diff --git a/Achievements/Achievement.cs b/Achievements/Achievement.cs index ef5dc0b..463e3a1 100644 --- a/Achievements/Achievement.cs +++ b/Achievements/Achievement.cs @@ -1,138 +1,138 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Achievements.Achievement -// 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 Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System.Collections.Generic; -using Terraria.Localization; -using Terraria.Social; - -namespace Terraria.Achievements -{ - [JsonObject] - public class Achievement - { - private static int _totalAchievements; - public readonly string Name; - public readonly LocalizedText FriendlyName; - public readonly LocalizedText Description; - public readonly int Id = Achievement._totalAchievements++; - private AchievementCategory _category; - private IAchievementTracker _tracker; - [JsonProperty("Conditions")] - private Dictionary _conditions = new Dictionary(); - private int _completedCount; - - public AchievementCategory Category => this._category; - - public event Achievement.AchievementCompleted OnCompleted; - - public bool HasTracker => this._tracker != null; - - public IAchievementTracker GetTracker() => this._tracker; - - public bool IsCompleted => this._completedCount == this._conditions.Count; - - public Achievement(string name) - { - this.Name = name; - this.FriendlyName = Language.GetText("Achievements." + name + "_Name"); - this.Description = Language.GetText("Achievements." + name + "_Description"); - } - - public void ClearProgress() - { - this._completedCount = 0; - foreach (KeyValuePair condition in this._conditions) - condition.Value.Clear(); - if (this._tracker == null) - return; - this._tracker.Clear(); - } - - public void Load(Dictionary conditions) - { - foreach (KeyValuePair condition in conditions) - { - AchievementCondition achievementCondition; - if (this._conditions.TryGetValue(condition.Key, out achievementCondition)) - { - achievementCondition.Load(condition.Value); - if (achievementCondition.IsCompleted) - ++this._completedCount; - } - } - if (this._tracker == null) - return; - this._tracker.Load(); - } - - public void AddCondition(AchievementCondition condition) - { - this._conditions[condition.Name] = condition; - condition.OnComplete += new AchievementCondition.AchievementUpdate(this.OnConditionComplete); - } - - private void OnConditionComplete(AchievementCondition condition) - { - ++this._completedCount; - if (this._completedCount != this._conditions.Count) - return; - if (this._tracker == null && SocialAPI.Achievements != null) - SocialAPI.Achievements.CompleteAchievement(this.Name); - if (this.OnCompleted == null) - return; - this.OnCompleted(this); - } - - private void UseTracker(IAchievementTracker tracker) - { - tracker.ReportAs("STAT_" + this.Name); - this._tracker = tracker; - } - - public void UseTrackerFromCondition(string conditionName) => this.UseTracker(this.GetConditionTracker(conditionName)); - - public void UseConditionsCompletedTracker() - { - ConditionsCompletedTracker completedTracker = new ConditionsCompletedTracker(); - foreach (KeyValuePair condition in this._conditions) - completedTracker.AddCondition(condition.Value); - this.UseTracker((IAchievementTracker) completedTracker); - } - - public void UseConditionsCompletedTracker(params string[] conditions) - { - ConditionsCompletedTracker completedTracker = new ConditionsCompletedTracker(); - for (int index = 0; index < conditions.Length; ++index) - { - string condition = conditions[index]; - completedTracker.AddCondition(this._conditions[condition]); - } - this.UseTracker((IAchievementTracker) completedTracker); - } - - public void ClearTracker() => this._tracker = (IAchievementTracker) null; - - private IAchievementTracker GetConditionTracker(string name) => this._conditions[name].GetAchievementTracker(); - - public void AddConditions(params AchievementCondition[] conditions) - { - for (int index = 0; index < conditions.Length; ++index) - this.AddCondition(conditions[index]); - } - - public AchievementCondition GetCondition(string conditionName) - { - AchievementCondition achievementCondition; - return this._conditions.TryGetValue(conditionName, out achievementCondition) ? achievementCondition : (AchievementCondition) null; - } - - public void SetCategory(AchievementCategory category) => this._category = category; - - public delegate void AchievementCompleted(Achievement achievement); - } -} +// Decompiled with JetBrains decompiler +// Type: Terraria.Achievements.Achievement +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 +// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe + +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using System.Collections.Generic; +using Terraria.Localization; +using Terraria.Social; + +namespace Terraria.Achievements +{ + [JsonObject] + public class Achievement + { + private static int _totalAchievements; + public readonly string Name; + public readonly LocalizedText FriendlyName; + public readonly LocalizedText Description; + public readonly int Id = Achievement._totalAchievements++; + private AchievementCategory _category; + private IAchievementTracker _tracker; + [JsonProperty("Conditions")] + private Dictionary _conditions = new Dictionary(); + private int _completedCount; + + public AchievementCategory Category => this._category; + + public event Achievement.AchievementCompleted OnCompleted; + + public bool HasTracker => this._tracker != null; + + public IAchievementTracker GetTracker() => this._tracker; + + public bool IsCompleted => this._completedCount == this._conditions.Count; + + public Achievement(string name) + { + this.Name = name; + this.FriendlyName = Language.GetText("Achievements." + name + "_Name"); + this.Description = Language.GetText("Achievements." + name + "_Description"); + } + + public void ClearProgress() + { + this._completedCount = 0; + foreach (KeyValuePair condition in this._conditions) + condition.Value.Clear(); + if (this._tracker == null) + return; + this._tracker.Clear(); + } + + public void Load(Dictionary conditions) + { + foreach (KeyValuePair condition in conditions) + { + AchievementCondition achievementCondition; + if (this._conditions.TryGetValue(condition.Key, out achievementCondition)) + { + achievementCondition.Load(condition.Value); + if (achievementCondition.IsCompleted) + ++this._completedCount; + } + } + if (this._tracker == null) + return; + this._tracker.Load(); + } + + public void AddCondition(AchievementCondition condition) + { + this._conditions[condition.Name] = condition; + condition.OnComplete += new AchievementCondition.AchievementUpdate(this.OnConditionComplete); + } + + private void OnConditionComplete(AchievementCondition condition) + { + ++this._completedCount; + if (this._completedCount != this._conditions.Count) + return; + if (this._tracker == null && SocialAPI.Achievements != null) + SocialAPI.Achievements.CompleteAchievement(this.Name); + if (this.OnCompleted == null) + return; + this.OnCompleted(this); + } + + private void UseTracker(IAchievementTracker tracker) + { + tracker.ReportAs("STAT_" + this.Name); + this._tracker = tracker; + } + + public void UseTrackerFromCondition(string conditionName) => this.UseTracker(this.GetConditionTracker(conditionName)); + + public void UseConditionsCompletedTracker() + { + ConditionsCompletedTracker completedTracker = new ConditionsCompletedTracker(); + foreach (KeyValuePair condition in this._conditions) + completedTracker.AddCondition(condition.Value); + this.UseTracker((IAchievementTracker) completedTracker); + } + + public void UseConditionsCompletedTracker(params string[] conditions) + { + ConditionsCompletedTracker completedTracker = new ConditionsCompletedTracker(); + for (int index = 0; index < conditions.Length; ++index) + { + string condition = conditions[index]; + completedTracker.AddCondition(this._conditions[condition]); + } + this.UseTracker((IAchievementTracker) completedTracker); + } + + public void ClearTracker() => this._tracker = (IAchievementTracker) null; + + private IAchievementTracker GetConditionTracker(string name) => this._conditions[name].GetAchievementTracker(); + + public void AddConditions(params AchievementCondition[] conditions) + { + for (int index = 0; index < conditions.Length; ++index) + this.AddCondition(conditions[index]); + } + + public AchievementCondition GetCondition(string conditionName) + { + AchievementCondition achievementCondition; + return this._conditions.TryGetValue(conditionName, out achievementCondition) ? achievementCondition : (AchievementCondition) null; + } + + public void SetCategory(AchievementCategory category) => this._category = category; + + public delegate void AchievementCompleted(Achievement achievement); + } +} diff --git a/Achievements/AchievementCategory.cs b/Achievements/AchievementCategory.cs index 4535255..91259b6 100644 --- a/Achievements/AchievementCategory.cs +++ b/Achievements/AchievementCategory.cs @@ -1,17 +1,17 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Achievements.AchievementCategory -// 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.Achievements -{ - public enum AchievementCategory - { - None = -1, // 0xFFFFFFFF - Slayer = 0, - Collector = 1, - Explorer = 2, - Challenger = 3, - } -} +// Decompiled with JetBrains decompiler +// Type: Terraria.Achievements.AchievementCategory +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 +// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe + +namespace Terraria.Achievements +{ + public enum AchievementCategory + { + None = -1, // 0xFFFFFFFF + Slayer = 0, + Collector = 1, + Explorer = 2, + Challenger = 3, + } +} diff --git a/Achievements/AchievementCondition.cs b/Achievements/AchievementCondition.cs index dc1f445..23d82aa 100644 --- a/Achievements/AchievementCondition.cs +++ b/Achievements/AchievementCondition.cs @@ -1,51 +1,51 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Achievements.AchievementCondition -// 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 Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -namespace Terraria.Achievements -{ - [JsonObject] - public abstract class AchievementCondition - { - public readonly string Name; - protected IAchievementTracker _tracker; - [JsonProperty("Completed")] - private bool _isCompleted; - - public event AchievementCondition.AchievementUpdate OnComplete; - - public bool IsCompleted => this._isCompleted; - - protected AchievementCondition(string name) => this.Name = name; - - public virtual void Load(JObject state) => this._isCompleted = JToken.op_Explicit(state["Completed"]); - - public virtual void Clear() => this._isCompleted = false; - - public virtual void Complete() - { - if (this._isCompleted) - return; - this._isCompleted = true; - if (this.OnComplete == null) - return; - this.OnComplete(this); - } - - protected virtual IAchievementTracker CreateAchievementTracker() => (IAchievementTracker) null; - - public IAchievementTracker GetAchievementTracker() - { - if (this._tracker == null) - this._tracker = this.CreateAchievementTracker(); - return this._tracker; - } - - public delegate void AchievementUpdate(AchievementCondition condition); - } -} +// Decompiled with JetBrains decompiler +// Type: Terraria.Achievements.AchievementCondition +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 +// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe + +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +namespace Terraria.Achievements +{ + [JsonObject] + public abstract class AchievementCondition + { + public readonly string Name; + protected IAchievementTracker _tracker; + [JsonProperty("Completed")] + private bool _isCompleted; + + public event AchievementCondition.AchievementUpdate OnComplete; + + public bool IsCompleted => this._isCompleted; + + protected AchievementCondition(string name) => this.Name = name; + + public virtual void Load(JObject state) => this._isCompleted = JToken.op_Explicit(state["Completed"]); + + public virtual void Clear() => this._isCompleted = false; + + public virtual void Complete() + { + if (this._isCompleted) + return; + this._isCompleted = true; + if (this.OnComplete == null) + return; + this.OnComplete(this); + } + + protected virtual IAchievementTracker CreateAchievementTracker() => (IAchievementTracker) null; + + public IAchievementTracker GetAchievementTracker() + { + if (this._tracker == null) + this._tracker = this.CreateAchievementTracker(); + return this._tracker; + } + + public delegate void AchievementUpdate(AchievementCondition condition); + } +} diff --git a/Achievements/AchievementManager.cs b/Achievements/AchievementManager.cs index dc4f593..c7f48b2 100644 --- a/Achievements/AchievementManager.cs +++ b/Achievements/AchievementManager.cs @@ -1,190 +1,177 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Achievements.AchievementManager -// 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 Newtonsoft.Json; -using Newtonsoft.Json.Bson; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using Terraria.Social; -using Terraria.UI; -using Terraria.Utilities; - -namespace Terraria.Achievements -{ - public class AchievementManager - { - private string _savePath; - private bool _isCloudSave; - private Dictionary _achievements = new Dictionary(); - private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings(); - private byte[] _cryptoKey; - private Dictionary _achievementIconIndexes = new Dictionary(); - private static object _ioLock = new object(); - - public event Achievement.AchievementCompleted OnAchievementCompleted; - - public AchievementManager() - { - if (SocialAPI.Achievements != null) - { - this._savePath = SocialAPI.Achievements.GetSavePath(); - this._isCloudSave = true; - this._cryptoKey = SocialAPI.Achievements.GetEncryptionKey(); - } - else - { - this._savePath = Main.SavePath + Path.DirectorySeparatorChar.ToString() + "achievements.dat"; - this._isCloudSave = false; - this._cryptoKey = Encoding.ASCII.GetBytes("RELOGIC-TERRARIA"); - } - } - - public void Save() => FileUtilities.ProtectedInvoke((Action) (() => this.Save(this._savePath, this._isCloudSave))); - - private void Save(string path, bool cloud) - { - lock (AchievementManager._ioLock) - { - if (SocialAPI.Achievements != null) - SocialAPI.Achievements.StoreStats(); - try - { - using (MemoryStream memoryStream = new MemoryStream()) - { - using (CryptoStream cryptoStream = new CryptoStream((Stream) memoryStream, new RijndaelManaged().CreateEncryptor(this._cryptoKey, this._cryptoKey), CryptoStreamMode.Write)) - { - using (BsonWriter bsonWriter = new BsonWriter((Stream) cryptoStream)) - { - JsonSerializer.Create(this._serializerSettings).Serialize((JsonWriter) bsonWriter, (object) this._achievements); - ((JsonWriter) bsonWriter).Flush(); - cryptoStream.FlushFinalBlock(); - FileUtilities.WriteAllBytes(path, memoryStream.ToArray(), cloud); - } - } - } - } - catch (Exception ex) - { - string savePath = this._savePath; - FancyErrorPrinter.ShowFileSavingFailError(ex, savePath); - } - } - } - - public List CreateAchievementsList() => this._achievements.Values.ToList(); - - public void Load() => this.Load(this._savePath, this._isCloudSave); - - private void Load(string path, bool cloud) - { - bool flag = false; - lock (AchievementManager._ioLock) - { - if (!FileUtilities.Exists(path, cloud)) - return; - byte[] buffer = FileUtilities.ReadAllBytes(path, cloud); - Dictionary dictionary = (Dictionary) null; - try - { - using (MemoryStream memoryStream = new MemoryStream(buffer)) - { - using (CryptoStream cryptoStream = new CryptoStream((Stream) memoryStream, new RijndaelManaged().CreateDecryptor(this._cryptoKey, this._cryptoKey), CryptoStreamMode.Read)) - { - using (BsonReader bsonReader = new BsonReader((Stream) cryptoStream)) - dictionary = JsonSerializer.Create(this._serializerSettings).Deserialize>((JsonReader) bsonReader); - } - } - } - catch (Exception ex) - { - FileUtilities.Delete(path, cloud); - return; - } - if (dictionary == null) - return; - foreach (KeyValuePair keyValuePair in dictionary) - { - if (this._achievements.ContainsKey(keyValuePair.Key)) - this._achievements[keyValuePair.Key].Load(keyValuePair.Value.Conditions); - } - if (SocialAPI.Achievements != null) - { - foreach (KeyValuePair achievement in this._achievements) - { - if (achievement.Value.IsCompleted && !SocialAPI.Achievements.IsAchievementCompleted(achievement.Key)) - { - flag = true; - achievement.Value.ClearProgress(); - } - } - } - } - if (!flag) - return; - this.Save(); - } - - public void ClearAll() - { - if (SocialAPI.Achievements != null) - return; - foreach (KeyValuePair achievement in this._achievements) - achievement.Value.ClearProgress(); - this.Save(); - } - - private void AchievementCompleted(Achievement achievement) - { - this.Save(); - if (this.OnAchievementCompleted == null) - return; - this.OnAchievementCompleted(achievement); - } - - public void Register(Achievement achievement) - { - this._achievements.Add(achievement.Name, achievement); - achievement.OnCompleted += new Achievement.AchievementCompleted(this.AchievementCompleted); - } - - public void RegisterIconIndex(string achievementName, int iconIndex) => this._achievementIconIndexes.Add(achievementName, iconIndex); - - public void RegisterAchievementCategory(string achievementName, AchievementCategory category) => this._achievements[achievementName].SetCategory(category); - - public Achievement GetAchievement(string achievementName) - { - Achievement achievement; - return this._achievements.TryGetValue(achievementName, out achievement) ? achievement : (Achievement) null; - } - - public T GetCondition(string achievementName, string conditionName) where T : AchievementCondition => this.GetCondition(achievementName, conditionName) as T; - - public AchievementCondition GetCondition( - string achievementName, - string conditionName) - { - Achievement achievement; - return this._achievements.TryGetValue(achievementName, out achievement) ? achievement.GetCondition(conditionName) : (AchievementCondition) null; - } - - public int GetIconIndex(string achievementName) - { - int num; - return this._achievementIconIndexes.TryGetValue(achievementName, out num) ? num : 0; - } - - private class StoredAchievement - { - [JsonProperty] - public Dictionary Conditions; - } - } -} +// Decompiled with JetBrains decompiler +// Type: Terraria.Achievements.AchievementManager +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 +// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe + +using Newtonsoft.Json; +using Newtonsoft.Json.Bson; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Security.Cryptography; +using System.Text; +using Terraria.Social; +using Terraria.Utilities; + +namespace Terraria.Achievements +{ + public class AchievementManager + { + private string _savePath; + private bool _isCloudSave; + private Dictionary _achievements = new Dictionary(); + private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings(); + private byte[] _cryptoKey; + private Dictionary _achievementIconIndexes = new Dictionary(); + private static object _ioLock = new object(); + + public event Achievement.AchievementCompleted OnAchievementCompleted; + + public AchievementManager() + { + if (SocialAPI.Achievements != null) + { + this._savePath = SocialAPI.Achievements.GetSavePath(); + this._isCloudSave = true; + this._cryptoKey = SocialAPI.Achievements.GetEncryptionKey(); + } + else + { + this._savePath = Main.SavePath + Path.DirectorySeparatorChar.ToString() + "achievements.dat"; + this._isCloudSave = false; + this._cryptoKey = Encoding.ASCII.GetBytes("RELOGIC-TERRARIA"); + } + } + + public void Save() => this.Save(this._savePath, this._isCloudSave); + + private void Save(string path, bool cloud) + { + lock (AchievementManager._ioLock) + { + if (SocialAPI.Achievements != null) + SocialAPI.Achievements.StoreStats(); + try + { + using (MemoryStream memoryStream = new MemoryStream()) + { + using (CryptoStream cryptoStream = new CryptoStream((Stream) memoryStream, new RijndaelManaged().CreateEncryptor(this._cryptoKey, this._cryptoKey), CryptoStreamMode.Write)) + { + using (BsonWriter bsonWriter = new BsonWriter((Stream) cryptoStream)) + { + JsonSerializer.Create(this._serializerSettings).Serialize((JsonWriter) bsonWriter, (object) this._achievements); + ((JsonWriter) bsonWriter).Flush(); + cryptoStream.FlushFinalBlock(); + FileUtilities.WriteAllBytes(path, memoryStream.ToArray(), cloud); + } + } + } + } + catch (Exception ex) + { + } + } + } + + public List CreateAchievementsList() => this._achievements.Values.ToList(); + + public void Load() => this.Load(this._savePath, this._isCloudSave); + + private void Load(string path, bool cloud) + { + bool flag = false; + lock (AchievementManager._ioLock) + { + if (!FileUtilities.Exists(path, cloud)) + return; + byte[] buffer = FileUtilities.ReadAllBytes(path, cloud); + Dictionary dictionary = (Dictionary) null; + try + { + using (MemoryStream memoryStream = new MemoryStream(buffer)) + { + using (CryptoStream cryptoStream = new CryptoStream((Stream) memoryStream, new RijndaelManaged().CreateDecryptor(this._cryptoKey, this._cryptoKey), CryptoStreamMode.Read)) + { + using (BsonReader bsonReader = new BsonReader((Stream) cryptoStream)) + dictionary = JsonSerializer.Create(this._serializerSettings).Deserialize>((JsonReader) bsonReader); + } + } + } + catch (Exception ex) + { + FileUtilities.Delete(path, cloud); + return; + } + if (dictionary == null) + return; + foreach (KeyValuePair keyValuePair in dictionary) + { + if (this._achievements.ContainsKey(keyValuePair.Key)) + this._achievements[keyValuePair.Key].Load(keyValuePair.Value.Conditions); + } + if (SocialAPI.Achievements != null) + { + foreach (KeyValuePair achievement in this._achievements) + { + if (achievement.Value.IsCompleted && !SocialAPI.Achievements.IsAchievementCompleted(achievement.Key)) + { + flag = true; + achievement.Value.ClearProgress(); + } + } + } + } + if (!flag) + return; + this.Save(); + } + + private void AchievementCompleted(Achievement achievement) + { + this.Save(); + if (this.OnAchievementCompleted == null) + return; + this.OnAchievementCompleted(achievement); + } + + public void Register(Achievement achievement) + { + this._achievements.Add(achievement.Name, achievement); + achievement.OnCompleted += new Achievement.AchievementCompleted(this.AchievementCompleted); + } + + public void RegisterIconIndex(string achievementName, int iconIndex) => this._achievementIconIndexes.Add(achievementName, iconIndex); + + public void RegisterAchievementCategory(string achievementName, AchievementCategory category) => this._achievements[achievementName].SetCategory(category); + + public Achievement GetAchievement(string achievementName) + { + Achievement achievement; + return this._achievements.TryGetValue(achievementName, out achievement) ? achievement : (Achievement) null; + } + + public T GetCondition(string achievementName, string conditionName) where T : AchievementCondition => this.GetCondition(achievementName, conditionName) as T; + + public AchievementCondition GetCondition( + string achievementName, + string conditionName) + { + Achievement achievement; + return this._achievements.TryGetValue(achievementName, out achievement) ? achievement.GetCondition(conditionName) : (AchievementCondition) null; + } + + public int GetIconIndex(string achievementName) + { + int num; + return this._achievementIconIndexes.TryGetValue(achievementName, out num) ? num : 0; + } + + private class StoredAchievement + { + public Dictionary Conditions; + } + } +} diff --git a/Achievements/AchievementTracker`1.cs b/Achievements/AchievementTracker`1.cs index 31754a5..8daf3e3 100644 --- a/Achievements/AchievementTracker`1.cs +++ b/Achievements/AchievementTracker`1.cs @@ -1,56 +1,56 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Achievements.AchievementTracker`1 -// 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 Terraria.Social; - -namespace Terraria.Achievements -{ - public abstract class AchievementTracker : IAchievementTracker - { - protected T _value; - protected T _maxValue; - protected string _name; - private TrackerType _type; - - public T Value => this._value; - - public T MaxValue => this._maxValue; - - protected AchievementTracker(TrackerType type) => this._type = type; - - void IAchievementTracker.ReportAs(string name) => this._name = name; - - TrackerType IAchievementTracker.GetTrackerType() => this._type; - - void IAchievementTracker.Clear() => this.SetValue(default (T)); - - public void SetValue(T newValue, bool reportUpdate = true) - { - if (newValue.Equals((object) this._value)) - return; - this._value = newValue; - if (!reportUpdate) - return; - this.ReportUpdate(); - if (!this._value.Equals((object) this._maxValue)) - return; - this.OnComplete(); - } - - public abstract void ReportUpdate(); - - protected abstract void Load(); - - void IAchievementTracker.Load() => this.Load(); - - protected void OnComplete() - { - if (SocialAPI.Achievements == null) - return; - SocialAPI.Achievements.StoreStats(); - } - } -} +// Decompiled with JetBrains decompiler +// Type: Terraria.Achievements.AchievementTracker`1 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 +// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe + +using Terraria.Social; + +namespace Terraria.Achievements +{ + public abstract class AchievementTracker : IAchievementTracker + { + protected T _value; + protected T _maxValue; + protected string _name; + private TrackerType _type; + + public T Value => this._value; + + public T MaxValue => this._maxValue; + + protected AchievementTracker(TrackerType type) => this._type = type; + + void IAchievementTracker.ReportAs(string name) => this._name = name; + + TrackerType IAchievementTracker.GetTrackerType() => this._type; + + void IAchievementTracker.Clear() => this.SetValue(default (T)); + + public void SetValue(T newValue, bool reportUpdate = true) + { + if (newValue.Equals((object) this._value)) + return; + this._value = newValue; + if (!reportUpdate) + return; + this.ReportUpdate(); + if (!this._value.Equals((object) this._maxValue)) + return; + this.OnComplete(); + } + + public abstract void ReportUpdate(); + + protected abstract void Load(); + + void IAchievementTracker.Load() => this.Load(); + + protected void OnComplete() + { + if (SocialAPI.Achievements == null) + return; + SocialAPI.Achievements.StoreStats(); + } + } +} diff --git a/Achievements/ConditionFloatTracker.cs b/Achievements/ConditionFloatTracker.cs index 04e5803..2e20a15 100644 --- a/Achievements/ConditionFloatTracker.cs +++ b/Achievements/ConditionFloatTracker.cs @@ -1,35 +1,35 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Achievements.ConditionFloatTracker -// 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 Terraria.Social; - -namespace Terraria.Achievements -{ - public class ConditionFloatTracker : AchievementTracker - { - public ConditionFloatTracker(float maxValue) - : base(TrackerType.Float) - { - this._maxValue = maxValue; - } - - public ConditionFloatTracker() - : base(TrackerType.Float) - { - } - - public override void ReportUpdate() - { - if (SocialAPI.Achievements == null || this._name == null) - return; - SocialAPI.Achievements.UpdateFloatStat(this._name, this._value); - } - - protected override void Load() - { - } - } -} +// Decompiled with JetBrains decompiler +// Type: Terraria.Achievements.ConditionFloatTracker +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 +// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe + +using Terraria.Social; + +namespace Terraria.Achievements +{ + public class ConditionFloatTracker : AchievementTracker + { + public ConditionFloatTracker(float maxValue) + : base(TrackerType.Float) + { + this._maxValue = maxValue; + } + + public ConditionFloatTracker() + : base(TrackerType.Float) + { + } + + public override void ReportUpdate() + { + if (SocialAPI.Achievements == null || this._name == null) + return; + SocialAPI.Achievements.UpdateFloatStat(this._name, this._value); + } + + protected override void Load() + { + } + } +} diff --git a/Achievements/ConditionIntTracker.cs b/Achievements/ConditionIntTracker.cs index 97c3e48..b2aa48f 100644 --- a/Achievements/ConditionIntTracker.cs +++ b/Achievements/ConditionIntTracker.cs @@ -1,35 +1,35 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Achievements.ConditionIntTracker -// 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 Terraria.Social; - -namespace Terraria.Achievements -{ - public class ConditionIntTracker : AchievementTracker - { - public ConditionIntTracker() - : base(TrackerType.Int) - { - } - - public ConditionIntTracker(int maxValue) - : base(TrackerType.Int) - { - this._maxValue = maxValue; - } - - public override void ReportUpdate() - { - if (SocialAPI.Achievements == null || this._name == null) - return; - SocialAPI.Achievements.UpdateIntStat(this._name, this._value); - } - - protected override void Load() - { - } - } -} +// Decompiled with JetBrains decompiler +// Type: Terraria.Achievements.ConditionIntTracker +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 +// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe + +using Terraria.Social; + +namespace Terraria.Achievements +{ + public class ConditionIntTracker : AchievementTracker + { + public ConditionIntTracker() + : base(TrackerType.Int) + { + } + + public ConditionIntTracker(int maxValue) + : base(TrackerType.Int) + { + this._maxValue = maxValue; + } + + public override void ReportUpdate() + { + if (SocialAPI.Achievements == null || this._name == null) + return; + SocialAPI.Achievements.UpdateIntStat(this._name, this._value); + } + + protected override void Load() + { + } + } +} diff --git a/Achievements/ConditionsCompletedTracker.cs b/Achievements/ConditionsCompletedTracker.cs index c36f091..d9ebb00 100644 --- a/Achievements/ConditionsCompletedTracker.cs +++ b/Achievements/ConditionsCompletedTracker.cs @@ -1,34 +1,34 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Achievements.ConditionsCompletedTracker -// 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; - -namespace Terraria.Achievements -{ - public class ConditionsCompletedTracker : ConditionIntTracker - { - private List _conditions = new List(); - - public void AddCondition(AchievementCondition condition) - { - ++this._maxValue; - condition.OnComplete += new AchievementCondition.AchievementUpdate(this.OnConditionCompleted); - this._conditions.Add(condition); - } - - private void OnConditionCompleted(AchievementCondition condition) => this.SetValue(Math.Min(this._value + 1, this._maxValue)); - - protected override void Load() - { - for (int index = 0; index < this._conditions.Count; ++index) - { - if (this._conditions[index].IsCompleted) - ++this._value; - } - } - } -} +// Decompiled with JetBrains decompiler +// Type: Terraria.Achievements.ConditionsCompletedTracker +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 +// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe + +using System; +using System.Collections.Generic; + +namespace Terraria.Achievements +{ + public class ConditionsCompletedTracker : ConditionIntTracker + { + private List _conditions = new List(); + + public void AddCondition(AchievementCondition condition) + { + ++this._maxValue; + condition.OnComplete += new AchievementCondition.AchievementUpdate(this.OnConditionCompleted); + this._conditions.Add(condition); + } + + private void OnConditionCompleted(AchievementCondition condition) => this.SetValue(Math.Min(this._value + 1, this._maxValue)); + + protected override void Load() + { + for (int index = 0; index < this._conditions.Count; ++index) + { + if (this._conditions[index].IsCompleted) + ++this._value; + } + } + } +} diff --git a/Achievements/IAchievementTracker.cs b/Achievements/IAchievementTracker.cs index ec9eb1c..14a4735 100644 --- a/Achievements/IAchievementTracker.cs +++ b/Achievements/IAchievementTracker.cs @@ -1,19 +1,19 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Achievements.IAchievementTracker -// 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.Achievements -{ - public interface IAchievementTracker - { - void ReportAs(string name); - - TrackerType GetTrackerType(); - - void Load(); - - void Clear(); - } -} +// Decompiled with JetBrains decompiler +// Type: Terraria.Achievements.IAchievementTracker +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 +// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe + +namespace Terraria.Achievements +{ + public interface IAchievementTracker + { + void ReportAs(string name); + + TrackerType GetTrackerType(); + + void Load(); + + void Clear(); + } +} diff --git a/Achievements/TrackerType.cs b/Achievements/TrackerType.cs index 4e5c9cf..80615be 100644 --- a/Achievements/TrackerType.cs +++ b/Achievements/TrackerType.cs @@ -1,14 +1,14 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Achievements.TrackerType -// 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.Achievements -{ - public enum TrackerType - { - Float, - Int, - } -} +// Decompiled with JetBrains decompiler +// Type: Terraria.Achievements.TrackerType +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 +// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe + +namespace Terraria.Achievements +{ + public enum TrackerType + { + Float, + Int, + } +} diff --git a/Animation.cs b/Animation.cs index 82c4281..54a01c8 100644 --- a/Animation.cs +++ b/Animation.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Animation -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System.Collections.Generic; @@ -61,20 +61,6 @@ namespace Terraria this._frameData = new int[5]{ 1, 2, 2, 2, 1 }; this._frameMax = this._frameData.Length; break; - case 3: - this._frameMax = 5; - this._frameCounterMax = 5; - this._frameData = new int[this._frameMax]; - for (int index = 0; index < this._frameMax; ++index) - this._frameData[index] = index; - break; - case 4: - this._frameMax = 3; - this._frameCounterMax = 5; - this._frameData = new int[this._frameMax]; - for (int index = 0; index < this._frameMax; ++index) - this._frameData[index] = 9 + index; - break; } } diff --git a/AssemblyInfo.cs b/AssemblyInfo.cs index 221eda4..51ca452 100644 --- a/AssemblyInfo.cs +++ b/AssemblyInfo.cs @@ -8,10 +8,10 @@ using System.Security.Permissions; [assembly: AssemblyProduct("Terraria")] [assembly: AssemblyDescription("")] [assembly: AssemblyCompany("Re-Logic")] -[assembly: AssemblyCopyright("Copyright © 2020 Re-Logic")] +[assembly: AssemblyCopyright("Copyright © Re-Logic 2017")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("f571b16a-2c9b-44ab-b115-7c762c9e4e7e")] -[assembly: AssemblyFileVersion("1.4.0.5")] -[assembly: AssemblyVersion("1.4.0.5")] +[assembly: AssemblyFileVersion("1.3.5.3")] +[assembly: AssemblyVersion("1.3.5.3")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] diff --git a/Audio/ActiveSound.cs b/Audio/ActiveSound.cs index 84023d3..7aee544 100644 --- a/Audio/ActiveSound.cs +++ b/Audio/ActiveSound.cs @@ -1,100 +1,101 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Audio.ActiveSound -// 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; -using Microsoft.Xna.Framework.Audio; - -namespace Terraria.Audio -{ - public class ActiveSound - { - public readonly bool IsGlobal; - public Vector2 Position; - public float Volume; - - public SoundEffectInstance Sound { get; private set; } - - public SoundStyle Style { get; private set; } - - public bool IsPlaying => this.Sound.State == SoundState.Playing; - - public ActiveSound(SoundStyle style, Vector2 position) - { - this.Position = position; - this.Volume = 1f; - this.IsGlobal = false; - this.Style = style; - this.Play(); - } - - public ActiveSound(SoundStyle style) - { - this.Position = Vector2.Zero; - this.Volume = 1f; - this.IsGlobal = true; - this.Style = style; - this.Play(); - } - - private void Play() - { - SoundEffectInstance instance = this.Style.GetRandomSound().CreateInstance(); - instance.Pitch += this.Style.GetRandomPitch(); - instance.Play(); - SoundInstanceGarbageCollector.Track(instance); - this.Sound = instance; - this.Update(); - } - - public void Stop() - { - if (this.Sound == null) - return; - this.Sound.Stop(); - } - - public void Pause() - { - if (this.Sound == null || this.Sound.State != SoundState.Playing) - return; - this.Sound.Pause(); - } - - public void Resume() - { - if (this.Sound == null || this.Sound.State != SoundState.Paused) - return; - this.Sound.Resume(); - } - - public void Update() - { - if (this.Sound == null) - return; - Vector2 vector2 = Main.screenPosition + new Vector2((float) (Main.screenWidth / 2), (float) (Main.screenHeight / 2)); - float num1 = 1f; - if (!this.IsGlobal) - { - this.Sound.Pan = MathHelper.Clamp((float) (((double) this.Position.X - (double) vector2.X) / ((double) Main.screenWidth * 0.5)), -1f, 1f); - num1 = (float) (1.0 - (double) Vector2.Distance(this.Position, vector2) / ((double) Main.screenWidth * 1.5)); - } - float num2 = num1 * (this.Style.Volume * this.Volume); - switch (this.Style.Type) - { - case SoundType.Sound: - num2 *= Main.soundVolume; - break; - case SoundType.Ambient: - num2 *= Main.ambientVolume; - break; - case SoundType.Music: - num2 *= Main.musicVolume; - break; - } - this.Sound.Volume = MathHelper.Clamp(num2, 0.0f, 1f); - } - } -} +// Decompiled with JetBrains decompiler +// Type: Terraria.Audio.ActiveSound +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 +// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe + +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Audio; + +namespace Terraria.Audio +{ + public class ActiveSound + { + private SoundEffectInstance _sound; + public readonly bool IsGlobal; + public Vector2 Position; + public float Volume; + private SoundStyle _style; + + public SoundEffectInstance Sound => this._sound; + + public SoundStyle Style => this._style; + + public bool IsPlaying => this.Sound.State == SoundState.Playing; + + public ActiveSound(SoundStyle style, Vector2 position) + { + this.Position = position; + this.Volume = 1f; + this.IsGlobal = false; + this._style = style; + this.Play(); + } + + public ActiveSound(SoundStyle style) + { + this.Position = Vector2.Zero; + this.Volume = 1f; + this.IsGlobal = true; + this._style = style; + this.Play(); + } + + private void Play() + { + SoundEffectInstance instance = this._style.GetRandomSound().CreateInstance(); + instance.Pitch += this._style.GetRandomPitch(); + Main.PlaySoundInstance(instance); + this._sound = instance; + this.Update(); + } + + public void Stop() + { + if (this._sound == null) + return; + this._sound.Stop(); + } + + public void Pause() + { + if (this._sound == null || this._sound.State != SoundState.Playing) + return; + this._sound.Pause(); + } + + public void Resume() + { + if (this._sound == null || this._sound.State != SoundState.Paused) + return; + this._sound.Resume(); + } + + public void Update() + { + if (this._sound == null) + return; + Vector2 vector2 = Main.screenPosition + new Vector2((float) (Main.screenWidth / 2), (float) (Main.screenHeight / 2)); + float num1 = 1f; + if (!this.IsGlobal) + { + this.Sound.Pan = MathHelper.Clamp((float) (((double) this.Position.X - (double) vector2.X) / ((double) Main.screenWidth * 0.5)), -1f, 1f); + num1 = (float) (1.0 - (double) Vector2.Distance(this.Position, vector2) / ((double) Main.screenWidth * 1.5)); + } + float num2 = num1 * (this._style.Volume * this.Volume); + switch (this._style.Type) + { + case SoundType.Sound: + num2 *= Main.soundVolume; + break; + case SoundType.Ambient: + num2 *= Main.ambientVolume; + break; + case SoundType.Music: + num2 *= Main.musicVolume; + break; + } + this.Sound.Volume = MathHelper.Clamp(num2, 0.0f, 1f); + } + } +} diff --git a/Audio/CustomSoundStyle.cs b/Audio/CustomSoundStyle.cs index 45869b1..6985726 100644 --- a/Audio/CustomSoundStyle.cs +++ b/Audio/CustomSoundStyle.cs @@ -1,41 +1,41 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Audio.CustomSoundStyle -// 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.Audio; -using Terraria.Utilities; - -namespace Terraria.Audio -{ - public class CustomSoundStyle : SoundStyle - { - private static readonly UnifiedRandom Random = new UnifiedRandom(); - private readonly SoundEffect[] _soundEffects; - - public override bool IsTrackable => true; - - public CustomSoundStyle( - SoundEffect soundEffect, - SoundType type = SoundType.Sound, - float volume = 1f, - float pitchVariance = 0.0f) - : base(volume, pitchVariance, type) - { - this._soundEffects = new SoundEffect[1]{ soundEffect }; - } - - public CustomSoundStyle( - SoundEffect[] soundEffects, - SoundType type = SoundType.Sound, - float volume = 1f, - float pitchVariance = 0.0f) - : base(volume, pitchVariance, type) - { - this._soundEffects = soundEffects; - } - - public override SoundEffect GetRandomSound() => this._soundEffects[CustomSoundStyle.Random.Next(this._soundEffects.Length)]; - } -} +// Decompiled with JetBrains decompiler +// Type: Terraria.Audio.CustomSoundStyle +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 +// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe + +using Microsoft.Xna.Framework.Audio; +using Terraria.Utilities; + +namespace Terraria.Audio +{ + public class CustomSoundStyle : SoundStyle + { + private static UnifiedRandom _random = new UnifiedRandom(); + private SoundEffect[] _soundEffects; + + public override bool IsTrackable => true; + + public CustomSoundStyle( + SoundEffect soundEffect, + SoundType type = SoundType.Sound, + float volume = 1f, + float pitchVariance = 0.0f) + : base(volume, pitchVariance, type) + { + this._soundEffects = new SoundEffect[1]{ soundEffect }; + } + + public CustomSoundStyle( + SoundEffect[] soundEffects, + SoundType type = SoundType.Sound, + float volume = 1f, + float pitchVariance = 0.0f) + : base(volume, pitchVariance, type) + { + this._soundEffects = soundEffects; + } + + public override SoundEffect GetRandomSound() => this._soundEffects[CustomSoundStyle._random.Next(this._soundEffects.Length)]; + } +} diff --git a/Audio/LegacySoundPlayer.cs b/Audio/LegacySoundPlayer.cs deleted file mode 100644 index 701db68..0000000 --- a/Audio/LegacySoundPlayer.cs +++ /dev/null @@ -1,996 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Audio.LegacySoundPlayer -// 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; -using Microsoft.Xna.Framework.Audio; -using ReLogic.Content; -using ReLogic.Utilities; -using System; -using System.IO; -using Terraria.ID; - -namespace Terraria.Audio -{ - public class LegacySoundPlayer - { - private Asset[] _soundDrip = new Asset[3]; - private SoundEffectInstance[] _soundInstanceDrip = new SoundEffectInstance[3]; - private Asset[] _soundLiquid = new Asset[2]; - private SoundEffectInstance[] _soundInstanceLiquid = new SoundEffectInstance[2]; - private Asset[] _soundMech = new Asset[1]; - private SoundEffectInstance[] _soundInstanceMech = new SoundEffectInstance[1]; - private Asset[] _soundDig = new Asset[3]; - private SoundEffectInstance[] _soundInstanceDig = new SoundEffectInstance[3]; - private Asset[] _soundThunder = new Asset[7]; - private SoundEffectInstance[] _soundInstanceThunder = new SoundEffectInstance[7]; - private Asset[] _soundResearch = new Asset[4]; - private SoundEffectInstance[] _soundInstanceResearch = new SoundEffectInstance[4]; - private Asset[] _soundTink = new Asset[3]; - private SoundEffectInstance[] _soundInstanceTink = new SoundEffectInstance[3]; - private Asset[] _soundCoin = new Asset[5]; - private SoundEffectInstance[] _soundInstanceCoin = new SoundEffectInstance[5]; - private Asset[] _soundPlayerHit = new Asset[3]; - private SoundEffectInstance[] _soundInstancePlayerHit = new SoundEffectInstance[3]; - private Asset[] _soundFemaleHit = new Asset[3]; - private SoundEffectInstance[] _soundInstanceFemaleHit = new SoundEffectInstance[3]; - private Asset _soundPlayerKilled; - private SoundEffectInstance _soundInstancePlayerKilled; - private Asset _soundGrass; - private SoundEffectInstance _soundInstanceGrass; - private Asset _soundGrab; - private SoundEffectInstance _soundInstanceGrab; - private Asset _soundPixie; - private SoundEffectInstance _soundInstancePixie; - private Asset[] _soundItem = new Asset[(int) SoundID.ItemSoundCount]; - private SoundEffectInstance[] _soundInstanceItem = new SoundEffectInstance[(int) SoundID.ItemSoundCount]; - private Asset[] _soundNpcHit = new Asset[58]; - private SoundEffectInstance[] _soundInstanceNpcHit = new SoundEffectInstance[58]; - private Asset[] _soundNpcKilled = new Asset[(int) SoundID.NPCDeathCount]; - private SoundEffectInstance[] _soundInstanceNpcKilled = new SoundEffectInstance[(int) SoundID.NPCDeathCount]; - private SoundEffectInstance _soundInstanceMoonlordCry; - private Asset _soundDoorOpen; - private SoundEffectInstance _soundInstanceDoorOpen; - private Asset _soundDoorClosed; - private SoundEffectInstance _soundInstanceDoorClosed; - private Asset _soundMenuOpen; - private SoundEffectInstance _soundInstanceMenuOpen; - private Asset _soundMenuClose; - private SoundEffectInstance _soundInstanceMenuClose; - private Asset _soundMenuTick; - private SoundEffectInstance _soundInstanceMenuTick; - private Asset _soundShatter; - private SoundEffectInstance _soundInstanceShatter; - private Asset _soundCamera; - private SoundEffectInstance _soundInstanceCamera; - private Asset[] _soundZombie = new Asset[118]; - private SoundEffectInstance[] _soundInstanceZombie = new SoundEffectInstance[118]; - private Asset[] _soundRoar = new Asset[3]; - private SoundEffectInstance[] _soundInstanceRoar = new SoundEffectInstance[3]; - private Asset[] _soundSplash = new Asset[2]; - private SoundEffectInstance[] _soundInstanceSplash = new SoundEffectInstance[2]; - private Asset _soundDoubleJump; - private SoundEffectInstance _soundInstanceDoubleJump; - private Asset _soundRun; - private SoundEffectInstance _soundInstanceRun; - private Asset _soundCoins; - private SoundEffectInstance _soundInstanceCoins; - private Asset _soundUnlock; - private SoundEffectInstance _soundInstanceUnlock; - private Asset _soundChat; - private SoundEffectInstance _soundInstanceChat; - private Asset _soundMaxMana; - private SoundEffectInstance _soundInstanceMaxMana; - private Asset _soundDrown; - private SoundEffectInstance _soundInstanceDrown; - private Asset[] _trackableSounds; - private SoundEffectInstance[] _trackableSoundInstances; - private readonly IServiceProvider _services; - - public LegacySoundPlayer(IServiceProvider services) - { - this._services = services; - this.LoadAll(); - } - - private void LoadAll() - { - this._soundMech[0] = this.Load("Sounds/Mech_0"); - this._soundGrab = this.Load("Sounds/Grab"); - this._soundPixie = this.Load("Sounds/Pixie"); - this._soundDig[0] = this.Load("Sounds/Dig_0"); - this._soundDig[1] = this.Load("Sounds/Dig_1"); - this._soundDig[2] = this.Load("Sounds/Dig_2"); - this._soundThunder[0] = this.Load("Sounds/Thunder_0"); - this._soundThunder[1] = this.Load("Sounds/Thunder_1"); - this._soundThunder[2] = this.Load("Sounds/Thunder_2"); - this._soundThunder[3] = this.Load("Sounds/Thunder_3"); - this._soundThunder[4] = this.Load("Sounds/Thunder_4"); - this._soundThunder[5] = this.Load("Sounds/Thunder_5"); - this._soundThunder[6] = this.Load("Sounds/Thunder_6"); - this._soundResearch[0] = this.Load("Sounds/Research_0"); - this._soundResearch[1] = this.Load("Sounds/Research_1"); - this._soundResearch[2] = this.Load("Sounds/Research_2"); - this._soundResearch[3] = this.Load("Sounds/Research_3"); - this._soundTink[0] = this.Load("Sounds/Tink_0"); - this._soundTink[1] = this.Load("Sounds/Tink_1"); - this._soundTink[2] = this.Load("Sounds/Tink_2"); - this._soundPlayerHit[0] = this.Load("Sounds/Player_Hit_0"); - this._soundPlayerHit[1] = this.Load("Sounds/Player_Hit_1"); - this._soundPlayerHit[2] = this.Load("Sounds/Player_Hit_2"); - this._soundFemaleHit[0] = this.Load("Sounds/Female_Hit_0"); - this._soundFemaleHit[1] = this.Load("Sounds/Female_Hit_1"); - this._soundFemaleHit[2] = this.Load("Sounds/Female_Hit_2"); - this._soundPlayerKilled = this.Load("Sounds/Player_Killed"); - this._soundChat = this.Load("Sounds/Chat"); - this._soundGrass = this.Load("Sounds/Grass"); - this._soundDoorOpen = this.Load("Sounds/Door_Opened"); - this._soundDoorClosed = this.Load("Sounds/Door_Closed"); - this._soundMenuTick = this.Load("Sounds/Menu_Tick"); - this._soundMenuOpen = this.Load("Sounds/Menu_Open"); - this._soundMenuClose = this.Load("Sounds/Menu_Close"); - this._soundShatter = this.Load("Sounds/Shatter"); - this._soundCamera = this.Load("Sounds/Camera"); - for (int index = 0; index < this._soundCoin.Length; ++index) - this._soundCoin[index] = this.Load("Sounds/Coin_" + (object) index); - for (int index = 0; index < this._soundDrip.Length; ++index) - this._soundDrip[index] = this.Load("Sounds/Drip_" + (object) index); - for (int index = 0; index < this._soundZombie.Length; ++index) - this._soundZombie[index] = this.Load("Sounds/Zombie_" + (object) index); - for (int index = 0; index < this._soundLiquid.Length; ++index) - this._soundLiquid[index] = this.Load("Sounds/Liquid_" + (object) index); - for (int index = 0; index < this._soundRoar.Length; ++index) - this._soundRoar[index] = this.Load("Sounds/Roar_" + (object) index); - this._soundSplash[0] = this.Load("Sounds/Splash_0"); - this._soundSplash[1] = this.Load("Sounds/Splash_1"); - this._soundDoubleJump = this.Load("Sounds/Double_Jump"); - this._soundRun = this.Load("Sounds/Run"); - this._soundCoins = this.Load("Sounds/Coins"); - this._soundUnlock = this.Load("Sounds/Unlock"); - this._soundMaxMana = this.Load("Sounds/MaxMana"); - this._soundDrown = this.Load("Sounds/Drown"); - for (int index = 1; index < this._soundItem.Length; ++index) - this._soundItem[index] = this.Load("Sounds/Item_" + (object) index); - for (int index = 1; index < this._soundNpcHit.Length; ++index) - this._soundNpcHit[index] = this.Load("Sounds/NPC_Hit_" + (object) index); - for (int index = 1; index < this._soundNpcKilled.Length; ++index) - this._soundNpcKilled[index] = this.Load("Sounds/NPC_Killed_" + (object) index); - this._trackableSounds = new Asset[SoundID.TrackableLegacySoundCount]; - this._trackableSoundInstances = new SoundEffectInstance[this._trackableSounds.Length]; - for (int id = 0; id < this._trackableSounds.Length; ++id) - this._trackableSounds[id] = this.Load("Sounds/Custom" + Path.DirectorySeparatorChar.ToString() + SoundID.GetTrackableLegacySoundPath(id)); - } - - public void CreateAllSoundInstances() - { - this._soundInstanceMech[0] = this._soundMech[0].Value.CreateInstance(); - this._soundInstanceGrab = this._soundGrab.Value.CreateInstance(); - this._soundInstancePixie = this._soundGrab.Value.CreateInstance(); - this._soundInstanceDig[0] = this._soundDig[0].Value.CreateInstance(); - this._soundInstanceDig[1] = this._soundDig[1].Value.CreateInstance(); - this._soundInstanceDig[2] = this._soundDig[2].Value.CreateInstance(); - this._soundInstanceTink[0] = this._soundTink[0].Value.CreateInstance(); - this._soundInstanceTink[1] = this._soundTink[1].Value.CreateInstance(); - this._soundInstanceTink[2] = this._soundTink[2].Value.CreateInstance(); - this._soundInstancePlayerHit[0] = this._soundPlayerHit[0].Value.CreateInstance(); - this._soundInstancePlayerHit[1] = this._soundPlayerHit[1].Value.CreateInstance(); - this._soundInstancePlayerHit[2] = this._soundPlayerHit[2].Value.CreateInstance(); - this._soundInstanceFemaleHit[0] = this._soundFemaleHit[0].Value.CreateInstance(); - this._soundInstanceFemaleHit[1] = this._soundFemaleHit[1].Value.CreateInstance(); - this._soundInstanceFemaleHit[2] = this._soundFemaleHit[2].Value.CreateInstance(); - this._soundInstancePlayerKilled = this._soundPlayerKilled.Value.CreateInstance(); - this._soundInstanceChat = this._soundChat.Value.CreateInstance(); - this._soundInstanceGrass = this._soundGrass.Value.CreateInstance(); - this._soundInstanceDoorOpen = this._soundDoorOpen.Value.CreateInstance(); - this._soundInstanceDoorClosed = this._soundDoorClosed.Value.CreateInstance(); - this._soundInstanceMenuTick = this._soundMenuTick.Value.CreateInstance(); - this._soundInstanceMenuOpen = this._soundMenuOpen.Value.CreateInstance(); - this._soundInstanceMenuClose = this._soundMenuClose.Value.CreateInstance(); - this._soundInstanceShatter = this._soundShatter.Value.CreateInstance(); - this._soundInstanceCamera = this._soundCamera.Value.CreateInstance(); - for (int index = 0; index < this._soundThunder.Length; ++index) - this._soundInstanceThunder[index] = this._soundThunder[index].Value.CreateInstance(); - for (int index = 0; index < this._soundResearch.Length; ++index) - this._soundInstanceResearch[index] = this._soundResearch[index].Value.CreateInstance(); - for (int index = 0; index < this._soundCoin.Length; ++index) - this._soundInstanceCoin[index] = this._soundCoin[index].Value.CreateInstance(); - for (int index = 0; index < this._soundDrip.Length; ++index) - this._soundInstanceDrip[index] = this._soundDrip[index].Value.CreateInstance(); - for (int index = 0; index < this._soundZombie.Length; ++index) - this._soundInstanceZombie[index] = this._soundZombie[index].Value.CreateInstance(); - for (int index = 0; index < this._soundLiquid.Length; ++index) - this._soundInstanceLiquid[index] = this._soundLiquid[index].Value.CreateInstance(); - for (int index = 0; index < this._soundRoar.Length; ++index) - this._soundInstanceRoar[index] = this._soundRoar[index].Value.CreateInstance(); - this._soundInstanceSplash[0] = this._soundRoar[0].Value.CreateInstance(); - this._soundInstanceSplash[1] = this._soundSplash[1].Value.CreateInstance(); - this._soundInstanceDoubleJump = this._soundRoar[0].Value.CreateInstance(); - this._soundInstanceRun = this._soundRun.Value.CreateInstance(); - this._soundInstanceCoins = this._soundCoins.Value.CreateInstance(); - this._soundInstanceUnlock = this._soundUnlock.Value.CreateInstance(); - this._soundInstanceMaxMana = this._soundMaxMana.Value.CreateInstance(); - this._soundInstanceDrown = this._soundDrown.Value.CreateInstance(); - for (int index = 1; index < this._soundItem.Length; ++index) - this._soundInstanceItem[index] = this._soundItem[index].Value.CreateInstance(); - for (int index = 1; index < this._soundNpcHit.Length; ++index) - this._soundInstanceNpcHit[index] = this._soundNpcHit[index].Value.CreateInstance(); - for (int index = 1; index < this._soundNpcKilled.Length; ++index) - this._soundInstanceNpcKilled[index] = this._soundNpcKilled[index].Value.CreateInstance(); - for (int index = 0; index < this._trackableSounds.Length; ++index) - this._trackableSoundInstances[index] = this._trackableSounds[index].Value.CreateInstance(); - this._soundInstanceMoonlordCry = this._soundNpcKilled[10].Value.CreateInstance(); - } - - private Asset Load(string assetName) => XnaExtensions.Get(this._services).Request(assetName, (AssetRequestMode) 2); - - public SoundEffectInstance PlaySound( - int type, - int x = -1, - int y = -1, - int Style = 1, - float volumeScale = 1f, - float pitchOffset = 0.0f) - { - int index1 = Style; - try - { - if (Main.dedServ || (double) Main.soundVolume == 0.0 && (type < 30 || type > 35)) - return (SoundEffectInstance) null; - bool flag = false; - float num1 = 1f; - float num2 = 0.0f; - if (x == -1 || y == -1) - { - flag = true; - } - else - { - if (WorldGen.gen || Main.netMode == 2) - return (SoundEffectInstance) null; - Vector2 vector2 = new Vector2(Main.screenPosition.X + (float) Main.screenWidth * 0.5f, Main.screenPosition.Y + (float) Main.screenHeight * 0.5f); - double num3 = (double) Math.Abs((float) x - vector2.X); - float num4 = Math.Abs((float) y - vector2.Y); - float num5 = (float) Math.Sqrt(num3 * num3 + (double) num4 * (double) num4); - int num6 = 2500; - if ((double) num5 < (double) num6) - { - flag = true; - num2 = type != 43 ? (float) (((double) x - (double) vector2.X) / ((double) Main.screenWidth * 0.5)) : (float) (((double) x - (double) vector2.X) / 900.0); - num1 = (float) (1.0 - (double) num5 / (double) num6); - } - } - if ((double) num2 < -1.0) - num2 = -1f; - if ((double) num2 > 1.0) - num2 = 1f; - if ((double) num1 > 1.0) - num1 = 1f; - if ((double) num1 <= 0.0 && (type < 34 || type > 35 || type > 39)) - return (SoundEffectInstance) null; - if (flag) - { - float num7; - if (type >= 30 && type <= 35 || type == 39) - { - num7 = num1 * (Main.ambientVolume * (Main.gameInactive ? 0.0f : 1f)); - if (Main.gameMenu) - num7 = 0.0f; - } - else - num7 = num1 * Main.soundVolume; - if ((double) num7 > 1.0) - num7 = 1f; - if ((double) num7 <= 0.0 && (type < 30 || type > 35) && type != 39) - return (SoundEffectInstance) null; - SoundEffectInstance sound = (SoundEffectInstance) null; - if (type == 0) - { - int index2 = Main.rand.Next(3); - if (this._soundInstanceDig[index2] != null) - this._soundInstanceDig[index2].Stop(); - this._soundInstanceDig[index2] = this._soundDig[index2].Value.CreateInstance(); - this._soundInstanceDig[index2].Volume = num7; - this._soundInstanceDig[index2].Pan = num2; - this._soundInstanceDig[index2].Pitch = (float) Main.rand.Next(-10, 11) * 0.01f; - sound = this._soundInstanceDig[index2]; - } - else if (type == 43) - { - int index3 = Main.rand.Next(this._soundThunder.Length); - for (int index4 = 0; index4 < this._soundThunder.Length && this._soundInstanceThunder[index3] != null && this._soundInstanceThunder[index3].State == SoundState.Playing; ++index4) - index3 = Main.rand.Next(this._soundThunder.Length); - if (this._soundInstanceThunder[index3] != null) - this._soundInstanceThunder[index3].Stop(); - this._soundInstanceThunder[index3] = this._soundThunder[index3].Value.CreateInstance(); - this._soundInstanceThunder[index3].Volume = num7; - this._soundInstanceThunder[index3].Pan = num2; - this._soundInstanceThunder[index3].Pitch = (float) Main.rand.Next(-10, 11) * 0.01f; - sound = this._soundInstanceThunder[index3]; - } - else if (type == 63) - { - int index5 = Main.rand.Next(1, 4); - if (this._soundInstanceResearch[index5] != null) - this._soundInstanceResearch[index5].Stop(); - this._soundInstanceResearch[index5] = this._soundResearch[index5].Value.CreateInstance(); - this._soundInstanceResearch[index5].Volume = num7; - this._soundInstanceResearch[index5].Pan = num2; - sound = this._soundInstanceResearch[index5]; - } - else if (type == 64) - { - if (this._soundInstanceResearch[0] != null) - this._soundInstanceResearch[0].Stop(); - this._soundInstanceResearch[0] = this._soundResearch[0].Value.CreateInstance(); - this._soundInstanceResearch[0].Volume = num7; - this._soundInstanceResearch[0].Pan = num2; - sound = this._soundInstanceResearch[0]; - } - else if (type == 1) - { - int index6 = Main.rand.Next(3); - if (this._soundInstancePlayerHit[index6] != null) - this._soundInstancePlayerHit[index6].Stop(); - this._soundInstancePlayerHit[index6] = this._soundPlayerHit[index6].Value.CreateInstance(); - this._soundInstancePlayerHit[index6].Volume = num7; - this._soundInstancePlayerHit[index6].Pan = num2; - sound = this._soundInstancePlayerHit[index6]; - } - else if (type == 2) - { - if (index1 == 129) - num7 *= 0.6f; - if (index1 == 123) - num7 *= 0.5f; - if (index1 == 124 || index1 == 125) - num7 *= 0.65f; - if (index1 == 116) - num7 *= 0.5f; - if (index1 == 1) - { - int num8 = Main.rand.Next(3); - if (num8 == 1) - index1 = 18; - if (num8 == 2) - index1 = 19; - } - else if (index1 == 55 || index1 == 53) - { - num7 *= 0.75f; - if (index1 == 55) - num7 *= 0.75f; - if (this._soundInstanceItem[index1] != null && this._soundInstanceItem[index1].State == SoundState.Playing) - return (SoundEffectInstance) null; - } - else if (index1 == 37) - num7 *= 0.5f; - else if (index1 == 52) - num7 *= 0.35f; - else if (index1 == 157) - num7 *= 0.7f; - else if (index1 == 158) - num7 *= 0.8f; - if (index1 == 159) - { - if (this._soundInstanceItem[index1] != null && this._soundInstanceItem[index1].State == SoundState.Playing) - return (SoundEffectInstance) null; - num7 *= 0.75f; - } - else if (index1 != 9 && index1 != 10 && index1 != 24 && index1 != 26 && index1 != 34 && index1 != 43 && index1 != 103 && index1 != 156 && index1 != 162 && this._soundInstanceItem[index1] != null) - this._soundInstanceItem[index1].Stop(); - this._soundInstanceItem[index1] = this._soundItem[index1].Value.CreateInstance(); - this._soundInstanceItem[index1].Volume = num7; - this._soundInstanceItem[index1].Pan = num2; - switch (index1) - { - case 53: - this._soundInstanceItem[index1].Pitch = (float) Main.rand.Next(-20, -11) * 0.02f; - break; - case 55: - this._soundInstanceItem[index1].Pitch = (float) -Main.rand.Next(-20, -11) * 0.02f; - break; - case 132: - this._soundInstanceItem[index1].Pitch = (float) Main.rand.Next(-20, 21) * (1f / 1000f); - break; - case 153: - this._soundInstanceItem[index1].Pitch = (float) Main.rand.Next(-50, 51) * (3f / 1000f); - break; - case 156: - this._soundInstanceItem[index1].Pitch = (float) Main.rand.Next(-50, 51) * (1f / 500f); - this._soundInstanceItem[index1].Volume *= 0.6f; - break; - default: - this._soundInstanceItem[index1].Pitch = (float) Main.rand.Next(-6, 7) * 0.01f; - break; - } - if (index1 == 26 || index1 == 35 || index1 == 47) - { - this._soundInstanceItem[index1].Volume = num7 * 0.75f; - this._soundInstanceItem[index1].Pitch = Main.musicPitch; - } - if (index1 == 169) - this._soundInstanceItem[index1].Pitch -= 0.8f; - sound = this._soundInstanceItem[index1]; - } - else if (type == 3) - { - if (index1 >= 20 && index1 <= 54) - num7 *= 0.5f; - if (index1 == 57 && this._soundInstanceNpcHit[index1] != null && this._soundInstanceNpcHit[index1].State == SoundState.Playing) - return (SoundEffectInstance) null; - if (index1 == 57) - num7 *= 0.6f; - if (index1 == 55 || index1 == 56) - num7 *= 0.5f; - if (this._soundInstanceNpcHit[index1] != null) - this._soundInstanceNpcHit[index1].Stop(); - this._soundInstanceNpcHit[index1] = this._soundNpcHit[index1].Value.CreateInstance(); - this._soundInstanceNpcHit[index1].Volume = num7; - this._soundInstanceNpcHit[index1].Pan = num2; - this._soundInstanceNpcHit[index1].Pitch = (float) Main.rand.Next(-10, 11) * 0.01f; - sound = this._soundInstanceNpcHit[index1]; - } - else if (type == 4) - { - if (index1 >= 23 && index1 <= 57) - num7 *= 0.5f; - if (index1 == 61) - num7 *= 0.6f; - if (index1 == 62) - num7 *= 0.6f; - if (index1 == 10 && this._soundInstanceNpcKilled[index1] != null && this._soundInstanceNpcKilled[index1].State == SoundState.Playing) - return (SoundEffectInstance) null; - this._soundInstanceNpcKilled[index1] = this._soundNpcKilled[index1].Value.CreateInstance(); - this._soundInstanceNpcKilled[index1].Volume = num7; - this._soundInstanceNpcKilled[index1].Pan = num2; - this._soundInstanceNpcKilled[index1].Pitch = (float) Main.rand.Next(-10, 11) * 0.01f; - sound = this._soundInstanceNpcKilled[index1]; - } - else if (type == 5) - { - if (this._soundInstancePlayerKilled != null) - this._soundInstancePlayerKilled.Stop(); - this._soundInstancePlayerKilled = this._soundPlayerKilled.Value.CreateInstance(); - this._soundInstancePlayerKilled.Volume = num7; - this._soundInstancePlayerKilled.Pan = num2; - sound = this._soundInstancePlayerKilled; - } - else if (type == 6) - { - if (this._soundInstanceGrass != null) - this._soundInstanceGrass.Stop(); - this._soundInstanceGrass = this._soundGrass.Value.CreateInstance(); - this._soundInstanceGrass.Volume = num7; - this._soundInstanceGrass.Pan = num2; - this._soundInstanceGrass.Pitch = (float) Main.rand.Next(-30, 31) * 0.01f; - sound = this._soundInstanceGrass; - } - else if (type == 7) - { - if (this._soundInstanceGrab != null) - this._soundInstanceGrab.Stop(); - this._soundInstanceGrab = this._soundGrab.Value.CreateInstance(); - this._soundInstanceGrab.Volume = num7; - this._soundInstanceGrab.Pan = num2; - this._soundInstanceGrab.Pitch = (float) Main.rand.Next(-10, 11) * 0.01f; - sound = this._soundInstanceGrab; - } - else if (type == 8) - { - if (this._soundInstanceDoorOpen != null) - this._soundInstanceDoorOpen.Stop(); - this._soundInstanceDoorOpen = this._soundDoorOpen.Value.CreateInstance(); - this._soundInstanceDoorOpen.Volume = num7; - this._soundInstanceDoorOpen.Pan = num2; - this._soundInstanceDoorOpen.Pitch = (float) Main.rand.Next(-20, 21) * 0.01f; - sound = this._soundInstanceDoorOpen; - } - else if (type == 9) - { - if (this._soundInstanceDoorClosed != null) - this._soundInstanceDoorClosed.Stop(); - this._soundInstanceDoorClosed = this._soundDoorClosed.Value.CreateInstance(); - this._soundInstanceDoorClosed.Volume = num7; - this._soundInstanceDoorClosed.Pan = num2; - this._soundInstanceDoorClosed.Pitch = (float) Main.rand.Next(-20, 21) * 0.01f; - sound = this._soundInstanceDoorClosed; - } - else if (type == 10) - { - if (this._soundInstanceMenuOpen != null) - this._soundInstanceMenuOpen.Stop(); - this._soundInstanceMenuOpen = this._soundMenuOpen.Value.CreateInstance(); - this._soundInstanceMenuOpen.Volume = num7; - this._soundInstanceMenuOpen.Pan = num2; - sound = this._soundInstanceMenuOpen; - } - else if (type == 11) - { - if (this._soundInstanceMenuClose != null) - this._soundInstanceMenuClose.Stop(); - this._soundInstanceMenuClose = this._soundMenuClose.Value.CreateInstance(); - this._soundInstanceMenuClose.Volume = num7; - this._soundInstanceMenuClose.Pan = num2; - sound = this._soundInstanceMenuClose; - } - else if (type == 12) - { - if (Main.hasFocus) - { - if (this._soundInstanceMenuTick != null) - this._soundInstanceMenuTick.Stop(); - this._soundInstanceMenuTick = this._soundMenuTick.Value.CreateInstance(); - this._soundInstanceMenuTick.Volume = num7; - this._soundInstanceMenuTick.Pan = num2; - sound = this._soundInstanceMenuTick; - } - } - else if (type == 13) - { - if (this._soundInstanceShatter != null) - this._soundInstanceShatter.Stop(); - this._soundInstanceShatter = this._soundShatter.Value.CreateInstance(); - this._soundInstanceShatter.Volume = num7; - this._soundInstanceShatter.Pan = num2; - sound = this._soundInstanceShatter; - } - else if (type == 14) - { - switch (Style) - { - case 489: - case 586: - int index7 = Main.rand.Next(21, 24); - this._soundInstanceZombie[index7] = this._soundZombie[index7].Value.CreateInstance(); - this._soundInstanceZombie[index7].Volume = num7 * 0.4f; - this._soundInstanceZombie[index7].Pan = num2; - sound = this._soundInstanceZombie[index7]; - break; - case 542: - int index8 = 7; - this._soundInstanceZombie[index8] = this._soundZombie[index8].Value.CreateInstance(); - this._soundInstanceZombie[index8].Volume = num7 * 0.4f; - this._soundInstanceZombie[index8].Pan = num2; - sound = this._soundInstanceZombie[index8]; - break; - default: - int index9 = Main.rand.Next(3); - this._soundInstanceZombie[index9] = this._soundZombie[index9].Value.CreateInstance(); - this._soundInstanceZombie[index9].Volume = num7 * 0.4f; - this._soundInstanceZombie[index9].Pan = num2; - sound = this._soundInstanceZombie[index9]; - break; - } - } - else if (type == 15) - { - float num9 = 1f; - if (index1 == 4) - { - index1 = 1; - num9 = 0.25f; - } - if (this._soundInstanceRoar[index1] == null || this._soundInstanceRoar[index1].State == SoundState.Stopped) - { - this._soundInstanceRoar[index1] = this._soundRoar[index1].Value.CreateInstance(); - this._soundInstanceRoar[index1].Volume = num7 * num9; - this._soundInstanceRoar[index1].Pan = num2; - sound = this._soundInstanceRoar[index1]; - } - } - else if (type == 16) - { - if (this._soundInstanceDoubleJump != null) - this._soundInstanceDoubleJump.Stop(); - this._soundInstanceDoubleJump = this._soundDoubleJump.Value.CreateInstance(); - this._soundInstanceDoubleJump.Volume = num7; - this._soundInstanceDoubleJump.Pan = num2; - this._soundInstanceDoubleJump.Pitch = (float) Main.rand.Next(-10, 11) * 0.01f; - sound = this._soundInstanceDoubleJump; - } - else if (type == 17) - { - if (this._soundInstanceRun != null) - this._soundInstanceRun.Stop(); - this._soundInstanceRun = this._soundRun.Value.CreateInstance(); - this._soundInstanceRun.Volume = num7; - this._soundInstanceRun.Pan = num2; - this._soundInstanceRun.Pitch = (float) Main.rand.Next(-10, 11) * 0.01f; - sound = this._soundInstanceRun; - } - else if (type == 18) - { - this._soundInstanceCoins = this._soundCoins.Value.CreateInstance(); - this._soundInstanceCoins.Volume = num7; - this._soundInstanceCoins.Pan = num2; - sound = this._soundInstanceCoins; - } - else if (type == 19) - { - if (this._soundInstanceSplash[index1] == null || this._soundInstanceSplash[index1].State == SoundState.Stopped) - { - this._soundInstanceSplash[index1] = this._soundSplash[index1].Value.CreateInstance(); - this._soundInstanceSplash[index1].Volume = num7; - this._soundInstanceSplash[index1].Pan = num2; - this._soundInstanceSplash[index1].Pitch = (float) Main.rand.Next(-10, 11) * 0.01f; - sound = this._soundInstanceSplash[index1]; - } - } - else if (type == 20) - { - int index10 = Main.rand.Next(3); - if (this._soundInstanceFemaleHit[index10] != null) - this._soundInstanceFemaleHit[index10].Stop(); - this._soundInstanceFemaleHit[index10] = this._soundFemaleHit[index10].Value.CreateInstance(); - this._soundInstanceFemaleHit[index10].Volume = num7; - this._soundInstanceFemaleHit[index10].Pan = num2; - sound = this._soundInstanceFemaleHit[index10]; - } - else if (type == 21) - { - int index11 = Main.rand.Next(3); - if (this._soundInstanceTink[index11] != null) - this._soundInstanceTink[index11].Stop(); - this._soundInstanceTink[index11] = this._soundTink[index11].Value.CreateInstance(); - this._soundInstanceTink[index11].Volume = num7; - this._soundInstanceTink[index11].Pan = num2; - sound = this._soundInstanceTink[index11]; - } - else if (type == 22) - { - if (this._soundInstanceUnlock != null) - this._soundInstanceUnlock.Stop(); - this._soundInstanceUnlock = this._soundUnlock.Value.CreateInstance(); - this._soundInstanceUnlock.Volume = num7; - this._soundInstanceUnlock.Pan = num2; - sound = this._soundInstanceUnlock; - } - else if (type == 23) - { - if (this._soundInstanceDrown != null) - this._soundInstanceDrown.Stop(); - this._soundInstanceDrown = this._soundDrown.Value.CreateInstance(); - this._soundInstanceDrown.Volume = num7; - this._soundInstanceDrown.Pan = num2; - sound = this._soundInstanceDrown; - } - else if (type == 24) - { - this._soundInstanceChat = this._soundChat.Value.CreateInstance(); - this._soundInstanceChat.Volume = num7; - this._soundInstanceChat.Pan = num2; - sound = this._soundInstanceChat; - } - else if (type == 25) - { - this._soundInstanceMaxMana = this._soundMaxMana.Value.CreateInstance(); - this._soundInstanceMaxMana.Volume = num7; - this._soundInstanceMaxMana.Pan = num2; - sound = this._soundInstanceMaxMana; - } - else if (type == 26) - { - int index12 = Main.rand.Next(3, 5); - this._soundInstanceZombie[index12] = this._soundZombie[index12].Value.CreateInstance(); - this._soundInstanceZombie[index12].Volume = num7 * 0.9f; - this._soundInstanceZombie[index12].Pan = num2; - this._soundInstanceZombie[index12].Pitch = (float) Main.rand.Next(-10, 11) * 0.01f; - sound = this._soundInstanceZombie[index12]; - } - else if (type == 27) - { - if (this._soundInstancePixie != null && this._soundInstancePixie.State == SoundState.Playing) - { - this._soundInstancePixie.Volume = num7; - this._soundInstancePixie.Pan = num2; - this._soundInstancePixie.Pitch = (float) Main.rand.Next(-10, 11) * 0.01f; - return (SoundEffectInstance) null; - } - if (this._soundInstancePixie != null) - this._soundInstancePixie.Stop(); - this._soundInstancePixie = this._soundPixie.Value.CreateInstance(); - this._soundInstancePixie.Volume = num7; - this._soundInstancePixie.Pan = num2; - this._soundInstancePixie.Pitch = (float) Main.rand.Next(-10, 11) * 0.01f; - sound = this._soundInstancePixie; - } - else if (type == 28) - { - if (this._soundInstanceMech[index1] != null && this._soundInstanceMech[index1].State == SoundState.Playing) - return (SoundEffectInstance) null; - this._soundInstanceMech[index1] = this._soundMech[index1].Value.CreateInstance(); - this._soundInstanceMech[index1].Volume = num7; - this._soundInstanceMech[index1].Pan = num2; - this._soundInstanceMech[index1].Pitch = (float) Main.rand.Next(-10, 11) * 0.01f; - sound = this._soundInstanceMech[index1]; - } - else if (type == 29) - { - if (index1 >= 24 && index1 <= 87) - num7 *= 0.5f; - if (index1 >= 88 && index1 <= 91) - num7 *= 0.7f; - if (index1 >= 93 && index1 <= 99) - num7 *= 0.4f; - if (index1 == 92) - num7 *= 0.5f; - if (index1 == 103) - num7 *= 0.4f; - if (index1 == 104) - num7 *= 0.55f; - if (index1 == 100 || index1 == 101) - num7 *= 0.25f; - if (index1 == 102) - num7 *= 0.4f; - if (this._soundInstanceZombie[index1] != null && this._soundInstanceZombie[index1].State == SoundState.Playing) - return (SoundEffectInstance) null; - this._soundInstanceZombie[index1] = this._soundZombie[index1].Value.CreateInstance(); - this._soundInstanceZombie[index1].Volume = num7; - this._soundInstanceZombie[index1].Pan = num2; - this._soundInstanceZombie[index1].Pitch = (float) Main.rand.Next(-10, 11) * 0.01f; - sound = this._soundInstanceZombie[index1]; - } - else if (type == 44) - { - int index13 = Main.rand.Next(106, 109); - this._soundInstanceZombie[index13] = this._soundZombie[index13].Value.CreateInstance(); - this._soundInstanceZombie[index13].Volume = num7 * 0.2f; - this._soundInstanceZombie[index13].Pan = num2; - this._soundInstanceZombie[index13].Pitch = (float) Main.rand.Next(-70, 1) * 0.01f; - sound = this._soundInstanceZombie[index13]; - } - else if (type == 45) - { - int index14 = 109; - if (this._soundInstanceZombie[index14] != null && this._soundInstanceZombie[index14].State == SoundState.Playing) - return (SoundEffectInstance) null; - this._soundInstanceZombie[index14] = this._soundZombie[index14].Value.CreateInstance(); - this._soundInstanceZombie[index14].Volume = num7 * 0.3f; - this._soundInstanceZombie[index14].Pan = num2; - this._soundInstanceZombie[index14].Pitch = (float) Main.rand.Next(-10, 11) * 0.01f; - sound = this._soundInstanceZombie[index14]; - } - else if (type == 46) - { - if (this._soundInstanceZombie[110] != null && this._soundInstanceZombie[110].State == SoundState.Playing || this._soundInstanceZombie[111] != null && this._soundInstanceZombie[111].State == SoundState.Playing) - return (SoundEffectInstance) null; - int index15 = Main.rand.Next(110, 112); - if (Main.rand.Next(300) == 0) - index15 = Main.rand.Next(3) != 0 ? (Main.rand.Next(2) != 0 ? 112 : 113) : 114; - this._soundInstanceZombie[index15] = this._soundZombie[index15].Value.CreateInstance(); - this._soundInstanceZombie[index15].Volume = num7 * 0.9f; - this._soundInstanceZombie[index15].Pan = num2; - this._soundInstanceZombie[index15].Pitch = (float) Main.rand.Next(-10, 11) * 0.01f; - sound = this._soundInstanceZombie[index15]; - } - else if (type == 45) - { - int index16 = 109; - this._soundInstanceZombie[index16] = this._soundZombie[index16].Value.CreateInstance(); - this._soundInstanceZombie[index16].Volume = num7 * 0.2f; - this._soundInstanceZombie[index16].Pan = num2; - this._soundInstanceZombie[index16].Pitch = (float) Main.rand.Next(-70, 1) * 0.01f; - sound = this._soundInstanceZombie[index16]; - } - else if (type == 30) - { - int index17 = Main.rand.Next(10, 12); - if (Main.rand.Next(300) == 0) - { - index17 = 12; - if (this._soundInstanceZombie[index17] != null && this._soundInstanceZombie[index17].State == SoundState.Playing) - return (SoundEffectInstance) null; - } - this._soundInstanceZombie[index17] = this._soundZombie[index17].Value.CreateInstance(); - this._soundInstanceZombie[index17].Volume = num7 * 0.75f; - this._soundInstanceZombie[index17].Pan = num2; - this._soundInstanceZombie[index17].Pitch = index17 == 12 ? (float) Main.rand.Next(-40, 21) * 0.01f : (float) Main.rand.Next(-70, 1) * 0.01f; - sound = this._soundInstanceZombie[index17]; - } - else if (type == 31) - { - int index18 = 13; - this._soundInstanceZombie[index18] = this._soundZombie[index18].Value.CreateInstance(); - this._soundInstanceZombie[index18].Volume = num7 * 0.35f; - this._soundInstanceZombie[index18].Pan = num2; - this._soundInstanceZombie[index18].Pitch = (float) Main.rand.Next(-40, 21) * 0.01f; - sound = this._soundInstanceZombie[index18]; - } - else if (type == 32) - { - if (this._soundInstanceZombie[index1] != null && this._soundInstanceZombie[index1].State == SoundState.Playing) - return (SoundEffectInstance) null; - this._soundInstanceZombie[index1] = this._soundZombie[index1].Value.CreateInstance(); - this._soundInstanceZombie[index1].Volume = num7 * 0.15f; - this._soundInstanceZombie[index1].Pan = num2; - this._soundInstanceZombie[index1].Pitch = (float) Main.rand.Next(-70, 26) * 0.01f; - sound = this._soundInstanceZombie[index1]; - } - else if (type == 33) - { - int index19 = 15; - if (this._soundInstanceZombie[index19] != null && this._soundInstanceZombie[index19].State == SoundState.Playing) - return (SoundEffectInstance) null; - this._soundInstanceZombie[index19] = this._soundZombie[index19].Value.CreateInstance(); - this._soundInstanceZombie[index19].Volume = num7 * 0.2f; - this._soundInstanceZombie[index19].Pan = num2; - this._soundInstanceZombie[index19].Pitch = (float) Main.rand.Next(-10, 31) * 0.01f; - sound = this._soundInstanceZombie[index19]; - } - else if (type >= 47 && type <= 52) - { - int index20 = 133 + type - 47; - for (int index21 = 133; index21 <= 138; ++index21) - { - if (this._soundInstanceItem[index21] != null && this._soundInstanceItem[index21].State == SoundState.Playing) - this._soundInstanceItem[index21].Stop(); - } - this._soundInstanceItem[index20] = this._soundItem[index20].Value.CreateInstance(); - this._soundInstanceItem[index20].Volume = num7 * 0.45f; - this._soundInstanceItem[index20].Pan = num2; - sound = this._soundInstanceItem[index20]; - } - else if (type >= 53 && type <= 62) - { - int index22 = 139 + type - 53; - if (this._soundInstanceItem[index22] != null && this._soundInstanceItem[index22].State == SoundState.Playing) - this._soundInstanceItem[index22].Stop(); - this._soundInstanceItem[index22] = this._soundItem[index22].Value.CreateInstance(); - this._soundInstanceItem[index22].Volume = num7 * 0.7f; - this._soundInstanceItem[index22].Pan = num2; - sound = this._soundInstanceItem[index22]; - } - else - { - switch (type) - { - case 34: - float num10 = (float) index1 / 50f; - if ((double) num10 > 1.0) - num10 = 1f; - float num11 = num7 * num10 * 0.2f; - if ((double) num11 <= 0.0 || x == -1 || y == -1) - { - if (this._soundInstanceLiquid[0] != null && this._soundInstanceLiquid[0].State == SoundState.Playing) - { - this._soundInstanceLiquid[0].Stop(); - break; - } - break; - } - if (this._soundInstanceLiquid[0] != null && this._soundInstanceLiquid[0].State == SoundState.Playing) - { - this._soundInstanceLiquid[0].Volume = num11; - this._soundInstanceLiquid[0].Pan = num2; - this._soundInstanceLiquid[0].Pitch = -0.2f; - break; - } - this._soundInstanceLiquid[0] = this._soundLiquid[0].Value.CreateInstance(); - this._soundInstanceLiquid[0].Volume = num11; - this._soundInstanceLiquid[0].Pan = num2; - sound = this._soundInstanceLiquid[0]; - break; - case 35: - float num12 = (float) index1 / 50f; - if ((double) num12 > 1.0) - num12 = 1f; - float num13 = num7 * num12 * 0.65f; - if ((double) num13 <= 0.0 || x == -1 || y == -1) - { - if (this._soundInstanceLiquid[1] != null && this._soundInstanceLiquid[1].State == SoundState.Playing) - { - this._soundInstanceLiquid[1].Stop(); - break; - } - break; - } - if (this._soundInstanceLiquid[1] != null && this._soundInstanceLiquid[1].State == SoundState.Playing) - { - this._soundInstanceLiquid[1].Volume = num13; - this._soundInstanceLiquid[1].Pan = num2; - this._soundInstanceLiquid[1].Pitch = -0.0f; - break; - } - this._soundInstanceLiquid[1] = this._soundLiquid[1].Value.CreateInstance(); - this._soundInstanceLiquid[1].Volume = num13; - this._soundInstanceLiquid[1].Pan = num2; - sound = this._soundInstanceLiquid[1]; - break; - case 36: - int index23 = Style; - if (Style == -1) - index23 = 0; - this._soundInstanceRoar[index23] = this._soundRoar[index23].Value.CreateInstance(); - this._soundInstanceRoar[index23].Volume = num7; - this._soundInstanceRoar[index23].Pan = num2; - if (Style == -1) - this._soundInstanceRoar[index23].Pitch += 0.6f; - sound = this._soundInstanceRoar[index23]; - break; - case 37: - int index24 = Main.rand.Next(57, 59); - float num14 = num7 * ((float) Style * 0.05f); - this._soundInstanceItem[index24] = this._soundItem[index24].Value.CreateInstance(); - this._soundInstanceItem[index24].Volume = num14; - this._soundInstanceItem[index24].Pan = num2; - this._soundInstanceItem[index24].Pitch = (float) Main.rand.Next(-40, 41) * 0.01f; - sound = this._soundInstanceItem[index24]; - break; - case 38: - int index25 = Main.rand.Next(5); - this._soundInstanceCoin[index25] = this._soundCoin[index25].Value.CreateInstance(); - this._soundInstanceCoin[index25].Volume = num7; - this._soundInstanceCoin[index25].Pan = num2; - this._soundInstanceCoin[index25].Pitch = (float) Main.rand.Next(-40, 41) * (1f / 500f); - sound = this._soundInstanceCoin[index25]; - break; - case 39: - int index26 = Style; - this._soundInstanceDrip[index26] = this._soundDrip[index26].Value.CreateInstance(); - this._soundInstanceDrip[index26].Volume = num7 * 0.5f; - this._soundInstanceDrip[index26].Pan = num2; - this._soundInstanceDrip[index26].Pitch = (float) Main.rand.Next(-30, 31) * 0.01f; - sound = this._soundInstanceDrip[index26]; - break; - case 40: - if (this._soundInstanceCamera != null) - this._soundInstanceCamera.Stop(); - this._soundInstanceCamera = this._soundCamera.Value.CreateInstance(); - this._soundInstanceCamera.Volume = num7; - this._soundInstanceCamera.Pan = num2; - sound = this._soundInstanceCamera; - break; - case 41: - this._soundInstanceMoonlordCry = this._soundNpcKilled[10].Value.CreateInstance(); - this._soundInstanceMoonlordCry.Volume = (float) (1.0 / (1.0 + (double) (new Vector2((float) x, (float) y) - Main.player[Main.myPlayer].position).Length())); - this._soundInstanceMoonlordCry.Pan = num2; - this._soundInstanceMoonlordCry.Pitch = (float) Main.rand.Next(-10, 11) * 0.01f; - sound = this._soundInstanceMoonlordCry; - break; - case 42: - sound = this._trackableSounds[index1].Value.CreateInstance(); - sound.Volume = num7; - sound.Pan = num2; - this._trackableSoundInstances[index1] = sound; - break; - case 65: - if (this._soundInstanceZombie[115] != null && this._soundInstanceZombie[115].State == SoundState.Playing || this._soundInstanceZombie[116] != null && this._soundInstanceZombie[116].State == SoundState.Playing || this._soundInstanceZombie[117] != null && this._soundInstanceZombie[117].State == SoundState.Playing) - return (SoundEffectInstance) null; - int index27 = Main.rand.Next(115, 118); - this._soundInstanceZombie[index27] = this._soundZombie[index27].Value.CreateInstance(); - this._soundInstanceZombie[index27].Volume = num7 * 0.5f; - this._soundInstanceZombie[index27].Pan = num2; - sound = this._soundInstanceZombie[index27]; - break; - } - } - if (sound != null) - { - sound.Pitch += pitchOffset; - sound.Volume *= volumeScale; - sound.Play(); - SoundInstanceGarbageCollector.Track(sound); - } - return sound; - } - } - catch - { - } - return (SoundEffectInstance) null; - } - - public SoundEffect GetTrackableSoundByStyleId(int id) => this._trackableSounds[id].Value; - - public void StopAmbientSounds() - { - for (int index = 0; index < this._soundInstanceLiquid.Length; ++index) - { - if (this._soundInstanceLiquid[index] != null) - this._soundInstanceLiquid[index].Stop(); - } - } - } -} diff --git a/Audio/LegacySoundStyle.cs b/Audio/LegacySoundStyle.cs index 4b0c02c..3b587c5 100644 --- a/Audio/LegacySoundStyle.cs +++ b/Audio/LegacySoundStyle.cs @@ -1,67 +1,71 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Audio.LegacySoundStyle -// 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.Audio; -using Terraria.Utilities; - -namespace Terraria.Audio -{ - public class LegacySoundStyle : SoundStyle - { - private static readonly UnifiedRandom Random = new UnifiedRandom(); - private readonly int _style; - public readonly int Variations; - public readonly int SoundId; - - public int Style => this.Variations != 1 ? LegacySoundStyle.Random.Next(this._style, this._style + this.Variations) : this._style; - - public override bool IsTrackable => this.SoundId == 42; - - public LegacySoundStyle(int soundId, int style, SoundType type = SoundType.Sound) - : base(type) - { - this._style = style; - this.Variations = 1; - this.SoundId = soundId; - } - - public LegacySoundStyle(int soundId, int style, int variations, SoundType type = SoundType.Sound) - : base(type) - { - this._style = style; - this.Variations = variations; - this.SoundId = soundId; - } - - private LegacySoundStyle( - int soundId, - int style, - int variations, - SoundType type, - float volume, - float pitchVariance) - : base(volume, pitchVariance, type) - { - this._style = style; - this.Variations = variations; - this.SoundId = soundId; - } - - public LegacySoundStyle WithVolume(float volume) => new LegacySoundStyle(this.SoundId, this._style, this.Variations, this.Type, volume, this.PitchVariance); - - public LegacySoundStyle WithPitchVariance(float pitchVariance) => new LegacySoundStyle(this.SoundId, this._style, this.Variations, this.Type, this.Volume, pitchVariance); - - public LegacySoundStyle AsMusic() => new LegacySoundStyle(this.SoundId, this._style, this.Variations, SoundType.Music, this.Volume, this.PitchVariance); - - public LegacySoundStyle AsAmbient() => new LegacySoundStyle(this.SoundId, this._style, this.Variations, SoundType.Ambient, this.Volume, this.PitchVariance); - - public LegacySoundStyle AsSound() => new LegacySoundStyle(this.SoundId, this._style, this.Variations, SoundType.Sound, this.Volume, this.PitchVariance); - - public bool Includes(int soundId, int style) => this.SoundId == soundId && style >= this._style && style < this._style + this.Variations; - - public override SoundEffect GetRandomSound() => this.IsTrackable ? SoundEngine.GetTrackableSoundByStyleId(this.Style) : (SoundEffect) null; - } -} +// Decompiled with JetBrains decompiler +// Type: Terraria.Audio.LegacySoundStyle +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 +// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe + +using Microsoft.Xna.Framework.Audio; +using Terraria.Utilities; + +namespace Terraria.Audio +{ + public class LegacySoundStyle : SoundStyle + { + private static UnifiedRandom _random = new UnifiedRandom(); + private int _style; + private int _styleVariations; + private int _soundId; + + public int Style => this._styleVariations != 1 ? LegacySoundStyle._random.Next(this._style, this._style + this._styleVariations) : this._style; + + public int Variations => this._styleVariations; + + public int SoundId => this._soundId; + + public override bool IsTrackable => this._soundId == 42; + + public LegacySoundStyle(int soundId, int style, SoundType type = SoundType.Sound) + : base(type) + { + this._style = style; + this._styleVariations = 1; + this._soundId = soundId; + } + + public LegacySoundStyle(int soundId, int style, int variations, SoundType type = SoundType.Sound) + : base(type) + { + this._style = style; + this._styleVariations = variations; + this._soundId = soundId; + } + + private LegacySoundStyle( + int soundId, + int style, + int variations, + SoundType type, + float volume, + float pitchVariance) + : base(volume, pitchVariance, type) + { + this._style = style; + this._styleVariations = variations; + this._soundId = soundId; + } + + public LegacySoundStyle WithVolume(float volume) => new LegacySoundStyle(this._soundId, this._style, this._styleVariations, this.Type, volume, this.PitchVariance); + + public LegacySoundStyle WithPitchVariance(float pitchVariance) => new LegacySoundStyle(this._soundId, this._style, this._styleVariations, this.Type, this.Volume, pitchVariance); + + public LegacySoundStyle AsMusic() => new LegacySoundStyle(this._soundId, this._style, this._styleVariations, SoundType.Music, this.Volume, this.PitchVariance); + + public LegacySoundStyle AsAmbient() => new LegacySoundStyle(this._soundId, this._style, this._styleVariations, SoundType.Ambient, this.Volume, this.PitchVariance); + + public LegacySoundStyle AsSound() => new LegacySoundStyle(this._soundId, this._style, this._styleVariations, SoundType.Sound, this.Volume, this.PitchVariance); + + public bool Includes(int soundId, int style) => this._soundId == soundId && style >= this._style && style < this._style + this._styleVariations; + + public override SoundEffect GetRandomSound() => this.IsTrackable ? Main.trackableSounds[this.Style] : (SoundEffect) null; + } +} diff --git a/Audio/SoundEngine.cs b/Audio/SoundEngine.cs deleted file mode 100644 index 1f6e5b8..0000000 --- a/Audio/SoundEngine.cs +++ /dev/null @@ -1,287 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Audio.SoundEngine -// 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; -using Microsoft.Xna.Framework.Audio; -using ReLogic.Utilities; -using System; -using System.IO; - -namespace Terraria.Audio -{ - public static class SoundEngine - { - private static LegacySoundPlayer _legacyPlayer; - private static SoundPlayer _player; - private static bool _areSoundsPaused; - - public static bool IsAudioSupported { get; private set; } - - public static void Initialize() => SoundEngine.IsAudioSupported = SoundEngine.TestAudioSupport(); - - public static void Load(IServiceProvider services) - { - if (!SoundEngine.IsAudioSupported) - return; - SoundEngine._legacyPlayer = new LegacySoundPlayer(services); - SoundEngine._player = new SoundPlayer(); - } - - public static void Update() - { - if (!SoundEngine.IsAudioSupported) - return; - SoundInstanceGarbageCollector.Update(); - bool flag = (!Main.hasFocus || Main.gamePaused) && Main.netMode == 0; - if (!SoundEngine._areSoundsPaused & flag) - SoundEngine._player.PauseAll(); - else if (SoundEngine._areSoundsPaused && !flag) - SoundEngine._player.ResumeAll(); - SoundEngine._areSoundsPaused = flag; - SoundEngine._player.Update(); - } - - public static void PlaySound(int type, Vector2 position, int style = 1) => SoundEngine.PlaySound(type, (int) position.X, (int) position.Y, style); - - public static SoundEffectInstance PlaySound( - LegacySoundStyle type, - Vector2 position) - { - return SoundEngine.PlaySound(type, (int) position.X, (int) position.Y); - } - - public static SoundEffectInstance PlaySound( - LegacySoundStyle type, - int x = -1, - int y = -1) - { - return type == null ? (SoundEffectInstance) null : SoundEngine.PlaySound(type.SoundId, x, y, type.Style, type.Volume, type.GetRandomPitch()); - } - - public static SoundEffectInstance PlaySound( - int type, - int x = -1, - int y = -1, - int Style = 1, - float volumeScale = 1f, - float pitchOffset = 0.0f) - { - return !SoundEngine.IsAudioSupported ? (SoundEffectInstance) null : SoundEngine._legacyPlayer.PlaySound(type, x, y, Style, volumeScale, pitchOffset); - } - - public static ActiveSound GetActiveSound(SlotId id) => !SoundEngine.IsAudioSupported ? (ActiveSound) null : SoundEngine._player.GetActiveSound(id); - - public static SlotId PlayTrackedSound(SoundStyle style, Vector2 position) => !SoundEngine.IsAudioSupported ? (SlotId) SlotId.Invalid : SoundEngine._player.Play(style, position); - - public static SlotId PlayTrackedSound(SoundStyle style) => !SoundEngine.IsAudioSupported ? (SlotId) SlotId.Invalid : SoundEngine._player.Play(style); - - public static void StopTrackedSounds() - { - if (!SoundEngine.IsAudioSupported) - return; - SoundEngine._player.StopAll(); - } - - public static SoundEffect GetTrackableSoundByStyleId(int id) => !SoundEngine.IsAudioSupported ? (SoundEffect) null : SoundEngine._legacyPlayer.GetTrackableSoundByStyleId(id); - - public static void StopAmbientSounds() - { - if (!SoundEngine.IsAudioSupported || SoundEngine._legacyPlayer == null) - return; - SoundEngine._legacyPlayer.StopAmbientSounds(); - } - - public static ActiveSound FindActiveSound(SoundStyle style) => !SoundEngine.IsAudioSupported ? (ActiveSound) null : SoundEngine._player.FindActiveSound(style); - - private static bool TestAudioSupport() - { - byte[] buffer = new byte[166] - { - (byte) 82, - (byte) 73, - (byte) 70, - (byte) 70, - (byte) 158, - (byte) 0, - (byte) 0, - (byte) 0, - (byte) 87, - (byte) 65, - (byte) 86, - (byte) 69, - (byte) 102, - (byte) 109, - (byte) 116, - (byte) 32, - (byte) 16, - (byte) 0, - (byte) 0, - (byte) 0, - (byte) 1, - (byte) 0, - (byte) 1, - (byte) 0, - (byte) 68, - (byte) 172, - (byte) 0, - (byte) 0, - (byte) 136, - (byte) 88, - (byte) 1, - (byte) 0, - (byte) 2, - (byte) 0, - (byte) 16, - (byte) 0, - (byte) 76, - (byte) 73, - (byte) 83, - (byte) 84, - (byte) 26, - (byte) 0, - (byte) 0, - (byte) 0, - (byte) 73, - (byte) 78, - (byte) 70, - (byte) 79, - (byte) 73, - (byte) 83, - (byte) 70, - (byte) 84, - (byte) 14, - (byte) 0, - (byte) 0, - (byte) 0, - (byte) 76, - (byte) 97, - (byte) 118, - (byte) 102, - (byte) 53, - (byte) 54, - (byte) 46, - (byte) 52, - (byte) 48, - (byte) 46, - (byte) 49, - (byte) 48, - (byte) 49, - (byte) 0, - (byte) 100, - (byte) 97, - (byte) 116, - (byte) 97, - (byte) 88, - (byte) 0, - (byte) 0, - (byte) 0, - (byte) 0, - (byte) 0, - (byte) 126, - (byte) 4, - (byte) 240, - (byte) 8, - (byte) 64, - (byte) 13, - (byte) 95, - (byte) 17, - (byte) 67, - (byte) 21, - (byte) 217, - (byte) 24, - (byte) 23, - (byte) 28, - (byte) 240, - (byte) 30, - (byte) 94, - (byte) 33, - (byte) 84, - (byte) 35, - (byte) 208, - (byte) 36, - (byte) 204, - (byte) 37, - (byte) 71, - (byte) 38, - (byte) 64, - (byte) 38, - (byte) 183, - (byte) 37, - (byte) 180, - (byte) 36, - (byte) 58, - (byte) 35, - (byte) 79, - (byte) 33, - (byte) 1, - (byte) 31, - (byte) 86, - (byte) 28, - (byte) 92, - (byte) 25, - (byte) 37, - (byte) 22, - (byte) 185, - (byte) 18, - (byte) 42, - (byte) 15, - (byte) 134, - (byte) 11, - (byte) 222, - (byte) 7, - (byte) 68, - (byte) 4, - (byte) 196, - (byte) 0, - (byte) 112, - (byte) 253, - (byte) 86, - (byte) 250, - (byte) 132, - (byte) 247, - (byte) 6, - (byte) 245, - (byte) 230, - (byte) 242, - (byte) 47, - (byte) 241, - (byte) 232, - (byte) 239, - (byte) 25, - (byte) 239, - (byte) 194, - (byte) 238, - (byte) 231, - (byte) 238, - (byte) 139, - (byte) 239, - (byte) 169, - (byte) 240, - (byte) 61, - (byte) 242, - (byte) 67, - (byte) 244, - (byte) 180, - (byte) 246 - }; - try - { - using (MemoryStream memoryStream = new MemoryStream(buffer)) - SoundEffect.FromStream((Stream) memoryStream); - } - catch (NoAudioHardwareException ex) - { - Console.WriteLine("No audio hardware found. Disabling all audio."); - return false; - } - catch - { - return false; - } - return true; - } - } -} diff --git a/Audio/SoundInstanceGarbageCollector.cs b/Audio/SoundInstanceGarbageCollector.cs deleted file mode 100644 index bc798ca..0000000 --- a/Audio/SoundInstanceGarbageCollector.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Audio.SoundInstanceGarbageCollector -// 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.Audio; -using System.Collections.Generic; - -namespace Terraria.Audio -{ - public static class SoundInstanceGarbageCollector - { - private static readonly List _activeSounds = new List(128); - - public static void Track(SoundEffectInstance sound) - { - } - - public static void Update() - { - for (int index = 0; index < SoundInstanceGarbageCollector._activeSounds.Count; ++index) - { - if (SoundInstanceGarbageCollector._activeSounds[index] == null) - { - SoundInstanceGarbageCollector._activeSounds.RemoveAt(index); - --index; - } - else if (SoundInstanceGarbageCollector._activeSounds[index].State == SoundState.Stopped) - { - SoundInstanceGarbageCollector._activeSounds[index].Dispose(); - SoundInstanceGarbageCollector._activeSounds.RemoveAt(index); - --index; - } - } - } - } -} diff --git a/Audio/SoundPlayer.cs b/Audio/SoundPlayer.cs deleted file mode 100644 index 374d4cf..0000000 --- a/Audio/SoundPlayer.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Audio.SoundPlayer -// 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; -using ReLogic.Utilities; -using System.Collections.Generic; - -namespace Terraria.Audio -{ - public class SoundPlayer - { - private readonly SlotVector _trackedSounds = new SlotVector(4096); - - public SlotId Play(SoundStyle style, Vector2 position) - { - if (Main.dedServ || style == null || !style.IsTrackable) - return (SlotId) SlotId.Invalid; - return (double) Vector2.DistanceSquared(Main.screenPosition + new Vector2((float) (Main.screenWidth / 2), (float) (Main.screenHeight / 2)), position) > 100000000.0 ? (SlotId) SlotId.Invalid : this._trackedSounds.Add(new ActiveSound(style, position)); - } - - public SlotId Play(SoundStyle style) => Main.dedServ || style == null || !style.IsTrackable ? (SlotId) SlotId.Invalid : this._trackedSounds.Add(new ActiveSound(style)); - - public ActiveSound GetActiveSound(SlotId id) => !this._trackedSounds.Has(id) ? (ActiveSound) null : this._trackedSounds[id]; - - public void PauseAll() - { - foreach (SlotVector.ItemPair trackedSound in (IEnumerable.ItemPair>) this._trackedSounds) - ((ActiveSound) trackedSound.Value).Pause(); - } - - public void ResumeAll() - { - foreach (SlotVector.ItemPair trackedSound in (IEnumerable.ItemPair>) this._trackedSounds) - ((ActiveSound) trackedSound.Value).Resume(); - } - - public void StopAll() - { - foreach (SlotVector.ItemPair trackedSound in (IEnumerable.ItemPair>) this._trackedSounds) - ((ActiveSound) trackedSound.Value).Stop(); - this._trackedSounds.Clear(); - } - - public void Update() - { - foreach (SlotVector.ItemPair trackedSound in (IEnumerable.ItemPair>) this._trackedSounds) - { - try - { - ((ActiveSound) trackedSound.Value).Update(); - if (!((ActiveSound) trackedSound.Value).IsPlaying) - this._trackedSounds.Remove((SlotId) trackedSound.Id); - } - catch - { - this._trackedSounds.Remove((SlotId) trackedSound.Id); - } - } - } - - public ActiveSound FindActiveSound(SoundStyle style) - { - foreach (SlotVector.ItemPair trackedSound in (IEnumerable.ItemPair>) this._trackedSounds) - { - if (((ActiveSound) trackedSound.Value).Style == style) - return (ActiveSound) trackedSound.Value; - } - return (ActiveSound) null; - } - } -} diff --git a/Audio/SoundStyle.cs b/Audio/SoundStyle.cs index bddae75..b97ece0 100644 --- a/Audio/SoundStyle.cs +++ b/Audio/SoundStyle.cs @@ -1,45 +1,45 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Audio.SoundStyle -// 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.Audio; -using Terraria.Utilities; - -namespace Terraria.Audio -{ - public abstract class SoundStyle - { - private static UnifiedRandom _random = new UnifiedRandom(); - private float _volume; - private float _pitchVariance; - private SoundType _type; - - public float Volume => this._volume; - - public float PitchVariance => this._pitchVariance; - - public SoundType Type => this._type; - - public abstract bool IsTrackable { get; } - - public SoundStyle(float volume, float pitchVariance, SoundType type = SoundType.Sound) - { - this._volume = volume; - this._pitchVariance = pitchVariance; - this._type = type; - } - - public SoundStyle(SoundType type = SoundType.Sound) - { - this._volume = 1f; - this._pitchVariance = 0.0f; - this._type = type; - } - - public float GetRandomPitch() => (float) ((double) SoundStyle._random.NextFloat() * (double) this.PitchVariance - (double) this.PitchVariance * 0.5); - - public abstract SoundEffect GetRandomSound(); - } -} +// Decompiled with JetBrains decompiler +// Type: Terraria.Audio.SoundStyle +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 +// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe + +using Microsoft.Xna.Framework.Audio; +using Terraria.Utilities; + +namespace Terraria.Audio +{ + public abstract class SoundStyle + { + private static UnifiedRandom _random = new UnifiedRandom(); + private float _volume; + private float _pitchVariance; + private SoundType _type; + + public float Volume => this._volume; + + public float PitchVariance => this._pitchVariance; + + public SoundType Type => this._type; + + public abstract bool IsTrackable { get; } + + public SoundStyle(float volume, float pitchVariance, SoundType type = SoundType.Sound) + { + this._volume = volume; + this._pitchVariance = pitchVariance; + this._type = type; + } + + public SoundStyle(SoundType type = SoundType.Sound) + { + this._volume = 1f; + this._pitchVariance = 0.0f; + this._type = type; + } + + public float GetRandomPitch() => (float) ((double) SoundStyle._random.NextFloat() * (double) this.PitchVariance - (double) this.PitchVariance * 0.5); + + public abstract SoundEffect GetRandomSound(); + } +} diff --git a/Audio/SoundType.cs b/Audio/SoundType.cs index fb7c7a9..a25fd68 100644 --- a/Audio/SoundType.cs +++ b/Audio/SoundType.cs @@ -1,15 +1,15 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Audio.SoundType -// 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.Audio -{ - public enum SoundType - { - Sound, - Ambient, - Music, - } -} +// Decompiled with JetBrains decompiler +// Type: Terraria.Audio.SoundType +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 +// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe + +namespace Terraria.Audio +{ + public enum SoundType + { + Sound, + Ambient, + Music, + } +} diff --git a/BitsByte.cs b/BitsByte.cs index 9d0b125..0604e74 100644 --- a/BitsByte.cs +++ b/BitsByte.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.BitsByte -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; @@ -146,5 +146,30 @@ namespace Terraria while (bitsByte[7]); return bitsByteList.ToArray(); } + + public static void SortOfAUnitTest() + { + MemoryStream memoryStream = new MemoryStream(); + BinaryWriter binaryWriter = new BinaryWriter((Stream) memoryStream); + BinaryReader reader = new BinaryReader((Stream) memoryStream); + bool[] flagArray = new bool[28]; + flagArray[3] = true; + flagArray[14] = true; + BitsByte[] bitsByteArray1 = BitsByte.ComposeBitsBytesChain(false, flagArray); + foreach (BitsByte bitsByte in bitsByteArray1) + { + byte num = (byte) bitsByte; + binaryWriter.Write(num); + } + memoryStream.Position = 0L; + BitsByte[] bitsByteArray2 = BitsByte.DecomposeBitsBytesChain(reader); + string str1 = ""; + string str2 = ""; + foreach (BitsByte bitsByte in bitsByteArray1) + str1 = str1 + (object) (byte) bitsByte + ", "; + foreach (BitsByte bitsByte in bitsByteArray2) + str2 = str2 + (object) (byte) bitsByte + ", "; + Main.NewText("done"); + } } } diff --git a/Chat/ChatCommandId.cs b/Chat/ChatCommandId.cs index 1cd4486..903d6e0 100644 --- a/Chat/ChatCommandId.cs +++ b/Chat/ChatCommandId.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Chat.ChatCommandId -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using ReLogic.Utilities; diff --git a/Chat/ChatCommandProcessor.cs b/Chat/ChatCommandProcessor.cs index 049e881..c006a2b 100644 --- a/Chat/ChatCommandProcessor.cs +++ b/Chat/ChatCommandProcessor.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Chat.ChatCommandProcessor -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using ReLogic.Utilities; @@ -15,9 +15,8 @@ namespace Terraria.Chat { public class ChatCommandProcessor : IChatProcessor { - private readonly Dictionary _localizedCommands = new Dictionary(); - private readonly Dictionary _commands = new Dictionary(); - private readonly Dictionary _aliases = new Dictionary(); + private Dictionary _localizedCommands = new Dictionary(); + private Dictionary _commands = new Dictionary(); private IChatCommand _defaultCommand; public ChatCommandProcessor AddCommand() where T : IChatCommand, new() @@ -38,8 +37,6 @@ namespace Terraria.Chat return this; } - public void AddAlias(LocalizedText text, NetworkText result) => this._aliases[text] = result; - public ChatCommandProcessor AddDefaultCommand() where T : IChatCommand, new() { this.AddCommand(); @@ -62,46 +59,29 @@ namespace Terraria.Chat return !messageText.StartsWith(str) || messageText.Length == str.Length || messageText[str.Length] != ' ' ? "" : messageText.Substring(str.Length + 1); } - public ChatMessage CreateOutgoingMessage(string text) + public bool ProcessOutgoingMessage(ChatMessage message) { - ChatMessage message = new ChatMessage(text); - KeyValuePair keyValuePair1 = this._localizedCommands.FirstOrDefault>((Func, bool>) (pair => ChatCommandProcessor.HasLocalizedCommand(message, pair.Key))); - ChatCommandId chatCommandId = keyValuePair1.Value; - if (keyValuePair1.Key != null) - { - message.SetCommand(chatCommandId); - message.Text = ChatCommandProcessor.RemoveCommandPrefix(message.Text, keyValuePair1.Key); - this._commands[chatCommandId].ProcessOutgoingMessage(message); - } - else - { - bool flag = false; - for (KeyValuePair keyValuePair2 = this._aliases.FirstOrDefault>((Func, bool>) (pair => ChatCommandProcessor.HasLocalizedCommand(message, pair.Key))); keyValuePair2.Key != null; keyValuePair2 = this._aliases.FirstOrDefault>((Func, bool>) (pair => ChatCommandProcessor.HasLocalizedCommand(message, pair.Key)))) - { - flag = true; - message = new ChatMessage(keyValuePair2.Value.ToString()); - } - if (flag) - return this.CreateOutgoingMessage(message.Text); - } - return message; + KeyValuePair keyValuePair = this._localizedCommands.FirstOrDefault>((Func, bool>) (pair => ChatCommandProcessor.HasLocalizedCommand(message, pair.Key))); + ChatCommandId commandId = keyValuePair.Value; + if (keyValuePair.Key == null) + return false; + message.SetCommand(commandId); + message.Text = ChatCommandProcessor.RemoveCommandPrefix(message.Text, keyValuePair.Key); + return true; } - public void ProcessIncomingMessage(ChatMessage message, int clientId) + public bool ProcessReceivedMessage(ChatMessage message, int clientId) { IChatCommand chatCommand; if (this._commands.TryGetValue(message.CommandId, out chatCommand)) { - chatCommand.ProcessIncomingMessage(message.Text, (byte) clientId); - message.Consume(); - } - else - { - if (this._defaultCommand == null) - return; - this._defaultCommand.ProcessIncomingMessage(message.Text, (byte) clientId); - message.Consume(); + chatCommand.ProcessMessage(message.Text, (byte) clientId); + return true; } + if (this._defaultCommand == null) + return false; + this._defaultCommand.ProcessMessage(message.Text, (byte) clientId); + return true; } } } diff --git a/Chat/ChatHelper.cs b/Chat/ChatHelper.cs deleted file mode 100644 index 736010a..0000000 --- a/Chat/ChatHelper.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Chat.ChatHelper -// 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; -using System; -using System.Collections.Generic; -using Terraria.GameContent.NetModules; -using Terraria.GameContent.UI.Chat; -using Terraria.Localization; -using Terraria.Net; - -namespace Terraria.Chat -{ - public static class ChatHelper - { - private static List> _cachedMessages = new List>(); - - public static void DisplayMessageOnClient(NetworkText text, Color color, int playerId) => ChatHelper.DisplayMessage(text, color, byte.MaxValue); - - public static void SendChatMessageToClient(NetworkText text, Color color, int playerId) => ChatHelper.SendChatMessageToClientAs(byte.MaxValue, text, color, playerId); - - public static void SendChatMessageToClientAs( - byte messageAuthor, - NetworkText text, - Color color, - int playerId) - { - if (playerId != Main.myPlayer) - return; - ChatHelper.DisplayMessage(text, color, messageAuthor); - } - - public static void BroadcastChatMessage(NetworkText text, Color color, int excludedPlayer = -1) => ChatHelper.BroadcastChatMessageAs(byte.MaxValue, text, color, excludedPlayer); - - public static void BroadcastChatMessageAs( - byte messageAuthor, - NetworkText text, - Color color, - int excludedPlayer = -1) - { - if (excludedPlayer == Main.myPlayer) - return; - ChatHelper.DisplayMessage(text, color, messageAuthor); - } - - public static bool OnlySendToPlayersWhoAreLoggedIn(int clientIndex) => Netplay.Clients[clientIndex].State == 10; - - public static void SendChatMessageFromClient(ChatMessage message) - { - if (message.IsConsumed) - return; - NetPacket packet = NetTextModule.SerializeClientMessage(message); - NetManager.Instance.SendToServer(packet); - } - - public static void DisplayMessage(NetworkText text, Color color, byte messageAuthor) - { - string str = text.ToString(); - if (messageAuthor < byte.MaxValue) - { - Main.player[(int) messageAuthor].chatOverhead.NewMessage(str, Main.PlayerOverheadChatMessageDisplayTime); - Main.player[(int) messageAuthor].chatOverhead.color = color; - str = NameTagHandler.GenerateTag(Main.player[(int) messageAuthor].name) + " " + str; - } - if (ChatHelper.ShouldCacheMessage()) - ChatHelper.CacheMessage(str, color); - else - Main.NewTextMultiline(str, c: color); - } - - private static void CacheMessage(string message, Color color) => ChatHelper._cachedMessages.Add(new Tuple(message, color)); - - public static void ShowCachedMessages() - { - lock (ChatHelper._cachedMessages) - { - foreach (Tuple cachedMessage in ChatHelper._cachedMessages) - Main.NewTextMultiline(cachedMessage.Item1, c: cachedMessage.Item2); - } - } - - public static void ClearDelayedMessagesCache() => ChatHelper._cachedMessages.Clear(); - - private static bool ShouldCacheMessage() => Main.netMode == 1 && Main.gameMenu; - } -} diff --git a/Chat/ChatMessage.cs b/Chat/ChatMessage.cs index 4749f1f..75aa680 100644 --- a/Chat/ChatMessage.cs +++ b/Chat/ChatMessage.cs @@ -1,29 +1,25 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Chat.ChatMessage -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe -using System; using System.IO; using System.Text; using Terraria.Chat.Commands; namespace Terraria.Chat { - public sealed class ChatMessage + public class ChatMessage { public ChatCommandId CommandId { get; private set; } public string Text { get; set; } - public bool IsConsumed { get; private set; } - public ChatMessage(string message) { this.CommandId = ChatCommandId.FromType(); this.Text = message; - this.IsConsumed = false; } private ChatMessage(string message, ChatCommandId commandId) @@ -34,18 +30,11 @@ namespace Terraria.Chat public void Serialize(BinaryWriter writer) { - if (this.IsConsumed) - throw new InvalidOperationException("Message has already been consumed."); this.CommandId.Serialize(writer); writer.Write(this.Text); } - public int GetMaxSerializedSize() - { - if (this.IsConsumed) - throw new InvalidOperationException("Message has already been consumed."); - return 0 + this.CommandId.GetMaxSerializedSize() + (4 + Encoding.UTF8.GetByteCount(this.Text)); - } + public int GetMaxSerializedSize() => 0 + this.CommandId.GetMaxSerializedSize() + (4 + Encoding.UTF8.GetByteCount(this.Text)); public static ChatMessage Deserialize(BinaryReader reader) { @@ -53,20 +42,8 @@ namespace Terraria.Chat return new ChatMessage(reader.ReadString(), commandId); } - public void SetCommand(ChatCommandId commandId) - { - if (this.IsConsumed) - throw new InvalidOperationException("Message has already been consumed."); - this.CommandId = commandId; - } + public void SetCommand(ChatCommandId commandId) => this.CommandId = commandId; - public void SetCommand() where T : IChatCommand - { - if (this.IsConsumed) - throw new InvalidOperationException("Message has already been consumed."); - this.CommandId = ChatCommandId.FromType(); - } - - public void Consume() => this.IsConsumed = true; + public void SetCommand() where T : IChatCommand => this.CommandId = ChatCommandId.FromType(); } } diff --git a/Chat/Commands/ChatCommandAttribute.cs b/Chat/Commands/ChatCommandAttribute.cs index 8836631..b748c65 100644 --- a/Chat/Commands/ChatCommandAttribute.cs +++ b/Chat/Commands/ChatCommandAttribute.cs @@ -1,14 +1,14 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Chat.Commands.ChatCommandAttribute -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; namespace Terraria.Chat.Commands { - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, Inherited = false)] + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = false, Inherited = false)] public sealed class ChatCommandAttribute : Attribute { public readonly string Name; diff --git a/Chat/Commands/EmojiCommand.cs b/Chat/Commands/EmojiCommand.cs deleted file mode 100644 index c0f2aeb..0000000 --- a/Chat/Commands/EmojiCommand.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Chat.Commands.EmojiCommand -// 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 Terraria.GameContent.UI; -using Terraria.Localization; - -namespace Terraria.Chat.Commands -{ - [ChatCommand("Emoji")] - public class EmojiCommand : IChatCommand - { - public const int PlayerEmojiDuration = 360; - private readonly Dictionary _byName = new Dictionary(); - - public EmojiCommand() => this.Initialize(); - - public void Initialize() - { - this._byName.Clear(); - for (int id = 0; id < 145; ++id) - { - LocalizedText emojiName = Lang.GetEmojiName(id); - if (emojiName != LocalizedText.Empty) - this._byName[emojiName] = id; - } - } - - public void ProcessIncomingMessage(string text, byte clientId) - { - } - - public void ProcessOutgoingMessage(ChatMessage message) - { - int result = -1; - if (int.TryParse(message.Text, out result)) - { - if (result < 0 || result >= 145) - return; - } - else - result = -1; - if (result == -1) - { - foreach (LocalizedText key in this._byName.Keys) - { - if (message.Text == key.Value) - { - result = this._byName[key]; - break; - } - } - } - if (result != -1) - { - if (Main.netMode == 0) - { - EmoteBubble.NewBubble(result, new WorldUIAnchor((Entity) Main.LocalPlayer), 360); - EmoteBubble.CheckForNPCsToReactToEmoteBubble(result, Main.LocalPlayer); - } - else - NetMessage.SendData(120, number: Main.myPlayer, number2: ((float) result)); - } - message.Consume(); - } - - public void PrintWarning(string text) => throw new Exception("This needs localized text!"); - } -} diff --git a/Chat/Commands/EmoteCommand.cs b/Chat/Commands/EmoteCommand.cs index 7cba4c1..fde3d4d 100644 --- a/Chat/Commands/EmoteCommand.cs +++ b/Chat/Commands/EmoteCommand.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Chat.Commands.EmoteCommand -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -14,16 +14,12 @@ namespace Terraria.Chat.Commands { private static readonly Color RESPONSE_COLOR = new Color(200, 100, 0); - public void ProcessIncomingMessage(string text, byte clientId) + public void ProcessMessage(string text, byte clientId) { if (!(text != "")) return; text = string.Format("*{0} {1}", (object) Main.player[(int) clientId].name, (object) text); - ChatHelper.BroadcastChatMessage(NetworkText.FromLiteral(text), EmoteCommand.RESPONSE_COLOR); - } - - public void ProcessOutgoingMessage(ChatMessage message) - { + NetMessage.BroadcastChatMessage(NetworkText.FromLiteral(text), EmoteCommand.RESPONSE_COLOR); } } } diff --git a/Chat/Commands/HelpCommand.cs b/Chat/Commands/HelpCommand.cs deleted file mode 100644 index 5677bc5..0000000 --- a/Chat/Commands/HelpCommand.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Chat.Commands.HelpCommand -// 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; -using System.Collections.Generic; -using Terraria.Localization; - -namespace Terraria.Chat.Commands -{ - [ChatCommand("Help")] - public class HelpCommand : IChatCommand - { - private static readonly Color RESPONSE_COLOR = new Color((int) byte.MaxValue, 240, 20); - - public void ProcessIncomingMessage(string text, byte clientId) => ChatHelper.SendChatMessageToClient(HelpCommand.ComposeMessage(HelpCommand.GetCommandAliasesByID()), HelpCommand.RESPONSE_COLOR, (int) clientId); - - private static Dictionary> GetCommandAliasesByID() - { - LocalizedText[] all = Language.FindAll(Lang.CreateDialogFilter("ChatCommand.", Lang.CreateDialogSubstitutionObject())); - Dictionary> dictionary = new Dictionary>(); - foreach (LocalizedText localizedText in all) - { - string key = localizedText.Key.Replace("ChatCommand.", ""); - int length = key.IndexOf('_'); - if (length != -1) - key = key.Substring(0, length); - List localizedTextList; - if (!dictionary.TryGetValue(key, out localizedTextList)) - { - localizedTextList = new List(); - dictionary[key] = localizedTextList; - } - localizedTextList.Add(localizedText); - } - return dictionary; - } - - private static NetworkText ComposeMessage( - Dictionary> aliases) - { - string text = ""; - for (int index = 0; index < aliases.Count; ++index) - text = text + "{" + (object) index + "}\n"; - List networkTextList = new List(); - foreach (KeyValuePair> alias in aliases) - networkTextList.Add(Language.GetText("ChatCommandDescription." + alias.Key).ToNetworkText()); - return NetworkText.FromFormattable(text, (object[]) networkTextList.ToArray()); - } - - public void ProcessOutgoingMessage(ChatMessage message) - { - } - } -} diff --git a/Chat/Commands/IChatCommand.cs b/Chat/Commands/IChatCommand.cs index d0ee042..49eb579 100644 --- a/Chat/Commands/IChatCommand.cs +++ b/Chat/Commands/IChatCommand.cs @@ -1,15 +1,13 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Chat.Commands.IChatCommand -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Chat.Commands { public interface IChatCommand { - void ProcessIncomingMessage(string text, byte clientId); - - void ProcessOutgoingMessage(ChatMessage message); + void ProcessMessage(string text, byte clientId); } } diff --git a/Chat/Commands/ListPlayersCommand.cs b/Chat/Commands/ListPlayersCommand.cs index f792211..64cd761 100644 --- a/Chat/Commands/ListPlayersCommand.cs +++ b/Chat/Commands/ListPlayersCommand.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Chat.Commands.ListPlayersCommand -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -17,10 +17,6 @@ namespace Terraria.Chat.Commands { private static readonly Color RESPONSE_COLOR = new Color((int) byte.MaxValue, 240, 20); - public void ProcessIncomingMessage(string text, byte clientId) => ChatHelper.SendChatMessageToClient(NetworkText.FromLiteral(string.Join(", ", ((IEnumerable) Main.player).Where((Func) (player => player.active)).Select((Func) (player => player.name)))), ListPlayersCommand.RESPONSE_COLOR, (int) clientId); - - public void ProcessOutgoingMessage(ChatMessage message) - { - } + public void ProcessMessage(string text, byte clientId) => NetMessage.SendChatMessageToClient(NetworkText.FromLiteral(string.Join(", ", ((IEnumerable) Main.player).Where((Func) (player => player.active)).Select((Func) (player => player.name)))), ListPlayersCommand.RESPONSE_COLOR, (int) clientId); } } diff --git a/Chat/Commands/PartyChatCommand.cs b/Chat/Commands/PartyChatCommand.cs index b91b5e9..e979180 100644 --- a/Chat/Commands/PartyChatCommand.cs +++ b/Chat/Commands/PartyChatCommand.cs @@ -1,11 +1,13 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Chat.Commands.PartyChatCommand -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; +using Terraria.GameContent.NetModules; using Terraria.Localization; +using Terraria.Net; namespace Terraria.Chat.Commands { @@ -14,7 +16,7 @@ namespace Terraria.Chat.Commands { private static readonly Color ERROR_COLOR = new Color((int) byte.MaxValue, 240, 20); - public void ProcessIncomingMessage(string text, byte clientId) + public void ProcessMessage(string text, byte clientId) { int team = Main.player[(int) clientId].team; Color color = Main.teamColor[team]; @@ -29,15 +31,18 @@ namespace Terraria.Chat.Commands for (int playerId = 0; playerId < (int) byte.MaxValue; ++playerId) { if (Main.player[playerId].team == team) - ChatHelper.SendChatMessageToClientAs(clientId, NetworkText.FromLiteral(text), color, playerId); + { + NetPacket packet = NetTextModule.SerializeServerMessage(NetworkText.FromLiteral(text), color, clientId); + NetManager.Instance.SendToClient(packet, playerId); + } } } } - public void ProcessOutgoingMessage(ChatMessage message) + private void SendNoTeamError(byte clientId) { + NetPacket packet = NetTextModule.SerializeServerMessage(Lang.mp[10].ToNetworkText(), PartyChatCommand.ERROR_COLOR); + NetManager.Instance.SendToClient(packet, (int) clientId); } - - private void SendNoTeamError(byte clientId) => ChatHelper.SendChatMessageToClient(Lang.mp[10].ToNetworkText(), PartyChatCommand.ERROR_COLOR, (int) clientId); } } diff --git a/Chat/Commands/RockPaperScissorsCommand.cs b/Chat/Commands/RockPaperScissorsCommand.cs deleted file mode 100644 index 60037c6..0000000 --- a/Chat/Commands/RockPaperScissorsCommand.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Chat.Commands.RockPaperScissorsCommand -// 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 Terraria.GameContent.UI; - -namespace Terraria.Chat.Commands -{ - [ChatCommand("RPS")] - public class RockPaperScissorsCommand : IChatCommand - { - public void ProcessIncomingMessage(string text, byte clientId) - { - } - - public void ProcessOutgoingMessage(ChatMessage message) - { - int num = Main.rand.NextFromList(37, 38, 36); - if (Main.netMode == 0) - { - EmoteBubble.NewBubble(num, new WorldUIAnchor((Entity) Main.LocalPlayer), 360); - EmoteBubble.CheckForNPCsToReactToEmoteBubble(num, Main.LocalPlayer); - } - else - NetMessage.SendData(120, number: Main.myPlayer, number2: ((float) num)); - message.Consume(); - } - } -} diff --git a/Chat/Commands/RollCommand.cs b/Chat/Commands/RollCommand.cs index 6194b60..d989833 100644 --- a/Chat/Commands/RollCommand.cs +++ b/Chat/Commands/RollCommand.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Chat.Commands.RollCommand -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -14,14 +14,12 @@ namespace Terraria.Chat.Commands { private static readonly Color RESPONSE_COLOR = new Color((int) byte.MaxValue, 240, 20); - public void ProcessIncomingMessage(string text, byte clientId) + public string InternalName => "roll"; + + public void ProcessMessage(string text, byte clientId) { int num = Main.rand.Next(1, 101); - ChatHelper.BroadcastChatMessage(NetworkText.FromFormattable("*{0} {1} {2}", (object) Main.player[(int) clientId].name, (object) Lang.mp[9].ToNetworkText(), (object) num), RollCommand.RESPONSE_COLOR); - } - - public void ProcessOutgoingMessage(ChatMessage message) - { + NetMessage.BroadcastChatMessage(NetworkText.FromFormattable("*{0} {1} {2}", (object) Main.player[(int) clientId].name, (object) Lang.mp[9].ToNetworkText(), (object) num), RollCommand.RESPONSE_COLOR); } } } diff --git a/Chat/Commands/SayChatCommand.cs b/Chat/Commands/SayChatCommand.cs index d3045b5..8d2d69e 100644 --- a/Chat/Commands/SayChatCommand.cs +++ b/Chat/Commands/SayChatCommand.cs @@ -1,20 +1,24 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Chat.Commands.SayChatCommand -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe +using System; +using Terraria.GameContent.NetModules; using Terraria.Localization; +using Terraria.Net; namespace Terraria.Chat.Commands { [ChatCommand("Say")] public class SayChatCommand : IChatCommand { - public void ProcessIncomingMessage(string text, byte clientId) => ChatHelper.BroadcastChatMessageAs(clientId, NetworkText.FromLiteral(text), Main.player[(int) clientId].ChatColor()); - - public void ProcessOutgoingMessage(ChatMessage message) + public void ProcessMessage(string text, byte clientId) { + NetPacket packet = NetTextModule.SerializeServerMessage(NetworkText.FromLiteral(text), Main.player[(int) clientId].ChatColor(), clientId); + NetManager.Instance.Broadcast(packet); + Console.WriteLine("<{0}> {1}", (object) Main.player[(int) clientId].name, (object) text); } } } diff --git a/Chat/IChatProcessor.cs b/Chat/IChatProcessor.cs index bf57a92..9d3a1db 100644 --- a/Chat/IChatProcessor.cs +++ b/Chat/IChatProcessor.cs @@ -1,15 +1,15 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Chat.IChatProcessor -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Chat { public interface IChatProcessor { - void ProcessIncomingMessage(ChatMessage message, int clientId); + bool ProcessReceivedMessage(ChatMessage message, int clientId); - ChatMessage CreateOutgoingMessage(string text); + bool ProcessOutgoingMessage(ChatMessage message); } } diff --git a/Chest.cs b/Chest.cs index 4fbe190..309370d 100644 --- a/Chest.cs +++ b/Chest.cs @@ -1,15 +1,12 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Chest -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; -using System.Collections.Generic; -using Terraria.Audio; using Terraria.DataStructures; using Terraria.GameContent.Achievements; -using Terraria.GameContent.Bestiary; using Terraria.GameContent.Events; using Terraria.ID; using Terraria.ObjectData; @@ -18,16 +15,15 @@ namespace Terraria { public class Chest { - public const float chestStackRange = 250f; public const int maxChestTypes = 52; public static int[] chestTypeToIcon = new int[52]; public static int[] chestItemSpawn = new int[52]; - public const int maxChestTypes2 = 14; - public static int[] chestTypeToIcon2 = new int[14]; - public static int[] chestItemSpawn2 = new int[14]; - public const int maxDresserTypes = 40; - public static int[] dresserTypeToIcon = new int[40]; - public static int[] dresserItemSpawn = new int[40]; + public const int maxChestTypes2 = 2; + public static int[] chestTypeToIcon2 = new int[2]; + public static int[] chestItemSpawn2 = new int[2]; + public const int maxDresserTypes = 32; + public static int[] dresserTypeToIcon = new int[32]; + public static int[] dresserItemSpawn = new int[32]; public const int maxItems = 40; public const int MaxNameLength = 20; public Item[] item; @@ -37,7 +33,6 @@ namespace Terraria public string name; public int frameCounter; public int frame; - private static HashSet _chestInUse = new HashSet(); public Chest(bool bank = false) { @@ -127,19 +122,6 @@ namespace Terraria int[] chestTypeToIcon2 = Chest.chestTypeToIcon2; chestTypeToIcon2[0] = chestItemSpawn2[0] = 3884; chestTypeToIcon2[1] = chestItemSpawn2[1] = 3885; - chestTypeToIcon2[2] = chestItemSpawn2[2] = 3939; - chestTypeToIcon2[3] = chestItemSpawn2[3] = 3965; - chestTypeToIcon2[4] = chestItemSpawn2[4] = 3988; - chestTypeToIcon2[5] = chestItemSpawn2[5] = 4153; - chestTypeToIcon2[6] = chestItemSpawn2[6] = 4174; - chestTypeToIcon2[7] = chestItemSpawn2[7] = 4195; - chestTypeToIcon2[8] = chestItemSpawn2[8] = 4216; - chestTypeToIcon2[9] = chestItemSpawn2[9] = 4265; - chestTypeToIcon2[10] = chestItemSpawn2[10] = 4267; - chestTypeToIcon2[11] = chestItemSpawn2[11] = 4574; - chestTypeToIcon2[12] = chestItemSpawn2[12] = 4712; - chestTypeToIcon2[13] = 4714; - chestItemSpawn2[13] = 4712; Chest.dresserTypeToIcon[0] = Chest.dresserItemSpawn[0] = 334; Chest.dresserTypeToIcon[1] = Chest.dresserItemSpawn[1] = 647; Chest.dresserTypeToIcon[2] = Chest.dresserItemSpawn[2] = 648; @@ -172,14 +154,6 @@ namespace Terraria Chest.dresserTypeToIcon[29] = Chest.dresserItemSpawn[29] = 3912; Chest.dresserTypeToIcon[30] = Chest.dresserItemSpawn[30] = 3913; Chest.dresserTypeToIcon[31] = Chest.dresserItemSpawn[31] = 3914; - Chest.dresserTypeToIcon[32] = Chest.dresserItemSpawn[32] = 3934; - Chest.dresserTypeToIcon[33] = Chest.dresserItemSpawn[33] = 3968; - Chest.dresserTypeToIcon[34] = Chest.dresserItemSpawn[34] = 4148; - Chest.dresserTypeToIcon[35] = Chest.dresserItemSpawn[35] = 4169; - Chest.dresserTypeToIcon[36] = Chest.dresserItemSpawn[36] = 4190; - Chest.dresserTypeToIcon[37] = Chest.dresserItemSpawn[37] = 4211; - Chest.dresserTypeToIcon[38] = Chest.dresserItemSpawn[38] = 4301; - Chest.dresserTypeToIcon[39] = Chest.dresserItemSpawn[39] = 4569; } private static bool IsPlayerInChest(int i) @@ -192,25 +166,7 @@ namespace Terraria return false; } - public static List GetCurrentlyOpenChests() - { - List intList = new List(); - for (int index = 0; index < (int) byte.MaxValue; ++index) - { - if (Main.player[index].chest > -1) - intList.Add(Main.player[index].chest); - } - return intList; - } - - public static bool IsLocked(int x, int y) => Chest.IsLocked(Main.tile[x, y]); - - public static bool IsLocked(Tile t) - { - if (t == null || t.type == (ushort) 21 && (t.frameX >= (short) 72 && t.frameX <= (short) 106 || t.frameX >= (short) 144 && t.frameX <= (short) 178 || t.frameX >= (short) 828 && t.frameX <= (short) 1006 || t.frameX >= (short) 1296 && t.frameX <= (short) 1330 || t.frameX >= (short) 1368 && t.frameX <= (short) 1402 || t.frameX >= (short) 1440 && t.frameX <= (short) 1474)) - return true; - return t.type == (ushort) 467 && (int) t.frameX / 36 == 13; - } + public static bool isLocked(int x, int y) => Main.tile[x, y] == null || Main.tile[x, y].frameX >= (short) 72 && Main.tile[x, y].frameX <= (short) 106 || Main.tile[x, y].frameX >= (short) 144 && Main.tile[x, y].frameX <= (short) 178 || Main.tile[x, y].frameX >= (short) 828 && Main.tile[x, y].frameX <= (short) 1006 || Main.tile[x, y].frameX >= (short) 1296 && Main.tile[x, y].frameX <= (short) 1330 || Main.tile[x, y].frameX >= (short) 1368 && Main.tile[x, y].frameX <= (short) 1402 || Main.tile[x, y].frameX >= (short) 1440 && Main.tile[x, y].frameX <= (short) 1474; public static void ServerPlaceItem(int plr, int slot) { @@ -222,11 +178,11 @@ namespace Terraria { if (Main.netMode == 1) return item; - for (int i = 0; i < 8000; ++i) + for (int i = 0; i < 1000; ++i) { bool flag1 = false; bool flag2 = false; - if (Main.chest[i] != null && !Chest.IsPlayerInChest(i) && !Chest.IsLocked(Main.chest[i].x, Main.chest[i].y) && (double) (new Vector2((float) (Main.chest[i].x * 16 + 16), (float) (Main.chest[i].y * 16 + 16)) - position).Length() < 250.0) + if (Main.chest[i] != null && !Chest.IsPlayerInChest(i) && !Chest.isLocked(Main.chest[i].x, Main.chest[i].y) && (double) (new Vector2((float) (Main.chest[i].x * 16 + 16), (float) (Main.chest[i].y * 16 + 16)) - position).Length() < 200.0) { for (int index = 0; index < Main.chest[i].item.Length; ++index) { @@ -274,69 +230,49 @@ namespace Terraria public static bool Unlock(int X, int Y) { - if (Main.tile[X, Y] == null || Main.tile[X + 1, Y] == null || Main.tile[X, Y + 1] == null || Main.tile[X + 1, Y + 1] == null) + if (Main.tile[X, Y] == null) return false; - short num1 = 0; - int Type = 0; - Tile tileSafely1 = Framing.GetTileSafely(X, Y); - int type = (int) tileSafely1.type; - int num2 = (int) tileSafely1.frameX / 36; - switch (type) + short num; + int Type; + switch ((int) Main.tile[X, Y].frameX / 36) { - case 21: - switch (num2) - { - case 2: - num1 = (short) 36; - Type = 11; - AchievementsHelper.NotifyProgressionEvent(19); - break; - case 4: - num1 = (short) 36; - Type = 11; - break; - case 23: - case 24: - case 25: - case 26: - case 27: - if (!NPC.downedPlantBoss) - return false; - num1 = (short) 180; - Type = 11; - AchievementsHelper.NotifyProgressionEvent(20); - break; - case 36: - case 38: - case 40: - num1 = (short) 36; - Type = 11; - break; - default: - return false; - } + case 2: + num = (short) 36; + Type = 11; + AchievementsHelper.NotifyProgressionEvent(19); break; - case 467: - if (num2 != 13 || !NPC.downedPlantBoss) + case 4: + num = (short) 36; + Type = 11; + break; + case 23: + case 24: + case 25: + case 26: + case 27: + if (!NPC.downedPlantBoss) return false; - num1 = (short) 36; + num = (short) 180; Type = 11; AchievementsHelper.NotifyProgressionEvent(20); break; + case 36: + case 38: + case 40: + num = (short) 36; + Type = 11; + break; + default: + return false; } - SoundEngine.PlaySound(22, X * 16, Y * 16); - for (int i = X; i <= X + 1; ++i) + Main.PlaySound(22, X * 16, Y * 16); + for (int index1 = X; index1 <= X + 1; ++index1) { - for (int j = Y; j <= Y + 1; ++j) + for (int index2 = Y; index2 <= Y + 1; ++index2) { - Tile tileSafely2 = Framing.GetTileSafely(i, j); - if ((int) tileSafely2.type == type) - { - tileSafely2.frameX -= num1; - Main.tile[i, j] = tileSafely2; - for (int index = 0; index < 4; ++index) - Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, Type); - } + Main.tile[index1, index2].frameX -= num; + for (int index3 = 0; index3 < 4; ++index3) + Dust.NewDust(new Vector2((float) (index1 * 16), (float) (index2 * 16)), 16, 16, Type); } } return true; @@ -357,7 +293,7 @@ namespace Terraria public static int FindChest(int X, int Y) { - for (int index = 0; index < 8000; ++index) + for (int index = 0; index < 1000; ++index) { if (Main.chest[index] != null && Main.chest[index].x == X && Main.chest[index].y == Y) return index; @@ -367,7 +303,7 @@ namespace Terraria public static int FindChestByGuessing(int X, int Y) { - for (int index = 0; index < 8000; ++index) + for (int index = 0; index < 1000; ++index) { if (Main.chest[index] != null && Main.chest[index].x >= X && Main.chest[index].x < X + 2 && Main.chest[index].y >= Y && Main.chest[index].y < Y + 2) return index; @@ -375,16 +311,10 @@ namespace Terraria return -1; } - public static int FindEmptyChest( - int x, - int y, - int type = 21, - int style = 0, - int direction = 1, - int alternate = 0) + public static int FindEmptyChest(int x, int y, int type = 21, int style = 0, int direction = 1) { int num = -1; - for (int index = 0; index < 8000; ++index) + for (int index = 0; index < 1000; ++index) { Chest chest = Main.chest[index]; if (chest != null) @@ -412,13 +342,7 @@ namespace Terraria return false; } - public static int AfterPlacement_Hook( - int x, - int y, - int type = 21, - int style = 0, - int direction = 1, - int alternate = 0) + public static int AfterPlacement_Hook(int x, int y, int type = 21, int style = 0, int direction = 1) { Point16 baseCoords = new Point16(x, y); TileObjectData.OriginToTopLeft(type, style, ref baseCoords); @@ -473,7 +397,7 @@ namespace Terraria public static bool CanDestroyChest(int X, int Y) { - for (int index1 = 0; index1 < 8000; ++index1) + for (int index1 = 0; index1 < 1000; ++index1) { Chest chest = Main.chest[index1]; if (chest != null && chest.x == X && chest.y == Y) @@ -491,7 +415,7 @@ namespace Terraria public static bool DestroyChest(int X, int Y) { - for (int index1 = 0; index1 < 8000; ++index1) + for (int index1 = 0; index1 < 1000; ++index1) { Chest chest = Main.chest[index1]; if (chest != null && chest.x == X && chest.y == Y) @@ -532,11 +456,8 @@ namespace Terraria } } - public void AddItemToShop(Item newItem) + public void AddShop(Item newItem) { - int num1 = Main.shopSellbackHelper.Remove(newItem); - if (num1 >= newItem.stack) - return; for (int index = 0; index < 39; ++index) { if (this.item[index] == null || this.item[index].type == 0) @@ -544,8 +465,12 @@ namespace Terraria this.item[index] = newItem.Clone(); this.item[index].favorited = false; this.item[index].buyOnce = true; - this.item[index].stack -= num1; - int num2 = this.item[index].value; + if (this.item[index].value <= 0) + break; + this.item[index].value /= 5; + if (this.item[index].value >= 1) + break; + this.item[index].value = 1; break; } } @@ -555,25 +480,16 @@ namespace Terraria { for (int index = 0; index < 40; ++index) Main.travelShop[index] = 0; - Player player1 = (Player) null; - for (int index = 0; index < (int) byte.MaxValue; ++index) - { - Player player2 = Main.player[index]; - if (player2.active && (player1 == null || (double) player1.luck < (double) player2.luck)) - player1 = player2; - } - if (player1 == null) - player1 = new Player(); int num1 = Main.rand.Next(4, 7); - if (player1.RollLuck(4) == 0) + if (Main.rand.Next(4) == 0) ++num1; - if (player1.RollLuck(8) == 0) + if (Main.rand.Next(8) == 0) ++num1; - if (player1.RollLuck(16) == 0) + if (Main.rand.Next(16) == 0) ++num1; - if (player1.RollLuck(32) == 0) + if (Main.rand.Next(32) == 0) ++num1; - if (Main.expertMode && player1.RollLuck(2) == 0) + if (Main.expertMode && Main.rand.Next(2) == 0) ++num1; int index1 = 0; int num2 = 0; @@ -589,153 +505,107 @@ namespace Terraria while (num2 < num1) { int num3 = 0; - if (player1.RollLuck(numArray[4]) == 0) + if (Main.rand.Next(numArray[4]) == 0) num3 = 3309; - if (player1.RollLuck(numArray[3]) == 0) + if (Main.rand.Next(numArray[3]) == 0) num3 = 3314; - if (player1.RollLuck(numArray[5]) == 0) + if (Main.rand.Next(numArray[5]) == 0) num3 = 1987; - if (player1.RollLuck(numArray[4]) == 0 && Main.hardMode) + if (Main.rand.Next(numArray[4]) == 0 && Main.hardMode) num3 = 2270; - if (player1.RollLuck(numArray[4]) == 0 && Main.hardMode) - num3 = 4760; - if (player1.RollLuck(numArray[4]) == 0) + if (Main.rand.Next(numArray[4]) == 0) num3 = 2278; - if (player1.RollLuck(numArray[4]) == 0) + if (Main.rand.Next(numArray[4]) == 0) num3 = 2271; - if (player1.RollLuck(numArray[4]) == 0 && Main.hardMode && NPC.downedMechBossAny) - num3 = 4060; - if (player1.RollLuck(numArray[4]) == 0 && (NPC.downedBoss1 || NPC.downedBoss2 || NPC.downedBoss3 || NPC.downedQueenBee || Main.hardMode)) - { - num3 = 4347; - if (Main.hardMode) - num3 = 4348; - } - if (player1.RollLuck(numArray[3]) == 0 && Main.hardMode && NPC.downedPlantBoss) + if (Main.rand.Next(numArray[3]) == 0 && Main.hardMode && NPC.downedPlantBoss) num3 = 2223; - if (player1.RollLuck(numArray[3]) == 0) + if (Main.rand.Next(numArray[3]) == 0) num3 = 2272; - if (player1.RollLuck(numArray[3]) == 0) + if (Main.rand.Next(numArray[3]) == 0) num3 = 2219; - if (player1.RollLuck(numArray[3]) == 0) + if (Main.rand.Next(numArray[3]) == 0) num3 = 2276; - if (player1.RollLuck(numArray[3]) == 0) + if (Main.rand.Next(numArray[3]) == 0) num3 = 2284; - if (player1.RollLuck(numArray[3]) == 0) + if (Main.rand.Next(numArray[3]) == 0) num3 = 2285; - if (player1.RollLuck(numArray[3]) == 0) + if (Main.rand.Next(numArray[3]) == 0) num3 = 2286; - if (player1.RollLuck(numArray[3]) == 0) + if (Main.rand.Next(numArray[3]) == 0) num3 = 2287; - if (player1.RollLuck(numArray[3]) == 0) - num3 = 4744; - if (player1.RollLuck(numArray[3]) == 0) + if (Main.rand.Next(numArray[3]) == 0) num3 = 2296; - if (player1.RollLuck(numArray[3]) == 0) + if (Main.rand.Next(numArray[3]) == 0) num3 = 3628; - if (player1.RollLuck(numArray[3]) == 0 && Main.hardMode) - num3 = 4091; - if (player1.RollLuck(numArray[3]) == 0) - num3 = 4603; - if (player1.RollLuck(numArray[3]) == 0) - num3 = 4604; - if (player1.RollLuck(numArray[3]) == 0) - num3 = 4605; - if (player1.RollLuck(numArray[3]) == 0) - num3 = 4550; - if (player1.RollLuck(numArray[2]) == 0 && WorldGen.shadowOrbSmashed) + if (Main.rand.Next(numArray[2]) == 0 && WorldGen.shadowOrbSmashed) num3 = 2269; - if (player1.RollLuck(numArray[2]) == 0) + if (Main.rand.Next(numArray[2]) == 0) num3 = 2177; - if (player1.RollLuck(numArray[2]) == 0) + if (Main.rand.Next(numArray[2]) == 0) num3 = 1988; - if (player1.RollLuck(numArray[2]) == 0) + if (Main.rand.Next(numArray[2]) == 0) num3 = 2275; - if (player1.RollLuck(numArray[2]) == 0) + if (Main.rand.Next(numArray[2]) == 0) num3 = 2279; - if (player1.RollLuck(numArray[2]) == 0) + if (Main.rand.Next(numArray[2]) == 0) num3 = 2277; - if (player1.RollLuck(numArray[2]) == 0) - num3 = 4555; - if (player1.RollLuck(numArray[2]) == 0) - num3 = 4321; - if (player1.RollLuck(numArray[2]) == 0) - num3 = 4323; - if (player1.RollLuck(numArray[2]) == 0) - num3 = 4549; - if (player1.RollLuck(numArray[2]) == 0) - num3 = 4561; - if (player1.RollLuck(numArray[2]) == 0) - num3 = 4774; - if (player1.RollLuck(numArray[2]) == 0) - num3 = 4562; - if (player1.RollLuck(numArray[2]) == 0) - num3 = 4558; - if (player1.RollLuck(numArray[2]) == 0) - num3 = 4559; - if (player1.RollLuck(numArray[2]) == 0) - num3 = 4563; - if (player1.RollLuck(numArray[2]) == 0) - num3 = 4666; - if (player1.RollLuck(numArray[2]) == 0 && NPC.downedBoss1) + if (Main.rand.Next(numArray[2]) == 0 && NPC.downedBoss1) num3 = 3262; - if (player1.RollLuck(numArray[2]) == 0 && NPC.downedMechBossAny) + if (Main.rand.Next(numArray[2]) == 0 && NPC.downedMechBossAny) num3 = 3284; - if (player1.RollLuck(numArray[2]) == 0 && Main.hardMode && NPC.downedMoonlord) + if (Main.rand.Next(numArray[2]) == 0 && Main.hardMode && NPC.downedMoonlord) num3 = 3596; - if (player1.RollLuck(numArray[2]) == 0 && Main.hardMode && NPC.downedMartians) + if (Main.rand.Next(numArray[2]) == 0 && Main.hardMode && NPC.downedMartians) num3 = 2865; - if (player1.RollLuck(numArray[2]) == 0 && Main.hardMode && NPC.downedMartians) + if (Main.rand.Next(numArray[2]) == 0 && Main.hardMode && NPC.downedMartians) num3 = 2866; - if (player1.RollLuck(numArray[2]) == 0 && Main.hardMode && NPC.downedMartians) + if (Main.rand.Next(numArray[2]) == 0 && Main.hardMode && NPC.downedMartians) num3 = 2867; - if (player1.RollLuck(numArray[2]) == 0 && Main.xMas) + if (Main.rand.Next(numArray[2]) == 0 && Main.xMas) num3 = 3055; - if (player1.RollLuck(numArray[2]) == 0 && Main.xMas) + if (Main.rand.Next(numArray[2]) == 0 && Main.xMas) num3 = 3056; - if (player1.RollLuck(numArray[2]) == 0 && Main.xMas) + if (Main.rand.Next(numArray[2]) == 0 && Main.xMas) num3 = 3057; - if (player1.RollLuck(numArray[2]) == 0 && Main.xMas) + if (Main.rand.Next(numArray[2]) == 0 && Main.xMas) num3 = 3058; - if (player1.RollLuck(numArray[2]) == 0 && Main.xMas) + if (Main.rand.Next(numArray[2]) == 0 && Main.xMas) num3 = 3059; - if (player1.RollLuck(numArray[1]) == 0) + if (Main.rand.Next(numArray[1]) == 0) num3 = 2214; - if (player1.RollLuck(numArray[1]) == 0) + if (Main.rand.Next(numArray[1]) == 0) num3 = 2215; - if (player1.RollLuck(numArray[1]) == 0) + if (Main.rand.Next(numArray[1]) == 0) num3 = 2216; - if (player1.RollLuck(numArray[1]) == 0) + if (Main.rand.Next(numArray[1]) == 0) num3 = 2217; - if (player1.RollLuck(numArray[1]) == 0) + if (Main.rand.Next(numArray[1]) == 0) num3 = 3624; - if (player1.RollLuck(numArray[1]) == 0) + if (Main.rand.Next(numArray[1]) == 0) num3 = 2273; - if (player1.RollLuck(numArray[1]) == 0) + if (Main.rand.Next(numArray[1]) == 0) num3 = 2274; - if (player1.RollLuck(numArray[0]) == 0) + if (Main.rand.Next(numArray[0]) == 0) num3 = 2266; - if (player1.RollLuck(numArray[0]) == 0) + if (Main.rand.Next(numArray[0]) == 0) num3 = 2267; - if (player1.RollLuck(numArray[0]) == 0) + if (Main.rand.Next(numArray[0]) == 0) num3 = 2268; - if (player1.RollLuck(numArray[0]) == 0) + if (Main.rand.Next(numArray[0]) == 0) num3 = 2281 + Main.rand.Next(3); - if (player1.RollLuck(numArray[0]) == 0) + if (Main.rand.Next(numArray[0]) == 0) num3 = 2258; - if (player1.RollLuck(numArray[0]) == 0) + if (Main.rand.Next(numArray[0]) == 0) num3 = 2242; - if (player1.RollLuck(numArray[0]) == 0) + if (Main.rand.Next(numArray[0]) == 0) num3 = 2260; - if (player1.RollLuck(numArray[0]) == 0) + if (Main.rand.Next(numArray[0]) == 0) num3 = 3637; - if (player1.RollLuck(numArray[0]) == 0) - num3 = 4420; - if (player1.RollLuck(numArray[0]) == 0) + if (Main.rand.Next(numArray[0]) == 0) num3 = 3119; - if (player1.RollLuck(numArray[0]) == 0) + if (Main.rand.Next(numArray[0]) == 0) num3 = 3118; - if (player1.RollLuck(numArray[0]) == 0) + if (Main.rand.Next(numArray[0]) == 0) num3 = 3099; if (num3 != 0) { @@ -782,32 +652,6 @@ namespace Terraria Main.travelShop[index3] = 2262; index1 = index3 + 1; } - if (num3 == 4555) - { - Main.travelShop[index1] = 4556; - int index4 = index1 + 1; - Main.travelShop[index4] = 4557; - index1 = index4 + 1; - } - if (num3 == 4321) - { - Main.travelShop[index1] = 4322; - ++index1; - } - if (num3 == 4323) - { - Main.travelShop[index1] = 4324; - int index5 = index1 + 1; - Main.travelShop[index5] = 4365; - index1 = index5 + 1; - } - if (num3 == 4666) - { - Main.travelShop[index1] = 4664; - int index6 = index1 + 1; - Main.travelShop[index6] = 4665; - index1 = index6 + 1; - } if (num3 == 3637) { --index1; @@ -815,63 +659,63 @@ namespace Terraria { case 0: int[] travelShop1 = Main.travelShop; - int index7 = index1; - int num4 = index7 + 1; - travelShop1[index7] = 3637; + int index4 = index1; + int num4 = index4 + 1; + travelShop1[index4] = 3637; int[] travelShop2 = Main.travelShop; - int index8 = num4; - index1 = index8 + 1; - travelShop2[index8] = 3642; + int index5 = num4; + index1 = index5 + 1; + travelShop2[index5] = 3642; continue; case 1: int[] travelShop3 = Main.travelShop; - int index9 = index1; - int num5 = index9 + 1; - travelShop3[index9] = 3621; + int index6 = index1; + int num5 = index6 + 1; + travelShop3[index6] = 3621; int[] travelShop4 = Main.travelShop; - int index10 = num5; - index1 = index10 + 1; - travelShop4[index10] = 3622; + int index7 = num5; + index1 = index7 + 1; + travelShop4[index7] = 3622; continue; case 2: int[] travelShop5 = Main.travelShop; - int index11 = index1; - int num6 = index11 + 1; - travelShop5[index11] = 3634; + int index8 = index1; + int num6 = index8 + 1; + travelShop5[index8] = 3634; int[] travelShop6 = Main.travelShop; - int index12 = num6; - index1 = index12 + 1; - travelShop6[index12] = 3639; + int index9 = num6; + index1 = index9 + 1; + travelShop6[index9] = 3639; continue; case 3: int[] travelShop7 = Main.travelShop; - int index13 = index1; - int num7 = index13 + 1; - travelShop7[index13] = 3633; + int index10 = index1; + int num7 = index10 + 1; + travelShop7[index10] = 3633; int[] travelShop8 = Main.travelShop; - int index14 = num7; - index1 = index14 + 1; - travelShop8[index14] = 3638; + int index11 = num7; + index1 = index11 + 1; + travelShop8[index11] = 3638; continue; case 4: int[] travelShop9 = Main.travelShop; - int index15 = index1; - int num8 = index15 + 1; - travelShop9[index15] = 3635; + int index12 = index1; + int num8 = index12 + 1; + travelShop9[index12] = 3635; int[] travelShop10 = Main.travelShop; - int index16 = num8; - index1 = index16 + 1; - travelShop10[index16] = 3640; + int index13 = num8; + index1 = index13 + 1; + travelShop10[index13] = 3640; continue; case 5: int[] travelShop11 = Main.travelShop; - int index17 = index1; - int num9 = index17 + 1; - travelShop11[index17] = 3636; + int index14 = index1; + int num9 = index14 + 1; + travelShop11[index14] = 3636; int[] travelShop12 = Main.travelShop; - int index18 = num9; - index1 = index18 + 1; - travelShop12[index18] = 3641; + int index15 = num9; + index1 = index15 + 1; + travelShop12[index15] = 3641; continue; default: continue; @@ -883,2141 +727,1485 @@ namespace Terraria public void SetupShop(int type) { - bool flag1 = Main.LocalPlayer.currentShoppingSettings.PriceAdjustment <= 0.850000023841858; - Item[] objArray1 = this.item; for (int index = 0; index < 40; ++index) - objArray1[index] = new Item(); + this.item[index] = new Item(); int index1 = 0; switch (type) { case 1: - objArray1[index1].SetDefaults(88); + this.item[index1].SetDefaults(88); int index2 = index1 + 1; - objArray1[index2].SetDefaults(87); + this.item[index2].SetDefaults(87); int index3 = index2 + 1; - objArray1[index3].SetDefaults(35); + this.item[index3].SetDefaults(35); int index4 = index3 + 1; - objArray1[index4].SetDefaults(1991); + this.item[index4].SetDefaults(1991); int index5 = index4 + 1; - objArray1[index5].SetDefaults(3509); + this.item[index5].SetDefaults(3509); int index6 = index5 + 1; - objArray1[index6].SetDefaults(3506); + this.item[index6].SetDefaults(3506); int index7 = index6 + 1; - objArray1[index7].SetDefaults(8); + this.item[index7].SetDefaults(8); int index8 = index7 + 1; - objArray1[index8].SetDefaults(28); + this.item[index8].SetDefaults(28); int index9 = index8 + 1; - objArray1[index9].SetDefaults(110); + this.item[index9].SetDefaults(110); int index10 = index9 + 1; - objArray1[index10].SetDefaults(40); + this.item[index10].SetDefaults(40); int index11 = index10 + 1; - objArray1[index11].SetDefaults(42); + this.item[index11].SetDefaults(42); int index12 = index11 + 1; - objArray1[index12].SetDefaults(965); + this.item[index12].SetDefaults(965); int index13 = index12 + 1; if (Main.player[Main.myPlayer].ZoneSnow) { - objArray1[index13].SetDefaults(967); + this.item[index13].SetDefaults(967); ++index13; } - if (Main.player[Main.myPlayer].ZoneJungle) - { - objArray1[index13].SetDefaults(33); - ++index13; - } - if (Main.dayTime && Main.IsItAHappyWindyDay) - objArray1[index13++].SetDefaults(4074); if (Main.bloodMoon) { - objArray1[index13].SetDefaults(279); + this.item[index13].SetDefaults(279); ++index13; } if (!Main.dayTime) { - objArray1[index13].SetDefaults(282); + this.item[index13].SetDefaults(282); ++index13; } if (NPC.downedBoss3) { - objArray1[index13].SetDefaults(346); + this.item[index13].SetDefaults(346); ++index13; } if (Main.hardMode) { - objArray1[index13].SetDefaults(488); + this.item[index13].SetDefaults(488); ++index13; } for (int index14 = 0; index14 < 58; ++index14) { if (Main.player[Main.myPlayer].inventory[index14].type == 930) { - objArray1[index13].SetDefaults(931); + this.item[index13].SetDefaults(931); int index15 = index13 + 1; - objArray1[index15].SetDefaults(1614); + this.item[index15].SetDefaults(1614); index13 = index15 + 1; break; } } - objArray1[index13].SetDefaults(1786); + this.item[index13].SetDefaults(1786); index1 = index13 + 1; if (Main.hardMode) { - objArray1[index1].SetDefaults(1348); + this.item[index1].SetDefaults(1348); ++index1; } - if (NPC.downedBoss2 || NPC.downedBoss3 || Main.hardMode) - { - Item[] objArray2 = objArray1; - int index16 = index1; - int num = index16 + 1; - objArray2[index16].SetDefaults(4063); - Item[] objArray3 = objArray1; - int index17 = num; - index1 = index17 + 1; - objArray3[index17].SetDefaults(4673); - } if (Main.player[Main.myPlayer].HasItem(3107)) { - objArray1[index1].SetDefaults(3108); + this.item[index1].SetDefaults(3108); ++index1; + } + if (Main.halloween) + { + Item[] objArray1 = this.item; + int index16 = index1; + int num1 = index16 + 1; + objArray1[index16].SetDefaults(3242); + Item[] objArray2 = this.item; + int index17 = num1; + int num2 = index17 + 1; + objArray2[index17].SetDefaults(3243); + Item[] objArray3 = this.item; + int index18 = num2; + index1 = index18 + 1; + objArray3[index18].SetDefaults(3244); break; } break; case 2: - objArray1[index1].SetDefaults(97); - int index18 = index1 + 1; + this.item[index1].SetDefaults(97); + int index19 = index1 + 1; if (Main.bloodMoon || Main.hardMode) { - if (WorldGen.SavedOreTiers.Silver == 168) - { - objArray1[index18].SetDefaults(4915); - ++index18; - } - else - { - objArray1[index18].SetDefaults(278); - ++index18; - } + this.item[index19].SetDefaults(278); + ++index19; } if (NPC.downedBoss2 && !Main.dayTime || Main.hardMode) { - objArray1[index18].SetDefaults(47); - ++index18; + this.item[index19].SetDefaults(47); + ++index19; } - objArray1[index18].SetDefaults(95); - int index19 = index18 + 1; - objArray1[index19].SetDefaults(98); - index1 = index19 + 1; - if (Main.player[Main.myPlayer].ZoneGraveyard) - objArray1[index1++].SetDefaults(4703); + this.item[index19].SetDefaults(95); + int index20 = index19 + 1; + this.item[index20].SetDefaults(98); + index1 = index20 + 1; if (!Main.dayTime) { - objArray1[index1].SetDefaults(324); + this.item[index1].SetDefaults(324); ++index1; } if (Main.hardMode) { - objArray1[index1].SetDefaults(534); + this.item[index1].SetDefaults(534); ++index1; } if (Main.hardMode) { - objArray1[index1].SetDefaults(1432); + this.item[index1].SetDefaults(1432); ++index1; } if (Main.player[Main.myPlayer].HasItem(1258)) { - objArray1[index1].SetDefaults(1261); + this.item[index1].SetDefaults(1261); ++index1; } if (Main.player[Main.myPlayer].HasItem(1835)) { - objArray1[index1].SetDefaults(1836); + this.item[index1].SetDefaults(1836); ++index1; } if (Main.player[Main.myPlayer].HasItem(3107)) { - objArray1[index1].SetDefaults(3108); + this.item[index1].SetDefaults(3108); ++index1; } if (Main.player[Main.myPlayer].HasItem(1782)) { - objArray1[index1].SetDefaults(1783); + this.item[index1].SetDefaults(1783); ++index1; } if (Main.player[Main.myPlayer].HasItem(1784)) { - objArray1[index1].SetDefaults(1785); + this.item[index1].SetDefaults(1785); ++index1; } if (Main.halloween) { - objArray1[index1].SetDefaults(1736); - int index20 = index1 + 1; - objArray1[index20].SetDefaults(1737); - int index21 = index20 + 1; - objArray1[index21].SetDefaults(1738); - index1 = index21 + 1; + this.item[index1].SetDefaults(1736); + int index21 = index1 + 1; + this.item[index21].SetDefaults(1737); + int index22 = index21 + 1; + this.item[index22].SetDefaults(1738); + index1 = index22 + 1; break; } break; case 3: - int index22; + int index23; if (Main.bloodMoon) { if (WorldGen.crimson) { - objArray1[index1].SetDefaults(2886); - int index23 = index1 + 1; - objArray1[index23].SetDefaults(2171); - int index24 = index23 + 1; - objArray1[index24].SetDefaults(4508); - index22 = index24 + 1; + this.item[index1].SetDefaults(2886); + int index24 = index1 + 1; + this.item[index24].SetDefaults(2171); + index23 = index24 + 1; } else { - objArray1[index1].SetDefaults(67); + this.item[index1].SetDefaults(67); int index25 = index1 + 1; - objArray1[index25].SetDefaults(59); - int index26 = index25 + 1; - objArray1[index26].SetDefaults(4504); - index22 = index26 + 1; + this.item[index25].SetDefaults(59); + index23 = index25 + 1; } } else { - objArray1[index1].SetDefaults(66); - int index27 = index1 + 1; - objArray1[index27].SetDefaults(62); - int index28 = index27 + 1; - objArray1[index28].SetDefaults(63); - int index29 = index28 + 1; - objArray1[index29].SetDefaults(745); - index22 = index29 + 1; + this.item[index1].SetDefaults(66); + int index26 = index1 + 1; + this.item[index26].SetDefaults(62); + int index27 = index26 + 1; + this.item[index27].SetDefaults(63); + index23 = index27 + 1; } - if (Main.hardMode && Main.player[Main.myPlayer].ZoneGraveyard) - { - if (WorldGen.crimson) - objArray1[index22].SetDefaults(59); - else - objArray1[index22].SetDefaults(2171); - ++index22; - } - objArray1[index22].SetDefaults(27); - int index30 = index22 + 1; - objArray1[index30].SetDefaults(114); + this.item[index23].SetDefaults(27); + int index28 = index23 + 1; + this.item[index28].SetDefaults(114); + int index29 = index28 + 1; + this.item[index29].SetDefaults(1828); + int index30 = index29 + 1; + this.item[index30].SetDefaults(745); int index31 = index30 + 1; - objArray1[index31].SetDefaults(1828); - int index32 = index31 + 1; - objArray1[index32].SetDefaults(747); - int index33 = index32 + 1; + this.item[index31].SetDefaults(747); + index1 = index31 + 1; if (Main.hardMode) { - objArray1[index33].SetDefaults(746); - ++index33; + this.item[index1].SetDefaults(746); + ++index1; } if (Main.hardMode) { - objArray1[index33].SetDefaults(369); - ++index33; + this.item[index1].SetDefaults(369); + ++index1; } - if (Main.hardMode) + if (Main.shroomTiles > 50) { - objArray1[index33].SetDefaults(4505); - ++index33; - } - if (Main.player[Main.myPlayer].ZoneGlowshroom) - { - objArray1[index33].SetDefaults(194); - ++index33; + this.item[index1].SetDefaults(194); + ++index1; } if (Main.halloween) { - objArray1[index33].SetDefaults(1853); - int index34 = index33 + 1; - objArray1[index34].SetDefaults(1854); - index33 = index34 + 1; + this.item[index1].SetDefaults(1853); + int index32 = index1 + 1; + this.item[index32].SetDefaults(1854); + index1 = index32 + 1; } if (NPC.downedSlimeKing) { - objArray1[index33].SetDefaults(3215); - ++index33; + this.item[index1].SetDefaults(3215); + ++index1; } if (NPC.downedQueenBee) { - objArray1[index33].SetDefaults(3216); - ++index33; + this.item[index1].SetDefaults(3216); + ++index1; } if (NPC.downedBoss1) { - objArray1[index33].SetDefaults(3219); - ++index33; + this.item[index1].SetDefaults(3219); + ++index1; } if (NPC.downedBoss2) { if (WorldGen.crimson) { - objArray1[index33].SetDefaults(3218); - ++index33; + this.item[index1].SetDefaults(3218); + ++index1; } else { - objArray1[index33].SetDefaults(3217); - ++index33; + this.item[index1].SetDefaults(3217); + ++index1; } } if (NPC.downedBoss3) { - objArray1[index33].SetDefaults(3220); - int index35 = index33 + 1; - objArray1[index35].SetDefaults(3221); - index33 = index35 + 1; + this.item[index1].SetDefaults(3220); + int index33 = index1 + 1; + this.item[index33].SetDefaults(3221); + index1 = index33 + 1; } if (Main.hardMode) { - objArray1[index33].SetDefaults(3222); - ++index33; - } - Item[] objArray4 = objArray1; - int index36 = index33; - int num1 = index36 + 1; - objArray4[index36].SetDefaults(4047); - Item[] objArray5 = objArray1; - int index37 = num1; - int num2 = index37 + 1; - objArray5[index37].SetDefaults(4045); - Item[] objArray6 = objArray1; - int index38 = num2; - int num3 = index38 + 1; - objArray6[index38].SetDefaults(4044); - Item[] objArray7 = objArray1; - int index39 = num3; - int num4 = index39 + 1; - objArray7[index39].SetDefaults(4043); - Item[] objArray8 = objArray1; - int index40 = num4; - int num5 = index40 + 1; - objArray8[index40].SetDefaults(4042); - Item[] objArray9 = objArray1; - int index41 = num5; - int num6 = index41 + 1; - objArray9[index41].SetDefaults(4046); - Item[] objArray10 = objArray1; - int index42 = num6; - int num7 = index42 + 1; - objArray10[index42].SetDefaults(4041); - Item[] objArray11 = objArray1; - int index43 = num7; - int num8 = index43 + 1; - objArray11[index43].SetDefaults(4241); - Item[] objArray12 = objArray1; - int index44 = num8; - index1 = index44 + 1; - objArray12[index44].SetDefaults(4048); - if (Main.hardMode) - { - switch (Main.moonPhase / 2) - { - case 0: - Item[] objArray13 = objArray1; - int index45 = index1; - int num9 = index45 + 1; - objArray13[index45].SetDefaults(4430); - Item[] objArray14 = objArray1; - int index46 = num9; - int num10 = index46 + 1; - objArray14[index46].SetDefaults(4431); - Item[] objArray15 = objArray1; - int index47 = num10; - index1 = index47 + 1; - objArray15[index47].SetDefaults(4432); - break; - case 1: - Item[] objArray16 = objArray1; - int index48 = index1; - int num11 = index48 + 1; - objArray16[index48].SetDefaults(4433); - Item[] objArray17 = objArray1; - int index49 = num11; - int num12 = index49 + 1; - objArray17[index49].SetDefaults(4434); - Item[] objArray18 = objArray1; - int index50 = num12; - index1 = index50 + 1; - objArray18[index50].SetDefaults(4435); - break; - case 2: - Item[] objArray19 = objArray1; - int index51 = index1; - int num13 = index51 + 1; - objArray19[index51].SetDefaults(4436); - Item[] objArray20 = objArray1; - int index52 = num13; - int num14 = index52 + 1; - objArray20[index52].SetDefaults(4437); - Item[] objArray21 = objArray1; - int index53 = num14; - index1 = index53 + 1; - objArray21[index53].SetDefaults(4438); - break; - default: - Item[] objArray22 = objArray1; - int index54 = index1; - int num15 = index54 + 1; - objArray22[index54].SetDefaults(4439); - Item[] objArray23 = objArray1; - int index55 = num15; - int num16 = index55 + 1; - objArray23[index55].SetDefaults(4440); - Item[] objArray24 = objArray1; - int index56 = num16; - index1 = index56 + 1; - objArray24[index56].SetDefaults(4441); - break; - } - } - else + this.item[index1].SetDefaults(3222); + ++index1; break; + } break; case 4: - objArray1[index1].SetDefaults(168); - int index57 = index1 + 1; - objArray1[index57].SetDefaults(166); - int index58 = index57 + 1; - objArray1[index58].SetDefaults(167); - index1 = index58 + 1; + this.item[index1].SetDefaults(168); + int index34 = index1 + 1; + this.item[index34].SetDefaults(166); + int index35 = index34 + 1; + this.item[index35].SetDefaults(167); + index1 = index35 + 1; if (Main.hardMode) { - objArray1[index1].SetDefaults(265); + this.item[index1].SetDefaults(265); ++index1; } if (Main.hardMode && NPC.downedPlantBoss && NPC.downedPirates) { - objArray1[index1].SetDefaults(937); + this.item[index1].SetDefaults(937); ++index1; } if (Main.hardMode) { - objArray1[index1].SetDefaults(1347); + this.item[index1].SetDefaults(1347); ++index1; - } - for (int index59 = 0; index59 < 58; ++index59) - { - if (Main.player[Main.myPlayer].inventory[index59].type == 4827) - { - objArray1[index1].SetDefaults(4827); - ++index1; - break; - } - } - for (int index60 = 0; index60 < 58; ++index60) - { - if (Main.player[Main.myPlayer].inventory[index60].type == 4824) - { - objArray1[index1].SetDefaults(4824); - ++index1; - break; - } - } - for (int index61 = 0; index61 < 58; ++index61) - { - if (Main.player[Main.myPlayer].inventory[index61].type == 4825) - { - objArray1[index1].SetDefaults(4825); - ++index1; - break; - } - } - for (int index62 = 0; index62 < 58; ++index62) - { - if (Main.player[Main.myPlayer].inventory[index62].type == 4826) - { - objArray1[index1].SetDefaults(4826); - ++index1; - break; - } + break; } break; case 5: - objArray1[index1].SetDefaults(254); - int index63 = index1 + 1; - objArray1[index63].SetDefaults(981); - int index64 = index63 + 1; + this.item[index1].SetDefaults(254); + int index36 = index1 + 1; + this.item[index36].SetDefaults(981); + int index37 = index36 + 1; if (Main.dayTime) { - objArray1[index64].SetDefaults(242); - ++index64; + this.item[index37].SetDefaults(242); + ++index37; } switch (Main.moonPhase) { case 0: - objArray1[index64].SetDefaults(245); - int index65 = index64 + 1; - objArray1[index65].SetDefaults(246); - index64 = index65 + 1; + this.item[index37].SetDefaults(245); + int index38 = index37 + 1; + this.item[index38].SetDefaults(246); + index37 = index38 + 1; if (!Main.dayTime) { - Item[] objArray25 = objArray1; - int index66 = index64; - int num17 = index66 + 1; - objArray25[index66].SetDefaults(1288); - Item[] objArray26 = objArray1; - int index67 = num17; - index64 = index67 + 1; - objArray26[index67].SetDefaults(1289); + Item[] objArray4 = this.item; + int index39 = index37; + int num = index39 + 1; + objArray4[index39].SetDefaults(1288); + Item[] objArray5 = this.item; + int index40 = num; + index37 = index40 + 1; + objArray5[index40].SetDefaults(1289); break; } break; case 1: - objArray1[index64].SetDefaults(325); - int index68 = index64 + 1; - objArray1[index68].SetDefaults(326); - index64 = index68 + 1; + this.item[index37].SetDefaults(325); + int index41 = index37 + 1; + this.item[index41].SetDefaults(326); + index37 = index41 + 1; break; } - objArray1[index64].SetDefaults(269); - int index69 = index64 + 1; - objArray1[index69].SetDefaults(270); - int index70 = index69 + 1; - objArray1[index70].SetDefaults(271); - index1 = index70 + 1; + this.item[index37].SetDefaults(269); + int index42 = index37 + 1; + this.item[index42].SetDefaults(270); + int index43 = index42 + 1; + this.item[index43].SetDefaults(271); + index1 = index43 + 1; if (NPC.downedClown) { - objArray1[index1].SetDefaults(503); - int index71 = index1 + 1; - objArray1[index71].SetDefaults(504); - int index72 = index71 + 1; - objArray1[index72].SetDefaults(505); - index1 = index72 + 1; + this.item[index1].SetDefaults(503); + int index44 = index1 + 1; + this.item[index44].SetDefaults(504); + int index45 = index44 + 1; + this.item[index45].SetDefaults(505); + index1 = index45 + 1; } if (Main.bloodMoon) { - objArray1[index1].SetDefaults(322); + this.item[index1].SetDefaults(322); ++index1; if (!Main.dayTime) { - Item[] objArray27 = objArray1; - int index73 = index1; - int num18 = index73 + 1; - objArray27[index73].SetDefaults(3362); - Item[] objArray28 = objArray1; - int index74 = num18; - index1 = index74 + 1; - objArray28[index74].SetDefaults(3363); + Item[] objArray6 = this.item; + int index46 = index1; + int num = index46 + 1; + objArray6[index46].SetDefaults(3362); + Item[] objArray7 = this.item; + int index47 = num; + index1 = index47 + 1; + objArray7[index47].SetDefaults(3363); } } if (NPC.downedAncientCultist) { if (Main.dayTime) { - Item[] objArray29 = objArray1; - int index75 = index1; - int num19 = index75 + 1; - objArray29[index75].SetDefaults(2856); - Item[] objArray30 = objArray1; - int index76 = num19; - index1 = index76 + 1; - objArray30[index76].SetDefaults(2858); + Item[] objArray8 = this.item; + int index48 = index1; + int num = index48 + 1; + objArray8[index48].SetDefaults(2856); + Item[] objArray9 = this.item; + int index49 = num; + index1 = index49 + 1; + objArray9[index49].SetDefaults(2858); } else { - Item[] objArray31 = objArray1; - int index77 = index1; - int num20 = index77 + 1; - objArray31[index77].SetDefaults(2857); - Item[] objArray32 = objArray1; - int index78 = num20; - index1 = index78 + 1; - objArray32[index78].SetDefaults(2859); + Item[] objArray10 = this.item; + int index50 = index1; + int num = index50 + 1; + objArray10[index50].SetDefaults(2857); + Item[] objArray11 = this.item; + int index51 = num; + index1 = index51 + 1; + objArray11[index51].SetDefaults(2859); } } if (NPC.AnyNPCs(441)) { - Item[] objArray33 = objArray1; - int index79 = index1; - int num21 = index79 + 1; - objArray33[index79].SetDefaults(3242); - Item[] objArray34 = objArray1; - int index80 = num21; - int num22 = index80 + 1; - objArray34[index80].SetDefaults(3243); - Item[] objArray35 = objArray1; - int index81 = num22; - index1 = index81 + 1; - objArray35[index81].SetDefaults(3244); - } - if (Main.player[Main.myPlayer].ZoneGraveyard) - { - Item[] objArray36 = objArray1; - int index82 = index1; - int num23 = index82 + 1; - objArray36[index82].SetDefaults(4685); - Item[] objArray37 = objArray1; - int index83 = num23; - int num24 = index83 + 1; - objArray37[index83].SetDefaults(4686); - Item[] objArray38 = objArray1; - int index84 = num24; - int num25 = index84 + 1; - objArray38[index84].SetDefaults(4704); - Item[] objArray39 = objArray1; - int index85 = num25; - int num26 = index85 + 1; - objArray39[index85].SetDefaults(4705); - Item[] objArray40 = objArray1; - int index86 = num26; - int num27 = index86 + 1; - objArray40[index86].SetDefaults(4706); - Item[] objArray41 = objArray1; - int index87 = num27; - int num28 = index87 + 1; - objArray41[index87].SetDefaults(4707); - Item[] objArray42 = objArray1; - int index88 = num28; - int num29 = index88 + 1; - objArray42[index88].SetDefaults(4708); - Item[] objArray43 = objArray1; - int index89 = num29; - index1 = index89 + 1; - objArray43[index89].SetDefaults(4709); + Item[] objArray12 = this.item; + int index52 = index1; + int num3 = index52 + 1; + objArray12[index52].SetDefaults(3242); + Item[] objArray13 = this.item; + int index53 = num3; + int num4 = index53 + 1; + objArray13[index53].SetDefaults(3243); + Item[] objArray14 = this.item; + int index54 = num4; + index1 = index54 + 1; + objArray14[index54].SetDefaults(3244); } if (Main.player[Main.myPlayer].ZoneSnow) { - objArray1[index1].SetDefaults(1429); + this.item[index1].SetDefaults(1429); ++index1; } if (Main.halloween) { - objArray1[index1].SetDefaults(1740); + this.item[index1].SetDefaults(1740); ++index1; } if (Main.hardMode) { if (Main.moonPhase == 2) { - objArray1[index1].SetDefaults(869); + this.item[index1].SetDefaults(869); ++index1; } - if (Main.moonPhase == 3) - { - objArray1[index1].SetDefaults(4994); - int index90 = index1 + 1; - objArray1[index90].SetDefaults(4997); - index1 = index90 + 1; - } if (Main.moonPhase == 4) { - objArray1[index1].SetDefaults(864); - int index91 = index1 + 1; - objArray1[index91].SetDefaults(865); - index1 = index91 + 1; - } - if (Main.moonPhase == 5) - { - objArray1[index1].SetDefaults(4995); - int index92 = index1 + 1; - objArray1[index92].SetDefaults(4998); - index1 = index92 + 1; + this.item[index1].SetDefaults(864); + int index55 = index1 + 1; + this.item[index55].SetDefaults(865); + index1 = index55 + 1; } if (Main.moonPhase == 6) { - objArray1[index1].SetDefaults(873); - int index93 = index1 + 1; - objArray1[index93].SetDefaults(874); - int index94 = index93 + 1; - objArray1[index94].SetDefaults(875); - index1 = index94 + 1; - } - if (Main.moonPhase == 7) - { - objArray1[index1].SetDefaults(4996); - int index95 = index1 + 1; - objArray1[index95].SetDefaults(4999); - index1 = index95 + 1; + this.item[index1].SetDefaults(873); + int index56 = index1 + 1; + this.item[index56].SetDefaults(874); + int index57 = index56 + 1; + this.item[index57].SetDefaults(875); + index1 = index57 + 1; } } if (NPC.downedFrost) { - objArray1[index1].SetDefaults(1275); - int index96 = index1 + 1; - objArray1[index96].SetDefaults(1276); - index1 = index96 + 1; + this.item[index1].SetDefaults(1275); + int index58 = index1 + 1; + this.item[index58].SetDefaults(1276); + index1 = index58 + 1; } if (Main.halloween) { - Item[] objArray44 = objArray1; - int index97 = index1; - int num30 = index97 + 1; - objArray44[index97].SetDefaults(3246); - Item[] objArray45 = objArray1; - int index98 = num30; - index1 = index98 + 1; - objArray45[index98].SetDefaults(3247); + Item[] objArray15 = this.item; + int index59 = index1; + int num = index59 + 1; + objArray15[index59].SetDefaults(3246); + Item[] objArray16 = this.item; + int index60 = num; + index1 = index60 + 1; + objArray16[index60].SetDefaults(3247); } if (BirthdayParty.PartyIsUp) { - Item[] objArray46 = objArray1; - int index99 = index1; - int num31 = index99 + 1; - objArray46[index99].SetDefaults(3730); - Item[] objArray47 = objArray1; - int index100 = num31; - int num32 = index100 + 1; - objArray47[index100].SetDefaults(3731); - Item[] objArray48 = objArray1; - int index101 = num32; - int num33 = index101 + 1; - objArray48[index101].SetDefaults(3733); - Item[] objArray49 = objArray1; - int index102 = num33; - int num34 = index102 + 1; - objArray49[index102].SetDefaults(3734); - Item[] objArray50 = objArray1; - int index103 = num34; - index1 = index103 + 1; - objArray50[index103].SetDefaults(3735); - } - int scoreAccumulated1 = Main.LocalPlayer.golferScoreAccumulated; - if (index1 < 38 && scoreAccumulated1 >= 2000) - { - objArray1[index1].SetDefaults(4744); - ++index1; + Item[] objArray17 = this.item; + int index61 = index1; + int num5 = index61 + 1; + objArray17[index61].SetDefaults(3730); + Item[] objArray18 = this.item; + int index62 = num5; + int num6 = index62 + 1; + objArray18[index62].SetDefaults(3731); + Item[] objArray19 = this.item; + int index63 = num6; + int num7 = index63 + 1; + objArray19[index63].SetDefaults(3733); + Item[] objArray20 = this.item; + int index64 = num7; + int num8 = index64 + 1; + objArray20[index64].SetDefaults(3734); + Item[] objArray21 = this.item; + int index65 = num8; + index1 = index65 + 1; + objArray21[index65].SetDefaults(3735); break; } break; case 6: - objArray1[index1].SetDefaults(128); - int index104 = index1 + 1; - objArray1[index104].SetDefaults(486); - int index105 = index104 + 1; - objArray1[index105].SetDefaults(398); - int index106 = index105 + 1; - objArray1[index106].SetDefaults(84); - int index107 = index106 + 1; - objArray1[index107].SetDefaults(407); - int index108 = index107 + 1; - objArray1[index108].SetDefaults(161); - index1 = index108 + 1; + this.item[index1].SetDefaults(128); + int index66 = index1 + 1; + this.item[index66].SetDefaults(486); + int index67 = index66 + 1; + this.item[index67].SetDefaults(398); + int index68 = index67 + 1; + this.item[index68].SetDefaults(84); + int index69 = index68 + 1; + this.item[index69].SetDefaults(407); + int index70 = index69 + 1; + this.item[index70].SetDefaults(161); + index1 = index70 + 1; break; case 7: - objArray1[index1].SetDefaults(487); - int index109 = index1 + 1; - objArray1[index109].SetDefaults(496); - int index110 = index109 + 1; - objArray1[index110].SetDefaults(500); - int index111 = index110 + 1; - objArray1[index111].SetDefaults(507); - int index112 = index111 + 1; - objArray1[index112].SetDefaults(508); - int index113 = index112 + 1; - objArray1[index113].SetDefaults(531); - int index114 = index113 + 1; - objArray1[index114].SetDefaults(576); - int index115 = index114 + 1; - objArray1[index115].SetDefaults(3186); - index1 = index115 + 1; + this.item[index1].SetDefaults(487); + int index71 = index1 + 1; + this.item[index71].SetDefaults(496); + int index72 = index71 + 1; + this.item[index72].SetDefaults(500); + int index73 = index72 + 1; + this.item[index73].SetDefaults(507); + int index74 = index73 + 1; + this.item[index74].SetDefaults(508); + int index75 = index74 + 1; + this.item[index75].SetDefaults(531); + int index76 = index75 + 1; + this.item[index76].SetDefaults(576); + int index77 = index76 + 1; + this.item[index77].SetDefaults(3186); + index1 = index77 + 1; if (Main.halloween) { - objArray1[index1].SetDefaults(1739); + this.item[index1].SetDefaults(1739); ++index1; break; } break; case 8: - objArray1[index1].SetDefaults(509); - int index116 = index1 + 1; - objArray1[index116].SetDefaults(850); - int index117 = index116 + 1; - objArray1[index117].SetDefaults(851); - int index118 = index117 + 1; - objArray1[index118].SetDefaults(3612); - int index119 = index118 + 1; - objArray1[index119].SetDefaults(510); - int index120 = index119 + 1; - objArray1[index120].SetDefaults(530); - int index121 = index120 + 1; - objArray1[index121].SetDefaults(513); - int index122 = index121 + 1; - objArray1[index122].SetDefaults(538); - int index123 = index122 + 1; - objArray1[index123].SetDefaults(529); - int index124 = index123 + 1; - objArray1[index124].SetDefaults(541); - int index125 = index124 + 1; - objArray1[index125].SetDefaults(542); - int index126 = index125 + 1; - objArray1[index126].SetDefaults(543); - int index127 = index126 + 1; - objArray1[index127].SetDefaults(852); - int index128 = index127 + 1; - objArray1[index128].SetDefaults(853); - int num35 = index128 + 1; - Item[] objArray51 = objArray1; - int index129 = num35; - int num36 = index129 + 1; - objArray51[index129].SetDefaults(4261); - Item[] objArray52 = objArray1; - int index130 = num36; - int index131 = index130 + 1; - objArray52[index130].SetDefaults(3707); - objArray1[index131].SetDefaults(2739); - int index132 = index131 + 1; - objArray1[index132].SetDefaults(849); - int num37 = index132 + 1; - Item[] objArray53 = objArray1; - int index133 = num37; - int num38 = index133 + 1; - objArray53[index133].SetDefaults(3616); - Item[] objArray54 = objArray1; - int index134 = num38; - int num39 = index134 + 1; - objArray54[index134].SetDefaults(2799); - Item[] objArray55 = objArray1; - int index135 = num39; - int num40 = index135 + 1; - objArray55[index135].SetDefaults(3619); - Item[] objArray56 = objArray1; - int index136 = num40; - int num41 = index136 + 1; - objArray56[index136].SetDefaults(3627); - Item[] objArray57 = objArray1; - int index137 = num41; - int num42 = index137 + 1; - objArray57[index137].SetDefaults(3629); - Item[] objArray58 = objArray1; - int index138 = num42; - int num43 = index138 + 1; - objArray58[index138].SetDefaults(4484); - Item[] objArray59 = objArray1; - int index139 = num43; - index1 = index139 + 1; - objArray59[index139].SetDefaults(4485); + this.item[index1].SetDefaults(509); + int index78 = index1 + 1; + this.item[index78].SetDefaults(850); + int index79 = index78 + 1; + this.item[index79].SetDefaults(851); + int index80 = index79 + 1; + this.item[index80].SetDefaults(3612); + int index81 = index80 + 1; + this.item[index81].SetDefaults(510); + int index82 = index81 + 1; + this.item[index82].SetDefaults(530); + int index83 = index82 + 1; + this.item[index83].SetDefaults(513); + int index84 = index83 + 1; + this.item[index84].SetDefaults(538); + int index85 = index84 + 1; + this.item[index85].SetDefaults(529); + int index86 = index85 + 1; + this.item[index86].SetDefaults(541); + int index87 = index86 + 1; + this.item[index87].SetDefaults(542); + int index88 = index87 + 1; + this.item[index88].SetDefaults(543); + int index89 = index88 + 1; + this.item[index89].SetDefaults(852); + int index90 = index89 + 1; + this.item[index90].SetDefaults(853); + int num9 = index90 + 1; + Item[] objArray22 = this.item; + int index91 = num9; + int index92 = index91 + 1; + objArray22[index91].SetDefaults(3707); + this.item[index92].SetDefaults(2739); + int index93 = index92 + 1; + this.item[index93].SetDefaults(849); + int num10 = index93 + 1; + Item[] objArray23 = this.item; + int index94 = num10; + int num11 = index94 + 1; + objArray23[index94].SetDefaults(3616); + Item[] objArray24 = this.item; + int index95 = num11; + int num12 = index95 + 1; + objArray24[index95].SetDefaults(2799); + Item[] objArray25 = this.item; + int index96 = num12; + int num13 = index96 + 1; + objArray25[index96].SetDefaults(3619); + Item[] objArray26 = this.item; + int index97 = num13; + int num14 = index97 + 1; + objArray26[index97].SetDefaults(3627); + Item[] objArray27 = this.item; + int index98 = num14; + index1 = index98 + 1; + objArray27[index98].SetDefaults(3629); if (NPC.AnyNPCs(369) && Main.hardMode && Main.moonPhase == 3) { - objArray1[index1].SetDefaults(2295); + this.item[index1].SetDefaults(2295); ++index1; break; } break; case 9: - objArray1[index1].SetDefaults(588); - int index140 = index1 + 1; - objArray1[index140].SetDefaults(589); - int index141 = index140 + 1; - objArray1[index141].SetDefaults(590); - int index142 = index141 + 1; - objArray1[index142].SetDefaults(597); - int index143 = index142 + 1; - objArray1[index143].SetDefaults(598); - int index144 = index143 + 1; - objArray1[index144].SetDefaults(596); - index1 = index144 + 1; + this.item[index1].SetDefaults(588); + int index99 = index1 + 1; + this.item[index99].SetDefaults(589); + int index100 = index99 + 1; + this.item[index100].SetDefaults(590); + int index101 = index100 + 1; + this.item[index101].SetDefaults(597); + int index102 = index101 + 1; + this.item[index102].SetDefaults(598); + int index103 = index102 + 1; + this.item[index103].SetDefaults(596); + index1 = index103 + 1; for (int Type = 1873; Type < 1906; ++Type) { - objArray1[index1].SetDefaults(Type); + this.item[index1].SetDefaults(Type); ++index1; } break; case 10: if (NPC.downedMechBossAny) { - objArray1[index1].SetDefaults(756); - int index145 = index1 + 1; - objArray1[index145].SetDefaults(787); - index1 = index145 + 1; + this.item[index1].SetDefaults(756); + int index104 = index1 + 1; + this.item[index104].SetDefaults(787); + index1 = index104 + 1; } - objArray1[index1].SetDefaults(868); - int index146 = index1 + 1; + this.item[index1].SetDefaults(868); + int index105 = index1 + 1; if (NPC.downedPlantBoss) { - objArray1[index146].SetDefaults(1551); - ++index146; + this.item[index105].SetDefaults(1551); + ++index105; } - objArray1[index146].SetDefaults(1181); - int index147 = index146 + 1; - objArray1[index147].SetDefaults(783); - index1 = index147 + 1; + this.item[index105].SetDefaults(1181); + int index106 = index105 + 1; + this.item[index106].SetDefaults(783); + index1 = index106 + 1; break; case 11: - objArray1[index1].SetDefaults(779); - int index148 = index1 + 1; - int index149; + this.item[index1].SetDefaults(779); + int index107 = index1 + 1; + int index108; if (Main.moonPhase >= 4) { - objArray1[index148].SetDefaults(748); - index149 = index148 + 1; + this.item[index107].SetDefaults(748); + index108 = index107 + 1; } else { - objArray1[index148].SetDefaults(839); - int index150 = index148 + 1; - objArray1[index150].SetDefaults(840); - int index151 = index150 + 1; - objArray1[index151].SetDefaults(841); - index149 = index151 + 1; + this.item[index107].SetDefaults(839); + int index109 = index107 + 1; + this.item[index109].SetDefaults(840); + int index110 = index109 + 1; + this.item[index110].SetDefaults(841); + index108 = index110 + 1; } if (NPC.downedGolemBoss) { - objArray1[index149].SetDefaults(948); - ++index149; + this.item[index108].SetDefaults(948); + ++index108; } - Item[] objArray60 = objArray1; - int index152 = index149; - int num44 = index152 + 1; - objArray60[index152].SetDefaults(3623); - Item[] objArray61 = objArray1; - int index153 = num44; - int num45 = index153 + 1; - objArray61[index153].SetDefaults(3603); - Item[] objArray62 = objArray1; - int index154 = num45; - int num46 = index154 + 1; - objArray62[index154].SetDefaults(3604); - Item[] objArray63 = objArray1; - int index155 = num46; - int num47 = index155 + 1; - objArray63[index155].SetDefaults(3607); - Item[] objArray64 = objArray1; - int index156 = num47; - int num48 = index156 + 1; - objArray64[index156].SetDefaults(3605); - Item[] objArray65 = objArray1; - int index157 = num48; - int num49 = index157 + 1; - objArray65[index157].SetDefaults(3606); - Item[] objArray66 = objArray1; - int index158 = num49; - int num50 = index158 + 1; - objArray66[index158].SetDefaults(3608); - Item[] objArray67 = objArray1; - int index159 = num50; - int num51 = index159 + 1; - objArray67[index159].SetDefaults(3618); - Item[] objArray68 = objArray1; - int index160 = num51; - int num52 = index160 + 1; - objArray68[index160].SetDefaults(3602); - Item[] objArray69 = objArray1; - int index161 = num52; - int num53 = index161 + 1; - objArray69[index161].SetDefaults(3663); - Item[] objArray70 = objArray1; - int index162 = num53; - int num54 = index162 + 1; - objArray70[index162].SetDefaults(3609); - Item[] objArray71 = objArray1; - int index163 = num54; - int index164 = index163 + 1; - objArray71[index163].SetDefaults(3610); - objArray1[index164].SetDefaults(995); - int index165 = index164 + 1; + Item[] objArray28 = this.item; + int index111 = index108; + int num15 = index111 + 1; + objArray28[index111].SetDefaults(3623); + Item[] objArray29 = this.item; + int index112 = num15; + int num16 = index112 + 1; + objArray29[index112].SetDefaults(3603); + Item[] objArray30 = this.item; + int index113 = num16; + int num17 = index113 + 1; + objArray30[index113].SetDefaults(3604); + Item[] objArray31 = this.item; + int index114 = num17; + int num18 = index114 + 1; + objArray31[index114].SetDefaults(3607); + Item[] objArray32 = this.item; + int index115 = num18; + int num19 = index115 + 1; + objArray32[index115].SetDefaults(3605); + Item[] objArray33 = this.item; + int index116 = num19; + int num20 = index116 + 1; + objArray33[index116].SetDefaults(3606); + Item[] objArray34 = this.item; + int index117 = num20; + int num21 = index117 + 1; + objArray34[index117].SetDefaults(3608); + Item[] objArray35 = this.item; + int index118 = num21; + int num22 = index118 + 1; + objArray35[index118].SetDefaults(3618); + Item[] objArray36 = this.item; + int index119 = num22; + int num23 = index119 + 1; + objArray36[index119].SetDefaults(3602); + Item[] objArray37 = this.item; + int index120 = num23; + int num24 = index120 + 1; + objArray37[index120].SetDefaults(3663); + Item[] objArray38 = this.item; + int index121 = num24; + int num25 = index121 + 1; + objArray38[index121].SetDefaults(3609); + Item[] objArray39 = this.item; + int index122 = num25; + int index123 = index122 + 1; + objArray39[index122].SetDefaults(3610); + this.item[index123].SetDefaults(995); + int index124 = index123 + 1; if (NPC.downedBoss1 && NPC.downedBoss2 && NPC.downedBoss3) { - objArray1[index165].SetDefaults(2203); - ++index165; + this.item[index124].SetDefaults(2203); + ++index124; } if (WorldGen.crimson) { - objArray1[index165].SetDefaults(2193); - ++index165; + this.item[index124].SetDefaults(2193); + ++index124; } - if (!WorldGen.crimson) - { - objArray1[index165].SetDefaults(4142); - ++index165; - } - objArray1[index165].SetDefaults(1263); - int index166 = index165 + 1; + this.item[index124].SetDefaults(1263); + int index125 = index124 + 1; if (Main.eclipse || Main.bloodMoon) { if (WorldGen.crimson) { - objArray1[index166].SetDefaults(784); - index1 = index166 + 1; + this.item[index125].SetDefaults(784); + index1 = index125 + 1; } else { - objArray1[index166].SetDefaults(782); - index1 = index166 + 1; + this.item[index125].SetDefaults(782); + index1 = index125 + 1; } } - else if (Main.player[Main.myPlayer].ZoneHallow) + else if (Main.player[Main.myPlayer].ZoneHoly) { - objArray1[index166].SetDefaults(781); - index1 = index166 + 1; + this.item[index125].SetDefaults(781); + index1 = index125 + 1; } else { - objArray1[index166].SetDefaults(780); - index1 = index166 + 1; + this.item[index125].SetDefaults(780); + index1 = index125 + 1; } if (Main.hardMode) { - objArray1[index1].SetDefaults(1344); - int index167 = index1 + 1; - objArray1[index167].SetDefaults(4472); - index1 = index167 + 1; + this.item[index1].SetDefaults(1344); + ++index1; } if (Main.halloween) { - objArray1[index1].SetDefaults(1742); + this.item[index1].SetDefaults(1742); ++index1; break; } break; case 12: - objArray1[index1].SetDefaults(1037); - int index168 = index1 + 1; - objArray1[index168].SetDefaults(2874); - int index169 = index168 + 1; - objArray1[index169].SetDefaults(1120); - index1 = index169 + 1; + this.item[index1].SetDefaults(1037); + int index126 = index1 + 1; + this.item[index126].SetDefaults(2874); + int index127 = index126 + 1; + this.item[index127].SetDefaults(1120); + index1 = index127 + 1; if (Main.netMode == 1) { - objArray1[index1].SetDefaults(1969); + this.item[index1].SetDefaults(1969); ++index1; } if (Main.halloween) { - objArray1[index1].SetDefaults(3248); - int index170 = index1 + 1; - objArray1[index170].SetDefaults(1741); - index1 = index170 + 1; + this.item[index1].SetDefaults(3248); + int index128 = index1 + 1; + this.item[index128].SetDefaults(1741); + index1 = index128 + 1; } if (Main.moonPhase == 0) { - objArray1[index1].SetDefaults(2871); - int index171 = index1 + 1; - objArray1[index171].SetDefaults(2872); - index1 = index171 + 1; - } - if (!Main.dayTime && Main.bloodMoon) - { - objArray1[index1].SetDefaults(4663); - ++index1; - } - if (Main.player[Main.myPlayer].ZoneGraveyard) - { - objArray1[index1].SetDefaults(4662); - ++index1; + this.item[index1].SetDefaults(2871); + int index129 = index1 + 1; + this.item[index129].SetDefaults(2872); + index1 = index129 + 1; break; } break; case 13: - objArray1[index1].SetDefaults(859); - int index172 = index1 + 1; - if (Main.LocalPlayer.golferScoreAccumulated > 500) - objArray1[index172++].SetDefaults(4743); - objArray1[index172].SetDefaults(1000); - int index173 = index172 + 1; - objArray1[index173].SetDefaults(1168); - int index174 = index173 + 1; - int index175; - if (Main.dayTime) - { - objArray1[index174].SetDefaults(1449); - index175 = index174 + 1; - } - else - { - objArray1[index174].SetDefaults(4552); - index175 = index174 + 1; - } - objArray1[index175].SetDefaults(1345); - int index176 = index175 + 1; - objArray1[index176].SetDefaults(1450); - int num55 = index176 + 1; - Item[] objArray72 = objArray1; - int index177 = num55; - int num56 = index177 + 1; - objArray72[index177].SetDefaults(3253); - Item[] objArray73 = objArray1; - int index178 = num56; - int num57 = index178 + 1; - objArray73[index178].SetDefaults(4553); - Item[] objArray74 = objArray1; - int index179 = num57; - int num58 = index179 + 1; - objArray74[index179].SetDefaults(2700); - Item[] objArray75 = objArray1; - int index180 = num58; - int num59 = index180 + 1; - objArray75[index180].SetDefaults(2738); - Item[] objArray76 = objArray1; - int index181 = num59; - int num60 = index181 + 1; - objArray76[index181].SetDefaults(4470); - Item[] objArray77 = objArray1; - int index182 = num60; - int index183 = index182 + 1; - objArray77[index182].SetDefaults(4681); - if (Main.player[Main.myPlayer].ZoneGraveyard) - objArray1[index183++].SetDefaults(4682); - if (LanternNight.LanternsUp) - objArray1[index183++].SetDefaults(4702); + this.item[index1].SetDefaults(859); + int index130 = index1 + 1; + this.item[index130].SetDefaults(1000); + int index131 = index130 + 1; + this.item[index131].SetDefaults(1168); + int index132 = index131 + 1; + this.item[index132].SetDefaults(1449); + int index133 = index132 + 1; + this.item[index133].SetDefaults(1345); + int index134 = index133 + 1; + this.item[index134].SetDefaults(1450); + int num26 = index134 + 1; + Item[] objArray40 = this.item; + int index135 = num26; + int num27 = index135 + 1; + objArray40[index135].SetDefaults(3253); + Item[] objArray41 = this.item; + int index136 = num27; + int num28 = index136 + 1; + objArray41[index136].SetDefaults(2700); + Item[] objArray42 = this.item; + int index137 = num28; + int index138 = index137 + 1; + objArray42[index137].SetDefaults(2738); if (Main.player[Main.myPlayer].HasItem(3548)) { - objArray1[index183].SetDefaults(3548); - ++index183; + this.item[index138].SetDefaults(3548); + ++index138; } if (NPC.AnyNPCs(229)) - objArray1[index183++].SetDefaults(3369); - if (NPC.downedGolemBoss) - objArray1[index183++].SetDefaults(3546); + this.item[index138++].SetDefaults(3369); if (Main.hardMode) { - objArray1[index183].SetDefaults(3214); - int index184 = index183 + 1; - objArray1[index184].SetDefaults(2868); - int index185 = index184 + 1; - objArray1[index185].SetDefaults(970); - int index186 = index185 + 1; - objArray1[index186].SetDefaults(971); - int index187 = index186 + 1; - objArray1[index187].SetDefaults(972); - int index188 = index187 + 1; - objArray1[index188].SetDefaults(973); - index183 = index188 + 1; + this.item[index138].SetDefaults(3214); + int index139 = index138 + 1; + this.item[index139].SetDefaults(2868); + int index140 = index139 + 1; + this.item[index140].SetDefaults(970); + int index141 = index140 + 1; + this.item[index141].SetDefaults(971); + int index142 = index141 + 1; + this.item[index142].SetDefaults(972); + int index143 = index142 + 1; + this.item[index143].SetDefaults(973); + index138 = index143 + 1; } - Item[] objArray78 = objArray1; - int index189 = index183; - int num61 = index189 + 1; - objArray78[index189].SetDefaults(4791); - Item[] objArray79 = objArray1; - int index190 = num61; - int num62 = index190 + 1; - objArray79[index190].SetDefaults(3747); - Item[] objArray80 = objArray1; - int index191 = num62; - int num63 = index191 + 1; - objArray80[index191].SetDefaults(3732); - Item[] objArray81 = objArray1; - int index192 = num63; - index1 = index192 + 1; - objArray81[index192].SetDefaults(3742); + Item[] objArray43 = this.item; + int index144 = index138; + int num29 = index144 + 1; + objArray43[index144].SetDefaults(3747); + Item[] objArray44 = this.item; + int index145 = num29; + int num30 = index145 + 1; + objArray44[index145].SetDefaults(3732); + Item[] objArray45 = this.item; + int index146 = num30; + index1 = index146 + 1; + objArray45[index146].SetDefaults(3742); if (BirthdayParty.PartyIsUp) { - Item[] objArray82 = objArray1; - int index193 = index1; - int num64 = index193 + 1; - objArray82[index193].SetDefaults(3749); - Item[] objArray83 = objArray1; - int index194 = num64; - int num65 = index194 + 1; - objArray83[index194].SetDefaults(3746); - Item[] objArray84 = objArray1; - int index195 = num65; - int num66 = index195 + 1; - objArray84[index195].SetDefaults(3739); - Item[] objArray85 = objArray1; - int index196 = num66; - int num67 = index196 + 1; - objArray85[index196].SetDefaults(3740); - Item[] objArray86 = objArray1; - int index197 = num67; - int num68 = index197 + 1; - objArray86[index197].SetDefaults(3741); - Item[] objArray87 = objArray1; - int index198 = num68; - int num69 = index198 + 1; - objArray87[index198].SetDefaults(3737); - Item[] objArray88 = objArray1; - int index199 = num69; - int num70 = index199 + 1; - objArray88[index199].SetDefaults(3738); - Item[] objArray89 = objArray1; - int index200 = num70; - int num71 = index200 + 1; - objArray89[index200].SetDefaults(3736); - Item[] objArray90 = objArray1; - int index201 = num71; - int num72 = index201 + 1; - objArray90[index201].SetDefaults(3745); - Item[] objArray91 = objArray1; - int index202 = num72; - int num73 = index202 + 1; - objArray91[index202].SetDefaults(3744); - Item[] objArray92 = objArray1; - int index203 = num73; - index1 = index203 + 1; - objArray92[index203].SetDefaults(3743); + Item[] objArray46 = this.item; + int index147 = index1; + int num31 = index147 + 1; + objArray46[index147].SetDefaults(3749); + Item[] objArray47 = this.item; + int index148 = num31; + int num32 = index148 + 1; + objArray47[index148].SetDefaults(3746); + Item[] objArray48 = this.item; + int index149 = num32; + int num33 = index149 + 1; + objArray48[index149].SetDefaults(3739); + Item[] objArray49 = this.item; + int index150 = num33; + int num34 = index150 + 1; + objArray49[index150].SetDefaults(3740); + Item[] objArray50 = this.item; + int index151 = num34; + int num35 = index151 + 1; + objArray50[index151].SetDefaults(3741); + Item[] objArray51 = this.item; + int index152 = num35; + int num36 = index152 + 1; + objArray51[index152].SetDefaults(3737); + Item[] objArray52 = this.item; + int index153 = num36; + int num37 = index153 + 1; + objArray52[index153].SetDefaults(3738); + Item[] objArray53 = this.item; + int index154 = num37; + int num38 = index154 + 1; + objArray53[index154].SetDefaults(3736); + Item[] objArray54 = this.item; + int index155 = num38; + int num39 = index155 + 1; + objArray54[index155].SetDefaults(3745); + Item[] objArray55 = this.item; + int index156 = num39; + int num40 = index156 + 1; + objArray55[index156].SetDefaults(3744); + Item[] objArray56 = this.item; + int index157 = num40; + index1 = index157 + 1; + objArray56[index157].SetDefaults(3743); break; } break; case 14: - objArray1[index1].SetDefaults(771); + this.item[index1].SetDefaults(771); ++index1; if (Main.bloodMoon) { - objArray1[index1].SetDefaults(772); + this.item[index1].SetDefaults(772); ++index1; } if (!Main.dayTime || Main.eclipse) { - objArray1[index1].SetDefaults(773); + this.item[index1].SetDefaults(773); ++index1; } if (Main.eclipse) { - objArray1[index1].SetDefaults(774); - ++index1; - } - if (NPC.downedMartians) - { - objArray1[index1++].SetDefaults(4445); - if (Main.bloodMoon || Main.eclipse) - objArray1[index1++].SetDefaults(4446); - } - if (Main.hardMode) - { - objArray1[index1].SetDefaults(4459); + this.item[index1].SetDefaults(774); ++index1; } if (Main.hardMode) { - objArray1[index1].SetDefaults(760); + this.item[index1].SetDefaults(760); ++index1; } if (Main.hardMode) { - objArray1[index1].SetDefaults(1346); - ++index1; - } - if (Main.player[Main.myPlayer].ZoneGraveyard) - { - objArray1[index1].SetDefaults(4409); - ++index1; - } - if (Main.player[Main.myPlayer].ZoneGraveyard) - { - objArray1[index1].SetDefaults(4392); + this.item[index1].SetDefaults(1346); ++index1; } if (Main.halloween) { - objArray1[index1].SetDefaults(1743); - int index204 = index1 + 1; - objArray1[index204].SetDefaults(1744); - int index205 = index204 + 1; - objArray1[index205].SetDefaults(1745); - index1 = index205 + 1; + this.item[index1].SetDefaults(1743); + int index158 = index1 + 1; + this.item[index158].SetDefaults(1744); + int index159 = index158 + 1; + this.item[index159].SetDefaults(1745); + index1 = index159 + 1; } if (NPC.downedMartians) { - Item[] objArray93 = objArray1; - int index206 = index1; - int num74 = index206 + 1; - objArray93[index206].SetDefaults(2862); - Item[] objArray94 = objArray1; - int index207 = num74; - index1 = index207 + 1; - objArray94[index207].SetDefaults(3109); + Item[] objArray57 = this.item; + int index160 = index1; + int num41 = index160 + 1; + objArray57[index160].SetDefaults(2862); + Item[] objArray58 = this.item; + int index161 = num41; + index1 = index161 + 1; + objArray58[index161].SetDefaults(3109); } if (Main.player[Main.myPlayer].HasItem(3384) || Main.player[Main.myPlayer].HasItem(3664)) { - objArray1[index1].SetDefaults(3664); + this.item[index1].SetDefaults(3664); ++index1; break; } break; case 15: - objArray1[index1].SetDefaults(1071); - int index208 = index1 + 1; - objArray1[index208].SetDefaults(1072); - int index209 = index208 + 1; - objArray1[index209].SetDefaults(1100); - int index210 = index209 + 1; + this.item[index1].SetDefaults(1071); + int index162 = index1 + 1; + this.item[index162].SetDefaults(1072); + int index163 = index162 + 1; + this.item[index163].SetDefaults(1100); + int index164 = index163 + 1; for (int Type = 1073; Type <= 1084; ++Type) { - objArray1[index210].SetDefaults(Type); - ++index210; - } - objArray1[index210].SetDefaults(1097); - int index211 = index210 + 1; - objArray1[index211].SetDefaults(1099); - int index212 = index211 + 1; - objArray1[index212].SetDefaults(1098); - int index213 = index212 + 1; - objArray1[index213].SetDefaults(1966); - index1 = index213 + 1; - if (Main.player[Main.myPlayer].ZoneGraveyard) - { - objArray1[index1].SetDefaults(4668); - ++index1; + this.item[index164].SetDefaults(Type); + ++index164; } + this.item[index164].SetDefaults(1097); + int index165 = index164 + 1; + this.item[index165].SetDefaults(1099); + int index166 = index165 + 1; + this.item[index166].SetDefaults(1098); + int index167 = index166 + 1; + this.item[index167].SetDefaults(1966); + int index168 = index167 + 1; if (Main.hardMode) { - objArray1[index1].SetDefaults(1967); - int index214 = index1 + 1; - objArray1[index214].SetDefaults(1968); - index1 = index214 + 1; + this.item[index168].SetDefaults(1967); + int index169 = index168 + 1; + this.item[index169].SetDefaults(1968); + index168 = index169 + 1; } - if (!Main.player[Main.myPlayer].ZoneGraveyard) + this.item[index168].SetDefaults(1490); + int index170 = index168 + 1; + if (Main.moonPhase <= 1) { - objArray1[index1].SetDefaults(1490); - int index215 = index1 + 1; - if (Main.moonPhase <= 1) - { - objArray1[index215].SetDefaults(1481); - index1 = index215 + 1; - } - else if (Main.moonPhase <= 3) - { - objArray1[index215].SetDefaults(1482); - index1 = index215 + 1; - } - else if (Main.moonPhase <= 5) - { - objArray1[index215].SetDefaults(1483); - index1 = index215 + 1; - } - else - { - objArray1[index215].SetDefaults(1484); - index1 = index215 + 1; - } + this.item[index170].SetDefaults(1481); + index1 = index170 + 1; + } + else if (Main.moonPhase <= 3) + { + this.item[index170].SetDefaults(1482); + index1 = index170 + 1; + } + else if (Main.moonPhase <= 5) + { + this.item[index170].SetDefaults(1483); + index1 = index170 + 1; + } + else + { + this.item[index170].SetDefaults(1484); + index1 = index170 + 1; } if (Main.player[Main.myPlayer].ZoneCrimson) { - objArray1[index1].SetDefaults(1492); + this.item[index1].SetDefaults(1492); ++index1; } if (Main.player[Main.myPlayer].ZoneCorrupt) { - objArray1[index1].SetDefaults(1488); + this.item[index1].SetDefaults(1488); ++index1; } - if (Main.player[Main.myPlayer].ZoneHallow) + if (Main.player[Main.myPlayer].ZoneHoly) { - objArray1[index1].SetDefaults(1489); + this.item[index1].SetDefaults(1489); ++index1; } if (Main.player[Main.myPlayer].ZoneJungle) { - objArray1[index1].SetDefaults(1486); + this.item[index1].SetDefaults(1486); ++index1; } if (Main.player[Main.myPlayer].ZoneSnow) { - objArray1[index1].SetDefaults(1487); + this.item[index1].SetDefaults(1487); ++index1; } - if (Main.player[Main.myPlayer].ZoneDesert) + if (Main.sandTiles > 1000) { - objArray1[index1].SetDefaults(1491); + this.item[index1].SetDefaults(1491); ++index1; } if (Main.bloodMoon) { - objArray1[index1].SetDefaults(1493); + this.item[index1].SetDefaults(1493); ++index1; } - if (!Main.player[Main.myPlayer].ZoneGraveyard) + if ((double) Main.player[Main.myPlayer].position.Y / 16.0 < Main.worldSurface * 0.349999994039536) { - if ((double) Main.player[Main.myPlayer].position.Y / 16.0 < Main.worldSurface * 0.349999994039536) - { - objArray1[index1].SetDefaults(1485); - ++index1; - } - if ((double) Main.player[Main.myPlayer].position.Y / 16.0 < Main.worldSurface * 0.349999994039536 && Main.hardMode) - { - objArray1[index1].SetDefaults(1494); - ++index1; - } + this.item[index1].SetDefaults(1485); + ++index1; } - if (Main.player[Main.myPlayer].ZoneGraveyard) + if ((double) Main.player[Main.myPlayer].position.Y / 16.0 < Main.worldSurface * 0.349999994039536 && Main.hardMode) { - objArray1[index1].SetDefaults(4723); - int index216 = index1 + 1; - objArray1[index216].SetDefaults(4724); - int index217 = index216 + 1; - objArray1[index217].SetDefaults(4725); - int index218 = index217 + 1; - objArray1[index218].SetDefaults(4726); - int index219 = index218 + 1; - objArray1[index219].SetDefaults(4727); - int index220 = index219 + 1; - objArray1[index220].SetDefaults(4728); - int index221 = index220 + 1; - objArray1[index221].SetDefaults(4729); - index1 = index221 + 1; + this.item[index1].SetDefaults(1494); + ++index1; } if (Main.xMas) { for (int Type = 1948; Type <= 1957; ++Type) { - objArray1[index1].SetDefaults(Type); + this.item[index1].SetDefaults(Type); ++index1; } } for (int Type = 2158; Type <= 2160; ++Type) { if (index1 < 39) - objArray1[index1].SetDefaults(Type); + this.item[index1].SetDefaults(Type); ++index1; } for (int Type = 2008; Type <= 2014; ++Type) { if (index1 < 39) - objArray1[index1].SetDefaults(Type); + this.item[index1].SetDefaults(Type); ++index1; } break; case 16: - Item[] objArray95 = objArray1; - int index222 = index1; - int num75 = index222 + 1; - objArray95[index222].SetDefaults(1430); - Item[] objArray96 = objArray1; - int index223 = num75; - int num76 = index223 + 1; - objArray96[index223].SetDefaults(986); + this.item[index1].SetDefaults(1430); + int index171 = index1 + 1; + this.item[index171].SetDefaults(986); + int index172 = index171 + 1; if (NPC.AnyNPCs(108)) - objArray1[num76++].SetDefaults(2999); + this.item[index172++].SetDefaults(2999); if (Main.hardMode && NPC.downedPlantBoss) { - Item[] objArray97 = objArray1; - int index224 = num76; - int num77 = index224 + 1; - objArray97[index224].SetDefaults(1159); - Item[] objArray98 = objArray1; - int index225 = num77; - int num78 = index225 + 1; - objArray98[index225].SetDefaults(1160); - Item[] objArray99 = objArray1; - int index226 = num78; - int num79 = index226 + 1; - objArray99[index226].SetDefaults(1161); - if (!Main.dayTime) - objArray1[num79++].SetDefaults(1158); - if (Main.player[Main.myPlayer].ZoneJungle) - objArray1[num79++].SetDefaults(1167); - Item[] objArray100 = objArray1; - int index227 = num79; - num76 = index227 + 1; - objArray100[index227].SetDefaults(1339); + if (Main.player[Main.myPlayer].HasItem(1157)) + { + this.item[index172].SetDefaults(1159); + int index173 = index172 + 1; + this.item[index173].SetDefaults(1160); + int index174 = index173 + 1; + this.item[index174].SetDefaults(1161); + index172 = index174 + 1; + if (!Main.dayTime) + { + this.item[index172].SetDefaults(1158); + ++index172; + } + if (Main.player[Main.myPlayer].ZoneJungle) + { + this.item[index172].SetDefaults(1167); + ++index172; + } + } + this.item[index172].SetDefaults(1339); + ++index172; } if (Main.hardMode && Main.player[Main.myPlayer].ZoneJungle) { - objArray1[num76++].SetDefaults(1171); + this.item[index172].SetDefaults(1171); + ++index172; if (!Main.dayTime) - objArray1[num76++].SetDefaults(1162); + { + this.item[index172].SetDefaults(1162); + ++index172; + } } - Item[] objArray101 = objArray1; - int index228 = num76; - int num80 = index228 + 1; - objArray101[index228].SetDefaults(909); - Item[] objArray102 = objArray1; - int index229 = num80; - int num81 = index229 + 1; - objArray102[index229].SetDefaults(910); - Item[] objArray103 = objArray1; - int index230 = num81; - int num82 = index230 + 1; - objArray103[index230].SetDefaults(940); - Item[] objArray104 = objArray1; - int index231 = num82; - int num83 = index231 + 1; - objArray104[index231].SetDefaults(941); - Item[] objArray105 = objArray1; - int index232 = num83; - int num84 = index232 + 1; - objArray105[index232].SetDefaults(942); - Item[] objArray106 = objArray1; - int index233 = num84; - int num85 = index233 + 1; - objArray106[index233].SetDefaults(943); - Item[] objArray107 = objArray1; - int index234 = num85; - int num86 = index234 + 1; - objArray107[index234].SetDefaults(944); - Item[] objArray108 = objArray1; - int index235 = num86; - int num87 = index235 + 1; - objArray108[index235].SetDefaults(945); - Item[] objArray109 = objArray1; - int index236 = num87; - int num88 = index236 + 1; - objArray109[index236].SetDefaults(4922); - Item[] objArray110 = objArray1; - int index237 = num88; - index1 = index237 + 1; - objArray110[index237].SetDefaults(4417); + this.item[index172].SetDefaults(909); + int index175 = index172 + 1; + this.item[index175].SetDefaults(910); + int index176 = index175 + 1; + this.item[index176].SetDefaults(940); + int index177 = index176 + 1; + this.item[index177].SetDefaults(941); + int index178 = index177 + 1; + this.item[index178].SetDefaults(942); + int index179 = index178 + 1; + this.item[index179].SetDefaults(943); + int index180 = index179 + 1; + this.item[index180].SetDefaults(944); + int index181 = index180 + 1; + this.item[index181].SetDefaults(945); + index1 = index181 + 1; if (Main.player[Main.myPlayer].HasItem(1835)) - objArray1[index1++].SetDefaults(1836); + { + this.item[index1].SetDefaults(1836); + ++index1; + } if (Main.player[Main.myPlayer].HasItem(1258)) - objArray1[index1++].SetDefaults(1261); + { + this.item[index1].SetDefaults(1261); + ++index1; + } if (Main.halloween) { - objArray1[index1++].SetDefaults(1791); + this.item[index1].SetDefaults(1791); + ++index1; break; } break; case 17: - objArray1[index1].SetDefaults(928); - int index238 = index1 + 1; - objArray1[index238].SetDefaults(929); - int index239 = index238 + 1; - objArray1[index239].SetDefaults(876); - int index240 = index239 + 1; - objArray1[index240].SetDefaults(877); - int index241 = index240 + 1; - objArray1[index241].SetDefaults(878); - int index242 = index241 + 1; - objArray1[index242].SetDefaults(2434); - index1 = index242 + 1; - int num89 = (int) (((double) Main.screenPosition.X + (double) (Main.screenWidth / 2)) / 16.0); - if ((double) Main.screenPosition.Y / 16.0 < Main.worldSurface + 10.0 && (num89 < 380 || num89 > Main.maxTilesX - 380)) + this.item[index1].SetDefaults(928); + int index182 = index1 + 1; + this.item[index182].SetDefaults(929); + int index183 = index182 + 1; + this.item[index183].SetDefaults(876); + int index184 = index183 + 1; + this.item[index184].SetDefaults(877); + int index185 = index184 + 1; + this.item[index185].SetDefaults(878); + int index186 = index185 + 1; + this.item[index186].SetDefaults(2434); + index1 = index186 + 1; + int num42 = (int) (((double) Main.screenPosition.X + (double) (Main.screenWidth / 2)) / 16.0); + if ((double) Main.screenPosition.Y / 16.0 < Main.worldSurface + 10.0 && (num42 < 380 || num42 > Main.maxTilesX - 380)) { - objArray1[index1].SetDefaults(1180); + this.item[index1].SetDefaults(1180); ++index1; } if (Main.hardMode && NPC.downedMechBossAny && NPC.AnyNPCs(208)) { - objArray1[index1].SetDefaults(1337); + this.item[index1].SetDefaults(1337); ++index1; break; } break; case 18: - objArray1[index1].SetDefaults(1990); - int index243 = index1 + 1; - objArray1[index243].SetDefaults(1979); - index1 = index243 + 1; + this.item[index1].SetDefaults(1990); + int index187 = index1 + 1; + this.item[index187].SetDefaults(1979); + index1 = index187 + 1; if (Main.player[Main.myPlayer].statLifeMax >= 400) { - objArray1[index1].SetDefaults(1977); + this.item[index1].SetDefaults(1977); ++index1; } if (Main.player[Main.myPlayer].statManaMax >= 200) { - objArray1[index1].SetDefaults(1978); + this.item[index1].SetDefaults(1978); ++index1; } - long num90 = 0; - for (int index244 = 0; index244 < 54; ++index244) + long num43 = 0; + for (int index188 = 0; index188 < 54; ++index188) { - if (Main.player[Main.myPlayer].inventory[index244].type == 71) - num90 += (long) Main.player[Main.myPlayer].inventory[index244].stack; - if (Main.player[Main.myPlayer].inventory[index244].type == 72) - num90 += (long) (Main.player[Main.myPlayer].inventory[index244].stack * 100); - if (Main.player[Main.myPlayer].inventory[index244].type == 73) - num90 += (long) (Main.player[Main.myPlayer].inventory[index244].stack * 10000); - if (Main.player[Main.myPlayer].inventory[index244].type == 74) - num90 += (long) (Main.player[Main.myPlayer].inventory[index244].stack * 1000000); + if (Main.player[Main.myPlayer].inventory[index188].type == 71) + num43 += (long) Main.player[Main.myPlayer].inventory[index188].stack; + if (Main.player[Main.myPlayer].inventory[index188].type == 72) + num43 += (long) (Main.player[Main.myPlayer].inventory[index188].stack * 100); + if (Main.player[Main.myPlayer].inventory[index188].type == 73) + num43 += (long) (Main.player[Main.myPlayer].inventory[index188].stack * 10000); + if (Main.player[Main.myPlayer].inventory[index188].type == 74) + num43 += (long) (Main.player[Main.myPlayer].inventory[index188].stack * 1000000); } - if (num90 >= 1000000L) + if (num43 >= 1000000L) { - objArray1[index1].SetDefaults(1980); + this.item[index1].SetDefaults(1980); ++index1; } if (Main.moonPhase % 2 == 0 && Main.dayTime || Main.moonPhase % 2 == 1 && !Main.dayTime) { - objArray1[index1].SetDefaults(1981); + this.item[index1].SetDefaults(1981); ++index1; } if (Main.player[Main.myPlayer].team != 0) { - objArray1[index1].SetDefaults(1982); + this.item[index1].SetDefaults(1982); ++index1; } if (Main.hardMode) { - objArray1[index1].SetDefaults(1983); + this.item[index1].SetDefaults(1983); ++index1; } if (NPC.AnyNPCs(208)) { - objArray1[index1].SetDefaults(1984); + this.item[index1].SetDefaults(1984); ++index1; } if (Main.hardMode && NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3) { - objArray1[index1].SetDefaults(1985); + this.item[index1].SetDefaults(1985); ++index1; } if (Main.hardMode && NPC.downedMechBossAny) { - objArray1[index1].SetDefaults(1986); + this.item[index1].SetDefaults(1986); ++index1; } if (Main.hardMode && NPC.downedMartians) { - objArray1[index1].SetDefaults(2863); - int index245 = index1 + 1; - objArray1[index245].SetDefaults(3259); - index1 = index245 + 1; + this.item[index1].SetDefaults(2863); + int index189 = index1 + 1; + this.item[index189].SetDefaults(3259); + index1 = index189 + 1; break; } break; case 19: - for (int index246 = 0; index246 < 40; ++index246) + for (int index190 = 0; index190 < 40; ++index190) { - if (Main.travelShop[index246] != 0) + if (Main.travelShop[index190] != 0) { - objArray1[index1].netDefaults(Main.travelShop[index246]); + this.item[index1].netDefaults(Main.travelShop[index190]); ++index1; } } break; case 20: if (Main.moonPhase % 2 == 0) - objArray1[index1].SetDefaults(3001); + this.item[index1].SetDefaults(3001); else - objArray1[index1].SetDefaults(28); - int index247 = index1 + 1; + this.item[index1].SetDefaults(28); + int index191 = index1 + 1; if (!Main.dayTime || Main.moonPhase == 0) - objArray1[index247].SetDefaults(3002); + this.item[index191].SetDefaults(3002); else - objArray1[index247].SetDefaults(282); - int index248 = index247 + 1; + this.item[index191].SetDefaults(282); + int index192 = index191 + 1; if (Main.time % 60.0 * 60.0 * 6.0 <= 10800.0) - objArray1[index248].SetDefaults(3004); + this.item[index192].SetDefaults(3004); else - objArray1[index248].SetDefaults(8); - int index249 = index248 + 1; + this.item[index192].SetDefaults(8); + int index193 = index192 + 1; if (Main.moonPhase == 0 || Main.moonPhase == 1 || Main.moonPhase == 4 || Main.moonPhase == 5) - objArray1[index249].SetDefaults(3003); + this.item[index193].SetDefaults(3003); else - objArray1[index249].SetDefaults(40); - int index250 = index249 + 1; + this.item[index193].SetDefaults(40); + int index194 = index193 + 1; if (Main.moonPhase % 4 == 0) - objArray1[index250].SetDefaults(3310); + this.item[index194].SetDefaults(3310); else if (Main.moonPhase % 4 == 1) - objArray1[index250].SetDefaults(3313); + this.item[index194].SetDefaults(3313); else if (Main.moonPhase % 4 == 2) - objArray1[index250].SetDefaults(3312); + this.item[index194].SetDefaults(3312); else - objArray1[index250].SetDefaults(3311); - int index251 = index250 + 1; - objArray1[index251].SetDefaults(166); - int index252 = index251 + 1; - objArray1[index252].SetDefaults(965); - index1 = index252 + 1; + this.item[index194].SetDefaults(3311); + int index195 = index194 + 1; + this.item[index195].SetDefaults(166); + int index196 = index195 + 1; + this.item[index196].SetDefaults(965); + index1 = index196 + 1; if (Main.hardMode) { if (Main.moonPhase < 4) - objArray1[index1].SetDefaults(3316); + this.item[index1].SetDefaults(3316); else - objArray1[index1].SetDefaults(3315); - int index253 = index1 + 1; - objArray1[index253].SetDefaults(3334); - index1 = index253 + 1; + this.item[index1].SetDefaults(3315); + int index197 = index1 + 1; + this.item[index197].SetDefaults(3334); + index1 = index197 + 1; if (Main.bloodMoon) { - objArray1[index1].SetDefaults(3258); + this.item[index1].SetDefaults(3258); ++index1; } } if (Main.moonPhase == 0 && !Main.dayTime) { - objArray1[index1].SetDefaults(3043); + this.item[index1].SetDefaults(3043); ++index1; break; } break; case 21: - bool flag2 = Main.hardMode && NPC.downedMechBossAny; - int num91 = !Main.hardMode ? 0 : (NPC.downedGolemBoss ? 1 : 0); - objArray1[index1].SetDefaults(353); - int index254 = index1 + 1; - objArray1[index254].SetDefaults(3828); - objArray1[index254].shopCustomPrice = num91 == 0 ? (!flag2 ? new int?(Item.buyPrice(silver: 25)) : new int?(Item.buyPrice(gold: 1))) : new int?(Item.buyPrice(gold: 4)); - int index255 = index254 + 1; - objArray1[index255].SetDefaults(3816); - int index256 = index255 + 1; - objArray1[index256].SetDefaults(3813); - objArray1[index256].shopCustomPrice = new int?(75); - objArray1[index256].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - int num92 = index256 + 1; - int index257 = 10; - objArray1[index257].SetDefaults(3818); - objArray1[index257].shopCustomPrice = new int?(5); - objArray1[index257].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - int index258 = index257 + 1; - objArray1[index258].SetDefaults(3824); - objArray1[index258].shopCustomPrice = new int?(5); - objArray1[index258].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - int index259 = index258 + 1; - objArray1[index259].SetDefaults(3832); - objArray1[index259].shopCustomPrice = new int?(5); - objArray1[index259].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - int index260 = index259 + 1; - objArray1[index260].SetDefaults(3829); - objArray1[index260].shopCustomPrice = new int?(5); - objArray1[index260].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - if (flag2) + bool flag = Main.hardMode && NPC.downedMechBossAny; + int num44 = !Main.hardMode ? 0 : (NPC.downedGolemBoss ? 1 : 0); + this.item[index1].SetDefaults(353); + int index198 = index1 + 1; + this.item[index198].SetDefaults(3828); + this.item[index198].shopCustomPrice = num44 == 0 ? (!flag ? new int?(Item.buyPrice(silver: 25)) : new int?(Item.buyPrice(gold: 1))) : new int?(Item.buyPrice(gold: 4)); + int index199 = index198 + 1; + this.item[index199].SetDefaults(3816); + int index200 = index199 + 1; + this.item[index200].SetDefaults(3813); + this.item[index200].shopCustomPrice = new int?(75); + this.item[index200].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + int num45 = index200 + 1; + int index201 = 10; + this.item[index201].SetDefaults(3818); + this.item[index201].shopCustomPrice = new int?(5); + this.item[index201].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + int index202 = index201 + 1; + this.item[index202].SetDefaults(3824); + this.item[index202].shopCustomPrice = new int?(5); + this.item[index202].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + int index203 = index202 + 1; + this.item[index203].SetDefaults(3832); + this.item[index203].shopCustomPrice = new int?(5); + this.item[index203].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + index1 = index203 + 1; + this.item[index1].SetDefaults(3829); + this.item[index1].shopCustomPrice = new int?(5); + this.item[index1].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + if (flag) { - int index261 = 20; - objArray1[index261].SetDefaults(3819); - objArray1[index261].shopCustomPrice = new int?(25); - objArray1[index261].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - int index262 = index261 + 1; - objArray1[index262].SetDefaults(3825); - objArray1[index262].shopCustomPrice = new int?(25); - objArray1[index262].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - int index263 = index262 + 1; - objArray1[index263].SetDefaults(3833); - objArray1[index263].shopCustomPrice = new int?(25); - objArray1[index263].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - int index264 = index263 + 1; - objArray1[index264].SetDefaults(3830); - objArray1[index264].shopCustomPrice = new int?(25); - objArray1[index264].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + int index204 = 20; + this.item[index204].SetDefaults(3819); + this.item[index204].shopCustomPrice = new int?(25); + this.item[index204].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + int index205 = index204 + 1; + this.item[index205].SetDefaults(3825); + this.item[index205].shopCustomPrice = new int?(25); + this.item[index205].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + int index206 = index205 + 1; + this.item[index206].SetDefaults(3833); + this.item[index206].shopCustomPrice = new int?(25); + this.item[index206].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + index1 = index206 + 1; + this.item[index1].SetDefaults(3830); + this.item[index1].shopCustomPrice = new int?(25); + this.item[index1].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; } - if (num91 != 0) + if (num44 != 0) { - int index265 = 30; - objArray1[index265].SetDefaults(3820); - objArray1[index265].shopCustomPrice = new int?(100); - objArray1[index265].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - int index266 = index265 + 1; - objArray1[index266].SetDefaults(3826); - objArray1[index266].shopCustomPrice = new int?(100); - objArray1[index266].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - int index267 = index266 + 1; - objArray1[index267].SetDefaults(3834); - objArray1[index267].shopCustomPrice = new int?(100); - objArray1[index267].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - int index268 = index267 + 1; - objArray1[index268].SetDefaults(3831); - objArray1[index268].shopCustomPrice = new int?(100); - objArray1[index268].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + int index207 = 30; + this.item[index207].SetDefaults(3820); + this.item[index207].shopCustomPrice = new int?(100); + this.item[index207].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + int index208 = index207 + 1; + this.item[index208].SetDefaults(3826); + this.item[index208].shopCustomPrice = new int?(100); + this.item[index208].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + int index209 = index208 + 1; + this.item[index209].SetDefaults(3834); + this.item[index209].shopCustomPrice = new int?(100); + this.item[index209].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + index1 = index209 + 1; + this.item[index1].SetDefaults(3831); + this.item[index1].shopCustomPrice = new int?(100); + this.item[index1].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; } - if (flag2) + if (flag) { - int index269 = 4; - objArray1[index269].SetDefaults(3800); - objArray1[index269].shopCustomPrice = new int?(25); - objArray1[index269].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - int index270 = index269 + 1; - objArray1[index270].SetDefaults(3801); - objArray1[index270].shopCustomPrice = new int?(25); - objArray1[index270].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - int index271 = index270 + 1; - objArray1[index271].SetDefaults(3802); - objArray1[index271].shopCustomPrice = new int?(25); - objArray1[index271].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - num92 = index271 + 1; - int index272 = 14; - objArray1[index272].SetDefaults(3797); - objArray1[index272].shopCustomPrice = new int?(25); - objArray1[index272].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - int index273 = index272 + 1; - objArray1[index273].SetDefaults(3798); - objArray1[index273].shopCustomPrice = new int?(25); - objArray1[index273].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - int index274 = index273 + 1; - objArray1[index274].SetDefaults(3799); - objArray1[index274].shopCustomPrice = new int?(25); - objArray1[index274].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - num92 = index274 + 1; - int index275 = 24; - objArray1[index275].SetDefaults(3803); - objArray1[index275].shopCustomPrice = new int?(25); - objArray1[index275].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - int index276 = index275 + 1; - objArray1[index276].SetDefaults(3804); - objArray1[index276].shopCustomPrice = new int?(25); - objArray1[index276].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - int index277 = index276 + 1; - objArray1[index277].SetDefaults(3805); - objArray1[index277].shopCustomPrice = new int?(25); - objArray1[index277].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - num92 = index277 + 1; - int index278 = 34; - objArray1[index278].SetDefaults(3806); - objArray1[index278].shopCustomPrice = new int?(25); - objArray1[index278].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - int index279 = index278 + 1; - objArray1[index279].SetDefaults(3807); - objArray1[index279].shopCustomPrice = new int?(25); - objArray1[index279].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - int index280 = index279 + 1; - objArray1[index280].SetDefaults(3808); - objArray1[index280].shopCustomPrice = new int?(25); - objArray1[index280].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - num92 = index280 + 1; + int index210 = 4; + this.item[index210].SetDefaults(3800); + this.item[index210].shopCustomPrice = new int?(25); + this.item[index210].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + int index211 = index210 + 1; + this.item[index211].SetDefaults(3801); + this.item[index211].shopCustomPrice = new int?(25); + this.item[index211].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + int index212 = index211 + 1; + this.item[index212].SetDefaults(3802); + this.item[index212].shopCustomPrice = new int?(25); + this.item[index212].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + num45 = index212 + 1; + int index213 = 14; + this.item[index213].SetDefaults(3797); + this.item[index213].shopCustomPrice = new int?(25); + this.item[index213].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + int index214 = index213 + 1; + this.item[index214].SetDefaults(3798); + this.item[index214].shopCustomPrice = new int?(25); + this.item[index214].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + int index215 = index214 + 1; + this.item[index215].SetDefaults(3799); + this.item[index215].shopCustomPrice = new int?(25); + this.item[index215].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + num45 = index215 + 1; + int index216 = 24; + this.item[index216].SetDefaults(3803); + this.item[index216].shopCustomPrice = new int?(25); + this.item[index216].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + int index217 = index216 + 1; + this.item[index217].SetDefaults(3804); + this.item[index217].shopCustomPrice = new int?(25); + this.item[index217].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + int index218 = index217 + 1; + this.item[index218].SetDefaults(3805); + this.item[index218].shopCustomPrice = new int?(25); + this.item[index218].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + num45 = index218 + 1; + int index219 = 34; + this.item[index219].SetDefaults(3806); + this.item[index219].shopCustomPrice = new int?(25); + this.item[index219].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + int index220 = index219 + 1; + this.item[index220].SetDefaults(3807); + this.item[index220].shopCustomPrice = new int?(25); + this.item[index220].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + int index221 = index220 + 1; + this.item[index221].SetDefaults(3808); + this.item[index221].shopCustomPrice = new int?(25); + this.item[index221].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + index1 = index221 + 1; } - if (num91 != 0) + if (num44 != 0) { - int index281 = 7; - objArray1[index281].SetDefaults(3871); - objArray1[index281].shopCustomPrice = new int?(75); - objArray1[index281].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - int index282 = index281 + 1; - objArray1[index282].SetDefaults(3872); - objArray1[index282].shopCustomPrice = new int?(75); - objArray1[index282].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - int index283 = index282 + 1; - objArray1[index283].SetDefaults(3873); - objArray1[index283].shopCustomPrice = new int?(75); - objArray1[index283].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - num92 = index283 + 1; - int index284 = 17; - objArray1[index284].SetDefaults(3874); - objArray1[index284].shopCustomPrice = new int?(75); - objArray1[index284].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - int index285 = index284 + 1; - objArray1[index285].SetDefaults(3875); - objArray1[index285].shopCustomPrice = new int?(75); - objArray1[index285].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - int index286 = index285 + 1; - objArray1[index286].SetDefaults(3876); - objArray1[index286].shopCustomPrice = new int?(75); - objArray1[index286].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - num92 = index286 + 1; - int index287 = 27; - objArray1[index287].SetDefaults(3877); - objArray1[index287].shopCustomPrice = new int?(75); - objArray1[index287].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - int index288 = index287 + 1; - objArray1[index288].SetDefaults(3878); - objArray1[index288].shopCustomPrice = new int?(75); - objArray1[index288].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - int index289 = index288 + 1; - objArray1[index289].SetDefaults(3879); - objArray1[index289].shopCustomPrice = new int?(75); - objArray1[index289].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - num92 = index289 + 1; - int index290 = 37; - objArray1[index290].SetDefaults(3880); - objArray1[index290].shopCustomPrice = new int?(75); - objArray1[index290].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - int index291 = index290 + 1; - objArray1[index291].SetDefaults(3881); - objArray1[index291].shopCustomPrice = new int?(75); - objArray1[index291].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - int index292 = index291 + 1; - objArray1[index292].SetDefaults(3882); - objArray1[index292].shopCustomPrice = new int?(75); - objArray1[index292].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; - num92 = index292 + 1; - } - index1 = num91 == 0 ? (!flag2 ? 4 : 30) : 39; - break; - case 22: - Item[] objArray111 = objArray1; - int index293 = index1; - int num93 = index293 + 1; - objArray111[index293].SetDefaults(4587); - Item[] objArray112 = objArray1; - int index294 = num93; - int num94 = index294 + 1; - objArray112[index294].SetDefaults(4590); - Item[] objArray113 = objArray1; - int index295 = num94; - int num95 = index295 + 1; - objArray113[index295].SetDefaults(4589); - Item[] objArray114 = objArray1; - int index296 = num95; - int num96 = index296 + 1; - objArray114[index296].SetDefaults(4588); - Item[] objArray115 = objArray1; - int index297 = num96; - int num97 = index297 + 1; - objArray115[index297].SetDefaults(4083); - Item[] objArray116 = objArray1; - int index298 = num97; - int num98 = index298 + 1; - objArray116[index298].SetDefaults(4084); - Item[] objArray117 = objArray1; - int index299 = num98; - int num99 = index299 + 1; - objArray117[index299].SetDefaults(4085); - Item[] objArray118 = objArray1; - int index300 = num99; - int num100 = index300 + 1; - objArray118[index300].SetDefaults(4086); - Item[] objArray119 = objArray1; - int index301 = num100; - int num101 = index301 + 1; - objArray119[index301].SetDefaults(4087); - Item[] objArray120 = objArray1; - int index302 = num101; - int index303 = index302 + 1; - objArray120[index302].SetDefaults(4088); - int scoreAccumulated2 = Main.LocalPlayer.golferScoreAccumulated; - if (scoreAccumulated2 > 500) - { - objArray1[index303].SetDefaults(4039); - int index304 = index303 + 1; - objArray1[index304].SetDefaults(4094); - int index305 = index304 + 1; - objArray1[index305].SetDefaults(4093); - int index306 = index305 + 1; - objArray1[index306].SetDefaults(4092); - index303 = index306 + 1; - } - Item[] objArray121 = objArray1; - int index307 = index303; - int num102 = index307 + 1; - objArray121[index307].SetDefaults(4089); - Item[] objArray122 = objArray1; - int index308 = num102; - int num103 = index308 + 1; - objArray122[index308].SetDefaults(3989); - Item[] objArray123 = objArray1; - int index309 = num103; - int num104 = index309 + 1; - objArray123[index309].SetDefaults(4095); - Item[] objArray124 = objArray1; - int index310 = num104; - int num105 = index310 + 1; - objArray124[index310].SetDefaults(4040); - Item[] objArray125 = objArray1; - int index311 = num105; - int num106 = index311 + 1; - objArray125[index311].SetDefaults(4319); - Item[] objArray126 = objArray1; - int index312 = num106; - int index313 = index312 + 1; - objArray126[index312].SetDefaults(4320); - if (scoreAccumulated2 > 1000) - { - objArray1[index313].SetDefaults(4591); - int index314 = index313 + 1; - objArray1[index314].SetDefaults(4594); - int index315 = index314 + 1; - objArray1[index315].SetDefaults(4593); - int index316 = index315 + 1; - objArray1[index316].SetDefaults(4592); - index313 = index316 + 1; - } - Item[] objArray127 = objArray1; - int index317 = index313; - int num107 = index317 + 1; - objArray127[index317].SetDefaults(4135); - Item[] objArray128 = objArray1; - int index318 = num107; - int num108 = index318 + 1; - objArray128[index318].SetDefaults(4138); - Item[] objArray129 = objArray1; - int index319 = num108; - int num109 = index319 + 1; - objArray129[index319].SetDefaults(4136); - Item[] objArray130 = objArray1; - int index320 = num109; - int num110 = index320 + 1; - objArray130[index320].SetDefaults(4137); - Item[] objArray131 = objArray1; - int index321 = num110; - index1 = index321 + 1; - objArray131[index321].SetDefaults(4049); - if (scoreAccumulated2 > 500) - { - objArray1[index1].SetDefaults(4265); - ++index1; - } - if (scoreAccumulated2 > 2000) - { - objArray1[index1].SetDefaults(4595); - int index322 = index1 + 1; - objArray1[index322].SetDefaults(4598); - int index323 = index322 + 1; - objArray1[index323].SetDefaults(4597); - int index324 = index323 + 1; - objArray1[index324].SetDefaults(4596); - index1 = index324 + 1; - if (NPC.downedBoss3) - { - objArray1[index1].SetDefaults(4264); - ++index1; - } - } - if (scoreAccumulated2 > 500) - { - objArray1[index1].SetDefaults(4599); - ++index1; - } - if (scoreAccumulated2 >= 1000) - { - objArray1[index1].SetDefaults(4600); - ++index1; - } - if (scoreAccumulated2 >= 2000) - { - objArray1[index1].SetDefaults(4601); - ++index1; - } - if (scoreAccumulated2 >= 2000) - { - switch (Main.moonPhase) - { - case 0: - case 1: - objArray1[index1].SetDefaults(4658); - ++index1; - break; - case 2: - case 3: - objArray1[index1].SetDefaults(4659); - ++index1; - break; - case 4: - case 5: - objArray1[index1].SetDefaults(4660); - ++index1; - break; - case 6: - case 7: - objArray1[index1].SetDefaults(4661); - ++index1; - break; - } - } - else + int index222 = 7; + this.item[index222].SetDefaults(3871); + this.item[index222].shopCustomPrice = new int?(75); + this.item[index222].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + int index223 = index222 + 1; + this.item[index223].SetDefaults(3872); + this.item[index223].shopCustomPrice = new int?(75); + this.item[index223].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + int index224 = index223 + 1; + this.item[index224].SetDefaults(3873); + this.item[index224].shopCustomPrice = new int?(75); + this.item[index224].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + num45 = index224 + 1; + int index225 = 17; + this.item[index225].SetDefaults(3874); + this.item[index225].shopCustomPrice = new int?(75); + this.item[index225].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + int index226 = index225 + 1; + this.item[index226].SetDefaults(3875); + this.item[index226].shopCustomPrice = new int?(75); + this.item[index226].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + int index227 = index226 + 1; + this.item[index227].SetDefaults(3876); + this.item[index227].shopCustomPrice = new int?(75); + this.item[index227].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + num45 = index227 + 1; + int index228 = 27; + this.item[index228].SetDefaults(3877); + this.item[index228].shopCustomPrice = new int?(75); + this.item[index228].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + int index229 = index228 + 1; + this.item[index229].SetDefaults(3878); + this.item[index229].shopCustomPrice = new int?(75); + this.item[index229].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + int index230 = index229 + 1; + this.item[index230].SetDefaults(3879); + this.item[index230].shopCustomPrice = new int?(75); + this.item[index230].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + num45 = index230 + 1; + int index231 = 37; + this.item[index231].SetDefaults(3880); + this.item[index231].shopCustomPrice = new int?(75); + this.item[index231].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + int index232 = index231 + 1; + this.item[index232].SetDefaults(3881); + this.item[index232].shopCustomPrice = new int?(75); + this.item[index232].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + int index233 = index232 + 1; + this.item[index233].SetDefaults(3882); + this.item[index233].shopCustomPrice = new int?(75); + this.item[index233].shopSpecialCurrency = CustomCurrencyID.DefenderMedals; + index1 = index233 + 1; break; - break; - case 23: - BestiaryUnlockProgressReport bestiaryProgressReport = Main.GetBestiaryProgressReport(); - if (Chest.BestiaryGirl_IsFairyTorchAvailable()) - objArray1[index1++].SetDefaults(4776); - Item[] objArray132 = objArray1; - int index325 = index1; - int num111 = index325 + 1; - objArray132[index325].SetDefaults(4767); - Item[] objArray133 = objArray1; - int index326 = num111; - index1 = index326 + 1; - objArray133[index326].SetDefaults(4759); - if ((double) bestiaryProgressReport.CompletionPercent >= 0.150000005960464) - objArray1[index1++].SetDefaults(4672); - if (!NPC.boughtCat) - objArray1[index1++].SetDefaults(4829); - if (!NPC.boughtDog && (double) bestiaryProgressReport.CompletionPercent >= 0.25) - objArray1[index1++].SetDefaults(4830); - if (!NPC.boughtBunny && (double) bestiaryProgressReport.CompletionPercent >= 0.449999988079071) - objArray1[index1++].SetDefaults(4910); - if ((double) bestiaryProgressReport.CompletionPercent >= 0.300000011920929) - objArray1[index1++].SetDefaults(4871); - if ((double) bestiaryProgressReport.CompletionPercent >= 0.300000011920929) - objArray1[index1++].SetDefaults(4907); - if (NPC.downedTowerSolar) - objArray1[index1++].SetDefaults(4677); - if ((double) bestiaryProgressReport.CompletionPercent >= 0.100000001490116) - objArray1[index1++].SetDefaults(4676); - if ((double) bestiaryProgressReport.CompletionPercent >= 0.300000011920929) - objArray1[index1++].SetDefaults(4762); - if ((double) bestiaryProgressReport.CompletionPercent >= 0.25) - objArray1[index1++].SetDefaults(4716); - if ((double) bestiaryProgressReport.CompletionPercent >= 0.300000011920929) - objArray1[index1++].SetDefaults(4785); - if ((double) bestiaryProgressReport.CompletionPercent >= 0.300000011920929) - objArray1[index1++].SetDefaults(4786); - if ((double) bestiaryProgressReport.CompletionPercent >= 0.300000011920929) - objArray1[index1++].SetDefaults(4787); - if ((double) bestiaryProgressReport.CompletionPercent >= 0.300000011920929 && Main.hardMode) - objArray1[index1++].SetDefaults(4788); - if ((double) bestiaryProgressReport.CompletionPercent >= 0.400000005960464) - objArray1[index1++].SetDefaults(4955); - if (Main.hardMode && Main.bloodMoon) - objArray1[index1++].SetDefaults(4736); - if (NPC.downedPlantBoss) - objArray1[index1++].SetDefaults(4701); - if ((double) bestiaryProgressReport.CompletionPercent >= 0.5) - objArray1[index1++].SetDefaults(4765); - if ((double) bestiaryProgressReport.CompletionPercent >= 0.5) - objArray1[index1++].SetDefaults(4766); - if ((double) bestiaryProgressReport.CompletionPercent >= 0.5) - objArray1[index1++].SetDefaults(4777); - if ((double) bestiaryProgressReport.CompletionPercent >= 0.600000023841858) - objArray1[index1++].SetDefaults(4763); - if ((double) bestiaryProgressReport.CompletionPercent >= 0.699999988079071) - objArray1[index1++].SetDefaults(4735); - if ((double) bestiaryProgressReport.CompletionPercent >= 1.0) - objArray1[index1++].SetDefaults(4951); - switch (Main.moonPhase) - { - case 0: - case 1: - Item[] objArray134 = objArray1; - int index327 = index1; - int num112 = index327 + 1; - objArray134[index327].SetDefaults(4768); - Item[] objArray135 = objArray1; - int index328 = num112; - index1 = index328 + 1; - objArray135[index328].SetDefaults(4769); - break; - case 2: - case 3: - Item[] objArray136 = objArray1; - int index329 = index1; - int num113 = index329 + 1; - objArray136[index329].SetDefaults(4770); - Item[] objArray137 = objArray1; - int index330 = num113; - index1 = index330 + 1; - objArray137[index330].SetDefaults(4771); - break; - case 4: - case 5: - Item[] objArray138 = objArray1; - int index331 = index1; - int num114 = index331 + 1; - objArray138[index331].SetDefaults(4772); - Item[] objArray139 = objArray1; - int index332 = num114; - index1 = index332 + 1; - objArray139[index332].SetDefaults(4773); - break; - case 6: - case 7: - Item[] objArray140 = objArray1; - int index333 = index1; - int num115 = index333 + 1; - objArray140[index333].SetDefaults(4560); - Item[] objArray141 = objArray1; - int index334 = num115; - index1 = index334 + 1; - objArray141[index334].SetDefaults(4775); - break; } break; } - if (((type == 19 ? 0 : (type != 20 ? 1 : 0)) & (flag1 ? 1 : 0)) != 0 && !Main.player[Main.myPlayer].ZoneCorrupt && !Main.player[Main.myPlayer].ZoneCrimson) - { - if (!Main.player[Main.myPlayer].ZoneSnow && !Main.player[Main.myPlayer].ZoneDesert && !Main.player[Main.myPlayer].ZoneBeach && !Main.player[Main.myPlayer].ZoneJungle && !Main.player[Main.myPlayer].ZoneHallow && !Main.player[Main.myPlayer].ZoneGlowshroom && (double) Main.player[Main.myPlayer].Center.Y / 16.0 < Main.worldSurface && index1 < 39) - objArray1[index1++].SetDefaults(4876); - if (Main.player[Main.myPlayer].ZoneSnow && index1 < 39) - objArray1[index1++].SetDefaults(4920); - if (Main.player[Main.myPlayer].ZoneDesert && index1 < 39) - objArray1[index1++].SetDefaults(4919); - if (!Main.player[Main.myPlayer].ZoneSnow && !Main.player[Main.myPlayer].ZoneDesert && !Main.player[Main.myPlayer].ZoneBeach && !Main.player[Main.myPlayer].ZoneJungle && !Main.player[Main.myPlayer].ZoneHallow && !Main.player[Main.myPlayer].ZoneGlowshroom && (double) Main.player[Main.myPlayer].Center.Y / 16.0 >= Main.worldSurface && index1 < 39) - objArray1[index1++].SetDefaults(4917); - if (Main.player[Main.myPlayer].ZoneBeach && (double) Main.player[Main.myPlayer].position.Y < Main.worldSurface * 16.0 && index1 < 39) - objArray1[index1++].SetDefaults(4918); - if (Main.player[Main.myPlayer].ZoneJungle && index1 < 39) - objArray1[index1++].SetDefaults(4875); - if (Main.player[Main.myPlayer].ZoneHallow && index1 < 39) - objArray1[index1++].SetDefaults(4916); - if (Main.player[Main.myPlayer].ZoneGlowshroom && index1 < 39) - objArray1[index1++].SetDefaults(4921); - } - for (int index335 = 0; index335 < index1; ++index335) - objArray1[index335].isAShopItem = true; + if (!Main.player[Main.myPlayer].discount) + return; + for (int index234 = 0; index234 < index1; ++index234) + this.item[index234].value = (int) ((double) this.item[index234].value * 0.800000011920929); } - private static bool BestiaryGirl_IsFairyTorchAvailable() => Chest.DidDiscoverBestiaryEntry(585) && Chest.DidDiscoverBestiaryEntry(584) && Chest.DidDiscoverBestiaryEntry(583); - - private static bool DidDiscoverBestiaryEntry(int npcId) => Main.BestiaryDB.FindEntryByNPCID(npcId).UIInfoProvider.GetEntryUICollectionInfo().UnlockState > BestiaryEntryUnlockState.NotKnownAtAll_0; - public static void UpdateChestFrames() { - int num = 8000; - Chest._chestInUse.Clear(); + bool[] flagArray = new bool[1000]; for (int index = 0; index < (int) byte.MaxValue; ++index) { - if (Main.player[index].active && Main.player[index].chest >= 0 && Main.player[index].chest < num) - Chest._chestInUse.Add(Main.player[index].chest); + if (Main.player[index].active && Main.player[index].chest >= 0 && Main.player[index].chest < 1000) + flagArray[Main.player[index].chest] = true; } - for (int index = 0; index < num; ++index) + for (int index = 0; index < 1000; ++index) { Chest chest = Main.chest[index]; if (chest != null) { - if (Chest._chestInUse.Contains(index)) + if (flagArray[index]) ++chest.frameCounter; else --chest.frameCounter; diff --git a/Cinematics/CinematicManager.cs b/Cinematics/CinematicManager.cs index 0b3726d..75817b6 100644 --- a/Cinematics/CinematicManager.cs +++ b/Cinematics/CinematicManager.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Cinematics.CinematicManager -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/Cinematics/DD2Film.cs b/Cinematics/DD2Film.cs index 3434807..efdde1b 100644 --- a/Cinematics/DD2Film.cs +++ b/Cinematics/DD2Film.cs @@ -1,13 +1,12 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Cinematics.DD2Film -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using System; using System.Collections.Generic; -using Terraria.Audio; using Terraria.GameContent.UI; using Terraria.ID; @@ -134,7 +133,7 @@ namespace Terraria.Cinematics } } - private void OgreSwingSound(FrameEventData evt) => SoundEngine.PlaySound(SoundID.DD2_OgreAttack, this._ogre.Center); + private void OgreSwingSound(FrameEventData evt) => Main.PlaySound(SoundID.DD2_OgreAttack, this._ogre.Center); private void DryadPortalKnock(FrameEventData evt) { @@ -144,7 +143,7 @@ namespace Terraria.Cinematics { this._dryad.velocity.Y -= 7f; this._dryad.velocity.X -= 8f; - SoundEngine.PlaySound(3, (int) this._dryad.Center.X, (int) this._dryad.Center.Y); + Main.PlaySound(3, (int) this._dryad.Center.X, (int) this._dryad.Center.Y); } if (evt.Frame >= 20) { @@ -188,7 +187,7 @@ namespace Terraria.Cinematics if (this._dryad == null || this._portal == null) return; if (evt.IsFirstFrame) - SoundEngine.PlaySound(SoundID.DD2_EtherianPortalDryadTouch, this._dryad.Center); + Main.PlaySound(SoundID.DD2_EtherianPortalDryadTouch, this._dryad.Center); float amount = Math.Max(0.0f, (float) (evt.Frame - 7) / (float) (evt.Duration - 7)); this._dryad.color = new Color(Vector3.Lerp(Vector3.One, new Vector3(0.5f, 0.0f, 0.8f), amount)); this._dryad.Opacity = 1f - amount; diff --git a/Cinematics/Film.cs b/Cinematics/Film.cs index 1e5a6b0..407a384 100644 --- a/Cinematics/Film.cs +++ b/Cinematics/Film.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Cinematics.Film -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/Cinematics/FrameEvent.cs b/Cinematics/FrameEvent.cs index 7ba22b2..e94bf6d 100644 --- a/Cinematics/FrameEvent.cs +++ b/Cinematics/FrameEvent.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Cinematics.FrameEvent -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Cinematics diff --git a/Cinematics/FrameEventData.cs b/Cinematics/FrameEventData.cs index e025bf2..622bb21 100644 --- a/Cinematics/FrameEventData.cs +++ b/Cinematics/FrameEventData.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Cinematics.FrameEventData -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Cinematics diff --git a/Cloud.cs b/Cloud.cs index 6438a13..27bfc6f 100644 --- a/Cloud.cs +++ b/Cloud.cs @@ -1,12 +1,11 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Cloud -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Terraria.GameContent; using Terraria.Utilities; namespace Terraria @@ -29,9 +28,9 @@ namespace Terraria public static void resetClouds() { - if (Main.dedServ) + if (Main.dedServ || Main.cloudLimit < 10) return; - Main.windSpeedCurrent = Main.windSpeedTarget; + Main.windSpeed = Main.windSpeedSet; for (int index = 0; index < 200; ++index) Main.cloud[index].active = false; for (int index = 0; index < Main.numClouds; ++index) @@ -63,15 +62,15 @@ namespace Terraria Main.cloud[index1].sSpeed = 0.0f; Main.cloud[index1].scale = (float) Cloud.rand.Next(70, 131) * 0.01f; Main.cloud[index1].rotation = (float) Cloud.rand.Next(-10, 11) * 0.01f; - Main.cloud[index1].width = (int) ((double) TextureAssets.Cloud[Main.cloud[index1].type].Width() * (double) Main.cloud[index1].scale); - Main.cloud[index1].height = (int) ((double) TextureAssets.Cloud[Main.cloud[index1].type].Height() * (double) Main.cloud[index1].scale); + Main.cloud[index1].width = (int) ((double) Main.cloudTexture[Main.cloud[index1].type].Width * (double) Main.cloud[index1].scale); + Main.cloud[index1].height = (int) ((double) Main.cloudTexture[Main.cloud[index1].type].Height * (double) Main.cloud[index1].scale); Main.cloud[index1].Alpha = 0.0f; Main.cloud[index1].spriteDir = SpriteEffects.None; if (Cloud.rand.Next(2) == 0) Main.cloud[index1].spriteDir = SpriteEffects.FlipHorizontally; - float num1 = Main.windSpeedCurrent; + float num1 = Main.windSpeed; if (!Main.gameMenu) - num1 = Main.windSpeedCurrent - Main.player[Main.myPlayer].velocity.X * 0.1f; + num1 = Main.windSpeed - Main.player[Main.myPlayer].velocity.X * 0.1f; int num2 = 0; int num3 = 0; if ((double) num1 > 0.0) @@ -81,9 +80,9 @@ namespace Terraria int num4 = 300; float num5 = (float) WorldGen.genRand.Next(num2 - num4, Main.screenWidth + num3 + num4); Main.cloud[index1].Alpha = 0.0f; - Main.cloud[index1].position.Y = (float) Cloud.rand.Next((int) ((double) -Main.screenHeight * 0.25), (int) ((double) Main.screenHeight * 0.150000005960464)); - if (Main.rand.Next(3) == 0) - Main.cloud[index1].position.Y -= (float) Cloud.rand.Next((int) ((double) Main.screenHeight * 0.100000001490116)); + Main.cloud[index1].position.Y = (float) Cloud.rand.Next((int) ((double) -Main.screenHeight * 0.25), (int) ((double) Main.screenHeight * 0.25)); + Main.cloud[index1].position.Y -= (float) Cloud.rand.Next((int) ((double) Main.screenHeight * 0.150000005960464)); + Main.cloud[index1].position.Y -= (float) Cloud.rand.Next((int) ((double) Main.screenHeight * 0.150000005960464)); Main.cloud[index1].type = Cloud.rand.Next(4); if ((double) Main.cloudAlpha > 0.0 && Cloud.rand.Next(4) != 0 || (double) Main.cloudBGActive >= 1.0 && Cloud.rand.Next(2) == 0) { @@ -93,14 +92,12 @@ namespace Terraria if ((double) Main.cloud[index1].scale >= 1.0) Main.cloud[index1].position.Y -= 150f; } - else if ((double) Main.cloudBGActive <= 0.0 && (double) Main.cloudAlpha == 0.0 && (double) Main.cloud[index1].scale < 1.0 && (double) Main.cloud[index1].position.Y < (double) -Main.screenHeight * 0.150000005960464 && (double) Main.numClouds <= 80.0) + else if (((double) Main.cloudBGActive <= 0.0 && (double) Main.cloudAlpha == 0.0 && (double) Main.cloud[index1].scale < 1.0 && (double) Main.cloud[index1].position.Y < (double) -Main.screenHeight * 0.200000002980232 || (double) Main.cloud[index1].position.Y < (double) -Main.screenHeight * 0.200000002980232) && (double) Main.numClouds < 50.0) Main.cloud[index1].type = Cloud.rand.Next(9, 14); else if (((double) Main.cloud[index1].scale < 1.15 && (double) Main.cloud[index1].position.Y < (double) -Main.screenHeight * 0.300000011920929 || (double) Main.cloud[index1].scale < 0.85 && (double) Main.cloud[index1].position.Y < (double) Main.screenHeight * 0.150000005960464) && ((double) Main.numClouds > 70.0 || (double) Main.cloudBGActive >= 1.0)) Main.cloud[index1].type = Cloud.rand.Next(4, 9); else if ((double) Main.cloud[index1].position.Y > (double) -Main.screenHeight * 0.150000005960464 && Cloud.rand.Next(2) == 0 && (double) Main.numClouds > 20.0) Main.cloud[index1].type = Cloud.rand.Next(14, 18); - if (Cloud.rand.Next(150) == 0) - Main.cloud[index1].type = Cloud.RollRareCloud(); if ((double) Main.cloud[index1].scale > 1.2) Main.cloud[index1].position.Y += 100f; if ((double) Main.cloud[index1].scale > 1.3) @@ -109,9 +106,9 @@ namespace Terraria Main.cloud[index1].scale = 0.7f; Main.cloud[index1].active = true; Main.cloud[index1].position.X = num5; - if ((double) Main.cloud[index1].position.X > (double) (Main.screenWidth + 400)) + if ((double) Main.cloud[index1].position.X > (double) (Main.screenWidth + 100)) Main.cloud[index1].Alpha = 1f; - if ((double) Main.cloud[index1].position.X + (double) TextureAssets.Cloud[Main.cloud[index1].type].Width() * (double) Main.cloud[index1].scale < -400.0) + if ((double) Main.cloud[index1].position.X + (double) Main.cloudTexture[Main.cloud[index1].type].Width * (double) Main.cloud[index1].scale < -100.0) Main.cloud[index1].Alpha = 1f; Rectangle rectangle1 = new Rectangle((int) Main.cloud[index1].position.X, (int) Main.cloud[index1].position.Y, Main.cloud[index1].width, Main.cloud[index1].height); for (int index3 = 0; index3 < 200; ++index3) @@ -125,44 +122,6 @@ namespace Terraria } } - private static int RollRareCloud() - { - int num = -1; - bool flag = false; - while (!flag) - { - num = Cloud.rand.Next(22, 37); - switch (num) - { - case 25: - case 26: - flag = NPC.downedBoss1; - continue; - case 28: - if (Main.rand.Next(10) == 0) - { - flag = true; - continue; - } - continue; - case 30: - case 35: - flag = Main.hardMode; - continue; - case 31: - flag = NPC.downedBoss3; - continue; - case 36: - flag = NPC.downedBoss2 && WorldGen.crimson; - continue; - default: - flag = true; - continue; - } - } - return num; - } - public Color cloudColor(Color bgColor) { float num = this.scale * this.Alpha; @@ -222,42 +181,42 @@ namespace Terraria public void Update() { - if (WorldGen.drunkWorldGenText && Main.gameMenu) - this.type = 28; - if ((double) this.scale == 1.0) - this.scale -= 0.0001f; - if ((double) this.scale == 1.15) - this.scale -= 0.0001f; - float num1; - if ((double) this.scale < 1.0) + if (Main.gameMenu) { - float num2 = 0.07f; - float num3 = (float) (((double) (this.scale + 0.15f) + 1.0) / 2.0); - float num4 = num3 * num3; - num1 = num2 * num4; - } - else if ((double) this.scale <= 1.15) - { - float num5 = 0.19f; - float num6 = this.scale - 0.075f; - float num7 = num6 * num6; - num1 = num5 * num7; + this.position.X += (float) ((double) Main.windSpeed * (double) this.scale * 3.0); } else { - float num8 = 0.23f; - float num9 = (float) ((double) this.scale - 0.150000005960464 - 0.0750000029802322); - float num10 = num9 * num9; - num1 = num8 * num10; - } - this.position.X += Main.windSpeedCurrent * 9f * num1 * (float) Main.dayRate; - this.position.X -= (Main.screenPosition.X - Main.screenLastPosition.X) * num1; - float num11 = 600f; - if ((double) Main.bgAlphaFrontLayer[4] == 1.0 && (double) this.position.Y > 200.0) - { - this.kill = true; - this.Alpha -= 0.005f * (float) Main.dayRate; + if ((double) this.scale == 1.0) + this.scale -= 0.0001f; + if ((double) this.scale == 1.15) + this.scale -= 0.0001f; + float num1; + if ((double) this.scale < 1.0) + { + float num2 = 0.07f; + float num3 = (float) (((double) (this.scale + 0.15f) + 1.0) / 2.0); + float num4 = num3 * num3; + num1 = num2 * num4; + } + else if ((double) this.scale <= 1.15) + { + float num5 = 0.19f; + float num6 = this.scale - 0.075f; + float num7 = num6 * num6; + num1 = num5 * num7; + } + else + { + float num8 = 0.23f; + float num9 = (float) ((double) this.scale - 0.150000005960464 - 0.0750000029802322); + float num10 = num9 * num9; + num1 = num8 * num10; + } + this.position.X += (float) ((double) Main.windSpeed * (double) num1 * 5.0) * (float) Main.dayRate; + this.position.X -= (Main.screenPosition.X - Main.screenLastPosition.X) * num1; } + float num = 600f; if (!this.kill) { if ((double) this.Alpha < 1.0) @@ -273,7 +232,7 @@ namespace Terraria if ((double) this.Alpha <= 0.0) this.active = false; } - if ((double) this.position.X + (double) TextureAssets.Cloud[this.type].Width() * (double) this.scale < -(double) num11 || (double) this.position.X > (double) Main.screenWidth + (double) num11) + if ((double) this.position.X + (double) Main.cloudTexture[this.type].Width * (double) this.scale < -(double) num || (double) this.position.X > (double) Main.screenWidth + (double) num) this.active = false; this.rSpeed += (float) Cloud.rand.Next(-10, 11) * 2E-05f; if ((double) this.rSpeed > 0.0002) @@ -285,8 +244,8 @@ namespace Terraria if ((double) this.rotation < -0.02) this.rotation = -0.02f; this.rotation += this.rSpeed; - this.width = (int) ((double) TextureAssets.Cloud[this.type].Width() * (double) this.scale); - this.height = (int) ((double) TextureAssets.Cloud[this.type].Height() * (double) this.scale); + this.width = (int) ((double) Main.cloudTexture[this.type].Width * (double) this.scale); + this.height = (int) ((double) Main.cloudTexture[this.type].Height * (double) this.scale); if (this.type < 9 || this.type > 13 || (double) Main.cloudAlpha <= 0.0 && (double) Main.cloudBGActive < 1.0) return; this.kill = true; diff --git a/Collision.cs b/Collision.cs index 55a3c1c..d41feac 100644 --- a/Collision.cs +++ b/Collision.cs @@ -1,26 +1,25 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Collision -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using System; using System.Collections.Generic; -using Terraria.DataStructures; using Terraria.ID; namespace Terraria { public class Collision { - public static bool stair; - public static bool stairFall; - public static bool honey; - public static bool sloping; + public static bool stair = false; + public static bool stairFall = false; + public static bool honey = false; + public static bool sloping = false; public static bool landMine = false; - public static bool up; - public static bool down; + public static bool up = false; + public static bool down = false; public static float Epsilon = 2.718282f; public static Vector2[] CheckLinevLine(Vector2 a1, Vector2 a2, Vector2 b1, Vector2 b2) @@ -306,10 +305,6 @@ namespace Terraria return flag; } - public static bool CanHit(Entity source, Entity target) => Collision.CanHit(source.position, source.width, source.height, target.position, target.width, target.height); - - public static bool CanHit(Entity source, NPCAimedTarget target) => Collision.CanHit(source.position, source.width, source.height, target.Position, target.Width, target.Height); - public static bool CanHit( Vector2 Position1, int Width1, @@ -381,7 +376,7 @@ namespace Terraria Vector2 Position2, int Width2, int Height2, - Utils.TileActionAttempt check) + Utils.PerLinePoint check) { int x = (int) (((double) Position1.X + (double) (Width1 / 2)) / 16.0); int y = (int) (((double) Position1.Y + (double) (Height1 / 2)) / 16.0); @@ -884,7 +879,7 @@ namespace Terraria public static bool HitWallSubstep(int x, int y) { - if (Main.tile[x, y].wall == (ushort) 0) + if (Main.tile[x, y].wall == (byte) 0) return false; bool flag1 = false; if (Main.wallHouse[(int) Main.tile[x, y].wall]) @@ -895,7 +890,7 @@ namespace Terraria { for (int index2 = -1; index2 < 2; ++index2) { - if ((index1 != 0 || index2 != 0) && Main.tile[x + index1, y + index2].wall == (ushort) 0) + if ((index1 != 0 || index2 != 0) && Main.tile[x + index1, y + index2].wall == (byte) 0) flag1 = true; } } @@ -939,12 +934,7 @@ namespace Terraria return true; } - public static bool DrownCollision( - Vector2 Position, - int Width, - int Height, - float gravDir = -1f, - bool includeSlopes = false) + public static bool DrownCollision(Vector2 Position, int Width, int Height, float gravDir = -1f) { Vector2 vector2_1 = new Vector2(Position.X + (float) (Width / 2), Position.Y + (float) (Height / 2)); int num1 = 10; @@ -971,7 +961,7 @@ namespace Terraria for (int index2 = num9; index2 < num10; ++index2) { Tile tile = Main.tile[index1, index2]; - if (tile != null && tile.liquid > (byte) 0 && !tile.lava() && (index2 != num11 || !tile.active() || !Main.tileSolid[(int) tile.type] || Main.tileSolidTop[(int) tile.type] || includeSlopes && tile.blockType() != 0)) + if (tile != null && tile.liquid > (byte) 0 && !tile.lava() && (index2 != num11 || !tile.active() || !Main.tileSolid[(int) tile.type] || Main.tileSolidTop[(int) tile.type])) { Vector2 vector2_2; vector2_2.X = (float) (index1 * 16); @@ -988,96 +978,6 @@ namespace Terraria return false; } - public static bool IsWorldPointSolid(Vector2 pos) - { - Point tileCoordinates = pos.ToTileCoordinates(); - if (!WorldGen.InWorld(tileCoordinates.X, tileCoordinates.Y, 1)) - return false; - Tile tile = Main.tile[tileCoordinates.X, tileCoordinates.Y]; - if (tile == null || !tile.active() || tile.inActive() || !Main.tileSolid[(int) tile.type]) - return false; - int num1 = tile.blockType(); - switch (num1) - { - case 0: - return (double) pos.X >= (double) (tileCoordinates.X * 16) && (double) pos.X <= (double) (tileCoordinates.X * 16 + 16) && (double) pos.Y >= (double) (tileCoordinates.Y * 16) && (double) pos.Y <= (double) (tileCoordinates.Y * 16 + 16); - case 1: - return (double) pos.X >= (double) (tileCoordinates.X * 16) && (double) pos.X <= (double) (tileCoordinates.X * 16 + 16) && (double) pos.Y >= (double) (tileCoordinates.Y * 16 + 8) && (double) pos.Y <= (double) (tileCoordinates.Y * 16 + 16); - case 2: - case 3: - case 4: - case 5: - if ((double) pos.X < (double) (tileCoordinates.X * 16) && (double) pos.X > (double) (tileCoordinates.X * 16 + 16) && (double) pos.Y < (double) (tileCoordinates.Y * 16) && (double) pos.Y > (double) (tileCoordinates.Y * 16 + 16)) - return false; - float num2 = pos.X % 16f; - float num3 = pos.Y % 16f; - switch (num1) - { - case 2: - return (double) num3 >= (double) num2; - case 3: - return (double) num2 + (double) num3 >= 16.0; - case 4: - return (double) num2 + (double) num3 <= 16.0; - case 5: - return (double) num3 <= (double) num2; - } - break; - } - return false; - } - - public static bool GetWaterLine(Point pt, out float waterLineHeight) => Collision.GetWaterLine(pt.X, pt.Y, out waterLineHeight); - - public static bool GetWaterLine(int X, int Y, out float waterLineHeight) - { - waterLineHeight = 0.0f; - if (Main.tile[X, Y - 2] == null) - Main.tile[X, Y - 2] = new Tile(); - if (Main.tile[X, Y - 1] == null) - Main.tile[X, Y - 1] = new Tile(); - if (Main.tile[X, Y] == null) - Main.tile[X, Y] = new Tile(); - if (Main.tile[X, Y + 1] == null) - Main.tile[X, Y + 1] = new Tile(); - if (Main.tile[X, Y - 2].liquid > (byte) 0) - return false; - if (Main.tile[X, Y - 1].liquid > (byte) 0) - { - waterLineHeight = (float) (Y * 16); - waterLineHeight -= (float) ((int) Main.tile[X, Y - 1].liquid / 16); - return true; - } - if (Main.tile[X, Y].liquid > (byte) 0) - { - waterLineHeight = (float) ((Y + 1) * 16); - waterLineHeight -= (float) ((int) Main.tile[X, Y].liquid / 16); - return true; - } - if (Main.tile[X, Y + 1].liquid <= (byte) 0) - return false; - waterLineHeight = (float) ((Y + 2) * 16); - waterLineHeight -= (float) ((int) Main.tile[X, Y + 1].liquid / 16); - return true; - } - - public static bool GetWaterLineIterate(Point pt, out float waterLineHeight) => Collision.GetWaterLineIterate(pt.X, pt.Y, out waterLineHeight); - - public static bool GetWaterLineIterate(int X, int Y, out float waterLineHeight) - { - waterLineHeight = 0.0f; - while (Y > 0 && Framing.GetTileSafely(X, Y).liquid > (byte) 0) - --Y; - ++Y; - if (Main.tile[X, Y] == null) - Main.tile[X, Y] = new Tile(); - if (Main.tile[X, Y].liquid <= (byte) 0) - return false; - waterLineHeight = (float) (Y * 16); - waterLineHeight -= (float) ((int) Main.tile[X, Y - 1].liquid / 16); - return true; - } - public static bool WetCollision(Vector2 Position, int Width, int Height) { Collision.honey = false; @@ -1312,14 +1212,29 @@ namespace Terraria if ((double) Position.X + (double) Width > (double) vector2_4.X && (double) Position.X < (double) vector2_4.X + 16.0 && (double) Position.Y + (double) Height > (double) vector2_4.Y && (double) Position.Y < (double) vector2_4.Y + (double) num9) { bool flag1 = true; + if (Main.tile[index1, index2].slope() > (byte) 0) + { + if (Main.tile[index1, index2].slope() > (byte) 2) + { + if (Main.tile[index1, index2].slope() == (byte) 3 && (double) vector2_1.Y + (double) Math.Abs(Velocity.X) + 1.0 >= (double) vector2_4.Y && (double) vector2_1.X >= (double) vector2_4.X) + flag1 = true; + if (Main.tile[index1, index2].slope() == (byte) 4 && (double) vector2_1.Y + (double) Math.Abs(Velocity.X) + 1.0 >= (double) vector2_4.Y && (double) vector2_1.X + (double) Width <= (double) vector2_4.X + 16.0) + flag1 = true; + } + else + { + if (Main.tile[index1, index2].slope() == (byte) 1 && (double) vector2_1.Y + (double) Height - (double) Math.Abs(Velocity.X) - 1.0 <= (double) vector2_4.Y + (double) num9 && (double) vector2_1.X >= (double) vector2_4.X) + flag1 = true; + if (Main.tile[index1, index2].slope() == (byte) 2 && (double) vector2_1.Y + (double) Height - (double) Math.Abs(Velocity.X) - 1.0 <= (double) vector2_4.Y + (double) num9 && (double) vector2_1.X + (double) Width <= (double) vector2_4.X + 16.0) + flag1 = true; + } + } if (TileID.Sets.Platforms[(int) Main.tile[index1, index2].type]) { if ((double) Velocity.Y < 0.0) flag1 = false; if ((double) Position.Y + (double) Height < (double) (index2 * 16) || (double) Position.Y + (double) Height - (1.0 + (double) Math.Abs(Velocity.X)) > (double) (index2 * 16 + 16)) flag1 = false; - if ((Main.tile[index1, index2].slope() == (byte) 1 && (double) Velocity.X >= 0.0 || Main.tile[index1, index2].slope() == (byte) 2 && (double) Velocity.X <= 0.0) && ((double) Position.Y + (double) Height) / 16.0 - 1.0 == (double) index2) - flag1 = false; } if (flag1) { @@ -1633,9 +1548,9 @@ namespace Terraria } else if ((double) vector2_4.X + (double) Width <= (double) vector2_5.X && !Main.tileSolidTop[(int) Main.tile[index1, index2].type]) { - if (index1 >= 1 && Main.tile[index1 - 1, index2] == null) + if (Main.tile[index1 - 1, index2] == null) Main.tile[index1 - 1, index2] = new Tile(); - if (index1 < 1 || Main.tile[index1 - 1, index2].slope() != (byte) 2 && Main.tile[index1 - 1, index2].slope() != (byte) 4) + if (Main.tile[index1 - 1, index2].slope() != (byte) 2 && Main.tile[index1 - 1, index2].slope() != (byte) 4) { num5 = index1; num6 = index2; @@ -2073,7 +1988,7 @@ label_19: { for (int j = num3; j < num4; ++j) { - if (Main.tile[i, j] != null && Main.tile[i, j].slope() == (byte) 0 && !Main.tile[i, j].inActive() && Main.tile[i, j].active() && (Main.tile[i, j].type == (ushort) 32 || Main.tile[i, j].type == (ushort) 37 || Main.tile[i, j].type == (ushort) 48 || Main.tile[i, j].type == (ushort) 232 || Main.tile[i, j].type == (ushort) 53 || Main.tile[i, j].type == (ushort) 57 || Main.tile[i, j].type == (ushort) 58 || Main.tile[i, j].type == (ushort) 69 || Main.tile[i, j].type == (ushort) 76 || Main.tile[i, j].type == (ushort) 112 || Main.tile[i, j].type == (ushort) 116 || Main.tile[i, j].type == (ushort) 123 || Main.tile[i, j].type == (ushort) 224 || Main.tile[i, j].type == (ushort) 234 || Main.tile[i, j].type == (ushort) 352 || Main.tile[i, j].type == (ushort) 484)) + if (Main.tile[i, j] != null && Main.tile[i, j].slope() == (byte) 0 && !Main.tile[i, j].inActive() && Main.tile[i, j].active() && (Main.tile[i, j].type == (ushort) 32 || Main.tile[i, j].type == (ushort) 37 || Main.tile[i, j].type == (ushort) 48 || Main.tile[i, j].type == (ushort) 232 || Main.tile[i, j].type == (ushort) 53 || Main.tile[i, j].type == (ushort) 57 || Main.tile[i, j].type == (ushort) 58 || Main.tile[i, j].type == (ushort) 69 || Main.tile[i, j].type == (ushort) 76 || Main.tile[i, j].type == (ushort) 112 || Main.tile[i, j].type == (ushort) 116 || Main.tile[i, j].type == (ushort) 123 || Main.tile[i, j].type == (ushort) 224 || Main.tile[i, j].type == (ushort) 234 || Main.tile[i, j].type == (ushort) 352)) { Vector2 vector2_2; vector2_2.X = (float) (i * 16); @@ -2131,11 +2046,9 @@ label_19: if (!fireImmune && (type == 37 || type == 58 || type == 76)) num5 = 20; if (type == 48) - num5 = 60; + num5 = 40; if (type == 232) - num5 = 80; - if (type == 484) - num5 = 25; + num5 = 60; return new Vector2((float) num11, (float) num5); } } @@ -2170,15 +2083,15 @@ label_19: if (Main.tile[index, j] != null) { int type = (int) Main.tile[index, j].type; - if (Main.tile[index, j].active() && (type == 135 || type == 210 || type == 443 || type == 442)) + if (Main.tile[index, j].active() && (type == 135 || type == 210 || type == 442)) { Vector2 vector2; vector2.X = (float) (index * 16); vector2.Y = (float) (j * 16 + 12); bool flag1 = false; - if (type == 442) + if (objType == 4) { - if (objType == 4) + if (type == 442) { float r1StartX = 0.0f; float r1StartY = 0.0f; @@ -2222,39 +2135,31 @@ label_19: } if (!flag1 && (double) Position.X + (double) Width > (double) vector2.X && (double) Position.X < (double) vector2.X + 16.0 && (double) Position.Y + (double) Height > (double) vector2.Y && (double) Position.Y < (double) vector2.Y + 4.01) { - if (type == 210) - WorldGen.ExplodeMine(index, j); - else if ((double) oldPosition.X + (double) Width <= (double) vector2.X || (double) oldPosition.X >= (double) vector2.X + 16.0 || (double) oldPosition.Y + (double) Height <= (double) vector2.Y || (double) oldPosition.Y >= (double) vector2.Y + 16.01) + switch (type) { - if (type == 443) - { - if (objType == 1) + case 210: + WorldGen.ExplodeMine(index, j); + continue; + case 442: + continue; + default: + if ((double) oldPosition.X + (double) Width <= (double) vector2.X || (double) oldPosition.X >= (double) vector2.X + 16.0 || (double) oldPosition.Y + (double) Height <= (double) vector2.Y || (double) oldPosition.Y >= (double) vector2.Y + 16.01) { - Wiring.HitSwitch(index, j); - NetMessage.SendData(59, number: index, number2: ((float) j)); - } - } - else - { - int num5 = (int) Main.tile[index, j].frameY / 18; - bool flag2 = true; - if ((num5 == 4 || num5 == 2 || num5 == 3 || num5 == 6 || num5 == 7) && objType != 1) - flag2 = false; - if (num5 == 5 && (objType == 1 || objType == 4)) - flag2 = false; - if (flag2) - { - Wiring.HitSwitch(index, j); - NetMessage.SendData(59, number: index, number2: ((float) j)); - if (num5 == 7) + int num5 = (int) Main.tile[index, j].frameY / 18; + bool flag2 = true; + if ((num5 == 4 || num5 == 2 || num5 == 3 || num5 == 6) && objType != 1) + flag2 = false; + if (num5 == 5 && (objType == 1 || objType == 4)) + flag2 = false; + if (flag2) { - WorldGen.KillTile(index, j); - if (Main.netMode == 1) - NetMessage.SendData(17, number2: ((float) index), number3: ((float) j)); + Wiring.HitSwitch(index, j); + NetMessage.SendData(59, number: index, number2: ((float) j)); + return true; } - return true; + continue; } - } + continue; } } } @@ -2361,8 +2266,6 @@ label_19: return Collision.SolidTiles(startX, endX, startY, endY); } - public static bool SolidTiles(Vector2 position, int width, int height) => Collision.SolidTiles((int) ((double) position.X / 16.0), (int) (((double) position.X + (double) width) / 16.0), (int) ((double) position.Y / 16.0), (int) (((double) position.Y + (double) height) / 16.0)); - public static bool SolidTiles(int startX, int endX, int startY, int endY) { if (startX < 0 || endX >= Main.maxTilesX || startY < 0 || endY >= Main.maxTilesY) @@ -2410,6 +2313,8 @@ label_19: Main.tile[x, y] = new Tile(); if (Main.tile[x, y - 1] == null) Main.tile[x, y - 1] = new Tile(); + if (Main.tile[x, y].topSlope()) + flag = true; if (waterWalk && Main.tile[x, y].liquid > (byte) 0 && Main.tile[x, y - 1].liquid == (byte) 0) { int num7 = (int) Main.tile[x, y].liquid / 32 * 2 + 2; @@ -2485,20 +2390,19 @@ label_19: bool flag5 = true; bool flag6 = true; bool flag7; - Tile tile2; bool flag8; if (gravDir == 1) { if (Main.tile[x, index1 - gravDir] == null || Main.tile[x, index1 - (num2 + 1) * gravDir] == null) return; - Tile tile3 = Main.tile[x, index1 - gravDir]; - Tile tile4 = Main.tile[x, index1 - (num2 + 1) * gravDir]; - flag7 = flag4 && (!tile3.nactive() || !Main.tileSolid[(int) tile3.type] || Main.tileSolidTop[(int) tile3.type] || tile3.slope() == (byte) 1 && (double) position.X + (double) (width / 2) > (double) (x * 16) || tile3.slope() == (byte) 2 && (double) position.X + (double) (width / 2) < (double) (x * 16 + 16) || tile3.halfBrick() && (!tile4.nactive() || !Main.tileSolid[(int) tile4.type] || Main.tileSolidTop[(int) tile4.type])); - Tile tile5 = Main.tile[x, index1]; - tile2 = Main.tile[x, index1 - 1]; + Tile tile2 = Main.tile[x, index1 - gravDir]; + Tile tile3 = Main.tile[x, index1 - (num2 + 1) * gravDir]; + flag7 = flag4 && (!tile2.nactive() || !Main.tileSolid[(int) tile2.type] || Main.tileSolidTop[(int) tile2.type] || tile2.slope() == (byte) 1 && (double) position.X + (double) (width / 2) > (double) (x * 16) || tile2.slope() == (byte) 2 && (double) position.X + (double) (width / 2) < (double) (x * 16 + 16) || tile2.halfBrick() && (!tile3.nactive() || !Main.tileSolid[(int) tile3.type] || Main.tileSolidTop[(int) tile3.type])); + Tile tile4 = Main.tile[x, index1]; + Tile tile5 = Main.tile[x, index1 - 1]; if (specialChecksMode == 1) - flag6 = tile5.type != (ushort) 16 && tile5.type != (ushort) 18 && tile5.type != (ushort) 14 && tile5.type != (ushort) 469 && tile5.type != (ushort) 134; - flag8 = ((!flag5 ? (false ? 1 : 0) : (!tile5.nactive() || tile5.topSlope() && (tile5.slope() != (byte) 1 || (double) position.X + (double) (width / 2) >= (double) (x * 16)) && (tile5.slope() != (byte) 2 || (double) position.X + (double) (width / 2) <= (double) (x * 16 + 16)) || tile5.topSlope() && (double) position.Y + (double) height <= (double) (index1 * 16) || (!Main.tileSolid[(int) tile5.type] || Main.tileSolidTop[(int) tile5.type]) && ((!holdsMatching || (!Main.tileSolidTop[(int) tile5.type] || tile5.frameY != (short) 0) && !TileID.Sets.Platforms[(int) tile5.type] ? 0 : (!Main.tileSolid[(int) tile2.type] ? 1 : (!tile2.nactive() ? 1 : 0))) & (flag6 ? 1 : 0)) == 0 ? (!tile2.halfBrick() ? (false ? 1 : 0) : (tile2.nactive() ? 1 : 0)) : (true ? 1 : 0))) & (!Main.tileSolidTop[(int) tile5.type] ? 1 : (!Main.tileSolidTop[(int) tile2.type] ? 1 : 0))) != 0; + flag6 = tile4.type != (ushort) 16 && tile4.type != (ushort) 18 && tile4.type != (ushort) 134; + flag8 = ((!flag5 ? (false ? 1 : 0) : (!tile4.nactive() || tile4.topSlope() && (tile4.slope() != (byte) 1 || (double) position.X + (double) (width / 2) >= (double) (x * 16)) && (tile4.slope() != (byte) 2 || (double) position.X + (double) (width / 2) <= (double) (x * 16 + 16)) || tile4.topSlope() && (double) position.Y + (double) height <= (double) (index1 * 16) || (!Main.tileSolid[(int) tile4.type] || Main.tileSolidTop[(int) tile4.type]) && ((!holdsMatching || (!Main.tileSolidTop[(int) tile4.type] || tile4.frameY != (short) 0) && !TileID.Sets.Platforms[(int) tile4.type] ? 0 : (!Main.tileSolid[(int) tile5.type] ? 1 : (!tile5.nactive() ? 1 : 0))) & (flag6 ? 1 : 0)) == 0 ? (!tile5.halfBrick() ? (false ? 1 : 0) : (tile5.nactive() ? 1 : 0)) : (true ? 1 : 0))) & (!Main.tileSolidTop[(int) tile4.type] ? 1 : (!Main.tileSolidTop[(int) tile5.type] ? 1 : 0))) != 0; } else { @@ -2506,8 +2410,8 @@ label_19: Tile tile7 = Main.tile[x, index1 - (num2 + 1) * gravDir]; flag7 = flag4 && (!tile6.nactive() || !Main.tileSolid[(int) tile6.type] || Main.tileSolidTop[(int) tile6.type] || tile6.slope() != (byte) 0 || tile6.halfBrick() && (!tile7.nactive() || !Main.tileSolid[(int) tile7.type] || Main.tileSolidTop[(int) tile7.type])); Tile tile8 = Main.tile[x, index1]; - tile2 = Main.tile[x, index1 + 1]; - flag8 = flag5 && (tile8.nactive() && (Main.tileSolid[(int) tile8.type] && !Main.tileSolidTop[(int) tile8.type] || holdsMatching && Main.tileSolidTop[(int) tile8.type] && tile8.frameY == (short) 0 && (!Main.tileSolid[(int) tile2.type] || !tile2.nactive())) || tile2.halfBrick() && tile2.nactive()); + Tile tile9 = Main.tile[x, index1 + 1]; + flag8 = flag5 && (tile8.nactive() && (Main.tileSolid[(int) tile8.type] && !Main.tileSolidTop[(int) tile8.type] || holdsMatching && Main.tileSolidTop[(int) tile8.type] && tile8.frameY == (short) 0 && (!Main.tileSolid[(int) tile9.type] || !tile9.nactive())) || tile9.halfBrick() && tile9.nactive()); } if ((double) (x * 16) >= (double) vector2.X + (double) width || (double) (x * 16 + 16) <= (double) vector2.X) return; @@ -2534,7 +2438,7 @@ label_19: } else { - if (!(flag8 & flag7 & flag1 & flag3) || Main.tile[x, index1].bottomSlope() || TileID.Sets.Platforms[(int) tile2.type]) + if (!(flag8 & flag7 & flag1 & flag3) || Main.tile[x, index1].bottomSlope()) return; float num5 = (float) (index1 * 16 + 16); if ((double) num5 <= (double) vector2.Y) @@ -2636,12 +2540,12 @@ label_19: ++x2; if (y2 % 16 == 0) ++y2; - int num3 = x2 / 16 - x1 / 16; + int num3 = x2 / 16 - x1 / 16 + 1; int num4 = y2 / 16 - y1 / 16; List pointList = new List(); int x3 = x1 / 16; int y3 = y1 / 16; - for (int x4 = x3; x4 <= x3 + num3; ++x4) + for (int x4 = x3; x4 < x3 + num3; ++x4) { if (up) pointList.Add(new Point(x4, y3)); @@ -2660,19 +2564,17 @@ label_19: public static void StepConveyorBelt(Entity entity, float gravDir) { - Player player = (Player) null; if (entity is Player) { - player = (Player) entity; + Player player = (Player) entity; if ((double) Math.Abs(player.gfxOffY) > 2.0 || player.grapCount > 0 || player.pulley) return; - entity.height -= 5; - entity.position.Y += 5f; } int num1 = 0; int num2 = 0; bool flag = false; - int num3 = (int) entity.position.Y + entity.height; + int y = (int) entity.position.Y; + int height = entity.height; entity.Hitbox.Inflate(2, 2); Vector2 topLeft = entity.TopLeft; Vector2 topRight = entity.TopRight; @@ -2682,71 +2584,63 @@ label_19: Vector2 vector2_1 = new Vector2(0.0001f); foreach (Point point in entityEdgeTiles) { - if (WorldGen.InWorld(point.X, point.Y) && (player == null || !player.onTrack || point.Y >= num3)) + Tile tile = Main.tile[point.X, point.Y]; + if (tile != null && tile.active() && tile.nactive()) { - Tile tile = Main.tile[point.X, point.Y]; - if (tile != null && tile.active() && tile.nactive()) + int num3 = TileID.Sets.ConveyorDirection[(int) tile.type]; + if (num3 != 0) { - int num4 = TileID.Sets.ConveyorDirection[(int) tile.type]; + Vector2 lineStart1; + Vector2 lineStart2; + lineStart1.X = lineStart2.X = (float) (point.X * 16); + Vector2 lineEnd1; + Vector2 lineEnd2; + lineEnd1.X = lineEnd2.X = (float) (point.X * 16 + 16); + switch (tile.slope()) + { + case 1: + lineStart2.Y = (float) (point.Y * 16); + lineEnd2.Y = lineEnd1.Y = lineStart1.Y = (float) (point.Y * 16 + 16); + break; + case 2: + lineEnd2.Y = (float) (point.Y * 16); + lineStart2.Y = lineEnd1.Y = lineStart1.Y = (float) (point.Y * 16 + 16); + break; + case 3: + lineEnd1.Y = lineStart2.Y = lineEnd2.Y = (float) (point.Y * 16); + lineStart1.Y = (float) (point.Y * 16 + 16); + break; + case 4: + lineStart1.Y = lineStart2.Y = lineEnd2.Y = (float) (point.Y * 16); + lineEnd1.Y = (float) (point.Y * 16 + 16); + break; + default: + lineStart2.Y = !tile.halfBrick() ? (lineEnd2.Y = (float) (point.Y * 16)) : (lineEnd2.Y = (float) (point.Y * 16 + 8)); + lineStart1.Y = lineEnd1.Y = (float) (point.Y * 16 + 16); + break; + } + int num4 = 0; + if (!TileID.Sets.Platforms[(int) tile.type] && Collision.CheckAABBvLineCollision2(entity.position - vector2_1, entity.Size + vector2_1 * 2f, lineStart1, lineEnd1)) + --num4; + if (Collision.CheckAABBvLineCollision2(entity.position - vector2_1, entity.Size + vector2_1 * 2f, lineStart2, lineEnd2)) + ++num4; if (num4 != 0) { - Vector2 lineStart1; - Vector2 lineStart2; - lineStart1.X = lineStart2.X = (float) (point.X * 16); - Vector2 lineEnd1; - Vector2 lineEnd2; - lineEnd1.X = lineEnd2.X = (float) (point.X * 16 + 16); - switch (tile.slope()) - { - case 1: - lineStart2.Y = (float) (point.Y * 16); - lineEnd2.Y = lineEnd1.Y = lineStart1.Y = (float) (point.Y * 16 + 16); - break; - case 2: - lineEnd2.Y = (float) (point.Y * 16); - lineStart2.Y = lineEnd1.Y = lineStart1.Y = (float) (point.Y * 16 + 16); - break; - case 3: - lineEnd1.Y = lineStart2.Y = lineEnd2.Y = (float) (point.Y * 16); - lineStart1.Y = (float) (point.Y * 16 + 16); - break; - case 4: - lineStart1.Y = lineStart2.Y = lineEnd2.Y = (float) (point.Y * 16); - lineEnd1.Y = (float) (point.Y * 16 + 16); - break; - default: - lineStart2.Y = !tile.halfBrick() ? (lineEnd2.Y = (float) (point.Y * 16)) : (lineEnd2.Y = (float) (point.Y * 16 + 8)); - lineStart1.Y = lineEnd1.Y = (float) (point.Y * 16 + 16); - break; - } - int num5 = 0; - if (!TileID.Sets.Platforms[(int) tile.type] && Collision.CheckAABBvLineCollision2(entity.position - vector2_1, entity.Size + vector2_1 * 2f, lineStart1, lineEnd1)) - --num5; - if (Collision.CheckAABBvLineCollision2(entity.position - vector2_1, entity.Size + vector2_1 * 2f, lineStart2, lineEnd2)) - ++num5; - if (num5 != 0) - { - flag = true; - num1 += num4 * num5 * (int) gravDir; - if (tile.leftSlope()) - num2 += (int) gravDir * -num4; - if (tile.rightSlope()) - num2 -= (int) gravDir * -num4; - } + flag = true; + num1 += num3 * num4 * (int) gravDir; + if (tile.leftSlope()) + num2 += (int) gravDir * -num3; + if (tile.rightSlope()) + num2 -= (int) gravDir * -num3; } } } } - if (entity is Player) - { - entity.height += 5; - entity.position.Y -= 5f; - } if (!flag || num1 == 0) return; - int num6 = Math.Sign(num1); - int num7 = Math.Sign(num2); - Vector2 Velocity = Vector2.Normalize(new Vector2((float) num6 * gravDir, (float) num7)) * 2.5f; + int num5 = Math.Sign(num1); + int num6 = Math.Sign(num2); + Vector2 Velocity = Vector2.Normalize(new Vector2((float) num5 * gravDir, (float) num6)) * 2.5f; Vector2 vector2_2 = Collision.TileCollision(entity.position, Velocity, entity.width, entity.height, gravDir: ((int) gravDir)); entity.position += vector2_2; Velocity = new Vector2(0.0f, 2.5f * gravDir); @@ -2960,18 +2854,5 @@ label_19: samples[index] = num2; } } - - public static void AimingLaserScan( - Vector2 startPoint, - Vector2 endPoint, - float samplingWidth, - int samplesToTake, - out Vector2 vectorTowardsTarget, - out float[] samples) - { - samples = new float[samplesToTake]; - vectorTowardsTarget = endPoint - startPoint; - Collision.LaserScan(startPoint, vectorTowardsTarget.SafeNormalize(Vector2.Zero), samplingWidth, vectorTowardsTarget.Length(), samples); - } } } diff --git a/CombatText.cs b/CombatText.cs index 2d982e7..9ef8599 100644 --- a/CombatText.cs +++ b/CombatText.cs @@ -1,11 +1,10 @@ // Decompiled with JetBrains decompiler // Type: Terraria.CombatText -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; -using Terraria.GameContent; namespace Terraria { @@ -25,7 +24,7 @@ namespace Terraria public Vector2 velocity; public float alpha; public int alphaDir = 1; - public string text = ""; + public string text; public float scale = 1f; public float rotation; public Color color; @@ -60,7 +59,7 @@ namespace Terraria int index2 = 0; if (dramatic) index2 = 1; - Vector2 vector2 = FontAssets.CombatText[index2].Value.MeasureString(text); + Vector2 vector2 = Main.fontCombatText[index2].MeasureString(text); Main.combatText[index1].alpha = 1f; Main.combatText[index1].alphaDir = -1; Main.combatText[index1].active = true; @@ -108,7 +107,7 @@ namespace Terraria Main.combatText[index].active = false; } - public static float TargetScale => 1f; + public static float TargetScale => Main.UIScale / (Main.GameViewMatrix.Zoom.X / Main.ForcedMinimumZoom); public void Update() { diff --git a/DataStructures/AnchorData.cs b/DataStructures/AnchorData.cs index 4184cb2..762a3f6 100644 --- a/DataStructures/AnchorData.cs +++ b/DataStructures/AnchorData.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.DataStructures.AnchorData -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Terraria.Enums; diff --git a/DataStructures/AnchoredEntitiesCollection.cs b/DataStructures/AnchoredEntitiesCollection.cs deleted file mode 100644 index 4b345f4..0000000 --- a/DataStructures/AnchoredEntitiesCollection.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.AnchoredEntitiesCollection -// 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; -using System.Collections.Generic; - -namespace Terraria.DataStructures -{ - public class AnchoredEntitiesCollection - { - private List _anchoredNPCs; - private List _anchoredPlayers; - - public int AnchoredPlayersAmount => this._anchoredPlayers.Count; - - public AnchoredEntitiesCollection() - { - this._anchoredNPCs = new List(); - this._anchoredPlayers = new List(); - } - - public void ClearNPCAnchors() => this._anchoredNPCs.Clear(); - - public void ClearPlayerAnchors() => this._anchoredPlayers.Clear(); - - public void AddNPC(int npcIndex, Point coords) => this._anchoredNPCs.Add(new AnchoredEntitiesCollection.IndexPointPair() - { - index = npcIndex, - coords = coords - }); - - public int GetNextPlayerStackIndexInCoords(Point coords) => this.GetEntitiesInCoords(coords); - - public void AddPlayerAndGetItsStackedIndexInCoords( - int playerIndex, - Point coords, - out int stackedIndexInCoords) - { - stackedIndexInCoords = this.GetEntitiesInCoords(coords); - this._anchoredPlayers.Add(new AnchoredEntitiesCollection.IndexPointPair() - { - index = playerIndex, - coords = coords - }); - } - - private int GetEntitiesInCoords(Point coords) - { - int num = 0; - for (int index = 0; index < this._anchoredNPCs.Count; ++index) - { - if (this._anchoredNPCs[index].coords == coords) - ++num; - } - for (int index = 0; index < this._anchoredPlayers.Count; ++index) - { - if (this._anchoredPlayers[index].coords == coords) - ++num; - } - return num; - } - - private struct IndexPointPair - { - public int index; - public Point coords; - } - } -} diff --git a/DataStructures/BinaryWriterHelper.cs b/DataStructures/BinaryWriterHelper.cs deleted file mode 100644 index c4e5806..0000000 --- a/DataStructures/BinaryWriterHelper.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.BinaryWriterHelper -// 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.IO; - -namespace Terraria.DataStructures -{ - public struct BinaryWriterHelper - { - private long _placeInWriter; - - public void ReservePointToFillLengthLaterByFilling6Bytes(BinaryWriter writer) - { - this._placeInWriter = writer.BaseStream.Position; - writer.Write(0U); - writer.Write((ushort) 0); - } - - public void FillReservedPoint(BinaryWriter writer, ushort dataId) - { - long position = writer.BaseStream.Position; - writer.BaseStream.Position = this._placeInWriter; - long num = position - this._placeInWriter - 4L; - writer.Write((int) num); - writer.Write(dataId); - writer.BaseStream.Position = position; - } - - public void FillOnlyIfThereIsLengthOrRevertToSavedPosition( - BinaryWriter writer, - ushort dataId, - out bool wroteSomething) - { - wroteSomething = false; - long position = writer.BaseStream.Position; - writer.BaseStream.Position = this._placeInWriter; - long num = position - this._placeInWriter - 4L; - if (num == 0L) - return; - writer.Write((int) num); - writer.Write(dataId); - writer.BaseStream.Position = position; - wroteSomething = true; - } - } -} diff --git a/DataStructures/BufferPool.cs b/DataStructures/BufferPool.cs index 0a006f1..eb9ed07 100644 --- a/DataStructures/BufferPool.cs +++ b/DataStructures/BufferPool.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.DataStructures.BufferPool -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; diff --git a/DataStructures/CachedBuffer.cs b/DataStructures/CachedBuffer.cs index d8ee78a..5338912 100644 --- a/DataStructures/CachedBuffer.cs +++ b/DataStructures/CachedBuffer.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.DataStructures.CachedBuffer -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System.IO; diff --git a/DataStructures/ColorSlidersSet.cs b/DataStructures/ColorSlidersSet.cs index 96c2317..67550e3 100644 --- a/DataStructures/ColorSlidersSet.cs +++ b/DataStructures/ColorSlidersSet.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.DataStructures.ColorSlidersSet -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/DataStructures/CompositePlayerDrawContext.cs b/DataStructures/CompositePlayerDrawContext.cs deleted file mode 100644 index 19ded4d..0000000 --- a/DataStructures/CompositePlayerDrawContext.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.CompositePlayerDrawContext -// 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.DataStructures -{ - public enum CompositePlayerDrawContext - { - BackShoulder, - BackArm, - Torso, - FrontArm, - FrontShoulder, - FrontArmAccessory, - BackArmAccessory, - } -} diff --git a/DataStructures/DoubleStack`1.cs b/DataStructures/DoubleStack`1.cs index eb19075..2719f94 100644 --- a/DataStructures/DoubleStack`1.cs +++ b/DataStructures/DoubleStack`1.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.DataStructures.DoubleStack`1 -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; diff --git a/DataStructures/DrawAnimation.cs b/DataStructures/DrawAnimation.cs index cd97dbe..16c23cc 100644 --- a/DataStructures/DrawAnimation.cs +++ b/DataStructures/DrawAnimation.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.DataStructures.DrawAnimation -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -20,6 +20,6 @@ namespace Terraria.DataStructures { } - public virtual Rectangle GetFrame(Texture2D texture, int frameCounterOverride = -1) => texture.Frame(); + public virtual Rectangle GetFrame(Texture2D texture) => texture.Frame(); } } diff --git a/DataStructures/DrawAnimationVertical.cs b/DataStructures/DrawAnimationVertical.cs index fbfbfd9..d70f67b 100644 --- a/DataStructures/DrawAnimationVertical.cs +++ b/DataStructures/DrawAnimationVertical.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.DataStructures.DrawAnimationVertical -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -11,61 +11,24 @@ namespace Terraria.DataStructures { public class DrawAnimationVertical : DrawAnimation { - public bool PingPong; - public bool NotActuallyAnimating; - - public DrawAnimationVertical(int ticksperframe, int frameCount, bool pingPong = false) + public DrawAnimationVertical(int ticksperframe, int frameCount) { this.Frame = 0; this.FrameCounter = 0; this.FrameCount = frameCount; this.TicksPerFrame = ticksperframe; - this.PingPong = pingPong; } public override void Update() { - if (this.NotActuallyAnimating) - return; if (++this.FrameCounter < this.TicksPerFrame) return; this.FrameCounter = 0; - if (this.PingPong) - { - if (++this.Frame < this.FrameCount * 2 - 2) - return; - this.Frame = 0; - } - else - { - if (++this.Frame < this.FrameCount) - return; - this.Frame = 0; - } + if (++this.Frame < this.FrameCount) + return; + this.Frame = 0; } - public override Rectangle GetFrame(Texture2D texture, int frameCounterOverride = -1) - { - if (frameCounterOverride != -1) - { - int num1 = frameCounterOverride / this.TicksPerFrame; - int num2 = this.FrameCount; - if (this.PingPong) - num2 = num2 * 2 - 1; - int num3 = num2; - int frameY = num1 % num3; - if (this.PingPong && frameY >= this.FrameCount) - frameY = this.FrameCount * 2 - 2 - frameY; - Rectangle rectangle = texture.Frame(verticalFrames: this.FrameCount, frameY: frameY); - rectangle.Height -= 2; - return rectangle; - } - int frameY1 = this.Frame; - if (this.PingPong && this.Frame >= this.FrameCount) - frameY1 = this.FrameCount * 2 - 2 - this.Frame; - Rectangle rectangle1 = texture.Frame(verticalFrames: this.FrameCount, frameY: frameY1); - rectangle1.Height -= 2; - return rectangle1; - } + public override Rectangle GetFrame(Texture2D texture) => texture.Frame(verticalFrames: this.FrameCount, frameY: this.Frame); } } diff --git a/DataStructures/DrawData.cs b/DataStructures/DrawData.cs index 271c50b..d78bb84 100644 --- a/DataStructures/DrawData.cs +++ b/DataStructures/DrawData.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.DataStructures.DrawData -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/DataStructures/DrillDebugDraw.cs b/DataStructures/DrillDebugDraw.cs index f673de0..ee27ea2 100644 --- a/DataStructures/DrillDebugDraw.cs +++ b/DataStructures/DrillDebugDraw.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.DataStructures.DrillDebugDraw -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/DataStructures/EntityShadowInfo.cs b/DataStructures/EntityShadowInfo.cs deleted file mode 100644 index dd7a808..0000000 --- a/DataStructures/EntityShadowInfo.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.EntityShadowInfo -// 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.DataStructures -{ - public struct EntityShadowInfo - { - public Vector2 Position; - public float Rotation; - public Vector2 Origin; - public int Direction; - public int GravityDirection; - public int BodyFrameIndex; - - public void CopyPlayer(Player player) - { - this.Position = player.position; - this.Rotation = player.fullRotation; - this.Origin = player.fullRotationOrigin; - this.Direction = player.direction; - this.GravityDirection = (int) player.gravDir; - this.BodyFrameIndex = player.bodyFrame.Y / player.bodyFrame.Height; - } - - public Vector2 HeadgearOffset => Main.OffsetsPlayerHeadgear[this.BodyFrameIndex]; - } -} diff --git a/DataStructures/EntryFilterer`2.cs b/DataStructures/EntryFilterer`2.cs deleted file mode 100644 index 270cefb..0000000 --- a/DataStructures/EntryFilterer`2.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.EntryFilterer`2 -// 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.Collections.Generic; -using Terraria.Localization; - -namespace Terraria.DataStructures -{ - public class EntryFilterer - where T : new() - where U : IEntryFilter - { - public List AvailableFilters; - public List ActiveFilters; - public List AlwaysActiveFilters; - private ISearchFilter _searchFilter; - private ISearchFilter _searchFilterFromConstructor; - - public EntryFilterer() - { - this.AvailableFilters = new List(); - this.ActiveFilters = new List(); - this.AlwaysActiveFilters = new List(); - } - - public void AddFilters(List filters) => this.AvailableFilters.AddRange((IEnumerable) filters); - - public bool FitsFilter(T entry) - { - if (this._searchFilter != null && !this._searchFilter.FitsFilter(entry)) - return false; - for (int index = 0; index < this.AlwaysActiveFilters.Count; ++index) - { - if (!this.AlwaysActiveFilters[index].FitsFilter(entry)) - return false; - } - if (this.ActiveFilters.Count == 0) - return true; - for (int index = 0; index < this.ActiveFilters.Count; ++index) - { - if (this.ActiveFilters[index].FitsFilter(entry)) - return true; - } - return false; - } - - public void ToggleFilter(int filterIndex) - { - U availableFilter = this.AvailableFilters[filterIndex]; - if (this.ActiveFilters.Contains(availableFilter)) - this.ActiveFilters.Remove(availableFilter); - else - this.ActiveFilters.Add(availableFilter); - } - - public bool IsFilterActive(int filterIndex) => this.AvailableFilters.IndexInRange(filterIndex) && this.ActiveFilters.Contains(this.AvailableFilters[filterIndex]); - - public void SetSearchFilterObject(Z searchFilter) where Z : ISearchFilter, U => this._searchFilterFromConstructor = (ISearchFilter) searchFilter; - - public void SetSearchFilter(string searchFilter) - { - if (string.IsNullOrWhiteSpace(searchFilter)) - { - this._searchFilter = (ISearchFilter) null; - } - else - { - this._searchFilter = this._searchFilterFromConstructor; - this._searchFilter.SetSearch(searchFilter); - } - } - - public string GetDisplayName() => Language.GetTextValueWith("BestiaryInfo.Filters", (object) new - { - Count = this.ActiveFilters.Count - }); - } -} diff --git a/DataStructures/EntrySorter`2.cs b/DataStructures/EntrySorter`2.cs deleted file mode 100644 index 873ec4f..0000000 --- a/DataStructures/EntrySorter`2.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.EntrySorter`2 -// 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.Collections.Generic; -using Terraria.Localization; - -namespace Terraria.DataStructures -{ - public class EntrySorter : IComparer - where TEntryType : new() - where TStepType : IEntrySortStep - { - public List Steps = new List(); - private int _prioritizedStep; - - public void AddSortSteps(List sortSteps) => this.Steps.AddRange((IEnumerable) sortSteps); - - public int Compare(TEntryType x, TEntryType y) - { - int num = 0; - if (this._prioritizedStep != -1) - { - num = this.Steps[this._prioritizedStep].Compare(x, y); - if (num != 0) - return num; - } - for (int index = 0; index < this.Steps.Count; ++index) - { - if (index != this._prioritizedStep) - { - num = this.Steps[index].Compare(x, y); - if (num != 0) - return num; - } - } - return num; - } - - public void SetPrioritizedStepIndex(int index) => this._prioritizedStep = index; - - public string GetDisplayName() => Language.GetTextValue(this.Steps[this._prioritizedStep].GetDisplayNameKey()); - } -} diff --git a/DataStructures/FishingAttempt.cs b/DataStructures/FishingAttempt.cs deleted file mode 100644 index 917122b..0000000 --- a/DataStructures/FishingAttempt.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.FishingAttempt -// 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.DataStructures -{ - public struct FishingAttempt - { - public PlayerFishingConditions playerFishingConditions; - public int X; - public int Y; - public int bobberType; - public bool common; - public bool uncommon; - public bool rare; - public bool veryrare; - public bool legendary; - public bool crate; - public bool inLava; - public bool inHoney; - public int waterTilesCount; - public int waterNeededToFish; - public float waterQuality; - public int chumsInWater; - public int fishingLevel; - public bool CanFishInLava; - public float atmo; - public int questFish; - public int heightLevel; - public int rolledItemDrop; - public int rolledEnemySpawn; - } -} diff --git a/DataStructures/FlowerPacketInfo.cs b/DataStructures/FlowerPacketInfo.cs deleted file mode 100644 index 746efc4..0000000 --- a/DataStructures/FlowerPacketInfo.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.FlowerPacketInfo -// 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.Collections.Generic; - -namespace Terraria.DataStructures -{ - public class FlowerPacketInfo - { - public List stylesOnPurity = new List(); - public List stylesOnCorruption = new List(); - public List stylesOnCrimson = new List(); - public List stylesOnHallow = new List(); - } -} diff --git a/DataStructures/GameModeData.cs b/DataStructures/GameModeData.cs deleted file mode 100644 index beadb85..0000000 --- a/DataStructures/GameModeData.cs +++ /dev/null @@ -1,82 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.GameModeData -// 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.DataStructures -{ - public class GameModeData - { - public static readonly GameModeData NormalMode = new GameModeData() - { - Id = 0, - EnemyMaxLifeMultiplier = 1f, - EnemyDamageMultiplier = 1f, - DebuffTimeMultiplier = 1f, - KnockbackToEnemiesMultiplier = 1f, - TownNPCDamageMultiplier = 1f, - EnemyDefenseMultiplier = 1f, - EnemyMoneyDropMultiplier = 1f - }; - public static readonly GameModeData ExpertMode = new GameModeData() - { - Id = 1, - IsExpertMode = true, - EnemyMaxLifeMultiplier = 2f, - EnemyDamageMultiplier = 2f, - DebuffTimeMultiplier = 2f, - KnockbackToEnemiesMultiplier = 0.9f, - TownNPCDamageMultiplier = 1.5f, - EnemyDefenseMultiplier = 1f, - EnemyMoneyDropMultiplier = 2.5f - }; - public static readonly GameModeData MasterMode = new GameModeData() - { - Id = 2, - IsExpertMode = true, - IsMasterMode = true, - EnemyMaxLifeMultiplier = 3f, - EnemyDamageMultiplier = 3f, - DebuffTimeMultiplier = 2.5f, - KnockbackToEnemiesMultiplier = 0.8f, - TownNPCDamageMultiplier = 1.75f, - EnemyDefenseMultiplier = 1f, - EnemyMoneyDropMultiplier = 2.5f - }; - public static readonly GameModeData CreativeMode = new GameModeData() - { - Id = 3, - IsJourneyMode = true, - EnemyMaxLifeMultiplier = 1f, - EnemyDamageMultiplier = 1f, - DebuffTimeMultiplier = 1f, - KnockbackToEnemiesMultiplier = 1f, - TownNPCDamageMultiplier = 2f, - EnemyDefenseMultiplier = 1f, - EnemyMoneyDropMultiplier = 1f - }; - - public int Id { get; private set; } - - public bool IsExpertMode { get; private set; } - - public bool IsMasterMode { get; private set; } - - public bool IsJourneyMode { get; private set; } - - public float EnemyMaxLifeMultiplier { get; private set; } - - public float EnemyDamageMultiplier { get; private set; } - - public float DebuffTimeMultiplier { get; private set; } - - public float KnockbackToEnemiesMultiplier { get; private set; } - - public float TownNPCDamageMultiplier { get; private set; } - - public float EnemyDefenseMultiplier { get; private set; } - - public float EnemyMoneyDropMultiplier { get; private set; } - } -} diff --git a/DataStructures/IEntryFilter`1.cs b/DataStructures/IEntryFilter`1.cs deleted file mode 100644 index 1e734ac..0000000 --- a/DataStructures/IEntryFilter`1.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.IEntryFilter`1 -// 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 Terraria.UI; - -namespace Terraria.DataStructures -{ - public interface IEntryFilter - { - bool FitsFilter(T entry); - - string GetDisplayNameKey(); - - UIElement GetImage(); - } -} diff --git a/DataStructures/IEntrySortStep`1.cs b/DataStructures/IEntrySortStep`1.cs deleted file mode 100644 index 558ecc9..0000000 --- a/DataStructures/IEntrySortStep`1.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.IEntrySortStep`1 -// 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.Collections.Generic; - -namespace Terraria.DataStructures -{ - public interface IEntrySortStep : IComparer - { - string GetDisplayNameKey(); - } -} diff --git a/DataStructures/ISearchFilter`1.cs b/DataStructures/ISearchFilter`1.cs deleted file mode 100644 index ae69fce..0000000 --- a/DataStructures/ISearchFilter`1.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.ISearchFilter`1 -// 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.DataStructures -{ - public interface ISearchFilter : IEntryFilter - { - void SetSearch(string searchText); - } -} diff --git a/DataStructures/ItemSyncPersistentStats.cs b/DataStructures/ItemSyncPersistentStats.cs deleted file mode 100644 index b6e4306..0000000 --- a/DataStructures/ItemSyncPersistentStats.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.ItemSyncPersistentStats -// 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.DataStructures -{ - public struct ItemSyncPersistentStats - { - private Color color; - private int type; - - public void CopyFrom(Item item) - { - this.type = item.type; - this.color = item.color; - } - - public void PasteInto(Item item) - { - if (this.type != item.type) - return; - item.color = this.color; - } - } -} diff --git a/DataStructures/LineSegment.cs b/DataStructures/LineSegment.cs deleted file mode 100644 index 670e903..0000000 --- a/DataStructures/LineSegment.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.LineSegment -// 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.DataStructures -{ - public struct LineSegment - { - public Vector2 Start; - public Vector2 End; - - public LineSegment(Vector2 start, Vector2 end) - { - this.Start = start; - this.End = end; - } - } -} diff --git a/DataStructures/MethodSequenceListItem.cs b/DataStructures/MethodSequenceListItem.cs index d583e98..368ef32 100644 --- a/DataStructures/MethodSequenceListItem.cs +++ b/DataStructures/MethodSequenceListItem.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.DataStructures.MethodSequenceListItem -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; diff --git a/DataStructures/NPCAimedTarget.cs b/DataStructures/NPCAimedTarget.cs index 651a161..1403316 100644 --- a/DataStructures/NPCAimedTarget.cs +++ b/DataStructures/NPCAimedTarget.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.DataStructures.NPCAimedTarget -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/DataStructures/NPCStrengthHelper.cs b/DataStructures/NPCStrengthHelper.cs deleted file mode 100644 index 504eac1..0000000 --- a/DataStructures/NPCStrengthHelper.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.NPCStrengthHelper -// 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.DataStructures -{ - public struct NPCStrengthHelper - { - private float _strength; - private GameModeData _gameModeData; - - public bool IsExpertMode => (double) this._strength >= 2.0 || this._gameModeData.IsExpertMode; - - public bool IsMasterMode => (double) this._strength >= 3.0 || this._gameModeData.IsMasterMode; - - public NPCStrengthHelper(GameModeData data, float strength) - { - this._strength = strength; - this._gameModeData = data; - } - } -} diff --git a/DataStructures/PlacementHook.cs b/DataStructures/PlacementHook.cs index d2290ec..a413a45 100644 --- a/DataStructures/PlacementHook.cs +++ b/DataStructures/PlacementHook.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.DataStructures.PlacementHook -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; @@ -10,15 +10,15 @@ namespace Terraria.DataStructures { public struct PlacementHook { - public Func hook; + public Func hook; public int badReturn; public int badResponse; public bool processedCoordinates; - public static PlacementHook Empty = new PlacementHook((Func) null, 0, 0, false); + public static PlacementHook Empty = new PlacementHook((Func) null, 0, 0, false); public const int Response_AllInvalid = 0; public PlacementHook( - Func hook, + Func hook, int badReturn, int badResponse, bool processedCoordinates) diff --git a/DataStructures/PlayerDeathReason.cs b/DataStructures/PlayerDeathReason.cs index 99600e7..28bd4fc 100644 --- a/DataStructures/PlayerDeathReason.cs +++ b/DataStructures/PlayerDeathReason.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.DataStructures.PlayerDeathReason -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System.IO; @@ -11,47 +11,45 @@ namespace Terraria.DataStructures { public class PlayerDeathReason { - private int _sourcePlayerIndex = -1; - private int _sourceNPCIndex = -1; - private int _sourceProjectileIndex = -1; - private int _sourceOtherIndex = -1; - private int _sourceProjectileType; - private int _sourceItemType; - private int _sourceItemPrefix; - private string _sourceCustomReason; - - public int? SourceProjectileType => this._sourceProjectileIndex == -1 ? new int?() : new int?(this._sourceProjectileType); + private int SourcePlayerIndex = -1; + private int SourceNPCIndex = -1; + private int SourceProjectileIndex = -1; + private int SourceOtherIndex = -1; + private int SourceProjectileType; + private int SourceItemType; + private int SourceItemPrefix; + private string SourceCustomReason; public static PlayerDeathReason LegacyEmpty() => new PlayerDeathReason() { - _sourceOtherIndex = 254 + SourceOtherIndex = 254 }; public static PlayerDeathReason LegacyDefault() => new PlayerDeathReason() { - _sourceOtherIndex = (int) byte.MaxValue + SourceOtherIndex = (int) byte.MaxValue }; public static PlayerDeathReason ByNPC(int index) => new PlayerDeathReason() { - _sourceNPCIndex = index + SourceNPCIndex = index }; public static PlayerDeathReason ByCustomReason(string reasonInEnglish) => new PlayerDeathReason() { - _sourceCustomReason = reasonInEnglish + SourceCustomReason = reasonInEnglish }; public static PlayerDeathReason ByPlayer(int index) => new PlayerDeathReason() { - _sourcePlayerIndex = index, - _sourceItemType = Main.player[index].inventory[Main.player[index].selectedItem].type, - _sourceItemPrefix = (int) Main.player[index].inventory[Main.player[index].selectedItem].prefix + SourcePlayerIndex = index, + SourceItemType = Main.player[index].inventory[Main.player[index].selectedItem].type, + SourceItemPrefix = (int) Main.player[index].inventory[Main.player[index].selectedItem].prefix }; public static PlayerDeathReason ByOther(int type) => new PlayerDeathReason() { - _sourceOtherIndex = type + SourceOtherIndex = type }; public static PlayerDeathReason ByProjectile( @@ -60,49 +58,49 @@ namespace Terraria.DataStructures { PlayerDeathReason playerDeathReason = new PlayerDeathReason() { - _sourcePlayerIndex = playerIndex, - _sourceProjectileIndex = projectileIndex, - _sourceProjectileType = Main.projectile[projectileIndex].type + SourcePlayerIndex = playerIndex, + SourceProjectileIndex = projectileIndex, + SourceProjectileType = Main.projectile[projectileIndex].type }; if (playerIndex >= 0 && playerIndex <= (int) byte.MaxValue) { - playerDeathReason._sourceItemType = Main.player[playerIndex].inventory[Main.player[playerIndex].selectedItem].type; - playerDeathReason._sourceItemPrefix = (int) Main.player[playerIndex].inventory[Main.player[playerIndex].selectedItem].prefix; + playerDeathReason.SourceItemType = Main.player[playerIndex].inventory[Main.player[playerIndex].selectedItem].type; + playerDeathReason.SourceItemPrefix = (int) Main.player[playerIndex].inventory[Main.player[playerIndex].selectedItem].prefix; } return playerDeathReason; } - public NetworkText GetDeathText(string deadPlayerName) => this._sourceCustomReason != null ? NetworkText.FromLiteral(this._sourceCustomReason) : Lang.CreateDeathMessage(deadPlayerName, this._sourcePlayerIndex, this._sourceNPCIndex, this._sourceProjectileIndex, this._sourceOtherIndex, this._sourceProjectileType, this._sourceItemType); + public NetworkText GetDeathText(string deadPlayerName) => this.SourceCustomReason != null ? NetworkText.FromLiteral(this.SourceCustomReason) : Lang.CreateDeathMessage(deadPlayerName, this.SourcePlayerIndex, this.SourceNPCIndex, this.SourceProjectileIndex, this.SourceOtherIndex, this.SourceProjectileType, this.SourceItemType); public void WriteSelfTo(BinaryWriter writer) { BitsByte bitsByte = (BitsByte) (byte) 0; - bitsByte[0] = this._sourcePlayerIndex != -1; - bitsByte[1] = this._sourceNPCIndex != -1; - bitsByte[2] = this._sourceProjectileIndex != -1; - bitsByte[3] = this._sourceOtherIndex != -1; - bitsByte[4] = (uint) this._sourceProjectileType > 0U; - bitsByte[5] = (uint) this._sourceItemType > 0U; - bitsByte[6] = (uint) this._sourceItemPrefix > 0U; - bitsByte[7] = this._sourceCustomReason != null; + bitsByte[0] = this.SourcePlayerIndex != -1; + bitsByte[1] = this.SourceNPCIndex != -1; + bitsByte[2] = this.SourceProjectileIndex != -1; + bitsByte[3] = this.SourceOtherIndex != -1; + bitsByte[4] = (uint) this.SourceProjectileType > 0U; + bitsByte[5] = (uint) this.SourceItemType > 0U; + bitsByte[6] = (uint) this.SourceItemPrefix > 0U; + bitsByte[7] = this.SourceCustomReason != null; writer.Write((byte) bitsByte); if (bitsByte[0]) - writer.Write((short) this._sourcePlayerIndex); + writer.Write((short) this.SourcePlayerIndex); if (bitsByte[1]) - writer.Write((short) this._sourceNPCIndex); + writer.Write((short) this.SourceNPCIndex); if (bitsByte[2]) - writer.Write((short) this._sourceProjectileIndex); + writer.Write((short) this.SourceProjectileIndex); if (bitsByte[3]) - writer.Write((byte) this._sourceOtherIndex); + writer.Write((byte) this.SourceOtherIndex); if (bitsByte[4]) - writer.Write((short) this._sourceProjectileType); + writer.Write((short) this.SourceProjectileType); if (bitsByte[5]) - writer.Write((short) this._sourceItemType); + writer.Write((short) this.SourceItemType); if (bitsByte[6]) - writer.Write((byte) this._sourceItemPrefix); + writer.Write((byte) this.SourceItemPrefix); if (!bitsByte[7]) return; - writer.Write(this._sourceCustomReason); + writer.Write(this.SourceCustomReason); } public static PlayerDeathReason FromReader(BinaryReader reader) @@ -110,21 +108,21 @@ namespace Terraria.DataStructures PlayerDeathReason playerDeathReason = new PlayerDeathReason(); BitsByte bitsByte = (BitsByte) reader.ReadByte(); if (bitsByte[0]) - playerDeathReason._sourcePlayerIndex = (int) reader.ReadInt16(); + playerDeathReason.SourcePlayerIndex = (int) reader.ReadInt16(); if (bitsByte[1]) - playerDeathReason._sourceNPCIndex = (int) reader.ReadInt16(); + playerDeathReason.SourceNPCIndex = (int) reader.ReadInt16(); if (bitsByte[2]) - playerDeathReason._sourceProjectileIndex = (int) reader.ReadInt16(); + playerDeathReason.SourceProjectileIndex = (int) reader.ReadInt16(); if (bitsByte[3]) - playerDeathReason._sourceOtherIndex = (int) reader.ReadByte(); + playerDeathReason.SourceOtherIndex = (int) reader.ReadByte(); if (bitsByte[4]) - playerDeathReason._sourceProjectileType = (int) reader.ReadInt16(); + playerDeathReason.SourceProjectileType = (int) reader.ReadInt16(); if (bitsByte[5]) - playerDeathReason._sourceItemType = (int) reader.ReadInt16(); + playerDeathReason.SourceItemType = (int) reader.ReadInt16(); if (bitsByte[6]) - playerDeathReason._sourceItemPrefix = (int) reader.ReadByte(); + playerDeathReason.SourceItemPrefix = (int) reader.ReadByte(); if (bitsByte[7]) - playerDeathReason._sourceCustomReason = reader.ReadString(); + playerDeathReason.SourceCustomReason = reader.ReadString(); return playerDeathReason; } } diff --git a/DataStructures/PlayerDrawHeadLayers.cs b/DataStructures/PlayerDrawHeadLayers.cs deleted file mode 100644 index b202f26..0000000 --- a/DataStructures/PlayerDrawHeadLayers.cs +++ /dev/null @@ -1,310 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.PlayerDrawHeadLayers -// 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; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using Terraria.GameContent; -using Terraria.Graphics; -using Terraria.ID; - -namespace Terraria.DataStructures -{ - public static class PlayerDrawHeadLayers - { - public static void DrawPlayer_0_(ref PlayerDrawHeadSet drawinfo) - { - } - - public static void DrawPlayer_00_BackHelmet(ref PlayerDrawHeadSet drawinfo) - { - if (drawinfo.drawPlayer.head < 0 || drawinfo.drawPlayer.head >= 266) - return; - int index = ArmorIDs.Head.Sets.FrontToBackID[drawinfo.drawPlayer.head]; - if (index < 0) - return; - Rectangle hairFrame = drawinfo.HairFrame; - PlayerDrawHeadLayers.QuickCDD(drawinfo.DrawData, drawinfo.cHead, TextureAssets.ArmorHead[index].Value, drawinfo.helmetOffset + new Vector2(drawinfo.Position.X - Main.screenPosition.X - (float) (drawinfo.bodyFrameMemory.Width / 2) + (float) (drawinfo.drawPlayer.width / 2), (float) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.bodyFrameMemory.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(hairFrame), drawinfo.colorArmorHead, drawinfo.drawPlayer.headRotation, drawinfo.headVect, drawinfo.scale, drawinfo.playerEffect, 0.0f); - } - - public static void DrawPlayer_01_FaceSkin(ref PlayerDrawHeadSet drawinfo) - { - if (drawinfo.drawPlayer.head == 38 || drawinfo.drawPlayer.head == 135 || drawinfo.drawPlayer.isHatRackDoll) - return; - PlayerDrawHeadLayers.QuickCDD(drawinfo.DrawData, drawinfo.skinDyePacked, TextureAssets.Players[drawinfo.skinVar, 0].Value, new Vector2(drawinfo.Position.X - Main.screenPosition.X - (float) (drawinfo.bodyFrameMemory.Width / 2) + (float) (drawinfo.drawPlayer.width / 2), (float) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.bodyFrameMemory.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.bodyFrameMemory), drawinfo.colorHead, drawinfo.drawPlayer.headRotation, drawinfo.headVect, drawinfo.scale, drawinfo.playerEffect, 0.0f); - PlayerDrawHeadLayers.QuickCDD(drawinfo.DrawData, TextureAssets.Players[drawinfo.skinVar, 1].Value, new Vector2(drawinfo.Position.X - Main.screenPosition.X - (float) (drawinfo.bodyFrameMemory.Width / 2) + (float) (drawinfo.drawPlayer.width / 2), (float) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.bodyFrameMemory.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.bodyFrameMemory), drawinfo.colorEyeWhites, drawinfo.drawPlayer.headRotation, drawinfo.headVect, drawinfo.scale, drawinfo.playerEffect, 0.0f); - PlayerDrawHeadLayers.QuickCDD(drawinfo.DrawData, TextureAssets.Players[drawinfo.skinVar, 2].Value, new Vector2(drawinfo.Position.X - Main.screenPosition.X - (float) (drawinfo.bodyFrameMemory.Width / 2) + (float) (drawinfo.drawPlayer.width / 2), (float) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.bodyFrameMemory.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.bodyFrameMemory), drawinfo.colorEyes, drawinfo.drawPlayer.headRotation, drawinfo.headVect, drawinfo.scale, drawinfo.playerEffect, 0.0f); - if (!drawinfo.drawPlayer.yoraiz0rDarkness) - return; - PlayerDrawHeadLayers.QuickCDD(drawinfo.DrawData, drawinfo.skinDyePacked, TextureAssets.Extra[67].Value, new Vector2(drawinfo.Position.X - Main.screenPosition.X - (float) (drawinfo.bodyFrameMemory.Width / 2) + (float) (drawinfo.drawPlayer.width / 2), (float) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.bodyFrameMemory.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.bodyFrameMemory), drawinfo.colorHead, drawinfo.drawPlayer.headRotation, drawinfo.headVect, drawinfo.scale, drawinfo.playerEffect, 0.0f); - } - - public static void DrawPlayer_02_DrawArmorWithFullHair(ref PlayerDrawHeadSet drawinfo) - { - if (!drawinfo.fullHair) - return; - PlayerDrawHeadLayers.QuickCDD(drawinfo.DrawData, drawinfo.cHead, TextureAssets.ArmorHead[drawinfo.drawPlayer.head].Value, drawinfo.helmetOffset + new Vector2(drawinfo.Position.X - Main.screenPosition.X - (float) (drawinfo.bodyFrameMemory.Width / 2) + (float) (drawinfo.drawPlayer.width / 2), (float) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.bodyFrameMemory.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.HairFrame), drawinfo.colorArmorHead, drawinfo.drawPlayer.headRotation, drawinfo.headVect, drawinfo.scale, drawinfo.playerEffect, 0.0f); - if (drawinfo.drawPlayer.invis || drawinfo.hideHair) - return; - Rectangle hairFrame = drawinfo.HairFrame; - hairFrame.Y -= 336; - if (hairFrame.Y < 0) - hairFrame.Y = 0; - PlayerDrawHeadLayers.QuickCDD(drawinfo.DrawData, drawinfo.hairShaderPacked, TextureAssets.PlayerHair[drawinfo.drawPlayer.hair].Value, new Vector2(drawinfo.Position.X - Main.screenPosition.X - (float) (drawinfo.bodyFrameMemory.Width / 2) + (float) (drawinfo.drawPlayer.width / 2), (float) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.bodyFrameMemory.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(hairFrame), drawinfo.colorHair, drawinfo.drawPlayer.headRotation, drawinfo.headVect, drawinfo.scale, drawinfo.playerEffect, 0.0f); - } - - public static void DrawPlayer_03_HelmetHair(ref PlayerDrawHeadSet drawinfo) - { - if (drawinfo.hideHair || !drawinfo.hatHair) - return; - Rectangle hairFrame = drawinfo.HairFrame; - hairFrame.Y -= 336; - if (hairFrame.Y < 0) - hairFrame.Y = 0; - if (drawinfo.drawPlayer.invis) - return; - PlayerDrawHeadLayers.QuickCDD(drawinfo.DrawData, drawinfo.hairShaderPacked, TextureAssets.PlayerHairAlt[drawinfo.drawPlayer.hair].Value, new Vector2(drawinfo.Position.X - Main.screenPosition.X - (float) (drawinfo.bodyFrameMemory.Width / 2) + (float) (drawinfo.drawPlayer.width / 2), (float) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.bodyFrameMemory.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(hairFrame), drawinfo.colorHair, drawinfo.drawPlayer.headRotation, drawinfo.headVect, drawinfo.scale, drawinfo.playerEffect, 0.0f); - } - - public static void DrawPlayer_04_RabbitOrder(ref PlayerDrawHeadSet drawinfo) - { - int verticalFrames = 27; - Texture2D texture2D = TextureAssets.ArmorHead[drawinfo.drawPlayer.head].Value; - Rectangle r = texture2D.Frame(verticalFrames: verticalFrames, frameY: drawinfo.drawPlayer.rabbitOrderFrame.DisplayFrame); - Vector2 origin = r.Size() / 2f; - int usedGravDir = 1; - Vector2 hatDrawPosition = PlayerDrawHeadLayers.DrawPlayer_04_GetHatDrawPosition(ref drawinfo, new Vector2(1f, -26f), usedGravDir); - int hatStacks = PlayerDrawHeadLayers.DrawPlayer_04_GetHatStacks(ref drawinfo, 4955); - float num1 = (float) Math.PI / 60f; - float num2 = (float) ((double) num1 * (double) drawinfo.drawPlayer.position.X % 6.28318548202515); - for (int index = hatStacks - 1; index >= 0; --index) - { - float x = (float) ((double) Vector2.UnitY.RotatedBy((double) num2 + (double) num1 * (double) index).X * ((double) index / 30.0) * 2.0) - (float) (index * 2 * drawinfo.drawPlayer.direction); - PlayerDrawHeadLayers.QuickCDD(drawinfo.DrawData, drawinfo.cHead, texture2D, hatDrawPosition + new Vector2(x, (float) (index * -14) * drawinfo.scale), new Rectangle?(r), drawinfo.colorArmorHead, drawinfo.drawPlayer.headRotation, origin, drawinfo.scale, drawinfo.playerEffect, 0.0f); - } - if (drawinfo.drawPlayer.invis || drawinfo.hideHair) - return; - Rectangle hairFrame = drawinfo.HairFrame; - hairFrame.Y -= 336; - if (hairFrame.Y < 0) - hairFrame.Y = 0; - PlayerDrawHeadLayers.QuickCDD(drawinfo.DrawData, drawinfo.hairShaderPacked, TextureAssets.PlayerHair[drawinfo.drawPlayer.hair].Value, new Vector2(drawinfo.Position.X - Main.screenPosition.X - (float) (drawinfo.bodyFrameMemory.Width / 2) + (float) (drawinfo.drawPlayer.width / 2), (float) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.bodyFrameMemory.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(hairFrame), drawinfo.colorHair, drawinfo.drawPlayer.headRotation, drawinfo.headVect, drawinfo.scale, drawinfo.playerEffect, 0.0f); - } - - public static void DrawPlayer_04_BadgersHat(ref PlayerDrawHeadSet drawinfo) - { - int verticalFrames = 6; - Texture2D texture2D = TextureAssets.ArmorHead[drawinfo.drawPlayer.head].Value; - Rectangle r = texture2D.Frame(verticalFrames: verticalFrames, frameY: drawinfo.drawPlayer.rabbitOrderFrame.DisplayFrame); - Vector2 origin = r.Size() / 2f; - int usedGravDir = 1; - Vector2 hatDrawPosition = PlayerDrawHeadLayers.DrawPlayer_04_GetHatDrawPosition(ref drawinfo, new Vector2(0.0f, -9f), usedGravDir); - int hatStacks = PlayerDrawHeadLayers.DrawPlayer_04_GetHatStacks(ref drawinfo, 5004); - float num1 = (float) Math.PI / 60f; - float num2 = (float) ((double) num1 * (double) drawinfo.drawPlayer.position.X % 6.28318548202515); - int num3 = hatStacks * 4 + 2; - int num4 = 0; - bool flag = ((double) Main.GlobalTimeWrappedHourly + 180.0) % 3600.0 < 60.0; - for (int index = num3 - 1; index >= 0; --index) - { - int num5 = 0; - if (index == num3 - 1) - { - r.Y = 0; - num5 = 2; - } - else - r.Y = index != 0 ? r.Height * (num4++ % 4 + 1) : r.Height * 5; - if (!(r.Y == r.Height * 3 & flag)) - { - float x = (float) ((double) Vector2.UnitY.RotatedBy((double) num2 + (double) num1 * (double) index).X * ((double) index / 10.0) * 4.0 - (double) index * 0.100000001490116 * (double) drawinfo.drawPlayer.direction); - PlayerDrawHeadLayers.QuickCDD(drawinfo.DrawData, drawinfo.cHead, texture2D, hatDrawPosition + new Vector2(x, (float) ((index * -4 + num5) * usedGravDir)) * drawinfo.scale, new Rectangle?(r), drawinfo.colorArmorHead, drawinfo.drawPlayer.headRotation, origin, drawinfo.scale, drawinfo.playerEffect, 0.0f); - } - } - } - - private static Vector2 DrawPlayer_04_GetHatDrawPosition( - ref PlayerDrawHeadSet drawinfo, - Vector2 hatOffset, - int usedGravDir) - { - Vector2 vector2 = new Vector2((float) drawinfo.drawPlayer.direction, (float) usedGravDir); - return drawinfo.Position - Main.screenPosition + new Vector2((float) (-drawinfo.bodyFrameMemory.Width / 2 + drawinfo.drawPlayer.width / 2), (float) (drawinfo.drawPlayer.height - drawinfo.bodyFrameMemory.Height + 4)) + hatOffset * vector2 * drawinfo.scale + (drawinfo.drawPlayer.headPosition + drawinfo.headVect); - } - - private static int DrawPlayer_04_GetHatStacks(ref PlayerDrawHeadSet drawinfo, int itemId) - { - int num = 0; - int index1 = 0; - if (drawinfo.drawPlayer.armor[index1] != null && drawinfo.drawPlayer.armor[index1].type == itemId && drawinfo.drawPlayer.armor[index1].stack > 0) - num += drawinfo.drawPlayer.armor[index1].stack; - int index2 = 10; - if (drawinfo.drawPlayer.armor[index2] != null && drawinfo.drawPlayer.armor[index2].type == itemId && drawinfo.drawPlayer.armor[index2].stack > 0) - num += drawinfo.drawPlayer.armor[index2].stack; - return num; - } - - public static void DrawPlayer_04_JungleRose(ref PlayerDrawHeadSet drawinfo) - { - if (drawinfo.drawPlayer.head == 259) - { - PlayerDrawHeadLayers.DrawPlayer_04_RabbitOrder(ref drawinfo); - } - else - { - if (!drawinfo.helmetIsOverFullHair) - return; - if (!drawinfo.drawPlayer.invis && !drawinfo.hideHair) - { - Rectangle hairFrame = drawinfo.HairFrame; - hairFrame.Y -= 336; - if (hairFrame.Y < 0) - hairFrame.Y = 0; - PlayerDrawHeadLayers.QuickCDD(drawinfo.DrawData, drawinfo.hairShaderPacked, TextureAssets.PlayerHair[drawinfo.drawPlayer.hair].Value, new Vector2(drawinfo.Position.X - Main.screenPosition.X - (float) (drawinfo.bodyFrameMemory.Width / 2) + (float) (drawinfo.drawPlayer.width / 2), (float) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.bodyFrameMemory.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(hairFrame), drawinfo.colorHair, drawinfo.drawPlayer.headRotation, drawinfo.headVect, drawinfo.scale, drawinfo.playerEffect, 0.0f); - } - if (drawinfo.drawPlayer.head == 0) - return; - PlayerDrawHeadLayers.QuickCDD(drawinfo.DrawData, drawinfo.cHead, TextureAssets.ArmorHead[drawinfo.drawPlayer.head].Value, drawinfo.helmetOffset + new Vector2(drawinfo.Position.X - Main.screenPosition.X - (float) (drawinfo.bodyFrameMemory.Width / 2) + (float) (drawinfo.drawPlayer.width / 2), (float) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.bodyFrameMemory.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.bodyFrameMemory), drawinfo.colorArmorHead, drawinfo.drawPlayer.headRotation, drawinfo.headVect, drawinfo.scale, drawinfo.playerEffect, 0.0f); - } - } - - public static void DrawPlayer_05_TallHats(ref PlayerDrawHeadSet drawinfo) - { - if (!drawinfo.helmetIsTall) - return; - Rectangle hairFrame = drawinfo.HairFrame; - if (drawinfo.drawPlayer.head == 158) - hairFrame.Height -= 2; - int num = 0; - if (hairFrame.Y == hairFrame.Height * 6) - hairFrame.Height -= 2; - else if (hairFrame.Y == hairFrame.Height * 7) - num = -2; - else if (hairFrame.Y == hairFrame.Height * 8) - num = -2; - else if (hairFrame.Y == hairFrame.Height * 9) - num = -2; - else if (hairFrame.Y == hairFrame.Height * 10) - num = -2; - else if (hairFrame.Y == hairFrame.Height * 13) - hairFrame.Height -= 2; - else if (hairFrame.Y == hairFrame.Height * 14) - num = -2; - else if (hairFrame.Y == hairFrame.Height * 15) - num = -2; - else if (hairFrame.Y == hairFrame.Height * 16) - num = -2; - hairFrame.Y += num; - PlayerDrawHeadLayers.QuickCDD(drawinfo.DrawData, drawinfo.cHead, TextureAssets.ArmorHead[drawinfo.drawPlayer.head].Value, drawinfo.helmetOffset + new Vector2(drawinfo.Position.X - Main.screenPosition.X - (float) (drawinfo.bodyFrameMemory.Width / 2) + (float) (drawinfo.drawPlayer.width / 2), (float) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.bodyFrameMemory.Height + 4.0) + (float) num) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(hairFrame), drawinfo.colorArmorHead, drawinfo.drawPlayer.headRotation, drawinfo.headVect, drawinfo.scale, drawinfo.playerEffect, 0.0f); - } - - public static void DrawPlayer_06_NormalHats(ref PlayerDrawHeadSet drawinfo) - { - if (drawinfo.drawPlayer.head == 265) - { - PlayerDrawHeadLayers.DrawPlayer_04_BadgersHat(ref drawinfo); - } - else - { - if (!drawinfo.helmetIsNormal) - return; - Rectangle hairFrame = drawinfo.HairFrame; - PlayerDrawHeadLayers.QuickCDD(drawinfo.DrawData, drawinfo.cHead, TextureAssets.ArmorHead[drawinfo.drawPlayer.head].Value, drawinfo.helmetOffset + new Vector2(drawinfo.Position.X - Main.screenPosition.X - (float) (drawinfo.bodyFrameMemory.Width / 2) + (float) (drawinfo.drawPlayer.width / 2), (float) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.bodyFrameMemory.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(hairFrame), drawinfo.colorArmorHead, drawinfo.drawPlayer.headRotation, drawinfo.headVect, drawinfo.scale, drawinfo.playerEffect, 0.0f); - } - } - - public static void DrawPlayer_07_JustHair(ref PlayerDrawHeadSet drawinfo) - { - if (drawinfo.helmetIsNormal || drawinfo.helmetIsOverFullHair || drawinfo.helmetIsTall || drawinfo.hideHair) - return; - if (drawinfo.drawPlayer.face == (sbyte) 5) - PlayerDrawHeadLayers.QuickCDD(drawinfo.DrawData, drawinfo.cFace, TextureAssets.AccFace[(int) drawinfo.drawPlayer.face].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.bodyFrameMemory.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.bodyFrameMemory.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.bodyFrameMemory), drawinfo.colorArmorHead, drawinfo.drawPlayer.headRotation, drawinfo.headVect, drawinfo.scale, drawinfo.playerEffect, 0.0f); - Rectangle hairFrame = drawinfo.HairFrame; - hairFrame.Y -= 336; - if (hairFrame.Y < 0) - hairFrame.Y = 0; - PlayerDrawHeadLayers.QuickCDD(drawinfo.DrawData, drawinfo.hairShaderPacked, TextureAssets.PlayerHair[drawinfo.drawPlayer.hair].Value, new Vector2(drawinfo.Position.X - Main.screenPosition.X - (float) (drawinfo.bodyFrameMemory.Width / 2) + (float) (drawinfo.drawPlayer.width / 2), (float) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.bodyFrameMemory.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(hairFrame), drawinfo.colorHair, drawinfo.drawPlayer.headRotation, drawinfo.headVect, drawinfo.scale, drawinfo.playerEffect, 0.0f); - } - - public static void DrawPlayer_08_FaceAcc(ref PlayerDrawHeadSet drawinfo) - { - if (drawinfo.drawPlayer.face > (sbyte) 0 && drawinfo.drawPlayer.face < (sbyte) 16 && drawinfo.drawPlayer.face != (sbyte) 5) - { - if (drawinfo.drawPlayer.face == (sbyte) 7) - { - Color color = new Color(200, 200, 200, 150); - PlayerDrawHeadLayers.QuickCDD(drawinfo.DrawData, drawinfo.cFace, TextureAssets.AccFace[(int) drawinfo.drawPlayer.face].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.bodyFrameMemory.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.bodyFrameMemory.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.bodyFrameMemory), new Color(200, 200, 200, 200), drawinfo.drawPlayer.headRotation, drawinfo.headVect, drawinfo.scale, drawinfo.playerEffect, 0.0f); - } - else - PlayerDrawHeadLayers.QuickCDD(drawinfo.DrawData, drawinfo.cFace, TextureAssets.AccFace[(int) drawinfo.drawPlayer.face].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.bodyFrameMemory.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.bodyFrameMemory.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.bodyFrameMemory), drawinfo.colorArmorHead, drawinfo.drawPlayer.headRotation, drawinfo.headVect, drawinfo.scale, drawinfo.playerEffect, 0.0f); - } - if (!drawinfo.drawUnicornHorn) - return; - PlayerDrawHeadLayers.QuickCDD(drawinfo.DrawData, drawinfo.cUnicornHorn, TextureAssets.Extra[143].Value, new Vector2(drawinfo.Position.X - Main.screenPosition.X - (float) (drawinfo.bodyFrameMemory.Width / 2) + (float) (drawinfo.drawPlayer.width / 2), (float) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.bodyFrameMemory.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.bodyFrameMemory), drawinfo.colorArmorHead, drawinfo.drawPlayer.headRotation, drawinfo.headVect, drawinfo.scale, drawinfo.playerEffect, 0.0f); - } - - public static void DrawPlayer_RenderAllLayers(ref PlayerDrawHeadSet drawinfo) - { - List drawData = drawinfo.DrawData; - Effect pixelShader = Main.pixelShader; - Projectile[] projectile = Main.projectile; - SpriteBatch spriteBatch = Main.spriteBatch; - for (int index = 0; index < drawData.Count; ++index) - { - DrawData cdd = drawData[index]; - if (!cdd.sourceRect.HasValue) - cdd.sourceRect = new Rectangle?(cdd.texture.Frame()); - PlayerDrawHelper.SetShaderForData(drawinfo.drawPlayer, drawinfo.cHead, ref cdd); - if (cdd.texture != null) - cdd.Draw(spriteBatch); - } - pixelShader.CurrentTechnique.Passes[0].Apply(); - } - - public static void DrawPlayer_DrawSelectionRect(ref PlayerDrawHeadSet drawinfo) - { - Vector2 lowest; - Vector2 highest; - SpriteRenderTargetHelper.GetDrawBoundary(drawinfo.DrawData, out lowest, out highest); - Utils.DrawRect(Main.spriteBatch, lowest + Main.screenPosition, highest + Main.screenPosition, Color.White); - } - - public static void QuickCDD( - List drawData, - Texture2D texture, - Vector2 position, - Rectangle? sourceRectangle, - Color color, - float rotation, - Vector2 origin, - float scale, - SpriteEffects effects, - float layerDepth) - { - drawData.Add(new DrawData(texture, position, sourceRectangle, color, rotation, origin, scale, effects, 0)); - } - - public static void QuickCDD( - List drawData, - int shaderTechnique, - Texture2D texture, - Vector2 position, - Rectangle? sourceRectangle, - Color color, - float rotation, - Vector2 origin, - float scale, - SpriteEffects effects, - float layerDepth) - { - drawData.Add(new DrawData(texture, position, sourceRectangle, color, rotation, origin, scale, effects, 0) - { - shader = shaderTechnique - }); - } - } -} diff --git a/DataStructures/PlayerDrawHeadSet.cs b/DataStructures/PlayerDrawHeadSet.cs deleted file mode 100644 index 07b38e2..0000000 --- a/DataStructures/PlayerDrawHeadSet.cs +++ /dev/null @@ -1,119 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.PlayerDrawHeadSet -// 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; -using Microsoft.Xna.Framework.Graphics; -using System.Collections.Generic; -using Terraria.ID; - -namespace Terraria.DataStructures -{ - public struct PlayerDrawHeadSet - { - public List DrawData; - public List Dust; - public List Gore; - public Player drawPlayer; - public int cHead; - public int cFace; - public int cUnicornHorn; - public int skinVar; - public int hairShaderPacked; - public int skinDyePacked; - public float scale; - public Color colorEyeWhites; - public Color colorEyes; - public Color colorHair; - public Color colorHead; - public Color colorArmorHead; - public SpriteEffects playerEffect; - public Vector2 headVect; - public Rectangle bodyFrameMemory; - public bool fullHair; - public bool hatHair; - public bool hideHair; - public bool helmetIsTall; - public bool helmetIsOverFullHair; - public bool helmetIsNormal; - public bool drawUnicornHorn; - public Vector2 Position; - public Vector2 helmetOffset; - - public Rectangle HairFrame - { - get - { - Rectangle bodyFrameMemory = this.bodyFrameMemory; - --bodyFrameMemory.Height; - return bodyFrameMemory; - } - } - - public void BoringSetup( - Player drawPlayer2, - List drawData, - List dust, - List gore, - float X, - float Y, - float Alpha, - float Scale) - { - this.DrawData = drawData; - this.Dust = dust; - this.Gore = gore; - this.drawPlayer = drawPlayer2; - this.Position = this.drawPlayer.position; - this.cHead = 0; - this.cFace = 0; - this.cUnicornHorn = 0; - this.drawUnicornHorn = false; - this.skinVar = this.drawPlayer.skinVariant; - this.hairShaderPacked = PlayerDrawHelper.PackShader((int) this.drawPlayer.hairDye, PlayerDrawHelper.ShaderConfiguration.HairShader); - if (this.drawPlayer.head == 0 && this.drawPlayer.hairDye == (byte) 0) - this.hairShaderPacked = PlayerDrawHelper.PackShader(1, PlayerDrawHelper.ShaderConfiguration.HairShader); - this.skinDyePacked = this.drawPlayer.skinDyePacked; - if (this.drawPlayer.face > (sbyte) 0 && this.drawPlayer.face < (sbyte) 16) - Main.instance.LoadAccFace((int) this.drawPlayer.face); - this.cHead = this.drawPlayer.cHead; - this.cFace = this.drawPlayer.cFace; - this.cUnicornHorn = this.drawPlayer.cUnicornHorn; - this.drawUnicornHorn = this.drawPlayer.hasUnicornHorn; - Main.instance.LoadHair(this.drawPlayer.hair); - this.scale = Scale; - this.colorEyeWhites = Main.quickAlpha(Color.White, Alpha); - this.colorEyes = Main.quickAlpha(this.drawPlayer.eyeColor, Alpha); - this.colorHair = Main.quickAlpha(this.drawPlayer.GetHairColor(false), Alpha); - this.colorHead = Main.quickAlpha(this.drawPlayer.skinColor, Alpha); - this.colorArmorHead = Main.quickAlpha(Color.White, Alpha); - this.playerEffect = SpriteEffects.None; - if (this.drawPlayer.direction < 0) - this.playerEffect = SpriteEffects.FlipHorizontally; - this.headVect = new Vector2((float) this.drawPlayer.legFrame.Width * 0.5f, (float) this.drawPlayer.legFrame.Height * 0.4f); - this.bodyFrameMemory = this.drawPlayer.bodyFrame; - this.bodyFrameMemory.Y = 0; - this.Position = Main.screenPosition; - this.Position.X += X; - this.Position.Y += Y; - this.Position.X -= 6f; - this.Position.Y -= 4f; - this.Position.Y -= (float) this.drawPlayer.HeightMapOffset; - if (this.drawPlayer.head > 0 && this.drawPlayer.head < 266) - { - Main.instance.LoadArmorHead(this.drawPlayer.head); - int i = ArmorIDs.Head.Sets.FrontToBackID[this.drawPlayer.head]; - if (i >= 0) - Main.instance.LoadArmorHead(i); - } - if (this.drawPlayer.face > (sbyte) 0 && this.drawPlayer.face < (sbyte) 16) - Main.instance.LoadAccFace((int) this.drawPlayer.face); - this.helmetOffset = this.drawPlayer.GetHelmetDrawOffset(); - this.drawPlayer.GetHairSettings(out this.fullHair, out this.hatHair, out this.hideHair, out bool _, out this.helmetIsOverFullHair); - this.helmetIsTall = this.drawPlayer.head == 14 || this.drawPlayer.head == 56 || this.drawPlayer.head == 158; - this.helmetIsNormal = !this.helmetIsTall && !this.helmetIsOverFullHair && this.drawPlayer.head > 0 && this.drawPlayer.head < 266 && this.drawPlayer.head != 28; - } - } -} diff --git a/DataStructures/PlayerDrawHelper.cs b/DataStructures/PlayerDrawHelper.cs deleted file mode 100644 index 3dd2c69..0000000 --- a/DataStructures/PlayerDrawHelper.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.PlayerDrawHelper -// 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 Terraria.Graphics.Shaders; - -namespace Terraria.DataStructures -{ - public class PlayerDrawHelper - { - public static int PackShader( - int localShaderIndex, - PlayerDrawHelper.ShaderConfiguration shaderType) - { - return localShaderIndex + (int) shaderType * 1000; - } - - public static void UnpackShader( - int packedShaderIndex, - out int localShaderIndex, - out PlayerDrawHelper.ShaderConfiguration shaderType) - { - shaderType = (PlayerDrawHelper.ShaderConfiguration) (packedShaderIndex / 1000); - localShaderIndex = packedShaderIndex % 1000; - } - - public static void SetShaderForData(Player player, int cHead, ref DrawData cdd) - { - int localShaderIndex; - PlayerDrawHelper.ShaderConfiguration shaderType; - PlayerDrawHelper.UnpackShader(cdd.shader, out localShaderIndex, out shaderType); - switch (shaderType) - { - case PlayerDrawHelper.ShaderConfiguration.ArmorShader: - GameShaders.Hair.Apply((short) 0, player, new DrawData?(cdd)); - GameShaders.Armor.Apply(localShaderIndex, (Entity) player, new DrawData?(cdd)); - break; - case PlayerDrawHelper.ShaderConfiguration.HairShader: - if (player.head == 0) - { - GameShaders.Hair.Apply((short) 0, player, new DrawData?(cdd)); - GameShaders.Armor.Apply(cHead, (Entity) player, new DrawData?(cdd)); - break; - } - GameShaders.Armor.Apply(0, (Entity) player, new DrawData?(cdd)); - GameShaders.Hair.Apply((short) localShaderIndex, player, new DrawData?(cdd)); - break; - case PlayerDrawHelper.ShaderConfiguration.TileShader: - Main.tileShader.CurrentTechnique.Passes[localShaderIndex].Apply(); - break; - case PlayerDrawHelper.ShaderConfiguration.TilePaintID: - if (localShaderIndex == 31) - { - GameShaders.Armor.Apply(0, (Entity) player, new DrawData?(cdd)); - break; - } - Main.tileShader.CurrentTechnique.Passes[Main.ConvertPaintIdToTileShaderIndex(localShaderIndex, false, false)].Apply(); - break; - } - } - - public enum ShaderConfiguration - { - ArmorShader, - HairShader, - TileShader, - TilePaintID, - } - } -} diff --git a/DataStructures/PlayerDrawLayers.cs b/DataStructures/PlayerDrawLayers.cs deleted file mode 100644 index 5d9d6df..0000000 --- a/DataStructures/PlayerDrawLayers.cs +++ /dev/null @@ -1,2753 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.PlayerDrawLayers -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using System; -using System.Collections.Generic; -using Terraria.GameContent; -using Terraria.Graphics; -using Terraria.Graphics.Shaders; -using Terraria.ID; -using Terraria.UI; - -namespace Terraria.DataStructures -{ - public static class PlayerDrawLayers - { - public static void DrawPlayer_extra_TorsoPlus(ref PlayerDrawSet drawinfo) - { - drawinfo.Position.Y += drawinfo.torsoOffset; - drawinfo.ItemLocation.Y += drawinfo.torsoOffset; - } - - public static void DrawPlayer_extra_TorsoMinus(ref PlayerDrawSet drawinfo) - { - drawinfo.Position.Y -= drawinfo.torsoOffset; - drawinfo.ItemLocation.Y -= drawinfo.torsoOffset; - } - - public static void DrawPlayer_extra_MountPlus(ref PlayerDrawSet drawinfo) => drawinfo.Position.Y += (float) ((int) drawinfo.mountOffSet / 2); - - public static void DrawPlayer_extra_MountMinus(ref PlayerDrawSet drawinfo) => drawinfo.Position.Y -= (float) ((int) drawinfo.mountOffSet / 2); - - public static void DrawCompositeArmorPiece( - ref PlayerDrawSet drawinfo, - CompositePlayerDrawContext context, - DrawData data) - { - drawinfo.DrawDataCache.Add(data); - switch (context) - { - case CompositePlayerDrawContext.BackShoulder: - case CompositePlayerDrawContext.BackArm: - case CompositePlayerDrawContext.FrontArm: - case CompositePlayerDrawContext.FrontShoulder: - if (drawinfo.armGlowColor.PackedValue > 0U) - { - DrawData drawData = data; - drawData.color = drawinfo.armGlowColor; - Rectangle rectangle = drawData.sourceRect.Value; - rectangle.Y += 224; - drawData.sourceRect = new Rectangle?(rectangle); - if (drawinfo.drawPlayer.body == 227) - { - Vector2 position = drawData.position; - for (int index = 0; index < 2; ++index) - { - Vector2 vector2 = new Vector2((float) Main.rand.Next(-10, 10) * 0.125f, (float) Main.rand.Next(-10, 10) * 0.125f); - drawData.position = position + vector2; - if (index == 0) - drawinfo.DrawDataCache.Add(drawData); - } - } - drawinfo.DrawDataCache.Add(drawData); - break; - } - break; - case CompositePlayerDrawContext.Torso: - if (drawinfo.bodyGlowColor.PackedValue > 0U) - { - DrawData drawData = data; - drawData.color = drawinfo.bodyGlowColor; - Rectangle rectangle = drawData.sourceRect.Value; - rectangle.Y += 224; - drawData.sourceRect = new Rectangle?(rectangle); - if (drawinfo.drawPlayer.body == 227) - { - Vector2 position = drawData.position; - for (int index = 0; index < 2; ++index) - { - Vector2 vector2 = new Vector2((float) Main.rand.Next(-10, 10) * 0.125f, (float) Main.rand.Next(-10, 10) * 0.125f); - drawData.position = position + vector2; - if (index == 0) - drawinfo.DrawDataCache.Add(drawData); - } - } - drawinfo.DrawDataCache.Add(drawData); - break; - } - break; - } - if (context != CompositePlayerDrawContext.FrontArm || drawinfo.drawPlayer.body != 205) - return; - Color color = new Color(100, 100, 100, 0); - ulong seed = (ulong) (drawinfo.drawPlayer.miscCounter / 4); - int num1 = 4; - for (int index = 0; index < num1; ++index) - { - float num2 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.2f; - float num3 = (float) Utils.RandomInt(ref seed, -10, 1) * 0.15f; - DrawData drawData = data; - Rectangle rectangle = drawData.sourceRect.Value; - rectangle.Y += 224; - drawData.sourceRect = new Rectangle?(rectangle); - drawData.position.X += num2; - drawData.position.Y += num3; - drawData.color = color; - drawinfo.DrawDataCache.Add(drawData); - } - } - - public static void DrawPlayer_01_BackHair(ref PlayerDrawSet drawinfo) - { - drawinfo.hairFrame = drawinfo.drawPlayer.bodyFrame; - drawinfo.hairFrame.Y -= 336; - if (drawinfo.hairFrame.Y < 0) - drawinfo.hairFrame.Y = 0; - int num = 26; - int hair = drawinfo.drawPlayer.hair; - drawinfo.backHairDraw = hair > 50 && (hair < 56 || hair > 63) && (hair < 74 || hair > 77) && (hair < 88 || hair > 89) && hair != 94 && hair != 100 && hair != 104 && hair != 112 && hair < 116; - if (hair == 133) - drawinfo.backHairDraw = true; - if (drawinfo.hideHair) - { - drawinfo.hairFrame.Height = 0; - } - else - { - if (!drawinfo.backHairDraw) - return; - if (drawinfo.drawPlayer.head == -1 || drawinfo.fullHair || drawinfo.drawsBackHairWithoutHeadgear) - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.PlayerHair[drawinfo.drawPlayer.hair].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.hairFrame), drawinfo.colorHair, drawinfo.drawPlayer.headRotation, drawinfo.headVect, 1f, drawinfo.playerEffect, 0) - { - shader = drawinfo.hairDyePacked - }); - else if (drawinfo.hatHair) - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.PlayerHairAlt[drawinfo.drawPlayer.hair].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.hairFrame), drawinfo.colorHair, drawinfo.drawPlayer.headRotation, drawinfo.headVect, 1f, drawinfo.playerEffect, 0) - { - shader = drawinfo.hairDyePacked - }); - if ((double) drawinfo.drawPlayer.gravDir != 1.0) - return; - drawinfo.hairFrame.Height = num; - } - } - - public static void DrawPlayer_02_MountBehindPlayer(ref PlayerDrawSet drawinfo) - { - if (!drawinfo.drawPlayer.mount.Active) - return; - PlayerDrawLayers.DrawMeowcartTrail(ref drawinfo); - PlayerDrawLayers.DrawTiedBalloons(ref drawinfo); - drawinfo.drawPlayer.mount.Draw(drawinfo.DrawDataCache, 0, drawinfo.drawPlayer, drawinfo.Position, drawinfo.colorMount, drawinfo.playerEffect, drawinfo.shadow); - drawinfo.drawPlayer.mount.Draw(drawinfo.DrawDataCache, 1, drawinfo.drawPlayer, drawinfo.Position, drawinfo.colorMount, drawinfo.playerEffect, drawinfo.shadow); - } - - public static void DrawPlayer_03_Carpet(ref PlayerDrawSet drawinfo) - { - if (drawinfo.drawPlayer.carpetFrame < 0) - return; - Color colorArmorLegs = drawinfo.colorArmorLegs; - float num = 0.0f; - if ((double) drawinfo.drawPlayer.gravDir == -1.0) - num = 10f; - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.FlyingCarpet.Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) (drawinfo.drawPlayer.height / 2) + 28.0 * (double) drawinfo.drawPlayer.gravDir + (double) num)), new Rectangle?(new Rectangle(0, TextureAssets.FlyingCarpet.Height() / 6 * drawinfo.drawPlayer.carpetFrame, TextureAssets.FlyingCarpet.Width(), TextureAssets.FlyingCarpet.Height() / 6)), colorArmorLegs, drawinfo.drawPlayer.bodyRotation, new Vector2((float) (TextureAssets.FlyingCarpet.Width() / 2), (float) (TextureAssets.FlyingCarpet.Height() / 8)), 1f, drawinfo.playerEffect, 0) - { - shader = drawinfo.cCarpet - }); - } - - public static void DrawPlayer_03_PortableStool(ref PlayerDrawSet drawinfo) - { - if (!drawinfo.drawPlayer.portableStoolInfo.IsInUse) - return; - Texture2D texture2D = TextureAssets.Extra[102].Value; - Vector2 position = new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height + 28.0)); - Rectangle r = texture2D.Frame(); - Vector2 origin = r.Size() * new Vector2(0.5f, 1f); - drawinfo.DrawDataCache.Add(new DrawData(texture2D, position, new Rectangle?(r), drawinfo.colorArmorLegs, drawinfo.drawPlayer.bodyRotation, origin, 1f, drawinfo.playerEffect, 0) - { - shader = drawinfo.cPortableStool - }); - } - - public static void DrawPlayer_04_ElectrifiedDebuffBack(ref PlayerDrawSet drawinfo) - { - if (!drawinfo.drawPlayer.electrified || (double) drawinfo.shadow != 0.0) - return; - Texture2D texture = TextureAssets.GlowMask[25].Value; - int num1 = drawinfo.drawPlayer.miscCounter / 5; - for (int index = 0; index < 2; ++index) - { - int num2 = num1 % 7; - if (num2 <= 1 || num2 >= 5) - { - DrawData drawData = new DrawData(texture, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)), new Rectangle?(new Rectangle(0, num2 * texture.Height / 7, texture.Width, texture.Height / 7)), drawinfo.colorElectricity, drawinfo.drawPlayer.bodyRotation, new Vector2((float) (texture.Width / 2), (float) (texture.Height / 14)), 1f, drawinfo.playerEffect, 0); - drawinfo.DrawDataCache.Add(drawData); - } - num1 = num2 + 3; - } - } - - public static void DrawPlayer_05_ForbiddenSetRing(ref PlayerDrawSet drawinfo) - { - if (!drawinfo.drawPlayer.setForbidden || (double) drawinfo.shadow != 0.0) - return; - Color color1 = Color.Lerp(drawinfo.colorArmorBody, Color.White, 0.7f); - Texture2D texture2D = TextureAssets.Extra[74].Value; - Texture2D texture = TextureAssets.GlowMask[217].Value; - int num1 = !drawinfo.drawPlayer.setForbiddenCooldownLocked ? 1 : 0; - int num2 = (int) ((double) ((float) ((double) drawinfo.drawPlayer.miscCounter / 300.0 * 6.28318548202515)).ToRotationVector2().Y * 6.0); - float num3 = ((float) ((double) drawinfo.drawPlayer.miscCounter / 75.0 * 6.28318548202515)).ToRotationVector2().X * 4f; - Color color2 = new Color(80, 70, 40, 0) * (float) ((double) num3 / 8.0 + 0.5) * 0.8f; - if (num1 == 0) - { - num2 = 0; - num3 = 2f; - color2 = new Color(80, 70, 40, 0) * 0.3f; - color1 = color1.MultiplyRGB(new Color(0.5f, 0.5f, 1f)); - } - Vector2 vector2 = new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)); - int num4 = 10; - int num5 = 20; - if (drawinfo.drawPlayer.head == 238) - { - num4 += 4; - num5 += 4; - } - Vector2 position = vector2 + new Vector2((float) (-drawinfo.drawPlayer.direction * num4), (float) ((double) -num5 * (double) drawinfo.drawPlayer.gravDir + (double) num2 * (double) drawinfo.drawPlayer.gravDir)); - DrawData drawData = new DrawData(texture2D, position, new Rectangle?(), color1, drawinfo.drawPlayer.bodyRotation, texture2D.Size() / 2f, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cBody; - drawinfo.DrawDataCache.Add(drawData); - for (float num6 = 0.0f; (double) num6 < 4.0; ++num6) - { - drawData = new DrawData(texture, position + (num6 * 1.570796f).ToRotationVector2() * num3, new Rectangle?(), color2, drawinfo.drawPlayer.bodyRotation, texture2D.Size() / 2f, 1f, drawinfo.playerEffect, 0); - drawinfo.DrawDataCache.Add(drawData); - } - } - - public static void DrawPlayer_01_3_BackHead(ref PlayerDrawSet drawinfo) - { - if (drawinfo.drawPlayer.head < 0 || drawinfo.drawPlayer.head >= 266) - return; - int index = ArmorIDs.Head.Sets.FrontToBackID[drawinfo.drawPlayer.head]; - if (index < 0) - return; - Vector2 helmetOffset = drawinfo.helmetOffset; - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.ArmorHead[index].Value, helmetOffset + new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorArmorHead, drawinfo.drawPlayer.headRotation, drawinfo.headVect, 1f, drawinfo.playerEffect, 0) - { - shader = drawinfo.cHead - }); - } - - public static void DrawPlayer_01_2_JimsCloak(ref PlayerDrawSet drawinfo) - { - if (drawinfo.drawPlayer.legs != 60 || drawinfo.isSitting || drawinfo.drawPlayer.invis || PlayerDrawLayers.ShouldOverrideLegs_CheckShoes(ref drawinfo) && !drawinfo.drawPlayer.wearsRobe) - return; - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.Extra[153].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.legFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.legFrame.Height + 4.0)) + drawinfo.drawPlayer.legPosition + drawinfo.legVect, new Rectangle?(drawinfo.drawPlayer.legFrame), drawinfo.colorArmorLegs, drawinfo.drawPlayer.legRotation, drawinfo.legVect, 1f, drawinfo.playerEffect, 0) - { - shader = drawinfo.cLegs - }); - } - - public static void DrawPlayer_05_2_SafemanSun(ref PlayerDrawSet drawinfo) - { - if (drawinfo.drawPlayer.head != 238 || (double) drawinfo.shadow != 0.0) - return; - Color color1 = Color.Lerp(drawinfo.colorArmorBody, Color.White, 0.7f); - Texture2D texture2D = TextureAssets.Extra[152].Value; - Texture2D texture = TextureAssets.Extra[152].Value; - int num1 = (int) ((double) ((float) ((double) drawinfo.drawPlayer.miscCounter / 300.0 * 6.28318548202515)).ToRotationVector2().Y * 6.0); - float num2 = ((float) ((double) drawinfo.drawPlayer.miscCounter / 75.0 * 6.28318548202515)).ToRotationVector2().X * 4f; - Color color2 = new Color(80, 70, 40, 0) * (float) ((double) num2 / 8.0 + 0.5) * 0.8f; - Vector2 vector2 = new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)); - int num3 = 8; - int num4 = 20; - int num5 = num3 + 4; - int num6 = num4 + 4; - Vector2 position = vector2 + new Vector2((float) (-drawinfo.drawPlayer.direction * num5), (float) ((double) -num6 * (double) drawinfo.drawPlayer.gravDir + (double) num1 * (double) drawinfo.drawPlayer.gravDir)); - DrawData drawData = new DrawData(texture2D, position, new Rectangle?(), color1, drawinfo.drawPlayer.bodyRotation, texture2D.Size() / 2f, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cHead; - drawinfo.DrawDataCache.Add(drawData); - for (float num7 = 0.0f; (double) num7 < 4.0; ++num7) - { - drawData = new DrawData(texture, position + (num7 * 1.570796f).ToRotationVector2() * num2, new Rectangle?(), color2, drawinfo.drawPlayer.bodyRotation, texture2D.Size() / 2f, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cHead; - drawinfo.DrawDataCache.Add(drawData); - } - } - - public static void DrawPlayer_06_WebbedDebuffBack(ref PlayerDrawSet drawinfo) - { - if (!drawinfo.drawPlayer.webbed || (double) drawinfo.shadow != 0.0 || (double) drawinfo.drawPlayer.velocity.Y == 0.0) - return; - Color color = drawinfo.colorArmorBody * 0.75f; - Texture2D texture2D = TextureAssets.Extra[32].Value; - DrawData drawData = new DrawData(texture2D, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)), new Rectangle?(), color, drawinfo.drawPlayer.bodyRotation, texture2D.Size() / 2f, 1f, drawinfo.playerEffect, 0); - drawinfo.DrawDataCache.Add(drawData); - } - - public static void DrawPlayer_07_LeinforsHairShampoo(ref PlayerDrawSet drawinfo) - { - if (!drawinfo.drawPlayer.leinforsHair || !drawinfo.fullHair && !drawinfo.hatHair && drawinfo.drawPlayer.head != -1 && drawinfo.drawPlayer.head != 0 || drawinfo.drawPlayer.hair == 12 || (double) drawinfo.shadow != 0.0 || (double) Main.rgbToHsl(drawinfo.colorHead).Z <= 0.200000002980232) - return; - if (Main.rand.Next(20) == 0 && !drawinfo.hatHair) - { - Rectangle r = Utils.CenteredRectangle(drawinfo.Position + drawinfo.drawPlayer.Size / 2f + new Vector2(0.0f, drawinfo.drawPlayer.gravDir * -20f), new Vector2(20f, 14f)); - int index = Dust.NewDust(r.TopLeft(), r.Width, r.Height, 204, Alpha: 150, Scale: 0.3f); - Main.dust[index].fadeIn = 1f; - Main.dust[index].velocity *= 0.1f; - Main.dust[index].noLight = true; - Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(drawinfo.drawPlayer.cLeinShampoo, drawinfo.drawPlayer); - drawinfo.DustCache.Add(index); - } - if (Main.rand.Next(40) == 0 && drawinfo.hatHair) - { - Rectangle r = Utils.CenteredRectangle(drawinfo.Position + drawinfo.drawPlayer.Size / 2f + new Vector2((float) (drawinfo.drawPlayer.direction * -10), drawinfo.drawPlayer.gravDir * -10f), new Vector2(5f, 5f)); - int index = Dust.NewDust(r.TopLeft(), r.Width, r.Height, 204, Alpha: 150, Scale: 0.3f); - Main.dust[index].fadeIn = 1f; - Main.dust[index].velocity *= 0.1f; - Main.dust[index].noLight = true; - Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(drawinfo.drawPlayer.cLeinShampoo, drawinfo.drawPlayer); - drawinfo.DustCache.Add(index); - } - if ((double) drawinfo.drawPlayer.velocity.X == 0.0 || !drawinfo.backHairDraw || Main.rand.Next(15) != 0) - return; - Rectangle r1 = Utils.CenteredRectangle(drawinfo.Position + drawinfo.drawPlayer.Size / 2f + new Vector2((float) (drawinfo.drawPlayer.direction * -14), 0.0f), new Vector2(4f, 30f)); - int index1 = Dust.NewDust(r1.TopLeft(), r1.Width, r1.Height, 204, Alpha: 150, Scale: 0.3f); - Main.dust[index1].fadeIn = 1f; - Main.dust[index1].velocity *= 0.1f; - Main.dust[index1].noLight = true; - Main.dust[index1].shader = GameShaders.Armor.GetSecondaryShader(drawinfo.drawPlayer.cLeinShampoo, drawinfo.drawPlayer); - drawinfo.DustCache.Add(index1); - } - - public static void DrawPlayer_08_Backpacks(ref PlayerDrawSet drawinfo) - { - drawinfo.backPack = false; - if (drawinfo.drawPlayer.wings != 0 && (double) drawinfo.drawPlayer.velocity.Y != 0.0 || drawinfo.heldItem.type != 1178 && drawinfo.heldItem.type != 779 && drawinfo.heldItem.type != 1295 && drawinfo.heldItem.type != 1910 && !drawinfo.drawPlayer.turtleArmor && drawinfo.drawPlayer.body != 106 && drawinfo.drawPlayer.body != 170 && (drawinfo.heldItem.type != 4818 || drawinfo.drawPlayer.ownedProjectileCounts[902] != 0)) - return; - drawinfo.backPack = true; - int type = drawinfo.heldItem.type; - int index = 1; - float num1 = -4f; - float num2 = -8f; - int num3 = 0; - if (drawinfo.drawPlayer.turtleArmor) - { - index = 4; - num3 = drawinfo.cBody; - } - else if (drawinfo.drawPlayer.body == 106) - { - index = 6; - num3 = drawinfo.cBody; - } - else if (drawinfo.drawPlayer.body == 170) - { - index = 7; - num3 = drawinfo.cBody; - } - else - { - switch (type) - { - case 779: - index = 2; - break; - case 1178: - index = 1; - break; - case 1295: - index = 3; - break; - case 1910: - index = 5; - break; - case 4818: - index = 8; - break; - } - } - Vector2 vector2 = new Vector2(0.0f, 8f); - Vector2 position1 = (drawinfo.Position - Main.screenPosition + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.width / 2), (float) (drawinfo.drawPlayer.height - drawinfo.drawPlayer.bodyFrame.Height / 2)) + new Vector2(0.0f, -4f) + vector2).Floor(); - Vector2 position2 = (drawinfo.Position - Main.screenPosition + new Vector2((float) (drawinfo.drawPlayer.width / 2), (float) (drawinfo.drawPlayer.height - drawinfo.drawPlayer.bodyFrame.Height / 2)) + new Vector2((num1 - 9f) * (float) drawinfo.drawPlayer.direction, (2f + num2) * drawinfo.drawPlayer.gravDir) + vector2).Floor(); - switch (index) - { - case 4: - case 6: - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.BackPack[index].Value, position1, new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorArmorBody, drawinfo.drawPlayer.bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0) - { - shader = num3 - }); - break; - case 7: - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.BackPack[index].Value, position1, new Rectangle?(new Rectangle(0, drawinfo.drawPlayer.bodyFrame.Y, TextureAssets.BackPack[index].Width(), drawinfo.drawPlayer.bodyFrame.Height)), drawinfo.colorArmorBody, drawinfo.drawPlayer.bodyRotation, new Vector2((float) TextureAssets.BackPack[index].Width() * 0.5f, drawinfo.bodyVect.Y), 1f, drawinfo.playerEffect, 0) - { - shader = num3 - }); - break; - case 8: - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.BackPack[index].Value, position1, new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorArmorBody, drawinfo.drawPlayer.bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0) - { - shader = num3 - }); - break; - default: - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.BackPack[index].Value, position2, new Rectangle?(new Rectangle(0, 0, TextureAssets.BackPack[index].Width(), TextureAssets.BackPack[index].Height())), drawinfo.colorArmorBody, drawinfo.drawPlayer.bodyRotation, new Vector2((float) (TextureAssets.BackPack[index].Width() / 2), (float) (TextureAssets.BackPack[index].Height() / 2)), 1f, drawinfo.playerEffect, 0) - { - shader = num3 - }); - break; - } - } - - public static void DrawPlayer_09_BackAc(ref PlayerDrawSet drawinfo) - { - if (drawinfo.backPack || drawinfo.drawPlayer.back <= (sbyte) 0 || drawinfo.drawPlayer.back >= (sbyte) 30 || drawinfo.drawPlayer.mount.Active) - return; - if (drawinfo.drawPlayer.front >= (sbyte) 1 && drawinfo.drawPlayer.front <= (sbyte) 4) - { - int num = drawinfo.drawPlayer.bodyFrame.Y / 56; - if (num < 1 || num > 5) - { - drawinfo.armorAdjust = 10; - } - else - { - if (drawinfo.drawPlayer.front == (sbyte) 1) - drawinfo.armorAdjust = 0; - if (drawinfo.drawPlayer.front == (sbyte) 2) - drawinfo.armorAdjust = 8; - if (drawinfo.drawPlayer.front == (sbyte) 3) - drawinfo.armorAdjust = 0; - if (drawinfo.drawPlayer.front == (sbyte) 4) - drawinfo.armorAdjust = 8; - } - } - Vector2 zero = Vector2.Zero; - Vector2 vector2 = new Vector2(0.0f, 8f); - Vector2 position1 = drawinfo.Position; - Vector2 position2 = (zero + position1 - Main.screenPosition + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.width / 2), (float) (drawinfo.drawPlayer.height - drawinfo.drawPlayer.bodyFrame.Height / 2)) + new Vector2(0.0f, -4f) + vector2).Floor(); - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.AccBack[(int) drawinfo.drawPlayer.back].Value, position2, new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorArmorBody, drawinfo.drawPlayer.bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0) - { - shader = drawinfo.cBack - }); - } - - public static void DrawPlayer_10_Wings(ref PlayerDrawSet drawinfo) - { - Vector2 directions = drawinfo.drawPlayer.Directions; - Vector2 vector2_1 = drawinfo.Position - Main.screenPosition + drawinfo.drawPlayer.Size / 2f; - Vector2 vector2_2 = new Vector2(0.0f, 7f); - Vector2 commonWingPosPreFloor = drawinfo.Position - Main.screenPosition + new Vector2((float) (drawinfo.drawPlayer.width / 2), (float) (drawinfo.drawPlayer.height - drawinfo.drawPlayer.bodyFrame.Height / 2)) + vector2_2; - if (drawinfo.backPack || drawinfo.drawPlayer.wings <= 0) - return; - Main.instance.LoadWings(drawinfo.drawPlayer.wings); - if (drawinfo.drawPlayer.wings == 22) - { - if (!drawinfo.drawPlayer.ShouldDrawWingsThatAreAlwaysAnimated()) - return; - Main.instance.LoadItemFlames(1866); - Color colorArmorBody = drawinfo.colorArmorBody; - int num1 = 26; - int num2 = -9; - Vector2 vec = commonWingPosPreFloor + new Vector2((float) num2, (float) num1) * directions; - DrawData drawData; - if ((double) drawinfo.shadow == 0.0 && drawinfo.drawPlayer.grappling[0] == -1) - { - for (int index = 0; index < 7; ++index) - { - Color color = new Color(250 - index * 10, 250 - index * 10, 250 - index * 10, 150 - index * 10); - Vector2 vector2_3 = new Vector2((float) Main.rand.Next(-10, 11) * 0.2f, (float) Main.rand.Next(-10, 11) * 0.2f); - drawinfo.stealth *= drawinfo.stealth; - drawinfo.stealth *= 1f - drawinfo.shadow; - color = new Color((int) ((double) color.R * (double) drawinfo.stealth), (int) ((double) color.G * (double) drawinfo.stealth), (int) ((double) color.B * (double) drawinfo.stealth), (int) ((double) color.A * (double) drawinfo.stealth)); - vector2_3.X = drawinfo.drawPlayer.itemFlamePos[index].X; - vector2_3.Y = -drawinfo.drawPlayer.itemFlamePos[index].Y; - vector2_3 *= 0.5f; - Vector2 position = (vec + vector2_3).Floor(); - drawData = new DrawData(TextureAssets.ItemFlame[1866].Value, position, new Rectangle?(new Rectangle(0, TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 7 * drawinfo.drawPlayer.wingFrame, TextureAssets.Wings[drawinfo.drawPlayer.wings].Width(), TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 7 - 2)), color, drawinfo.drawPlayer.bodyRotation, new Vector2((float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Width() / 2), (float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 14)), 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cWings; - drawinfo.DrawDataCache.Add(drawData); - } - } - drawData = new DrawData(TextureAssets.Wings[drawinfo.drawPlayer.wings].Value, vec.Floor(), new Rectangle?(new Rectangle(0, TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 7 * drawinfo.drawPlayer.wingFrame, TextureAssets.Wings[drawinfo.drawPlayer.wings].Width(), TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 7)), colorArmorBody, drawinfo.drawPlayer.bodyRotation, new Vector2((float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Width() / 2), (float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 14)), 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cWings; - drawinfo.DrawDataCache.Add(drawData); - } - else if (drawinfo.drawPlayer.wings == 28) - { - if (!drawinfo.drawPlayer.ShouldDrawWingsThatAreAlwaysAnimated()) - return; - Color colorArmorBody = drawinfo.colorArmorBody; - Vector2 vector2_4 = new Vector2(0.0f, 0.0f); - Texture2D texture2D = TextureAssets.Wings[drawinfo.drawPlayer.wings].Value; - Vector2 vec = drawinfo.Position + drawinfo.drawPlayer.Size * new Vector2(0.5f, 1f) - Main.screenPosition + vector2_4 * drawinfo.drawPlayer.Directions; - Rectangle r = texture2D.Frame(verticalFrames: 4, frameY: (drawinfo.drawPlayer.miscCounter / 5 % 4)); - r.Width -= 2; - r.Height -= 2; - DrawData drawData = new DrawData(texture2D, vec.Floor(), new Rectangle?(r), Color.Lerp(colorArmorBody, Color.White, 1f), drawinfo.drawPlayer.bodyRotation, r.Size() / 2f, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cWings; - drawinfo.DrawDataCache.Add(drawData); - drawData = new DrawData(TextureAssets.Extra[38].Value, vec.Floor(), new Rectangle?(r), Color.Lerp(colorArmorBody, Color.White, 0.5f), drawinfo.drawPlayer.bodyRotation, r.Size() / 2f, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cWings; - drawinfo.DrawDataCache.Add(drawData); - } - else if (drawinfo.drawPlayer.wings == 45) - { - if (!drawinfo.drawPlayer.ShouldDrawWingsThatAreAlwaysAnimated()) - return; - PlayerDrawLayers.DrawStarboardRainbowTrail(ref drawinfo, commonWingPosPreFloor, directions); - Color color1 = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); - int num3 = 22; - int num4 = 0; - Vector2 vec = commonWingPosPreFloor + new Vector2((float) num4, (float) num3) * directions; - double num5 = 1.0 - (double) drawinfo.shadow; - Color color2 = color1 * (float) num5; - DrawData drawData = new DrawData(TextureAssets.Wings[drawinfo.drawPlayer.wings].Value, vec.Floor(), new Rectangle?(new Rectangle(0, TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 6 * drawinfo.drawPlayer.wingFrame, TextureAssets.Wings[drawinfo.drawPlayer.wings].Width(), TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 6)), color2, drawinfo.drawPlayer.bodyRotation, new Vector2((float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Width() / 2), (float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 12)), 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cWings; - drawinfo.DrawDataCache.Add(drawData); - if ((double) drawinfo.shadow != 0.0) - return; - float num6 = ((float) ((double) drawinfo.drawPlayer.miscCounter / 75.0 * 6.28318548202515)).ToRotationVector2().X * 4f; - Color color3 = new Color(70, 70, 70, 0) * (float) ((double) num6 / 8.0 + 0.5) * 0.4f; - for (float f = 0.0f; (double) f < 6.28318548202515; f += 1.570796f) - { - drawData = new DrawData(TextureAssets.Wings[drawinfo.drawPlayer.wings].Value, vec.Floor() + f.ToRotationVector2() * num6, new Rectangle?(new Rectangle(0, TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 6 * drawinfo.drawPlayer.wingFrame, TextureAssets.Wings[drawinfo.drawPlayer.wings].Width(), TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 6)), color3, drawinfo.drawPlayer.bodyRotation, new Vector2((float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Width() / 2), (float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 12)), 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cWings; - drawinfo.DrawDataCache.Add(drawData); - } - } - else if (drawinfo.drawPlayer.wings == 34) - { - if (!drawinfo.drawPlayer.ShouldDrawWingsThatAreAlwaysAnimated()) - return; - drawinfo.stealth *= drawinfo.stealth; - drawinfo.stealth *= 1f - drawinfo.shadow; - Color color = new Color((int) (250.0 * (double) drawinfo.stealth), (int) (250.0 * (double) drawinfo.stealth), (int) (250.0 * (double) drawinfo.stealth), (int) (100.0 * (double) drawinfo.stealth)); - Vector2 vector2_5 = new Vector2(0.0f, 0.0f); - Texture2D texture2D = TextureAssets.Wings[drawinfo.drawPlayer.wings].Value; - Vector2 vec = drawinfo.Position + drawinfo.drawPlayer.Size / 2f - Main.screenPosition + vector2_5 * drawinfo.drawPlayer.Directions - Vector2.UnitX * (float) drawinfo.drawPlayer.direction * 4f; - Rectangle r = texture2D.Frame(verticalFrames: 6, frameY: drawinfo.drawPlayer.wingFrame); - r.Width -= 2; - r.Height -= 2; - drawinfo.DrawDataCache.Add(new DrawData(texture2D, vec.Floor(), new Rectangle?(r), color, drawinfo.drawPlayer.bodyRotation, r.Size() / 2f, 1f, drawinfo.playerEffect, 0) - { - shader = drawinfo.cWings - }); - } - else if (drawinfo.drawPlayer.wings == 40) - { - drawinfo.stealth *= drawinfo.stealth; - drawinfo.stealth *= 1f - drawinfo.shadow; - Color color = new Color((int) (250.0 * (double) drawinfo.stealth), (int) (250.0 * (double) drawinfo.stealth), (int) (250.0 * (double) drawinfo.stealth), (int) (100.0 * (double) drawinfo.stealth)); - Vector2 vector2_6 = new Vector2(-4f, 0.0f); - Texture2D texture2D = TextureAssets.Wings[drawinfo.drawPlayer.wings].Value; - Vector2 vector2_7 = commonWingPosPreFloor + vector2_6 * directions; - for (int index = 0; index < 1; ++index) - { - SpriteEffects playerEffect = drawinfo.playerEffect; - Vector2 scale = new Vector2(1f); - Vector2 zero = Vector2.Zero; - zero.X = (float) (drawinfo.drawPlayer.direction * 3); - if (index == 1) - { - playerEffect ^= SpriteEffects.FlipHorizontally; - scale = new Vector2(0.7f, 1f); - zero.X += (float) -drawinfo.drawPlayer.direction * 6f; - } - Vector2 vector2_8 = drawinfo.drawPlayer.velocity * -1.5f; - int num7 = 0; - int num8 = 8; - float num9 = 4f; - if ((double) drawinfo.drawPlayer.velocity.Y == 0.0) - { - num7 = 8; - num8 = 14; - num9 = 3f; - } - for (int frameY = num7; frameY < num8; ++frameY) - { - Vector2 vector2_9 = vector2_7; - Rectangle r = texture2D.Frame(verticalFrames: 14, frameY: frameY); - r.Width -= 2; - r.Height -= 2; - int num10 = (frameY - num7) % (int) num9; - Vector2 vector2_10 = new Vector2(0.0f, 0.5f).RotatedBy(((double) drawinfo.drawPlayer.miscCounterNormalized * (2.0 + (double) num10) + (double) num10 * 0.5 + (double) index * 1.29999995231628) * 6.28318548202515) * (float) (num10 + 1); - Vector2 vec = vector2_9 + vector2_10 + vector2_8 * ((float) num10 / num9) + zero; - drawinfo.DrawDataCache.Add(new DrawData(texture2D, vec.Floor(), new Rectangle?(r), color, drawinfo.drawPlayer.bodyRotation, r.Size() / 2f, scale, playerEffect, 0) - { - shader = drawinfo.cWings - }); - } - } - } - else if (drawinfo.drawPlayer.wings == 39) - { - if (!drawinfo.drawPlayer.ShouldDrawWingsThatAreAlwaysAnimated()) - return; - drawinfo.stealth *= drawinfo.stealth; - drawinfo.stealth *= 1f - drawinfo.shadow; - Color colorArmorBody = drawinfo.colorArmorBody; - Vector2 vector2_11 = new Vector2(-6f, -7f); - Texture2D texture2D = TextureAssets.Wings[drawinfo.drawPlayer.wings].Value; - Vector2 vec = commonWingPosPreFloor + vector2_11 * directions; - Rectangle r = texture2D.Frame(verticalFrames: 6, frameY: drawinfo.drawPlayer.wingFrame); - r.Width -= 2; - r.Height -= 2; - drawinfo.DrawDataCache.Add(new DrawData(texture2D, vec.Floor(), new Rectangle?(r), colorArmorBody, drawinfo.drawPlayer.bodyRotation, r.Size() / 2f, 1f, drawinfo.playerEffect, 0) - { - shader = drawinfo.cWings - }); - } - else - { - int num11 = 0; - int num12 = 0; - int num13 = 4; - if (drawinfo.drawPlayer.wings == 43) - { - num12 = -5; - num11 = -7; - num13 = 7; - } - else if (drawinfo.drawPlayer.wings == 44) - num13 = 7; - else if (drawinfo.drawPlayer.wings == 5) - { - num12 = 4; - num11 -= 4; - } - else if (drawinfo.drawPlayer.wings == 27) - num12 = 4; - Color color4 = drawinfo.colorArmorBody; - if (drawinfo.drawPlayer.wings == 9 || drawinfo.drawPlayer.wings == 29) - { - drawinfo.stealth *= drawinfo.stealth; - drawinfo.stealth *= 1f - drawinfo.shadow; - color4 = new Color((int) (250.0 * (double) drawinfo.stealth), (int) (250.0 * (double) drawinfo.stealth), (int) (250.0 * (double) drawinfo.stealth), (int) (100.0 * (double) drawinfo.stealth)); - } - if (drawinfo.drawPlayer.wings == 10) - { - drawinfo.stealth *= drawinfo.stealth; - drawinfo.stealth *= 1f - drawinfo.shadow; - color4 = new Color((int) (250.0 * (double) drawinfo.stealth), (int) (250.0 * (double) drawinfo.stealth), (int) (250.0 * (double) drawinfo.stealth), (int) (175.0 * (double) drawinfo.stealth)); - } - if (drawinfo.drawPlayer.wings == 11 && (int) color4.A > (int) Main.gFade) - color4.A = Main.gFade; - if (drawinfo.drawPlayer.wings == 31) - color4.A = (byte) (220.0 * (double) drawinfo.stealth); - if (drawinfo.drawPlayer.wings == 32) - color4.A = (byte) ((double) sbyte.MaxValue * (double) drawinfo.stealth); - if (drawinfo.drawPlayer.wings == 6) - { - color4.A = (byte) (160.0 * (double) drawinfo.stealth); - color4 *= 0.9f; - } - Vector2 vec = commonWingPosPreFloor + new Vector2((float) (num12 - 9), (float) (num11 + 2)) * directions; - DrawData drawData = new DrawData(TextureAssets.Wings[drawinfo.drawPlayer.wings].Value, vec.Floor(), new Rectangle?(new Rectangle(0, TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / num13 * drawinfo.drawPlayer.wingFrame, TextureAssets.Wings[drawinfo.drawPlayer.wings].Width(), TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / num13)), color4, drawinfo.drawPlayer.bodyRotation, new Vector2((float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Width() / 2), (float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / num13 / 2)), 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cWings; - drawinfo.DrawDataCache.Add(drawData); - if (drawinfo.drawPlayer.wings == 43 && (double) drawinfo.shadow == 0.0) - { - Vector2 vector2_12 = vec; - Vector2 origin = new Vector2((float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Width() / 2), (float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / num13 / 2)); - Rectangle rectangle = new Rectangle(0, TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / num13 * drawinfo.drawPlayer.wingFrame, TextureAssets.Wings[drawinfo.drawPlayer.wings].Width(), TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / num13); - for (int index = 0; index < 2; ++index) - { - Vector2 vector2_13 = new Vector2((float) Main.rand.Next(-10, 10) * 0.125f, (float) Main.rand.Next(-10, 10) * 0.125f); - drawData = new DrawData(TextureAssets.GlowMask[272].Value, vector2_12 + vector2_13, new Rectangle?(rectangle), new Color(230, 230, 230, 60), drawinfo.drawPlayer.bodyRotation, origin, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cWings; - drawinfo.DrawDataCache.Add(drawData); - } - } - if (drawinfo.drawPlayer.wings == 23) - { - drawinfo.stealth *= drawinfo.stealth; - drawinfo.stealth *= 1f - drawinfo.shadow; - color4 = new Color((int) (200.0 * (double) drawinfo.stealth), (int) (200.0 * (double) drawinfo.stealth), (int) (200.0 * (double) drawinfo.stealth), (int) (200.0 * (double) drawinfo.stealth)); - drawData = new DrawData(TextureAssets.Flames[8].Value, vec.Floor(), new Rectangle?(new Rectangle(0, TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 4 * drawinfo.drawPlayer.wingFrame, TextureAssets.Wings[drawinfo.drawPlayer.wings].Width(), TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 4)), color4, drawinfo.drawPlayer.bodyRotation, new Vector2((float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Width() / 2), (float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 8)), 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cWings; - drawinfo.DrawDataCache.Add(drawData); - } - else if (drawinfo.drawPlayer.wings == 27) - { - drawData = new DrawData(TextureAssets.GlowMask[92].Value, vec.Floor(), new Rectangle?(new Rectangle(0, TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 4 * drawinfo.drawPlayer.wingFrame, TextureAssets.Wings[drawinfo.drawPlayer.wings].Width(), TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 4)), new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue) * drawinfo.stealth * (1f - drawinfo.shadow), drawinfo.drawPlayer.bodyRotation, new Vector2((float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Width() / 2), (float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 8)), 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cWings; - drawinfo.DrawDataCache.Add(drawData); - } - else if (drawinfo.drawPlayer.wings == 44) - { - PlayerRainbowWingsTextureContent playerRainbowWings = TextureAssets.RenderTargets.PlayerRainbowWings; - playerRainbowWings.Request(); - if (!playerRainbowWings.IsReady) - return; - drawData = new DrawData((Texture2D) playerRainbowWings.GetTarget(), vec.Floor(), new Rectangle?(new Rectangle(0, TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 7 * drawinfo.drawPlayer.wingFrame, TextureAssets.Wings[drawinfo.drawPlayer.wings].Width(), TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 7)), new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue) * drawinfo.stealth * (1f - drawinfo.shadow), drawinfo.drawPlayer.bodyRotation, new Vector2((float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Width() / 2), (float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 14)), 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cWings; - drawinfo.DrawDataCache.Add(drawData); - } - else if (drawinfo.drawPlayer.wings == 30) - { - drawData = new DrawData(TextureAssets.GlowMask[181].Value, vec.Floor(), new Rectangle?(new Rectangle(0, TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 4 * drawinfo.drawPlayer.wingFrame, TextureAssets.Wings[drawinfo.drawPlayer.wings].Width(), TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 4)), new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue) * drawinfo.stealth * (1f - drawinfo.shadow), drawinfo.drawPlayer.bodyRotation, new Vector2((float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Width() / 2), (float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 8)), 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cWings; - drawinfo.DrawDataCache.Add(drawData); - } - else if (drawinfo.drawPlayer.wings == 38) - { - Color color5 = drawinfo.ArkhalisColor * drawinfo.stealth * (1f - drawinfo.shadow); - drawData = new DrawData(TextureAssets.GlowMask[251].Value, vec.Floor(), new Rectangle?(new Rectangle(0, TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 4 * drawinfo.drawPlayer.wingFrame, TextureAssets.Wings[drawinfo.drawPlayer.wings].Width(), TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 4)), color5, drawinfo.drawPlayer.bodyRotation, new Vector2((float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Width() / 2), (float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 8)), 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cWings; - drawinfo.DrawDataCache.Add(drawData); - for (int index = drawinfo.drawPlayer.shadowPos.Length - 2; index >= 0; --index) - { - Color color6 = color5; - color6.A = (byte) 0; - Color color7 = color6 * MathHelper.Lerp(1f, 0.0f, (float) index / 3f) * 0.1f; - Vector2 vector2_14 = drawinfo.drawPlayer.shadowPos[index] - drawinfo.drawPlayer.position; - for (float num14 = 0.0f; (double) num14 < 1.0; num14 += 0.01f) - { - Vector2 vector2_15 = new Vector2(2f, 0.0f).RotatedBy((double) num14 / 0.0399999991059303 * 6.28318548202515); - drawData = new DrawData(TextureAssets.GlowMask[251].Value, vector2_15 + vector2_14 * num14 + vec, new Rectangle?(new Rectangle(0, TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 4 * drawinfo.drawPlayer.wingFrame, TextureAssets.Wings[drawinfo.drawPlayer.wings].Width(), TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 4)), color7 * (1f - num14), drawinfo.drawPlayer.bodyRotation, new Vector2((float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Width() / 2), (float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 8)), 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cWings; - drawinfo.DrawDataCache.Add(drawData); - } - } - } - else if (drawinfo.drawPlayer.wings == 29) - { - drawData = new DrawData(TextureAssets.Wings[drawinfo.drawPlayer.wings].Value, vec.Floor(), new Rectangle?(new Rectangle(0, TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 4 * drawinfo.drawPlayer.wingFrame, TextureAssets.Wings[drawinfo.drawPlayer.wings].Width(), TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 4)), new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * drawinfo.stealth * (1f - drawinfo.shadow) * 0.5f, drawinfo.drawPlayer.bodyRotation, new Vector2((float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Width() / 2), (float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 8)), 1.06f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cWings; - drawinfo.DrawDataCache.Add(drawData); - } - else if (drawinfo.drawPlayer.wings == 36) - { - drawData = new DrawData(TextureAssets.GlowMask[213].Value, vec.Floor(), new Rectangle?(new Rectangle(0, TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 4 * drawinfo.drawPlayer.wingFrame, TextureAssets.Wings[drawinfo.drawPlayer.wings].Width(), TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 4)), new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * drawinfo.stealth * (1f - drawinfo.shadow), drawinfo.drawPlayer.bodyRotation, new Vector2((float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Width() / 2), (float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 8)), 1.06f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cWings; - drawinfo.DrawDataCache.Add(drawData); - Vector2 spinningpoint = new Vector2(0.0f, (float) (2.0 - (double) drawinfo.shadow * 2.0)); - for (int index = 0; index < 4; ++index) - { - drawData = new DrawData(TextureAssets.GlowMask[213].Value, spinningpoint.RotatedBy(1.57079637050629 * (double) index) + vec.Floor(), new Rectangle?(new Rectangle(0, TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 4 * drawinfo.drawPlayer.wingFrame, TextureAssets.Wings[drawinfo.drawPlayer.wings].Width(), TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 4)), new Color((int) sbyte.MaxValue, (int) sbyte.MaxValue, (int) sbyte.MaxValue, (int) sbyte.MaxValue) * drawinfo.stealth * (1f - drawinfo.shadow), drawinfo.drawPlayer.bodyRotation, new Vector2((float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Width() / 2), (float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 8)), 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cWings; - drawinfo.DrawDataCache.Add(drawData); - } - } - else if (drawinfo.drawPlayer.wings == 31) - { - Color color8 = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); - Color color9 = Color.Lerp(Color.HotPink, Color.Crimson, (float) (Math.Cos(6.28318548202515 * ((double) drawinfo.drawPlayer.miscCounter / 100.0)) * 0.400000005960464 + 0.5)); - color9.A = (byte) 0; - for (int index = 0; index < 4; ++index) - { - Vector2 vector2_16 = new Vector2((float) (Math.Cos(6.28318548202515 * ((double) drawinfo.drawPlayer.miscCounter / 60.0)) * 0.5 + 0.5), 0.0f).RotatedBy((double) index * 1.57079637050629) * 1f; - drawData = new DrawData(TextureAssets.Wings[drawinfo.drawPlayer.wings].Value, vec.Floor() + vector2_16, new Rectangle?(new Rectangle(0, TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 4 * drawinfo.drawPlayer.wingFrame, TextureAssets.Wings[drawinfo.drawPlayer.wings].Width(), TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 4)), color9 * drawinfo.stealth * (1f - drawinfo.shadow) * 0.5f, drawinfo.drawPlayer.bodyRotation, new Vector2((float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Width() / 2), (float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 8)), 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cWings; - drawinfo.DrawDataCache.Add(drawData); - } - drawData = new DrawData(TextureAssets.Wings[drawinfo.drawPlayer.wings].Value, vec.Floor(), new Rectangle?(new Rectangle(0, TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 4 * drawinfo.drawPlayer.wingFrame, TextureAssets.Wings[drawinfo.drawPlayer.wings].Width(), TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 4)), color9 * drawinfo.stealth * (1f - drawinfo.shadow) * 1f, drawinfo.drawPlayer.bodyRotation, new Vector2((float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Width() / 2), (float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 8)), 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cWings; - drawinfo.DrawDataCache.Add(drawData); - } - else - { - if (drawinfo.drawPlayer.wings != 32) - return; - drawData = new DrawData(TextureAssets.GlowMask[183].Value, vec.Floor(), new Rectangle?(new Rectangle(0, TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 4 * drawinfo.drawPlayer.wingFrame, TextureAssets.Wings[drawinfo.drawPlayer.wings].Width(), TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 4)), new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * drawinfo.stealth * (1f - drawinfo.shadow), drawinfo.drawPlayer.bodyRotation, new Vector2((float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Width() / 2), (float) (TextureAssets.Wings[drawinfo.drawPlayer.wings].Height() / 8)), 1.06f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cWings; - drawinfo.DrawDataCache.Add(drawData); - } - } - } - - public static void DrawPlayer_11_Balloons(ref PlayerDrawSet drawinfo) - { - if (drawinfo.drawPlayer.balloon <= (sbyte) 0) - return; - int num = !Main.hasFocus || Main.ingameOptionsWindow && Main.autoPause ? 0 : DateTime.Now.Millisecond % 800 / 200; - Vector2 vector2_1 = Main.OffsetsPlayerOffhand[drawinfo.drawPlayer.bodyFrame.Y / 56]; - if (drawinfo.drawPlayer.direction != 1) - vector2_1.X = (float) drawinfo.drawPlayer.width - vector2_1.X; - if ((double) drawinfo.drawPlayer.gravDir != 1.0) - vector2_1.Y -= (float) drawinfo.drawPlayer.height; - Vector2 vector2_2 = new Vector2(0.0f, 8f) + new Vector2(0.0f, 6f); - Vector2 vector2_3 = new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X + (double) vector2_1.X), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) vector2_1.Y * (double) drawinfo.drawPlayer.gravDir)); - vector2_3 = drawinfo.Position - Main.screenPosition + vector2_1 * new Vector2(1f, drawinfo.drawPlayer.gravDir) + new Vector2(0.0f, (float) (drawinfo.drawPlayer.height - drawinfo.drawPlayer.bodyFrame.Height)) + vector2_2; - vector2_3 = vector2_3.Floor(); - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.AccBalloon[(int) drawinfo.drawPlayer.balloon].Value, vector2_3, new Rectangle?(new Rectangle(0, TextureAssets.AccBalloon[(int) drawinfo.drawPlayer.balloon].Height() / 4 * num, TextureAssets.AccBalloon[(int) drawinfo.drawPlayer.balloon].Width(), TextureAssets.AccBalloon[(int) drawinfo.drawPlayer.balloon].Height() / 4)), drawinfo.colorArmorBody, drawinfo.drawPlayer.bodyRotation, new Vector2((float) (26 + drawinfo.drawPlayer.direction * 4), (float) (28.0 + (double) drawinfo.drawPlayer.gravDir * 6.0)), 1f, drawinfo.playerEffect, 0) - { - shader = drawinfo.cBalloon - }); - } - - public static void DrawPlayer_12_Skin(ref PlayerDrawSet drawinfo) - { - if (drawinfo.usesCompositeTorso) - { - PlayerDrawLayers.DrawPlayer_12_Skin_Composite(ref drawinfo); - } - else - { - if (drawinfo.isSitting) - drawinfo.hidesBottomSkin = true; - DrawData drawData; - if (!drawinfo.hidesTopSkin) - { - drawinfo.Position.Y += drawinfo.torsoOffset; - drawData = new DrawData(TextureAssets.Players[drawinfo.skinVar, 3].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorBodySkin, drawinfo.drawPlayer.bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0) - { - shader = drawinfo.skinDyePacked - }; - drawinfo.DrawDataCache.Add(drawData); - drawinfo.Position.Y -= drawinfo.torsoOffset; - } - if (drawinfo.hidesBottomSkin || PlayerDrawLayers.IsBottomOverridden(ref drawinfo)) - return; - if (drawinfo.isSitting) - { - PlayerDrawLayers.DrawSittingLegs(ref drawinfo, TextureAssets.Players[drawinfo.skinVar, 10].Value, drawinfo.colorLegs); - } - else - { - drawData = new DrawData(TextureAssets.Players[drawinfo.skinVar, 10].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawinfo.drawPlayer.legFrame), drawinfo.colorLegs, drawinfo.drawPlayer.legRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0); - drawinfo.DrawDataCache.Add(drawData); - } - } - } - - public static bool IsBottomOverridden(ref PlayerDrawSet drawinfo) => PlayerDrawLayers.ShouldOverrideLegs_CheckPants(ref drawinfo) || PlayerDrawLayers.ShouldOverrideLegs_CheckShoes(ref drawinfo); - - public static bool ShouldOverrideLegs_CheckPants(ref PlayerDrawSet drawinfo) - { - switch (drawinfo.drawPlayer.legs) - { - case 67: - case 106: - case 138: - case 140: - case 143: - case 217: - return true; - default: - return false; - } - } - - public static bool ShouldOverrideLegs_CheckShoes(ref PlayerDrawSet drawinfo) => drawinfo.drawPlayer.shoe == (sbyte) 15; - - public static void DrawPlayer_12_Skin_Composite(ref PlayerDrawSet drawinfo) - { - DrawData drawData1; - if (!drawinfo.hidesTopSkin && !drawinfo.drawPlayer.invis) - { - Vector2 vector2_1 = new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)); - vector2_1.Y += drawinfo.torsoOffset; - Vector2 vector2_2 = Main.OffsetsPlayerHeadgear[drawinfo.drawPlayer.bodyFrame.Y / drawinfo.drawPlayer.bodyFrame.Height]; - vector2_2.Y -= 2f; - Vector2 position = vector2_1 + vector2_2; - float bodyRotation = drawinfo.drawPlayer.bodyRotation; - Vector2 vector2_3 = position; - Vector2 vector2_4 = position; - Vector2 bodyVect1 = drawinfo.bodyVect; - Vector2 bodyVect2 = drawinfo.bodyVect; - Vector2 compositeOffsetBackArm = PlayerDrawLayers.GetCompositeOffset_BackArm(ref drawinfo); - Vector2 vector2_5 = vector2_3 + compositeOffsetBackArm; - Vector2 vector2_6 = compositeOffsetBackArm; - Vector2 vector2_7 = bodyVect1 + vector2_6; - Vector2 compositeOffsetFrontArm = PlayerDrawLayers.GetCompositeOffset_FrontArm(ref drawinfo); - Vector2 vector2_8 = bodyVect2 + compositeOffsetFrontArm; - Vector2 vector2_9 = compositeOffsetFrontArm; - Vector2 vector2_10 = vector2_4 + vector2_9; - if (drawinfo.drawFloatingTube) - { - List drawDataCache = drawinfo.DrawDataCache; - drawData1 = new DrawData(TextureAssets.Extra[105].Value, position, new Rectangle?(new Rectangle(0, 0, 40, 56)), drawinfo.floatingTubeColor, bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0); - drawData1.shader = drawinfo.cFloatingTube; - DrawData drawData2 = drawData1; - drawDataCache.Add(drawData2); - } - List drawDataCache1 = drawinfo.DrawDataCache; - drawData1 = new DrawData(TextureAssets.Players[drawinfo.skinVar, 3].Value, position, new Rectangle?(drawinfo.compTorsoFrame), drawinfo.colorBodySkin, bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0); - drawData1.shader = drawinfo.skinDyePacked; - DrawData drawData3 = drawData1; - drawDataCache1.Add(drawData3); - } - if (!drawinfo.hidesBottomSkin && !drawinfo.drawPlayer.invis && !PlayerDrawLayers.IsBottomOverridden(ref drawinfo)) - { - if (drawinfo.isSitting) - { - PlayerDrawLayers.DrawSittingLegs(ref drawinfo, TextureAssets.Players[drawinfo.skinVar, 10].Value, drawinfo.colorLegs, drawinfo.skinDyePacked); - } - else - { - drawData1 = new DrawData(TextureAssets.Players[drawinfo.skinVar, 10].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawinfo.drawPlayer.legFrame), drawinfo.colorLegs, drawinfo.drawPlayer.legRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0); - drawData1.shader = drawinfo.skinDyePacked; - DrawData drawData4 = drawData1; - drawinfo.DrawDataCache.Add(drawData4); - } - } - PlayerDrawLayers.DrawPlayer_12_SkinComposite_BackArmShirt(ref drawinfo); - } - - public static void DrawPlayer_12_SkinComposite_BackArmShirt(ref PlayerDrawSet drawinfo) - { - Vector2 vector2_1 = new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)); - Vector2 vector2_2 = Main.OffsetsPlayerHeadgear[drawinfo.drawPlayer.bodyFrame.Y / drawinfo.drawPlayer.bodyFrame.Height]; - vector2_2.Y -= 2f; - Vector2 vector2_3 = vector2_1 + vector2_2 * (float) -drawinfo.playerEffect.HasFlag((Enum) SpriteEffects.FlipVertically).ToDirectionInt(); - vector2_3.Y += drawinfo.torsoOffset; - float bodyRotation = drawinfo.drawPlayer.bodyRotation; - Vector2 vector2_4 = vector2_3; - Vector2 vector2_5 = vector2_3; - Vector2 bodyVect = drawinfo.bodyVect; - Vector2 compositeOffsetBackArm = PlayerDrawLayers.GetCompositeOffset_BackArm(ref drawinfo); - Vector2 position1 = vector2_4 + compositeOffsetBackArm; - Vector2 position2 = vector2_5 + drawinfo.backShoulderOffset; - Vector2 origin1 = bodyVect + compositeOffsetBackArm; - float rotation = bodyRotation + drawinfo.compositeBackArmRotation; - bool flag1 = !drawinfo.drawPlayer.invis; - bool flag2 = !drawinfo.drawPlayer.invis; - bool flag3 = drawinfo.drawPlayer.body > 0 && drawinfo.drawPlayer.body < 235; - bool flag4 = !drawinfo.hidesTopSkin; - bool flag5 = false; - DrawData drawData1; - if (flag3) - { - flag1 &= drawinfo.missingHand; - if (flag2 && drawinfo.missingArm) - { - if (flag4) - { - List drawDataCache = drawinfo.DrawDataCache; - drawData1 = new DrawData(TextureAssets.Players[drawinfo.skinVar, 7].Value, position1, new Rectangle?(drawinfo.compBackArmFrame), drawinfo.colorBodySkin, rotation, origin1, 1f, drawinfo.playerEffect, 0); - drawData1.shader = drawinfo.skinDyePacked; - DrawData drawData2 = drawData1; - drawDataCache.Add(drawData2); - } - if (!flag5 & flag4) - { - List drawDataCache = drawinfo.DrawDataCache; - drawData1 = new DrawData(TextureAssets.Players[drawinfo.skinVar, 5].Value, position1, new Rectangle?(drawinfo.compBackArmFrame), drawinfo.colorBodySkin, rotation, origin1, 1f, drawinfo.playerEffect, 0); - drawData1.shader = drawinfo.skinDyePacked; - DrawData drawData3 = drawData1; - drawDataCache.Add(drawData3); - flag5 = true; - } - flag2 = false; - } - if (!drawinfo.drawPlayer.invis || PlayerDrawLayers.IsArmorDrawnWhenInvisible(drawinfo.drawPlayer.body)) - { - Texture2D texture = TextureAssets.ArmorBodyComposite[drawinfo.drawPlayer.body].Value; - if (!drawinfo.hideCompositeShoulders) - { - ref PlayerDrawSet local = ref drawinfo; - drawData1 = new DrawData(texture, position2, new Rectangle?(drawinfo.compBackShoulderFrame), drawinfo.colorArmorBody, bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0); - drawData1.shader = drawinfo.cBody; - DrawData data = drawData1; - PlayerDrawLayers.DrawCompositeArmorPiece(ref local, CompositePlayerDrawContext.BackShoulder, data); - } - ref PlayerDrawSet local1 = ref drawinfo; - drawData1 = new DrawData(texture, position1, new Rectangle?(drawinfo.compBackArmFrame), drawinfo.colorArmorBody, rotation, origin1, 1f, drawinfo.playerEffect, 0); - drawData1.shader = drawinfo.cBody; - DrawData data1 = drawData1; - PlayerDrawLayers.DrawCompositeArmorPiece(ref local1, CompositePlayerDrawContext.BackArm, data1); - } - } - if (flag1) - { - if (flag4) - { - if (flag2) - { - List drawDataCache = drawinfo.DrawDataCache; - drawData1 = new DrawData(TextureAssets.Players[drawinfo.skinVar, 7].Value, position1, new Rectangle?(drawinfo.compBackArmFrame), drawinfo.colorBodySkin, rotation, origin1, 1f, drawinfo.playerEffect, 0); - drawData1.shader = drawinfo.skinDyePacked; - DrawData drawData4 = drawData1; - drawDataCache.Add(drawData4); - } - if (!flag5 & flag4) - { - List drawDataCache = drawinfo.DrawDataCache; - drawData1 = new DrawData(TextureAssets.Players[drawinfo.skinVar, 5].Value, position1, new Rectangle?(drawinfo.compBackArmFrame), drawinfo.colorBodySkin, rotation, origin1, 1f, drawinfo.playerEffect, 0); - drawData1.shader = drawinfo.skinDyePacked; - DrawData drawData5 = drawData1; - drawDataCache.Add(drawData5); - } - } - if (!flag3) - { - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.Players[drawinfo.skinVar, 8].Value, position1, new Rectangle?(drawinfo.compBackArmFrame), drawinfo.colorUnderShirt, rotation, origin1, 1f, drawinfo.playerEffect, 0)); - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.Players[drawinfo.skinVar, 13].Value, position1, new Rectangle?(drawinfo.compBackArmFrame), drawinfo.colorShirt, rotation, origin1, 1f, drawinfo.playerEffect, 0)); - } - } - if (drawinfo.drawPlayer.handoff > (sbyte) 0 && drawinfo.drawPlayer.handoff < (sbyte) 14) - { - Texture2D texture = TextureAssets.AccHandsOffComposite[(int) drawinfo.drawPlayer.handoff].Value; - ref PlayerDrawSet local = ref drawinfo; - drawData1 = new DrawData(texture, position1, new Rectangle?(drawinfo.compBackArmFrame), drawinfo.colorArmorBody, rotation, origin1, 1f, drawinfo.playerEffect, 0); - drawData1.shader = drawinfo.cHandOff; - DrawData data = drawData1; - PlayerDrawLayers.DrawCompositeArmorPiece(ref local, CompositePlayerDrawContext.BackArmAccessory, data); - } - if (!drawinfo.drawPlayer.drawingFootball) - return; - Main.instance.LoadProjectile(861); - Texture2D texture2D = TextureAssets.Projectile[861].Value; - Rectangle r = texture2D.Frame(verticalFrames: 4); - Vector2 origin2 = r.Size() / 2f; - Vector2 position3 = position1 + new Vector2((float) (drawinfo.drawPlayer.direction * -2), drawinfo.drawPlayer.gravDir * 4f); - drawinfo.DrawDataCache.Add(new DrawData(texture2D, position3, new Rectangle?(r), drawinfo.colorArmorBody, bodyRotation + 0.7853982f * (float) drawinfo.drawPlayer.direction, origin2, 0.8f, drawinfo.playerEffect, 0)); - } - - public static void DrawPlayer_13_Leggings(ref PlayerDrawSet drawinfo) - { - if (drawinfo.isSitting && drawinfo.drawPlayer.legs != 140 && drawinfo.drawPlayer.legs != 217) - { - if (drawinfo.drawPlayer.legs > 0 && drawinfo.drawPlayer.legs < 218 && (!PlayerDrawLayers.ShouldOverrideLegs_CheckShoes(ref drawinfo) || drawinfo.drawPlayer.wearsRobe)) - { - if (drawinfo.drawPlayer.invis) - return; - PlayerDrawLayers.DrawSittingLegs(ref drawinfo, TextureAssets.ArmorLeg[drawinfo.drawPlayer.legs].Value, drawinfo.colorArmorLegs, drawinfo.cLegs); - if (drawinfo.legsGlowMask == -1) - return; - PlayerDrawLayers.DrawSittingLegs(ref drawinfo, TextureAssets.GlowMask[drawinfo.legsGlowMask].Value, drawinfo.legsGlowColor, drawinfo.cLegs); - } - else - { - if (drawinfo.drawPlayer.invis || PlayerDrawLayers.ShouldOverrideLegs_CheckShoes(ref drawinfo)) - return; - PlayerDrawLayers.DrawSittingLegs(ref drawinfo, TextureAssets.Players[drawinfo.skinVar, 11].Value, drawinfo.colorPants); - PlayerDrawLayers.DrawSittingLegs(ref drawinfo, TextureAssets.Players[drawinfo.skinVar, 12].Value, drawinfo.colorShoes); - } - } - else if (drawinfo.drawPlayer.legs == 140) - { - if (drawinfo.drawPlayer.invis || drawinfo.drawPlayer.mount.Active) - return; - Texture2D texture = TextureAssets.Extra[73].Value; - bool flag = drawinfo.drawPlayer.legFrame.Y != drawinfo.drawPlayer.legFrame.Height || Main.gameMenu; - int num1 = drawinfo.drawPlayer.miscCounter / 3 % 8; - if (flag) - num1 = drawinfo.drawPlayer.miscCounter / 4 % 8; - Rectangle r = new Rectangle(18 * flag.ToInt(), num1 * 26, 16, 24); - float num2 = 12f; - if (drawinfo.drawPlayer.bodyFrame.Height != 0) - num2 = 12f - Main.OffsetsPlayerHeadgear[drawinfo.drawPlayer.bodyFrame.Y / drawinfo.drawPlayer.bodyFrame.Height].Y; - Vector2 scale = new Vector2(1f, 1f); - Vector2 vector2_1 = drawinfo.Position + drawinfo.drawPlayer.Size * new Vector2(0.5f, (float) (0.5 + 0.5 * (double) drawinfo.drawPlayer.gravDir)); - int direction = drawinfo.drawPlayer.direction; - Vector2 vector2_2 = new Vector2(0.0f, -num2 * drawinfo.drawPlayer.gravDir); - Vector2 vec = vector2_1 + vector2_2 - Main.screenPosition + drawinfo.drawPlayer.legPosition; - if (drawinfo.isSitting) - vec.Y += drawinfo.seatYOffset; - Vector2 position = vec.Floor(); - drawinfo.DrawDataCache.Add(new DrawData(texture, position, new Rectangle?(r), drawinfo.colorArmorLegs, drawinfo.drawPlayer.legRotation, r.Size() * new Vector2(0.5f, (float) (0.5 - (double) drawinfo.drawPlayer.gravDir * 0.5)), scale, drawinfo.playerEffect, 0) - { - shader = drawinfo.cLegs - }); - } - else if (drawinfo.drawPlayer.legs > 0 && drawinfo.drawPlayer.legs < 218 && (!PlayerDrawLayers.ShouldOverrideLegs_CheckShoes(ref drawinfo) || drawinfo.drawPlayer.wearsRobe)) - { - if (drawinfo.drawPlayer.invis) - return; - DrawData drawData = new DrawData(TextureAssets.ArmorLeg[drawinfo.drawPlayer.legs].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.legFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.legFrame.Height + 4.0)) + drawinfo.drawPlayer.legPosition + drawinfo.legVect, new Rectangle?(drawinfo.drawPlayer.legFrame), drawinfo.colorArmorLegs, drawinfo.drawPlayer.legRotation, drawinfo.legVect, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cLegs; - drawinfo.DrawDataCache.Add(drawData); - if (drawinfo.legsGlowMask == -1) - return; - if (drawinfo.legsGlowMask == 274) - { - for (int index = 0; index < 2; ++index) - { - Vector2 vector2 = new Vector2((float) Main.rand.Next(-10, 10) * 0.125f, (float) Main.rand.Next(-10, 10) * 0.125f); - drawData = new DrawData(TextureAssets.GlowMask[drawinfo.legsGlowMask].Value, vector2 + new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.legFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.legFrame.Height + 4.0)) + drawinfo.drawPlayer.legPosition + drawinfo.legVect, new Rectangle?(drawinfo.drawPlayer.legFrame), drawinfo.legsGlowColor, drawinfo.drawPlayer.legRotation, drawinfo.legVect, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cLegs; - drawinfo.DrawDataCache.Add(drawData); - } - } - else - { - drawData = new DrawData(TextureAssets.GlowMask[drawinfo.legsGlowMask].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.legFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.legFrame.Height + 4.0)) + drawinfo.drawPlayer.legPosition + drawinfo.legVect, new Rectangle?(drawinfo.drawPlayer.legFrame), drawinfo.legsGlowColor, drawinfo.drawPlayer.legRotation, drawinfo.legVect, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cLegs; - drawinfo.DrawDataCache.Add(drawData); - } - } - else - { - if (drawinfo.drawPlayer.invis || PlayerDrawLayers.ShouldOverrideLegs_CheckShoes(ref drawinfo)) - return; - DrawData drawData = new DrawData(TextureAssets.Players[drawinfo.skinVar, 11].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.legFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.legFrame.Height + 4.0)) + drawinfo.drawPlayer.legPosition + drawinfo.legVect, new Rectangle?(drawinfo.drawPlayer.legFrame), drawinfo.colorPants, drawinfo.drawPlayer.legRotation, drawinfo.legVect, 1f, drawinfo.playerEffect, 0); - drawinfo.DrawDataCache.Add(drawData); - drawData = new DrawData(TextureAssets.Players[drawinfo.skinVar, 12].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.legFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.legFrame.Height + 4.0)) + drawinfo.drawPlayer.legPosition + drawinfo.legVect, new Rectangle?(drawinfo.drawPlayer.legFrame), drawinfo.colorShoes, drawinfo.drawPlayer.legRotation, drawinfo.legVect, 1f, drawinfo.playerEffect, 0); - drawinfo.DrawDataCache.Add(drawData); - } - } - - private static void DrawSittingLegs( - ref PlayerDrawSet drawinfo, - Texture2D textureToDraw, - Color matchingColor, - int shaderIndex = 0, - bool glowmask = false) - { - Vector2 vector2_1 = new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.legFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.legFrame.Height + 4.0)) + drawinfo.drawPlayer.legPosition + drawinfo.legVect; - Rectangle legFrame = drawinfo.drawPlayer.legFrame; - vector2_1.Y -= 2f; - vector2_1.Y += drawinfo.seatYOffset; - int num1 = 2; - int num2 = 42; - int num3 = 2; - int num4 = 2; - int num5 = 0; - int num6 = 0; - switch (drawinfo.drawPlayer.legs) - { - case 132: - num1 = -2; - num6 = 2; - break; - case 143: - num1 = 0; - num2 = 40; - break; - case 193: - case 194: - if (drawinfo.drawPlayer.body == 218) - { - num1 = -2; - num6 = 2; - vector2_1.Y += 2f; - break; - } - break; - case 210: - if (glowmask) - { - Vector2 vector2_2 = new Vector2((float) Main.rand.Next(-10, 10) * 0.125f, (float) Main.rand.Next(-10, 10) * 0.125f); - vector2_1 += vector2_2; - break; - } - break; - } - for (int index = num3; index >= 0; --index) - { - Vector2 position = vector2_1 + new Vector2((float) num1, 2f) * new Vector2((float) drawinfo.drawPlayer.direction, 1f); - Rectangle rectangle = legFrame; - rectangle.Y += index * 2; - rectangle.Y += num2; - rectangle.Height -= num2; - rectangle.Height -= index * 2; - if (index != num3) - rectangle.Height = 2; - position.X += (float) (drawinfo.drawPlayer.direction * num4 * index + num5 * drawinfo.drawPlayer.direction); - if (index != 0) - position.X += (float) (num6 * drawinfo.drawPlayer.direction); - position.Y += (float) num2; - drawinfo.DrawDataCache.Add(new DrawData(textureToDraw, position, new Rectangle?(rectangle), matchingColor, drawinfo.drawPlayer.legRotation, drawinfo.legVect, 1f, drawinfo.playerEffect, 0) - { - shader = shaderIndex - }); - } - } - - public static void DrawPlayer_14_Shoes(ref PlayerDrawSet drawinfo) - { - if (drawinfo.drawPlayer.shoe <= (sbyte) 0 || drawinfo.drawPlayer.shoe >= (sbyte) 25 || PlayerDrawLayers.ShouldOverrideLegs_CheckPants(ref drawinfo)) - return; - if (drawinfo.isSitting) - PlayerDrawLayers.DrawSittingLegs(ref drawinfo, TextureAssets.AccShoes[(int) drawinfo.drawPlayer.shoe].Value, drawinfo.colorArmorLegs, drawinfo.cShoe); - else - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.AccShoes[(int) drawinfo.drawPlayer.shoe].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.legFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.legFrame.Height + 4.0)) + drawinfo.drawPlayer.legPosition + drawinfo.legVect, new Rectangle?(drawinfo.drawPlayer.legFrame), drawinfo.colorArmorLegs, drawinfo.drawPlayer.legRotation, drawinfo.legVect, 1f, drawinfo.playerEffect, 0) - { - shader = drawinfo.cShoe - }); - } - - public static void DrawPlayer_15_SkinLongCoat(ref PlayerDrawSet drawinfo) - { - if ((drawinfo.skinVar == 3 || drawinfo.skinVar == 8 ? 1 : (drawinfo.skinVar == 7 ? 1 : 0)) == 0 || drawinfo.drawPlayer.body > 0 && drawinfo.drawPlayer.body < 235 || drawinfo.drawPlayer.invis) - return; - if (drawinfo.isSitting) - { - PlayerDrawLayers.DrawSittingLegs(ref drawinfo, TextureAssets.Players[drawinfo.skinVar, 14].Value, drawinfo.colorShirt); - } - else - { - DrawData drawData = new DrawData(TextureAssets.Players[drawinfo.skinVar, 14].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.legFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.legFrame.Height + 4.0)) + drawinfo.drawPlayer.legPosition + drawinfo.legVect, new Rectangle?(drawinfo.drawPlayer.legFrame), drawinfo.colorShirt, drawinfo.drawPlayer.legRotation, drawinfo.legVect, 1f, drawinfo.playerEffect, 0); - drawinfo.DrawDataCache.Add(drawData); - } - } - - public static void DrawPlayer_16_ArmorLongCoat(ref PlayerDrawSet drawinfo) - { - int i = -1; - switch (drawinfo.drawPlayer.body) - { - case 52: - i = !drawinfo.drawPlayer.Male ? 172 : 171; - break; - case 53: - i = !drawinfo.drawPlayer.Male ? 176 : 175; - break; - case 73: - i = 170; - break; - case 168: - i = 164; - break; - case 182: - i = 163; - break; - case 187: - i = 173; - break; - case 198: - i = 162; - break; - case 200: - i = 149; - break; - case 201: - i = 150; - break; - case 202: - i = 151; - break; - case 205: - i = 174; - break; - case 207: - i = 161; - break; - case 209: - i = 160; - break; - case 210: - i = !drawinfo.drawPlayer.Male ? 177 : 178; - break; - case 211: - i = !drawinfo.drawPlayer.Male ? 181 : 182; - break; - case 218: - i = 195; - break; - case 222: - i = !drawinfo.drawPlayer.Male ? 200 : 201; - break; - case 225: - i = 206; - break; - } - if (i == -1) - return; - Main.instance.LoadArmorLegs(i); - if (drawinfo.isSitting && i != 195) - PlayerDrawLayers.DrawSittingLegs(ref drawinfo, TextureAssets.ArmorLeg[i].Value, drawinfo.colorArmorBody, drawinfo.cBody); - else - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.ArmorLeg[i].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.legFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.legFrame.Height + 4.0)) + drawinfo.drawPlayer.legPosition + drawinfo.legVect, new Rectangle?(drawinfo.drawPlayer.legFrame), drawinfo.colorArmorBody, drawinfo.drawPlayer.legRotation, drawinfo.legVect, 1f, drawinfo.playerEffect, 0) - { - shader = drawinfo.cBody - }); - } - - public static void DrawPlayer_17_Torso(ref PlayerDrawSet drawinfo) - { - if (drawinfo.usesCompositeTorso) - PlayerDrawLayers.DrawPlayer_17_TorsoComposite(ref drawinfo); - else if (drawinfo.drawPlayer.body > 0 && drawinfo.drawPlayer.body < 235) - { - Rectangle bodyFrame = drawinfo.drawPlayer.bodyFrame; - int num = drawinfo.armorAdjust; - bodyFrame.X += num; - bodyFrame.Width -= num; - if (drawinfo.drawPlayer.direction == -1) - num = 0; - if (!drawinfo.drawPlayer.invis || drawinfo.drawPlayer.body != 21 && drawinfo.drawPlayer.body != 22) - { - DrawData drawData = new DrawData(drawinfo.drawPlayer.Male ? TextureAssets.ArmorBody[drawinfo.drawPlayer.body].Value : TextureAssets.FemaleBody[drawinfo.drawPlayer.body].Value, new Vector2((float) ((int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)) + num), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)), new Rectangle?(bodyFrame), drawinfo.colorArmorBody, drawinfo.drawPlayer.bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cBody; - drawinfo.DrawDataCache.Add(drawData); - if (drawinfo.bodyGlowMask != -1) - { - drawData = new DrawData(TextureAssets.GlowMask[drawinfo.bodyGlowMask].Value, new Vector2((float) ((int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)) + num), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)), new Rectangle?(bodyFrame), drawinfo.bodyGlowColor, drawinfo.drawPlayer.bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cBody; - drawinfo.DrawDataCache.Add(drawData); - } - } - if (!drawinfo.missingHand || drawinfo.drawPlayer.invis) - return; - DrawData drawData1 = new DrawData(TextureAssets.Players[drawinfo.skinVar, 5].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorBodySkin, drawinfo.drawPlayer.bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0) - { - shader = drawinfo.skinDyePacked - }; - drawinfo.DrawDataCache.Add(drawData1); - } - else - { - if (drawinfo.drawPlayer.invis) - return; - if (!drawinfo.drawPlayer.Male) - { - DrawData drawData = new DrawData(TextureAssets.Players[drawinfo.skinVar, 4].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorUnderShirt, drawinfo.drawPlayer.bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0); - drawinfo.DrawDataCache.Add(drawData); - drawData = new DrawData(TextureAssets.Players[drawinfo.skinVar, 6].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorShirt, drawinfo.drawPlayer.bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0); - drawinfo.DrawDataCache.Add(drawData); - } - else - { - DrawData drawData = new DrawData(TextureAssets.Players[drawinfo.skinVar, 4].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorUnderShirt, drawinfo.drawPlayer.bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0); - drawinfo.DrawDataCache.Add(drawData); - drawData = new DrawData(TextureAssets.Players[drawinfo.skinVar, 6].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorShirt, drawinfo.drawPlayer.bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0); - drawinfo.DrawDataCache.Add(drawData); - } - DrawData drawData2 = new DrawData(TextureAssets.Players[drawinfo.skinVar, 5].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorBodySkin, drawinfo.drawPlayer.bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0) - { - shader = drawinfo.skinDyePacked - }; - drawinfo.DrawDataCache.Add(drawData2); - } - } - - public static void DrawPlayer_17_TorsoComposite(ref PlayerDrawSet drawinfo) - { - Vector2 vector2_1 = new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)); - Vector2 vector2_2 = Main.OffsetsPlayerHeadgear[drawinfo.drawPlayer.bodyFrame.Y / drawinfo.drawPlayer.bodyFrame.Height]; - vector2_2.Y -= 2f; - Vector2 position = vector2_1 + vector2_2 * (float) -drawinfo.playerEffect.HasFlag((Enum) SpriteEffects.FlipVertically).ToDirectionInt(); - float bodyRotation = drawinfo.drawPlayer.bodyRotation; - Vector2 vector2_3 = position; - Vector2 bodyVect = drawinfo.bodyVect; - Vector2 compositeOffsetBackArm = PlayerDrawLayers.GetCompositeOffset_BackArm(ref drawinfo); - Vector2 vector2_4 = compositeOffsetBackArm; - Vector2 vector2_5 = vector2_3 + vector2_4; - Vector2 vector2_6 = bodyVect + compositeOffsetBackArm; - DrawData drawData1; - if (drawinfo.drawPlayer.body > 0 && drawinfo.drawPlayer.body < 235) - { - if (!drawinfo.drawPlayer.invis || PlayerDrawLayers.IsArmorDrawnWhenInvisible(drawinfo.drawPlayer.body)) - { - Texture2D texture = TextureAssets.ArmorBodyComposite[drawinfo.drawPlayer.body].Value; - ref PlayerDrawSet local = ref drawinfo; - drawData1 = new DrawData(texture, position, new Rectangle?(drawinfo.compTorsoFrame), drawinfo.colorArmorBody, bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0); - drawData1.shader = drawinfo.cBody; - DrawData data = drawData1; - PlayerDrawLayers.DrawCompositeArmorPiece(ref local, CompositePlayerDrawContext.Torso, data); - } - } - else if (!drawinfo.drawPlayer.invis) - { - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.Players[drawinfo.skinVar, 4].Value, position, new Rectangle?(drawinfo.compBackShoulderFrame), drawinfo.colorUnderShirt, bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0)); - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.Players[drawinfo.skinVar, 6].Value, position, new Rectangle?(drawinfo.compBackShoulderFrame), drawinfo.colorShirt, bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0)); - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.Players[drawinfo.skinVar, 4].Value, position, new Rectangle?(drawinfo.compTorsoFrame), drawinfo.colorUnderShirt, bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0)); - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.Players[drawinfo.skinVar, 6].Value, position, new Rectangle?(drawinfo.compTorsoFrame), drawinfo.colorShirt, bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0)); - } - if (!drawinfo.drawFloatingTube) - return; - List drawDataCache = drawinfo.DrawDataCache; - drawData1 = new DrawData(TextureAssets.Extra[105].Value, position, new Rectangle?(new Rectangle(0, 56, 40, 56)), drawinfo.floatingTubeColor, bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0); - drawData1.shader = drawinfo.cFloatingTube; - DrawData drawData2 = drawData1; - drawDataCache.Add(drawData2); - } - - public static void DrawPlayer_18_OffhandAcc(ref PlayerDrawSet drawinfo) - { - if (drawinfo.usesCompositeBackHandAcc || drawinfo.drawPlayer.handoff <= (sbyte) 0 || drawinfo.drawPlayer.handoff >= (sbyte) 14) - return; - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.AccHandsOff[(int) drawinfo.drawPlayer.handoff].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorArmorBody, drawinfo.drawPlayer.bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0) - { - shader = drawinfo.cHandOff - }); - } - - public static void DrawPlayer_19_WaistAcc(ref PlayerDrawSet drawinfo) - { - if (drawinfo.drawPlayer.waist <= (sbyte) 0 || drawinfo.drawPlayer.waist >= (sbyte) 17) - return; - Rectangle rectangle = drawinfo.drawPlayer.legFrame; - if (ArmorIDs.Waist.Sets.UsesTorsoFraming[(int) drawinfo.drawPlayer.waist]) - rectangle = drawinfo.drawPlayer.bodyFrame; - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.AccWaist[(int) drawinfo.drawPlayer.waist].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.legFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.legFrame.Height + 4.0)) + drawinfo.drawPlayer.legPosition + drawinfo.legVect, new Rectangle?(rectangle), drawinfo.colorArmorLegs, drawinfo.drawPlayer.legRotation, drawinfo.legVect, 1f, drawinfo.playerEffect, 0) - { - shader = drawinfo.cWaist - }); - } - - public static void DrawPlayer_20_NeckAcc(ref PlayerDrawSet drawinfo) - { - if (drawinfo.drawPlayer.neck <= (sbyte) 0 || drawinfo.drawPlayer.neck >= (sbyte) 11) - return; - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.AccNeck[(int) drawinfo.drawPlayer.neck].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorArmorBody, drawinfo.drawPlayer.bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0) - { - shader = drawinfo.cNeck - }); - } - - public static void DrawPlayer_21_Head(ref PlayerDrawSet drawinfo) - { - Vector2 helmetOffset = drawinfo.helmetOffset; - PlayerDrawLayers.DrawPlayer_21_Head_TheFace(ref drawinfo); - bool flag1 = drawinfo.drawPlayer.head == 14 || drawinfo.drawPlayer.head == 56 || drawinfo.drawPlayer.head == 114 || drawinfo.drawPlayer.head == 158 || drawinfo.drawPlayer.head == 69 || drawinfo.drawPlayer.head == 180; - bool flag2 = drawinfo.drawPlayer.head == 28; - bool flag3 = drawinfo.drawPlayer.head == 39 || drawinfo.drawPlayer.head == 38; - DrawData drawData; - if (drawinfo.fullHair) - { - drawData = new DrawData(TextureAssets.ArmorHead[drawinfo.drawPlayer.head].Value, helmetOffset + new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorArmorHead, drawinfo.drawPlayer.headRotation, drawinfo.headVect, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cHead; - drawinfo.DrawDataCache.Add(drawData); - if (!drawinfo.drawPlayer.invis) - { - drawData = new DrawData(TextureAssets.PlayerHair[drawinfo.drawPlayer.hair].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.hairFrame), drawinfo.colorHair, drawinfo.drawPlayer.headRotation, drawinfo.headVect, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.hairDyePacked; - drawinfo.DrawDataCache.Add(drawData); - } - } - if (drawinfo.hatHair && !drawinfo.drawPlayer.invis) - { - drawData = new DrawData(TextureAssets.PlayerHairAlt[drawinfo.drawPlayer.hair].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.hairFrame), drawinfo.colorHair, drawinfo.drawPlayer.headRotation, drawinfo.headVect, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.hairDyePacked; - drawinfo.DrawDataCache.Add(drawData); - } - if (drawinfo.drawPlayer.head == 23) - { - if (!drawinfo.drawPlayer.invis) - { - drawData = new DrawData(TextureAssets.PlayerHair[drawinfo.drawPlayer.hair].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.hairFrame), drawinfo.colorHair, drawinfo.drawPlayer.headRotation, drawinfo.headVect, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.hairDyePacked; - drawinfo.DrawDataCache.Add(drawData); - } - drawData = new DrawData(TextureAssets.ArmorHead[drawinfo.drawPlayer.head].Value, helmetOffset + new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorArmorHead, drawinfo.drawPlayer.headRotation, drawinfo.headVect, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cHead; - drawinfo.DrawDataCache.Add(drawData); - } - else if (flag1) - { - Rectangle bodyFrame = drawinfo.drawPlayer.bodyFrame; - Vector2 headVect = drawinfo.headVect; - if ((double) drawinfo.drawPlayer.gravDir == 1.0) - { - if (bodyFrame.Y != 0) - { - bodyFrame.Y -= 2; - bodyFrame.Height -= 8; - headVect.Y += 2f; - } - } - else if (bodyFrame.Y != 0) - { - bodyFrame.Y -= 2; - headVect.Y -= 10f; - bodyFrame.Height -= 8; - } - drawData = new DrawData(TextureAssets.ArmorHead[drawinfo.drawPlayer.head].Value, helmetOffset + new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(bodyFrame), drawinfo.colorArmorHead, drawinfo.drawPlayer.headRotation, headVect, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cHead; - drawinfo.DrawDataCache.Add(drawData); - } - else if (drawinfo.drawPlayer.head == 259) - { - int verticalFrames = 27; - Texture2D texture2D = TextureAssets.ArmorHead[drawinfo.drawPlayer.head].Value; - Rectangle r = texture2D.Frame(verticalFrames: verticalFrames, frameY: drawinfo.drawPlayer.rabbitOrderFrame.DisplayFrame); - Vector2 origin = r.Size() / 2f; - int num1 = drawinfo.drawPlayer.babyBird.ToInt(); - Vector2 specialHatDrawPosition = PlayerDrawLayers.DrawPlayer_21_Head_GetSpecialHatDrawPosition(ref drawinfo, ref helmetOffset, new Vector2((float) (1 + num1 * 2), (float) (drawinfo.drawPlayer.babyBird.ToInt() * -6 - 26))); - int hatStacks = PlayerDrawLayers.DrawPlayer_21_head_GetHatStacks(ref drawinfo, 4955); - float num2 = (float) Math.PI / 60f; - float num3 = (float) ((double) num2 * (double) drawinfo.drawPlayer.position.X % 6.28318548202515); - for (int index = hatStacks - 1; index >= 0; --index) - { - float x = (float) ((double) Vector2.UnitY.RotatedBy((double) num3 + (double) num2 * (double) index).X * ((double) index / 30.0) * 2.0) - (float) (index * 2 * drawinfo.drawPlayer.direction); - drawData = new DrawData(texture2D, specialHatDrawPosition + new Vector2(x, (float) (index * -14) * drawinfo.drawPlayer.gravDir), new Rectangle?(r), drawinfo.colorArmorHead, drawinfo.drawPlayer.headRotation, origin, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cHead; - drawinfo.DrawDataCache.Add(drawData); - } - if (!drawinfo.drawPlayer.invis) - { - drawData = new DrawData(TextureAssets.PlayerHair[drawinfo.drawPlayer.hair].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.hairFrame), drawinfo.colorHair, drawinfo.drawPlayer.headRotation, drawinfo.headVect, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.hairDyePacked; - drawinfo.DrawDataCache.Add(drawData); - } - } - else if (drawinfo.drawPlayer.head > 0 && drawinfo.drawPlayer.head < 266 && !flag2) - { - if (!(drawinfo.drawPlayer.invis & flag3)) - { - if (drawinfo.drawPlayer.head == 13) - { - int num4 = 0; - int index1 = 0; - if (drawinfo.drawPlayer.armor[index1] != null && drawinfo.drawPlayer.armor[index1].type == 205 && drawinfo.drawPlayer.armor[index1].stack > 0) - num4 += drawinfo.drawPlayer.armor[index1].stack; - int index2 = 10; - if (drawinfo.drawPlayer.armor[index2] != null && drawinfo.drawPlayer.armor[index2].type == 205 && drawinfo.drawPlayer.armor[index2].stack > 0) - num4 += drawinfo.drawPlayer.armor[index2].stack; - float num5 = (float) Math.PI / 60f; - float num6 = (float) ((double) num5 * (double) drawinfo.drawPlayer.position.X % 6.28318548202515); - for (int index3 = 0; index3 < num4; ++index3) - { - float num7 = (float) ((double) Vector2.UnitY.RotatedBy((double) num6 + (double) num5 * (double) index3).X * ((double) index3 / 30.0) * 2.0); - drawData = new DrawData(TextureAssets.ArmorHead[drawinfo.drawPlayer.head].Value, helmetOffset + new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)) + num7, (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0 - (double) (4 * index3))) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorArmorHead, drawinfo.drawPlayer.headRotation, drawinfo.headVect, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cHead; - drawinfo.DrawDataCache.Add(drawData); - } - } - else if (drawinfo.drawPlayer.head == 265) - { - int verticalFrames = 6; - Texture2D texture2D = TextureAssets.ArmorHead[drawinfo.drawPlayer.head].Value; - Rectangle r = texture2D.Frame(verticalFrames: verticalFrames, frameY: drawinfo.drawPlayer.rabbitOrderFrame.DisplayFrame); - Vector2 origin = r.Size() / 2f; - Vector2 specialHatDrawPosition = PlayerDrawLayers.DrawPlayer_21_Head_GetSpecialHatDrawPosition(ref drawinfo, ref helmetOffset, new Vector2(0.0f, -9f)); - int hatStacks = PlayerDrawLayers.DrawPlayer_21_head_GetHatStacks(ref drawinfo, 5004); - float num8 = (float) Math.PI / 60f; - float num9 = (float) ((double) num8 * (double) drawinfo.drawPlayer.position.X % 6.28318548202515); - int num10 = hatStacks * 4 + 2; - int num11 = 0; - bool flag4 = ((double) Main.GlobalTimeWrappedHourly + 180.0) % 3600.0 < 60.0; - for (int index = num10 - 1; index >= 0; --index) - { - int num12 = 0; - if (index == num10 - 1) - { - r.Y = 0; - num12 = 2; - } - else - r.Y = index != 0 ? r.Height * (num11++ % 4 + 1) : r.Height * 5; - if (!(r.Y == r.Height * 3 & flag4)) - { - float x = (float) ((double) Vector2.UnitY.RotatedBy((double) num9 + (double) num8 * (double) index).X * ((double) index / 10.0) * 4.0 - (double) index * 0.100000001490116 * (double) drawinfo.drawPlayer.direction); - drawData = new DrawData(texture2D, specialHatDrawPosition + new Vector2(x, (float) (index * -4 + num12) * drawinfo.drawPlayer.gravDir), new Rectangle?(r), drawinfo.colorArmorHead, drawinfo.drawPlayer.headRotation, origin, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cHead; - drawinfo.DrawDataCache.Add(drawData); - } - } - } - else - { - drawData = new DrawData(TextureAssets.ArmorHead[drawinfo.drawPlayer.head].Value, helmetOffset + new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorArmorHead, drawinfo.drawPlayer.headRotation, drawinfo.headVect, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cHead; - drawinfo.DrawDataCache.Add(drawData); - if (drawinfo.headGlowMask != -1) - { - if (drawinfo.headGlowMask == 273) - { - for (int index = 0; index < 2; ++index) - { - Vector2 vector2 = new Vector2((float) Main.rand.Next(-10, 10) * 0.125f, (float) Main.rand.Next(-10, 10) * 0.125f); - drawData = new DrawData(TextureAssets.GlowMask[drawinfo.headGlowMask].Value, vector2 + helmetOffset + new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.headGlowColor, drawinfo.drawPlayer.headRotation, drawinfo.headVect, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cHead; - drawinfo.DrawDataCache.Add(drawData); - } - } - else - { - drawData = new DrawData(TextureAssets.GlowMask[drawinfo.headGlowMask].Value, helmetOffset + new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.headGlowColor, drawinfo.drawPlayer.headRotation, drawinfo.headVect, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cHead; - drawinfo.DrawDataCache.Add(drawData); - } - } - if (drawinfo.drawPlayer.head == 211) - { - Color color = new Color(100, 100, 100, 0); - ulong seed = (ulong) (drawinfo.drawPlayer.miscCounter / 4 + 100); - int num = 4; - for (int index = 0; index < num; ++index) - { - float x = (float) Utils.RandomInt(ref seed, -10, 11) * 0.2f; - float y = (float) Utils.RandomInt(ref seed, -14, 1) * 0.15f; - drawData = new DrawData(TextureAssets.GlowMask[241].Value, helmetOffset + new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect + new Vector2(x, y), new Rectangle?(drawinfo.drawPlayer.bodyFrame), color, drawinfo.drawPlayer.headRotation, drawinfo.headVect, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cHead; - drawinfo.DrawDataCache.Add(drawData); - } - } - } - } - } - else if (!drawinfo.drawPlayer.invis && (drawinfo.drawPlayer.face < (sbyte) 0 || !ArmorIDs.Face.Sets.PreventHairDraw[(int) drawinfo.drawPlayer.face])) - { - if (drawinfo.drawPlayer.face == (sbyte) 5) - { - drawData = new DrawData(TextureAssets.AccFace[(int) drawinfo.drawPlayer.face].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorArmorHead, drawinfo.drawPlayer.headRotation, drawinfo.headVect, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cFace; - drawinfo.DrawDataCache.Add(drawData); - } - drawData = new DrawData(TextureAssets.PlayerHair[drawinfo.drawPlayer.hair].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.hairFrame), drawinfo.colorHair, drawinfo.drawPlayer.headRotation, drawinfo.headVect, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.hairDyePacked; - drawinfo.DrawDataCache.Add(drawData); - } - if (drawinfo.drawPlayer.head == 205) - { - drawData = new DrawData(TextureAssets.Extra[77].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorHead, drawinfo.drawPlayer.headRotation, drawinfo.headVect, 1f, drawinfo.playerEffect, 0) - { - shader = drawinfo.skinDyePacked - }; - drawinfo.DrawDataCache.Add(drawData); - } - if (drawinfo.drawPlayer.head == 214 && !drawinfo.drawPlayer.invis) - { - Rectangle bodyFrame = drawinfo.drawPlayer.bodyFrame; - bodyFrame.Y = 0; - float t = (float) drawinfo.drawPlayer.miscCounter / 300f; - Color color = new Color(0, 0, 0, 0); - float from = 0.8f; - float to = 0.9f; - if ((double) t >= (double) from) - color = Color.Lerp(Color.Transparent, new Color(200, 200, 200, 0), Utils.GetLerpValue(from, to, t, true)); - if ((double) t >= (double) to) - color = Color.Lerp(Color.Transparent, new Color(200, 200, 200, 0), Utils.GetLerpValue(1f, to, t, true)); - color *= drawinfo.stealth * (1f - drawinfo.shadow); - drawData = new DrawData(TextureAssets.Extra[90].Value, helmetOffset + new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect - Main.OffsetsPlayerHeadgear[drawinfo.drawPlayer.bodyFrame.Y / drawinfo.drawPlayer.bodyFrame.Height], new Rectangle?(bodyFrame), color, drawinfo.drawPlayer.headRotation, drawinfo.headVect, 1f, drawinfo.playerEffect, 0); - drawinfo.DrawDataCache.Add(drawData); - } - if (drawinfo.drawPlayer.head == 137) - { - drawData = new DrawData(TextureAssets.JackHat.Value, helmetOffset + new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.drawPlayer.bodyFrame), new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue), drawinfo.drawPlayer.headRotation, drawinfo.headVect, 1f, drawinfo.playerEffect, 0); - drawinfo.DrawDataCache.Add(drawData); - for (int index = 0; index < 7; ++index) - { - Color color = new Color(110 - index * 10, 110 - index * 10, 110 - index * 10, 110 - index * 10); - Vector2 vector2 = new Vector2((float) Main.rand.Next(-10, 11) * 0.2f, (float) Main.rand.Next(-10, 11) * 0.2f); - vector2.X = drawinfo.drawPlayer.itemFlamePos[index].X; - vector2.Y = drawinfo.drawPlayer.itemFlamePos[index].Y; - vector2 *= 0.5f; - drawData = new DrawData(TextureAssets.JackHat.Value, helmetOffset + new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect + vector2, new Rectangle?(drawinfo.drawPlayer.bodyFrame), color, drawinfo.drawPlayer.headRotation, drawinfo.headVect, 1f, drawinfo.playerEffect, 0); - drawinfo.DrawDataCache.Add(drawData); - } - } - if (!drawinfo.drawPlayer.babyBird) - return; - Rectangle bodyFrame1 = drawinfo.drawPlayer.bodyFrame; - bodyFrame1.Y = 0; - drawData = new DrawData(TextureAssets.Extra[100].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect + Main.OffsetsPlayerHeadgear[drawinfo.drawPlayer.bodyFrame.Y / drawinfo.drawPlayer.bodyFrame.Height] * drawinfo.drawPlayer.gravDir, new Rectangle?(bodyFrame1), drawinfo.colorArmorHead, drawinfo.drawPlayer.headRotation, drawinfo.headVect, 1f, drawinfo.playerEffect, 0); - drawinfo.DrawDataCache.Add(drawData); - } - - private static int DrawPlayer_21_head_GetHatStacks(ref PlayerDrawSet drawinfo, int hatItemId) - { - int num = 0; - int index1 = 0; - if (drawinfo.drawPlayer.armor[index1] != null && drawinfo.drawPlayer.armor[index1].type == hatItemId && drawinfo.drawPlayer.armor[index1].stack > 0) - num += drawinfo.drawPlayer.armor[index1].stack; - int index2 = 10; - if (drawinfo.drawPlayer.armor[index2] != null && drawinfo.drawPlayer.armor[index2].type == hatItemId && drawinfo.drawPlayer.armor[index2].stack > 0) - num += drawinfo.drawPlayer.armor[index2].stack; - return num; - } - - private static Vector2 DrawPlayer_21_Head_GetSpecialHatDrawPosition( - ref PlayerDrawSet drawinfo, - ref Vector2 helmetOffset, - Vector2 hatOffset) - { - Vector2 vector2 = Main.OffsetsPlayerHeadgear[drawinfo.drawPlayer.bodyFrame.Y / drawinfo.drawPlayer.bodyFrame.Height] * drawinfo.drawPlayer.Directions; - Vector2 vec = (drawinfo.Position - Main.screenPosition + helmetOffset + new Vector2((float) (-drawinfo.drawPlayer.bodyFrame.Width / 2 + drawinfo.drawPlayer.width / 2), (float) (drawinfo.drawPlayer.height - drawinfo.drawPlayer.bodyFrame.Height + 4)) + hatOffset * drawinfo.drawPlayer.Directions + vector2).Floor() + (drawinfo.drawPlayer.headPosition + drawinfo.headVect); - if ((double) drawinfo.drawPlayer.gravDir == -1.0) - vec.Y += 12f; - vec = vec.Floor(); - return vec; - } - - private static void DrawPlayer_21_Head_TheFace(ref PlayerDrawSet drawinfo) - { - bool flag = drawinfo.drawPlayer.head == 38 && drawinfo.drawPlayer.head == 135; - if (drawinfo.drawPlayer.invis || flag) - return; - DrawData drawData1 = new DrawData(TextureAssets.Players[drawinfo.skinVar, 0].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorHead, drawinfo.drawPlayer.headRotation, drawinfo.headVect, 1f, drawinfo.playerEffect, 0); - drawData1.shader = drawinfo.skinDyePacked; - DrawData drawData2 = drawData1; - drawinfo.DrawDataCache.Add(drawData2); - drawData2 = new DrawData(TextureAssets.Players[drawinfo.skinVar, 1].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorEyeWhites, drawinfo.drawPlayer.headRotation, drawinfo.headVect, 1f, drawinfo.playerEffect, 0); - drawinfo.DrawDataCache.Add(drawData2); - drawData2 = new DrawData(TextureAssets.Players[drawinfo.skinVar, 2].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorEyes, drawinfo.drawPlayer.headRotation, drawinfo.headVect, 1f, drawinfo.playerEffect, 0); - drawinfo.DrawDataCache.Add(drawData2); - Asset player = TextureAssets.Players[drawinfo.skinVar, 15]; - if (player.IsLoaded) - { - Vector2 vector2 = Main.OffsetsPlayerHeadgear[drawinfo.drawPlayer.bodyFrame.Y / drawinfo.drawPlayer.bodyFrame.Height]; - vector2.Y -= 2f; - Rectangle rectangle = player.Frame(verticalFrames: 3, frameY: drawinfo.drawPlayer.eyeHelper.EyeFrameToShow); - drawData1 = new DrawData(player.Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect + vector2, new Rectangle?(rectangle), drawinfo.colorHead, drawinfo.drawPlayer.headRotation, drawinfo.headVect, 1f, drawinfo.playerEffect, 0); - drawData1.shader = drawinfo.skinDyePacked; - DrawData drawData3 = drawData1; - drawinfo.DrawDataCache.Add(drawData3); - } - if (!drawinfo.drawPlayer.yoraiz0rDarkness) - return; - drawData1 = new DrawData(TextureAssets.Extra[67].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorHead, drawinfo.drawPlayer.headRotation, drawinfo.headVect, 1f, drawinfo.playerEffect, 0); - drawData1.shader = drawinfo.skinDyePacked; - DrawData drawData4 = drawData1; - drawinfo.DrawDataCache.Add(drawData4); - } - - public static void DrawPlayer_22_FaceAcc(ref PlayerDrawSet drawinfo) - { - DrawData drawData; - if (drawinfo.drawPlayer.face > (sbyte) 0 && drawinfo.drawPlayer.face < (sbyte) 16 && drawinfo.drawPlayer.face != (sbyte) 5) - { - if (drawinfo.drawPlayer.face == (sbyte) 7) - { - drawData = new DrawData(TextureAssets.AccFace[(int) drawinfo.drawPlayer.face].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.drawPlayer.bodyFrame), new Color(200, 200, 200, 150), drawinfo.drawPlayer.headRotation, drawinfo.headVect, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cFace; - drawinfo.DrawDataCache.Add(drawData); - } - else - { - drawData = new DrawData(TextureAssets.AccFace[(int) drawinfo.drawPlayer.face].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorArmorHead, drawinfo.drawPlayer.headRotation, drawinfo.headVect, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cFace; - drawinfo.DrawDataCache.Add(drawData); - } - } - if (!drawinfo.drawUnicornHorn) - return; - drawData = new DrawData(TextureAssets.Extra[143].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.headPosition + drawinfo.headVect, new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorArmorHead, drawinfo.drawPlayer.headRotation, drawinfo.headVect, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cUnicornHorn; - drawinfo.DrawDataCache.Add(drawData); - } - - public static void DrawTiedBalloons(ref PlayerDrawSet drawinfo) - { - if (drawinfo.drawPlayer.mount.Type != 34) - return; - Texture2D texture2D = TextureAssets.Extra[141].Value; - Vector2 vector2 = new Vector2(0.0f, 4f); - Color colorMount = drawinfo.colorMount; - int frameY = (int) ((double) Main.GlobalTimeWrappedHourly * 3.0 + (double) drawinfo.drawPlayer.position.X / 50.0) % 3; - Rectangle rectangle = texture2D.Frame(verticalFrames: 3, frameY: frameY); - Vector2 origin = new Vector2((float) (rectangle.Width / 2), (float) rectangle.Height); - float rotation = (float) (-(double) drawinfo.drawPlayer.velocity.X * 0.100000001490116) - drawinfo.drawPlayer.fullRotation; - DrawData drawData = new DrawData(texture2D, drawinfo.drawPlayer.MountedCenter + vector2 - Main.screenPosition, new Rectangle?(rectangle), colorMount, rotation, origin, 1f, drawinfo.playerEffect, 0); - drawinfo.DrawDataCache.Add(drawData); - } - - public static void DrawStarboardRainbowTrail( - ref PlayerDrawSet drawinfo, - Vector2 commonWingPosPreFloor, - Vector2 dirsVec) - { - if ((double) drawinfo.shadow != 0.0) - return; - int num1 = Math.Min(drawinfo.drawPlayer.availableAdvancedShadowsCount - 1, 30); - float num2 = 0.0f; - for (int shadowIndex = num1; shadowIndex > 0; --shadowIndex) - { - EntityShadowInfo advancedShadow1 = drawinfo.drawPlayer.GetAdvancedShadow(shadowIndex); - EntityShadowInfo advancedShadow2 = drawinfo.drawPlayer.GetAdvancedShadow(shadowIndex - 1); - num2 += Vector2.Distance(advancedShadow1.Position, advancedShadow2.Position); - } - float num3 = MathHelper.Clamp(num2 / 160f, 0.0f, 1f); - Main.instance.LoadProjectile(250); - Texture2D texture = TextureAssets.Projectile[250].Value; - float x = 1.7f; - Vector2 origin = new Vector2((float) (texture.Width / 2), (float) (texture.Height / 2)); - Vector2 vector2_1 = new Vector2((float) drawinfo.drawPlayer.width, (float) drawinfo.drawPlayer.height) / 2f; - Color white = Color.White; - white.A = (byte) 64; - Vector2 vector2_2 = drawinfo.drawPlayer.DefaultSize * new Vector2(0.5f, 1f) + new Vector2(0.0f, -4f); - for (int shadowIndex = num1; shadowIndex > 0; --shadowIndex) - { - EntityShadowInfo advancedShadow3 = drawinfo.drawPlayer.GetAdvancedShadow(shadowIndex); - EntityShadowInfo advancedShadow4 = drawinfo.drawPlayer.GetAdvancedShadow(shadowIndex - 1); - Vector2 pos1 = advancedShadow3.Position + vector2_2 + advancedShadow3.HeadgearOffset; - Vector2 pos2 = advancedShadow4.Position + vector2_2 + advancedShadow4.HeadgearOffset; - Vector2 vector2_3 = drawinfo.drawPlayer.RotatedRelativePoint(pos1, true, false); - Vector2 vector2_4 = drawinfo.drawPlayer.RotatedRelativePoint(pos2, true, false); - float num4 = (vector2_4 - vector2_3).ToRotation() - 1.570796f; - float rotation = 1.570796f * (float) drawinfo.drawPlayer.direction; - float t = Math.Abs(vector2_4.X - vector2_3.X); - Vector2 scale = new Vector2(x, t / (float) texture.Height); - float num5 = (float) (1.0 - (double) shadowIndex / (double) num1); - float num6 = num5 * num5 * Utils.GetLerpValue(0.0f, 4f, t, true) * 0.5f; - float num7 = num6 * num6; - Color color = white * num7 * num3; - if (!(color == Color.Transparent)) - { - DrawData drawData = new DrawData(texture, vector2_3 - Main.screenPosition, new Rectangle?(), color, rotation, origin, scale, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cWings; - drawinfo.DrawDataCache.Add(drawData); - for (float amount = 0.25f; (double) amount < 1.0; amount += 0.25f) - { - drawData = new DrawData(texture, Vector2.Lerp(vector2_3, vector2_4, amount) - Main.screenPosition, new Rectangle?(), color, rotation, origin, scale, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cWings; - drawinfo.DrawDataCache.Add(drawData); - } - } - } - } - - public static void DrawMeowcartTrail(ref PlayerDrawSet drawinfo) - { - if (drawinfo.drawPlayer.mount.Type != 33) - return; - int num1 = Math.Min(drawinfo.drawPlayer.availableAdvancedShadowsCount - 1, 20); - float num2 = 0.0f; - for (int shadowIndex = num1; shadowIndex > 0; --shadowIndex) - { - EntityShadowInfo advancedShadow1 = drawinfo.drawPlayer.GetAdvancedShadow(shadowIndex); - EntityShadowInfo advancedShadow2 = drawinfo.drawPlayer.GetAdvancedShadow(shadowIndex - 1); - num2 += Vector2.Distance(advancedShadow1.Position, advancedShadow2.Position); - } - float num3 = MathHelper.Clamp(num2 / 160f, 0.0f, 1f); - Main.instance.LoadProjectile(250); - Texture2D texture = TextureAssets.Projectile[250].Value; - float x = 1.5f; - Vector2 origin = new Vector2((float) (texture.Width / 2), 0.0f); - Vector2 vector2_1 = new Vector2((float) drawinfo.drawPlayer.width, (float) drawinfo.drawPlayer.height) / 2f; - Vector2 vector2_2 = new Vector2((float) (-drawinfo.drawPlayer.direction * 10), 15f); - Color white = Color.White; - white.A = (byte) 127; - Vector2 vector2_3 = vector2_2; - Vector2 vector2_4 = vector2_1 + vector2_3; - Vector2 zero = Vector2.Zero; - Vector2 vector2_5 = drawinfo.drawPlayer.RotatedRelativePoint(drawinfo.drawPlayer.Center + zero + vector2_2) - drawinfo.drawPlayer.position; - for (int shadowIndex = num1; shadowIndex > 0; --shadowIndex) - { - EntityShadowInfo advancedShadow3 = drawinfo.drawPlayer.GetAdvancedShadow(shadowIndex); - EntityShadowInfo advancedShadow4 = drawinfo.drawPlayer.GetAdvancedShadow(shadowIndex - 1); - Vector2 vector2_6 = advancedShadow3.Position + zero; - Vector2 vector2_7 = advancedShadow4.Position + zero; - Vector2 pos1 = vector2_6 + vector2_5; - Vector2 pos2 = vector2_7 + vector2_5; - Vector2 vector2_8 = drawinfo.drawPlayer.RotatedRelativePoint(pos1, true, false); - Vector2 vector2_9 = drawinfo.drawPlayer.RotatedRelativePoint(pos2, true, false); - float rotation = (vector2_9 - vector2_8).ToRotation() - 1.570796f; - float num4 = Vector2.Distance(vector2_8, vector2_9); - Vector2 scale = new Vector2(x, num4 / (float) texture.Height); - float num5 = (float) (1.0 - (double) shadowIndex / (double) num1); - float num6 = num5 * num5; - Color color = white * num6 * num3; - DrawData drawData = new DrawData(texture, vector2_8 - Main.screenPosition, new Rectangle?(), color, rotation, origin, scale, drawinfo.playerEffect, 0); - drawinfo.DrawDataCache.Add(drawData); - } - } - - public static void DrawPlayer_23_MountFront(ref PlayerDrawSet drawinfo) - { - if (!drawinfo.drawPlayer.mount.Active) - return; - drawinfo.drawPlayer.mount.Draw(drawinfo.DrawDataCache, 2, drawinfo.drawPlayer, drawinfo.Position, drawinfo.colorMount, drawinfo.playerEffect, drawinfo.shadow); - drawinfo.drawPlayer.mount.Draw(drawinfo.DrawDataCache, 3, drawinfo.drawPlayer, drawinfo.Position, drawinfo.colorMount, drawinfo.playerEffect, drawinfo.shadow); - } - - public static void DrawPlayer_24_Pulley(ref PlayerDrawSet drawinfo) - { - if (!drawinfo.drawPlayer.pulley || drawinfo.drawPlayer.itemAnimation != 0) - return; - if (drawinfo.drawPlayer.pulleyDir == (byte) 2) - { - int num1 = -25; - int num2 = 0; - float rotation = 0.0f; - DrawData drawData = new DrawData(TextureAssets.Pulley.Value, new Vector2((float) ((int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X + (double) (drawinfo.drawPlayer.width / 2) - (double) (9 * drawinfo.drawPlayer.direction)) + num2 * drawinfo.drawPlayer.direction), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) (drawinfo.drawPlayer.height / 2) + 2.0 * (double) drawinfo.drawPlayer.gravDir + (double) num1 * (double) drawinfo.drawPlayer.gravDir)), new Rectangle?(new Rectangle(0, TextureAssets.Pulley.Height() / 2 * drawinfo.drawPlayer.pulleyFrame, TextureAssets.Pulley.Width(), TextureAssets.Pulley.Height() / 2)), drawinfo.colorArmorHead, rotation, new Vector2((float) (TextureAssets.Pulley.Width() / 2), (float) (TextureAssets.Pulley.Height() / 4)), 1f, drawinfo.playerEffect, 0); - drawinfo.DrawDataCache.Add(drawData); - } - else - { - int num3 = -26; - int num4 = 10; - float rotation = 0.35f * (float) -drawinfo.drawPlayer.direction; - DrawData drawData = new DrawData(TextureAssets.Pulley.Value, new Vector2((float) ((int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X + (double) (drawinfo.drawPlayer.width / 2) - (double) (9 * drawinfo.drawPlayer.direction)) + num4 * drawinfo.drawPlayer.direction), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) (drawinfo.drawPlayer.height / 2) + 2.0 * (double) drawinfo.drawPlayer.gravDir + (double) num3 * (double) drawinfo.drawPlayer.gravDir)), new Rectangle?(new Rectangle(0, TextureAssets.Pulley.Height() / 2 * drawinfo.drawPlayer.pulleyFrame, TextureAssets.Pulley.Width(), TextureAssets.Pulley.Height() / 2)), drawinfo.colorArmorHead, rotation, new Vector2((float) (TextureAssets.Pulley.Width() / 2), (float) (TextureAssets.Pulley.Height() / 4)), 1f, drawinfo.playerEffect, 0); - drawinfo.DrawDataCache.Add(drawData); - } - } - - public static void DrawPlayer_25_Shield(ref PlayerDrawSet drawinfo) - { - if (drawinfo.drawPlayer.shield <= (sbyte) 0 || drawinfo.drawPlayer.shield >= (sbyte) 10) - return; - Vector2 zero1 = Vector2.Zero; - if (drawinfo.drawPlayer.shieldRaised) - zero1.Y -= 4f * drawinfo.drawPlayer.gravDir; - Rectangle bodyFrame = drawinfo.drawPlayer.bodyFrame; - Vector2 zero2 = Vector2.Zero; - Vector2 bodyVect = drawinfo.bodyVect; - if (bodyFrame.Width != TextureAssets.AccShield[(int) drawinfo.drawPlayer.shield].Value.Width) - { - bodyFrame.Width = TextureAssets.AccShield[(int) drawinfo.drawPlayer.shield].Value.Width; - bodyVect.X += (float) (bodyFrame.Width - TextureAssets.AccShield[(int) drawinfo.drawPlayer.shield].Value.Width); - if (drawinfo.playerEffect.HasFlag((Enum) SpriteEffects.FlipHorizontally)) - bodyVect.X = (float) bodyFrame.Width - bodyVect.X; - } - DrawData drawData; - if (drawinfo.drawPlayer.shieldRaised) - { - float num1 = (float) Math.Sin((double) Main.GlobalTimeWrappedHourly * 6.28318548202515); - float x = (float) (2.5 + 1.5 * (double) num1); - Color colorArmorBody = drawinfo.colorArmorBody; - colorArmorBody.A = (byte) 0; - colorArmorBody *= (float) (0.449999988079071 - (double) num1 * 0.150000005960464); - for (float num2 = 0.0f; (double) num2 < 4.0; ++num2) - { - drawData = new DrawData(TextureAssets.AccShield[(int) drawinfo.drawPlayer.shield].Value, zero2 + new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)) + zero1 + new Vector2(x, 0.0f).RotatedBy((double) num2 / 4.0 * 6.28318548202515), new Rectangle?(bodyFrame), colorArmorBody, drawinfo.drawPlayer.bodyRotation, bodyVect, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cShield; - drawinfo.DrawDataCache.Add(drawData); - } - } - drawData = new DrawData(TextureAssets.AccShield[(int) drawinfo.drawPlayer.shield].Value, zero2 + new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)) + zero1, new Rectangle?(bodyFrame), drawinfo.colorArmorBody, drawinfo.drawPlayer.bodyRotation, bodyVect, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cShield; - drawinfo.DrawDataCache.Add(drawData); - if (drawinfo.drawPlayer.shieldRaised) - { - Color colorArmorBody = drawinfo.colorArmorBody; - float num = (float) Math.Sin((double) Main.GlobalTimeWrappedHourly * 3.14159274101257); - colorArmorBody.A = (byte) ((double) colorArmorBody.A * (0.5 + 0.5 * (double) num)); - colorArmorBody *= (float) (0.5 + 0.5 * (double) num); - drawData = new DrawData(TextureAssets.AccShield[(int) drawinfo.drawPlayer.shield].Value, zero2 + new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)) + zero1, new Rectangle?(bodyFrame), colorArmorBody, drawinfo.drawPlayer.bodyRotation, bodyVect, 1f, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cShield; - } - if (drawinfo.drawPlayer.shieldRaised && drawinfo.drawPlayer.shieldParryTimeLeft > 0) - { - float num3 = (float) drawinfo.drawPlayer.shieldParryTimeLeft / 20f; - float num4 = 1.5f * num3; - Vector2 vector2_1 = zero2 + new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)) + zero1; - Color colorArmorBody = drawinfo.colorArmorBody; - float num5 = 1f; - Vector2 vector2_2 = drawinfo.Position + drawinfo.drawPlayer.Size / 2f - Main.screenPosition; - Vector2 vector2_3 = vector2_1 - vector2_2; - Vector2 position = vector2_1 + vector2_3 * num4; - float scale = num5 + num4; - colorArmorBody.A = (byte) ((double) colorArmorBody.A * (1.0 - (double) num3)); - Color color = colorArmorBody * (1f - num3); - drawData = new DrawData(TextureAssets.AccShield[(int) drawinfo.drawPlayer.shield].Value, position, new Rectangle?(bodyFrame), color, drawinfo.drawPlayer.bodyRotation, bodyVect, scale, drawinfo.playerEffect, 0); - drawData.shader = drawinfo.cShield; - drawinfo.DrawDataCache.Add(drawData); - } - if (!drawinfo.drawPlayer.mount.Cart) - return; - drawinfo.DrawDataCache.Reverse(drawinfo.DrawDataCache.Count - 2, 2); - } - - public static void DrawPlayer_26_SolarShield(ref PlayerDrawSet drawinfo) - { - if (drawinfo.drawPlayer.solarShields <= 0 || (double) drawinfo.shadow != 0.0 || drawinfo.drawPlayer.dead) - return; - Texture2D texture2D = TextureAssets.Extra[61 + drawinfo.drawPlayer.solarShields - 1].Value; - Color color = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue); - float rotation1 = (drawinfo.drawPlayer.solarShieldPos[0] * new Vector2(1f, 0.5f)).ToRotation(); - if (drawinfo.drawPlayer.direction == -1) - rotation1 += 3.141593f; - float rotation2 = rotation1 + 0.06283186f * (float) drawinfo.drawPlayer.direction; - drawinfo.DrawDataCache.Add(new DrawData(texture2D, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) (drawinfo.drawPlayer.height / 2))) + drawinfo.drawPlayer.solarShieldPos[0], new Rectangle?(), color, rotation2, texture2D.Size() / 2f, 1f, drawinfo.playerEffect, 0) - { - shader = drawinfo.cBody - }); - } - - public static void DrawPlayer_27_HeldItem(ref PlayerDrawSet drawinfo) - { - if (drawinfo.drawPlayer.JustDroppedAnItem) - return; - if (drawinfo.drawPlayer.heldProj >= 0 && (double) drawinfo.shadow == 0.0 && !drawinfo.heldProjOverHand) - drawinfo.projectileDrawPosition = drawinfo.DrawDataCache.Count; - Item heldItem = drawinfo.heldItem; - int index1 = heldItem.type; - if (index1 == 8 && drawinfo.drawPlayer.UsingBiomeTorches) - index1 = drawinfo.drawPlayer.BiomeTorchHoldStyle(index1); - float scale = heldItem.scale; - Main.instance.LoadItem(index1); - Texture2D texture2D1 = TextureAssets.Item[index1].Value; - Vector2 position = new Vector2((float) (int) ((double) drawinfo.ItemLocation.X - (double) Main.screenPosition.X), (float) (int) ((double) drawinfo.ItemLocation.Y - (double) Main.screenPosition.Y)); - Rectangle? sourceRect = new Rectangle?(new Rectangle(0, 0, texture2D1.Width, texture2D1.Height)); - if (index1 == 75) - sourceRect = new Rectangle?(texture2D1.Frame(verticalFrames: 8)); - if (ItemID.Sets.IsFood[index1]) - sourceRect = new Rectangle?(texture2D1.Frame(verticalFrames: 3, frameY: 1)); - drawinfo.itemColor = Lighting.GetColor((int) ((double) drawinfo.Position.X + (double) drawinfo.drawPlayer.width * 0.5) / 16, (int) (((double) drawinfo.Position.Y + (double) drawinfo.drawPlayer.height * 0.5) / 16.0)); - if (index1 == 678) - drawinfo.itemColor = Color.White; - if (drawinfo.drawPlayer.shroomiteStealth && heldItem.ranged) - { - float num1 = drawinfo.drawPlayer.stealth; - if ((double) num1 < 0.03) - num1 = 0.03f; - float num2 = (float) ((1.0 + (double) num1 * 10.0) / 11.0); - drawinfo.itemColor = new Color((int) (byte) ((double) drawinfo.itemColor.R * (double) num1), (int) (byte) ((double) drawinfo.itemColor.G * (double) num1), (int) (byte) ((double) drawinfo.itemColor.B * (double) num2), (int) (byte) ((double) drawinfo.itemColor.A * (double) num1)); - } - if (drawinfo.drawPlayer.setVortex && heldItem.ranged) - { - float num3 = drawinfo.drawPlayer.stealth; - if ((double) num3 < 0.03) - num3 = 0.03f; - double num4 = (1.0 + (double) num3 * 10.0) / 11.0; - drawinfo.itemColor = drawinfo.itemColor.MultiplyRGBA(new Color(Vector4.Lerp(Vector4.One, new Vector4(0.0f, 0.12f, 0.16f, 0.0f), 1f - num3))); - } - bool flag1 = drawinfo.drawPlayer.itemAnimation > 0 && (uint) heldItem.useStyle > 0U; - bool flag2 = heldItem.holdStyle != 0 && !drawinfo.drawPlayer.pulley; - if (!drawinfo.drawPlayer.CanVisuallyHoldItem(heldItem)) - flag2 = false; - if ((double) drawinfo.shadow != 0.0 || drawinfo.drawPlayer.frozen || !(flag1 | flag2) || index1 <= 0 || drawinfo.drawPlayer.dead || heldItem.noUseGraphic || drawinfo.drawPlayer.wet && heldItem.noWet || drawinfo.drawPlayer.happyFunTorchTime && drawinfo.drawPlayer.inventory[drawinfo.drawPlayer.selectedItem].createTile == 4 && drawinfo.drawPlayer.itemAnimation == 0) - return; - string name = drawinfo.drawPlayer.name; - Color color1 = new Color(250, 250, 250, heldItem.alpha); - Vector2 vector2_1 = Vector2.Zero; - if (index1 == 3823) - vector2_1 = new Vector2((float) (7 * drawinfo.drawPlayer.direction), -7f * drawinfo.drawPlayer.gravDir); - if (index1 == 3827) - { - vector2_1 = new Vector2((float) (13 * drawinfo.drawPlayer.direction), -13f * drawinfo.drawPlayer.gravDir); - color1 = heldItem.GetAlpha(drawinfo.itemColor); - color1 = Color.Lerp(color1, Color.White, 0.6f); - color1.A = (byte) 66; - } - Vector2 vector2_2 = new Vector2((float) ((double) sourceRect.Value.Width * 0.5 - (double) sourceRect.Value.Width * 0.5 * (double) drawinfo.drawPlayer.direction), (float) sourceRect.Value.Height); - if (heldItem.useStyle == 9 && drawinfo.drawPlayer.itemAnimation > 0) - { - Vector2 vector2_3 = new Vector2(0.5f, 0.4f); - if (heldItem.type == 5009 || heldItem.type == 5042) - { - vector2_3 = new Vector2(0.26f, 0.5f); - if (drawinfo.drawPlayer.direction == -1) - vector2_3.X = 1f - vector2_3.X; - } - vector2_2 = sourceRect.Value.Size() * vector2_3; - } - if ((double) drawinfo.drawPlayer.gravDir == -1.0) - vector2_2.Y = (float) sourceRect.Value.Height - vector2_2.Y; - Vector2 origin1 = vector2_2 + vector2_1; - float rotation1 = drawinfo.drawPlayer.itemRotation; - if (heldItem.useStyle == 8) - { - ref float local = ref position.X; - double num = (double) local; - int direction = drawinfo.drawPlayer.direction; - local = (float) (num - 0.0); - rotation1 -= 1.570796f * (float) drawinfo.drawPlayer.direction; - origin1.Y = 2f; - origin1.X += (float) (2 * drawinfo.drawPlayer.direction); - } - if (index1 == 425 || index1 == 507) - drawinfo.itemEffect = (double) drawinfo.drawPlayer.gravDir != 1.0 ? (drawinfo.drawPlayer.direction != 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None) : (drawinfo.drawPlayer.direction != 1 ? SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically : SpriteEffects.FlipVertically); - if ((index1 == 946 || index1 == 4707) && (double) rotation1 != 0.0) - { - position.Y -= 22f * drawinfo.drawPlayer.gravDir; - rotation1 = -1.57f * (float) -drawinfo.drawPlayer.direction * drawinfo.drawPlayer.gravDir; - } - ItemSlot.GetItemLight(ref drawinfo.itemColor, heldItem); - switch (index1) - { - case 3476: - Texture2D texture2D2 = TextureAssets.Extra[64].Value; - Rectangle r1 = texture2D2.Frame(verticalFrames: 9, frameY: (drawinfo.drawPlayer.miscCounter % 54 / 6)); - Vector2 vector2_4 = new Vector2((float) (r1.Width / 2 * drawinfo.drawPlayer.direction), 0.0f); - Vector2 origin2 = r1.Size() / 2f; - DrawData drawData1 = new DrawData(texture2D2, (drawinfo.ItemLocation - Main.screenPosition + vector2_4).Floor(), new Rectangle?(r1), heldItem.GetAlpha(drawinfo.itemColor).MultiplyRGBA(new Color(new Vector4(0.5f, 0.5f, 0.5f, 0.8f))), drawinfo.drawPlayer.itemRotation, origin2, scale, drawinfo.itemEffect, 0); - drawinfo.DrawDataCache.Add(drawData1); - drawData1 = new DrawData(TextureAssets.GlowMask[195].Value, (drawinfo.ItemLocation - Main.screenPosition + vector2_4).Floor(), new Rectangle?(r1), new Color(250, 250, 250, heldItem.alpha) * 0.5f, drawinfo.drawPlayer.itemRotation, origin2, scale, drawinfo.itemEffect, 0); - drawinfo.DrawDataCache.Add(drawData1); - break; - case 3779: - Texture2D texture2D3 = texture2D1; - Rectangle r2 = texture2D3.Frame(); - Vector2 vector2_5 = new Vector2((float) (r2.Width / 2 * drawinfo.drawPlayer.direction), 0.0f); - Vector2 origin3 = r2.Size() / 2f; - Color color2 = new Color(120, 40, 222, 0) * (float) (((double) ((float) ((double) drawinfo.drawPlayer.miscCounter / 75.0 * 6.28318548202515)).ToRotationVector2().X * 1.0 + 0.0) / 2.0 * 0.300000011920929 + 0.850000023841858) * 0.5f; - float num5 = 2f; - DrawData drawData2; - for (float num6 = 0.0f; (double) num6 < 4.0; ++num6) - { - drawData2 = new DrawData(TextureAssets.GlowMask[218].Value, (drawinfo.ItemLocation - Main.screenPosition + vector2_5).Floor() + (num6 * 1.570796f).ToRotationVector2() * num5, new Rectangle?(r2), color2, drawinfo.drawPlayer.itemRotation, origin3, scale, drawinfo.itemEffect, 0); - drawinfo.DrawDataCache.Add(drawData2); - } - drawData2 = new DrawData(texture2D3, (drawinfo.ItemLocation - Main.screenPosition + vector2_5).Floor(), new Rectangle?(r2), heldItem.GetAlpha(drawinfo.itemColor).MultiplyRGBA(new Color(new Vector4(0.5f, 0.5f, 0.5f, 0.8f))), drawinfo.drawPlayer.itemRotation, origin3, scale, drawinfo.itemEffect, 0); - drawinfo.DrawDataCache.Add(drawData2); - break; - case 4049: - Texture2D texture2D4 = TextureAssets.Extra[92].Value; - Rectangle r3 = texture2D4.Frame(verticalFrames: 4, frameY: (drawinfo.drawPlayer.miscCounter % 20 / 5)); - Vector2 vector2_6 = new Vector2((float) (r3.Width / 2 * drawinfo.drawPlayer.direction), 0.0f) + new Vector2((float) (-10 * drawinfo.drawPlayer.direction), 8f * drawinfo.drawPlayer.gravDir); - Vector2 origin4 = r3.Size() / 2f; - DrawData drawData3 = new DrawData(texture2D4, (drawinfo.ItemLocation - Main.screenPosition + vector2_6).Floor(), new Rectangle?(r3), heldItem.GetAlpha(drawinfo.itemColor), drawinfo.drawPlayer.itemRotation, origin4, scale, drawinfo.itemEffect, 0); - drawinfo.DrawDataCache.Add(drawData3); - break; - default: - if (heldItem.useStyle == 5) - { - if (Item.staff[index1]) - { - float rotation2 = drawinfo.drawPlayer.itemRotation + 0.785f * (float) drawinfo.drawPlayer.direction; - int num7 = 0; - int num8 = 0; - Vector2 origin5 = new Vector2(0.0f, (float) texture2D1.Height); - if (index1 == 3210) - { - num7 = 8 * -drawinfo.drawPlayer.direction; - num8 = 2 * (int) drawinfo.drawPlayer.gravDir; - } - if (index1 == 3870) - { - Vector2 vector2_7 = (drawinfo.drawPlayer.itemRotation + 0.7853982f * (float) drawinfo.drawPlayer.direction).ToRotationVector2() * new Vector2((float) -drawinfo.drawPlayer.direction * 1.5f, drawinfo.drawPlayer.gravDir) * 3f; - num7 = (int) vector2_7.X; - num8 = (int) vector2_7.Y; - } - if (index1 == 3787) - num8 = (int) ((double) (8 * (int) drawinfo.drawPlayer.gravDir) * Math.Cos((double) rotation2)); - if ((double) drawinfo.drawPlayer.gravDir == -1.0) - { - if (drawinfo.drawPlayer.direction == -1) - { - rotation2 += 1.57f; - origin5 = new Vector2((float) texture2D1.Width, 0.0f); - num7 -= texture2D1.Width; - } - else - { - rotation2 -= 1.57f; - origin5 = Vector2.Zero; - } - } - else if (drawinfo.drawPlayer.direction == -1) - { - origin5 = new Vector2((float) texture2D1.Width, (float) texture2D1.Height); - num7 -= texture2D1.Width; - } - DrawData drawData4 = new DrawData(texture2D1, new Vector2((float) (int) ((double) drawinfo.ItemLocation.X - (double) Main.screenPosition.X + (double) origin5.X + (double) num7), (float) (int) ((double) drawinfo.ItemLocation.Y - (double) Main.screenPosition.Y + (double) num8)), sourceRect, heldItem.GetAlpha(drawinfo.itemColor), rotation2, origin5, scale, drawinfo.itemEffect, 0); - drawinfo.DrawDataCache.Add(drawData4); - if (index1 != 3870) - break; - drawData4 = new DrawData(TextureAssets.GlowMask[238].Value, new Vector2((float) (int) ((double) drawinfo.ItemLocation.X - (double) Main.screenPosition.X + (double) origin5.X + (double) num7), (float) (int) ((double) drawinfo.ItemLocation.Y - (double) Main.screenPosition.Y + (double) num8)), sourceRect, new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue), rotation2, origin5, scale, drawinfo.itemEffect, 0); - drawinfo.DrawDataCache.Add(drawData4); - break; - } - Vector2 vector2_8 = new Vector2((float) (texture2D1.Width / 2), (float) (texture2D1.Height / 2)); - Vector2 vector2_9 = Main.DrawPlayerItemPos(drawinfo.drawPlayer.gravDir, index1); - int x = (int) vector2_9.X; - vector2_8.Y = vector2_9.Y; - Vector2 origin6 = new Vector2((float) -x, (float) (texture2D1.Height / 2)); - if (drawinfo.drawPlayer.direction == -1) - origin6 = new Vector2((float) (texture2D1.Width + x), (float) (texture2D1.Height / 2)); - DrawData drawData5 = new DrawData(texture2D1, new Vector2((float) (int) ((double) drawinfo.ItemLocation.X - (double) Main.screenPosition.X + (double) vector2_8.X), (float) (int) ((double) drawinfo.ItemLocation.Y - (double) Main.screenPosition.Y + (double) vector2_8.Y)), sourceRect, heldItem.GetAlpha(drawinfo.itemColor), drawinfo.drawPlayer.itemRotation, origin6, scale, drawinfo.itemEffect, 0); - drawinfo.DrawDataCache.Add(drawData5); - if (heldItem.color != new Color()) - { - drawData5 = new DrawData(texture2D1, new Vector2((float) (int) ((double) drawinfo.ItemLocation.X - (double) Main.screenPosition.X + (double) vector2_8.X), (float) (int) ((double) drawinfo.ItemLocation.Y - (double) Main.screenPosition.Y + (double) vector2_8.Y)), sourceRect, heldItem.GetColor(drawinfo.itemColor), drawinfo.drawPlayer.itemRotation, origin6, scale, drawinfo.itemEffect, 0); - drawinfo.DrawDataCache.Add(drawData5); - } - if (heldItem.glowMask != (short) -1) - { - drawData5 = new DrawData(TextureAssets.GlowMask[(int) heldItem.glowMask].Value, new Vector2((float) (int) ((double) drawinfo.ItemLocation.X - (double) Main.screenPosition.X + (double) vector2_8.X), (float) (int) ((double) drawinfo.ItemLocation.Y - (double) Main.screenPosition.Y + (double) vector2_8.Y)), sourceRect, new Color(250, 250, 250, heldItem.alpha), drawinfo.drawPlayer.itemRotation, origin6, scale, drawinfo.itemEffect, 0); - drawinfo.DrawDataCache.Add(drawData5); - } - if (index1 != 3788) - break; - float num9 = (float) ((double) ((float) ((double) drawinfo.drawPlayer.miscCounter / 75.0 * 6.28318548202515)).ToRotationVector2().X * 1.0 + 0.0); - Color color3 = new Color(80, 40, 252, 0) * (float) ((double) num9 / 2.0 * 0.300000011920929 + 0.850000023841858) * 0.5f; - for (float num10 = 0.0f; (double) num10 < 4.0; ++num10) - { - drawData5 = new DrawData(TextureAssets.GlowMask[220].Value, new Vector2((float) (int) ((double) drawinfo.ItemLocation.X - (double) Main.screenPosition.X + (double) vector2_8.X), (float) (int) ((double) drawinfo.ItemLocation.Y - (double) Main.screenPosition.Y + (double) vector2_8.Y)) + (num10 * 1.570796f + drawinfo.drawPlayer.itemRotation).ToRotationVector2() * num9, new Rectangle?(), color3, drawinfo.drawPlayer.itemRotation, origin6, scale, drawinfo.itemEffect, 0); - drawinfo.DrawDataCache.Add(drawData5); - } - break; - } - if ((double) drawinfo.drawPlayer.gravDir == -1.0) - { - DrawData drawData6 = new DrawData(texture2D1, position, sourceRect, heldItem.GetAlpha(drawinfo.itemColor), rotation1, origin1, scale, drawinfo.itemEffect, 0); - drawinfo.DrawDataCache.Add(drawData6); - if (heldItem.color != new Color()) - { - drawData6 = new DrawData(texture2D1, position, sourceRect, heldItem.GetColor(drawinfo.itemColor), rotation1, origin1, scale, drawinfo.itemEffect, 0); - drawinfo.DrawDataCache.Add(drawData6); - } - if (heldItem.glowMask == (short) -1) - break; - drawData6 = new DrawData(TextureAssets.GlowMask[(int) heldItem.glowMask].Value, position, sourceRect, new Color(250, 250, 250, heldItem.alpha), rotation1, origin1, scale, drawinfo.itemEffect, 0); - drawinfo.DrawDataCache.Add(drawData6); - break; - } - DrawData drawData7 = new DrawData(texture2D1, position, sourceRect, heldItem.GetAlpha(drawinfo.itemColor), rotation1, origin1, scale, drawinfo.itemEffect, 0); - drawinfo.DrawDataCache.Add(drawData7); - if (heldItem.color != new Color()) - { - drawData7 = new DrawData(texture2D1, position, sourceRect, heldItem.GetColor(drawinfo.itemColor), rotation1, origin1, scale, drawinfo.itemEffect, 0); - drawinfo.DrawDataCache.Add(drawData7); - } - if (heldItem.glowMask != (short) -1) - { - drawData7 = new DrawData(TextureAssets.GlowMask[(int) heldItem.glowMask].Value, position, sourceRect, color1, rotation1, origin1, scale, drawinfo.itemEffect, 0); - drawinfo.DrawDataCache.Add(drawData7); - } - if (!heldItem.flame) - break; - if ((double) drawinfo.shadow != 0.0) - break; - try - { - Main.instance.LoadItemFlames(index1); - if (!TextureAssets.ItemFlame[index1].IsLoaded) - break; - Color color4 = new Color(100, 100, 100, 0); - int num11 = 7; - float num12 = 1f; - switch (index1) - { - case 3045: - color4 = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, 0); - break; - case 4952: - num11 = 3; - num12 = 0.6f; - color4 = new Color(50, 50, 50, 0); - break; - } - for (int index2 = 0; index2 < num11; ++index2) - { - float num13 = drawinfo.drawPlayer.itemFlamePos[index2].X * scale * num12; - float num14 = drawinfo.drawPlayer.itemFlamePos[index2].Y * scale * num12; - DrawData drawData8 = new DrawData(TextureAssets.ItemFlame[index1].Value, new Vector2((float) (int) ((double) position.X + (double) num13), (float) (int) ((double) position.Y + (double) num14)), sourceRect, color4, rotation1, origin1, scale, drawinfo.itemEffect, 0); - drawinfo.DrawDataCache.Add(drawData8); - } - break; - } - catch - { - break; - } - } - } - - public static void DrawPlayer_28_ArmOverItem(ref PlayerDrawSet drawinfo) - { - if (drawinfo.usesCompositeTorso) - PlayerDrawLayers.DrawPlayer_28_ArmOverItemComposite(ref drawinfo); - else if (drawinfo.drawPlayer.body > 0 && drawinfo.drawPlayer.body < 235) - { - Rectangle bodyFrame = drawinfo.drawPlayer.bodyFrame; - int num1 = drawinfo.armorAdjust; - bodyFrame.X += num1; - bodyFrame.Width -= num1; - if (drawinfo.drawPlayer.direction == -1) - num1 = 0; - if (drawinfo.drawPlayer.invis && (drawinfo.drawPlayer.body == 21 || drawinfo.drawPlayer.body == 22)) - return; - DrawData drawData1; - if (drawinfo.missingHand && !drawinfo.drawPlayer.invis) - { - int body = drawinfo.drawPlayer.body; - DrawData drawData2; - if (drawinfo.missingArm) - { - drawData2 = new DrawData(TextureAssets.Players[drawinfo.skinVar, 7].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorBodySkin, drawinfo.drawPlayer.bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0); - drawData2.shader = drawinfo.skinDyePacked; - DrawData drawData3 = drawData2; - drawinfo.DrawDataCache.Add(drawData3); - } - drawData2 = new DrawData(TextureAssets.Players[drawinfo.skinVar, 9].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorBodySkin, drawinfo.drawPlayer.bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0); - drawData2.shader = drawinfo.skinDyePacked; - drawData1 = drawData2; - drawinfo.DrawDataCache.Add(drawData1); - } - drawData1 = new DrawData(TextureAssets.ArmorArm[drawinfo.drawPlayer.body].Value, new Vector2((float) ((int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)) + num1), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)), new Rectangle?(bodyFrame), drawinfo.colorArmorBody, drawinfo.drawPlayer.bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0); - drawData1.shader = drawinfo.cBody; - drawinfo.DrawDataCache.Add(drawData1); - if (drawinfo.armGlowMask != -1) - { - drawData1 = new DrawData(TextureAssets.GlowMask[drawinfo.armGlowMask].Value, new Vector2((float) ((int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)) + num1), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)), new Rectangle?(bodyFrame), drawinfo.armGlowColor, drawinfo.drawPlayer.bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0); - drawData1.shader = drawinfo.cBody; - drawinfo.DrawDataCache.Add(drawData1); - } - if (drawinfo.drawPlayer.body != 205) - return; - Color color = new Color(100, 100, 100, 0); - ulong seed = (ulong) (drawinfo.drawPlayer.miscCounter / 4); - int num2 = 4; - for (int index = 0; index < num2; ++index) - { - float num3 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.2f; - float num4 = (float) Utils.RandomInt(ref seed, -10, 1) * 0.15f; - drawData1 = new DrawData(TextureAssets.GlowMask[240].Value, new Vector2((float) ((int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)) + num1), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2) + num3, (float) (drawinfo.drawPlayer.bodyFrame.Height / 2) + num4), new Rectangle?(bodyFrame), color, drawinfo.drawPlayer.bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0); - drawData1.shader = drawinfo.cBody; - drawinfo.DrawDataCache.Add(drawData1); - } - } - else - { - if (drawinfo.drawPlayer.invis) - return; - DrawData drawData = new DrawData(TextureAssets.Players[drawinfo.skinVar, 7].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorBodySkin, drawinfo.drawPlayer.bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0) - { - shader = drawinfo.skinDyePacked - }; - drawinfo.DrawDataCache.Add(drawData); - drawData = new DrawData(TextureAssets.Players[drawinfo.skinVar, 8].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorUnderShirt, drawinfo.drawPlayer.bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0); - drawinfo.DrawDataCache.Add(drawData); - drawData = new DrawData(TextureAssets.Players[drawinfo.skinVar, 13].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorShirt, drawinfo.drawPlayer.bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0); - drawinfo.DrawDataCache.Add(drawData); - } - } - - public static void DrawPlayer_28_ArmOverItemComposite(ref PlayerDrawSet drawinfo) - { - Vector2 vector2_1 = new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)); - Vector2 vector2_2 = Main.OffsetsPlayerHeadgear[drawinfo.drawPlayer.bodyFrame.Y / drawinfo.drawPlayer.bodyFrame.Height]; - vector2_2.Y -= 2f; - Vector2 vector2_3 = vector2_1 + vector2_2 * (float) -drawinfo.playerEffect.HasFlag((Enum) SpriteEffects.FlipVertically).ToDirectionInt(); - float bodyRotation = drawinfo.drawPlayer.bodyRotation; - float rotation = drawinfo.drawPlayer.bodyRotation + drawinfo.compositeFrontArmRotation; - Vector2 bodyVect = drawinfo.bodyVect; - Vector2 compositeOffsetFrontArm = PlayerDrawLayers.GetCompositeOffset_FrontArm(ref drawinfo); - Vector2 origin = bodyVect + compositeOffsetFrontArm; - Vector2 position1 = vector2_3 + compositeOffsetFrontArm; - Vector2 position2 = position1 + drawinfo.frontShoulderOffset; - if (drawinfo.compFrontArmFrame.X / drawinfo.compFrontArmFrame.Width >= 7) - position1 += new Vector2(drawinfo.playerEffect.HasFlag((Enum) SpriteEffects.FlipHorizontally) ? -1f : 1f, drawinfo.playerEffect.HasFlag((Enum) SpriteEffects.FlipVertically) ? -1f : 1f); - int num1 = drawinfo.drawPlayer.invis ? 1 : 0; - int num2 = drawinfo.drawPlayer.body <= 0 ? 0 : (drawinfo.drawPlayer.body < 235 ? 1 : 0); - int num3 = drawinfo.compShoulderOverFrontArm ? 1 : 0; - int num4 = drawinfo.compShoulderOverFrontArm ? 0 : 1; - int num5 = drawinfo.compShoulderOverFrontArm ? 0 : 1; - bool flag = !drawinfo.hidesTopSkin; - DrawData drawData1; - if (num2 != 0) - { - if (!drawinfo.drawPlayer.invis || PlayerDrawLayers.IsArmorDrawnWhenInvisible(drawinfo.drawPlayer.body)) - { - Texture2D texture = TextureAssets.ArmorBodyComposite[drawinfo.drawPlayer.body].Value; - for (int index = 0; index < 2; ++index) - { - if (((drawinfo.drawPlayer.invis ? 0 : (index == num5 ? 1 : 0)) & (flag ? 1 : 0)) != 0) - { - if (drawinfo.missingArm) - { - List drawDataCache = drawinfo.DrawDataCache; - drawData1 = new DrawData(TextureAssets.Players[drawinfo.skinVar, 7].Value, position1, new Rectangle?(drawinfo.compFrontArmFrame), drawinfo.colorBodySkin, rotation, origin, 1f, drawinfo.playerEffect, 0); - drawData1.shader = drawinfo.skinDyePacked; - DrawData drawData2 = drawData1; - drawDataCache.Add(drawData2); - } - if (drawinfo.missingHand) - { - List drawDataCache = drawinfo.DrawDataCache; - drawData1 = new DrawData(TextureAssets.Players[drawinfo.skinVar, 9].Value, position1, new Rectangle?(drawinfo.compFrontArmFrame), drawinfo.colorBodySkin, rotation, origin, 1f, drawinfo.playerEffect, 0); - drawData1.shader = drawinfo.skinDyePacked; - DrawData drawData3 = drawData1; - drawDataCache.Add(drawData3); - } - } - if (index == num3 && !drawinfo.hideCompositeShoulders) - { - ref PlayerDrawSet local = ref drawinfo; - drawData1 = new DrawData(texture, position2, new Rectangle?(drawinfo.compFrontShoulderFrame), drawinfo.colorArmorBody, bodyRotation, origin, 1f, drawinfo.playerEffect, 0); - drawData1.shader = drawinfo.cBody; - DrawData data = drawData1; - PlayerDrawLayers.DrawCompositeArmorPiece(ref local, CompositePlayerDrawContext.FrontShoulder, data); - } - if (index == num4) - { - ref PlayerDrawSet local = ref drawinfo; - drawData1 = new DrawData(texture, position1, new Rectangle?(drawinfo.compFrontArmFrame), drawinfo.colorArmorBody, rotation, origin, 1f, drawinfo.playerEffect, 0); - drawData1.shader = drawinfo.cBody; - DrawData data = drawData1; - PlayerDrawLayers.DrawCompositeArmorPiece(ref local, CompositePlayerDrawContext.FrontArm, data); - } - } - } - } - else if (!drawinfo.drawPlayer.invis) - { - for (int index = 0; index < 2; ++index) - { - if (index == num3) - { - if (flag) - { - List drawDataCache = drawinfo.DrawDataCache; - drawData1 = new DrawData(TextureAssets.Players[drawinfo.skinVar, 7].Value, position2, new Rectangle?(drawinfo.compFrontShoulderFrame), drawinfo.colorBodySkin, bodyRotation, origin, 1f, drawinfo.playerEffect, 0); - drawData1.shader = drawinfo.skinDyePacked; - DrawData drawData4 = drawData1; - drawDataCache.Add(drawData4); - } - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.Players[drawinfo.skinVar, 8].Value, position2, new Rectangle?(drawinfo.compFrontShoulderFrame), drawinfo.colorUnderShirt, bodyRotation, origin, 1f, drawinfo.playerEffect, 0)); - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.Players[drawinfo.skinVar, 13].Value, position2, new Rectangle?(drawinfo.compFrontShoulderFrame), drawinfo.colorShirt, bodyRotation, origin, 1f, drawinfo.playerEffect, 0)); - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.Players[drawinfo.skinVar, 6].Value, position2, new Rectangle?(drawinfo.compFrontShoulderFrame), drawinfo.colorShirt, bodyRotation, origin, 1f, drawinfo.playerEffect, 0)); - } - if (index == num4) - { - if (flag) - { - List drawDataCache = drawinfo.DrawDataCache; - drawData1 = new DrawData(TextureAssets.Players[drawinfo.skinVar, 7].Value, position1, new Rectangle?(drawinfo.compFrontArmFrame), drawinfo.colorBodySkin, rotation, origin, 1f, drawinfo.playerEffect, 0); - drawData1.shader = drawinfo.skinDyePacked; - DrawData drawData5 = drawData1; - drawDataCache.Add(drawData5); - } - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.Players[drawinfo.skinVar, 8].Value, position1, new Rectangle?(drawinfo.compFrontArmFrame), drawinfo.colorUnderShirt, rotation, origin, 1f, drawinfo.playerEffect, 0)); - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.Players[drawinfo.skinVar, 13].Value, position1, new Rectangle?(drawinfo.compFrontArmFrame), drawinfo.colorShirt, rotation, origin, 1f, drawinfo.playerEffect, 0)); - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.Players[drawinfo.skinVar, 6].Value, position1, new Rectangle?(drawinfo.compFrontArmFrame), drawinfo.colorShirt, rotation, origin, 1f, drawinfo.playerEffect, 0)); - } - } - } - if (drawinfo.drawPlayer.handon <= (sbyte) 0 || drawinfo.drawPlayer.handon >= (sbyte) 22) - return; - Texture2D texture1 = TextureAssets.AccHandsOnComposite[(int) drawinfo.drawPlayer.handon].Value; - ref PlayerDrawSet local1 = ref drawinfo; - drawData1 = new DrawData(texture1, position1, new Rectangle?(drawinfo.compFrontArmFrame), drawinfo.colorArmorBody, rotation, origin, 1f, drawinfo.playerEffect, 0); - drawData1.shader = drawinfo.cHandOn; - DrawData data1 = drawData1; - PlayerDrawLayers.DrawCompositeArmorPiece(ref local1, CompositePlayerDrawContext.FrontArmAccessory, data1); - } - - public static void DrawPlayer_29_OnhandAcc(ref PlayerDrawSet drawinfo) - { - if (drawinfo.usesCompositeFrontHandAcc || drawinfo.drawPlayer.handon <= (sbyte) 0 || drawinfo.drawPlayer.handon >= (sbyte) 22) - return; - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.AccHandsOn[(int) drawinfo.drawPlayer.handon].Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorArmorBody, drawinfo.drawPlayer.bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0) - { - shader = drawinfo.cHandOn - }); - } - - public static void DrawPlayer_30_BladedGlove(ref PlayerDrawSet drawinfo) - { - Item heldItem = drawinfo.heldItem; - if (heldItem.type <= -1 || !Item.claw[heldItem.type] || (double) drawinfo.shadow != 0.0) - return; - Main.instance.LoadItem(heldItem.type); - Asset asset = TextureAssets.Item[heldItem.type]; - if (drawinfo.drawPlayer.frozen || drawinfo.drawPlayer.itemAnimation <= 0 && (heldItem.holdStyle == 0 || drawinfo.drawPlayer.pulley) || heldItem.type <= 0 || drawinfo.drawPlayer.dead || heldItem.noUseGraphic || drawinfo.drawPlayer.wet && heldItem.noWet) - return; - if ((double) drawinfo.drawPlayer.gravDir == -1.0) - { - DrawData drawData = new DrawData(asset.Value, new Vector2((float) (int) ((double) drawinfo.ItemLocation.X - (double) Main.screenPosition.X), (float) (int) ((double) drawinfo.ItemLocation.Y - (double) Main.screenPosition.Y)), new Rectangle?(new Rectangle(0, 0, asset.Width(), asset.Height())), heldItem.GetAlpha(drawinfo.itemColor), drawinfo.drawPlayer.itemRotation, new Vector2((float) ((double) asset.Width() * 0.5 - (double) asset.Width() * 0.5 * (double) drawinfo.drawPlayer.direction), 0.0f), heldItem.scale, drawinfo.itemEffect, 0); - drawinfo.DrawDataCache.Add(drawData); - } - else - { - DrawData drawData = new DrawData(asset.Value, new Vector2((float) (int) ((double) drawinfo.ItemLocation.X - (double) Main.screenPosition.X), (float) (int) ((double) drawinfo.ItemLocation.Y - (double) Main.screenPosition.Y)), new Rectangle?(new Rectangle(0, 0, asset.Width(), asset.Height())), heldItem.GetAlpha(drawinfo.itemColor), drawinfo.drawPlayer.itemRotation, new Vector2((float) ((double) asset.Width() * 0.5 - (double) asset.Width() * 0.5 * (double) drawinfo.drawPlayer.direction), (float) asset.Height()), heldItem.scale, drawinfo.itemEffect, 0); - drawinfo.DrawDataCache.Add(drawData); - } - } - - public static void DrawPlayer_31_ProjectileOverArm(ref PlayerDrawSet drawinfo) - { - if (drawinfo.drawPlayer.heldProj < 0 || (double) drawinfo.shadow != 0.0 || !drawinfo.heldProjOverHand) - return; - drawinfo.projectileDrawPosition = drawinfo.DrawDataCache.Count; - } - - public static void DrawPlayer_32_FrontAcc(ref PlayerDrawSet drawinfo) - { - if (drawinfo.backPack || drawinfo.drawPlayer.front <= (sbyte) 0 || drawinfo.drawPlayer.front >= (sbyte) 9 || drawinfo.drawPlayer.mount.Active) - return; - Vector2 zero = Vector2.Zero; - drawinfo.DrawDataCache.Add(new DrawData(TextureAssets.AccFront[(int) drawinfo.drawPlayer.front].Value, zero + new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawinfo.drawPlayer.bodyFrame), drawinfo.colorArmorBody, drawinfo.drawPlayer.bodyRotation, drawinfo.bodyVect, 1f, drawinfo.playerEffect, 0) - { - shader = drawinfo.cFront - }); - } - - public static void DrawPlayer_33_FrozenOrWebbedDebuff(ref PlayerDrawSet drawinfo) - { - if (drawinfo.drawPlayer.frozen && (double) drawinfo.shadow == 0.0) - { - Color colorArmorBody = drawinfo.colorArmorBody; - colorArmorBody.R = (byte) ((double) colorArmorBody.R * 0.55); - colorArmorBody.G = (byte) ((double) colorArmorBody.G * 0.55); - colorArmorBody.B = (byte) ((double) colorArmorBody.B * 0.55); - colorArmorBody.A = (byte) ((double) colorArmorBody.A * 0.55); - DrawData drawData = new DrawData(TextureAssets.Frozen.Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)), new Rectangle?(new Rectangle(0, 0, TextureAssets.Frozen.Width(), TextureAssets.Frozen.Height())), colorArmorBody, drawinfo.drawPlayer.bodyRotation, new Vector2((float) (TextureAssets.Frozen.Width() / 2), (float) (TextureAssets.Frozen.Height() / 2)), 1f, drawinfo.playerEffect, 0); - drawinfo.DrawDataCache.Add(drawData); - } - else - { - if (!drawinfo.drawPlayer.webbed || (double) drawinfo.shadow != 0.0 || (double) drawinfo.drawPlayer.velocity.Y != 0.0) - return; - Color color = drawinfo.colorArmorBody * 0.75f; - Texture2D texture2D = TextureAssets.Extra[31].Value; - int num = drawinfo.drawPlayer.height / 2; - DrawData drawData = new DrawData(texture2D, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0 + (double) num)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)), new Rectangle?(), color, drawinfo.drawPlayer.bodyRotation, texture2D.Size() / 2f, 1f, drawinfo.playerEffect, 0); - drawinfo.DrawDataCache.Add(drawData); - } - } - - public static void DrawPlayer_34_ElectrifiedDebuffFront(ref PlayerDrawSet drawinfo) - { - if (!drawinfo.drawPlayer.electrified || (double) drawinfo.shadow != 0.0) - return; - Texture2D texture = TextureAssets.GlowMask[25].Value; - int num1 = drawinfo.drawPlayer.miscCounter / 5; - for (int index = 0; index < 2; ++index) - { - int num2 = num1 % 7; - if (num2 > 1 && num2 < 5) - { - DrawData drawData = new DrawData(texture, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)), new Rectangle?(new Rectangle(0, num2 * texture.Height / 7, texture.Width, texture.Height / 7)), drawinfo.colorElectricity, drawinfo.drawPlayer.bodyRotation, new Vector2((float) (texture.Width / 2), (float) (texture.Height / 14)), 1f, drawinfo.playerEffect, 0); - drawinfo.DrawDataCache.Add(drawData); - } - num1 = num2 + 3; - } - } - - public static void DrawPlayer_35_IceBarrier(ref PlayerDrawSet drawinfo) - { - if (!drawinfo.drawPlayer.iceBarrier || (double) drawinfo.shadow != 0.0) - return; - int height = TextureAssets.IceBarrier.Height() / 12; - Color white = Color.White; - DrawData drawData = new DrawData(TextureAssets.IceBarrier.Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X - (double) (drawinfo.drawPlayer.bodyFrame.Width / 2) + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - (double) drawinfo.drawPlayer.bodyFrame.Height + 4.0)) + drawinfo.drawPlayer.bodyPosition + new Vector2((float) (drawinfo.drawPlayer.bodyFrame.Width / 2), (float) (drawinfo.drawPlayer.bodyFrame.Height / 2)), new Rectangle?(new Rectangle(0, height * (int) drawinfo.drawPlayer.iceBarrierFrame, TextureAssets.IceBarrier.Width(), height)), white, 0.0f, new Vector2((float) (TextureAssets.Frozen.Width() / 2), (float) (TextureAssets.Frozen.Height() / 2)), 1f, drawinfo.playerEffect, 0); - drawinfo.DrawDataCache.Add(drawData); - } - - public static void DrawPlayer_36_CTG(ref PlayerDrawSet drawinfo) - { - if ((double) drawinfo.shadow != 0.0 || (byte) drawinfo.drawPlayer.ownedLargeGems <= (byte) 0) - return; - bool flag = false; - BitsByte ownedLargeGems = drawinfo.drawPlayer.ownedLargeGems; - float num1 = 0.0f; - for (int key = 0; key < 7; ++key) - { - if (ownedLargeGems[key]) - ++num1; - } - float num2 = (float) (1.0 - (double) num1 * 0.0599999986588955); - float num3 = (float) (((double) num1 - 1.0) * 4.0); - switch (num1) - { - case 2f: - num3 += 10f; - break; - case 3f: - num3 += 8f; - break; - case 4f: - num3 += 6f; - break; - case 5f: - num3 += 6f; - break; - case 6f: - num3 += 2f; - break; - case 7f: - num3 += 0.0f; - break; - } - float num4 = (float) ((double) drawinfo.drawPlayer.miscCounter / 300.0 * 6.28318548202515); - if ((double) num1 <= 0.0) - return; - float num5 = 6.283185f / num1; - float num6 = 0.0f; - Vector2 vector2 = new Vector2(1.3f, 0.65f); - if (!flag) - vector2 = Vector2.One; - List drawDataList = new List(); - for (int key = 0; key < 7; ++key) - { - if (!ownedLargeGems[key]) - { - ++num6; - } - else - { - Vector2 rotationVector2 = (num4 + num5 * ((float) key - num6)).ToRotationVector2(); - float num7 = num2; - if (flag) - num7 = MathHelper.Lerp(num2 * 0.7f, 1f, (float) ((double) rotationVector2.Y / 2.0 + 0.5)); - Texture2D texture2D = TextureAssets.Gem[key].Value; - DrawData drawData = new DrawData(texture2D, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) drawinfo.drawPlayer.height - 80.0)) + rotationVector2 * vector2 * num3, new Rectangle?(), new Color(250, 250, 250, (int) Main.mouseTextColor / 2), 0.0f, texture2D.Size() / 2f, (float) ((double) Main.mouseTextColor / 1000.0 + 0.800000011920929) * num7, SpriteEffects.None, 0); - drawDataList.Add(drawData); - } - } - if (flag) - drawDataList.Sort(new Comparison(DelegateMethods.CompareDrawSorterByYScale)); - drawinfo.DrawDataCache.AddRange((IEnumerable) drawDataList); - } - - public static void DrawPlayer_37_BeetleBuff(ref PlayerDrawSet drawinfo) - { - if (!drawinfo.drawPlayer.beetleOffense && !drawinfo.drawPlayer.beetleDefense || (double) drawinfo.shadow != 0.0) - return; - for (int index1 = 0; index1 < drawinfo.drawPlayer.beetleOrbs; ++index1) - { - DrawData drawData; - for (int index2 = 0; index2 < 5; ++index2) - { - Color colorArmorBody = drawinfo.colorArmorBody; - float num = 0.5f - (float) index2 * 0.1f; - colorArmorBody.R = (byte) ((double) colorArmorBody.R * (double) num); - colorArmorBody.G = (byte) ((double) colorArmorBody.G * (double) num); - colorArmorBody.B = (byte) ((double) colorArmorBody.B * (double) num); - colorArmorBody.A = (byte) ((double) colorArmorBody.A * (double) num); - Vector2 vector2 = -drawinfo.drawPlayer.beetleVel[index1] * (float) index2; - drawData = new DrawData(TextureAssets.Beetle.Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) (drawinfo.drawPlayer.height / 2))) + drawinfo.drawPlayer.beetlePos[index1] + vector2, new Rectangle?(new Rectangle(0, TextureAssets.Beetle.Height() / 3 * drawinfo.drawPlayer.beetleFrame + 1, TextureAssets.Beetle.Width(), TextureAssets.Beetle.Height() / 3 - 2)), colorArmorBody, 0.0f, new Vector2((float) (TextureAssets.Beetle.Width() / 2), (float) (TextureAssets.Beetle.Height() / 6)), 1f, drawinfo.playerEffect, 0); - drawinfo.DrawDataCache.Add(drawData); - } - drawData = new DrawData(TextureAssets.Beetle.Value, new Vector2((float) (int) ((double) drawinfo.Position.X - (double) Main.screenPosition.X + (double) (drawinfo.drawPlayer.width / 2)), (float) (int) ((double) drawinfo.Position.Y - (double) Main.screenPosition.Y + (double) (drawinfo.drawPlayer.height / 2))) + drawinfo.drawPlayer.beetlePos[index1], new Rectangle?(new Rectangle(0, TextureAssets.Beetle.Height() / 3 * drawinfo.drawPlayer.beetleFrame + 1, TextureAssets.Beetle.Width(), TextureAssets.Beetle.Height() / 3 - 2)), drawinfo.colorArmorBody, 0.0f, new Vector2((float) (TextureAssets.Beetle.Width() / 2), (float) (TextureAssets.Beetle.Height() / 6)), 1f, drawinfo.playerEffect, 0); - drawinfo.DrawDataCache.Add(drawData); - } - } - - private static Vector2 GetCompositeOffset_BackArm(ref PlayerDrawSet drawinfo) => new Vector2((float) (6 * (drawinfo.playerEffect.HasFlag((Enum) SpriteEffects.FlipHorizontally) ? -1 : 1)), (float) (2 * (drawinfo.playerEffect.HasFlag((Enum) SpriteEffects.FlipVertically) ? -1 : 1))); - - private static Vector2 GetCompositeOffset_FrontArm(ref PlayerDrawSet drawinfo) => new Vector2((float) (-5 * (drawinfo.playerEffect.HasFlag((Enum) SpriteEffects.FlipHorizontally) ? -1 : 1)), 0.0f); - - public static void DrawPlayer_TransformDrawData(ref PlayerDrawSet drawinfo) - { - double rotation = (double) drawinfo.rotation; - Vector2 vector2_1 = drawinfo.Position - Main.screenPosition + drawinfo.rotationOrigin; - Vector2 vector2_2 = drawinfo.drawPlayer.position + drawinfo.rotationOrigin; - Matrix rotationZ = Matrix.CreateRotationZ(drawinfo.rotation); - for (int index = 0; index < drawinfo.DustCache.Count; ++index) - { - Vector2 vector2_3 = Vector2.Transform(Main.dust[drawinfo.DustCache[index]].position - vector2_2, rotationZ); - Main.dust[drawinfo.DustCache[index]].position = vector2_3 + vector2_2; - } - for (int index = 0; index < drawinfo.GoreCache.Count; ++index) - { - Vector2 vector2_4 = Vector2.Transform(Main.gore[drawinfo.GoreCache[index]].position - vector2_2, rotationZ); - Main.gore[drawinfo.GoreCache[index]].position = vector2_4 + vector2_2; - } - for (int index = 0; index < drawinfo.DrawDataCache.Count; ++index) - { - DrawData drawData = drawinfo.DrawDataCache[index]; - if (!drawData.ignorePlayerRotation) - { - Vector2 vector2_5 = Vector2.Transform(drawData.position - vector2_1, rotationZ); - drawData.position = vector2_5 + vector2_1; - drawData.rotation += drawinfo.rotation; - drawinfo.DrawDataCache[index] = drawData; - } - } - } - - public static void DrawPlayer_ScaleDrawData(ref PlayerDrawSet drawinfo, float scale) - { - if ((double) scale == 1.0) - return; - Vector2 vector2_1 = drawinfo.Position + drawinfo.drawPlayer.Size * new Vector2(0.5f, 1f) - Main.screenPosition; - for (int index = 0; index < drawinfo.DrawDataCache.Count; ++index) - { - DrawData drawData = drawinfo.DrawDataCache[index]; - Vector2 vector2_2 = drawData.position - vector2_1; - drawData.position = vector2_1 + vector2_2 * scale; - drawData.scale *= scale; - drawinfo.DrawDataCache[index] = drawData; - } - } - - public static void DrawPlayer_AddSelectionGlow(ref PlayerDrawSet drawinfo) - { - if (drawinfo.selectionGlowColor == Color.Transparent) - return; - Color selectionGlowColor = drawinfo.selectionGlowColor; - List drawDataList = new List(); - drawDataList.AddRange((IEnumerable) PlayerDrawLayers.GetFlatColoredCloneData(ref drawinfo, new Vector2(0.0f, -2f), selectionGlowColor)); - drawDataList.AddRange((IEnumerable) PlayerDrawLayers.GetFlatColoredCloneData(ref drawinfo, new Vector2(0.0f, 2f), selectionGlowColor)); - drawDataList.AddRange((IEnumerable) PlayerDrawLayers.GetFlatColoredCloneData(ref drawinfo, new Vector2(2f, 0.0f), selectionGlowColor)); - drawDataList.AddRange((IEnumerable) PlayerDrawLayers.GetFlatColoredCloneData(ref drawinfo, new Vector2(-2f, 0.0f), selectionGlowColor)); - drawDataList.AddRange((IEnumerable) drawinfo.DrawDataCache); - drawinfo.DrawDataCache = drawDataList; - } - - public static void DrawPlayer_MakeIntoFirstFractalAfterImage(ref PlayerDrawSet drawinfo) - { - if (!drawinfo.drawPlayer.isFirstFractalAfterImage) - { - int num = drawinfo.drawPlayer.HeldItem.type != 4722 ? 0 : (drawinfo.drawPlayer.itemAnimation > 0 ? 1 : 0); - } - else - { - for (int index = 0; index < drawinfo.DrawDataCache.Count; ++index) - { - DrawData drawData = drawinfo.DrawDataCache[index]; - drawData.color *= drawinfo.drawPlayer.firstFractalAfterImageOpacity; - drawData.color.A = (byte) ((double) drawData.color.A * 0.800000011920929); - drawinfo.DrawDataCache[index] = drawData; - } - } - } - - public static void DrawPlayer_RenderAllLayers(ref PlayerDrawSet drawinfo) - { - int num = -1; - List drawDataCache = drawinfo.DrawDataCache; - Effect pixelShader = Main.pixelShader; - Projectile[] projectile = Main.projectile; - SpriteBatch spriteBatch = Main.spriteBatch; - for (int index = 0; index <= drawDataCache.Count; ++index) - { - if (drawinfo.projectileDrawPosition == index) - { - projectile[drawinfo.drawPlayer.heldProj].gfxOffY = drawinfo.drawPlayer.gfxOffY; - if (num != 0) - { - pixelShader.CurrentTechnique.Passes[0].Apply(); - num = 0; - } - try - { - Main.instance.DrawProj(drawinfo.drawPlayer.heldProj); - } - catch - { - projectile[drawinfo.drawPlayer.heldProj].active = false; - } - } - if (index != drawDataCache.Count) - { - DrawData cdd = drawDataCache[index]; - if (!cdd.sourceRect.HasValue) - cdd.sourceRect = new Rectangle?(cdd.texture.Frame()); - PlayerDrawHelper.SetShaderForData(drawinfo.drawPlayer, drawinfo.cHead, ref cdd); - num = cdd.shader; - if (cdd.texture != null) - cdd.Draw(spriteBatch); - } - } - pixelShader.CurrentTechnique.Passes[0].Apply(); - } - - public static void DrawPlayer_DrawSelectionRect(ref PlayerDrawSet drawinfo) - { - Vector2 lowest; - Vector2 highest; - SpriteRenderTargetHelper.GetDrawBoundary(drawinfo.DrawDataCache, out lowest, out highest); - Utils.DrawRect(Main.spriteBatch, lowest + Main.screenPosition, highest + Main.screenPosition, Color.White); - } - - private static bool IsArmorDrawnWhenInvisible(int torsoID) - { - switch (torsoID) - { - case 21: - case 22: - return false; - default: - return true; - } - } - - private static DrawData[] GetFlatColoredCloneData( - ref PlayerDrawSet drawinfo, - Vector2 offset, - Color color) - { - int colorOnlyShaderIndex = ContentSamples.CommonlyUsedContentSamples.ColorOnlyShaderIndex; - DrawData[] drawDataArray = new DrawData[drawinfo.DrawDataCache.Count]; - for (int index = 0; index < drawinfo.DrawDataCache.Count; ++index) - { - DrawData drawData = drawinfo.DrawDataCache[index]; - drawData.position += offset; - drawData.shader = colorOnlyShaderIndex; - drawData.color = color; - drawDataArray[index] = drawData; - } - return drawDataArray; - } - } -} diff --git a/DataStructures/PlayerDrawSet.cs b/DataStructures/PlayerDrawSet.cs deleted file mode 100644 index 7b32855..0000000 --- a/DataStructures/PlayerDrawSet.cs +++ /dev/null @@ -1,1554 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.PlayerDrawSet -// 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; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using Terraria.GameContent.Golf; -using Terraria.Graphics.Shaders; -using Terraria.ID; - -namespace Terraria.DataStructures -{ - public struct PlayerDrawSet - { - public List DrawDataCache; - public List DustCache; - public List GoreCache; - public Player drawPlayer; - public float shadow; - public Vector2 Position; - public int projectileDrawPosition; - public Vector2 ItemLocation; - public int armorAdjust; - public bool missingHand; - public bool missingArm; - public bool heldProjOverHand; - public int skinVar; - public bool fullHair; - public bool drawsBackHairWithoutHeadgear; - public bool hatHair; - public bool hideHair; - public int hairDyePacked; - public int skinDyePacked; - public float mountOffSet; - public int cHead; - public int cBody; - public int cLegs; - public int cHandOn; - public int cHandOff; - public int cBack; - public int cFront; - public int cShoe; - public int cWaist; - public int cShield; - public int cNeck; - public int cFace; - public int cBalloon; - public int cWings; - public int cCarpet; - public int cPortableStool; - public int cFloatingTube; - public int cUnicornHorn; - public int cLeinShampoo; - public SpriteEffects playerEffect; - public SpriteEffects itemEffect; - public Color colorHair; - public Color colorEyeWhites; - public Color colorEyes; - public Color colorHead; - public Color colorBodySkin; - public Color colorLegs; - public Color colorShirt; - public Color colorUnderShirt; - public Color colorPants; - public Color colorShoes; - public Color colorArmorHead; - public Color colorArmorBody; - public Color colorMount; - public Color colorArmorLegs; - public Color colorElectricity; - public int headGlowMask; - public int bodyGlowMask; - public int armGlowMask; - public int legsGlowMask; - public Color headGlowColor; - public Color bodyGlowColor; - public Color armGlowColor; - public Color legsGlowColor; - public Color ArkhalisColor; - public float stealth; - public Vector2 legVect; - public Vector2 bodyVect; - public Vector2 headVect; - public Color selectionGlowColor; - public float torsoOffset; - public bool hidesTopSkin; - public bool hidesBottomSkin; - public float rotation; - public Vector2 rotationOrigin; - public Rectangle hairFrame; - public bool backHairDraw; - public bool backPack; - public Color itemColor; - public bool usesCompositeTorso; - public bool usesCompositeFrontHandAcc; - public bool usesCompositeBackHandAcc; - public bool compShoulderOverFrontArm; - public Rectangle compBackShoulderFrame; - public Rectangle compFrontShoulderFrame; - public Rectangle compBackArmFrame; - public Rectangle compFrontArmFrame; - public Rectangle compTorsoFrame; - public float compositeBackArmRotation; - public float compositeFrontArmRotation; - public bool hideCompositeShoulders; - public Vector2 frontShoulderOffset; - public Vector2 backShoulderOffset; - public WeaponDrawOrder weaponDrawOrder; - public bool weaponOverFrontArm; - public bool isSitting; - public bool isSleeping; - public float seatYOffset; - public int sittingIndex; - public bool drawFrontAccInNeckAccLayer; - public Item heldItem; - public bool drawFloatingTube; - public bool drawUnicornHorn; - public Color floatingTubeColor; - public Vector2 helmetOffset; - - public Vector2 Center => new Vector2(this.Position.X + (float) (this.drawPlayer.width / 2), this.Position.Y + (float) (this.drawPlayer.height / 2)); - - public void BoringSetup( - Player player, - List drawData, - List dust, - List gore, - Vector2 drawPosition, - float shadowOpacity, - float rotation, - Vector2 rotationOrigin) - { - this.DrawDataCache = drawData; - this.DustCache = dust; - this.GoreCache = gore; - this.drawPlayer = player; - this.shadow = shadowOpacity; - this.rotation = rotation; - this.rotationOrigin = rotationOrigin; - this.heldItem = player.lastVisualizedSelectedItem; - this.cHead = this.drawPlayer.cHead; - this.cBody = this.drawPlayer.cBody; - this.cLegs = this.drawPlayer.cLegs; - if (this.drawPlayer.wearsRobe) - this.cLegs = this.cBody; - this.cHandOn = this.drawPlayer.cHandOn; - this.cHandOff = this.drawPlayer.cHandOff; - this.cBack = this.drawPlayer.cBack; - this.cFront = this.drawPlayer.cFront; - this.cShoe = this.drawPlayer.cShoe; - this.cWaist = this.drawPlayer.cWaist; - this.cShield = this.drawPlayer.cShield; - this.cNeck = this.drawPlayer.cNeck; - this.cFace = this.drawPlayer.cFace; - this.cBalloon = this.drawPlayer.cBalloon; - this.cWings = this.drawPlayer.cWings; - this.cCarpet = this.drawPlayer.cCarpet; - this.cPortableStool = this.drawPlayer.cPortalbeStool; - this.cFloatingTube = this.drawPlayer.cFloatingTube; - this.cUnicornHorn = this.drawPlayer.cUnicornHorn; - this.cLeinShampoo = this.drawPlayer.cLeinShampoo; - this.isSitting = this.drawPlayer.sitting.isSitting; - this.seatYOffset = 0.0f; - this.sittingIndex = 0; - Vector2 posOffset1 = Vector2.Zero; - this.drawPlayer.sitting.GetSittingOffsetInfo(this.drawPlayer, out posOffset1, out this.seatYOffset); - if (this.isSitting) - this.sittingIndex = this.drawPlayer.sitting.sittingIndex; - if (this.drawPlayer.mount.Active && this.drawPlayer.mount.Type == 17) - this.isSitting = true; - if (this.drawPlayer.mount.Active && this.drawPlayer.mount.Type == 23) - this.isSitting = true; - if (this.drawPlayer.mount.Active && this.drawPlayer.mount.Type == 45) - this.isSitting = true; - this.isSleeping = this.drawPlayer.sleeping.isSleeping; - this.Position = drawPosition; - if (this.isSitting) - { - this.torsoOffset = this.seatYOffset; - this.Position += posOffset1; - } - else - this.sittingIndex = -1; - if (this.isSleeping) - { - this.rotationOrigin = player.Size / 2f; - Vector2 posOffset2; - this.drawPlayer.sleeping.GetSleepingOffsetInfo(this.drawPlayer, out posOffset2); - this.Position += posOffset2; - } - this.weaponDrawOrder = WeaponDrawOrder.BehindFrontArm; - if (this.heldItem.type == 4952) - this.weaponDrawOrder = WeaponDrawOrder.BehindBackArm; - if (GolfHelper.IsPlayerHoldingClub(player) && player.itemAnimation > player.itemAnimationMax) - this.weaponDrawOrder = WeaponDrawOrder.OverFrontArm; - this.projectileDrawPosition = -1; - this.ItemLocation = this.Position + (this.drawPlayer.itemLocation - this.drawPlayer.position); - this.armorAdjust = 0; - this.missingHand = false; - this.missingArm = false; - this.heldProjOverHand = false; - this.skinVar = this.drawPlayer.skinVariant; - if (this.drawPlayer.body == 77 || this.drawPlayer.body == 103 || this.drawPlayer.body == 41 || this.drawPlayer.body == 100 || this.drawPlayer.body == 10 || this.drawPlayer.body == 11 || this.drawPlayer.body == 12 || this.drawPlayer.body == 13 || this.drawPlayer.body == 14 || this.drawPlayer.body == 43 || this.drawPlayer.body == 15 || this.drawPlayer.body == 16 || this.drawPlayer.body == 20 || this.drawPlayer.body == 39 || this.drawPlayer.body == 50 || this.drawPlayer.body == 38 || this.drawPlayer.body == 40 || this.drawPlayer.body == 57 || this.drawPlayer.body == 44 || this.drawPlayer.body == 52 || this.drawPlayer.body == 53 || this.drawPlayer.body == 68 || this.drawPlayer.body == 81 || this.drawPlayer.body == 85 || this.drawPlayer.body == 88 || this.drawPlayer.body == 98 || this.drawPlayer.body == 86 || this.drawPlayer.body == 87 || this.drawPlayer.body == 99 || this.drawPlayer.body == 165 || this.drawPlayer.body == 166 || this.drawPlayer.body == 167 || this.drawPlayer.body == 171 || this.drawPlayer.body == 45 || this.drawPlayer.body == 168 || this.drawPlayer.body == 169 || this.drawPlayer.body == 42 || this.drawPlayer.body == 180 || this.drawPlayer.body == 181 || this.drawPlayer.body == 183 || this.drawPlayer.body == 186 || this.drawPlayer.body == 187 || this.drawPlayer.body == 188 || this.drawPlayer.body == 64 || this.drawPlayer.body == 189 || this.drawPlayer.body == 191 || this.drawPlayer.body == 192 || this.drawPlayer.body == 198 || this.drawPlayer.body == 199 || this.drawPlayer.body == 202 || this.drawPlayer.body == 203 || this.drawPlayer.body == 58 || this.drawPlayer.body == 59 || this.drawPlayer.body == 60 || this.drawPlayer.body == 61 || this.drawPlayer.body == 62 || this.drawPlayer.body == 63 || this.drawPlayer.body == 36 || this.drawPlayer.body == 104 || this.drawPlayer.body == 184 || this.drawPlayer.body == 74 || this.drawPlayer.body == 78 || this.drawPlayer.body == 185 || this.drawPlayer.body == 196 || this.drawPlayer.body == 197 || this.drawPlayer.body == 182 || this.drawPlayer.body == 87 || this.drawPlayer.body == 76 || this.drawPlayer.body == 209 || this.drawPlayer.body == 168 || this.drawPlayer.body == 210 || this.drawPlayer.body == 211 || this.drawPlayer.body == 213) - this.missingHand = true; - this.missingArm = this.drawPlayer.body != 83; - if (this.drawPlayer.heldProj >= 0 && (double) this.shadow == 0.0) - { - switch (Main.projectile[this.drawPlayer.heldProj].type) - { - case 460: - case 535: - case 600: - this.heldProjOverHand = true; - break; - } - } - this.drawPlayer.GetHairSettings(out this.fullHair, out this.hatHair, out this.hideHair, out this.backHairDraw, out this.drawsBackHairWithoutHeadgear); - this.hairDyePacked = PlayerDrawHelper.PackShader((int) this.drawPlayer.hairDye, PlayerDrawHelper.ShaderConfiguration.HairShader); - if (this.drawPlayer.head == 0 && this.drawPlayer.hairDye == (byte) 0) - this.hairDyePacked = PlayerDrawHelper.PackShader(1, PlayerDrawHelper.ShaderConfiguration.HairShader); - this.skinDyePacked = player.skinDyePacked; - if (this.drawPlayer.isDisplayDollOrInanimate) - { - Point tileCoordinates = this.Center.ToTileCoordinates(); - bool actuallySelected; - if (Main.InSmartCursorHighlightArea(tileCoordinates.X, tileCoordinates.Y, out actuallySelected)) - { - Color color = Lighting.GetColor(tileCoordinates.X, tileCoordinates.Y); - int averageTileLighting = ((int) color.R + (int) color.G + (int) color.B) / 3; - if (averageTileLighting > 10) - this.selectionGlowColor = Colors.GetSelectionGlowColor(actuallySelected, averageTileLighting); - } - } - this.mountOffSet = this.drawPlayer.HeightOffsetVisual; - this.Position.Y -= this.mountOffSet; - Mount.currentShader = !this.drawPlayer.mount.Active ? 0 : (this.drawPlayer.mount.Cart ? this.drawPlayer.cMinecart : this.drawPlayer.cMount); - this.playerEffect = SpriteEffects.None; - this.itemEffect = SpriteEffects.FlipHorizontally; - this.colorHair = this.drawPlayer.GetImmuneAlpha(this.drawPlayer.GetHairColor(), this.shadow); - this.colorEyeWhites = this.drawPlayer.GetImmuneAlpha(Lighting.GetColor((int) ((double) this.Position.X + (double) this.drawPlayer.width * 0.5) / 16, (int) (((double) this.Position.Y + (double) this.drawPlayer.height * 0.25) / 16.0), Color.White), this.shadow); - this.colorEyes = this.drawPlayer.GetImmuneAlpha(Lighting.GetColor((int) ((double) this.Position.X + (double) this.drawPlayer.width * 0.5) / 16, (int) (((double) this.Position.Y + (double) this.drawPlayer.height * 0.25) / 16.0), this.drawPlayer.eyeColor), this.shadow); - this.colorHead = this.drawPlayer.GetImmuneAlpha(Lighting.GetColor((int) ((double) this.Position.X + (double) this.drawPlayer.width * 0.5) / 16, (int) (((double) this.Position.Y + (double) this.drawPlayer.height * 0.25) / 16.0), this.drawPlayer.skinColor), this.shadow); - this.colorBodySkin = this.drawPlayer.GetImmuneAlpha(Lighting.GetColor((int) ((double) this.Position.X + (double) this.drawPlayer.width * 0.5) / 16, (int) (((double) this.Position.Y + (double) this.drawPlayer.height * 0.5) / 16.0), this.drawPlayer.skinColor), this.shadow); - this.colorLegs = this.drawPlayer.GetImmuneAlpha(Lighting.GetColor((int) ((double) this.Position.X + (double) this.drawPlayer.width * 0.5) / 16, (int) (((double) this.Position.Y + (double) this.drawPlayer.height * 0.75) / 16.0), this.drawPlayer.skinColor), this.shadow); - this.colorShirt = this.drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int) ((double) this.Position.X + (double) this.drawPlayer.width * 0.5) / 16, (int) (((double) this.Position.Y + (double) this.drawPlayer.height * 0.5) / 16.0), this.drawPlayer.shirtColor), this.shadow); - this.colorUnderShirt = this.drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int) ((double) this.Position.X + (double) this.drawPlayer.width * 0.5) / 16, (int) (((double) this.Position.Y + (double) this.drawPlayer.height * 0.5) / 16.0), this.drawPlayer.underShirtColor), this.shadow); - this.colorPants = this.drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int) ((double) this.Position.X + (double) this.drawPlayer.width * 0.5) / 16, (int) (((double) this.Position.Y + (double) this.drawPlayer.height * 0.75) / 16.0), this.drawPlayer.pantsColor), this.shadow); - this.colorShoes = this.drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int) ((double) this.Position.X + (double) this.drawPlayer.width * 0.5) / 16, (int) (((double) this.Position.Y + (double) this.drawPlayer.height * 0.75) / 16.0), this.drawPlayer.shoeColor), this.shadow); - this.colorArmorHead = this.drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int) ((double) this.Position.X + (double) this.drawPlayer.width * 0.5) / 16, (int) ((double) this.Position.Y + (double) this.drawPlayer.height * 0.25) / 16, Color.White), this.shadow); - this.colorArmorBody = this.drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int) ((double) this.Position.X + (double) this.drawPlayer.width * 0.5) / 16, (int) ((double) this.Position.Y + (double) this.drawPlayer.height * 0.5) / 16, Color.White), this.shadow); - this.colorMount = this.colorArmorBody; - this.colorArmorLegs = this.drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int) ((double) this.Position.X + (double) this.drawPlayer.width * 0.5) / 16, (int) ((double) this.Position.Y + (double) this.drawPlayer.height * 0.75) / 16, Color.White), this.shadow); - this.floatingTubeColor = this.drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int) ((double) this.Position.X + (double) this.drawPlayer.width * 0.5) / 16, (int) ((double) this.Position.Y + (double) this.drawPlayer.height * 0.75) / 16, Color.White), this.shadow); - this.colorElectricity = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 100); - int num1 = 0; - int num2 = 0; - int num3 = 0; - int num4 = 0; - this.headGlowMask = -1; - this.bodyGlowMask = -1; - this.armGlowMask = -1; - this.legsGlowMask = -1; - this.headGlowColor = Color.Transparent; - this.bodyGlowColor = Color.Transparent; - this.armGlowColor = Color.Transparent; - this.legsGlowColor = Color.Transparent; - switch (this.drawPlayer.head) - { - case 169: - ++num1; - break; - case 170: - ++num2; - break; - case 171: - ++num3; - break; - case 189: - ++num4; - break; - } - switch (this.drawPlayer.body) - { - case 175: - ++num1; - break; - case 176: - ++num2; - break; - case 177: - ++num3; - break; - case 190: - ++num4; - break; - } - switch (this.drawPlayer.legs) - { - case 110: - int num5 = num1 + 1; - break; - case 111: - int num6 = num2 + 1; - break; - case 112: - int num7 = num3 + 1; - break; - case 130: - int num8 = num4 + 1; - break; - } - int num9 = 3; - int num10 = 3; - int num11 = 3; - int num12 = 3; - this.ArkhalisColor = this.drawPlayer.underShirtColor; - this.ArkhalisColor.A = (byte) 180; - if (this.drawPlayer.head == 169) - { - this.headGlowMask = 15; - byte num13 = (byte) (62.5 * (double) (1 + num9)); - this.headGlowColor = new Color((int) num13, (int) num13, (int) num13, 0); - } - else if (this.drawPlayer.head == 216) - { - this.headGlowMask = 256; - byte num14 = 127; - this.headGlowColor = new Color((int) num14, (int) num14, (int) num14, 0); - } - else if (this.drawPlayer.head == 210) - { - this.headGlowMask = 242; - byte num15 = 127; - this.headGlowColor = new Color((int) num15, (int) num15, (int) num15, 0); - } - else if (this.drawPlayer.head == 214) - { - this.headGlowMask = 245; - this.headGlowColor = this.ArkhalisColor; - } - else if (this.drawPlayer.head == 240) - { - this.headGlowMask = 273; - this.headGlowColor = new Color(230, 230, 230, 60); - } - else if (this.drawPlayer.head == 170) - { - this.headGlowMask = 16; - byte num16 = (byte) (62.5 * (double) (1 + num10)); - this.headGlowColor = new Color((int) num16, (int) num16, (int) num16, 0); - } - else if (this.drawPlayer.head == 189) - { - this.headGlowMask = 184; - byte num17 = (byte) (62.5 * (double) (1 + num12)); - this.headGlowColor = new Color((int) num17, (int) num17, (int) num17, 0); - this.colorArmorHead = this.drawPlayer.GetImmuneAlphaPure(new Color((int) num17, (int) num17, (int) num17, (int) byte.MaxValue), this.shadow); - } - else if (this.drawPlayer.head == 171) - { - byte num18 = (byte) (62.5 * (double) (1 + num11)); - this.colorArmorHead = this.drawPlayer.GetImmuneAlphaPure(new Color((int) num18, (int) num18, (int) num18, (int) byte.MaxValue), this.shadow); - } - else if (this.drawPlayer.head == 175) - { - this.headGlowMask = 41; - this.headGlowColor = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); - } - else if (this.drawPlayer.head == 193) - { - this.headGlowMask = 209; - this.headGlowColor = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue); - } - else if (this.drawPlayer.head == 109) - { - this.headGlowMask = 208; - this.headGlowColor = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); - } - else if (this.drawPlayer.head == 178) - { - this.headGlowMask = 96; - this.headGlowColor = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); - } - if (this.drawPlayer.body == 175) - { - this.bodyGlowMask = !this.drawPlayer.Male ? 18 : 13; - byte num19 = (byte) (62.5 * (double) (1 + num9)); - this.bodyGlowColor = new Color((int) num19, (int) num19, (int) num19, 0); - } - else if (this.drawPlayer.body == 208) - { - this.bodyGlowMask = !this.drawPlayer.Male ? 247 : 246; - this.armGlowMask = 248; - this.bodyGlowColor = this.ArkhalisColor; - this.armGlowColor = this.ArkhalisColor; - } - else if (this.drawPlayer.body == 227) - { - this.bodyGlowColor = new Color(230, 230, 230, 60); - this.armGlowColor = new Color(230, 230, 230, 60); - } - else if (this.drawPlayer.body == 190) - { - this.bodyGlowMask = !this.drawPlayer.Male ? 186 : 185; - this.armGlowMask = 188; - byte num20 = (byte) (62.5 * (double) (1 + num12)); - this.bodyGlowColor = new Color((int) num20, (int) num20, (int) num20, 0); - this.armGlowColor = new Color((int) num20, (int) num20, (int) num20, 0); - this.colorArmorBody = this.drawPlayer.GetImmuneAlphaPure(new Color((int) num20, (int) num20, (int) num20, (int) byte.MaxValue), this.shadow); - } - else if (this.drawPlayer.body == 176) - { - this.bodyGlowMask = !this.drawPlayer.Male ? 19 : 14; - this.armGlowMask = 12; - byte num21 = (byte) (62.5 * (double) (1 + num10)); - this.bodyGlowColor = new Color((int) num21, (int) num21, (int) num21, 0); - this.armGlowColor = new Color((int) num21, (int) num21, (int) num21, 0); - } - else if (this.drawPlayer.body == 194) - { - this.bodyGlowMask = 210; - this.armGlowMask = 211; - this.bodyGlowColor = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue); - this.armGlowColor = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue); - } - else if (this.drawPlayer.body == 177) - { - byte num22 = (byte) (62.5 * (double) (1 + num11)); - this.colorArmorBody = this.drawPlayer.GetImmuneAlphaPure(new Color((int) num22, (int) num22, (int) num22, (int) byte.MaxValue), this.shadow); - } - else if (this.drawPlayer.body == 179) - { - this.bodyGlowMask = !this.drawPlayer.Male ? 43 : 42; - this.armGlowMask = 44; - this.bodyGlowColor = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); - this.armGlowColor = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); - } - if (this.drawPlayer.legs == 111) - { - this.legsGlowMask = 17; - byte num23 = (byte) (62.5 * (double) (1 + num10)); - this.legsGlowColor = new Color((int) num23, (int) num23, (int) num23, 0); - } - else if (this.drawPlayer.legs == 157) - { - this.legsGlowMask = 249; - this.legsGlowColor = this.ArkhalisColor; - } - else if (this.drawPlayer.legs == 158) - { - this.legsGlowMask = 250; - this.legsGlowColor = this.ArkhalisColor; - } - else if (this.drawPlayer.legs == 210) - { - this.legsGlowMask = 274; - this.legsGlowColor = new Color(230, 230, 230, 60); - } - else if (this.drawPlayer.legs == 110) - { - this.legsGlowMask = 199; - byte num24 = (byte) (62.5 * (double) (1 + num9)); - this.legsGlowColor = new Color((int) num24, (int) num24, (int) num24, 0); - } - else if (this.drawPlayer.legs == 112) - { - byte num25 = (byte) (62.5 * (double) (1 + num11)); - this.colorArmorLegs = this.drawPlayer.GetImmuneAlphaPure(new Color((int) num25, (int) num25, (int) num25, (int) byte.MaxValue), this.shadow); - } - else if (this.drawPlayer.legs == 134) - { - this.legsGlowMask = 212; - this.legsGlowColor = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue); - } - else if (this.drawPlayer.legs == 130) - { - byte num26 = (byte) ((int) sbyte.MaxValue * (1 + num12)); - this.legsGlowMask = 187; - this.legsGlowColor = new Color((int) num26, (int) num26, (int) num26, 0); - this.colorArmorLegs = this.drawPlayer.GetImmuneAlphaPure(new Color((int) num26, (int) num26, (int) num26, (int) byte.MaxValue), this.shadow); - } - float shadow = this.shadow; - this.headGlowColor = this.drawPlayer.GetImmuneAlphaPure(this.headGlowColor, shadow); - this.bodyGlowColor = this.drawPlayer.GetImmuneAlphaPure(this.bodyGlowColor, shadow); - this.armGlowColor = this.drawPlayer.GetImmuneAlphaPure(this.armGlowColor, shadow); - this.legsGlowColor = this.drawPlayer.GetImmuneAlphaPure(this.legsGlowColor, shadow); - if (this.drawPlayer.head > 0 && this.drawPlayer.head < 266) - { - Main.instance.LoadArmorHead(this.drawPlayer.head); - int i = ArmorIDs.Head.Sets.FrontToBackID[this.drawPlayer.head]; - if (i >= 0) - Main.instance.LoadArmorHead(i); - } - if (this.drawPlayer.body > 0 && this.drawPlayer.body < 235) - Main.instance.LoadArmorBody(this.drawPlayer.body); - if (this.drawPlayer.legs > 0 && this.drawPlayer.legs < 218) - Main.instance.LoadArmorLegs(this.drawPlayer.legs); - if (this.drawPlayer.handon > (sbyte) 0 && this.drawPlayer.handon < (sbyte) 22) - Main.instance.LoadAccHandsOn((int) this.drawPlayer.handon); - if (this.drawPlayer.handoff > (sbyte) 0 && this.drawPlayer.handoff < (sbyte) 14) - Main.instance.LoadAccHandsOff((int) this.drawPlayer.handoff); - if (this.drawPlayer.back > (sbyte) 0 && this.drawPlayer.back < (sbyte) 30) - Main.instance.LoadAccBack((int) this.drawPlayer.back); - if (this.drawPlayer.front > (sbyte) 0 && this.drawPlayer.front < (sbyte) 9) - Main.instance.LoadAccFront((int) this.drawPlayer.front); - if (this.drawPlayer.shoe > (sbyte) 0 && this.drawPlayer.shoe < (sbyte) 25) - Main.instance.LoadAccShoes((int) this.drawPlayer.shoe); - if (this.drawPlayer.waist > (sbyte) 0 && this.drawPlayer.waist < (sbyte) 17) - Main.instance.LoadAccWaist((int) this.drawPlayer.waist); - if (this.drawPlayer.shield > (sbyte) 0 && this.drawPlayer.shield < (sbyte) 10) - Main.instance.LoadAccShield((int) this.drawPlayer.shield); - if (this.drawPlayer.neck > (sbyte) 0 && this.drawPlayer.neck < (sbyte) 11) - Main.instance.LoadAccNeck((int) this.drawPlayer.neck); - if (this.drawPlayer.face > (sbyte) 0 && this.drawPlayer.face < (sbyte) 16) - Main.instance.LoadAccFace((int) this.drawPlayer.face); - if (this.drawPlayer.balloon > (sbyte) 0 && this.drawPlayer.balloon < (sbyte) 18) - Main.instance.LoadAccBalloon((int) this.drawPlayer.balloon); - Main.instance.LoadHair(this.drawPlayer.hair); - if (this.drawPlayer.isHatRackDoll) - { - this.colorLegs = Color.Transparent; - this.colorBodySkin = Color.Transparent; - this.colorHead = Color.Transparent; - this.colorHair = Color.Transparent; - this.colorEyes = Color.Transparent; - this.colorEyeWhites = Color.Transparent; - } - if (this.drawPlayer.isDisplayDollOrInanimate) - { - int localShaderIndex; - PlayerDrawHelper.ShaderConfiguration shaderType; - PlayerDrawHelper.UnpackShader(this.skinDyePacked, out localShaderIndex, out shaderType); - if (shaderType == PlayerDrawHelper.ShaderConfiguration.TilePaintID && localShaderIndex == 31) - { - this.colorHead = Color.White; - this.colorBodySkin = Color.White; - this.colorLegs = Color.White; - this.colorEyes = Color.White; - this.colorEyeWhites = Color.White; - this.colorArmorHead = Color.White; - this.colorArmorBody = Color.White; - this.colorArmorLegs = Color.White; - } - } - if (!this.drawPlayer.isDisplayDollOrInanimate) - { - if ((this.drawPlayer.head == 78 || this.drawPlayer.head == 79 || this.drawPlayer.head == 80) && this.drawPlayer.body == 51 && this.drawPlayer.legs == 47) - { - float num27 = (float) ((double) Main.mouseTextColor / 200.0 - 0.300000011920929); - if ((double) this.shadow != 0.0) - num27 = 0.0f; - this.colorArmorHead.R = (byte) ((double) this.colorArmorHead.R * (double) num27); - this.colorArmorHead.G = (byte) ((double) this.colorArmorHead.G * (double) num27); - this.colorArmorHead.B = (byte) ((double) this.colorArmorHead.B * (double) num27); - this.colorArmorBody.R = (byte) ((double) this.colorArmorBody.R * (double) num27); - this.colorArmorBody.G = (byte) ((double) this.colorArmorBody.G * (double) num27); - this.colorArmorBody.B = (byte) ((double) this.colorArmorBody.B * (double) num27); - this.colorArmorLegs.R = (byte) ((double) this.colorArmorLegs.R * (double) num27); - this.colorArmorLegs.G = (byte) ((double) this.colorArmorLegs.G * (double) num27); - this.colorArmorLegs.B = (byte) ((double) this.colorArmorLegs.B * (double) num27); - } - if (this.drawPlayer.head == 193 && this.drawPlayer.body == 194 && this.drawPlayer.legs == 134) - { - float num28 = (float) (0.600000023841858 - (double) this.drawPlayer.ghostFade * 0.300000011920929); - if ((double) this.shadow != 0.0) - num28 = 0.0f; - this.colorArmorHead.R = (byte) ((double) this.colorArmorHead.R * (double) num28); - this.colorArmorHead.G = (byte) ((double) this.colorArmorHead.G * (double) num28); - this.colorArmorHead.B = (byte) ((double) this.colorArmorHead.B * (double) num28); - this.colorArmorBody.R = (byte) ((double) this.colorArmorBody.R * (double) num28); - this.colorArmorBody.G = (byte) ((double) this.colorArmorBody.G * (double) num28); - this.colorArmorBody.B = (byte) ((double) this.colorArmorBody.B * (double) num28); - this.colorArmorLegs.R = (byte) ((double) this.colorArmorLegs.R * (double) num28); - this.colorArmorLegs.G = (byte) ((double) this.colorArmorLegs.G * (double) num28); - this.colorArmorLegs.B = (byte) ((double) this.colorArmorLegs.B * (double) num28); - } - if ((double) this.shadow > 0.0) - { - this.colorLegs = Color.Transparent; - this.colorBodySkin = Color.Transparent; - this.colorHead = Color.Transparent; - this.colorHair = Color.Transparent; - this.colorEyes = Color.Transparent; - this.colorEyeWhites = Color.Transparent; - } - } - float R = 1f; - float G = 1f; - float B = 1f; - float A = 1f; - if (this.drawPlayer.honey && Main.rand.Next(30) == 0 && (double) this.shadow == 0.0) - { - Dust dust1 = Dust.NewDustDirect(this.Position, this.drawPlayer.width, this.drawPlayer.height, 152, Alpha: 150); - dust1.velocity.Y = 0.3f; - dust1.velocity.X *= 0.1f; - dust1.scale += (float) Main.rand.Next(3, 4) * 0.1f; - dust1.alpha = 100; - dust1.noGravity = true; - dust1.velocity += this.drawPlayer.velocity * 0.1f; - this.DustCache.Add(dust1.dustIndex); - } - if (this.drawPlayer.dryadWard && (double) this.drawPlayer.velocity.X != 0.0 && Main.rand.Next(4) == 0) - { - Dust dust2 = Dust.NewDustDirect(new Vector2(this.drawPlayer.position.X - 2f, (float) ((double) this.drawPlayer.position.Y + (double) this.drawPlayer.height - 2.0)), this.drawPlayer.width + 4, 4, 163, Alpha: 100, Scale: 1.5f); - dust2.noGravity = true; - dust2.noLight = true; - dust2.velocity *= 0.0f; - this.DustCache.Add(dust2.dustIndex); - } - if (this.drawPlayer.poisoned) - { - if (Main.rand.Next(50) == 0 && (double) this.shadow == 0.0) - { - Dust dust3 = Dust.NewDustDirect(this.Position, this.drawPlayer.width, this.drawPlayer.height, 46, Alpha: 150, Scale: 0.2f); - dust3.noGravity = true; - dust3.fadeIn = 1.9f; - this.DustCache.Add(dust3.dustIndex); - } - R *= 0.65f; - B *= 0.75f; - } - if (this.drawPlayer.venom) - { - if (Main.rand.Next(10) == 0 && (double) this.shadow == 0.0) - { - Dust dust4 = Dust.NewDustDirect(this.Position, this.drawPlayer.width, this.drawPlayer.height, 171, Alpha: 100, Scale: 0.5f); - dust4.noGravity = true; - dust4.fadeIn = 1.5f; - this.DustCache.Add(dust4.dustIndex); - } - G *= 0.45f; - R *= 0.75f; - } - if (this.drawPlayer.onFire) - { - if (Main.rand.Next(4) == 0 && (double) this.shadow == 0.0) - { - Dust dust5 = Dust.NewDustDirect(new Vector2(this.Position.X - 2f, this.Position.Y - 2f), this.drawPlayer.width + 4, this.drawPlayer.height + 4, 6, this.drawPlayer.velocity.X * 0.4f, this.drawPlayer.velocity.Y * 0.4f, 100, Scale: 3f); - dust5.noGravity = true; - dust5.velocity *= 1.8f; - dust5.velocity.Y -= 0.5f; - this.DustCache.Add(dust5.dustIndex); - } - B *= 0.6f; - G *= 0.7f; - } - if (this.drawPlayer.dripping && (double) this.shadow == 0.0 && Main.rand.Next(4) != 0) - { - Vector2 position = this.Position; - position.X -= 2f; - position.Y -= 2f; - if (Main.rand.Next(2) == 0) - { - Dust dust6 = Dust.NewDustDirect(position, this.drawPlayer.width + 4, this.drawPlayer.height + 2, 211, Alpha: 50, Scale: 0.8f); - if (Main.rand.Next(2) == 0) - dust6.alpha += 25; - if (Main.rand.Next(2) == 0) - dust6.alpha += 25; - dust6.noLight = true; - dust6.velocity *= 0.2f; - dust6.velocity.Y += 0.2f; - dust6.velocity += this.drawPlayer.velocity; - this.DustCache.Add(dust6.dustIndex); - } - else - { - Dust dust7 = Dust.NewDustDirect(position, this.drawPlayer.width + 8, this.drawPlayer.height + 8, 211, Alpha: 50, Scale: 1.1f); - if (Main.rand.Next(2) == 0) - dust7.alpha += 25; - if (Main.rand.Next(2) == 0) - dust7.alpha += 25; - dust7.noLight = true; - dust7.noGravity = true; - dust7.velocity *= 0.2f; - ++dust7.velocity.Y; - dust7.velocity += this.drawPlayer.velocity; - this.DustCache.Add(dust7.dustIndex); - } - } - if (this.drawPlayer.drippingSlime) - { - int Alpha = 175; - Color newColor = new Color(0, 80, (int) byte.MaxValue, 100); - if (Main.rand.Next(4) != 0 && (double) this.shadow == 0.0) - { - Vector2 position = this.Position; - position.X -= 2f; - position.Y -= 2f; - if (Main.rand.Next(2) == 0) - { - Dust dust8 = Dust.NewDustDirect(position, this.drawPlayer.width + 4, this.drawPlayer.height + 2, 4, Alpha: Alpha, newColor: newColor, Scale: 1.4f); - if (Main.rand.Next(2) == 0) - dust8.alpha += 25; - if (Main.rand.Next(2) == 0) - dust8.alpha += 25; - dust8.noLight = true; - dust8.velocity *= 0.2f; - dust8.velocity.Y += 0.2f; - dust8.velocity += this.drawPlayer.velocity; - this.DustCache.Add(dust8.dustIndex); - } - } - R *= 0.8f; - G *= 0.8f; - } - if (this.drawPlayer.drippingSparkleSlime) - { - int Alpha = 100; - if (Main.rand.Next(4) != 0 && (double) this.shadow == 0.0) - { - Vector2 position = this.Position; - position.X -= 2f; - position.Y -= 2f; - if (Main.rand.Next(4) == 0) - { - Color rgb = Main.hslToRgb((float) (0.699999988079071 + 0.200000002980232 * (double) Main.rand.NextFloat()), 1f, 0.5f); - rgb.A /= (byte) 2; - Dust dust9 = Dust.NewDustDirect(position, this.drawPlayer.width + 4, this.drawPlayer.height + 2, 4, Alpha: Alpha, newColor: rgb, Scale: 0.65f); - if (Main.rand.Next(2) == 0) - dust9.alpha += 25; - if (Main.rand.Next(2) == 0) - dust9.alpha += 25; - dust9.noLight = true; - dust9.velocity *= 0.2f; - dust9.velocity += this.drawPlayer.velocity * 0.7f; - dust9.fadeIn = 0.8f; - this.DustCache.Add(dust9.dustIndex); - } - if (Main.rand.Next(30) == 0) - { - Main.hslToRgb((float) (0.699999988079071 + 0.200000002980232 * (double) Main.rand.NextFloat()), 1f, 0.5f).A /= (byte) 2; - Dust dust10 = Dust.NewDustDirect(position, this.drawPlayer.width + 4, this.drawPlayer.height + 2, 43, Alpha: 254, newColor: new Color((int) sbyte.MaxValue, (int) sbyte.MaxValue, (int) sbyte.MaxValue, 0), Scale: 0.45f); - dust10.noLight = true; - dust10.velocity.X *= 0.0f; - dust10.velocity *= 0.03f; - dust10.fadeIn = 0.6f; - this.DustCache.Add(dust10.dustIndex); - } - } - R *= 0.94f; - G *= 0.82f; - } - if (this.drawPlayer.ichor) - B = 0.0f; - if (this.drawPlayer.electrified && (double) this.shadow == 0.0 && Main.rand.Next(3) == 0) - { - Dust dust11 = Dust.NewDustDirect(new Vector2(this.Position.X - 2f, this.Position.Y - 2f), this.drawPlayer.width + 4, this.drawPlayer.height + 4, 226, Alpha: 100, Scale: 0.5f); - dust11.velocity *= 1.6f; - --dust11.velocity.Y; - dust11.position = Vector2.Lerp(dust11.position, this.drawPlayer.Center, 0.5f); - this.DustCache.Add(dust11.dustIndex); - } - if (this.drawPlayer.burned) - { - if ((double) this.shadow == 0.0) - { - Dust dust12 = Dust.NewDustDirect(new Vector2(this.Position.X - 2f, this.Position.Y - 2f), this.drawPlayer.width + 4, this.drawPlayer.height + 4, 6, this.drawPlayer.velocity.X * 0.4f, this.drawPlayer.velocity.Y * 0.4f, 100, Scale: 2f); - dust12.noGravity = true; - dust12.velocity *= 1.8f; - dust12.velocity.Y -= 0.75f; - this.DustCache.Add(dust12.dustIndex); - } - R = 1f; - B *= 0.6f; - G *= 0.7f; - } - if (this.drawPlayer.onFrostBurn) - { - if (Main.rand.Next(4) == 0 && (double) this.shadow == 0.0) - { - Dust dust13 = Dust.NewDustDirect(new Vector2(this.Position.X - 2f, this.Position.Y - 2f), this.drawPlayer.width + 4, this.drawPlayer.height + 4, 135, this.drawPlayer.velocity.X * 0.4f, this.drawPlayer.velocity.Y * 0.4f, 100, Scale: 3f); - dust13.noGravity = true; - dust13.velocity *= 1.8f; - dust13.velocity.Y -= 0.5f; - this.DustCache.Add(dust13.dustIndex); - } - R *= 0.5f; - G *= 0.7f; - } - if (this.drawPlayer.onFire2) - { - if (Main.rand.Next(4) == 0 && (double) this.shadow == 0.0) - { - Dust dust14 = Dust.NewDustDirect(new Vector2(this.Position.X - 2f, this.Position.Y - 2f), this.drawPlayer.width + 4, this.drawPlayer.height + 4, 75, this.drawPlayer.velocity.X * 0.4f, this.drawPlayer.velocity.Y * 0.4f, 100, Scale: 3f); - dust14.noGravity = true; - dust14.velocity *= 1.8f; - dust14.velocity.Y -= 0.5f; - this.DustCache.Add(dust14.dustIndex); - } - B *= 0.6f; - G *= 0.7f; - } - if (this.drawPlayer.noItems) - { - G *= 0.8f; - R *= 0.65f; - } - if (this.drawPlayer.blind) - { - G *= 0.65f; - R *= 0.7f; - } - if (this.drawPlayer.bleed) - { - G *= 0.9f; - B *= 0.9f; - if (!this.drawPlayer.dead && Main.rand.Next(30) == 0 && (double) this.shadow == 0.0) - { - Dust dust15 = Dust.NewDustDirect(this.Position, this.drawPlayer.width, this.drawPlayer.height, 5); - dust15.velocity.Y += 0.5f; - dust15.velocity *= 0.25f; - this.DustCache.Add(dust15.dustIndex); - } - } - if ((double) this.shadow == 0.0 && this.drawPlayer.palladiumRegen && this.drawPlayer.statLife < this.drawPlayer.statLifeMax2 && Main.instance.IsActive && !Main.gamePaused && this.drawPlayer.miscCounter % 10 == 0 && (double) this.shadow == 0.0) - { - Vector2 Position; - Position.X = this.Position.X + (float) Main.rand.Next(this.drawPlayer.width); - Position.Y = this.Position.Y + (float) Main.rand.Next(this.drawPlayer.height); - Position.X = (float) ((double) this.Position.X + (double) (this.drawPlayer.width / 2) - 6.0); - Position.Y = (float) ((double) this.Position.Y + (double) (this.drawPlayer.height / 2) - 6.0); - Position.X -= (float) Main.rand.Next(-10, 11); - Position.Y -= (float) Main.rand.Next(-20, 21); - this.GoreCache.Add(Gore.NewGore(Position, new Vector2((float) Main.rand.Next(-10, 11) * 0.1f, (float) Main.rand.Next(-20, -10) * 0.1f), 331, (float) Main.rand.Next(80, 120) * 0.01f)); - } - if ((double) this.shadow == 0.0 && this.drawPlayer.loveStruck && Main.instance.IsActive && !Main.gamePaused && Main.rand.Next(5) == 0) - { - Vector2 vector2 = new Vector2((float) Main.rand.Next(-10, 11), (float) Main.rand.Next(-10, 11)); - vector2.Normalize(); - vector2.X *= 0.66f; - int index = Gore.NewGore(this.Position + new Vector2((float) Main.rand.Next(this.drawPlayer.width + 1), (float) Main.rand.Next(this.drawPlayer.height + 1)), vector2 * (float) Main.rand.Next(3, 6) * 0.33f, 331, (float) Main.rand.Next(40, 121) * 0.01f); - Main.gore[index].sticky = false; - Main.gore[index].velocity *= 0.4f; - Main.gore[index].velocity.Y -= 0.6f; - this.GoreCache.Add(index); - } - if (this.drawPlayer.stinky && Main.instance.IsActive && !Main.gamePaused) - { - R *= 0.7f; - B *= 0.55f; - if (Main.rand.Next(5) == 0 && (double) this.shadow == 0.0) - { - Vector2 vector2_1 = new Vector2((float) Main.rand.Next(-10, 11), (float) Main.rand.Next(-10, 11)); - vector2_1.Normalize(); - vector2_1.X *= 0.66f; - vector2_1.Y = Math.Abs(vector2_1.Y); - Vector2 vector2_2 = vector2_1 * (float) Main.rand.Next(3, 5) * 0.25f; - int index = Dust.NewDust(this.Position, this.drawPlayer.width, this.drawPlayer.height, 188, vector2_2.X, vector2_2.Y * 0.5f, 100, Scale: 1.5f); - Main.dust[index].velocity *= 0.1f; - Main.dust[index].velocity.Y -= 0.5f; - this.DustCache.Add(index); - } - } - if (this.drawPlayer.slowOgreSpit && Main.instance.IsActive && !Main.gamePaused) - { - R *= 0.6f; - B *= 0.45f; - if (Main.rand.Next(5) == 0 && (double) this.shadow == 0.0) - { - int Type = Utils.SelectRandom(Main.rand, 4, 256); - Dust dust16 = Main.dust[Dust.NewDust(this.Position, this.drawPlayer.width, this.drawPlayer.height, Type, Alpha: 100)]; - dust16.scale = (float) (0.800000011920929 + (double) Main.rand.NextFloat() * 0.600000023841858); - dust16.fadeIn = 0.5f; - dust16.velocity *= 0.05f; - dust16.noLight = true; - if (dust16.type == 4) - dust16.color = new Color(80, 170, 40, 120); - this.DustCache.Add(dust16.dustIndex); - } - if (Main.rand.Next(5) == 0 && (double) this.shadow == 0.0) - { - int index = Gore.NewGore(this.Position + new Vector2(Main.rand.NextFloat(), Main.rand.NextFloat()) * this.drawPlayer.Size, Vector2.Zero, Utils.SelectRandom(Main.rand, 1024, 1025, 1026), 0.65f); - Main.gore[index].velocity *= 0.05f; - this.GoreCache.Add(index); - } - } - if (Main.instance.IsActive && !Main.gamePaused && (double) this.shadow == 0.0) - { - float num29 = (float) this.drawPlayer.miscCounter / 180f; - float num30 = 0.0f; - float num31 = 10f; - int Type = 90; - int num32 = 0; - for (int index1 = 0; index1 < 3; ++index1) - { - switch (index1) - { - case 0: - if (this.drawPlayer.nebulaLevelLife >= 1) - { - num30 = 6.283185f / (float) this.drawPlayer.nebulaLevelLife; - num32 = this.drawPlayer.nebulaLevelLife; - goto default; - } - else - break; - case 1: - if (this.drawPlayer.nebulaLevelMana >= 1) - { - num30 = -6.283185f / (float) this.drawPlayer.nebulaLevelMana; - num32 = this.drawPlayer.nebulaLevelMana; - num29 = (float) -this.drawPlayer.miscCounter / 180f; - num31 = 20f; - Type = 88; - goto default; - } - else - break; - case 2: - if (this.drawPlayer.nebulaLevelDamage >= 1) - { - num30 = 6.283185f / (float) this.drawPlayer.nebulaLevelDamage; - num32 = this.drawPlayer.nebulaLevelDamage; - num29 = (float) this.drawPlayer.miscCounter / 180f; - num31 = 30f; - Type = 86; - goto default; - } - else - break; - default: - for (int index2 = 0; index2 < num32; ++index2) - { - Dust dust17 = Dust.NewDustDirect(this.Position, this.drawPlayer.width, this.drawPlayer.height, Type, Alpha: 100, Scale: 1.5f); - dust17.noGravity = true; - dust17.velocity = Vector2.Zero; - dust17.position = this.drawPlayer.Center + Vector2.UnitY * this.drawPlayer.gfxOffY + ((float) ((double) num29 * 6.28318548202515 + (double) num30 * (double) index2)).ToRotationVector2() * num31; - dust17.customData = (object) this.drawPlayer; - this.DustCache.Add(dust17.dustIndex); - } - break; - } - } - } - if (this.drawPlayer.witheredArmor && Main.instance.IsActive && !Main.gamePaused) - { - G *= 0.5f; - R *= 0.75f; - } - if (this.drawPlayer.witheredWeapon && this.drawPlayer.itemAnimation > 0 && this.heldItem.damage > 0 && Main.instance.IsActive && !Main.gamePaused && Main.rand.Next(3) == 0) - { - Dust dust18 = Dust.NewDustDirect(new Vector2(this.Position.X - 2f, this.Position.Y - 2f), this.drawPlayer.width + 4, this.drawPlayer.height + 4, 272, Alpha: 50, Scale: 0.5f); - dust18.velocity *= 1.6f; - --dust18.velocity.Y; - dust18.position = Vector2.Lerp(dust18.position, this.drawPlayer.Center, 0.5f); - this.DustCache.Add(dust18.dustIndex); - } - if ((double) R != 1.0 || (double) G != 1.0 || (double) B != 1.0 || (double) A != 1.0) - { - if (this.drawPlayer.onFire || this.drawPlayer.onFire2 || this.drawPlayer.onFrostBurn) - { - this.colorEyeWhites = this.drawPlayer.GetImmuneAlpha(Color.White, this.shadow); - this.colorEyes = this.drawPlayer.GetImmuneAlpha(this.drawPlayer.eyeColor, this.shadow); - this.colorHair = this.drawPlayer.GetImmuneAlpha(this.drawPlayer.GetHairColor(false), this.shadow); - this.colorHead = this.drawPlayer.GetImmuneAlpha(this.drawPlayer.skinColor, this.shadow); - this.colorBodySkin = this.drawPlayer.GetImmuneAlpha(this.drawPlayer.skinColor, this.shadow); - this.colorShirt = this.drawPlayer.GetImmuneAlpha(this.drawPlayer.shirtColor, this.shadow); - this.colorUnderShirt = this.drawPlayer.GetImmuneAlpha(this.drawPlayer.underShirtColor, this.shadow); - this.colorPants = this.drawPlayer.GetImmuneAlpha(this.drawPlayer.pantsColor, this.shadow); - this.colorLegs = this.drawPlayer.GetImmuneAlpha(this.drawPlayer.skinColor, this.shadow); - this.colorShoes = this.drawPlayer.GetImmuneAlpha(this.drawPlayer.shoeColor, this.shadow); - this.colorArmorHead = this.drawPlayer.GetImmuneAlpha(Color.White, this.shadow); - this.colorArmorBody = this.drawPlayer.GetImmuneAlpha(Color.White, this.shadow); - this.colorArmorLegs = this.drawPlayer.GetImmuneAlpha(Color.White, this.shadow); - } - else - { - this.colorEyeWhites = Main.buffColor(this.colorEyeWhites, R, G, B, A); - this.colorEyes = Main.buffColor(this.colorEyes, R, G, B, A); - this.colorHair = Main.buffColor(this.colorHair, R, G, B, A); - this.colorHead = Main.buffColor(this.colorHead, R, G, B, A); - this.colorBodySkin = Main.buffColor(this.colorBodySkin, R, G, B, A); - this.colorShirt = Main.buffColor(this.colorShirt, R, G, B, A); - this.colorUnderShirt = Main.buffColor(this.colorUnderShirt, R, G, B, A); - this.colorPants = Main.buffColor(this.colorPants, R, G, B, A); - this.colorLegs = Main.buffColor(this.colorLegs, R, G, B, A); - this.colorShoes = Main.buffColor(this.colorShoes, R, G, B, A); - this.colorArmorHead = Main.buffColor(this.colorArmorHead, R, G, B, A); - this.colorArmorBody = Main.buffColor(this.colorArmorBody, R, G, B, A); - this.colorArmorLegs = Main.buffColor(this.colorArmorLegs, R, G, B, A); - } - } - if (this.drawPlayer.socialGhost) - { - this.colorEyeWhites = Color.Transparent; - this.colorEyes = Color.Transparent; - this.colorHair = Color.Transparent; - this.colorHead = Color.Transparent; - this.colorBodySkin = Color.Transparent; - this.colorShirt = Color.Transparent; - this.colorUnderShirt = Color.Transparent; - this.colorPants = Color.Transparent; - this.colorShoes = Color.Transparent; - this.colorLegs = Color.Transparent; - if ((int) this.colorArmorHead.A > (int) Main.gFade) - this.colorArmorHead.A = Main.gFade; - if ((int) this.colorArmorBody.A > (int) Main.gFade) - this.colorArmorBody.A = Main.gFade; - if ((int) this.colorArmorLegs.A > (int) Main.gFade) - this.colorArmorLegs.A = Main.gFade; - } - if (this.drawPlayer.socialIgnoreLight) - { - float num33 = 1.2f; - this.colorEyeWhites = Color.White * num33; - this.colorEyes = this.drawPlayer.eyeColor * num33; - this.colorHair = GameShaders.Hair.GetColor((short) this.drawPlayer.hairDye, this.drawPlayer, Color.White); - this.colorHead = this.drawPlayer.skinColor * num33; - this.colorBodySkin = this.drawPlayer.skinColor * num33; - this.colorShirt = this.drawPlayer.shirtColor * num33; - this.colorUnderShirt = this.drawPlayer.underShirtColor * num33; - this.colorPants = this.drawPlayer.pantsColor * num33; - this.colorShoes = this.drawPlayer.shoeColor * num33; - this.colorLegs = this.drawPlayer.skinColor * num33; - } - this.stealth = 1f; - if (this.heldItem.type == 3106) - { - float num34 = this.drawPlayer.stealth; - if ((double) num34 < 0.03) - num34 = 0.03f; - float num35 = (float) ((1.0 + (double) num34 * 10.0) / 11.0); - if ((double) num34 < 0.0) - num34 = 0.0f; - if ((double) num34 >= 1.0 - (double) this.shadow && (double) this.shadow > 0.0) - num34 = this.shadow * 0.5f; - this.stealth = num35; - this.colorArmorHead = new Color((int) (byte) ((double) this.colorArmorHead.R * (double) num34), (int) (byte) ((double) this.colorArmorHead.G * (double) num34), (int) (byte) ((double) this.colorArmorHead.B * (double) num35), (int) (byte) ((double) this.colorArmorHead.A * (double) num34)); - this.colorArmorBody = new Color((int) (byte) ((double) this.colorArmorBody.R * (double) num34), (int) (byte) ((double) this.colorArmorBody.G * (double) num34), (int) (byte) ((double) this.colorArmorBody.B * (double) num35), (int) (byte) ((double) this.colorArmorBody.A * (double) num34)); - this.colorArmorLegs = new Color((int) (byte) ((double) this.colorArmorLegs.R * (double) num34), (int) (byte) ((double) this.colorArmorLegs.G * (double) num34), (int) (byte) ((double) this.colorArmorLegs.B * (double) num35), (int) (byte) ((double) this.colorArmorLegs.A * (double) num34)); - float scale = num34 * num34; - this.colorEyeWhites = Color.Multiply(this.colorEyeWhites, scale); - this.colorEyes = Color.Multiply(this.colorEyes, scale); - this.colorHair = Color.Multiply(this.colorHair, scale); - this.colorHead = Color.Multiply(this.colorHead, scale); - this.colorBodySkin = Color.Multiply(this.colorBodySkin, scale); - this.colorShirt = Color.Multiply(this.colorShirt, scale); - this.colorUnderShirt = Color.Multiply(this.colorUnderShirt, scale); - this.colorPants = Color.Multiply(this.colorPants, scale); - this.colorShoes = Color.Multiply(this.colorShoes, scale); - this.colorLegs = Color.Multiply(this.colorLegs, scale); - this.colorMount = Color.Multiply(this.colorMount, scale); - this.headGlowColor = Color.Multiply(this.headGlowColor, scale); - this.bodyGlowColor = Color.Multiply(this.bodyGlowColor, scale); - this.armGlowColor = Color.Multiply(this.armGlowColor, scale); - this.legsGlowColor = Color.Multiply(this.legsGlowColor, scale); - } - else if (this.drawPlayer.shroomiteStealth) - { - float num36 = this.drawPlayer.stealth; - if ((double) num36 < 0.03) - num36 = 0.03f; - float num37 = (float) ((1.0 + (double) num36 * 10.0) / 11.0); - if ((double) num36 < 0.0) - num36 = 0.0f; - if ((double) num36 >= 1.0 - (double) this.shadow && (double) this.shadow > 0.0) - num36 = this.shadow * 0.5f; - this.stealth = num37; - this.colorArmorHead = new Color((int) (byte) ((double) this.colorArmorHead.R * (double) num36), (int) (byte) ((double) this.colorArmorHead.G * (double) num36), (int) (byte) ((double) this.colorArmorHead.B * (double) num37), (int) (byte) ((double) this.colorArmorHead.A * (double) num36)); - this.colorArmorBody = new Color((int) (byte) ((double) this.colorArmorBody.R * (double) num36), (int) (byte) ((double) this.colorArmorBody.G * (double) num36), (int) (byte) ((double) this.colorArmorBody.B * (double) num37), (int) (byte) ((double) this.colorArmorBody.A * (double) num36)); - this.colorArmorLegs = new Color((int) (byte) ((double) this.colorArmorLegs.R * (double) num36), (int) (byte) ((double) this.colorArmorLegs.G * (double) num36), (int) (byte) ((double) this.colorArmorLegs.B * (double) num37), (int) (byte) ((double) this.colorArmorLegs.A * (double) num36)); - float scale = num36 * num36; - this.colorEyeWhites = Color.Multiply(this.colorEyeWhites, scale); - this.colorEyes = Color.Multiply(this.colorEyes, scale); - this.colorHair = Color.Multiply(this.colorHair, scale); - this.colorHead = Color.Multiply(this.colorHead, scale); - this.colorBodySkin = Color.Multiply(this.colorBodySkin, scale); - this.colorShirt = Color.Multiply(this.colorShirt, scale); - this.colorUnderShirt = Color.Multiply(this.colorUnderShirt, scale); - this.colorPants = Color.Multiply(this.colorPants, scale); - this.colorShoes = Color.Multiply(this.colorShoes, scale); - this.colorLegs = Color.Multiply(this.colorLegs, scale); - this.colorMount = Color.Multiply(this.colorMount, scale); - this.headGlowColor = Color.Multiply(this.headGlowColor, scale); - this.bodyGlowColor = Color.Multiply(this.bodyGlowColor, scale); - this.armGlowColor = Color.Multiply(this.armGlowColor, scale); - this.legsGlowColor = Color.Multiply(this.legsGlowColor, scale); - } - else if (this.drawPlayer.setVortex) - { - float num38 = this.drawPlayer.stealth; - if ((double) num38 < 0.03) - num38 = 0.03f; - if ((double) num38 < 0.0) - num38 = 0.0f; - if ((double) num38 >= 1.0 - (double) this.shadow && (double) this.shadow > 0.0) - num38 = this.shadow * 0.5f; - this.stealth = num38; - Color secondColor = new Color(Vector4.Lerp(Vector4.One, new Vector4(0.0f, 0.12f, 0.16f, 0.0f), 1f - num38)); - this.colorArmorHead = this.colorArmorHead.MultiplyRGBA(secondColor); - this.colorArmorBody = this.colorArmorBody.MultiplyRGBA(secondColor); - this.colorArmorLegs = this.colorArmorLegs.MultiplyRGBA(secondColor); - float scale = num38 * num38; - this.colorEyeWhites = Color.Multiply(this.colorEyeWhites, scale); - this.colorEyes = Color.Multiply(this.colorEyes, scale); - this.colorHair = Color.Multiply(this.colorHair, scale); - this.colorHead = Color.Multiply(this.colorHead, scale); - this.colorBodySkin = Color.Multiply(this.colorBodySkin, scale); - this.colorShirt = Color.Multiply(this.colorShirt, scale); - this.colorUnderShirt = Color.Multiply(this.colorUnderShirt, scale); - this.colorPants = Color.Multiply(this.colorPants, scale); - this.colorShoes = Color.Multiply(this.colorShoes, scale); - this.colorLegs = Color.Multiply(this.colorLegs, scale); - this.colorMount = Color.Multiply(this.colorMount, scale); - this.headGlowColor = Color.Multiply(this.headGlowColor, scale); - this.bodyGlowColor = Color.Multiply(this.bodyGlowColor, scale); - this.armGlowColor = Color.Multiply(this.armGlowColor, scale); - this.legsGlowColor = Color.Multiply(this.legsGlowColor, scale); - } - if ((double) this.drawPlayer.gravDir == 1.0) - { - if (this.drawPlayer.direction == 1) - { - this.playerEffect = SpriteEffects.None; - this.itemEffect = SpriteEffects.None; - } - else - { - this.playerEffect = SpriteEffects.FlipHorizontally; - this.itemEffect = SpriteEffects.FlipHorizontally; - } - if (!this.drawPlayer.dead) - { - this.drawPlayer.legPosition.Y = 0.0f; - this.drawPlayer.headPosition.Y = 0.0f; - this.drawPlayer.bodyPosition.Y = 0.0f; - } - } - else - { - if (this.drawPlayer.direction == 1) - { - this.playerEffect = SpriteEffects.FlipVertically; - this.itemEffect = SpriteEffects.FlipVertically; - } - else - { - this.playerEffect = SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically; - this.itemEffect = SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically; - } - if (!this.drawPlayer.dead) - { - this.drawPlayer.legPosition.Y = 6f; - this.drawPlayer.headPosition.Y = 6f; - this.drawPlayer.bodyPosition.Y = 6f; - } - } - switch (this.heldItem.type) - { - case 3182: - case 3184: - case 3185: - case 3782: - this.itemEffect ^= SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically; - break; - } - this.legVect = new Vector2((float) this.drawPlayer.legFrame.Width * 0.5f, (float) this.drawPlayer.legFrame.Height * 0.75f); - this.bodyVect = new Vector2((float) this.drawPlayer.legFrame.Width * 0.5f, (float) this.drawPlayer.legFrame.Height * 0.5f); - this.headVect = new Vector2((float) this.drawPlayer.legFrame.Width * 0.5f, (float) this.drawPlayer.legFrame.Height * 0.4f); - if ((this.drawPlayer.merman || this.drawPlayer.forceMerman) && !this.drawPlayer.hideMerman) - { - this.drawPlayer.headRotation = (float) ((double) this.drawPlayer.velocity.Y * (double) this.drawPlayer.direction * 0.100000001490116); - if ((double) this.drawPlayer.headRotation < -0.3) - this.drawPlayer.headRotation = -0.3f; - if ((double) this.drawPlayer.headRotation > 0.3) - this.drawPlayer.headRotation = 0.3f; - } - else if (!this.drawPlayer.dead) - this.drawPlayer.headRotation = 0.0f; - this.hairFrame = this.drawPlayer.bodyFrame; - this.hairFrame.Y -= 336; - if (this.hairFrame.Y < 0) - this.hairFrame.Y = 0; - if (this.hideHair) - this.hairFrame.Height = 0; - this.hidesTopSkin = this.drawPlayer.body == 82 || this.drawPlayer.body == 83 || this.drawPlayer.body == 93 || this.drawPlayer.body == 21 || this.drawPlayer.body == 22; - this.hidesBottomSkin = this.drawPlayer.body == 93 || this.drawPlayer.legs == 20 || this.drawPlayer.legs == 21; - this.drawFloatingTube = this.drawPlayer.hasFloatingTube; - this.drawUnicornHorn = this.drawPlayer.hasUnicornHorn; - this.drawFrontAccInNeckAccLayer = false; - if (this.drawPlayer.bodyFrame.Y / this.drawPlayer.bodyFrame.Height == 5) - this.drawFrontAccInNeckAccLayer = this.drawPlayer.front > (sbyte) 0 && this.drawPlayer.front < (sbyte) 9 && ArmorIDs.Front.Sets.DrawsInNeckLayer[(int) this.drawPlayer.front]; - this.helmetOffset = this.drawPlayer.GetHelmetDrawOffset(); - this.CreateCompositeData(); - } - - private void CreateCompositeData() - { - this.frontShoulderOffset = Vector2.Zero; - this.backShoulderOffset = Vector2.Zero; - this.usesCompositeTorso = this.drawPlayer.body > 0 && this.drawPlayer.body < 235 && ArmorIDs.Body.Sets.UsesNewFramingCode[this.drawPlayer.body]; - this.usesCompositeFrontHandAcc = this.drawPlayer.handon > (sbyte) 0 && this.drawPlayer.handon < (sbyte) 22 && ArmorIDs.HandOn.Sets.UsesNewFramingCode[(int) this.drawPlayer.handon]; - this.usesCompositeBackHandAcc = this.drawPlayer.handoff > (sbyte) 0 && this.drawPlayer.handoff < (sbyte) 14 && ArmorIDs.HandOff.Sets.UsesNewFramingCode[(int) this.drawPlayer.handoff]; - if (this.drawPlayer.body < 1) - this.usesCompositeTorso = true; - if (!this.usesCompositeTorso) - return; - Point pt1 = new Point(1, 1); - Point pt2 = new Point(0, 1); - Point pt3 = new Point(); - Point frameIndex1 = new Point(); - Point frameIndex2 = new Point(); - int targetFrameNumber = this.drawPlayer.bodyFrame.Y / this.drawPlayer.bodyFrame.Height; - this.compShoulderOverFrontArm = true; - this.hideCompositeShoulders = false; - bool flag1 = true; - if (this.drawPlayer.body > 0) - flag1 = ArmorIDs.Body.Sets.showsShouldersWhileJumping[this.drawPlayer.body]; - bool flag2 = false; - if (this.drawPlayer.handon > (sbyte) 0) - flag2 = ArmorIDs.HandOn.Sets.UsesOldFramingTexturesForWalking[(int) this.drawPlayer.handon]; - bool flag3 = !flag2; - switch (targetFrameNumber) - { - case 0: - frameIndex2.X = 2; - flag3 = true; - break; - case 1: - frameIndex2.X = 3; - this.compShoulderOverFrontArm = false; - flag3 = true; - break; - case 2: - frameIndex2.X = 4; - this.compShoulderOverFrontArm = false; - flag3 = true; - break; - case 3: - frameIndex2.X = 5; - this.compShoulderOverFrontArm = true; - flag3 = true; - break; - case 4: - frameIndex2.X = 6; - this.compShoulderOverFrontArm = true; - flag3 = true; - break; - case 5: - frameIndex2.X = 2; - frameIndex2.Y = 1; - pt3.X = 1; - this.compShoulderOverFrontArm = false; - flag3 = true; - if (!flag1) - { - this.hideCompositeShoulders = true; - break; - } - break; - case 6: - frameIndex2.X = 3; - frameIndex2.Y = 1; - break; - case 7: - case 8: - case 9: - case 10: - frameIndex2.X = 4; - frameIndex2.Y = 1; - break; - case 11: - case 12: - case 13: - frameIndex2.X = 3; - frameIndex2.Y = 1; - break; - case 14: - frameIndex2.X = 5; - frameIndex2.Y = 1; - break; - case 15: - case 16: - frameIndex2.X = 6; - frameIndex2.Y = 1; - break; - case 17: - frameIndex2.X = 5; - frameIndex2.Y = 1; - break; - case 18: - case 19: - frameIndex2.X = 3; - frameIndex2.Y = 1; - break; - } - this.CreateCompositeData_DetermineShoulderOffsets(this.drawPlayer.body, targetFrameNumber); - this.backShoulderOffset *= new Vector2((float) this.drawPlayer.direction, this.drawPlayer.gravDir); - this.frontShoulderOffset *= new Vector2((float) this.drawPlayer.direction, this.drawPlayer.gravDir); - if (this.drawPlayer.body > 0 && ArmorIDs.Body.Sets.shouldersAreAlwaysInTheBack[this.drawPlayer.body]) - this.compShoulderOverFrontArm = false; - this.usesCompositeFrontHandAcc = flag3; - frameIndex1.X = frameIndex2.X; - frameIndex1.Y = frameIndex2.Y + 2; - this.UpdateCompositeArm(this.drawPlayer.compositeFrontArm, ref this.compositeFrontArmRotation, ref frameIndex2, 7); - this.UpdateCompositeArm(this.drawPlayer.compositeBackArm, ref this.compositeBackArmRotation, ref frameIndex1, 8); - if (!this.drawPlayer.Male) - { - pt1.Y += 2; - pt2.Y += 2; - pt3.Y += 2; - } - this.compBackShoulderFrame = this.CreateCompositeFrameRect(pt1); - this.compFrontShoulderFrame = this.CreateCompositeFrameRect(pt2); - this.compBackArmFrame = this.CreateCompositeFrameRect(frameIndex1); - this.compFrontArmFrame = this.CreateCompositeFrameRect(frameIndex2); - this.compTorsoFrame = this.CreateCompositeFrameRect(pt3); - } - - private void CreateCompositeData_DetermineShoulderOffsets(int armor, int targetFrameNumber) - { - int num = 0; - switch (armor) - { - case 55: - num = 1; - break; - case 71: - num = 2; - break; - case 101: - num = 6; - break; - case 183: - num = 4; - break; - case 201: - num = 5; - break; - case 204: - num = 3; - break; - case 207: - num = 7; - break; - } - switch (num) - { - case 1: - switch (targetFrameNumber) - { - case 6: - this.frontShoulderOffset.X = -2f; - return; - case 7: - case 8: - case 9: - case 10: - this.frontShoulderOffset.X = -4f; - return; - case 11: - case 12: - case 13: - case 14: - this.frontShoulderOffset.X = -2f; - return; - case 15: - return; - case 16: - return; - case 17: - return; - case 18: - case 19: - this.frontShoulderOffset.X = -2f; - return; - default: - return; - } - case 2: - switch (targetFrameNumber) - { - case 6: - this.frontShoulderOffset.X = -2f; - return; - case 7: - case 8: - case 9: - case 10: - this.frontShoulderOffset.X = -4f; - return; - case 11: - case 12: - case 13: - case 14: - this.frontShoulderOffset.X = -2f; - return; - case 15: - return; - case 16: - return; - case 17: - return; - case 18: - case 19: - this.frontShoulderOffset.X = -2f; - return; - default: - return; - } - case 3: - switch (targetFrameNumber) - { - case 7: - case 8: - case 9: - this.frontShoulderOffset.X = -2f; - return; - case 15: - case 16: - case 17: - this.frontShoulderOffset.X = 2f; - return; - default: - return; - } - case 4: - switch (targetFrameNumber) - { - case 6: - this.frontShoulderOffset.X = -2f; - return; - case 7: - case 8: - case 9: - case 10: - this.frontShoulderOffset.X = -4f; - return; - case 11: - case 12: - case 13: - this.frontShoulderOffset.X = -2f; - return; - case 14: - return; - case 15: - case 16: - this.frontShoulderOffset.X = 2f; - return; - case 17: - return; - case 18: - case 19: - this.frontShoulderOffset.X = -2f; - return; - default: - return; - } - case 5: - switch (targetFrameNumber) - { - case 7: - case 8: - case 9: - case 10: - this.frontShoulderOffset.X = -2f; - return; - case 15: - case 16: - this.frontShoulderOffset.X = 2f; - return; - default: - return; - } - case 6: - switch (targetFrameNumber) - { - case 7: - case 8: - case 9: - case 10: - this.frontShoulderOffset.X = -2f; - return; - case 14: - case 15: - case 16: - case 17: - this.frontShoulderOffset.X = 2f; - return; - default: - return; - } - case 7: - switch (targetFrameNumber) - { - case 6: - case 7: - case 8: - case 9: - case 10: - this.frontShoulderOffset.X = -2f; - return; - case 11: - case 12: - case 13: - case 14: - this.frontShoulderOffset.X = -2f; - return; - case 15: - return; - case 16: - return; - case 17: - return; - case 18: - case 19: - this.frontShoulderOffset.X = -2f; - return; - default: - return; - } - } - } - - private Rectangle CreateCompositeFrameRect(Point pt) => new Rectangle(pt.X * 40, pt.Y * 56, 40, 56); - - private void UpdateCompositeArm( - Player.CompositeArmData data, - ref float rotation, - ref Point frameIndex, - int targetX) - { - if (data.enabled) - { - rotation = data.rotation; - switch (data.stretch) - { - case Player.CompositeArmStretchAmount.Full: - frameIndex.X = targetX; - frameIndex.Y = 0; - break; - case Player.CompositeArmStretchAmount.None: - frameIndex.X = targetX; - frameIndex.Y = 3; - break; - case Player.CompositeArmStretchAmount.Quarter: - frameIndex.X = targetX; - frameIndex.Y = 2; - break; - case Player.CompositeArmStretchAmount.ThreeQuarters: - frameIndex.X = targetX; - frameIndex.Y = 1; - break; - } - } - else - rotation = 0.0f; - } - } -} diff --git a/DataStructures/PlayerFishingConditions.cs b/DataStructures/PlayerFishingConditions.cs deleted file mode 100644 index 73a34ec..0000000 --- a/DataStructures/PlayerFishingConditions.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.PlayerFishingConditions -// 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.DataStructures -{ - public struct PlayerFishingConditions - { - public int PolePower; - public int PoleItemType; - public int BaitPower; - public int BaitItemType; - public float LevelMultipliers; - public int FinalFishingLevel; - } -} diff --git a/DataStructures/PlayerInteractionAnchor.cs b/DataStructures/PlayerInteractionAnchor.cs deleted file mode 100644 index 3907634..0000000 --- a/DataStructures/PlayerInteractionAnchor.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.PlayerInteractionAnchor -// 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.DataStructures -{ - public struct PlayerInteractionAnchor - { - public int interactEntityID; - public int X; - public int Y; - - public PlayerInteractionAnchor(int entityID, int x = -1, int y = -1) - { - this.interactEntityID = entityID; - this.X = x; - this.Y = y; - } - - public bool InUse => this.interactEntityID != -1; - - public void Clear() - { - this.interactEntityID = -1; - this.X = -1; - this.Y = -1; - } - - public void Set(int entityID, int x, int y) - { - this.interactEntityID = entityID; - this.X = x; - this.Y = y; - } - - public bool IsInValidUseTileEntity() => this.InUse && TileEntity.ByID.ContainsKey(this.interactEntityID); - - public TileEntity GetTileEntity() => !this.IsInValidUseTileEntity() ? (TileEntity) null : TileEntity.ByID[this.interactEntityID]; - } -} diff --git a/DataStructures/PlayerMovementAccsCache.cs b/DataStructures/PlayerMovementAccsCache.cs deleted file mode 100644 index 0ef282e..0000000 --- a/DataStructures/PlayerMovementAccsCache.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.PlayerMovementAccsCache -// 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.DataStructures -{ - public struct PlayerMovementAccsCache - { - private bool _readyToPaste; - private bool _mountPreventedFlight; - private bool _mountPreventedExtraJumps; - private int rocketTime; - private float wingTime; - private int rocketDelay; - private int rocketDelay2; - private bool jumpAgainCloud; - private bool jumpAgainSandstorm; - private bool jumpAgainBlizzard; - private bool jumpAgainFart; - private bool jumpAgainSail; - private bool jumpAgainUnicorn; - - public void CopyFrom(Player player) - { - if (this._readyToPaste) - return; - this._readyToPaste = true; - this._mountPreventedFlight = true; - this._mountPreventedExtraJumps = player.mount.BlockExtraJumps; - this.rocketTime = player.rocketTime; - this.rocketDelay = player.rocketDelay; - this.rocketDelay2 = player.rocketDelay2; - this.wingTime = player.wingTime; - this.jumpAgainCloud = player.canJumpAgain_Cloud; - this.jumpAgainSandstorm = player.canJumpAgain_Sandstorm; - this.jumpAgainBlizzard = player.canJumpAgain_Blizzard; - this.jumpAgainFart = player.canJumpAgain_Fart; - this.jumpAgainSail = player.canJumpAgain_Sail; - this.jumpAgainUnicorn = player.canJumpAgain_Unicorn; - } - - public void PasteInto(Player player) - { - if (!this._readyToPaste) - return; - this._readyToPaste = false; - if (this._mountPreventedFlight) - { - player.rocketTime = this.rocketTime; - player.rocketDelay = this.rocketDelay; - player.rocketDelay2 = this.rocketDelay2; - player.wingTime = this.wingTime; - } - if (!this._mountPreventedExtraJumps) - return; - player.canJumpAgain_Cloud = this.jumpAgainCloud; - player.canJumpAgain_Sandstorm = this.jumpAgainSandstorm; - player.canJumpAgain_Blizzard = this.jumpAgainBlizzard; - player.canJumpAgain_Fart = this.jumpAgainFart; - player.canJumpAgain_Sail = this.jumpAgainSail; - player.canJumpAgain_Unicorn = this.jumpAgainUnicorn; - } - } -} diff --git a/DataStructures/Point16.cs b/DataStructures/Point16.cs index 3db3b2e..16f4ada 100644 --- a/DataStructures/Point16.cs +++ b/DataStructures/Point16.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.DataStructures.Point16 -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/DataStructures/PortableStoolUsage.cs b/DataStructures/PortableStoolUsage.cs deleted file mode 100644 index 34ecdcf..0000000 --- a/DataStructures/PortableStoolUsage.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.PortableStoolUsage -// 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.DataStructures -{ - public struct PortableStoolUsage - { - public bool HasAStool; - public bool IsInUse; - public int HeightBoost; - public int VisualYOffset; - public int MapYOffset; - - public void Reset() - { - this.HasAStool = false; - this.IsInUse = false; - this.HeightBoost = 0; - this.VisualYOffset = 0; - this.MapYOffset = 0; - } - - public void SetStats(int heightBoost, int visualYOffset, int mapYOffset) - { - this.HasAStool = true; - this.HeightBoost = heightBoost; - this.VisualYOffset = visualYOffset; - this.MapYOffset = mapYOffset; - } - } -} diff --git a/DataStructures/SoundPlaySet.cs b/DataStructures/SoundPlaySet.cs index af2f5ef..a45ada3 100644 --- a/DataStructures/SoundPlaySet.cs +++ b/DataStructures/SoundPlaySet.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.DataStructures.SoundPlaySet -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.DataStructures diff --git a/DataStructures/SpriteFrame.cs b/DataStructures/SpriteFrame.cs deleted file mode 100644 index 8b66f1a..0000000 --- a/DataStructures/SpriteFrame.cs +++ /dev/null @@ -1,68 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.SpriteFrame -// 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; -using Microsoft.Xna.Framework.Graphics; - -namespace Terraria.DataStructures -{ - public struct SpriteFrame - { - public int PaddingX; - public int PaddingY; - private byte _currentColumn; - private byte _currentRow; - public readonly byte ColumnCount; - public readonly byte RowCount; - - public byte CurrentColumn - { - get => this._currentColumn; - set => this._currentColumn = value; - } - - public byte CurrentRow - { - get => this._currentRow; - set => this._currentRow = value; - } - - public SpriteFrame(byte columns, byte rows) - { - this.PaddingX = 2; - this.PaddingY = 2; - this._currentColumn = (byte) 0; - this._currentRow = (byte) 0; - this.ColumnCount = columns; - this.RowCount = rows; - } - - public SpriteFrame(byte columns, byte rows, byte currentColumn, byte currentRow) - { - this.PaddingX = 2; - this.PaddingY = 2; - this._currentColumn = currentColumn; - this._currentRow = currentRow; - this.ColumnCount = columns; - this.RowCount = rows; - } - - public SpriteFrame With(byte columnToUse, byte rowToUse) - { - SpriteFrame spriteFrame = this; - spriteFrame.CurrentColumn = columnToUse; - spriteFrame.CurrentRow = rowToUse; - return spriteFrame; - } - - public Rectangle GetSourceRectangle(Texture2D texture) - { - int num1 = texture.Width / (int) this.ColumnCount; - int num2 = texture.Height / (int) this.RowCount; - return new Rectangle((int) this.CurrentColumn * num1, (int) this.CurrentRow * num2, num1 - (this.ColumnCount == (byte) 1 ? 0 : this.PaddingX), num2 - (this.RowCount == (byte) 1 ? 0 : this.PaddingY)); - } - } -} diff --git a/DataStructures/TileDataType.cs b/DataStructures/TileDataType.cs deleted file mode 100644 index c4f8047..0000000 --- a/DataStructures/TileDataType.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.TileDataType -// 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.DataStructures -{ - [Flags] - public enum TileDataType - { - Tile = 1, - TilePaint = 2, - Wall = 4, - WallPaint = 8, - Liquid = 16, // 0x00000010 - Wiring = 32, // 0x00000020 - Actuator = 64, // 0x00000040 - Slope = 128, // 0x00000080 - All = Slope | Actuator | Wiring | Liquid | WallPaint | Wall | TilePaint | Tile, // 0x000000FF - } -} diff --git a/DataStructures/TileDrawInfo.cs b/DataStructures/TileDrawInfo.cs deleted file mode 100644 index f9b8bd1..0000000 --- a/DataStructures/TileDrawInfo.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.TileDrawInfo -// 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; -using Microsoft.Xna.Framework.Graphics; - -namespace Terraria.DataStructures -{ - public class TileDrawInfo - { - public Tile tileCache; - public ushort typeCache; - public short tileFrameX; - public short tileFrameY; - public Texture2D drawTexture; - public Color tileLight; - public int tileTop; - public int tileWidth; - public int tileHeight; - public int halfBrickHeight; - public int addFrY; - public int addFrX; - public SpriteEffects tileSpriteEffect; - public Texture2D glowTexture; - public Rectangle glowSourceRect; - public Color glowColor; - public Vector3[] colorSlices = new Vector3[9]; - public Color finalColor; - public Color colorTint; - } -} diff --git a/DataStructures/TileDrawSorter.cs b/DataStructures/TileDrawSorter.cs deleted file mode 100644 index 7eef3ef..0000000 --- a/DataStructures/TileDrawSorter.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.TileDrawSorter -// 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; - -namespace Terraria.DataStructures -{ - public class TileDrawSorter - { - public TileDrawSorter.TileTexPoint[] tilesToDraw; - private int _holderLength; - private int _currentCacheIndex; - private TileDrawSorter.CustomComparer _tileComparer = new TileDrawSorter.CustomComparer(); - - public TileDrawSorter() - { - this._currentCacheIndex = 0; - this._holderLength = 9000; - this.tilesToDraw = new TileDrawSorter.TileTexPoint[this._holderLength]; - } - - public void reset() => this._currentCacheIndex = 0; - - public void Cache(int x, int y, int type) - { - int index = this._currentCacheIndex++; - this.tilesToDraw[index].X = x; - this.tilesToDraw[index].Y = y; - this.tilesToDraw[index].TileType = type; - if (this._currentCacheIndex != this._holderLength) - return; - this.IncreaseArraySize(); - } - - private void IncreaseArraySize() - { - this._holderLength *= 2; - Array.Resize(ref this.tilesToDraw, this._holderLength); - } - - public void Sort() => Array.Sort(this.tilesToDraw, 0, this._currentCacheIndex, (IComparer) this._tileComparer); - - public int GetAmountToDraw() => this._currentCacheIndex; - - public struct TileTexPoint - { - public int X; - public int Y; - public int TileType; - - public override string ToString() => string.Format("X:{0}, Y:{1}, Type:{2}", (object) this.X, (object) this.Y, (object) this.TileType); - } - - public class CustomComparer : Comparer - { - public override int Compare(TileDrawSorter.TileTexPoint x, TileDrawSorter.TileTexPoint y) => x.TileType.CompareTo(y.TileType); - } - } -} diff --git a/DataStructures/TileEntitiesManager.cs b/DataStructures/TileEntitiesManager.cs deleted file mode 100644 index eba39a4..0000000 --- a/DataStructures/TileEntitiesManager.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.TileEntitiesManager -// 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.Collections.Generic; -using Terraria.GameContent.Tile_Entities; - -namespace Terraria.DataStructures -{ - public class TileEntitiesManager - { - private int _nextEntityID; - private Dictionary _types = new Dictionary(); - - private int AssignNewID() => this._nextEntityID++; - - private bool InvalidEntityID(int id) => id < 0 || id >= this._nextEntityID; - - public void RegisterAll() - { - this.Register((TileEntity) new TETrainingDummy()); - this.Register((TileEntity) new TEItemFrame()); - this.Register((TileEntity) new TELogicSensor()); - this.Register((TileEntity) new TEDisplayDoll()); - this.Register((TileEntity) new TEWeaponsRack()); - this.Register((TileEntity) new TEHatRack()); - this.Register((TileEntity) new TEFoodPlatter()); - this.Register((TileEntity) new TETeleportationPylon()); - } - - public void Register(TileEntity entity) - { - int num = this.AssignNewID(); - this._types[num] = entity; - entity.RegisterTileEntityID(num); - } - - public bool CheckValidTile(int id, int x, int y) => !this.InvalidEntityID(id) && this._types[id].IsTileValidForEntity(x, y); - - public void NetPlaceEntity(int id, int x, int y) - { - if (this.InvalidEntityID(id) || !this._types[id].IsTileValidForEntity(x, y)) - return; - this._types[id].NetPlaceEntityAttempt(x, y); - } - - public TileEntity GenerateInstance(int id) => this.InvalidEntityID(id) ? (TileEntity) null : this._types[id].GenerateInstance(); - } -} diff --git a/DataStructures/TileEntity.cs b/DataStructures/TileEntity.cs index 2a3fe61..bc3785b 100644 --- a/DataStructures/TileEntity.cs +++ b/DataStructures/TileEntity.cs @@ -1,25 +1,22 @@ // Decompiled with JetBrains decompiler // Type: Terraria.DataStructures.TileEntity -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe -using Microsoft.Xna.Framework.Graphics; using System; using System.Collections.Generic; using System.IO; -using Terraria.Audio; -using Terraria.GameInput; +using Terraria.GameContent.Tile_Entities; namespace Terraria.DataStructures { public abstract class TileEntity { - public static TileEntitiesManager manager; public const int MaxEntitiesPerChunk = 1000; public static Dictionary ByID = new Dictionary(); public static Dictionary ByPosition = new Dictionary(); - public static int TileEntitiesNextID; + public static int TileEntitiesNextID = 0; public int ID; public Point16 Position; public byte type; @@ -30,6 +27,8 @@ namespace Terraria.DataStructures public static event Action _UpdateEnd; + public static event Action _NetPlaceEntity; + public static void Clear() { TileEntity.ByID.Clear(); @@ -53,15 +52,16 @@ namespace Terraria.DataStructures public static void InitializeAll() { - TileEntity.manager = new TileEntitiesManager(); - TileEntity.manager.RegisterAll(); + TETrainingDummy.Initialize(); + TEItemFrame.Initialize(); + TELogicSensor.Initialize(); } public static void PlaceEntityNet(int x, int y, int type) { - if (!WorldGen.InWorld(x, y) || TileEntity.ByPosition.ContainsKey(new Point16(x, y))) + if (!WorldGen.InWorld(x, y) || TileEntity.ByPosition.ContainsKey(new Point16(x, y)) || TileEntity._NetPlaceEntity == null) return; - TileEntity.manager.NetPlaceEntity(type, x, y); + TileEntity._NetPlaceEntity(x, y, type); } public virtual void Update() @@ -76,11 +76,23 @@ namespace Terraria.DataStructures public static TileEntity Read(BinaryReader reader, bool networkSend = false) { + TileEntity tileEntity = (TileEntity) null; byte num = reader.ReadByte(); - TileEntity instance = TileEntity.manager.GenerateInstance((int) num); - instance.type = num; - instance.ReadInner(reader, networkSend); - return instance; + switch (num) + { + case 0: + tileEntity = (TileEntity) new TETrainingDummy(); + break; + case 1: + tileEntity = (TileEntity) new TEItemFrame(); + break; + case 2: + tileEntity = (TileEntity) new TELogicSensor(); + break; + } + tileEntity.type = num; + tileEntity.ReadInner(reader, networkSend); + return tileEntity; } private void WriteInner(BinaryWriter writer, bool networkSend) @@ -107,113 +119,5 @@ namespace Terraria.DataStructures public virtual void ReadExtraData(BinaryReader reader, bool networkSend) { } - - public virtual void OnPlayerUpdate(Player player) - { - } - - public static bool IsOccupied(int id, out int interactingPlayer) - { - interactingPlayer = -1; - for (int index = 0; index < (int) byte.MaxValue; ++index) - { - Player player = Main.player[index]; - if (player.active && !player.dead && player.tileEntityAnchor.interactEntityID == id) - { - interactingPlayer = index; - return true; - } - } - return false; - } - - public virtual void OnInventoryDraw(Player player, SpriteBatch spriteBatch) - { - } - - public virtual string GetItemGamepadInstructions(int slot = 0) => ""; - - public virtual bool TryGetItemGamepadOverrideInstructions( - Item[] inv, - int context, - int slot, - out string instruction) - { - instruction = (string) null; - return false; - } - - public virtual bool OverrideItemSlotHover(Item[] inv, int context = 0, int slot = 0) => false; - - public virtual bool OverrideItemSlotLeftClick(Item[] inv, int context = 0, int slot = 0) => false; - - public static void BasicOpenCloseInteraction(Player player, int x, int y, int id) - { - player.CloseSign(); - if (Main.netMode != 1) - { - Main.stackSplit = 600; - player.GamepadEnableGrappleCooldown(); - int interactingPlayer; - if (TileEntity.IsOccupied(id, out interactingPlayer)) - { - if (interactingPlayer != player.whoAmI) - return; - Recipe.FindRecipes(); - SoundEngine.PlaySound(11); - player.tileEntityAnchor.Clear(); - } - else - TileEntity.SetInteractionAnchor(player, x, y, id); - } - else - { - Main.stackSplit = 600; - player.GamepadEnableGrappleCooldown(); - int interactingPlayer; - if (TileEntity.IsOccupied(id, out interactingPlayer)) - { - if (interactingPlayer != player.whoAmI) - return; - Recipe.FindRecipes(); - SoundEngine.PlaySound(11); - player.tileEntityAnchor.Clear(); - NetMessage.SendData(122, number: -1, number2: ((float) Main.myPlayer)); - } - else - NetMessage.SendData(122, number: id, number2: ((float) Main.myPlayer)); - } - } - - public static void SetInteractionAnchor(Player player, int x, int y, int id) - { - player.chest = -1; - player.SetTalkNPC(-1); - if (player.whoAmI == Main.myPlayer) - { - Main.playerInventory = true; - Main.recBigList = false; - Main.CreativeMenu.CloseMenu(); - if (PlayerInput.GrappleAndInteractAreShared) - PlayerInput.Triggers.JustPressed.Grapple = false; - if (player.tileEntityAnchor.interactEntityID != -1) - SoundEngine.PlaySound(12); - else - SoundEngine.PlaySound(10); - } - player.tileEntityAnchor.Set(id, x, y); - } - - public virtual void RegisterTileEntityID(int assignedID) - { - } - - public virtual void NetPlaceEntityAttempt(int x, int y) - { - } - - public virtual bool IsTileValidForEntity(int x, int y) => false; - - public virtual TileEntity GenerateInstance() => (TileEntity) null; } } diff --git a/DataStructures/TileObjectPreviewData.cs b/DataStructures/TileObjectPreviewData.cs index 78fe69b..b9c986f 100644 --- a/DataStructures/TileObjectPreviewData.cs +++ b/DataStructures/TileObjectPreviewData.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.DataStructures.TileObjectPreviewData -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; diff --git a/DataStructures/WeaponDrawOrder.cs b/DataStructures/WeaponDrawOrder.cs deleted file mode 100644 index a0c3181..0000000 --- a/DataStructures/WeaponDrawOrder.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.WeaponDrawOrder -// 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.DataStructures -{ - public enum WeaponDrawOrder - { - BehindBackArm, - BehindFrontArm, - OverFrontArm, - } -} diff --git a/DataStructures/WingStats.cs b/DataStructures/WingStats.cs deleted file mode 100644 index ab9edf6..0000000 --- a/DataStructures/WingStats.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.DataStructures.WingStats -// 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.DataStructures -{ - public struct WingStats - { - public static readonly WingStats Default; - public int FlyTime; - public float AccRunSpeedOverride; - public float AccRunAccelerationMult; - public bool HasDownHoverStats; - public float DownHoverSpeedOverride; - public float DownHoverAccelerationMult; - - public WingStats( - int flyTime = 100, - float flySpeedOverride = -1f, - float accelerationMultiplier = 1f, - bool hasHoldDownHoverFeatures = false, - float hoverFlySpeedOverride = -1f, - float hoverAccelerationMultiplier = 1f) - { - this.FlyTime = flyTime; - this.AccRunSpeedOverride = flySpeedOverride; - this.AccRunAccelerationMult = accelerationMultiplier; - this.HasDownHoverStats = hasHoldDownHoverFeatures; - this.DownHoverSpeedOverride = hoverFlySpeedOverride; - this.DownHoverAccelerationMult = hoverAccelerationMultiplier; - } - - public WingStats WithSpeedBoost(float multiplier) => new WingStats(this.FlyTime, this.AccRunSpeedOverride * multiplier, this.AccRunAccelerationMult, this.HasDownHoverStats, this.DownHoverSpeedOverride * multiplier, this.DownHoverAccelerationMult); - } -} diff --git a/DelegateMethods.cs b/DelegateMethods.cs index af3144a..b929a9e 100644 --- a/DelegateMethods.cs +++ b/DelegateMethods.cs @@ -1,14 +1,12 @@ // Decompiled with JetBrains decompiler // Type: Terraria.DelegateMethods -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; -using Terraria.Audio; using Terraria.DataStructures; using Terraria.Enums; -using Terraria.Graphics.Shaders; using Terraria.ID; namespace Terraria @@ -16,10 +14,9 @@ namespace Terraria public static class DelegateMethods { public static Vector3 v3_1 = Vector3.Zero; - public static Vector2 v2_1 = Vector2.Zero; public static float f_1 = 0.0f; public static Color c_1 = Color.Transparent; - public static int i_1; + public static int i_1 = 0; public static TileCuttingContext tilecut_0 = TileCuttingContext.Unknown; public static Color ColorLerp_BlackToWhite(float percent) => Color.Lerp(Color.Black, Color.White, percent); @@ -32,118 +29,6 @@ namespace Terraria public static Color ColorLerp_HSL_O(float percent) => Color.Lerp(Color.White, Main.hslToRgb(DelegateMethods.v3_1.X, DelegateMethods.v3_1.Y, DelegateMethods.v3_1.Z), percent); - public static bool SpreadDirt(int x, int y) - { - if ((double) Vector2.Distance(DelegateMethods.v2_1, new Vector2((float) x, (float) y)) > (double) DelegateMethods.f_1 || !WorldGen.PlaceTile(x, y, 0)) - return false; - if (Main.netMode != 0) - NetMessage.SendData(17, number: 1, number2: ((float) x), number3: ((float) y)); - Vector2 Position = new Vector2((float) (x * 16), (float) (y * 16)); - int Type = 0; - for (int index = 0; index < 3; ++index) - { - Dust dust1 = Dust.NewDustDirect(Position, 16, 16, Type, Alpha: 100, newColor: Color.Transparent, Scale: 2.2f); - dust1.noGravity = true; - dust1.velocity.Y -= 1.2f; - dust1.velocity *= 4f; - Dust dust2 = Dust.NewDustDirect(Position, 16, 16, Type, Alpha: 100, newColor: Color.Transparent, Scale: 1.3f); - dust2.velocity.Y -= 1.2f; - dust2.velocity *= 2f; - } - int i = x; - int j1 = y + 1; - if (Main.tile[i, j1] != null && !TileID.Sets.Platforms[(int) Main.tile[i, j1].type] && (Main.tile[i, j1].topSlope() || Main.tile[i, j1].halfBrick())) - { - WorldGen.SlopeTile(i, j1); - if (Main.netMode != 0) - NetMessage.SendData(17, number: 14, number2: ((float) i), number3: ((float) j1)); - } - int j2 = y - 1; - if (Main.tile[i, j2] != null && !TileID.Sets.Platforms[(int) Main.tile[i, j2].type] && Main.tile[i, j2].bottomSlope()) - { - WorldGen.SlopeTile(i, j2); - if (Main.netMode != 0) - NetMessage.SendData(17, number: 14, number2: ((float) i), number3: ((float) j2)); - } - return true; - } - - public static bool SpreadWater(int x, int y) - { - if ((double) Vector2.Distance(DelegateMethods.v2_1, new Vector2((float) x, (float) y)) > (double) DelegateMethods.f_1 || !WorldGen.PlaceLiquid(x, y, (byte) 0, byte.MaxValue)) - return false; - Vector2 Position = new Vector2((float) (x * 16), (float) (y * 16)); - int Type = Dust.dustWater(); - for (int index = 0; index < 3; ++index) - { - Dust dust1 = Dust.NewDustDirect(Position, 16, 16, Type, Alpha: 100, newColor: Color.Transparent, Scale: 2.2f); - dust1.noGravity = true; - dust1.velocity.Y -= 1.2f; - dust1.velocity *= 7f; - Dust dust2 = Dust.NewDustDirect(Position, 16, 16, Type, Alpha: 100, newColor: Color.Transparent, Scale: 1.3f); - dust2.velocity.Y -= 1.2f; - dust2.velocity *= 4f; - } - return true; - } - - public static bool SpreadHoney(int x, int y) - { - if ((double) Vector2.Distance(DelegateMethods.v2_1, new Vector2((float) x, (float) y)) > (double) DelegateMethods.f_1 || !WorldGen.PlaceLiquid(x, y, (byte) 2, byte.MaxValue)) - return false; - Vector2 Position = new Vector2((float) (x * 16), (float) (y * 16)); - int Type = 152; - for (int index = 0; index < 3; ++index) - { - Dust dust1 = Dust.NewDustDirect(Position, 16, 16, Type, Alpha: 100, newColor: Color.Transparent, Scale: 2.2f); - dust1.velocity.Y -= 1.2f; - dust1.velocity *= 7f; - Dust dust2 = Dust.NewDustDirect(Position, 16, 16, Type, Alpha: 100, newColor: Color.Transparent, Scale: 1.3f); - dust2.velocity.Y -= 1.2f; - dust2.velocity *= 4f; - } - return true; - } - - public static bool SpreadLava(int x, int y) - { - if ((double) Vector2.Distance(DelegateMethods.v2_1, new Vector2((float) x, (float) y)) > (double) DelegateMethods.f_1 || !WorldGen.PlaceLiquid(x, y, (byte) 1, byte.MaxValue)) - return false; - Vector2 Position = new Vector2((float) (x * 16), (float) (y * 16)); - int Type = 35; - for (int index = 0; index < 3; ++index) - { - Dust.NewDustDirect(Position, 16, 16, Type, Alpha: 100, newColor: Color.Transparent, Scale: 1.2f).velocity *= 7f; - Dust.NewDustDirect(Position, 16, 16, Type, Alpha: 100, newColor: Color.Transparent, Scale: 0.8f).velocity *= 4f; - } - return true; - } - - public static bool SpreadDry(int x, int y) - { - if ((double) Vector2.Distance(DelegateMethods.v2_1, new Vector2((float) x, (float) y)) > (double) DelegateMethods.f_1 || !WorldGen.EmptyLiquid(x, y)) - return false; - Vector2 Position = new Vector2((float) (x * 16), (float) (y * 16)); - int Type = 31; - for (int index = 0; index < 3; ++index) - { - Dust dust = Dust.NewDustDirect(Position, 16, 16, Type, Alpha: 100, newColor: Color.Transparent, Scale: 1.2f); - dust.noGravity = true; - dust.velocity *= 7f; - Dust.NewDustDirect(Position, 16, 16, Type, Alpha: 100, newColor: Color.Transparent, Scale: 0.8f).velocity *= 4f; - } - return true; - } - - public static bool SpreadTest(int x, int y) - { - Tile tile = Main.tile[x, y]; - if (!WorldGen.SolidTile(x, y) && tile.wall == (ushort) 0) - return true; - tile.active(); - return false; - } - public static bool TestDust(int x, int y) { if (x < 0 || x >= Main.maxTilesX || y < 0 || y >= Main.maxTilesY) @@ -171,26 +56,6 @@ namespace Terraria return true; } - public static bool CastLightOpen_StopForSolids_ScaleWithDistance(int x, int y) - { - if (x < 0 || x >= Main.maxTilesX || y < 0 || y >= Main.maxTilesY || Main.tile[x, y] == null || Main.tile[x, y].active() && !Main.tile[x, y].inActive() && !Main.tileSolidTop[(int) Main.tile[x, y].type] && Main.tileSolid[(int) Main.tile[x, y].type]) - return false; - Vector3 v31 = DelegateMethods.v3_1; - Vector2 vector2 = new Vector2((float) x, (float) y); - float num = Vector2.Distance(DelegateMethods.v2_1, vector2); - Vector3 vector3 = v31 * MathHelper.Lerp(0.65f, 1f, num / DelegateMethods.f_1); - Lighting.AddLight(x, y, vector3.X, vector3.Y, vector3.Z); - return true; - } - - public static bool EmitGolfCartDust_StopForSolids(int x, int y) - { - if (x < 0 || x >= Main.maxTilesX || y < 0 || y >= Main.maxTilesY || Main.tile[x, y] == null || Main.tile[x, y].active() && !Main.tile[x, y].inActive() && !Main.tileSolidTop[(int) Main.tile[x, y].type] && Main.tileSolid[(int) Main.tile[x, y].type]) - return false; - Dust.NewDustPerfect(new Vector2((float) (x * 16 + 8), (float) (y * 16 + 8)), 260, new Vector2?(Vector2.UnitY * -0.2f)); - return true; - } - public static bool NotDoorStand(int x, int y) { if (Main.tile[x, y] == null || !Main.tile[x, y].active() || Main.tile[x, y].type != (ushort) 11) @@ -351,10 +216,6 @@ namespace Terraria Main.dust[index].scale *= 0.6f; } - public static void LandingSound(Vector2 Position, int Width, int Height) => SoundEngine.PlaySound(SoundID.Item53, (int) Position.X + Width / 2, (int) Position.Y + Height / 2); - - public static void BumperSound(Vector2 Position, int Width, int Height) => SoundEngine.PlaySound(SoundID.Item56, (int) Position.X + Width / 2, (int) Position.Y + Height / 2); - public static void SparksMech(Vector2 dustPosition) { dustPosition += new Vector2(Main.rand.Next(2) == 0 ? 13f : -13f, 0.0f).RotatedBy((double) DelegateMethods.Minecart.rotation); @@ -371,24 +232,6 @@ namespace Terraria else Main.dust[index].scale *= 0.6f; } - - public static void SparksMeow(Vector2 dustPosition) - { - dustPosition += new Vector2(Main.rand.Next(2) == 0 ? 13f : -13f, 0.0f).RotatedBy((double) DelegateMethods.Minecart.rotation); - int index = Dust.NewDust(dustPosition, 1, 1, 213, (float) Main.rand.Next(-2, 3), (float) Main.rand.Next(-2, 3)); - Main.dust[index].shader = GameShaders.Armor.GetShaderFromItemId(2870); - Main.dust[index].noGravity = true; - Main.dust[index].fadeIn = (float) ((double) Main.dust[index].scale + 1.0 + 0.00999999977648258 * (double) Main.rand.Next(0, 51)); - Main.dust[index].noGravity = true; - Main.dust[index].velocity *= (float) Main.rand.Next(15, 51) * 0.01f; - Main.dust[index].velocity.X *= (float) Main.rand.Next(25, 101) * 0.01f; - Main.dust[index].velocity.Y -= (float) Main.rand.Next(15, 31) * 0.1f; - Main.dust[index].position.Y -= 4f; - if (Main.rand.Next(3) != 0) - Main.dust[index].noGravity = false; - else - Main.dust[index].scale *= 0.6f; - } } } } diff --git a/DeprecatedClassLeftInForLoading.cs b/DeprecatedClassLeftInForLoading.cs index 3476b12..5a82522 100644 --- a/DeprecatedClassLeftInForLoading.cs +++ b/DeprecatedClassLeftInForLoading.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.DeprecatedClassLeftInForLoading -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/Dust.cs b/Dust.cs index 28dffaf..0cb9058 100644 --- a/Dust.cs +++ b/Dust.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Dust -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -26,7 +26,6 @@ namespace Terraria public float scale; public float rotation; public bool noLight; - public bool noLightEmittence; public bool active; public int type; public Color color; @@ -97,27 +96,27 @@ namespace Terraria if ((double) index > (double) Main.maxDustToDraw * 0.9) { if (Main.rand.Next(4) != 0) - return 6000; + return 5999; } else if ((double) index > (double) Main.maxDustToDraw * 0.8) { if (Main.rand.Next(3) != 0) - return 6000; + return 5999; } else if ((double) index > (double) Main.maxDustToDraw * 0.7) { if (Main.rand.Next(2) == 0) - return 6000; + return 5999; } else if ((double) index > (double) Main.maxDustToDraw * 0.6) { if (Main.rand.Next(4) == 0) - return 6000; + return 5999; } else if ((double) index > (double) Main.maxDustToDraw * 0.5) { if (Main.rand.Next(5) == 0) - return 6000; + return 5999; } else Dust.dCount = 0.0f; @@ -142,7 +141,6 @@ namespace Terraria dust.frame.Y = 10 * Main.rand.Next(3); dust.shader = (ArmorShaderData) null; dust.customData = (object) null; - dust.noLightEmittence = false; int num5 = Type; while (num5 >= 100) { @@ -157,7 +155,7 @@ namespace Terraria dust.scale *= Scale; dust.noLight = false; dust.firstFrame = true; - if (dust.type == 228 || dust.type == 279 || dust.type == 269 || dust.type == 135 || dust.type == 6 || dust.type == 242 || dust.type == 75 || dust.type == 169 || dust.type == 29 || dust.type >= 59 && dust.type <= 65 || dust.type == 158 || dust.type == 293 || dust.type == 294 || dust.type == 295 || dust.type == 296 || dust.type == 297 || dust.type == 298 || dust.type == 302) + if (dust.type == 228 || dust.type == 269 || dust.type == 135 || dust.type == 6 || dust.type == 242 || dust.type == 75 || dust.type == 169 || dust.type == 29 || dust.type >= 59 && dust.type <= 65 || dust.type == 158) { dust.velocity.Y = (float) Main.rand.Next(-10, 6) * 0.1f; dust.velocity.X *= 0.3f; @@ -220,8 +218,6 @@ namespace Terraria return dust; } - public static Dust QuickDust(int x, int y, Color color) => Dust.QuickDust(new Point(x, y), color); - public static Dust QuickDust(Point tileCoords, Color color) => Dust.QuickDust(tileCoords.ToWorldCoordinates(), color); public static void QuickBox( @@ -261,16 +257,6 @@ namespace Terraria return dust; } - public static Dust QuickDustSmall(Vector2 pos, Color color, bool floorPositionValues = false) - { - Dust dust = Dust.QuickDust(pos, color); - dust.fadeIn = 0.0f; - dust.scale = 0.35f; - if (floorPositionValues) - dust.position = dust.position.Floor(); - return dust; - } - public static void QuickDustLine(Vector2 start, Vector2 end, float splits, Color color) { Dust.QuickDust(start, color).scale = 2f; @@ -302,8 +288,6 @@ namespace Terraria return 105; case 10: return 123; - case 12: - return 288; default: return 33; } @@ -315,7 +299,7 @@ namespace Terraria Dust.lavaBubbles = 0; Main.snowDust = 0; Dust.SandStormCount = 0; - bool flag = Sandstorm.ShouldSandstormDustPersist(); + bool flag = Sandstorm.Happening && Main.player[Main.myPlayer].ZoneSandstorm && (Main.bgStyle == 2 || Main.bgStyle == 5) && Main.bgDelay < 50; for (int index1 = 0; index1 < 6000; ++index1) { Dust dust = Main.dust[index1]; @@ -346,15 +330,6 @@ namespace Terraria else dust.active = false; } - switch (dust.type) - { - case 299: - case 300: - case 301: - dust.scale *= 0.96f; - dust.velocity.Y -= 0.01f; - break; - } if (dust.type == 35) ++Dust.lavaBubbles; dust.position += dust.velocity; @@ -363,7 +338,7 @@ namespace Terraria dust.noGravity = true; dust.scale += 0.015f; } - if ((dust.type >= 86 && dust.type <= 92 || dust.type == 286) && !dust.noLight && !dust.noLightEmittence) + if (dust.type >= 86 && dust.type <= 92 && !dust.noLight) { float num3 = dust.scale * 0.6f; if ((double) num3 > 1.0) @@ -407,7 +382,7 @@ namespace Terraria } Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num3 * num5, num3 * num6, num3 * num7); } - if (dust.type >= 86 && dust.type <= 92 || dust.type == 286) + if (dust.type >= 86 && dust.type <= 92) { if (dust.customData != null && dust.customData is Player) { @@ -536,7 +511,7 @@ namespace Terraria } if (dust.type == 261) { - if (!dust.noLight && !dust.noLightEmittence) + if (!dust.noLight) { float num29 = dust.scale * 0.3f; if ((double) num29 > 1.0) @@ -585,8 +560,6 @@ namespace Terraria } if (dust.type == 211 && dust.noLight && Collision.SolidCollision(dust.position, 4, 4)) dust.active = false; - if (dust.type == 284 && Collision.SolidCollision(dust.position - Vector2.One * 4f, 8, 8) && (double) dust.fadeIn == 0.0) - dust.velocity *= 0.25f; if (dust.type == 213 || dust.type == 260) { dust.rotation = 0.0f; @@ -665,29 +638,37 @@ namespace Terraria } if (dust.type == 156) { - float lightAmount = dust.scale * 0.6f; + float num80 = dust.scale * 0.6f; int type = dust.type; - float num80 = lightAmount; - float num81 = lightAmount; - float num82 = num80 * 0.9f; - float num83 = num81 * 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), 12, lightAmount); + float num81 = num80; + float num82 = num80; + float num83 = num80; + float num84 = num81 * 0.5f; + float num85 = num82 * 0.9f; + float num86 = num83 * 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num80 * num84, num80 * num85, num80 * num86); } if (dust.type == 234) { - float lightAmount = dust.scale * 0.6f; + float num87 = dust.scale * 0.6f; int type = dust.type; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), 13, lightAmount); + float num88 = num87; + float num89 = num87; + float num90 = num87; + float num91 = num88 * 0.95f; + float num92 = num89 * 0.65f; + float num93 = num90 * 1.3f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num87 * num91, num87 * num92, num87 * num93); } if (dust.type == 175) dust.scale -= 0.05f; if (dust.type == 174) { dust.scale -= 0.01f; - float r = dust.scale * 1f; - if ((double) r > 0.600000023841858) - r = 0.6f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), r, r * 0.4f, 0.0f); + float R = dust.scale * 1f; + if ((double) R > 0.600000023841858) + R = 0.6f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), R, R * 0.4f, 0.0f); } if (dust.type == 235) { @@ -696,11 +677,11 @@ namespace Terraria vector2 *= 15f; dust.scale -= 0.01f; } - else if (dust.type == 228 || dust.type == 279 || dust.type == 229 || dust.type == 6 || dust.type == 242 || dust.type == 135 || dust.type == (int) sbyte.MaxValue || dust.type == 187 || dust.type == 75 || dust.type == 169 || dust.type == 29 || dust.type >= 59 && dust.type <= 65 || dust.type == 158 || dust.type == 293 || dust.type == 294 || dust.type == 295 || dust.type == 296 || dust.type == 297 || dust.type == 298 || dust.type == 302) + else if (dust.type == 228 || dust.type == 229 || dust.type == 6 || dust.type == 242 || dust.type == 135 || dust.type == (int) sbyte.MaxValue || dust.type == 187 || dust.type == 75 || dust.type == 169 || dust.type == 29 || dust.type >= 59 && dust.type <= 65 || dust.type == 158) { if (!dust.noGravity) dust.velocity.Y += 0.05f; - if (dust.type == 229 || dust.type == 228 || dust.type == 279) + if (dust.type == 229 || dust.type == 228) { if (dust.customData != null && dust.customData is NPC) { @@ -720,119 +701,124 @@ namespace Terraria dust.velocity = (dust.velocity * 4f + vector2 * dust.velocity.Length()) / 5f; } } - if (!dust.noLight && !dust.noLightEmittence) + if (!dust.noLight) { - float num84 = dust.scale * 1.4f; + float num94 = dust.scale * 1.4f; if (dust.type == 29) { - if ((double) num84 > 1.0) - num84 = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num84 * 0.1f, num84 * 0.4f, num84); + if ((double) num94 > 1.0) + num94 = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num94 * 0.1f, num94 * 0.4f, num94); } else if (dust.type == 75) { - if ((double) num84 > 1.0) - num84 = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), 8, num84); + if ((double) num94 > 1.0) + num94 = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num94 * 0.7f, num94, num94 * 0.2f); } else if (dust.type == 169) { - if ((double) num84 > 1.0) - num84 = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), 11, num84); + if ((double) num94 > 1.0) + num94 = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num94 * 1.1f, num94 * 1.1f, num94 * 0.2f); } else if (dust.type == 135) { - if ((double) num84 > 1.0) - num84 = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), 9, num84); + if ((double) num94 > 1.0) + num94 = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num94 * 0.2f, num94 * 0.7f, num94); } else if (dust.type == 158) { - if ((double) num84 > 1.0) - num84 = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), 10, num84); + if ((double) num94 > 1.0) + num94 = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num94 * 1f, num94 * 0.5f, 0.0f); } else if (dust.type == 228) { - if ((double) num84 > 1.0) - num84 = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num84 * 0.7f, num84 * 0.65f, num84 * 0.3f); + if ((double) num94 > 1.0) + num94 = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num94 * 0.7f, num94 * 0.65f, num94 * 0.3f); } else if (dust.type == 229) { - if ((double) num84 > 1.0) - num84 = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num84 * 0.3f, num84 * 0.65f, num84 * 0.7f); + if ((double) num94 > 1.0) + num94 = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num94 * 0.3f, num94 * 0.65f, num94 * 0.7f); } else if (dust.type == 242) { - if ((double) num84 > 1.0) - num84 = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), 15, num84); - } - else if (dust.type == 293) - { - if ((double) num84 > 1.0) - num84 = 1f; - float lightAmount = num84 * 0.95f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), 16, lightAmount); - } - else if (dust.type == 294) - { - if ((double) num84 > 1.0) - num84 = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), 17, num84); + if ((double) num94 > 1.0) + num94 = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num94, 0.0f, num94); } else if (dust.type >= 59 && dust.type <= 65) { - if ((double) num84 > 0.800000011920929) - num84 = 0.8f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), 1 + dust.type - 59, num84); + if ((double) num94 > 0.800000011920929) + num94 = 0.8f; + int num95 = dust.type - 58; + float num96 = 1f; + float num97 = 1f; + float num98 = 1f; + switch (num95) + { + case 1: + num96 = 0.0f; + num97 = 0.1f; + num98 = 1.3f; + break; + case 2: + num96 = 1f; + num97 = 0.1f; + num98 = 0.1f; + break; + case 3: + num96 = 0.0f; + num97 = 1f; + num98 = 0.1f; + break; + case 4: + num96 = 0.9f; + num97 = 0.0f; + num98 = 0.9f; + break; + case 5: + num96 = 1.3f; + num97 = 1.3f; + num98 = 1.3f; + break; + case 6: + num96 = 0.9f; + num97 = 0.9f; + num98 = 0.0f; + break; + case 7: + num96 = (float) (0.5 * (double) Main.demonTorch + 1.0 * (1.0 - (double) Main.demonTorch)); + num97 = 0.3f; + num98 = (float) (1.0 * (double) Main.demonTorch + 0.5 * (1.0 - (double) Main.demonTorch)); + break; + } + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num94 * num96, num94 * num97, num94 * num98); } else if (dust.type == (int) sbyte.MaxValue) { - float r = num84 * 1.3f; - if ((double) r > 1.0) - r = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), r, r * 0.45f, r * 0.2f); + float R = num94 * 1.3f; + if ((double) R > 1.0) + R = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), R, R * 0.45f, R * 0.2f); } else if (dust.type == 187) { - float b = num84 * 1.3f; - if ((double) b > 1.0) - b = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), b * 0.2f, b * 0.45f, b); - } - else if (dust.type == 295) - { - if ((double) num84 > 1.0) - num84 = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), 18, num84); - } - else if (dust.type == 296) - { - if ((double) num84 > 1.0) - num84 = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), 19, num84); - } - else if (dust.type == 297) - { - if ((double) num84 > 1.0) - num84 = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), 20, num84); - } - else if (dust.type == 298) - { - if ((double) num84 > 1.0) - num84 = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), 21, num84); + float B = num94 * 1.3f; + if ((double) B > 1.0) + B = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), B * 0.2f, B * 0.45f, B); } else { - if ((double) num84 > 0.600000023841858) - num84 = 0.6f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num84, num84 * 0.65f, num84 * 0.4f); + if ((double) num94 > 0.600000023841858) + num94 = 0.6f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num94, num94 * 0.65f, num94 * 0.4f); } } } @@ -840,11 +826,11 @@ namespace Terraria { if (!dust.noLight) { - float num85 = dust.scale * 1.4f; - if ((double) num85 > 1.0) - num85 = 1f; + float num99 = dust.scale * 1.4f; + if ((double) num99 > 1.0) + num99 = 1f; Vector3 vector3 = new Vector3(0.7f, 0.65f, 0.3f); - Lighting.AddLight(dust.position, vector3 * num85); + Lighting.AddLight(dust.position, vector3 * num99); } if (dust.customData != null && dust.customData is Vector2) { @@ -854,10 +840,10 @@ namespace Terraria } else if (dust.type == 159) { - float num86 = dust.scale * 1.3f; - if ((double) num86 > 1.0) - num86 = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num86, num86, num86 * 0.1f); + float num100 = dust.scale * 1.3f; + if ((double) num100 > 1.0) + num100 = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num100, num100, num100 * 0.1f); if (dust.noGravity) { if ((double) dust.scale < 0.699999988079071) @@ -884,10 +870,10 @@ namespace Terraria } else if (dust.type == 164) { - float r = dust.scale; - if ((double) r > 1.0) - r = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), r, r * 0.1f, r * 0.8f); + float R = dust.scale; + if ((double) R > 1.0) + R = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), R, R * 0.1f, R * 0.8f); if (dust.noGravity) { if ((double) dust.scale < 0.699999988079071) @@ -914,10 +900,10 @@ namespace Terraria } else if (dust.type == 173) { - float b = dust.scale; - if ((double) b > 1.0) - b = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), b * 0.4f, b * 0.1f, b); + float B = dust.scale; + if ((double) B > 1.0) + B = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), B * 0.4f, B * 0.1f, B); if (dust.noGravity) { dust.velocity *= 0.8f; @@ -949,13 +935,13 @@ namespace Terraria } else if (dust.type == 160 || dust.type == 162) { - float num87 = dust.scale * 1.3f; - if ((double) num87 > 1.0) - num87 = 1f; + float num101 = dust.scale * 1.3f; + if ((double) num101 > 1.0) + num101 = 1f; if (dust.type == 162) - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num87, num87 * 0.7f, num87 * 0.1f); + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num101, num101 * 0.7f, num101 * 0.1f); else - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num87 * 0.1f, num87, num87); + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num101 * 0.1f, num101, num101); if (dust.noGravity) { dust.velocity *= 0.8f; @@ -978,10 +964,10 @@ namespace Terraria } else if (dust.type == 168) { - float r = dust.scale * 0.8f; - if ((double) r > 0.55) - r = 0.55f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), r, 0.0f, r * 0.8f); + float R = dust.scale * 0.8f; + if ((double) R > 0.55) + R = 0.55f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), R, 0.0f, R * 0.8f); dust.scale += 0.03f; dust.velocity.X += (float) Main.rand.Next(-10, 11) * 0.02f; dust.velocity.Y += (float) Main.rand.Next(-10, 11) * 0.02f; @@ -1000,46 +986,14 @@ namespace Terraria else dust.rotation -= 0.005f; } - else if (dust.type == 14 || dust.type == 16 || dust.type == 31 || dust.type == 46 || dust.type == 124 || dust.type == 186 || dust.type == 188 || dust.type == 303) + else if (dust.type == 14 || dust.type == 16 || dust.type == 31 || dust.type == 46 || dust.type == 124 || dust.type == 186 || dust.type == 188) { dust.velocity.Y *= 0.98f; dust.velocity.X *= 0.98f; - if (dust.type == 31) - { - if (dust.customData != null && dust.customData is NPC) - { - NPC customData = (NPC) dust.customData; - dust.position += customData.position - customData.oldPosition; - if (dust.noGravity) - dust.velocity *= 1.02f; - dust.alpha -= 70; - if (dust.alpha < 0) - dust.alpha = 0; - dust.scale *= 0.97f; - if ((double) dust.scale <= 0.00999999977648258) - { - dust.scale = 0.0001f; - dust.alpha = (int) byte.MaxValue; - } - } - else if (dust.noGravity) - { - dust.velocity *= 1.02f; - dust.scale += 0.02f; - dust.alpha += 4; - if (dust.alpha > (int) byte.MaxValue) - { - dust.scale = 0.0001f; - dust.alpha = (int) byte.MaxValue; - } - } - } - if (dust.type == 303 && dust.noGravity) + if (dust.type == 31 && dust.noGravity) { dust.velocity *= 1.02f; - dust.scale += 0.03f; - if (dust.alpha < 90) - dust.alpha = 90; + dust.scale += 0.02f; dust.alpha += 4; if (dust.alpha > (int) byte.MaxValue) { @@ -1059,13 +1013,13 @@ namespace Terraria { dust.rotation += 0.1f * dust.scale; Color color = Lighting.GetColor((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0)); - int num88; - float num89 = (float) (((double) (num88 = (int) (byte) (((int) color.R + (int) color.G + (int) color.B) / 3)) / 270.0 + 1.0) / 2.0); - float num90 = (float) (((double) num88 / 270.0 + 1.0) / 2.0); - float num91 = (float) (((double) num88 / 270.0 + 1.0) / 2.0); - float num92 = num89 * (dust.scale * 0.9f); - float num93 = num90 * (dust.scale * 0.9f); - float num94 = num91 * (dust.scale * 0.9f); + int num102; + float num103 = (float) (((double) (num102 = (int) (byte) (((int) color.R + (int) color.G + (int) color.B) / 3)) / 270.0 + 1.0) / 2.0); + float num104 = (float) (((double) num102 / 270.0 + 1.0) / 2.0); + float num105 = (float) (((double) num102 / 270.0 + 1.0) / 2.0); + float num106 = num103 * (dust.scale * 0.9f); + float num107 = num104 * (dust.scale * 0.9f); + float num108 = num105 * (dust.scale * 0.9f); if (dust.alpha < (int) byte.MaxValue) { dust.scale += 0.09f; @@ -1082,53 +1036,53 @@ namespace Terraria if ((double) dust.scale < 0.5) dust.scale -= 0.01f; } - float num95 = 1f; + float num109 = 1f; if (dust.type == 244) { - num92 *= 0.8862745f; - num93 *= 0.4627451f; - num94 *= 0.2980392f; - num95 = 0.9f; + num106 *= 0.8862745f; + num107 *= 0.4627451f; + num108 *= 0.2980392f; + num109 = 0.9f; } else if (dust.type == 245) { - num92 *= 0.5137255f; - num93 *= 0.6745098f; - num94 *= 0.6784314f; - num95 = 1f; + num106 *= 0.5137255f; + num107 *= 0.6745098f; + num108 *= 0.6784314f; + num109 = 1f; } else if (dust.type == 246) { - num92 *= 0.8f; - num93 *= 0.7098039f; - num94 *= 0.282353f; - num95 = 1.1f; + num106 *= 0.8f; + num107 *= 0.7098039f; + num108 *= 0.282353f; + num109 = 1.1f; } else if (dust.type == 247) { - num92 *= 0.6f; - num93 *= 0.6745098f; - num94 *= 0.7254902f; - num95 = 1.2f; + num106 *= 0.6f; + num107 *= 0.6745098f; + num108 *= 0.7254902f; + num109 = 1.2f; } - float r = num92 * num95; - float g = num93 * num95; - float b = num94 * num95; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), r, g, b); + float R = num106 * num109; + float G = num107 * num109; + float B = num108 * num109; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), R, G, B); } else if (dust.type == 43) { dust.rotation += 0.1f * dust.scale; Color color = Lighting.GetColor((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0)); - float num96 = (float) color.R / 270f; - float num97 = (float) color.G / 270f; - float num98 = (float) color.B / 270f; - float num99 = (float) dust.color.R / (float) byte.MaxValue; - float num100 = (float) dust.color.G / (float) byte.MaxValue; - float num101 = (float) dust.color.B / (float) byte.MaxValue; - float r = num96 * (dust.scale * 1.07f * num99); - float g = num97 * (dust.scale * 1.07f * num100); - float b = num98 * (dust.scale * 1.07f * num101); + float num110 = (float) color.R / 270f; + float num111 = (float) color.G / 270f; + float num112 = (float) color.B / 270f; + float num113 = (float) ((int) dust.color.R / (int) byte.MaxValue); + float num114 = (float) ((int) dust.color.G / (int) byte.MaxValue); + float num115 = (float) ((int) dust.color.B / (int) byte.MaxValue); + float R = num110 * (dust.scale * 1.07f * num113); + float G = num111 * (dust.scale * 1.07f * num114); + float B = num112 * (dust.scale * 1.07f * num115); if (dust.alpha < (int) byte.MaxValue) { dust.scale += 0.09f; @@ -1145,36 +1099,28 @@ namespace Terraria if ((double) dust.scale < 0.5) dust.scale -= 0.01f; } - if ((double) r < 0.05 && (double) g < 0.05 && (double) b < 0.05) + if ((double) R < 0.05 && (double) G < 0.05 && (double) B < 0.05) dust.active = false; - else if (!dust.noLightEmittence) - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), r, g, b); - if (dust.customData != null && dust.customData is Player) - { - Player customData = (Player) dust.customData; - dust.position += customData.position - customData.oldPosition; - } + else + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), R, G, B); } - else if (dust.type == 15 || dust.type == 57 || dust.type == 58 || dust.type == 274 || dust.type == 292) + else if (dust.type == 15 || dust.type == 57 || dust.type == 58 || dust.type == 274) { dust.velocity.Y *= 0.98f; dust.velocity.X *= 0.98f; - if (!dust.noLightEmittence) - { - float num102 = dust.scale; - if (dust.type != 15) - num102 = dust.scale * 0.8f; - if (dust.noLight) - dust.velocity *= 0.95f; - if ((double) num102 > 1.0) - num102 = 1f; - if (dust.type == 15) - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num102 * 0.45f, num102 * 0.55f, num102); - else if (dust.type == 57) - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num102 * 0.95f, num102 * 0.95f, num102 * 0.45f); - else if (dust.type == 58) - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num102, num102 * 0.55f, num102 * 0.75f); - } + float num116 = dust.scale; + if (dust.type != 15) + num116 = dust.scale * 0.8f; + if (dust.noLight) + dust.velocity *= 0.95f; + if ((double) num116 > 1.0) + num116 = 1f; + if (dust.type == 15) + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num116 * 0.45f, num116 * 0.55f, num116); + else if (dust.type == 57) + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num116 * 0.95f, num116 * 0.95f, num116 * 0.45f); + else if (dust.type == 58) + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num116, num116 * 0.55f, num116 * 0.75f); } else if (dust.type == 204) { @@ -1186,38 +1132,38 @@ namespace Terraria } else if (dust.type == 110) { - float g = dust.scale * 0.1f; - if ((double) g > 1.0) - g = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), g * 0.2f, g, g * 0.5f); + float G = dust.scale * 0.1f; + if ((double) G > 1.0) + G = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), G * 0.2f, G, G * 0.5f); } else if (dust.type == 111) { - float b = dust.scale * 0.125f; - if ((double) b > 1.0) - b = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), b * 0.2f, b * 0.7f, b); + float B = dust.scale * 0.125f; + if ((double) B > 1.0) + B = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), B * 0.2f, B * 0.7f, B); } else if (dust.type == 112) { - float num103 = dust.scale * 0.1f; - if ((double) num103 > 1.0) - num103 = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num103 * 0.8f, num103 * 0.2f, num103 * 0.8f); + float num117 = dust.scale * 0.1f; + if ((double) num117 > 1.0) + num117 = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num117 * 0.8f, num117 * 0.2f, num117 * 0.8f); } else if (dust.type == 113) { - float num104 = dust.scale * 0.1f; - if ((double) num104 > 1.0) - num104 = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num104 * 0.2f, num104 * 0.3f, num104 * 1.3f); + float num118 = dust.scale * 0.1f; + if ((double) num118 > 1.0) + num118 = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num118 * 0.2f, num118 * 0.3f, num118 * 1.3f); } else if (dust.type == 114) { - float num105 = dust.scale * 0.1f; - if ((double) num105 > 1.0) - num105 = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num105 * 1.2f, num105 * 0.5f, num105 * 0.4f); + float num119 = dust.scale * 0.1f; + if ((double) num119 > 1.0) + num119 = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num119 * 1.2f, num119 * 0.5f, num119 * 0.4f); } else if (dust.type == 66) { @@ -1228,12 +1174,12 @@ namespace Terraria dust.velocity.Y *= 0.98f; dust.velocity.X *= 0.98f; dust.scale += 0.02f; - float num106 = dust.scale; + float num120 = dust.scale; if (dust.type != 15) - num106 = dust.scale * 0.8f; - if ((double) num106 > 1.0) - num106 = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num106 * ((float) dust.color.R / (float) byte.MaxValue), num106 * ((float) dust.color.G / (float) byte.MaxValue), num106 * ((float) dust.color.B / (float) byte.MaxValue)); + num120 = dust.scale * 0.8f; + if ((double) num120 > 1.0) + num120 = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num120 * ((float) dust.color.R / (float) byte.MaxValue), num120 * ((float) dust.color.G / (float) byte.MaxValue), num120 * ((float) dust.color.B / (float) byte.MaxValue)); } else if (dust.type == 267) { @@ -1244,34 +1190,34 @@ namespace Terraria dust.velocity.Y *= 0.98f; dust.velocity.X *= 0.98f; dust.scale += 0.02f; - float num107 = dust.scale * 0.8f; - if ((double) num107 > 1.0) - num107 = 1f; + float num121 = dust.scale * 0.8f; + if ((double) num121 > 1.0) + num121 = 1f; if (dust.noLight) dust.noLight = false; - if (!dust.noLight && !dust.noLightEmittence) - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num107 * ((float) dust.color.R / (float) byte.MaxValue), num107 * ((float) dust.color.G / (float) byte.MaxValue), num107 * ((float) dust.color.B / (float) byte.MaxValue)); + if (!dust.noLight) + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num121 * ((float) dust.color.R / (float) byte.MaxValue), num121 * ((float) dust.color.G / (float) byte.MaxValue), num121 * ((float) dust.color.B / (float) byte.MaxValue)); } else if (dust.type == 20 || dust.type == 21 || dust.type == 231) { dust.scale += 0.005f; dust.velocity.Y *= 0.94f; dust.velocity.X *= 0.94f; - float b1 = dust.scale * 0.8f; - if ((double) b1 > 1.0) - b1 = 1f; - if (dust.type == 21 && !dust.noLightEmittence) + float B1 = dust.scale * 0.8f; + if ((double) B1 > 1.0) + B1 = 1f; + if (dust.type == 21) { - float b2 = dust.scale * 0.4f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), b2 * 0.8f, b2 * 0.3f, b2); + float B2 = dust.scale * 0.4f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), B2 * 0.8f, B2 * 0.3f, B2); } else if (dust.type == 231) { - float r = dust.scale * 0.4f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), r, r * 0.5f, r * 0.3f); + float R = dust.scale * 0.4f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), R, R * 0.5f, R * 0.3f); } else - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), b1 * 0.3f, b1 * 0.6f, b1); + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), B1 * 0.3f, B1 * 0.6f, B1); } else if (dust.type == 27 || dust.type == 45) { @@ -1288,10 +1234,10 @@ namespace Terraria } dust.velocity *= 0.94f; dust.scale += 1f / 500f; - float b = dust.scale; + float B = dust.scale; if (dust.noLight) { - b *= 0.1f; + B *= 0.1f; dust.scale -= 0.06f; if ((double) dust.scale < 1.0) dust.scale -= 0.06f; @@ -1300,50 +1246,47 @@ namespace Terraria else dust.position += Main.player[Main.myPlayer].velocity; } - if ((double) b > 1.0) - b = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), b * 0.6f, b * 0.2f, b); + if ((double) B > 1.0) + B = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), B * 0.6f, B * 0.2f, B); } else if (dust.type == 55 || dust.type == 56 || dust.type == 73 || dust.type == 74) { dust.velocity *= 0.98f; - if (!dust.noLightEmittence) + float num122 = dust.scale * 0.8f; + if (dust.type == 55) { - float num108 = dust.scale * 0.8f; - if (dust.type == 55) - { - if ((double) num108 > 1.0) - num108 = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num108, num108, num108 * 0.6f); - } - else if (dust.type == 73) - { - if ((double) num108 > 1.0) - num108 = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num108, num108 * 0.35f, num108 * 0.5f); - } - else if (dust.type == 74) - { - if ((double) num108 > 1.0) - num108 = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num108 * 0.35f, num108, num108 * 0.5f); - } - else - { - float b = dust.scale * 1.2f; - if ((double) b > 1.0) - b = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), b * 0.35f, b * 0.5f, b); - } + if ((double) num122 > 1.0) + num122 = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num122, num122, num122 * 0.6f); + } + else if (dust.type == 73) + { + if ((double) num122 > 1.0) + num122 = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num122, num122 * 0.35f, num122 * 0.5f); + } + else if (dust.type == 74) + { + if ((double) num122 > 1.0) + num122 = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num122 * 0.35f, num122, num122 * 0.5f); + } + else + { + float B = dust.scale * 1.2f; + if ((double) B > 1.0) + B = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), B * 0.35f, B * 0.5f, B); } } else if (dust.type == 71 || dust.type == 72) { dust.velocity *= 0.98f; - float num109 = dust.scale; - if ((double) num109 > 1.0) - num109 = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num109 * 0.2f, 0.0f, num109 * 0.1f); + float num123 = dust.scale; + if ((double) num123 > 1.0) + num123 = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num123 * 0.2f, 0.0f, num123 * 0.1f); } else if (dust.type == 76) { @@ -1418,7 +1361,7 @@ namespace Terraria } if (dust.type == 5 || dust.type == 273 && dust.noGravity) dust.scale -= 0.04f; - if (dust.type == 33 || dust.type == 52 || dust.type == 266 || dust.type == 98 || dust.type == 99 || dust.type == 100 || dust.type == 101 || dust.type == 102 || dust.type == 103 || dust.type == 104 || dust.type == 105 || dust.type == 123 || dust.type == 288) + if (dust.type == 33 || dust.type == 52 || dust.type == 266 || dust.type == 98 || dust.type == 99 || dust.type == 100 || dust.type == 101 || dust.type == 102 || dust.type == 103 || dust.type == 104 || dust.type == 105 || dust.type == 123) { if ((double) dust.velocity.X == 0.0) { @@ -1459,10 +1402,10 @@ namespace Terraria dust.rotation += 0.01f; else dust.rotation -= 0.01f; - float r = dust.scale * 0.6f; - if ((double) r > 1.0) - r = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0 + 1.0), r, r * 0.3f, r * 0.1f); + float R = dust.scale * 0.6f; + if ((double) R > 1.0) + R = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0 + 1.0), R, R * 0.3f, R * 0.1f); } else if (dust.type == 152 && dust.noGravity) { @@ -1477,28 +1420,28 @@ namespace Terraria } else if (dust.type == 67 || dust.type == 92) { - float b = dust.scale; - if ((double) b > 1.0) - b = 1f; + float B = dust.scale; + if ((double) B > 1.0) + B = 1f; if (dust.noLight) - b *= 0.1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), 0.0f, b * 0.8f, b); + B *= 0.1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), 0.0f, B * 0.8f, B); } else if (dust.type == 185) { - float b = dust.scale; - if ((double) b > 1.0) - b = 1f; + float B = dust.scale; + if ((double) B > 1.0) + B = 1f; if (dust.noLight) - b *= 0.1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), b * 0.1f, b * 0.7f, b); + B *= 0.1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), B * 0.1f, B * 0.7f, B); } else if (dust.type == 107) { - float g = dust.scale * 0.5f; - if ((double) g > 1.0) - g = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), g * 0.1f, g, g * 0.4f); + float G = dust.scale * 0.5f; + if ((double) G > 1.0) + G = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), G * 0.1f, G, G * 0.4f); } else if (dust.type == 34 || dust.type == 35 || dust.type == 152) { @@ -1530,25 +1473,25 @@ namespace Terraria } if (dust.type == 35) { - float r = (float) ((double) dust.scale * 0.300000011920929 + 0.400000005960464); - if ((double) r > 1.0) - r = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), r, r * 0.5f, r * 0.3f); + float R = (float) ((double) dust.scale * 0.300000011920929 + 0.400000005960464); + if ((double) R > 1.0) + R = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), R, R * 0.5f, R * 0.3f); } } if (dust.type == 68) { - float b = dust.scale * 0.3f; - if ((double) b > 1.0) - b = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), b * 0.1f, b * 0.2f, b); + float B = dust.scale * 0.3f; + if ((double) B > 1.0) + B = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), B * 0.1f, B * 0.2f, B); } if (dust.type == 70) { - float b = dust.scale * 0.3f; - if ((double) b > 1.0) - b = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), b * 0.5f, 0.0f, b); + float B = dust.scale * 0.3f; + if ((double) B > 1.0) + B = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), B * 0.5f, 0.0f, B); } if (dust.type == 41) { @@ -1563,10 +1506,10 @@ namespace Terraria if ((double) dust.velocity.Y < -0.75) dust.velocity.Y = -0.75f; dust.scale += 0.007f; - float b = dust.scale * 0.7f; - if ((double) b > 1.0) - b = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), b * 0.4f, b * 0.9f, b); + float B = dust.scale * 0.7f; + if ((double) B > 1.0) + B = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), B * 0.4f, B * 0.9f, B); } else if (dust.type == 44) { @@ -1581,10 +1524,10 @@ namespace Terraria if ((double) dust.velocity.Y < -0.35) dust.velocity.Y = -0.35f; dust.scale += 0.0085f; - float g = dust.scale * 0.7f; - if ((double) g > 1.0) - g = 1f; - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), g * 0.7f, g, g * 0.8f); + float G = dust.scale * 0.7f; + if ((double) G > 1.0) + G = 1f; + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), G * 0.7f, G, G * 0.8f); } else dust.velocity.X *= 0.99f; @@ -1599,12 +1542,12 @@ namespace Terraria if (index6 >= 0 && index6 <= (int) byte.MaxValue) { Vector2 vector2_3 = dust.position - Main.player[index6].Center; - float num110 = 100f - vector2_3.Length(); - if ((double) num110 > 0.0) - dust.scale -= num110 * 0.0015f; + float num124 = 100f - vector2_3.Length(); + if ((double) num124 > 0.0) + dust.scale -= num124 * 0.0015f; vector2_3.Normalize(); - float num111 = (float) ((1.0 - (double) dust.scale) * 20.0); - Vector2 vector2_4 = vector2_3 * -num111; + float num125 = (float) ((1.0 - (double) dust.scale) * 20.0); + Vector2 vector2_4 = vector2_3 * -num125; dust.velocity = (dust.velocity * 4f + vector2_4) / 5f; } } @@ -1623,17 +1566,17 @@ namespace Terraria dust.scale -= 0.01f; if (dust.type >= 130 && dust.type <= 134) { - float num112 = dust.scale; - if ((double) num112 > 1.0) - num112 = 1f; + float num126 = dust.scale; + if ((double) num126 > 1.0) + num126 = 1f; if (dust.type == 130) - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num112 * 1f, num112 * 0.5f, num112 * 0.4f); + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num126 * 1f, num126 * 0.5f, num126 * 0.4f); if (dust.type == 131) - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num112 * 0.4f, num112 * 1f, num112 * 0.6f); + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num126 * 0.4f, num126 * 1f, num126 * 0.6f); if (dust.type == 132) - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num112 * 0.3f, num112 * 0.5f, num112 * 1f); + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num126 * 0.3f, num126 * 0.5f, num126 * 1f); if (dust.type == 133) - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num112 * 0.9f, num112 * 0.9f, num112 * 0.3f); + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num126 * 0.9f, num126 * 0.9f, num126 * 0.3f); if (dust.noGravity) { dust.velocity *= 0.93f; @@ -1652,45 +1595,21 @@ namespace Terraria dust.scale -= 1f / 400f; } } - else if (dust.type == 278) - { - float num113 = dust.scale; - if ((double) num113 > 1.0) - num113 = 1f; - if (!dust.noLight) - Lighting.AddLight(dust.position, dust.color.ToVector3() * num113); - if (dust.noGravity) - { - dust.velocity *= 0.93f; - if ((double) dust.fadeIn == 0.0) - dust.scale += 1f / 400f; - } - else - { - dust.velocity *= 0.95f; - dust.scale -= 1f / 400f; - } - if (WorldGen.SolidTile(Framing.GetTileSafely(dust.position)) && (double) dust.fadeIn == 0.0 && !dust.noGravity) - { - dust.scale *= 0.9f; - dust.velocity *= 0.25f; - } - } else if (dust.type >= 219 && dust.type <= 223) { - float num114 = dust.scale; - if ((double) num114 > 1.0) - num114 = 1f; + float num127 = dust.scale; + if ((double) num127 > 1.0) + num127 = 1f; if (!dust.noLight) { if (dust.type == 219) - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num114 * 1f, num114 * 0.5f, num114 * 0.4f); + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num127 * 1f, num127 * 0.5f, num127 * 0.4f); if (dust.type == 220) - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num114 * 0.4f, num114 * 1f, num114 * 0.6f); + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num127 * 0.4f, num127 * 1f, num127 * 0.6f); if (dust.type == 221) - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num114 * 0.3f, num114 * 0.5f, num114 * 1f); + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num127 * 0.3f, num127 * 0.5f, num127 * 1f); if (dust.type == 222) - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num114 * 0.9f, num114 * 0.9f, num114 * 0.3f); + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num127 * 0.9f, num127 * 0.9f, num127 * 0.3f); } if (dust.noGravity) { @@ -1708,11 +1627,11 @@ namespace Terraria } else if (dust.type == 226) { - float num115 = dust.scale; - if ((double) num115 > 1.0) - num115 = 1f; + float num128 = dust.scale; + if ((double) num128 > 1.0) + num128 = 1f; if (!dust.noLight) - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num115 * 0.2f, num115 * 0.7f, num115 * 1f); + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num128 * 0.2f, num128 * 0.7f, num128 * 1f); if (dust.noGravity) { dust.velocity *= 0.93f; @@ -1729,11 +1648,11 @@ namespace Terraria } else if (dust.type == 272) { - float num116 = dust.scale; - if ((double) num116 > 1.0) - num116 = 1f; + float num129 = dust.scale; + if ((double) num129 > 1.0) + num129 = 1f; if (!dust.noLight) - Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num116 * 0.5f, num116 * 0.2f, num116 * 0.8f); + Lighting.AddLight((int) ((double) dust.position.X / 16.0), (int) ((double) dust.position.Y / 16.0), num129 * 0.5f, num129 * 0.2f, num129 * 0.8f); if (dust.noGravity) { dust.velocity *= 0.93f; @@ -1761,7 +1680,7 @@ namespace Terraria } if ((double) dust.position.Y > (double) Main.screenPosition.Y + (double) Main.screenHeight) dust.active = false; - float num117 = 0.1f; + float num130 = 0.1f; if ((double) Dust.dCount == 0.5) dust.scale -= 1f / 1000f; if ((double) Dust.dCount == 0.6) @@ -1773,32 +1692,32 @@ namespace Terraria if ((double) Dust.dCount == 0.9) dust.scale -= 0.02f; if ((double) Dust.dCount == 0.5) - num117 = 0.11f; + num130 = 0.11f; if ((double) Dust.dCount == 0.6) - num117 = 0.13f; + num130 = 0.13f; if ((double) Dust.dCount == 0.7) - num117 = 0.16f; + num130 = 0.16f; if ((double) Dust.dCount == 0.8) - num117 = 0.22f; + num130 = 0.22f; if ((double) Dust.dCount == 0.9) - num117 = 0.25f; - if ((double) dust.scale < (double) num117) + num130 = 0.25f; + if ((double) dust.scale < (double) num130) dust.active = false; } } else dust.active = false; } - int num118 = num1; - if ((double) num118 > (double) Main.maxDustToDraw * 0.9) + int num131 = num1; + if ((double) num131 > (double) Main.maxDustToDraw * 0.9) Dust.dCount = 0.9f; - else if ((double) num118 > (double) Main.maxDustToDraw * 0.8) + else if ((double) num131 > (double) Main.maxDustToDraw * 0.8) Dust.dCount = 0.8f; - else if ((double) num118 > (double) Main.maxDustToDraw * 0.7) + else if ((double) num131 > (double) Main.maxDustToDraw * 0.7) Dust.dCount = 0.7f; - else if ((double) num118 > (double) Main.maxDustToDraw * 0.6) + else if ((double) num131 > (double) Main.maxDustToDraw * 0.6) Dust.dCount = 0.6f; - else if ((double) num118 > (double) Main.maxDustToDraw * 0.5) + else if ((double) num131 > (double) Main.maxDustToDraw * 0.5) Dust.dCount = 0.5f; else Dust.dCount = 0.0f; @@ -1807,190 +1726,146 @@ namespace Terraria public Color GetAlpha(Color newColor) { float num1 = (float) ((int) byte.MaxValue - this.alpha) / (float) byte.MaxValue; - switch (this.type) + if (this.type == 259) + return new Color(230, 230, 230, 230); + if (this.type == 261) + return new Color(230, 230, 230, 115); + if (this.type == 254 || this.type == (int) byte.MaxValue) + return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); + if (this.type == 258) + return new Color(150, 50, 50, 0); + if (this.type == 263 || this.type == 264) + return new Color((int) this.color.R / 2 + (int) sbyte.MaxValue, (int) this.color.G + (int) sbyte.MaxValue, (int) this.color.B + (int) sbyte.MaxValue, (int) this.color.A / 8) * 0.5f; + if (this.type == 235) + return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); + if ((this.type >= 86 && this.type <= 91 || this.type == 262) && !this.noLight) + return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); + if (this.type == 213 || this.type == 260) { - case 299: - case 300: - case 301: - Color color = new Color(); - switch (this.type) - { - case 299: - color = new Color(50, (int) byte.MaxValue, 50, 200); - break; - case 300: - color = new Color(50, 200, (int) byte.MaxValue, (int) byte.MaxValue); - break; - case 301: - color = new Color((int) byte.MaxValue, 50, 125, 200); - break; - default: - color = new Color((int) byte.MaxValue, 150, 150, 200); - break; - } - return color; - default: - if (this.type == 292) - return Color.White; - if (this.type == 259) - return new Color(230, 230, 230, 230); - if (this.type == 261) - return new Color(230, 230, 230, 115); - if (this.type == 254 || this.type == (int) byte.MaxValue) - return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); - if (this.type == 258) - return new Color(150, 50, 50, 0); - if (this.type == 263 || this.type == 264) - return new Color((int) this.color.R / 2 + (int) sbyte.MaxValue, (int) this.color.G + (int) sbyte.MaxValue, (int) this.color.B + (int) sbyte.MaxValue, (int) this.color.A / 8) * 0.5f; - if (this.type == 235) - return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); - if ((this.type >= 86 && this.type <= 91 || this.type == 262 || this.type == 286) && !this.noLight) - return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); - if (this.type == 213 || this.type == 260) - { - int num2 = (int) ((double) this.scale / 2.5 * (double) byte.MaxValue); - return new Color(num2, num2, num2, num2); - } - if (this.type == 64 && this.alpha == (int) byte.MaxValue && this.noLight) - return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); - if (this.type == 197) - return new Color(250, 250, 250, 150); - if (this.type >= 110 && this.type <= 114) - return new Color(200, 200, 200, 0); - if (this.type == 204) - return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); - if (this.type == 181) - return new Color(200, 200, 200, 0); - if (this.type == 182 || this.type == 206) - return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); - if (this.type == 159) - return new Color(250, 250, 250, 50); - if (this.type == 163 || this.type == 205) - return new Color(250, 250, 250, 0); - if (this.type == 170) - return new Color(200, 200, 200, 100); - if (this.type == 180) - return new Color(200, 200, 200, 0); - if (this.type == 175) - return new Color(200, 200, 200, 0); - if (this.type == 183) - return new Color(50, 0, 0, 0); - if (this.type == 172) - return new Color(250, 250, 250, 150); - if (this.type == 160 || this.type == 162 || this.type == 164 || this.type == 173) - { - int num3 = (int) (250.0 * (double) this.scale); - return new Color(num3, num3, num3, 0); - } - if (this.type == 92 || this.type == 106 || this.type == 107) - return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); - if (this.type == 185) - return new Color(200, 200, (int) byte.MaxValue, 125); - if (this.type == (int) sbyte.MaxValue || this.type == 187) - return new Color((int) newColor.R, (int) newColor.G, (int) newColor.B, 25); - if (this.type == 156 || this.type == 230 || this.type == 234) - return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); - if (this.type == 270) - return new Color((int) newColor.R / 2 + (int) sbyte.MaxValue, (int) newColor.G / 2 + (int) sbyte.MaxValue, (int) newColor.B / 2 + (int) sbyte.MaxValue, 25); - if (this.type == 271) - return new Color((int) newColor.R / 2 + (int) sbyte.MaxValue, (int) newColor.G / 2 + (int) sbyte.MaxValue, (int) newColor.B / 2 + (int) sbyte.MaxValue, (int) sbyte.MaxValue); - if (this.type == 6 || this.type == 242 || this.type == 174 || this.type == 135 || this.type == 75 || this.type == 20 || this.type == 21 || this.type == 231 || this.type == 169 || this.type >= 130 && this.type <= 134 || this.type == 158 || this.type == 293 || this.type == 294 || this.type == 295 || this.type == 296 || this.type == 297 || this.type == 298) - return new Color((int) newColor.R, (int) newColor.G, (int) newColor.B, 25); - if (this.type == 278) - return new Color(newColor.ToVector3() * this.color.ToVector3()) - { - A = 25 - }; - if (this.type >= 219 && this.type <= 223) - { - newColor = Color.Lerp(newColor, Color.White, 0.5f); - return new Color((int) newColor.R, (int) newColor.G, (int) newColor.B, 25); - } - if (this.type == 226 || this.type == 272) - { - newColor = Color.Lerp(newColor, Color.White, 0.8f); - return new Color((int) newColor.R, (int) newColor.G, (int) newColor.B, 25); - } - if (this.type == 228) - { - newColor = Color.Lerp(newColor, Color.White, 0.8f); - return new Color((int) newColor.R, (int) newColor.G, (int) newColor.B, 25); - } - if (this.type == 279) - { - int a = (int) newColor.A; - newColor = Color.Lerp(newColor, Color.White, 0.8f); - return new Color((int) newColor.R, (int) newColor.G, (int) newColor.B, a) * MathHelper.Min(this.scale, 1f); - } - if (this.type == 229 || this.type == 269) - { - newColor = Color.Lerp(newColor, Color.White, 0.6f); - return new Color((int) newColor.R, (int) newColor.G, (int) newColor.B, 25); - } - if ((this.type == 68 || this.type == 70) && this.noGravity) - return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); - if (this.type == 157) - { - int maxValue; - int num4 = maxValue = (int) byte.MaxValue; - int num5 = maxValue; - int num6 = maxValue; - float num7 = (float) ((double) Main.mouseTextColor / 100.0 - 1.60000002384186); - int num8 = (int) ((double) num6 * (double) num7); - int num9 = (int) ((double) num5 * (double) num7); - int num10 = (int) ((double) num4 * (double) num7); - int a = (int) (100.0 * (double) num7); - int r = num8 + 50; - if (r > (int) byte.MaxValue) - r = (int) byte.MaxValue; - int g = num9 + 50; - if (g > (int) byte.MaxValue) - g = (int) byte.MaxValue; - int b = num10 + 50; - if (b > (int) byte.MaxValue) - b = (int) byte.MaxValue; - return new Color(r, g, b, a); - } - if (this.type == 284) - return new Color(newColor.ToVector4() * this.color.ToVector4()) - { - A = this.color.A - }; - if (this.type == 15 || this.type == 274 || this.type == 20 || this.type == 21 || this.type == 29 || this.type == 35 || this.type == 41 || this.type == 44 || this.type == 27 || this.type == 45 || this.type == 55 || this.type == 56 || this.type == 57 || this.type == 58 || this.type == 73 || this.type == 74) - num1 = (float) (((double) num1 + 3.0) / 4.0); - else if (this.type == 43) - { - num1 = (float) (((double) num1 + 9.0) / 10.0); - } - else - { - if (this.type >= 244 && this.type <= 247) - return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); - if (this.type == 66) - return new Color((int) newColor.R, (int) newColor.G, (int) newColor.B, 0); - if (this.type == 267) - return new Color((int) this.color.R, (int) this.color.G, (int) this.color.B, 0); - if (this.type == 71) - return new Color(200, 200, 200, 0); - if (this.type == 72) - return new Color(200, 200, 200, 200); - } - int r1 = (int) ((double) newColor.R * (double) num1); - int g1 = (int) ((double) newColor.G * (double) num1); - int b1 = (int) ((double) newColor.B * (double) num1); - int a1 = (int) newColor.A - this.alpha; - if (a1 < 0) - a1 = 0; - if (a1 > (int) byte.MaxValue) - a1 = (int) byte.MaxValue; - return new Color(r1, g1, b1, a1); + int num2 = (int) ((double) this.scale / 2.5 * (double) byte.MaxValue); + return new Color(num2, num2, num2, num2); } + if (this.type == 64 && this.alpha == (int) byte.MaxValue && this.noLight) + return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); + if (this.type == 197) + return new Color(250, 250, 250, 150); + if (this.type >= 110 && this.type <= 114) + return new Color(200, 200, 200, 0); + if (this.type == 204) + return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); + if (this.type == 181) + return new Color(200, 200, 200, 0); + if (this.type == 182 || this.type == 206) + return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); + if (this.type == 159) + return new Color(250, 250, 250, 50); + if (this.type == 163 || this.type == 205) + return new Color(250, 250, 250, 0); + if (this.type == 170) + return new Color(200, 200, 200, 100); + if (this.type == 180) + return new Color(200, 200, 200, 0); + if (this.type == 175) + return new Color(200, 200, 200, 0); + if (this.type == 183) + return new Color(50, 0, 0, 0); + if (this.type == 172) + return new Color(250, 250, 250, 150); + if (this.type == 160 || this.type == 162 || this.type == 164 || this.type == 173) + { + int num3 = (int) (250.0 * (double) this.scale); + return new Color(num3, num3, num3, 0); + } + if (this.type == 92 || this.type == 106 || this.type == 107) + return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); + if (this.type == 185) + return new Color(200, 200, (int) byte.MaxValue, 125); + if (this.type == (int) sbyte.MaxValue || this.type == 187) + return new Color((int) newColor.R, (int) newColor.G, (int) newColor.B, 25); + if (this.type == 156 || this.type == 230 || this.type == 234) + return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); + if (this.type == 270) + return new Color((int) newColor.R / 2 + (int) sbyte.MaxValue, (int) newColor.G / 2 + (int) sbyte.MaxValue, (int) newColor.B / 2 + (int) sbyte.MaxValue, 25); + if (this.type == 271) + return new Color((int) newColor.R / 2 + (int) sbyte.MaxValue, (int) newColor.G / 2 + (int) sbyte.MaxValue, (int) newColor.B / 2 + (int) sbyte.MaxValue, (int) sbyte.MaxValue); + if (this.type == 6 || this.type == 242 || this.type == 174 || this.type == 135 || this.type == 75 || this.type == 20 || this.type == 21 || this.type == 231 || this.type == 169 || this.type >= 130 && this.type <= 134 || this.type == 158) + return new Color((int) newColor.R, (int) newColor.G, (int) newColor.B, 25); + if (this.type >= 219 && this.type <= 223) + { + newColor = Color.Lerp(newColor, Color.White, 0.5f); + return new Color((int) newColor.R, (int) newColor.G, (int) newColor.B, 25); + } + if (this.type == 226 || this.type == 272) + { + newColor = Color.Lerp(newColor, Color.White, 0.8f); + return new Color((int) newColor.R, (int) newColor.G, (int) newColor.B, 25); + } + if (this.type == 228) + { + newColor = Color.Lerp(newColor, Color.White, 0.8f); + return new Color((int) newColor.R, (int) newColor.G, (int) newColor.B, 25); + } + if (this.type == 229 || this.type == 269) + { + newColor = Color.Lerp(newColor, Color.White, 0.6f); + return new Color((int) newColor.R, (int) newColor.G, (int) newColor.B, 25); + } + if ((this.type == 68 || this.type == 70) && this.noGravity) + return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); + if (this.type == 157) + { + int maxValue; + int num4 = maxValue = (int) byte.MaxValue; + int num5 = maxValue; + int num6 = maxValue; + float num7 = (float) ((double) Main.mouseTextColor / 100.0 - 1.60000002384186); + int num8 = (int) ((double) num6 * (double) num7); + int num9 = (int) ((double) num5 * (double) num7); + int num10 = (int) ((double) num4 * (double) num7); + int a = (int) (100.0 * (double) num7); + int r = num8 + 50; + if (r > (int) byte.MaxValue) + r = (int) byte.MaxValue; + int g = num9 + 50; + if (g > (int) byte.MaxValue) + g = (int) byte.MaxValue; + int b = num10 + 50; + if (b > (int) byte.MaxValue) + b = (int) byte.MaxValue; + return new Color(r, g, b, a); + } + if (this.type == 15 || this.type == 274 || this.type == 20 || this.type == 21 || this.type == 29 || this.type == 35 || this.type == 41 || this.type == 44 || this.type == 27 || this.type == 45 || this.type == 55 || this.type == 56 || this.type == 57 || this.type == 58 || this.type == 73 || this.type == 74) + num1 = (float) (((double) num1 + 3.0) / 4.0); + else if (this.type == 43) + { + num1 = (float) (((double) num1 + 9.0) / 10.0); + } + else + { + if (this.type >= 244 && this.type <= 247) + return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); + if (this.type == 66) + return new Color((int) newColor.R, (int) newColor.G, (int) newColor.B, 0); + if (this.type == 267) + return new Color((int) this.color.R, (int) this.color.G, (int) this.color.B, 0); + if (this.type == 71) + return new Color(200, 200, 200, 0); + if (this.type == 72) + return new Color(200, 200, 200, 200); + } + int r1 = (int) ((double) newColor.R * (double) num1); + int g1 = (int) ((double) newColor.G * (double) num1); + int b1 = (int) ((double) newColor.B * (double) num1); + int a1 = (int) newColor.A - this.alpha; + if (a1 < 0) + a1 = 0; + if (a1 > (int) byte.MaxValue) + a1 = (int) byte.MaxValue; + return new Color(r1, g1, b1, a1); } public Color GetColor(Color newColor) { - if (this.type == 284) - return Color.Transparent; int r = (int) this.color.R - ((int) byte.MaxValue - (int) newColor.R); int g = (int) this.color.G - ((int) byte.MaxValue - (int) newColor.G); int b = (int) this.color.B - ((int) byte.MaxValue - (int) newColor.B); diff --git a/Entity.cs b/Entity.cs index 3843ce1..05bf322 100644 --- a/Entity.cs +++ b/Entity.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Entity -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -26,8 +26,6 @@ namespace Terraria public byte wetCount; public bool lavaWet; - public virtual Vector2 VisualPosition => this.position; - public float AngleTo(Vector2 Destination) => (float) Math.Atan2((double) Destination.Y - (double) this.Center.Y, (double) Destination.X - (double) this.Center.X); public float AngleFrom(Vector2 Source) => (float) Math.Atan2((double) this.Center.Y - (double) Source.Y, (double) this.Center.X - (double) Source.X); diff --git a/Enums/AnchorType.cs b/Enums/AnchorType.cs index 1aad707..2698847 100644 --- a/Enums/AnchorType.cs +++ b/Enums/AnchorType.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Enums.AnchorType -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; diff --git a/Enums/ItemRarityColor.cs b/Enums/ItemRarityColor.cs deleted file mode 100644 index 9509a41..0000000 --- a/Enums/ItemRarityColor.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Enums.ItemRarityColor -// 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.Enums -{ - public enum ItemRarityColor - { - AmberMinus11 = -11, // 0xFFFFFFF5 - TrashMinus1 = -1, // 0xFFFFFFFF - White0 = 0, - Blue1 = 1, - Green2 = 2, - Orange3 = 3, - LightRed4 = 4, - Pink5 = 5, - LightPurple6 = 6, - Lime7 = 7, - Yellow8 = 8, - Cyan9 = 9, - StrongRed10 = 10, // 0x0000000A - Purple11 = 11, // 0x0000000B - } -} diff --git a/Enums/LiquidPlacement.cs b/Enums/LiquidPlacement.cs index fe360d4..c54a4de 100644 --- a/Enums/LiquidPlacement.cs +++ b/Enums/LiquidPlacement.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Enums.LiquidPlacement -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Enums diff --git a/Enums/MoonPhase.cs b/Enums/MoonPhase.cs deleted file mode 100644 index f3ad037..0000000 --- a/Enums/MoonPhase.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Enums.MoonPhase -// 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.Enums -{ - public enum MoonPhase - { - Full, - ThreeQuartersAtLeft, - HalfAtLeft, - QuarterAtLeft, - Empty, - QuarterAtRight, - HalfAtRight, - ThreeQuartersAtRight, - } -} diff --git a/Enums/NPCTargetType.cs b/Enums/NPCTargetType.cs index 9277e57..a1e0634 100644 --- a/Enums/NPCTargetType.cs +++ b/Enums/NPCTargetType.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Enums.NPCTargetType -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Enums diff --git a/Enums/TileCuttingContext.cs b/Enums/TileCuttingContext.cs index 6219cd7..d7ea431 100644 --- a/Enums/TileCuttingContext.cs +++ b/Enums/TileCuttingContext.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Enums.TileCuttingContext -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Enums diff --git a/Enums/TileIDEnum.cs b/Enums/TileIDEnum.cs index 290fd75..45ac574 100644 --- a/Enums/TileIDEnum.cs +++ b/Enums/TileIDEnum.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Enums.TileIDEnum -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Enums @@ -207,7 +207,7 @@ namespace Terraria.Enums RainCloud, FrozenSlimeBlock, Asphalt, - CrimsonGrass, + FleshGrass, RedIce, FleshWeeds, Sunplate, diff --git a/Enums/TileObjectDirection.cs b/Enums/TileObjectDirection.cs index da1a40d..615f2f5 100644 --- a/Enums/TileObjectDirection.cs +++ b/Enums/TileObjectDirection.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Enums.TileObjectDirection -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Enums diff --git a/Enums/TileScanGroup.cs b/Enums/TileScanGroup.cs index 72e9d21..a68f1f7 100644 --- a/Enums/TileScanGroup.cs +++ b/Enums/TileScanGroup.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Enums.TileScanGroup -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Enums diff --git a/Enums/TownNPCRoomCheckFailureReason.cs b/Enums/TownNPCRoomCheckFailureReason.cs index ccc4eb2..a7bca5c 100644 --- a/Enums/TownNPCRoomCheckFailureReason.cs +++ b/Enums/TownNPCRoomCheckFailureReason.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Enums.TownNPCRoomCheckFailureReason -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Enums diff --git a/Enums/TownNPCSpawnResult.cs b/Enums/TownNPCSpawnResult.cs index 6968b91..36a81e9 100644 --- a/Enums/TownNPCSpawnResult.cs +++ b/Enums/TownNPCSpawnResult.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Enums.TownNPCSpawnResult -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Enums diff --git a/Enums/TreeTypes.cs b/Enums/TreeTypes.cs deleted file mode 100644 index 88363bb..0000000 --- a/Enums/TreeTypes.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Enums.TreeTypes -// 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.Enums -{ - public enum TreeTypes - { - None, - Forest, - Corrupt, - Mushroom, - Crimson, - Jungle, - Snow, - Hallowed, - Palm, - PalmCrimson, - PalmCorrupt, - PalmHallowed, - } -} diff --git a/Extensions/EnumerationExtensions.cs b/Extensions/EnumerationExtensions.cs index 8bfbe8d..133e06c 100644 --- a/Extensions/EnumerationExtensions.cs +++ b/Extensions/EnumerationExtensions.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Extensions.EnumerationExtensions -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; diff --git a/FrameSkipTest.cs b/FrameSkipTest.cs index 60280fa..1840738 100644 --- a/FrameSkipTest.cs +++ b/FrameSkipTest.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.FrameSkipTest -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -14,8 +14,8 @@ namespace Terraria public class FrameSkipTest { private static int LastRecordedSecondNumber; - private static float CallsThisSecond; - private static float DeltasThisSecond; + private static float CallsThisSecond = 0.0f; + private static float DeltasThisSecond = 0.0f; private static List DeltaSamples = new List(); private const int SamplesCount = 5; private static MultiTimer serverFramerateTest = new MultiTimer(60); diff --git a/Framing.cs b/Framing.cs index f6cd730..ecd35e0 100644 --- a/Framing.cs +++ b/Framing.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Framing -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -113,7 +113,7 @@ namespace Terraria Framing.AddWallFrameLookup(11, (short) 4, (short) 0, (short) 4, (short) 1, (short) 4, (short) 2, (short) 4, (short) 5); Framing.AddWallFrameLookup(12, (short) 0, (short) 3, (short) 2, (short) 3, (short) 4, (short) 3, (short) 0, (short) 6); Framing.AddWallFrameLookup(13, (short) 0, (short) 0, (short) 0, (short) 1, (short) 0, (short) 2, (short) 0, (short) 5); - Framing.AddWallFrameLookup(14, (short) 1, (short) 0, (short) 2, (short) 0, (short) 3, (short) 0, (short) 1, (short) 5); + Framing.AddWallFrameLookup(14, (short) 1, (short) 0, (short) 2, (short) 0, (short) 3, (short) 0, (short) 1, (short) 6); Framing.AddWallFrameLookup(15, (short) 1, (short) 1, (short) 2, (short) 1, (short) 3, (short) 1, (short) 2, (short) 5); Framing.AddWallFrameLookup(16, (short) 6, (short) 1, (short) 7, (short) 1, (short) 8, (short) 1, (short) 7, (short) 5); Framing.AddWallFrameLookup(17, (short) 6, (short) 2, (short) 7, (short) 2, (short) 8, (short) 2, (short) 8, (short) 5); @@ -173,19 +173,22 @@ namespace Terraria Framing.wallFrameLookup[lookup] = point16Array; } - private static bool WillItBlend(ushort myType, ushort otherType) => TileID.Sets.ForcedDirtMerging[(int) myType] && otherType == (ushort) 0 || Main.tileBrick[(int) myType] && Main.tileBrick[(int) otherType] || (int) TileID.Sets.GemsparkFramingTypes[(int) otherType] == (int) TileID.Sets.GemsparkFramingTypes[(int) myType]; + public static void SelfFrame4Way() + { + } public static void SelfFrame8Way(int i, int j, Tile centerTile, bool resetFrame) { if (!centerTile.active()) return; + ushort gemsparkFramingType = TileID.Sets.GemsparkFramingTypes[(int) centerTile.type]; Framing.BlockStyle blockStyle1 = Framing.FindBlockStyle(centerTile); int index = 0; Framing.BlockStyle blockStyle2 = new Framing.BlockStyle(); if (blockStyle1.top) { Tile tileSafely = Framing.GetTileSafely(i, j - 1); - if (tileSafely.active() && Framing.WillItBlend(centerTile.type, tileSafely.type)) + if (tileSafely.active() && (int) TileID.Sets.GemsparkFramingTypes[(int) tileSafely.type] == (int) gemsparkFramingType) { blockStyle2 = Framing.FindBlockStyle(tileSafely); if (blockStyle2.bottom) @@ -198,7 +201,7 @@ namespace Terraria if (blockStyle1.left) { Tile tileSafely = Framing.GetTileSafely(i - 1, j); - if (tileSafely.active() && Framing.WillItBlend(centerTile.type, tileSafely.type)) + if (tileSafely.active() && (int) TileID.Sets.GemsparkFramingTypes[(int) tileSafely.type] == (int) gemsparkFramingType) { blockStyle3 = Framing.FindBlockStyle(tileSafely); if (blockStyle3.right) @@ -211,7 +214,7 @@ namespace Terraria if (blockStyle1.right) { Tile tileSafely = Framing.GetTileSafely(i + 1, j); - if (tileSafely.active() && Framing.WillItBlend(centerTile.type, tileSafely.type)) + if (tileSafely.active() && (int) TileID.Sets.GemsparkFramingTypes[(int) tileSafely.type] == (int) gemsparkFramingType) { blockStyle4 = Framing.FindBlockStyle(tileSafely); if (blockStyle4.left) @@ -224,7 +227,7 @@ namespace Terraria if (blockStyle1.bottom) { Tile tileSafely = Framing.GetTileSafely(i, j + 1); - if (tileSafely.active() && Framing.WillItBlend(centerTile.type, tileSafely.type)) + if (tileSafely.active() && (int) TileID.Sets.GemsparkFramingTypes[(int) tileSafely.type] == (int) gemsparkFramingType) { blockStyle5 = Framing.FindBlockStyle(tileSafely); if (blockStyle5.top) @@ -236,7 +239,7 @@ namespace Terraria if (blockStyle2.left && blockStyle3.top) { Tile tileSafely = Framing.GetTileSafely(i - 1, j - 1); - if (tileSafely.active() && Framing.WillItBlend(centerTile.type, tileSafely.type)) + if (tileSafely.active() && (int) TileID.Sets.GemsparkFramingTypes[(int) tileSafely.type] == (int) gemsparkFramingType) { Framing.BlockStyle blockStyle6 = Framing.FindBlockStyle(tileSafely); if (blockStyle6.right && blockStyle6.bottom) @@ -246,7 +249,7 @@ namespace Terraria if (blockStyle2.right && blockStyle4.top) { Tile tileSafely = Framing.GetTileSafely(i + 1, j - 1); - if (tileSafely.active() && Framing.WillItBlend(centerTile.type, tileSafely.type)) + if (tileSafely.active() && (int) TileID.Sets.GemsparkFramingTypes[(int) tileSafely.type] == (int) gemsparkFramingType) { Framing.BlockStyle blockStyle7 = Framing.FindBlockStyle(tileSafely); if (blockStyle7.left && blockStyle7.bottom) @@ -256,7 +259,7 @@ namespace Terraria if (blockStyle5.left && blockStyle3.bottom) { Tile tileSafely = Framing.GetTileSafely(i - 1, j + 1); - if (tileSafely.active() && Framing.WillItBlend(centerTile.type, tileSafely.type)) + if (tileSafely.active() && (int) TileID.Sets.GemsparkFramingTypes[(int) tileSafely.type] == (int) gemsparkFramingType) { Framing.BlockStyle blockStyle8 = Framing.FindBlockStyle(tileSafely); if (blockStyle8.right && blockStyle8.top) @@ -266,7 +269,7 @@ namespace Terraria if (blockStyle5.right && blockStyle4.bottom) { Tile tileSafely = Framing.GetTileSafely(i + 1, j + 1); - if (tileSafely.active() && Framing.WillItBlend(centerTile.type, tileSafely.type)) + if (tileSafely.active() && (int) TileID.Sets.GemsparkFramingTypes[(int) tileSafely.type] == (int) gemsparkFramingType) { Framing.BlockStyle blockStyle9 = Framing.FindBlockStyle(tileSafely); if (blockStyle9.left && blockStyle9.top) @@ -282,43 +285,29 @@ namespace Terraria public static void WallFrame(int i, int j, bool resetFrame = false) { - if (WorldGen.SkipFramingBecauseOfGen || i <= 0 || j <= 0 || i >= Main.maxTilesX - 1 || j >= Main.maxTilesY - 1 || Main.tile[i, j] == null) + if (i <= 0 || j <= 0 || i >= Main.maxTilesX - 1 || j >= Main.maxTilesY - 1 || Main.tile[i, j] == null) return; - if (Main.tile[i, j].wall >= (ushort) 316) - Main.tile[i, j].wall = (ushort) 0; WorldGen.UpdateMapTile(i, j); Tile tile1 = Main.tile[i, j]; - if (tile1.wall == (ushort) 0) + if (tile1.wall == (byte) 0) { tile1.wallColor((byte) 0); } else { int index1 = 0; - if (j - 1 >= 0) - { - Tile tile2 = Main.tile[i, j - 1]; - if (tile2 != null && (tile2.wall > (ushort) 0 || tile2.active() && tile2.type == (ushort) 54)) - index1 = 1; - } - if (i - 1 >= 0) - { - Tile tile3 = Main.tile[i - 1, j]; - if (tile3 != null && (tile3.wall > (ushort) 0 || tile3.active() && tile3.type == (ushort) 54)) - index1 |= 2; - } - if (i + 1 <= Main.maxTilesX - 1) - { - Tile tile4 = Main.tile[i + 1, j]; - if (tile4 != null && (tile4.wall > (ushort) 0 || tile4.active() && tile4.type == (ushort) 54)) - index1 |= 4; - } - if (j + 1 <= Main.maxTilesY - 1) - { - Tile tile5 = Main.tile[i, j + 1]; - if (tile5 != null && (tile5.wall > (ushort) 0 || tile5.active() && tile5.type == (ushort) 54)) - index1 |= 8; - } + Tile tile2 = Main.tile[i, j - 1]; + if (tile2 != null && (tile2.wall > (byte) 0 || tile2.active() && tile2.type == (ushort) 54)) + index1 = 1; + Tile tile3 = Main.tile[i - 1, j]; + if (tile3 != null && (tile3.wall > (byte) 0 || tile3.active() && tile3.type == (ushort) 54)) + index1 |= 2; + Tile tile4 = Main.tile[i + 1, j]; + if (tile4 != null && (tile4.wall > (byte) 0 || tile4.active() && tile4.type == (ushort) 54)) + index1 |= 4; + Tile tile5 = Main.tile[i, j + 1]; + if (tile5 != null && (tile5.wall > (byte) 0 || tile5.active() && tile5.type == (ushort) 54)) + index1 |= 8; int index2; if (Main.wallLargeFrames[(int) tile1.wall] == (byte) 1) { @@ -333,8 +322,6 @@ namespace Terraria else if (resetFrame) { index2 = WorldGen.genRand.Next(0, 3); - if (tile1.wall == (ushort) 21 && WorldGen.genRand.Next(2) == 0) - index2 = 2; tile1.wallFrameNumber((byte) index2); } else @@ -359,8 +346,6 @@ namespace Terraria public static Tile GetTileSafely(int i, int j) { - if (!WorldGen.InWorld(i, j)) - return new Tile(); Tile tile = Main.tile[i, j]; if (tile == null) { diff --git a/GameContent/ARenderTargetContentByRequest.cs b/GameContent/ARenderTargetContentByRequest.cs deleted file mode 100644 index 50dd23c..0000000 --- a/GameContent/ARenderTargetContentByRequest.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ARenderTargetContentByRequest -// 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.Graphics; -using System; - -namespace Terraria.GameContent -{ - public abstract class ARenderTargetContentByRequest : INeedRenderTargetContent - { - protected RenderTarget2D _target; - protected bool _wasPrepared; - private bool _wasRequested; - - public bool IsReady => this._wasPrepared; - - public void Request() => this._wasRequested = true; - - public RenderTarget2D GetTarget() => this._target; - - public void PrepareRenderTarget(GraphicsDevice device, SpriteBatch spriteBatch) - { - this._wasPrepared = false; - if (!this._wasRequested) - return; - this._wasRequested = false; - this.HandleUseReqest(device, spriteBatch); - } - - protected abstract void HandleUseReqest(GraphicsDevice device, SpriteBatch spriteBatch); - - protected void PrepareARenderTarget_AndListenToEvents( - ref RenderTarget2D target, - GraphicsDevice device, - int neededWidth, - int neededHeight, - RenderTargetUsage usage) - { - if (target != null && !target.IsDisposed && target.Width == neededWidth && target.Height == neededHeight) - return; - if (target != null) - { - target.ContentLost -= new EventHandler(this.target_ContentLost); - target.Disposing -= new EventHandler(this.target_Disposing); - } - target = new RenderTarget2D(device, neededWidth, neededHeight, false, device.PresentationParameters.BackBufferFormat, DepthFormat.None, 0, usage); - target.ContentLost += new EventHandler(this.target_ContentLost); - target.Disposing += new EventHandler(this.target_Disposing); - } - - private void target_Disposing(object sender, EventArgs e) - { - this._wasPrepared = false; - this._target = (RenderTarget2D) null; - } - - private void target_ContentLost(object sender, EventArgs e) => this._wasPrepared = false; - - protected void PrepareARenderTarget_WithoutListeningToEvents( - ref RenderTarget2D target, - GraphicsDevice device, - int neededWidth, - int neededHeight, - RenderTargetUsage usage) - { - if (target != null && !target.IsDisposed && target.Width == neededWidth && target.Height == neededHeight) - return; - target = new RenderTarget2D(device, neededWidth, neededHeight, false, device.PresentationParameters.BackBufferFormat, DepthFormat.None, 0, usage); - } - } -} diff --git a/GameContent/Achievements/AchievementsHelper.cs b/GameContent/Achievements/AchievementsHelper.cs index 2d9e40e..69a4f36 100644 --- a/GameContent/Achievements/AchievementsHelper.cs +++ b/GameContent/Achievements/AchievementsHelper.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Achievements.AchievementsHelper -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; @@ -62,7 +62,7 @@ namespace Terraria.GameContent.Achievements public static void Initialize() => Player.Hooks.OnEnterWorld += new Action(AchievementsHelper.OnPlayerEnteredWorld); - internal static void OnPlayerEnteredWorld(Player player) + private static void OnPlayerEnteredWorld(Player player) { if (AchievementsHelper.OnItemPickup != null) { @@ -82,8 +82,6 @@ namespace Terraria.GameContent.Achievements AchievementsHelper.OnItemPickup(player, (short) player.bank2.item[index].type, player.bank2.item[index].stack); for (int index = 0; index < player.bank3.item.Length; ++index) AchievementsHelper.OnItemPickup(player, (short) player.bank3.item[index].type, player.bank3.item[index].stack); - for (int index = 0; index < player.bank4.item.Length; ++index) - AchievementsHelper.OnItemPickup(player, (short) player.bank4.item[index].type, player.bank4.item[index].stack); } if (player.statManaMax > 20) Main.Achievements.GetCondition("STAR_POWER", "Use").Complete(); @@ -106,9 +104,9 @@ namespace Terraria.GameContent.Achievements if (player.armor[10].stack > 0 && player.armor[11].stack > 0 && player.armor[12].stack > 0) Main.Achievements.GetCondition("FASHION_STATEMENT", "Equip").Complete(); bool flag = true; - for (int slot = 0; slot < 10; ++slot) + for (int index = 0; index < player.extraAccessorySlots + 3 + 5; ++index) { - if (player.IsAValidEquipmentSlotForIteration(slot) && (player.dye[slot].type < 1 || player.dye[slot].stack < 1)) + if (player.dye[index].type < 1 || player.dye[index].stack < 1) flag = false; } if (!flag) @@ -169,9 +167,9 @@ namespace Terraria.GameContent.Achievements Main.Achievements.GetCondition("FASHION_STATEMENT", "Equip").Complete(); if (context != 12) return; - for (int slot = 0; slot < 10; ++slot) + for (int index = 0; index < player.extraAccessorySlots + 3 + 5; ++index) { - if (player.IsAValidEquipmentSlotForIteration(slot) && (player.dye[slot].type < 1 || player.dye[slot].stack < 1)) + if (player.dye[index].type < 1 || player.dye[index].stack < 1) return; } for (int index = 0; index < player.miscDyes.Length; ++index) diff --git a/GameContent/Achievements/CustomFlagCondition.cs b/GameContent/Achievements/CustomFlagCondition.cs index 9c6cb5a..2fbc7a8 100644 --- a/GameContent/Achievements/CustomFlagCondition.cs +++ b/GameContent/Achievements/CustomFlagCondition.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Achievements.CustomFlagCondition -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Terraria.Achievements; diff --git a/GameContent/Achievements/CustomFloatCondition.cs b/GameContent/Achievements/CustomFloatCondition.cs index 766ff44..9bd5de0 100644 --- a/GameContent/Achievements/CustomFloatCondition.cs +++ b/GameContent/Achievements/CustomFloatCondition.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Achievements.CustomFloatCondition -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Newtonsoft.Json; @@ -56,13 +56,5 @@ namespace Terraria.GameContent.Achievements protected override IAchievementTracker CreateAchievementTracker() => (IAchievementTracker) new ConditionFloatTracker(this._maxValue); public static AchievementCondition Create(string name, float maxValue) => (AchievementCondition) new CustomFloatCondition(name, maxValue); - - public override void Complete() - { - if (this._tracker != null) - ((AchievementTracker) this._tracker).SetValue(this._maxValue); - this._value = this._maxValue; - base.Complete(); - } } } diff --git a/GameContent/Achievements/CustomIntCondition.cs b/GameContent/Achievements/CustomIntCondition.cs index 080e6b2..853e539 100644 --- a/GameContent/Achievements/CustomIntCondition.cs +++ b/GameContent/Achievements/CustomIntCondition.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Achievements.CustomIntCondition -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Newtonsoft.Json; @@ -56,13 +56,5 @@ namespace Terraria.GameContent.Achievements protected override IAchievementTracker CreateAchievementTracker() => (IAchievementTracker) new ConditionIntTracker(this._maxValue); public static AchievementCondition Create(string name, int maxValue) => (AchievementCondition) new CustomIntCondition(name, maxValue); - - public override void Complete() - { - if (this._tracker != null) - ((AchievementTracker) this._tracker).SetValue(this._maxValue); - this._value = this._maxValue; - base.Complete(); - } } } diff --git a/GameContent/Achievements/ItemCraftCondition.cs b/GameContent/Achievements/ItemCraftCondition.cs index 8c07989..fbd5940 100644 --- a/GameContent/Achievements/ItemCraftCondition.cs +++ b/GameContent/Achievements/ItemCraftCondition.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Achievements.ItemCraftCondition -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System.Collections.Generic; @@ -13,7 +13,7 @@ namespace Terraria.GameContent.Achievements { private const string Identifier = "ITEM_PICKUP"; private static Dictionary> _listeners = new Dictionary>(); - private static bool _isListenerHooked; + private static bool _isListenerHooked = false; private short[] _itemIds; private ItemCraftCondition(short itemId) diff --git a/GameContent/Achievements/ItemPickupCondition.cs b/GameContent/Achievements/ItemPickupCondition.cs index f99d9b8..7cfdad2 100644 --- a/GameContent/Achievements/ItemPickupCondition.cs +++ b/GameContent/Achievements/ItemPickupCondition.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Achievements.ItemPickupCondition -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System.Collections.Generic; @@ -13,7 +13,7 @@ namespace Terraria.GameContent.Achievements { private const string Identifier = "ITEM_PICKUP"; private static Dictionary> _listeners = new Dictionary>(); - private static bool _isListenerHooked; + private static bool _isListenerHooked = false; private short[] _itemIds; private ItemPickupCondition(short itemId) diff --git a/GameContent/Achievements/NPCKilledCondition.cs b/GameContent/Achievements/NPCKilledCondition.cs index 895c93d..8d810af 100644 --- a/GameContent/Achievements/NPCKilledCondition.cs +++ b/GameContent/Achievements/NPCKilledCondition.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Achievements.NPCKilledCondition -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System.Collections.Generic; @@ -13,7 +13,7 @@ namespace Terraria.GameContent.Achievements { private const string Identifier = "NPC_KILLED"; private static Dictionary> _listeners = new Dictionary>(); - private static bool _isListenerHooked; + private static bool _isListenerHooked = false; private short[] _npcIds; private NPCKilledCondition(short npcId) diff --git a/GameContent/Achievements/ProgressionEventCondition.cs b/GameContent/Achievements/ProgressionEventCondition.cs index b544728..49b717e 100644 --- a/GameContent/Achievements/ProgressionEventCondition.cs +++ b/GameContent/Achievements/ProgressionEventCondition.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Achievements.ProgressionEventCondition -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System.Collections.Generic; @@ -13,7 +13,7 @@ namespace Terraria.GameContent.Achievements { private const string Identifier = "PROGRESSION_EVENT"; private static Dictionary> _listeners = new Dictionary>(); - private static bool _isListenerHooked; + private static bool _isListenerHooked = false; private int[] _eventIDs; private ProgressionEventCondition(int eventID) diff --git a/GameContent/Achievements/TileDestroyedCondition.cs b/GameContent/Achievements/TileDestroyedCondition.cs index e7ae778..e1dced8 100644 --- a/GameContent/Achievements/TileDestroyedCondition.cs +++ b/GameContent/Achievements/TileDestroyedCondition.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Achievements.TileDestroyedCondition -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System.Collections.Generic; @@ -13,7 +13,7 @@ namespace Terraria.GameContent.Achievements { private const string Identifier = "TILE_DESTROYED"; private static Dictionary> _listeners = new Dictionary>(); - private static bool _isListenerHooked; + private static bool _isListenerHooked = false; private ushort[] _tileIds; private TileDestroyedCondition(ushort[] tileIds) diff --git a/GameContent/Ambience/AmbienceServer.cs b/GameContent/Ambience/AmbienceServer.cs deleted file mode 100644 index 89632b6..0000000 --- a/GameContent/Ambience/AmbienceServer.cs +++ /dev/null @@ -1,143 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Ambience.AmbienceServer -// 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.GameContent.NetModules; -using Terraria.Net; - -namespace Terraria.GameContent.Ambience -{ - public class AmbienceServer - { - private const int MINIMUM_SECONDS_BETWEEN_SPAWNS = 10; - private const int MAXIMUM_SECONDS_BETWEEN_SPAWNS = 120; - private readonly Dictionary> _spawnConditions = new Dictionary>(); - private readonly Dictionary> _secondarySpawnConditionsPerPlayer = new Dictionary>(); - private int _updatesUntilNextAttempt; - private List _forcedSpawns = new List(); - - private static bool IsSunnyDay() => !Main.IsItRaining && Main.dayTime && !Main.eclipse; - - private static bool IsSunset() => Main.dayTime && Main.time > 40500.0; - - private static bool IsCalmNight() => !Main.IsItRaining && !Main.dayTime && !Main.bloodMoon && !Main.pumpkinMoon && !Main.snowMoon; - - public AmbienceServer() - { - this.ResetSpawnTime(); - this._spawnConditions[SkyEntityType.BirdsV] = new Func(AmbienceServer.IsSunnyDay); - this._spawnConditions[SkyEntityType.Wyvern] = (Func) (() => AmbienceServer.IsSunnyDay() && Main.hardMode); - this._spawnConditions[SkyEntityType.Airship] = (Func) (() => AmbienceServer.IsSunnyDay() && Main.IsItAHappyWindyDay); - this._spawnConditions[SkyEntityType.AirBalloon] = (Func) (() => AmbienceServer.IsSunnyDay() && !Main.IsItAHappyWindyDay); - this._spawnConditions[SkyEntityType.Eyeball] = (Func) (() => !Main.dayTime); - this._spawnConditions[SkyEntityType.Butterflies] = (Func) (() => AmbienceServer.IsSunnyDay() && !Main.IsItAHappyWindyDay && !NPC.TooWindyForButterflies && NPC.butterflyChance < 6); - this._spawnConditions[SkyEntityType.LostKite] = (Func) (() => Main.dayTime && !Main.eclipse && Main.IsItAHappyWindyDay); - this._spawnConditions[SkyEntityType.Vulture] = (Func) (() => AmbienceServer.IsSunnyDay()); - this._spawnConditions[SkyEntityType.Bats] = (Func) (() => AmbienceServer.IsSunset() && AmbienceServer.IsSunnyDay() || AmbienceServer.IsCalmNight()); - this._spawnConditions[SkyEntityType.PixiePosse] = (Func) (() => AmbienceServer.IsSunnyDay() || AmbienceServer.IsCalmNight()); - this._spawnConditions[SkyEntityType.Seagulls] = (Func) (() => AmbienceServer.IsSunnyDay()); - this._spawnConditions[SkyEntityType.SlimeBalloons] = (Func) (() => AmbienceServer.IsSunnyDay() && Main.IsItAHappyWindyDay); - this._spawnConditions[SkyEntityType.Gastropods] = (Func) (() => AmbienceServer.IsCalmNight()); - this._spawnConditions[SkyEntityType.Pegasus] = (Func) (() => AmbienceServer.IsSunnyDay()); - this._spawnConditions[SkyEntityType.EaterOfSouls] = (Func) (() => AmbienceServer.IsSunnyDay() || AmbienceServer.IsCalmNight()); - this._spawnConditions[SkyEntityType.Crimera] = (Func) (() => AmbienceServer.IsSunnyDay() || AmbienceServer.IsCalmNight()); - this._spawnConditions[SkyEntityType.Hellbats] = (Func) (() => true); - this._secondarySpawnConditionsPerPlayer[SkyEntityType.Vulture] = (Func) (player => player.ZoneDesert); - this._secondarySpawnConditionsPerPlayer[SkyEntityType.PixiePosse] = (Func) (player => player.ZoneHallow); - this._secondarySpawnConditionsPerPlayer[SkyEntityType.Seagulls] = (Func) (player => player.ZoneBeach); - this._secondarySpawnConditionsPerPlayer[SkyEntityType.Gastropods] = (Func) (player => player.ZoneHallow); - this._secondarySpawnConditionsPerPlayer[SkyEntityType.Pegasus] = (Func) (player => player.ZoneHallow); - this._secondarySpawnConditionsPerPlayer[SkyEntityType.EaterOfSouls] = (Func) (player => player.ZoneCorrupt); - this._secondarySpawnConditionsPerPlayer[SkyEntityType.Crimera] = (Func) (player => player.ZoneCrimson); - this._secondarySpawnConditionsPerPlayer[SkyEntityType.Bats] = (Func) (player => player.ZoneJungle); - } - - private bool IsPlayerAtRightHeightForType(SkyEntityType type, Player plr) => type == SkyEntityType.Hellbats ? AmbienceServer.IsPlayerInAPlaceWhereTheyCanSeeAmbienceHell(plr) : AmbienceServer.IsPlayerInAPlaceWhereTheyCanSeeAmbienceSky(plr); - - public void Update() - { - this.SpawnForcedEntities(); - if (this._updatesUntilNextAttempt > 0) - { - this._updatesUntilNextAttempt -= Main.dayRate; - } - else - { - this.ResetSpawnTime(); - IEnumerable source1 = this._spawnConditions.Where>>((Func>, bool>) (pair => pair.Value())).Select>, SkyEntityType>((Func>, SkyEntityType>) (pair => pair.Key)); - if (source1.Count((Func) (type => true)) == 0) - return; - Player player; - AmbienceServer.FindPlayerThatCanSeeBackgroundAmbience(out player); - if (player == null) - return; - IEnumerable source2 = source1.Where((Func) (type => this.IsPlayerAtRightHeightForType(type, player) && this._secondarySpawnConditionsPerPlayer.ContainsKey(type) && this._secondarySpawnConditionsPerPlayer[type](player))); - int maxValue = source2.Count((Func) (type => true)); - if (maxValue == 0 || Main.rand.Next(5) < 3) - { - source2 = source1.Where((Func) (type => - { - if (!this.IsPlayerAtRightHeightForType(type, player)) - return false; - return !this._secondarySpawnConditionsPerPlayer.ContainsKey(type) || this._secondarySpawnConditionsPerPlayer[type](player); - })); - maxValue = source2.Count((Func) (type => true)); - } - if (maxValue == 0) - return; - SkyEntityType type1 = source2.ElementAt(Main.rand.Next(maxValue)); - this.SpawnForPlayer(player, type1); - } - } - - public void ResetSpawnTime() => this._updatesUntilNextAttempt = Main.rand.Next(600, 7200); - - public void ForceEntitySpawn(AmbienceServer.AmbienceSpawnInfo info) => this._forcedSpawns.Add(info); - - private void SpawnForcedEntities() - { - if (this._forcedSpawns.Count == 0) - return; - for (int index = this._forcedSpawns.Count - 1; index >= 0; --index) - { - AmbienceServer.AmbienceSpawnInfo forcedSpawn = this._forcedSpawns[index]; - Player player; - if (forcedSpawn.targetPlayer == -1) - AmbienceServer.FindPlayerThatCanSeeBackgroundAmbience(out player); - else - player = Main.player[forcedSpawn.targetPlayer]; - if (player != null && this.IsPlayerAtRightHeightForType(forcedSpawn.skyEntityType, player)) - this.SpawnForPlayer(player, forcedSpawn.skyEntityType); - this._forcedSpawns.RemoveAt(index); - } - } - - private static void FindPlayerThatCanSeeBackgroundAmbience(out Player player) - { - player = (Player) null; - int maxValue = ((IEnumerable) Main.player).Count((Func) (plr => plr.active && AmbienceServer.IsPlayerInAPlaceWhereTheyCanSeeAmbience(plr))); - if (maxValue == 0) - return; - player = ((IEnumerable) Main.player).Where((Func) (plr => plr.active && AmbienceServer.IsPlayerInAPlaceWhereTheyCanSeeAmbience(plr))).ElementAt(Main.rand.Next(maxValue)); - } - - private static bool IsPlayerInAPlaceWhereTheyCanSeeAmbience(Player plr) => AmbienceServer.IsPlayerInAPlaceWhereTheyCanSeeAmbienceSky(plr) || AmbienceServer.IsPlayerInAPlaceWhereTheyCanSeeAmbienceHell(plr); - - private static bool IsPlayerInAPlaceWhereTheyCanSeeAmbienceSky(Player plr) => (double) plr.position.Y <= Main.worldSurface * 16.0 + 1600.0; - - private static bool IsPlayerInAPlaceWhereTheyCanSeeAmbienceHell(Player plr) => (double) plr.position.Y >= (double) ((Main.UnderworldLayer - 100) * 16); - - private void SpawnForPlayer(Player player, SkyEntityType type) => NetManager.Instance.BroadcastOrLoopback(NetAmbienceModule.SerializeSkyEntitySpawn(player, type)); - - public struct AmbienceSpawnInfo - { - public SkyEntityType skyEntityType; - public int targetPlayer; - } - } -} diff --git a/GameContent/Ambience/AmbientSkyDrawCache.cs b/GameContent/Ambience/AmbientSkyDrawCache.cs deleted file mode 100644 index 46ed61f..0000000 --- a/GameContent/Ambience/AmbientSkyDrawCache.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Ambience.AmbientSkyDrawCache -// 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.Ambience -{ - public class AmbientSkyDrawCache - { - public static AmbientSkyDrawCache Instance = new AmbientSkyDrawCache(); - public AmbientSkyDrawCache.UnderworldCache[] Underworld = new AmbientSkyDrawCache.UnderworldCache[5]; - public AmbientSkyDrawCache.OceanLineCache OceanLineInfo; - - public void SetUnderworldInfo(int drawIndex, float scale) => this.Underworld[drawIndex] = new AmbientSkyDrawCache.UnderworldCache() - { - Scale = scale - }; - - public void SetOceanLineInfo(float yScreenPosition, float oceanOpacity) => this.OceanLineInfo = new AmbientSkyDrawCache.OceanLineCache() - { - YScreenPosition = yScreenPosition, - OceanOpacity = oceanOpacity - }; - - public struct UnderworldCache - { - public float Scale; - } - - public struct OceanLineCache - { - public float YScreenPosition; - public float OceanOpacity; - } - } -} diff --git a/GameContent/Ambience/SkyEntityType.cs b/GameContent/Ambience/SkyEntityType.cs deleted file mode 100644 index 0fd39a1..0000000 --- a/GameContent/Ambience/SkyEntityType.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Ambience.SkyEntityType -// 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.Ambience -{ - public enum SkyEntityType : byte - { - BirdsV, - Wyvern, - Airship, - AirBalloon, - Eyeball, - Meteor, - BoneSerpent, - Bats, - Butterflies, - LostKite, - Vulture, - PixiePosse, - Seagulls, - SlimeBalloons, - Gastropods, - Pegasus, - EaterOfSouls, - Crimera, - Hellbats, - } -} diff --git a/GameContent/AmbientWindSystem.cs b/GameContent/AmbientWindSystem.cs deleted file mode 100644 index f3cf93e..0000000 --- a/GameContent/AmbientWindSystem.cs +++ /dev/null @@ -1,134 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.AmbientWindSystem -// 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; -using System; -using System.Collections.Generic; -using Terraria.Utilities; - -namespace Terraria.GameContent -{ - public class AmbientWindSystem - { - private UnifiedRandom _random = new UnifiedRandom(); - private List _spotsForAirboneWind = new List(); - private int _updatesCounter; - - public void Update() - { - if (!Main.LocalPlayer.ZoneGraveyard) - return; - ++this._updatesCounter; - Rectangle tileWorkSpace = this.GetTileWorkSpace(); - int num1 = tileWorkSpace.X + tileWorkSpace.Width; - int num2 = tileWorkSpace.Y + tileWorkSpace.Height; - for (int x = tileWorkSpace.X; x < num1; ++x) - { - for (int y = tileWorkSpace.Y; y < num2; ++y) - this.TrySpawningWind(x, y); - } - if (this._updatesCounter % 30 != 0) - return; - this.SpawnAirborneWind(); - } - - private void SpawnAirborneWind() - { - foreach (Point point in this._spotsForAirboneWind) - this.SpawnAirborneCloud(point.X, point.Y); - this._spotsForAirboneWind.Clear(); - } - - private Rectangle GetTileWorkSpace() - { - Point tileCoordinates = Main.LocalPlayer.Center.ToTileCoordinates(); - int width = 120; - int height = 30; - return new Rectangle(tileCoordinates.X - width / 2, tileCoordinates.Y - height / 2, width, height); - } - - private void TrySpawningWind(int x, int y) - { - if (!WorldGen.InWorld(x, y, 10) || Main.tile[x, y] == null) - return; - this.TestAirCloud(x, y); - Tile tile = Main.tile[x, y]; - if (!tile.active() || tile.slope() > (byte) 0 || tile.halfBrick() || !Main.tileSolid[(int) tile.type] || WorldGen.SolidTile(Main.tile[x, y - 1]) || this._random.Next(120) != 0) - return; - this.SpawnFloorCloud(x, y); - if (this._random.Next(3) != 0) - return; - this.SpawnFloorCloud(x, y - 1); - } - - private void SpawnAirborneCloud(int x, int y) - { - int num1 = this._random.Next(2, 6); - float num2 = 1.1f; - float num3 = 2.2f; - float num4 = 3f * (float) Math.PI / 400f * this._random.NextFloatDirection(); - float num5 = 3f * (float) Math.PI / 400f * this._random.NextFloatDirection(); - while ((double) num5 > -3.0 * Math.PI / 800.0 && (double) num5 < 3.0 * Math.PI / 800.0) - num5 = 3f * (float) Math.PI / 400f * this._random.NextFloatDirection(); - if (this._random.Next(4) == 0) - { - num1 = this._random.Next(9, 16); - num2 = 1.1f; - num3 = 1.2f; - } - else if (this._random.Next(4) == 0) - { - num1 = this._random.Next(9, 16); - num2 = 1.1f; - num3 = 0.2f; - } - Vector2 vector2_1 = new Vector2(-10f, 0.0f); - Vector2 worldCoordinates = new Point(x, y).ToWorldCoordinates(); - float num6 = num4 - (float) ((double) num5 * (double) num1 * 0.5); - for (int index = 0; index < num1; ++index) - { - if (Main.rand.Next(10) == 0) - num5 *= this._random.NextFloatDirection(); - Vector2 vector2_2 = this._random.NextVector2Circular(4f, 4f); - int Type = 1091 + this._random.Next(2) * 2; - float num7 = 1.4f; - float Scale = num2 + this._random.NextFloat() * num3; - float num8 = num6 + num5; - Vector2 vector2_3 = Vector2.UnitX.RotatedBy((double) num8) * num7; - Gore.NewGorePerfect(worldCoordinates + vector2_2 - vector2_1, vector2_3 * Main.WindForVisuals, Type, Scale); - worldCoordinates += vector2_3 * 6.5f * Scale; - num6 = num8; - } - } - - private void SpawnFloorCloud(int x, int y) - { - Vector2 worldCoordinates = new Point(x, y - 1).ToWorldCoordinates(); - int Type = this._random.Next(1087, 1090); - float num1 = 16f * this._random.NextFloat(); - worldCoordinates.Y -= num1; - if ((double) num1 < 4.0) - Type = 1090; - float num2 = 0.4f; - float Scale = (float) (0.800000011920929 + (double) this._random.NextFloat() * 0.200000002980232); - Gore.NewGorePerfect(worldCoordinates, Vector2.UnitX * num2 * Main.WindForVisuals, Type, Scale); - } - - private void TestAirCloud(int x, int y) - { - if (this._random.Next(120000) != 0) - return; - for (int index = -2; index <= 2; ++index) - { - if (index != 0 && (!this.DoesTileAllowWind(Main.tile[x + index, y]) || !this.DoesTileAllowWind(Main.tile[x, y + index]))) - return; - } - this._spotsForAirboneWind.Add(new Point(x, y)); - } - - private bool DoesTileAllowWind(Tile t) => !t.active() || !Main.tileSolid[(int) t.type]; - } -} diff --git a/GameContent/AnOutlinedDrawRenderTargetContent.cs b/GameContent/AnOutlinedDrawRenderTargetContent.cs deleted file mode 100644 index c5fa622..0000000 --- a/GameContent/AnOutlinedDrawRenderTargetContent.cs +++ /dev/null @@ -1,68 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.AnOutlinedDrawRenderTargetContent -// 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; -using Microsoft.Xna.Framework.Graphics; -using System; - -namespace Terraria.GameContent -{ - public abstract class AnOutlinedDrawRenderTargetContent : ARenderTargetContentByRequest - { - protected int width = 84; - protected int height = 84; - public Color _borderColor = Color.White; - private EffectPass _coloringShader; - private RenderTarget2D _helperTarget; - - public void UseColor(Color color) => this._borderColor = color; - - protected override void HandleUseReqest(GraphicsDevice device, SpriteBatch spriteBatch) - { - Effect pixelShader = Main.pixelShader; - if (this._coloringShader == null) - this._coloringShader = pixelShader.CurrentTechnique.Passes["ColorOnly"]; - Rectangle rectangle = new Rectangle(0, 0, this.width, this.height); - this.PrepareARenderTarget_AndListenToEvents(ref this._target, device, this.width, this.height, RenderTargetUsage.PreserveContents); - this.PrepareARenderTarget_WithoutListeningToEvents(ref this._helperTarget, device, this.width, this.height, RenderTargetUsage.DiscardContents); - device.SetRenderTarget(this._helperTarget); - device.Clear(Color.Transparent); - spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null); - this.DrawTheContent(spriteBatch); - spriteBatch.End(); - device.SetRenderTarget(this._target); - device.Clear(Color.Transparent); - spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null); - this._coloringShader.Apply(); - int num1 = 2; - int num2 = num1 * 2; - for (int index1 = -num2; index1 <= num2; index1 += num1) - { - for (int index2 = -num2; index2 <= num2; index2 += num1) - { - if (Math.Abs(index1) + Math.Abs(index2) == num2) - spriteBatch.Draw((Texture2D) this._helperTarget, new Vector2((float) index1, (float) index2), Color.Black); - } - } - int num3 = num1; - for (int index3 = -num3; index3 <= num3; index3 += num1) - { - for (int index4 = -num3; index4 <= num3; index4 += num1) - { - if (Math.Abs(index3) + Math.Abs(index4) == num3) - spriteBatch.Draw((Texture2D) this._helperTarget, new Vector2((float) index3, (float) index4), this._borderColor); - } - } - pixelShader.CurrentTechnique.Passes[0].Apply(); - spriteBatch.Draw((Texture2D) this._helperTarget, Vector2.Zero, Color.White); - spriteBatch.End(); - device.SetRenderTarget((RenderTarget2D) null); - this._wasPrepared = true; - } - - internal abstract void DrawTheContent(SpriteBatch spriteBatch); - } -} diff --git a/GameContent/AssetSourceController.cs b/GameContent/AssetSourceController.cs deleted file mode 100644 index 8d1f756..0000000 --- a/GameContent/AssetSourceController.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.AssetSourceController -// 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.Content; -using ReLogic.Content.Sources; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria.IO; - -namespace Terraria.GameContent -{ - public class AssetSourceController - { - private readonly List _staticSources; - private readonly IAssetRepository _assetRepository; - - public event Action OnResourcePackChange; - - public ResourcePackList ActiveResourcePackList { get; private set; } - - public AssetSourceController( - IAssetRepository assetRepository, - IEnumerable staticSources) - { - this._assetRepository = assetRepository; - this._staticSources = staticSources.ToList(); - this.UseResourcePacks(new ResourcePackList()); - } - - public void Refresh() - { - foreach (ResourcePack allPack in this.ActiveResourcePackList.AllPacks) - allPack.Refresh(); - this.UseResourcePacks(this.ActiveResourcePackList); - } - - public void UseResourcePacks(ResourcePackList resourcePacks) - { - if (this.OnResourcePackChange != null) - this.OnResourcePackChange(resourcePacks); - this.ActiveResourcePackList = resourcePacks; - List icontentSourceList = new List(resourcePacks.EnabledPacks.OrderBy((Func) (pack => pack.SortingOrder)).Select((Func) (pack => pack.GetContentSource()))); - icontentSourceList.AddRange((IEnumerable) this._staticSources); - foreach (IContentSource icontentSource in icontentSourceList) - icontentSource.ClearRejections(); - this._assetRepository.SetSources((IEnumerable) icontentSourceList, (AssetRequestMode) 1); - } - } -} diff --git a/GameContent/BackgroundChangeFlashInfo.cs b/GameContent/BackgroundChangeFlashInfo.cs deleted file mode 100644 index 2ad70fe..0000000 --- a/GameContent/BackgroundChangeFlashInfo.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.BackgroundChangeFlashInfo -// 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 -{ - public class BackgroundChangeFlashInfo - { - private int[] _variations = new int[13]; - private float[] _flashPower = new float[13]; - - public void UpdateCache() - { - this.UpdateVariation(0, WorldGen.treeBG1); - this.UpdateVariation(1, WorldGen.treeBG2); - this.UpdateVariation(2, WorldGen.treeBG3); - this.UpdateVariation(3, WorldGen.treeBG4); - this.UpdateVariation(4, WorldGen.corruptBG); - this.UpdateVariation(5, WorldGen.jungleBG); - this.UpdateVariation(6, WorldGen.snowBG); - this.UpdateVariation(7, WorldGen.hallowBG); - this.UpdateVariation(8, WorldGen.crimsonBG); - this.UpdateVariation(9, WorldGen.desertBG); - this.UpdateVariation(10, WorldGen.oceanBG); - this.UpdateVariation(11, WorldGen.mushroomBG); - this.UpdateVariation(12, WorldGen.underworldBG); - } - - private void UpdateVariation(int areaId, int newVariationValue) - { - int variation = this._variations[areaId]; - this._variations[areaId] = newVariationValue; - int num = newVariationValue; - if (variation == num) - return; - this.ValueChanged(areaId); - } - - private void ValueChanged(int areaId) - { - if (Main.gameMenu) - return; - this._flashPower[areaId] = 1f; - } - - public void UpdateFlashValues() - { - for (int index = 0; index < this._flashPower.Length; ++index) - this._flashPower[index] = MathHelper.Clamp(this._flashPower[index] - 0.05f, 0.0f, 1f); - } - - public float GetFlashPower(int areaId) => this._flashPower[areaId]; - } -} diff --git a/GameContent/Bestiary/BestiaryDatabase.cs b/GameContent/Bestiary/BestiaryDatabase.cs deleted file mode 100644 index 99883ed..0000000 --- a/GameContent/Bestiary/BestiaryDatabase.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.BestiaryDatabase -// 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.Collections.Generic; -using Terraria.GameContent.ItemDropRules; - -namespace Terraria.GameContent.Bestiary -{ - public class BestiaryDatabase - { - private List _entries = new List(); - private List _filters = new List(); - private List _sortSteps = new List(); - private Dictionary _byNpcId = new Dictionary(); - private BestiaryEntry _trashEntry = new BestiaryEntry(); - - public List Entries => this._entries; - - public List Filters => this._filters; - - public List SortSteps => this._sortSteps; - - public BestiaryEntry Register(BestiaryEntry entry) - { - this._entries.Add(entry); - for (int index = 0; index < entry.Info.Count; ++index) - { - if (entry.Info[index] is NPCNetIdBestiaryInfoElement bestiaryInfoElement1) - this._byNpcId[bestiaryInfoElement1.NetId] = entry; - } - return entry; - } - - public IBestiaryEntryFilter Register(IBestiaryEntryFilter filter) - { - this._filters.Add(filter); - return filter; - } - - public IBestiarySortStep Register(IBestiarySortStep sortStep) - { - this._sortSteps.Add(sortStep); - return sortStep; - } - - public BestiaryEntry FindEntryByNPCID(int npcNetId) - { - BestiaryEntry bestiaryEntry; - if (this._byNpcId.TryGetValue(npcNetId, out bestiaryEntry)) - return bestiaryEntry; - this._trashEntry.Info.Clear(); - return this._trashEntry; - } - - public void Merge(ItemDropDatabase dropsDatabase) - { - for (int npcId = -65; npcId < 663; ++npcId) - this.ExtractDropsForNPC(dropsDatabase, npcId); - } - - private void ExtractDropsForNPC(ItemDropDatabase dropsDatabase, int npcId) - { - BestiaryEntry entryByNpcid = this.FindEntryByNPCID(npcId); - if (entryByNpcid == null) - return; - List rulesForNpcid = dropsDatabase.GetRulesForNPCID(npcId, false); - List drops = new List(); - DropRateInfoChainFeed ratesInfo = new DropRateInfoChainFeed(1f); - foreach (IItemDropRule itemDropRule in rulesForNpcid) - itemDropRule.ReportDroprates(drops, ratesInfo); - foreach (DropRateInfo info in drops) - entryByNpcid.Info.Add((IBestiaryInfoElement) new ItemDropBestiaryInfoElement(info)); - } - - public void ApplyPass(BestiaryDatabase.BestiaryEntriesPass pass) - { - for (int index = 0; index < this._entries.Count; ++index) - pass(this._entries[index]); - } - - public delegate void BestiaryEntriesPass(BestiaryEntry entry); - } -} diff --git a/GameContent/Bestiary/BestiaryDatabaseNPCsPopulator.cs b/GameContent/Bestiary/BestiaryDatabaseNPCsPopulator.cs deleted file mode 100644 index 02571cf..0000000 --- a/GameContent/Bestiary/BestiaryDatabaseNPCsPopulator.cs +++ /dev/null @@ -1,3601 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.BestiaryDatabaseNPCsPopulator -// 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; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria.ID; - -namespace Terraria.GameContent.Bestiary -{ - public class BestiaryDatabaseNPCsPopulator - { - private BestiaryDatabase _currentDatabase; - - private BestiaryEntry FindEntryByNPCID(int npcNetId) => this._currentDatabase.FindEntryByNPCID(npcNetId); - - private BestiaryEntry Register(BestiaryEntry entry) => this._currentDatabase.Register(entry); - - private IBestiaryEntryFilter Register(IBestiaryEntryFilter filter) => this._currentDatabase.Register(filter); - - public void Populate(BestiaryDatabase database) - { - this._currentDatabase = database; - this.AddEmptyEntries_CrittersAndEnemies_Automated(); - this.AddTownNPCs_Manual(); - this.AddNPCBiomeRelationships_Automated(); - this.AddNPCBiomeRelationships_Manual(); - this.AddNPCBiomeRelationships_AddDecorations_Automated(); - this.ModifyEntriesThatNeedIt(); - this.RegisterFilters(); - this.RegisterSortSteps(); - } - - private void RegisterTestEntries() => this.Register(BestiaryEntry.Biome("Bestiary_Biomes.Hallow", "Images/UI/Bestiary/Biome_Hallow", new Func(BestiaryDatabaseNPCsPopulator.Conditions.ReachHardMode))); - - private void RegisterSortSteps() - { - foreach (IBestiarySortStep sortStep in new List() - { - (IBestiarySortStep) new SortingSteps.ByUnlockState(), - (IBestiarySortStep) new SortingSteps.ByBestiarySortingId(), - (IBestiarySortStep) new SortingSteps.Alphabetical(), - (IBestiarySortStep) new SortingSteps.ByNetId(), - (IBestiarySortStep) new SortingSteps.ByAttack(), - (IBestiarySortStep) new SortingSteps.ByDefense(), - (IBestiarySortStep) new SortingSteps.ByCoins(), - (IBestiarySortStep) new SortingSteps.ByHP(), - (IBestiarySortStep) new SortingSteps.ByBestiaryRarity() - }) - this._currentDatabase.Register(sortStep); - } - - private void RegisterFilters() - { - this.Register((IBestiaryEntryFilter) new Filters.ByUnlockState()); - this.Register((IBestiaryEntryFilter) new Filters.ByBoss()); - this.Register((IBestiaryEntryFilter) new Filters.ByRareCreature()); - List elementsForFilters = BestiaryDatabaseNPCsPopulator.CommonTags.GetCommonInfoElementsForFilters(); - for (int index = 0; index < elementsForFilters.Count; ++index) - this.Register((IBestiaryEntryFilter) new Filters.ByInfoElement(elementsForFilters[index])); - } - - private void ModifyEntriesThatNeedIt_NameOverride(int npcID, string newNameKey) - { - BestiaryEntry entryByNpcid = this.FindEntryByNPCID(npcID); - entryByNpcid.Info.RemoveAll((Predicate) (x => x is NamePlateInfoElement)); - entryByNpcid.Info.Add((IBestiaryInfoElement) new NamePlateInfoElement(newNameKey, npcID)); - entryByNpcid.Icon = (IEntryIcon) new UnlockableNPCEntryIcon(npcID, overrideNameKey: newNameKey); - } - - private void ModifyEntriesThatNeedIt() - { - this.FindEntryByNPCID(258).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SurfaceMushroom)); - this.FindEntryByNPCID(-1).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCorruption)); - this.FindEntryByNPCID(81).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCorruption)); - this.FindEntryByNPCID(121).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCorruption)); - this.FindEntryByNPCID(7).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCorruption)); - this.FindEntryByNPCID(98).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCorruption)); - this.FindEntryByNPCID(6).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCorruption)); - this.FindEntryByNPCID(94).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCorruption)); - this.FindEntryByNPCID(173).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCrimson)); - this.FindEntryByNPCID(181).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCrimson)); - this.FindEntryByNPCID(183).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCrimson)); - this.FindEntryByNPCID(242).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCrimson)); - this.FindEntryByNPCID(241).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCrimson)); - this.FindEntryByNPCID(174).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCrimson)); - this.FindEntryByNPCID(240).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCrimson)); - this.FindEntryByNPCID(175).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle)); - this.FindEntryByNPCID(153).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle)); - this.FindEntryByNPCID(52).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle)); - this.FindEntryByNPCID(58).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle)); - this.FindEntryByNPCID(102).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns)); - this.FindEntryByNPCID(157).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle)); - this.FindEntryByNPCID(51).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle)); - this.FindEntryByNPCID(169).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundSnow)); - this.FindEntryByNPCID(510).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert)); - this.FindEntryByNPCID(69).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Desert)); - this.FindEntryByNPCID(580).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert)); - this.FindEntryByNPCID(581).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert)); - this.FindEntryByNPCID(78).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Desert)); - this.FindEntryByNPCID(79).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.CorruptDesert)); - this.FindEntryByNPCID(630).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.CrimsonDesert)); - this.FindEntryByNPCID(80).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.HallowDesert)); - this.FindEntryByNPCID(533).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundBasedOnWorldEvilProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.CorruptUndergroundDesert, (IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.CrimsonUndergroundDesert)); - this.FindEntryByNPCID(528).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert)); - this.FindEntryByNPCID(529).AddTags((IBestiaryInfoElement) new BestiaryPortraitBackgroundBasedOnWorldEvilProviderPreferenceInfoElement((IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.CorruptUndergroundDesert, (IBestiaryBackgroundImagePathAndColorProvider) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.CrimsonUndergroundDesert)); - this._currentDatabase.ApplyPass(new BestiaryDatabase.BestiaryEntriesPass(this.TryGivingEntryFlavorTextIfItIsMissing)); - BestiaryEntry entryByNpcid = this.FindEntryByNPCID(398); - entryByNpcid.Info.Add((IBestiaryInfoElement) new MoonLordPortraitBackgroundProviderBestiaryInfoElement()); - entryByNpcid.Info.RemoveAll((Predicate) (x => x is NamePlateInfoElement)); - entryByNpcid.Info.Add((IBestiaryInfoElement) new NamePlateInfoElement("Enemies.MoonLord", 398)); - entryByNpcid.Icon = (IEntryIcon) new UnlockableNPCEntryIcon(398, overrideNameKey: "Enemies.MoonLord"); - this.ModifyEntriesThatNeedIt_NameOverride(637, "Friends.TownCat"); - this.ModifyEntriesThatNeedIt_NameOverride(638, "Friends.TownDog"); - this.ModifyEntriesThatNeedIt_NameOverride(656, "Friends.TownBunny"); - for (int index = 494; index <= 506; ++index) - this.FindEntryByNPCID(index).UIInfoProvider = (IBestiaryUICollectionInfoProvider) new SalamanderShellyDadUICollectionInfoProvider(ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[index]); - this.FindEntryByNPCID(534).UIInfoProvider = (IBestiaryUICollectionInfoProvider) new HighestOfMultipleUICollectionInfoProvider(new IBestiaryUICollectionInfoProvider[2] - { - (IBestiaryUICollectionInfoProvider) new CommonEnemyUICollectionInfoProvider(ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[534], false), - (IBestiaryUICollectionInfoProvider) new TownNPCUICollectionInfoProvider(ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[441]) - }); - foreach (NPCStatsReportInfoElement reportInfoElement in this.FindEntryByNPCID(13).Info.Select((Func) (x => x as NPCStatsReportInfoElement)).Where((Func) (x => x != null))) - reportInfoElement.LifeMax *= NPC.GetEaterOfWorldsSegmentsCountByGamemode(reportInfoElement.GameMode); - foreach (NPCStatsReportInfoElement reportInfoElement in this.FindEntryByNPCID(491).Info.Select((Func) (x => x as NPCStatsReportInfoElement)).Where((Func) (x => x != null))) - { - NPC npc = new NPC(); - int num = 4; - npc.SetDefaults(492); - reportInfoElement.LifeMax = num * npc.lifeMax; - } - this.FindEntryByNPCID(68).UIInfoProvider = (IBestiaryUICollectionInfoProvider) new HighestOfMultipleUICollectionInfoProvider(new IBestiaryUICollectionInfoProvider[3] - { - (IBestiaryUICollectionInfoProvider) new CommonEnemyUICollectionInfoProvider(ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[68], true), - (IBestiaryUICollectionInfoProvider) new CommonEnemyUICollectionInfoProvider(ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[35], true), - (IBestiaryUICollectionInfoProvider) new TownNPCUICollectionInfoProvider(ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[54]) - }); - this.FindEntryByNPCID(35).UIInfoProvider = (IBestiaryUICollectionInfoProvider) new HighestOfMultipleUICollectionInfoProvider(new IBestiaryUICollectionInfoProvider[2] - { - (IBestiaryUICollectionInfoProvider) new CommonEnemyUICollectionInfoProvider(ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[35], true), - (IBestiaryUICollectionInfoProvider) new TownNPCUICollectionInfoProvider(ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[54]) - }); - this.FindEntryByNPCID(37).UIInfoProvider = (IBestiaryUICollectionInfoProvider) new HighestOfMultipleUICollectionInfoProvider(new IBestiaryUICollectionInfoProvider[3] - { - (IBestiaryUICollectionInfoProvider) new TownNPCUICollectionInfoProvider(ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[37]), - (IBestiaryUICollectionInfoProvider) new TownNPCUICollectionInfoProvider(ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[54]), - (IBestiaryUICollectionInfoProvider) new CommonEnemyUICollectionInfoProvider(ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[35], true) - }); - this.FindEntryByNPCID(551).UIInfoProvider = (IBestiaryUICollectionInfoProvider) new CommonEnemyUICollectionInfoProvider(ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[551], true); - this.FindEntryByNPCID(491).UIInfoProvider = (IBestiaryUICollectionInfoProvider) new CommonEnemyUICollectionInfoProvider(ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[491], true); - foreach (KeyValuePair keyValuePair in new Dictionary() - { - { - 443, - new int[1]{ 46 } - }, - { - 442, - new int[1]{ 74 } - }, - { - 592, - new int[1]{ 55 } - }, - { - 444, - new int[1]{ 356 } - }, - { - 601, - new int[1]{ 599 } - }, - { - 445, - new int[1]{ 361 } - }, - { - 446, - new int[1]{ 377 } - }, - { - 605, - new int[1]{ 604 } - }, - { - 447, - new int[1]{ 300 } - }, - { - 627, - new int[1]{ 626 } - }, - { - 613, - new int[1]{ 612 } - }, - { - 448, - new int[1]{ 357 } - }, - { - 539, - new int[2]{ 299, 538 } - } - }) - this.FindEntryByNPCID(keyValuePair.Key).UIInfoProvider = (IBestiaryUICollectionInfoProvider) new GoldCritterUICollectionInfoProvider(keyValuePair.Value, ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[keyValuePair.Key]); - foreach (KeyValuePair keyValuePair in new Dictionary() - { - { - 362, - 363 - }, - { - 364, - 365 - }, - { - 602, - 603 - }, - { - 608, - 609 - } - }) - this.FindEntryByNPCID(keyValuePair.Key).UIInfoProvider = (IBestiaryUICollectionInfoProvider) new HighestOfMultipleUICollectionInfoProvider(new IBestiaryUICollectionInfoProvider[2] - { - (IBestiaryUICollectionInfoProvider) new CritterUICollectionInfoProvider(ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[keyValuePair.Key]), - (IBestiaryUICollectionInfoProvider) new CritterUICollectionInfoProvider(ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[keyValuePair.Value]) - }); - this.FindEntryByNPCID(4).AddTags((IBestiaryInfoElement) new SearchAliasInfoElement("eoc")); - this.FindEntryByNPCID(13).AddTags((IBestiaryInfoElement) new SearchAliasInfoElement("eow")); - this.FindEntryByNPCID(266).AddTags((IBestiaryInfoElement) new SearchAliasInfoElement("boc")); - this.FindEntryByNPCID(113).AddTags((IBestiaryInfoElement) new SearchAliasInfoElement("wof")); - this.FindEntryByNPCID(50).AddTags((IBestiaryInfoElement) new SearchAliasInfoElement("slime king")); - this.FindEntryByNPCID(125).AddTags((IBestiaryInfoElement) new SearchAliasInfoElement("the twins")); - this.FindEntryByNPCID(126).AddTags((IBestiaryInfoElement) new SearchAliasInfoElement("the twins")); - this.FindEntryByNPCID(222).AddTags((IBestiaryInfoElement) new SearchAliasInfoElement("qb")); - this.FindEntryByNPCID(222).AddTags((IBestiaryInfoElement) new SearchAliasInfoElement("bee queen")); - this.FindEntryByNPCID(398).AddTags((IBestiaryInfoElement) new SearchAliasInfoElement("moonlord")); - this.FindEntryByNPCID(398).AddTags((IBestiaryInfoElement) new SearchAliasInfoElement("cthulhu")); - this.FindEntryByNPCID(398).AddTags((IBestiaryInfoElement) new SearchAliasInfoElement("ml")); - this.FindEntryByNPCID(125).AddTags((IBestiaryInfoElement) new SearchAliasInfoElement("mech boss")); - this.FindEntryByNPCID(126).AddTags((IBestiaryInfoElement) new SearchAliasInfoElement("mech boss")); - this.FindEntryByNPCID((int) sbyte.MaxValue).AddTags((IBestiaryInfoElement) new SearchAliasInfoElement("mech boss")); - this.FindEntryByNPCID(134).AddTags((IBestiaryInfoElement) new SearchAliasInfoElement("mech boss")); - this.FindEntryByNPCID(657).AddTags((IBestiaryInfoElement) new SearchAliasInfoElement("slime queen")); - this.FindEntryByNPCID(636).AddTags((IBestiaryInfoElement) new SearchAliasInfoElement("eol")); - this.FindEntryByNPCID(636).AddTags((IBestiaryInfoElement) new SearchAliasInfoElement("fairy")); - } - - private void TryGivingEntryFlavorTextIfItIsMissing(BestiaryEntry entry) - { - if (entry.Info.Any((Func) (x => x is FlavorTextBestiaryInfoElement))) - return; - SpawnConditionBestiaryInfoElement bestiaryInfoElement1 = (SpawnConditionBestiaryInfoElement) null; - int? nullable1 = new int?(); - foreach (IBestiaryInfoElement bestiaryInfoElement2 in entry.Info) - { - if (bestiaryInfoElement2 is BestiaryPortraitBackgroundProviderPreferenceInfoElement preferenceInfoElement2 && preferenceInfoElement2.GetPreferredProvider() is SpawnConditionBestiaryInfoElement preferredProvider2) - { - bestiaryInfoElement1 = preferredProvider2; - break; - } - if (bestiaryInfoElement2 is SpawnConditionBestiaryInfoElement bestiaryInfoElement5) - { - int displayTextPriority = bestiaryInfoElement5.DisplayTextPriority; - if (nullable1.HasValue) - { - int num = displayTextPriority; - int? nullable2 = nullable1; - int valueOrDefault = nullable2.GetValueOrDefault(); - if (!(num >= valueOrDefault & nullable2.HasValue)) - continue; - } - bestiaryInfoElement1 = bestiaryInfoElement5; - nullable1 = new int?(displayTextPriority); - } - } - if (bestiaryInfoElement1 == null) - return; - string displayNameKey = bestiaryInfoElement1.GetDisplayNameKey(); - string languageKey = "Bestiary_BiomeText.biome_" + displayNameKey.Substring(displayNameKey.IndexOf('.') + 1); - entry.Info.Add((IBestiaryInfoElement) new FlavorTextBestiaryInfoElement(languageKey)); - } - - private void AddTownNPCs_Manual() - { - this.Register(BestiaryEntry.TownNPC(22)); - this.Register(BestiaryEntry.TownNPC(17)); - this.Register(BestiaryEntry.TownNPC(18)); - this.Register(BestiaryEntry.TownNPC(19)); - this.Register(BestiaryEntry.TownNPC(20)); - this.Register(BestiaryEntry.TownNPC(37)); - this.Register(BestiaryEntry.TownNPC(54)); - this.Register(BestiaryEntry.TownNPC(38)); - this.Register(BestiaryEntry.TownNPC(107)); - this.Register(BestiaryEntry.TownNPC(108)); - this.Register(BestiaryEntry.TownNPC(124)); - this.Register(BestiaryEntry.TownNPC(142)); - this.Register(BestiaryEntry.TownNPC(160)); - this.Register(BestiaryEntry.TownNPC(178)); - this.Register(BestiaryEntry.TownNPC(207)); - this.Register(BestiaryEntry.TownNPC(208)); - this.Register(BestiaryEntry.TownNPC(209)); - this.Register(BestiaryEntry.TownNPC(227)); - this.Register(BestiaryEntry.TownNPC(228)); - this.Register(BestiaryEntry.TownNPC(229)); - this.Register(BestiaryEntry.TownNPC(353)); - this.Register(BestiaryEntry.TownNPC(369)); - this.Register(BestiaryEntry.TownNPC(441)); - this.Register(BestiaryEntry.TownNPC(550)); - this.Register(BestiaryEntry.TownNPC(588)); - this.Register(BestiaryEntry.TownNPC(368)); - this.Register(BestiaryEntry.TownNPC(453)); - this.Register(BestiaryEntry.TownNPC(633)); - this.Register(BestiaryEntry.TownNPC(638)); - this.Register(BestiaryEntry.TownNPC(637)); - this.Register(BestiaryEntry.TownNPC(656)); - } - - private void AddMultiEntryNPCS_Manual() => this.Register(BestiaryEntry.Enemy(85)).Icon = (IEntryIcon) new UnlockableNPCEntryIcon(85, ai3: 3f); - - private void AddEmptyEntries_CrittersAndEnemies_Automated() - { - HashSet exclusions = BestiaryDatabaseNPCsPopulator.GetExclusions(); - foreach (KeyValuePair keyValuePair in ContentSamples.NpcsByNetId) - { - if (!exclusions.Contains(keyValuePair.Key) && !keyValuePair.Value.isLikeATownNPC) - { - if (keyValuePair.Value.CountsAsACritter) - this.Register(BestiaryEntry.Critter(keyValuePair.Key)); - else - this.Register(BestiaryEntry.Enemy(keyValuePair.Key)); - } - } - } - - private static HashSet GetExclusions() - { - HashSet intSet = new HashSet(); - List intList = new List(); - foreach (KeyValuePair keyValuePair in NPCID.Sets.NPCBestiaryDrawOffset) - { - if (keyValuePair.Value.Hide) - intList.Add(keyValuePair.Key); - } - foreach (int num in intList) - intSet.Add(num); - return intSet; - } - - private void AddNPCBiomeRelationships_Automated() - { - this.FindEntryByNPCID(357).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Rain - }); - this.FindEntryByNPCID(448).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Rain - }); - this.FindEntryByNPCID(606).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Graveyard - }); - this.FindEntryByNPCID(211).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle - }); - this.FindEntryByNPCID(377).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface - }); - this.FindEntryByNPCID(446).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface - }); - this.FindEntryByNPCID(595).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(596).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(597).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(598).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(599).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(600).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(601).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(612).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(613).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(25).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheUnderworld - }); - this.FindEntryByNPCID(30).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Goblins - }); - this.FindEntryByNPCID(33).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(112).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCorruption - }); - this.FindEntryByNPCID(300).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Underground - }); - this.FindEntryByNPCID(355).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(358).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheHallow - }); - this.FindEntryByNPCID(447).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Underground - }); - this.FindEntryByNPCID(610).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Graveyard - }); - this.FindEntryByNPCID(210).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle - }); - this.FindEntryByNPCID(261).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundMushroom - }); - this.FindEntryByNPCID(402).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.StardustPillar - }); - this.FindEntryByNPCID(403).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.StardustPillar - }); - this.FindEntryByNPCID(485).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle - }); - this.FindEntryByNPCID(486).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle - }); - this.FindEntryByNPCID(487).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle - }); - this.FindEntryByNPCID(359).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(410).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.StardustPillar - }); - this.FindEntryByNPCID(604).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.WindyDay - }); - this.FindEntryByNPCID(605).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.WindyDay - }); - this.FindEntryByNPCID(218).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundSnow - }); - this.FindEntryByNPCID(361).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle - }); - this.FindEntryByNPCID(404).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.StardustPillar - }); - this.FindEntryByNPCID(445).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle - }); - this.FindEntryByNPCID(626).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Ocean - }); - this.FindEntryByNPCID(627).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Ocean - }); - this.FindEntryByNPCID(2).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(74).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(190).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(191).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(192).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(193).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(194).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(217).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(297).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(298).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(356).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(360).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SurfaceMushroom, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundMushroom - }); - this.FindEntryByNPCID(655).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheUnderworld - }); - this.FindEntryByNPCID(653).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheUnderworld - }); - this.FindEntryByNPCID(654).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheUnderworld - }); - this.FindEntryByNPCID(442).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(444).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(582).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert - }); - this.FindEntryByNPCID(583).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(584).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(585).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(1).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface - }); - this.FindEntryByNPCID(59).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheUnderworld - }); - this.FindEntryByNPCID(138).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundHallow - }); - this.FindEntryByNPCID(147).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Snow, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(265).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle - }); - this.FindEntryByNPCID(367).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Desert, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(616).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(617).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(23).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Meteor - }); - this.FindEntryByNPCID(55).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface - }); - this.FindEntryByNPCID(57).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.BloodMoon - }); - this.FindEntryByNPCID(58).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Underground, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle - }); - this.FindEntryByNPCID(102).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(157).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle - }); - this.FindEntryByNPCID(219).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle - }); - this.FindEntryByNPCID(220).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Ocean - }); - this.FindEntryByNPCID(236).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle - }); - this.FindEntryByNPCID(302).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Halloween - }); - this.FindEntryByNPCID(366).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Desert, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(465).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.BloodMoon - }); - this.FindEntryByNPCID(537).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert - }); - this.FindEntryByNPCID(592).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface - }); - this.FindEntryByNPCID(607).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Desert - }); - this.FindEntryByNPCID(10).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Underground - }); - this.FindEntryByNPCID(11).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Underground - }); - this.FindEntryByNPCID(12).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Underground - }); - this.FindEntryByNPCID(34).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(117).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheUnderworld - }); - this.FindEntryByNPCID(118).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheUnderworld - }); - this.FindEntryByNPCID(119).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheUnderworld - }); - this.FindEntryByNPCID(163).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SpiderNest - }); - this.FindEntryByNPCID(164).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SpiderNest - }); - this.FindEntryByNPCID(230).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Rain - }); - this.FindEntryByNPCID(241).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCrimson - }); - this.FindEntryByNPCID(406).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.StardustPillar - }); - this.FindEntryByNPCID(496).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(497).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(519).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SolarPillar - }); - this.FindEntryByNPCID(593).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Rain - }); - this.FindEntryByNPCID(625).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Ocean - }); - this.FindEntryByNPCID(49).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(51).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle - }); - this.FindEntryByNPCID(60).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheUnderworld - }); - this.FindEntryByNPCID(93).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(137).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundHallow - }); - this.FindEntryByNPCID(184).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundSnow - }); - this.FindEntryByNPCID(204).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle - }); - this.FindEntryByNPCID(224).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Rain - }); - this.FindEntryByNPCID(259).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundMushroom - }); - this.FindEntryByNPCID(299).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(317).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(318).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(378).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.BloodMoon - }); - this.FindEntryByNPCID(393).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Martian - }); - this.FindEntryByNPCID(494).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(495).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(513).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert - }); - this.FindEntryByNPCID(514).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert - }); - this.FindEntryByNPCID(515).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert - }); - this.FindEntryByNPCID(538).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(539).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(580).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert - }); - this.FindEntryByNPCID(587).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.BloodMoon - }); - this.FindEntryByNPCID(16).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(71).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(81).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCorruption - }); - this.FindEntryByNPCID(183).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCrimson - }); - this.FindEntryByNPCID(67).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Ocean - }); - this.FindEntryByNPCID(70).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(75).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheHallow - }); - this.FindEntryByNPCID(239).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCrimson - }); - this.FindEntryByNPCID(267).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCrimson - }); - this.FindEntryByNPCID(288).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(394).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Martian - }); - this.FindEntryByNPCID(408).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.StardustPillar - }); - this.FindEntryByNPCID(428).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.VortexPillar - }); - this.FindEntryByNPCID(43).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle - }); - this.FindEntryByNPCID(56).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle - }); - this.FindEntryByNPCID(72).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(141).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Underground - }); - this.FindEntryByNPCID(185).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundSnow - }); - this.FindEntryByNPCID(374).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundMushroom - }); - this.FindEntryByNPCID(375).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundMushroom - }); - this.FindEntryByNPCID(661).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheHallow - }); - this.FindEntryByNPCID(388).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Martian - }); - this.FindEntryByNPCID(602).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Ocean - }); - this.FindEntryByNPCID(603).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Ocean - }); - this.FindEntryByNPCID(115).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheUnderworld - }); - this.FindEntryByNPCID(232).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle - }); - this.FindEntryByNPCID(258).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SurfaceMushroom, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundMushroom - }); - this.FindEntryByNPCID(409).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.StardustPillar - }); - this.FindEntryByNPCID(462).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Eclipse - }); - this.FindEntryByNPCID(516).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SolarPillar - }); - this.FindEntryByNPCID(42).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle - }); - this.FindEntryByNPCID(46).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(47).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.BloodMoon - }); - this.FindEntryByNPCID(69).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Desert - }); - this.FindEntryByNPCID(231).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle - }); - this.FindEntryByNPCID(235).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle - }); - this.FindEntryByNPCID(247).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheTemple - }); - this.FindEntryByNPCID(248).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheTemple - }); - this.FindEntryByNPCID(303).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Halloween, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(304).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Halloween, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(337).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Christmas, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(354).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SpiderNest - }); - this.FindEntryByNPCID(362).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(363).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(364).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(365).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(395).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Martian - }); - this.FindEntryByNPCID(443).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(464).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.BloodMoon - }); - this.FindEntryByNPCID(508).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert - }); - this.FindEntryByNPCID(532).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert - }); - this.FindEntryByNPCID(540).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Party, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(578).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(608).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Desert - }); - this.FindEntryByNPCID(609).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Desert - }); - this.FindEntryByNPCID(611).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(264).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle - }); - this.FindEntryByNPCID(101).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundCorruption - }); - this.FindEntryByNPCID(121).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCorruption - }); - this.FindEntryByNPCID(122).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheHallow - }); - this.FindEntryByNPCID(132).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(148).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Snow - }); - this.FindEntryByNPCID(149).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Snow - }); - this.FindEntryByNPCID(168).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.BloodMoon - }); - this.FindEntryByNPCID(234).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle - }); - this.FindEntryByNPCID(250).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Rain - }); - this.FindEntryByNPCID(257).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SurfaceMushroom, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundMushroom - }); - this.FindEntryByNPCID(421).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.NebulaPillar - }); - this.FindEntryByNPCID(470).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.BloodMoon - }); - this.FindEntryByNPCID(472).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Goblins - }); - this.FindEntryByNPCID(478).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Eclipse - }); - this.FindEntryByNPCID(546).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Desert, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Sandstorm - }); - this.FindEntryByNPCID(581).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert - }); - this.FindEntryByNPCID(615).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Ocean - }); - this.FindEntryByNPCID(256).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SurfaceMushroom, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundMushroom - }); - this.FindEntryByNPCID(133).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(221).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Ocean - }); - this.FindEntryByNPCID(252).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Pirates - }); - this.FindEntryByNPCID(329).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.PumpkinMoon - }); - this.FindEntryByNPCID(385).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Martian - }); - this.FindEntryByNPCID(427).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.VortexPillar - }); - this.FindEntryByNPCID(490).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.BloodMoon - }); - this.FindEntryByNPCID(548).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(63).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(64).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Ocean - }); - this.FindEntryByNPCID(85).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(629).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundSnow - }); - this.FindEntryByNPCID(103).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(152).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle - }); - this.FindEntryByNPCID(174).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCrimson - }); - this.FindEntryByNPCID(195).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(254).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SurfaceMushroom - }); - this.FindEntryByNPCID(260).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SurfaceMushroom, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundMushroom - }); - this.FindEntryByNPCID(382).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Martian - }); - this.FindEntryByNPCID(383).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Martian - }); - this.FindEntryByNPCID(386).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Martian - }); - this.FindEntryByNPCID(389).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Martian - }); - this.FindEntryByNPCID(466).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Eclipse - }); - this.FindEntryByNPCID(467).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Eclipse - }); - this.FindEntryByNPCID(489).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.BloodMoon - }); - this.FindEntryByNPCID(530).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert - }); - this.FindEntryByNPCID(175).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle - }); - this.FindEntryByNPCID(176).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle - }); - this.FindEntryByNPCID(188).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(3).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(7).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCorruption - }); - this.FindEntryByNPCID(8).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCorruption - }); - this.FindEntryByNPCID(9).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCorruption - }); - this.FindEntryByNPCID(95).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Underground - }); - this.FindEntryByNPCID(96).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Underground - }); - this.FindEntryByNPCID(97).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Underground - }); - this.FindEntryByNPCID(98).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCorruption - }); - this.FindEntryByNPCID(99).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCorruption - }); - this.FindEntryByNPCID(100).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCorruption - }); - this.FindEntryByNPCID(120).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundHallow - }); - this.FindEntryByNPCID(150).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundSnow - }); - this.FindEntryByNPCID(151).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheUnderworld - }); - this.FindEntryByNPCID(153).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle - }); - this.FindEntryByNPCID(154).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundSnow - }); - this.FindEntryByNPCID(158).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Eclipse - }); - this.FindEntryByNPCID(161).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Snow - }); - this.FindEntryByNPCID(186).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(187).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(189).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(223).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Rain, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(233).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle - }); - this.FindEntryByNPCID(251).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Eclipse - }); - this.FindEntryByNPCID(319).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(320).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(321).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(331).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(332).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(338).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.FrostMoon - }); - this.FindEntryByNPCID(339).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.FrostMoon - }); - this.FindEntryByNPCID(340).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.FrostMoon - }); - this.FindEntryByNPCID(341).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.FrostMoon - }); - this.FindEntryByNPCID(342).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.FrostMoon - }); - this.FindEntryByNPCID(350).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.FrostMoon - }); - this.FindEntryByNPCID(381).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Martian - }); - this.FindEntryByNPCID(492).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Pirates - }); - this.FindEntryByNPCID(510).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert - }); - this.FindEntryByNPCID(511).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert - }); - this.FindEntryByNPCID(512).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert - }); - this.FindEntryByNPCID(552).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(553).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(554).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(590).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(82).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(116).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheUnderworld - }); - this.FindEntryByNPCID(166).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Eclipse - }); - this.FindEntryByNPCID(199).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheTemple - }); - this.FindEntryByNPCID(263).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle - }); - this.FindEntryByNPCID(371).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Ocean - }); - this.FindEntryByNPCID(461).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Eclipse - }); - this.FindEntryByNPCID(463).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Eclipse - }); - this.FindEntryByNPCID(523).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(52).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle - }); - this.FindEntryByNPCID(200).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(244).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheHallow, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Rain - }); - this.FindEntryByNPCID((int) byte.MaxValue).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SurfaceMushroom - }); - this.FindEntryByNPCID(384).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Martian - }); - this.FindEntryByNPCID(387).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Martian - }); - this.FindEntryByNPCID(390).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Martian - }); - this.FindEntryByNPCID(418).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SolarPillar - }); - this.FindEntryByNPCID(420).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.NebulaPillar - }); - this.FindEntryByNPCID(460).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Eclipse - }); - this.FindEntryByNPCID(468).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Eclipse - }); - this.FindEntryByNPCID(524).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert - }); - this.FindEntryByNPCID(525).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.CorruptUndergroundDesert - }); - this.FindEntryByNPCID(526).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.CrimsonUndergroundDesert - }); - this.FindEntryByNPCID(527).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.HallowUndergroundDesert - }); - this.FindEntryByNPCID(536).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.BloodMoon - }); - this.FindEntryByNPCID(566).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(567).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(53).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.BloodMoon - }); - this.FindEntryByNPCID(169).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundSnow - }); - this.FindEntryByNPCID(301).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Graveyard - }); - this.FindEntryByNPCID(391).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Martian - }); - this.FindEntryByNPCID(405).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.StardustPillar - }); - this.FindEntryByNPCID(423).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.NebulaPillar - }); - this.FindEntryByNPCID(438).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(498).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(499).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(500).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(501).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(502).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(503).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(504).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(505).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(506).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(534).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheUnderworld - }); - this.FindEntryByNPCID(568).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(569).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(21).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(24).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheUnderworld - }); - this.FindEntryByNPCID(26).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Goblins - }); - this.FindEntryByNPCID(27).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Goblins - }); - this.FindEntryByNPCID(28).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Goblins - }); - this.FindEntryByNPCID(29).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Goblins - }); - this.FindEntryByNPCID(31).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(32).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(44).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(73).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface - }); - this.FindEntryByNPCID(77).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(78).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Desert - }); - this.FindEntryByNPCID(79).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.CorruptDesert - }); - this.FindEntryByNPCID(630).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.CrimsonDesert - }); - this.FindEntryByNPCID(80).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.HallowDesert - }); - this.FindEntryByNPCID(104).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(111).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Goblins - }); - this.FindEntryByNPCID(140).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(159).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Eclipse - }); - this.FindEntryByNPCID(162).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Eclipse - }); - this.FindEntryByNPCID(196).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(198).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheTemple - }); - this.FindEntryByNPCID(201).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(202).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(203).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(212).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Pirates - }); - this.FindEntryByNPCID(213).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Pirates - }); - this.FindEntryByNPCID(242).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCrimson - }); - this.FindEntryByNPCID(269).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(270).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(272).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(273).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(275).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(276).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(277).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(278).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(279).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(280).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(281).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(282).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(283).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(284).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(285).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(286).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(287).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(294).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(295).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(296).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(310).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.PumpkinMoon - }); - this.FindEntryByNPCID(311).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.PumpkinMoon - }); - this.FindEntryByNPCID(312).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.PumpkinMoon - }); - this.FindEntryByNPCID(313).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.PumpkinMoon - }); - this.FindEntryByNPCID(316).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Graveyard - }); - this.FindEntryByNPCID(326).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.PumpkinMoon - }); - this.FindEntryByNPCID(415).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SolarPillar - }); - this.FindEntryByNPCID(449).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(450).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(451).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(452).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(471).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Goblins - }); - this.FindEntryByNPCID(482).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Granite - }); - this.FindEntryByNPCID(572).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(573).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(143).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.FrostLegion - }); - this.FindEntryByNPCID(144).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.FrostLegion - }); - this.FindEntryByNPCID(145).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.FrostLegion - }); - this.FindEntryByNPCID(155).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Snow - }); - this.FindEntryByNPCID(271).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(274).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(314).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.PumpkinMoon - }); - this.FindEntryByNPCID(352).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.FrostMoon - }); - this.FindEntryByNPCID(379).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(509).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert - }); - this.FindEntryByNPCID(555).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(556).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(557).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(61).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Desert - }); - this.FindEntryByNPCID(110).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(206).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundSnow - }); - this.FindEntryByNPCID(214).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Pirates - }); - this.FindEntryByNPCID(215).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Pirates - }); - this.FindEntryByNPCID(216).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Pirates - }); - this.FindEntryByNPCID(225).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Rain - }); - this.FindEntryByNPCID(291).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(292).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(293).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(347).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.FrostMoon - }); - this.FindEntryByNPCID(412).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SolarPillar - }); - this.FindEntryByNPCID(413).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SolarPillar - }); - this.FindEntryByNPCID(414).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SolarPillar - }); - this.FindEntryByNPCID(469).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Eclipse - }); - this.FindEntryByNPCID(473).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundCorruption - }); - this.FindEntryByNPCID(474).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundCrimson - }); - this.FindEntryByNPCID(475).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundHallow - }); - this.FindEntryByNPCID(476).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle - }); - this.FindEntryByNPCID(483).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Granite - }); - this.FindEntryByNPCID(586).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.BloodMoon - }); - this.FindEntryByNPCID(62).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheUnderworld - }); - this.FindEntryByNPCID(131).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(165).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SpiderNest - }); - this.FindEntryByNPCID(167).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundSnow - }); - this.FindEntryByNPCID(197).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundSnow - }); - this.FindEntryByNPCID(226).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheTemple - }); - this.FindEntryByNPCID(237).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle - }); - this.FindEntryByNPCID(238).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SpiderNest - }); - this.FindEntryByNPCID(480).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Marble - }); - this.FindEntryByNPCID(528).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert - }); - this.FindEntryByNPCID(529).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert - }); - this.FindEntryByNPCID(289).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(439).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(440).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(533).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert - }); - this.FindEntryByNPCID(170).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.CorruptIce - }); - this.FindEntryByNPCID(171).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.HallowIce - }); - this.FindEntryByNPCID(179).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundCrimson - }); - this.FindEntryByNPCID(180).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.CrimsonIce - }); - this.FindEntryByNPCID(181).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCrimson - }); - this.FindEntryByNPCID(205).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle - }); - this.FindEntryByNPCID(411).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.StardustPillar - }); - this.FindEntryByNPCID(424).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.NebulaPillar - }); - this.FindEntryByNPCID(429).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.VortexPillar - }); - this.FindEntryByNPCID(481).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Marble - }); - this.FindEntryByNPCID(240).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCrimson - }); - this.FindEntryByNPCID(290).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(430).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(431).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Snow, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(432).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(433).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(434).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(435).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(436).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(479).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Eclipse - }); - this.FindEntryByNPCID(518).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SolarPillar - }); - this.FindEntryByNPCID(591).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(45).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(130).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(172).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(305).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.PumpkinMoon - }); - this.FindEntryByNPCID(306).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.PumpkinMoon - }); - this.FindEntryByNPCID(307).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.PumpkinMoon - }); - this.FindEntryByNPCID(308).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.PumpkinMoon - }); - this.FindEntryByNPCID(309).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.PumpkinMoon - }); - this.FindEntryByNPCID(425).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.VortexPillar - }); - this.FindEntryByNPCID(426).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.VortexPillar - }); - this.FindEntryByNPCID(570).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(571).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(417).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SolarPillar - }); - this.FindEntryByNPCID(419).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SolarPillar - }); - this.FindEntryByNPCID(65).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Ocean - }); - this.FindEntryByNPCID(372).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Ocean - }); - this.FindEntryByNPCID(373).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Ocean - }); - this.FindEntryByNPCID(407).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.StardustPillar - }); - this.FindEntryByNPCID(542).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Desert, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Sandstorm - }); - this.FindEntryByNPCID(543).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.CorruptDesert, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Sandstorm - }); - this.FindEntryByNPCID(544).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.CrimsonDesert, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Sandstorm - }); - this.FindEntryByNPCID(545).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.HallowDesert, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Sandstorm - }); - this.FindEntryByNPCID(619).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.BloodMoon - }); - this.FindEntryByNPCID(621).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.BloodMoon - }); - this.FindEntryByNPCID(622).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.BloodMoon - }); - this.FindEntryByNPCID(623).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.BloodMoon - }); - this.FindEntryByNPCID(128).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(177).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle - }); - this.FindEntryByNPCID(561).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(562).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(563).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(594).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.WindyDay - }); - this.FindEntryByNPCID(253).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Eclipse - }); - this.FindEntryByNPCID(129).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(6).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCorruption - }); - this.FindEntryByNPCID(173).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCrimson - }); - this.FindEntryByNPCID(399).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Sky - }); - this.FindEntryByNPCID(416).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SolarPillar - }); - this.FindEntryByNPCID(531).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert - }); - this.FindEntryByNPCID(83).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundCorruption - }); - this.FindEntryByNPCID(84).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundHallow - }); - this.FindEntryByNPCID(86).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheHallow - }); - this.FindEntryByNPCID(330).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.PumpkinMoon - }); - this.FindEntryByNPCID(620).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.BloodMoon - }); - this.FindEntryByNPCID(48).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Sky - }); - this.FindEntryByNPCID(268).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundCrimson - }); - this.FindEntryByNPCID(328).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.PumpkinMoon - }); - this.FindEntryByNPCID(66).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheUnderworld - }); - this.FindEntryByNPCID(182).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundCrimson - }); - this.FindEntryByNPCID(13).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCorruption - }); - this.FindEntryByNPCID(14).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCorruption - }); - this.FindEntryByNPCID(15).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCorruption - }); - this.FindEntryByNPCID(39).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheUnderworld - }); - this.FindEntryByNPCID(40).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheUnderworld - }); - this.FindEntryByNPCID(41).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheUnderworld - }); - this.FindEntryByNPCID(315).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.PumpkinMoon - }); - this.FindEntryByNPCID(343).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.FrostMoon - }); - this.FindEntryByNPCID(94).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCorruption - }); - this.FindEntryByNPCID(392).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Martian - }); - this.FindEntryByNPCID(558).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(559).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(560).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(348).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.FrostMoon - }); - this.FindEntryByNPCID(349).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.FrostMoon - }); - this.FindEntryByNPCID(156).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheUnderworld - }); - this.FindEntryByNPCID(35).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(68).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(134).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(136).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(135).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(454).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(455).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(456).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(457).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(458).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(459).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(113).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheUnderworld - }); - this.FindEntryByNPCID(114).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheUnderworld - }); - this.FindEntryByNPCID(564).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(565).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(327).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.PumpkinMoon - }); - this.FindEntryByNPCID(520).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Martian - }); - this.FindEntryByNPCID(574).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(575).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(246).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheTemple - }); - this.FindEntryByNPCID(50).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface - }); - this.FindEntryByNPCID(477).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Eclipse - }); - this.FindEntryByNPCID(541).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Desert, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Sandstorm - }); - this.FindEntryByNPCID(109).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.BloodMoon - }); - this.FindEntryByNPCID(243).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Snow, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Blizzard - }); - this.FindEntryByNPCID(618).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.BloodMoon - }); - this.FindEntryByNPCID(351).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.FrostMoon - }); - this.FindEntryByNPCID(249).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheTemple - }); - this.FindEntryByNPCID(222).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle - }); - this.FindEntryByNPCID(262).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle - }); - this.FindEntryByNPCID(87).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Sky - }); - this.FindEntryByNPCID(88).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Sky - }); - this.FindEntryByNPCID(89).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Sky - }); - this.FindEntryByNPCID(90).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Sky - }); - this.FindEntryByNPCID(91).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Sky - }); - this.FindEntryByNPCID(92).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Sky - }); - this.FindEntryByNPCID((int) sbyte.MaxValue).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(346).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.FrostMoon - }); - this.FindEntryByNPCID(370).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Ocean - }); - this.FindEntryByNPCID(4).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(551).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(245).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheTemple - }); - this.FindEntryByNPCID(576).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(577).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(266).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCrimson - }); - this.FindEntryByNPCID(325).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.PumpkinMoon - }); - this.FindEntryByNPCID(344).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.FrostMoon - }); - this.FindEntryByNPCID(125).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(126).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(549).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy - }); - this.FindEntryByNPCID(345).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.FrostMoon - }); - this.FindEntryByNPCID(422).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.VortexPillar - }); - this.FindEntryByNPCID(493).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.StardustPillar - }); - this.FindEntryByNPCID(507).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.NebulaPillar - }); - this.FindEntryByNPCID(517).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SolarPillar - }); - this.FindEntryByNPCID(491).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Pirates - }); - } - - private void AddNPCBiomeRelationships_Manual() - { - this.FindEntryByNPCID(628).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.WindyDay - }); - this.FindEntryByNPCID(-4).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(-3).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(-7).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(1).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(-10).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(-8).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Underground - }); - this.FindEntryByNPCID(-9).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Underground - }); - this.FindEntryByNPCID(-6).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(-5).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(-2).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCorruption - }); - this.FindEntryByNPCID(-1).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCorruption, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundCorruption - }); - this.FindEntryByNPCID(81).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundCorruption - }); - this.FindEntryByNPCID(121).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundCorruption - }); - this.FindEntryByNPCID(7).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundCorruption - }); - this.FindEntryByNPCID(8).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundCorruption - }); - this.FindEntryByNPCID(9).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundCorruption - }); - this.FindEntryByNPCID(98).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundCorruption - }); - this.FindEntryByNPCID(99).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundCorruption - }); - this.FindEntryByNPCID(100).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundCorruption - }); - this.FindEntryByNPCID(6).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundCorruption - }); - this.FindEntryByNPCID(94).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundCorruption - }); - this.FindEntryByNPCID(173).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundCrimson - }); - this.FindEntryByNPCID(181).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundCrimson - }); - this.FindEntryByNPCID(183).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundCrimson - }); - this.FindEntryByNPCID(242).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundCrimson - }); - this.FindEntryByNPCID(241).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundCrimson - }); - this.FindEntryByNPCID(174).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundCrimson - }); - this.FindEntryByNPCID(240).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundCrimson - }); - this.FindEntryByNPCID(175).Info.Remove((IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle); - this.FindEntryByNPCID(175).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle - }); - this.FindEntryByNPCID(153).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle - }); - this.FindEntryByNPCID(52).Info.Remove((IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime); - this.FindEntryByNPCID(52).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(58).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle - }); - this.FindEntryByNPCID(102).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle - }); - this.FindEntryByNPCID(157).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle - }); - this.FindEntryByNPCID(51).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle - }); - this.FindEntryByNPCID(161).Info.Remove((IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime); - this.FindEntryByNPCID(161).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(155).Info.Remove((IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime); - this.FindEntryByNPCID(155).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(169).Info.Remove((IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundSnow); - this.FindEntryByNPCID(169).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Snow, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundSnow - }); - this.FindEntryByNPCID(510).Info.Remove((IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert); - this.FindEntryByNPCID(510).Info.AddRange((IEnumerable) new IBestiaryInfoElement[3] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Desert, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Sandstorm - }); - this.FindEntryByNPCID(511).Info.Remove((IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert); - this.FindEntryByNPCID(511).Info.AddRange((IEnumerable) new IBestiaryInfoElement[3] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Desert, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Sandstorm - }); - this.FindEntryByNPCID(512).Info.Remove((IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert); - this.FindEntryByNPCID(512).Info.AddRange((IEnumerable) new IBestiaryInfoElement[3] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Desert, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Sandstorm - }); - this.FindEntryByNPCID(69).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert - }); - this.FindEntryByNPCID(580).Info.Remove((IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert); - this.FindEntryByNPCID(580).Info.AddRange((IEnumerable) new IBestiaryInfoElement[3] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Desert, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Sandstorm - }); - this.FindEntryByNPCID(581).Info.Remove((IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert); - this.FindEntryByNPCID(581).Info.AddRange((IEnumerable) new IBestiaryInfoElement[3] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Desert, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Sandstorm - }); - this.FindEntryByNPCID(78).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert - }); - this.FindEntryByNPCID(79).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.CorruptUndergroundDesert - }); - this.FindEntryByNPCID(630).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.CrimsonUndergroundDesert - }); - this.FindEntryByNPCID(80).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.HallowUndergroundDesert - }); - this.FindEntryByNPCID(533).Info.Remove((IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert); - this.FindEntryByNPCID(533).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.CorruptUndergroundDesert, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.CrimsonUndergroundDesert - }); - this.FindEntryByNPCID(528).Info.Remove((IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert); - this.FindEntryByNPCID(528).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.HallowUndergroundDesert - }); - this.FindEntryByNPCID(529).Info.Remove((IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert); - this.FindEntryByNPCID(529).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.CorruptUndergroundDesert, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.CrimsonUndergroundDesert - }); - this.FindEntryByNPCID(624).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface - }); - this.FindEntryByNPCID(5).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(139).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(484).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime - }); - this.FindEntryByNPCID(317).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Halloween - }); - this.FindEntryByNPCID(318).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Halloween - }); - this.FindEntryByNPCID(320).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Halloween - }); - this.FindEntryByNPCID(321).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Halloween - }); - this.FindEntryByNPCID(319).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Halloween - }); - this.FindEntryByNPCID(324).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Halloween, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(322).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Halloween, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(323).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Halloween, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(302).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(521).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(332).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Christmas - }); - this.FindEntryByNPCID(331).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Christmas - }); - this.FindEntryByNPCID(335).Info.AddRange((IEnumerable) new IBestiaryInfoElement[3] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Christmas, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(336).Info.AddRange((IEnumerable) new IBestiaryInfoElement[3] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Christmas, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(333).Info.AddRange((IEnumerable) new IBestiaryInfoElement[3] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Christmas, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(334).Info.AddRange((IEnumerable) new IBestiaryInfoElement[3] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Christmas, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(535).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime - }); - this.FindEntryByNPCID(614).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Underground - }); - this.FindEntryByNPCID(225).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface - }); - this.FindEntryByNPCID(224).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface - }); - this.FindEntryByNPCID(250).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface - }); - this.FindEntryByNPCID(632).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Graveyard - }); - this.FindEntryByNPCID(631).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(634).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundMushroom - }); - this.FindEntryByNPCID(635).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundMushroom - }); - this.FindEntryByNPCID(636).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheHallow - }); - this.FindEntryByNPCID(639).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(640).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(641).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(642).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(643).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(644).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(645).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(646).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(647).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(648).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(649).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(650).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(651).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(652).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns - }); - this.FindEntryByNPCID(657).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheHallow - }); - this.FindEntryByNPCID(658).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheHallow - }); - this.FindEntryByNPCID(660).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheHallow - }); - this.FindEntryByNPCID(659).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheHallow - }); - this.FindEntryByNPCID(22).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface - }); - this.FindEntryByNPCID(17).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface - }); - this.FindEntryByNPCID(588).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface - }); - this.FindEntryByNPCID(441).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Snow - }); - this.FindEntryByNPCID(124).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Snow - }); - this.FindEntryByNPCID(209).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Snow - }); - this.FindEntryByNPCID(142).Info.AddRange((IEnumerable) new IBestiaryInfoElement[2] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Snow, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Christmas - }); - this.FindEntryByNPCID(207).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Desert - }); - this.FindEntryByNPCID(19).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Desert - }); - this.FindEntryByNPCID(178).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Desert - }); - this.FindEntryByNPCID(20).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle - }); - this.FindEntryByNPCID(228).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle - }); - this.FindEntryByNPCID(227).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle - }); - this.FindEntryByNPCID(369).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Ocean - }); - this.FindEntryByNPCID(229).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Ocean - }); - this.FindEntryByNPCID(353).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Ocean - }); - this.FindEntryByNPCID(38).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Underground - }); - this.FindEntryByNPCID(107).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Underground - }); - this.FindEntryByNPCID(54).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Underground - }); - this.FindEntryByNPCID(108).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheHallow - }); - this.FindEntryByNPCID(18).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheHallow - }); - this.FindEntryByNPCID(208).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheHallow - }); - this.FindEntryByNPCID(550).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheHallow - }); - this.FindEntryByNPCID(633).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface - }); - this.FindEntryByNPCID(160).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SurfaceMushroom - }); - this.FindEntryByNPCID(637).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface - }); - this.FindEntryByNPCID(638).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface - }); - this.FindEntryByNPCID(656).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface - }); - this.FindEntryByNPCID(368).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface - }); - this.FindEntryByNPCID(37).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon - }); - this.FindEntryByNPCID(453).Info.AddRange((IEnumerable) new IBestiaryInfoElement[1] - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Underground - }); - } - - private void AddNPCBiomeRelationships_AddDecorations_Automated() - { - foreach (KeyValuePair keyValuePair in ContentSamples.NpcsByNetId) - { - BestiaryEntry entryByNpcid = this.FindEntryByNPCID(keyValuePair.Key); - if (!entryByNpcid.Info.Contains((IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Rain)) - { - if (entryByNpcid.Info.Contains((IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Eclipse)) - entryByNpcid.AddTags((IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Visuals.EclipseSun); - if (entryByNpcid.Info.Contains((IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime)) - entryByNpcid.AddTags((IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Visuals.Moon); - if (entryByNpcid.Info.Contains((IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime)) - entryByNpcid.AddTags((IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Visuals.Sun); - if (entryByNpcid.Info.Contains((IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.PumpkinMoon)) - entryByNpcid.AddTags((IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Visuals.PumpkinMoon); - if (entryByNpcid.Info.Contains((IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.FrostMoon)) - entryByNpcid.AddTags((IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Visuals.FrostMoon); - if (entryByNpcid.Info.Contains((IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Meteor)) - { - entryByNpcid.AddTags((IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Visuals.Moon); - entryByNpcid.AddTags((IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Visuals.Meteor); - } - } - } - } - - public static class CommonTags - { - public static List GetCommonInfoElementsForFilters() => new List() - { - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Surface, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Party, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.WindyDay, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Rain, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.BloodMoon, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Graveyard, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Underground, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Caverns, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Granite, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Marble, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundMushroom, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SpiderNest, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Snow, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundSnow, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Desert, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundDesert, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Sandstorm, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Ocean, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundJungle, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Meteor, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheDungeon, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheUnderworld, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Sky, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCorruption, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundCorruption, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.CorruptIce, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.CorruptDesert, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.CorruptUndergroundDesert, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheCrimson, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundCrimson, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.CrimsonIce, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.CrimsonDesert, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.CrimsonUndergroundDesert, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheHallow, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.UndergroundHallow, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.HallowIce, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.HallowDesert, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.HallowUndergroundDesert, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SurfaceMushroom, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheTemple, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Goblins, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.OldOnesArmy, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Pirates, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.Martian, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Eclipse, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.PumpkinMoon, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.FrostMoon, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Halloween, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Christmas, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Invasions.FrostLegion, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.NebulaPillar, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.SolarPillar, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.VortexPillar, - (IBestiaryInfoElement) BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.StardustPillar - }; - - public static class SpawnConditions - { - public static class Invasions - { - public static SpawnConditionBestiaryInfoElement Goblins = new SpawnConditionBestiaryInfoElement("Bestiary_Invasions.Goblins", 49, "Images/MapBG1"); - public static SpawnConditionBestiaryInfoElement Pirates = new SpawnConditionBestiaryInfoElement("Bestiary_Invasions.Pirates", 50, "Images/MapBG11"); - public static SpawnConditionBestiaryInfoElement Martian = new SpawnConditionBestiaryInfoElement("Bestiary_Invasions.Martian", 53, "Images/MapBG1", new Color?(new Color(35, 40, 40))); - public static SpawnConditionBestiaryInfoElement OldOnesArmy = new SpawnConditionBestiaryInfoElement("Bestiary_Invasions.OldOnesArmy", 55, "Images/MapBG1"); - public static SpawnConditionBestiaryInfoElement PumpkinMoon = new SpawnConditionBestiaryInfoElement("Bestiary_Invasions.PumpkinMoon", 51, "Images/MapBG1", new Color?(new Color(35, 40, 40))); - public static SpawnConditionBestiaryInfoElement FrostMoon = new SpawnConditionBestiaryInfoElement("Bestiary_Invasions.FrostMoon", 52, "Images/MapBG12", new Color?(new Color(35, 40, 40))); - public static SpawnConditionBestiaryInfoElement FrostLegion = new SpawnConditionBestiaryInfoElement("Bestiary_Invasions.FrostLegion", 54, "Images/MapBG12"); - } - - public static class Events - { - public static SpawnConditionBestiaryInfoElement SlimeRain; - public static SpawnConditionBestiaryInfoElement WindyDay; - public static SpawnConditionBestiaryInfoElement BloodMoon; - public static SpawnConditionBestiaryInfoElement Halloween; - public static SpawnConditionBestiaryOverlayInfoElement Rain; - public static SpawnConditionBestiaryInfoElement Christmas; - public static SpawnConditionBestiaryInfoElement Eclipse; - public static SpawnConditionBestiaryInfoElement Party; - public static SpawnConditionBestiaryOverlayInfoElement Blizzard; - public static SpawnConditionBestiaryOverlayInfoElement Sandstorm; - - static Events() - { - SpawnConditionBestiaryInfoElement bestiaryInfoElement1 = new SpawnConditionBestiaryInfoElement("Bestiary_Events.SlimeRain", 47, "Images/MapBG1"); - bestiaryInfoElement1.DisplayTextPriority = 1; - BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.SlimeRain = bestiaryInfoElement1; - SpawnConditionBestiaryInfoElement bestiaryInfoElement2 = new SpawnConditionBestiaryInfoElement("Bestiary_Events.WindyDay", 41, "Images/MapBG1"); - bestiaryInfoElement2.DisplayTextPriority = 1; - BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.WindyDay = bestiaryInfoElement2; - SpawnConditionBestiaryInfoElement bestiaryInfoElement3 = new SpawnConditionBestiaryInfoElement("Bestiary_Events.BloodMoon", 38, "Images/MapBG26", new Color?(new Color(200, 190, 180))); - bestiaryInfoElement3.DisplayTextPriority = 1; - BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.BloodMoon = bestiaryInfoElement3; - SpawnConditionBestiaryInfoElement bestiaryInfoElement4 = new SpawnConditionBestiaryInfoElement("Bestiary_Events.Halloween", 45, "Images/MapBG1"); - bestiaryInfoElement4.DisplayTextPriority = 1; - BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Halloween = bestiaryInfoElement4; - SpawnConditionBestiaryOverlayInfoElement overlayInfoElement1 = new SpawnConditionBestiaryOverlayInfoElement("Bestiary_Events.Rain", 40, "Images/MapBGOverlay2", new Color?(new Color(200, 200, 200))); - overlayInfoElement1.DisplayTextPriority = 1; - BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Rain = overlayInfoElement1; - SpawnConditionBestiaryInfoElement bestiaryInfoElement5 = new SpawnConditionBestiaryInfoElement("Bestiary_Events.Christmas", 46, "Images/MapBG12"); - bestiaryInfoElement5.DisplayTextPriority = 1; - BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Christmas = bestiaryInfoElement5; - SpawnConditionBestiaryInfoElement bestiaryInfoElement6 = new SpawnConditionBestiaryInfoElement("Bestiary_Events.Eclipse", 39, "Images/MapBG1", new Color?(new Color(60, 30, 0))); - bestiaryInfoElement6.DisplayTextPriority = 1; - BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Eclipse = bestiaryInfoElement6; - SpawnConditionBestiaryInfoElement bestiaryInfoElement7 = new SpawnConditionBestiaryInfoElement("Bestiary_Events.Party", 48, "Images/MapBG1"); - bestiaryInfoElement7.DisplayTextPriority = 1; - BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Party = bestiaryInfoElement7; - SpawnConditionBestiaryOverlayInfoElement overlayInfoElement2 = new SpawnConditionBestiaryOverlayInfoElement("Bestiary_Events.Blizzard", 42, "Images/MapBGOverlay6", new Color?(Color.White)); - overlayInfoElement2.DisplayTextPriority = 1; - BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Blizzard = overlayInfoElement2; - SpawnConditionBestiaryOverlayInfoElement overlayInfoElement3 = new SpawnConditionBestiaryOverlayInfoElement("Bestiary_Events.Sandstorm", 43, "Images/MapBGOverlay1", new Color?(Color.White)); - overlayInfoElement3.DisplayTextPriority = 1; - BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Events.Sandstorm = overlayInfoElement3; - } - } - - public static class Biomes - { - public static SpawnConditionBestiaryInfoElement TheCorruption = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.TheCorruption", 7, "Images/MapBG6", new Color?(new Color(200, 200, 200))); - public static SpawnConditionBestiaryInfoElement TheCrimson = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.Crimson", 12, "Images/MapBG7", new Color?(new Color(200, 200, 200))); - public static SpawnConditionBestiaryInfoElement Surface = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.Surface", 0, "Images/MapBG1"); - public static SpawnConditionBestiaryInfoElement Graveyard = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.Graveyard", 35, "Images/MapBG27"); - public static SpawnConditionBestiaryInfoElement UndergroundJungle = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.UndergroundJungle", 23, "Images/MapBG13"); - public static SpawnConditionBestiaryInfoElement TheUnderworld = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.TheUnderworld", 33, "Images/MapBG3"); - public static SpawnConditionBestiaryInfoElement TheDungeon = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.TheDungeon", 32, "Images/MapBG5"); - public static SpawnConditionBestiaryInfoElement Underground = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.Underground", 1, "Images/MapBG2"); - public static SpawnConditionBestiaryInfoElement TheHallow = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.TheHallow", 17, "Images/MapBG8"); - public static SpawnConditionBestiaryInfoElement UndergroundMushroom = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.UndergroundMushroom", 25, "Images/MapBG21"); - public static SpawnConditionBestiaryInfoElement Jungle = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.Jungle", 22, "Images/MapBG9"); - public static SpawnConditionBestiaryInfoElement Caverns = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.Caverns", 2, "Images/MapBG32"); - public static SpawnConditionBestiaryInfoElement UndergroundSnow = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.UndergroundSnow", 6, "Images/MapBG4"); - public static SpawnConditionBestiaryInfoElement Ocean = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.Ocean", 28, "Images/MapBG11"); - public static SpawnConditionBestiaryInfoElement SurfaceMushroom = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.SurfaceMushroom", 24, "Images/MapBG20"); - public static SpawnConditionBestiaryInfoElement UndergroundDesert = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.UndergroundDesert", 4, "Images/MapBG15"); - public static SpawnConditionBestiaryInfoElement Snow = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.Snow", 5, "Images/MapBG12"); - public static SpawnConditionBestiaryInfoElement Desert = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.Desert", 3, "Images/MapBG10"); - public static SpawnConditionBestiaryInfoElement Meteor = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.Meteor", 44, "Images/MapBG1", new Color?(new Color(35, 40, 40))); - public static SpawnConditionBestiaryInfoElement Oasis = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.Oasis", 27, "Images/MapBG10"); - public static SpawnConditionBestiaryInfoElement SpiderNest = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.SpiderNest", 34, "Images/MapBG19"); - public static SpawnConditionBestiaryInfoElement TheTemple = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.TheTemple", 31, "Images/MapBG14"); - public static SpawnConditionBestiaryInfoElement CorruptUndergroundDesert = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.CorruptUndergroundDesert", 10, "Images/MapBG40"); - public static SpawnConditionBestiaryInfoElement CrimsonUndergroundDesert = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.CrimsonUndergroundDesert", 15, "Images/MapBG41"); - public static SpawnConditionBestiaryInfoElement HallowUndergroundDesert = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.HallowUndergroundDesert", 20, "Images/MapBG42"); - public static SpawnConditionBestiaryInfoElement CorruptDesert = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.CorruptDesert", 9, "Images/MapBG37"); - public static SpawnConditionBestiaryInfoElement CrimsonDesert = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.CrimsonDesert", 14, "Images/MapBG38"); - public static SpawnConditionBestiaryInfoElement HallowDesert = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.HallowDesert", 19, "Images/MapBG39"); - public static SpawnConditionBestiaryInfoElement Granite = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.Granite", 30, "Images/MapBG17", new Color?(new Color(100, 100, 100))); - public static SpawnConditionBestiaryInfoElement UndergroundCorruption = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.UndergroundCorruption", 8, "Images/MapBG23"); - public static SpawnConditionBestiaryInfoElement UndergroundCrimson = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.UndergroundCrimson", 13, "Images/MapBG24"); - public static SpawnConditionBestiaryInfoElement UndergroundHallow = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.UndergroundHallow", 18, "Images/MapBG22"); - public static SpawnConditionBestiaryInfoElement Marble = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.Marble", 29, "Images/MapBG18"); - public static SpawnConditionBestiaryInfoElement CorruptIce = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.CorruptIce", 11, "Images/MapBG34", new Color?(new Color(200, 200, 200))); - public static SpawnConditionBestiaryInfoElement HallowIce = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.HallowIce", 21, "Images/MapBG36", new Color?(new Color(200, 200, 200))); - public static SpawnConditionBestiaryInfoElement CrimsonIce = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.CrimsonIce", 16, "Images/MapBG35", new Color?(new Color(200, 200, 200))); - public static SpawnConditionBestiaryInfoElement Sky = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.Sky", 26, "Images/MapBG33"); - public static SpawnConditionBestiaryInfoElement NebulaPillar = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.NebulaPillar", 58, "Images/MapBG28"); - public static SpawnConditionBestiaryInfoElement SolarPillar = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.SolarPillar", 56, "Images/MapBG29"); - public static SpawnConditionBestiaryInfoElement VortexPillar = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.VortexPillar", 57, "Images/MapBG30"); - public static SpawnConditionBestiaryInfoElement StardustPillar = new SpawnConditionBestiaryInfoElement("Bestiary_Biomes.StardustPillar", 59, "Images/MapBG31"); - } - - public static class Times - { - public static SpawnConditionBestiaryInfoElement DayTime; - public static SpawnConditionBestiaryInfoElement NightTime; - - static Times() - { - SpawnConditionBestiaryInfoElement bestiaryInfoElement1 = new SpawnConditionBestiaryInfoElement("Bestiary_Times.DayTime", 36); - bestiaryInfoElement1.DisplayTextPriority = -1; - BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.DayTime = bestiaryInfoElement1; - SpawnConditionBestiaryInfoElement bestiaryInfoElement2 = new SpawnConditionBestiaryInfoElement("Bestiary_Times.NightTime", 37, "Images/MapBG1", new Color?(new Color(35, 40, 40))); - bestiaryInfoElement2.DisplayTextPriority = -1; - BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime = bestiaryInfoElement2; - } - } - - public static class Visuals - { - public static SpawnConditionDecorativeOverlayInfoElement Sun = new SpawnConditionDecorativeOverlayInfoElement("Images/MapBGOverlay3", new Color?(Color.White)) - { - DisplayPriority = 1f - }; - public static SpawnConditionDecorativeOverlayInfoElement Moon = new SpawnConditionDecorativeOverlayInfoElement("Images/MapBGOverlay4", new Color?(Color.White)) - { - DisplayPriority = 1f - }; - public static SpawnConditionDecorativeOverlayInfoElement EclipseSun = new SpawnConditionDecorativeOverlayInfoElement("Images/MapBGOverlay5", new Color?(Color.White)) - { - DisplayPriority = 1f - }; - public static SpawnConditionDecorativeOverlayInfoElement PumpkinMoon = new SpawnConditionDecorativeOverlayInfoElement("Images/MapBGOverlay8", new Color?(Color.White)) - { - DisplayPriority = 1f - }; - public static SpawnConditionDecorativeOverlayInfoElement FrostMoon = new SpawnConditionDecorativeOverlayInfoElement("Images/MapBGOverlay9", new Color?(Color.White)) - { - DisplayPriority = 1f - }; - public static SpawnConditionDecorativeOverlayInfoElement Meteor = new SpawnConditionDecorativeOverlayInfoElement("Images/MapBGOverlay7", new Color?(Color.White)) - { - DisplayPriority = 1f - }; - } - } - } - - public static class Conditions - { - public static bool ReachHardMode() => Main.hardMode; - } - - public static class CrownosIconIndexes - { - public const int Surface = 0; - public const int Underground = 1; - public const int Cave = 2; - public const int Desert = 3; - public const int UndergroundDesert = 4; - public const int Snow = 5; - public const int UndergroundIce = 6; - public const int Corruption = 7; - public const int CorruptionUnderground = 8; - public const int CorruptionDesert = 9; - public const int CorruptionUndergroundDesert = 10; - public const int CorruptionIce = 11; - public const int Crimson = 12; - public const int CrimsonUnderground = 13; - public const int CrimsonDesert = 14; - public const int CrimsonUndergroundDesert = 15; - public const int CrimsonIce = 16; - public const int Hallow = 17; - public const int HallowUnderground = 18; - public const int HallowDesert = 19; - public const int HallowUndergroundDesert = 20; - public const int HallowIce = 21; - public const int Jungle = 22; - public const int UndergroundJungle = 23; - public const int SurfaceMushroom = 24; - public const int UndergroundMushroom = 25; - public const int Sky = 26; - public const int Oasis = 27; - public const int Ocean = 28; - public const int Marble = 29; - public const int Granite = 30; - public const int JungleTemple = 31; - public const int Dungeon = 32; - public const int Underworld = 33; - public const int SpiderNest = 34; - public const int Graveyard = 35; - public const int Day = 36; - public const int Night = 37; - public const int BloodMoon = 38; - public const int Eclipse = 39; - public const int Rain = 40; - public const int WindyDay = 41; - public const int Blizzard = 42; - public const int Sandstorm = 43; - public const int Meteor = 44; - public const int Halloween = 45; - public const int Christmas = 46; - public const int SlimeRain = 47; - public const int Party = 48; - public const int GoblinInvasion = 49; - public const int PirateInvasion = 50; - public const int PumpkinMoon = 51; - public const int FrostMoon = 52; - public const int AlienInvasion = 53; - public const int FrostLegion = 54; - public const int OldOnesArmy = 55; - public const int SolarTower = 56; - public const int VortexTower = 57; - public const int NebulaTower = 58; - public const int StardustTower = 59; - public const int Hardmode = 60; - public const int ItemSpawn = 61; - } - } -} diff --git a/GameContent/Bestiary/BestiaryEntry.cs b/GameContent/Bestiary/BestiaryEntry.cs deleted file mode 100644 index 5f968ae..0000000 --- a/GameContent/Bestiary/BestiaryEntry.cs +++ /dev/null @@ -1,109 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.BestiaryEntry -// 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 Terraria.ID; -using Terraria.Localization; - -namespace Terraria.GameContent.Bestiary -{ - public class BestiaryEntry - { - public IEntryIcon Icon; - public IBestiaryUICollectionInfoProvider UIInfoProvider; - - public List Info { get; private set; } - - public BestiaryEntry() => this.Info = new List(); - - public static BestiaryEntry Enemy(int npcNetId) - { - NPC npc = ContentSamples.NpcsByNetId[npcNetId]; - List bestiaryInfoElementList = new List() - { - (IBestiaryInfoElement) new NPCNetIdBestiaryInfoElement(npcNetId), - (IBestiaryInfoElement) new NamePlateInfoElement(Lang.GetNPCName(npcNetId).Key, npcNetId), - (IBestiaryInfoElement) new NPCPortraitInfoElement(new int?(ContentSamples.NpcBestiaryRarityStars[npcNetId])) - }; - foreach (int key in Main.RegisterdGameModes.Keys) - bestiaryInfoElementList.Add((IBestiaryInfoElement) new NPCStatsReportInfoElement(npcNetId, key)); - if (npc.rarity != 0) - bestiaryInfoElementList.Add((IBestiaryInfoElement) new RareSpawnBestiaryInfoElement(npc.rarity)); - IBestiaryUICollectionInfoProvider collectionInfoProvider; - if (npc.boss || NPCID.Sets.ShouldBeCountedAsBoss[npc.type]) - { - bestiaryInfoElementList.Add((IBestiaryInfoElement) new BossBestiaryInfoElement()); - collectionInfoProvider = (IBestiaryUICollectionInfoProvider) new CommonEnemyUICollectionInfoProvider(npc.GetBestiaryCreditId(), true); - } - else - collectionInfoProvider = (IBestiaryUICollectionInfoProvider) new CommonEnemyUICollectionInfoProvider(npc.GetBestiaryCreditId(), false); - string str = "Bestiary_FlavorText.npc_" + Lang.GetNPCName(npc.netID).Key.Replace("NPCName.", ""); - if (Language.Exists(str)) - bestiaryInfoElementList.Add((IBestiaryInfoElement) new FlavorTextBestiaryInfoElement(str)); - return new BestiaryEntry() - { - Icon = (IEntryIcon) new UnlockableNPCEntryIcon(npcNetId), - Info = bestiaryInfoElementList, - UIInfoProvider = collectionInfoProvider - }; - } - - public static BestiaryEntry TownNPC(int npcNetId) - { - NPC npc = ContentSamples.NpcsByNetId[npcNetId]; - List bestiaryInfoElementList = new List() - { - (IBestiaryInfoElement) new NPCNetIdBestiaryInfoElement(npcNetId), - (IBestiaryInfoElement) new NamePlateInfoElement(Lang.GetNPCName(npcNetId).Key, npcNetId), - (IBestiaryInfoElement) new NPCPortraitInfoElement(new int?(ContentSamples.NpcBestiaryRarityStars[npcNetId])) - }; - string str = "Bestiary_FlavorText.npc_" + Lang.GetNPCName(npc.netID).Key.Replace("NPCName.", ""); - if (Language.Exists(str)) - bestiaryInfoElementList.Add((IBestiaryInfoElement) new FlavorTextBestiaryInfoElement(str)); - return new BestiaryEntry() - { - Icon = (IEntryIcon) new UnlockableNPCEntryIcon(npcNetId), - Info = bestiaryInfoElementList, - UIInfoProvider = (IBestiaryUICollectionInfoProvider) new TownNPCUICollectionInfoProvider(npc.GetBestiaryCreditId()) - }; - } - - public static BestiaryEntry Critter(int npcNetId) - { - NPC npc = ContentSamples.NpcsByNetId[npcNetId]; - List bestiaryInfoElementList = new List() - { - (IBestiaryInfoElement) new NPCNetIdBestiaryInfoElement(npcNetId), - (IBestiaryInfoElement) new NamePlateInfoElement(Lang.GetNPCName(npcNetId).Key, npcNetId), - (IBestiaryInfoElement) new NPCPortraitInfoElement(new int?(ContentSamples.NpcBestiaryRarityStars[npcNetId])) - }; - string str = "Bestiary_FlavorText.npc_" + Lang.GetNPCName(npc.netID).Key.Replace("NPCName.", ""); - if (Language.Exists(str)) - bestiaryInfoElementList.Add((IBestiaryInfoElement) new FlavorTextBestiaryInfoElement(str)); - return new BestiaryEntry() - { - Icon = (IEntryIcon) new UnlockableNPCEntryIcon(npcNetId), - Info = bestiaryInfoElementList, - UIInfoProvider = (IBestiaryUICollectionInfoProvider) new CritterUICollectionInfoProvider(npc.GetBestiaryCreditId()) - }; - } - - public static BestiaryEntry Biome( - string nameLanguageKey, - string texturePath, - Func unlockCondition) - { - return new BestiaryEntry() - { - Icon = (IEntryIcon) new CustomEntryIcon(nameLanguageKey, texturePath, unlockCondition), - Info = new List() - }; - } - - public void AddTags(params IBestiaryInfoElement[] elements) => this.Info.AddRange((IEnumerable) elements); - } -} diff --git a/GameContent/Bestiary/BestiaryEntryUnlockState.cs b/GameContent/Bestiary/BestiaryEntryUnlockState.cs deleted file mode 100644 index a2f41f0..0000000 --- a/GameContent/Bestiary/BestiaryEntryUnlockState.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.BestiaryEntryUnlockState -// 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.Bestiary -{ - public enum BestiaryEntryUnlockState - { - NotKnownAtAll_0, - CanShowPortraitOnly_1, - CanShowStats_2, - CanShowDropsWithoutDropRates_3, - CanShowDropsWithDropRates_4, - } -} diff --git a/GameContent/Bestiary/BestiaryPortraitBackgroundBasedOnWorldEvilProvider.cs b/GameContent/Bestiary/BestiaryPortraitBackgroundBasedOnWorldEvilProvider.cs deleted file mode 100644 index 83dc8dc..0000000 --- a/GameContent/Bestiary/BestiaryPortraitBackgroundBasedOnWorldEvilProvider.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.BestiaryPortraitBackgroundBasedOnWorldEvilProviderPreferenceInfoElement -// 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 Terraria.UI; - -namespace Terraria.GameContent.Bestiary -{ - public class BestiaryPortraitBackgroundBasedOnWorldEvilProviderPreferenceInfoElement : - IPreferenceProviderElement, - IBestiaryInfoElement - { - private IBestiaryBackgroundImagePathAndColorProvider _preferredProviderCorrupt; - private IBestiaryBackgroundImagePathAndColorProvider _preferredProviderCrimson; - - public BestiaryPortraitBackgroundBasedOnWorldEvilProviderPreferenceInfoElement( - IBestiaryBackgroundImagePathAndColorProvider preferredProviderCorrupt, - IBestiaryBackgroundImagePathAndColorProvider preferredProviderCrimson) - { - this._preferredProviderCorrupt = preferredProviderCorrupt; - this._preferredProviderCrimson = preferredProviderCrimson; - } - - public UIElement ProvideUIElement(BestiaryUICollectionInfo info) => (UIElement) null; - - public bool Matches( - IBestiaryBackgroundImagePathAndColorProvider provider) - { - return Main.ActiveWorldFileData == null || !WorldGen.crimson ? provider == this._preferredProviderCorrupt : provider == this._preferredProviderCrimson; - } - - public IBestiaryBackgroundImagePathAndColorProvider GetPreferredProvider() => Main.ActiveWorldFileData == null || !WorldGen.crimson ? this._preferredProviderCorrupt : this._preferredProviderCrimson; - } -} diff --git a/GameContent/Bestiary/BestiaryPortraitBackgroundProviderPreferenceInfoEl.cs b/GameContent/Bestiary/BestiaryPortraitBackgroundProviderPreferenceInfoEl.cs deleted file mode 100644 index 538af01..0000000 --- a/GameContent/Bestiary/BestiaryPortraitBackgroundProviderPreferenceInfoEl.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.BestiaryPortraitBackgroundProviderPreferenceInfoElement -// 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 Terraria.UI; - -namespace Terraria.GameContent.Bestiary -{ - public class BestiaryPortraitBackgroundProviderPreferenceInfoElement : - IPreferenceProviderElement, - IBestiaryInfoElement - { - private IBestiaryBackgroundImagePathAndColorProvider _preferredProvider; - - public BestiaryPortraitBackgroundProviderPreferenceInfoElement( - IBestiaryBackgroundImagePathAndColorProvider preferredProvider) - { - this._preferredProvider = preferredProvider; - } - - public UIElement ProvideUIElement(BestiaryUICollectionInfo info) => (UIElement) null; - - public bool Matches( - IBestiaryBackgroundImagePathAndColorProvider provider) - { - return provider == this._preferredProvider; - } - - public IBestiaryBackgroundImagePathAndColorProvider GetPreferredProvider() => this._preferredProvider; - } -} diff --git a/GameContent/Bestiary/BestiaryUICollectionInfo.cs b/GameContent/Bestiary/BestiaryUICollectionInfo.cs deleted file mode 100644 index 6f6205a..0000000 --- a/GameContent/Bestiary/BestiaryUICollectionInfo.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.BestiaryUICollectionInfo -// 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.Bestiary -{ - public struct BestiaryUICollectionInfo - { - public BestiaryEntry OwnerEntry; - public BestiaryEntryUnlockState UnlockState; - } -} diff --git a/GameContent/Bestiary/BestiaryUnlockProgressReport.cs b/GameContent/Bestiary/BestiaryUnlockProgressReport.cs deleted file mode 100644 index bd152ed..0000000 --- a/GameContent/Bestiary/BestiaryUnlockProgressReport.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.BestiaryUnlockProgressReport -// 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.Bestiary -{ - public struct BestiaryUnlockProgressReport - { - public int EntriesTotal; - public float CompletionAmountTotal; - - public float CompletionPercent => this.EntriesTotal == 0 ? 1f : this.CompletionAmountTotal / (float) this.EntriesTotal; - } -} diff --git a/GameContent/Bestiary/BestiaryUnlocksTracker.cs b/GameContent/Bestiary/BestiaryUnlocksTracker.cs deleted file mode 100644 index 91f9425..0000000 --- a/GameContent/Bestiary/BestiaryUnlocksTracker.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.BestiaryUnlocksTracker -// 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.IO; - -namespace Terraria.GameContent.Bestiary -{ - public class BestiaryUnlocksTracker : IPersistentPerWorldContent, IOnPlayerJoining - { - public NPCKillsTracker Kills = new NPCKillsTracker(); - public NPCWasNearPlayerTracker Sights = new NPCWasNearPlayerTracker(); - public NPCWasChatWithTracker Chats = new NPCWasChatWithTracker(); - - public void Save(BinaryWriter writer) - { - this.Kills.Save(writer); - this.Sights.Save(writer); - this.Chats.Save(writer); - } - - public void Load(BinaryReader reader, int gameVersionSaveWasMadeOn) - { - this.Kills.Load(reader, gameVersionSaveWasMadeOn); - this.Sights.Load(reader, gameVersionSaveWasMadeOn); - this.Chats.Load(reader, gameVersionSaveWasMadeOn); - } - - public void ValidateWorld(BinaryReader reader, int gameVersionSaveWasMadeOn) - { - this.Kills.ValidateWorld(reader, gameVersionSaveWasMadeOn); - this.Sights.ValidateWorld(reader, gameVersionSaveWasMadeOn); - this.Chats.ValidateWorld(reader, gameVersionSaveWasMadeOn); - } - - public void Reset() - { - this.Kills.Reset(); - this.Sights.Reset(); - this.Chats.Reset(); - } - - public void OnPlayerJoining(int playerIndex) - { - this.Kills.OnPlayerJoining(playerIndex); - this.Sights.OnPlayerJoining(playerIndex); - this.Chats.OnPlayerJoining(playerIndex); - } - - public void FillBasedOnVersionBefore210() - { - } - } -} diff --git a/GameContent/Bestiary/BossBestiaryInfoElement.cs b/GameContent/Bestiary/BossBestiaryInfoElement.cs deleted file mode 100644 index 77e5d72..0000000 --- a/GameContent/Bestiary/BossBestiaryInfoElement.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.BossBestiaryInfoElement -// 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 Terraria.Localization; -using Terraria.UI; - -namespace Terraria.GameContent.Bestiary -{ - public class BossBestiaryInfoElement : IBestiaryInfoElement, IProvideSearchFilterString - { - public UIElement ProvideUIElement(BestiaryUICollectionInfo info) => (UIElement) null; - - public string GetSearchString(ref BestiaryUICollectionInfo info) => info.UnlockState < BestiaryEntryUnlockState.CanShowPortraitOnly_1 ? (string) null : Language.GetText("BestiaryInfo.IsBoss").Value; - } -} diff --git a/GameContent/Bestiary/CommonEnemyUICollectionInfoProvider.cs b/GameContent/Bestiary/CommonEnemyUICollectionInfoProvider.cs deleted file mode 100644 index ed13c49..0000000 --- a/GameContent/Bestiary/CommonEnemyUICollectionInfoProvider.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.CommonEnemyUICollectionInfoProvider -// 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 Terraria.UI; - -namespace Terraria.GameContent.Bestiary -{ - public class CommonEnemyUICollectionInfoProvider : IBestiaryUICollectionInfoProvider - { - private string _persistentIdentifierToCheck; - private bool _quickUnlock; - - public CommonEnemyUICollectionInfoProvider(string persistentId, bool quickUnlock) - { - this._persistentIdentifierToCheck = persistentId; - this._quickUnlock = quickUnlock; - } - - public BestiaryUICollectionInfo GetEntryUICollectionInfo() - { - BestiaryEntryUnlockState stateByKillCount = CommonEnemyUICollectionInfoProvider.GetUnlockStateByKillCount(Main.BestiaryTracker.Kills.GetKillCount(this._persistentIdentifierToCheck), this._quickUnlock); - return new BestiaryUICollectionInfo() - { - UnlockState = stateByKillCount - }; - } - - public static BestiaryEntryUnlockState GetUnlockStateByKillCount( - int killCount, - bool quickUnlock) - { - return !quickUnlock || killCount <= 0 ? (killCount < 50 ? (killCount < 25 ? (killCount < 10 ? (killCount < 1 ? BestiaryEntryUnlockState.NotKnownAtAll_0 : BestiaryEntryUnlockState.CanShowPortraitOnly_1) : BestiaryEntryUnlockState.CanShowStats_2) : BestiaryEntryUnlockState.CanShowDropsWithoutDropRates_3) : BestiaryEntryUnlockState.CanShowDropsWithDropRates_4) : BestiaryEntryUnlockState.CanShowDropsWithDropRates_4; - } - - public UIElement ProvideUIElement(BestiaryUICollectionInfo info) => (UIElement) null; - } -} diff --git a/GameContent/Bestiary/CritterUICollectionInfoProvider.cs b/GameContent/Bestiary/CritterUICollectionInfoProvider.cs deleted file mode 100644 index a667265..0000000 --- a/GameContent/Bestiary/CritterUICollectionInfoProvider.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.CritterUICollectionInfoProvider -// 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 Terraria.UI; - -namespace Terraria.GameContent.Bestiary -{ - public class CritterUICollectionInfoProvider : IBestiaryUICollectionInfoProvider - { - private string _persistentIdentifierToCheck; - - public CritterUICollectionInfoProvider(string persistentId) => this._persistentIdentifierToCheck = persistentId; - - public BestiaryUICollectionInfo GetEntryUICollectionInfo() => new BestiaryUICollectionInfo() - { - UnlockState = Main.BestiaryTracker.Sights.GetWasNearbyBefore(this._persistentIdentifierToCheck) ? BestiaryEntryUnlockState.CanShowDropsWithDropRates_4 : BestiaryEntryUnlockState.NotKnownAtAll_0 - }; - - public UIElement ProvideUIElement(BestiaryUICollectionInfo info) => (UIElement) null; - } -} diff --git a/GameContent/Bestiary/CustomEntryIcon.cs b/GameContent/Bestiary/CustomEntryIcon.cs deleted file mode 100644 index bdb6f59..0000000 --- a/GameContent/Bestiary/CustomEntryIcon.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.CustomEntryIcon -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using System; -using Terraria.Localization; - -namespace Terraria.GameContent.Bestiary -{ - public class CustomEntryIcon : IEntryIcon - { - private LocalizedText _text; - private Asset _textureAsset; - private Rectangle _sourceRectangle; - private Func _unlockCondition; - - public CustomEntryIcon(string nameLanguageKey, string texturePath, Func unlockCondition) - { - this._text = Language.GetText(nameLanguageKey); - this._textureAsset = Main.Assets.Request(texturePath, (AssetRequestMode) 1); - this._unlockCondition = unlockCondition; - this.UpdateUnlockState(false); - } - - public IEntryIcon CreateClone() => (IEntryIcon) new CustomEntryIcon(this._text.Key, this._textureAsset.Name, this._unlockCondition); - - public void Update( - BestiaryUICollectionInfo providedInfo, - Rectangle hitbox, - EntryIconDrawSettings settings) - { - this.UpdateUnlockState(this.GetUnlockState(providedInfo)); - } - - public void Draw( - BestiaryUICollectionInfo providedInfo, - SpriteBatch spriteBatch, - EntryIconDrawSettings settings) - { - Rectangle iconbox = settings.iconbox; - spriteBatch.Draw(this._textureAsset.Value, iconbox.Center.ToVector2() + Vector2.One, new Rectangle?(this._sourceRectangle), Color.White, 0.0f, this._sourceRectangle.Size() / 2f, 1f, SpriteEffects.None, 0.0f); - } - - public string GetHoverText(BestiaryUICollectionInfo providedInfo) => this.GetUnlockState(providedInfo) ? this._text.Value : "???"; - - private void UpdateUnlockState(bool state) - { - this._sourceRectangle = this._textureAsset.Frame(2, frameX: state.ToInt()); - this._sourceRectangle.Inflate(-2, -2); - } - - public bool GetUnlockState(BestiaryUICollectionInfo providedInfo) => providedInfo.UnlockState > BestiaryEntryUnlockState.NotKnownAtAll_0; - } -} diff --git a/GameContent/Bestiary/EntryIconDrawSettings.cs b/GameContent/Bestiary/EntryIconDrawSettings.cs deleted file mode 100644 index c1c012b..0000000 --- a/GameContent/Bestiary/EntryIconDrawSettings.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.EntryIconDrawSettings -// 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.Bestiary -{ - public struct EntryIconDrawSettings - { - public bool IsPortrait; - public bool IsHovered; - public Rectangle iconbox; - } -} diff --git a/GameContent/Bestiary/FilterProviderInfoElement.cs b/GameContent/Bestiary/FilterProviderInfoElement.cs deleted file mode 100644 index add41fa..0000000 --- a/GameContent/Bestiary/FilterProviderInfoElement.cs +++ /dev/null @@ -1,88 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.FilterProviderInfoElement -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria.GameContent.UI.Elements; -using Terraria.Localization; -using Terraria.UI; - -namespace Terraria.GameContent.Bestiary -{ - public class FilterProviderInfoElement : - IFilterInfoProvider, - IProvideSearchFilterString, - IBestiaryInfoElement - { - private const int framesPerRow = 16; - private const int framesPerColumn = 5; - private Point _filterIconFrame; - private string _key; - - public int DisplayTextPriority { get; set; } - - public FilterProviderInfoElement(string nameLanguageKey, int filterIconFrame) - { - this._key = nameLanguageKey; - this._filterIconFrame.X = filterIconFrame % 16; - this._filterIconFrame.Y = filterIconFrame / 16; - } - - public UIElement GetFilterImage() - { - Asset asset = Main.Assets.Request("Images/UI/Bestiary/Icon_Tags_Shadow", (AssetRequestMode) 1); - UIImageFramed uiImageFramed = new UIImageFramed(asset, asset.Frame(16, 5, this._filterIconFrame.X, this._filterIconFrame.Y)); - uiImageFramed.HAlign = 0.5f; - uiImageFramed.VAlign = 0.5f; - return (UIElement) uiImageFramed; - } - - public string GetSearchString(ref BestiaryUICollectionInfo info) => info.UnlockState == BestiaryEntryUnlockState.NotKnownAtAll_0 ? (string) null : Language.GetText(this._key).Value; - - public string GetDisplayNameKey() => this._key; - - public UIElement ProvideUIElement(BestiaryUICollectionInfo info) - { - if (info.UnlockState == BestiaryEntryUnlockState.NotKnownAtAll_0) - return (UIElement) null; - UIPanel uiPanel = new UIPanel(Main.Assets.Request("Images/UI/Bestiary/Stat_Panel", (AssetRequestMode) 1), (Asset) null, customBarSize: 7); - uiPanel.Width = new StyleDimension(-14f, 1f); - uiPanel.Height = new StyleDimension(34f, 0.0f); - uiPanel.BackgroundColor = new Color(43, 56, 101); - uiPanel.BorderColor = Color.Transparent; - uiPanel.Left = new StyleDimension(5f, 0.0f); - UIElement button = (UIElement) uiPanel; - button.SetPadding(0.0f); - button.PaddingRight = 5f; - UIElement filterImage = this.GetFilterImage(); - filterImage.HAlign = 0.0f; - filterImage.Left = new StyleDimension(5f, 0.0f); - UIText uiText1 = new UIText(Language.GetText(this.GetDisplayNameKey()), 0.8f); - uiText1.HAlign = 0.0f; - uiText1.Left = new StyleDimension(38f, 0.0f); - uiText1.TextOriginX = 0.0f; - uiText1.VAlign = 0.5f; - uiText1.DynamicallyScaleDownToWidth = true; - UIText uiText2 = uiText1; - if (filterImage != null) - button.Append(filterImage); - button.Append((UIElement) uiText2); - this.AddOnHover(button); - return button; - } - - private void AddOnHover(UIElement button) => button.OnUpdate += (UIElement.ElementEvent) (e => this.ShowButtonName(e)); - - private void ShowButtonName(UIElement element) - { - if (!element.IsMouseHovering) - return; - string textValue = Language.GetTextValue(this.GetDisplayNameKey()); - Main.instance.MouseText(textValue); - } - } -} diff --git a/GameContent/Bestiary/Filters.cs b/GameContent/Bestiary/Filters.cs deleted file mode 100644 index f4bad75..0000000 --- a/GameContent/Bestiary/Filters.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.Filters -// 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.Graphics; -using ReLogic.Content; -using System; -using Terraria.DataStructures; -using Terraria.GameContent.UI.Elements; -using Terraria.UI; - -namespace Terraria.GameContent.Bestiary -{ - public static class Filters - { - public class BySearch : - IBestiaryEntryFilter, - IEntryFilter, - ISearchFilter - { - private string _search; - - public bool? ForcedDisplay => new bool?(true); - - public bool FitsFilter(BestiaryEntry entry) - { - if (this._search == null) - return true; - BestiaryUICollectionInfo uiCollectionInfo = entry.UIInfoProvider.GetEntryUICollectionInfo(); - for (int index = 0; index < entry.Info.Count; ++index) - { - if (entry.Info[index] is IProvideSearchFilterString searchFilterString1) - { - string searchString = searchFilterString1.GetSearchString(ref uiCollectionInfo); - if (searchString != null && searchString.ToLower().IndexOf(this._search, StringComparison.OrdinalIgnoreCase) != -1) - return true; - } - } - return false; - } - - public string GetDisplayNameKey() => "BestiaryInfo.IfSearched"; - - public UIElement GetImage() - { - Asset asset = Main.Assets.Request("Images/UI/Bestiary/Icon_Rank_Light", (AssetRequestMode) 1); - UIImageFramed uiImageFramed = new UIImageFramed(asset, asset.Frame()); - uiImageFramed.HAlign = 0.5f; - uiImageFramed.VAlign = 0.5f; - return (UIElement) uiImageFramed; - } - - public void SetSearch(string searchText) => this._search = searchText; - } - - public class ByUnlockState : IBestiaryEntryFilter, IEntryFilter - { - public bool? ForcedDisplay => new bool?(true); - - public bool FitsFilter(BestiaryEntry entry) - { - BestiaryUICollectionInfo uiCollectionInfo = entry.UIInfoProvider.GetEntryUICollectionInfo(); - return entry.Icon.GetUnlockState(uiCollectionInfo); - } - - public string GetDisplayNameKey() => "BestiaryInfo.IfUnlocked"; - - public UIElement GetImage() - { - Asset asset = Main.Assets.Request("Images/UI/Bestiary/Icon_Tags_Shadow", (AssetRequestMode) 1); - UIImageFramed uiImageFramed = new UIImageFramed(asset, asset.Frame(16, 5, 14, 3)); - uiImageFramed.HAlign = 0.5f; - uiImageFramed.VAlign = 0.5f; - return (UIElement) uiImageFramed; - } - } - - public class ByRareCreature : IBestiaryEntryFilter, IEntryFilter - { - public bool? ForcedDisplay => new bool?(); - - public bool FitsFilter(BestiaryEntry entry) - { - for (int index = 0; index < entry.Info.Count; ++index) - { - if (entry.Info[index] is RareSpawnBestiaryInfoElement) - return true; - } - return false; - } - - public string GetDisplayNameKey() => "BestiaryInfo.IsRare"; - - public UIElement GetImage() - { - Asset asset = Main.Assets.Request("Images/UI/Bestiary/Icon_Rank_Light", (AssetRequestMode) 1); - UIImageFramed uiImageFramed = new UIImageFramed(asset, asset.Frame()); - uiImageFramed.HAlign = 0.5f; - uiImageFramed.VAlign = 0.5f; - return (UIElement) uiImageFramed; - } - } - - public class ByBoss : IBestiaryEntryFilter, IEntryFilter - { - public bool? ForcedDisplay => new bool?(); - - public bool FitsFilter(BestiaryEntry entry) - { - for (int index = 0; index < entry.Info.Count; ++index) - { - if (entry.Info[index] is BossBestiaryInfoElement) - return true; - } - return false; - } - - public string GetDisplayNameKey() => "BestiaryInfo.IsBoss"; - - public UIElement GetImage() - { - Asset asset = Main.Assets.Request("Images/UI/Bestiary/Icon_Tags_Shadow", (AssetRequestMode) 1); - UIImageFramed uiImageFramed = new UIImageFramed(asset, asset.Frame(16, 5, 15, 3)); - uiImageFramed.HAlign = 0.5f; - uiImageFramed.VAlign = 0.5f; - return (UIElement) uiImageFramed; - } - } - - public class ByInfoElement : IBestiaryEntryFilter, IEntryFilter - { - private IBestiaryInfoElement _element; - - public bool? ForcedDisplay => new bool?(); - - public ByInfoElement(IBestiaryInfoElement element) => this._element = element; - - public bool FitsFilter(BestiaryEntry entry) => entry.Info.Contains(this._element); - - public string GetDisplayNameKey() => !(this._element is IFilterInfoProvider element) ? (string) null : element.GetDisplayNameKey(); - - public UIElement GetImage() => !(this._element is IFilterInfoProvider element) ? (UIElement) null : element.GetFilterImage(); - } - } -} diff --git a/GameContent/Bestiary/FlavorTextBestiaryInfoElement.cs b/GameContent/Bestiary/FlavorTextBestiaryInfoElement.cs deleted file mode 100644 index 804a1da..0000000 --- a/GameContent/Bestiary/FlavorTextBestiaryInfoElement.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.FlavorTextBestiaryInfoElement -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using System; -using Terraria.GameContent.UI.Elements; -using Terraria.Localization; -using Terraria.UI; - -namespace Terraria.GameContent.Bestiary -{ - public class FlavorTextBestiaryInfoElement : IBestiaryInfoElement - { - private string _key; - - public FlavorTextBestiaryInfoElement(string languageKey) => this._key = languageKey; - - public UIElement ProvideUIElement(BestiaryUICollectionInfo info) - { - if (info.UnlockState < BestiaryEntryUnlockState.CanShowStats_2) - return (UIElement) null; - UIPanel uiPanel = new UIPanel(Main.Assets.Request("Images/UI/Bestiary/Stat_Panel", (AssetRequestMode) 1), (Asset) null, customBarSize: 7); - uiPanel.Width = new StyleDimension(-11f, 1f); - uiPanel.Height = new StyleDimension(109f, 0.0f); - uiPanel.BackgroundColor = new Color(43, 56, 101); - uiPanel.BorderColor = Color.Transparent; - uiPanel.Left = new StyleDimension(3f, 0.0f); - uiPanel.PaddingLeft = 4f; - uiPanel.PaddingRight = 4f; - UIText uiText = new UIText(Language.GetText(this._key), 0.8f); - uiText.HAlign = 0.0f; - uiText.VAlign = 0.0f; - uiText.Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f); - uiText.Height = StyleDimension.FromPixelsAndPercent(0.0f, 1f); - uiText.IsWrapped = true; - UIText text = uiText; - FlavorTextBestiaryInfoElement.AddDynamicResize((UIElement) uiPanel, text); - uiPanel.Append((UIElement) text); - return (UIElement) uiPanel; - } - - private static void AddDynamicResize(UIElement container, UIText text) => text.OnInternalTextChange += (Action) (() => container.Height = new StyleDimension(text.MinHeight.Pixels, 0.0f)); - } -} diff --git a/GameContent/Bestiary/GoldCritterUICollectionInfoProvider.cs b/GameContent/Bestiary/GoldCritterUICollectionInfoProvider.cs deleted file mode 100644 index 184e710..0000000 --- a/GameContent/Bestiary/GoldCritterUICollectionInfoProvider.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.GoldCritterUICollectionInfoProvider -// 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 Terraria.ID; - -namespace Terraria.GameContent.Bestiary -{ - public class GoldCritterUICollectionInfoProvider : IBestiaryUICollectionInfoProvider - { - private string[] _normalCritterPersistentId; - private string _goldCritterPersistentId; - - public GoldCritterUICollectionInfoProvider( - int[] normalCritterPersistentId, - string goldCritterPersistentId) - { - this._normalCritterPersistentId = new string[normalCritterPersistentId.Length]; - for (int index = 0; index < normalCritterPersistentId.Length; ++index) - this._normalCritterPersistentId[index] = ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[normalCritterPersistentId[index]]; - this._goldCritterPersistentId = goldCritterPersistentId; - } - - public BestiaryUICollectionInfo GetEntryUICollectionInfo() - { - BestiaryEntryUnlockState unlockStateForCritter1 = this.GetUnlockStateForCritter(this._goldCritterPersistentId); - BestiaryEntryUnlockState entryUnlockState = BestiaryEntryUnlockState.NotKnownAtAll_0; - if (unlockStateForCritter1 > entryUnlockState) - entryUnlockState = unlockStateForCritter1; - foreach (string persistentId in this._normalCritterPersistentId) - { - BestiaryEntryUnlockState unlockStateForCritter2 = this.GetUnlockStateForCritter(persistentId); - if (unlockStateForCritter2 > entryUnlockState) - entryUnlockState = unlockStateForCritter2; - } - BestiaryUICollectionInfo uiCollectionInfo = new BestiaryUICollectionInfo() - { - UnlockState = entryUnlockState - }; - if (entryUnlockState == BestiaryEntryUnlockState.NotKnownAtAll_0 || this.TryFindingOneGoldCritterThatIsAlreadyUnlocked()) - return uiCollectionInfo; - return new BestiaryUICollectionInfo() - { - UnlockState = BestiaryEntryUnlockState.NotKnownAtAll_0 - }; - } - - private bool TryFindingOneGoldCritterThatIsAlreadyUnlocked() - { - for (int index = 0; index < NPCID.Sets.GoldCrittersCollection.Count; ++index) - { - int goldCritters = NPCID.Sets.GoldCrittersCollection[index]; - if (this.GetUnlockStateForCritter(ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[goldCritters]) > BestiaryEntryUnlockState.NotKnownAtAll_0) - return true; - } - return false; - } - - private BestiaryEntryUnlockState GetUnlockStateForCritter( - string persistentId) - { - return !Main.BestiaryTracker.Sights.GetWasNearbyBefore(persistentId) ? BestiaryEntryUnlockState.NotKnownAtAll_0 : BestiaryEntryUnlockState.CanShowDropsWithDropRates_4; - } - } -} diff --git a/GameContent/Bestiary/HighestOfMultipleUICollectionInfoProvider.cs b/GameContent/Bestiary/HighestOfMultipleUICollectionInfoProvider.cs deleted file mode 100644 index 7f717cc..0000000 --- a/GameContent/Bestiary/HighestOfMultipleUICollectionInfoProvider.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.HighestOfMultipleUICollectionInfoProvider -// 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 Terraria.UI; - -namespace Terraria.GameContent.Bestiary -{ - public class HighestOfMultipleUICollectionInfoProvider : IBestiaryUICollectionInfoProvider - { - private IBestiaryUICollectionInfoProvider[] _providers; - private int _mainProviderIndex; - - public HighestOfMultipleUICollectionInfoProvider( - params IBestiaryUICollectionInfoProvider[] providers) - { - this._providers = providers; - this._mainProviderIndex = 0; - } - - public BestiaryUICollectionInfo GetEntryUICollectionInfo() - { - BestiaryUICollectionInfo uiCollectionInfo1 = this._providers[this._mainProviderIndex].GetEntryUICollectionInfo(); - BestiaryEntryUnlockState unlockState = uiCollectionInfo1.UnlockState; - for (int index = 0; index < this._providers.Length; ++index) - { - BestiaryUICollectionInfo uiCollectionInfo2 = this._providers[index].GetEntryUICollectionInfo(); - if (unlockState < uiCollectionInfo2.UnlockState) - unlockState = uiCollectionInfo2.UnlockState; - } - uiCollectionInfo1.UnlockState = unlockState; - return uiCollectionInfo1; - } - - public UIElement ProvideUIElement(BestiaryUICollectionInfo info) => (UIElement) null; - } -} diff --git a/GameContent/Bestiary/IBestiaryBackgroundImagePathAndColorProvider.cs b/GameContent/Bestiary/IBestiaryBackgroundImagePathAndColorProvider.cs deleted file mode 100644 index 497cc87..0000000 --- a/GameContent/Bestiary/IBestiaryBackgroundImagePathAndColorProvider.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.IBestiaryBackgroundImagePathAndColorProvider -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; - -namespace Terraria.GameContent.Bestiary -{ - public interface IBestiaryBackgroundImagePathAndColorProvider - { - Asset GetBackgroundImage(); - - Color? GetBackgroundColor(); - } -} diff --git a/GameContent/Bestiary/IBestiaryBackgroundOverlayAndColorProvider.cs b/GameContent/Bestiary/IBestiaryBackgroundOverlayAndColorProvider.cs deleted file mode 100644 index 3ffca50..0000000 --- a/GameContent/Bestiary/IBestiaryBackgroundOverlayAndColorProvider.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.IBestiaryBackgroundOverlayAndColorProvider -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; - -namespace Terraria.GameContent.Bestiary -{ - public interface IBestiaryBackgroundOverlayAndColorProvider - { - Asset GetBackgroundOverlayImage(); - - Color? GetBackgroundOverlayColor(); - - float DisplayPriority { get; } - } -} diff --git a/GameContent/Bestiary/IBestiaryEntryDisplayIndex.cs b/GameContent/Bestiary/IBestiaryEntryDisplayIndex.cs deleted file mode 100644 index 92bf939..0000000 --- a/GameContent/Bestiary/IBestiaryEntryDisplayIndex.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.IBestiaryEntryDisplayIndex -// 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.Bestiary -{ - public interface IBestiaryEntryDisplayIndex - { - int BestiaryDisplayIndex { get; } - } -} diff --git a/GameContent/Bestiary/IBestiaryEntryFilter.cs b/GameContent/Bestiary/IBestiaryEntryFilter.cs deleted file mode 100644 index 8832f0b..0000000 --- a/GameContent/Bestiary/IBestiaryEntryFilter.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.IBestiaryEntryFilter -// 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 Terraria.DataStructures; - -namespace Terraria.GameContent.Bestiary -{ - public interface IBestiaryEntryFilter : IEntryFilter - { - bool? ForcedDisplay { get; } - } -} diff --git a/GameContent/Bestiary/IBestiaryInfoElement.cs b/GameContent/Bestiary/IBestiaryInfoElement.cs deleted file mode 100644 index bbd0e1c..0000000 --- a/GameContent/Bestiary/IBestiaryInfoElement.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.IBestiaryInfoElement -// 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 Terraria.UI; - -namespace Terraria.GameContent.Bestiary -{ - public interface IBestiaryInfoElement - { - UIElement ProvideUIElement(BestiaryUICollectionInfo info); - } -} diff --git a/GameContent/Bestiary/IBestiarySortStep.cs b/GameContent/Bestiary/IBestiarySortStep.cs deleted file mode 100644 index b6a07c7..0000000 --- a/GameContent/Bestiary/IBestiarySortStep.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.IBestiarySortStep -// 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.Collections.Generic; -using Terraria.DataStructures; - -namespace Terraria.GameContent.Bestiary -{ - public interface IBestiarySortStep : IEntrySortStep, IComparer - { - bool HiddenFromSortOptions { get; } - } -} diff --git a/GameContent/Bestiary/IBestiaryUICollectionInfoProvider.cs b/GameContent/Bestiary/IBestiaryUICollectionInfoProvider.cs deleted file mode 100644 index 17f4d3b..0000000 --- a/GameContent/Bestiary/IBestiaryUICollectionInfoProvider.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.IBestiaryUICollectionInfoProvider -// 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.Bestiary -{ - public interface IBestiaryUICollectionInfoProvider - { - BestiaryUICollectionInfo GetEntryUICollectionInfo(); - } -} diff --git a/GameContent/Bestiary/IEntryIcon.cs b/GameContent/Bestiary/IEntryIcon.cs deleted file mode 100644 index 3330425..0000000 --- a/GameContent/Bestiary/IEntryIcon.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.IEntryIcon -// 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; -using Microsoft.Xna.Framework.Graphics; - -namespace Terraria.GameContent.Bestiary -{ - public interface IEntryIcon - { - void Update( - BestiaryUICollectionInfo providedInfo, - Rectangle hitbox, - EntryIconDrawSettings settings); - - void Draw( - BestiaryUICollectionInfo providedInfo, - SpriteBatch spriteBatch, - EntryIconDrawSettings settings); - - bool GetUnlockState(BestiaryUICollectionInfo providedInfo); - - string GetHoverText(BestiaryUICollectionInfo providedInfo); - - IEntryIcon CreateClone(); - } -} diff --git a/GameContent/Bestiary/IFilterInfoProvider.cs b/GameContent/Bestiary/IFilterInfoProvider.cs deleted file mode 100644 index df45bb1..0000000 --- a/GameContent/Bestiary/IFilterInfoProvider.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.IFilterInfoProvider -// 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 Terraria.UI; - -namespace Terraria.GameContent.Bestiary -{ - public interface IFilterInfoProvider - { - UIElement GetFilterImage(); - - string GetDisplayNameKey(); - } -} diff --git a/GameContent/Bestiary/IItemBestiaryInfoElement.cs b/GameContent/Bestiary/IItemBestiaryInfoElement.cs deleted file mode 100644 index c580cdf..0000000 --- a/GameContent/Bestiary/IItemBestiaryInfoElement.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.IItemBestiaryInfoElement -// 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.Bestiary -{ - public interface IItemBestiaryInfoElement : IBestiaryInfoElement - { - } -} diff --git a/GameContent/Bestiary/IPreferenceProviderElement.cs b/GameContent/Bestiary/IPreferenceProviderElement.cs deleted file mode 100644 index 9a4fd80..0000000 --- a/GameContent/Bestiary/IPreferenceProviderElement.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.IPreferenceProviderElement -// 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.Bestiary -{ - public interface IPreferenceProviderElement : IBestiaryInfoElement - { - IBestiaryBackgroundImagePathAndColorProvider GetPreferredProvider(); - - bool Matches( - IBestiaryBackgroundImagePathAndColorProvider provider); - } -} diff --git a/GameContent/Bestiary/IProvideSearchFilterString.cs b/GameContent/Bestiary/IProvideSearchFilterString.cs deleted file mode 100644 index 4f51677..0000000 --- a/GameContent/Bestiary/IProvideSearchFilterString.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.IProvideSearchFilterString -// 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.Bestiary -{ - public interface IProvideSearchFilterString - { - string GetSearchString(ref BestiaryUICollectionInfo info); - } -} diff --git a/GameContent/Bestiary/ItemDropBestiaryInfoElement.cs b/GameContent/Bestiary/ItemDropBestiaryInfoElement.cs deleted file mode 100644 index 6dcc355..0000000 --- a/GameContent/Bestiary/ItemDropBestiaryInfoElement.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.ItemDropBestiaryInfoElement -// 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 Terraria.GameContent.ItemDropRules; -using Terraria.GameContent.UI.Elements; -using Terraria.ID; -using Terraria.UI; - -namespace Terraria.GameContent.Bestiary -{ - public class ItemDropBestiaryInfoElement : - IItemBestiaryInfoElement, - IBestiaryInfoElement, - IProvideSearchFilterString - { - protected DropRateInfo _droprateInfo; - - public ItemDropBestiaryInfoElement(DropRateInfo info) => this._droprateInfo = info; - - public virtual UIElement ProvideUIElement(BestiaryUICollectionInfo info) - { - bool flag = ItemDropBestiaryInfoElement.ShouldShowItem(ref this._droprateInfo); - if (info.UnlockState < BestiaryEntryUnlockState.CanShowStats_2) - flag = false; - return !flag ? (UIElement) null : (UIElement) new UIBestiaryInfoItemLine(this._droprateInfo, info); - } - - private static bool ShouldShowItem(ref DropRateInfo dropRateInfo) - { - bool flag = true; - if (dropRateInfo.conditions != null && dropRateInfo.conditions.Count > 0) - { - for (int index = 0; index < dropRateInfo.conditions.Count; ++index) - { - if (!dropRateInfo.conditions[index].CanShowItemDropInUI()) - { - flag = false; - break; - } - } - } - return flag; - } - - public string GetSearchString(ref BestiaryUICollectionInfo info) - { - bool flag = ItemDropBestiaryInfoElement.ShouldShowItem(ref this._droprateInfo); - if (info.UnlockState < BestiaryEntryUnlockState.CanShowStats_2) - flag = false; - return !flag ? (string) null : ContentSamples.ItemsByType[this._droprateInfo.itemId].Name; - } - } -} diff --git a/GameContent/Bestiary/ItemFromCatchingNPCBestiaryInfoElement.cs b/GameContent/Bestiary/ItemFromCatchingNPCBestiaryInfoElement.cs deleted file mode 100644 index 934c046..0000000 --- a/GameContent/Bestiary/ItemFromCatchingNPCBestiaryInfoElement.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.ItemFromCatchingNPCBestiaryInfoElement -// 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 Terraria.GameContent.UI.Elements; -using Terraria.ID; -using Terraria.UI; - -namespace Terraria.GameContent.Bestiary -{ - public class ItemFromCatchingNPCBestiaryInfoElement : - IItemBestiaryInfoElement, - IBestiaryInfoElement, - IProvideSearchFilterString - { - private int _itemType; - - public ItemFromCatchingNPCBestiaryInfoElement(int itemId) => this._itemType = itemId; - - public UIElement ProvideUIElement(BestiaryUICollectionInfo info) => info.UnlockState < BestiaryEntryUnlockState.CanShowDropsWithoutDropRates_3 ? (UIElement) null : (UIElement) new UIBestiaryInfoLine("catch item #" + (object) this._itemType ?? ""); - - public string GetSearchString(ref BestiaryUICollectionInfo info) => info.UnlockState < BestiaryEntryUnlockState.CanShowDropsWithoutDropRates_3 ? (string) null : ContentSamples.ItemsByType[this._itemType].Name; - } -} diff --git a/GameContent/Bestiary/MoonLordPortraitBackgroundProviderBestiaryInfoElem.cs b/GameContent/Bestiary/MoonLordPortraitBackgroundProviderBestiaryInfoElem.cs deleted file mode 100644 index 1a79c21..0000000 --- a/GameContent/Bestiary/MoonLordPortraitBackgroundProviderBestiaryInfoElem.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.MoonLordPortraitBackgroundProviderBestiaryInfoElement -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria.UI; - -namespace Terraria.GameContent.Bestiary -{ - public class MoonLordPortraitBackgroundProviderBestiaryInfoElement : - IBestiaryInfoElement, - IBestiaryBackgroundImagePathAndColorProvider - { - public Asset GetBackgroundImage() => Main.Assets.Request("Images/MapBG1", (AssetRequestMode) 1); - - public Color? GetBackgroundColor() => new Color?(Color.Black); - - public UIElement ProvideUIElement(BestiaryUICollectionInfo info) => (UIElement) null; - } -} diff --git a/GameContent/Bestiary/NPCKillsTracker.cs b/GameContent/Bestiary/NPCKillsTracker.cs deleted file mode 100644 index 73e5ec3..0000000 --- a/GameContent/Bestiary/NPCKillsTracker.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.NPCKillsTracker -// 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.Collections.Generic; -using System.IO; -using Terraria.GameContent.NetModules; -using Terraria.ID; -using Terraria.Net; - -namespace Terraria.GameContent.Bestiary -{ - public class NPCKillsTracker : IPersistentPerWorldContent, IOnPlayerJoining - { - public const int POSITIVE_KILL_COUNT_CAP = 9999; - private Dictionary _killCountsByNpcId; - - public NPCKillsTracker() => this._killCountsByNpcId = new Dictionary(); - - public void RegisterKill(NPC npc) - { - string bestiaryCreditId = npc.GetBestiaryCreditId(); - int num; - this._killCountsByNpcId.TryGetValue(bestiaryCreditId, out num); - int killcount = num + 1; - this._killCountsByNpcId[bestiaryCreditId] = Utils.Clamp(killcount, 0, 9999); - if (Main.netMode != 2) - return; - NetManager.Instance.Broadcast(NetBestiaryModule.SerializeKillCount(npc.netID, killcount)); - } - - public int GetKillCount(NPC npc) => this.GetKillCount(npc.GetBestiaryCreditId()); - - public void SetKillCountDirectly(string persistentId, int killCount) => this._killCountsByNpcId[persistentId] = Utils.Clamp(killCount, 0, 9999); - - public int GetKillCount(string persistentId) - { - int num; - this._killCountsByNpcId.TryGetValue(persistentId, out num); - return num; - } - - public void Save(BinaryWriter writer) - { - lock (this._killCountsByNpcId) - { - writer.Write(this._killCountsByNpcId.Count); - foreach (KeyValuePair keyValuePair in this._killCountsByNpcId) - { - writer.Write(keyValuePair.Key); - writer.Write(keyValuePair.Value); - } - } - } - - public void Load(BinaryReader reader, int gameVersionSaveWasMadeOn) - { - int num = reader.ReadInt32(); - for (int index = 0; index < num; ++index) - this._killCountsByNpcId[reader.ReadString()] = reader.ReadInt32(); - } - - public void ValidateWorld(BinaryReader reader, int gameVersionSaveWasMadeOn) - { - int num = reader.ReadInt32(); - for (int index = 0; index < num; ++index) - { - reader.ReadString(); - reader.ReadInt32(); - } - } - - public void Reset() => this._killCountsByNpcId.Clear(); - - public void OnPlayerJoining(int playerIndex) - { - foreach (KeyValuePair keyValuePair in this._killCountsByNpcId) - { - int idsByPersistentId = ContentSamples.NpcNetIdsByPersistentIds[keyValuePair.Key]; - NetManager.Instance.SendToClient(NetBestiaryModule.SerializeKillCount(idsByPersistentId, keyValuePair.Value), playerIndex); - } - } - } -} diff --git a/GameContent/Bestiary/NPCNetIdBestiaryInfoElement.cs b/GameContent/Bestiary/NPCNetIdBestiaryInfoElement.cs deleted file mode 100644 index 2b8ee16..0000000 --- a/GameContent/Bestiary/NPCNetIdBestiaryInfoElement.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.NPCNetIdBestiaryInfoElement -// 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 Terraria.ID; -using Terraria.UI; - -namespace Terraria.GameContent.Bestiary -{ - public class NPCNetIdBestiaryInfoElement : IBestiaryInfoElement, IBestiaryEntryDisplayIndex - { - public int NetId { get; private set; } - - public NPCNetIdBestiaryInfoElement(int npcNetId) => this.NetId = npcNetId; - - public UIElement ProvideUIElement(BestiaryUICollectionInfo info) => (UIElement) null; - - public int BestiaryDisplayIndex => ContentSamples.NpcBestiarySortingId[this.NetId]; - } -} diff --git a/GameContent/Bestiary/NPCPortraitInfoElement.cs b/GameContent/Bestiary/NPCPortraitInfoElement.cs deleted file mode 100644 index f1b39ff..0000000 --- a/GameContent/Bestiary/NPCPortraitInfoElement.cs +++ /dev/null @@ -1,137 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.NPCPortraitInfoElement -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria.GameContent.UI.Elements; -using Terraria.UI; - -namespace Terraria.GameContent.Bestiary -{ - public class NPCPortraitInfoElement : IBestiaryInfoElement - { - private int? _filledStarsCount; - - public NPCPortraitInfoElement(int? rarityStars = null) => this._filledStarsCount = rarityStars; - - public UIElement ProvideUIElement(BestiaryUICollectionInfo info) - { - UIElement uiElement = new UIElement() - { - Width = new StyleDimension(0.0f, 1f), - Height = new StyleDimension(112f, 0.0f) - }; - uiElement.SetPadding(0.0f); - BestiaryEntry entry = new BestiaryEntry(); - Asset portraitBackgroundAsset = (Asset) null; - Color white = Color.White; - entry.Icon = info.OwnerEntry.Icon.CreateClone(); - entry.UIInfoProvider = info.OwnerEntry.UIInfoProvider; - List overlays = new List(); - bool flag1 = info.UnlockState > BestiaryEntryUnlockState.NotKnownAtAll_0; - if (flag1) - { - List source1 = new List(); - IEnumerable source2 = info.OwnerEntry.Info.OfType(); - IEnumerable preferences = info.OwnerEntry.Info.OfType(); - Func predicate = (Func) (provider => preferences.Any((Func) (preference => preference.Matches(provider)))); - IEnumerable andColorProviders = source2.Where(predicate); - bool flag2 = false; - foreach (IBestiaryBackgroundImagePathAndColorProvider andColorProvider in andColorProviders) - { - Asset backgroundImage = andColorProvider.GetBackgroundImage(); - if (backgroundImage != null) - { - portraitBackgroundAsset = backgroundImage; - flag2 = true; - Color? backgroundColor = andColorProvider.GetBackgroundColor(); - if (backgroundColor.HasValue) - { - white = backgroundColor.Value; - break; - } - break; - } - } - foreach (IBestiaryInfoElement bestiaryInfoElement in info.OwnerEntry.Info) - { - if (bestiaryInfoElement is IBestiaryBackgroundImagePathAndColorProvider andColorProvider9) - { - Asset backgroundImage = andColorProvider9.GetBackgroundImage(); - if (backgroundImage != null) - { - if (!flag2) - portraitBackgroundAsset = backgroundImage; - Color? backgroundColor = andColorProvider9.GetBackgroundColor(); - if (backgroundColor.HasValue) - white = backgroundColor.Value; - } - else - continue; - } - if (!flag2 && bestiaryInfoElement is IBestiaryBackgroundOverlayAndColorProvider andColorProvider10 && andColorProvider10.GetBackgroundOverlayImage() != null) - source1.Add(bestiaryInfoElement); - } - overlays.AddRange(source1.OrderBy(new Func(this.GetSortingValueForElement)).Select((Func) (x => x as IBestiaryBackgroundOverlayAndColorProvider))); - } - UIBestiaryNPCEntryPortrait npcEntryPortrait1 = new UIBestiaryNPCEntryPortrait(entry, portraitBackgroundAsset, white, overlays); - npcEntryPortrait1.Left = new StyleDimension(4f, 0.0f); - npcEntryPortrait1.HAlign = 0.0f; - UIBestiaryNPCEntryPortrait npcEntryPortrait2 = npcEntryPortrait1; - uiElement.Append((UIElement) npcEntryPortrait2); - if (flag1 && this._filledStarsCount.HasValue) - { - UIElement starsContainer = this.CreateStarsContainer(); - uiElement.Append(starsContainer); - } - return uiElement; - } - - private float GetSortingValueForElement(IBestiaryInfoElement element) => element is IBestiaryBackgroundOverlayAndColorProvider andColorProvider ? andColorProvider.DisplayPriority : 0.0f; - - private UIElement CreateStarsContainer() - { - int num1 = 14; - int num2 = 14; - int num3 = -4; - int num4 = num1 + num3; - int val2 = 5; - int val1 = 5; - int num5 = this._filledStarsCount.Value; - float num6 = 1f; - int num7 = num4 * Math.Min(val1, val2) - num3; - double num8 = (double) num4 * Math.Ceiling((double) val2 / (double) val1) - (double) num3; - UIPanel uiPanel = new UIPanel(Main.Assets.Request("Images/UI/Bestiary/Stat_Panel", (AssetRequestMode) 1), (Asset) null, 5, 21); - uiPanel.Width = new StyleDimension((float) num7 + num6 * 2f, 0.0f); - uiPanel.Height = new StyleDimension((float) num8 + num6 * 2f, 0.0f); - uiPanel.BackgroundColor = Color.Gray * 0.0f; - uiPanel.BorderColor = Color.Transparent; - uiPanel.Left = new StyleDimension(10f, 0.0f); - uiPanel.Top = new StyleDimension(6f, 0.0f); - uiPanel.VAlign = 0.0f; - UIElement uiElement = (UIElement) uiPanel; - uiElement.SetPadding(0.0f); - for (int index = val2 - 1; index >= 0; --index) - { - string str = "Images/UI/Bestiary/Icon_Rank_Light"; - if (index >= num5) - str = "Images/UI/Bestiary/Icon_Rank_Dim"; - UIImage uiImage1 = new UIImage(Main.Assets.Request(str, (AssetRequestMode) 1)); - uiImage1.Left = new StyleDimension((float) ((double) (num4 * (index % val1)) - (double) num7 * 0.5 + (double) num1 * 0.5), 0.0f); - uiImage1.Top = new StyleDimension((float) ((double) (num4 * (index / val1)) - num8 * 0.5 + (double) num2 * 0.5), 0.0f); - uiImage1.HAlign = 0.5f; - uiImage1.VAlign = 0.5f; - UIImage uiImage2 = uiImage1; - uiElement.Append((UIElement) uiImage2); - } - return uiElement; - } - } -} diff --git a/GameContent/Bestiary/NPCStatsReportInfoElement.cs b/GameContent/Bestiary/NPCStatsReportInfoElement.cs deleted file mode 100644 index 890ba51..0000000 --- a/GameContent/Bestiary/NPCStatsReportInfoElement.cs +++ /dev/null @@ -1,245 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.NPCStatsReportInfoElement -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria.DataStructures; -using Terraria.GameContent.UI.Elements; -using Terraria.Localization; -using Terraria.UI; - -namespace Terraria.GameContent.Bestiary -{ - public class NPCStatsReportInfoElement : IBestiaryInfoElement - { - public int NpcId; - public int GameMode; - public int Damage; - public int LifeMax; - public float MonetaryValue; - public int Defense; - public float KnockbackResist; - - public NPCStatsReportInfoElement(int npcNetId, int gameMode) - { - this.NpcId = npcNetId; - this.GameMode = gameMode; - if (!Main.RegisterdGameModes.TryGetValue(this.GameMode, out GameModeData _)) - return; - NPC npc = new NPC(); - npc.SetDefaults(this.NpcId); - this.Damage = npc.damage; - this.LifeMax = npc.lifeMax; - this.MonetaryValue = npc.value; - this.Defense = npc.defense; - this.KnockbackResist = npc.knockBackResist; - } - - public UIElement ProvideUIElement(BestiaryUICollectionInfo info) - { - if (info.UnlockState == BestiaryEntryUnlockState.NotKnownAtAll_0) - return (UIElement) null; - if (this.GameMode != Main.GameMode) - return (UIElement) null; - UIElement uiElement = new UIElement() - { - Width = new StyleDimension(0.0f, 1f), - Height = new StyleDimension(109f, 0.0f) - }; - int num1 = 99; - int num2 = 35; - int num3 = 3; - int num4 = 0; - UIImage uiImage1 = new UIImage(Main.Assets.Request("Images/UI/Bestiary/Stat_HP", (AssetRequestMode) 1)); - uiImage1.Top = new StyleDimension((float) num4, 0.0f); - uiImage1.Left = new StyleDimension((float) num3, 0.0f); - UIImage uiImage2 = uiImage1; - UIImage uiImage3 = new UIImage(Main.Assets.Request("Images/UI/Bestiary/Stat_Attack", (AssetRequestMode) 1)); - uiImage3.Top = new StyleDimension((float) (num4 + num2), 0.0f); - uiImage3.Left = new StyleDimension((float) num3, 0.0f); - UIImage uiImage4 = uiImage3; - UIImage uiImage5 = new UIImage(Main.Assets.Request("Images/UI/Bestiary/Stat_Defense", (AssetRequestMode) 1)); - uiImage5.Top = new StyleDimension((float) (num4 + num2), 0.0f); - uiImage5.Left = new StyleDimension((float) (num3 + num1), 0.0f); - UIImage uiImage6 = uiImage5; - UIImage uiImage7 = new UIImage(Main.Assets.Request("Images/UI/Bestiary/Stat_Knockback", (AssetRequestMode) 1)); - uiImage7.Top = new StyleDimension((float) num4, 0.0f); - uiImage7.Left = new StyleDimension((float) (num3 + num1), 0.0f); - UIImage uiImage8 = uiImage7; - uiElement.Append((UIElement) uiImage2); - uiElement.Append((UIElement) uiImage4); - uiElement.Append((UIElement) uiImage6); - uiElement.Append((UIElement) uiImage8); - int num5 = -10; - int num6 = 0; - int monetaryValue = (int) this.MonetaryValue; - string text1 = Utils.Clamp(monetaryValue / 1000000, 0, 999).ToString(); - string text2 = Utils.Clamp(monetaryValue % 1000000 / 10000, 0, 99).ToString(); - string text3 = Utils.Clamp(monetaryValue % 10000 / 100, 0, 99).ToString(); - string text4 = Utils.Clamp(monetaryValue % 100 / 1, 0, 99).ToString(); - if (monetaryValue / 1000000 < 1) - text1 = "-"; - if (monetaryValue / 10000 < 1) - text2 = "-"; - if (monetaryValue / 100 < 1) - text3 = "-"; - if (monetaryValue < 1) - text4 = "-"; - string text5 = this.LifeMax.ToString(); - string text6 = this.Damage.ToString(); - string text7 = this.Defense.ToString(); - string text8 = (double) this.KnockbackResist <= 0.800000011920929 ? ((double) this.KnockbackResist <= 0.400000005960464 ? ((double) this.KnockbackResist <= 0.0 ? Language.GetText("BestiaryInfo.KnockbackNone").Value : Language.GetText("BestiaryInfo.KnockbackLow").Value) : Language.GetText("BestiaryInfo.KnockbackMedium").Value) : Language.GetText("BestiaryInfo.KnockbackHigh").Value; - if (info.UnlockState < BestiaryEntryUnlockState.CanShowStats_2) - { - string str1; - text4 = str1 = "?"; - text3 = str1; - text2 = str1; - text1 = str1; - string str2; - text8 = str2 = "???"; - text7 = str2; - text6 = str2; - text5 = str2; - } - UIText uiText1 = new UIText(text5); - uiText1.HAlign = 1f; - uiText1.VAlign = 0.5f; - uiText1.Left = new StyleDimension((float) num5, 0.0f); - uiText1.Top = new StyleDimension((float) num6, 0.0f); - uiText1.IgnoresMouseInteraction = true; - UIText uiText2 = uiText1; - UIText uiText3 = new UIText(text8); - uiText3.HAlign = 1f; - uiText3.VAlign = 0.5f; - uiText3.Left = new StyleDimension((float) num5, 0.0f); - uiText3.Top = new StyleDimension((float) num6, 0.0f); - uiText3.IgnoresMouseInteraction = true; - UIText uiText4 = uiText3; - UIText uiText5 = new UIText(text6); - uiText5.HAlign = 1f; - uiText5.VAlign = 0.5f; - uiText5.Left = new StyleDimension((float) num5, 0.0f); - uiText5.Top = new StyleDimension((float) num6, 0.0f); - uiText5.IgnoresMouseInteraction = true; - UIText uiText6 = uiText5; - UIText uiText7 = new UIText(text7); - uiText7.HAlign = 1f; - uiText7.VAlign = 0.5f; - uiText7.Left = new StyleDimension((float) num5, 0.0f); - uiText7.Top = new StyleDimension((float) num6, 0.0f); - uiText7.IgnoresMouseInteraction = true; - UIText uiText8 = uiText7; - uiImage2.Append((UIElement) uiText2); - uiImage4.Append((UIElement) uiText6); - uiImage6.Append((UIElement) uiText8); - uiImage8.Append((UIElement) uiText4); - if (monetaryValue > 0) - { - UIHorizontalSeparator horizontalSeparator1 = new UIHorizontalSeparator(); - horizontalSeparator1.Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f); - horizontalSeparator1.Color = new Color(89, 116, 213, (int) byte.MaxValue) * 0.9f; - horizontalSeparator1.Left = new StyleDimension(0.0f, 0.0f); - horizontalSeparator1.Top = new StyleDimension((float) (num6 + num2 * 2), 0.0f); - UIHorizontalSeparator horizontalSeparator2 = horizontalSeparator1; - uiElement.Append((UIElement) horizontalSeparator2); - int num7 = num3; - int num8 = num6 + num2 * 2 + 8; - int num9 = 49; - UIImage uiImage9 = new UIImage(Main.Assets.Request("Images/UI/Bestiary/Stat_Platinum", (AssetRequestMode) 1)); - uiImage9.Top = new StyleDimension((float) num8, 0.0f); - uiImage9.Left = new StyleDimension((float) num7, 0.0f); - UIImage uiImage10 = uiImage9; - UIImage uiImage11 = new UIImage(Main.Assets.Request("Images/UI/Bestiary/Stat_Gold", (AssetRequestMode) 1)); - uiImage11.Top = new StyleDimension((float) num8, 0.0f); - uiImage11.Left = new StyleDimension((float) (num7 + num9), 0.0f); - UIImage uiImage12 = uiImage11; - UIImage uiImage13 = new UIImage(Main.Assets.Request("Images/UI/Bestiary/Stat_Silver", (AssetRequestMode) 1)); - uiImage13.Top = new StyleDimension((float) num8, 0.0f); - uiImage13.Left = new StyleDimension((float) (num7 + num9 * 2 + 1), 0.0f); - UIImage uiImage14 = uiImage13; - UIImage uiImage15 = new UIImage(Main.Assets.Request("Images/UI/Bestiary/Stat_Copper", (AssetRequestMode) 1)); - uiImage15.Top = new StyleDimension((float) num8, 0.0f); - uiImage15.Left = new StyleDimension((float) (num7 + num9 * 3 + 1), 0.0f); - UIImage uiImage16 = uiImage15; - if (text1 != "-") - uiElement.Append((UIElement) uiImage10); - if (text2 != "-") - uiElement.Append((UIElement) uiImage12); - if (text3 != "-") - uiElement.Append((UIElement) uiImage14); - if (text4 != "-") - uiElement.Append((UIElement) uiImage16); - int num10 = num5 + 3; - float textScale = 0.85f; - UIText uiText9 = new UIText(text1, textScale); - uiText9.HAlign = 1f; - uiText9.VAlign = 0.5f; - uiText9.Left = new StyleDimension((float) num10, 0.0f); - uiText9.Top = new StyleDimension((float) num6, 0.0f); - UIText uiText10 = uiText9; - UIText uiText11 = new UIText(text2, textScale); - uiText11.HAlign = 1f; - uiText11.VAlign = 0.5f; - uiText11.Left = new StyleDimension((float) num10, 0.0f); - uiText11.Top = new StyleDimension((float) num6, 0.0f); - UIText uiText12 = uiText11; - UIText uiText13 = new UIText(text3, textScale); - uiText13.HAlign = 1f; - uiText13.VAlign = 0.5f; - uiText13.Left = new StyleDimension((float) num10, 0.0f); - uiText13.Top = new StyleDimension((float) num6, 0.0f); - UIText uiText14 = uiText13; - UIText uiText15 = new UIText(text4, textScale); - uiText15.HAlign = 1f; - uiText15.VAlign = 0.5f; - uiText15.Left = new StyleDimension((float) num10, 0.0f); - uiText15.Top = new StyleDimension((float) num6, 0.0f); - UIText uiText16 = uiText15; - uiImage10.Append((UIElement) uiText10); - uiImage12.Append((UIElement) uiText12); - uiImage14.Append((UIElement) uiText14); - uiImage16.Append((UIElement) uiText16); - } - else - uiElement.Height.Pixels = (float) (num6 + num2 * 2 - 4); - uiImage4.OnUpdate += new UIElement.ElementEvent(this.ShowStats_Attack); - uiImage6.OnUpdate += new UIElement.ElementEvent(this.ShowStats_Defense); - uiImage2.OnUpdate += new UIElement.ElementEvent(this.ShowStats_Life); - uiImage8.OnUpdate += new UIElement.ElementEvent(this.ShowStats_Knockback); - return uiElement; - } - - private void ShowStats_Attack(UIElement element) - { - if (!element.IsMouseHovering) - return; - Main.instance.MouseText(Language.GetTextValue("BestiaryInfo.Attack")); - } - - private void ShowStats_Defense(UIElement element) - { - if (!element.IsMouseHovering) - return; - Main.instance.MouseText(Language.GetTextValue("BestiaryInfo.Defense")); - } - - private void ShowStats_Knockback(UIElement element) - { - if (!element.IsMouseHovering) - return; - Main.instance.MouseText(Language.GetTextValue("BestiaryInfo.Knockback")); - } - - private void ShowStats_Life(UIElement element) - { - if (!element.IsMouseHovering) - return; - Main.instance.MouseText(Language.GetTextValue("BestiaryInfo.Life")); - } - } -} diff --git a/GameContent/Bestiary/NPCWasChatWithTracker.cs b/GameContent/Bestiary/NPCWasChatWithTracker.cs deleted file mode 100644 index fa236e0..0000000 --- a/GameContent/Bestiary/NPCWasChatWithTracker.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.NPCWasChatWithTracker -// 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.Collections.Generic; -using System.IO; -using Terraria.GameContent.NetModules; -using Terraria.ID; -using Terraria.Net; - -namespace Terraria.GameContent.Bestiary -{ - public class NPCWasChatWithTracker : IPersistentPerWorldContent, IOnPlayerJoining - { - private HashSet _chattedWithPlayer; - - public NPCWasChatWithTracker() => this._chattedWithPlayer = new HashSet(); - - public void RegisterChatStartWith(NPC npc) - { - string bestiaryCreditId = npc.GetBestiaryCreditId(); - bool flag = !this._chattedWithPlayer.Contains(bestiaryCreditId); - this._chattedWithPlayer.Add(bestiaryCreditId); - if (!(Main.netMode == 2 & flag)) - return; - NetManager.Instance.Broadcast(NetBestiaryModule.SerializeChat(npc.netID)); - } - - public void SetWasChatWithDirectly(string persistentId) => this._chattedWithPlayer.Add(persistentId); - - public bool GetWasChatWith(NPC npc) => this._chattedWithPlayer.Contains(npc.GetBestiaryCreditId()); - - public bool GetWasChatWith(string persistentId) => this._chattedWithPlayer.Contains(persistentId); - - public void Save(BinaryWriter writer) - { - lock (this._chattedWithPlayer) - { - writer.Write(this._chattedWithPlayer.Count); - foreach (string str in this._chattedWithPlayer) - writer.Write(str); - } - } - - public void Load(BinaryReader reader, int gameVersionSaveWasMadeOn) - { - int num = reader.ReadInt32(); - for (int index = 0; index < num; ++index) - this._chattedWithPlayer.Add(reader.ReadString()); - } - - public void ValidateWorld(BinaryReader reader, int gameVersionSaveWasMadeOn) - { - int num = reader.ReadInt32(); - for (int index = 0; index < num; ++index) - reader.ReadString(); - } - - public void Reset() => this._chattedWithPlayer.Clear(); - - public void OnPlayerJoining(int playerIndex) - { - foreach (string key in this._chattedWithPlayer) - { - int npcNetId; - if (ContentSamples.NpcNetIdsByPersistentIds.TryGetValue(key, out npcNetId)) - NetManager.Instance.SendToClient(NetBestiaryModule.SerializeChat(npcNetId), playerIndex); - } - } - } -} diff --git a/GameContent/Bestiary/NPCWasNearPlayerTracker.cs b/GameContent/Bestiary/NPCWasNearPlayerTracker.cs deleted file mode 100644 index 14f5fab..0000000 --- a/GameContent/Bestiary/NPCWasNearPlayerTracker.cs +++ /dev/null @@ -1,121 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.NPCWasNearPlayerTracker -// 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; -using System.Collections.Generic; -using System.IO; -using Terraria.GameContent.NetModules; -using Terraria.ID; -using Terraria.Net; - -namespace Terraria.GameContent.Bestiary -{ - public class NPCWasNearPlayerTracker : IPersistentPerWorldContent, IOnPlayerJoining - { - private HashSet _wasNearPlayer; - private List _playerHitboxesForBestiary; - private List _wasSeenNearPlayerByNetId; - - public void PrepareSamplesBasedOptimizations() - { - } - - public NPCWasNearPlayerTracker() - { - this._wasNearPlayer = new HashSet(); - this._playerHitboxesForBestiary = new List(); - this._wasSeenNearPlayerByNetId = new List(); - } - - public void RegisterWasNearby(NPC npc) - { - string bestiaryCreditId = npc.GetBestiaryCreditId(); - bool flag = !this._wasNearPlayer.Contains(bestiaryCreditId); - this._wasNearPlayer.Add(bestiaryCreditId); - if (!(Main.netMode == 2 & flag)) - return; - NetManager.Instance.Broadcast(NetBestiaryModule.SerializeSight(npc.netID)); - } - - public void SetWasSeenDirectly(string persistentId) => this._wasNearPlayer.Add(persistentId); - - public bool GetWasNearbyBefore(NPC npc) => this.GetWasNearbyBefore(npc.GetBestiaryCreditId()); - - public bool GetWasNearbyBefore(string persistentIdentifier) => this._wasNearPlayer.Contains(persistentIdentifier); - - public void Save(BinaryWriter writer) - { - lock (this._wasNearPlayer) - { - writer.Write(this._wasNearPlayer.Count); - foreach (string str in this._wasNearPlayer) - writer.Write(str); - } - } - - public void Load(BinaryReader reader, int gameVersionSaveWasMadeOn) - { - int num = reader.ReadInt32(); - for (int index = 0; index < num; ++index) - this._wasNearPlayer.Add(reader.ReadString()); - } - - public void ValidateWorld(BinaryReader reader, int gameVersionSaveWasMadeOn) - { - int num = reader.ReadInt32(); - for (int index = 0; index < num; ++index) - reader.ReadString(); - } - - public void Reset() - { - this._wasNearPlayer.Clear(); - this._playerHitboxesForBestiary.Clear(); - this._wasSeenNearPlayerByNetId.Clear(); - } - - public void ScanWorldForFinds() - { - this._playerHitboxesForBestiary.Clear(); - for (int index = 0; index < (int) byte.MaxValue; ++index) - { - Player player = Main.player[index]; - if (player.active) - { - Rectangle hitbox = player.Hitbox; - hitbox.Inflate(300, 200); - this._playerHitboxesForBestiary.Add(hitbox); - } - } - for (int index1 = 0; index1 < 200; ++index1) - { - NPC npc = Main.npc[index1]; - if (npc.active && npc.CountsAsACritter && !this._wasSeenNearPlayerByNetId.Contains(npc.netID)) - { - Rectangle hitbox = npc.Hitbox; - for (int index2 = 0; index2 < this._playerHitboxesForBestiary.Count; ++index2) - { - Rectangle rectangle = this._playerHitboxesForBestiary[index2]; - if (hitbox.Intersects(rectangle)) - { - this._wasSeenNearPlayerByNetId.Add(npc.netID); - this.RegisterWasNearby(npc); - } - } - } - } - } - - public void OnPlayerJoining(int playerIndex) - { - foreach (string key in this._wasNearPlayer) - { - int idsByPersistentId = ContentSamples.NpcNetIdsByPersistentIds[key]; - NetManager.Instance.SendToClient(NetBestiaryModule.SerializeSight(idsByPersistentId), playerIndex); - } - } - } -} diff --git a/GameContent/Bestiary/NamePlateInfoElement.cs b/GameContent/Bestiary/NamePlateInfoElement.cs deleted file mode 100644 index c87f2ec..0000000 --- a/GameContent/Bestiary/NamePlateInfoElement.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.NamePlateInfoElement -// 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 Terraria.GameContent.UI.Elements; -using Terraria.Localization; -using Terraria.UI; - -namespace Terraria.GameContent.Bestiary -{ - public class NamePlateInfoElement : IBestiaryInfoElement, IProvideSearchFilterString - { - private string _key; - private int _npcNetId; - - public NamePlateInfoElement(string languageKey, int npcNetId) - { - this._key = languageKey; - this._npcNetId = npcNetId; - } - - public UIElement ProvideUIElement(BestiaryUICollectionInfo info) - { - UIElement element = info.UnlockState != BestiaryEntryUnlockState.NotKnownAtAll_0 ? (UIElement) new UIText(Language.GetText(this._key)) : (UIElement) new UIText("???"); - element.HAlign = 0.5f; - element.VAlign = 0.5f; - element.Top = new StyleDimension(2f, 0.0f); - element.IgnoresMouseInteraction = true; - UIElement uiElement = new UIElement(); - uiElement.Width = new StyleDimension(0.0f, 1f); - uiElement.Height = new StyleDimension(24f, 0.0f); - uiElement.Append(element); - return uiElement; - } - - public string GetSearchString(ref BestiaryUICollectionInfo info) => info.UnlockState == BestiaryEntryUnlockState.NotKnownAtAll_0 ? (string) null : Language.GetText(this._key).Value; - } -} diff --git a/GameContent/Bestiary/RareSpawnBestiaryInfoElement.cs b/GameContent/Bestiary/RareSpawnBestiaryInfoElement.cs deleted file mode 100644 index 674a2c7..0000000 --- a/GameContent/Bestiary/RareSpawnBestiaryInfoElement.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.RareSpawnBestiaryInfoElement -// 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 Terraria.Localization; -using Terraria.UI; - -namespace Terraria.GameContent.Bestiary -{ - public class RareSpawnBestiaryInfoElement : IBestiaryInfoElement, IProvideSearchFilterString - { - public int RarityLevel { get; private set; } - - public RareSpawnBestiaryInfoElement(int rarityLevel) => this.RarityLevel = rarityLevel; - - public UIElement ProvideUIElement(BestiaryUICollectionInfo info) => (UIElement) null; - - public string GetSearchString(ref BestiaryUICollectionInfo info) => info.UnlockState == BestiaryEntryUnlockState.NotKnownAtAll_0 ? (string) null : Language.GetText("BestiaryInfo.IsRare").Value; - } -} diff --git a/GameContent/Bestiary/SalamanderShellyDadUICollectionInfoProvider.cs b/GameContent/Bestiary/SalamanderShellyDadUICollectionInfoProvider.cs deleted file mode 100644 index 0cf7289..0000000 --- a/GameContent/Bestiary/SalamanderShellyDadUICollectionInfoProvider.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.SalamanderShellyDadUICollectionInfoProvider -// 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 Terraria.ID; -using Terraria.UI; - -namespace Terraria.GameContent.Bestiary -{ - public class SalamanderShellyDadUICollectionInfoProvider : IBestiaryUICollectionInfoProvider - { - private string _persistentIdentifierToCheck; - - public SalamanderShellyDadUICollectionInfoProvider(string persistentId) => this._persistentIdentifierToCheck = persistentId; - - public BestiaryUICollectionInfo GetEntryUICollectionInfo() - { - BestiaryEntryUnlockState unlockstatus = CommonEnemyUICollectionInfoProvider.GetUnlockStateByKillCount(Main.BestiaryTracker.Kills.GetKillCount(this._persistentIdentifierToCheck), false); - if (!this.IsIncludedInCurrentWorld()) - unlockstatus = this.GetLowestAvailableUnlockStateFromEntriesThatAreInWorld(unlockstatus); - return new BestiaryUICollectionInfo() - { - UnlockState = unlockstatus - }; - } - - private BestiaryEntryUnlockState GetLowestAvailableUnlockStateFromEntriesThatAreInWorld( - BestiaryEntryUnlockState unlockstatus) - { - BestiaryEntryUnlockState entryUnlockState = BestiaryEntryUnlockState.CanShowDropsWithDropRates_4; - int[,] cavernMonsterType = NPC.cavernMonsterType; - for (int index1 = 0; index1 < cavernMonsterType.GetLength(0); ++index1) - { - for (int index2 = 0; index2 < cavernMonsterType.GetLength(1); ++index2) - { - string creditIdsByNpcNetId = ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[cavernMonsterType[index1, index2]]; - BestiaryEntryUnlockState stateByKillCount = CommonEnemyUICollectionInfoProvider.GetUnlockStateByKillCount(Main.BestiaryTracker.Kills.GetKillCount(creditIdsByNpcNetId), false); - if (entryUnlockState > stateByKillCount) - entryUnlockState = stateByKillCount; - } - } - unlockstatus = entryUnlockState; - return unlockstatus; - } - - private bool IsIncludedInCurrentWorld() - { - int idsByPersistentId = ContentSamples.NpcNetIdsByPersistentIds[this._persistentIdentifierToCheck]; - int[,] cavernMonsterType = NPC.cavernMonsterType; - for (int index1 = 0; index1 < cavernMonsterType.GetLength(0); ++index1) - { - for (int index2 = 0; index2 < cavernMonsterType.GetLength(1); ++index2) - { - if (ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[cavernMonsterType[index1, index2]] == this._persistentIdentifierToCheck) - return true; - } - } - return false; - } - - public UIElement ProvideUIElement(BestiaryUICollectionInfo info) => (UIElement) null; - } -} diff --git a/GameContent/Bestiary/SearchAliasInfoElement.cs b/GameContent/Bestiary/SearchAliasInfoElement.cs deleted file mode 100644 index 693f24e..0000000 --- a/GameContent/Bestiary/SearchAliasInfoElement.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.SearchAliasInfoElement -// 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 Terraria.UI; - -namespace Terraria.GameContent.Bestiary -{ - public class SearchAliasInfoElement : IBestiaryInfoElement, IProvideSearchFilterString - { - private readonly string _alias; - - public SearchAliasInfoElement(string alias) => this._alias = alias; - - public string GetSearchString(ref BestiaryUICollectionInfo info) => info.UnlockState == BestiaryEntryUnlockState.NotKnownAtAll_0 ? (string) null : this._alias; - - public UIElement ProvideUIElement(BestiaryUICollectionInfo info) => (UIElement) null; - } -} diff --git a/GameContent/Bestiary/SortingSteps.cs b/GameContent/Bestiary/SortingSteps.cs deleted file mode 100644 index 657b416..0000000 --- a/GameContent/Bestiary/SortingSteps.cs +++ /dev/null @@ -1,172 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.SortingSteps -// 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.DataStructures; -using Terraria.ID; -using Terraria.Localization; - -namespace Terraria.GameContent.Bestiary -{ - public static class SortingSteps - { - public class ByNetId : IBestiarySortStep, IEntrySortStep, IComparer - { - public bool HiddenFromSortOptions => true; - - public int Compare(BestiaryEntry x, BestiaryEntry y) - { - NPCNetIdBestiaryInfoElement bestiaryInfoElement1 = x.Info.FirstOrDefault((Func) (element => element is NPCNetIdBestiaryInfoElement)) as NPCNetIdBestiaryInfoElement; - NPCNetIdBestiaryInfoElement bestiaryInfoElement2 = y.Info.FirstOrDefault((Func) (element => element is NPCNetIdBestiaryInfoElement)) as NPCNetIdBestiaryInfoElement; - if (bestiaryInfoElement1 == null && bestiaryInfoElement2 != null) - return 1; - if (bestiaryInfoElement2 == null && bestiaryInfoElement1 != null) - return -1; - return bestiaryInfoElement1 == null || bestiaryInfoElement2 == null ? 0 : bestiaryInfoElement1.NetId.CompareTo(bestiaryInfoElement2.NetId); - } - - public string GetDisplayNameKey() => "BestiaryInfo.Sort_ID"; - } - - public class ByUnlockState : - IBestiarySortStep, - IEntrySortStep, - IComparer - { - public bool HiddenFromSortOptions => true; - - public int Compare(BestiaryEntry x, BestiaryEntry y) - { - BestiaryUICollectionInfo uiCollectionInfo1 = x.UIInfoProvider.GetEntryUICollectionInfo(); - BestiaryUICollectionInfo uiCollectionInfo2 = y.UIInfoProvider.GetEntryUICollectionInfo(); - return y.Icon.GetUnlockState(uiCollectionInfo2).CompareTo(x.Icon.GetUnlockState(uiCollectionInfo1)); - } - - public string GetDisplayNameKey() => "BestiaryInfo.Sort_Unlocks"; - } - - public class ByBestiarySortingId : - IBestiarySortStep, - IEntrySortStep, - IComparer - { - public bool HiddenFromSortOptions => false; - - public int Compare(BestiaryEntry x, BestiaryEntry y) - { - NPCNetIdBestiaryInfoElement bestiaryInfoElement1 = x.Info.FirstOrDefault((Func) (element => element is NPCNetIdBestiaryInfoElement)) as NPCNetIdBestiaryInfoElement; - NPCNetIdBestiaryInfoElement bestiaryInfoElement2 = y.Info.FirstOrDefault((Func) (element => element is NPCNetIdBestiaryInfoElement)) as NPCNetIdBestiaryInfoElement; - if (bestiaryInfoElement1 == null && bestiaryInfoElement2 != null) - return 1; - if (bestiaryInfoElement2 == null && bestiaryInfoElement1 != null) - return -1; - return bestiaryInfoElement1 == null || bestiaryInfoElement2 == null ? 0 : ContentSamples.NpcBestiarySortingId[bestiaryInfoElement1.NetId].CompareTo(ContentSamples.NpcBestiarySortingId[bestiaryInfoElement2.NetId]); - } - - public string GetDisplayNameKey() => "BestiaryInfo.Sort_BestiaryID"; - } - - public class ByBestiaryRarity : - IBestiarySortStep, - IEntrySortStep, - IComparer - { - public bool HiddenFromSortOptions => false; - - public int Compare(BestiaryEntry x, BestiaryEntry y) - { - NPCNetIdBestiaryInfoElement bestiaryInfoElement1 = x.Info.FirstOrDefault((Func) (element => element is NPCNetIdBestiaryInfoElement)) as NPCNetIdBestiaryInfoElement; - NPCNetIdBestiaryInfoElement bestiaryInfoElement2 = y.Info.FirstOrDefault((Func) (element => element is NPCNetIdBestiaryInfoElement)) as NPCNetIdBestiaryInfoElement; - if (bestiaryInfoElement1 == null && bestiaryInfoElement2 != null) - return 1; - if (bestiaryInfoElement2 == null && bestiaryInfoElement1 != null) - return -1; - if (bestiaryInfoElement1 == null || bestiaryInfoElement2 == null) - return 0; - int bestiaryRarityStar = ContentSamples.NpcBestiaryRarityStars[bestiaryInfoElement1.NetId]; - return ContentSamples.NpcBestiaryRarityStars[bestiaryInfoElement2.NetId].CompareTo(bestiaryRarityStar); - } - - public string GetDisplayNameKey() => "BestiaryInfo.Sort_Rarity"; - } - - public class Alphabetical : - IBestiarySortStep, - IEntrySortStep, - IComparer - { - public bool HiddenFromSortOptions => false; - - public int Compare(BestiaryEntry x, BestiaryEntry y) - { - NPCNetIdBestiaryInfoElement bestiaryInfoElement1 = x.Info.FirstOrDefault((Func) (element => element is NPCNetIdBestiaryInfoElement)) as NPCNetIdBestiaryInfoElement; - NPCNetIdBestiaryInfoElement bestiaryInfoElement2 = y.Info.FirstOrDefault((Func) (element => element is NPCNetIdBestiaryInfoElement)) as NPCNetIdBestiaryInfoElement; - if (bestiaryInfoElement1 == null && bestiaryInfoElement2 != null) - return 1; - if (bestiaryInfoElement2 == null && bestiaryInfoElement1 != null) - return -1; - return bestiaryInfoElement1 == null || bestiaryInfoElement2 == null ? 0 : Language.GetTextValue(ContentSamples.NpcsByNetId[bestiaryInfoElement1.NetId].TypeName).CompareTo(Language.GetTextValue(ContentSamples.NpcsByNetId[bestiaryInfoElement2.NetId].TypeName)); - } - - public string GetDisplayNameKey() => "BestiaryInfo.Sort_Alphabetical"; - } - - public abstract class ByStat : - IBestiarySortStep, - IEntrySortStep, - IComparer - { - public bool HiddenFromSortOptions => false; - - public int Compare(BestiaryEntry x, BestiaryEntry y) - { - NPCStatsReportInfoElement cardX = x.Info.FirstOrDefault((Func) (element => this.IsAStatsCardINeed(element, Main.GameMode))) as NPCStatsReportInfoElement; - NPCStatsReportInfoElement cardY = y.Info.FirstOrDefault((Func) (element => this.IsAStatsCardINeed(element, Main.GameMode))) as NPCStatsReportInfoElement; - if (cardX == null && cardY != null) - return 1; - if (cardY == null && cardX != null) - return -1; - return cardX == null || cardY == null ? 0 : this.Compare(cardX, cardY); - } - - public abstract int Compare(NPCStatsReportInfoElement cardX, NPCStatsReportInfoElement cardY); - - public abstract string GetDisplayNameKey(); - - private bool IsAStatsCardINeed(IBestiaryInfoElement element, int gameMode) => element is NPCStatsReportInfoElement reportInfoElement && reportInfoElement.GameMode == gameMode; - } - - public class ByAttack : SortingSteps.ByStat - { - public override int Compare(NPCStatsReportInfoElement cardX, NPCStatsReportInfoElement cardY) => cardY.Damage.CompareTo(cardX.Damage); - - public override string GetDisplayNameKey() => "BestiaryInfo.Sort_Attack"; - } - - public class ByDefense : SortingSteps.ByStat - { - public override int Compare(NPCStatsReportInfoElement cardX, NPCStatsReportInfoElement cardY) => cardY.Defense.CompareTo(cardX.Defense); - - public override string GetDisplayNameKey() => "BestiaryInfo.Sort_Defense"; - } - - public class ByCoins : SortingSteps.ByStat - { - public override int Compare(NPCStatsReportInfoElement cardX, NPCStatsReportInfoElement cardY) => cardY.MonetaryValue.CompareTo(cardX.MonetaryValue); - - public override string GetDisplayNameKey() => "BestiaryInfo.Sort_Coins"; - } - - public class ByHP : SortingSteps.ByStat - { - public override int Compare(NPCStatsReportInfoElement cardX, NPCStatsReportInfoElement cardY) => cardY.LifeMax.CompareTo(cardX.LifeMax); - - public override string GetDisplayNameKey() => "BestiaryInfo.Sort_HitPoints"; - } - } -} diff --git a/GameContent/Bestiary/SpawnConditionBestiaryInfoElement.cs b/GameContent/Bestiary/SpawnConditionBestiaryInfoElement.cs deleted file mode 100644 index 8a4c366..0000000 --- a/GameContent/Bestiary/SpawnConditionBestiaryInfoElement.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.SpawnConditionBestiaryInfoElement -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; - -namespace Terraria.GameContent.Bestiary -{ - public class SpawnConditionBestiaryInfoElement : - FilterProviderInfoElement, - IBestiaryBackgroundImagePathAndColorProvider - { - private string _backgroundImagePath; - private Color? _backgroundColor; - - public SpawnConditionBestiaryInfoElement( - string nameLanguageKey, - int filterIconFrame, - string backgroundImagePath = null, - Color? backgroundColor = null) - : base(nameLanguageKey, filterIconFrame) - { - this._backgroundImagePath = backgroundImagePath; - this._backgroundColor = backgroundColor; - } - - public Asset GetBackgroundImage() => this._backgroundImagePath == null ? (Asset) null : Main.Assets.Request(this._backgroundImagePath, (AssetRequestMode) 1); - - public Color? GetBackgroundColor() => this._backgroundColor; - } -} diff --git a/GameContent/Bestiary/SpawnConditionBestiaryOverlayInfoElement.cs b/GameContent/Bestiary/SpawnConditionBestiaryOverlayInfoElement.cs deleted file mode 100644 index 0b3c14a..0000000 --- a/GameContent/Bestiary/SpawnConditionBestiaryOverlayInfoElement.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.SpawnConditionBestiaryOverlayInfoElement -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; - -namespace Terraria.GameContent.Bestiary -{ - public class SpawnConditionBestiaryOverlayInfoElement : - FilterProviderInfoElement, - IBestiaryBackgroundOverlayAndColorProvider - { - private string _overlayImagePath; - private Color? _overlayColor; - - public float DisplayPriority { get; set; } - - public SpawnConditionBestiaryOverlayInfoElement( - string nameLanguageKey, - int filterIconFrame, - string overlayImagePath = null, - Color? overlayColor = null) - : base(nameLanguageKey, filterIconFrame) - { - this._overlayImagePath = overlayImagePath; - this._overlayColor = overlayColor; - } - - public Asset GetBackgroundOverlayImage() => this._overlayImagePath == null ? (Asset) null : Main.Assets.Request(this._overlayImagePath, (AssetRequestMode) 1); - - public Color? GetBackgroundOverlayColor() => this._overlayColor; - } -} diff --git a/GameContent/Bestiary/SpawnConditionDecorativeOverlayInfoElement.cs b/GameContent/Bestiary/SpawnConditionDecorativeOverlayInfoElement.cs deleted file mode 100644 index bb50c0d..0000000 --- a/GameContent/Bestiary/SpawnConditionDecorativeOverlayInfoElement.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.SpawnConditionDecorativeOverlayInfoElement -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria.UI; - -namespace Terraria.GameContent.Bestiary -{ - public class SpawnConditionDecorativeOverlayInfoElement : - IBestiaryInfoElement, - IBestiaryBackgroundOverlayAndColorProvider - { - private string _overlayImagePath; - private Color? _overlayColor; - - public float DisplayPriority { get; set; } - - public SpawnConditionDecorativeOverlayInfoElement(string overlayImagePath = null, Color? overlayColor = null) - { - this._overlayImagePath = overlayImagePath; - this._overlayColor = overlayColor; - } - - public Asset GetBackgroundOverlayImage() => this._overlayImagePath == null ? (Asset) null : Main.Assets.Request(this._overlayImagePath, (AssetRequestMode) 1); - - public Color? GetBackgroundOverlayColor() => this._overlayColor; - - public UIElement ProvideUIElement(BestiaryUICollectionInfo info) => (UIElement) null; - } -} diff --git a/GameContent/Bestiary/TownNPCUICollectionInfoProvider.cs b/GameContent/Bestiary/TownNPCUICollectionInfoProvider.cs deleted file mode 100644 index 402f933..0000000 --- a/GameContent/Bestiary/TownNPCUICollectionInfoProvider.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.TownNPCUICollectionInfoProvider -// 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 Terraria.UI; - -namespace Terraria.GameContent.Bestiary -{ - public class TownNPCUICollectionInfoProvider : IBestiaryUICollectionInfoProvider - { - private string _persistentIdentifierToCheck; - - public TownNPCUICollectionInfoProvider(string persistentId) => this._persistentIdentifierToCheck = persistentId; - - public BestiaryUICollectionInfo GetEntryUICollectionInfo() => new BestiaryUICollectionInfo() - { - UnlockState = Main.BestiaryTracker.Chats.GetWasChatWith(this._persistentIdentifierToCheck) ? BestiaryEntryUnlockState.CanShowDropsWithDropRates_4 : BestiaryEntryUnlockState.NotKnownAtAll_0 - }; - - public UIElement ProvideUIElement(BestiaryUICollectionInfo info) => (UIElement) null; - } -} diff --git a/GameContent/Bestiary/UnlockProgressDisplayBestiaryInfoElement.cs b/GameContent/Bestiary/UnlockProgressDisplayBestiaryInfoElement.cs deleted file mode 100644 index 947ad7c..0000000 --- a/GameContent/Bestiary/UnlockProgressDisplayBestiaryInfoElement.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.UnlockProgressDisplayBestiaryInfoElement -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using System; -using Terraria.GameContent.UI.Elements; -using Terraria.UI; - -namespace Terraria.GameContent.Bestiary -{ - public class UnlockProgressDisplayBestiaryInfoElement : IBestiaryInfoElement - { - private BestiaryUnlockProgressReport _progressReport; - private UIElement _text1; - private UIElement _text2; - - public UnlockProgressDisplayBestiaryInfoElement(BestiaryUnlockProgressReport progressReport) => this._progressReport = progressReport; - - public UIElement ProvideUIElement(BestiaryUICollectionInfo info) - { - UIPanel uiPanel = new UIPanel(Main.Assets.Request("Images/UI/Bestiary/Stat_Panel", (AssetRequestMode) 1), (Asset) null, customBarSize: 7); - uiPanel.Width = new StyleDimension(-11f, 1f); - uiPanel.Height = new StyleDimension(109f, 0.0f); - uiPanel.BackgroundColor = new Color(43, 56, 101); - uiPanel.BorderColor = Color.Transparent; - uiPanel.Left = new StyleDimension(3f, 0.0f); - UIElement container = (UIElement) uiPanel; - container.PaddingLeft = 4f; - container.PaddingRight = 4f; - string text1 = string.Format("{0} Entry Collected", (object) Utils.PrettifyPercentDisplay((float) info.UnlockState / 4f, "P2")); - string text2 = string.Format("{0} Bestiary Collected", (object) Utils.PrettifyPercentDisplay(this._progressReport.CompletionPercent, "P2")); - int num = 8; - UIText uiText1 = new UIText(text1, 0.8f); - uiText1.HAlign = 0.0f; - uiText1.VAlign = 0.0f; - uiText1.Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f); - uiText1.Height = StyleDimension.FromPixelsAndPercent(0.0f, 1f); - uiText1.IsWrapped = true; - uiText1.PaddingTop = (float) -num; - uiText1.PaddingBottom = (float) -num; - UIText text3 = uiText1; - UIText uiText2 = new UIText(text2, 0.8f); - uiText2.HAlign = 0.0f; - uiText2.VAlign = 0.0f; - uiText2.Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f); - uiText2.Height = StyleDimension.FromPixelsAndPercent(0.0f, 1f); - uiText2.IsWrapped = true; - uiText2.PaddingTop = (float) -num; - uiText2.PaddingBottom = (float) -num; - UIText uiText3 = uiText2; - this._text1 = (UIElement) text3; - this._text2 = (UIElement) uiText3; - this.AddDynamicResize(container, text3); - container.Append((UIElement) text3); - container.Append((UIElement) uiText3); - return container; - } - - private void AddDynamicResize(UIElement container, UIText text) => text.OnInternalTextChange += (Action) (() => - { - container.Height = new StyleDimension(this._text1.MinHeight.Pixels + 4f + this._text2.MinHeight.Pixels, 0.0f); - this._text2.Top = new StyleDimension(this._text1.MinHeight.Pixels + 4f, 0.0f); - }); - } -} diff --git a/GameContent/Bestiary/UnlockableNPCEntryIcon.cs b/GameContent/Bestiary/UnlockableNPCEntryIcon.cs deleted file mode 100644 index 9c00ed4..0000000 --- a/GameContent/Bestiary/UnlockableNPCEntryIcon.cs +++ /dev/null @@ -1,208 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Bestiary.UnlockableNPCEntryIcon -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria.ID; -using Terraria.Localization; - -namespace Terraria.GameContent.Bestiary -{ - public class UnlockableNPCEntryIcon : IEntryIcon - { - private int _npcNetId; - private NPC _npcCache; - private bool _firstUpdateDone; - private Asset _customTexture; - private Vector2 _positionOffsetCache; - private string _overrideNameKey; - - public UnlockableNPCEntryIcon( - int npcNetId, - float ai0 = 0.0f, - float ai1 = 0.0f, - float ai2 = 0.0f, - float ai3 = 0.0f, - string overrideNameKey = null) - { - this._npcNetId = npcNetId; - this._npcCache = new NPC(); - this._npcCache.SetDefaults(this._npcNetId); - this._npcCache.IsABestiaryIconDummy = true; - this._firstUpdateDone = false; - this._npcCache.ai[0] = ai0; - this._npcCache.ai[1] = ai1; - this._npcCache.ai[2] = ai2; - this._npcCache.ai[3] = ai3; - this._customTexture = (Asset) null; - this._overrideNameKey = overrideNameKey; - } - - public IEntryIcon CreateClone() => (IEntryIcon) new UnlockableNPCEntryIcon(this._npcNetId, overrideNameKey: this._overrideNameKey); - - public void Update( - BestiaryUICollectionInfo providedInfo, - Rectangle hitbox, - EntryIconDrawSettings settings) - { - Vector2 vector2 = new Vector2(); - int? nullable1 = new int?(); - int? nullable2 = new int?(); - int? nullable3 = new int?(); - bool flag = false; - float velocity = 0.0f; - Asset asset = (Asset) null; - NPCID.Sets.NPCBestiaryDrawModifiers bestiaryDrawModifiers; - if (NPCID.Sets.NPCBestiaryDrawOffset.TryGetValue(this._npcNetId, out bestiaryDrawModifiers)) - { - this._npcCache.rotation = bestiaryDrawModifiers.Rotation; - this._npcCache.scale = bestiaryDrawModifiers.Scale; - if (bestiaryDrawModifiers.PortraitScale.HasValue && settings.IsPortrait) - this._npcCache.scale = bestiaryDrawModifiers.PortraitScale.Value; - vector2 = bestiaryDrawModifiers.Position; - nullable1 = bestiaryDrawModifiers.Frame; - nullable2 = bestiaryDrawModifiers.Direction; - nullable3 = bestiaryDrawModifiers.SpriteDirection; - velocity = bestiaryDrawModifiers.Velocity; - flag = bestiaryDrawModifiers.IsWet; - if (bestiaryDrawModifiers.PortraitPositionXOverride.HasValue && settings.IsPortrait) - vector2.X = bestiaryDrawModifiers.PortraitPositionXOverride.Value; - if (bestiaryDrawModifiers.PortraitPositionYOverride.HasValue && settings.IsPortrait) - vector2.Y = bestiaryDrawModifiers.PortraitPositionYOverride.Value; - if (bestiaryDrawModifiers.CustomTexturePath != null) - asset = Main.Assets.Request(bestiaryDrawModifiers.CustomTexturePath, (AssetRequestMode) 1); - if (asset != null && asset.IsLoaded) - this._customTexture = asset; - } - this._positionOffsetCache = vector2; - this.UpdatePosition(settings); - if (NPCID.Sets.TrailingMode[this._npcCache.type] != -1) - { - for (int index = 0; index < this._npcCache.oldPos.Length; ++index) - this._npcCache.oldPos[index] = this._npcCache.position; - } - this._npcCache.direction = this._npcCache.spriteDirection = nullable2.HasValue ? nullable2.Value : -1; - if (nullable3.HasValue) - this._npcCache.spriteDirection = nullable3.Value; - this._npcCache.wet = flag; - this.AdjustSpecialSpawnRulesForVisuals(settings); - this.SimulateFirstHover(velocity); - if (!nullable1.HasValue && (settings.IsPortrait || settings.IsHovered)) - { - this._npcCache.velocity.X = (float) this._npcCache.direction * velocity; - this._npcCache.FindFrame(); - } - else - { - if (!nullable1.HasValue) - return; - this._npcCache.FindFrame(); - this._npcCache.frame.Y = this._npcCache.frame.Height * nullable1.Value; - } - } - - private void UpdatePosition(EntryIconDrawSettings settings) - { - if (this._npcCache.noGravity) - this._npcCache.Center = settings.iconbox.Center.ToVector2() + this._positionOffsetCache; - else - this._npcCache.Bottom = settings.iconbox.TopLeft() + settings.iconbox.Size() * new Vector2(0.5f, 1f) + new Vector2(0.0f, -8f) + this._positionOffsetCache; - this._npcCache.position = this._npcCache.position.Floor(); - } - - private void AdjustSpecialSpawnRulesForVisuals(EntryIconDrawSettings settings) - { - int num; - if (NPCID.Sets.SpecialSpawningRules.TryGetValue(this._npcNetId, out num) && num == 0) - { - Point tileCoordinates = (this._npcCache.position - this._npcCache.rotation.ToRotationVector2() * -1600f).ToTileCoordinates(); - this._npcCache.ai[0] = (float) tileCoordinates.X; - this._npcCache.ai[1] = (float) tileCoordinates.Y; - } - switch (this._npcNetId) - { - case 244: - this._npcCache.AI_001_SetRainbowSlimeColor(); - break; - case 299: - case 538: - case 539: - case 639: - case 640: - case 641: - case 642: - case 643: - case 644: - case 645: - if (!settings.IsPortrait || this._npcCache.frame.Y != 0) - break; - this._npcCache.frame.Y = this._npcCache.frame.Height; - break; - case 330: - case 372: - case 586: - case 587: - case 619: - case 620: - this._npcCache.alpha = 0; - break; - case 356: - this._npcCache.ai[2] = 1f; - break; - case 636: - this._npcCache.Opacity = 1f; - if ((double) ++this._npcCache.localAI[0] < 44.0) - break; - this._npcCache.localAI[0] = 0.0f; - break; - case 656: - this._npcCache.townNpcVariationIndex = 1; - break; - } - } - - private void SimulateFirstHover(float velocity) - { - if (this._firstUpdateDone) - return; - this._firstUpdateDone = true; - this._npcCache.SetFrameSize(); - this._npcCache.velocity.X = (float) this._npcCache.direction * velocity; - for (int index = 0; index < 1; ++index) - this._npcCache.FindFrame(); - } - - public void Draw( - BestiaryUICollectionInfo providedInfo, - SpriteBatch spriteBatch, - EntryIconDrawSettings settings) - { - this.UpdatePosition(settings); - if (this._customTexture != null) - { - spriteBatch.Draw(this._customTexture.Value, this._npcCache.Center, new Rectangle?(), Color.White, 0.0f, this._customTexture.Size() / 2f, this._npcCache.scale, SpriteEffects.None, 0.0f); - } - else - { - ITownNPCProfile profile; - if (this._npcCache.townNPC && TownNPCProfiles.Instance.GetProfile(this._npcCache.type, out profile)) - TextureAssets.Npc[this._npcCache.type] = profile.GetTextureNPCShouldUse(this._npcCache); - Main.instance.DrawNPCDirect(spriteBatch, this._npcCache, this._npcCache.behindTiles, Vector2.Zero); - } - } - - public string GetHoverText(BestiaryUICollectionInfo providedInfo) - { - string str = Lang.GetNPCNameValue(this._npcCache.netID); - if (!string.IsNullOrWhiteSpace(this._overrideNameKey)) - str = Language.GetTextValue(this._overrideNameKey); - return this.GetUnlockState(providedInfo) ? str : "???"; - } - - public bool GetUnlockState(BestiaryUICollectionInfo providedInfo) => providedInfo.UnlockState > BestiaryEntryUnlockState.NotKnownAtAll_0; - } -} diff --git a/GameContent/Biomes/CampsiteBiome.cs b/GameContent/Biomes/CampsiteBiome.cs index d98bece..d3f20c9 100644 --- a/GameContent/Biomes/CampsiteBiome.cs +++ b/GameContent/Biomes/CampsiteBiome.cs @@ -1,11 +1,11 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Biomes.CampsiteBiome -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; -using Terraria.WorldBuilding; +using Terraria.World.Generation; namespace Terraria.GameContent.Biomes { @@ -22,33 +22,12 @@ namespace Terraria.GameContent.Biomes int num1 = GenBase._random.Next(5); if (!structures.CanPlace(new Microsoft.Xna.Framework.Rectangle(origin.X - radius, origin.Y - radius, radius * 2, radius * 2))) return false; - ushort type1 = (ushort) (byte) (196 + WorldGen.genRand.Next(4)); - for (int index1 = origin.X - radius; index1 <= origin.X + radius; ++index1) - { - for (int index2 = origin.Y - radius; index2 <= origin.Y + radius; ++index2) - { - if (Main.tile[index1, index2].active()) - { - int type2 = (int) Main.tile[index1, index2].type; - if (type2 == 53 || type2 == 396 || type2 == 397 || type2 == 404) - type1 = (ushort) 187; - if (type2 == 161 || type2 == 147) - type1 = (ushort) 40; - if (type2 == 60) - type1 = (ushort) (byte) (204 + WorldGen.genRand.Next(4)); - if (type2 == 367) - type1 = (ushort) 178; - if (type2 == 368) - type1 = (ushort) 180; - } - } - } ShapeData data = new ShapeData(); WorldUtils.Gen(origin, (GenShape) new Shapes.Slime(radius), Actions.Chain(new Modifiers.Blotches(num1, num1, num1, 1).Output(data), (GenAction) new Modifiers.Offset(0, -2), (GenAction) new Modifiers.OnlyTiles(new ushort[1] { (ushort) 53 - }), (GenAction) new Actions.SetTile((ushort) 397, true), (GenAction) new Modifiers.OnlyWalls(new ushort[1]), (GenAction) new Actions.PlaceWall(type1))); - WorldUtils.Gen(origin, (GenShape) new ModShapes.All(data), Actions.Chain((GenAction) new Actions.ClearTile(), (GenAction) new Actions.SetLiquid(value: (byte) 0), (GenAction) new Actions.SetFrames(true), (GenAction) new Modifiers.OnlyWalls(new ushort[1]), (GenAction) new Actions.PlaceWall(type1))); + }), (GenAction) new Actions.SetTile((ushort) 397, true), (GenAction) new Modifiers.OnlyWalls(new byte[1]), (GenAction) new Actions.PlaceWall((byte) 16))); + WorldUtils.Gen(origin, (GenShape) new ModShapes.All(data), Actions.Chain((GenAction) new Actions.ClearTile(), (GenAction) new Actions.SetLiquid(value: (byte) 0), (GenAction) new Actions.SetFrames(true), (GenAction) new Modifiers.OnlyWalls(new byte[1]), (GenAction) new Actions.PlaceWall((byte) 16))); Point result; if (!WorldUtils.Find(origin, Searches.Chain((GenSearch) new Searches.Down(10), (GenCondition) new Conditions.IsSolid()), out result)) return false; @@ -58,11 +37,11 @@ namespace Terraria.GameContent.Biomes { int num2 = GenBase._random.Next(1, 4); int num3 = flag ? 4 : -(radius >> 1); - for (int index3 = 0; index3 < num2; ++index3) + for (int index1 = 0; index1 < num2; ++index1) { int num4 = GenBase._random.Next(1, 3); - for (int index4 = 0; index4 < num4; ++index4) - WorldGen.PlaceTile(origin.X + num3 - index3, j - index4, 332, true); + for (int index2 = 0; index2 < num4; ++index2) + WorldGen.PlaceTile(origin.X + num3 - index1, j - index2, 331); } } int num5 = (radius - 3) * (flag ? -1 : 1); @@ -81,7 +60,7 @@ namespace Terraria.GameContent.Biomes GenBase._tiles[origin.X + 1, j - 1].frameY += (short) 36; } } - structures.AddProtectedStructure(new Microsoft.Xna.Framework.Rectangle(origin.X - radius, origin.Y - radius, radius * 2, radius * 2), 4); + structures.AddStructure(new Microsoft.Xna.Framework.Rectangle(origin.X - radius, origin.Y - radius, radius * 2, radius * 2), 4); return true; } } diff --git a/GameContent/Biomes/CaveHouse/DesertHouseBuilder.cs b/GameContent/Biomes/CaveHouse/DesertHouseBuilder.cs deleted file mode 100644 index 3e41085..0000000 --- a/GameContent/Biomes/CaveHouse/DesertHouseBuilder.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Biomes.CaveHouse.DesertHouseBuilder -// 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; -using System.Collections.Generic; -using Terraria.GameContent.Generation; -using Terraria.WorldBuilding; - -namespace Terraria.GameContent.Biomes.CaveHouse -{ - public class DesertHouseBuilder : HouseBuilder - { - public DesertHouseBuilder(IEnumerable rooms) - : base(HouseType.Desert, rooms) - { - this.TileType = (ushort) 396; - this.WallType = (ushort) 187; - this.BeamType = (ushort) 577; - this.PlatformStyle = 42; - this.DoorStyle = 43; - this.TableStyle = 7; - this.UsesTables2 = true; - this.WorkbenchStyle = 39; - this.PianoStyle = 38; - this.BookcaseStyle = 39; - this.ChairStyle = 43; - this.ChestStyle = 1; - } - - protected override void AgeRoom(Microsoft.Xna.Framework.Rectangle room) - { - WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.Dither(0.800000011920929), (GenAction) new Modifiers.Blotches(chance: 0.200000002980232), (GenAction) new Modifiers.OnlyTiles(new ushort[1] - { - this.TileType - }), (GenAction) new Actions.SetTileKeepWall((ushort) 396, true), (GenAction) new Modifiers.Dither(), (GenAction) new Actions.SetTileKeepWall((ushort) 397, true))); - WorldUtils.Gen(new Point(room.X + 1, room.Y), (GenShape) new Shapes.Rectangle(room.Width - 2, 1), Actions.Chain((GenAction) new Modifiers.Dither(), (GenAction) new Modifiers.OnlyTiles(new ushort[2] - { - (ushort) 397, - (ushort) 396 - }), (GenAction) new Modifiers.Offset(0, 1), (GenAction) new ActionStalagtite())); - WorldUtils.Gen(new Point(room.X + 1, room.Y + room.Height - 1), (GenShape) new Shapes.Rectangle(room.Width - 2, 1), Actions.Chain((GenAction) new Modifiers.Dither(), (GenAction) new Modifiers.OnlyTiles(new ushort[2] - { - (ushort) 397, - (ushort) 396 - }), (GenAction) new Modifiers.Offset(0, 1), (GenAction) new ActionStalagtite())); - WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.Dither(0.800000011920929), (GenAction) new Modifiers.Blotches(), (GenAction) new Modifiers.OnlyWalls(new ushort[1] - { - this.WallType - }), (GenAction) new Actions.PlaceWall((ushort) 216))); - } - } -} diff --git a/GameContent/Biomes/CaveHouse/GraniteHouseBuilder.cs b/GameContent/Biomes/CaveHouse/GraniteHouseBuilder.cs deleted file mode 100644 index 59351e6..0000000 --- a/GameContent/Biomes/CaveHouse/GraniteHouseBuilder.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Biomes.CaveHouse.GraniteHouseBuilder -// 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; -using System.Collections.Generic; -using Terraria.GameContent.Generation; -using Terraria.WorldBuilding; - -namespace Terraria.GameContent.Biomes.CaveHouse -{ - public class GraniteHouseBuilder : HouseBuilder - { - public GraniteHouseBuilder(IEnumerable rooms) - : base(HouseType.Granite, rooms) - { - this.TileType = (ushort) 369; - this.WallType = (ushort) 181; - this.BeamType = (ushort) 576; - this.PlatformStyle = 28; - this.DoorStyle = 34; - this.TableStyle = 33; - this.WorkbenchStyle = 29; - this.PianoStyle = 28; - this.BookcaseStyle = 30; - this.ChairStyle = 34; - this.ChestStyle = 50; - } - - protected override void AgeRoom(Microsoft.Xna.Framework.Rectangle room) - { - WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.Dither(0.600000023841858), (GenAction) new Modifiers.Blotches(chance: 0.600000023841858), (GenAction) new Modifiers.OnlyTiles(new ushort[1] - { - this.TileType - }), (GenAction) new Actions.SetTileKeepWall((ushort) 368, true))); - WorldUtils.Gen(new Point(room.X + 1, room.Y), (GenShape) new Shapes.Rectangle(room.Width - 2, 1), Actions.Chain((GenAction) new Modifiers.Dither(0.800000011920929), (GenAction) new Modifiers.OnlyTiles(new ushort[1] - { - (ushort) 368 - }), (GenAction) new Modifiers.Offset(0, 1), (GenAction) new ActionStalagtite())); - WorldUtils.Gen(new Point(room.X + 1, room.Y + room.Height - 1), (GenShape) new Shapes.Rectangle(room.Width - 2, 1), Actions.Chain((GenAction) new Modifiers.Dither(0.800000011920929), (GenAction) new Modifiers.OnlyTiles(new ushort[1] - { - (ushort) 368 - }), (GenAction) new Modifiers.Offset(0, 1), (GenAction) new ActionStalagtite())); - WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.Dither(0.850000023841858), (GenAction) new Modifiers.Blotches(), (GenAction) new Actions.PlaceWall((ushort) 180))); - } - } -} diff --git a/GameContent/Biomes/CaveHouse/HouseBuilder.cs b/GameContent/Biomes/CaveHouse/HouseBuilder.cs deleted file mode 100644 index 6d177c2..0000000 --- a/GameContent/Biomes/CaveHouse/HouseBuilder.cs +++ /dev/null @@ -1,441 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Biomes.CaveHouse.HouseBuilder -// 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; -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using Terraria.Utilities; -using Terraria.WorldBuilding; - -namespace Terraria.GameContent.Biomes.CaveHouse -{ - public class HouseBuilder - { - private const int VERTICAL_EXIT_WIDTH = 3; - public static readonly HouseBuilder Invalid = new HouseBuilder(); - public readonly HouseType Type; - public readonly bool IsValid; - protected ushort[] SkipTilesDuringWallAging = new ushort[5] - { - (ushort) 245, - (ushort) 246, - (ushort) 240, - (ushort) 241, - (ushort) 242 - }; - - public float ChestChance { get; set; } - - public ushort TileType { get; protected set; } - - public ushort WallType { get; protected set; } - - public ushort BeamType { get; protected set; } - - public int PlatformStyle { get; protected set; } - - public int DoorStyle { get; protected set; } - - public int TableStyle { get; protected set; } - - public bool UsesTables2 { get; protected set; } - - public int WorkbenchStyle { get; protected set; } - - public int PianoStyle { get; protected set; } - - public int BookcaseStyle { get; protected set; } - - public int ChairStyle { get; protected set; } - - public int ChestStyle { get; protected set; } - - public ReadOnlyCollection Rooms { get; private set; } - - public Microsoft.Xna.Framework.Rectangle TopRoom => this.Rooms.First(); - - public Microsoft.Xna.Framework.Rectangle BottomRoom => this.Rooms.Last(); - - private UnifiedRandom _random => WorldGen.genRand; - - private Tile[,] _tiles => Main.tile; - - private HouseBuilder() => this.IsValid = false; - - protected HouseBuilder(HouseType type, IEnumerable rooms) - { - this.Type = type; - this.IsValid = true; - List list = rooms.ToList(); - list.Sort((Comparison) ((lhs, rhs) => lhs.Top.CompareTo(rhs.Top))); - this.Rooms = list.AsReadOnly(); - } - - protected virtual void AgeRoom(Microsoft.Xna.Framework.Rectangle room) - { - } - - public void Place(HouseBuilderContext context, StructureMap structures) - { - this.PlaceEmptyRooms(); - foreach (Microsoft.Xna.Framework.Rectangle room in this.Rooms) - structures.AddProtectedStructure(room, 8); - this.PlaceStairs(); - this.PlaceDoors(); - this.PlacePlatforms(); - this.PlaceSupportBeams(); - this.FillRooms(); - foreach (Microsoft.Xna.Framework.Rectangle room in this.Rooms) - this.AgeRoom(room); - this.PlaceChests(); - this.PlaceBiomeSpecificTool(context); - } - - private void PlaceEmptyRooms() - { - foreach (Microsoft.Xna.Framework.Rectangle room in this.Rooms) - { - WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Actions.SetTileKeepWall(this.TileType), (GenAction) new Actions.SetFrames(true))); - WorldUtils.Gen(new Point(room.X + 1, room.Y + 1), (GenShape) new Shapes.Rectangle(room.Width - 2, room.Height - 2), Actions.Chain((GenAction) new Actions.ClearTile(true), (GenAction) new Actions.PlaceWall(this.WallType))); - } - } - - private void FillRooms() - { - int x1 = 14; - if (this.UsesTables2) - x1 = 469; - Point[] pointArray = new Point[7] - { - new Point(x1, this.TableStyle), - new Point(16, 0), - new Point(18, this.WorkbenchStyle), - new Point(86, 0), - new Point(87, this.PianoStyle), - new Point(94, 0), - new Point(101, this.BookcaseStyle) - }; - foreach (Microsoft.Xna.Framework.Rectangle room in this.Rooms) - { - int num1 = room.Width / 8; - int num2 = room.Width / (num1 + 1); - int num3 = this._random.Next(2); - for (int index1 = 0; index1 < num1; ++index1) - { - int i = (index1 + 1) * num2 + room.X; - switch (index1 + num3 % 2) - { - case 0: - int j1 = room.Y + Math.Min(room.Height / 2, room.Height - 5); - Vector2 vector2 = this.Type != HouseType.Desert ? WorldGen.randHousePicture() : WorldGen.RandHousePictureDesert(); - int x2 = (int) vector2.X; - int y = (int) vector2.Y; - WorldGen.PlaceTile(i, j1, x2, true, style: y); - break; - case 1: - int j2 = room.Y + 1; - WorldGen.PlaceTile(i, j2, 34, true, style: this._random.Next(6)); - for (int index2 = -1; index2 < 2; ++index2) - { - for (int index3 = 0; index3 < 3; ++index3) - this._tiles[index2 + i, index3 + j2].frameX += (short) 54; - } - break; - } - } - int num4 = room.Width / 8 + 3; - WorldGen.SetupStatueList(); - for (; num4 > 0; --num4) - { - int num5 = this._random.Next(room.Width - 3) + 1 + room.X; - int num6 = room.Y + room.Height - 2; - switch (this._random.Next(4)) - { - case 0: - WorldGen.PlaceSmallPile(num5, num6, this._random.Next(31, 34), 1); - break; - case 1: - WorldGen.PlaceTile(num5, num6, 186, true, style: this._random.Next(22, 26)); - break; - case 2: - int index = this._random.Next(2, WorldGen.statueList.Length); - WorldGen.PlaceTile(num5, num6, (int) WorldGen.statueList[index].X, true, style: ((int) WorldGen.statueList[index].Y)); - if (WorldGen.StatuesWithTraps.Contains(index)) - { - WorldGen.PlaceStatueTrap(num5, num6); - break; - } - break; - case 3: - Point point = Utils.SelectRandom(this._random, pointArray); - WorldGen.PlaceTile(num5, num6, point.X, true, style: point.Y); - break; - } - } - } - } - - private void PlaceStairs() - { - foreach (Tuple stairs in this.CreateStairsList()) - { - Point origin = stairs.Item1; - Point point = stairs.Item2; - int num = point.X > origin.X ? 1 : -1; - ShapeData data = new ShapeData(); - for (int y = 0; y < point.Y - origin.Y; ++y) - data.Add(num * (y + 1), y); - WorldUtils.Gen(origin, (GenShape) new ModShapes.All(data), Actions.Chain((GenAction) new Actions.PlaceTile((ushort) 19, this.PlatformStyle), (GenAction) new Actions.SetSlope(num == 1 ? 1 : 2), (GenAction) new Actions.SetFrames(true))); - WorldUtils.Gen(new Point(origin.X + (num == 1 ? 1 : -4), origin.Y - 1), (GenShape) new Shapes.Rectangle(4, 1), Actions.Chain((GenAction) new Actions.Clear(), (GenAction) new Actions.PlaceWall(this.WallType), (GenAction) new Actions.PlaceTile((ushort) 19, this.PlatformStyle), (GenAction) new Actions.SetFrames(true))); - } - } - - private List> CreateStairsList() - { - List> tupleList = new List>(); - for (int index = 1; index < this.Rooms.Count; ++index) - { - Microsoft.Xna.Framework.Rectangle room1 = this.Rooms[index]; - Microsoft.Xna.Framework.Rectangle room2 = this.Rooms[index - 1]; - if (room2.X - room1.X > room1.X + room1.Width - (room2.X + room2.Width)) - tupleList.Add(new Tuple(new Point(room1.X + room1.Width - 1, room1.Y + 1), new Point(room1.X + room1.Width - room1.Height + 1, room1.Y + room1.Height - 1))); - else - tupleList.Add(new Tuple(new Point(room1.X, room1.Y + 1), new Point(room1.X + room1.Height - 1, room1.Y + room1.Height - 1))); - } - return tupleList; - } - - private void PlaceDoors() - { - foreach (Point door in this.CreateDoorList()) - { - WorldUtils.Gen(door, (GenShape) new Shapes.Rectangle(1, 3), (GenAction) new Actions.ClearTile(true)); - WorldGen.PlaceTile(door.X, door.Y, 10, true, true, style: this.DoorStyle); - } - } - - private List CreateDoorList() - { - List pointList = new List(); - foreach (Microsoft.Xna.Framework.Rectangle room in this.Rooms) - { - int exitY; - if (HouseBuilder.FindSideExit(new Microsoft.Xna.Framework.Rectangle(room.X + room.Width, room.Y + 1, 1, room.Height - 2), false, out exitY)) - pointList.Add(new Point(room.X + room.Width - 1, exitY)); - if (HouseBuilder.FindSideExit(new Microsoft.Xna.Framework.Rectangle(room.X, room.Y + 1, 1, room.Height - 2), true, out exitY)) - pointList.Add(new Point(room.X, exitY)); - } - return pointList; - } - - private void PlacePlatforms() - { - foreach (Point platforms in this.CreatePlatformsList()) - WorldUtils.Gen(platforms, (GenShape) new Shapes.Rectangle(3, 1), Actions.Chain((GenAction) new Actions.ClearMetadata(), (GenAction) new Actions.PlaceTile((ushort) 19, this.PlatformStyle), (GenAction) new Actions.SetFrames(true))); - } - - private List CreatePlatformsList() - { - List pointList = new List(); - Microsoft.Xna.Framework.Rectangle topRoom = this.TopRoom; - Microsoft.Xna.Framework.Rectangle bottomRoom = this.BottomRoom; - int exitX; - if (HouseBuilder.FindVerticalExit(new Microsoft.Xna.Framework.Rectangle(topRoom.X + 2, topRoom.Y, topRoom.Width - 4, 1), true, out exitX)) - pointList.Add(new Point(exitX, topRoom.Y)); - if (HouseBuilder.FindVerticalExit(new Microsoft.Xna.Framework.Rectangle(bottomRoom.X + 2, bottomRoom.Y + bottomRoom.Height - 1, bottomRoom.Width - 4, 1), false, out exitX)) - pointList.Add(new Point(exitX, bottomRoom.Y + bottomRoom.Height - 1)); - return pointList; - } - - private void PlaceSupportBeams() - { - foreach (Microsoft.Xna.Framework.Rectangle supportBeam in this.CreateSupportBeamList()) - { - if (supportBeam.Height > 1 && this._tiles[supportBeam.X, supportBeam.Y - 1].type != (ushort) 19) - { - WorldUtils.Gen(new Point(supportBeam.X, supportBeam.Y), (GenShape) new Shapes.Rectangle(supportBeam.Width, supportBeam.Height), Actions.Chain((GenAction) new Actions.SetTileKeepWall(this.BeamType), (GenAction) new Actions.SetFrames(true))); - Tile tile = this._tiles[supportBeam.X, supportBeam.Y + supportBeam.Height]; - tile.slope((byte) 0); - tile.halfBrick(false); - } - } - } - - private List CreateSupportBeamList() - { - List rectangleList = new List(); - int num1 = this.Rooms.Min((Func) (room => room.Left)); - int num2 = this.Rooms.Max((Func) (room => room.Right)) - 1; - int num3 = 6; - while (num3 > 4 && (num2 - num1) % num3 != 0) - --num3; - for (int x = num1; x <= num2; x += num3) - { - for (int index1 = 0; index1 < this.Rooms.Count; ++index1) - { - Microsoft.Xna.Framework.Rectangle room = this.Rooms[index1]; - if (x >= room.X && x < room.X + room.Width) - { - int y = room.Y + room.Height; - int num4 = 50; - for (int index2 = index1 + 1; index2 < this.Rooms.Count; ++index2) - { - if (x >= this.Rooms[index2].X && x < this.Rooms[index2].X + this.Rooms[index2].Width) - num4 = Math.Min(num4, this.Rooms[index2].Y - y); - } - if (num4 > 0) - { - Point result; - bool flag = WorldUtils.Find(new Point(x, y), Searches.Chain((GenSearch) new Searches.Down(num4), (GenCondition) new Conditions.IsSolid()), out result); - if (num4 < 50) - { - flag = true; - result = new Point(x, y + num4); - } - if (flag) - rectangleList.Add(new Microsoft.Xna.Framework.Rectangle(x, y, 1, result.Y - y)); - } - } - } - } - return rectangleList; - } - - private static bool FindVerticalExit(Microsoft.Xna.Framework.Rectangle wall, bool isUp, out int exitX) - { - Point result; - int num = WorldUtils.Find(new Point(wall.X + wall.Width - 3, wall.Y + (isUp ? -5 : 0)), Searches.Chain((GenSearch) new Searches.Left(wall.Width - 3), new Conditions.IsSolid().Not().AreaOr(3, 5)), out result) ? 1 : 0; - exitX = result.X; - return num != 0; - } - - private static bool FindSideExit(Microsoft.Xna.Framework.Rectangle wall, bool isLeft, out int exitY) - { - Point result; - int num = WorldUtils.Find(new Point(wall.X + (isLeft ? -4 : 0), wall.Y + wall.Height - 3), Searches.Chain((GenSearch) new Searches.Up(wall.Height - 3), new Conditions.IsSolid().Not().AreaOr(4, 3)), out result) ? 1 : 0; - exitY = result.Y; - return num != 0; - } - - private void PlaceChests() - { - if ((double) this._random.NextFloat() > (double) this.ChestChance) - return; - bool flag = false; - foreach (Microsoft.Xna.Framework.Rectangle room in this.Rooms) - { - int j = room.Height - 1 + room.Y; - int Style = j > (int) Main.worldSurface ? this.ChestStyle : 0; - int num = 0; - while (num < 10 && !(flag = WorldGen.AddBuriedChest(this._random.Next(2, room.Width - 2) + room.X, j, Style: Style))) - ++num; - if (!flag) - { - int i = room.X + 2; - while (i <= room.X + room.Width - 2 && !(flag = WorldGen.AddBuriedChest(i, j, Style: Style))) - ++i; - if (flag) - break; - } - else - break; - } - if (!flag) - { - foreach (Microsoft.Xna.Framework.Rectangle room in this.Rooms) - { - int j = room.Y - 1; - int Style = j > (int) Main.worldSurface ? this.ChestStyle : 0; - int num = 0; - while (num < 10 && !(flag = WorldGen.AddBuriedChest(this._random.Next(2, room.Width - 2) + room.X, j, Style: Style))) - ++num; - if (!flag) - { - int i = room.X + 2; - while (i <= room.X + room.Width - 2 && !(flag = WorldGen.AddBuriedChest(i, j, Style: Style))) - ++i; - if (flag) - break; - } - else - break; - } - } - if (flag) - return; - for (int index = 0; index < 1000; ++index) - { - int i = this._random.Next(this.Rooms[0].X - 30, this.Rooms[0].X + 30); - int num1 = this._random.Next(this.Rooms[0].Y - 30, this.Rooms[0].Y + 30); - int num2 = num1 > (int) Main.worldSurface ? this.ChestStyle : 0; - int j = num1; - int Style = num2; - if (WorldGen.AddBuriedChest(i, j, Style: Style)) - break; - } - } - - private void PlaceBiomeSpecificTool(HouseBuilderContext context) - { - if (this.Type == HouseType.Jungle && context.SharpenerCount < this._random.Next(2, 5)) - { - bool flag = false; - foreach (Microsoft.Xna.Framework.Rectangle room in this.Rooms) - { - int j = room.Height - 2 + room.Y; - for (int index = 0; index < 10; ++index) - { - int i = this._random.Next(2, room.Width - 2) + room.X; - WorldGen.PlaceTile(i, j, 377, true, true); - if (flag = this._tiles[i, j].active() && this._tiles[i, j].type == (ushort) 377) - break; - } - if (!flag) - { - int i = room.X + 2; - while (i <= room.X + room.Width - 2 && !(flag = WorldGen.PlaceTile(i, j, 377, true, true))) - ++i; - if (flag) - break; - } - else - break; - } - if (flag) - ++context.SharpenerCount; - } - if (this.Type != HouseType.Desert || context.ExtractinatorCount >= this._random.Next(2, 5)) - return; - bool flag1 = false; - foreach (Microsoft.Xna.Framework.Rectangle room in this.Rooms) - { - int j = room.Height - 2 + room.Y; - for (int index = 0; index < 10; ++index) - { - int i = this._random.Next(2, room.Width - 2) + room.X; - WorldGen.PlaceTile(i, j, 219, true, true); - if (flag1 = this._tiles[i, j].active() && this._tiles[i, j].type == (ushort) 219) - break; - } - if (!flag1) - { - int i = room.X + 2; - while (i <= room.X + room.Width - 2 && !(flag1 = WorldGen.PlaceTile(i, j, 219, true, true))) - ++i; - if (flag1) - break; - } - else - break; - } - if (!flag1) - return; - ++context.ExtractinatorCount; - } - } -} diff --git a/GameContent/Biomes/CaveHouse/HouseBuilderContext.cs b/GameContent/Biomes/CaveHouse/HouseBuilderContext.cs deleted file mode 100644 index 16c4012..0000000 --- a/GameContent/Biomes/CaveHouse/HouseBuilderContext.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Biomes.CaveHouse.HouseBuilderContext -// 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.Biomes.CaveHouse -{ - public class HouseBuilderContext - { - public int SharpenerCount; - public int ExtractinatorCount; - } -} diff --git a/GameContent/Biomes/CaveHouse/HouseType.cs b/GameContent/Biomes/CaveHouse/HouseType.cs deleted file mode 100644 index 9591029..0000000 --- a/GameContent/Biomes/CaveHouse/HouseType.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Biomes.CaveHouse.HouseType -// 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.Biomes.CaveHouse -{ - public enum HouseType - { - Wood, - Ice, - Desert, - Jungle, - Mushroom, - Granite, - Marble, - } -} diff --git a/GameContent/Biomes/CaveHouse/HouseUtils.cs b/GameContent/Biomes/CaveHouse/HouseUtils.cs deleted file mode 100644 index df819d5..0000000 --- a/GameContent/Biomes/CaveHouse/HouseUtils.cs +++ /dev/null @@ -1,180 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Biomes.CaveHouse.HouseUtils -// 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; -using System; -using System.Collections.Generic; -using Terraria.ID; -using Terraria.WorldBuilding; - -namespace Terraria.GameContent.Biomes.CaveHouse -{ - public static class HouseUtils - { - private static readonly bool[] BlacklistedTiles = TileID.Sets.Factory.CreateBoolSet(true, 225, 41, 43, 44, 226, 203, 112, 25, 151); - private static readonly bool[] BeelistedTiles = TileID.Sets.Factory.CreateBoolSet(true, 41, 43, 44, 226, 203, 112, 25, 151); - - public static HouseBuilder CreateBuilder(Point origin, StructureMap structures) - { - List rooms = HouseUtils.CreateRooms(origin); - if (rooms.Count == 0 || !HouseUtils.AreRoomLocationsValid((IEnumerable) rooms)) - return HouseBuilder.Invalid; - HouseType houseType = HouseUtils.GetHouseType((IEnumerable) rooms); - if (!HouseUtils.AreRoomsValid((IEnumerable) rooms, structures, houseType)) - return HouseBuilder.Invalid; - switch (houseType) - { - case HouseType.Wood: - return (HouseBuilder) new WoodHouseBuilder((IEnumerable) rooms); - case HouseType.Ice: - return (HouseBuilder) new IceHouseBuilder((IEnumerable) rooms); - case HouseType.Desert: - return (HouseBuilder) new DesertHouseBuilder((IEnumerable) rooms); - case HouseType.Jungle: - return (HouseBuilder) new JungleHouseBuilder((IEnumerable) rooms); - case HouseType.Mushroom: - return (HouseBuilder) new MushroomHouseBuilder((IEnumerable) rooms); - case HouseType.Granite: - return (HouseBuilder) new GraniteHouseBuilder((IEnumerable) rooms); - case HouseType.Marble: - return (HouseBuilder) new MarbleHouseBuilder((IEnumerable) rooms); - default: - return (HouseBuilder) new WoodHouseBuilder((IEnumerable) rooms); - } - } - - private static List CreateRooms(Point origin) - { - Point result; - if (!WorldUtils.Find(origin, Searches.Chain((GenSearch) new Searches.Down(200), (GenCondition) new Conditions.IsSolid()), out result) || result == origin) - return new List(); - Microsoft.Xna.Framework.Rectangle room1 = HouseUtils.FindRoom(result); - Microsoft.Xna.Framework.Rectangle room2 = HouseUtils.FindRoom(new Point(room1.Center.X, room1.Y + 1)); - Microsoft.Xna.Framework.Rectangle room3 = HouseUtils.FindRoom(new Point(room1.Center.X, room1.Y + room1.Height + 10)); - room3.Y = room1.Y + room1.Height - 1; - float roomSolidPrecentage1 = HouseUtils.GetRoomSolidPrecentage(room2); - float roomSolidPrecentage2 = HouseUtils.GetRoomSolidPrecentage(room3); - room1.Y += 3; - room2.Y += 3; - room3.Y += 3; - List rectangleList = new List(); - if ((double) WorldGen.genRand.NextFloat() > (double) roomSolidPrecentage1 + 0.200000002980232) - rectangleList.Add(room2); - rectangleList.Add(room1); - if ((double) WorldGen.genRand.NextFloat() > (double) roomSolidPrecentage2 + 0.200000002980232) - rectangleList.Add(room3); - return rectangleList; - } - - private static Microsoft.Xna.Framework.Rectangle FindRoom(Point origin) - { - Point result1; - bool flag1 = WorldUtils.Find(origin, Searches.Chain((GenSearch) new Searches.Left(25), (GenCondition) new Conditions.IsSolid()), out result1); - Point result2; - int num1 = WorldUtils.Find(origin, Searches.Chain((GenSearch) new Searches.Right(25), (GenCondition) new Conditions.IsSolid()), out result2) ? 1 : 0; - if (!flag1) - result1 = new Point(origin.X - 25, origin.Y); - if (num1 == 0) - result2 = new Point(origin.X + 25, origin.Y); - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(origin.X, origin.Y, 0, 0); - if (origin.X - result1.X > result2.X - origin.X) - { - rectangle.X = result1.X; - rectangle.Width = Utils.Clamp(result2.X - result1.X, 15, 30); - } - else - { - rectangle.Width = Utils.Clamp(result2.X - result1.X, 15, 30); - rectangle.X = result2.X - rectangle.Width; - } - Point result3; - bool flag2 = WorldUtils.Find(result1, Searches.Chain((GenSearch) new Searches.Up(10), (GenCondition) new Conditions.IsSolid()), out result3); - Point result4; - int num2 = WorldUtils.Find(result2, Searches.Chain((GenSearch) new Searches.Up(10), (GenCondition) new Conditions.IsSolid()), out result4) ? 1 : 0; - if (!flag2) - result3 = new Point(origin.X, origin.Y - 10); - if (num2 == 0) - result4 = new Point(origin.X, origin.Y - 10); - rectangle.Height = Utils.Clamp(Math.Max(origin.Y - result3.Y, origin.Y - result4.Y), 8, 12); - rectangle.Y -= rectangle.Height; - return rectangle; - } - - private static float GetRoomSolidPrecentage(Microsoft.Xna.Framework.Rectangle room) - { - float num = (float) (room.Width * room.Height); - Ref count = new Ref(0); - WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.IsSolid(), (GenAction) new Actions.Count(count))); - return (float) count.Value / num; - } - - private static int SortBiomeResults(Tuple item1, Tuple item2) => item2.Item2.CompareTo(item1.Item2); - - private static bool AreRoomLocationsValid(IEnumerable rooms) - { - foreach (Microsoft.Xna.Framework.Rectangle room in rooms) - { - if (room.Y + room.Height > Main.maxTilesY - 220) - return false; - } - return true; - } - - private static HouseType GetHouseType(IEnumerable rooms) - { - Dictionary resultsOutput = new Dictionary(); - foreach (Microsoft.Xna.Framework.Rectangle room in rooms) - WorldUtils.Gen(new Point(room.X - 10, room.Y - 10), (GenShape) new Shapes.Rectangle(room.Width + 20, room.Height + 20), (GenAction) new Actions.TileScanner(new ushort[12] - { - (ushort) 0, - (ushort) 59, - (ushort) 147, - (ushort) 1, - (ushort) 161, - (ushort) 53, - (ushort) 396, - (ushort) 397, - (ushort) 368, - (ushort) 367, - (ushort) 60, - (ushort) 70 - }).Output(resultsOutput)); - List> tupleList = new List>(); - tupleList.Add(Tuple.Create(HouseType.Wood, resultsOutput[(ushort) 0] + resultsOutput[(ushort) 1])); - tupleList.Add(Tuple.Create(HouseType.Jungle, resultsOutput[(ushort) 59] + resultsOutput[(ushort) 60] * 10)); - tupleList.Add(Tuple.Create(HouseType.Mushroom, resultsOutput[(ushort) 59] + resultsOutput[(ushort) 70] * 10)); - tupleList.Add(Tuple.Create(HouseType.Ice, resultsOutput[(ushort) 147] + resultsOutput[(ushort) 161])); - tupleList.Add(Tuple.Create(HouseType.Desert, resultsOutput[(ushort) 397] + resultsOutput[(ushort) 396] + resultsOutput[(ushort) 53])); - tupleList.Add(Tuple.Create(HouseType.Granite, resultsOutput[(ushort) 368])); - tupleList.Add(Tuple.Create(HouseType.Marble, resultsOutput[(ushort) 367])); - tupleList.Sort(new Comparison>(HouseUtils.SortBiomeResults)); - return tupleList[0].Item1; - } - - private static bool AreRoomsValid( - IEnumerable rooms, - StructureMap structures, - HouseType style) - { - foreach (Microsoft.Xna.Framework.Rectangle room in rooms) - { - if (style != HouseType.Granite) - { - if (WorldUtils.Find(new Point(room.X - 2, room.Y - 2), Searches.Chain(new Searches.Rectangle(room.Width + 4, room.Height + 4).RequireAll(false), (GenCondition) new Conditions.HasLava()), out Point _)) - return false; - } - if (WorldGen.notTheBees) - { - if (!structures.CanPlace(room, HouseUtils.BeelistedTiles, 5)) - return false; - } - else if (!structures.CanPlace(room, HouseUtils.BlacklistedTiles, 5)) - return false; - } - return true; - } - } -} diff --git a/GameContent/Biomes/CaveHouse/IceHouseBuilder.cs b/GameContent/Biomes/CaveHouse/IceHouseBuilder.cs deleted file mode 100644 index 6514618..0000000 --- a/GameContent/Biomes/CaveHouse/IceHouseBuilder.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Biomes.CaveHouse.IceHouseBuilder -// 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; -using System.Collections.Generic; -using Terraria.GameContent.Generation; -using Terraria.WorldBuilding; - -namespace Terraria.GameContent.Biomes.CaveHouse -{ - public class IceHouseBuilder : HouseBuilder - { - public IceHouseBuilder(IEnumerable rooms) - : base(HouseType.Ice, rooms) - { - this.TileType = (ushort) 321; - this.WallType = (ushort) 149; - this.BeamType = (ushort) 574; - this.DoorStyle = 30; - this.PlatformStyle = 19; - this.TableStyle = 28; - this.WorkbenchStyle = 23; - this.PianoStyle = 23; - this.BookcaseStyle = 25; - this.ChairStyle = 30; - this.ChestStyle = 11; - } - - protected override void AgeRoom(Microsoft.Xna.Framework.Rectangle room) - { - WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.Dither(0.600000023841858), (GenAction) new Modifiers.Blotches(chance: 0.600000023841858), (GenAction) new Modifiers.OnlyTiles(new ushort[1] - { - this.TileType - }), (GenAction) new Actions.SetTileKeepWall((ushort) 161, true), (GenAction) new Modifiers.Dither(0.8), (GenAction) new Actions.SetTileKeepWall((ushort) 147, true))); - WorldUtils.Gen(new Point(room.X + 1, room.Y), (GenShape) new Shapes.Rectangle(room.Width - 2, 1), Actions.Chain((GenAction) new Modifiers.Dither(), (GenAction) new Modifiers.OnlyTiles(new ushort[1] - { - (ushort) 161 - }), (GenAction) new Modifiers.Offset(0, 1), (GenAction) new ActionStalagtite())); - WorldUtils.Gen(new Point(room.X + 1, room.Y + room.Height - 1), (GenShape) new Shapes.Rectangle(room.Width - 2, 1), Actions.Chain((GenAction) new Modifiers.Dither(), (GenAction) new Modifiers.OnlyTiles(new ushort[1] - { - (ushort) 161 - }), (GenAction) new Modifiers.Offset(0, 1), (GenAction) new ActionStalagtite())); - WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.Dither(0.850000023841858), (GenAction) new Modifiers.Blotches(chance: 0.8), (GenAction) new Modifiers.SkipTiles(this.SkipTilesDuringWallAging), (double) room.Y > Main.worldSurface ? (GenAction) new Actions.ClearWall(true) : (GenAction) new Actions.PlaceWall((ushort) 40))); - } - } -} diff --git a/GameContent/Biomes/CaveHouse/JungleHouseBuilder.cs b/GameContent/Biomes/CaveHouse/JungleHouseBuilder.cs deleted file mode 100644 index 6d9ed93..0000000 --- a/GameContent/Biomes/CaveHouse/JungleHouseBuilder.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Biomes.CaveHouse.JungleHouseBuilder -// 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; -using System.Collections.Generic; -using Terraria.GameContent.Generation; -using Terraria.WorldBuilding; - -namespace Terraria.GameContent.Biomes.CaveHouse -{ - public class JungleHouseBuilder : HouseBuilder - { - public JungleHouseBuilder(IEnumerable rooms) - : base(HouseType.Jungle, rooms) - { - this.TileType = (ushort) 158; - this.WallType = (ushort) 42; - this.BeamType = (ushort) 575; - this.PlatformStyle = 2; - this.DoorStyle = 2; - this.TableStyle = 2; - this.WorkbenchStyle = 2; - this.PianoStyle = 2; - this.BookcaseStyle = 12; - this.ChairStyle = 3; - this.ChestStyle = 8; - } - - protected override void AgeRoom(Microsoft.Xna.Framework.Rectangle room) - { - WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.Dither(0.600000023841858), (GenAction) new Modifiers.Blotches(chance: 0.600000023841858), (GenAction) new Modifiers.OnlyTiles(new ushort[1] - { - this.TileType - }), (GenAction) new Actions.SetTileKeepWall((ushort) 60, true), (GenAction) new Modifiers.Dither(0.800000011920929), (GenAction) new Actions.SetTileKeepWall((ushort) 59, true))); - WorldUtils.Gen(new Point(room.X + 1, room.Y), (GenShape) new Shapes.Rectangle(room.Width - 2, 1), Actions.Chain((GenAction) new Modifiers.Dither(), (GenAction) new Modifiers.OnlyTiles(new ushort[1] - { - (ushort) 60 - }), (GenAction) new Modifiers.Offset(0, 1), (GenAction) new Modifiers.IsEmpty(), (GenAction) new ActionVines(3, room.Height, 62))); - WorldUtils.Gen(new Point(room.X + 1, room.Y + room.Height - 1), (GenShape) new Shapes.Rectangle(room.Width - 2, 1), Actions.Chain((GenAction) new Modifiers.Dither(), (GenAction) new Modifiers.OnlyTiles(new ushort[1] - { - (ushort) 60 - }), (GenAction) new Modifiers.Offset(0, 1), (GenAction) new Modifiers.IsEmpty(), (GenAction) new ActionVines(3, room.Height, 62))); - WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.Dither(0.850000023841858), (GenAction) new Modifiers.Blotches(), (GenAction) new Actions.PlaceWall((ushort) 64))); - } - } -} diff --git a/GameContent/Biomes/CaveHouse/MarbleHouseBuilder.cs b/GameContent/Biomes/CaveHouse/MarbleHouseBuilder.cs deleted file mode 100644 index 71361e8..0000000 --- a/GameContent/Biomes/CaveHouse/MarbleHouseBuilder.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Biomes.CaveHouse.MarbleHouseBuilder -// 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; -using System.Collections.Generic; -using Terraria.GameContent.Generation; -using Terraria.WorldBuilding; - -namespace Terraria.GameContent.Biomes.CaveHouse -{ - public class MarbleHouseBuilder : HouseBuilder - { - public MarbleHouseBuilder(IEnumerable rooms) - : base(HouseType.Marble, rooms) - { - this.TileType = (ushort) 357; - this.WallType = (ushort) 179; - this.BeamType = (ushort) 561; - this.PlatformStyle = 29; - this.DoorStyle = 35; - this.TableStyle = 34; - this.WorkbenchStyle = 30; - this.PianoStyle = 29; - this.BookcaseStyle = 31; - this.ChairStyle = 35; - this.ChestStyle = 51; - } - - protected override void AgeRoom(Microsoft.Xna.Framework.Rectangle room) - { - WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.Dither(0.600000023841858), (GenAction) new Modifiers.Blotches(chance: 0.600000023841858), (GenAction) new Modifiers.OnlyTiles(new ushort[1] - { - this.TileType - }), (GenAction) new Actions.SetTileKeepWall((ushort) 367, true))); - WorldUtils.Gen(new Point(room.X + 1, room.Y), (GenShape) new Shapes.Rectangle(room.Width - 2, 1), Actions.Chain((GenAction) new Modifiers.Dither(0.800000011920929), (GenAction) new Modifiers.OnlyTiles(new ushort[1] - { - (ushort) 367 - }), (GenAction) new Modifiers.Offset(0, 1), (GenAction) new ActionStalagtite())); - WorldUtils.Gen(new Point(room.X + 1, room.Y + room.Height - 1), (GenShape) new Shapes.Rectangle(room.Width - 2, 1), Actions.Chain((GenAction) new Modifiers.Dither(0.800000011920929), (GenAction) new Modifiers.OnlyTiles(new ushort[1] - { - (ushort) 367 - }), (GenAction) new Modifiers.Offset(0, 1), (GenAction) new ActionStalagtite())); - WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.Dither(0.850000023841858), (GenAction) new Modifiers.Blotches(), (GenAction) new Actions.PlaceWall((ushort) 178))); - } - } -} diff --git a/GameContent/Biomes/CaveHouse/MushroomHouseBuilder.cs b/GameContent/Biomes/CaveHouse/MushroomHouseBuilder.cs deleted file mode 100644 index 665e253..0000000 --- a/GameContent/Biomes/CaveHouse/MushroomHouseBuilder.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Biomes.CaveHouse.MushroomHouseBuilder -// 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; -using System.Collections.Generic; -using Terraria.WorldBuilding; - -namespace Terraria.GameContent.Biomes.CaveHouse -{ - public class MushroomHouseBuilder : HouseBuilder - { - public MushroomHouseBuilder(IEnumerable rooms) - : base(HouseType.Mushroom, rooms) - { - this.TileType = (ushort) 190; - this.WallType = (ushort) 74; - this.BeamType = (ushort) 578; - this.PlatformStyle = 18; - this.DoorStyle = 6; - this.TableStyle = 27; - this.WorkbenchStyle = 7; - this.PianoStyle = 22; - this.BookcaseStyle = 24; - this.ChairStyle = 9; - this.ChestStyle = 32; - } - - protected override void AgeRoom(Microsoft.Xna.Framework.Rectangle room) - { - WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.Dither(0.699999988079071), (GenAction) new Modifiers.Blotches(chance: 0.5), (GenAction) new Modifiers.OnlyTiles(new ushort[1] - { - this.TileType - }), (GenAction) new Actions.SetTileKeepWall((ushort) 70, true))); - WorldUtils.Gen(new Point(room.X + 1, room.Y), (GenShape) new Shapes.Rectangle(room.Width - 2, 1), Actions.Chain((GenAction) new Modifiers.Dither(0.600000023841858), (GenAction) new Modifiers.OnlyTiles(new ushort[1] - { - (ushort) 70 - }), (GenAction) new Modifiers.Offset(0, -1), (GenAction) new Modifiers.IsEmpty(), (GenAction) new Actions.SetTile((ushort) 71))); - WorldUtils.Gen(new Point(room.X + 1, room.Y + room.Height - 1), (GenShape) new Shapes.Rectangle(room.Width - 2, 1), Actions.Chain((GenAction) new Modifiers.Dither(0.600000023841858), (GenAction) new Modifiers.OnlyTiles(new ushort[1] - { - (ushort) 70 - }), (GenAction) new Modifiers.Offset(0, -1), (GenAction) new Modifiers.IsEmpty(), (GenAction) new Actions.SetTile((ushort) 71))); - WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.Dither(0.850000023841858), (GenAction) new Modifiers.Blotches(), (GenAction) new Actions.ClearWall())); - } - } -} diff --git a/GameContent/Biomes/CaveHouse/WoodHouseBuilder.cs b/GameContent/Biomes/CaveHouse/WoodHouseBuilder.cs deleted file mode 100644 index 9c299d6..0000000 --- a/GameContent/Biomes/CaveHouse/WoodHouseBuilder.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Biomes.CaveHouse.WoodHouseBuilder -// 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; -using System.Collections.Generic; -using Terraria.WorldBuilding; - -namespace Terraria.GameContent.Biomes.CaveHouse -{ - public class WoodHouseBuilder : HouseBuilder - { - public WoodHouseBuilder(IEnumerable rooms) - : base(HouseType.Wood, rooms) - { - this.TileType = (ushort) 30; - this.WallType = (ushort) 27; - this.BeamType = (ushort) 124; - this.PlatformStyle = 0; - this.DoorStyle = 0; - this.TableStyle = 0; - this.WorkbenchStyle = 0; - this.PianoStyle = 0; - this.BookcaseStyle = 0; - this.ChairStyle = 0; - this.ChestStyle = 1; - } - - protected override void AgeRoom(Microsoft.Xna.Framework.Rectangle room) - { - for (int index = 0; index < room.Width * room.Height / 16; ++index) - WorldUtils.Gen(new Point(WorldGen.genRand.Next(1, room.Width - 1) + room.X, WorldGen.genRand.Next(1, room.Height - 1) + room.Y), (GenShape) new Shapes.Rectangle(2, 2), Actions.Chain((GenAction) new Modifiers.Dither(), (GenAction) new Modifiers.Blotches(chance: 2.0), (GenAction) new Modifiers.IsEmpty(), (GenAction) new Actions.SetTile((ushort) 51, true))); - WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.Dither(0.850000023841858), (GenAction) new Modifiers.Blotches(), (GenAction) new Modifiers.OnlyWalls(new ushort[1] - { - this.WallType - }), (GenAction) new Modifiers.SkipTiles(this.SkipTilesDuringWallAging), (double) room.Y > Main.worldSurface ? (GenAction) new Actions.ClearWall(true) : (GenAction) new Actions.PlaceWall((ushort) 2))); - WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.Dither(0.949999988079071), (GenAction) new Modifiers.OnlyTiles(new ushort[3] - { - (ushort) 30, - (ushort) 321, - (ushort) 158 - }), (GenAction) new Actions.ClearTile(true))); - } - } -} diff --git a/GameContent/Biomes/CaveHouseBiome.cs b/GameContent/Biomes/CaveHouseBiome.cs index 8fad722..d65657c 100644 --- a/GameContent/Biomes/CaveHouseBiome.cs +++ b/GameContent/Biomes/CaveHouseBiome.cs @@ -1,89 +1,699 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Biomes.CaveHouseBiome -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; -using Newtonsoft.Json; -using Terraria.GameContent.Biomes.CaveHouse; +using System; +using System.Collections.Generic; +using Terraria.GameContent.Generation; using Terraria.ID; -using Terraria.WorldBuilding; +using Terraria.World.Generation; namespace Terraria.GameContent.Biomes { public class CaveHouseBiome : MicroBiome { - private readonly HouseBuilderContext _builderContext = new HouseBuilderContext(); + private const int VERTICAL_EXIT_WIDTH = 3; + private static readonly bool[] _blacklistedTiles = TileID.Sets.Factory.CreateBoolSet(true, 225, 41, 43, 44, 226, 203, 112, 25, 151); + private int _sharpenerCount; + private int _extractinatorCount; - [JsonProperty] - public float IceChestChance { get; set; } + private Microsoft.Xna.Framework.Rectangle GetRoom(Point origin) + { + Point result1; + bool flag1 = WorldUtils.Find(origin, Searches.Chain((GenSearch) new Searches.Left(25), (GenCondition) new Conditions.IsSolid()), out result1); + Point result2; + int num1 = WorldUtils.Find(origin, Searches.Chain((GenSearch) new Searches.Right(25), (GenCondition) new Conditions.IsSolid()), out result2) ? 1 : 0; + if (!flag1) + result1 = new Point(origin.X - 25, origin.Y); + if (num1 == 0) + result2 = new Point(origin.X + 25, origin.Y); + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(origin.X, origin.Y, 0, 0); + if (origin.X - result1.X > result2.X - origin.X) + { + rectangle.X = result1.X; + rectangle.Width = Utils.Clamp(result2.X - result1.X, 15, 30); + } + else + { + rectangle.Width = Utils.Clamp(result2.X - result1.X, 15, 30); + rectangle.X = result2.X - rectangle.Width; + } + Point result3; + bool flag2 = WorldUtils.Find(result1, Searches.Chain((GenSearch) new Searches.Up(10), (GenCondition) new Conditions.IsSolid()), out result3); + Point result4; + int num2 = WorldUtils.Find(result2, Searches.Chain((GenSearch) new Searches.Up(10), (GenCondition) new Conditions.IsSolid()), out result4) ? 1 : 0; + if (!flag2) + result3 = new Point(origin.X, origin.Y - 10); + if (num2 == 0) + result4 = new Point(origin.X, origin.Y - 10); + rectangle.Height = Utils.Clamp(Math.Max(origin.Y - result3.Y, origin.Y - result4.Y), 8, 12); + rectangle.Y -= rectangle.Height; + return rectangle; + } - [JsonProperty] - public float JungleChestChance { get; set; } + private float RoomSolidPrecentage(Microsoft.Xna.Framework.Rectangle room) + { + float num = (float) (room.Width * room.Height); + Ref count = new Ref(0); + WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.IsSolid(), (GenAction) new Actions.Count(count))); + return (float) count.Value / num; + } - [JsonProperty] - public float GoldChestChance { get; set; } + private bool FindVerticalExit(Microsoft.Xna.Framework.Rectangle wall, bool isUp, out int exitX) + { + Point result; + int num = WorldUtils.Find(new Point(wall.X + wall.Width - 3, wall.Y + (isUp ? -5 : 0)), Searches.Chain((GenSearch) new Searches.Left(wall.Width - 3), new Conditions.IsSolid().Not().AreaOr(3, 5)), out result) ? 1 : 0; + exitX = result.X; + return num != 0; + } - [JsonProperty] - public float GraniteChestChance { get; set; } + private bool FindSideExit(Microsoft.Xna.Framework.Rectangle wall, bool isLeft, out int exitY) + { + Point result; + int num = WorldUtils.Find(new Point(wall.X + (isLeft ? -4 : 0), wall.Y + wall.Height - 3), Searches.Chain((GenSearch) new Searches.Up(wall.Height - 3), new Conditions.IsSolid().Not().AreaOr(4, 3)), out result) ? 1 : 0; + exitY = result.Y; + return num != 0; + } - [JsonProperty] - public float MarbleChestChance { get; set; } - - [JsonProperty] - public float MushroomChestChance { get; set; } - - [JsonProperty] - public float DesertChestChance { get; set; } + private int SortBiomeResults( + Tuple item1, + Tuple item2) + { + return item2.Item2.CompareTo(item1.Item2); + } public override bool Place(Point origin, StructureMap structures) { - if (!WorldGen.InWorld(origin.X, origin.Y, 10)) + Point result1; + if (!WorldUtils.Find(origin, Searches.Chain((GenSearch) new Searches.Down(200), (GenCondition) new Conditions.IsSolid()), out result1) || result1 == origin) return false; - int num = 25; - for (int index1 = origin.X - num; index1 <= origin.X + num; ++index1) + Microsoft.Xna.Framework.Rectangle room1 = this.GetRoom(result1); + Microsoft.Xna.Framework.Rectangle room2 = this.GetRoom(new Point(room1.Center.X, room1.Y + 1)); + Microsoft.Xna.Framework.Rectangle room3 = this.GetRoom(new Point(room1.Center.X, room1.Y + room1.Height + 10)); + room3.Y = room1.Y + room1.Height - 1; + float num1 = this.RoomSolidPrecentage(room2); + float num2 = this.RoomSolidPrecentage(room3); + room1.Y += 3; + room2.Y += 3; + room3.Y += 3; + List rectangleList1 = new List(); + if ((double) GenBase._random.NextFloat() > (double) num1 + 0.200000002980232) + rectangleList1.Add(room2); + else + room2 = room1; + rectangleList1.Add(room1); + if ((double) GenBase._random.NextFloat() > (double) num2 + 0.200000002980232) + rectangleList1.Add(room3); + else + room3 = room1; + foreach (Microsoft.Xna.Framework.Rectangle rectangle in rectangleList1) { - for (int index2 = origin.Y - num; index2 <= origin.Y + num; ++index2) + if (rectangle.Y + rectangle.Height > Main.maxTilesY - 220) + return false; + } + Dictionary resultsOutput = new Dictionary(); + foreach (Microsoft.Xna.Framework.Rectangle rectangle in rectangleList1) + WorldUtils.Gen(new Point(rectangle.X - 10, rectangle.Y - 10), (GenShape) new Shapes.Rectangle(rectangle.Width + 20, rectangle.Height + 20), (GenAction) new Actions.TileScanner(new ushort[12] { - if (Main.tile[index1, index2].wire() || TileID.Sets.BasicChest[(int) Main.tile[index1, index2].type]) + (ushort) 0, + (ushort) 59, + (ushort) 147, + (ushort) 1, + (ushort) 161, + (ushort) 53, + (ushort) 396, + (ushort) 397, + (ushort) 368, + (ushort) 367, + (ushort) 60, + (ushort) 70 + }).Output(resultsOutput)); + List> tupleList1 = new List>(); + tupleList1.Add(Tuple.Create(CaveHouseBiome.BuildData.Default, resultsOutput[(ushort) 0] + resultsOutput[(ushort) 1])); + tupleList1.Add(Tuple.Create(CaveHouseBiome.BuildData.Jungle, resultsOutput[(ushort) 59] + resultsOutput[(ushort) 60] * 10)); + tupleList1.Add(Tuple.Create(CaveHouseBiome.BuildData.Mushroom, resultsOutput[(ushort) 59] + resultsOutput[(ushort) 70] * 10)); + tupleList1.Add(Tuple.Create(CaveHouseBiome.BuildData.Snow, resultsOutput[(ushort) 147] + resultsOutput[(ushort) 161])); + tupleList1.Add(Tuple.Create(CaveHouseBiome.BuildData.Desert, resultsOutput[(ushort) 397] + resultsOutput[(ushort) 396] + resultsOutput[(ushort) 53])); + tupleList1.Add(Tuple.Create(CaveHouseBiome.BuildData.Granite, resultsOutput[(ushort) 368])); + tupleList1.Add(Tuple.Create(CaveHouseBiome.BuildData.Marble, resultsOutput[(ushort) 367])); + tupleList1.Sort(new Comparison>(this.SortBiomeResults)); + CaveHouseBiome.BuildData buildData = tupleList1[0].Item1; + foreach (Microsoft.Xna.Framework.Rectangle area in rectangleList1) + { + if (buildData != CaveHouseBiome.BuildData.Granite) + { + if (WorldUtils.Find(new Point(area.X - 2, area.Y - 2), Searches.Chain(new Searches.Rectangle(area.Width + 4, area.Height + 4).RequireAll(false), (GenCondition) new Conditions.HasLava()), out Point _)) return false; } + if (!structures.CanPlace(area, CaveHouseBiome._blacklistedTiles, 5)) + return false; + } + int val1_1 = room1.X; + int val1_2 = room1.X + room1.Width - 1; + List rectangleList2 = new List(); + foreach (Microsoft.Xna.Framework.Rectangle rectangle in rectangleList1) + { + val1_1 = Math.Min(val1_1, rectangle.X); + val1_2 = Math.Max(val1_2, rectangle.X + rectangle.Width - 1); + } + int num3 = 6; + while (num3 > 4 && (val1_2 - val1_1) % num3 != 0) + --num3; + for (int x = val1_1; x <= val1_2; x += num3) + { + for (int index1 = 0; index1 < rectangleList1.Count; ++index1) + { + Microsoft.Xna.Framework.Rectangle rectangle = rectangleList1[index1]; + if (x >= rectangle.X && x < rectangle.X + rectangle.Width) + { + int y = rectangle.Y + rectangle.Height; + int num4 = 50; + for (int index2 = index1 + 1; index2 < rectangleList1.Count; ++index2) + { + if (x >= rectangleList1[index2].X && x < rectangleList1[index2].X + rectangleList1[index2].Width) + num4 = Math.Min(num4, rectangleList1[index2].Y - y); + } + if (num4 > 0) + { + Point result2; + bool flag = WorldUtils.Find(new Point(x, y), Searches.Chain((GenSearch) new Searches.Down(num4), (GenCondition) new Conditions.IsSolid()), out result2); + if (num4 < 50) + { + flag = true; + result2 = new Point(x, y + num4); + } + if (flag) + rectangleList2.Add(new Microsoft.Xna.Framework.Rectangle(x, y, 1, result2.Y - y)); + } + } + } + } + List pointList1 = new List(); + foreach (Microsoft.Xna.Framework.Rectangle rectangle in rectangleList1) + { + int exitY; + if (this.FindSideExit(new Microsoft.Xna.Framework.Rectangle(rectangle.X + rectangle.Width, rectangle.Y + 1, 1, rectangle.Height - 2), false, out exitY)) + pointList1.Add(new Point(rectangle.X + rectangle.Width - 1, exitY)); + if (this.FindSideExit(new Microsoft.Xna.Framework.Rectangle(rectangle.X, rectangle.Y + 1, 1, rectangle.Height - 2), true, out exitY)) + pointList1.Add(new Point(rectangle.X, exitY)); + } + List> tupleList2 = new List>(); + for (int index = 1; index < rectangleList1.Count; ++index) + { + Microsoft.Xna.Framework.Rectangle rectangle1 = rectangleList1[index]; + Microsoft.Xna.Framework.Rectangle rectangle2 = rectangleList1[index - 1]; + if (rectangle2.X - rectangle1.X > rectangle1.X + rectangle1.Width - (rectangle2.X + rectangle2.Width)) + tupleList2.Add(new Tuple(new Point(rectangle1.X + rectangle1.Width - 1, rectangle1.Y + 1), new Point(rectangle1.X + rectangle1.Width - rectangle1.Height + 1, rectangle1.Y + rectangle1.Height - 1))); + else + tupleList2.Add(new Tuple(new Point(rectangle1.X, rectangle1.Y + 1), new Point(rectangle1.X + rectangle1.Height - 1, rectangle1.Y + rectangle1.Height - 1))); + } + List pointList2 = new List(); + int exitX; + if (this.FindVerticalExit(new Microsoft.Xna.Framework.Rectangle(room2.X + 2, room2.Y, room2.Width - 4, 1), true, out exitX)) + pointList2.Add(new Point(exitX, room2.Y)); + if (this.FindVerticalExit(new Microsoft.Xna.Framework.Rectangle(room3.X + 2, room3.Y + room3.Height - 1, room3.Width - 4, 1), false, out exitX)) + pointList2.Add(new Point(exitX, room3.Y + room3.Height - 1)); + foreach (Microsoft.Xna.Framework.Rectangle area in rectangleList1) + { + WorldUtils.Gen(new Point(area.X, area.Y), (GenShape) new Shapes.Rectangle(area.Width, area.Height), Actions.Chain((GenAction) new Actions.SetTile(buildData.Tile), (GenAction) new Actions.SetFrames(true))); + WorldUtils.Gen(new Point(area.X + 1, area.Y + 1), (GenShape) new Shapes.Rectangle(area.Width - 2, area.Height - 2), Actions.Chain((GenAction) new Actions.ClearTile(true), (GenAction) new Actions.PlaceWall(buildData.Wall))); + structures.AddStructure(area, 8); + } + foreach (Tuple tuple in tupleList2) + { + Point origin1 = tuple.Item1; + Point point = tuple.Item2; + int num5 = point.X > origin1.X ? 1 : -1; + ShapeData data = new ShapeData(); + for (int y = 0; y < point.Y - origin1.Y; ++y) + data.Add(num5 * (y + 1), y); + WorldUtils.Gen(origin1, (GenShape) new ModShapes.All(data), Actions.Chain((GenAction) new Actions.PlaceTile((ushort) 19, buildData.PlatformStyle), (GenAction) new Actions.SetSlope(num5 == 1 ? 1 : 2), (GenAction) new Actions.SetFrames(true))); + WorldUtils.Gen(new Point(origin1.X + (num5 == 1 ? 1 : -4), origin1.Y - 1), (GenShape) new Shapes.Rectangle(4, 1), Actions.Chain((GenAction) new Actions.Clear(), (GenAction) new Actions.PlaceWall(buildData.Wall), (GenAction) new Actions.PlaceTile((ushort) 19, buildData.PlatformStyle), (GenAction) new Actions.SetFrames(true))); + } + foreach (Point origin2 in pointList1) + { + WorldUtils.Gen(origin2, (GenShape) new Shapes.Rectangle(1, 3), (GenAction) new Actions.ClearTile(true)); + WorldGen.PlaceTile(origin2.X, origin2.Y, 10, true, true, style: buildData.DoorStyle); + } + foreach (Point origin3 in pointList2) + { + Shapes.Rectangle rectangle = new Shapes.Rectangle(3, 1); + GenAction action = Actions.Chain((GenAction) new Actions.ClearMetadata(), (GenAction) new Actions.PlaceTile((ushort) 19, buildData.PlatformStyle), (GenAction) new Actions.SetFrames(true)); + WorldUtils.Gen(origin3, (GenShape) rectangle, action); + } + foreach (Microsoft.Xna.Framework.Rectangle rectangle in rectangleList2) + { + if (rectangle.Height > 1 && GenBase._tiles[rectangle.X, rectangle.Y - 1].type != (ushort) 19) + { + WorldUtils.Gen(new Point(rectangle.X, rectangle.Y), (GenShape) new Shapes.Rectangle(rectangle.Width, rectangle.Height), Actions.Chain((GenAction) new Actions.SetTile((ushort) 124), (GenAction) new Actions.SetFrames(true))); + Tile tile = GenBase._tiles[rectangle.X, rectangle.Y + rectangle.Height]; + tile.slope((byte) 0); + tile.halfBrick(false); + } + } + Point[] pointArray = new Point[7] + { + new Point(14, buildData.TableStyle), + new Point(16, 0), + new Point(18, buildData.WorkbenchStyle), + new Point(86, 0), + new Point(87, buildData.PianoStyle), + new Point(94, 0), + new Point(101, buildData.BookcaseStyle) + }; + foreach (Microsoft.Xna.Framework.Rectangle rectangle in rectangleList1) + { + int num6 = rectangle.Width / 8; + int num7 = rectangle.Width / (num6 + 1); + int num8 = GenBase._random.Next(2); + for (int index3 = 0; index3 < num6; ++index3) + { + int num9 = (index3 + 1) * num7 + rectangle.X; + switch (index3 + num8 % 2) + { + case 0: + int num10 = rectangle.Y + Math.Min(rectangle.Height / 2, rectangle.Height - 5); + Vector2 vector2 = WorldGen.randHousePicture(); + int x = (int) vector2.X; + int y = (int) vector2.Y; + if (!WorldGen.nearPicture(num9, num10)) + { + WorldGen.PlaceTile(num9, num10, x, true, style: y); + break; + } + break; + case 1: + int j = rectangle.Y + 1; + WorldGen.PlaceTile(num9, j, 34, true, style: GenBase._random.Next(6)); + for (int index4 = -1; index4 < 2; ++index4) + { + for (int index5 = 0; index5 < 3; ++index5) + GenBase._tiles[index4 + num9, index5 + j].frameX += (short) 54; + } + break; + } + } + int num11 = rectangle.Width / 8 + 3; + WorldGen.SetupStatueList(); + for (; num11 > 0; --num11) + { + int num12 = GenBase._random.Next(rectangle.Width - 3) + 1 + rectangle.X; + int num13 = rectangle.Y + rectangle.Height - 2; + switch (GenBase._random.Next(4)) + { + case 0: + WorldGen.PlaceSmallPile(num12, num13, GenBase._random.Next(31, 34), 1); + break; + case 1: + WorldGen.PlaceTile(num12, num13, 186, true, style: GenBase._random.Next(22, 26)); + break; + case 2: + int index = GenBase._random.Next(2, WorldGen.statueList.Length); + WorldGen.PlaceTile(num12, num13, (int) WorldGen.statueList[index].X, true, style: ((int) WorldGen.statueList[index].Y)); + if (WorldGen.StatuesWithTraps.Contains(index)) + { + WorldGen.PlaceStatueTrap(num12, num13); + break; + } + break; + case 3: + Point point = Utils.SelectRandom(GenBase._random, pointArray); + WorldGen.PlaceTile(num12, num13, point.X, true, style: point.Y); + break; + } + } + } + foreach (Microsoft.Xna.Framework.Rectangle room4 in rectangleList1) + buildData.ProcessRoom(room4); + bool flag1 = false; + foreach (Microsoft.Xna.Framework.Rectangle rectangle in rectangleList1) + { + int j = rectangle.Height - 1 + rectangle.Y; + int Style = j > (int) Main.worldSurface ? buildData.ChestStyle : 0; + int num14 = 0; + while (num14 < 10 && !(flag1 = WorldGen.AddBuriedChest(GenBase._random.Next(2, rectangle.Width - 2) + rectangle.X, j, Style: Style))) + ++num14; + if (!flag1) + { + int i = rectangle.X + 2; + while (i <= rectangle.X + rectangle.Width - 2 && !(flag1 = WorldGen.AddBuriedChest(i, j, Style: Style))) + ++i; + if (flag1) + break; + } + else + break; + } + if (!flag1) + { + foreach (Microsoft.Xna.Framework.Rectangle rectangle in rectangleList1) + { + int j = rectangle.Y - 1; + int Style = j > (int) Main.worldSurface ? buildData.ChestStyle : 0; + int num15 = 0; + while (num15 < 10 && !(flag1 = WorldGen.AddBuriedChest(GenBase._random.Next(2, rectangle.Width - 2) + rectangle.X, j, Style: Style))) + ++num15; + if (!flag1) + { + int i = rectangle.X + 2; + while (i <= rectangle.X + rectangle.Width - 2 && !(flag1 = WorldGen.AddBuriedChest(i, j, Style: Style))) + ++i; + if (flag1) + break; + } + else + break; + } + } + if (!flag1) + { + for (int index = 0; index < 1000; ++index) + { + int i = GenBase._random.Next(rectangleList1[0].X - 30, rectangleList1[0].X + 30); + int num16 = GenBase._random.Next(rectangleList1[0].Y - 30, rectangleList1[0].Y + 30); + int num17 = num16 > (int) Main.worldSurface ? buildData.ChestStyle : 0; + int j = num16; + int Style = num17; + if (WorldGen.AddBuriedChest(i, j, Style: Style)) + break; + } + } + if (buildData == CaveHouseBiome.BuildData.Jungle && this._sharpenerCount < GenBase._random.Next(2, 5)) + { + bool flag2 = false; + foreach (Microsoft.Xna.Framework.Rectangle rectangle in rectangleList1) + { + int j = rectangle.Height - 2 + rectangle.Y; + for (int index = 0; index < 10; ++index) + { + int i = GenBase._random.Next(2, rectangle.Width - 2) + rectangle.X; + WorldGen.PlaceTile(i, j, 377, true, true); + if (flag2 = GenBase._tiles[i, j].active() && GenBase._tiles[i, j].type == (ushort) 377) + break; + } + if (!flag2) + { + int i = rectangle.X + 2; + while (i <= rectangle.X + rectangle.Width - 2 && !(flag2 = WorldGen.PlaceTile(i, j, 377, true, true))) + ++i; + if (flag2) + break; + } + else + break; + } + if (flag2) + ++this._sharpenerCount; + } + if (buildData == CaveHouseBiome.BuildData.Desert && this._extractinatorCount < GenBase._random.Next(2, 5)) + { + bool flag3 = false; + foreach (Microsoft.Xna.Framework.Rectangle rectangle in rectangleList1) + { + int j = rectangle.Height - 2 + rectangle.Y; + for (int index = 0; index < 10; ++index) + { + int i = GenBase._random.Next(2, rectangle.Width - 2) + rectangle.X; + WorldGen.PlaceTile(i, j, 219, true, true); + if (flag3 = GenBase._tiles[i, j].active() && GenBase._tiles[i, j].type == (ushort) 219) + break; + } + if (!flag3) + { + int i = rectangle.X + 2; + while (i <= rectangle.X + rectangle.Width - 2 && !(flag3 = WorldGen.PlaceTile(i, j, 219, true, true))) + ++i; + if (flag3) + break; + } + else + break; + } + if (flag3) + ++this._extractinatorCount; } - HouseBuilder builder = HouseUtils.CreateBuilder(origin, structures); - if (!builder.IsValid) - return false; - this.ApplyConfigurationToBuilder(builder); - builder.Place(this._builderContext, structures); return true; } - private void ApplyConfigurationToBuilder(HouseBuilder builder) + public override void Reset() { - switch (builder.Type) + this._sharpenerCount = 0; + this._extractinatorCount = 0; + } + + internal static void AgeDefaultRoom(Microsoft.Xna.Framework.Rectangle room) + { + for (int index = 0; index < room.Width * room.Height / 16; ++index) + WorldUtils.Gen(new Point(GenBase._random.Next(1, room.Width - 1) + room.X, GenBase._random.Next(1, room.Height - 1) + room.Y), (GenShape) new Shapes.Rectangle(2, 2), Actions.Chain((GenAction) new Modifiers.Dither(), (GenAction) new Modifiers.Blotches(chance: 2.0), (GenAction) new Modifiers.IsEmpty(), (GenAction) new Actions.SetTile((ushort) 51, true))); + WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.Dither(0.850000023841858), (GenAction) new Modifiers.Blotches(), (GenAction) new Modifiers.OnlyWalls(new byte[1] { - case HouseType.Wood: - builder.ChestChance = this.GoldChestChance; - break; - case HouseType.Ice: - builder.ChestChance = this.IceChestChance; - break; - case HouseType.Desert: - builder.ChestChance = this.DesertChestChance; - break; - case HouseType.Jungle: - builder.ChestChance = this.JungleChestChance; - break; - case HouseType.Mushroom: - builder.ChestChance = this.MushroomChestChance; - break; - case HouseType.Granite: - builder.ChestChance = this.GraniteChestChance; - break; - case HouseType.Marble: - builder.ChestChance = this.MarbleChestChance; - break; - } + CaveHouseBiome.BuildData.Default.Wall + }), (double) room.Y > Main.worldSurface ? (GenAction) new Actions.ClearWall(true) : (GenAction) new Actions.PlaceWall((byte) 2))); + WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.Dither(0.949999988079071), (GenAction) new Modifiers.OnlyTiles(new ushort[3] + { + (ushort) 30, + (ushort) 321, + (ushort) 158 + }), (GenAction) new Actions.ClearTile(true))); + } + + internal static void AgeSnowRoom(Microsoft.Xna.Framework.Rectangle room) + { + WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.Dither(0.600000023841858), (GenAction) new Modifiers.Blotches(chance: 0.600000023841858), (GenAction) new Modifiers.OnlyTiles(new ushort[1] + { + CaveHouseBiome.BuildData.Snow.Tile + }), (GenAction) new Actions.SetTile((ushort) 161, true), (GenAction) new Modifiers.Dither(0.8), (GenAction) new Actions.SetTile((ushort) 147, true))); + WorldUtils.Gen(new Point(room.X + 1, room.Y), (GenShape) new Shapes.Rectangle(room.Width - 2, 1), Actions.Chain((GenAction) new Modifiers.Dither(), (GenAction) new Modifiers.OnlyTiles(new ushort[1] + { + (ushort) 161 + }), (GenAction) new Modifiers.Offset(0, 1), (GenAction) new ActionStalagtite())); + WorldUtils.Gen(new Point(room.X + 1, room.Y + room.Height - 1), (GenShape) new Shapes.Rectangle(room.Width - 2, 1), Actions.Chain((GenAction) new Modifiers.Dither(), (GenAction) new Modifiers.OnlyTiles(new ushort[1] + { + (ushort) 161 + }), (GenAction) new Modifiers.Offset(0, 1), (GenAction) new ActionStalagtite())); + WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.Dither(0.850000023841858), (GenAction) new Modifiers.Blotches(chance: 0.8), (double) room.Y > Main.worldSurface ? (GenAction) new Actions.ClearWall(true) : (GenAction) new Actions.PlaceWall((byte) 40))); + } + + internal static void AgeDesertRoom(Microsoft.Xna.Framework.Rectangle room) + { + WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.Dither(0.800000011920929), (GenAction) new Modifiers.Blotches(chance: 0.200000002980232), (GenAction) new Modifiers.OnlyTiles(new ushort[1] + { + CaveHouseBiome.BuildData.Desert.Tile + }), (GenAction) new Actions.SetTile((ushort) 396, true), (GenAction) new Modifiers.Dither(), (GenAction) new Actions.SetTile((ushort) 397, true))); + WorldUtils.Gen(new Point(room.X + 1, room.Y), (GenShape) new Shapes.Rectangle(room.Width - 2, 1), Actions.Chain((GenAction) new Modifiers.Dither(), (GenAction) new Modifiers.OnlyTiles(new ushort[2] + { + (ushort) 397, + (ushort) 396 + }), (GenAction) new Modifiers.Offset(0, 1), (GenAction) new ActionStalagtite())); + WorldUtils.Gen(new Point(room.X + 1, room.Y + room.Height - 1), (GenShape) new Shapes.Rectangle(room.Width - 2, 1), Actions.Chain((GenAction) new Modifiers.Dither(), (GenAction) new Modifiers.OnlyTiles(new ushort[2] + { + (ushort) 397, + (ushort) 396 + }), (GenAction) new Modifiers.Offset(0, 1), (GenAction) new ActionStalagtite())); + WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.Dither(0.800000011920929), (GenAction) new Modifiers.Blotches(), (GenAction) new Modifiers.OnlyWalls(new byte[1] + { + CaveHouseBiome.BuildData.Desert.Wall + }), (GenAction) new Actions.PlaceWall((byte) 216))); + } + + internal static void AgeGraniteRoom(Microsoft.Xna.Framework.Rectangle room) + { + WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.Dither(0.600000023841858), (GenAction) new Modifiers.Blotches(chance: 0.600000023841858), (GenAction) new Modifiers.OnlyTiles(new ushort[1] + { + CaveHouseBiome.BuildData.Granite.Tile + }), (GenAction) new Actions.SetTile((ushort) 368, true))); + WorldUtils.Gen(new Point(room.X + 1, room.Y), (GenShape) new Shapes.Rectangle(room.Width - 2, 1), Actions.Chain((GenAction) new Modifiers.Dither(0.800000011920929), (GenAction) new Modifiers.OnlyTiles(new ushort[1] + { + (ushort) 368 + }), (GenAction) new Modifiers.Offset(0, 1), (GenAction) new ActionStalagtite())); + WorldUtils.Gen(new Point(room.X + 1, room.Y + room.Height - 1), (GenShape) new Shapes.Rectangle(room.Width - 2, 1), Actions.Chain((GenAction) new Modifiers.Dither(0.800000011920929), (GenAction) new Modifiers.OnlyTiles(new ushort[1] + { + (ushort) 368 + }), (GenAction) new Modifiers.Offset(0, 1), (GenAction) new ActionStalagtite())); + WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.Dither(0.850000023841858), (GenAction) new Modifiers.Blotches(), (GenAction) new Actions.PlaceWall((byte) 180))); + } + + internal static void AgeMarbleRoom(Microsoft.Xna.Framework.Rectangle room) + { + WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.Dither(0.600000023841858), (GenAction) new Modifiers.Blotches(chance: 0.600000023841858), (GenAction) new Modifiers.OnlyTiles(new ushort[1] + { + CaveHouseBiome.BuildData.Marble.Tile + }), (GenAction) new Actions.SetTile((ushort) 367, true))); + WorldUtils.Gen(new Point(room.X + 1, room.Y), (GenShape) new Shapes.Rectangle(room.Width - 2, 1), Actions.Chain((GenAction) new Modifiers.Dither(0.800000011920929), (GenAction) new Modifiers.OnlyTiles(new ushort[1] + { + (ushort) 367 + }), (GenAction) new Modifiers.Offset(0, 1), (GenAction) new ActionStalagtite())); + WorldUtils.Gen(new Point(room.X + 1, room.Y + room.Height - 1), (GenShape) new Shapes.Rectangle(room.Width - 2, 1), Actions.Chain((GenAction) new Modifiers.Dither(0.800000011920929), (GenAction) new Modifiers.OnlyTiles(new ushort[1] + { + (ushort) 367 + }), (GenAction) new Modifiers.Offset(0, 1), (GenAction) new ActionStalagtite())); + WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.Dither(0.850000023841858), (GenAction) new Modifiers.Blotches(), (GenAction) new Actions.PlaceWall((byte) 178))); + } + + internal static void AgeMushroomRoom(Microsoft.Xna.Framework.Rectangle room) + { + WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.Dither(0.699999988079071), (GenAction) new Modifiers.Blotches(chance: 0.5), (GenAction) new Modifiers.OnlyTiles(new ushort[1] + { + CaveHouseBiome.BuildData.Mushroom.Tile + }), (GenAction) new Actions.SetTile((ushort) 70, true))); + WorldUtils.Gen(new Point(room.X + 1, room.Y), (GenShape) new Shapes.Rectangle(room.Width - 2, 1), Actions.Chain((GenAction) new Modifiers.Dither(0.600000023841858), (GenAction) new Modifiers.OnlyTiles(new ushort[1] + { + (ushort) 70 + }), (GenAction) new Modifiers.Offset(0, -1), (GenAction) new Actions.SetTile((ushort) 71))); + WorldUtils.Gen(new Point(room.X + 1, room.Y + room.Height - 1), (GenShape) new Shapes.Rectangle(room.Width - 2, 1), Actions.Chain((GenAction) new Modifiers.Dither(0.600000023841858), (GenAction) new Modifiers.OnlyTiles(new ushort[1] + { + (ushort) 70 + }), (GenAction) new Modifiers.Offset(0, -1), (GenAction) new Actions.SetTile((ushort) 71))); + WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.Dither(0.850000023841858), (GenAction) new Modifiers.Blotches(), (GenAction) new Actions.ClearWall())); + } + + internal static void AgeJungleRoom(Microsoft.Xna.Framework.Rectangle room) + { + WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.Dither(0.600000023841858), (GenAction) new Modifiers.Blotches(chance: 0.600000023841858), (GenAction) new Modifiers.OnlyTiles(new ushort[1] + { + CaveHouseBiome.BuildData.Jungle.Tile + }), (GenAction) new Actions.SetTile((ushort) 60, true), (GenAction) new Modifiers.Dither(0.800000011920929), (GenAction) new Actions.SetTile((ushort) 59, true))); + WorldUtils.Gen(new Point(room.X + 1, room.Y), (GenShape) new Shapes.Rectangle(room.Width - 2, 1), Actions.Chain((GenAction) new Modifiers.Dither(), (GenAction) new Modifiers.OnlyTiles(new ushort[1] + { + (ushort) 60 + }), (GenAction) new Modifiers.Offset(0, 1), (GenAction) new ActionVines(3, room.Height, 62))); + WorldUtils.Gen(new Point(room.X + 1, room.Y + room.Height - 1), (GenShape) new Shapes.Rectangle(room.Width - 2, 1), Actions.Chain((GenAction) new Modifiers.Dither(), (GenAction) new Modifiers.OnlyTiles(new ushort[1] + { + (ushort) 60 + }), (GenAction) new Modifiers.Offset(0, 1), (GenAction) new ActionVines(3, room.Height, 62))); + WorldUtils.Gen(new Point(room.X, room.Y), (GenShape) new Shapes.Rectangle(room.Width, room.Height), Actions.Chain((GenAction) new Modifiers.Dither(0.850000023841858), (GenAction) new Modifiers.Blotches(), (GenAction) new Actions.PlaceWall((byte) 64))); + } + + private class BuildData + { + public static CaveHouseBiome.BuildData Snow = CaveHouseBiome.BuildData.CreateSnowData(); + public static CaveHouseBiome.BuildData Jungle = CaveHouseBiome.BuildData.CreateJungleData(); + public static CaveHouseBiome.BuildData Default = CaveHouseBiome.BuildData.CreateDefaultData(); + public static CaveHouseBiome.BuildData Granite = CaveHouseBiome.BuildData.CreateGraniteData(); + public static CaveHouseBiome.BuildData Marble = CaveHouseBiome.BuildData.CreateMarbleData(); + public static CaveHouseBiome.BuildData Mushroom = CaveHouseBiome.BuildData.CreateMushroomData(); + public static CaveHouseBiome.BuildData Desert = CaveHouseBiome.BuildData.CreateDesertData(); + public ushort Tile; + public byte Wall; + public int PlatformStyle; + public int DoorStyle; + public int TableStyle; + public int WorkbenchStyle; + public int PianoStyle; + public int BookcaseStyle; + public int ChairStyle; + public int ChestStyle; + public CaveHouseBiome.BuildData.ProcessRoomMethod ProcessRoom; + + public static CaveHouseBiome.BuildData CreateSnowData() => new CaveHouseBiome.BuildData() + { + Tile = 321, + Wall = 149, + DoorStyle = 30, + PlatformStyle = 19, + TableStyle = 28, + WorkbenchStyle = 23, + PianoStyle = 23, + BookcaseStyle = 25, + ChairStyle = 30, + ChestStyle = 11, + ProcessRoom = new CaveHouseBiome.BuildData.ProcessRoomMethod(CaveHouseBiome.AgeSnowRoom) + }; + + public static CaveHouseBiome.BuildData CreateDesertData() => new CaveHouseBiome.BuildData() + { + Tile = 396, + Wall = 187, + PlatformStyle = 0, + DoorStyle = 0, + TableStyle = 0, + WorkbenchStyle = 0, + PianoStyle = 0, + BookcaseStyle = 0, + ChairStyle = 0, + ChestStyle = 1, + ProcessRoom = new CaveHouseBiome.BuildData.ProcessRoomMethod(CaveHouseBiome.AgeDesertRoom) + }; + + public static CaveHouseBiome.BuildData CreateJungleData() => new CaveHouseBiome.BuildData() + { + Tile = 158, + Wall = 42, + PlatformStyle = 2, + DoorStyle = 2, + TableStyle = 2, + WorkbenchStyle = 2, + PianoStyle = 2, + BookcaseStyle = 12, + ChairStyle = 3, + ChestStyle = 8, + ProcessRoom = new CaveHouseBiome.BuildData.ProcessRoomMethod(CaveHouseBiome.AgeJungleRoom) + }; + + public static CaveHouseBiome.BuildData CreateGraniteData() => new CaveHouseBiome.BuildData() + { + Tile = 369, + Wall = 181, + PlatformStyle = 28, + DoorStyle = 34, + TableStyle = 33, + WorkbenchStyle = 29, + PianoStyle = 28, + BookcaseStyle = 30, + ChairStyle = 34, + ChestStyle = 50, + ProcessRoom = new CaveHouseBiome.BuildData.ProcessRoomMethod(CaveHouseBiome.AgeGraniteRoom) + }; + + public static CaveHouseBiome.BuildData CreateMarbleData() => new CaveHouseBiome.BuildData() + { + Tile = 357, + Wall = 179, + PlatformStyle = 29, + DoorStyle = 35, + TableStyle = 34, + WorkbenchStyle = 30, + PianoStyle = 29, + BookcaseStyle = 31, + ChairStyle = 35, + ChestStyle = 51, + ProcessRoom = new CaveHouseBiome.BuildData.ProcessRoomMethod(CaveHouseBiome.AgeMarbleRoom) + }; + + public static CaveHouseBiome.BuildData CreateMushroomData() => new CaveHouseBiome.BuildData() + { + Tile = 190, + Wall = 74, + PlatformStyle = 18, + DoorStyle = 6, + TableStyle = 27, + WorkbenchStyle = 7, + PianoStyle = 22, + BookcaseStyle = 24, + ChairStyle = 9, + ChestStyle = 32, + ProcessRoom = new CaveHouseBiome.BuildData.ProcessRoomMethod(CaveHouseBiome.AgeMushroomRoom) + }; + + public static CaveHouseBiome.BuildData CreateDefaultData() => new CaveHouseBiome.BuildData() + { + Tile = 30, + Wall = 27, + PlatformStyle = 0, + DoorStyle = 0, + TableStyle = 0, + WorkbenchStyle = 0, + PianoStyle = 0, + BookcaseStyle = 0, + ChairStyle = 0, + ChestStyle = 1, + ProcessRoom = new CaveHouseBiome.BuildData.ProcessRoomMethod(CaveHouseBiome.AgeDefaultRoom) + }; + + public delegate void ProcessRoomMethod(Microsoft.Xna.Framework.Rectangle room); } } } diff --git a/GameContent/Biomes/CorruptionPitBiome.cs b/GameContent/Biomes/CorruptionPitBiome.cs index cafa82e..30cd911 100644 --- a/GameContent/Biomes/CorruptionPitBiome.cs +++ b/GameContent/Biomes/CorruptionPitBiome.cs @@ -1,12 +1,12 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Biomes.CorruptionPitBiome -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Terraria.ID; -using Terraria.WorldBuilding; +using Terraria.World.Generation; namespace Terraria.GameContent.Biomes { @@ -16,7 +16,7 @@ namespace Terraria.GameContent.Biomes public override bool Place(Point origin, StructureMap structures) { - if (WorldGen.SolidTile(origin.X, origin.Y) && GenBase._tiles[origin.X, origin.Y].wall == (ushort) 3) + if (WorldGen.SolidTile(origin.X, origin.Y) && GenBase._tiles[origin.X, origin.Y].wall == (byte) 3) return false; if (!WorldUtils.Find(origin, Searches.Chain((GenSearch) new Searches.Down(100), (GenCondition) new Conditions.IsSolid()), out origin)) return false; @@ -40,15 +40,15 @@ namespace Terraria.GameContent.Biomes Microsoft.Xna.Framework.Rectangle bounds = ShapeData.GetBounds(origin, data1, shapeData2); if (!structures.CanPlace(bounds, CorruptionPitBiome.ValidTiles, 2)) return false; - WorldUtils.Gen(origin, (GenShape) new ModShapes.All(data1), Actions.Chain((GenAction) new Actions.SetTile((ushort) 25, true), (GenAction) new Actions.PlaceWall((ushort) 3))); + WorldUtils.Gen(origin, (GenShape) new ModShapes.All(data1), Actions.Chain((GenAction) new Actions.SetTile((ushort) 25, true), (GenAction) new Actions.PlaceWall((byte) 3))); WorldUtils.Gen(origin, (GenShape) new ModShapes.All(shapeData1), (GenAction) new Actions.SetTile((ushort) 0, true)); WorldUtils.Gen(origin, (GenShape) new ModShapes.All(shapeData2), (GenAction) new Actions.ClearTile(true)); WorldUtils.Gen(origin, (GenShape) new ModShapes.All(shapeData1), Actions.Chain((GenAction) new Modifiers.IsTouchingAir(true), (GenAction) new Modifiers.NotTouching(false, new ushort[1] { (ushort) 25 }), (GenAction) new Actions.SetTile((ushort) 23, true))); - WorldUtils.Gen(origin, (GenShape) new ModShapes.All(data2), (GenAction) new Actions.PlaceWall((ushort) 69)); - structures.AddProtectedStructure(bounds, 2); + WorldUtils.Gen(origin, (GenShape) new ModShapes.All(data2), (GenAction) new Actions.PlaceWall((byte) 69)); + structures.AddStructure(bounds, 2); return true; } } diff --git a/GameContent/Biomes/DeadMansChestBiome.cs b/GameContent/Biomes/DeadMansChestBiome.cs deleted file mode 100644 index 326318b..0000000 --- a/GameContent/Biomes/DeadMansChestBiome.cs +++ /dev/null @@ -1,461 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Biomes.DeadMansChestBiome -// 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; -using Newtonsoft.Json; -using System.Collections.Generic; -using Terraria.ID; -using Terraria.Utilities; -using Terraria.WorldBuilding; - -namespace Terraria.GameContent.Biomes -{ - public class DeadMansChestBiome : MicroBiome - { - private List _dartTrapPlacementSpots = new List(); - private List _wirePlacementSpots = new List(); - private List _boulderPlacementSpots = new List(); - private List _explosivePlacementAttempt = new List(); - [JsonProperty("NumberOfDartTraps")] - private IntRange _numberOfDartTraps = new IntRange(3, 6); - [JsonProperty("NumberOfBoulderTraps")] - private IntRange _numberOfBoulderTraps = new IntRange(2, 4); - [JsonProperty("NumberOfStepsBetweenBoulderTraps")] - private IntRange _numberOfStepsBetweenBoulderTraps = new IntRange(2, 4); - - public override bool Place(Point origin, StructureMap structures) - { - if (!DeadMansChestBiome.IsAGoodSpot(origin)) - return false; - this.ClearCaches(); - Point position = new Point(origin.X, origin.Y + 1); - this.FindBoulderTrapSpots(position); - this.FindDartTrapSpots(position); - this.FindExplosiveTrapSpots(position); - if (!this.AreThereEnoughTraps()) - return false; - this.TurnGoldChestIntoDeadMansChest(origin); - foreach (DeadMansChestBiome.DartTrapPlacementAttempt trapPlacementSpot in this._dartTrapPlacementSpots) - this.ActuallyPlaceDartTrap(trapPlacementSpot.position, trapPlacementSpot.directionX, trapPlacementSpot.x, trapPlacementSpot.y, trapPlacementSpot.xPush, trapPlacementSpot.t); - foreach (DeadMansChestBiome.WirePlacementAttempt wirePlacementSpot in this._wirePlacementSpots) - this.PlaceWireLine(wirePlacementSpot.position, wirePlacementSpot.dirX, wirePlacementSpot.dirY, wirePlacementSpot.steps); - foreach (DeadMansChestBiome.BoulderPlacementAttempt boulderPlacementSpot in this._boulderPlacementSpots) - this.ActuallyPlaceBoulderTrap(boulderPlacementSpot.position, boulderPlacementSpot.yPush, boulderPlacementSpot.requiredHeight, boulderPlacementSpot.bestType); - foreach (DeadMansChestBiome.ExplosivePlacementAttempt placementAttempt in this._explosivePlacementAttempt) - this.ActuallyPlaceExplosive(placementAttempt.position); - this.PlaceWiresForExplosives(origin); - return true; - } - - private void PlaceWiresForExplosives(Point origin) - { - if (this._explosivePlacementAttempt.Count <= 0) - return; - this.PlaceWireLine(origin, 0, 1, this._explosivePlacementAttempt[0].position.Y - origin.Y); - int x1 = this._explosivePlacementAttempt[0].position.X; - int num = this._explosivePlacementAttempt[0].position.X; - int y = this._explosivePlacementAttempt[0].position.Y; - for (int index = 1; index < this._explosivePlacementAttempt.Count; ++index) - { - int x2 = this._explosivePlacementAttempt[index].position.X; - if (x1 > x2) - x1 = x2; - if (num < x2) - num = x2; - } - this.PlaceWireLine(new Point(x1, y), 1, 0, num - x1); - } - - private bool AreThereEnoughTraps() => (this._boulderPlacementSpots.Count >= 1 || this._explosivePlacementAttempt.Count >= 1) && this._dartTrapPlacementSpots.Count >= 1; - - private void ClearCaches() - { - this._dartTrapPlacementSpots.Clear(); - this._wirePlacementSpots.Clear(); - this._boulderPlacementSpots.Clear(); - this._explosivePlacementAttempt.Clear(); - } - - private void FindBoulderTrapSpots(Point position) - { - int x1 = position.X; - int num1 = GenBase._random.Next(this._numberOfBoulderTraps); - int num2 = GenBase._random.Next(this._numberOfStepsBetweenBoulderTraps); - int x2 = x1 - num1 / 2 * num2; - int y = position.Y - 6; - for (int index = 0; index <= num1; ++index) - { - this.FindBoulderTrapSpot(new Point(x2, y)); - x2 += num2; - } - if (this._boulderPlacementSpots.Count <= 0) - return; - int x3 = this._boulderPlacementSpots[0].position.X; - int num3 = this._boulderPlacementSpots[0].position.X; - for (int index = 1; index < this._boulderPlacementSpots.Count; ++index) - { - int x4 = this._boulderPlacementSpots[index].position.X; - if (x3 > x4) - x3 = x4; - if (num3 < x4) - num3 = x4; - } - if (x3 > position.X) - x3 = position.X; - if (num3 < position.X) - num3 = position.X; - this._wirePlacementSpots.Add(new DeadMansChestBiome.WirePlacementAttempt(new Point(x3, y - 1), 1, 0, num3 - x3)); - this._wirePlacementSpots.Add(new DeadMansChestBiome.WirePlacementAttempt(position, 0, -1, 7)); - } - - private void FindBoulderTrapSpot(Point position) - { - int x = position.X; - int y = position.Y; - for (int yPush = 0; yPush < 50; ++yPush) - { - if (Main.tile[x, y - yPush].active()) - { - this.PlaceBoulderTrapSpot(new Point(x, y - yPush), yPush); - break; - } - } - } - - private void PlaceBoulderTrapSpot(Point position, int yPush) - { - int[] numArray = new int[623]; - for (int x = position.X; x < position.X + 2; ++x) - { - for (int index = position.Y - 4; index <= position.Y; ++index) - { - Tile tile = Main.tile[x, index]; - if (tile.active() && !Main.tileFrameImportant[(int) tile.type] && Main.tileSolid[(int) tile.type]) - ++numArray[(int) tile.type]; - if (tile.active() && !TileID.Sets.CanBeClearedDuringGeneration[(int) tile.type]) - return; - } - } - for (int index1 = position.X - 1; index1 < position.X + 2 + 1; ++index1) - { - for (int index2 = position.Y - 4 - 1; index2 <= position.Y - 4 + 2; ++index2) - { - if (!Main.tile[index1, index2].active()) - return; - } - } - int bestType = -1; - for (int index = 0; index < numArray.Length; ++index) - { - if (bestType == -1 || numArray[bestType] < numArray[index]) - bestType = index; - } - this._boulderPlacementSpots.Add(new DeadMansChestBiome.BoulderPlacementAttempt(position, yPush - 1, 4, bestType)); - } - - private void FindDartTrapSpots(Point position) - { - int num1 = GenBase._random.Next(this._numberOfDartTraps); - int directionX = GenBase._random.Next(2) == 0 ? -1 : 1; - int steps = -1; - for (int index = 0; index < num1; ++index) - { - int num2 = this.FindDartTrapSpotSingle(position, directionX) ? 1 : 0; - directionX *= -1; - --position.Y; - if (num2 != 0) - steps = index; - } - this._wirePlacementSpots.Add(new DeadMansChestBiome.WirePlacementAttempt(new Point(position.X, position.Y + num1), 0, -1, steps)); - } - - private bool FindDartTrapSpotSingle(Point position, int directionX) - { - int x = position.X; - int y = position.Y; - for (int xPush = 0; xPush < 20; ++xPush) - { - Tile t = Main.tile[x + xPush * directionX, y]; - if (t.type != (ushort) 467 && t.active() && Main.tileSolid[(int) t.type]) - { - if (xPush < 5 || t.actuator() || Main.tileFrameImportant[(int) t.type] || !TileID.Sets.CanBeClearedDuringGeneration[(int) t.type]) - return false; - this._dartTrapPlacementSpots.Add(new DeadMansChestBiome.DartTrapPlacementAttempt(position, directionX, x, y, xPush, t)); - return true; - } - } - return false; - } - - private void FindExplosiveTrapSpots(Point position) - { - int x1 = position.X; - int y = position.Y + 3; - List intList = new List(); - if (this.IsGoodSpotsForExplosive(x1, y)) - intList.Add(x1); - int x2 = x1 + 1; - if (this.IsGoodSpotsForExplosive(x2, y)) - intList.Add(x2); - int x3 = -1; - if (intList.Count > 0) - x3 = intList[GenBase._random.Next(intList.Count)]; - intList.Clear(); - int num1 = x2 + GenBase._random.Next(2, 6); - int num2 = 4; - for (int x4 = num1; x4 < num1 + num2; ++x4) - { - if (this.IsGoodSpotsForExplosive(x4, y)) - intList.Add(x4); - } - int x5 = -1; - if (intList.Count > 0) - x5 = intList[GenBase._random.Next(intList.Count)]; - int num3 = position.X - num2 - GenBase._random.Next(2, 6); - for (int x6 = num3; x6 < num3 + num2; ++x6) - { - if (this.IsGoodSpotsForExplosive(x6, y)) - intList.Add(x6); - } - int x7 = -1; - if (intList.Count > 0) - x7 = intList[GenBase._random.Next(intList.Count)]; - if (x7 != -1) - this._explosivePlacementAttempt.Add(new DeadMansChestBiome.ExplosivePlacementAttempt(new Point(x7, y))); - if (x3 != -1) - this._explosivePlacementAttempt.Add(new DeadMansChestBiome.ExplosivePlacementAttempt(new Point(x3, y))); - if (x5 == -1) - return; - this._explosivePlacementAttempt.Add(new DeadMansChestBiome.ExplosivePlacementAttempt(new Point(x5, y))); - } - - private bool IsGoodSpotsForExplosive(int x, int y) - { - Tile tile = Main.tile[x, y]; - return tile.active() && Main.tileSolid[(int) tile.type] && !Main.tileFrameImportant[(int) tile.type] && !Main.tileSolidTop[(int) tile.type]; - } - - public List GetPossibleChestsToTrapify(StructureMap structures) - { - List intList = new List(); - bool[] validTiles = new bool[TileID.Sets.GeneralPlacementTiles.Length]; - for (int index = 0; index < validTiles.Length; ++index) - validTiles[index] = TileID.Sets.GeneralPlacementTiles[index]; - validTiles[21] = true; - validTiles[467] = true; - for (int index = 0; index < 8000; ++index) - { - Chest chest = Main.chest[index]; - if (chest != null) - { - Point position1 = new Point(chest.x, chest.y); - if (DeadMansChestBiome.IsAGoodSpot(position1)) - { - this.ClearCaches(); - Point position2 = new Point(position1.X, position1.Y + 1); - this.FindBoulderTrapSpots(position2); - this.FindDartTrapSpots(position2); - if (this.AreThereEnoughTraps() && (structures == null || structures.CanPlace(new Microsoft.Xna.Framework.Rectangle(position1.X, position1.Y, 1, 1), validTiles, 10))) - intList.Add(index); - } - } - } - return intList; - } - - private static bool IsAGoodSpot(Point position) - { - if (!WorldGen.InWorld(position.X, position.Y, 50) || WorldGen.oceanDepths(position.X, position.Y)) - return false; - Tile tile1 = Main.tile[position.X, position.Y]; - if (tile1.type != (ushort) 21 || (int) tile1.frameX / 36 != 1) - return false; - Tile tile2 = Main.tile[position.X, position.Y + 2]; - return TileID.Sets.CanBeClearedDuringGeneration[(int) tile2.type] && WorldGen.countWires(position.X, position.Y, 20) <= 0 && WorldGen.countTiles(position.X, position.Y, lavaOk: true) >= 40; - } - - private void TurnGoldChestIntoDeadMansChest(Point position) - { - for (int index1 = 0; index1 < 2; ++index1) - { - for (int index2 = 0; index2 < 2; ++index2) - { - int index3 = position.X + index1; - int index4 = position.Y + index2; - Tile tile = Main.tile[index3, index4]; - tile.type = (ushort) 467; - tile.frameX = (short) (144 + index1 * 18); - tile.frameY = (short) (index2 * 18); - } - } - if (GenBase._random.Next(3) != 0) - return; - int chest = Chest.FindChest(position.X, position.Y); - if (chest <= -1) - return; - Item[] objArray = Main.chest[chest].item; - for (int index = objArray.Length - 2; index > 0; --index) - { - Item obj = objArray[index]; - if (obj.stack != 0) - objArray[index + 1] = obj.DeepClone(); - } - objArray[1] = new Item(); - objArray[1].SetDefaults(5007); - Main.chest[chest].item = objArray; - } - - private void ActuallyPlaceDartTrap( - Point position, - int directionX, - int x, - int y, - int xPush, - Tile t) - { - t.type = (ushort) 137; - t.frameY = (short) 0; - t.frameX = directionX != -1 ? (short) 0 : (short) 18; - t.slope((byte) 0); - t.halfBrick(false); - WorldGen.TileFrame(x, y, true); - this.PlaceWireLine(position, directionX, 0, xPush); - } - - private void PlaceWireLine(Point start, int offsetX, int offsetY, int steps) - { - for (int index = 0; index <= steps; ++index) - Main.tile[start.X + offsetX * index, start.Y + offsetY * index].wire(true); - } - - private void ActuallyPlaceBoulderTrap( - Point position, - int yPush, - int requiredHeight, - int bestType) - { - for (int x = position.X; x < position.X + 2; ++x) - { - for (int j = position.Y - requiredHeight; j <= position.Y + 2; ++j) - { - Tile tile = Main.tile[x, j]; - if (j < position.Y - requiredHeight + 2) - tile.ClearTile(); - else if (j <= position.Y) - { - if (!tile.active()) - { - tile.active(true); - tile.type = (ushort) bestType; - } - tile.slope((byte) 0); - tile.halfBrick(false); - tile.actuator(true); - tile.wire(true); - WorldGen.TileFrame(x, j, true); - } - else - tile.ClearTile(); - } - } - int i = position.X + 1; - int j1 = position.Y - requiredHeight + 1; - int num1 = 3; - int num2 = i - num1; - int num3 = j1 - num1; - int num4 = i + num1 - 1; - int num5 = j1 + num1 - 1; - for (int index1 = num2; index1 <= num4; ++index1) - { - for (int index2 = num3; index2 <= num5; ++index2) - { - if (Main.tile[index1, index2].type != (ushort) 138) - Main.tile[index1, index2].type = (ushort) 1; - } - } - WorldGen.PlaceTile(i, j1, 138); - this.PlaceWireLine(position, 0, 1, yPush); - } - - private void ActuallyPlaceExplosive(Point position) - { - Tile tile = Main.tile[position.X, position.Y]; - tile.type = (ushort) 141; - int num1; - short num2 = (short) (num1 = 0); - tile.frameY = (short) num1; - tile.frameX = num2; - tile.slope((byte) 0); - tile.halfBrick(false); - WorldGen.TileFrame(position.X, position.Y, true); - } - - private class DartTrapPlacementAttempt - { - public int directionX; - public int xPush; - public int x; - public int y; - public Point position; - public Tile t; - - public DartTrapPlacementAttempt( - Point position, - int directionX, - int x, - int y, - int xPush, - Tile t) - { - this.position = position; - this.directionX = directionX; - this.x = x; - this.y = y; - this.xPush = xPush; - this.t = t; - } - } - - private class BoulderPlacementAttempt - { - public Point position; - public int yPush; - public int requiredHeight; - public int bestType; - - public BoulderPlacementAttempt(Point position, int yPush, int requiredHeight, int bestType) - { - this.position = position; - this.yPush = yPush; - this.requiredHeight = requiredHeight; - this.bestType = bestType; - } - } - - private class WirePlacementAttempt - { - public Point position; - public int dirX; - public int dirY; - public int steps; - - public WirePlacementAttempt(Point position, int dirX, int dirY, int steps) - { - this.position = position; - this.dirX = dirX; - this.dirY = dirY; - this.steps = steps; - } - } - - private class ExplosivePlacementAttempt - { - public Point position; - - public ExplosivePlacementAttempt(Point position) => this.position = position; - } - } -} diff --git a/GameContent/Biomes/Desert/AnthillEntrance.cs b/GameContent/Biomes/Desert/AnthillEntrance.cs deleted file mode 100644 index f174b08..0000000 --- a/GameContent/Biomes/Desert/AnthillEntrance.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Biomes.Desert.AnthillEntrance -// 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; -using Terraria.WorldBuilding; - -namespace Terraria.GameContent.Biomes.Desert -{ - public static class AnthillEntrance - { - public static void Place(DesertDescription description) - { - int num1 = WorldGen.genRand.Next(2, 4); - for (int index = 0; index < num1; ++index) - { - int holeRadius = WorldGen.genRand.Next(15, 18); - int num2 = (int) ((double) (index + 1) / (double) (num1 + 1) * (double) description.Surface.Width) + description.Desert.Left; - int y = (int) description.Surface[num2]; - AnthillEntrance.PlaceAt(description, new Point(num2, y), holeRadius); - } - } - - private static void PlaceAt(DesertDescription description, Point position, int holeRadius) - { - ShapeData data = new ShapeData(); - Point origin = new Point(position.X, position.Y + 6); - WorldUtils.Gen(origin, (GenShape) new Shapes.Tail((float) (holeRadius * 2), new Vector2(0.0f, (float) -holeRadius * 1.5f)), Actions.Chain(new Actions.SetTile((ushort) 53).Output(data))); - GenShapeActionPair pair1 = new GenShapeActionPair((GenShape) new Shapes.Rectangle(1, 1), Actions.Chain((GenAction) new Modifiers.Blotches(), (GenAction) new Modifiers.IsSolid(), (GenAction) new Actions.Clear(), (GenAction) new Actions.PlaceWall((ushort) 187))); - GenShapeActionPair genShapeActionPair = new GenShapeActionPair((GenShape) new Shapes.Rectangle(1, 1), Actions.Chain((GenAction) new Modifiers.IsSolid(), (GenAction) new Actions.Clear(), (GenAction) new Actions.PlaceWall((ushort) 187))); - GenShapeActionPair pair2 = new GenShapeActionPair((GenShape) new Shapes.Circle(2, 3), Actions.Chain((GenAction) new Modifiers.IsSolid(), (GenAction) new Actions.SetTile((ushort) 397), (GenAction) new Actions.PlaceWall((ushort) 187))); - GenShapeActionPair pair3 = new GenShapeActionPair((GenShape) new Shapes.Circle(holeRadius, 3), Actions.Chain((GenAction) new Modifiers.SkipWalls(new ushort[1] - { - (ushort) 187 - }), (GenAction) new Actions.SetTile((ushort) 53))); - GenShapeActionPair pair4 = new GenShapeActionPair((GenShape) new Shapes.Circle(holeRadius - 2, 3), Actions.Chain((GenAction) new Actions.PlaceWall((ushort) 187))); - int x = position.X; - int y1 = position.Y - holeRadius - 3; - while (true) - { - int num1 = y1; - Microsoft.Xna.Framework.Rectangle rectangle = description.Hive; - int top1 = rectangle.Top; - int y2 = position.Y; - rectangle = description.Desert; - int top2 = rectangle.Top; - int num2 = (y2 - top2) * 2; - int num3 = top1 + num2 + 12; - if (num1 < num3) - { - WorldUtils.Gen(new Point(x, y1), y1 < position.Y ? genShapeActionPair : pair1); - WorldUtils.Gen(new Point(x, y1), pair2); - if (y1 % 3 == 0 && y1 >= position.Y) - { - x += WorldGen.genRand.Next(-1, 2); - WorldUtils.Gen(new Point(x, y1), pair1); - if (y1 >= position.Y + 5) - { - WorldUtils.Gen(new Point(x, y1), pair3); - WorldUtils.Gen(new Point(x, y1), pair4); - } - WorldUtils.Gen(new Point(x, y1), pair2); - } - ++y1; - } - else - break; - } - WorldUtils.Gen(new Point(origin.X, origin.Y - (int) ((double) holeRadius * 1.5) + 3), (GenShape) new Shapes.Circle(holeRadius / 2, holeRadius / 3), Actions.Chain(Actions.Chain((GenAction) new Actions.ClearTile(), (GenAction) new Modifiers.Expand(1), (GenAction) new Actions.PlaceWall((ushort) 0)))); - WorldUtils.Gen(origin, (GenShape) new ModShapes.All(data), (GenAction) new Actions.Smooth()); - } - } -} diff --git a/GameContent/Biomes/Desert/ChambersEntrance.cs b/GameContent/Biomes/Desert/ChambersEntrance.cs deleted file mode 100644 index 92f70ec..0000000 --- a/GameContent/Biomes/Desert/ChambersEntrance.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Biomes.Desert.ChambersEntrance -// 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; -using System; -using System.Collections.Generic; -using Terraria.Utilities; -using Terraria.WorldBuilding; - -namespace Terraria.GameContent.Biomes.Desert -{ - public static class ChambersEntrance - { - public static void Place(DesertDescription description) - { - int num = description.Desert.Center.X + WorldGen.genRand.Next(-40, 41); - Point position = new Point(num, (int) description.Surface[num]); - ChambersEntrance.PlaceAt(description, position); - } - - private static void PlaceAt(DesertDescription description, Point position) - { - ShapeData shapeData = new ShapeData(); - Point origin = new Point(position.X, position.Y + 2); - WorldUtils.Gen(origin, (GenShape) new Shapes.Circle(24, 12), Actions.Chain((GenAction) new Modifiers.Blotches(), new Actions.SetTile((ushort) 53).Output(shapeData))); - UnifiedRandom genRand = WorldGen.genRand; - ShapeData data = new ShapeData(); - int num1 = description.Hive.Top - position.Y; - int direction = genRand.Next(2) == 0 ? -1 : 1; - List pathConnectionList = new List() - { - new ChambersEntrance.PathConnection(new Point(position.X + -direction * 26, position.Y - 8), direction) - }; - int num2 = genRand.Next(2, 4); - for (int index = 0; index < num2; ++index) - { - int y = (int) ((double) (index + 1) / (double) num2 * (double) num1) + genRand.Next(-8, 9); - int x = direction * genRand.Next(20, 41); - int num3 = genRand.Next(18, 29); - WorldUtils.Gen(position, (GenShape) new Shapes.Circle(num3 / 2, 3), Actions.Chain((GenAction) new Modifiers.Offset(x, y), (GenAction) new Modifiers.Blotches(), new Actions.Clear().Output(data), (GenAction) new Actions.PlaceWall((ushort) 187))); - pathConnectionList.Add(new ChambersEntrance.PathConnection(new Point(x + num3 / 2 * -direction + position.X, y + position.Y), -direction)); - direction *= -1; - } - WorldUtils.Gen(position, (GenShape) new ModShapes.OuterOutline(data), Actions.Chain((GenAction) new Modifiers.Expand(1), (GenAction) new Modifiers.OnlyTiles(new ushort[1] - { - (ushort) 53 - }), (GenAction) new Actions.SetTile((ushort) 397), (GenAction) new Actions.PlaceWall((ushort) 187))); - GenShapeActionPair pair = new GenShapeActionPair((GenShape) new Shapes.Rectangle(2, 4), Actions.Chain((GenAction) new Modifiers.IsSolid(), (GenAction) new Modifiers.Blotches(), (GenAction) new Actions.Clear(), (GenAction) new Modifiers.Expand(1), (GenAction) new Actions.PlaceWall((ushort) 187), (GenAction) new Modifiers.OnlyTiles(new ushort[1] - { - (ushort) 53 - }), (GenAction) new Actions.SetTile((ushort) 397))); - for (int index = 1; index < pathConnectionList.Count; ++index) - { - ChambersEntrance.PathConnection pathConnection1 = pathConnectionList[index - 1]; - ChambersEntrance.PathConnection pathConnection2 = pathConnectionList[index]; - float num4 = Math.Abs(pathConnection2.Position.X - pathConnection1.Position.X) * 1.5f; - for (float amount = 0.0f; (double) amount <= 1.0; amount += 0.02f) - { - Vector2 vector2_1 = new Vector2(pathConnection1.Position.X + pathConnection1.Direction * num4 * amount, pathConnection1.Position.Y); - Vector2 vector2_2 = new Vector2(pathConnection2.Position.X + (float) ((double) pathConnection2.Direction * (double) num4 * (1.0 - (double) amount)), pathConnection2.Position.Y); - Vector2 vector2_3 = Vector2.Lerp(pathConnection1.Position, pathConnection2.Position, amount); - Vector2 vector2_4 = vector2_3; - double num5 = (double) amount; - WorldUtils.Gen(Vector2.Lerp(Vector2.Lerp(vector2_1, vector2_4, (float) num5), Vector2.Lerp(vector2_3, vector2_2, amount), amount).ToPoint(), pair); - } - } - WorldUtils.Gen(origin, (GenShape) new Shapes.Rectangle(new Microsoft.Xna.Framework.Rectangle(-29, -12, 58, 12)), Actions.Chain((GenAction) new Modifiers.NotInShape(shapeData), (GenAction) new Modifiers.Expand(1), (GenAction) new Actions.PlaceWall((ushort) 0))); - } - - private struct PathConnection - { - public readonly Vector2 Position; - public readonly float Direction; - - public PathConnection(Point position, int direction) - { - this.Position = new Vector2((float) position.X, (float) position.Y); - this.Direction = (float) direction; - } - } - } -} diff --git a/GameContent/Biomes/Desert/DesertDescription.cs b/GameContent/Biomes/Desert/DesertDescription.cs deleted file mode 100644 index 29f6cd7..0000000 --- a/GameContent/Biomes/Desert/DesertDescription.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Biomes.Desert.DesertDescription -// 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.Biomes.Desert -{ - public class DesertDescription - { - public static readonly DesertDescription Invalid = new DesertDescription() - { - IsValid = false - }; - private static readonly Vector2 DefaultBlockScale = new Vector2(4f, 2f); - private const int SCAN_PADDING = 5; - - public Rectangle CombinedArea { get; private set; } - - public Rectangle Desert { get; private set; } - - public Rectangle Hive { get; private set; } - - public Vector2 BlockScale { get; private set; } - - public int BlockColumnCount { get; private set; } - - public int BlockRowCount { get; private set; } - - public bool IsValid { get; private set; } - - public SurfaceMap Surface { get; private set; } - - private DesertDescription() - { - } - - public void UpdateSurfaceMap() => this.Surface = SurfaceMap.FromArea(this.CombinedArea.Left - 5, this.CombinedArea.Width + 10); - - public static DesertDescription CreateFromPlacement(Point origin) - { - Vector2 defaultBlockScale = DesertDescription.DefaultBlockScale; - float num1 = (float) Main.maxTilesX / 4200f; - int num2 = (int) (80.0 * (double) num1); - int num3 = (int) (((double) WorldGen.genRand.NextFloat() + 1.0) * 170.0 * (double) num1); - int width = (int) ((double) defaultBlockScale.X * (double) num2); - int height = (int) ((double) defaultBlockScale.Y * (double) num3); - origin.X -= width / 2; - SurfaceMap surfaceMap = SurfaceMap.FromArea(origin.X - 5, width + 10); - if (DesertDescription.RowHasInvalidTiles(origin.X, surfaceMap.Bottom, width)) - return DesertDescription.Invalid; - int y = (int) ((double) surfaceMap.Average + (double) surfaceMap.Bottom) / 2; - origin.Y = y + WorldGen.genRand.Next(40, 60); - return new DesertDescription() - { - CombinedArea = new Rectangle(origin.X, y, width, origin.Y + height - y), - Hive = new Rectangle(origin.X, origin.Y, width, height), - Desert = new Rectangle(origin.X, y, width, origin.Y + height / 2 - y), - BlockScale = defaultBlockScale, - BlockColumnCount = num2, - BlockRowCount = num3, - Surface = surfaceMap, - IsValid = true - }; - } - - private static bool RowHasInvalidTiles(int startX, int startY, int width) - { - if (WorldGen.skipDesertTileCheck) - return false; - for (int index = startX; index < startX + width; ++index) - { - switch (Main.tile[index, startY].type) - { - case 59: - case 60: - return true; - case 147: - case 161: - return true; - default: - continue; - } - } - return false; - } - } -} diff --git a/GameContent/Biomes/Desert/DesertHive.cs b/GameContent/Biomes/Desert/DesertHive.cs deleted file mode 100644 index ee87591..0000000 --- a/GameContent/Biomes/Desert/DesertHive.cs +++ /dev/null @@ -1,366 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Biomes.Desert.DesertHive -// 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; -using System; -using System.Collections.Generic; -using Terraria.Utilities; - -namespace Terraria.GameContent.Biomes.Desert -{ - public static class DesertHive - { - public static void Place(DesertDescription description) - { - DesertHive.ClusterGroup clusters = DesertHive.ClusterGroup.FromDescription(description); - DesertHive.PlaceClusters(description, clusters); - DesertHive.AddTileVariance(description); - } - - private static void PlaceClusters( - DesertDescription description, - DesertHive.ClusterGroup clusters) - { - Rectangle hive = description.Hive; - hive.Inflate(20, 20); - DesertHive.PostPlacementEffect[,] postEffectMap = new DesertHive.PostPlacementEffect[hive.Width, hive.Height]; - DesertHive.PlaceClustersArea(description, clusters, hive, postEffectMap, Point.Zero); - for (int left = hive.Left; left < hive.Right; ++left) - { - for (int top = hive.Top; top < hive.Bottom; ++top) - { - if (postEffectMap[left - hive.Left, top - hive.Top].HasFlag((Enum) DesertHive.PostPlacementEffect.Smooth)) - Tile.SmoothSlope(left, top, false); - } - } - } - - private static void PlaceClustersArea( - DesertDescription description, - DesertHive.ClusterGroup clusters, - Rectangle area, - DesertHive.PostPlacementEffect[,] postEffectMap, - Point postEffectMapOffset) - { - FastRandom fastRandom1 = new FastRandom(Main.ActiveWorldFileData.Seed).WithModifier(57005UL); - Vector2 vector2_1 = new Vector2((float) description.Hive.Width, (float) description.Hive.Height); - Vector2 vector2_2 = new Vector2((float) clusters.Width, (float) clusters.Height); - Vector2 vector2_3 = description.BlockScale / 2f; - for (int left = area.Left; left < area.Right; ++left) - { - for (int top = area.Top; top < area.Bottom; ++top) - { - if (WorldGen.InWorld(left, top, 1)) - { - float num1 = 0.0f; - int num2 = -1; - float num3 = 0.0f; - ushort type = 53; - if (fastRandom1.Next(3) == 0) - type = (ushort) 397; - int x = left - description.Hive.X; - int y = top - description.Hive.Y; - Vector2 vector2_4 = (new Vector2((float) x, (float) y) - vector2_3) / vector2_1 * vector2_2; - for (int index = 0; index < clusters.Count; ++index) - { - DesertHive.Cluster cluster = clusters[index]; - if ((double) Math.Abs(cluster[0].Position.X - vector2_4.X) <= 10.0 && (double) Math.Abs(cluster[0].Position.Y - vector2_4.Y) <= 10.0) - { - float num4 = 0.0f; - foreach (DesertHive.Block block in (List) cluster) - num4 += 1f / Vector2.DistanceSquared(block.Position, vector2_4); - if ((double) num4 > (double) num1) - { - if ((double) num1 > (double) num3) - num3 = num1; - num1 = num4; - num2 = index; - } - else if ((double) num4 > (double) num3) - num3 = num4; - } - } - float num5 = num1 + num3; - Tile tile = Main.tile[left, top]; - bool flag = (double) ((new Vector2((float) x, (float) y) - vector2_3) / vector2_1 * 2f - Vector2.One).Length() >= 0.800000011920929; - DesertHive.PostPlacementEffect postPlacementEffect = DesertHive.PostPlacementEffect.None; - if ((double) num5 > 3.5) - { - postPlacementEffect = DesertHive.PostPlacementEffect.Smooth; - tile.ClearEverything(); - tile.wall = (ushort) 187; - if (num2 % 15 == 2) - tile.ResetToType((ushort) 404); - } - else if ((double) num5 > 1.79999995231628) - { - tile.wall = (ushort) 187; - if ((double) top < Main.worldSurface) - tile.liquid = (byte) 0; - else - tile.lava(true); - if (!flag || tile.active()) - { - tile.ResetToType((ushort) 396); - postPlacementEffect = DesertHive.PostPlacementEffect.Smooth; - } - } - else if ((double) num5 > 0.699999988079071 || !flag) - { - tile.wall = (ushort) 216; - tile.liquid = (byte) 0; - if (!flag || tile.active()) - { - tile.ResetToType(type); - postPlacementEffect = DesertHive.PostPlacementEffect.Smooth; - } - } - else if ((double) num5 > 0.25) - { - FastRandom fastRandom2 = fastRandom1.WithModifier(x, y); - float num6 = (float) (((double) num5 - 0.25) / 0.449999988079071); - if ((double) fastRandom2.NextFloat() < (double) num6) - { - tile.wall = (ushort) 187; - if ((double) top < Main.worldSurface) - tile.liquid = (byte) 0; - else - tile.lava(true); - if (tile.active()) - { - tile.ResetToType(type); - postPlacementEffect = DesertHive.PostPlacementEffect.Smooth; - } - } - } - postEffectMap[left - area.X + postEffectMapOffset.X, top - area.Y + postEffectMapOffset.Y] = postPlacementEffect; - } - } - } - } - - private static void AddTileVariance(DesertDescription description) - { - for (int index1 = -20; index1 < description.Hive.Width + 20; ++index1) - { - for (int index2 = -20; index2 < description.Hive.Height + 20; ++index2) - { - int x = index1 + description.Hive.X; - int y = index2 + description.Hive.Y; - if (WorldGen.InWorld(x, y, 1)) - { - Tile tile = Main.tile[x, y]; - Tile testTile1 = Main.tile[x, y + 1]; - Tile testTile2 = Main.tile[x, y + 2]; - if (tile.type == (ushort) 53 && (!WorldGen.SolidTile(testTile1) || !WorldGen.SolidTile(testTile2))) - tile.type = (ushort) 397; - } - } - } - for (int index3 = -20; index3 < description.Hive.Width + 20; ++index3) - { - for (int index4 = -20; index4 < description.Hive.Height + 20; ++index4) - { - int index5 = index3 + description.Hive.X; - int y = index4 + description.Hive.Y; - if (WorldGen.InWorld(index5, y, 1)) - { - Tile tile = Main.tile[index5, y]; - if (tile.active() && tile.type == (ushort) 396) - { - bool flag1 = true; - for (int index6 = -1; index6 >= -3; --index6) - { - if (Main.tile[index5, y + index6].active()) - { - flag1 = false; - break; - } - } - bool flag2 = true; - for (int index7 = 1; index7 <= 3; ++index7) - { - if (Main.tile[index5, y + index7].active()) - { - flag2 = false; - break; - } - } - if (flag1 && WorldGen.genRand.Next(5) == 0) - WorldGen.PlaceTile(index5, y - 1, 485, true, true, style: WorldGen.genRand.Next(4)); - else if (flag1 && WorldGen.genRand.Next(5) == 0) - WorldGen.PlaceTile(index5, y - 1, 484, true, true); - else if (flag1 ^ flag2 && WorldGen.genRand.Next(5) == 0) - WorldGen.PlaceTile(index5, y + (flag1 ? -1 : 1), 165, true, true); - else if (flag1 && WorldGen.genRand.Next(5) == 0) - WorldGen.PlaceTile(index5, y - 1, 187, true, true, style: (29 + WorldGen.genRand.Next(6))); - } - } - } - } - } - - private struct Block - { - public Vector2 Position; - - public Block(float x, float y) => this.Position = new Vector2(x, y); - } - - private class Cluster : List - { - } - - private class ClusterGroup : List - { - public readonly int Width; - public readonly int Height; - - private ClusterGroup(int width, int height) - { - this.Width = width; - this.Height = height; - this.Generate(); - } - - public static DesertHive.ClusterGroup FromDescription(DesertDescription description) => new DesertHive.ClusterGroup(description.BlockColumnCount, description.BlockRowCount); - - private static void SearchForCluster( - bool[,] blockMap, - List pointCluster, - int x, - int y, - int level = 2) - { - pointCluster.Add(new Point(x, y)); - blockMap[x, y] = false; - --level; - if (level == -1) - return; - if (x > 0 && blockMap[x - 1, y]) - DesertHive.ClusterGroup.SearchForCluster(blockMap, pointCluster, x - 1, y, level); - if (x < blockMap.GetLength(0) - 1 && blockMap[x + 1, y]) - DesertHive.ClusterGroup.SearchForCluster(blockMap, pointCluster, x + 1, y, level); - if (y > 0 && blockMap[x, y - 1]) - DesertHive.ClusterGroup.SearchForCluster(blockMap, pointCluster, x, y - 1, level); - if (y >= blockMap.GetLength(1) - 1 || !blockMap[x, y + 1]) - return; - DesertHive.ClusterGroup.SearchForCluster(blockMap, pointCluster, x, y + 1, level); - } - - private static void AttemptClaim( - int x, - int y, - int[,] clusterIndexMap, - List> pointClusters, - int index) - { - int clusterIndex = clusterIndexMap[x, y]; - if (clusterIndex == -1 || clusterIndex == index) - return; - int num = WorldGen.genRand.Next(2) == 0 ? -1 : index; - foreach (Point point in pointClusters[clusterIndex]) - clusterIndexMap[point.X, point.Y] = num; - } - - private void Generate() - { - this.Clear(); - bool[,] blockMap = new bool[this.Width, this.Height]; - int num1 = this.Width / 2 - 1; - int y1 = this.Height / 2 - 1; - int num2 = (num1 + 1) * (num1 + 1); - Point point1 = new Point(num1, y1); - for (int index1 = point1.Y - y1; index1 <= point1.Y + y1; ++index1) - { - float num3 = (float) num1 / (float) y1 * (float) (index1 - point1.Y); - int num4 = Math.Min(num1, (int) Math.Sqrt((double) num2 - (double) num3 * (double) num3)); - for (int index2 = point1.X - num4; index2 <= point1.X + num4; ++index2) - blockMap[index2, index1] = WorldGen.genRand.Next(2) == 0; - } - List> pointClusters = new List>(); - for (int x = 0; x < blockMap.GetLength(0); ++x) - { - for (int y2 = 0; y2 < blockMap.GetLength(1); ++y2) - { - if (blockMap[x, y2] && WorldGen.genRand.Next(2) == 0) - { - List pointCluster = new List(); - DesertHive.ClusterGroup.SearchForCluster(blockMap, pointCluster, x, y2); - if (pointCluster.Count > 2) - pointClusters.Add(pointCluster); - } - } - } - int[,] clusterIndexMap = new int[blockMap.GetLength(0), blockMap.GetLength(1)]; - for (int index3 = 0; index3 < clusterIndexMap.GetLength(0); ++index3) - { - for (int index4 = 0; index4 < clusterIndexMap.GetLength(1); ++index4) - clusterIndexMap[index3, index4] = -1; - } - for (int index = 0; index < pointClusters.Count; ++index) - { - foreach (Point point2 in pointClusters[index]) - clusterIndexMap[point2.X, point2.Y] = index; - } - for (int index5 = 0; index5 < pointClusters.Count; ++index5) - { - foreach (Point point3 in pointClusters[index5]) - { - int x = point3.X; - int y3 = point3.Y; - if (clusterIndexMap[x, y3] != -1) - { - int index6 = clusterIndexMap[x, y3]; - if (x > 0) - DesertHive.ClusterGroup.AttemptClaim(x - 1, y3, clusterIndexMap, pointClusters, index6); - if (x < clusterIndexMap.GetLength(0) - 1) - DesertHive.ClusterGroup.AttemptClaim(x + 1, y3, clusterIndexMap, pointClusters, index6); - if (y3 > 0) - DesertHive.ClusterGroup.AttemptClaim(x, y3 - 1, clusterIndexMap, pointClusters, index6); - if (y3 < clusterIndexMap.GetLength(1) - 1) - DesertHive.ClusterGroup.AttemptClaim(x, y3 + 1, clusterIndexMap, pointClusters, index6); - } - else - break; - } - } - foreach (List pointList in pointClusters) - pointList.Clear(); - for (int x = 0; x < clusterIndexMap.GetLength(0); ++x) - { - for (int y4 = 0; y4 < clusterIndexMap.GetLength(1); ++y4) - { - if (clusterIndexMap[x, y4] != -1) - pointClusters[clusterIndexMap[x, y4]].Add(new Point(x, y4)); - } - } - foreach (List pointList in pointClusters) - { - if (pointList.Count < 4) - pointList.Clear(); - } - foreach (List pointList in pointClusters) - { - DesertHive.Cluster cluster = new DesertHive.Cluster(); - if (pointList.Count > 0) - { - foreach (Point point4 in pointList) - cluster.Add(new DesertHive.Block((float) point4.X + (float) (((double) WorldGen.genRand.NextFloat() - 0.5) * 0.5), (float) point4.Y + (float) (((double) WorldGen.genRand.NextFloat() - 0.5) * 0.5))); - this.Add(cluster); - } - } - } - } - - [Flags] - private enum PostPlacementEffect : byte - { - None = 0, - Smooth = 1, - } - } -} diff --git a/GameContent/Biomes/Desert/LarvaHoleEntrance.cs b/GameContent/Biomes/Desert/LarvaHoleEntrance.cs deleted file mode 100644 index 4e4f612..0000000 --- a/GameContent/Biomes/Desert/LarvaHoleEntrance.cs +++ /dev/null @@ -1,64 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Biomes.Desert.LarvaHoleEntrance -// 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; -using Terraria.WorldBuilding; - -namespace Terraria.GameContent.Biomes.Desert -{ - public static class LarvaHoleEntrance - { - public static void Place(DesertDescription description) - { - int num1 = WorldGen.genRand.Next(2, 4); - for (int index = 0; index < num1; ++index) - { - int holeRadius = WorldGen.genRand.Next(13, 16); - int num2 = (int) ((double) (index + 1) / (double) (num1 + 1) * (double) description.Surface.Width) + description.Desert.Left; - int y = (int) description.Surface[num2]; - LarvaHoleEntrance.PlaceAt(description, new Point(num2, y), holeRadius); - } - } - - private static void PlaceAt(DesertDescription description, Point position, int holeRadius) - { - ShapeData data = new ShapeData(); - WorldUtils.Gen(position, (GenShape) new Shapes.Rectangle(new Microsoft.Xna.Framework.Rectangle(-holeRadius, -holeRadius * 2, holeRadius * 2, holeRadius * 2)), new Actions.Clear().Output(data)); - WorldUtils.Gen(position, (GenShape) new Shapes.Tail((float) (holeRadius * 2), new Vector2(0.0f, (float) holeRadius * 1.5f)), Actions.Chain(new Actions.Clear().Output(data))); - WorldUtils.Gen(position, (GenShape) new ModShapes.All(data), Actions.Chain((GenAction) new Modifiers.Offset(0, 1), (GenAction) new Modifiers.Expand(1), (GenAction) new Modifiers.IsSolid(), (GenAction) new Actions.Smooth(true))); - GenShapeActionPair pair1 = new GenShapeActionPair((GenShape) new Shapes.Rectangle(1, 1), Actions.Chain((GenAction) new Modifiers.Blotches(), (GenAction) new Modifiers.IsSolid(), (GenAction) new Actions.Clear(), (GenAction) new Actions.PlaceWall((ushort) 187))); - GenShapeActionPair pair2 = new GenShapeActionPair((GenShape) new Shapes.Circle(2, 3), Actions.Chain((GenAction) new Modifiers.IsSolid(), (GenAction) new Actions.SetTile((ushort) 397), (GenAction) new Actions.PlaceWall((ushort) 187))); - int x = position.X; - int y1 = position.Y + (int) ((double) holeRadius * 1.5); - while (true) - { - int num1 = y1; - Microsoft.Xna.Framework.Rectangle rectangle = description.Hive; - int top1 = rectangle.Top; - int y2 = position.Y; - rectangle = description.Desert; - int top2 = rectangle.Top; - int num2 = (y2 - top2) * 2; - int num3 = top1 + num2 + 12; - if (num1 < num3) - { - WorldUtils.Gen(new Point(x, y1), pair1); - WorldUtils.Gen(new Point(x, y1), pair2); - if (y1 % 3 == 0) - { - x += WorldGen.genRand.Next(-1, 2); - WorldUtils.Gen(new Point(x, y1), pair1); - WorldUtils.Gen(new Point(x, y1), pair2); - } - ++y1; - } - else - break; - } - WorldUtils.Gen(new Point(position.X, position.Y + 2), (GenShape) new ModShapes.All(data), (GenAction) new Actions.PlaceWall((ushort) 0)); - } - } -} diff --git a/GameContent/Biomes/Desert/PitEntrance.cs b/GameContent/Biomes/Desert/PitEntrance.cs deleted file mode 100644 index 9bca716..0000000 --- a/GameContent/Biomes/Desert/PitEntrance.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Biomes.Desert.PitEntrance -// 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; -using System; - -namespace Terraria.GameContent.Biomes.Desert -{ - public static class PitEntrance - { - public static void Place(DesertDescription description) - { - int holeRadius = WorldGen.genRand.Next(6, 9); - Point center = description.CombinedArea.Center; - center.Y = (int) description.Surface[center.X]; - PitEntrance.PlaceAt(description, center, holeRadius); - } - - private static void PlaceAt(DesertDescription description, Point position, int holeRadius) - { - for (int index = -holeRadius - 3; index < holeRadius + 3; ++index) - { - int j = (int) description.Surface[index + position.X]; - while (true) - { - int num1 = j; - Rectangle rectangle = description.Hive; - int num2 = rectangle.Top + 10; - if (num1 <= num2) - { - double num3 = (double) (j - (int) description.Surface[index + position.X]); - rectangle = description.Hive; - int top1 = rectangle.Top; - rectangle = description.Desert; - int top2 = rectangle.Top; - double num4 = (double) (top1 - top2); - float yProgress = MathHelper.Clamp((float) (num3 / num4), 0.0f, 1f); - int num5 = (int) ((double) PitEntrance.GetHoleRadiusScaleAt(yProgress) * (double) holeRadius); - if (Math.Abs(index) < num5) - Main.tile[index + position.X, j].ClearEverything(); - else if (Math.Abs(index) < num5 + 3 && (double) yProgress > 0.349999994039536) - Main.tile[index + position.X, j].ResetToType((ushort) 397); - float num6 = Math.Abs((float) index / (float) holeRadius); - float num7 = num6 * num6; - if (Math.Abs(index) < num5 + 3 && (double) (j - position.Y) > 15.0 - 3.0 * (double) num7) - { - Main.tile[index + position.X, j].wall = (ushort) 187; - WorldGen.SquareWallFrame(index + position.X, j - 1); - WorldGen.SquareWallFrame(index + position.X, j); - } - ++j; - } - else - break; - } - } - holeRadius += 4; - for (int index1 = -holeRadius; index1 < holeRadius; ++index1) - { - int num8 = holeRadius - Math.Abs(index1); - int num9 = Math.Min(10, num8 * num8); - for (int index2 = 0; index2 < num9; ++index2) - Main.tile[index1 + position.X, index2 + (int) description.Surface[index1 + position.X]].ClearEverything(); - } - } - - private static float GetHoleRadiusScaleAt(float yProgress) => (double) yProgress < 0.600000023841858 ? 1f : (float) ((1.0 - (double) PitEntrance.SmootherStep((float) (((double) yProgress - 0.600000023841858) / 0.400000005960464))) * 0.5 + 0.5); - - private static float SmootherStep(float delta) - { - delta = MathHelper.Clamp(delta, 0.0f, 1f); - return (float) (1.0 - Math.Cos((double) delta * 3.14159274101257) * 0.5 - 0.5); - } - } -} diff --git a/GameContent/Biomes/Desert/SandMound.cs b/GameContent/Biomes/Desert/SandMound.cs deleted file mode 100644 index 44ff573..0000000 --- a/GameContent/Biomes/Desert/SandMound.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Biomes.Desert.SandMound -// 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; -using System; - -namespace Terraria.GameContent.Biomes.Desert -{ - public static class SandMound - { - public static void Place(DesertDescription description) - { - Rectangle desert1 = description.Desert; - desert1.Height = Math.Min(description.Desert.Height, description.Hive.Height / 2); - Rectangle desert2 = description.Desert; - desert2.Y = desert1.Bottom; - desert2.Height = Math.Max(0, description.Desert.Bottom - desert1.Bottom); - SurfaceMap surface = description.Surface; - int num1 = 0; - int num2 = 0; - for (int index1 = -5; index1 < desert1.Width + 5; ++index1) - { - float num3 = MathHelper.Clamp((float) ((double) Math.Abs((float) (index1 + 5) / (float) (desert1.Width + 10)) * 2.0 - 1.0), -1f, 1f); - if (index1 % 3 == 0) - num1 = Utils.Clamp(num1 + WorldGen.genRand.Next(-1, 2), -10, 10); - num2 = Utils.Clamp(num2 + WorldGen.genRand.Next(-1, 2), -10, 10); - float num4 = (float) Math.Sqrt(1.0 - (double) num3 * (double) num3 * (double) num3 * (double) num3); - int num5 = desert1.Bottom - (int) ((double) num4 * (double) desert1.Height) + num1; - if ((double) Math.Abs(num3) < 1.0) - { - float num6 = Utils.UnclampedSmoothStep(0.5f, 0.8f, Math.Abs(num3)); - float num7 = num6 * num6 * num6; - int num8 = Math.Min(10 + (int) ((double) desert1.Top - (double) num7 * 20.0) + num2, num5); - for (int index2 = (int) surface[index1 + desert1.X] - 1; index2 < num8; ++index2) - { - int index3 = index1 + desert1.X; - int index4 = index2; - Main.tile[index3, index4].active(false); - Main.tile[index3, index4].wall = (ushort) 0; - } - } - SandMound.PlaceSandColumn(index1 + desert1.X, num5, desert2.Bottom - num5); - } - } - - private static void PlaceSandColumn(int startX, int startY, int height) - { - for (int index = startY + height - 1; index >= startY; --index) - { - int i = startX; - int j = index; - Tile tile1 = Main.tile[i, j]; - tile1.liquid = (byte) 0; - Tile tile2 = Main.tile[i, j + 1]; - Tile tile3 = Main.tile[i, j + 2]; - tile1.type = (ushort) 53; - tile1.slope((byte) 0); - tile1.halfBrick(false); - tile1.active(true); - if (index < startY) - tile1.active(false); - WorldGen.SquareWallFrame(i, j); - } - } - } -} diff --git a/GameContent/Biomes/Desert/SurfaceMap.cs b/GameContent/Biomes/Desert/SurfaceMap.cs deleted file mode 100644 index f00a69d..0000000 --- a/GameContent/Biomes/Desert/SurfaceMap.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Biomes.Desert.SurfaceMap -// 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.Biomes.Desert -{ - public class SurfaceMap - { - public readonly float Average; - public readonly int Bottom; - public readonly int Top; - public readonly int X; - private readonly short[] _heights; - - public int Width => this._heights.Length; - - private SurfaceMap(short[] heights, int x) - { - this._heights = heights; - this.X = x; - int val1_1 = 0; - int val1_2 = int.MaxValue; - int num = 0; - for (int index = 0; index < heights.Length; ++index) - { - num += (int) heights[index]; - val1_1 = Math.Max(val1_1, (int) heights[index]); - val1_2 = Math.Min(val1_2, (int) heights[index]); - } - if ((double) val1_1 > Main.worldSurface - 10.0) - val1_1 = (int) Main.worldSurface - 10; - this.Bottom = val1_1; - this.Top = val1_2; - this.Average = (float) num / (float) this._heights.Length; - } - - public short this[int absoluteX] => this._heights[absoluteX - this.X]; - - public static SurfaceMap FromArea(int startX, int width) - { - int num1 = Main.maxTilesY / 2; - short[] heights = new short[width]; - for (int index1 = startX; index1 < startX + width; ++index1) - { - bool flag = false; - int num2 = 0; - for (int index2 = 50; index2 < 50 + num1; ++index2) - { - if (Main.tile[index1, index2].active()) - { - if (Main.tile[index1, index2].type == (ushort) 189 || Main.tile[index1, index2].type == (ushort) 196 || Main.tile[index1, index2].type == (ushort) 460) - flag = false; - else if (!flag) - { - num2 = index2; - flag = true; - } - } - if (!flag) - num2 = num1 + 50; - } - heights[index1 - startX] = (short) num2; - } - return new SurfaceMap(heights, startX); - } - } -} diff --git a/GameContent/Biomes/DesertBiome.cs b/GameContent/Biomes/DesertBiome.cs index 586fc41..1fe4ed3 100644 --- a/GameContent/Biomes/DesertBiome.cs +++ b/GameContent/Biomes/DesertBiome.cs @@ -1,71 +1,457 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Biomes.DesertBiome -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; -using Newtonsoft.Json; -using Terraria.GameContent.Biomes.Desert; -using Terraria.WorldBuilding; +using System; +using System.Collections.Generic; +using Terraria.World.Generation; namespace Terraria.GameContent.Biomes { public class DesertBiome : MicroBiome { - [JsonProperty("ChanceOfEntrance")] - public float ChanceOfEntrance = 0.3333f; - - public override bool Place(Point origin, StructureMap structures) + private void PlaceSand(DesertBiome.ClusterGroup clusters, Point start, Vector2 scale) { - DesertDescription fromPlacement = DesertDescription.CreateFromPlacement(origin); - if (!fromPlacement.IsValid) - return false; - DesertBiome.ExportDescriptionToEngine(fromPlacement); - SandMound.Place(fromPlacement); - fromPlacement.UpdateSurfaceMap(); - if ((double) GenBase._random.NextFloat() <= (double) this.ChanceOfEntrance) + int num1 = (int) ((double) scale.X * (double) clusters.Width); + int num2 = (int) ((double) scale.Y * (double) clusters.Height); + int num3 = 5; + int val1 = start.Y + (num2 >> 1); + float num4 = 0.0f; + short[] numArray = new short[num1 + num3 * 2]; + for (int index = -num3; index < num1 + num3; ++index) { - switch (GenBase._random.Next(4)) + for (int y = 150; y < val1; ++y) { - case 0: - ChambersEntrance.Place(fromPlacement); - break; - case 1: - AnthillEntrance.Place(fromPlacement); - break; - case 2: - LarvaHoleEntrance.Place(fromPlacement); - break; - case 3: - PitEntrance.Place(fromPlacement); + if (WorldGen.SolidOrSlopedTile(index + start.X, y)) + { + num4 += (float) (y - 1); + numArray[index + num3] = (short) (y - 1); break; + } } } - DesertHive.Place(fromPlacement); - DesertBiome.CleanupArea(fromPlacement.Hive); - Microsoft.Xna.Framework.Rectangle area = new Microsoft.Xna.Framework.Rectangle(fromPlacement.CombinedArea.X, 50, fromPlacement.CombinedArea.Width, fromPlacement.CombinedArea.Bottom - 20); - structures.AddStructure(area, 10); + float num5 = num4 / (float) (num1 + num3 * 2); + int num6 = 0; + for (int index1 = -num3; index1 < num1 + num3; ++index1) + { + float num7 = MathHelper.Clamp((float) ((double) Math.Abs((float) (index1 + num3) / (float) (num1 + num3 * 2)) * 2.0 - 1.0), -1f, 1f); + if (index1 % 3 == 0) + num6 = Utils.Clamp(num6 + GenBase._random.Next(-1, 2), -10, 10); + float num8 = (float) Math.Sqrt(1.0 - (double) num7 * (double) num7 * (double) num7 * (double) num7); + int val2_1 = val1 - (int) ((double) num8 * (double) ((float) val1 - num5)) + num6; + int val2_2 = val1 - (int) ((double) ((float) val1 - num5) * ((double) num8 - 0.150000005960464 / Math.Sqrt(Math.Max(0.01, (double) Math.Abs(8f * num7) - 0.1)) + 0.25)); + int num9 = Math.Min(val1, val2_2); + if ((double) Math.Abs(num7) < 0.800000011920929) + { + float num10 = Utils.SmoothStep(0.5f, 0.8f, Math.Abs(num7)); + float num11 = num10 * num10 * num10; + int num12 = Math.Min(10 + (int) ((double) num5 - (double) num11 * 20.0) + num6, val2_1); + int num13 = 50; + for (int index2 = num13; (double) index2 < (double) num5; ++index2) + { + int index3 = index1 + start.X; + if (GenBase._tiles[index3, index2].active() && (GenBase._tiles[index3, index2].type == (ushort) 189 || GenBase._tiles[index3, index2].type == (ushort) 196)) + num13 = index2 + 5; + } + for (int index4 = num13; index4 < num12; ++index4) + { + int index5 = index1 + start.X; + int index6 = index4; + GenBase._tiles[index5, index6].active(false); + GenBase._tiles[index5, index6].wall = (byte) 0; + } + numArray[index1 + num3] = (short) num12; + } + for (int index7 = val1 - 1; index7 >= val2_1; --index7) + { + int i = index1 + start.X; + int j = index7; + Tile tile1 = GenBase._tiles[i, j]; + tile1.liquid = (byte) 0; + Tile tile2 = GenBase._tiles[i, j + 1]; + Tile tile3 = GenBase._tiles[i, j + 2]; + tile1.type = !WorldGen.SolidTile(tile2) || !WorldGen.SolidTile(tile3) ? (ushort) 397 : (ushort) 53; + if (index7 > val2_1 + 5) + tile1.wall = (byte) 187; + tile1.active(true); + if (tile1.wall != (byte) 187) + tile1.wall = (byte) 0; + if (index7 < num9) + { + if (index7 > val2_1 + 5) + tile1.wall = (byte) 187; + tile1.active(false); + } + WorldGen.SquareWallFrame(i, j); + } + } + } + + private void PlaceClusters(DesertBiome.ClusterGroup clusters, Point start, Vector2 scale) + { + int num1 = (int) ((double) scale.X * (double) clusters.Width); + int num2 = (int) ((double) scale.Y * (double) clusters.Height); + Vector2 vector2_1 = new Vector2((float) num1, (float) num2); + Vector2 vector2_2 = new Vector2((float) clusters.Width, (float) clusters.Height); + for (int index1 = -20; index1 < num1 + 20; ++index1) + { + for (int index2 = -20; index2 < num2 + 20; ++index2) + { + float num3 = 0.0f; + int num4 = -1; + float num5 = 0.0f; + int x = index1 + start.X; + int y = index2 + start.Y; + Vector2 vector2_3 = new Vector2((float) index1, (float) index2) / vector2_1 * vector2_2; + float num6 = (new Vector2((float) index1, (float) index2) / vector2_1 * 2f - Vector2.One).Length(); + for (int index3 = 0; index3 < clusters.Count; ++index3) + { + DesertBiome.Cluster cluster = clusters[index3]; + if ((double) Math.Abs(cluster[0].Position.X - vector2_3.X) <= 10.0 && (double) Math.Abs(cluster[0].Position.Y - vector2_3.Y) <= 10.0) + { + float num7 = 0.0f; + foreach (DesertBiome.Hub hub in (List) cluster) + num7 += 1f / Vector2.DistanceSquared(hub.Position, vector2_3); + if ((double) num7 > (double) num3) + { + if ((double) num3 > (double) num5) + num5 = num3; + num3 = num7; + num4 = index3; + } + else if ((double) num7 > (double) num5) + num5 = num7; + } + } + float num8 = num3 + num5; + Tile tile = GenBase._tiles[x, y]; + bool flag = (double) num6 >= 0.800000011920929; + if ((double) num8 > 3.5) + { + tile.ClearEverything(); + tile.wall = (byte) 187; + tile.liquid = (byte) 0; + if (num4 % 15 == 2) + { + tile.ResetToType((ushort) 404); + tile.wall = (byte) 187; + tile.active(true); + } + Tile.SmoothSlope(x, y); + } + else if ((double) num8 > 1.79999995231628) + { + tile.wall = (byte) 187; + if (!flag || tile.active()) + { + tile.ResetToType((ushort) 396); + tile.wall = (byte) 187; + tile.active(true); + Tile.SmoothSlope(x, y); + } + tile.liquid = (byte) 0; + } + else if ((double) num8 > 0.699999988079071 || !flag) + { + if (!flag || tile.active()) + { + tile.ResetToType((ushort) 397); + tile.active(true); + Tile.SmoothSlope(x, y); + } + tile.liquid = (byte) 0; + tile.wall = (byte) 216; + } + else if ((double) num8 > 0.25) + { + float num9 = (float) (((double) num8 - 0.25) / 0.449999988079071); + if ((double) GenBase._random.NextFloat() < (double) num9) + { + if (tile.active()) + { + tile.ResetToType((ushort) 397); + tile.active(true); + Tile.SmoothSlope(x, y); + tile.wall = (byte) 216; + } + tile.liquid = (byte) 0; + tile.wall = (byte) 187; + } + } + } + } + } + + private void AddTileVariance(DesertBiome.ClusterGroup clusters, Point start, Vector2 scale) + { + int num1 = (int) ((double) scale.X * (double) clusters.Width); + int num2 = (int) ((double) scale.Y * (double) clusters.Height); + for (int index1 = -20; index1 < num1 + 20; ++index1) + { + for (int index2 = -20; index2 < num2 + 20; ++index2) + { + int index3 = index1 + start.X; + int index4 = index2 + start.Y; + Tile tile1 = GenBase._tiles[index3, index4]; + Tile tile2 = GenBase._tiles[index3, index4 + 1]; + Tile tile3 = GenBase._tiles[index3, index4 + 2]; + if (tile1.type == (ushort) 53 && (!WorldGen.SolidTile(tile2) || !WorldGen.SolidTile(tile3))) + tile1.type = (ushort) 397; + } + } + for (int index5 = -20; index5 < num1 + 20; ++index5) + { + for (int index6 = -20; index6 < num2 + 20; ++index6) + { + int i = index5 + start.X; + int index7 = index6 + start.Y; + Tile tile = GenBase._tiles[i, index7]; + if (tile.active() && tile.type == (ushort) 396) + { + bool flag1 = true; + for (int index8 = -1; index8 >= -3; --index8) + { + if (GenBase._tiles[i, index7 + index8].active()) + { + flag1 = false; + break; + } + } + bool flag2 = true; + for (int index9 = 1; index9 <= 3; ++index9) + { + if (GenBase._tiles[i, index7 + index9].active()) + { + flag2 = false; + break; + } + } + if (flag1 ^ flag2 && GenBase._random.Next(5) == 0) + WorldGen.PlaceTile(i, index7 + (flag1 ? -1 : 1), 165, true, true); + else if (flag1 && GenBase._random.Next(5) == 0) + WorldGen.PlaceTile(i, index7 - 1, 187, true, true, style: (29 + GenBase._random.Next(6))); + } + } + } + } + + private bool FindStart( + Point origin, + Vector2 scale, + int xHubCount, + int yHubCount, + out Point start) + { + start = new Point(0, 0); + int width = (int) ((double) scale.X * (double) xHubCount); + int height = (int) ((double) scale.Y * (double) yHubCount); + origin.X -= width >> 1; + int y = 220; +label_10: + for (int index = -20; index < width + 20; ++index) + { + for (int j = 220; j < Main.maxTilesY; ++j) + { + if (WorldGen.SolidTile(index + origin.X, j)) + { + switch (GenBase._tiles[index + origin.X, j].type) + { + case 59: + case 60: + return false; + default: + if (j > y) + { + y = j; + goto label_10; + } + else + goto label_10; + } + } + } + } + WorldGen.UndergroundDesertLocation = new Microsoft.Xna.Framework.Rectangle(origin.X, y, width, height); + start = new Point(origin.X, y); return true; } - private static void ExportDescriptionToEngine(DesertDescription description) + public override bool Place(Point origin, StructureMap structures) { - WorldGen.UndergroundDesertLocation = description.CombinedArea; - WorldGen.UndergroundDesertLocation.Inflate(10, 10); - WorldGen.UndergroundDesertHiveLocation = description.Hive; + float num1 = (float) Main.maxTilesX / 4200f; + int num2 = (int) (80.0 * (double) num1); + int num3 = (int) (((double) GenBase._random.NextFloat() + 1.0) * 80.0 * (double) num1); + Vector2 scale = new Vector2(4f, 2f); + Point start; + if (!this.FindStart(origin, scale, num2, num3, out start)) + return false; + DesertBiome.ClusterGroup clusters = new DesertBiome.ClusterGroup(); + clusters.Generate(num2, num3); + this.PlaceSand(clusters, start, scale); + this.PlaceClusters(clusters, start, scale); + this.AddTileVariance(clusters, start, scale); + int num4 = (int) ((double) scale.X * (double) clusters.Width); + int num5 = (int) ((double) scale.Y * (double) clusters.Height); + for (int index1 = -20; index1 < num4 + 20; ++index1) + { + for (int index2 = -20; index2 < num5 + 20; ++index2) + { + if (index1 + start.X > 0 && index1 + start.X < Main.maxTilesX - 1 && index2 + start.Y > 0 && index2 + start.Y < Main.maxTilesY - 1) + { + WorldGen.SquareWallFrame(index1 + start.X, index2 + start.Y); + WorldUtils.TileFrame(index1 + start.X, index2 + start.Y, true); + } + } + } + return true; } - private static void CleanupArea(Microsoft.Xna.Framework.Rectangle area) + private struct Hub { - for (int index1 = area.Left - 20; index1 < area.Right + 20; ++index1) + public Vector2 Position; + + public Hub(Vector2 position) => this.Position = position; + + public Hub(float x, float y) => this.Position = new Vector2(x, y); + } + + private class Cluster : List + { + } + + private class ClusterGroup : List + { + public int Width; + public int Height; + + private void SearchForCluster( + bool[,] hubMap, + List pointCluster, + int x, + int y, + int level = 2) { - for (int index2 = area.Top - 20; index2 < area.Bottom + 20; ++index2) + pointCluster.Add(new Point(x, y)); + hubMap[x, y] = false; + --level; + if (level == -1) + return; + if (x > 0 && hubMap[x - 1, y]) + this.SearchForCluster(hubMap, pointCluster, x - 1, y, level); + if (x < hubMap.GetLength(0) - 1 && hubMap[x + 1, y]) + this.SearchForCluster(hubMap, pointCluster, x + 1, y, level); + if (y > 0 && hubMap[x, y - 1]) + this.SearchForCluster(hubMap, pointCluster, x, y - 1, level); + if (y >= hubMap.GetLength(1) - 1 || !hubMap[x, y + 1]) + return; + this.SearchForCluster(hubMap, pointCluster, x, y + 1, level); + } + + private void AttemptClaim( + int x, + int y, + int[,] clusterIndexMap, + List> pointClusters, + int index) + { + int clusterIndex = clusterIndexMap[x, y]; + if (clusterIndex == -1 || clusterIndex == index) + return; + int num = WorldGen.genRand.Next(2) == 0 ? -1 : index; + foreach (Point point in pointClusters[clusterIndex]) + clusterIndexMap[point.X, point.Y] = num; + } + + public void Generate(int width, int height) + { + this.Width = width; + this.Height = height; + this.Clear(); + bool[,] hubMap = new bool[width, height]; + int num1 = (width >> 1) - 1; + int y1 = (height >> 1) - 1; + int num2 = (num1 + 1) * (num1 + 1); + Point point1 = new Point(num1, y1); + for (int index1 = point1.Y - y1; index1 <= point1.Y + y1; ++index1) { - if (index1 > 0 && index1 < Main.maxTilesX - 1 && index2 > 0 && index2 < Main.maxTilesY - 1) + float num3 = (float) num1 / (float) y1 * (float) (index1 - point1.Y); + int num4 = Math.Min(num1, (int) Math.Sqrt((double) num2 - (double) num3 * (double) num3)); + for (int index2 = point1.X - num4; index2 <= point1.X + num4; ++index2) + hubMap[index2, index1] = WorldGen.genRand.Next(2) == 0; + } + List> pointClusters = new List>(); + for (int x = 0; x < hubMap.GetLength(0); ++x) + { + for (int y2 = 0; y2 < hubMap.GetLength(1); ++y2) { - WorldGen.SquareWallFrame(index1, index2); - WorldUtils.TileFrame(index1, index2, true); + if (hubMap[x, y2] && WorldGen.genRand.Next(2) == 0) + { + List pointCluster = new List(); + this.SearchForCluster(hubMap, pointCluster, x, y2); + if (pointCluster.Count > 2) + pointClusters.Add(pointCluster); + } + } + } + int[,] clusterIndexMap = new int[hubMap.GetLength(0), hubMap.GetLength(1)]; + for (int index3 = 0; index3 < clusterIndexMap.GetLength(0); ++index3) + { + for (int index4 = 0; index4 < clusterIndexMap.GetLength(1); ++index4) + clusterIndexMap[index3, index4] = -1; + } + for (int index = 0; index < pointClusters.Count; ++index) + { + foreach (Point point2 in pointClusters[index]) + clusterIndexMap[point2.X, point2.Y] = index; + } + for (int index5 = 0; index5 < pointClusters.Count; ++index5) + { + foreach (Point point3 in pointClusters[index5]) + { + int x = point3.X; + int y3 = point3.Y; + if (clusterIndexMap[x, y3] != -1) + { + int index6 = clusterIndexMap[x, y3]; + if (x > 0) + this.AttemptClaim(x - 1, y3, clusterIndexMap, pointClusters, index6); + if (x < clusterIndexMap.GetLength(0) - 1) + this.AttemptClaim(x + 1, y3, clusterIndexMap, pointClusters, index6); + if (y3 > 0) + this.AttemptClaim(x, y3 - 1, clusterIndexMap, pointClusters, index6); + if (y3 < clusterIndexMap.GetLength(1) - 1) + this.AttemptClaim(x, y3 + 1, clusterIndexMap, pointClusters, index6); + } + else + break; + } + } + foreach (List pointList in pointClusters) + pointList.Clear(); + for (int x = 0; x < clusterIndexMap.GetLength(0); ++x) + { + for (int y4 = 0; y4 < clusterIndexMap.GetLength(1); ++y4) + { + if (clusterIndexMap[x, y4] != -1) + pointClusters[clusterIndexMap[x, y4]].Add(new Point(x, y4)); + } + } + foreach (List pointList in pointClusters) + { + if (pointList.Count < 4) + pointList.Clear(); + } + foreach (List pointList in pointClusters) + { + DesertBiome.Cluster cluster = new DesertBiome.Cluster(); + if (pointList.Count > 0) + { + foreach (Point point4 in pointList) + cluster.Add(new DesertBiome.Hub((float) point4.X + (float) (((double) WorldGen.genRand.NextFloat() - 0.5) * 0.5), (float) point4.Y + (float) (((double) WorldGen.genRand.NextFloat() - 0.5) * 0.5))); + this.Add(cluster); } } } diff --git a/GameContent/Biomes/DunesBiome.cs b/GameContent/Biomes/DunesBiome.cs deleted file mode 100644 index b913542..0000000 --- a/GameContent/Biomes/DunesBiome.cs +++ /dev/null @@ -1,150 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Biomes.DunesBiome -// 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; -using Newtonsoft.Json; -using System; -using Terraria.GameContent.Biomes.Desert; -using Terraria.WorldBuilding; - -namespace Terraria.GameContent.Biomes -{ - public class DunesBiome : MicroBiome - { - [JsonProperty("SingleDunesWidth")] - private WorldGenRange _singleDunesWidth = WorldGenRange.Empty; - [JsonProperty("HeightScale")] - private float _heightScale = 1f; - - public int MaximumWidth => this._singleDunesWidth.ScaledMaximum * 2; - - public override bool Place(Point origin, StructureMap structures) - { - int height1 = (int) ((double) GenBase._random.Next(60, 100) * (double) this._heightScale); - int height2 = (int) ((double) GenBase._random.Next(60, 100) * (double) this._heightScale); - int random1 = this._singleDunesWidth.GetRandom(GenBase._random); - int random2 = this._singleDunesWidth.GetRandom(GenBase._random); - DunesBiome.DunesDescription fromPlacement1 = DunesBiome.DunesDescription.CreateFromPlacement(new Point(origin.X - random1 / 2 + 30, origin.Y), random1, height1); - DunesBiome.DunesDescription fromPlacement2 = DunesBiome.DunesDescription.CreateFromPlacement(new Point(origin.X + random2 / 2 - 30, origin.Y), random2, height2); - this.PlaceSingle(fromPlacement1, structures); - this.PlaceSingle(fromPlacement2, structures); - return true; - } - - private void PlaceSingle(DunesBiome.DunesDescription description, StructureMap structures) - { - int num1 = GenBase._random.Next(3) + 8; - for (int index = 0; index < num1 - 1; ++index) - { - int num2 = (int) (2.0 / (double) num1 * (double) description.Area.Width); - int num3 = (int) ((double) index / (double) num1 * (double) description.Area.Width + (double) description.Area.Left) + num2 * 2 / 5 + GenBase._random.Next(-5, 6); - float num4 = (float) (1.0 - (double) Math.Abs((float) index / (float) (num1 - 2) - 0.5f) * 2.0); - DunesBiome.PlaceHill(num3 - num2 / 2, num3 + num2 / 2, (float) ((double) num4 * 0.300000011920929 + 0.200000002980232) * this._heightScale, description); - } - int num5 = GenBase._random.Next(2) + 1; - for (int index = 0; index < num5; ++index) - { - int num6 = description.Area.Width / 2; - int num7 = description.Area.Center.X + GenBase._random.Next(-10, 11); - DunesBiome.PlaceHill(num7 - num6 / 2, num7 + num6 / 2, 0.8f * this._heightScale, description); - } - structures.AddStructure(description.Area, 20); - } - - private static void PlaceHill( - int startX, - int endX, - float scale, - DunesBiome.DunesDescription description) - { - Point startPoint = new Point(startX, (int) description.Surface[startX]); - Point endPoint = new Point(endX, (int) description.Surface[endX]); - Point point1 = new Point((startPoint.X + endPoint.X) / 2, (startPoint.Y + endPoint.Y) / 2 - (int) (35.0 * (double) scale)); - int num = (endPoint.X - point1.X) / 4; - int minValue = (endPoint.X - point1.X) / 16; - if (description.WindDirection == DunesBiome.WindDirection.Left) - point1.X -= WorldGen.genRand.Next(minValue, num + 1); - else - point1.X += WorldGen.genRand.Next(minValue, num + 1); - Point point2 = new Point(0, (int) ((double) scale * 12.0)); - Point point3 = new Point(point2.X / -2, point2.Y / -2); - DunesBiome.PlaceCurvedLine(startPoint, point1, description.WindDirection != DunesBiome.WindDirection.Left ? point3 : point2, description); - DunesBiome.PlaceCurvedLine(point1, endPoint, description.WindDirection == DunesBiome.WindDirection.Left ? point3 : point2, description); - } - - private static void PlaceCurvedLine( - Point startPoint, - Point endPoint, - Point anchorOffset, - DunesBiome.DunesDescription description) - { - Point p = new Point((startPoint.X + endPoint.X) / 2, (startPoint.Y + endPoint.Y) / 2); - p.X += anchorOffset.X; - p.Y += anchorOffset.Y; - Vector2 vector2_1 = startPoint.ToVector2(); - Vector2 vector2_2 = endPoint.ToVector2(); - Vector2 vector2_3 = p.ToVector2(); - float num1 = (float) (0.5 / ((double) vector2_2.X - (double) vector2_1.X)); - Point point1 = new Point(-1, -1); - for (float amount = 0.0f; (double) amount <= 1.0; amount += num1) - { - Point point2 = Vector2.Lerp(Vector2.Lerp(vector2_1, vector2_3, amount), Vector2.Lerp(vector2_3, vector2_2, amount), amount).ToPoint(); - if (!(point2 == point1)) - { - point1 = point2; - int num2 = description.Area.Width / 2 - Math.Abs(point2.X - description.Area.Center.X); - int num3 = (int) description.Surface[point2.X] + (int) (Math.Sqrt((double) num2) * 3.0); - for (int index = point2.Y - 10; index < point2.Y; ++index) - { - if (GenBase._tiles[point2.X, index].active() && GenBase._tiles[point2.X, index].type != (ushort) 53) - GenBase._tiles[point2.X, index].ClearEverything(); - } - for (int y = point2.Y; y < num3; ++y) - { - GenBase._tiles[point2.X, y].ResetToType((ushort) 53); - Tile.SmoothSlope(point2.X, y); - } - } - } - } - - private class DunesDescription - { - public bool IsValid { get; private set; } - - public SurfaceMap Surface { get; private set; } - - public Microsoft.Xna.Framework.Rectangle Area { get; private set; } - - public DunesBiome.WindDirection WindDirection { get; private set; } - - private DunesDescription() - { - } - - public static DunesBiome.DunesDescription CreateFromPlacement( - Point origin, - int width, - int height) - { - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(origin.X - width / 2, origin.Y - height / 2, width, height); - return new DunesBiome.DunesDescription() - { - Area = rectangle, - IsValid = true, - Surface = SurfaceMap.FromArea(rectangle.Left - 20, rectangle.Width + 40), - WindDirection = WorldGen.genRand.Next(2) == 0 ? DunesBiome.WindDirection.Left : DunesBiome.WindDirection.Right - }; - } - } - - private enum WindDirection - { - Left, - Right, - } - } -} diff --git a/GameContent/Biomes/EnchantedSwordBiome.cs b/GameContent/Biomes/EnchantedSwordBiome.cs index d80f6be..a60b082 100644 --- a/GameContent/Biomes/EnchantedSwordBiome.cs +++ b/GameContent/Biomes/EnchantedSwordBiome.cs @@ -1,25 +1,18 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Biomes.EnchantedSwordBiome -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; -using Newtonsoft.Json; using System.Collections.Generic; using Terraria.GameContent.Generation; -using Terraria.ID; -using Terraria.WorldBuilding; +using Terraria.World.Generation; namespace Terraria.GameContent.Biomes { public class EnchantedSwordBiome : MicroBiome { - [JsonProperty("ChanceOfEntrance")] - private float _chanceOfEntrance; - [JsonProperty("ChanceOfRealSword")] - private float _chanceOfRealSword; - public override bool Place(Point origin, StructureMap structures) { Dictionary resultsOutput = new Dictionary(); @@ -42,37 +35,25 @@ namespace Terraria.GameContent.Biomes ShapeData shapeData = new ShapeData(); Point point1 = new Point(origin.X, origin.Y + 20); Point point2 = new Point(origin.X, origin.Y + 30); - bool[] validTiles = new bool[TileID.Sets.GeneralPlacementTiles.Length]; - for (int index = 0; index < validTiles.Length; ++index) - validTiles[index] = TileID.Sets.GeneralPlacementTiles[index]; - validTiles[21] = false; - validTiles[467] = false; float xScale = (float) (0.800000011920929 + (double) GenBase._random.NextFloat() * 0.5); - if (!structures.CanPlace(new Microsoft.Xna.Framework.Rectangle(point1.X - (int) (20.0 * (double) xScale), point1.Y - 20, (int) (40.0 * (double) xScale), 40), validTiles) || !structures.CanPlace(new Microsoft.Xna.Framework.Rectangle(origin.X, result.Y + 10, 1, origin.Y - result.Y - 9), validTiles, 2)) + if (!structures.CanPlace(new Microsoft.Xna.Framework.Rectangle(point1.X - (int) (20.0 * (double) xScale), point1.Y - 20, (int) (40.0 * (double) xScale), 40)) || !structures.CanPlace(new Microsoft.Xna.Framework.Rectangle(origin.X, result.Y + 10, 1, origin.Y - result.Y - 9), 2)) return false; WorldUtils.Gen(point1, (GenShape) new Shapes.Slime(20, xScale, 1f), Actions.Chain((GenAction) new Modifiers.Blotches(chance: 0.4), new Actions.ClearTile(true).Output(data1))); WorldUtils.Gen(point2, (GenShape) new Shapes.Mound(14, 14), Actions.Chain((GenAction) new Modifiers.Blotches(2, 1, 0.8), (GenAction) new Actions.SetTile((ushort) 0), new Actions.SetFrames(true).Output(shapeData))); data1.Subtract(shapeData, point1, point2); WorldUtils.Gen(point1, (GenShape) new ModShapes.InnerOutline(data1), Actions.Chain((GenAction) new Actions.SetTile((ushort) 2), (GenAction) new Actions.SetFrames(true))); WorldUtils.Gen(point1, (GenShape) new ModShapes.All(data1), Actions.Chain((GenAction) new Modifiers.RectangleMask(-40, 40, 0, 40), (GenAction) new Modifiers.IsEmpty(), (GenAction) new Actions.SetLiquid())); - WorldUtils.Gen(point1, (GenShape) new ModShapes.All(data1), Actions.Chain((GenAction) new Actions.PlaceWall((ushort) 68), (GenAction) new Modifiers.OnlyTiles(new ushort[1] + WorldUtils.Gen(point1, (GenShape) new ModShapes.All(data1), Actions.Chain((GenAction) new Actions.PlaceWall((byte) 68), (GenAction) new Modifiers.OnlyTiles(new ushort[1] { (ushort) 2 - }), (GenAction) new Modifiers.Offset(0, 1), (GenAction) new ActionVines(3, 5, 382))); - if ((double) GenBase._random.NextFloat() <= (double) this._chanceOfEntrance) + }), (GenAction) new Modifiers.Offset(0, 1), (GenAction) new ActionVines(3, 5))); + ShapeData data2 = new ShapeData(); + WorldUtils.Gen(new Point(origin.X, result.Y + 10), (GenShape) new Shapes.Rectangle(1, origin.Y - result.Y - 9), Actions.Chain((GenAction) new Modifiers.Blotches(chance: 0.2), new Actions.ClearTile().Output(data2), (GenAction) new Modifiers.Expand(1), (GenAction) new Modifiers.OnlyTiles(new ushort[1] { - ShapeData data2 = new ShapeData(); - WorldUtils.Gen(new Point(origin.X, result.Y + 10), (GenShape) new Shapes.Rectangle(1, origin.Y - result.Y - 9), Actions.Chain((GenAction) new Modifiers.Blotches(chance: 0.2), (GenAction) new Modifiers.SkipTiles(new ushort[2] - { - (ushort) 191, - (ushort) 192 - }), new Actions.ClearTile().Output(data2), (GenAction) new Modifiers.Expand(1), (GenAction) new Modifiers.OnlyTiles(new ushort[1] - { - (ushort) 53 - }), new Actions.SetTile((ushort) 397).Output(data2))); - WorldUtils.Gen(new Point(origin.X, result.Y + 10), (GenShape) new ModShapes.All(data2), (GenAction) new Actions.SetFrames(true)); - } - if ((double) GenBase._random.NextFloat() <= (double) this._chanceOfRealSword) + (ushort) 53 + }), new Actions.SetTile((ushort) 397).Output(data2))); + WorldUtils.Gen(new Point(origin.X, result.Y + 10), (GenShape) new ModShapes.All(data2), (GenAction) new Actions.SetFrames(true)); + if (GenBase._random.Next(3) == 0) WorldGen.PlaceTile(point2.X, point2.Y - 15, 187, true, style: 17); else WorldGen.PlaceTile(point2.X, point2.Y - 15, 186, true, style: 15); @@ -80,7 +61,7 @@ namespace Terraria.GameContent.Biomes { (ushort) 2 }), (GenAction) new Modifiers.Offset(0, -1), (GenAction) new ActionGrass())); - structures.AddProtectedStructure(new Microsoft.Xna.Framework.Rectangle(point1.X - (int) (20.0 * (double) xScale), point1.Y - 20, (int) (40.0 * (double) xScale), 40), 10); + structures.AddStructure(new Microsoft.Xna.Framework.Rectangle(point1.X - (int) (20.0 * (double) xScale), point1.Y - 20, (int) (40.0 * (double) xScale), 40), 4); return true; } } diff --git a/GameContent/Biomes/GraniteBiome.cs b/GameContent/Biomes/GraniteBiome.cs index 922dcd7..d7aefba 100644 --- a/GameContent/Biomes/GraniteBiome.cs +++ b/GameContent/Biomes/GraniteBiome.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Biomes.GraniteBiome -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -9,223 +9,164 @@ using System; using System.Collections.Generic; using Terraria.DataStructures; using Terraria.ID; -using Terraria.Utilities; -using Terraria.WorldBuilding; +using Terraria.World.Generation; namespace Terraria.GameContent.Biomes { public class GraniteBiome : MicroBiome { private const int MAX_MAGMA_ITERATIONS = 300; - private GraniteBiome.Magma[,] _sourceMagmaMap = new GraniteBiome.Magma[200, 200]; - private GraniteBiome.Magma[,] _targetMagmaMap = new GraniteBiome.Magma[200, 200]; - private static Vector2[] _normalisedVectors = new Vector2[9] - { - Vector2.Normalize(new Vector2(-1f, -1f)), - Vector2.Normalize(new Vector2(-1f, 0.0f)), - Vector2.Normalize(new Vector2(-1f, 1f)), - Vector2.Normalize(new Vector2(0.0f, -1f)), - new Vector2(0.0f, 0.0f), - Vector2.Normalize(new Vector2(0.0f, 1f)), - Vector2.Normalize(new Vector2(1f, -1f)), - Vector2.Normalize(new Vector2(1f, 0.0f)), - Vector2.Normalize(new Vector2(1f, 1f)) - }; - - public static bool CanPlace(Point origin, StructureMap structures) => !WorldGen.BiomeTileCheck(origin.X, origin.Y) && !GenBase._tiles[origin.X, origin.Y].active(); + private static GraniteBiome.Magma[,] _sourceMagmaMap = new GraniteBiome.Magma[200, 200]; + private static GraniteBiome.Magma[,] _targetMagmaMap = new GraniteBiome.Magma[200, 200]; public override bool Place(Point origin, StructureMap structures) { if (GenBase._tiles[origin.X, origin.Y].active()) return false; - origin.X -= this._sourceMagmaMap.GetLength(0) / 2; - origin.Y -= this._sourceMagmaMap.GetLength(1) / 2; - this.BuildMagmaMap(origin); - Microsoft.Xna.Framework.Rectangle effectedMapArea; - this.SimulatePressure(out effectedMapArea); - this.PlaceGranite(origin, effectedMapArea); - this.CleanupTiles(origin, effectedMapArea); - this.PlaceDecorations(origin, effectedMapArea); - structures.AddStructure(effectedMapArea, 8); - return true; - } - - private void BuildMagmaMap(Point tileOrigin) - { - this._sourceMagmaMap = new GraniteBiome.Magma[200, 200]; - this._targetMagmaMap = new GraniteBiome.Magma[200, 200]; - for (int index1 = 0; index1 < this._sourceMagmaMap.GetLength(0); ++index1) - { - for (int index2 = 0; index2 < this._sourceMagmaMap.GetLength(1); ++index2) - { - int i = index1 + tileOrigin.X; - int j = index2 + tileOrigin.Y; - this._sourceMagmaMap[index1, index2] = GraniteBiome.Magma.CreateEmpty(WorldGen.SolidTile(i, j) ? 4f : 1f); - this._targetMagmaMap[index1, index2] = this._sourceMagmaMap[index1, index2]; - } - } - } - - private void SimulatePressure(out Microsoft.Xna.Framework.Rectangle effectedMapArea) - { - int length1 = this._sourceMagmaMap.GetLength(0); - int length2 = this._sourceMagmaMap.GetLength(1); + int length1 = GraniteBiome._sourceMagmaMap.GetLength(0); + int length2 = GraniteBiome._sourceMagmaMap.GetLength(1); int index1 = length1 / 2; int index2 = length2 / 2; - int num1 = index1; - int min1 = num1; - int num2 = index2; - int min2 = num2; - for (int index3 = 0; index3 < 300; ++index3) + origin.X -= index1; + origin.Y -= index2; + for (int index3 = 0; index3 < length1; ++index3) { - for (int index4 = num1; index4 <= min1; ++index4) + for (int index4 = 0; index4 < length2; ++index4) { - for (int index5 = num2; index5 <= min2; ++index5) + int i = index3 + origin.X; + int j = index4 + origin.Y; + GraniteBiome._sourceMagmaMap[index3, index4] = GraniteBiome.Magma.CreateEmpty(WorldGen.SolidTile(i, j) ? 4f : 1f); + GraniteBiome._targetMagmaMap[index3, index4] = GraniteBiome._sourceMagmaMap[index3, index4]; + } + } + int max1 = index1; + int min1 = index1; + int max2 = index2; + int min2 = index2; + for (int index5 = 0; index5 < 300; ++index5) + { + for (int index6 = max1; index6 <= min1; ++index6) + { + for (int index7 = max2; index7 <= min2; ++index7) { - GraniteBiome.Magma sourceMagma1 = this._sourceMagmaMap[index4, index5]; + GraniteBiome.Magma sourceMagma1 = GraniteBiome._sourceMagmaMap[index6, index7]; if (sourceMagma1.IsActive) { - float num3 = 0.0f; + float num1 = 0.0f; Vector2 zero = Vector2.Zero; - for (int index6 = -1; index6 <= 1; ++index6) + for (int index8 = -1; index8 <= 1; ++index8) { - for (int index7 = -1; index7 <= 1; ++index7) + for (int index9 = -1; index9 <= 1; ++index9) { - if (index6 != 0 || index7 != 0) + if (index8 != 0 || index9 != 0) { - Vector2 normalisedVector = GraniteBiome._normalisedVectors[(index6 + 1) * 3 + (index7 + 1)]; - GraniteBiome.Magma sourceMagma2 = this._sourceMagmaMap[index4 + index6, index5 + index7]; + Vector2 vector2 = new Vector2((float) index8, (float) index9); + vector2.Normalize(); + GraniteBiome.Magma sourceMagma2 = GraniteBiome._sourceMagmaMap[index6 + index8, index7 + index9]; if ((double) sourceMagma1.Pressure > 0.00999999977648258 && !sourceMagma2.IsActive) { - if (index6 == -1) - num1 = Utils.Clamp(index4 + index6, 1, num1); + if (index8 == -1) + max1 = Utils.Clamp(index6 + index8, 1, max1); else - min1 = Utils.Clamp(index4 + index6, min1, length1 - 2); - if (index7 == -1) - num2 = Utils.Clamp(index5 + index7, 1, num2); + min1 = Utils.Clamp(index6 + index8, min1, length1 - 2); + if (index9 == -1) + max2 = Utils.Clamp(index7 + index9, 1, max2); else - min2 = Utils.Clamp(index5 + index7, min2, length2 - 2); - this._targetMagmaMap[index4 + index6, index5 + index7] = sourceMagma2.ToFlow(); + min2 = Utils.Clamp(index7 + index9, min2, length2 - 2); + GraniteBiome._targetMagmaMap[index6 + index8, index7 + index9] = sourceMagma2.ToFlow(); } float pressure = sourceMagma2.Pressure; - num3 += pressure; - zero += pressure * normalisedVector; + num1 += pressure; + zero += pressure * vector2; } } } - float num4 = num3 / 8f; - if ((double) num4 > (double) sourceMagma1.Resistance) + float num2 = num1 / 8f; + if ((double) num2 > (double) sourceMagma1.Resistance) { - float num5 = zero.Length() / 8f; - float pressure = Math.Max(0.0f, (float) ((double) Math.Max(num4 - num5 - sourceMagma1.Pressure, 0.0f) + (double) num5 + (double) sourceMagma1.Pressure * 0.875) - sourceMagma1.Resistance); - this._targetMagmaMap[index4, index5] = GraniteBiome.Magma.CreateFlow(pressure, Math.Max(0.0f, sourceMagma1.Resistance - pressure * 0.02f)); + float num3 = zero.Length() / 8f; + float pressure = Math.Max(0.0f, (float) ((double) Math.Max(num2 - num3 - sourceMagma1.Pressure, 0.0f) + (double) num3 + (double) sourceMagma1.Pressure * 0.875) - sourceMagma1.Resistance); + GraniteBiome._targetMagmaMap[index6, index7] = GraniteBiome.Magma.CreateFlow(pressure, Math.Max(0.0f, sourceMagma1.Resistance - pressure * 0.02f)); } } } } - if (index3 < 2) - this._targetMagmaMap[index1, index2] = GraniteBiome.Magma.CreateFlow(25f); - Utils.Swap(ref this._sourceMagmaMap, ref this._targetMagmaMap); + if (index5 < 2) + GraniteBiome._targetMagmaMap[index1, index2] = GraniteBiome.Magma.CreateFlow(25f); + Utils.Swap(ref GraniteBiome._sourceMagmaMap, ref GraniteBiome._targetMagmaMap); } - effectedMapArea = new Microsoft.Xna.Framework.Rectangle(num1, num2, min1 - num1 + 1, min2 - num2 + 1); - } - - private bool ShouldUseLava(Point tileOrigin) - { - int length1 = this._sourceMagmaMap.GetLength(0); - int length2 = this._sourceMagmaMap.GetLength(1); - int num1 = length1 / 2; - int num2 = length2 / 2; - if (tileOrigin.Y + num2 <= WorldGen.lavaLine - 30) - return false; - for (int index1 = -50; index1 < 50; ++index1) + bool flag1 = origin.Y + index2 > WorldGen.lavaLine - 30; + bool flag2 = false; + for (int index10 = -50; index10 < 50 && !flag2; ++index10) { - for (int index2 = -50; index2 < 50; ++index2) + for (int index11 = -50; index11 < 50 && !flag2; ++index11) { - if (GenBase._tiles[tileOrigin.X + num1 + index1, tileOrigin.Y + num2 + index2].active()) + if (GenBase._tiles[origin.X + index1 + index10, origin.Y + index2 + index11].active()) { - switch (GenBase._tiles[tileOrigin.X + num1 + index1, tileOrigin.Y + num2 + index2].type) + switch (GenBase._tiles[origin.X + index1 + index10, origin.Y + index2 + index11].type) { case 147: case 161: case 162: case 163: case 200: - return false; + flag1 = false; + flag2 = true; + continue; default: continue; } } } } - return true; - } - - private void PlaceGranite(Point tileOrigin, Microsoft.Xna.Framework.Rectangle magmaMapArea) - { - bool flag = this.ShouldUseLava(tileOrigin); - ushort type = 368; - ushort num = 180; - if (WorldGen.drunkWorldGen) + for (int index12 = max1; index12 <= min1; ++index12) { - type = (ushort) 367; - num = (ushort) 178; - } - for (int left = magmaMapArea.Left; left < magmaMapArea.Right; ++left) - { - for (int top = magmaMapArea.Top; top < magmaMapArea.Bottom; ++top) + for (int index13 = max2; index13 <= min2; ++index13) { - GraniteBiome.Magma sourceMagma = this._sourceMagmaMap[left, top]; + GraniteBiome.Magma sourceMagma = GraniteBiome._sourceMagmaMap[index12, index13]; if (sourceMagma.IsActive) { - Tile tile = GenBase._tiles[tileOrigin.X + left, tileOrigin.Y + top]; - if ((double) Math.Max(1f - Math.Max(0.0f, (float) (Math.Sin((double) (tileOrigin.Y + top) * 0.400000005960464) * 0.699999988079071 + 1.20000004768372) * (float) (0.200000002980232 + 0.5 / Math.Sqrt((double) Math.Max(0.0f, sourceMagma.Pressure - sourceMagma.Resistance)))), sourceMagma.Pressure / 15f) > 0.349999994039536 + (WorldGen.SolidTile(tileOrigin.X + left, tileOrigin.Y + top) ? 0.0 : 0.5)) + Tile tile = GenBase._tiles[origin.X + index12, origin.Y + index13]; + if ((double) Math.Max(1f - Math.Max(0.0f, (float) (Math.Sin((double) (origin.Y + index13) * 0.400000005960464) * 0.699999988079071 + 1.20000004768372) * (float) (0.200000002980232 + 0.5 / Math.Sqrt((double) Math.Max(0.0f, sourceMagma.Pressure - sourceMagma.Resistance)))), sourceMagma.Pressure / 15f) > 0.349999994039536 + (WorldGen.SolidTile(origin.X + index12, origin.Y + index13) ? 0.0 : 0.5)) { if (TileID.Sets.Ore[(int) tile.type]) tile.ResetToType(tile.type); else - tile.ResetToType(type); - tile.wall = num; + tile.ResetToType((ushort) 368); + tile.wall = (byte) 180; } else if ((double) sourceMagma.Resistance < 0.00999999977648258) { - WorldUtils.ClearTile(tileOrigin.X + left, tileOrigin.Y + top); - tile.wall = num; + WorldUtils.ClearTile(origin.X + index12, origin.Y + index13); + tile.wall = (byte) 180; } - if (tile.liquid > (byte) 0 & flag) + if (tile.liquid > (byte) 0 & flag1) tile.liquidType(1); } } } - } - - private void CleanupTiles(Point tileOrigin, Microsoft.Xna.Framework.Rectangle magmaMapArea) - { - ushort num1 = 180; - if (WorldGen.drunkWorldGen) - num1 = (ushort) 178; List point16List = new List(); - for (int left = magmaMapArea.Left; left < magmaMapArea.Right; ++left) + for (int index14 = max1; index14 <= min1; ++index14) { - for (int top = magmaMapArea.Top; top < magmaMapArea.Bottom; ++top) + for (int index15 = max2; index15 <= min2; ++index15) { - if (this._sourceMagmaMap[left, top].IsActive) + if (GraniteBiome._sourceMagmaMap[index14, index15].IsActive) { - int num2 = 0; - int num3 = left + tileOrigin.X; - int num4 = top + tileOrigin.Y; - if (WorldGen.SolidTile(num3, num4)) + int num4 = 0; + int num5 = index14 + origin.X; + int num6 = index15 + origin.Y; + if (WorldGen.SolidTile(num5, num6)) { - for (int index1 = -1; index1 <= 1; ++index1) + for (int index16 = -1; index16 <= 1; ++index16) { - for (int index2 = -1; index2 <= 1; ++index2) + for (int index17 = -1; index17 <= 1; ++index17) { - if (WorldGen.SolidTile(num3 + index1, num4 + index2)) - ++num2; + if (WorldGen.SolidTile(num5 + index16, num6 + index17)) + ++num4; } } - if (num2 < 3) - point16List.Add(new Point16(num3, num4)); + if (num4 < 3) + point16List.Add(new Point16(num5, num6)); } } } @@ -235,38 +176,33 @@ namespace Terraria.GameContent.Biomes int x = (int) point16.X; int y = (int) point16.Y; WorldUtils.ClearTile(x, y, true); - GenBase._tiles[x, y].wall = num1; + GenBase._tiles[x, y].wall = (byte) 180; } point16List.Clear(); - } - - private void PlaceDecorations(Point tileOrigin, Microsoft.Xna.Framework.Rectangle magmaMapArea) - { - FastRandom fastRandom1 = new FastRandom(Main.ActiveWorldFileData.Seed).WithModifier(65440UL); - for (int left = magmaMapArea.Left; left < magmaMapArea.Right; ++left) + for (int index18 = max1; index18 <= min1; ++index18) { - for (int top = magmaMapArea.Top; top < magmaMapArea.Bottom; ++top) + for (int index19 = max2; index19 <= min2; ++index19) { - GraniteBiome.Magma sourceMagma = this._sourceMagmaMap[left, top]; - int index1 = left + tileOrigin.X; - int index2 = top + tileOrigin.Y; + GraniteBiome.Magma sourceMagma = GraniteBiome._sourceMagmaMap[index18, index19]; + int index20 = index18 + origin.X; + int index21 = index19 + origin.Y; if (sourceMagma.IsActive) { - WorldUtils.TileFrame(index1, index2); - WorldGen.SquareWallFrame(index1, index2); - FastRandom fastRandom2 = fastRandom1.WithModifier(index1, index2); - if (fastRandom2.Next(8) == 0 && GenBase._tiles[index1, index2].active()) + WorldUtils.TileFrame(index20, index21); + WorldGen.SquareWallFrame(index20, index21); + if (GenBase._random.Next(8) == 0 && GenBase._tiles[index20, index21].active()) { - if (!GenBase._tiles[index1, index2 + 1].active()) - WorldGen.PlaceUncheckedStalactite(index1, index2 + 1, fastRandom2.Next(2) == 0, fastRandom2.Next(3), false); - if (!GenBase._tiles[index1, index2 - 1].active()) - WorldGen.PlaceUncheckedStalactite(index1, index2 - 1, fastRandom2.Next(2) == 0, fastRandom2.Next(3), false); + if (!GenBase._tiles[index20, index21 + 1].active()) + WorldGen.PlaceTight(index20, index21 + 1); + if (!GenBase._tiles[index20, index21 - 1].active()) + WorldGen.PlaceTight(index20, index21 - 1); } - if (fastRandom2.Next(2) == 0) - Tile.SmoothSlope(index1, index2); + if (GenBase._random.Next(2) == 0) + Tile.SmoothSlope(index20, index21); } } } + return true; } private struct Magma diff --git a/GameContent/Biomes/HiveBiome.cs b/GameContent/Biomes/HiveBiome.cs index 6a0ad8c..3b2f2a6 100644 --- a/GameContent/Biomes/HiveBiome.cs +++ b/GameContent/Biomes/HiveBiome.cs @@ -1,13 +1,12 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Biomes.HiveBiome -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using System; -using Terraria.Utilities; -using Terraria.WorldBuilding; +using Terraria.World.Generation; namespace Terraria.GameContent.Biomes { @@ -15,52 +14,64 @@ namespace Terraria.GameContent.Biomes { public override bool Place(Point origin, StructureMap structures) { - if (!structures.CanPlace(new Microsoft.Xna.Framework.Rectangle(origin.X - 50, origin.Y - 50, 100, 100)) || HiveBiome.TooCloseToImportantLocations(origin)) - return false; Ref count1 = new Ref(0); Ref count2 = new Ref(0); Ref count3 = new Ref(0); - WorldUtils.Gen(origin, (GenShape) new Shapes.Circle(15), Actions.Chain((GenAction) new Modifiers.IsSolid(), (GenAction) new Actions.Scanner(count1), (GenAction) new Modifiers.OnlyTiles(new ushort[2] + Ref count4 = new Ref(0); + WorldUtils.Gen(origin, (GenShape) new Shapes.Circle(15), Actions.Chain((GenAction) new Actions.Scanner(count3), (GenAction) new Modifiers.IsSolid(), (GenAction) new Actions.Scanner(count1), (GenAction) new Modifiers.OnlyTiles(new ushort[2] { (ushort) 60, (ushort) 59 }), (GenAction) new Actions.Scanner(count2), (GenAction) new Modifiers.OnlyTiles(new ushort[1] { (ushort) 60 - }), (GenAction) new Actions.Scanner(count3))); - if ((double) count2.Value / (double) count1.Value < 0.75 || count3.Value < 2) + }), (GenAction) new Actions.Scanner(count4))); + if ((double) count2.Value / (double) count1.Value < 0.75 || count4.Value < 2 || !structures.CanPlace(new Microsoft.Xna.Framework.Rectangle(origin.X - 50, origin.Y - 50, 100, 100))) return false; - int index1 = 0; - int[] numArray1 = new int[1000]; - int[] numArray2 = new int[1000]; - Vector2 position1 = origin.ToVector2(); - int num1 = WorldGen.genRand.Next(2, 5); - if (WorldGen.drunkWorldGen) - num1 += WorldGen.genRand.Next(7, 10); - for (int index2 = 0; index2 < num1; ++index2) + int x1 = origin.X; + int y1 = origin.Y; + int num1 = 150; + for (int index1 = x1 - num1; index1 < x1 + num1; index1 += 10) { - Vector2 vector2 = position1; - int num2 = WorldGen.genRand.Next(2, 5); - for (int index3 = 0; index3 < num2; ++index3) - vector2 = HiveBiome.CreateHiveTunnel((int) position1.X, (int) position1.Y, WorldGen.genRand); - position1 = vector2; - numArray1[index1] = (int) position1.X; - numArray2[index1] = (int) position1.Y; - ++index1; - } - HiveBiome.FrameOutAllHiveContents(origin, 50); - for (int index4 = 0; index4 < index1; ++index4) - { - int x1 = numArray1[index4]; - int y = numArray2[index4]; - int dir = 1; - if (WorldGen.genRand.Next(2) == 0) - dir = -1; - bool flag = false; - while (WorldGen.InWorld(x1, y, 10) && HiveBiome.BadSpotForHoneyFall(x1, y)) + if (index1 > 0 && index1 <= Main.maxTilesX - 1) { - x1 += dir; - if (Math.Abs(x1 - numArray1[index4]) > 50) + for (int index2 = y1 - num1; index2 < y1 + num1; index2 += 10) + { + if (index2 > 0 && index2 <= Main.maxTilesY - 1 && (Main.tile[index1, index2].active() && Main.tile[index1, index2].type == (ushort) 226 || Main.tile[index1, index2].wall == (byte) 87 || Main.tile[index1, index2].wall == (byte) 3 || Main.tile[index1, index2].wall == (byte) 83)) + return false; + } + } + } + int x2 = origin.X; + int y2 = origin.Y; + int index3 = 0; + int[] numArray1 = new int[10]; + int[] numArray2 = new int[10]; + Vector2 vector2_1 = new Vector2((float) x2, (float) y2); + Vector2 vector2_2 = vector2_1; + int num2 = WorldGen.genRand.Next(2, 5); + for (int index4 = 0; index4 < num2; ++index4) + { + int num3 = WorldGen.genRand.Next(2, 5); + for (int index5 = 0; index5 < num3; ++index5) + vector2_2 = WorldGen.Hive((int) vector2_1.X, (int) vector2_1.Y); + vector2_1 = vector2_2; + numArray1[index3] = (int) vector2_1.X; + numArray2[index3] = (int) vector2_1.Y; + ++index3; + } + for (int index6 = 0; index6 < index3; ++index6) + { + int index7 = numArray1[index6]; + int index8 = numArray2[index6]; + bool flag = false; + int num4 = 1; + if (WorldGen.genRand.Next(2) == 0) + num4 = -1; + while (index7 > 10 && index7 < Main.maxTilesX - 10 && index8 > 10 && index8 < Main.maxTilesY - 10 && (!Main.tile[index7, index8].active() || !Main.tile[index7, index8 + 1].active() || !Main.tile[index7 + 1, index8].active() || !Main.tile[index7 + 1, index8 + 1].active())) + { + index7 += num4; + if (Math.Abs(index7 - numArray1[index6]) > 50) { flag = true; break; @@ -68,257 +79,83 @@ namespace Terraria.GameContent.Biomes } if (!flag) { - int x2 = x1 + dir; - if (!HiveBiome.SpotActuallyNotInHive(x2, y)) + int i = index7 + num4; + for (int index9 = i - 1; index9 <= i + 2; ++index9) { - HiveBiome.CreateBlockedHoneyCube(x2, y); - HiveBiome.CreateDentForHoneyFall(x2, y, dir); - } - } - } - HiveBiome.CreateStandForLarva(position1); - if (WorldGen.drunkWorldGen) - { - for (int index5 = 0; index5 < 1000; ++index5) - { - Vector2 position2 = position1; - position2.X += (float) WorldGen.genRand.Next(-50, 51); - position2.Y += (float) WorldGen.genRand.Next(-50, 51); - if (WorldGen.InWorld((int) position2.X, (int) position2.Y) && (double) Vector2.Distance(position1, position2) > 10.0 && !Main.tile[(int) position2.X, (int) position2.Y].active() && Main.tile[(int) position2.X, (int) position2.Y].wall == (ushort) 86) - { - HiveBiome.CreateStandForLarva(position2); - break; - } - } - } - structures.AddProtectedStructure(new Microsoft.Xna.Framework.Rectangle(origin.X - 50, origin.Y - 50, 100, 100), 5); - return true; - } - - private static void FrameOutAllHiveContents(Point origin, int squareHalfWidth) - { - int num1 = Math.Max(10, origin.X - squareHalfWidth); - int num2 = Math.Min(Main.maxTilesX - 10, origin.X + squareHalfWidth); - int num3 = Math.Max(10, origin.Y - squareHalfWidth); - int num4 = Math.Min(Main.maxTilesY - 10, origin.Y + squareHalfWidth); - for (int i = num1; i < num2; ++i) - { - for (int j = num3; j < num4; ++j) - { - Tile tile = Main.tile[i, j]; - if (tile.active() && tile.type == (ushort) 225) - WorldGen.SquareTileFrame(i, j); - if (tile.wall == (ushort) 86) - WorldGen.SquareWallFrame(i, j); - } - } - } - - private static Vector2 CreateHiveTunnel(int i, int j, UnifiedRandom random) - { - double num1 = (double) random.Next(12, 21); - float num2 = (float) random.Next(10, 21); - if (WorldGen.drunkWorldGen) - { - double num3 = (double) random.Next(8, 26); - float num4 = (float) random.Next(10, 41); - float num5 = (float) (((double) (Main.maxTilesX / 4200) + 1.0) / 2.0); - num1 = num3 * (double) num5; - num2 = num4 * num5; - } - double num6 = num1; - Vector2 vector2_1; - vector2_1.X = (float) i; - vector2_1.Y = (float) j; - Vector2 vector2_2; - vector2_2.X = (float) random.Next(-10, 11) * 0.2f; - vector2_2.Y = (float) random.Next(-10, 11) * 0.2f; - while (num1 > 0.0 && (double) num2 > 0.0) - { - if ((double) vector2_1.Y > (double) (Main.maxTilesY - 250)) - num2 = 0.0f; - num1 = num6 * (1.0 + (double) random.Next(-20, 20) * 0.00999999977648258); - float num7 = num2 - 1f; - int num8 = (int) ((double) vector2_1.X - num1); - int num9 = (int) ((double) vector2_1.X + num1); - int num10 = (int) ((double) vector2_1.Y - num1); - int num11 = (int) ((double) vector2_1.Y + num1); - if (num8 < 1) - num8 = 1; - if (num9 > Main.maxTilesX - 1) - num9 = Main.maxTilesX - 1; - if (num10 < 1) - num10 = 1; - if (num11 > Main.maxTilesY - 1) - num11 = Main.maxTilesY - 1; - for (int x = num8; x < num9; ++x) - { - for (int y = num10; y < num11; ++y) - { - if (!WorldGen.InWorld(x, y, 50)) + for (int index10 = index8 - 1; index10 <= index8 + 2; ++index10) { - num7 = 0.0f; - } - else - { - if (Main.tile[x - 10, y].wall == (ushort) 87) - num7 = 0.0f; - if (Main.tile[x + 10, y].wall == (ushort) 87) - num7 = 0.0f; - if (Main.tile[x, y - 10].wall == (ushort) 87) - num7 = 0.0f; - if (Main.tile[x, y + 10].wall == (ushort) 87) - num7 = 0.0f; - } - if ((double) y < Main.worldSurface && Main.tile[x, y - 5].wall == (ushort) 0) - num7 = 0.0f; - double num12 = (double) Math.Abs((float) x - vector2_1.X); - float num13 = Math.Abs((float) y - vector2_1.Y); - double num14 = Math.Sqrt(num12 * num12 + (double) num13 * (double) num13); - if (num14 < num6 * 0.4 * (1.0 + (double) random.Next(-10, 11) * 0.005)) - { - if (random.Next(3) == 0) - Main.tile[x, y].liquid = byte.MaxValue; - if (WorldGen.drunkWorldGen) - Main.tile[x, y].liquid = byte.MaxValue; - Main.tile[x, y].honey(true); - Main.tile[x, y].wall = (ushort) 86; - Main.tile[x, y].active(false); - Main.tile[x, y].halfBrick(false); - Main.tile[x, y].slope((byte) 0); - } - else if (num14 < num6 * 0.75 * (1.0 + (double) random.Next(-10, 11) * 0.005)) - { - Main.tile[x, y].liquid = (byte) 0; - if (Main.tile[x, y].wall != (ushort) 86) + if (index9 < 10 || index9 > Main.maxTilesX - 10) + flag = true; + else if (Main.tile[index9, index10].active() && Main.tile[index9, index10].type != (ushort) 225) { - Main.tile[x, y].active(true); - Main.tile[x, y].halfBrick(false); - Main.tile[x, y].slope((byte) 0); - Main.tile[x, y].type = (ushort) 225; + flag = true; + break; } } - if (num14 < num6 * 0.6 * (1.0 + (double) random.Next(-10, 11) * 0.005)) + } + if (!flag) + { + for (int index11 = i - 1; index11 <= i + 2; ++index11) { - Main.tile[x, y].wall = (ushort) 86; - if (WorldGen.drunkWorldGen && random.Next(2) == 0) + for (int index12 = index8 - 1; index12 <= index8 + 2; ++index12) { - Main.tile[x, y].liquid = byte.MaxValue; - Main.tile[x, y].honey(true); + if (index11 >= i && index11 <= i + 1 && index12 >= index8 && index12 <= index8 + 1) + { + Main.tile[index11, index12].active(false); + Main.tile[index11, index12].liquid = byte.MaxValue; + Main.tile[index11, index12].honey(true); + } + else + { + Main.tile[index11, index12].active(true); + Main.tile[index11, index12].type = (ushort) 225; + } + } + } + int num5 = num4 * -1; + int j = index8 + 1; + int num6 = 0; + while ((num6 < 4 || WorldGen.SolidTile(i, j)) && i > 10 && i < Main.maxTilesX - 10) + { + ++num6; + i += num5; + if (WorldGen.SolidTile(i, j)) + { + WorldGen.PoundTile(i, j); + if (!Main.tile[i, j + 1].active()) + { + Main.tile[i, j + 1].active(true); + Main.tile[i, j + 1].type = (ushort) 225; + } } } } } - vector2_1 += vector2_2; - num2 = num7 - 1f; - vector2_2.Y += (float) random.Next(-10, 11) * 0.05f; - vector2_2.X += (float) random.Next(-10, 11) * 0.05f; } - return vector2_1; - } - - private static bool TooCloseToImportantLocations(Point origin) - { - int x = origin.X; - int y = origin.Y; - int num = 150; - for (int index1 = x - num; index1 < x + num; index1 += 10) - { - if (index1 > 0 && index1 <= Main.maxTilesX - 1) - { - for (int index2 = y - num; index2 < y + num; index2 += 10) - { - if (index2 > 0 && index2 <= Main.maxTilesY - 1 && (Main.tile[index1, index2].active() && Main.tile[index1, index2].type == (ushort) 226 || Main.tile[index1, index2].wall == (ushort) 83 || Main.tile[index1, index2].wall == (ushort) 3 || Main.tile[index1, index2].wall == (ushort) 87)) - return true; - } - } - } - return false; - } - - private static void CreateDentForHoneyFall(int x, int y, int dir) - { - dir *= -1; - ++y; - int num = 0; - while ((num < 4 || WorldGen.SolidTile(x, y)) && x > 10 && x < Main.maxTilesX - 10) - { - ++num; - x += dir; - if (WorldGen.SolidTile(x, y)) - { - WorldGen.PoundTile(x, y); - if (!Main.tile[x, y + 1].active()) - { - Main.tile[x, y + 1].active(true); - Main.tile[x, y + 1].type = (ushort) 225; - } - } - } - } - - private static void CreateBlockedHoneyCube(int x, int y) - { - for (int index1 = x - 1; index1 <= x + 2; ++index1) - { - for (int index2 = y - 1; index2 <= y + 2; ++index2) - { - if (index1 >= x && index1 <= x + 1 && index2 >= y && index2 <= y + 1) - { - Main.tile[index1, index2].active(false); - Main.tile[index1, index2].liquid = byte.MaxValue; - Main.tile[index1, index2].honey(true); - } - else - { - Main.tile[index1, index2].active(true); - Main.tile[index1, index2].type = (ushort) 225; - } - } - } - } - - private static bool SpotActuallyNotInHive(int x, int y) - { - for (int index1 = x - 1; index1 <= x + 2; ++index1) - { - for (int index2 = y - 1; index2 <= y + 2; ++index2) - { - if (index1 < 10 || index1 > Main.maxTilesX - 10 || Main.tile[index1, index2].active() && Main.tile[index1, index2].type != (ushort) 225) - return true; - } - } - return false; - } - - private static bool BadSpotForHoneyFall(int x, int y) => !Main.tile[x, y].active() || !Main.tile[x, y + 1].active() || !Main.tile[x + 1, y].active() || !Main.tile[x + 1, y + 1].active(); - - public static void CreateStandForLarva(Vector2 position) - { - WorldGen.larvaX[WorldGen.numLarva] = Utils.Clamp((int) position.X, 5, Main.maxTilesX - 5); - WorldGen.larvaY[WorldGen.numLarva] = Utils.Clamp((int) position.Y, 5, Main.maxTilesY - 5); + WorldGen.larvaX[WorldGen.numLarva] = Utils.Clamp((int) vector2_1.X, 5, Main.maxTilesX - 5); + WorldGen.larvaY[WorldGen.numLarva] = Utils.Clamp((int) vector2_1.Y, 5, Main.maxTilesY - 5); ++WorldGen.numLarva; - if (WorldGen.numLarva >= WorldGen.larvaX.Length) - WorldGen.numLarva = WorldGen.larvaX.Length - 1; - int x = (int) position.X; - int y = (int) position.Y; - for (int index1 = x - 1; index1 <= x + 1 && index1 > 0 && index1 < Main.maxTilesX; ++index1) + int x3 = (int) vector2_1.X; + int y3 = (int) vector2_1.Y; + for (int index13 = x3 - 1; index13 <= x3 + 1 && index13 > 0 && index13 < Main.maxTilesX; ++index13) { - for (int index2 = y - 2; index2 <= y + 1 && index2 > 0 && index2 < Main.maxTilesY; ++index2) + for (int index14 = y3 - 2; index14 <= y3 + 1 && index14 > 0 && index14 < Main.maxTilesY; ++index14) { - if (index2 != y + 1) + if (index14 != y3 + 1) { - Main.tile[index1, index2].active(false); + Main.tile[index13, index14].active(false); } else { - Main.tile[index1, index2].active(true); - Main.tile[index1, index2].type = (ushort) 225; - Main.tile[index1, index2].slope((byte) 0); - Main.tile[index1, index2].halfBrick(false); + Main.tile[index13, index14].active(true); + Main.tile[index13, index14].type = (ushort) 225; + Main.tile[index13, index14].slope((byte) 0); + Main.tile[index13, index14].halfBrick(false); } } } + structures.AddStructure(new Microsoft.Xna.Framework.Rectangle(origin.X - 50, origin.Y - 50, 100, 100), 5); + return true; } } } diff --git a/GameContent/Biomes/HoneyPatchBiome.cs b/GameContent/Biomes/HoneyPatchBiome.cs index 3e6b784..9c80038 100644 --- a/GameContent/Biomes/HoneyPatchBiome.cs +++ b/GameContent/Biomes/HoneyPatchBiome.cs @@ -1,11 +1,11 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Biomes.HoneyPatchBiome -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; -using Terraria.WorldBuilding; +using Terraria.World.Generation; namespace Terraria.GameContent.Biomes { @@ -27,7 +27,7 @@ namespace Terraria.GameContent.Biomes ShapeData data = new ShapeData(); WorldUtils.Gen(result, (GenShape) new Shapes.Circle(4, 3), Actions.Chain((GenAction) new Modifiers.Blotches(), (GenAction) new Modifiers.IsSolid(), (GenAction) new Actions.ClearTile(true), new Modifiers.RectangleMask(-6, 6, 0, 3).Output(data), (GenAction) new Actions.SetLiquid(2))); WorldUtils.Gen(new Point(result.X, result.Y + 1), (GenShape) new ModShapes.InnerOutline(data), Actions.Chain((GenAction) new Modifiers.IsEmpty(), (GenAction) new Modifiers.RectangleMask(-6, 6, 1, 3), (GenAction) new Actions.SetTile((ushort) 59, true))); - structures.AddProtectedStructure(new Microsoft.Xna.Framework.Rectangle(result.X - 8, result.Y - 8, 16, 16)); + structures.AddStructure(new Microsoft.Xna.Framework.Rectangle(result.X - 8, result.Y - 8, 16, 16)); return true; } } diff --git a/GameContent/Biomes/JunglePass.cs b/GameContent/Biomes/JunglePass.cs deleted file mode 100644 index 3b7b0fd..0000000 --- a/GameContent/Biomes/JunglePass.cs +++ /dev/null @@ -1,232 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Biomes.JunglePass -// 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; -using System; -using Terraria.IO; -using Terraria.WorldBuilding; - -namespace Terraria.GameContent.Biomes -{ - public class JunglePass : GenPass - { - private float _worldScale; - - public int JungleOriginX { get; set; } - - public int DungeonSide { get; set; } - - public double WorldSurface { get; set; } - - public int LeftBeachEnd { get; set; } - - public int RightBeachStart { get; set; } - - public int JungleX { get; private set; } - - public JunglePass() - : base("Jungle", 10154.65f) - { - } - - protected override void ApplyPass(GenerationProgress progress, GameConfiguration configuration) - { - progress.Message = Lang.gen[11].Value; - this._worldScale = (float) (Main.maxTilesX / 4200) * 1.5f; - float worldScale = this._worldScale; - Point startPoint = this.CreateStartPoint(); - int x = startPoint.X; - int y = startPoint.Y; - Point zero = Point.Zero; - this.ApplyRandomMovement(ref x, ref y, 100, 100); - zero.X += x; - zero.Y += y; - this.PlaceFirstPassMud(x, y, 3); - this.PlaceGemsAt(x, y, (ushort) 63, 2); - progress.Set(0.15f); - this.ApplyRandomMovement(ref x, ref y, 250, 150); - zero.X += x; - zero.Y += y; - this.PlaceFirstPassMud(x, y, 0); - this.PlaceGemsAt(x, y, (ushort) 65, 2); - progress.Set(0.3f); - int oldX = x; - int oldY = y; - this.ApplyRandomMovement(ref x, ref y, 400, 150); - zero.X += x; - zero.Y += y; - this.PlaceFirstPassMud(x, y, -3); - this.PlaceGemsAt(x, y, (ushort) 67, 2); - progress.Set(0.45f); - int num1 = zero.X / 3; - int j = zero.Y / 3; - int num2 = GenBase._random.Next((int) (400.0 * (double) worldScale), (int) (600.0 * (double) worldScale)); - int num3 = (int) (25.0 * (double) worldScale); - int i = Utils.Clamp(num1, this.LeftBeachEnd + num2 / 2 + num3, this.RightBeachStart - num2 / 2 - num3); - WorldGen.mudWall = true; - WorldGen.TileRunner(i, j, (double) num2, 10000, 59, speedY: -20f, noYChange: true); - this.GenerateTunnelToSurface(i, j); - WorldGen.mudWall = false; - progress.Set(0.6f); - this.GenerateHolesInMudWalls(); - this.GenerateFinishingTouches(progress, oldX, oldY); - } - - private void PlaceGemsAt(int x, int y, ushort baseGem, int gemVariants) - { - for (int index = 0; (double) index < 6.0 * (double) this._worldScale; ++index) - WorldGen.TileRunner(x + GenBase._random.Next(-(int) (125.0 * (double) this._worldScale), (int) (125.0 * (double) this._worldScale)), y + GenBase._random.Next(-(int) (125.0 * (double) this._worldScale), (int) (125.0 * (double) this._worldScale)), (double) GenBase._random.Next(3, 7), GenBase._random.Next(3, 8), GenBase._random.Next((int) baseGem, (int) baseGem + gemVariants)); - } - - private void PlaceFirstPassMud(int x, int y, int xSpeedScale) - { - WorldGen.mudWall = true; - WorldGen.TileRunner(x, y, (double) GenBase._random.Next((int) (250.0 * (double) this._worldScale), (int) (500.0 * (double) this._worldScale)), GenBase._random.Next(50, 150), 59, speedX: ((float) (this.DungeonSide * xSpeedScale))); - WorldGen.mudWall = false; - } - - private Point CreateStartPoint() => new Point(this.JungleOriginX, (int) ((double) Main.maxTilesY + Main.rockLayer) / 2); - - private void ApplyRandomMovement(ref int x, ref int y, int xRange, int yRange) - { - x += GenBase._random.Next((int) ((double) -xRange * (double) this._worldScale), 1 + (int) ((double) xRange * (double) this._worldScale)); - y += GenBase._random.Next((int) ((double) -yRange * (double) this._worldScale), 1 + (int) ((double) yRange * (double) this._worldScale)); - y = Utils.Clamp(y, (int) Main.rockLayer, Main.maxTilesY); - } - - private void GenerateTunnelToSurface(int i, int j) - { - double num1 = (double) GenBase._random.Next(5, 11); - Vector2 vector2_1; - vector2_1.X = (float) i; - vector2_1.Y = (float) j; - Vector2 vector2_2; - vector2_2.X = (float) GenBase._random.Next(-10, 11) * 0.1f; - vector2_2.Y = (float) GenBase._random.Next(10, 20) * 0.1f; - int num2 = 0; - bool flag = true; - while (flag) - { - if ((double) vector2_1.Y < Main.worldSurface) - { - if (WorldGen.drunkWorldGen) - flag = false; - int x = (int) vector2_1.X; - int y = (int) vector2_1.Y; - int index1 = Utils.Clamp(x, 10, Main.maxTilesX - 10); - int index2 = Utils.Clamp(y, 10, Main.maxTilesY - 10); - if (index2 < 5) - index2 = 5; - if (Main.tile[index1, index2].wall == (ushort) 0 && !Main.tile[index1, index2].active() && Main.tile[index1, index2 - 3].wall == (ushort) 0 && !Main.tile[index1, index2 - 3].active() && Main.tile[index1, index2 - 1].wall == (ushort) 0 && !Main.tile[index1, index2 - 1].active() && Main.tile[index1, index2 - 4].wall == (ushort) 0 && !Main.tile[index1, index2 - 4].active() && Main.tile[index1, index2 - 2].wall == (ushort) 0 && !Main.tile[index1, index2 - 2].active() && Main.tile[index1, index2 - 5].wall == (ushort) 0 && !Main.tile[index1, index2 - 5].active()) - flag = false; - } - this.JungleX = (int) vector2_1.X; - num1 += (double) GenBase._random.Next(-20, 21) * 0.100000001490116; - if (num1 < 5.0) - num1 = 5.0; - if (num1 > 10.0) - num1 = 10.0; - int num3 = (int) ((double) vector2_1.X - num1 * 0.5); - int num4 = (int) ((double) vector2_1.X + num1 * 0.5); - int num5 = (int) ((double) vector2_1.Y - num1 * 0.5); - int num6 = (int) ((double) vector2_1.Y + num1 * 0.5); - int max = Main.maxTilesX - 10; - int num7 = Utils.Clamp(num3, 10, max); - int num8 = Utils.Clamp(num4, 10, Main.maxTilesX - 10); - int num9 = Utils.Clamp(num5, 10, Main.maxTilesY - 10); - int num10 = Utils.Clamp(num6, 10, Main.maxTilesY - 10); - for (int i1 = num7; i1 < num8; ++i1) - { - for (int j1 = num9; j1 < num10; ++j1) - { - if ((double) Math.Abs((float) i1 - vector2_1.X) + (double) Math.Abs((float) j1 - vector2_1.Y) < num1 * 0.5 * (1.0 + (double) GenBase._random.Next(-10, 11) * 0.015)) - WorldGen.KillTile(i1, j1); - } - } - ++num2; - if (num2 > 10 && GenBase._random.Next(50) < num2) - { - num2 = 0; - int num11 = -2; - if (GenBase._random.Next(2) == 0) - num11 = 2; - WorldGen.TileRunner((int) vector2_1.X, (int) vector2_1.Y, (double) GenBase._random.Next(3, 20), GenBase._random.Next(10, 100), -1, speedX: ((float) num11)); - } - vector2_1 += vector2_2; - vector2_2.Y += (float) GenBase._random.Next(-10, 11) * 0.01f; - if ((double) vector2_2.Y > 0.0) - vector2_2.Y = 0.0f; - if ((double) vector2_2.Y < -2.0) - vector2_2.Y = -2f; - vector2_2.X += (float) GenBase._random.Next(-10, 11) * 0.1f; - if ((double) vector2_1.X < (double) (i - 200)) - vector2_2.X += (float) GenBase._random.Next(5, 21) * 0.1f; - if ((double) vector2_1.X > (double) (i + 200)) - vector2_2.X -= (float) GenBase._random.Next(5, 21) * 0.1f; - if ((double) vector2_2.X > 1.5) - vector2_2.X = 1.5f; - if ((double) vector2_2.X < -1.5) - vector2_2.X = -1.5f; - } - } - - private void GenerateHolesInMudWalls() - { - for (int index = 0; index < Main.maxTilesX / 4; ++index) - { - int i = GenBase._random.Next(20, Main.maxTilesX - 20); - int j; - for (j = GenBase._random.Next((int) this.WorldSurface + 10, Main.UnderworldLayer); Main.tile[i, j].wall != (ushort) 64 && Main.tile[i, j].wall != (ushort) 15; j = GenBase._random.Next((int) this.WorldSurface + 10, Main.UnderworldLayer)) - i = GenBase._random.Next(20, Main.maxTilesX - 20); - WorldGen.MudWallRunner(i, j); - } - } - - private void GenerateFinishingTouches(GenerationProgress progress, int oldX, int oldY) - { - int i1 = oldX; - int j1 = oldY; - float worldScale = this._worldScale; - for (int index = 0; (double) index <= 20.0 * (double) worldScale; ++index) - { - progress.Set((float) ((60.0 + (double) index / (double) worldScale) * 0.00999999977648258)); - i1 += GenBase._random.Next((int) (-5.0 * (double) worldScale), (int) (6.0 * (double) worldScale)); - j1 += GenBase._random.Next((int) (-5.0 * (double) worldScale), (int) (6.0 * (double) worldScale)); - WorldGen.TileRunner(i1, j1, (double) GenBase._random.Next(40, 100), GenBase._random.Next(300, 500), 59); - } - for (int index1 = 0; (double) index1 <= 10.0 * (double) worldScale; ++index1) - { - progress.Set((float) ((80.0 + (double) index1 / (double) worldScale * 2.0) * 0.00999999977648258)); - int i2 = oldX + GenBase._random.Next((int) (-600.0 * (double) worldScale), (int) (600.0 * (double) worldScale)); - int j2; - for (j2 = oldY + GenBase._random.Next((int) (-200.0 * (double) worldScale), (int) (200.0 * (double) worldScale)); i2 < 1 || i2 >= Main.maxTilesX - 1 || j2 < 1 || j2 >= Main.maxTilesY - 1 || Main.tile[i2, j2].type != (ushort) 59; j2 = oldY + GenBase._random.Next((int) (-200.0 * (double) worldScale), (int) (200.0 * (double) worldScale))) - i2 = oldX + GenBase._random.Next((int) (-600.0 * (double) worldScale), (int) (600.0 * (double) worldScale)); - for (int index2 = 0; (double) index2 < 8.0 * (double) worldScale; ++index2) - { - i2 += GenBase._random.Next(-30, 31); - j2 += GenBase._random.Next(-30, 31); - int type = -1; - if (GenBase._random.Next(7) == 0) - type = -2; - WorldGen.TileRunner(i2, j2, (double) GenBase._random.Next(10, 20), GenBase._random.Next(30, 70), type); - } - } - for (int index = 0; (double) index <= 300.0 * (double) worldScale; ++index) - { - int i3 = oldX + GenBase._random.Next((int) (-600.0 * (double) worldScale), (int) (600.0 * (double) worldScale)); - int j3; - for (j3 = oldY + GenBase._random.Next((int) (-200.0 * (double) worldScale), (int) (200.0 * (double) worldScale)); i3 < 1 || i3 >= Main.maxTilesX - 1 || j3 < 1 || j3 >= Main.maxTilesY - 1 || Main.tile[i3, j3].type != (ushort) 59; j3 = oldY + GenBase._random.Next((int) (-200.0 * (double) worldScale), (int) (200.0 * (double) worldScale))) - i3 = oldX + GenBase._random.Next((int) (-600.0 * (double) worldScale), (int) (600.0 * (double) worldScale)); - WorldGen.TileRunner(i3, j3, (double) GenBase._random.Next(4, 10), GenBase._random.Next(5, 30), 1); - if (GenBase._random.Next(4) == 0) - { - int type = GenBase._random.Next(63, 69); - WorldGen.TileRunner(i3 + GenBase._random.Next(-1, 2), j3 + GenBase._random.Next(-1, 2), (double) GenBase._random.Next(3, 7), GenBase._random.Next(4, 8), type); - } - } - } - } -} diff --git a/GameContent/Biomes/MahoganyTreeBiome.cs b/GameContent/Biomes/MahoganyTreeBiome.cs index 171c0ae..40b331e 100644 --- a/GameContent/Biomes/MahoganyTreeBiome.cs +++ b/GameContent/Biomes/MahoganyTreeBiome.cs @@ -1,14 +1,14 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Biomes.MahoganyTreeBiome -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using System; using System.Collections.Generic; using Terraria.GameContent.Generation; -using Terraria.WorldBuilding; +using Terraria.World.Generation; namespace Terraria.GameContent.Biomes { @@ -22,21 +22,18 @@ namespace Terraria.GameContent.Biomes Point result2; if (!WorldUtils.Find(new Point(result1.X, result1.Y - 5), Searches.Chain((GenSearch) new Searches.Up(120), new Conditions.IsSolid().AreaOr(6, 1)), out result2) || result1.Y - 5 - result2.Y > 60 || result1.Y - result2.Y < 30 || !structures.CanPlace(new Microsoft.Xna.Framework.Rectangle(result1.X - 30, result1.Y - 60, 60, 90))) return false; - if (!WorldGen.drunkWorldGen || WorldGen.genRand.Next(50) > 0) + Dictionary resultsOutput = new Dictionary(); + WorldUtils.Gen(new Point(result1.X - 25, result1.Y - 25), (GenShape) new Shapes.Rectangle(50, 50), (GenAction) new Actions.TileScanner(new ushort[4] { - Dictionary resultsOutput = new Dictionary(); - WorldUtils.Gen(new Point(result1.X - 25, result1.Y - 25), (GenShape) new Shapes.Rectangle(50, 50), (GenAction) new Actions.TileScanner(new ushort[4] - { - (ushort) 0, - (ushort) 59, - (ushort) 147, - (ushort) 1 - }).Output(resultsOutput)); - int num1 = resultsOutput[(ushort) 0] + resultsOutput[(ushort) 1]; - int num2 = resultsOutput[(ushort) 59]; - if (resultsOutput[(ushort) 147] > num2 || num1 > num2 || num2 < 50) - return false; - } + (ushort) 0, + (ushort) 59, + (ushort) 147, + (ushort) 1 + }).Output(resultsOutput)); + int num1 = resultsOutput[(ushort) 0] + resultsOutput[(ushort) 1]; + int num2 = resultsOutput[(ushort) 59]; + if (resultsOutput[(ushort) 147] > num2 || num1 > num2 || num2 < 50) + return false; int num3 = (result1.Y - result2.Y - 9) / 5; int num4 = num3 * 5; int num5 = 0; @@ -49,8 +46,8 @@ namespace Terraria.GameContent.Biomes int num8 = (int) (Math.Sin((double) (index + 1) / 12.0 * num6 * 3.14159274101257) * num7); int num9 = num8 < num5 ? num8 - num5 : 0; WorldUtils.Gen(new Point(result1.X + num5 + num9, result1.Y - (index + 1) * 5), (GenShape) new Shapes.Rectangle(6 + Math.Abs(num8 - num5), 7), Actions.Chain((GenAction) new Actions.RemoveWall(), (GenAction) new Actions.SetTile((ushort) 383), (GenAction) new Actions.SetFrames())); - WorldUtils.Gen(new Point(result1.X + num5 + num9 + 2, result1.Y - (index + 1) * 5), (GenShape) new Shapes.Rectangle(2 + Math.Abs(num8 - num5), 5), Actions.Chain((GenAction) new Actions.ClearTile(true), (GenAction) new Actions.PlaceWall((ushort) 78))); - WorldUtils.Gen(new Point(result1.X + num5 + 2, result1.Y - index * 5), (GenShape) new Shapes.Rectangle(2, 2), Actions.Chain((GenAction) new Actions.ClearTile(true), (GenAction) new Actions.PlaceWall((ushort) 78))); + WorldUtils.Gen(new Point(result1.X + num5 + num9 + 2, result1.Y - (index + 1) * 5), (GenShape) new Shapes.Rectangle(2 + Math.Abs(num8 - num5), 5), Actions.Chain((GenAction) new Actions.ClearTile(true), (GenAction) new Actions.PlaceWall((byte) 78))); + WorldUtils.Gen(new Point(result1.X + num5 + 2, result1.Y - index * 5), (GenShape) new Shapes.Rectangle(2, 2), Actions.Chain((GenAction) new Actions.ClearTile(true), (GenAction) new Actions.PlaceWall((byte) 78))); num5 = num8; } int num10 = 6; @@ -76,9 +73,9 @@ namespace Terraria.GameContent.Biomes GenAction action = Actions.Chain((GenAction) new Modifiers.Blotches(4, 2, 0.3), (GenAction) new Modifiers.SkipTiles(new ushort[1] { (ushort) 383 - }), (GenAction) new Modifiers.SkipWalls(new ushort[1] + }), (GenAction) new Modifiers.SkipWalls(new byte[1] { - (ushort) 78 + (byte) 78 }), (GenAction) new Actions.SetTile((ushort) 384), (GenAction) new Actions.SetFrames(true)); WorldUtils.Gen(origin1, (GenShape) circle, action); } @@ -88,7 +85,7 @@ namespace Terraria.GameContent.Biomes WorldUtils.Gen(result1, (GenShape) new ShapeRoot(angle, (float) GenBase._random.Next(40, 60)), (GenAction) new Actions.SetTile((ushort) 383, true)); } WorldGen.AddBuriedChest(result1.X + 3, result1.Y - 1, GenBase._random.Next(4) == 0 ? 0 : WorldGen.GetNextJungleChestItem(), Style: 10); - structures.AddProtectedStructure(new Microsoft.Xna.Framework.Rectangle(result1.X - 30, result1.Y - 30, 60, 60)); + structures.AddStructure(new Microsoft.Xna.Framework.Rectangle(result1.X - 30, result1.Y - 30, 60, 60)); return true; } } diff --git a/GameContent/Biomes/MarbleBiome.cs b/GameContent/Biomes/MarbleBiome.cs index 5820c2d..a409544 100644 --- a/GameContent/Biomes/MarbleBiome.cs +++ b/GameContent/Biomes/MarbleBiome.cs @@ -1,13 +1,13 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Biomes.MarbleBiome -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using System; using Terraria.ID; -using Terraria.WorldBuilding; +using Terraria.World.Generation; namespace Terraria.GameContent.Biomes { @@ -50,46 +50,31 @@ namespace Terraria.GameContent.Biomes private void PlaceSlab(MarbleBiome.Slab slab, int originX, int originY, int scale) { - ushort num1 = 367; - ushort num2 = 178; - if (WorldGen.drunkWorldGen) + for (int x = 0; x < scale; ++x) { - num1 = (ushort) 368; - num2 = (ushort) 180; - } - int num3 = -1; - int num4 = scale + 1; - int num5 = 0; - int num6 = scale; - for (int x = num3; x < num4; ++x) - { - if (x != num3 && x != num4 - 1 || WorldGen.genRand.Next(2) != 0) + for (int y = 0; y < scale; ++y) { - if (WorldGen.genRand.Next(2) == 0) - --num5; - if (WorldGen.genRand.Next(2) == 0) - ++num6; - for (int y = num5; y < num6; ++y) - { - Tile tile = GenBase._tiles[originX + x, originY + y]; - tile.ResetToType(TileID.Sets.Ore[(int) tile.type] ? tile.type : num1); - bool active = slab.State(x, y, scale); - tile.active(active); - if (slab.HasWall) - tile.wall = num2; - WorldUtils.TileFrame(originX + x, originY + y, true); - WorldGen.SquareWallFrame(originX + x, originY + y); - Tile.SmoothSlope(originX + x, originY + y); - if (WorldGen.SolidTile(originX + x, originY + y - 1) && GenBase._random.Next(4) == 0) - WorldGen.PlaceTight(originX + x, originY + y); - if (WorldGen.SolidTile(originX + x, originY + y) && GenBase._random.Next(4) == 0) - WorldGen.PlaceTight(originX + x, originY + y - 1); - } + Tile tile = GenBase._tiles[originX + x, originY + y]; + if (TileID.Sets.Ore[(int) tile.type]) + tile.ResetToType(tile.type); + else + tile.ResetToType((ushort) 367); + bool active = slab.State(x, y, scale); + tile.active(active); + if (slab.HasWall) + tile.wall = (byte) 178; + WorldUtils.TileFrame(originX + x, originY + y, true); + WorldGen.SquareWallFrame(originX + x, originY + y); + Tile.SmoothSlope(originX + x, originY + y); + if (WorldGen.SolidTile(originX + x, originY + y - 1) && GenBase._random.Next(4) == 0) + WorldGen.PlaceTight(originX + x, originY + y); + if (WorldGen.SolidTile(originX + x, originY + y) && GenBase._random.Next(4) == 0) + WorldGen.PlaceTight(originX + x, originY + y - 1); } } } - private static bool IsGroupSolid(int x, int y, int scale) + private bool IsGroupSolid(int x, int y, int scale) { int num = 0; for (int index1 = 0; index1 < scale; ++index1) @@ -105,8 +90,6 @@ namespace Terraria.GameContent.Biomes public override bool Place(Point origin, StructureMap structures) { - if (WorldGen.BiomeTileCheck(origin.X, origin.Y)) - return false; if (this._slabs == null) this._slabs = new MarbleBiome.Slab[56, 26]; int num1 = GenBase._random.Next(80, 150) / 3; @@ -116,13 +99,13 @@ namespace Terraria.GameContent.Biomes origin.Y -= num2 * 3 / 2; for (int index1 = -1; index1 < num1 + 1; ++index1) { - double num4 = (double) (index1 - num1 / 2) / (double) num1 + 0.5; - int num5 = (int) ((0.5 - Math.Abs(num4 - 0.5)) * 5.0) - 2; + float num4 = (float) ((double) (index1 - num1 / 2) / (double) num1 + 0.5); + int num5 = (int) ((0.5 - (double) Math.Abs(num4 - 0.5f)) * 5.0) - 2; for (int index2 = -1; index2 < num2 + 1; ++index2) { bool hasWall = true; bool flag1 = false; - bool flag2 = MarbleBiome.IsGroupSolid(index1 * 3 + origin.X, index2 * 3 + origin.Y, 3); + bool flag2 = this.IsGroupSolid(index1 * 3 + origin.X, index2 * 3 + origin.Y, 3); int num6 = Math.Abs(index2 - num2 / 2) - num3 / 4 + num5; if (num6 > 3) { @@ -136,7 +119,7 @@ namespace Terraria.GameContent.Biomes } else if (num6 == 0) flag1 = GenBase._random.Next(2) == 0 && index2 - num2 / 2 > 0 | flag2; - if (Math.Abs(num4 - 0.5) > 0.349999994039536 + (double) GenBase._random.NextFloat() * 0.100000001490116 && !flag2) + if ((double) Math.Abs(num4 - 0.5f) > 0.349999994039536 + (double) GenBase._random.NextFloat() * 0.100000001490116 && !flag2) { hasWall = false; flag1 = false; @@ -167,13 +150,12 @@ namespace Terraria.GameContent.Biomes for (int index6 = val1 - num14; index6 <= val1 + num14; ++index6) this.PlaceSlab(this._slabs[index5 + 1, index6 + 1], index5 * 3 + origin.X, index6 * 3 + origin.Y + (int) num12, 3); } - structures.AddStructure(new Microsoft.Xna.Framework.Rectangle(origin.X, origin.Y, num1 * 3, num2 * 3), 8); return true; } private delegate bool SlabState(int x, int y, int scale); - private static class SlabStates + private class SlabStates { public static bool Empty(int x, int y, int scale) => false; diff --git a/GameContent/Biomes/MiningExplosivesBiome.cs b/GameContent/Biomes/MiningExplosivesBiome.cs index d27322c..a0122ea 100644 --- a/GameContent/Biomes/MiningExplosivesBiome.cs +++ b/GameContent/Biomes/MiningExplosivesBiome.cs @@ -1,12 +1,12 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Biomes.MiningExplosivesBiome -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Terraria.GameContent.Generation; -using Terraria.WorldBuilding; +using Terraria.World.Generation; namespace Terraria.GameContent.Biomes { @@ -14,7 +14,7 @@ namespace Terraria.GameContent.Biomes { public override bool Place(Point origin, StructureMap structures) { - if (WorldGen.SolidTile(origin.X, origin.Y) || Main.tile[origin.X, origin.Y].wall == (ushort) 216 || Main.tile[origin.X, origin.Y].wall == (ushort) 187) + if (WorldGen.SolidTile(origin.X, origin.Y)) return false; ushort type = Utils.SelectRandom(GenBase._random, WorldGen.goldBar == 19 ? (ushort) 8 : (ushort) 169, WorldGen.silverBar == 21 ? (ushort) 9 : (ushort) 168, WorldGen.ironBar == 22 ? (ushort) 6 : (ushort) 167, WorldGen.copperBar == 20 ? (ushort) 7 : (ushort) 166); double num1 = GenBase._random.NextDouble() * 2.0 - 1.0; @@ -61,7 +61,7 @@ namespace Terraria.GameContent.Biomes WorldGen.PlaceTile(result1.X, result1.Y, 141); WorldGen.PlaceTile(result2.X, result2.Y, 411, true, true); WorldUtils.WireLine(result1, result2); - structures.AddProtectedStructure(area, 5); + structures.AddStructure(area, 5); return true; } } diff --git a/GameContent/Biomes/TerrainPass.cs b/GameContent/Biomes/TerrainPass.cs deleted file mode 100644 index 599cfb1..0000000 --- a/GameContent/Biomes/TerrainPass.cs +++ /dev/null @@ -1,309 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Biomes.TerrainPass -// 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.IO; -using Terraria.WorldBuilding; - -namespace Terraria.GameContent.Biomes -{ - public class TerrainPass : GenPass - { - public double WorldSurface { get; private set; } - - public double WorldSurfaceHigh { get; private set; } - - public double WorldSurfaceLow { get; private set; } - - public double RockLayer { get; private set; } - - public double RockLayerHigh { get; private set; } - - public double RockLayerLow { get; private set; } - - public int WaterLine { get; private set; } - - public int LavaLine { get; private set; } - - public int LeftBeachSize { get; set; } - - public int RightBeachSize { get; set; } - - public TerrainPass() - : base("Terrain", 449.3722f) - { - } - - protected override void ApplyPass(GenerationProgress progress, GameConfiguration configuration) - { - int num1 = configuration.Get("FlatBeachPadding"); - progress.Message = Lang.gen[0].Value; - TerrainPass.TerrainFeatureType featureType = TerrainPass.TerrainFeatureType.Plateau; - double num2 = (double) Main.maxTilesY * 0.3 * ((double) GenBase._random.Next(90, 110) * 0.005); - double num3 = (num2 + (double) Main.maxTilesY * 0.2) * ((double) GenBase._random.Next(90, 110) * 0.01); - double val2_1 = num2; - double val2_2 = num2; - double val2_3 = num3; - double val2_4 = num3; - double num4 = (double) Main.maxTilesY * 0.23; - TerrainPass.SurfaceHistory history = new TerrainPass.SurfaceHistory(500); - int num5 = this.LeftBeachSize + num1; - for (int index = 0; index < Main.maxTilesX; ++index) - { - progress.Set((float) index / (float) Main.maxTilesX); - val2_1 = Math.Min(num2, val2_1); - val2_2 = Math.Max(num2, val2_2); - val2_3 = Math.Min(num3, val2_3); - val2_4 = Math.Max(num3, val2_4); - if (num5 <= 0) - { - featureType = (TerrainPass.TerrainFeatureType) GenBase._random.Next(0, 5); - num5 = GenBase._random.Next(5, 40); - if (featureType == TerrainPass.TerrainFeatureType.Plateau) - num5 *= (int) ((double) GenBase._random.Next(5, 30) * 0.2); - } - --num5; - if ((double) index > (double) Main.maxTilesX * 0.45 && (double) index < (double) Main.maxTilesX * 0.55 && (featureType == TerrainPass.TerrainFeatureType.Mountain || featureType == TerrainPass.TerrainFeatureType.Valley)) - featureType = (TerrainPass.TerrainFeatureType) GenBase._random.Next(3); - if ((double) index > (double) Main.maxTilesX * 0.48 && (double) index < (double) Main.maxTilesX * 0.52) - featureType = TerrainPass.TerrainFeatureType.Plateau; - num2 += TerrainPass.GenerateWorldSurfaceOffset(featureType); - float num6 = 0.17f; - float num7 = 0.26f; - if (WorldGen.drunkWorldGen) - { - num6 = 0.15f; - num7 = 0.28f; - } - if (index < this.LeftBeachSize + num1 || index > Main.maxTilesX - this.RightBeachSize - num1) - num2 = Utils.Clamp(num2, (double) Main.maxTilesY * 0.17, num4); - else if (num2 < (double) Main.maxTilesY * (double) num6) - { - num2 = (double) Main.maxTilesY * (double) num6; - num5 = 0; - } - else if (num2 > (double) Main.maxTilesY * (double) num7) - { - num2 = (double) Main.maxTilesY * (double) num7; - num5 = 0; - } - while (GenBase._random.Next(0, 3) == 0) - num3 += (double) GenBase._random.Next(-2, 3); - if (num3 < num2 + (double) Main.maxTilesY * 0.06) - ++num3; - if (num3 > num2 + (double) Main.maxTilesY * 0.35) - --num3; - history.Record(num2); - TerrainPass.FillColumn(index, num2, num3); - if (index == Main.maxTilesX - this.RightBeachSize - num1) - { - if (num2 > num4) - TerrainPass.RetargetSurfaceHistory(history, index, num4); - featureType = TerrainPass.TerrainFeatureType.Plateau; - num5 = Main.maxTilesX - index; - } - } - Main.worldSurface = (double) (int) (val2_2 + 25.0); - Main.rockLayer = val2_4; - double num8 = (double) ((int) ((Main.rockLayer - Main.worldSurface) / 6.0) * 6); - Main.rockLayer = (double) (int) (Main.worldSurface + num8); - int num9 = (int) (Main.rockLayer + (double) Main.maxTilesY) / 2 + GenBase._random.Next(-100, 20); - int num10 = num9 + GenBase._random.Next(50, 80); - int num11 = 20; - if (val2_3 < val2_2 + (double) num11) - { - double num12 = (val2_3 + val2_2) / 2.0; - double num13 = Math.Abs(val2_3 - val2_2); - if (num13 < (double) num11) - num13 = (double) num11; - val2_3 = num12 + num13 / 2.0; - val2_2 = num12 - num13 / 2.0; - } - this.RockLayer = num3; - this.RockLayerHigh = val2_4; - this.RockLayerLow = val2_3; - this.WorldSurface = num2; - this.WorldSurfaceHigh = val2_2; - this.WorldSurfaceLow = val2_1; - this.WaterLine = num9; - this.LavaLine = num10; - } - - private static void FillColumn(int x, double worldSurface, double rockLayer) - { - for (int index = 0; (double) index < worldSurface; ++index) - { - Main.tile[x, index].active(false); - Main.tile[x, index].frameX = (short) -1; - Main.tile[x, index].frameY = (short) -1; - } - for (int index = (int) worldSurface; index < Main.maxTilesY; ++index) - { - if ((double) index < rockLayer) - { - Main.tile[x, index].active(true); - Main.tile[x, index].type = (ushort) 0; - Main.tile[x, index].frameX = (short) -1; - Main.tile[x, index].frameY = (short) -1; - } - else - { - Main.tile[x, index].active(true); - Main.tile[x, index].type = (ushort) 1; - Main.tile[x, index].frameX = (short) -1; - Main.tile[x, index].frameY = (short) -1; - } - } - } - - private static void RetargetColumn(int x, double worldSurface) - { - for (int index = 0; (double) index < worldSurface; ++index) - { - Main.tile[x, index].active(false); - Main.tile[x, index].frameX = (short) -1; - Main.tile[x, index].frameY = (short) -1; - } - for (int index = (int) worldSurface; index < Main.maxTilesY; ++index) - { - if (Main.tile[x, index].type != (ushort) 1 || !Main.tile[x, index].active()) - { - Main.tile[x, index].active(true); - Main.tile[x, index].type = (ushort) 0; - Main.tile[x, index].frameX = (short) -1; - Main.tile[x, index].frameY = (short) -1; - } - } - } - - private static double GenerateWorldSurfaceOffset(TerrainPass.TerrainFeatureType featureType) - { - double num = 0.0; - if ((WorldGen.drunkWorldGen || WorldGen.getGoodWorldGen) && WorldGen.genRand.Next(2) == 0) - { - switch (featureType) - { - case TerrainPass.TerrainFeatureType.Plateau: - while (GenBase._random.Next(0, 6) == 0) - num += (double) GenBase._random.Next(-1, 2); - break; - case TerrainPass.TerrainFeatureType.Hill: - while (GenBase._random.Next(0, 3) == 0) - --num; - while (GenBase._random.Next(0, 10) == 0) - ++num; - break; - case TerrainPass.TerrainFeatureType.Dale: - while (GenBase._random.Next(0, 3) == 0) - ++num; - while (GenBase._random.Next(0, 10) == 0) - --num; - break; - case TerrainPass.TerrainFeatureType.Mountain: - while (GenBase._random.Next(0, 3) != 0) - --num; - while (GenBase._random.Next(0, 6) == 0) - ++num; - break; - case TerrainPass.TerrainFeatureType.Valley: - while (GenBase._random.Next(0, 3) != 0) - ++num; - while (GenBase._random.Next(0, 5) == 0) - --num; - break; - } - } - else - { - switch (featureType) - { - case TerrainPass.TerrainFeatureType.Plateau: - while (GenBase._random.Next(0, 7) == 0) - num += (double) GenBase._random.Next(-1, 2); - break; - case TerrainPass.TerrainFeatureType.Hill: - while (GenBase._random.Next(0, 4) == 0) - --num; - while (GenBase._random.Next(0, 10) == 0) - ++num; - break; - case TerrainPass.TerrainFeatureType.Dale: - while (GenBase._random.Next(0, 4) == 0) - ++num; - while (GenBase._random.Next(0, 10) == 0) - --num; - break; - case TerrainPass.TerrainFeatureType.Mountain: - while (GenBase._random.Next(0, 2) == 0) - --num; - while (GenBase._random.Next(0, 6) == 0) - ++num; - break; - case TerrainPass.TerrainFeatureType.Valley: - while (GenBase._random.Next(0, 2) == 0) - ++num; - while (GenBase._random.Next(0, 5) == 0) - --num; - break; - } - } - return num; - } - - private static void RetargetSurfaceHistory( - TerrainPass.SurfaceHistory history, - int targetX, - double targetHeight) - { - for (int index1 = 0; index1 < history.Length / 2 && history[history.Length - 1] > targetHeight; ++index1) - { - for (int index2 = 0; index2 < history.Length - index1 * 2; ++index2) - { - double num = history[history.Length - index2 - 1] - 1.0; - history[history.Length - index2 - 1] = num; - if (num <= targetHeight) - break; - } - } - for (int index = 0; index < history.Length; ++index) - { - double worldSurface = history[history.Length - index - 1]; - TerrainPass.RetargetColumn(targetX - index, worldSurface); - } - } - - private enum TerrainFeatureType - { - Plateau, - Hill, - Dale, - Mountain, - Valley, - } - - private class SurfaceHistory - { - private readonly double[] _heights; - private int _index; - - public double this[int index] - { - get => this._heights[(index + this._index) % this._heights.Length]; - set => this._heights[(index + this._index) % this._heights.Length] = value; - } - - public int Length => this._heights.Length; - - public SurfaceHistory(int size) => this._heights = new double[size]; - - public void Record(double height) - { - this._heights[this._index] = height; - this._index = (this._index + 1) % this._heights.Length; - } - } - } -} diff --git a/GameContent/Biomes/ThinIceBiome.cs b/GameContent/Biomes/ThinIceBiome.cs index fb35a22..c3df1c7 100644 --- a/GameContent/Biomes/ThinIceBiome.cs +++ b/GameContent/Biomes/ThinIceBiome.cs @@ -1,12 +1,12 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Biomes.ThinIceBiome -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using System.Collections.Generic; -using Terraria.WorldBuilding; +using Terraria.World.Generation; namespace Terraria.GameContent.Biomes { @@ -15,18 +15,17 @@ namespace Terraria.GameContent.Biomes public override bool Place(Point origin, StructureMap structures) { Dictionary resultsOutput = new Dictionary(); - WorldUtils.Gen(new Point(origin.X - 25, origin.Y - 25), (GenShape) new Shapes.Rectangle(50, 50), (GenAction) new Actions.TileScanner(new ushort[5] + WorldUtils.Gen(new Point(origin.X - 25, origin.Y - 25), (GenShape) new Shapes.Rectangle(50, 50), (GenAction) new Actions.TileScanner(new ushort[4] { (ushort) 0, (ushort) 59, (ushort) 147, - (ushort) 1, - (ushort) 225 + (ushort) 1 }).Output(resultsOutput)); int num1 = resultsOutput[(ushort) 0] + resultsOutput[(ushort) 1]; int num2 = resultsOutput[(ushort) 59]; int num3 = resultsOutput[(ushort) 147]; - if (resultsOutput[(ushort) 225] > 0 || num3 <= num2 || num3 <= num1) + if (num3 <= num2 || num3 <= num1) return false; int num4 = 0; for (int radius = GenBase._random.Next(10, 15); radius > 5; --radius) @@ -43,7 +42,6 @@ namespace Terraria.GameContent.Biomes WorldUtils.Gen(new Point(origin.X + num5, origin.Y + num4), (GenShape) new Shapes.Circle(radius), Actions.Chain((GenAction) new Modifiers.Blotches(4), (GenAction) new Modifiers.HasLiquid(), (GenAction) new Actions.SetTile((ushort) 162, true), (GenAction) new Actions.SetLiquid(value: (byte) 0))); num4 += radius - 2; } - structures.AddStructure(new Microsoft.Xna.Framework.Rectangle(origin.X - 25, origin.Y - 25, 50, 50), 8); return true; } } diff --git a/GameContent/ChildSafety.cs b/GameContent/ChildSafety.cs index b4cfeaa..093efbe 100644 --- a/GameContent/ChildSafety.cs +++ b/GameContent/ChildSafety.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.ChildSafety -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Terraria.ID; @@ -10,9 +10,9 @@ namespace Terraria.GameContent { public class ChildSafety { - private static SetFactory factoryDust = new SetFactory(304); - private static SetFactory factoryGore = new SetFactory(1269); - private static readonly bool[] SafeGore = ChildSafety.factoryGore.CreateBoolSet(11, 12, 13, 16, 17, 42, 53, 44, 51, 52, 53, 54, 55, 56, 57, 61, 62, 63, 67, 68, 69, 99, 106, 120, 130, 131, 147, 148, 149, 150, 156, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 213, 217, 218, 219, 220, 221, 222, 257, 265, 266, 267, 268, 269, 276, 277, 278, 279, 280, 281, 282, 314, 321, 322, 326, 331, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 375, 376, 377, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 435, 436, 437, 521, 522, 523, 525, 526, 527, 542, 570, 571, 572, 580, 581, 582, 603, 604, 605, 606, 610, 611, 612, 613, 614, 615, 616, 617, 618, 639, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 734, 728, 729, 730, 731, 732, 733, 825, 826, 827, 848, 849, 850, 851, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 892, 893, 898, 899, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 939, 940, 941, 942, 943, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1160, 1161, 1162, 1201, 1202, 1203, 1204, 1208, 1209, 1218, 1225, 1226, 1248, 1249, 1250, 1251, 1252, 1253, 1254, 1255, 1257, 1261); + private static SetFactory factoryDust = new SetFactory(275); + private static SetFactory factoryGore = new SetFactory(1087); + private static readonly bool[] SafeGore = ChildSafety.factoryGore.CreateBoolSet(11, 12, 13, 16, 17, 42, 53, 44, 51, 52, 53, 54, 55, 56, 57, 61, 62, 63, 67, 68, 69, 99, 106, 120, 130, 131, 147, 148, 149, 150, 156, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 213, 217, 218, 219, 220, 221, 222, 257, 265, 266, 267, 268, 269, 276, 277, 278, 279, 280, 281, 282, 314, 321, 322, 326, 331, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 375, 376, 377, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 435, 436, 437, 521, 522, 523, 525, 526, 527, 542, 570, 571, 572, 580, 581, 582, 603, 604, 605, 606, 610, 611, 612, 613, 614, 615, 616, 617, 618, 639, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 734, 728, 729, 730, 731, 732, 733, 825, 826, 827, 848, 849, 850, 851, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 892, 893, 898, 899, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926); private static readonly bool[] SafeDust = ChildSafety.factoryDust.CreateBoolSet(true, 5, 227, 273); public static bool Disabled = true; diff --git a/GameContent/ChromaHotkeyPainter.cs b/GameContent/ChromaHotkeyPainter.cs deleted file mode 100644 index 0244207..0000000 --- a/GameContent/ChromaHotkeyPainter.cs +++ /dev/null @@ -1,395 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ChromaHotkeyPainter -// 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; -using Microsoft.Xna.Framework.Input; -using ReLogic.Peripherals.RGB; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria.GameInput; - -namespace Terraria.GameContent -{ - public class ChromaHotkeyPainter - { - private readonly Dictionary _keys = new Dictionary(); - private readonly List _reactiveKeys = new List(); - private List _xnaKeysInUse = new List(); - private Player _player; - private int _quickHealAlert; - private List _wasdKeys = new List(); - private ChromaHotkeyPainter.PaintKey _healKey; - private ChromaHotkeyPainter.PaintKey _mountKey; - private ChromaHotkeyPainter.PaintKey _jumpKey; - private ChromaHotkeyPainter.PaintKey _grappleKey; - private ChromaHotkeyPainter.PaintKey _throwKey; - private ChromaHotkeyPainter.PaintKey _manaKey; - private ChromaHotkeyPainter.PaintKey _buffKey; - private ChromaHotkeyPainter.PaintKey _smartCursorKey; - private ChromaHotkeyPainter.PaintKey _smartSelectKey; - - public bool PotionAlert => (uint) this._quickHealAlert > 0U; - - public void CollectBoundKeys() - { - foreach (KeyValuePair key in this._keys) - key.Value.Unbind(); - this._keys.Clear(); - foreach (KeyValuePair> keyStatu in PlayerInput.CurrentProfile.InputModes[InputMode.Keyboard].KeyStatus) - this._keys.Add(keyStatu.Key, new ChromaHotkeyPainter.PaintKey(keyStatu.Key, keyStatu.Value)); - foreach (KeyValuePair key in this._keys) - key.Value.Bind(); - this._wasdKeys = new List() - { - this._keys["Up"], - this._keys["Down"], - this._keys["Left"], - this._keys["Right"] - }; - this._healKey = this._keys["QuickHeal"]; - this._mountKey = this._keys["QuickMount"]; - this._jumpKey = this._keys["Jump"]; - this._grappleKey = this._keys["Grapple"]; - this._throwKey = this._keys["Throw"]; - this._manaKey = this._keys["QuickMana"]; - this._buffKey = this._keys["QuickBuff"]; - this._smartCursorKey = this._keys["SmartCursor"]; - this._smartSelectKey = this._keys["SmartSelect"]; - this._reactiveKeys.Clear(); - this._xnaKeysInUse.Clear(); - foreach (KeyValuePair key in this._keys) - this._xnaKeysInUse.AddRange((IEnumerable) key.Value.GetXNAKeysInUse()); - this._xnaKeysInUse = this._xnaKeysInUse.Distinct().ToList(); - } - - public void PressKey(Keys key) - { - } - - private ChromaHotkeyPainter.ReactiveRGBKey FindReactiveKey(Keys keyTarget) => this._reactiveKeys.FirstOrDefault((Func) (x => x.XNAKey == keyTarget)); - - public void Update() - { - this._player = Main.LocalPlayer; - if (!Main.hasFocus) - { - this.Step_ClearAll(); - } - else - { - if (this.PotionAlert) - { - foreach (KeyValuePair key in this._keys) - { - if (key.Key != "QuickHeal") - key.Value.SetClear(); - } - this.Step_QuickHeal(); - } - else - { - this.Step_Movement(); - this.Step_QuickHeal(); - } - if (Main.InGameUI.CurrentState == Main.ManageControlsMenu) - { - this.Step_ClearAll(); - this.Step_KeybindsMenu(); - } - this.Step_UpdateReactiveKeys(); - } - } - - private void SetGroupColorBase(List keys, Color color) - { - foreach (ChromaHotkeyPainter.PaintKey key in keys) - key.SetSolid(color); - } - - private void SetGroupClear(List keys) - { - foreach (ChromaHotkeyPainter.PaintKey key in keys) - key.SetClear(); - } - - private void Step_KeybindsMenu() - { - this.SetGroupColorBase(this._wasdKeys, ChromaHotkeyPainter.PainterColors.MovementKeys); - this._jumpKey.SetSolid(ChromaHotkeyPainter.PainterColors.MovementKeys); - this._grappleKey.SetSolid(ChromaHotkeyPainter.PainterColors.QuickGrapple); - this._mountKey.SetSolid(ChromaHotkeyPainter.PainterColors.QuickMount); - this._quickHealAlert = 0; - this._healKey.SetSolid(ChromaHotkeyPainter.PainterColors.QuickHealReady); - this._manaKey.SetSolid(ChromaHotkeyPainter.PainterColors.QuickMana); - this._throwKey.SetSolid(ChromaHotkeyPainter.PainterColors.Throw); - this._smartCursorKey.SetSolid(ChromaHotkeyPainter.PainterColors.SmartCursor); - this._smartSelectKey.SetSolid(ChromaHotkeyPainter.PainterColors.SmartSelect); - } - - private void Step_UpdateReactiveKeys() - { - foreach (ChromaHotkeyPainter.ReactiveRGBKey reactiveRgbKey in this._reactiveKeys.FindAll((Predicate) (x => x.Expired))) - { - ChromaHotkeyPainter.ReactiveRGBKey key = reactiveRgbKey; - key.Clear(); - if (!this._keys.Any>((Func, bool>) (x => x.Value.UsesKey(key.XNAKey)))) - key.Unbind(); - } - this._reactiveKeys.RemoveAll((Predicate) (x => x.Expired)); - foreach (ChromaHotkeyPainter.ReactiveRGBKey reactiveKey in this._reactiveKeys) - reactiveKey.Update(); - } - - private void Step_ClearAll() - { - foreach (KeyValuePair key in this._keys) - key.Value.SetClear(); - } - - private void Step_SmartKeys() - { - ChromaHotkeyPainter.PaintKey smartCursorKey = this._smartCursorKey; - ChromaHotkeyPainter.PaintKey smartSelectKey = this._smartSelectKey; - if (this._player.DeadOrGhost || this._player.frozen || this._player.tongued || this._player.webbed || this._player.stoned || this._player.noItems) - { - smartCursorKey.SetClear(); - smartSelectKey.SetClear(); - } - else - { - if (Main.SmartCursorEnabled) - smartCursorKey.SetSolid(ChromaHotkeyPainter.PainterColors.SmartCursor); - else - smartCursorKey.SetClear(); - if (this._player.nonTorch >= 0) - smartSelectKey.SetSolid(ChromaHotkeyPainter.PainterColors.SmartSelect); - else - smartSelectKey.SetClear(); - } - } - - private void Step_Movement() - { - List wasdKeys = this._wasdKeys; - bool flag = this._player.frozen || this._player.tongued || this._player.webbed || this._player.stoned; - if (this._player.DeadOrGhost) - this.SetGroupClear(wasdKeys); - else if (flag) - this.SetGroupColorBase(wasdKeys, ChromaHotkeyPainter.PainterColors.DangerKeyBlocked); - else - this.SetGroupColorBase(wasdKeys, ChromaHotkeyPainter.PainterColors.MovementKeys); - } - - private void Step_Mount() - { - ChromaHotkeyPainter.PaintKey mountKey = this._mountKey; - if (this._player.QuickMount_GetItemToUse() == null || this._player.DeadOrGhost) - mountKey.SetClear(); - else if (this._player.frozen || this._player.tongued || this._player.webbed || this._player.stoned || (double) this._player.gravDir == -1.0 || this._player.noItems) - { - mountKey.SetSolid(ChromaHotkeyPainter.PainterColors.DangerKeyBlocked); - if ((double) this._player.gravDir != -1.0) - return; - mountKey.SetSolid(ChromaHotkeyPainter.PainterColors.DangerKeyBlocked * 0.6f); - } - else - mountKey.SetSolid(ChromaHotkeyPainter.PainterColors.QuickMount); - } - - private void Step_Grapple() - { - ChromaHotkeyPainter.PaintKey grappleKey = this._grappleKey; - if (this._player.QuickGrapple_GetItemToUse() == null || this._player.DeadOrGhost) - grappleKey.SetClear(); - else if (this._player.frozen || this._player.tongued || this._player.webbed || this._player.stoned || this._player.noItems) - grappleKey.SetSolid(ChromaHotkeyPainter.PainterColors.DangerKeyBlocked); - else - grappleKey.SetSolid(ChromaHotkeyPainter.PainterColors.QuickGrapple); - } - - private void Step_Jump() - { - ChromaHotkeyPainter.PaintKey jumpKey = this._jumpKey; - if (this._player.DeadOrGhost) - jumpKey.SetClear(); - else if (this._player.frozen || this._player.tongued || this._player.webbed || this._player.stoned) - jumpKey.SetSolid(ChromaHotkeyPainter.PainterColors.DangerKeyBlocked); - else - jumpKey.SetSolid(ChromaHotkeyPainter.PainterColors.MovementKeys); - } - - private void Step_QuickHeal() - { - ChromaHotkeyPainter.PaintKey healKey = this._healKey; - if (this._player.QuickHeal_GetItemToUse() == null || this._player.DeadOrGhost) - { - healKey.SetClear(); - this._quickHealAlert = 0; - } - else if (this._player.potionDelay > 0) - { - float lerpValue = Utils.GetLerpValue((float) this._player.potionDelayTime, 0.0f, (float) this._player.potionDelay, true); - Color color = Color.Lerp(ChromaHotkeyPainter.PainterColors.DangerKeyBlocked, ChromaHotkeyPainter.PainterColors.QuickHealCooldown, lerpValue) * lerpValue * lerpValue * lerpValue; - healKey.SetSolid(color); - this._quickHealAlert = 0; - } - else if (this._player.statLife == this._player.statLifeMax2) - { - healKey.SetClear(); - this._quickHealAlert = 0; - } - else if ((double) this._player.statLife <= (double) this._player.statLifeMax2 / 4.0) - { - if (this._quickHealAlert == 1) - return; - this._quickHealAlert = 1; - healKey.SetAlert(Color.Black, ChromaHotkeyPainter.PainterColors.QuickHealReadyUrgent, -1f, 2f); - } - else if ((double) this._player.statLife <= (double) this._player.statLifeMax2 / 2.0) - { - if (this._quickHealAlert == 2) - return; - this._quickHealAlert = 2; - healKey.SetAlert(Color.Black, ChromaHotkeyPainter.PainterColors.QuickHealReadyUrgent, -1f, 2f); - } - else - { - healKey.SetSolid(ChromaHotkeyPainter.PainterColors.QuickHealReady); - this._quickHealAlert = 0; - } - } - - private void Step_QuickMana() - { - ChromaHotkeyPainter.PaintKey manaKey = this._manaKey; - if (this._player.QuickMana_GetItemToUse() == null || this._player.DeadOrGhost || this._player.statMana == this._player.statManaMax2) - manaKey.SetClear(); - else - manaKey.SetSolid(ChromaHotkeyPainter.PainterColors.QuickMana); - } - - private void Step_Throw() - { - ChromaHotkeyPainter.PaintKey throwKey = this._throwKey; - Item heldItem = this._player.HeldItem; - if (this._player.DeadOrGhost || this._player.HeldItem.favorited || this._player.noThrow > 0) - throwKey.SetClear(); - else if (this._player.frozen || this._player.tongued || this._player.webbed || this._player.stoned || this._player.noItems) - throwKey.SetClear(); - else - throwKey.SetSolid(ChromaHotkeyPainter.PainterColors.Throw); - } - - private class ReactiveRGBKey - { - public readonly Keys XNAKey; - private readonly Color _color; - private readonly TimeSpan _duration; - private TimeSpan _startTime; - private TimeSpan _expireTime; - private RgbKey _rgbKey; - - public bool Expired => this._expireTime < Main.gameTimeCache.TotalGameTime; - - public ReactiveRGBKey(Keys key, Color color, TimeSpan duration) - { - this._color = color; - this.XNAKey = key; - this._duration = duration; - this._startTime = Main.gameTimeCache.TotalGameTime; - } - - public void Update() => this._rgbKey.SetSolid(Color.Lerp(this._color, Color.Black, (float) Utils.GetLerpValue(this._startTime.TotalSeconds, this._expireTime.TotalSeconds, Main.gameTimeCache.TotalGameTime.TotalSeconds, true))); - - public void Clear() => this._rgbKey.Clear(); - - public void Unbind() => Main.Chroma.UnbindKey(this.XNAKey); - - public void Bind() => this._rgbKey = Main.Chroma.BindKey(this.XNAKey); - - public void Refresh() - { - this._startTime = Main.gameTimeCache.TotalGameTime; - this._expireTime = this._startTime; - this._expireTime.Add(this._duration); - } - } - - private class PaintKey - { - private string _trigger; - private List _xnaKeys; - private List _rgbKeys; - - public PaintKey(string triggerName, List keys) - { - this._trigger = triggerName; - this._xnaKeys = new List(); - foreach (string key in keys) - { - Keys result; - if (Enum.TryParse(key, true, out result)) - this._xnaKeys.Add(result); - } - this._rgbKeys = new List(); - } - - public void Unbind() - { - foreach (RgbKey rgbKey in this._rgbKeys) - Main.Chroma.UnbindKey((Keys) rgbKey.Key); - } - - public void Bind() - { - foreach (Keys xnaKey in this._xnaKeys) - this._rgbKeys.Add(Main.Chroma.BindKey(xnaKey)); - this._rgbKeys = ((IEnumerable) this._rgbKeys).Distinct().ToList(); - } - - public void SetSolid(Color color) - { - foreach (RgbKey rgbKey in this._rgbKeys) - rgbKey.SetSolid(color); - } - - public void SetClear() - { - foreach (RgbKey rgbKey in this._rgbKeys) - rgbKey.Clear(); - } - - public bool UsesKey(Keys key) => this._xnaKeys.Contains(key); - - public void SetAlert(Color colorBase, Color colorFlash, float time, float flashesPerSecond) - { - if ((double) time == -1.0) - time = 10000f; - foreach (RgbKey rgbKey in this._rgbKeys) - rgbKey.SetFlashing(colorBase, colorFlash, time, flashesPerSecond); - } - - public List GetXNAKeysInUse() => new List((IEnumerable) this._xnaKeys); - } - - private static class PainterColors - { - private const float HOTKEY_COLOR_MULTIPLIER = 1f; - public static readonly Color MovementKeys = Color.Gray * 1f; - public static readonly Color QuickMount = Color.RoyalBlue * 1f; - public static readonly Color QuickGrapple = Color.Lerp(Color.RoyalBlue, Color.Blue, 0.5f) * 1f; - public static readonly Color QuickHealReady = Color.Pink * 1f; - public static readonly Color QuickHealReadyUrgent = Color.DeepPink * 1f; - public static readonly Color QuickHealCooldown = Color.HotPink * 0.5f * 1f; - public static readonly Color QuickMana = new Color(40, 0, 230) * 1f; - public static readonly Color Throw = Color.Red * 0.2f * 1f; - public static readonly Color SmartCursor = Color.Gold; - public static readonly Color SmartSelect = Color.Goldenrod; - public static readonly Color DangerKeyBlocked = Color.Red * 1f; - } - } -} diff --git a/GameContent/ChumBucketProjectileHelper.cs b/GameContent/ChumBucketProjectileHelper.cs deleted file mode 100644 index 6f05021..0000000 --- a/GameContent/ChumBucketProjectileHelper.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ChumBucketProjectileHelper -// 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; -using System.Collections.Generic; - -namespace Terraria.GameContent -{ - public class ChumBucketProjectileHelper - { - private Dictionary _chumCountsPendingForThisFrame = new Dictionary(); - private Dictionary _chumCountsFromLastFrame = new Dictionary(); - - public void OnPreUpdateAllProjectiles() - { - Utils.Swap>(ref this._chumCountsPendingForThisFrame, ref this._chumCountsFromLastFrame); - this._chumCountsPendingForThisFrame.Clear(); - } - - public void AddChumLocation(Vector2 spot) - { - Point tileCoordinates = spot.ToTileCoordinates(); - int num1 = 0; - this._chumCountsPendingForThisFrame.TryGetValue(tileCoordinates, out num1); - int num2 = num1 + 1; - this._chumCountsPendingForThisFrame[tileCoordinates] = num2; - } - - public int GetChumsInLocation(Point tileCoords) - { - int num = 0; - this._chumCountsFromLastFrame.TryGetValue(tileCoords, out num); - return num; - } - } -} diff --git a/GameContent/CoinLossRevengeSystem.cs b/GameContent/CoinLossRevengeSystem.cs deleted file mode 100644 index e9b41e4..0000000 --- a/GameContent/CoinLossRevengeSystem.cs +++ /dev/null @@ -1,431 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.CoinLossRevengeSystem -// 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; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Terraria.GameContent.Events; -using Terraria.ID; -using Terraria.UI; - -namespace Terraria.GameContent -{ - public class CoinLossRevengeSystem - { - public static bool DisplayCaching = false; - public static int MinimumCoinsForCaching = Item.buyPrice(silver: 10); - private const int PLAYER_BOX_WIDTH_INNER = 1968; - private const int PLAYER_BOX_HEIGHT_INNER = 1200; - private const int PLAYER_BOX_WIDTH_OUTER = 2608; - private const int PLAYER_BOX_HEIGHT_OUTER = 1840; - private static readonly Vector2 _playerBoxSizeInner = new Vector2(1968f, 1200f); - private static readonly Vector2 _playerBoxSizeOuter = new Vector2(2608f, 1840f); - private List _markers; - private readonly object _markersLock = new object(); - private int _gameTime; - - public void AddMarkerFromReader(BinaryReader reader) - { - int num1 = reader.ReadInt32(); - Vector2 coords = reader.ReadVector2(); - int num2 = reader.ReadInt32(); - float num3 = reader.ReadSingle(); - int num4 = reader.ReadInt32(); - int num5 = reader.ReadInt32(); - int num6 = reader.ReadInt32(); - float num7 = reader.ReadSingle(); - bool flag = reader.ReadBoolean(); - int npcNetId = num2; - double num8 = (double) num3; - int npcType = num4; - int npcAiStyle = num5; - int coinValue = num6; - double num9 = (double) num7; - int num10 = flag ? 1 : 0; - int gameTime = this._gameTime; - int uniqueID = num1; - this.AddMarker(new CoinLossRevengeSystem.RevengeMarker(coords, npcNetId, (float) num8, npcType, npcAiStyle, coinValue, (float) num9, num10 != 0, gameTime, uniqueID)); - } - - private void AddMarker(CoinLossRevengeSystem.RevengeMarker marker) - { - lock (this._markersLock) - this._markers.Add(marker); - } - - public void DestroyMarker(int markerUniqueID) - { - lock (this._markersLock) - this._markers.RemoveAll((Predicate) (x => x.UniqueID == markerUniqueID)); - } - - public CoinLossRevengeSystem() => this._markers = new List(); - - public void CacheEnemy(NPC npc) - { - if (npc.boss || npc.realLife != -1 || npc.rarity > 0 || npc.extraValue < CoinLossRevengeSystem.MinimumCoinsForCaching || (double) npc.position.X < (double) Main.leftWorld + 640.0 + 16.0 || (double) npc.position.X + (double) npc.width > (double) Main.rightWorld - 640.0 - 32.0 || (double) npc.position.Y < (double) Main.topWorld + 640.0 + 16.0 || (double) npc.position.Y > (double) Main.bottomWorld - 640.0 - 32.0 - (double) npc.height) - return; - int num1 = npc.netID; - int num2; - if (NPCID.Sets.RespawnEnemyID.TryGetValue(num1, out num2)) - num1 = num2; - if (num1 == 0) - return; - CoinLossRevengeSystem.RevengeMarker marker = new CoinLossRevengeSystem.RevengeMarker(npc.Center, num1, npc.GetLifePercent(), npc.type, npc.aiStyle, npc.extraValue, npc.value, npc.SpawnedFromStatue, this._gameTime); - this.AddMarker(marker); - if (Main.netMode == 2) - NetMessage.SendCoinLossRevengeMarker(marker); - if (!CoinLossRevengeSystem.DisplayCaching) - return; - Main.NewText("Cached " + npc.GivenOrTypeName); - } - - public void Reset() - { - lock (this._markersLock) - this._markers.Clear(); - this._gameTime = 0; - } - - public void Update() - { - ++this._gameTime; - if (Main.netMode != 1 || this._gameTime % 60 != 0) - return; - this.RemoveExpiredOrInvalidMarkers(); - } - - public void CheckRespawns() - { - lock (this._markersLock) - { - if (this._markers.Count == 0) - return; - } - List> tupleList = new List>(); - for (int index = 0; index < (int) byte.MaxValue; ++index) - { - Player player = Main.player[index]; - if (player.active && !player.dead) - tupleList.Add(Tuple.Create(index, Utils.CenteredRectangle(player.Center, CoinLossRevengeSystem._playerBoxSizeInner), Utils.CenteredRectangle(player.Center, CoinLossRevengeSystem._playerBoxSizeOuter))); - } - if (tupleList.Count == 0) - return; - this.RemoveExpiredOrInvalidMarkers(); - lock (this._markersLock) - { - List revengeMarkerList = new List(); - for (int index = 0; index < this._markers.Count; ++index) - { - CoinLossRevengeSystem.RevengeMarker marker = this._markers[index]; - bool flag = false; - Tuple tuple1 = (Tuple) null; - foreach (Tuple tuple2 in tupleList) - { - if (marker.Intersects(tuple2.Item2, tuple2.Item3)) - { - tuple1 = tuple2; - flag = true; - break; - } - } - if (!flag) - marker.SetRespawnAttemptLock(false); - else if (!marker.RespawnAttemptLocked) - { - marker.SetRespawnAttemptLock(true); - if (marker.WouldNPCBeDiscouraged(Main.player[tuple1.Item1])) - { - marker.SetToExpire(); - } - else - { - marker.SpawnEnemy(); - revengeMarkerList.Add(marker); - } - } - } - this._markers = this._markers.Except((IEnumerable) revengeMarkerList).ToList(); - } - } - - private void RemoveExpiredOrInvalidMarkers() - { - lock (this._markersLock) - { - this._markers.Where((Func) (x => x.IsExpired(this._gameTime))); - this._markers.Where((Func) (x => x.IsInvalid())); - this._markers.RemoveAll((Predicate) (x => x.IsInvalid())); - this._markers.RemoveAll((Predicate) (x => x.IsExpired(this._gameTime))); - } - } - - public CoinLossRevengeSystem.RevengeMarker DrawMapIcons( - SpriteBatch spriteBatch, - Vector2 mapTopLeft, - Vector2 mapX2Y2AndOff, - Rectangle? mapRect, - float mapScale, - float drawScale, - ref string unused) - { - CoinLossRevengeSystem.RevengeMarker revengeMarker = (CoinLossRevengeSystem.RevengeMarker) null; - lock (this._markersLock) - { - foreach (CoinLossRevengeSystem.RevengeMarker marker in this._markers) - { - if (marker.DrawMapIcon(spriteBatch, mapTopLeft, mapX2Y2AndOff, mapRect, mapScale, drawScale, this._gameTime)) - revengeMarker = marker; - } - } - return revengeMarker; - } - - public void SendAllMarkersToPlayer(int plr) - { - lock (this._markersLock) - { - foreach (CoinLossRevengeSystem.RevengeMarker marker in this._markers) - NetMessage.SendCoinLossRevengeMarker(marker, plr); - } - } - - public class RevengeMarker - { - private static int _uniqueIDCounter = 0; - private static readonly int _expirationCompCopper = Item.buyPrice(copper: 1); - private static readonly int _expirationCompSilver = Item.buyPrice(silver: 1); - private static readonly int _expirationCompGold = Item.buyPrice(gold: 1); - private static readonly int _expirationCompPlat = Item.buyPrice(1); - private const int ONE_MINUTE = 3600; - private const int ENEMY_BOX_WIDTH = 2160; - private const int ENEMY_BOX_HEIGHT = 1440; - public static readonly Vector2 EnemyBoxSize = new Vector2(2160f, 1440f); - private readonly Vector2 _location; - private readonly Rectangle _hitbox; - private readonly int _npcNetID; - private readonly float _npcHPPercent; - private readonly float _baseValue; - private readonly int _coinsValue; - private readonly int _npcTypeAgainstDiscouragement; - private readonly int _npcAIStyleAgainstDiscouragement; - private readonly int _expirationTime; - private readonly bool _spawnedFromStatue; - private readonly int _uniqueID; - private bool _forceExpire; - private bool _attemptedRespawn; - - public void SetToExpire() => this._forceExpire = true; - - public bool RespawnAttemptLocked => this._attemptedRespawn; - - public void SetRespawnAttemptLock(bool state) => this._attemptedRespawn = state; - - public RevengeMarker( - Vector2 coords, - int npcNetId, - float npcHPPercent, - int npcType, - int npcAiStyle, - int coinValue, - float baseValue, - bool spawnedFromStatue, - int gameTime, - int uniqueID = -1) - { - this._location = coords; - this._npcNetID = npcNetId; - this._npcHPPercent = npcHPPercent; - this._npcTypeAgainstDiscouragement = npcType; - this._npcAIStyleAgainstDiscouragement = npcAiStyle; - this._coinsValue = coinValue; - this._baseValue = baseValue; - this._spawnedFromStatue = spawnedFromStatue; - this._hitbox = Utils.CenteredRectangle(this._location, CoinLossRevengeSystem.RevengeMarker.EnemyBoxSize); - this._expirationTime = this.CalculateExpirationTime(gameTime, coinValue); - if (uniqueID == -1) - this._uniqueID = CoinLossRevengeSystem.RevengeMarker._uniqueIDCounter++; - else - this._uniqueID = uniqueID; - } - - public bool IsInvalid() - { - int npcInvasionGroup = NPC.GetNPCInvasionGroup(this._npcTypeAgainstDiscouragement); - switch (npcInvasionGroup) - { - case -3: - return !DD2Event.Ongoing; - case -2: - return !Main.pumpkinMoon || Main.dayTime; - case -1: - return !Main.snowMoon || Main.dayTime; - case 1: - case 2: - case 3: - case 4: - return npcInvasionGroup != Main.invasionType; - default: - switch (this._npcTypeAgainstDiscouragement) - { - case 158: - case 159: - case 162: - case 166: - case 251: - case 253: - case 460: - case 461: - case 462: - case 463: - case 466: - case 467: - case 468: - case 469: - case 477: - case 478: - case 479: - if (!Main.eclipse || !Main.dayTime) - return true; - break; - } - return false; - } - } - - public bool IsExpired(int gameTime) => this._forceExpire || this._expirationTime <= gameTime; - - private int CalculateExpirationTime(int gameCacheTime, int coinValue) - { - int num = (coinValue >= CoinLossRevengeSystem.RevengeMarker._expirationCompSilver ? (coinValue >= CoinLossRevengeSystem.RevengeMarker._expirationCompGold ? (coinValue >= CoinLossRevengeSystem.RevengeMarker._expirationCompPlat ? 432000 : (int) MathHelper.Lerp(108000f, 216000f, Utils.GetLerpValue((float) CoinLossRevengeSystem.RevengeMarker._expirationCompSilver, (float) CoinLossRevengeSystem.RevengeMarker._expirationCompGold, (float) coinValue, false))) : (int) MathHelper.Lerp(36000f, 108000f, Utils.GetLerpValue((float) CoinLossRevengeSystem.RevengeMarker._expirationCompSilver, (float) CoinLossRevengeSystem.RevengeMarker._expirationCompGold, (float) coinValue, false))) : (int) MathHelper.Lerp(0.0f, 3600f, Utils.GetLerpValue((float) CoinLossRevengeSystem.RevengeMarker._expirationCompCopper, (float) CoinLossRevengeSystem.RevengeMarker._expirationCompSilver, (float) coinValue, false))) + 18000; - return gameCacheTime + num; - } - - public bool Intersects(Rectangle rectInner, Rectangle rectOuter) => rectOuter.Intersects(this._hitbox); - - public void SpawnEnemy() - { - int number = NPC.NewNPC((int) this._location.X, (int) this._location.Y, this._npcNetID); - NPC npc = Main.npc[number]; - if (this._npcNetID < 0) - npc.SetDefaults(this._npcNetID); - int num1; - if (NPCID.Sets.SpecialSpawningRules.TryGetValue(this._npcNetID, out num1) && num1 == 0) - { - Point tileCoordinates = npc.position.ToTileCoordinates(); - npc.ai[0] = (float) tileCoordinates.X; - npc.ai[1] = (float) tileCoordinates.Y; - npc.netUpdate = true; - } - npc.timeLeft += 3600; - npc.extraValue = this._coinsValue; - npc.value = this._baseValue; - npc.SpawnedFromStatue = this._spawnedFromStatue; - float num2 = Math.Max(0.5f, this._npcHPPercent); - npc.life = (int) ((double) npc.lifeMax * (double) num2); - if (number < 200) - { - if (Main.netMode == 0) - { - npc.moneyPing(this._location); - } - else - { - NetMessage.SendData(23, number: number); - NetMessage.SendData(92, number: number, number2: ((float) this._coinsValue), number3: this._location.X, number4: this._location.Y); - } - } - if (!CoinLossRevengeSystem.DisplayCaching) - return; - Main.NewText("Spawned " + npc.GivenOrTypeName); - } - - public bool WouldNPCBeDiscouraged(Player playerTarget) - { - switch (this._npcAIStyleAgainstDiscouragement) - { - case 2: - return NPC.DespawnEncouragement_AIStyle2_FloatingEye_IsDiscouraged(this._npcTypeAgainstDiscouragement, playerTarget.position); - case 3: - return !NPC.DespawnEncouragement_AIStyle3_Fighters_NotDiscouraged(this._npcTypeAgainstDiscouragement, playerTarget.position, (NPC) null); - case 6: - bool flag = false; - switch (this._npcTypeAgainstDiscouragement) - { - case 10: - case 39: - case 95: - case 117: - case 510: - flag = true; - break; - case 513: - flag = !playerTarget.ZoneUndergroundDesert; - break; - } - return flag && (double) playerTarget.position.Y < Main.worldSurface * 16.0; - default: - switch (this._npcNetID) - { - case 253: - return !Main.eclipse; - case 490: - return Main.dayTime; - default: - return false; - } - } - } - - public bool DrawMapIcon( - SpriteBatch spriteBatch, - Vector2 mapTopLeft, - Vector2 mapX2Y2AndOff, - Rectangle? mapRect, - float mapScale, - float drawScale, - int gameTime) - { - Vector2 vector2 = (this._location / 16f - mapTopLeft) * mapScale + mapX2Y2AndOff; - if (mapRect.HasValue && !mapRect.Value.Contains(vector2.ToPoint())) - return false; - Texture2D texture2D1 = TextureAssets.MapDeath.Value; - Texture2D texture2D2 = this._coinsValue >= 100 ? (this._coinsValue >= 10000 ? (this._coinsValue >= 1000000 ? TextureAssets.Coin[3].Value : TextureAssets.Coin[2].Value) : TextureAssets.Coin[1].Value) : TextureAssets.Coin[0].Value; - Rectangle r = texture2D2.Frame(verticalFrames: 8); - spriteBatch.Draw(texture2D2, vector2, new Rectangle?(r), Color.White, 0.0f, r.Size() / 2f, drawScale, SpriteEffects.None, 0.0f); - return Utils.CenteredRectangle(vector2, r.Size() * drawScale).Contains(Main.MouseScreen.ToPoint()); - } - - public void UseMouseOver( - SpriteBatch spriteBatch, - ref string mouseTextString, - float drawScale = 1f) - { - mouseTextString = ""; - Vector2 vector2 = Main.MouseScreen / drawScale + new Vector2(-28f) + new Vector2(4f, 0.0f); - ItemSlot.DrawMoney(spriteBatch, "", vector2.X, vector2.Y, Utils.CoinsSplit((long) this._coinsValue), true); - } - - public int UniqueID => this._uniqueID; - - public void WriteSelfTo(BinaryWriter writer) - { - writer.Write(this._uniqueID); - writer.WriteVector2(this._location); - writer.Write(this._npcNetID); - writer.Write(this._npcHPPercent); - writer.Write(this._npcTypeAgainstDiscouragement); - writer.Write(this._npcAIStyleAgainstDiscouragement); - writer.Write(this._coinsValue); - writer.Write(this._baseValue); - writer.Write(this._spawnedFromStatue); - } - } - } -} diff --git a/GameContent/ContentRejectionFromSize.cs b/GameContent/ContentRejectionFromSize.cs deleted file mode 100644 index a4b5d12..0000000 --- a/GameContent/ContentRejectionFromSize.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ContentRejectionFromSize -// 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.Content; -using Terraria.Localization; - -namespace Terraria.GameContent -{ - public class ContentRejectionFromSize : IRejectionReason - { - private int _neededWidth; - private int _neededHeight; - private int _actualWidth; - private int _actualHeight; - - public ContentRejectionFromSize( - int neededWidth, - int neededHeight, - int actualWidth, - int actualHeight) - { - this._neededWidth = neededWidth; - this._neededHeight = neededHeight; - this._actualWidth = actualWidth; - this._actualHeight = actualHeight; - } - - public string GetReason() => Language.GetTextValueWith("AssetRejections.BadSize", (object) new - { - NeededWidth = this._neededWidth, - NeededHeight = this._neededHeight, - ActualWidth = this._actualWidth, - ActualHeight = this._actualHeight - }); - } -} diff --git a/GameContent/Creative/Content/Sacrifices.tsv b/GameContent/Creative/Content/Sacrifices.tsv deleted file mode 100644 index bbc79f0..0000000 --- a/GameContent/Creative/Content/Sacrifices.tsv +++ /dev/null @@ -1,5095 +0,0 @@ -//A - 50 B - 25 C - 5 D - 1 E - Invalid 2 f 3 g 10 h 15 i 30 j 99 k 100 l 200 m N - 20 O - 400 -//ItemID RarityCategoryId SpecialTags Notes -YellowPhasesaberOld E -WhitePhasesaberOld E -PurplePhasesaberOld E -GreenPhasesaberOld E -RedPhasesaberOld E -BluePhasesaberOld E -PlatinumBowOld E -PlatinumHammerOld E -PlatinumAxeOld E -PlatinumShortswordOld E -PlatinumBroadswordOld E -PlatinumPickaxeOld E -TungstenBowOld E -TungstenHammerOld E -TungstenAxeOld E -TungstenShortswordOld E -TungstenBroadswordOld E -TungstenPickaxeOld E -LeadBowOld E -LeadHammerOld E -LeadAxeOld E -LeadShortswordOld E -LeadBroadswordOld E -LeadPickaxeOld E -TinBowOld E -TinHammerOld E -TinAxeOld E -TinShortswordOld E -TinBroadswordOld E -TinPickaxeOld E -CopperBowOld E -CopperHammerOld E -CopperAxeOld E -CopperShortswordOld E -CopperBroadswordOld E -CopperPickaxeOld E -SilverBowOld E -SilverHammerOld E -SilverAxeOld E -SilverShortswordOld E -SilverBroadswordOld E -SilverPickaxeOld E -GoldBowOld E -GoldHammerOld E -GoldAxeOld E -GoldShortswordOld E -GoldBroadswordOld E -GoldPickaxeOld E -None E -IronPickaxe D -DirtBlock L -StoneBlock L -IronBroadsword D -Mushroom J -IronShortsword D -IronHammer D -Torch L -Wood L -IronAxe D -IronOre L -CopperOre L -GoldOre L -SilverOre L -CopperWatch D -SilverWatch D -GoldWatch D -DepthMeter D -GoldBar B -CopperBar B -SilverBar B -IronBar B -Gel K -WoodenSword D -WoodenDoor D -StoneWall O -Acorn A -LesserHealingPotion J -LifeCrystal H -DirtWall O -Bottle B -WoodenTable D -Furnace D -WoodenChair D -IronAnvil D -WorkBench D -Goggles D -Lens B -WoodenBow D -WoodenArrow K -FlamingArrow K -Shuriken K -SuspiciousLookingEye G -DemonBow D -WarAxeoftheNight D -LightsBane D -UnholyArrow K -Chest D -BandofRegeneration D -MagicMirror D -JestersArrow K -AngelStatue D -CloudinaBottle D -HermesBoots D -EnchantedBoomerang D -DemoniteOre L -DemoniteBar B -Heart E -CorruptSeeds B -VileMushroom B -EbonstoneBlock L -GrassSeeds B -Sunflower C -Vilethorn D -Starfury D -PurificationPowder K -VilePowder K -RottenChunk B -WormTooth B -WormFood G -CopperCoin L -SilverCoin L -GoldCoin L -PlatinumCoin L -FallenStar A -CopperGreaves D -IronGreaves D -SilverGreaves D -GoldGreaves D -CopperChainmail D -IronChainmail D -SilverChainmail D -GoldChainmail D -GrapplingHook D -Chain L -ShadowScale B -PiggyBank D -MiningHelmet D -CopperHelmet D -IronHelmet D -SilverHelmet D -GoldHelmet D -WoodWall O -WoodPlatform M -FlintlockPistol D -Musket D -MusketBall K -Minishark D -IronBow D -ShadowGreaves D -ShadowScalemail D -ShadowHelmet D -NightmarePickaxe D -TheBreaker D -Candle D -CopperChandelier D -SilverChandelier D -GoldChandelier D -ManaCrystal H -LesserManaPotion J -BandofStarpower D -FlowerofFire D -MagicMissile D -DirtRod D -ShadowOrb D -Meteorite L -MeteoriteBar B -Hook D -Flamarang D -MoltenFury D -FieryGreatsword D -MoltenPickaxe D -MeteorHelmet D -MeteorSuit D -MeteorLeggings D -BottledWater J -SpaceGun D -RocketBoots D -GrayBrick L -GrayBrickWall O -RedBrick L -RedBrickWall O -ClayBlock L -BlueBrick L -BlueBrickWall O -ChainLantern D -GreenBrick L -GreenBrickWall O -PinkBrick L -PinkBrickWall O -GoldBrick L -GoldBrickWall O -SilverBrick L -SilverBrickWall O -CopperBrick L -CopperBrickWall O -Spike L -WaterCandle D -Book B -Cobweb A -NecroHelmet D -NecroBreastplate D -NecroGreaves D -Bone K -Muramasa D -CobaltShield D -AquaScepter D -LuckyHorseshoe D -ShinyRedBalloon D -Harpoon D -SpikyBall K -BallOHurt D -BlueMoon D -Handgun D -WaterBolt D -Bomb K -Dynamite K -Grenade K -SandBlock L -Glass L -Sign D -AshBlock L -Obsidian L -Hellstone L -HellstoneBar B -MudBlock L -Sapphire I -Ruby I -Emerald I -Topaz I -Amethyst I -Diamond I -GlowingMushroom L -Star E -IvyWhip D -BreathingReed D -Flipper D -HealingPotion J -ManaPotion J -BladeofGrass D -ThornChakram D -ObsidianBrick L -ObsidianSkull D -MushroomGrassSeeds B -JungleGrassSeeds B -WoodenHammer D -StarCannon D -BluePhaseblade D -RedPhaseblade D -GreenPhaseblade D -PurplePhaseblade D -WhitePhaseblade D -YellowPhaseblade D -MeteorHamaxe D -EmptyBucket D -WaterBucket D -LavaBucket D -JungleRose D -Stinger B -Vine C -FeralClaws D -AnkletoftheWind D -StaffofRegrowth D -HellstoneBrick L -WhoopieCushion D -Shackle D -MoltenHamaxe D -Flamelash D -PhoenixBlaster D -Sunfury D -Hellforge D -ClayPot D -NaturesGift D -Bed D -Silk B -LesserRestorationPotion J -RestorationPotion J -JungleHat D -JungleShirt D -JunglePants D -MoltenHelmet D -MoltenBreastplate D -MoltenGreaves D -MeteorShot K -StickyBomb K -BlackLens D -Sunglasses D -WizardHat D -TopHat D -TuxedoShirt D -TuxedoPants D -SummerHat D -BunnyHood D -PlumbersHat D -PlumbersShirt D -PlumbersPants D -HerosHat D -HerosShirt D -HerosPants D -FishBowl D -ArchaeologistsHat D -ArchaeologistsJacket D -ArchaeologistsPants D -BlackThread C -GreenThread C -NinjaHood D -NinjaShirt D -NinjaPants D -Leather C -RedHat D -Goldfish C -Robe D -RobotHat D -GoldCrown D -HellfireArrow K -Sandgun D -GuideVoodooDoll D -DivingHelmet D -FamiliarShirt D -FamiliarPants D -FamiliarWig D -DemonScythe D -NightsEdge D -DarkLance D -Coral B -Cactus L -Trident D -SilverBullet K -ThrowingKnife K -Spear D -Blowpipe D -Glowstick L -Seed K -WoodenBoomerang D -Aglet D -StickyGlowstick L -PoisonedKnife K -ObsidianSkinPotion N -RegenerationPotion N -SwiftnessPotion N -GillsPotion N -IronskinPotion N -ManaRegenerationPotion N -MagicPowerPotion N -FeatherfallPotion N -SpelunkerPotion N -InvisibilityPotion N -ShinePotion N -NightOwlPotion N -BattlePotion N -ThornsPotion N -WaterWalkingPotion N -ArcheryPotion N -HunterPotion N -GravitationPotion N -GoldChest D -DaybloomSeeds B -MoonglowSeeds B -BlinkrootSeeds B -DeathweedSeeds B -WaterleafSeeds B -FireblossomSeeds B -Daybloom B -Moonglow B -Blinkroot B -Deathweed B -Waterleaf B -Fireblossom B -SharkFin B -Feather B -Tombstone F -MimeMask D -AntlionMandible C -IllegalGunParts D -TheDoctorsShirt D -TheDoctorsPants D -GoldenKey g -ShadowChest D -ShadowKey D -ObsidianBrickWall O -JungleSpores B -Loom D -Piano D -Dresser D -Bench D -Bathtub D -RedBanner D -GreenBanner D -BlueBanner D -YellowBanner D -LampPost D -TikiTorch D -Barrel D -ChineseLantern D -CookingPot D -Safe D -SkullLantern D -TrashCan D -Candelabra D -PinkVase D -Mug D -Keg D -Ale N -Bookcase D -Throne D -Bowl D -BowlofSoup H -Toilet D -GrandfatherClock D -ArmorStatue D -GoblinBattleStandard G -TatteredCloth B -Sawmill D -CobaltOre L -MythrilOre L -AdamantiteOre L -Pwnhammer D -Excalibur D -HallowedSeeds B -EbonsandBlock L -CobaltHat D -CobaltHelmet D -CobaltMask D -CobaltBreastplate D -CobaltLeggings D -MythrilHood D -MythrilHelmet D -MythrilHat D -MythrilChainmail D -MythrilGreaves D -CobaltBar B -MythrilBar B -CobaltChainsaw D -MythrilChainsaw D -CobaltDrill D -MythrilDrill D -AdamantiteChainsaw D -AdamantiteDrill D -DaoofPow D -MythrilHalberd D -AdamantiteBar B -GlassWall O -Compass D -DivingGear D -GPS D -ObsidianHorseshoe D -ObsidianShield D -TinkerersWorkshop D -CloudinaBalloon D -AdamantiteHeadgear D -AdamantiteHelmet D -AdamantiteMask D -AdamantiteBreastplate D -AdamantiteLeggings D -SpectreBoots D -AdamantiteGlaive D -Toolbelt D -PearlsandBlock L -PearlstoneBlock L -MiningShirt D -MiningPants D -PearlstoneBrick L -IridescentBrick L -MudstoneBlock L -CobaltBrick L -MythrilBrick L -PearlstoneBrickWall O -IridescentBrickWall O -MudstoneBrickWall O -CobaltBrickWall O -MythrilBrickWall O -HolyWater K -UnholyWater K -SiltBlock M -FairyBell D -BreakerBlade D -BlueTorch L -RedTorch L -GreenTorch L -PurpleTorch L -WhiteTorch L -YellowTorch L -DemonTorch L -ClockworkAssaultRifle D -CobaltRepeater D -MythrilRepeater D -DualHook D -StarStatue D -SwordStatue D -SlimeStatue D -GoblinStatue D -ShieldStatue D -BatStatue D -FishStatue D -BunnyStatue D -SkeletonStatue D -ReaperStatue D -WomanStatue D -ImpStatue D -GargoyleStatue D -GloomStatue D -HornetStatue D -BombStatue D -CrabStatue D -HammerStatue D -PotionStatue D -SpearStatue D -CrossStatue D -JellyfishStatue D -BowStatue D -BoomerangStatue D -BootStatue D -ChestStatue D -BirdStatue D -AxeStatue D -CorruptStatue D -TreeStatue D -AnvilStatue D -PickaxeStatue D -MushroomStatue D -EyeballStatue D -PillarStatue D -HeartStatue D -PotStatue D -SunflowerStatue D -KingStatue D -QueenStatue D -PiranhaStatue D -PlankedWall O -WoodenBeam A -AdamantiteRepeater D -AdamantiteSword D -CobaltSword D -MythrilSword D -MoonCharm D -Ruler D -CrystalBall D -DiscoBall D -SorcererEmblem D -WarriorEmblem D -RangerEmblem D -DemonWings D -AngelWings D -MagicalHarp D -RainbowRod D -IceRod D -NeptunesShell D -Mannequin D -GreaterHealingPotion J -GreaterManaPotion J -PixieDust B -CrystalShard B -ClownHat D -ClownShirt D -ClownPants D -Flamethrower D -Bell D -Harp D -Wrench D -WireCutter D -ActiveStoneBlock L -InactiveStoneBlock L -Lever C -LaserRifle D -CrystalBullet K -HolyArrow K -MagicDagger D -CrystalStorm D -CursedFlames D -SoulofLight B -SoulofNight B -CursedFlame B -CursedTorch L -AdamantiteForge D -MythrilAnvil D -UnicornHorn C -DarkShard D -LightShard D -RedPressurePlate C -Wire L -SpellTome D -StarCloak D -Megashark D -Shotgun D -PhilosophersStone D -TitanGlove D -CobaltNaginata D -Switch C -DartTrap C -Boulder C -GreenPressurePlate C -GrayPressurePlate C -BrownPressurePlate C -MechanicalEye G -CursedArrow K -CursedBullet K -SoulofFright B -SoulofMight B -SoulofSight B -Gungnir D -HallowedPlateMail D -HallowedGreaves D -HallowedHelmet D -CrossNecklace D -ManaFlower D -MechanicalWorm G -MechanicalSkull G -HallowedHeadgear D -HallowedMask D -SlimeCrown G -LightDisc D -MusicBoxOverworldDay D -MusicBoxEerie D -MusicBoxNight D -MusicBoxTitle D -MusicBoxUnderground D -MusicBoxBoss1 D -MusicBoxJungle D -MusicBoxCorruption D -MusicBoxUndergroundCorruption D -MusicBoxTheHallow D -MusicBoxBoss2 D -MusicBoxUndergroundHallow D -MusicBoxBoss3 D -SoulofFlight B -MusicBox D -DemoniteBrick L -HallowedRepeater D -Drax D -Explosives C -InletPump D -OutletPump D -Timer1Second D -Timer3Second D -Timer5Second D -CandyCaneBlock L -CandyCaneWall O -SantaHat D -SantaShirt D -SantaPants D -GreenCandyCaneBlock L -GreenCandyCaneWall O -SnowBlock L -SnowBrick L -SnowBrickWall O -BlueLight B -RedLight B -GreenLight B -BluePresent E -GreenPresent E -YellowPresent E -SnowGlobe G -Carrot D -AdamantiteBeam L -AdamantiteBeamWall O -DemoniteBrickWall O -SandstoneBrick L -SandstoneBrickWall O -EbonstoneBrick L -EbonstoneBrickWall O -RedStucco L -YellowStucco L -GreenStucco L -GrayStucco L -RedStuccoWall O -YellowStuccoWall O -GreenStuccoWall O -GrayStuccoWall O -Ebonwood L -RichMahogany L -Pearlwood L -EbonwoodWall O -RichMahoganyWall O -PearlwoodWall O -EbonwoodChest D -RichMahoganyChest D -PearlwoodChest D -EbonwoodChair D -RichMahoganyChair D -PearlwoodChair D -EbonwoodPlatform M -RichMahoganyPlatform M -PearlwoodPlatform M -BonePlatform M -EbonwoodWorkBench D -RichMahoganyWorkBench D -PearlwoodWorkBench D -EbonwoodTable D -RichMahoganyTable D -PearlwoodTable D -EbonwoodPiano D -RichMahoganyPiano D -PearlwoodPiano D -EbonwoodBed D -RichMahoganyBed D -PearlwoodBed D -EbonwoodDresser D -RichMahoganyDresser D -PearlwoodDresser D -EbonwoodDoor D -RichMahoganyDoor D -PearlwoodDoor D -EbonwoodSword D -EbonwoodHammer D -EbonwoodBow D -RichMahoganySword D -RichMahoganyHammer D -RichMahoganyBow D -PearlwoodSword D -PearlwoodHammer D -PearlwoodBow D -RainbowBrick L -RainbowBrickWall O -IceBlock L -RedsWings D -RedsHelmet D -RedsBreastplate D -RedsLeggings D -Fish D -IceBoomerang D -Keybrand D -Cutlass D -BorealWoodWorkBench D -TrueExcalibur D -TrueNightsEdge D -Frostbrand D -BorealWoodTable D -RedPotion H -TacticalShotgun D -IvyChest D -IceChest D -Marrow D -UnholyTrident D -FrostHelmet D -FrostBreastplate D -FrostLeggings D -TinHelmet D -TinChainmail D -TinGreaves D -LeadHelmet D -LeadChainmail D -LeadGreaves D -TungstenHelmet D -TungstenChainmail D -TungstenGreaves D -PlatinumHelmet D -PlatinumChainmail D -PlatinumGreaves D -TinOre L -LeadOre L -TungstenOre L -PlatinumOre L -TinBar B -LeadBar B -TungstenBar B -PlatinumBar B -TinWatch D -TungstenWatch D -PlatinumWatch D -TinChandelier D -TungstenChandelier D -PlatinumChandelier D -PlatinumCandle D -PlatinumCandelabra D -PlatinumCrown D -LeadAnvil D -TinBrick L -TungstenBrick L -PlatinumBrick L -TinBrickWall O -TungstenBrickWall O -PlatinumBrickWall O -BeamSword D -IceBlade D -IceBow D -FrostStaff D -WoodHelmet D -WoodBreastplate D -WoodGreaves D -EbonwoodHelmet D -EbonwoodBreastplate D -EbonwoodGreaves D -RichMahoganyHelmet D -RichMahoganyBreastplate D -RichMahoganyGreaves D -PearlwoodHelmet D -PearlwoodBreastplate D -PearlwoodGreaves D -AmethystStaff D -TopazStaff D -SapphireStaff D -EmeraldStaff D -RubyStaff D -DiamondStaff D -GrassWall O -JungleWall O -FlowerWall O -Jetpack D -ButterflyWings D -CactusWall O -Cloud L -CloudWall O -Seaweed D -RuneHat D -RuneRobe D -MushroomSpear D -TerraBlade D -GrenadeLauncher D -RocketLauncher D -ProximityMineLauncher D -FairyWings D -SlimeBlock L -FleshBlock L -MushroomWall O -RainCloud L -BoneBlock L -FrozenSlimeBlock L -BoneBlockWall O -SlimeBlockWall O -FleshBlockWall O -RocketI K -RocketII K -RocketIII K -RocketIV K -AsphaltBlock L -CobaltPickaxe D -MythrilPickaxe D -AdamantitePickaxe D -Clentaminator D -GreenSolution K -BlueSolution K -PurpleSolution K -DarkBlueSolution K -RedSolution K -HarpyWings D -BoneWings D -Hammush D -NettleBurst D -AnkhBanner D -SnakeBanner D -OmegaBanner D -CrimsonHelmet D -CrimsonScalemail D -CrimsonGreaves D -BloodButcherer D -TendonBow D -FleshGrinder D -DeathbringerPickaxe D -BloodLustCluster D -TheUndertaker D -TheMeatball D -TheRottedFork D -EskimoHood D -EskimoCoat D -EskimoPants D -LivingWoodChair D -CactusChair D -BoneChair D -FleshChair D -MushroomChair D -BoneWorkBench D -CactusWorkBench D -FleshWorkBench D -MushroomWorkBench D -SlimeWorkBench D -CactusDoor D -FleshDoor D -MushroomDoor D -LivingWoodDoor D -BoneDoor D -FlameWings D -FrozenWings D -GhostWings D -SunplateBlock L -DiscWall O -SkywareChair D -BoneTable D -FleshTable D -LivingWoodTable D -SkywareTable D -LivingWoodChest D -LivingWoodWand D -PurpleIceBlock L -PinkIceBlock L -RedIceBlock L -CrimstoneBlock L -SkywareDoor D -SkywareChest D -SteampunkHat D -SteampunkShirt D -SteampunkPants D -BeeHat D -BeeShirt D -BeePants D -WorldBanner D -SunBanner D -GravityBanner D -PharaohsMask D -Actuator A -BlueWrench D -GreenWrench D -BluePressurePlate C -YellowPressurePlate C -DiscountCard D -LuckyCoin D -UnicornonaStick D -SandstorminaBottle D -BorealWoodSofa D -BeachBall D -CharmofMyths D -MoonShell D -StarVeil D -WaterWalkingBoots D -Tiara D -PrincessDress D -PharaohsRobe D -GreenCap D -MushroomCap D -TamOShanter D -MummyMask D -MummyShirt D -MummyPants D -CowboyHat D -CowboyJacket D -CowboyPants D -PirateHat D -PirateShirt D -PiratePants D -VikingHelmet D -CrimtaneOre L -CactusSword D -CactusPickaxe D -IceBrick L -IceBrickWall O -AdhesiveBandage D -ArmorPolish D -Bezoar D -Blindfold D -FastClock D -Megaphone D -Nazar D -Vitamins D -TrifoldMap D -CactusHelmet D -CactusBreastplate D -CactusLeggings D -PowerGlove D -LightningBoots D -SunStone D -MoonStone D -ArmorBracing D -MedicatedBandage D -ThePlan D -CountercurseMantra D -CoinGun D -LavaCharm D -ObsidianWaterWalkingBoots D -LavaWaders D -PureWaterFountain D -DesertWaterFountain D -Shadewood L -ShadewoodDoor D -ShadewoodPlatform M -ShadewoodChest D -ShadewoodChair D -ShadewoodWorkBench D -ShadewoodTable D -ShadewoodDresser D -ShadewoodPiano D -ShadewoodBed D -ShadewoodSword D -ShadewoodHammer D -ShadewoodBow D -ShadewoodHelmet D -ShadewoodBreastplate D -ShadewoodGreaves D -ShadewoodWall O -Cannon D -Cannonball B -FlareGun D -Flare K -BoneWand D -LeafWand D -FlyingCarpet D -AvengerEmblem D -MechanicalGlove D -LandMine C -PaladinsShield D -WebSlinger D -JungleWaterFountain D -IcyWaterFountain D -CorruptWaterFountain D -CrimsonWaterFountain D -HallowedWaterFountain D -BloodWaterFountain D -Umbrella D -ChlorophyteOre L -SteampunkWings D -Snowball K -IceSkates D -SnowballLauncher D -WebCoveredChest D -ClimbingClaws D -AncientIronHelmet D -AncientGoldHelmet D -AncientShadowHelmet D -AncientShadowScalemail D -AncientShadowGreaves D -AncientNecroHelmet D -AncientCobaltHelmet D -AncientCobaltBreastplate D -AncientCobaltLeggings D -BlackBelt D -Boomstick D -Rope L -Campfire D -Marshmallow H -MarshmallowonaStick H -CookedMarshmallow H -RedRocket C -GreenRocket C -BlueRocket C -YellowRocket C -IceTorch L -ShoeSpikes D -TigerClimbingGear D -Tabi D -PinkEskimoHood D -PinkEskimoCoat D -PinkEskimoPants D -PinkThread C -ManaRegenerationBand D -SandstorminaBalloon D -MasterNinjaGear D -RopeCoil H -Blowgun D -BlizzardinaBottle D -FrostburnArrow K -EnchantedSword D -PickaxeAxe D -CobaltWaraxe D -MythrilWaraxe D -AdamantiteWaraxe D -EatersBone D -BlendOMatic D -MeatGrinder D -Extractinator D -Solidifier D -Amber I -ConfettiGun C -ChlorophyteMask D -ChlorophyteHelmet D -ChlorophyteHeadgear D -ChlorophytePlateMail D -ChlorophyteGreaves D -ChlorophyteBar B -RedDye G -OrangeDye G -YellowDye G -LimeDye G -GreenDye G -TealDye G -CyanDye G -SkyBlueDye G -BlueDye G -PurpleDye G -VioletDye G -PinkDye G -RedandBlackDye G -OrangeandBlackDye G -YellowandBlackDye G -LimeandBlackDye G -GreenandBlackDye G -TealandBlackDye G -CyanandBlackDye G -SkyBlueandBlackDye G -BlueandBlackDye G -PurpleandBlackDye G -VioletandBlackDye G -PinkandBlackDye G -FlameDye G -FlameAndBlackDye G -GreenFlameDye G -GreenFlameAndBlackDye G -BlueFlameDye G -BlueFlameAndBlackDye G -SilverDye G -BrightRedDye G -BrightOrangeDye G -BrightYellowDye G -BrightLimeDye G -BrightGreenDye G -BrightTealDye G -BrightCyanDye G -BrightSkyBlueDye G -BrightBlueDye G -BrightPurpleDye G -BrightVioletDye G -BrightPinkDye G -BlackDye G -RedandSilverDye G -OrangeandSilverDye G -YellowandSilverDye G -LimeandSilverDye G -GreenandSilverDye G -TealandSilverDye G -CyanandSilverDye G -SkyBlueandSilverDye G -BlueandSilverDye G -PurpleandSilverDye G -VioletandSilverDye G -PinkandSilverDye G -IntenseFlameDye G -IntenseGreenFlameDye G -IntenseBlueFlameDye G -RainbowDye G -IntenseRainbowDye G -YellowGradientDye G -CyanGradientDye G -VioletGradientDye G -Paintbrush D -PaintRoller D -RedPaint L -OrangePaint L -YellowPaint L -LimePaint L -GreenPaint L -TealPaint L -CyanPaint L -SkyBluePaint L -BluePaint L -PurplePaint L -VioletPaint L -PinkPaint L -DeepRedPaint L -DeepOrangePaint L -DeepYellowPaint L -DeepLimePaint L -DeepGreenPaint L -DeepTealPaint L -DeepCyanPaint L -DeepSkyBluePaint L -DeepBluePaint L -DeepPurplePaint L -DeepVioletPaint L -DeepPinkPaint L -BlackPaint L -WhitePaint L -GrayPaint L -PaintScraper D -LihzahrdBrick L -LihzahrdBrickWall O -SlushBlock M -PalladiumOre L -OrichalcumOre L -TitaniumOre L -TealMushroom G -GreenMushroom G -SkyBlueFlower G -YellowMarigold G -BlueBerries G -LimeKelp G -PinkPricklyPear G -OrangeBloodroot G -RedHusk G -CyanHusk G -VioletHusk G -PurpleMucos G -BlackInk G -DyeVat D -BeeGun D -PossessedHatchet D -BeeKeeper D -Hive L -HoneyBlock L -HiveWall O -CrispyHoneyBlock L -HoneyBucket D -HiveWand D -Beenade K -GravityGlobe D -HoneyComb D -Abeemination G -BottledHoney J -RainHat D -RainCoat D -LihzahrdDoor D -DungeonDoor D -LeadDoor D -IronDoor D -TempleKey D -LihzahrdChest D -LihzahrdChair D -LihzahrdTable D -LihzahrdWorkBench D -SuperDartTrap C -FlameTrap C -SpikyBallTrap C -SpearTrap C -WoodenSpike L -LihzahrdPressurePlate C -LihzahrdStatue D -LihzahrdWatcherStatue D -LihzahrdGuardianStatue D -WaspGun D -PiranhaGun D -PygmyStaff D -PygmyNecklace D -TikiMask D -TikiShirt D -TikiPants D -LeafWings D -BlizzardinaBalloon D -BundleofBalloons D -BatWings D -BoneSword D -HerculesBeetle D -SmokeBomb B -BoneKey D -Nectar D -TikiTotem D -LizardEgg D -GraveMarker F -CrossGraveMarker F -Headstone F -Gravestone F -Obelisk F -LeafBlower D -ChlorophyteBullet K -ParrotCracker D -StrangeGlowingMushroom D -Seedling D -WispinaBottle D -PalladiumBar B -PalladiumSword D -PalladiumPike D -PalladiumRepeater D -PalladiumPickaxe D -PalladiumDrill D -PalladiumChainsaw D -OrichalcumBar B -OrichalcumSword D -OrichalcumHalberd D -OrichalcumRepeater D -OrichalcumPickaxe D -OrichalcumDrill D -OrichalcumChainsaw D -TitaniumBar B -TitaniumSword D -TitaniumTrident D -TitaniumRepeater D -TitaniumPickaxe D -TitaniumDrill D -TitaniumChainsaw D -PalladiumMask D -PalladiumHelmet D -PalladiumHeadgear D -PalladiumBreastplate D -PalladiumLeggings D -OrichalcumMask D -OrichalcumHelmet D -OrichalcumHeadgear D -OrichalcumBreastplate D -OrichalcumLeggings D -TitaniumMask D -TitaniumHelmet D -TitaniumHeadgear D -TitaniumBreastplate D -TitaniumLeggings D -OrichalcumAnvil D -TitaniumForge D -PalladiumWaraxe D -OrichalcumWaraxe D -TitaniumWaraxe D -HallowedBar B -ChlorophyteClaymore D -ChlorophyteSaber D -ChlorophytePartisan D -ChlorophyteShotbow D -ChlorophytePickaxe D -ChlorophyteDrill D -ChlorophyteChainsaw D -ChlorophyteGreataxe D -ChlorophyteWarhammer D -ChlorophyteArrow K -AmethystHook D -TopazHook D -SapphireHook D -EmeraldHook D -RubyHook D -DiamondHook D -AmberMosquito D -UmbrellaHat D -NimbusRod D -OrangeTorch L -CrimsandBlock L -BeeCloak D -EyeoftheGolem D -HoneyBalloon D -BlueHorseshoeBalloon D -WhiteHorseshoeBalloon D -YellowHorseshoeBalloon D -FrozenTurtleShell D -SniperRifle D -VenusMagnum D -CrimsonRod D -CrimtaneBar B -Stynger D -FlowerPow D -RainbowGun D -StyngerBolt K -ChlorophyteJackhammer D -Teleporter D -FlowerofFrost D -Uzi D -MagnetSphere D -PurpleStainedGlass O -YellowStainedGlass O -BlueStainedGlass O -GreenStainedGlass O -RedStainedGlass O -MulticoloredStainedGlass O -SkeletronHand D -Skull D -BallaHat D -GangstaHat D -SailorHat D -EyePatch D -SailorShirt D -SailorPants D -SkeletronMask D -AmethystRobe D -TopazRobe D -SapphireRobe D -EmeraldRobe D -RubyRobe D -DiamondRobe D -WhiteTuxedoShirt D -WhiteTuxedoPants D -PanicNecklace D -LifeFruit H -LihzahrdAltar D -LihzahrdPowerCell G -Picksaw D -HeatRay D -StaffofEarth D -GolemFist D -WaterChest D -Binoculars D -RifleScope D -DestroyerEmblem D -HighVelocityBullet K -JellyfishNecklace D -ZombieArm D -TheAxe D -IceSickle D -ClothierVoodooDoll D -PoisonStaff D -SlimeStaff D -PoisonDart K -EyeSpring D -ToySled D -BookofSkulls D -KOCannon D -PirateMap G -TurtleHelmet D -TurtleScaleMail D -TurtleLeggings D -SnowballCannon D -BonePickaxe D -MagicQuiver D -MagmaStone D -ObsidianRose D -Bananarang D -ChainKnife D -RodofDiscord D -DeathSickle D -TurtleShell G -TissueSample B -Vertebrae B -BloodySpine G -Ichor B -IchorTorch L -IchorArrow K -IchorBullet K -GoldenShower D -BunnyCannon D -ExplosiveBunny B -VialofVenom B -FlaskofVenom N -VenomArrow K -VenomBullet K -FireGauntlet D -Cog L -Confetti B -Nanites B -ExplosivePowder B -GoldDust B -PartyBullet K -NanoBullet K -ExplodingBullet K -GoldenBullet K -FlaskofCursedFlames N -FlaskofFire N -FlaskofGold N -FlaskofIchor N -FlaskofNanites N -FlaskofParty N -FlaskofPoison N -EyeofCthulhuTrophy D -EaterofWorldsTrophy D -BrainofCthulhuTrophy D -SkeletronTrophy D -QueenBeeTrophy D -WallofFleshTrophy D -DestroyerTrophy D -SkeletronPrimeTrophy D -RetinazerTrophy D -SpazmatismTrophy D -PlanteraTrophy D -GolemTrophy D -BloodMoonRising D -TheHangedMan D -GloryoftheFire D -BoneWarp D -WallSkeleton D -HangingSkeleton D -BlueSlabWall O -BlueTiledWall O -PinkSlabWall O -PinkTiledWall O -GreenSlabWall O -GreenTiledWall O -BlueBrickPlatform B -PinkBrickPlatform B -GreenBrickPlatform B -MetalShelf B -BrassShelf B -WoodShelf B -BrassLantern D -CagedLantern D -CarriageLantern D -AlchemyLantern D -DiablostLamp D -OilRagSconse D -BlueDungeonChair D -BlueDungeonTable D -BlueDungeonWorkBench D -GreenDungeonChair D -GreenDungeonTable D -GreenDungeonWorkBench D -PinkDungeonChair D -PinkDungeonTable D -PinkDungeonWorkBench D -BlueDungeonCandle D -GreenDungeonCandle D -PinkDungeonCandle D -BlueDungeonVase D -GreenDungeonVase D -PinkDungeonVase D -BlueDungeonDoor D -GreenDungeonDoor D -PinkDungeonDoor D -BlueDungeonBookcase D -GreenDungeonBookcase D -PinkDungeonBookcase D -Catacomb D -DungeonShelf B -SkellingtonJSkellingsworth D -TheCursedMan D -TheEyeSeestheEnd D -SomethingEvilisWatchingYou D -TheTwinsHaveAwoken D -TheScreamer D -GoblinsPlayingPoker D -Dryadisque D -Sunflowers D -TerrarianGothic D -Beanie D -ImbuingStation D -StarinaBottle D -EmptyBullet L -Impact D -PoweredbyBirds D -TheDestroyer D -ThePersistencyofEyes D -UnicornCrossingtheHallows D -GreatWave D -StarryNight D -GuidePicasso D -TheGuardiansGaze D -FatherofSomeone D -NurseLisa D -ShadowbeamStaff D -InfernoFork D -SpectreStaff D -WoodenFence O -LeadFence O -BubbleMachine D -BubbleWand D -MarchingBonesBanner D -NecromanticSign D -RustedCompanyStandard D -RaggedBrotherhoodSigil D -MoltenLegionFlag D -DiabolicSigil D -ObsidianPlatform M -ObsidianDoor D -ObsidianChair D -ObsidianTable D -ObsidianWorkBench D -ObsidianVase D -ObsidianBookcase D -HellboundBanner D -HellHammerBanner D -HelltowerBanner D -LostHopesofManBanner D -ObsidianWatcherBanner D -LavaEruptsBanner D -BlueDungeonBed D -GreenDungeonBed D -PinkDungeonBed D -ObsidianBed D -Waldo D -Darkness D -DarkSoulReaper D -Land D -TrappedGhost D -DemonsEye D -FindingGold D -FirstEncounter D -GoodMorning D -UndergroundReward D -ThroughtheWindow D -PlaceAbovetheClouds D -DoNotStepontheGrass D -ColdWatersintheWhiteLand D -LightlessChasms D -TheLandofDeceivingLooks D -Daylight D -SecretoftheSands D -DeadlandComesAlive D -EvilPresence D -SkyGuardian D -AmericanExplosive D -Discover D -HandEarth D -OldMiner D -Skelehead D -FacingtheCerebralMastermind D -LakeofFire D -TrioSuperHeroes D -SpectreHood D -SpectreRobe D -SpectrePants D -SpectrePickaxe D -SpectreHamaxe D -Ectoplasm B -GothicChair D -GothicTable D -GothicWorkBench D -GothicBookcase D -PaladinsHammer D -SWATHelmet D -BeeWings D -GiantHarpyFeather D -BoneFeather D -FireFeather D -IceFeather D -BrokenBatWing D -TatteredBeeWing D -LargeAmethyst D -LargeTopaz D -LargeSapphire D -LargeEmerald D -LargeRuby D -LargeDiamond D -JungleChest D -CorruptionChest D -CrimsonChest D -HallowedChest D -FrozenChest D -JungleKey D -CorruptionKey D -CrimsonKey D -HallowedKey D -FrozenKey D -ImpFace D -OminousPresence D -ShiningMoon D -LivingGore D -FlowingMagma D -SpectrePaintbrush D -SpectrePaintRoller D -SpectrePaintScraper D -ShroomiteHeadgear D -ShroomiteMask D -ShroomiteHelmet D -ShroomiteBreastplate D -ShroomiteLeggings D -Autohammer D -ShroomiteBar B -SDMG D -CenxsTiara D -CenxsBreastplate D -CenxsLeggings D -CrownosMask D -CrownosBreastplate D -CrownosLeggings D -WillsHelmet D -WillsBreastplate D -WillsLeggings D -JimsHelmet D -JimsBreastplate D -JimsLeggings D -AaronsHelmet D -AaronsBreastplate D -AaronsLeggings D -VampireKnives D -BrokenHeroSword D -ScourgeoftheCorruptor D -StaffoftheFrostHydra D -TheCreationoftheGuide D -TheMerchant D -CrownoDevoursHisLunch D -RareEnchantment D -GloriousNight D -SweetheartNecklace D -FlurryBoots D -DTownsHelmet D -DTownsBreastplate D -DTownsLeggings D -DTownsWings D -WillsWings D -CrownosWings D -CenxsWings D -CenxsDress D -CenxsDressPants D -PalladiumColumn L -PalladiumColumnWall O -BubblegumBlock L -BubblegumBlockWall O -TitanstoneBlock L -TitanstoneBlockWall O -MagicCuffs D -MusicBoxSnow D -MusicBoxSpace D -MusicBoxCrimson D -MusicBoxBoss4 D -MusicBoxAltOverworldDay D -MusicBoxRain D -MusicBoxIce D -MusicBoxDesert D -MusicBoxOcean D -MusicBoxDungeon D -MusicBoxPlantera D -MusicBoxBoss5 D -MusicBoxTemple D -MusicBoxEclipse D -MusicBoxMushrooms D -ButterflyDust D -AnkhCharm D -AnkhShield D -BlueFlare K -AnglerFishBanner D -AngryNimbusBanner D -AnomuraFungusBanner D -AntlionBanner D -ArapaimaBanner D -ArmoredSkeletonBanner D -BatBanner D -BirdBanner D -BlackRecluseBanner D -BloodFeederBanner D -BloodJellyBanner D -BloodCrawlerBanner D -BoneSerpentBanner D -BunnyBanner D -ChaosElementalBanner D -MimicBanner D -ClownBanner D -CorruptBunnyBanner D -CorruptGoldfishBanner D -CrabBanner D -CrimeraBanner D -CrimsonAxeBanner D -CursedHammerBanner D -DemonBanner D -DemonEyeBanner D -DerplingBanner D -EaterofSoulsBanner D -EnchantedSwordBanner D -ZombieEskimoBanner D -FaceMonsterBanner D -FloatyGrossBanner D -FlyingFishBanner D -FlyingSnakeBanner D -FrankensteinBanner D -FungiBulbBanner D -FungoFishBanner D -GastropodBanner D -GoblinThiefBanner D -GoblinSorcererBanner D -GoblinPeonBanner D -GoblinScoutBanner D -GoblinWarriorBanner D -GoldfishBanner D -HarpyBanner D -HellbatBanner D -HerplingBanner D -HornetBanner D -IceElementalBanner D -IcyMermanBanner D -FireImpBanner D -JellyfishBanner D -JungleCreeperBanner D -LihzahrdBanner D -ManEaterBanner D -MeteorHeadBanner D -MothBanner D -MummyBanner D -MushiLadybugBanner D -ParrotBanner D -PigronBanner D -PiranhaBanner D -PirateBanner D -PixieBanner D -RaincoatZombieBanner D -ReaperBanner D -SharkBanner D -SkeletonBanner D -SkeletonMageBanner D -SlimeBanner D -SnowFlinxBanner D -SpiderBanner D -SporeZombieBanner D -SwampThingBanner D -TortoiseBanner D -ToxicSludgeBanner D -UmbrellaSlimeBanner D -UnicornBanner D -VampireBanner D -VultureBanner D -NypmhBanner D -WerewolfBanner D -WolfBanner D -WorldFeederBanner D -WormBanner D -WraithBanner D -WyvernBanner D -ZombieBanner D -GlassPlatform M -GlassChair D -GoldenChair D -GoldenToilet D -BarStool D -HoneyChair D -SteampunkChair D -GlassDoor D -GoldenDoor D -HoneyDoor D -SteampunkDoor D -GlassTable D -BanquetTable D -Bar D -GoldenTable D -HoneyTable D -SteampunkTable D -GlassBed D -GoldenBed D -HoneyBed D -SteampunkBed D -LivingWoodWall O -FartinaJar D -Pumpkin L -PumpkinWall O -Hay L -HayWall O -SpookyWood L -SpookyWoodWall O -PumpkinHelmet D -PumpkinBreastplate D -PumpkinLeggings D -CandyApple E -SoulCake E -NurseHat D -NurseShirt D -NursePants D -WizardsHat D -GuyFawkesMask D -DyeTraderRobe D -SteampunkGoggles D -CyborgHelmet D -CyborgShirt D -CyborgPants D -CreeperMask D -CreeperShirt D -CreeperPants D -CatMask D -CatShirt D -CatPants D -GhostMask D -GhostShirt D -PumpkinMask D -PumpkinShirt D -PumpkinPants D -RobotMask D -RobotShirt D -RobotPants D -UnicornMask D -UnicornShirt D -UnicornPants D -VampireMask D -VampireShirt D -VampirePants D -WitchHat D -LeprechaunHat D -LeprechaunShirt D -LeprechaunPants D -PixieShirt D -PixiePants D -PrincessHat D -PrincessDressNew D -GoodieBag H -WitchDress D -WitchBoots D -BrideofFrankensteinMask D -BrideofFrankensteinDress D -KarateTortoiseMask D -KarateTortoiseShirt D -KarateTortoisePants D -CandyCornRifle D -CandyCorn K -JackOLanternLauncher D -ExplosiveJackOLantern K -Sickle D -PumpkinPie H -ScarecrowHat D -ScarecrowShirt D -ScarecrowPants D -Cauldron D -PumpkinChair D -PumpkinDoor D -PumpkinTable D -PumpkinWorkBench D -PumpkinPlatform M -TatteredFairyWings D -SpiderEgg D -MagicalPumpkinSeed D -BatHook D -BatScepter D -RavenStaff D -JungleKeyMold E -CorruptionKeyMold E -CrimsonKeyMold E -HallowedKeyMold E -FrozenKeyMold E -HangingJackOLantern D -RottenEgg K -UnluckyYarn D -BlackFairyDust D -Jackelier D -JackOLantern D -SpookyChair D -SpookyDoor D -SpookyTable D -SpookyWorkBench D -SpookyPlatform M -ReaperHood D -ReaperRobe D -FoxMask D -FoxShirt D -FoxPants D -CatEars D -BloodyMachete D -TheHorsemansBlade D -BladedGlove D -PumpkinSeed B -SpookyHook D -SpookyWings D -SpookyTwig D -SpookyHelmet D -SpookyBreastplate D -SpookyLeggings D -StakeLauncher D -Stake K -CursedSapling D -SpaceCreatureMask D -SpaceCreatureShirt D -SpaceCreaturePants D -WolfMask D -WolfShirt D -WolfPants D -PumpkinMoonMedallion G -NecromanticScroll D -JackingSkeletron D -BitterHarvest D -BloodMoonCountess D -HallowsEve D -MorbidCuriosity D -TreasureHunterShirt D -TreasureHunterPants D -DryadCoverings D -DryadLoincloth D -MourningWoodTrophy D -PumpkingTrophy D -JackOLanternMask D -SniperScope D -HeartLantern D -JellyfishDivingGear D -ArcticDivingGear D -FrostsparkBoots D -FartInABalloon D -PapyrusScarab D -CelestialStone D -Hoverboard D -CandyCane E -SugarPlum E -Present H -RedRyder D -FestiveWings D -PineTreeBlock L -ChristmasTree D -StarTopper1 D -StarTopper2 D -StarTopper3 D -BowTopper D -WhiteGarland D -WhiteAndRedGarland D -RedGardland D -RedAndGreenGardland D -GreenGardland D -GreenAndWhiteGarland D -MulticoloredBulb D -RedBulb D -YellowBulb D -GreenBulb D -RedAndGreenBulb D -YellowAndGreenBulb D -RedAndYellowBulb D -WhiteBulb D -WhiteAndRedBulb D -WhiteAndYellowBulb D -WhiteAndGreenBulb D -MulticoloredLights D -RedLights D -GreenLights D -BlueLights D -YellowLights D -RedAndYellowLights D -RedAndGreenLights D -YellowAndGreenLights D -BlueAndGreenLights D -RedAndBlueLights D -BlueAndYellowLights D -GiantBow D -ReindeerAntlers D -Holly D -CandyCaneSword D -EldMelter D -ChristmasPudding H -Eggnog J -StarAnise K -ReindeerBells D -CandyCaneHook D -ChristmasHook D -CnadyCanePickaxe D -FruitcakeChakram D -SugarCookie H -GingerbreadCookie H -HandWarmer D -Coal D -Toolbox D -PineDoor D -PineChair D -PineTable D -DogWhistle D -ChristmasTreeSword D -ChainGun D -Razorpine D -BlizzardStaff D -MrsClauseHat D -MrsClauseShirt D -MrsClauseHeels D -ParkaHood D -ParkaCoat D -ParkaPants D -SnowHat D -UglySweater D -TreeMask D -TreeShirt D -TreeTrunks D -ElfHat D -ElfShirt D -ElfPants D -SnowmanCannon D -NorthPole D -ChristmasTreeWallpaper O -OrnamentWallpaper O -CandyCaneWallpaper O -FestiveWallpaper O -StarsWallpaper O -SquigglesWallpaper O -SnowflakeWallpaper O -KrampusHornWallpaper O -BluegreenWallpaper O -GrinchFingerWallpaper O -NaughtyPresent G -BabyGrinchMischiefWhistle D -IceQueenTrophy D -SantaNK1Trophy D -EverscreamTrophy D -MusicBoxPumpkinMoon D -MusicBoxAltUnderground D -MusicBoxFrostMoon D -BrownPaint L -ShadowPaint L -NegativePaint L -TeamDye G -AmethystGemsparkBlock L -TopazGemsparkBlock L -SapphireGemsparkBlock L -EmeraldGemsparkBlock L -RubyGemsparkBlock L -DiamondGemsparkBlock L -AmberGemsparkBlock L -LifeHairDye D -ManaHairDye D -DepthHairDye D -MoneyHairDye D -TimeHairDye D -TeamHairDye D -BiomeHairDye D -PartyHairDye D -RainbowHairDye D -SpeedHairDye D -AngelHalo D -Fez D -Womannquin D -HairDyeRemover D -BugNet D -Firefly C -FireflyinaBottle D -MonarchButterfly C -PurpleEmperorButterfly C -RedAdmiralButterfly C -UlyssesButterfly C -SulphurButterfly C -TreeNymphButterfly C -ZebraSwallowtailButterfly C -JuliaButterfly C -Worm C -Mouse C -LightningBug C -LightningBuginaBottle D -Snail C -GlowingSnail C -FancyGreyWallpaper O -IceFloeWallpaper O -MusicWallpaper O -PurpleRainWallpaper O -RainbowWallpaper O -SparkleStoneWallpaper O -StarlitHeavenWallpaper O -Bird C -BlueJay C -Cardinal C -Squirrel C -Bunny C -CactusBookcase D -EbonwoodBookcase D -FleshBookcase D -HoneyBookcase D -SteampunkBookcase D -GlassBookcase D -RichMahoganyBookcase D -PearlwoodBookcase D -SpookyBookcase D -SkywareBookcase D -LihzahrdBookcase D -FrozenBookcase D -CactusLantern D -EbonwoodLantern D -FleshLantern D -HoneyLantern D -SteampunkLantern D -GlassLantern D -RichMahoganyLantern D -PearlwoodLantern D -FrozenLantern D -LihzahrdLantern D -SkywareLantern D -SpookyLantern D -FrozenDoor D -CactusCandle D -EbonwoodCandle D -FleshCandle D -GlassCandle D -FrozenCandle D -RichMahoganyCandle D -PearlwoodCandle D -LihzahrdCandle D -SkywareCandle D -PumpkinCandle D -CactusChandelier D -EbonwoodChandelier D -FleshChandelier D -HoneyChandelier D -FrozenChandelier D -RichMahoganyChandelier D -PearlwoodChandelier D -LihzahrdChandelier D -SkywareChandelier D -SpookyChandelier D -GlassChandelier D -CactusBed D -FleshBed D -FrozenBed D -LihzahrdBed D -SkywareBed D -SpookyBed D -CactusBathtub D -EbonwoodBathtub D -FleshBathtub D -GlassBathtub D -FrozenBathtub D -RichMahoganyBathtub D -PearlwoodBathtub D -LihzahrdBathtub D -SkywareBathtub D -SpookyBathtub D -CactusLamp D -EbonwoodLamp D -FleshLamp D -GlassLamp D -FrozenLamp D -RichMahoganyLamp D -PearlwoodLamp D -LihzahrdLamp D -SkywareLamp D -SpookyLamp D -CactusCandelabra D -EbonwoodCandelabra D -FleshCandelabra D -HoneyCandelabra D -SteampunkCandelabra D -GlassCandelabra D -RichMahoganyCandelabra D -PearlwoodCandelabra D -FrozenCandelabra D -LihzahrdCandelabra D -SkywareCandelabra D -SpookyCandelabra D -BrainMask D -FleshMask D -TwinMask D -SkeletronPrimeMask D -BeeMask D -PlanteraMask D -GolemMask D -EaterMask D -EyeMask D -DestroyerMask D -BlacksmithRack D -CarpentryRack D -HelmetRack D -SpearRack D -SwordRack D -StoneSlab L -SandstoneSlab L -Frog C -MallardDuck C -Duck C -HoneyBathtub D -SteampunkBathtub D -LivingWoodBathtub D -ShadewoodBathtub D -BoneBathtub D -HoneyLamp D -SteampunkLamp D -LivingWoodLamp D -ShadewoodLamp D -GoldenLamp D -BoneLamp D -LivingWoodBookcase D -ShadewoodBookcase D -GoldenBookcase D -BoneBookcase D -LivingWoodBed D -BoneBed D -LivingWoodChandelier D -ShadewoodChandelier D -GoldenChandelier D -BoneChandelier D -LivingWoodLantern D -ShadewoodLantern D -GoldenLantern D -BoneLantern D -LivingWoodCandelabra D -ShadewoodCandelabra D -GoldenCandelabra D -BoneCandelabra D -LivingWoodCandle D -ShadewoodCandle D -GoldenCandle D -BlackScorpion C -Scorpion C -BubbleWallpaper O -CopperPipeWallpaper O -DuckyWallpaper O -FrostCore G -BunnyCage D -SquirrelCage D -MallardDuckCage D -DuckCage D -BirdCage D -BlueJayCage D -CardinalCage D -WaterfallWall O -LavafallWall O -CrimsonSeeds B -HeavyWorkBench D -CopperPlating L -SnailCage D -GlowingSnailCage D -ShroomiteDiggingClaw D -AmmoBox D -MonarchButterflyJar D -PurpleEmperorButterflyJar D -RedAdmiralButterflyJar D -UlyssesButterflyJar D -SulphurButterflyJar D -TreeNymphButterflyJar D -ZebraSwallowtailButterflyJar D -JuliaButterflyJar D -ScorpionCage D -BlackScorpionCage D -VenomStaff D -SpectreMask D -FrogCage D -MouseCage D -BoneWelder D -FleshCloningVaat D -GlassKiln D -LihzahrdFurnace D -LivingLoom D -SkyMill D -IceMachine D -BeetleHelmet D -BeetleScaleMail D -BeetleShell D -BeetleLeggings D -SteampunkBoiler D -HoneyDispenser D -Penguin C -PenguinCage D -WormCage D -Terrarium D -SuperManaPotion J -EbonwoodFence O -RichMahoganyFence O -PearlwoodFence O -ShadewoodFence O -BrickLayer D -ExtendoGrip D -PaintSprayer D -PortableCementMixer D -BeetleHusk B -CelestialMagnet D -CelestialEmblem D -CelestialCuffs D -PeddlersHat D -PulseBow D -DynastyChandelier D -DynastyLamp D -DynastyLantern D -DynastyCandelabra D -DynastyChair D -DynastyWorkBench D -DynastyChest D -DynastyBed D -DynastyBathtub D -DynastyBookcase D -DynastyCup D -DynastyBowl D -DynastyCandle D -DynastyClock D -GoldenClock D -GlassClock D -HoneyClock D -SteampunkClock D -FancyDishes D -GlassBowl D -WineGlass D -LivingWoodPiano D -FleshPiano D -FrozenPiano D -FrozenTable D -HoneyChest D -SteampunkChest D -HoneyWorkBench D -FrozenWorkBench D -SteampunkWorkBench D -GlassPiano D -HoneyPiano D -SteampunkPiano D -HoneyCup D -SteampunkCup D -DynastyTable D -DynastyWood L -RedDynastyShingles L -BlueDynastyShingles L -WhiteDynastyWall O -BlueDynastyWall O -DynastyDoor D -Sake N -PadThai H -Pho H -Revolver D -Gatligator D -ArcaneRuneWall O -WaterGun D -Katana D -UltrabrightTorch L -MagicHat D -DiamondRing D -Gi D -Kimono D -GypsyRobe D -BeetleWings D -TigerSkin D -LeopardSkin D -ZebraSkin D -CrimsonCloak D -MysteriousCape D -RedCape D -WinterCape D -FrozenChair D -WoodFishingPole D -Bass G -ReinforcedFishingPole D -FiberglassFishingPole D -FisherofSouls D -GoldenFishingRod D -MechanicsRod D -SittingDucksFishingRod D -Trout G -Salmon G -AtlanticCod G -Tuna G -RedSnapper G -NeonTetra G -ArmoredCavefish G -Damselfish G -CrimsonTigerfish G -FrostMinnow G -PrincessFish G -GoldenCarp G -SpecularFish G -Prismite G -VariegatedLardfish G -FlarefinKoi G -DoubleCod G -Honeyfin J -Obsidifish G -Shrimp G -ChaosFish G -Ebonkoi G -Hemopiranha G -Rockfish D -Stinkfish G -MiningPotion N -HeartreachPotion N -CalmingPotion N -BuilderPotion N -TitanPotion N -FlipperPotion N -SummoningPotion N -TrapsightPotion N -PurpleClubberfish D -ObsidianSwordfish D -Swordfish D -IronFence O -WoodenCrate H -IronCrate H -GoldenCrate H -OldShoe D -FishingSeaweed D -TinCan D -MinecartTrack L -ReaverShark D -SawtoothShark D -Minecart D -AmmoReservationPotion N -LifeforcePotion N -EndurancePotion N -RagePotion N -InfernoPotion N -WrathPotion N -RecallPotion N -TeleportationPotion N -LovePotion N -StinkPotion N -FishingPotion N -SonarPotion N -CratePotion N -ShiverthornSeeds B -Shiverthorn B -WarmthPotion N -FishHook D -BeeHeadgear D -BeeBreastplate D -BeeGreaves D -HornetStaff D -ImpStaff D -QueenSpiderStaff D -AnglerHat D -AnglerVest D -AnglerPants D -SpiderMask D -SpiderBreastplate D -SpiderGreaves D -HighTestFishingLine D -AnglerEarring D -TackleBox D -BlueDungeonPiano D -GreenDungeonPiano D -PinkDungeonPiano D -GoldenPiano D -ObsidianPiano D -BonePiano D -CactusPiano D -SpookyPiano D -SkywarePiano D -LihzahrdPiano D -BlueDungeonDresser D -GreenDungeonDresser D -PinkDungeonDresser D -GoldenDresser D -ObsidianDresser D -BoneDresser D -CactusDresser D -SpookyDresser D -SkywareDresser D -HoneyDresser D -LihzahrdDresser D -Sofa D -EbonwoodSofa D -RichMahoganySofa D -PearlwoodSofa D -ShadewoodSofa D -BlueDungeonSofa D -GreenDungeonSofa D -PinkDungeonSofa D -GoldenSofa D -ObsidianSofa D -BoneSofa D -CactusSofa D -SpookySofa D -SkywareSofa D -HoneySofa D -SteampunkSofa D -MushroomSofa D -GlassSofa D -PumpkinSofa D -LihzahrdSofa D -SeashellHairpin D -MermaidAdornment D -MermaidTail D -ZephyrFish D -Fleshcatcher D -HotlineFishingHook D -FrogLeg D -Anchor D -CookedFish H -CookedShrimp H -Sashimi H -FuzzyCarrot D -ScalyTruffle D -SlimySaddle D -BeeWax B -CopperPlatingWall O -StoneSlabWall O -Sail O -CoralstoneBlock L -BlueJellyfish G -GreenJellyfish G -PinkJellyfish G -BlueJellyfishJar D -GreenJellyfishJar D -PinkJellyfishJar D -LifePreserver D -ShipsWheel D -CompassRose D -WallAnchor D -GoldfishTrophy D -BunnyfishTrophy D -SwordfishTrophy D -SharkteethTrophy D -Batfish F -BumblebeeTuna F -Catfish F -Cloudfish F -Cursedfish F -Dirtfish F -DynamiteFish F -EaterofPlankton F -FallenStarfish F -TheFishofCthulu F -Fishotron F -Harpyfish F -Hungerfish F -Ichorfish F -Jewelfish F -MirageFish F -MutantFlinxfin F -Pengfish F -Pixiefish F -Spiderfish F -TundraTrout F -UnicornFish F -GuideVoodooFish F -Wyverntail F -ZombieFish F -AmanitaFungifin F -Angelfish F -BloodyManowar F -Bonefish F -Bunnyfish F -CapnTunabeard F -Clownfish F -DemonicHellfish F -Derpfish F -Fishron F -InfectedScabbardfish F -Mudfish F -Slimefish F -TropicalBarracuda F -KingSlimeTrophy D -ShipInABottle D -HardySaddle D -PressureTrack C -KingSlimeMask D -FinWings D -TreasureMap D -SeaweedPlanter D -PillaginMePixels D -FishCostumeMask D -FishCostumeShirt D -FishCostumeFinskirt D -GingerBeard D -HoneyedGoggles D -BorealWood L -PalmWood L -BorealWoodWall O -PalmWoodWall O -BorealWoodFence O -PalmWoodFence O -BorealWoodHelmet D -BorealWoodBreastplate D -BorealWoodGreaves D -PalmWoodHelmet D -PalmWoodBreastplate D -PalmWoodGreaves D -PalmWoodBow D -PalmWoodHammer D -PalmWoodSword D -PalmWoodPlatform M -PalmWoodBathtub D -PalmWoodBed D -PalmWoodBench D -PalmWoodCandelabra D -PalmWoodCandle D -PalmWoodChair D -PalmWoodChandelier D -PalmWoodChest D -PalmWoodSofa D -PalmWoodDoor D -PalmWoodDresser D -PalmWoodLantern D -PalmWoodPiano D -PalmWoodTable D -PalmWoodLamp D -PalmWoodWorkBench D -OpticStaff D -PalmWoodBookcase D -MushroomBathtub D -MushroomBed D -MushroomBench D -MushroomBookcase D -MushroomCandelabra D -MushroomCandle D -MushroomChandelier D -MushroomChest D -MushroomDresser D -MushroomLantern D -MushroomLamp D -MushroomPiano D -MushroomPlatform M -MushroomTable D -SpiderStaff D -BorealWoodBathtub D -BorealWoodBed D -BorealWoodBookcase D -BorealWoodCandelabra D -BorealWoodCandle D -BorealWoodChair D -BorealWoodChandelier D -BorealWoodChest D -BorealWoodClock D -BorealWoodDoor D -BorealWoodDresser D -BorealWoodLamp D -BorealWoodLantern D -BorealWoodPiano D -BorealWoodPlatform M -SlimeBathtub D -SlimeBed D -SlimeBookcase D -SlimeCandelabra D -SlimeCandle D -SlimeChair D -SlimeChandelier D -SlimeChest D -SlimeClock D -SlimeDoor D -SlimeDresser D -SlimeLamp D -SlimeLantern D -SlimePiano D -SlimePlatform M -SlimeSofa D -SlimeTable D -PirateStaff D -SlimeHook D -StickyGrenade K -TartarSauce D -DukeFishronMask D -DukeFishronTrophy D -MolotovCocktail K -BoneClock D -CactusClock D -EbonwoodClock D -FrozenClock D -LihzahrdClock D -LivingWoodClock D -RichMahoganyClock D -FleshClock D -MushroomClock D -ObsidianClock D -PalmWoodClock D -PearlwoodClock D -PumpkinClock D -ShadewoodClock D -SpookyClock D -SkywareClock D -SpiderFang B -FalconBlade D -FishronWings D -SlimeGun D -Flairon D -GreenDungeonChest D -PinkDungeonChest D -BlueDungeonChest D -BoneChest D -CactusChest D -FleshChest D -ObsidianChest D -PumpkinChest D -SpookyChest D -TempestStaff D -RazorbladeTyphoon D -BubbleGun D -Tsunami D -Seashell C -Starfish C -SteampunkPlatform M -SkywarePlatform M -LivingWoodPlatform M -HoneyPlatform M -SkywareWorkbench D -GlassWorkBench D -LivingWoodWorkBench D -FleshSofa D -FrozenSofa D -LivingWoodSofa D -PumpkinDresser D -SteampunkDresser D -GlassDresser D -FleshDresser D -PumpkinLantern D -ObsidianLantern D -PumpkinLamp D -ObsidianLamp D -BlueDungeonLamp D -GreenDungeonLamp D -PinkDungeonLamp D -HoneyCandle D -SteampunkCandle D -SpookyCandle D -ObsidianCandle D -BlueDungeonChandelier D -GreenDungeonChandelier D -PinkDungeonChandelier D -SteampunkChandelier D -PumpkinChandelier D -ObsidianChandelier D -BlueDungeonBathtub D -GreenDungeonBathtub D -PinkDungeonBathtub D -PumpkinBathtub D -ObsidianBathtub D -GoldenBathtub D -BlueDungeonCandelabra D -GreenDungeonCandelabra D -PinkDungeonCandelabra D -ObsidianCandelabra D -PumpkinCandelabra D -PumpkinBed D -PumpkinBookcase D -PumpkinPiano D -SharkStatue D -TruffleWorm G -ApprenticeBait C -JourneymanBait C -MasterBait C -AmberGemsparkWall O -AmberGemsparkWallOff O -AmethystGemsparkWall O -AmethystGemsparkWallOff O -DiamondGemsparkWall O -DiamondGemsparkWallOff O -EmeraldGemsparkWall O -EmeraldGemsparkWallOff O -RubyGemsparkWall O -RubyGemsparkWallOff O -SapphireGemsparkWall O -SapphireGemsparkWallOff O -TopazGemsparkWall O -TopazGemsparkWallOff O -TinPlatingWall O -TinPlating L -WaterfallBlock L -LavafallBlock L -ConfettiBlock L -ConfettiWall O -ConfettiBlockBlack L -ConfettiWallBlack O -WeaponRack D -FireworksBox D -LivingFireBlock L -AlphabetStatue0 D -AlphabetStatue1 D -AlphabetStatue2 D -AlphabetStatue3 D -AlphabetStatue4 D -AlphabetStatue5 D -AlphabetStatue6 D -AlphabetStatue7 D -AlphabetStatue8 D -AlphabetStatue9 D -AlphabetStatueA D -AlphabetStatueB D -AlphabetStatueC D -AlphabetStatueD D -AlphabetStatueE D -AlphabetStatueF D -AlphabetStatueG D -AlphabetStatueH D -AlphabetStatueI D -AlphabetStatueJ D -AlphabetStatueK D -AlphabetStatueL D -AlphabetStatueM D -AlphabetStatueN D -AlphabetStatueO D -AlphabetStatueP D -AlphabetStatueQ D -AlphabetStatueR D -AlphabetStatueS D -AlphabetStatueT D -AlphabetStatueU D -AlphabetStatueV D -AlphabetStatueW D -AlphabetStatueX D -AlphabetStatueY D -AlphabetStatueZ D -FireworkFountain D -BoosterTrack C -Grasshopper C -GrasshopperCage D -MusicBoxUndergroundCrimson D -CactusTable D -CactusPlatform M -BorealWoodSword D -BorealWoodHammer D -BorealWoodBow D -GlassChest D -XenoStaff D -MeteorStaff D -LivingCursedFireBlock L -LivingDemonFireBlock L -LivingFrostFireBlock L -LivingIchorBlock L -LivingUltrabrightFireBlock L -GenderChangePotion N -VortexHelmet D -VortexBreastplate D -VortexLeggings D -NebulaHelmet D -NebulaBreastplate D -NebulaLeggings D -SolarFlareHelmet D -SolarFlareBreastplate D -SolarFlareLeggings D -LunarTabletFragment H -SolarTablet G -DrillContainmentUnit D -CosmicCarKey D -MothronWings D -BrainScrambler D -VortexAxe E -VortexChainsaw E -VortexDrill D -VortexHammer E -VortexPickaxe D -NebulaAxe E -NebulaChainsaw E -NebulaDrill D -NebulaHammer E -NebulaPickaxe D -SolarFlareAxe E -SolarFlareChainsaw E -SolarFlareDrill D -SolarFlareHammer E -SolarFlarePickaxe D -HoneyfallBlock L -HoneyfallWall O -ChlorophyteBrickWall O -CrimtaneBrickWall O -ShroomitePlatingWall O -ChlorophyteBrick L -CrimtaneBrick L -ShroomitePlating L -LaserMachinegun D -ElectrosphereLauncher D -Xenopopper D -LaserDrill D -LaserRuler D -AntiGravityHook D -MoonMask D -SunMask D -MartianCostumeMask D -MartianCostumeShirt D -MartianCostumePants D -MartianUniformHelmet D -MartianUniformTorso D -MartianUniformPants D -MartianAstroClock D -MartianBathtub D -MartianBed D -MartianHoverChair D -MartianChandelier D -MartianChest D -MartianDoor D -MartianDresser D -MartianHolobookcase D -MartianHoverCandle D -MartianLamppost D -MartianLantern D -MartianPiano D -MartianPlatform M -MartianSofa D -MartianTable D -MartianTableLamp D -MartianWorkBench D -WoodenSink D -EbonwoodSink D -RichMahoganySink D -PearlwoodSink D -BoneSink D -FleshSink D -LivingWoodSink D -SkywareSink D -ShadewoodSink D -LihzahrdSink D -BlueDungeonSink D -GreenDungeonSink D -PinkDungeonSink D -ObsidianSink D -MetalSink D -GlassSink D -GoldenSink D -HoneySink D -SteampunkSink D -PumpkinSink D -SpookySink D -FrozenSink D -DynastySink D -PalmWoodSink D -MushroomSink D -BorealWoodSink D -SlimeSink D -CactusSink D -MartianSink D -WhiteLunaticHood D -BlueLunaticHood D -WhiteLunaticRobe D -BlueLunaticRobe D -MartianConduitPlating L -MartianConduitWall O -HiTekSunglasses D -MartianHairDye D -MartianArmorDye G -PaintingCastleMarsberg D -PaintingMartiaLisa D -PaintingTheTruthIsUpThere D -SmokeBlock L -LivingFlameDye G -LivingRainbowDye G -ShadowDye G -NegativeDye G -LivingOceanDye G -BrownDye G -BrownAndBlackDye G -BrightBrownDye G -BrownAndSilverDye G -WispDye G -PixieDye G -InfluxWaver D -PhasicWarpEjector E -ChargedBlasterCannon D -ChlorophyteDye G -UnicornWispDye G -InfernalWispDye G -ViciousPowder K -ViciousMushroom B -BeesKnees D -GoldBird G -GoldBunny G -GoldButterfly G -GoldFrog G -GoldGrasshopper G -GoldMouse G -GoldWorm G -StickyDynamite K -AngryTrapperBanner D -ArmoredVikingBanner D -BlackSlimeBanner D -BlueArmoredBonesBanner D -BlueCultistArcherBanner D -BlueCultistCasterBanner D -BlueCultistFighterBanner E -BoneLeeBanner D -ClingerBanner D -CochinealBeetleBanner D -CorruptPenguinBanner D -CorruptSlimeBanner D -CorruptorBanner D -CrimslimeBanner D -CursedSkullBanner D -CyanBeetleBanner D -DevourerBanner D -DiablolistBanner D -DoctorBonesBanner D -DungeonSlimeBanner D -DungeonSpiritBanner D -ElfArcherBanner D -ElfCopterBanner D -EyezorBanner D -FlockoBanner D -GhostBanner D -GiantBatBanner D -GiantCursedSkullBanner D -GiantFlyingFoxBanner D -GingerbreadManBanner D -GoblinArcherBanner D -GreenSlimeBanner D -HeadlessHorsemanBanner D -HellArmoredBonesBanner D -HellhoundBanner D -HoppinJackBanner D -IceBatBanner D -IceGolemBanner D -IceSlimeBanner D -IchorStickerBanner D -IlluminantBatBanner D -IlluminantSlimeBanner D -JungleBatBanner D -JungleSlimeBanner D -KrampusBanner D -LacBeetleBanner D -LavaBatBanner D -LavaSlimeBanner D -MartianBrainscramblerBanner D -MartianDroneBanner D -MartianEngineerBanner D -MartianGigazapperBanner D -MartianGreyGruntBanner D -MartianOfficerBanner D -MartianRaygunnerBanner D -MartianScutlixGunnerBanner D -MartianTeslaTurretBanner D -MisterStabbyBanner D -MotherSlimeBanner D -NecromancerBanner D -NutcrackerBanner D -PaladinBanner D -PenguinBanner D -PinkyBanner D -PoltergeistBanner D -PossessedArmorBanner D -PresentMimicBanner D -PurpleSlimeBanner D -RaggedCasterBanner D -RainbowSlimeBanner D -RavenBanner D -RedSlimeBanner D -RuneWizardBanner D -RustyArmoredBonesBanner D -ScarecrowBanner D -ScutlixBanner D -SkeletonArcherBanner D -SkeletonCommandoBanner D -SkeletonSniperBanner D -SlimerBanner D -SnatcherBanner D -SnowBallaBanner D -SnowmanGangstaBanner D -SpikedIceSlimeBanner D -SpikedJungleSlimeBanner D -SplinterlingBanner D -SquidBanner D -TacticalSkeletonBanner D -TheGroomBanner D -TimBanner D -UndeadMinerBanner D -UndeadVikingBanner D -WhiteCultistArcherBanner E -WhiteCultistCasterBanner E -WhiteCultistFighterBanner E -YellowSlimeBanner D -YetiBanner D -ZombieElfBanner D -SparkyPainting D -VineRope L -WormholePotion N -SummonerEmblem D -BewitchingTable D -AlchemyTable D -StrangeBrew J -SpelunkerGlowstick L -BoneArrow K -BoneTorch L -VineRopeCoil H -SoulDrain D -DartPistol D -DartRifle D -CrystalDart K -CursedDart K -IchorDart K -ChainGuillotines D -FetidBaghnakhs D -ClingerStaff D -PutridScent D -FleshKnuckles D -FlowerBoots D -Seedler D -HellwingBow D -TendonHook D -ThornHook D -IlluminantHook D -WormHook D -DevDye G -PurpleOozeDye G -ReflectiveSilverDye G -ReflectiveGoldDye G -BlueAcidDye G -DaedalusStormbow D -FlyingKnife D -BottomlessBucket D -SuperAbsorbantSponge D -GoldRing D -CoinRing D -GreedyRing D -FishFinder D -WeatherRadio D -HadesDye G -TwilightDye G -AcidDye G -MushroomDye G -PhaseDye G -MagicLantern D -MusicBoxLunarBoss D -RainbowTorch L -CursedCampfire D -DemonCampfire D -FrozenCampfire D -IchorCampfire D -RainbowCampfire D -CrystalVileShard D -ShadowFlameBow D -ShadowFlameHexDoll D -ShadowFlameKnife D -PaintingAcorns D -PaintingColdSnap D -PaintingCursedSaint D -PaintingSnowfellas D -PaintingTheSeason D -BoneRattle D -ArchitectGizmoPack D -CrimsonHeart D -Meowmere D -Sundial D -StarWrath D -MarbleBlock L -HellstoneBrickWall O -CordageGuide D -WandofSparking D -GoldBirdCage D -GoldBunnyCage D -GoldButterflyCage D -GoldFrogCage D -GoldGrasshopperCage D -GoldMouseCage D -GoldWormCage D -SilkRope L -WebRope L -SilkRopeCoil H -WebRopeCoil H -Marble L -MarbleWall O -MarbleBlockWall O -Radar D -LockBox H -Granite L -GraniteBlock L -GraniteWall O -GraniteBlockWall O -RoyalGel D -NightKey D -LightKey D -HerbBag F -Javelin K -TallyCounter D -Sextant D -EoCShield D -ButchersChainsaw D -Stopwatch D -MeteoriteBrick L -MeteoriteBrickWall O -MetalDetector D -EndlessQuiver D -EndlessMusketPouch D -ToxicFlask D -PsychoKnife D -NailGun D -Nail K -NightVisionHelmet D -CelestialShell D -PinkGel C -BouncyGlowstick L -PinkSlimeBlock L -PinkTorch L -BouncyBomb K -BouncyGrenade K -PeaceCandle D -LifeformAnalyzer D -DPSMeter D -FishermansGuide D -GoblinTech D -REK D -PDA D -CellPhone D -GraniteChest D -MeteoriteClock D -MarbleClock D -GraniteClock D -MeteoriteDoor D -MarbleDoor D -GraniteDoor D -MeteoriteDresser D -MarbleDresser D -GraniteDresser D -MeteoriteLamp D -MarbleLamp D -GraniteLamp D -MeteoriteLantern D -MarbleLantern D -GraniteLantern D -MeteoritePiano D -MarblePiano D -GranitePiano D -MeteoritePlatform M -MarblePlatform M -GranitePlatform M -MeteoriteSink D -MarbleSink D -GraniteSink D -MeteoriteSofa D -MarbleSofa D -GraniteSofa D -MeteoriteTable D -MarbleTable D -GraniteTable D -MeteoriteWorkBench D -MarbleWorkBench D -GraniteWorkBench D -MeteoriteBathtub D -MarbleBathtub D -GraniteBathtub D -MeteoriteBed D -MarbleBed D -GraniteBed D -MeteoriteBookcase D -MarbleBookcase D -GraniteBookcase D -MeteoriteCandelabra D -MarbleCandelabra D -GraniteCandelabra D -MeteoriteCandle D -MarbleCandle D -GraniteCandle D -MeteoriteChair D -MarbleChair D -GraniteChair D -MeteoriteChandelier D -MarbleChandelier D -GraniteChandelier D -MeteoriteChest D -MarbleChest D -MagicWaterDropper D -GoldenBugNet D -MagicLavaDropper D -MagicHoneyDropper D -EmptyDropper D -GladiatorHelmet D -GladiatorBreastplate D -GladiatorLeggings D -ReflectiveDye G -EnchantedNightcrawler C -Grubby C -Sluggy C -Buggy C -GrubSoup H -BombFish K -FrostDaggerfish K -SharpeningStation D -IceMirror D -SailfishBoots D -TsunamiInABottle D -TargetDummy D -CorruptFishingCrate H -CrimsonFishingCrate H -DungeonFishingCrate H -FloatingIslandFishingCrate H -HallowedFishingCrate H -JungleFishingCrate H -CrystalSerpent D -Toxikarp D -Bladetongue D -SharkToothNecklace D -MoneyTrough D -Bubble L -DayBloomPlanterBox B -MoonglowPlanterBox B -CorruptPlanterBox B -CrimsonPlanterBox B -BlinkrootPlanterBox B -WaterleafPlanterBox B -ShiverthornPlanterBox B -FireBlossomPlanterBox B -BrainOfConfusion D -WormScarf D -BalloonPufferfish D -BejeweledValkyrieHead D -BejeweledValkyrieBody D -BejeweledValkyrieWing D -RichGravestone1 F -RichGravestone2 F -RichGravestone3 F -RichGravestone4 F -RichGravestone5 F -CrystalBlock L -MusicBoxMartians D -MusicBoxPirates D -MusicBoxHell D -CrystalBlockWall O -Trapdoor D -TallGate D -SharkronBalloon D -TaxCollectorHat D -TaxCollectorSuit D -TaxCollectorPants D -BoneGlove D -ClothierJacket D -ClothierPants D -DyeTraderTurban D -DeadlySphereStaff D -BalloonHorseshoeFart D -BalloonHorseshoeHoney D -BalloonHorseshoeSharkron D -LavaLamp D -CageEnchantedNightcrawler D -CageBuggy D -CageGrubby D -CageSluggy D -SlapHand D -TwilightHairDye D -BlessedApple D -SpectreBar B -Code1 D -BuccaneerBandana D -BuccaneerShirt D -BuccaneerPants D -ObsidianHelm D -ObsidianShirt D -ObsidianPants D -MedusaHead D -ItemFrame D -Sandstone L -HardenedSand L -SandstoneWall O -CorruptHardenedSand L -CrimsonHardenedSand L -CorruptSandstone L -CrimsonSandstone L -WoodYoyo D -CorruptYoyo D -CrimsonYoyo D -JungleYoyo D -Cascade D -Chik D -Code2 D -Rally D -Yelets D -RedsYoyo D -ValkyrieYoyo D -Amarok D -HelFire D -Kraken D -TheEyeOfCthulhu D -RedString D -OrangeString D -YellowString D -LimeString D -GreenString D -TealString D -CyanString D -SkyBlueString D -BlueString D -PurpleString D -VioletString D -PinkString D -BrownString D -WhiteString D -RainbowString D -BlackString D -BlackCounterweight D -BlueCounterweight D -GreenCounterweight D -PurpleCounterweight D -RedCounterweight D -YellowCounterweight D -FormatC D -Gradient D -Valor D -KingSlimeBossBag G -EyeOfCthulhuBossBag G -EaterOfWorldsBossBag G -BrainOfCthulhuBossBag G -QueenBeeBossBag G -SkeletronBossBag G -WallOfFleshBossBag G -DestroyerBossBag G -TwinsBossBag G -SkeletronPrimeBossBag G -PlanteraBossBag G -GolemBossBag G -FishronBossBag G -CultistBossBag E -MoonLordBossBag G -HiveBackpack D -YoYoGlove D -DemonHeart D -SporeSac D -ShinyStone D -HallowHardenedSand L -HallowSandstone L -HardenedSandWall O -CorruptHardenedSandWall O -CrimsonHardenedSandWall O -HallowHardenedSandWall O -CorruptSandstoneWall O -CrimsonSandstoneWall O -HallowSandstoneWall O -DesertFossil M -DesertFossilWall O -DyeTradersScimitar D -PainterPaintballGun D -TaxCollectorsStickOfDoom D -StylistKilLaKillScissorsIWish D -MinecartMech D -MechanicalWheelPiece D -MechanicalWagonPiece D -MechanicalBatteryPiece D -AncientCultistTrophy D -MartianSaucerTrophy D -FlyingDutchmanTrophy D -LivingMahoganyWand D -LivingMahoganyLeafWand D -FallenTuxedoShirt D -FallenTuxedoPants D -Fireplace D -Chimney D -YoyoBag D -ShrimpyTruffle D -Arkhalis D -ConfettiCannon D -MusicBoxTowers D -MusicBoxGoblins D -BossMaskCultist D -BossMaskMoonlord D -FossilHelm D -FossilShirt D -FossilPants D -AmberStaff D -BoneJavelin K -BoneDagger K -FossilOre L -StardustHelmet D -StardustBreastplate D -StardustLeggings D -PortalGun D -StrangePlant1 G -StrangePlant2 G -StrangePlant3 G -StrangePlant4 G -Terrarian D -GoblinSummonerBanner D -SalamanderBanner D -GiantShellyBanner D -CrawdadBanner D -FritzBanner D -CreatureFromTheDeepBanner D -DrManFlyBanner D -MothronBanner D -SeveredHandBanner E -ThePossessedBanner D -ButcherBanner D -PsychoBanner D -DeadlySphereBanner D -NailheadBanner D -PoisonousSporeBanner E -MedusaBanner D -GreekSkeletonBanner D -GraniteFlyerBanner D -GraniteGolemBanner D -BloodZombieBanner D -DripplerBanner D -TombCrawlerBanner D -DuneSplicerBanner D -FlyingAntlionBanner D -WalkingAntlionBanner D -DesertGhoulBanner D -DesertLamiaBanner D -DesertDjinnBanner D -DesertBasiliskBanner D -RavagerScorpionBanner D -StardustSoldierBanner D -StardustWormBanner D -StardustJellyfishBanner D -StardustSpiderBanner D -StardustSmallCellBanner E -StardustLargeCellBanner D -SolarCoriteBanner D -SolarSrollerBanner D -SolarCrawltipedeBanner D -SolarDrakomireRiderBanner D -SolarDrakomireBanner D -SolarSolenianBanner D -NebulaSoldierBanner D -NebulaHeadcrabBanner D -NebulaBrainBanner D -NebulaBeastBanner D -VortexLarvaBanner D -VortexHornetQueenBanner D -VortexHornetBanner D -VortexSoldierBanner D -VortexRiflemanBanner D -PirateCaptainBanner D -PirateDeadeyeBanner D -PirateCorsairBanner D -PirateCrossbowerBanner D -MartianWalkerBanner D -RedDevilBanner D -PinkJellyfishBanner D -GreenJellyfishBanner D -DarkMummyBanner D -LightMummyBanner D -AngryBonesBanner D -IceTortoiseBanner D -NebulaPickup1 E -NebulaPickup2 E -NebulaPickup3 E -FragmentVortex B -FragmentNebula B -FragmentSolar B -FragmentStardust B -LunarOre L -LunarBrick L -StardustAxe E -StardustChainsaw E -StardustDrill D -StardustHammer E -StardustPickaxe D -LunarBar B -WingsSolar D -WingsVortex D -WingsNebula D -WingsStardust D -LunarBrickWall O -SolarEruption D -StardustCellStaff D -VortexBeater D -NebulaArcanum D -BloodWater K -TheBrideHat D -TheBrideDress D -PlatinumBow D -PlatinumHammer D -PlatinumAxe D -PlatinumShortsword D -PlatinumBroadsword D -PlatinumPickaxe D -TungstenBow D -TungstenHammer D -TungstenAxe D -TungstenShortsword D -TungstenBroadsword D -TungstenPickaxe D -LeadBow D -LeadHammer D -LeadAxe D -LeadShortsword D -LeadBroadsword D -LeadPickaxe D -TinBow D -TinHammer D -TinAxe D -TinShortsword D -TinBroadsword D -TinPickaxe D -CopperBow D -CopperHammer D -CopperAxe D -CopperShortsword D -CopperBroadsword D -CopperPickaxe D -SilverBow D -SilverHammer D -SilverAxe D -SilverShortsword D -SilverBroadsword D -SilverPickaxe D -GoldBow D -GoldHammer D -GoldAxe D -GoldShortsword D -GoldBroadsword D -GoldPickaxe D -LunarHamaxeSolar D -LunarHamaxeVortex D -LunarHamaxeNebula D -LunarHamaxeStardust D -SolarDye G -NebulaDye G -VortexDye G -StardustDye G -VoidDye G -StardustDragonStaff D -Bacon H -ShiftingSandsDye G -MirageDye G -ShiftingPearlSandsDye G -VortexMonolith D -NebulaMonolith D -StardustMonolith D -SolarMonolith D -Phantasm D -LastPrism D -NebulaBlaze D -DayBreak D -SuperHealingPotion J -Detonator D -FireworksLauncher D -BouncyDynamite K -PartyGirlGrenade K -LunarCraftingStation D -FlameAndSilverDye G -GreenFlameAndSilverDye G -BlueFlameAndSilverDye G -ReflectiveCopperDye G -ReflectiveObsidianDye G -ReflectiveMetalDye G -MidnightRainbowDye G -BlackAndWhiteDye G -BrightSilverDye G -SilverAndBlackDye G -RedAcidDye G -GelDye G -PinkGelDye G -SquirrelRed C -SquirrelGold G -SquirrelOrangeCage D -SquirrelGoldCage D -MoonlordBullet K -MoonlordArrow K -MoonlordTurretStaff D -LunarFlareBook D -RainbowCrystalStaff D -LunarHook D -LunarBlockSolar L -LunarBlockVortex L -LunarBlockNebula L -LunarBlockStardust L -SuspiciousLookingTentacle D -Yoraiz0rShirt D -Yoraiz0rPants D -Yoraiz0rWings D -Yoraiz0rDarkness D -JimsWings D -Yoraiz0rHead D -LivingLeafWall O -SkiphsHelm D -SkiphsShirt D -SkiphsPants D -SkiphsWings D -LokisHelm D -LokisShirt D -LokisPants D -LokisWings D -SandSlimeBanner D -SeaSnailBanner D -MoonLordTrophy D -MoonLordPainting D -BurningHadesDye G -GrimDye G -LokisDye G -ShadowflameHadesDye G -CelestialSigil G -LogicGateLamp_Off C -LogicGate_AND C -LogicGate_OR C -LogicGate_NAND C -LogicGate_NOR C -LogicGate_XOR C -LogicGate_NXOR C -ConveyorBeltLeft L -ConveyorBeltRight L -WireKite D -YellowWrench D -LogicSensor_Sun C -LogicSensor_Moon C -LogicSensor_Above C -WirePipe B -AnnouncementBox D -LogicGateLamp_On C -MechanicalLens D -ActuationRod D -TeamBlockRed L -TeamBlockRedPlatform M -StaticHook D -ActuationAccessory D -MulticolorWrench D -WeightedPressurePlatePink C -EngineeringHelmet D -CompanionCube D -WireBulb C -WeightedPressurePlateOrange C -WeightedPressurePlatePurple C -WeightedPressurePlateCyan C -TeamBlockGreen L -TeamBlockBlue L -TeamBlockYellow L -TeamBlockPink L -TeamBlockWhite L -TeamBlockGreenPlatform M -TeamBlockBluePlatform M -TeamBlockYellowPlatform M -TeamBlockPinkPlatform M -TeamBlockWhitePlatform M -LargeAmber D -GemLockRuby D -GemLockSapphire D -GemLockEmerald D -GemLockTopaz D -GemLockAmethyst D -GemLockDiamond D -GemLockAmber D -SquirrelStatue D -ButterflyStatue D -WormStatue D -FireflyStatue D -ScorpionStatue D -SnailStatue D -GrasshopperStatue D -MouseStatue D -DuckStatue D -PenguinStatue D -FrogStatue D -BuggyStatue D -LogicGateLamp_Faulty C -PortalGunStation D -Fake_Chest D -Fake_GoldChest D -Fake_ShadowChest D -Fake_EbonwoodChest D -Fake_RichMahoganyChest D -Fake_PearlwoodChest D -Fake_IvyChest D -Fake_IceChest D -Fake_LivingWoodChest D -Fake_SkywareChest D -Fake_ShadewoodChest D -Fake_WebCoveredChest D -Fake_LihzahrdChest D -Fake_WaterChest D -Fake_JungleChest D -Fake_CorruptionChest D -Fake_CrimsonChest D -Fake_HallowedChest D -Fake_FrozenChest D -Fake_DynastyChest D -Fake_HoneyChest D -Fake_SteampunkChest D -Fake_PalmWoodChest D -Fake_MushroomChest D -Fake_BorealWoodChest D -Fake_SlimeChest D -Fake_GreenDungeonChest D -Fake_PinkDungeonChest D -Fake_BlueDungeonChest D -Fake_BoneChest D -Fake_CactusChest D -Fake_FleshChest D -Fake_ObsidianChest D -Fake_PumpkinChest D -Fake_SpookyChest D -Fake_GlassChest D -Fake_MartianChest D -Fake_MeteoriteChest D -Fake_GraniteChest D -Fake_MarbleChest D -Fake_newchest1 E -Fake_newchest2 E -ProjectilePressurePad C -WallCreeperStatue D -UnicornStatue D -DripplerStatue D -WraithStatue D -BoneSkeletonStatue D -UndeadVikingStatue D -MedusaStatue D -HarpyStatue D -PigronStatue D -HopliteStatue D -GraniteGolemStatue D -ZombieArmStatue D -BloodZombieStatue D -AnglerTackleBag D -GeyserTrap C -UltraBrightCampfire D -BoneCampfire D -PixelBox E -LogicSensor_Water C -LogicSensor_Lava C -LogicSensor_Honey C -LogicSensor_Liquid C -PartyBundleOfBalloonsAccessory D -PartyBalloonAnimal D -PartyHat D -FlowerBoyHat D -FlowerBoyShirt D -FlowerBoyPants D -SillyBalloonPink L -SillyBalloonPurple L -SillyBalloonGreen L -SillyStreamerBlue L -SillyStreamerGreen L -SillyStreamerPink L -SillyBalloonMachine D -SillyBalloonTiedPink D -SillyBalloonTiedPurple D -SillyBalloonTiedGreen D -Pigronata D -PartyMonolith D -PartyBundleOfBalloonTile D -PartyPresent D -SliceOfCake G -CogWall O -SandFallWall O -SnowFallWall O -SandFallBlock L -SnowFallBlock L -SnowCloudBlock L -PedguinHat D -PedguinShirt D -PedguinPants D -SillyBalloonPinkWall O -SillyBalloonPurpleWall O -SillyBalloonGreenWall O -AviatorSunglasses D -BluePhasesaber D -RedPhasesaber D -GreenPhasesaber D -PurplePhasesaber D -WhitePhasesaber D -YellowPhasesaber D -DjinnsCurse D -AncientHorn D -AntlionClaw D -AncientArmorHat D -AncientArmorShirt D -AncientArmorPants D -AncientBattleArmorHat D -AncientBattleArmorShirt D -AncientBattleArmorPants D -SpiritFlame D -SandElementalBanner D -PocketMirror D -MagicSandDropper D -AncientBattleArmorMaterial G -LamiaPants D -LamiaShirt D -LamiaHat D -SkyFracture D -OnyxBlaster D -SandsharkBanner D -SandsharkCorruptBanner D -SandsharkCrimsonBanner D -SandsharkHallowedBanner D -TumbleweedBanner D -AncientCloth C -DjinnLamp D -MusicBoxSandstorm D -ApprenticeHat D -ApprenticeRobe D -ApprenticeTrousers D -SquireGreatHelm D -SquirePlating D -SquireGreaves D -HuntressWig D -HuntressJerkin D -HuntressPants D -MonkBrows D -MonkShirt D -MonkPants D -ApprenticeScarf D -SquireShield D -HuntressBuckler D -MonkBelt D -DefendersForge D -WarTable D -WarTableBanner D -DD2ElderCrystalStand D -DefenderMedal A -DD2FlameburstTowerT1Popper D -DD2FlameburstTowerT2Popper D -DD2FlameburstTowerT3Popper D -AleThrowingGlove D -DD2EnergyCrystal E -DD2SquireDemonSword D -DD2BallistraTowerT1Popper D -DD2BallistraTowerT2Popper D -DD2BallistraTowerT3Popper D -DD2SquireBetsySword D -DD2ElderCrystal G -DD2LightningAuraT1Popper D -DD2LightningAuraT2Popper D -DD2LightningAuraT3Popper D -DD2ExplosiveTrapT1Popper D -DD2ExplosiveTrapT2Popper D -DD2ExplosiveTrapT3Popper D -MonkStaffT1 D -MonkStaffT2 D -DD2GoblinBomberBanner D -DD2GoblinBanner D -DD2SkeletonBanner D -DD2DrakinBanner D -DD2KoboldFlyerBanner D -DD2KoboldBanner D -DD2WitherBeastBanner D -DD2WyvernBanner D -DD2JavelinThrowerBanner D -DD2LightningBugBanner D -OgreMask E -GoblinMask E -GoblinBomberCap E -EtherianJavelin E -KoboldDynamiteBackpack E -BookStaff D -BoringBow E -DD2PhoenixBow D -DD2PetGato D -DD2PetGhost D -DD2PetDragon D -MonkStaffT3 D -DD2BetsyBow D -BossBagBetsy G -BossBagOgre E -BossBagDarkMage E -BossMaskBetsy D -BossMaskDarkMage D -BossMaskOgre D -BossTrophyBetsy D -BossTrophyDarkmage D -BossTrophyOgre D -MusicBoxDD2 D -ApprenticeStaffT3 D -SquireAltHead D -SquireAltShirt D -SquireAltPants D -ApprenticeAltHead D -ApprenticeAltShirt D -ApprenticeAltPants D -HuntressAltHead D -HuntressAltShirt D -HuntressAltPants D -MonkAltHead D -MonkAltShirt D -MonkAltPants D -BetsyWings D -CrystalChest D -GoldenChest D -Fake_CrystalChest D -Fake_GoldenChest D -CrystalDoor D -CrystalChair D -CrystalCandle D -CrystalLantern D -CrystalLamp D -CrystalCandelabra D -CrystalChandelier D -CrystalBathtub D -CrystalSink D -CrystalBed D -CrystalClock D -SkywareClock2 D -DungeonClockBlue D -DungeonClockGreen D -DungeonClockPink D -CrystalPlatform M -GoldenPlatform M -DynastyPlatform M -LihzahrdPlatform M -FleshPlatform M -FrozenPlatform M -CrystalWorkbench D -GoldenWorkbench D -CrystalDresser D -DynastyDresser D -FrozenDresser D -LivingWoodDresser D -CrystalPiano D -DynastyPiano D -CrystalBookCase D -CrystalSofaHowDoesThatEvenWork D -DynastySofa D -CrystalTable D -ArkhalisHat D -ArkhalisShirt D -ArkhalisPants D -ArkhalisWings D -LeinforsHat D -LeinforsShirt D -LeinforsPants D -LeinforsWings D -LeinforsAccessory D -Celeb2 D -SpiderBathtub D -SpiderBed D -SpiderBookcase D -SpiderDresser D -SpiderCandelabra D -SpiderCandle D -SpiderChair D -SpiderChandelier D -SpiderChest D -SpiderClock D -SpiderDoor D -SpiderLamp D -SpiderLantern D -SpiderPiano D -SpiderPlatform M -SpiderSinkSpiderSinkDoesWhateverASpiderSinkDoes D -SpiderSofa D -SpiderTable D -SpiderWorkbench D -Fake_SpiderChest D -IronBrick L -IronBrickWall O -LeadBrick L -LeadBrickWall O -LesionBlock L -LesionBlockWall O -LesionPlatform M -LesionBathtub D -LesionBed D -LesionBookcase D -LesionCandelabra D -LesionCandle D -LesionChair D -LesionChandelier D -LesionChest D -LesionClock D -LesionDoor D -LesionDresser D -LesionLamp D -LesionLantern D -LesionPiano D -LesionSink D -LesionSofa D -LesionTable D -LesionWorkbench D -Fake_LesionChest D -HatRack D -ColorOnlyDye E -WoodenCrateHard H -IronCrateHard H -GoldenCrateHard H -CorruptFishingCrateHard H -CrimsonFishingCrateHard H -DungeonFishingCrateHard H -FloatingIslandFishingCrateHard H -HallowedFishingCrateHard H -JungleFishingCrateHard H -DeadMansChest D -GolfBall D -AmphibianBoots D -ArcaneFlower D -BerserkerGlove D -FairyBoots D -FrogFlipper D -FrogGear D -FrogWebbing D -FrozenShield D -HeroShield D -LavaSkull D -MagnetFlower D -ManaCloak D -MoltenQuiver D -MoltenSkullRose D -ObsidianSkullRose D -ReconScope D -StalkersQuiver D -StingerNecklace D -UltrabrightHelmet D -Apple C -ApplePieSlice E -ApplePie H -BananaSplit H -BBQRibs H -BunnyStew H -Burger H -ChickenNugget H -ChocolateChipCookie H -CreamSoda H -Escargot H -FriedEgg H -Fries H -GoldenDelight H -Grapes H -GrilledSquirrel H -Hotdog H -IceCream H -Milkshake H -Nachos H -Pizza H -PotatoChips H -RoastedBird H -RoastedDuck H -SauteedFrogLegs H -SeafoodDinner H -ShrimpPoBoy H -Spaghetti H -Steak H -MoltenCharm D -GolfClubIron D -GolfCup D -FlowerPacketBlue B -FlowerPacketMagenta B -FlowerPacketPink B -FlowerPacketRed B -FlowerPacketYellow B -FlowerPacketViolet B -FlowerPacketWhite B -FlowerPacketTallGrass B -LawnMower D -CrimstoneBrick L -SmoothSandstone L -CrimstoneBrickWall O -SmoothSandstoneWall O -BloodMoonMonolith D -SandBoots D -AncientChisel D -CarbonGuitar D -SkeletonBow E -FossilPickaxe D -SuperStarCannon D -ThunderSpear D -ThunderStaff D -DrumSet D -PicnicTable D -PicnicTableWithCloth D -DesertMinecart D -FishMinecart D -FairyCritterPink G -FairyCritterGreen G -FairyCritterBlue G -JunoniaShell D -LightningWhelkShell D -TulipShell D -PinWheel D -WeatherVane D -VoidVault D -MusicBoxOceanAlt D -MusicBoxSlimeRain D -MusicBoxSpaceAlt D -MusicBoxTownDay D -MusicBoxTownNight D -MusicBoxWindyDay D -GolfCupFlagWhite D -GolfCupFlagRed D -GolfCupFlagGreen D -GolfCupFlagBlue D -GolfCupFlagYellow D -GolfCupFlagPurple D -GolfTee D -ShellPileBlock L -AntiPortalBlock L -GolfClubPutter D -GolfClubWedge D -GolfClubDriver D -GolfWhistle D -ToiletEbonyWood D -ToiletRichMahogany D -ToiletPearlwood D -ToiletLivingWood D -ToiletCactus D -ToiletBone D -ToiletFlesh D -ToiletMushroom D -ToiletSunplate D -ToiletShadewood D -ToiletLihzhard D -ToiletDungeonBlue D -ToiletDungeonGreen D -ToiletDungeonPink D -ToiletObsidian D -ToiletFrozen D -ToiletGlass D -ToiletHoney D -ToiletSteampunk D -ToiletPumpkin D -ToiletSpooky D -ToiletDynasty D -ToiletPalm D -ToiletBoreal D -ToiletSlime D -ToiletMartian D -ToiletGranite D -ToiletMarble D -ToiletCrystal D -ToiletSpider D -ToiletLesion D -ToiletDiamond D -MaidHead D -MaidShirt D -MaidPants D -VoidLens D -MaidHead2 D -MaidShirt2 D -MaidPants2 D -GolfHat D -GolfShirt D -GolfPants D -GolfVisor D -SpiderBlock L -SpiderWall O -ToiletMeteor D -LesionStation D -ManaCloakStar D -Terragrim D -SolarBathtub D -SolarBed D -SolarBookcase D -SolarDresser D -SolarCandelabra D -SolarCandle D -SolarChair D -SolarChandelier D -SolarChest D -SolarClock D -SolarDoor D -SolarLamp D -SolarLantern D -SolarPiano D -SolarPlatform M -SolarSink D -SolarSofa D -SolarTable D -SolarWorkbench D -Fake_SolarChest D -SolarToilet D -VortexBathtub D -VortexBed D -VortexBookcase D -VortexDresser D -VortexCandelabra D -VortexCandle D -VortexChair D -VortexChandelier D -VortexChest D -VortexClock D -VortexDoor D -VortexLamp D -VortexLantern D -VortexPiano D -VortexPlatform M -VortexSink D -VortexSofa D -VortexTable D -VortexWorkbench D -Fake_VortexChest D -VortexToilet D -NebulaBathtub D -NebulaBed D -NebulaBookcase D -NebulaDresser D -NebulaCandelabra D -NebulaCandle D -NebulaChair D -NebulaChandelier D -NebulaChest D -NebulaClock D -NebulaDoor D -NebulaLamp D -NebulaLantern D -NebulaPiano D -NebulaPlatform M -NebulaSink D -NebulaSofa D -NebulaTable D -NebulaWorkbench D -Fake_NebulaChest D -NebulaToilet D -StardustBathtub D -StardustBed D -StardustBookcase D -StardustDresser D -StardustCandelabra D -StardustCandle D -StardustChair D -StardustChandelier D -StardustChest D -StardustClock D -StardustDoor D -StardustLamp D -StardustLantern D -StardustPiano D -StardustPlatform M -StardustSink D -StardustSofa D -StardustTable D -StardustWorkbench D -Fake_StardustChest D -StardustToilet D -SolarBrick L -VortexBrick L -NebulaBrick L -StardustBrick L -SolarBrickWall O -VortexBrickWall O -NebulaBrickWall O -StardustBrickWall O -MusicBoxDayRemix D -CrackedBlueBrick L -CrackedGreenBrick L -CrackedPinkBrick L -FlowerPacketWild B -GolfBallDyedBlack D -GolfBallDyedBlue D -GolfBallDyedBrown D -GolfBallDyedCyan D -GolfBallDyedGreen D -GolfBallDyedLimeGreen D -GolfBallDyedOrange D -GolfBallDyedPink D -GolfBallDyedPurple D -GolfBallDyedRed D -GolfBallDyedSkyBlue D -GolfBallDyedTeal D -GolfBallDyedViolet D -GolfBallDyedYellow D -AmberRobe D -AmberHook D -OrangePhaseblade D -OrangePhasesaber D -OrangeStainedGlass O -OrangePressurePlate C -MysticCoilSnake D -MagicConch D -GolfCart D -GolfChest D -Fake_GolfChest D -DesertChest D -Fake_DesertChest D -SanguineStaff D -SharpTears D -BloodMoonStarter G -DripplerFlail D -VampireFrogStaff D -GoldGoldfish G -GoldGoldfishBowl D -CatBast D -GoldStarryGlassBlock L -BlueStarryGlassBlock L -GoldStarryGlassWall O -BlueStarryGlassWall O -BabyBirdStaff D -Apricot C -Banana C -BlackCurrant C -BloodOrange C -Cherry C -Coconut C -Dragonfruit C -Elderberry C -Grapefruit C -Lemon C -Mango C -Peach C -Pineapple C -Plum C -Rambutan C -Starfruit C -SandstoneBathtub D -SandstoneBed D -SandstoneBookcase D -SandstoneDresser D -SandstoneCandelabra D -SandstoneCandle D -SandstoneChair D -SandstoneChandelier D -SandstoneClock D -SandstoneDoor D -SandstoneLamp D -SandstoneLantern D -SandstonePiano D -SandstonePlatform M -SandstoneSink D -SandstoneSofa D -SandstoneTable D -SandstoneWorkbench D -SandstoneToilet D -BloodHamaxe D -VoidMonolith D -ArrowSign D -PaintedArrowSign D -GameMasterShirt D -GameMasterPants D -StarPrincessCrown D -StarPrincessDress D -BloodFishingRod D -FoodPlatter D -BlackDragonflyJar D -BlueDragonflyJar D -GreenDragonflyJar D -OrangeDragonflyJar D -RedDragonflyJar D -YellowDragonflyJar D -GoldDragonflyJar D -BlackDragonfly C -BlueDragonfly C -GreenDragonfly C -OrangeDragonfly C -RedDragonfly C -YellowDragonfly C -GoldDragonfly G -PortableStool D -DragonflyStatue D -PaperAirplaneA D -PaperAirplaneB D -CanOfWorms F -EncumberingStone D -ZapinatorGray D -ZapinatorOrange D -GreenMoss B -BrownMoss B -RedMoss B -BlueMoss B -PurpleMoss B -LavaMoss B -BoulderStatue D -MusicBoxTitleAlt D -MusicBoxStorm D -MusicBoxGraveyard D -Seagull C -SeagullStatue D -LadyBug C -GoldLadyBug G -Maggot C -MaggotCage D -CelestialWand D -EucaluptusSap D -KiteBlue D -KiteBlueAndYellow D -KiteRed D -KiteRedAndYellow D -KiteYellow D -IvyGuitar D -Pupfish C -Grebe C -Rat C -RatCage D -KryptonMoss B -XenonMoss B -KiteWyvern D -LadybugCage D -BloodRainBow D -CombatBook D -DesertTorch L -CoralTorch L -CorruptTorch L -CrimsonTorch L -HallowedTorch L -JungleTorch L -ArgonMoss B -RollingCactus C -ThinIce L -EchoBlock L -ScarabFish F -ScorpioFish F -Owl C -OwlCage D -OwlStatue D -PupfishBowl D -GoldLadybugCage D -Geode C -Flounder G -RockLobster G -LobsterTail H -FloatingTube D -FrozenCrate H -FrozenCrateHard H -OasisCrate H -OasisCrateHard H -SpectreGoggles D -Oyster C -ShuckedOyster H -WhitePearl C -BlackPearl C -PinkPearl C -StoneDoor D -StonePlatform M -OasisFountain D -WaterStrider C -GoldWaterStrider G -LawnFlamingo D -MusicBoxUndergroundJungle D -Grate L -ScarabBomb K -WroughtIronFence O -SharkBait D -BeeMinecart D -LadybugMinecart D -PigronMinecart D -SunflowerMinecart D -PottedForestCedar D -PottedJungleCedar D -PottedHallowCedar D -PottedForestTree D -PottedJungleTree D -PottedHallowTree D -PottedForestPalm D -PottedJunglePalm D -PottedHallowPalm D -PottedForestBamboo D -PottedJungleBamboo D -PottedHallowBamboo D -ScarabFishingRod D -HellMinecart D -WitchBroom D -ClusterRocketI K -ClusterRocketII K -WetRocket K -LavaRocket K -HoneyRocket K -ShroomMinecart D -AmethystMinecart D -TopazMinecart D -SapphireMinecart D -EmeraldMinecart D -RubyMinecart D -DiamondMinecart D -MiniNukeI K -MiniNukeII K -DryRocket K -SandcastleBucket D -TurtleCage D -TurtleJungleCage D -Gladius D -Turtle C -TurtleJungle C -TurtleStatue D -AmberMinecart D -BeetleMinecart D -MeowmereMinecart D -PartyMinecart D -PirateMinecart D -SteampunkMinecart D -GrebeCage D -SeagullCage D -WaterStriderCage D -GoldWaterStriderCage D -LuckPotionLesser N -LuckPotion N -LuckPotionGreater N -Seahorse C -SeahorseCage D -GoldSeahorse G -GoldSeahorseCage D -TimerOneHalfSecond D -TimerOneFourthSecond D -EbonstoneEcho O -MudWallEcho O -PearlstoneEcho O -SnowWallEcho O -AmethystEcho O -TopazEcho O -SapphireEcho O -EmeraldEcho O -RubyEcho O -DiamondEcho O -Cave1Echo O -Cave2Echo O -Cave3Echo O -Cave4Echo O -Cave5Echo O -Cave6Echo O -Cave7Echo O -SpiderEcho O -CorruptGrassEcho O -HallowedGrassEcho O -IceEcho O -ObsidianBackEcho O -CrimsonGrassEcho O -CrimstoneEcho O -CaveWall1Echo O -CaveWall2Echo O -Cave8Echo O -Corruption1Echo O -Corruption2Echo O -Corruption3Echo O -Corruption4Echo O -Crimson1Echo O -Crimson2Echo O -Crimson3Echo O -Crimson4Echo O -Dirt1Echo O -Dirt2Echo O -Dirt3Echo O -Dirt4Echo O -Hallow1Echo O -Hallow2Echo O -Hallow3Echo O -Hallow4Echo O -Jungle1Echo O -Jungle2Echo O -Jungle3Echo O -Jungle4Echo O -Lava1Echo O -Lava2Echo O -Lava3Echo O -Lava4Echo O -Rocks1Echo O -Rocks2Echo O -Rocks3Echo O -Rocks4Echo O -TheBrideBanner D -ZombieMermanBanner D -EyeballFlyingFishBanner D -BloodSquidBanner D -BloodEelBanner D -GoblinSharkBanner D -LargeBambooBlock L -LargeBambooBlockWall O -DemonHorns D -BambooLeaf D -HellCake D -FogMachine D -PlasmaLamp D -MarbleColumn A -ChefHat D -ChefShirt D -ChefPants D -StarHairpin D -HeartHairpin D -BunnyEars D -DevilHorns D -Fedora D -UnicornHornHat D -BambooBlock L -BambooBlockWall O -BambooBathtub D -BambooBed D -BambooBookcase D -BambooDresser D -BambooCandelabra D -BambooCandle D -BambooChair D -BambooChandelier D -BambooChest D -BambooClock D -BambooDoor D -BambooLamp D -BambooLantern D -BambooPiano D -BambooPlatform M -BambooSink D -BambooSofa D -BambooTable D -BambooWorkbench D -Fake_BambooChest D -BambooToilet D -GolfClubStoneIron D -GolfClubRustyPutter D -GolfClubBronzeWedge D -GolfClubWoodDriver D -GolfClubMythrilIron D -GolfClubLeadPutter D -GolfClubGoldWedge D -GolfClubPearlwoodDriver D -GolfClubTitaniumIron D -GolfClubShroomitePutter D -GolfClubDiamondWedge D -GolfClubChlorophyteDriver D -GolfTrophyBronze D -GolfTrophySilver D -GolfTrophyGold D -BloodNautilusBanner D -BirdieRattle D -ExoticEasternChewToy D -BedazzledNectar D -MusicBoxJungleNight D -StormTigerStaff D -ChumBucket B -GardenGnome D -KiteBoneSerpent D -KiteWorldFeeder D -KiteBunny D -KitePigron D -AppleJuice H -GrapeJuice H -Lemonade H -BananaDaiquiri H -PeachSangria H -PinaColada H -TropicalSmoothie H -BloodyMoscato H -SmoothieofDarkness H -PrismaticPunch H -FruitJuice H -FruitSalad H -AndrewSphinx D -WatchfulAntlion D -BurningSpirit D -JawsOfDeath D -TheSandsOfSlime D -SnakesIHateSnakes D -LifeAboveTheSand D -Oasis D -PrehistoryPreserved D -AncientTablet D -Uluru D -VisitingThePyramids D -BandageBoy D -DivineEye D -AmethystStoneBlock L -TopazStoneBlock L -SapphireStoneBlock L -EmeraldStoneBlock L -RubyStoneBlock L -DiamondStoneBlock L -AmberStoneBlock L -AmberStoneWallEcho O -KiteManEater D -KiteJellyfishBlue D -KiteJellyfishPink D -KiteShark D -SuperHeroMask D -SuperHeroCostume D -SuperHeroTights D -PinkFairyJar D -GreenFairyJar D -BlueFairyJar D -GolfPainting1 D -GolfPainting2 D -GolfPainting3 D -GolfPainting4 D -FogboundDye G -BloodbathDye G -PrettyPinkDressSkirt D -PrettyPinkDressPants D -PrettyPinkRibbon D -BambooFence O -GlowPaint L -KiteSandShark D -KiteBunnyCorrupt D -KiteBunnyCrimson D -BlandWhip D -DrumStick D -KiteGoldfish D -KiteAngryTrapper D -KiteKoi D -KiteCrawltipede D -SwordWhip D -MaceWhip D -ScytheWhip D -KiteSpectrum D -ReleaseDoves C -KiteWanderingEye D -KiteUnicorn D -UndertakerHat D -UndertakerCoat D -DandelionBanner D -GnomeBanner D -DesertCampfire D -CoralCampfire D -CorruptCampfire D -CrimsonCampfire D -HallowedCampfire D -JungleCampfire D -SoulBottleLight D -SoulBottleNight D -SoulBottleFlight D -SoulBottleSight D -SoulBottleMight D -SoulBottleFright D -MudBud D -ReleaseLantern C -QuadBarrelShotgun D -FuneralHat D -FuneralCoat D -FuneralPants D -TragicUmbrella D -VictorianGothHat D -VictorianGothDress D -TatteredWoodSign D -GravediggerShovel D -DungeonDesertChest D -Fake_DungeonDesertChest D -DungeonDesertKey D -SparkleGuitar D -MolluskWhistle D -BorealBeam A -RichMahoganyBeam A -GraniteColumn A -SandstoneColumn A -MushroomBeam A -FirstFractal D -Nevermore D -Reborn D -Graveyard D -GhostManifestation D -WickedUndead D -BloodyGoblet D -StillLife D -GhostarsWings D -TerraToilet D -GhostarSkullPin D -GhostarShirt D -GhostarPants D -BallOfFuseWire D -FullMoonSqueakyToy D -OrnateShadowKey D -DrManFlyMask D -DrManFlyLabCoat D -ButcherMask D -ButcherApron D -ButcherPants D -Football D -HunterCloak D -CoffinMinecart D -SafemanWings D -SafemanSunHair D -SafemanSunDress D -SafemanDressLeggings D -FoodBarbarianWings D -FoodBarbarianHelm D -FoodBarbarianArmor D -FoodBarbarianGreaves D -GroxTheGreatWings D -GroxTheGreatHelm D -GroxTheGreatArmor D -GroxTheGreatGreaves D -Smolstar D -SquirrelHook D -BouncingShield D -RockGolemHead D -CritterShampoo D -DiggingMoleMinecart D -Shroomerang D -TreeGlobe D -WorldGlobe D -DontHurtCrittersBook D -DogEars D -DogTail D -FoxEars D -FoxTail D -LizardEars D -LizardTail D -PandaEars D -BunnyTail D -FairyGlowstick L -LightningCarrot D -HallowBossDye G -MushroomHat D -MushroomVest D -MushroomPants D -FairyQueenBossBag G -FairyQueenTrophy D -FairyQueenMask D -PaintedHorseSaddle D -MajesticHorseSaddle D -DarkHorseSaddle D -JoustingLance D -ShadowJoustingLance D -HallowJoustingLance D -PogoStick D -PirateShipMountItem D -SpookyWoodMountItem D -SantankMountItem D -WallOfFleshGoatMountItem D -DarkMageBookMountItem D -KingSlimePetItem D -EyeOfCthulhuPetItem D -EaterOfWorldsPetItem D -BrainOfCthulhuPetItem D -SkeletronPetItem D -QueenBeePetItem D -DestroyerPetItem D -TwinsPetItem D -SkeletronPrimePetItem D -PlanteraPetItem D -GolemPetItem D -DukeFishronPetItem D -LunaticCultistPetItem D -MoonLordPetItem D -FairyQueenPetItem D -PumpkingPetItem D -EverscreamPetItem D -IceQueenPetItem D -MartianPetItem D -DD2OgrePetItem D -DD2BetsyPetItem D -CombatWrench D -DemonConch D -BottomlessLavaBucket D -FireproofBugNet D -FlameWakerBoots D -RainbowWings D -WetBomb K -LavaBomb K -HoneyBomb K -DryBomb K -SuperheatedBlood D -LicenseCat D -LicenseDog D -GemSquirrelAmethyst C -GemSquirrelTopaz C -GemSquirrelSapphire C -GemSquirrelEmerald C -GemSquirrelRuby C -GemSquirrelDiamond C -GemSquirrelAmber C -GemBunnyAmethyst C -GemBunnyTopaz C -GemBunnySapphire C -GemBunnyEmerald C -GemBunnyRuby C -GemBunnyDiamond C -GemBunnyAmber C -HellButterfly C -HellButterflyJar D -Lavafly C -LavaflyinaBottle D -MagmaSnail C -MagmaSnailCage D -GemTreeTopazSeed C -GemTreeAmethystSeed C -GemTreeSapphireSeed C -GemTreeEmeraldSeed C -GemTreeRubySeed C -GemTreeDiamondSeed C -GemTreeAmberSeed C -PotSuspended D -PotSuspendedDaybloom D -PotSuspendedMoonglow D -PotSuspendedWaterleaf D -PotSuspendedShiverthorn D -PotSuspendedBlinkroot D -PotSuspendedDeathweedCorrupt D -PotSuspendedDeathweedCrimson D -PotSuspendedFireblossom D -BrazierSuspended D -VolcanoSmall D -VolcanoLarge D -PotionOfReturn N -VanityTreeSakuraSeed b -LavaAbsorbantSponge D -HallowedHood D -HellfireTreads D -TeleportationPylonJungle D -TeleportationPylonPurity D -LavaCrate H -LavaCrateHard H -ObsidianLockbox H -LavaFishbowl D -LavaFishingHook D -AmethystBunnyCage D -TopazBunnyCage D -SapphireBunnyCage D -EmeraldBunnyCage D -RubyBunnyCage D -DiamondBunnyCage D -AmberBunnyCage D -AmethystSquirrelCage D -TopazSquirrelCage D -SapphireSquirrelCage D -EmeraldSquirrelCage D -RubySquirrelCage D -DiamondSquirrelCage D -AmberSquirrelCage D -AncientHallowedMask D -AncientHallowedHelmet D -AncientHallowedHeadgear D -AncientHallowedHood D -AncientHallowedPlateMail D -AncientHallowedGreaves D -PottedLavaPlantPalm D -PottedLavaPlantBush D -PottedLavaPlantBramble D -PottedLavaPlantBulb D -PottedLavaPlantTendrils D -VanityTreeYellowWillowSeed B -DirtBomb K -DirtStickyBomb K -LicenseBunny D -CoolWhip D -FireWhip D -ThornWhip D -RainbowWhip D -TungstenBullet K -TeleportationPylonHallow D -TeleportationPylonUnderground D -TeleportationPylonOcean D -TeleportationPylonDesert D -TeleportationPylonSnow D -TeleportationPylonMushroom D -CavernFountain D -PiercingStarlight D -EyeofCthulhuMasterTrophy D -EaterofWorldsMasterTrophy D -BrainofCthulhuMasterTrophy D -SkeletronMasterTrophy D -QueenBeeMasterTrophy D -KingSlimeMasterTrophy D -WallofFleshMasterTrophy D -TwinsMasterTrophy D -DestroyerMasterTrophy D -SkeletronPrimeMasterTrophy D -PlanteraMasterTrophy D -GolemMasterTrophy D -DukeFishronMasterTrophy D -LunaticCultistMasterTrophy D -MoonLordMasterTrophy D -UFOMasterTrophy D -FlyingDutchmanMasterTrophy D -MourningWoodMasterTrophy D -PumpkingMasterTrophy D -IceQueenMasterTrophy D -EverscreamMasterTrophy D -SantankMasterTrophy D -DarkMageMasterTrophy D -OgreMasterTrophy D -BetsyMasterTrophy D -FairyQueenMasterTrophy D -QueenSlimeMasterTrophy D -TeleportationPylonVictory D -FairyQueenMagicItem D -FairyQueenRangedItem D -LongRainbowTrailWings D -RabbitOrder D -Zenith D -QueenSlimeBossBag G -QueenSlimeTrophy D -QueenSlimeMask D -QueenSlimePetItem D -EmpressButterfly G -AccentSlab L -TruffleWormCage D -EmpressButterflyJar D -RockGolemBanner D -BloodMummyBanner D -SporeSkeletonBanner D -SporeBatBanner D -LarvaeAntlionBanner D -CrimsonBunnyBanner D -CrimsonGoldfishBanner D -CrimsonPenguinBanner D -BigMimicCorruptionBanner D -BigMimicCrimsonBanner D -BigMimicHallowBanner D -MossHornetBanner D -WanderingEyeBanner D -CreativeWings D -MusicBoxQueenSlime D -QueenSlimeHook D -QueenSlimeMountSaddle D -CrystalNinjaHelmet D -CrystalNinjaChestplate D -CrystalNinjaLeggings D -MusicBoxEmpressOfLight D -GelBalloon A -VolatileGelatin D -QueenSlimeCrystal G -EmpressFlightBooster D -MusicBoxDukeFishron D -MusicBoxMorningRain D -MusicBoxConsoleTitle D -ChippysCouch D -GraduationCapBlue D -GraduationCapMaroon D -GraduationCapBlack D -GraduationGownBlue D -GraduationGownMaroon D -GraduationGownBlack D -TerrasparkBoots D -MoonLordLegs D -OceanCrate H -OceanCrateHard H -BadgersHat D -EmpressBlade D -MusicBoxUndergroundDesert D -DeadMansSweater D -TeaKettle D -Teacup H -TreasureMagnet D -Mace D -FlamingMace D -SleepingIcon E -MusicBoxOWRain D -MusicBoxOWDay D -MusicBoxOWNight D -MusicBoxOWUnderground D -MusicBoxOWDesert D -MusicBoxOWOcean D -MusicBoxOWMushroom D -MusicBoxOWDungeon D -MusicBoxOWSpace D -MusicBoxOWUnderworld D -MusicBoxOWSnow D -MusicBoxOWCorruption D -MusicBoxOWUndergroundCorruption D -MusicBoxOWCrimson D -MusicBoxOWUndergroundCrimson D -MusicBoxOWUndergroundSnow D -MusicBoxOWUndergroundHallow D -MusicBoxOWBloodMoon D -MusicBoxOWBoss2 D -MusicBoxOWBoss1 D -MusicBoxOWInvasion D -MusicBoxOWTowers D -MusicBoxOWMoonLord D -MusicBoxOWPlantera D -MusicBoxOWJungle D -MusicBoxOWWallOfFlesh D -MusicBoxOWHallow D -MilkCarton H -CoffeeCup H -TorchGodsFavor D -MusicBoxCredits D \ No newline at end of file diff --git a/GameContent/Creative/CreativeItemSacrificesCatalog.cs b/GameContent/Creative/CreativeItemSacrificesCatalog.cs deleted file mode 100644 index 0b35623..0000000 --- a/GameContent/Creative/CreativeItemSacrificesCatalog.cs +++ /dev/null @@ -1,106 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Creative.CreativeItemSacrificesCatalog -// 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.Text.RegularExpressions; -using Terraria.ID; - -namespace Terraria.GameContent.Creative -{ - public class CreativeItemSacrificesCatalog - { - public static CreativeItemSacrificesCatalog Instance = new CreativeItemSacrificesCatalog(); - private Dictionary _sacrificeCountNeededByItemId = new Dictionary(); - - public Dictionary SacrificeCountNeededByItemId => this._sacrificeCountNeededByItemId; - - public void Initialize() - { - this._sacrificeCountNeededByItemId.Clear(); - foreach (string str in Regex.Split(Utils.ReadEmbeddedResource("Terraria.GameContent.Creative.Content.Sacrifices.tsv"), "\r\n|\r|\n")) - { - if (!str.StartsWith("//")) - { - string[] strArray = str.Split('\t'); - int key; - if (strArray.Length >= 3 && ItemID.Search.TryGetId(strArray[0], ref key)) - { - int num = 0; - bool flag = false; - string lower = strArray[1].ToLower(); - switch (lower) - { - case "": - case "a": - num = 50; - break; - case "b": - num = 25; - break; - case "c": - num = 5; - break; - case "d": - num = 1; - break; - case "e": - flag = true; - break; - case "f": - num = 2; - break; - case "g": - num = 3; - break; - case "h": - num = 10; - break; - case "i": - num = 15; - break; - case "j": - num = 30; - break; - case "k": - num = 99; - break; - case "l": - num = 100; - break; - case "m": - num = 200; - break; - case "n": - num = 20; - break; - case "o": - num = 400; - break; - default: - throw new Exception("There is no category for this item: " + strArray[0] + ", category: " + lower); - } - if (!flag) - this._sacrificeCountNeededByItemId[key] = num; - } - } - } - } - - public bool TryGetSacrificeCountCapToUnlockInfiniteItems(int itemId, out int amountNeeded) => this._sacrificeCountNeededByItemId.TryGetValue(itemId, out amountNeeded); - - public void FillListOfItemsThatCanBeObtainedInfinitely( - List itemIdsThatCanBeCraftedInfinitely) - { - foreach (KeyValuePair keyValuePair in Main.LocalPlayerCreativeTracker.ItemSacrifices.SacrificesCountByItemIdCache) - { - int num; - if (this._sacrificeCountNeededByItemId.TryGetValue(keyValuePair.Key, out num) && keyValuePair.Value >= num) - itemIdsThatCanBeCraftedInfinitely.Add(keyValuePair.Key); - } - } - } -} diff --git a/GameContent/Creative/CreativePowerManager.cs b/GameContent/Creative/CreativePowerManager.cs deleted file mode 100644 index 120d8a0..0000000 --- a/GameContent/Creative/CreativePowerManager.cs +++ /dev/null @@ -1,198 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Creative.CreativePowerManager -// 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.Collections.Generic; -using System.IO; -using Terraria.GameContent.NetModules; -using Terraria.Net; - -namespace Terraria.GameContent.Creative -{ - public class CreativePowerManager - { - public static readonly CreativePowerManager Instance = new CreativePowerManager(); - private Dictionary _powersById = new Dictionary(); - private Dictionary _powersByName = new Dictionary(); - private ushort _powersCount; - private static bool _initialized = false; - private const string _powerPermissionsLineHeader = "journeypermission_"; - - private CreativePowerManager() - { - } - - public void Register(string nameInServerConfig) where T : ICreativePower, new() - { - T obj = new T(); - CreativePowerManager.PowerTypeStorage.Power = obj; - CreativePowerManager.PowerTypeStorage.Id = this._powersCount; - CreativePowerManager.PowerTypeStorage.Name = nameInServerConfig; - obj.DefaultPermissionLevel = PowerPermissionLevel.CanBeChangedByEveryone; - obj.CurrentPermissionLevel = PowerPermissionLevel.CanBeChangedByEveryone; - this._powersById[this._powersCount] = (ICreativePower) obj; - this._powersByName[nameInServerConfig] = (ICreativePower) obj; - obj.PowerId = this._powersCount; - obj.ServerConfigName = nameInServerConfig; - ++this._powersCount; - } - - public T GetPower() where T : ICreativePower => CreativePowerManager.PowerTypeStorage.Power; - - public ushort GetPowerId() where T : ICreativePower => CreativePowerManager.PowerTypeStorage.Id; - - public bool TryGetPower(ushort id, out ICreativePower power) => this._powersById.TryGetValue(id, out power); - - public static void TryListingPermissionsFrom(string line) - { - int length = "journeypermission_".Length; - if (line.Length < length || !line.ToLower().StartsWith("journeypermission_")) - return; - string[] strArray = line.Substring(length).Split('='); - int result; - if (strArray.Length != 2 || !int.TryParse(strArray[1].Trim(), out result)) - return; - PowerPermissionLevel powerPermissionLevel = (PowerPermissionLevel) Utils.Clamp(result, 0, 2); - string lower = strArray[0].Trim().ToLower(); - CreativePowerManager.Initialize(); - ICreativePower creativePower; - if (!CreativePowerManager.Instance._powersByName.TryGetValue(lower, out creativePower)) - return; - creativePower.DefaultPermissionLevel = powerPermissionLevel; - creativePower.CurrentPermissionLevel = powerPermissionLevel; - } - - public static void Initialize() - { - if (CreativePowerManager._initialized) - return; - CreativePowerManager.Instance.Register("time_setfrozen"); - CreativePowerManager.Instance.Register("time_setdawn"); - CreativePowerManager.Instance.Register("time_setnoon"); - CreativePowerManager.Instance.Register("time_setdusk"); - CreativePowerManager.Instance.Register("time_setmidnight"); - CreativePowerManager.Instance.Register("godmode"); - CreativePowerManager.Instance.Register("wind_setstrength"); - CreativePowerManager.Instance.Register("rain_setstrength"); - CreativePowerManager.Instance.Register("time_setspeed"); - CreativePowerManager.Instance.Register("rain_setfrozen"); - CreativePowerManager.Instance.Register("wind_setfrozen"); - CreativePowerManager.Instance.Register("increaseplacementrange"); - CreativePowerManager.Instance.Register("setdifficulty"); - CreativePowerManager.Instance.Register("biomespread_setfrozen"); - CreativePowerManager.Instance.Register("setspawnrate"); - CreativePowerManager._initialized = true; - } - - public void Reset() - { - foreach (KeyValuePair keyValuePair in this._powersById) - { - keyValuePair.Value.CurrentPermissionLevel = keyValuePair.Value.DefaultPermissionLevel; - if (keyValuePair.Value is IPersistentPerWorldContent persistentPerWorldContent2) - persistentPerWorldContent2.Reset(); - if (keyValuePair.Value is IPersistentPerPlayerContent perPlayerContent2) - perPlayerContent2.Reset(); - } - } - - public void SaveToWorld(BinaryWriter writer) - { - lock (this._powersById) - { - foreach (KeyValuePair keyValuePair in this._powersById) - { - if (keyValuePair.Value is IPersistentPerWorldContent persistentPerWorldContent2) - { - writer.Write(true); - writer.Write(keyValuePair.Key); - persistentPerWorldContent2.Save(writer); - } - } - } - writer.Write(false); - } - - public void LoadFromWorld(BinaryReader reader, int versionGameWasLastSavedOn) - { - ICreativePower creativePower; - while (reader.ReadBoolean() && this._powersById.TryGetValue(reader.ReadUInt16(), out creativePower) && creativePower is IPersistentPerWorldContent persistentPerWorldContent) - persistentPerWorldContent.Load(reader, versionGameWasLastSavedOn); - } - - public void ValidateWorld(BinaryReader reader, int versionGameWasLastSavedOn) - { - ICreativePower creativePower; - while (reader.ReadBoolean() && this._powersById.TryGetValue(reader.ReadUInt16(), out creativePower) && creativePower is IPersistentPerWorldContent persistentPerWorldContent) - persistentPerWorldContent.ValidateWorld(reader, versionGameWasLastSavedOn); - } - - public void SyncThingsToJoiningPlayer(int playerIndex) - { - foreach (KeyValuePair keyValuePair in this._powersById) - { - NetPacket packet = NetCreativePowerPermissionsModule.SerializeCurrentPowerPermissionLevel(keyValuePair.Key, (int) keyValuePair.Value.CurrentPermissionLevel); - NetManager.Instance.SendToClient(packet, playerIndex); - } - foreach (KeyValuePair keyValuePair in this._powersById) - { - if (keyValuePair.Value is IOnPlayerJoining onPlayerJoining1) - onPlayerJoining1.OnPlayerJoining(playerIndex); - } - } - - public void SaveToPlayer(Player player, BinaryWriter writer) - { - foreach (KeyValuePair keyValuePair in this._powersById) - { - if (keyValuePair.Value is IPersistentPerPlayerContent perPlayerContent1) - { - writer.Write(true); - writer.Write(keyValuePair.Key); - perPlayerContent1.Save(player, writer); - } - } - writer.Write(false); - } - - public void LoadToPlayer(Player player, BinaryReader reader, int versionGameWasLastSavedOn) - { - ICreativePower creativePower; - while (reader.ReadBoolean() && this._powersById.TryGetValue(reader.ReadUInt16(), out creativePower)) - { - if (creativePower is IPersistentPerPlayerContent perPlayerContent2) - perPlayerContent2.Load(player, reader, versionGameWasLastSavedOn); - } - } - - public void ApplyLoadedDataToPlayer(Player player) - { - foreach (KeyValuePair keyValuePair in this._powersById) - { - if (keyValuePair.Value is IPersistentPerPlayerContent perPlayerContent1) - perPlayerContent1.ApplyLoadedDataToOutOfPlayerFields(player); - } - } - - public void ResetDataForNewPlayer(Player player) - { - foreach (KeyValuePair keyValuePair in this._powersById) - { - if (keyValuePair.Value is IPersistentPerPlayerContent perPlayerContent1) - { - perPlayerContent1.Reset(); - perPlayerContent1.ResetDataForNewPlayer(player); - } - } - } - - private class PowerTypeStorage where T : ICreativePower - { - public static ushort Id; - public static string Name; - public static T Power; - } - } -} diff --git a/GameContent/Creative/CreativePowerSettings.cs b/GameContent/Creative/CreativePowerSettings.cs deleted file mode 100644 index 0fc139f..0000000 --- a/GameContent/Creative/CreativePowerSettings.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Creative.CreativePowerSettings -// 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.Creative -{ - public class CreativePowerSettings - { - public static bool ShouldPowersBeElaborated; - } -} diff --git a/GameContent/Creative/CreativePowerUIElementRequestInfo.cs b/GameContent/Creative/CreativePowerUIElementRequestInfo.cs deleted file mode 100644 index 86b39b4..0000000 --- a/GameContent/Creative/CreativePowerUIElementRequestInfo.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Creative.CreativePowerUIElementRequestInfo -// 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.Creative -{ - public struct CreativePowerUIElementRequestInfo - { - public int PreferredButtonWidth; - public int PreferredButtonHeight; - } -} diff --git a/GameContent/Creative/CreativePowers.cs b/GameContent/Creative/CreativePowers.cs deleted file mode 100644 index 5b6f76d..0000000 --- a/GameContent/Creative/CreativePowers.cs +++ /dev/null @@ -1,1210 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Creative.CreativePowers -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using System; -using System.Collections.Generic; -using System.IO; -using Terraria.GameContent.NetModules; -using Terraria.GameContent.UI.Elements; -using Terraria.GameInput; -using Terraria.Initializers; -using Terraria.Localization; -using Terraria.Net; -using Terraria.UI; - -namespace Terraria.GameContent.Creative -{ - public class CreativePowers - { - public abstract class APerPlayerTogglePower : ICreativePower, IOnPlayerJoining - { - internal string _powerNameKey; - internal Point _iconLocation; - internal bool _defaultToggleState; - private bool[] _perPlayerIsEnabled = new bool[(int) byte.MaxValue]; - - public ushort PowerId { get; set; } - - public string ServerConfigName { get; set; } - - public PowerPermissionLevel CurrentPermissionLevel { get; set; } - - public PowerPermissionLevel DefaultPermissionLevel { get; set; } - - public bool IsEnabledForPlayer(int playerIndex) => this._perPlayerIsEnabled.IndexInRange(playerIndex) && this._perPlayerIsEnabled[playerIndex]; - - public void DeserializeNetMessage(BinaryReader reader, int userId) - { - switch ((CreativePowers.APerPlayerTogglePower.SubMessageType) reader.ReadByte()) - { - case CreativePowers.APerPlayerTogglePower.SubMessageType.SyncEveryone: - this.Deserialize_SyncEveryone(reader, userId); - break; - case CreativePowers.APerPlayerTogglePower.SubMessageType.SyncOnePlayer: - int playerIndex = (int) reader.ReadByte(); - bool state = reader.ReadBoolean(); - if (Main.netMode == 2) - { - playerIndex = userId; - if (!CreativePowersHelper.IsAvailableForPlayer((ICreativePower) this, playerIndex)) - break; - } - this.SetEnabledState(playerIndex, state); - break; - } - } - - private void Deserialize_SyncEveryone(BinaryReader reader, int userId) - { - int count = (int) Math.Ceiling((double) this._perPlayerIsEnabled.Length / 8.0); - if (Main.netMode == 2 && !CreativePowersHelper.IsAvailableForPlayer((ICreativePower) this, userId)) - { - reader.ReadBytes(count); - } - else - { - for (int index = 0; index < count; ++index) - { - BitsByte bitsByte = (BitsByte) reader.ReadByte(); - for (int key = 0; key < 8; ++key) - { - int playerIndex = index * 8 + key; - if (playerIndex != Main.myPlayer) - { - if (playerIndex < this._perPlayerIsEnabled.Length) - this.SetEnabledState(playerIndex, bitsByte[key]); - else - break; - } - } - } - } - } - - public void SetEnabledState(int playerIndex, bool state) - { - this._perPlayerIsEnabled[playerIndex] = state; - if (Main.netMode != 2) - return; - NetPacket packet = NetCreativePowersModule.PreparePacket(this.PowerId, 3); - packet.Writer.Write((byte) 1); - packet.Writer.Write((byte) playerIndex); - packet.Writer.Write(state); - NetManager.Instance.Broadcast(packet); - } - - public void DebugCall() => this.RequestUse(); - - internal void RequestUse() - { - NetPacket packet = NetCreativePowersModule.PreparePacket(this.PowerId, 1); - packet.Writer.Write((byte) 1); - packet.Writer.Write((byte) Main.myPlayer); - packet.Writer.Write(!this._perPlayerIsEnabled[Main.myPlayer]); - NetManager.Instance.SendToServerOrLoopback(packet); - } - - public void Reset() - { - for (int index = 0; index < this._perPlayerIsEnabled.Length; ++index) - this._perPlayerIsEnabled[index] = this._defaultToggleState; - } - - public void OnPlayerJoining(int playerIndex) - { - int num = (int) Math.Ceiling((double) this._perPlayerIsEnabled.Length / 8.0); - NetPacket packet = NetCreativePowersModule.PreparePacket(this.PowerId, num + 1); - packet.Writer.Write((byte) 0); - for (int index1 = 0; index1 < num; ++index1) - { - BitsByte bitsByte = (BitsByte) (byte) 0; - for (int key = 0; key < 8; ++key) - { - int index2 = index1 * 8 + key; - if (index2 < this._perPlayerIsEnabled.Length) - bitsByte[key] = this._perPlayerIsEnabled[index2]; - else - break; - } - packet.Writer.Write((byte) bitsByte); - } - NetManager.Instance.SendToClient(packet, playerIndex); - } - - public void ProvidePowerButtons( - CreativePowerUIElementRequestInfo info, - List elements) - { - GroupOptionButton toggleButton = CreativePowersHelper.CreateToggleButton(info); - CreativePowersHelper.UpdateUnlockStateByPower((ICreativePower) this, (UIElement) toggleButton, Main.OurFavoriteColor); - toggleButton.Append((UIElement) CreativePowersHelper.GetIconImage(this._iconLocation)); - toggleButton.OnClick += new UIElement.MouseEvent(this.button_OnClick); - toggleButton.OnUpdate += new UIElement.ElementEvent(this.button_OnUpdate); - elements.Add((UIElement) toggleButton); - } - - private void button_OnUpdate(UIElement affectedElement) - { - bool option = this._perPlayerIsEnabled[Main.myPlayer]; - GroupOptionButton groupOptionButton = affectedElement as GroupOptionButton; - groupOptionButton.SetCurrentOption(option); - if (!affectedElement.IsMouseHovering) - return; - string textValue = Language.GetTextValue(groupOptionButton.IsSelected ? this._powerNameKey + "_Enabled" : this._powerNameKey + "_Disabled"); - CreativePowersHelper.AddDescriptionIfNeeded(ref textValue, this._powerNameKey + "_Description"); - CreativePowersHelper.AddUnlockTextIfNeeded(ref textValue, this.GetIsUnlocked(), this._powerNameKey + "_Unlock"); - CreativePowersHelper.AddPermissionTextIfNeeded((ICreativePower) this, ref textValue); - Main.instance.MouseTextNoOverride(textValue); - } - - private void button_OnClick(UIMouseEvent evt, UIElement listeningElement) - { - if (!this.GetIsUnlocked() || !CreativePowersHelper.IsAvailableForPlayer((ICreativePower) this, Main.myPlayer)) - return; - this.RequestUse(); - } - - public abstract bool GetIsUnlocked(); - - private enum SubMessageType : byte - { - SyncEveryone, - SyncOnePlayer, - } - } - - public abstract class APerPlayerSliderPower : - ICreativePower, - IOnPlayerJoining, - IProvideSliderElement, - IPowerSubcategoryElement - { - internal Point _iconLocation; - internal float _sliderCurrentValueCache; - internal string _powerNameKey; - internal float[] _cachePerPlayer = new float[256]; - internal float _sliderDefaultValue; - private float _currentTargetValue; - private bool _needsToCommitChange; - private DateTime _nextTimeWeCanPush = DateTime.UtcNow; - - public ushort PowerId { get; set; } - - public string ServerConfigName { get; set; } - - public PowerPermissionLevel CurrentPermissionLevel { get; set; } - - public PowerPermissionLevel DefaultPermissionLevel { get; set; } - - public bool GetRemappedSliderValueFor(int playerIndex, out float value) - { - value = 0.0f; - if (!this._cachePerPlayer.IndexInRange(playerIndex)) - return false; - value = this.RemapSliderValueToPowerValue(this._cachePerPlayer[playerIndex]); - return true; - } - - public abstract float RemapSliderValueToPowerValue(float sliderValue); - - public void DeserializeNetMessage(BinaryReader reader, int userId) - { - int playerIndex = (int) reader.ReadByte(); - float num = reader.ReadSingle(); - if (Main.netMode == 2) - { - playerIndex = userId; - if (!CreativePowersHelper.IsAvailableForPlayer((ICreativePower) this, playerIndex)) - return; - } - this._cachePerPlayer[playerIndex] = num; - if (playerIndex != Main.myPlayer) - return; - this._sliderCurrentValueCache = num; - this.UpdateInfoFromSliderValueCache(); - } - - internal abstract void UpdateInfoFromSliderValueCache(); - - public void ProvidePowerButtons( - CreativePowerUIElementRequestInfo info, - List elements) - { - throw new NotImplementedException(); - } - - public void DebugCall() - { - NetPacket packet = NetCreativePowersModule.PreparePacket(this.PowerId, 5); - packet.Writer.Write((byte) Main.myPlayer); - packet.Writer.Write(0.0f); - NetManager.Instance.SendToServerOrLoopback(packet); - } - - public abstract UIElement ProvideSlider(); - - internal float GetSliderValue() => Main.netMode == 1 && this._needsToCommitChange ? this._currentTargetValue : this._sliderCurrentValueCache; - - internal void SetValueKeyboard(float value) - { - if ((double) value == (double) this._currentTargetValue || !CreativePowersHelper.IsAvailableForPlayer((ICreativePower) this, Main.myPlayer)) - return; - this._currentTargetValue = value; - this._needsToCommitChange = true; - } - - internal void SetValueGamepad() - { - float sliderValue = this.GetSliderValue(); - float num = UILinksInitializer.HandleSliderVerticalInput(sliderValue, 0.0f, 1f, PlayerInput.CurrentProfile.InterfaceDeadzoneX, 0.35f); - if ((double) num == (double) sliderValue) - return; - this.SetValueKeyboard(num); - } - - public void PushChangeAndSetSlider(float value) - { - if (!CreativePowersHelper.IsAvailableForPlayer((ICreativePower) this, Main.myPlayer)) - return; - value = MathHelper.Clamp(value, 0.0f, 1f); - this._sliderCurrentValueCache = value; - this._currentTargetValue = value; - this.PushChange(value); - } - - public GroupOptionButton GetOptionButton( - CreativePowerUIElementRequestInfo info, - int optionIndex, - int currentOptionIndex) - { - GroupOptionButton categoryButton = CreativePowersHelper.CreateCategoryButton(info, optionIndex, currentOptionIndex); - CreativePowersHelper.UpdateUnlockStateByPower((ICreativePower) this, (UIElement) categoryButton, CreativePowersHelper.CommonSelectedColor); - categoryButton.Append((UIElement) CreativePowersHelper.GetIconImage(this._iconLocation)); - categoryButton.OnUpdate += new UIElement.ElementEvent(this.categoryButton_OnUpdate); - return categoryButton; - } - - private void categoryButton_OnUpdate(UIElement affectedElement) - { - if (affectedElement.IsMouseHovering) - { - string textValue = Language.GetTextValue(this._powerNameKey + ((affectedElement as GroupOptionButton).IsSelected ? "_Opened" : "_Closed")); - CreativePowersHelper.AddDescriptionIfNeeded(ref textValue, this._powerNameKey + "_Description"); - CreativePowersHelper.AddUnlockTextIfNeeded(ref textValue, this.GetIsUnlocked(), this._powerNameKey + "_Unlock"); - CreativePowersHelper.AddPermissionTextIfNeeded((ICreativePower) this, ref textValue); - Main.instance.MouseTextNoOverride(textValue); - } - this.AttemptPushingChange(); - } - - private void AttemptPushingChange() - { - if (!this._needsToCommitChange || DateTime.UtcNow.CompareTo(this._nextTimeWeCanPush) == -1) - return; - this.PushChange(this._currentTargetValue); - } - - internal void PushChange(float newSliderValue) - { - this._needsToCommitChange = false; - this._sliderCurrentValueCache = newSliderValue; - this._nextTimeWeCanPush = DateTime.UtcNow; - NetPacket packet = NetCreativePowersModule.PreparePacket(this.PowerId, 5); - packet.Writer.Write((byte) Main.myPlayer); - packet.Writer.Write(newSliderValue); - NetManager.Instance.SendToServerOrLoopback(packet); - } - - public virtual void Reset() - { - for (int playerIndex = 0; playerIndex < this._cachePerPlayer.Length; ++playerIndex) - this.ResetForPlayer(playerIndex); - } - - public virtual void ResetForPlayer(int playerIndex) - { - this._cachePerPlayer[playerIndex] = this._sliderDefaultValue; - if (playerIndex != Main.myPlayer) - return; - this._sliderCurrentValueCache = this._sliderDefaultValue; - this._currentTargetValue = this._sliderDefaultValue; - } - - public void OnPlayerJoining(int playerIndex) => this.ResetForPlayer(playerIndex); - - public abstract bool GetIsUnlocked(); - } - - public abstract class ASharedButtonPower : ICreativePower - { - internal Point _iconLocation; - internal string _powerNameKey; - internal string _descriptionKey; - - public ushort PowerId { get; set; } - - public string ServerConfigName { get; set; } - - public PowerPermissionLevel CurrentPermissionLevel { get; set; } - - public PowerPermissionLevel DefaultPermissionLevel { get; set; } - - public ASharedButtonPower() => this.OnCreation(); - - public void RequestUse() - { - NetPacket packet = NetCreativePowersModule.PreparePacket(this.PowerId, 0); - NetManager.Instance.SendToServerOrLoopback(packet); - } - - public void DeserializeNetMessage(BinaryReader reader, int userId) - { - if (Main.netMode == 2 && !CreativePowersHelper.IsAvailableForPlayer((ICreativePower) this, userId)) - return; - this.UsePower(); - } - - internal abstract void UsePower(); - - internal abstract void OnCreation(); - - public void ProvidePowerButtons( - CreativePowerUIElementRequestInfo info, - List elements) - { - GroupOptionButton simpleButton = CreativePowersHelper.CreateSimpleButton(info); - CreativePowersHelper.UpdateUnlockStateByPower((ICreativePower) this, (UIElement) simpleButton, CreativePowersHelper.CommonSelectedColor); - simpleButton.Append((UIElement) CreativePowersHelper.GetIconImage(this._iconLocation)); - simpleButton.OnClick += new UIElement.MouseEvent(this.button_OnClick); - simpleButton.OnUpdate += new UIElement.ElementEvent(this.button_OnUpdate); - elements.Add((UIElement) simpleButton); - } - - private void button_OnUpdate(UIElement affectedElement) - { - if (!affectedElement.IsMouseHovering) - return; - string textValue = Language.GetTextValue(this._powerNameKey); - CreativePowersHelper.AddDescriptionIfNeeded(ref textValue, this._descriptionKey); - CreativePowersHelper.AddUnlockTextIfNeeded(ref textValue, this.GetIsUnlocked(), this._powerNameKey + "_Unlock"); - CreativePowersHelper.AddPermissionTextIfNeeded((ICreativePower) this, ref textValue); - Main.instance.MouseTextNoOverride(textValue); - } - - private void button_OnClick(UIMouseEvent evt, UIElement listeningElement) - { - if (!CreativePowersHelper.IsAvailableForPlayer((ICreativePower) this, Main.myPlayer)) - return; - this.RequestUse(); - } - - public abstract bool GetIsUnlocked(); - } - - public abstract class ASharedTogglePower : ICreativePower, IOnPlayerJoining - { - public ushort PowerId { get; set; } - - public string ServerConfigName { get; set; } - - public PowerPermissionLevel CurrentPermissionLevel { get; set; } - - public PowerPermissionLevel DefaultPermissionLevel { get; set; } - - public bool Enabled { get; private set; } - - public void SetPowerInfo(bool enabled) => this.Enabled = enabled; - - public void Reset() => this.Enabled = false; - - public void OnPlayerJoining(int playerIndex) - { - NetPacket packet = NetCreativePowersModule.PreparePacket(this.PowerId, 1); - packet.Writer.Write(this.Enabled); - NetManager.Instance.SendToClient(packet, playerIndex); - } - - public void DeserializeNetMessage(BinaryReader reader, int userId) - { - bool enabled = reader.ReadBoolean(); - if (Main.netMode == 2 && !CreativePowersHelper.IsAvailableForPlayer((ICreativePower) this, userId)) - return; - this.SetPowerInfo(enabled); - if (Main.netMode != 2) - return; - NetPacket packet = NetCreativePowersModule.PreparePacket(this.PowerId, 1); - packet.Writer.Write(this.Enabled); - NetManager.Instance.Broadcast(packet); - } - - private void RequestUse() - { - NetPacket packet = NetCreativePowersModule.PreparePacket(this.PowerId, 1); - packet.Writer.Write(!this.Enabled); - NetManager.Instance.SendToServerOrLoopback(packet); - } - - public void ProvidePowerButtons( - CreativePowerUIElementRequestInfo info, - List elements) - { - GroupOptionButton toggleButton = CreativePowersHelper.CreateToggleButton(info); - CreativePowersHelper.UpdateUnlockStateByPower((ICreativePower) this, (UIElement) toggleButton, Main.OurFavoriteColor); - this.CustomizeButton((UIElement) toggleButton); - toggleButton.OnClick += new UIElement.MouseEvent(this.button_OnClick); - toggleButton.OnUpdate += new UIElement.ElementEvent(this.button_OnUpdate); - elements.Add((UIElement) toggleButton); - } - - private void button_OnUpdate(UIElement affectedElement) - { - bool enabled = this.Enabled; - GroupOptionButton groupOptionButton = affectedElement as GroupOptionButton; - groupOptionButton.SetCurrentOption(enabled); - if (!affectedElement.IsMouseHovering) - return; - string buttonTextKey = this.GetButtonTextKey(); - string textValue = Language.GetTextValue(buttonTextKey + (groupOptionButton.IsSelected ? "_Enabled" : "_Disabled")); - CreativePowersHelper.AddDescriptionIfNeeded(ref textValue, buttonTextKey + "_Description"); - CreativePowersHelper.AddUnlockTextIfNeeded(ref textValue, this.GetIsUnlocked(), buttonTextKey + "_Unlock"); - CreativePowersHelper.AddPermissionTextIfNeeded((ICreativePower) this, ref textValue); - Main.instance.MouseTextNoOverride(textValue); - } - - private void button_OnClick(UIMouseEvent evt, UIElement listeningElement) - { - if (!CreativePowersHelper.IsAvailableForPlayer((ICreativePower) this, Main.myPlayer)) - return; - this.RequestUse(); - } - - internal abstract void CustomizeButton(UIElement button); - - internal abstract string GetButtonTextKey(); - - public abstract bool GetIsUnlocked(); - } - - public abstract class ASharedSliderPower : - ICreativePower, - IOnPlayerJoining, - IProvideSliderElement, - IPowerSubcategoryElement - { - internal Point _iconLocation; - internal float _sliderCurrentValueCache; - internal string _powerNameKey; - internal bool _syncToJoiningPlayers = true; - internal float _currentTargetValue; - private bool _needsToCommitChange; - private DateTime _nextTimeWeCanPush = DateTime.UtcNow; - - public ushort PowerId { get; set; } - - public string ServerConfigName { get; set; } - - public PowerPermissionLevel CurrentPermissionLevel { get; set; } - - public PowerPermissionLevel DefaultPermissionLevel { get; set; } - - public void DeserializeNetMessage(BinaryReader reader, int userId) - { - float num = reader.ReadSingle(); - if (Main.netMode == 2 && !CreativePowersHelper.IsAvailableForPlayer((ICreativePower) this, userId)) - return; - this._sliderCurrentValueCache = num; - this.UpdateInfoFromSliderValueCache(); - if (Main.netMode != 2) - return; - NetPacket packet = NetCreativePowersModule.PreparePacket(this.PowerId, 4); - packet.Writer.Write(num); - NetManager.Instance.Broadcast(packet); - } - - internal abstract void UpdateInfoFromSliderValueCache(); - - public void ProvidePowerButtons( - CreativePowerUIElementRequestInfo info, - List elements) - { - throw new NotImplementedException(); - } - - public void DebugCall() - { - NetPacket packet = NetCreativePowersModule.PreparePacket(this.PowerId, 4); - packet.Writer.Write(0.0f); - NetManager.Instance.SendToServerOrLoopback(packet); - } - - public abstract UIElement ProvideSlider(); - - internal float GetSliderValue() => Main.netMode == 1 && this._needsToCommitChange ? this._currentTargetValue : this.GetSliderValueInner(); - - internal virtual float GetSliderValueInner() => this._sliderCurrentValueCache; - - internal void SetValueKeyboard(float value) - { - if ((double) value == (double) this._currentTargetValue || !CreativePowersHelper.IsAvailableForPlayer((ICreativePower) this, Main.myPlayer)) - return; - this._currentTargetValue = value; - this._needsToCommitChange = true; - } - - internal void SetValueGamepad() - { - float sliderValue = this.GetSliderValue(); - float num = UILinksInitializer.HandleSliderVerticalInput(sliderValue, 0.0f, 1f, PlayerInput.CurrentProfile.InterfaceDeadzoneX, 0.35f); - if ((double) num == (double) sliderValue) - return; - this.SetValueKeyboard(num); - } - - public GroupOptionButton GetOptionButton( - CreativePowerUIElementRequestInfo info, - int optionIndex, - int currentOptionIndex) - { - GroupOptionButton categoryButton = CreativePowersHelper.CreateCategoryButton(info, optionIndex, currentOptionIndex); - CreativePowersHelper.UpdateUnlockStateByPower((ICreativePower) this, (UIElement) categoryButton, CreativePowersHelper.CommonSelectedColor); - categoryButton.Append((UIElement) CreativePowersHelper.GetIconImage(this._iconLocation)); - categoryButton.OnUpdate += new UIElement.ElementEvent(this.categoryButton_OnUpdate); - return categoryButton; - } - - private void categoryButton_OnUpdate(UIElement affectedElement) - { - if (affectedElement.IsMouseHovering) - { - string textValue = Language.GetTextValue(this._powerNameKey + ((affectedElement as GroupOptionButton).IsSelected ? "_Opened" : "_Closed")); - CreativePowersHelper.AddDescriptionIfNeeded(ref textValue, this._powerNameKey + "_Description"); - CreativePowersHelper.AddUnlockTextIfNeeded(ref textValue, this.GetIsUnlocked(), this._powerNameKey + "_Unlock"); - CreativePowersHelper.AddPermissionTextIfNeeded((ICreativePower) this, ref textValue); - Main.instance.MouseTextNoOverride(textValue); - } - this.AttemptPushingChange(); - } - - private void AttemptPushingChange() - { - if (!this._needsToCommitChange || DateTime.UtcNow.CompareTo(this._nextTimeWeCanPush) == -1) - return; - this._needsToCommitChange = false; - this._sliderCurrentValueCache = this._currentTargetValue; - this._nextTimeWeCanPush = DateTime.UtcNow; - NetPacket packet = NetCreativePowersModule.PreparePacket(this.PowerId, 4); - packet.Writer.Write(this._currentTargetValue); - NetManager.Instance.SendToServerOrLoopback(packet); - } - - public virtual void Reset() => this._sliderCurrentValueCache = 0.0f; - - public void OnPlayerJoining(int playerIndex) - { - if (!this._syncToJoiningPlayers) - return; - NetPacket packet = NetCreativePowersModule.PreparePacket(this.PowerId, 4); - packet.Writer.Write(this._sliderCurrentValueCache); - NetManager.Instance.SendToClient(packet, playerIndex); - } - - public abstract bool GetIsUnlocked(); - } - - public class GodmodePower : CreativePowers.APerPlayerTogglePower, IPersistentPerPlayerContent - { - public GodmodePower() - { - this._powerNameKey = "CreativePowers.Godmode"; - this._iconLocation = CreativePowersHelper.CreativePowerIconLocations.Godmode; - } - - public override bool GetIsUnlocked() => true; - - public void Save(Player player, BinaryWriter writer) - { - bool flag = this.IsEnabledForPlayer(Main.myPlayer); - writer.Write(flag); - } - - public void ResetDataForNewPlayer(Player player) => player.savedPerPlayerFieldsThatArentInThePlayerClass.godmodePowerEnabled = this._defaultToggleState; - - public void Load(Player player, BinaryReader reader, int gameVersionSaveWasMadeOn) - { - bool flag = reader.ReadBoolean(); - player.savedPerPlayerFieldsThatArentInThePlayerClass.godmodePowerEnabled = flag; - } - - public void ApplyLoadedDataToOutOfPlayerFields(Player player) - { - if (player.savedPerPlayerFieldsThatArentInThePlayerClass.godmodePowerEnabled == this.IsEnabledForPlayer(player.whoAmI)) - return; - this.RequestUse(); - } - } - - public class FarPlacementRangePower : - CreativePowers.APerPlayerTogglePower, - IPersistentPerPlayerContent - { - public FarPlacementRangePower() - { - this._powerNameKey = "CreativePowers.InfinitePlacementRange"; - this._iconLocation = CreativePowersHelper.CreativePowerIconLocations.BlockPlacementRange; - this._defaultToggleState = true; - } - - public override bool GetIsUnlocked() => true; - - public void Save(Player player, BinaryWriter writer) - { - bool flag = this.IsEnabledForPlayer(Main.myPlayer); - writer.Write(flag); - } - - public void ResetDataForNewPlayer(Player player) => player.savedPerPlayerFieldsThatArentInThePlayerClass.farPlacementRangePowerEnabled = this._defaultToggleState; - - public void Load(Player player, BinaryReader reader, int gameVersionSaveWasMadeOn) - { - bool flag = reader.ReadBoolean(); - player.savedPerPlayerFieldsThatArentInThePlayerClass.farPlacementRangePowerEnabled = flag; - } - - public void ApplyLoadedDataToOutOfPlayerFields(Player player) - { - if (player.savedPerPlayerFieldsThatArentInThePlayerClass.farPlacementRangePowerEnabled == this.IsEnabledForPlayer(player.whoAmI)) - return; - this.RequestUse(); - } - } - - public class StartDayImmediately : CreativePowers.ASharedButtonPower - { - internal override void UsePower() - { - if (Main.netMode == 1) - return; - Main.SkipToTime(0, true); - } - - internal override void OnCreation() - { - this._powerNameKey = "CreativePowers.StartDayImmediately"; - this._descriptionKey = this._powerNameKey + "_Description"; - this._iconLocation = CreativePowersHelper.CreativePowerIconLocations.TimeDawn; - } - - public override bool GetIsUnlocked() => true; - } - - public class StartNightImmediately : CreativePowers.ASharedButtonPower - { - internal override void UsePower() - { - if (Main.netMode == 1) - return; - Main.SkipToTime(0, false); - } - - internal override void OnCreation() - { - this._powerNameKey = "CreativePowers.StartNightImmediately"; - this._descriptionKey = this._powerNameKey + "_Description"; - this._iconLocation = CreativePowersHelper.CreativePowerIconLocations.TimeDusk; - } - - public override bool GetIsUnlocked() => true; - } - - public class StartNoonImmediately : CreativePowers.ASharedButtonPower - { - internal override void UsePower() - { - if (Main.netMode == 1) - return; - Main.SkipToTime(27000, true); - } - - internal override void OnCreation() - { - this._powerNameKey = "CreativePowers.StartNoonImmediately"; - this._descriptionKey = this._powerNameKey + "_Description"; - this._iconLocation = CreativePowersHelper.CreativePowerIconLocations.TimeNoon; - } - - public override bool GetIsUnlocked() => true; - } - - public class StartMidnightImmediately : CreativePowers.ASharedButtonPower - { - internal override void UsePower() - { - if (Main.netMode == 1) - return; - Main.SkipToTime(16200, false); - } - - internal override void OnCreation() - { - this._powerNameKey = "CreativePowers.StartMidnightImmediately"; - this._descriptionKey = this._powerNameKey + "_Description"; - this._iconLocation = CreativePowersHelper.CreativePowerIconLocations.TimeMidnight; - } - - public override bool GetIsUnlocked() => true; - } - - public class ModifyTimeRate : CreativePowers.ASharedSliderPower, IPersistentPerWorldContent - { - public int TargetTimeRate { get; private set; } - - public ModifyTimeRate() - { - this._powerNameKey = "CreativePowers.ModifyTimeRate"; - this._iconLocation = CreativePowersHelper.CreativePowerIconLocations.ModifyTime; - } - - public override void Reset() - { - this._sliderCurrentValueCache = 0.0f; - this.TargetTimeRate = 1; - } - - internal override void UpdateInfoFromSliderValueCache() => this.TargetTimeRate = (int) Math.Round((double) Utils.Remap(this._sliderCurrentValueCache, 0.0f, 1f, 1f, 24f)); - - public override UIElement ProvideSlider() - { - UIVerticalSlider slider = CreativePowersHelper.CreateSlider(new Func(((CreativePowers.ASharedSliderPower) this).GetSliderValue), new Action(((CreativePowers.ASharedSliderPower) this).SetValueKeyboard), new Action(((CreativePowers.ASharedSliderPower) this).SetValueGamepad)); - slider.OnUpdate += new UIElement.ElementEvent(this.UpdateSliderAndShowMultiplierMouseOver); - UIPanel uiPanel = new UIPanel(); - uiPanel.Width = new StyleDimension(87f, 0.0f); - uiPanel.Height = new StyleDimension(180f, 0.0f); - uiPanel.HAlign = 0.0f; - uiPanel.VAlign = 0.5f; - uiPanel.Append((UIElement) slider); - uiPanel.OnUpdate += new UIElement.ElementEvent(CreativePowersHelper.UpdateUseMouseInterface); - UIText uiText1 = new UIText("x24"); - uiText1.HAlign = 1f; - uiText1.VAlign = 0.0f; - uiPanel.Append((UIElement) uiText1); - UIText uiText2 = new UIText("x12"); - uiText2.HAlign = 1f; - uiText2.VAlign = 0.5f; - uiPanel.Append((UIElement) uiText2); - UIText uiText3 = new UIText("x1"); - uiText3.HAlign = 1f; - uiText3.VAlign = 1f; - uiPanel.Append((UIElement) uiText3); - return (UIElement) uiPanel; - } - - public override bool GetIsUnlocked() => true; - - public void Save(BinaryWriter writer) => writer.Write(this._sliderCurrentValueCache); - - public void Load(BinaryReader reader, int gameVersionSaveWasMadeOn) - { - this._sliderCurrentValueCache = reader.ReadSingle(); - this.UpdateInfoFromSliderValueCache(); - } - - public void ValidateWorld(BinaryReader reader, int gameVersionSaveWasMadeOn) - { - double num = (double) reader.ReadSingle(); - } - - private void UpdateSliderAndShowMultiplierMouseOver(UIElement affectedElement) - { - if (!affectedElement.IsMouseHovering) - return; - string originalText = "x" + this.TargetTimeRate.ToString(); - CreativePowersHelper.AddPermissionTextIfNeeded((ICreativePower) this, ref originalText); - Main.instance.MouseTextNoOverride(originalText); - } - } - - public class DifficultySliderPower : - CreativePowers.ASharedSliderPower, - IPersistentPerWorldContent - { - public float StrengthMultiplierToGiveNPCs { get; private set; } - - public DifficultySliderPower() - { - this._powerNameKey = "CreativePowers.DifficultySlider"; - this._iconLocation = CreativePowersHelper.CreativePowerIconLocations.EnemyStrengthSlider; - } - - public override void Reset() - { - this._sliderCurrentValueCache = 0.0f; - this.UpdateInfoFromSliderValueCache(); - } - - internal override void UpdateInfoFromSliderValueCache() - { - this.StrengthMultiplierToGiveNPCs = (double) this._sliderCurrentValueCache > 0.330000013113022 ? Utils.Remap(this._sliderCurrentValueCache, 0.33f, 1f, 1f, 3f) : Utils.Remap(this._sliderCurrentValueCache, 0.0f, 0.33f, 0.5f, 1f); - this.StrengthMultiplierToGiveNPCs = (float) Math.Round((double) this.StrengthMultiplierToGiveNPCs * 20.0) / 20f; - } - - public override UIElement ProvideSlider() - { - UIVerticalSlider slider = CreativePowersHelper.CreateSlider(new Func(((CreativePowers.ASharedSliderPower) this).GetSliderValue), new Action(((CreativePowers.ASharedSliderPower) this).SetValueKeyboard), new Action(((CreativePowers.ASharedSliderPower) this).SetValueGamepad)); - UIPanel panel = new UIPanel(); - panel.Width = new StyleDimension(82f, 0.0f); - panel.Height = new StyleDimension(180f, 0.0f); - panel.HAlign = 0.0f; - panel.VAlign = 0.5f; - panel.Append((UIElement) slider); - panel.OnUpdate += new UIElement.ElementEvent(CreativePowersHelper.UpdateUseMouseInterface); - slider.OnUpdate += new UIElement.ElementEvent(this.UpdateSliderColorAndShowMultiplierMouseOver); - CreativePowers.DifficultySliderPower.AddIndication(panel, 0.0f, "x3", "Images/UI/WorldCreation/IconDifficultyMaster", new UIElement.ElementEvent(this.MouseOver_Master)); - CreativePowers.DifficultySliderPower.AddIndication(panel, 0.3333333f, "x2", "Images/UI/WorldCreation/IconDifficultyExpert", new UIElement.ElementEvent(this.MouseOver_Expert)); - CreativePowers.DifficultySliderPower.AddIndication(panel, 0.6666667f, "x1", "Images/UI/WorldCreation/IconDifficultyNormal", new UIElement.ElementEvent(this.MouseOver_Normal)); - CreativePowers.DifficultySliderPower.AddIndication(panel, 1f, "x0.5", "Images/UI/WorldCreation/IconDifficultyCreative", new UIElement.ElementEvent(this.MouseOver_Journey)); - return (UIElement) panel; - } - - private static void AddIndication( - UIPanel panel, - float yAnchor, - string indicationText, - string iconImagePath, - UIElement.ElementEvent updateEvent) - { - UIImage uiImage1 = new UIImage(Main.Assets.Request(iconImagePath, (AssetRequestMode) 1)); - uiImage1.HAlign = 1f; - uiImage1.VAlign = yAnchor; - uiImage1.Left = new StyleDimension(4f, 0.0f); - uiImage1.Top = new StyleDimension(2f, 0.0f); - uiImage1.RemoveFloatingPointsFromDrawPosition = true; - UIImage uiImage2 = uiImage1; - if (updateEvent != null) - uiImage2.OnUpdate += updateEvent; - panel.Append((UIElement) uiImage2); - } - - private void MouseOver_Journey(UIElement affectedElement) - { - if (!affectedElement.IsMouseHovering) - return; - string textValue = Language.GetTextValue("UI.Creative"); - Main.instance.MouseTextNoOverride(textValue); - } - - private void MouseOver_Normal(UIElement affectedElement) - { - if (!affectedElement.IsMouseHovering) - return; - string textValue = Language.GetTextValue("UI.Normal"); - Main.instance.MouseTextNoOverride(textValue); - } - - private void MouseOver_Expert(UIElement affectedElement) - { - if (!affectedElement.IsMouseHovering) - return; - string textValue = Language.GetTextValue("UI.Expert"); - Main.instance.MouseTextNoOverride(textValue); - } - - private void MouseOver_Master(UIElement affectedElement) - { - if (!affectedElement.IsMouseHovering) - return; - string textValue = Language.GetTextValue("UI.Master"); - Main.instance.MouseTextNoOverride(textValue); - } - - private void UpdateSliderColorAndShowMultiplierMouseOver(UIElement affectedElement) - { - if (affectedElement.IsMouseHovering) - { - string originalText = "x" + this.StrengthMultiplierToGiveNPCs.ToString("F2"); - CreativePowersHelper.AddPermissionTextIfNeeded((ICreativePower) this, ref originalText); - Main.instance.MouseTextNoOverride(originalText); - } - if (!(affectedElement is UIVerticalSlider uiVerticalSlider)) - return; - uiVerticalSlider.EmptyColor = Color.Black; - Color color = !Main.masterMode ? (!Main.expertMode ? ((double) this.StrengthMultiplierToGiveNPCs >= 1.0 ? Color.White : Main.creativeModeColor) : Main.mcColor) : Main.hcColor; - uiVerticalSlider.FilledColor = color; - } - - public override bool GetIsUnlocked() => true; - - public void Save(BinaryWriter writer) => writer.Write(this._sliderCurrentValueCache); - - public void Load(BinaryReader reader, int gameVersionSaveWasMadeOn) - { - this._sliderCurrentValueCache = reader.ReadSingle(); - this.UpdateInfoFromSliderValueCache(); - } - - public void ValidateWorld(BinaryReader reader, int gameVersionSaveWasMadeOn) - { - double num = (double) reader.ReadSingle(); - } - } - - public class ModifyWindDirectionAndStrength : CreativePowers.ASharedSliderPower - { - public ModifyWindDirectionAndStrength() - { - this._powerNameKey = "CreativePowers.ModifyWindDirectionAndStrength"; - this._iconLocation = CreativePowersHelper.CreativePowerIconLocations.WindDirection; - this._syncToJoiningPlayers = false; - } - - internal override void UpdateInfoFromSliderValueCache() => Main.windSpeedCurrent = Main.windSpeedTarget = MathHelper.Lerp(-0.8f, 0.8f, this._sliderCurrentValueCache); - - internal override float GetSliderValueInner() => Utils.GetLerpValue(-0.8f, 0.8f, Main.windSpeedTarget, false); - - public override bool GetIsUnlocked() => true; - - public override UIElement ProvideSlider() - { - UIVerticalSlider slider = CreativePowersHelper.CreateSlider(new Func(((CreativePowers.ASharedSliderPower) this).GetSliderValue), new Action(((CreativePowers.ASharedSliderPower) this).SetValueKeyboard), new Action(((CreativePowers.ASharedSliderPower) this).SetValueGamepad)); - slider.OnUpdate += new UIElement.ElementEvent(this.UpdateSliderAndShowMultiplierMouseOver); - UIPanel uiPanel = new UIPanel(); - uiPanel.Width = new StyleDimension(132f, 0.0f); - uiPanel.Height = new StyleDimension(180f, 0.0f); - uiPanel.HAlign = 0.0f; - uiPanel.VAlign = 0.5f; - uiPanel.Append((UIElement) slider); - uiPanel.OnUpdate += new UIElement.ElementEvent(CreativePowersHelper.UpdateUseMouseInterface); - UIText uiText1 = new UIText(Language.GetText("CreativePowers.WindWest")); - uiText1.HAlign = 1f; - uiText1.VAlign = 0.0f; - uiPanel.Append((UIElement) uiText1); - UIText uiText2 = new UIText(Language.GetText("CreativePowers.WindEast")); - uiText2.HAlign = 1f; - uiText2.VAlign = 1f; - uiPanel.Append((UIElement) uiText2); - UIText uiText3 = new UIText(Language.GetText("CreativePowers.WindNone")); - uiText3.HAlign = 1f; - uiText3.VAlign = 0.5f; - uiPanel.Append((UIElement) uiText3); - return (UIElement) uiPanel; - } - - private void UpdateSliderAndShowMultiplierMouseOver(UIElement affectedElement) - { - if (!affectedElement.IsMouseHovering) - return; - int num = (int) ((double) Main.windSpeedCurrent * 50.0); - string originalText = ""; - if (num < 0) - originalText += Language.GetTextValue("GameUI.EastWind", (object) Math.Abs(num)); - else if (num > 0) - originalText += Language.GetTextValue("GameUI.WestWind", (object) num); - CreativePowersHelper.AddPermissionTextIfNeeded((ICreativePower) this, ref originalText); - Main.instance.MouseTextNoOverride(originalText); - } - } - - public class ModifyRainPower : CreativePowers.ASharedSliderPower - { - public ModifyRainPower() - { - this._powerNameKey = "CreativePowers.ModifyRainPower"; - this._iconLocation = CreativePowersHelper.CreativePowerIconLocations.RainStrength; - this._syncToJoiningPlayers = false; - } - - internal override void UpdateInfoFromSliderValueCache() - { - if ((double) this._sliderCurrentValueCache == 0.0) - Main.StopRain(); - else - Main.StartRain(); - Main.cloudAlpha = this._sliderCurrentValueCache; - Main.maxRaining = this._sliderCurrentValueCache; - } - - internal override float GetSliderValueInner() => Main.cloudAlpha; - - public override bool GetIsUnlocked() => true; - - public override UIElement ProvideSlider() - { - UIVerticalSlider slider = CreativePowersHelper.CreateSlider(new Func(((CreativePowers.ASharedSliderPower) this).GetSliderValue), new Action(((CreativePowers.ASharedSliderPower) this).SetValueKeyboard), new Action(((CreativePowers.ASharedSliderPower) this).SetValueGamepad)); - slider.OnUpdate += new UIElement.ElementEvent(this.UpdateSliderAndShowMultiplierMouseOver); - UIPanel uiPanel = new UIPanel(); - uiPanel.Width = new StyleDimension(132f, 0.0f); - uiPanel.Height = new StyleDimension(180f, 0.0f); - uiPanel.HAlign = 0.0f; - uiPanel.VAlign = 0.5f; - uiPanel.Append((UIElement) slider); - uiPanel.OnUpdate += new UIElement.ElementEvent(CreativePowersHelper.UpdateUseMouseInterface); - UIText uiText1 = new UIText(Language.GetText("CreativePowers.WeatherMonsoon")); - uiText1.HAlign = 1f; - uiText1.VAlign = 0.0f; - uiPanel.Append((UIElement) uiText1); - UIText uiText2 = new UIText(Language.GetText("CreativePowers.WeatherClearSky")); - uiText2.HAlign = 1f; - uiText2.VAlign = 1f; - uiPanel.Append((UIElement) uiText2); - UIText uiText3 = new UIText(Language.GetText("CreativePowers.WeatherDrizzle")); - uiText3.HAlign = 1f; - uiText3.VAlign = 0.5f; - uiPanel.Append((UIElement) uiText3); - return (UIElement) uiPanel; - } - - private void UpdateSliderAndShowMultiplierMouseOver(UIElement affectedElement) - { - if (!affectedElement.IsMouseHovering) - return; - string originalText = Main.maxRaining.ToString("P0"); - CreativePowersHelper.AddPermissionTextIfNeeded((ICreativePower) this, ref originalText); - Main.instance.MouseTextNoOverride(originalText); - } - } - - public class FreezeTime : CreativePowers.ASharedTogglePower, IPersistentPerWorldContent - { - internal override void CustomizeButton(UIElement button) => button.Append((UIElement) CreativePowersHelper.GetIconImage(CreativePowersHelper.CreativePowerIconLocations.FreezeTime)); - - internal override string GetButtonTextKey() => "CreativePowers.FreezeTime"; - - public override bool GetIsUnlocked() => true; - - public void Save(BinaryWriter writer) => writer.Write(this.Enabled); - - public void Load(BinaryReader reader, int gameVersionSaveWasMadeOn) => this.SetPowerInfo(reader.ReadBoolean()); - - public void ValidateWorld(BinaryReader reader, int gameVersionSaveWasMadeOn) => reader.ReadBoolean(); - } - - public class FreezeWindDirectionAndStrength : - CreativePowers.ASharedTogglePower, - IPersistentPerWorldContent - { - internal override void CustomizeButton(UIElement button) => button.Append((UIElement) CreativePowersHelper.GetIconImage(CreativePowersHelper.CreativePowerIconLocations.WindFreeze)); - - internal override string GetButtonTextKey() => "CreativePowers.FreezeWindDirectionAndStrength"; - - public override bool GetIsUnlocked() => true; - - public void Save(BinaryWriter writer) => writer.Write(this.Enabled); - - public void Load(BinaryReader reader, int gameVersionSaveWasMadeOn) => this.SetPowerInfo(reader.ReadBoolean()); - - public void ValidateWorld(BinaryReader reader, int gameVersionSaveWasMadeOn) => reader.ReadBoolean(); - } - - public class FreezeRainPower : CreativePowers.ASharedTogglePower, IPersistentPerWorldContent - { - internal override void CustomizeButton(UIElement button) => button.Append((UIElement) CreativePowersHelper.GetIconImage(CreativePowersHelper.CreativePowerIconLocations.RainFreeze)); - - internal override string GetButtonTextKey() => "CreativePowers.FreezeRainPower"; - - public override bool GetIsUnlocked() => true; - - public void Save(BinaryWriter writer) => writer.Write(this.Enabled); - - public void Load(BinaryReader reader, int gameVersionSaveWasMadeOn) => this.SetPowerInfo(reader.ReadBoolean()); - - public void ValidateWorld(BinaryReader reader, int gameVersionSaveWasMadeOn) => reader.ReadBoolean(); - } - - public class StopBiomeSpreadPower : CreativePowers.ASharedTogglePower, IPersistentPerWorldContent - { - internal override void CustomizeButton(UIElement button) => button.Append((UIElement) CreativePowersHelper.GetIconImage(CreativePowersHelper.CreativePowerIconLocations.StopBiomeSpread)); - - internal override string GetButtonTextKey() => "CreativePowers.StopBiomeSpread"; - - public override bool GetIsUnlocked() => true; - - public void Save(BinaryWriter writer) => writer.Write(this.Enabled); - - public void Load(BinaryReader reader, int gameVersionSaveWasMadeOn) => this.SetPowerInfo(reader.ReadBoolean()); - - public void ValidateWorld(BinaryReader reader, int gameVersionSaveWasMadeOn) => reader.ReadBoolean(); - } - - public class SpawnRateSliderPerPlayerPower : - CreativePowers.APerPlayerSliderPower, - IPersistentPerPlayerContent - { - public float StrengthMultiplierToGiveNPCs { get; private set; } - - public SpawnRateSliderPerPlayerPower() - { - this._powerNameKey = "CreativePowers.NPCSpawnRateSlider"; - this._sliderDefaultValue = 0.5f; - this._iconLocation = CreativePowersHelper.CreativePowerIconLocations.EnemySpawnRate; - } - - public bool GetShouldDisableSpawnsFor(int playerIndex) => this._cachePerPlayer.IndexInRange(playerIndex) && (double) this._cachePerPlayer[playerIndex] == 0.0; - - internal override void UpdateInfoFromSliderValueCache() - { - } - - public override float RemapSliderValueToPowerValue(float sliderValue) => (double) sliderValue < 0.5 ? Utils.Remap(sliderValue, 0.0f, 0.5f, 0.1f, 1f) : Utils.Remap(sliderValue, 0.5f, 1f, 1f, 10f); - - public override UIElement ProvideSlider() - { - UIVerticalSlider slider = CreativePowersHelper.CreateSlider(new Func(((CreativePowers.APerPlayerSliderPower) this).GetSliderValue), new Action(((CreativePowers.APerPlayerSliderPower) this).SetValueKeyboard), new Action(((CreativePowers.APerPlayerSliderPower) this).SetValueGamepad)); - slider.OnUpdate += new UIElement.ElementEvent(this.UpdateSliderAndShowMultiplierMouseOver); - UIPanel uiPanel = new UIPanel(); - uiPanel.Width = new StyleDimension(77f, 0.0f); - uiPanel.Height = new StyleDimension(180f, 0.0f); - uiPanel.HAlign = 0.0f; - uiPanel.VAlign = 0.5f; - uiPanel.Append((UIElement) slider); - uiPanel.OnUpdate += new UIElement.ElementEvent(CreativePowersHelper.UpdateUseMouseInterface); - UIText uiText1 = new UIText("x10"); - uiText1.HAlign = 1f; - uiText1.VAlign = 0.0f; - uiPanel.Append((UIElement) uiText1); - UIText uiText2 = new UIText("x1"); - uiText2.HAlign = 1f; - uiText2.VAlign = 0.5f; - uiPanel.Append((UIElement) uiText2); - UIText uiText3 = new UIText("x0"); - uiText3.HAlign = 1f; - uiText3.VAlign = 1f; - uiPanel.Append((UIElement) uiText3); - return (UIElement) uiPanel; - } - - private void UpdateSliderAndShowMultiplierMouseOver(UIElement affectedElement) - { - if (!affectedElement.IsMouseHovering) - return; - string originalText = "x" + this.RemapSliderValueToPowerValue(this.GetSliderValue()).ToString("F2"); - if (this.GetShouldDisableSpawnsFor(Main.myPlayer)) - originalText = Language.GetTextValue(this._powerNameKey + "EnemySpawnsDisabled"); - CreativePowersHelper.AddPermissionTextIfNeeded((ICreativePower) this, ref originalText); - Main.instance.MouseTextNoOverride(originalText); - } - - public override bool GetIsUnlocked() => true; - - public void Save(Player player, BinaryWriter writer) - { - float num = this._cachePerPlayer[player.whoAmI]; - writer.Write(num); - } - - public void ResetDataForNewPlayer(Player player) => player.savedPerPlayerFieldsThatArentInThePlayerClass.spawnRatePowerSliderValue = this._sliderDefaultValue; - - public void Load(Player player, BinaryReader reader, int gameVersionSaveWasMadeOn) - { - float num = reader.ReadSingle(); - player.savedPerPlayerFieldsThatArentInThePlayerClass.spawnRatePowerSliderValue = num; - } - - public void ApplyLoadedDataToOutOfPlayerFields(Player player) => this.PushChangeAndSetSlider(player.savedPerPlayerFieldsThatArentInThePlayerClass.spawnRatePowerSliderValue); - } - } -} diff --git a/GameContent/Creative/CreativePowersHelper.cs b/GameContent/Creative/CreativePowersHelper.cs deleted file mode 100644 index 84fe7ec..0000000 --- a/GameContent/Creative/CreativePowersHelper.cs +++ /dev/null @@ -1,195 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Creative.CreativePowersHelper -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using System; -using Terraria.GameContent.UI.Elements; -using Terraria.ID; -using Terraria.Localization; -using Terraria.UI; - -namespace Terraria.GameContent.Creative -{ - public class CreativePowersHelper - { - public const int TextureIconColumns = 21; - public const int TextureIconRows = 1; - public static Color CommonSelectedColor = new Color(152, 175, 235); - - private static Asset GetPowerIconAsset(string path) => Main.Assets.Request(path, (AssetRequestMode) 1); - - public static UIImageFramed GetIconImage(Point iconLocation) - { - Asset powerIconAsset = CreativePowersHelper.GetPowerIconAsset("Images/UI/Creative/Infinite_Powers"); - UIImageFramed uiImageFramed = new UIImageFramed(powerIconAsset, powerIconAsset.Frame(21, frameX: iconLocation.X, frameY: iconLocation.Y)); - uiImageFramed.MarginLeft = 4f; - uiImageFramed.MarginTop = 4f; - uiImageFramed.VAlign = 0.5f; - uiImageFramed.HAlign = 1f; - uiImageFramed.IgnoresMouseInteraction = true; - return uiImageFramed; - } - - public static GroupOptionButton CreateToggleButton( - CreativePowerUIElementRequestInfo info) - { - GroupOptionButton groupOptionButton = new GroupOptionButton(true, (LocalizedText) null, (LocalizedText) null, Color.White, (string) null, 0.8f); - groupOptionButton.Width = new StyleDimension((float) info.PreferredButtonWidth, 0.0f); - groupOptionButton.Height = new StyleDimension((float) info.PreferredButtonHeight, 0.0f); - groupOptionButton.ShowHighlightWhenSelected = false; - groupOptionButton.SetCurrentOption(false); - groupOptionButton.SetColorsBasedOnSelectionState(new Color(152, 175, 235), Colors.InventoryDefaultColor, 1f, 0.7f); - groupOptionButton.SetColorsBasedOnSelectionState(Main.OurFavoriteColor, Colors.InventoryDefaultColor, 1f, 0.7f); - return groupOptionButton; - } - - public static GroupOptionButton CreateSimpleButton( - CreativePowerUIElementRequestInfo info) - { - GroupOptionButton groupOptionButton = new GroupOptionButton(true, (LocalizedText) null, (LocalizedText) null, Color.White, (string) null, 0.8f); - groupOptionButton.Width = new StyleDimension((float) info.PreferredButtonWidth, 0.0f); - groupOptionButton.Height = new StyleDimension((float) info.PreferredButtonHeight, 0.0f); - groupOptionButton.ShowHighlightWhenSelected = false; - groupOptionButton.SetCurrentOption(false); - groupOptionButton.SetColorsBasedOnSelectionState(new Color(152, 175, 235), Colors.InventoryDefaultColor, 1f, 0.7f); - return groupOptionButton; - } - - public static GroupOptionButton CreateCategoryButton( - CreativePowerUIElementRequestInfo info, - T option, - T currentOption) - where T : IConvertible, IEquatable - { - GroupOptionButton groupOptionButton = new GroupOptionButton(option, (LocalizedText) null, (LocalizedText) null, Color.White, (string) null, 0.8f); - groupOptionButton.Width = new StyleDimension((float) info.PreferredButtonWidth, 0.0f); - groupOptionButton.Height = new StyleDimension((float) info.PreferredButtonHeight, 0.0f); - groupOptionButton.ShowHighlightWhenSelected = false; - groupOptionButton.SetCurrentOption(currentOption); - groupOptionButton.SetColorsBasedOnSelectionState(new Color(152, 175, 235), Colors.InventoryDefaultColor, 1f, 0.7f); - return groupOptionButton; - } - - public static void AddPermissionTextIfNeeded(ICreativePower power, ref string originalText) - { - if (CreativePowersHelper.IsAvailableForPlayer(power, Main.myPlayer)) - return; - string textValue = Language.GetTextValue("CreativePowers.CantUsePowerBecauseOfNoPermissionFromServer"); - originalText = originalText + "\n" + textValue; - } - - public static void AddDescriptionIfNeeded(ref string originalText, string descriptionKey) - { - if (!CreativePowerSettings.ShouldPowersBeElaborated) - return; - string textValue = Language.GetTextValue(descriptionKey); - originalText = originalText + "\n" + textValue; - } - - public static void AddUnlockTextIfNeeded( - ref string originalText, - bool needed, - string descriptionKey) - { - if (needed) - return; - string textValue = Language.GetTextValue(descriptionKey); - originalText = originalText + "\n" + textValue; - } - - public static UIVerticalSlider CreateSlider( - Func GetSliderValueMethod, - Action SetValueKeyboardMethod, - Action SetValueGamepadMethod) - { - UIVerticalSlider uiVerticalSlider = new UIVerticalSlider(GetSliderValueMethod, SetValueKeyboardMethod, SetValueGamepadMethod, Color.Red); - uiVerticalSlider.Width = new StyleDimension(12f, 0.0f); - uiVerticalSlider.Height = new StyleDimension(-10f, 1f); - uiVerticalSlider.Left = new StyleDimension(6f, 0.0f); - uiVerticalSlider.HAlign = 0.0f; - uiVerticalSlider.VAlign = 0.5f; - uiVerticalSlider.EmptyColor = Color.OrangeRed; - uiVerticalSlider.FilledColor = Color.CornflowerBlue; - return uiVerticalSlider; - } - - public static void UpdateUseMouseInterface(UIElement affectedElement) - { - if (!affectedElement.IsMouseHovering) - return; - Main.LocalPlayer.mouseInterface = true; - } - - public static void UpdateUnlockStateByPower( - ICreativePower power, - UIElement button, - Color colorWhenSelected) - { - IGroupOptionButton asButton = button as IGroupOptionButton; - if (asButton == null) - return; - button.OnUpdate += (UIElement.ElementEvent) (element => CreativePowersHelper.UpdateUnlockStateByPowerInternal(power, colorWhenSelected, asButton)); - } - - public static bool IsAvailableForPlayer(ICreativePower power, int playerIndex) - { - switch (power.CurrentPermissionLevel) - { - case PowerPermissionLevel.CanBeChangedByHostAlone: - return Main.netMode == 0 || Main.countsAsHostForGameplay[playerIndex]; - case PowerPermissionLevel.CanBeChangedByEveryone: - return true; - default: - return false; - } - } - - private static void UpdateUnlockStateByPowerInternal( - ICreativePower power, - Color colorWhenSelected, - IGroupOptionButton asButton) - { - bool isUnlocked = power.GetIsUnlocked(); - bool flag = !CreativePowersHelper.IsAvailableForPlayer(power, Main.myPlayer); - asButton.SetBorderColor(flag ? Color.DimGray : Color.White); - if (flag) - asButton.SetColorsBasedOnSelectionState(new Color(60, 60, 60), new Color(60, 60, 60), 0.7f, 0.7f); - else if (isUnlocked) - asButton.SetColorsBasedOnSelectionState(colorWhenSelected, Colors.InventoryDefaultColor, 1f, 0.7f); - else - asButton.SetColorsBasedOnSelectionState(Color.Crimson, Color.Red, 0.7f, 0.7f); - } - - public class CreativePowerIconLocations - { - public static readonly Point Unassigned = new Point(0, 0); - public static readonly Point Deprecated = new Point(0, 0); - public static readonly Point ItemDuplication = new Point(0, 0); - public static readonly Point ItemResearch = new Point(1, 0); - public static readonly Point TimeCategory = new Point(2, 0); - public static readonly Point WeatherCategory = new Point(3, 0); - public static readonly Point EnemyStrengthSlider = new Point(4, 0); - public static readonly Point GameEvents = new Point(5, 0); - public static readonly Point Godmode = new Point(6, 0); - public static readonly Point BlockPlacementRange = new Point(7, 0); - public static readonly Point StopBiomeSpread = new Point(8, 0); - public static readonly Point EnemySpawnRate = new Point(9, 0); - public static readonly Point FreezeTime = new Point(10, 0); - public static readonly Point TimeDawn = new Point(11, 0); - public static readonly Point TimeNoon = new Point(12, 0); - public static readonly Point TimeDusk = new Point(13, 0); - public static readonly Point TimeMidnight = new Point(14, 0); - public static readonly Point WindDirection = new Point(15, 0); - public static readonly Point WindFreeze = new Point(16, 0); - public static readonly Point RainStrength = new Point(17, 0); - public static readonly Point RainFreeze = new Point(18, 0); - public static readonly Point ModifyTime = new Point(19, 0); - public static readonly Point PersonalCategory = new Point(20, 0); - } - } -} diff --git a/GameContent/Creative/CreativeUI.cs b/GameContent/Creative/CreativeUI.cs deleted file mode 100644 index 6b05196..0000000 --- a/GameContent/Creative/CreativeUI.cs +++ /dev/null @@ -1,236 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Creative.CreativeUI -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using System; -using System.Collections.Generic; -using Terraria.Audio; -using Terraria.GameContent.NetModules; -using Terraria.GameContent.UI.Elements; -using Terraria.GameContent.UI.States; -using Terraria.Localization; -using Terraria.Net; -using Terraria.UI; -using Terraria.UI.Gamepad; - -namespace Terraria.GameContent.Creative -{ - public class CreativeUI - { - public const int ItemSlotIndexes_SacrificeItem = 0; - public const int ItemSlotIndexes_Count = 1; - private bool _initialized; - private Asset _buttonTexture; - private Asset _buttonBorderTexture; - private Item[] _itemSlotsForUI = new Item[1]; - private List _itemIdsAvailableInfinitely = new List(); - private UserInterface _powersUI = new UserInterface(); - public int GamepadPointIdForInfiniteItemSearchHack = -1; - public bool GamepadMoveToSearchButtonHack; - private UICreativePowersMenu _uiState; - - public bool Enabled { get; private set; } - - public bool Blocked => Main.LocalPlayer.talkNPC != -1 || Main.LocalPlayer.chest != -1; - - public CreativeUI() - { - for (int index = 0; index < this._itemSlotsForUI.Length; ++index) - this._itemSlotsForUI[index] = new Item(); - } - - public void Initialize() - { - this._buttonTexture = Main.Assets.Request("Images/UI/Creative/Journey_Toggle", (AssetRequestMode) 1); - this._buttonBorderTexture = Main.Assets.Request("Images/UI/Creative/Journey_Toggle_MouseOver", (AssetRequestMode) 1); - this._itemIdsAvailableInfinitely.Clear(); - this._uiState = new UICreativePowersMenu(); - this._powersUI.SetState((UIState) this._uiState); - this._initialized = true; - } - - public void Update(GameTime gameTime) - { - if (!this.Enabled || !Main.playerInventory) - return; - this._powersUI.Update(gameTime); - } - - public void Draw(SpriteBatch spriteBatch) - { - if (!this._initialized) - this.Initialize(); - if (Main.LocalPlayer.difficulty != (byte) 3) - { - this.Enabled = false; - } - else - { - if (this.Blocked) - return; - Vector2 location = new Vector2(28f, 267f); - Vector2 vector2_1 = new Vector2(353f, 258f); - Vector2 vector2_2 = new Vector2(40f, 267f); - Vector2 vector2_3 = new Vector2(50f, 50f); - Vector2 vector2_4 = vector2_1 + vector2_3; - if (Main.screenHeight < 650 && this.Enabled) - location.X += 52f * Main.inventoryScale; - this.DrawToggleButton(spriteBatch, location); - if (!this.Enabled) - return; - this._powersUI.Draw(spriteBatch, Main.gameTimeCache); - } - } - - public UIElement ProvideItemSlotElement(int itemSlotContext) => itemSlotContext != 0 ? (UIElement) null : (UIElement) new UIItemSlot(this._itemSlotsForUI, itemSlotContext, 30); - - public Item GetItemByIndex(int itemSlotContext) => itemSlotContext != 0 ? (Item) null : this._itemSlotsForUI[itemSlotContext]; - - public void SetItembyIndex(Item item, int itemSlotContext) - { - if (itemSlotContext != 0) - return; - this._itemSlotsForUI[itemSlotContext] = item; - } - - private void DrawToggleButton(SpriteBatch spritebatch, Vector2 location) - { - Vector2 size = this._buttonTexture.Size(); - Rectangle rectangle = Utils.CenteredRectangle(location + size / 2f, size); - UILinkPointNavigator.SetPosition(311, rectangle.Center.ToVector2()); - spritebatch.Draw(this._buttonTexture.Value, location, new Rectangle?(), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - Main.LocalPlayer.creativeInterface = false; - if (!rectangle.Contains(Main.MouseScreen.ToPoint())) - return; - Main.LocalPlayer.creativeInterface = true; - Main.LocalPlayer.mouseInterface = true; - if (this.Enabled) - Main.instance.MouseText(Language.GetTextValue("CreativePowers.PowersMenuOpen")); - else - Main.instance.MouseText(Language.GetTextValue("CreativePowers.PowersMenuClosed")); - spritebatch.Draw(this._buttonBorderTexture.Value, location, new Rectangle?(), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - if (!Main.mouseLeft || !Main.mouseLeftRelease) - return; - this.ToggleMenu(); - } - - public void SwapItem(ref Item item) => Utils.Swap(ref item, ref this._itemSlotsForUI[0]); - - public void CloseMenu() - { - this.Enabled = false; - if (this._itemSlotsForUI[0].stack <= 0) - return; - this._itemSlotsForUI[0] = Main.LocalPlayer.GetItem(Main.myPlayer, this._itemSlotsForUI[0], GetItemSettings.InventoryUIToInventorySettings); - } - - public void ToggleMenu() - { - this.Enabled = !this.Enabled; - SoundEngine.PlaySound(12); - if (this.Enabled) - { - Recipe.FindRecipes(); - Main.LocalPlayer.tileEntityAnchor.Clear(); - this.RefreshAvailableInfiniteItemsList(); - } - else - { - if (this._itemSlotsForUI[0].stack <= 0) - return; - this._itemSlotsForUI[0] = Main.LocalPlayer.GetItem(Main.myPlayer, this._itemSlotsForUI[0], GetItemSettings.InventoryUIToInventorySettings); - } - } - - public bool IsShowingResearchMenu() => this.Enabled && this._uiState != null && this._uiState.IsShowingResearchMenu; - - public bool ShouldDrawSacrificeArea() - { - if (!this._itemSlotsForUI[0].IsAir) - return true; - Item mouseItem = Main.mouseItem; - int amountNeeded; - return !mouseItem.IsAir && CreativeItemSacrificesCatalog.Instance.TryGetSacrificeCountCapToUnlockInfiniteItems(mouseItem.type, out amountNeeded) && Main.LocalPlayerCreativeTracker.ItemSacrifices.GetSacrificeCount(mouseItem.type) < amountNeeded; - } - - public bool GetSacrificeNumbers( - out int itemIdChecked, - out int amountWeHave, - out int amountNeededTotal) - { - amountWeHave = 0; - amountNeededTotal = 0; - itemIdChecked = 0; - Item obj = this._itemSlotsForUI[0]; - if (!obj.IsAir) - itemIdChecked = obj.type; - if (!CreativeItemSacrificesCatalog.Instance.TryGetSacrificeCountCapToUnlockInfiniteItems(obj.type, out amountNeededTotal)) - return false; - Main.LocalPlayerCreativeTracker.ItemSacrifices.SacrificesCountByItemIdCache.TryGetValue(obj.type, out amountWeHave); - return true; - } - - public CreativeUI.ItemSacrificeResult SacrificeItem(out int amountWeSacrificed) - { - int amountNeeded = 0; - amountWeSacrificed = 0; - Item newItem = this._itemSlotsForUI[0]; - if (!CreativeItemSacrificesCatalog.Instance.TryGetSacrificeCountCapToUnlockInfiniteItems(newItem.type, out amountNeeded)) - return CreativeUI.ItemSacrificeResult.CannotSacrifice; - int num1 = 0; - Main.LocalPlayerCreativeTracker.ItemSacrifices.SacrificesCountByItemIdCache.TryGetValue(newItem.type, out num1); - int val1 = Utils.Clamp(amountNeeded - num1, 0, amountNeeded); - if (val1 == 0) - return CreativeUI.ItemSacrificeResult.CannotSacrifice; - int amount = Math.Min(val1, newItem.stack); - if (!Main.ServerSideCharacter) - { - Main.LocalPlayerCreativeTracker.ItemSacrifices.RegisterItemSacrifice(newItem.type, amount); - } - else - { - NetPacket packet = NetCreativeUnlocksPlayerReportModule.SerializeSacrificeRequest(newItem.type, amount); - NetManager.Instance.SendToServerOrLoopback(packet); - } - int num2 = amount == val1 ? 1 : 0; - newItem.stack -= amount; - if (newItem.stack <= 0) - newItem.TurnToAir(); - amountWeSacrificed = amount; - this.RefreshAvailableInfiniteItemsList(); - if (newItem.stack > 0) - { - newItem.position.X = Main.player[Main.myPlayer].Center.X - (float) (newItem.width / 2); - newItem.position.Y = Main.player[Main.myPlayer].Center.Y - (float) (newItem.height / 2); - this._itemSlotsForUI[0] = Main.LocalPlayer.GetItem(Main.myPlayer, newItem, GetItemSettings.InventoryUIToInventorySettings); - } - return num2 == 0 ? CreativeUI.ItemSacrificeResult.SacrificedButNotDone : CreativeUI.ItemSacrificeResult.SacrificedAndDone; - } - - private void RefreshAvailableInfiniteItemsList() - { - this._itemIdsAvailableInfinitely.Clear(); - CreativeItemSacrificesCatalog.Instance.FillListOfItemsThatCanBeObtainedInfinitely(this._itemIdsAvailableInfinitely); - } - - public void Reset() - { - for (int index = 0; index < this._itemSlotsForUI.Length; ++index) - this._itemSlotsForUI[index].TurnToAir(); - this._initialized = false; - this.Enabled = false; - } - - public enum ItemSacrificeResult - { - CannotSacrifice, - SacrificedButNotDone, - SacrificedAndDone, - } - } -} diff --git a/GameContent/Creative/CreativeUnlocksTracker.cs b/GameContent/Creative/CreativeUnlocksTracker.cs deleted file mode 100644 index 990c77e..0000000 --- a/GameContent/Creative/CreativeUnlocksTracker.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Creative.CreativeUnlocksTracker -// 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.IO; - -namespace Terraria.GameContent.Creative -{ - public class CreativeUnlocksTracker : IPersistentPerWorldContent, IOnPlayerJoining - { - public ItemsSacrificedUnlocksTracker ItemSacrifices = new ItemsSacrificedUnlocksTracker(); - - public void Save(BinaryWriter writer) => this.ItemSacrifices.Save(writer); - - public void Load(BinaryReader reader, int gameVersionSaveWasMadeOn) => this.ItemSacrifices.Load(reader, gameVersionSaveWasMadeOn); - - public void ValidateWorld(BinaryReader reader, int gameVersionSaveWasMadeOn) => this.ValidateWorld(reader, gameVersionSaveWasMadeOn); - - public void Reset() => this.ItemSacrifices.Reset(); - - public void OnPlayerJoining(int playerIndex) => this.ItemSacrifices.OnPlayerJoining(playerIndex); - } -} diff --git a/GameContent/Creative/ICreativeItemSortStep.cs b/GameContent/Creative/ICreativeItemSortStep.cs deleted file mode 100644 index 72e3a6b..0000000 --- a/GameContent/Creative/ICreativeItemSortStep.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Creative.ICreativeItemSortStep -// 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.Collections.Generic; -using Terraria.DataStructures; - -namespace Terraria.GameContent.Creative -{ - public interface ICreativeItemSortStep : IEntrySortStep, IComparer - { - } -} diff --git a/GameContent/Creative/ICreativePower.cs b/GameContent/Creative/ICreativePower.cs deleted file mode 100644 index 3fca4cd..0000000 --- a/GameContent/Creative/ICreativePower.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Creative.ICreativePower -// 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.Collections.Generic; -using System.IO; -using Terraria.UI; - -namespace Terraria.GameContent.Creative -{ - public interface ICreativePower - { - ushort PowerId { get; set; } - - string ServerConfigName { get; set; } - - PowerPermissionLevel CurrentPermissionLevel { get; set; } - - PowerPermissionLevel DefaultPermissionLevel { get; set; } - - void DeserializeNetMessage(BinaryReader reader, int userId); - - void ProvidePowerButtons(CreativePowerUIElementRequestInfo info, List elements); - - bool GetIsUnlocked(); - } -} diff --git a/GameContent/Creative/IItemEntryFilter.cs b/GameContent/Creative/IItemEntryFilter.cs deleted file mode 100644 index 64d83c2..0000000 --- a/GameContent/Creative/IItemEntryFilter.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Creative.IItemEntryFilter -// 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 Terraria.DataStructures; - -namespace Terraria.GameContent.Creative -{ - public interface IItemEntryFilter : IEntryFilter - { - } -} diff --git a/GameContent/Creative/IPowerSubcategoryElement.cs b/GameContent/Creative/IPowerSubcategoryElement.cs deleted file mode 100644 index 918bffb..0000000 --- a/GameContent/Creative/IPowerSubcategoryElement.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Creative.IPowerSubcategoryElement -// 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 Terraria.GameContent.UI.Elements; - -namespace Terraria.GameContent.Creative -{ - public interface IPowerSubcategoryElement - { - GroupOptionButton GetOptionButton( - CreativePowerUIElementRequestInfo info, - int optionIndex, - int currentOptionIndex); - } -} diff --git a/GameContent/Creative/IProvideSliderElement.cs b/GameContent/Creative/IProvideSliderElement.cs deleted file mode 100644 index 461b66f..0000000 --- a/GameContent/Creative/IProvideSliderElement.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Creative.IProvideSliderElement -// 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 Terraria.UI; - -namespace Terraria.GameContent.Creative -{ - public interface IProvideSliderElement : IPowerSubcategoryElement - { - UIElement ProvideSlider(); - } -} diff --git a/GameContent/Creative/ItemFilters.cs b/GameContent/Creative/ItemFilters.cs deleted file mode 100644 index f460ce8..0000000 --- a/GameContent/Creative/ItemFilters.cs +++ /dev/null @@ -1,179 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Creative.ItemFilters -// 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.Graphics; -using ReLogic.Content; -using System; -using Terraria.DataStructures; -using Terraria.GameContent.UI.Elements; -using Terraria.ID; -using Terraria.UI; - -namespace Terraria.GameContent.Creative -{ - public static class ItemFilters - { - private const int framesPerRow = 9; - private const int framesPerColumn = 1; - private const int frameSizeOffsetX = -2; - private const int frameSizeOffsetY = 0; - - public class BySearch : IItemEntryFilter, IEntryFilter, ISearchFilter - { - private const int _tooltipMaxLines = 30; - private string[] _toolTipLines = new string[30]; - private bool[] _unusedPrefixLine = new bool[30]; - private bool[] _unusedBadPrefixLines = new bool[30]; - private int _unusedYoyoLogo; - private int _unusedResearchLine; - private string _search; - - public bool FitsFilter(Item entry) - { - if (this._search == null) - return true; - int numLines = 1; - float knockBack = entry.knockBack; - Main.MouseText_DrawItemTooltip_GetLinesInfo(entry, ref this._unusedYoyoLogo, ref this._unusedResearchLine, knockBack, ref numLines, this._toolTipLines, this._unusedPrefixLine, this._unusedBadPrefixLines); - for (int index = 0; index < numLines; ++index) - { - if (this._toolTipLines[index].ToLower().IndexOf(this._search, StringComparison.OrdinalIgnoreCase) != -1) - return true; - } - return false; - } - - public string GetDisplayNameKey() => "CreativePowers.TabSearch"; - - public UIElement GetImage() - { - Asset asset = Main.Assets.Request("Images/UI/Bestiary/Icon_Rank_Light", (AssetRequestMode) 1); - UIImageFramed uiImageFramed = new UIImageFramed(asset, asset.Frame()); - uiImageFramed.HAlign = 0.5f; - uiImageFramed.VAlign = 0.5f; - return (UIElement) uiImageFramed; - } - - public void SetSearch(string searchText) => this._search = searchText; - } - - public class BuildingBlock : IItemEntryFilter, IEntryFilter - { - public bool FitsFilter(Item entry) => entry.createTile != -1 || entry.createWall != -1 || entry.tileWand != -1; - - public string GetDisplayNameKey() => "CreativePowers.TabBlocks"; - - public UIElement GetImage() - { - Asset asset = Main.Assets.Request("Images/UI/Creative/Infinite_Icons", (AssetRequestMode) 1); - UIImageFramed uiImageFramed = new UIImageFramed(asset, asset.Frame(9, frameX: 4).OffsetSize(-2, 0)); - uiImageFramed.HAlign = 0.5f; - uiImageFramed.VAlign = 0.5f; - return (UIElement) uiImageFramed; - } - } - - public class Weapon : IItemEntryFilter, IEntryFilter - { - public bool FitsFilter(Item entry) => entry.damage > 0; - - public string GetDisplayNameKey() => "CreativePowers.TabWeapons"; - - public UIElement GetImage() - { - Asset asset = Main.Assets.Request("Images/UI/Creative/Infinite_Icons", (AssetRequestMode) 1); - UIImageFramed uiImageFramed = new UIImageFramed(asset, asset.Frame(9).OffsetSize(-2, 0)); - uiImageFramed.HAlign = 0.5f; - uiImageFramed.VAlign = 0.5f; - return (UIElement) uiImageFramed; - } - } - - public class Armor : IItemEntryFilter, IEntryFilter - { - public bool FitsFilter(Item entry) => entry.bodySlot != -1 || entry.headSlot != -1 || entry.legSlot != -1; - - public string GetDisplayNameKey() => "CreativePowers.TabArmor"; - - public UIElement GetImage() - { - Asset asset = Main.Assets.Request("Images/UI/Creative/Infinite_Icons", (AssetRequestMode) 1); - UIImageFramed uiImageFramed = new UIImageFramed(asset, asset.Frame(9, frameX: 2).OffsetSize(-2, 0)); - uiImageFramed.HAlign = 0.5f; - uiImageFramed.VAlign = 0.5f; - return (UIElement) uiImageFramed; - } - } - - public class Accessories : IItemEntryFilter, IEntryFilter - { - public bool FitsFilter(Item entry) => entry.accessory; - - public string GetDisplayNameKey() => "CreativePowers.TabAccessories"; - - public UIElement GetImage() - { - Asset asset = Main.Assets.Request("Images/UI/Creative/Infinite_Icons", (AssetRequestMode) 1); - UIImageFramed uiImageFramed = new UIImageFramed(asset, asset.Frame(9, frameX: 1).OffsetSize(-2, 0)); - uiImageFramed.HAlign = 0.5f; - uiImageFramed.VAlign = 0.5f; - return (UIElement) uiImageFramed; - } - } - - public class Consumables : IItemEntryFilter, IEntryFilter - { - public bool FitsFilter(Item entry) - { - bool flag = entry.createTile != -1 || entry.createWall != -1 || entry.tileWand != -1; - return entry.consumable && !flag; - } - - public string GetDisplayNameKey() => "CreativePowers.TabConsumables"; - - public UIElement GetImage() - { - Asset asset = Main.Assets.Request("Images/UI/Creative/Infinite_Icons", (AssetRequestMode) 1); - UIImageFramed uiImageFramed = new UIImageFramed(asset, asset.Frame(9, frameX: 3).OffsetSize(-2, 0)); - uiImageFramed.HAlign = 0.5f; - uiImageFramed.VAlign = 0.5f; - return (UIElement) uiImageFramed; - } - } - - public class GameplayItems : IItemEntryFilter, IEntryFilter - { - public bool FitsFilter(Item entry) => ItemID.Sets.SortingPriorityBossSpawns[entry.type] != -1; - - public string GetDisplayNameKey() => "CreativePowers.TabMisc"; - - public UIElement GetImage() - { - Asset asset = Main.Assets.Request("Images/UI/Creative/Infinite_Icons", (AssetRequestMode) 1); - UIImageFramed uiImageFramed = new UIImageFramed(asset, asset.Frame(9, frameX: 5).OffsetSize(-2, 0)); - uiImageFramed.HAlign = 0.5f; - uiImageFramed.VAlign = 0.5f; - return (UIElement) uiImageFramed; - } - } - - public class Materials : IItemEntryFilter, IEntryFilter - { - public bool FitsFilter(Item entry) => entry.material; - - public string GetDisplayNameKey() => "CreativePowers.TabMaterials"; - - public UIElement GetImage() - { - Asset asset = Main.Assets.Request("Images/UI/Creative/Infinite_Icons", (AssetRequestMode) 1); - UIImageFramed uiImageFramed = new UIImageFramed(asset, asset.Frame(9, frameX: 6).OffsetSize(-2, 0)); - uiImageFramed.HAlign = 0.5f; - uiImageFramed.VAlign = 0.5f; - return (UIElement) uiImageFramed; - } - } - } -} diff --git a/GameContent/Creative/ItemsSacrificedUnlocksTracker.cs b/GameContent/Creative/ItemsSacrificedUnlocksTracker.cs deleted file mode 100644 index ea9a849..0000000 --- a/GameContent/Creative/ItemsSacrificedUnlocksTracker.cs +++ /dev/null @@ -1,107 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Creative.ItemsSacrificedUnlocksTracker -// 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.Collections.Generic; -using System.IO; -using Terraria.ID; - -namespace Terraria.GameContent.Creative -{ - public class ItemsSacrificedUnlocksTracker : IPersistentPerWorldContent, IOnPlayerJoining - { - public const int POSITIVE_SACRIFICE_COUNT_CAP = 9999; - private Dictionary _sacrificeCountByItemPersistentId; - public readonly Dictionary SacrificesCountByItemIdCache; - - public int LastEditId { get; private set; } - - public ItemsSacrificedUnlocksTracker() - { - this._sacrificeCountByItemPersistentId = new Dictionary(); - this.SacrificesCountByItemIdCache = new Dictionary(); - this.LastEditId = 0; - } - - public int GetSacrificeCount(int itemId) - { - int num; - this.SacrificesCountByItemIdCache.TryGetValue(itemId, out num); - return num; - } - - public void RegisterItemSacrifice(int itemId, int amount) - { - string key; - if (!ContentSamples.ItemPersistentIdsByNetIds.TryGetValue(itemId, out key)) - return; - int num1; - this._sacrificeCountByItemPersistentId.TryGetValue(key, out num1); - int num2 = Utils.Clamp(num1 + amount, 0, 9999); - this._sacrificeCountByItemPersistentId[key] = num2; - this.SacrificesCountByItemIdCache[itemId] = num2; - this.MarkContentsDirty(); - } - - public void SetSacrificeCountDirectly(string persistentId, int sacrificeCount) - { - int num = Utils.Clamp(sacrificeCount, 0, 9999); - this._sacrificeCountByItemPersistentId[persistentId] = num; - int key; - if (!ContentSamples.ItemNetIdsByPersistentIds.TryGetValue(persistentId, out key)) - return; - this.SacrificesCountByItemIdCache[key] = num; - this.MarkContentsDirty(); - } - - public void Save(BinaryWriter writer) - { - Dictionary dictionary = new Dictionary((IDictionary) this._sacrificeCountByItemPersistentId); - writer.Write(dictionary.Count); - foreach (KeyValuePair keyValuePair in dictionary) - { - writer.Write(keyValuePair.Key); - writer.Write(keyValuePair.Value); - } - } - - public void Load(BinaryReader reader, int gameVersionSaveWasMadeOn) - { - int num1 = reader.ReadInt32(); - for (int index = 0; index < num1; ++index) - { - string key1 = reader.ReadString(); - int num2 = reader.ReadInt32(); - this._sacrificeCountByItemPersistentId[key1] = num2; - int key2; - if (ContentSamples.ItemNetIdsByPersistentIds.TryGetValue(key1, out key2)) - this.SacrificesCountByItemIdCache[key2] = num2; - } - } - - public void ValidateWorld(BinaryReader reader, int gameVersionSaveWasMadeOn) - { - int num = reader.ReadInt32(); - for (int index = 0; index < num; ++index) - { - reader.ReadString(); - reader.ReadInt32(); - } - } - - public void Reset() - { - this._sacrificeCountByItemPersistentId.Clear(); - this.SacrificesCountByItemIdCache.Clear(); - this.MarkContentsDirty(); - } - - public void OnPlayerJoining(int playerIndex) - { - } - - public void MarkContentsDirty() => ++this.LastEditId; - } -} diff --git a/GameContent/Creative/PowerPermissionLevel.cs b/GameContent/Creative/PowerPermissionLevel.cs deleted file mode 100644 index ecd0326..0000000 --- a/GameContent/Creative/PowerPermissionLevel.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Creative.PowerPermissionLevel -// 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.Creative -{ - public enum PowerPermissionLevel - { - LockedForEveryone, - CanBeChangedByHostAlone, - CanBeChangedByEveryone, - } -} diff --git a/GameContent/Creative/SortingSteps.cs b/GameContent/Creative/SortingSteps.cs deleted file mode 100644 index 178d1c8..0000000 --- a/GameContent/Creative/SortingSteps.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Creative.SortingSteps -// 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 Terraria.DataStructures; -using Terraria.ID; - -namespace Terraria.GameContent.Creative -{ - public static class SortingSteps - { - public abstract class ACreativeItemSortStep : - ICreativeItemSortStep, - IEntrySortStep, - IComparer, - IComparer - { - public abstract string GetDisplayNameKey(); - - public int Compare(int x, int y) => this.Compare(ContentSamples.ItemsByType[x], ContentSamples.ItemsByType[y]); - - public abstract int Compare(Item x, Item y); - } - - public abstract class AStepByFittingFilter : SortingSteps.ACreativeItemSortStep - { - public override int Compare(Item x, Item y) - { - int num = this.FitsFilter(x).CompareTo(this.FitsFilter(y)); - if (num == 0) - num = 1; - return num; - } - - public abstract bool FitsFilter(Item item); - - public virtual int CompareWhenBothFit(Item x, Item y) => string.Compare(x.Name, y.Name, StringComparison.OrdinalIgnoreCase); - } - - public class Blocks : SortingSteps.AStepByFittingFilter - { - public override string GetDisplayNameKey() => "CreativePowers.Sort_Blocks"; - - public override bool FitsFilter(Item item) => item.createTile >= 0 && !Main.tileFrameImportant[item.createTile]; - } - - public class Walls : SortingSteps.AStepByFittingFilter - { - public override string GetDisplayNameKey() => "CreativePowers.Sort_Walls"; - - public override bool FitsFilter(Item item) => item.createWall >= 0; - } - - public class PlacableObjects : SortingSteps.AStepByFittingFilter - { - public override string GetDisplayNameKey() => "CreativePowers.Sort_PlacableObjects"; - - public override bool FitsFilter(Item item) => item.createTile >= 0 && Main.tileFrameImportant[item.createTile]; - } - - public class ByCreativeSortingId : SortingSteps.ACreativeItemSortStep - { - public override string GetDisplayNameKey() => "CreativePowers.Sort_SortingID"; - - public override int Compare(Item x, Item y) - { - ContentSamples.CreativeHelper.ItemGroupAndOrderInGroup groupAndOrderInGroup1 = ContentSamples.ItemCreativeSortingId[x.type]; - ContentSamples.CreativeHelper.ItemGroupAndOrderInGroup groupAndOrderInGroup2 = ContentSamples.ItemCreativeSortingId[y.type]; - int num = groupAndOrderInGroup1.Group.CompareTo((object) groupAndOrderInGroup2.Group); - if (num == 0) - num = groupAndOrderInGroup1.OrderInGroup.CompareTo(groupAndOrderInGroup2.OrderInGroup); - return num; - } - } - - public class Alphabetical : SortingSteps.ACreativeItemSortStep - { - public override string GetDisplayNameKey() => "CreativePowers.Sort_Alphabetical"; - - public override int Compare(Item x, Item y) => x.Name.CompareTo(y.Name); - } - } -} diff --git a/GameContent/DoorOpeningHelper.cs b/GameContent/DoorOpeningHelper.cs deleted file mode 100644 index 06eb76f..0000000 --- a/GameContent/DoorOpeningHelper.cs +++ /dev/null @@ -1,352 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.DoorOpeningHelper -// 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; -using System; -using System.Collections.Generic; -using Terraria.GameInput; - -namespace Terraria.GameContent -{ - public class DoorOpeningHelper - { - public static DoorOpeningHelper.DoorAutoOpeningPreference PreferenceSettings = DoorOpeningHelper.DoorAutoOpeningPreference.EnabledForEverything; - private Dictionary _handlerByTileType = new Dictionary() - { - { - 10, - (DoorOpeningHelper.DoorAutoHandler) new DoorOpeningHelper.CommonDoorOpeningInfoProvider() - }, - { - 388, - (DoorOpeningHelper.DoorAutoHandler) new DoorOpeningHelper.TallGateOpeningInfoProvider() - } - }; - private List _ongoingOpenDoors = new List(); - private int _timeWeCanOpenDoorsUsingVelocityAlone; - - public void AllowOpeningDoorsByVelocityAloneForATime(int timeInFramesToAllow) => this._timeWeCanOpenDoorsUsingVelocityAlone = timeInFramesToAllow; - - public void Update(Player player) - { - this.LookForDoorsToClose(player); - if (this.ShouldTryOpeningDoors()) - this.LookForDoorsToOpen(player); - if (this._timeWeCanOpenDoorsUsingVelocityAlone <= 0) - return; - --this._timeWeCanOpenDoorsUsingVelocityAlone; - } - - private bool ShouldTryOpeningDoors() - { - switch (DoorOpeningHelper.PreferenceSettings) - { - case DoorOpeningHelper.DoorAutoOpeningPreference.EnabledForGamepadOnly: - return PlayerInput.UsingGamepad; - case DoorOpeningHelper.DoorAutoOpeningPreference.EnabledForEverything: - return true; - default: - return false; - } - } - - public static void CyclePreferences() - { - switch (DoorOpeningHelper.PreferenceSettings) - { - case DoorOpeningHelper.DoorAutoOpeningPreference.Disabled: - DoorOpeningHelper.PreferenceSettings = DoorOpeningHelper.DoorAutoOpeningPreference.EnabledForEverything; - break; - case DoorOpeningHelper.DoorAutoOpeningPreference.EnabledForGamepadOnly: - DoorOpeningHelper.PreferenceSettings = DoorOpeningHelper.DoorAutoOpeningPreference.Disabled; - break; - case DoorOpeningHelper.DoorAutoOpeningPreference.EnabledForEverything: - DoorOpeningHelper.PreferenceSettings = DoorOpeningHelper.DoorAutoOpeningPreference.EnabledForGamepadOnly; - break; - } - } - - public void LookForDoorsToClose(Player player) - { - DoorOpeningHelper.PlayerInfoForClosingDoors infoForClosingDoor = this.GetPlayerInfoForClosingDoor(player); - for (int index = this._ongoingOpenDoors.Count - 1; index >= 0; --index) - { - DoorOpeningHelper.DoorOpenCloseTogglingInfo ongoingOpenDoor = this._ongoingOpenDoors[index]; - if (ongoingOpenDoor.handler.TryCloseDoor(ongoingOpenDoor, infoForClosingDoor) != DoorOpeningHelper.DoorCloseAttemptResult.StillInDoorArea) - this._ongoingOpenDoors.RemoveAt(index); - } - } - - private DoorOpeningHelper.PlayerInfoForClosingDoors GetPlayerInfoForClosingDoor( - Player player) - { - return new DoorOpeningHelper.PlayerInfoForClosingDoors() - { - hitboxToNotCloseDoor = player.Hitbox - }; - } - - public void LookForDoorsToOpen(Player player) - { - DoorOpeningHelper.PlayerInfoForOpeningDoors infoForOpeningDoor = this.GetPlayerInfoForOpeningDoor(player); - if (infoForOpeningDoor.intendedOpeningDirection == 0 && (double) player.velocity.X == 0.0) - return; - Point tileCoords = new Point(); - for (int left = infoForOpeningDoor.tileCoordSpaceForCheckingForDoors.Left; left <= infoForOpeningDoor.tileCoordSpaceForCheckingForDoors.Right; ++left) - { - for (int top = infoForOpeningDoor.tileCoordSpaceForCheckingForDoors.Top; top <= infoForOpeningDoor.tileCoordSpaceForCheckingForDoors.Bottom; ++top) - { - tileCoords.X = left; - tileCoords.Y = top; - this.TryAutoOpeningDoor(tileCoords, infoForOpeningDoor); - } - } - } - - private DoorOpeningHelper.PlayerInfoForOpeningDoors GetPlayerInfoForOpeningDoor( - Player player) - { - int num1 = player.controlRight.ToInt() - player.controlLeft.ToInt(); - int gravDir = (int) player.gravDir; - Rectangle hitbox1 = player.Hitbox; - hitbox1.Y -= -1; - hitbox1.Height += -2; - float num2 = player.velocity.X; - if (num1 == 0 && this._timeWeCanOpenDoorsUsingVelocityAlone == 0) - num2 = 0.0f; - float num3 = (float) num1 + num2; - int num4 = Math.Sign(num3) * (int) Math.Ceiling((double) Math.Abs(num3)); - hitbox1.X += num4; - if (num1 == 0) - num1 = Math.Sign(num3); - Rectangle hitbox2; - Rectangle rectangle1 = hitbox2 = player.Hitbox; - rectangle1.X += num4; - Rectangle rectangle2 = rectangle1; - Rectangle r = Rectangle.Union(hitbox2, rectangle2); - Point tileCoordinates1 = r.TopLeft().ToTileCoordinates(); - Point tileCoordinates2 = r.BottomRight().ToTileCoordinates(); - Rectangle rectangle3 = new Rectangle(tileCoordinates1.X, tileCoordinates1.Y, tileCoordinates2.X - tileCoordinates1.X, tileCoordinates2.Y - tileCoordinates1.Y); - return new DoorOpeningHelper.PlayerInfoForOpeningDoors() - { - hitboxToOpenDoor = hitbox1, - intendedOpeningDirection = num1, - playerGravityDirection = gravDir, - tileCoordSpaceForCheckingForDoors = rectangle3 - }; - } - - private void TryAutoOpeningDoor( - Point tileCoords, - DoorOpeningHelper.PlayerInfoForOpeningDoors playerInfo) - { - DoorOpeningHelper.DoorAutoHandler infoProvider; - if (!this.TryGetHandler(tileCoords, out infoProvider)) - return; - DoorOpeningHelper.DoorOpenCloseTogglingInfo info = infoProvider.ProvideInfo(tileCoords); - if (!infoProvider.TryOpenDoor(info, playerInfo)) - return; - this._ongoingOpenDoors.Add(info); - } - - private bool TryGetHandler(Point tileCoords, out DoorOpeningHelper.DoorAutoHandler infoProvider) - { - infoProvider = (DoorOpeningHelper.DoorAutoHandler) null; - if (!WorldGen.InWorld(tileCoords.X, tileCoords.Y, 3)) - return false; - Tile tile = Main.tile[tileCoords.X, tileCoords.Y]; - return tile != null && this._handlerByTileType.TryGetValue((int) tile.type, out infoProvider); - } - - public enum DoorAutoOpeningPreference - { - Disabled, - EnabledForGamepadOnly, - EnabledForEverything, - } - - private enum DoorCloseAttemptResult - { - StillInDoorArea, - ClosedDoor, - FailedToCloseDoor, - DoorIsInvalidated, - } - - private struct DoorOpenCloseTogglingInfo - { - public Point tileCoordsForToggling; - public DoorOpeningHelper.DoorAutoHandler handler; - } - - private struct PlayerInfoForOpeningDoors - { - public Rectangle hitboxToOpenDoor; - public int intendedOpeningDirection; - public int playerGravityDirection; - public Rectangle tileCoordSpaceForCheckingForDoors; - } - - private struct PlayerInfoForClosingDoors - { - public Rectangle hitboxToNotCloseDoor; - } - - private interface DoorAutoHandler - { - DoorOpeningHelper.DoorOpenCloseTogglingInfo ProvideInfo(Point tileCoords); - - bool TryOpenDoor( - DoorOpeningHelper.DoorOpenCloseTogglingInfo info, - DoorOpeningHelper.PlayerInfoForOpeningDoors playerInfo); - - DoorOpeningHelper.DoorCloseAttemptResult TryCloseDoor( - DoorOpeningHelper.DoorOpenCloseTogglingInfo info, - DoorOpeningHelper.PlayerInfoForClosingDoors playerInfo); - } - - private class CommonDoorOpeningInfoProvider : DoorOpeningHelper.DoorAutoHandler - { - public DoorOpeningHelper.DoorOpenCloseTogglingInfo ProvideInfo( - Point tileCoords) - { - Tile tile = Main.tile[tileCoords.X, tileCoords.Y]; - Point point = tileCoords; - point.Y -= (int) tile.frameY % 54 / 18; - return new DoorOpeningHelper.DoorOpenCloseTogglingInfo() - { - handler = (DoorOpeningHelper.DoorAutoHandler) this, - tileCoordsForToggling = point - }; - } - - public bool TryOpenDoor( - DoorOpeningHelper.DoorOpenCloseTogglingInfo doorInfo, - DoorOpeningHelper.PlayerInfoForOpeningDoors playerInfo) - { - Point coordsForToggling = doorInfo.tileCoordsForToggling; - int openingDirection = playerInfo.intendedOpeningDirection; - Rectangle rectangle = new Rectangle(doorInfo.tileCoordsForToggling.X * 16, doorInfo.tileCoordsForToggling.Y * 16, 16, 48); - switch (playerInfo.playerGravityDirection) - { - case -1: - rectangle.Y -= 16; - rectangle.Height += 16; - break; - case 1: - rectangle.Height += 16; - break; - } - if (!rectangle.Intersects(playerInfo.hitboxToOpenDoor) || playerInfo.hitboxToOpenDoor.Top < rectangle.Top || playerInfo.hitboxToOpenDoor.Bottom > rectangle.Bottom) - return false; - WorldGen.OpenDoor(coordsForToggling.X, coordsForToggling.Y, openingDirection); - if (Main.tile[coordsForToggling.X, coordsForToggling.Y].type != (ushort) 10) - { - NetMessage.SendData(19, number2: ((float) coordsForToggling.X), number3: ((float) coordsForToggling.Y), number4: ((float) openingDirection)); - return true; - } - WorldGen.OpenDoor(coordsForToggling.X, coordsForToggling.Y, -openingDirection); - if (Main.tile[coordsForToggling.X, coordsForToggling.Y].type == (ushort) 10) - return false; - NetMessage.SendData(19, number2: ((float) coordsForToggling.X), number3: ((float) coordsForToggling.Y), number4: ((float) -openingDirection)); - return true; - } - - public DoorOpeningHelper.DoorCloseAttemptResult TryCloseDoor( - DoorOpeningHelper.DoorOpenCloseTogglingInfo info, - DoorOpeningHelper.PlayerInfoForClosingDoors playerInfo) - { - Point coordsForToggling = info.tileCoordsForToggling; - Tile tile = Main.tile[coordsForToggling.X, coordsForToggling.Y]; - if (!tile.active() || tile.type != (ushort) 11) - return DoorOpeningHelper.DoorCloseAttemptResult.DoorIsInvalidated; - int num = (int) tile.frameX % 72 / 18; - Rectangle rectangle1 = new Rectangle(coordsForToggling.X * 16, coordsForToggling.Y * 16, 16, 48); - switch (num) - { - case 1: - rectangle1.X -= 16; - break; - case 2: - rectangle1.X += 16; - break; - } - rectangle1.Inflate(1, 0); - Rectangle rectangle2 = Rectangle.Intersect(rectangle1, playerInfo.hitboxToNotCloseDoor); - if (rectangle2.Width > 0 || rectangle2.Height > 0) - return DoorOpeningHelper.DoorCloseAttemptResult.StillInDoorArea; - if (!WorldGen.CloseDoor(coordsForToggling.X, coordsForToggling.Y)) - return DoorOpeningHelper.DoorCloseAttemptResult.FailedToCloseDoor; - NetMessage.SendData(13, number: Main.myPlayer); - NetMessage.SendData(19, number: 1, number2: ((float) coordsForToggling.X), number3: ((float) coordsForToggling.Y), number4: 1f); - return DoorOpeningHelper.DoorCloseAttemptResult.ClosedDoor; - } - } - - private class TallGateOpeningInfoProvider : DoorOpeningHelper.DoorAutoHandler - { - public DoorOpeningHelper.DoorOpenCloseTogglingInfo ProvideInfo( - Point tileCoords) - { - Tile tile = Main.tile[tileCoords.X, tileCoords.Y]; - Point point = tileCoords; - point.Y -= (int) tile.frameY % 90 / 18; - return new DoorOpeningHelper.DoorOpenCloseTogglingInfo() - { - handler = (DoorOpeningHelper.DoorAutoHandler) this, - tileCoordsForToggling = point - }; - } - - public bool TryOpenDoor( - DoorOpeningHelper.DoorOpenCloseTogglingInfo doorInfo, - DoorOpeningHelper.PlayerInfoForOpeningDoors playerInfo) - { - Point coordsForToggling = doorInfo.tileCoordsForToggling; - Rectangle rectangle = new Rectangle(doorInfo.tileCoordsForToggling.X * 16, doorInfo.tileCoordsForToggling.Y * 16, 16, 80); - switch (playerInfo.playerGravityDirection) - { - case -1: - rectangle.Y -= 16; - rectangle.Height += 16; - break; - case 1: - rectangle.Height += 16; - break; - } - if (!rectangle.Intersects(playerInfo.hitboxToOpenDoor) || playerInfo.hitboxToOpenDoor.Top < rectangle.Top || playerInfo.hitboxToOpenDoor.Bottom > rectangle.Bottom) - return false; - bool closing = false; - if (!WorldGen.ShiftTallGate(coordsForToggling.X, coordsForToggling.Y, closing)) - return false; - NetMessage.SendData(19, number: (4 + closing.ToInt()), number2: ((float) coordsForToggling.X), number3: ((float) coordsForToggling.Y)); - return true; - } - - public DoorOpeningHelper.DoorCloseAttemptResult TryCloseDoor( - DoorOpeningHelper.DoorOpenCloseTogglingInfo info, - DoorOpeningHelper.PlayerInfoForClosingDoors playerInfo) - { - Point coordsForToggling = info.tileCoordsForToggling; - Tile tile = Main.tile[coordsForToggling.X, coordsForToggling.Y]; - if (!tile.active() || tile.type != (ushort) 389) - return DoorOpeningHelper.DoorCloseAttemptResult.DoorIsInvalidated; - int num = (int) tile.frameY % 90 / 18; - Rectangle rectangle1 = new Rectangle(coordsForToggling.X * 16, coordsForToggling.Y * 16, 16, 80); - rectangle1.Inflate(1, 0); - Rectangle rectangle2 = Rectangle.Intersect(rectangle1, playerInfo.hitboxToNotCloseDoor); - if (rectangle2.Width > 0 || rectangle2.Height > 0) - return DoorOpeningHelper.DoorCloseAttemptResult.StillInDoorArea; - bool closing = true; - if (!WorldGen.ShiftTallGate(coordsForToggling.X, coordsForToggling.Y, closing)) - return DoorOpeningHelper.DoorCloseAttemptResult.FailedToCloseDoor; - NetMessage.SendData(13, number: Main.myPlayer); - NetMessage.SendData(19, number: (4 + closing.ToInt()), number2: ((float) coordsForToggling.X), number3: ((float) coordsForToggling.Y)); - return DoorOpeningHelper.DoorCloseAttemptResult.ClosedDoor; - } - } - } -} diff --git a/GameContent/Drawing/ParticleOrchestraSettings.cs b/GameContent/Drawing/ParticleOrchestraSettings.cs deleted file mode 100644 index 6fd6f68..0000000 --- a/GameContent/Drawing/ParticleOrchestraSettings.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Drawing.ParticleOrchestraSettings -// 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; -using System.IO; - -namespace Terraria.GameContent.Drawing -{ - public struct ParticleOrchestraSettings - { - public Vector2 PositionInWorld; - public Vector2 MovementVector; - public int PackedShaderIndex; - public byte IndexOfPlayerWhoInvokedThis; - public const int SerializationSize = 21; - - public void Serialize(BinaryWriter writer) - { - writer.WriteVector2(this.PositionInWorld); - writer.WriteVector2(this.MovementVector); - writer.Write(this.PackedShaderIndex); - writer.Write(this.IndexOfPlayerWhoInvokedThis); - } - - public void DeserializeFrom(BinaryReader reader) - { - this.PositionInWorld = reader.ReadVector2(); - this.MovementVector = reader.ReadVector2(); - this.PackedShaderIndex = reader.ReadInt32(); - this.IndexOfPlayerWhoInvokedThis = reader.ReadByte(); - } - } -} diff --git a/GameContent/Drawing/ParticleOrchestraType.cs b/GameContent/Drawing/ParticleOrchestraType.cs deleted file mode 100644 index 128414a..0000000 --- a/GameContent/Drawing/ParticleOrchestraType.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Drawing.ParticleOrchestraType -// 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.Drawing -{ - public enum ParticleOrchestraType : byte - { - Keybrand, - FlameWaders, - StellarTune, - WallOfFleshGoatMountFlames, - BlackLightningHit, - RainbowRodHit, - BlackLightningSmall, - StardustPunch, - } -} diff --git a/GameContent/Drawing/ParticleOrchestrator.cs b/GameContent/Drawing/ParticleOrchestrator.cs deleted file mode 100644 index 09f195d..0000000 --- a/GameContent/Drawing/ParticleOrchestrator.cs +++ /dev/null @@ -1,420 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Drawing.ParticleOrchestrator -// 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; -using Terraria.GameContent.NetModules; -using Terraria.Graphics.Renderers; -using Terraria.Graphics.Shaders; -using Terraria.Net; - -namespace Terraria.GameContent.Drawing -{ - public class ParticleOrchestrator - { - private static ParticlePool _poolFading = new ParticlePool(200, new ParticlePool.ParticleInstantiator(ParticleOrchestrator.GetNewFadingParticle)); - private static ParticlePool _poolFlame = new ParticlePool(200, new ParticlePool.ParticleInstantiator(ParticleOrchestrator.GetNewFlameParticle)); - private static ParticlePool _poolRandomizedFrame = new ParticlePool(200, new ParticlePool.ParticleInstantiator(ParticleOrchestrator.GetNewRandomizedFrameParticle)); - private static ParticlePool _poolPrettySparkle = new ParticlePool(200, new ParticlePool.ParticleInstantiator(ParticleOrchestrator.GetNewPrettySparkleParticle)); - - public static void RequestParticleSpawn( - bool clientOnly, - ParticleOrchestraType type, - ParticleOrchestraSettings settings, - int? overrideInvokingPlayerIndex = null) - { - settings.IndexOfPlayerWhoInvokedThis = (byte) Main.myPlayer; - if (overrideInvokingPlayerIndex.HasValue) - settings.IndexOfPlayerWhoInvokedThis = (byte) overrideInvokingPlayerIndex.Value; - if (clientOnly) - ParticleOrchestrator.SpawnParticlesDirect(type, settings); - else - NetManager.Instance.SendToServerOrLoopback(NetParticlesModule.Serialize(type, settings)); - } - - private static FadingParticle GetNewFadingParticle() => new FadingParticle(); - - private static FlameParticle GetNewFlameParticle() => new FlameParticle(); - - private static RandomizedFrameParticle GetNewRandomizedFrameParticle() => new RandomizedFrameParticle(); - - private static PrettySparkleParticle GetNewPrettySparkleParticle() => new PrettySparkleParticle(); - - public static void SpawnParticlesDirect( - ParticleOrchestraType type, - ParticleOrchestraSettings settings) - { - if (Main.netMode == 2) - return; - switch (type) - { - case ParticleOrchestraType.Keybrand: - ParticleOrchestrator.Spawn_Keybrand(settings); - break; - case ParticleOrchestraType.FlameWaders: - ParticleOrchestrator.Spawn_FlameWaders(settings); - break; - case ParticleOrchestraType.StellarTune: - ParticleOrchestrator.Spawn_StellarTune(settings); - break; - case ParticleOrchestraType.WallOfFleshGoatMountFlames: - ParticleOrchestrator.Spawn_WallOfFleshGoatMountFlames(settings); - break; - case ParticleOrchestraType.BlackLightningHit: - ParticleOrchestrator.Spawn_BlackLightningHit(settings); - break; - case ParticleOrchestraType.RainbowRodHit: - ParticleOrchestrator.Spawn_RainbowRodHit(settings); - break; - case ParticleOrchestraType.BlackLightningSmall: - ParticleOrchestrator.Spawn_BlackLightningSmall(settings); - break; - case ParticleOrchestraType.StardustPunch: - ParticleOrchestrator.Spawn_StardustPunch(settings); - break; - } - } - - private static void Spawn_StardustPunch(ParticleOrchestraSettings settings) - { - float num1 = Main.rand.NextFloat() * 6.283185f; - float num2 = 1f; - for (float num3 = 0.0f; (double) num3 < 1.0; num3 += 1f / num2) - { - Vector2 vector2_1 = settings.MovementVector * (float) (0.300000011920929 + (double) Main.rand.NextFloat() * 0.349999994039536); - Vector2 vector2_2 = new Vector2((float) ((double) Main.rand.NextFloat() * 0.400000005960464 + 0.400000005960464)); - float f = num1 + Main.rand.NextFloat() * 6.283185f; - float num4 = 1.570796f; - Vector2 vector2_3 = 0.1f * vector2_2; - float num5 = 60f; - Vector2 vector2_4 = Main.rand.NextVector2Circular(8f, 8f) * vector2_2; - PrettySparkleParticle prettySparkleParticle1 = ParticleOrchestrator._poolPrettySparkle.RequestParticle(); - prettySparkleParticle1.Velocity = f.ToRotationVector2() * vector2_3 + vector2_1; - prettySparkleParticle1.AccelerationPerFrame = f.ToRotationVector2() * -(vector2_3 / num5) - vector2_1 * 1f / 60f; - prettySparkleParticle1.ColorTint = Main.hslToRgb((float) ((0.600000023841858 + (double) Main.rand.NextFloat() * 0.0500000007450581) % 1.0), 1f, (float) (0.400000005960464 + (double) Main.rand.NextFloat() * 0.25)); - prettySparkleParticle1.ColorTint.A = (byte) 0; - prettySparkleParticle1.LocalPosition = settings.PositionInWorld + vector2_4; - prettySparkleParticle1.Rotation = num4; - prettySparkleParticle1.Scale = vector2_2; - Main.ParticleSystem_World_OverPlayers.Add((IParticle) prettySparkleParticle1); - PrettySparkleParticle prettySparkleParticle2 = ParticleOrchestrator._poolPrettySparkle.RequestParticle(); - prettySparkleParticle2.Velocity = f.ToRotationVector2() * vector2_3 + vector2_1; - prettySparkleParticle2.AccelerationPerFrame = f.ToRotationVector2() * -(vector2_3 / num5) - vector2_1 * 1f / 30f; - prettySparkleParticle2.ColorTint = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); - prettySparkleParticle2.LocalPosition = settings.PositionInWorld + vector2_4; - prettySparkleParticle2.Rotation = num4; - prettySparkleParticle2.Scale = vector2_2 * 0.6f; - Main.ParticleSystem_World_OverPlayers.Add((IParticle) prettySparkleParticle2); - } - for (int index = 0; index < 2; ++index) - { - Color rgb = Main.hslToRgb((float) ((0.589999973773956 + (double) Main.rand.NextFloat() * 0.0500000007450581) % 1.0), 1f, (float) (0.400000005960464 + (double) Main.rand.NextFloat() * 0.25)); - int dustIndex = Dust.NewDust(settings.PositionInWorld, 0, 0, 267, newColor: rgb); - Main.dust[dustIndex].velocity = Main.rand.NextVector2Circular(2f, 2f); - Main.dust[dustIndex].velocity += settings.MovementVector * (float) (0.5 + 0.5 * (double) Main.rand.NextFloat()) * 1.4f; - Main.dust[dustIndex].noGravity = true; - Main.dust[dustIndex].scale = (float) (0.600000023841858 + (double) Main.rand.NextFloat() * 2.0); - Main.dust[dustIndex].position += Main.rand.NextVector2Circular(16f, 16f); - if (dustIndex != 6000) - { - Dust dust = Dust.CloneDust(dustIndex); - dust.scale /= 2f; - dust.fadeIn *= 0.75f; - dust.color = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); - } - } - } - - private static void Spawn_RainbowRodHit(ParticleOrchestraSettings settings) - { - float num1 = Main.rand.NextFloat() * 6.283185f; - float num2 = 6f; - float num3 = Main.rand.NextFloat(); - for (float num4 = 0.0f; (double) num4 < 1.0; num4 += 1f / num2) - { - Vector2 vector2_1 = settings.MovementVector * Main.rand.NextFloatDirection() * 0.15f; - Vector2 vector2_2 = new Vector2((float) ((double) Main.rand.NextFloat() * 0.400000005960464 + 0.400000005960464)); - float f = num1 + Main.rand.NextFloat() * 6.283185f; - float num5 = 1.570796f; - Vector2 vector2_3 = 1.5f * vector2_2; - float num6 = 60f; - Vector2 vector2_4 = Main.rand.NextVector2Circular(8f, 8f) * vector2_2; - PrettySparkleParticle prettySparkleParticle1 = ParticleOrchestrator._poolPrettySparkle.RequestParticle(); - prettySparkleParticle1.Velocity = f.ToRotationVector2() * vector2_3 + vector2_1; - prettySparkleParticle1.AccelerationPerFrame = f.ToRotationVector2() * -(vector2_3 / num6) - vector2_1 * 1f / 60f; - prettySparkleParticle1.ColorTint = Main.hslToRgb((float) (((double) num3 + (double) Main.rand.NextFloat() * 0.330000013113022) % 1.0), 1f, (float) (0.400000005960464 + (double) Main.rand.NextFloat() * 0.25)); - prettySparkleParticle1.ColorTint.A = (byte) 0; - prettySparkleParticle1.LocalPosition = settings.PositionInWorld + vector2_4; - prettySparkleParticle1.Rotation = num5; - prettySparkleParticle1.Scale = vector2_2; - Main.ParticleSystem_World_OverPlayers.Add((IParticle) prettySparkleParticle1); - PrettySparkleParticle prettySparkleParticle2 = ParticleOrchestrator._poolPrettySparkle.RequestParticle(); - prettySparkleParticle2.Velocity = f.ToRotationVector2() * vector2_3 + vector2_1; - prettySparkleParticle2.AccelerationPerFrame = f.ToRotationVector2() * -(vector2_3 / num6) - vector2_1 * 1f / 60f; - prettySparkleParticle2.ColorTint = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); - prettySparkleParticle2.LocalPosition = settings.PositionInWorld + vector2_4; - prettySparkleParticle2.Rotation = num5; - prettySparkleParticle2.Scale = vector2_2 * 0.6f; - Main.ParticleSystem_World_OverPlayers.Add((IParticle) prettySparkleParticle2); - } - for (int index = 0; index < 12; ++index) - { - Color rgb = Main.hslToRgb((float) (((double) num3 + (double) Main.rand.NextFloat() * 0.119999997317791) % 1.0), 1f, (float) (0.400000005960464 + (double) Main.rand.NextFloat() * 0.25)); - int dustIndex = Dust.NewDust(settings.PositionInWorld, 0, 0, 267, newColor: rgb); - Main.dust[dustIndex].velocity = Main.rand.NextVector2Circular(1f, 1f); - Main.dust[dustIndex].velocity += settings.MovementVector * Main.rand.NextFloatDirection() * 0.5f; - Main.dust[dustIndex].noGravity = true; - Main.dust[dustIndex].scale = (float) (0.600000023841858 + (double) Main.rand.NextFloat() * 0.899999976158142); - Main.dust[dustIndex].fadeIn = (float) (0.699999988079071 + (double) Main.rand.NextFloat() * 0.800000011920929); - if (dustIndex != 6000) - { - Dust dust = Dust.CloneDust(dustIndex); - dust.scale /= 2f; - dust.fadeIn *= 0.75f; - dust.color = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); - } - } - } - - private static void Spawn_BlackLightningSmall(ParticleOrchestraSettings settings) - { - float num1 = Main.rand.NextFloat() * 6.283185f; - float num2 = (float) Main.rand.Next(1, 3); - float num3 = 0.7f; - int i = 916; - Main.instance.LoadProjectile(i); - Color color1 = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); - Color indigo = Color.Indigo; - indigo.A = (byte) 0; - for (float num4 = 0.0f; (double) num4 < 1.0; num4 += 1f / num2) - { - float f = (float) (6.28318548202515 * (double) num4 + (double) num1 + (double) Main.rand.NextFloatDirection() * 0.25); - float num5 = (float) ((double) Main.rand.NextFloat() * 4.0 + 0.100000001490116); - Vector2 initialLocalPosition = Main.rand.NextVector2Circular(12f, 12f) * num3; - Color.Lerp(Color.Lerp(Color.Black, indigo, Main.rand.NextFloat() * 0.5f), color1, Main.rand.NextFloat() * 0.6f); - Color color2 = new Color(0, 0, 0, (int) byte.MaxValue); - int num6 = Main.rand.Next(4); - if (num6 == 1) - color2 = Color.Lerp(new Color(106, 90, 205, (int) sbyte.MaxValue), Color.Black, (float) (0.100000001490116 + 0.699999988079071 * (double) Main.rand.NextFloat())); - if (num6 == 2) - color2 = Color.Lerp(new Color(106, 90, 205, 60), Color.Black, (float) (0.100000001490116 + 0.800000011920929 * (double) Main.rand.NextFloat())); - RandomizedFrameParticle randomizedFrameParticle = ParticleOrchestrator._poolRandomizedFrame.RequestParticle(); - randomizedFrameParticle.SetBasicInfo(TextureAssets.Projectile[i], new Rectangle?(), Vector2.Zero, initialLocalPosition); - randomizedFrameParticle.SetTypeInfo(Main.projFrames[i], 2, 24f); - randomizedFrameParticle.Velocity = f.ToRotationVector2() * num5 * new Vector2(1f, 0.5f) * 0.2f + settings.MovementVector; - randomizedFrameParticle.ColorTint = color2; - randomizedFrameParticle.LocalPosition = settings.PositionInWorld + initialLocalPosition; - randomizedFrameParticle.Rotation = randomizedFrameParticle.Velocity.ToRotation(); - randomizedFrameParticle.Scale = Vector2.One * 0.5f; - randomizedFrameParticle.FadeInNormalizedTime = 0.01f; - randomizedFrameParticle.FadeOutNormalizedTime = 0.5f; - randomizedFrameParticle.ScaleVelocity = new Vector2(0.025f); - Main.ParticleSystem_World_OverPlayers.Add((IParticle) randomizedFrameParticle); - } - } - - private static void Spawn_BlackLightningHit(ParticleOrchestraSettings settings) - { - float num1 = Main.rand.NextFloat() * 6.283185f; - float num2 = 7f; - float num3 = 0.7f; - int i = 916; - Main.instance.LoadProjectile(i); - Color color1 = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); - Color indigo = Color.Indigo; - indigo.A = (byte) 0; - for (float num4 = 0.0f; (double) num4 < 1.0; num4 += 1f / num2) - { - float f = (float) (6.28318548202515 * (double) num4 + (double) num1 + (double) Main.rand.NextFloatDirection() * 0.25); - float num5 = (float) ((double) Main.rand.NextFloat() * 4.0 + 0.100000001490116); - Vector2 initialLocalPosition = Main.rand.NextVector2Circular(12f, 12f) * num3; - Color.Lerp(Color.Lerp(Color.Black, indigo, Main.rand.NextFloat() * 0.5f), color1, Main.rand.NextFloat() * 0.6f); - Color color2 = new Color(0, 0, 0, (int) byte.MaxValue); - int num6 = Main.rand.Next(4); - if (num6 == 1) - color2 = Color.Lerp(new Color(106, 90, 205, (int) sbyte.MaxValue), Color.Black, (float) (0.100000001490116 + 0.699999988079071 * (double) Main.rand.NextFloat())); - if (num6 == 2) - color2 = Color.Lerp(new Color(106, 90, 205, 60), Color.Black, (float) (0.100000001490116 + 0.800000011920929 * (double) Main.rand.NextFloat())); - RandomizedFrameParticle randomizedFrameParticle = ParticleOrchestrator._poolRandomizedFrame.RequestParticle(); - randomizedFrameParticle.SetBasicInfo(TextureAssets.Projectile[i], new Rectangle?(), Vector2.Zero, initialLocalPosition); - randomizedFrameParticle.SetTypeInfo(Main.projFrames[i], 2, 24f); - randomizedFrameParticle.Velocity = f.ToRotationVector2() * num5 * new Vector2(1f, 0.5f); - randomizedFrameParticle.ColorTint = color2; - randomizedFrameParticle.LocalPosition = settings.PositionInWorld + initialLocalPosition; - randomizedFrameParticle.Rotation = f; - randomizedFrameParticle.Scale = Vector2.One; - randomizedFrameParticle.FadeInNormalizedTime = 0.01f; - randomizedFrameParticle.FadeOutNormalizedTime = 0.5f; - randomizedFrameParticle.ScaleVelocity = new Vector2(0.05f); - Main.ParticleSystem_World_OverPlayers.Add((IParticle) randomizedFrameParticle); - } - } - - private static void Spawn_StellarTune(ParticleOrchestraSettings settings) - { - float num1 = Main.rand.NextFloat() * 6.283185f; - float num2 = 5f; - Vector2 vector2_1 = new Vector2(0.7f); - for (float num3 = 0.0f; (double) num3 < 1.0; num3 += 1f / num2) - { - float f = (float) (6.28318548202515 * (double) num3 + (double) num1 + (double) Main.rand.NextFloatDirection() * 0.25); - Vector2 vector2_2 = 1.5f * vector2_1; - float num4 = 60f; - Vector2 vector2_3 = Main.rand.NextVector2Circular(12f, 12f) * vector2_1; - Color color = Color.Lerp(Color.Gold, Color.HotPink, Main.rand.NextFloat()); - if (Main.rand.Next(2) == 0) - color = Color.Lerp(Color.Violet, Color.HotPink, Main.rand.NextFloat()); - PrettySparkleParticle prettySparkleParticle = ParticleOrchestrator._poolPrettySparkle.RequestParticle(); - prettySparkleParticle.Velocity = f.ToRotationVector2() * vector2_2; - prettySparkleParticle.AccelerationPerFrame = f.ToRotationVector2() * -(vector2_2 / num4); - prettySparkleParticle.ColorTint = color; - prettySparkleParticle.LocalPosition = settings.PositionInWorld + vector2_3; - prettySparkleParticle.Rotation = f; - prettySparkleParticle.Scale = vector2_1 * (float) ((double) Main.rand.NextFloat() * 0.800000011920929 + 0.200000002980232); - Main.ParticleSystem_World_OverPlayers.Add((IParticle) prettySparkleParticle); - } - } - - private static void Spawn_Keybrand(ParticleOrchestraSettings settings) - { - float num1 = Main.rand.NextFloat() * 6.283185f; - float num2 = 3f; - Vector2 vector2_1 = new Vector2(0.7f); - for (float num3 = 0.0f; (double) num3 < 1.0; num3 += 1f / num2) - { - float f = (float) (6.28318548202515 * (double) num3 + (double) num1 + (double) Main.rand.NextFloatDirection() * 0.100000001490116); - Vector2 vector2_2 = 1.5f * vector2_1; - float num4 = 60f; - Vector2 vector2_3 = Main.rand.NextVector2Circular(4f, 4f) * vector2_1; - PrettySparkleParticle prettySparkleParticle = ParticleOrchestrator._poolPrettySparkle.RequestParticle(); - prettySparkleParticle.Velocity = f.ToRotationVector2() * vector2_2; - prettySparkleParticle.AccelerationPerFrame = f.ToRotationVector2() * -(vector2_2 / num4); - prettySparkleParticle.ColorTint = Color.Lerp(Color.Gold, Color.OrangeRed, Main.rand.NextFloat()); - prettySparkleParticle.LocalPosition = settings.PositionInWorld + vector2_3; - prettySparkleParticle.Rotation = f; - prettySparkleParticle.Scale = vector2_1 * 0.8f; - Main.ParticleSystem_World_OverPlayers.Add((IParticle) prettySparkleParticle); - } - float num5 = num1 + (float) (1.0 / (double) num2 / 2.0 * 6.28318548202515); - float num6 = Main.rand.NextFloat() * 6.283185f; - for (float num7 = 0.0f; (double) num7 < 1.0; num7 += 1f / num2) - { - float f = (float) (6.28318548202515 * (double) num7 + (double) num6 + (double) Main.rand.NextFloatDirection() * 0.100000001490116); - Vector2 vector2_4 = 1f * vector2_1; - float timeToLive = 30f; - Color color = Color.Lerp(Color.White, Color.Lerp(Color.Gold, Color.OrangeRed, Main.rand.NextFloat()), 0.5f); - color.A = (byte) 0; - Vector2 vector2_5 = Main.rand.NextVector2Circular(4f, 4f) * vector2_1; - FadingParticle fadingParticle = ParticleOrchestrator._poolFading.RequestParticle(); - fadingParticle.SetBasicInfo(TextureAssets.Extra[98], new Rectangle?(), Vector2.Zero, Vector2.Zero); - fadingParticle.SetTypeInfo(timeToLive); - fadingParticle.Velocity = f.ToRotationVector2() * vector2_4; - fadingParticle.AccelerationPerFrame = f.ToRotationVector2() * -(vector2_4 / timeToLive); - fadingParticle.ColorTint = color; - fadingParticle.LocalPosition = settings.PositionInWorld + f.ToRotationVector2() * vector2_4 * vector2_1 * timeToLive * 0.2f + vector2_5; - fadingParticle.Rotation = f + 1.570796f; - fadingParticle.FadeInNormalizedTime = 0.3f; - fadingParticle.FadeOutNormalizedTime = 0.4f; - fadingParticle.Scale = new Vector2(0.5f, 1.2f) * 0.8f * vector2_1; - Main.ParticleSystem_World_OverPlayers.Add((IParticle) fadingParticle); - } - float num8 = 1f; - float num9 = Main.rand.NextFloat() * 6.283185f; - for (float num10 = 0.0f; (double) num10 < 1.0; num10 += 1f / num8) - { - float num11 = 6.283185f * num10 + num9; - float timeToLive = 30f; - Color color = Color.Lerp(Color.CornflowerBlue, Color.White, Main.rand.NextFloat()); - color.A = (byte) 127; - Vector2 vector2_6 = Main.rand.NextVector2Circular(4f, 4f) * vector2_1; - Vector2 vector2_7 = Main.rand.NextVector2Square(0.7f, 1.3f); - FadingParticle fadingParticle = ParticleOrchestrator._poolFading.RequestParticle(); - fadingParticle.SetBasicInfo(TextureAssets.Extra[174], new Rectangle?(), Vector2.Zero, Vector2.Zero); - fadingParticle.SetTypeInfo(timeToLive); - fadingParticle.ColorTint = color; - fadingParticle.LocalPosition = settings.PositionInWorld + vector2_6; - fadingParticle.Rotation = num11 + 1.570796f; - fadingParticle.FadeInNormalizedTime = 0.1f; - fadingParticle.FadeOutNormalizedTime = 0.4f; - fadingParticle.Scale = new Vector2(0.1f, 0.1f) * vector2_1; - fadingParticle.ScaleVelocity = vector2_7 * 1f / 60f; - fadingParticle.ScaleAcceleration = vector2_7 * -0.01666667f / 60f; - Main.ParticleSystem_World_OverPlayers.Add((IParticle) fadingParticle); - } - } - - private static void Spawn_FlameWaders(ParticleOrchestraSettings settings) - { - float timeToLive = 60f; - for (int index = -1; index <= 1; ++index) - { - int i = (int) Main.rand.NextFromList((short) 326, (short) 327, (short) 328); - Main.instance.LoadProjectile(i); - Player player = Main.player[(int) settings.IndexOfPlayerWhoInvokedThis]; - float num = (float) ((double) Main.rand.NextFloat() * 0.899999976158142 + 0.100000001490116); - Vector2 vector2 = settings.PositionInWorld + new Vector2((float) index * 5.333333f, 0.0f); - FlameParticle flameParticle = ParticleOrchestrator._poolFlame.RequestParticle(); - flameParticle.SetBasicInfo(TextureAssets.Projectile[i], new Rectangle?(), Vector2.Zero, vector2); - flameParticle.SetTypeInfo(timeToLive, (int) settings.IndexOfPlayerWhoInvokedThis, player.cShoe); - flameParticle.FadeOutNormalizedTime = 0.4f; - flameParticle.ScaleAcceleration = Vector2.One * num * -0.01666667f / timeToLive; - flameParticle.Scale = Vector2.One * num; - Main.ParticleSystem_World_BehindPlayers.Add((IParticle) flameParticle); - if (Main.rand.Next(16) == 0) - { - Dust dust = Dust.NewDustDirect(vector2, 4, 4, 6, Alpha: 100); - if (Main.rand.Next(2) == 0) - { - dust.noGravity = true; - dust.fadeIn = 1.15f; - } - else - dust.scale = 0.6f; - dust.velocity *= 0.6f; - dust.velocity.Y -= 1.2f; - dust.noLight = true; - dust.position.Y -= 4f; - dust.shader = GameShaders.Armor.GetSecondaryShader(player.cShoe, player); - } - } - } - - private static void Spawn_WallOfFleshGoatMountFlames(ParticleOrchestraSettings settings) - { - float timeToLive = 50f; - for (int index = -1; index <= 1; ++index) - { - int i = (int) Main.rand.NextFromList((short) 326, (short) 327, (short) 328); - Main.instance.LoadProjectile(i); - Player player = Main.player[(int) settings.IndexOfPlayerWhoInvokedThis]; - float num = (float) ((double) Main.rand.NextFloat() * 0.899999976158142 + 0.100000001490116); - Vector2 vector2 = settings.PositionInWorld + new Vector2((float) index * 5.333333f, 0.0f); - FlameParticle flameParticle = ParticleOrchestrator._poolFlame.RequestParticle(); - flameParticle.SetBasicInfo(TextureAssets.Projectile[i], new Rectangle?(), Vector2.Zero, vector2); - flameParticle.SetTypeInfo(timeToLive, (int) settings.IndexOfPlayerWhoInvokedThis, player.cMount); - flameParticle.FadeOutNormalizedTime = 0.3f; - flameParticle.ScaleAcceleration = Vector2.One * num * -0.01666667f / timeToLive; - flameParticle.Scale = Vector2.One * num; - Main.ParticleSystem_World_BehindPlayers.Add((IParticle) flameParticle); - if (Main.rand.Next(8) == 0) - { - Dust dust = Dust.NewDustDirect(vector2, 4, 4, 6, Alpha: 100); - if (Main.rand.Next(2) == 0) - { - dust.noGravity = true; - dust.fadeIn = 1.15f; - } - else - dust.scale = 0.6f; - dust.velocity *= 0.6f; - dust.velocity.Y -= 1.2f; - dust.noLight = true; - dust.position.Y -= 4f; - dust.shader = GameShaders.Armor.GetSecondaryShader(player.cMount, player); - } - } - } - } -} diff --git a/GameContent/Drawing/TileDrawing.cs b/GameContent/Drawing/TileDrawing.cs deleted file mode 100644 index 73bd683..0000000 --- a/GameContent/Drawing/TileDrawing.cs +++ /dev/null @@ -1,6662 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Drawing.TileDrawing -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Threading; -using Terraria.DataStructures; -using Terraria.GameContent.Events; -using Terraria.GameContent.Tile_Entities; -using Terraria.Graphics.Capture; -using Terraria.ID; -using Terraria.ObjectData; -using Terraria.UI; -using Terraria.Utilities; - -namespace Terraria.GameContent.Drawing -{ - public class TileDrawing - { - private const int MAX_SPECIALS = 9000; - private const int MAX_SPECIALS_LEGACY = 1000; - private const float FORCE_FOR_MIN_WIND = 0.08f; - private const float FORCE_FOR_MAX_WIND = 1.2f; - private int _leafFrequency = 100000; - private int[] _specialsCount = new int[12]; - private Point[][] _specialPositions = new Point[12][]; - private Dictionary _displayDollTileEntityPositions = new Dictionary(); - private Dictionary _hatRackTileEntityPositions = new Dictionary(); - private Dictionary _trainingDummyTileEntityPositions = new Dictionary(); - private Dictionary _itemFrameTileEntityPositions = new Dictionary(); - private Dictionary _foodPlatterTileEntityPositions = new Dictionary(); - private Dictionary _weaponRackTileEntityPositions = new Dictionary(); - private Dictionary _chestPositions = new Dictionary(); - private int _specialTilesCount; - private int[] _specialTileX = new int[1000]; - private int[] _specialTileY = new int[1000]; - private UnifiedRandom _rand; - private double _treeWindCounter; - private double _grassWindCounter; - private double _sunflowerWindCounter; - private double _vineWindCounter; - private WindGrid _windGrid = new WindGrid(); - private bool _shouldShowInvisibleBlocks; - private List _vineRootsPositions = new List(); - private List _reverseVineRootsPositions = new List(); - private TilePaintSystemV2 _paintSystem; - private Color _martianGlow = new Color(0, 0, 0, 0); - private Color _meteorGlow = new Color(100, 100, 100, 0); - private Color _lavaMossGlow = new Color(150, 100, 50, 0); - private Color _kryptonMossGlow = new Color(0, 200, 0, 0); - private Color _xenonMossGlow = new Color(0, 180, 250, 0); - private Color _argonMossGlow = new Color(225, 0, 125, 0); - private bool _isActiveAndNotPaused; - private Player _localPlayer = new Player(); - private Color _highQualityLightingRequirement; - private Color _mediumQualityLightingRequirement; - private static readonly Vector2 _zero; - private ThreadLocal _currentTileDrawInfo = new ThreadLocal((Func) (() => new TileDrawInfo())); - private TileDrawInfo _currentTileDrawInfoNonThreaded = new TileDrawInfo(); - private Vector3[] _glowPaintColorSlices = new Vector3[9] - { - Vector3.One, - Vector3.One, - Vector3.One, - Vector3.One, - Vector3.One, - Vector3.One, - Vector3.One, - Vector3.One, - Vector3.One - }; - private List _voidLensData = new List(); - - private void AddSpecialPoint(int x, int y, TileDrawing.TileCounterType type) => this._specialPositions[(int) type][this._specialsCount[(int) type]++] = new Point(x, y); - - private bool[] _tileSolid => Main.tileSolid; - - private bool[] _tileSolidTop => Main.tileSolidTop; - - private Dust[] _dust => Main.dust; - - private Gore[] _gore => Main.gore; - - public TileDrawing(TilePaintSystemV2 paintSystem) - { - this._paintSystem = paintSystem; - this._rand = new UnifiedRandom(); - for (int index = 0; index < this._specialPositions.Length; ++index) - this._specialPositions[index] = new Point[9000]; - } - - public void PreparePaintForTilesOnScreen() - { - if (Main.GameUpdateCount % 6U > 0U) - return; - Vector2 unscaledPosition = Main.Camera.UnscaledPosition; - Vector2 vector2 = new Vector2((float) Main.offScreenRange, (float) Main.offScreenRange); - if (Main.drawToScreen) - vector2 = Vector2.Zero; - int firstTileX; - int lastTileX; - int firstTileY; - int lastTileY; - this.GetScreenDrawArea(unscaledPosition, vector2 + (Main.Camera.UnscaledPosition - Main.Camera.ScaledPosition), out firstTileX, out lastTileX, out firstTileY, out lastTileY); - this.PrepareForAreaDrawing(firstTileX, lastTileX, firstTileY, lastTileY, true); - } - - public void PrepareForAreaDrawing( - int firstTileX, - int lastTileX, - int firstTileY, - int lastTileY, - bool prepareLazily) - { - TilePaintSystemV2.TileVariationkey lookupKey1 = new TilePaintSystemV2.TileVariationkey(); - TilePaintSystemV2.WallVariationKey lookupKey2 = new TilePaintSystemV2.WallVariationKey(); - for (int index1 = firstTileY; index1 < lastTileY + 4; ++index1) - { - for (int index2 = firstTileX - 2; index2 < lastTileX + 2; ++index2) - { - Tile tile = Main.tile[index2, index1]; - if (tile != null) - { - if (tile.active()) - { - Main.instance.LoadTiles((int) tile.type); - lookupKey1.TileType = (int) tile.type; - lookupKey1.PaintColor = (int) tile.color(); - int num = 0; - switch (tile.type) - { - case 5: - num = TileDrawing.GetTreeBiome(index2, index1, (int) tile.frameX, (int) tile.frameY); - break; - case 323: - num = this.GetPalmTreeBiome(index2, index1); - break; - } - lookupKey1.TileStyle = num; - if (lookupKey1.PaintColor != 0) - this._paintSystem.RequestTile(ref lookupKey1); - } - if (tile.wall != (ushort) 0) - { - Main.instance.LoadWall((int) tile.wall); - lookupKey2.WallType = (int) tile.wall; - lookupKey2.PaintColor = (int) tile.wallColor(); - if (lookupKey2.PaintColor != 0) - this._paintSystem.RequestWall(ref lookupKey2); - } - if (!prepareLazily) - this.MakeExtraPreparations(tile, index2, index1); - } - } - } - } - - private void MakeExtraPreparations(Tile tile, int x, int y) - { - switch (tile.type) - { - case 5: - int treeFrame1 = 0; - int floorY1 = 0; - int topTextureFrameWidth1 = 0; - int topTextureFrameHeight1 = 0; - int treeStyle1 = 0; - int xoffset1 = (tile.frameX == (short) 44).ToInt() - (tile.frameX == (short) 66).ToInt(); - if (!WorldGen.GetCommonTreeFoliageData(x, y, xoffset1, ref treeFrame1, ref treeStyle1, out floorY1, out topTextureFrameWidth1, out topTextureFrameHeight1)) - break; - TilePaintSystemV2.TreeFoliageVariantKey lookupKey1 = new TilePaintSystemV2.TreeFoliageVariantKey() - { - TextureIndex = treeStyle1, - PaintColor = (int) tile.color() - }; - this._paintSystem.RequestTreeTop(ref lookupKey1); - this._paintSystem.RequestTreeBranch(ref lookupKey1); - break; - case 323: - int num = 15; - if (x >= WorldGen.beachDistance && x <= Main.maxTilesX - WorldGen.beachDistance) - num = 21; - TilePaintSystemV2.TreeFoliageVariantKey lookupKey2 = new TilePaintSystemV2.TreeFoliageVariantKey() - { - TextureIndex = num, - PaintColor = (int) tile.color() - }; - this._paintSystem.RequestTreeTop(ref lookupKey2); - this._paintSystem.RequestTreeBranch(ref lookupKey2); - break; - case 583: - case 584: - case 585: - case 586: - case 587: - case 588: - case 589: - int treeFrame2 = 0; - int floorY2 = 0; - int topTextureFrameWidth2 = 0; - int topTextureFrameHeight2 = 0; - int treeStyle2 = 0; - int xoffset2 = (tile.frameX == (short) 44).ToInt() - (tile.frameX == (short) 66).ToInt(); - if (!WorldGen.GetGemTreeFoliageData(x, y, xoffset2, ref treeFrame2, ref treeStyle2, out floorY2, out topTextureFrameWidth2, out topTextureFrameHeight2)) - break; - TilePaintSystemV2.TreeFoliageVariantKey lookupKey3 = new TilePaintSystemV2.TreeFoliageVariantKey() - { - TextureIndex = treeStyle2, - PaintColor = (int) tile.color() - }; - this._paintSystem.RequestTreeTop(ref lookupKey3); - this._paintSystem.RequestTreeBranch(ref lookupKey3); - break; - case 596: - case 616: - int treeFrame3 = 0; - int floorY3 = 0; - int topTextureFrameWidth3 = 0; - int topTextureFrameHeight3 = 0; - int treeStyle3 = 0; - int xoffset3 = (tile.frameX == (short) 44).ToInt() - (tile.frameX == (short) 66).ToInt(); - if (!WorldGen.GetVanityTreeFoliageData(x, y, xoffset3, ref treeFrame3, ref treeStyle3, out floorY3, out topTextureFrameWidth3, out topTextureFrameHeight3)) - break; - TilePaintSystemV2.TreeFoliageVariantKey lookupKey4 = new TilePaintSystemV2.TreeFoliageVariantKey() - { - TextureIndex = treeStyle3, - PaintColor = (int) tile.color() - }; - this._paintSystem.RequestTreeTop(ref lookupKey4); - this._paintSystem.RequestTreeBranch(ref lookupKey4); - break; - } - } - - public void Update() - { - double lerpValue = (double) Utils.GetLerpValue(0.08f, 1.2f, Math.Abs(Main.WindForVisuals), true); - this._treeWindCounter += 1.0 / 240.0 + 1.0 / 240.0 * lerpValue * 2.0; - this._grassWindCounter += 1.0 / 180.0 + 1.0 / 180.0 * lerpValue * 4.0; - this._sunflowerWindCounter += 1.0 / 420.0 + 1.0 / 420.0 * lerpValue * 5.0; - this._vineWindCounter += 1.0 / 120.0 + 1.0 / 120.0 * lerpValue * 0.400000005960464; - this.UpdateLeafFrequency(); - this.EnsureWindGridSize(); - this._windGrid.Update(); - this._shouldShowInvisibleBlocks = Main.LocalPlayer.CanSeeInvisibleBlocks; - } - - public void PreDrawTiles(bool solidLayer, bool forRenderTargets, bool intoRenderTargets) - { - bool flag = intoRenderTargets || Lighting.UpdateEveryFrame; - if (!(!solidLayer & flag)) - return; - this._specialsCount[5] = 0; - this._specialsCount[4] = 0; - this._specialsCount[8] = 0; - this._specialsCount[6] = 0; - this._specialsCount[3] = 0; - this._specialsCount[0] = 0; - this._specialsCount[9] = 0; - this._specialsCount[10] = 0; - this._specialsCount[11] = 0; - } - - public void PostDrawTiles(bool solidLayer, bool forRenderTargets, bool intoRenderTargets) - { - if (!solidLayer && !intoRenderTargets) - { - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.Transform); - this.DrawMultiTileVines(); - this.DrawMultiTileGrass(); - this.DrawVoidLenses(); - this.DrawTeleportationPylons(); - this.DrawMasterTrophies(); - this.DrawGrass(); - this.DrawTrees(); - this.DrawVines(); - this.DrawReverseVines(); - Main.spriteBatch.End(); - } - if (!solidLayer || intoRenderTargets) - return; - this.DrawEntities_HatRacks(); - this.DrawEntities_DisplayDolls(); - } - - public void Draw( - bool solidLayer, - bool forRenderTargets, - bool intoRenderTargets, - int waterStyleOverride = -1) - { - Stopwatch stopwatch = new Stopwatch(); - stopwatch.Start(); - this._isActiveAndNotPaused = !Main.gamePaused && Main.instance.IsActive; - this._localPlayer = Main.LocalPlayer; - Vector2 unscaledPosition = Main.Camera.UnscaledPosition; - Vector2 vector2 = new Vector2((float) Main.offScreenRange, (float) Main.offScreenRange); - if (Main.drawToScreen) - vector2 = Vector2.Zero; - if (!solidLayer) - Main.critterCage = false; - this.EnsureWindGridSize(); - this.ClearLegacyCachedDraws(); - bool flag = intoRenderTargets || Main.LightingEveryFrame; - if (flag) - this.ClearCachedTileDraws(solidLayer); - float num1 = (float) ((double) byte.MaxValue * (1.0 - (double) Main.gfxQuality) + 30.0 * (double) Main.gfxQuality); - this._highQualityLightingRequirement.R = (byte) num1; - this._highQualityLightingRequirement.G = (byte) ((double) num1 * 1.1); - this._highQualityLightingRequirement.B = (byte) ((double) num1 * 1.2); - float num2 = (float) (50.0 * (1.0 - (double) Main.gfxQuality) + 2.0 * (double) Main.gfxQuality); - this._mediumQualityLightingRequirement.R = (byte) num2; - this._mediumQualityLightingRequirement.G = (byte) ((double) num2 * 1.1); - this._mediumQualityLightingRequirement.B = (byte) ((double) num2 * 1.2); - int firstTileX; - int lastTileX; - int firstTileY; - int lastTileY; - this.GetScreenDrawArea(unscaledPosition, vector2 + (Main.Camera.UnscaledPosition - Main.Camera.ScaledPosition), out firstTileX, out lastTileX, out firstTileY, out lastTileY); - byte num3 = (byte) (100.0 + 150.0 * (double) Main.martianLight); - this._martianGlow = new Color((int) num3, (int) num3, (int) num3, 0); - TileDrawInfo drawData = this._currentTileDrawInfo.Value; - for (int index1 = firstTileY; index1 < lastTileY + 4; ++index1) - { - for (int index2 = firstTileX - 2; index2 < lastTileX + 2; ++index2) - { - Tile tileCache = Main.tile[index2, index1]; - if (tileCache == null) - { - Tile tile = new Tile(); - Main.tile[index2, index1] = tile; - Main.mapTime += 60; - } - else if (tileCache.active() && this.IsTileDrawLayerSolid(tileCache.type) == solidLayer) - { - ushort type = tileCache.type; - short frameX = tileCache.frameX; - short frameY = tileCache.frameY; - if (!TextureAssets.Tile[(int) type].IsLoaded) - Main.instance.LoadTiles((int) type); - switch (type) - { - case 27: - if ((((int) frameX % 36 != 0 ? 0 : (frameY == (short) 0 ? 1 : 0)) & (flag ? 1 : 0)) != 0) - { - this.AddSpecialPoint(index2, index1, TileDrawing.TileCounterType.MultiTileGrass); - continue; - } - continue; - case 34: - if ((((int) frameX % 54 != 0 ? 0 : ((int) frameY % 54 == 0 ? 1 : 0)) & (flag ? 1 : 0)) != 0) - { - this.AddSpecialPoint(index2, index1, TileDrawing.TileCounterType.MultiTileVine); - continue; - } - continue; - case 42: - case 270: - case 271: - case 572: - case 581: - if ((((int) frameX % 18 != 0 ? 0 : ((int) frameY % 36 == 0 ? 1 : 0)) & (flag ? 1 : 0)) != 0) - { - this.AddSpecialPoint(index2, index1, TileDrawing.TileCounterType.MultiTileVine); - continue; - } - continue; - case 52: - case 62: - case 115: - case 205: - case 382: - case 528: - if (flag) - { - this.CrawlToTopOfVineAndAddSpecialPoint(index1, index2); - continue; - } - continue; - case 91: - if ((((int) frameX % 18 != 0 ? 0 : ((int) frameY % 54 == 0 ? 1 : 0)) & (flag ? 1 : 0)) != 0) - { - this.AddSpecialPoint(index2, index1, TileDrawing.TileCounterType.MultiTileVine); - continue; - } - continue; - case 95: - case 126: - case 444: - if ((((int) frameX % 36 != 0 ? 0 : ((int) frameY % 36 == 0 ? 1 : 0)) & (flag ? 1 : 0)) != 0) - { - this.AddSpecialPoint(index2, index1, TileDrawing.TileCounterType.MultiTileVine); - continue; - } - continue; - case 233: - if (((frameY != (short) 0 ? 0 : ((int) frameX % 54 == 0 ? 1 : 0)) & (flag ? 1 : 0)) != 0) - this.AddSpecialPoint(index2, index1, TileDrawing.TileCounterType.MultiTileGrass); - if (((frameY != (short) 34 ? 0 : ((int) frameX % 36 == 0 ? 1 : 0)) & (flag ? 1 : 0)) != 0) - { - this.AddSpecialPoint(index2, index1, TileDrawing.TileCounterType.MultiTileGrass); - continue; - } - continue; - case 236: - case 238: - if ((((int) frameX % 36 != 0 ? 0 : (frameY == (short) 0 ? 1 : 0)) & (flag ? 1 : 0)) != 0) - { - this.AddSpecialPoint(index2, index1, TileDrawing.TileCounterType.MultiTileGrass); - continue; - } - continue; - case 373: - case 374: - case 375: - case 461: - this.EmitLiquidDrops(index1, index2, tileCache, type); - continue; - case 454: - if ((((int) frameX % 72 != 0 ? 0 : ((int) frameY % 54 == 0 ? 1 : 0)) & (flag ? 1 : 0)) != 0) - { - this.AddSpecialPoint(index2, index1, TileDrawing.TileCounterType.MultiTileVine); - continue; - } - continue; - case 465: - case 591: - case 592: - if ((((int) frameX % 36 != 0 ? 0 : ((int) frameY % 54 == 0 ? 1 : 0)) & (flag ? 1 : 0)) != 0) - { - this.AddSpecialPoint(index2, index1, TileDrawing.TileCounterType.MultiTileVine); - continue; - } - continue; - case 485: - case 489: - case 490: - if (((frameY != (short) 0 ? 0 : ((int) frameX % 36 == 0 ? 1 : 0)) & (flag ? 1 : 0)) != 0) - { - this.AddSpecialPoint(index2, index1, TileDrawing.TileCounterType.MultiTileGrass); - continue; - } - continue; - case 491: - if (flag && frameX == (short) 18 && frameY == (short) 18) - { - this.AddSpecialPoint(index2, index1, TileDrawing.TileCounterType.VoidLens); - break; - } - break; - case 493: - if (((frameY != (short) 0 ? 0 : ((int) frameX % 18 == 0 ? 1 : 0)) & (flag ? 1 : 0)) != 0) - { - this.AddSpecialPoint(index2, index1, TileDrawing.TileCounterType.MultiTileGrass); - continue; - } - continue; - case 519: - if ((int) frameX / 18 <= 4 & flag) - { - this.AddSpecialPoint(index2, index1, TileDrawing.TileCounterType.MultiTileGrass); - continue; - } - continue; - case 521: - case 522: - case 523: - case 524: - case 525: - case 526: - case 527: - if (((frameY != (short) 0 ? 0 : ((int) frameX % 36 == 0 ? 1 : 0)) & (flag ? 1 : 0)) != 0) - { - this.AddSpecialPoint(index2, index1, TileDrawing.TileCounterType.MultiTileGrass); - continue; - } - continue; - case 530: - if (frameX < (short) 270) - { - if ((((int) frameX % 54 != 0 ? 0 : (frameY == (short) 0 ? 1 : 0)) & (flag ? 1 : 0)) != 0) - { - this.AddSpecialPoint(index2, index1, TileDrawing.TileCounterType.MultiTileGrass); - continue; - } - continue; - } - break; - case 541: - if (this._shouldShowInvisibleBlocks) - break; - continue; - case 549: - if (flag) - { - this.CrawlToBottomOfReverseVineAndAddSpecialPoint(index1, index2); - continue; - } - continue; - case 597: - if (flag && (int) frameX % 54 == 0 && frameY == (short) 0) - { - this.AddSpecialPoint(index2, index1, TileDrawing.TileCounterType.TeleportationPylon); - break; - } - break; - case 617: - if (flag && (int) frameX % 54 == 0 && (int) frameY % 72 == 0) - { - this.AddSpecialPoint(index2, index1, TileDrawing.TileCounterType.MasterTrophy); - break; - } - break; - default: - if (this.ShouldSwayInWind(index2, index1, tileCache)) - { - if (flag) - { - this.AddSpecialPoint(index2, index1, TileDrawing.TileCounterType.WindyGrass); - continue; - } - continue; - } - break; - } - this.DrawSingleTile(drawData, solidLayer, waterStyleOverride, unscaledPosition, vector2, index2, index1); - } - } - } - if (solidLayer) - { - Main.instance.DrawTileCracks(1, Main.player[Main.myPlayer].hitReplace); - Main.instance.DrawTileCracks(1, Main.player[Main.myPlayer].hitTile); - } - this.DrawSpecialTilesLegacy(unscaledPosition, vector2); - if (TileObject.objectPreview.Active && this._localPlayer.cursorItemIconEnabled && Main.placementPreview && !CaptureManager.Instance.Active) - { - Main.instance.LoadTiles((int) TileObject.objectPreview.Type); - TileObject.DrawPreview(Main.spriteBatch, TileObject.objectPreview, unscaledPosition - vector2); - } - if (solidLayer) - TimeLogger.DrawTime(0, stopwatch.Elapsed.TotalMilliseconds); - else - TimeLogger.DrawTime(1, stopwatch.Elapsed.TotalMilliseconds); - } - - private void CrawlToTopOfVineAndAddSpecialPoint(int j, int i) - { - int y = j; - for (int j1 = j - 1; j1 > 0; --j1) - { - Tile tile = Main.tile[i, j1]; - if (WorldGen.SolidTile(i, j1) || !tile.active()) - { - y = j1 + 1; - break; - } - } - Point point = new Point(i, y); - if (this._vineRootsPositions.Contains(point)) - return; - this._vineRootsPositions.Add(point); - this.AddSpecialPoint(i, y, TileDrawing.TileCounterType.Vine); - } - - private void CrawlToBottomOfReverseVineAndAddSpecialPoint(int j, int i) - { - int y = j; - for (int j1 = j; j1 < Main.maxTilesY; ++j1) - { - Tile tile = Main.tile[i, j1]; - if (WorldGen.SolidTile(i, j1) || !tile.active()) - { - y = j1 - 1; - break; - } - } - Point point = new Point(i, y); - if (this._reverseVineRootsPositions.Contains(point)) - return; - this._reverseVineRootsPositions.Add(point); - this.AddSpecialPoint(i, y, TileDrawing.TileCounterType.ReverseVine); - } - - private void DrawSingleTile( - TileDrawInfo drawData, - bool solidLayer, - int waterStyleOverride, - Vector2 screenPosition, - Vector2 screenOffset, - int tileX, - int tileY) - { - drawData.tileCache = Main.tile[tileX, tileY]; - drawData.typeCache = drawData.tileCache.type; - drawData.tileFrameX = drawData.tileCache.frameX; - drawData.tileFrameY = drawData.tileCache.frameY; - drawData.tileLight = Lighting.GetColor(tileX, tileY); - if (drawData.tileCache.liquid > (byte) 0 && drawData.tileCache.type == (ushort) 518) - return; - this.GetTileDrawData(tileX, tileY, drawData.tileCache, drawData.typeCache, ref drawData.tileFrameX, ref drawData.tileFrameY, out drawData.tileWidth, out drawData.tileHeight, out drawData.tileTop, out drawData.halfBrickHeight, out drawData.addFrX, out drawData.addFrY, out drawData.tileSpriteEffect, out drawData.glowTexture, out drawData.glowSourceRect, out drawData.glowColor); - drawData.drawTexture = this.GetTileDrawTexture(drawData.tileCache, tileX, tileY); - Texture2D highlightTexture = (Texture2D) null; - Rectangle rectangle1 = Rectangle.Empty; - Color transparent = Color.Transparent; - if (TileID.Sets.HasOutlines[(int) drawData.typeCache]) - this.GetTileOutlineInfo(tileX, tileY, drawData.typeCache, ref drawData.tileLight, ref highlightTexture, ref transparent); - if (this._localPlayer.dangerSense && TileDrawing.IsTileDangerous(this._localPlayer, drawData.tileCache, drawData.typeCache)) - { - if (drawData.tileLight.R < byte.MaxValue) - drawData.tileLight.R = byte.MaxValue; - if (drawData.tileLight.G < (byte) 50) - drawData.tileLight.G = (byte) 50; - if (drawData.tileLight.B < (byte) 50) - drawData.tileLight.B = (byte) 50; - if (this._isActiveAndNotPaused && this._rand.Next(30) == 0) - { - int index = Dust.NewDust(new Vector2((float) (tileX * 16), (float) (tileY * 16)), 16, 16, 60, Alpha: 100, Scale: 0.3f); - this._dust[index].fadeIn = 1f; - this._dust[index].velocity *= 0.1f; - this._dust[index].noLight = true; - this._dust[index].noGravity = true; - } - } - if (this._localPlayer.findTreasure && Main.IsTileSpelunkable(drawData.typeCache, drawData.tileFrameX, drawData.tileFrameY)) - { - if (drawData.tileLight.R < (byte) 200) - drawData.tileLight.R = (byte) 200; - if (drawData.tileLight.G < (byte) 170) - drawData.tileLight.G = (byte) 170; - if (this._isActiveAndNotPaused && this._rand.Next(60) == 0) - { - int index = Dust.NewDust(new Vector2((float) (tileX * 16), (float) (tileY * 16)), 16, 16, 204, Alpha: 150, Scale: 0.3f); - this._dust[index].fadeIn = 1f; - this._dust[index].velocity *= 0.1f; - this._dust[index].noLight = true; - } - } - if (this._isActiveAndNotPaused) - { - if (!Lighting.UpdateEveryFrame || new FastRandom(Main.TileFrameSeed).WithModifier(tileX, tileY).Next(4) == 0) - this.DrawTiles_EmitParticles(tileY, tileX, drawData.tileCache, drawData.typeCache, drawData.tileFrameX, drawData.tileFrameY, drawData.tileLight); - drawData.tileLight = this.DrawTiles_GetLightOverride(tileY, tileX, drawData.tileCache, drawData.typeCache, drawData.tileFrameX, drawData.tileFrameY, drawData.tileLight); - } - this.CacheSpecialDraws(tileX, tileY, drawData); - if (drawData.typeCache == (ushort) 72 && drawData.tileFrameX >= (short) 36) - { - int num = 0; - if (drawData.tileFrameY == (short) 18) - num = 1; - else if (drawData.tileFrameY == (short) 36) - num = 2; - Main.spriteBatch.Draw(TextureAssets.ShroomCap.Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X - 22), (float) (tileY * 16 - (int) screenPosition.Y - 26)) + screenOffset, new Rectangle?(new Rectangle(num * 62, 0, 60, 42)), Lighting.GetColor(tileX, tileY), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - Rectangle normalTileRect = new Rectangle((int) drawData.tileFrameX + drawData.addFrX, (int) drawData.tileFrameY + drawData.addFrY, drawData.tileWidth, drawData.tileHeight - drawData.halfBrickHeight); - Vector2 vector2 = new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop + drawData.halfBrickHeight)) + screenOffset; - if (drawData.tileLight.R < (byte) 1 && drawData.tileLight.G < (byte) 1 && drawData.tileLight.B < (byte) 1) - return; - this.DrawTile_LiquidBehindTile(solidLayer, waterStyleOverride, screenPosition, screenOffset, tileX, tileY, drawData); - drawData.colorTint = Color.White; - drawData.finalColor = TileDrawing.GetFinalLight(drawData.tileCache, drawData.typeCache, drawData.tileLight, drawData.colorTint); - switch (drawData.typeCache) - { - case 51: - drawData.finalColor = drawData.tileLight * 0.5f; - break; - case 80: - bool evil; - bool good; - bool crimson; - this.GetCactusType(tileX, tileY, (int) drawData.tileFrameX, (int) drawData.tileFrameY, out evil, out good, out crimson); - if (evil) - normalTileRect.Y += 54; - if (good) - normalTileRect.Y += 108; - if (crimson) - { - normalTileRect.Y += 162; - break; - } - break; - case 83: - drawData.drawTexture = this.GetTileDrawTexture(drawData.tileCache, tileX, tileY); - break; - case 129: - drawData.finalColor = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 100); - int num1 = 2; - if (drawData.tileFrameX >= (short) 324) - drawData.finalColor = Color.Transparent; - if (drawData.tileFrameY < (short) 36) - { - vector2.Y += (float) (num1 * (drawData.tileFrameY == (short) 0).ToDirectionInt()); - break; - } - vector2.X += (float) (num1 * (drawData.tileFrameY == (short) 36).ToDirectionInt()); - break; - case 136: - switch ((int) drawData.tileFrameX / 18) - { - case 1: - vector2.X += -2f; - break; - case 2: - vector2.X += 2f; - break; - } - break; - case 160: - Color oldColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, (int) byte.MaxValue); - if (drawData.tileCache.inActive()) - oldColor = drawData.tileCache.actColor(oldColor); - drawData.finalColor = oldColor; - break; - case 272: - int num2 = (Main.tileFrame[(int) drawData.typeCache] + tileX % 2 + tileY % 2 + tileX % 3 + tileY % 3) % 2 * 90; - drawData.addFrY += num2; - normalTileRect.Y += num2; - break; - case 323: - if (drawData.tileCache.frameX <= (short) 132 && drawData.tileCache.frameX >= (short) 88) - return; - vector2.X += (float) drawData.tileCache.frameY; - break; - case 442: - if ((int) drawData.tileFrameX / 22 == 3) - { - vector2.X += 2f; - break; - } - break; - } - if (drawData.typeCache == (ushort) 314) - this.DrawTile_MinecartTrack(screenPosition, screenOffset, tileX, tileY, drawData); - else if (drawData.typeCache == (ushort) 171) - this.DrawXmasTree(screenPosition, screenOffset, tileX, tileY, drawData); - else - this.DrawBasicTile(screenPosition, screenOffset, tileX, tileY, drawData, normalTileRect, vector2); - if (Main.tileGlowMask[(int) drawData.tileCache.type] != (short) -1) - { - short num3 = Main.tileGlowMask[(int) drawData.tileCache.type]; - if (TextureAssets.GlowMask.IndexInRange>((int) num3)) - drawData.drawTexture = TextureAssets.GlowMask[(int) num3].Value; - double num4 = Main.timeForVisualEffects * 0.08; - Color color = Color.White; - bool flag = false; - switch (drawData.tileCache.type) - { - case 129: - if (drawData.tileFrameX < (short) 324) - { - flag = true; - break; - } - drawData.drawTexture = this.GetTileDrawTexture(drawData.tileCache, tileX, tileY); - Color rgb = Main.hslToRgb((float) (0.699999988079071 + Math.Sin(6.28318548202515 * (double) Main.GlobalTimeWrappedHourly * 0.159999996423721 + (double) tileX * 0.300000011920929 + (double) tileY * 0.699999988079071) * 0.159999996423721), 1f, 0.5f); - rgb.A /= (byte) 2; - color = rgb * 0.3f; - int num5 = 72; - for (float f = 0.0f; (double) f < 6.28318548202515; f += 1.570796f) - Main.spriteBatch.Draw(drawData.drawTexture, vector2 + f.ToRotationVector2() * 2f, new Rectangle?(new Rectangle((int) drawData.tileFrameX + drawData.addFrX, (int) drawData.tileFrameY + drawData.addFrY + num5, drawData.tileWidth, drawData.tileHeight)), color, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - color = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 100); - break; - case 209: - color = PortalHelper.GetPortalColor(Main.myPlayer, drawData.tileCache.frameX >= (short) 288 ? 1 : 0); - break; - case 350: - color = new Color(new Vector4((float) (-Math.Cos((int) (num4 / 6.283) % 3 == 1 ? num4 : 0.0) * 0.2 + 0.2))); - break; - case 370: - case 390: - color = this._meteorGlow; - break; - case 381: - case 517: - color = this._lavaMossGlow; - break; - case 391: - color = new Color(250, 250, 250, 200); - break; - case 429: - case 445: - drawData.drawTexture = this.GetTileDrawTexture(drawData.tileCache, tileX, tileY); - drawData.addFrY = 18; - break; - case 534: - case 535: - color = this._kryptonMossGlow; - break; - case 536: - case 537: - color = this._xenonMossGlow; - break; - case 539: - case 540: - color = this._argonMossGlow; - break; - } - if (!flag) - { - if (drawData.tileCache.slope() == (byte) 0 && !drawData.tileCache.halfBrick()) - Main.spriteBatch.Draw(drawData.drawTexture, vector2, new Rectangle?(new Rectangle((int) drawData.tileFrameX + drawData.addFrX, (int) drawData.tileFrameY + drawData.addFrY, drawData.tileWidth, drawData.tileHeight)), color, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - else if (drawData.tileCache.halfBrick()) - { - Main.spriteBatch.Draw(drawData.drawTexture, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + 10)) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX + drawData.addFrX, (int) drawData.tileFrameY + drawData.addFrY + 10, drawData.tileWidth, 6)), color, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - } - else - { - byte num6 = drawData.tileCache.slope(); - for (int index = 0; index < 8; ++index) - { - int width = index << 1; - Rectangle rectangle2 = new Rectangle((int) drawData.tileFrameX + drawData.addFrX, (int) drawData.tileFrameY + drawData.addFrY + index * 2, width, 2); - int num7 = 0; - switch (num6) - { - case 2: - rectangle2.X = 16 - width; - num7 = 16 - width; - break; - case 3: - rectangle2.Width = 16 - width; - break; - case 4: - rectangle2.Width = 14 - width; - rectangle2.X = width + 2; - num7 = width + 2; - break; - } - Main.spriteBatch.Draw(drawData.drawTexture, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + (float) num7, (float) (tileY * 16 - (int) screenPosition.Y + index * 2)) + screenOffset, new Rectangle?(rectangle2), color, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - } - } - } - } - if (drawData.glowTexture != null) - { - Vector2 position = new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset; - if (TileID.Sets.Platforms[(int) drawData.typeCache]) - position = vector2; - Main.spriteBatch.Draw(drawData.glowTexture, position, new Rectangle?(drawData.glowSourceRect), drawData.glowColor, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - if (highlightTexture == null) - return; - rectangle1 = new Rectangle((int) drawData.tileFrameX + drawData.addFrX, (int) drawData.tileFrameY + drawData.addFrY, drawData.tileWidth, drawData.tileHeight); - int num8 = 0; - int num9 = 0; - Main.spriteBatch.Draw(highlightTexture, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + (float) num8, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop + num9)) + screenOffset, new Rectangle?(rectangle1), transparent, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - - private Texture2D GetTileDrawTexture(Tile tile, int tileX, int tileY) - { - Texture2D texture2D = TextureAssets.Tile[(int) tile.type].Value; - int tileStyle = 0; - int num = (int) tile.type; - switch (tile.type) - { - case 5: - tileStyle = TileDrawing.GetTreeBiome(tileX, tileY, (int) tile.frameX, (int) tile.frameY); - break; - case 83: - if (this.IsAlchemyPlantHarvestable((int) tile.frameX / 18)) - num = 84; - Main.instance.LoadTiles(num); - break; - case 323: - tileStyle = this.GetPalmTreeBiome(tileX, tileY); - break; - } - Texture2D requestIfNotReady = this._paintSystem.TryGetTileAndRequestIfNotReady(num, tileStyle, (int) tile.color()); - if (requestIfNotReady != null) - texture2D = requestIfNotReady; - return texture2D; - } - - private Texture2D GetTileDrawTexture( - Tile tile, - int tileX, - int tileY, - int paintOverride) - { - Texture2D texture2D = TextureAssets.Tile[(int) tile.type].Value; - int tileStyle = 0; - int num = (int) tile.type; - switch (tile.type) - { - case 5: - tileStyle = TileDrawing.GetTreeBiome(tileX, tileY, (int) tile.frameX, (int) tile.frameY); - break; - case 83: - if (this.IsAlchemyPlantHarvestable((int) tile.frameX / 18)) - num = 84; - Main.instance.LoadTiles(num); - break; - case 323: - tileStyle = this.GetPalmTreeBiome(tileX, tileY); - break; - } - Texture2D requestIfNotReady = this._paintSystem.TryGetTileAndRequestIfNotReady(num, tileStyle, paintOverride); - if (requestIfNotReady != null) - texture2D = requestIfNotReady; - return texture2D; - } - - private void DrawBasicTile( - Vector2 screenPosition, - Vector2 screenOffset, - int tileX, - int tileY, - TileDrawInfo drawData, - Rectangle normalTileRect, - Vector2 normalTilePosition) - { - if (drawData.tileCache.slope() > (byte) 0) - { - if (TileID.Sets.Platforms[(int) drawData.tileCache.type]) - { - Main.spriteBatch.Draw(drawData.drawTexture, normalTilePosition, new Rectangle?(normalTileRect), drawData.finalColor, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - if (drawData.tileCache.slope() == (byte) 1 && Main.tile[tileX + 1, tileY + 1].active() && Main.tileSolid[(int) Main.tile[tileX + 1, tileY + 1].type] && Main.tile[tileX + 1, tileY + 1].slope() != (byte) 2 && !Main.tile[tileX + 1, tileY + 1].halfBrick() && (!Main.tile[tileX, tileY + 1].active() || Main.tile[tileX, tileY + 1].blockType() != 0 && Main.tile[tileX, tileY + 1].blockType() != 5 || !TileID.Sets.BlocksStairs[(int) Main.tile[tileX, tileY + 1].type] && !TileID.Sets.BlocksStairsAbove[(int) Main.tile[tileX, tileY + 1].type])) - { - Rectangle rectangle = new Rectangle(198, (int) drawData.tileFrameY, 16, 16); - if (TileID.Sets.Platforms[(int) Main.tile[tileX + 1, tileY + 1].type] && Main.tile[tileX + 1, tileY + 1].slope() == (byte) 0) - rectangle.X = 324; - Main.spriteBatch.Draw(drawData.drawTexture, normalTilePosition + new Vector2(0.0f, 16f), new Rectangle?(rectangle), drawData.finalColor, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - else - { - if (drawData.tileCache.slope() != (byte) 2 || !Main.tile[tileX - 1, tileY + 1].active() || !Main.tileSolid[(int) Main.tile[tileX - 1, tileY + 1].type] || Main.tile[tileX - 1, tileY + 1].slope() == (byte) 1 || Main.tile[tileX - 1, tileY + 1].halfBrick() || Main.tile[tileX, tileY + 1].active() && (Main.tile[tileX, tileY + 1].blockType() == 0 || Main.tile[tileX, tileY + 1].blockType() == 4) && (TileID.Sets.BlocksStairs[(int) Main.tile[tileX, tileY + 1].type] || TileID.Sets.BlocksStairsAbove[(int) Main.tile[tileX, tileY + 1].type])) - return; - Rectangle rectangle = new Rectangle(162, (int) drawData.tileFrameY, 16, 16); - if (TileID.Sets.Platforms[(int) Main.tile[tileX - 1, tileY + 1].type] && Main.tile[tileX - 1, tileY + 1].slope() == (byte) 0) - rectangle.X = 306; - Main.spriteBatch.Draw(drawData.drawTexture, normalTilePosition + new Vector2(0.0f, 16f), new Rectangle?(rectangle), drawData.finalColor, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - } - else if (TileID.Sets.HasSlopeFrames[(int) drawData.tileCache.type]) - { - Main.spriteBatch.Draw(drawData.drawTexture, normalTilePosition, new Rectangle?(new Rectangle((int) drawData.tileFrameX + drawData.addFrX, (int) drawData.tileFrameY + drawData.addFrY, 16, 16)), drawData.finalColor, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - else - { - int num1 = (int) drawData.tileCache.slope(); - int width = 2; - for (int index = 0; index < 8; ++index) - { - int num2 = index * -2; - int height = 16 - index * 2; - int num3 = 16 - height; - int num4; - switch (num1) - { - case 1: - num2 = 0; - num4 = index * 2; - height = 14 - index * 2; - num3 = 0; - break; - case 2: - num2 = 0; - num4 = 16 - index * 2 - 2; - height = 14 - index * 2; - num3 = 0; - break; - case 3: - num4 = index * 2; - break; - default: - num4 = 16 - index * 2 - 2; - break; - } - Main.spriteBatch.Draw(drawData.drawTexture, normalTilePosition + new Vector2((float) num4, (float) (index * width + num2)), new Rectangle?(new Rectangle((int) drawData.tileFrameX + drawData.addFrX + num4, (int) drawData.tileFrameY + drawData.addFrY + num3, width, height)), drawData.finalColor, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - int num5 = num1 > 2 ? 0 : 14; - Main.spriteBatch.Draw(drawData.drawTexture, normalTilePosition + new Vector2(0.0f, (float) num5), new Rectangle?(new Rectangle((int) drawData.tileFrameX + drawData.addFrX, (int) drawData.tileFrameY + drawData.addFrY + num5, 16, 2)), drawData.finalColor, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - } - else if (!TileID.Sets.Platforms[(int) drawData.typeCache] && !TileID.Sets.IgnoresNearbyHalfbricksWhenDrawn[(int) drawData.typeCache] && this._tileSolid[(int) drawData.typeCache] && !TileID.Sets.NotReallySolid[(int) drawData.typeCache] && !drawData.tileCache.halfBrick() && (Main.tile[tileX - 1, tileY].halfBrick() || Main.tile[tileX + 1, tileY].halfBrick())) - { - if (Main.tile[tileX - 1, tileY].halfBrick() && Main.tile[tileX + 1, tileY].halfBrick()) - { - Main.spriteBatch.Draw(drawData.drawTexture, normalTilePosition + new Vector2(0.0f, 8f), new Rectangle?(new Rectangle((int) drawData.tileFrameX + drawData.addFrX, drawData.addFrY + (int) drawData.tileFrameY + 8, drawData.tileWidth, 8)), drawData.finalColor, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - Rectangle rectangle = new Rectangle(126 + drawData.addFrX, drawData.addFrY, 16, 8); - if (Main.tile[tileX, tileY - 1].active() && !Main.tile[tileX, tileY - 1].bottomSlope() && (int) Main.tile[tileX, tileY - 1].type == (int) drawData.typeCache) - rectangle = new Rectangle(90 + drawData.addFrX, drawData.addFrY, 16, 8); - Main.spriteBatch.Draw(drawData.drawTexture, normalTilePosition, new Rectangle?(rectangle), drawData.finalColor, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - else if (Main.tile[tileX - 1, tileY].halfBrick()) - { - int width = 4; - if (TileID.Sets.AllBlocksWithSmoothBordersToResolveHalfBlockIssue[(int) drawData.typeCache]) - width = 2; - Main.spriteBatch.Draw(drawData.drawTexture, normalTilePosition + new Vector2(0.0f, 8f), new Rectangle?(new Rectangle((int) drawData.tileFrameX + drawData.addFrX, drawData.addFrY + (int) drawData.tileFrameY + 8, drawData.tileWidth, 8)), drawData.finalColor, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - Main.spriteBatch.Draw(drawData.drawTexture, normalTilePosition + new Vector2((float) width, 0.0f), new Rectangle?(new Rectangle((int) drawData.tileFrameX + width + drawData.addFrX, drawData.addFrY + (int) drawData.tileFrameY, drawData.tileWidth - width, drawData.tileHeight)), drawData.finalColor, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - Main.spriteBatch.Draw(drawData.drawTexture, normalTilePosition, new Rectangle?(new Rectangle(144 + drawData.addFrX, drawData.addFrY, width, 8)), drawData.finalColor, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - if (width != 2) - return; - Main.spriteBatch.Draw(drawData.drawTexture, normalTilePosition, new Rectangle?(new Rectangle(148 + drawData.addFrX, drawData.addFrY, 2, 2)), drawData.finalColor, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - else - { - if (!Main.tile[tileX + 1, tileY].halfBrick()) - return; - int width = 4; - if (TileID.Sets.AllBlocksWithSmoothBordersToResolveHalfBlockIssue[(int) drawData.typeCache]) - width = 2; - Main.spriteBatch.Draw(drawData.drawTexture, normalTilePosition + new Vector2(0.0f, 8f), new Rectangle?(new Rectangle((int) drawData.tileFrameX + drawData.addFrX, drawData.addFrY + (int) drawData.tileFrameY + 8, drawData.tileWidth, 8)), drawData.finalColor, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - Main.spriteBatch.Draw(drawData.drawTexture, normalTilePosition, new Rectangle?(new Rectangle((int) drawData.tileFrameX + drawData.addFrX, drawData.addFrY + (int) drawData.tileFrameY, drawData.tileWidth - width, drawData.tileHeight)), drawData.finalColor, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - Main.spriteBatch.Draw(drawData.drawTexture, normalTilePosition + new Vector2((float) (16 - width), 0.0f), new Rectangle?(new Rectangle(144 + (16 - width), 0, width, 8)), drawData.finalColor, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - if (width != 2) - return; - Main.spriteBatch.Draw(drawData.drawTexture, normalTilePosition + new Vector2(14f, 0.0f), new Rectangle?(new Rectangle(156, 0, 2, 2)), drawData.finalColor, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - } - else if (Lighting.NotRetro && this._tileSolid[(int) drawData.typeCache] && !drawData.tileCache.halfBrick() && !drawData.tileCache.inActive() && drawData.typeCache != (ushort) 137 && drawData.typeCache != (ushort) 235 && drawData.typeCache != (ushort) 388 && drawData.typeCache != (ushort) 476 && drawData.typeCache != (ushort) 160 && drawData.typeCache != (ushort) 138) - { - this.DrawSingleTile_SlicedBlock(normalTilePosition, tileX, tileY, drawData); - } - else - { - if (drawData.halfBrickHeight == 8 && (!Main.tile[tileX, tileY + 1].active() || !this._tileSolid[(int) Main.tile[tileX, tileY + 1].type] || Main.tile[tileX, tileY + 1].halfBrick())) - { - if (TileID.Sets.Platforms[(int) drawData.typeCache]) - { - Main.spriteBatch.Draw(drawData.drawTexture, normalTilePosition, new Rectangle?(normalTileRect), drawData.finalColor, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - else - { - Main.spriteBatch.Draw(drawData.drawTexture, normalTilePosition, new Rectangle?(normalTileRect.Modified(0, 0, 0, -4)), drawData.finalColor, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - Main.spriteBatch.Draw(drawData.drawTexture, normalTilePosition + new Vector2(0.0f, 4f), new Rectangle?(new Rectangle(144 + drawData.addFrX, 66 + drawData.addFrY, drawData.tileWidth, 4)), drawData.finalColor, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - } - else - Main.spriteBatch.Draw(drawData.drawTexture, normalTilePosition, new Rectangle?(normalTileRect), drawData.finalColor, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - this.DrawSingleTile_Flames(screenPosition, screenOffset, tileX, tileY, drawData); - } - } - - private int GetPalmTreeBiome(int tileX, int tileY) - { - int x = tileX; - int y = tileY; - while (Main.tile[x, y].active() && Main.tile[x, y].type == (ushort) 323) - ++y; - return this.GetPalmTreeVariant(x, y); - } - - private static int GetTreeBiome(int tileX, int tileY, int tileFrameX, int tileFrameY) - { - int x = tileX; - int y = tileY; - int type = (int) Main.tile[x, y].type; - if (tileFrameX == 66 && tileFrameY <= 45) - ++x; - if (tileFrameX == 88 && tileFrameY >= 66 && tileFrameY <= 110) - --x; - if (tileFrameY >= 198) - { - switch (tileFrameX) - { - case 44: - ++x; - break; - case 66: - --x; - break; - } - } - else if (tileFrameY >= 132) - { - switch (tileFrameX) - { - case 22: - --x; - break; - case 44: - ++x; - break; - } - } - while (Main.tile[x, y].active() && (int) Main.tile[x, y].type == type) - ++y; - return TileDrawing.GetTreeVariant(x, y); - } - - public static int GetTreeVariant(int x, int y) - { - if (Main.tile[x, y] == null || !Main.tile[x, y].active()) - return -1; - switch (Main.tile[x, y].type) - { - case 23: - return 0; - case 60: - return (double) y <= Main.worldSurface ? 1 : 5; - case 70: - return 6; - case 109: - case 492: - return 2; - case 147: - return 3; - case 199: - return 4; - default: - return -1; - } - } - - private TileDrawing.TileFlameData GetTileFlameData( - int tileX, - int tileY, - int type, - int tileFrameY) - { - switch (type) - { - case 270: - return new TileDrawing.TileFlameData() - { - flameTexture = TextureAssets.FireflyJar.Value, - flameColor = new Color(200, 200, 200, 0), - flameCount = 1 - }; - case 271: - return new TileDrawing.TileFlameData() - { - flameTexture = TextureAssets.LightningbugJar.Value, - flameColor = new Color(200, 200, 200, 0), - flameCount = 1 - }; - case 581: - return new TileDrawing.TileFlameData() - { - flameTexture = TextureAssets.GlowMask[291].Value, - flameColor = new Color(200, 100, 100, 0), - flameCount = 1 - }; - default: - if (!Main.tileFlame[type]) - return new TileDrawing.TileFlameData(); - ulong num = Main.TileFrameSeed ^ ((ulong) tileX << 32 | (ulong) (uint) tileY); - int index = 0; - switch (type) - { - case 4: - index = 0; - break; - case 33: - case 174: - index = 1; - break; - case 34: - index = 3; - break; - case 35: - index = 7; - break; - case 42: - index = 13; - break; - case 49: - index = 5; - break; - case 93: - index = 4; - break; - case 98: - index = 6; - break; - case 100: - case 173: - index = 2; - break; - case 372: - index = 16; - break; - } - TileDrawing.TileFlameData tileFlameData = new TileDrawing.TileFlameData() - { - flameTexture = TextureAssets.Flames[index].Value, - flameSeed = num - }; - switch (index) - { - case 1: - switch ((int) Main.tile[tileX, tileY].frameY / 22) - { - case 5: - case 6: - case 7: - case 10: - tileFlameData.flameCount = 7; - tileFlameData.flameColor = new Color(50, 50, 50, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 11; - tileFlameData.flameRangeMultX = 0.075f; - tileFlameData.flameRangeMultY = 0.075f; - break; - case 8: - tileFlameData.flameCount = 7; - tileFlameData.flameColor = new Color(50, 50, 50, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 11; - tileFlameData.flameRangeMultX = 0.3f; - tileFlameData.flameRangeMultY = 0.3f; - break; - case 12: - tileFlameData.flameCount = 7; - tileFlameData.flameColor = new Color(50, 50, 50, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 1; - tileFlameData.flameRangeMultX = 0.1f; - tileFlameData.flameRangeMultY = 0.15f; - break; - case 14: - tileFlameData.flameCount = 8; - tileFlameData.flameColor = new Color(75, 75, 75, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 11; - tileFlameData.flameRangeMultX = 0.1f; - tileFlameData.flameRangeMultY = 0.1f; - break; - case 16: - tileFlameData.flameCount = 4; - tileFlameData.flameColor = new Color(75, 75, 75, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 11; - tileFlameData.flameRangeMultX = 0.15f; - tileFlameData.flameRangeMultY = 0.15f; - break; - case 27: - case 28: - tileFlameData.flameCount = 1; - tileFlameData.flameColor = new Color(75, 75, 75, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 11; - tileFlameData.flameRangeMultX = 0.0f; - tileFlameData.flameRangeMultY = 0.0f; - break; - default: - tileFlameData.flameCount = 7; - tileFlameData.flameColor = new Color(100, 100, 100, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 1; - tileFlameData.flameRangeMultX = 0.15f; - tileFlameData.flameRangeMultY = 0.35f; - break; - } - break; - case 2: - switch ((int) Main.tile[tileX, tileY].frameY / 36) - { - case 3: - tileFlameData.flameCount = 3; - tileFlameData.flameColor = new Color(50, 50, 50, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 11; - tileFlameData.flameRangeMultX = 0.05f; - tileFlameData.flameRangeMultY = 0.15f; - break; - case 6: - tileFlameData.flameCount = 5; - tileFlameData.flameColor = new Color(75, 75, 75, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 11; - tileFlameData.flameRangeMultX = 0.15f; - tileFlameData.flameRangeMultY = 0.15f; - break; - case 9: - tileFlameData.flameCount = 7; - tileFlameData.flameColor = new Color(100, 100, 100, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 11; - tileFlameData.flameRangeMultX = 0.3f; - tileFlameData.flameRangeMultY = 0.3f; - break; - case 11: - tileFlameData.flameCount = 7; - tileFlameData.flameColor = new Color(50, 50, 50, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 1; - tileFlameData.flameRangeMultX = 0.1f; - tileFlameData.flameRangeMultY = 0.15f; - break; - case 13: - tileFlameData.flameCount = 8; - tileFlameData.flameColor = new Color(75, 75, 75, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 11; - tileFlameData.flameRangeMultX = 0.1f; - tileFlameData.flameRangeMultY = 0.1f; - break; - case 28: - case 29: - tileFlameData.flameCount = 1; - tileFlameData.flameColor = new Color(75, 75, 75, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 1; - tileFlameData.flameRangeMultX = 0.0f; - tileFlameData.flameRangeMultY = 0.0f; - break; - default: - tileFlameData.flameCount = 7; - tileFlameData.flameColor = new Color(100, 100, 100, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 1; - tileFlameData.flameRangeMultX = 0.15f; - tileFlameData.flameRangeMultY = 0.35f; - break; - } - break; - case 3: - switch ((int) Main.tile[tileX, tileY].frameY / 54) - { - case 8: - tileFlameData.flameCount = 7; - tileFlameData.flameColor = new Color(50, 50, 50, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 11; - tileFlameData.flameRangeMultX = 0.075f; - tileFlameData.flameRangeMultY = 0.075f; - break; - case 9: - tileFlameData.flameCount = 3; - tileFlameData.flameColor = new Color(50, 50, 50, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 11; - tileFlameData.flameRangeMultX = 0.05f; - tileFlameData.flameRangeMultY = 0.15f; - break; - case 11: - tileFlameData.flameCount = 7; - tileFlameData.flameColor = new Color(50, 50, 50, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 11; - tileFlameData.flameRangeMultX = 0.3f; - tileFlameData.flameRangeMultY = 0.3f; - break; - case 15: - tileFlameData.flameCount = 7; - tileFlameData.flameColor = new Color(50, 50, 50, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 1; - tileFlameData.flameRangeMultX = 0.1f; - tileFlameData.flameRangeMultY = 0.15f; - break; - case 17: - case 20: - tileFlameData.flameCount = 7; - tileFlameData.flameColor = new Color(50, 50, 50, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 11; - tileFlameData.flameRangeMultX = 0.075f; - tileFlameData.flameRangeMultY = 0.075f; - break; - case 18: - tileFlameData.flameCount = 8; - tileFlameData.flameColor = new Color(75, 75, 75, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 11; - tileFlameData.flameRangeMultX = 0.1f; - tileFlameData.flameRangeMultY = 0.1f; - break; - case 34: - case 35: - tileFlameData.flameCount = 1; - tileFlameData.flameColor = new Color(75, 75, 75, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 11; - tileFlameData.flameRangeMultX = 0.0f; - tileFlameData.flameRangeMultY = 0.0f; - break; - default: - tileFlameData.flameCount = 7; - tileFlameData.flameColor = new Color(100, 100, 100, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 1; - tileFlameData.flameRangeMultX = 0.15f; - tileFlameData.flameRangeMultY = 0.35f; - break; - } - break; - case 4: - switch ((int) Main.tile[tileX, tileY].frameY / 54) - { - case 1: - tileFlameData.flameCount = 3; - tileFlameData.flameColor = new Color(50, 50, 50, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 11; - tileFlameData.flameRangeMultX = 0.15f; - tileFlameData.flameRangeMultY = 0.15f; - break; - case 2: - case 4: - tileFlameData.flameCount = 7; - tileFlameData.flameColor = new Color(50, 50, 50, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 11; - tileFlameData.flameRangeMultX = 0.075f; - tileFlameData.flameRangeMultY = 0.075f; - break; - case 3: - tileFlameData.flameCount = 7; - tileFlameData.flameColor = new Color(100, 100, 100, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -20; - tileFlameData.flameRangeYMax = 1; - tileFlameData.flameRangeMultX = 0.2f; - tileFlameData.flameRangeMultY = 0.35f; - break; - case 5: - tileFlameData.flameCount = 7; - tileFlameData.flameColor = new Color(50, 50, 50, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 11; - tileFlameData.flameRangeMultX = 0.3f; - tileFlameData.flameRangeMultY = 0.3f; - break; - case 9: - tileFlameData.flameCount = 7; - tileFlameData.flameColor = new Color(50, 50, 50, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 1; - tileFlameData.flameRangeMultX = 0.1f; - tileFlameData.flameRangeMultY = 0.15f; - break; - case 12: - tileFlameData.flameCount = 1; - tileFlameData.flameColor = new Color(100, 100, 100, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 11; - tileFlameData.flameRangeMultX = 0.01f; - tileFlameData.flameRangeMultY = 0.01f; - break; - case 13: - tileFlameData.flameCount = 8; - tileFlameData.flameColor = new Color(50, 50, 50, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 11; - tileFlameData.flameRangeMultX = 0.1f; - tileFlameData.flameRangeMultY = 0.1f; - break; - case 28: - case 29: - tileFlameData.flameCount = 1; - tileFlameData.flameColor = new Color(75, 75, 75, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 11; - tileFlameData.flameRangeMultX = 0.0f; - tileFlameData.flameRangeMultY = 0.0f; - break; - default: - tileFlameData.flameCount = 7; - tileFlameData.flameColor = new Color(100, 100, 100, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 1; - tileFlameData.flameRangeMultX = 0.15f; - tileFlameData.flameRangeMultY = 0.35f; - break; - } - break; - case 7: - tileFlameData.flameCount = 4; - tileFlameData.flameColor = new Color(50, 50, 50, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 10; - tileFlameData.flameRangeMultX = 0.0f; - tileFlameData.flameRangeMultY = 0.0f; - break; - case 13: - switch (tileFrameY / 36) - { - case 1: - case 3: - case 6: - case 8: - case 19: - case 27: - case 29: - case 30: - case 31: - case 32: - case 36: - case 39: - tileFlameData.flameCount = 7; - tileFlameData.flameColor = new Color(100, 100, 100, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 1; - tileFlameData.flameRangeMultX = 0.15f; - tileFlameData.flameRangeMultY = 0.35f; - break; - case 2: - case 16: - case 25: - tileFlameData.flameCount = 7; - tileFlameData.flameColor = new Color(50, 50, 50, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 1; - tileFlameData.flameRangeMultX = 0.15f; - tileFlameData.flameRangeMultY = 0.1f; - break; - case 11: - tileFlameData.flameCount = 7; - tileFlameData.flameColor = new Color(50, 50, 50, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 11; - tileFlameData.flameRangeMultX = 0.075f; - tileFlameData.flameRangeMultY = 0.075f; - break; - case 34: - case 35: - tileFlameData.flameCount = 1; - tileFlameData.flameColor = new Color(75, 75, 75, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 1; - tileFlameData.flameRangeMultX = 0.0f; - tileFlameData.flameRangeMultY = 0.0f; - break; - case 44: - tileFlameData.flameCount = 7; - tileFlameData.flameColor = new Color(100, 100, 100, 0); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 1; - tileFlameData.flameRangeMultX = 0.15f; - tileFlameData.flameRangeMultY = 0.35f; - break; - default: - tileFlameData.flameCount = 0; - break; - } - break; - default: - tileFlameData.flameCount = 7; - tileFlameData.flameColor = new Color(100, 100, 100, 0); - if (tileFrameY / 22 == 14) - tileFlameData.flameColor = new Color((float) Main.DiscoR / (float) byte.MaxValue, (float) Main.DiscoG / (float) byte.MaxValue, (float) Main.DiscoB / (float) byte.MaxValue, 0.0f); - tileFlameData.flameRangeXMin = -10; - tileFlameData.flameRangeXMax = 11; - tileFlameData.flameRangeYMin = -10; - tileFlameData.flameRangeYMax = 1; - tileFlameData.flameRangeMultX = 0.15f; - tileFlameData.flameRangeMultY = 0.35f; - break; - } - return tileFlameData; - } - } - - private void DrawSingleTile_Flames( - Vector2 screenPosition, - Vector2 screenOffset, - int tileX, - int tileY, - TileDrawInfo drawData) - { - if (drawData.typeCache == (ushort) 548 && (int) drawData.tileFrameX / 54 > 6) - Main.spriteBatch.Draw(TextureAssets.GlowMask[297].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX + drawData.addFrX, (int) drawData.tileFrameY + drawData.addFrY, drawData.tileWidth, drawData.tileHeight)), Color.White, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - if (drawData.typeCache == (ushort) 613) - Main.spriteBatch.Draw(TextureAssets.GlowMask[298].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX + drawData.addFrX, (int) drawData.tileFrameY + drawData.addFrY, drawData.tileWidth, drawData.tileHeight)), Color.White, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - if (drawData.typeCache == (ushort) 614) - Main.spriteBatch.Draw(TextureAssets.GlowMask[299].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX + drawData.addFrX, (int) drawData.tileFrameY + drawData.addFrY, drawData.tileWidth, drawData.tileHeight)), Color.White, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - if (drawData.typeCache == (ushort) 593) - Main.spriteBatch.Draw(TextureAssets.GlowMask[295].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX + drawData.addFrX, (int) drawData.tileFrameY + drawData.addFrY, drawData.tileWidth, drawData.tileHeight)), Color.White, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - if (drawData.typeCache == (ushort) 594) - Main.spriteBatch.Draw(TextureAssets.GlowMask[296].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX + drawData.addFrX, (int) drawData.tileFrameY + drawData.addFrY, drawData.tileWidth, drawData.tileHeight)), Color.White, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - if (drawData.typeCache == (ushort) 215 && drawData.tileFrameY < (short) 36) - { - int index = 15; - Color color = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); - if ((int) drawData.tileFrameX / 54 == 5) - color = new Color((float) Main.DiscoR / (float) byte.MaxValue, (float) Main.DiscoG / (float) byte.MaxValue, (float) Main.DiscoB / (float) byte.MaxValue, 0.0f); - Main.spriteBatch.Draw(TextureAssets.Flames[index].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY + drawData.addFrY, drawData.tileWidth, drawData.tileHeight)), color, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - if (drawData.typeCache == (ushort) 85) - { - float graveyardVisualIntensity = Main.GraveyardVisualIntensity; - if ((double) graveyardVisualIntensity > 0.0) - { - ulong num1 = Main.TileFrameSeed ^ ((ulong) tileX << 32 | (ulong) (uint) tileY); - TileDrawing.TileFlameData tileFlameData = this.GetTileFlameData(tileX, tileY, (int) drawData.typeCache, (int) drawData.tileFrameY); - if (num1 == 0UL) - num1 = tileFlameData.flameSeed; - tileFlameData.flameSeed = num1; - Vector2 position = new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset; - Rectangle rectangle = new Rectangle((int) drawData.tileFrameX + drawData.addFrX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight); - for (int index = 0; index < tileFlameData.flameCount; ++index) - { - Color color = tileFlameData.flameColor * graveyardVisualIntensity; - float x = (float) Utils.RandomInt(ref tileFlameData.flameSeed, tileFlameData.flameRangeXMin, tileFlameData.flameRangeXMax) * tileFlameData.flameRangeMultX; - float y = (float) Utils.RandomInt(ref tileFlameData.flameSeed, tileFlameData.flameRangeYMin, tileFlameData.flameRangeYMax) * tileFlameData.flameRangeMultY; - for (float num2 = 0.0f; (double) num2 < 1.0; num2 += 0.25f) - Main.spriteBatch.Draw(tileFlameData.flameTexture, position + new Vector2(x, y) + Vector2.UnitX.RotatedBy((double) num2 * 6.28318548202515) * 2f, new Rectangle?(rectangle), color, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - Main.spriteBatch.Draw(tileFlameData.flameTexture, position, new Rectangle?(rectangle), Color.White * graveyardVisualIntensity, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - } - } - if (drawData.typeCache == (ushort) 286) - Main.spriteBatch.Draw(TextureAssets.GlowSnail.Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX + drawData.addFrX, (int) drawData.tileFrameY + drawData.addFrY, drawData.tileWidth, drawData.tileHeight)), new Color(75, 100, (int) byte.MaxValue, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - if (drawData.typeCache == (ushort) 582) - Main.spriteBatch.Draw(TextureAssets.GlowMask[293].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX + drawData.addFrX, (int) drawData.tileFrameY + drawData.addFrY, drawData.tileWidth, drawData.tileHeight)), new Color(200, 100, 100, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - if (drawData.typeCache == (ushort) 391) - Main.spriteBatch.Draw(TextureAssets.GlowMask[131].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX + drawData.addFrX, (int) drawData.tileFrameY + drawData.addFrY, drawData.tileWidth, drawData.tileHeight)), new Color(250, 250, 250, 200), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - if (drawData.typeCache == (ushort) 619) - Main.spriteBatch.Draw(TextureAssets.GlowMask[300].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX + drawData.addFrX, (int) drawData.tileFrameY + drawData.addFrY, drawData.tileWidth, drawData.tileHeight)), new Color(75, 100, (int) byte.MaxValue, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - if (drawData.typeCache == (ushort) 270) - Main.spriteBatch.Draw(TextureAssets.FireflyJar.Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX + drawData.addFrX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(200, 200, 200, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - if (drawData.typeCache == (ushort) 271) - Main.spriteBatch.Draw(TextureAssets.LightningbugJar.Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX + drawData.addFrX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(200, 200, 200, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - if (drawData.typeCache == (ushort) 581) - Main.spriteBatch.Draw(TextureAssets.GlowMask[291].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX + drawData.addFrX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(200, 200, 200, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - if (drawData.typeCache == (ushort) 316 || drawData.typeCache == (ushort) 317 || drawData.typeCache == (ushort) 318) - { - int index = (tileX - (int) drawData.tileFrameX / 18) / 2 * ((tileY - (int) drawData.tileFrameY / 18) / 3) % Main.cageFrames; - Main.spriteBatch.Draw(TextureAssets.JellyfishBowl[(int) drawData.typeCache - 316].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX + drawData.addFrX, (int) drawData.tileFrameY + Main.jellyfishCageFrame[(int) drawData.typeCache - 316, index] * 36, drawData.tileWidth, drawData.tileHeight)), new Color(200, 200, 200, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - if (drawData.typeCache == (ushort) 149 && drawData.tileFrameX < (short) 54) - Main.spriteBatch.Draw(TextureAssets.XmasLight.Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(200, 200, 200, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - if (drawData.typeCache == (ushort) 300 || drawData.typeCache == (ushort) 302 || drawData.typeCache == (ushort) 303 || drawData.typeCache == (ushort) 306) - { - int index = 9; - if (drawData.typeCache == (ushort) 302) - index = 10; - if (drawData.typeCache == (ushort) 303) - index = 11; - if (drawData.typeCache == (ushort) 306) - index = 12; - Main.spriteBatch.Draw(TextureAssets.Flames[index].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY + drawData.addFrY, drawData.tileWidth, drawData.tileHeight)), new Color(200, 200, 200, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - else if (Main.tileFlame[(int) drawData.typeCache]) - { - ulong seed = Main.TileFrameSeed ^ ((ulong) tileX << 32 | (ulong) (uint) tileY); - int typeCache = (int) drawData.typeCache; - int index1 = 0; - switch (typeCache) - { - case 4: - index1 = 0; - break; - case 33: - case 174: - index1 = 1; - break; - case 34: - index1 = 3; - break; - case 35: - index1 = 7; - break; - case 42: - index1 = 13; - break; - case 49: - index1 = 5; - break; - case 93: - index1 = 4; - break; - case 98: - index1 = 6; - break; - case 100: - case 173: - index1 = 2; - break; - case 372: - index1 = 16; - break; - } - switch (index1) - { - case 1: - switch ((int) Main.tile[tileX, tileY].frameY / 22) - { - case 5: - case 6: - case 7: - case 10: - for (int index2 = 0; index2 < 7; ++index2) - { - float num3 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.075f; - float num4 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.075f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num3, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num4) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(50, 50, 50, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - case 8: - for (int index3 = 0; index3 < 7; ++index3) - { - float num5 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.3f; - float num6 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.3f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num5, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num6) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(50, 50, 50, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - case 12: - for (int index4 = 0; index4 < 7; ++index4) - { - float num7 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.1f; - float num8 = (float) Utils.RandomInt(ref seed, -10, 1) * 0.15f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num7, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num8) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(50, 50, 50, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - case 14: - for (int index5 = 0; index5 < 8; ++index5) - { - float num9 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.1f; - float num10 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.1f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num9, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num10) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(75, 75, 75, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - case 16: - for (int index6 = 0; index6 < 4; ++index6) - { - float num11 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; - float num12 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num11, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num12) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(75, 75, 75, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - case 27: - case 28: - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(75, 75, 75, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - break; - default: - for (int index7 = 0; index7 < 7; ++index7) - { - float num13 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; - float num14 = (float) Utils.RandomInt(ref seed, -10, 1) * 0.35f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num13, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num14) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(100, 100, 100, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - } - break; - case 2: - switch ((int) Main.tile[tileX, tileY].frameY / 36) - { - case 3: - for (int index8 = 0; index8 < 3; ++index8) - { - float num15 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.05f; - float num16 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num15, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num16) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(50, 50, 50, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - case 6: - for (int index9 = 0; index9 < 5; ++index9) - { - float num17 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; - float num18 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num17, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num18) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(75, 75, 75, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - case 9: - for (int index10 = 0; index10 < 7; ++index10) - { - float num19 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.3f; - float num20 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.3f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num19, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num20) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(100, 100, 100, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - case 11: - for (int index11 = 0; index11 < 7; ++index11) - { - float num21 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.1f; - float num22 = (float) Utils.RandomInt(ref seed, -10, 1) * 0.15f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num21, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num22) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(50, 50, 50, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - case 13: - for (int index12 = 0; index12 < 8; ++index12) - { - float num23 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.1f; - float num24 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.1f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num23, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num24) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(75, 75, 75, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - case 28: - case 29: - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(75, 75, 75, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - break; - default: - for (int index13 = 0; index13 < 7; ++index13) - { - float num25 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; - float num26 = (float) Utils.RandomInt(ref seed, -10, 1) * 0.35f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num25, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num26) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(100, 100, 100, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - } - break; - case 3: - switch ((int) Main.tile[tileX, tileY].frameY / 54) - { - case 8: - for (int index14 = 0; index14 < 7; ++index14) - { - float num27 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.075f; - float num28 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.075f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num27, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num28) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(50, 50, 50, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - case 9: - for (int index15 = 0; index15 < 3; ++index15) - { - float num29 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.05f; - float num30 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num29, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num30) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(50, 50, 50, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - case 11: - for (int index16 = 0; index16 < 7; ++index16) - { - float num31 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.3f; - float num32 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.3f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num31, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num32) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(50, 50, 50, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - case 15: - for (int index17 = 0; index17 < 7; ++index17) - { - float num33 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.1f; - float num34 = (float) Utils.RandomInt(ref seed, -10, 1) * 0.15f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num33, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num34) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(50, 50, 50, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - case 17: - case 20: - for (int index18 = 0; index18 < 7; ++index18) - { - float num35 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.075f; - float num36 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.075f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num35, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num36) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(50, 50, 50, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - case 18: - for (int index19 = 0; index19 < 8; ++index19) - { - float num37 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.1f; - float num38 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.1f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num37, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num38) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(75, 75, 75, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - case 34: - case 35: - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(75, 75, 75, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - break; - default: - for (int index20 = 0; index20 < 7; ++index20) - { - float num39 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; - float num40 = (float) Utils.RandomInt(ref seed, -10, 1) * 0.35f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num39, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num40) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(100, 100, 100, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - } - break; - case 4: - switch ((int) Main.tile[tileX, tileY].frameY / 54) - { - case 1: - for (int index21 = 0; index21 < 3; ++index21) - { - float num41 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; - float num42 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num41, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num42) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(50, 50, 50, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - case 2: - case 4: - for (int index22 = 0; index22 < 7; ++index22) - { - float num43 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.075f; - float num44 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.075f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num43, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num44) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(50, 50, 50, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - case 3: - for (int index23 = 0; index23 < 7; ++index23) - { - float num45 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.2f; - float num46 = (float) Utils.RandomInt(ref seed, -20, 1) * 0.35f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num45, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num46) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(100, 100, 100, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - case 5: - for (int index24 = 0; index24 < 7; ++index24) - { - float num47 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.3f; - float num48 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.3f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num47, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num48) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(50, 50, 50, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - case 9: - for (int index25 = 0; index25 < 7; ++index25) - { - float num49 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.1f; - float num50 = (float) Utils.RandomInt(ref seed, -10, 1) * 0.15f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num49, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num50) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(50, 50, 50, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - case 12: - float num51 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.01f; - float num52 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.01f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num51, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num52) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(Utils.RandomInt(ref seed, 90, 111), Utils.RandomInt(ref seed, 90, 111), Utils.RandomInt(ref seed, 90, 111), 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - break; - case 13: - for (int index26 = 0; index26 < 8; ++index26) - { - float num53 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.1f; - float num54 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.1f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num53, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num54) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(75, 75, 75, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - case 28: - case 29: - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(75, 75, 75, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - break; - default: - for (int index27 = 0; index27 < 7; ++index27) - { - float num55 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; - float num56 = (float) Utils.RandomInt(ref seed, -10, 1) * 0.35f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num55, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num56) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX + drawData.addFrX, (int) drawData.tileFrameY + drawData.addFrY, drawData.tileWidth, drawData.tileHeight)), new Color(100, 100, 100, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - } - break; - case 7: - for (int index28 = 0; index28 < 4; ++index28) - { - float num57 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; - float num58 = (float) Utils.RandomInt(ref seed, -10, 10) * 0.15f; - float num59 = 0.0f; - float num60 = 0.0f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num59, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num60) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(50, 50, 50, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - case 13: - int num61 = (int) drawData.tileFrameY / 36; - if (num61 == 1 || num61 == 3 || num61 == 6 || num61 == 8 || num61 == 19 || num61 == 27 || num61 == 29 || num61 == 30 || num61 == 31 || num61 == 32 || num61 == 36 || num61 == 39) - { - for (int index29 = 0; index29 < 7; ++index29) - { - float num62 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; - float num63 = (float) Utils.RandomInt(ref seed, -10, 1) * 0.35f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num62, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num63) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(100, 100, 100, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - } - if (num61 == 25 || num61 == 16 || num61 == 2) - { - for (int index30 = 0; index30 < 7; ++index30) - { - float num64 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; - float num65 = (float) Utils.RandomInt(ref seed, -10, 1) * 0.1f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num64, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num65) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(50, 50, 50, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - } - if (num61 == 29) - { - for (int index31 = 0; index31 < 7; ++index31) - { - float num66 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; - float num67 = (float) Utils.RandomInt(ref seed, -10, 1) * 0.15f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num66, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num67) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(25, 25, 25, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - } - if (num61 == 34 || num61 == 35) - { - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(75, 75, 75, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - break; - } - break; - default: - for (int index32 = 0; index32 < 7; ++index32) - { - Color color = new Color(100, 100, 100, 0); - if ((int) drawData.tileFrameY / 22 == 14) - color = new Color((float) Main.DiscoR / (float) byte.MaxValue, (float) Main.DiscoG / (float) byte.MaxValue, (float) Main.DiscoB / (float) byte.MaxValue, 0.0f); - float num68 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; - float num69 = (float) Utils.RandomInt(ref seed, -10, 1) * 0.35f; - Main.spriteBatch.Draw(TextureAssets.Flames[index1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0) + num68, (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop) + num69) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), color, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - break; - } - } - if (drawData.typeCache == (ushort) 144) - Main.spriteBatch.Draw(TextureAssets.Timer.Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color(200, 200, 200, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - if (drawData.typeCache != (ushort) 237) - return; - Main.spriteBatch.Draw(TextureAssets.SunAltar.Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset, new Rectangle?(new Rectangle((int) drawData.tileFrameX, (int) drawData.tileFrameY, drawData.tileWidth, drawData.tileHeight)), new Color((int) Main.mouseTextColor / 2, (int) Main.mouseTextColor / 2, (int) Main.mouseTextColor / 2, 0), 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - - private int GetPalmTreeVariant(int x, int y) - { - int num = -1; - if (Main.tile[x, y].active() && Main.tile[x, y].type == (ushort) 53) - num = 0; - if (Main.tile[x, y].active() && Main.tile[x, y].type == (ushort) 234) - num = 1; - if (Main.tile[x, y].active() && Main.tile[x, y].type == (ushort) 116) - num = 2; - if (Main.tile[x, y].active() && Main.tile[x, y].type == (ushort) 112) - num = 3; - if (WorldGen.IsPalmOasisTree(x)) - num += 4; - return num; - } - - private void DrawSingleTile_SlicedBlock( - Vector2 normalTilePosition, - int tileX, - int tileY, - TileDrawInfo drawData) - { - Color color = new Color(); - Vector2 origin = new Vector2(); - if ((int) drawData.tileLight.R > (int) this._highQualityLightingRequirement.R || (int) drawData.tileLight.G > (int) this._highQualityLightingRequirement.G || (int) drawData.tileLight.B > (int) this._highQualityLightingRequirement.B) - { - Vector3[] slices = drawData.colorSlices; - Lighting.GetColor9Slice(tileX, tileY, ref slices); - Vector3 vector3_1 = drawData.tileLight.ToVector3(); - Vector3 vector3_2 = drawData.colorTint.ToVector3(); - if (drawData.tileCache.color() == (byte) 31) - slices = this._glowPaintColorSlices; - for (int index = 0; index < 9; ++index) - { - Rectangle rectangle; - rectangle.X = 0; - rectangle.Y = 0; - rectangle.Width = 4; - rectangle.Height = 4; - switch (index) - { - case 1: - rectangle.Width = 8; - rectangle.X = 4; - break; - case 2: - rectangle.X = 12; - break; - case 3: - rectangle.Height = 8; - rectangle.Y = 4; - break; - case 4: - rectangle.Width = 8; - rectangle.Height = 8; - rectangle.X = 4; - rectangle.Y = 4; - break; - case 5: - rectangle.X = 12; - rectangle.Y = 4; - rectangle.Height = 8; - break; - case 6: - rectangle.Y = 12; - break; - case 7: - rectangle.Width = 8; - rectangle.Height = 4; - rectangle.X = 4; - rectangle.Y = 12; - break; - case 8: - rectangle.X = 12; - rectangle.Y = 12; - break; - } - Vector3 tileLight; - tileLight.X = (float) (((double) slices[index].X + (double) vector3_1.X) * 0.5); - tileLight.Y = (float) (((double) slices[index].Y + (double) vector3_1.Y) * 0.5); - tileLight.Z = (float) (((double) slices[index].Z + (double) vector3_1.Z) * 0.5); - TileDrawing.GetFinalLight(drawData.tileCache, drawData.typeCache, ref tileLight, ref vector3_2); - Vector2 position; - position.X = normalTilePosition.X + (float) rectangle.X; - position.Y = normalTilePosition.Y + (float) rectangle.Y; - rectangle.X += (int) drawData.tileFrameX + drawData.addFrX; - rectangle.Y += (int) drawData.tileFrameY + drawData.addFrY; - int num1 = (int) ((double) tileLight.X * (double) byte.MaxValue); - int num2 = (int) ((double) tileLight.Y * (double) byte.MaxValue); - int num3 = (int) ((double) tileLight.Z * (double) byte.MaxValue); - if (num1 > (int) byte.MaxValue) - num1 = (int) byte.MaxValue; - if (num2 > (int) byte.MaxValue) - num2 = (int) byte.MaxValue; - if (num3 > (int) byte.MaxValue) - num3 = (int) byte.MaxValue; - int num4 = num3 << 16; - int num5 = num2 << 8; - color.PackedValue = (uint) (num1 | num5 | num4 | -16777216); - Main.spriteBatch.Draw(drawData.drawTexture, position, new Rectangle?(rectangle), color, 0.0f, origin, 1f, drawData.tileSpriteEffect, 0.0f); - } - } - else if ((int) drawData.tileLight.R > (int) this._mediumQualityLightingRequirement.R || (int) drawData.tileLight.G > (int) this._mediumQualityLightingRequirement.G || (int) drawData.tileLight.B > (int) this._mediumQualityLightingRequirement.B) - { - Vector3[] colorSlices = drawData.colorSlices; - Lighting.GetColor4Slice(tileX, tileY, ref colorSlices); - Vector3 vector3_3 = drawData.tileLight.ToVector3(); - Vector3 vector3_4 = drawData.colorTint.ToVector3(); - Rectangle rectangle; - rectangle.Width = 8; - rectangle.Height = 8; - for (int index = 0; index < 4; ++index) - { - rectangle.X = 0; - rectangle.Y = 0; - switch (index) - { - case 1: - rectangle.X = 8; - break; - case 2: - rectangle.Y = 8; - break; - case 3: - rectangle.X = 8; - rectangle.Y = 8; - break; - } - Vector3 tileLight; - tileLight.X = (float) (((double) colorSlices[index].X + (double) vector3_3.X) * 0.5); - tileLight.Y = (float) (((double) colorSlices[index].Y + (double) vector3_3.Y) * 0.5); - tileLight.Z = (float) (((double) colorSlices[index].Z + (double) vector3_3.Z) * 0.5); - TileDrawing.GetFinalLight(drawData.tileCache, drawData.typeCache, ref tileLight, ref vector3_4); - Vector2 position; - position.X = normalTilePosition.X + (float) rectangle.X; - position.Y = normalTilePosition.Y + (float) rectangle.Y; - rectangle.X += (int) drawData.tileFrameX + drawData.addFrX; - rectangle.Y += (int) drawData.tileFrameY + drawData.addFrY; - int num6 = (int) ((double) tileLight.X * (double) byte.MaxValue); - int num7 = (int) ((double) tileLight.Y * (double) byte.MaxValue); - int num8 = (int) ((double) tileLight.Z * (double) byte.MaxValue); - if (num6 > (int) byte.MaxValue) - num6 = (int) byte.MaxValue; - if (num7 > (int) byte.MaxValue) - num7 = (int) byte.MaxValue; - if (num8 > (int) byte.MaxValue) - num8 = (int) byte.MaxValue; - int num9 = num8 << 16; - int num10 = num7 << 8; - color.PackedValue = (uint) (num6 | num10 | num9 | -16777216); - Main.spriteBatch.Draw(drawData.drawTexture, position, new Rectangle?(rectangle), color, 0.0f, origin, 1f, drawData.tileSpriteEffect, 0.0f); - } - } - else - Main.spriteBatch.Draw(drawData.drawTexture, normalTilePosition, new Rectangle?(new Rectangle((int) drawData.tileFrameX + drawData.addFrX, (int) drawData.tileFrameY + drawData.addFrY, drawData.tileWidth, drawData.tileHeight)), drawData.finalColor, 0.0f, TileDrawing._zero, 1f, drawData.tileSpriteEffect, 0.0f); - } - - private void GetCactusType( - int tileX, - int tileY, - int frameX, - int frameY, - out bool evil, - out bool good, - out bool crimson) - { - evil = false; - good = false; - crimson = false; - int index1 = tileX; - if (frameX == 36) - --index1; - if (frameX == 54) - ++index1; - if (frameX == 108) - { - if (frameY == 18) - --index1; - else - ++index1; - } - int index2 = tileY; - bool flag = false; - if (Main.tile[index1, index2].type == (ushort) 80 && Main.tile[index1, index2].active()) - flag = true; - while (!Main.tile[index1, index2].active() || !this._tileSolid[(int) Main.tile[index1, index2].type] || !flag) - { - if (Main.tile[index1, index2].type == (ushort) 80 && Main.tile[index1, index2].active()) - flag = true; - ++index2; - if (index2 > tileY + 20) - break; - } - if (Main.tile[index1, index2].type == (ushort) 112) - evil = true; - if (Main.tile[index1, index2].type == (ushort) 116) - good = true; - if (Main.tile[index1, index2].type != (ushort) 234) - return; - crimson = true; - } - - private void DrawXmasTree( - Vector2 screenPosition, - Vector2 screenOffset, - int tileX, - int tileY, - TileDrawInfo drawData) - { - if (tileY - (int) drawData.tileFrameY > 0 && drawData.tileFrameY == (short) 7 && Main.tile[tileX, tileY - (int) drawData.tileFrameY] != null) - { - drawData.tileTop -= 16 * (int) drawData.tileFrameY; - drawData.tileFrameX = Main.tile[tileX, tileY - (int) drawData.tileFrameY].frameX; - drawData.tileFrameY = Main.tile[tileX, tileY - (int) drawData.tileFrameY].frameY; - } - if (drawData.tileFrameX < (short) 10) - return; - int num1 = 0; - if (((int) drawData.tileFrameY & 1) == 1) - ++num1; - if (((int) drawData.tileFrameY & 2) == 2) - num1 += 2; - if (((int) drawData.tileFrameY & 4) == 4) - num1 += 4; - int num2 = 0; - if (((int) drawData.tileFrameY & 8) == 8) - ++num2; - if (((int) drawData.tileFrameY & 16) == 16) - num2 += 2; - if (((int) drawData.tileFrameY & 32) == 32) - num2 += 4; - int num3 = 0; - if (((int) drawData.tileFrameY & 64) == 64) - ++num3; - if (((int) drawData.tileFrameY & 128) == 128) - num3 += 2; - if (((int) drawData.tileFrameY & 256) == 256) - num3 += 4; - if (((int) drawData.tileFrameY & 512) == 512) - num3 += 8; - int num4 = 0; - if (((int) drawData.tileFrameY & 1024) == 1024) - ++num4; - if (((int) drawData.tileFrameY & 2048) == 2048) - num4 += 2; - if (((int) drawData.tileFrameY & 4096) == 4096) - num4 += 4; - if (((int) drawData.tileFrameY & 8192) == 8192) - num4 += 8; - Color color1 = Lighting.GetColor(tileX + 1, tileY - 3); - Main.spriteBatch.Draw(TextureAssets.XmasTree[0].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset, new Rectangle?(new Rectangle(0, 0, 64, 128)), color1, 0.0f, TileDrawing._zero, 1f, SpriteEffects.None, 0.0f); - if (num1 > 0) - { - int num5 = num1 - 1; - Color color2 = color1; - if (num5 != 3) - color2 = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); - Main.spriteBatch.Draw(TextureAssets.XmasTree[3].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset, new Rectangle?(new Rectangle(66 * num5, 0, 64, 128)), color2, 0.0f, TileDrawing._zero, 1f, SpriteEffects.None, 0.0f); - } - if (num2 > 0) - { - int num6 = num2 - 1; - Main.spriteBatch.Draw(TextureAssets.XmasTree[1].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset, new Rectangle?(new Rectangle(66 * num6, 0, 64, 128)), color1, 0.0f, TileDrawing._zero, 1f, SpriteEffects.None, 0.0f); - } - if (num3 > 0) - { - int num7 = num3 - 1; - Main.spriteBatch.Draw(TextureAssets.XmasTree[2].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset, new Rectangle?(new Rectangle(66 * num7, 0, 64, 128)), color1, 0.0f, TileDrawing._zero, 1f, SpriteEffects.None, 0.0f); - } - if (num4 <= 0) - return; - int num8 = num4 - 1; - Main.spriteBatch.Draw(TextureAssets.XmasTree[4].Value, new Vector2((float) (tileX * 16 - (int) screenPosition.X) - (float) (((double) drawData.tileWidth - 16.0) / 2.0), (float) (tileY * 16 - (int) screenPosition.Y + drawData.tileTop)) + screenOffset, new Rectangle?(new Rectangle(66 * num8, 130 * Main.tileFrame[171], 64, 128)), new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue), 0.0f, TileDrawing._zero, 1f, SpriteEffects.None, 0.0f); - } - - private void DrawTile_MinecartTrack( - Vector2 screenPosition, - Vector2 screenOffset, - int tileX, - int tileY, - TileDrawInfo drawData) - { - drawData.tileLight = TileDrawing.GetFinalLight(drawData.tileCache, drawData.typeCache, drawData.tileLight, drawData.colorTint); - int frontColor; - int backColor; - Minecart.TrackColors(tileX, tileY, drawData.tileCache, out frontColor, out backColor); - drawData.drawTexture = this.GetTileDrawTexture(drawData.tileCache, tileX, tileY, frontColor); - Texture2D tileDrawTexture = this.GetTileDrawTexture(drawData.tileCache, tileX, tileY, backColor); - int num = (int) drawData.tileCache.frameNumber(); - if (drawData.tileFrameY != (short) -1) - Main.spriteBatch.Draw(tileDrawTexture, new Vector2((float) (tileX * 16 - (int) screenPosition.X), (float) (tileY * 16 - (int) screenPosition.Y)) + screenOffset, new Rectangle?(Minecart.GetSourceRect((int) drawData.tileFrameY, Main.tileFrame[314])), drawData.tileLight, 0.0f, new Vector2(), 1f, drawData.tileSpriteEffect, 0.0f); - Main.spriteBatch.Draw(drawData.drawTexture, new Vector2((float) (tileX * 16 - (int) screenPosition.X), (float) (tileY * 16 - (int) screenPosition.Y)) + screenOffset, new Rectangle?(Minecart.GetSourceRect((int) drawData.tileFrameX, Main.tileFrame[314])), drawData.tileLight, 0.0f, new Vector2(), 1f, drawData.tileSpriteEffect, 0.0f); - if (Minecart.DrawLeftDecoration((int) drawData.tileFrameY)) - Main.spriteBatch.Draw(tileDrawTexture, new Vector2((float) (tileX * 16 - (int) screenPosition.X), (float) ((tileY + 1) * 16 - (int) screenPosition.Y)) + screenOffset, new Rectangle?(Minecart.GetSourceRect(36)), drawData.tileLight, 0.0f, new Vector2(), 1f, drawData.tileSpriteEffect, 0.0f); - if (Minecart.DrawLeftDecoration((int) drawData.tileFrameX)) - Main.spriteBatch.Draw(drawData.drawTexture, new Vector2((float) (tileX * 16 - (int) screenPosition.X), (float) ((tileY + 1) * 16 - (int) screenPosition.Y)) + screenOffset, new Rectangle?(Minecart.GetSourceRect(36)), drawData.tileLight, 0.0f, new Vector2(), 1f, drawData.tileSpriteEffect, 0.0f); - if (Minecart.DrawRightDecoration((int) drawData.tileFrameY)) - Main.spriteBatch.Draw(tileDrawTexture, new Vector2((float) (tileX * 16 - (int) screenPosition.X), (float) ((tileY + 1) * 16 - (int) screenPosition.Y)) + screenOffset, new Rectangle?(Minecart.GetSourceRect(37, Main.tileFrame[314])), drawData.tileLight, 0.0f, new Vector2(), 1f, drawData.tileSpriteEffect, 0.0f); - if (Minecart.DrawRightDecoration((int) drawData.tileFrameX)) - Main.spriteBatch.Draw(drawData.drawTexture, new Vector2((float) (tileX * 16 - (int) screenPosition.X), (float) ((tileY + 1) * 16 - (int) screenPosition.Y)) + screenOffset, new Rectangle?(Minecart.GetSourceRect(37)), drawData.tileLight, 0.0f, new Vector2(), 1f, drawData.tileSpriteEffect, 0.0f); - if (Minecart.DrawBumper((int) drawData.tileFrameX)) - { - Main.spriteBatch.Draw(drawData.drawTexture, new Vector2((float) (tileX * 16 - (int) screenPosition.X), (float) ((tileY - 1) * 16 - (int) screenPosition.Y)) + screenOffset, new Rectangle?(Minecart.GetSourceRect(39)), drawData.tileLight, 0.0f, new Vector2(), 1f, drawData.tileSpriteEffect, 0.0f); - } - else - { - if (!Minecart.DrawBouncyBumper((int) drawData.tileFrameX)) - return; - Main.spriteBatch.Draw(drawData.drawTexture, new Vector2((float) (tileX * 16 - (int) screenPosition.X), (float) ((tileY - 1) * 16 - (int) screenPosition.Y)) + screenOffset, new Rectangle?(Minecart.GetSourceRect(38)), drawData.tileLight, 0.0f, new Vector2(), 1f, drawData.tileSpriteEffect, 0.0f); - } - } - - private void DrawTile_LiquidBehindTile( - bool solidLayer, - int waterStyleOverride, - Vector2 screenPosition, - Vector2 screenOffset, - int tileX, - int tileY, - TileDrawInfo drawData) - { - Tile tile1 = Main.tile[tileX + 1, tileY]; - Tile tile2 = Main.tile[tileX - 1, tileY]; - Tile tile3 = Main.tile[tileX, tileY - 1]; - Tile tile4 = Main.tile[tileX, tileY + 1]; - if (tile1 == null) - { - tile1 = new Tile(); - Main.tile[tileX + 1, tileY] = tile1; - } - if (tile2 == null) - { - tile2 = new Tile(); - Main.tile[tileX - 1, tileY] = tile2; - } - if (tile3 == null) - { - tile3 = new Tile(); - Main.tile[tileX, tileY - 1] = tile3; - } - if (tile4 == null) - { - tile4 = new Tile(); - Main.tile[tileX, tileY + 1] = tile4; - } - if (!solidLayer || drawData.tileCache.inActive() || this._tileSolidTop[(int) drawData.typeCache] || drawData.tileCache.halfBrick() && (tile2.liquid > (byte) 160 || tile1.liquid > (byte) 160) && Main.instance.waterfallManager.CheckForWaterfall(tileX, tileY) || TileID.Sets.BlocksWaterDrawingBehindSelf[(int) drawData.tileCache.type] && drawData.tileCache.slope() == (byte) 0) - return; - int num1 = 0; - bool flag1 = false; - bool flag2 = false; - bool flag3 = false; - bool flag4 = false; - bool flag5 = false; - int liquidType = 0; - bool flag6 = false; - int num2 = (int) drawData.tileCache.slope(); - int num3 = drawData.tileCache.blockType(); - if (drawData.tileCache.type == (ushort) 546 && drawData.tileCache.liquid > (byte) 0) - { - flag5 = true; - flag4 = true; - flag1 = true; - flag2 = true; - switch (drawData.tileCache.liquidType()) - { - case 0: - flag6 = true; - break; - case 1: - liquidType = 1; - break; - case 2: - liquidType = 11; - break; - } - num1 = (int) drawData.tileCache.liquid; - } - else - { - if (drawData.tileCache.liquid > (byte) 0) - { - switch (num3) - { - case 0: - goto label_25; - case 1: - if (drawData.tileCache.liquid <= (byte) 160) - goto label_25; - else - break; - } - flag5 = true; - switch (drawData.tileCache.liquidType()) - { - case 0: - flag6 = true; - break; - case 1: - liquidType = 1; - break; - case 2: - liquidType = 11; - break; - } - if ((int) drawData.tileCache.liquid > num1) - num1 = (int) drawData.tileCache.liquid; - } -label_25: - if (tile2.liquid > (byte) 0 && num2 != 1 && num2 != 3) - { - flag1 = true; - switch (tile2.liquidType()) - { - case 0: - flag6 = true; - break; - case 1: - liquidType = 1; - break; - case 2: - liquidType = 11; - break; - } - if ((int) tile2.liquid > num1) - num1 = (int) tile2.liquid; - } - if (tile1.liquid > (byte) 0 && num2 != 2 && num2 != 4) - { - flag2 = true; - switch (tile1.liquidType()) - { - case 0: - flag6 = true; - break; - case 1: - liquidType = 1; - break; - case 2: - liquidType = 11; - break; - } - if ((int) tile1.liquid > num1) - num1 = (int) tile1.liquid; - } - if (tile3.liquid > (byte) 0 && num2 != 3 && num2 != 4) - { - flag3 = true; - switch (tile3.liquidType()) - { - case 0: - flag6 = true; - break; - case 1: - liquidType = 1; - break; - case 2: - liquidType = 11; - break; - } - } - if (tile4.liquid > (byte) 0 && num2 != 1 && num2 != 2) - { - if (tile4.liquid > (byte) 240) - flag4 = true; - switch (tile4.liquidType()) - { - case 0: - flag6 = true; - break; - case 1: - liquidType = 1; - break; - case 2: - liquidType = 11; - break; - } - } - } - if (!flag3 && !flag4 && !flag1 && !flag2 && !flag5) - return; - if (waterStyleOverride != -1) - Main.waterStyle = waterStyleOverride; - if (liquidType == 0) - liquidType = Main.waterStyle; - Color color = Lighting.GetColor(tileX, tileY); - Vector2 vector2 = new Vector2((float) (tileX * 16), (float) (tileY * 16)); - Rectangle liquidSize = new Rectangle(0, 4, 16, 16); - if (flag4 && flag1 | flag2) - { - flag1 = true; - flag2 = true; - } - if ((!flag3 || !(flag1 | flag2)) && !(flag4 & flag3)) - { - if (flag3) - { - liquidSize = new Rectangle(0, 4, 16, 4); - if (drawData.tileCache.halfBrick() || drawData.tileCache.slope() != (byte) 0) - liquidSize = new Rectangle(0, 4, 16, 12); - } - else if (flag4 && !flag1 && !flag2) - { - vector2 = new Vector2((float) (tileX * 16), (float) (tileY * 16 + 12)); - liquidSize = new Rectangle(0, 4, 16, 4); - } - else - { - float num4 = (float) (256 - num1) / 32f; - int y = 4; - if (tile3.liquid == (byte) 0 && (num3 != 0 || !WorldGen.SolidTile(tileX, tileY - 1))) - y = 0; - if (drawData.tileCache.slope() != (byte) 0) - { - vector2 = new Vector2((float) (tileX * 16), (float) (tileY * 16 + (int) num4 * 2)); - liquidSize = new Rectangle(0, (int) num4 * 2, 16, 16 - (int) num4 * 2); - } - else if (flag1 & flag2 || drawData.tileCache.halfBrick()) - { - vector2 = new Vector2((float) (tileX * 16), (float) (tileY * 16 + (int) num4 * 2)); - liquidSize = new Rectangle(0, y, 16, 16 - (int) num4 * 2); - } - else if (flag1) - { - vector2 = new Vector2((float) (tileX * 16), (float) (tileY * 16 + (int) num4 * 2)); - liquidSize = new Rectangle(0, y, 4, 16 - (int) num4 * 2); - } - else - { - vector2 = new Vector2((float) (tileX * 16 + 12), (float) (tileY * 16 + (int) num4 * 2)); - liquidSize = new Rectangle(0, y, 4, 16 - (int) num4 * 2); - } - } - } - float num5 = 0.5f; - switch (liquidType) - { - case 1: - num5 = 1f; - break; - case 11: - num5 = Math.Max(num5 * 1.7f, 1f); - break; - } - if ((double) tileY <= Main.worldSurface || (double) num5 > 1.0) - { - num5 = 1f; - if (drawData.tileCache.wall == (ushort) 21) - num5 = 0.9f; - else if (drawData.tileCache.wall > (ushort) 0) - num5 = 0.6f; - } - if (drawData.tileCache.halfBrick() && tile3.liquid > (byte) 0 && drawData.tileCache.wall > (ushort) 0) - num5 = 0.0f; - if (drawData.tileCache.bottomSlope() && (tile2.liquid == (byte) 0 && !WorldGen.SolidTile(tileX - 1, tileY) || tile1.liquid == (byte) 0 && !WorldGen.SolidTile(tileX + 1, tileY))) - num5 = 0.0f; - Color aColor = color * num5; - bool flag7 = false; - if (flag6) - { - for (int index = 0; index < 13; ++index) - { - if (Main.IsLiquidStyleWater(index) && (double) Main.liquidAlpha[index] > 0.0 && index != liquidType) - { - this.DrawPartialLiquid(drawData.tileCache, vector2 - screenPosition + screenOffset, liquidSize, index, aColor); - flag7 = true; - break; - } - } - } - this.DrawPartialLiquid(drawData.tileCache, vector2 - screenPosition + screenOffset, liquidSize, liquidType, aColor * (flag7 ? Main.liquidAlpha[liquidType] : 1f)); - } - - private void CacheSpecialDraws(int tileX, int tileY, TileDrawInfo drawData) - { - if (TileID.Sets.BasicChest[(int) drawData.typeCache]) - { - Point key = new Point(tileX, tileY); - if ((int) drawData.tileFrameX % 36 != 0) - --key.X; - if ((int) drawData.tileFrameY % 36 != 0) - --key.Y; - if (!this._chestPositions.ContainsKey(key)) - this._chestPositions[key] = Chest.FindChest(key.X, key.Y); - int num1 = (int) drawData.tileFrameX / 18; - int num2 = (int) drawData.tileFrameY / 18; - int num3 = (int) drawData.tileFrameX / 36; - int num4 = num1 * 18; - drawData.addFrX = num4 - (int) drawData.tileFrameX; - int num5 = num2 * 18; - if (this._chestPositions[key] != -1) - { - int frame = Main.chest[this._chestPositions[key]].frame; - if (frame == 1) - num5 += 38; - if (frame == 2) - num5 += 76; - } - drawData.addFrY = num5 - (int) drawData.tileFrameY; - if (num2 != 0) - drawData.tileHeight = 18; - if (drawData.typeCache == (ushort) 21 && (num3 == 48 || num3 == 49)) - drawData.glowSourceRect = new Rectangle(16 * (num1 % 2), (int) drawData.tileFrameY + drawData.addFrY, drawData.tileWidth, drawData.tileHeight); - } - if (drawData.typeCache == (ushort) 378) - { - Point key = new Point(tileX, tileY); - if ((int) drawData.tileFrameX % 36 != 0) - --key.X; - if ((int) drawData.tileFrameY % 54 != 0) - key.Y -= (int) drawData.tileFrameY / 18; - if (!this._trainingDummyTileEntityPositions.ContainsKey(key)) - this._trainingDummyTileEntityPositions[key] = TETrainingDummy.Find(key.X, key.Y); - if (this._trainingDummyTileEntityPositions[key] != -1) - { - int npc = ((TETrainingDummy) TileEntity.ByID[this._trainingDummyTileEntityPositions[key]]).npc; - if (npc != -1) - { - int num = Main.npc[npc].frame.Y / 55 * 54 + (int) drawData.tileFrameY; - drawData.addFrY = num - (int) drawData.tileFrameY; - } - } - } - if (drawData.typeCache == (ushort) 395) - { - Point point = new Point(tileX, tileY); - if ((int) drawData.tileFrameX % 36 != 0) - --point.X; - if ((int) drawData.tileFrameY % 36 != 0) - --point.Y; - if (!this._itemFrameTileEntityPositions.ContainsKey(point)) - { - this._itemFrameTileEntityPositions[point] = TEItemFrame.Find(point.X, point.Y); - if (this._itemFrameTileEntityPositions[point] != -1) - this.AddSpecialLegacyPoint(point); - } - } - if (drawData.typeCache == (ushort) 520) - { - Point point = new Point(tileX, tileY); - if (!this._foodPlatterTileEntityPositions.ContainsKey(point)) - { - this._foodPlatterTileEntityPositions[point] = TEFoodPlatter.Find(point.X, point.Y); - if (this._foodPlatterTileEntityPositions[point] != -1) - this.AddSpecialLegacyPoint(point); - } - } - if (drawData.typeCache == (ushort) 471) - { - Point point = new Point(tileX, tileY); - point.X -= (int) drawData.tileFrameX % 54 / 18; - point.Y -= (int) drawData.tileFrameY % 54 / 18; - if (!this._weaponRackTileEntityPositions.ContainsKey(point)) - { - this._weaponRackTileEntityPositions[point] = TEWeaponsRack.Find(point.X, point.Y); - if (this._weaponRackTileEntityPositions[point] != -1) - this.AddSpecialLegacyPoint(point); - } - } - if (drawData.typeCache == (ushort) 470) - { - Point point = new Point(tileX, tileY); - point.X -= (int) drawData.tileFrameX % 36 / 18; - point.Y -= (int) drawData.tileFrameY % 54 / 18; - if (!this._displayDollTileEntityPositions.ContainsKey(point)) - { - this._displayDollTileEntityPositions[point] = TEDisplayDoll.Find(point.X, point.Y); - if (this._displayDollTileEntityPositions[point] != -1) - this.AddSpecialLegacyPoint(point); - } - } - if (drawData.typeCache == (ushort) 475) - { - Point point = new Point(tileX, tileY); - point.X -= (int) drawData.tileFrameX % 54 / 18; - point.Y -= (int) drawData.tileFrameY % 72 / 18; - if (!this._hatRackTileEntityPositions.ContainsKey(point)) - { - this._hatRackTileEntityPositions[point] = TEHatRack.Find(point.X, point.Y); - if (this._hatRackTileEntityPositions[point] != -1) - this.AddSpecialLegacyPoint(point); - } - } - if (drawData.typeCache == (ushort) 323 && drawData.tileFrameX <= (short) 132 && drawData.tileFrameX >= (short) 88) - this.AddSpecialPoint(tileX, tileY, TileDrawing.TileCounterType.Tree); - if (drawData.typeCache == (ushort) 412 && drawData.tileFrameX == (short) 0 && drawData.tileFrameY == (short) 0) - this.AddSpecialLegacyPoint(tileX, tileY); - if (drawData.typeCache == (ushort) 620 && drawData.tileFrameX == (short) 0 && drawData.tileFrameY == (short) 0) - this.AddSpecialLegacyPoint(tileX, tileY); - if (drawData.typeCache == (ushort) 237 && drawData.tileFrameX == (short) 18 && drawData.tileFrameY == (short) 0) - this.AddSpecialLegacyPoint(tileX, tileY); - switch (drawData.typeCache) - { - case 5: - case 583: - case 584: - case 585: - case 586: - case 587: - case 588: - case 589: - case 596: - case 616: - if (drawData.tileFrameY < (short) 198 || drawData.tileFrameX < (short) 22) - break; - this.AddSpecialPoint(tileX, tileY, TileDrawing.TileCounterType.Tree); - break; - } - } - - private static Color GetFinalLight( - Tile tileCache, - ushort typeCache, - Color tileLight, - Color tint) - { - int num1 = (int) ((double) ((int) tileLight.R * (int) tint.R) / (double) byte.MaxValue); - int num2 = (int) ((double) ((int) tileLight.G * (int) tint.G) / (double) byte.MaxValue); - int num3 = (int) ((double) ((int) tileLight.B * (int) tint.B) / (double) byte.MaxValue); - if (num1 > (int) byte.MaxValue) - num1 = (int) byte.MaxValue; - if (num2 > (int) byte.MaxValue) - num2 = (int) byte.MaxValue; - if (num3 > (int) byte.MaxValue) - num3 = (int) byte.MaxValue; - int num4 = num3 << 16; - int num5 = num2 << 8; - tileLight.PackedValue = (uint) (num1 | num5 | num4 | -16777216); - if (tileCache.color() == (byte) 31) - tileLight = Color.White; - if (tileCache.inActive()) - tileLight = tileCache.actColor(tileLight); - else if (TileDrawing.ShouldTileShine(typeCache, tileCache.frameX)) - tileLight = Main.shine(tileLight, (int) typeCache); - return tileLight; - } - - private static void GetFinalLight( - Tile tileCache, - ushort typeCache, - ref Vector3 tileLight, - ref Vector3 tint) - { - tileLight *= tint; - if (tileCache.inActive()) - { - tileCache.actColor(ref tileLight); - } - else - { - if (!TileDrawing.ShouldTileShine(typeCache, tileCache.frameX)) - return; - Main.shine(ref tileLight, (int) typeCache); - } - } - - private static bool ShouldTileShine(ushort type, short frameX) - { - if (!Main.tileShine2[(int) type]) - return false; - switch (type) - { - case 21: - case 441: - return frameX >= (short) 36 && frameX < (short) 178; - case 467: - case 468: - return frameX >= (short) 144 && frameX < (short) 178; - default: - return true; - } - } - - private static bool IsTileDangerous(Player localPlayer, Tile tileCache, ushort typeCache) - { - bool flag = typeCache == (ushort) 135 || typeCache == (ushort) 137 || typeCache == (ushort) 138 || typeCache == (ushort) 484 || typeCache == (ushort) 141 || typeCache == (ushort) 210 || typeCache == (ushort) 442 || typeCache == (ushort) 443 || typeCache == (ushort) 444 || typeCache == (ushort) 411 || typeCache == (ushort) 485 || typeCache == (ushort) 85; - if (tileCache.slope() == (byte) 0 && !tileCache.inActive()) - { - flag = flag || typeCache == (ushort) 32 || typeCache == (ushort) 69 || typeCache == (ushort) 48 || typeCache == (ushort) 232 || typeCache == (ushort) 352 || typeCache == (ushort) 483 || typeCache == (ushort) 482 || typeCache == (ushort) 481 || typeCache == (ushort) 51 || typeCache == (ushort) 229; - if (!localPlayer.fireWalk) - flag = flag || typeCache == (ushort) 37 || typeCache == (ushort) 58 || typeCache == (ushort) 76; - if (!localPlayer.iceSkate) - flag = flag || typeCache == (ushort) 162; - } - return flag; - } - - private bool IsTileDrawLayerSolid(ushort typeCache) => TileID.Sets.DrawTileInSolidLayer[(int) typeCache].HasValue ? TileID.Sets.DrawTileInSolidLayer[(int) typeCache].Value : this._tileSolid[(int) typeCache]; - - private void GetTileOutlineInfo( - int x, - int y, - ushort typeCache, - ref Color tileLight, - ref Texture2D highlightTexture, - ref Color highlightColor) - { - bool actuallySelected; - if (!Main.InSmartCursorHighlightArea(x, y, out actuallySelected)) - return; - int averageTileLighting = ((int) tileLight.R + (int) tileLight.G + (int) tileLight.B) / 3; - if (averageTileLighting <= 10) - return; - highlightTexture = TextureAssets.HighlightMask[(int) typeCache].Value; - highlightColor = Colors.GetSelectionGlowColor(actuallySelected, averageTileLighting); - } - - private void DrawPartialLiquid( - Tile tileCache, - Vector2 position, - Rectangle liquidSize, - int liquidType, - Color aColor) - { - int num = (int) tileCache.slope(); - if (!TileID.Sets.BlocksWaterDrawingBehindSelf[(int) tileCache.type] || num == 0) - { - Main.spriteBatch.Draw(TextureAssets.Liquid[liquidType].Value, position, new Rectangle?(liquidSize), aColor, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - } - else - { - liquidSize.X += 18 * (num - 1); - if (tileCache.slope() == (byte) 1) - Main.spriteBatch.Draw(TextureAssets.LiquidSlope[liquidType].Value, position, new Rectangle?(liquidSize), aColor, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - else if (tileCache.slope() == (byte) 2) - Main.spriteBatch.Draw(TextureAssets.LiquidSlope[liquidType].Value, position, new Rectangle?(liquidSize), aColor, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - else if (tileCache.slope() == (byte) 3) - { - Main.spriteBatch.Draw(TextureAssets.LiquidSlope[liquidType].Value, position, new Rectangle?(liquidSize), aColor, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - } - else - { - if (tileCache.slope() != (byte) 4) - return; - Main.spriteBatch.Draw(TextureAssets.LiquidSlope[liquidType].Value, position, new Rectangle?(liquidSize), aColor, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - } - } - } - - private bool InAPlaceWithWind(int x, int y, int width, int height) => WorldGen.InAPlaceWithWind(x, y, width, height); - - private void GetTileDrawData( - int x, - int y, - Tile tileCache, - ushort typeCache, - ref short tileFrameX, - ref short tileFrameY, - out int tileWidth, - out int tileHeight, - out int tileTop, - out int halfBrickHeight, - out int addFrX, - out int addFrY, - out SpriteEffects tileSpriteEffect, - out Texture2D glowTexture, - out Rectangle glowSourceRect, - out Color glowColor) - { - tileTop = 0; - tileWidth = 16; - tileHeight = 16; - halfBrickHeight = 0; - addFrY = Main.tileFrame[(int) typeCache] * 38; - addFrX = 0; - tileSpriteEffect = SpriteEffects.None; - glowTexture = (Texture2D) null; - glowSourceRect = Rectangle.Empty; - glowColor = Color.Transparent; - switch (typeCache) - { - case 3: - case 24: - case 61: - case 71: - case 110: - case 201: - tileHeight = 20; - if (x % 2 == 0) - { - tileSpriteEffect = SpriteEffects.FlipHorizontally; - break; - } - break; - case 4: - tileWidth = 20; - tileHeight = 20; - if (WorldGen.SolidTile(x, y - 1)) - { - tileTop = 4; - break; - } - break; - case 5: - tileWidth = 20; - tileHeight = 20; - int treeBiome = TileDrawing.GetTreeBiome(x, y, (int) tileFrameX, (int) tileFrameY); - tileFrameX += (short) (176 * (treeBiome + 1)); - break; - case 12: - case 31: - case 96: - addFrY = Main.tileFrame[(int) typeCache] * 36; - break; - case 14: - case 21: - case 411: - case 467: - case 469: - if (tileFrameY == (short) 18) - { - tileHeight = 18; - break; - } - break; - case 15: - case 497: - if ((int) tileFrameY % 40 == 18) - { - tileHeight = 18; - break; - } - break; - case 16: - case 17: - case 18: - case 26: - case 32: - case 69: - case 72: - case 77: - case 79: - case 124: - case 137: - case 138: - case 352: - case 462: - case 487: - case 488: - case 574: - case 575: - case 576: - case 577: - case 578: - tileHeight = 18; - break; - case 20: - case 590: - case 595: - tileHeight = 18; - if (x % 2 == 0) - { - tileSpriteEffect = SpriteEffects.FlipHorizontally; - break; - } - break; - case 27: - if ((int) tileFrameY % 74 == 54) - { - tileHeight = 18; - break; - } - break; - case 28: - case 105: - case 470: - case 475: - case 506: - case 547: - case 548: - case 552: - case 560: - case 597: - case 613: - case 621: - case 622: - tileTop = 2; - break; - case 33: - case 49: - case 174: - case 372: - tileHeight = 20; - tileTop = -4; - break; - case 52: - case 62: - case 115: - case 205: - case 382: - case 528: - tileTop = -2; - if (x % 2 == 0) - { - tileSpriteEffect = SpriteEffects.FlipHorizontally; - break; - } - break; - case 73: - case 74: - case 113: - tileTop = -12; - tileHeight = 32; - if (x % 2 == 0) - { - tileSpriteEffect = SpriteEffects.FlipHorizontally; - break; - } - break; - case 78: - case 85: - case 100: - case 133: - case 134: - case 173: - case 210: - case 233: - case 254: - case 283: - case 378: - case 457: - case 466: - case 520: - tileTop = 2; - break; - case 80: - case 142: - case 143: - tileTop = 2; - break; - case 81: - tileTop -= 8; - tileHeight = 26; - tileWidth = 24; - if (x % 2 == 0) - { - tileSpriteEffect = SpriteEffects.FlipHorizontally; - break; - } - break; - case 82: - case 83: - case 84: - tileHeight = 20; - tileTop = -2; - if (x % 2 == 0) - { - tileSpriteEffect = SpriteEffects.FlipHorizontally; - break; - } - break; - case 89: - tileTop = 2; - break; - case 102: - tileTop = 2; - break; - case 106: - addFrY = Main.tileFrame[(int) typeCache] * 54; - break; - case 129: - addFrY = 0; - if (tileFrameX >= (short) 324) - { - int num1 = ((int) tileFrameX - 324) / 18; - int num2 = (num1 + Main.tileFrame[(int) typeCache]) % 6 - num1; - addFrX = num2 * 18; - break; - } - break; - case 132: - case 135: - tileTop = 2; - tileHeight = 18; - break; - case 136: - if (tileFrameX == (short) 0) - { - tileTop = 2; - break; - } - break; - case 139: - tileTop = 2; - int num3 = (int) tileFrameY / 2016; - addFrY -= 2016 * num3; - addFrX += 72 * num3; - break; - case 172: - case 376: - if ((int) tileFrameY % 38 == 18) - { - tileHeight = 18; - break; - } - break; - case 178: - if (tileFrameY <= (short) 36) - { - tileTop = 2; - break; - } - break; - case 184: - tileWidth = 20; - if (tileFrameY <= (short) 36) - { - tileTop = 2; - break; - } - if (tileFrameY <= (short) 108) - { - tileTop = -2; - break; - } - break; - case 185: - case 186: - case 187: - tileTop = 2; - switch (typeCache) - { - case 185: - Main.tileShine2[185] = tileFrameY == (short) 18 && tileFrameX >= (short) 576 && tileFrameX <= (short) 882; - if (tileFrameY == (short) 18) - { - int num4 = (int) tileFrameX / 1908; - addFrX -= 1908 * num4; - addFrY += 18 * num4; - break; - } - break; - case 186: - Main.tileShine2[186] = tileFrameX >= (short) 864 && tileFrameX <= (short) 1170; - break; - case 187: - int num5 = (int) tileFrameX / 1890; - addFrX -= 1890 * num5; - addFrY += 36 * num5; - break; - } - break; - case 207: - tileTop = 2; - if (tileFrameY >= (short) 72) - { - addFrY = Main.tileFrame[(int) typeCache]; - int num6 = x; - if ((int) tileFrameX % 36 != 0) - --num6; - addFrY += num6 % 6; - if (addFrY >= 6) - addFrY -= 6; - addFrY *= 72; - break; - } - addFrY = 0; - break; - case 215: - addFrY = tileFrameY >= (short) 36 ? 252 : Main.tileFrame[(int) typeCache] * 36; - tileTop = 2; - break; - case 217: - case 218: - case 564: - addFrY = Main.tileFrame[(int) typeCache] * 36; - tileTop = 2; - break; - case 219: - case 220: - addFrY = Main.tileFrame[(int) typeCache] * 54; - tileTop = 2; - break; - case 227: - tileWidth = 32; - tileHeight = 38; - if (tileFrameX == (short) 238) - tileTop -= 6; - else - tileTop -= 20; - if (tileFrameX == (short) 204) - { - bool evil; - bool good; - bool crimson; - this.GetCactusType(x, y, (int) tileFrameX, (int) tileFrameY, out evil, out good, out crimson); - if (good) - tileFrameX += (short) 238; - if (evil) - tileFrameX += (short) 204; - if (crimson) - tileFrameX += (short) 272; - } - if (x % 2 == 0) - { - tileSpriteEffect = SpriteEffects.FlipHorizontally; - break; - } - break; - case 228: - case 231: - case 243: - case 247: - tileTop = 2; - addFrY = Main.tileFrame[(int) typeCache] * 54; - break; - case 235: - addFrY = Main.tileFrame[(int) typeCache] * 18; - break; - case 238: - tileTop = 2; - addFrY = Main.tileFrame[(int) typeCache] * 36; - break; - case 244: - tileTop = 2; - addFrY = tileFrameX >= (short) 54 ? 0 : Main.tileFrame[(int) typeCache] * 36; - break; - case 270: - case 271: - case 581: - int num7 = Main.tileFrame[(int) typeCache] + x % 6; - if (x % 2 == 0) - num7 += 3; - if (x % 3 == 0) - num7 += 3; - if (x % 4 == 0) - num7 += 3; - while (num7 > 5) - num7 -= 6; - addFrX = num7 * 18; - addFrY = 0; - if (x % 2 == 0) - { - tileSpriteEffect = SpriteEffects.FlipHorizontally; - break; - } - break; - case 272: - addFrY = 0; - break; - case 275: - case 276: - case 277: - case 278: - case 279: - case 280: - case 281: - case 296: - case 297: - case 309: - case 358: - case 359: - case 413: - case 414: - case 542: - case 550: - case 551: - case 553: - case 554: - case 558: - case 559: - case 599: - case 600: - case 601: - case 602: - case 603: - case 604: - case 605: - case 606: - case 607: - case 608: - case 609: - case 610: - case 611: - case 612: - tileTop = 2; - Main.critterCage = true; - int bigAnimalCageFrame = this.GetBigAnimalCageFrame(x, y, (int) tileFrameX, (int) tileFrameY); - switch (typeCache) - { - case 275: - case 359: - case 599: - case 600: - case 601: - case 602: - case 603: - case 604: - case 605: - addFrY = Main.bunnyCageFrame[bigAnimalCageFrame] * 54; - break; - case 276: - case 413: - case 414: - case 606: - case 607: - case 608: - case 609: - case 610: - case 611: - case 612: - addFrY = Main.squirrelCageFrame[bigAnimalCageFrame] * 54; - break; - case 277: - addFrY = Main.mallardCageFrame[bigAnimalCageFrame] * 54; - break; - case 278: - addFrY = Main.duckCageFrame[bigAnimalCageFrame] * 54; - break; - case 279: - case 358: - addFrY = Main.birdCageFrame[bigAnimalCageFrame] * 54; - break; - case 280: - addFrY = Main.blueBirdCageFrame[bigAnimalCageFrame] * 54; - break; - case 281: - addFrY = Main.redBirdCageFrame[bigAnimalCageFrame] * 54; - break; - case 296: - case 297: - addFrY = Main.scorpionCageFrame[0, bigAnimalCageFrame] * 54; - break; - case 309: - addFrY = Main.penguinCageFrame[bigAnimalCageFrame] * 54; - break; - case 542: - addFrY = Main.owlCageFrame[bigAnimalCageFrame] * 54; - break; - case 550: - case 551: - addFrY = Main.turtleCageFrame[bigAnimalCageFrame] * 54; - break; - case 553: - addFrY = Main.grebeCageFrame[bigAnimalCageFrame] * 54; - break; - case 554: - addFrY = Main.seagullCageFrame[bigAnimalCageFrame] * 54; - break; - case 558: - case 559: - addFrY = Main.seahorseCageFrame[bigAnimalCageFrame] * 54; - break; - } - break; - case 282: - case 505: - case 543: - tileTop = 2; - Main.critterCage = true; - int waterAnimalCageFrame1 = this.GetWaterAnimalCageFrame(x, y, (int) tileFrameX, (int) tileFrameY); - addFrY = Main.fishBowlFrame[waterAnimalCageFrame1] * 36; - break; - case 285: - case 286: - case 298: - case 299: - case 310: - case 339: - case 361: - case 362: - case 363: - case 364: - case 391: - case 392: - case 393: - case 394: - case 532: - case 533: - case 538: - case 544: - case 555: - case 556: - case 582: - case 619: - tileTop = 2; - Main.critterCage = true; - int smallAnimalCageFrame1 = this.GetSmallAnimalCageFrame(x, y, (int) tileFrameX, (int) tileFrameY); - switch (typeCache) - { - case 285: - addFrY = Main.snailCageFrame[smallAnimalCageFrame1] * 36; - break; - case 286: - case 582: - addFrY = Main.snail2CageFrame[smallAnimalCageFrame1] * 36; - break; - case 298: - case 361: - addFrY = Main.frogCageFrame[smallAnimalCageFrame1] * 36; - break; - case 299: - case 363: - addFrY = Main.mouseCageFrame[smallAnimalCageFrame1] * 36; - break; - case 310: - case 364: - case 391: - case 619: - addFrY = Main.wormCageFrame[smallAnimalCageFrame1] * 36; - break; - case 339: - case 362: - addFrY = Main.grasshopperCageFrame[smallAnimalCageFrame1] * 36; - break; - case 392: - case 393: - case 394: - addFrY = Main.slugCageFrame[(int) typeCache - 392, smallAnimalCageFrame1] * 36; - break; - case 532: - addFrY = Main.maggotCageFrame[smallAnimalCageFrame1] * 36; - break; - case 533: - addFrY = Main.ratCageFrame[smallAnimalCageFrame1] * 36; - break; - case 538: - case 544: - addFrY = Main.ladybugCageFrame[smallAnimalCageFrame1] * 36; - break; - case 555: - case 556: - addFrY = Main.waterStriderCageFrame[smallAnimalCageFrame1] * 36; - break; - } - break; - case 288: - case 289: - case 290: - case 291: - case 292: - case 293: - case 294: - case 295: - case 360: - case 580: - case 620: - tileTop = 2; - Main.critterCage = true; - int waterAnimalCageFrame2 = this.GetWaterAnimalCageFrame(x, y, (int) tileFrameX, (int) tileFrameY); - int index1 = (int) typeCache - 288; - if (typeCache == (ushort) 360 || typeCache == (ushort) 580 || typeCache == (ushort) 620) - index1 = 8; - addFrY = Main.butterflyCageFrame[index1, waterAnimalCageFrame2] * 36; - break; - case 300: - case 301: - case 302: - case 303: - case 304: - case 305: - case 306: - case 307: - case 308: - case 354: - case 355: - case 499: - addFrY = Main.tileFrame[(int) typeCache] * 54; - tileTop = 2; - break; - case 316: - case 317: - case 318: - tileTop = 2; - Main.critterCage = true; - int smallAnimalCageFrame2 = this.GetSmallAnimalCageFrame(x, y, (int) tileFrameX, (int) tileFrameY); - int index2 = (int) typeCache - 316; - addFrY = Main.jellyfishCageFrame[index2, smallAnimalCageFrame2] * 36; - break; - case 323: - tileWidth = 20; - tileHeight = 20; - int palmTreeBiome = this.GetPalmTreeBiome(x, y); - tileFrameY = (short) (22 * palmTreeBiome); - break; - case 324: - tileWidth = 20; - tileHeight = 20; - tileTop = -2; - if (x % 2 == 0) - { - tileSpriteEffect = SpriteEffects.FlipHorizontally; - break; - } - break; - case 326: - case 327: - case 328: - case 329: - case 345: - case 351: - case 421: - case 422: - case 458: - case 459: - addFrY = Main.tileFrame[(int) typeCache] * 90; - break; - case 330: - case 331: - case 332: - case 333: - tileTop += 2; - break; - case 336: - case 340: - case 341: - case 342: - case 343: - case 344: - addFrY = Main.tileFrame[(int) typeCache] * 90; - tileTop = 2; - break; - case 349: - tileTop = 2; - int num8 = (int) tileFrameX % 36; - int num9 = (int) tileFrameY % 54; - int frameData1; - if (Animation.GetTemporaryFrame(x - num8 / 18, y - num9 / 18, out frameData1)) - { - tileFrameX = (short) (36 * frameData1 + num8); - break; - } - break; - case 377: - addFrY = Main.tileFrame[(int) typeCache] * 38; - tileTop = 2; - break; - case 379: - addFrY = Main.tileFrame[(int) typeCache] * 90; - break; - case 388: - case 389: - TileObjectData.GetTileData((int) typeCache, (int) tileFrameX / 18); - int num10 = 94; - tileTop = -2; - if ((int) tileFrameY == num10 - 20 || (int) tileFrameY == num10 * 2 - 20 || tileFrameY == (short) 0 || (int) tileFrameY == num10) - tileHeight = 18; - if (tileFrameY != (short) 0 && (int) tileFrameY != num10) - { - tileTop = 0; - break; - } - break; - case 390: - addFrY = Main.tileFrame[(int) typeCache] * 36; - break; - case 405: - tileHeight = 16; - if (tileFrameY > (short) 0) - tileHeight = 18; - int num11 = Main.tileFrame[(int) typeCache]; - if (tileFrameX >= (short) 54) - num11 = 0; - addFrY = num11 * 38; - break; - case 406: - tileHeight = 16; - if ((int) tileFrameY % 54 >= 36) - tileHeight = 18; - int num12 = Main.tileFrame[(int) typeCache]; - if (tileFrameY >= (short) 108) - num12 = 6 - (int) tileFrameY / 54; - else if (tileFrameY >= (short) 54) - num12 = Main.tileFrame[(int) typeCache] - 1; - addFrY = num12 * 56; - addFrY += (int) tileFrameY / 54 * 2; - break; - case 410: - if (tileFrameY == (short) 36) - tileHeight = 18; - if (tileFrameY >= (short) 56) - { - addFrY = Main.tileFrame[(int) typeCache]; - addFrY *= 56; - break; - } - addFrY = 0; - break; - case 412: - addFrY = 0; - tileTop = 2; - break; - case 426: - case 430: - case 431: - case 432: - case 433: - case 434: - addFrY = 90; - break; - case 428: - tileTop += 4; - if (PressurePlateHelper.PressurePlatesPressed.ContainsKey(new Point(x, y))) - { - addFrX += 18; - break; - } - break; - case 441: - case 468: - if (tileFrameY == (short) 18) - tileHeight = 18; - int num13 = (int) tileFrameX % 36; - int num14 = (int) tileFrameY % 38; - int frameData2; - if (Animation.GetTemporaryFrame(x - num13 / 18, y - num14 / 18, out frameData2)) - { - tileFrameY = (short) (38 * frameData2 + num14); - break; - } - break; - case 442: - tileWidth = 20; - tileHeight = 20; - switch ((int) tileFrameX / 22) - { - case 1: - tileTop = -4; - break; - case 2: - tileTop = -2; - tileWidth = 24; - break; - case 3: - tileTop = -2; - break; - } - break; - case 452: - int num15 = Main.tileFrame[(int) typeCache]; - if (tileFrameX >= (short) 54) - num15 = 0; - addFrY = num15 * 54; - break; - case 453: - int num16 = (Main.tileFrameCounter[(int) typeCache] / 20 + (y - (int) tileFrameY / 18 + x)) % 3; - addFrY = num16 * 54; - break; - case 454: - addFrY = Main.tileFrame[(int) typeCache] * 54; - break; - case 455: - addFrY = 0; - tileTop = 2; - int num17 = 1 + Main.tileFrame[(int) typeCache]; - if (!BirthdayParty.PartyIsUp) - num17 = 0; - addFrY = num17 * 54; - break; - case 456: - int num18 = (Main.tileFrameCounter[(int) typeCache] / 20 + (y - (int) tileFrameY / 18 + (x - (int) tileFrameX / 18))) % 4; - addFrY = num18 * 54; - break; - case 463: - case 464: - addFrY = Main.tileFrame[(int) typeCache] * 72; - tileTop = 2; - break; - case 476: - tileWidth = 20; - tileHeight = 18; - break; - case 480: - case 509: - if (tileFrameY >= (short) 54) - { - addFrY = Main.tileFrame[(int) typeCache]; - addFrY *= 54; - break; - } - addFrY = 0; - break; - case 485: - tileTop = 2; - int num19 = (Main.tileFrameCounter[(int) typeCache] / 5 + (y - (int) tileFrameY / 18 + (x - (int) tileFrameX / 18))) % 4; - addFrY = num19 * 36; - break; - case 489: - tileTop = 2; - int y1 = y - (int) tileFrameY / 18; - int x1 = x - (int) tileFrameX / 18; - if (this.InAPlaceWithWind(x1, y1, 2, 3)) - { - int num20 = (Main.tileFrameCounter[(int) typeCache] / 5 + (y1 + x1)) % 16; - addFrY = num20 * 54; - break; - } - break; - case 490: - tileTop = 2; - int y2 = y - (int) tileFrameY / 18; - int num21 = this.InAPlaceWithWind(x - (int) tileFrameX / 18, y2, 2, 2) ? 1 : 0; - int num22 = num21 != 0 ? Main.tileFrame[(int) typeCache] : 0; - int num23 = 0; - if (num21 != 0) - { - if ((double) Math.Abs(Main.WindForVisuals) > 0.5) - { - switch (Main.weatherVaneBobframe) - { - case 0: - num23 = 0; - break; - case 1: - num23 = 1; - break; - case 2: - num23 = 2; - break; - case 3: - num23 = 1; - break; - case 4: - num23 = 0; - break; - case 5: - num23 = -1; - break; - case 6: - num23 = -2; - break; - case 7: - num23 = -1; - break; - } - } - else - { - switch (Main.weatherVaneBobframe) - { - case 0: - num23 = 0; - break; - case 1: - num23 = 1; - break; - case 2: - num23 = 0; - break; - case 3: - num23 = -1; - break; - case 4: - num23 = 0; - break; - case 5: - num23 = 1; - break; - case 6: - num23 = 0; - break; - case 7: - num23 = -1; - break; - } - } - } - int num24 = num22 + num23; - if (num24 < 0) - num24 += 12; - int num25 = num24 % 12; - addFrY = num25 * 36; - break; - case 491: - tileTop = 2; - addFrX = 54; - break; - case 493: - if (tileFrameY == (short) 0) - { - int num26 = Main.tileFrameCounter[(int) typeCache]; - float num27 = Math.Abs(Main.WindForVisuals); - int y3 = y - (int) tileFrameY / 18; - int x2 = x - (int) tileFrameX / 18; - if (!this.InAPlaceWithWind(x2, y3, 1, 1)) - num27 = 0.0f; - if ((double) num27 >= 0.100000001490116) - { - if ((double) num27 < 0.5) - { - int num28 = (num26 / 20 + (y3 + x2)) % 6; - int num29 = (double) Main.WindForVisuals >= 0.0 ? num28 + 1 : 6 - num28; - addFrY = num29 * 36; - } - else - { - int num30 = (num26 / 10 + (y3 + x2)) % 6; - int num31 = (double) Main.WindForVisuals >= 0.0 ? num30 + 7 : 12 - num30; - addFrY = num31 * 36; - } - } - } - tileTop = 2; - break; - case 494: - tileTop = 2; - break; - case 507: - case 508: - int num32 = 20; - int num33 = (Main.tileFrameCounter[(int) typeCache] + x * 11 + y * 27) % (num32 * 8); - addFrY = 90 * (num33 / num32); - break; - case 518: - int num34 = (int) tileCache.liquid / 16 - 3; - if (WorldGen.SolidTile(x, y - 1) && num34 > 8) - num34 = 8; - if (tileCache.liquid == (byte) 0) - { - Tile tileSafely = Framing.GetTileSafely(x, y + 1); - if (tileSafely.nactive()) - { - switch (tileSafely.blockType()) - { - case 1: - num34 = Math.Max(8, (int) tileSafely.liquid / 16) - 16; - break; - case 2: - case 3: - num34 -= 4; - break; - } - } - } - tileTop -= num34; - break; - case 519: - tileTop = 2; - if (x % 2 == 0) - { - tileSpriteEffect = SpriteEffects.FlipHorizontally; - break; - } - break; - case 521: - case 522: - case 523: - case 524: - case 525: - case 526: - case 527: - tileTop = 2; - Main.critterCage = true; - int waterAnimalCageFrame3 = this.GetWaterAnimalCageFrame(x, y, (int) tileFrameX, (int) tileFrameY); - int index3 = (int) typeCache - 521; - addFrY = Main.dragonflyJarFrame[index3, waterAnimalCageFrame3] * 36; - break; - case 529: - int num35 = y + 1; - int num36 = x; - int corruptCount1; - int crimsonCount1; - int hallowedCount1; - WorldGen.GetBiomeInfluence(num36, num36, num35, num35, out corruptCount1, out crimsonCount1, out hallowedCount1); - int num37 = corruptCount1; - if (num37 < crimsonCount1) - num37 = crimsonCount1; - if (num37 < hallowedCount1) - num37 = hallowedCount1; - int num38 = corruptCount1 != 0 || crimsonCount1 != 0 || hallowedCount1 != 0 ? (hallowedCount1 != num37 ? (crimsonCount1 != num37 ? 4 : 3) : 2) : (x < WorldGen.beachDistance || x > Main.maxTilesX - WorldGen.beachDistance ? 1 : 0); - addFrY += 34 * num38 - (int) tileFrameY; - tileHeight = 32; - tileTop = -14; - if (x % 2 == 0) - { - tileSpriteEffect = SpriteEffects.FlipHorizontally; - break; - } - break; - case 530: - int num39 = y - (int) tileFrameY % 36 / 18 + 2; - int startX = x - (int) tileFrameX % 54 / 18; - int corruptCount2; - int crimsonCount2; - int hallowedCount2; - WorldGen.GetBiomeInfluence(startX, startX + 3, num39, num39, out corruptCount2, out crimsonCount2, out hallowedCount2); - int num40 = corruptCount2; - if (num40 < crimsonCount2) - num40 = crimsonCount2; - if (num40 < hallowedCount2) - num40 = hallowedCount2; - int num41 = corruptCount2 != 0 || crimsonCount2 != 0 || hallowedCount2 != 0 ? (hallowedCount2 != num40 ? (crimsonCount2 != num40 ? 3 : 2) : 1) : 0; - addFrY += 36 * num41; - tileTop = 2; - break; - case 541: - addFrY = this._shouldShowInvisibleBlocks ? 0 : 90; - break; - case 561: - tileTop -= 2; - tileHeight = 20; - addFrY = (int) tileFrameY / 18 * 4; - break; - case 565: - tileTop = 2; - addFrY = tileFrameX >= (short) 36 ? 0 : Main.tileFrame[(int) typeCache] * 36; - break; - case 567: - tileWidth = 26; - tileHeight = 18; - tileTop = 2; - if (x % 2 == 0) - { - tileSpriteEffect = SpriteEffects.FlipHorizontally; - break; - } - break; - case 568: - case 569: - case 570: - tileTop = 2; - Main.critterCage = true; - int waterAnimalCageFrame4 = this.GetWaterAnimalCageFrame(x, y, (int) tileFrameX, (int) tileFrameY); - addFrY = Main.fairyJarFrame[waterAnimalCageFrame4] * 36; - break; - case 571: - if (x % 2 == 0) - tileSpriteEffect = SpriteEffects.FlipHorizontally; - tileTop = 2; - break; - case 572: - int num42 = Main.tileFrame[(int) typeCache] + x % 6; - while (num42 > 3) - num42 -= 3; - addFrX = num42 * 18; - addFrY = 0; - if (x % 2 == 0) - { - tileSpriteEffect = SpriteEffects.FlipHorizontally; - break; - } - break; - case 579: - tileWidth = 20; - tileHeight = 20; - tileTop -= 2; - bool flag = (double) (x * 16 + 8) > (double) Main.LocalPlayer.Center.X; - addFrY = tileFrameX <= (short) 0 ? (!flag ? 22 : 0) : (!flag ? 0 : 22); - break; - case 583: - case 584: - case 585: - case 586: - case 587: - case 588: - case 589: - case 596: - case 616: - tileWidth = 20; - tileHeight = 20; - break; - case 592: - addFrY = Main.tileFrame[(int) typeCache] * 54; - break; - case 593: - if (tileFrameX >= (short) 18) - addFrX = -18; - tileTop = 2; - int frameData3; - addFrY = !Animation.GetTemporaryFrame(x, y, out frameData3) ? (tileFrameX >= (short) 18 ? 0 : Main.tileFrame[(int) typeCache] * 18) : (int) (short) (18 * frameData3); - break; - case 594: - if (tileFrameX >= (short) 36) - addFrX = -36; - tileTop = 2; - int num43 = (int) tileFrameX % 36; - int num44 = (int) tileFrameY % 36; - int frameData4; - addFrY = !Animation.GetTemporaryFrame(x - num43 / 18, y - num44 / 18, out frameData4) ? (tileFrameX >= (short) 36 ? 0 : Main.tileFrame[(int) typeCache] * 36) : (int) (short) (36 * frameData4); - break; - case 598: - tileTop = 2; - Main.critterCage = true; - int waterAnimalCageFrame5 = this.GetWaterAnimalCageFrame(x, y, (int) tileFrameX, (int) tileFrameY); - addFrY = Main.lavaFishBowlFrame[waterAnimalCageFrame5] * 36; - break; - case 614: - addFrX = Main.tileFrame[(int) typeCache] * 54; - addFrY = 0; - tileTop = 2; - break; - case 615: - tileHeight = 18; - if (x % 2 == 0) - { - tileSpriteEffect = SpriteEffects.FlipHorizontally; - break; - } - break; - case 617: - tileTop = 2; - tileFrameY %= (short) 144; - tileFrameX %= (short) 54; - break; - } - if (tileCache.halfBrick()) - halfBrickHeight = 8; - switch (typeCache) - { - case 10: - if ((int) tileFrameY / 54 != 32) - break; - glowTexture = TextureAssets.GlowMask[57].Value; - glowSourceRect = new Rectangle((int) tileFrameX, (int) tileFrameY % 54, tileWidth, tileHeight); - glowColor = this._martianGlow; - break; - case 11: - int num45 = (int) tileFrameY / 54; - if (num45 == 32) - { - glowTexture = TextureAssets.GlowMask[58].Value; - glowSourceRect = new Rectangle((int) tileFrameX, (int) tileFrameY % 54, tileWidth, tileHeight); - glowColor = this._martianGlow; - } - if (num45 != 33) - break; - glowTexture = TextureAssets.GlowMask[119].Value; - glowSourceRect = new Rectangle((int) tileFrameX, (int) tileFrameY % 54, tileWidth, tileHeight); - glowColor = this._meteorGlow; - break; - case 14: - int num46 = (int) tileFrameX / 54; - if (num46 == 31) - { - glowTexture = TextureAssets.GlowMask[67].Value; - glowSourceRect = new Rectangle((int) tileFrameX % 54, (int) tileFrameY, tileWidth, tileHeight); - glowColor = this._martianGlow; - } - if (num46 != 32) - break; - glowTexture = TextureAssets.GlowMask[124].Value; - glowSourceRect = new Rectangle((int) tileFrameX % 54, (int) tileFrameY, tileWidth, tileHeight); - glowColor = this._meteorGlow; - break; - case 15: - int num47 = (int) tileFrameY / 40; - if (num47 == 32) - { - glowTexture = TextureAssets.GlowMask[54].Value; - glowSourceRect = new Rectangle((int) tileFrameX, (int) tileFrameY % 40, tileWidth, tileHeight); - glowColor = this._martianGlow; - } - if (num47 != 33) - break; - glowTexture = TextureAssets.GlowMask[116].Value; - glowSourceRect = new Rectangle((int) tileFrameX, (int) tileFrameY % 40, tileWidth, tileHeight); - glowColor = this._meteorGlow; - break; - case 18: - int num48 = (int) tileFrameX / 36; - if (num48 == 27) - { - glowTexture = TextureAssets.GlowMask[69].Value; - glowSourceRect = new Rectangle((int) tileFrameX % 36, (int) tileFrameY, tileWidth, tileHeight); - glowColor = this._martianGlow; - } - if (num48 != 28) - break; - glowTexture = TextureAssets.GlowMask[125].Value; - glowSourceRect = new Rectangle((int) tileFrameX % 36, (int) tileFrameY, tileWidth, tileHeight); - glowColor = this._meteorGlow; - break; - case 19: - int num49 = (int) tileFrameY / 18; - if (num49 == 26) - { - glowTexture = TextureAssets.GlowMask[65].Value; - glowSourceRect = new Rectangle((int) tileFrameX, (int) tileFrameY % 18, tileWidth, tileHeight); - glowColor = this._martianGlow; - } - if (num49 != 27) - break; - glowTexture = TextureAssets.GlowMask[112].Value; - glowSourceRect = new Rectangle((int) tileFrameX, (int) tileFrameY % 18, tileWidth, tileHeight); - glowColor = this._meteorGlow; - break; - case 21: - case 467: - int num50 = (int) tileFrameX / 36; - if (num50 == 48) - { - glowTexture = TextureAssets.GlowMask[56].Value; - glowSourceRect = new Rectangle((int) tileFrameX % 36, (int) tileFrameY, tileWidth, tileHeight); - glowColor = this._martianGlow; - } - if (num50 != 49) - break; - glowTexture = TextureAssets.GlowMask[117].Value; - glowSourceRect = new Rectangle((int) tileFrameX % 36, (int) tileFrameY, tileWidth, tileHeight); - glowColor = this._meteorGlow; - break; - case 33: - if ((int) tileFrameX / 18 != 0 || (int) tileFrameY / 22 != 26) - break; - glowTexture = TextureAssets.GlowMask[61].Value; - glowSourceRect = new Rectangle((int) tileFrameX, (int) tileFrameY % 22, tileWidth, tileHeight); - glowColor = this._martianGlow; - break; - case 34: - if ((int) tileFrameX / 54 != 0 || (int) tileFrameY / 54 != 33) - break; - glowTexture = TextureAssets.GlowMask[55].Value; - glowSourceRect = new Rectangle((int) tileFrameX, (int) tileFrameY % 54, tileWidth, tileHeight); - glowColor = this._martianGlow; - break; - case 42: - if ((int) tileFrameY / 36 != 33) - break; - glowTexture = TextureAssets.GlowMask[63].Value; - glowSourceRect = new Rectangle((int) tileFrameX, (int) tileFrameY % 36, tileWidth, tileHeight); - glowColor = this._martianGlow; - break; - case 79: - int num51 = (int) tileFrameY / 36; - if (num51 == 27) - { - glowTexture = TextureAssets.GlowMask[53].Value; - glowSourceRect = new Rectangle((int) tileFrameX, (int) tileFrameY % 36, tileWidth, tileHeight); - glowColor = this._martianGlow; - } - if (num51 != 28) - break; - glowTexture = TextureAssets.GlowMask[114].Value; - glowSourceRect = new Rectangle((int) tileFrameX, (int) tileFrameY % 36, tileWidth, tileHeight); - glowColor = this._meteorGlow; - break; - case 87: - int num52 = (int) tileFrameX / 54; - int num53 = (int) tileFrameX / 1998; - addFrX -= 1998 * num53; - addFrY += 36 * num53; - if (num52 == 26) - { - glowTexture = TextureAssets.GlowMask[64].Value; - glowSourceRect = new Rectangle((int) tileFrameX % 54, (int) tileFrameY, tileWidth, tileHeight); - glowColor = this._martianGlow; - } - if (num52 != 27) - break; - glowTexture = TextureAssets.GlowMask[121].Value; - glowSourceRect = new Rectangle((int) tileFrameX % 54, (int) tileFrameY, tileWidth, tileHeight); - glowColor = this._meteorGlow; - break; - case 88: - int num54 = (int) tileFrameX / 54; - int num55 = (int) tileFrameX / 1998; - addFrX -= 1998 * num55; - addFrY += 36 * num55; - if (num54 == 24) - { - glowTexture = TextureAssets.GlowMask[59].Value; - glowSourceRect = new Rectangle((int) tileFrameX % 54, (int) tileFrameY, tileWidth, tileHeight); - glowColor = this._martianGlow; - } - if (num54 != 25) - break; - glowTexture = TextureAssets.GlowMask[120].Value; - glowSourceRect = new Rectangle((int) tileFrameX % 54, (int) tileFrameY, tileWidth, tileHeight); - glowColor = this._meteorGlow; - break; - case 89: - int num56 = (int) tileFrameX / 54; - int num57 = (int) tileFrameX / 1998; - addFrX -= 1998 * num57; - addFrY += 36 * num57; - if (num56 == 29) - { - glowTexture = TextureAssets.GlowMask[66].Value; - glowSourceRect = new Rectangle((int) tileFrameX % 54, (int) tileFrameY, tileWidth, tileHeight); - glowColor = this._martianGlow; - } - if (num56 != 30) - break; - glowTexture = TextureAssets.GlowMask[123].Value; - glowSourceRect = new Rectangle((int) tileFrameX % 54, (int) tileFrameY, tileWidth, tileHeight); - glowColor = this._meteorGlow; - break; - case 90: - int num58 = (int) tileFrameY / 36; - if (num58 == 27) - { - glowTexture = TextureAssets.GlowMask[52].Value; - glowSourceRect = new Rectangle((int) tileFrameX, (int) tileFrameY % 36, tileWidth, tileHeight); - glowColor = this._martianGlow; - } - if (num58 != 28) - break; - glowTexture = TextureAssets.GlowMask[113].Value; - glowSourceRect = new Rectangle((int) tileFrameX, (int) tileFrameY % 36, tileWidth, tileHeight); - glowColor = this._meteorGlow; - break; - case 93: - int num59 = (int) tileFrameY / 54; - int num60 = (int) tileFrameY / 1998; - addFrY -= 1998 * num60; - addFrX += 36 * num60; - tileTop += 2; - if (num59 != 27) - break; - glowTexture = TextureAssets.GlowMask[62].Value; - glowSourceRect = new Rectangle((int) tileFrameX, (int) tileFrameY % 54, tileWidth, tileHeight); - glowColor = this._martianGlow; - break; - case 100: - if ((int) tileFrameX / 36 != 0 || (int) tileFrameY / 36 != 27) - break; - glowTexture = TextureAssets.GlowMask[68].Value; - glowSourceRect = new Rectangle((int) tileFrameX, (int) tileFrameY % 36, tileWidth, tileHeight); - glowColor = this._martianGlow; - break; - case 101: - int num61 = (int) tileFrameX / 54; - int num62 = (int) tileFrameX / 1998; - addFrX -= 1998 * num62; - addFrY += 72 * num62; - if (num61 == 28) - { - glowTexture = TextureAssets.GlowMask[60].Value; - glowSourceRect = new Rectangle((int) tileFrameX % 54, (int) tileFrameY, tileWidth, tileHeight); - glowColor = this._martianGlow; - } - if (num61 != 29) - break; - glowTexture = TextureAssets.GlowMask[115].Value; - glowSourceRect = new Rectangle((int) tileFrameX % 54, (int) tileFrameY, tileWidth, tileHeight); - glowColor = this._meteorGlow; - break; - case 104: - int num63 = (int) tileFrameX / 36; - tileTop = 2; - if (num63 == 24) - { - glowTexture = TextureAssets.GlowMask[51].Value; - glowSourceRect = new Rectangle((int) tileFrameX % 36, (int) tileFrameY, tileWidth, tileHeight); - glowColor = this._martianGlow; - } - if (num63 != 25) - break; - glowTexture = TextureAssets.GlowMask[118].Value; - glowSourceRect = new Rectangle((int) tileFrameX % 36, (int) tileFrameY, tileWidth, tileHeight); - glowColor = this._meteorGlow; - break; - case 172: - int num64 = (int) tileFrameY / 38; - if (num64 == 28) - { - glowTexture = TextureAssets.GlowMask[88].Value; - glowSourceRect = new Rectangle((int) tileFrameX, (int) tileFrameY % 38, tileWidth, tileHeight); - glowColor = this._martianGlow; - } - if (num64 != 29) - break; - glowTexture = TextureAssets.GlowMask[122].Value; - glowSourceRect = new Rectangle((int) tileFrameX, (int) tileFrameY % 38, tileWidth, tileHeight); - glowColor = this._meteorGlow; - break; - case 184: - if (tileCache.frameX == (short) 110) - { - glowTexture = TextureAssets.GlowMask[(int) sbyte.MaxValue].Value; - glowSourceRect = new Rectangle((int) tileFrameX, (int) tileFrameY, tileWidth, tileHeight); - glowColor = this._lavaMossGlow; - } - if (tileCache.frameX == (short) 132) - { - glowTexture = TextureAssets.GlowMask[(int) sbyte.MaxValue].Value; - glowSourceRect = new Rectangle((int) tileFrameX, (int) tileFrameY, tileWidth, tileHeight); - glowColor = this._kryptonMossGlow; - } - if (tileCache.frameX == (short) 154) - { - glowTexture = TextureAssets.GlowMask[(int) sbyte.MaxValue].Value; - glowSourceRect = new Rectangle((int) tileFrameX, (int) tileFrameY, tileWidth, tileHeight); - glowColor = this._xenonMossGlow; - } - if (tileCache.frameX != (short) 176) - break; - glowTexture = TextureAssets.GlowMask[(int) sbyte.MaxValue].Value; - glowSourceRect = new Rectangle((int) tileFrameX, (int) tileFrameY, tileWidth, tileHeight); - glowColor = this._argonMossGlow; - break; - case 441: - case 468: - int num65 = (int) tileFrameX / 36; - if (num65 == 48) - { - glowTexture = TextureAssets.GlowMask[56].Value; - glowSourceRect = new Rectangle((int) tileFrameX % 36, (int) tileFrameY, tileWidth, tileHeight); - glowColor = this._martianGlow; - } - if (num65 != 49) - break; - glowTexture = TextureAssets.GlowMask[117].Value; - glowSourceRect = new Rectangle((int) tileFrameX % 36, (int) tileFrameY, tileWidth, tileHeight); - glowColor = this._meteorGlow; - break; - case 463: - glowTexture = TextureAssets.GlowMask[243].Value; - glowSourceRect = new Rectangle((int) tileFrameX, (int) tileFrameY + addFrY, tileWidth, tileHeight); - glowColor = new Color((int) sbyte.MaxValue, (int) sbyte.MaxValue, (int) sbyte.MaxValue, 0); - break; - case 564: - if (tileCache.frameX < (short) 36) - { - glowTexture = TextureAssets.GlowMask[267].Value; - glowSourceRect = new Rectangle((int) tileFrameX, (int) tileFrameY + addFrY, tileWidth, tileHeight); - glowColor = new Color(200, 200, 200, 0) * ((float) Main.mouseTextColor / (float) byte.MaxValue); - } - addFrY = 0; - break; - case 568: - glowTexture = TextureAssets.GlowMask[268].Value; - glowSourceRect = new Rectangle((int) tileFrameX, (int) tileFrameY + addFrY, tileWidth, tileHeight); - glowColor = Color.White; - break; - case 569: - glowTexture = TextureAssets.GlowMask[269].Value; - glowSourceRect = new Rectangle((int) tileFrameX, (int) tileFrameY + addFrY, tileWidth, tileHeight); - glowColor = Color.White; - break; - case 570: - glowTexture = TextureAssets.GlowMask[270].Value; - glowSourceRect = new Rectangle((int) tileFrameX, (int) tileFrameY + addFrY, tileWidth, tileHeight); - glowColor = Color.White; - break; - case 580: - glowTexture = TextureAssets.GlowMask[289].Value; - glowSourceRect = new Rectangle((int) tileFrameX, (int) tileFrameY + addFrY, tileWidth, tileHeight); - glowColor = new Color(225, 110, 110, 0); - break; - } - } - - private bool IsWindBlocked(int x, int y) - { - Tile tile = Main.tile[x, y]; - return tile == null || tile.wall > (ushort) 0 && !WallID.Sets.AllowsWind[(int) tile.wall] || (double) y > Main.worldSurface; - } - - private int GetWaterAnimalCageFrame(int x, int y, int tileFrameX, int tileFrameY) => (x - tileFrameX / 18) / 2 * ((y - tileFrameY / 18) / 3) % Main.cageFrames; - - private int GetSmallAnimalCageFrame(int x, int y, int tileFrameX, int tileFrameY) => (x - tileFrameX / 18) / 3 * ((y - tileFrameY / 18) / 3) % Main.cageFrames; - - private int GetBigAnimalCageFrame(int x, int y, int tileFrameX, int tileFrameY) => (x - tileFrameX / 18) / 6 * ((y - tileFrameY / 18) / 4) % Main.cageFrames; - - private void GetScreenDrawArea( - Vector2 screenPosition, - Vector2 offSet, - out int firstTileX, - out int lastTileX, - out int firstTileY, - out int lastTileY) - { - firstTileX = (int) (((double) screenPosition.X - (double) offSet.X) / 16.0 - 1.0); - lastTileX = (int) (((double) screenPosition.X + (double) Main.screenWidth + (double) offSet.X) / 16.0) + 2; - firstTileY = (int) (((double) screenPosition.Y - (double) offSet.Y) / 16.0 - 1.0); - lastTileY = (int) (((double) screenPosition.Y + (double) Main.screenHeight + (double) offSet.Y) / 16.0) + 5; - if (firstTileX < 4) - firstTileX = 4; - if (lastTileX > Main.maxTilesX - 4) - lastTileX = Main.maxTilesX - 4; - if (firstTileY < 4) - firstTileY = 4; - if (lastTileY > Main.maxTilesY - 4) - lastTileY = Main.maxTilesY - 4; - if (Main.sectionManager.FrameSectionsLeft <= 0) - return; - TimeLogger.DetailedDrawReset(); - WorldGen.SectionTileFrameWithCheck(firstTileX, firstTileY, lastTileX, lastTileY); - TimeLogger.DetailedDrawTime(5); - } - - public void ClearCachedTileDraws(bool solidLayer) - { - if (!solidLayer) - return; - this._displayDollTileEntityPositions.Clear(); - this._hatRackTileEntityPositions.Clear(); - this._vineRootsPositions.Clear(); - this._reverseVineRootsPositions.Clear(); - } - - private void AddSpecialLegacyPoint(Point p) => this.AddSpecialLegacyPoint(p.X, p.Y); - - private void AddSpecialLegacyPoint(int x, int y) - { - this._specialTileX[this._specialTilesCount] = x; - this._specialTileY[this._specialTilesCount] = y; - ++this._specialTilesCount; - } - - private void ClearLegacyCachedDraws() - { - this._chestPositions.Clear(); - this._trainingDummyTileEntityPositions.Clear(); - this._foodPlatterTileEntityPositions.Clear(); - this._itemFrameTileEntityPositions.Clear(); - this._weaponRackTileEntityPositions.Clear(); - this._specialTilesCount = 0; - } - - private Color DrawTiles_GetLightOverride( - int j, - int i, - Tile tileCache, - ushort typeCache, - short tileFrameX, - short tileFrameY, - Color tileLight) - { - if (tileCache.color() == (byte) 31) - return Color.White; - switch (typeCache) - { - case 61: - if (tileFrameX == (short) 144) - { - tileLight.A = tileLight.R = tileLight.G = tileLight.B = (byte) (245.0 - (double) Main.mouseTextColor * 1.5); - break; - } - break; - case 83: - int style = (int) tileFrameX / 18; - if (this.IsAlchemyPlantHarvestable(style)) - { - if (style == 5) - { - tileLight.A = (byte) ((uint) Main.mouseTextColor / 2U); - tileLight.G = Main.mouseTextColor; - tileLight.B = Main.mouseTextColor; - } - if (style == 6) - { - byte num1 = (byte) (((int) Main.mouseTextColor + (int) tileLight.G * 2) / 3); - byte num2 = (byte) (((int) Main.mouseTextColor + (int) tileLight.B * 2) / 3); - if ((int) num1 > (int) tileLight.G) - tileLight.G = num1; - if ((int) num2 > (int) tileLight.B) - { - tileLight.B = num2; - break; - } - break; - } - break; - } - break; - case 541: - return Color.White; - } - return tileLight; - } - - private void DrawTiles_EmitParticles( - int j, - int i, - Tile tileCache, - ushort typeCache, - short tileFrameX, - short tileFrameY, - Color tileLight) - { - switch (typeCache) - { - case 238: - if (this._rand.Next(10) == 0) - { - int index = Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, 168); - this._dust[index].noGravity = true; - this._dust[index].alpha = 200; - break; - } - break; - case 463: - if (tileFrameY == (short) 54 && tileFrameX == (short) 0) - { - for (int index = 0; index < 4; ++index) - { - if (this._rand.Next(2) != 0) - { - Dust dust = Dust.NewDustDirect(new Vector2((float) (i * 16 + 4), (float) (j * 16)), 36, 8, 16); - dust.noGravity = true; - dust.alpha = 140; - dust.fadeIn = 1.2f; - dust.velocity = Vector2.Zero; - } - } - } - if (tileFrameY == (short) 18 && (tileFrameX == (short) 0 || tileFrameX == (short) 36)) - { - for (int index = 0; index < 1; ++index) - { - if (this._rand.Next(13) == 0) - { - Dust dust = Dust.NewDustDirect(new Vector2((float) (i * 16), (float) (j * 16)), 8, 8, 274); - dust.position = new Vector2((float) (i * 16 + 8), (float) (j * 16 + 8)); - dust.position.X += tileFrameX == (short) 36 ? 4f : -4f; - dust.noGravity = true; - dust.alpha = 128; - dust.fadeIn = 1.2f; - dust.noLight = true; - dust.velocity = new Vector2(0.0f, this._rand.NextFloatDirection() * 1.2f); - } - } - break; - } - break; - default: - if (typeCache == (ushort) 497 && (int) tileCache.frameY / 40 == 31 && (int) tileCache.frameY % 40 == 0) - { - for (int index = 0; index < 1; ++index) - { - if (this._rand.Next(10) == 0) - { - Dust dust = Dust.NewDustDirect(new Vector2((float) (i * 16), (float) (j * 16 + 8)), 16, 12, 43); - dust.noGravity = true; - dust.alpha = 254; - dust.color = Color.White; - dust.scale = 0.7f; - dust.velocity = Vector2.Zero; - dust.noLight = true; - } - } - break; - } - break; - } - if (typeCache == (ushort) 139 && tileCache.frameX == (short) 36 && (int) tileCache.frameY % 36 == 0 && (int) Main.timeForVisualEffects % 7 == 0 && this._rand.Next(3) == 0) - { - int Type = this._rand.Next(570, 573); - Vector2 Position = new Vector2((float) (i * 16 + 8), (float) (j * 16 - 8)); - Vector2 Velocity = new Vector2(Main.WindForVisuals * 2f, -0.5f); - Velocity.X *= (float) (1.0 + (double) this._rand.Next(-50, 51) * 0.00999999977648258); - Velocity.Y *= (float) (1.0 + (double) this._rand.Next(-50, 51) * 0.00999999977648258); - if (Type == 572) - Position.X -= 8f; - if (Type == 571) - Position.X -= 4f; - Gore.NewGore(Position, Velocity, Type, 0.8f); - } - if (typeCache == (ushort) 244 && tileFrameX == (short) 18 && tileFrameY == (short) 18 && this._rand.Next(2) == 0) - { - if (this._rand.Next(500) == 0) - Gore.NewGore(new Vector2((float) (i * 16 + 8), (float) (j * 16 + 8)), new Vector2(), 415, (float) this._rand.Next(51, 101) * 0.01f); - else if (this._rand.Next(250) == 0) - Gore.NewGore(new Vector2((float) (i * 16 + 8), (float) (j * 16 + 8)), new Vector2(), 414, (float) this._rand.Next(51, 101) * 0.01f); - else if (this._rand.Next(80) == 0) - Gore.NewGore(new Vector2((float) (i * 16 + 8), (float) (j * 16 + 8)), new Vector2(), 413, (float) this._rand.Next(51, 101) * 0.01f); - else if (this._rand.Next(10) == 0) - Gore.NewGore(new Vector2((float) (i * 16 + 8), (float) (j * 16 + 8)), new Vector2(), 412, (float) this._rand.Next(51, 101) * 0.01f); - else if (this._rand.Next(3) == 0) - Gore.NewGore(new Vector2((float) (i * 16 + 8), (float) (j * 16 + 8)), new Vector2(), 411, (float) this._rand.Next(51, 101) * 0.01f); - } - if (typeCache == (ushort) 565 && tileFrameX == (short) 0 && tileFrameY == (short) 18 && this._rand.Next(3) == 0 && (Main.drawToScreen && this._rand.Next(4) == 0 || !Main.drawToScreen)) - { - Vector2 worldCoordinates = new Point(i, j).ToWorldCoordinates(); - int Type = 1202; - float Scale = (float) (8.0 + (double) Main.rand.NextFloat() * 1.60000002384186); - Vector2 vector2 = new Vector2(0.0f, -18f); - Gore.NewGorePerfect(worldCoordinates + vector2, (Main.rand.NextVector2Circular(0.7f, 0.25f) * 0.4f + Main.rand.NextVector2CircularEdge(1f, 0.4f) * 0.1f) * 4f, Type, Scale); - } - if (typeCache == (ushort) 165 && tileFrameX >= (short) 162 && tileFrameX <= (short) 214 && tileFrameY == (short) 72 && this._rand.Next(60) == 0) - { - int index = Dust.NewDust(new Vector2((float) (i * 16 + 2), (float) (j * 16 + 6)), 8, 4, 153); - this._dust[index].scale -= (float) this._rand.Next(3) * 0.1f; - this._dust[index].velocity.Y = 0.0f; - this._dust[index].velocity.X *= 0.05f; - this._dust[index].alpha = 100; - } - if (typeCache == (ushort) 42 && tileFrameX == (short) 0) - { - int num1 = (int) tileFrameY / 36; - int num2 = (int) tileFrameY / 18 % 2; - if (num1 == 7 && num2 == 1) - { - if (this._rand.Next(50) == 0) - this._dust[Dust.NewDust(new Vector2((float) (i * 16 + 4), (float) (j * 16 + 4)), 8, 8, 58, Alpha: 150)].velocity *= 0.5f; - if (this._rand.Next(100) == 0) - { - int index = Gore.NewGore(new Vector2((float) (i * 16 - 2), (float) (j * 16 - 4)), new Vector2(), this._rand.Next(16, 18)); - this._gore[index].scale *= 0.7f; - this._gore[index].velocity *= 0.25f; - } - } - else if (num1 == 29 && num2 == 1 && this._rand.Next(40) == 0) - { - int index = Dust.NewDust(new Vector2((float) (i * 16 + 4), (float) (j * 16)), 8, 8, 59, Alpha: 100); - if (this._rand.Next(3) != 0) - this._dust[index].noGravity = true; - this._dust[index].velocity *= 0.3f; - this._dust[index].velocity.Y -= 1.5f; - } - } - if (typeCache == (ushort) 215 && tileFrameY < (short) 36 && this._rand.Next(3) == 0 && (Main.drawToScreen && this._rand.Next(4) == 0 || !Main.drawToScreen) && tileFrameY == (short) 0) - { - int index = Dust.NewDust(new Vector2((float) (i * 16 + 2), (float) (j * 16 - 4)), 4, 8, 31, Alpha: 100); - if (tileFrameX == (short) 0) - this._dust[index].position.X += (float) this._rand.Next(8); - if (tileFrameX == (short) 36) - this._dust[index].position.X -= (float) this._rand.Next(8); - this._dust[index].alpha += this._rand.Next(100); - this._dust[index].velocity *= 0.2f; - this._dust[index].velocity.Y -= (float) (0.5 + (double) this._rand.Next(10) * 0.100000001490116); - this._dust[index].fadeIn = (float) (0.5 + (double) this._rand.Next(10) * 0.100000001490116); - } - if (typeCache == (ushort) 592 && tileFrameY == (short) 18 && this._rand.Next(3) == 0 && (Main.drawToScreen && this._rand.Next(6) == 0 || !Main.drawToScreen)) - { - int index = Dust.NewDust(new Vector2((float) (i * 16 + 2), (float) (j * 16 + 4)), 4, 8, 31, Alpha: 100); - if (tileFrameX == (short) 0) - this._dust[index].position.X += (float) this._rand.Next(8); - if (tileFrameX == (short) 36) - this._dust[index].position.X -= (float) this._rand.Next(8); - this._dust[index].alpha += this._rand.Next(100); - this._dust[index].velocity *= 0.2f; - this._dust[index].velocity.Y -= (float) (0.5 + (double) this._rand.Next(10) * 0.100000001490116); - this._dust[index].fadeIn = (float) (0.5 + (double) this._rand.Next(10) * 0.100000001490116); - } - if (typeCache == (ushort) 4 && this._rand.Next(40) == 0 && tileFrameX < (short) 66) - { - int num = (int) tileFrameY / 22; - int Type; - switch (num) - { - case 0: - Type = 6; - break; - case 8: - Type = 75; - break; - case 9: - Type = 135; - break; - case 10: - Type = 158; - break; - case 11: - Type = 169; - break; - case 12: - Type = 156; - break; - case 13: - Type = 234; - break; - case 14: - Type = 66; - break; - case 15: - Type = 242; - break; - case 16: - Type = 293; - break; - case 17: - Type = 294; - break; - default: - Type = 58 + num; - break; - } - int index; - switch (tileFrameX) - { - case 22: - index = Dust.NewDust(new Vector2((float) (i * 16 + 6), (float) (j * 16)), 4, 4, Type, Alpha: 100); - break; - case 44: - index = Dust.NewDust(new Vector2((float) (i * 16 + 2), (float) (j * 16)), 4, 4, Type, Alpha: 100); - break; - default: - index = Dust.NewDust(new Vector2((float) (i * 16 + 4), (float) (j * 16)), 4, 4, Type, Alpha: 100); - break; - } - if (this._rand.Next(3) != 0) - this._dust[index].noGravity = true; - this._dust[index].velocity *= 0.3f; - this._dust[index].velocity.Y -= 1.5f; - if (Type == 66) - { - this._dust[index].color = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); - this._dust[index].noGravity = true; - } - } - if (typeCache == (ushort) 93 && this._rand.Next(40) == 0 && tileFrameX == (short) 0) - { - int num = (int) tileFrameY / 54; - if ((int) tileFrameY / 18 % 3 == 0) - { - int Type; - switch (num) - { - case 0: - case 6: - case 7: - case 8: - case 10: - case 14: - case 15: - case 16: - Type = 6; - break; - case 20: - Type = 59; - break; - default: - Type = -1; - break; - } - if (Type != -1) - { - int index = Dust.NewDust(new Vector2((float) (i * 16 + 4), (float) (j * 16 + 2)), 4, 4, Type, Alpha: 100); - if (this._rand.Next(3) != 0) - this._dust[index].noGravity = true; - this._dust[index].velocity *= 0.3f; - this._dust[index].velocity.Y -= 1.5f; - } - } - } - if (typeCache == (ushort) 100 && this._rand.Next(40) == 0 && tileFrameX < (short) 36) - { - int num = (int) tileFrameY / 36; - if ((int) tileFrameY / 18 % 2 == 0) - { - int Type; - switch (num) - { - case 0: - case 5: - case 7: - case 8: - case 10: - case 12: - case 14: - case 15: - case 16: - Type = 6; - break; - case 20: - Type = 59; - break; - default: - Type = -1; - break; - } - if (Type != -1) - { - int index = Dust.NewDust(tileFrameX != (short) 0 ? (this._rand.Next(3) != 0 ? new Vector2((float) (i * 16), (float) (j * 16 + 2)) : new Vector2((float) (i * 16 + 6), (float) (j * 16 + 2))) : (this._rand.Next(3) != 0 ? new Vector2((float) (i * 16 + 14), (float) (j * 16 + 2)) : new Vector2((float) (i * 16 + 4), (float) (j * 16 + 2))), 4, 4, Type, Alpha: 100); - if (this._rand.Next(3) != 0) - this._dust[index].noGravity = true; - this._dust[index].velocity *= 0.3f; - this._dust[index].velocity.Y -= 1.5f; - } - } - } - if (typeCache == (ushort) 98 && this._rand.Next(40) == 0 && tileFrameY == (short) 0 && tileFrameX == (short) 0) - { - int index = Dust.NewDust(new Vector2((float) (i * 16 + 12), (float) (j * 16 + 2)), 4, 4, 6, Alpha: 100); - if (this._rand.Next(3) != 0) - this._dust[index].noGravity = true; - this._dust[index].velocity *= 0.3f; - this._dust[index].velocity.Y -= 1.5f; - } - if (typeCache == (ushort) 49 && tileFrameX == (short) 0 && this._rand.Next(2) == 0) - { - int index = Dust.NewDust(new Vector2((float) (i * 16 + 4), (float) (j * 16 - 4)), 4, 4, 172, Alpha: 100); - if (this._rand.Next(3) == 0) - { - this._dust[index].scale = 0.5f; - } - else - { - this._dust[index].scale = 0.9f; - this._dust[index].noGravity = true; - } - this._dust[index].velocity *= 0.3f; - this._dust[index].velocity.Y -= 1.5f; - } - if (typeCache == (ushort) 372 && tileFrameX == (short) 0 && this._rand.Next(2) == 0) - { - int index = Dust.NewDust(new Vector2((float) (i * 16 + 4), (float) (j * 16 - 4)), 4, 4, 242, Alpha: 100); - if (this._rand.Next(3) == 0) - { - this._dust[index].scale = 0.5f; - } - else - { - this._dust[index].scale = 0.9f; - this._dust[index].noGravity = true; - } - this._dust[index].velocity *= 0.3f; - this._dust[index].velocity.Y -= 1.5f; - } - if (typeCache == (ushort) 34 && this._rand.Next(40) == 0 && tileFrameX < (short) 54) - { - int num3 = (int) tileFrameY / 54; - int num4 = (int) tileFrameX / 18 % 3; - if ((int) tileFrameY / 18 % 3 == 1 && num4 != 1) - { - int Type; - switch (num3) - { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 12: - case 13: - case 16: - case 19: - case 21: - Type = 6; - break; - case 25: - Type = 59; - break; - default: - Type = -1; - break; - } - if (Type != -1) - { - int index = Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16 + 2)), 14, 6, Type, Alpha: 100); - if (this._rand.Next(3) != 0) - this._dust[index].noGravity = true; - this._dust[index].velocity *= 0.3f; - this._dust[index].velocity.Y -= 1.5f; - } - } - } - int maxValue = this._leafFrequency / 4; - if (typeCache == (ushort) 192 && this._rand.Next(maxValue) == 0) - this.EmitLivingTreeLeaf(i, j, 910); - if (typeCache == (ushort) 384 && this._rand.Next(maxValue) == 0) - this.EmitLivingTreeLeaf(i, j, 914); - if (typeCache == (ushort) 83) - { - int style = (int) tileFrameX / 18; - if (this.IsAlchemyPlantHarvestable(style)) - this.EmitAlchemyHerbParticles(j, i, style); - } - if (typeCache == (ushort) 22 && this._rand.Next(400) == 0) - Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, 14); - else if ((typeCache == (ushort) 23 || typeCache == (ushort) 24 || typeCache == (ushort) 32) && this._rand.Next(500) == 0) - Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, 14); - else if (typeCache == (ushort) 25 && this._rand.Next(700) == 0) - Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, 14); - else if (typeCache == (ushort) 112 && this._rand.Next(700) == 0) - Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, 14); - else if (typeCache == (ushort) 31 && this._rand.Next(20) == 0) - { - if (tileFrameX >= (short) 36) - { - int index = Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, 5, Alpha: 100); - this._dust[index].velocity.Y = 0.0f; - this._dust[index].velocity.X *= 0.3f; - } - else - Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, 14, Alpha: 100); - } - else if (typeCache == (ushort) 26 && this._rand.Next(20) == 0) - { - if (tileFrameX >= (short) 54) - { - int index = Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, 5, Alpha: 100); - this._dust[index].scale = 1.5f; - this._dust[index].noGravity = true; - this._dust[index].velocity *= 0.75f; - } - else - Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, 14, Alpha: 100); - } - else if ((typeCache == (ushort) 71 || typeCache == (ushort) 72) && this._rand.Next(500) == 0) - Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, 41, Alpha: 250, Scale: 0.8f); - else if ((typeCache == (ushort) 17 || typeCache == (ushort) 77 || typeCache == (ushort) 133) && this._rand.Next(40) == 0) - { - if (!(tileFrameX == (short) 18 & tileFrameY == (short) 18)) - return; - int index = Dust.NewDust(new Vector2((float) (i * 16 - 4), (float) (j * 16 - 6)), 8, 6, 6, Alpha: 100); - if (this._rand.Next(3) == 0) - return; - this._dust[index].noGravity = true; - } - else if (typeCache == (ushort) 405 && this._rand.Next(20) == 0) - { - if (!(tileFrameX == (short) 18 & tileFrameY == (short) 18)) - return; - int index = Dust.NewDust(new Vector2((float) (i * 16 - 4), (float) (j * 16 - 6)), 24, 10, 6, Alpha: 100); - if (this._rand.Next(5) == 0) - return; - this._dust[index].noGravity = true; - } - else if (typeCache == (ushort) 452 && tileFrameY == (short) 0 && tileFrameX == (short) 0 && this._rand.Next(3) == 0) - { - Vector2 Position = new Vector2((float) (i * 16 + 16), (float) (j * 16 + 8)); - Vector2 Velocity = new Vector2(0.0f, 0.0f); - if ((double) Main.WindForVisuals < 0.0) - Velocity.X = -Main.WindForVisuals; - int Type = 907 + Main.tileFrame[(int) typeCache] / 5; - if (this._rand.Next(2) != 0) - return; - Gore.NewGore(Position, Velocity, Type, (float) ((double) this._rand.NextFloat() * 0.400000005960464 + 0.400000005960464)); - } - else if (typeCache == (ushort) 406 && tileFrameY == (short) 54 && tileFrameX == (short) 0 && this._rand.Next(3) == 0) - { - Vector2 Position = new Vector2((float) (i * 16 + 16), (float) (j * 16 + 8)); - Vector2 Velocity = new Vector2(0.0f, 0.0f); - if ((double) Main.WindForVisuals < 0.0) - Velocity.X = -Main.WindForVisuals; - int Type = this._rand.Next(825, 828); - if (this._rand.Next(4) == 0) - Gore.NewGore(Position, Velocity, Type, (float) ((double) this._rand.NextFloat() * 0.200000002980232 + 0.200000002980232)); - else if (this._rand.Next(2) == 0) - Gore.NewGore(Position, Velocity, Type, (float) ((double) this._rand.NextFloat() * 0.300000011920929 + 0.300000011920929)); - else - Gore.NewGore(Position, Velocity, Type, (float) ((double) this._rand.NextFloat() * 0.400000005960464 + 0.400000005960464)); - } - else if (typeCache == (ushort) 37 && this._rand.Next(250) == 0) - { - int index = Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, 6, Scale: ((float) this._rand.Next(3))); - if ((double) this._dust[index].scale <= 1.0) - return; - this._dust[index].noGravity = true; - } - else if ((typeCache == (ushort) 58 || typeCache == (ushort) 76) && this._rand.Next(250) == 0) - { - int index = Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, 6, Scale: ((float) this._rand.Next(3))); - if ((double) this._dust[index].scale > 1.0) - this._dust[index].noGravity = true; - this._dust[index].noLight = true; - } - else if (typeCache == (ushort) 61) - { - if (tileFrameX != (short) 144 || this._rand.Next(60) != 0) - return; - this._dust[Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, 44, Alpha: 250, Scale: 0.4f)].fadeIn = 0.7f; - } - else - { - if (Main.tileShine[(int) typeCache] <= 0 || tileLight.R <= (byte) 20 && tileLight.B <= (byte) 20 && tileLight.G <= (byte) 20) - return; - int num5 = (int) tileLight.R; - if ((int) tileLight.G > num5) - num5 = (int) tileLight.G; - if ((int) tileLight.B > num5) - num5 = (int) tileLight.B; - int num6 = num5 / 30; - if (this._rand.Next(Main.tileShine[(int) typeCache]) >= num6 || (typeCache == (ushort) 21 || typeCache == (ushort) 441) && (tileFrameX < (short) 36 || tileFrameX >= (short) 180) && (tileFrameX < (short) 396 || tileFrameX > (short) 409) || (typeCache == (ushort) 467 || typeCache == (ushort) 468) && (tileFrameX < (short) 144 || tileFrameX >= (short) 180)) - return; - Color newColor = Color.White; - if (typeCache == (ushort) 178) - { - switch ((int) tileFrameX / 18) - { - case 0: - newColor = new Color((int) byte.MaxValue, 0, (int) byte.MaxValue, (int) byte.MaxValue); - break; - case 1: - newColor = new Color((int) byte.MaxValue, (int) byte.MaxValue, 0, (int) byte.MaxValue); - break; - case 2: - newColor = new Color(0, 0, (int) byte.MaxValue, (int) byte.MaxValue); - break; - case 3: - newColor = new Color(0, (int) byte.MaxValue, 0, (int) byte.MaxValue); - break; - case 4: - newColor = new Color((int) byte.MaxValue, 0, 0, (int) byte.MaxValue); - break; - case 5: - newColor = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); - break; - case 6: - newColor = new Color((int) byte.MaxValue, (int) byte.MaxValue, 0, (int) byte.MaxValue); - break; - } - this._dust[Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, 43, Alpha: 254, newColor: newColor, Scale: 0.5f)].velocity *= 0.0f; - } - else - { - if (typeCache == (ushort) 63) - newColor = new Color(0, 0, (int) byte.MaxValue, (int) byte.MaxValue); - if (typeCache == (ushort) 64) - newColor = new Color((int) byte.MaxValue, 0, 0, (int) byte.MaxValue); - if (typeCache == (ushort) 65) - newColor = new Color(0, (int) byte.MaxValue, 0, (int) byte.MaxValue); - if (typeCache == (ushort) 66) - newColor = new Color((int) byte.MaxValue, (int) byte.MaxValue, 0, (int) byte.MaxValue); - if (typeCache == (ushort) 67) - newColor = new Color((int) byte.MaxValue, 0, (int) byte.MaxValue, (int) byte.MaxValue); - if (typeCache == (ushort) 68) - newColor = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); - if (typeCache == (ushort) 12) - newColor = new Color((int) byte.MaxValue, 0, 0, (int) byte.MaxValue); - if (typeCache == (ushort) 204) - newColor = new Color((int) byte.MaxValue, 0, 0, (int) byte.MaxValue); - if (typeCache == (ushort) 211) - newColor = new Color(50, (int) byte.MaxValue, 100, (int) byte.MaxValue); - this._dust[Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, 43, Alpha: 254, newColor: newColor, Scale: 0.5f)].velocity *= 0.0f; - } - } - } - - private void EmitLivingTreeLeaf(int i, int j, int leafGoreType) - { - this.EmitLivingTreeLeaf_Below(i, j, leafGoreType); - if (this._rand.Next(2) != 0) - return; - this.EmitLivingTreeLeaf_Sideways(i, j, leafGoreType); - } - - private void EmitLivingTreeLeaf_Below(int x, int y, int leafGoreType) - { - Tile testTile = Main.tile[x, y + 1]; - if (WorldGen.SolidTile(testTile) || testTile.liquid > (byte) 0) - return; - float windForVisuals = Main.WindForVisuals; - if ((double) windForVisuals < -0.200000002980232 && (WorldGen.SolidTile(Main.tile[x - 1, y + 1]) || WorldGen.SolidTile(Main.tile[x - 2, y + 1])) || (double) windForVisuals > 0.200000002980232 && (WorldGen.SolidTile(Main.tile[x + 1, y + 1]) || WorldGen.SolidTile(Main.tile[x + 2, y + 1]))) - return; - Gore.NewGorePerfect(new Vector2((float) (x * 16), (float) (y * 16 + 16)), Vector2.Zero, leafGoreType).Frame.CurrentColumn = Main.tile[x, y].color(); - } - - private void EmitLivingTreeLeaf_Sideways(int x, int y, int leafGoreType) - { - int num1 = 0; - if ((double) Main.WindForVisuals > 0.200000002980232) - num1 = 1; - else if ((double) Main.WindForVisuals < -0.200000002980232) - num1 = -1; - Tile testTile = Main.tile[x + num1, y]; - if (WorldGen.SolidTile(testTile) || testTile.liquid > (byte) 0) - return; - int num2 = 0; - if (num1 == -1) - num2 = -10; - Gore.NewGorePerfect(new Vector2((float) (x * 16 + 8 + 4 * num1 + num2), (float) (y * 16 + 8)), Vector2.Zero, leafGoreType).Frame.CurrentColumn = Main.tile[x, y].color(); - } - - private void EmitLiquidDrops(int j, int i, Tile tileCache, ushort typeCache) - { - int num1 = 60; - switch (typeCache) - { - case 374: - num1 = 120; - break; - case 375: - num1 = 180; - break; - case 461: - num1 = 180; - break; - } - if (this._rand.Next(num1 * 2) != 0 || tileCache.liquid != (byte) 0) - return; - Rectangle rectangle1 = new Rectangle(i * 16, j * 16, 16, 16); - rectangle1.X -= 34; - rectangle1.Width += 68; - rectangle1.Y -= 100; - rectangle1.Height = 400; - bool flag = true; - for (int index = 0; index < 600; ++index) - { - if (this._gore[index].active && (this._gore[index].type >= 706 && this._gore[index].type <= 717 || this._gore[index].type == 943 || this._gore[index].type == 1147 || this._gore[index].type >= 1160 && this._gore[index].type <= 1162)) - { - Rectangle rectangle2 = new Rectangle((int) this._gore[index].position.X, (int) this._gore[index].position.Y, 16, 16); - if (rectangle1.Intersects(rectangle2)) - flag = false; - } - } - if (!flag) - return; - Vector2 Position = new Vector2((float) (i * 16), (float) (j * 16)); - int num2 = 706; - if (Main.waterStyle == 12) - num2 = 1147; - else if (Main.waterStyle > 1) - num2 = 706 + Main.waterStyle - 1; - if (typeCache == (ushort) 374) - num2 = 716; - if (typeCache == (ushort) 375) - num2 = 717; - if (typeCache == (ushort) 461) - { - num2 = 943; - if (Main.player[Main.myPlayer].ZoneCorrupt) - num2 = 1160; - if (Main.player[Main.myPlayer].ZoneCrimson) - num2 = 1161; - if (Main.player[Main.myPlayer].ZoneHallow) - num2 = 1162; - } - Vector2 Velocity = new Vector2(); - int Type = num2; - this._gore[Gore.NewGore(Position, Velocity, Type)].velocity *= 0.0f; - } - - private float GetWindCycle(int x, int y, double windCounter) - { - if (!Main.SettingsEnabled_TilesSwayInWind) - return 0.0f; - float num1 = (float) ((double) x * 0.5 + (double) (y / 100) * 0.5); - float num2 = (float) Math.Cos(windCounter * 6.28318548202515 + (double) num1) * 0.5f; - return (double) y < Main.worldSurface ? (num2 + Main.WindForVisuals) * Utils.GetLerpValue(0.08f, 0.18f, Math.Abs(Main.WindForVisuals), true) : 0.0f; - } - - private bool ShouldSwayInWind(int x, int y, Tile tileCache) => Main.SettingsEnabled_TilesSwayInWind && TileID.Sets.SwaysInWindBasic[(int) tileCache.type] && (tileCache.type != (ushort) 227 || tileCache.frameX != (short) 204 && tileCache.frameX != (short) 238 && tileCache.frameX != (short) 408 && tileCache.frameX != (short) 442 && tileCache.frameX != (short) 476); - - private void UpdateLeafFrequency() - { - float num = Math.Abs(Main.WindForVisuals); - this._leafFrequency = (double) num > 0.100000001490116 ? ((double) num > 0.200000002980232 ? ((double) num > 0.300000011920929 ? ((double) num > 0.400000005960464 ? ((double) num > 0.5 ? ((double) num > 0.600000023841858 ? ((double) num > 0.699999988079071 ? ((double) num > 0.800000011920929 ? ((double) num > 0.899999976158142 ? ((double) num > 1.0 ? ((double) num > 1.10000002384186 ? 10 : 20) : 30) : 40) : 50) : 75) : 130) : 200) : 300) : 450) : 1000) : 2000; - this._leafFrequency *= 7; - } - - private void EnsureWindGridSize() - { - Vector2 unscaledPosition = Main.Camera.UnscaledPosition; - Vector2 offSet = new Vector2((float) Main.offScreenRange, (float) Main.offScreenRange); - if (Main.drawToScreen) - offSet = Vector2.Zero; - int firstTileX; - int lastTileX; - int firstTileY; - int lastTileY; - this.GetScreenDrawArea(unscaledPosition, offSet, out firstTileX, out lastTileX, out firstTileY, out lastTileY); - this._windGrid.SetSize(lastTileX - firstTileX, lastTileY - firstTileY); - } - - private void EmitTreeLeaves(int tilePosX, int tilePosY, int grassPosX, int grassPosY) - { - if (!this._isActiveAndNotPaused) - return; - int treeHeight = grassPosY - tilePosY; - Tile topTile = Main.tile[tilePosX, tilePosY]; - if (topTile.liquid > (byte) 0) - return; - int passStyle; - WorldGen.GetTreeLeaf(tilePosX, topTile, Main.tile[grassPosX, grassPosY], ref treeHeight, out int _, out passStyle); - if (passStyle == -1 || passStyle == 912 || passStyle == 913) - return; - bool flag1 = passStyle >= 917 && passStyle <= 925 || passStyle >= 1113 && passStyle <= 1121; - int maxValue = this._leafFrequency; - bool flag2 = (uint) (tilePosX - grassPosX) > 0U; - if (flag1) - maxValue /= 2; - if ((double) tilePosY > Main.worldSurface) - maxValue = 10000; - if (flag2) - maxValue *= 3; - if (this._rand.Next(maxValue) != 0) - return; - int num1 = 2; - Vector2 vector2 = new Vector2((float) (tilePosX * 16 + 8), (float) (tilePosY * 16 + 8)); - if (flag2) - { - int num2 = tilePosX - grassPosX; - vector2.X += (float) (num2 * 12); - int num3 = 0; - if (topTile.frameY == (short) 220) - num3 = 1; - else if (topTile.frameY == (short) 242) - num3 = 2; - if (topTile.frameX == (short) 66) - { - switch (num3) - { - case 0: - vector2 += new Vector2(0.0f, -6f); - break; - case 1: - vector2 += new Vector2(0.0f, -6f); - break; - case 2: - vector2 += new Vector2(0.0f, 8f); - break; - } - } - else - { - switch (num3) - { - case 0: - vector2 += new Vector2(0.0f, 4f); - break; - case 1: - vector2 += new Vector2(2f, -6f); - break; - case 2: - vector2 += new Vector2(6f, -6f); - break; - } - } - } - else - { - vector2 += new Vector2(-16f, -16f); - if (flag1) - vector2.Y -= (float) (Main.rand.Next(0, 28) * 4); - } - if (WorldGen.SolidTile(vector2.ToTileCoordinates())) - return; - Gore.NewGoreDirect(vector2, Utils.RandomVector2(Main.rand, (float) -num1, (float) num1), passStyle, (float) (0.699999988079071 + (double) Main.rand.NextFloat() * 0.600000023841858)).Frame.CurrentColumn = Main.tile[tilePosX, tilePosY].color(); - } - - private void DrawSpecialTilesLegacy(Vector2 screenPosition, Vector2 offSet) - { - for (int index1 = 0; index1 < this._specialTilesCount; ++index1) - { - int index2 = this._specialTileX[index1]; - int index3 = this._specialTileY[index1]; - Tile tile = Main.tile[index2, index3]; - ushort type1 = tile.type; - short frameX1 = tile.frameX; - short frameY1 = tile.frameY; - if (type1 == (ushort) 237) - Main.spriteBatch.Draw(TextureAssets.SunOrb.Value, new Vector2((float) (index2 * 16 - (int) screenPosition.X) + 8f, (float) (index3 * 16 - (int) screenPosition.Y - 36)) + offSet, new Rectangle?(new Rectangle(0, 0, TextureAssets.SunOrb.Width(), TextureAssets.SunOrb.Height())), new Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, 0), Main.sunCircle, new Vector2((float) (TextureAssets.SunOrb.Width() / 2), (float) (TextureAssets.SunOrb.Height() / 2)), 1f, SpriteEffects.None, 0.0f); - if (type1 == (ushort) 334 && frameX1 >= (short) 5000) - { - int num1 = (int) frameY1 / 18; - int num2 = (int) frameX1; - int num3 = 0; - int type2 = num2 % 5000 - 100; - for (; num2 >= 5000; num2 -= 5000) - ++num3; - int frameX2 = (int) Main.tile[index2 + 1, index3].frameX; - int pre = frameX2 < 25000 ? frameX2 - 10000 : frameX2 - 25000; - Item obj = new Item(); - obj.netDefaults(type2); - obj.Prefix(pre); - Main.instance.LoadItem(obj.type); - Texture2D texture2D = TextureAssets.Item[obj.type].Value; - Rectangle rectangle = Main.itemAnimations[obj.type] == null ? texture2D.Frame() : Main.itemAnimations[obj.type].GetFrame(texture2D); - int width = rectangle.Width; - int height = rectangle.Height; - float num4 = 1f; - if (width > 40 || height > 40) - num4 = width <= height ? 40f / (float) height : 40f / (float) width; - float scale = num4 * obj.scale; - SpriteEffects effects = SpriteEffects.None; - if (num3 >= 3) - effects = SpriteEffects.FlipHorizontally; - Color color = Lighting.GetColor(index2, index3); - Main.spriteBatch.Draw(texture2D, new Vector2((float) (index2 * 16 - (int) screenPosition.X + 24), (float) (index3 * 16 - (int) screenPosition.Y + 8)) + offSet, new Rectangle?(rectangle), Lighting.GetColor(index2, index3), 0.0f, new Vector2((float) (width / 2), (float) (height / 2)), scale, effects, 0.0f); - if (obj.color != new Color()) - Main.spriteBatch.Draw(texture2D, new Vector2((float) (index2 * 16 - (int) screenPosition.X + 24), (float) (index3 * 16 - (int) screenPosition.Y + 8)) + offSet, new Rectangle?(rectangle), obj.GetColor(color), 0.0f, new Vector2((float) (width / 2), (float) (height / 2)), scale, effects, 0.0f); - } - if (type1 == (ushort) 395) - { - Item theItem = ((TEItemFrame) TileEntity.ByPosition[new Point16(index2, index3)]).item; - Vector2 screenPositionForItemCenter = new Vector2((float) (index2 * 16 - (int) screenPosition.X + 16), (float) (index3 * 16 - (int) screenPosition.Y + 16)) + offSet; - Color color = Lighting.GetColor(index2, index3); - Main.DrawItemIcon(Main.spriteBatch, theItem, screenPositionForItemCenter, color, 20f); - } - if (type1 == (ushort) 520) - { - Item obj = ((TEFoodPlatter) TileEntity.ByPosition[new Point16(index2, index3)]).item; - if (!obj.IsAir) - { - Main.instance.LoadItem(obj.type); - Texture2D texture2D = TextureAssets.Item[obj.type].Value; - Rectangle rectangle = !ItemID.Sets.IsFood[obj.type] ? texture2D.Frame() : texture2D.Frame(verticalFrames: 3, frameY: 2); - int width = rectangle.Width; - int height = rectangle.Height; - float num = 1f; - SpriteEffects effects = tile.frameX == (short) 0 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Color color = Lighting.GetColor(index2, index3); - Color currentColor = color; - float scale1 = 1f; - ItemSlot.GetItemLight(ref currentColor, ref scale1, obj); - float scale2 = num * scale1; - Vector2 position = new Vector2((float) (index2 * 16 - (int) screenPosition.X + 8), (float) (index3 * 16 - (int) screenPosition.Y + 16)) + offSet; - position.Y += 2f; - Vector2 origin = new Vector2((float) (width / 2), (float) height); - Main.spriteBatch.Draw(texture2D, position, new Rectangle?(rectangle), currentColor, 0.0f, origin, scale2, effects, 0.0f); - if (obj.color != new Color()) - Main.spriteBatch.Draw(texture2D, position, new Rectangle?(rectangle), obj.GetColor(color), 0.0f, origin, scale2, effects, 0.0f); - } - } - if (type1 == (ushort) 471) - { - Item obj = (TileEntity.ByPosition[new Point16(index2, index3)] as TEWeaponsRack).item; - Main.instance.LoadItem(obj.type); - Texture2D texture2D = TextureAssets.Item[obj.type].Value; - Rectangle rectangle = Main.itemAnimations[obj.type] == null ? texture2D.Frame() : Main.itemAnimations[obj.type].GetFrame(texture2D); - int width = rectangle.Width; - int height = rectangle.Height; - float num5 = 1f; - float num6 = 40f; - if ((double) width > (double) num6 || (double) height > (double) num6) - num5 = width <= height ? num6 / (float) height : num6 / (float) width; - float num7 = num5 * obj.scale; - SpriteEffects effects = SpriteEffects.FlipHorizontally; - if (tile.frameX < (short) 54) - effects = SpriteEffects.None; - Color color = Lighting.GetColor(index2, index3); - Color currentColor = color; - float scale3 = 1f; - ItemSlot.GetItemLight(ref currentColor, ref scale3, obj); - float scale4 = num7 * scale3; - Main.spriteBatch.Draw(texture2D, new Vector2((float) (index2 * 16 - (int) screenPosition.X + 24), (float) (index3 * 16 - (int) screenPosition.Y + 24)) + offSet, new Rectangle?(rectangle), currentColor, 0.0f, new Vector2((float) (width / 2), (float) (height / 2)), scale4, effects, 0.0f); - if (obj.color != new Color()) - Main.spriteBatch.Draw(texture2D, new Vector2((float) (index2 * 16 - (int) screenPosition.X + 24), (float) (index3 * 16 - (int) screenPosition.Y + 24)) + offSet, new Rectangle?(rectangle), obj.GetColor(color), 0.0f, new Vector2((float) (width / 2), (float) (height / 2)), scale4, effects, 0.0f); - } - if (type1 == (ushort) 412) - { - Texture2D texture2D = TextureAssets.GlowMask[202].Value; - int frameY2 = Main.tileFrame[(int) type1] / 60; - int frameY3 = (frameY2 + 1) % 4; - float num = (float) (Main.tileFrame[(int) type1] % 60) / 60f; - Color color = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); - Main.spriteBatch.Draw(texture2D, new Vector2((float) (index2 * 16 - (int) screenPosition.X), (float) (index3 * 16 - (int) screenPosition.Y + 10)) + offSet, new Rectangle?(texture2D.Frame(verticalFrames: 4, frameY: frameY2)), color * (1f - num), 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(texture2D, new Vector2((float) (index2 * 16 - (int) screenPosition.X), (float) (index3 * 16 - (int) screenPosition.Y + 10)) + offSet, new Rectangle?(texture2D.Frame(verticalFrames: 4, frameY: frameY3)), color * num, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - } - if (type1 == (ushort) 620) - { - Texture2D texture = TextureAssets.Extra[202].Value; - double num8 = (double) (Main.tileFrame[(int) type1] % 60) / 60.0; - int num9 = 2; - Main.critterCage = true; - int waterAnimalCageFrame = this.GetWaterAnimalCageFrame(index2, index3, (int) frameX1, (int) frameY1); - int index4 = 8; - int num10 = Main.butterflyCageFrame[index4, waterAnimalCageFrame]; - int num11 = 6; - float num12 = 1f; - Rectangle rectangle = new Rectangle(0, 34 * num10, 32, 32); - Vector2 position1 = new Vector2((float) (index2 * 16 - (int) screenPosition.X), (float) (index3 * 16 - (int) screenPosition.Y + num9)) + offSet; - Main.spriteBatch.Draw(texture, position1, new Rectangle?(rectangle), new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue), 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - for (int index5 = 0; index5 < num11; ++index5) - { - Color color = new Color((int) sbyte.MaxValue, (int) sbyte.MaxValue, (int) sbyte.MaxValue, 0).MultiplyRGBA(Main.hslToRgb((float) (((double) Main.GlobalTimeWrappedHourly + (double) index5 / (double) num11) % 1.0), 1f, 0.5f)) * (float) (1.0 - (double) num12 * 0.5); - color.A = (byte) 0; - int num13 = 2; - Vector2 position2 = position1 + ((float) ((double) index5 / (double) num11 * 6.28318548202515)).ToRotationVector2() * (float) ((double) num13 * (double) num12 + 2.0); - Main.spriteBatch.Draw(texture, position2, new Rectangle?(rectangle), color, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - } - Main.spriteBatch.Draw(texture, position1, new Rectangle?(rectangle), new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * 0.1f, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - } - } - } - - private void DrawEntities_DisplayDolls() - { - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.Transform); - foreach (KeyValuePair tileEntityPosition in this._displayDollTileEntityPositions) - { - TileEntity tileEntity; - if (tileEntityPosition.Value != -1 && TileEntity.ByPosition.TryGetValue(new Point16(tileEntityPosition.Key.X, tileEntityPosition.Key.Y), out tileEntity)) - (tileEntity as TEDisplayDoll).Draw(tileEntityPosition.Key.X, tileEntityPosition.Key.Y); - } - Main.spriteBatch.End(); - } - - private void DrawEntities_HatRacks() - { - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.Transform); - foreach (KeyValuePair tileEntityPosition in this._hatRackTileEntityPositions) - { - TileEntity tileEntity; - if (tileEntityPosition.Value != -1 && TileEntity.ByPosition.TryGetValue(new Point16(tileEntityPosition.Key.X, tileEntityPosition.Key.Y), out tileEntity)) - (tileEntity as TEHatRack).Draw(tileEntityPosition.Key.X, tileEntityPosition.Key.Y); - } - Main.spriteBatch.End(); - } - - private void DrawTrees() - { - Vector2 unscaledPosition = Main.Camera.UnscaledPosition; - Vector2 zero = Vector2.Zero; - int index1 = 0; - int num1 = this._specialsCount[index1]; - float num2 = 0.08f; - float num3 = 0.06f; - for (int index2 = 0; index2 < num1; ++index2) - { - Point point = this._specialPositions[index1][index2]; - int x = point.X; - int y1 = point.Y; - Tile t = Main.tile[x, y1]; - if (t != null && t.active()) - { - ushort type = t.type; - short frameX = t.frameX; - short frameY1 = t.frameY; - bool flag1 = t.wall > (ushort) 0; - WorldGen.GetTreeFoliageDataMethod foliageDataMethod = (WorldGen.GetTreeFoliageDataMethod) null; - try - { - bool flag2 = false; - switch (type) - { - case 5: - flag2 = true; - foliageDataMethod = new WorldGen.GetTreeFoliageDataMethod(WorldGen.GetCommonTreeFoliageData); - break; - case 583: - case 584: - case 585: - case 586: - case 587: - case 588: - case 589: - flag2 = true; - foliageDataMethod = new WorldGen.GetTreeFoliageDataMethod(WorldGen.GetGemTreeFoliageData); - break; - case 596: - case 616: - flag2 = true; - foliageDataMethod = new WorldGen.GetTreeFoliageDataMethod(WorldGen.GetVanityTreeFoliageData); - break; - } - if (flag2 && frameY1 >= (short) 198 && frameX >= (short) 22) - { - int treeFrame = WorldGen.GetTreeFrame(t); - switch (frameX) - { - case 22: - int treeStyle1 = 0; - int topTextureFrameWidth1 = 80; - int topTextureFrameHeight1 = 80; - int xoffset1 = 0; - int grassPosX = x + xoffset1; - int floorY1 = y1; - if (foliageDataMethod(x, y1, xoffset1, ref treeFrame, ref treeStyle1, out floorY1, out topTextureFrameWidth1, out topTextureFrameHeight1)) - { - this.EmitTreeLeaves(x, y1, grassPosX, floorY1); - if (treeStyle1 == 14) - { - float num4 = (float) this._rand.Next(28, 42) * 0.005f + (float) (270 - (int) Main.mouseTextColor) / 1000f; - Lighting.AddLight(x, y1, 0.1f, (float) (0.200000002980232 + (double) num4 / 2.0), 0.7f + num4); - } - byte tileColor = t.color(); - Texture2D treeTopTexture = this.GetTreeTopTexture(treeStyle1, 0, tileColor); - Vector2 vector2; - Vector2 position = vector2 = new Vector2((float) (x * 16 - (int) unscaledPosition.X + 8), (float) (y1 * 16 - (int) unscaledPosition.Y + 16)) + zero; - float num5 = 0.0f; - if (!flag1) - num5 = this.GetWindCycle(x, y1, this._treeWindCounter); - position.X += num5 * 2f; - position.Y += Math.Abs(num5) * 2f; - Color color = Lighting.GetColor(x, y1); - if (t.color() == (byte) 31) - color = Color.White; - Main.spriteBatch.Draw(treeTopTexture, position, new Rectangle?(new Rectangle(treeFrame * (topTextureFrameWidth1 + 2), 0, topTextureFrameWidth1, topTextureFrameHeight1)), color, num5 * num2, new Vector2((float) (topTextureFrameWidth1 / 2), (float) topTextureFrameHeight1), 1f, SpriteEffects.None, 0.0f); - break; - } - continue; - case 44: - int treeStyle2 = 0; - int num6 = x; - int floorY2 = y1; - int xoffset2 = 1; - int topTextureFrameWidth2; - int topTextureFrameHeight2; - if (foliageDataMethod(x, y1, xoffset2, ref treeFrame, ref treeStyle2, out floorY2, out topTextureFrameWidth2, out topTextureFrameHeight2)) - { - this.EmitTreeLeaves(x, y1, num6 + xoffset2, floorY2); - if (treeStyle2 == 14) - { - float num7 = (float) this._rand.Next(28, 42) * 0.005f + (float) (270 - (int) Main.mouseTextColor) / 1000f; - Lighting.AddLight(x, y1, 0.1f, (float) (0.200000002980232 + (double) num7 / 2.0), 0.7f + num7); - } - byte tileColor = t.color(); - Texture2D treeBranchTexture = this.GetTreeBranchTexture(treeStyle2, 0, tileColor); - Vector2 position = new Vector2((float) (x * 16), (float) (y1 * 16)) - unscaledPosition.Floor() + zero + new Vector2(16f, 12f); - float num8 = 0.0f; - if (!flag1) - num8 = this.GetWindCycle(x, y1, this._treeWindCounter); - if ((double) num8 > 0.0) - position.X += num8; - position.X += Math.Abs(num8) * 2f; - Color color = Lighting.GetColor(x, y1); - if (t.color() == (byte) 31) - color = Color.White; - Main.spriteBatch.Draw(treeBranchTexture, position, new Rectangle?(new Rectangle(0, treeFrame * 42, 40, 40)), color, num8 * num3, new Vector2(40f, 24f), 1f, SpriteEffects.None, 0.0f); - break; - } - continue; - case 66: - int treeStyle3 = 0; - int num9 = x; - int floorY3 = y1; - int xoffset3 = -1; - int topTextureFrameWidth3; - int topTextureFrameHeight3; - if (foliageDataMethod(x, y1, xoffset3, ref treeFrame, ref treeStyle3, out floorY3, out topTextureFrameWidth3, out topTextureFrameHeight3)) - { - this.EmitTreeLeaves(x, y1, num9 + xoffset3, floorY3); - if (treeStyle3 == 14) - { - float num10 = (float) this._rand.Next(28, 42) * 0.005f + (float) (270 - (int) Main.mouseTextColor) / 1000f; - Lighting.AddLight(x, y1, 0.1f, (float) (0.200000002980232 + (double) num10 / 2.0), 0.7f + num10); - } - byte tileColor = t.color(); - Texture2D treeBranchTexture = this.GetTreeBranchTexture(treeStyle3, 0, tileColor); - Vector2 position = new Vector2((float) (x * 16), (float) (y1 * 16)) - unscaledPosition.Floor() + zero + new Vector2(0.0f, 18f); - float num11 = 0.0f; - if (!flag1) - num11 = this.GetWindCycle(x, y1, this._treeWindCounter); - if ((double) num11 < 0.0) - position.X += num11; - position.X -= Math.Abs(num11) * 2f; - Color color = Lighting.GetColor(x, y1); - if (t.color() == (byte) 31) - color = Color.White; - Main.spriteBatch.Draw(treeBranchTexture, position, new Rectangle?(new Rectangle(42, treeFrame * 42, 40, 40)), color, num11 * num3, new Vector2(0.0f, 30f), 1f, SpriteEffects.None, 0.0f); - break; - } - continue; - } - } - if (type == (ushort) 323) - { - if (frameX >= (short) 88) - { - if (frameX <= (short) 132) - { - int num12 = 0; - if (frameX == (short) 110) - num12 = 1; - else if (frameX == (short) 132) - num12 = 2; - int treeTextureIndex = 15; - int width = 80; - int height = 80; - int num13 = 32; - int num14 = 0; - int palmTreeBiome = this.GetPalmTreeBiome(x, y1); - int y2 = palmTreeBiome * 82; - if (palmTreeBiome >= 4 && palmTreeBiome <= 7) - { - treeTextureIndex = 21; - width = 114; - height = 98; - y2 = (palmTreeBiome - 4) * 98; - num13 = 48; - num14 = 2; - } - int frameY2 = (int) Main.tile[x, y1].frameY; - byte tileColor = t.color(); - Texture2D treeTopTexture = this.GetTreeTopTexture(treeTextureIndex, palmTreeBiome, tileColor); - Vector2 position = new Vector2((float) (x * 16 - (int) unscaledPosition.X - num13 + frameY2 + width / 2), (float) (y1 * 16 - (int) unscaledPosition.Y + 16 + num14)) + zero; - float num15 = 0.0f; - if (!flag1) - num15 = this.GetWindCycle(x, y1, this._treeWindCounter); - position.X += num15 * 2f; - position.Y += Math.Abs(num15) * 2f; - Color color = Lighting.GetColor(x, y1); - if (t.color() == (byte) 31) - color = Color.White; - Main.spriteBatch.Draw(treeTopTexture, position, new Rectangle?(new Rectangle(num12 * (width + 2), y2, width, height)), color, num15 * num2, new Vector2((float) (width / 2), (float) height), 1f, SpriteEffects.None, 0.0f); - } - } - } - } - catch - { - } - } - } - } - - private Texture2D GetTreeTopTexture( - int treeTextureIndex, - int treeTextureStyle, - byte tileColor) - { - return this._paintSystem.TryGetTreeTopAndRequestIfNotReady(treeTextureIndex, treeTextureStyle, (int) tileColor) ?? TextureAssets.TreeTop[treeTextureIndex].Value; - } - - private Texture2D GetTreeBranchTexture( - int treeTextureIndex, - int treeTextureStyle, - byte tileColor) - { - return this._paintSystem.TryGetTreeBranchAndRequestIfNotReady(treeTextureIndex, treeTextureStyle, (int) tileColor) ?? TextureAssets.TreeBranch[treeTextureIndex].Value; - } - - private void DrawGrass() - { - Vector2 unscaledPosition = Main.Camera.UnscaledPosition; - Vector2 zero = Vector2.Zero; - int index1 = 3; - int num1 = this._specialsCount[index1]; - for (int index2 = 0; index2 < num1; ++index2) - { - Point point = this._specialPositions[index1][index2]; - int x = point.X; - int y = point.Y; - Tile tile = Main.tile[x, y]; - if (tile != null && tile.active()) - { - ushort type = tile.type; - short frameX = tile.frameX; - short frameY = tile.frameY; - int tileWidth; - int tileHeight; - int tileTop; - int halfBrickHeight; - int addFrX; - int addFrY; - SpriteEffects tileSpriteEffect; - this.GetTileDrawData(x, y, tile, type, ref frameX, ref frameY, out tileWidth, out tileHeight, out tileTop, out halfBrickHeight, out addFrX, out addFrY, out tileSpriteEffect, out Texture2D _, out Rectangle _, out Color _); - bool canDoDust = this._rand.Next(4) == 0; - Color tileLight = Lighting.GetColor(x, y); - this.DrawAnimatedTile_AdjustForVisionChangers(x, y, tile, type, frameX, frameY, ref tileLight, canDoDust); - tileLight = this.DrawTiles_GetLightOverride(y, x, tile, type, frameX, frameY, tileLight); - if (this._isActiveAndNotPaused & canDoDust) - this.DrawTiles_EmitParticles(y, x, tile, type, frameX, frameY, tileLight); - if (type == (ushort) 83 && this.IsAlchemyPlantHarvestable((int) frameX / 18)) - { - ushort num2 = 84; - Main.instance.LoadTiles((int) num2); - } - if (tile.type == (ushort) 227 && frameX == (short) 202) - { - bool evil; - bool good; - bool crimson; - this.GetCactusType(x, y, (int) frameX, (int) frameY, out evil, out good, out crimson); - if (good) - frameX += (short) 170; - if (evil) - frameX += (short) 204; - if (crimson) - frameX += (short) 238; - } - Vector2 position = new Vector2((float) (x * 16 - (int) unscaledPosition.X + 8), (float) (y * 16 - (int) unscaledPosition.Y + 16)) + zero; - double grassWindCounter = this._grassWindCounter; - float num3 = this.GetWindCycle(x, y, this._grassWindCounter); - if (!WallID.Sets.AllowsWind[(int) tile.wall]) - num3 = 0.0f; - if (!this.InAPlaceWithWind(x, y, 1, 1)) - num3 = 0.0f; - float num4 = num3 + this.GetWindGridPush(x, y, 20, 0.35f); - position.X += num4 * 1f; - position.Y += Math.Abs(num4) * 1f; - Texture2D tileDrawTexture = this.GetTileDrawTexture(tile, x, y); - if (tileDrawTexture != null) - Main.spriteBatch.Draw(tileDrawTexture, position, new Rectangle?(new Rectangle((int) frameX + addFrX, (int) frameY + addFrY, tileWidth, tileHeight - halfBrickHeight)), tileLight, num4 * 0.1f, new Vector2((float) (tileWidth / 2), (float) (16 - halfBrickHeight - tileTop)), 1f, tileSpriteEffect, 0.0f); - } - } - } - - private void DrawAnimatedTile_AdjustForVisionChangers( - int i, - int j, - Tile tileCache, - ushort typeCache, - short tileFrameX, - short tileFrameY, - ref Color tileLight, - bool canDoDust) - { - if (this._localPlayer.dangerSense && TileDrawing.IsTileDangerous(this._localPlayer, tileCache, typeCache)) - { - if (tileLight.R < byte.MaxValue) - tileLight.R = byte.MaxValue; - if (tileLight.G < (byte) 50) - tileLight.G = (byte) 50; - if (tileLight.B < (byte) 50) - tileLight.B = (byte) 50; - if (this._isActiveAndNotPaused & canDoDust && this._rand.Next(30) == 0) - { - int index = Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, 60, Alpha: 100, Scale: 0.3f); - this._dust[index].fadeIn = 1f; - this._dust[index].velocity *= 0.1f; - this._dust[index].noLight = true; - this._dust[index].noGravity = true; - } - } - if (!this._localPlayer.findTreasure || !Main.IsTileSpelunkable(typeCache, tileFrameX, tileFrameY)) - return; - if (tileLight.R < (byte) 200) - tileLight.R = (byte) 200; - if (tileLight.G < (byte) 170) - tileLight.G = (byte) 170; - if (!this._isActiveAndNotPaused || !(this._rand.Next(60) == 0 & canDoDust)) - return; - int index1 = Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, 204, Alpha: 150, Scale: 0.3f); - this._dust[index1].fadeIn = 1f; - this._dust[index1].velocity *= 0.1f; - this._dust[index1].noLight = true; - } - - private float GetWindGridPush( - int i, - int j, - int pushAnimationTimeTotal, - float pushForcePerFrame) - { - int windTimeLeft; - int direction; - this._windGrid.GetWindTime(i, j, pushAnimationTimeTotal, out windTimeLeft, out direction); - return windTimeLeft >= pushAnimationTimeTotal / 2 ? (float) (pushAnimationTimeTotal - windTimeLeft) * pushForcePerFrame * (float) direction : (float) windTimeLeft * pushForcePerFrame * (float) direction; - } - - private float GetWindGridPushComplex( - int i, - int j, - int pushAnimationTimeTotal, - float totalPushForce, - int loops, - bool flipDirectionPerLoop) - { - int windTimeLeft; - int direction; - this._windGrid.GetWindTime(i, j, pushAnimationTimeTotal, out windTimeLeft, out direction); - double num1 = (double) windTimeLeft / (double) pushAnimationTimeTotal; - int num2 = (int) (num1 * (double) loops); - float num3 = (float) (num1 * (double) loops % 1.0); - double num4 = 1.0 / (double) loops; - if (flipDirectionPerLoop && num2 % 2 == 1) - direction *= -1; - return num1 * (double) loops % 1.0 > 0.5 ? (1f - num3) * totalPushForce * (float) direction * (float) (loops - num2) : num3 * totalPushForce * (float) direction * (float) (loops - num2); - } - - private void DrawMasterTrophies() - { - int index1 = 11; - int num1 = this._specialsCount[index1]; - for (int index2 = 0; index2 < num1; ++index2) - { - Point p = this._specialPositions[index1][index2]; - Tile tile = Main.tile[p.X, p.Y]; - if (tile != null && tile.active()) - { - Texture2D texture2D = TextureAssets.Extra[198].Value; - int frameY = (int) tile.frameX / 54; - int num2 = (uint) tile.frameY / 72U > 0U ? 1 : 0; - int horizontalFrames = 1; - int verticalFrames = 27; - Rectangle r = texture2D.Frame(horizontalFrames, verticalFrames, frameY: frameY); - Vector2 origin = r.Size() / 2f; - Vector2 worldCoordinates = p.ToWorldCoordinates(24f, 64f); - float num3 = (float) Math.Sin((double) Main.GlobalTimeWrappedHourly * 6.28318548202515 / 5.0); - Vector2 vector2_1 = new Vector2(0.0f, -40f); - Vector2 vector2_2 = worldCoordinates + vector2_1 + new Vector2(0.0f, num3 * 4f); - Color color1 = Lighting.GetColor(p.X, p.Y); - SpriteEffects effects = num2 != 0 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Main.spriteBatch.Draw(texture2D, vector2_2 - Main.screenPosition, new Rectangle?(r), color1, 0.0f, origin, 1f, effects, 0.0f); - float num4 = (float) (Math.Sin((double) Main.GlobalTimeWrappedHourly * 6.28318548202515 / 2.0) * 0.300000011920929 + 0.699999988079071); - Color color2 = color1; - color2.A = (byte) 0; - Color color3 = color2 * 0.1f * num4; - for (float num5 = 0.0f; (double) num5 < 1.0; num5 += 0.1666667f) - Main.spriteBatch.Draw(texture2D, vector2_2 - Main.screenPosition + (6.283185f * num5).ToRotationVector2() * (float) (6.0 + (double) num3 * 2.0), new Rectangle?(r), color3, 0.0f, origin, 1f, effects, 0.0f); - } - } - } - - private void DrawTeleportationPylons() - { - int index1 = 10; - int num1 = this._specialsCount[index1]; - for (int index2 = 0; index2 < num1; ++index2) - { - Point p = this._specialPositions[index1][index2]; - Tile tile = Main.tile[p.X, p.Y]; - if (tile != null && tile.active()) - { - Texture2D texture2D = TextureAssets.Extra[181].Value; - int tileStyle = (int) tile.frameX / 54; - int num2 = 3; - int horizontalFrames = num2 + 9; - int verticalFrames = 8; - int frameY = (Main.tileFrameCounter[597] + p.X + p.Y) % 64 / 8; - Rectangle r = texture2D.Frame(horizontalFrames, verticalFrames, num2 + tileStyle, frameY); - Rectangle rectangle = texture2D.Frame(horizontalFrames, verticalFrames, 2, frameY); - texture2D.Frame(horizontalFrames, verticalFrames, frameY: frameY); - Vector2 origin = r.Size() / 2f; - Vector2 worldCoordinates = p.ToWorldCoordinates(24f, 64f); - float num3 = (float) Math.Sin((double) Main.GlobalTimeWrappedHourly * 6.28318548202515 / 5.0); - Vector2 vector2 = new Vector2(0.0f, -40f); - Vector2 center = worldCoordinates + vector2 + new Vector2(0.0f, num3 * 4f); - if (this._isActiveAndNotPaused & this._rand.Next(4) == 0 && this._rand.Next(10) == 0) - { - Rectangle dustBox = Utils.CenteredRectangle(center, r.Size()); - TeleportPylonsSystem.SpawnInWorldDust(tileStyle, dustBox); - } - Color color1 = Color.Lerp(Lighting.GetColor(p.X, p.Y), Color.White, 0.8f); - Main.spriteBatch.Draw(texture2D, center - Main.screenPosition, new Rectangle?(r), color1 * 0.7f, 0.0f, origin, 1f, SpriteEffects.None, 0.0f); - Color color2 = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * 0.1f * (float) (Math.Sin((double) Main.GlobalTimeWrappedHourly * 6.28318548202515 / 1.0) * 0.200000002980232 + 0.800000011920929); - for (float num4 = 0.0f; (double) num4 < 1.0; num4 += 0.1666667f) - Main.spriteBatch.Draw(texture2D, center - Main.screenPosition + (6.283185f * num4).ToRotationVector2() * (float) (6.0 + (double) num3 * 2.0), new Rectangle?(r), color2, 0.0f, origin, 1f, SpriteEffects.None, 0.0f); - int num5 = 0; - bool actuallySelected; - if (Main.InSmartCursorHighlightArea(p.X, p.Y, out actuallySelected)) - { - num5 = 1; - if (actuallySelected) - num5 = 2; - } - if (num5 != 0) - { - int averageTileLighting = ((int) color1.R + (int) color1.G + (int) color1.B) / 3; - if (averageTileLighting > 10) - { - Color selectionGlowColor = Colors.GetSelectionGlowColor(num5 == 2, averageTileLighting); - Main.spriteBatch.Draw(texture2D, center - Main.screenPosition, new Rectangle?(rectangle), selectionGlowColor, 0.0f, origin, 1f, SpriteEffects.None, 0.0f); - } - } - } - } - } - - private void DrawVoidLenses() - { - int index1 = 8; - int num = this._specialsCount[index1]; - this._voidLensData.Clear(); - for (int index2 = 0; index2 < num; ++index2) - { - Point p = this._specialPositions[index1][index2]; - VoidLensHelper voidLensHelper = new VoidLensHelper(p.ToWorldCoordinates(), 1f); - if (!Main.gamePaused) - voidLensHelper.Update(); - int selectionMode = 0; - bool actuallySelected; - if (Main.InSmartCursorHighlightArea(p.X, p.Y, out actuallySelected)) - { - selectionMode = 1; - if (actuallySelected) - selectionMode = 2; - } - voidLensHelper.DrawToDrawData(this._voidLensData, selectionMode); - } - foreach (DrawData drawData in this._voidLensData) - drawData.Draw(Main.spriteBatch); - } - - private void DrawMultiTileGrass() - { - Vector2 unscaledPosition = Main.Camera.UnscaledPosition; - Vector2 zero = Vector2.Zero; - int index1 = 4; - int num = this._specialsCount[index1]; - for (int index2 = 0; index2 < num; ++index2) - { - Point point = this._specialPositions[index1][index2]; - int x = point.X; - int y = point.Y; - int sizeX = 1; - int sizeY = 1; - Tile tile = Main.tile[x, y]; - if (tile != null && tile.active()) - { - switch (Main.tile[x, y].type) - { - case 27: - sizeX = 2; - sizeY = 5; - break; - case 233: - sizeX = Main.tile[x, y].frameY != (short) 0 ? 2 : 3; - sizeY = 2; - break; - case 236: - case 238: - sizeX = sizeY = 2; - break; - case 485: - case 490: - case 521: - case 522: - case 523: - case 524: - case 525: - case 526: - case 527: - sizeX = 2; - sizeY = 2; - break; - case 489: - sizeX = 2; - sizeY = 3; - break; - case 493: - sizeX = 1; - sizeY = 2; - break; - case 519: - sizeX = 1; - sizeY = this.ClimbCatTail(x, y); - y -= sizeY - 1; - break; - case 530: - sizeX = 3; - sizeY = 2; - break; - } - this.DrawMultiTileGrassInWind(unscaledPosition, zero, x, y, sizeX, sizeY); - } - } - } - - private int ClimbCatTail(int originx, int originy) - { - int num = 0; - int index = originy; - while (index > 10) - { - Tile tile = Main.tile[originx, index]; - if (tile.active() && tile.type == (ushort) 519) - { - if (tile.frameX >= (short) 180) - { - ++num; - break; - } - --index; - ++num; - } - else - break; - } - return num; - } - - private void DrawMultiTileVines() - { - Vector2 unscaledPosition = Main.Camera.UnscaledPosition; - Vector2 zero = Vector2.Zero; - int index1 = 5; - int num = this._specialsCount[index1]; - for (int index2 = 0; index2 < num; ++index2) - { - Point point = this._specialPositions[index1][index2]; - int x = point.X; - int y = point.Y; - int sizeX = 1; - int sizeY = 1; - Tile tile = Main.tile[x, y]; - if (tile != null && tile.active()) - { - switch (Main.tile[x, y].type) - { - case 34: - sizeX = 3; - sizeY = 3; - break; - case 42: - case 270: - case 271: - case 572: - case 581: - sizeX = 1; - sizeY = 2; - break; - case 91: - sizeX = 1; - sizeY = 3; - break; - case 95: - case 126: - case 444: - sizeX = 2; - sizeY = 2; - break; - case 454: - sizeX = 4; - sizeY = 3; - break; - case 465: - case 591: - case 592: - sizeX = 2; - sizeY = 3; - break; - } - this.DrawMultiTileVinesInWind(unscaledPosition, zero, x, y, sizeX, sizeY); - } - } - } - - private void DrawVines() - { - Vector2 unscaledPosition = Main.Camera.UnscaledPosition; - Vector2 zero = Vector2.Zero; - int index1 = 6; - int num = this._specialsCount[index1]; - for (int index2 = 0; index2 < num; ++index2) - { - Point point = this._specialPositions[index1][index2]; - int x = point.X; - int y = point.Y; - this.DrawVineStrip(unscaledPosition, zero, x, y); - } - } - - private void DrawReverseVines() - { - Vector2 unscaledPosition = Main.Camera.UnscaledPosition; - Vector2 zero = Vector2.Zero; - int index1 = 9; - int num = this._specialsCount[index1]; - for (int index2 = 0; index2 < num; ++index2) - { - Point point = this._specialPositions[index1][index2]; - int x = point.X; - int y = point.Y; - this.DrawRisingVineStrip(unscaledPosition, zero, x, y); - } - } - - private void DrawMultiTileGrassInWind( - Vector2 screenPosition, - Vector2 offSet, - int topLeftX, - int topLeftY, - int sizeX, - int sizeY) - { - float windCycle = this.GetWindCycle(topLeftX, topLeftY, this._sunflowerWindCounter); - Vector2 vector2_1 = new Vector2((float) (sizeX * 16) * 0.5f, (float) (sizeY * 16)); - Vector2 vector2_2 = new Vector2((float) (topLeftX * 16 - (int) screenPosition.X) + (float) ((double) sizeX * 16.0 * 0.5), (float) (topLeftY * 16 - (int) screenPosition.Y + 16 * sizeY)) + offSet; - float num1 = 0.07f; - int type1 = (int) Main.tile[topLeftX, topLeftY].type; - Texture2D texture = (Texture2D) null; - Color color1 = Color.Transparent; - bool flag = this.InAPlaceWithWind(topLeftX, topLeftY, sizeX, sizeY); - switch (type1) - { - case 27: - texture = TextureAssets.Flames[14].Value; - color1 = Color.White; - break; - case 519: - flag = this.InAPlaceWithWind(topLeftX, topLeftY, sizeX, 1); - break; - case 521: - case 522: - case 523: - case 524: - case 525: - case 526: - case 527: - num1 = 0.0f; - flag = false; - break; - default: - num1 = 0.15f; - break; - } - for (int index1 = topLeftX; index1 < topLeftX + sizeX; ++index1) - { - for (int index2 = topLeftY; index2 < topLeftY + sizeY; ++index2) - { - Tile tile = Main.tile[index1, index2]; - ushort type2 = tile.type; - if ((int) type2 == type1) - { - double num2 = (double) Math.Abs((float) (((double) (index1 - topLeftX) + 0.5) / (double) sizeX - 0.5)); - short frameX = tile.frameX; - short frameY = tile.frameY; - float num3 = (float) (1.0 - (double) (index2 - topLeftY + 1) / (double) sizeY); - if ((double) num3 == 0.0) - num3 = 0.1f; - if (!flag) - num3 = 0.0f; - int tileWidth; - int tileHeight; - int tileTop; - int halfBrickHeight; - int addFrX; - int addFrY; - SpriteEffects tileSpriteEffect; - this.GetTileDrawData(index1, index2, tile, type2, ref frameX, ref frameY, out tileWidth, out tileHeight, out tileTop, out halfBrickHeight, out addFrX, out addFrY, out tileSpriteEffect, out Texture2D _, out Rectangle _, out Color _); - bool canDoDust = this._rand.Next(4) == 0; - Color color2 = Lighting.GetColor(index1, index2); - this.DrawAnimatedTile_AdjustForVisionChangers(index1, index2, tile, type2, frameX, frameY, ref color2, canDoDust); - Color lightOverride = this.DrawTiles_GetLightOverride(index2, index1, tile, type2, frameX, frameY, color2); - if (this._isActiveAndNotPaused & canDoDust) - this.DrawTiles_EmitParticles(index2, index1, tile, type2, frameX, frameY, lightOverride); - Vector2 vector2_3 = new Vector2((float) (index1 * 16 - (int) screenPosition.X), (float) (index2 * 16 - (int) screenPosition.Y + tileTop)) + offSet; - if (tile.type == (ushort) 493 && tile.frameY == (short) 0) - { - if ((double) Main.WindForVisuals >= 0.0) - tileSpriteEffect ^= SpriteEffects.FlipHorizontally; - if (!tileSpriteEffect.HasFlag((Enum) SpriteEffects.FlipHorizontally)) - vector2_3.X -= 6f; - else - vector2_3.X += 6f; - } - Vector2 vector2_4 = new Vector2(windCycle * 1f, Math.Abs(windCycle) * 2f * num3); - Vector2 origin = vector2_2 - vector2_3; - Texture2D tileDrawTexture = this.GetTileDrawTexture(tile, index1, index2); - if (tileDrawTexture != null) - { - Main.spriteBatch.Draw(tileDrawTexture, vector2_2 + new Vector2(0.0f, vector2_4.Y), new Rectangle?(new Rectangle((int) frameX + addFrX, (int) frameY + addFrY, tileWidth, tileHeight - halfBrickHeight)), lightOverride, windCycle * num1 * num3, origin, 1f, tileSpriteEffect, 0.0f); - if (texture != null) - Main.spriteBatch.Draw(texture, vector2_2 + new Vector2(0.0f, vector2_4.Y), new Rectangle?(new Rectangle((int) frameX + addFrX, (int) frameY + addFrY, tileWidth, tileHeight - halfBrickHeight)), color1, windCycle * num1 * num3, origin, 1f, tileSpriteEffect, 0.0f); - } - } - } - } - } - - private void DrawVineStrip(Vector2 screenPosition, Vector2 offSet, int x, int startY) - { - int num1 = 0; - int num2 = 0; - Vector2 vector2 = new Vector2((float) (x * 16 + 8), (float) (startY * 16 - 2)); - float num3 = MathHelper.Lerp(0.2f, 1f, Math.Abs(Main.WindForVisuals) / 1.2f); - float num4 = -0.08f * num3; - float windCycle = this.GetWindCycle(x, startY, this._vineWindCounter); - float num5 = 0.0f; - float num6 = 0.0f; - for (int index = startY; index < Main.maxTilesY - 10; ++index) - { - Tile tile = Main.tile[x, index]; - if (tile != null) - { - ushort type = tile.type; - if (!tile.active() || !TileID.Sets.VineThreads[(int) type]) - break; - ++num1; - if (num2 >= 5) - num4 += 0.0075f * num3; - if (num2 >= 2) - num4 += 1f / 400f; - if (WallID.Sets.AllowsWind[(int) tile.wall] && (double) index < Main.worldSurface) - ++num2; - float windGridPush = this.GetWindGridPush(x, index, 20, 0.01f); - if ((double) windGridPush == 0.0 && (double) num6 != 0.0) - num5 *= -0.78f; - else - num5 -= windGridPush; - num6 = windGridPush; - short frameX = tile.frameX; - short frameY = tile.frameY; - Color color = Lighting.GetColor(x, index); - int tileWidth; - int tileHeight; - int tileTop; - int halfBrickHeight; - int addFrX; - int addFrY; - SpriteEffects tileSpriteEffect; - this.GetTileDrawData(x, index, tile, type, ref frameX, ref frameY, out tileWidth, out tileHeight, out tileTop, out halfBrickHeight, out addFrX, out addFrY, out tileSpriteEffect, out Texture2D _, out Rectangle _, out Color _); - Vector2 position = new Vector2((float) -(int) screenPosition.X, (float) -(int) screenPosition.Y) + offSet + vector2; - if (tile.color() == (byte) 31) - color = Color.White; - float rotation = (float) num2 * num4 * windCycle + num5; - Texture2D tileDrawTexture = this.GetTileDrawTexture(tile, x, index); - if (tileDrawTexture == null) - break; - Main.spriteBatch.Draw(tileDrawTexture, position, new Rectangle?(new Rectangle((int) frameX + addFrX, (int) frameY + addFrY, tileWidth, tileHeight - halfBrickHeight)), color, rotation, new Vector2((float) (tileWidth / 2), (float) (halfBrickHeight - tileTop)), 1f, tileSpriteEffect, 0.0f); - vector2 += (rotation + 1.570796f).ToRotationVector2() * 16f; - } - } - } - - private void DrawRisingVineStrip(Vector2 screenPosition, Vector2 offSet, int x, int startY) - { - int num1 = 0; - int num2 = 0; - Vector2 vector2 = new Vector2((float) (x * 16 + 8), (float) (startY * 16 + 16 + 2)); - float num3 = MathHelper.Lerp(0.2f, 1f, Math.Abs(Main.WindForVisuals) / 1.2f); - float num4 = -0.08f * num3; - float windCycle = this.GetWindCycle(x, startY, this._vineWindCounter); - float num5 = 0.0f; - float num6 = 0.0f; - for (int index = startY; index > 10; --index) - { - Tile tile = Main.tile[x, index]; - if (tile != null) - { - ushort type = tile.type; - if (!tile.active() || !TileID.Sets.ReverseVineThreads[(int) type]) - break; - ++num1; - if (num2 >= 5) - num4 += 0.0075f * num3; - if (num2 >= 2) - num4 += 1f / 400f; - if (WallID.Sets.AllowsWind[(int) tile.wall] && (double) index < Main.worldSurface) - ++num2; - float windGridPush = this.GetWindGridPush(x, index, 40, -0.004f); - if ((double) windGridPush == 0.0 && (double) num6 != 0.0) - num5 *= -0.78f; - else - num5 -= windGridPush; - num6 = windGridPush; - short frameX = tile.frameX; - short frameY = tile.frameY; - Color color = Lighting.GetColor(x, index); - int tileWidth; - int tileHeight; - int tileTop; - int halfBrickHeight; - int addFrX; - int addFrY; - SpriteEffects tileSpriteEffect; - this.GetTileDrawData(x, index, tile, type, ref frameX, ref frameY, out tileWidth, out tileHeight, out tileTop, out halfBrickHeight, out addFrX, out addFrY, out tileSpriteEffect, out Texture2D _, out Rectangle _, out Color _); - Vector2 position = new Vector2((float) -(int) screenPosition.X, (float) -(int) screenPosition.Y) + offSet + vector2; - float rotation = (float) num2 * -num4 * windCycle + num5; - Texture2D tileDrawTexture = this.GetTileDrawTexture(tile, x, index); - if (tileDrawTexture == null) - break; - Main.spriteBatch.Draw(tileDrawTexture, position, new Rectangle?(new Rectangle((int) frameX + addFrX, (int) frameY + addFrY, tileWidth, tileHeight - halfBrickHeight)), color, rotation, new Vector2((float) (tileWidth / 2), (float) (halfBrickHeight - tileTop + tileHeight)), 1f, tileSpriteEffect, 0.0f); - vector2 += (rotation - 1.570796f).ToRotationVector2() * 16f; - } - } - } - - private float GetAverageWindGridPush( - int topLeftX, - int topLeftY, - int sizeX, - int sizeY, - int totalPushTime, - float pushForcePerFrame) - { - float num1 = 0.0f; - int num2 = 0; - for (int index1 = 0; index1 < sizeX; ++index1) - { - for (int index2 = 0; index2 < sizeY; ++index2) - { - float windGridPush = this.GetWindGridPush(topLeftX + index1, topLeftY + index2, totalPushTime, pushForcePerFrame); - if ((double) windGridPush != 0.0) - { - num1 += windGridPush; - ++num2; - } - } - } - return num2 == 0 ? 0.0f : num1 / (float) num2; - } - - private float GetHighestWindGridPushComplex( - int topLeftX, - int topLeftY, - int sizeX, - int sizeY, - int totalPushTime, - float pushForcePerFrame, - int loops, - bool swapLoopDir) - { - float num1 = 0.0f; - int num2 = int.MaxValue; - for (int index1 = 0; index1 < 1; ++index1) - { - for (int index2 = 0; index2 < sizeY; ++index2) - { - int windTimeLeft; - this._windGrid.GetWindTime(topLeftX + index1 + sizeX / 2, topLeftY + index2, totalPushTime, out windTimeLeft, out int _); - float windGridPushComplex = this.GetWindGridPushComplex(topLeftX + index1, topLeftY + index2, totalPushTime, pushForcePerFrame, loops, swapLoopDir); - if (windTimeLeft < num2 && windTimeLeft != 0) - { - num1 = windGridPushComplex; - num2 = windTimeLeft; - } - } - } - return num1; - } - - private void DrawMultiTileVinesInWind( - Vector2 screenPosition, - Vector2 offSet, - int topLeftX, - int topLeftY, - int sizeX, - int sizeY) - { - float windCycle = this.GetWindCycle(topLeftX, topLeftY, this._sunflowerWindCounter); - float num1 = windCycle; - int totalPushTime = 60; - float pushForcePerFrame = 1.26f; - float windGridPushComplex = this.GetHighestWindGridPushComplex(topLeftX, topLeftY, sizeX, sizeY, totalPushTime, pushForcePerFrame, 3, true); - float num2 = windCycle + windGridPushComplex; - Vector2 vector2_1 = new Vector2((float) (sizeX * 16) * 0.5f, 0.0f); - Vector2 vector2_2 = new Vector2((float) (topLeftX * 16 - (int) screenPosition.X) + (float) ((double) sizeX * 16.0 * 0.5), (float) (topLeftY * 16 - (int) screenPosition.Y)) + offSet; - Tile tile1 = Main.tile[topLeftX, topLeftY]; - int type1 = (int) tile1.type; - Vector2 vector2_3 = new Vector2(0.0f, -2f); - Vector2 vector2_4 = vector2_2 + vector2_3; - Texture2D texture = (Texture2D) null; - Color color = Color.Transparent; - float? nullable = new float?(); - float num3 = 1f; - float num4 = -4f; - bool flag = false; - float num5 = 0.15f; - switch (type1) - { - case 34: - case 126: - nullable = new float?(1f); - num4 = 0.0f; - switch ((int) tile1.frameY / 54 + (int) tile1.frameX / 108 * 37) - { - case 9: - nullable = new float?(); - num4 = -1f; - flag = true; - num5 *= 0.3f; - break; - case 11: - num5 *= 0.5f; - break; - case 12: - nullable = new float?(); - num4 = -1f; - break; - case 18: - nullable = new float?(); - num4 = -1f; - break; - case 21: - nullable = new float?(); - num4 = -1f; - break; - case 23: - nullable = new float?(0.0f); - break; - case 25: - nullable = new float?(); - num4 = -1f; - flag = true; - break; - case 32: - num5 *= 0.5f; - break; - case 33: - num5 *= 0.5f; - break; - case 35: - nullable = new float?(0.0f); - break; - case 36: - nullable = new float?(); - num4 = -1f; - flag = true; - break; - case 37: - nullable = new float?(); - num4 = -1f; - flag = true; - num5 *= 0.5f; - break; - case 39: - nullable = new float?(); - num4 = -1f; - flag = true; - break; - case 40: - case 41: - case 42: - case 43: - nullable = new float?(); - num4 = -2f; - flag = true; - num5 *= 0.5f; - break; - case 44: - nullable = new float?(); - num4 = -3f; - break; - } - break; - case 42: - nullable = new float?(1f); - num4 = 0.0f; - switch ((int) tile1.frameY / 36) - { - case 0: - nullable = new float?(); - num4 = -1f; - break; - case 9: - nullable = new float?(0.0f); - break; - case 12: - nullable = new float?(); - num4 = -1f; - break; - case 14: - nullable = new float?(); - num4 = -1f; - break; - case 28: - nullable = new float?(); - num4 = -1f; - break; - case 30: - nullable = new float?(0.0f); - break; - case 32: - nullable = new float?(0.0f); - break; - case 33: - nullable = new float?(0.0f); - break; - case 34: - nullable = new float?(); - num4 = -1f; - break; - case 35: - nullable = new float?(0.0f); - break; - case 38: - nullable = new float?(); - num4 = -1f; - break; - case 39: - nullable = new float?(); - num4 = -1f; - flag = true; - break; - case 40: - case 41: - case 42: - case 43: - nullable = new float?(0.0f); - nullable = new float?(); - num4 = -1f; - flag = true; - break; - } - break; - case 95: - case 270: - case 271: - case 444: - case 454: - case 572: - case 581: - nullable = new float?(1f); - num4 = 0.0f; - break; - case 591: - num3 = 0.5f; - num4 = -2f; - break; - case 592: - num3 = 0.5f; - num4 = -2f; - texture = TextureAssets.GlowMask[294].Value; - color = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); - break; - } - if (flag) - vector2_4 += new Vector2(0.0f, 16f); - float num6 = num5 * -1f; - if (!this.InAPlaceWithWind(topLeftX, topLeftY, sizeX, sizeY)) - num2 -= num1; - ulong num7 = 0; - for (int index1 = topLeftX; index1 < topLeftX + sizeX; ++index1) - { - for (int index2 = topLeftY; index2 < topLeftY + sizeY; ++index2) - { - Tile tile2 = Main.tile[index1, index2]; - ushort type2 = tile2.type; - if ((int) type2 == type1) - { - double num8 = (double) Math.Abs((float) (((double) (index1 - topLeftX) + 0.5) / (double) sizeX - 0.5)); - short frameX = tile2.frameX; - short frameY = tile2.frameY; - float num9 = (float) (index2 - topLeftY + 1) / (float) sizeY; - if ((double) num9 == 0.0) - num9 = 0.1f; - if (nullable.HasValue) - num9 = nullable.Value; - if (flag && index2 == topLeftY) - num9 = 0.0f; - int tileWidth; - int tileHeight; - int tileTop; - int halfBrickHeight; - int addFrX; - int addFrY; - SpriteEffects tileSpriteEffect; - this.GetTileDrawData(index1, index2, tile2, type2, ref frameX, ref frameY, out tileWidth, out tileHeight, out tileTop, out halfBrickHeight, out addFrX, out addFrY, out tileSpriteEffect, out Texture2D _, out Rectangle _, out Color _); - bool canDoDust = this._rand.Next(4) == 0; - Color tileLight = Lighting.GetColor(index1, index2); - this.DrawAnimatedTile_AdjustForVisionChangers(index1, index2, tile2, type2, frameX, frameY, ref tileLight, canDoDust); - tileLight = this.DrawTiles_GetLightOverride(index2, index1, tile2, type2, frameX, frameY, tileLight); - if (this._isActiveAndNotPaused & canDoDust) - this.DrawTiles_EmitParticles(index2, index1, tile2, type2, frameX, frameY, tileLight); - Vector2 vector2_5 = new Vector2((float) (index1 * 16 - (int) screenPosition.X), (float) (index2 * 16 - (int) screenPosition.Y + tileTop)) + offSet + vector2_3; - Vector2 vector2_6 = new Vector2(num2 * num3, Math.Abs(num2) * num4 * num9); - Vector2 origin = vector2_4 - vector2_5; - Texture2D tileDrawTexture = this.GetTileDrawTexture(tile2, index1, index2); - if (tileDrawTexture != null) - { - Vector2 position = vector2_4 + new Vector2(0.0f, vector2_6.Y); - Rectangle rectangle = new Rectangle((int) frameX + addFrX, (int) frameY + addFrY, tileWidth, tileHeight - halfBrickHeight); - float rotation = num2 * num6 * num9; - Main.spriteBatch.Draw(tileDrawTexture, position, new Rectangle?(rectangle), tileLight, rotation, origin, 1f, tileSpriteEffect, 0.0f); - if (texture != null) - Main.spriteBatch.Draw(texture, position, new Rectangle?(rectangle), color, rotation, origin, 1f, tileSpriteEffect, 0.0f); - TileDrawing.TileFlameData tileFlameData = this.GetTileFlameData(index1, index2, (int) type2, (int) frameY); - if (num7 == 0UL) - num7 = tileFlameData.flameSeed; - tileFlameData.flameSeed = num7; - for (int index3 = 0; index3 < tileFlameData.flameCount; ++index3) - { - float x = (float) Utils.RandomInt(ref tileFlameData.flameSeed, tileFlameData.flameRangeXMin, tileFlameData.flameRangeXMax) * tileFlameData.flameRangeMultX; - float y = (float) Utils.RandomInt(ref tileFlameData.flameSeed, tileFlameData.flameRangeYMin, tileFlameData.flameRangeYMax) * tileFlameData.flameRangeMultY; - Main.spriteBatch.Draw(tileFlameData.flameTexture, position + new Vector2(x, y), new Rectangle?(rectangle), tileFlameData.flameColor, rotation, origin, 1f, tileSpriteEffect, 0.0f); - } - } - } - } - } - } - - private void EmitAlchemyHerbParticles(int j, int i, int style) - { - if (style == 0 && this._rand.Next(100) == 0) - { - int index = Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16 - 4)), 16, 16, 19, Alpha: 160, Scale: 0.1f); - this._dust[index].velocity.X /= 2f; - this._dust[index].velocity.Y /= 2f; - this._dust[index].noGravity = true; - this._dust[index].fadeIn = 1f; - } - if (style == 1 && this._rand.Next(100) == 0) - Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, 41, Alpha: 250, Scale: 0.8f); - if (style == 3) - { - if (this._rand.Next(200) == 0) - this._dust[Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, 14, Alpha: 100, Scale: 0.2f)].fadeIn = 1.2f; - if (this._rand.Next(75) == 0) - { - int index = Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, 27, Alpha: 100); - this._dust[index].velocity.X /= 2f; - this._dust[index].velocity.Y /= 2f; - } - } - if (style == 4 && this._rand.Next(150) == 0) - { - int index = Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 8, 16); - this._dust[index].velocity.X /= 3f; - this._dust[index].velocity.Y /= 3f; - this._dust[index].velocity.Y -= 0.7f; - this._dust[index].alpha = 50; - this._dust[index].scale *= 0.1f; - this._dust[index].fadeIn = 0.9f; - this._dust[index].noGravity = true; - } - if (style == 5 && this._rand.Next(40) == 0) - { - int index = Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16 - 6)), 16, 16, 6, Scale: 1.5f); - this._dust[index].velocity.Y -= 2f; - this._dust[index].noGravity = true; - } - if (style != 6 || this._rand.Next(30) != 0) - return; - Color newColor = new Color(50, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); - this._dust[Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, 43, Alpha: 254, newColor: newColor, Scale: 0.5f)].velocity *= 0.0f; - } - - private bool IsAlchemyPlantHarvestable(int style) => style == 0 && Main.dayTime || style == 1 && !Main.dayTime || style == 3 && !Main.dayTime && (Main.bloodMoon || Main.moonPhase == 0) || style == 4 && (Main.raining || (double) Main.cloudAlpha > 0.0) || style == 5 && !Main.raining && Main.time > 40500.0; - - private enum TileCounterType - { - Tree, - DisplayDoll, - HatRack, - WindyGrass, - MultiTileGrass, - MultiTileVine, - Vine, - BiomeGrass, - VoidLens, - ReverseVine, - TeleportationPylon, - MasterTrophy, - Count, - } - - private struct TileFlameData - { - public Texture2D flameTexture; - public ulong flameSeed; - public int flameCount; - public Color flameColor; - public int flameRangeXMin; - public int flameRangeXMax; - public int flameRangeYMin; - public int flameRangeYMax; - public float flameRangeMultX; - public float flameRangeMultY; - } - } -} diff --git a/GameContent/Drawing/WallDrawing.cs b/GameContent/Drawing/WallDrawing.cs deleted file mode 100644 index fbd527c..0000000 --- a/GameContent/Drawing/WallDrawing.cs +++ /dev/null @@ -1,178 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Drawing.WallDrawing -// 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; -using Microsoft.Xna.Framework.Graphics; -using System.Diagnostics; -using Terraria.Graphics; -using Terraria.ID; - -namespace Terraria.GameContent.Drawing -{ - public class WallDrawing - { - private static VertexColors _glowPaintColors = new VertexColors(Color.White); - private Tile[,] _tileArray; - private TilePaintSystemV2 _paintSystem; - - public WallDrawing(TilePaintSystemV2 paintSystem) => this._paintSystem = paintSystem; - - public void DrawWalls() - { - float gfxQuality = Main.gfxQuality; - int offScreenRange = Main.offScreenRange; - int num1 = Main.drawToScreen ? 1 : 0; - Vector2 screenPosition = Main.screenPosition; - int screenWidth = Main.screenWidth; - int screenHeight = Main.screenHeight; - int maxTilesX = Main.maxTilesX; - int maxTilesY = Main.maxTilesY; - int[] wallBlend = Main.wallBlend; - SpriteBatch spriteBatch = Main.spriteBatch; - TileBatch tileBatch = Main.tileBatch; - this._tileArray = Main.tile; - Stopwatch stopwatch = new Stopwatch(); - stopwatch.Start(); - int num2; - int num3 = (int) ((double) (num2 = (int) (120.0 * (1.0 - (double) gfxQuality) + 40.0 * (double) gfxQuality)) * 0.400000005960464); - int num4 = (int) ((double) num2 * 0.349999994039536); - int num5 = (int) ((double) num2 * 0.300000011920929); - Vector2 vector2 = new Vector2((float) offScreenRange, (float) offScreenRange); - if (num1 != 0) - vector2 = Vector2.Zero; - int num6 = (int) (((double) screenPosition.X - (double) vector2.X) / 16.0 - 1.0); - int num7 = (int) (((double) screenPosition.X + (double) screenWidth + (double) vector2.X) / 16.0) + 2; - int num8 = (int) (((double) screenPosition.Y - (double) vector2.Y) / 16.0 - 1.0); - int num9 = (int) (((double) screenPosition.Y + (double) screenHeight + (double) vector2.Y) / 16.0) + 5; - int num10 = offScreenRange / 16; - int num11 = offScreenRange / 16; - if (num6 - num10 < 4) - num6 = num10 + 4; - if (num7 + num10 > maxTilesX - 4) - num7 = maxTilesX - num10 - 4; - if (num8 - num11 < 4) - num8 = num11 + 4; - if (num9 + num11 > maxTilesY - 4) - num9 = maxTilesY - num11 - 4; - VertexColors vertices = new VertexColors(); - Rectangle rectangle = new Rectangle(0, 0, 32, 32); - int underworldLayer = Main.UnderworldLayer; - Point screenOverdrawOffset = Main.GetScreenOverdrawOffset(); - for (int index1 = num8 - num11 + screenOverdrawOffset.Y; index1 < num9 + num11 - screenOverdrawOffset.Y; ++index1) - { - for (int index2 = num6 - num10 + screenOverdrawOffset.X; index2 < num7 + num10 - screenOverdrawOffset.X; ++index2) - { - Tile tile = this._tileArray[index2, index1]; - if (tile == null) - { - tile = new Tile(); - this._tileArray[index2, index1] = tile; - } - ushort wall = tile.wall; - if (wall > (ushort) 0 && !this.FullTile(index2, index1)) - { - Color color1 = Lighting.GetColor(index2, index1); - if (tile.wallColor() == (byte) 31) - color1 = Color.White; - if (color1.R != (byte) 0 || color1.G != (byte) 0 || color1.B != (byte) 0 || index1 >= underworldLayer) - { - Main.instance.LoadWall((int) wall); - rectangle.X = tile.wallFrameX(); - rectangle.Y = tile.wallFrameY() + (int) Main.wallFrame[(int) wall] * 180; - switch (tile.wall) - { - case 242: - case 243: - int num12 = 20; - int num13 = ((int) Main.wallFrameCounter[(int) wall] + index2 * 11 + index1 * 27) % (num12 * 8); - rectangle.Y = tile.wallFrameY() + 180 * (num13 / num12); - break; - } - if (Lighting.NotRetro && !Main.wallLight[(int) wall] && tile.wall != (ushort) 241 && (tile.wall < (ushort) 88 || tile.wall > (ushort) 93) && !WorldGen.SolidTile(tile)) - { - Texture2D tileDrawTexture = this.GetTileDrawTexture(tile, index2, index1); - if (tile.wall == (ushort) 44) - { - Color color2 = new Color((int) (byte) Main.DiscoR, (int) (byte) Main.DiscoG, (int) (byte) Main.DiscoB); - vertices.BottomLeftColor = color2; - vertices.BottomRightColor = color2; - vertices.TopLeftColor = color2; - vertices.TopRightColor = color2; - } - else - { - Lighting.GetCornerColors(index2, index1, out vertices); - if (tile.wallColor() == (byte) 31) - vertices = WallDrawing._glowPaintColors; - } - tileBatch.Draw(tileDrawTexture, new Vector2((float) (index2 * 16 - (int) screenPosition.X - 8), (float) (index1 * 16 - (int) screenPosition.Y - 8)) + vector2, new Rectangle?(rectangle), vertices, Vector2.Zero, 1f, SpriteEffects.None); - } - else - { - Color color3 = color1; - if (wall == (ushort) 44) - color3 = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); - Texture2D tileDrawTexture = this.GetTileDrawTexture(tile, index2, index1); - spriteBatch.Draw(tileDrawTexture, new Vector2((float) (index2 * 16 - (int) screenPosition.X - 8), (float) (index1 * 16 - (int) screenPosition.Y - 8)) + vector2, new Rectangle?(rectangle), color3, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - } - if ((int) color1.R > num3 || (int) color1.G > num4 || (int) color1.B > num5) - { - int num14 = this._tileArray[index2 - 1, index1].wall <= (ushort) 0 ? 0 : (wallBlend[(int) this._tileArray[index2 - 1, index1].wall] != wallBlend[(int) tile.wall] ? 1 : 0); - bool flag1 = this._tileArray[index2 + 1, index1].wall > (ushort) 0 && wallBlend[(int) this._tileArray[index2 + 1, index1].wall] != wallBlend[(int) tile.wall]; - bool flag2 = this._tileArray[index2, index1 - 1].wall > (ushort) 0 && wallBlend[(int) this._tileArray[index2, index1 - 1].wall] != wallBlend[(int) tile.wall]; - bool flag3 = this._tileArray[index2, index1 + 1].wall > (ushort) 0 && wallBlend[(int) this._tileArray[index2, index1 + 1].wall] != wallBlend[(int) tile.wall]; - if (num14 != 0) - spriteBatch.Draw(TextureAssets.WallOutline.Value, new Vector2((float) (index2 * 16 - (int) screenPosition.X), (float) (index1 * 16 - (int) screenPosition.Y)) + vector2, new Rectangle?(new Rectangle(0, 0, 2, 16)), color1, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - if (flag1) - spriteBatch.Draw(TextureAssets.WallOutline.Value, new Vector2((float) (index2 * 16 - (int) screenPosition.X + 14), (float) (index1 * 16 - (int) screenPosition.Y)) + vector2, new Rectangle?(new Rectangle(14, 0, 2, 16)), color1, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - if (flag2) - spriteBatch.Draw(TextureAssets.WallOutline.Value, new Vector2((float) (index2 * 16 - (int) screenPosition.X), (float) (index1 * 16 - (int) screenPosition.Y)) + vector2, new Rectangle?(new Rectangle(0, 0, 16, 2)), color1, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - if (flag3) - spriteBatch.Draw(TextureAssets.WallOutline.Value, new Vector2((float) (index2 * 16 - (int) screenPosition.X), (float) (index1 * 16 - (int) screenPosition.Y + 14)) + vector2, new Rectangle?(new Rectangle(0, 14, 16, 2)), color1, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - } - } - } - } - } - Main.instance.DrawTileCracks(2, Main.LocalPlayer.hitReplace); - Main.instance.DrawTileCracks(2, Main.LocalPlayer.hitTile); - TimeLogger.DrawTime(2, stopwatch.Elapsed.TotalMilliseconds); - } - - private Texture2D GetTileDrawTexture(Tile tile, int tileX, int tileY) - { - Texture2D texture2D = TextureAssets.Wall[(int) tile.wall].Value; - Texture2D requestIfNotReady = this._paintSystem.TryGetWallAndRequestIfNotReady((int) tile.wall, (int) tile.wallColor()); - if (requestIfNotReady != null) - texture2D = requestIfNotReady; - return texture2D; - } - - protected bool FullTile(int x, int y) - { - if (this._tileArray[x - 1, y] == null || this._tileArray[x - 1, y].blockType() != 0 || this._tileArray[x + 1, y] == null || this._tileArray[x + 1, y].blockType() != 0) - return false; - Tile tile = this._tileArray[x, y]; - if (tile == null || !tile.active() || (int) tile.type < TileID.Sets.DrawsWalls.Length && TileID.Sets.DrawsWalls[(int) tile.type] || !Main.tileSolid[(int) tile.type] || Main.tileSolidTop[(int) tile.type]) - return false; - int frameX = (int) tile.frameX; - int frameY = (int) tile.frameY; - if (Main.tileLargeFrames[(int) tile.type] > (byte) 0) - { - if ((frameY == 18 || frameY == 108) && (frameX >= 18 && frameX <= 54 || frameX >= 108 && frameX <= 144)) - return true; - } - else if (frameY == 18) - { - if (frameX >= 18 && frameX <= 54 || frameX >= 108 && frameX <= 144) - return true; - } - else if (frameY >= 90 && frameY <= 196 && (frameX <= 70 || frameX >= 144 && frameX <= 232)) - return true; - return false; - } - } -} diff --git a/GameContent/Drawing/WindGrid.cs b/GameContent/Drawing/WindGrid.cs deleted file mode 100644 index a7fe99f..0000000 --- a/GameContent/Drawing/WindGrid.cs +++ /dev/null @@ -1,92 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Drawing.WindGrid -// 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; -using System; - -namespace Terraria.GameContent.Drawing -{ - public class WindGrid - { - private WindGrid.WindCoord[,] _grid = new WindGrid.WindCoord[1, 1]; - private int _width = 1; - private int _height = 1; - private int _gameTime; - - public void SetSize(int targetWidth, int targetHeight) - { - this._width = Math.Max(this._width, targetWidth); - this._height = Math.Max(this._height, targetHeight); - this.ResizeGrid(); - } - - public void Update() - { - ++this._gameTime; - if (!Main.SettingsEnabled_TilesSwayInWind) - return; - this.ScanPlayers(); - } - - public void GetWindTime( - int tileX, - int tileY, - int timeThreshold, - out int windTimeLeft, - out int direction) - { - WindGrid.WindCoord windCoord = this._grid[tileX % this._width, tileY % this._height]; - direction = windCoord.Direction; - if (windCoord.Time + timeThreshold < this._gameTime) - windTimeLeft = 0; - else - windTimeLeft = this._gameTime - windCoord.Time; - } - - private void ResizeGrid() - { - if (this._width <= this._grid.GetLength(0) && this._height <= this._grid.GetLength(1)) - return; - this._grid = new WindGrid.WindCoord[this._width, this._height]; - } - - private void SetWindTime(int tileX, int tileY, int direction) - { - this._grid[tileX % this._width, tileY % this._height].Time = this._gameTime; - this._grid[tileX % this._width, tileY % this._height].Direction = direction; - } - - private void ScanPlayers() - { - switch (Main.netMode) - { - case 0: - this.ScanPlayer(Main.myPlayer); - break; - case 1: - for (int i = 0; i < (int) byte.MaxValue; ++i) - this.ScanPlayer(i); - break; - } - } - - private void ScanPlayer(int i) - { - Player player = Main.player[i]; - if (!player.active || player.dead || (double) player.velocity.X == 0.0 || !Utils.CenteredRectangle(Main.Camera.Center, Main.Camera.UnscaledSize).Intersects(player.Hitbox) || player.velocity.HasNaNs()) - return; - int direction = Math.Sign(player.velocity.X); - foreach (Point point in Collision.GetTilesIn(player.TopLeft, player.BottomRight)) - this.SetWindTime(point.X, point.Y, direction); - } - - private struct WindCoord - { - public int Time; - public int Direction; - } - } -} diff --git a/GameContent/Dyes/LegacyHairShaderData.cs b/GameContent/Dyes/LegacyHairShaderData.cs index 33f6f02..8bcfbfd 100644 --- a/GameContent/Dyes/LegacyHairShaderData.cs +++ b/GameContent/Dyes/LegacyHairShaderData.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Dyes.LegacyHairShaderData -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/GameContent/Dyes/ReflectiveArmorShaderData.cs b/GameContent/Dyes/ReflectiveArmorShaderData.cs index 41b1f5f..35224f5 100644 --- a/GameContent/Dyes/ReflectiveArmorShaderData.cs +++ b/GameContent/Dyes/ReflectiveArmorShaderData.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Dyes.ReflectiveArmorShaderData -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/GameContent/Dyes/TeamArmorShaderData.cs b/GameContent/Dyes/TeamArmorShaderData.cs index 3f687f8..df2786e 100644 --- a/GameContent/Dyes/TeamArmorShaderData.cs +++ b/GameContent/Dyes/TeamArmorShaderData.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Dyes.TeamArmorShaderData -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework.Graphics; diff --git a/GameContent/Dyes/TwilightDyeShaderData.cs b/GameContent/Dyes/TwilightDyeShaderData.cs deleted file mode 100644 index 73acb60..0000000 --- a/GameContent/Dyes/TwilightDyeShaderData.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Dyes.TwilightDyeShaderData -// 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.Graphics; -using Terraria.DataStructures; -using Terraria.Graphics.Shaders; - -namespace Terraria.GameContent.Dyes -{ - public class TwilightDyeShaderData : ArmorShaderData - { - public TwilightDyeShaderData(Ref shader, string passName) - : base(shader, passName) - { - } - - public override void Apply(Entity entity, DrawData? drawData) - { - if (drawData.HasValue) - { - switch (entity) - { - case Player player2 when !player2.isDisplayDollOrInanimate && !player2.isHatRackDoll: - this.UseTargetPosition(Main.screenPosition + drawData.Value.position); - break; - case Projectile _: - this.UseTargetPosition(Main.screenPosition + drawData.Value.position); - break; - default: - this.UseTargetPosition(drawData.Value.position); - break; - } - } - base.Apply(entity, drawData); - } - } -} diff --git a/GameContent/Dyes/TwilightHairDyeShaderData.cs b/GameContent/Dyes/TwilightHairDyeShaderData.cs deleted file mode 100644 index ae9609a..0000000 --- a/GameContent/Dyes/TwilightHairDyeShaderData.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Dyes.TwilightHairDyeShaderData -// 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.Graphics; -using Terraria.DataStructures; -using Terraria.Graphics.Shaders; - -namespace Terraria.GameContent.Dyes -{ - public class TwilightHairDyeShaderData : HairShaderData - { - public TwilightHairDyeShaderData(Ref shader, string passName) - : base(shader, passName) - { - } - - public override void Apply(Player player, DrawData? drawData = null) - { - if (drawData.HasValue) - this.UseTargetPosition(Main.screenPosition + drawData.Value.position); - base.Apply(player, drawData); - } - } -} diff --git a/GameContent/Events/BirthdayParty.cs b/GameContent/Events/BirthdayParty.cs index 6d3dc17..c5edcd1 100644 --- a/GameContent/Events/BirthdayParty.cs +++ b/GameContent/Events/BirthdayParty.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Events.BirthdayParty -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -9,18 +9,17 @@ using System; using System.Collections.Generic; using System.Linq; using Terraria.Graphics.Effects; -using Terraria.ID; using Terraria.Localization; namespace Terraria.GameContent.Events { public class BirthdayParty { - public static bool ManualParty; - public static bool GenuineParty; - public static int PartyDaysOnCooldown; + public static bool ManualParty = false; + public static bool GenuineParty = false; + public static int PartyDaysOnCooldown = 0; public static List CelebratingNPCs = new List(); - private static bool _wasCelebrating; + private static bool _wasCelebrating = false; public static bool PartyIsUp => BirthdayParty.GenuineParty || BirthdayParty.ManualParty; @@ -46,11 +45,9 @@ namespace Terraria.GameContent.Events WorldGen.BroadcastText(NetworkText.FromKey(Lang.misc[99].Key), color); } - private static bool CanNPCParty(NPC n) => n.active && n.townNPC && n.aiStyle != 0 && n.type != 37 && n.type != 453 && n.type != 441 && !NPCID.Sets.IsTownPet[n.type]; - private static void NaturalAttempt() { - if (Main.netMode == 1 || !NPC.AnyNPCs(208)) + if (Main.netMode == 1) return; if (BirthdayParty.PartyDaysOnCooldown > 0) { @@ -63,15 +60,14 @@ namespace Terraria.GameContent.Events List source = new List(); for (int index = 0; index < 200; ++index) { - NPC n = Main.npc[index]; - if (BirthdayParty.CanNPCParty(n)) - source.Add(n); + NPC npc = Main.npc[index]; + if (npc.active && npc.townNPC && npc.type != 37 && npc.type != 453 && npc.aiStyle != 0) + source.Add(npc); } if (source.Count < 5) return; BirthdayParty.GenuineParty = true; BirthdayParty.PartyDaysOnCooldown = Main.rand.Next(5, 11); - NPC.freeCake = true; BirthdayParty.CelebratingNPCs.Clear(); List intList = new List(); int num = 1; @@ -91,7 +87,6 @@ namespace Terraria.GameContent.Events WorldGen.BroadcastText(NetworkText.FromKey("Game.BirthdayParty_2", (object) Main.npc[BirthdayParty.CelebratingNPCs[0]].GetGivenOrTypeNetName(), (object) Main.npc[BirthdayParty.CelebratingNPCs[1]].GetGivenOrTypeNetName()), color); else WorldGen.BroadcastText(NetworkText.FromKey("Game.BirthdayParty_1", (object) Main.npc[BirthdayParty.CelebratingNPCs[0]].GetGivenOrTypeNetName()), color); - NetMessage.SendData(7); } } @@ -132,7 +127,8 @@ namespace Terraria.GameContent.Events { for (int index = 0; index < BirthdayParty.CelebratingNPCs.Count; ++index) { - if (!BirthdayParty.CanNPCParty(Main.npc[BirthdayParty.CelebratingNPCs[index]])) + NPC npc = Main.npc[BirthdayParty.CelebratingNPCs[index]]; + if (!npc.active || !npc.townNPC || npc.type == 37 || npc.type == 453 || npc.aiStyle == 0) BirthdayParty.CelebratingNPCs.RemoveAt(index); } if (BirthdayParty.CelebratingNPCs.Count == 0) diff --git a/GameContent/Events/CultistRitual.cs b/GameContent/Events/CultistRitual.cs index a27ce78..1c36ae7 100644 --- a/GameContent/Events/CultistRitual.cs +++ b/GameContent/Events/CultistRitual.cs @@ -1,11 +1,10 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Events.CultistRitual -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; -using Terraria.ID; namespace Terraria.GameContent.Events { @@ -71,7 +70,7 @@ namespace Terraria.GameContent.Events { int num2 = tileCoordinates.X + index1 * 2; int num3 = tileCoordinates.Y + index2; - if ((WorldGen.SolidTile(num2, num3) || TileID.Sets.Platforms[(int) Framing.GetTileSafely(num2, num3).type]) && (!Collision.SolidTiles(num2 - 1, num2 + 1, num3 - 3, num3 - 1) || !Collision.SolidTiles(num2, num2, num3 - 3, num3 - 1) && !Collision.SolidTiles(num2 + 1, num2 + 1, num3 - 3, num3 - 2) && !Collision.SolidTiles(num2 - 1, num2 - 1, num3 - 3, num3 - 2))) + if (WorldGen.SolidTile(num2, num3) && !Collision.SolidTiles(num2 - 1, num2 + 1, num3 - 3, num3 - 1)) { pointArray[num1++] = new Point(num2, num3); break; diff --git a/GameContent/Events/DD2Event.cs b/GameContent/Events/DD2Event.cs index fa20e5f..74a555f 100644 --- a/GameContent/Events/DD2Event.cs +++ b/GameContent/Events/DD2Event.cs @@ -1,17 +1,16 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Events.DD2Event -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using System.Collections.Generic; using System.IO; -using Terraria.Chat; using Terraria.Graphics.Effects; using Terraria.ID; using Terraria.Localization; -using Terraria.WorldBuilding; +using Terraria.World.Generation; namespace Terraria.GameContent.Events { @@ -20,24 +19,24 @@ namespace Terraria.GameContent.Events private static readonly Color INFO_NEW_WAVE_COLOR = new Color(175, 55, (int) byte.MaxValue); private static readonly Color INFO_START_INVASION_COLOR = new Color(50, (int) byte.MaxValue, 130); private const int INVASION_ID = 3; - public static bool DownedInvasionT1; - public static bool DownedInvasionT2; - public static bool DownedInvasionT3; - public static bool LostThisRun; - public static bool WonThisRun; + public static bool DownedInvasionT1 = false; + public static bool DownedInvasionT2 = false; + public static bool DownedInvasionT3 = false; + public static bool LostThisRun = false; + public static bool WonThisRun = false; public static int LaneSpawnRate = 60; - private static bool _downedDarkMageT1; - private static bool _downedOgreT2; - private static bool _spawnedBetsyT3; - public static bool Ongoing; - public static Microsoft.Xna.Framework.Rectangle ArenaHitbox; - private static int _arenaHitboxingCooldown; - public static int OngoingDifficulty; + private static bool _downedDarkMageT1 = false; + private static bool _downedOgreT2 = false; + private static bool _spawnedBetsyT3 = false; + public static bool Ongoing = false; + public static Microsoft.Xna.Framework.Rectangle ArenaHitbox = new Microsoft.Xna.Framework.Rectangle(); + private static int _arenaHitboxingCooldown = 0; + public static int OngoingDifficulty = 0; private static List _deadGoblinSpots = new List(); - private static int _crystalsDropping_lastWave; - private static int _crystalsDropping_toDrop; - private static int _crystalsDropping_alreadyDropped; - private static int _timeLeftUntilSpawningBegins; + private static int _crystalsDropping_lastWave = 0; + private static int _crystalsDropping_toDrop = 0; + private static int _crystalsDropping_alreadyDropped = 0; + private static int _timeLeftUntilSpawningBegins = 0; public static bool ReadyToFindBartender => NPC.downedBoss2; @@ -206,11 +205,11 @@ namespace Terraria.GameContent.Events private static void WinInvasionInternal() { - if (DD2Event.OngoingDifficulty >= 1) + if (DD2Event.OngoingDifficulty <= 1) DD2Event.DownedInvasionT1 = true; - if (DD2Event.OngoingDifficulty >= 2) + if (DD2Event.OngoingDifficulty <= 2) DD2Event.DownedInvasionT2 = true; - if (DD2Event.OngoingDifficulty >= 3) + if (DD2Event.OngoingDifficulty <= 3) DD2Event.DownedInvasionT3 = true; if (DD2Event.OngoingDifficulty == 1) DD2Event.DropMedals(3); @@ -450,7 +449,7 @@ namespace Terraria.GameContent.Events LocalizedText text = Language.GetText("DungeonDefenders2.BartenderWarning"); Color color = new Color((int) byte.MaxValue, (int) byte.MaxValue, 0); if (Main.netMode == 2) - ChatHelper.SendChatMessageToClient(NetworkText.FromKey(text.Key), color, client); + NetMessage.SendChatMessageToClient(NetworkText.FromKey(text.Key), color, client); else Main.NewText(text.Value, color.R, color.G, color.B); } @@ -459,7 +458,6 @@ namespace Terraria.GameContent.Events { DD2Event.ClearAllTowersInGame(); DD2Event.ClearAllDD2HostilesInGame(); - DD2Event.ClearAllDD2EnergyCrystalsInChests(); if (Main.netMode != 2) return; NetMessage.SendData(114); @@ -501,29 +499,6 @@ namespace Terraria.GameContent.Events } } - public static void ClearAllDD2EnergyCrystalsInChests() - { - if (Main.netMode == 1) - return; - List currentlyOpenChests = Chest.GetCurrentlyOpenChests(); - for (int number = 0; number < 8000; ++number) - { - Chest chest = Main.chest[number]; - if (chest != null && currentlyOpenChests.Contains(number)) - { - for (int index = 0; index < 40; ++index) - { - if (chest.item[index].type == 3822 && chest.item[index].stack > 0) - { - chest.item[index].TurnToAir(); - if (Main.netMode != 0) - NetMessage.SendData(32, number: number, number2: ((float) index)); - } - } - } - } - } - public static void AnnounceGoblinDeath(NPC n) => DD2Event._deadGoblinSpots.Add(n.Bottom); public static bool CanRaiseGoblinsHere(Vector2 spot) @@ -706,8 +681,6 @@ namespace Terraria.GameContent.Events break; } } - if (Main.netMode != 0 && Main.expertMode) - DD2Event._crystalsDropping_toDrop = (int) ((double) DD2Event._crystalsDropping_toDrop * (double) NPC.GetBalance()); float num = (float) currentKillCount / (float) requiredKillCount; if ((double) DD2Event._crystalsDropping_alreadyDropped >= (double) DD2Event._crystalsDropping_toDrop * (double) num) return false; @@ -836,7 +809,7 @@ namespace Terraria.GameContent.Events int num3 = 6; if (NPC.waveNumber > 4) num3 = 8; - for (int index = 1; index < Main.CurrentFrameFlags.ActivePlayersCount; ++index) + for (int index = 1; index < Main.ActivePlayersCount; ++index) { num1 = (int) ((double) num1 * 1.3); num2 = (int) ((double) num2 * 1.3); @@ -1118,7 +1091,7 @@ namespace Terraria.GameContent.Events int num6 = 3; if (NPC.waveNumber > 5) num6 = 5; - for (int index = 1; index < Main.CurrentFrameFlags.ActivePlayersCount; ++index) + for (int index = 1; index < Main.ActivePlayersCount; ++index) { num1 = (int) ((double) num1 * 1.3); num2 = (int) ((double) num2 * 1.3); @@ -1491,7 +1464,7 @@ namespace Terraria.GameContent.Events if (NPC.waveNumber > 5) num6 = 6; int num7 = 4; - for (int index = 1; index < Main.CurrentFrameFlags.ActivePlayersCount; ++index) + for (int index = 1; index < Main.ActivePlayersCount; ++index) { num1 = (int) ((double) num1 * 1.3); num2 = (int) ((double) num2 * 1.3); diff --git a/GameContent/Events/LanternNight.cs b/GameContent/Events/LanternNight.cs deleted file mode 100644 index a83e1de..0000000 --- a/GameContent/Events/LanternNight.cs +++ /dev/null @@ -1,113 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Events.LanternNight -// 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; -using Terraria.Graphics.Effects; - -namespace Terraria.GameContent.Events -{ - public class LanternNight - { - public static bool ManualLanterns; - public static bool GenuineLanterns; - public static bool NextNightIsLanternNight; - public static int LanternNightsOnCooldown; - private static bool _wasLanternNight; - - public static bool LanternsUp => LanternNight.GenuineLanterns || LanternNight.ManualLanterns; - - public static void CheckMorning() - { - bool flag = false; - if (LanternNight.GenuineLanterns) - { - flag = true; - LanternNight.GenuineLanterns = false; - } - if (LanternNight.ManualLanterns) - { - flag = true; - LanternNight.ManualLanterns = false; - } - int num = flag ? 1 : 0; - } - - public static void CheckNight() => LanternNight.NaturalAttempt(); - - public static bool LanternsCanPersist() => !Main.dayTime && LanternNight.LanternsCanStart(); - - public static bool LanternsCanStart() => !Main.bloodMoon && !Main.pumpkinMoon && !Main.snowMoon && Main.invasionType == 0 && NPC.MoonLordCountdown == 0 && !LanternNight.BossIsActive(); - - private static bool BossIsActive() - { - for (int index = 0; index < 200; ++index) - { - NPC npc = Main.npc[index]; - if (npc.active && (npc.boss || npc.type >= 13 && npc.type <= 15)) - return true; - } - return false; - } - - private static void NaturalAttempt() - { - if (Main.netMode == 1 || !LanternNight.LanternsCanStart()) - return; - bool flag = false; - if (LanternNight.LanternNightsOnCooldown > 0) - --LanternNight.LanternNightsOnCooldown; - if (LanternNight.LanternNightsOnCooldown == 0 && NPC.downedMoonlord && Main.rand.Next(14) == 0) - flag = true; - if (!flag && LanternNight.NextNightIsLanternNight) - { - LanternNight.NextNightIsLanternNight = false; - flag = true; - } - if (!flag) - return; - LanternNight.GenuineLanterns = true; - LanternNight.LanternNightsOnCooldown = Main.rand.Next(5, 11); - } - - public static void ToggleManualLanterns() - { - int num1 = LanternNight.LanternsUp ? 1 : 0; - if (Main.netMode != 1) - LanternNight.ManualLanterns = !LanternNight.ManualLanterns; - int num2 = LanternNight.LanternsUp ? 1 : 0; - if (num1 == num2 || Main.netMode != 2) - return; - NetMessage.SendData(7); - } - - public static void WorldClear() - { - LanternNight.ManualLanterns = false; - LanternNight.GenuineLanterns = false; - LanternNight.LanternNightsOnCooldown = 0; - LanternNight._wasLanternNight = false; - } - - public static void UpdateTime() - { - if (LanternNight.GenuineLanterns && !LanternNight.LanternsCanPersist()) - LanternNight.GenuineLanterns = false; - if (LanternNight._wasLanternNight != LanternNight.LanternsUp) - { - if (Main.netMode != 2) - { - if (LanternNight.LanternsUp) - SkyManager.Instance.Activate("Lantern", new Vector2()); - else - SkyManager.Instance.Deactivate("Lantern"); - } - else - NetMessage.SendData(7); - } - LanternNight._wasLanternNight = LanternNight.LanternsUp; - } - } -} diff --git a/GameContent/Events/MoonlordDeathDrama.cs b/GameContent/Events/MoonlordDeathDrama.cs index 615a692..b16ac0c 100644 --- a/GameContent/Events/MoonlordDeathDrama.cs +++ b/GameContent/Events/MoonlordDeathDrama.cs @@ -1,14 +1,14 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Events.MoonlordDeathDrama -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using System; using System.Collections.Generic; +using Terraria.Graphics; using Terraria.Utilities; namespace Terraria.GameContent.Events @@ -18,8 +18,8 @@ namespace Terraria.GameContent.Events private static List _pieces = new List(); private static List _explosions = new List(); private static List _lightSources = new List(); - private static float whitening; - private static float requestedLight; + private static float whitening = 0.0f; + private static float requestedLight = 0.0f; public static void Update() { @@ -90,23 +90,23 @@ namespace Terraria.GameContent.Events if ((double) MoonlordDeathDrama.whitening == 0.0) return; Color color = Color.White * MoonlordDeathDrama.whitening; - spriteBatch.Draw(TextureAssets.MagicPixel.Value, new Rectangle(-2, -2, Main.screenWidth + 4, Main.screenHeight + 4), new Rectangle?(new Rectangle(0, 0, 1, 1)), color); + spriteBatch.Draw(Main.magicPixel, new Rectangle(-2, -2, Main.screenWidth + 4, Main.screenHeight + 4), new Rectangle?(new Rectangle(0, 0, 1, 1)), color); } public static void ThrowPieces(Vector2 MoonlordCoreCenter, int DramaSeed) { UnifiedRandom r = new UnifiedRandom(DramaSeed); Vector2 vector2_1 = Vector2.UnitY.RotatedBy((double) r.NextFloat() * 1.57079637050629 - 0.785398185253143 + 3.14159274101257); - MoonlordDeathDrama._pieces.Add(new MoonlordDeathDrama.MoonlordPiece(Main.Assets.Request("Images/Misc/MoonExplosion/Spine", (AssetRequestMode) 1).Value, new Vector2(64f, 150f), MoonlordCoreCenter + new Vector2(0.0f, 50f), vector2_1 * 6f, 0.0f, (float) ((double) r.NextFloat() * 0.100000001490116 - 0.0500000007450581))); + MoonlordDeathDrama._pieces.Add(new MoonlordDeathDrama.MoonlordPiece(TextureManager.Load("Images/Misc/MoonExplosion/Spine"), new Vector2(64f, 150f), MoonlordCoreCenter + new Vector2(0.0f, 50f), vector2_1 * 6f, 0.0f, (float) ((double) r.NextFloat() * 0.100000001490116 - 0.0500000007450581))); Vector2 vector2_2 = Vector2.UnitY.RotatedBy((double) r.NextFloat() * 1.57079637050629 - 0.785398185253143 + 3.14159274101257); - MoonlordDeathDrama._pieces.Add(new MoonlordDeathDrama.MoonlordPiece(Main.Assets.Request("Images/Misc/MoonExplosion/Shoulder", (AssetRequestMode) 1).Value, new Vector2(40f, 120f), MoonlordCoreCenter + new Vector2(50f, -120f), vector2_2 * 10f, 0.0f, (float) ((double) r.NextFloat() * 0.100000001490116 - 0.0500000007450581))); + MoonlordDeathDrama._pieces.Add(new MoonlordDeathDrama.MoonlordPiece(TextureManager.Load("Images/Misc/MoonExplosion/Shoulder"), new Vector2(40f, 120f), MoonlordCoreCenter + new Vector2(50f, -120f), vector2_2 * 10f, 0.0f, (float) ((double) r.NextFloat() * 0.100000001490116 - 0.0500000007450581))); Vector2 vector2_3 = Vector2.UnitY.RotatedBy((double) r.NextFloat() * 1.57079637050629 - 0.785398185253143 + 3.14159274101257); - MoonlordDeathDrama._pieces.Add(new MoonlordDeathDrama.MoonlordPiece(Main.Assets.Request("Images/Misc/MoonExplosion/Torso", (AssetRequestMode) 1).Value, new Vector2(192f, 252f), MoonlordCoreCenter, vector2_3 * 8f, 0.0f, (float) ((double) r.NextFloat() * 0.100000001490116 - 0.0500000007450581))); + MoonlordDeathDrama._pieces.Add(new MoonlordDeathDrama.MoonlordPiece(TextureManager.Load("Images/Misc/MoonExplosion/Torso"), new Vector2(192f, 252f), MoonlordCoreCenter, vector2_3 * 8f, 0.0f, (float) ((double) r.NextFloat() * 0.100000001490116 - 0.0500000007450581))); Vector2 vector2_4 = Vector2.UnitY.RotatedBy((double) r.NextFloat() * 1.57079637050629 - 0.785398185253143 + 3.14159274101257); - MoonlordDeathDrama._pieces.Add(new MoonlordDeathDrama.MoonlordPiece(Main.Assets.Request("Images/Misc/MoonExplosion/Head", (AssetRequestMode) 1).Value, new Vector2(138f, 185f), MoonlordCoreCenter - new Vector2(0.0f, 200f), vector2_4 * 12f, 0.0f, (float) ((double) r.NextFloat() * 0.100000001490116 - 0.0500000007450581))); + MoonlordDeathDrama._pieces.Add(new MoonlordDeathDrama.MoonlordPiece(TextureManager.Load("Images/Misc/MoonExplosion/Head"), new Vector2(138f, 185f), MoonlordCoreCenter - new Vector2(0.0f, 200f), vector2_4 * 12f, 0.0f, (float) ((double) r.NextFloat() * 0.100000001490116 - 0.0500000007450581))); } - public static void AddExplosion(Vector2 spot) => MoonlordDeathDrama._explosions.Add(new MoonlordDeathDrama.MoonlordExplosion(Main.Assets.Request("Images/Misc/MoonExplosion/Explosion", (AssetRequestMode) 1).Value, spot, Main.rand.Next(2, 4))); + public static void AddExplosion(Vector2 spot) => MoonlordDeathDrama._explosions.Add(new MoonlordDeathDrama.MoonlordExplosion(TextureManager.Load("Images/Misc/MoonExplosion/Explosion"), spot, Main.rand.Next(2, 4))); public static void RequestLight(float light, Vector2 spot) { diff --git a/GameContent/Events/MysticLogFairiesEvent.cs b/GameContent/Events/MysticLogFairiesEvent.cs deleted file mode 100644 index 867c5ce..0000000 --- a/GameContent/Events/MysticLogFairiesEvent.cs +++ /dev/null @@ -1,150 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Events.MysticLogFairiesEvent -// 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; -using System; -using System.Collections.Generic; -using Terraria.Enums; - -namespace Terraria.GameContent.Events -{ - public class MysticLogFairiesEvent - { - private bool _canSpawnFairies; - private int _delayUntilNextAttempt; - private const int DELAY_BETWEEN_ATTEMPTS = 60; - private List _stumpCoords = new List(); - - public void WorldClear() - { - this._canSpawnFairies = false; - this._delayUntilNextAttempt = 0; - this._stumpCoords.Clear(); - } - - public void StartWorld() - { - if (Main.netMode == 1) - return; - this.ScanWholeOverworldForLogs(); - } - - public void StartNight() - { - if (Main.netMode == 1) - return; - this._canSpawnFairies = true; - this._delayUntilNextAttempt = 0; - this.ScanWholeOverworldForLogs(); - } - - public void UpdateTime() - { - if (Main.netMode == 1 || !this._canSpawnFairies || !this.IsAGoodTime()) - return; - this._delayUntilNextAttempt = Math.Max(0, this._delayUntilNextAttempt - Main.dayRate); - if (this._delayUntilNextAttempt != 0) - return; - this._delayUntilNextAttempt = 60; - this.TrySpawningFairies(); - } - - private bool IsAGoodTime() => !Main.dayTime && Main.time >= 6480.00009655952 && Main.time <= 25920.0003862381; - - private void TrySpawningFairies() - { - if ((double) Main.maxRaining > 0.0 || Main.bloodMoon || NPC.MoonLordCountdown > 0 || Main.snowMoon || Main.pumpkinMoon || Main.invasionType > 0 || this._stumpCoords.Count == 0) - return; - int oneOverSpawnChance = this.GetOneOverSpawnChance(); - bool flag = false; - for (int index = 0; index < Main.dayRate; ++index) - { - if (Main.rand.Next(oneOverSpawnChance) == 0) - { - flag = true; - break; - } - } - if (!flag) - return; - Point stumpCoord = this._stumpCoords[Main.rand.Next(this._stumpCoords.Count)]; - Vector2 worldCoordinates = stumpCoord.ToWorldCoordinates(24f); - worldCoordinates.Y -= 50f; - if (WorldGen.PlayerLOS(stumpCoord.X, stumpCoord.Y)) - return; - int num1 = Main.rand.Next(1, 4); - if (Main.rand.Next(7) == 0) - ++num1; - int num2 = (int) Utils.SelectRandom(Main.rand, (short) 585, (short) 584, (short) 583); - for (int index = 0; index < num1; ++index) - { - int Type = (int) Utils.SelectRandom(Main.rand, (short) 585, (short) 584, (short) 583); - int number = NPC.NewNPC((int) worldCoordinates.X, (int) worldCoordinates.Y, Type); - if (Main.netMode == 2 && number < 200) - NetMessage.SendData(23, number: number); - } - this._canSpawnFairies = false; - } - - public void FallenLogDestroyed() - { - if (Main.netMode == 1) - return; - this.ScanWholeOverworldForLogs(); - } - - private void ScanWholeOverworldForLogs() - { - this._stumpCoords.Clear(); - NPC.fairyLog = false; - int num1 = (int) Main.worldSurface - 10; - int num2 = 100; - int num3 = Main.maxTilesX - 100; - int num4 = 3; - int num5 = 2; - List pointList = new List(); - for (int x = 100; x < num3; x += num4) - { - for (int y = num1; y >= num2; y -= num5) - { - Tile tile = Main.tile[x, y]; - if (tile.active() && tile.type == (ushort) 488 && tile.liquid == (byte) 0) - { - pointList.Add(new Point(x, y)); - NPC.fairyLog = true; - } - } - } - foreach (Point stumpRandomPoint in pointList) - this._stumpCoords.Add(this.GetStumpTopLeft(stumpRandomPoint)); - } - - private Point GetStumpTopLeft(Point stumpRandomPoint) - { - Tile tile = Main.tile[stumpRandomPoint.X, stumpRandomPoint.Y]; - Point point = stumpRandomPoint; - point.X -= (int) tile.frameX / 18; - point.Y -= (int) tile.frameY / 18; - return point; - } - - private int GetOneOverSpawnChance() - { - int num; - switch (Main.GetMoonPhase()) - { - case MoonPhase.Full: - case MoonPhase.Empty: - num = 3600; - break; - default: - num = 10800; - break; - } - return num / 60; - } - } -} diff --git a/GameContent/Events/Sandstorm.cs b/GameContent/Events/Sandstorm.cs index 809417f..16dae63 100644 --- a/GameContent/Events/Sandstorm.cs +++ b/GameContent/Events/Sandstorm.cs @@ -1,10 +1,11 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Events.Sandstorm -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using System; using Terraria.Graphics.Effects; using Terraria.Utilities; @@ -13,16 +14,12 @@ namespace Terraria.GameContent.Events { public class Sandstorm { - private const int SANDSTORM_DURATION_MINIMUM = 28800; - private const int SANDSTORM_DURATION_MAXIMUM = 86400; public static bool Happening; public static int TimeLeft; public static float Severity; public static float IntendedSeverity; private static bool _effectsUp; - private static bool HasSufficientWind() => (double) Math.Abs(Main.windSpeedCurrent) >= 0.600000023841858; - public static void WorldClear() => Sandstorm.Happening = false; public static void UpdateTime() @@ -34,18 +31,17 @@ namespace Terraria.GameContent.Events if (Sandstorm.TimeLeft > 86400) Sandstorm.TimeLeft = 0; Sandstorm.TimeLeft -= Main.dayRate; - if (!Sandstorm.HasSufficientWind()) - Sandstorm.TimeLeft -= 15 * Main.dayRate; - if ((double) Main.windSpeedCurrent == 0.0) - Sandstorm.TimeLeft = 0; if (Sandstorm.TimeLeft <= 0) Sandstorm.StopSandstorm(); } - else if (Sandstorm.HasSufficientWind()) + else { + int num = (int) ((double) Main.windSpeed * 100.0); for (int index = 0; index < Main.dayRate; ++index) { - if (Main.rand.Next(86400) == 0) + if (Main.rand.Next(777600) == 0) + Sandstorm.StartSandstorm(); + else if ((Main.numClouds < 40 || Math.Abs(num) > 50) && Main.rand.Next(518400) == 0) Sandstorm.StartSandstorm(); } } @@ -65,10 +61,6 @@ namespace Terraria.GameContent.Events private static void UpdateSeverity() { - if (float.IsNaN(Sandstorm.Severity)) - Sandstorm.Severity = 0.0f; - if (float.IsNaN(Sandstorm.IntendedSeverity)) - Sandstorm.IntendedSeverity = 0.0f; int num1 = Math.Sign(Sandstorm.IntendedSeverity - Sandstorm.Severity); Sandstorm.Severity = MathHelper.Clamp(Sandstorm.Severity + 3f / 1000f * (float) num1, 0.0f, 1f); int num2 = Math.Sign(Sandstorm.IntendedSeverity - Sandstorm.Severity); @@ -80,7 +72,7 @@ namespace Terraria.GameContent.Events private static void StartSandstorm() { Sandstorm.Happening = true; - Sandstorm.TimeLeft = Main.rand.Next(28800, 86401); + Sandstorm.TimeLeft = (int) (3600.0 * (8.0 + (double) Main.rand.NextFloat() * 16.0)); Sandstorm.ChangeSeverityIntentions(); } @@ -111,27 +103,25 @@ namespace Terraria.GameContent.Events } } - public static bool ShouldSandstormDustPersist() => Sandstorm.Happening && Main.player[Main.myPlayer].ZoneSandstorm && (Main.bgStyle == 2 || Main.bgStyle == 5) && Main.bgDelay < 50; - public static void EmitDust() { if (Main.gamePaused) return; - int sandTileCount = Main.SceneMetrics.SandTileCount; + int sandTiles = Main.sandTiles; Player player = Main.player[Main.myPlayer]; - bool flag = Sandstorm.ShouldSandstormDustPersist(); + bool flag = Sandstorm.Happening && player.ZoneSandstorm && (Main.bgStyle == 2 || Main.bgStyle == 5) && Main.bgDelay < 50; Sandstorm.HandleEffectAndSky(flag && Main.UseStormEffects); - if (sandTileCount < 100 || (double) player.position.Y > Main.worldSurface * 16.0 || player.ZoneBeach) + if (sandTiles < 100 || (double) player.position.Y > Main.worldSurface * 16.0 || player.ZoneBeach) return; int maxValue1 = 1; if (!flag || Main.rand.Next(maxValue1) != 0) return; - int num1 = Math.Sign(Main.windSpeedCurrent); - float amount = Math.Abs(Main.windSpeedCurrent); + int num1 = Math.Sign(Main.windSpeed); + float amount = Math.Abs(Main.windSpeed); if ((double) amount < 0.00999999977648258) return; float num2 = (float) num1 * MathHelper.Lerp(0.9f, 1f, amount); - float num3 = 2000f / (float) sandTileCount; + float num3 = 2000f / (float) sandTiles; float num4 = MathHelper.Clamp(3f / num3, 0.77f, 1f); int num5 = (int) num3; int num6 = (int) (1000.0 * (double) ((float) Main.screenWidth / (float) Main.maxScreenW)); @@ -143,10 +133,10 @@ namespace Terraria.GameContent.Events float screenHeight = (float) Main.screenHeight; Vector2 vector2 = Main.screenPosition + player.velocity; WeightedRandom weightedRandom = new WeightedRandom(); - weightedRandom.Add(new Color(200, 160, 20, 180), (double) (Main.SceneMetrics.GetTileCount((ushort) 53) + Main.SceneMetrics.GetTileCount((ushort) 396) + Main.SceneMetrics.GetTileCount((ushort) 397))); - weightedRandom.Add(new Color(103, 98, 122, 180), (double) (Main.SceneMetrics.GetTileCount((ushort) 112) + Main.SceneMetrics.GetTileCount((ushort) 400) + Main.SceneMetrics.GetTileCount((ushort) 398))); - weightedRandom.Add(new Color(135, 43, 34, 180), (double) (Main.SceneMetrics.GetTileCount((ushort) 234) + Main.SceneMetrics.GetTileCount((ushort) 401) + Main.SceneMetrics.GetTileCount((ushort) 399))); - weightedRandom.Add(new Color(213, 196, 197, 180), (double) (Main.SceneMetrics.GetTileCount((ushort) 116) + Main.SceneMetrics.GetTileCount((ushort) 403) + Main.SceneMetrics.GetTileCount((ushort) 402))); + weightedRandom.Add(new Color(200, 160, 20, 180), (double) (Main.screenTileCounts[53] + Main.screenTileCounts[396] + Main.screenTileCounts[397])); + weightedRandom.Add(new Color(103, 98, 122, 180), (double) (Main.screenTileCounts[112] + Main.screenTileCounts[400] + Main.screenTileCounts[398])); + weightedRandom.Add(new Color(135, 43, 34, 180), (double) (Main.screenTileCounts[234] + Main.screenTileCounts[401] + Main.screenTileCounts[399])); + weightedRandom.Add(new Color(213, 196, 197, 180), (double) (Main.screenTileCounts[116] + Main.screenTileCounts[403] + Main.screenTileCounts[402])); float num10 = MathHelper.Lerp(0.2f, 0.35f, Sandstorm.Severity); float num11 = MathHelper.Lerp(0.5f, 0.7f, Sandstorm.Severity); int maxValue2 = (int) MathHelper.Lerp(1f, 10f, (float) (((double) num4 - 0.769999980926514) / 0.230000019073486)); @@ -162,11 +152,11 @@ namespace Terraria.GameContent.Events if ((double) Position.X < 0.0 || (double) Position.X > (double) Main.screenWidth) Position.Y += (float) ((double) Main.rand.NextFloat() * (double) screenHeight * 0.899999976158142); Position += vector2; - int x1 = (int) Position.X / 16; - int y1 = (int) Position.Y / 16; - if (WorldGen.InWorld(x1, y1, 10) && Main.tile[x1, y1] != null && Main.tile[x1, y1].wall == (ushort) 0) + int index2 = (int) Position.X / 16; + int index3 = (int) Position.Y / 16; + if (Main.tile[index2, index3] != null && Main.tile[index2, index3].wall == (byte) 0) { - for (int index2 = 0; index2 < 1; ++index2) + for (int index4 = 0; index4 < 1; ++index4) { Dust dust = Main.dust[Dust.NewDust(Position, 10, 10, 268)]; dust.velocity.Y = (float) (2.0 + (double) Main.rand.NextFloat() * 0.200000002980232); @@ -185,13 +175,13 @@ namespace Terraria.GameContent.Events { if (Main.rand.Next(maxValue2) != 0) { - --index2; + --index4; Position += Utils.RandomVector2(Main.rand, -10f, 10f) + dust.velocity * -1.1f; - int x2 = (int) Position.X / 16; - int y2 = (int) Position.Y / 16; - if (WorldGen.InWorld(x2, y2, 10) && Main.tile[x2, y2] != null) + int x = (int) Position.X / 16; + int y = (int) Position.Y / 16; + if (WorldGen.InWorld(x, y, 10) && Main.tile[x, y] != null) { - int wall = (int) Main.tile[x2, y2].wall; + int wall = (int) Main.tile[x, y].wall; } } } @@ -204,5 +194,9 @@ namespace Terraria.GameContent.Events } } } + + public static void DrawGrains(SpriteBatch spriteBatch) + { + } } } diff --git a/GameContent/Events/ScreenDarkness.cs b/GameContent/Events/ScreenDarkness.cs index 3d0dde7..7e87aa9 100644 --- a/GameContent/Events/ScreenDarkness.cs +++ b/GameContent/Events/ScreenDarkness.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Events.ScreenDarkness -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -34,7 +34,7 @@ namespace Terraria.GameContent.Events if ((double) ScreenDarkness.screenObstruction == 0.0) return; Color color = Color.Black * ScreenDarkness.screenObstruction; - spriteBatch.Draw(TextureAssets.MagicPixel.Value, new Rectangle(-2, -2, Main.screenWidth + 4, Main.screenHeight + 4), new Rectangle?(new Rectangle(0, 0, 1, 1)), color); + spriteBatch.Draw(Main.magicPixel, new Rectangle(-2, -2, Main.screenWidth + 4, Main.screenHeight + 4), new Rectangle?(new Rectangle(0, 0, 1, 1)), color); } public static void DrawFront(SpriteBatch spriteBatch) @@ -42,7 +42,7 @@ namespace Terraria.GameContent.Events if ((double) ScreenDarkness.screenObstruction == 0.0) return; Color color = new Color(0, 0, 120) * ScreenDarkness.screenObstruction * 0.3f; - spriteBatch.Draw(TextureAssets.MagicPixel.Value, new Rectangle(-2, -2, Main.screenWidth + 4, Main.screenHeight + 4), new Rectangle?(new Rectangle(0, 0, 1, 1)), color); + spriteBatch.Draw(Main.magicPixel, new Rectangle(-2, -2, Main.screenWidth + 4, Main.screenHeight + 4), new Rectangle?(new Rectangle(0, 0, 1, 1)), color); } } } diff --git a/GameContent/Events/ScreenObstruction.cs b/GameContent/Events/ScreenObstruction.cs index 95dadab..f7ea22b 100644 --- a/GameContent/Events/ScreenObstruction.cs +++ b/GameContent/Events/ScreenObstruction.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Events.ScreenObstruction -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -30,20 +30,20 @@ namespace Terraria.GameContent.Events if ((double) ScreenObstruction.screenObstruction == 0.0) return; Color color = Color.Black * ScreenObstruction.screenObstruction; - int num1 = TextureAssets.Extra[49].Width(); - int num2 = 10; + int width = Main.extraTexture[49].Width; + int num = 10; Rectangle rect = Main.player[Main.myPlayer].getRect(); - rect.Inflate((num1 - rect.Width) / 2, (num1 - rect.Height) / 2 + num2 / 2); - rect.Offset(-(int) Main.screenPosition.X, -(int) Main.screenPosition.Y + (int) Main.player[Main.myPlayer].gfxOffY - num2); + rect.Inflate((width - rect.Width) / 2, (width - rect.Height) / 2 + num / 2); + rect.Offset(-(int) Main.screenPosition.X, -(int) Main.screenPosition.Y + (int) Main.player[Main.myPlayer].gfxOffY - num); Rectangle destinationRectangle1 = Rectangle.Union(new Rectangle(0, 0, 1, 1), new Rectangle(rect.Right - 1, rect.Top - 1, 1, 1)); Rectangle destinationRectangle2 = Rectangle.Union(new Rectangle(Main.screenWidth - 1, 0, 1, 1), new Rectangle(rect.Right, rect.Bottom - 1, 1, 1)); Rectangle destinationRectangle3 = Rectangle.Union(new Rectangle(Main.screenWidth - 1, Main.screenHeight - 1, 1, 1), new Rectangle(rect.Left, rect.Bottom, 1, 1)); Rectangle destinationRectangle4 = Rectangle.Union(new Rectangle(0, Main.screenHeight - 1, 1, 1), new Rectangle(rect.Left - 1, rect.Top, 1, 1)); - spriteBatch.Draw(TextureAssets.MagicPixel.Value, destinationRectangle1, new Rectangle?(new Rectangle(0, 0, 1, 1)), color); - spriteBatch.Draw(TextureAssets.MagicPixel.Value, destinationRectangle2, new Rectangle?(new Rectangle(0, 0, 1, 1)), color); - spriteBatch.Draw(TextureAssets.MagicPixel.Value, destinationRectangle3, new Rectangle?(new Rectangle(0, 0, 1, 1)), color); - spriteBatch.Draw(TextureAssets.MagicPixel.Value, destinationRectangle4, new Rectangle?(new Rectangle(0, 0, 1, 1)), color); - spriteBatch.Draw(TextureAssets.Extra[49].Value, rect, color); + spriteBatch.Draw(Main.magicPixel, destinationRectangle1, new Rectangle?(new Rectangle(0, 0, 1, 1)), color); + spriteBatch.Draw(Main.magicPixel, destinationRectangle2, new Rectangle?(new Rectangle(0, 0, 1, 1)), color); + spriteBatch.Draw(Main.magicPixel, destinationRectangle3, new Rectangle?(new Rectangle(0, 0, 1, 1)), color); + spriteBatch.Draw(Main.magicPixel, destinationRectangle4, new Rectangle?(new Rectangle(0, 0, 1, 1)), color); + spriteBatch.Draw(Main.extraTexture[49], rect, color); } } } diff --git a/GameContent/FixExploitManEaters.cs b/GameContent/FixExploitManEaters.cs index f2bc2fc..a10c5f0 100644 --- a/GameContent/FixExploitManEaters.cs +++ b/GameContent/FixExploitManEaters.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.FixExploitManEaters -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System.Collections.Generic; @@ -10,22 +10,22 @@ namespace Terraria.GameContent { public static class FixExploitManEaters { - private static readonly List IndexesProtected = new List(); + private static List _indexesProtected = new List(); - public static void Update() => FixExploitManEaters.IndexesProtected.Clear(); + public static void Update() => FixExploitManEaters._indexesProtected.Clear(); public static void ProtectSpot(int x, int y) { int num = (x & (int) ushort.MaxValue) << 16 | y & (int) ushort.MaxValue; - if (FixExploitManEaters.IndexesProtected.Contains(num)) + if (FixExploitManEaters._indexesProtected.Contains(num)) return; - FixExploitManEaters.IndexesProtected.Add(num); + FixExploitManEaters._indexesProtected.Add(num); } public static bool SpotProtected(int x, int y) { int num = (x & (int) ushort.MaxValue) << 16 | y & (int) ushort.MaxValue; - return FixExploitManEaters.IndexesProtected.Contains(num); + return FixExploitManEaters._indexesProtected.Contains(num); } } } diff --git a/GameContent/FontAssets.cs b/GameContent/FontAssets.cs deleted file mode 100644 index 764acef..0000000 --- a/GameContent/FontAssets.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.FontAssets -// 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.Content; -using ReLogic.Graphics; - -namespace Terraria.GameContent -{ - public static class FontAssets - { - public static Asset ItemStack; - public static Asset MouseText; - public static Asset DeathText; - public static Asset[] CombatText = new Asset[2]; - } -} diff --git a/GameContent/GameNotificationType.cs b/GameContent/GameNotificationType.cs deleted file mode 100644 index 5dfb9f4..0000000 --- a/GameContent/GameNotificationType.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.GameNotificationType -// 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 -{ - [Flags] - public enum GameNotificationType - { - None = 0, - Damage = 1, - SpawnOrDeath = 2, - WorldGen = 4, - All = WorldGen | SpawnOrDeath | Damage, // 0x00000007 - } -} diff --git a/GameContent/Generation/ActionGrass.cs b/GameContent/Generation/ActionGrass.cs index cf3e3d1..b5bf468 100644 --- a/GameContent/Generation/ActionGrass.cs +++ b/GameContent/Generation/ActionGrass.cs @@ -1,11 +1,11 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Generation.ActionGrass -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; -using Terraria.WorldBuilding; +using Terraria.World.Generation; namespace Terraria.GameContent.Generation { diff --git a/GameContent/Generation/ActionPlaceStatue.cs b/GameContent/Generation/ActionPlaceStatue.cs index 1d74712..bdad292 100644 --- a/GameContent/Generation/ActionPlaceStatue.cs +++ b/GameContent/Generation/ActionPlaceStatue.cs @@ -1,12 +1,12 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Generation.ActionPlaceStatue -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Terraria.DataStructures; -using Terraria.WorldBuilding; +using Terraria.World.Generation; namespace Terraria.GameContent.Generation { diff --git a/GameContent/Generation/ActionStalagtite.cs b/GameContent/Generation/ActionStalagtite.cs index 4230769..5f7024b 100644 --- a/GameContent/Generation/ActionStalagtite.cs +++ b/GameContent/Generation/ActionStalagtite.cs @@ -1,11 +1,11 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Generation.ActionStalagtite -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; -using Terraria.WorldBuilding; +using Terraria.World.Generation; namespace Terraria.GameContent.Generation { diff --git a/GameContent/Generation/ActionVines.cs b/GameContent/Generation/ActionVines.cs index 0bf87d5..0611fd3 100644 --- a/GameContent/Generation/ActionVines.cs +++ b/GameContent/Generation/ActionVines.cs @@ -1,11 +1,11 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Generation.ActionVines -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; -using Terraria.WorldBuilding; +using Terraria.World.Generation; namespace Terraria.GameContent.Generation { diff --git a/GameContent/Generation/PassLegacy.cs b/GameContent/Generation/PassLegacy.cs index a5446af..8dd5bc9 100644 --- a/GameContent/Generation/PassLegacy.cs +++ b/GameContent/Generation/PassLegacy.cs @@ -1,804 +1,33 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Generation.PassLegacy -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe +using System; using System.Collections.Generic; -using Terraria.IO; -using Terraria.WorldBuilding; +using System.Globalization; +using Terraria.World.Generation; namespace Terraria.GameContent.Generation { public class PassLegacy : GenPass { - private static readonly Dictionary _weightMap_135 = new Dictionary() + private static Dictionary _weightMap = PassLegacy.GenerateWeightMap(); + private WorldGenLegacyMethod _method; + + private static Dictionary GenerateWeightMap() { + Dictionary dictionary = new Dictionary(); + char[] chArray1 = new char[1]{ ',' }; + foreach (string str in "Reset:1.794,Terrain:233.6416,Tunnels:4.6075,Sand:256.211,Mount Caves:28.2501,Dirt Wall Backgrounds:91.1031,Rocks In Dirt:568.933,Dirt In Rocks:612.0777,Clay:99.0829,Small Holes:1080.6658,Dirt Layer Caves:97.6719,Rock Layer Caves:978.5062,Surface Caves:13.8707,Slush Check:40.0098,Grass:14.2435,Jungle:2404.0004,Marble:644.4756,Granite:7445.4057,Mud Caves To Grass:13289.4058,Full Desert:1977.3443,Floating Islands:430.9967,Mushroom Patches:305.0517,Mud To Dirt:135.7024,Silt:76.367,Shinies:106.5187,Webs:22.2261,Underworld:5202.7952,Lakes:12.458,Dungeon:273.1042,Corruption:100.9735,Slush:24.1356,Mud Caves To Grass:8.4174,Beaches:4.4018,Gems:289.1701,Gravitating Sand:207.9566,Clean Up Dirt:459.6188,Pyramids:0.4286,Dirt Rock Wall Runner:18.2315,Living Trees:11.9772,Wood Tree Walls:61.6,Altars:18.7726,Wet Jungle:10.5711,Remove Water From Sand:11.0268,Jungle Temple:140.1556,Hives:2144.6166,Jungle Chests:1.3979,Smooth World:2242.1054,Settle Liquids:4844.7201,Waterfalls:1868.306,Ice:80.3287,Wall Variety:2390.3296,Traps:42.6118,Life Crystals:2.0239,Statues:15.5157,Buried Chests:591.4215,Surface Chests:9.5181,Jungle Chests Placement:1.8203,Water Chests:5.5477,Spider Caves:4979.7116,Gem Caves:41.1786,Moss:2116.5164,Temple:6.6512,Ice Walls:7890.5261,Jungle Trees:230.5412,Floating Island Houses:2.299,Quick Cleanup:417.1482,Pots:515.7405,Hellforge:5.3522,Spreading Grass:47.0313,Piles:160.8168,Moss:11.8533,Spawn Point:0.2951,Grass Wall:293.7116,Guide:4.4433,Sunflowers:4.6765,Planting Trees:203.2509,Herbs:86.5444,Dye Plants:178.949,Webs And Honey:336.4474,Weeds:137.5676,Mud Caves To Grass:179.8629,Jungle Plants:606.4348,Vines:264.2856,Flowers:0.8461,Mushrooms:0.4203,Stalac:347.0403,Gems In Ice Biome:5.491,Random Gems:9.3797,Moss Grass:267.3524,Muds Walls In Jungle:34.8689,Larva:0.6675,Tile Cleanup:675.7305,Lihzahrd Altars:0.2615,Micro Biomes:2734.7864,Final Cleanup:648.6878".Split(chArray1)) { - "Reset", - 2.2056f - }, - { - "Terrain", - 449.3722f - }, - { - "Tunnels", - 5.379f - }, - { - "Dunes", - 779.3144f - }, - { - "Mount Caves", - 36.1749f - }, - { - "Dirt Wall Backgrounds", - 238.8786f - }, - { - "Rocks In Dirt", - 1539.898f - }, - { - "Dirt In Rocks", - 1640.048f - }, - { - "Clay", - 302.2475f - }, - { - "Small Holes", - 3047.099f - }, - { - "Dirt Layer Caves", - 250.0248f - }, - { - "Rock Layer Caves", - 2635.903f - }, - { - "Surface Caves", - 41.3442f - }, - { - "Slush Check", - 62.3121f - }, - { - "Grass", - 27.8485f - }, - { - "Jungle", - 10154.65f - }, - { - "Marble", - 3140.926f - }, - { - "Granite", - 6769.554f - }, - { - "Mud Caves To Grass", - 29042.46f - }, - { - "Full Desert", - 7802.509f - }, - { - "Floating Islands", - 1504.831f - }, - { - "Mushroom Patches", - 1001.21f - }, - { - "Mud To Dirt", - 355.9895f - }, - { - "Silt", - 198.4567f - }, - { - "Shinies", - 253.9256f - }, - { - "Webs", - 53.7234f - }, - { - "Underworld", - 9213.443f - }, - { - "Lakes", - 14.6001f - }, - { - "Corruption", - 1367.068f - }, - { - "Dungeon", - 386.8962f - }, - { - "Slush", - 56.7959f - }, - { - "Mountain Caves", - 14.2958f - }, - { - "Beaches", - 7.6043f - }, - { - "Gems", - 1016.745f - }, - { - "Gravitating Sand", - 875.1385f - }, - { - "Clean Up Dirt", - 632.9365f - }, - { - "Pyramids", - 0.3045f - }, - { - "Dirt Rock Wall Runner", - 24.1628f - }, - { - "Living Trees", - 5.6897f - }, - { - "Wood Tree Walls", - 72.6673f - }, - { - "Altars", - 24.975f - }, - { - "Wet Jungle", - 18.2339f - }, - { - "Remove Water From Sand", - 14.3244f - }, - { - "Jungle Temple", - 838.0293f - }, - { - "Hives", - 7194.68f - }, - { - "Jungle Chests", - 2.3522f - }, - { - "Smooth World", - 6418.349f - }, - { - "Settle Liquids", - 13069.07f - }, - { - "Waterfalls", - 4614.806f - }, - { - "Ice", - 236.3986f - }, - { - "Wall Variety", - 5988.028f - }, - { - "Traps", - 113.9219f - }, - { - "Life Crystals", - 3.4912f - }, - { - "Statues", - 72.0258f - }, - { - "Buried Chests", - 2371.881f - }, - { - "Surface Chests", - 22.1015f - }, - { - "Jungle Chests Placement", - 11.6857f - }, - { - "Water Chests", - 18.6092f - }, - { - "Spider Caves", - 8218.94f - }, - { - "Gem Caves", - 96.4863f - }, - { - "Moss", - 4440.283f - }, - { - "Temple", - 12.6321f - }, - { - "Ice Walls", - 8744.889f - }, - { - "Jungle Trees", - 933.2522f - }, - { - "Floating Island Houses", - 2.8349f - }, - { - "Quick Cleanup", - 1339.91f - }, - { - "Pots", - 1363.35f - }, - { - "Spreading Grass", - 80.3414f - }, - { - "Piles", - 274.4605f - }, - { - "Cactus", - 30.4524f - }, - { - "Spawn Point", - 0.3068f - }, - { - "Grass Wall", - 512.8323f - }, - { - "Guide", - 3.1494f - }, - { - "Sunflowers", - 4.7643f - }, - { - "Planting Trees", - 356.2866f - }, - { - "Herbs", - 123.8192f - }, - { - "Dye Plants", - 437.3852f - }, - { - "Webs And Honey", - 770.3133f - }, - { - "Weeds", - 224.6974f - }, - { - "Mud Caves To Grass 2", - 737.635f - }, - { - "Jungle Plants", - 1037.098f - }, - { - "Vines", - 897.331f - }, - { - "Flowers", - 1.3216f - }, - { - "Mushrooms", - 0.7789f - }, - { - "Stalac", - 1079.509f - }, - { - "Gems In Ice Biome", - 14.8002f - }, - { - "Random Gems", - 15.3893f - }, - { - "Moss Grass", - 770.8217f - }, - { - "Muds Walls In Jungle", - 73.5705f - }, - { - "Larva", - 0.5222f - }, - { - "Settle Liquids Again", - 7461.561f - }, - { - "Tile Cleanup", - 1813.04f - }, - { - "Lihzahrd Altars", - 0.2171f - }, - { - "Micro Biomes", - 24240.07f - }, - { - "Final Cleanup", - 1768.462f + char[] chArray2 = new char[1]{ ':' }; + string[] strArray = str.Split(chArray2); + dictionary[strArray[0]] = float.Parse(strArray[1], NumberStyles.AllowDecimalPoint, (IFormatProvider) CultureInfo.InvariantCulture); } - }; - private static readonly Dictionary _weightMap = new Dictionary() - { - { - "Reset", - 0.9667f - }, - { - "Terrain", - 507.352f - }, - { - "Dunes", - 239.7913f - }, - { - "Ocean Sand", - 10.4129f - }, - { - "Sand Patches", - 452.6755f - }, - { - "Tunnels", - 4.3622f - }, - { - "Mount Caves", - 49.9993f - }, - { - "Dirt Wall Backgrounds", - 328.7817f - }, - { - "Rocks In Dirt", - 1537.466f - }, - { - "Dirt In Rocks", - 1515.23f - }, - { - "Clay", - 314.8327f - }, - { - "Small Holes", - 2955.926f - }, - { - "Dirt Layer Caves", - 238.2545f - }, - { - "Rock Layer Caves", - 2708.396f - }, - { - "Surface Caves", - 42.3857f - }, - { - "Generate Ice Biome", - 100.005f - }, - { - "Grass", - 29.7885f - }, - { - "Jungle", - 11205.83f - }, - { - "Marble", - 5358.884f - }, - { - "Granite", - 2142.664f - }, - { - "Mud Caves To Grass", - 3319.761f - }, - { - "Full Desert", - 9730.408f - }, - { - "Floating Islands", - 1364.346f - }, - { - "Mushroom Patches", - 743.7686f - }, - { - "Dirt To Mud", - 351.3519f - }, - { - "Silt", - 211.84f - }, - { - "Shinies", - 237.4298f - }, - { - "Webs", - 50.6646f - }, - { - "Underworld", - 8936.494f - }, - { - "Lakes", - 12.1766f - }, - { - "Corruption", - 1094.237f - }, - { - "Dungeon", - 477.1963f - }, - { - "Slush", - 55.1857f - }, - { - "Mountain Caves", - 11.4819f - }, - { - "Beaches", - 7.8287f - }, - { - "Gems", - 895.426f - }, - { - "Gravitating Sand", - 933.5295f - }, - { - "Clean Up Dirt", - 697.0276f - }, - { - "Pyramids", - 6.6884f - }, - { - "Dirt Rock Wall Runner", - 24.7648f - }, - { - "Living Trees", - 4.937f - }, - { - "Wood Tree Walls", - 76.8709f - }, - { - "Altars", - 72.6607f - }, - { - "Wet Jungle", - 23.492f - }, - { - "Remove Water From Sand", - 22.0898f - }, - { - "Jungle Temple", - 595.8422f - }, - { - "Hives", - 371.392f - }, - { - "Jungle Chests", - 0.5896f - }, - { - "Smooth World", - 5841.608f - }, - { - "Settle Liquids", - 9398.525f - }, - { - "Waterfalls", - 4118.666f - }, - { - "Ice", - 163.0777f - }, - { - "Wall Variety", - 5264.021f - }, - { - "Life Crystals", - 2.7582f - }, - { - "Statues", - 64.5737f - }, - { - "Buried Chests", - 1102.553f - }, - { - "Surface Chests", - 12.8337f - }, - { - "Jungle Chests Placement", - 1.3546f - }, - { - "Water Chests", - 12.5981f - }, - { - "Spider Caves", - 475.4143f - }, - { - "Gem Caves", - 36.0143f - }, - { - "Moss", - 655.8314f - }, - { - "Temple", - 5.6917f - }, - { - "Ice Walls", - 957.0317f - }, - { - "Jungle Trees", - 817.2459f - }, - { - "Floating Island Houses", - 1.5022f - }, - { - "Quick Cleanup", - 1374.467f - }, - { - "Pots", - 1638.609f - }, - { - "Hellforge", - 2.8645f - }, - { - "Spreading Grass", - 127.7581f - }, - { - "Place Fallen Log", - 17.3377f - }, - { - "Traps", - 562.9085f - }, - { - "Piles", - 288.3675f - }, - { - "Spawn Point", - 0.012f - }, - { - "Grass Wall", - 604.9992f - }, - { - "Guide", - 0.016f - }, - { - "Sunflowers", - 4.1757f - }, - { - "Planting Trees", - 325.0993f - }, - { - "Cactus & Coral", - 31.6349f - }, - { - "Herbs", - 120.1871f - }, - { - "Dye Plants", - 226.6394f - }, - { - "Webs And Honey", - 608.9524f - }, - { - "Weeds", - 187.9759f - }, - { - "Mud Caves To Grass 2", - 686.4958f - }, - { - "Jungle Plants", - 1295.038f - }, - { - "Vines", - 1132.555f - }, - { - "Flowers", - 16.7723f - }, - { - "Mushrooms", - 0.2294f - }, - { - "Gems In Ice Biome", - 10.3092f - }, - { - "Random Gems", - 18.4925f - }, - { - "Moss Grass", - 687.742f - }, - { - "Muds Walls In Jungle", - 89.7739f - }, - { - "Larva", - 0.2074f - }, - { - "Settle Liquids Again", - 7073.647f - }, - { - "Tile Cleanup", - 1896.76f - }, - { - "Lihzahrd Altars", - 0.0071f - }, - { - "Micro Biomes", - 3547.43f - }, - { - "Stalac", - 1180.906f - }, - { - "Remove Broken Traps", - 1293.425f - }, - { - "Final Cleanup", - 2080.294f - } - }; - private readonly WorldGenLegacyMethod _method; + return dictionary; + } public PassLegacy(string name, WorldGenLegacyMethod method) : base(name, PassLegacy.GetWeight(name)) @@ -820,6 +49,6 @@ namespace Terraria.GameContent.Generation return num; } - protected override void ApplyPass(GenerationProgress progress, GameConfiguration configuration) => this._method(progress, configuration); + public override void Apply(GenerationProgress progress) => this._method(progress); } } diff --git a/GameContent/Generation/ShapeBranch.cs b/GameContent/Generation/ShapeBranch.cs index f6ee54d..d581d70 100644 --- a/GameContent/Generation/ShapeBranch.cs +++ b/GameContent/Generation/ShapeBranch.cs @@ -1,13 +1,13 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Generation.ShapeBranch -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using System; using System.Collections.Generic; -using Terraria.WorldBuilding; +using Terraria.World.Generation; namespace Terraria.GameContent.Generation { @@ -29,7 +29,7 @@ namespace Terraria.GameContent.Generation { for (int index2 = -(size >> 1); index2 < size - (size >> 1); ++index2) { - if (!Utils.PlotLine(new Point(start.X + index1, start.Y + index2), end, (Utils.TileActionAttempt) ((tileX, tileY) => this.UnitApply(action, origin, tileX, tileY) || !this._quitOnFail), false)) + if (!Utils.PlotLine(new Point(start.X + index1, start.Y + index2), end, (Utils.PerLinePoint) ((tileX, tileY) => this.UnitApply(action, origin, tileX, tileY) || !this._quitOnFail), false)) return false; } } diff --git a/GameContent/Generation/ShapeFloodFill.cs b/GameContent/Generation/ShapeFloodFill.cs index e53fc1a..fd36b48 100644 --- a/GameContent/Generation/ShapeFloodFill.cs +++ b/GameContent/Generation/ShapeFloodFill.cs @@ -1,13 +1,13 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Generation.ShapeFloodFill -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using System.Collections.Generic; using Terraria.DataStructures; -using Terraria.WorldBuilding; +using Terraria.World.Generation; namespace Terraria.GameContent.Generation { diff --git a/GameContent/Generation/ShapeRoot.cs b/GameContent/Generation/ShapeRoot.cs index aa0af68..24e327c 100644 --- a/GameContent/Generation/ShapeRoot.cs +++ b/GameContent/Generation/ShapeRoot.cs @@ -1,12 +1,12 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Generation.ShapeRoot -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using System; -using Terraria.WorldBuilding; +using Terraria.World.Generation; namespace Terraria.GameContent.Generation { diff --git a/GameContent/Generation/ShapeRunner.cs b/GameContent/Generation/ShapeRunner.cs index c3f3e29..6224048 100644 --- a/GameContent/Generation/ShapeRunner.cs +++ b/GameContent/Generation/ShapeRunner.cs @@ -1,12 +1,12 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Generation.ShapeRunner -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using System; -using Terraria.WorldBuilding; +using Terraria.World.Generation; namespace Terraria.GameContent.Generation { diff --git a/GameContent/Generation/TrackGenerator.cs b/GameContent/Generation/TrackGenerator.cs index 0d93a86..03becf5 100644 --- a/GameContent/Generation/TrackGenerator.cs +++ b/GameContent/Generation/TrackGenerator.cs @@ -1,423 +1,278 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Generation.TrackGenerator -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using System; -using System.Diagnostics; using Terraria.ID; -using Terraria.WorldBuilding; +using Terraria.World.Generation; namespace Terraria.GameContent.Generation { public class TrackGenerator { - private static readonly ushort[] InvalidWalls = new ushort[20] + private static readonly byte[] INVALID_WALLS = new byte[13] { - (ushort) 7, - (ushort) 94, - (ushort) 95, - (ushort) 8, - (ushort) 98, - (ushort) 99, - (ushort) 9, - (ushort) 96, - (ushort) 97, - (ushort) 3, - (ushort) 83, - (ushort) 68, - (ushort) 62, - (ushort) 78, - (ushort) 87, - (ushort) 86, - (ushort) 42, - (ushort) 74, - (ushort) 27, - (ushort) 149 + (byte) 7, + (byte) 94, + (byte) 95, + (byte) 8, + (byte) 98, + (byte) 99, + (byte) 9, + (byte) 96, + (byte) 97, + (byte) 3, + (byte) 83, + (byte) 87, + (byte) 86 }; - private static readonly ushort[] InvalidTiles = new ushort[22] - { - (ushort) 383, - (ushort) 384, - (ushort) 15, - (ushort) 304, - (ushort) 30, - (ushort) 321, - (ushort) 245, - (ushort) 246, - (ushort) 240, - (ushort) 241, - (ushort) 242, - (ushort) 16, - (ushort) 34, - (ushort) 158, - (ushort) 377, - (ushort) 94, - (ushort) 10, - (ushort) 19, - (ushort) 86, - (ushort) 219, - (ushort) 484, - (ushort) 190 - }; - private readonly TrackGenerator.TrackHistory[] _history = new TrackGenerator.TrackHistory[4096]; - private readonly TrackGenerator.TrackHistory[] _rewriteHistory = new TrackGenerator.TrackHistory[25]; - private int _xDirection; - private int _length; - private int playerHeight = 6; + private const int TOTAL_TILE_IGNORES = 150; + private const int PLAYER_HEIGHT = 6; + private const int MAX_RETRIES = 400; + private const int MAX_SMOOTH_DISTANCE = 15; + private const int MAX_ITERATIONS = 1000000; + private TrackGenerator.TrackHistory[] _historyCache = new TrackGenerator.TrackHistory[2048]; - public bool Place(Point origin, int minLength, int maxLength) + public void Generate(int trackCount, int minimumLength) { - if (!TrackGenerator.FindSuitableOrigin(ref origin)) + int num = trackCount; + while (num > 0) + { + int x = WorldGen.genRand.Next(150, Main.maxTilesX - 150); + int y = WorldGen.genRand.Next((int) Main.worldSurface + 25, Main.maxTilesY - 200); + if (this.IsLocationEmpty(x, y)) + { + while (this.IsLocationEmpty(x, y + 1)) + ++y; + if (this.FindPath(x, y, minimumLength)) + --num; + } + } + } + + private bool IsLocationEmpty(int x, int y) + { + if (y > Main.maxTilesY - 200 || x < 0 || y < (int) Main.worldSurface || x > Main.maxTilesX - 5) return false; - this.CreateTrackStart(origin); - if (!this.FindPath(minLength, maxLength)) - return false; - this.PlacePath(); + for (int index = 0; index < 6; ++index) + { + if (WorldGen.SolidTile(x, y - index)) + return false; + } return true; } - private void PlacePath() + private bool CanTrackBePlaced(int x, int y) { - bool[] flagArray = new bool[this._length]; - for (int index1 = 0; index1 < this._length; ++index1) - { - if (WorldGen.genRand.Next(7) == 0) - this.playerHeight = WorldGen.genRand.Next(5, 9); - for (int index2 = 0; index2 < this.playerHeight; ++index2) - { - if (Main.tile[(int) this._history[index1].X, (int) this._history[index1].Y - index2 - 1].wall == (ushort) 244) - Main.tile[(int) this._history[index1].X, (int) this._history[index1].Y - index2 - 1].wall = (ushort) 0; - if (Main.tile[(int) this._history[index1].X, (int) this._history[index1].Y - index2].wall == (ushort) 244) - Main.tile[(int) this._history[index1].X, (int) this._history[index1].Y - index2].wall = (ushort) 0; - if (Main.tile[(int) this._history[index1].X, (int) this._history[index1].Y - index2 + 1].wall == (ushort) 244) - Main.tile[(int) this._history[index1].X, (int) this._history[index1].Y - index2 + 1].wall = (ushort) 0; - if (Main.tile[(int) this._history[index1].X, (int) this._history[index1].Y - index2].type == (ushort) 135) - flagArray[index1] = true; - WorldGen.KillTile((int) this._history[index1].X, (int) this._history[index1].Y - index2, noItem: true); - } - } - for (int index3 = 0; index3 < this._length; ++index3) - { - if (WorldGen.genRand.Next(7) == 0) - this.playerHeight = WorldGen.genRand.Next(5, 9); - TrackGenerator.TrackHistory trackHistory = this._history[index3]; - Tile.SmoothSlope((int) trackHistory.X, (int) trackHistory.Y + 1); - Tile.SmoothSlope((int) trackHistory.X, (int) trackHistory.Y - this.playerHeight); - bool wire = Main.tile[(int) trackHistory.X, (int) trackHistory.Y].wire(); - if (flagArray[index3] && index3 < this._length && index3 > 0 && (int) this._history[index3 - 1].Y == (int) trackHistory.Y && (int) this._history[index3 + 1].Y == (int) trackHistory.Y) - { - Main.tile[(int) trackHistory.X, (int) trackHistory.Y].ClearEverything(); - WorldGen.PlaceTile((int) trackHistory.X, (int) trackHistory.Y, 314, forced: true, style: 1); - } - else - Main.tile[(int) trackHistory.X, (int) trackHistory.Y].ResetToType((ushort) 314); - Main.tile[(int) trackHistory.X, (int) trackHistory.Y].wire(wire); - if (index3 != 0) - { - for (int index4 = 0; index4 < 8; ++index4) - WorldUtils.TileFrame((int) this._history[index3 - 1].X, (int) this._history[index3 - 1].Y - index4, true); - if (index3 == this._length - 1) - { - for (int index5 = 0; index5 < this.playerHeight; ++index5) - WorldUtils.TileFrame((int) trackHistory.X, (int) trackHistory.Y - index5, true); - } - } - } - } - - private void CreateTrackStart(Point origin) - { - this._xDirection = origin.X > Main.maxTilesX / 2 ? -1 : 1; - this._length = 1; - for (int index = 0; index < this._history.Length; ++index) - this._history[index] = new TrackGenerator.TrackHistory(origin.X + index * this._xDirection, origin.Y + index, TrackGenerator.TrackSlope.Down); - } - - private bool FindPath(int minLength, int maxLength) - { - int length = this._length; - while (this._length < this._history.Length - 100) - { - this.AppendToHistory(this._history[this._length - 1].Slope == TrackGenerator.TrackSlope.Up ? TrackGenerator.TrackSlope.Straight : TrackGenerator.TrackSlope.Down); - TrackGenerator.TrackPlacementState avoidTiles = this.TryRewriteHistoryToAvoidTiles(); - if (avoidTiles != TrackGenerator.TrackPlacementState.Invalid) - { - length = this._length; - TrackGenerator.TrackPlacementState trackPlacementState = avoidTiles; - while (trackPlacementState != TrackGenerator.TrackPlacementState.Available) - { - trackPlacementState = this.CreateTunnel(); - if (trackPlacementState != TrackGenerator.TrackPlacementState.Invalid) - length = this._length; - else - break; - } - if (this._length >= maxLength) - break; - } - else - break; - } - this._length = Math.Min(maxLength, length); - if (this._length < minLength) + if (y > Main.maxTilesY - 200 || x < 0 || y < (int) Main.worldSurface || x > Main.maxTilesX - 5) return false; - this.SmoothTrack(); - return this.GetHistorySegmentPlacementState(0, this._length) != TrackGenerator.TrackPlacementState.Invalid; - } - - private TrackGenerator.TrackPlacementState CreateTunnel() - { - TrackGenerator.TrackSlope trackSlope1 = TrackGenerator.TrackSlope.Straight; - int num = 10; - TrackGenerator.TrackPlacementState trackPlacementState1 = TrackGenerator.TrackPlacementState.Invalid; - int x = (int) this._history[this._length - 1].X; - int y = (int) this._history[this._length - 1].Y; - for (TrackGenerator.TrackSlope trackSlope2 = TrackGenerator.TrackSlope.Up; trackSlope2 <= TrackGenerator.TrackSlope.Down; ++trackSlope2) + byte wall = Main.tile[x, y].wall; + for (int index = 0; index < TrackGenerator.INVALID_WALLS.Length; ++index) { - TrackGenerator.TrackPlacementState trackPlacementState2 = TrackGenerator.TrackPlacementState.Invalid; - for (int index = 1; index < num; ++index) - { - trackPlacementState2 = TrackGenerator.CalculateStateForLocation(x + index * this._xDirection, y + index * (int) trackSlope2); - switch (trackPlacementState2) - { - case TrackGenerator.TrackPlacementState.Obstructed: - continue; - case TrackGenerator.TrackPlacementState.Invalid: - goto label_6; - default: - trackSlope1 = trackSlope2; - num = index; - trackPlacementState1 = trackPlacementState2; - goto label_6; - } - } -label_6: - if (trackPlacementState1 != TrackGenerator.TrackPlacementState.Available && trackPlacementState2 == TrackGenerator.TrackPlacementState.Obstructed && (trackPlacementState1 != TrackGenerator.TrackPlacementState.Obstructed || trackSlope1 != TrackGenerator.TrackSlope.Straight)) - { - trackSlope1 = trackSlope2; - num = 10; - trackPlacementState1 = trackPlacementState2; - } + if ((int) wall == (int) TrackGenerator.INVALID_WALLS[index]) + return false; } - if (this._length == 0 || !TrackGenerator.CanSlopesTouch(this._history[this._length - 1].Slope, trackSlope1)) - this.RewriteSlopeDirection(this._length - 1, TrackGenerator.TrackSlope.Straight); - this._history[this._length - 1].Mode = TrackGenerator.TrackMode.Tunnel; - for (int index = 1; index < num; ++index) - this.AppendToHistory(trackSlope1, TrackGenerator.TrackMode.Tunnel); - return trackPlacementState1; - } - - private void AppendToHistory(TrackGenerator.TrackSlope slope, TrackGenerator.TrackMode mode = TrackGenerator.TrackMode.Normal) - { - this._history[this._length] = new TrackGenerator.TrackHistory((int) this._history[this._length - 1].X + this._xDirection, (int) ((sbyte) this._history[this._length - 1].Y + slope), slope); - this._history[this._length].Mode = mode; - ++this._length; - } - - private TrackGenerator.TrackPlacementState TryRewriteHistoryToAvoidTiles() - { - int index1 = this._length - 1; - int length = Math.Min(this._length, this._rewriteHistory.Length); - for (int index2 = 0; index2 < length; ++index2) - this._rewriteHistory[index2] = this._history[index1 - index2]; - for (; index1 >= this._length - length; --index1) + for (int index = -1; index <= 1; ++index) { - if (this._history[index1].Slope == TrackGenerator.TrackSlope.Down) - { - TrackGenerator.TrackPlacementState segmentPlacementState = this.GetHistorySegmentPlacementState(index1, this._length - index1); - if (segmentPlacementState == TrackGenerator.TrackPlacementState.Available) - return segmentPlacementState; - this.RewriteSlopeDirection(index1, TrackGenerator.TrackSlope.Straight); - } + if (Main.tile[x + index, y].active() && (Main.tile[x + index, y].type == (ushort) 314 || !TileID.Sets.GeneralPlacementTiles[(int) Main.tile[x + index, y].type])) + return false; } - if (this.GetHistorySegmentPlacementState(index1 + 1, this._length - (index1 + 1)) == TrackGenerator.TrackPlacementState.Available) - return TrackGenerator.TrackPlacementState.Available; - int index3; - for (index3 = this._length - 1; index3 >= this._length - length + 1; --index3) - { - if (this._history[index3].Slope == TrackGenerator.TrackSlope.Straight) - { - TrackGenerator.TrackPlacementState segmentPlacementState = this.GetHistorySegmentPlacementState(this._length - length, length); - if (segmentPlacementState == TrackGenerator.TrackPlacementState.Available) - return segmentPlacementState; - this.RewriteSlopeDirection(index3, TrackGenerator.TrackSlope.Up); - } - } - for (int index4 = 0; index4 < length; ++index4) - this._history[this._length - 1 - index4] = this._rewriteHistory[index4]; - this.RewriteSlopeDirection(this._length - 1, TrackGenerator.TrackSlope.Straight); - return this.GetHistorySegmentPlacementState(index3 + 1, this._length - (index3 + 1)); + return true; } - private void RewriteSlopeDirection(int index, TrackGenerator.TrackSlope slope) + private void SmoothTrack(TrackGenerator.TrackHistory[] history, int length) { - int num = (int) (slope - this._history[index].Slope); - this._history[index].Slope = slope; - for (int index1 = index; index1 < this._length; ++index1) - this._history[index1].Y += (short) num; - } - - private TrackGenerator.TrackPlacementState GetHistorySegmentPlacementState( - int startIndex, - int length) - { - TrackGenerator.TrackPlacementState trackPlacementState = TrackGenerator.TrackPlacementState.Available; - for (int index = startIndex; index < startIndex + length; ++index) - { - TrackGenerator.TrackPlacementState stateForLocation = TrackGenerator.CalculateStateForLocation((int) this._history[index].X, (int) this._history[index].Y); - switch (stateForLocation) - { - case TrackGenerator.TrackPlacementState.Obstructed: - if (this._history[index].Mode != TrackGenerator.TrackMode.Tunnel) - { - trackPlacementState = stateForLocation; - break; - } - break; - case TrackGenerator.TrackPlacementState.Invalid: - return stateForLocation; - } - } - return trackPlacementState; - } - - private void SmoothTrack() - { - int val2 = this._length - 1; + int val2 = length - 1; bool flag = false; - for (int index1 = this._length - 1; index1 >= 0; --index1) + for (int index1 = length - 1; index1 >= 0; --index1) { if (flag) { val2 = Math.Min(index1 + 15, val2); - if ((int) this._history[index1].Y >= (int) this._history[val2].Y) + if ((int) history[index1].Y >= (int) history[val2].Y) { - for (int index2 = index1 + 1; (int) this._history[index2].Y > (int) this._history[index1].Y; ++index2) - { - this._history[index2].Y = this._history[index1].Y; - this._history[index2].Slope = TrackGenerator.TrackSlope.Straight; - } - if ((int) this._history[index1].Y == (int) this._history[val2].Y) + for (int index2 = index1 + 1; (int) history[index2].Y > (int) history[index1].Y; ++index2) + history[index2].Y = history[index1].Y; + if ((int) history[index1].Y == (int) history[val2].Y) flag = false; } } - else if ((int) this._history[index1].Y > (int) this._history[val2].Y) + else if ((int) history[index1].Y > (int) history[val2].Y) flag = true; else val2 = index1; } } - private static bool CanSlopesTouch( - TrackGenerator.TrackSlope leftSlope, - TrackGenerator.TrackSlope rightSlope) + public bool FindPath(int x, int y, int minimumLength, bool debugMode = false) { - return leftSlope == rightSlope || leftSlope == TrackGenerator.TrackSlope.Straight || rightSlope == TrackGenerator.TrackSlope.Straight; - } - - private static bool FindSuitableOrigin(ref Point origin) - { - TrackGenerator.TrackPlacementState stateForLocation; - while ((stateForLocation = TrackGenerator.CalculateStateForLocation(origin.X, origin.Y)) != TrackGenerator.TrackPlacementState.Obstructed) + TrackGenerator.TrackHistory[] historyCache = this._historyCache; + int index1 = 0; + Tile[,] tile = Main.tile; + bool flag1 = true; + int num1 = WorldGen.genRand.Next(2) == 0 ? 1 : -1; + if (debugMode) + num1 = Main.player[Main.myPlayer].direction; + int yDirection = 1; + int length = 0; + int num2 = 400; + bool flag2 = false; + int num3 = 150; + int num4 = 0; + for (int index2 = 1000000; index2 > 0 & flag1 && index1 < historyCache.Length - 1; ++index1) { - ++origin.Y; - if (stateForLocation == TrackGenerator.TrackPlacementState.Invalid) - return false; + --index2; + historyCache[index1] = new TrackGenerator.TrackHistory(x, y, yDirection); + bool flag3 = false; + int num5 = 1; + if (index1 > minimumLength >> 1) + num5 = -1; + else if (index1 > (minimumLength >> 1) - 5) + num5 = 0; + if (flag2) + { + int num6 = 0; + int num7 = num3; + bool flag4 = false; + for (int index3 = Math.Min(1, yDirection + 1); index3 >= Math.Max(-1, yDirection - 1); --index3) + { + int num8; + for (num8 = 0; num8 <= num3; ++num8) + { + if (this.IsLocationEmpty(x + (num8 + 1) * num1, y + (num8 + 1) * index3 * num5)) + { + flag4 = true; + break; + } + } + if (num8 < num7) + { + num7 = num8; + num6 = index3; + } + } + if (flag4) + { + yDirection = num6; + for (int index4 = 0; index4 < num7 - 1; ++index4) + { + ++index1; + x += num1; + y += yDirection * num5; + historyCache[index1] = new TrackGenerator.TrackHistory(x, y, yDirection); + num4 = index1; + } + x += num1; + y += yDirection * num5; + length = index1 + 1; + flag2 = false; + } + num3 -= num7; + if (num3 < 0) + flag1 = false; + } + else + { + for (int index5 = Math.Min(1, yDirection + 1); index5 >= Math.Max(-1, yDirection - 1); --index5) + { + if (this.IsLocationEmpty(x + num1, y + index5 * num5)) + { + yDirection = index5; + flag3 = true; + x += num1; + y += yDirection * num5; + length = index1 + 1; + break; + } + } + if (!flag3) + { + while (index1 > num4 && y == (int) historyCache[index1].Y) + --index1; + x = (int) historyCache[index1].X; + y = (int) historyCache[index1].Y; + yDirection = (int) historyCache[index1].YDirection - 1; + --num2; + if (num2 <= 0) + { + index1 = length; + x = (int) historyCache[index1].X; + y = (int) historyCache[index1].Y; + yDirection = (int) historyCache[index1].YDirection; + flag2 = true; + num2 = 200; + } + --index1; + } + } } - --origin.Y; - return TrackGenerator.CalculateStateForLocation(origin.X, origin.Y) == TrackGenerator.TrackPlacementState.Available; - } - - private static TrackGenerator.TrackPlacementState CalculateStateForLocation( - int x, - int y) - { - for (int index = 0; index < 6; ++index) + if (!(length > minimumLength | debugMode)) + return false; + this.SmoothTrack(historyCache, length); + if (!debugMode) { - if (TrackGenerator.IsLocationInvalid(x, y - index)) - return TrackGenerator.TrackPlacementState.Invalid; + for (int index6 = 0; index6 < length; ++index6) + { + for (int index7 = -1; index7 < 7; ++index7) + { + if (!this.CanTrackBePlaced((int) historyCache[index6].X, (int) historyCache[index6].Y - index7)) + return false; + } + } } - for (int index = 0; index < 6; ++index) + for (int index8 = 0; index8 < length; ++index8) { - if (TrackGenerator.IsMinecartTrack(x, y + index)) - return TrackGenerator.TrackPlacementState.Invalid; + TrackGenerator.TrackHistory trackHistory = historyCache[index8]; + for (int index9 = 0; index9 < 6; ++index9) + Main.tile[(int) trackHistory.X, (int) trackHistory.Y - index9].active(false); } - for (int index = 0; index < 6; ++index) + for (int index10 = 0; index10 < length; ++index10) { - if (WorldGen.SolidTile(x, y - index)) - return TrackGenerator.TrackPlacementState.Obstructed; + TrackGenerator.TrackHistory trackHistory = historyCache[index10]; + Tile.SmoothSlope((int) trackHistory.X, (int) trackHistory.Y + 1); + Tile.SmoothSlope((int) trackHistory.X, (int) trackHistory.Y - 6); + bool wire = Main.tile[(int) trackHistory.X, (int) trackHistory.Y].wire(); + Main.tile[(int) trackHistory.X, (int) trackHistory.Y].ResetToType((ushort) 314); + Main.tile[(int) trackHistory.X, (int) trackHistory.Y].wire(wire); + if (index10 != 0) + { + for (int index11 = 0; index11 < 6; ++index11) + WorldUtils.TileFrame((int) historyCache[index10 - 1].X, (int) historyCache[index10 - 1].Y - index11, true); + if (index10 == length - 1) + { + for (int index12 = 0; index12 < 6; ++index12) + WorldUtils.TileFrame((int) trackHistory.X, (int) trackHistory.Y - index12, true); + } + } } - return WorldGen.IsTileNearby(x, y, 314, 30) ? TrackGenerator.TrackPlacementState.Invalid : TrackGenerator.TrackPlacementState.Available; + return true; } - private static bool IsMinecartTrack(int x, int y) => Main.tile[x, y].active() && Main.tile[x, y].type == (ushort) 314; + public static void Run(int trackCount = 30, int minimumLength = 250) => new TrackGenerator().Generate(trackCount, minimumLength); - private static bool IsLocationInvalid(int x, int y) - { - if (y > Main.UnderworldLayer || x < 5 || y < (int) Main.worldSurface || x > Main.maxTilesX - 5 || WorldGen.oceanDepths(x, y)) - return true; - ushort wall = Main.tile[x, y].wall; - for (int index = 0; index < TrackGenerator.InvalidWalls.Length; ++index) - { - if ((int) wall == (int) TrackGenerator.InvalidWalls[index] && (!WorldGen.notTheBees || wall != (ushort) 108)) - return true; - } - ushort type = Main.tile[x, y].type; - for (int index = 0; index < TrackGenerator.InvalidTiles.Length; ++index) - { - if ((int) type == (int) TrackGenerator.InvalidTiles[index]) - return true; - } - for (int index = -1; index <= 1; ++index) - { - if (Main.tile[x + index, y].active() && (Main.tile[x + index, y].type == (ushort) 314 || !TileID.Sets.GeneralPlacementTiles[(int) Main.tile[x + index, y].type]) && (!WorldGen.notTheBees || Main.tile[x + index, y].type != (ushort) 225)) - return true; - } - return false; - } + public static void Run(Point start) => new TrackGenerator().FindPath(start.X, start.Y, 250, true); - [Conditional("DEBUG")] - private void DrawPause() - { - } - - private enum TrackPlacementState - { - Available, - Obstructed, - Invalid, - } - - private enum TrackSlope : sbyte - { - Up = -1, // 0xFF - Straight = 0, - Down = 1, - } - - private enum TrackMode : byte - { - Normal, - Tunnel, - } - - [DebuggerDisplay("X = {X}, Y = {Y}, Slope = {Slope}")] private struct TrackHistory { public short X; public short Y; - public TrackGenerator.TrackSlope Slope; - public TrackGenerator.TrackMode Mode; + public byte YDirection; - public TrackHistory(int x, int y, TrackGenerator.TrackSlope slope) + public TrackHistory(int x, int y, int yDirection) { this.X = (short) x; this.Y = (short) y; - this.Slope = slope; - this.Mode = TrackGenerator.TrackMode.Normal; + this.YDirection = (byte) yDirection; + } + + public TrackHistory(short x, short y, byte yDirection) + { + this.X = x; + this.Y = y; + this.YDirection = yDirection; } } } diff --git a/GameContent/Generation/WorldGenLegacyMethod.cs b/GameContent/Generation/WorldGenLegacyMethod.cs index e5a3e3f..38402ad 100644 --- a/GameContent/Generation/WorldGenLegacyMethod.cs +++ b/GameContent/Generation/WorldGenLegacyMethod.cs @@ -1,15 +1,12 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Generation.WorldGenLegacyMethod -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe -using Terraria.IO; -using Terraria.WorldBuilding; +using Terraria.World.Generation; namespace Terraria.GameContent.Generation { - public delegate void WorldGenLegacyMethod( - GenerationProgress progress, - GameConfiguration configuration); + public delegate void WorldGenLegacyMethod(GenerationProgress progress); } diff --git a/GameContent/Golf/FancyGolfPredictionLine.cs b/GameContent/Golf/FancyGolfPredictionLine.cs deleted file mode 100644 index a3b3ad1..0000000 --- a/GameContent/Golf/FancyGolfPredictionLine.cs +++ /dev/null @@ -1,138 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Golf.FancyGolfPredictionLine -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Graphics; -using System; -using System.Collections.Generic; -using Terraria.Graphics; - -namespace Terraria.GameContent.Golf -{ - public class FancyGolfPredictionLine - { - private readonly List _positions; - private readonly Entity _entity = (Entity) new FancyGolfPredictionLine.PredictionEntity(); - private readonly int _iterations; - private readonly Color[] _colors = new Color[2] - { - Color.White, - Color.Gray - }; - private readonly BasicDebugDrawer _drawer = new BasicDebugDrawer(Main.instance.GraphicsDevice); - private float _time; - - public FancyGolfPredictionLine(int iterations) - { - this._positions = new List(iterations * 2 + 1); - this._iterations = iterations; - } - - public void Update(Entity golfBall, Vector2 impactVelocity, float roughLandResistance) - { - bool flag = Main.tileSolid[379]; - Main.tileSolid[379] = false; - this._positions.Clear(); - this._time += 0.01666667f; - this._entity.position = golfBall.position; - this._entity.width = golfBall.width; - this._entity.height = golfBall.height; - GolfHelper.HitGolfBall(this._entity, impactVelocity, roughLandResistance); - this._positions.Add(this._entity.position); - float angularVelocity = 0.0f; - for (int index = 0; index < this._iterations; ++index) - { - GolfHelper.StepGolfBall(this._entity, ref angularVelocity); - this._positions.Add(this._entity.position); - } - Main.tileSolid[379] = flag; - } - - public void Draw(Camera camera, SpriteBatch spriteBatch, float chargeProgress) - { - this._drawer.Begin(camera.GameViewMatrix.TransformationMatrix); - int count = this._positions.Count; - Texture2D texture2D = TextureAssets.Extra[33].Value; - Vector2 vector2_1 = new Vector2(3.5f, 3.5f); - Vector2 origin = texture2D.Size() / 2f; - Vector2 unscaledPosition = camera.UnscaledPosition; - Vector2 vector2_2 = vector2_1 - unscaledPosition; - float travelledLength = 0.0f; - float num = 0.0f; - for (int startIndex = 0; startIndex < this._positions.Count - 1; ++startIndex) - { - float length; - this.GetSectionLength(startIndex, out length, out float _); - if ((double) length != 0.0) - { - for (; (double) travelledLength < (double) num + (double) length; travelledLength += 4f) - { - float index = (travelledLength - num) / length + (float) startIndex; - Vector2 position = this.GetPosition((travelledLength - num) / length + (float) startIndex); - Color color = this.GetColor2(index) * MathHelper.Clamp((float) (2.0 - 2.0 * (double) index / (double) (this._positions.Count - 1)), 0.0f, 1f); - spriteBatch.Draw(texture2D, position + vector2_2, new Rectangle?(), color, 0.0f, origin, this.GetScale(travelledLength), SpriteEffects.None, 0.0f); - } - num += length; - } - } - this._drawer.End(); - } - - private Color GetColor(float travelledLength) - { - float num1 = ((float) ((double) travelledLength % 200.0 / 200.0) * (float) this._colors.Length - (float) ((double) this._time * 3.14159274101257 * 1.5)) % (float) this._colors.Length; - if ((double) num1 < 0.0) - num1 += (float) this._colors.Length; - int num2 = (int) Math.Floor((double) num1); - int num3 = num2 + 1; - int index1 = Utils.Clamp(num2 % this._colors.Length, 0, this._colors.Length - 1); - int index2 = Utils.Clamp(num3 % this._colors.Length, 0, this._colors.Length - 1); - float amount = num1 - (float) index1; - Color color = Color.Lerp(this._colors[index1], this._colors[index2], amount); - color.A = (byte) 64; - return color * 0.6f; - } - - private Color GetColor2(float index) - { - double d; - int index1 = (int) Math.Floor(d = (double) index * 0.5 - (double) this._time * 3.14159274101257 * 1.5) % this._colors.Length; - if (index1 < 0) - index1 += this._colors.Length; - int index2 = (index1 + 1) % this._colors.Length; - float amount = (float) d - (float) Math.Floor(d); - Color color = Color.Lerp(this._colors[index1], this._colors[index2], amount); - color.A = (byte) 64; - return color * 0.6f; - } - - private float GetScale(float travelledLength) => (float) (0.200000002980232 + (double) Utils.GetLerpValue(0.8f, 1f, (float) (Math.Cos((double) travelledLength / 50.0 + (double) this._time * -3.14159274101257) * 0.5 + 0.5), true) * 0.150000005960464); - - private void GetSectionLength(int startIndex, out float length, out float rotation) - { - int index = startIndex + 1; - if (index >= this._positions.Count) - index = this._positions.Count - 1; - length = Vector2.Distance(this._positions[startIndex], this._positions[index]); - rotation = (this._positions[index] - this._positions[startIndex]).ToRotation(); - } - - private Vector2 GetPosition(float indexProgress) - { - int index1 = (int) Math.Floor((double) indexProgress); - int index2 = index1 + 1; - if (index2 >= this._positions.Count) - index2 = this._positions.Count - 1; - float amount = indexProgress - (float) index1; - return Vector2.Lerp(this._positions[index1], this._positions[index2], amount); - } - - private class PredictionEntity : Entity - { - } - } -} diff --git a/GameContent/Golf/GolfBallTrackRecord.cs b/GameContent/Golf/GolfBallTrackRecord.cs deleted file mode 100644 index 1bcbabd..0000000 --- a/GameContent/Golf/GolfBallTrackRecord.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Golf.GolfBallTrackRecord -// 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; -using System.Collections.Generic; - -namespace Terraria.GameContent.Golf -{ - public class GolfBallTrackRecord - { - private List _hitLocations = new List(); - - public void RecordHit(Vector2 position) => this._hitLocations.Add(position); - - public int GetAccumulatedScore() - { - double totalDistancePassed; - int hitsMade; - this.GetTrackInfo(out totalDistancePassed, out hitsMade); - return (int) (totalDistancePassed / 16.0) / (hitsMade + 2); - } - - private void GetTrackInfo(out double totalDistancePassed, out int hitsMade) - { - hitsMade = 0; - totalDistancePassed = 0.0; - int index = 0; - while (index < this._hitLocations.Count - 1) - { - totalDistancePassed += (double) Vector2.Distance(this._hitLocations[index], this._hitLocations[index + 1]); - ++index; - ++hitsMade; - } - } - } -} diff --git a/GameContent/Golf/GolfHelper.cs b/GameContent/Golf/GolfHelper.cs deleted file mode 100644 index 8750a4e..0000000 --- a/GameContent/Golf/GolfHelper.cs +++ /dev/null @@ -1,485 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Golf.GolfHelper -// 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; -using System; -using System.Diagnostics; -using Terraria.Audio; -using Terraria.Chat; -using Terraria.GameContent.Metadata; -using Terraria.ID; -using Terraria.Localization; -using Terraria.Physics; - -namespace Terraria.GameContent.Golf -{ - public static class GolfHelper - { - public const int PointsNeededForLevel1 = 500; - public const int PointsNeededForLevel2 = 1000; - public const int PointsNeededForLevel3 = 2000; - private static readonly PhysicsProperties PhysicsProperties = new PhysicsProperties(0.3f, 0.99f); - private static readonly GolfHelper.ContactListener Listener = new GolfHelper.ContactListener(); - private static FancyGolfPredictionLine _predictionLine; - - public static BallStepResult StepGolfBall( - Entity entity, - ref float angularVelocity) - { - return BallCollision.Step(GolfHelper.PhysicsProperties, entity, ref angularVelocity, (IBallContactListener) GolfHelper.Listener); - } - - private static Vector2 FindVectorOnOval(Vector2 vector, Vector2 radius) => (double) Math.Abs(radius.X) < 9.99999974737875E-05 || (double) Math.Abs(radius.Y) < 9.99999974737875E-05 ? Vector2.Zero : Vector2.Normalize(vector / radius) * radius; - - private static GolfHelper.ShotStrength CalculateShotStrength( - Vector2 shotVector, - GolfHelper.ClubProperties clubProperties) - { - Vector2.Normalize(shotVector); - double num1 = (double) shotVector.Length(); - float num2 = GolfHelper.FindVectorOnOval(shotVector, clubProperties.MaximumStrength).Length(); - float num3 = GolfHelper.FindVectorOnOval(shotVector, clubProperties.MinimumStrength).Length(); - double num4 = (double) num3; - double num5 = (double) num2; - double num6 = (double) MathHelper.Clamp((float) num1, (float) num4, (float) num5); - return new GolfHelper.ShotStrength((float) (num6 * 32.0), Math.Max((float) ((num6 - (double) num3) / ((double) num2 - (double) num3)), 1f / 1000f), clubProperties.RoughLandResistance); - } - - public static bool IsPlayerHoldingClub(Player player) - { - if (player == null || player.HeldItem == null) - return false; - int type = player.HeldItem.type; - switch (type) - { - case 4039: - case 4092: - case 4093: - case 4094: - return true; - default: - if ((uint) (type - 4587) > 11U) - return false; - goto case 4039; - } - } - - public static GolfHelper.ShotStrength CalculateShotStrength( - Projectile golfHelper, - Entity golfBall) - { - int num1 = Main.screenWidth; - if (num1 > Main.screenHeight) - num1 = Main.screenHeight; - int num2 = 150; - int num3 = (num1 - num2) / 2; - if (num3 < 200) - num3 = 200; - float num4 = 300f; - return (double) golfHelper.ai[0] != 0.0 ? new GolfHelper.ShotStrength() : GolfHelper.CalculateShotStrength((golfHelper.Center - golfBall.Center) / num4, GolfHelper.GetClubPropertiesFromGolfHelper(golfHelper)); - } - - private static GolfHelper.ClubProperties GetClubPropertiesFromGolfHelper( - Projectile golfHelper) - { - return GolfHelper.GetClubProperties((short) Main.player[golfHelper.owner].HeldItem.type); - } - - private static GolfHelper.ClubProperties GetClubProperties(short itemId) - { - Vector2 vector2 = new Vector2(0.25f, 0.25f); - switch (itemId) - { - case 4039: - return new GolfHelper.ClubProperties(vector2, Vector2.One, 0.0f); - case 4092: - return new GolfHelper.ClubProperties(Vector2.Zero, vector2, 0.0f); - case 4093: - return new GolfHelper.ClubProperties(vector2, new Vector2(0.65f, 1.5f), 1f); - case 4094: - return new GolfHelper.ClubProperties(vector2, new Vector2(1.5f, 0.65f), 0.0f); - case 4587: - return new GolfHelper.ClubProperties(vector2, Vector2.One, 0.0f); - case 4588: - return new GolfHelper.ClubProperties(Vector2.Zero, vector2, 0.0f); - case 4589: - return new GolfHelper.ClubProperties(vector2, new Vector2(0.65f, 1.5f), 1f); - case 4590: - return new GolfHelper.ClubProperties(vector2, new Vector2(1.5f, 0.65f), 0.0f); - case 4591: - return new GolfHelper.ClubProperties(vector2, Vector2.One, 0.0f); - case 4592: - return new GolfHelper.ClubProperties(Vector2.Zero, vector2, 0.0f); - case 4593: - return new GolfHelper.ClubProperties(vector2, new Vector2(0.65f, 1.5f), 1f); - case 4594: - return new GolfHelper.ClubProperties(vector2, new Vector2(1.5f, 0.65f), 0.0f); - case 4595: - return new GolfHelper.ClubProperties(vector2, Vector2.One, 0.0f); - case 4596: - return new GolfHelper.ClubProperties(Vector2.Zero, vector2, 0.0f); - case 4597: - return new GolfHelper.ClubProperties(vector2, new Vector2(0.65f, 1.5f), 1f); - case 4598: - return new GolfHelper.ClubProperties(vector2, new Vector2(1.5f, 0.65f), 0.0f); - default: - return new GolfHelper.ClubProperties(); - } - } - - public static Projectile FindHelperFromGolfBall(Projectile golfBall) - { - for (int index = 0; index < 1000; ++index) - { - Projectile projectile = Main.projectile[index]; - if (projectile.active && projectile.type == 722 && projectile.owner == golfBall.owner) - return Main.projectile[index]; - } - return (Projectile) null; - } - - public static Projectile FindGolfBallForHelper(Projectile golfHelper) - { - for (int index = 0; index < 1000; ++index) - { - Projectile projectile = Main.projectile[index]; - Vector2 shotVector = golfHelper.Center - projectile.Center; - if (projectile.active && ProjectileID.Sets.IsAGolfBall[projectile.type] && projectile.owner == golfHelper.owner && GolfHelper.ValidateShot((Entity) projectile, Main.player[golfHelper.owner], ref shotVector)) - return Main.projectile[index]; - } - return (Projectile) null; - } - - public static bool IsGolfBallResting(Projectile golfBall) => (int) golfBall.localAI[1] == 0 || (double) Vector2.Distance(golfBall.position, golfBall.oldPos[golfBall.oldPos.Length - 1]) < 1.0; - - public static bool IsGolfShotValid(Entity golfBall, Player player) - { - Vector2 vector2 = golfBall.Center - player.Bottom; - if (player.direction == -1) - vector2.X *= -1f; - return (double) vector2.X >= -16.0 && (double) vector2.X <= 32.0 && (double) vector2.Y <= 16.0 && (double) vector2.Y >= -16.0; - } - - public static bool ValidateShot(Entity golfBall, Player player, ref Vector2 shotVector) - { - Vector2 vector2 = golfBall.Center - player.Bottom; - if (player.direction == -1) - { - vector2.X *= -1f; - shotVector.X *= -1f; - } - float rotation = shotVector.ToRotation(); - if ((double) rotation > 0.0) - shotVector = shotVector.Length() * new Vector2((float) Math.Cos(0.0), (float) Math.Sin(0.0)); - else if ((double) rotation < -1.52079641819) - shotVector = shotVector.Length() * new Vector2((float) Math.Cos(-1.52079641819), (float) Math.Sin(-1.52079641819)); - if (player.direction == -1) - shotVector.X *= -1f; - return (double) vector2.X >= -16.0 && (double) vector2.X <= 32.0 && (double) vector2.Y <= 16.0 && (double) vector2.Y >= -16.0; - } - - public static void HitGolfBall(Entity entity, Vector2 velocity, float roughLandResistance) - { - Vector2 bottom = entity.Bottom; - ++bottom.Y; - Point tileCoordinates = bottom.ToTileCoordinates(); - Tile tile = Main.tile[tileCoordinates.X, tileCoordinates.Y]; - if (tile != null && tile.active()) - { - TileMaterial byTileId = TileMaterials.GetByTileId(tile.type); - velocity = Vector2.Lerp(velocity * byTileId.GolfPhysics.ClubImpactDampening, velocity, byTileId.GolfPhysics.ImpactDampeningResistanceEfficiency * roughLandResistance); - } - entity.velocity = velocity; - if (!(entity is Projectile golfBall)) - return; - golfBall.timeLeft = 18000; - if ((double) golfBall.ai[1] < 0.0) - golfBall.ai[1] = 0.0f; - ++golfBall.ai[1]; - golfBall.localAI[1] = 1f; - Main.LocalGolfState.RecordSwing(golfBall); - } - - public static void DrawPredictionLine( - Entity golfBall, - Vector2 impactVelocity, - float chargeProgress, - float roughLandResistance) - { - if (GolfHelper._predictionLine == null) - GolfHelper._predictionLine = new FancyGolfPredictionLine(20); - GolfHelper._predictionLine.Update(golfBall, impactVelocity, roughLandResistance); - GolfHelper._predictionLine.Draw(Main.Camera, Main.spriteBatch, chargeProgress); - } - - [Conditional("DEBUG")] - private static void UpdateDebugDraw(Vector2 position) - { - } - - private struct ClubProperties - { - public readonly Vector2 MinimumStrength; - public readonly Vector2 MaximumStrength; - public readonly float RoughLandResistance; - - public ClubProperties( - Vector2 minimumStrength, - Vector2 maximumStrength, - float roughLandResistance) - { - this.MinimumStrength = minimumStrength; - this.MaximumStrength = maximumStrength; - this.RoughLandResistance = roughLandResistance; - } - } - - public struct ShotStrength - { - public readonly float AbsoluteStrength; - public readonly float RelativeStrength; - public readonly float RoughLandResistance; - - public ShotStrength( - float absoluteStrength, - float relativeStrength, - float roughLandResistance) - { - this.AbsoluteStrength = absoluteStrength; - this.RelativeStrength = relativeStrength; - this.RoughLandResistance = roughLandResistance; - } - } - - public class ContactListener : IBallContactListener - { - public void OnCollision( - PhysicsProperties properties, - ref Vector2 position, - ref Vector2 velocity, - ref BallCollisionEvent collision) - { - TileMaterial byTileId = TileMaterials.GetByTileId(collision.Tile.type); - Vector2 vector2_1 = velocity * byTileId.GolfPhysics.SideImpactDampening; - Vector2 vector2_2 = collision.Normal * Vector2.Dot(velocity, collision.Normal) * (byTileId.GolfPhysics.DirectImpactDampening - byTileId.GolfPhysics.SideImpactDampening); - velocity = vector2_1 + vector2_2; - Projectile entity = collision.Entity as Projectile; - switch (collision.Tile.type) - { - case 421: - case 422: - float num1 = 2.5f * collision.TimeScale; - Vector2 vector2_3 = new Vector2(-collision.Normal.Y, collision.Normal.X); - if (collision.Tile.type == (ushort) 422) - vector2_3 = -vector2_3; - float num2 = Vector2.Dot(velocity, vector2_3); - if ((double) num2 < (double) num1) - { - velocity += vector2_3 * MathHelper.Clamp(num1 - num2, 0.0f, num1 * 0.5f); - break; - } - break; - case 476: - float num3 = velocity.Length() / collision.TimeScale; - if ((double) collision.Normal.Y <= -0.00999999977648258 && (double) num3 <= 100.0) - { - velocity *= 0.0f; - if (entity != null && entity.active) - { - this.PutBallInCup(entity, collision); - break; - } - break; - } - break; - } - if (entity == null || (double) velocity.Y >= -0.300000011920929 || (double) velocity.Y <= -2.0 || (double) velocity.Length() <= 1.0) - return; - Dust dust = Dust.NewDustPerfect(collision.Entity.Center, 31, new Vector2?(collision.Normal), (int) sbyte.MaxValue); - dust.scale = 0.7f; - dust.fadeIn = 1f; - dust.velocity = dust.velocity * 0.5f + Main.rand.NextVector2CircularEdge(0.5f, 0.4f); - } - - private void PutBallInCup(Projectile proj, BallCollisionEvent collision) - { - if (proj.owner == Main.myPlayer && Main.LocalGolfState.ShouldScoreHole) - { - Point tileCoordinates = (collision.ImpactPoint - collision.Normal * 0.5f).ToTileCoordinates(); - int owner = proj.owner; - int numberOfHits = (int) proj.ai[1]; - int type = proj.type; - if (numberOfHits > 1) - Main.LocalGolfState.SetScoreTime(); - Main.LocalGolfState.RecordBallInfo(proj); - Main.LocalGolfState.LandBall(proj); - int golfBallScore = Main.LocalGolfState.GetGolfBallScore(proj); - if (numberOfHits > 0) - Main.player[owner].AccumulateGolfingScore(golfBallScore); - GolfHelper.ContactListener.PutBallInCup_TextAndEffects(tileCoordinates, owner, numberOfHits, type); - Main.LocalGolfState.ResetScoreTime(); - Wiring.HitSwitch(tileCoordinates.X, tileCoordinates.Y); - NetMessage.SendData(59, number: tileCoordinates.X, number2: ((float) tileCoordinates.Y)); - if (Main.netMode == 1) - NetMessage.SendData(128, number: owner, number2: ((float) numberOfHits), number3: ((float) type), number5: tileCoordinates.X, number6: tileCoordinates.Y); - } - proj.Kill(); - } - - public static void PutBallInCup_TextAndEffects( - Point hitLocation, - int plr, - int numberOfHits, - int projid) - { - if (numberOfHits == 0) - return; - GolfHelper.ContactListener.EmitGolfballExplosion(hitLocation.ToWorldCoordinates(autoAddY: 0.0f)); - string key = "Game.BallBounceResultGolf_Single"; - if (numberOfHits != 1) - key = "Game.BallBounceResultGolf_Plural"; - NetworkText text = NetworkText.FromKey(key, (object) Main.player[plr].name, (object) NetworkText.FromKey(Lang.GetProjectileName(projid).Key), (object) numberOfHits); - switch (Main.netMode) - { - case 0: - case 1: - Main.NewText(text.ToString(), G: (byte) 240, B: (byte) 20); - break; - case 2: - ChatHelper.BroadcastChatMessage(text, new Color((int) byte.MaxValue, 240, 20)); - break; - } - } - - public void OnPassThrough( - PhysicsProperties properties, - ref Vector2 position, - ref Vector2 velocity, - ref float angularVelocity, - ref BallPassThroughEvent collision) - { - switch (collision.Type) - { - case BallPassThroughType.Water: - velocity *= 0.91f; - angularVelocity *= 0.91f; - break; - case BallPassThroughType.Honey: - velocity *= 0.8f; - angularVelocity *= 0.8f; - break; - case BallPassThroughType.Tile: - TileMaterial byTileId = TileMaterials.GetByTileId(collision.Tile.type); - velocity *= byTileId.GolfPhysics.PassThroughDampening; - angularVelocity *= byTileId.GolfPhysics.PassThroughDampening; - break; - } - } - - private static void EmitGolfballExplosion_Old(Vector2 Center) => GolfHelper.ContactListener.EmitGolfballExplosion(Center); - - private static void EmitGolfballExplosion(Vector2 Center) - { - SoundEngine.PlaySound(SoundID.Item129, Center); - for (float num = 0.0f; (double) num < 1.0; num += 0.085f) - { - Dust dust = Dust.NewDustPerfect(Center, 278, new Vector2?((num * 6.283185f).ToRotationVector2() * new Vector2(2f, 0.5f))); - dust.fadeIn = 1.2f; - dust.noGravity = true; - dust.velocity.X *= 0.7f; - dust.velocity.Y -= 1.5f; - dust.position.Y += 8f; - dust.velocity.X *= 2f; - dust.color = Main.hslToRgb(Main.rand.NextFloat(), 1f, 0.5f); - } - float num1 = Main.rand.NextFloat(); - float num2 = (float) Main.rand.Next(5, 10); - for (int index1 = 0; (double) index1 < (double) num2; ++index1) - { - int num3 = Main.rand.Next(5, 22); - Vector2 vector2 = ((float) (((double) index1 - (double) num2 / 2.0) * 6.28318548202515 / 256.0 - 1.57079637050629)).ToRotationVector2() * new Vector2(5f, 1f) * (float) (0.25 + (double) Main.rand.NextFloat() * 0.0500000007450581); - Color rgb = Main.hslToRgb((float) (((double) num1 + (double) index1 / (double) num2) % 1.0), 0.7f, 0.7f); - rgb.A = (byte) 127; - for (int index2 = 0; index2 < num3; ++index2) - { - Dust dust = Dust.NewDustPerfect(Center + new Vector2((float) index1 - num2 / 2f, 0.0f) * 2f, 278, new Vector2?(vector2)); - dust.fadeIn = 0.7f; - dust.scale = 0.7f; - dust.noGravity = true; - dust.position.Y += -1f; - dust.velocity *= (float) index2; - dust.scale += (float) (0.200000002980232 - (double) index2 * 0.0299999993294477); - dust.velocity += Main.rand.NextVector2Circular(0.05f, 0.05f); - dust.color = rgb; - } - } - for (float num4 = 0.0f; (double) num4 < 1.0; num4 += 0.2f) - { - Dust dust = Dust.NewDustPerfect(Center, 278, new Vector2?((num4 * 6.283185f).ToRotationVector2() * new Vector2(1f, 0.5f))); - dust.fadeIn = 1.2f; - dust.noGravity = true; - dust.velocity.X *= 0.7f; - dust.velocity.Y -= 0.5f; - dust.position.Y += 8f; - dust.velocity.X *= 2f; - dust.color = Main.hslToRgb(Main.rand.NextFloat(), 1f, 0.3f); - } - float num5 = Main.rand.NextFloatDirection(); - for (float num6 = 0.0f; (double) num6 < 1.0; num6 += 0.15f) - { - Dust dust = Dust.NewDustPerfect(Center, 278, new Vector2?((num5 + num6 * 6.283185f).ToRotationVector2() * 4f)); - dust.fadeIn = 1.5f; - dust.velocity *= (float) (0.5 + (double) num6 * 0.800000011920929); - dust.noGravity = true; - dust.velocity.X *= 0.35f; - dust.velocity.Y *= 2f; - --dust.velocity.Y; - dust.velocity.Y = -Math.Abs(dust.velocity.Y); - dust.position += dust.velocity * 3f; - dust.color = Main.hslToRgb(Main.rand.NextFloat(), 1f, (float) (0.600000023841858 + (double) Main.rand.NextFloat() * 0.200000002980232)); - } - } - - private static void EmitGolfballExplosion_v1(Vector2 Center) - { - for (float num = 0.0f; (double) num < 1.0; num += 0.085f) - { - Dust dust = Dust.NewDustPerfect(Center, 278, new Vector2?((num * 6.283185f).ToRotationVector2() * new Vector2(2f, 0.5f))); - dust.fadeIn = 1.2f; - dust.noGravity = true; - dust.velocity.X *= 0.7f; - dust.velocity.Y -= 1.5f; - dust.position.Y += 8f; - dust.color = Color.Lerp(Color.Silver, Color.White, 0.5f); - } - for (float num = 0.0f; (double) num < 1.0; num += 0.2f) - { - Dust dust = Dust.NewDustPerfect(Center, 278, new Vector2?((num * 6.283185f).ToRotationVector2() * new Vector2(1f, 0.5f))); - dust.fadeIn = 1.2f; - dust.noGravity = true; - dust.velocity.X *= 0.7f; - dust.velocity.Y -= 0.5f; - dust.position.Y += 8f; - dust.color = Color.Lerp(Color.Silver, Color.White, 0.5f); - } - float num1 = Main.rand.NextFloatDirection(); - for (float num2 = 0.0f; (double) num2 < 1.0; num2 += 0.15f) - { - Dust dust = Dust.NewDustPerfect(Center, 278, new Vector2?((num1 + num2 * 6.283185f).ToRotationVector2() * 4f)); - dust.fadeIn = 1.5f; - dust.velocity *= (float) (0.5 + (double) num2 * 0.800000011920929); - dust.noGravity = true; - dust.velocity.X *= 0.35f; - dust.velocity.Y *= 2f; - --dust.velocity.Y; - dust.velocity.Y = -Math.Abs(dust.velocity.Y); - dust.position += dust.velocity * 3f; - dust.color = Color.Lerp(Color.Silver, Color.White, 0.5f); - } - } - } - } -} diff --git a/GameContent/Golf/GolfState.cs b/GameContent/Golf/GolfState.cs deleted file mode 100644 index 65832fd..0000000 --- a/GameContent/Golf/GolfState.cs +++ /dev/null @@ -1,111 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Golf.GolfState -// 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; -using Terraria.ID; - -namespace Terraria.GameContent.Golf -{ - public class GolfState - { - private const int BALL_RETURN_PENALTY = 1; - private int golfScoreTime; - private int golfScoreTimeMax = 3600; - private int golfScoreDelay = 90; - private double _lastRecordedBallTime; - private Vector2? _lastRecordedBallLocation; - private bool _waitingForBallToSettle; - private Vector2 _lastSwingPosition; - private Projectile _lastHitGolfBall; - private int _lastRecordedSwingCount; - private GolfBallTrackRecord[] _hitRecords = new GolfBallTrackRecord[1000]; - - private void UpdateScoreTime() - { - if (this.golfScoreTime >= this.golfScoreTimeMax) - return; - ++this.golfScoreTime; - } - - public void ResetScoreTime() => this.golfScoreTime = 0; - - public void SetScoreTime() => this.golfScoreTime = this.golfScoreTimeMax; - - public float ScoreAdjustment => (float) this.golfScoreTime / (float) this.golfScoreTimeMax; - - public bool ShouldScoreHole => this.golfScoreTime >= this.golfScoreDelay; - - public bool IsTrackingBall => this.GetLastHitBall() != null && this._waitingForBallToSettle; - - public bool ShouldCameraTrackBallLastKnownLocation => this._lastRecordedBallTime + 2.0 >= Main.gameTimeCache.TotalGameTime.TotalSeconds && this.GetLastHitBall() == null; - - public Vector2? GetLastBallLocation() => this._lastRecordedBallLocation; - - public void CancelBallTracking() => this._waitingForBallToSettle = false; - - public void RecordSwing(Projectile golfBall) - { - this._lastSwingPosition = golfBall.position; - this._lastHitGolfBall = golfBall; - this._lastRecordedSwingCount = (int) golfBall.ai[1]; - this._waitingForBallToSettle = true; - int golfBallId = this.GetGolfBallId(golfBall); - if (this._hitRecords[golfBallId] == null || this._lastRecordedSwingCount == 1) - this._hitRecords[golfBallId] = new GolfBallTrackRecord(); - this._hitRecords[golfBallId].RecordHit(golfBall.position); - } - - private int GetGolfBallId(Projectile golfBall) => golfBall.whoAmI; - - public Projectile GetLastHitBall() => this._lastHitGolfBall == null || !this._lastHitGolfBall.active || !ProjectileID.Sets.IsAGolfBall[this._lastHitGolfBall.type] || this._lastHitGolfBall.owner != Main.myPlayer || this._lastRecordedSwingCount != (int) this._lastHitGolfBall.ai[1] ? (Projectile) null : this._lastHitGolfBall; - - public void Update() - { - this.UpdateScoreTime(); - Projectile lastHitBall = this.GetLastHitBall(); - if (lastHitBall == null) - { - this._waitingForBallToSettle = false; - } - else - { - if (this._waitingForBallToSettle) - this._waitingForBallToSettle = (int) lastHitBall.localAI[1] == 1; - if (Item.IsAGolfingItem(Main.LocalPlayer.HeldItem)) - return; - this._waitingForBallToSettle = false; - } - } - - public void RecordBallInfo(Projectile golfBall) - { - if (this.GetLastHitBall() != golfBall || !this._waitingForBallToSettle) - return; - this._lastRecordedBallLocation = new Vector2?(golfBall.Center); - this._lastRecordedBallTime = Main.gameTimeCache.TotalGameTime.TotalSeconds; - } - - public void LandBall(Projectile golfBall) => this._hitRecords[this.GetGolfBallId(golfBall)]?.RecordHit(golfBall.position); - - public int GetGolfBallScore(Projectile golfBall) - { - GolfBallTrackRecord hitRecord = this._hitRecords[this.GetGolfBallId(golfBall)]; - return hitRecord == null ? 0 : (int) ((double) hitRecord.GetAccumulatedScore() * (double) this.ScoreAdjustment); - } - - public void ResetGolfBall() - { - Projectile lastHitBall = this.GetLastHitBall(); - if (lastHitBall == null || (double) Vector2.Distance(lastHitBall.position, this._lastSwingPosition) < 1.0) - return; - lastHitBall.position = this._lastSwingPosition; - lastHitBall.velocity = Vector2.Zero; - ++lastHitBall.ai[1]; - lastHitBall.netUpdate2 = true; - this._lastRecordedSwingCount = (int) lastHitBall.ai[1]; - } - } -} diff --git a/GameContent/HairstyleUnlocksHelper.cs b/GameContent/HairstyleUnlocksHelper.cs deleted file mode 100644 index 914eaf7..0000000 --- a/GameContent/HairstyleUnlocksHelper.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.HairstyleUnlocksHelper -// 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.Collections.Generic; - -namespace Terraria.GameContent -{ - public class HairstyleUnlocksHelper - { - public List AvailableHairstyles = new List(); - private bool _defeatedMartians; - private bool _defeatedMoonlord; - private bool _isAtStylist; - private bool _isAtCharacterCreation; - - public void UpdateUnlocks() - { - if (!this.ListWarrantsRemake()) - return; - this.RebuildList(); - } - - private bool ListWarrantsRemake() - { - bool flag1 = NPC.downedMartians && !Main.gameMenu; - bool flag2 = NPC.downedMoonlord && !Main.gameMenu; - bool flag3 = Main.hairWindow && !Main.gameMenu; - bool gameMenu = Main.gameMenu; - bool flag4 = false; - if (this._defeatedMartians != flag1 || this._defeatedMoonlord != flag2 || this._isAtStylist != flag3 || this._isAtCharacterCreation != gameMenu) - flag4 = true; - this._defeatedMartians = flag1; - this._defeatedMoonlord = flag2; - this._isAtStylist = flag3; - this._isAtCharacterCreation = gameMenu; - return flag4; - } - - private void RebuildList() - { - List availableHairstyles = this.AvailableHairstyles; - availableHairstyles.Clear(); - if (this._isAtCharacterCreation || this._isAtStylist) - { - for (int index = 0; index < 51; ++index) - availableHairstyles.Add(index); - availableHairstyles.Add(136); - availableHairstyles.Add(137); - availableHairstyles.Add(138); - availableHairstyles.Add(139); - availableHairstyles.Add(140); - availableHairstyles.Add(141); - availableHairstyles.Add(142); - availableHairstyles.Add(143); - availableHairstyles.Add(144); - availableHairstyles.Add(147); - availableHairstyles.Add(148); - availableHairstyles.Add(149); - availableHairstyles.Add(150); - availableHairstyles.Add(151); - availableHairstyles.Add(154); - availableHairstyles.Add(155); - availableHairstyles.Add(157); - availableHairstyles.Add(158); - availableHairstyles.Add(161); - } - if (!this._isAtStylist) - return; - for (int index = 51; index < 123; ++index) - availableHairstyles.Add(index); - availableHairstyles.Add(134); - availableHairstyles.Add(135); - availableHairstyles.Add(145); - availableHairstyles.Add(146); - availableHairstyles.Add(152); - availableHairstyles.Add(153); - availableHairstyles.Add(156); - availableHairstyles.Add(159); - availableHairstyles.Add(160); - if (this._defeatedMartians) - availableHairstyles.AddRange((IEnumerable) new int[10] - { - 132, - 131, - 130, - 129, - 128, - (int) sbyte.MaxValue, - 126, - 125, - 124, - 123 - }); - if (!this._defeatedMartians || !this._defeatedMoonlord) - return; - availableHairstyles.Add(133); - } - } -} diff --git a/GameContent/INeedRenderTargetContent.cs b/GameContent/INeedRenderTargetContent.cs deleted file mode 100644 index 26a0e53..0000000 --- a/GameContent/INeedRenderTargetContent.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.INeedRenderTargetContent -// 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.Graphics; - -namespace Terraria.GameContent -{ - public interface INeedRenderTargetContent - { - bool IsReady { get; } - - void PrepareRenderTarget(GraphicsDevice device, SpriteBatch spriteBatch); - } -} diff --git a/GameContent/IOnPlayerJoining.cs b/GameContent/IOnPlayerJoining.cs deleted file mode 100644 index 2e087e1..0000000 --- a/GameContent/IOnPlayerJoining.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.IOnPlayerJoining -// 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 -{ - public interface IOnPlayerJoining - { - void OnPlayerJoining(int playerIndex); - } -} diff --git a/GameContent/IPersistentPerPlayerContent.cs b/GameContent/IPersistentPerPlayerContent.cs deleted file mode 100644 index bcc1d3e..0000000 --- a/GameContent/IPersistentPerPlayerContent.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.IPersistentPerPlayerContent -// 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.IO; - -namespace Terraria.GameContent -{ - public interface IPersistentPerPlayerContent - { - void Save(Player player, BinaryWriter writer); - - void Load(Player player, BinaryReader reader, int gameVersionSaveWasMadeOn); - - void ApplyLoadedDataToOutOfPlayerFields(Player player); - - void ResetDataForNewPlayer(Player player); - - void Reset(); - } -} diff --git a/GameContent/IPersistentPerWorldContent.cs b/GameContent/IPersistentPerWorldContent.cs deleted file mode 100644 index 33549d8..0000000 --- a/GameContent/IPersistentPerWorldContent.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.IPersistentPerWorldContent -// 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.IO; - -namespace Terraria.GameContent -{ - public interface IPersistentPerWorldContent - { - void Save(BinaryWriter writer); - - void Load(BinaryReader reader, int gameVersionSaveWasMadeOn); - - void ValidateWorld(BinaryReader reader, int gameVersionSaveWasMadeOn); - - void Reset(); - } -} diff --git a/GameContent/ITownNPCProfile.cs b/GameContent/ITownNPCProfile.cs deleted file mode 100644 index 1cc323a..0000000 --- a/GameContent/ITownNPCProfile.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ITownNPCProfile -// 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.Graphics; -using ReLogic.Content; - -namespace Terraria.GameContent -{ - public interface ITownNPCProfile - { - int RollVariation(); - - string GetNameForVariant(NPC npc); - - Asset GetTextureNPCShouldUse(NPC npc); - - int GetHeadTextureIndex(NPC npc); - } -} diff --git a/GameContent/ItemDropRules/Chains.cs b/GameContent/ItemDropRules/Chains.cs deleted file mode 100644 index c10be1b..0000000 --- a/GameContent/ItemDropRules/Chains.cs +++ /dev/null @@ -1,125 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.Chains -// 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.Collections.Generic; - -namespace Terraria.GameContent.ItemDropRules -{ - public static class Chains - { - public static void ReportDroprates( - List ChainedRules, - float personalDropRate, - List drops, - DropRateInfoChainFeed ratesInfo) - { - foreach (IItemDropRuleChainAttempt chainedRule in ChainedRules) - chainedRule.ReportDroprates(personalDropRate, drops, ratesInfo); - } - - public static IItemDropRule OnFailedRoll( - this IItemDropRule rule, - IItemDropRule ruleToChain, - bool hideLootReport = false) - { - rule.ChainedRules.Add((IItemDropRuleChainAttempt) new Chains.TryIfFailedRandomRoll(ruleToChain, hideLootReport)); - return ruleToChain; - } - - public static IItemDropRule OnSuccess( - this IItemDropRule rule, - IItemDropRule ruleToChain, - bool hideLootReport = false) - { - rule.ChainedRules.Add((IItemDropRuleChainAttempt) new Chains.TryIfSucceeded(ruleToChain, hideLootReport)); - return ruleToChain; - } - - public static IItemDropRule OnFailedConditions( - this IItemDropRule rule, - IItemDropRule ruleToChain, - bool hideLootReport = false) - { - rule.ChainedRules.Add((IItemDropRuleChainAttempt) new Chains.TryIfDoesntFillConditions(ruleToChain, hideLootReport)); - return ruleToChain; - } - - public class TryIfFailedRandomRoll : IItemDropRuleChainAttempt - { - private bool _hideLootReport; - - public IItemDropRule RuleToChain { get; private set; } - - public TryIfFailedRandomRoll(IItemDropRule rule, bool hideLootReport = false) - { - this.RuleToChain = rule; - this._hideLootReport = hideLootReport; - } - - public bool CanChainIntoRule(ItemDropAttemptResult parentResult) => parentResult.State == ItemDropAttemptResultState.FailedRandomRoll; - - public void ReportDroprates( - float personalDropRate, - List drops, - DropRateInfoChainFeed ratesInfo) - { - if (this._hideLootReport) - return; - this.RuleToChain.ReportDroprates(drops, ratesInfo.With(1f - personalDropRate)); - } - } - - public class TryIfSucceeded : IItemDropRuleChainAttempt - { - private bool _hideLootReport; - - public IItemDropRule RuleToChain { get; private set; } - - public TryIfSucceeded(IItemDropRule rule, bool hideLootReport = false) - { - this.RuleToChain = rule; - this._hideLootReport = hideLootReport; - } - - public bool CanChainIntoRule(ItemDropAttemptResult parentResult) => parentResult.State == ItemDropAttemptResultState.Success; - - public void ReportDroprates( - float personalDropRate, - List drops, - DropRateInfoChainFeed ratesInfo) - { - if (this._hideLootReport) - return; - this.RuleToChain.ReportDroprates(drops, ratesInfo.With(personalDropRate)); - } - } - - public class TryIfDoesntFillConditions : IItemDropRuleChainAttempt - { - private bool _hideLootReport; - - public IItemDropRule RuleToChain { get; private set; } - - public TryIfDoesntFillConditions(IItemDropRule rule, bool hideLootReport = false) - { - this.RuleToChain = rule; - this._hideLootReport = hideLootReport; - } - - public bool CanChainIntoRule(ItemDropAttemptResult parentResult) => parentResult.State == ItemDropAttemptResultState.DoesntFillConditions; - - public void ReportDroprates( - float personalDropRate, - List drops, - DropRateInfoChainFeed ratesInfo) - { - if (this._hideLootReport) - return; - this.RuleToChain.ReportDroprates(drops, ratesInfo.With(personalDropRate)); - } - } - } -} diff --git a/GameContent/ItemDropRules/CommonCode.cs b/GameContent/ItemDropRules/CommonCode.cs deleted file mode 100644 index 74334a4..0000000 --- a/GameContent/ItemDropRules/CommonCode.cs +++ /dev/null @@ -1,117 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.CommonCode -// 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; -using Terraria.Utilities; - -namespace Terraria.GameContent.ItemDropRules -{ - public static class CommonCode - { - public static void DropItemFromNPC(NPC npc, int itemId, int stack, bool scattered = false) - { - if (itemId <= 0 || itemId >= 5045) - return; - int X = (int) npc.position.X + npc.width / 2; - int Y = (int) npc.position.Y + npc.height / 2; - if (scattered) - { - X = (int) npc.position.X + Main.rand.Next(npc.width + 1); - Y = (int) npc.position.Y + Main.rand.Next(npc.height + 1); - } - int itemIndex = Item.NewItem(X, Y, 0, 0, itemId, stack, pfix: -1); - CommonCode.ModifyItemDropFromNPC(npc, itemIndex); - } - - public static void DropItemLocalPerClientAndSetNPCMoneyTo0( - NPC npc, - int itemId, - int stack, - bool interactionRequired = true) - { - if (itemId <= 0 || itemId >= 5045) - return; - if (Main.netMode == 2) - { - int number = Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, itemId, stack, true, -1); - Main.timeItemSlotCannotBeReusedFor[number] = 54000; - for (int remoteClient = 0; remoteClient < (int) byte.MaxValue; ++remoteClient) - { - if (Main.player[remoteClient].active && (npc.playerInteraction[remoteClient] || !interactionRequired)) - NetMessage.SendData(90, remoteClient, number: number); - } - Main.item[number].active = false; - } - else - CommonCode.DropItemFromNPC(npc, itemId, stack); - npc.value = 0.0f; - } - - public static void DropItemForEachInteractingPlayerOnThePlayer( - NPC npc, - int itemId, - UnifiedRandom rng, - int dropsAtXOutOfY_TheX, - int dropsAtXOutOfY_TheY, - int stack = 1, - bool interactionRequired = true) - { - if (itemId <= 0 || itemId >= 5045) - return; - if (Main.netMode == 2) - { - for (int index = 0; index < (int) byte.MaxValue; ++index) - { - Player player = Main.player[index]; - if (player.active && (npc.playerInteraction[index] || !interactionRequired) && rng.Next(dropsAtXOutOfY_TheY) < dropsAtXOutOfY_TheX) - { - int itemIndex = Item.NewItem(player.position, player.Size, itemId, stack, prefixGiven: -1); - CommonCode.ModifyItemDropFromNPC(npc, itemIndex); - } - } - } - else if (rng.Next(dropsAtXOutOfY_TheY) < dropsAtXOutOfY_TheX) - CommonCode.DropItemFromNPC(npc, itemId, stack); - npc.value = 0.0f; - } - - private static void ModifyItemDropFromNPC(NPC npc, int itemIndex) - { - Item obj = Main.item[itemIndex]; - switch (obj.type) - { - case 23: - if (npc.type != 1 || npc.netID == -1 || npc.netID == -2 || npc.netID == -5 || npc.netID == -6) - break; - obj.color = npc.color; - NetMessage.SendData(88, number: itemIndex, number2: 1f); - break; - case 319: - switch (npc.netID) - { - case 542: - obj.color = new Color(189, 148, 96, (int) byte.MaxValue); - NetMessage.SendData(88, number: itemIndex, number2: 1f); - return; - case 543: - obj.color = new Color(112, 85, 89, (int) byte.MaxValue); - NetMessage.SendData(88, number: itemIndex, number2: 1f); - return; - case 544: - obj.color = new Color(145, 27, 40, (int) byte.MaxValue); - NetMessage.SendData(88, number: itemIndex, number2: 1f); - return; - case 545: - obj.color = new Color(158, 113, 164, (int) byte.MaxValue); - NetMessage.SendData(88, number: itemIndex, number2: 1f); - return; - default: - return; - } - } - } - } -} diff --git a/GameContent/ItemDropRules/CommonDrop.cs b/GameContent/ItemDropRules/CommonDrop.cs deleted file mode 100644 index 359fc8f..0000000 --- a/GameContent/ItemDropRules/CommonDrop.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.CommonDrop -// 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.Collections.Generic; - -namespace Terraria.GameContent.ItemDropRules -{ - public class CommonDrop : IItemDropRule - { - protected int _itemId; - protected int _dropsOutOfY; - protected int _amtDroppedMinimum; - protected int _amtDroppedMaximum; - protected int _dropsXoutOfY; - - public List ChainedRules { get; private set; } - - public CommonDrop( - int itemId, - int dropsOutOfY, - int amountDroppedMinimum = 1, - int amountDroppedMaximum = 1, - int dropsXOutOfY = 1) - { - this._itemId = itemId; - this._dropsOutOfY = dropsOutOfY; - this._amtDroppedMinimum = amountDroppedMinimum; - this._amtDroppedMaximum = amountDroppedMaximum; - this._dropsXoutOfY = dropsXOutOfY; - this.ChainedRules = new List(); - } - - public virtual bool CanDrop(DropAttemptInfo info) => true; - - public virtual ItemDropAttemptResult TryDroppingItem(DropAttemptInfo info) - { - if (info.player.RollLuck(this._dropsOutOfY) < this._dropsXoutOfY) - { - CommonCode.DropItemFromNPC(info.npc, this._itemId, info.rng.Next(this._amtDroppedMinimum, this._amtDroppedMaximum + 1)); - return new ItemDropAttemptResult() - { - State = ItemDropAttemptResultState.Success - }; - } - return new ItemDropAttemptResult() - { - State = ItemDropAttemptResultState.FailedRandomRoll - }; - } - - public virtual void ReportDroprates(List drops, DropRateInfoChainFeed ratesInfo) - { - float personalDropRate = (float) this._dropsXoutOfY / (float) this._dropsOutOfY; - float dropRate = personalDropRate * ratesInfo.parentDroprateChance; - drops.Add(new DropRateInfo(this._itemId, this._amtDroppedMinimum, this._amtDroppedMaximum, dropRate, ratesInfo.conditions)); - Chains.ReportDroprates(this.ChainedRules, personalDropRate, drops, ratesInfo); - } - } -} diff --git a/GameContent/ItemDropRules/CommonDropNotScalingWithLuck.cs b/GameContent/ItemDropRules/CommonDropNotScalingWithLuck.cs deleted file mode 100644 index 5861f2f..0000000 --- a/GameContent/ItemDropRules/CommonDropNotScalingWithLuck.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.CommonDropNotScalingWithLuck -// 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.ItemDropRules -{ - public class CommonDropNotScalingWithLuck : CommonDrop - { - public CommonDropNotScalingWithLuck( - int itemId, - int dropsOutOfY, - int amountDroppedMinimum, - int amountDroppedMaximum) - : base(itemId, dropsOutOfY, amountDroppedMinimum, amountDroppedMaximum) - { - } - - public override ItemDropAttemptResult TryDroppingItem(DropAttemptInfo info) - { - if (info.rng.Next(this._dropsOutOfY) < this._dropsXoutOfY) - { - CommonCode.DropItemFromNPC(info.npc, this._itemId, info.rng.Next(this._amtDroppedMinimum, this._amtDroppedMaximum + 1)); - return new ItemDropAttemptResult() - { - State = ItemDropAttemptResultState.Success - }; - } - return new ItemDropAttemptResult() - { - State = ItemDropAttemptResultState.FailedRandomRoll - }; - } - } -} diff --git a/GameContent/ItemDropRules/CommonDropWithRerolls.cs b/GameContent/ItemDropRules/CommonDropWithRerolls.cs deleted file mode 100644 index 772b71b..0000000 --- a/GameContent/ItemDropRules/CommonDropWithRerolls.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.CommonDropWithRerolls -// 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.Collections.Generic; - -namespace Terraria.GameContent.ItemDropRules -{ - public class CommonDropWithRerolls : CommonDrop - { - private int _timesToRoll; - - public CommonDropWithRerolls( - int itemId, - int dropsOutOfY, - int amountDroppedMinimum, - int amountDroppedMaximum, - int rerolls) - : base(itemId, dropsOutOfY, amountDroppedMinimum, amountDroppedMaximum) - { - this._timesToRoll = rerolls + 1; - } - - public override ItemDropAttemptResult TryDroppingItem(DropAttemptInfo info) - { - bool flag = false; - for (int index = 0; index < this._timesToRoll; ++index) - flag = flag || info.player.RollLuck(this._dropsOutOfY) < this._dropsXoutOfY; - if (flag) - { - CommonCode.DropItemFromNPC(info.npc, this._itemId, info.rng.Next(this._amtDroppedMinimum, this._amtDroppedMaximum + 1)); - return new ItemDropAttemptResult() - { - State = ItemDropAttemptResultState.Success - }; - } - return new ItemDropAttemptResult() - { - State = ItemDropAttemptResultState.FailedRandomRoll - }; - } - - public override void ReportDroprates(List drops, DropRateInfoChainFeed ratesInfo) - { - float num1 = 1f - (float) this._dropsXoutOfY / (float) this._dropsOutOfY; - float num2 = 1f; - for (int index = 0; index < this._timesToRoll; ++index) - num2 *= num1; - float personalDropRate = 1f - num2; - float dropRate = personalDropRate * ratesInfo.parentDroprateChance; - drops.Add(new DropRateInfo(this._itemId, this._amtDroppedMinimum, this._amtDroppedMaximum, dropRate, ratesInfo.conditions)); - Chains.ReportDroprates(this.ChainedRules, personalDropRate, drops, ratesInfo); - } - } -} diff --git a/GameContent/ItemDropRules/Conditions.cs b/GameContent/ItemDropRules/Conditions.cs deleted file mode 100644 index 4e246d7..0000000 --- a/GameContent/ItemDropRules/Conditions.cs +++ /dev/null @@ -1,576 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.Conditions -// 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 Terraria.Localization; - -namespace Terraria.GameContent.ItemDropRules -{ - public class Conditions - { - private static bool SoulOfWhateverConditionCanDrop(DropAttemptInfo info) - { - if (info.npc.boss) - return false; - switch (info.npc.type) - { - case 1: - case 13: - case 14: - case 15: - case 121: - case 535: - return false; - default: - return Main.hardMode && info.npc.lifeMax > 1 && !info.npc.friendly && (double) info.npc.position.Y > Main.rockLayer * 16.0 && (double) info.npc.value >= 1.0; - } - } - - public class NeverTrue : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => false; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => (string) null; - } - - public class IsUsingSpecificAIValues : IItemDropRuleCondition, IProvideItemConditionDescription - { - private int _aiSlotToCheck; - private float _valueToMatch; - - public IsUsingSpecificAIValues(int aislot, float valueToMatch) - { - this._aiSlotToCheck = aislot; - this._valueToMatch = valueToMatch; - } - - public bool CanDrop(DropAttemptInfo info) => (double) info.npc.ai[this._aiSlotToCheck] == (double) this._valueToMatch; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => (string) null; - } - - public class FrostMoonDropGatingChance : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) - { - if (!Main.snowMoon) - return false; - int waveNumber = NPC.waveNumber; - if (Main.expertMode) - waveNumber += 7; - int range = (int) ((double) (30 - waveNumber) / 2.5); - if (Main.expertMode) - range -= 2; - if (range < 1) - range = 1; - return info.player.RollLuck(range) == 0; - } - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => (string) null; - } - - public class PumpkinMoonDropGatingChance : - IItemDropRuleCondition, - IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) - { - if (!Main.pumpkinMoon) - return false; - int waveNumber = NPC.waveNumber; - if (Main.expertMode) - waveNumber += 6; - int range = (int) ((double) (17 - waveNumber) / 1.25); - if (Main.expertMode) - --range; - if (range < 1) - range = 1; - return info.player.RollLuck(range) == 0; - } - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => (string) null; - } - - public class FrostMoonDropGateForTrophies : - IItemDropRuleCondition, - IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) - { - if (!Main.snowMoon) - return false; - int waveNumber = NPC.waveNumber; - if (NPC.waveNumber < 15) - return false; - int maxValue = 4; - if (waveNumber == 16) - maxValue = 4; - if (waveNumber == 17) - maxValue = 3; - if (waveNumber == 18) - maxValue = 3; - if (waveNumber == 19) - maxValue = 2; - if (waveNumber >= 20) - maxValue = 2; - if (Main.expertMode && Main.rand.Next(3) == 0) - --maxValue; - return info.rng.Next(maxValue) == 0; - } - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => (string) null; - } - - public class IsPumpkinMoon : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => Main.pumpkinMoon; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => (string) null; - } - - public class FromCertainWaveAndAbove : IItemDropRuleCondition, IProvideItemConditionDescription - { - private int _neededWave; - - public FromCertainWaveAndAbove(int neededWave) => this._neededWave = neededWave; - - public bool CanDrop(DropAttemptInfo info) => NPC.waveNumber >= this._neededWave; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => (string) null; - } - - public class IsBloodMoonAndNotFromStatue : - IItemDropRuleCondition, - IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => !Main.dayTime && Main.bloodMoon && !info.npc.SpawnedFromStatue && !info.IsInSimulation; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => (string) null; - } - - public class DownedAllMechBosses : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => (string) null; - } - - public class DownedPlantera : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => NPC.downedPlantBoss; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => (string) null; - } - - public class FirstTimeKillingPlantera : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => !NPC.downedPlantBoss; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => (string) null; - } - - public class MechanicalBossesDummyCondition : - IItemDropRuleCondition, - IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => true; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => (string) null; - } - - public class PirateMap : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => (double) info.npc.value > 0.0 && Main.hardMode && (double) info.npc.position.Y / 16.0 < Main.worldSurface + 10.0 && ((double) info.npc.Center.X / 16.0 < 380.0 || (double) info.npc.Center.X / 16.0 > (double) (Main.maxTilesX - 380)) && !info.IsInSimulation; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.PirateMap"); - } - - public class IsChristmas : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => Main.xMas; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.IsChristmas"); - } - - public class NotExpert : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => !Main.expertMode; - - public bool CanShowItemDropInUI() => !Main.expertMode; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.NotExpert"); - } - - public class NotMasterMode : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => !Main.masterMode; - - public bool CanShowItemDropInUI() => !Main.masterMode; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.NotMasterMode"); - } - - public class MissingTwin : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) - { - int Type = 125; - if (info.npc.type == 125) - Type = 126; - return !NPC.AnyNPCs(Type); - } - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => (string) null; - } - - public class EmpressOfLightIsGenuinelyEnraged : - IItemDropRuleCondition, - IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => info.npc.AI_120_HallowBoss_IsGenuinelyEnraged(); - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.EmpressOfLightOnlyTookDamageWhileEnraged"); - } - - public class PlayerNeedsHealing : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => info.player.statLife < info.player.statLifeMax2; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.PlayerNeedsHealing"); - } - - public class LegacyHack_IsBossAndExpert : - IItemDropRuleCondition, - IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => info.npc.boss && Main.expertMode; - - public bool CanShowItemDropInUI() => Main.expertMode; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.LegacyHack_IsBossAndExpert"); - } - - public class LegacyHack_IsBossAndNotExpert : - IItemDropRuleCondition, - IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => info.npc.boss && !Main.expertMode; - - public bool CanShowItemDropInUI() => !Main.expertMode; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.LegacyHack_IsBossAndNotExpert"); - } - - public class LegacyHack_IsABoss : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => info.npc.boss; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => (string) null; - } - - public class IsExpert : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => Main.expertMode; - - public bool CanShowItemDropInUI() => Main.expertMode; - - public string GetConditionDescription() => Main.masterMode ? Language.GetTextValue("Bestiary_ItemDropConditions.IsMasterMode") : Language.GetTextValue("Bestiary_ItemDropConditions.IsExpert"); - } - - public class IsMasterMode : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => Main.masterMode; - - public bool CanShowItemDropInUI() => Main.masterMode; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.IsMasterMode"); - } - - public class IsCrimson : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => WorldGen.crimson; - - public bool CanShowItemDropInUI() => WorldGen.crimson; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.IsCrimson"); - } - - public class IsCorruption : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => !WorldGen.crimson; - - public bool CanShowItemDropInUI() => !WorldGen.crimson; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.IsCorruption"); - } - - public class IsCrimsonAndNotExpert : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => WorldGen.crimson && !Main.expertMode; - - public bool CanShowItemDropInUI() => WorldGen.crimson && !Main.expertMode; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.IsCrimsonAndNotExpert"); - } - - public class IsCorruptionAndNotExpert : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => !WorldGen.crimson && !Main.expertMode; - - public bool CanShowItemDropInUI() => !WorldGen.crimson && !Main.expertMode; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.IsCorruptionAndNotExpert"); - } - - public class HalloweenWeapons : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) - { - float num1 = 500f * Main.GameModeInfo.EnemyMoneyDropMultiplier; - float num2 = 40f * Main.GameModeInfo.EnemyDamageMultiplier; - float num3 = 20f * Main.GameModeInfo.EnemyDefenseMultiplier; - return Main.halloween && (double) info.npc.value > 0.0 && (double) info.npc.value < (double) num1 && (double) info.npc.damage < (double) num2 && (double) info.npc.defense < (double) num3 && !info.IsInSimulation; - } - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.HalloweenWeapons"); - } - - public class SoulOfNight : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) - { - if (!Conditions.SoulOfWhateverConditionCanDrop(info)) - return false; - return info.player.ZoneCorrupt || info.player.ZoneCrimson; - } - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.SoulOfNight"); - } - - public class SoulOfLight : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => Conditions.SoulOfWhateverConditionCanDrop(info) && info.player.ZoneHallow; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.SoulOfLight"); - } - - public class NotFromStatue : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => !info.npc.SpawnedFromStatue; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.NotFromStatue"); - } - - public class HalloweenGoodieBagDrop : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => Main.halloween && info.npc.lifeMax > 1 && info.npc.damage > 0 && !info.npc.friendly && info.npc.type != 121 && info.npc.type != 23 && (double) info.npc.value > 0.0 && !info.IsInSimulation; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.HalloweenGoodieBagDrop"); - } - - public class XmasPresentDrop : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => Main.xMas && info.npc.lifeMax > 1 && info.npc.damage > 0 && !info.npc.friendly && info.npc.type != 121 && info.npc.type != 23 && (double) info.npc.value > 0.0 && !info.IsInSimulation; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.XmasPresentDrop"); - } - - public class LivingFlames : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => info.npc.lifeMax > 5 && (double) info.npc.value > 0.0 && !info.npc.friendly && Main.hardMode && (double) info.npc.position.Y / 16.0 > (double) Main.UnderworldLayer && !info.IsInSimulation; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.LivingFlames"); - } - - public class NamedNPC : IItemDropRuleCondition, IProvideItemConditionDescription - { - private string _neededName; - - public NamedNPC(string neededName) => this._neededName = neededName; - - public bool CanDrop(DropAttemptInfo info) => info.npc.GivenOrTypeName == this._neededName; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.NamedNPC"); - } - - public class HallowKeyCondition : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => (double) info.npc.value > 0.0 && Main.hardMode && !info.IsInSimulation && info.player.ZoneHallow; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.HallowKeyCondition"); - } - - public class JungleKeyCondition : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => (double) info.npc.value > 0.0 && Main.hardMode && !info.IsInSimulation && info.player.ZoneJungle; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.JungleKeyCondition"); - } - - public class CorruptKeyCondition : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => (double) info.npc.value > 0.0 && Main.hardMode && !info.IsInSimulation && info.player.ZoneCorrupt; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.CorruptKeyCondition"); - } - - public class CrimsonKeyCondition : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => (double) info.npc.value > 0.0 && Main.hardMode && !info.IsInSimulation && info.player.ZoneCrimson; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.CrimsonKeyCondition"); - } - - public class FrozenKeyCondition : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => (double) info.npc.value > 0.0 && Main.hardMode && !info.IsInSimulation && info.player.ZoneSnow; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.FrozenKeyCondition"); - } - - public class DesertKeyCondition : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => (double) info.npc.value > 0.0 && Main.hardMode && !info.IsInSimulation && info.player.ZoneDesert && !info.player.ZoneBeach; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.DesertKeyCondition"); - } - - public class BeatAnyMechBoss : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => NPC.downedMechBossAny; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.BeatAnyMechBoss"); - } - - public class YoyoCascade : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => !Main.hardMode && info.npc.HasPlayerTarget && info.npc.lifeMax > 5 && !info.npc.friendly && (double) info.npc.position.Y / 16.0 > (double) (Main.maxTilesY - 350) && NPC.downedBoss3 && !info.IsInSimulation; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.YoyoCascade"); - } - - public class YoyosAmarok : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => Main.hardMode && info.npc.HasPlayerTarget && info.player.ZoneSnow && info.npc.lifeMax > 5 && !info.npc.friendly && (double) info.npc.value > 0.0 && !info.IsInSimulation; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.YoyosAmarok"); - } - - public class YoyosYelets : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => Main.hardMode && info.player.ZoneJungle && NPC.downedMechBossAny && info.npc.lifeMax > 5 && info.npc.HasPlayerTarget && !info.npc.friendly && (double) info.npc.value > 0.0 && !info.IsInSimulation; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.YoyosYelets"); - } - - public class YoyosKraken : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => Main.hardMode && info.player.ZoneDungeon && NPC.downedPlantBoss && info.npc.lifeMax > 5 && info.npc.HasPlayerTarget && !info.npc.friendly && (double) info.npc.value > 0.0 && !info.IsInSimulation; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.YoyosKraken"); - } - - public class YoyosHelFire : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => Main.hardMode && !info.player.ZoneDungeon && (double) info.npc.position.Y / 16.0 > (Main.rockLayer + (double) (Main.maxTilesY * 2)) / 3.0 && info.npc.lifeMax > 5 && info.npc.HasPlayerTarget && !info.npc.friendly && (double) info.npc.value > 0.0 && !info.IsInSimulation; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.YoyosHelFire"); - } - - public class KOCannon : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => Main.hardMode && Main.bloodMoon && (double) info.npc.value > 0.0 && !info.IsInSimulation; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.KOCannon"); - } - - public class WindyEnoughForKiteDrops : IItemDropRuleCondition, IProvideItemConditionDescription - { - public bool CanDrop(DropAttemptInfo info) => Main.WindyEnoughForKiteDrops; - - public bool CanShowItemDropInUI() => true; - - public string GetConditionDescription() => Language.GetTextValue("Bestiary_ItemDropConditions.IsItAHappyWindyDay"); - } - } -} diff --git a/GameContent/ItemDropRules/DropAttemptInfo.cs b/GameContent/ItemDropRules/DropAttemptInfo.cs deleted file mode 100644 index 2f71487..0000000 --- a/GameContent/ItemDropRules/DropAttemptInfo.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.DropAttemptInfo -// 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 Terraria.Utilities; - -namespace Terraria.GameContent.ItemDropRules -{ - public struct DropAttemptInfo - { - public NPC npc; - public Player player; - public UnifiedRandom rng; - public bool IsInSimulation; - public bool IsExpertMode; - public bool IsMasterMode; - } -} diff --git a/GameContent/ItemDropRules/DropBasedOnExpertMode.cs b/GameContent/ItemDropRules/DropBasedOnExpertMode.cs deleted file mode 100644 index 07cf881..0000000 --- a/GameContent/ItemDropRules/DropBasedOnExpertMode.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.DropBasedOnExpertMode -// 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.Collections.Generic; - -namespace Terraria.GameContent.ItemDropRules -{ - public class DropBasedOnExpertMode : IItemDropRule, INestedItemDropRule - { - private IItemDropRule _ruleForNormalMode; - private IItemDropRule _ruleForExpertMode; - - public List ChainedRules { get; private set; } - - public DropBasedOnExpertMode(IItemDropRule ruleForNormalMode, IItemDropRule ruleForExpertMode) - { - this._ruleForNormalMode = ruleForNormalMode; - this._ruleForExpertMode = ruleForExpertMode; - this.ChainedRules = new List(); - } - - public bool CanDrop(DropAttemptInfo info) => info.IsExpertMode ? this._ruleForExpertMode.CanDrop(info) : this._ruleForNormalMode.CanDrop(info); - - public ItemDropAttemptResult TryDroppingItem(DropAttemptInfo info) => new ItemDropAttemptResult() - { - State = ItemDropAttemptResultState.DidNotRunCode - }; - - public ItemDropAttemptResult TryDroppingItem( - DropAttemptInfo info, - ItemDropRuleResolveAction resolveAction) - { - return info.IsExpertMode ? resolveAction(this._ruleForExpertMode, info) : resolveAction(this._ruleForNormalMode, info); - } - - public void ReportDroprates(List drops, DropRateInfoChainFeed ratesInfo) - { - DropRateInfoChainFeed ratesInfo1 = ratesInfo.With(1f); - ratesInfo1.AddCondition((IItemDropRuleCondition) new Conditions.IsExpert()); - this._ruleForExpertMode.ReportDroprates(drops, ratesInfo1); - DropRateInfoChainFeed ratesInfo2 = ratesInfo.With(1f); - ratesInfo2.AddCondition((IItemDropRuleCondition) new Conditions.NotExpert()); - this._ruleForNormalMode.ReportDroprates(drops, ratesInfo2); - Chains.ReportDroprates(this.ChainedRules, 1f, drops, ratesInfo); - } - } -} diff --git a/GameContent/ItemDropRules/DropBasedOnMasterMode.cs b/GameContent/ItemDropRules/DropBasedOnMasterMode.cs deleted file mode 100644 index 1e146a0..0000000 --- a/GameContent/ItemDropRules/DropBasedOnMasterMode.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.DropBasedOnMasterMode -// 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.Collections.Generic; - -namespace Terraria.GameContent.ItemDropRules -{ - public class DropBasedOnMasterMode : IItemDropRule, INestedItemDropRule - { - private IItemDropRule _ruleForDefault; - private IItemDropRule _ruleForMasterMode; - - public List ChainedRules { get; private set; } - - public DropBasedOnMasterMode(IItemDropRule ruleForDefault, IItemDropRule ruleForMasterMode) - { - this._ruleForDefault = ruleForDefault; - this._ruleForMasterMode = ruleForMasterMode; - this.ChainedRules = new List(); - } - - public bool CanDrop(DropAttemptInfo info) => info.IsMasterMode ? this._ruleForMasterMode.CanDrop(info) : this._ruleForDefault.CanDrop(info); - - public ItemDropAttemptResult TryDroppingItem(DropAttemptInfo info) => new ItemDropAttemptResult() - { - State = ItemDropAttemptResultState.DidNotRunCode - }; - - public ItemDropAttemptResult TryDroppingItem( - DropAttemptInfo info, - ItemDropRuleResolveAction resolveAction) - { - return info.IsMasterMode ? resolveAction(this._ruleForMasterMode, info) : resolveAction(this._ruleForDefault, info); - } - - public void ReportDroprates(List drops, DropRateInfoChainFeed ratesInfo) - { - DropRateInfoChainFeed ratesInfo1 = ratesInfo.With(1f); - ratesInfo1.AddCondition((IItemDropRuleCondition) new Conditions.IsMasterMode()); - this._ruleForMasterMode.ReportDroprates(drops, ratesInfo1); - DropRateInfoChainFeed ratesInfo2 = ratesInfo.With(1f); - ratesInfo2.AddCondition((IItemDropRuleCondition) new Conditions.NotMasterMode()); - this._ruleForDefault.ReportDroprates(drops, ratesInfo2); - Chains.ReportDroprates(this.ChainedRules, 1f, drops, ratesInfo); - } - } -} diff --git a/GameContent/ItemDropRules/DropLocalPerClientAndResetsNPCMoneyTo0.cs b/GameContent/ItemDropRules/DropLocalPerClientAndResetsNPCMoneyTo0.cs deleted file mode 100644 index a735905..0000000 --- a/GameContent/ItemDropRules/DropLocalPerClientAndResetsNPCMoneyTo0.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.DropLocalPerClientAndResetsNPCMoneyTo0 -// 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.ItemDropRules -{ - public class DropLocalPerClientAndResetsNPCMoneyTo0 : CommonDrop - { - private IItemDropRuleCondition _condition; - - public DropLocalPerClientAndResetsNPCMoneyTo0( - int itemId, - int dropsOutOfY, - int amountDroppedMinimum, - int amountDroppedMaximum, - IItemDropRuleCondition optionalCondition) - : base(itemId, dropsOutOfY, amountDroppedMinimum, amountDroppedMaximum) - { - this._condition = optionalCondition; - } - - public override bool CanDrop(DropAttemptInfo info) => this._condition == null || this._condition.CanDrop(info); - - public override ItemDropAttemptResult TryDroppingItem(DropAttemptInfo info) - { - if (info.rng.Next(this._dropsOutOfY) < this._dropsXoutOfY) - { - CommonCode.DropItemLocalPerClientAndSetNPCMoneyTo0(info.npc, this._itemId, info.rng.Next(this._amtDroppedMinimum, this._amtDroppedMaximum + 1)); - return new ItemDropAttemptResult() - { - State = ItemDropAttemptResultState.Success - }; - } - return new ItemDropAttemptResult() - { - State = ItemDropAttemptResultState.FailedRandomRoll - }; - } - } -} diff --git a/GameContent/ItemDropRules/DropNothing.cs b/GameContent/ItemDropRules/DropNothing.cs deleted file mode 100644 index d484d8b..0000000 --- a/GameContent/ItemDropRules/DropNothing.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.DropNothing -// 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.Collections.Generic; - -namespace Terraria.GameContent.ItemDropRules -{ - public class DropNothing : IItemDropRule - { - public List ChainedRules { get; private set; } - - public DropNothing() => this.ChainedRules = new List(); - - public bool CanDrop(DropAttemptInfo info) => false; - - public ItemDropAttemptResult TryDroppingItem(DropAttemptInfo info) => new ItemDropAttemptResult() - { - State = ItemDropAttemptResultState.DoesntFillConditions - }; - - public void ReportDroprates(List drops, DropRateInfoChainFeed ratesInfo) => Chains.ReportDroprates(this.ChainedRules, 1f, drops, ratesInfo); - } -} diff --git a/GameContent/ItemDropRules/DropOneByOne.cs b/GameContent/ItemDropRules/DropOneByOne.cs deleted file mode 100644 index cd874b1..0000000 --- a/GameContent/ItemDropRules/DropOneByOne.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.DropOneByOne -// 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.Collections.Generic; - -namespace Terraria.GameContent.ItemDropRules -{ - public class DropOneByOne : IItemDropRule - { - private int _itemId; - private DropOneByOne.Parameters _parameters; - - public List ChainedRules { get; private set; } - - public DropOneByOne(int itemId, DropOneByOne.Parameters parameters) - { - this.ChainedRules = new List(); - this._parameters = parameters; - this._itemId = itemId; - } - - public ItemDropAttemptResult TryDroppingItem(DropAttemptInfo info) - { - if (info.player.RollLuck(this._parameters.DropsXOutOfYTimes_TheY) < this._parameters.DropsXOutOfYTimes_TheX) - { - int num1 = info.rng.Next(this._parameters.MinimumItemDropsCount, this._parameters.MaximumItemDropsCount + 1); - int activePlayersCount = Main.CurrentFrameFlags.ActivePlayersCount; - int minValue = this._parameters.MinimumStackPerChunkBase + activePlayersCount * this._parameters.BonusMinDropsPerChunkPerPlayer; - int num2 = this._parameters.MaximumStackPerChunkBase + activePlayersCount * this._parameters.BonusMaxDropsPerChunkPerPlayer; - for (int index = 0; index < num1; ++index) - CommonCode.DropItemFromNPC(info.npc, this._itemId, info.rng.Next(minValue, num2 + 1), true); - return new ItemDropAttemptResult() - { - State = ItemDropAttemptResultState.Success - }; - } - return new ItemDropAttemptResult() - { - State = ItemDropAttemptResultState.FailedRandomRoll - }; - } - - public void ReportDroprates(List drops, DropRateInfoChainFeed ratesInfo) - { - float personalDropRate = this._parameters.GetPersonalDropRate(); - float dropRate = personalDropRate * ratesInfo.parentDroprateChance; - drops.Add(new DropRateInfo(this._itemId, this._parameters.MinimumItemDropsCount * (this._parameters.MinimumStackPerChunkBase + this._parameters.BonusMinDropsPerChunkPerPlayer), this._parameters.MaximumItemDropsCount * (this._parameters.MaximumStackPerChunkBase + this._parameters.BonusMaxDropsPerChunkPerPlayer), dropRate, ratesInfo.conditions)); - Chains.ReportDroprates(this.ChainedRules, personalDropRate, drops, ratesInfo); - } - - public bool CanDrop(DropAttemptInfo info) => true; - - public struct Parameters - { - public int DropsXOutOfYTimes_TheX; - public int DropsXOutOfYTimes_TheY; - public int MinimumItemDropsCount; - public int MaximumItemDropsCount; - public int MinimumStackPerChunkBase; - public int MaximumStackPerChunkBase; - public int BonusMinDropsPerChunkPerPlayer; - public int BonusMaxDropsPerChunkPerPlayer; - - public float GetPersonalDropRate() => (float) this.DropsXOutOfYTimes_TheX / (float) this.DropsXOutOfYTimes_TheY; - } - } -} diff --git a/GameContent/ItemDropRules/DropPerPlayerOnThePlayer.cs b/GameContent/ItemDropRules/DropPerPlayerOnThePlayer.cs deleted file mode 100644 index 6b7ae1b..0000000 --- a/GameContent/ItemDropRules/DropPerPlayerOnThePlayer.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.DropPerPlayerOnThePlayer -// 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.ItemDropRules -{ - public class DropPerPlayerOnThePlayer : CommonDrop - { - private IItemDropRuleCondition _condition; - - public DropPerPlayerOnThePlayer( - int itemId, - int dropsOutOfY, - int amountDroppedMinimum, - int amountDroppedMaximum, - IItemDropRuleCondition optionalCondition) - : base(itemId, dropsOutOfY, amountDroppedMinimum, amountDroppedMaximum) - { - this._condition = optionalCondition; - } - - public override bool CanDrop(DropAttemptInfo info) => this._condition == null || this._condition.CanDrop(info); - - public override ItemDropAttemptResult TryDroppingItem(DropAttemptInfo info) - { - CommonCode.DropItemForEachInteractingPlayerOnThePlayer(info.npc, this._itemId, info.rng, this._dropsXoutOfY, this._dropsOutOfY, info.rng.Next(this._amtDroppedMinimum, this._amtDroppedMaximum + 1)); - return new ItemDropAttemptResult() - { - State = ItemDropAttemptResultState.Success - }; - } - } -} diff --git a/GameContent/ItemDropRules/DropRateInfo.cs b/GameContent/ItemDropRules/DropRateInfo.cs deleted file mode 100644 index 6689a6e..0000000 --- a/GameContent/ItemDropRules/DropRateInfo.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.DropRateInfo -// 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.Collections.Generic; - -namespace Terraria.GameContent.ItemDropRules -{ - public struct DropRateInfo - { - public int itemId; - public int stackMin; - public int stackMax; - public float dropRate; - public List conditions; - - public DropRateInfo( - int itemId, - int stackMin, - int stackMax, - float dropRate, - List conditions = null) - { - this.itemId = itemId; - this.stackMin = stackMin; - this.stackMax = stackMax; - this.dropRate = dropRate; - this.conditions = (List) null; - if (conditions == null || conditions.Count <= 0) - return; - this.conditions = new List((IEnumerable) conditions); - } - - public void AddCondition(IItemDropRuleCondition condition) - { - if (this.conditions == null) - this.conditions = new List(); - this.conditions.Add(condition); - } - } -} diff --git a/GameContent/ItemDropRules/DropRateInfoChainFeed.cs b/GameContent/ItemDropRules/DropRateInfoChainFeed.cs deleted file mode 100644 index 483ddf9..0000000 --- a/GameContent/ItemDropRules/DropRateInfoChainFeed.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.DropRateInfoChainFeed -// 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.Collections.Generic; - -namespace Terraria.GameContent.ItemDropRules -{ - public struct DropRateInfoChainFeed - { - public float parentDroprateChance; - public List conditions; - - public void AddCondition(IItemDropRuleCondition condition) - { - if (this.conditions == null) - this.conditions = new List(); - this.conditions.Add(condition); - } - - public DropRateInfoChainFeed(float droprate) - { - this.parentDroprateChance = droprate; - this.conditions = (List) null; - } - - public DropRateInfoChainFeed With(float multiplier) - { - DropRateInfoChainFeed rateInfoChainFeed = new DropRateInfoChainFeed(this.parentDroprateChance * multiplier); - if (this.conditions != null) - rateInfoChainFeed.conditions = new List((IEnumerable) this.conditions); - return rateInfoChainFeed; - } - } -} diff --git a/GameContent/ItemDropRules/IItemDropRule.cs b/GameContent/ItemDropRules/IItemDropRule.cs deleted file mode 100644 index a6bc06f..0000000 --- a/GameContent/ItemDropRules/IItemDropRule.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.IItemDropRule -// 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.Collections.Generic; - -namespace Terraria.GameContent.ItemDropRules -{ - public interface IItemDropRule - { - List ChainedRules { get; } - - bool CanDrop(DropAttemptInfo info); - - void ReportDroprates(List drops, DropRateInfoChainFeed ratesInfo); - - ItemDropAttemptResult TryDroppingItem(DropAttemptInfo info); - } -} diff --git a/GameContent/ItemDropRules/IItemDropRuleChainAttempt.cs b/GameContent/ItemDropRules/IItemDropRuleChainAttempt.cs deleted file mode 100644 index 31e7fab..0000000 --- a/GameContent/ItemDropRules/IItemDropRuleChainAttempt.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.IItemDropRuleChainAttempt -// 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.Collections.Generic; - -namespace Terraria.GameContent.ItemDropRules -{ - public interface IItemDropRuleChainAttempt - { - IItemDropRule RuleToChain { get; } - - bool CanChainIntoRule(ItemDropAttemptResult parentResult); - - void ReportDroprates( - float personalDropRate, - List drops, - DropRateInfoChainFeed ratesInfo); - } -} diff --git a/GameContent/ItemDropRules/IItemDropRuleCondition.cs b/GameContent/ItemDropRules/IItemDropRuleCondition.cs deleted file mode 100644 index e085a1e..0000000 --- a/GameContent/ItemDropRules/IItemDropRuleCondition.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.IItemDropRuleCondition -// 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.ItemDropRules -{ - public interface IItemDropRuleCondition : IProvideItemConditionDescription - { - bool CanDrop(DropAttemptInfo info); - - bool CanShowItemDropInUI(); - } -} diff --git a/GameContent/ItemDropRules/INestedItemDropRule.cs b/GameContent/ItemDropRules/INestedItemDropRule.cs deleted file mode 100644 index 998a08c..0000000 --- a/GameContent/ItemDropRules/INestedItemDropRule.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.INestedItemDropRule -// 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.ItemDropRules -{ - public interface INestedItemDropRule - { - ItemDropAttemptResult TryDroppingItem( - DropAttemptInfo info, - ItemDropRuleResolveAction resolveAction); - } -} diff --git a/GameContent/ItemDropRules/IProvideItemConditionDescription.cs b/GameContent/ItemDropRules/IProvideItemConditionDescription.cs deleted file mode 100644 index 28afbd0..0000000 --- a/GameContent/ItemDropRules/IProvideItemConditionDescription.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.IProvideItemConditionDescription -// 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.ItemDropRules -{ - public interface IProvideItemConditionDescription - { - string GetConditionDescription(); - } -} diff --git a/GameContent/ItemDropRules/ItemDropAttemptResult.cs b/GameContent/ItemDropRules/ItemDropAttemptResult.cs deleted file mode 100644 index 7c67b9f..0000000 --- a/GameContent/ItemDropRules/ItemDropAttemptResult.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.ItemDropAttemptResult -// 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.ItemDropRules -{ - public struct ItemDropAttemptResult - { - public ItemDropAttemptResultState State; - } -} diff --git a/GameContent/ItemDropRules/ItemDropAttemptResultState.cs b/GameContent/ItemDropRules/ItemDropAttemptResultState.cs deleted file mode 100644 index ecc83de..0000000 --- a/GameContent/ItemDropRules/ItemDropAttemptResultState.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.ItemDropAttemptResultState -// 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.ItemDropRules -{ - public enum ItemDropAttemptResultState - { - DoesntFillConditions, - FailedRandomRoll, - Success, - DidNotRunCode, - } -} diff --git a/GameContent/ItemDropRules/ItemDropDatabase.cs b/GameContent/ItemDropRules/ItemDropDatabase.cs deleted file mode 100644 index 4756f5b..0000000 --- a/GameContent/ItemDropRules/ItemDropDatabase.cs +++ /dev/null @@ -1,1221 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.ItemDropDatabase -// 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.ItemDropRules -{ - public class ItemDropDatabase - { - private List _globalEntries = new List(); - private Dictionary> _entriesByNpcNetId = new Dictionary>(); - private Dictionary> _npcNetIdsByType = new Dictionary>(); - private int _masterModeDropRng = 4; - - public void PrepareNPCNetIDsByTypeDictionary() - { - this._npcNetIdsByType.Clear(); - foreach (KeyValuePair keyValuePair in ContentSamples.NpcsByNetId.Where>((Func, bool>) (x => x.Key < 0))) - { - if (!this._npcNetIdsByType.ContainsKey(keyValuePair.Value.type)) - this._npcNetIdsByType[keyValuePair.Value.type] = new List(); - this._npcNetIdsByType[keyValuePair.Value.type].Add(keyValuePair.Value.netID); - } - } - - public void TrimDuplicateRulesForNegativeIDs() - { - for (int key = -65; key < 0; ++key) - { - List source; - if (this._entriesByNpcNetId.TryGetValue(key, out source)) - this._entriesByNpcNetId[key] = source.Distinct().ToList(); - } - } - - public List GetRulesForNPCID( - int npcNetId, - bool includeGlobalDrops = true) - { - List itemDropRuleList1 = new List(); - if (includeGlobalDrops) - itemDropRuleList1.AddRange((IEnumerable) this._globalEntries); - List itemDropRuleList2; - if (this._entriesByNpcNetId.TryGetValue(npcNetId, out itemDropRuleList2)) - itemDropRuleList1.AddRange((IEnumerable) itemDropRuleList2); - return itemDropRuleList1; - } - - public IItemDropRule RegisterToGlobal(IItemDropRule entry) - { - this._globalEntries.Add(entry); - return entry; - } - - public IItemDropRule RegisterToNPC(int type, IItemDropRule entry) - { - this.RegisterToNPCNetId(type, entry); - List intList; - if (type > 0 && this._npcNetIdsByType.TryGetValue(type, out intList)) - { - for (int index = 0; index < intList.Count; ++index) - this.RegisterToNPCNetId(intList[index], entry); - } - return entry; - } - - private void RegisterToNPCNetId(int npcNetId, IItemDropRule entry) - { - if (!this._entriesByNpcNetId.ContainsKey(npcNetId)) - this._entriesByNpcNetId[npcNetId] = new List(); - this._entriesByNpcNetId[npcNetId].Add(entry); - } - - public IItemDropRule RegisterToMultipleNPCs( - IItemDropRule entry, - params int[] npcNetIds) - { - for (int index = 0; index < npcNetIds.Length; ++index) - this.RegisterToNPC(npcNetIds[index], entry); - return entry; - } - - private void RemoveFromNPCNetId(int npcNetId, IItemDropRule entry) - { - if (!this._entriesByNpcNetId.ContainsKey(npcNetId)) - return; - this._entriesByNpcNetId[npcNetId].Remove(entry); - } - - public IItemDropRule RemoveFromNPC(int type, IItemDropRule entry) - { - this.RemoveFromNPCNetId(type, entry); - List intList; - if (type > 0 && this._npcNetIdsByType.TryGetValue(type, out intList)) - { - for (int index = 0; index < intList.Count; ++index) - this.RemoveFromNPCNetId(intList[index], entry); - } - return entry; - } - - public IItemDropRule RemoveFromMultipleNPCs( - IItemDropRule entry, - params int[] npcNetIds) - { - for (int index = 0; index < npcNetIds.Length; ++index) - this.RemoveFromNPC(npcNetIds[index], entry); - return entry; - } - - public void Populate() - { - this.PrepareNPCNetIDsByTypeDictionary(); - this.RegisterGlobalRules(); - this.RegisterFoodDrops(); - this.RegisterWeirdRules(); - this.RegisterTownNPCDrops(); - this.RegisterDD2EventDrops(); - this.RegisterMiscDrops(); - this.RegisterHardmodeFeathers(); - this.RegisterYoyos(); - this.RegisterStatusImmunityItems(); - this.RegisterPirateDrops(); - this.RegisterBloodMoonFishingEnemies(); - this.RegisterMartianDrops(); - this.RegisterBossTrophies(); - this.RegisterBosses(); - this.RegisterHardmodeDungeonDrops(); - this.RegisterMimic(); - this.RegisterEclipse(); - this.RegisterBloodMoonFishing(); - this.TrimDuplicateRulesForNegativeIDs(); - } - - private void RegisterBloodMoonFishing() - { - this.RegisterToMultipleNPCs(ItemDropRule.Common(4608, 2, 4, 6), 587, 586); - this.RegisterToMultipleNPCs(ItemDropRule.Common(4608, 2, 7, 10), 620, 621, 618); - this.RegisterToMultipleNPCs(ItemDropRule.OneFromOptions(8, 4273, 4381, 4325), 587, 586); - this.RegisterToMultipleNPCs(ItemDropRule.Common(3213, 15), 587, 586); - this.RegisterToNPC(620, ItemDropRule.Common(4270, 8)); - this.RegisterToNPC(620, ItemDropRule.Common(4317, 8)); - this.RegisterToNPC(621, ItemDropRule.Common(4272, 8)); - this.RegisterToNPC(621, ItemDropRule.Common(4317, 8)); - this.RegisterToNPC(618, ItemDropRule.Common(4269, 5)); - this.RegisterToNPC(618, ItemDropRule.Common(4054, 10)); - Conditions.IsBloodMoonAndNotFromStatue andNotFromStatue = new Conditions.IsBloodMoonAndNotFromStatue(); - this.RegisterToMultipleNPCs(ItemDropRule.ByCondition((IItemDropRuleCondition) andNotFromStatue, 4271, 200), 587, 586, 489, 490, 109, 621, 620); - this.RegisterToMultipleNPCs(ItemDropRule.ByCondition((IItemDropRuleCondition) andNotFromStatue, 4271, 9), 53, 536, 618); - } - - private void RegisterEclipse() - { - this.RegisterToNPC(461, ItemDropRule.ExpertGetsRerolls(497, 50, 1)); - this.RegisterToMultipleNPCs(ItemDropRule.ExpertGetsRerolls(900, 35, 1), 159, 158); - this.RegisterToNPC(251, ItemDropRule.ExpertGetsRerolls(1311, 15, 1)); - Conditions.DownedAllMechBosses downedAllMechBosses = new Conditions.DownedAllMechBosses(); - Conditions.DownedPlantera downedPlantera = new Conditions.DownedPlantera(); - IItemDropRule npc = this.RegisterToNPC(477, (IItemDropRule) new LeadingConditionRule((IItemDropRuleCondition) downedAllMechBosses)); - IItemDropRule rule = npc.OnSuccess((IItemDropRule) new LeadingConditionRule((IItemDropRuleCondition) downedPlantera)); - npc.OnSuccess(ItemDropRule.ExpertGetsRerolls(1570, 4, 1)); - rule.OnSuccess(ItemDropRule.ExpertGetsRerolls(2770, 20, 1)); - rule.OnSuccess(ItemDropRule.ExpertGetsRerolls(3292, 3, 1)); - this.RegisterToNPC(253, (IItemDropRule) new LeadingConditionRule((IItemDropRuleCondition) downedAllMechBosses)).OnSuccess(ItemDropRule.ExpertGetsRerolls(1327, 40, 1)); - this.RegisterToNPC(460, (IItemDropRule) new LeadingConditionRule((IItemDropRuleCondition) downedPlantera)).OnSuccess(ItemDropRule.ExpertGetsRerolls(3098, 40, 1)); - this.RegisterToNPC(460, ItemDropRule.ExpertGetsRerolls(4740, 50, 1)); - this.RegisterToNPC(460, ItemDropRule.ExpertGetsRerolls(4741, 50, 1)); - this.RegisterToNPC(460, ItemDropRule.ExpertGetsRerolls(4742, 50, 1)); - this.RegisterToNPC(468, (IItemDropRule) new LeadingConditionRule((IItemDropRuleCondition) downedPlantera)).OnSuccess(ItemDropRule.ExpertGetsRerolls(3105, 40, 1)); - this.RegisterToNPC(468, ItemDropRule.ExpertGetsRerolls(4738, 50, 1)); - this.RegisterToNPC(468, ItemDropRule.ExpertGetsRerolls(4739, 50, 1)); - this.RegisterToNPC(466, (IItemDropRule) new LeadingConditionRule((IItemDropRuleCondition) downedPlantera)).OnSuccess(ItemDropRule.ExpertGetsRerolls(3106, 40, 1)); - this.RegisterToNPC(467, (IItemDropRule) new LeadingConditionRule((IItemDropRuleCondition) downedPlantera)).OnSuccess(ItemDropRule.ExpertGetsRerolls(3249, 40, 1)); - IItemDropRule itemDropRule1 = ItemDropRule.Common(3107, 25); - IItemDropRule itemDropRule2 = ItemDropRule.WithRerolls(3107, 1, 25); - itemDropRule1.OnSuccess(ItemDropRule.Common(3108, minimumDropped: 100, maximumDropped: 200), true); - itemDropRule2.OnSuccess(ItemDropRule.Common(3108, minimumDropped: 100, maximumDropped: 200), true); - this.RegisterToNPC(463, (IItemDropRule) new LeadingConditionRule((IItemDropRuleCondition) downedPlantera)).OnSuccess((IItemDropRule) new DropBasedOnExpertMode(itemDropRule1, itemDropRule2)); - } - - private void RegisterMimic() - { - this.RegisterToNPC(85, ItemDropRule.OneFromOptions(1, 437, 517, 535, 536, 532, 554)); - IItemDropRule itemDropRule = ItemDropRule.Common(1312, 20); - itemDropRule.OnFailedRoll(ItemDropRule.OneFromOptions(1, 676, 725, 1264)); - this.RegisterToNPC(629, itemDropRule); - } - - private void RegisterHardmodeDungeonDrops() - { - int[] numArray = new int[12] - { - 269, - 270, - 271, - 272, - 273, - 274, - 275, - 276, - 277, - 278, - 279, - 280 - }; - this.RegisterToNPC(290, ItemDropRule.ExpertGetsRerolls(1513, 15, 1)); - this.RegisterToNPC(290, ItemDropRule.ExpertGetsRerolls(938, 10, 1)); - this.RegisterToNPC(287, ItemDropRule.ExpertGetsRerolls(977, 12, 1)); - this.RegisterToNPC(287, ItemDropRule.ExpertGetsRerolls(963, 12, 1)); - this.RegisterToNPC(291, ItemDropRule.ExpertGetsRerolls(1300, 12, 1)); - this.RegisterToNPC(291, ItemDropRule.ExpertGetsRerolls(1254, 12, 1)); - this.RegisterToNPC(292, ItemDropRule.ExpertGetsRerolls(1514, 12, 1)); - this.RegisterToNPC(292, ItemDropRule.ExpertGetsRerolls(679, 12, 1)); - this.RegisterToNPC(293, ItemDropRule.ExpertGetsRerolls(759, 18, 1)); - this.RegisterToNPC(289, ItemDropRule.ExpertGetsRerolls(4789, 25, 1)); - this.RegisterToMultipleNPCs(ItemDropRule.ExpertGetsRerolls(1446, 20, 1), 281, 282); - this.RegisterToMultipleNPCs(ItemDropRule.ExpertGetsRerolls(1444, 20, 1), 283, 284); - this.RegisterToMultipleNPCs(ItemDropRule.ExpertGetsRerolls(1445, 20, 1), 285, 286); - this.RegisterToMultipleNPCs(ItemDropRule.ExpertGetsRerolls(1183, 400, 1), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.ExpertGetsRerolls(1266, 300, 1), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.ExpertGetsRerolls(671, 200, 1), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.ExpertGetsRerolls(4679, 200, 1), numArray); - this.RegisterToNPC(288, ItemDropRule.Common(1508, maximumDropped: 2)); - } - - private void RegisterBosses() - { - this.RegisterBoss_EOC(); - this.RegisterBoss_BOC(); - this.RegisterBoss_EOW(); - this.RegisterBoss_QueenBee(); - this.RegisterBoss_Skeletron(); - this.RegisterBoss_WOF(); - this.RegisterBoss_AncientCultist(); - this.RegisterBoss_MoonLord(); - this.RegisterBoss_LunarTowers(); - this.RegisterBoss_Betsy(); - this.RegisterBoss_Golem(); - this.RegisterBoss_DukeFishron(); - this.RegisterBoss_SkeletronPrime(); - this.RegisterBoss_TheDestroyer(); - this.RegisterBoss_Twins(); - this.RegisterBoss_Plantera(); - this.RegisterBoss_KingSlime(); - this.RegisterBoss_FrostMoon(); - this.RegisterBoss_PumpkinMoon(); - this.RegisterBoss_HallowBoss(); - this.RegisterBoss_QueenSlime(); - } - - private void RegisterBoss_QueenSlime() - { - short num = 657; - this.RegisterToNPC((int) num, ItemDropRule.BossBag(4957)); - this.RegisterToNPC((int) num, ItemDropRule.MasterModeCommonDrop(4950)); - this.RegisterToNPC((int) num, ItemDropRule.MasterModeDropOnAllPlayers(4960, this._masterModeDropRng)); - LeadingConditionRule rule = new LeadingConditionRule((IItemDropRuleCondition) new Conditions.NotExpert()); - this.RegisterToNPC((int) num, (IItemDropRule) rule); - rule.OnSuccess(ItemDropRule.Common(4986, minimumDropped: 25, maximumDropped: 75)); - rule.OnSuccess(ItemDropRule.Common(4959, 7)); - rule.OnSuccess(ItemDropRule.OneFromOptions(1, 4982, 4983, 4984)); - rule.OnSuccess(ItemDropRule.Common(4981, 4)); - rule.OnSuccess(ItemDropRule.NotScalingWithLuck(4980, 3)); - } - - private void RegisterBoss_HallowBoss() - { - short num = 636; - this.RegisterToNPC((int) num, ItemDropRule.BossBag(4782)); - this.RegisterToNPC((int) num, ItemDropRule.MasterModeCommonDrop(4949)); - this.RegisterToNPC((int) num, ItemDropRule.MasterModeDropOnAllPlayers(4811, this._masterModeDropRng)); - LeadingConditionRule rule = new LeadingConditionRule((IItemDropRuleCondition) new Conditions.NotExpert()); - this.RegisterToNPC((int) num, (IItemDropRule) rule).OnSuccess(ItemDropRule.OneFromOptions(1, 4923, 4952, 4953, 4914)); - rule.OnSuccess(ItemDropRule.Common(4823, 15)); - rule.OnSuccess(ItemDropRule.Common(4778, 4)); - rule.OnSuccess(ItemDropRule.Common(4715, 50)); - rule.OnSuccess(ItemDropRule.Common(4784, 7)); - LeadingConditionRule leadingConditionRule = new LeadingConditionRule((IItemDropRuleCondition) new Conditions.EmpressOfLightIsGenuinelyEnraged()); - this.RegisterToNPC((int) num, (IItemDropRule) leadingConditionRule).OnSuccess(ItemDropRule.Common(5005)); - } - - private void RegisterBoss_PumpkinMoon() - { - Conditions.PumpkinMoonDropGatingChance dropGatingChance = new Conditions.PumpkinMoonDropGatingChance(); - Conditions.IsPumpkinMoon isPumpkinMoon = new Conditions.IsPumpkinMoon(); - Conditions.FromCertainWaveAndAbove certainWaveAndAbove = new Conditions.FromCertainWaveAndAbove(15); - this.RegisterToNPC(327, (IItemDropRule) new LeadingConditionRule((IItemDropRuleCondition) isPumpkinMoon)).OnSuccess((IItemDropRule) new LeadingConditionRule((IItemDropRuleCondition) certainWaveAndAbove)).OnSuccess(ItemDropRule.Common(1856)); - this.RegisterToNPC(325, (IItemDropRule) new LeadingConditionRule((IItemDropRuleCondition) isPumpkinMoon)).OnSuccess((IItemDropRule) new LeadingConditionRule((IItemDropRuleCondition) certainWaveAndAbove)).OnSuccess(ItemDropRule.Common(1855)); - this.RegisterToNPC(315, ItemDropRule.ByCondition((IItemDropRuleCondition) dropGatingChance, 1857, 20)); - int[] numArray = new int[10] - { - 305, - 306, - 307, - 308, - 309, - 310, - 311, - 312, - 313, - 314 - }; - this.RegisterToMultipleNPCs((IItemDropRule) new LeadingConditionRule((IItemDropRuleCondition) dropGatingChance), numArray).OnSuccess(ItemDropRule.OneFromOptions(10, 1788, 1789, 1790)); - IItemDropRule npc1 = this.RegisterToNPC(325, (IItemDropRule) new LeadingConditionRule((IItemDropRuleCondition) dropGatingChance)); - IItemDropRule rule1 = ItemDropRule.Common(1835); - rule1.OnSuccess(ItemDropRule.Common(1836, minimumDropped: 30, maximumDropped: 60), true); - npc1.OnSuccess((IItemDropRule) new OneFromRulesRule(1, new IItemDropRule[5] - { - ItemDropRule.Common(1829), - ItemDropRule.Common(1831), - rule1, - ItemDropRule.Common(1837), - ItemDropRule.Common(1845) - })); - npc1.OnSuccess(ItemDropRule.ByCondition((IItemDropRuleCondition) new Conditions.IsExpert(), 4444, 5)); - npc1.OnSuccess(ItemDropRule.MasterModeCommonDrop(4941)); - npc1.OnSuccess(ItemDropRule.MasterModeDropOnAllPlayers(4793, this._masterModeDropRng)); - IItemDropRule rule2 = ItemDropRule.Common(1782); - rule2.OnSuccess(ItemDropRule.Common(1783, minimumDropped: 50, maximumDropped: 100), true); - IItemDropRule rule3 = ItemDropRule.Common(1784); - rule3.OnSuccess(ItemDropRule.Common(1785, minimumDropped: 25, maximumDropped: 50), true); - IItemDropRule npc2 = this.RegisterToNPC(327, (IItemDropRule) new LeadingConditionRule((IItemDropRuleCondition) dropGatingChance)); - npc2.OnSuccess((IItemDropRule) new OneFromRulesRule(1, new IItemDropRule[8] - { - rule2, - rule3, - ItemDropRule.Common(1811), - ItemDropRule.Common(1826), - ItemDropRule.Common(1801), - ItemDropRule.Common(1802), - ItemDropRule.Common(4680), - ItemDropRule.Common(1798) - })); - npc2.OnSuccess(ItemDropRule.MasterModeCommonDrop(4942)); - npc2.OnSuccess(ItemDropRule.MasterModeDropOnAllPlayers(4812, this._masterModeDropRng)); - this.RegisterToNPC(325, ItemDropRule.ByCondition((IItemDropRuleCondition) isPumpkinMoon, 1729, minimumDropped: 30, maximumDropped: 50)); - this.RegisterToNPC(326, ItemDropRule.ByCondition((IItemDropRuleCondition) isPumpkinMoon, 1729, maximumDropped: 4)); - } - - private void RegisterBoss_FrostMoon() - { - Conditions.FrostMoonDropGatingChance dropGatingChance = new Conditions.FrostMoonDropGatingChance(); - Conditions.FrostMoonDropGateForTrophies dropGateForTrophies = new Conditions.FrostMoonDropGateForTrophies(); - Conditions.FromCertainWaveAndAbove certainWaveAndAbove = new Conditions.FromCertainWaveAndAbove(15); - IItemDropRule npc1 = this.RegisterToNPC(344, (IItemDropRule) new LeadingConditionRule((IItemDropRuleCondition) dropGatingChance)); - npc1.OnSuccess(ItemDropRule.ByCondition((IItemDropRuleCondition) dropGateForTrophies, 1962)); - npc1.OnSuccess(ItemDropRule.Common(1871, 15)).OnFailedRoll(ItemDropRule.OneFromOptions(1, 1916, 1928, 1930)); - npc1.OnSuccess(ItemDropRule.MasterModeCommonDrop(4944)); - npc1.OnSuccess(ItemDropRule.MasterModeDropOnAllPlayers(4813, this._masterModeDropRng)); - IItemDropRule npc2 = this.RegisterToNPC(345, (IItemDropRule) new LeadingConditionRule((IItemDropRuleCondition) dropGatingChance)); - npc2.OnSuccess(ItemDropRule.ByCondition((IItemDropRuleCondition) dropGateForTrophies, 1960)); - npc2.OnSuccess(ItemDropRule.ByCondition((IItemDropRuleCondition) certainWaveAndAbove, 1914, 30)); - npc2.OnSuccess(ItemDropRule.Common(1959, 15)).OnFailedRoll(ItemDropRule.OneFromOptions(1, 1931, 1946, 1947)); - npc2.OnSuccess(ItemDropRule.MasterModeCommonDrop(4943)); - npc2.OnSuccess(ItemDropRule.MasterModeDropOnAllPlayers(4814, this._masterModeDropRng)); - IItemDropRule npc3 = this.RegisterToNPC(346, (IItemDropRule) new LeadingConditionRule((IItemDropRuleCondition) dropGatingChance)); - npc3.OnSuccess(ItemDropRule.ByCondition((IItemDropRuleCondition) dropGateForTrophies, 1961)); - npc3.OnSuccess(ItemDropRule.OneFromOptions(1, 1910, 1929)); - npc3.OnSuccess(ItemDropRule.MasterModeCommonDrop(4945)); - npc3.OnSuccess(ItemDropRule.MasterModeDropOnAllPlayers(4794, this._masterModeDropRng)); - int[] numArray = new int[3]{ 338, 339, 340 }; - this.RegisterToMultipleNPCs(ItemDropRule.OneFromOptions(200, 1943, 1944, 1945), numArray); - this.RegisterToNPC(341, ItemDropRule.ByCondition((IItemDropRuleCondition) new Conditions.IsChristmas(), 1869)); - } - - private void RegisterBoss_KingSlime() - { - short num = 50; - this.RegisterToNPC((int) num, ItemDropRule.BossBag(3318)); - this.RegisterToNPC((int) num, ItemDropRule.MasterModeCommonDrop(4929)); - this.RegisterToNPC((int) num, ItemDropRule.MasterModeDropOnAllPlayers(4797, this._masterModeDropRng)); - LeadingConditionRule rule = new LeadingConditionRule((IItemDropRuleCondition) new Conditions.NotExpert()); - this.RegisterToNPC((int) num, (IItemDropRule) rule); - rule.OnSuccess(ItemDropRule.Common(2430, 4)); - rule.OnSuccess(ItemDropRule.Common(2493, 7)); - rule.OnSuccess(ItemDropRule.OneFromOptions(1, 256, 257, 258)); - rule.OnSuccess(ItemDropRule.NotScalingWithLuck(2585, 3)).OnFailedRoll(ItemDropRule.Common(2610)); - rule.OnSuccess(ItemDropRule.Common(998)); - } - - private void RegisterBoss_Plantera() - { - short num = 262; - this.RegisterToNPC((int) num, ItemDropRule.BossBag(3328)); - this.RegisterToNPC((int) num, ItemDropRule.MasterModeCommonDrop(4934)); - this.RegisterToNPC((int) num, ItemDropRule.MasterModeDropOnAllPlayers(4806, this._masterModeDropRng)); - LeadingConditionRule rule1 = new LeadingConditionRule((IItemDropRuleCondition) new Conditions.NotExpert()); - this.RegisterToNPC((int) num, (IItemDropRule) rule1); - LeadingConditionRule rule2 = new LeadingConditionRule((IItemDropRuleCondition) new Conditions.FirstTimeKillingPlantera()); - rule1.OnSuccess((IItemDropRule) rule2); - rule1.OnSuccess(ItemDropRule.Common(2109, 7)); - rule1.OnSuccess(ItemDropRule.Common(1141)); - rule1.OnSuccess(ItemDropRule.Common(1182, 20)); - rule1.OnSuccess(ItemDropRule.Common(1305, 50)); - rule1.OnSuccess(ItemDropRule.Common(1157, 4)); - rule1.OnSuccess(ItemDropRule.Common(3021, 10)); - IItemDropRule itemDropRule = ItemDropRule.Common(758); - itemDropRule.OnSuccess(ItemDropRule.Common(771, minimumDropped: 50, maximumDropped: 150), true); - rule2.OnSuccess(itemDropRule, true); - rule2.OnFailedConditions((IItemDropRule) new OneFromRulesRule(1, new IItemDropRule[7] - { - itemDropRule, - ItemDropRule.Common(1255), - ItemDropRule.Common(788), - ItemDropRule.Common(1178), - ItemDropRule.Common(1259), - ItemDropRule.Common(1155), - ItemDropRule.Common(3018) - })); - } - - private void RegisterBoss_SkeletronPrime() - { - Conditions.NotExpert notExpert = new Conditions.NotExpert(); - short maxValue = (short) sbyte.MaxValue; - this.RegisterToNPC((int) maxValue, ItemDropRule.BossBag(3327)); - this.RegisterToNPC((int) maxValue, ItemDropRule.MasterModeCommonDrop(4933)); - this.RegisterToNPC((int) maxValue, ItemDropRule.MasterModeDropOnAllPlayers(4805, this._masterModeDropRng)); - this.RegisterToNPC((int) maxValue, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 2107, 7)); - this.RegisterToNPC((int) maxValue, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 1225, minimumDropped: 15, maximumDropped: 30)); - this.RegisterToNPC((int) maxValue, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 547, minimumDropped: 25, maximumDropped: 40)); - } - - private void RegisterBoss_TheDestroyer() - { - Conditions.NotExpert notExpert = new Conditions.NotExpert(); - short num = 134; - this.RegisterToNPC((int) num, ItemDropRule.BossBag(3325)); - this.RegisterToNPC((int) num, ItemDropRule.MasterModeCommonDrop(4932)); - this.RegisterToNPC((int) num, ItemDropRule.MasterModeDropOnAllPlayers(4803, this._masterModeDropRng)); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 2113, 7)); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 1225, minimumDropped: 15, maximumDropped: 30)); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 548, minimumDropped: 25, maximumDropped: 40)); - } - - private void RegisterBoss_Twins() - { - LeadingConditionRule rule1 = new LeadingConditionRule((IItemDropRuleCondition) new Conditions.MissingTwin()); - LeadingConditionRule rule2 = new LeadingConditionRule((IItemDropRuleCondition) new Conditions.NotExpert()); - rule1.OnSuccess(ItemDropRule.BossBag(3326)); - rule1.OnSuccess((IItemDropRule) rule2); - rule2.OnSuccess(ItemDropRule.Common(2106, 7)); - rule2.OnSuccess(ItemDropRule.Common(1225, minimumDropped: 15, maximumDropped: 30)); - rule2.OnSuccess(ItemDropRule.Common(549, minimumDropped: 25, maximumDropped: 40)); - rule1.OnSuccess(ItemDropRule.MasterModeCommonDrop(4931)); - rule1.OnSuccess(ItemDropRule.MasterModeDropOnAllPlayers(4804, this._masterModeDropRng)); - this.RegisterToMultipleNPCs((IItemDropRule) rule1, 126, 125); - } - - private void RegisterBoss_EOC() - { - Conditions.NotExpert notExpert = new Conditions.NotExpert(); - Conditions.IsCrimsonAndNotExpert crimsonAndNotExpert = new Conditions.IsCrimsonAndNotExpert(); - Conditions.IsCorruptionAndNotExpert corruptionAndNotExpert = new Conditions.IsCorruptionAndNotExpert(); - short num = 4; - this.RegisterToNPC((int) num, ItemDropRule.BossBag(3319)); - this.RegisterToNPC((int) num, ItemDropRule.MasterModeCommonDrop(4924)); - this.RegisterToNPC((int) num, ItemDropRule.MasterModeCommonDrop(3763)); - this.RegisterToNPC((int) num, ItemDropRule.MasterModeDropOnAllPlayers(4798, this._masterModeDropRng)); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 2112, 7)); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 1299, 40)); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) crimsonAndNotExpert, 880, minimumDropped: 30, maximumDropped: 90)); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) crimsonAndNotExpert, 2171, maximumDropped: 3)); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) corruptionAndNotExpert, 47, minimumDropped: 20, maximumDropped: 50)); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) corruptionAndNotExpert, 56, minimumDropped: 30, maximumDropped: 90)); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) corruptionAndNotExpert, 59, maximumDropped: 3)); - } - - private void RegisterBoss_BOC() - { - Conditions.NotExpert notExpert = new Conditions.NotExpert(); - short num1 = 266; - this.RegisterToNPC((int) num1, ItemDropRule.BossBag(3321)); - this.RegisterToNPC((int) num1, ItemDropRule.MasterModeCommonDrop(4926)); - this.RegisterToNPC((int) num1, ItemDropRule.MasterModeDropOnAllPlayers(4800, this._masterModeDropRng)); - this.RegisterToNPC((int) num1, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 880, minimumDropped: 40, maximumDropped: 90)); - this.RegisterToNPC((int) num1, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 2104, 7)); - this.RegisterToNPC((int) num1, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 3060, 20)); - short num2 = 267; - this.RegisterToNPC((int) num2, (IItemDropRule) new DropBasedOnExpertMode((IItemDropRule) new CommonDrop(1329, 3, 2, 5, 2), (IItemDropRule) new CommonDrop(1329, 3, 4, 10, 2))); - this.RegisterToNPC((int) num2, (IItemDropRule) new DropBasedOnExpertMode((IItemDropRule) new CommonDrop(880, 3, 5, 12, 2), (IItemDropRule) new CommonDrop(880, 3, 11, 25, 2))); - } - - private void RegisterBoss_EOW() - { - Conditions.LegacyHack_IsBossAndExpert hackIsBossAndExpert = new Conditions.LegacyHack_IsBossAndExpert(); - Conditions.LegacyHack_IsBossAndNotExpert bossAndNotExpert = new Conditions.LegacyHack_IsBossAndNotExpert(); - int[] numArray = new int[3]{ 13, 14, 15 }; - this.RegisterToMultipleNPCs((IItemDropRule) new DropBasedOnExpertMode(ItemDropRule.Common(86, 2, maximumDropped: 2), ItemDropRule.Common(86, 2, 2, 3)), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(56, 2, 2, 5), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.BossBagByCondition((IItemDropRuleCondition) hackIsBossAndExpert, 3320), numArray); - IItemDropRule multipleNpCs = this.RegisterToMultipleNPCs((IItemDropRule) new LeadingConditionRule((IItemDropRuleCondition) new Conditions.LegacyHack_IsABoss()), numArray); - multipleNpCs.OnSuccess(ItemDropRule.MasterModeCommonDrop(4925)); - multipleNpCs.OnSuccess(ItemDropRule.MasterModeDropOnAllPlayers(4799, this._masterModeDropRng)); - this.RegisterToMultipleNPCs(ItemDropRule.ByCondition((IItemDropRuleCondition) bossAndNotExpert, 56, minimumDropped: 20, maximumDropped: 60), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.ByCondition((IItemDropRuleCondition) bossAndNotExpert, 994, 20), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.ByCondition((IItemDropRuleCondition) bossAndNotExpert, 2111, 7), numArray); - } - - private void RegisterBoss_QueenBee() - { - Conditions.NotExpert notExpert = new Conditions.NotExpert(); - short num = 222; - this.RegisterToNPC((int) num, ItemDropRule.BossBag(3322)); - this.RegisterToNPC((int) num, ItemDropRule.MasterModeCommonDrop(4928)); - this.RegisterToNPC((int) num, ItemDropRule.MasterModeDropOnAllPlayers(4802, this._masterModeDropRng)); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 2108, 7)); - this.RegisterToNPC((int) num, (IItemDropRule) new DropBasedOnExpertMode(ItemDropRule.OneFromOptionsNotScalingWithLuck(1, 1121, 1123, 2888), ItemDropRule.DropNothing())); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 1132, 3)); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 1170, 15)); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 2502, 20)); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 1129, 3)).OnFailedRoll(ItemDropRule.OneFromOptionsNotScalingWithLuck(2, 842, 843, 844)); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 1130, 4, 10, 30, 3)); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 2431, minimumDropped: 16, maximumDropped: 26)); - } - - private void RegisterBoss_Skeletron() - { - Conditions.NotExpert notExpert = new Conditions.NotExpert(); - short num = 35; - this.RegisterToNPC((int) num, ItemDropRule.BossBag(3323)); - this.RegisterToNPC((int) num, ItemDropRule.MasterModeCommonDrop(4927)); - this.RegisterToNPC((int) num, ItemDropRule.MasterModeDropOnAllPlayers(4801, this._masterModeDropRng)); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 1281, 7)).OnFailedRoll(ItemDropRule.Common(1273, 7)).OnFailedRoll(ItemDropRule.Common(1313, 7)); - this.RegisterToNPC((int) num, ItemDropRule.Common(4993, 7)); - } - - private void RegisterBoss_WOF() - { - Conditions.NotExpert notExpert = new Conditions.NotExpert(); - short num = 113; - this.RegisterToNPC((int) num, ItemDropRule.BossBag(3324)); - this.RegisterToNPC((int) num, ItemDropRule.MasterModeCommonDrop(4930)); - this.RegisterToNPC((int) num, ItemDropRule.MasterModeDropOnAllPlayers(4795, this._masterModeDropRng)); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 2105, 7)); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 367)); - this.RegisterToNPC((int) num, (IItemDropRule) new LeadingConditionRule((IItemDropRuleCondition) notExpert)).OnSuccess((IItemDropRule) new OneFromRulesRule(1, new IItemDropRule[2] - { - ItemDropRule.OneFromOptionsNotScalingWithLuck(1, 490, 491, 489, 2998), - ItemDropRule.OneFromOptionsNotScalingWithLuck(1, 426, 434, 514, 4912) - })); - } - - private void RegisterBoss_AncientCultist() - { - short num = 439; - this.RegisterToNPC((int) num, ItemDropRule.MasterModeCommonDrop(4937)); - this.RegisterToNPC((int) num, ItemDropRule.MasterModeDropOnAllPlayers(4809, this._masterModeDropRng)); - this.RegisterToNPC((int) num, ItemDropRule.Common(3372, 7)); - this.RegisterToNPC((int) num, ItemDropRule.Common(3549)); - } - - private void RegisterBoss_MoonLord() - { - Conditions.NotExpert notExpert = new Conditions.NotExpert(); - short num = 398; - this.RegisterToNPC((int) num, ItemDropRule.BossBag(3332)); - this.RegisterToNPC((int) num, ItemDropRule.MasterModeCommonDrop(4938)); - this.RegisterToNPC((int) num, ItemDropRule.MasterModeDropOnAllPlayers(4810, this._masterModeDropRng)); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 3373, 7)); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 4469, 10)); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 3384)); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 3460, minimumDropped: 70, maximumDropped: 90)); - this.RegisterToNPC((int) num, (IItemDropRule) new LeadingConditionRule((IItemDropRuleCondition) notExpert)).OnSuccess(ItemDropRule.OneFromOptionsNotScalingWithLuck(1, 3063, 3389, 3065, 1553, 3930, 3541, 3570, 3571, 3569)); - } - - private void RegisterBoss_LunarTowers() - { - DropOneByOne.Parameters parameters1 = new DropOneByOne.Parameters() - { - MinimumItemDropsCount = 12, - MaximumItemDropsCount = 20, - DropsXOutOfYTimes_TheX = 1, - DropsXOutOfYTimes_TheY = 1, - MinimumStackPerChunkBase = 1, - MaximumStackPerChunkBase = 3, - BonusMinDropsPerChunkPerPlayer = 0, - BonusMaxDropsPerChunkPerPlayer = 0 - }; - DropOneByOne.Parameters parameters2 = parameters1; - parameters2.BonusMinDropsPerChunkPerPlayer = 1; - parameters2.BonusMaxDropsPerChunkPerPlayer = 1; - parameters2.MinimumStackPerChunkBase = (int) ((double) parameters1.MinimumStackPerChunkBase * 1.5); - parameters2.MaximumStackPerChunkBase = (int) ((double) parameters1.MaximumStackPerChunkBase * 1.5); - this.RegisterToNPC(517, (IItemDropRule) new DropBasedOnExpertMode((IItemDropRule) new DropOneByOne(3458, parameters1), (IItemDropRule) new DropOneByOne(3458, parameters2))); - this.RegisterToNPC(422, (IItemDropRule) new DropBasedOnExpertMode((IItemDropRule) new DropOneByOne(3456, parameters1), (IItemDropRule) new DropOneByOne(3456, parameters2))); - this.RegisterToNPC(507, (IItemDropRule) new DropBasedOnExpertMode((IItemDropRule) new DropOneByOne(3457, parameters1), (IItemDropRule) new DropOneByOne(3457, parameters2))); - this.RegisterToNPC(493, (IItemDropRule) new DropBasedOnExpertMode((IItemDropRule) new DropOneByOne(3459, parameters1), (IItemDropRule) new DropOneByOne(3459, parameters2))); - } - - private void RegisterBoss_Betsy() - { - Conditions.NotExpert notExpert = new Conditions.NotExpert(); - short num = 551; - this.RegisterToNPC((int) num, ItemDropRule.BossBag(3860)); - this.RegisterToNPC((int) num, ItemDropRule.MasterModeCommonDrop(4948)); - this.RegisterToNPC((int) num, ItemDropRule.MasterModeDropOnAllPlayers(4817, this._masterModeDropRng)); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 3863, 7)); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 3883, 4)); - this.RegisterToNPC((int) num, (IItemDropRule) new LeadingConditionRule((IItemDropRuleCondition) notExpert)).OnSuccess(ItemDropRule.OneFromOptionsNotScalingWithLuck(1, 3827, 3859, 3870, 3858)); - } - - private void RegisterBoss_Golem() - { - Conditions.NotExpert notExpert = new Conditions.NotExpert(); - short num = 245; - this.RegisterToNPC((int) num, ItemDropRule.BossBag(3329)); - this.RegisterToNPC((int) num, ItemDropRule.MasterModeCommonDrop(4935)); - this.RegisterToNPC((int) num, ItemDropRule.MasterModeDropOnAllPlayers(4807, this._masterModeDropRng)); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 2110, 7)); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 1294, 4)); - IItemDropRule rule = ItemDropRule.Common(1258); - rule.OnSuccess(ItemDropRule.Common(1261, minimumDropped: 60, maximumDropped: 180), true); - this.RegisterToNPC((int) num, (IItemDropRule) new LeadingConditionRule((IItemDropRuleCondition) notExpert)).OnSuccess((IItemDropRule) new OneFromRulesRule(1, new IItemDropRule[7] - { - rule, - ItemDropRule.Common(1122), - ItemDropRule.Common(899), - ItemDropRule.Common(1248), - ItemDropRule.Common(1295), - ItemDropRule.Common(1296), - ItemDropRule.Common(1297) - })); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 2218, minimumDropped: 4, maximumDropped: 8)); - } - - private void RegisterBoss_DukeFishron() - { - Conditions.NotExpert notExpert = new Conditions.NotExpert(); - short num = 370; - this.RegisterToNPC((int) num, ItemDropRule.BossBag(3330)); - this.RegisterToNPC((int) num, ItemDropRule.MasterModeCommonDrop(4936)); - this.RegisterToNPC((int) num, ItemDropRule.MasterModeDropOnAllPlayers(4808, this._masterModeDropRng)); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 2588, 7)); - this.RegisterToNPC((int) num, ItemDropRule.ByCondition((IItemDropRuleCondition) notExpert, 2609, 15)); - this.RegisterToNPC((int) num, (IItemDropRule) new LeadingConditionRule((IItemDropRuleCondition) notExpert)).OnSuccess(ItemDropRule.OneFromOptions(1, 2611, 2624, 2622, 2621, 2623)); - } - - private void RegisterWeirdRules() => this.RegisterToMultipleNPCs(ItemDropRule.NormalvsExpert(3260, 40, 30), 86); - - private void RegisterGlobalRules() - { - this.RegisterToGlobal((IItemDropRule) new MechBossSpawnersDropRule()); - this.RegisterToGlobal((IItemDropRule) new SlimeBodyItemDropRule()); - this.RegisterToGlobal(ItemDropRule.ByCondition((IItemDropRuleCondition) new Conditions.HalloweenWeapons(), 1825, 2000)).OnFailedRoll(ItemDropRule.Common(1827, 2000)); - this.RegisterToGlobal((IItemDropRule) new ItemDropWithConditionRule(1533, 2500, 1, 1, (IItemDropRuleCondition) new Conditions.JungleKeyCondition())); - this.RegisterToGlobal((IItemDropRule) new ItemDropWithConditionRule(1534, 2500, 1, 1, (IItemDropRuleCondition) new Conditions.CorruptKeyCondition())); - this.RegisterToGlobal((IItemDropRule) new ItemDropWithConditionRule(1535, 2500, 1, 1, (IItemDropRuleCondition) new Conditions.CrimsonKeyCondition())); - this.RegisterToGlobal((IItemDropRule) new ItemDropWithConditionRule(1536, 2500, 1, 1, (IItemDropRuleCondition) new Conditions.HallowKeyCondition())); - this.RegisterToGlobal((IItemDropRule) new ItemDropWithConditionRule(1537, 2500, 1, 1, (IItemDropRuleCondition) new Conditions.FrozenKeyCondition())); - this.RegisterToGlobal((IItemDropRule) new ItemDropWithConditionRule(4714, 2500, 1, 1, (IItemDropRuleCondition) new Conditions.DesertKeyCondition())); - this.RegisterToGlobal((IItemDropRule) new ItemDropWithConditionRule(1774, 80, 1, 1, (IItemDropRuleCondition) new Conditions.HalloweenGoodieBagDrop())); - this.RegisterToGlobal((IItemDropRule) new ItemDropWithConditionRule(1869, 13, 1, 1, (IItemDropRuleCondition) new Conditions.XmasPresentDrop())); - this.RegisterToGlobal((IItemDropRule) new ItemDropWithConditionRule(2701, 50, 20, 50, (IItemDropRuleCondition) new Conditions.LivingFlames())); - this.RegisterToGlobal((IItemDropRule) new ItemDropWithConditionRule(1314, 1000, 1, 1, (IItemDropRuleCondition) new Conditions.KOCannon())); - this.RegisterToGlobal((IItemDropRule) new ItemDropWithConditionRule(520, 5, 1, 1, (IItemDropRuleCondition) new Conditions.SoulOfLight())); - this.RegisterToGlobal((IItemDropRule) new ItemDropWithConditionRule(521, 5, 1, 1, (IItemDropRuleCondition) new Conditions.SoulOfNight())); - this.RegisterToGlobal(ItemDropRule.ByCondition((IItemDropRuleCondition) new Conditions.PirateMap(), 1315, 100)); - } - - private void RegisterFoodDrops() - { - this.RegisterToNPC(48, ItemDropRule.Food(4016, 50)); - this.RegisterToNPC(224, ItemDropRule.Food(4021, 50)); - this.RegisterToNPC(44, ItemDropRule.Food(4037, 10)); - this.RegisterToNPC(469, ItemDropRule.Food(4037, 100)); - this.RegisterToMultipleNPCs(ItemDropRule.Food(4020, 30), 163, 238, 164, 165, 530, 531); - this.RegisterToMultipleNPCs(ItemDropRule.Food(4029, 50), 480, 481); - this.RegisterToMultipleNPCs(ItemDropRule.Food(4030, 75), 498, 499, 500, 501, 502, 503, 504, 505, 506, 496, 497, 494, 495); - this.RegisterToMultipleNPCs(ItemDropRule.Food(4036, 50), 482, 483); - this.RegisterToMultipleNPCs(ItemDropRule.Food(4015, 100), 6, 173); - this.RegisterToMultipleNPCs(ItemDropRule.Food(4026, 150), 150, 147, 184); - this.RegisterToMultipleNPCs(ItemDropRule.Food(4027, 75), 154, 206); - this.RegisterToMultipleNPCs(ItemDropRule.Food(3532, 15), 170, 180, 171); - this.RegisterToNPC(289, ItemDropRule.Food(4018, 35)); - this.RegisterToNPC(34, ItemDropRule.Food(4018, 70)); - this.RegisterToMultipleNPCs(ItemDropRule.Food(4013, 21), 293, 291, 292); - this.RegisterToMultipleNPCs(ItemDropRule.Food(5042, 30), 43, 175, 56); - this.RegisterToNPC(287, ItemDropRule.Food(5042, 10)); - this.RegisterToMultipleNPCs(ItemDropRule.Food(5041, 150), 21, 201, 202, 203, 322, 323, 324, 635, 449, 450, 451, 452); - this.RegisterToNPC(290, ItemDropRule.Food(4013, 7)); - this.RegisterToMultipleNPCs(ItemDropRule.Food(4025, 30), 39, 156); - this.RegisterToMultipleNPCs(ItemDropRule.Food(4023, 40), 177, 152); - this.RegisterToMultipleNPCs(ItemDropRule.Food(4012, 50), 581, 509, 580, 508, 69); - this.RegisterToMultipleNPCs(ItemDropRule.Food(4028, 30), 546, 542, 544, 543, 545); - this.RegisterToMultipleNPCs(ItemDropRule.Food(4035, 50), 67, 65); - this.RegisterToMultipleNPCs(ItemDropRule.Food(4011, 150), 120, 137, 138); - this.RegisterToNPC(122, ItemDropRule.Food(4017, 75)); - } - - private void RegisterTownNPCDrops() - { - this.RegisterToNPC(22, (IItemDropRule) new ItemDropWithConditionRule(867, 1, 1, 1, (IItemDropRuleCondition) new Conditions.NamedNPC("Andrew"))); - this.RegisterToNPC(178, (IItemDropRule) new ItemDropWithConditionRule(4372, 1, 1, 1, (IItemDropRuleCondition) new Conditions.NamedNPC("Whitney"))); - this.RegisterToNPC(353, ItemDropRule.Common(3352, 8)); - this.RegisterToNPC(441, ItemDropRule.Common(3351, 8)); - this.RegisterToNPC(227, ItemDropRule.Common(3350, 10)); - this.RegisterToNPC(550, ItemDropRule.Common(3821, 6)); - this.RegisterToNPC(208, ItemDropRule.Common(3548, 4, 30, 60)); - this.RegisterToNPC(207, ItemDropRule.Common(3349, 8)); - this.RegisterToNPC(124, ItemDropRule.Common(4818, 8)); - this.RegisterToNPC(54, ItemDropRule.Common(260)); - this.RegisterToNPC(368, ItemDropRule.Common(2222)); - } - - private void RegisterDD2EventDrops() - { - this.RegisterToNPC(576, (IItemDropRule) new CommonDropNotScalingWithLuck(3865, 7, 1, 1)); - this.RegisterToNPC(576, ItemDropRule.NormalvsExpertOneFromOptionsNotScalingWithLuck(3, 2, 3809, 3811, 3810, 3812)); - this.RegisterToNPC(576, ItemDropRule.NormalvsExpertOneFromOptionsNotScalingWithLuck(3, 2, 3852, 3854, 3823, 3835, 3836)); - this.RegisterToNPC(576, ItemDropRule.NormalvsExpertNotScalingWithLuck(3856, 5, 4)); - this.RegisterToNPC(577, (IItemDropRule) new CommonDropNotScalingWithLuck(3865, 14, 1, 1)); - this.RegisterToNPC(577, ItemDropRule.MasterModeCommonDrop(4947)); - this.RegisterToNPC(577, ItemDropRule.MasterModeDropOnAllPlayers(4816, this._masterModeDropRng)); - this.RegisterToNPC(577, ItemDropRule.OneFromOptionsNotScalingWithLuck(6, 3809, 3811, 3810, 3812)); - this.RegisterToNPC(577, ItemDropRule.OneFromOptionsNotScalingWithLuck(6, 3852, 3854, 3823, 3835, 3836)); - this.RegisterToNPC(577, ItemDropRule.Common(3856, 10)); - this.RegisterToNPC(564, ItemDropRule.Common(3864, 7)); - this.RegisterToNPC(564, ItemDropRule.MasterModeDropOnAllPlayers(4796, this._masterModeDropRng)); - this.RegisterToNPC(564, (IItemDropRule) new OneFromRulesRule(5, new IItemDropRule[2] - { - ItemDropRule.NotScalingWithLuck(3814), - ItemDropRule.NotScalingWithLuck(3815, minimumDropped: 4, maximumDropped: 4) - })); - this.RegisterToNPC(564, ItemDropRule.NormalvsExpertOneFromOptionsNotScalingWithLuck(3, 2, 3857, 3855)); - this.RegisterToNPC(565, ItemDropRule.Common(3864, 14)); - this.RegisterToNPC(565, ItemDropRule.MasterModeCommonDrop(4946)); - this.RegisterToNPC(565, ItemDropRule.MasterModeDropOnAllPlayers(4796, this._masterModeDropRng)); - this.RegisterToNPC(565, (IItemDropRule) new OneFromRulesRule(10, new IItemDropRule[2] - { - ItemDropRule.NotScalingWithLuck(3814), - ItemDropRule.NotScalingWithLuck(3815, minimumDropped: 4, maximumDropped: 4) - })); - this.RegisterToNPC(565, ItemDropRule.OneFromOptionsNotScalingWithLuck(6, 3857, 3855)); - } - - private void RegisterHardmodeFeathers() - { - this.RegisterToNPC(156, ItemDropRule.Common(1518, 75)); - this.RegisterToNPC(243, ItemDropRule.Common(1519, 3)); - this.RegisterToMultipleNPCs(ItemDropRule.Common(1517, 450), 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280); - this.RegisterToMultipleNPCs(ItemDropRule.Common(1520, 40), 159, 158); - this.RegisterToNPC(48, ItemDropRule.Common(1516, 200)); - this.RegisterToNPC(176, (IItemDropRule) new ItemDropWithConditionRule(1521, 150, 1, 1, (IItemDropRuleCondition) new Conditions.BeatAnyMechBoss())); - this.RegisterToNPC(205, (IItemDropRule) new ItemDropWithConditionRule(1611, 2, 1, 1, (IItemDropRuleCondition) new Conditions.BeatAnyMechBoss())); - } - - private void RegisterYoyos() - { - this.RegisterToGlobal((IItemDropRule) new ItemDropWithConditionRule(3282, 400, 1, 1, (IItemDropRuleCondition) new Conditions.YoyoCascade())); - this.RegisterToGlobal((IItemDropRule) new ItemDropWithConditionRule(3289, 300, 1, 1, (IItemDropRuleCondition) new Conditions.YoyosAmarok())); - this.RegisterToGlobal((IItemDropRule) new ItemDropWithConditionRule(3286, 200, 1, 1, (IItemDropRuleCondition) new Conditions.YoyosYelets())); - this.RegisterToGlobal((IItemDropRule) new ItemDropWithConditionRule(3291, 400, 1, 1, (IItemDropRuleCondition) new Conditions.YoyosKraken())); - this.RegisterToGlobal((IItemDropRule) new ItemDropWithConditionRule(3290, 400, 1, 1, (IItemDropRuleCondition) new Conditions.YoyosHelFire())); - } - - private void RegisterStatusImmunityItems() - { - this.RegisterToMultipleNPCs(ItemDropRule.StatusImmunityItem(3781, 100), 480); - this.RegisterToMultipleNPCs(ItemDropRule.StatusImmunityItem(885, 100), 104, 102, 269, 270, 271, 272); - this.RegisterToMultipleNPCs(ItemDropRule.StatusImmunityItem(886, 100), 77, 273, 274, 275, 276); - this.RegisterToMultipleNPCs(ItemDropRule.StatusImmunityItem(887, 100), 141, 176, 42, 231, 232, 233, 234, 235); - this.RegisterToMultipleNPCs(ItemDropRule.StatusImmunityItem(888, 100), 81, 79, 183, 630); - this.RegisterToMultipleNPCs(ItemDropRule.StatusImmunityItem(889, 100), 78, 82, 75); - this.RegisterToMultipleNPCs(ItemDropRule.StatusImmunityItem(890, 100), 103, 75, 79, 630); - this.RegisterToMultipleNPCs(ItemDropRule.StatusImmunityItem(891, 100), 34, 83, 84, 179, 289); - this.RegisterToMultipleNPCs(ItemDropRule.StatusImmunityItem(892, 100), 94, 182); - this.RegisterToMultipleNPCs(ItemDropRule.StatusImmunityItem(893, 100), 93, 109, 80); - } - - private void RegisterPirateDrops() - { - int[] numArray = new int[4]{ 212, 213, 214, 215 }; - this.RegisterToMultipleNPCs(ItemDropRule.Common(905, 8000), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(855, 4000), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(854, 2000), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(2584, 2000), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(3033, 1000), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(672, 200), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(1277, 500), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(1278, 500), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(1279, 500), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(1280, 500), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(1704, 300), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(1705, 300), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(1710, 300), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(1716, 300), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(1720, 300), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(2379, 300), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(2389, 300), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(2405, 300), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(2843, 300), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(3885, 300), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(2663, 300), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(3904, 150, 30, 50), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(3910, 300), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(2238, 300), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(2133, 300), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(2137, 300), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(2143, 300), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(2147, 300), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(2151, 300), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(2155, 300), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(3263, 500), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(3264, 500), numArray); - this.RegisterToMultipleNPCs(ItemDropRule.Common(3265, 500), numArray); - this.RegisterToNPC(216, ItemDropRule.Common(905, 2000)); - this.RegisterToNPC(216, ItemDropRule.Common(855, 1000)); - this.RegisterToNPC(216, ItemDropRule.Common(854, 500)); - this.RegisterToNPC(216, ItemDropRule.Common(2584, 500)); - this.RegisterToNPC(216, ItemDropRule.Common(3033, 250)); - this.RegisterToNPC(216, ItemDropRule.Common(672, 50)); - this.RegisterToNPC(491, ItemDropRule.Common(905, 400)); - this.RegisterToNPC(491, ItemDropRule.Common(855, 200)); - this.RegisterToNPC(491, ItemDropRule.Common(854, 100)); - this.RegisterToNPC(491, ItemDropRule.Common(2584, 100)); - this.RegisterToNPC(491, ItemDropRule.Common(3033, 50)); - this.RegisterToNPC(491, ItemDropRule.Common(4471, 20)); - this.RegisterToNPC(491, ItemDropRule.Common(672, 10)); - this.RegisterToNPC(491, ItemDropRule.MasterModeCommonDrop(4940)); - this.RegisterToNPC(491, ItemDropRule.MasterModeDropOnAllPlayers(4792, this._masterModeDropRng)); - } - - private void RegisterBloodMoonFishingEnemies() - { - } - - private void RegisterBossTrophies() - { - Conditions.LegacyHack_IsABoss legacyHackIsAboss = new Conditions.LegacyHack_IsABoss(); - this.RegisterToNPC(4, ItemDropRule.ByCondition((IItemDropRuleCondition) legacyHackIsAboss, 1360, 10)); - this.RegisterToNPC(13, ItemDropRule.ByCondition((IItemDropRuleCondition) legacyHackIsAboss, 1361, 10)); - this.RegisterToNPC(14, ItemDropRule.ByCondition((IItemDropRuleCondition) legacyHackIsAboss, 1361, 10)); - this.RegisterToNPC(15, ItemDropRule.ByCondition((IItemDropRuleCondition) legacyHackIsAboss, 1361, 10)); - this.RegisterToNPC(266, ItemDropRule.ByCondition((IItemDropRuleCondition) legacyHackIsAboss, 1362, 10)); - this.RegisterToNPC(35, ItemDropRule.ByCondition((IItemDropRuleCondition) legacyHackIsAboss, 1363, 10)); - this.RegisterToNPC(222, ItemDropRule.ByCondition((IItemDropRuleCondition) legacyHackIsAboss, 1364, 10)); - this.RegisterToNPC(113, ItemDropRule.ByCondition((IItemDropRuleCondition) legacyHackIsAboss, 1365, 10)); - this.RegisterToNPC(134, ItemDropRule.ByCondition((IItemDropRuleCondition) legacyHackIsAboss, 1366, 10)); - this.RegisterToNPC((int) sbyte.MaxValue, ItemDropRule.ByCondition((IItemDropRuleCondition) legacyHackIsAboss, 1367, 10)); - this.RegisterToNPC(262, ItemDropRule.ByCondition((IItemDropRuleCondition) legacyHackIsAboss, 1370, 10)); - this.RegisterToNPC(245, ItemDropRule.ByCondition((IItemDropRuleCondition) legacyHackIsAboss, 1371, 10)); - this.RegisterToNPC(50, ItemDropRule.ByCondition((IItemDropRuleCondition) legacyHackIsAboss, 2489, 10)); - this.RegisterToNPC(370, ItemDropRule.ByCondition((IItemDropRuleCondition) legacyHackIsAboss, 2589, 10)); - this.RegisterToNPC(439, ItemDropRule.ByCondition((IItemDropRuleCondition) legacyHackIsAboss, 3357, 10)); - this.RegisterToNPC(395, ItemDropRule.ByCondition((IItemDropRuleCondition) legacyHackIsAboss, 3358, 10)); - this.RegisterToNPC(398, ItemDropRule.ByCondition((IItemDropRuleCondition) legacyHackIsAboss, 3595, 10)); - this.RegisterToNPC(636, ItemDropRule.ByCondition((IItemDropRuleCondition) legacyHackIsAboss, 4783, 10)); - this.RegisterToNPC(657, ItemDropRule.ByCondition((IItemDropRuleCondition) legacyHackIsAboss, 4958, 10)); - this.RegisterToNPC(125, ItemDropRule.Common(1368, 10)); - this.RegisterToNPC(126, ItemDropRule.Common(1369, 10)); - this.RegisterToNPC(491, ItemDropRule.Common(3359, 10)); - this.RegisterToNPC(551, ItemDropRule.Common(3866, 10)); - this.RegisterToNPC(564, ItemDropRule.Common(3867, 10)); - this.RegisterToNPC(565, ItemDropRule.Common(3867, 10)); - this.RegisterToNPC(576, ItemDropRule.Common(3868, 10)); - this.RegisterToNPC(577, ItemDropRule.Common(3868, 10)); - } - - private void RegisterMartianDrops() - { - this.RegisterToMultipleNPCs(ItemDropRule.Common(2860, 8, 8, 20), 520, 383, 389, 385, 382, 381, 390, 386); - int[] numArray1 = new int[8] - { - 520, - 383, - 389, - 385, - 382, - 381, - 390, - 386 - }; - this.RegisterToMultipleNPCs(ItemDropRule.Common(2798, 800), numArray1); - this.RegisterToMultipleNPCs(ItemDropRule.Common(2800, 800), numArray1); - this.RegisterToMultipleNPCs(ItemDropRule.Common(2882, 800), numArray1); - int[] numArray2 = new int[3]{ 383, 389, 386 }; - this.RegisterToMultipleNPCs(ItemDropRule.Common(2806, 200), numArray2); - this.RegisterToMultipleNPCs(ItemDropRule.Common(2807, 200), numArray2); - this.RegisterToMultipleNPCs(ItemDropRule.Common(2808, 200), numArray2); - int[] numArray3 = new int[4]{ 385, 382, 381, 390 }; - this.RegisterToMultipleNPCs(ItemDropRule.Common(2803, 200), numArray3); - this.RegisterToMultipleNPCs(ItemDropRule.Common(2804, 200), numArray3); - this.RegisterToMultipleNPCs(ItemDropRule.Common(2805, 200), numArray3); - this.RegisterToNPC(395, ItemDropRule.OneFromOptionsNotScalingWithLuck(1, 2797, 2749, 2795, 2796, 2880, 2769)); - this.RegisterToNPC(395, ItemDropRule.MasterModeCommonDrop(4939)); - this.RegisterToNPC(395, ItemDropRule.MasterModeDropOnAllPlayers(4815, this._masterModeDropRng)); - this.RegisterToNPC(390, ItemDropRule.Common(2771, 100)); - } - - private void RegisterMiscDrops() - { - this.RegisterToNPC(68, ItemDropRule.Common(1169)); - this.RegisterToMultipleNPCs(ItemDropRule.Common(3086, minimumDropped: 5, maximumDropped: 10), 483, 482); - this.RegisterToNPC(77, ItemDropRule.Common(723, 150)); - this.RegisterToNPC(156, ItemDropRule.Common(683, 30)); - this.RegisterToMultipleNPCs(ItemDropRule.NormalvsExpert(3102, 2, 1), 195, 196); - this.RegisterToNPC(471, ItemDropRule.NormalvsExpertOneFromOptions(2, 1, 3052, 3053, 3054)); - this.RegisterToNPC(153, ItemDropRule.Common(1328, 17)); - this.RegisterToNPC(120, ItemDropRule.NormalvsExpert(1326, 500, 400)); - this.RegisterToNPC(84, ItemDropRule.Common(4758, 35)); - this.RegisterToNPC(49, ItemDropRule.Common(1325, 250)); - this.RegisterToNPC(634, ItemDropRule.Common(4764, 100)); - this.RegisterToNPC(185, ItemDropRule.Common(951, 150)); - this.RegisterToNPC(44, ItemDropRule.Common(1320, 50)); - this.RegisterToNPC(44, ItemDropRule.Common(88, 20)); - this.RegisterToNPC(60, ItemDropRule.Common(1322, 150)); - this.RegisterToNPC(151, ItemDropRule.Common(1322, 50)); - this.RegisterToNPC(24, ItemDropRule.Common(1323, 50)); - this.RegisterToNPC(109, ItemDropRule.Common(1324, 30, maximumDropped: 4)); - int[] numArray1 = new int[2]{ 163, 238 }; - this.RegisterToMultipleNPCs(ItemDropRule.Common(1308, 40), numArray1); - this.RegisterToMultipleNPCs((IItemDropRule) new DropBasedOnExpertMode(ItemDropRule.Common(2607, 2, maximumDropped: 3), (IItemDropRule) new CommonDrop(2607, 10, amountDroppedMaximum: 3, dropsXOutOfY: 9)), numArray1); - this.RegisterToMultipleNPCs(ItemDropRule.Common(1306, 180), 197, 206, 169, 154); - this.RegisterToNPC(244, ItemDropRule.Common(23, maximumDropped: 20)); - this.RegisterToNPC(244, ItemDropRule.Common(662, minimumDropped: 30, maximumDropped: 60)); - this.RegisterToNPC(250, ItemDropRule.Common(1244, 15)); - this.RegisterToNPC(172, ItemDropRule.Common(754)); - this.RegisterToNPC(172, ItemDropRule.Common(755)); - this.RegisterToNPC(110, ItemDropRule.Common(682, 200)); - this.RegisterToNPC(110, ItemDropRule.Common(1321, 80)); - this.RegisterToMultipleNPCs(ItemDropRule.Common(4428, 100), 170, 180, 171); - this.RegisterToMultipleNPCs((IItemDropRule) new ItemDropWithConditionRule(4613, 25, 1, 1, (IItemDropRuleCondition) new Conditions.WindyEnoughForKiteDrops()), 170, 180, 171); - this.RegisterToNPC(154, ItemDropRule.Common(1253, 100)); - this.RegisterToMultipleNPCs(ItemDropRule.Common(726, 50), 169, 206); - this.RegisterToNPC(243, ItemDropRule.Common(2161)); - this.RegisterToNPC(480, ItemDropRule.Common(3269, 50)); - int[] numArray2 = new int[3]{ 198, 199, 226 }; - this.RegisterToMultipleNPCs(ItemDropRule.Common(1172, 1000), numArray2); - this.RegisterToMultipleNPCs(ItemDropRule.Common(1293, 50), numArray2); - this.RegisterToMultipleNPCs(ItemDropRule.Common(2766, 7, maximumDropped: 2), numArray2); - int[] numArray3 = new int[4]{ 78, 79, 80, 630 }; - this.RegisterToMultipleNPCs(ItemDropRule.Common(870, 75), numArray3); - this.RegisterToMultipleNPCs(ItemDropRule.Common(871, 75), numArray3); - this.RegisterToMultipleNPCs(ItemDropRule.Common(872, 75), numArray3); - this.RegisterToNPC(473, ItemDropRule.OneFromOptions(1, 3008, 3014, 3012, 3015, 3023)); - this.RegisterToNPC(474, ItemDropRule.OneFromOptions(1, 3006, 3007, 3013, 3016, 3020)); - this.RegisterToNPC(475, ItemDropRule.OneFromOptions(1, 3029, 3030, 3051, 3022)); - int[] numArray4 = new int[3]{ 473, 474, 475 }; - this.RegisterToMultipleNPCs(ItemDropRule.Common(499, minimumDropped: 5, maximumDropped: 10), numArray4); - this.RegisterToMultipleNPCs(ItemDropRule.Common(500, minimumDropped: 5, maximumDropped: 15), numArray4); - this.RegisterToNPC(87, (IItemDropRule) new ItemDropWithConditionRule(4379, 25, 1, 1, (IItemDropRuleCondition) new Conditions.WindyEnoughForKiteDrops())); - this.RegisterToNPC(87, (IItemDropRule) new DropBasedOnExpertMode(ItemDropRule.Common(575, minimumDropped: 5, maximumDropped: 10), ItemDropRule.Common(575, minimumDropped: 10, maximumDropped: 20))); - this.RegisterToMultipleNPCs(ItemDropRule.OneFromOptions(50, 803, 804, 805), 161, 431); - this.RegisterToNPC(217, ItemDropRule.Common(1115)); - this.RegisterToNPC(218, ItemDropRule.Common(1116)); - this.RegisterToNPC(219, ItemDropRule.Common(1117)); - this.RegisterToNPC(220, ItemDropRule.Common(1118)); - this.RegisterToNPC(221, ItemDropRule.Common(1119)); - this.RegisterToNPC(167, ItemDropRule.Common(879, 50)); - this.RegisterToNPC(628, ItemDropRule.Common(313, 2, maximumDropped: 2)); - int[] numArray5 = new int[3]{ 143, 144, 145 }; - this.RegisterToMultipleNPCs(ItemDropRule.Common(593, minimumDropped: 5, maximumDropped: 10), numArray5); - this.RegisterToMultipleNPCs(ItemDropRule.Common(527, 10), 79, 630); - this.RegisterToNPC(80, ItemDropRule.Common(528, 10)); - this.RegisterToNPC(524, ItemDropRule.Common(3794, 10, maximumDropped: 3)); - this.RegisterToNPC(525, ItemDropRule.Common(3794, 10)); - this.RegisterToNPC(525, ItemDropRule.Common(522, 3, maximumDropped: 3)); - this.RegisterToNPC(525, ItemDropRule.Common(527, 15)); - this.RegisterToNPC(526, ItemDropRule.Common(3794, 10)); - this.RegisterToNPC(526, ItemDropRule.Common(1332, 3, maximumDropped: 3)); - this.RegisterToNPC(526, ItemDropRule.Common(527, 15)); - this.RegisterToNPC(527, ItemDropRule.Common(3794, 10)); - this.RegisterToNPC(527, ItemDropRule.Common(528, 15)); - this.RegisterToNPC(532, ItemDropRule.Common(3380, 3)); - this.RegisterToNPC(532, ItemDropRule.Common(3771, 50)); - this.RegisterToNPC(528, ItemDropRule.Common(2802, 25)); - this.RegisterToNPC(528, ItemDropRule.OneFromOptions(60, 3786, 3785, 3784)); - this.RegisterToNPC(529, ItemDropRule.Common(2801, 25)); - this.RegisterToNPC(529, ItemDropRule.OneFromOptions(40, 3786, 3785, 3784)); - this.RegisterToMultipleNPCs(ItemDropRule.Common(18, 100), 49, 51, 150, 93, 634); - this.RegisterToMultipleNPCs(ItemDropRule.Common(393, 50), 16, 185, 167, 197); - this.RegisterToNPC(58, ItemDropRule.Common(393, 75)); - int[] numArray6 = new int[13] - { - 494, - 495, - 496, - 497, - 498, - 499, - 500, - 501, - 502, - 503, - 504, - 505, - 506 - }; - this.RegisterToMultipleNPCs(ItemDropRule.Common(18, 80), numArray6).OnFailedRoll(ItemDropRule.Common(393, 80)).OnFailedRoll(ItemDropRule.Common(3285, 25)); - int[] numArray7 = new int[12] - { - 21, - 201, - 202, - 203, - 322, - 323, - 324, - 635, - 449, - 450, - 451, - 452 - }; - this.RegisterToMultipleNPCs(ItemDropRule.Common(954, 100), numArray7).OnFailedRoll(ItemDropRule.Common(955, 200)).OnFailedRoll(ItemDropRule.Common(1166, 200)).OnFailedRoll(ItemDropRule.Common(1274, 500)); - this.RegisterToNPC(6, ItemDropRule.OneFromOptions(175, 956, 957, 958)); - int[] numArray8 = new int[7] - { - 42, - 43, - 231, - 232, - 233, - 234, - 235 - }; - this.RegisterToMultipleNPCs(ItemDropRule.OneFromOptions(100, 960, 961, 962), numArray8); - int[] numArray9 = new int[5]{ 31, 32, 294, 295, 296 }; - this.RegisterToMultipleNPCs(ItemDropRule.Common(959, 450), numArray9); - this.RegisterToMultipleNPCs(ItemDropRule.Common(1307, 300), numArray9); - this.RegisterToMultipleNPCs(ItemDropRule.Common(996, 200), 174, 179, 182, 183, 98, 83, 94, 81, 101); - this.RegisterToMultipleNPCs(ItemDropRule.Common(522, minimumDropped: 2, maximumDropped: 5), 101, 98); - this.RegisterToNPC(98, ItemDropRule.ByCondition((IItemDropRuleCondition) new Conditions.WindyEnoughForKiteDrops(), 4611, 25)); - this.RegisterToNPC(86, ItemDropRule.Common(526)); - this.RegisterToNPC(86, ItemDropRule.Common(856, 100)); - this.RegisterToNPC(86, ItemDropRule.ByCondition((IItemDropRuleCondition) new Conditions.WindyEnoughForKiteDrops(), 4684, 25)); - this.RegisterToNPC(224, ItemDropRule.Common(4057, 100)); - this.RegisterToMultipleNPCs(ItemDropRule.Common(40, maximumDropped: 9), 186, 432); - this.RegisterToNPC(225, ItemDropRule.Common(1243, 45)).OnFailedRoll(ItemDropRule.Common(23, minimumDropped: 2, maximumDropped: 6)); - this.RegisterToNPC(537, ItemDropRule.Common(23, minimumDropped: 2, maximumDropped: 3)); - this.RegisterToNPC(537, ItemDropRule.NormalvsExpert(1309, 8000, 5600)); - int[] numArray10 = new int[4]{ 335, 336, 333, 334 }; - this.RegisterToMultipleNPCs(ItemDropRule.Common(1906, 20), numArray10); - this.RegisterToNPC(-4, ItemDropRule.Common(3111, minimumDropped: 25, maximumDropped: 50)); - this.RegisterToNPC(-4, ItemDropRule.NormalvsExpert(1309, 100, 70)); - int[] numArray11 = new int[15] - { - 1, - 16, - 138, - 141, - 147, - 184, - 187, - 433, - 204, - 302, - 333, - 334, - 335, - 336, - 535 - }; - int[] numArray12 = new int[4]{ -6, -7, -8, -9 }; - int[] numArray13 = new int[5]{ -6, -7, -8, -9, -4 }; - this.RemoveFromMultipleNPCs(this.RegisterToMultipleNPCs(ItemDropRule.Common(23, maximumDropped: 2), numArray11), numArray13); - this.RegisterToMultipleNPCs(ItemDropRule.Common(23, minimumDropped: 2, maximumDropped: 5), numArray12); - this.RemoveFromMultipleNPCs(this.RegisterToMultipleNPCs(ItemDropRule.NormalvsExpert(1309, 10000, 7000), numArray11), numArray13); - this.RegisterToMultipleNPCs(ItemDropRule.NormalvsExpert(1309, 10000, 7000), numArray12); - this.RegisterToNPC(75, ItemDropRule.Common(501, maximumDropped: 3)); - this.RegisterToMultipleNPCs(ItemDropRule.Common(23, minimumDropped: 2, maximumDropped: 4), 81, 183); - this.RegisterToNPC(122, ItemDropRule.Common(23, minimumDropped: 5, maximumDropped: 10)); - this.RegisterToNPC(71, ItemDropRule.Common(327)); - int[] numArray14 = new int[9] - { - 2, - 317, - 318, - 190, - 191, - 192, - 193, - 194, - 133 - }; - this.RegisterToMultipleNPCs(ItemDropRule.Common(236, 100), numArray14).OnFailedRoll(ItemDropRule.Common(38, 3)); - this.RegisterToNPC(133, ItemDropRule.ByCondition((IItemDropRuleCondition) new Conditions.WindyEnoughForKiteDrops(), 4683, 25)); - this.RegisterToNPC(104, ItemDropRule.Common(485, 60)); - this.RegisterToNPC(58, ItemDropRule.Common(263, 250)).OnFailedRoll(ItemDropRule.Common(118, 30)); - this.RegisterToNPC(102, ItemDropRule.Common(263, 250)); - int[] numArray15 = new int[23] - { - 3, - 591, - 590, - 331, - 332, - 132, - 161, - 186, - 187, - 188, - 189, - 200, - 223, - 319, - 320, - 321, - 430, - 431, - 432, - 433, - 434, - 435, - 436 - }; - this.RegisterToMultipleNPCs(ItemDropRule.Common(216, 50), numArray15); - this.RegisterToMultipleNPCs(ItemDropRule.Common(1304, 250), numArray15); - this.RegisterToMultipleNPCs(ItemDropRule.Common(8, minimumDropped: 5, maximumDropped: 20), 590, 591); - this.RegisterToMultipleNPCs(ItemDropRule.NormalvsExpert(3212, 150, 75), 489, 490); - this.RegisterToMultipleNPCs(ItemDropRule.NormalvsExpert(3213, 200, 100), 489, 490); - this.RegisterToNPC(223, ItemDropRule.OneFromOptions(20, 1135, 1136)); - this.RegisterToNPC(66, ItemDropRule.Common(267)); - this.RegisterToMultipleNPCs(ItemDropRule.Common(272, 35), 62, 66); - this.RegisterToNPC(52, ItemDropRule.Common(251)); - this.RegisterToNPC(53, ItemDropRule.Common(239)); - this.RegisterToNPC(536, ItemDropRule.Common(3478)); - this.RegisterToNPC(536, ItemDropRule.Common(3479)); - this.RegisterToMultipleNPCs(ItemDropRule.Common(323, 3, maximumDropped: 2), 69, 581, 580, 508, 509); - this.RegisterToNPC(582, ItemDropRule.Common(323, 6)); - this.RegisterToMultipleNPCs(ItemDropRule.Common(3772, 50), 581, 580, 508, 509); - this.RegisterToNPC(73, ItemDropRule.Common(362, maximumDropped: 2)); - int[] numArray16 = new int[2]{ 483, 482 }; - this.RegisterToMultipleNPCs(ItemDropRule.Common(3109, 30), numArray16); - this.RegisterToMultipleNPCs(ItemDropRule.Common(4400, 20), numArray16); - this.RegisterToMultipleNPCs(ItemDropRule.Common(68, 3), 6, 94); - this.RegisterToMultipleNPCs(ItemDropRule.Common(1330, 3), 181, 173, 239, 182, 240); - this.RegisterToMultipleNPCs(ItemDropRule.Common(68, 3, maximumDropped: 2), 7, 8, 9); - this.RegisterToMultipleNPCs(ItemDropRule.Common(69, minimumDropped: 3, maximumDropped: 8), 7, 8, 9); - this.RegisterToMultipleNPCs((IItemDropRule) new DropBasedOnExpertMode(ItemDropRule.Common(215, 50), ItemDropRule.WithRerolls(215, 1, 50)), 10, 11, 12, 95, 96, 97); - this.RegisterToMultipleNPCs(ItemDropRule.Common(243, 75), 47, 464); - this.RegisterToMultipleNPCs(ItemDropRule.OneFromOptions(50, 3757, 3758, 3759), 168, 470); - this.RegisterToNPC(533, ItemDropRule.Common(3795, 40)).OnFailedRoll(ItemDropRule.Common(3770, 30)); - int[] numArray17 = new int[3]{ 63, 103, 64 }; - this.RegisterToMultipleNPCs(ItemDropRule.Common(1303, 100), numArray17); - this.RegisterToMultipleNPCs(ItemDropRule.Common(282, maximumDropped: 4), numArray17); - this.RegisterToNPC(63, ItemDropRule.ByCondition((IItemDropRuleCondition) new Conditions.WindyEnoughForKiteDrops(), 4649, 50)); - this.RegisterToNPC(64, ItemDropRule.ByCondition((IItemDropRuleCondition) new Conditions.WindyEnoughForKiteDrops(), 4650, 50)); - this.RegisterToNPC(481, ItemDropRule.Common(3094, 2, 40, 80)); - this.RegisterToNPC(481, ItemDropRule.OneFromOptions(20, 3187, 3188, 3189)); - this.RegisterToNPC(481, ItemDropRule.Common(4463, 40)); - int[] numArray18 = new int[13] - { - 21, - 167, - 201, - 202, - 481, - 203, - 322, - 323, - 324, - 449, - 450, - 451, - 452 - }; - this.RegisterToMultipleNPCs(ItemDropRule.Common(118, 25), numArray18); - this.RegisterToNPC(44, ItemDropRule.Common(118, 25)).OnFailedRoll(ItemDropRule.OneFromOptions(20, 410, 411)).OnFailedRoll(ItemDropRule.Common(166, maximumDropped: 3)); - this.RegisterToNPC(45, ItemDropRule.Common(238)); - this.RegisterToNPC(23, ItemDropRule.Common(116, 50)); - this.RegisterToNPC(24, ItemDropRule.Common(244, 250)); - int[] numArray19 = new int[6] - { - 31, - 32, - 34, - 294, - 295, - 296 - }; - this.RegisterToMultipleNPCs(ItemDropRule.Common(932, 250), numArray19).OnFailedRoll(ItemDropRule.Common(3095, 100)).OnFailedRoll(ItemDropRule.Common(327, 65)).OnFailedRoll(ItemDropRule.ByCondition((IItemDropRuleCondition) new Conditions.NotExpert(), 154, maximumDropped: 3)); - this.RegisterToMultipleNPCs(ItemDropRule.ByCondition((IItemDropRuleCondition) new Conditions.IsExpert(), 154, minimumDropped: 2, maximumDropped: 6), numArray19); - int[] numArray20 = new int[5]{ 26, 27, 28, 29, 111 }; - this.RegisterToMultipleNPCs(ItemDropRule.Common(160, 200), numArray20).OnFailedRoll(ItemDropRule.Common(161, 2, maximumDropped: 5)); - this.RegisterToNPC(175, ItemDropRule.Common(1265, 100)); - this.RegisterToNPC(175, ItemDropRule.ByCondition((IItemDropRuleCondition) new Conditions.WindyEnoughForKiteDrops(), 4675, 25)); - this.RegisterToMultipleNPCs((IItemDropRule) new DropBasedOnExpertMode((IItemDropRule) new CommonDrop(209, 3, dropsXOutOfY: 2), ItemDropRule.Common(209)), 42, 231, 232, 233, 234, 235); - this.RegisterToNPC(204, ItemDropRule.NormalvsExpert(209, 2, 1)); - this.RegisterToNPC(43, ItemDropRule.NormalvsExpert(210, 2, 1)); - this.RegisterToNPC(43, ItemDropRule.ByCondition((IItemDropRuleCondition) new Conditions.WindyEnoughForKiteDrops(), 4648, 25)); - this.RegisterToNPC(39, ItemDropRule.ByCondition((IItemDropRuleCondition) new Conditions.WindyEnoughForKiteDrops(), 4610, 25)); - this.RegisterToNPC(65, ItemDropRule.ByCondition((IItemDropRuleCondition) new Conditions.WindyEnoughForKiteDrops(), 4651, 25)); - this.RegisterToNPC(65, ItemDropRule.Common(268, 50)).OnFailedRoll(ItemDropRule.Common(319)); - this.RegisterToNPC(48, ItemDropRule.NotScalingWithLuck(320, 2)); - this.RegisterToNPC(541, ItemDropRule.Common(3783)); - this.RegisterToMultipleNPCs(ItemDropRule.Common(319, 8), 542, 543, 544, 545); - this.RegisterToMultipleNPCs(ItemDropRule.ByCondition((IItemDropRuleCondition) new Conditions.WindyEnoughForKiteDrops(), 4669, 25), 542, 543, 544, 545); - this.RegisterToNPC(543, ItemDropRule.Common(527, 25)); - this.RegisterToNPC(544, ItemDropRule.Common(527, 25)); - this.RegisterToNPC(545, ItemDropRule.Common(528, 25)); - this.RegisterToNPC(47, ItemDropRule.ByCondition((IItemDropRuleCondition) new Conditions.WindyEnoughForKiteDrops(), 4670, 25)); - this.RegisterToNPC(464, ItemDropRule.ByCondition((IItemDropRuleCondition) new Conditions.WindyEnoughForKiteDrops(), 4671, 25)); - this.RegisterToNPC(268, ItemDropRule.Common(1332, minimumDropped: 2, maximumDropped: 5)); - this.RegisterToNPC(631, ItemDropRule.Common(3, minimumDropped: 10, maximumDropped: 20)); - this.RegisterToNPC(631, ItemDropRule.Common(4761, 20)); - int[] numArray21 = new int[1]{ 594 }; - LeadingConditionRule rule1 = new LeadingConditionRule((IItemDropRuleCondition) new Conditions.NeverTrue()); - int[] numArray22 = new int[0]; - IItemDropRule rule2 = rule1.OnSuccess(ItemDropRule.OneFromOptions(20, numArray22)); - int dropsOutOfY = 13; - rule2.OnSuccess((IItemDropRule) new CommonDrop(4367, dropsOutOfY)); - rule2.OnSuccess((IItemDropRule) new CommonDrop(4368, dropsOutOfY)); - rule2.OnSuccess((IItemDropRule) new CommonDrop(4369, dropsOutOfY)); - rule2.OnSuccess((IItemDropRule) new CommonDrop(4370, dropsOutOfY)); - rule2.OnSuccess((IItemDropRule) new CommonDrop(4371, dropsOutOfY)); - rule2.OnSuccess((IItemDropRule) new CommonDrop(4612, dropsOutOfY)); - rule2.OnSuccess((IItemDropRule) new CommonDrop(4674, dropsOutOfY)); - rule2.OnSuccess((IItemDropRule) new CommonDrop(4343, dropsOutOfY, dropsXOutOfY: 3)); - rule2.OnSuccess((IItemDropRule) new CommonDrop(4344, dropsOutOfY, dropsXOutOfY: 3)); - this.RegisterToMultipleNPCs((IItemDropRule) rule1, numArray21); - } - } -} diff --git a/GameContent/ItemDropRules/ItemDropResolver.cs b/GameContent/ItemDropRules/ItemDropResolver.cs deleted file mode 100644 index ac94eba..0000000 --- a/GameContent/ItemDropRules/ItemDropResolver.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.ItemDropResolver -// 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.Collections.Generic; - -namespace Terraria.GameContent.ItemDropRules -{ - public class ItemDropResolver - { - private ItemDropDatabase _database; - - public ItemDropResolver(ItemDropDatabase database) => this._database = database; - - public void TryDropping(DropAttemptInfo info) - { - List rulesForNpcid = this._database.GetRulesForNPCID(info.npc.netID); - for (int index = 0; index < rulesForNpcid.Count; ++index) - this.ResolveRule(rulesForNpcid[index], info); - } - - private ItemDropAttemptResult ResolveRule( - IItemDropRule rule, - DropAttemptInfo info) - { - if (!rule.CanDrop(info)) - { - ItemDropAttemptResult parentResult = new ItemDropAttemptResult() - { - State = ItemDropAttemptResultState.DoesntFillConditions - }; - this.ResolveRuleChains(rule, info, parentResult); - return parentResult; - } - ItemDropAttemptResult parentResult1 = !(rule is INestedItemDropRule nestedItemDropRule) ? rule.TryDroppingItem(info) : nestedItemDropRule.TryDroppingItem(info, new ItemDropRuleResolveAction(this.ResolveRule)); - this.ResolveRuleChains(rule, info, parentResult1); - return parentResult1; - } - - private void ResolveRuleChains( - IItemDropRule rule, - DropAttemptInfo info, - ItemDropAttemptResult parentResult) - { - this.ResolveRuleChains(ref info, ref parentResult, rule.ChainedRules); - } - - private void ResolveRuleChains( - ref DropAttemptInfo info, - ref ItemDropAttemptResult parentResult, - List ruleChains) - { - if (ruleChains == null) - return; - for (int index = 0; index < ruleChains.Count; ++index) - { - IItemDropRuleChainAttempt ruleChain = ruleChains[index]; - if (ruleChain.CanChainIntoRule(parentResult)) - this.ResolveRule(ruleChain.RuleToChain, info); - } - } - } -} diff --git a/GameContent/ItemDropRules/ItemDropRule.cs b/GameContent/ItemDropRules/ItemDropRule.cs deleted file mode 100644 index 70c19fc..0000000 --- a/GameContent/ItemDropRules/ItemDropRule.cs +++ /dev/null @@ -1,146 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.ItemDropRule -// 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.ItemDropRules -{ - public class ItemDropRule - { - public static IItemDropRule Common( - int itemId, - int dropsOutOfX = 1, - int minimumDropped = 1, - int maximumDropped = 1) - { - return (IItemDropRule) new CommonDrop(itemId, dropsOutOfX, minimumDropped, maximumDropped); - } - - public static IItemDropRule BossBag(int itemId) => (IItemDropRule) new DropBasedOnExpertMode(ItemDropRule.DropNothing(), (IItemDropRule) new DropLocalPerClientAndResetsNPCMoneyTo0(itemId, 1, 1, 1, (IItemDropRuleCondition) null)); - - public static IItemDropRule BossBagByCondition( - IItemDropRuleCondition condition, - int itemId) - { - return (IItemDropRule) new DropBasedOnExpertMode(ItemDropRule.DropNothing(), (IItemDropRule) new DropLocalPerClientAndResetsNPCMoneyTo0(itemId, 1, 1, 1, condition)); - } - - public static IItemDropRule ExpertGetsRerolls( - int itemId, - int dropsOutOfX, - int expertRerolls) - { - return (IItemDropRule) new DropBasedOnExpertMode(ItemDropRule.WithRerolls(itemId, 0, dropsOutOfX), ItemDropRule.WithRerolls(itemId, expertRerolls, dropsOutOfX)); - } - - public static IItemDropRule MasterModeCommonDrop(int itemId) => ItemDropRule.ByCondition((IItemDropRuleCondition) new Conditions.IsMasterMode(), itemId); - - public static IItemDropRule MasterModeDropOnAllPlayers( - int itemId, - int dropsAtXOutOfY_TheY = 1) - { - return (IItemDropRule) new DropBasedOnMasterMode(ItemDropRule.DropNothing(), (IItemDropRule) new DropPerPlayerOnThePlayer(itemId, dropsAtXOutOfY_TheY, 1, 1, (IItemDropRuleCondition) new Conditions.IsMasterMode())); - } - - public static IItemDropRule WithRerolls( - int itemId, - int rerolls, - int dropsOutOfX = 1, - int minimumDropped = 1, - int maximumDropped = 1) - { - return (IItemDropRule) new CommonDropWithRerolls(itemId, dropsOutOfX, minimumDropped, maximumDropped, rerolls); - } - - public static IItemDropRule ByCondition( - IItemDropRuleCondition condition, - int itemId, - int dropsOutOfX = 1, - int minimumDropped = 1, - int maximumDropped = 1, - int dropsXOutOfY = 1) - { - return (IItemDropRule) new ItemDropWithConditionRule(itemId, dropsOutOfX, minimumDropped, maximumDropped, condition, dropsXOutOfY); - } - - public static IItemDropRule NotScalingWithLuck( - int itemId, - int dropsOutOfX = 1, - int minimumDropped = 1, - int maximumDropped = 1) - { - return (IItemDropRule) new CommonDrop(itemId, dropsOutOfX, minimumDropped, maximumDropped); - } - - public static IItemDropRule OneFromOptionsNotScalingWithLuck( - int dropsOutOfX, - params int[] options) - { - return (IItemDropRule) new OneFromOptionsNotScaledWithLuckDropRule(dropsOutOfX, 1, options); - } - - public static IItemDropRule OneFromOptionsNotScalingWithLuckWithX( - int dropsOutOfY, - int xOutOfY, - params int[] options) - { - return (IItemDropRule) new OneFromOptionsNotScaledWithLuckDropRule(dropsOutOfY, xOutOfY, options); - } - - public static IItemDropRule OneFromOptions(int dropsOutOfX, params int[] options) => (IItemDropRule) new OneFromOptionsDropRule(dropsOutOfX, 1, options); - - public static IItemDropRule OneFromOptionsWithX( - int dropsOutOfY, - int xOutOfY, - params int[] options) - { - return (IItemDropRule) new OneFromOptionsDropRule(dropsOutOfY, xOutOfY, options); - } - - public static IItemDropRule DropNothing() => (IItemDropRule) new Terraria.GameContent.ItemDropRules.DropNothing(); - - public static IItemDropRule NormalvsExpert( - int itemId, - int oncePerXInNormal, - int oncePerXInExpert) - { - return (IItemDropRule) new DropBasedOnExpertMode(ItemDropRule.Common(itemId, oncePerXInNormal), ItemDropRule.Common(itemId, oncePerXInExpert)); - } - - public static IItemDropRule NormalvsExpertNotScalingWithLuck( - int itemId, - int oncePerXInNormal, - int oncePerXInExpert) - { - return (IItemDropRule) new DropBasedOnExpertMode(ItemDropRule.NotScalingWithLuck(itemId, oncePerXInNormal), ItemDropRule.NotScalingWithLuck(itemId, oncePerXInExpert)); - } - - public static IItemDropRule NormalvsExpertOneFromOptionsNotScalingWithLuck( - int dropsOutOfXNormalMode, - int dropsOutOfXExpertMode, - params int[] options) - { - return (IItemDropRule) new DropBasedOnExpertMode(ItemDropRule.OneFromOptionsNotScalingWithLuck(dropsOutOfXNormalMode, options), ItemDropRule.OneFromOptionsNotScalingWithLuck(dropsOutOfXExpertMode, options)); - } - - public static IItemDropRule NormalvsExpertOneFromOptions( - int dropsOutOfXNormalMode, - int dropsOutOfXExpertMode, - params int[] options) - { - return (IItemDropRule) new DropBasedOnExpertMode(ItemDropRule.OneFromOptions(dropsOutOfXNormalMode, options), ItemDropRule.OneFromOptions(dropsOutOfXExpertMode, options)); - } - - public static IItemDropRule Food( - int itemId, - int dropsOutOfX, - int minimumDropped = 1, - int maximumDropped = 1) - { - return (IItemDropRule) new ItemDropWithConditionRule(itemId, dropsOutOfX, minimumDropped, maximumDropped, (IItemDropRuleCondition) new Conditions.NotFromStatue()); - } - - public static IItemDropRule StatusImmunityItem(int itemId, int dropsOutOfX) => ItemDropRule.ExpertGetsRerolls(itemId, dropsOutOfX, 1); - } -} diff --git a/GameContent/ItemDropRules/ItemDropRuleResolveAction.cs b/GameContent/ItemDropRules/ItemDropRuleResolveAction.cs deleted file mode 100644 index 61e1f0a..0000000 --- a/GameContent/ItemDropRules/ItemDropRuleResolveAction.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.ItemDropRuleResolveAction -// 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.ItemDropRules -{ - public delegate ItemDropAttemptResult ItemDropRuleResolveAction( - IItemDropRule rule, - DropAttemptInfo info); -} diff --git a/GameContent/ItemDropRules/ItemDropWithConditionRule.cs b/GameContent/ItemDropRules/ItemDropWithConditionRule.cs deleted file mode 100644 index 857dd34..0000000 --- a/GameContent/ItemDropRules/ItemDropWithConditionRule.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.ItemDropWithConditionRule -// 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.Collections.Generic; - -namespace Terraria.GameContent.ItemDropRules -{ - public class ItemDropWithConditionRule : CommonDrop - { - private IItemDropRuleCondition _condition; - - public ItemDropWithConditionRule( - int itemId, - int dropsOutOfY, - int amountDroppedMinimum, - int amountDroppedMaximum, - IItemDropRuleCondition condition, - int dropsXOutOfY = 1) - : base(itemId, dropsOutOfY, amountDroppedMinimum, amountDroppedMaximum, dropsXOutOfY) - { - this._condition = condition; - } - - public override bool CanDrop(DropAttemptInfo info) => this._condition.CanDrop(info); - - public override void ReportDroprates(List drops, DropRateInfoChainFeed ratesInfo) - { - DropRateInfoChainFeed ratesInfo1 = ratesInfo.With(1f); - ratesInfo1.AddCondition(this._condition); - float personalDropRate = (float) this._dropsXoutOfY / (float) this._dropsOutOfY; - float dropRate = personalDropRate * ratesInfo1.parentDroprateChance; - drops.Add(new DropRateInfo(this._itemId, this._amtDroppedMinimum, this._amtDroppedMaximum, dropRate, ratesInfo1.conditions)); - Chains.ReportDroprates(this.ChainedRules, personalDropRate, drops, ratesInfo1); - } - } -} diff --git a/GameContent/ItemDropRules/LeadingConditionRule.cs b/GameContent/ItemDropRules/LeadingConditionRule.cs deleted file mode 100644 index fc8170a..0000000 --- a/GameContent/ItemDropRules/LeadingConditionRule.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.LeadingConditionRule -// 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.Collections.Generic; - -namespace Terraria.GameContent.ItemDropRules -{ - public class LeadingConditionRule : IItemDropRule - { - private IItemDropRuleCondition _condition; - - public List ChainedRules { get; private set; } - - public LeadingConditionRule(IItemDropRuleCondition condition) - { - this._condition = condition; - this.ChainedRules = new List(); - } - - public bool CanDrop(DropAttemptInfo info) => this._condition.CanDrop(info); - - public void ReportDroprates(List drops, DropRateInfoChainFeed ratesInfo) - { - ratesInfo.AddCondition(this._condition); - Chains.ReportDroprates(this.ChainedRules, 1f, drops, ratesInfo); - } - - public ItemDropAttemptResult TryDroppingItem(DropAttemptInfo info) => new ItemDropAttemptResult() - { - State = ItemDropAttemptResultState.Success - }; - } -} diff --git a/GameContent/ItemDropRules/MechBossSpawnersDropRule.cs b/GameContent/ItemDropRules/MechBossSpawnersDropRule.cs deleted file mode 100644 index 8de8221..0000000 --- a/GameContent/ItemDropRules/MechBossSpawnersDropRule.cs +++ /dev/null @@ -1,64 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.MechBossSpawnersDropRule -// 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.Collections.Generic; - -namespace Terraria.GameContent.ItemDropRules -{ - public class MechBossSpawnersDropRule : IItemDropRule - { - private Conditions.MechanicalBossesDummyCondition _dummyCondition = new Conditions.MechanicalBossesDummyCondition(); - - public List ChainedRules { get; private set; } - - public MechBossSpawnersDropRule() => this.ChainedRules = new List(); - - public bool CanDrop(DropAttemptInfo info) => (double) info.npc.value > 0.0 && Main.hardMode && (!NPC.downedMechBoss1 || !NPC.downedMechBoss2 || !NPC.downedMechBoss3) && !info.IsInSimulation; - - public ItemDropAttemptResult TryDroppingItem(DropAttemptInfo info) - { - if (!NPC.downedMechBoss1 && info.player.RollLuck(2500) == 0) - { - CommonCode.DropItemFromNPC(info.npc, 556, 1); - return new ItemDropAttemptResult() - { - State = ItemDropAttemptResultState.Success - }; - } - if (!NPC.downedMechBoss2 && info.player.RollLuck(2500) == 0) - { - CommonCode.DropItemFromNPC(info.npc, 544, 1); - return new ItemDropAttemptResult() - { - State = ItemDropAttemptResultState.Success - }; - } - if (!NPC.downedMechBoss3 && info.player.RollLuck(2500) == 0) - { - CommonCode.DropItemFromNPC(info.npc, 557, 1); - return new ItemDropAttemptResult() - { - State = ItemDropAttemptResultState.Success - }; - } - return new ItemDropAttemptResult() - { - State = ItemDropAttemptResultState.FailedRandomRoll - }; - } - - public void ReportDroprates(List drops, DropRateInfoChainFeed ratesInfo) - { - ratesInfo.AddCondition((IItemDropRuleCondition) this._dummyCondition); - float personalDropRate = 0.0004f; - float dropRate = personalDropRate * ratesInfo.parentDroprateChance; - drops.Add(new DropRateInfo(556, 1, 1, dropRate, ratesInfo.conditions)); - drops.Add(new DropRateInfo(544, 1, 1, dropRate, ratesInfo.conditions)); - drops.Add(new DropRateInfo(557, 1, 1, dropRate, ratesInfo.conditions)); - Chains.ReportDroprates(this.ChainedRules, personalDropRate, drops, ratesInfo); - } - } -} diff --git a/GameContent/ItemDropRules/OneFromOptionsDropRule.cs b/GameContent/ItemDropRules/OneFromOptionsDropRule.cs deleted file mode 100644 index 47754ce..0000000 --- a/GameContent/ItemDropRules/OneFromOptionsDropRule.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.OneFromOptionsDropRule -// 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.Collections.Generic; - -namespace Terraria.GameContent.ItemDropRules -{ - public class OneFromOptionsDropRule : IItemDropRule - { - private int[] _dropIds; - private int _outOfY; - private int _xoutOfY; - - public List ChainedRules { get; private set; } - - public OneFromOptionsDropRule(int outOfY, int xoutOfY, params int[] options) - { - this._outOfY = outOfY; - this._xoutOfY = xoutOfY; - this._dropIds = options; - this.ChainedRules = new List(); - } - - public bool CanDrop(DropAttemptInfo info) => true; - - public ItemDropAttemptResult TryDroppingItem(DropAttemptInfo info) - { - if (info.player.RollLuck(this._outOfY) < this._xoutOfY) - { - CommonCode.DropItemFromNPC(info.npc, this._dropIds[info.rng.Next(this._dropIds.Length)], 1); - return new ItemDropAttemptResult() - { - State = ItemDropAttemptResultState.Success - }; - } - return new ItemDropAttemptResult() - { - State = ItemDropAttemptResultState.FailedRandomRoll - }; - } - - public void ReportDroprates(List drops, DropRateInfoChainFeed ratesInfo) - { - float personalDropRate = (float) this._xoutOfY / (float) this._outOfY; - float dropRate = 1f / (float) this._dropIds.Length * (personalDropRate * ratesInfo.parentDroprateChance); - for (int index = 0; index < this._dropIds.Length; ++index) - drops.Add(new DropRateInfo(this._dropIds[index], 1, 1, dropRate, ratesInfo.conditions)); - Chains.ReportDroprates(this.ChainedRules, personalDropRate, drops, ratesInfo); - } - } -} diff --git a/GameContent/ItemDropRules/OneFromOptionsNotScaledWithLuckDropRule.cs b/GameContent/ItemDropRules/OneFromOptionsNotScaledWithLuckDropRule.cs deleted file mode 100644 index 9202e04..0000000 --- a/GameContent/ItemDropRules/OneFromOptionsNotScaledWithLuckDropRule.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.OneFromOptionsNotScaledWithLuckDropRule -// 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.Collections.Generic; - -namespace Terraria.GameContent.ItemDropRules -{ - public class OneFromOptionsNotScaledWithLuckDropRule : IItemDropRule - { - private int[] _dropIds; - private int _outOfY; - private int _xoutOfY; - - public List ChainedRules { get; private set; } - - public OneFromOptionsNotScaledWithLuckDropRule(int outOfY, int xoutOfY, params int[] options) - { - this._outOfY = outOfY; - this._dropIds = options; - this._xoutOfY = xoutOfY; - this.ChainedRules = new List(); - } - - public bool CanDrop(DropAttemptInfo info) => true; - - public ItemDropAttemptResult TryDroppingItem(DropAttemptInfo info) - { - if (info.rng.Next(this._outOfY) < this._xoutOfY) - { - CommonCode.DropItemFromNPC(info.npc, this._dropIds[info.rng.Next(this._dropIds.Length)], 1); - return new ItemDropAttemptResult() - { - State = ItemDropAttemptResultState.Success - }; - } - return new ItemDropAttemptResult() - { - State = ItemDropAttemptResultState.FailedRandomRoll - }; - } - - public void ReportDroprates(List drops, DropRateInfoChainFeed ratesInfo) - { - float personalDropRate = (float) this._xoutOfY / (float) this._outOfY; - float dropRate = 1f / (float) this._dropIds.Length * (personalDropRate * ratesInfo.parentDroprateChance); - for (int index = 0; index < this._dropIds.Length; ++index) - drops.Add(new DropRateInfo(this._dropIds[index], 1, 1, dropRate, ratesInfo.conditions)); - Chains.ReportDroprates(this.ChainedRules, personalDropRate, drops, ratesInfo); - } - } -} diff --git a/GameContent/ItemDropRules/OneFromRulesRule.cs b/GameContent/ItemDropRules/OneFromRulesRule.cs deleted file mode 100644 index bb135d4..0000000 --- a/GameContent/ItemDropRules/OneFromRulesRule.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.OneFromRulesRule -// 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.Collections.Generic; - -namespace Terraria.GameContent.ItemDropRules -{ - public class OneFromRulesRule : IItemDropRule, INestedItemDropRule - { - private IItemDropRule[] _options; - private int _outOfY; - - public List ChainedRules { get; private set; } - - public OneFromRulesRule(int outOfY, params IItemDropRule[] options) - { - this._outOfY = outOfY; - this._options = options; - this.ChainedRules = new List(); - } - - public bool CanDrop(DropAttemptInfo info) => true; - - public ItemDropAttemptResult TryDroppingItem(DropAttemptInfo info) => new ItemDropAttemptResult() - { - State = ItemDropAttemptResultState.DidNotRunCode - }; - - public ItemDropAttemptResult TryDroppingItem( - DropAttemptInfo info, - ItemDropRuleResolveAction resolveAction) - { - if (info.rng.Next(this._outOfY) == 0) - { - int index = info.rng.Next(this._options.Length); - ItemDropAttemptResult dropAttemptResult = resolveAction(this._options[index], info); - return new ItemDropAttemptResult() - { - State = ItemDropAttemptResultState.Success - }; - } - return new ItemDropAttemptResult() - { - State = ItemDropAttemptResultState.FailedRandomRoll - }; - } - - public void ReportDroprates(List drops, DropRateInfoChainFeed ratesInfo) - { - float personalDropRate = 1f / (float) this._outOfY; - float multiplier = 1f / (float) this._options.Length * (personalDropRate * ratesInfo.parentDroprateChance); - for (int index = 0; index < this._options.Length; ++index) - this._options[index].ReportDroprates(drops, ratesInfo.With(multiplier)); - Chains.ReportDroprates(this.ChainedRules, personalDropRate, drops, ratesInfo); - } - } -} diff --git a/GameContent/ItemDropRules/SlimeBodyItemDropRule.cs b/GameContent/ItemDropRules/SlimeBodyItemDropRule.cs deleted file mode 100644 index 75b1c27..0000000 --- a/GameContent/ItemDropRules/SlimeBodyItemDropRule.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemDropRules.SlimeBodyItemDropRule -// 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.Collections.Generic; - -namespace Terraria.GameContent.ItemDropRules -{ - public class SlimeBodyItemDropRule : IItemDropRule - { - public List ChainedRules { get; private set; } - - public SlimeBodyItemDropRule() => this.ChainedRules = new List(); - - public bool CanDrop(DropAttemptInfo info) => info.npc.type == 1 && (double) info.npc.ai[1] > 0.0 && (double) info.npc.ai[1] < 5045.0; - - public ItemDropAttemptResult TryDroppingItem(DropAttemptInfo info) - { - int itemId = (int) info.npc.ai[1]; - int amountDroppedMinimum; - int amountDroppedMaximum; - this.GetDropInfo(itemId, out amountDroppedMinimum, out amountDroppedMaximum); - CommonCode.DropItemFromNPC(info.npc, itemId, info.rng.Next(amountDroppedMinimum, amountDroppedMaximum + 1)); - return new ItemDropAttemptResult() - { - State = ItemDropAttemptResultState.Success - }; - } - - private void GetDropInfo( - int itemId, - out int amountDroppedMinimum, - out int amountDroppedMaximum) - { - amountDroppedMinimum = 1; - amountDroppedMaximum = 1; - switch (itemId) - { - case 8: - amountDroppedMinimum = 5; - amountDroppedMaximum = 10; - break; - case 11: - case 12: - case 13: - case 14: - case 699: - case 700: - case 701: - case 702: - amountDroppedMinimum = 3; - amountDroppedMaximum = 13; - break; - case 71: - amountDroppedMinimum = 50; - amountDroppedMaximum = 99; - break; - case 72: - amountDroppedMinimum = 20; - amountDroppedMaximum = 99; - break; - case 73: - amountDroppedMinimum = 1; - amountDroppedMaximum = 2; - break; - case 166: - amountDroppedMinimum = 2; - amountDroppedMaximum = 6; - break; - case 965: - amountDroppedMinimum = 20; - amountDroppedMaximum = 45; - break; - } - } - - public void ReportDroprates(List drops, DropRateInfoChainFeed ratesInfo) => Chains.ReportDroprates(this.ChainedRules, 1f, drops, ratesInfo); - } -} diff --git a/GameContent/ItemShopSellbackHelper.cs b/GameContent/ItemShopSellbackHelper.cs deleted file mode 100644 index 9bff538..0000000 --- a/GameContent/ItemShopSellbackHelper.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ItemShopSellbackHelper -// 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; - -namespace Terraria.GameContent -{ - public class ItemShopSellbackHelper - { - private List _memos = new List(); - - public void Add(Item item) - { - ItemShopSellbackHelper.ItemMemo itemMemo = this._memos.Find((Predicate) (x => x.Matches(item))); - if (itemMemo != null) - itemMemo.stack += item.stack; - else - this._memos.Add(new ItemShopSellbackHelper.ItemMemo(item)); - } - - public void Clear() => this._memos.Clear(); - - public int GetAmount(Item item) - { - ItemShopSellbackHelper.ItemMemo itemMemo = this._memos.Find((Predicate) (x => x.Matches(item))); - return itemMemo != null ? itemMemo.stack : 0; - } - - public int Remove(Item item) - { - ItemShopSellbackHelper.ItemMemo itemMemo = this._memos.Find((Predicate) (x => x.Matches(item))); - if (itemMemo == null) - return 0; - int stack = itemMemo.stack; - itemMemo.stack -= item.stack; - if (itemMemo.stack > 0) - return stack - itemMemo.stack; - this._memos.Remove(itemMemo); - return stack; - } - - private class ItemMemo - { - public readonly int itemNetID; - public readonly int itemPrefix; - public int stack; - - public ItemMemo(Item item) - { - this.itemNetID = item.netID; - this.itemPrefix = (int) item.prefix; - this.stack = item.stack; - } - - public bool Matches(Item item) => item.netID == this.itemNetID && (int) item.prefix == this.itemPrefix; - } - } -} diff --git a/GameContent/Liquid/LiquidRenderer.cs b/GameContent/Liquid/LiquidRenderer.cs index b2dfb66..79b09e1 100644 --- a/GameContent/Liquid/LiquidRenderer.cs +++ b/GameContent/Liquid/LiquidRenderer.cs @@ -1,15 +1,13 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Liquid.LiquidRenderer -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using System; using Terraria.Graphics; -using Terraria.ID; using Terraria.Utilities; namespace Terraria.GameContent.Liquid @@ -48,30 +46,23 @@ namespace Terraria.GameContent.Liquid (byte) 0 }; public const float MIN_LIQUID_SIZE = 0.25f; - public static LiquidRenderer Instance; - private readonly Asset[] _liquidTextures = new Asset[13]; + public static LiquidRenderer Instance = new LiquidRenderer(); + private Tile[,] _tiles = Main.tile; + private Texture2D[] _liquidTextures = new Texture2D[12]; private LiquidRenderer.LiquidCache[] _cache = new LiquidRenderer.LiquidCache[1]; private LiquidRenderer.LiquidDrawCache[] _drawCache = new LiquidRenderer.LiquidDrawCache[1]; private int _animationFrame; private Rectangle _drawArea = new Rectangle(0, 0, 1, 1); - private readonly UnifiedRandom _random = new UnifiedRandom(); + private UnifiedRandom _random = new UnifiedRandom(); private Color[] _waveMask = new Color[1]; private float _frameState; public event Action WaveFilters; - private static Tile[,] Tiles => Main.tile; - - public static void LoadContent() - { - LiquidRenderer.Instance = new LiquidRenderer(); - LiquidRenderer.Instance.PrepareAssets(); - } - - private void PrepareAssets() + public LiquidRenderer() { for (int index = 0; index < this._liquidTextures.Length; ++index) - this._liquidTextures[index] = Main.Assets.Request("Images/Misc/water_" + (object) index, (AssetRequestMode) 1); + this._liquidTextures[index] = TextureManager.Load("Images/Misc/water_" + (object) index); } private unsafe void InternalPrepareDraw(Rectangle drawArea) @@ -92,13 +83,13 @@ namespace Terraria.GameContent.Liquid { for (int y = rectangle.Y; y < rectangle.Y + rectangle.Height; ++y) { - Tile tile = LiquidRenderer.Tiles[x, y] ?? new Tile(); + Tile tile = this._tiles[x, y] ?? new Tile(); liquidCachePtr2->LiquidLevel = (float) tile.liquid / (float) byte.MaxValue; - liquidCachePtr2->IsHalfBrick = tile.halfBrick() && liquidCachePtr2[-1].HasLiquid && !TileID.Sets.Platforms[(int) tile.type]; - liquidCachePtr2->IsSolid = WorldGen.SolidOrSlopedTile(tile); + liquidCachePtr2->IsHalfBrick = tile.halfBrick() && liquidCachePtr2[-1].HasLiquid; + liquidCachePtr2->IsSolid = WorldGen.SolidOrSlopedTile(tile) && !liquidCachePtr2->IsHalfBrick; liquidCachePtr2->HasLiquid = tile.liquid > (byte) 0; liquidCachePtr2->VisibleLiquidLevel = 0.0f; - liquidCachePtr2->HasWall = tile.wall > (ushort) 0; + liquidCachePtr2->HasWall = tile.wall > (byte) 0; liquidCachePtr2->Type = tile.liquidType(); if (liquidCachePtr2->IsHalfBrick && !liquidCachePtr2->HasLiquid) liquidCachePtr2->Type = liquidCachePtr2[-1].Type; @@ -116,16 +107,16 @@ namespace Terraria.GameContent.Liquid num2 = 1f; else if (!liquidCachePtr3->HasLiquid) { - LiquidRenderer.LiquidCache liquidCache1 = liquidCachePtr3[-1]; - LiquidRenderer.LiquidCache liquidCache2 = liquidCachePtr3[1]; - LiquidRenderer.LiquidCache liquidCache3 = liquidCachePtr3[-rectangle.Height]; - LiquidRenderer.LiquidCache liquidCache4 = liquidCachePtr3[rectangle.Height]; - if (liquidCache1.HasLiquid && liquidCache2.HasLiquid && (int) liquidCache1.Type == (int) liquidCache2.Type && !liquidCache1.IsSolid && !liquidCache2.IsSolid) + LiquidRenderer.LiquidCache liquidCache1 = liquidCachePtr3[-rectangle.Height]; + LiquidRenderer.LiquidCache liquidCache2 = liquidCachePtr3[rectangle.Height]; + LiquidRenderer.LiquidCache liquidCache3 = liquidCachePtr3[-1]; + LiquidRenderer.LiquidCache liquidCache4 = liquidCachePtr3[1]; + if (liquidCache1.HasLiquid && liquidCache2.HasLiquid && (int) liquidCache1.Type == (int) liquidCache2.Type) { val1 = liquidCache1.LiquidLevel + liquidCache2.LiquidLevel; liquidCachePtr3->Type = liquidCache1.Type; } - if (liquidCache3.HasLiquid && liquidCache4.HasLiquid && (int) liquidCache3.Type == (int) liquidCache4.Type && !liquidCache3.IsSolid && !liquidCache4.IsSolid) + if (liquidCache3.HasLiquid && liquidCache4.HasLiquid && (int) liquidCache3.Type == (int) liquidCache4.Type) { val1 = Math.Max(val1, liquidCache3.LiquidLevel + liquidCache4.LiquidLevel); liquidCachePtr3->Type = liquidCache3.Type; @@ -145,7 +136,7 @@ namespace Terraria.GameContent.Liquid { for (int index4 = 0; index4 < rectangle.Height - 10; ++index4) { - if (liquidCachePtr4->HasVisibleLiquid && (!liquidCachePtr4->IsSolid || liquidCachePtr4->IsHalfBrick)) + if (liquidCachePtr4->HasVisibleLiquid && !liquidCachePtr4->IsSolid) { liquidCachePtr4->Opacity = 1f; liquidCachePtr4->VisibleType = liquidCachePtr4->Type; @@ -164,7 +155,7 @@ namespace Terraria.GameContent.Liquid break; } } - if (liquidCachePtr4->IsSolid && !liquidCachePtr4->IsHalfBrick) + if (liquidCachePtr4->IsSolid) { liquidCachePtr4->VisibleLiquidLevel = 1f; liquidCachePtr4->HasVisibleLiquid = false; @@ -180,7 +171,7 @@ namespace Terraria.GameContent.Liquid { for (int index7 = 2; index7 < rectangle.Height - 2; ++index7) { - if (!liquidCachePtr5->HasVisibleLiquid) + if (!liquidCachePtr5->HasVisibleLiquid || liquidCachePtr5->IsSolid) { liquidCachePtr5->HasLeftEdge = false; liquidCachePtr5->HasTopEdge = false; @@ -373,9 +364,9 @@ namespace Terraria.GameContent.Liquid float num10 = Math.Max(0.25f, liquidCachePtr9->VisibleRightWall); float num11 = Math.Min(0.75f, liquidCachePtr9->VisibleTopWall); float num12 = Math.Max(0.25f, liquidCachePtr9->VisibleBottomWall); - if (liquidCachePtr9->IsHalfBrick && liquidCachePtr9->IsSolid && (double) num12 > 0.5) + if (liquidCachePtr9->IsHalfBrick && (double) num12 > 0.5) num12 = 0.5f; - liquidDrawCachePtr2->IsVisible = liquidCachePtr9->HasWall || !liquidCachePtr9->IsHalfBrick || !liquidCachePtr9->HasLiquid || (double) liquidCachePtr9->LiquidLevel >= 1.0; + liquidDrawCachePtr2->IsVisible = liquidCachePtr9->HasWall || !liquidCachePtr9->IsHalfBrick || !liquidCachePtr9->HasLiquid; liquidDrawCachePtr2->SourceRectangle = new Rectangle((int) (16.0 - (double) num10 * 16.0) + liquidCachePtr9->FrameOffset.X, (int) (16.0 - (double) num12 * 16.0) + liquidCachePtr9->FrameOffset.Y, (int) Math.Ceiling(((double) num10 - (double) num9) * 16.0), (int) Math.Ceiling(((double) num12 - (double) num11) * 16.0)); liquidDrawCachePtr2->IsSurfaceLiquid = liquidCachePtr9->FrameOffset.X == 16 && liquidCachePtr9->FrameOffset.Y == 0 && (double) (index15 + rectangle.Y) > Main.worldSurface - 40.0; liquidDrawCachePtr2->Opacity = liquidCachePtr9->Opacity; @@ -469,7 +460,7 @@ namespace Terraria.GameContent.Liquid { case 0: index = waterStyle; - val2 *= globalAlpha; + val2 *= isBackgroundDraw ? 1f : globalAlpha; break; case 2: index = 11; @@ -477,13 +468,12 @@ namespace Terraria.GameContent.Liquid } float num = Math.Min(1f, val2); VertexColors vertices; - Lighting.GetCornerColors(x, y, out vertices); + Lighting.GetColor4Slice_New(x, y, out vertices); vertices.BottomLeftColor *= num; vertices.BottomRightColor *= num; vertices.TopLeftColor *= num; vertices.TopRightColor *= num; - Main.DrawTileInWater(drawOffset, x, y); - Main.tileBatch.Draw(this._liquidTextures[index].Value, new Vector2((float) (x << 4), (float) (y << 4)) + drawOffset + liquidOffset, new Rectangle?(sourceRectangle), vertices, Vector2.Zero, 1f, SpriteEffects.None); + Main.tileBatch.Draw(this._liquidTextures[index], new Vector2((float) (x << 4), (float) (y << 4)) + drawOffset + liquidOffset, new Rectangle?(sourceRectangle), vertices, Vector2.Zero, 1f, SpriteEffects.None); } ++liquidDrawCachePtr2; } @@ -516,8 +506,8 @@ namespace Terraria.GameContent.Liquid { if (Main.gamePaused || !Main.hasFocus) return; - float num = Main.windSpeedCurrent * 25f; - this._frameState += ((double) num >= 0.0 ? num + 6f : num - 6f) * (float) gameTime.ElapsedGameTime.TotalSeconds; + float val2 = MathHelper.Clamp(Main.windSpeed * 80f, -20f, 20f); + this._frameState += ((double) val2 >= 0.0 ? Math.Max(10f, val2) : Math.Min(-10f, val2)) * (float) gameTime.ElapsedGameTime.TotalSeconds; if ((double) this._frameState < 0.0) this._frameState += 16f; this._frameState %= 16f; @@ -528,30 +518,22 @@ namespace Terraria.GameContent.Liquid public void SetWaveMaskData(ref Texture2D texture) { - try + if (texture == null || texture.Width < this._drawArea.Height || texture.Height < this._drawArea.Width) { - if (texture == null || texture.Width < this._drawArea.Height || texture.Height < this._drawArea.Width) + Console.WriteLine("WaveMaskData texture recreated. {0}x{1}", (object) this._drawArea.Height, (object) this._drawArea.Width); + if (texture != null) { - Console.WriteLine("WaveMaskData texture recreated. {0}x{1}", (object) this._drawArea.Height, (object) this._drawArea.Width); - if (texture != null) + try + { + texture.Dispose(); + } + catch { - try - { - texture.Dispose(); - } - catch - { - } } - texture = new Texture2D(Main.instance.GraphicsDevice, this._drawArea.Height, this._drawArea.Width, false, SurfaceFormat.Color); } - texture.SetData(0, new Rectangle?(new Rectangle(0, 0, this._drawArea.Height, this._drawArea.Width)), this._waveMask, 0, this._drawArea.Width * this._drawArea.Height); - } - catch - { texture = new Texture2D(Main.instance.GraphicsDevice, this._drawArea.Height, this._drawArea.Width, false, SurfaceFormat.Color); - texture.SetData(0, new Rectangle?(new Rectangle(0, 0, this._drawArea.Height, this._drawArea.Width)), this._waveMask, 0, this._drawArea.Width * this._drawArea.Height); } + texture.SetData(0, new Rectangle?(new Rectangle(0, 0, this._drawArea.Height, this._drawArea.Width)), this._waveMask, 0, this._drawArea.Width * this._drawArea.Height); } public Rectangle GetCachedDrawArea() => this._drawArea; diff --git a/GameContent/LootSimulation/ISimulationConditionSetter.cs b/GameContent/LootSimulation/ISimulationConditionSetter.cs deleted file mode 100644 index 1062c0b..0000000 --- a/GameContent/LootSimulation/ISimulationConditionSetter.cs +++ /dev/null @@ -1,17 +0,0 @@ -// 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); - } -} diff --git a/GameContent/LootSimulation/LootSimulationItemCounter.cs b/GameContent/LootSimulation/LootSimulationItemCounter.cs deleted file mode 100644 index 97668c8..0000000 --- a/GameContent/LootSimulation/LootSimulationItemCounter.cs +++ /dev/null @@ -1,62 +0,0 @@ -// 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) collectionToUse).Select((count, itemId) => new - { - itemId = itemId, - count = count - }).Where(entry => entry.count > 0L).Select(entry => entry.itemId).Select((Func) (itemId => string.Format("new ItemDropInfo(ItemID.{0}, {1}, {2})", (object) ItemID.Search.GetName(itemId), (object) collectionToUse[itemId], (object) totalDropsAttempted)))); - } - } -} diff --git a/GameContent/LootSimulation/LootSimulator.cs b/GameContent/LootSimulation/LootSimulator.cs deleted file mode 100644 index 162ecf5..0000000 --- a/GameContent/LootSimulation/LootSimulator.cs +++ /dev/null @@ -1,121 +0,0 @@ -// 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 _neededTestConditions = new List(); - private int[] _excludedItemIds = new int[0]; - - public LootSimulator() - { - this.FillDesiredTestConditions(); - this.FillItemExclusions(); - } - - private void FillItemExclusions() - { - List intList = new List(); - intList.AddRange(((IEnumerable) ItemID.Sets.IsAPickup).Select((state, index) => new - { - index = index, - state = state - }).Where(tuple => tuple.state).Select(tuple => tuple.index)); - intList.AddRange(((IEnumerable) 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) new List() - { - (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().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) this._excludedItemIds).ToArray()); - 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; - } - } -} diff --git a/GameContent/LootSimulation/LootSimulatorConditionSetterTypes/FastConditionSetter.cs b/GameContent/LootSimulation/LootSimulatorConditionSetterTypes/FastConditionSetter.cs deleted file mode 100644 index 63c1d32..0000000 --- a/GameContent/LootSimulation/LootSimulatorConditionSetterTypes/FastConditionSetter.cs +++ /dev/null @@ -1,38 +0,0 @@ -// 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 _setup; - private Action _tearDown; - - public FastConditionSetter(Action setup, Action 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; - } -} diff --git a/GameContent/LootSimulation/LootSimulatorConditionSetterTypes/LuckyCoinConditionSetter.cs b/GameContent/LootSimulation/LootSimulatorConditionSetterTypes/LuckyCoinConditionSetter.cs deleted file mode 100644 index 41a93db..0000000 --- a/GameContent/LootSimulation/LootSimulatorConditionSetterTypes/LuckyCoinConditionSetter.cs +++ /dev/null @@ -1,35 +0,0 @@ -// 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) - { - } - } -} diff --git a/GameContent/LootSimulation/LootSimulatorConditionSetterTypes/SlimeStaffConditionSetter.cs b/GameContent/LootSimulation/LootSimulatorConditionSetterTypes/SlimeStaffConditionSetter.cs deleted file mode 100644 index f394e02..0000000 --- a/GameContent/LootSimulation/LootSimulatorConditionSetterTypes/SlimeStaffConditionSetter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// 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) - { - } - } -} diff --git a/GameContent/LootSimulation/LootSimulatorConditionSetterTypes/StackedConditionSetter.cs b/GameContent/LootSimulation/LootSimulatorConditionSetterTypes/StackedConditionSetter.cs deleted file mode 100644 index a3969db..0000000 --- a/GameContent/LootSimulation/LootSimulatorConditionSetterTypes/StackedConditionSetter.cs +++ /dev/null @@ -1,29 +0,0 @@ -// 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; - } -} diff --git a/GameContent/LootSimulation/SimulationConditionSetters.cs b/GameContent/LootSimulation/SimulationConditionSetters.cs deleted file mode 100644 index 45bde34..0000000 --- a/GameContent/LootSimulation/SimulationConditionSetters.cs +++ /dev/null @@ -1,82 +0,0 @@ -// 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) (info => Main.hardMode = true), (Action) (info => Main.hardMode = false)); - public static FastConditionSetter ExpertMode = new FastConditionSetter((Action) (info => - { - Main.GameMode = 1; - info.runningExpertMode = true; - }), (Action) (info => - { - Main.GameMode = 0; - info.runningExpertMode = false; - })); - public static FastConditionSetter Eclipse = new FastConditionSetter((Action) (info => Main.eclipse = true), (Action) (info => Main.eclipse = false)); - public static FastConditionSetter BloodMoon = new FastConditionSetter((Action) (info => Main.bloodMoon = true), (Action) (info => Main.bloodMoon = false)); - public static FastConditionSetter SlainMechBosses = new FastConditionSetter((Action) (info => - { - int num; - NPC.downedMechBossAny = (num = 1) != 0; - NPC.downedMechBoss3 = num != 0; - NPC.downedMechBoss2 = num != 0; - NPC.downedMechBoss1 = num != 0; - }), (Action) (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) (info => NPC.downedPlantBoss = true), (Action) (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) (info => Main._shouldUseWindyDayMusic = true), (Action) (info => Main._shouldUseWindyDayMusic = false)); - public static FastConditionSetter MidDay = new FastConditionSetter((Action) (info => - { - Main.dayTime = true; - Main.time = 27000.0; - }), (Action) (info => info.ReturnToOriginalDaytime())); - public static FastConditionSetter MidNight = new FastConditionSetter((Action) (info => - { - Main.dayTime = false; - Main.time = 16200.0; - }), (Action) (info => info.ReturnToOriginalDaytime())); - public static FastConditionSetter SlimeRain = new FastConditionSetter((Action) (info => Main.slimeRain = true), (Action) (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); - } -} diff --git a/GameContent/LootSimulation/SimulatorInfo.cs b/GameContent/LootSimulation/SimulatorInfo.cs deleted file mode 100644 index 585c427..0000000 --- a/GameContent/LootSimulation/SimulatorInfo.cs +++ /dev/null @@ -1,40 +0,0 @@ -// 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; - } -} diff --git a/GameContent/Metadata/MaterialData/Materials.json b/GameContent/Metadata/MaterialData/Materials.json deleted file mode 100644 index 5932025..0000000 --- a/GameContent/Metadata/MaterialData/Materials.json +++ /dev/null @@ -1,128 +0,0 @@ -{ - "Default": { - "GolfPhysics": { - "DirectImpactDampening": 0.95, - "SideImpactDampening": 0.98, - "ClubImpactDampening": 1, - "PassThroughDampening": 1, - "ImpactDampeningResistanceEfficiency": 0 - } - }, - "Dirt": { - "GolfPhysics": { - "DirectImpactDampening": 0.9, - "SideImpactDampening": 0.95, - "ClubImpactDampening": 0.9, - "PassThroughDampening": 1, - "ImpactDampeningResistanceEfficiency": 0.5 - } - }, - "Grass": { - "GolfPhysics": { - "DirectImpactDampening": 0.9, - "SideImpactDampening": 0.95, - "ClubImpactDampening": 1, - "PassThroughDampening": 1, - "ImpactDampeningResistanceEfficiency": 0.5 - } - }, - "Snow": { - "GolfPhysics": { - "DirectImpactDampening": 0.5, - "SideImpactDampening": 0.2, - "ClubImpactDampening": 0.6, - "PassThroughDampening": 1, - "ImpactDampeningResistanceEfficiency": 1 - } - }, - "Wood": { - "GolfPhysics": { - "DirectImpactDampening": 0.94, - "SideImpactDampening": 0.99, - "ClubImpactDampening": 0.99, - "PassThroughDampening": 1, - "ImpactDampeningResistanceEfficiency": 0 - } - }, - "Ice": { - "GolfPhysics": { - "DirectImpactDampening": 0.95, - "SideImpactDampening": 1.0, - "ClubImpactDampening": 0.99, - "PassThroughDampening": 1, - "ImpactDampeningResistanceEfficiency": 0 - } - }, - "Sand": { - "GolfPhysics": { - "DirectImpactDampening": 0.3, - "SideImpactDampening": 0.2, - "ClubImpactDampening": 0.4, - "PassThroughDampening": 1, - "ImpactDampeningResistanceEfficiency": 1 - } - }, - "PinkSlime": { - "GolfPhysics": { - "DirectImpactDampening": 1, - "SideImpactDampening": 1, - "ClubImpactDampening": 1, - "PassThroughDampening": 1, - "ImpactDampeningResistanceEfficiency": 0 - } - }, - "Organic": { - "GolfPhysics": { - "DirectImpactDampening": 0.7, - "SideImpactDampening": 0.4, - "ClubImpactDampening": 0.8, - "PassThroughDampening": 1, - "ImpactDampeningResistanceEfficiency": 0.5 - } - }, - "Sticky": { - "GolfPhysics": { - "DirectImpactDampening": 0.1, - "SideImpactDampening": 0.1, - "ClubImpactDampening": 0.2, - "PassThroughDampening": 1, - "ImpactDampeningResistanceEfficiency": 0.5 - } - }, - "Plant": { - "GolfPhysics": { - "DirectImpactDampening": 0.98, - "SideImpactDampening": 0.98, - "ClubImpactDampening": 0.98, - "PassThroughDampening": 0.99, - "ImpactDampeningResistanceEfficiency": 0.5 - } - }, - "Web": { - "GolfPhysics": { - "DirectImpactDampening": 0.98, - "SideImpactDampening": 0.98, - "ClubImpactDampening": 0.98, - "PassThroughDampening": 0.95, - "ImpactDampeningResistanceEfficiency": 0.5 - } - }, - "GolfGrass": { - "GolfPhysics": { - "DirectImpactDampening": 0.9, - "SideImpactDampening": 0.98, - "ClubImpactDampening": 1.5, - "PassThroughDampening": 1, - "ImpactDampeningResistanceEfficiency": 0 - } - }, - "GolfTee": { - "GolfPhysics": { - "DirectImpactDampening": 0.9, - "SideImpactDampening": 0.98, - "ClubImpactDampening": 1.8, - "PassThroughDampening": 1, - "ImpactDampeningResistanceEfficiency": 0 - } - } -} \ No newline at end of file diff --git a/GameContent/Metadata/MaterialData/Tiles.json b/GameContent/Metadata/MaterialData/Tiles.json deleted file mode 100644 index 5a405e3..0000000 --- a/GameContent/Metadata/MaterialData/Tiles.json +++ /dev/null @@ -1,624 +0,0 @@ -{ - "Dirt": "Dirt", - "Stone": "Default", - "Grass": "Grass", - "Plants": "Plant", - "Torches": "Default", - "Trees": "Default", - "Iron": "Default", - "Copper": "Default", - "Gold": "Default", - "Silver": "Default", - "ClosedDoor": "Default", - "OpenDoor": "Default", - "Heart": "Default", - "Bottles": "Default", - "Tables": "Default", - "Chairs": "Default", - "Anvils": "Default", - "Furnaces": "Default", - "WorkBenches": "Default", - "Platforms": "Default", - "Saplings": "Plant", - "Containers": "Default", - "Demonite": "Default", - "CorruptGrass": "Plant", - "CorruptPlants": "Plant", - "Ebonstone": "Default", - "DemonAltar": "Default", - "Sunflower": "Plant", - "Pots": "Default", - "PiggyBank": "Default", - "WoodBlock": "Wood", - "ShadowOrbs": "Default", - "CorruptThorns": "Plant", - "Candles": "Default", - "Chandeliers": "Default", - "Jackolanterns": "Default", - "Presents": "Default", - "Meteorite": "Default", - "GrayBrick": "Default", - "RedBrick": "Default", - "ClayBlock": "Default", - "BlueDungeonBrick": "Default", - "HangingLanterns": "Default", - "GreenDungeonBrick": "Default", - "PinkDungeonBrick": "Default", - "GoldBrick": "Default", - "SilverBrick": "Default", - "CopperBrick": "Default", - "Spikes": "Default", - "WaterCandle": "Default", - "Books": "Default", - "Cobweb": "Web", - "Vines": "Plant", - "Sand": "Sand", - "Glass": "Default", - "Signs": "Default", - "Obsidian": "Default", - "Ash": "Default", - "Hellstone": "Default", - "Mud": "Organic", - "JungleGrass": "Grass", - "JunglePlants": "Plant", - "JungleVines": "Plant", - "Sapphire": "Default", - "Ruby": "Default", - "Emerald": "Default", - "Topaz": "Default", - "Amethyst": "Default", - "Diamond": "Default", - "JungleThorns": "Plant", - "MushroomGrass": "Grass", - "MushroomPlants": "Plant", - "MushroomTrees": "Default", - "Plants2": "Plant", - "JunglePlants2": "Plant", - "ObsidianBrick": "Default", - "HellstoneBrick": "Default", - "Hellforge": "Default", - "ClayPot": "Default", - "Beds": "Default", - "Cactus": "Default", - "Coral": "Default", - "ImmatureHerbs": "Plant", - "MatureHerbs": "Plant", - "BloomingHerbs": "Plant", - "Tombstones": "Default", - "Loom": "Default", - "Pianos": "Default", - "Dressers": "Default", - "Benches": "Default", - "Bathtubs": "Default", - "Banners": "Default", - "Lampposts": "Default", - "Lamps": "Default", - "Kegs": "Default", - "ChineseLanterns": "Default", - "CookingPots": "Default", - "Safes": "Default", - "SkullLanterns": "Default", - "TrashCan": "Default", - "Candelabras": "Default", - "Bookcases": "Default", - "Thrones": "Default", - "Bowls": "Default", - "GrandfatherClocks": "Default", - "Statues": "Default", - "Sawmill": "Default", - "Cobalt": "Default", - "Mythril": "Default", - "HallowedGrass": "Grass", - "HallowedPlants": "Plant", - "Adamantite": "Default", - "Ebonsand": "Sand", - "HallowedPlants2": "Plant", - "TinkerersWorkbench": "Default", - "HallowedVines": "Plant", - "Pearlsand": "Sand", - "Pearlstone": "Default", - "PearlstoneBrick": "Default", - "IridescentBrick": "Default", - "Mudstone": "Default", - "CobaltBrick": "Default", - "MythrilBrick": "Default", - "Silt": "Sand", - "WoodenBeam": "Wood", - "CrystalBall": "Default", - "DiscoBall": "Default", - "MagicalIceBlock": "Ice", - "Mannequin": "Default", - "Crystals": "Default", - "ActiveStoneBlock": "Default", - "InactiveStoneBlock": "Default", - "Lever": "Default", - "AdamantiteForge": "Default", - "MythrilAnvil": "Default", - "PressurePlates": "Default", - "Switches": "Default", - "Traps": "Default", - "Boulder": "Default", - "MusicBoxes": "Default", - "DemoniteBrick": "Default", - "Explosives": "Default", - "InletPump": "Default", - "OutletPump": "Default", - "Timers": "Default", - "CandyCaneBlock": "Default", - "GreenCandyCaneBlock": "Default", - "SnowBlock": "Snow", - "SnowBrick": "Default", - "HolidayLights": "Default", - "AdamantiteBeam": "Default", - "SandstoneBrick": "Default", - "EbonstoneBrick": "Default", - "RedStucco": "Default", - "YellowStucco": "Default", - "GreenStucco": "Default", - "GrayStucco": "Default", - "Ebonwood": "Wood", - "RichMahogany": "Default", - "Pearlwood": "Wood", - "RainbowBrick": "Default", - "IceBlock": "Ice", - "BreakableIce": "Ice", - "CorruptIce": "Ice", - "HallowedIce": "Ice", - "Stalactite": "Default", - "Tin": "Default", - "Lead": "Default", - "Tungsten": "Default", - "Platinum": "Default", - "PineTree": "Default", - "ChristmasTree": "Default", - "Sinks": "Default", - "PlatinumCandelabra": "Default", - "PlatinumCandle": "Default", - "TinBrick": "Default", - "TungstenBrick": "Default", - "PlatinumBrick": "Default", - "ExposedGems": "Default", - "GreenMoss": "Grass", - "BrownMoss": "Grass", - "RedMoss": "Grass", - "BlueMoss": "Grass", - "PurpleMoss": "Grass", - "LongMoss": "Plant", - "SmallPiles": "Default", - "LargePiles": "Default", - "LargePiles2": "Default", - "CactusBlock": "Organic", - "Cloud": "Sand", - "MushroomBlock": "Organic", - "LivingWood": "Wood", - "LeafBlock": "Sand", - "SlimeBlock": "Organic", - "BoneBlock": "Default", - "FleshBlock": "Organic", - "RainCloud": "Sand", - "FrozenSlimeBlock": "Ice", - "Asphalt": "Default", - "CrimsonGrass": "Grass", - "FleshIce": "Ice", - "CrimsonPlants": "Plant", - "Sunplate": "Default", - "Crimstone": "Default", - "Crimtane": "Default", - "CrimsonVines": "Plant", - "IceBrick": "Ice", - "WaterFountain": "Default", - "Shadewood": "Wood", - "Cannon": "Default", - "LandMine": "Default", - "Chlorophyte": "Default", - "SnowballLauncher": "Default", - "Rope": "Default", - "Chain": "Default", - "Campfire": "Default", - "Firework": "Default", - "Blendomatic": "Default", - "MeatGrinder": "Default", - "Extractinator": "Default", - "Solidifier": "Default", - "Palladium": "Default", - "Orichalcum": "Default", - "Titanium": "Default", - "Slush": "Sand", - "Hive": "Organic", - "LihzahrdBrick": "Default", - "DyePlants": "Plant", - "DyeVat": "Default", - "HoneyBlock": "Sticky", - "CrispyHoneyBlock": "Organic", - "Larva": "Default", - "WoodenSpikes": "Wood", - "PlantDetritus": "Default", - "Crimsand": "Sand", - "Teleporter": "Default", - "LifeFruit": "Plant", - "LihzahrdAltar": "Default", - "PlanteraBulb": "Plant", - "MetalBars": "Default", - "Painting3X3": "Default", - "Painting4X3": "Default", - "Painting6X4": "Default", - "ImbuingStation": "Default", - "BubbleMachine": "Default", - "Painting2X3": "Default", - "Painting3X2": "Default", - "Autohammer": "Default", - "PalladiumColumn": "Default", - "BubblegumBlock": "Sticky", - "Titanstone": "Default", - "PumpkinBlock": "Organic", - "HayBlock": "Snow", - "SpookyWood": "Wood", - "Pumpkins": "Default", - "AmethystGemsparkOff": "Default", - "TopazGemsparkOff": "Default", - "SapphireGemsparkOff": "Default", - "EmeraldGemsparkOff": "Default", - "RubyGemsparkOff": "Default", - "DiamondGemsparkOff": "Default", - "AmberGemsparkOff": "Default", - "AmethystGemspark": "Default", - "TopazGemspark": "Default", - "SapphireGemspark": "Default", - "EmeraldGemspark": "Default", - "RubyGemspark": "Default", - "DiamondGemspark": "Default", - "AmberGemspark": "Default", - "Womannequin": "Default", - "FireflyinaBottle": "Default", - "LightningBuginaBottle": "Default", - "Cog": "Default", - "StoneSlab": "Default", - "SandStoneSlab": "Default", - "BunnyCage": "Default", - "SquirrelCage": "Default", - "MallardDuckCage": "Default", - "DuckCage": "Default", - "BirdCage": "Default", - "BlueJay": "Default", - "CardinalCage": "Default", - "FishBowl": "Default", - "HeavyWorkBench": "Default", - "CopperPlating": "Default", - "SnailCage": "Default", - "GlowingSnailCage": "Default", - "AmmoBox": "Default", - "MonarchButterflyJar": "Default", - "PurpleEmperorButterflyJar": "Default", - "RedAdmiralButterflyJar": "Default", - "UlyssesButterflyJar": "Default", - "SulphurButterflyJar": "Default", - "TreeNymphButterflyJar": "Default", - "ZebraSwallowtailButterflyJar": "Default", - "JuliaButterflyJar": "Default", - "ScorpionCage": "Default", - "BlackScorpionCage": "Default", - "FrogCage": "Default", - "MouseCage": "Default", - "BoneWelder": "Default", - "FleshCloningVat": "Default", - "GlassKiln": "Default", - "LihzahrdFurnace": "Default", - "LivingLoom": "Default", - "SkyMill": "Default", - "IceMachine": "Default", - "SteampunkBoiler": "Default", - "HoneyDispenser": "Default", - "PenguinCage": "Default", - "WormCage": "Default", - "DynastyWood": "Wood", - "RedDynastyShingles": "Default", - "BlueDynastyShingles": "Default", - "MinecartTrack": "Default", - "Coralstone": "Default", - "BlueJellyfishBowl": "Default", - "GreenJellyfishBowl": "Default", - "PinkJellyfishBowl": "Default", - "ShipInABottle": "Default", - "SeaweedPlanter": "Default", - "BorealWood": "Wood", - "PalmWood": "Wood", - "PalmTree": "Default", - "BeachPiles": "Default", - "TinPlating": "Default", - "Waterfall": "Default", - "Lavafall": "Default", - "Confetti": "Default", - "ConfettiBlack": "Default", - "CopperCoinPile": "Default", - "SilverCoinPile": "Default", - "GoldCoinPile": "Default", - "PlatinumCoinPile": "Default", - "WeaponsRack": "Default", - "FireworksBox": "Default", - "LivingFire": "Default", - "AlphabetStatues": "Default", - "FireworkFountain": "Default", - "GrasshopperCage": "Default", - "LivingCursedFire": "Default", - "LivingDemonFire": "Default", - "LivingFrostFire": "Default", - "LivingIchor": "Default", - "LivingUltrabrightFire": "Default", - "Honeyfall": "Default", - "ChlorophyteBrick": "Default", - "CrimtaneBrick": "Default", - "ShroomitePlating": "Default", - "MushroomStatue": "Default", - "MartianConduitPlating": "Default", - "ChimneySmoke": "Default", - "CrimsonThorns": "Plant", - "VineRope": "Default", - "BewitchingTable": "Default", - "AlchemyTable": "Default", - "Sundial": "Default", - "MarbleBlock": "Default", - "GoldBirdCage": "Default", - "GoldBunnyCage": "Default", - "GoldButterflyCage": "Default", - "GoldFrogCage": "Default", - "GoldGrasshopperCage": "Default", - "GoldMouseCage": "Default", - "GoldWormCage": "Default", - "SilkRope": "Default", - "WebRope": "Default", - "Marble": "Default", - "Granite": "Default", - "GraniteBlock": "Default", - "MeteoriteBrick": "Default", - "PinkSlimeBlock": "PinkSlime", - "PeaceCandle": "Default", - "WaterDrip": "Default", - "LavaDrip": "Default", - "HoneyDrip": "Default", - "FishingCrate": "Default", - "SharpeningStation": "Default", - "TargetDummy": "Default", - "Bubble": "Default", - "PlanterBox": "Default", - "LavaMoss": "Grass", - "VineFlowers": "Plant", - "LivingMahogany": "Wood", - "LivingMahoganyLeaves": "Sand", - "CrystalBlock": "Default", - "TrapdoorOpen": "Default", - "TrapdoorClosed": "Default", - "TallGateClosed": "Default", - "TallGateOpen": "Default", - "LavaLamp": "Default", - "CageEnchantedNightcrawler": "Default", - "CageBuggy": "Default", - "CageGrubby": "Default", - "CageSluggy": "Default", - "ItemFrame": "Default", - "Sandstone": "Default", - "HardenedSand": "Default", - "CorruptHardenedSand": "Default", - "CrimsonHardenedSand": "Default", - "CorruptSandstone": "Default", - "CrimsonSandstone": "Default", - "HallowHardenedSand": "Default", - "HallowSandstone": "Default", - "DesertFossil": "Default", - "Fireplace": "Default", - "Chimney": "Default", - "FossilOre": "Default", - "LunarOre": "Default", - "LunarBrick": "Default", - "LunarMonolith": "Default", - "Detonator": "Default", - "LunarCraftingStation": "Default", - "SquirrelOrangeCage": "Default", - "SquirrelGoldCage": "Default", - "LunarBlockSolar": "Default", - "LunarBlockVortex": "Default", - "LunarBlockNebula": "Default", - "LunarBlockStardust": "Default", - "LogicGateLamp": "Default", - "LogicGate": "Default", - "ConveyorBeltLeft": "Default", - "ConveyorBeltRight": "Default", - "LogicSensor": "Default", - "WirePipe": "Default", - "AnnouncementBox": "Default", - "TeamBlockRed": "Default", - "TeamBlockRedPlatform": "Default", - "WeightedPressurePlate": "Default", - "WireBulb": "Default", - "TeamBlockGreen": "Default", - "TeamBlockBlue": "Default", - "TeamBlockYellow": "Default", - "TeamBlockPink": "Default", - "TeamBlockWhite": "Default", - "TeamBlockGreenPlatform": "Default", - "TeamBlockBluePlatform": "Default", - "TeamBlockYellowPlatform": "Default", - "TeamBlockPinkPlatform": "Default", - "TeamBlockWhitePlatform": "Default", - "GemLocks": "Default", - "FakeContainers": "Default", - "ProjectilePressurePad": "Default", - "GeyserTrap": "Default", - "BeeHive": "Default", - "PixelBox": "Default", - "SillyBalloonPink": "PinkSlime", - "SillyBalloonPurple": "PinkSlime", - "SillyBalloonGreen": "PinkSlime", - "SillyStreamerBlue": "Default", - "SillyStreamerGreen": "Default", - "SillyStreamerPink": "Default", - "SillyBalloonMachine": "Default", - "SillyBalloonTile": "Default", - "Pigronata": "Default", - "PartyMonolith": "Default", - "PartyBundleOfBalloonTile": "Default", - "PartyPresent": "Default", - "SandFallBlock": "Default", - "SnowFallBlock": "Default", - "SnowCloud": "Sand", - "SandDrip": "Default", - "DjinnLamp": "Default", - "DefendersForge": "Default", - "WarTable": "Default", - "WarTableBanner": "Default", - "ElderCrystalStand": "Default", - "Containers2": "Default", - "FakeContainers2": "Default", - "Tables2": "Default", - "DisplayDoll": "Default", - "WeaponsRack2": "Default", - "IronBrick": "Default", - "LeadBrick": "Default", - "LesionBlock": "Organic", - "HatRack": "Default", - "GolfGrass": "GolfGrass", - "CrimstoneBrick": "Default", - "SmoothSandstone": "Default", - "BloodMoonMonolith": "Default", - "CrackedBlueDungeonBrick": "Default", - "CrackedGreenDungeonBrick": "Default", - "CrackedPinkDungeonBrick": "Default", - "RollingCactus": "Plant", - "AntlionLarva": "Plant", - "DrumSet": "Default", - "PicnicTable": "Default", - "FallenLog": "Default", - "PinWheel": "Default", - "WeatherVane": "Default", - "VoidVault": "Default", - "GolfGrassHallowed": "GolfGrass", - "GolfCupFlag": "Default", - "ShellPile": "Organic", - "AntiPortalBlock": "Default", - "Toilets": "Default", - "Spider": "Organic", - "LesionStation": "Default", - "SolarBrick": "Default", - "VortexBrick": "Default", - "NebulaBrick": "Default", - "StardustBrick": "Default", - "GolfTee": "GolfTee", - "MysticSnakeRope": "Default", - "GoldGoldfishBowl": "Default", - "CatBast": "Default", - "GoldStarryGlassBlock": "Default", - "BlueStarryGlassBlock": "Default", - "VoidMonolith": "Default", - "ArrowSign": "Default", - "PaintedArrowSign": "Default", - "GreenMossBrick": "Grass", - "BrownMossBrick": "Grass", - "RedMossBrick": "Grass", - "BlueMossBrick": "Grass", - "PurpleMossBrick": "Grass", - "LavaMossBrick": "Grass", - "LilyPad": "Default", - "Cattail": "Plant", - "FoodPlatter": "Default", - "BlackDragonflyJar": "Default", - "BlueDragonflyJar": "Default", - "GreenDragonflyJar": "Default", - "OrangeDragonflyJar": "Default", - "RedDragonflyJar": "Default", - "YellowDragonflyJar": "Default", - "GoldDragonflyJar": "Default", - "MushroomVines": "Plant", - "SeaOats": "Plant", - "OasisPlants": "Plant", - "BoulderStatue": "Default", - "MaggotCage": "Default", - "RatCage": "Default", - "KryptonMoss": "Grass", - "KryptonMossBrick": "Grass", - "XenonMoss": "Grass", - "XenonMossBrick": "Grass", - "LadybugCage": "Default", - "ArgonMoss": "Grass", - "ArgonMossBrick": "Grass", - "EchoBlock": "Default", - "OwlCage": "Default", - "PupfishBowl": "Default", - "GoldLadybugCage": "Default", - "LawnFlamingo": "Default", - "Grate": "Default", - "PottedPlants1": "Default", - "PottedPlants2": "Default", - "Seaweed": "Plant", - "TurtleCage": "Default", - "TurtleJungleCage": "Default", - "Sandcastles": "Default", - "GrebeCage": "Default", - "SeagullCage": "Default", - "WaterStriderCage": "Default", - "GoldWaterStriderCage": "Default", - "GrateClosed": "Default", - "SeahorseCage": "Default", - "GoldSeahorseCage": "Default", - "GolfTrophies": "Default", - "MarbleColumn": "Default", - "BambooBlock": "Wood", - "LargeBambooBlock": "Wood", - "PlasmaLamp": "Default", - "FogMachine": "Default", - "AmberStoneBlock": "Default", - "GardenGnome": "Default", - "PinkFairyJar": "Default", - "GreenFairyJar": "Default", - "BlueFairyJar": "Default", - "Bamboo": "Plant", - "SoulBottles": "Default", - "TatteredWoodSign": "Default", - "BorealBeam": "Default", - "RichMahoganyBeam": "Default", - "GraniteColumn": "Default", - "SandstoneColumn": "Default", - "MushroomBeam": "Default", - "RockGolemHead": "Default", - "HellButterflyJar": "Default", - "LavaflyinaBottle": "Default", - "MagmaSnailCage": "Default", - "TreeTopaz": "Default", - "TreeAmethyst": "Default", - "TreeSapphire": "Default", - "TreeEmerald": "Default", - "TreeRuby": "Default", - "TreeDiamond": "Default", - "TreeAmber": "Default", - "GemSaplings": "Plant", - "PotsSuspended": "Default", - "BrazierSuspended": "Default", - "VolcanoSmall": "Default", - "VolcanoLarge": "Default", - "VanityTreeSakuraSaplings": "Plant", - "VanityTreeSakura": "Default", - "TeleportationPylon": "Default", - "LavafishBowl": "Default", - "AmethystBunnyCage": "Default", - "TopazBunnyCage": "Default", - "SapphireBunnyCage": "Default", - "EmeraldBunnyCage": "Default", - "RubyBunnyCage": "Default", - "DiamondBunnyCage": "Default", - "AmberBunnyCage": "Default", - "AmethystSquirrelCage": "Default", - "TopazSquirrelCage": "Default", - "SapphireSquirrelCage": "Default", - "EmeraldSquirrelCage": "Default", - "RubySquirrelCage": "Default", - "DiamondSquirrelCage": "Default", - "AmberSquirrelCage": "Default", - "PottedLavaPlants": "Default", - "PottedLavaPlantTendrils": "Default", - "VanityTreeWillowSaplings": "Plant", - "VanityTreeYellowWillow": "Default", - "MasterTrophyBase": "Default", - "AccentSlab": "Default", - "TruffleWormCage": "Default", - "EmpressButterflyJar": "Default", - "SliceOfCake": "Default", - "TeaKettle": "Default" -} \ No newline at end of file diff --git a/GameContent/Metadata/TileGolfPhysics.cs b/GameContent/Metadata/TileGolfPhysics.cs deleted file mode 100644 index 71f312b..0000000 --- a/GameContent/Metadata/TileGolfPhysics.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Metadata.TileGolfPhysics -// 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 Newtonsoft.Json; - -namespace Terraria.GameContent.Metadata -{ - public class TileGolfPhysics - { - [JsonProperty] - public float DirectImpactDampening { get; private set; } - - [JsonProperty] - public float SideImpactDampening { get; private set; } - - [JsonProperty] - public float ClubImpactDampening { get; private set; } - - [JsonProperty] - public float PassThroughDampening { get; private set; } - - [JsonProperty] - public float ImpactDampeningResistanceEfficiency { get; private set; } - } -} diff --git a/GameContent/Metadata/TileMaterial.cs b/GameContent/Metadata/TileMaterial.cs deleted file mode 100644 index 737ba54..0000000 --- a/GameContent/Metadata/TileMaterial.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Metadata.TileMaterial -// 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 Newtonsoft.Json; - -namespace Terraria.GameContent.Metadata -{ - public class TileMaterial - { - [JsonProperty] - public TileGolfPhysics GolfPhysics { get; private set; } - } -} diff --git a/GameContent/Metadata/TileMaterials.cs b/GameContent/Metadata/TileMaterials.cs deleted file mode 100644 index 8c27f05..0000000 --- a/GameContent/Metadata/TileMaterials.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Metadata.TileMaterials -// 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 Newtonsoft.Json; -using System.Collections.Generic; -using System.IO; -using System.Reflection; -using Terraria.ID; - -namespace Terraria.GameContent.Metadata -{ - public static class TileMaterials - { - private static Dictionary _materialsByName; - private static readonly TileMaterial[] MaterialsByTileId = new TileMaterial[623]; - - static TileMaterials() - { - TileMaterials._materialsByName = TileMaterials.DeserializeEmbeddedResource>("Terraria.GameContent.Metadata.MaterialData.Materials.json"); - TileMaterial tileMaterial = TileMaterials._materialsByName["Default"]; - for (int index = 0; index < TileMaterials.MaterialsByTileId.Length; ++index) - TileMaterials.MaterialsByTileId[index] = tileMaterial; - foreach (KeyValuePair keyValuePair in TileMaterials.DeserializeEmbeddedResource>("Terraria.GameContent.Metadata.MaterialData.Tiles.json")) - { - string key1 = keyValuePair.Key; - string key2 = keyValuePair.Value; - TileMaterials.SetForTileId((ushort) TileID.Search.GetId(key1), TileMaterials._materialsByName[key2]); - } - } - - private static T DeserializeEmbeddedResource(string path) - { - using (Stream manifestResourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(path)) - { - using (StreamReader streamReader = new StreamReader(manifestResourceStream)) - return JsonConvert.DeserializeObject(streamReader.ReadToEnd()); - } - } - - public static void SetForTileId(ushort tileId, TileMaterial material) => TileMaterials.MaterialsByTileId[(int) tileId] = material; - - public static TileMaterial GetByTileId(ushort tileId) => TileMaterials.MaterialsByTileId[(int) tileId]; - } -} diff --git a/GameContent/MinecartDiggerHelper.cs b/GameContent/MinecartDiggerHelper.cs deleted file mode 100644 index 356deef..0000000 --- a/GameContent/MinecartDiggerHelper.cs +++ /dev/null @@ -1,187 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.MinecartDiggerHelper -// 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; -using Terraria.GameContent.Achievements; -using Terraria.ID; - -namespace Terraria.GameContent -{ - public class MinecartDiggerHelper - { - public static MinecartDiggerHelper Instance = new MinecartDiggerHelper(); - - public void TryDigging( - Player player, - Vector2 trackWorldPosition, - int digDirectionX, - int digDirectionY) - { - digDirectionY = 0; - Point tileCoordinates = trackWorldPosition.ToTileCoordinates(); - if (Framing.GetTileSafely(tileCoordinates).type != (ushort) 314 || (double) tileCoordinates.Y < Main.worldSurface) - return; - Point point1 = tileCoordinates; - point1.X += digDirectionX; - point1.Y += digDirectionY; - if (this.AlreadyLeadsIntoWantedTrack(tileCoordinates, point1) || digDirectionY == 0 && (this.AlreadyLeadsIntoWantedTrack(tileCoordinates, new Point(point1.X, point1.Y - 1)) || this.AlreadyLeadsIntoWantedTrack(tileCoordinates, new Point(point1.X, point1.Y + 1)))) - return; - int num = 5; - if (digDirectionY != 0) - num = 5; - Point point2 = point1; - Point point3 = point2; - point3.Y -= num - 1; - int x1 = point3.X; - for (int y = point3.Y; y <= point2.Y; ++y) - { - if (!this.CanGetPastTile(x1, y) || !this.HasPickPower(player, x1, y)) - return; - } - if (!this.CanConsumeATrackItem(player)) - return; - int x2 = point3.X; - for (int y = point3.Y; y <= point2.Y; ++y) - this.MineTheTileIfNecessary(x2, y); - this.ConsumeATrackItem(player); - this.PlaceATrack(point1.X, point1.Y); - player.velocity.X = MathHelper.Clamp(player.velocity.X, -1f, 1f); - if (this.DoTheTracksConnectProperly(tileCoordinates, point1)) - return; - this.CorrectTrackConnections(tileCoordinates, point1); - } - - private bool CanConsumeATrackItem(Player player) => this.FindMinecartTrackItem(player) != null; - - private void ConsumeATrackItem(Player player) - { - Item minecartTrackItem = this.FindMinecartTrackItem(player); - --minecartTrackItem.stack; - if (minecartTrackItem.stack != 0) - return; - minecartTrackItem.TurnToAir(); - } - - private Item FindMinecartTrackItem(Player player) - { - Item obj1 = (Item) null; - for (int index = 0; index < 58; ++index) - { - if (player.selectedItem != index || player.itemAnimation <= 0 && player.reuseDelay <= 0 && player.itemTime <= 0) - { - Item obj2 = player.inventory[index]; - if (obj2.type == 2340 && obj2.stack > 0) - { - obj1 = obj2; - break; - } - } - } - return obj1; - } - - private void PoundTrack(Point spot) - { - if (Main.tile[spot.X, spot.Y].type != (ushort) 314 || !Minecart.FrameTrack(spot.X, spot.Y, true) || Main.netMode != 1) - return; - NetMessage.SendData(17, number: 15, number2: ((float) spot.X), number3: ((float) spot.Y), number4: 1f); - } - - private bool AlreadyLeadsIntoWantedTrack( - Point tileCoordsOfFrontWheel, - Point tileCoordsWeWantToReach) - { - Tile tileSafely1 = Framing.GetTileSafely(tileCoordsOfFrontWheel); - Tile tileSafely2 = Framing.GetTileSafely(tileCoordsWeWantToReach); - if (!tileSafely1.active() || tileSafely1.type != (ushort) 314 || !tileSafely2.active() || tileSafely2.type != (ushort) 314) - return false; - int? expectedStartLeft; - int? expectedStartRight; - int? expectedEndLeft; - int? expectedEndRight; - MinecartDiggerHelper.GetExpectedDirections(tileCoordsOfFrontWheel, tileCoordsWeWantToReach, out expectedStartLeft, out expectedStartRight, out expectedEndLeft, out expectedEndRight); - return Minecart.GetAreExpectationsForSidesMet(tileCoordsOfFrontWheel, expectedStartLeft, expectedStartRight) && Minecart.GetAreExpectationsForSidesMet(tileCoordsWeWantToReach, expectedEndLeft, expectedEndRight); - } - - private static void GetExpectedDirections( - Point startCoords, - Point endCoords, - out int? expectedStartLeft, - out int? expectedStartRight, - out int? expectedEndLeft, - out int? expectedEndRight) - { - int num1 = endCoords.Y - startCoords.Y; - int num2 = endCoords.X - startCoords.X; - expectedStartLeft = new int?(); - expectedStartRight = new int?(); - expectedEndLeft = new int?(); - expectedEndRight = new int?(); - if (num2 == -1) - { - expectedStartLeft = new int?(num1); - expectedEndRight = new int?(-num1); - } - if (num2 != 1) - return; - expectedStartRight = new int?(num1); - expectedEndLeft = new int?(-num1); - } - - private bool DoTheTracksConnectProperly( - Point tileCoordsOfFrontWheel, - Point tileCoordsWeWantToReach) - { - return this.AlreadyLeadsIntoWantedTrack(tileCoordsOfFrontWheel, tileCoordsWeWantToReach); - } - - private void CorrectTrackConnections(Point startCoords, Point endCoords) - { - int? expectedStartLeft; - int? expectedStartRight; - int? expectedEndLeft; - int? expectedEndRight; - MinecartDiggerHelper.GetExpectedDirections(startCoords, endCoords, out expectedStartLeft, out expectedStartRight, out expectedEndLeft, out expectedEndRight); - Tile tileSafely1 = Framing.GetTileSafely(startCoords); - Tile tileSafely2 = Framing.GetTileSafely(endCoords); - if (tileSafely1.active() && tileSafely1.type == (ushort) 314) - Minecart.TryFittingTileOrientation(startCoords, expectedStartLeft, expectedStartRight); - if (!tileSafely2.active() || tileSafely2.type != (ushort) 314) - return; - Minecart.TryFittingTileOrientation(endCoords, expectedEndLeft, expectedEndRight); - } - - private bool HasPickPower(Player player, int x, int y) => player.HasEnoughPickPowerToHurtTile(x, y); - - private bool CanGetPastTile(int x, int y) - { - if (WorldGen.CheckTileBreakability(x, y) != 0) - return false; - Tile tile = Main.tile[x, y]; - return (!tile.active() || !TileID.Sets.Falling[(int) tile.type]) && (!tile.active() || WorldGen.CanKillTile(x, y)); - } - - private void PlaceATrack(int x, int y) - { - int Type = 314; - int num = 0; - if (!WorldGen.PlaceTile(x, y, Type, plr: Main.myPlayer, style: num)) - return; - NetMessage.SendData(17, number: 1, number2: ((float) x), number3: ((float) y), number4: ((float) Type), number5: num); - } - - private void MineTheTileIfNecessary(int x, int y) - { - AchievementsHelper.CurrentlyMining = true; - if (Main.tile[x, y].active()) - { - WorldGen.KillTile(x, y); - NetMessage.SendData(17, number2: ((float) x), number3: ((float) y)); - } - AchievementsHelper.CurrentlyMining = false; - } - } -} diff --git a/GameContent/NPCHeadDrawRenderTargetContent.cs b/GameContent/NPCHeadDrawRenderTargetContent.cs deleted file mode 100644 index 7c13caf..0000000 --- a/GameContent/NPCHeadDrawRenderTargetContent.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.NPCHeadDrawRenderTargetContent -// 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; -using Microsoft.Xna.Framework.Graphics; - -namespace Terraria.GameContent -{ - public class NPCHeadDrawRenderTargetContent : AnOutlinedDrawRenderTargetContent - { - private Texture2D _theTexture; - - public void SetTexture(Texture2D texture) - { - if (this._theTexture == texture) - return; - this._theTexture = texture; - this._wasPrepared = false; - this.width = texture.Width + 8; - this.height = texture.Height + 8; - } - - internal override void DrawTheContent(SpriteBatch spriteBatch) => spriteBatch.Draw(this._theTexture, new Vector2(4f, 4f), new Rectangle?(), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - } -} diff --git a/GameContent/NetModules/NetAmbienceModule.cs b/GameContent/NetModules/NetAmbienceModule.cs deleted file mode 100644 index cf8292e..0000000 --- a/GameContent/NetModules/NetAmbienceModule.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.NetModules.NetAmbienceModule -// 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.IO; -using Terraria.GameContent.Ambience; -using Terraria.GameContent.Skies; -using Terraria.Graphics.Effects; -using Terraria.Net; - -namespace Terraria.GameContent.NetModules -{ - public class NetAmbienceModule : NetModule - { - public static NetPacket SerializeSkyEntitySpawn(Player player, SkyEntityType type) - { - int num = Main.rand.Next(); - NetPacket packet = NetModule.CreatePacket(6); - packet.Writer.Write((byte) player.whoAmI); - packet.Writer.Write(num); - packet.Writer.Write((byte) type); - return packet; - } - - public override bool Deserialize(BinaryReader reader, int userId) - { - byte playerId = reader.ReadByte(); - int seed = reader.ReadInt32(); - SkyEntityType type = (SkyEntityType) reader.ReadByte(); - Main.QueueMainThreadAction((Action) (() => ((AmbientSky) SkyManager.Instance["Ambience"]).Spawn(Main.player[(int) playerId], type, seed))); - return true; - } - } -} diff --git a/GameContent/NetModules/NetBestiaryModule.cs b/GameContent/NetModules/NetBestiaryModule.cs deleted file mode 100644 index 0599c58..0000000 --- a/GameContent/NetModules/NetBestiaryModule.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.NetModules.NetBestiaryModule -// 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.IO; -using Terraria.ID; -using Terraria.Net; - -namespace Terraria.GameContent.NetModules -{ - public class NetBestiaryModule : NetModule - { - public static NetPacket SerializeKillCount(int npcNetId, int killcount) - { - NetPacket packet = NetModule.CreatePacket(5); - packet.Writer.Write((byte) 0); - packet.Writer.Write((short) npcNetId); - packet.Writer.Write((ushort) killcount); - return packet; - } - - public static NetPacket SerializeSight(int npcNetId) - { - NetPacket packet = NetModule.CreatePacket(3); - packet.Writer.Write((byte) 1); - packet.Writer.Write((short) npcNetId); - return packet; - } - - public static NetPacket SerializeChat(int npcNetId) - { - NetPacket packet = NetModule.CreatePacket(3); - packet.Writer.Write((byte) 2); - packet.Writer.Write((short) npcNetId); - return packet; - } - - public override bool Deserialize(BinaryReader reader, int userId) - { - switch (reader.ReadByte()) - { - case 0: - short num1 = reader.ReadInt16(); - string bestiaryCreditId1 = ContentSamples.NpcsByNetId[(int) num1].GetBestiaryCreditId(); - ushort num2 = reader.ReadUInt16(); - Main.BestiaryTracker.Kills.SetKillCountDirectly(bestiaryCreditId1, (int) num2); - break; - case 1: - short num3 = reader.ReadInt16(); - string bestiaryCreditId2 = ContentSamples.NpcsByNetId[(int) num3].GetBestiaryCreditId(); - Main.BestiaryTracker.Sights.SetWasSeenDirectly(bestiaryCreditId2); - break; - case 2: - short num4 = reader.ReadInt16(); - string bestiaryCreditId3 = ContentSamples.NpcsByNetId[(int) num4].GetBestiaryCreditId(); - Main.BestiaryTracker.Chats.SetWasChatWithDirectly(bestiaryCreditId3); - break; - } - return true; - } - - private enum BestiaryUnlockType : byte - { - Kill, - Sight, - Chat, - } - } -} diff --git a/GameContent/NetModules/NetCreativePowerPermissionsModule.cs b/GameContent/NetModules/NetCreativePowerPermissionsModule.cs deleted file mode 100644 index c3747b9..0000000 --- a/GameContent/NetModules/NetCreativePowerPermissionsModule.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.NetModules.NetCreativePowerPermissionsModule -// 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.IO; -using Terraria.GameContent.Creative; -using Terraria.Net; - -namespace Terraria.GameContent.NetModules -{ - public class NetCreativePowerPermissionsModule : NetModule - { - private const byte _setPermissionLevelId = 0; - - public static NetPacket SerializeCurrentPowerPermissionLevel(ushort powerId, int level) - { - NetPacket packet = NetModule.CreatePacket(4); - packet.Writer.Write((byte) 0); - packet.Writer.Write(powerId); - packet.Writer.Write((byte) level); - return packet; - } - - public override bool Deserialize(BinaryReader reader, int userId) - { - if (reader.ReadByte() == (byte) 0) - { - ushort id = reader.ReadUInt16(); - int num = (int) reader.ReadByte(); - ICreativePower power; - if (Main.netMode == 2 || !CreativePowerManager.Instance.TryGetPower(id, out power)) - return false; - power.CurrentPermissionLevel = (PowerPermissionLevel) num; - } - return true; - } - } -} diff --git a/GameContent/NetModules/NetCreativePowersModule.cs b/GameContent/NetModules/NetCreativePowersModule.cs deleted file mode 100644 index f862ec6..0000000 --- a/GameContent/NetModules/NetCreativePowersModule.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.NetModules.NetCreativePowersModule -// 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.IO; -using Terraria.GameContent.Creative; -using Terraria.Net; - -namespace Terraria.GameContent.NetModules -{ - public class NetCreativePowersModule : NetModule - { - public static NetPacket PreparePacket( - ushort powerId, - int specificInfoBytesInPacketCount) - { - NetPacket packet = NetModule.CreatePacket(specificInfoBytesInPacketCount + 2); - packet.Writer.Write(powerId); - return packet; - } - - public override bool Deserialize(BinaryReader reader, int userId) - { - ushort id = reader.ReadUInt16(); - ICreativePower power; - if (!CreativePowerManager.Instance.TryGetPower(id, out power)) - return false; - power.DeserializeNetMessage(reader, userId); - return true; - } - } -} diff --git a/GameContent/NetModules/NetCreativeUnlocksModule.cs b/GameContent/NetModules/NetCreativeUnlocksModule.cs deleted file mode 100644 index 8cd3faf..0000000 --- a/GameContent/NetModules/NetCreativeUnlocksModule.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.NetModules.NetCreativeUnlocksModule -// 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.IO; -using Terraria.ID; -using Terraria.Net; - -namespace Terraria.GameContent.NetModules -{ - public class NetCreativeUnlocksModule : NetModule - { - public static NetPacket SerializeItemSacrifice(int itemId, int sacrificeCount) - { - NetPacket packet = NetModule.CreatePacket(3); - packet.Writer.Write((short) itemId); - packet.Writer.Write((ushort) sacrificeCount); - return packet; - } - - public override bool Deserialize(BinaryReader reader, int userId) - { - short num = reader.ReadInt16(); - Main.LocalPlayerCreativeTracker.ItemSacrifices.SetSacrificeCountDirectly(ContentSamples.ItemPersistentIdsByNetIds[(int) num], (int) reader.ReadUInt16()); - return true; - } - } -} diff --git a/GameContent/NetModules/NetCreativeUnlocksPlayerReportModule.cs b/GameContent/NetModules/NetCreativeUnlocksPlayerReportModule.cs deleted file mode 100644 index 0fab77e..0000000 --- a/GameContent/NetModules/NetCreativeUnlocksPlayerReportModule.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.NetModules.NetCreativeUnlocksPlayerReportModule -// 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.IO; -using Terraria.Net; - -namespace Terraria.GameContent.NetModules -{ - public class NetCreativeUnlocksPlayerReportModule : NetModule - { - private const byte _requestItemSacrificeId = 0; - - public static NetPacket SerializeSacrificeRequest(int itemId, int amount) - { - NetPacket packet = NetModule.CreatePacket(5); - packet.Writer.Write((byte) 0); - packet.Writer.Write((ushort) itemId); - packet.Writer.Write((ushort) amount); - return packet; - } - - public override bool Deserialize(BinaryReader reader, int userId) - { - if (reader.ReadByte() == (byte) 0) - { - int num1 = (int) reader.ReadUInt16(); - int num2 = (int) reader.ReadUInt16(); - } - return true; - } - } -} diff --git a/GameContent/NetModules/NetLiquidModule.cs b/GameContent/NetModules/NetLiquidModule.cs index bcd1f79..45599d9 100644 --- a/GameContent/NetModules/NetLiquidModule.cs +++ b/GameContent/NetModules/NetLiquidModule.cs @@ -1,10 +1,9 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.NetModules.NetLiquidModule -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe -using Microsoft.Xna.Framework; using System.Collections.Generic; using System.IO; using Terraria.Net; @@ -13,9 +12,6 @@ namespace Terraria.GameContent.NetModules { public class NetLiquidModule : NetModule { - private static List _changesForPlayerCache = new List(); - private static Dictionary _changesByChunkCoords = new Dictionary(); - public static NetPacket Serialize(HashSet changes) { NetPacket packet = NetModule.CreatePacket(changes.Count * 6 + 2); @@ -31,27 +27,6 @@ namespace Terraria.GameContent.NetModules return packet; } - public static NetPacket SerializeForPlayer(int playerIndex) - { - NetLiquidModule._changesForPlayerCache.Clear(); - foreach (KeyValuePair changesByChunkCoord in NetLiquidModule._changesByChunkCoords) - { - if (changesByChunkCoord.Value.BroadcastingCondition(playerIndex)) - NetLiquidModule._changesForPlayerCache.AddRange((IEnumerable) changesByChunkCoord.Value.DirtiedPackedTileCoords); - } - NetPacket packet = NetModule.CreatePacket(NetLiquidModule._changesForPlayerCache.Count * 6 + 2); - packet.Writer.Write((ushort) NetLiquidModule._changesForPlayerCache.Count); - foreach (int num in NetLiquidModule._changesForPlayerCache) - { - int index1 = num >> 16 & (int) ushort.MaxValue; - int index2 = num & (int) ushort.MaxValue; - packet.Writer.Write(num); - packet.Writer.Write(Main.tile[index1, index2].liquid); - packet.Writer.Write(Main.tile[index1, index2].liquidType()); - } - return packet; - } - public override bool Deserialize(BinaryReader reader, int userId) { int num1 = (int) reader.ReadUInt16(); @@ -71,70 +46,5 @@ namespace Terraria.GameContent.NetModules } return true; } - - public static void CreateAndBroadcastByChunk(HashSet dirtiedPackedTileCoords) - { - NetLiquidModule.PrepareChunks(dirtiedPackedTileCoords); - NetLiquidModule.PrepareAndSendToEachPlayerSeparately(); - } - - private static void PrepareAndSendToEachPlayerSeparately() - { - for (int index = 0; index < 256; ++index) - { - if (Netplay.Clients[index].IsConnected()) - NetManager.Instance.SendToClient(NetLiquidModule.SerializeForPlayer(index), index); - } - } - - private static void BroadcastEachChunkSeparately() - { - foreach (KeyValuePair changesByChunkCoord in NetLiquidModule._changesByChunkCoords) - NetManager.Instance.Broadcast(NetLiquidModule.Serialize(changesByChunkCoord.Value.DirtiedPackedTileCoords), new NetManager.BroadcastCondition(changesByChunkCoord.Value.BroadcastingCondition)); - } - - private static void PrepareChunks(HashSet dirtiedPackedTileCoords) - { - foreach (KeyValuePair changesByChunkCoord in NetLiquidModule._changesByChunkCoords) - changesByChunkCoord.Value.DirtiedPackedTileCoords.Clear(); - NetLiquidModule.DistributeChangesIntoChunks(dirtiedPackedTileCoords); - } - - private static void BroadcastAllChanges(HashSet dirtiedPackedTileCoords) => NetManager.Instance.Broadcast(NetLiquidModule.Serialize(dirtiedPackedTileCoords)); - - private static void DistributeChangesIntoChunks(HashSet dirtiedPackedTileCoords) - { - foreach (int dirtiedPackedTileCoord in dirtiedPackedTileCoords) - { - int x = dirtiedPackedTileCoord >> 16 & (int) ushort.MaxValue; - int y = dirtiedPackedTileCoord & (int) ushort.MaxValue; - Point key; - key.X = Netplay.GetSectionX(x); - key.Y = Netplay.GetSectionY(y); - NetLiquidModule.ChunkChanges chunkChanges; - if (!NetLiquidModule._changesByChunkCoords.TryGetValue(key, out chunkChanges)) - { - chunkChanges = new NetLiquidModule.ChunkChanges(key.X, key.Y); - NetLiquidModule._changesByChunkCoords[key] = chunkChanges; - } - chunkChanges.DirtiedPackedTileCoords.Add(dirtiedPackedTileCoord); - } - } - - private class ChunkChanges - { - public HashSet DirtiedPackedTileCoords; - public int ChunkX; - public int ChunkY; - - public ChunkChanges(int x, int y) - { - this.ChunkX = x; - this.ChunkY = y; - this.DirtiedPackedTileCoords = new HashSet(); - } - - public bool BroadcastingCondition(int clientIndex) => Netplay.Clients[clientIndex].TileSections[this.ChunkX, this.ChunkY]; - } } } diff --git a/GameContent/NetModules/NetParticlesModule.cs b/GameContent/NetModules/NetParticlesModule.cs deleted file mode 100644 index 108df76..0000000 --- a/GameContent/NetModules/NetParticlesModule.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.NetModules.NetParticlesModule -// 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.IO; -using Terraria.GameContent.Drawing; -using Terraria.Net; - -namespace Terraria.GameContent.NetModules -{ - public class NetParticlesModule : NetModule - { - public static NetPacket Serialize( - ParticleOrchestraType particleType, - ParticleOrchestraSettings settings) - { - NetPacket packet = NetModule.CreatePacket(22); - packet.Writer.Write((byte) particleType); - settings.Serialize(packet.Writer); - return packet; - } - - public override bool Deserialize(BinaryReader reader, int userId) - { - ParticleOrchestraType particleOrchestraType = (ParticleOrchestraType) reader.ReadByte(); - ParticleOrchestraSettings settings = new ParticleOrchestraSettings(); - settings.DeserializeFrom(reader); - if (Main.netMode == 2) - NetManager.Instance.Broadcast(NetParticlesModule.Serialize(particleOrchestraType, settings), userId); - else - ParticleOrchestrator.SpawnParticlesDirect(particleOrchestraType, settings); - return true; - } - } -} diff --git a/GameContent/NetModules/NetPingModule.cs b/GameContent/NetModules/NetPingModule.cs deleted file mode 100644 index fd81ee4..0000000 --- a/GameContent/NetModules/NetPingModule.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.NetModules.NetPingModule -// 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; -using System.IO; -using Terraria.Net; - -namespace Terraria.GameContent.NetModules -{ - public class NetPingModule : NetModule - { - public static NetPacket Serialize(Vector2 position) - { - NetPacket packet = NetModule.CreatePacket(8); - packet.Writer.WriteVector2(position); - return packet; - } - - public override bool Deserialize(BinaryReader reader, int userId) - { - Vector2 position = reader.ReadVector2(); - Main.Pings.Add(position); - return true; - } - } -} diff --git a/GameContent/NetModules/NetTeleportPylonModule.cs b/GameContent/NetModules/NetTeleportPylonModule.cs deleted file mode 100644 index dd2c596..0000000 --- a/GameContent/NetModules/NetTeleportPylonModule.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.NetModules.NetTeleportPylonModule -// 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.IO; -using Terraria.DataStructures; -using Terraria.Net; - -namespace Terraria.GameContent.NetModules -{ - public class NetTeleportPylonModule : NetModule - { - public static NetPacket SerializePylonWasAddedOrRemoved( - TeleportPylonInfo info, - NetTeleportPylonModule.SubPacketType packetType) - { - NetPacket packet = NetModule.CreatePacket(6); - packet.Writer.Write((byte) packetType); - packet.Writer.Write(info.PositionInTiles.X); - packet.Writer.Write(info.PositionInTiles.Y); - packet.Writer.Write((byte) info.TypeOfPylon); - return packet; - } - - public static NetPacket SerializeUseRequest(TeleportPylonInfo info) - { - NetPacket packet = NetModule.CreatePacket(6); - packet.Writer.Write((byte) 2); - packet.Writer.Write(info.PositionInTiles.X); - packet.Writer.Write(info.PositionInTiles.Y); - packet.Writer.Write((byte) info.TypeOfPylon); - return packet; - } - - public override bool Deserialize(BinaryReader reader, int userId) - { - switch (reader.ReadByte()) - { - case 0: - Main.PylonSystem.AddForClient(new TeleportPylonInfo() - { - PositionInTiles = new Point16(reader.ReadInt16(), reader.ReadInt16()), - TypeOfPylon = (TeleportPylonType) reader.ReadByte() - }); - break; - case 1: - Main.PylonSystem.RemoveForClient(new TeleportPylonInfo() - { - PositionInTiles = new Point16(reader.ReadInt16(), reader.ReadInt16()), - TypeOfPylon = (TeleportPylonType) reader.ReadByte() - }); - break; - case 2: - Main.PylonSystem.HandleTeleportRequest(new TeleportPylonInfo() - { - PositionInTiles = new Point16(reader.ReadInt16(), reader.ReadInt16()), - TypeOfPylon = (TeleportPylonType) reader.ReadByte() - }, userId); - break; - } - return true; - } - - public enum SubPacketType : byte - { - PylonWasAdded, - PylonWasRemoved, - PlayerRequestsTeleport, - } - } -} diff --git a/GameContent/NetModules/NetTextModule.cs b/GameContent/NetModules/NetTextModule.cs index fe06578..1c8a959 100644 --- a/GameContent/NetModules/NetTextModule.cs +++ b/GameContent/NetModules/NetTextModule.cs @@ -1,12 +1,13 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.NetModules.NetTextModule -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using System.IO; using Terraria.Chat; +using Terraria.GameContent.UI.Chat; using Terraria.Localization; using Terraria.Net; using Terraria.UI.Chat; @@ -38,18 +39,27 @@ namespace Terraria.GameContent.NetModules private bool DeserializeAsClient(BinaryReader reader, int senderPlayerId) { - byte messageAuthor = reader.ReadByte(); - ChatHelper.DisplayMessage(NetworkText.Deserialize(reader), reader.ReadRGB(), messageAuthor); + byte num = reader.ReadByte(); + string str = NetworkText.Deserialize(reader).ToString(); + Color c = reader.ReadRGB(); + if (num < byte.MaxValue) + { + Main.player[(int) num].chatOverhead.NewMessage(str, Main.chatLength / 2); + str = NameTagHandler.GenerateTag(Main.player[(int) num].name) + " " + str; + } + Main.NewTextMultiline(str, c: c); return true; } private bool DeserializeAsServer(BinaryReader reader, int senderPlayerId) { ChatMessage message = ChatMessage.Deserialize(reader); - ChatManager.Commands.ProcessIncomingMessage(message, senderPlayerId); + ChatManager.Commands.ProcessReceivedMessage(message, senderPlayerId); return true; } + private void BroadcastRawMessage(ChatMessage message, byte author, Color messageColor) => NetManager.Instance.Broadcast(NetTextModule.SerializeServerMessage(NetworkText.FromLiteral(message.Text), messageColor)); + public override bool Deserialize(BinaryReader reader, int senderPlayerId) => this.DeserializeAsClient(reader, senderPlayerId); } } diff --git a/GameContent/ObjectInteractions/AHoverInteractionChecker.cs b/GameContent/ObjectInteractions/AHoverInteractionChecker.cs deleted file mode 100644 index 4063d02..0000000 --- a/GameContent/ObjectInteractions/AHoverInteractionChecker.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ObjectInteractions.AHoverInteractionChecker -// 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; -using Terraria.GameInput; - -namespace Terraria.GameContent.ObjectInteractions -{ - public abstract class AHoverInteractionChecker - { - internal AHoverInteractionChecker.HoverStatus AttemptInteraction( - Player player, - Rectangle Hitbox) - { - Point tileCoordinates = Hitbox.ClosestPointInRect(player.Center).ToTileCoordinates(); - if (!player.IsInTileInteractionRange(tileCoordinates.X, tileCoordinates.Y)) - return AHoverInteractionChecker.HoverStatus.NotSelectable; - Matrix matrix = Matrix.Invert(Main.GameViewMatrix.ZoomMatrix); - Vector2 vector2 = Main.ReverseGravitySupport(Main.MouseScreen); - Vector2.Transform(Main.screenPosition, matrix); - Vector2 screenPosition = Main.screenPosition; - Vector2 v = vector2 + screenPosition; - bool flag1 = Hitbox.Contains(v.ToPoint()); - bool flag2 = flag1; - bool? nullable = this.AttemptOverridingHoverStatus(player, Hitbox); - if (nullable.HasValue) - flag2 = nullable.Value; - bool flag3 = flag2 & !player.lastMouseInterface; - bool flag4 = !Main.SmartCursorEnabled && !PlayerInput.UsingGamepad; - if (!flag3) - return !flag4 ? AHoverInteractionChecker.HoverStatus.SelectableButNotSelected : AHoverInteractionChecker.HoverStatus.NotSelectable; - Main.HasInteractibleObjectThatIsNotATile = true; - if (flag1) - this.DoHoverEffect(player, Hitbox); - if (PlayerInput.UsingGamepad) - player.GamepadEnableGrappleCooldown(); - bool flag5 = this.ShouldBlockInteraction(player, Hitbox); - if (Main.mouseRight && Main.mouseRightRelease && !flag5) - { - Main.mouseRightRelease = false; - player.tileInteractAttempted = true; - player.tileInteractionHappened = true; - player.releaseUseTile = false; - this.PerformInteraction(player, Hitbox); - } - return !Main.SmartCursorEnabled && !PlayerInput.UsingGamepad || flag4 ? AHoverInteractionChecker.HoverStatus.NotSelectable : AHoverInteractionChecker.HoverStatus.Selected; - } - - internal abstract bool? AttemptOverridingHoverStatus(Player player, Rectangle rectangle); - - internal abstract void DoHoverEffect(Player player, Rectangle hitbox); - - internal abstract bool ShouldBlockInteraction(Player player, Rectangle hitbox); - - internal abstract void PerformInteraction(Player player, Rectangle hitbox); - - internal enum HoverStatus - { - NotSelectable, - SelectableButNotSelected, - Selected, - } - } -} diff --git a/GameContent/ObjectInteractions/BlockBecauseYouAreOverAnImportantTile.cs b/GameContent/ObjectInteractions/BlockBecauseYouAreOverAnImportantTile.cs deleted file mode 100644 index 5e45076..0000000 --- a/GameContent/ObjectInteractions/BlockBecauseYouAreOverAnImportantTile.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ObjectInteractions.BlockBecauseYouAreOverAnImportantTile -// 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.ObjectInteractions -{ - public class BlockBecauseYouAreOverAnImportantTile : ISmartInteractBlockReasonProvider - { - public bool ShouldBlockSmartInteract(SmartInteractScanSettings settings) - { - int tileTargetX = Player.tileTargetX; - int tileTargetY = Player.tileTargetY; - if (!WorldGen.InWorld(tileTargetX, tileTargetY, 10)) - return true; - Tile tile = Main.tile[tileTargetX, tileTargetY]; - if (tile == null) - return true; - if (tile.active()) - { - switch (tile.type) - { - case 4: - case 33: - case 334: - case 395: - case 410: - case 455: - case 471: - case 480: - case 509: - case 520: - return true; - } - } - return false; - } - } -} diff --git a/GameContent/ObjectInteractions/ISmartInteractBlockReasonProvider.cs b/GameContent/ObjectInteractions/ISmartInteractBlockReasonProvider.cs deleted file mode 100644 index b6f80da..0000000 --- a/GameContent/ObjectInteractions/ISmartInteractBlockReasonProvider.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ObjectInteractions.ISmartInteractBlockReasonProvider -// 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.ObjectInteractions -{ - public interface ISmartInteractBlockReasonProvider - { - bool ShouldBlockSmartInteract(SmartInteractScanSettings settings); - } -} diff --git a/GameContent/ObjectInteractions/ISmartInteractCandidate.cs b/GameContent/ObjectInteractions/ISmartInteractCandidate.cs deleted file mode 100644 index bdfdaf2..0000000 --- a/GameContent/ObjectInteractions/ISmartInteractCandidate.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ObjectInteractions.ISmartInteractCandidate -// 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.ObjectInteractions -{ - public interface ISmartInteractCandidate - { - float DistanceFromCursor { get; } - - void WinCandidacy(); - } -} diff --git a/GameContent/ObjectInteractions/ISmartInteractCandidateProvider.cs b/GameContent/ObjectInteractions/ISmartInteractCandidateProvider.cs deleted file mode 100644 index 6b27e59..0000000 --- a/GameContent/ObjectInteractions/ISmartInteractCandidateProvider.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ObjectInteractions.ISmartInteractCandidateProvider -// 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.ObjectInteractions -{ - public interface ISmartInteractCandidateProvider - { - void ClearSelfAndPrepareForCheck(); - - bool ProvideCandidate(SmartInteractScanSettings settings, out ISmartInteractCandidate candidate); - } -} diff --git a/GameContent/ObjectInteractions/NPCSmartInteractCandidateProvider.cs b/GameContent/ObjectInteractions/NPCSmartInteractCandidateProvider.cs deleted file mode 100644 index 1faf062..0000000 --- a/GameContent/ObjectInteractions/NPCSmartInteractCandidateProvider.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ObjectInteractions.NPCSmartInteractCandidateProvider -// 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.ObjectInteractions -{ - public class NPCSmartInteractCandidateProvider : ISmartInteractCandidateProvider - { - private NPCSmartInteractCandidateProvider.ReusableCandidate _candidate = new NPCSmartInteractCandidateProvider.ReusableCandidate(); - - public void ClearSelfAndPrepareForCheck() => Main.SmartInteractNPC = -1; - - public bool ProvideCandidate( - SmartInteractScanSettings settings, - out ISmartInteractCandidate candidate) - { - candidate = (ISmartInteractCandidate) null; - if (!settings.FullInteraction) - return false; - Rectangle rectangle = Utils.CenteredRectangle(settings.player.Center, new Vector2((float) Player.tileRangeX, (float) Player.tileRangeY) * 16f * 2f); - Vector2 mousevec = settings.mousevec; - mousevec.ToPoint(); - bool flag = false; - int npcIndex = -1; - float npcDistanceFromCursor = -1f; - for (int index = 0; index < 200; ++index) - { - NPC npc = Main.npc[index]; - if (npc.active && npc.townNPC && npc.Hitbox.Intersects(rectangle) && !flag) - { - float num = npc.Hitbox.Distance(mousevec); - if ((npcIndex == -1 ? 1 : ((double) Main.npc[npcIndex].Hitbox.Distance(mousevec) > (double) num ? 1 : 0)) != 0) - { - npcIndex = index; - npcDistanceFromCursor = num; - } - if ((double) num == 0.0) - { - flag = true; - npcIndex = index; - npcDistanceFromCursor = num; - break; - } - } - } - if (settings.DemandOnlyZeroDistanceTargets && !flag || npcIndex == -1) - return false; - this._candidate.Reuse(npcIndex, npcDistanceFromCursor); - candidate = (ISmartInteractCandidate) this._candidate; - return true; - } - - private class ReusableCandidate : ISmartInteractCandidate - { - private int _npcIndexToTarget; - - public float DistanceFromCursor { get; private set; } - - public void WinCandidacy() - { - Main.SmartInteractNPC = this._npcIndexToTarget; - Main.SmartInteractShowingGenuine = true; - } - - public void Reuse(int npcIndex, float npcDistanceFromCursor) - { - this._npcIndexToTarget = npcIndex; - this.DistanceFromCursor = npcDistanceFromCursor; - } - } - } -} diff --git a/GameContent/ObjectInteractions/PotionOfReturnGateInteractionChecker.cs b/GameContent/ObjectInteractions/PotionOfReturnGateInteractionChecker.cs deleted file mode 100644 index b9db42b..0000000 --- a/GameContent/ObjectInteractions/PotionOfReturnGateInteractionChecker.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ObjectInteractions.PotionOfReturnGateInteractionChecker -// 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.ObjectInteractions -{ - public class PotionOfReturnGateInteractionChecker : AHoverInteractionChecker - { - internal override bool? AttemptOverridingHoverStatus(Player player, Rectangle rectangle) => Main.SmartInteractPotionOfReturn ? new bool?(true) : new bool?(); - - internal override void DoHoverEffect(Player player, Rectangle hitbox) - { - player.noThrow = 2; - player.cursorItemIconEnabled = true; - player.cursorItemIconID = 4870; - } - - internal override bool ShouldBlockInteraction(Player player, Rectangle hitbox) => (uint) Player.BlockInteractionWithProjectiles > 0U; - - internal override void PerformInteraction(Player player, Rectangle hitbox) => player.DoPotionOfReturnReturnToOriginalUsePosition(); - } -} diff --git a/GameContent/ObjectInteractions/PotionOfReturnHelper.cs b/GameContent/ObjectInteractions/PotionOfReturnHelper.cs deleted file mode 100644 index 0f8f11e..0000000 --- a/GameContent/ObjectInteractions/PotionOfReturnHelper.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ObjectInteractions.PotionOfReturnHelper -// 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.ObjectInteractions -{ - public class PotionOfReturnHelper - { - public static bool TryGetGateHitbox(Player player, out Rectangle homeHitbox) - { - homeHitbox = Rectangle.Empty; - if (!player.PotionOfReturnHomePosition.HasValue) - return false; - Vector2 vector2 = new Vector2(0.0f, (float) (-player.height / 2)); - Vector2 center = player.PotionOfReturnHomePosition.Value + vector2; - homeHitbox = Utils.CenteredRectangle(center, new Vector2(24f, 40f)); - return true; - } - } -} diff --git a/GameContent/ObjectInteractions/PotionOfReturnSmartInteractCandidateProvider.cs b/GameContent/ObjectInteractions/PotionOfReturnSmartInteractCandidateProvider.cs deleted file mode 100644 index 0a3abf6..0000000 --- a/GameContent/ObjectInteractions/PotionOfReturnSmartInteractCandidateProvider.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ObjectInteractions.PotionOfReturnSmartInteractCandidateProvider -// 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.ObjectInteractions -{ - public class PotionOfReturnSmartInteractCandidateProvider : ISmartInteractCandidateProvider - { - private PotionOfReturnSmartInteractCandidateProvider.ReusableCandidate _candidate = new PotionOfReturnSmartInteractCandidateProvider.ReusableCandidate(); - - public void ClearSelfAndPrepareForCheck() => Main.SmartInteractPotionOfReturn = false; - - public bool ProvideCandidate( - SmartInteractScanSettings settings, - out ISmartInteractCandidate candidate) - { - candidate = (ISmartInteractCandidate) null; - Rectangle homeHitbox; - if (!PotionOfReturnHelper.TryGetGateHitbox(settings.player, out homeHitbox)) - return false; - this._candidate.Reuse(homeHitbox.ClosestPointInRect(settings.mousevec).Distance(settings.mousevec)); - candidate = (ISmartInteractCandidate) this._candidate; - return true; - } - - private class ReusableCandidate : ISmartInteractCandidate - { - public float DistanceFromCursor { get; private set; } - - public void WinCandidacy() - { - Main.SmartInteractPotionOfReturn = true; - Main.SmartInteractShowingGenuine = true; - } - - public void Reuse(float distanceFromCursor) => this.DistanceFromCursor = distanceFromCursor; - } - } -} diff --git a/GameContent/ObjectInteractions/ProjectileSmartInteractCandidateProvider.cs b/GameContent/ObjectInteractions/ProjectileSmartInteractCandidateProvider.cs deleted file mode 100644 index f01eeb3..0000000 --- a/GameContent/ObjectInteractions/ProjectileSmartInteractCandidateProvider.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ObjectInteractions.ProjectileSmartInteractCandidateProvider -// 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; -using System.Collections.Generic; - -namespace Terraria.GameContent.ObjectInteractions -{ - public class ProjectileSmartInteractCandidateProvider : ISmartInteractCandidateProvider - { - private ProjectileSmartInteractCandidateProvider.ReusableCandidate _candidate = new ProjectileSmartInteractCandidateProvider.ReusableCandidate(); - - public void ClearSelfAndPrepareForCheck() => Main.SmartInteractProj = -1; - - public bool ProvideCandidate( - SmartInteractScanSettings settings, - out ISmartInteractCandidate candidate) - { - candidate = (ISmartInteractCandidate) null; - if (!settings.FullInteraction) - return false; - List interactWithHack = settings.player.GetListOfProjectilesToInteractWithHack(); - bool flag = false; - Vector2 mousevec = settings.mousevec; - mousevec.ToPoint(); - int projectileIndex = -1; - float projectileDistanceFromCursor = -1f; - for (int index1 = 0; index1 < interactWithHack.Count; ++index1) - { - int index2 = interactWithHack[index1]; - Projectile projectile = Main.projectile[index2]; - if (projectile.active) - { - float num = projectile.Hitbox.Distance(mousevec); - if ((projectileIndex == -1 ? 1 : ((double) Main.projectile[projectileIndex].Hitbox.Distance(mousevec) > (double) num ? 1 : 0)) != 0) - { - projectileIndex = index2; - projectileDistanceFromCursor = num; - } - if ((double) num == 0.0) - { - flag = true; - projectileIndex = index2; - projectileDistanceFromCursor = num; - break; - } - } - } - if (settings.DemandOnlyZeroDistanceTargets && !flag || projectileIndex == -1) - return false; - this._candidate.Reuse(projectileIndex, projectileDistanceFromCursor); - candidate = (ISmartInteractCandidate) this._candidate; - return true; - } - - private class ReusableCandidate : ISmartInteractCandidate - { - private int _projectileIndexToTarget; - - public float DistanceFromCursor { get; private set; } - - public void WinCandidacy() - { - Main.SmartInteractProj = this._projectileIndexToTarget; - Main.SmartInteractShowingGenuine = true; - } - - public void Reuse(int projectileIndex, float projectileDistanceFromCursor) - { - this._projectileIndexToTarget = projectileIndex; - this.DistanceFromCursor = projectileDistanceFromCursor; - } - } - } -} diff --git a/GameContent/ObjectInteractions/SmartInteractScanSettings.cs b/GameContent/ObjectInteractions/SmartInteractScanSettings.cs deleted file mode 100644 index f4aec43..0000000 --- a/GameContent/ObjectInteractions/SmartInteractScanSettings.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ObjectInteractions.SmartInteractScanSettings -// 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.ObjectInteractions -{ - public struct SmartInteractScanSettings - { - public Player player; - public bool DemandOnlyZeroDistanceTargets; - public bool FullInteraction; - public Vector2 mousevec; - public int LX; - public int HX; - public int LY; - public int HY; - } -} diff --git a/GameContent/ObjectInteractions/SmartInteractSystem.cs b/GameContent/ObjectInteractions/SmartInteractSystem.cs deleted file mode 100644 index 295628f..0000000 --- a/GameContent/ObjectInteractions/SmartInteractSystem.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ObjectInteractions.SmartInteractSystem -// 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.Collections.Generic; - -namespace Terraria.GameContent.ObjectInteractions -{ - public class SmartInteractSystem - { - private List _candidateProvidersByOrderOfPriority = new List(); - private List _blockProviders = new List(); - private List _candidates = new List(); - - public SmartInteractSystem() - { - this._candidateProvidersByOrderOfPriority.Add((ISmartInteractCandidateProvider) new PotionOfReturnSmartInteractCandidateProvider()); - this._candidateProvidersByOrderOfPriority.Add((ISmartInteractCandidateProvider) new ProjectileSmartInteractCandidateProvider()); - this._candidateProvidersByOrderOfPriority.Add((ISmartInteractCandidateProvider) new NPCSmartInteractCandidateProvider()); - this._candidateProvidersByOrderOfPriority.Add((ISmartInteractCandidateProvider) new TileSmartInteractCandidateProvider()); - this._blockProviders.Add((ISmartInteractBlockReasonProvider) new BlockBecauseYouAreOverAnImportantTile()); - } - - public void RunQuery(SmartInteractScanSettings settings) - { - this._candidates.Clear(); - foreach (ISmartInteractBlockReasonProvider blockProvider in this._blockProviders) - { - if (blockProvider.ShouldBlockSmartInteract(settings)) - return; - } - foreach (ISmartInteractCandidateProvider candidateProvider in this._candidateProvidersByOrderOfPriority) - candidateProvider.ClearSelfAndPrepareForCheck(); - foreach (ISmartInteractCandidateProvider candidateProvider in this._candidateProvidersByOrderOfPriority) - { - ISmartInteractCandidate candidate; - if (candidateProvider.ProvideCandidate(settings, out candidate)) - { - this._candidates.Add(candidate); - if ((double) candidate.DistanceFromCursor == 0.0) - break; - } - } - ISmartInteractCandidate interactCandidate = (ISmartInteractCandidate) null; - foreach (ISmartInteractCandidate candidate in this._candidates) - { - if (interactCandidate == null || (double) interactCandidate.DistanceFromCursor > (double) candidate.DistanceFromCursor) - interactCandidate = candidate; - } - interactCandidate?.WinCandidacy(); - } - } -} diff --git a/GameContent/ObjectInteractions/TileSmartInteractCandidateProvider.cs b/GameContent/ObjectInteractions/TileSmartInteractCandidateProvider.cs deleted file mode 100644 index 7c046fe..0000000 --- a/GameContent/ObjectInteractions/TileSmartInteractCandidateProvider.cs +++ /dev/null @@ -1,387 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ObjectInteractions.TileSmartInteractCandidateProvider -// 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; -using System; -using System.Collections.Generic; - -namespace Terraria.GameContent.ObjectInteractions -{ - public class TileSmartInteractCandidateProvider : ISmartInteractCandidateProvider - { - private List> targets = new List>(); - private TileSmartInteractCandidateProvider.ReusableCandidate _candidate = new TileSmartInteractCandidateProvider.ReusableCandidate(); - - public void ClearSelfAndPrepareForCheck() - { - Main.TileInteractionLX = -1; - Main.TileInteractionHX = -1; - Main.TileInteractionLY = -1; - Main.TileInteractionHY = -1; - Main.SmartInteractTileCoords.Clear(); - Main.SmartInteractTileCoordsSelected.Clear(); - this.targets.Clear(); - } - - public bool ProvideCandidate( - SmartInteractScanSettings settings, - out ISmartInteractCandidate candidate) - { - candidate = (ISmartInteractCandidate) null; - Point tileCoordinates = settings.mousevec.ToTileCoordinates(); - this.FillPotentialTargetTiles(settings); - int num1 = -1; - int num2 = -1; - int AimedX = -1; - int AimedY = -1; - if (this.targets.Count > 0) - { - float num3 = -1f; - Tuple target = this.targets[0]; - for (int index = 0; index < this.targets.Count; ++index) - { - float num4 = Vector2.Distance(new Vector2((float) this.targets[index].Item1, (float) this.targets[index].Item2) * 16f + Vector2.One * 8f, settings.mousevec); - if ((double) num3 == -1.0 || (double) num4 <= (double) num3) - { - num3 = num4; - target = this.targets[index]; - } - } - if (Collision.InTileBounds(target.Item1, target.Item2, settings.LX, settings.LY, settings.HX, settings.HY)) - { - num1 = target.Item1; - num2 = target.Item2; - } - } - bool flag1 = false; - for (int index1 = 0; index1 < this.targets.Count; ++index1) - { - int index2 = this.targets[index1].Item1; - int index3 = this.targets[index1].Item2; - Tile tile = Main.tile[index2, index3]; - int num5 = 0; - int num6 = 0; - int num7 = 18; - int num8 = 18; - int num9 = 2; - switch (tile.type) - { - case 10: - num5 = 1; - num6 = 3; - num9 = 0; - break; - case 11: - case 356: - case 410: - case 470: - case 480: - case 509: - num5 = 2; - num6 = 3; - num9 = 0; - break; - case 15: - case 497: - num5 = 1; - num6 = 2; - num9 = 4; - break; - case 21: - case 55: - case 85: - case 97: - case 125: - case 132: - case 287: - case 335: - case 386: - case 411: - case 425: - case 441: - case 467: - case 468: - case 573: - case 621: - num5 = 2; - num6 = 2; - break; - case 29: - case 387: - num5 = 2; - num6 = 1; - break; - case 79: - case 139: - case 510: - case 511: - num5 = 2; - num6 = 2; - num9 = 0; - break; - case 88: - num5 = 3; - num6 = 1; - num9 = 0; - break; - case 89: - case 215: - case 237: - case 377: - num5 = 3; - num6 = 2; - break; - case 102: - case 463: - case 475: - case 597: - num5 = 3; - num6 = 4; - break; - case 104: - num5 = 2; - num6 = 5; - break; - case 136: - case 144: - case 494: - num5 = 1; - num6 = 1; - num9 = 0; - break; - case 207: - num5 = 2; - num6 = 4; - num9 = 0; - break; - case 209: - num5 = 4; - num6 = 3; - num9 = 0; - break; - case 212: - num5 = 4; - num6 = 3; - break; - case 216: - case 338: - num5 = 1; - num6 = 2; - break; - case 354: - case 455: - case 491: - num5 = 3; - num6 = 3; - num9 = 0; - break; - case 388: - case 389: - num5 = 1; - num6 = 5; - break; - case 487: - num5 = 4; - num6 = 2; - num9 = 0; - break; - } - if (num5 != 0 && num6 != 0) - { - int lx = index2 - (int) tile.frameX % (num7 * num5) / num7; - int ly = index3 - (int) tile.frameY % (num8 * num6 + num9) / num8; - bool flag2 = Collision.InTileBounds(num1, num2, lx, ly, lx + num5 - 1, ly + num6 - 1); - bool flag3 = Collision.InTileBounds(tileCoordinates.X, tileCoordinates.Y, lx, ly, lx + num5 - 1, ly + num6 - 1); - if (flag3) - { - AimedX = tileCoordinates.X; - AimedY = tileCoordinates.Y; - } - if (!settings.FullInteraction) - flag2 &= flag3; - if (flag1) - flag2 = false; - for (int x = lx; x < lx + num5; ++x) - { - for (int y = ly; y < ly + num6; ++y) - { - Point point = new Point(x, y); - if (!Main.SmartInteractTileCoords.Contains(point)) - { - if (flag2) - Main.SmartInteractTileCoordsSelected.Add(point); - if (flag2 || settings.FullInteraction) - Main.SmartInteractTileCoords.Add(point); - } - } - } - if (!flag1 & flag2) - flag1 = true; - } - } - if (settings.DemandOnlyZeroDistanceTargets) - { - if (AimedX == -1 || AimedY == -1) - return false; - this._candidate.Reuse(true, 0.0f, AimedX, AimedY, settings.LX - 10, settings.LY - 10, settings.HX + 10, settings.HY + 10); - candidate = (ISmartInteractCandidate) this._candidate; - return true; - } - if (num1 == -1 || num2 == -1) - return false; - this._candidate.Reuse(false, new Rectangle(num1 * 16, num2 * 16, 16, 16).ClosestPointInRect(settings.mousevec).Distance(settings.mousevec), num1, num2, settings.LX - 10, settings.LY - 10, settings.HX + 10, settings.HY + 10); - candidate = (ISmartInteractCandidate) this._candidate; - return true; - } - - private void FillPotentialTargetTiles(SmartInteractScanSettings settings) - { - for (int lx = settings.LX; lx <= settings.HX; ++lx) - { - for (int ly = settings.LY; ly <= settings.HY; ++ly) - { - Tile tile = Main.tile[lx, ly]; - if (tile != null && tile.active()) - { - switch (tile.type) - { - case 10: - case 11: - case 21: - case 29: - case 55: - case 79: - case 85: - case 88: - case 89: - case 97: - case 102: - case 104: - case 125: - case 132: - case 136: - case 139: - case 144: - case 207: - case 209: - case 215: - case 216: - case 287: - case 335: - case 338: - case 354: - case 377: - case 386: - case 387: - case 388: - case 389: - case 410: - case 411: - case 425: - case 441: - case 455: - case 463: - case 467: - case 468: - case 470: - case 475: - case 480: - case 487: - case 491: - case 494: - case 509: - case 510: - case 511: - case 573: - case 597: - case 621: - this.targets.Add(new Tuple(lx, ly)); - continue; - case 15: - case 497: - if (settings.player.IsWithinSnappngRangeToTile(lx, ly, 40)) - { - this.targets.Add(new Tuple(lx, ly)); - continue; - } - continue; - case 212: - if (settings.player.HasItem(949)) - { - this.targets.Add(new Tuple(lx, ly)); - continue; - } - continue; - case 237: - if (settings.player.HasItem(1293)) - { - this.targets.Add(new Tuple(lx, ly)); - continue; - } - continue; - case 356: - if (!Main.fastForwardTime && (Main.netMode == 1 || Main.sundialCooldown == 0)) - { - this.targets.Add(new Tuple(lx, ly)); - continue; - } - continue; - default: - continue; - } - } - } - } - } - - private class ReusableCandidate : ISmartInteractCandidate - { - private bool _strictSettings; - private int _aimedX; - private int _aimedY; - private int _hx; - private int _hy; - private int _lx; - private int _ly; - - public void Reuse( - bool strictSettings, - float distanceFromCursor, - int AimedX, - int AimedY, - int LX, - int LY, - int HX, - int HY) - { - this.DistanceFromCursor = distanceFromCursor; - this._strictSettings = strictSettings; - this._aimedX = AimedX; - this._aimedY = AimedY; - this._lx = LX; - this._ly = LY; - this._hx = HX; - this._hy = HY; - } - - public float DistanceFromCursor { get; private set; } - - public void WinCandidacy() - { - Main.SmartInteractX = this._aimedX; - Main.SmartInteractY = this._aimedY; - if (this._strictSettings) - Main.SmartInteractShowingFake = Main.SmartInteractTileCoords.Count > 0; - else - Main.SmartInteractShowingGenuine = true; - Main.TileInteractionLX = this._lx - 10; - Main.TileInteractionLY = this._ly - 10; - Main.TileInteractionHX = this._hx + 10; - Main.TileInteractionHY = this._hy + 10; - } - } - } -} diff --git a/GameContent/Personalities/AllPersonalitiesModifier.cs b/GameContent/Personalities/AllPersonalitiesModifier.cs deleted file mode 100644 index c75a503..0000000 --- a/GameContent/Personalities/AllPersonalitiesModifier.cs +++ /dev/null @@ -1,458 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Personalities.AllPersonalitiesModifier -// 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.Personalities -{ - public class AllPersonalitiesModifier : IShopPersonalityTrait - { - public void ModifyShopPrice(HelperInfo info, ShopHelper shopHelperInstance) - { - int primaryPlayerBiome = info.PrimaryPlayerBiome; - bool[] nearbyNpCsByType = info.nearbyNPCsByType; - switch (info.npc.type) - { - case 17: - case 22: - case 588: - case 633: - if (primaryPlayerBiome == 0) - { - shopHelperInstance.LikeBiome(primaryPlayerBiome); - break; - } - break; - case 18: - case 108: - case 208: - case 550: - if (primaryPlayerBiome == 6) - { - shopHelperInstance.LikeBiome(primaryPlayerBiome); - break; - } - break; - case 19: - case 178: - case 207: - if (primaryPlayerBiome == 3) - { - shopHelperInstance.LikeBiome(primaryPlayerBiome); - break; - } - break; - case 20: - case 227: - case 228: - if (primaryPlayerBiome == 4) - { - shopHelperInstance.LikeBiome(primaryPlayerBiome); - break; - } - break; - case 38: - case 54: - case 107: - if (primaryPlayerBiome == 1) - { - shopHelperInstance.LikeBiome(primaryPlayerBiome); - break; - } - break; - case 124: - case 209: - case 441: - if (primaryPlayerBiome == 2) - { - shopHelperInstance.LikeBiome(primaryPlayerBiome); - break; - } - break; - case 142: - if (primaryPlayerBiome == 2) - { - shopHelperInstance.LoveBiome(primaryPlayerBiome); - break; - } - break; - case 160: - if (primaryPlayerBiome == 7) - { - shopHelperInstance.LikeBiome(primaryPlayerBiome); - break; - } - break; - case 229: - case 353: - case 369: - if (primaryPlayerBiome == 5) - { - shopHelperInstance.LikeBiome(primaryPlayerBiome); - break; - } - break; - } - switch (info.npc.type) - { - case 17: - case 20: - case 369: - case 633: - if (primaryPlayerBiome == 3) - { - shopHelperInstance.DislikeBiome(primaryPlayerBiome); - break; - } - break; - case 18: - case 19: - case 353: - case 550: - if (primaryPlayerBiome == 2) - { - shopHelperInstance.DislikeBiome(primaryPlayerBiome); - break; - } - break; - case 22: - case 38: - case 108: - if (primaryPlayerBiome == 5) - { - shopHelperInstance.DislikeBiome(primaryPlayerBiome); - break; - } - break; - case 54: - case 228: - case 441: - if (primaryPlayerBiome == 6) - { - shopHelperInstance.DislikeBiome(primaryPlayerBiome); - break; - } - break; - case 107: - case 178: - case 209: - if (primaryPlayerBiome == 4) - { - shopHelperInstance.DislikeBiome(primaryPlayerBiome); - break; - } - break; - case 124: - case 208: - case 229: - case 588: - if (primaryPlayerBiome == 1) - { - shopHelperInstance.DislikeBiome(primaryPlayerBiome); - break; - } - break; - case 142: - if (primaryPlayerBiome == 3) - { - shopHelperInstance.HateBiome(primaryPlayerBiome); - break; - } - break; - case 207: - case 227: - if (primaryPlayerBiome == 0) - { - shopHelperInstance.DislikeBiome(primaryPlayerBiome); - break; - } - break; - } - switch (info.npc.type) - { - case 17: - if (nearbyNpCsByType[588]) - shopHelperInstance.LikeNPC(588); - if (nearbyNpCsByType[18]) - shopHelperInstance.LikeNPC(18); - if (nearbyNpCsByType[441]) - shopHelperInstance.DislikeNPC(441); - if (!nearbyNpCsByType[369]) - break; - shopHelperInstance.HateNPC(369); - break; - case 18: - if (nearbyNpCsByType[19]) - shopHelperInstance.LoveNPC(19); - if (nearbyNpCsByType[108]) - shopHelperInstance.LikeNPC(108); - if (nearbyNpCsByType[208]) - shopHelperInstance.DislikeNPC(208); - if (nearbyNpCsByType[20]) - shopHelperInstance.DislikeNPC(20); - if (!nearbyNpCsByType[633]) - break; - shopHelperInstance.HateNPC(633); - break; - case 19: - if (nearbyNpCsByType[18]) - shopHelperInstance.LoveNPC(18); - if (nearbyNpCsByType[178]) - shopHelperInstance.LikeNPC(178); - if (nearbyNpCsByType[588]) - shopHelperInstance.DislikeNPC(588); - if (!nearbyNpCsByType[38]) - break; - shopHelperInstance.HateNPC(38); - break; - case 20: - if (nearbyNpCsByType[228]) - shopHelperInstance.LikeNPC(228); - if (nearbyNpCsByType[160]) - shopHelperInstance.LikeNPC(160); - if (nearbyNpCsByType[369]) - shopHelperInstance.DislikeNPC(369); - if (!nearbyNpCsByType[588]) - break; - shopHelperInstance.HateNPC(588); - break; - case 22: - if (nearbyNpCsByType[54]) - shopHelperInstance.LikeNPC(54); - if (nearbyNpCsByType[178]) - shopHelperInstance.DislikeNPC(178); - if (nearbyNpCsByType[227]) - shopHelperInstance.HateNPC(227); - if (!nearbyNpCsByType[633]) - break; - shopHelperInstance.LikeNPC(633); - break; - case 38: - if (nearbyNpCsByType[550]) - shopHelperInstance.LoveNPC(550); - if (nearbyNpCsByType[124]) - shopHelperInstance.LikeNPC(124); - if (nearbyNpCsByType[107]) - shopHelperInstance.DislikeNPC(107); - if (!nearbyNpCsByType[19]) - break; - shopHelperInstance.DislikeNPC(19); - break; - case 54: - if (nearbyNpCsByType[160]) - shopHelperInstance.LoveNPC(160); - if (nearbyNpCsByType[441]) - shopHelperInstance.LikeNPC(441); - if (nearbyNpCsByType[18]) - shopHelperInstance.DislikeNPC(18); - if (!nearbyNpCsByType[124]) - break; - shopHelperInstance.HateNPC(124); - break; - case 107: - if (nearbyNpCsByType[124]) - shopHelperInstance.LoveNPC(124); - if (nearbyNpCsByType[207]) - shopHelperInstance.LikeNPC(207); - if (nearbyNpCsByType[54]) - shopHelperInstance.DislikeNPC(54); - if (!nearbyNpCsByType[353]) - break; - shopHelperInstance.HateNPC(353); - break; - case 108: - if (nearbyNpCsByType[588]) - shopHelperInstance.LoveNPC(588); - if (nearbyNpCsByType[17]) - shopHelperInstance.LikeNPC(17); - if (nearbyNpCsByType[228]) - shopHelperInstance.DislikeNPC(228); - if (!nearbyNpCsByType[209]) - break; - shopHelperInstance.HateNPC(209); - break; - case 124: - if (nearbyNpCsByType[107]) - shopHelperInstance.LoveNPC(107); - if (nearbyNpCsByType[209]) - shopHelperInstance.LikeNPC(209); - if (nearbyNpCsByType[19]) - shopHelperInstance.DislikeNPC(19); - if (!nearbyNpCsByType[54]) - break; - shopHelperInstance.HateNPC(54); - break; - case 142: - if (!nearbyNpCsByType[441]) - break; - shopHelperInstance.HateNPC(441); - break; - case 160: - if (nearbyNpCsByType[22]) - shopHelperInstance.LoveNPC(22); - if (nearbyNpCsByType[20]) - shopHelperInstance.LikeNPC(20); - if (nearbyNpCsByType[54]) - shopHelperInstance.DislikeNPC(54); - if (!nearbyNpCsByType[228]) - break; - shopHelperInstance.HateNPC(228); - break; - case 178: - if (nearbyNpCsByType[209]) - shopHelperInstance.LoveNPC(209); - if (nearbyNpCsByType[227]) - shopHelperInstance.LikeNPC(227); - if (nearbyNpCsByType[208]) - shopHelperInstance.DislikeNPC(208); - if (nearbyNpCsByType[108]) - shopHelperInstance.DislikeNPC(108); - if (!nearbyNpCsByType[20]) - break; - shopHelperInstance.DislikeNPC(20); - break; - case 207: - if (nearbyNpCsByType[19]) - shopHelperInstance.LikeNPC(19); - if (nearbyNpCsByType[227]) - shopHelperInstance.LikeNPC(227); - if (nearbyNpCsByType[178]) - shopHelperInstance.DislikeNPC(178); - if (!nearbyNpCsByType[229]) - break; - shopHelperInstance.HateNPC(229); - break; - case 208: - if (nearbyNpCsByType[108]) - shopHelperInstance.LoveNPC(108); - if (nearbyNpCsByType[353]) - shopHelperInstance.LikeNPC(353); - if (nearbyNpCsByType[17]) - shopHelperInstance.DislikeNPC(17); - if (nearbyNpCsByType[441]) - shopHelperInstance.HateNPC(441); - if (!nearbyNpCsByType[633]) - break; - shopHelperInstance.LoveNPC(633); - break; - case 209: - if (nearbyNpCsByType[353]) - shopHelperInstance.LikeNPC(353); - if (nearbyNpCsByType[229]) - shopHelperInstance.LikeNPC(229); - if (nearbyNpCsByType[178]) - shopHelperInstance.LikeNPC(178); - if (nearbyNpCsByType[108]) - shopHelperInstance.HateNPC(108); - if (!nearbyNpCsByType[633]) - break; - shopHelperInstance.DislikeNPC(633); - break; - case 227: - if (nearbyNpCsByType[20]) - shopHelperInstance.LoveNPC(20); - if (nearbyNpCsByType[208]) - shopHelperInstance.LikeNPC(208); - if (nearbyNpCsByType[209]) - shopHelperInstance.DislikeNPC(209); - if (!nearbyNpCsByType[160]) - break; - shopHelperInstance.DislikeNPC(160); - break; - case 228: - if (nearbyNpCsByType[20]) - shopHelperInstance.LikeNPC(20); - if (nearbyNpCsByType[22]) - shopHelperInstance.LikeNPC(22); - if (nearbyNpCsByType[18]) - shopHelperInstance.DislikeNPC(18); - if (!nearbyNpCsByType[160]) - break; - shopHelperInstance.HateNPC(160); - break; - case 229: - if (nearbyNpCsByType[369]) - shopHelperInstance.LoveNPC(369); - if (nearbyNpCsByType[550]) - shopHelperInstance.LikeNPC(550); - if (nearbyNpCsByType[353]) - shopHelperInstance.DislikeNPC(353); - if (!nearbyNpCsByType[22]) - break; - shopHelperInstance.HateNPC(22); - break; - case 353: - if (nearbyNpCsByType[207]) - shopHelperInstance.LoveNPC(207); - if (nearbyNpCsByType[229]) - shopHelperInstance.LikeNPC(229); - if (nearbyNpCsByType[550]) - shopHelperInstance.DislikeNPC(550); - if (!nearbyNpCsByType[107]) - break; - shopHelperInstance.HateNPC(107); - break; - case 369: - if (nearbyNpCsByType[208]) - shopHelperInstance.LikeNPC(208); - if (nearbyNpCsByType[38]) - shopHelperInstance.LikeNPC(38); - if (nearbyNpCsByType[441]) - shopHelperInstance.LikeNPC(441); - if (!nearbyNpCsByType[550]) - break; - shopHelperInstance.HateNPC(550); - break; - case 441: - if (nearbyNpCsByType[17]) - shopHelperInstance.LoveNPC(17); - if (nearbyNpCsByType[208]) - shopHelperInstance.LikeNPC(208); - if (nearbyNpCsByType[38]) - shopHelperInstance.DislikeNPC(38); - if (nearbyNpCsByType[124]) - shopHelperInstance.DislikeNPC(124); - if (!nearbyNpCsByType[142]) - break; - shopHelperInstance.HateNPC(142); - break; - case 550: - if (nearbyNpCsByType[38]) - shopHelperInstance.LoveNPC(38); - if (nearbyNpCsByType[107]) - shopHelperInstance.LikeNPC(107); - if (nearbyNpCsByType[22]) - shopHelperInstance.DislikeNPC(22); - if (!nearbyNpCsByType[207]) - break; - shopHelperInstance.HateNPC(207); - break; - case 588: - if (nearbyNpCsByType[227]) - shopHelperInstance.LikeNPC(227); - if (nearbyNpCsByType[369]) - shopHelperInstance.LoveNPC(369); - if (nearbyNpCsByType[17]) - shopHelperInstance.HateNPC(17); - if (nearbyNpCsByType[229]) - shopHelperInstance.DislikeNPC(229); - if (!nearbyNpCsByType[633]) - break; - shopHelperInstance.LikeNPC(633); - break; - case 633: - if (nearbyNpCsByType[369]) - shopHelperInstance.DislikeNPC(369); - if (nearbyNpCsByType[19]) - shopHelperInstance.HateNPC(19); - if (nearbyNpCsByType[228]) - shopHelperInstance.LoveNPC(228); - if (!nearbyNpCsByType[588]) - break; - shopHelperInstance.LikeNPC(588); - break; - } - } - } -} diff --git a/GameContent/Personalities/HelperInfo.cs b/GameContent/Personalities/HelperInfo.cs deleted file mode 100644 index a67aebc..0000000 --- a/GameContent/Personalities/HelperInfo.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Personalities.HelperInfo -// 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.Collections.Generic; - -namespace Terraria.GameContent.Personalities -{ - public struct HelperInfo - { - public Player player; - public NPC npc; - public List NearbyNPCs; - public int PrimaryPlayerBiome; - public bool[] nearbyNPCsByType; - } -} diff --git a/GameContent/Personalities/IShopPersonalityTrait.cs b/GameContent/Personalities/IShopPersonalityTrait.cs deleted file mode 100644 index 3d1cf10..0000000 --- a/GameContent/Personalities/IShopPersonalityTrait.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Personalities.IShopPersonalityTrait -// 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.Personalities -{ - public interface IShopPersonalityTrait - { - void ModifyShopPrice(HelperInfo info, ShopHelper shopHelperInstance); - } -} diff --git a/GameContent/Personalities/PersonalityDatabase.cs b/GameContent/Personalities/PersonalityDatabase.cs deleted file mode 100644 index b51daa9..0000000 --- a/GameContent/Personalities/PersonalityDatabase.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Personalities.PersonalityDatabase -// 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.Collections.Generic; - -namespace Terraria.GameContent.Personalities -{ - public class PersonalityDatabase - { - private Dictionary _personalityProfiles; - - public PersonalityDatabase() => this._personalityProfiles = new Dictionary(); - - private void Register(IShopPersonalityTrait trait, int npcId) - { - if (!this._personalityProfiles.ContainsKey(npcId)) - this._personalityProfiles[npcId] = new PersonalityProfile(); - this._personalityProfiles[npcId].ShopModifiers.Add(trait); - } - - private void Register(IShopPersonalityTrait trait, params int[] npcIds) - { - for (int index = 0; index < npcIds.Length; ++index) - this.Register(trait, npcIds[index]); - } - } -} diff --git a/GameContent/Personalities/PersonalityProfile.cs b/GameContent/Personalities/PersonalityProfile.cs deleted file mode 100644 index 7bde227..0000000 --- a/GameContent/Personalities/PersonalityProfile.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Personalities.PersonalityProfile -// 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.Collections.Generic; - -namespace Terraria.GameContent.Personalities -{ - public class PersonalityProfile - { - public List ShopModifiers = new List(); - } -} diff --git a/GameContent/PlayerEyeHelper.cs b/GameContent/PlayerEyeHelper.cs deleted file mode 100644 index 3fbdd48..0000000 --- a/GameContent/PlayerEyeHelper.cs +++ /dev/null @@ -1,122 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.PlayerEyeHelper -// 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 -{ - public struct PlayerEyeHelper - { - private PlayerEyeHelper.EyeState _state; - private int _timeInState; - private const int TimeToActDamaged = 20; - - public int EyeFrameToShow { get; private set; } - - public void Update(Player player) - { - this.SetStateByPlayerInfo(player); - this.UpdateEyeFrameToShow(player); - ++this._timeInState; - } - - private void UpdateEyeFrameToShow(Player player) - { - PlayerEyeHelper.EyeFrame eyeFrame1 = PlayerEyeHelper.EyeFrame.EyeOpen; - switch (this._state) - { - case PlayerEyeHelper.EyeState.NormalBlinking: - int num = this._timeInState % 240 - 234; - eyeFrame1 = num < 4 ? (num < 2 ? (num < 0 ? PlayerEyeHelper.EyeFrame.EyeOpen : PlayerEyeHelper.EyeFrame.EyeHalfClosed) : PlayerEyeHelper.EyeFrame.EyeClosed) : PlayerEyeHelper.EyeFrame.EyeHalfClosed; - break; - case PlayerEyeHelper.EyeState.InStorm: - eyeFrame1 = this._timeInState % 120 - 114 < 0 ? PlayerEyeHelper.EyeFrame.EyeHalfClosed : PlayerEyeHelper.EyeFrame.EyeClosed; - break; - case PlayerEyeHelper.EyeState.InBed: - PlayerEyeHelper.EyeFrame eyeFrame2 = this.DoesPlayerCountAsModeratelyDamaged(player) ? PlayerEyeHelper.EyeFrame.EyeHalfClosed : PlayerEyeHelper.EyeFrame.EyeOpen; - this._timeInState = player.sleeping.timeSleeping; - eyeFrame1 = this._timeInState >= 60 ? (this._timeInState >= 120 ? PlayerEyeHelper.EyeFrame.EyeClosed : PlayerEyeHelper.EyeFrame.EyeHalfClosed) : eyeFrame2; - break; - case PlayerEyeHelper.EyeState.JustTookDamage: - eyeFrame1 = PlayerEyeHelper.EyeFrame.EyeClosed; - break; - case PlayerEyeHelper.EyeState.IsModeratelyDamaged: - case PlayerEyeHelper.EyeState.IsTipsy: - case PlayerEyeHelper.EyeState.IsPoisoned: - eyeFrame1 = this._timeInState % 120 - 100 < 0 ? PlayerEyeHelper.EyeFrame.EyeHalfClosed : PlayerEyeHelper.EyeFrame.EyeClosed; - break; - case PlayerEyeHelper.EyeState.IsBlind: - eyeFrame1 = PlayerEyeHelper.EyeFrame.EyeClosed; - break; - } - this.EyeFrameToShow = (int) eyeFrame1; - } - - private void SetStateByPlayerInfo(Player player) - { - if (player.blackout || player.blind) - { - this.SwitchToState(PlayerEyeHelper.EyeState.IsBlind); - } - else - { - if (this._state == PlayerEyeHelper.EyeState.JustTookDamage && this._timeInState < 20) - return; - if (player.sleeping.isSleeping) - this.SwitchToState(PlayerEyeHelper.EyeState.InBed, player.itemAnimation > 0); - else if (this.DoesPlayerCountAsModeratelyDamaged(player)) - this.SwitchToState(PlayerEyeHelper.EyeState.IsModeratelyDamaged); - else if (player.tipsy) - this.SwitchToState(PlayerEyeHelper.EyeState.IsTipsy); - else if (player.poisoned || player.venom) - { - this.SwitchToState(PlayerEyeHelper.EyeState.IsPoisoned); - } - else - { - bool flag = player.ZoneSandstorm || player.ZoneSnow && Main.IsItRaining; - if (player.behindBackWall) - flag = false; - if (flag) - this.SwitchToState(PlayerEyeHelper.EyeState.InStorm); - else - this.SwitchToState(PlayerEyeHelper.EyeState.NormalBlinking); - } - } - } - - private void SwitchToState( - PlayerEyeHelper.EyeState newState, - bool resetStateTimerEvenIfAlreadyInState = false) - { - if (this._state == newState && !resetStateTimerEvenIfAlreadyInState) - return; - this._state = newState; - this._timeInState = 0; - } - - private bool DoesPlayerCountAsModeratelyDamaged(Player player) => (double) player.statLife <= (double) player.statLifeMax2 * 0.25; - - public void BlinkBecausePlayerGotHurt() => this.SwitchToState(PlayerEyeHelper.EyeState.JustTookDamage, true); - - private enum EyeFrame - { - EyeOpen, - EyeHalfClosed, - EyeClosed, - } - - private enum EyeState - { - NormalBlinking, - InStorm, - InBed, - JustTookDamage, - IsModeratelyDamaged, - IsBlind, - IsTipsy, - IsPoisoned, - } - } -} diff --git a/GameContent/PlayerHeadDrawRenderTargetContent.cs b/GameContent/PlayerHeadDrawRenderTargetContent.cs deleted file mode 100644 index 8b199d9..0000000 --- a/GameContent/PlayerHeadDrawRenderTargetContent.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.PlayerHeadDrawRenderTargetContent -// 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.Graphics; -using System.Collections.Generic; -using Terraria.DataStructures; - -namespace Terraria.GameContent -{ - public class PlayerHeadDrawRenderTargetContent : AnOutlinedDrawRenderTargetContent - { - private Player _player; - private readonly List _drawData = new List(); - private readonly List _dust = new List(); - private readonly List _gore = new List(); - - public void UsePlayer(Player player) => this._player = player; - - internal override void DrawTheContent(SpriteBatch spriteBatch) - { - if (this._player == null) - return; - this._drawData.Clear(); - this._dust.Clear(); - this._gore.Clear(); - PlayerDrawHeadSet drawinfo = new PlayerDrawHeadSet(); - drawinfo.BoringSetup(this._player, this._drawData, this._dust, this._gore, (float) (this.width / 2), (float) (this.height / 2), 1f, 1f); - PlayerDrawHeadLayers.DrawPlayer_00_BackHelmet(ref drawinfo); - PlayerDrawHeadLayers.DrawPlayer_01_FaceSkin(ref drawinfo); - PlayerDrawHeadLayers.DrawPlayer_02_DrawArmorWithFullHair(ref drawinfo); - PlayerDrawHeadLayers.DrawPlayer_03_HelmetHair(ref drawinfo); - PlayerDrawHeadLayers.DrawPlayer_04_JungleRose(ref drawinfo); - PlayerDrawHeadLayers.DrawPlayer_05_TallHats(ref drawinfo); - PlayerDrawHeadLayers.DrawPlayer_06_NormalHats(ref drawinfo); - PlayerDrawHeadLayers.DrawPlayer_07_JustHair(ref drawinfo); - PlayerDrawHeadLayers.DrawPlayer_08_FaceAcc(ref drawinfo); - PlayerDrawHeadLayers.DrawPlayer_RenderAllLayers(ref drawinfo); - } - } -} diff --git a/GameContent/PlayerQueenSlimeMountTextureContent.cs b/GameContent/PlayerQueenSlimeMountTextureContent.cs deleted file mode 100644 index 6494dc4..0000000 --- a/GameContent/PlayerQueenSlimeMountTextureContent.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.PlayerQueenSlimeMountTextureContent -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria.DataStructures; -using Terraria.Graphics.Shaders; - -namespace Terraria.GameContent -{ - public class PlayerQueenSlimeMountTextureContent : ARenderTargetContentByRequest - { - protected override void HandleUseReqest(GraphicsDevice device, SpriteBatch spriteBatch) - { - Asset asset = TextureAssets.Extra[204]; - this.PrepareARenderTarget_AndListenToEvents(ref this._target, device, asset.Width(), asset.Height(), RenderTargetUsage.PreserveContents); - device.SetRenderTarget(this._target); - device.Clear(Color.Transparent); - DrawData drawData = new DrawData(asset.Value, Vector2.Zero, Color.White); - spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); - GameShaders.Misc["QueenSlime"].Apply(new DrawData?(drawData)); - drawData.Draw(spriteBatch); - spriteBatch.End(); - device.SetRenderTarget((RenderTarget2D) null); - this._wasPrepared = true; - } - } -} diff --git a/GameContent/PlayerRainbowWingsTextureContent.cs b/GameContent/PlayerRainbowWingsTextureContent.cs deleted file mode 100644 index d9c8ee2..0000000 --- a/GameContent/PlayerRainbowWingsTextureContent.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.PlayerRainbowWingsTextureContent -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria.DataStructures; -using Terraria.Graphics.Shaders; - -namespace Terraria.GameContent -{ - public class PlayerRainbowWingsTextureContent : ARenderTargetContentByRequest - { - protected override void HandleUseReqest(GraphicsDevice device, SpriteBatch spriteBatch) - { - Asset asset = TextureAssets.Extra[171]; - this.PrepareARenderTarget_AndListenToEvents(ref this._target, device, asset.Width(), asset.Height(), RenderTargetUsage.PreserveContents); - device.SetRenderTarget(this._target); - device.Clear(Color.Transparent); - DrawData drawData = new DrawData(asset.Value, Vector2.Zero, Color.White); - spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); - GameShaders.Misc["HallowBoss"].Apply(new DrawData?(drawData)); - drawData.Draw(spriteBatch); - spriteBatch.End(); - device.SetRenderTarget((RenderTarget2D) null); - this._wasPrepared = true; - } - } -} diff --git a/GameContent/PlayerSittingHelper.cs b/GameContent/PlayerSittingHelper.cs deleted file mode 100644 index 759a48f..0000000 --- a/GameContent/PlayerSittingHelper.cs +++ /dev/null @@ -1,251 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.PlayerSittingHelper -// 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; -using Terraria.ID; - -namespace Terraria.GameContent -{ - public struct PlayerSittingHelper - { - public const int ChairSittingMaxDistance = 40; - public bool isSitting; - public Vector2 offsetForSeat; - public int sittingIndex; - - public void GetSittingOffsetInfo( - Player player, - out Vector2 posOffset, - out float seatAdjustment) - { - if (this.isSitting) - { - posOffset = new Vector2((float) (this.sittingIndex * player.direction * 8), (float) ((double) this.sittingIndex * (double) player.gravDir * -4.0)); - seatAdjustment = -4f; - seatAdjustment += (float) (int) this.offsetForSeat.Y; - posOffset += this.offsetForSeat * player.Directions; - } - else - { - posOffset = Vector2.Zero; - seatAdjustment = 0.0f; - } - } - - public void UpdateSitting(Player player) - { - if (!this.isSitting) - return; - Point tileCoordinates = (player.Bottom + new Vector2(0.0f, -2f)).ToTileCoordinates(); - int targetDirection; - Vector2 seatDownOffset; - if (!PlayerSittingHelper.GetSittingTargetInfo(player, tileCoordinates.X, tileCoordinates.Y, out targetDirection, out Vector2 _, out seatDownOffset)) - { - this.SitUp(player); - } - else - { - if (player.controlLeft || player.controlRight || player.controlUp || player.controlDown || player.controlJump || player.pulley || player.mount.Active || targetDirection != player.direction) - this.SitUp(player); - if (Main.sittingManager.GetNextPlayerStackIndexInCoords(tileCoordinates) >= 2) - this.SitUp(player); - if (!this.isSitting) - return; - this.offsetForSeat = seatDownOffset; - Main.sittingManager.AddPlayerAndGetItsStackedIndexInCoords(player.whoAmI, tileCoordinates, out this.sittingIndex); - } - } - - public void SitUp(Player player, bool multiplayerBroadcast = true) - { - if (!this.isSitting) - return; - this.isSitting = false; - this.offsetForSeat = Vector2.Zero; - this.sittingIndex = -1; - if (!multiplayerBroadcast || Main.myPlayer != player.whoAmI) - return; - NetMessage.SendData(13, number: player.whoAmI); - } - - public void SitDown(Player player, int x, int y) - { - int targetDirection; - Vector2 playerSittingPosition; - Vector2 seatDownOffset; - if (!PlayerSittingHelper.GetSittingTargetInfo(player, x, y, out targetDirection, out playerSittingPosition, out seatDownOffset)) - return; - Vector2 offset = playerSittingPosition - player.Bottom; - bool position = player.CanSnapToPosition(offset); - if (position) - position &= Main.sittingManager.GetNextPlayerStackIndexInCoords((playerSittingPosition + new Vector2(0.0f, -2f)).ToTileCoordinates()) < 2; - if (!position) - return; - if (this.isSitting && player.Bottom == playerSittingPosition) - { - this.SitUp(player); - } - else - { - player.StopVanityActions(); - player.RemoveAllGrapplingHooks(); - if (player.mount.Active) - player.mount.Dismount(player); - player.Bottom = playerSittingPosition; - player.ChangeDir(targetDirection); - this.isSitting = true; - this.offsetForSeat = seatDownOffset; - Main.sittingManager.AddPlayerAndGetItsStackedIndexInCoords(player.whoAmI, new Point(x, y), out this.sittingIndex); - player.velocity = Vector2.Zero; - player.gravDir = 1f; - if (Main.myPlayer != player.whoAmI) - return; - NetMessage.SendData(13, number: player.whoAmI); - } - } - - public static bool GetSittingTargetInfo( - Player player, - int x, - int y, - out int targetDirection, - out Vector2 playerSittingPosition, - out Vector2 seatDownOffset) - { - Tile tileSafely = Framing.GetTileSafely(x, y); - if (!TileID.Sets.CanBeSatOnForPlayers[(int) tileSafely.type] || !tileSafely.active()) - { - targetDirection = 1; - seatDownOffset = Vector2.Zero; - playerSittingPosition = new Vector2(); - return false; - } - int x1 = x; - int num1 = y; - targetDirection = 1; - seatDownOffset = Vector2.Zero; - int num2 = 6; - Vector2 zero1 = Vector2.Zero; - switch (tileSafely.type) - { - case 15: - case 497: - seatDownOffset.Y = (float) ((tileSafely.type == (ushort) 15 && (int) tileSafely.frameY / 40 == 27).ToInt() * 4); - if ((int) tileSafely.frameY % 40 != 0) - --num1; - targetDirection = -1; - if (tileSafely.frameX != (short) 0) - { - targetDirection = 1; - break; - } - break; - case 89: - targetDirection = player.direction; - num2 = 0; - Vector2 vector2_1 = new Vector2(-4f, 2f); - Vector2 vector2_2 = new Vector2(4f, 2f); - Vector2 vector2_3 = new Vector2(0.0f, 2f); - Vector2 zero2 = Vector2.Zero; - zero2.X = 1f; - zero1.X = -1f; - switch ((int) tileSafely.frameX / 54) - { - case 0: - vector2_3.Y = vector2_1.Y = vector2_2.Y = 1f; - break; - case 1: - vector2_3.Y = 1f; - break; - case 2: - case 14: - case 15: - case 17: - case 20: - case 21: - case 22: - case 23: - case 25: - case 26: - case 27: - case 28: - case 35: - case 37: - case 38: - case 39: - case 40: - case 41: - case 42: - vector2_3.Y = vector2_1.Y = vector2_2.Y = 1f; - break; - case 3: - case 4: - case 5: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 16: - case 18: - case 19: - case 36: - vector2_3.Y = vector2_1.Y = vector2_2.Y = 0.0f; - break; - case 6: - vector2_3.Y = vector2_1.Y = vector2_2.Y = -1f; - break; - case 24: - vector2_3.Y = 0.0f; - vector2_1.Y = -4f; - vector2_1.X = 0.0f; - vector2_2.X = 0.0f; - vector2_2.Y = -4f; - break; - } - if ((int) tileSafely.frameY % 40 != 0) - --num1; - seatDownOffset = (int) tileSafely.frameX % 54 == 0 && targetDirection == -1 || (int) tileSafely.frameX % 54 == 36 && targetDirection == 1 ? vector2_1 : ((int) tileSafely.frameX % 54 == 0 && targetDirection == 1 || (int) tileSafely.frameX % 54 == 36 && targetDirection == -1 ? vector2_2 : vector2_3); - seatDownOffset += zero2; - break; - case 102: - int num3 = (int) tileSafely.frameX / 18; - if (num3 == 0) - ++x1; - if (num3 == 2) - --x1; - int num4 = (int) tileSafely.frameY / 18; - if (num4 == 0) - num1 += 2; - if (num4 == 1) - ++num1; - if (num4 == 3) - --num1; - targetDirection = player.direction; - num2 = 0; - break; - case 487: - int num5 = (int) tileSafely.frameX % 72 / 18; - if (num5 == 1) - --x1; - if (num5 == 2) - ++x1; - if ((int) tileSafely.frameY / 18 != 0) - --num1; - targetDirection = (num5 <= 1).ToDirectionInt(); - num2 = 0; - --seatDownOffset.Y; - break; - } - playerSittingPosition = new Point(x1, num1 + 1).ToWorldCoordinates(autoAddY: 16f); - playerSittingPosition.X += (float) (targetDirection * num2); - playerSittingPosition += zero1; - return true; - } - } -} diff --git a/GameContent/PlayerSleepingHelper.cs b/GameContent/PlayerSleepingHelper.cs deleted file mode 100644 index 37b47f3..0000000 --- a/GameContent/PlayerSleepingHelper.cs +++ /dev/null @@ -1,238 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.PlayerSleepingHelper -// 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; -using Terraria.ID; - -namespace Terraria.GameContent -{ - public struct PlayerSleepingHelper - { - public const int BedSleepingMaxDistance = 96; - public const int TimeToFullyFallAsleep = 120; - public bool isSleeping; - public int sleepingIndex; - public int timeSleeping; - public Vector2 visualOffsetOfBedBase; - - public bool FullyFallenAsleep => this.isSleeping && this.timeSleeping >= 120; - - public void GetSleepingOffsetInfo(Player player, out Vector2 posOffset) - { - if (this.isSleeping) - posOffset = this.visualOffsetOfBedBase * player.Directions + new Vector2(0.0f, (float) ((double) this.sleepingIndex * (double) player.gravDir * -4.0)); - else - posOffset = Vector2.Zero; - } - - private bool DoesPlayerHaveReasonToActUpInBed(Player player) => NPC.AnyDanger(true) || Main.bloodMoon && !Main.dayTime || Main.eclipse && Main.dayTime || player.itemAnimation > 0; - - public void SetIsSleepingAndAdjustPlayerRotation(Player player, bool state) - { - if (this.isSleeping == state) - return; - this.isSleeping = state; - if (state) - { - player.fullRotation = 1.570796f * (float) -player.direction; - } - else - { - player.fullRotation = 0.0f; - this.visualOffsetOfBedBase = new Vector2(); - } - } - - public void UpdateState(Player player) - { - if (!this.isSleeping) - { - this.timeSleeping = 0; - } - else - { - ++this.timeSleeping; - if (this.DoesPlayerHaveReasonToActUpInBed(player)) - this.timeSleeping = 0; - Point tileCoordinates = (player.Bottom + new Vector2(0.0f, -2f)).ToTileCoordinates(); - int targetDirection; - Vector2 visualoffset; - if (!PlayerSleepingHelper.GetSleepingTargetInfo(tileCoordinates.X, tileCoordinates.Y, out targetDirection, out Vector2 _, out visualoffset)) - { - this.StopSleeping(player); - } - else - { - if (player.controlLeft || player.controlRight || player.controlUp || player.controlDown || player.controlJump || player.pulley || player.mount.Active || targetDirection != player.direction) - this.StopSleeping(player); - bool flag = false; - if (player.itemAnimation > 0) - { - Item heldItem = player.HeldItem; - if (heldItem.damage > 0 && !heldItem.noMelee) - flag = true; - if (heldItem.fishingPole > 0) - flag = true; - bool? nullable = ItemID.Sets.ForcesBreaksSleeping[heldItem.type]; - if (nullable.HasValue) - flag = nullable.Value; - } - if (flag) - this.StopSleeping(player); - if (Main.sleepingManager.GetNextPlayerStackIndexInCoords(tileCoordinates) >= 2) - this.StopSleeping(player); - if (!this.isSleeping) - return; - this.visualOffsetOfBedBase = visualoffset; - Main.sleepingManager.AddPlayerAndGetItsStackedIndexInCoords(player.whoAmI, tileCoordinates, out this.sleepingIndex); - } - } - } - - public void StopSleeping(Player player, bool multiplayerBroadcast = true) - { - if (!this.isSleeping) - return; - this.SetIsSleepingAndAdjustPlayerRotation(player, false); - this.timeSleeping = 0; - this.sleepingIndex = -1; - this.visualOffsetOfBedBase = new Vector2(); - if (!multiplayerBroadcast || Main.myPlayer != player.whoAmI) - return; - NetMessage.SendData(13, number: player.whoAmI); - } - - public void StartSleeping(Player player, int x, int y) - { - int targetDirection; - Vector2 anchorPosition; - Vector2 visualoffset; - PlayerSleepingHelper.GetSleepingTargetInfo(x, y, out targetDirection, out anchorPosition, out visualoffset); - Vector2 offset = anchorPosition - player.Bottom; - bool position = player.CanSnapToPosition(offset); - if (position) - position &= Main.sleepingManager.GetNextPlayerStackIndexInCoords((anchorPosition + new Vector2(0.0f, -2f)).ToTileCoordinates()) < 2; - if (!position) - return; - if (this.isSleeping && player.Bottom == anchorPosition) - { - this.StopSleeping(player); - } - else - { - player.StopVanityActions(); - player.RemoveAllGrapplingHooks(); - player.RemoveAllFishingBobbers(); - if (player.mount.Active) - player.mount.Dismount(player); - player.Bottom = anchorPosition; - player.ChangeDir(targetDirection); - Main.sleepingManager.AddPlayerAndGetItsStackedIndexInCoords(player.whoAmI, new Point(x, y), out this.sleepingIndex); - player.velocity = Vector2.Zero; - player.gravDir = 1f; - this.SetIsSleepingAndAdjustPlayerRotation(player, true); - this.visualOffsetOfBedBase = visualoffset; - if (Main.myPlayer != player.whoAmI) - return; - NetMessage.SendData(13, number: player.whoAmI); - } - } - - public static bool GetSleepingTargetInfo( - int x, - int y, - out int targetDirection, - out Vector2 anchorPosition, - out Vector2 visualoffset) - { - Tile tileSafely = Framing.GetTileSafely(x, y); - if (!TileID.Sets.CanBeSleptIn[(int) tileSafely.type] || !tileSafely.active()) - { - targetDirection = 1; - anchorPosition = new Vector2(); - visualoffset = new Vector2(); - return false; - } - int num1 = x; - int num2 = y; - int num3 = (int) tileSafely.frameX % 72 / 18; - int num4 = num1 - num3; - if ((int) tileSafely.frameY % 36 != 0) - --num2; - targetDirection = 1; - int num5 = (int) tileSafely.frameX / 72; - int x1 = num4; - switch (num5) - { - case 0: - targetDirection = -1; - ++x1; - break; - case 1: - x1 += 2; - break; - } - anchorPosition = new Point(x1, num2 + 1).ToWorldCoordinates(autoAddY: 16f); - visualoffset = PlayerSleepingHelper.SetOffsetbyBed((int) tileSafely.frameY / 36); - return true; - } - - private static Vector2 SetOffsetbyBed(int bedStyle) - { - switch (bedStyle) - { - case 8: - return new Vector2(-11f, 1f); - case 10: - return new Vector2(-9f, -1f); - case 11: - return new Vector2(-11f, 1f); - case 13: - return new Vector2(-11f, -3f); - case 15: - case 16: - case 17: - return new Vector2(-7f, -3f); - case 18: - return new Vector2(-9f, -3f); - case 19: - return new Vector2(-3f, -1f); - case 20: - return new Vector2(-9f, -5f); - case 21: - return new Vector2(-9f, 5f); - case 22: - return new Vector2(-7f, 1f); - case 23: - return new Vector2(-5f, -1f); - case 24: - case 25: - return new Vector2(-7f, 1f); - case 27: - return new Vector2(-9f, 3f); - case 28: - return new Vector2(-9f, 5f); - case 29: - return new Vector2(-11f, -1f); - case 30: - return new Vector2(-9f, 3f); - case 31: - return new Vector2(-7f, 5f); - case 32: - return new Vector2(-7f, -1f); - case 34: - case 35: - case 36: - case 37: - return new Vector2(-13f, 1f); - case 38: - return new Vector2(-11f, -3f); - default: - return new Vector2(-9f, 1f); - } - } - } -} diff --git a/GameContent/PlayerTitaniumStormBuffTextureContent.cs b/GameContent/PlayerTitaniumStormBuffTextureContent.cs deleted file mode 100644 index 3dc0142..0000000 --- a/GameContent/PlayerTitaniumStormBuffTextureContent.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.PlayerTitaniumStormBuffTextureContent -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria.DataStructures; -using Terraria.Graphics.Shaders; - -namespace Terraria.GameContent -{ - public class PlayerTitaniumStormBuffTextureContent : ARenderTargetContentByRequest - { - private MiscShaderData _shaderData; - - public PlayerTitaniumStormBuffTextureContent() - { - this._shaderData = new MiscShaderData(Main.PixelShaderRef, "TitaniumStorm"); - this._shaderData.UseImage1("Images/Extra_" + (object) (short) 156); - } - - protected override void HandleUseReqest(GraphicsDevice device, SpriteBatch spriteBatch) - { - Main.instance.LoadProjectile(908); - Asset asset = TextureAssets.Projectile[908]; - this.UpdateSettingsForRendering(0.6f, 0.0f, Main.GlobalTimeWrappedHourly, 0.3f); - this.PrepareARenderTarget_AndListenToEvents(ref this._target, device, asset.Width(), asset.Height(), RenderTargetUsage.PreserveContents); - device.SetRenderTarget(this._target); - device.Clear(Color.Transparent); - DrawData drawData = new DrawData(asset.Value, Vector2.Zero, Color.White); - spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); - this._shaderData.Apply(new DrawData?(drawData)); - drawData.Draw(spriteBatch); - spriteBatch.End(); - device.SetRenderTarget((RenderTarget2D) null); - this._wasPrepared = true; - } - - public void UpdateSettingsForRendering( - float gradientContributionFromOriginalTexture, - float gradientScrollingSpeed, - float flatGradientOffset, - float gradientColorDominance) - { - this._shaderData.UseColor(gradientScrollingSpeed, gradientContributionFromOriginalTexture, gradientColorDominance); - this._shaderData.UseOpacity(flatGradientOffset); - } - } -} diff --git a/GameContent/PortalHelper.cs b/GameContent/PortalHelper.cs index 0047292..df9839b 100644 --- a/GameContent/PortalHelper.cs +++ b/GameContent/PortalHelper.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.PortalHelper -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -38,7 +38,6 @@ namespace Terraria.GameContent new Point(1, 1), new Point(-1, 1) }; - private static bool anyPortalAtAll = false; static PortalHelper() { @@ -53,7 +52,6 @@ namespace Terraria.GameContent public static void UpdatePortalPoints() { - PortalHelper.anyPortalAtAll = false; for (int index = 0; index < PortalHelper.FoundPortals.GetLength(0); ++index) { PortalHelper.FoundPortals[index, 0] = -1; @@ -73,18 +71,12 @@ namespace Terraria.GameContent { Projectile projectile = Main.projectile[index]; if (projectile.active && projectile.type == 602 && (double) projectile.ai[1] >= 0.0 && (double) projectile.ai[1] <= 1.0 && projectile.owner >= 0 && projectile.owner <= (int) byte.MaxValue) - { PortalHelper.FoundPortals[projectile.owner, (int) projectile.ai[1]] = index; - if (PortalHelper.FoundPortals[projectile.owner, 0] != -1 && PortalHelper.FoundPortals[projectile.owner, 1] != -1) - PortalHelper.anyPortalAtAll = true; - } } } public static void TryGoingThroughPortals(Entity ent) { - if (!PortalHelper.anyPortalAtAll) - return; float collisionPoint = 0.0f; Vector2 velocity = ent.velocity; int width = ent.width; @@ -156,15 +148,12 @@ namespace Terraria.GameContent NPC npc = (NPC) ent; npc.lastPortalColorIndex = num3; npc.Teleport(newPos, 4, extraInfo); - if (Main.netMode == 2) + if (Main.netMode == 1) { NetMessage.SendData(100, number: npc.whoAmI, number2: newPos.X, number3: newPos.Y, number4: ((float) extraInfo)); NetMessage.SendData(23, number: npc.whoAmI); } PortalHelper.PortalCooldownForPlayers[index1] = 10; - if (bonusY != -1 || (double) ent.velocity.Y <= -3.0) - return; - ent.velocity.Y = -3f; return; default: return; @@ -232,23 +221,19 @@ namespace Terraria.GameContent private static bool IsValidLine(Point position, int xOffset, int yOffset) { - Tile tile = Main.tile[position.X, position.Y]; - Tile t1 = Main.tile[position.X - xOffset, position.Y - yOffset]; - Tile t2 = Main.tile[position.X + xOffset, position.Y + yOffset]; - return !PortalHelper.BlockPortals(Main.tile[position.X + yOffset, position.Y - xOffset]) && !PortalHelper.BlockPortals(Main.tile[position.X + yOffset - xOffset, position.Y - xOffset - yOffset]) && !PortalHelper.BlockPortals(Main.tile[position.X + yOffset + xOffset, position.Y - xOffset + yOffset]) && PortalHelper.CanPlacePortalOn(tile) && PortalHelper.CanPlacePortalOn(t1) && PortalHelper.CanPlacePortalOn(t2) && t1.HasSameSlope(tile) && t2.HasSameSlope(tile); + Tile tile1 = Main.tile[position.X, position.Y]; + Tile tile2 = Main.tile[position.X - xOffset, position.Y - yOffset]; + Tile tile3 = Main.tile[position.X + xOffset, position.Y + yOffset]; + return !PortalHelper.BlockPortals(Main.tile[position.X + yOffset, position.Y - xOffset]) && !PortalHelper.BlockPortals(Main.tile[position.X + yOffset - xOffset, position.Y - xOffset - yOffset]) && !PortalHelper.BlockPortals(Main.tile[position.X + yOffset + xOffset, position.Y - xOffset + yOffset]) && WorldGen.SolidOrSlopedTile(tile1) && WorldGen.SolidOrSlopedTile(tile2) && WorldGen.SolidOrSlopedTile(tile3) && tile2.HasSameSlope(tile1) && tile3.HasSameSlope(tile1); } - private static bool CanPlacePortalOn(Tile t) => PortalHelper.DoesTileTypeSupportPortals(t.type) && WorldGen.SolidOrSlopedTile(t); - - private static bool DoesTileTypeSupportPortals(ushort tileType) => tileType != (ushort) 496; - private static bool BlockPortals(Tile t) => t.active() && !Main.tileCut[(int) t.type] && !TileID.Sets.BreakableWhenPlacing[(int) t.type] && Main.tileSolid[(int) t.type]; private static Vector2 FindCollision(Vector2 startPosition, Vector2 stopPosition) { int lastX = 0; int lastY = 0; - Utils.PlotLine(startPosition.ToTileCoordinates(), stopPosition.ToTileCoordinates(), (Utils.TileActionAttempt) ((x, y) => + Utils.PlotLine(startPosition.ToTileCoordinates(), stopPosition.ToTileCoordinates(), (Utils.PerLinePoint) ((x, y) => { lastX = x; lastY = y; @@ -287,9 +272,9 @@ namespace Terraria.GameContent Vector2 start1; Vector2 end1; PortalHelper.GetPortalEdges(position, angle, out start1, out end1); - for (int index = 0; index < 1000; ++index) + for (int number = 0; number < 1000; ++number) { - Projectile projectile = Main.projectile[index]; + Projectile projectile = Main.projectile[number]; if (projectile.active && projectile.type == 602) { Vector2 start2; @@ -298,8 +283,10 @@ namespace Terraria.GameContent if (Collision.CheckLinevLine(start1, end1, start2, end2).Length != 0) { if (projectile.owner != Main.myPlayer && Main.netMode != 2) - NetMessage.SendData(95, number: projectile.owner, number2: ((float) (int) projectile.ai[1])); + NetMessage.SendData(95, number: number); projectile.Kill(); + if (Main.netMode == 2) + NetMessage.SendData(29, number: projectile.whoAmI, number2: ((float) projectile.owner)); } } } @@ -366,6 +353,7 @@ namespace Terraria.GameContent bonusY = num == 0 ? 1 : -1; return portalPosition + new Vector2((float) (-(double) objectSize.X / 2.0), num == 0 ? 0.0f : -objectSize.Y); default: + Main.NewText("Broken portal! (over4s = " + (object) num + ")"); bonusX = 0; bonusY = 0; return portalPosition; @@ -482,19 +470,19 @@ namespace Terraria.GameContent private static bool SupportedSlope(int x, int y, int slope) { Tile tile = Main.tile[x, y]; - return tile != null && tile.nactive() && !Main.tileCut[(int) tile.type] && !TileID.Sets.BreakableWhenPlacing[(int) tile.type] && Main.tileSolid[(int) tile.type] && (int) tile.slope() == slope && PortalHelper.DoesTileTypeSupportPortals(tile.type); + return tile != null && tile.nactive() && !Main.tileCut[(int) tile.type] && !TileID.Sets.BreakableWhenPlacing[(int) tile.type] && Main.tileSolid[(int) tile.type] && (int) tile.slope() == slope; } private static bool SupportedHalfbrick(int x, int y) { Tile tile = Main.tile[x, y]; - return tile != null && tile.nactive() && !Main.tileCut[(int) tile.type] && !TileID.Sets.BreakableWhenPlacing[(int) tile.type] && Main.tileSolid[(int) tile.type] && tile.halfBrick() && PortalHelper.DoesTileTypeSupportPortals(tile.type); + return tile != null && tile.nactive() && !Main.tileCut[(int) tile.type] && !TileID.Sets.BreakableWhenPlacing[(int) tile.type] && Main.tileSolid[(int) tile.type] && tile.halfBrick(); } private static bool SupportedNormal(int x, int y) { Tile tile = Main.tile[x, y]; - return tile != null && tile.nactive() && !Main.tileCut[(int) tile.type] && !TileID.Sets.BreakableWhenPlacing[(int) tile.type] && Main.tileSolid[(int) tile.type] && !TileID.Sets.NotReallySolid[(int) tile.type] && !tile.halfBrick() && tile.slope() == (byte) 0 && PortalHelper.DoesTileTypeSupportPortals(tile.type); + return tile != null && tile.nactive() && !Main.tileCut[(int) tile.type] && !TileID.Sets.BreakableWhenPlacing[(int) tile.type] && Main.tileSolid[(int) tile.type] && !TileID.Sets.NotReallySolid[(int) tile.type] && !tile.halfBrick() && tile.slope() == (byte) 0; } } } diff --git a/GameContent/PotionOfReturnGateHelper.cs b/GameContent/PotionOfReturnGateHelper.cs deleted file mode 100644 index fbfce00..0000000 --- a/GameContent/PotionOfReturnGateHelper.cs +++ /dev/null @@ -1,146 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.PotionOfReturnGateHelper -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using System.Collections.Generic; -using Terraria.DataStructures; -using Terraria.ID; - -namespace Terraria.GameContent -{ - public struct PotionOfReturnGateHelper - { - private readonly Vector2 _position; - private readonly float _opacity; - private readonly int _frameNumber; - private readonly PotionOfReturnGateHelper.GateType _gateType; - - public PotionOfReturnGateHelper( - PotionOfReturnGateHelper.GateType gateType, - Vector2 worldPosition, - float opacity) - { - this._gateType = gateType; - worldPosition.Y -= 2f; - this._position = worldPosition; - this._opacity = opacity; - int num = (int) (((double) Main.tileFrameCounter[491] + (double) this._position.X + (double) this._position.Y) % 40.0) / 5; - if (gateType == PotionOfReturnGateHelper.GateType.ExitPoint) - num = 7 - num; - this._frameNumber = num; - } - - public void Update() - { - Lighting.AddLight(this._position, 0.4f, 0.2f, 0.9f); - this.SpawnReturnPortalDust(); - } - - public void SpawnReturnPortalDust() - { - if (this._gateType == PotionOfReturnGateHelper.GateType.EntryPoint) - { - if (Main.rand.Next(3) != 0) - return; - if (Main.rand.Next(2) == 0) - { - Vector2 vector2 = Vector2.UnitY.RotatedByRandom(6.28318548202515) * new Vector2(0.5f, 1f); - Dust dust = Dust.NewDustDirect(this._position - vector2 * 30f, 0, 0, Utils.SelectRandom(Main.rand, 86, 88)); - dust.noGravity = true; - dust.noLightEmittence = true; - dust.position = this._position - vector2.SafeNormalize(Vector2.Zero) * (float) Main.rand.Next(10, 21); - dust.velocity = vector2.RotatedBy(1.57079637050629) * 2f; - dust.scale = 0.5f + Main.rand.NextFloat(); - dust.fadeIn = 0.5f; - dust.customData = (object) this; - dust.position += dust.velocity * 10f; - dust.velocity *= -1f; - } - else - { - Vector2 vector2 = Vector2.UnitY.RotatedByRandom(6.28318548202515) * new Vector2(0.5f, 1f); - Dust dust = Dust.NewDustDirect(this._position - vector2 * 30f, 0, 0, 240); - dust.noGravity = true; - dust.noLight = true; - dust.position = this._position - vector2.SafeNormalize(Vector2.Zero) * (float) Main.rand.Next(5, 10); - dust.velocity = vector2.RotatedBy(-1.57079637050629) * 3f; - dust.scale = 0.5f + Main.rand.NextFloat(); - dust.fadeIn = 0.5f; - dust.customData = (object) this; - dust.position += dust.velocity * 10f; - dust.velocity *= -1f; - } - } - else - { - if (Main.rand.Next(3) != 0) - return; - if (Main.rand.Next(2) == 0) - { - Vector2 spinningpoint = Vector2.UnitY.RotatedByRandom(6.28318548202515) * new Vector2(0.5f, 1f); - Dust dust = Dust.NewDustDirect(this._position - spinningpoint * 30f, 0, 0, Utils.SelectRandom(Main.rand, 86, 88)); - dust.noGravity = true; - dust.noLightEmittence = true; - dust.position = this._position; - dust.velocity = spinningpoint.RotatedBy(-0.785398185253143) * 2f; - dust.scale = 0.5f + Main.rand.NextFloat(); - dust.fadeIn = 0.5f; - dust.customData = (object) this; - dust.position += spinningpoint * new Vector2(20f); - } - else - { - Vector2 spinningpoint = Vector2.UnitY.RotatedByRandom(6.28318548202515) * new Vector2(0.5f, 1f); - Dust dust = Dust.NewDustDirect(this._position - spinningpoint * 30f, 0, 0, Utils.SelectRandom(Main.rand, 86, 88)); - dust.noGravity = true; - dust.noLightEmittence = true; - dust.position = this._position; - dust.velocity = spinningpoint.RotatedBy(-0.785398185253143) * 2f; - dust.scale = 0.5f + Main.rand.NextFloat(); - dust.fadeIn = 0.5f; - dust.customData = (object) this; - dust.position += spinningpoint * new Vector2(20f); - } - } - } - - public void DrawToDrawData(List drawDataList, int selectionMode) - { - short num1 = this._gateType == PotionOfReturnGateHelper.GateType.EntryPoint ? (short) 183 : (short) 184; - Asset tex = TextureAssets.Extra[(int) num1]; - Rectangle r = tex.Frame(verticalFrames: 8, frameY: this._frameNumber); - Color color = Color.Lerp(Lighting.GetColor(this._position.ToTileCoordinates()), Color.White, 0.5f) * this._opacity; - DrawData drawData1 = new DrawData(tex.Value, this._position - Main.screenPosition, new Rectangle?(r), color, 0.0f, r.Size() / 2f, 1f, SpriteEffects.None, 0); - drawDataList.Add(drawData1); - for (float num2 = 0.0f; (double) num2 < 1.0; num2 += 0.34f) - { - DrawData drawData2 = drawData1; - drawData2.color = new Color((int) sbyte.MaxValue, 50, (int) sbyte.MaxValue, 0) * this._opacity; - drawData2.scale *= 1.1f; - float x = ((float) ((double) Main.GlobalTimeWrappedHourly / 5.0 * 6.28318548202515)).ToRotationVector2().X; - drawData2.color *= (float) ((double) x * 0.100000001490116 + 0.300000011920929); - drawData2.position += ((float) (((double) Main.GlobalTimeWrappedHourly / 5.0 + (double) num2) * 6.28318548202515)).ToRotationVector2() * (float) ((double) x * 1.0 + 2.0); - drawDataList.Add(drawData2); - } - if (selectionMode == 0) - return; - int averageTileLighting = ((int) color.R + (int) color.G + (int) color.B) / 3; - if (averageTileLighting <= 10) - return; - Color selectionGlowColor = Colors.GetSelectionGlowColor(selectionMode == 2, averageTileLighting); - drawData1 = new DrawData(TextureAssets.Extra[93].Value, this._position - Main.screenPosition, new Rectangle?(r), selectionGlowColor, 0.0f, r.Size() / 2f, 1f, SpriteEffects.None, 0); - drawDataList.Add(drawData1); - } - - public enum GateType - { - EntryPoint, - ExitPoint, - } - } -} diff --git a/GameContent/PressurePlateHelper.cs b/GameContent/PressurePlateHelper.cs index dad2c58..6ce70f7 100644 --- a/GameContent/PressurePlateHelper.cs +++ b/GameContent/PressurePlateHelper.cs @@ -1,19 +1,18 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.PressurePlateHelper -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using System.Collections.Generic; -using System.Linq; namespace Terraria.GameContent { public class PressurePlateHelper { public static Dictionary PressurePlatesPressed = new Dictionary(); - public static bool NeedsFirstUpdate; + public static bool NeedsFirstUpdate = false; private static Vector2[] PlayerLastPosition = new Vector2[(int) byte.MaxValue]; private static Rectangle pressurePlateBounds = new Rectangle(0, 0, 16, 10); @@ -36,8 +35,8 @@ namespace Terraria.GameContent public static void ResetPlayer(int player) { - foreach (Point location in PressurePlateHelper.PressurePlatesPressed.Keys.ToArray()) - PressurePlateHelper.MoveAwayFrom(location, player); + foreach (bool[] flagArray in PressurePlateHelper.PressurePlatesPressed.Values) + flagArray[player] = false; } public static void UpdatePlayerPosition(Player player) diff --git a/GameContent/Profiles.cs b/GameContent/Profiles.cs deleted file mode 100644 index c8ae69b..0000000 --- a/GameContent/Profiles.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Profiles -// 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.Graphics; -using ReLogic.Content; -using System.Collections.Generic; -using Terraria.Localization; - -namespace Terraria.GameContent -{ - public class Profiles - { - public class LegacyNPCProfile : ITownNPCProfile - { - private string _rootFilePath; - private int _defaultVariationHeadIndex; - private Asset _defaultNoAlt; - private Asset _defaultParty; - - public LegacyNPCProfile(string npcFileTitleFilePath, int defaultHeadIndex) - { - this._rootFilePath = npcFileTitleFilePath; - this._defaultVariationHeadIndex = defaultHeadIndex; - this._defaultNoAlt = Main.Assets.Request(npcFileTitleFilePath + "_Default", (AssetRequestMode) 0); - this._defaultParty = Main.Assets.Request(npcFileTitleFilePath + "_Default_Party", (AssetRequestMode) 0); - } - - public int RollVariation() => 0; - - public string GetNameForVariant(NPC npc) => NPC.getNewNPCName(npc.type); - - public Asset GetTextureNPCShouldUse(NPC npc) => npc.IsABestiaryIconDummy || npc.altTexture != 1 ? this._defaultNoAlt : this._defaultParty; - - public int GetHeadTextureIndex(NPC npc) => this._defaultVariationHeadIndex; - } - - public class TransformableNPCProfile : ITownNPCProfile - { - private string _rootFilePath; - private int _defaultVariationHeadIndex; - private Asset _defaultNoAlt; - private Asset _defaultTransformed; - - public TransformableNPCProfile(string npcFileTitleFilePath, int defaultHeadIndex) - { - this._rootFilePath = npcFileTitleFilePath; - this._defaultVariationHeadIndex = defaultHeadIndex; - this._defaultNoAlt = Main.Assets.Request(npcFileTitleFilePath + "_Default", (AssetRequestMode) 0); - this._defaultTransformed = Main.Assets.Request(npcFileTitleFilePath + "_Default_Transformed", (AssetRequestMode) 0); - } - - public int RollVariation() => 0; - - public string GetNameForVariant(NPC npc) => NPC.getNewNPCName(npc.type); - - public Asset GetTextureNPCShouldUse(NPC npc) => npc.IsABestiaryIconDummy || npc.altTexture != 2 ? this._defaultNoAlt : this._defaultTransformed; - - public int GetHeadTextureIndex(NPC npc) => this._defaultVariationHeadIndex; - } - - public class VariantNPCProfile : ITownNPCProfile - { - private string _rootFilePath; - private string _npcBaseName; - private int[] _variantHeadIDs; - private string[] _variants; - private Dictionary> _variantTextures = new Dictionary>(); - - public VariantNPCProfile( - string npcFileTitleFilePath, - string npcBaseName, - int[] variantHeadIds, - params string[] variantTextureNames) - { - this._rootFilePath = npcFileTitleFilePath; - this._npcBaseName = npcBaseName; - this._variantHeadIDs = variantHeadIds; - this._variants = variantTextureNames; - foreach (string variant in this._variants) - { - string key = this._rootFilePath + "_" + variant; - this._variantTextures[key] = Main.Assets.Request(key, (AssetRequestMode) 0); - } - } - - public int RollVariation() => Main.rand.Next(this._variants.Length); - - public string GetNameForVariant(NPC npc) => Language.RandomFromCategory(this._npcBaseName + "Names_" + this._variants[npc.townNpcVariationIndex], WorldGen.genRand).Value; - - public Asset GetTextureNPCShouldUse(NPC npc) - { - string key = this._rootFilePath + "_" + this._variants[npc.townNpcVariationIndex]; - return npc.IsABestiaryIconDummy || npc.altTexture != 1 || !this._variantTextures.ContainsKey(key + "_Party") ? this._variantTextures[key] : this._variantTextures[key + "_Party"]; - } - - public int GetHeadTextureIndex(NPC npc) => this._variantHeadIDs[npc.townNpcVariationIndex]; - } - } -} diff --git a/GameContent/RGB/BlizzardShader.cs b/GameContent/RGB/BlizzardShader.cs deleted file mode 100644 index 6daaebb..0000000 --- a/GameContent/RGB/BlizzardShader.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.BlizzardShader -// 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; -using ReLogic.Peripherals.RGB; - -namespace Terraria.GameContent.RGB -{ - public class BlizzardShader : ChromaShader - { - private readonly Vector4 _backColor = new Vector4(0.1f, 0.1f, 0.3f, 1f); - private readonly Vector4 _frontColor = new Vector4(1f, 1f, 1f, 1f); - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - if (quality == null) - time *= 0.25f; - for (int index = 0; index < fragment.Count; ++index) - { - float staticNoise = NoiseHelper.GetStaticNoise(fragment.GetCanvasPositionOfIndex(index) * new Vector2(0.2f, 0.4f) + new Vector2(time * 0.35f, time * -0.35f)); - Vector4 vector4 = Vector4.Lerp(this._backColor, this._frontColor, staticNoise * staticNoise); - fragment.SetColor(index, vector4); - } - } - } -} diff --git a/GameContent/RGB/BrainShader.cs b/GameContent/RGB/BrainShader.cs deleted file mode 100644 index 9d0381a..0000000 --- a/GameContent/RGB/BrainShader.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.BrainShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class BrainShader : ChromaShader - { - private readonly Vector4 _brainColor; - private readonly Vector4 _veinColor; - - public BrainShader(Color brainColor, Color veinColor) - { - this._brainColor = brainColor.ToVector4(); - this._veinColor = veinColor.ToVector4(); - } - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - Vector4 vector4 = Vector4.Lerp(this._brainColor, this._veinColor, Math.Max(0.0f, (float) Math.Sin((double) time * 3.0))); - for (int index = 0; index < fragment.Count; ++index) - fragment.SetColor(index, vector4); - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - Vector2 vector2 = new Vector2(1.6f, 0.5f); - Vector4 vector4_1 = Vector4.Lerp(this._brainColor, this._veinColor, (float) ((double) Math.Max(0.0f, (float) Math.Sin((double) time * 3.0)) * 0.5 + 0.5)); - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Vector4 brainColor = this._brainColor; - float amount = Math.Max(0.0f, (float) (1.0 - 5.0 * (Math.Sin((double) NoiseHelper.GetDynamicNoise(canvasPositionOfIndex * 0.15f + new Vector2(time * (1f / 500f)), time * 0.03f) * 10.0) * 0.5 + 0.5))); - Vector4 vector4_2 = Vector4.Lerp(brainColor, vector4_1, amount); - fragment.SetColor(index, vector4_2); - } - } - } -} diff --git a/GameContent/RGB/CavernShader.cs b/GameContent/RGB/CavernShader.cs deleted file mode 100644 index 9835703..0000000 --- a/GameContent/RGB/CavernShader.cs +++ /dev/null @@ -1,68 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.CavernShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class CavernShader : ChromaShader - { - private readonly Vector4 _backColor; - private readonly Vector4 _frontColor; - private readonly float _speed; - - public CavernShader(Color backColor, Color frontColor, float speed) - { - this._backColor = backColor.ToVector4(); - this._frontColor = frontColor.ToVector4(); - this._speed = speed; - } - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Vector4 vector4 = Vector4.Lerp(this._backColor, this._frontColor, (float) (Math.Sin((double) time * (double) this._speed + (double) canvasPositionOfIndex.X) * 0.5 + 0.5)); - fragment.SetColor(index, vector4); - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - time *= this._speed * 0.5f; - float num1 = time % 1f; - int num2 = (double) time % 2.0 > 1.0 ? 1 : 0; - Vector4 vector4_1 = num2 != 0 ? this._frontColor : this._backColor; - Vector4 vector4_2 = num2 != 0 ? this._backColor : this._frontColor; - float num3 = num1 * 1.2f; - for (int index = 0; index < fragment.Count; ++index) - { - float staticNoise = NoiseHelper.GetStaticNoise(fragment.GetCanvasPositionOfIndex(index) * 0.5f + new Vector2(0.0f, time * 0.5f)); - Vector4 vector4_3 = vector4_1; - float num4 = staticNoise + num3; - if ((double) num4 > 0.999000012874603) - { - float amount = MathHelper.Clamp((float) (((double) num4 - 0.999000012874603) / 0.200000002980232), 0.0f, 1f); - vector4_3 = Vector4.Lerp(vector4_3, vector4_2, amount); - } - fragment.SetColor(index, vector4_3); - } - } - } -} diff --git a/GameContent/RGB/CommonConditions.cs b/GameContent/RGB/CommonConditions.cs deleted file mode 100644 index c0041f3..0000000 --- a/GameContent/RGB/CommonConditions.cs +++ /dev/null @@ -1,188 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.CommonConditions -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public static class CommonConditions - { - public static readonly ChromaCondition InMenu = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => Main.gameMenu && !Main.drunkWorld)); - public static readonly ChromaCondition DrunkMenu = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => Main.gameMenu && Main.drunkWorld)); - - public abstract class ConditionBase : ChromaCondition - { - protected Player CurrentPlayer => Main.player[Main.myPlayer]; - } - - private class SimpleCondition : CommonConditions.ConditionBase - { - private Func _condition; - - public SimpleCondition(Func condition) => this._condition = condition; - - public virtual bool IsActive() => this._condition(this.CurrentPlayer); - } - - public static class SurfaceBiome - { - public static readonly ChromaCondition Ocean = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneBeach && player.ZoneOverworldHeight)); - public static readonly ChromaCondition Desert = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneDesert && !player.ZoneBeach && player.ZoneOverworldHeight)); - public static readonly ChromaCondition Jungle = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneJungle && player.ZoneOverworldHeight)); - public static readonly ChromaCondition Snow = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneSnow && player.ZoneOverworldHeight)); - public static readonly ChromaCondition Mushroom = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneGlowshroom && player.ZoneOverworldHeight)); - public static readonly ChromaCondition Corruption = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneCorrupt && player.ZoneOverworldHeight)); - public static readonly ChromaCondition Hallow = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneHallow && player.ZoneOverworldHeight)); - public static readonly ChromaCondition Crimson = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneCrimson && player.ZoneOverworldHeight)); - } - - public static class MiscBiome - { - public static readonly ChromaCondition Meteorite = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneMeteor)); - } - - public static class UndergroundBiome - { - public static readonly ChromaCondition Hive = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneHive)); - public static readonly ChromaCondition Jungle = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneJungle && !player.ZoneOverworldHeight)); - public static readonly ChromaCondition Mushroom = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneGlowshroom && !player.ZoneOverworldHeight)); - public static readonly ChromaCondition Ice = (ChromaCondition) new CommonConditions.SimpleCondition(new Func(CommonConditions.UndergroundBiome.InIce)); - public static readonly ChromaCondition HallowIce = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => CommonConditions.UndergroundBiome.InIce(player) && player.ZoneHallow)); - public static readonly ChromaCondition CrimsonIce = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => CommonConditions.UndergroundBiome.InIce(player) && player.ZoneCrimson)); - public static readonly ChromaCondition CorruptIce = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => CommonConditions.UndergroundBiome.InIce(player) && player.ZoneCorrupt)); - public static readonly ChromaCondition Hallow = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneHallow && !player.ZoneOverworldHeight)); - public static readonly ChromaCondition Crimson = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneCrimson && !player.ZoneOverworldHeight)); - public static readonly ChromaCondition Corrupt = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneCorrupt && !player.ZoneOverworldHeight)); - public static readonly ChromaCondition Desert = (ChromaCondition) new CommonConditions.SimpleCondition(new Func(CommonConditions.UndergroundBiome.InDesert)); - public static readonly ChromaCondition HallowDesert = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => CommonConditions.UndergroundBiome.InDesert(player) && player.ZoneHallow)); - public static readonly ChromaCondition CrimsonDesert = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => CommonConditions.UndergroundBiome.InDesert(player) && player.ZoneCrimson)); - public static readonly ChromaCondition CorruptDesert = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => CommonConditions.UndergroundBiome.InDesert(player) && player.ZoneCorrupt)); - public static readonly ChromaCondition Temple = (ChromaCondition) new CommonConditions.SimpleCondition(new Func(CommonConditions.UndergroundBiome.InTemple)); - public static readonly ChromaCondition Dungeon = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneDungeon)); - public static readonly ChromaCondition Marble = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneMarble)); - public static readonly ChromaCondition Granite = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneGranite)); - public static readonly ChromaCondition GemCave = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneGemCave)); - - private static bool InTemple(Player player) - { - int x = (int) ((double) player.position.X + (double) (player.width / 2)) / 16; - int y = (int) ((double) player.position.Y + (double) (player.height / 2)) / 16; - return WorldGen.InWorld(x, y) && Main.tile[x, y] != null && Main.tile[x, y].wall == (ushort) 87; - } - - private static bool InIce(Player player) => player.ZoneSnow && !player.ZoneOverworldHeight; - - private static bool InDesert(Player player) => player.ZoneDesert && !player.ZoneOverworldHeight; - } - - public static class Boss - { - public static int HighestTierBossOrEvent; - public static readonly ChromaCondition EaterOfWorlds = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => CommonConditions.Boss.HighestTierBossOrEvent == 13)); - public static readonly ChromaCondition Destroyer = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => CommonConditions.Boss.HighestTierBossOrEvent == 134)); - public static readonly ChromaCondition KingSlime = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => CommonConditions.Boss.HighestTierBossOrEvent == 50)); - public static readonly ChromaCondition QueenSlime = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => CommonConditions.Boss.HighestTierBossOrEvent == 657)); - public static readonly ChromaCondition BrainOfCthulhu = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => CommonConditions.Boss.HighestTierBossOrEvent == 266)); - public static readonly ChromaCondition DukeFishron = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => CommonConditions.Boss.HighestTierBossOrEvent == 370)); - public static readonly ChromaCondition QueenBee = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => CommonConditions.Boss.HighestTierBossOrEvent == 222)); - public static readonly ChromaCondition Plantera = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => CommonConditions.Boss.HighestTierBossOrEvent == 262)); - public static readonly ChromaCondition Empress = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => CommonConditions.Boss.HighestTierBossOrEvent == 636)); - public static readonly ChromaCondition EyeOfCthulhu = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => CommonConditions.Boss.HighestTierBossOrEvent == 4)); - public static readonly ChromaCondition TheTwins = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => CommonConditions.Boss.HighestTierBossOrEvent == 126)); - public static readonly ChromaCondition MoonLord = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => CommonConditions.Boss.HighestTierBossOrEvent == 398)); - public static readonly ChromaCondition WallOfFlesh = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => CommonConditions.Boss.HighestTierBossOrEvent == 113)); - public static readonly ChromaCondition Golem = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => CommonConditions.Boss.HighestTierBossOrEvent == 245)); - public static readonly ChromaCondition Cultist = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => CommonConditions.Boss.HighestTierBossOrEvent == 439)); - public static readonly ChromaCondition Skeletron = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => CommonConditions.Boss.HighestTierBossOrEvent == 35)); - public static readonly ChromaCondition SkeletronPrime = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => CommonConditions.Boss.HighestTierBossOrEvent == (int) sbyte.MaxValue)); - } - - public static class Weather - { - public static readonly ChromaCondition Rain = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneRain && !player.ZoneSnow && !player.ZoneSandstorm)); - public static readonly ChromaCondition Sandstorm = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneSandstorm)); - public static readonly ChromaCondition Blizzard = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneSnow && player.ZoneRain)); - public static readonly ChromaCondition SlimeRain = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => Main.slimeRain && player.ZoneOverworldHeight)); - } - - public static class Depth - { - public static readonly ChromaCondition Sky = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => (double) player.position.Y / 16.0 < Main.worldSurface * 0.449999988079071)); - public static readonly ChromaCondition Surface = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneOverworldHeight && (double) player.position.Y / 16.0 >= Main.worldSurface * 0.449999988079071 && !CommonConditions.Depth.IsPlayerInFrontOfDirtWall(player))); - public static readonly ChromaCondition Vines = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneOverworldHeight && (double) player.position.Y / 16.0 >= Main.worldSurface * 0.449999988079071 && CommonConditions.Depth.IsPlayerInFrontOfDirtWall(player))); - public static readonly ChromaCondition Underground = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneDirtLayerHeight)); - public static readonly ChromaCondition Caverns = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneRockLayerHeight && player.position.ToTileCoordinates().Y <= Main.maxTilesY - 400)); - public static readonly ChromaCondition Magma = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneRockLayerHeight && player.position.ToTileCoordinates().Y > Main.maxTilesY - 400)); - public static readonly ChromaCondition Underworld = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneUnderworldHeight)); - - private static bool IsPlayerInFrontOfDirtWall(Player player) - { - Point tileCoordinates = player.Center.ToTileCoordinates(); - if (!WorldGen.InWorld(tileCoordinates.X, tileCoordinates.Y) || Main.tile[tileCoordinates.X, tileCoordinates.Y] == null) - return false; - switch (Main.tile[tileCoordinates.X, tileCoordinates.Y].wall) - { - case 2: - case 16: - case 54: - case 55: - case 56: - case 57: - case 58: - case 59: - case 61: - case 170: - case 171: - case 185: - case 196: - case 197: - case 198: - case 199: - case 212: - case 213: - case 214: - case 215: - return true; - default: - return false; - } - } - } - - public static class Events - { - public static readonly ChromaCondition BloodMoon = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => Main.bloodMoon && !Main.snowMoon && !Main.pumpkinMoon)); - public static readonly ChromaCondition FrostMoon = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => Main.snowMoon)); - public static readonly ChromaCondition PumpkinMoon = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => Main.pumpkinMoon)); - public static readonly ChromaCondition SolarEclipse = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => Main.eclipse)); - public static readonly ChromaCondition SolarPillar = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneTowerSolar)); - public static readonly ChromaCondition NebulaPillar = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneTowerNebula)); - public static readonly ChromaCondition VortexPillar = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneTowerVortex)); - public static readonly ChromaCondition StardustPillar = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.ZoneTowerStardust)); - public static readonly ChromaCondition PirateInvasion = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => CommonConditions.Boss.HighestTierBossOrEvent == -3)); - public static readonly ChromaCondition DD2Event = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => CommonConditions.Boss.HighestTierBossOrEvent == -6)); - public static readonly ChromaCondition FrostLegion = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => CommonConditions.Boss.HighestTierBossOrEvent == -2)); - public static readonly ChromaCondition MartianMadness = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => CommonConditions.Boss.HighestTierBossOrEvent == -4)); - public static readonly ChromaCondition GoblinArmy = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => CommonConditions.Boss.HighestTierBossOrEvent == -1)); - } - - public static class Alert - { - public static readonly ChromaCondition MoonlordComing = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => NPC.MoonLordCountdown > 0)); - public static readonly ChromaCondition Drowning = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.breath != player.breathMax)); - public static readonly ChromaCondition Keybinds = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => Main.InGameUI.CurrentState == Main.ManageControlsMenu || Main.MenuUI.CurrentState == Main.ManageControlsMenu)); - public static readonly ChromaCondition LavaIndicator = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.lavaWet)); - } - - public static class CriticalAlert - { - public static readonly ChromaCondition LowLife = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => Main.ChromaPainter.PotionAlert)); - public static readonly ChromaCondition Death = (ChromaCondition) new CommonConditions.SimpleCondition((Func) (player => player.dead)); - } - } -} diff --git a/GameContent/RGB/CorruptSurfaceShader.cs b/GameContent/RGB/CorruptSurfaceShader.cs deleted file mode 100644 index 2811858..0000000 --- a/GameContent/RGB/CorruptSurfaceShader.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.CorruptSurfaceShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class CorruptSurfaceShader : ChromaShader - { - private readonly Vector4 _baseColor; - private readonly Vector4 _skyColor; - private Vector4 _lightColor; - - public CorruptSurfaceShader(Color color) - { - this._baseColor = color.ToVector4(); - this._skyColor = Vector4.Lerp(this._baseColor, Color.DeepSkyBlue.ToVector4(), 0.5f); - } - - public CorruptSurfaceShader(Color vineColor, Color skyColor) - { - this._baseColor = vineColor.ToVector4(); - this._skyColor = skyColor.ToVector4(); - } - - public virtual void Update(float elapsedTime) => this._lightColor = Main.ColorOfTheSkies.ToVector4() * 0.75f + Vector4.One * 0.25f; - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - Vector4 vector4_1 = this._skyColor * this._lightColor; - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Vector4 vector4_2 = Vector4.Lerp(this._baseColor, vector4_1, (float) (Math.Sin((double) time * 0.5 + (double) canvasPositionOfIndex.X) * 0.5 + 0.5)); - fragment.SetColor(index, vector4_2); - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - Vector4 vector4_1 = this._skyColor * this._lightColor; - for (int index = 0; index < fragment.Count; ++index) - { - Point gridPositionOfIndex = fragment.GetGridPositionOfIndex(index); - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - float num1 = (float) (((double) NoiseHelper.GetStaticNoise(gridPositionOfIndex.X) * 10.0 + (double) time * 0.400000005960464) % 10.0); - float num2 = 1f; - if ((double) num1 > 1.0) - { - num2 = MathHelper.Clamp((float) (1.0 - ((double) num1 - 1.39999997615814)), 0.0f, 1f); - num1 = 1f; - } - float num3 = (float) (Math.Sin((double) canvasPositionOfIndex.X) * 0.300000011920929 + 0.699999988079071); - float num4 = num1 - (1f - canvasPositionOfIndex.Y); - Vector4 vector4_2 = vector4_1; - if ((double) num4 > 0.0) - { - float num5 = 1f; - if ((double) num4 < 0.200000002980232) - num5 = num4 * 5f; - vector4_2 = Vector4.Lerp(vector4_2, this._baseColor, num5 * num2); - } - if ((double) canvasPositionOfIndex.Y > (double) num3) - vector4_2 = this._baseColor; - fragment.SetColor(index, vector4_2); - } - } - } -} diff --git a/GameContent/RGB/CultistShader.cs b/GameContent/RGB/CultistShader.cs deleted file mode 100644 index 90f15e0..0000000 --- a/GameContent/RGB/CultistShader.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.CultistShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class CultistShader : ChromaShader - { - private readonly Vector4 _lightningDarkColor = new Color(23, 11, 23).ToVector4(); - private readonly Vector4 _lightningBrightColor = new Color(249, 140, (int) byte.MaxValue).ToVector4(); - private readonly Vector4 _fireDarkColor = Color.Red.ToVector4(); - private readonly Vector4 _fireBrightColor = new Color((int) byte.MaxValue, 196, 0).ToVector4(); - private readonly Vector4 _iceDarkColor = new Color(4, 4, 148).ToVector4(); - private readonly Vector4 _iceBrightColor = new Color(208, 233, (int) byte.MaxValue).ToVector4(); - private readonly Vector4 _backgroundColor = Color.Black.ToVector4(); - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - time *= 2f; - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Vector4 backgroundColor = this._backgroundColor; - float num1 = time * 0.5f + canvasPositionOfIndex.X + canvasPositionOfIndex.Y; - float amount = MathHelper.Clamp((float) (Math.Cos((double) num1) * 2.0 + 2.0), 0.0f, 1f); - float num2 = (float) (((double) num1 + 3.14159274101257) % 18.8495559692383); - Vector4 vector4_1; - if ((double) num2 < 6.28318548202515) - { - float staticNoise = NoiseHelper.GetStaticNoise(canvasPositionOfIndex * 0.3f + new Vector2(12.5f, time * 0.2f)); - vector4_1 = Vector4.Lerp(this._fireDarkColor, this._fireBrightColor, MathHelper.Clamp(Math.Max(0.0f, (float) (1.0 - (double) staticNoise * (double) staticNoise * 4.0 * (double) staticNoise)), 0.0f, 1f)); - } - else - vector4_1 = (double) num2 >= 12.5663709640503 ? Vector4.Lerp(this._lightningDarkColor, this._lightningBrightColor, Math.Max(0.0f, (float) (1.0 - 5.0 * (Math.Sin((double) NoiseHelper.GetDynamicNoise(canvasPositionOfIndex * 0.15f, time * 0.05f) * 15.0) * 0.5 + 0.5)))) : Vector4.Lerp(this._iceDarkColor, this._iceBrightColor, Math.Max(0.0f, (float) (1.0 - (double) NoiseHelper.GetDynamicNoise(new Vector2((float) (((double) canvasPositionOfIndex.X + (double) canvasPositionOfIndex.Y) * 0.200000002980232), 0.0f), time / 5f) * 1.5))); - Vector4 vector4_2 = Vector4.Lerp(backgroundColor, vector4_1, amount); - fragment.SetColor(index, vector4_2); - } - } - } -} diff --git a/GameContent/RGB/DD2Shader.cs b/GameContent/RGB/DD2Shader.cs deleted file mode 100644 index 47799a0..0000000 --- a/GameContent/RGB/DD2Shader.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.DD2Shader -// 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; -using ReLogic.Peripherals.RGB; - -namespace Terraria.GameContent.RGB -{ - public class DD2Shader : ChromaShader - { - private readonly Vector4 _darkGlowColor; - private readonly Vector4 _lightGlowColor; - - public DD2Shader(Color darkGlowColor, Color lightGlowColor) - { - this._darkGlowColor = darkGlowColor.ToVector4(); - this._lightGlowColor = lightGlowColor.ToVector4(); - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - Vector2 vector2_1 = fragment.CanvasCenter; - if (quality == null) - vector2_1 = new Vector2(1.7f, 0.5f); - time *= 0.5f; - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Vector4 vector4_1 = new Vector4(0.0f, 0.0f, 0.0f, 1f); - Vector2 vector2_2 = vector2_1; - float num1 = (canvasPositionOfIndex - vector2_2).Length(); - float num2 = (float) ((double) num1 * (double) num1 * 0.75); - float num3 = (float) (((double) num1 - (double) time) % 1.0); - if ((double) num3 < 0.0) - ++num3; - float num4 = (double) num3 <= 0.800000011920929 ? num3 / 0.8f : num3 * (float) (1.0 - ((double) num3 - 1.0 + 0.200000002980232) / 0.200000002980232); - Vector4 vector4_2 = Vector4.Lerp(this._darkGlowColor, this._lightGlowColor, num4 * num4); - float amount1 = num4 * (float) ((double) MathHelper.Clamp(1f - num2, 0.0f, 1f) * 0.75 + 0.25); - vector4_1 = Vector4.Lerp(vector4_1, vector4_2, amount1); - if ((double) num1 < 0.5) - { - float amount2 = 1f - MathHelper.Clamp((float) (((double) num1 - 0.5 + 0.400000005960464) / 0.400000005960464), 0.0f, 1f); - vector4_1 = Vector4.Lerp(vector4_1, this._lightGlowColor, amount2); - } - fragment.SetColor(index, vector4_1); - } - } - } -} diff --git a/GameContent/RGB/DeathShader.cs b/GameContent/RGB/DeathShader.cs deleted file mode 100644 index 15195cf..0000000 --- a/GameContent/RGB/DeathShader.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.DeathShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class DeathShader : ChromaShader - { - private readonly Vector4 _primaryColor; - private readonly Vector4 _secondaryColor; - - public DeathShader(Color primaryColor, Color secondaryColor) - { - this._primaryColor = primaryColor.ToVector4(); - this._secondaryColor = secondaryColor.ToVector4(); - } - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - time *= 3f; - float amount = 0.0f; - float num = time % 12.56637f; - if ((double) num < 3.14159274101257) - amount = (float) Math.Sin((double) num); - for (int index = 0; index < fragment.Count; ++index) - { - Vector4 vector4 = Vector4.Lerp(this._primaryColor, this._secondaryColor, amount); - fragment.SetColor(index, vector4); - } - } - } -} diff --git a/GameContent/RGB/DebugKeyboard.cs b/GameContent/RGB/DebugKeyboard.cs deleted file mode 100644 index 1eabf14..0000000 --- a/GameContent/RGB/DebugKeyboard.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.DebugKeyboard -// 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; -using ReLogic.Graphics; -using ReLogic.Peripherals.RGB; - -namespace Terraria.GameContent.RGB -{ - internal class DebugKeyboard : RgbDevice - { - private DebugKeyboard(Fragment fragment) - : base((RgbDeviceVendor) 4, (RgbDeviceType) 6, fragment, new DeviceColorProfile()) - { - } - - public static DebugKeyboard Create() - { - int num1 = 400; - int num2 = 100; - Point[] pointArray = new Point[num1 * num2]; - for (int index1 = 0; index1 < num2; ++index1) - { - for (int index2 = 0; index2 < num1; ++index2) - pointArray[index1 * num1 + index2] = new Point(index2 / 10, index1 / 10); - } - Vector2[] vector2Array = new Vector2[num1 * num2]; - for (int index3 = 0; index3 < num2; ++index3) - { - for (int index4 = 0; index4 < num1; ++index4) - vector2Array[index3 * num1 + index4] = new Vector2((float) index4 / (float) num2, (float) index3 / (float) num2); - } - return new DebugKeyboard(Fragment.FromCustom(pointArray, vector2Array)); - } - - public virtual void Present() - { - } - - public virtual void DebugDraw(IDebugDrawer drawer, Vector2 position, float scale) - { - for (int index = 0; index < this.LedCount; ++index) - { - Vector2 ledCanvasPosition = this.GetLedCanvasPosition(index); - drawer.DrawSquare(new Vector4(ledCanvasPosition * scale + position, scale / 100f, scale / 100f), new Color(this.GetUnprocessedLedColor(index))); - } - } - } -} diff --git a/GameContent/RGB/DesertShader.cs b/GameContent/RGB/DesertShader.cs deleted file mode 100644 index 3144df6..0000000 --- a/GameContent/RGB/DesertShader.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.DesertShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class DesertShader : ChromaShader - { - private readonly Vector4 _baseColor; - private readonly Vector4 _sandColor; - - public DesertShader(Color baseColor, Color sandColor) - { - this._baseColor = baseColor.ToVector4(); - this._sandColor = sandColor.ToVector4(); - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - fragment.GetGridPositionOfIndex(index); - canvasPositionOfIndex.Y += (float) Math.Sin((double) canvasPositionOfIndex.X * 2.0 + (double) time * 2.0) * 0.2f; - float staticNoise = NoiseHelper.GetStaticNoise(canvasPositionOfIndex * new Vector2(0.1f, 0.5f)); - Vector4 vector4 = Vector4.Lerp(this._baseColor, this._sandColor, staticNoise * staticNoise); - fragment.SetColor(index, vector4); - } - } - } -} diff --git a/GameContent/RGB/DrippingShader.cs b/GameContent/RGB/DrippingShader.cs deleted file mode 100644 index a37ec76..0000000 --- a/GameContent/RGB/DrippingShader.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.DrippingShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class DrippingShader : ChromaShader - { - private readonly Vector4 _baseColor; - private readonly Vector4 _liquidColor; - private readonly float _viscosity; - - public DrippingShader(Color baseColor, Color liquidColor, float viscosity = 1f) - { - this._baseColor = baseColor.ToVector4(); - this._liquidColor = liquidColor.ToVector4(); - this._viscosity = viscosity; - } - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Vector4 vector4 = Vector4.Lerp(this._baseColor, this._liquidColor, (float) (Math.Sin((double) time * 0.5 + (double) canvasPositionOfIndex.X) * 0.5 + 0.5)); - fragment.SetColor(index, vector4); - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - fragment.GetGridPositionOfIndex(index); - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - float staticNoise = NoiseHelper.GetStaticNoise(canvasPositionOfIndex * new Vector2(0.7f * this._viscosity, 0.075f) + new Vector2(0.0f, time * -0.1f * this._viscosity)); - Vector4 vector4 = Vector4.Lerp(this._baseColor, this._liquidColor, Math.Max(0.0f, (float) (1.0 - ((double) canvasPositionOfIndex.Y * 4.5 + 0.5) * (double) staticNoise))); - fragment.SetColor(index, vector4); - } - } - } -} diff --git a/GameContent/RGB/DrowningShader.cs b/GameContent/RGB/DrowningShader.cs deleted file mode 100644 index a8c6bcf..0000000 --- a/GameContent/RGB/DrowningShader.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.DrowningShader -// 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; -using ReLogic.Peripherals.RGB; - -namespace Terraria.GameContent.RGB -{ - public class DrowningShader : ChromaShader - { - private float _breath = 1f; - - public virtual void Update(float elapsedTime) - { - Player player = Main.player[Main.myPlayer]; - this._breath = (float) (player.breath * player.breathCDMax - player.breathCD) / (float) (player.breathMax * player.breathCDMax); - } - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - fragment.GetCanvasPositionOfIndex(index); - Vector4 vector4 = new Vector4(0.0f, 0.0f, 1f, 1f - this._breath); - fragment.SetColor(index, vector4); - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - float num = (float) ((double) this._breath * 1.20000004768372 - 0.100000001490116); - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Vector4 vector4 = Vector4.Zero; - if ((double) canvasPositionOfIndex.Y > (double) num) - vector4 = new Vector4(0.0f, 0.0f, 1f, MathHelper.Clamp((float) (((double) canvasPositionOfIndex.Y - (double) num) * 5.0), 0.0f, 1f)); - fragment.SetColor(index, vector4); - } - } - } -} diff --git a/GameContent/RGB/DukeFishronShader.cs b/GameContent/RGB/DukeFishronShader.cs deleted file mode 100644 index fae6b93..0000000 --- a/GameContent/RGB/DukeFishronShader.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.DukeFishronShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class DukeFishronShader : ChromaShader - { - private readonly Vector4 _primaryColor; - private readonly Vector4 _secondaryColor; - - public DukeFishronShader(Color primaryColor, Color secondaryColor) - { - this._primaryColor = primaryColor.ToVector4(); - this._secondaryColor = secondaryColor.ToVector4(); - } - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Vector4 vector4 = Vector4.Lerp(this._primaryColor, this._secondaryColor, Math.Max(0.0f, (float) Math.Sin((double) time * 2.0 + (double) canvasPositionOfIndex.X))); - fragment.SetColor(index, vector4); - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - float dynamicNoise = NoiseHelper.GetDynamicNoise(fragment.GetGridPositionOfIndex(index).Y, time); - Vector4 vector4 = Vector4.Lerp(this._primaryColor, this._secondaryColor, Math.Max(0.0f, (float) Math.Sin((double) canvasPositionOfIndex.X + 2.0 * (double) time + (double) dynamicNoise) - 0.2f)); - fragment.SetColor(index, vector4); - } - } - } -} diff --git a/GameContent/RGB/DungeonShader.cs b/GameContent/RGB/DungeonShader.cs deleted file mode 100644 index e8ba2c4..0000000 --- a/GameContent/RGB/DungeonShader.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.DungeonShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class DungeonShader : ChromaShader - { - private readonly Vector4 _backgroundColor = new Color(5, 5, 5).ToVector4(); - private readonly Vector4 _spiritTrailColor = new Color(6, 51, 222).ToVector4(); - private readonly Vector4 _spiritColor = Color.White.ToVector4(); - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Point gridPositionOfIndex = fragment.GetGridPositionOfIndex(index); - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - float num = (float) ((((double) NoiseHelper.GetStaticNoise(gridPositionOfIndex.Y) * 10.0 + (double) time) % 10.0 - ((double) canvasPositionOfIndex.X + 2.0)) * 0.5); - Vector4 vector4_1 = this._backgroundColor; - if ((double) num > 0.0) - { - float amount1 = Math.Max(0.0f, 1.2f - num); - float amount2 = MathHelper.Clamp(amount1 * amount1 * amount1, 0.0f, 1f); - if ((double) num < 0.200000002980232) - amount1 = num / 0.2f; - Vector4 vector4_2 = Vector4.Lerp(this._spiritTrailColor, this._spiritColor, amount2); - vector4_1 = Vector4.Lerp(vector4_1, vector4_2, amount1); - } - fragment.SetColor(index, vector4_1); - } - } - } -} diff --git a/GameContent/RGB/EmpressShader.cs b/GameContent/RGB/EmpressShader.cs deleted file mode 100644 index 7e516f6..0000000 --- a/GameContent/RGB/EmpressShader.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.EmpressShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class EmpressShader : ChromaShader - { - private static readonly Vector4[] _colors = new Vector4[12] - { - new Vector4(1f, 0.1f, 0.1f, 1f), - new Vector4(1f, 0.5f, 0.1f, 1f), - new Vector4(1f, 1f, 0.1f, 1f), - new Vector4(0.5f, 1f, 0.1f, 1f), - new Vector4(0.1f, 1f, 0.1f, 1f), - new Vector4(0.1f, 1f, 0.5f, 1f), - new Vector4(0.1f, 1f, 1f, 1f), - new Vector4(0.1f, 0.5f, 1f, 1f), - new Vector4(0.1f, 0.1f, 1f, 1f), - new Vector4(0.5f, 0.1f, 1f, 1f), - new Vector4(1f, 0.1f, 1f, 1f), - new Vector4(1f, 0.1f, 0.5f, 1f) - }; - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - float num1 = time * 2f; - for (int index = 0; index < fragment.Count; ++index) - { - Point gridPositionOfIndex = fragment.GetGridPositionOfIndex(index); - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - double num2 = (double) MathHelper.Max(0.0f, (float) Math.Cos(((double) NoiseHelper.GetStaticNoise(gridPositionOfIndex.X) + (double) num1) * 6.28318548202515 * 0.200000002980232)); - Vector4 vector4_1 = Color.Lerp(Color.Black, Color.Indigo, 0.5f).ToVector4(); - Math.Max(0.0f, (float) Math.Sin((double) Main.GlobalTimeWrappedHourly * 2.0 + (double) canvasPositionOfIndex.X * 1.0)); - float amount1 = 0.0f; - Vector4 vector4_2 = Vector4.Lerp(vector4_1, new Vector4(1f, 0.1f, 0.1f, 1f), amount1); - double x = (double) canvasPositionOfIndex.X; - float amount2 = (float) ((num2 + x + (double) canvasPositionOfIndex.Y) % 1.0); - if ((double) amount2 > 0.0) - { - int num3 = (gridPositionOfIndex.X + gridPositionOfIndex.Y) % EmpressShader._colors.Length; - if (num3 < 0) - { - int num4 = num3 + EmpressShader._colors.Length; - } - Vector4 vector4_3 = Main.hslToRgb((float) ((((double) canvasPositionOfIndex.X + (double) canvasPositionOfIndex.Y) * 0.150000005960464 + (double) time * 0.100000001490116) % 1.0), 1f, 0.5f).ToVector4(); - vector4_2 = Vector4.Lerp(vector4_2, vector4_3, amount2); - } - fragment.SetColor(index, vector4_2); - } - } - - private static void RedsVersion(Fragment fragment, float time) - { - time *= 3f; - for (int index1 = 0; index1 < fragment.Count; ++index1) - { - Point gridPositionOfIndex = fragment.GetGridPositionOfIndex(index1); - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index1); - float num = (float) (((double) NoiseHelper.GetStaticNoise(gridPositionOfIndex.X) * 7.0 + (double) time * 0.400000005960464) % 7.0) - canvasPositionOfIndex.Y; - Vector4 vector4 = new Vector4(); - if ((double) num > 0.0) - { - float amount = Math.Max(0.0f, 1.4f - num); - if ((double) num < 0.400000005960464) - amount = num / 0.4f; - int index2 = (gridPositionOfIndex.X + EmpressShader._colors.Length + (int) ((double) time / 6.0)) % EmpressShader._colors.Length; - vector4 = Vector4.Lerp(vector4, EmpressShader._colors[index2], amount); - } - fragment.SetColor(index1, vector4); - } - } - } -} diff --git a/GameContent/RGB/EyeOfCthulhuShader.cs b/GameContent/RGB/EyeOfCthulhuShader.cs deleted file mode 100644 index 841b91e..0000000 --- a/GameContent/RGB/EyeOfCthulhuShader.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.EyeOfCthulhuShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class EyeOfCthulhuShader : ChromaShader - { - private readonly Vector4 _eyeColor; - private readonly Vector4 _veinColor; - private readonly Vector4 _backgroundColor; - - public EyeOfCthulhuShader(Color eyeColor, Color veinColor, Color backgroundColor) - { - this._eyeColor = eyeColor.ToVector4(); - this._veinColor = veinColor.ToVector4(); - this._backgroundColor = backgroundColor.ToVector4(); - } - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Vector4 vector4 = Vector4.Lerp(this._veinColor, this._eyeColor, (float) (Math.Sin((double) time + (double) canvasPositionOfIndex.X * 4.0) * 0.5 + 0.5)); - fragment.SetColor(index, vector4); - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - if (device.Type != null && device.Type != 6) - { - this.ProcessLowDetail(device, fragment, quality, time); - } - else - { - float num1 = (float) ((double) time * 0.200000002980232 % 2.0); - int num2 = 1; - if ((double) num1 > 1.0) - { - num1 = 2f - num1; - num2 = -1; - } - Vector2 vector2_1 = new Vector2((float) ((double) num1 * 7.0 - 3.5), 0.0f) + fragment.CanvasCenter; - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Vector4 vector4_1 = this._backgroundColor; - Vector2 vector2_2 = vector2_1; - Vector2 vector2_3 = canvasPositionOfIndex - vector2_2; - float num3 = vector2_3.Length(); - if ((double) num3 < 0.5) - { - float amount1 = 1f - MathHelper.Clamp((float) (((double) num3 - 0.5 + 0.200000002980232) / 0.200000002980232), 0.0f, 1f); - float amount2 = MathHelper.Clamp((float) (((double) vector2_3.X + 0.5 - 0.200000002980232) / 0.600000023841858), 0.0f, 1f); - if (num2 == 1) - amount2 = 1f - amount2; - Vector4 vector4_2 = Vector4.Lerp(this._eyeColor, this._veinColor, amount2); - vector4_1 = Vector4.Lerp(vector4_1, vector4_2, amount1); - } - fragment.SetColor(index, vector4_1); - } - } - } - } -} diff --git a/GameContent/RGB/EyeballShader.cs b/GameContent/RGB/EyeballShader.cs deleted file mode 100644 index 4bfa68f..0000000 --- a/GameContent/RGB/EyeballShader.cs +++ /dev/null @@ -1,160 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.EyeballShader -// 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; -using ReLogic.Peripherals.RGB; -using System; -using Terraria.Utilities; - -namespace Terraria.GameContent.RGB -{ - public class EyeballShader : ChromaShader - { - private static readonly EyeballShader.Ring[] Rings = new EyeballShader.Ring[5] - { - new EyeballShader.Ring(Color.Black.ToVector4(), 0.0f), - new EyeballShader.Ring(Color.Black.ToVector4(), 0.4f), - new EyeballShader.Ring(new Color(17, 220, 237).ToVector4(), 0.5f), - new EyeballShader.Ring(new Color(17, 120, 237).ToVector4(), 0.6f), - new EyeballShader.Ring(Vector4.One, 0.65f) - }; - private readonly Vector4 _eyelidColor = new Color(108, 110, 75).ToVector4(); - private float _eyelidProgress; - private Vector2 _pupilOffset = Vector2.Zero; - private Vector2 _targetOffset = Vector2.Zero; - private readonly UnifiedRandom _random = new UnifiedRandom(); - private float _timeUntilPupilMove; - private float _eyelidStateTime; - private readonly bool _isSpawning; - private EyeballShader.EyelidState _eyelidState; - - public EyeballShader(bool isSpawning) => this._isSpawning = isSpawning; - - public virtual void Update(float elapsedTime) - { - this.UpdateEyelid(elapsedTime); - int num1 = (double) this._timeUntilPupilMove <= 0.0 ? 1 : 0; - this._pupilOffset = (this._targetOffset + this._pupilOffset) * 0.5f; - this._timeUntilPupilMove -= elapsedTime; - if (num1 == 0) - return; - float num2 = (float) this._random.NextDouble() * 6.283185f; - float num3; - if (this._isSpawning) - { - this._timeUntilPupilMove = (float) (this._random.NextDouble() * 0.400000005960464 + 0.300000011920929); - num3 = (float) this._random.NextDouble() * 0.7f; - } - else - { - this._timeUntilPupilMove = (float) (this._random.NextDouble() * 0.400000005960464 + 0.600000023841858); - num3 = (float) this._random.NextDouble() * 0.3f; - } - this._targetOffset = new Vector2((float) Math.Cos((double) num2), (float) Math.Sin((double) num2)) * num3; - } - - private void UpdateEyelid(float elapsedTime) - { - float num1 = 0.5f; - float num2 = 6f; - if (this._isSpawning) - { - if (NPC.MoonLordCountdown >= 3590) - { - this._eyelidStateTime = 0.0f; - this._eyelidState = EyeballShader.EyelidState.Closed; - } - num1 = (float) ((double) NPC.MoonLordCountdown / 3600.0 * 10.0 + 0.5); - num2 = 2f; - } - this._eyelidStateTime += elapsedTime; - switch (this._eyelidState) - { - case EyeballShader.EyelidState.Closed: - this._eyelidProgress = 0.0f; - if ((double) this._eyelidStateTime <= (double) num1) - break; - this._eyelidStateTime = 0.0f; - this._eyelidState = EyeballShader.EyelidState.Opening; - break; - case EyeballShader.EyelidState.Opening: - this._eyelidProgress = this._eyelidStateTime / 0.4f; - if ((double) this._eyelidStateTime <= 0.400000005960464) - break; - this._eyelidStateTime = 0.0f; - this._eyelidState = EyeballShader.EyelidState.Open; - break; - case EyeballShader.EyelidState.Open: - this._eyelidProgress = 1f; - if ((double) this._eyelidStateTime <= (double) num2) - break; - this._eyelidStateTime = 0.0f; - this._eyelidState = EyeballShader.EyelidState.Closing; - break; - case EyeballShader.EyelidState.Closing: - this._eyelidProgress = (float) (1.0 - (double) this._eyelidStateTime / 0.400000005960464); - if ((double) this._eyelidStateTime <= 0.400000005960464) - break; - this._eyelidStateTime = 0.0f; - this._eyelidState = EyeballShader.EyelidState.Closed; - break; - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - Vector2 vector2_1 = new Vector2(1.5f, 0.5f); - Vector2 vector2_2 = vector2_1 + this._pupilOffset; - for (int index1 = 0; index1 < fragment.Count; ++index1) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index1); - Vector2 vector2_3 = canvasPositionOfIndex - vector2_1; - Vector4 vector4 = Vector4.One; - float num1 = (vector2_2 - canvasPositionOfIndex).Length(); - for (int index2 = 1; index2 < EyeballShader.Rings.Length; ++index2) - { - EyeballShader.Ring ring1 = EyeballShader.Rings[index2]; - EyeballShader.Ring ring2 = EyeballShader.Rings[index2 - 1]; - if ((double) num1 < (double) ring1.Distance) - { - vector4 = Vector4.Lerp(ring2.Color, ring1.Color, (float) (((double) num1 - (double) ring2.Distance) / ((double) ring1.Distance - (double) ring2.Distance))); - break; - } - } - float num2 = (float) Math.Sqrt(1.0 - 0.400000005960464 * (double) vector2_3.Y * (double) vector2_3.Y) * 5f; - float num3 = Math.Abs(vector2_3.X) - num2 * (float) (1.10000002384186 * (double) this._eyelidProgress - 0.100000001490116); - if ((double) num3 > 0.0) - vector4 = Vector4.Lerp(vector4, this._eyelidColor, Math.Min(1f, num3 * 10f)); - fragment.SetColor(index1, vector4); - } - } - - private struct Ring - { - public readonly Vector4 Color; - public readonly float Distance; - - public Ring(Vector4 color, float distance) - { - this.Color = color; - this.Distance = distance; - } - } - - private enum EyelidState - { - Closed, - Opening, - Open, - Closing, - } - } -} diff --git a/GameContent/RGB/FrostLegionShader.cs b/GameContent/RGB/FrostLegionShader.cs deleted file mode 100644 index 309c01d..0000000 --- a/GameContent/RGB/FrostLegionShader.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.FrostLegionShader -// 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; -using ReLogic.Peripherals.RGB; - -namespace Terraria.GameContent.RGB -{ - public class FrostLegionShader : ChromaShader - { - private readonly Vector4 _primaryColor; - private readonly Vector4 _secondaryColor; - - public FrostLegionShader(Color primaryColor, Color secondaryColor) - { - this._primaryColor = primaryColor.ToVector4(); - this._secondaryColor = secondaryColor.ToVector4(); - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - float staticNoise = NoiseHelper.GetStaticNoise(fragment.GetGridPositionOfIndex(index).X / 2); - float num = (float) (((double) canvasPositionOfIndex.Y + (double) canvasPositionOfIndex.X / 2.0 - (double) staticNoise + (double) time) % 2.0); - if ((double) num < 0.0) - num += 2f; - if ((double) num < 0.200000002980232) - num = (float) (1.0 - (double) num / 0.200000002980232); - Vector4 vector4 = Vector4.Lerp(this._primaryColor, this._secondaryColor, num / 2f); - fragment.SetColor(index, vector4); - } - } - } -} diff --git a/GameContent/RGB/GemCaveShader.cs b/GameContent/RGB/GemCaveShader.cs deleted file mode 100644 index 7d07a47..0000000 --- a/GameContent/RGB/GemCaveShader.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.GemCaveShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class GemCaveShader : ChromaShader - { - private readonly Vector4 _primaryColor; - private readonly Vector4 _secondaryColor; - private static readonly Vector4[] _gemColors = new Vector4[7] - { - Color.White.ToVector4(), - Color.Yellow.ToVector4(), - Color.Orange.ToVector4(), - Color.Red.ToVector4(), - Color.Green.ToVector4(), - Color.Blue.ToVector4(), - Color.Purple.ToVector4() - }; - - public GemCaveShader(Color primaryColor, Color secondaryColor) - { - this._primaryColor = primaryColor.ToVector4(); - this._secondaryColor = secondaryColor.ToVector4(); - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - time *= 0.25f; - float num1 = time % 1f; - int num2 = (double) time % 2.0 > 1.0 ? 1 : 0; - Vector4 vector4_1 = num2 != 0 ? this._secondaryColor : this._primaryColor; - Vector4 vector4_2 = num2 != 0 ? this._primaryColor : this._secondaryColor; - float num3 = num1 * 1.2f; - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Point gridPositionOfIndex = fragment.GetGridPositionOfIndex(index); - float staticNoise = NoiseHelper.GetStaticNoise(canvasPositionOfIndex * 0.5f + new Vector2(0.0f, time * 0.5f)); - Vector4 vector4_3 = vector4_1; - float num4 = staticNoise + num3; - if ((double) num4 > 0.999000012874603) - { - float amount = MathHelper.Clamp((float) (((double) num4 - 0.999000012874603) / 0.200000002980232), 0.0f, 1f); - vector4_3 = Vector4.Lerp(vector4_3, vector4_2, amount); - } - float amount1 = Math.Max(0.0f, (float) (1.0 - (double) NoiseHelper.GetDynamicNoise(gridPositionOfIndex.X, gridPositionOfIndex.Y, time / 100f) * 20.0)); - Vector4 vector4_4 = Vector4.Lerp(vector4_3, GemCaveShader._gemColors[((gridPositionOfIndex.Y * 47 + gridPositionOfIndex.X) % GemCaveShader._gemColors.Length + GemCaveShader._gemColors.Length) % GemCaveShader._gemColors.Length], amount1); - fragment.SetColor(index, vector4_4); - fragment.SetColor(index, vector4_4); - } - } - } -} diff --git a/GameContent/RGB/GoblinArmyShader.cs b/GameContent/RGB/GoblinArmyShader.cs deleted file mode 100644 index 86aea47..0000000 --- a/GameContent/RGB/GoblinArmyShader.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.GoblinArmyShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class GoblinArmyShader : ChromaShader - { - private readonly Vector4 _primaryColor; - private readonly Vector4 _secondaryColor; - - public GoblinArmyShader(Color primaryColor, Color secondaryColor) - { - this._primaryColor = primaryColor.ToVector4(); - this._secondaryColor = secondaryColor.ToVector4(); - } - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - time *= 0.5f; - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - canvasPositionOfIndex.Y = 1f; - float staticNoise = NoiseHelper.GetStaticNoise(canvasPositionOfIndex * 0.3f + new Vector2(12.5f, time * 0.2f)); - float amount = MathHelper.Clamp(Math.Max(0.0f, (float) (1.0 - (double) staticNoise * (double) staticNoise * 4.0 * (double) staticNoise)), 0.0f, 1f); - Vector4 vector4 = Vector4.Lerp(new Vector4(0.0f, 0.0f, 0.0f, 1f), Vector4.Lerp(Vector4.Lerp(this._primaryColor, this._secondaryColor, amount), Vector4.One, amount * amount), amount); - fragment.SetColor(index, vector4); - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - float staticNoise = NoiseHelper.GetStaticNoise(canvasPositionOfIndex * 0.3f + new Vector2(12.5f, time * 0.2f)); - float amount = MathHelper.Clamp(Math.Max(0.0f, (float) (1.0 - (double) staticNoise * (double) staticNoise * 4.0 * (double) staticNoise * (1.20000004768372 - (double) canvasPositionOfIndex.Y))) * canvasPositionOfIndex.Y * canvasPositionOfIndex.Y, 0.0f, 1f); - Vector4 vector4 = Vector4.Lerp(new Vector4(0.0f, 0.0f, 0.0f, 1f), Vector4.Lerp(Vector4.Lerp(this._primaryColor, this._secondaryColor, amount), Vector4.One, amount * amount * amount), amount); - fragment.SetColor(index, vector4); - } - } - } -} diff --git a/GameContent/RGB/GolemShader.cs b/GameContent/RGB/GolemShader.cs deleted file mode 100644 index 23c1ead..0000000 --- a/GameContent/RGB/GolemShader.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.GolemShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class GolemShader : ChromaShader - { - private readonly Vector4 _glowColor; - private readonly Vector4 _coreColor; - private readonly Vector4 _backgroundColor; - - public GolemShader(Color glowColor, Color coreColor, Color backgroundColor) - { - this._glowColor = glowColor.ToVector4(); - this._coreColor = coreColor.ToVector4(); - this._backgroundColor = backgroundColor.ToVector4(); - } - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - Vector4 vector4_1 = Vector4.Lerp(this._backgroundColor, this._coreColor, Math.Max(0.0f, (float) Math.Sin((double) time * 0.5))); - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Vector4 vector4_2 = Vector4.Lerp(vector4_1, this._glowColor, Math.Max(0.0f, (float) Math.Sin((double) canvasPositionOfIndex.X * 2.0 + (double) time + 101.0))); - fragment.SetColor(index, vector4_2); - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - float num1 = (float) (0.5 + Math.Sin((double) time * 3.0) * 0.100000001490116); - Vector2 vector2 = new Vector2(1.6f, 0.5f); - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Point gridPositionOfIndex = fragment.GetGridPositionOfIndex(index); - Vector4 vector4 = this._backgroundColor; - float num2 = (float) (((double) NoiseHelper.GetStaticNoise(gridPositionOfIndex.Y) * 10.0 + (double) time * 2.0) % 10.0) - Math.Abs(canvasPositionOfIndex.X - vector2.X); - if ((double) num2 > 0.0) - { - float amount = Math.Max(0.0f, 1.2f - num2); - if ((double) num2 < 0.200000002980232) - amount = num2 * 5f; - vector4 = Vector4.Lerp(vector4, this._glowColor, amount); - } - float num3 = (canvasPositionOfIndex - vector2).Length(); - if ((double) num3 < (double) num1) - { - float amount = 1f - MathHelper.Clamp((float) (((double) num3 - (double) num1 + 0.100000001490116) / 0.100000001490116), 0.0f, 1f); - vector4 = Vector4.Lerp(vector4, this._coreColor, amount); - } - fragment.SetColor(index, vector4); - } - } - } -} diff --git a/GameContent/RGB/HallowSurfaceShader.cs b/GameContent/RGB/HallowSurfaceShader.cs deleted file mode 100644 index 8f9fea0..0000000 --- a/GameContent/RGB/HallowSurfaceShader.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.HallowSurfaceShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class HallowSurfaceShader : ChromaShader - { - private readonly Vector4 _skyColor = new Color(150, 220, 220).ToVector4(); - private readonly Vector4 _groundColor = new Vector4(1f, 0.2f, 0.25f, 1f); - private readonly Vector4 _pinkFlowerColor = new Vector4(1f, 0.2f, 0.25f, 1f); - private readonly Vector4 _yellowFlowerColor = new Vector4(1f, 1f, 0.0f, 1f); - private Vector4 _lightColor; - - public virtual void Update(float elapsedTime) => this._lightColor = Main.ColorOfTheSkies.ToVector4() * 0.75f + Vector4.One * 0.25f; - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Vector4 vector4 = Vector4.Lerp(this._skyColor, this._groundColor, (float) (Math.Sin((double) time + (double) canvasPositionOfIndex.X) * 0.5 + 0.5)); - fragment.SetColor(index, vector4); - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - Vector4 vector4_1 = this._skyColor * this._lightColor; - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Point gridPositionOfIndex = fragment.GetGridPositionOfIndex(index); - float amount = Math.Max(0.0f, (float) (1.0 - (double) NoiseHelper.GetDynamicNoise(gridPositionOfIndex.X, gridPositionOfIndex.Y, time / 20f) * 5.0)); - Vector4 vector4_2 = vector4_1; - Vector4 vector4_3 = (gridPositionOfIndex.X * 100 + gridPositionOfIndex.Y) % 2 != 0 ? Vector4.Lerp(vector4_2, this._pinkFlowerColor, amount) : Vector4.Lerp(vector4_2, this._yellowFlowerColor, amount); - if ((double) canvasPositionOfIndex.Y > Math.Sin((double) canvasPositionOfIndex.X) * 0.300000011920929 + 0.699999988079071) - vector4_3 = this._groundColor; - fragment.SetColor(index, vector4_3); - } - } - } -} diff --git a/GameContent/RGB/IceShader.cs b/GameContent/RGB/IceShader.cs deleted file mode 100644 index 998e7bf..0000000 --- a/GameContent/RGB/IceShader.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.IceShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class IceShader : ChromaShader - { - private readonly Vector4 _baseColor; - private readonly Vector4 _iceColor; - private readonly Vector4 _shineColor = new Vector4(1f, 1f, 0.7f, 1f); - - public IceShader(Color baseColor, Color iceColor) - { - this._baseColor = baseColor.ToVector4(); - this._iceColor = iceColor.ToVector4(); - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - float amount1 = Math.Max(0.0f, (float) (1.0 - (double) NoiseHelper.GetDynamicNoise(new Vector2((float) (((double) canvasPositionOfIndex.X - (double) canvasPositionOfIndex.Y) * 0.200000002980232), 0.0f), time / 5f) * 1.5)); - float amount2 = Math.Max(0.0f, (float) (1.0 - (double) NoiseHelper.GetDynamicNoise(new Vector2((float) (((double) canvasPositionOfIndex.X - (double) canvasPositionOfIndex.Y) * 0.300000011920929), 0.3f), time / 20f) * 5.0)); - Vector4 vector4 = Vector4.Lerp(Vector4.Lerp(this._baseColor, this._iceColor, amount1), this._shineColor, amount2); - fragment.SetColor(index, vector4); - } - } - } -} diff --git a/GameContent/RGB/JungleShader.cs b/GameContent/RGB/JungleShader.cs deleted file mode 100644 index 8d40c36..0000000 --- a/GameContent/RGB/JungleShader.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.JungleShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class JungleShader : ChromaShader - { - private readonly Vector4 _backgroundColor = new Color(40, 80, 0).ToVector4(); - private readonly Vector4 _sporeColor = new Color((int) byte.MaxValue, (int) byte.MaxValue, 0).ToVector4(); - private readonly Vector4[] _flowerColors = new Vector4[5] - { - Color.Yellow.ToVector4(), - Color.Pink.ToVector4(), - Color.Purple.ToVector4(), - Color.Red.ToVector4(), - Color.Blue.ToVector4() - }; - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector4 vector4 = Vector4.Lerp(this._backgroundColor, this._sporeColor, NoiseHelper.GetDynamicNoise(fragment.GetCanvasPositionOfIndex(index) * 0.3f, time / 5f)); - fragment.SetColor(index, vector4); - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - bool flag = device.Type == null || device.Type == 6; - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Point gridPositionOfIndex = fragment.GetGridPositionOfIndex(index); - Vector4 vector4 = Vector4.Lerp(this._backgroundColor, this._sporeColor, Math.Max(0.0f, (float) (1.0 - (double) NoiseHelper.GetDynamicNoise(canvasPositionOfIndex * 0.3f, time / 5f) * 2.5))); - if (flag) - { - float amount = Math.Max(0.0f, (float) (1.0 - (double) NoiseHelper.GetDynamicNoise(gridPositionOfIndex.X, gridPositionOfIndex.Y, time / 100f) * 20.0)); - vector4 = Vector4.Lerp(vector4, this._flowerColors[((gridPositionOfIndex.Y * 47 + gridPositionOfIndex.X) % 5 + 5) % 5], amount); - } - fragment.SetColor(index, vector4); - } - } - } -} diff --git a/GameContent/RGB/KeybindsMenuShader.cs b/GameContent/RGB/KeybindsMenuShader.cs deleted file mode 100644 index 84c0ea5..0000000 --- a/GameContent/RGB/KeybindsMenuShader.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.KeybindsMenuShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - internal class KeybindsMenuShader : ChromaShader - { - private static Vector4 _baseColor = new Color(20, 20, 20, 245).ToVector4(); - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - float num = (float) (Math.Cos((double) time * 1.57079637050629) * 0.200000002980232 + 0.800000011920929); - Vector4 vector4 = KeybindsMenuShader._baseColor * num; - vector4.W = KeybindsMenuShader._baseColor.W; - for (int index = 0; index < fragment.Count; ++index) - fragment.SetColor(index, vector4); - } - } -} diff --git a/GameContent/RGB/KingSlimeShader.cs b/GameContent/RGB/KingSlimeShader.cs deleted file mode 100644 index c62b63c..0000000 --- a/GameContent/RGB/KingSlimeShader.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.KingSlimeShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class KingSlimeShader : ChromaShader - { - private readonly Vector4 _slimeColor; - private readonly Vector4 _debrisColor; - - public KingSlimeShader(Color slimeColor, Color debrisColor) - { - this._slimeColor = slimeColor.ToVector4(); - this._debrisColor = debrisColor.ToVector4(); - } - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector4 vector4 = Vector4.Lerp(this._slimeColor, this._debrisColor, Math.Max(0.0f, (float) (1.0 - (double) NoiseHelper.GetDynamicNoise(fragment.GetCanvasPositionOfIndex(index), time * 0.25f) * 2.0))); - fragment.SetColor(index, vector4); - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - Vector2 vector2 = new Vector2(1.6f, 0.5f); - for (int index = 0; index < fragment.Count; ++index) - { - Vector4 vector4 = Vector4.Lerp(this._slimeColor, this._debrisColor, (float) Math.Sqrt((double) Math.Max(0.0f, (float) (1.0 - (double) NoiseHelper.GetStaticNoise(fragment.GetCanvasPositionOfIndex(index) * 0.3f + new Vector2(0.0f, time * 0.1f)) * 3.0)))); - fragment.SetColor(index, vector4); - } - } - } -} diff --git a/GameContent/RGB/LavaIndicatorShader.cs b/GameContent/RGB/LavaIndicatorShader.cs deleted file mode 100644 index 518c2c9..0000000 --- a/GameContent/RGB/LavaIndicatorShader.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.LavaIndicatorShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class LavaIndicatorShader : ChromaShader - { - private readonly Vector4 _backgroundColor; - private readonly Vector4 _primaryColor; - private readonly Vector4 _secondaryColor; - - public LavaIndicatorShader(Color backgroundColor, Color primaryColor, Color secondaryColor) - { - this._backgroundColor = backgroundColor.ToVector4(); - this._primaryColor = primaryColor.ToVector4(); - this._secondaryColor = secondaryColor.ToVector4(); - } - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - float staticNoise = NoiseHelper.GetStaticNoise(fragment.GetCanvasPositionOfIndex(index) * 0.3f + new Vector2(12.5f, time * 0.2f)); - Vector4 vector4 = Vector4.Lerp(this._primaryColor, this._secondaryColor, MathHelper.Clamp(Math.Max(0.0f, (float) (1.0 - (double) staticNoise * (double) staticNoise * 4.0 * (double) staticNoise)), 0.0f, 1f)); - fragment.SetColor(index, vector4); - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Vector4 vector4_1 = this._backgroundColor; - float num1 = 0.4f + NoiseHelper.GetDynamicNoise(canvasPositionOfIndex * 0.2f, time * 0.5f) * 0.4f; - float num2 = 1.1f - canvasPositionOfIndex.Y; - if ((double) num2 < (double) num1) - { - float staticNoise = NoiseHelper.GetStaticNoise(canvasPositionOfIndex * 0.3f + new Vector2(12.5f, time * 0.2f)); - Vector4 vector4_2 = Vector4.Lerp(this._primaryColor, this._secondaryColor, MathHelper.Clamp(Math.Max(0.0f, (float) (1.0 - (double) staticNoise * (double) staticNoise * 4.0 * (double) staticNoise)), 0.0f, 1f)); - float amount = 1f - MathHelper.Clamp((float) (((double) num2 - (double) num1 + 0.200000002980232) / 0.200000002980232), 0.0f, 1f); - vector4_1 = Vector4.Lerp(vector4_1, vector4_2, amount); - } - fragment.SetColor(index, vector4_1); - } - } - } -} diff --git a/GameContent/RGB/LowLifeShader.cs b/GameContent/RGB/LowLifeShader.cs deleted file mode 100644 index ff1e707..0000000 --- a/GameContent/RGB/LowLifeShader.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.LowLifeShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class LowLifeShader : ChromaShader - { - private static Vector4 _baseColor = new Color(40, 0, 8, (int) byte.MaxValue).ToVector4(); - - [RgbProcessor] - private void ProcessAnyDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - float num = (float) (Math.Cos((double) time * 3.14159274101257) * 0.300000011920929 + 0.699999988079071); - Vector4 vector4 = LowLifeShader._baseColor * num; - vector4.W = LowLifeShader._baseColor.W; - for (int index = 0; index < fragment.Count; ++index) - fragment.SetColor(index, vector4); - } - } -} diff --git a/GameContent/RGB/MartianMadnessShader.cs b/GameContent/RGB/MartianMadnessShader.cs deleted file mode 100644 index 210610b..0000000 --- a/GameContent/RGB/MartianMadnessShader.cs +++ /dev/null @@ -1,105 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.MartianMadnessShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class MartianMadnessShader : ChromaShader - { - private readonly Vector4 _metalColor; - private readonly Vector4 _glassColor; - private readonly Vector4 _beamColor; - private readonly Vector4 _backgroundColor; - - public MartianMadnessShader( - Color metalColor, - Color glassColor, - Color beamColor, - Color backgroundColor) - { - this._metalColor = metalColor.ToVector4(); - this._glassColor = glassColor.ToVector4(); - this._beamColor = beamColor.ToVector4(); - this._backgroundColor = backgroundColor.ToVector4(); - } - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Point gridPositionOfIndex = fragment.GetGridPositionOfIndex(index); - float amount = (float) (Math.Sin((double) time * 2.0 + (double) canvasPositionOfIndex.X * 5.0) * 0.5 + 0.5); - int num = (gridPositionOfIndex.X + gridPositionOfIndex.Y) % 2; - if (num < 0) - num += 2; - Vector4 vector4 = num == 1 ? Vector4.Lerp(this._glassColor, this._beamColor, amount) : this._metalColor; - fragment.SetColor(index, vector4); - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - if (device.Type != null && device.Type != 6) - { - this.ProcessLowDetail(device, fragment, quality, time); - } - else - { - float num1 = (float) ((double) time * 0.5 % 6.28318548202515); - if ((double) num1 > 3.14159274101257) - num1 = 6.283185f - num1; - Vector2 vector2_1 = new Vector2((float) (1.70000004768372 + Math.Cos((double) num1) * 2.0), (float) (Math.Sin((double) num1) * 1.10000002384186 - 0.5)); - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Vector4 vector4 = this._backgroundColor; - float num2 = Math.Abs(vector2_1.X - canvasPositionOfIndex.X); - if ((double) canvasPositionOfIndex.Y > (double) vector2_1.Y && (double) num2 < 0.200000002980232) - { - float num3 = 1f - MathHelper.Clamp((float) (((double) num2 - 0.200000002980232 + 0.200000002980232) / 0.200000002980232), 0.0f, 1f); - float num4 = Math.Max(0.0f, (float) (1.0 - (double) Math.Abs((float) (((double) num1 - 1.57079637050629) / 1.57079637050629)) * 3.0)); - vector4 = Vector4.Lerp(vector4, this._beamColor, num3 * num4); - } - Vector2 vector2_2 = vector2_1 - canvasPositionOfIndex; - vector2_2.X /= 1f; - vector2_2.Y /= 0.2f; - float num5 = vector2_2.Length(); - if ((double) num5 < 1.0) - { - float amount = 1f - MathHelper.Clamp((float) (((double) num5 - 1.0 + 0.200000002980232) / 0.200000002980232), 0.0f, 1f); - vector4 = Vector4.Lerp(vector4, this._metalColor, amount); - } - Vector2 vector2_3 = vector2_1 - canvasPositionOfIndex + new Vector2(0.0f, -0.1f); - vector2_3.X /= 0.3f; - vector2_3.Y /= 0.3f; - if ((double) vector2_3.Y < 0.0) - vector2_3.Y *= 2f; - float num6 = vector2_3.Length(); - if ((double) num6 < 1.0) - { - float amount = 1f - MathHelper.Clamp((float) (((double) num6 - 1.0 + 0.200000002980232) / 0.200000002980232), 0.0f, 1f); - vector4 = Vector4.Lerp(vector4, this._glassColor, amount); - } - fragment.SetColor(index, vector4); - } - } - } - } -} diff --git a/GameContent/RGB/MeteoriteShader.cs b/GameContent/RGB/MeteoriteShader.cs deleted file mode 100644 index 29e132c..0000000 --- a/GameContent/RGB/MeteoriteShader.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.MeteoriteShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class MeteoriteShader : ChromaShader - { - private readonly Vector4 _baseColor = new Color(39, 15, 26).ToVector4(); - private readonly Vector4 _secondaryColor = new Color(69, 50, 43).ToVector4(); - private readonly Vector4 _glowColor = Color.DarkOrange.ToVector4(); - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Vector4 vector4 = Vector4.Lerp(this._baseColor, this._secondaryColor, (float) (Math.Sin((double) time + (double) canvasPositionOfIndex.X) * 0.5 + 0.5)); - fragment.SetColor(index, vector4); - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Point gridPositionOfIndex = fragment.GetGridPositionOfIndex(index); - Vector4 baseColor = this._baseColor; - float dynamicNoise = NoiseHelper.GetDynamicNoise(gridPositionOfIndex.X, gridPositionOfIndex.Y, time / 10f); - Vector4 vector4 = Vector4.Lerp(Vector4.Lerp(baseColor, this._secondaryColor, dynamicNoise * dynamicNoise), this._glowColor, (float) Math.Sqrt((double) Math.Max(0.0f, (float) (1.0 - (double) NoiseHelper.GetDynamicNoise(canvasPositionOfIndex * 0.5f + new Vector2(0.0f, time * 0.05f), time / 20f) * 2.0))) * 0.75f); - fragment.SetColor(index, vector4); - } - } - } -} diff --git a/GameContent/RGB/MoonShader.cs b/GameContent/RGB/MoonShader.cs deleted file mode 100644 index e1f250d..0000000 --- a/GameContent/RGB/MoonShader.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.MoonShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class MoonShader : ChromaShader - { - private readonly Vector4 _moonCoreColor; - private readonly Vector4 _moonRingColor; - private readonly Vector4 _skyColor; - private readonly Vector4 _cloudColor; - private float _progress; - - public MoonShader(Color skyColor, Color moonRingColor, Color moonCoreColor) - : this(skyColor, moonRingColor, moonCoreColor, Color.White) - { - } - - public MoonShader(Color skyColor, Color moonColor) - : this(skyColor, moonColor, moonColor) - { - } - - public MoonShader(Color skyColor, Color moonRingColor, Color moonCoreColor, Color cloudColor) - { - this._skyColor = skyColor.ToVector4(); - this._moonRingColor = moonRingColor.ToVector4(); - this._moonCoreColor = moonCoreColor.ToVector4(); - this._cloudColor = cloudColor.ToVector4(); - } - - public virtual void Update(float elapsedTime) - { - if (Main.dayTime) - this._progress = (float) (Main.time / 54000.0); - else - this._progress = (float) (Main.time / 32400.0); - } - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector4 vector4 = Vector4.Lerp(this._skyColor, this._cloudColor, (float) Math.Sqrt((double) Math.Max(0.0f, (float) (1.0 - 2.0 * (double) NoiseHelper.GetDynamicNoise(fragment.GetCanvasPositionOfIndex(index) * new Vector2(0.1f, 0.5f) + new Vector2(time * 0.02f, 0.0f), time / 40f)))) * 0.1f); - fragment.SetColor(index, vector4); - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - if (device.Type != null && device.Type != 6) - { - this.ProcessLowDetail(device, fragment, quality, time); - } - else - { - Vector2 vector2_1 = new Vector2(2f, 0.5f); - Vector2 vector2_2 = new Vector2(2.5f, 1f); - float num1 = (float) ((double) this._progress * 3.14159274101257 + 3.14159274101257); - Vector2 vector2_3 = new Vector2((float) Math.Cos((double) num1), (float) Math.Sin((double) num1)) * vector2_2 + vector2_1; - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - float num2 = (float) Math.Sqrt((double) Math.Max(0.0f, (float) (1.0 - 2.0 * (double) NoiseHelper.GetDynamicNoise(canvasPositionOfIndex * new Vector2(0.1f, 0.5f) + new Vector2(time * 0.02f, 0.0f), time / 40f)))); - float num3 = (canvasPositionOfIndex - vector2_3).Length(); - Vector4 vector4 = Vector4.Lerp(this._skyColor, this._cloudColor, num2 * 0.15f); - if ((double) num3 < 0.800000011920929) - vector4 = Vector4.Lerp(this._moonRingColor, this._moonCoreColor, Math.Min(0.1f, 0.8f - num3) / 0.1f); - else if ((double) num3 < 1.0) - vector4 = Vector4.Lerp(vector4, this._moonRingColor, Math.Min(0.2f, 1f - num3) / 0.2f); - fragment.SetColor(index, vector4); - } - } - } - } -} diff --git a/GameContent/RGB/NoiseHelper.cs b/GameContent/RGB/NoiseHelper.cs deleted file mode 100644 index 1903403..0000000 --- a/GameContent/RGB/NoiseHelper.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.NoiseHelper -// 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; -using System; -using Terraria.Utilities; - -namespace Terraria.GameContent.RGB -{ - public static class NoiseHelper - { - private const int RANDOM_SEED = 1; - private const int NOISE_2D_SIZE = 32; - private const int NOISE_2D_SIZE_MASK = 31; - private const int NOISE_SIZE_MASK = 1023; - private static readonly float[] StaticNoise = NoiseHelper.CreateStaticNoise(1024); - - private static float[] CreateStaticNoise(int length) - { - UnifiedRandom r = new UnifiedRandom(1); - float[] numArray = new float[length]; - for (int index = 0; index < numArray.Length; ++index) - numArray[index] = r.NextFloat(); - return numArray; - } - - public static float GetDynamicNoise(int index, float currentTime) => Math.Abs(Math.Abs(NoiseHelper.StaticNoise[index & 1023] - currentTime % 1f) - 0.5f) * 2f; - - public static float GetStaticNoise(int index) => NoiseHelper.StaticNoise[index & 1023]; - - public static float GetDynamicNoise(int x, int y, float currentTime) => NoiseHelper.GetDynamicNoiseInternal(x, y, currentTime % 1f); - - private static float GetDynamicNoiseInternal(int x, int y, float wrappedTime) - { - x &= 31; - y &= 31; - return Math.Abs(Math.Abs(NoiseHelper.StaticNoise[y * 32 + x] - wrappedTime) - 0.5f) * 2f; - } - - public static float GetStaticNoise(int x, int y) - { - x &= 31; - y &= 31; - return NoiseHelper.StaticNoise[y * 32 + x]; - } - - public static float GetDynamicNoise(Vector2 position, float currentTime) - { - position *= 10f; - currentTime %= 1f; - Vector2 vector2_1 = new Vector2((float) Math.Floor((double) position.X), (float) Math.Floor((double) position.Y)); - Point point = new Point((int) vector2_1.X, (int) vector2_1.Y); - Vector2 vector2_2 = new Vector2(position.X - vector2_1.X, position.Y - vector2_1.Y); - return MathHelper.Lerp(MathHelper.Lerp(NoiseHelper.GetDynamicNoiseInternal(point.X, point.Y, currentTime), NoiseHelper.GetDynamicNoiseInternal(point.X, point.Y + 1, currentTime), vector2_2.Y), MathHelper.Lerp(NoiseHelper.GetDynamicNoiseInternal(point.X + 1, point.Y, currentTime), NoiseHelper.GetDynamicNoiseInternal(point.X + 1, point.Y + 1, currentTime), vector2_2.Y), vector2_2.X); - } - - public static float GetStaticNoise(Vector2 position) - { - position *= 10f; - Vector2 vector2_1 = new Vector2((float) Math.Floor((double) position.X), (float) Math.Floor((double) position.Y)); - Point point = new Point((int) vector2_1.X, (int) vector2_1.Y); - Vector2 vector2_2 = new Vector2(position.X - vector2_1.X, position.Y - vector2_1.Y); - return MathHelper.Lerp(MathHelper.Lerp(NoiseHelper.GetStaticNoise(point.X, point.Y), NoiseHelper.GetStaticNoise(point.X, point.Y + 1), vector2_2.Y), MathHelper.Lerp(NoiseHelper.GetStaticNoise(point.X + 1, point.Y), NoiseHelper.GetStaticNoise(point.X + 1, point.Y + 1), vector2_2.Y), vector2_2.X); - } - } -} diff --git a/GameContent/RGB/PillarShader.cs b/GameContent/RGB/PillarShader.cs deleted file mode 100644 index 9473fa9..0000000 --- a/GameContent/RGB/PillarShader.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.PillarShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class PillarShader : ChromaShader - { - private readonly Vector4 _primaryColor; - private readonly Vector4 _secondaryColor; - - public PillarShader(Color primaryColor, Color secondaryColor) - { - this._primaryColor = primaryColor.ToVector4(); - this._secondaryColor = secondaryColor.ToVector4(); - } - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Vector4 vector4 = Vector4.Lerp(this._primaryColor, this._secondaryColor, (float) (Math.Sin((double) time * 2.5 + (double) canvasPositionOfIndex.X) * 0.5 + 0.5)); - fragment.SetColor(index, vector4); - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - Vector2 vector2_1 = new Vector2(1.5f, 0.5f); - time *= 4f; - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 vector2_2 = fragment.GetCanvasPositionOfIndex(index) - vector2_1; - float num1 = vector2_2.Length() * 2f; - float num2 = (float) Math.Atan2((double) vector2_2.Y, (double) vector2_2.X); - Vector4 vector4 = Vector4.Lerp(this._primaryColor, this._secondaryColor, (float) (Math.Sin((double) num1 * 4.0 - (double) time - (double) num2) * 0.5 + 0.5)); - if ((double) num1 < 1.0) - { - float num3 = num1 / 1f; - float num4 = num3 * (num3 * num3); - vector4 = Vector4.Lerp(this._primaryColor, this._secondaryColor, (float) (Math.Sin(4.0 - (double) time - (double) num2) * 0.5 + 0.5)) * num4; - } - vector4.W = 1f; - fragment.SetColor(index, vector4); - } - } - } -} diff --git a/GameContent/RGB/PirateInvasionShader.cs b/GameContent/RGB/PirateInvasionShader.cs deleted file mode 100644 index 3222e82..0000000 --- a/GameContent/RGB/PirateInvasionShader.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.PirateInvasionShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class PirateInvasionShader : ChromaShader - { - private readonly Vector4 _cannonBallColor; - private readonly Vector4 _splashColor; - private readonly Vector4 _waterColor; - private readonly Vector4 _backgroundColor; - - public PirateInvasionShader( - Color cannonBallColor, - Color splashColor, - Color waterColor, - Color backgroundColor) - { - this._cannonBallColor = cannonBallColor.ToVector4(); - this._splashColor = splashColor.ToVector4(); - this._waterColor = waterColor.ToVector4(); - this._backgroundColor = backgroundColor.ToVector4(); - } - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Vector4 vector4 = Vector4.Lerp(this._waterColor, this._cannonBallColor, (float) (Math.Sin((double) time * 0.5 + (double) canvasPositionOfIndex.X) * 0.5 + 0.5)); - fragment.SetColor(index, vector4); - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Point gridPositionOfIndex = fragment.GetGridPositionOfIndex(index); - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - gridPositionOfIndex.X /= 2; - double num1 = ((double) NoiseHelper.GetStaticNoise(gridPositionOfIndex.X) * 40.0 + (double) time * 1.0) % 40.0; - float amount1 = 0.0f; - float num2 = (float) (num1 - (double) canvasPositionOfIndex.Y / 1.20000004768372); - if (num1 > 1.0) - { - float num3 = (float) (1.0 - (double) canvasPositionOfIndex.Y / 1.20000004768372); - amount1 = (float) ((1.0 - (double) Math.Min(1f, num2 - num3)) * (1.0 - (double) Math.Min(1f, num3 / 1f))); - } - Vector4 vector4 = this._backgroundColor; - if ((double) num2 > 0.0) - { - float amount2 = Math.Max(0.0f, (float) (1.20000004768372 - (double) num2 * 4.0)); - if ((double) num2 < 0.100000001490116) - amount2 = num2 / 0.1f; - vector4 = Vector4.Lerp(Vector4.Lerp(vector4, this._cannonBallColor, amount2), this._splashColor, amount1); - } - if ((double) canvasPositionOfIndex.Y > 0.800000011920929) - vector4 = this._waterColor; - fragment.SetColor(index, vector4); - } - } - } -} diff --git a/GameContent/RGB/PlanteraShader.cs b/GameContent/RGB/PlanteraShader.cs deleted file mode 100644 index 4555342..0000000 --- a/GameContent/RGB/PlanteraShader.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.PlanteraShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class PlanteraShader : ChromaShader - { - private readonly Vector4 _bulbColor; - private readonly Vector4 _vineColor; - private readonly Vector4 _backgroundColor; - - public PlanteraShader(Color bulbColor, Color vineColor, Color backgroundColor) - { - this._bulbColor = bulbColor.ToVector4(); - this._vineColor = vineColor.ToVector4(); - this._backgroundColor = backgroundColor.ToVector4(); - } - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Vector4 vector4 = Vector4.Lerp(this._bulbColor, this._vineColor, (float) (Math.Sin((double) time * 2.0 + (double) canvasPositionOfIndex.X * 10.0) * 0.5 + 0.5)); - fragment.SetColor(index, vector4); - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Point gridPositionOfIndex = fragment.GetGridPositionOfIndex(index); - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - canvasPositionOfIndex.X -= 1.8f; - if ((double) canvasPositionOfIndex.X < 0.0) - { - canvasPositionOfIndex.X *= -1f; - gridPositionOfIndex.Y += 101; - } - float num1 = (float) (((double) NoiseHelper.GetStaticNoise(gridPositionOfIndex.Y) * 5.0 + (double) time * 0.400000005960464) % 5.0); - float num2 = 1f; - if ((double) num1 > 1.0) - { - num2 = 1f - MathHelper.Clamp((float) (((double) num1 - 0.400000005960464 - 1.0) / 0.400000005960464), 0.0f, 1f); - num1 = 1f; - } - float num3 = num1 - canvasPositionOfIndex.X / 5f; - Vector4 vector4 = this._backgroundColor; - if ((double) num3 > 0.0) - { - float num4 = 1f; - if ((double) num3 < 0.200000002980232) - num4 = num3 / 0.2f; - vector4 = (gridPositionOfIndex.X + 7 * gridPositionOfIndex.Y) % 5 != 0 ? Vector4.Lerp(this._backgroundColor, this._vineColor, num4 * num2) : Vector4.Lerp(this._backgroundColor, this._bulbColor, num4 * num2); - } - fragment.SetColor(index, vector4); - } - } - } -} diff --git a/GameContent/RGB/QueenBeeShader.cs b/GameContent/RGB/QueenBeeShader.cs deleted file mode 100644 index 741af7f..0000000 --- a/GameContent/RGB/QueenBeeShader.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.QueenBeeShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class QueenBeeShader : ChromaShader - { - private readonly Vector4 _primaryColor; - private readonly Vector4 _secondaryColor; - - public QueenBeeShader(Color primaryColor, Color secondaryColor) - { - this._primaryColor = primaryColor.ToVector4(); - this._secondaryColor = secondaryColor.ToVector4(); - } - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Vector4 vector4 = Vector4.Lerp(this._primaryColor, this._secondaryColor, (float) (Math.Sin((double) time * 2.0 + (double) canvasPositionOfIndex.X * 10.0) * 0.5 + 0.5)); - fragment.SetColor(index, vector4); - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - time *= 0.5f; - for (int index = 0; index < fragment.Count; ++index) - { - Vector4 vector4 = Vector4.Lerp(this._primaryColor, this._secondaryColor, MathHelper.Clamp((float) Math.Sin((double) fragment.GetCanvasPositionOfIndex(index).X * 5.0 - 4.0 * (double) time) * 1.5f, 0.0f, 1f)); - fragment.SetColor(index, vector4); - } - } - } -} diff --git a/GameContent/RGB/QueenSlimeShader.cs b/GameContent/RGB/QueenSlimeShader.cs deleted file mode 100644 index e6c0815..0000000 --- a/GameContent/RGB/QueenSlimeShader.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.QueenSlimeShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class QueenSlimeShader : ChromaShader - { - private readonly Vector4 _slimeColor; - private readonly Vector4 _debrisColor; - - public QueenSlimeShader(Color slimeColor, Color debrisColor) - { - this._slimeColor = slimeColor.ToVector4(); - this._debrisColor = debrisColor.ToVector4(); - } - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector4 vector4 = Vector4.Lerp(this._slimeColor, this._debrisColor, Math.Max(0.0f, (float) (1.0 - (double) NoiseHelper.GetDynamicNoise(fragment.GetCanvasPositionOfIndex(index), time * 0.25f) * 2.0))); - fragment.SetColor(index, vector4); - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - Vector2 vector2 = new Vector2(1.6f, 0.5f); - for (int index = 0; index < fragment.Count; ++index) - { - Vector4 vector4 = Vector4.Lerp(this._slimeColor, this._debrisColor, (float) Math.Sqrt((double) Math.Max(0.0f, (float) (1.0 - (double) NoiseHelper.GetStaticNoise(fragment.GetCanvasPositionOfIndex(index) * 0.3f + new Vector2(0.0f, time * 0.1f)) * 3.0)))); - fragment.SetColor(index, vector4); - } - } - } -} diff --git a/GameContent/RGB/RainShader.cs b/GameContent/RGB/RainShader.cs deleted file mode 100644 index cfd21c5..0000000 --- a/GameContent/RGB/RainShader.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.RainShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class RainShader : ChromaShader - { - private bool _inBloodMoon; - - public virtual void Update(float elapsedTime) => this._inBloodMoon = Main.bloodMoon; - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - Vector4 vector4_1 = !this._inBloodMoon ? new Vector4(0.0f, 0.0f, 1f, 1f) : new Vector4(1f, 0.0f, 0.0f, 1f); - Vector4 vector4_2 = new Vector4(0.0f, 0.0f, 0.0f, 0.75f); - for (int index = 0; index < fragment.Count; ++index) - { - Point gridPositionOfIndex = fragment.GetGridPositionOfIndex(index); - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - float num = (float) (((double) NoiseHelper.GetStaticNoise(gridPositionOfIndex.X) * 10.0 + (double) time) % 10.0) - canvasPositionOfIndex.Y; - Vector4 vector4_3 = vector4_2; - if ((double) num > 0.0) - { - float amount = Math.Max(0.0f, 1.2f - num); - if ((double) num < 0.200000002980232) - amount = num * 5f; - vector4_3 = Vector4.Lerp(vector4_3, vector4_1, amount); - } - fragment.SetColor(index, vector4_3); - } - } - } -} diff --git a/GameContent/RGB/SandstormShader.cs b/GameContent/RGB/SandstormShader.cs deleted file mode 100644 index 3a38715..0000000 --- a/GameContent/RGB/SandstormShader.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.SandstormShader -// 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; -using ReLogic.Peripherals.RGB; - -namespace Terraria.GameContent.RGB -{ - public class SandstormShader : ChromaShader - { - private readonly Vector4 _backColor = new Vector4(0.2f, 0.0f, 0.0f, 1f); - private readonly Vector4 _frontColor = new Vector4(1f, 0.5f, 0.0f, 1f); - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - if (quality == null) - time *= 0.25f; - for (int index = 0; index < fragment.Count; ++index) - { - Vector4 vector4 = Vector4.Lerp(this._backColor, this._frontColor, NoiseHelper.GetStaticNoise(fragment.GetCanvasPositionOfIndex(index) * 0.3f + new Vector2(time, -time) * 0.5f)); - fragment.SetColor(index, vector4); - } - } - } -} diff --git a/GameContent/RGB/SkullShader.cs b/GameContent/RGB/SkullShader.cs deleted file mode 100644 index fa801a1..0000000 --- a/GameContent/RGB/SkullShader.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.SkullShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class SkullShader : ChromaShader - { - private readonly Vector4 _skullColor; - private readonly Vector4 _bloodDark; - private readonly Vector4 _bloodLight; - private readonly Vector4 _backgroundColor = Color.Black.ToVector4(); - - public SkullShader(Color skullColor, Color bloodDark, Color bloodLight) - { - this._skullColor = skullColor.ToVector4(); - this._bloodDark = bloodDark.ToVector4(); - this._bloodLight = bloodLight.ToVector4(); - } - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Vector4 vector4 = Vector4.Lerp(this._skullColor, this._bloodLight, (float) (Math.Sin((double) time * 2.0 + (double) canvasPositionOfIndex.X * 2.0) * 0.5 + 0.5)); - fragment.SetColor(index, vector4); - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Point gridPositionOfIndex = fragment.GetGridPositionOfIndex(index); - Vector4 vector4_1 = this._backgroundColor; - float num = (float) (((double) NoiseHelper.GetStaticNoise(gridPositionOfIndex.X) * 10.0 + (double) time * 0.75) % 10.0 + (double) canvasPositionOfIndex.Y - 1.0); - if ((double) num > 0.0) - { - float amount = Math.Max(0.0f, 1.2f - num); - if ((double) num < 0.200000002980232) - amount = num * 5f; - vector4_1 = Vector4.Lerp(vector4_1, this._skullColor, amount); - } - float staticNoise = NoiseHelper.GetStaticNoise(canvasPositionOfIndex * 0.5f + new Vector2(12.5f, time * 0.2f)); - float amount1 = MathHelper.Clamp(Math.Max(0.0f, (float) (1.0 - (double) staticNoise * (double) staticNoise * 4.0 * (double) staticNoise * (1.0 - (double) canvasPositionOfIndex.Y * (double) canvasPositionOfIndex.Y))) * canvasPositionOfIndex.Y * canvasPositionOfIndex.Y, 0.0f, 1f); - Vector4 vector4_2 = Vector4.Lerp(this._bloodDark, this._bloodLight, amount1); - Vector4 vector4_3 = Vector4.Lerp(vector4_1, vector4_2, amount1); - fragment.SetColor(index, vector4_3); - } - } - } -} diff --git a/GameContent/RGB/SkyShader.cs b/GameContent/RGB/SkyShader.cs deleted file mode 100644 index 43ea118..0000000 --- a/GameContent/RGB/SkyShader.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.SkyShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class SkyShader : ChromaShader - { - private readonly Vector4 _baseSkyColor; - private readonly Vector4 _baseSpaceColor; - private Vector4 _processedSkyColor; - private Vector4 _processedCloudColor; - private float _backgroundTransition; - private float _starVisibility; - - public SkyShader(Color skyColor, Color spaceColor) - { - this._baseSkyColor = skyColor.ToVector4(); - this._baseSpaceColor = spaceColor.ToVector4(); - } - - public virtual void Update(float elapsedTime) - { - this._backgroundTransition = MathHelper.Clamp((float) (((double) (Main.player[Main.myPlayer].position.Y / 16f) - Main.worldSurface * 0.25) / (Main.worldSurface * 0.100000001490116)), 0.0f, 1f); - this._processedSkyColor = this._baseSkyColor * (Main.ColorOfTheSkies.ToVector4() * 0.75f + Vector4.One * 0.25f); - this._processedCloudColor = Main.ColorOfTheSkies.ToVector4() * 0.75f + Vector4.One * 0.25f; - if (Main.dayTime) - { - float num = (float) (Main.time / 54000.0); - this._starVisibility = (double) num >= 0.25 ? ((double) num <= 0.75 ? 0.0f : (float) (((double) num - 0.75) / 0.25)) : (float) (1.0 - (double) num / 0.25); - } - else - this._starVisibility = 1f; - this._starVisibility = Math.Max(1f - this._backgroundTransition, this._starVisibility); - } - - [RgbProcessor] - private void ProcessAnyDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Point gridPositionOfIndex = fragment.GetGridPositionOfIndex(index); - Vector2 vector2 = new Vector2(0.1f, 0.5f); - Vector4 vector4 = Vector4.Lerp(Vector4.Lerp(this._baseSpaceColor, Vector4.Lerp(this._processedSkyColor, this._processedCloudColor, (float) Math.Sqrt((double) Math.Max(0.0f, (float) (1.0 - 2.0 * (double) NoiseHelper.GetDynamicNoise(canvasPositionOfIndex * vector2 + new Vector2(time * 0.05f, 0.0f), time / 20f))))), this._backgroundTransition), Vector4.One, Math.Max(0.0f, (float) (1.0 - (double) NoiseHelper.GetDynamicNoise(gridPositionOfIndex.X, gridPositionOfIndex.Y, time / 60f) * 20.0)) * 0.98f * this._starVisibility); - fragment.SetColor(index, vector4); - } - } - } -} diff --git a/GameContent/RGB/SlimeRainShader.cs b/GameContent/RGB/SlimeRainShader.cs deleted file mode 100644 index 3359402..0000000 --- a/GameContent/RGB/SlimeRainShader.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.SlimeRainShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class SlimeRainShader : ChromaShader - { - private static readonly Vector4[] _colors = new Vector4[3] - { - Color.Blue.ToVector4(), - Color.Green.ToVector4(), - Color.Purple.ToVector4() - }; - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - Vector4 vector4_1 = new Vector4(0.0f, 0.0f, 0.0f, 0.75f); - for (int index1 = 0; index1 < fragment.Count; ++index1) - { - Point gridPositionOfIndex = fragment.GetGridPositionOfIndex(index1); - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index1); - float num = (float) (((double) NoiseHelper.GetStaticNoise(gridPositionOfIndex.X) * 7.0 + (double) time * 0.400000005960464) % 7.0) - canvasPositionOfIndex.Y; - Vector4 vector4_2 = vector4_1; - if ((double) num > 0.0) - { - float amount = Math.Max(0.0f, 1.2f - num); - if ((double) num < 0.400000005960464) - amount = num / 0.4f; - int index2 = (gridPositionOfIndex.X % SlimeRainShader._colors.Length + SlimeRainShader._colors.Length) % SlimeRainShader._colors.Length; - vector4_2 = Vector4.Lerp(vector4_2, SlimeRainShader._colors[index2], amount); - } - fragment.SetColor(index1, vector4_2); - } - } - } -} diff --git a/GameContent/RGB/SurfaceBiomeShader.cs b/GameContent/RGB/SurfaceBiomeShader.cs deleted file mode 100644 index 2f9eb15..0000000 --- a/GameContent/RGB/SurfaceBiomeShader.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.SurfaceBiomeShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class SurfaceBiomeShader : ChromaShader - { - private readonly Vector4 _primaryColor; - private readonly Vector4 _secondaryColor; - private Vector4 _surfaceColor; - private float _starVisibility; - - public SurfaceBiomeShader(Color primaryColor, Color secondaryColor) - { - this._primaryColor = primaryColor.ToVector4(); - this._secondaryColor = secondaryColor.ToVector4(); - } - - public virtual void Update(float elapsedTime) - { - this._surfaceColor = Main.ColorOfTheSkies.ToVector4() * 0.75f + Vector4.One * 0.25f; - if (Main.dayTime) - { - float num = (float) (Main.time / 54000.0); - if ((double) num < 0.25) - { - this._starVisibility = (float) (1.0 - (double) num / 0.25); - } - else - { - if ((double) num <= 0.75) - return; - this._starVisibility = (float) (((double) num - 0.75) / 0.25); - } - } - else - this._starVisibility = 1f; - } - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - Vector4 vector4_1 = this._primaryColor * this._surfaceColor; - Vector4 vector4_2 = this._secondaryColor * this._surfaceColor; - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Vector4 vector4_3 = Vector4.Lerp(vector4_1, vector4_2, (float) (Math.Sin((double) time * 0.5 + (double) canvasPositionOfIndex.X) * 0.5 + 0.5)); - fragment.SetColor(index, vector4_3); - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - Vector4 vector4_1 = this._primaryColor * this._surfaceColor; - Vector4 vector4_2 = this._secondaryColor * this._surfaceColor; - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Point gridPositionOfIndex = fragment.GetGridPositionOfIndex(index); - float amount = (float) (Math.Sin((double) canvasPositionOfIndex.X * 1.5 + (double) canvasPositionOfIndex.Y + (double) time) * 0.5 + 0.5); - Vector4 vector4_3 = Vector4.Max(Vector4.Lerp(vector4_1, vector4_2, amount), new Vector4(Math.Max(0.0f, (float) (1.0 - (double) NoiseHelper.GetDynamicNoise(gridPositionOfIndex.X, gridPositionOfIndex.Y, time / 60f) * 20.0)) * (1f - this._surfaceColor.X) * this._starVisibility)); - fragment.SetColor(index, vector4_3); - } - } - } -} diff --git a/GameContent/RGB/TempleShader.cs b/GameContent/RGB/TempleShader.cs deleted file mode 100644 index b668e18..0000000 --- a/GameContent/RGB/TempleShader.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.TempleShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class TempleShader : ChromaShader - { - private readonly Vector4 _backgroundColor = new Vector4(0.05f, 0.025f, 0.0f, 1f); - private readonly Vector4 _glowColor = Color.Orange.ToVector4(); - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Point gridPositionOfIndex = fragment.GetGridPositionOfIndex(index); - Vector4 vector4 = this._backgroundColor; - float num = (float) (((double) NoiseHelper.GetStaticNoise(gridPositionOfIndex.Y * 7) * 10.0 + (double) time) % 10.0 - ((double) canvasPositionOfIndex.X + 2.0)); - if ((double) num > 0.0) - { - float amount = Math.Max(0.0f, 1.2f - num); - if ((double) num < 0.200000002980232) - amount = num * 5f; - vector4 = Vector4.Lerp(vector4, this._glowColor, amount); - } - fragment.SetColor(index, vector4); - } - } - } -} diff --git a/GameContent/RGB/TwinsShader.cs b/GameContent/RGB/TwinsShader.cs deleted file mode 100644 index 673642c..0000000 --- a/GameContent/RGB/TwinsShader.cs +++ /dev/null @@ -1,123 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.TwinsShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class TwinsShader : ChromaShader - { - private readonly Vector4 _eyeColor; - private readonly Vector4 _veinColor; - private readonly Vector4 _laserColor; - private readonly Vector4 _mouthColor; - private readonly Vector4 _flameColor; - private readonly Vector4 _backgroundColor; - private static readonly Vector4[] _irisColors = new Vector4[2] - { - Color.Green.ToVector4(), - Color.Blue.ToVector4() - }; - - public TwinsShader( - Color eyeColor, - Color veinColor, - Color laserColor, - Color mouthColor, - Color flameColor, - Color backgroundColor) - { - this._eyeColor = eyeColor.ToVector4(); - this._veinColor = veinColor.ToVector4(); - this._laserColor = laserColor.ToVector4(); - this._mouthColor = mouthColor.ToVector4(); - this._flameColor = flameColor.ToVector4(); - this._backgroundColor = backgroundColor.ToVector4(); - } - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Point gridPositionOfIndex = fragment.GetGridPositionOfIndex(index); - Vector4 vector4_1 = Vector4.Lerp(this._veinColor, this._eyeColor, (float) (Math.Sin((double) time + (double) canvasPositionOfIndex.X * 4.0) * 0.5 + 0.5)); - float amount = Math.Max(0.0f, (float) (1.0 - (double) NoiseHelper.GetDynamicNoise(gridPositionOfIndex.X, gridPositionOfIndex.Y, time / 25f) * 5.0)); - Vector4 vector4_2 = Vector4.Lerp(vector4_1, TwinsShader._irisColors[((gridPositionOfIndex.Y * 47 + gridPositionOfIndex.X) % TwinsShader._irisColors.Length + TwinsShader._irisColors.Length) % TwinsShader._irisColors.Length], amount); - fragment.SetColor(index, vector4_2); - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - if (device.Type != null && device.Type != 6) - { - this.ProcessLowDetail(device, fragment, quality, time); - } - else - { - bool flag = true; - float num1 = (float) ((double) time * 0.100000001490116 % 2.0); - if ((double) num1 > 1.0) - { - num1 = 2f - num1; - flag = false; - } - Vector2 vector2_1 = new Vector2((float) ((double) num1 * 7.0 - 3.5), 0.0f) + fragment.CanvasCenter; - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Point gridPositionOfIndex = fragment.GetGridPositionOfIndex(index); - Vector4 vector4_1 = this._backgroundColor; - Vector2 vector2_2 = canvasPositionOfIndex - vector2_1; - float num2 = vector2_2.Length(); - if ((double) num2 < 0.5) - { - float amount1 = 1f - MathHelper.Clamp((float) (((double) num2 - 0.5 + 0.200000002980232) / 0.200000002980232), 0.0f, 1f); - float amount2 = MathHelper.Clamp((float) (((double) vector2_2.X + 0.5 - 0.200000002980232) / 0.600000023841858), 0.0f, 1f); - if (flag) - amount2 = 1f - amount2; - Vector4 vector4_2 = Vector4.Lerp(this._eyeColor, this._veinColor, amount2); - float num3 = (float) Math.Atan2((double) vector2_2.Y, (double) vector2_2.X); - if (!flag && 3.14159274101257 - (double) Math.Abs(num3) < 0.600000023841858) - vector4_2 = this._mouthColor; - vector4_1 = Vector4.Lerp(vector4_1, vector4_2, amount1); - } - if (flag && gridPositionOfIndex.Y == 3 && (double) canvasPositionOfIndex.X > (double) vector2_1.X) - { - float num4 = (float) (1.0 - (double) Math.Abs((float) ((double) canvasPositionOfIndex.X - (double) vector2_1.X * 2.0 - 0.5)) / 0.5); - vector4_1 = Vector4.Lerp(vector4_1, this._laserColor, MathHelper.Clamp(num4, 0.0f, 1f)); - } - else if (!flag) - { - Vector2 vector2_3 = canvasPositionOfIndex - (vector2_1 - new Vector2(1.2f, 0.0f)); - vector2_3.Y *= 3.5f; - float num5 = vector2_3.Length(); - if ((double) num5 < 0.699999988079071) - { - float dynamicNoise = NoiseHelper.GetDynamicNoise(canvasPositionOfIndex, time); - float amount = dynamicNoise * dynamicNoise * dynamicNoise * (1f - MathHelper.Clamp((float) (((double) num5 - 0.699999988079071 + 0.300000011920929) / 0.300000011920929), 0.0f, 1f)); - vector4_1 = Vector4.Lerp(vector4_1, this._flameColor, amount); - } - } - fragment.SetColor(index, vector4_1); - } - } - } - } -} diff --git a/GameContent/RGB/UndergroundCorruptionShader.cs b/GameContent/RGB/UndergroundCorruptionShader.cs deleted file mode 100644 index 500de35..0000000 --- a/GameContent/RGB/UndergroundCorruptionShader.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.UndergroundCorruptionShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class UndergroundCorruptionShader : ChromaShader - { - private readonly Vector4 _corruptionColor = new Vector4(Color.Purple.ToVector3() * 0.2f, 1f); - private readonly Vector4 _flameColor = Color.Green.ToVector4(); - private readonly Vector4 _flameTipColor = Color.Yellow.ToVector4(); - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - Vector4 vector4_1 = Vector4.Lerp(this._flameColor, this._flameTipColor, 0.25f); - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Vector4 vector4_2 = Vector4.Lerp(this._corruptionColor, vector4_1, (float) (Math.Sin((double) time + (double) canvasPositionOfIndex.X) * 0.5 + 0.5)); - fragment.SetColor(index, vector4_2); - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - fragment.GetGridPositionOfIndex(index); - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - float dynamicNoise = NoiseHelper.GetDynamicNoise(canvasPositionOfIndex * 0.3f + new Vector2(12.5f, time * 0.05f), time * 0.1f); - float amount = MathHelper.Clamp(Math.Max(0.0f, (float) (1.0 - (double) dynamicNoise * (double) dynamicNoise * 4.0 * (1.20000004768372 - (double) canvasPositionOfIndex.Y))) * canvasPositionOfIndex.Y, 0.0f, 1f); - Vector4 vector4 = Vector4.Lerp(this._corruptionColor, Vector4.Lerp(this._flameColor, this._flameTipColor, amount), amount); - fragment.SetColor(index, vector4); - } - } - } -} diff --git a/GameContent/RGB/UndergroundHallowShader.cs b/GameContent/RGB/UndergroundHallowShader.cs deleted file mode 100644 index d2e2cf2..0000000 --- a/GameContent/RGB/UndergroundHallowShader.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.UndergroundHallowShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class UndergroundHallowShader : ChromaShader - { - private readonly Vector4 _baseColor = new Color(0.05f, 0.05f, 0.05f).ToVector4(); - private readonly Vector4 _pinkCrystalColor = Color.HotPink.ToVector4(); - private readonly Vector4 _blueCrystalColor = Color.DeepSkyBlue.ToVector4(); - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Vector4 vector4 = Vector4.Lerp(this._pinkCrystalColor, this._blueCrystalColor, (float) (Math.Sin((double) time * 2.0 + (double) canvasPositionOfIndex.X) * 0.5 + 0.5)); - fragment.SetColor(index, vector4); - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - fragment.GetGridPositionOfIndex(index); - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Vector4 baseColor = this._baseColor; - float amount1 = Math.Max(0.0f, (float) (1.0 - 2.5 * (double) NoiseHelper.GetDynamicNoise(canvasPositionOfIndex * 0.4f, time * 0.05f))); - float amount2 = Math.Max(0.0f, (float) (1.0 - 2.5 * (double) NoiseHelper.GetDynamicNoise(canvasPositionOfIndex * 0.4f + new Vector2(0.05f, 0.0f), time * 0.05f))); - Vector4 vector4 = (double) amount1 <= (double) amount2 ? Vector4.Lerp(baseColor, this._blueCrystalColor, amount2) : Vector4.Lerp(baseColor, this._pinkCrystalColor, amount1); - fragment.SetColor(index, vector4); - } - } - } -} diff --git a/GameContent/RGB/UndergroundMushroomShader.cs b/GameContent/RGB/UndergroundMushroomShader.cs deleted file mode 100644 index 7a11c0d..0000000 --- a/GameContent/RGB/UndergroundMushroomShader.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.UndergroundMushroomShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class UndergroundMushroomShader : ChromaShader - { - private readonly Vector4 _baseColor = new Color(10, 10, 10).ToVector4(); - private readonly Vector4 _edgeGlowColor = new Color(0, 0, (int) byte.MaxValue).ToVector4(); - private readonly Vector4 _sporeColor = new Color((int) byte.MaxValue, 230, 150).ToVector4(); - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Vector4 vector4 = Vector4.Lerp(this._edgeGlowColor, this._sporeColor, (float) (Math.Sin((double) time * 0.5 + (double) canvasPositionOfIndex.X) * 0.5 + 0.5)); - fragment.SetColor(index, vector4); - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Point gridPositionOfIndex = fragment.GetGridPositionOfIndex(index); - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Vector4 vector4_1 = this._baseColor; - float num = (float) ((((double) NoiseHelper.GetStaticNoise(gridPositionOfIndex.X) * 10.0 + (double) time * 0.200000002980232) % 10.0 - (1.0 - (double) canvasPositionOfIndex.Y)) * 2.0); - if ((double) num > 0.0) - { - float amount = Math.Max(0.0f, 1.5f - num); - if ((double) num < 0.5) - amount = num * 2f; - vector4_1 = Vector4.Lerp(vector4_1, this._sporeColor, amount); - } - float amount1 = Math.Max(0.0f, (float) (1.0 - (double) NoiseHelper.GetStaticNoise(canvasPositionOfIndex * 0.3f + new Vector2(0.0f, time * 0.1f)) * (1.0 + (1.0 - (double) canvasPositionOfIndex.Y) * 4.0))) * Math.Max(0.0f, (float) (((double) canvasPositionOfIndex.Y - 0.300000011920929) / 0.699999988079071)); - Vector4 vector4_2 = Vector4.Lerp(vector4_1, this._edgeGlowColor, amount1); - fragment.SetColor(index, vector4_2); - } - } - } -} diff --git a/GameContent/RGB/UnderworldShader.cs b/GameContent/RGB/UnderworldShader.cs deleted file mode 100644 index 7c34e6d..0000000 --- a/GameContent/RGB/UnderworldShader.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.UnderworldShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class UnderworldShader : ChromaShader - { - private readonly Vector4 _backColor; - private readonly Vector4 _frontColor; - private readonly float _speed; - - public UnderworldShader(Color backColor, Color frontColor, float speed) - { - this._backColor = backColor.ToVector4(); - this._frontColor = frontColor.ToVector4(); - this._speed = speed; - } - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Vector4 vector4 = Vector4.Lerp(this._backColor, this._frontColor, (float) (Math.Sin((double) time * (double) this._speed + (double) canvasPositionOfIndex.X) * 0.5 + 0.5)); - fragment.SetColor(index, vector4); - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector4 vector4 = Vector4.Lerp(this._backColor, this._frontColor, NoiseHelper.GetDynamicNoise(fragment.GetCanvasPositionOfIndex(index) * 0.5f, (float) ((double) time * (double) this._speed / 3.0))); - fragment.SetColor(index, vector4); - } - } - } -} diff --git a/GameContent/RGB/VineShader.cs b/GameContent/RGB/VineShader.cs deleted file mode 100644 index 31ff2e2..0000000 --- a/GameContent/RGB/VineShader.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.VineShader -// 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; -using ReLogic.Peripherals.RGB; - -namespace Terraria.GameContent.RGB -{ - public class VineShader : ChromaShader - { - private readonly Vector4 _backgroundColor = new Color(46, 17, 6).ToVector4(); - private readonly Vector4 _vineColor = Color.Green.ToVector4(); - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - fragment.GetCanvasPositionOfIndex(index); - fragment.SetColor(index, this._backgroundColor); - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Point gridPositionOfIndex = fragment.GetGridPositionOfIndex(index); - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - float num1 = (float) (((double) NoiseHelper.GetStaticNoise(gridPositionOfIndex.X) * 10.0 + (double) time * 0.400000005960464) % 10.0); - float num2 = 1f; - if ((double) num1 > 1.0) - { - num2 = 1f - MathHelper.Clamp((float) (((double) num1 - 0.400000005960464 - 1.0) / 0.400000005960464), 0.0f, 1f); - num1 = 1f; - } - float num3 = num1 - canvasPositionOfIndex.Y / 1f; - Vector4 vector4 = this._backgroundColor; - if ((double) num3 > 0.0) - { - float num4 = 1f; - if ((double) num3 < 0.200000002980232) - num4 = num3 / 0.2f; - vector4 = Vector4.Lerp(this._backgroundColor, this._vineColor, num4 * num2); - } - fragment.SetColor(index, vector4); - } - } - } -} diff --git a/GameContent/RGB/VirtualKeyboard.cs b/GameContent/RGB/VirtualKeyboard.cs deleted file mode 100644 index fd126e3..0000000 --- a/GameContent/RGB/VirtualKeyboard.cs +++ /dev/null @@ -1,455 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.VirtualKeyboard -// 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; -using Microsoft.Xna.Framework.Input; -using ReLogic.Peripherals.RGB; -using System.Collections.Generic; - -namespace Terraria.GameContent.RGB -{ - public class VirtualKeyboard : RgbKeyboard - { - private Dictionary _keyCodeMap = new Dictionary(); - - private VirtualKeyboard(Fragment fragment, Keys[] keyMap) - : base((RgbDeviceVendor) 4, fragment, new DeviceColorProfile()) - { - for (int index = 0; index < keyMap.Length; ++index) - { - if (keyMap[index] != Keys.None) - this._keyCodeMap.Add(keyMap[index], index); - } - } - - public static VirtualKeyboard Create() - { - Point[] pointArray = new Point[133] - { - new Point(2, 6), - new Point(7, 0), - new Point(1, 4), - new Point(2, 4), - new Point(0, 5), - new Point(1, 5), - new Point(2, 5), - new Point(0, 6), - new Point(1, 6), - new Point(1, 3), - new Point(2, 3), - new Point(0, 4), - new Point(4, 0), - new Point(5, 0), - new Point(6, 0), - new Point(19, 3), - new Point(20, 3), - new Point(21, 3), - new Point(17, 5), - new Point(17, 6), - new Point(20, 5), - new Point(19, 6), - new Point(20, 6), - new Point(16, 3), - new Point(17, 3), - new Point(17, 4), - new Point(16, 2), - new Point(17, 2), - new Point(19, 0), - new Point(18, 1), - new Point(19, 1), - new Point(20, 1), - new Point(21, 1), - new Point(19, 2), - new Point(20, 2), - new Point(21, 2), - new Point(10, 6), - new Point(14, 6), - new Point(15, 6), - new Point(16, 6), - new Point(24, 6), - new Point(0, 1), - new Point(1, 1), - new Point(2, 1), - new Point(0, 2), - new Point(1, 2), - new Point(2, 2), - new Point(0, 3), - new Point(22, 4), - new Point(23, 4), - new Point(24, 4), - new Point(22, 5), - new Point(23, 5), - new Point(24, 5), - new Point(23, 6), - new Point(23, 2), - new Point(24, 2), - new Point(25, 2), - new Point(25, 3), - new Point(25, 5), - new Point(22, 3), - new Point(23, 3), - new Point(24, 3), - new Point(21, 6), - new Point(20, 0), - new Point(23, 0), - new Point(22, 1), - new Point(23, 1), - new Point(24, 1), - new Point(25, 1), - new Point(22, 2), - new Point(15, 2), - new Point(4, 3), - new Point(5, 3), - new Point(6, 3), - new Point(7, 3), - new Point(8, 3), - new Point(9, 3), - new Point(10, 3), - new Point(7, 2), - new Point(8, 2), - new Point(9, 2), - new Point(10, 2), - new Point(11, 2), - new Point(12, 2), - new Point(13, 2), - new Point(14, 2), - new Point(12, 1), - new Point(13, 1), - new Point(15, 1), - new Point(16, 1), - new Point(17, 1), - new Point(4, 2), - new Point(5, 2), - new Point(6, 2), - new Point(4, 1), - new Point(5, 1), - new Point(6, 1), - new Point(7, 1), - new Point(8, 1), - new Point(10, 1), - new Point(11, 1), - new Point(11, 5), - new Point(12, 5), - new Point(13, 5), - new Point(14, 5), - new Point(15, 5), - new Point(4, 6), - new Point(5, 6), - new Point(6, 6), - new Point(15, 4), - new Point(4, 5), - new Point(6, 5), - new Point(7, 5), - new Point(8, 5), - new Point(9, 5), - new Point(10, 5), - new Point(7, 4), - new Point(8, 4), - new Point(9, 4), - new Point(10, 4), - new Point(11, 4), - new Point(12, 4), - new Point(13, 4), - new Point(14, 4), - new Point(11, 3), - new Point(12, 3), - new Point(13, 3), - new Point(14, 3), - new Point(15, 3), - new Point(4, 4), - new Point(5, 4), - new Point(6, 4) - }; - Vector2[] vector2Array = new Vector2[133] - { - new Vector2(0.4365079f, 1f), - new Vector2(1.123016f, 0.007936508f), - new Vector2(0.2857143f, 0.6666667f), - new Vector2(0.4365079f, 0.6666667f), - new Vector2(0.1349206f, 0.8571429f), - new Vector2(0.2857143f, 0.8571429f), - new Vector2(0.4365079f, 0.8571429f), - new Vector2(0.1349206f, 1f), - new Vector2(0.2857143f, 1f), - new Vector2(0.2857143f, 0.515873f), - new Vector2(0.4365079f, 0.515873f), - new Vector2(0.1349206f, 0.6666667f), - new Vector2(0.6428571f, 0.007936508f), - new Vector2(0.8015873f, 0.007936508f), - new Vector2(0.9603174f, 0.007936508f), - new Vector2(3.06746f, 0.515873f), - new Vector2(3.226191f, 0.515873f), - new Vector2(3.384921f, 0.515873f), - new Vector2(2.730159f, 0.8412699f), - new Vector2(2.829365f, 0.9920635f), - new Vector2(3.226191f, 0.8412699f), - new Vector2(3.071429f, 0.9920635f), - new Vector2(3.226191f, 0.9920635f), - new Vector2(2.630952f, 0.515873f), - new Vector2(2.829365f, 0.515873f), - new Vector2(2.769841f, 0.6825397f), - new Vector2(2.551587f, 0.3650794f), - new Vector2(2.789683f, 0.3650794f), - new Vector2(3.075397f, 0.0f), - new Vector2(2.869048f, 0.1904762f), - new Vector2(3.06746f, 0.1904762f), - new Vector2(3.226191f, 0.1904762f), - new Vector2(3.384921f, 0.1904762f), - new Vector2(3.06746f, 0.3650794f), - new Vector2(3.226191f, 0.3650794f), - new Vector2(3.384921f, 0.3650794f), - new Vector2(1.674603f, 0.9920635f), - new Vector2(2.289683f, 0.9920635f), - new Vector2(2.472222f, 0.9920635f), - new Vector2(2.630952f, 0.9920635f), - new Vector2(3.904762f, 0.9920635f), - new Vector2(0.1349206f, 0.1825397f), - new Vector2(0.2857143f, 0.1825397f), - new Vector2(0.4365079f, 0.1825397f), - new Vector2(0.1349206f, 0.3333333f), - new Vector2(0.2857143f, 0.3333333f), - new Vector2(0.4365079f, 0.3333333f), - new Vector2(0.1349206f, 0.515873f), - new Vector2(3.59127f, 0.6825397f), - new Vector2(3.75f, 0.6825397f), - new Vector2(3.90873f, 0.6825397f), - new Vector2(3.59127f, 0.8412699f), - new Vector2(3.75f, 0.8412699f), - new Vector2(3.90873f, 0.8412699f), - new Vector2(3.670635f, 0.9920635f), - new Vector2(3.75f, 0.3650794f), - new Vector2(3.90873f, 0.3650794f), - new Vector2(4.063492f, 0.3650794f), - new Vector2(4.063492f, 0.515873f), - new Vector2(4.063492f, 0.8412699f), - new Vector2(3.59127f, 0.515873f), - new Vector2(3.75f, 0.515873f), - new Vector2(3.90873f, 0.515873f), - new Vector2(3.384921f, 0.9920635f), - new Vector2(3.234127f, 0.0f), - new Vector2(3.75f, 0.0f), - new Vector2(3.595238f, 0.1904762f), - new Vector2(3.75f, 0.1904762f), - new Vector2(3.900794f, 0.1904762f), - new Vector2(4.059524f, 0.1904762f), - new Vector2(3.59127f, 0.3650794f), - new Vector2(2.392857f, 0.3650794f), - new Vector2(0.6785714f, 0.515873f), - new Vector2(0.8849207f, 0.515873f), - new Vector2(1.043651f, 0.515873f), - new Vector2(1.194444f, 0.515873f), - new Vector2(1.361111f, 0.515873f), - new Vector2(1.519841f, 0.515873f), - new Vector2(1.678571f, 0.515873f), - new Vector2(1.123016f, 0.3650794f), - new Vector2(1.281746f, 0.3650794f), - new Vector2(1.440476f, 0.3650794f), - new Vector2(1.599206f, 0.3650794f), - new Vector2(1.757936f, 0.3650794f), - new Vector2(1.916667f, 0.3650794f), - new Vector2(2.075397f, 0.3650794f), - new Vector2(2.234127f, 0.3650794f), - new Vector2(1.964286f, 0.1904762f), - new Vector2(2.130952f, 0.1904762f), - new Vector2(2.392857f, 0.1904762f), - new Vector2(2.551587f, 0.1904762f), - new Vector2(2.710317f, 0.1904762f), - new Vector2(0.6388889f, 0.3650794f), - new Vector2(0.8055556f, 0.3650794f), - new Vector2(0.9642857f, 0.3650794f), - new Vector2(0.6388889f, 0.1904762f), - new Vector2(0.9087301f, 0.1904762f), - new Vector2(1.06746f, 0.1904762f), - new Vector2(1.22619f, 0.1904762f), - new Vector2(1.384921f, 0.1904762f), - new Vector2(1.654762f, 0.1904762f), - new Vector2(1.805556f, 0.1904762f), - new Vector2(1.797619f, 0.8412699f), - new Vector2(1.956349f, 0.8412699f), - new Vector2(2.115079f, 0.8412699f), - new Vector2(2.273809f, 0.8412699f), - new Vector2(2.43254f, 0.8412699f), - new Vector2(0.6785714f, 0.9920635f), - new Vector2(0.8849207f, 0.9920635f), - new Vector2(1.063492f, 0.9920635f), - new Vector2(2.511905f, 0.6825397f), - new Vector2(0.7380952f, 0.8412699f), - new Vector2(1.003968f, 0.8412699f), - new Vector2(1.162698f, 0.8412699f), - new Vector2(1.321429f, 0.8412699f), - new Vector2(1.480159f, 0.8412699f), - new Vector2(1.638889f, 0.8412699f), - new Vector2(1.242064f, 0.6825397f), - new Vector2(1.400794f, 0.6825397f), - new Vector2(1.559524f, 0.6825397f), - new Vector2(1.718254f, 0.6825397f), - new Vector2(1.876984f, 0.6825397f), - new Vector2(2.035714f, 0.6825397f), - new Vector2(2.194444f, 0.6825397f), - new Vector2(2.353175f, 0.6825397f), - new Vector2(1.837302f, 0.515873f), - new Vector2(1.996032f, 0.515873f), - new Vector2(2.154762f, 0.515873f), - new Vector2(2.313492f, 0.515873f), - new Vector2(2.472222f, 0.515873f), - new Vector2(0.6984127f, 0.6825397f), - new Vector2(0.9166667f, 0.6825397f), - new Vector2(1.083333f, 0.6825397f) - }; - Keys[] keyMap = new Keys[133] - { - Keys.None, - Keys.None, - Keys.None, - Keys.None, - Keys.None, - Keys.None, - Keys.None, - Keys.None, - Keys.None, - Keys.None, - Keys.None, - Keys.None, - Keys.None, - Keys.None, - Keys.None, - Keys.Delete, - Keys.End, - Keys.PageDown, - Keys.RightShift, - Keys.RightControl, - Keys.Up, - Keys.Left, - Keys.Down, - Keys.OemCloseBrackets, - Keys.OemBackslash, - Keys.Enter, - Keys.OemPlus, - Keys.Back, - Keys.None, - Keys.F12, - Keys.PrintScreen, - Keys.Scroll, - Keys.Pause, - Keys.Insert, - Keys.Home, - Keys.PageUp, - Keys.Space, - Keys.RightAlt, - Keys.None, - Keys.None, - Keys.Decimal, - Keys.None, - Keys.None, - Keys.None, - Keys.None, - Keys.None, - Keys.None, - Keys.None, - Keys.NumPad4, - Keys.NumPad5, - Keys.NumPad6, - Keys.NumPad1, - Keys.NumPad2, - Keys.NumPad3, - Keys.NumPad0, - Keys.Divide, - Keys.Multiply, - Keys.Subtract, - Keys.Add, - Keys.None, - Keys.NumPad7, - Keys.NumPad8, - Keys.NumPad9, - Keys.Right, - Keys.None, - Keys.VolumeMute, - Keys.MediaStop, - Keys.MediaPreviousTrack, - Keys.MediaPlayPause, - Keys.MediaNextTrack, - Keys.NumLock, - Keys.OemMinus, - Keys.Tab, - Keys.Q, - Keys.W, - Keys.E, - Keys.R, - Keys.T, - Keys.Y, - Keys.D3, - Keys.D4, - Keys.D5, - Keys.D6, - Keys.D7, - Keys.D8, - Keys.D9, - Keys.D0, - Keys.F7, - Keys.F8, - Keys.F9, - Keys.F10, - Keys.F11, - Keys.OemTilde, - Keys.D1, - Keys.D2, - Keys.Escape, - Keys.F1, - Keys.F2, - Keys.F3, - Keys.F4, - Keys.F5, - Keys.F6, - Keys.N, - Keys.M, - Keys.OemComma, - Keys.OemPeriod, - Keys.OemQuestion, - Keys.LeftControl, - Keys.None, - Keys.LeftAlt, - Keys.OemQuotes, - Keys.LeftShift, - Keys.Z, - Keys.X, - Keys.C, - Keys.V, - Keys.B, - Keys.D, - Keys.F, - Keys.G, - Keys.H, - Keys.J, - Keys.K, - Keys.L, - Keys.OemSemicolon, - Keys.U, - Keys.I, - Keys.O, - Keys.P, - Keys.OemOpenBrackets, - Keys.CapsLock, - Keys.A, - Keys.S - }; - return new VirtualKeyboard(Fragment.FromCustom(pointArray, vector2Array), keyMap); - } - - public virtual void Present() - { - } - - public virtual void Render(IEnumerable keys) - { - foreach (RgbKey key in keys) - { - int num; - if (this._keyCodeMap.TryGetValue((Keys) key.Key, out num)) - ((RgbDevice) this).SetLedColor(num, key.CurrentColor.ToVector4()); - } - } - } -} diff --git a/GameContent/RGB/WallOfFleshShader.cs b/GameContent/RGB/WallOfFleshShader.cs deleted file mode 100644 index 365f899..0000000 --- a/GameContent/RGB/WallOfFleshShader.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.WallOfFleshShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class WallOfFleshShader : ChromaShader - { - private readonly Vector4 _primaryColor; - private readonly Vector4 _secondaryColor; - - public WallOfFleshShader(Color primaryColor, Color secondaryColor) - { - this._primaryColor = primaryColor.ToVector4(); - this._secondaryColor = secondaryColor.ToVector4(); - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector4 vector4 = Vector4.Lerp(this._secondaryColor, this._primaryColor, (float) Math.Sqrt((double) Math.Max(0.0f, (float) (1.0 - (double) NoiseHelper.GetDynamicNoise(fragment.GetCanvasPositionOfIndex(index) * 0.3f, time / 5f) * 2.0))) * 0.75f); - fragment.SetColor(index, vector4); - } - } - } -} diff --git a/GameContent/RGB/WormShader.cs b/GameContent/RGB/WormShader.cs deleted file mode 100644 index 9266c85..0000000 --- a/GameContent/RGB/WormShader.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.RGB.WormShader -// 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; -using ReLogic.Peripherals.RGB; -using System; - -namespace Terraria.GameContent.RGB -{ - public class WormShader : ChromaShader - { - private readonly Vector4 _skinColor; - private readonly Vector4 _eyeColor; - private readonly Vector4 _innerEyeColor; - - public WormShader() - { - } - - public WormShader(Color skinColor, Color eyeColor, Color innerEyeColor) - { - this._skinColor = skinColor.ToVector4(); - this._eyeColor = eyeColor.ToVector4(); - this._innerEyeColor = innerEyeColor.ToVector4(); - } - - [RgbProcessor] - private void ProcessLowDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - Vector4 vector4 = Vector4.Lerp(this._skinColor, this._eyeColor, Math.Max(0.0f, (float) Math.Sin((double) time * -3.0 + (double) canvasPositionOfIndex.X))); - fragment.SetColor(index, vector4); - } - } - - [RgbProcessor] - private void ProcessHighDetail( - RgbDevice device, - Fragment fragment, - EffectDetailLevel quality, - float time) - { - time *= 0.25f; - for (int index = 0; index < fragment.Count; ++index) - { - Vector2 canvasPositionOfIndex = fragment.GetCanvasPositionOfIndex(index); - canvasPositionOfIndex.X -= time * 1.5f; - canvasPositionOfIndex.X %= 2f; - if ((double) canvasPositionOfIndex.X < 0.0) - canvasPositionOfIndex.X += 2f; - float num1 = (canvasPositionOfIndex - new Vector2(0.5f)).Length(); - Vector4 vector4 = this._skinColor; - if ((double) num1 < 0.5) - { - float num2 = MathHelper.Clamp((float) (((double) num1 - 0.5 + 0.200000002980232) / 0.200000002980232), 0.0f, 1f); - vector4 = Vector4.Lerp(vector4, this._eyeColor, 1f - num2); - if ((double) num1 < 0.400000005960464) - { - float num3 = MathHelper.Clamp((float) (((double) num1 - 0.400000005960464 + 0.200000002980232) / 0.200000002980232), 0.0f, 1f); - vector4 = Vector4.Lerp(vector4, this._innerEyeColor, 1f - num3); - } - } - fragment.SetColor(index, vector4); - } - } - } -} diff --git a/GameContent/Shaders/BlizzardShaderData.cs b/GameContent/Shaders/BlizzardShaderData.cs index 6f0c8c3..8273efb 100644 --- a/GameContent/Shaders/BlizzardShaderData.cs +++ b/GameContent/Shaders/BlizzardShaderData.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Shaders.BlizzardShaderData -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -21,7 +21,7 @@ namespace Terraria.GameContent.Shaders public override void Update(GameTime gameTime) { - float num = Main.windSpeedCurrent; + float num = Main.windSpeed; if ((double) num >= 0.0 && (double) num <= 0.100000001490116) num = 0.1f; else if ((double) num <= 0.0 && (double) num >= -0.100000001490116) diff --git a/GameContent/Shaders/BloodMoonScreenShaderData.cs b/GameContent/Shaders/BloodMoonScreenShaderData.cs index b9f1dc4..0b88b60 100644 --- a/GameContent/Shaders/BloodMoonScreenShaderData.cs +++ b/GameContent/Shaders/BloodMoonScreenShaderData.cs @@ -1,10 +1,9 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Shaders.BloodMoonScreenShaderData -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe -using Microsoft.Xna.Framework; using Terraria.Graphics.Shaders; namespace Terraria.GameContent.Shaders @@ -16,6 +15,10 @@ namespace Terraria.GameContent.Shaders { } - public override void Update(GameTime gameTime) => this.UseOpacity((1f - Utils.SmoothStep((float) Main.worldSurface + 50f, (float) Main.rockLayer + 100f, (float) (((double) Main.screenPosition.Y + (double) (Main.screenHeight / 2)) / 16.0))) * 0.75f); + public override void Apply() + { + this.UseOpacity((1f - Utils.SmoothStep((float) Main.worldSurface + 50f, (float) Main.rockLayer + 100f, (float) (((double) Main.screenPosition.Y + (double) (Main.screenHeight / 2)) / 16.0))) * 0.75f); + base.Apply(); + } } } diff --git a/GameContent/Shaders/MoonLordScreenShaderData.cs b/GameContent/Shaders/MoonLordScreenShaderData.cs index 171b396..a5aacd8 100644 --- a/GameContent/Shaders/MoonLordScreenShaderData.cs +++ b/GameContent/Shaders/MoonLordScreenShaderData.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Shaders.MoonLordScreenShaderData -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Terraria.Graphics.Shaders; @@ -11,17 +11,15 @@ namespace Terraria.GameContent.Shaders public class MoonLordScreenShaderData : ScreenShaderData { private int _moonLordIndex = -1; - private bool _aimAtPlayer; - public MoonLordScreenShaderData(string passName, bool aimAtPlayer) + public MoonLordScreenShaderData(string passName) : base(passName) { - this._aimAtPlayer = aimAtPlayer; } private void UpdateMoonLordIndex() { - if (this._aimAtPlayer || this._moonLordIndex >= 0 && Main.npc[this._moonLordIndex].active && Main.npc[this._moonLordIndex].type == 398) + if (this._moonLordIndex >= 0 && Main.npc[this._moonLordIndex].active && Main.npc[this._moonLordIndex].type == 398) return; int num = -1; for (int index = 0; index < Main.npc.Length; ++index) @@ -38,9 +36,7 @@ namespace Terraria.GameContent.Shaders public override void Apply() { this.UpdateMoonLordIndex(); - if (this._aimAtPlayer) - this.UseTargetPosition(Main.LocalPlayer.Center); - else if (this._moonLordIndex != -1) + if (this._moonLordIndex != -1) this.UseTargetPosition(Main.npc[this._moonLordIndex].Center); base.Apply(); } diff --git a/GameContent/Shaders/RippleShape.cs b/GameContent/Shaders/RippleShape.cs index 6ee1662..8c45ae6 100644 --- a/GameContent/Shaders/RippleShape.cs +++ b/GameContent/Shaders/RippleShape.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Shaders.RippleShape -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.GameContent.Shaders diff --git a/GameContent/Shaders/SandstormShaderData.cs b/GameContent/Shaders/SandstormShaderData.cs index f50b5bb..969cf34 100644 --- a/GameContent/Shaders/SandstormShaderData.cs +++ b/GameContent/Shaders/SandstormShaderData.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Shaders.SandstormShaderData -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -20,7 +20,7 @@ namespace Terraria.GameContent.Shaders public override void Update(GameTime gameTime) { - Vector2 vector2 = new Vector2(-Main.windSpeedCurrent, -1f) * new Vector2(20f, 0.1f); + Vector2 vector2 = new Vector2(-Main.windSpeed, -1f) * new Vector2(20f, 0.1f); vector2.Normalize(); Vector2 direction = vector2 * new Vector2(2f, 0.2f); if (!Main.gamePaused && Main.hasFocus) diff --git a/GameContent/Shaders/WaterShaderData.cs b/GameContent/Shaders/WaterShaderData.cs index 97d6be9..2556306 100644 --- a/GameContent/Shaders/WaterShaderData.cs +++ b/GameContent/Shaders/WaterShaderData.cs @@ -1,17 +1,15 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Shaders.WaterShaderData -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using System; using Terraria.DataStructures; using Terraria.GameContent.Liquid; using Terraria.Graphics; -using Terraria.Graphics.Light; using Terraria.Graphics.Shaders; using Terraria.ID; @@ -40,7 +38,7 @@ namespace Terraria.GameContent.Shaders private bool _clearNextFrame = true; private Texture2D[] _viscosityMaskChain = new Texture2D[3]; private int _activeViscosityMask; - private Asset _rippleShapeTexture; + private Texture2D _rippleShapeTexture; private bool _isWaveBufferDirty = true; private int _queuedSteps; private const int MAX_QUEUED_STEPS = 2; @@ -52,7 +50,7 @@ namespace Terraria.GameContent.Shaders { Main.OnRenderTargetsInitialized += new ResolutionChangeEvent(this.InitRenderTargets); Main.OnRenderTargetsReleased += new Action(this.ReleaseRenderTargets); - this._rippleShapeTexture = Main.Assets.Request("Images/Misc/Ripples", (AssetRequestMode) 1); + this._rippleShapeTexture = Main.instance.OurLoad("Images/Misc/Ripples"); Main.OnPreDraw += new Action(this.PreDraw); } @@ -130,7 +128,7 @@ namespace Terraria.GameContent.Shaders Vector2 dimensions1 = new Vector2((float) Main.screenWidth, (float) Main.screenHeight); Vector2 vector2_2 = new Vector2(16f, 16f); tileBatch.Begin(); - GameShaders.Misc["WaterDistortionObject"].Apply(new DrawData?()); + GameShaders.Misc["WaterDistortionObject"].Apply(); if (this._useNPCWaves) { for (int index = 0; index < 200; ++index) @@ -149,7 +147,7 @@ namespace Terraria.GameContent.Shaders if (!this._useViscosityFilter && (npc.honeyWet || npc.lavaWet)) num2 *= 0.3f; if (npc.wet) - tileBatch.Draw(TextureAssets.MagicPixel.Value, new Vector4(vector2_5.X, vector2_5.Y, (float) npc.width * 2f, (float) npc.height * 2f) * 0.25f, new Rectangle?(), new VertexColors(new Color((float) ((double) vector2_4.X * 0.5 + 0.5), (float) ((double) vector2_4.Y * 0.5 + 0.5), 0.5f * num2)), new Vector2((float) TextureAssets.MagicPixel.Width() / 2f, (float) TextureAssets.MagicPixel.Height() / 2f), SpriteEffects.None, npc.rotation); + tileBatch.Draw(Main.magicPixel, new Vector4(vector2_5.X, vector2_5.Y, (float) npc.width * 2f, (float) npc.height * 2f) * 0.25f, new Rectangle?(), new VertexColors(new Color((float) ((double) vector2_4.X * 0.5 + 0.5), (float) ((double) vector2_4.Y * 0.5 + 0.5), 0.5f * num2)), new Vector2((float) Main.magicPixel.Width / 2f, (float) Main.magicPixel.Height / 2f), SpriteEffects.None, npc.rotation); if (npc.wetCount != (byte) 0) { float num3 = 0.195f * (float) Math.Sqrt((double) npc.velocity.Length()); @@ -176,7 +174,7 @@ namespace Terraria.GameContent.Shaders if (!this._useViscosityFilter && (player.honeyWet || player.lavaWet)) num5 *= 0.3f; if (player.wet) - tileBatch.Draw(TextureAssets.MagicPixel.Value, new Vector4(vector2_7.X - (float) ((double) player.width * 2.0 * 0.5), vector2_7.Y - (float) ((double) player.height * 2.0 * 0.5), (float) player.width * 2f, (float) player.height * 2f) * 0.25f, new VertexColors(new Color((float) ((double) velocity.X * 0.5 + 0.5), (float) ((double) velocity.Y * 0.5 + 0.5), 0.5f * num5))); + tileBatch.Draw(Main.magicPixel, new Vector4(vector2_7.X - (float) ((double) player.width * 2.0 * 0.5), vector2_7.Y - (float) ((double) player.height * 2.0 * 0.5), (float) player.width * 2f, (float) player.height * 2f) * 0.25f, new VertexColors(new Color((float) ((double) velocity.X * 0.5 + 0.5), (float) ((double) velocity.Y * 0.5 + 0.5), 0.5f * num5))); if (player.wetCount != (byte) 0) { float num6 = 5f; @@ -218,7 +216,7 @@ namespace Terraria.GameContent.Shaders num11 *= 0.3f; float z = Math.Max(12f, (float) projectile.width * 0.75f); float w = Math.Max(12f, (float) projectile.height * 0.75f); - tileBatch.Draw(TextureAssets.MagicPixel.Value, new Vector4(vector2_8.X - z * 0.5f, vector2_8.Y - w * 0.5f, z, w) * 0.25f, new VertexColors(new Color((float) ((double) velocity.X * 0.5 + 0.5), (float) ((double) velocity.Y * 0.5 + 0.5), num11 * 0.5f))); + tileBatch.Draw(Main.magicPixel, new Vector4(vector2_8.X - z * 0.5f, vector2_8.Y - w * 0.5f, z, w) * 0.25f, new VertexColors(new Color((float) ((double) velocity.X * 0.5 + 0.5), (float) ((double) velocity.Y * 0.5 + 0.5), num11 * 0.5f))); } } } @@ -231,8 +229,8 @@ namespace Terraria.GameContent.Shaders Vector2 vector2_9 = this._rippleQueue[index].Position - vector2_1; Vector2 size = this._rippleQueue[index].Size; Rectangle sourceRectangle = this._rippleQueue[index].SourceRectangle; - Texture2D texture = this._rippleShapeTexture.Value; - tileBatch.Draw(texture, new Vector4(vector2_9.X, vector2_9.Y, size.X, size.Y) * 0.25f, new Rectangle?(sourceRectangle), new VertexColors(this._rippleQueue[index].WaveData), new Vector2((float) (sourceRectangle.Width / 2), (float) (sourceRectangle.Height / 2)), SpriteEffects.None, this._rippleQueue[index].Rotation); + Texture2D rippleShapeTexture = this._rippleShapeTexture; + tileBatch.Draw(rippleShapeTexture, new Vector4(vector2_9.X, vector2_9.Y, size.X, size.Y) * 0.25f, new Rectangle?(sourceRectangle), new VertexColors(this._rippleQueue[index].WaveData), new Vector2((float) (sourceRectangle.Width / 2), (float) (sourceRectangle.Height / 2)), SpriteEffects.None, this._rippleQueue[index].Rotation); } tileBatch.End(); } @@ -315,9 +313,9 @@ namespace Terraria.GameContent.Shaders } catch (Exception ex) { - Lighting.Mode = LightMode.Retro; + Lighting.lightMode = 2; this._usingRenderTargets = false; - Console.WriteLine("Failed to create water distortion render targets. " + (object) ex); + Console.WriteLine("Failed to create water distortion render targets. " + ex.ToString()); } } @@ -332,7 +330,7 @@ namespace Terraria.GameContent.Shaders } catch (Exception ex) { - Console.WriteLine("Error disposing of water distortion render targets. " + (object) ex); + Console.WriteLine("Error disposing of water distortion render targets. " + ex.ToString()); } this._distortionTarget = (RenderTarget2D) null; this._distortionTargetSwap = (RenderTarget2D) null; diff --git a/GameContent/ShopHelper.cs b/GameContent/ShopHelper.cs deleted file mode 100644 index 7389ace..0000000 --- a/GameContent/ShopHelper.cs +++ /dev/null @@ -1,358 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.ShopHelper -// 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; -using System; -using System.Collections.Generic; -using Terraria.GameContent.Personalities; -using Terraria.ID; -using Terraria.Localization; - -namespace Terraria.GameContent -{ - public class ShopHelper - { - private const float LowestPossiblePriceMultiplier = 0.75f; - private const float HighestPossiblePriceMultiplier = 1.5f; - private string _currentHappiness; - private float _currentPriceAdjustment; - private NPC _currentNPCBeingTalkedTo; - private Player _currentPlayerTalking; - private const float likeValue = 0.95f; - private const float dislikeValue = 1.05f; - private const float loveValue = 0.9f; - private const float hateValue = 1.1f; - - public ShoppingSettings GetShoppingSettings(Player player, NPC npc) - { - ShoppingSettings shoppingSettings = new ShoppingSettings() - { - PriceAdjustment = 1.0, - HappinessReport = "" - }; - this._currentNPCBeingTalkedTo = npc; - this._currentPlayerTalking = player; - this.ProcessMood(player, npc); - shoppingSettings.PriceAdjustment = (double) this._currentPriceAdjustment; - shoppingSettings.HappinessReport = this._currentHappiness; - return shoppingSettings; - } - - private float GetSkeletonMerchantPrices(NPC npc) - { - float num = 1f; - if (Main.moonPhase == 1 || Main.moonPhase == 7) - num = 1.1f; - if (Main.moonPhase == 2 || Main.moonPhase == 6) - num = 1.2f; - if (Main.moonPhase == 3 || Main.moonPhase == 5) - num = 1.3f; - if (Main.moonPhase == 4) - num = 1.4f; - if (Main.dayTime) - num += 0.1f; - return num; - } - - private float GetTravelingMerchantPrices(NPC npc) => (float) ((2.0 + (double) (1.5f - Vector2.Distance(npc.Center / 16f, new Vector2((float) Main.spawnTileX, (float) Main.spawnTileY)) / (float) (Main.maxTilesX / 2))) / 3.0); - - private void ProcessMood(Player player, NPC npc) - { - this._currentHappiness = ""; - this._currentPriceAdjustment = 1f; - if (npc.type == 368) - this._currentPriceAdjustment = 1f; - else if (npc.type == 453) - { - this._currentPriceAdjustment = 1f; - } - else - { - if (npc.type == 656 || npc.type == 637 || npc.type == 638) - return; - if (this.IsNotReallyTownNPC(npc)) - { - this._currentPriceAdjustment = 1f; - } - else - { - if (this.RuinMoodIfHomeless(npc)) - this._currentPriceAdjustment = 1000f; - else if (this.IsFarFromHome(npc)) - this._currentPriceAdjustment = 1000f; - if (this.IsPlayerInEvilBiomes(player)) - this._currentPriceAdjustment = 1000f; - int npcsWithinHouse; - int npcsWithinVillage; - List nearbyResidentNpCs = this.GetNearbyResidentNPCs(npc, out npcsWithinHouse, out npcsWithinVillage); - if (npcsWithinHouse > 2) - { - for (int index = 2; index < npcsWithinHouse + 1; ++index) - this._currentPriceAdjustment *= 1.04f; - if (npcsWithinHouse > 4) - this.AddHappinessReportText("HateCrowded"); - else - this.AddHappinessReportText("DislikeCrowded"); - } - if (npcsWithinHouse < 2 && npcsWithinVillage < 4) - { - this.AddHappinessReportText("LoveSpace"); - this._currentPriceAdjustment *= 0.9f; - } - bool[] flagArray = new bool[663]; - foreach (NPC npc1 in nearbyResidentNpCs) - flagArray[npc1.type] = true; - new AllPersonalitiesModifier().ModifyShopPrice(new HelperInfo() - { - player = player, - npc = npc, - NearbyNPCs = nearbyResidentNpCs, - PrimaryPlayerBiome = player.GetPrimaryBiome(), - nearbyNPCsByType = flagArray - }, this); - if (this._currentHappiness == "") - this.AddHappinessReportText("Content"); - this._currentPriceAdjustment = this.LimitAndRoundMultiplier(this._currentPriceAdjustment); - } - } - } - - private float LimitAndRoundMultiplier(float priceAdjustment) - { - priceAdjustment = MathHelper.Clamp(priceAdjustment, 0.75f, 1.5f); - priceAdjustment = (float) Math.Round((double) priceAdjustment * 20.0) / 20f; - return priceAdjustment; - } - - private static string BiomeName(int biomeID) - { - switch (biomeID) - { - case 1: - return "the Underground"; - case 2: - return "the Snow"; - case 3: - return "the Desert"; - case 4: - return "the Jungle"; - case 5: - return "the Ocean"; - case 6: - return "the Hallow"; - case 7: - return "the Glowing Mushrooms"; - case 8: - return "the Dungeon"; - case 9: - return "the Corruption"; - case 10: - return "the Crimson"; - default: - return "the Forest"; - } - } - - private static string BiomeNameKey(int biomeID) - { - switch (biomeID) - { - case 1: - return "the Underground"; - case 2: - return "the Snow"; - case 3: - return "the Desert"; - case 4: - return "the Jungle"; - case 5: - return "the Ocean"; - case 6: - return "the Hallow"; - case 7: - return "the Glowing Mushrooms"; - case 8: - return "the Dungeon"; - case 9: - return "the Corruption"; - case 10: - return "the Crimson"; - default: - return "the Forest"; - } - } - - private void AddHappinessReportText(string textKeyInCategory, object substitutes = null) - { - string str = "TownNPCMood_" + NPCID.Search.GetName(this._currentNPCBeingTalkedTo.netID); - if (this._currentNPCBeingTalkedTo.type == 633 && this._currentNPCBeingTalkedTo.altTexture == 2) - str += "Transformed"; - this._currentHappiness = this._currentHappiness + Language.GetTextValueWith(str + "." + textKeyInCategory, substitutes) + " "; - } - - public void LikeBiome(int biomeID) - { - this.AddHappinessReportText(nameof (LikeBiome), (object) new - { - BiomeName = ShopHelper.BiomeNameKey(biomeID) - }); - this._currentPriceAdjustment *= 0.95f; - } - - public void LoveBiome(int biomeID) - { - this.AddHappinessReportText(nameof (LoveBiome), (object) new - { - BiomeName = ShopHelper.BiomeNameKey(biomeID) - }); - this._currentPriceAdjustment *= 0.9f; - } - - public void DislikeBiome(int biomeID) - { - this.AddHappinessReportText(nameof (DislikeBiome), (object) new - { - BiomeName = ShopHelper.BiomeNameKey(biomeID) - }); - this._currentPriceAdjustment *= 1.05f; - } - - public void HateBiome(int biomeID) - { - this.AddHappinessReportText(nameof (HateBiome), (object) new - { - BiomeName = ShopHelper.BiomeNameKey(biomeID) - }); - this._currentPriceAdjustment *= 1.1f; - } - - public void LikeNPC(int npcType) - { - this.AddHappinessReportText(nameof (LikeNPC), (object) new - { - NPCName = NPC.GetFullnameByID(npcType) - }); - this._currentPriceAdjustment *= 0.95f; - } - - public void LoveNPC(int npcType) - { - this.AddHappinessReportText(nameof (LoveNPC), (object) new - { - NPCName = NPC.GetFullnameByID(npcType) - }); - this._currentPriceAdjustment *= 0.9f; - } - - public void DislikeNPC(int npcType) - { - this.AddHappinessReportText(nameof (DislikeNPC), (object) new - { - NPCName = NPC.GetFullnameByID(npcType) - }); - this._currentPriceAdjustment *= 1.05f; - } - - public void HateNPC(int npcType) - { - this.AddHappinessReportText(nameof (HateNPC), (object) new - { - NPCName = NPC.GetFullnameByID(npcType) - }); - this._currentPriceAdjustment *= 1.1f; - } - - private List GetNearbyResidentNPCs( - NPC npc, - out int npcsWithinHouse, - out int npcsWithinVillage) - { - List npcList = new List(); - npcsWithinHouse = 0; - npcsWithinVillage = 0; - Vector2 vector2_1 = new Vector2((float) npc.homeTileX, (float) npc.homeTileY); - if (npc.homeless) - vector2_1 = new Vector2(npc.Center.X / 16f, npc.Center.Y / 16f); - for (int index = 0; index < 200; ++index) - { - if (index != npc.whoAmI) - { - NPC npc1 = Main.npc[index]; - if (npc1.active && npc1.townNPC && !this.IsNotReallyTownNPC(npc1) && !WorldGen.TownManager.CanNPCsLiveWithEachOther_ShopHelper(npc, npc1)) - { - Vector2 vector2_2 = new Vector2((float) npc1.homeTileX, (float) npc1.homeTileY); - if (npc1.homeless) - vector2_2 = npc1.Center / 16f; - float num = Vector2.Distance(vector2_1, vector2_2); - if ((double) num < 25.0) - { - npcList.Add(npc1); - ++npcsWithinHouse; - } - else if ((double) num < 120.0) - ++npcsWithinVillage; - } - } - } - return npcList; - } - - private bool RuinMoodIfHomeless(NPC npc) - { - if (npc.homeless) - this.AddHappinessReportText("NoHome"); - return npc.homeless; - } - - private bool IsFarFromHome(NPC npc) - { - if ((double) Vector2.Distance(new Vector2((float) npc.homeTileX, (float) npc.homeTileY), new Vector2(npc.Center.X / 16f, npc.Center.Y / 16f)) <= 120.0) - return false; - this.AddHappinessReportText("FarFromHome"); - return true; - } - - private bool IsPlayerInEvilBiomes(Player player) - { - if (player.ZoneCorrupt) - { - this.AddHappinessReportText("HateBiome", (object) new - { - BiomeName = ShopHelper.BiomeNameKey(9) - }); - return true; - } - if (player.ZoneCrimson) - { - this.AddHappinessReportText("HateBiome", (object) new - { - BiomeName = ShopHelper.BiomeNameKey(10) - }); - return true; - } - if (!player.ZoneDungeon) - return false; - this.AddHappinessReportText("HateBiome", (object) new - { - BiomeName = ShopHelper.BiomeNameKey(8) - }); - return true; - } - - private bool IsNotReallyTownNPC(NPC npc) - { - switch (npc.type) - { - case 37: - case 368: - case 453: - return true; - default: - return false; - } - } - } -} diff --git a/GameContent/Skies/AmbientSky.cs b/GameContent/Skies/AmbientSky.cs deleted file mode 100644 index a8bdaac..0000000 --- a/GameContent/Skies/AmbientSky.cs +++ /dev/null @@ -1,1219 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Skies.AmbientSky -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using ReLogic.Utilities; -using System; -using System.Collections.Generic; -using Terraria.DataStructures; -using Terraria.GameContent.Ambience; -using Terraria.Graphics; -using Terraria.Graphics.Effects; -using Terraria.ID; -using Terraria.Utilities; - -namespace Terraria.GameContent.Skies -{ - public class AmbientSky : CustomSky - { - private bool _isActive; - private readonly SlotVector _entities = new SlotVector(500); - private int _frameCounter; - - public override void Activate(Vector2 position, params object[] args) => this._isActive = true; - - public override void Deactivate(params object[] args) => this._isActive = false; - - private bool AnActiveSkyConflictsWithAmbience() => SkyManager.Instance["MonolithMoonLord"].IsActive() || SkyManager.Instance["MoonLord"].IsActive(); - - public override void Update(GameTime gameTime) - { - if (Main.gamePaused) - return; - ++this._frameCounter; - if (Main.netMode != 2 && this.AnActiveSkyConflictsWithAmbience() && SkyManager.Instance["Ambience"].IsActive()) - SkyManager.Instance.Deactivate("Ambience"); - foreach (SlotVector.ItemPair entity in (IEnumerable.ItemPair>) this._entities) - { - // ISSUE: variable of the null type - __Null local = entity.Value; - ((AmbientSky.SkyEntity) local).Update(this._frameCounter); - if (!((AmbientSky.SkyEntity) local).IsActive) - { - this._entities.Remove((SlotId) entity.Id); - if (Main.netMode != 2 && this._entities.Count == 0 && SkyManager.Instance["Ambience"].IsActive()) - SkyManager.Instance.Deactivate("Ambience"); - } - } - } - - public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth) - { - if (Main.gameMenu && Main.netMode == 0 && SkyManager.Instance["Ambience"].IsActive()) - { - this._entities.Clear(); - SkyManager.Instance.Deactivate("Ambience"); - } - foreach (SlotVector.ItemPair entity in (IEnumerable.ItemPair>) this._entities) - ((AmbientSky.SkyEntity) entity.Value).Draw(spriteBatch, 3f, minDepth, maxDepth); - } - - public override bool IsActive() => this._isActive; - - public override void Reset() - { - } - - public void Spawn(Player player, SkyEntityType type, int seed) - { - FastRandom random = new FastRandom(seed); - switch (type) - { - case SkyEntityType.BirdsV: - this._entities.Add((AmbientSky.SkyEntity) new AmbientSky.BirdsPackSkyEntity(player, random)); - break; - case SkyEntityType.Wyvern: - this._entities.Add((AmbientSky.SkyEntity) new AmbientSky.WyvernSkyEntity(player, random)); - break; - case SkyEntityType.Airship: - this._entities.Add((AmbientSky.SkyEntity) new AmbientSky.AirshipSkyEntity(player, random)); - break; - case SkyEntityType.AirBalloon: - this._entities.Add((AmbientSky.SkyEntity) new AmbientSky.AirBalloonSkyEntity(player, random)); - break; - case SkyEntityType.Eyeball: - this._entities.Add((AmbientSky.SkyEntity) new AmbientSky.EOCSkyEntity(player, random)); - break; - case SkyEntityType.Meteor: - this._entities.Add((AmbientSky.SkyEntity) new AmbientSky.MeteorSkyEntity(player, random)); - break; - case SkyEntityType.Bats: - List group1 = AmbientSky.BatsGroupSkyEntity.CreateGroup(player, random); - for (int index = 0; index < group1.Count; ++index) - this._entities.Add((AmbientSky.SkyEntity) group1[index]); - break; - case SkyEntityType.Butterflies: - this._entities.Add((AmbientSky.SkyEntity) new AmbientSky.ButterfliesSkyEntity(player, random)); - break; - case SkyEntityType.LostKite: - this._entities.Add((AmbientSky.SkyEntity) new AmbientSky.LostKiteSkyEntity(player, random)); - break; - case SkyEntityType.Vulture: - this._entities.Add((AmbientSky.SkyEntity) new AmbientSky.VultureSkyEntity(player, random)); - break; - case SkyEntityType.PixiePosse: - this._entities.Add((AmbientSky.SkyEntity) new AmbientSky.PixiePosseSkyEntity(player, random)); - break; - case SkyEntityType.Seagulls: - List group2 = AmbientSky.SeagullsGroupSkyEntity.CreateGroup(player, random); - for (int index = 0; index < group2.Count; ++index) - this._entities.Add((AmbientSky.SkyEntity) group2[index]); - break; - case SkyEntityType.SlimeBalloons: - List group3 = AmbientSky.SlimeBalloonGroupSkyEntity.CreateGroup(player, random); - for (int index = 0; index < group3.Count; ++index) - this._entities.Add((AmbientSky.SkyEntity) group3[index]); - break; - case SkyEntityType.Gastropods: - List group4 = AmbientSky.GastropodGroupSkyEntity.CreateGroup(player, random); - for (int index = 0; index < group4.Count; ++index) - this._entities.Add((AmbientSky.SkyEntity) group4[index]); - break; - case SkyEntityType.Pegasus: - this._entities.Add((AmbientSky.SkyEntity) new AmbientSky.PegasusSkyEntity(player, random)); - break; - case SkyEntityType.EaterOfSouls: - this._entities.Add((AmbientSky.SkyEntity) new AmbientSky.EOSSkyEntity(player, random)); - break; - case SkyEntityType.Crimera: - this._entities.Add((AmbientSky.SkyEntity) new AmbientSky.CrimeraSkyEntity(player, random)); - break; - case SkyEntityType.Hellbats: - List group5 = AmbientSky.HellBatsGoupSkyEntity.CreateGroup(player, random); - for (int index = 0; index < group5.Count; ++index) - this._entities.Add((AmbientSky.SkyEntity) group5[index]); - break; - } - if (Main.netMode == 2 || this.AnActiveSkyConflictsWithAmbience() || SkyManager.Instance["Ambience"].IsActive()) - return; - SkyManager.Instance.Activate("Ambience", new Vector2()); - } - - private abstract class SkyEntity - { - public Vector2 Position; - public Asset Texture; - public SpriteFrame Frame; - public float Depth; - public SpriteEffects Effects; - public bool IsActive = true; - public float Rotation; - - public Rectangle SourceRectangle => this.Frame.GetSourceRectangle(this.Texture.Value); - - protected void NextFrame() => this.Frame.CurrentRow = (byte) (((uint) this.Frame.CurrentRow + 1U) % (uint) this.Frame.RowCount); - - public abstract Color GetColor(Color backgroundColor); - - public abstract void Update(int frameCount); - - protected void SetPositionInWorldBasedOnScreenSpace(Vector2 actualWorldSpace) - { - Vector2 vector2 = actualWorldSpace - Main.Camera.Center; - this.Position = Main.Camera.Center + vector2 * (this.Depth / 3f); - } - - public abstract Vector2 GetDrawPosition(); - - public virtual void Draw( - SpriteBatch spriteBatch, - float depthScale, - float minDepth, - float maxDepth) - { - this.CommonDraw(spriteBatch, depthScale, minDepth, maxDepth); - } - - public void CommonDraw( - SpriteBatch spriteBatch, - float depthScale, - float minDepth, - float maxDepth) - { - if ((double) this.Depth <= (double) minDepth || (double) this.Depth > (double) maxDepth) - return; - Vector2 drawPositionByDepth = this.GetDrawPositionByDepth(); - Color color = this.GetColor(Main.ColorOfTheSkies) * Main.atmo; - Vector2 origin = this.SourceRectangle.Size() / 2f; - float scale = depthScale / this.Depth; - spriteBatch.Draw(this.Texture.Value, drawPositionByDepth - Main.Camera.UnscaledPosition, new Rectangle?(this.SourceRectangle), color, this.Rotation, origin, scale, this.Effects, 0.0f); - } - - internal Vector2 GetDrawPositionByDepth() => (this.GetDrawPosition() - Main.Camera.Center) * new Vector2(1f / this.Depth, 0.9f / this.Depth) + Main.Camera.Center; - - internal float Helper_GetOpacityWithAccountingForOceanWaterLine() - { - float t = (this.GetDrawPositionByDepth() - Main.Camera.UnscaledPosition).Y + (float) (this.SourceRectangle.Height / 2); - float yscreenPosition = AmbientSkyDrawCache.Instance.OceanLineInfo.YScreenPosition; - return 1f - Utils.GetLerpValue(yscreenPosition - 10f, yscreenPosition - 2f, t, true) * AmbientSkyDrawCache.Instance.OceanLineInfo.OceanOpacity; - } - } - - private class FadingSkyEntity : AmbientSky.SkyEntity - { - protected int LifeTime; - protected Vector2 Velocity; - protected int FramingSpeed; - protected int TimeEntitySpawnedIn; - protected float Opacity; - protected float BrightnessLerper; - protected float FinalOpacityMultiplier; - protected float OpacityNormalizedTimeToFadeIn; - protected float OpacityNormalizedTimeToFadeOut; - protected int FrameOffset; - - public FadingSkyEntity() - { - this.Opacity = 0.0f; - this.TimeEntitySpawnedIn = -1; - this.BrightnessLerper = 0.0f; - this.FinalOpacityMultiplier = 1f; - this.OpacityNormalizedTimeToFadeIn = 0.1f; - this.OpacityNormalizedTimeToFadeOut = 0.9f; - } - - public override void Update(int frameCount) - { - if (this.IsMovementDone(frameCount)) - return; - this.UpdateOpacity(frameCount); - if ((frameCount + this.FrameOffset) % this.FramingSpeed == 0) - this.NextFrame(); - this.UpdateVelocity(frameCount); - this.Position = this.Position + this.Velocity; - } - - public virtual void UpdateVelocity(int frameCount) - { - } - - private void UpdateOpacity(int frameCount) - { - int num = frameCount - this.TimeEntitySpawnedIn; - if ((double) num >= (double) this.LifeTime * (double) this.OpacityNormalizedTimeToFadeOut) - this.Opacity = Utils.GetLerpValue((float) this.LifeTime, (float) this.LifeTime * this.OpacityNormalizedTimeToFadeOut, (float) num, true); - else - this.Opacity = Utils.GetLerpValue(0.0f, (float) this.LifeTime * this.OpacityNormalizedTimeToFadeIn, (float) num, true); - } - - private bool IsMovementDone(int frameCount) - { - if (this.TimeEntitySpawnedIn == -1) - this.TimeEntitySpawnedIn = frameCount; - if (frameCount - this.TimeEntitySpawnedIn < this.LifeTime) - return false; - this.IsActive = false; - return true; - } - - public override Color GetColor(Color backgroundColor) => Color.Lerp(backgroundColor, Color.White, this.BrightnessLerper) * this.Opacity * this.FinalOpacityMultiplier * this.Helper_GetOpacityWithAccountingForOceanWaterLine(); - - public void StartFadingOut(int currentFrameCount) - { - int num1 = (int) ((double) this.LifeTime * (double) this.OpacityNormalizedTimeToFadeOut); - int num2 = currentFrameCount - num1; - if (num2 >= this.TimeEntitySpawnedIn) - return; - this.TimeEntitySpawnedIn = num2; - } - - public override Vector2 GetDrawPosition() => this.Position; - } - - private class ButterfliesSkyEntity : AmbientSky.FadingSkyEntity - { - public ButterfliesSkyEntity(Player player, FastRandom random) - { - VirtualCamera virtualCamera = new VirtualCamera(player); - this.Effects = (double) Main.WindForVisuals > 0.0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - int num1 = 100; - if (this.Effects == SpriteEffects.FlipHorizontally) - this.Position.X = virtualCamera.Position.X + virtualCamera.Size.X + (float) num1; - else - this.Position.X = virtualCamera.Position.X - (float) num1; - this.Position.Y = (float) ((double) random.NextFloat() * (Main.worldSurface * 16.0 - 4000.0) + 4000.0); - this.Depth = (float) ((double) random.NextFloat() * 3.0 + 3.0); - this.SetPositionInWorldBasedOnScreenSpace(this.Position); - int num2 = random.Next(2) + 1; - this.Texture = Main.Assets.Request("Images/Backgrounds/Ambience/ButterflySwarm" + (object) num2, (AssetRequestMode) 1); - this.Frame = new SpriteFrame((byte) 1, num2 == 2 ? (byte) 19 : (byte) 17); - this.LifeTime = random.Next(60, 121) * 60; - this.OpacityNormalizedTimeToFadeIn = 0.15f; - this.OpacityNormalizedTimeToFadeOut = 0.85f; - this.BrightnessLerper = 0.2f; - this.FinalOpacityMultiplier = 1f; - this.FramingSpeed = 5; - } - - public override void UpdateVelocity(int frameCount) => this.Velocity = new Vector2((float) ((0.100000001490116 + (double) Math.Abs(Main.WindForVisuals) * 0.0500000007450581) * (this.Effects == SpriteEffects.FlipHorizontally ? -1.0 : 1.0)), 0.0f); - - public override void Update(int frameCount) - { - base.Update(frameCount); - if (!Main.IsItRaining && Main.dayTime && !Main.eclipse) - return; - this.StartFadingOut(frameCount); - } - } - - private class LostKiteSkyEntity : AmbientSky.FadingSkyEntity - { - public LostKiteSkyEntity(Player player, FastRandom random) - { - VirtualCamera virtualCamera = new VirtualCamera(player); - this.Effects = (double) Main.WindForVisuals > 0.0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - int num1 = 100; - if (this.Effects == SpriteEffects.FlipHorizontally) - this.Position.X = virtualCamera.Position.X + virtualCamera.Size.X + (float) num1; - else - this.Position.X = virtualCamera.Position.X - (float) num1; - this.Position.Y = (float) ((double) random.NextFloat() * (Main.worldSurface * 16.0 - 1600.0 - 2400.0) + 2400.0); - this.Depth = (float) ((double) random.NextFloat() * 3.0 + 3.0); - this.SetPositionInWorldBasedOnScreenSpace(this.Position); - this.Texture = Main.Assets.Request("Images/Backgrounds/Ambience/LostKite", (AssetRequestMode) 1); - this.Frame = new SpriteFrame((byte) 1, (byte) 42); - this.LifeTime = random.Next(60, 121) * 60; - this.OpacityNormalizedTimeToFadeIn = 0.15f; - this.OpacityNormalizedTimeToFadeOut = 0.85f; - this.BrightnessLerper = 0.2f; - this.FinalOpacityMultiplier = 1f; - this.FramingSpeed = 6; - int num2 = random.Next((int) this.Frame.RowCount); - for (int index = 0; index < num2; ++index) - this.NextFrame(); - } - - public override void UpdateVelocity(int frameCount) - { - float num = (float) (1.20000004768372 + (double) Math.Abs(Main.WindForVisuals) * 3.0); - if (Main.IsItStorming) - num *= 1.5f; - this.Velocity = new Vector2(num * (this.Effects == SpriteEffects.FlipHorizontally ? -1f : 1f), 0.0f); - } - - public override void Update(int frameCount) - { - if (Main.IsItStorming) - this.FramingSpeed = 4; - this.Effects = (double) Main.WindForVisuals > 0.0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - base.Update(frameCount); - if (Main.dayTime && !Main.eclipse) - return; - this.StartFadingOut(frameCount); - } - } - - private class PegasusSkyEntity : AmbientSky.FadingSkyEntity - { - public PegasusSkyEntity(Player player, FastRandom random) - { - VirtualCamera virtualCamera = new VirtualCamera(player); - this.Effects = (double) Main.WindForVisuals > 0.0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - int num = 100; - if (this.Effects == SpriteEffects.FlipHorizontally) - this.Position.X = virtualCamera.Position.X + virtualCamera.Size.X + (float) num; - else - this.Position.X = virtualCamera.Position.X - (float) num; - this.Position.Y = (float) ((double) random.NextFloat() * (Main.worldSurface * 16.0 - 1600.0 - 2400.0) + 2400.0); - this.Depth = (float) ((double) random.NextFloat() * 3.0 + 3.0); - this.SetPositionInWorldBasedOnScreenSpace(this.Position); - this.Texture = Main.Assets.Request("Images/Backgrounds/Ambience/Pegasus", (AssetRequestMode) 1); - this.Frame = new SpriteFrame((byte) 1, (byte) 11); - this.LifeTime = random.Next(60, 121) * 60; - this.OpacityNormalizedTimeToFadeIn = 0.15f; - this.OpacityNormalizedTimeToFadeOut = 0.85f; - this.BrightnessLerper = 0.2f; - this.FinalOpacityMultiplier = 1f; - this.FramingSpeed = 5; - } - - public override void UpdateVelocity(int frameCount) => this.Velocity = new Vector2((float) ((1.5 + (double) Math.Abs(Main.WindForVisuals) * 0.600000023841858) * (this.Effects == SpriteEffects.FlipHorizontally ? -1.0 : 1.0)), 0.0f); - - public override void Update(int frameCount) - { - base.Update(frameCount); - if (!Main.IsItRaining && Main.dayTime && !Main.eclipse) - return; - this.StartFadingOut(frameCount); - } - - public override Color GetColor(Color backgroundColor) => base.GetColor(backgroundColor) * Main.bgAlphaFrontLayer[6]; - } - - private class VultureSkyEntity : AmbientSky.FadingSkyEntity - { - public VultureSkyEntity(Player player, FastRandom random) - { - VirtualCamera virtualCamera = new VirtualCamera(player); - this.Effects = (double) Main.WindForVisuals > 0.0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - int num = 100; - if (this.Effects == SpriteEffects.FlipHorizontally) - this.Position.X = virtualCamera.Position.X + virtualCamera.Size.X + (float) num; - else - this.Position.X = virtualCamera.Position.X - (float) num; - this.Position.Y = (float) ((double) random.NextFloat() * (Main.worldSurface * 16.0 - 1600.0 - 2400.0) + 2400.0); - this.Depth = (float) ((double) random.NextFloat() * 3.0 + 3.0); - this.SetPositionInWorldBasedOnScreenSpace(this.Position); - this.Texture = Main.Assets.Request("Images/Backgrounds/Ambience/Vulture", (AssetRequestMode) 1); - this.Frame = new SpriteFrame((byte) 1, (byte) 10); - this.LifeTime = random.Next(60, 121) * 60; - this.OpacityNormalizedTimeToFadeIn = 0.15f; - this.OpacityNormalizedTimeToFadeOut = 0.85f; - this.BrightnessLerper = 0.2f; - this.FinalOpacityMultiplier = 1f; - this.FramingSpeed = 5; - } - - public override void UpdateVelocity(int frameCount) => this.Velocity = new Vector2((float) ((3.0 + (double) Math.Abs(Main.WindForVisuals) * 0.800000011920929) * (this.Effects == SpriteEffects.FlipHorizontally ? -1.0 : 1.0)), 0.0f); - - public override void Update(int frameCount) - { - base.Update(frameCount); - if (!Main.IsItRaining && Main.dayTime && !Main.eclipse) - return; - this.StartFadingOut(frameCount); - } - - public override Color GetColor(Color backgroundColor) => base.GetColor(backgroundColor) * Math.Max(Main.bgAlphaFrontLayer[2], Main.bgAlphaFrontLayer[5]); - } - - private class PixiePosseSkyEntity : AmbientSky.FadingSkyEntity - { - private int pixieType = 1; - - public PixiePosseSkyEntity(Player player, FastRandom random) - { - VirtualCamera virtualCamera = new VirtualCamera(player); - this.Effects = (double) Main.WindForVisuals > 0.0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - int num = 100; - if (this.Effects == SpriteEffects.FlipHorizontally) - this.Position.X = virtualCamera.Position.X + virtualCamera.Size.X + (float) num; - else - this.Position.X = virtualCamera.Position.X - (float) num; - this.Position.Y = (float) ((double) random.NextFloat() * (Main.worldSurface * 16.0 - 4000.0) + 4000.0); - this.Depth = (float) ((double) random.NextFloat() * 3.0 + 2.0); - this.SetPositionInWorldBasedOnScreenSpace(this.Position); - if (!Main.dayTime) - this.pixieType = 2; - this.Texture = Main.Assets.Request("Images/Backgrounds/Ambience/PixiePosse" + (object) this.pixieType, (AssetRequestMode) 1); - this.Frame = new SpriteFrame((byte) 1, (byte) 25); - this.LifeTime = random.Next(60, 121) * 60; - this.OpacityNormalizedTimeToFadeIn = 0.15f; - this.OpacityNormalizedTimeToFadeOut = 0.85f; - this.BrightnessLerper = 0.6f; - this.FinalOpacityMultiplier = 1f; - this.FramingSpeed = 5; - } - - public override void UpdateVelocity(int frameCount) => this.Velocity = new Vector2((float) ((0.119999997317791 + (double) Math.Abs(Main.WindForVisuals) * 0.0799999982118607) * (this.Effects == SpriteEffects.FlipHorizontally ? -1.0 : 1.0)), 0.0f); - - public override void Update(int frameCount) - { - base.Update(frameCount); - if ((this.pixieType != 1 || Main.dayTime) && (this.pixieType != 2 || !Main.dayTime) && !Main.IsItRaining && !Main.eclipse && !Main.bloodMoon && !Main.pumpkinMoon && !Main.snowMoon) - return; - this.StartFadingOut(frameCount); - } - - public override void Draw( - SpriteBatch spriteBatch, - float depthScale, - float minDepth, - float maxDepth) - { - this.CommonDraw(spriteBatch, depthScale - 0.1f, minDepth, maxDepth); - } - } - - private class BirdsPackSkyEntity : AmbientSky.FadingSkyEntity - { - public BirdsPackSkyEntity(Player player, FastRandom random) - { - VirtualCamera virtualCamera = new VirtualCamera(player); - this.Effects = (double) Main.WindForVisuals > 0.0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - int num = 100; - if (this.Effects == SpriteEffects.FlipHorizontally) - this.Position.X = virtualCamera.Position.X + virtualCamera.Size.X + (float) num; - else - this.Position.X = virtualCamera.Position.X - (float) num; - this.Position.Y = (float) ((double) random.NextFloat() * (Main.worldSurface * 16.0 - 1600.0 - 2400.0) + 2400.0); - this.Depth = (float) ((double) random.NextFloat() * 3.0 + 3.0); - this.SetPositionInWorldBasedOnScreenSpace(this.Position); - this.Texture = Main.Assets.Request("Images/Backgrounds/Ambience/BirdsVShape", (AssetRequestMode) 1); - this.Frame = new SpriteFrame((byte) 1, (byte) 4); - this.LifeTime = random.Next(60, 121) * 60; - this.OpacityNormalizedTimeToFadeIn = 0.15f; - this.OpacityNormalizedTimeToFadeOut = 0.85f; - this.BrightnessLerper = 0.2f; - this.FinalOpacityMultiplier = 1f; - this.FramingSpeed = 5; - } - - public override void UpdateVelocity(int frameCount) => this.Velocity = new Vector2((float) ((3.0 + (double) Math.Abs(Main.WindForVisuals) * 0.800000011920929) * (this.Effects == SpriteEffects.FlipHorizontally ? -1.0 : 1.0)), 0.0f); - - public override void Update(int frameCount) - { - base.Update(frameCount); - if (!Main.IsItRaining && Main.dayTime && !Main.eclipse) - return; - this.StartFadingOut(frameCount); - } - } - - private class SeagullsGroupSkyEntity : AmbientSky.FadingSkyEntity - { - private Vector2 _magnetAccelerations; - private Vector2 _magnetPointTarget; - private Vector2 _positionVsMagnet; - private Vector2 _velocityVsMagnet; - - public SeagullsGroupSkyEntity(Player player, FastRandom random) - { - VirtualCamera virtualCamera = new VirtualCamera(player); - this.Effects = (double) Main.WindForVisuals > 0.0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - int num1 = 100; - if (this.Effects == SpriteEffects.FlipHorizontally) - this.Position.X = virtualCamera.Position.X + virtualCamera.Size.X + (float) num1; - else - this.Position.X = virtualCamera.Position.X - (float) num1; - this.Position.Y = (float) ((double) random.NextFloat() * (Main.worldSurface * 16.0 - 1600.0 - 2400.0) + 2400.0); - this.Depth = (float) ((double) random.NextFloat() * 3.0 + 3.0); - this.SetPositionInWorldBasedOnScreenSpace(this.Position); - this.Texture = Main.Assets.Request("Images/Backgrounds/Ambience/Seagull", (AssetRequestMode) 1); - this.Frame = new SpriteFrame((byte) 1, (byte) 9); - this.LifeTime = random.Next(60, 121) * 60; - this.OpacityNormalizedTimeToFadeIn = 0.1f; - this.OpacityNormalizedTimeToFadeOut = 0.9f; - this.BrightnessLerper = 0.2f; - this.FinalOpacityMultiplier = 1f; - this.FramingSpeed = 4; - this.FrameOffset = random.Next(0, (int) this.Frame.RowCount); - int num2 = random.Next((int) this.Frame.RowCount); - for (int index = 0; index < num2; ++index) - this.NextFrame(); - } - - public override void UpdateVelocity(int frameCount) - { - this._velocityVsMagnet += this._magnetAccelerations * new Vector2((float) Math.Sign(this._magnetPointTarget.X - this._positionVsMagnet.X), (float) Math.Sign(this._magnetPointTarget.Y - this._positionVsMagnet.Y)); - this._positionVsMagnet += this._velocityVsMagnet; - this.Velocity = new Vector2((float) (4.0 * (this.Effects == SpriteEffects.FlipHorizontally ? -1.0 : 1.0)), 0.0f) + this._velocityVsMagnet; - } - - public override void Update(int frameCount) - { - base.Update(frameCount); - if (!Main.IsItRaining && Main.dayTime && !Main.eclipse) - return; - this.StartFadingOut(frameCount); - } - - public void SetMagnetization(Vector2 accelerations, Vector2 targetOffset) - { - this._magnetAccelerations = accelerations; - this._magnetPointTarget = targetOffset; - } - - public override Color GetColor(Color backgroundColor) => base.GetColor(backgroundColor) * Main.bgAlphaFrontLayer[4]; - - public override void Draw( - SpriteBatch spriteBatch, - float depthScale, - float minDepth, - float maxDepth) - { - this.CommonDraw(spriteBatch, depthScale - 1.5f, minDepth, maxDepth); - } - - public static List CreateGroup( - Player player, - FastRandom random) - { - List seagullsGroupSkyEntityList = new List(); - int num1 = 100; - int num2 = random.Next(5, 9); - float num3 = 100f; - VirtualCamera virtualCamera = new VirtualCamera(player); - SpriteEffects spriteEffects = (double) Main.WindForVisuals > 0.0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - Vector2 vector2_1 = new Vector2(); - vector2_1.X = spriteEffects != SpriteEffects.FlipHorizontally ? virtualCamera.Position.X - (float) num1 : virtualCamera.Position.X + virtualCamera.Size.X + (float) num1; - vector2_1.Y = (float) ((double) random.NextFloat() * (Main.worldSurface * 16.0 - 1600.0 - 2400.0) + 2400.0); - float num4 = (float) ((double) random.NextFloat() * 2.0 + 1.0); - int num5 = random.Next(30, 61) * 60; - Vector2 vector2_2 = new Vector2((float) ((double) random.NextFloat() * 0.5 + 0.5), (float) ((double) random.NextFloat() * 0.5 + 0.5)); - Vector2 targetOffset = new Vector2((float) ((double) random.NextFloat() * 2.0 - 1.0), (float) ((double) random.NextFloat() * 2.0 - 1.0)) * num3; - for (int index = 0; index < num2; ++index) - { - AmbientSky.SeagullsGroupSkyEntity seagullsGroupSkyEntity = new AmbientSky.SeagullsGroupSkyEntity(player, random); - seagullsGroupSkyEntity.Depth = num4 + random.NextFloat() * 0.5f; - seagullsGroupSkyEntity.Position = vector2_1 + new Vector2((float) ((double) random.NextFloat() * 20.0 - 10.0), random.NextFloat() * 3f) * 50f; - seagullsGroupSkyEntity.Effects = spriteEffects; - seagullsGroupSkyEntity.SetPositionInWorldBasedOnScreenSpace(seagullsGroupSkyEntity.Position); - seagullsGroupSkyEntity.LifeTime = num5 + random.Next(301); - seagullsGroupSkyEntity.SetMagnetization(vector2_2 * (float) ((double) random.NextFloat() * 0.300000011920929 + 0.850000023841858) * 0.05f, targetOffset); - seagullsGroupSkyEntityList.Add(seagullsGroupSkyEntity); - } - return seagullsGroupSkyEntityList; - } - } - - private class GastropodGroupSkyEntity : AmbientSky.FadingSkyEntity - { - private Vector2 _magnetAccelerations; - private Vector2 _magnetPointTarget; - private Vector2 _positionVsMagnet; - private Vector2 _velocityVsMagnet; - - public GastropodGroupSkyEntity(Player player, FastRandom random) - { - VirtualCamera virtualCamera = new VirtualCamera(player); - this.Effects = (double) Main.WindForVisuals > 0.0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - int num = 100; - if (this.Effects == SpriteEffects.FlipHorizontally) - this.Position.X = virtualCamera.Position.X + virtualCamera.Size.X + (float) num; - else - this.Position.X = virtualCamera.Position.X - (float) num; - this.Position.Y = (float) ((double) random.NextFloat() * (Main.worldSurface * 16.0 - 1600.0 - 3200.0) + 3200.0); - this.Depth = (float) ((double) random.NextFloat() * 3.0 + 2.0); - this.SetPositionInWorldBasedOnScreenSpace(this.Position); - this.Texture = Main.Assets.Request("Images/Backgrounds/Ambience/Gastropod", (AssetRequestMode) 1); - this.Frame = new SpriteFrame((byte) 1, (byte) 1); - this.LifeTime = random.Next(60, 121) * 60; - this.OpacityNormalizedTimeToFadeIn = 0.1f; - this.OpacityNormalizedTimeToFadeOut = 0.9f; - this.BrightnessLerper = 0.75f; - this.FinalOpacityMultiplier = 1f; - this.FramingSpeed = int.MaxValue; - } - - public override void UpdateVelocity(int frameCount) - { - this._velocityVsMagnet += this._magnetAccelerations * new Vector2((float) Math.Sign(this._magnetPointTarget.X - this._positionVsMagnet.X), (float) Math.Sign(this._magnetPointTarget.Y - this._positionVsMagnet.Y)); - this._positionVsMagnet += this._velocityVsMagnet; - this.Velocity = new Vector2((float) ((1.5 + (double) Math.Abs(Main.WindForVisuals) * 0.200000002980232) * (this.Effects == SpriteEffects.FlipHorizontally ? -1.0 : 1.0)), 0.0f) + this._velocityVsMagnet; - this.Rotation = this.Velocity.X * 0.1f; - } - - public override void Update(int frameCount) - { - base.Update(frameCount); - if (!Main.IsItRaining && !Main.dayTime && !Main.bloodMoon && !Main.pumpkinMoon && !Main.snowMoon) - return; - this.StartFadingOut(frameCount); - } - - public override Color GetColor(Color backgroundColor) => Color.Lerp(backgroundColor, Colors.AmbientNPCGastropodLight, this.BrightnessLerper) * this.Opacity * this.FinalOpacityMultiplier; - - public override void Draw( - SpriteBatch spriteBatch, - float depthScale, - float minDepth, - float maxDepth) - { - this.CommonDraw(spriteBatch, depthScale - 0.1f, minDepth, maxDepth); - } - - public void SetMagnetization(Vector2 accelerations, Vector2 targetOffset) - { - this._magnetAccelerations = accelerations; - this._magnetPointTarget = targetOffset; - } - - public static List CreateGroup( - Player player, - FastRandom random) - { - List gastropodGroupSkyEntityList = new List(); - int num1 = 100; - int num2 = random.Next(3, 8); - VirtualCamera virtualCamera = new VirtualCamera(player); - SpriteEffects spriteEffects = (double) Main.WindForVisuals > 0.0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - Vector2 vector2_1 = new Vector2(); - vector2_1.X = spriteEffects != SpriteEffects.FlipHorizontally ? virtualCamera.Position.X - (float) num1 : virtualCamera.Position.X + virtualCamera.Size.X + (float) num1; - vector2_1.Y = (float) ((double) random.NextFloat() * (Main.worldSurface * 16.0 - 1600.0 - 3200.0) + 3200.0); - float num3 = (float) ((double) random.NextFloat() * 3.0 + 2.0); - int num4 = random.Next(30, 61) * 60; - Vector2 vector2_2 = new Vector2((float) ((double) random.NextFloat() * 0.100000001490116 + 0.100000001490116), (float) ((double) random.NextFloat() * 0.300000011920929 + 0.300000011920929)); - Vector2 targetOffset = new Vector2((float) ((double) random.NextFloat() * 2.0 - 1.0), (float) ((double) random.NextFloat() * 2.0 - 1.0)) * 120f; - for (int index = 0; index < num2; ++index) - { - AmbientSky.GastropodGroupSkyEntity gastropodGroupSkyEntity = new AmbientSky.GastropodGroupSkyEntity(player, random); - gastropodGroupSkyEntity.Depth = num3 + random.NextFloat() * 0.5f; - gastropodGroupSkyEntity.Position = vector2_1 + new Vector2((float) ((double) random.NextFloat() * 20.0 - 10.0), random.NextFloat() * 3f) * 60f; - gastropodGroupSkyEntity.Effects = spriteEffects; - gastropodGroupSkyEntity.SetPositionInWorldBasedOnScreenSpace(gastropodGroupSkyEntity.Position); - gastropodGroupSkyEntity.LifeTime = num4 + random.Next(301); - gastropodGroupSkyEntity.SetMagnetization(vector2_2 * (random.NextFloat() * 0.5f) * 0.05f, targetOffset); - gastropodGroupSkyEntityList.Add(gastropodGroupSkyEntity); - } - return gastropodGroupSkyEntityList; - } - } - - private class SlimeBalloonGroupSkyEntity : AmbientSky.FadingSkyEntity - { - private Vector2 _magnetAccelerations; - private Vector2 _magnetPointTarget; - private Vector2 _positionVsMagnet; - private Vector2 _velocityVsMagnet; - - public SlimeBalloonGroupSkyEntity(Player player, FastRandom random) - { - VirtualCamera virtualCamera = new VirtualCamera(player); - this.Effects = (double) Main.WindForVisuals > 0.0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - int num = 100; - if (this.Effects == SpriteEffects.FlipHorizontally) - this.Position.X = virtualCamera.Position.X + virtualCamera.Size.X + (float) num; - else - this.Position.X = virtualCamera.Position.X - (float) num; - this.Position.Y = (float) ((double) random.NextFloat() * (Main.worldSurface * 16.0 - 1600.0 - 4000.0) + 4000.0); - this.Depth = (float) ((double) random.NextFloat() * 3.0 + 3.0); - this.SetPositionInWorldBasedOnScreenSpace(this.Position); - this.Texture = Main.Assets.Request("Images/Backgrounds/Ambience/SlimeBalloons", (AssetRequestMode) 1); - this.Frame = new SpriteFrame((byte) 1, (byte) 7); - this.Frame.CurrentRow = (byte) random.Next(7); - this.LifeTime = random.Next(60, 121) * 60; - this.OpacityNormalizedTimeToFadeIn = 0.025f; - this.OpacityNormalizedTimeToFadeOut = 0.975f; - this.BrightnessLerper = 0.2f; - this.FinalOpacityMultiplier = 1f; - this.FramingSpeed = int.MaxValue; - } - - public override void UpdateVelocity(int frameCount) - { - this._velocityVsMagnet += this._magnetAccelerations * new Vector2((float) Math.Sign(this._magnetPointTarget.X - this._positionVsMagnet.X), (float) Math.Sign(this._magnetPointTarget.Y - this._positionVsMagnet.Y)); - this._positionVsMagnet += this._velocityVsMagnet; - this.Velocity = new Vector2((float) ((1.0 + (double) Math.Abs(Main.WindForVisuals) * 1.0) * (this.Effects == SpriteEffects.FlipHorizontally ? -1.0 : 1.0)), -0.01f) + this._velocityVsMagnet; - this.Rotation = this.Velocity.X * 0.1f; - } - - public override void Update(int frameCount) - { - base.Update(frameCount); - this.Effects = (double) Main.WindForVisuals > 0.0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - if (Main.IsItAHappyWindyDay && !Main.IsItRaining && Main.dayTime && !Main.eclipse) - return; - this.StartFadingOut(frameCount); - } - - public void SetMagnetization(Vector2 accelerations, Vector2 targetOffset) - { - this._magnetAccelerations = accelerations; - this._magnetPointTarget = targetOffset; - } - - public static List CreateGroup( - Player player, - FastRandom random) - { - List balloonGroupSkyEntityList = new List(); - int num1 = 100; - int num2 = random.Next(5, 10); - VirtualCamera virtualCamera = new VirtualCamera(player); - SpriteEffects spriteEffects = (double) Main.WindForVisuals > 0.0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - Vector2 vector2_1 = new Vector2(); - vector2_1.X = spriteEffects != SpriteEffects.FlipHorizontally ? virtualCamera.Position.X - (float) num1 : virtualCamera.Position.X + virtualCamera.Size.X + (float) num1; - vector2_1.Y = (float) ((double) random.NextFloat() * (Main.worldSurface * 16.0 - 1600.0 - 2400.0) + 2400.0); - float num3 = (float) ((double) random.NextFloat() * 3.0 + 3.0); - int num4 = random.Next(80, 121) * 60; - Vector2 vector2_2 = new Vector2((float) ((double) random.NextFloat() * 0.100000001490116 + 0.100000001490116), (float) ((double) random.NextFloat() * 0.100000001490116 + 0.100000001490116)); - Vector2 targetOffset = new Vector2((float) ((double) random.NextFloat() * 2.0 - 1.0), (float) ((double) random.NextFloat() * 2.0 - 1.0)) * 150f; - for (int index = 0; index < num2; ++index) - { - AmbientSky.SlimeBalloonGroupSkyEntity balloonGroupSkyEntity = new AmbientSky.SlimeBalloonGroupSkyEntity(player, random); - balloonGroupSkyEntity.Depth = num3 + random.NextFloat() * 0.5f; - balloonGroupSkyEntity.Position = vector2_1 + new Vector2((float) ((double) random.NextFloat() * 20.0 - 10.0), random.NextFloat() * 3f) * 80f; - balloonGroupSkyEntity.Effects = spriteEffects; - balloonGroupSkyEntity.SetPositionInWorldBasedOnScreenSpace(balloonGroupSkyEntity.Position); - balloonGroupSkyEntity.LifeTime = num4 + random.Next(301); - balloonGroupSkyEntity.SetMagnetization(vector2_2 * (random.NextFloat() * 0.2f) * 0.05f, targetOffset); - balloonGroupSkyEntityList.Add(balloonGroupSkyEntity); - } - return balloonGroupSkyEntityList; - } - } - - private class HellBatsGoupSkyEntity : AmbientSky.FadingSkyEntity - { - private Vector2 _magnetAccelerations; - private Vector2 _magnetPointTarget; - private Vector2 _positionVsMagnet; - private Vector2 _velocityVsMagnet; - - public HellBatsGoupSkyEntity(Player player, FastRandom random) - { - VirtualCamera virtualCamera = new VirtualCamera(player); - this.Effects = (double) Main.WindForVisuals > 0.0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - int num1 = 100; - if (this.Effects == SpriteEffects.FlipHorizontally) - this.Position.X = virtualCamera.Position.X + virtualCamera.Size.X + (float) num1; - else - this.Position.X = virtualCamera.Position.X - (float) num1; - this.Position.Y = random.NextFloat() * 400f + (float) (Main.UnderworldLayer * 16); - this.Depth = (float) ((double) random.NextFloat() * 5.0 + 3.0); - this.SetPositionInWorldBasedOnScreenSpace(this.Position); - this.Texture = Main.Assets.Request("Images/Backgrounds/Ambience/HellBat" + (object) random.Next(1, 3), (AssetRequestMode) 1); - this.Frame = new SpriteFrame((byte) 1, (byte) 10); - this.LifeTime = random.Next(60, 121) * 60; - this.OpacityNormalizedTimeToFadeIn = 0.1f; - this.OpacityNormalizedTimeToFadeOut = 0.9f; - this.BrightnessLerper = 0.2f; - this.FinalOpacityMultiplier = 1f; - this.FramingSpeed = 4; - this.FrameOffset = random.Next(0, (int) this.Frame.RowCount); - int num2 = random.Next((int) this.Frame.RowCount); - for (int index = 0; index < num2; ++index) - this.NextFrame(); - } - - public override void UpdateVelocity(int frameCount) - { - this._velocityVsMagnet += this._magnetAccelerations * new Vector2((float) Math.Sign(this._magnetPointTarget.X - this._positionVsMagnet.X), (float) Math.Sign(this._magnetPointTarget.Y - this._positionVsMagnet.Y)); - this._positionVsMagnet += this._velocityVsMagnet; - this.Velocity = new Vector2((float) ((3.0 + (double) Math.Abs(Main.WindForVisuals) * 0.800000011920929) * (this.Effects == SpriteEffects.FlipHorizontally ? -1.0 : 1.0)), 0.0f) + this._velocityVsMagnet; - } - - public override void Update(int frameCount) => base.Update(frameCount); - - public void SetMagnetization(Vector2 accelerations, Vector2 targetOffset) - { - this._magnetAccelerations = accelerations; - this._magnetPointTarget = targetOffset; - } - - public override Color GetColor(Color backgroundColor) => Color.Lerp(Color.White, Color.Gray, this.Depth / 15f) * this.Opacity * this.FinalOpacityMultiplier; - - public static List CreateGroup( - Player player, - FastRandom random) - { - List batsGoupSkyEntityList = new List(); - int num1 = 100; - int num2 = random.Next(20, 40); - VirtualCamera virtualCamera = new VirtualCamera(player); - SpriteEffects spriteEffects = (double) Main.WindForVisuals > 0.0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - Vector2 vector2_1 = new Vector2(); - vector2_1.X = spriteEffects != SpriteEffects.FlipHorizontally ? virtualCamera.Position.X - (float) num1 : virtualCamera.Position.X + virtualCamera.Size.X + (float) num1; - vector2_1.Y = random.NextFloat() * 800f + (float) (Main.UnderworldLayer * 16); - float num3 = (float) ((double) random.NextFloat() * 5.0 + 3.0); - int num4 = random.Next(30, 61) * 60; - Vector2 vector2_2 = new Vector2((float) ((double) random.NextFloat() * 0.5 + 0.5), (float) ((double) random.NextFloat() * 0.5 + 0.5)); - Vector2 targetOffset = new Vector2((float) ((double) random.NextFloat() * 2.0 - 1.0), (float) ((double) random.NextFloat() * 2.0 - 1.0)) * 100f; - for (int index = 0; index < num2; ++index) - { - AmbientSky.HellBatsGoupSkyEntity batsGoupSkyEntity = new AmbientSky.HellBatsGoupSkyEntity(player, random); - batsGoupSkyEntity.Depth = num3 + random.NextFloat() * 0.5f; - batsGoupSkyEntity.Position = vector2_1 + new Vector2((float) ((double) random.NextFloat() * 20.0 - 10.0), random.NextFloat() * 3f) * 50f; - batsGoupSkyEntity.Effects = spriteEffects; - batsGoupSkyEntity.SetPositionInWorldBasedOnScreenSpace(batsGoupSkyEntity.Position); - batsGoupSkyEntity.LifeTime = num4 + random.Next(301); - batsGoupSkyEntity.SetMagnetization(vector2_2 * (float) ((double) random.NextFloat() * 0.300000011920929 + 0.850000023841858) * 0.05f, targetOffset); - batsGoupSkyEntityList.Add(batsGoupSkyEntity); - } - return batsGoupSkyEntityList; - } - } - - private class BatsGroupSkyEntity : AmbientSky.FadingSkyEntity - { - private Vector2 _magnetAccelerations; - private Vector2 _magnetPointTarget; - private Vector2 _positionVsMagnet; - private Vector2 _velocityVsMagnet; - - public BatsGroupSkyEntity(Player player, FastRandom random) - { - VirtualCamera virtualCamera = new VirtualCamera(player); - this.Effects = (double) Main.WindForVisuals > 0.0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - int num1 = 100; - if (this.Effects == SpriteEffects.FlipHorizontally) - this.Position.X = virtualCamera.Position.X + virtualCamera.Size.X + (float) num1; - else - this.Position.X = virtualCamera.Position.X - (float) num1; - this.Position.Y = (float) ((double) random.NextFloat() * (Main.worldSurface * 16.0 - 1600.0 - 2400.0) + 2400.0); - this.Depth = (float) ((double) random.NextFloat() * 3.0 + 3.0); - this.SetPositionInWorldBasedOnScreenSpace(this.Position); - this.Texture = Main.Assets.Request("Images/Backgrounds/Ambience/Bat" + (object) random.Next(1, 4), (AssetRequestMode) 1); - this.Frame = new SpriteFrame((byte) 1, (byte) 10); - this.LifeTime = random.Next(60, 121) * 60; - this.OpacityNormalizedTimeToFadeIn = 0.1f; - this.OpacityNormalizedTimeToFadeOut = 0.9f; - this.BrightnessLerper = 0.2f; - this.FinalOpacityMultiplier = 1f; - this.FramingSpeed = 4; - this.FrameOffset = random.Next(0, (int) this.Frame.RowCount); - int num2 = random.Next((int) this.Frame.RowCount); - for (int index = 0; index < num2; ++index) - this.NextFrame(); - } - - public override void UpdateVelocity(int frameCount) - { - this._velocityVsMagnet += this._magnetAccelerations * new Vector2((float) Math.Sign(this._magnetPointTarget.X - this._positionVsMagnet.X), (float) Math.Sign(this._magnetPointTarget.Y - this._positionVsMagnet.Y)); - this._positionVsMagnet += this._velocityVsMagnet; - this.Velocity = new Vector2((float) ((3.0 + (double) Math.Abs(Main.WindForVisuals) * 0.800000011920929) * (this.Effects == SpriteEffects.FlipHorizontally ? -1.0 : 1.0)), 0.0f) + this._velocityVsMagnet; - } - - public override void Update(int frameCount) - { - base.Update(frameCount); - if (!Main.IsItRaining && Main.dayTime && !Main.eclipse) - return; - this.StartFadingOut(frameCount); - } - - public void SetMagnetization(Vector2 accelerations, Vector2 targetOffset) - { - this._magnetAccelerations = accelerations; - this._magnetPointTarget = targetOffset; - } - - public override Color GetColor(Color backgroundColor) => base.GetColor(backgroundColor) * Utils.Max(Main.bgAlphaFrontLayer[3], Main.bgAlphaFrontLayer[0], Main.bgAlphaFrontLayer[10], Main.bgAlphaFrontLayer[11], Main.bgAlphaFrontLayer[12]); - - public static List CreateGroup( - Player player, - FastRandom random) - { - List batsGroupSkyEntityList = new List(); - int num1 = 100; - int num2 = random.Next(20, 40); - VirtualCamera virtualCamera = new VirtualCamera(player); - SpriteEffects spriteEffects = (double) Main.WindForVisuals > 0.0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - Vector2 vector2_1 = new Vector2(); - vector2_1.X = spriteEffects != SpriteEffects.FlipHorizontally ? virtualCamera.Position.X - (float) num1 : virtualCamera.Position.X + virtualCamera.Size.X + (float) num1; - vector2_1.Y = (float) ((double) random.NextFloat() * (Main.worldSurface * 16.0 - 1600.0 - 2400.0) + 2400.0); - float num3 = (float) ((double) random.NextFloat() * 3.0 + 3.0); - int num4 = random.Next(30, 61) * 60; - Vector2 vector2_2 = new Vector2((float) ((double) random.NextFloat() * 0.5 + 0.5), (float) ((double) random.NextFloat() * 0.5 + 0.5)); - Vector2 targetOffset = new Vector2((float) ((double) random.NextFloat() * 2.0 - 1.0), (float) ((double) random.NextFloat() * 2.0 - 1.0)) * 100f; - for (int index = 0; index < num2; ++index) - { - AmbientSky.BatsGroupSkyEntity batsGroupSkyEntity = new AmbientSky.BatsGroupSkyEntity(player, random); - batsGroupSkyEntity.Depth = num3 + random.NextFloat() * 0.5f; - batsGroupSkyEntity.Position = vector2_1 + new Vector2((float) ((double) random.NextFloat() * 20.0 - 10.0), random.NextFloat() * 3f) * 50f; - batsGroupSkyEntity.Effects = spriteEffects; - batsGroupSkyEntity.SetPositionInWorldBasedOnScreenSpace(batsGroupSkyEntity.Position); - batsGroupSkyEntity.LifeTime = num4 + random.Next(301); - batsGroupSkyEntity.SetMagnetization(vector2_2 * (float) ((double) random.NextFloat() * 0.300000011920929 + 0.850000023841858) * 0.05f, targetOffset); - batsGroupSkyEntityList.Add(batsGroupSkyEntity); - } - return batsGroupSkyEntityList; - } - } - - private class WyvernSkyEntity : AmbientSky.FadingSkyEntity - { - public WyvernSkyEntity(Player player, FastRandom random) - { - VirtualCamera virtualCamera = new VirtualCamera(player); - this.Effects = (double) Main.WindForVisuals > 0.0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - int num = 100; - if (this.Effects == SpriteEffects.FlipHorizontally) - this.Position.X = virtualCamera.Position.X + virtualCamera.Size.X + (float) num; - else - this.Position.X = virtualCamera.Position.X - (float) num; - this.Position.Y = (float) ((double) random.NextFloat() * (Main.worldSurface * 16.0 - 1600.0 - 2400.0) + 2400.0); - this.Depth = (float) ((double) random.NextFloat() * 3.0 + 3.0); - this.SetPositionInWorldBasedOnScreenSpace(this.Position); - this.Texture = Main.Assets.Request("Images/Backgrounds/Ambience/Wyvern", (AssetRequestMode) 1); - this.Frame = new SpriteFrame((byte) 1, (byte) 5); - this.LifeTime = random.Next(40, 71) * 60; - this.OpacityNormalizedTimeToFadeIn = 0.15f; - this.OpacityNormalizedTimeToFadeOut = 0.85f; - this.BrightnessLerper = 0.2f; - this.FinalOpacityMultiplier = 1f; - this.FramingSpeed = 4; - } - - public override void UpdateVelocity(int frameCount) => this.Velocity = new Vector2((float) ((3.0 + (double) Math.Abs(Main.WindForVisuals) * 0.800000011920929) * (this.Effects == SpriteEffects.FlipHorizontally ? -1.0 : 1.0)), 0.0f); - } - - private class NormalizedBackgroundLayerSpaceSkyEntity : AmbientSky.SkyEntity - { - public override Color GetColor(Color backgroundColor) => Color.Lerp(backgroundColor, Color.White, 0.3f); - - public override Vector2 GetDrawPosition() => this.Position; - - public override void Update(int frameCount) - { - } - } - - private class BoneSerpentSkyEntity : AmbientSky.NormalizedBackgroundLayerSpaceSkyEntity - { - } - - private class AirshipSkyEntity : AmbientSky.FadingSkyEntity - { - public AirshipSkyEntity(Player player, FastRandom random) - { - VirtualCamera virtualCamera = new VirtualCamera(player); - this.Effects = random.Next(2) == 0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - int num = 100; - if (this.Effects == SpriteEffects.FlipHorizontally) - this.Position.X = virtualCamera.Position.X + virtualCamera.Size.X + (float) num; - else - this.Position.X = virtualCamera.Position.X - (float) num; - this.Position.Y = (float) ((double) random.NextFloat() * (Main.worldSurface * 16.0 - 1600.0 - 2400.0) + 2400.0); - this.Depth = (float) ((double) random.NextFloat() * 3.0 + 3.0); - this.SetPositionInWorldBasedOnScreenSpace(this.Position); - this.Texture = Main.Assets.Request("Images/Backgrounds/Ambience/FlyingShip", (AssetRequestMode) 1); - this.Frame = new SpriteFrame((byte) 1, (byte) 4); - this.LifeTime = random.Next(40, 71) * 60; - this.OpacityNormalizedTimeToFadeIn = 0.05f; - this.OpacityNormalizedTimeToFadeOut = 0.95f; - this.BrightnessLerper = 0.2f; - this.FinalOpacityMultiplier = 1f; - this.FramingSpeed = 4; - } - - public override void UpdateVelocity(int frameCount) => this.Velocity = new Vector2((float) ((6.0 + (double) Math.Abs(Main.WindForVisuals) * 1.60000002384186) * (this.Effects == SpriteEffects.FlipHorizontally ? -1.0 : 1.0)), 0.0f); - - public override void Update(int frameCount) - { - base.Update(frameCount); - if (!Main.IsItRaining && Main.dayTime && !Main.eclipse) - return; - this.StartFadingOut(frameCount); - } - } - - private class AirBalloonSkyEntity : AmbientSky.FadingSkyEntity - { - private const int RANDOM_TILE_SPAWN_RANGE = 100; - - public AirBalloonSkyEntity(Player player, FastRandom random) - { - VirtualCamera virtualCamera = new VirtualCamera(player); - int x = player.Center.ToTileCoordinates().X; - this.Effects = random.Next(2) == 0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - this.Position.X = (float) (((double) x + 100.0 * ((double) random.NextFloat() * 2.0 - 1.0)) * 16.0); - this.Position.Y = (float) (Main.worldSurface * 16.0 - (double) random.Next(50, 81) * 16.0); - this.Depth = (float) ((double) random.NextFloat() * 3.0 + 3.0); - this.Texture = Main.Assets.Request("Images/Backgrounds/Ambience/AirBalloons_" + (random.Next(2) == 0 ? "Large" : "Small"), (AssetRequestMode) 1); - this.Frame = new SpriteFrame((byte) 1, (byte) 5); - this.Frame.CurrentRow = (byte) random.Next(5); - this.LifeTime = random.Next(20, 51) * 60; - this.OpacityNormalizedTimeToFadeIn = 0.05f; - this.OpacityNormalizedTimeToFadeOut = 0.95f; - this.BrightnessLerper = 0.2f; - this.FinalOpacityMultiplier = 1f; - this.FramingSpeed = int.MaxValue; - } - - public override void UpdateVelocity(int frameCount) - { - float x = Main.WindForVisuals * 4f; - float num = (float) (3.0 + (double) Math.Abs(Main.WindForVisuals) * 1.0); - if ((double) this.Position.Y < Main.worldSurface * 12.0) - num *= 0.5f; - if ((double) this.Position.Y < Main.worldSurface * 8.0) - num *= 0.5f; - if ((double) this.Position.Y < Main.worldSurface * 4.0) - num *= 0.5f; - this.Velocity = new Vector2(x, -num); - } - - public override void Update(int frameCount) - { - base.Update(frameCount); - if (!Main.IsItRaining && Main.dayTime && !Main.eclipse) - return; - this.StartFadingOut(frameCount); - } - } - - private class CrimeraSkyEntity : AmbientSky.EOCSkyEntity - { - public CrimeraSkyEntity(Player player, FastRandom random) - : base(player, random) - { - int num = 3; - if ((double) this.Depth <= 6.0) - num = 2; - if ((double) this.Depth <= 5.0) - num = 1; - this.Texture = Main.Assets.Request("Images/Backgrounds/Ambience/Crimera" + (object) num, (AssetRequestMode) 1); - this.Frame = new SpriteFrame((byte) 1, (byte) 3); - } - - public override Color GetColor(Color backgroundColor) => base.GetColor(backgroundColor) * Main.bgAlphaFrontLayer[8]; - } - - private class EOSSkyEntity : AmbientSky.EOCSkyEntity - { - public EOSSkyEntity(Player player, FastRandom random) - : base(player, random) - { - int num = 3; - if ((double) this.Depth <= 6.0) - num = 2; - if ((double) this.Depth <= 5.0) - num = 1; - this.Texture = Main.Assets.Request("Images/Backgrounds/Ambience/EOS" + (object) num, (AssetRequestMode) 1); - this.Frame = new SpriteFrame((byte) 1, (byte) 4); - } - - public override Color GetColor(Color backgroundColor) => base.GetColor(backgroundColor) * Main.bgAlphaFrontLayer[1]; - } - - private class EOCSkyEntity : AmbientSky.FadingSkyEntity - { - private const int STATE_ZIGZAG = 1; - private const int STATE_GOOVERPLAYER = 2; - private int _state; - private int _direction; - private float _waviness; - - public EOCSkyEntity(Player player, FastRandom random) - { - VirtualCamera camera = new VirtualCamera(player); - this.Texture = Main.Assets.Request("Images/Backgrounds/Ambience/EOC", (AssetRequestMode) 1); - this.Frame = new SpriteFrame((byte) 1, (byte) 3); - this.Depth = (float) ((double) random.NextFloat() * 3.0 + 4.5); - if (random.Next(4) != 0) - this.BeginZigZag(ref random, camera, random.Next(2) == 1 ? 1 : -1); - else - this.BeginChasingPlayer(ref random, camera); - this.SetPositionInWorldBasedOnScreenSpace(this.Position); - this.OpacityNormalizedTimeToFadeIn = 0.1f; - this.OpacityNormalizedTimeToFadeOut = 0.9f; - this.BrightnessLerper = 0.2f; - this.FinalOpacityMultiplier = 1f; - this.FramingSpeed = 5; - } - - private void BeginZigZag(ref FastRandom random, VirtualCamera camera, int direction) - { - this._state = 1; - this.LifeTime = random.Next(18, 31) * 60; - this._direction = direction; - this._waviness = (float) ((double) random.NextFloat() * 1.0 + 1.0); - this.Position.Y = camera.Position.Y; - int num = 100; - if (this._direction == 1) - this.Position.X = camera.Position.X - (float) num; - else - this.Position.X = camera.Position.X + camera.Size.X + (float) num; - } - - private void BeginChasingPlayer(ref FastRandom random, VirtualCamera camera) - { - this._state = 2; - this.LifeTime = random.Next(18, 31) * 60; - this.Position = camera.Position + camera.Size * new Vector2(random.NextFloat(), random.NextFloat()); - } - - public override void UpdateVelocity(int frameCount) - { - switch (this._state) - { - case 1: - this.ZigzagMove(frameCount); - break; - case 2: - this.ChasePlayerTop(frameCount); - break; - } - this.Rotation = this.Velocity.ToRotation(); - } - - private void ZigzagMove(int frameCount) => this.Velocity = new Vector2((float) (this._direction * 3), (float) Math.Cos((double) frameCount / 1200.0 * 6.28318548202515) * this._waviness); - - private void ChasePlayerTop(int frameCount) - { - Vector2 vector2 = Main.LocalPlayer.Center + new Vector2(0.0f, -500f) - this.Position; - if ((double) vector2.Length() < 100.0) - return; - this.Velocity.X += 0.1f * (float) Math.Sign(vector2.X); - this.Velocity.Y += 0.1f * (float) Math.Sign(vector2.Y); - this.Velocity = Vector2.Clamp(this.Velocity, new Vector2(-18f), new Vector2(18f)); - } - } - - private class MeteorSkyEntity : AmbientSky.FadingSkyEntity - { - public MeteorSkyEntity(Player player, FastRandom random) - { - VirtualCamera virtualCamera = new VirtualCamera(player); - this.Effects = random.Next(2) == 0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - this.Depth = (float) ((double) random.NextFloat() * 3.0 + 3.0); - this.Texture = Main.Assets.Request("Images/Backgrounds/Ambience/Meteor", (AssetRequestMode) 1); - this.Frame = new SpriteFrame((byte) 1, (byte) 4); - Vector2 rotationVector2 = ((float) (0.785398185253143 + (double) random.NextFloat() * 1.57079637050629)).ToRotationVector2(); - double num1 = (Main.worldSurface * 16.0 - 0.0) / (double) rotationVector2.Y; - float num2 = 1200f; - double num3 = (double) num2; - float num4 = (float) (num1 / num3); - this.Velocity = rotationVector2 * num4; - int num5 = 100; - this.Position = player.Center + new Vector2((float) random.Next(-num5, num5 + 1), (float) random.Next(-num5, num5 + 1)) - this.Velocity * num2 * 0.5f; - this.LifeTime = (int) num2; - this.OpacityNormalizedTimeToFadeIn = 0.05f; - this.OpacityNormalizedTimeToFadeOut = 0.95f; - this.BrightnessLerper = 0.5f; - this.FinalOpacityMultiplier = 1f; - this.FramingSpeed = 5; - this.Rotation = this.Velocity.ToRotation() + 1.570796f; - } - } - - private delegate AmbientSky.SkyEntity EntityFactoryMethod(Player player, int seed); - } -} diff --git a/GameContent/Skies/BlizzardSky.cs b/GameContent/Skies/BlizzardSky.cs index 3f3e2f3..1fa5158 100644 --- a/GameContent/Skies/BlizzardSky.cs +++ b/GameContent/Skies/BlizzardSky.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Skies.BlizzardSky -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -49,17 +49,17 @@ namespace Terraria.GameContent.Skies if ((double) minDepth >= 1.0 && (double) maxDepth != 3.40282346638529E+38) return; float num = Math.Min(1f, Main.cloudAlpha * 2f); - Color color = new Color(new Vector4(1f) * Main.ColorOfTheSkies.ToVector4()) * this._opacity * 0.7f * num; - spriteBatch.Draw(TextureAssets.MagicPixel.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), color); + Color color = new Color(new Vector4(1f) * Main.bgColor.ToVector4()) * this._opacity * 0.7f * num; + spriteBatch.Draw(Main.magicPixel, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), color); } - public override void Activate(Vector2 position, params object[] args) + internal override void Activate(Vector2 position, params object[] args) { this._isActive = true; this._isLeaving = false; } - public override void Deactivate(params object[] args) => this._isLeaving = true; + internal override void Deactivate(params object[] args) => this._isLeaving = true; public override void Reset() { diff --git a/GameContent/Skies/CreditsRoll/Actions.cs b/GameContent/Skies/CreditsRoll/Actions.cs deleted file mode 100644 index 6894d41..0000000 --- a/GameContent/Skies/CreditsRoll/Actions.cs +++ /dev/null @@ -1,241 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Skies.CreditsRoll.Actions -// 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.Skies.CreditsRoll -{ - public class Actions - { - public class NPCs - { - public interface INPCAction : ICreditsRollSegmentAction - { - } - - public class Fade : Actions.NPCs.INPCAction, ICreditsRollSegmentAction - { - private int _duration; - private int _alphaPerFrame; - private float _delay; - - public Fade(int alphaPerFrame) - { - this._duration = 0; - this._alphaPerFrame = alphaPerFrame; - } - - public Fade(int alphaPerFrame, int duration) - { - this._duration = duration; - this._alphaPerFrame = alphaPerFrame; - } - - public void BindTo(NPC obj) - { - } - - public int ExpectedLengthOfActionInFrames => this._duration; - - public void SetDelay(float delay) => this._delay = delay; - - public void ApplyTo(NPC obj, float localTimeForObj) - { - if ((double) localTimeForObj < (double) this._delay) - return; - if (this._duration == 0) - { - obj.alpha = Utils.Clamp(obj.alpha + this._alphaPerFrame, 0, (int) byte.MaxValue); - } - else - { - float num = localTimeForObj - this._delay; - if ((double) num > (double) this._duration) - num = (float) this._duration; - obj.alpha = Utils.Clamp(obj.alpha + (int) num * this._alphaPerFrame, 0, (int) byte.MaxValue); - } - } - } - - public class Move : Actions.NPCs.INPCAction, ICreditsRollSegmentAction - { - private Vector2 _offsetPerFrame; - private int _duration; - private float _delay; - - public Move(Vector2 offsetPerFrame, int durationInFrames) - { - this._offsetPerFrame = offsetPerFrame; - this._duration = durationInFrames; - } - - public void BindTo(NPC obj) - { - } - - public int ExpectedLengthOfActionInFrames => this._duration; - - public void SetDelay(float delay) => this._delay = delay; - - public void ApplyTo(NPC obj, float localTimeForObj) - { - if ((double) localTimeForObj < (double) this._delay) - return; - float num = localTimeForObj - this._delay; - if ((double) num > (double) this._duration) - num = (float) this._duration; - NPC npc = obj; - npc.position = npc.position + this._offsetPerFrame * num; - obj.velocity = this._offsetPerFrame; - if ((double) this._offsetPerFrame.X == 0.0) - return; - obj.direction = obj.spriteDirection = (double) this._offsetPerFrame.X > 0.0 ? 1 : -1; - } - } - - public class Wait : Actions.NPCs.INPCAction, ICreditsRollSegmentAction - { - private int _duration; - private float _delay; - - public Wait(int durationInFrames) => this._duration = durationInFrames; - - public void BindTo(NPC obj) - { - } - - public int ExpectedLengthOfActionInFrames => this._duration; - - public void ApplyTo(NPC obj, float localTimeForObj) - { - if ((double) localTimeForObj < (double) this._delay) - return; - obj.velocity = Vector2.Zero; - } - - public void SetDelay(float delay) => this._delay = delay; - } - - public class LookAt : Actions.NPCs.INPCAction, ICreditsRollSegmentAction - { - private int _direction; - private float _delay; - - public LookAt(int direction) => this._direction = direction; - - public void BindTo(NPC obj) - { - } - - public int ExpectedLengthOfActionInFrames => 0; - - public void ApplyTo(NPC obj, float localTimeForObj) - { - if ((double) localTimeForObj < (double) this._delay) - return; - obj.direction = obj.spriteDirection = this._direction; - } - - public void SetDelay(float delay) => this._delay = delay; - } - - public class PartyHard : Actions.NPCs.INPCAction, ICreditsRollSegmentAction - { - public void BindTo(NPC obj) - { - obj.ForcePartyHatOn = true; - obj.UpdateAltTexture(); - } - - public int ExpectedLengthOfActionInFrames => 0; - - public void ApplyTo(NPC obj, float localTimeForObj) - { - } - - public void SetDelay(float delay) - { - } - } - } - - public class Sprites - { - public interface ISpriteAction : ICreditsRollSegmentAction - { - } - - public class Fade : - Actions.Sprites.ISpriteAction, - ICreditsRollSegmentAction - { - private int _duration; - private float _opacityTarget; - private float _delay; - - public Fade(float opacityTarget) - { - this._duration = 0; - this._opacityTarget = opacityTarget; - } - - public Fade(float opacityTarget, int duration) - { - this._duration = duration; - this._opacityTarget = opacityTarget; - } - - public void BindTo(Segments.LooseSprite obj) - { - } - - public int ExpectedLengthOfActionInFrames => this._duration; - - public void SetDelay(float delay) => this._delay = delay; - - public void ApplyTo(Segments.LooseSprite obj, float localTimeForObj) - { - if ((double) localTimeForObj < (double) this._delay) - return; - if (this._duration == 0) - { - obj.CurrentOpacity = this._opacityTarget; - } - else - { - float t = localTimeForObj - this._delay; - if ((double) t > (double) this._duration) - t = (float) this._duration; - obj.CurrentOpacity = MathHelper.Lerp(obj.CurrentOpacity, this._opacityTarget, Utils.GetLerpValue(0.0f, (float) this._duration, t, true)); - } - } - } - - public class Wait : - Actions.Sprites.ISpriteAction, - ICreditsRollSegmentAction - { - private int _duration; - private float _delay; - - public Wait(int durationInFrames) => this._duration = durationInFrames; - - public void BindTo(Segments.LooseSprite obj) - { - } - - public int ExpectedLengthOfActionInFrames => this._duration; - - public void ApplyTo(Segments.LooseSprite obj, float localTimeForObj) - { - double delay = (double) this._delay; - } - - public void SetDelay(float delay) => this._delay = delay; - } - } - } -} diff --git a/GameContent/Skies/CreditsRoll/CreditsRollInfo.cs b/GameContent/Skies/CreditsRoll/CreditsRollInfo.cs deleted file mode 100644 index 2c74049..0000000 --- a/GameContent/Skies/CreditsRoll/CreditsRollInfo.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Skies.CreditsRoll.CreditsRollInfo -// 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; -using Microsoft.Xna.Framework.Graphics; - -namespace Terraria.GameContent.Skies.CreditsRoll -{ - public struct CreditsRollInfo - { - public SpriteBatch SpriteBatch; - public Vector2 AnchorPositionOnScreen; - public int TimeInAnimation; - } -} diff --git a/GameContent/Skies/CreditsRoll/ICreditsRollSegment.cs b/GameContent/Skies/CreditsRoll/ICreditsRollSegment.cs deleted file mode 100644 index c2ae5f2..0000000 --- a/GameContent/Skies/CreditsRoll/ICreditsRollSegment.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Skies.CreditsRoll.ICreditsRollSegment -// 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.Skies.CreditsRoll -{ - public interface ICreditsRollSegment - { - float DedicatedTimeNeeded { get; } - - void Draw(ref CreditsRollInfo info); - } -} diff --git a/GameContent/Skies/CreditsRoll/ICreditsRollSegmentAction`1.cs b/GameContent/Skies/CreditsRoll/ICreditsRollSegmentAction`1.cs deleted file mode 100644 index f9d82ed..0000000 --- a/GameContent/Skies/CreditsRoll/ICreditsRollSegmentAction`1.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Skies.CreditsRoll.ICreditsRollSegmentAction`1 -// 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.Skies.CreditsRoll -{ - public interface ICreditsRollSegmentAction - { - void BindTo(T obj); - - int ExpectedLengthOfActionInFrames { get; } - - void ApplyTo(T obj, float localTimeForObj); - - void SetDelay(float delay); - } -} diff --git a/GameContent/Skies/CreditsRoll/Segments.cs b/GameContent/Skies/CreditsRoll/Segments.cs deleted file mode 100644 index 49c1420..0000000 --- a/GameContent/Skies/CreditsRoll/Segments.cs +++ /dev/null @@ -1,256 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Skies.CreditsRoll.Segments -// 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; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using Terraria.DataStructures; -using Terraria.Localization; -using Terraria.UI.Chat; - -namespace Terraria.GameContent.Skies.CreditsRoll -{ - public class Segments - { - private const float PixelsToRollUpPerFrame = 0.5f; - - public class LocalizedTextSegment : ICreditsRollSegment - { - private const int PixelsForALine = 120; - private LocalizedText _text; - private float _timeToShowPeak; - - public float DedicatedTimeNeeded => 240f; - - public LocalizedTextSegment(float timeInAnimation, string textKey) - { - this._text = Language.GetText(textKey); - this._timeToShowPeak = timeInAnimation; - } - - public void Draw(ref CreditsRollInfo info) - { - float num1 = 400f; - float num2 = 400f; - int timeInAnimation = info.TimeInAnimation; - float num3 = Utils.GetLerpValue(this._timeToShowPeak - num1, this._timeToShowPeak, (float) timeInAnimation, true) * Utils.GetLerpValue(this._timeToShowPeak + num2, this._timeToShowPeak, (float) timeInAnimation, true); - if ((double) num3 <= 0.0) - return; - float num4 = this._timeToShowPeak - (float) timeInAnimation; - Vector2 position = info.AnchorPositionOnScreen + new Vector2(0.0f, num4 * 0.5f); - float Hue = (float) ((double) this._timeToShowPeak / 100.0 % 1.0); - if ((double) Hue < 0.0) - ++Hue; - Color rgb = Main.hslToRgb(Hue, 1f, 0.5f); - string text = this._text.Value; - Vector2 origin = FontAssets.DeathText.Value.MeasureString(text) * 0.5f; - float num5 = (float) (1.0 - (1.0 - (double) num3) * (1.0 - (double) num3)); - ChatManager.DrawColorCodedStringShadow(info.SpriteBatch, FontAssets.DeathText.Value, text, position, rgb * num5 * num5 * 0.25f, 0.0f, origin, Vector2.One); - ChatManager.DrawColorCodedString(info.SpriteBatch, FontAssets.DeathText.Value, text, position, Color.White * num5, 0.0f, origin, Vector2.One); - } - } - - public abstract class ACreditsRollSegmentWithActions : ICreditsRollSegment - { - private int _dedicatedTimeNeeded; - private int _lastDedicatedTimeNeeded; - protected int _targetTime; - private List> _actions = new List>(); - - public float DedicatedTimeNeeded => (float) this._dedicatedTimeNeeded; - - public ACreditsRollSegmentWithActions(int targetTime) - { - this._targetTime = targetTime; - this._dedicatedTimeNeeded = 0; - } - - protected void ProcessActions(T obj, float localTimeForObject) - { - for (int index = 0; index < this._actions.Count; ++index) - this._actions[index].ApplyTo(obj, localTimeForObject); - } - - public Segments.ACreditsRollSegmentWithActions Then( - ICreditsRollSegmentAction act) - { - this.Bind(act); - act.SetDelay((float) this._dedicatedTimeNeeded); - this._actions.Add(act); - this._lastDedicatedTimeNeeded = this._dedicatedTimeNeeded; - this._dedicatedTimeNeeded += act.ExpectedLengthOfActionInFrames; - return this; - } - - public Segments.ACreditsRollSegmentWithActions With( - ICreditsRollSegmentAction act) - { - this.Bind(act); - act.SetDelay((float) this._lastDedicatedTimeNeeded); - this._actions.Add(act); - return this; - } - - protected abstract void Bind(ICreditsRollSegmentAction act); - - public abstract void Draw(ref CreditsRollInfo info); - } - - public class NPCSegment : Segments.ACreditsRollSegmentWithActions - { - private NPC _npc; - private Vector2 _anchorOffset; - private Vector2 _normalizedOriginForHitbox; - - public NPCSegment( - int targetTime, - int npcId, - Vector2 anchorOffset, - Vector2 normalizedNPCHitboxOrigin) - : base(targetTime) - { - this._npc = new NPC(); - this._npc.SetDefaults(npcId); - this._npc.IsABestiaryIconDummy = true; - this._anchorOffset = anchorOffset; - this._normalizedOriginForHitbox = normalizedNPCHitboxOrigin; - } - - protected override void Bind(ICreditsRollSegmentAction act) => act.BindTo(this._npc); - - public override void Draw(ref CreditsRollInfo info) - { - if ((double) info.TimeInAnimation > (double) this._targetTime + (double) this.DedicatedTimeNeeded) - return; - this.ResetNPCAnimation(ref info); - this.ProcessActions(this._npc, (float) (info.TimeInAnimation - this._targetTime)); - if (this._npc.alpha >= (int) byte.MaxValue) - return; - this._npc.FindFrame(); - Main.instance.DrawNPCDirect(info.SpriteBatch, this._npc, this._npc.behindTiles, Vector2.Zero); - } - - private void ResetNPCAnimation(ref CreditsRollInfo info) - { - this._npc.position = info.AnchorPositionOnScreen + this._anchorOffset - this._npc.Size * this._normalizedOriginForHitbox; - this._npc.alpha = 0; - this._npc.velocity = Vector2.Zero; - } - } - - public class LooseSprite - { - private DrawData _originalDrawData; - public DrawData CurrentDrawData; - public float CurrentOpacity; - - public LooseSprite(DrawData data) - { - this._originalDrawData = data; - this.Reset(); - } - - public void Reset() - { - this.CurrentDrawData = this._originalDrawData; - this.CurrentOpacity = 1f; - } - } - - public class SpriteSegment : Segments.ACreditsRollSegmentWithActions - { - private Segments.LooseSprite _sprite; - private Vector2 _anchorOffset; - - public SpriteSegment(int targetTime, DrawData data, Vector2 anchorOffset) - : base(targetTime) - { - this._sprite = new Segments.LooseSprite(data); - this._anchorOffset = anchorOffset; - } - - protected override void Bind( - ICreditsRollSegmentAction act) - { - act.BindTo(this._sprite); - } - - public override void Draw(ref CreditsRollInfo info) - { - if ((double) info.TimeInAnimation > (double) this._targetTime + (double) this.DedicatedTimeNeeded) - return; - this.ResetSpriteAnimation(ref info); - this.ProcessActions(this._sprite, (float) (info.TimeInAnimation - this._targetTime)); - DrawData currentDrawData = this._sprite.CurrentDrawData; - currentDrawData.position += info.AnchorPositionOnScreen; - currentDrawData.color *= this._sprite.CurrentOpacity; - currentDrawData.Draw(info.SpriteBatch); - } - - private void ResetSpriteAnimation(ref CreditsRollInfo info) => this._sprite.Reset(); - } - - public class EmoteSegment : ICreditsRollSegment - { - private int _targetTime; - private Vector2 _offset; - private SpriteEffects _effect; - private int _emoteId; - - public float DedicatedTimeNeeded { get; private set; } - - public EmoteSegment( - int emoteId, - int targetTime, - int timeToPlay, - Vector2 position, - SpriteEffects drawEffect) - { - this._emoteId = emoteId; - this._targetTime = targetTime; - this._effect = drawEffect; - this._offset = position; - this.DedicatedTimeNeeded = (float) timeToPlay; - } - - public void Draw(ref CreditsRollInfo info) - { - int num = info.TimeInAnimation - this._targetTime; - if (num < 0 || (double) num >= (double) this.DedicatedTimeNeeded) - return; - Vector2 position = (info.AnchorPositionOnScreen + this._offset).Floor(); - bool flag = num < 6 || (double) num >= (double) this.DedicatedTimeNeeded - 6.0; - Texture2D texture2D = TextureAssets.Extra[48].Value; - Rectangle rectangle = texture2D.Frame(8, 38, flag ? 0 : 1); - Vector2 origin = new Vector2((float) (rectangle.Width / 2), (float) rectangle.Height); - SpriteEffects effect = this._effect; - info.SpriteBatch.Draw(texture2D, position, new Rectangle?(rectangle), Color.White, 0.0f, origin, 1f, effect, 0.0f); - if (flag) - return; - switch (this._emoteId) - { - case 87: - case 89: - if (effect.HasFlag((Enum) SpriteEffects.FlipHorizontally)) - { - effect &= ~SpriteEffects.FlipHorizontally; - position.X += 4f; - break; - } - break; - } - info.SpriteBatch.Draw(texture2D, position, new Rectangle?(this.GetFrame(num % 20)), Color.White, 0.0f, origin, 1f, effect, 0.0f); - } - - private Rectangle GetFrame(int wrappedTime) - { - int num = wrappedTime >= 10 ? 1 : 0; - return TextureAssets.Extra[48].Value.Frame(8, 38, this._emoteId % 4 * 2 + num, this._emoteId / 4 + 1); - } - } - } -} diff --git a/GameContent/Skies/CreditsRollSky.cs b/GameContent/Skies/CreditsRollSky.cs deleted file mode 100644 index 8e9b3c8..0000000 --- a/GameContent/Skies/CreditsRollSky.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Skies.CreditsRollSky -// 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; -using Microsoft.Xna.Framework.Graphics; -using System.Collections.Generic; -using Terraria.DataStructures; -using Terraria.GameContent.Skies.CreditsRoll; -using Terraria.Graphics.Effects; - -namespace Terraria.GameContent.Skies -{ - public class CreditsRollSky : CustomSky - { - private int _endTime; - private int _currentTime; - private List _segments; - - public void EnsureSegmentsAreMade() - { - this._segments = new List(); - new string[1][0] = "Now, this is a story all about how"; - Segments.ACreditsRollSegmentWithActions segmentWithActions1 = new Segments.NPCSegment(0, 22, new Vector2(-300f, 0.0f), new Vector2(0.5f, 1f)).Then((ICreditsRollSegmentAction) new Actions.NPCs.Fade((int) byte.MaxValue)).With((ICreditsRollSegmentAction) new Actions.NPCs.Fade(-5, 51)).Then((ICreditsRollSegmentAction) new Actions.NPCs.Move(new Vector2(1f, 0.0f), 60)); - Segments.ACreditsRollSegmentWithActions segmentWithActions2 = new Segments.SpriteSegment(0, new DrawData(TextureAssets.Extra[156].Value, Vector2.Zero, new Rectangle?(), Color.White, 0.0f, TextureAssets.Extra[156].Size() / 2f, 0.25f, SpriteEffects.None, 0), new Vector2(-100f, 0.0f)).Then((ICreditsRollSegmentAction) new Actions.Sprites.Fade(0.0f, 0)).Then((ICreditsRollSegmentAction) new Actions.Sprites.Fade(1f, 60)).Then((ICreditsRollSegmentAction) new Actions.Sprites.Wait(60)).Then((ICreditsRollSegmentAction) new Actions.Sprites.Fade(0.0f, 60)); - int num = 60; - Segments.EmoteSegment emoteSegment = new Segments.EmoteSegment(3, (int) segmentWithActions1.DedicatedTimeNeeded, num, new Vector2(-254f, -38f), SpriteEffects.FlipHorizontally); - segmentWithActions1.Then((ICreditsRollSegmentAction) new Actions.NPCs.Wait(num)).Then((ICreditsRollSegmentAction) new Actions.NPCs.Wait(60)).With((ICreditsRollSegmentAction) new Actions.NPCs.Fade(5, 51)); - this._segments.Add((ICreditsRollSegment) segmentWithActions1); - this._segments.Add((ICreditsRollSegment) emoteSegment); - this._segments.Add((ICreditsRollSegment) segmentWithActions2); - foreach (ICreditsRollSegment segment in this._segments) - this._endTime += (int) segment.DedicatedTimeNeeded; - this._endTime += 300; - } - - public override void Update(GameTime gameTime) - { - ++this._currentTime; - int num = 0; - foreach (ICreditsRollSegment segment in this._segments) - num += (int) segment.DedicatedTimeNeeded; - if (this._currentTime < num + 1) - return; - this._currentTime = 0; - } - - public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth) - { - float num = 4.5f; - if ((double) num < (double) minDepth || (double) num > (double) maxDepth) - return; - CreditsRollInfo info = new CreditsRollInfo() - { - SpriteBatch = spriteBatch, - AnchorPositionOnScreen = Main.ScreenSize.ToVector2() / 2f, - TimeInAnimation = this._currentTime - }; - for (int index = 0; index < this._segments.Count; ++index) - this._segments[index].Draw(ref info); - } - - public override bool IsActive() => this._currentTime < this._endTime; - - public override void Reset() - { - this._currentTime = 0; - this.EnsureSegmentsAreMade(); - } - - public override void Activate(Vector2 position, params object[] args) - { - this._currentTime = 0; - this.EnsureSegmentsAreMade(); - } - - public override void Deactivate(params object[] args) => this._currentTime = 0; - } -} diff --git a/GameContent/Skies/LanternSky.cs b/GameContent/Skies/LanternSky.cs deleted file mode 100644 index c4ae315..0000000 --- a/GameContent/Skies/LanternSky.cs +++ /dev/null @@ -1,230 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Skies.LanternSky -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using System; -using Terraria.GameContent.Events; -using Terraria.Graphics.Effects; -using Terraria.Utilities; - -namespace Terraria.GameContent.Skies -{ - public class LanternSky : CustomSky - { - private bool _active; - private bool _leaving; - private float _opacity; - private Asset _texture; - private LanternSky.Lantern[] _lanterns; - private UnifiedRandom _random = new UnifiedRandom(); - private int _lanternsDrawing; - private const float slowDown = 0.5f; - - public override void OnLoad() - { - this._texture = TextureAssets.Extra[134]; - this.GenerateLanterns(false); - } - - private void GenerateLanterns(bool onlyMissing) - { - if (!onlyMissing) - this._lanterns = new LanternSky.Lantern[Main.maxTilesY / 4]; - for (int i = 0; i < this._lanterns.Length; ++i) - { - if (!onlyMissing || !this._lanterns[i].Active) - { - int maxValue = (int) ((double) Main.screenPosition.Y * 0.7 - (double) Main.screenHeight); - int minValue = (int) ((double) maxValue - Main.worldSurface * 16.0); - this._lanterns[i].Position = new Vector2((float) (this._random.Next(0, Main.maxTilesX) * 16), (float) this._random.Next(minValue, maxValue)); - this.ResetLantern(i); - this._lanterns[i].Active = true; - } - } - this._lanternsDrawing = this._lanterns.Length; - } - - public void ResetLantern(int i) - { - this._lanterns[i].Depth = (float) ((1.0 - (double) i / (double) this._lanterns.Length) * 4.40000009536743 + 1.60000002384186); - this._lanterns[i].Speed = (float) (-1.5 - 2.5 * this._random.NextDouble()); - this._lanterns[i].Texture = this._texture.Value; - this._lanterns[i].Variant = this._random.Next(3); - this._lanterns[i].TimeUntilFloat = (int) ((double) (2000 + this._random.Next(1200)) * 2.0); - this._lanterns[i].TimeUntilFloatMax = this._lanterns[i].TimeUntilFloat; - } - - public override void Update(GameTime gameTime) - { - if (Main.gamePaused || !Main.hasFocus) - return; - this._opacity = Utils.Clamp(this._opacity + (float) LanternNight.LanternsUp.ToDirectionInt() * 0.01f, 0.0f, 1f); - for (int i = 0; i < this._lanterns.Length; ++i) - { - if (this._lanterns[i].Active) - { - float num1 = Main.windSpeedCurrent; - if ((double) num1 == 0.0) - num1 = 0.1f; - float num2 = (float) Math.Sin((double) this._lanterns[i].Position.X / 120.0) * 0.5f; - this._lanterns[i].Position.Y += num2 * 0.5f; - this._lanterns[i].Position.Y += this._lanterns[i].FloatAdjustedSpeed * 0.5f; - this._lanterns[i].Position.X += (float) ((0.100000001490116 + (double) num1) * (3.0 - (double) this._lanterns[i].Speed) * 0.5 * ((double) i / (double) this._lanterns.Length + 1.5) / 2.5); - this._lanterns[i].Rotation = (float) ((double) num2 * ((double) num1 < 0.0 ? -1.0 : 1.0) * 0.5); - this._lanterns[i].TimeUntilFloat = Math.Max(0, this._lanterns[i].TimeUntilFloat - 1); - if ((double) this._lanterns[i].Position.Y < 300.0) - { - if (!this._leaving) - { - this.ResetLantern(i); - this._lanterns[i].Position = new Vector2((float) (this._random.Next(0, Main.maxTilesX) * 16), (float) (Main.worldSurface * 16.0 + 1600.0)); - } - else - { - this._lanterns[i].Active = false; - --this._lanternsDrawing; - } - } - } - } - this._active = true; - } - - public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth) - { - if (Main.gameMenu && this._active) - { - this._active = false; - this._leaving = false; - for (int index = 0; index < this._lanterns.Length; ++index) - this._lanterns[index].Active = false; - } - if ((double) Main.screenPosition.Y > Main.worldSurface * 16.0 || Main.gameMenu || (double) this._opacity <= 0.0) - return; - int num1 = -1; - int num2 = 0; - for (int index = 0; index < this._lanterns.Length; ++index) - { - float depth = this._lanterns[index].Depth; - if (num1 == -1 && (double) depth < (double) maxDepth) - num1 = index; - if ((double) depth > (double) minDepth) - num2 = index; - else - break; - } - if (num1 == -1) - return; - Vector2 vector2 = Main.screenPosition + new Vector2((float) (Main.screenWidth >> 1), (float) (Main.screenHeight >> 1)); - Rectangle rectangle = new Rectangle(-1000, -1000, 4000, 4000); - for (int index = num1; index < num2; ++index) - { - if (this._lanterns[index].Active) - { - Color opacity = new Color(250, 120, 60, 120); - float alpha = 1f; - if ((double) this._lanterns[index].Depth > 5.0) - alpha = 0.3f; - else if ((double) this._lanterns[index].Depth > 4.5) - alpha = 0.4f; - else if ((double) this._lanterns[index].Depth > 4.0) - alpha = 0.5f; - else if ((double) this._lanterns[index].Depth > 3.5) - alpha = 0.6f; - else if ((double) this._lanterns[index].Depth > 3.0) - alpha = 0.7f; - else if ((double) this._lanterns[index].Depth > 2.5) - alpha = 0.8f; - else if ((double) this._lanterns[index].Depth > 2.0) - alpha = 0.9f; - opacity = new Color((int) ((double) opacity.R * (double) alpha), (int) ((double) opacity.G * (double) alpha), (int) ((double) opacity.B * (double) alpha), (int) ((double) opacity.A * (double) alpha)); - Vector2 depthScale = new Vector2(1f / this._lanterns[index].Depth, 0.9f / this._lanterns[index].Depth); - depthScale *= 1.2f; - Vector2 position = (this._lanterns[index].Position - vector2) * depthScale + vector2 - Main.screenPosition; - position.X = (float) (((double) position.X + 500.0) % 4000.0); - if ((double) position.X < 0.0) - position.X += 4000f; - position.X -= 500f; - if (rectangle.Contains((int) position.X, (int) position.Y)) - this.DrawLantern(spriteBatch, this._lanterns[index], opacity, depthScale, position, alpha); - } - } - } - - private void DrawLantern( - SpriteBatch spriteBatch, - LanternSky.Lantern lantern, - Color opacity, - Vector2 depthScale, - Vector2 position, - float alpha) - { - float y = ((float) ((double) Main.GlobalTimeWrappedHourly % 6.0 / 6.0 * 6.28318548202515)).ToRotationVector2().Y; - float num1 = (float) ((double) y * 0.200000002980232 + 0.800000011920929); - Color color = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * this._opacity * alpha * num1 * 0.4f; - for (float num2 = 0.0f; (double) num2 < 1.0; num2 += 0.3333333f) - { - Vector2 vector2 = new Vector2(0.0f, 2f).RotatedBy(6.28318548202515 * (double) num2 + (double) lantern.Rotation) * y; - spriteBatch.Draw(lantern.Texture, position + vector2, new Rectangle?(lantern.GetSourceRectangle()), color, lantern.Rotation, lantern.GetSourceRectangle().Size() / 2f, depthScale.X * 2f, SpriteEffects.None, 0.0f); - } - spriteBatch.Draw(lantern.Texture, position, new Rectangle?(lantern.GetSourceRectangle()), opacity * this._opacity, lantern.Rotation, lantern.GetSourceRectangle().Size() / 2f, depthScale.X * 2f, SpriteEffects.None, 0.0f); - } - - public override void Activate(Vector2 position, params object[] args) - { - if (this._active) - { - this._leaving = false; - this.GenerateLanterns(true); - } - else - { - this.GenerateLanterns(false); - this._active = true; - this._leaving = false; - } - } - - public override void Deactivate(params object[] args) => this._leaving = true; - - public override bool IsActive() => this._active; - - public override void Reset() => this._active = false; - - private struct Lantern - { - private const int MAX_FRAMES_X = 3; - public int Variant; - public int TimeUntilFloat; - public int TimeUntilFloatMax; - private Texture2D _texture; - public Vector2 Position; - public float Depth; - public float Rotation; - public int FrameHeight; - public int FrameWidth; - public float Speed; - public bool Active; - - public Texture2D Texture - { - get => this._texture; - set - { - this._texture = value; - this.FrameWidth = value.Width / 3; - this.FrameHeight = value.Height; - } - } - - public float FloatAdjustedSpeed => this.Speed * ((float) this.TimeUntilFloat / (float) this.TimeUntilFloatMax); - - public Rectangle GetSourceRectangle() => new Rectangle(this.FrameWidth * this.Variant, 0, this.FrameWidth, this.FrameHeight); - } - } -} diff --git a/GameContent/Skies/MartianSky.cs b/GameContent/Skies/MartianSky.cs index 1b12db4..4556b44 100644 --- a/GameContent/Skies/MartianSky.cs +++ b/GameContent/Skies/MartianSky.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Skies.MartianSky -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -74,7 +74,7 @@ namespace Terraria.GameContent.Skies } if (num1 == -1) return; - Color color = new Color(Main.ColorOfTheSkies.ToVector4() * 0.9f + new Vector4(0.1f)); + Color color = new Color(Main.bgColor.ToVector4() * 0.9f + new Vector4(0.1f)); Vector2 vector2_1 = Main.screenPosition + new Vector2((float) (Main.screenWidth >> 1), (float) (Main.screenHeight >> 1)); Rectangle rectangle = new Rectangle(-1000, -1000, 4000, 4000); for (int index = num1; index < num2; ++index) @@ -98,19 +98,19 @@ namespace Terraria.GameContent.Skies for (int index = 0; index < num1; ++index) { double num2 = (double) index / (double) num1; - this._ufos[index] = new MartianSky.Ufo(TextureAssets.Extra[5].Value, (float) (Main.rand.NextDouble() * 4.0 + 6.59999990463257)); - this._ufos[index].GlowTexture = TextureAssets.GlowMask[90].Value; + this._ufos[index] = new MartianSky.Ufo(Main.extraTexture[5], (float) (Main.rand.NextDouble() * 4.0 + 6.59999990463257)); + this._ufos[index].GlowTexture = Main.glowMaskTexture[90]; } for (int index = num1; index < this._ufos.Length; ++index) { double num3 = (double) (index - num1) / (double) (this._ufos.Length - num1); - this._ufos[index] = new MartianSky.Ufo(TextureAssets.Extra[6].Value, (float) (Main.rand.NextDouble() * 5.0 + 1.60000002384186)); + this._ufos[index] = new MartianSky.Ufo(Main.extraTexture[6], (float) (Main.rand.NextDouble() * 5.0 + 1.60000002384186)); this._ufos[index].Scale = 0.5f; - this._ufos[index].GlowTexture = TextureAssets.GlowMask[91].Value; + this._ufos[index].GlowTexture = Main.glowMaskTexture[91]; } } - public override void Activate(Vector2 position, params object[] args) + internal override void Activate(Vector2 position, params object[] args) { this._activeUfos = 0; this.GenerateUfos(); @@ -119,7 +119,7 @@ namespace Terraria.GameContent.Skies this._leaving = false; } - public override void Deactivate(params object[] args) => this._leaving = true; + internal override void Deactivate(params object[] args) => this._leaving = true; public override bool IsActive() => this._active; diff --git a/GameContent/Skies/MoonLordSky.cs b/GameContent/Skies/MoonLordSky.cs index df486ff..7e0117e 100644 --- a/GameContent/Skies/MoonLordSky.cs +++ b/GameContent/Skies/MoonLordSky.cs @@ -1,12 +1,11 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Skies.MoonLordSky -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria.Graphics.Effects; using Terraria.Utilities; @@ -17,10 +16,6 @@ namespace Terraria.GameContent.Skies private UnifiedRandom _random = new UnifiedRandom(); private bool _isActive; private int _moonLordIndex = -1; - private bool _forPlayer; - private float _fadeOpacity; - - public MoonLordSky(bool forPlayer) => this._forPlayer = forPlayer; public override void OnLoad() { @@ -28,18 +23,10 @@ namespace Terraria.GameContent.Skies public override void Update(GameTime gameTime) { - if (!this._forPlayer) - return; - if (this._isActive) - this._fadeOpacity = Math.Min(1f, 0.01f + this._fadeOpacity); - else - this._fadeOpacity = Math.Max(0.0f, this._fadeOpacity - 0.01f); } private float GetIntensity() { - if (this._forPlayer) - return this._fadeOpacity; if (!this.UpdateMoonLordIndex()) return 0.0f; float x = 0.0f; @@ -76,34 +63,17 @@ namespace Terraria.GameContent.Skies if ((double) maxDepth < 0.0 || (double) minDepth >= 0.0) return; float intensity = this.GetIntensity(); - spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.Black * intensity); + spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.Black * intensity); } - public override float GetCloudAlpha() => 1f - this._fadeOpacity; + public override float GetCloudAlpha() => 0.0f; - public override void Activate(Vector2 position, params object[] args) - { - this._isActive = true; - if (this._forPlayer) - this._fadeOpacity = 1f / 500f; - else - this._fadeOpacity = 1f; - } + internal override void Activate(Vector2 position, params object[] args) => this._isActive = true; - public override void Deactivate(params object[] args) - { - this._isActive = false; - if (this._forPlayer) - return; - this._fadeOpacity = 0.0f; - } + internal override void Deactivate(params object[] args) => this._isActive = false; - public override void Reset() - { - this._isActive = false; - this._fadeOpacity = 0.0f; - } + public override void Reset() => this._isActive = false; - public override bool IsActive() => this._isActive || (double) this._fadeOpacity > 1.0 / 1000.0; + public override bool IsActive() => this._isActive; } } diff --git a/GameContent/Skies/NebulaSky.cs b/GameContent/Skies/NebulaSky.cs index dd440bb..50fabef 100644 --- a/GameContent/Skies/NebulaSky.cs +++ b/GameContent/Skies/NebulaSky.cs @@ -1,13 +1,13 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Skies.NebulaSky -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using System; +using Terraria.Graphics; using Terraria.Graphics.Effects; using Terraria.Utilities; @@ -17,21 +17,21 @@ namespace Terraria.GameContent.Skies { private NebulaSky.LightPillar[] _pillars; private UnifiedRandom _random = new UnifiedRandom(); - private Asset _planetTexture; - private Asset _bgTexture; - private Asset _beamTexture; - private Asset[] _rockTextures; + private Texture2D _planetTexture; + private Texture2D _bgTexture; + private Texture2D _beamTexture; + private Texture2D[] _rockTextures; private bool _isActive; private float _fadeOpacity; public override void OnLoad() { - this._planetTexture = Main.Assets.Request("Images/Misc/NebulaSky/Planet", (AssetRequestMode) 1); - this._bgTexture = Main.Assets.Request("Images/Misc/NebulaSky/Background", (AssetRequestMode) 1); - this._beamTexture = Main.Assets.Request("Images/Misc/NebulaSky/Beam", (AssetRequestMode) 1); - this._rockTextures = new Asset[3]; + this._planetTexture = TextureManager.Load("Images/Misc/NebulaSky/Planet"); + this._bgTexture = TextureManager.Load("Images/Misc/NebulaSky/Background"); + this._beamTexture = TextureManager.Load("Images/Misc/NebulaSky/Beam"); + this._rockTextures = new Texture2D[3]; for (int index = 0; index < this._rockTextures.Length; ++index) - this._rockTextures[index] = Main.Assets.Request("Images/Misc/NebulaSky/Rock_" + (object) index, (AssetRequestMode) 1); + this._rockTextures[index] = TextureManager.Load("Images/Misc/NebulaSky/Rock_" + (object) index); } public override void Update(GameTime gameTime) @@ -48,11 +48,11 @@ namespace Terraria.GameContent.Skies { if ((double) maxDepth >= 3.40282346638529E+38 && (double) minDepth < 3.40282346638529E+38) { - spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.Black * this._fadeOpacity); - spriteBatch.Draw(this._bgTexture.Value, new Rectangle(0, Math.Max(0, (int) ((Main.worldSurface * 16.0 - (double) Main.screenPosition.Y - 2400.0) * 0.100000001490116)), Main.screenWidth, Main.screenHeight), Color.White * Math.Min(1f, (float) (((double) Main.screenPosition.Y - 800.0) / 1000.0) * this._fadeOpacity)); + spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.Black * this._fadeOpacity); + spriteBatch.Draw(this._bgTexture, new Rectangle(0, Math.Max(0, (int) ((Main.worldSurface * 16.0 - (double) Main.screenPosition.Y - 2400.0) * 0.100000001490116)), Main.screenWidth, Main.screenHeight), Color.White * Math.Min(1f, (float) (((double) Main.screenPosition.Y - 800.0) / 1000.0) * this._fadeOpacity)); Vector2 vector2_1 = new Vector2((float) (Main.screenWidth >> 1), (float) (Main.screenHeight >> 1)); Vector2 vector2_2 = 0.01f * (new Vector2((float) Main.maxTilesX * 8f, (float) Main.worldSurface / 2f) - Main.screenPosition); - spriteBatch.Draw(this._planetTexture.Value, vector2_1 + new Vector2(-200f, -200f) + vector2_2, new Rectangle?(), Color.White * 0.9f * this._fadeOpacity, 0.0f, new Vector2((float) (this._planetTexture.Width() >> 1), (float) (this._planetTexture.Height() >> 1)), 1f, SpriteEffects.None, 1f); + spriteBatch.Draw(this._planetTexture, vector2_1 + new Vector2(-200f, -200f) + vector2_2, new Rectangle?(), Color.White * 0.9f * this._fadeOpacity, 0.0f, new Vector2((float) (this._planetTexture.Width >> 1), (float) (this._planetTexture.Height >> 1)), 1f, SpriteEffects.None, 1f); } int num1 = -1; int num2 = 0; @@ -78,12 +78,12 @@ namespace Terraria.GameContent.Skies if (rectangle.Contains((int) position.X, (int) position.Y)) { float num4 = vector2_4.X * 450f; - spriteBatch.Draw(this._beamTexture.Value, position, new Rectangle?(), Color.White * 0.2f * num3 * this._fadeOpacity, 0.0f, Vector2.Zero, new Vector2(num4 / 70f, num4 / 45f), SpriteEffects.None, 0.0f); + spriteBatch.Draw(this._beamTexture, position, new Rectangle?(), Color.White * 0.2f * num3 * this._fadeOpacity, 0.0f, Vector2.Zero, new Vector2(num4 / 70f, num4 / 45f), SpriteEffects.None, 0.0f); int index2 = 0; for (float num5 = 0.0f; (double) num5 <= 1.0; num5 += 0.03f) { - float num6 = (float) (1.0 - ((double) num5 + (double) Main.GlobalTimeWrappedHourly * 0.0199999995529652 + Math.Sin((double) index1)) % 1.0); - spriteBatch.Draw(this._rockTextures[index2].Value, position + new Vector2((float) (Math.Sin((double) num5 * 1582.0) * ((double) num4 * 0.5) + (double) num4 * 0.5), num6 * 2000f), new Rectangle?(), Color.White * num6 * num3 * this._fadeOpacity, num6 * 20f, new Vector2((float) (this._rockTextures[index2].Width() >> 1), (float) (this._rockTextures[index2].Height() >> 1)), 0.9f, SpriteEffects.None, 0.0f); + float num6 = (float) (1.0 - ((double) num5 + (double) Main.GlobalTime * 0.0199999995529652 + Math.Sin((double) index1)) % 1.0); + spriteBatch.Draw(this._rockTextures[index2], position + new Vector2((float) (Math.Sin((double) num5 * 1582.0) * ((double) num4 * 0.5) + (double) num4 * 0.5), num6 * 2000f), new Rectangle?(), Color.White * num6 * num3 * this._fadeOpacity, num6 * 20f, new Vector2((float) (this._rockTextures[index2].Width >> 1), (float) (this._rockTextures[index2].Height >> 1)), 0.9f, SpriteEffects.None, 0.0f); index2 = (index2 + 1) % this._rockTextures.Length; } } @@ -92,7 +92,7 @@ namespace Terraria.GameContent.Skies public override float GetCloudAlpha() => (float) ((1.0 - (double) this._fadeOpacity) * 0.300000011920929 + 0.699999988079071); - public override void Activate(Vector2 position, params object[] args) + internal override void Activate(Vector2 position, params object[] args) { this._fadeOpacity = 1f / 500f; this._isActive = true; @@ -108,7 +108,7 @@ namespace Terraria.GameContent.Skies private int SortMethod(NebulaSky.LightPillar pillar1, NebulaSky.LightPillar pillar2) => pillar2.Depth.CompareTo(pillar1.Depth); - public override void Deactivate(params object[] args) => this._isActive = false; + internal override void Deactivate(params object[] args) => this._isActive = false; public override void Reset() => this._isActive = false; diff --git a/GameContent/Skies/PartySky.cs b/GameContent/Skies/PartySky.cs index 3af3a92..d58f8a0 100644 --- a/GameContent/Skies/PartySky.cs +++ b/GameContent/Skies/PartySky.cs @@ -1,12 +1,11 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Skies.PartySky -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using Terraria.Graphics.Effects; using Terraria.Utilities; @@ -18,16 +17,16 @@ namespace Terraria.GameContent.Skies private bool _active; private bool _leaving; private float _opacity; - private Asset[] _textures; + private Texture2D[] _textures; private PartySky.Balloon[] _balloons; private UnifiedRandom _random = new UnifiedRandom(); private int _balloonsDrawing; public override void OnLoad() { - this._textures = new Asset[3]; + this._textures = new Texture2D[3]; for (int index = 0; index < this._textures.Length; ++index) - this._textures[index] = TextureAssets.Extra[69 + index]; + this._textures[index] = Main.extraTexture[69 + index]; this.GenerateBalloons(false); } @@ -53,18 +52,18 @@ namespace Terraria.GameContent.Skies { this._balloons[i].Depth = (float) ((double) i / (double) this._balloons.Length * 1.75 + 1.60000002384186); this._balloons[i].Speed = (float) (-1.5 - 2.5 * this._random.NextDouble()); - this._balloons[i].Texture = this._textures[this._random.Next(2)].Value; + this._balloons[i].Texture = this._textures[this._random.Next(2)]; this._balloons[i].Variant = this._random.Next(3); if (this._random.Next(30) != 0) return; - this._balloons[i].Texture = this._textures[2].Value; + this._balloons[i].Texture = this._textures[2]; } - private bool IsNearParty() => (double) Main.player[Main.myPlayer].townNPCs > 0.0 || Main.SceneMetrics.PartyMonolithCount > 0; + private bool IsNearParty() => (double) Main.player[Main.myPlayer].townNPCs > 0.0 || Main.partyMonoliths > 0; public override void Update(GameTime gameTime) { - if (!PartySky.MultipleSkyWorkaroundFix && Main.dayRate == 0) + if (!PartySky.MultipleSkyWorkaroundFix) return; PartySky.MultipleSkyWorkaroundFix = false; if (Main.gamePaused || !Main.hasFocus) @@ -76,7 +75,7 @@ namespace Terraria.GameContent.Skies { ++this._balloons[i].Frame; this._balloons[i].Position.Y += this._balloons[i].Speed; - this._balloons[i].Position.X += Main.windSpeedCurrent * (3f - this._balloons[i].Speed); + this._balloons[i].Position.X += Main.windSpeed * (3f - this._balloons[i].Speed); if ((double) this._balloons[i].Position.Y < 300.0) { if (!this._leaving) @@ -84,7 +83,7 @@ namespace Terraria.GameContent.Skies this.ResetBalloon(i); this._balloons[i].Position = new Vector2((float) (this._random.Next(0, Main.maxTilesX) * 16), (float) (Main.worldSurface * 16.0 + 1600.0)); if (this._random.Next(30) == 0) - this._balloons[i].Texture = this._textures[2].Value; + this._balloons[i].Texture = this._textures[2]; } else { @@ -130,7 +129,7 @@ namespace Terraria.GameContent.Skies { if (this._balloons[index].Active) { - Color color = new Color(Main.ColorOfTheSkies.ToVector4() * 0.9f + new Vector4(0.1f)) * 0.8f; + Color color = new Color(Main.bgColor.ToVector4() * 0.9f + new Vector4(0.1f)) * 0.8f; float num3 = 1f; if ((double) this._balloons[index].Depth > 3.0) num3 = 0.6f; @@ -154,7 +153,7 @@ namespace Terraria.GameContent.Skies } } - public override void Activate(Vector2 position, params object[] args) + internal override void Activate(Vector2 position, params object[] args) { if (this._active) { @@ -169,7 +168,7 @@ namespace Terraria.GameContent.Skies } } - public override void Deactivate(params object[] args) => this._leaving = true; + internal override void Deactivate(params object[] args) => this._leaving = true; public override bool IsActive() => this._active; diff --git a/GameContent/Skies/SandstormSky.cs b/GameContent/Skies/SandstormSky.cs index bff8d24..033cd41 100644 --- a/GameContent/Skies/SandstormSky.cs +++ b/GameContent/Skies/SandstormSky.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Skies.SandstormSky -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -50,17 +50,17 @@ namespace Terraria.GameContent.Skies if ((double) minDepth >= 1.0 && (double) maxDepth != 3.40282346638529E+38) return; float num = Math.Min(1f, Sandstorm.Severity * 1.5f); - Color color = new Color(new Vector4(0.85f, 0.66f, 0.33f, 1f) * 0.8f * Main.ColorOfTheSkies.ToVector4()) * this._opacity * num; - spriteBatch.Draw(TextureAssets.MagicPixel.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), color); + Color color = new Color(new Vector4(0.85f, 0.66f, 0.33f, 1f) * 0.8f * Main.bgColor.ToVector4()) * this._opacity * num; + spriteBatch.Draw(Main.magicPixel, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), color); } - public override void Activate(Vector2 position, params object[] args) + internal override void Activate(Vector2 position, params object[] args) { this._isActive = true; this._isLeaving = false; } - public override void Deactivate(params object[] args) => this._isLeaving = true; + internal override void Deactivate(params object[] args) => this._isLeaving = true; public override void Reset() { diff --git a/GameContent/Skies/SlimeSky.cs b/GameContent/Skies/SlimeSky.cs index 8d3ebaf..3ce1aea 100644 --- a/GameContent/Skies/SlimeSky.cs +++ b/GameContent/Skies/SlimeSky.cs @@ -1,12 +1,12 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Skies.SlimeSky -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; +using Terraria.Graphics; using Terraria.Graphics.Effects; using Terraria.Utilities; @@ -14,7 +14,7 @@ namespace Terraria.GameContent.Skies { public class SlimeSky : CustomSky { - private Asset[] _textures; + private Texture2D[] _textures; private SlimeSky.Slime[] _slimes; private UnifiedRandom _random = new UnifiedRandom(); private int _slimesRemaining; @@ -23,9 +23,9 @@ namespace Terraria.GameContent.Skies public override void OnLoad() { - this._textures = new Asset[4]; + this._textures = new Texture2D[4]; for (int index = 0; index < 4; ++index) - this._textures[index] = Main.Assets.Request("Images/Misc/Sky_Slime_" + (object) (index + 1), (AssetRequestMode) 1); + this._textures[index] = TextureManager.Load("Images/Misc/Sky_Slime_" + (object) (index + 1)); this.GenerateSlimes(); } @@ -39,16 +39,16 @@ namespace Terraria.GameContent.Skies this._slimes[index].Position = new Vector2((float) (this._random.Next(0, Main.maxTilesX) * 16), (float) this._random.Next(minValue, maxValue)); this._slimes[index].Speed = (float) (5.0 + 3.0 * this._random.NextDouble()); this._slimes[index].Depth = (float) ((double) index / (double) this._slimes.Length * 1.75 + 1.60000002384186); - this._slimes[index].Texture = this._textures[this._random.Next(2)].Value; + this._slimes[index].Texture = this._textures[this._random.Next(2)]; if (this._random.Next(60) == 0) { - this._slimes[index].Texture = this._textures[3].Value; + this._slimes[index].Texture = this._textures[3]; this._slimes[index].Speed = (float) (6.0 + 3.0 * this._random.NextDouble()); this._slimes[index].Depth += 0.5f; } else if (this._random.Next(30) == 0) { - this._slimes[index].Texture = this._textures[2].Value; + this._slimes[index].Texture = this._textures[2]; this._slimes[index].Speed = (float) (6.0 + 2.0 * this._random.NextDouble()); } this._slimes[index].Active = true; @@ -72,17 +72,17 @@ namespace Terraria.GameContent.Skies { this._slimes[index].Depth = (float) ((double) index / (double) this._slimes.Length * 1.75 + 1.60000002384186); this._slimes[index].Position = new Vector2((float) (this._random.Next(0, Main.maxTilesX) * 16), -100f); - this._slimes[index].Texture = this._textures[this._random.Next(2)].Value; + this._slimes[index].Texture = this._textures[this._random.Next(2)]; this._slimes[index].Speed = (float) (5.0 + 3.0 * this._random.NextDouble()); if (this._random.Next(60) == 0) { - this._slimes[index].Texture = this._textures[3].Value; + this._slimes[index].Texture = this._textures[3]; this._slimes[index].Speed = (float) (6.0 + 3.0 * this._random.NextDouble()); this._slimes[index].Depth += 0.5f; } else if (this._random.Next(30) == 0) { - this._slimes[index].Texture = this._textures[2].Value; + this._slimes[index].Texture = this._textures[2]; this._slimes[index].Speed = (float) (6.0 + 2.0 * this._random.NextDouble()); } } @@ -123,7 +123,7 @@ namespace Terraria.GameContent.Skies { if (this._slimes[index].Active) { - Color color = new Color(Main.ColorOfTheSkies.ToVector4() * 0.9f + new Vector4(0.1f)) * 0.8f; + Color color = new Color(Main.bgColor.ToVector4() * 0.9f + new Vector4(0.1f)) * 0.8f; float num3 = 1f; if ((double) this._slimes[index].Depth > 3.0) num3 = 0.6f; @@ -147,14 +147,14 @@ namespace Terraria.GameContent.Skies } } - public override void Activate(Vector2 position, params object[] args) + internal override void Activate(Vector2 position, params object[] args) { this.GenerateSlimes(); this._isActive = true; this._isLeaving = false; } - public override void Deactivate(params object[] args) => this._isLeaving = true; + internal override void Deactivate(params object[] args) => this._isLeaving = true; public override void Reset() => this._isActive = false; diff --git a/GameContent/Skies/SolarSky.cs b/GameContent/Skies/SolarSky.cs index 0cbb292..c9ebc6d 100644 --- a/GameContent/Skies/SolarSky.cs +++ b/GameContent/Skies/SolarSky.cs @@ -1,13 +1,13 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Skies.SolarSky -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using System; +using Terraria.Graphics; using Terraria.Graphics.Effects; using Terraria.Utilities; @@ -16,18 +16,18 @@ namespace Terraria.GameContent.Skies public class SolarSky : CustomSky { private UnifiedRandom _random = new UnifiedRandom(); - private Asset _planetTexture; - private Asset _bgTexture; - private Asset _meteorTexture; + private Texture2D _planetTexture; + private Texture2D _bgTexture; + private Texture2D _meteorTexture; private bool _isActive; private SolarSky.Meteor[] _meteors; private float _fadeOpacity; public override void OnLoad() { - this._planetTexture = Main.Assets.Request("Images/Misc/SolarSky/Planet", (AssetRequestMode) 1); - this._bgTexture = Main.Assets.Request("Images/Misc/SolarSky/Background", (AssetRequestMode) 1); - this._meteorTexture = Main.Assets.Request("Images/Misc/SolarSky/Meteor", (AssetRequestMode) 1); + this._planetTexture = TextureManager.Load("Images/Misc/SolarSky/Planet"); + this._bgTexture = TextureManager.Load("Images/Misc/SolarSky/Background"); + this._meteorTexture = TextureManager.Load("Images/Misc/SolarSky/Meteor"); } public override void Update(GameTime gameTime) @@ -52,11 +52,11 @@ namespace Terraria.GameContent.Skies { if ((double) maxDepth >= 3.40282346638529E+38 && (double) minDepth < 3.40282346638529E+38) { - spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.Black * this._fadeOpacity); - spriteBatch.Draw(this._bgTexture.Value, new Rectangle(0, Math.Max(0, (int) ((Main.worldSurface * 16.0 - (double) Main.screenPosition.Y - 2400.0) * 0.100000001490116)), Main.screenWidth, Main.screenHeight), Color.White * Math.Min(1f, (float) (((double) Main.screenPosition.Y - 800.0) / 1000.0) * this._fadeOpacity)); + spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.Black * this._fadeOpacity); + spriteBatch.Draw(this._bgTexture, new Rectangle(0, Math.Max(0, (int) ((Main.worldSurface * 16.0 - (double) Main.screenPosition.Y - 2400.0) * 0.100000001490116)), Main.screenWidth, Main.screenHeight), Color.White * Math.Min(1f, (float) (((double) Main.screenPosition.Y - 800.0) / 1000.0) * this._fadeOpacity)); Vector2 vector2_1 = new Vector2((float) (Main.screenWidth >> 1), (float) (Main.screenHeight >> 1)); Vector2 vector2_2 = 0.01f * (new Vector2((float) Main.maxTilesX * 8f, (float) Main.worldSurface / 2f) - Main.screenPosition); - spriteBatch.Draw(this._planetTexture.Value, vector2_1 + new Vector2(-200f, -200f) + vector2_2, new Rectangle?(), Color.White * 0.9f * this._fadeOpacity, 0.0f, new Vector2((float) (this._planetTexture.Width() >> 1), (float) (this._planetTexture.Height() >> 1)), 1f, SpriteEffects.None, 1f); + spriteBatch.Draw(this._planetTexture, vector2_1 + new Vector2(-200f, -200f) + vector2_2, new Rectangle?(), Color.White * 0.9f * this._fadeOpacity, 0.0f, new Vector2((float) (this._planetTexture.Width >> 1), (float) (this._planetTexture.Height >> 1)), 1f, SpriteEffects.None, 1f); } int num1 = -1; int num2 = 0; @@ -82,13 +82,13 @@ namespace Terraria.GameContent.Skies int num4 = this._meteors[index].FrameCounter / 3; this._meteors[index].FrameCounter = (this._meteors[index].FrameCounter + 1) % 12; if (rectangle.Contains((int) position.X, (int) position.Y)) - spriteBatch.Draw(this._meteorTexture.Value, position, new Rectangle?(new Rectangle(0, num4 * (this._meteorTexture.Height() / 4), this._meteorTexture.Width(), this._meteorTexture.Height() / 4)), Color.White * num3 * this._fadeOpacity, 0.0f, Vector2.Zero, vector2_4.X * 5f * this._meteors[index].Scale, SpriteEffects.None, 0.0f); + spriteBatch.Draw(this._meteorTexture, position, new Rectangle?(new Rectangle(0, num4 * (this._meteorTexture.Height / 4), this._meteorTexture.Width, this._meteorTexture.Height / 4)), Color.White * num3 * this._fadeOpacity, 0.0f, Vector2.Zero, vector2_4.X * 5f * this._meteors[index].Scale, SpriteEffects.None, 0.0f); } } public override float GetCloudAlpha() => (float) ((1.0 - (double) this._fadeOpacity) * 0.300000011920929 + 0.699999988079071); - public override void Activate(Vector2 position, params object[] args) + internal override void Activate(Vector2 position, params object[] args) { this._fadeOpacity = 1f / 500f; this._isActive = true; @@ -108,7 +108,7 @@ namespace Terraria.GameContent.Skies private int SortMethod(SolarSky.Meteor meteor1, SolarSky.Meteor meteor2) => meteor2.Depth.CompareTo(meteor1.Depth); - public override void Deactivate(params object[] args) => this._isActive = false; + internal override void Deactivate(params object[] args) => this._isActive = false; public override void Reset() => this._isActive = false; diff --git a/GameContent/Skies/StardustSky.cs b/GameContent/Skies/StardustSky.cs index 43e2494..3da78fe 100644 --- a/GameContent/Skies/StardustSky.cs +++ b/GameContent/Skies/StardustSky.cs @@ -1,13 +1,13 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Skies.StardustSky -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using System; +using Terraria.Graphics; using Terraria.Graphics.Effects; using Terraria.Utilities; @@ -16,20 +16,20 @@ namespace Terraria.GameContent.Skies public class StardustSky : CustomSky { private UnifiedRandom _random = new UnifiedRandom(); - private Asset _planetTexture; - private Asset _bgTexture; - private Asset[] _starTextures; + private Texture2D _planetTexture; + private Texture2D _bgTexture; + private Texture2D[] _starTextures; private bool _isActive; private StardustSky.Star[] _stars; private float _fadeOpacity; public override void OnLoad() { - this._planetTexture = Main.Assets.Request("Images/Misc/StarDustSky/Planet", (AssetRequestMode) 1); - this._bgTexture = Main.Assets.Request("Images/Misc/StarDustSky/Background", (AssetRequestMode) 1); - this._starTextures = new Asset[2]; + this._planetTexture = TextureManager.Load("Images/Misc/StarDustSky/Planet"); + this._bgTexture = TextureManager.Load("Images/Misc/StarDustSky/Background"); + this._starTextures = new Texture2D[2]; for (int index = 0; index < this._starTextures.Length; ++index) - this._starTextures[index] = Main.Assets.Request("Images/Misc/StarDustSky/Star " + (object) index, (AssetRequestMode) 1); + this._starTextures[index] = TextureManager.Load("Images/Misc/StarDustSky/Star " + (object) index); } public override void Update(GameTime gameTime) @@ -46,11 +46,11 @@ namespace Terraria.GameContent.Skies { if ((double) maxDepth >= 3.40282346638529E+38 && (double) minDepth < 3.40282346638529E+38) { - spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.Black * this._fadeOpacity); - spriteBatch.Draw(this._bgTexture.Value, new Rectangle(0, Math.Max(0, (int) ((Main.worldSurface * 16.0 - (double) Main.screenPosition.Y - 2400.0) * 0.100000001490116)), Main.screenWidth, Main.screenHeight), Color.White * Math.Min(1f, (float) (((double) Main.screenPosition.Y - 800.0) / 1000.0) * this._fadeOpacity)); + spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.Black * this._fadeOpacity); + spriteBatch.Draw(this._bgTexture, new Rectangle(0, Math.Max(0, (int) ((Main.worldSurface * 16.0 - (double) Main.screenPosition.Y - 2400.0) * 0.100000001490116)), Main.screenWidth, Main.screenHeight), Color.White * Math.Min(1f, (float) (((double) Main.screenPosition.Y - 800.0) / 1000.0) * this._fadeOpacity)); Vector2 vector2_1 = new Vector2((float) (Main.screenWidth >> 1), (float) (Main.screenHeight >> 1)); Vector2 vector2_2 = 0.01f * (new Vector2((float) Main.maxTilesX * 8f, (float) Main.worldSurface / 2f) - Main.screenPosition); - spriteBatch.Draw(this._planetTexture.Value, vector2_1 + new Vector2(-200f, -200f) + vector2_2, new Rectangle?(), Color.White * 0.9f * this._fadeOpacity, 0.0f, new Vector2((float) (this._planetTexture.Width() >> 1), (float) (this._planetTexture.Height() >> 1)), 1f, SpriteEffects.None, 1f); + spriteBatch.Draw(this._planetTexture, vector2_1 + new Vector2(-200f, -200f) + vector2_2, new Rectangle?(), Color.White * 0.9f * this._fadeOpacity, 0.0f, new Vector2((float) (this._planetTexture.Width >> 1), (float) (this._planetTexture.Height >> 1)), 1f, SpriteEffects.None, 1f); } int num1 = -1; int num2 = 0; @@ -75,18 +75,18 @@ namespace Terraria.GameContent.Skies Vector2 position = (this._stars[index].Position - vector2_3) * vector2_4 + vector2_3 - Main.screenPosition; if (rectangle.Contains((int) position.X, (int) position.Y)) { - float num4 = (float) Math.Sin((double) this._stars[index].AlphaFrequency * (double) Main.GlobalTimeWrappedHourly + (double) this._stars[index].SinOffset) * this._stars[index].AlphaAmplitude + this._stars[index].AlphaAmplitude; - float num5 = (float) (Math.Sin((double) this._stars[index].AlphaFrequency * (double) Main.GlobalTimeWrappedHourly * 5.0 + (double) this._stars[index].SinOffset) * 0.100000001490116 - 0.100000001490116); + float num4 = (float) Math.Sin((double) this._stars[index].AlphaFrequency * (double) Main.GlobalTime + (double) this._stars[index].SinOffset) * this._stars[index].AlphaAmplitude + this._stars[index].AlphaAmplitude; + float num5 = (float) (Math.Sin((double) this._stars[index].AlphaFrequency * (double) Main.GlobalTime * 5.0 + (double) this._stars[index].SinOffset) * 0.100000001490116 - 0.100000001490116); float num6 = MathHelper.Clamp(num4, 0.0f, 1f); - Texture2D texture = this._starTextures[this._stars[index].TextureIndex].Value; - spriteBatch.Draw(texture, position, new Rectangle?(), Color.White * num3 * num6 * 0.8f * (1f - num5) * this._fadeOpacity, 0.0f, new Vector2((float) (texture.Width >> 1), (float) (texture.Height >> 1)), (float) (((double) vector2_4.X * 0.5 + 0.5) * ((double) num6 * 0.300000011920929 + 0.699999988079071)), SpriteEffects.None, 0.0f); + Texture2D starTexture = this._starTextures[this._stars[index].TextureIndex]; + spriteBatch.Draw(starTexture, position, new Rectangle?(), Color.White * num3 * num6 * 0.8f * (1f - num5) * this._fadeOpacity, 0.0f, new Vector2((float) (starTexture.Width >> 1), (float) (starTexture.Height >> 1)), (float) (((double) vector2_4.X * 0.5 + 0.5) * ((double) num6 * 0.300000011920929 + 0.699999988079071)), SpriteEffects.None, 0.0f); } } } public override float GetCloudAlpha() => (float) ((1.0 - (double) this._fadeOpacity) * 0.300000011920929 + 0.699999988079071); - public override void Activate(Vector2 position, params object[] args) + internal override void Activate(Vector2 position, params object[] args) { this._fadeOpacity = 1f / 500f; this._isActive = true; @@ -115,7 +115,7 @@ namespace Terraria.GameContent.Skies private int SortMethod(StardustSky.Star meteor1, StardustSky.Star meteor2) => meteor2.Depth.CompareTo(meteor1.Depth); - public override void Deactivate(params object[] args) => this._isActive = false; + internal override void Deactivate(params object[] args) => this._isActive = false; public override void Reset() => this._isActive = false; diff --git a/GameContent/Skies/VortexSky.cs b/GameContent/Skies/VortexSky.cs index b4c46ce..b1c64c7 100644 --- a/GameContent/Skies/VortexSky.cs +++ b/GameContent/Skies/VortexSky.cs @@ -1,13 +1,13 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Skies.VortexSky -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using System; +using Terraria.Graphics; using Terraria.Graphics.Effects; using Terraria.Utilities; @@ -16,10 +16,10 @@ namespace Terraria.GameContent.Skies public class VortexSky : CustomSky { private UnifiedRandom _random = new UnifiedRandom(); - private Asset _planetTexture; - private Asset _bgTexture; - private Asset _boltTexture; - private Asset _flashTexture; + private Texture2D _planetTexture; + private Texture2D _bgTexture; + private Texture2D _boltTexture; + private Texture2D _flashTexture; private bool _isActive; private int _ticksUntilNextBolt; private float _fadeOpacity; @@ -27,10 +27,10 @@ namespace Terraria.GameContent.Skies public override void OnLoad() { - this._planetTexture = Main.Assets.Request("Images/Misc/VortexSky/Planet", (AssetRequestMode) 1); - this._bgTexture = Main.Assets.Request("Images/Misc/VortexSky/Background", (AssetRequestMode) 1); - this._boltTexture = Main.Assets.Request("Images/Misc/VortexSky/Bolt", (AssetRequestMode) 1); - this._flashTexture = Main.Assets.Request("Images/Misc/VortexSky/Flash", (AssetRequestMode) 1); + this._planetTexture = TextureManager.Load("Images/Misc/VortexSky/Planet"); + this._bgTexture = TextureManager.Load("Images/Misc/VortexSky/Background"); + this._boltTexture = TextureManager.Load("Images/Misc/VortexSky/Bolt"); + this._flashTexture = TextureManager.Load("Images/Misc/VortexSky/Flash"); } public override void Update(GameTime gameTime) @@ -66,11 +66,11 @@ namespace Terraria.GameContent.Skies { if ((double) maxDepth >= 3.40282346638529E+38 && (double) minDepth < 3.40282346638529E+38) { - spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.Black * this._fadeOpacity); - spriteBatch.Draw(this._bgTexture.Value, new Rectangle(0, Math.Max(0, (int) ((Main.worldSurface * 16.0 - (double) Main.screenPosition.Y - 2400.0) * 0.100000001490116)), Main.screenWidth, Main.screenHeight), Color.White * Math.Min(1f, (float) (((double) Main.screenPosition.Y - 800.0) / 1000.0)) * this._fadeOpacity); + spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.Black * this._fadeOpacity); + spriteBatch.Draw(this._bgTexture, new Rectangle(0, Math.Max(0, (int) ((Main.worldSurface * 16.0 - (double) Main.screenPosition.Y - 2400.0) * 0.100000001490116)), Main.screenWidth, Main.screenHeight), Color.White * Math.Min(1f, (float) (((double) Main.screenPosition.Y - 800.0) / 1000.0)) * this._fadeOpacity); Vector2 vector2_1 = new Vector2((float) (Main.screenWidth >> 1), (float) (Main.screenHeight >> 1)); Vector2 vector2_2 = 0.01f * (new Vector2((float) Main.maxTilesX * 8f, (float) Main.worldSurface / 2f) - Main.screenPosition); - spriteBatch.Draw(this._planetTexture.Value, vector2_1 + new Vector2(-200f, -200f) + vector2_2, new Rectangle?(), Color.White * 0.9f * this._fadeOpacity, 0.0f, new Vector2((float) (this._planetTexture.Width() >> 1), (float) (this._planetTexture.Height() >> 1)), 1f, SpriteEffects.None, 1f); + spriteBatch.Draw(this._planetTexture, vector2_1 + new Vector2(-200f, -200f) + vector2_2, new Rectangle?(), Color.White * 0.9f * this._fadeOpacity, 0.0f, new Vector2((float) (this._planetTexture.Width >> 1), (float) (this._planetTexture.Height >> 1)), 1f, SpriteEffects.None, 1f); } float num1 = Math.Min(1f, (float) (((double) Main.screenPosition.Y - 1000.0) / 1000.0)); Vector2 vector2_3 = Main.screenPosition + new Vector2((float) (Main.screenWidth >> 1), (float) (Main.screenHeight >> 1)); @@ -83,10 +83,10 @@ namespace Terraria.GameContent.Skies Vector2 position = (this._bolts[index].Position - vector2_3) * vector2_4 + vector2_3 - Main.screenPosition; if (rectangle.Contains((int) position.X, (int) position.Y)) { - Texture2D texture = this._boltTexture.Value; + Texture2D texture = this._boltTexture; int life = this._bolts[index].Life; if (life > 26 && life % 2 == 0) - texture = this._flashTexture.Value; + texture = this._flashTexture; float num2 = (float) life / 30f; spriteBatch.Draw(texture, position, new Rectangle?(), Color.White * num1 * num2 * this._fadeOpacity, 0.0f, Vector2.Zero, vector2_4.X * 5f, SpriteEffects.None, 0.0f); } @@ -96,7 +96,7 @@ namespace Terraria.GameContent.Skies public override float GetCloudAlpha() => (float) ((1.0 - (double) this._fadeOpacity) * 0.300000011920929 + 0.699999988079071); - public override void Activate(Vector2 position, params object[] args) + internal override void Activate(Vector2 position, params object[] args) { this._fadeOpacity = 1f / 500f; this._isActive = true; @@ -105,7 +105,7 @@ namespace Terraria.GameContent.Skies this._bolts[index].IsAlive = false; } - public override void Deactivate(params object[] args) => this._isActive = false; + internal override void Deactivate(params object[] args) => this._isActive = false; public override void Reset() => this._isActive = false; diff --git a/GameContent/SmartCursorHelper.cs b/GameContent/SmartCursorHelper.cs deleted file mode 100644 index 8d0bf46..0000000 --- a/GameContent/SmartCursorHelper.cs +++ /dev/null @@ -1,2364 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.SmartCursorHelper -// 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; -using System; -using System.Collections.Generic; -using Terraria.Enums; -using Terraria.GameContent.UI; -using Terraria.GameInput; -using Terraria.ID; - -namespace Terraria.GameContent -{ - public class SmartCursorHelper - { - private static List> _targets = new List>(); - private static List> _grappleTargets = new List>(); - private static List> _points = new List>(); - private static List> _endpoints = new List>(); - private static List> _toRemove = new List>(); - private static List> _targets2 = new List>(); - - public static void SmartCursorLookup(Player player) - { - Main.SmartCursorShowing = false; - if (!Main.SmartCursorEnabled) - return; - SmartCursorHelper.SmartCursorUsageInfo providedInfo = new SmartCursorHelper.SmartCursorUsageInfo() - { - player = player, - item = player.inventory[player.selectedItem], - mouse = Main.MouseWorld, - position = player.position, - Center = player.Center - }; - double gravDir = (double) player.gravDir; - int tileTargetX = Player.tileTargetX; - int tileTargetY = Player.tileTargetY; - int tileRangeX = Player.tileRangeX; - int tileRangeY = Player.tileRangeY; - providedInfo.screenTargetX = Utils.Clamp(tileTargetX, 10, Main.maxTilesX - 10); - providedInfo.screenTargetY = Utils.Clamp(tileTargetY, 10, Main.maxTilesY - 10); - if (Main.tile[providedInfo.screenTargetX, providedInfo.screenTargetY] == null) - return; - int num1 = SmartCursorHelper.IsHoveringOverAnInteractibleTileThatBlocksSmartCursor(providedInfo) ? 1 : 0; - int num2 = SmartCursorHelper.TryFindingPaintInplayerInventory(providedInfo); - providedInfo.paintLookup = num2; - int tileBoost = providedInfo.item.tileBoost; - providedInfo.reachableStartX = (int) ((double) player.position.X / 16.0) - tileRangeX - tileBoost + 1; - providedInfo.reachableEndX = (int) (((double) player.position.X + (double) player.width) / 16.0) + tileRangeX + tileBoost - 1; - providedInfo.reachableStartY = (int) ((double) player.position.Y / 16.0) - tileRangeY - tileBoost + 1; - providedInfo.reachableEndY = (int) (((double) player.position.Y + (double) player.height) / 16.0) + tileRangeY + tileBoost - 2; - providedInfo.reachableStartX = Utils.Clamp(providedInfo.reachableStartX, 10, Main.maxTilesX - 10); - providedInfo.reachableEndX = Utils.Clamp(providedInfo.reachableEndX, 10, Main.maxTilesX - 10); - providedInfo.reachableStartY = Utils.Clamp(providedInfo.reachableStartY, 10, Main.maxTilesY - 10); - providedInfo.reachableEndY = Utils.Clamp(providedInfo.reachableEndY, 10, Main.maxTilesY - 10); - if (num1 != 0 && providedInfo.screenTargetX >= providedInfo.reachableStartX && providedInfo.screenTargetX <= providedInfo.reachableEndX && providedInfo.screenTargetY >= providedInfo.reachableStartY && providedInfo.screenTargetY <= providedInfo.reachableEndY) - return; - SmartCursorHelper._grappleTargets.Clear(); - int[] grappling = player.grappling; - int grapCount = player.grapCount; - for (int index = 0; index < grapCount; ++index) - { - Projectile projectile = Main.projectile[grappling[index]]; - int num3 = (int) projectile.Center.X / 16; - int num4 = (int) projectile.Center.Y / 16; - SmartCursorHelper._grappleTargets.Add(new Tuple(num3, num4)); - } - int num5 = -1; - int num6 = -1; - if (!Player.SmartCursorSettings.SmartAxeAfterPickaxe) - SmartCursorHelper.Step_Axe(providedInfo, ref num5, ref num6); - SmartCursorHelper.Step_ForceCursorToAnyMinableThing(providedInfo, ref num5, ref num6); - SmartCursorHelper.Step_Pickaxe_MineShinies(providedInfo, ref num5, ref num6); - SmartCursorHelper.Step_Pickaxe_MineSolids(player, providedInfo, SmartCursorHelper._grappleTargets, ref num5, ref num6); - if (Player.SmartCursorSettings.SmartAxeAfterPickaxe) - SmartCursorHelper.Step_Axe(providedInfo, ref num5, ref num6); - SmartCursorHelper.Step_ColoredWrenches(providedInfo, ref num5, ref num6); - SmartCursorHelper.Step_MulticolorWrench(providedInfo, ref num5, ref num6); - SmartCursorHelper.Step_Hammers(providedInfo, ref num5, ref num6); - SmartCursorHelper.Step_ActuationRod(providedInfo, ref num5, ref num6); - SmartCursorHelper.Step_WireCutter(providedInfo, ref num5, ref num6); - SmartCursorHelper.Step_Platforms(providedInfo, ref num5, ref num6); - SmartCursorHelper.Step_MinecartTracks(providedInfo, ref num5, ref num6); - SmartCursorHelper.Step_Walls(providedInfo, ref num5, ref num6); - SmartCursorHelper.Step_PumpkinSeeds(providedInfo, ref num5, ref num6); - SmartCursorHelper.Step_Pigronata(providedInfo, ref num5, ref num6); - SmartCursorHelper.Step_Boulders(providedInfo, ref num5, ref num6); - SmartCursorHelper.Step_Torch(providedInfo, ref num5, ref num6); - SmartCursorHelper.Step_LawnMower(providedInfo, ref num5, ref num6); - SmartCursorHelper.Step_BlocksFilling(providedInfo, ref num5, ref num6); - SmartCursorHelper.Step_BlocksLines(providedInfo, ref num5, ref num6); - SmartCursorHelper.Step_PaintRoller(providedInfo, ref num5, ref num6); - SmartCursorHelper.Step_PaintBrush(providedInfo, ref num5, ref num6); - SmartCursorHelper.Step_PaintScrapper(providedInfo, ref num5, ref num6); - SmartCursorHelper.Step_Acorns(providedInfo, ref num5, ref num6); - SmartCursorHelper.Step_GemCorns(providedInfo, ref num5, ref num6); - SmartCursorHelper.Step_EmptyBuckets(providedInfo, ref num5, ref num6); - SmartCursorHelper.Step_Actuators(providedInfo, ref num5, ref num6); - SmartCursorHelper.Step_AlchemySeeds(providedInfo, ref num5, ref num6); - SmartCursorHelper.Step_PlanterBox(providedInfo, ref num5, ref num6); - SmartCursorHelper.Step_ClayPots(providedInfo, ref num5, ref num6); - SmartCursorHelper.Step_StaffOfRegrowth(providedInfo, ref num5, ref num6); - if (num5 != -1 && num6 != -1) - { - Main.SmartCursorX = Player.tileTargetX = num5; - Main.SmartCursorY = Player.tileTargetY = num6; - Main.SmartCursorShowing = true; - } - SmartCursorHelper._grappleTargets.Clear(); - } - - private static int TryFindingPaintInplayerInventory( - SmartCursorHelper.SmartCursorUsageInfo providedInfo) - { - Item[] inventory = providedInfo.player.inventory; - int num = 0; - if (providedInfo.item.type == 1071 || providedInfo.item.type == 1543 || providedInfo.item.type == 1072 || providedInfo.item.type == 1544) - { - for (int index = 0; index < 58; ++index) - { - if (inventory[index].stack > 0 && inventory[index].paint > (byte) 0) - { - num = (int) inventory[index].paint; - break; - } - } - } - return num; - } - - private static bool IsHoveringOverAnInteractibleTileThatBlocksSmartCursor( - SmartCursorHelper.SmartCursorUsageInfo providedInfo) - { - bool flag = false; - if (Main.tile[providedInfo.screenTargetX, providedInfo.screenTargetY].active()) - { - switch (Main.tile[providedInfo.screenTargetX, providedInfo.screenTargetY].type) - { - case 4: - case 10: - case 11: - case 13: - case 21: - case 29: - case 33: - case 49: - case 50: - case 55: - case 79: - case 85: - case 88: - case 97: - case 104: - case 125: - case 132: - case 136: - case 139: - case 144: - case 174: - case 207: - case 209: - case 212: - case 216: - case 219: - case 237: - case 287: - case 334: - case 335: - case 338: - case 354: - case 386: - case 387: - case 388: - case 389: - case 411: - case 425: - case 441: - case 463: - case 467: - case 468: - case 491: - case 494: - case 510: - case 511: - case 573: - case 621: - flag = true; - break; - case 314: - if ((double) providedInfo.player.gravDir == 1.0) - { - flag = true; - break; - } - break; - } - } - return flag; - } - - private static void Step_StaffOfRegrowth( - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - ref int focusedX, - ref int focusedY) - { - if (providedInfo.item.type != 213 || focusedX != -1 || focusedY != -1) - return; - SmartCursorHelper._targets.Clear(); - for (int reachableStartX = providedInfo.reachableStartX; reachableStartX <= providedInfo.reachableEndX; ++reachableStartX) - { - for (int reachableStartY = providedInfo.reachableStartY; reachableStartY <= providedInfo.reachableEndY; ++reachableStartY) - { - Tile tile = Main.tile[reachableStartX, reachableStartY]; - bool flag1 = !Main.tile[reachableStartX - 1, reachableStartY].active() || !Main.tile[reachableStartX, reachableStartY + 1].active() || !Main.tile[reachableStartX + 1, reachableStartY].active() || !Main.tile[reachableStartX, reachableStartY - 1].active(); - bool flag2 = !Main.tile[reachableStartX - 1, reachableStartY - 1].active() || !Main.tile[reachableStartX - 1, reachableStartY + 1].active() || !Main.tile[reachableStartX + 1, reachableStartY + 1].active() || !Main.tile[reachableStartX + 1, reachableStartY - 1].active(); - if (tile.active() && !tile.inActive() && tile.type == (ushort) 0 && (flag1 || tile.type == (ushort) 0 & flag2)) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY)); - } - } - if (SmartCursorHelper._targets.Count > 0) - { - float num1 = -1f; - Tuple target = SmartCursorHelper._targets[0]; - for (int index = 0; index < SmartCursorHelper._targets.Count; ++index) - { - float num2 = Vector2.Distance(new Vector2((float) SmartCursorHelper._targets[index].Item1, (float) SmartCursorHelper._targets[index].Item2) * 16f + Vector2.One * 8f, providedInfo.mouse); - if ((double) num1 == -1.0 || (double) num2 < (double) num1) - { - num1 = num2; - target = SmartCursorHelper._targets[index]; - } - } - if (Collision.InTileBounds(target.Item1, target.Item2, providedInfo.reachableStartX, providedInfo.reachableStartY, providedInfo.reachableEndX, providedInfo.reachableEndY)) - { - focusedX = target.Item1; - focusedY = target.Item2; - } - } - SmartCursorHelper._targets.Clear(); - } - - private static void Step_ClayPots( - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - ref int focusedX, - ref int focusedY) - { - if (providedInfo.item.createTile != 78 || focusedX != -1 || focusedY != -1) - return; - SmartCursorHelper._targets.Clear(); - bool flag = false; - if (Main.tile[providedInfo.screenTargetX, providedInfo.screenTargetY].active()) - flag = true; - if (!Collision.InTileBounds(providedInfo.screenTargetX, providedInfo.screenTargetY, providedInfo.reachableStartX, providedInfo.reachableStartY, providedInfo.reachableEndX, providedInfo.reachableEndY)) - flag = true; - if (!flag) - { - for (int reachableStartX = providedInfo.reachableStartX; reachableStartX <= providedInfo.reachableEndX; ++reachableStartX) - { - for (int reachableStartY = providedInfo.reachableStartY; reachableStartY <= providedInfo.reachableEndY; ++reachableStartY) - { - Tile tile1 = Main.tile[reachableStartX, reachableStartY]; - Tile tile2 = Main.tile[reachableStartX, reachableStartY + 1]; - if ((!tile1.active() || Main.tileCut[(int) tile1.type] || TileID.Sets.BreakableWhenPlacing[(int) tile1.type]) && tile2.nactive() && !tile2.halfBrick() && tile2.slope() == (byte) 0 && Main.tileSolid[(int) tile2.type]) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY)); - } - } - } - if (SmartCursorHelper._targets.Count > 0) - { - float num1 = -1f; - Tuple target = SmartCursorHelper._targets[0]; - for (int index = 0; index < SmartCursorHelper._targets.Count; ++index) - { - if (Collision.EmptyTile(SmartCursorHelper._targets[index].Item1, SmartCursorHelper._targets[index].Item2, true)) - { - float num2 = Vector2.Distance(new Vector2((float) SmartCursorHelper._targets[index].Item1, (float) SmartCursorHelper._targets[index].Item2) * 16f + Vector2.One * 8f, providedInfo.mouse); - if ((double) num1 == -1.0 || (double) num2 < (double) num1) - { - num1 = num2; - target = SmartCursorHelper._targets[index]; - } - } - } - if (Collision.InTileBounds(target.Item1, target.Item2, providedInfo.reachableStartX, providedInfo.reachableStartY, providedInfo.reachableEndX, providedInfo.reachableEndY) && (double) num1 != -1.0) - { - focusedX = target.Item1; - focusedY = target.Item2; - } - } - SmartCursorHelper._targets.Clear(); - } - - private static void Step_PlanterBox( - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - ref int focusedX, - ref int focusedY) - { - if (providedInfo.item.createTile != 380 || focusedX != -1 || focusedY != -1) - return; - SmartCursorHelper._targets.Clear(); - bool flag = false; - if (Main.tile[providedInfo.screenTargetX, providedInfo.screenTargetY].active() && Main.tile[providedInfo.screenTargetX, providedInfo.screenTargetY].type == (ushort) 380) - flag = true; - if (!flag) - { - for (int reachableStartX = providedInfo.reachableStartX; reachableStartX <= providedInfo.reachableEndX; ++reachableStartX) - { - for (int reachableStartY = providedInfo.reachableStartY; reachableStartY <= providedInfo.reachableEndY; ++reachableStartY) - { - Tile tile = Main.tile[reachableStartX, reachableStartY]; - if (tile.active() && tile.type == (ushort) 380) - { - if (!Main.tile[reachableStartX - 1, reachableStartY].active() || Main.tileCut[(int) Main.tile[reachableStartX - 1, reachableStartY].type] || TileID.Sets.BreakableWhenPlacing[(int) Main.tile[reachableStartX - 1, reachableStartY].type]) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX - 1, reachableStartY)); - if (!Main.tile[reachableStartX + 1, reachableStartY].active() || Main.tileCut[(int) Main.tile[reachableStartX + 1, reachableStartY].type] || TileID.Sets.BreakableWhenPlacing[(int) Main.tile[reachableStartX + 1, reachableStartY].type]) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX + 1, reachableStartY)); - } - } - } - } - if (SmartCursorHelper._targets.Count > 0) - { - float num1 = -1f; - Tuple target = SmartCursorHelper._targets[0]; - for (int index = 0; index < SmartCursorHelper._targets.Count; ++index) - { - float num2 = Vector2.Distance(new Vector2((float) SmartCursorHelper._targets[index].Item1, (float) SmartCursorHelper._targets[index].Item2) * 16f + Vector2.One * 8f, providedInfo.mouse); - if ((double) num1 == -1.0 || (double) num2 < (double) num1) - { - num1 = num2; - target = SmartCursorHelper._targets[index]; - } - } - if (Collision.InTileBounds(target.Item1, target.Item2, providedInfo.reachableStartX, providedInfo.reachableStartY, providedInfo.reachableEndX, providedInfo.reachableEndY) && (double) num1 != -1.0) - { - focusedX = target.Item1; - focusedY = target.Item2; - } - } - SmartCursorHelper._targets.Clear(); - } - - private static void Step_AlchemySeeds( - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - ref int focusedX, - ref int focusedY) - { - if (providedInfo.item.createTile != 82 || focusedX != -1 || focusedY != -1) - return; - int placeStyle = providedInfo.item.placeStyle; - SmartCursorHelper._targets.Clear(); - for (int reachableStartX = providedInfo.reachableStartX; reachableStartX <= providedInfo.reachableEndX; ++reachableStartX) - { - for (int reachableStartY = providedInfo.reachableStartY; reachableStartY <= providedInfo.reachableEndY; ++reachableStartY) - { - Tile tile1 = Main.tile[reachableStartX, reachableStartY]; - Tile tile2 = Main.tile[reachableStartX, reachableStartY + 1]; - int num = !tile1.active() || TileID.Sets.BreakableWhenPlacing[(int) tile1.type] ? 1 : (!Main.tileCut[(int) tile1.type] || tile1.type == (ushort) 82 ? 0 : (WorldGen.IsHarvestableHerbWithSeed((int) tile1.type, (int) tile1.frameX / 18) ? 1 : 0)); - bool flag = tile2.nactive() && !tile2.halfBrick() && tile2.slope() == (byte) 0; - if (num != 0 && flag) - { - switch (placeStyle) - { - case 0: - if (tile2.type != (ushort) 78 && tile2.type != (ushort) 380 && tile2.type != (ushort) 2 && tile2.type != (ushort) 477 && tile2.type != (ushort) 109 && tile2.type != (ushort) 492 || tile1.liquid > (byte) 0) - continue; - break; - case 1: - if (tile2.type != (ushort) 78 && tile2.type != (ushort) 380 && tile2.type != (ushort) 60 || tile1.liquid > (byte) 0) - continue; - break; - case 2: - if (tile2.type != (ushort) 78 && tile2.type != (ushort) 380 && tile2.type != (ushort) 0 && tile2.type != (ushort) 59 || tile1.liquid > (byte) 0) - continue; - break; - case 3: - if (tile2.type != (ushort) 78 && tile2.type != (ushort) 380 && tile2.type != (ushort) 203 && tile2.type != (ushort) 199 && tile2.type != (ushort) 23 && tile2.type != (ushort) 25 || tile1.liquid > (byte) 0) - continue; - break; - case 4: - if (tile2.type != (ushort) 78 && tile2.type != (ushort) 380 && tile2.type != (ushort) 53 && tile2.type != (ushort) 116 || tile1.liquid > (byte) 0 && tile1.lava()) - continue; - break; - case 5: - if (tile2.type != (ushort) 78 && tile2.type != (ushort) 380 && tile2.type != (ushort) 57 || tile1.liquid > (byte) 0 && !tile1.lava()) - continue; - break; - case 6: - if (tile2.type != (ushort) 78 && tile2.type != (ushort) 380 && tile2.type != (ushort) 147 && tile2.type != (ushort) 161 && tile2.type != (ushort) 163 && tile2.type != (ushort) 164 && tile2.type != (ushort) 200 || tile1.liquid > (byte) 0 && tile1.lava()) - continue; - break; - } - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY)); - } - } - } - if (SmartCursorHelper._targets.Count > 0) - { - float num1 = -1f; - Tuple target = SmartCursorHelper._targets[0]; - for (int index = 0; index < SmartCursorHelper._targets.Count; ++index) - { - float num2 = Vector2.Distance(new Vector2((float) SmartCursorHelper._targets[index].Item1, (float) SmartCursorHelper._targets[index].Item2) * 16f + Vector2.One * 8f, providedInfo.mouse); - if ((double) num1 == -1.0 || (double) num2 < (double) num1) - { - num1 = num2; - target = SmartCursorHelper._targets[index]; - } - } - if (Collision.InTileBounds(target.Item1, target.Item2, providedInfo.reachableStartX, providedInfo.reachableStartY, providedInfo.reachableEndX, providedInfo.reachableEndY)) - { - focusedX = target.Item1; - focusedY = target.Item2; - } - } - SmartCursorHelper._targets.Clear(); - } - - private static void Step_Actuators( - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - ref int focusedX, - ref int focusedY) - { - if (providedInfo.item.type != 849 || focusedX != -1 || focusedY != -1) - return; - SmartCursorHelper._targets.Clear(); - for (int reachableStartX = providedInfo.reachableStartX; reachableStartX <= providedInfo.reachableEndX; ++reachableStartX) - { - for (int reachableStartY = providedInfo.reachableStartY; reachableStartY <= providedInfo.reachableEndY; ++reachableStartY) - { - Tile tile = Main.tile[reachableStartX, reachableStartY]; - if ((tile.wire() || tile.wire2() || tile.wire3() || tile.wire4()) && !tile.actuator() && tile.active()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY)); - } - } - if (SmartCursorHelper._targets.Count > 0) - { - float num1 = -1f; - Tuple target = SmartCursorHelper._targets[0]; - for (int index = 0; index < SmartCursorHelper._targets.Count; ++index) - { - float num2 = Vector2.Distance(new Vector2((float) SmartCursorHelper._targets[index].Item1, (float) SmartCursorHelper._targets[index].Item2) * 16f + Vector2.One * 8f, providedInfo.mouse); - if ((double) num1 == -1.0 || (double) num2 < (double) num1) - { - num1 = num2; - target = SmartCursorHelper._targets[index]; - } - } - if (Collision.InTileBounds(target.Item1, target.Item2, providedInfo.reachableStartX, providedInfo.reachableStartY, providedInfo.reachableEndX, providedInfo.reachableEndY)) - { - focusedX = target.Item1; - focusedY = target.Item2; - } - } - SmartCursorHelper._targets.Clear(); - } - - private static void Step_EmptyBuckets( - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - ref int focusedX, - ref int focusedY) - { - if (providedInfo.item.type != 205 || focusedX != -1 || focusedY != -1) - return; - SmartCursorHelper._targets.Clear(); - for (int reachableStartX = providedInfo.reachableStartX; reachableStartX <= providedInfo.reachableEndX; ++reachableStartX) - { - for (int reachableStartY = providedInfo.reachableStartY; reachableStartY <= providedInfo.reachableEndY; ++reachableStartY) - { - Tile tile = Main.tile[reachableStartX, reachableStartY]; - if (tile.liquid > (byte) 0) - { - int num1 = (int) tile.liquidType(); - int num2 = 0; - for (int index1 = reachableStartX - 1; index1 <= reachableStartX + 1; ++index1) - { - for (int index2 = reachableStartY - 1; index2 <= reachableStartY + 1; ++index2) - { - if ((int) Main.tile[index1, index2].liquidType() == num1) - num2 += (int) Main.tile[index1, index2].liquid; - } - } - if (num2 > 100) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY)); - } - } - } - if (SmartCursorHelper._targets.Count > 0) - { - float num3 = -1f; - Tuple target = SmartCursorHelper._targets[0]; - for (int index = 0; index < SmartCursorHelper._targets.Count; ++index) - { - float num4 = Vector2.Distance(new Vector2((float) SmartCursorHelper._targets[index].Item1, (float) SmartCursorHelper._targets[index].Item2) * 16f + Vector2.One * 8f, providedInfo.mouse); - if ((double) num3 == -1.0 || (double) num4 < (double) num3) - { - num3 = num4; - target = SmartCursorHelper._targets[index]; - } - } - if (Collision.InTileBounds(target.Item1, target.Item2, providedInfo.reachableStartX, providedInfo.reachableStartY, providedInfo.reachableEndX, providedInfo.reachableEndY)) - { - focusedX = target.Item1; - focusedY = target.Item2; - } - } - SmartCursorHelper._targets.Clear(); - } - - private static void Step_PaintScrapper( - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - ref int focusedX, - ref int focusedY) - { - if (!ItemID.Sets.IsPaintScraper[providedInfo.item.type] || focusedX != -1 || focusedY != -1) - return; - SmartCursorHelper._targets.Clear(); - for (int reachableStartX = providedInfo.reachableStartX; reachableStartX <= providedInfo.reachableEndX; ++reachableStartX) - { - for (int reachableStartY = providedInfo.reachableStartY; reachableStartY <= providedInfo.reachableEndY; ++reachableStartY) - { - Tile tile = Main.tile[reachableStartX, reachableStartY]; - if (tile.active() && (tile.color() > (byte) 0 || tile.type == (ushort) 184) || tile.wall > (ushort) 0 && tile.wallColor() > (byte) 0) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY)); - } - } - if (SmartCursorHelper._targets.Count > 0) - { - float num1 = -1f; - Tuple target = SmartCursorHelper._targets[0]; - for (int index = 0; index < SmartCursorHelper._targets.Count; ++index) - { - float num2 = Vector2.Distance(new Vector2((float) SmartCursorHelper._targets[index].Item1, (float) SmartCursorHelper._targets[index].Item2) * 16f + Vector2.One * 8f, providedInfo.mouse); - if ((double) num1 == -1.0 || (double) num2 < (double) num1) - { - num1 = num2; - target = SmartCursorHelper._targets[index]; - } - } - if (Collision.InTileBounds(target.Item1, target.Item2, providedInfo.reachableStartX, providedInfo.reachableStartY, providedInfo.reachableEndX, providedInfo.reachableEndY)) - { - focusedX = target.Item1; - focusedY = target.Item2; - } - } - SmartCursorHelper._targets.Clear(); - } - - private static void Step_PaintBrush( - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - ref int focusedX, - ref int focusedY) - { - if (providedInfo.item.type != 1071 && providedInfo.item.type != 1543 || providedInfo.paintLookup == 0 || focusedX != -1 || focusedY != -1) - return; - SmartCursorHelper._targets.Clear(); - for (int reachableStartX = providedInfo.reachableStartX; reachableStartX <= providedInfo.reachableEndX; ++reachableStartX) - { - for (int reachableStartY = providedInfo.reachableStartY; reachableStartY <= providedInfo.reachableEndY; ++reachableStartY) - { - Tile tile = Main.tile[reachableStartX, reachableStartY]; - if (tile.active() && (int) tile.color() != providedInfo.paintLookup) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY)); - } - } - if (SmartCursorHelper._targets.Count > 0) - { - float num1 = -1f; - Tuple target = SmartCursorHelper._targets[0]; - for (int index = 0; index < SmartCursorHelper._targets.Count; ++index) - { - float num2 = Vector2.Distance(new Vector2((float) SmartCursorHelper._targets[index].Item1, (float) SmartCursorHelper._targets[index].Item2) * 16f + Vector2.One * 8f, providedInfo.mouse); - if ((double) num1 == -1.0 || (double) num2 < (double) num1) - { - num1 = num2; - target = SmartCursorHelper._targets[index]; - } - } - if (Collision.InTileBounds(target.Item1, target.Item2, providedInfo.reachableStartX, providedInfo.reachableStartY, providedInfo.reachableEndX, providedInfo.reachableEndY)) - { - focusedX = target.Item1; - focusedY = target.Item2; - } - } - SmartCursorHelper._targets.Clear(); - } - - private static void Step_PaintRoller( - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - ref int focusedX, - ref int focusedY) - { - if (providedInfo.item.type != 1072 && providedInfo.item.type != 1544 || providedInfo.paintLookup == 0 || focusedX != -1 || focusedY != -1) - return; - SmartCursorHelper._targets.Clear(); - for (int reachableStartX = providedInfo.reachableStartX; reachableStartX <= providedInfo.reachableEndX; ++reachableStartX) - { - for (int reachableStartY = providedInfo.reachableStartY; reachableStartY <= providedInfo.reachableEndY; ++reachableStartY) - { - Tile tile = Main.tile[reachableStartX, reachableStartY]; - if (tile.wall > (ushort) 0 && (int) tile.wallColor() != providedInfo.paintLookup && (!tile.active() || !Main.tileSolid[(int) tile.type] || Main.tileSolidTop[(int) tile.type])) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY)); - } - } - if (SmartCursorHelper._targets.Count > 0) - { - float num1 = -1f; - Tuple target = SmartCursorHelper._targets[0]; - for (int index = 0; index < SmartCursorHelper._targets.Count; ++index) - { - float num2 = Vector2.Distance(new Vector2((float) SmartCursorHelper._targets[index].Item1, (float) SmartCursorHelper._targets[index].Item2) * 16f + Vector2.One * 8f, providedInfo.mouse); - if ((double) num1 == -1.0 || (double) num2 < (double) num1) - { - num1 = num2; - target = SmartCursorHelper._targets[index]; - } - } - if (Collision.InTileBounds(target.Item1, target.Item2, providedInfo.reachableStartX, providedInfo.reachableStartY, providedInfo.reachableEndX, providedInfo.reachableEndY)) - { - focusedX = target.Item1; - focusedY = target.Item2; - } - } - SmartCursorHelper._targets.Clear(); - } - - private static void Step_BlocksLines( - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - ref int focusedX, - ref int focusedY) - { - if (!Player.SmartCursorSettings.SmartBlocksEnabled || providedInfo.item.createTile <= -1 || providedInfo.item.type == 213 || !Main.tileSolid[providedInfo.item.createTile] || Main.tileSolidTop[providedInfo.item.createTile] || Main.tileFrameImportant[providedInfo.item.createTile] || focusedX != -1 || focusedY != -1) - return; - SmartCursorHelper._targets.Clear(); - bool flag1 = false; - if (Main.tile[providedInfo.screenTargetX, providedInfo.screenTargetY].active()) - flag1 = true; - if (!Collision.InTileBounds(providedInfo.screenTargetX, providedInfo.screenTargetY, providedInfo.reachableStartX, providedInfo.reachableStartY, providedInfo.reachableEndX, providedInfo.reachableEndY)) - flag1 = true; - if (!flag1) - { - for (int reachableStartX = providedInfo.reachableStartX; reachableStartX <= providedInfo.reachableEndX; ++reachableStartX) - { - for (int reachableStartY = providedInfo.reachableStartY; reachableStartY <= providedInfo.reachableEndY; ++reachableStartY) - { - Tile tile = Main.tile[reachableStartX, reachableStartY]; - if (!tile.active() || Main.tileCut[(int) tile.type] || TileID.Sets.BreakableWhenPlacing[(int) tile.type]) - { - bool flag2 = false; - if (Main.tile[reachableStartX - 1, reachableStartY].active() && Main.tileSolid[(int) Main.tile[reachableStartX - 1, reachableStartY].type] && !Main.tileSolidTop[(int) Main.tile[reachableStartX - 1, reachableStartY].type]) - flag2 = true; - if (Main.tile[reachableStartX + 1, reachableStartY].active() && Main.tileSolid[(int) Main.tile[reachableStartX + 1, reachableStartY].type] && !Main.tileSolidTop[(int) Main.tile[reachableStartX + 1, reachableStartY].type]) - flag2 = true; - if (Main.tile[reachableStartX, reachableStartY - 1].active() && Main.tileSolid[(int) Main.tile[reachableStartX, reachableStartY - 1].type] && !Main.tileSolidTop[(int) Main.tile[reachableStartX, reachableStartY - 1].type]) - flag2 = true; - if (Main.tile[reachableStartX, reachableStartY + 1].active() && Main.tileSolid[(int) Main.tile[reachableStartX, reachableStartY + 1].type] && !Main.tileSolidTop[(int) Main.tile[reachableStartX, reachableStartY + 1].type]) - flag2 = true; - if (flag2) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY)); - } - } - } - } - if (SmartCursorHelper._targets.Count > 0) - { - float num1 = -1f; - Tuple target = SmartCursorHelper._targets[0]; - for (int index = 0; index < SmartCursorHelper._targets.Count; ++index) - { - if (Collision.EmptyTile(SmartCursorHelper._targets[index].Item1, SmartCursorHelper._targets[index].Item2)) - { - float num2 = Vector2.Distance(new Vector2((float) SmartCursorHelper._targets[index].Item1, (float) SmartCursorHelper._targets[index].Item2) * 16f + Vector2.One * 8f, providedInfo.mouse); - if ((double) num1 == -1.0 || (double) num2 < (double) num1) - { - num1 = num2; - target = SmartCursorHelper._targets[index]; - } - } - } - if (Collision.InTileBounds(target.Item1, target.Item2, providedInfo.reachableStartX, providedInfo.reachableStartY, providedInfo.reachableEndX, providedInfo.reachableEndY) && (double) num1 != -1.0) - { - focusedX = target.Item1; - focusedY = target.Item2; - } - } - SmartCursorHelper._targets.Clear(); - } - - private static void Step_Boulders( - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - ref int focusedX, - ref int focusedY) - { - if (providedInfo.item.createTile != 138 || focusedX != -1 || focusedY != -1) - return; - SmartCursorHelper._targets.Clear(); - for (int reachableStartX = providedInfo.reachableStartX; reachableStartX <= providedInfo.reachableEndX; ++reachableStartX) - { - for (int reachableStartY = providedInfo.reachableStartY; reachableStartY <= providedInfo.reachableEndY; ++reachableStartY) - { - Tile tile1 = Main.tile[reachableStartX, reachableStartY + 1]; - Tile tile2 = Main.tile[reachableStartX - 1, reachableStartY + 1]; - bool flag = true; - if (!tile2.nactive() || !tile1.nactive()) - flag = false; - if (tile2.slope() > (byte) 0 || tile1.slope() > (byte) 0 || tile2.halfBrick() || tile1.halfBrick()) - flag = false; - if (Main.tileNoAttach[(int) tile2.type] || Main.tileNoAttach[(int) tile1.type]) - flag = false; - for (int index1 = reachableStartX - 1; index1 <= reachableStartX; ++index1) - { - for (int index2 = reachableStartY - 1; index2 <= reachableStartY; ++index2) - { - Tile tile3 = Main.tile[index1, index2]; - if (tile3.active() && !Main.tileCut[(int) tile3.type]) - flag = false; - } - } - Rectangle rectangle = new Rectangle(reachableStartX * 16 - 16, reachableStartY * 16 - 16, 32, 32); - for (int index = 0; index < (int) byte.MaxValue; ++index) - { - Player player = Main.player[index]; - if (player.active && !player.dead && player.Hitbox.Intersects(rectangle)) - { - flag = false; - break; - } - } - if (flag) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY)); - } - } - if (SmartCursorHelper._targets.Count > 0) - { - float num1 = -1f; - Tuple target = SmartCursorHelper._targets[0]; - for (int index = 0; index < SmartCursorHelper._targets.Count; ++index) - { - float num2 = Vector2.Distance(new Vector2((float) SmartCursorHelper._targets[index].Item1, (float) SmartCursorHelper._targets[index].Item2) * 16f + Vector2.One * 8f, providedInfo.mouse); - if ((double) num1 == -1.0 || (double) num2 < (double) num1) - { - num1 = num2; - target = SmartCursorHelper._targets[index]; - } - } - if (Collision.InTileBounds(target.Item1, target.Item2, providedInfo.reachableStartX, providedInfo.reachableStartY, providedInfo.reachableEndX, providedInfo.reachableEndY)) - { - focusedX = target.Item1; - focusedY = target.Item2; - } - } - SmartCursorHelper._targets.Clear(); - } - - private static void Step_Pigronata( - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - ref int focusedX, - ref int focusedY) - { - if (providedInfo.item.createTile != 454 || focusedX != -1 || focusedY != -1) - return; - SmartCursorHelper._targets.Clear(); - for (int reachableStartX = providedInfo.reachableStartX; reachableStartX <= providedInfo.reachableEndX; ++reachableStartX) - { - for (int reachableStartY = providedInfo.reachableStartY; reachableStartY <= providedInfo.reachableEndY && (double) reachableStartY <= Main.worldSurface - 2.0; ++reachableStartY) - { - bool flag = true; - for (int index1 = reachableStartX - 2; index1 <= reachableStartX + 1; ++index1) - { - for (int index2 = reachableStartY - 1; index2 <= reachableStartY + 2; ++index2) - { - Tile testTile = Main.tile[index1, index2]; - if (index2 == reachableStartY - 1) - { - if (!WorldGen.SolidTile(testTile)) - flag = false; - } - else if (testTile.active() && (!Main.tileCut[(int) testTile.type] || testTile.type == (ushort) 454)) - flag = false; - } - } - if (flag) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY)); - } - } - if (SmartCursorHelper._targets.Count > 0) - { - float num1 = -1f; - Tuple target = SmartCursorHelper._targets[0]; - for (int index = 0; index < SmartCursorHelper._targets.Count; ++index) - { - float num2 = Vector2.Distance(new Vector2((float) SmartCursorHelper._targets[index].Item1, (float) SmartCursorHelper._targets[index].Item2) * 16f + Vector2.One * 8f, providedInfo.mouse); - if ((double) num1 == -1.0 || (double) num2 < (double) num1) - { - num1 = num2; - target = SmartCursorHelper._targets[index]; - } - } - if (Collision.InTileBounds(target.Item1, target.Item2, providedInfo.reachableStartX, providedInfo.reachableStartY, providedInfo.reachableEndX, providedInfo.reachableEndY)) - { - focusedX = target.Item1; - focusedY = target.Item2; - } - } - SmartCursorHelper._targets.Clear(); - } - - private static void Step_PumpkinSeeds( - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - ref int focusedX, - ref int focusedY) - { - if (providedInfo.item.createTile != 254 || focusedX != -1 || focusedY != -1) - return; - SmartCursorHelper._targets.Clear(); - for (int reachableStartX = providedInfo.reachableStartX; reachableStartX <= providedInfo.reachableEndX; ++reachableStartX) - { - for (int reachableStartY = providedInfo.reachableStartY; reachableStartY <= providedInfo.reachableEndY; ++reachableStartY) - { - Tile tile1 = Main.tile[reachableStartX, reachableStartY + 1]; - Tile tile2 = Main.tile[reachableStartX - 1, reachableStartY + 1]; - if ((double) reachableStartY <= Main.worldSurface - 2.0) - { - bool flag = true; - if (!tile2.active() || !tile1.active()) - flag = false; - if (tile2.slope() > (byte) 0 || tile1.slope() > (byte) 0 || tile2.halfBrick() || tile1.halfBrick()) - flag = false; - if (tile2.type != (ushort) 2 && tile2.type != (ushort) 477 && tile2.type != (ushort) 109 && tile2.type != (ushort) 492) - flag = false; - if (tile1.type != (ushort) 2 && tile1.type != (ushort) 477 && tile1.type != (ushort) 109 && tile1.type != (ushort) 492) - flag = false; - for (int x = reachableStartX - 1; x <= reachableStartX; ++x) - { - for (int y = reachableStartY - 1; y <= reachableStartY; ++y) - { - if (Main.tile[x, y].active() && !WorldGen.CanCutTile(x, y, TileCuttingContext.TilePlacement)) - flag = false; - } - } - if (flag) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY)); - } - else - break; - } - } - if (SmartCursorHelper._targets.Count > 0) - { - float num1 = -1f; - Tuple target = SmartCursorHelper._targets[0]; - for (int index = 0; index < SmartCursorHelper._targets.Count; ++index) - { - float num2 = Vector2.Distance(new Vector2((float) SmartCursorHelper._targets[index].Item1, (float) SmartCursorHelper._targets[index].Item2) * 16f + Vector2.One * 8f, providedInfo.mouse); - if ((double) num1 == -1.0 || (double) num2 < (double) num1) - { - num1 = num2; - target = SmartCursorHelper._targets[index]; - } - } - if (Collision.InTileBounds(target.Item1, target.Item2, providedInfo.reachableStartX, providedInfo.reachableStartY, providedInfo.reachableEndX, providedInfo.reachableEndY)) - { - focusedX = target.Item1; - focusedY = target.Item2; - } - } - SmartCursorHelper._targets.Clear(); - } - - private static void Step_Walls( - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - ref int focusedX, - ref int focusedY) - { - int width = providedInfo.player.width; - int height = providedInfo.player.height; - if (providedInfo.item.createWall <= 0 || focusedX != -1 || focusedY != -1) - return; - SmartCursorHelper._targets.Clear(); - for (int reachableStartX = providedInfo.reachableStartX; reachableStartX <= providedInfo.reachableEndX; ++reachableStartX) - { - for (int reachableStartY = providedInfo.reachableStartY; reachableStartY <= providedInfo.reachableEndY; ++reachableStartY) - { - Tile tile = Main.tile[reachableStartX, reachableStartY]; - if (tile.wall == (ushort) 0 && (!tile.active() || !Main.tileSolid[(int) tile.type] || Main.tileSolidTop[(int) tile.type]) && Collision.CanHitWithCheck(providedInfo.position, width, height, new Vector2((float) reachableStartX, (float) reachableStartY) * 16f, 16, 16, new Utils.TileActionAttempt(DelegateMethods.NotDoorStand))) - { - bool flag = false; - if (Main.tile[reachableStartX - 1, reachableStartY].active() || Main.tile[reachableStartX - 1, reachableStartY].wall > (ushort) 0) - flag = true; - if (Main.tile[reachableStartX + 1, reachableStartY].active() || Main.tile[reachableStartX + 1, reachableStartY].wall > (ushort) 0) - flag = true; - if (Main.tile[reachableStartX, reachableStartY - 1].active() || Main.tile[reachableStartX, reachableStartY - 1].wall > (ushort) 0) - flag = true; - if (Main.tile[reachableStartX, reachableStartY + 1].active() || Main.tile[reachableStartX, reachableStartY + 1].wall > (ushort) 0) - flag = true; - if (WorldGen.IsOpenDoorAnchorFrame(reachableStartX, reachableStartY)) - flag = false; - if (flag) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY)); - } - } - } - if (SmartCursorHelper._targets.Count > 0) - { - float num1 = -1f; - Tuple target = SmartCursorHelper._targets[0]; - for (int index = 0; index < SmartCursorHelper._targets.Count; ++index) - { - float num2 = Vector2.Distance(new Vector2((float) SmartCursorHelper._targets[index].Item1, (float) SmartCursorHelper._targets[index].Item2) * 16f + Vector2.One * 8f, providedInfo.mouse); - if ((double) num1 == -1.0 || (double) num2 < (double) num1) - { - num1 = num2; - target = SmartCursorHelper._targets[index]; - } - } - if (Collision.InTileBounds(target.Item1, target.Item2, providedInfo.reachableStartX, providedInfo.reachableStartY, providedInfo.reachableEndX, providedInfo.reachableEndY)) - { - focusedX = target.Item1; - focusedY = target.Item2; - } - } - SmartCursorHelper._targets.Clear(); - } - - private static void Step_MinecartTracks( - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - ref int focusedX, - ref int focusedY) - { - if ((providedInfo.item.type == 2340 || providedInfo.item.type == 2739) && focusedX == -1 && focusedY == -1) - { - SmartCursorHelper._targets.Clear(); - Vector2 vector2 = (Main.MouseWorld - providedInfo.Center).SafeNormalize(Vector2.UnitY); - double num1 = (double) Vector2.Dot(vector2, -Vector2.UnitY); - bool flag1 = num1 >= 0.5; - bool flag2 = num1 <= -0.5; - double num2 = (double) Vector2.Dot(vector2, Vector2.UnitX); - bool flag3 = num2 >= 0.5; - bool flag4 = num2 <= -0.5; - bool flag5 = flag1 & flag4; - bool flag6 = flag1 & flag3; - bool flag7 = flag2 & flag4; - bool flag8 = flag2 & flag3; - bool flag9; - if (flag5) - flag9 = flag4 = false; - if (flag6) - flag9 = flag3 = false; - bool flag10; - if (flag7) - flag10 = flag4 = false; - if (flag8) - flag10 = flag3 = false; - bool flag11 = false; - if (Main.tile[providedInfo.screenTargetX, providedInfo.screenTargetY].active() && Main.tile[providedInfo.screenTargetX, providedInfo.screenTargetY].type == (ushort) 314) - flag11 = true; - if (!flag11) - { - for (int reachableStartX = providedInfo.reachableStartX; reachableStartX <= providedInfo.reachableEndX; ++reachableStartX) - { - for (int reachableStartY = providedInfo.reachableStartY; reachableStartY <= providedInfo.reachableEndY; ++reachableStartY) - { - Tile tile = Main.tile[reachableStartX, reachableStartY]; - if (tile.active() && tile.type == (ushort) 314) - { - bool flag12 = Main.tile[reachableStartX + 1, reachableStartY + 1].active() && Main.tile[reachableStartX + 1, reachableStartY + 1].type == (ushort) 314; - bool flag13 = Main.tile[reachableStartX + 1, reachableStartY - 1].active() && Main.tile[reachableStartX + 1, reachableStartY - 1].type == (ushort) 314; - bool flag14 = Main.tile[reachableStartX - 1, reachableStartY + 1].active() && Main.tile[reachableStartX - 1, reachableStartY + 1].type == (ushort) 314; - bool flag15 = Main.tile[reachableStartX - 1, reachableStartY - 1].active() && Main.tile[reachableStartX - 1, reachableStartY - 1].type == (ushort) 314; - if (flag5 && (!Main.tile[reachableStartX - 1, reachableStartY - 1].active() || Main.tileCut[(int) Main.tile[reachableStartX - 1, reachableStartY - 1].type] || TileID.Sets.BreakableWhenPlacing[(int) Main.tile[reachableStartX - 1, reachableStartY - 1].type]) && !(!flag12 & flag13) && !flag14) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX - 1, reachableStartY - 1)); - if (flag4 && (!Main.tile[reachableStartX - 1, reachableStartY].active() || Main.tileCut[(int) Main.tile[reachableStartX - 1, reachableStartY].type] || TileID.Sets.BreakableWhenPlacing[(int) Main.tile[reachableStartX - 1, reachableStartY].type])) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX - 1, reachableStartY)); - if (flag7 && (!Main.tile[reachableStartX - 1, reachableStartY + 1].active() || Main.tileCut[(int) Main.tile[reachableStartX - 1, reachableStartY + 1].type] || TileID.Sets.BreakableWhenPlacing[(int) Main.tile[reachableStartX - 1, reachableStartY + 1].type]) && !(!flag13 & flag12) && !flag15) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX - 1, reachableStartY + 1)); - if (flag6 && (!Main.tile[reachableStartX + 1, reachableStartY - 1].active() || Main.tileCut[(int) Main.tile[reachableStartX + 1, reachableStartY - 1].type] || TileID.Sets.BreakableWhenPlacing[(int) Main.tile[reachableStartX + 1, reachableStartY - 1].type]) && !(!flag14 & flag15) && !flag12) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX + 1, reachableStartY - 1)); - if (flag3 && (!Main.tile[reachableStartX + 1, reachableStartY].active() || Main.tileCut[(int) Main.tile[reachableStartX + 1, reachableStartY].type] || TileID.Sets.BreakableWhenPlacing[(int) Main.tile[reachableStartX + 1, reachableStartY].type])) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX + 1, reachableStartY)); - if (flag8 && (!Main.tile[reachableStartX + 1, reachableStartY + 1].active() || Main.tileCut[(int) Main.tile[reachableStartX + 1, reachableStartY + 1].type] || TileID.Sets.BreakableWhenPlacing[(int) Main.tile[reachableStartX + 1, reachableStartY + 1].type]) && !(!flag15 & flag14) && !flag13) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX + 1, reachableStartY + 1)); - } - } - } - } - if (SmartCursorHelper._targets.Count > 0) - { - float num3 = -1f; - Tuple target = SmartCursorHelper._targets[0]; - for (int index = 0; index < SmartCursorHelper._targets.Count; ++index) - { - if ((!Main.tile[SmartCursorHelper._targets[index].Item1, SmartCursorHelper._targets[index].Item2 - 1].active() || Main.tile[SmartCursorHelper._targets[index].Item1, SmartCursorHelper._targets[index].Item2 - 1].type != (ushort) 314) && (!Main.tile[SmartCursorHelper._targets[index].Item1, SmartCursorHelper._targets[index].Item2 + 1].active() || Main.tile[SmartCursorHelper._targets[index].Item1, SmartCursorHelper._targets[index].Item2 + 1].type != (ushort) 314)) - { - float num4 = Vector2.Distance(new Vector2((float) SmartCursorHelper._targets[index].Item1, (float) SmartCursorHelper._targets[index].Item2) * 16f + Vector2.One * 8f, providedInfo.mouse); - if ((double) num3 == -1.0 || (double) num4 < (double) num3) - { - num3 = num4; - target = SmartCursorHelper._targets[index]; - } - } - } - if (Collision.InTileBounds(target.Item1, target.Item2, providedInfo.reachableStartX, providedInfo.reachableStartY, providedInfo.reachableEndX, providedInfo.reachableEndY) && (double) num3 != -1.0) - { - focusedX = target.Item1; - focusedY = target.Item2; - } - } - SmartCursorHelper._targets.Clear(); - } - if (providedInfo.item.type != 2492 || focusedX != -1 || focusedY != -1) - return; - SmartCursorHelper._targets.Clear(); - bool flag = false; - if (Main.tile[providedInfo.screenTargetX, providedInfo.screenTargetY].active() && Main.tile[providedInfo.screenTargetX, providedInfo.screenTargetY].type == (ushort) 314) - flag = true; - if (!flag) - { - for (int reachableStartX = providedInfo.reachableStartX; reachableStartX <= providedInfo.reachableEndX; ++reachableStartX) - { - for (int reachableStartY = providedInfo.reachableStartY; reachableStartY <= providedInfo.reachableEndY; ++reachableStartY) - { - Tile tile = Main.tile[reachableStartX, reachableStartY]; - if (tile.active() && tile.type == (ushort) 314) - { - if (!Main.tile[reachableStartX - 1, reachableStartY].active() || Main.tileCut[(int) Main.tile[reachableStartX - 1, reachableStartY].type] || TileID.Sets.BreakableWhenPlacing[(int) Main.tile[reachableStartX - 1, reachableStartY].type]) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX - 1, reachableStartY)); - if (!Main.tile[reachableStartX + 1, reachableStartY].active() || Main.tileCut[(int) Main.tile[reachableStartX + 1, reachableStartY].type] || TileID.Sets.BreakableWhenPlacing[(int) Main.tile[reachableStartX + 1, reachableStartY].type]) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX + 1, reachableStartY)); - } - } - } - } - if (SmartCursorHelper._targets.Count > 0) - { - float num5 = -1f; - Tuple target = SmartCursorHelper._targets[0]; - for (int index = 0; index < SmartCursorHelper._targets.Count; ++index) - { - if ((!Main.tile[SmartCursorHelper._targets[index].Item1, SmartCursorHelper._targets[index].Item2 - 1].active() || Main.tile[SmartCursorHelper._targets[index].Item1, SmartCursorHelper._targets[index].Item2 - 1].type != (ushort) 314) && (!Main.tile[SmartCursorHelper._targets[index].Item1, SmartCursorHelper._targets[index].Item2 + 1].active() || Main.tile[SmartCursorHelper._targets[index].Item1, SmartCursorHelper._targets[index].Item2 + 1].type != (ushort) 314)) - { - float num6 = Vector2.Distance(new Vector2((float) SmartCursorHelper._targets[index].Item1, (float) SmartCursorHelper._targets[index].Item2) * 16f + Vector2.One * 8f, providedInfo.mouse); - if ((double) num5 == -1.0 || (double) num6 < (double) num5) - { - num5 = num6; - target = SmartCursorHelper._targets[index]; - } - } - } - if (Collision.InTileBounds(target.Item1, target.Item2, providedInfo.reachableStartX, providedInfo.reachableStartY, providedInfo.reachableEndX, providedInfo.reachableEndY) && (double) num5 != -1.0) - { - focusedX = target.Item1; - focusedY = target.Item2; - } - } - SmartCursorHelper._targets.Clear(); - } - - private static void Step_Platforms( - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - ref int focusedX, - ref int focusedY) - { - if (providedInfo.item.createTile < 0 || !TileID.Sets.Platforms[providedInfo.item.createTile] || focusedX != -1 || focusedY != -1) - return; - SmartCursorHelper._targets.Clear(); - bool flag = false; - if (Main.tile[providedInfo.screenTargetX, providedInfo.screenTargetY].active() && TileID.Sets.Platforms[(int) Main.tile[providedInfo.screenTargetX, providedInfo.screenTargetY].type]) - flag = true; - if (!flag) - { - for (int reachableStartX = providedInfo.reachableStartX; reachableStartX <= providedInfo.reachableEndX; ++reachableStartX) - { - for (int reachableStartY = providedInfo.reachableStartY; reachableStartY <= providedInfo.reachableEndY; ++reachableStartY) - { - Tile tile1 = Main.tile[reachableStartX, reachableStartY]; - if (tile1.active() && TileID.Sets.Platforms[(int) tile1.type]) - { - int num = (int) tile1.slope(); - if (num != 2 && !Main.tile[reachableStartX - 1, reachableStartY - 1].active()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX - 1, reachableStartY - 1)); - if (!Main.tile[reachableStartX - 1, reachableStartY].active()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX - 1, reachableStartY)); - if (num != 1 && !Main.tile[reachableStartX - 1, reachableStartY + 1].active()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX - 1, reachableStartY + 1)); - if (num != 1 && !Main.tile[reachableStartX + 1, reachableStartY - 1].active()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX + 1, reachableStartY - 1)); - if (!Main.tile[reachableStartX + 1, reachableStartY].active()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX + 1, reachableStartY)); - if (num != 2 && !Main.tile[reachableStartX + 1, reachableStartY + 1].active()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX + 1, reachableStartY + 1)); - } - if (!tile1.active()) - { - int num1 = 0; - int num2 = 1; - Tile tile2 = Main.tile[reachableStartX + num1, reachableStartY + num2]; - if (tile2.active() && Main.tileSolid[(int) tile2.type] && !Main.tileSolidTop[(int) tile2.type]) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY)); - int num3 = -1; - int num4 = 0; - Tile tile3 = Main.tile[reachableStartX + num3, reachableStartY + num4]; - if (tile3.active() && Main.tileSolid[(int) tile3.type] && !Main.tileSolidTop[(int) tile3.type]) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY)); - int num5 = 1; - int num6 = 0; - Tile tile4 = Main.tile[reachableStartX + num5, reachableStartY + num6]; - if (tile4.active() && Main.tileSolid[(int) tile4.type] && !Main.tileSolidTop[(int) tile4.type]) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY)); - } - } - } - } - if (SmartCursorHelper._targets.Count > 0) - { - float num7 = -1f; - Tuple target = SmartCursorHelper._targets[0]; - for (int index = 0; index < SmartCursorHelper._targets.Count; ++index) - { - float num8 = Vector2.Distance(new Vector2((float) SmartCursorHelper._targets[index].Item1, (float) SmartCursorHelper._targets[index].Item2) * 16f + Vector2.One * 8f, providedInfo.mouse); - if ((double) num7 == -1.0 || (double) num8 < (double) num7) - { - num7 = num8; - target = SmartCursorHelper._targets[index]; - } - } - if (Collision.InTileBounds(target.Item1, target.Item2, providedInfo.reachableStartX, providedInfo.reachableStartY, providedInfo.reachableEndX, providedInfo.reachableEndY)) - { - focusedX = target.Item1; - focusedY = target.Item2; - } - } - SmartCursorHelper._targets.Clear(); - } - - private static void Step_WireCutter( - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - ref int focusedX, - ref int focusedY) - { - if (providedInfo.item.type != 510 || focusedX != -1 || focusedY != -1) - return; - SmartCursorHelper._targets.Clear(); - for (int reachableStartX = providedInfo.reachableStartX; reachableStartX <= providedInfo.reachableEndX; ++reachableStartX) - { - for (int reachableStartY = providedInfo.reachableStartY; reachableStartY <= providedInfo.reachableEndY; ++reachableStartY) - { - Tile tile = Main.tile[reachableStartX, reachableStartY]; - if (tile.wire() || tile.wire2() || tile.wire3() || tile.wire4() || tile.actuator()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY)); - } - } - if (SmartCursorHelper._targets.Count > 0) - { - float num1 = -1f; - Tuple target = SmartCursorHelper._targets[0]; - for (int index = 0; index < SmartCursorHelper._targets.Count; ++index) - { - float num2 = Vector2.Distance(new Vector2((float) SmartCursorHelper._targets[index].Item1, (float) SmartCursorHelper._targets[index].Item2) * 16f + Vector2.One * 8f, providedInfo.mouse); - if ((double) num1 == -1.0 || (double) num2 < (double) num1) - { - num1 = num2; - target = SmartCursorHelper._targets[index]; - } - } - if (Collision.InTileBounds(target.Item1, target.Item2, providedInfo.reachableStartX, providedInfo.reachableStartY, providedInfo.reachableEndX, providedInfo.reachableEndY)) - { - focusedX = target.Item1; - focusedY = target.Item2; - } - } - SmartCursorHelper._targets.Clear(); - } - - private static void Step_ActuationRod( - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - ref int focusedX, - ref int focusedY) - { - bool actuationRodLock = providedInfo.player.ActuationRodLock; - bool actuationRodLockSetting = providedInfo.player.ActuationRodLockSetting; - if (providedInfo.item.type != 3620 || focusedX != -1 || focusedY != -1) - return; - SmartCursorHelper._targets.Clear(); - for (int reachableStartX = providedInfo.reachableStartX; reachableStartX <= providedInfo.reachableEndX; ++reachableStartX) - { - for (int reachableStartY = providedInfo.reachableStartY; reachableStartY <= providedInfo.reachableEndY; ++reachableStartY) - { - Tile tile = Main.tile[reachableStartX, reachableStartY]; - if (tile.active() && tile.actuator() && (!actuationRodLock || actuationRodLockSetting == tile.inActive())) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY)); - } - } - if (SmartCursorHelper._targets.Count > 0) - { - float num1 = -1f; - Tuple target = SmartCursorHelper._targets[0]; - for (int index = 0; index < SmartCursorHelper._targets.Count; ++index) - { - float num2 = Vector2.Distance(new Vector2((float) SmartCursorHelper._targets[index].Item1, (float) SmartCursorHelper._targets[index].Item2) * 16f + Vector2.One * 8f, providedInfo.mouse); - if ((double) num1 == -1.0 || (double) num2 < (double) num1) - { - num1 = num2; - target = SmartCursorHelper._targets[index]; - } - } - if (Collision.InTileBounds(target.Item1, target.Item2, providedInfo.reachableStartX, providedInfo.reachableStartY, providedInfo.reachableEndX, providedInfo.reachableEndY)) - { - focusedX = target.Item1; - focusedY = target.Item2; - } - } - SmartCursorHelper._targets.Clear(); - } - - private static void Step_Hammers( - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - ref int focusedX, - ref int focusedY) - { - int width = providedInfo.player.width; - int height = providedInfo.player.height; - if (providedInfo.item.hammer > 0 && focusedX == -1 && focusedY == -1) - { - Vector2 vector2 = providedInfo.mouse - providedInfo.Center; - int num1 = Math.Sign(vector2.X); - int num2 = Math.Sign(vector2.Y); - if ((double) Math.Abs(vector2.X) > (double) Math.Abs(vector2.Y) * 3.0) - { - num2 = 0; - providedInfo.mouse.Y = providedInfo.Center.Y; - } - if ((double) Math.Abs(vector2.Y) > (double) Math.Abs(vector2.X) * 3.0) - { - num1 = 0; - providedInfo.mouse.X = providedInfo.Center.X; - } - int num3 = (int) providedInfo.Center.X / 16; - int num4 = (int) providedInfo.Center.Y / 16; - SmartCursorHelper._points.Clear(); - SmartCursorHelper._endpoints.Clear(); - int num5 = 1; - if (num2 == -1 && num1 != 0) - num5 = -1; - int index1 = (int) (((double) providedInfo.position.X + (double) (width / 2) + (double) ((width / 2 - 1) * num1)) / 16.0); - int index2 = (int) (((double) providedInfo.position.Y + 0.1) / 16.0); - if (num5 == -1) - index2 = (int) (((double) providedInfo.position.Y + (double) height - 1.0) / 16.0); - int num6 = width / 16 + (width % 16 == 0 ? 0 : 1); - int num7 = height / 16 + (height % 16 == 0 ? 0 : 1); - if (num1 != 0) - { - for (int index3 = 0; index3 < num7; ++index3) - { - if (Main.tile[index1, index2 + index3 * num5] != null) - SmartCursorHelper._points.Add(new Tuple(index1, index2 + index3 * num5)); - } - } - if (num2 != 0) - { - for (int index4 = 0; index4 < num6; ++index4) - { - if (Main.tile[(int) ((double) providedInfo.position.X / 16.0) + index4, index2] != null) - SmartCursorHelper._points.Add(new Tuple((int) ((double) providedInfo.position.X / 16.0) + index4, index2)); - } - } - int index5 = (int) (((double) providedInfo.mouse.X + (double) ((width / 2 - 1) * num1)) / 16.0); - int index6 = (int) (((double) providedInfo.mouse.Y + 0.1 - (double) (height / 2 + 1)) / 16.0); - if (num5 == -1) - index6 = (int) (((double) providedInfo.mouse.Y + (double) (height / 2) - 1.0) / 16.0); - if ((double) providedInfo.player.gravDir == -1.0 && num2 == 0) - ++index6; - if (index6 < 10) - index6 = 10; - if (index6 > Main.maxTilesY - 10) - index6 = Main.maxTilesY - 10; - int num8 = width / 16 + (width % 16 == 0 ? 0 : 1); - int num9 = height / 16 + (height % 16 == 0 ? 0 : 1); - if (num1 != 0) - { - for (int index7 = 0; index7 < num9; ++index7) - { - if (Main.tile[index5, index6 + index7 * num5] != null) - SmartCursorHelper._endpoints.Add(new Tuple(index5, index6 + index7 * num5)); - } - } - if (num2 != 0) - { - for (int index8 = 0; index8 < num8; ++index8) - { - if (Main.tile[(int) (((double) providedInfo.mouse.X - (double) (width / 2)) / 16.0) + index8, index6] != null) - SmartCursorHelper._endpoints.Add(new Tuple((int) (((double) providedInfo.mouse.X - (double) (width / 2)) / 16.0) + index8, index6)); - } - } - SmartCursorHelper._targets.Clear(); - while (SmartCursorHelper._points.Count > 0) - { - Tuple point = SmartCursorHelper._points[0]; - Tuple endpoint = SmartCursorHelper._endpoints[0]; - Tuple tuple = Collision.TupleHitLineWall(point.Item1, point.Item2, endpoint.Item1, endpoint.Item2); - if (tuple.Item1 == -1 || tuple.Item2 == -1) - { - SmartCursorHelper._points.Remove(point); - SmartCursorHelper._endpoints.Remove(endpoint); - } - else - { - if (tuple.Item1 != endpoint.Item1 || tuple.Item2 != endpoint.Item2) - SmartCursorHelper._targets.Add(tuple); - Tile tile = Main.tile[tuple.Item1, tuple.Item2]; - if (Collision.HitWallSubstep(tuple.Item1, tuple.Item2)) - SmartCursorHelper._targets.Add(tuple); - SmartCursorHelper._points.Remove(point); - SmartCursorHelper._endpoints.Remove(endpoint); - } - } - if (SmartCursorHelper._targets.Count > 0) - { - float num10 = -1f; - Tuple tuple = (Tuple) null; - for (int index9 = 0; index9 < SmartCursorHelper._targets.Count; ++index9) - { - if (!Main.tile[SmartCursorHelper._targets[index9].Item1, SmartCursorHelper._targets[index9].Item2].active() || Main.tile[SmartCursorHelper._targets[index9].Item1, SmartCursorHelper._targets[index9].Item2].type != (ushort) 26) - { - float num11 = Vector2.Distance(new Vector2((float) SmartCursorHelper._targets[index9].Item1, (float) SmartCursorHelper._targets[index9].Item2) * 16f + Vector2.One * 8f, providedInfo.Center); - if ((double) num10 == -1.0 || (double) num11 < (double) num10) - { - num10 = num11; - tuple = SmartCursorHelper._targets[index9]; - } - } - } - if (tuple != null && Collision.InTileBounds(tuple.Item1, tuple.Item2, providedInfo.reachableStartX, providedInfo.reachableStartY, providedInfo.reachableEndX, providedInfo.reachableEndY)) - { - providedInfo.player.poundRelease = false; - focusedX = tuple.Item1; - focusedY = tuple.Item2; - } - } - SmartCursorHelper._targets.Clear(); - SmartCursorHelper._points.Clear(); - SmartCursorHelper._endpoints.Clear(); - } - if (providedInfo.item.hammer <= 0 || focusedX != -1 || focusedY != -1) - return; - SmartCursorHelper._targets.Clear(); - for (int reachableStartX = providedInfo.reachableStartX; reachableStartX <= providedInfo.reachableEndX; ++reachableStartX) - { - for (int reachableStartY = providedInfo.reachableStartY; reachableStartY <= providedInfo.reachableEndY; ++reachableStartY) - { - if (Main.tile[reachableStartX, reachableStartY].wall > (ushort) 0 && Collision.HitWallSubstep(reachableStartX, reachableStartY)) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY)); - } - } - if (SmartCursorHelper._targets.Count > 0) - { - float num12 = -1f; - Tuple tuple = (Tuple) null; - for (int index = 0; index < SmartCursorHelper._targets.Count; ++index) - { - if (!Main.tile[SmartCursorHelper._targets[index].Item1, SmartCursorHelper._targets[index].Item2].active() || Main.tile[SmartCursorHelper._targets[index].Item1, SmartCursorHelper._targets[index].Item2].type != (ushort) 26) - { - float num13 = Vector2.Distance(new Vector2((float) SmartCursorHelper._targets[index].Item1, (float) SmartCursorHelper._targets[index].Item2) * 16f + Vector2.One * 8f, providedInfo.mouse); - if ((double) num12 == -1.0 || (double) num13 < (double) num12) - { - num12 = num13; - tuple = SmartCursorHelper._targets[index]; - } - } - } - if (tuple != null && Collision.InTileBounds(tuple.Item1, tuple.Item2, providedInfo.reachableStartX, providedInfo.reachableStartY, providedInfo.reachableEndX, providedInfo.reachableEndY)) - { - providedInfo.player.poundRelease = false; - focusedX = tuple.Item1; - focusedY = tuple.Item2; - } - } - SmartCursorHelper._targets.Clear(); - } - - private static void Step_MulticolorWrench( - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - ref int focusedX, - ref int focusedY) - { - if (providedInfo.item.type != 3625 || focusedX != -1 || focusedY != -1) - return; - SmartCursorHelper._targets.Clear(); - WiresUI.Settings.MultiToolMode toolMode1 = WiresUI.Settings.ToolMode; - WiresUI.Settings.MultiToolMode multiToolMode = (WiresUI.Settings.MultiToolMode) 0; - if (Main.tile[providedInfo.screenTargetX, providedInfo.screenTargetY].wire()) - multiToolMode |= WiresUI.Settings.MultiToolMode.Red; - if (Main.tile[providedInfo.screenTargetX, providedInfo.screenTargetY].wire2()) - multiToolMode |= WiresUI.Settings.MultiToolMode.Blue; - if (Main.tile[providedInfo.screenTargetX, providedInfo.screenTargetY].wire3()) - multiToolMode |= WiresUI.Settings.MultiToolMode.Green; - if (Main.tile[providedInfo.screenTargetX, providedInfo.screenTargetY].wire4()) - multiToolMode |= WiresUI.Settings.MultiToolMode.Yellow; - int num1 = (toolMode1 & ~WiresUI.Settings.MultiToolMode.Cutter) == multiToolMode ? 1 : 0; - WiresUI.Settings.MultiToolMode toolMode2 = WiresUI.Settings.ToolMode; - if (num1 == 0) - { - bool flag1 = toolMode2.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Red); - bool flag2 = toolMode2.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Blue); - bool flag3 = toolMode2.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Green); - bool flag4 = toolMode2.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Yellow); - bool flag5 = toolMode2.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Cutter); - for (int reachableStartX = providedInfo.reachableStartX; reachableStartX <= providedInfo.reachableEndX; ++reachableStartX) - { - for (int reachableStartY = providedInfo.reachableStartY; reachableStartY <= providedInfo.reachableEndY; ++reachableStartY) - { - Tile tile = Main.tile[reachableStartX, reachableStartY]; - if (flag5) - { - if (tile.wire() & flag1 || tile.wire2() & flag2 || tile.wire3() & flag3 || tile.wire4() & flag4) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY)); - } - else if (tile.wire() & flag1 || tile.wire2() & flag2 || tile.wire3() & flag3 || tile.wire4() & flag4) - { - if (flag1) - { - if (!Main.tile[reachableStartX - 1, reachableStartY].wire()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX - 1, reachableStartY)); - if (!Main.tile[reachableStartX + 1, reachableStartY].wire()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX + 1, reachableStartY)); - if (!Main.tile[reachableStartX, reachableStartY - 1].wire()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY - 1)); - if (!Main.tile[reachableStartX, reachableStartY + 1].wire()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY + 1)); - } - if (flag2) - { - if (!Main.tile[reachableStartX - 1, reachableStartY].wire2()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX - 1, reachableStartY)); - if (!Main.tile[reachableStartX + 1, reachableStartY].wire2()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX + 1, reachableStartY)); - if (!Main.tile[reachableStartX, reachableStartY - 1].wire2()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY - 1)); - if (!Main.tile[reachableStartX, reachableStartY + 1].wire2()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY + 1)); - } - if (flag3) - { - if (!Main.tile[reachableStartX - 1, reachableStartY].wire3()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX - 1, reachableStartY)); - if (!Main.tile[reachableStartX + 1, reachableStartY].wire3()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX + 1, reachableStartY)); - if (!Main.tile[reachableStartX, reachableStartY - 1].wire3()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY - 1)); - if (!Main.tile[reachableStartX, reachableStartY + 1].wire3()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY + 1)); - } - if (flag4) - { - if (!Main.tile[reachableStartX - 1, reachableStartY].wire4()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX - 1, reachableStartY)); - if (!Main.tile[reachableStartX + 1, reachableStartY].wire4()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX + 1, reachableStartY)); - if (!Main.tile[reachableStartX, reachableStartY - 1].wire4()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY - 1)); - if (!Main.tile[reachableStartX, reachableStartY + 1].wire4()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY + 1)); - } - } - } - } - } - if (SmartCursorHelper._targets.Count > 0) - { - float num2 = -1f; - Tuple target = SmartCursorHelper._targets[0]; - for (int index = 0; index < SmartCursorHelper._targets.Count; ++index) - { - float num3 = Vector2.Distance(new Vector2((float) SmartCursorHelper._targets[index].Item1, (float) SmartCursorHelper._targets[index].Item2) * 16f + Vector2.One * 8f, providedInfo.mouse); - if ((double) num2 == -1.0 || (double) num3 < (double) num2) - { - num2 = num3; - target = SmartCursorHelper._targets[index]; - } - } - if (Collision.InTileBounds(target.Item1, target.Item2, providedInfo.reachableStartX, providedInfo.reachableStartY, providedInfo.reachableEndX, providedInfo.reachableEndY)) - { - focusedX = target.Item1; - focusedY = target.Item2; - } - } - SmartCursorHelper._targets.Clear(); - } - - private static void Step_ColoredWrenches( - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - ref int focusedX, - ref int focusedY) - { - if (providedInfo.item.type != 509 && providedInfo.item.type != 850 && providedInfo.item.type != 851 && providedInfo.item.type != 3612 || focusedX != -1 || focusedY != -1) - return; - SmartCursorHelper._targets.Clear(); - int num1 = 0; - if (providedInfo.item.type == 509) - num1 = 1; - if (providedInfo.item.type == 850) - num1 = 2; - if (providedInfo.item.type == 851) - num1 = 3; - if (providedInfo.item.type == 3612) - num1 = 4; - bool flag = false; - if (Main.tile[providedInfo.screenTargetX, providedInfo.screenTargetY].wire() && num1 == 1) - flag = true; - if (Main.tile[providedInfo.screenTargetX, providedInfo.screenTargetY].wire2() && num1 == 2) - flag = true; - if (Main.tile[providedInfo.screenTargetX, providedInfo.screenTargetY].wire3() && num1 == 3) - flag = true; - if (Main.tile[providedInfo.screenTargetX, providedInfo.screenTargetY].wire4() && num1 == 4) - flag = true; - if (!flag) - { - for (int reachableStartX = providedInfo.reachableStartX; reachableStartX <= providedInfo.reachableEndX; ++reachableStartX) - { - for (int reachableStartY = providedInfo.reachableStartY; reachableStartY <= providedInfo.reachableEndY; ++reachableStartY) - { - Tile tile = Main.tile[reachableStartX, reachableStartY]; - if (tile.wire() && num1 == 1 || tile.wire2() && num1 == 2 || tile.wire3() && num1 == 3 || tile.wire4() && num1 == 4) - { - if (num1 == 1) - { - if (!Main.tile[reachableStartX - 1, reachableStartY].wire()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX - 1, reachableStartY)); - if (!Main.tile[reachableStartX + 1, reachableStartY].wire()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX + 1, reachableStartY)); - if (!Main.tile[reachableStartX, reachableStartY - 1].wire()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY - 1)); - if (!Main.tile[reachableStartX, reachableStartY + 1].wire()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY + 1)); - } - if (num1 == 2) - { - if (!Main.tile[reachableStartX - 1, reachableStartY].wire2()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX - 1, reachableStartY)); - if (!Main.tile[reachableStartX + 1, reachableStartY].wire2()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX + 1, reachableStartY)); - if (!Main.tile[reachableStartX, reachableStartY - 1].wire2()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY - 1)); - if (!Main.tile[reachableStartX, reachableStartY + 1].wire2()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY + 1)); - } - if (num1 == 3) - { - if (!Main.tile[reachableStartX - 1, reachableStartY].wire3()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX - 1, reachableStartY)); - if (!Main.tile[reachableStartX + 1, reachableStartY].wire3()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX + 1, reachableStartY)); - if (!Main.tile[reachableStartX, reachableStartY - 1].wire3()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY - 1)); - if (!Main.tile[reachableStartX, reachableStartY + 1].wire3()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY + 1)); - } - if (num1 == 4) - { - if (!Main.tile[reachableStartX - 1, reachableStartY].wire4()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX - 1, reachableStartY)); - if (!Main.tile[reachableStartX + 1, reachableStartY].wire4()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX + 1, reachableStartY)); - if (!Main.tile[reachableStartX, reachableStartY - 1].wire4()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY - 1)); - if (!Main.tile[reachableStartX, reachableStartY + 1].wire4()) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY + 1)); - } - } - } - } - } - if (SmartCursorHelper._targets.Count > 0) - { - float num2 = -1f; - Tuple target = SmartCursorHelper._targets[0]; - for (int index = 0; index < SmartCursorHelper._targets.Count; ++index) - { - float num3 = Vector2.Distance(new Vector2((float) SmartCursorHelper._targets[index].Item1, (float) SmartCursorHelper._targets[index].Item2) * 16f + Vector2.One * 8f, providedInfo.mouse); - if ((double) num2 == -1.0 || (double) num3 < (double) num2) - { - num2 = num3; - target = SmartCursorHelper._targets[index]; - } - } - if (Collision.InTileBounds(target.Item1, target.Item2, providedInfo.reachableStartX, providedInfo.reachableStartY, providedInfo.reachableEndX, providedInfo.reachableEndY)) - { - focusedX = target.Item1; - focusedY = target.Item2; - } - } - SmartCursorHelper._targets.Clear(); - } - - private static void Step_Acorns( - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - ref int focusedX, - ref int focusedY) - { - if (providedInfo.item.type != 27 || focusedX != -1 || focusedY != -1 || providedInfo.reachableStartY <= 20) - return; - SmartCursorHelper._targets.Clear(); - for (int reachableStartX = providedInfo.reachableStartX; reachableStartX <= providedInfo.reachableEndX; ++reachableStartX) - { - for (int reachableStartY = providedInfo.reachableStartY; reachableStartY <= providedInfo.reachableEndY; ++reachableStartY) - { - Tile tile1 = Main.tile[reachableStartX, reachableStartY]; - Tile tile2 = Main.tile[reachableStartX, reachableStartY - 1]; - Tile testTile = Main.tile[reachableStartX, reachableStartY + 1]; - Tile tile3 = Main.tile[reachableStartX - 1, reachableStartY]; - Tile tile4 = Main.tile[reachableStartX + 1, reachableStartY]; - Tile tile5 = Main.tile[reachableStartX - 2, reachableStartY]; - Tile tile6 = Main.tile[reachableStartX + 2, reachableStartY]; - Tile tile7 = Main.tile[reachableStartX - 3, reachableStartY]; - Tile tile8 = Main.tile[reachableStartX + 3, reachableStartY]; - if ((!tile1.active() || Main.tileCut[(int) tile1.type] || TileID.Sets.BreakableWhenPlacing[(int) tile1.type]) && (!tile2.active() || Main.tileCut[(int) tile2.type] || TileID.Sets.BreakableWhenPlacing[(int) tile2.type]) && (!tile3.active() || !TileID.Sets.CommonSapling[(int) tile3.type]) && (!tile4.active() || !TileID.Sets.CommonSapling[(int) tile4.type]) && (!tile5.active() || !TileID.Sets.CommonSapling[(int) tile5.type]) && (!tile6.active() || !TileID.Sets.CommonSapling[(int) tile6.type]) && (!tile7.active() || !TileID.Sets.CommonSapling[(int) tile7.type]) && (!tile8.active() || !TileID.Sets.CommonSapling[(int) tile8.type]) && testTile.active() && WorldGen.SolidTile2(testTile)) - { - switch (testTile.type) - { - case 2: - case 23: - case 53: - case 109: - case 112: - case 116: - case 147: - case 199: - case 234: - case 477: - case 492: - if (tile3.liquid == (byte) 0 && tile1.liquid == (byte) 0 && tile4.liquid == (byte) 0 && WorldGen.EmptyTileCheck(reachableStartX - 2, reachableStartX + 2, reachableStartY - 20, reachableStartY, 20)) - { - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY)); - continue; - } - continue; - case 60: - if (WorldGen.EmptyTileCheck(reachableStartX - 2, reachableStartX + 2, reachableStartY - 20, reachableStartY, 20)) - { - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY)); - continue; - } - continue; - default: - continue; - } - } - } - } - SmartCursorHelper._toRemove.Clear(); - for (int index1 = 0; index1 < SmartCursorHelper._targets.Count; ++index1) - { - bool flag = false; - for (int index2 = -1; index2 < 2; index2 += 2) - { - Tile tile = Main.tile[SmartCursorHelper._targets[index1].Item1 + index2, SmartCursorHelper._targets[index1].Item2 + 1]; - if (tile.active()) - { - switch (tile.type) - { - case 2: - case 23: - case 53: - case 60: - case 109: - case 112: - case 116: - case 147: - case 199: - case 234: - case 477: - case 492: - flag = true; - continue; - default: - continue; - } - } - } - if (!flag) - SmartCursorHelper._toRemove.Add(SmartCursorHelper._targets[index1]); - } - for (int index = 0; index < SmartCursorHelper._toRemove.Count; ++index) - SmartCursorHelper._targets.Remove(SmartCursorHelper._toRemove[index]); - SmartCursorHelper._toRemove.Clear(); - if (SmartCursorHelper._targets.Count > 0) - { - float num1 = -1f; - Tuple target = SmartCursorHelper._targets[0]; - for (int index = 0; index < SmartCursorHelper._targets.Count; ++index) - { - float num2 = Vector2.Distance(new Vector2((float) SmartCursorHelper._targets[index].Item1, (float) SmartCursorHelper._targets[index].Item2) * 16f + Vector2.One * 8f, providedInfo.mouse); - if ((double) num1 == -1.0 || (double) num2 < (double) num1) - { - num1 = num2; - target = SmartCursorHelper._targets[index]; - } - } - if (Collision.InTileBounds(target.Item1, target.Item2, providedInfo.reachableStartX, providedInfo.reachableStartY, providedInfo.reachableEndX, providedInfo.reachableEndY)) - { - focusedX = target.Item1; - focusedY = target.Item2; - } - } - SmartCursorHelper._targets.Clear(); - } - - private static void Step_GemCorns( - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - ref int focusedX, - ref int focusedY) - { - WorldGen.GrowTreeSettings profile; - if (!WorldGen.GrowTreeSettings.Profiles.TryGetFromItemId(providedInfo.item.type, out profile) || focusedX != -1 || focusedY != -1 || providedInfo.reachableStartY <= 20) - return; - SmartCursorHelper._targets.Clear(); - for (int reachableStartX = providedInfo.reachableStartX; reachableStartX <= providedInfo.reachableEndX; ++reachableStartX) - { - for (int reachableStartY = providedInfo.reachableStartY; reachableStartY <= providedInfo.reachableEndY; ++reachableStartY) - { - Tile tile1 = Main.tile[reachableStartX, reachableStartY]; - Tile tile2 = Main.tile[reachableStartX, reachableStartY - 1]; - Tile testTile = Main.tile[reachableStartX, reachableStartY + 1]; - Tile tile3 = Main.tile[reachableStartX - 1, reachableStartY]; - Tile tile4 = Main.tile[reachableStartX + 1, reachableStartY]; - Tile tile5 = Main.tile[reachableStartX - 2, reachableStartY]; - Tile tile6 = Main.tile[reachableStartX + 2, reachableStartY]; - Tile tile7 = Main.tile[reachableStartX - 3, reachableStartY]; - Tile tile8 = Main.tile[reachableStartX + 3, reachableStartY]; - if (profile.GroundTest((int) testTile.type) && (!tile1.active() || Main.tileCut[(int) tile1.type] || TileID.Sets.BreakableWhenPlacing[(int) tile1.type]) && (!tile2.active() || Main.tileCut[(int) tile2.type] || TileID.Sets.BreakableWhenPlacing[(int) tile2.type]) && (!tile3.active() || !TileID.Sets.CommonSapling[(int) tile3.type]) && (!tile4.active() || !TileID.Sets.CommonSapling[(int) tile4.type]) && (!tile5.active() || !TileID.Sets.CommonSapling[(int) tile5.type]) && (!tile6.active() || !TileID.Sets.CommonSapling[(int) tile6.type]) && (!tile7.active() || !TileID.Sets.CommonSapling[(int) tile7.type]) && (!tile8.active() || !TileID.Sets.CommonSapling[(int) tile8.type]) && testTile.active() && WorldGen.SolidTile2(testTile) && tile3.liquid == (byte) 0 && tile1.liquid == (byte) 0 && tile4.liquid == (byte) 0 && WorldGen.EmptyTileCheck(reachableStartX - 2, reachableStartX + 2, reachableStartY - profile.TreeHeightMax, reachableStartY, (int) profile.SaplingTileType)) - SmartCursorHelper._targets.Add(new Tuple(reachableStartX, reachableStartY)); - } - } - SmartCursorHelper._toRemove.Clear(); - for (int index1 = 0; index1 < SmartCursorHelper._targets.Count; ++index1) - { - bool flag = false; - for (int index2 = -1; index2 < 2; index2 += 2) - { - Tile tile = Main.tile[SmartCursorHelper._targets[index1].Item1 + index2, SmartCursorHelper._targets[index1].Item2 + 1]; - if (tile.active() && profile.GroundTest((int) tile.type)) - flag = true; - } - if (!flag) - SmartCursorHelper._toRemove.Add(SmartCursorHelper._targets[index1]); - } - for (int index = 0; index < SmartCursorHelper._toRemove.Count; ++index) - SmartCursorHelper._targets.Remove(SmartCursorHelper._toRemove[index]); - SmartCursorHelper._toRemove.Clear(); - if (SmartCursorHelper._targets.Count > 0) - { - float num1 = -1f; - Tuple target = SmartCursorHelper._targets[0]; - for (int index = 0; index < SmartCursorHelper._targets.Count; ++index) - { - float num2 = Vector2.Distance(new Vector2((float) SmartCursorHelper._targets[index].Item1, (float) SmartCursorHelper._targets[index].Item2) * 16f + Vector2.One * 8f, providedInfo.mouse); - if ((double) num1 == -1.0 || (double) num2 < (double) num1) - { - num1 = num2; - target = SmartCursorHelper._targets[index]; - } - } - if (Collision.InTileBounds(target.Item1, target.Item2, providedInfo.reachableStartX, providedInfo.reachableStartY, providedInfo.reachableEndX, providedInfo.reachableEndY)) - { - focusedX = target.Item1; - focusedY = target.Item2; - } - } - SmartCursorHelper._targets.Clear(); - } - - private static void Step_ForceCursorToAnyMinableThing( - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - ref int fX, - ref int fY) - { - int reachableStartX = providedInfo.reachableStartX; - int reachableStartY = providedInfo.reachableStartY; - int reachableEndX = providedInfo.reachableEndX; - int reachableEndY = providedInfo.reachableEndY; - int screenTargetX = providedInfo.screenTargetX; - int screenTargetY = providedInfo.screenTargetY; - Vector2 mouse = providedInfo.mouse; - Item obj = providedInfo.item; - if (fX != -1 || fY != -1 || PlayerInput.UsingGamepad) - return; - Point tileCoordinates = mouse.ToTileCoordinates(); - int x = tileCoordinates.X; - int y = tileCoordinates.Y; - if (!Collision.InTileBounds(x, y, reachableStartX, reachableStartY, reachableEndX, reachableEndY)) - return; - Tile tile = Main.tile[x, y]; - bool flag = tile.active() && WorldGen.CanKillTile(x, y) && (!Main.tileSolid[(int) tile.type] || Main.tileSolidTop[(int) tile.type]); - if (flag && Main.tileAxe[(int) tile.type] && obj.axe < 1) - flag = false; - if (flag && Main.tileHammer[(int) tile.type] && obj.hammer < 1) - flag = false; - if (flag && !Main.tileHammer[(int) tile.type] && !Main.tileAxe[(int) tile.type] && obj.pick < 1) - flag = false; - if (!flag) - return; - fX = x; - fY = y; - } - - private static void Step_Pickaxe_MineShinies( - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - ref int fX, - ref int fY) - { - int reachableStartX = providedInfo.reachableStartX; - int reachableStartY = providedInfo.reachableStartY; - int reachableEndX = providedInfo.reachableEndX; - int reachableEndY = providedInfo.reachableEndY; - int screenTargetX = providedInfo.screenTargetX; - int screenTargetY = providedInfo.screenTargetY; - Item obj = providedInfo.item; - Vector2 mouse = providedInfo.mouse; - if (obj.pick <= 0 || fX != -1 || fY != -1) - return; - SmartCursorHelper._targets.Clear(); - int num1 = obj.type == 1333 || obj.type == 523 ? 0 : (obj.type != 4384 ? 1 : 0); - int num2 = 0; - for (int index1 = reachableStartX; index1 <= reachableEndX; ++index1) - { - for (int index2 = reachableStartY; index2 <= reachableEndY; ++index2) - { - Tile tile1 = Main.tile[index1, index2]; - Tile tile2 = Main.tile[index1 - 1, index2]; - Tile tile3 = Main.tile[index1 + 1, index2]; - Tile tile4 = Main.tile[index1, index2 + 1]; - if (tile1.active()) - { - int num3; - int num4 = num3 = TileID.Sets.SmartCursorPickaxePriorityOverride[(int) tile1.type]; - if (num4 > 0) - { - if (num2 < num4) - num2 = num4; - SmartCursorHelper._targets.Add(new Tuple(index1, index2)); - } - } - } - } - SmartCursorHelper._targets2.Clear(); - foreach (Tuple tuple in SmartCursorHelper._targets2) - { - Tile tile = Main.tile[tuple.Item1, tuple.Item2]; - if (TileID.Sets.SmartCursorPickaxePriorityOverride[(int) tile.type] < num2) - SmartCursorHelper._targets2.Add(tuple); - } - foreach (Tuple tuple in SmartCursorHelper._targets2) - SmartCursorHelper._targets.Remove(tuple); - if (SmartCursorHelper._targets.Count > 0) - { - float num5 = -1f; - Tuple target = SmartCursorHelper._targets[0]; - for (int index = 0; index < SmartCursorHelper._targets.Count; ++index) - { - float num6 = Vector2.Distance(new Vector2((float) SmartCursorHelper._targets[index].Item1, (float) SmartCursorHelper._targets[index].Item2) * 16f + Vector2.One * 8f, mouse); - if ((double) num5 == -1.0 || (double) num6 < (double) num5) - { - num5 = num6; - target = SmartCursorHelper._targets[index]; - } - } - if (Collision.InTileBounds(target.Item1, target.Item2, reachableStartX, reachableStartY, reachableEndX, reachableEndY)) - { - fX = target.Item1; - fY = target.Item2; - } - } - SmartCursorHelper._targets.Clear(); - } - - private static void Step_Pickaxe_MineSolids( - Player player, - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - List> grappleTargets, - ref int focusedX, - ref int focusedY) - { - int width = player.width; - int height = player.height; - int direction = player.direction; - Vector2 center = player.Center; - Vector2 position = player.position; - float gravDir = player.gravDir; - int whoAmI = player.whoAmI; - if (providedInfo.item.pick <= 0 || focusedX != -1 || focusedY != -1) - return; - if (PlayerInput.UsingGamepad) - { - Vector2 navigatorDirections = PlayerInput.Triggers.Current.GetNavigatorDirections(); - Vector2 gamepadThumbstickLeft = PlayerInput.GamepadThumbstickLeft; - Vector2 gamepadThumbstickRight = PlayerInput.GamepadThumbstickRight; - Vector2 zero = Vector2.Zero; - if (navigatorDirections == zero && (double) gamepadThumbstickLeft.Length() < 0.0500000007450581 && (double) gamepadThumbstickRight.Length() < 0.0500000007450581) - providedInfo.mouse = center + new Vector2((float) (direction * 1000), 0.0f); - } - Vector2 vector2_1 = providedInfo.mouse - center; - int num1 = Math.Sign(vector2_1.X); - int num2 = Math.Sign(vector2_1.Y); - if ((double) Math.Abs(vector2_1.X) > (double) Math.Abs(vector2_1.Y) * 3.0) - { - num2 = 0; - providedInfo.mouse.Y = center.Y; - } - if ((double) Math.Abs(vector2_1.Y) > (double) Math.Abs(vector2_1.X) * 3.0) - { - num1 = 0; - providedInfo.mouse.X = center.X; - } - int num3 = (int) center.X / 16; - int num4 = (int) center.Y / 16; - SmartCursorHelper._points.Clear(); - SmartCursorHelper._endpoints.Clear(); - int num5 = 1; - if (num2 == -1 && num1 != 0) - num5 = -1; - int index1 = (int) (((double) position.X + (double) (width / 2) + (double) ((width / 2 - 1) * num1)) / 16.0); - int index2 = (int) (((double) position.Y + 0.1) / 16.0); - if (num5 == -1) - index2 = (int) (((double) position.Y + (double) height - 1.0) / 16.0); - int num6 = width / 16 + (width % 16 == 0 ? 0 : 1); - int num7 = height / 16 + (height % 16 == 0 ? 0 : 1); - if (num1 != 0) - { - for (int index3 = 0; index3 < num7; ++index3) - { - if (Main.tile[index1, index2 + index3 * num5] != null) - SmartCursorHelper._points.Add(new Tuple(index1, index2 + index3 * num5)); - } - } - if (num2 != 0) - { - for (int index4 = 0; index4 < num6; ++index4) - { - if (Main.tile[(int) ((double) position.X / 16.0) + index4, index2] != null) - SmartCursorHelper._points.Add(new Tuple((int) ((double) position.X / 16.0) + index4, index2)); - } - } - int x = (int) (((double) providedInfo.mouse.X + (double) ((width / 2 - 1) * num1)) / 16.0); - int y = (int) (((double) providedInfo.mouse.Y + 0.1 - (double) (height / 2 + 1)) / 16.0); - if (num5 == -1) - y = (int) (((double) providedInfo.mouse.Y + (double) (height / 2) - 1.0) / 16.0); - if ((double) gravDir == -1.0 && num2 == 0) - ++y; - if (y < 10) - y = 10; - if (y > Main.maxTilesY - 10) - y = Main.maxTilesY - 10; - int num8 = width / 16 + (width % 16 == 0 ? 0 : 1); - int num9 = height / 16 + (height % 16 == 0 ? 0 : 1); - if (WorldGen.InWorld(x, y, Main.Map.BlackEdgeWidth)) - { - if (num1 != 0) - { - for (int index5 = 0; index5 < num9; ++index5) - { - if (Main.tile[x, y + index5 * num5] != null) - SmartCursorHelper._endpoints.Add(new Tuple(x, y + index5 * num5)); - } - } - if (num2 != 0) - { - for (int index6 = 0; index6 < num8; ++index6) - { - if (Main.tile[(int) (((double) providedInfo.mouse.X - (double) (width / 2)) / 16.0) + index6, y] != null) - SmartCursorHelper._endpoints.Add(new Tuple((int) (((double) providedInfo.mouse.X - (double) (width / 2)) / 16.0) + index6, y)); - } - } - } - SmartCursorHelper._targets.Clear(); - while (SmartCursorHelper._points.Count > 0 && SmartCursorHelper._endpoints.Count > 0) - { - Tuple point = SmartCursorHelper._points[0]; - Tuple endpoint = SmartCursorHelper._endpoints[0]; - Tuple col; - if (!Collision.TupleHitLine(point.Item1, point.Item2, endpoint.Item1, endpoint.Item2, num1 * (int) gravDir, -num2 * (int) gravDir, grappleTargets, out col)) - { - SmartCursorHelper._points.Remove(point); - SmartCursorHelper._endpoints.Remove(endpoint); - } - else - { - if (col.Item1 != endpoint.Item1 || col.Item2 != endpoint.Item2) - SmartCursorHelper._targets.Add(col); - Tile tile = Main.tile[col.Item1, col.Item2]; - if (!tile.inActive() && tile.active() && Main.tileSolid[(int) tile.type] && !Main.tileSolidTop[(int) tile.type] && !grappleTargets.Contains(col)) - SmartCursorHelper._targets.Add(col); - SmartCursorHelper._points.Remove(point); - SmartCursorHelper._endpoints.Remove(endpoint); - } - } - SmartCursorHelper._toRemove.Clear(); - for (int index7 = 0; index7 < SmartCursorHelper._targets.Count; ++index7) - { - if (!WorldGen.CanKillTile(SmartCursorHelper._targets[index7].Item1, SmartCursorHelper._targets[index7].Item2)) - SmartCursorHelper._toRemove.Add(SmartCursorHelper._targets[index7]); - } - for (int index8 = 0; index8 < SmartCursorHelper._toRemove.Count; ++index8) - SmartCursorHelper._targets.Remove(SmartCursorHelper._toRemove[index8]); - SmartCursorHelper._toRemove.Clear(); - if (SmartCursorHelper._targets.Count > 0) - { - float num10 = -1f; - Tuple target = SmartCursorHelper._targets[0]; - Vector2 vector2_2 = center; - if (Main.netMode == 1) - { - int num11 = 0; - int num12 = 0; - int num13 = 0; - for (int index9 = 0; index9 < whoAmI; ++index9) - { - Player player1 = Main.player[index9]; - if (player1.active && !player1.dead && player1.HeldItem.pick > 0 && player1.itemAnimation > 0) - { - if ((double) player.Distance(player1.Center) <= 8.0) - ++num11; - if ((double) player.Distance(player1.Center) <= 80.0 && (double) Math.Abs(player1.Center.Y - center.Y) <= 12.0) - ++num12; - } - } - for (int index10 = whoAmI + 1; index10 < (int) byte.MaxValue; ++index10) - { - Player player2 = Main.player[index10]; - if (player2.active && !player2.dead && player2.HeldItem.pick > 0 && player2.itemAnimation > 0 && (double) player.Distance(player2.Center) <= 8.0) - ++num13; - } - if (num11 > 0) - { - if (num11 % 2 == 1) - vector2_2.X += 12f; - else - vector2_2.X -= 12f; - if (num12 % 2 == 1) - vector2_2.Y -= 12f; - } - if (num13 > 0 && num11 == 0) - { - if (num13 % 2 == 1) - vector2_2.X -= 12f; - else - vector2_2.X += 12f; - } - } - for (int index11 = 0; index11 < SmartCursorHelper._targets.Count; ++index11) - { - float num14 = Vector2.Distance(new Vector2((float) SmartCursorHelper._targets[index11].Item1, (float) SmartCursorHelper._targets[index11].Item2) * 16f + Vector2.One * 8f, vector2_2); - if ((double) num10 == -1.0 || (double) num14 < (double) num10) - { - num10 = num14; - target = SmartCursorHelper._targets[index11]; - } - } - if (Collision.InTileBounds(target.Item1, target.Item2, providedInfo.reachableStartX, providedInfo.reachableStartY, providedInfo.reachableEndX, providedInfo.reachableEndY)) - { - focusedX = target.Item1; - focusedY = target.Item2; - } - } - SmartCursorHelper._points.Clear(); - SmartCursorHelper._endpoints.Clear(); - SmartCursorHelper._targets.Clear(); - } - - private static void Step_Axe( - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - ref int fX, - ref int fY) - { - int reachableStartX = providedInfo.reachableStartX; - int reachableStartY = providedInfo.reachableStartY; - int reachableEndX = providedInfo.reachableEndX; - int reachableEndY = providedInfo.reachableEndY; - int screenTargetX = providedInfo.screenTargetX; - int screenTargetY = providedInfo.screenTargetY; - if (providedInfo.item.axe <= 0 || fX != -1 || fY != -1) - return; - float num1 = -1f; - for (int index1 = reachableStartX; index1 <= reachableEndX; ++index1) - { - for (int index2 = reachableStartY; index2 <= reachableEndY; ++index2) - { - if (Main.tile[index1, index2].active()) - { - Tile tile = Main.tile[index1, index2]; - if (Main.tileAxe[(int) tile.type] && !TileID.Sets.IgnoreSmartCursorPriorityAxe[(int) tile.type]) - { - int x = index1; - int y = index2; - int type = (int) tile.type; - if (TileID.Sets.IsATreeTrunk[type]) - { - if (Collision.InTileBounds(x + 1, y, reachableStartX, reachableStartY, reachableEndX, reachableEndY)) - { - if (Main.tile[x, y].frameY >= (short) 198 && Main.tile[x, y].frameX == (short) 44) - ++x; - if (Main.tile[x, y].frameX == (short) 66 && Main.tile[x, y].frameY <= (short) 44) - ++x; - if (Main.tile[x, y].frameX == (short) 44 && Main.tile[x, y].frameY >= (short) 132 && Main.tile[x, y].frameY <= (short) 176) - ++x; - } - if (Collision.InTileBounds(x - 1, y, reachableStartX, reachableStartY, reachableEndX, reachableEndY)) - { - if (Main.tile[x, y].frameY >= (short) 198 && Main.tile[x, y].frameX == (short) 66) - --x; - if (Main.tile[x, y].frameX == (short) 88 && Main.tile[x, y].frameY >= (short) 66 && Main.tile[x, y].frameY <= (short) 110) - --x; - if (Main.tile[x, y].frameX == (short) 22 && Main.tile[x, y].frameY >= (short) 132 && Main.tile[x, y].frameY <= (short) 176) - --x; - } - while (Main.tile[x, y].active() && (int) Main.tile[x, y].type == type && (int) Main.tile[x, y + 1].type == type && Collision.InTileBounds(x, y + 1, reachableStartX, reachableStartY, reachableEndX, reachableEndY)) - ++y; - } - if (tile.type == (ushort) 80) - { - if (Collision.InTileBounds(x + 1, y, reachableStartX, reachableStartY, reachableEndX, reachableEndY)) - { - if (Main.tile[x, y].frameX == (short) 54) - ++x; - if (Main.tile[x, y].frameX == (short) 108 && Main.tile[x, y].frameY == (short) 36) - ++x; - } - if (Collision.InTileBounds(x - 1, y, reachableStartX, reachableStartY, reachableEndX, reachableEndY)) - { - if (Main.tile[x, y].frameX == (short) 36) - --x; - if (Main.tile[x, y].frameX == (short) 108 && Main.tile[x, y].frameY == (short) 18) - --x; - } - while (Main.tile[x, y].active() && Main.tile[x, y].type == (ushort) 80 && Main.tile[x, y + 1].type == (ushort) 80 && Collision.InTileBounds(x, y + 1, reachableStartX, reachableStartY, reachableEndX, reachableEndY)) - ++y; - } - if (tile.type == (ushort) 323 || tile.type == (ushort) 72) - { - while (Main.tile[x, y].active() && (Main.tile[x, y].type == (ushort) 323 && Main.tile[x, y + 1].type == (ushort) 323 || Main.tile[x, y].type == (ushort) 72 && Main.tile[x, y + 1].type == (ushort) 72) && Collision.InTileBounds(x, y + 1, reachableStartX, reachableStartY, reachableEndX, reachableEndY)) - ++y; - } - float num2 = Vector2.Distance(new Vector2((float) x, (float) y) * 16f + Vector2.One * 8f, providedInfo.mouse); - if ((double) num1 == -1.0 || (double) num2 < (double) num1) - { - num1 = num2; - fX = x; - fY = y; - } - } - } - } - } - } - - private static void Step_BlocksFilling( - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - ref int fX, - ref int fY) - { - if (!Player.SmartCursorSettings.SmartBlocksEnabled) - return; - int reachableStartX = providedInfo.reachableStartX; - int reachableStartY = providedInfo.reachableStartY; - int reachableEndX = providedInfo.reachableEndX; - int reachableEndY = providedInfo.reachableEndY; - int screenTargetX = providedInfo.screenTargetX; - int screenTargetY = providedInfo.screenTargetY; - if (Player.SmartCursorSettings.SmartBlocksEnabled || providedInfo.item.createTile <= -1 || providedInfo.item.type == 213 || !Main.tileSolid[providedInfo.item.createTile] || Main.tileSolidTop[providedInfo.item.createTile] || Main.tileFrameImportant[providedInfo.item.createTile] || fX != -1 || fY != -1) - return; - SmartCursorHelper._targets.Clear(); - bool flag1 = false; - if (Main.tile[screenTargetX, screenTargetY].active()) - flag1 = true; - if (!Collision.InTileBounds(screenTargetX, screenTargetY, reachableStartX, reachableStartY, reachableEndX, reachableEndY)) - flag1 = true; - if (!flag1) - { - for (int index1 = reachableStartX; index1 <= reachableEndX; ++index1) - { - for (int index2 = reachableStartY; index2 <= reachableEndY; ++index2) - { - Tile tile = Main.tile[index1, index2]; - if (!tile.active() || Main.tileCut[(int) tile.type] || TileID.Sets.BreakableWhenPlacing[(int) tile.type]) - { - int num = 0; - if (Main.tile[index1 - 1, index2].active() && Main.tileSolid[(int) Main.tile[index1 - 1, index2].type] && !Main.tileSolidTop[(int) Main.tile[index1 - 1, index2].type]) - ++num; - if (Main.tile[index1 + 1, index2].active() && Main.tileSolid[(int) Main.tile[index1 + 1, index2].type] && !Main.tileSolidTop[(int) Main.tile[index1 + 1, index2].type]) - ++num; - if (Main.tile[index1, index2 - 1].active() && Main.tileSolid[(int) Main.tile[index1, index2 - 1].type] && !Main.tileSolidTop[(int) Main.tile[index1, index2 - 1].type]) - ++num; - if (Main.tile[index1, index2 + 1].active() && Main.tileSolid[(int) Main.tile[index1, index2 + 1].type] && !Main.tileSolidTop[(int) Main.tile[index1, index2 + 1].type]) - ++num; - if (num >= 2) - SmartCursorHelper._targets.Add(new Tuple(index1, index2)); - } - } - } - } - if (SmartCursorHelper._targets.Count > 0) - { - float num1 = -1f; - float num2 = float.PositiveInfinity; - Tuple target = SmartCursorHelper._targets[0]; - for (int index = 0; index < SmartCursorHelper._targets.Count; ++index) - { - if (Collision.EmptyTile(SmartCursorHelper._targets[index].Item1, SmartCursorHelper._targets[index].Item2, true)) - { - Vector2 vector2 = new Vector2((float) SmartCursorHelper._targets[index].Item1, (float) SmartCursorHelper._targets[index].Item2) * 16f + Vector2.One * 8f - providedInfo.mouse; - bool flag2 = false; - float num3 = Math.Abs(vector2.X); - float num4 = vector2.Length(); - if ((double) num3 < (double) num2) - flag2 = true; - if ((double) num3 == (double) num2 && ((double) num1 == -1.0 || (double) num4 < (double) num1)) - flag2 = true; - if (flag2) - { - num1 = num4; - num2 = num3; - target = SmartCursorHelper._targets[index]; - } - } - } - if (Collision.InTileBounds(target.Item1, target.Item2, reachableStartX, reachableStartY, reachableEndX, reachableEndY) && (double) num1 != -1.0) - { - fX = target.Item1; - fY = target.Item2; - } - } - SmartCursorHelper._targets.Clear(); - } - - private static void Step_Torch( - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - ref int fX, - ref int fY) - { - int reachableStartX = providedInfo.reachableStartX; - int reachableStartY = providedInfo.reachableStartY; - int reachableEndX = providedInfo.reachableEndX; - int reachableEndY = providedInfo.reachableEndY; - int screenTargetX = providedInfo.screenTargetX; - int screenTargetY = providedInfo.screenTargetY; - if (providedInfo.item.createTile != 4 || fX != -1 || fY != -1) - return; - SmartCursorHelper._targets.Clear(); - bool flag1 = providedInfo.item.type != 1333 && providedInfo.item.type != 523 && providedInfo.item.type != 4384; - for (int index1 = reachableStartX; index1 <= reachableEndX; ++index1) - { - for (int index2 = reachableStartY; index2 <= reachableEndY; ++index2) - { - Tile tile1 = Main.tile[index1, index2]; - Tile tile2 = Main.tile[index1 - 1, index2]; - Tile tile3 = Main.tile[index1 + 1, index2]; - Tile tile4 = Main.tile[index1, index2 + 1]; - if (!tile1.active() || TileID.Sets.BreakableWhenPlacing[(int) tile1.type] || Main.tileCut[(int) tile1.type] && tile1.type != (ushort) 82 && tile1.type != (ushort) 83) - { - bool flag2 = false; - for (int index3 = index1 - 8; index3 <= index1 + 8; ++index3) - { - for (int index4 = index2 - 8; index4 <= index2 + 8; ++index4) - { - if (Main.tile[index3, index4] != null && Main.tile[index3, index4].type == (ushort) 4) - { - flag2 = true; - break; - } - } - if (flag2) - break; - } - if (!flag2 && (!flag1 || tile1.liquid <= (byte) 0) && (tile1.wall > (ushort) 0 || tile2.active() && (tile2.slope() == (byte) 0 || (int) tile2.slope() % 2 != 1) && (Main.tileSolid[(int) tile2.type] && !Main.tileNoAttach[(int) tile2.type] && !Main.tileSolidTop[(int) tile2.type] && !TileID.Sets.NotReallySolid[(int) tile2.type] || TileID.Sets.IsBeam[(int) tile2.type] || WorldGen.IsTreeType((int) tile2.type) && WorldGen.IsTreeType((int) Main.tile[index1 - 1, index2 - 1].type) && WorldGen.IsTreeType((int) Main.tile[index1 - 1, index2 + 1].type)) || tile3.active() && (tile3.slope() == (byte) 0 || (int) tile3.slope() % 2 != 0) && (Main.tileSolid[(int) tile3.type] && !Main.tileNoAttach[(int) tile3.type] && !Main.tileSolidTop[(int) tile3.type] && !TileID.Sets.NotReallySolid[(int) tile3.type] || TileID.Sets.IsBeam[(int) tile3.type] || WorldGen.IsTreeType((int) tile3.type) && WorldGen.IsTreeType((int) Main.tile[index1 + 1, index2 - 1].type) && WorldGen.IsTreeType((int) Main.tile[index1 + 1, index2 + 1].type)) || tile4.active() && Main.tileSolid[(int) tile4.type] && !Main.tileNoAttach[(int) tile4.type] && (!Main.tileSolidTop[(int) tile4.type] || TileID.Sets.Platforms[(int) tile4.type] && tile4.slope() == (byte) 0) && !TileID.Sets.NotReallySolid[(int) tile4.type] && !tile4.halfBrick() && tile4.slope() == (byte) 0) && tile1.type != (ushort) 4) - SmartCursorHelper._targets.Add(new Tuple(index1, index2)); - } - } - } - if (SmartCursorHelper._targets.Count > 0) - { - float num1 = -1f; - Tuple target = SmartCursorHelper._targets[0]; - for (int index = 0; index < SmartCursorHelper._targets.Count; ++index) - { - float num2 = Vector2.Distance(new Vector2((float) SmartCursorHelper._targets[index].Item1, (float) SmartCursorHelper._targets[index].Item2) * 16f + Vector2.One * 8f, providedInfo.mouse); - if ((double) num1 == -1.0 || (double) num2 < (double) num1) - { - num1 = num2; - target = SmartCursorHelper._targets[index]; - } - } - if (Collision.InTileBounds(target.Item1, target.Item2, reachableStartX, reachableStartY, reachableEndX, reachableEndY)) - { - fX = target.Item1; - fY = target.Item2; - } - } - SmartCursorHelper._targets.Clear(); - } - - private static void Step_LawnMower( - SmartCursorHelper.SmartCursorUsageInfo providedInfo, - ref int fX, - ref int fY) - { - int reachableStartX = providedInfo.reachableStartX; - int reachableStartY = providedInfo.reachableStartY; - int reachableEndX = providedInfo.reachableEndX; - int reachableEndY = providedInfo.reachableEndY; - int screenTargetX = providedInfo.screenTargetX; - int screenTargetY = providedInfo.screenTargetY; - if (providedInfo.item.type != 4049 || fX != -1 || fY != -1) - return; - SmartCursorHelper._targets.Clear(); - for (int index1 = reachableStartX; index1 <= reachableEndX; ++index1) - { - for (int index2 = reachableStartY; index2 <= reachableEndY; ++index2) - { - Tile tile = Main.tile[index1, index2]; - if (tile.active() && (tile.type == (ushort) 2 || tile.type == (ushort) 109)) - SmartCursorHelper._targets.Add(new Tuple(index1, index2)); - } - } - if (SmartCursorHelper._targets.Count > 0) - { - float num1 = -1f; - Tuple target = SmartCursorHelper._targets[0]; - for (int index = 0; index < SmartCursorHelper._targets.Count; ++index) - { - float num2 = Vector2.Distance(new Vector2((float) SmartCursorHelper._targets[index].Item1, (float) SmartCursorHelper._targets[index].Item2) * 16f + Vector2.One * 8f, providedInfo.mouse); - if ((double) num1 == -1.0 || (double) num2 < (double) num1) - { - num1 = num2; - target = SmartCursorHelper._targets[index]; - } - } - if (Collision.InTileBounds(target.Item1, target.Item2, reachableStartX, reachableStartY, reachableEndX, reachableEndY)) - { - fX = target.Item1; - fY = target.Item2; - } - } - SmartCursorHelper._targets.Clear(); - } - - private class SmartCursorUsageInfo - { - public Player player; - public Item item; - public Vector2 mouse; - public Vector2 position; - public Vector2 Center; - public int screenTargetX; - public int screenTargetY; - public int reachableStartX; - public int reachableEndX; - public int reachableStartY; - public int reachableEndY; - public int paintLookup; - } - } -} diff --git a/GameContent/SpelunkerProjectileHelper.cs b/GameContent/SpelunkerProjectileHelper.cs deleted file mode 100644 index 1598ccc..0000000 --- a/GameContent/SpelunkerProjectileHelper.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.SpelunkerProjectileHelper -// 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; -using System.Collections.Generic; - -namespace Terraria.GameContent -{ - public class SpelunkerProjectileHelper - { - private HashSet _positionsChecked = new HashSet(); - private HashSet _tilesChecked = new HashSet(); - private Rectangle _clampBox; - private int _frameCounter; - - public void OnPreUpdateAllProjectiles() - { - this._clampBox = new Rectangle(2, 2, Main.maxTilesX - 2, Main.maxTilesY - 2); - if (++this._frameCounter < 10) - return; - this._frameCounter = 0; - this._tilesChecked.Clear(); - this._positionsChecked.Clear(); - } - - public void AddSpotToCheck(Vector2 spot) - { - if (!this._positionsChecked.Add(spot)) - return; - this.CheckSpot(spot); - } - - private void CheckSpot(Vector2 Center) - { - int num1 = (int) Center.X / 16; - int num2 = (int) Center.Y / 16; - int num3 = Utils.Clamp(num1 - 30, this._clampBox.Left, this._clampBox.Right); - int num4 = Utils.Clamp(num1 + 30, this._clampBox.Left, this._clampBox.Right); - int num5 = Utils.Clamp(num2 - 30, this._clampBox.Top, this._clampBox.Bottom); - int num6 = Utils.Clamp(num2 + 30, this._clampBox.Top, this._clampBox.Bottom); - Point point = new Point(); - Vector2 Position = new Vector2(); - for (int index1 = num3; index1 <= num4; ++index1) - { - for (int index2 = num5; index2 <= num6; ++index2) - { - Tile t = Main.tile[index1, index2]; - if (t != null && t.active() && Main.IsTileSpelunkable(t) && (double) new Vector2((float) (num1 - index1), (float) (num2 - index2)).Length() <= 30.0) - { - point.X = index1; - point.Y = index2; - if (this._tilesChecked.Add(point) && Main.rand.Next(4) == 0) - { - Position.X = (float) (index1 * 16); - Position.Y = (float) (index2 * 16); - Dust dust = Dust.NewDustDirect(Position, 16, 16, 204, Alpha: 150, Scale: 0.3f); - dust.fadeIn = 0.75f; - dust.velocity *= 0.1f; - dust.noLight = true; - } - } - } - } - } - } -} diff --git a/GameContent/TeleportHelpers.cs b/GameContent/TeleportHelpers.cs deleted file mode 100644 index 8a17307..0000000 --- a/GameContent/TeleportHelpers.cs +++ /dev/null @@ -1,112 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.TeleportHelpers -// 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 -{ - public class TeleportHelpers - { - public static bool RequestMagicConchTeleportPosition( - Player player, - int crawlOffsetX, - int startX, - out Point landingPoint) - { - landingPoint = new Point(); - Point point = new Point(startX, 50); - int num1 = 1; - int num2 = -1; - int num3 = 1; - int num4 = 0; - int num5 = 5000; - Vector2 vector2 = new Vector2((float) player.width * 0.5f, (float) player.height); - int num6 = 40; - bool flag1 = WorldGen.SolidOrSlopedTile(Main.tile[point.X, point.Y]); - int num7 = 0; - int num8 = 400; - while (num4 < num5 && num7 < num8) - { - ++num4; - Tile tile1 = Main.tile[point.X, point.Y]; - Tile tile2 = Main.tile[point.X, point.Y + num3]; - bool flag2 = WorldGen.SolidOrSlopedTile(tile1) || tile1.liquid > (byte) 0; - bool flag3 = WorldGen.SolidOrSlopedTile(tile2) || tile2.liquid > (byte) 0; - if (TeleportHelpers.IsInSolidTilesExtended(new Vector2((float) (point.X * 16 + 8), (float) (point.Y * 16 + 15)) - vector2, player.velocity, player.width, player.height, (int) player.gravDir)) - { - if (flag1) - point.Y += num1; - else - point.Y += num2; - } - else if (flag2) - { - if (flag1) - point.Y += num1; - else - point.Y += num2; - } - else - { - flag1 = false; - if (!TeleportHelpers.IsInSolidTilesExtended(new Vector2((float) (point.X * 16 + 8), (float) (point.Y * 16 + 15 + 16)) - vector2, player.velocity, player.width, player.height, (int) player.gravDir) && !flag3 && (double) point.Y < Main.worldSurface) - point.Y += num1; - else if (tile2.liquid > (byte) 0) - { - point.X += crawlOffsetX; - ++num7; - } - else if (TeleportHelpers.TileIsDangerous(point.X, point.Y)) - { - point.X += crawlOffsetX; - ++num7; - } - else if (TeleportHelpers.TileIsDangerous(point.X, point.Y + num3)) - { - point.X += crawlOffsetX; - ++num7; - } - else if (point.Y < num6) - point.Y += num1; - else - break; - } - } - if (num4 == num5 || num7 >= num8 || !WorldGen.InWorld(point.X, point.Y, 40)) - return false; - landingPoint = point; - return true; - } - - private static bool TileIsDangerous(int x, int y) - { - Tile tile = Main.tile[x, y]; - return tile.liquid > (byte) 0 && tile.lava() || tile.wall == (ushort) 87 && (double) y > Main.worldSurface && !NPC.downedPlantBoss || Main.wallDungeon[(int) tile.wall] && (double) y > Main.worldSurface && !NPC.downedBoss3; - } - - private static bool IsInSolidTilesExtended( - Vector2 testPosition, - Vector2 playerVelocity, - int width, - int height, - int gravDir) - { - if (Collision.LavaCollision(testPosition, width, height) || (double) Collision.HurtTiles(testPosition, playerVelocity, width, height).Y > 0.0 || Collision.SolidCollision(testPosition, width, height)) - return true; - Vector2 Velocity1 = Vector2.UnitX * 16f; - if (Collision.TileCollision(testPosition - Velocity1, Velocity1, width, height, gravDir: gravDir) != Velocity1) - return true; - Vector2 Velocity2 = -Vector2.UnitX * 16f; - if (Collision.TileCollision(testPosition - Velocity2, Velocity2, width, height, gravDir: gravDir) != Velocity2) - return true; - Vector2 Velocity3 = Vector2.UnitY * 16f; - if (Collision.TileCollision(testPosition - Velocity3, Velocity3, width, height, gravDir: gravDir) != Velocity3) - return true; - Vector2 Velocity4 = -Vector2.UnitY * 16f; - return Collision.TileCollision(testPosition - Velocity4, Velocity4, width, height, gravDir: gravDir) != Velocity4; - } - } -} diff --git a/GameContent/TeleportPylonInfo.cs b/GameContent/TeleportPylonInfo.cs deleted file mode 100644 index 61a0f8e..0000000 --- a/GameContent/TeleportPylonInfo.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.TeleportPylonInfo -// 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.DataStructures; - -namespace Terraria.GameContent -{ - public struct TeleportPylonInfo : IEquatable - { - public Point16 PositionInTiles; - public TeleportPylonType TypeOfPylon; - - public bool Equals(TeleportPylonInfo other) => this.PositionInTiles == other.PositionInTiles && this.TypeOfPylon == other.TypeOfPylon; - } -} diff --git a/GameContent/TeleportPylonType.cs b/GameContent/TeleportPylonType.cs deleted file mode 100644 index 8bbf64a..0000000 --- a/GameContent/TeleportPylonType.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.TeleportPylonType -// 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 -{ - public enum TeleportPylonType : byte - { - SurfacePurity, - Jungle, - Hallow, - Underground, - Beach, - Desert, - Snow, - GlowingMushroom, - Victory, - Count, - } -} diff --git a/GameContent/TeleportPylonsSystem.cs b/GameContent/TeleportPylonsSystem.cs deleted file mode 100644 index 57c11f2..0000000 --- a/GameContent/TeleportPylonsSystem.cs +++ /dev/null @@ -1,321 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.TeleportPylonsSystem -// 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; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria.Chat; -using Terraria.DataStructures; -using Terraria.GameContent.NetModules; -using Terraria.GameContent.Tile_Entities; -using Terraria.Localization; -using Terraria.Net; - -namespace Terraria.GameContent -{ - public class TeleportPylonsSystem : IOnPlayerJoining - { - private List _pylons = new List(); - private List _pylonsOld = new List(); - private int _cooldownForUpdatingPylonsList; - private const int CooldownTimePerPylonsListUpdate = 2147483647; - private SceneMetrics _sceneMetrics = new SceneMetrics(Main.ActiveWorld); - - public List Pylons => this._pylons; - - public void Update() - { - if (Main.netMode == 1) - return; - if (this._cooldownForUpdatingPylonsList > 0) - { - --this._cooldownForUpdatingPylonsList; - } - else - { - this._cooldownForUpdatingPylonsList = int.MaxValue; - this.UpdatePylonsListAndBroadcastChanges(); - } - } - - public bool HasPylonOfType(TeleportPylonType pylonType) => this._pylons.Any((Func) (x => x.TypeOfPylon == pylonType)); - - public bool HasAnyPylon() => this._pylons.Count > 0; - - public void RequestImmediateUpdate() - { - if (Main.netMode == 1) - return; - this._cooldownForUpdatingPylonsList = int.MaxValue; - this.UpdatePylonsListAndBroadcastChanges(); - } - - private void UpdatePylonsListAndBroadcastChanges() - { - Utils.Swap>(ref this._pylons, ref this._pylonsOld); - this._pylons.Clear(); - foreach (TileEntity tileEntity in TileEntity.ByPosition.Values) - { - TeleportPylonType pylonType; - if (tileEntity is TETeleportationPylon teleportationPylon2 && teleportationPylon2.TryGetPylonType(out pylonType)) - this._pylons.Add(new TeleportPylonInfo() - { - PositionInTiles = teleportationPylon2.Position, - TypeOfPylon = pylonType - }); - } - IEnumerable teleportPylonInfos = this._pylonsOld.Except((IEnumerable) this._pylons); - foreach (TeleportPylonInfo info in this._pylons.Except((IEnumerable) this._pylonsOld)) - NetManager.Instance.BroadcastOrLoopback(NetTeleportPylonModule.SerializePylonWasAddedOrRemoved(info, NetTeleportPylonModule.SubPacketType.PylonWasAdded)); - foreach (TeleportPylonInfo info in teleportPylonInfos) - NetManager.Instance.BroadcastOrLoopback(NetTeleportPylonModule.SerializePylonWasAddedOrRemoved(info, NetTeleportPylonModule.SubPacketType.PylonWasRemoved)); - } - - public void AddForClient(TeleportPylonInfo info) - { - if (this._pylons.Contains(info)) - return; - this._pylons.Add(info); - } - - public void RemoveForClient(TeleportPylonInfo info) => this._pylons.RemoveAll((Predicate) (x => x.Equals(info))); - - public void HandleTeleportRequest(TeleportPylonInfo info, int playerIndex) - { - Player player = Main.player[playerIndex]; - string key = (string) null; - bool flag1 = true; - if (flag1) - { - flag1 &= TeleportPylonsSystem.IsPlayerNearAPylon(player); - if (!flag1) - key = "Net.CannotTeleportToPylonBecausePlayerIsNotNearAPylon"; - } - if (flag1) - { - int necessaryNPCCount = this.HowManyNPCsDoesPylonNeed(info, player); - flag1 &= this.DoesPylonHaveEnoughNPCsAroundIt(info, necessaryNPCCount); - if (!flag1) - key = "Net.CannotTeleportToPylonBecauseNotEnoughNPCs"; - } - if (flag1) - { - flag1 &= !NPC.AnyDanger(); - if (!flag1) - key = "Net.CannotTeleportToPylonBecauseThereIsDanger"; - } - if (flag1) - { - if (!NPC.downedPlantBoss && (double) info.PositionInTiles.Y > Main.worldSurface && Framing.GetTileSafely((int) info.PositionInTiles.X, (int) info.PositionInTiles.Y).wall == (ushort) 87) - flag1 = false; - if (!flag1) - key = "Net.CannotTeleportToPylonBecauseAccessingLihzahrdTempleEarly"; - } - SceneMetricsScanSettings metricsScanSettings; - if (flag1) - { - SceneMetrics sceneMetrics = this._sceneMetrics; - metricsScanSettings = new SceneMetricsScanSettings(); - metricsScanSettings.VisualScanArea = new Rectangle?(); - metricsScanSettings.BiomeScanCenterPositionInWorld = new Vector2?(info.PositionInTiles.ToWorldCoordinates()); - metricsScanSettings.ScanOreFinderData = false; - SceneMetricsScanSettings settings = metricsScanSettings; - sceneMetrics.ScanAndExportToMain(settings); - flag1 = this.DoesPylonAcceptTeleportation(info, player); - if (!flag1) - key = "Net.CannotTeleportToPylonBecauseNotMeetingBiomeRequirements"; - } - if (flag1) - { - bool flag2 = false; - int num = 0; - for (int index = 0; index < this._pylons.Count; ++index) - { - TeleportPylonInfo pylon = this._pylons[index]; - if (player.InInteractionRange((int) pylon.PositionInTiles.X, (int) pylon.PositionInTiles.Y)) - { - if (num < 1) - num = 1; - int necessaryNPCCount = this.HowManyNPCsDoesPylonNeed(pylon, player); - if (this.DoesPylonHaveEnoughNPCsAroundIt(pylon, necessaryNPCCount)) - { - if (num < 2) - num = 2; - SceneMetrics sceneMetrics = this._sceneMetrics; - metricsScanSettings = new SceneMetricsScanSettings(); - metricsScanSettings.VisualScanArea = new Rectangle?(); - metricsScanSettings.BiomeScanCenterPositionInWorld = new Vector2?(pylon.PositionInTiles.ToWorldCoordinates()); - metricsScanSettings.ScanOreFinderData = false; - SceneMetricsScanSettings settings = metricsScanSettings; - sceneMetrics.ScanAndExportToMain(settings); - if (this.DoesPylonAcceptTeleportation(pylon, player)) - { - flag2 = true; - break; - } - } - } - } - if (!flag2) - { - flag1 = false; - switch (num) - { - case 1: - key = "Net.CannotTeleportToPylonBecauseNotEnoughNPCsAtCurrentPylon"; - break; - case 2: - key = "Net.CannotTeleportToPylonBecauseNotMeetingBiomeRequirements"; - break; - default: - key = "Net.CannotTeleportToPylonBecausePlayerIsNotNearAPylon"; - break; - } - } - } - if (flag1) - { - Vector2 newPos = info.PositionInTiles.ToWorldCoordinates() - new Vector2(0.0f, (float) player.HeightOffsetBoost); - int num = 9; - int typeOfPylon = (int) info.TypeOfPylon; - int number6 = 0; - player.Teleport(newPos, num, typeOfPylon); - player.velocity = Vector2.Zero; - if (Main.netMode != 2) - return; - RemoteClient.CheckSection(player.whoAmI, player.position); - NetMessage.SendData(65, number2: ((float) player.whoAmI), number3: newPos.X, number4: newPos.Y, number5: num, number6: number6, number7: typeOfPylon); - } - else - ChatHelper.SendChatMessageToClient(NetworkText.FromKey(key), new Color((int) byte.MaxValue, 240, 20), playerIndex); - } - - public static bool IsPlayerNearAPylon(Player player) => player.IsTileTypeInInteractionRange(597); - - private bool DoesPylonHaveEnoughNPCsAroundIt(TeleportPylonInfo info, int necessaryNPCCount) - { - if (necessaryNPCCount <= 0) - return true; - Point16 positionInTiles = info.PositionInTiles; - Rectangle rectangle = new Rectangle((int) positionInTiles.X - Main.buffScanAreaWidth / 2, (int) positionInTiles.Y - Main.buffScanAreaHeight / 2, Main.buffScanAreaWidth, Main.buffScanAreaHeight); - int num = necessaryNPCCount; - for (int index = 0; index < 200; ++index) - { - NPC npc = Main.npc[index]; - if (npc.active && npc.isLikeATownNPC && !npc.homeless && rectangle.Contains(npc.homeTileX, npc.homeTileY)) - { - --num; - if (num == 0) - return true; - } - } - return false; - } - - public void RequestTeleportation(TeleportPylonInfo info, Player player) => NetManager.Instance.SendToServerOrLoopback(NetTeleportPylonModule.SerializeUseRequest(info)); - - private bool DoesPylonAcceptTeleportation(TeleportPylonInfo info, Player player) - { - switch (info.TypeOfPylon) - { - case TeleportPylonType.SurfacePurity: - return !(((double) info.PositionInTiles.Y <= Main.worldSurface ? 1 : 0) == 0 | ((int) info.PositionInTiles.X >= Main.maxTilesX - 380 || info.PositionInTiles.X <= (short) 380)) && (this._sceneMetrics.EnoughTilesForJungle || this._sceneMetrics.EnoughTilesForSnow || this._sceneMetrics.EnoughTilesForDesert || this._sceneMetrics.EnoughTilesForGlowingMushroom || this._sceneMetrics.EnoughTilesForHallow || this._sceneMetrics.EnoughTilesForCrimson ? 1 : (this._sceneMetrics.EnoughTilesForCorruption ? 1 : 0)) == 0; - case TeleportPylonType.Jungle: - return this._sceneMetrics.EnoughTilesForJungle; - case TeleportPylonType.Hallow: - return this._sceneMetrics.EnoughTilesForHallow; - case TeleportPylonType.Underground: - return (double) info.PositionInTiles.Y >= Main.worldSurface; - case TeleportPylonType.Beach: - bool flag = (double) info.PositionInTiles.Y <= Main.worldSurface && (double) info.PositionInTiles.Y > Main.worldSurface * 0.349999994039536; - return (((int) info.PositionInTiles.X >= Main.maxTilesX - 380 ? 1 : (info.PositionInTiles.X <= (short) 380 ? 1 : 0)) & (flag ? 1 : 0)) != 0; - case TeleportPylonType.Desert: - return this._sceneMetrics.EnoughTilesForDesert; - case TeleportPylonType.Snow: - return this._sceneMetrics.EnoughTilesForSnow; - case TeleportPylonType.GlowingMushroom: - return this._sceneMetrics.EnoughTilesForGlowingMushroom; - case TeleportPylonType.Victory: - return true; - default: - return true; - } - } - - private int HowManyNPCsDoesPylonNeed(TeleportPylonInfo info, Player player) => info.TypeOfPylon != TeleportPylonType.Victory ? 2 : 0; - - public void Reset() - { - this._pylons.Clear(); - this._cooldownForUpdatingPylonsList = 0; - } - - public void OnPlayerJoining(int playerIndex) - { - foreach (TeleportPylonInfo pylon in this._pylons) - NetManager.Instance.SendToClient(NetTeleportPylonModule.SerializePylonWasAddedOrRemoved(pylon, NetTeleportPylonModule.SubPacketType.PylonWasAdded), playerIndex); - } - - public static void SpawnInWorldDust(int tileStyle, Rectangle dustBox) - { - float r = 1f; - float g = 1f; - float b = 1f; - switch ((byte) tileStyle) - { - case 0: - r = 0.05f; - g = 0.8f; - b = 0.3f; - break; - case 1: - r = 0.7f; - g = 0.8f; - b = 0.05f; - break; - case 2: - r = 0.5f; - g = 0.3f; - b = 0.7f; - break; - case 3: - r = 0.4f; - g = 0.4f; - b = 0.6f; - break; - case 4: - r = 0.2f; - g = 0.2f; - b = 0.95f; - break; - case 5: - r = 0.85f; - g = 0.45f; - b = 0.1f; - break; - case 6: - r = 1f; - g = 1f; - b = 1.2f; - break; - case 7: - r = 0.4f; - g = 0.7f; - b = 1.2f; - break; - case 8: - r = 0.7f; - g = 0.7f; - b = 0.7f; - break; - } - int index = Dust.NewDust(dustBox.TopLeft(), dustBox.Width, dustBox.Height, 43, Alpha: 254, newColor: new Color(r, g, b, 1f), Scale: 0.5f); - Main.dust[index].velocity *= 0.1f; - Main.dust[index].velocity.Y -= 0.2f; - } - } -} diff --git a/GameContent/TextureAssets.cs b/GameContent/TextureAssets.cs deleted file mode 100644 index f8a8093..0000000 --- a/GameContent/TextureAssets.cs +++ /dev/null @@ -1,301 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.TextureAssets -// 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.Graphics; -using ReLogic.Content; - -namespace Terraria.GameContent -{ - public static class TextureAssets - { - public static Asset[] InfoIcon = new Asset[14]; - public static Asset[] WireUi = new Asset[12]; - public static Asset BuilderAcc; - public static Asset QuicksIcon; - public static Asset[] Clothes = new Asset[6]; - public static Asset[] MapIcon = new Asset[9]; - public static Asset[] Underworld = new Asset[14]; - public static Asset MapPing; - public static Asset Map; - public static Asset[] MapBGs = new Asset[42]; - public static Asset Hue; - public static Asset FlameRing; - public static Asset MapDeath; - public static Asset ColorSlider; - public static Asset ColorBar; - public static Asset ColorBlip; - public static Asset SmartDig; - public static Asset ColorHighlight; - public static Asset TileCrack; - public static Asset LockOnCursor; - public static Asset IceBarrier; - public static Asset[] ChestStack = new Asset[2]; - public static Asset[] NpcHead = new Asset[45]; - public static Asset[] NpcHeadBoss = new Asset[39]; - public static Asset[] CraftToggle = new Asset[4]; - public static Asset[] InventorySort = new Asset[2]; - public static Asset[] TextGlyph = new Asset[1]; - public static Asset[] HotbarRadial = new Asset[3]; - public static Asset CraftUpButton; - public static Asset CraftDownButton; - public static Asset ScrollLeftButton; - public static Asset ScrollRightButton; - public static Asset Frozen; - public static Asset MagicPixel; - public static Asset SettingsPanel; - public static Asset SettingsPanel2; - public static Asset[] Dest = new Asset[3]; - public static Asset[] Gem = new Asset[7]; - public static Asset[] RudolphMount = new Asset[3]; - public static Asset BunnyMount; - public static Asset PigronMount; - public static Asset SlimeMount; - public static Asset MinecartMount; - public static Asset TurtleMount; - public static Asset DesertMinecartMount; - public static Asset FishMinecartMount; - public static Asset[] BeeMount = new Asset[2]; - public static Asset[] UfoMount = new Asset[2]; - public static Asset[] DrillMount = new Asset[6]; - public static Asset[] ScutlixMount = new Asset[3]; - public static Asset UnicornMount; - public static Asset BasiliskMount; - public static Asset[] MinecartMechMount = new Asset[2]; - public static Asset[] CuteFishronMount = new Asset[2]; - public static Asset MinecartWoodMount; - public static Asset[] Wings = new Asset[47]; - public static Asset[] ArmorHead = new Asset[266]; - public static Asset[] ArmorBody = new Asset[235]; - public static Asset[] ArmorBodyComposite = new Asset[235]; - public static Asset[] FemaleBody = new Asset[235]; - public static Asset[] ArmorArm = new Asset[235]; - public static Asset[] ArmorLeg = new Asset[218]; - public static Asset[] AccHandsOn = new Asset[22]; - public static Asset[] AccHandsOnComposite = new Asset[22]; - public static Asset[] AccHandsOff = new Asset[14]; - public static Asset[] AccHandsOffComposite = new Asset[14]; - public static Asset[] AccBack = new Asset[30]; - public static Asset[] AccFront = new Asset[9]; - public static Asset[] AccShoes = new Asset[25]; - public static Asset[] AccWaist = new Asset[17]; - public static Asset[] AccShield = new Asset[10]; - public static Asset[] AccNeck = new Asset[11]; - public static Asset[] AccFace = new Asset[16]; - public static Asset[] AccBalloon = new Asset[18]; - public static Asset Pulley; - public static Asset[] XmasTree = new Asset[5]; - public static Asset[] Flames = new Asset[17]; - public static Asset Timer; - public static Asset[] Reforge = new Asset[2]; - public static Asset EmoteMenuButton; - public static Asset BestiaryMenuButton; - public static Asset WallOutline; - public static Asset Actuator; - public static Asset Wire; - public static Asset Wire2; - public static Asset Wire3; - public static Asset Wire4; - public static Asset WireNew; - public static Asset[] Camera = new Asset[8]; - public static Asset FlyingCarpet; - public static Asset Grid; - public static Asset LightDisc; - public static Asset EyeLaser; - public static Asset BoneEyes; - public static Asset BoneLaser; - public static Asset Trash; - public static Asset FishingLine; - public static Asset Beetle; - public static Asset Probe; - public static Asset EyeLaserSmall; - public static Asset XmasLight; - public static Asset[] Golem = new Asset[4]; - public static Asset Confuse; - public static Asset SunOrb; - public static Asset SunAltar; - public static Asset[] Chains = new Asset[17]; - public static Asset Chain; - public static Asset[] GemChain = new Asset[7]; - public static Asset Chain2; - public static Asset Chain3; - public static Asset Chain4; - public static Asset Chain5; - public static Asset Chain6; - public static Asset Chain7; - public static Asset Chain8; - public static Asset Chain9; - public static Asset Chain10; - public static Asset Chain11; - public static Asset Chain12; - public static Asset Chain13; - public static Asset Chain14; - public static Asset Chain15; - public static Asset Chain16; - public static Asset Chain17; - public static Asset Chain18; - public static Asset Chain19; - public static Asset Chain20; - public static Asset Chain21; - public static Asset Chain22; - public static Asset Chain23; - public static Asset Chain24; - public static Asset Chain25; - public static Asset Chain26; - public static Asset Chain27; - public static Asset Chain28; - public static Asset Chain29; - public static Asset Chain30; - public static Asset Chain31; - public static Asset Chain32; - public static Asset Chain33; - public static Asset Chain34; - public static Asset Chain35; - public static Asset Chain36; - public static Asset Chain37; - public static Asset Chain38; - public static Asset Chain39; - public static Asset Chain40; - public static Asset Chain41; - public static Asset Chain42; - public static Asset Chain43; - public static Asset Hb1; - public static Asset Hb2; - public static Asset Chaos; - public static Asset Cd; - public static Asset Wof; - public static Asset BoneArm; - public static Asset BoneArm2; - public static Asset PumpkingArm; - public static Asset PumpkingCloak; - public static Asset[] EquipPage = new Asset[11]; - public static Asset HouseBanner; - public static Asset[] Pvp = new Asset[3]; - public static Asset[] NpcToggle = new Asset[2]; - public static Asset[] HbLock = new Asset[2]; - public static Asset[] blockReplaceIcon = new Asset[2]; - public static Asset[] Buff = new Asset[323]; - public static Asset[] Item = new Asset[5045]; - public static Asset[] ItemFlame = new Asset[5045]; - public static Asset[] Npc = new Asset[663]; - public static Asset[] Projectile = new Asset[950]; - public static Asset[] Gore = new Asset[1269]; - public static Asset[] BackPack = new Asset[9]; - public static Asset Rain; - public static Asset[] GlowMask = new Asset[301]; - public static Asset[] Extra = new Asset[212]; - public static Asset[] HighlightMask = new Asset[623]; - public static Asset[] Coin = new Asset[4]; - public static Asset[] Cursors = new Asset[18]; - public static Asset CursorRadial; - public static Asset Dust; - public static Asset Sun; - public static Asset Sun2; - public static Asset Sun3; - public static Asset[] Moon = new Asset[9]; - public static Asset SmileyMoon; - public static Asset PumpkinMoon; - public static Asset SnowMoon; - public static Asset OneDropLogo; - public static Asset[] Tile = new Asset[623]; - public static Asset BlackTile; - public static Asset[] Wall = new Asset[316]; - public static Asset[] Background = new Asset[298]; - public static Asset[] Cloud = new Asset[37]; - public static Asset[] Star = new Asset[4]; - public static Asset[] Liquid = new Asset[13]; - public static Asset[] LiquidSlope = new Asset[13]; - public static Asset Heart; - public static Asset Heart2; - public static Asset Mana; - public static Asset Bubble; - public static Asset Flame; - public static Asset[] TreeTop = new Asset[31]; - public static Asset[] TreeBranch = new Asset[31]; - public static Asset[] Wood = new Asset[7]; - public static Asset ShroomCap; - public static Asset InventoryBack; - public static Asset InventoryBack2; - public static Asset InventoryBack3; - public static Asset InventoryBack4; - public static Asset InventoryBack5; - public static Asset InventoryBack6; - public static Asset InventoryBack7; - public static Asset InventoryBack8; - public static Asset InventoryBack9; - public static Asset InventoryBack10; - public static Asset InventoryBack11; - public static Asset InventoryBack12; - public static Asset InventoryBack13; - public static Asset InventoryBack14; - public static Asset InventoryBack15; - public static Asset InventoryBack16; - public static Asset InventoryBack17; - public static Asset InventoryBack18; - public static Asset HairStyleBack; - public static Asset ClothesStyleBack; - public static Asset InventoryTickOn; - public static Asset InventoryTickOff; - public static Asset SplashTexture16x9; - public static Asset SplashTexture4x3; - public static Asset SplashTextureLegoBack; - public static Asset SplashTextureLegoResonanace; - public static Asset SplashTextureLegoTree; - public static Asset SplashTextureLegoFront; - public static Asset Logo; - public static Asset Logo2; - public static Asset Logo3; - public static Asset Logo4; - public static Asset TextBack; - public static Asset Chat; - public static Asset Chat2; - public static Asset ChatBack; - public static Asset Team; - public static Asset Re; - public static Asset Ra; - public static Asset Splash; - public static Asset Fade; - public static Asset Ninja; - public static Asset AntLion; - public static Asset SpikeBase; - public static Asset Ghost; - public static Asset EvilCactus; - public static Asset GoodCactus; - public static Asset CrimsonCactus; - public static Asset WraithEye; - public static Asset Firefly; - public static Asset FireflyJar; - public static Asset Lightningbug; - public static Asset LightningbugJar; - public static Asset[] JellyfishBowl = new Asset[3]; - public static Asset GlowSnail; - public static Asset IceQueen; - public static Asset SantaTank; - public static Asset ReaperEye; - public static Asset JackHat; - public static Asset TreeFace; - public static Asset PumpkingFace; - public static Asset DukeFishron; - public static Asset MiniMinotaur; - public static Asset[,] Players; - public static Asset[] PlayerHair = new Asset[162]; - public static Asset[] PlayerHairAlt = new Asset[162]; - public static Asset LoadingSunflower; - public static Asset GolfSwingBarPanel; - public static Asset GolfSwingBarFill; - public static Asset SpawnPoint; - public static Asset SpawnBed; - public static Asset GolfBallArrow; - public static Asset GolfBallArrowShadow; - public static Asset GolfBallOutline; - - public static class RenderTargets - { - public static PlayerRainbowWingsTextureContent PlayerRainbowWings; - public static PlayerTitaniumStormBuffTextureContent PlayerTitaniumStormBuff; - public static PlayerQueenSlimeMountTextureContent QueenSlimeMount; - } - } -} diff --git a/GameContent/TilePaintSystemV2.cs b/GameContent/TilePaintSystemV2.cs deleted file mode 100644 index 895dec3..0000000 --- a/GameContent/TilePaintSystemV2.cs +++ /dev/null @@ -1,377 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.TilePaintSystemV2 -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using System; -using System.Collections.Generic; - -namespace Terraria.GameContent -{ - public class TilePaintSystemV2 - { - private Dictionary _tilesRenders = new Dictionary(); - private Dictionary _wallsRenders = new Dictionary(); - private Dictionary _treeTopRenders = new Dictionary(); - private Dictionary _treeBranchRenders = new Dictionary(); - private List _requests = new List(); - - public void Reset() - { - foreach (TilePaintSystemV2.ARenderTargetHolder arenderTargetHolder in this._tilesRenders.Values) - arenderTargetHolder.Clear(); - this._tilesRenders.Clear(); - foreach (TilePaintSystemV2.ARenderTargetHolder arenderTargetHolder in this._wallsRenders.Values) - arenderTargetHolder.Clear(); - this._wallsRenders.Clear(); - foreach (TilePaintSystemV2.ARenderTargetHolder arenderTargetHolder in this._treeTopRenders.Values) - arenderTargetHolder.Clear(); - this._treeTopRenders.Clear(); - foreach (TilePaintSystemV2.ARenderTargetHolder arenderTargetHolder in this._treeBranchRenders.Values) - arenderTargetHolder.Clear(); - this._treeBranchRenders.Clear(); - foreach (TilePaintSystemV2.ARenderTargetHolder request in this._requests) - request.Clear(); - this._requests.Clear(); - } - - public void RequestTile(ref TilePaintSystemV2.TileVariationkey lookupKey) - { - TilePaintSystemV2.TileRenderTargetHolder renderTargetHolder; - if (!this._tilesRenders.TryGetValue(lookupKey, out renderTargetHolder)) - { - renderTargetHolder = new TilePaintSystemV2.TileRenderTargetHolder() - { - Key = lookupKey - }; - this._tilesRenders.Add(lookupKey, renderTargetHolder); - } - if (renderTargetHolder.IsReady) - return; - this._requests.Add((TilePaintSystemV2.ARenderTargetHolder) renderTargetHolder); - } - - private void RequestTile_CheckForRelatedTileRequests( - ref TilePaintSystemV2.TileVariationkey lookupKey) - { - if (lookupKey.TileType != 83) - return; - TilePaintSystemV2.TileVariationkey lookupKey1 = new TilePaintSystemV2.TileVariationkey() - { - TileType = 84, - TileStyle = lookupKey.TileStyle, - PaintColor = lookupKey.PaintColor - }; - this.RequestTile(ref lookupKey1); - } - - public void RequestWall(ref TilePaintSystemV2.WallVariationKey lookupKey) - { - TilePaintSystemV2.WallRenderTargetHolder renderTargetHolder; - if (!this._wallsRenders.TryGetValue(lookupKey, out renderTargetHolder)) - { - renderTargetHolder = new TilePaintSystemV2.WallRenderTargetHolder() - { - Key = lookupKey - }; - this._wallsRenders.Add(lookupKey, renderTargetHolder); - } - if (renderTargetHolder.IsReady) - return; - this._requests.Add((TilePaintSystemV2.ARenderTargetHolder) renderTargetHolder); - } - - public void RequestTreeTop( - ref TilePaintSystemV2.TreeFoliageVariantKey lookupKey) - { - TilePaintSystemV2.TreeTopRenderTargetHolder renderTargetHolder; - if (!this._treeTopRenders.TryGetValue(lookupKey, out renderTargetHolder)) - { - renderTargetHolder = new TilePaintSystemV2.TreeTopRenderTargetHolder() - { - Key = lookupKey - }; - this._treeTopRenders.Add(lookupKey, renderTargetHolder); - } - if (renderTargetHolder.IsReady) - return; - this._requests.Add((TilePaintSystemV2.ARenderTargetHolder) renderTargetHolder); - } - - public void RequestTreeBranch( - ref TilePaintSystemV2.TreeFoliageVariantKey lookupKey) - { - TilePaintSystemV2.TreeBranchTargetHolder branchTargetHolder; - if (!this._treeBranchRenders.TryGetValue(lookupKey, out branchTargetHolder)) - { - branchTargetHolder = new TilePaintSystemV2.TreeBranchTargetHolder() - { - Key = lookupKey - }; - this._treeBranchRenders.Add(lookupKey, branchTargetHolder); - } - if (branchTargetHolder.IsReady) - return; - this._requests.Add((TilePaintSystemV2.ARenderTargetHolder) branchTargetHolder); - } - - public Texture2D TryGetTileAndRequestIfNotReady( - int tileType, - int tileStyle, - int paintColor) - { - TilePaintSystemV2.TileVariationkey lookupKey = new TilePaintSystemV2.TileVariationkey() - { - TileType = tileType, - TileStyle = tileStyle, - PaintColor = paintColor - }; - TilePaintSystemV2.TileRenderTargetHolder renderTargetHolder; - if (this._tilesRenders.TryGetValue(lookupKey, out renderTargetHolder) && renderTargetHolder.IsReady) - return (Texture2D) renderTargetHolder.Target; - this.RequestTile(ref lookupKey); - return (Texture2D) null; - } - - public Texture2D TryGetWallAndRequestIfNotReady(int wallType, int paintColor) - { - TilePaintSystemV2.WallVariationKey lookupKey = new TilePaintSystemV2.WallVariationKey() - { - WallType = wallType, - PaintColor = paintColor - }; - TilePaintSystemV2.WallRenderTargetHolder renderTargetHolder; - if (this._wallsRenders.TryGetValue(lookupKey, out renderTargetHolder) && renderTargetHolder.IsReady) - return (Texture2D) renderTargetHolder.Target; - this.RequestWall(ref lookupKey); - return (Texture2D) null; - } - - public Texture2D TryGetTreeTopAndRequestIfNotReady( - int treeTopIndex, - int treeTopStyle, - int paintColor) - { - TilePaintSystemV2.TreeFoliageVariantKey lookupKey = new TilePaintSystemV2.TreeFoliageVariantKey() - { - TextureIndex = treeTopIndex, - TextureStyle = treeTopStyle, - PaintColor = paintColor - }; - TilePaintSystemV2.TreeTopRenderTargetHolder renderTargetHolder; - if (this._treeTopRenders.TryGetValue(lookupKey, out renderTargetHolder) && renderTargetHolder.IsReady) - return (Texture2D) renderTargetHolder.Target; - this.RequestTreeTop(ref lookupKey); - return (Texture2D) null; - } - - public Texture2D TryGetTreeBranchAndRequestIfNotReady( - int treeTopIndex, - int treeTopStyle, - int paintColor) - { - TilePaintSystemV2.TreeFoliageVariantKey lookupKey = new TilePaintSystemV2.TreeFoliageVariantKey() - { - TextureIndex = treeTopIndex, - TextureStyle = treeTopStyle, - PaintColor = paintColor - }; - TilePaintSystemV2.TreeBranchTargetHolder branchTargetHolder; - if (this._treeBranchRenders.TryGetValue(lookupKey, out branchTargetHolder) && branchTargetHolder.IsReady) - return (Texture2D) branchTargetHolder.Target; - this.RequestTreeBranch(ref lookupKey); - return (Texture2D) null; - } - - public void PrepareAllRequests() - { - if (this._requests.Count == 0) - return; - for (int index = 0; index < this._requests.Count; ++index) - this._requests[index].Prepare(); - this._requests.Clear(); - } - - public abstract class ARenderTargetHolder - { - public RenderTarget2D Target; - protected bool _wasPrepared; - - public bool IsReady => this._wasPrepared; - - public abstract void Prepare(); - - public abstract void PrepareShader(); - - public void Clear() - { - if (this.Target == null || this.Target.IsDisposed) - return; - this.Target.Dispose(); - } - - protected void PrepareTextureIfNecessary(Texture2D originalTexture, Rectangle? sourceRect = null) - { - if (this.Target != null && !this.Target.IsContentLost) - return; - Main instance = Main.instance; - if (!sourceRect.HasValue) - sourceRect = new Rectangle?(originalTexture.Frame()); - this.Target = new RenderTarget2D(instance.GraphicsDevice, sourceRect.Value.Width, sourceRect.Value.Height, false, instance.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.None, 0, RenderTargetUsage.PreserveContents); - this.Target.ContentLost += new EventHandler(this.Target_ContentLost); - this.Target.Disposing += new EventHandler(this.Target_Disposing); - instance.GraphicsDevice.SetRenderTarget(this.Target); - instance.GraphicsDevice.Clear(Color.Transparent); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); - this.PrepareShader(); - Rectangle destinationRectangle = sourceRect.Value; - destinationRectangle.X = 0; - destinationRectangle.Y = 0; - Main.spriteBatch.Draw(originalTexture, destinationRectangle, Color.White); - Main.spriteBatch.End(); - instance.GraphicsDevice.SetRenderTarget((RenderTarget2D) null); - this._wasPrepared = true; - } - - private void Target_Disposing(object sender, EventArgs e) - { - this._wasPrepared = false; - this.Target = (RenderTarget2D) null; - } - - private void Target_ContentLost(object sender, EventArgs e) => this._wasPrepared = false; - - protected void PrepareShader(int paintColor, TreePaintingSettings settings) - { - Effect tileShader = Main.tileShader; - tileShader.Parameters["leafHueTestOffset"].SetValue(settings.HueTestOffset); - tileShader.Parameters["leafMinHue"].SetValue(settings.SpecialGroupMinimalHueValue); - tileShader.Parameters["leafMaxHue"].SetValue(settings.SpecialGroupMaximumHueValue); - tileShader.Parameters["leafMinSat"].SetValue(settings.SpecialGroupMinimumSaturationValue); - tileShader.Parameters["leafMaxSat"].SetValue(settings.SpecialGroupMaximumSaturationValue); - tileShader.Parameters["invertSpecialGroupResult"].SetValue(settings.InvertSpecialGroupResult); - tileShader.CurrentTechnique.Passes[Main.ConvertPaintIdToTileShaderIndex(paintColor, settings.UseSpecialGroups, settings.UseWallShaderHacks)].Apply(); - } - } - - public class TreeTopRenderTargetHolder : TilePaintSystemV2.ARenderTargetHolder - { - public TilePaintSystemV2.TreeFoliageVariantKey Key; - - public override void Prepare() => this.PrepareTextureIfNecessary(Main.Assets.Request(TextureAssets.TreeTop[this.Key.TextureIndex].Name, (AssetRequestMode) 1).Value); - - public override void PrepareShader() => this.PrepareShader(this.Key.PaintColor, TreePaintSystemData.GetTreeFoliageSettings(this.Key.TextureIndex, this.Key.TextureStyle)); - } - - public class TreeBranchTargetHolder : TilePaintSystemV2.ARenderTargetHolder - { - public TilePaintSystemV2.TreeFoliageVariantKey Key; - - public override void Prepare() => this.PrepareTextureIfNecessary(Main.Assets.Request(TextureAssets.TreeBranch[this.Key.TextureIndex].Name, (AssetRequestMode) 1).Value); - - public override void PrepareShader() => this.PrepareShader(this.Key.PaintColor, TreePaintSystemData.GetTreeFoliageSettings(this.Key.TextureIndex, this.Key.TextureStyle)); - } - - public class TileRenderTargetHolder : TilePaintSystemV2.ARenderTargetHolder - { - public TilePaintSystemV2.TileVariationkey Key; - - public override void Prepare() => this.PrepareTextureIfNecessary(Main.Assets.Request(TextureAssets.Tile[this.Key.TileType].Name, (AssetRequestMode) 1).Value); - - public override void PrepareShader() => this.PrepareShader(this.Key.PaintColor, TreePaintSystemData.GetTileSettings(this.Key.TileType, this.Key.TileStyle)); - } - - public class WallRenderTargetHolder : TilePaintSystemV2.ARenderTargetHolder - { - public TilePaintSystemV2.WallVariationKey Key; - - public override void Prepare() => this.PrepareTextureIfNecessary(Main.Assets.Request(TextureAssets.Wall[this.Key.WallType].Name, (AssetRequestMode) 1).Value); - - public override void PrepareShader() => this.PrepareShader(this.Key.PaintColor, TreePaintSystemData.GetWallSettings(this.Key.WallType)); - } - - public struct TileVariationkey - { - public int TileType; - public int TileStyle; - public int PaintColor; - - public bool Equals(TilePaintSystemV2.TileVariationkey other) => this.TileType == other.TileType && this.TileStyle == other.TileStyle && this.PaintColor == other.PaintColor; - - public override bool Equals(object obj) => obj is TilePaintSystemV2.TileVariationkey other && this.Equals(other); - - public override int GetHashCode() => (this.TileType * 397 ^ this.TileStyle) * 397 ^ this.PaintColor; - - public static bool operator ==( - TilePaintSystemV2.TileVariationkey left, - TilePaintSystemV2.TileVariationkey right) - { - return left.Equals(right); - } - - public static bool operator !=( - TilePaintSystemV2.TileVariationkey left, - TilePaintSystemV2.TileVariationkey right) - { - return !left.Equals(right); - } - } - - public struct WallVariationKey - { - public int WallType; - public int PaintColor; - - public bool Equals(TilePaintSystemV2.WallVariationKey other) => this.WallType == other.WallType && this.PaintColor == other.PaintColor; - - public override bool Equals(object obj) => obj is TilePaintSystemV2.WallVariationKey other && this.Equals(other); - - public override int GetHashCode() => this.WallType * 397 ^ this.PaintColor; - - public static bool operator ==( - TilePaintSystemV2.WallVariationKey left, - TilePaintSystemV2.WallVariationKey right) - { - return left.Equals(right); - } - - public static bool operator !=( - TilePaintSystemV2.WallVariationKey left, - TilePaintSystemV2.WallVariationKey right) - { - return !left.Equals(right); - } - } - - public struct TreeFoliageVariantKey - { - public int TextureIndex; - public int TextureStyle; - public int PaintColor; - - public bool Equals(TilePaintSystemV2.TreeFoliageVariantKey other) => this.TextureIndex == other.TextureIndex && this.TextureStyle == other.TextureStyle && this.PaintColor == other.PaintColor; - - public override bool Equals(object obj) => obj is TilePaintSystemV2.TreeFoliageVariantKey other && this.Equals(other); - - public override int GetHashCode() => (this.TextureIndex * 397 ^ this.TextureStyle) * 397 ^ this.PaintColor; - - public static bool operator ==( - TilePaintSystemV2.TreeFoliageVariantKey left, - TilePaintSystemV2.TreeFoliageVariantKey right) - { - return left.Equals(right); - } - - public static bool operator !=( - TilePaintSystemV2.TreeFoliageVariantKey left, - TilePaintSystemV2.TreeFoliageVariantKey right) - { - return !left.Equals(right); - } - } - } -} diff --git a/GameContent/Tile_Entities/DisplayDollSlot.cs b/GameContent/Tile_Entities/DisplayDollSlot.cs deleted file mode 100644 index a8ed103..0000000 --- a/GameContent/Tile_Entities/DisplayDollSlot.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Tile_Entities.DisplayDollSlot -// 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.Tile_Entities -{ - public static class DisplayDollSlot - { - public const int Armor_Head = 0; - public const int Armor_Shirt = 1; - public const int Armor_Legs = 2; - public const int Acc_1 = 3; - public const int Acc_2 = 4; - public const int Acc_3 = 5; - public const int Acc_4 = 6; - public const int Acc_5 = 7; - public const int Count = 8; - } -} diff --git a/GameContent/Tile_Entities/HatRackSlot.cs b/GameContent/Tile_Entities/HatRackSlot.cs deleted file mode 100644 index 932375e..0000000 --- a/GameContent/Tile_Entities/HatRackSlot.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Tile_Entities.HatRackSlot -// 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.Tile_Entities -{ - public static class HatRackSlot - { - public const int LeftHat = 0; - public const int RightHat = 1; - public const int Count = 2; - } -} diff --git a/GameContent/Tile_Entities/TEDisplayDoll.cs b/GameContent/Tile_Entities/TEDisplayDoll.cs deleted file mode 100644 index 43c4e17..0000000 --- a/GameContent/Tile_Entities/TEDisplayDoll.cs +++ /dev/null @@ -1,510 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Tile_Entities.TEDisplayDoll -// 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; -using Microsoft.Xna.Framework.Graphics; -using System.IO; -using Terraria.Audio; -using Terraria.DataStructures; -using Terraria.GameInput; -using Terraria.UI; - -namespace Terraria.GameContent.Tile_Entities -{ - public class TEDisplayDoll : TileEntity - { - private static byte _myEntityID; - private const int MyTileID = 470; - private const int entityTileWidth = 2; - private const int entityTileHeight = 3; - private Player _dollPlayer; - private Item[] _items; - private Item[] _dyes; - private static int accessoryTargetSlot = 3; - - public TEDisplayDoll() - { - this._items = new Item[8]; - for (int index = 0; index < this._items.Length; ++index) - this._items[index] = new Item(); - this._dyes = new Item[8]; - for (int index = 0; index < this._dyes.Length; ++index) - this._dyes[index] = new Item(); - this._dollPlayer = new Player(); - this._dollPlayer.hair = 15; - this._dollPlayer.skinColor = Color.White; - this._dollPlayer.skinVariant = 10; - } - - public override void RegisterTileEntityID(int assignedID) => TEDisplayDoll._myEntityID = (byte) assignedID; - - public override TileEntity GenerateInstance() => (TileEntity) new TEDisplayDoll(); - - public override void NetPlaceEntityAttempt(int x, int y) => NetMessage.SendData(86, number: TEDisplayDoll.Place(x, y), number2: ((float) x), number3: ((float) y)); - - public static int Place(int x, int y) - { - TEDisplayDoll teDisplayDoll = new TEDisplayDoll(); - teDisplayDoll.Position = new Point16(x, y); - teDisplayDoll.ID = TileEntity.AssignNewID(); - teDisplayDoll.type = TEDisplayDoll._myEntityID; - TileEntity.ByID[teDisplayDoll.ID] = (TileEntity) teDisplayDoll; - TileEntity.ByPosition[teDisplayDoll.Position] = (TileEntity) teDisplayDoll; - return teDisplayDoll.ID; - } - - public static int Hook_AfterPlacement( - int x, - int y, - int type = 470, - int style = 0, - int direction = 1, - int alternate = 0) - { - if (Main.netMode != 1) - return TEDisplayDoll.Place(x, y - 2); - NetMessage.SendTileSquare(Main.myPlayer, x, y - 1, 3); - NetMessage.SendData(87, number: x, number2: ((float) (y - 2)), number3: ((float) TEDisplayDoll._myEntityID)); - return -1; - } - - public static void Kill(int x, int y) - { - TileEntity tileEntity; - if (!TileEntity.ByPosition.TryGetValue(new Point16(x, y), out tileEntity) || (int) tileEntity.type != (int) TEDisplayDoll._myEntityID) - return; - TileEntity.ByID.Remove(tileEntity.ID); - TileEntity.ByPosition.Remove(new Point16(x, y)); - } - - public static int Find(int x, int y) - { - TileEntity tileEntity; - return TileEntity.ByPosition.TryGetValue(new Point16(x, y), out tileEntity) && (int) tileEntity.type == (int) TEDisplayDoll._myEntityID ? tileEntity.ID : -1; - } - - public override void WriteExtraData(BinaryWriter writer, bool networkSend) - { - BitsByte bitsByte1 = (BitsByte) (byte) 0; - bitsByte1[0] = !this._items[0].IsAir; - bitsByte1[1] = !this._items[1].IsAir; - bitsByte1[2] = !this._items[2].IsAir; - bitsByte1[3] = !this._items[3].IsAir; - bitsByte1[4] = !this._items[4].IsAir; - bitsByte1[5] = !this._items[5].IsAir; - bitsByte1[6] = !this._items[6].IsAir; - bitsByte1[7] = !this._items[7].IsAir; - BitsByte bitsByte2 = (BitsByte) (byte) 0; - bitsByte2[0] = !this._dyes[0].IsAir; - bitsByte2[1] = !this._dyes[1].IsAir; - bitsByte2[2] = !this._dyes[2].IsAir; - bitsByte2[3] = !this._dyes[3].IsAir; - bitsByte2[4] = !this._dyes[4].IsAir; - bitsByte2[5] = !this._dyes[5].IsAir; - bitsByte2[6] = !this._dyes[6].IsAir; - bitsByte2[7] = !this._dyes[7].IsAir; - writer.Write((byte) bitsByte1); - writer.Write((byte) bitsByte2); - for (int index = 0; index < 8; ++index) - { - Item obj = this._items[index]; - if (!obj.IsAir) - { - writer.Write((short) obj.netID); - writer.Write(obj.prefix); - writer.Write((short) obj.stack); - } - } - for (int index = 0; index < 8; ++index) - { - Item dye = this._dyes[index]; - if (!dye.IsAir) - { - writer.Write((short) dye.netID); - writer.Write(dye.prefix); - writer.Write((short) dye.stack); - } - } - } - - public override void ReadExtraData(BinaryReader reader, bool networkSend) - { - BitsByte bitsByte1 = (BitsByte) reader.ReadByte(); - BitsByte bitsByte2 = (BitsByte) reader.ReadByte(); - for (int key = 0; key < 8; ++key) - { - this._items[key] = new Item(); - Item obj = this._items[key]; - if (bitsByte1[key]) - { - obj.netDefaults((int) reader.ReadInt16()); - obj.Prefix((int) reader.ReadByte()); - obj.stack = (int) reader.ReadInt16(); - } - } - for (int key = 0; key < 8; ++key) - { - this._dyes[key] = new Item(); - Item dye = this._dyes[key]; - if (bitsByte2[key]) - { - dye.netDefaults((int) reader.ReadInt16()); - dye.Prefix((int) reader.ReadByte()); - dye.stack = (int) reader.ReadInt16(); - } - } - } - - public override string ToString() => this.Position.X.ToString() + "x " + (object) this.Position.Y + "y item: " + (object) this._items[0] + " " + (object) this._items[1] + " " + (object) this._items[2]; - - public static void Framing_CheckTile(int callX, int callY) - { - if (WorldGen.destroyObject) - return; - int num1 = callX; - int num2 = callY; - Tile tileSafely = Framing.GetTileSafely(callX, callY); - int num3 = num1 - (int) tileSafely.frameX / 18 % 2; - int y = num2 - (int) tileSafely.frameY / 18 % 3; - bool flag = false; - for (int index1 = num3; index1 < num3 + 2; ++index1) - { - for (int index2 = y; index2 < y + 3; ++index2) - { - Tile tile = Main.tile[index1, index2]; - if (!tile.active() || tile.type != (ushort) 470) - flag = true; - } - } - if (!WorldGen.SolidTileAllowBottomSlope(num3, y + 3) || !WorldGen.SolidTileAllowBottomSlope(num3 + 1, y + 3)) - flag = true; - if (!flag) - return; - TEDisplayDoll.Kill(num3, y); - if ((int) Main.tile[callX, callY].frameX / 72 != 1) - Item.NewItem(num3 * 16, y * 16, 32, 48, 498); - else - Item.NewItem(num3 * 16, y * 16, 32, 48, 1989); - WorldGen.destroyObject = true; - for (int i = num3; i < num3 + 2; ++i) - { - for (int j = y; j < y + 3; ++j) - { - if (Main.tile[i, j].active() && Main.tile[i, j].type == (ushort) 470) - WorldGen.KillTile(i, j); - } - } - WorldGen.destroyObject = false; - } - - public void Draw(int tileLeftX, int tileTopY) - { - Player dollPlayer = this._dollPlayer; - for (int index = 0; index < 8; ++index) - { - dollPlayer.armor[index] = this._items[index]; - dollPlayer.dye[index] = this._dyes[index]; - } - dollPlayer.direction = -1; - dollPlayer.Male = true; - Tile tileSafely = Framing.GetTileSafely(tileLeftX, tileTopY); - if ((int) tileSafely.frameX % 72 == 36) - dollPlayer.direction = 1; - if ((int) tileSafely.frameX / 72 == 1) - dollPlayer.Male = false; - dollPlayer.isDisplayDollOrInanimate = true; - dollPlayer.ResetEffects(); - dollPlayer.ResetVisibleAccessories(); - dollPlayer.UpdateDyes(); - dollPlayer.DisplayDollUpdate(); - dollPlayer.UpdateSocialShadow(); - dollPlayer.PlayerFrame(); - Vector2 vector2 = new Vector2((float) (tileLeftX + 1), (float) (tileTopY + 3)) * 16f + new Vector2((float) (-dollPlayer.width / 2), (float) (-dollPlayer.height - 6)); - dollPlayer.position = vector2; - dollPlayer.skinDyePacked = PlayerDrawHelper.PackShader((int) tileSafely.color(), PlayerDrawHelper.ShaderConfiguration.TilePaintID); - Main.PlayerRenderer.DrawPlayer(Main.Camera, dollPlayer, dollPlayer.position, 0.0f, dollPlayer.fullRotationOrigin); - } - - public override void OnPlayerUpdate(Player player) - { - if (player.InInteractionRange(player.tileEntityAnchor.X, player.tileEntityAnchor.Y) && player.chest == -1 && player.talkNPC == -1) - return; - if (player.chest == -1 && player.talkNPC == -1) - SoundEngine.PlaySound(11); - player.tileEntityAnchor.Clear(); - Recipe.FindRecipes(); - } - - public static void OnPlayerInteraction(Player player, int clickX, int clickY) - { - int x = clickX; - int index = clickY; - if ((int) Main.tile[x, index].frameX % 36 != 0) - --x; - int y1 = index - (int) Main.tile[x, index].frameY / 18; - int id = TEDisplayDoll.Find(x, y1); - if (id == -1) - return; - int y2 = y1 + 1; - TEDisplayDoll.accessoryTargetSlot = 3; - TileEntity.BasicOpenCloseInteraction(player, x, y2, id); - } - - public override void OnInventoryDraw(Player player, SpriteBatch spriteBatch) - { - if (Main.tile[player.tileEntityAnchor.X, player.tileEntityAnchor.Y].type != (ushort) 470) - { - player.tileEntityAnchor.Clear(); - Recipe.FindRecipes(); - } - else - this.DrawInner(player, spriteBatch); - } - - public override bool TryGetItemGamepadOverrideInstructions( - Item[] inv, - int context, - int slot, - out string instruction) - { - instruction = ""; - Item newItem = inv[slot]; - if (newItem.IsAir || newItem.favorited) - return false; - switch (context) - { - case 0: - if (TEDisplayDoll.FitsDisplayDoll(newItem)) - { - instruction = Lang.misc[76].Value; - return true; - } - break; - case 23: - case 24: - case 25: - if (Main.player[Main.myPlayer].ItemSpace(newItem).CanTakeItemToPersonalInventory) - { - instruction = Lang.misc[68].Value; - return true; - } - break; - } - return false; - } - - public override string GetItemGamepadInstructions(int slot = 0) - { - Item[] inv = this._items; - int slot1 = slot; - int context = 23; - if (slot >= 8) - { - slot1 -= 8; - inv = this._dyes; - context = 25; - } - else if (slot >= 3) - { - inv = this._items; - context = 24; - } - return ItemSlot.GetGamepadInstructions(inv, context, slot1); - } - - private void DrawInner(Player player, SpriteBatch spriteBatch) - { - Main.inventoryScale = 0.72f; - this.DrawSlotPairSet(player, spriteBatch, 3, 0, 0.0f, 0.5f, 23); - this.DrawSlotPairSet(player, spriteBatch, 5, 3, 3f, 0.5f, 24); - } - - private void DrawSlotPairSet( - Player player, - SpriteBatch spriteBatch, - int slotsToShowLine, - int slotsArrayOffset, - float offsetX, - float offsetY, - int inventoryContextTarget) - { - Item[] items = this._items; - for (int index1 = 0; index1 < slotsToShowLine; ++index1) - { - for (int index2 = 0; index2 < 2; ++index2) - { - int num1 = (int) (73.0 + ((double) index1 + (double) offsetX) * 56.0 * (double) Main.inventoryScale); - int num2 = (int) ((double) Main.instance.invBottom + ((double) index2 + (double) offsetY) * 56.0 * (double) Main.inventoryScale); - Item[] inv; - int context; - if (index2 == 0) - { - inv = this._items; - context = inventoryContextTarget; - } - else - { - inv = this._dyes; - context = 25; - } - if (Utils.FloatIntersect((float) Main.mouseX, (float) Main.mouseY, 0.0f, 0.0f, (float) num1, (float) num2, (float) TextureAssets.InventoryBack.Width() * Main.inventoryScale, (float) TextureAssets.InventoryBack.Height() * Main.inventoryScale) && !PlayerInput.IgnoreMouseInterface) - { - player.mouseInterface = true; - ItemSlot.Handle(inv, context, index1 + slotsArrayOffset); - } - ItemSlot.Draw(spriteBatch, inv, context, index1 + slotsArrayOffset, new Vector2((float) num1, (float) num2)); - } - } - } - - public override bool OverrideItemSlotHover(Item[] inv, int context = 0, int slot = 0) - { - Item obj = inv[slot]; - if (!obj.IsAir && !inv[slot].favorited && context == 0 && TEDisplayDoll.FitsDisplayDoll(obj)) - { - Main.cursorOverride = 9; - return true; - } - if (obj.IsAir || context != 23 && context != 24 && context != 25 || !Main.player[Main.myPlayer].ItemSpace(inv[slot]).CanTakeItemToPersonalInventory) - return false; - Main.cursorOverride = 8; - return true; - } - - public override bool OverrideItemSlotLeftClick(Item[] inv, int context = 0, int slot = 0) - { - if (!ItemSlot.ShiftInUse) - return false; - if (Main.cursorOverride == 9 && context == 0) - { - Item obj = inv[slot]; - if (!obj.IsAir && !obj.favorited && TEDisplayDoll.FitsDisplayDoll(obj)) - return this.TryFitting(inv, context, slot); - } - if ((Main.cursorOverride != 8 || context != 23) && context != 24 && context != 25) - return false; - inv[slot] = Main.player[Main.myPlayer].GetItem(Main.myPlayer, inv[slot], GetItemSettings.InventoryEntityToPlayerInventorySettings); - if (Main.netMode == 1) - { - if (context == 25) - NetMessage.SendData(121, number: Main.myPlayer, number2: ((float) this.ID), number3: ((float) slot), number4: 1f); - else - NetMessage.SendData(121, number: Main.myPlayer, number2: ((float) this.ID), number3: ((float) slot)); - } - return true; - } - - public static bool FitsDisplayDoll(Item item) - { - if (item.maxStack > 1) - return false; - return item.headSlot > 0 || item.bodySlot > 0 || item.legSlot > 0 || item.accessory; - } - - private bool TryFitting(Item[] inv, int context = 0, int slot = 0, bool justCheck = false) - { - Item obj = inv[slot]; - int index1 = -1; - if (obj.headSlot > 0) - index1 = 0; - if (obj.bodySlot > 0) - index1 = 1; - if (obj.legSlot > 0) - index1 = 2; - if (obj.accessory) - index1 = TEDisplayDoll.accessoryTargetSlot; - if (index1 == -1) - return false; - if (justCheck) - return true; - if (obj.accessory) - { - ++TEDisplayDoll.accessoryTargetSlot; - if (TEDisplayDoll.accessoryTargetSlot >= 8) - TEDisplayDoll.accessoryTargetSlot = 3; - for (int index2 = 3; index2 < 8; ++index2) - { - if (this._items[index2].IsAir) - { - index1 = index2; - TEDisplayDoll.accessoryTargetSlot = index2; - break; - } - } - for (int index3 = 3; index3 < 8; ++index3) - { - if (inv[slot].type == this._items[index3].type) - index1 = index3; - } - } - SoundEngine.PlaySound(7); - Utils.Swap(ref this._items[index1], ref inv[slot]); - if (Main.netMode == 1) - NetMessage.SendData(121, number: Main.myPlayer, number2: ((float) this.ID), number3: ((float) index1)); - return true; - } - - public void WriteItem(int itemIndex, BinaryWriter writer, bool dye) - { - Item dye1 = this._items[itemIndex]; - if (dye) - dye1 = this._dyes[itemIndex]; - writer.Write((ushort) dye1.netID); - writer.Write((ushort) dye1.stack); - writer.Write(dye1.prefix); - } - - public void ReadItem(int itemIndex, BinaryReader reader, bool dye) - { - int Type = (int) reader.ReadUInt16(); - int num = (int) reader.ReadUInt16(); - int pre = (int) reader.ReadByte(); - Item dye1 = this._items[itemIndex]; - if (dye) - dye1 = this._dyes[itemIndex]; - dye1.SetDefaults(Type); - dye1.stack = num; - dye1.Prefix(pre); - } - - public override bool IsTileValidForEntity(int x, int y) => Main.tile[x, y].active() && Main.tile[x, y].type == (ushort) 470 && Main.tile[x, y].frameY == (short) 0 && (int) Main.tile[x, y].frameX % 36 == 0; - - public void SetInventoryFromMannequin(int headFrame, int shirtFrame, int legFrame) - { - headFrame /= 100; - shirtFrame /= 100; - legFrame /= 100; - if (headFrame >= 0 && headFrame < Item.headType.Length) - this._items[0].SetDefaults(Item.headType[headFrame]); - if (shirtFrame >= 0 && shirtFrame < Item.bodyType.Length) - this._items[1].SetDefaults(Item.bodyType[shirtFrame]); - if (legFrame < 0 || legFrame >= Item.legType.Length) - return; - this._items[2].SetDefaults(Item.legType[legFrame]); - } - - public static bool IsBreakable(int clickX, int clickY) - { - int x = clickX; - int index = clickY; - if ((int) Main.tile[x, index].frameX % 36 != 0) - --x; - int y = index - (int) Main.tile[x, index].frameY / 18; - int key = TEDisplayDoll.Find(x, y); - return key == -1 || !(TileEntity.ByID[key] as TEDisplayDoll).ContainsItems(); - } - - public bool ContainsItems() - { - for (int index = 0; index < 8; ++index) - { - if (!this._items[index].IsAir || !this._dyes[index].IsAir) - return true; - } - return false; - } - } -} diff --git a/GameContent/Tile_Entities/TEFoodPlatter.cs b/GameContent/Tile_Entities/TEFoodPlatter.cs deleted file mode 100644 index 3c81f5f..0000000 --- a/GameContent/Tile_Entities/TEFoodPlatter.cs +++ /dev/null @@ -1,175 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Tile_Entities.TEFoodPlatter -// 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.IO; -using Terraria.DataStructures; -using Terraria.ID; - -namespace Terraria.GameContent.Tile_Entities -{ - public class TEFoodPlatter : TileEntity - { - private static byte _myEntityID; - public Item item; - - public override void RegisterTileEntityID(int assignedID) => TEFoodPlatter._myEntityID = (byte) assignedID; - - public override void NetPlaceEntityAttempt(int x, int y) => TEFoodPlatter.NetPlaceEntity(x, y); - - public static void NetPlaceEntity(int x, int y) => NetMessage.SendData(86, number: TEFoodPlatter.Place(x, y), number2: ((float) x), number3: ((float) y)); - - public override TileEntity GenerateInstance() => (TileEntity) new TEFoodPlatter(); - - public TEFoodPlatter() => this.item = new Item(); - - public static int Place(int x, int y) - { - TEFoodPlatter teFoodPlatter = new TEFoodPlatter(); - teFoodPlatter.Position = new Point16(x, y); - teFoodPlatter.ID = TileEntity.AssignNewID(); - teFoodPlatter.type = TEFoodPlatter._myEntityID; - TileEntity.ByID[teFoodPlatter.ID] = (TileEntity) teFoodPlatter; - TileEntity.ByPosition[teFoodPlatter.Position] = (TileEntity) teFoodPlatter; - return teFoodPlatter.ID; - } - - public override bool IsTileValidForEntity(int x, int y) => TEFoodPlatter.ValidTile(x, y); - - public static int Hook_AfterPlacement( - int x, - int y, - int type = 520, - int style = 0, - int direction = 1, - int alternate = 0) - { - if (Main.netMode != 1) - return TEFoodPlatter.Place(x, y); - NetMessage.SendTileSquare(Main.myPlayer, x, y, 1); - NetMessage.SendData(87, number: x, number2: ((float) y), number3: ((float) TEFoodPlatter._myEntityID)); - return -1; - } - - public static void Kill(int x, int y) - { - TileEntity tileEntity; - if (!TileEntity.ByPosition.TryGetValue(new Point16(x, y), out tileEntity) || (int) tileEntity.type != (int) TEFoodPlatter._myEntityID) - return; - TileEntity.ByID.Remove(tileEntity.ID); - TileEntity.ByPosition.Remove(new Point16(x, y)); - } - - public static int Find(int x, int y) - { - TileEntity tileEntity; - return TileEntity.ByPosition.TryGetValue(new Point16(x, y), out tileEntity) && (int) tileEntity.type == (int) TEFoodPlatter._myEntityID ? tileEntity.ID : -1; - } - - public static bool ValidTile(int x, int y) => Main.tile[x, y].active() && Main.tile[x, y].type == (ushort) 520 && Main.tile[x, y].frameY == (short) 0; - - public override void WriteExtraData(BinaryWriter writer, bool networkSend) - { - writer.Write((short) this.item.netID); - writer.Write(this.item.prefix); - writer.Write((short) this.item.stack); - } - - public override void ReadExtraData(BinaryReader reader, bool networkSend) - { - this.item = new Item(); - this.item.netDefaults((int) reader.ReadInt16()); - this.item.Prefix((int) reader.ReadByte()); - this.item.stack = (int) reader.ReadInt16(); - } - - public override string ToString() => this.Position.X.ToString() + "x " + (object) this.Position.Y + "y item: " + (object) this.item; - - public void DropItem() - { - if (Main.netMode != 1) - Item.NewItem((int) this.Position.X * 16, (int) this.Position.Y * 16, 16, 16, this.item.netID, pfix: ((int) this.item.prefix)); - this.item = new Item(); - } - - public static void TryPlacing(int x, int y, int netid, int prefix, int stack) - { - WorldGen.RangeFrame(x, y, x + 1, y + 1); - int key = TEFoodPlatter.Find(x, y); - if (key == -1) - { - int number = Item.NewItem(x * 16, y * 16, 16, 16, 1); - Main.item[number].netDefaults(netid); - Main.item[number].Prefix(prefix); - Main.item[number].stack = stack; - NetMessage.SendData(21, number: number); - } - else - { - TEFoodPlatter teFoodPlatter = (TEFoodPlatter) TileEntity.ByID[key]; - if (teFoodPlatter.item.stack > 0) - teFoodPlatter.DropItem(); - teFoodPlatter.item = new Item(); - teFoodPlatter.item.netDefaults(netid); - teFoodPlatter.item.Prefix(prefix); - teFoodPlatter.item.stack = stack; - NetMessage.SendData(86, number: teFoodPlatter.ID, number2: ((float) x), number3: ((float) y)); - } - } - - public static void OnPlayerInteraction(Player player, int clickX, int clickY) - { - if (TEFoodPlatter.FitsFoodPlatter(player.inventory[player.selectedItem]) && !player.inventory[player.selectedItem].favorited) - { - player.GamepadEnableGrappleCooldown(); - TEFoodPlatter.PlaceItemInFrame(player, clickX, clickY); - Recipe.FindRecipes(); - } - else - { - int x = clickX; - int y = clickY; - int key = TEFoodPlatter.Find(x, y); - if (key == -1 || ((TEFoodPlatter) TileEntity.ByID[key]).item.stack <= 0) - return; - player.GamepadEnableGrappleCooldown(); - WorldGen.KillTile(clickX, clickY, true); - if (Main.netMode != 1) - return; - NetMessage.SendData(17, number2: ((float) x), number3: ((float) y), number4: 1f); - } - } - - public static bool FitsFoodPlatter(Item i) => i.stack > 0 && ItemID.Sets.IsFood[i.type]; - - public static void PlaceItemInFrame(Player player, int x, int y) - { - int key = TEFoodPlatter.Find(x, y); - if (key == -1) - return; - if (((TEFoodPlatter) TileEntity.ByID[key]).item.stack > 0) - { - WorldGen.KillTile(x, y, true); - if (Main.netMode == 1) - NetMessage.SendData(17, number2: ((float) Player.tileTargetX), number3: ((float) y), number4: 1f); - } - if (Main.netMode == 1) - NetMessage.SendData(133, number: x, number2: ((float) y), number3: ((float) player.selectedItem), number4: ((float) player.whoAmI), number5: 1); - else - TEFoodPlatter.TryPlacing(x, y, player.inventory[player.selectedItem].netID, (int) player.inventory[player.selectedItem].prefix, 1); - --player.inventory[player.selectedItem].stack; - if (player.inventory[player.selectedItem].stack <= 0) - { - player.inventory[player.selectedItem].SetDefaults(); - Main.mouseItem.SetDefaults(); - } - if (player.selectedItem == 58) - Main.mouseItem = player.inventory[player.selectedItem].Clone(); - player.releaseUseItem = false; - player.mouseInterface = true; - WorldGen.RangeFrame(x, y, x + 1, y + 1); - } - } -} diff --git a/GameContent/Tile_Entities/TEHatRack.cs b/GameContent/Tile_Entities/TEHatRack.cs deleted file mode 100644 index c30e7dc..0000000 --- a/GameContent/Tile_Entities/TEHatRack.cs +++ /dev/null @@ -1,457 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Tile_Entities.TEHatRack -// 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; -using Microsoft.Xna.Framework.Graphics; -using System.IO; -using Terraria.Audio; -using Terraria.DataStructures; -using Terraria.GameInput; -using Terraria.UI; - -namespace Terraria.GameContent.Tile_Entities -{ - public class TEHatRack : TileEntity - { - private static byte _myEntityID; - private const int MyTileID = 475; - private const int entityTileWidth = 3; - private const int entityTileHeight = 4; - private Player _dollPlayer; - private Item[] _items; - private Item[] _dyes; - private static int hatTargetSlot; - - public TEHatRack() - { - this._items = new Item[2]; - for (int index = 0; index < this._items.Length; ++index) - this._items[index] = new Item(); - this._dyes = new Item[2]; - for (int index = 0; index < this._dyes.Length; ++index) - this._dyes[index] = new Item(); - this._dollPlayer = new Player(); - this._dollPlayer.hair = 15; - this._dollPlayer.skinColor = Color.White; - this._dollPlayer.skinVariant = 10; - } - - public override void RegisterTileEntityID(int assignedID) => TEHatRack._myEntityID = (byte) assignedID; - - public override TileEntity GenerateInstance() => (TileEntity) new TEHatRack(); - - public override void NetPlaceEntityAttempt(int x, int y) => NetMessage.SendData(86, number: TEHatRack.Place(x, y), number2: ((float) x), number3: ((float) y)); - - public static int Place(int x, int y) - { - TEHatRack teHatRack = new TEHatRack(); - teHatRack.Position = new Point16(x, y); - teHatRack.ID = TileEntity.AssignNewID(); - teHatRack.type = TEHatRack._myEntityID; - TileEntity.ByID[teHatRack.ID] = (TileEntity) teHatRack; - TileEntity.ByPosition[teHatRack.Position] = (TileEntity) teHatRack; - return teHatRack.ID; - } - - public static int Hook_AfterPlacement( - int x, - int y, - int type = 475, - int style = 0, - int direction = 1, - int alternate = 0) - { - if (Main.netMode != 1) - return TEHatRack.Place(x - 1, y - 3); - NetMessage.SendTileSquare(Main.myPlayer, x, y - 1, 5); - NetMessage.SendData(87, number: (x - 1), number2: ((float) (y - 3)), number3: ((float) TEHatRack._myEntityID)); - return -1; - } - - public static void Kill(int x, int y) - { - TileEntity tileEntity; - if (!TileEntity.ByPosition.TryGetValue(new Point16(x, y), out tileEntity) || (int) tileEntity.type != (int) TEHatRack._myEntityID) - return; - TileEntity.ByID.Remove(tileEntity.ID); - TileEntity.ByPosition.Remove(new Point16(x, y)); - } - - public static int Find(int x, int y) - { - TileEntity tileEntity; - return TileEntity.ByPosition.TryGetValue(new Point16(x, y), out tileEntity) && (int) tileEntity.type == (int) TEHatRack._myEntityID ? tileEntity.ID : -1; - } - - public override void WriteExtraData(BinaryWriter writer, bool networkSend) - { - BitsByte bitsByte = (BitsByte) (byte) 0; - bitsByte[0] = !this._items[0].IsAir; - bitsByte[1] = !this._items[1].IsAir; - bitsByte[2] = !this._dyes[0].IsAir; - bitsByte[3] = !this._dyes[1].IsAir; - writer.Write((byte) bitsByte); - for (int index = 0; index < 2; ++index) - { - Item obj = this._items[index]; - if (!obj.IsAir) - { - writer.Write((short) obj.netID); - writer.Write(obj.prefix); - writer.Write((short) obj.stack); - } - } - for (int index = 0; index < 2; ++index) - { - Item dye = this._dyes[index]; - if (!dye.IsAir) - { - writer.Write((short) dye.netID); - writer.Write(dye.prefix); - writer.Write((short) dye.stack); - } - } - } - - public override void ReadExtraData(BinaryReader reader, bool networkSend) - { - BitsByte bitsByte = (BitsByte) reader.ReadByte(); - for (int key = 0; key < 2; ++key) - { - this._items[key] = new Item(); - Item obj = this._items[key]; - if (bitsByte[key]) - { - obj.netDefaults((int) reader.ReadInt16()); - obj.Prefix((int) reader.ReadByte()); - obj.stack = (int) reader.ReadInt16(); - } - } - for (int index = 0; index < 2; ++index) - { - this._dyes[index] = new Item(); - Item dye = this._dyes[index]; - if (bitsByte[index + 2]) - { - dye.netDefaults((int) reader.ReadInt16()); - dye.Prefix((int) reader.ReadByte()); - dye.stack = (int) reader.ReadInt16(); - } - } - } - - public override string ToString() => this.Position.X.ToString() + "x " + (object) this.Position.Y + "y item: " + (object) this._items[0] + " " + (object) this._items[1]; - - public static void Framing_CheckTile(int callX, int callY) - { - if (WorldGen.destroyObject) - return; - int num1 = callX; - int num2 = callY; - Tile tileSafely = Framing.GetTileSafely(callX, callY); - int num3 = num1 - (int) tileSafely.frameX / 18 % 3; - int y = num2 - (int) tileSafely.frameY / 18 % 4; - bool flag = false; - for (int index1 = num3; index1 < num3 + 3; ++index1) - { - for (int index2 = y; index2 < y + 4; ++index2) - { - Tile tile = Main.tile[index1, index2]; - if (!tile.active() || tile.type != (ushort) 475) - flag = true; - } - } - if (!WorldGen.SolidTileAllowBottomSlope(num3, y + 4) || !WorldGen.SolidTileAllowBottomSlope(num3 + 1, y + 4) || !WorldGen.SolidTileAllowBottomSlope(num3 + 2, y + 4)) - flag = true; - if (!flag) - return; - TEHatRack.Kill(num3, y); - Item.NewItem(num3 * 16, y * 16, 48, 64, 3977); - WorldGen.destroyObject = true; - for (int i = num3; i < num3 + 3; ++i) - { - for (int j = y; j < y + 4; ++j) - { - if (Main.tile[i, j].active() && Main.tile[i, j].type == (ushort) 475) - WorldGen.KillTile(i, j); - } - } - WorldGen.destroyObject = false; - } - - public void Draw(int tileLeftX, int tileTopY) - { - Player dollPlayer = this._dollPlayer; - dollPlayer.direction = -1; - dollPlayer.Male = true; - if ((int) Framing.GetTileSafely(tileLeftX, tileTopY).frameX % 216 == 54) - dollPlayer.direction = 1; - dollPlayer.isDisplayDollOrInanimate = true; - dollPlayer.isHatRackDoll = true; - dollPlayer.armor[0] = this._items[0]; - dollPlayer.dye[0] = this._dyes[0]; - dollPlayer.ResetEffects(); - dollPlayer.ResetVisibleAccessories(); - dollPlayer.invis = true; - dollPlayer.UpdateDyes(); - dollPlayer.DisplayDollUpdate(); - dollPlayer.PlayerFrame(); - Vector2 vector2_1 = new Vector2((float) tileLeftX + 1.5f, (float) (tileTopY + 4)) * 16f; - dollPlayer.direction *= -1; - Vector2 vector2_2 = new Vector2((float) (-dollPlayer.width / 2), (float) (-dollPlayer.height - 6)) + new Vector2((float) (dollPlayer.direction * 14), -2f); - dollPlayer.position = vector2_1 + vector2_2; - Main.PlayerRenderer.DrawPlayer(Main.Camera, dollPlayer, dollPlayer.position, 0.0f, dollPlayer.fullRotationOrigin); - dollPlayer.armor[0] = this._items[1]; - dollPlayer.dye[0] = this._dyes[1]; - dollPlayer.ResetEffects(); - dollPlayer.ResetVisibleAccessories(); - dollPlayer.invis = true; - dollPlayer.UpdateDyes(); - dollPlayer.DisplayDollUpdate(); - dollPlayer.skipAnimatingValuesInPlayerFrame = true; - dollPlayer.PlayerFrame(); - dollPlayer.skipAnimatingValuesInPlayerFrame = false; - dollPlayer.direction *= -1; - Vector2 vector2_3 = new Vector2((float) (-dollPlayer.width / 2), (float) (-dollPlayer.height - 6)) + new Vector2((float) (dollPlayer.direction * 12), 16f); - dollPlayer.position = vector2_1 + vector2_3; - Main.PlayerRenderer.DrawPlayer(Main.Camera, dollPlayer, dollPlayer.position, 0.0f, dollPlayer.fullRotationOrigin); - } - - public override string GetItemGamepadInstructions(int slot = 0) - { - Item[] inv = this._items; - int slot1 = slot; - int context = 26; - if (slot >= 2) - { - slot1 -= 2; - inv = this._dyes; - context = 27; - } - return ItemSlot.GetGamepadInstructions(inv, context, slot1); - } - - public override bool TryGetItemGamepadOverrideInstructions( - Item[] inv, - int context, - int slot, - out string instruction) - { - instruction = ""; - Item newItem = inv[slot]; - if (newItem.IsAir || newItem.favorited) - return false; - switch (context) - { - case 0: - if (TEHatRack.FitsHatRack(newItem)) - { - instruction = Lang.misc[76].Value; - return true; - } - break; - case 26: - case 27: - if (Main.player[Main.myPlayer].ItemSpace(newItem).CanTakeItemToPersonalInventory) - { - instruction = Lang.misc[68].Value; - return true; - } - break; - } - return false; - } - - public override void OnPlayerUpdate(Player player) - { - if (player.InInteractionRange(player.tileEntityAnchor.X, player.tileEntityAnchor.Y) && player.chest == -1 && player.talkNPC == -1) - return; - if (player.chest == -1 && player.talkNPC == -1) - SoundEngine.PlaySound(11); - player.tileEntityAnchor.Clear(); - Recipe.FindRecipes(); - } - - public static void OnPlayerInteraction(Player player, int clickX, int clickY) - { - int index1 = clickX; - int index2 = clickY; - int x1 = index1 - (int) Main.tile[index1, index2].frameX % 54 / 18; - int y1 = index2 - (int) Main.tile[x1, index2].frameY / 18; - int id = TEHatRack.Find(x1, y1); - if (id == -1) - return; - int y2 = y1 + 1; - int x2 = x1 + 1; - TileEntity.BasicOpenCloseInteraction(player, x2, y2, id); - } - - public override void OnInventoryDraw(Player player, SpriteBatch spriteBatch) - { - if (Main.tile[player.tileEntityAnchor.X, player.tileEntityAnchor.Y].type != (ushort) 475) - { - player.tileEntityAnchor.Clear(); - Recipe.FindRecipes(); - } - else - this.DrawInner(player, spriteBatch); - } - - private void DrawInner(Player player, SpriteBatch spriteBatch) - { - Main.inventoryScale = 0.72f; - this.DrawSlotPairSet(player, spriteBatch, 2, 0, 3.5f, 0.5f, 26); - } - - private void DrawSlotPairSet( - Player player, - SpriteBatch spriteBatch, - int slotsToShowLine, - int slotsArrayOffset, - float offsetX, - float offsetY, - int inventoryContextTarget) - { - Item[] items = this._items; - for (int index1 = 0; index1 < slotsToShowLine; ++index1) - { - for (int index2 = 0; index2 < 2; ++index2) - { - int num1 = (int) (73.0 + ((double) index1 + (double) offsetX) * 56.0 * (double) Main.inventoryScale); - int num2 = (int) ((double) Main.instance.invBottom + ((double) index2 + (double) offsetY) * 56.0 * (double) Main.inventoryScale); - Item[] inv; - int context; - if (index2 == 0) - { - inv = this._items; - context = inventoryContextTarget; - } - else - { - inv = this._dyes; - context = 27; - } - if (Utils.FloatIntersect((float) Main.mouseX, (float) Main.mouseY, 0.0f, 0.0f, (float) num1, (float) num2, (float) TextureAssets.InventoryBack.Width() * Main.inventoryScale, (float) TextureAssets.InventoryBack.Height() * Main.inventoryScale) && !PlayerInput.IgnoreMouseInterface) - { - player.mouseInterface = true; - ItemSlot.Handle(inv, context, index1 + slotsArrayOffset); - } - ItemSlot.Draw(spriteBatch, inv, context, index1 + slotsArrayOffset, new Vector2((float) num1, (float) num2)); - } - } - } - - public override bool OverrideItemSlotHover(Item[] inv, int context = 0, int slot = 0) - { - Item obj = inv[slot]; - if (!obj.IsAir && !inv[slot].favorited && context == 0 && TEHatRack.FitsHatRack(obj)) - { - Main.cursorOverride = 9; - return true; - } - if (obj.IsAir || context != 26 && context != 27 || !Main.player[Main.myPlayer].ItemSpace(inv[slot]).CanTakeItemToPersonalInventory) - return false; - Main.cursorOverride = 8; - return true; - } - - public override bool OverrideItemSlotLeftClick(Item[] inv, int context = 0, int slot = 0) - { - if (!ItemSlot.ShiftInUse) - return false; - if (Main.cursorOverride == 9 && context == 0) - { - Item obj = inv[slot]; - if (Main.cursorOverride == 9 && !obj.IsAir && !obj.favorited && context == 0 && TEHatRack.FitsHatRack(obj)) - return this.TryFitting(inv, context, slot); - } - if ((Main.cursorOverride != 8 || context != 23) && context != 26 && context != 27) - return false; - inv[slot] = Main.player[Main.myPlayer].GetItem(Main.myPlayer, inv[slot], GetItemSettings.InventoryEntityToPlayerInventorySettings); - if (Main.netMode == 1) - NetMessage.SendData(124, number: Main.myPlayer, number2: ((float) this.ID), number3: ((float) slot)); - return true; - } - - public static bool FitsHatRack(Item item) => item.maxStack <= 1 && item.headSlot > 0; - - private bool TryFitting(Item[] inv, int context = 0, int slot = 0, bool justCheck = false) - { - if (!TEHatRack.FitsHatRack(inv[slot])) - return false; - if (justCheck) - return true; - int index1 = TEHatRack.hatTargetSlot; - ++TEHatRack.hatTargetSlot; - for (int index2 = 0; index2 < 2; ++index2) - { - if (this._items[index2].IsAir) - { - index1 = index2; - TEHatRack.hatTargetSlot = index2 + 1; - break; - } - } - for (int index3 = 0; index3 < 2; ++index3) - { - if (inv[slot].type == this._items[index3].type) - index1 = index3; - } - if (TEHatRack.hatTargetSlot >= 2) - TEHatRack.hatTargetSlot = 0; - SoundEngine.PlaySound(7); - Utils.Swap(ref this._items[index1], ref inv[slot]); - if (Main.netMode == 1) - NetMessage.SendData(124, number: Main.myPlayer, number2: ((float) this.ID), number3: ((float) index1)); - return true; - } - - public void WriteItem(int itemIndex, BinaryWriter writer, bool dye) - { - Item dye1 = this._items[itemIndex]; - if (dye) - dye1 = this._dyes[itemIndex]; - writer.Write((ushort) dye1.netID); - writer.Write((ushort) dye1.stack); - writer.Write(dye1.prefix); - } - - public void ReadItem(int itemIndex, BinaryReader reader, bool dye) - { - int Type = (int) reader.ReadUInt16(); - int num = (int) reader.ReadUInt16(); - int pre = (int) reader.ReadByte(); - Item dye1 = this._items[itemIndex]; - if (dye) - dye1 = this._dyes[itemIndex]; - dye1.SetDefaults(Type); - dye1.stack = num; - dye1.Prefix(pre); - } - - public override bool IsTileValidForEntity(int x, int y) => Main.tile[x, y].active() && Main.tile[x, y].type == (ushort) 475 && Main.tile[x, y].frameY == (short) 0 && (int) Main.tile[x, y].frameX % 54 == 0; - - public static bool IsBreakable(int clickX, int clickY) - { - int index1 = clickX; - int index2 = clickY; - int x = index1 - (int) Main.tile[index1, index2].frameX % 54 / 18; - int y = index2 - (int) Main.tile[x, index2].frameY / 18; - int key = TEHatRack.Find(x, y); - return key == -1 || !(TileEntity.ByID[key] as TEHatRack).ContainsItems(); - } - - public bool ContainsItems() - { - for (int index = 0; index < 2; ++index) - { - if (!this._items[index].IsAir || !this._dyes[index].IsAir) - return true; - } - return false; - } - } -} diff --git a/GameContent/Tile_Entities/TEItemFrame.cs b/GameContent/Tile_Entities/TEItemFrame.cs index b6e1174..20d926e 100644 --- a/GameContent/Tile_Entities/TEItemFrame.cs +++ b/GameContent/Tile_Entities/TEItemFrame.cs @@ -1,9 +1,10 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Tile_Entities.TEItemFrame -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe +using System; using System.IO; using Terraria.DataStructures; @@ -11,16 +12,16 @@ namespace Terraria.GameContent.Tile_Entities { public class TEItemFrame : TileEntity { - private static byte _myEntityID; public Item item; - public override void RegisterTileEntityID(int assignedID) => TEItemFrame._myEntityID = (byte) assignedID; + public static void Initialize() => TileEntity._NetPlaceEntity += new Action(TEItemFrame.NetPlaceEntity); - public override void NetPlaceEntityAttempt(int x, int y) => TEItemFrame.NetPlaceEntity(x, y); - - public static void NetPlaceEntity(int x, int y) => NetMessage.SendData(86, number: TEItemFrame.Place(x, y), number2: ((float) x), number3: ((float) y)); - - public override TileEntity GenerateInstance() => (TileEntity) new TEItemFrame(); + public static void NetPlaceEntity(int x, int y, int type) + { + if (type != 1 || !TEItemFrame.ValidTile(x, y)) + return; + NetMessage.SendData(86, number: TEItemFrame.Place(x, y), number2: ((float) x), number3: ((float) y)); + } public TEItemFrame() => this.item = new Item(); @@ -29,33 +30,25 @@ namespace Terraria.GameContent.Tile_Entities TEItemFrame teItemFrame = new TEItemFrame(); teItemFrame.Position = new Point16(x, y); teItemFrame.ID = TileEntity.AssignNewID(); - teItemFrame.type = TEItemFrame._myEntityID; + teItemFrame.type = (byte) 1; TileEntity.ByID[teItemFrame.ID] = (TileEntity) teItemFrame; TileEntity.ByPosition[teItemFrame.Position] = (TileEntity) teItemFrame; return teItemFrame.ID; } - public override bool IsTileValidForEntity(int x, int y) => TEItemFrame.ValidTile(x, y); - - public static int Hook_AfterPlacement( - int x, - int y, - int type = 395, - int style = 0, - int direction = 1, - int alternate = 0) + public static int Hook_AfterPlacement(int x, int y, int type = 395, int style = 0, int direction = 1) { if (Main.netMode != 1) return TEItemFrame.Place(x, y); NetMessage.SendTileSquare(Main.myPlayer, x, y, 2); - NetMessage.SendData(87, number: x, number2: ((float) y), number3: ((float) TEItemFrame._myEntityID)); + NetMessage.SendData(87, number: x, number2: ((float) y), number3: 1f); return -1; } public static void Kill(int x, int y) { TileEntity tileEntity; - if (!TileEntity.ByPosition.TryGetValue(new Point16(x, y), out tileEntity) || (int) tileEntity.type != (int) TEItemFrame._myEntityID) + if (!TileEntity.ByPosition.TryGetValue(new Point16(x, y), out tileEntity) || tileEntity.type != (byte) 1) return; TileEntity.ByID.Remove(tileEntity.ID); TileEntity.ByPosition.Remove(new Point16(x, y)); @@ -64,7 +57,7 @@ namespace Terraria.GameContent.Tile_Entities public static int Find(int x, int y) { TileEntity tileEntity; - return TileEntity.ByPosition.TryGetValue(new Point16(x, y), out tileEntity) && (int) tileEntity.type == (int) TEItemFrame._myEntityID ? tileEntity.ID : -1; + return TileEntity.ByPosition.TryGetValue(new Point16(x, y), out tileEntity) && tileEntity.type == (byte) 1 ? tileEntity.ID : -1; } public static bool ValidTile(int x, int y) => Main.tile[x, y].active() && Main.tile[x, y].type == (ushort) 395 && Main.tile[x, y].frameY == (short) 0 && (int) Main.tile[x, y].frameX % 36 == 0; @@ -84,7 +77,7 @@ namespace Terraria.GameContent.Tile_Entities this.item.stack = (int) reader.ReadInt16(); } - public override string ToString() => this.Position.X.ToString() + "x " + (object) this.Position.Y + "y item: " + (object) this.item; + public override string ToString() => this.Position.X.ToString() + "x " + (object) this.Position.Y + "y item: " + this.item.ToString(); public void DropItem() { @@ -95,7 +88,6 @@ namespace Terraria.GameContent.Tile_Entities public static void TryPlacing(int x, int y, int netid, int prefix, int stack) { - WorldGen.RangeFrame(x, y, x + 2, y + 2); int key = TEItemFrame.Find(x, y); if (key == -1) { @@ -117,66 +109,5 @@ namespace Terraria.GameContent.Tile_Entities NetMessage.SendData(86, number: teItemFrame.ID, number2: ((float) x), number3: ((float) y)); } } - - public static void OnPlayerInteraction(Player player, int clickX, int clickY) - { - if (TEItemFrame.FitsItemFrame(player.inventory[player.selectedItem]) && !player.inventory[player.selectedItem].favorited) - { - player.GamepadEnableGrappleCooldown(); - TEItemFrame.PlaceItemInFrame(player, clickX, clickY); - Recipe.FindRecipes(); - } - else - { - int x = clickX; - int y = clickY; - if ((int) Main.tile[x, y].frameX % 36 != 0) - --x; - if ((int) Main.tile[x, y].frameY % 36 != 0) - --y; - int key = TEItemFrame.Find(x, y); - if (key == -1 || ((TEItemFrame) TileEntity.ByID[key]).item.stack <= 0) - return; - player.GamepadEnableGrappleCooldown(); - WorldGen.KillTile(clickX, clickY, true); - if (Main.netMode != 1) - return; - NetMessage.SendData(17, number2: ((float) x), number3: ((float) y), number4: 1f); - } - } - - public static bool FitsItemFrame(Item i) => i.stack > 0; - - public static void PlaceItemInFrame(Player player, int x, int y) - { - if ((int) Main.tile[x, y].frameX % 36 != 0) - --x; - if ((int) Main.tile[x, y].frameY % 36 != 0) - --y; - int key = TEItemFrame.Find(x, y); - if (key == -1) - return; - if (((TEItemFrame) TileEntity.ByID[key]).item.stack > 0) - { - WorldGen.KillTile(x, y, true); - if (Main.netMode == 1) - NetMessage.SendData(17, number2: ((float) Player.tileTargetX), number3: ((float) y), number4: 1f); - } - if (Main.netMode == 1) - NetMessage.SendData(89, number: x, number2: ((float) y), number3: ((float) player.selectedItem), number4: ((float) player.whoAmI), number5: 1); - else - TEItemFrame.TryPlacing(x, y, player.inventory[player.selectedItem].netID, (int) player.inventory[player.selectedItem].prefix, 1); - --player.inventory[player.selectedItem].stack; - if (player.inventory[player.selectedItem].stack <= 0) - { - player.inventory[player.selectedItem].SetDefaults(); - Main.mouseItem.SetDefaults(); - } - if (player.selectedItem == 58) - Main.mouseItem = player.inventory[player.selectedItem].Clone(); - player.releaseUseItem = false; - player.mouseInterface = true; - WorldGen.RangeFrame(x, y, x + 2, y + 2); - } } } diff --git a/GameContent/Tile_Entities/TELogicSensor.cs b/GameContent/Tile_Entities/TELogicSensor.cs index 7ff94d5..f4f4c72 100644 --- a/GameContent/Tile_Entities/TELogicSensor.cs +++ b/GameContent/Tile_Entities/TELogicSensor.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Tile_Entities.TELogicSensor -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -14,36 +14,31 @@ namespace Terraria.GameContent.Tile_Entities { public class TELogicSensor : TileEntity { - private static byte _myEntityID; private static Dictionary playerBox = new Dictionary(); private static List> tripPoints = new List>(); private static List markedIDsForRemoval = new List(); - private static bool inUpdateLoop; - private static bool playerBoxFilled; + private static bool inUpdateLoop = false; + private static bool playerBoxFilled = false; public TELogicSensor.LogicCheckType logicCheck; public bool On; public int CountedData; - public override void RegisterTileEntityID(int assignedID) + public static void Initialize() { - TELogicSensor._myEntityID = (byte) assignedID; TileEntity._UpdateStart += new Action(TELogicSensor.UpdateStartInternal); TileEntity._UpdateEnd += new Action(TELogicSensor.UpdateEndInternal); + TileEntity._NetPlaceEntity += new Action(TELogicSensor.NetPlaceEntity); } - public override void NetPlaceEntityAttempt(int x, int y) => TELogicSensor.NetPlaceEntity(x, y); - - public static void NetPlaceEntity(int x, int y) + public static void NetPlaceEntity(int x, int y, int type) { + if (type != 2 || !TELogicSensor.ValidTile(x, y)) + return; int num = TELogicSensor.Place(x, y); ((TELogicSensor) TileEntity.ByID[num]).FigureCheckState(); NetMessage.SendData(86, number: num, number2: ((float) x), number3: ((float) y)); } - public override bool IsTileValidForEntity(int x, int y) => TELogicSensor.ValidTile(x, y); - - public override TileEntity GenerateInstance() => (TileEntity) new TELogicSensor(); - private static void UpdateStartInternal() { TELogicSensor.inUpdateLoop = true; @@ -72,15 +67,13 @@ namespace Terraria.GameContent.Tile_Entities { Wiring.blockPlayerTeleportationForOneIteration = tripPoint.Item2; Wiring.HitSwitch((int) tripPoint.Item1.X, (int) tripPoint.Item1.Y); - if (Main.netMode == 2) - NetMessage.SendData(59, number: ((int) tripPoint.Item1.X), number2: ((float) tripPoint.Item1.Y)); } Wiring.blockPlayerTeleportationForOneIteration = false; TELogicSensor.tripPoints.Clear(); foreach (int key in TELogicSensor.markedIDsForRemoval) { TileEntity tileEntity; - if (TileEntity.ByID.TryGetValue(key, out tileEntity) && (int) tileEntity.type == (int) TELogicSensor._myEntityID) + if (TileEntity.ByID.TryGetValue(key, out tileEntity) && tileEntity.type == (byte) 2) TileEntity.ByID.Remove(key); TileEntity.ByPosition.Remove(tileEntity.Position); } @@ -278,19 +271,13 @@ namespace Terraria.GameContent.Tile_Entities TELogicSensor teLogicSensor = new TELogicSensor(); teLogicSensor.Position = new Point16(x, y); teLogicSensor.ID = TileEntity.AssignNewID(); - teLogicSensor.type = TELogicSensor._myEntityID; + teLogicSensor.type = (byte) 2; TileEntity.ByID[teLogicSensor.ID] = (TileEntity) teLogicSensor; TileEntity.ByPosition[teLogicSensor.Position] = (TileEntity) teLogicSensor; return teLogicSensor.ID; } - public static int Hook_AfterPlacement( - int x, - int y, - int type = 423, - int style = 0, - int direction = 1, - int alternate = 0) + public static int Hook_AfterPlacement(int x, int y, int type = 423, int style = 0, int direction = 1) { bool on; TELogicSensor.LogicCheckType type1 = TELogicSensor.FigureCheckType(x, y, out on); @@ -298,7 +285,7 @@ namespace Terraria.GameContent.Tile_Entities if (Main.netMode == 1) { NetMessage.SendTileSquare(Main.myPlayer, x, y, 1); - NetMessage.SendData(87, number: x, number2: ((float) y), number3: ((float) TELogicSensor._myEntityID)); + NetMessage.SendData(87, number: x, number2: ((float) y), number3: 2f); return -1; } int key = TELogicSensor.Place(x, y); @@ -309,25 +296,19 @@ namespace Terraria.GameContent.Tile_Entities public static void Kill(int x, int y) { TileEntity tileEntity; - if (!TileEntity.ByPosition.TryGetValue(new Point16(x, y), out tileEntity) || (int) tileEntity.type != (int) TELogicSensor._myEntityID) + if (!TileEntity.ByPosition.TryGetValue(new Point16(x, y), out tileEntity) || tileEntity.type != (byte) 2) return; Wiring.blockPlayerTeleportationForOneIteration = ((TELogicSensor) tileEntity).logicCheck == TELogicSensor.LogicCheckType.PlayerAbove; - bool flag = false; if (((TELogicSensor) tileEntity).logicCheck == TELogicSensor.LogicCheckType.PlayerAbove && ((TELogicSensor) tileEntity).On) - flag = true; - else if (((TELogicSensor) tileEntity).logicCheck == TELogicSensor.LogicCheckType.Water && ((TELogicSensor) tileEntity).On) - flag = true; - else if (((TELogicSensor) tileEntity).logicCheck == TELogicSensor.LogicCheckType.Lava && ((TELogicSensor) tileEntity).On) - flag = true; - else if (((TELogicSensor) tileEntity).logicCheck == TELogicSensor.LogicCheckType.Honey && ((TELogicSensor) tileEntity).On) - flag = true; - else if (((TELogicSensor) tileEntity).logicCheck == TELogicSensor.LogicCheckType.Liquid && ((TELogicSensor) tileEntity).On) - flag = true; - if (flag) - { Wiring.HitSwitch((int) tileEntity.Position.X, (int) tileEntity.Position.Y); - NetMessage.SendData(59, number: ((int) tileEntity.Position.X), number2: ((float) tileEntity.Position.Y)); - } + if (((TELogicSensor) tileEntity).logicCheck == TELogicSensor.LogicCheckType.Water && ((TELogicSensor) tileEntity).On) + Wiring.HitSwitch((int) tileEntity.Position.X, (int) tileEntity.Position.Y); + if (((TELogicSensor) tileEntity).logicCheck == TELogicSensor.LogicCheckType.Lava && ((TELogicSensor) tileEntity).On) + Wiring.HitSwitch((int) tileEntity.Position.X, (int) tileEntity.Position.Y); + if (((TELogicSensor) tileEntity).logicCheck == TELogicSensor.LogicCheckType.Honey && ((TELogicSensor) tileEntity).On) + Wiring.HitSwitch((int) tileEntity.Position.X, (int) tileEntity.Position.Y); + if (((TELogicSensor) tileEntity).logicCheck == TELogicSensor.LogicCheckType.Liquid && ((TELogicSensor) tileEntity).On) + Wiring.HitSwitch((int) tileEntity.Position.X, (int) tileEntity.Position.Y); Wiring.blockPlayerTeleportationForOneIteration = false; if (TELogicSensor.inUpdateLoop) { @@ -343,7 +324,7 @@ namespace Terraria.GameContent.Tile_Entities public static int Find(int x, int y) { TileEntity tileEntity; - return TileEntity.ByPosition.TryGetValue(new Point16(x, y), out tileEntity) && (int) tileEntity.type == (int) TELogicSensor._myEntityID ? tileEntity.ID : -1; + return TileEntity.ByPosition.TryGetValue(new Point16(x, y), out tileEntity) && tileEntity.type == (byte) 2 ? tileEntity.ID : -1; } public override void WriteExtraData(BinaryWriter writer, bool networkSend) diff --git a/GameContent/Tile_Entities/TETeleportationPylon.cs b/GameContent/Tile_Entities/TETeleportationPylon.cs deleted file mode 100644 index d2ca87b..0000000 --- a/GameContent/Tile_Entities/TETeleportationPylon.cs +++ /dev/null @@ -1,181 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Tile_Entities.TETeleportationPylon -// 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 Terraria.DataStructures; - -namespace Terraria.GameContent.Tile_Entities -{ - public class TETeleportationPylon : TileEntity - { - private static byte _myEntityID; - private const int MyTileID = 597; - private const int entityTileWidth = 3; - private const int entityTileHeight = 4; - - public override void RegisterTileEntityID(int assignedID) => TETeleportationPylon._myEntityID = (byte) assignedID; - - public override TileEntity GenerateInstance() => (TileEntity) new TETeleportationPylon(); - - public override void NetPlaceEntityAttempt(int x, int y) - { - TeleportPylonType pylonType; - if (!this.TryGetPylonTypeFromTileCoords(x, y, out pylonType)) - TETeleportationPylon.RejectPlacementFromNet(x, y); - else if (Main.PylonSystem.HasPylonOfType(pylonType)) - TETeleportationPylon.RejectPlacementFromNet(x, y); - else - NetMessage.SendData(86, number: TETeleportationPylon.Place(x, y), number2: ((float) x), number3: ((float) y)); - } - - public bool TryGetPylonType(out TeleportPylonType pylonType) => this.TryGetPylonTypeFromTileCoords((int) this.Position.X, (int) this.Position.Y, out pylonType); - - private static void RejectPlacementFromNet(int x, int y) - { - WorldGen.KillTile(x, y); - if (Main.netMode != 2) - return; - NetMessage.SendData(17, number2: ((float) x), number3: ((float) y)); - } - - public static int Place(int x, int y) - { - TETeleportationPylon teleportationPylon = new TETeleportationPylon(); - teleportationPylon.Position = new Point16(x, y); - teleportationPylon.ID = TileEntity.AssignNewID(); - teleportationPylon.type = TETeleportationPylon._myEntityID; - TileEntity.ByID[teleportationPylon.ID] = (TileEntity) teleportationPylon; - TileEntity.ByPosition[teleportationPylon.Position] = (TileEntity) teleportationPylon; - Main.PylonSystem.RequestImmediateUpdate(); - return teleportationPylon.ID; - } - - public static void Kill(int x, int y) - { - TileEntity tileEntity; - if (!TileEntity.ByPosition.TryGetValue(new Point16(x, y), out tileEntity) || (int) tileEntity.type != (int) TETeleportationPylon._myEntityID) - return; - TileEntity.ByID.Remove(tileEntity.ID); - TileEntity.ByPosition.Remove(new Point16(x, y)); - Main.PylonSystem.RequestImmediateUpdate(); - } - - public override string ToString() => this.Position.X.ToString() + "x " + (object) this.Position.Y + "y"; - - public static void Framing_CheckTile(int callX, int callY) - { - if (WorldGen.destroyObject) - return; - int num1 = callX; - int num2 = callY; - Tile tileSafely = Framing.GetTileSafely(callX, callY); - int num3 = num1 - (int) tileSafely.frameX / 18 % 3; - int y = num2 - (int) tileSafely.frameY / 18 % 4; - int pylonStyleFromTile = TETeleportationPylon.GetPylonStyleFromTile(tileSafely); - bool flag = false; - for (int index1 = num3; index1 < num3 + 3; ++index1) - { - for (int index2 = y; index2 < y + 4; ++index2) - { - Tile tile = Main.tile[index1, index2]; - if (!tile.active() || tile.type != (ushort) 597) - flag = true; - } - } - if (!WorldGen.SolidTileAllowBottomSlope(num3, y + 4) || !WorldGen.SolidTileAllowBottomSlope(num3 + 1, y + 4) || !WorldGen.SolidTileAllowBottomSlope(num3 + 2, y + 4)) - flag = true; - if (!flag) - return; - TETeleportationPylon.Kill(num3, y); - int typeFromTileStyle = TETeleportationPylon.GetPylonItemTypeFromTileStyle(pylonStyleFromTile); - Item.NewItem(num3 * 16, y * 16, 48, 64, typeFromTileStyle); - WorldGen.destroyObject = true; - for (int i = num3; i < num3 + 3; ++i) - { - for (int j = y; j < y + 4; ++j) - { - if (Main.tile[i, j].active() && Main.tile[i, j].type == (ushort) 597) - WorldGen.KillTile(i, j); - } - } - WorldGen.destroyObject = false; - } - - public static int GetPylonStyleFromTile(Tile tile) => (int) tile.frameX / 54; - - public static int GetPylonItemTypeFromTileStyle(int style) - { - switch (style) - { - case 1: - return 4875; - case 2: - return 4916; - case 3: - return 4917; - case 4: - return 4918; - case 5: - return 4919; - case 6: - return 4920; - case 7: - return 4921; - case 8: - return 4951; - default: - return 4876; - } - } - - public override bool IsTileValidForEntity(int x, int y) => Main.tile[x, y].active() && Main.tile[x, y].type == (ushort) 597 && Main.tile[x, y].frameY == (short) 0 && (int) Main.tile[x, y].frameX % 54 == 0; - - public static int PlacementPreviewHook_AfterPlacement( - int x, - int y, - int type = 597, - int style = 0, - int direction = 1, - int alternate = 0) - { - if (Main.netMode != 1) - return TETeleportationPylon.Place(x - 1, y - 3); - NetMessage.SendTileSquare(Main.myPlayer, x, y - 1, 5); - NetMessage.SendData(87, number: (x - 1), number2: ((float) (y - 3)), number3: ((float) TETeleportationPylon._myEntityID)); - return -1; - } - - public static int PlacementPreviewHook_CheckIfCanPlace( - int x, - int y, - int type = 597, - int style = 0, - int direction = 1, - int alternate = 0) - { - TeleportPylonType fromPylonTileStyle = TETeleportationPylon.GetPylonTypeFromPylonTileStyle(style); - return Main.PylonSystem.HasPylonOfType(fromPylonTileStyle) ? 1 : 0; - } - - private bool TryGetPylonTypeFromTileCoords(int x, int y, out TeleportPylonType pylonType) - { - pylonType = TeleportPylonType.SurfacePurity; - Tile tile = Main.tile[x, y]; - if (tile == null || !tile.active() || tile.type != (ushort) 597) - return false; - int pylonStyle = (int) tile.frameX / 54; - pylonType = TETeleportationPylon.GetPylonTypeFromPylonTileStyle(pylonStyle); - return true; - } - - private static TeleportPylonType GetPylonTypeFromPylonTileStyle(int pylonStyle) => (TeleportPylonType) pylonStyle; - - public static int Find(int x, int y) - { - TileEntity tileEntity; - return TileEntity.ByPosition.TryGetValue(new Point16(x, y), out tileEntity) && (int) tileEntity.type == (int) TETeleportationPylon._myEntityID ? tileEntity.ID : -1; - } - } -} diff --git a/GameContent/Tile_Entities/TETrainingDummy.cs b/GameContent/Tile_Entities/TETrainingDummy.cs index 8be5981..6825f5e 100644 --- a/GameContent/Tile_Entities/TETrainingDummy.cs +++ b/GameContent/Tile_Entities/TETrainingDummy.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.Tile_Entities.TETrainingDummy -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -15,23 +15,21 @@ namespace Terraria.GameContent.Tile_Entities public class TETrainingDummy : TileEntity { private static Dictionary playerBox = new Dictionary(); - private static bool playerBoxFilled; - private static byte _myEntityID; + private static bool playerBoxFilled = false; public int npc; - public override void RegisterTileEntityID(int assignedID) + public static void Initialize() { - TETrainingDummy._myEntityID = (byte) assignedID; TileEntity._UpdateStart += new Action(TETrainingDummy.ClearBoxes); + TileEntity._NetPlaceEntity += new Action(TETrainingDummy.NetPlaceEntity); } - public override void NetPlaceEntityAttempt(int x, int y) => TETrainingDummy.NetPlaceEntity(x, y); - - public static void NetPlaceEntity(int x, int y) => TETrainingDummy.Place(x, y); - - public override TileEntity GenerateInstance() => (TileEntity) new TETrainingDummy(); - - public override bool IsTileValidForEntity(int x, int y) => TETrainingDummy.ValidTile(x, y); + public static void NetPlaceEntity(int x, int y, int type) + { + if (type != 0 || !TETrainingDummy.ValidTile(x, y)) + return; + TETrainingDummy.Place(x, y); + } public static void ClearBoxes() { @@ -92,31 +90,25 @@ namespace Terraria.GameContent.Tile_Entities TETrainingDummy teTrainingDummy = new TETrainingDummy(); teTrainingDummy.Position = new Point16(x, y); teTrainingDummy.ID = TileEntity.AssignNewID(); - teTrainingDummy.type = TETrainingDummy._myEntityID; + teTrainingDummy.type = (byte) 0; TileEntity.ByID[teTrainingDummy.ID] = (TileEntity) teTrainingDummy; TileEntity.ByPosition[teTrainingDummy.Position] = (TileEntity) teTrainingDummy; return teTrainingDummy.ID; } - public static int Hook_AfterPlacement( - int x, - int y, - int type = 378, - int style = 0, - int direction = 1, - int alternate = 0) + public static int Hook_AfterPlacement(int x, int y, int type = 378, int style = 0, int direction = 1) { if (Main.netMode != 1) return TETrainingDummy.Place(x - 1, y - 2); NetMessage.SendTileSquare(Main.myPlayer, x - 1, y - 1, 3); - NetMessage.SendData(87, number: (x - 1), number2: ((float) (y - 2)), number3: ((float) TETrainingDummy._myEntityID)); + NetMessage.SendData(87, number: (x - 1), number2: ((float) (y - 2))); return -1; } public static void Kill(int x, int y) { TileEntity tileEntity; - if (!TileEntity.ByPosition.TryGetValue(new Point16(x, y), out tileEntity) || (int) tileEntity.type != (int) TETrainingDummy._myEntityID) + if (!TileEntity.ByPosition.TryGetValue(new Point16(x, y), out tileEntity) || tileEntity.type != (byte) 0) return; TileEntity.ByID.Remove(tileEntity.ID); TileEntity.ByPosition.Remove(new Point16(x, y)); @@ -125,7 +117,7 @@ namespace Terraria.GameContent.Tile_Entities public static int Find(int x, int y) { TileEntity tileEntity; - return TileEntity.ByPosition.TryGetValue(new Point16(x, y), out tileEntity) && (int) tileEntity.type == (int) TETrainingDummy._myEntityID ? tileEntity.ID : -1; + return TileEntity.ByPosition.TryGetValue(new Point16(x, y), out tileEntity) && tileEntity.type == (byte) 0 ? tileEntity.ID : -1; } public override void WriteExtraData(BinaryWriter writer, bool networkSend) => writer.Write((short) this.npc); diff --git a/GameContent/Tile_Entities/TEWeaponsRack.cs b/GameContent/Tile_Entities/TEWeaponsRack.cs deleted file mode 100644 index 5ed4f47..0000000 --- a/GameContent/Tile_Entities/TEWeaponsRack.cs +++ /dev/null @@ -1,239 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.Tile_Entities.TEWeaponsRack -// 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.IO; -using Terraria.DataStructures; -using Terraria.ID; - -namespace Terraria.GameContent.Tile_Entities -{ - public class TEWeaponsRack : TileEntity - { - private static byte _myEntityID; - public Item item; - private const int MyTileID = 471; - - public TEWeaponsRack() => this.item = new Item(); - - public override void RegisterTileEntityID(int assignedID) => TEWeaponsRack._myEntityID = (byte) assignedID; - - public override TileEntity GenerateInstance() => (TileEntity) new TEWeaponsRack(); - - public override void NetPlaceEntityAttempt(int x, int y) => TEWeaponsRack.NetPlaceEntity(x, y); - - public static void NetPlaceEntity(int x, int y) => NetMessage.SendData(86, number: TEWeaponsRack.Place(x, y), number2: ((float) x), number3: ((float) y)); - - public override bool IsTileValidForEntity(int x, int y) => TEWeaponsRack.ValidTile(x, y); - - public static bool ValidTile(int x, int y) => Main.tile[x, y].active() && Main.tile[x, y].type == (ushort) 471 && Main.tile[x, y].frameY == (short) 0 && (int) Main.tile[x, y].frameX % 54 == 0; - - public static int Place(int x, int y) - { - TEWeaponsRack teWeaponsRack = new TEWeaponsRack(); - teWeaponsRack.Position = new Point16(x, y); - teWeaponsRack.ID = TileEntity.AssignNewID(); - teWeaponsRack.type = TEWeaponsRack._myEntityID; - TileEntity.ByID[teWeaponsRack.ID] = (TileEntity) teWeaponsRack; - TileEntity.ByPosition[teWeaponsRack.Position] = (TileEntity) teWeaponsRack; - return teWeaponsRack.ID; - } - - public static int Hook_AfterPlacement( - int x, - int y, - int type = 471, - int style = 0, - int direction = 1, - int alternate = 0) - { - if (Main.netMode != 1) - return TEWeaponsRack.Place(x, y); - NetMessage.SendTileSquare(Main.myPlayer, x, y, 5); - NetMessage.SendData(87, number: x, number2: ((float) y), number3: ((float) TEWeaponsRack._myEntityID)); - return -1; - } - - public static void Kill(int x, int y) - { - TileEntity tileEntity; - if (!TileEntity.ByPosition.TryGetValue(new Point16(x, y), out tileEntity) || (int) tileEntity.type != (int) TEWeaponsRack._myEntityID) - return; - TileEntity.ByID.Remove(tileEntity.ID); - TileEntity.ByPosition.Remove(new Point16(x, y)); - } - - public static int Find(int x, int y) - { - TileEntity tileEntity; - return TileEntity.ByPosition.TryGetValue(new Point16(x, y), out tileEntity) && (int) tileEntity.type == (int) TEWeaponsRack._myEntityID ? tileEntity.ID : -1; - } - - public override void WriteExtraData(BinaryWriter writer, bool networkSend) - { - writer.Write((short) this.item.netID); - writer.Write(this.item.prefix); - writer.Write((short) this.item.stack); - } - - public override void ReadExtraData(BinaryReader reader, bool networkSend) - { - this.item = new Item(); - this.item.netDefaults((int) reader.ReadInt16()); - this.item.Prefix((int) reader.ReadByte()); - this.item.stack = (int) reader.ReadInt16(); - } - - public override string ToString() => this.Position.X.ToString() + "x " + (object) this.Position.Y + "y item: " + (object) this.item; - - public static void Framing_CheckTile(int callX, int callY) - { - int num1 = 3; - int num2 = 3; - if (WorldGen.destroyObject) - return; - int num3 = callX; - int num4 = callY; - Tile tileSafely = Framing.GetTileSafely(callX, callY); - int x = num3 - (int) tileSafely.frameX / 18 % num1; - int y = num4 - (int) tileSafely.frameY / 18 % num2; - bool flag = false; - for (int index1 = x; index1 < x + num1; ++index1) - { - for (int index2 = y; index2 < y + num2; ++index2) - { - Tile tile = Main.tile[index1, index2]; - if (!tile.active() || tile.type != (ushort) 471 || tile.wall == (ushort) 0) - flag = true; - } - } - if (!flag) - return; - Item.NewItem(x * 16, y * 16, 48, 48, 2699); - WorldGen.destroyObject = true; - int key = TEWeaponsRack.Find(x, y); - if (key != -1) - { - TEWeaponsRack teWeaponsRack = (TEWeaponsRack) TileEntity.ByID[key]; - if (!teWeaponsRack.item.IsAir) - teWeaponsRack.DropItem(); - } - for (int i = x; i < x + num1; ++i) - { - for (int j = y; j < y + num2; ++j) - { - if (Main.tile[i, j].active() && Main.tile[i, j].type == (ushort) 471) - WorldGen.KillTile(i, j); - } - } - WorldGen.destroyObject = false; - } - - public void DropItem() - { - if (Main.netMode != 1) - Item.NewItem((int) this.Position.X * 16, (int) this.Position.Y * 16, 32, 32, this.item.netID, pfix: ((int) this.item.prefix)); - this.item = new Item(); - } - - public static void TryPlacing(int x, int y, int netid, int prefix, int stack) - { - WorldGen.RangeFrame(x, y, x + 3, y + 3); - int key = TEWeaponsRack.Find(x, y); - if (key == -1) - { - int number = Item.NewItem(x * 16, y * 16, 32, 32, 1); - Main.item[number].netDefaults(netid); - Main.item[number].Prefix(prefix); - Main.item[number].stack = stack; - NetMessage.SendData(21, number: number); - } - else - { - TEWeaponsRack teWeaponsRack = (TEWeaponsRack) TileEntity.ByID[key]; - if (teWeaponsRack.item.stack > 0) - teWeaponsRack.DropItem(); - teWeaponsRack.item = new Item(); - teWeaponsRack.item.netDefaults(netid); - teWeaponsRack.item.Prefix(prefix); - teWeaponsRack.item.stack = stack; - NetMessage.SendData(86, number: teWeaponsRack.ID, number2: ((float) x), number3: ((float) y)); - } - } - - public static void OnPlayerInteraction(Player player, int clickX, int clickY) - { - if (TEWeaponsRack.FitsWeaponFrame(player.inventory[player.selectedItem]) && !player.inventory[player.selectedItem].favorited) - { - player.GamepadEnableGrappleCooldown(); - TEWeaponsRack.PlaceItemInFrame(player, clickX, clickY); - Recipe.FindRecipes(); - } - else - { - int index1 = clickX; - int index2 = clickY; - int index3 = index1 - (int) Main.tile[index1, index2].frameX % 54 / 18; - int num = index2 - (int) Main.tile[index3, index2].frameY % 54 / 18; - int key = TEWeaponsRack.Find(index3, num); - if (key == -1 || ((TEWeaponsRack) TileEntity.ByID[key]).item.stack <= 0) - return; - player.GamepadEnableGrappleCooldown(); - WorldGen.KillTile(index3, num, true); - if (Main.netMode != 1) - return; - NetMessage.SendData(17, number2: ((float) index3), number3: ((float) num), number4: 1f); - } - } - - public static bool FitsWeaponFrame(Item i) - { - if (!i.IsAir && (i.fishingPole > 0 || ItemID.Sets.CanBePlacedOnWeaponRacks[i.type])) - return true; - return i.damage > 0 && i.useStyle != 0 && i.stack > 0; - } - - private static void PlaceItemInFrame(Player player, int x, int y) - { - x -= (int) Main.tile[x, y].frameX % 54 / 18; - y -= (int) Main.tile[x, y].frameY % 54 / 18; - int key = TEWeaponsRack.Find(x, y); - if (key == -1) - return; - if (((TEWeaponsRack) TileEntity.ByID[key]).item.stack > 0) - { - WorldGen.KillTile(x, y, true); - if (Main.netMode == 1) - NetMessage.SendData(17, number2: ((float) Player.tileTargetX), number3: ((float) y), number4: 1f); - } - if (Main.netMode == 1) - NetMessage.SendData(123, number: x, number2: ((float) y), number3: ((float) player.selectedItem), number4: ((float) player.whoAmI), number5: 1); - else - TEWeaponsRack.TryPlacing(x, y, player.inventory[player.selectedItem].netID, (int) player.inventory[player.selectedItem].prefix, 1); - --player.inventory[player.selectedItem].stack; - if (player.inventory[player.selectedItem].stack <= 0) - { - player.inventory[player.selectedItem].SetDefaults(); - Main.mouseItem.SetDefaults(); - } - if (player.selectedItem == 58) - Main.mouseItem = player.inventory[player.selectedItem].Clone(); - player.releaseUseItem = false; - player.mouseInterface = true; - WorldGen.RangeFrame(x, y, x + 3, y + 3); - } - - public static bool KillTileDropItem(Tile tileCache, int i, int j) - { - int key = TEWeaponsRack.Find(i - (int) tileCache.frameX % 54 / 18, j - (int) tileCache.frameY % 54 / 18); - if (key == -1 || ((TEWeaponsRack) TileEntity.ByID[key]).item.stack <= 0) - return false; - ((TEWeaponsRack) TileEntity.ByID[key]).DropItem(); - if (Main.netMode != 2) - Main.LocalPlayer.InterruptItemUsageIfOverTile(471); - return true; - } - } -} diff --git a/GameContent/TownNPCProfiles.cs b/GameContent/TownNPCProfiles.cs deleted file mode 100644 index 4f33b14..0000000 --- a/GameContent/TownNPCProfiles.cs +++ /dev/null @@ -1,160 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.TownNPCProfiles -// 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.Collections.Generic; - -namespace Terraria.GameContent -{ - public class TownNPCProfiles - { - private const string DefaultNPCFileFolderPath = "Images/TownNPCs/"; - private static readonly int[] CatHeadIDs = new int[6] - { - 27, - 28, - 29, - 30, - 31, - 32 - }; - private static readonly int[] DogHeadIDs = new int[6] - { - 33, - 34, - 35, - 36, - 37, - 38 - }; - private static readonly int[] BunnyHeadIDs = new int[6] - { - 39, - 40, - 41, - 42, - 43, - 44 - }; - private Dictionary _townNPCProfiles = new Dictionary() - { - { - 369, - (ITownNPCProfile) new Profiles.LegacyNPCProfile("Images/TownNPCs/Angler", 22) - }, - { - 633, - (ITownNPCProfile) new Profiles.TransformableNPCProfile("Images/TownNPCs/BestiaryGirl", 26) - }, - { - 54, - (ITownNPCProfile) new Profiles.LegacyNPCProfile("Images/TownNPCs/Clothier", 7) - }, - { - 209, - (ITownNPCProfile) new Profiles.LegacyNPCProfile("Images/TownNPCs/Cyborg", 16) - }, - { - 38, - (ITownNPCProfile) new Profiles.LegacyNPCProfile("Images/TownNPCs/Demolitionist", 4) - }, - { - 207, - (ITownNPCProfile) new Profiles.LegacyNPCProfile("Images/TownNPCs/DyeTrader", 14) - }, - { - 588, - (ITownNPCProfile) new Profiles.LegacyNPCProfile("Images/TownNPCs/Golfer", 25) - }, - { - 124, - (ITownNPCProfile) new Profiles.LegacyNPCProfile("Images/TownNPCs/Mechanic", 8) - }, - { - 17, - (ITownNPCProfile) new Profiles.LegacyNPCProfile("Images/TownNPCs/Merchant", 2) - }, - { - 18, - (ITownNPCProfile) new Profiles.LegacyNPCProfile("Images/TownNPCs/Nurse", 3) - }, - { - 227, - (ITownNPCProfile) new Profiles.LegacyNPCProfile("Images/TownNPCs/Painter", 17) - }, - { - 229, - (ITownNPCProfile) new Profiles.LegacyNPCProfile("Images/TownNPCs/Pirate", 19) - }, - { - 142, - (ITownNPCProfile) new Profiles.LegacyNPCProfile("Images/TownNPCs/Santa", 11) - }, - { - 453, - (ITownNPCProfile) new Profiles.LegacyNPCProfile("Images/TownNPCs/SkeletonMerchant", -1) - }, - { - 178, - (ITownNPCProfile) new Profiles.LegacyNPCProfile("Images/TownNPCs/Steampunker", 13) - }, - { - 353, - (ITownNPCProfile) new Profiles.LegacyNPCProfile("Images/TownNPCs/Stylist", 20) - }, - { - 441, - (ITownNPCProfile) new Profiles.LegacyNPCProfile("Images/TownNPCs/TaxCollector", 23) - }, - { - 368, - (ITownNPCProfile) new Profiles.LegacyNPCProfile("Images/TownNPCs/TravelingMerchant", 21) - }, - { - 108, - (ITownNPCProfile) new Profiles.LegacyNPCProfile("Images/TownNPCs/Wizard", 10) - }, - { - 637, - (ITownNPCProfile) new Profiles.VariantNPCProfile("Images/TownNPCs/Cat", "Cat", TownNPCProfiles.CatHeadIDs, new string[6] - { - "Siamese", - "Black", - "OrangeTabby", - "RussianBlue", - "Silver", - "White" - }) - }, - { - 638, - (ITownNPCProfile) new Profiles.VariantNPCProfile("Images/TownNPCs/Dog", "Dog", TownNPCProfiles.DogHeadIDs, new string[6] - { - "Labrador", - "PitBull", - "Beagle", - "Corgi", - "Dalmation", - "Husky" - }) - }, - { - 656, - (ITownNPCProfile) new Profiles.VariantNPCProfile("Images/TownNPCs/Bunny", "Bunny", TownNPCProfiles.BunnyHeadIDs, new string[6] - { - "White", - "Angora", - "Dutch", - "Flemish", - "Lop", - "Silver" - }) - } - }; - public static TownNPCProfiles Instance = new TownNPCProfiles(); - - public bool GetProfile(int npcId, out ITownNPCProfile profile) => this._townNPCProfiles.TryGetValue(npcId, out profile); - } -} diff --git a/GameContent/TownRoomManager.cs b/GameContent/TownRoomManager.cs index 5e3c25a..91014d8 100644 --- a/GameContent/TownRoomManager.cs +++ b/GameContent/TownRoomManager.cs @@ -1,31 +1,31 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.TownRoomManager -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using System; using System.Collections.Generic; using System.IO; -using Terraria.ID; namespace Terraria.GameContent { public class TownRoomManager { private List> _roomLocationPairs = new List>(); - private bool[] _hasRoom = new bool[663]; + private bool[] _hasRoom = new bool[580]; - public void AddOccupantsToList(int x, int y, List occupantsList) => this.AddOccupantsToList(new Point(x, y), occupantsList); + public int FindOccupation(int x, int y) => this.FindOccupation(new Point(x, y)); - public void AddOccupantsToList(Point tilePosition, List occupants) + public int FindOccupation(Point tilePosition) { foreach (Tuple roomLocationPair in this._roomLocationPairs) { if (roomLocationPair.Item2 == tilePosition) - occupants.Add(roomLocationPair.Item1); + return roomLocationPair.Item1; } + return -1; } public bool HasRoomQuick(int npcID) => this._hasRoom[npcID]; @@ -77,15 +77,12 @@ namespace Terraria.GameContent public void Save(BinaryWriter writer) { - lock (this._roomLocationPairs) + writer.Write(this._roomLocationPairs.Count); + foreach (Tuple roomLocationPair in this._roomLocationPairs) { - writer.Write(this._roomLocationPairs.Count); - foreach (Tuple roomLocationPair in this._roomLocationPairs) - { - writer.Write(roomLocationPair.Item1); - writer.Write(roomLocationPair.Item2.X); - writer.Write(roomLocationPair.Item2.Y); - } + writer.Write(roomLocationPair.Item1); + writer.Write(roomLocationPair.Item2.X); + writer.Write(roomLocationPair.Item2.Y); } } @@ -118,15 +115,5 @@ namespace Terraria.GameContent num = (byte) 2; return num; } - - public bool CanNPCsLiveWithEachOther(int npc1ByType, NPC npc2) - { - NPC npc1; - return !ContentSamples.NpcsByNetId.TryGetValue(npc1ByType, out npc1) || this.CanNPCsLiveWithEachOther(npc1, npc2); - } - - public bool CanNPCsLiveWithEachOther(NPC npc1, NPC npc2) => npc1.housingCategory != npc2.housingCategory; - - public bool CanNPCsLiveWithEachOther_ShopHelper(NPC npc1, NPC npc2) => this.CanNPCsLiveWithEachOther(npc1, npc2); } } diff --git a/GameContent/TreePaintSystemData.cs b/GameContent/TreePaintSystemData.cs deleted file mode 100644 index fb7179b..0000000 --- a/GameContent/TreePaintSystemData.cs +++ /dev/null @@ -1,377 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.TreePaintSystemData -// 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 -{ - public static class TreePaintSystemData - { - private static TreePaintingSettings DefaultNoSpecialGroups = new TreePaintingSettings() - { - UseSpecialGroups = false - }; - private static TreePaintingSettings DefaultNoSpecialGroups_ForWalls = new TreePaintingSettings() - { - UseSpecialGroups = false, - UseWallShaderHacks = true - }; - private static TreePaintingSettings DefaultDirt = new TreePaintingSettings() - { - UseSpecialGroups = true, - SpecialGroupMinimalHueValue = 0.03f, - SpecialGroupMaximumHueValue = 0.08f, - SpecialGroupMinimumSaturationValue = 0.38f, - SpecialGroupMaximumSaturationValue = 0.53f, - InvertSpecialGroupResult = true - }; - private static TreePaintingSettings CullMud = new TreePaintingSettings() - { - UseSpecialGroups = true, - HueTestOffset = 0.5f, - SpecialGroupMinimalHueValue = 0.42f, - SpecialGroupMaximumHueValue = 0.55f, - SpecialGroupMinimumSaturationValue = 0.2f, - SpecialGroupMaximumSaturationValue = 0.27f, - InvertSpecialGroupResult = true - }; - private static TreePaintingSettings WoodPurity = new TreePaintingSettings() - { - UseSpecialGroups = true, - SpecialGroupMinimalHueValue = 0.1666667f, - SpecialGroupMaximumHueValue = 0.8333333f, - SpecialGroupMinimumSaturationValue = 0.0f, - SpecialGroupMaximumSaturationValue = 1f - }; - private static TreePaintingSettings WoodCorruption = new TreePaintingSettings() - { - UseSpecialGroups = true, - SpecialGroupMinimalHueValue = 0.5f, - SpecialGroupMaximumHueValue = 1f, - SpecialGroupMinimumSaturationValue = 0.27f, - SpecialGroupMaximumSaturationValue = 1f - }; - private static TreePaintingSettings WoodJungle = new TreePaintingSettings() - { - UseSpecialGroups = true, - SpecialGroupMinimalHueValue = 0.1666667f, - SpecialGroupMaximumHueValue = 0.8333333f, - SpecialGroupMinimumSaturationValue = 0.0f, - SpecialGroupMaximumSaturationValue = 1f - }; - private static TreePaintingSettings WoodHallow = new TreePaintingSettings() - { - UseSpecialGroups = true, - SpecialGroupMinimalHueValue = 0.0f, - SpecialGroupMaximumHueValue = 1f, - SpecialGroupMinimumSaturationValue = 0.0f, - SpecialGroupMaximumSaturationValue = 0.34f, - InvertSpecialGroupResult = true - }; - private static TreePaintingSettings WoodSnow = new TreePaintingSettings() - { - UseSpecialGroups = true, - SpecialGroupMinimalHueValue = 0.0f, - SpecialGroupMaximumHueValue = 0.06944445f, - SpecialGroupMinimumSaturationValue = 0.0f, - SpecialGroupMaximumSaturationValue = 1f - }; - private static TreePaintingSettings WoodCrimson = new TreePaintingSettings() - { - UseSpecialGroups = true, - SpecialGroupMinimalHueValue = 0.3333333f, - SpecialGroupMaximumHueValue = 0.6666667f, - SpecialGroupMinimumSaturationValue = 0.0f, - SpecialGroupMaximumSaturationValue = 1f, - InvertSpecialGroupResult = true - }; - private static TreePaintingSettings WoodJungleUnderground = new TreePaintingSettings() - { - UseSpecialGroups = true, - SpecialGroupMinimalHueValue = 0.1666667f, - SpecialGroupMaximumHueValue = 0.8333333f, - SpecialGroupMinimumSaturationValue = 0.0f, - SpecialGroupMaximumSaturationValue = 1f - }; - private static TreePaintingSettings WoodGlowingMushroom = new TreePaintingSettings() - { - UseSpecialGroups = true, - SpecialGroupMinimalHueValue = 0.5f, - SpecialGroupMaximumHueValue = 0.8333333f, - SpecialGroupMinimumSaturationValue = 0.0f, - SpecialGroupMaximumSaturationValue = 1f - }; - private static TreePaintingSettings VanityCherry = new TreePaintingSettings() - { - UseSpecialGroups = true, - SpecialGroupMinimalHueValue = 0.8333333f, - SpecialGroupMaximumHueValue = 1f, - SpecialGroupMinimumSaturationValue = 0.0f, - SpecialGroupMaximumSaturationValue = 1f - }; - private static TreePaintingSettings VanityYellowWillow = new TreePaintingSettings() - { - UseSpecialGroups = true, - SpecialGroupMinimalHueValue = 0.0f, - SpecialGroupMaximumHueValue = 0.025f, - SpecialGroupMinimumSaturationValue = 0.0f, - SpecialGroupMaximumSaturationValue = 1f, - InvertSpecialGroupResult = true - }; - private static TreePaintingSettings GemTreeRuby = new TreePaintingSettings() - { - UseSpecialGroups = true, - SpecialGroupMinimalHueValue = 0.0f, - SpecialGroupMaximumHueValue = 1f, - SpecialGroupMinimumSaturationValue = 0.0f, - SpecialGroupMaximumSaturationValue = 1f / 360f, - InvertSpecialGroupResult = true - }; - private static TreePaintingSettings GemTreeAmber = new TreePaintingSettings() - { - UseSpecialGroups = true, - SpecialGroupMinimalHueValue = 0.0f, - SpecialGroupMaximumHueValue = 1f, - SpecialGroupMinimumSaturationValue = 0.0f, - SpecialGroupMaximumSaturationValue = 1f / 360f, - InvertSpecialGroupResult = true - }; - private static TreePaintingSettings GemTreeSapphire = new TreePaintingSettings() - { - UseSpecialGroups = true, - SpecialGroupMinimalHueValue = 0.0f, - SpecialGroupMaximumHueValue = 1f, - SpecialGroupMinimumSaturationValue = 0.0f, - SpecialGroupMaximumSaturationValue = 1f / 360f, - InvertSpecialGroupResult = true - }; - private static TreePaintingSettings GemTreeEmerald = new TreePaintingSettings() - { - UseSpecialGroups = true, - SpecialGroupMinimalHueValue = 0.0f, - SpecialGroupMaximumHueValue = 1f, - SpecialGroupMinimumSaturationValue = 0.0f, - SpecialGroupMaximumSaturationValue = 1f / 360f, - InvertSpecialGroupResult = true - }; - private static TreePaintingSettings GemTreeAmethyst = new TreePaintingSettings() - { - UseSpecialGroups = true, - SpecialGroupMinimalHueValue = 0.0f, - SpecialGroupMaximumHueValue = 1f, - SpecialGroupMinimumSaturationValue = 0.0f, - SpecialGroupMaximumSaturationValue = 1f / 360f, - InvertSpecialGroupResult = true - }; - private static TreePaintingSettings GemTreeTopaz = new TreePaintingSettings() - { - UseSpecialGroups = true, - SpecialGroupMinimalHueValue = 0.0f, - SpecialGroupMaximumHueValue = 1f, - SpecialGroupMinimumSaturationValue = 0.0f, - SpecialGroupMaximumSaturationValue = 1f / 360f, - InvertSpecialGroupResult = true - }; - private static TreePaintingSettings GemTreeDiamond = new TreePaintingSettings() - { - UseSpecialGroups = true, - SpecialGroupMinimalHueValue = 0.0f, - SpecialGroupMaximumHueValue = 1f, - SpecialGroupMinimumSaturationValue = 0.0f, - SpecialGroupMaximumSaturationValue = 1f / 360f, - InvertSpecialGroupResult = true - }; - private static TreePaintingSettings PalmTreePurity = new TreePaintingSettings() - { - UseSpecialGroups = true, - SpecialGroupMinimalHueValue = 0.1527778f, - SpecialGroupMaximumHueValue = 0.25f, - SpecialGroupMinimumSaturationValue = 0.88f, - SpecialGroupMaximumSaturationValue = 1f - }; - private static TreePaintingSettings PalmTreeCorruption = new TreePaintingSettings() - { - UseSpecialGroups = true, - SpecialGroupMinimalHueValue = 0.0f, - SpecialGroupMaximumHueValue = 1f, - SpecialGroupMinimumSaturationValue = 0.4f, - SpecialGroupMaximumSaturationValue = 1f - }; - private static TreePaintingSettings PalmTreeCrimson = new TreePaintingSettings() - { - UseSpecialGroups = true, - HueTestOffset = 0.5f, - SpecialGroupMinimalHueValue = 0.3333333f, - SpecialGroupMaximumHueValue = 0.5277778f, - SpecialGroupMinimumSaturationValue = 0.0f, - SpecialGroupMaximumSaturationValue = 1f - }; - private static TreePaintingSettings PalmTreeHallow = new TreePaintingSettings() - { - UseSpecialGroups = true, - SpecialGroupMinimalHueValue = 0.5f, - SpecialGroupMaximumHueValue = 0.6111111f, - SpecialGroupMinimumSaturationValue = 0.0f, - SpecialGroupMaximumSaturationValue = 1f - }; - - public static TreePaintingSettings GetTileSettings( - int tileType, - int tileStyle) - { - switch (tileType) - { - case 0: - case 2: - case 23: - case 109: - case 199: - case 477: - case 492: - return TreePaintSystemData.DefaultDirt; - case 5: - switch (tileStyle) - { - case 0: - return TreePaintSystemData.WoodCorruption; - case 1: - return TreePaintSystemData.WoodJungle; - case 2: - return TreePaintSystemData.WoodHallow; - case 3: - return TreePaintSystemData.WoodSnow; - case 4: - return TreePaintSystemData.WoodCrimson; - case 5: - return TreePaintSystemData.WoodJungleUnderground; - case 6: - return TreePaintSystemData.WoodGlowingMushroom; - default: - return TreePaintSystemData.WoodPurity; - } - case 59: - case 60: - case 70: - return TreePaintSystemData.CullMud; - case 323: - switch (tileStyle) - { - case 0: - case 4: - return TreePaintSystemData.PalmTreePurity; - case 1: - case 5: - return TreePaintSystemData.PalmTreeCrimson; - case 2: - case 6: - return TreePaintSystemData.PalmTreeHallow; - case 3: - case 7: - return TreePaintSystemData.PalmTreeCorruption; - default: - return TreePaintSystemData.WoodPurity; - } - case 583: - return TreePaintSystemData.GemTreeTopaz; - case 584: - return TreePaintSystemData.GemTreeAmethyst; - case 585: - return TreePaintSystemData.GemTreeSapphire; - case 586: - return TreePaintSystemData.GemTreeEmerald; - case 587: - return TreePaintSystemData.GemTreeRuby; - case 588: - return TreePaintSystemData.GemTreeDiamond; - case 589: - return TreePaintSystemData.GemTreeAmber; - case 595: - case 596: - return TreePaintSystemData.VanityCherry; - case 615: - case 616: - return TreePaintSystemData.VanityYellowWillow; - default: - return TreePaintSystemData.DefaultNoSpecialGroups; - } - } - - public static TreePaintingSettings GetTreeFoliageSettings( - int foliageIndex, - int foliageStyle) - { - switch (foliageIndex) - { - case 0: - case 6: - case 7: - case 8: - case 9: - case 10: - return TreePaintSystemData.WoodPurity; - case 1: - return TreePaintSystemData.WoodCorruption; - case 2: - case 11: - case 13: - return TreePaintSystemData.WoodJungle; - case 3: - case 19: - case 20: - return TreePaintSystemData.WoodHallow; - case 4: - case 12: - case 16: - case 17: - case 18: - return TreePaintSystemData.WoodSnow; - case 5: - return TreePaintSystemData.WoodCrimson; - case 14: - return TreePaintSystemData.WoodGlowingMushroom; - case 15: - case 21: - switch (foliageStyle) - { - case 0: - case 4: - return TreePaintSystemData.PalmTreePurity; - case 1: - case 5: - return TreePaintSystemData.PalmTreeCrimson; - case 2: - case 6: - return TreePaintSystemData.PalmTreeHallow; - case 3: - case 7: - return TreePaintSystemData.PalmTreeCorruption; - default: - return TreePaintSystemData.WoodPurity; - } - case 22: - return TreePaintSystemData.GemTreeTopaz; - case 23: - return TreePaintSystemData.GemTreeAmethyst; - case 24: - return TreePaintSystemData.GemTreeSapphire; - case 25: - return TreePaintSystemData.GemTreeEmerald; - case 26: - return TreePaintSystemData.GemTreeRuby; - case 27: - return TreePaintSystemData.GemTreeDiamond; - case 28: - return TreePaintSystemData.GemTreeAmber; - case 29: - return TreePaintSystemData.VanityCherry; - case 30: - return TreePaintSystemData.VanityYellowWillow; - default: - return TreePaintSystemData.DefaultDirt; - } - } - - public static TreePaintingSettings GetWallSettings(int wallType) => TreePaintSystemData.DefaultNoSpecialGroups_ForWalls; - } -} diff --git a/GameContent/TreePaintingSettings.cs b/GameContent/TreePaintingSettings.cs deleted file mode 100644 index 59923e1..0000000 --- a/GameContent/TreePaintingSettings.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.TreePaintingSettings -// 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 -{ - public class TreePaintingSettings - { - public float SpecialGroupMinimalHueValue; - public float SpecialGroupMaximumHueValue; - public float SpecialGroupMinimumSaturationValue; - public float SpecialGroupMaximumSaturationValue; - public float HueTestOffset; - public bool UseSpecialGroups; - public bool UseWallShaderHacks; - public bool InvertSpecialGroupResult; - } -} diff --git a/GameContent/TreeTopsInfo.cs b/GameContent/TreeTopsInfo.cs deleted file mode 100644 index 9778c9b..0000000 --- a/GameContent/TreeTopsInfo.cs +++ /dev/null @@ -1,183 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.TreeTopsInfo -// 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; -using System.IO; -using Terraria.ID; -using Terraria.Utilities; - -namespace Terraria.GameContent -{ - public class TreeTopsInfo - { - private int[] _variations = new int[13]; - - public void Save(BinaryWriter writer) - { - writer.Write(this._variations.Length); - for (int index = 0; index < this._variations.Length; ++index) - writer.Write(this._variations[index]); - } - - public void Load(BinaryReader reader, int loadVersion) - { - if (loadVersion < 211) - { - this.CopyExistingWorldInfo(); - } - else - { - int num = reader.ReadInt32(); - for (int index = 0; index < num && index < this._variations.Length; ++index) - this._variations[index] = reader.ReadInt32(); - } - } - - public void SyncSend(BinaryWriter writer) - { - for (int index = 0; index < this._variations.Length; ++index) - writer.Write((byte) this._variations[index]); - } - - public void SyncReceive(BinaryReader reader) - { - for (int areaID = 0; areaID < this._variations.Length; ++areaID) - { - int variation = this._variations[areaID]; - this._variations[areaID] = (int) reader.ReadByte(); - if (this._variations[areaID] != variation) - this.DoTreeFX(areaID); - } - } - - public int GetTreeStyle(int areaId) => this._variations[areaId]; - - public void RandomizeTreeStyleBasedOnWorldPosition(UnifiedRandom rand, Vector2 worldPosition) - { - Point pt = new Point((int) ((double) worldPosition.X / 16.0), (int) ((double) worldPosition.Y / 16.0) + 1); - Tile tileSafely = Framing.GetTileSafely(pt); - if (!tileSafely.active()) - return; - int areaId = -1; - if (tileSafely.type == (ushort) 70) - areaId = 11; - else if (tileSafely.type == (ushort) 53 && WorldGen.oceanDepths(pt.X, pt.Y)) - areaId = 10; - else if (tileSafely.type == (ushort) 23) - areaId = 4; - else if (tileSafely.type == (ushort) 199) - areaId = 8; - else if (tileSafely.type == (ushort) 109 || tileSafely.type == (ushort) 492) - areaId = 7; - else if (tileSafely.type == (ushort) 53) - areaId = 9; - else if (tileSafely.type == (ushort) 147) - areaId = 6; - else if (tileSafely.type == (ushort) 60) - areaId = 5; - else if (tileSafely.type == (ushort) 2 || tileSafely.type == (ushort) 477) - areaId = pt.X >= Main.treeX[0] ? (pt.X >= Main.treeX[1] ? (pt.X >= Main.treeX[2] ? 3 : 2) : 1) : 0; - if (areaId <= -1) - return; - this.RandomizeTreeStyle(rand, areaId); - } - - public void RandomizeTreeStyle(UnifiedRandom rand, int areaId) - { - int variation = this._variations[areaId]; - bool flag = false; - while (this._variations[areaId] == variation) - { - switch (areaId) - { - case 0: - case 1: - case 2: - case 3: - this._variations[areaId] = rand.Next(6); - break; - case 4: - this._variations[areaId] = rand.Next(5); - break; - case 5: - this._variations[areaId] = rand.Next(6); - break; - case 6: - this._variations[areaId] = rand.NextFromList(0, 1, 2, 21, 22, 3, 31, 32, 4, 41, 42, 5, 6, 7); - break; - case 7: - this._variations[areaId] = rand.Next(5); - break; - case 8: - this._variations[areaId] = rand.Next(6); - break; - case 9: - this._variations[areaId] = rand.Next(5); - break; - case 10: - this._variations[areaId] = rand.Next(6); - break; - case 11: - this._variations[areaId] = rand.Next(4); - break; - default: - flag = true; - break; - } - if (flag) - break; - } - if (variation == this._variations[areaId]) - return; - if (Main.netMode == 2) - NetMessage.SendData(7); - else - this.DoTreeFX(areaId); - } - - private void DoTreeFX(int areaID) - { - } - - public void CopyExistingWorldInfoForWorldGeneration() => this.CopyExistingWorldInfo(); - - private void CopyExistingWorldInfo() - { - this._variations[0] = Main.treeStyle[0]; - this._variations[1] = Main.treeStyle[1]; - this._variations[2] = Main.treeStyle[2]; - this._variations[3] = Main.treeStyle[3]; - this._variations[4] = WorldGen.corruptBG; - this._variations[5] = WorldGen.jungleBG; - this._variations[6] = WorldGen.snowBG; - this._variations[7] = WorldGen.hallowBG; - this._variations[8] = WorldGen.crimsonBG; - this._variations[9] = WorldGen.desertBG; - this._variations[10] = WorldGen.oceanBG; - this._variations[11] = WorldGen.mushroomBG; - this._variations[12] = WorldGen.underworldBG; - } - - public class AreaId - { - public static SetFactory Factory = new SetFactory(13); - public const int Forest1 = 0; - public const int Forest2 = 1; - public const int Forest3 = 2; - public const int Forest4 = 3; - public const int Corruption = 4; - public const int Jungle = 5; - public const int Snow = 6; - public const int Hallow = 7; - public const int Crimson = 8; - public const int Desert = 9; - public const int Ocean = 10; - public const int GlowingMushroom = 11; - public const int Underworld = 12; - public const int Count = 13; - } - } -} diff --git a/GameContent/UI/BigProgressBar/BigProgressBarHelper.cs b/GameContent/UI/BigProgressBar/BigProgressBarHelper.cs deleted file mode 100644 index 8d6cd10..0000000 --- a/GameContent/UI/BigProgressBar/BigProgressBarHelper.cs +++ /dev/null @@ -1,116 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.BigProgressBar.BigProgressBarHelper -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; - -namespace Terraria.GameContent.UI.BigProgressBar -{ - public class BigProgressBarHelper - { - private const string _bossBarTexturePath = "Images/UI/UI_BossBar"; - - public static void DrawBareBonesBar(SpriteBatch spriteBatch, float lifePercent) - { - Rectangle destinationRectangle1 = Utils.CenteredRectangle(Main.ScreenSize.ToVector2() * new Vector2(0.5f, 1f) + new Vector2(0.0f, -50f), new Vector2(400f, 20f)); - Rectangle destinationRectangle2 = destinationRectangle1; - destinationRectangle2.Inflate(2, 2); - Texture2D texture = TextureAssets.MagicPixel.Value; - Rectangle rectangle = new Rectangle(0, 0, 1, 1); - Rectangle destinationRectangle3 = destinationRectangle1; - destinationRectangle3.Width = (int) ((double) destinationRectangle3.Width * (double) lifePercent); - spriteBatch.Draw(texture, destinationRectangle2, new Rectangle?(rectangle), Color.White * 0.6f); - spriteBatch.Draw(texture, destinationRectangle1, new Rectangle?(rectangle), Color.Black * 0.6f); - spriteBatch.Draw(texture, destinationRectangle3, new Rectangle?(rectangle), Color.LimeGreen * 0.5f); - } - - public static void DrawFancyBar( - SpriteBatch spriteBatch, - float lifePercent, - Texture2D barIconTexture, - Rectangle barIconFrame) - { - Texture2D texture2D = Main.Assets.Request("Images/UI/UI_BossBar", (AssetRequestMode) 1).Value; - Point p1 = new Point(456, 22); - Point p2 = new Point(32, 24); - int verticalFrames = 6; - Rectangle rectangle1 = texture2D.Frame(verticalFrames: verticalFrames, frameY: 3); - Color color = Color.White * 0.2f; - int num1 = (int) ((double) p1.X * (double) lifePercent); - int num2 = num1 - num1 % 2; - Rectangle rectangle2 = texture2D.Frame(verticalFrames: verticalFrames, frameY: 2); - rectangle2.X += p2.X; - rectangle2.Y += p2.Y; - rectangle2.Width = 2; - rectangle2.Height = p1.Y; - Rectangle rectangle3 = texture2D.Frame(verticalFrames: verticalFrames, frameY: 1); - rectangle3.X += p2.X; - rectangle3.Y += p2.Y; - rectangle3.Width = 2; - rectangle3.Height = p1.Y; - Rectangle r = Utils.CenteredRectangle(Main.ScreenSize.ToVector2() * new Vector2(0.5f, 1f) + new Vector2(0.0f, -50f), p1.ToVector2()); - Vector2 position = r.TopLeft() - p2.ToVector2(); - spriteBatch.Draw(texture2D, position, new Rectangle?(rectangle1), color, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - spriteBatch.Draw(texture2D, r.TopLeft(), new Rectangle?(rectangle2), Color.White, 0.0f, Vector2.Zero, new Vector2((float) (num2 / rectangle2.Width), 1f), SpriteEffects.None, 0.0f); - spriteBatch.Draw(texture2D, r.TopLeft() + new Vector2((float) (num2 - 2), 0.0f), new Rectangle?(rectangle3), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - Rectangle rectangle4 = texture2D.Frame(verticalFrames: verticalFrames); - spriteBatch.Draw(texture2D, position, new Rectangle?(rectangle4), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - Vector2 vector2 = new Vector2(4f, 20f) + new Vector2(26f, 28f) / 2f; - spriteBatch.Draw(barIconTexture, position + vector2, new Rectangle?(barIconFrame), Color.White, 0.0f, barIconFrame.Size() / 2f, 1f, SpriteEffects.None, 0.0f); - } - - public static void DrawFancyBar( - SpriteBatch spriteBatch, - float lifePercent, - Texture2D barIconTexture, - Rectangle barIconFrame, - float shieldPercent) - { - Texture2D texture2D = Main.Assets.Request("Images/UI/UI_BossBar", (AssetRequestMode) 1).Value; - Point p1 = new Point(456, 22); - Point p2 = new Point(32, 24); - int verticalFrames = 6; - Rectangle rectangle1 = texture2D.Frame(verticalFrames: verticalFrames, frameY: 3); - Color color = Color.White * 0.2f; - int num1 = (int) ((double) p1.X * (double) lifePercent); - int num2 = num1 - num1 % 2; - Rectangle rectangle2 = texture2D.Frame(verticalFrames: verticalFrames, frameY: 2); - rectangle2.X += p2.X; - rectangle2.Y += p2.Y; - rectangle2.Width = 2; - rectangle2.Height = p1.Y; - Rectangle rectangle3 = texture2D.Frame(verticalFrames: verticalFrames, frameY: 1); - rectangle3.X += p2.X; - rectangle3.Y += p2.Y; - rectangle3.Width = 2; - rectangle3.Height = p1.Y; - int num3 = (int) ((double) p1.X * (double) shieldPercent); - int num4 = num3 - num3 % 2; - Rectangle rectangle4 = texture2D.Frame(verticalFrames: verticalFrames, frameY: 5); - rectangle4.X += p2.X; - rectangle4.Y += p2.Y; - rectangle4.Width = 2; - rectangle4.Height = p1.Y; - Rectangle rectangle5 = texture2D.Frame(verticalFrames: verticalFrames, frameY: 4); - rectangle5.X += p2.X; - rectangle5.Y += p2.Y; - rectangle5.Width = 2; - rectangle5.Height = p1.Y; - Rectangle r = Utils.CenteredRectangle(Main.ScreenSize.ToVector2() * new Vector2(0.5f, 1f) + new Vector2(0.0f, -50f), p1.ToVector2()); - Vector2 position = r.TopLeft() - p2.ToVector2(); - spriteBatch.Draw(texture2D, position, new Rectangle?(rectangle1), color, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - spriteBatch.Draw(texture2D, r.TopLeft(), new Rectangle?(rectangle2), Color.White, 0.0f, Vector2.Zero, new Vector2((float) (num2 / rectangle2.Width), 1f), SpriteEffects.None, 0.0f); - spriteBatch.Draw(texture2D, r.TopLeft() + new Vector2((float) (num2 - 2), 0.0f), new Rectangle?(rectangle3), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - spriteBatch.Draw(texture2D, r.TopLeft(), new Rectangle?(rectangle4), Color.White, 0.0f, Vector2.Zero, new Vector2((float) (num4 / rectangle4.Width), 1f), SpriteEffects.None, 0.0f); - spriteBatch.Draw(texture2D, r.TopLeft() + new Vector2((float) (num4 - 2), 0.0f), new Rectangle?(rectangle5), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - Rectangle rectangle6 = texture2D.Frame(verticalFrames: verticalFrames); - spriteBatch.Draw(texture2D, position, new Rectangle?(rectangle6), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - Vector2 vector2 = new Vector2(4f, 20f) + barIconFrame.Size() / 2f; - spriteBatch.Draw(barIconTexture, position + vector2, new Rectangle?(barIconFrame), Color.White, 0.0f, barIconFrame.Size() / 2f, 1f, SpriteEffects.None, 0.0f); - } - } -} diff --git a/GameContent/UI/BigProgressBar/BigProgressBarInfo.cs b/GameContent/UI/BigProgressBar/BigProgressBarInfo.cs deleted file mode 100644 index c9f713b..0000000 --- a/GameContent/UI/BigProgressBar/BigProgressBarInfo.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.BigProgressBar.BigProgressBarInfo -// 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.UI.BigProgressBar -{ - public struct BigProgressBarInfo - { - public int npcIndexToAimAt; - public bool validatedAtLeastOnce; - } -} diff --git a/GameContent/UI/BigProgressBar/BigProgressBarSystem.cs b/GameContent/UI/BigProgressBar/BigProgressBarSystem.cs deleted file mode 100644 index 38b3b6e..0000000 --- a/GameContent/UI/BigProgressBar/BigProgressBarSystem.cs +++ /dev/null @@ -1,185 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.BigProgressBar.BigProgressBarSystem -// 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; -using Microsoft.Xna.Framework.Graphics; -using System.Collections.Generic; - -namespace Terraria.GameContent.UI.BigProgressBar -{ - public class BigProgressBarSystem - { - private IBigProgressBar _currentBar; - private CommonBossBigProgressBar _bossBar = new CommonBossBigProgressBar(); - private BigProgressBarInfo _info; - private static TwinsBigProgressBar _twinsBar = new TwinsBigProgressBar(); - private static EaterOfWorldsProgressBar _eaterOfWorldsBar = new EaterOfWorldsProgressBar(); - private static BrainOfCthuluBigProgressBar _brainOfCthuluBar = new BrainOfCthuluBigProgressBar(); - private static GolemHeadProgressBar _golemBar = new GolemHeadProgressBar(); - private static MoonLordProgressBar _moonlordBar = new MoonLordProgressBar(); - private static SolarFlarePillarBigProgressBar _solarPillarBar = new SolarFlarePillarBigProgressBar(); - private static VortexPillarBigProgressBar _vortexPillarBar = new VortexPillarBigProgressBar(); - private static NebulaPillarBigProgressBar _nebulaPillarBar = new NebulaPillarBigProgressBar(); - private static StardustPillarBigProgressBar _stardustPillarBar = new StardustPillarBigProgressBar(); - private static NeverValidProgressBar _neverValid = new NeverValidProgressBar(); - private static PirateShipBigProgressBar _pirateShipBar = new PirateShipBigProgressBar(); - private static MartianSaucerBigProgressBar _martianSaucerBar = new MartianSaucerBigProgressBar(); - private Dictionary _bossBarsByNpcNetId = new Dictionary() - { - { - 125, - (IBigProgressBar) BigProgressBarSystem._twinsBar - }, - { - 126, - (IBigProgressBar) BigProgressBarSystem._twinsBar - }, - { - 13, - (IBigProgressBar) BigProgressBarSystem._eaterOfWorldsBar - }, - { - 14, - (IBigProgressBar) BigProgressBarSystem._eaterOfWorldsBar - }, - { - 15, - (IBigProgressBar) BigProgressBarSystem._eaterOfWorldsBar - }, - { - 266, - (IBigProgressBar) BigProgressBarSystem._brainOfCthuluBar - }, - { - 245, - (IBigProgressBar) BigProgressBarSystem._golemBar - }, - { - 246, - (IBigProgressBar) BigProgressBarSystem._golemBar - }, - { - 517, - (IBigProgressBar) BigProgressBarSystem._solarPillarBar - }, - { - 422, - (IBigProgressBar) BigProgressBarSystem._vortexPillarBar - }, - { - 507, - (IBigProgressBar) BigProgressBarSystem._nebulaPillarBar - }, - { - 493, - (IBigProgressBar) BigProgressBarSystem._stardustPillarBar - }, - { - 398, - (IBigProgressBar) BigProgressBarSystem._moonlordBar - }, - { - 396, - (IBigProgressBar) BigProgressBarSystem._moonlordBar - }, - { - 397, - (IBigProgressBar) BigProgressBarSystem._moonlordBar - }, - { - 548, - (IBigProgressBar) BigProgressBarSystem._neverValid - }, - { - 549, - (IBigProgressBar) BigProgressBarSystem._neverValid - }, - { - 491, - (IBigProgressBar) BigProgressBarSystem._pirateShipBar - }, - { - 492, - (IBigProgressBar) BigProgressBarSystem._pirateShipBar - }, - { - 440, - (IBigProgressBar) BigProgressBarSystem._neverValid - }, - { - 395, - (IBigProgressBar) BigProgressBarSystem._martianSaucerBar - }, - { - 393, - (IBigProgressBar) BigProgressBarSystem._martianSaucerBar - }, - { - 394, - (IBigProgressBar) BigProgressBarSystem._martianSaucerBar - }, - { - 68, - (IBigProgressBar) BigProgressBarSystem._neverValid - } - }; - - public void Update() - { - if (this._currentBar == null) - this.TryFindingNPCToTrack(); - if (this._currentBar == null || this._currentBar.ValidateAndCollectNecessaryInfo(ref this._info)) - return; - this._currentBar = (IBigProgressBar) null; - } - - public void Draw(SpriteBatch spriteBatch) - { - if (this._currentBar == null) - return; - this._currentBar.Draw(ref this._info, spriteBatch); - } - - private void TryFindingNPCToTrack() - { - Rectangle rectangle = new Rectangle((int) Main.screenPosition.X, (int) Main.screenPosition.Y, Main.screenWidth, Main.screenHeight); - rectangle.Inflate(5000, 5000); - float num1 = float.PositiveInfinity; - for (int npcIndex = 0; npcIndex < 200; ++npcIndex) - { - NPC npc = Main.npc[npcIndex]; - if (npc.active && npc.Hitbox.Intersects(rectangle)) - { - float num2 = npc.Distance(Main.LocalPlayer.Center); - if ((double) num1 > (double) num2 && this.TryTracking(npcIndex)) - num1 = num2; - } - } - } - - public bool TryTracking(int npcIndex) - { - if (npcIndex < 0 || npcIndex > 200) - return false; - NPC npc = Main.npc[npcIndex]; - if (!npc.active) - return false; - BigProgressBarInfo info = new BigProgressBarInfo() - { - npcIndexToAimAt = npcIndex - }; - IBigProgressBar bigProgressBar1 = (IBigProgressBar) this._bossBar; - IBigProgressBar bigProgressBar2; - if (this._bossBarsByNpcNetId.TryGetValue(npc.netID, out bigProgressBar2)) - bigProgressBar1 = bigProgressBar2; - if (!bigProgressBar1.ValidateAndCollectNecessaryInfo(ref info)) - return false; - this._currentBar = bigProgressBar1; - this._info = info; - return true; - } - } -} diff --git a/GameContent/UI/BigProgressBar/BrainOfCthuluBigProgressBar.cs b/GameContent/UI/BigProgressBar/BrainOfCthuluBigProgressBar.cs deleted file mode 100644 index 0f7167f..0000000 --- a/GameContent/UI/BigProgressBar/BrainOfCthuluBigProgressBar.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.BigProgressBar.BrainOfCthuluBigProgressBar -// 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; -using Microsoft.Xna.Framework.Graphics; -using Terraria.ID; - -namespace Terraria.GameContent.UI.BigProgressBar -{ - public class BrainOfCthuluBigProgressBar : IBigProgressBar - { - private float _lifePercentToShow; - private NPC _creeperForReference; - - public BrainOfCthuluBigProgressBar() => this._creeperForReference = new NPC(); - - public bool ValidateAndCollectNecessaryInfo(ref BigProgressBarInfo info) - { - if (info.npcIndexToAimAt < 0 || info.npcIndexToAimAt > 200) - return false; - NPC npc1 = Main.npc[info.npcIndexToAimAt]; - if (!npc1.active) - return false; - int cthuluCreepersCount = NPC.GetBrainOfCthuluCreepersCount(); - this._creeperForReference.SetDefaults(267, npc1.GetMatchingSpawnParams()); - int num1 = this._creeperForReference.lifeMax * cthuluCreepersCount; - float num2 = 0.0f; - for (int index = 0; index < 200; ++index) - { - NPC npc2 = Main.npc[index]; - if (npc2.active && npc2.type == this._creeperForReference.type) - num2 += (float) npc2.life; - } - this._lifePercentToShow = Utils.Clamp(((float) npc1.life + num2) / (float) (npc1.lifeMax + num1), 0.0f, 1f); - return true; - } - - public void Draw(ref BigProgressBarInfo info, SpriteBatch spriteBatch) - { - int bossHeadTexture = NPCID.Sets.BossHeadTextures[266]; - Texture2D texture2D = TextureAssets.NpcHeadBoss[bossHeadTexture].Value; - Rectangle barIconFrame = texture2D.Frame(); - BigProgressBarHelper.DrawFancyBar(spriteBatch, this._lifePercentToShow, texture2D, barIconFrame); - } - } -} diff --git a/GameContent/UI/BigProgressBar/CommonBossBigProgressBar.cs b/GameContent/UI/BigProgressBar/CommonBossBigProgressBar.cs deleted file mode 100644 index add7715..0000000 --- a/GameContent/UI/BigProgressBar/CommonBossBigProgressBar.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.BigProgressBar.CommonBossBigProgressBar -// 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; -using Microsoft.Xna.Framework.Graphics; - -namespace Terraria.GameContent.UI.BigProgressBar -{ - public class CommonBossBigProgressBar : IBigProgressBar - { - private float _lifePercentToShow; - private int _headIndex; - - public bool ValidateAndCollectNecessaryInfo(ref BigProgressBarInfo info) - { - if (info.npcIndexToAimAt < 0 || info.npcIndexToAimAt > 200) - return false; - NPC npc = Main.npc[info.npcIndexToAimAt]; - if (!npc.active) - return false; - int headTextureIndex = npc.GetBossHeadTextureIndex(); - if (headTextureIndex == -1) - return false; - this._lifePercentToShow = Utils.Clamp((float) npc.life / (float) npc.lifeMax, 0.0f, 1f); - this._headIndex = headTextureIndex; - return true; - } - - public void Draw(ref BigProgressBarInfo info, SpriteBatch spriteBatch) - { - Texture2D texture2D = TextureAssets.NpcHeadBoss[this._headIndex].Value; - Rectangle barIconFrame = texture2D.Frame(); - BigProgressBarHelper.DrawFancyBar(spriteBatch, this._lifePercentToShow, texture2D, barIconFrame); - } - } -} diff --git a/GameContent/UI/BigProgressBar/EaterOfWorldsProgressBar.cs b/GameContent/UI/BigProgressBar/EaterOfWorldsProgressBar.cs deleted file mode 100644 index b06eaef..0000000 --- a/GameContent/UI/BigProgressBar/EaterOfWorldsProgressBar.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.BigProgressBar.EaterOfWorldsProgressBar -// 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; -using Microsoft.Xna.Framework.Graphics; -using Terraria.ID; - -namespace Terraria.GameContent.UI.BigProgressBar -{ - public class EaterOfWorldsProgressBar : IBigProgressBar - { - private float _lifePercentToShow; - - public bool ValidateAndCollectNecessaryInfo(ref BigProgressBarInfo info) - { - if (info.npcIndexToAimAt < 0 || info.npcIndexToAimAt > 200 || !Main.npc[info.npcIndexToAimAt].active && !this.TryFindingAnotherEOWPiece(ref info)) - return false; - int worldsSegmentsCount = NPC.GetEaterOfWorldsSegmentsCount(); - float num = 0.0f; - for (int index = 0; index < 200; ++index) - { - NPC npc = Main.npc[index]; - if (npc.active && npc.type >= 13 && npc.type <= 15) - num += (float) npc.life / (float) npc.lifeMax; - } - this._lifePercentToShow = Utils.Clamp(num / (float) worldsSegmentsCount, 0.0f, 1f); - return true; - } - - public void Draw(ref BigProgressBarInfo info, SpriteBatch spriteBatch) - { - int bossHeadTexture = NPCID.Sets.BossHeadTextures[13]; - Texture2D texture2D = TextureAssets.NpcHeadBoss[bossHeadTexture].Value; - Rectangle barIconFrame = texture2D.Frame(); - BigProgressBarHelper.DrawFancyBar(spriteBatch, this._lifePercentToShow, texture2D, barIconFrame); - } - - private bool TryFindingAnotherEOWPiece(ref BigProgressBarInfo info) - { - for (int index = 0; index < 200; ++index) - { - NPC npc = Main.npc[index]; - if (npc.active && npc.type >= 13 && npc.type <= 15) - { - info.npcIndexToAimAt = index; - return true; - } - } - return false; - } - } -} diff --git a/GameContent/UI/BigProgressBar/GolemHeadProgressBar.cs b/GameContent/UI/BigProgressBar/GolemHeadProgressBar.cs deleted file mode 100644 index f6d6b08..0000000 --- a/GameContent/UI/BigProgressBar/GolemHeadProgressBar.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.BigProgressBar.GolemHeadProgressBar -// 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; -using Microsoft.Xna.Framework.Graphics; -using System.Collections.Generic; -using Terraria.ID; - -namespace Terraria.GameContent.UI.BigProgressBar -{ - public class GolemHeadProgressBar : IBigProgressBar - { - private float _lifePercentToShow; - private NPC _referenceDummy; - private HashSet ValidIds = new HashSet() - { - 246, - 245 - }; - - public GolemHeadProgressBar() => this._referenceDummy = new NPC(); - - public bool ValidateAndCollectNecessaryInfo(ref BigProgressBarInfo info) - { - if (info.npcIndexToAimAt < 0 || info.npcIndexToAimAt > 200) - return false; - NPC npc1 = Main.npc[info.npcIndexToAimAt]; - if (!npc1.active && !this.TryFindingAnotherGolemPiece(ref info)) - return false; - int num1 = 0; - this._referenceDummy.SetDefaults(245, npc1.GetMatchingSpawnParams()); - int num2 = num1 + this._referenceDummy.lifeMax; - this._referenceDummy.SetDefaults(246, npc1.GetMatchingSpawnParams()); - int num3 = num2 + this._referenceDummy.lifeMax; - float num4 = 0.0f; - for (int index = 0; index < 200; ++index) - { - NPC npc2 = Main.npc[index]; - if (npc2.active && this.ValidIds.Contains(npc2.type)) - num4 += (float) npc2.life; - } - this._lifePercentToShow = Utils.Clamp(num4 / (float) num3, 0.0f, 1f); - return true; - } - - public void Draw(ref BigProgressBarInfo info, SpriteBatch spriteBatch) - { - int bossHeadTexture = NPCID.Sets.BossHeadTextures[246]; - Texture2D texture2D = TextureAssets.NpcHeadBoss[bossHeadTexture].Value; - Rectangle barIconFrame = texture2D.Frame(); - BigProgressBarHelper.DrawFancyBar(spriteBatch, this._lifePercentToShow, texture2D, barIconFrame); - } - - private bool TryFindingAnotherGolemPiece(ref BigProgressBarInfo info) - { - for (int index = 0; index < 200; ++index) - { - NPC npc = Main.npc[index]; - if (npc.active && this.ValidIds.Contains(npc.type)) - { - info.npcIndexToAimAt = index; - return true; - } - } - return false; - } - } -} diff --git a/GameContent/UI/BigProgressBar/IBigProgressBar.cs b/GameContent/UI/BigProgressBar/IBigProgressBar.cs deleted file mode 100644 index 4d17f13..0000000 --- a/GameContent/UI/BigProgressBar/IBigProgressBar.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.BigProgressBar.IBigProgressBar -// 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.Graphics; - -namespace Terraria.GameContent.UI.BigProgressBar -{ - internal interface IBigProgressBar - { - bool ValidateAndCollectNecessaryInfo(ref BigProgressBarInfo info); - - void Draw(ref BigProgressBarInfo info, SpriteBatch spriteBatch); - } -} diff --git a/GameContent/UI/BigProgressBar/LunarPillarBigProgessBar.cs b/GameContent/UI/BigProgressBar/LunarPillarBigProgessBar.cs deleted file mode 100644 index d7a7bff..0000000 --- a/GameContent/UI/BigProgressBar/LunarPillarBigProgessBar.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.BigProgressBar.LunarPillarBigProgessBar -// 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; -using Microsoft.Xna.Framework.Graphics; - -namespace Terraria.GameContent.UI.BigProgressBar -{ - public abstract class LunarPillarBigProgessBar : IBigProgressBar - { - private float _lifePercentToShow; - private float _shieldPercentToShow; - private int _headIndex; - - public bool ValidateAndCollectNecessaryInfo(ref BigProgressBarInfo info) - { - if (info.npcIndexToAimAt < 0 || info.npcIndexToAimAt > 200) - return false; - NPC npc = Main.npc[info.npcIndexToAimAt]; - if (!npc.active) - return false; - int headTextureIndex = npc.GetBossHeadTextureIndex(); - if (headTextureIndex == -1 || !this.IsPlayerInCombatArea() || (double) npc.ai[2] == 1.0) - return false; - float num1 = Utils.Clamp((float) npc.life / (float) npc.lifeMax, 0.0f, 1f); - float num2 = this.GetCurrentShieldValue() / this.GetMaxShieldValue(); - double num3 = 600.0 * (double) Main.GameModeInfo.EnemyMaxLifeMultiplier * (double) this.GetMaxShieldValue() / (double) npc.lifeMax; - this._lifePercentToShow = num1; - this._shieldPercentToShow = num2; - this._headIndex = headTextureIndex; - return true; - } - - public void Draw(ref BigProgressBarInfo info, SpriteBatch spriteBatch) - { - Texture2D texture2D = TextureAssets.NpcHeadBoss[this._headIndex].Value; - Rectangle barIconFrame = texture2D.Frame(); - BigProgressBarHelper.DrawFancyBar(spriteBatch, this._lifePercentToShow, texture2D, barIconFrame, this._shieldPercentToShow); - } - - internal abstract float GetCurrentShieldValue(); - - internal abstract float GetMaxShieldValue(); - - internal abstract bool IsPlayerInCombatArea(); - } -} diff --git a/GameContent/UI/BigProgressBar/MartianSaucerBigProgressBar.cs b/GameContent/UI/BigProgressBar/MartianSaucerBigProgressBar.cs deleted file mode 100644 index d2ef7aa..0000000 --- a/GameContent/UI/BigProgressBar/MartianSaucerBigProgressBar.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.BigProgressBar.MartianSaucerBigProgressBar -// 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; -using Microsoft.Xna.Framework.Graphics; -using System.Collections.Generic; -using Terraria.ID; - -namespace Terraria.GameContent.UI.BigProgressBar -{ - public class MartianSaucerBigProgressBar : IBigProgressBar - { - private float _lifePercentToShow; - private NPC _referenceDummy; - private HashSet ValidIds = new HashSet() - { - 395 - }; - private HashSet ValidIdsToScanHp = new HashSet() - { - 395, - 393, - 394 - }; - - public MartianSaucerBigProgressBar() => this._referenceDummy = new NPC(); - - public bool ValidateAndCollectNecessaryInfo(ref BigProgressBarInfo info) - { - if (info.npcIndexToAimAt < 0 || info.npcIndexToAimAt > 200) - return false; - NPC npc1 = Main.npc[info.npcIndexToAimAt]; - if (!npc1.active || npc1.type != 395) - { - if (!this.TryFindingAnotherMartianSaucerPiece(ref info)) - return false; - npc1 = Main.npc[info.npcIndexToAimAt]; - } - int num1 = 0; - if (Main.expertMode) - { - this._referenceDummy.SetDefaults(395, npc1.GetMatchingSpawnParams()); - num1 += this._referenceDummy.lifeMax; - } - this._referenceDummy.SetDefaults(394, npc1.GetMatchingSpawnParams()); - int num2 = num1 + this._referenceDummy.lifeMax * 2; - this._referenceDummy.SetDefaults(393, npc1.GetMatchingSpawnParams()); - int num3 = num2 + this._referenceDummy.lifeMax * 2; - float num4 = 0.0f; - for (int index = 0; index < 200; ++index) - { - NPC npc2 = Main.npc[index]; - if (npc2.active && this.ValidIdsToScanHp.Contains(npc2.type) && (Main.expertMode || npc2.type != 395)) - num4 += (float) npc2.life; - } - this._lifePercentToShow = Utils.Clamp(num4 / (float) num3, 0.0f, 1f); - return true; - } - - public void Draw(ref BigProgressBarInfo info, SpriteBatch spriteBatch) - { - int bossHeadTexture = NPCID.Sets.BossHeadTextures[395]; - Texture2D texture2D = TextureAssets.NpcHeadBoss[bossHeadTexture].Value; - Rectangle barIconFrame = texture2D.Frame(); - BigProgressBarHelper.DrawFancyBar(spriteBatch, this._lifePercentToShow, texture2D, barIconFrame); - } - - private bool TryFindingAnotherMartianSaucerPiece(ref BigProgressBarInfo info) - { - for (int index = 0; index < 200; ++index) - { - NPC npc = Main.npc[index]; - if (npc.active && this.ValidIds.Contains(npc.type)) - { - info.npcIndexToAimAt = index; - return true; - } - } - return false; - } - } -} diff --git a/GameContent/UI/BigProgressBar/MoonLordProgressBar.cs b/GameContent/UI/BigProgressBar/MoonLordProgressBar.cs deleted file mode 100644 index f26915e..0000000 --- a/GameContent/UI/BigProgressBar/MoonLordProgressBar.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.BigProgressBar.MoonLordProgressBar -// 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; -using Microsoft.Xna.Framework.Graphics; -using System.Collections.Generic; -using Terraria.ID; - -namespace Terraria.GameContent.UI.BigProgressBar -{ - public class MoonLordProgressBar : IBigProgressBar - { - private float _lifePercentToShow; - private NPC _referenceDummy; - private HashSet ValidIds = new HashSet() - { - 396, - 397, - 398 - }; - - public MoonLordProgressBar() => this._referenceDummy = new NPC(); - - public bool ValidateAndCollectNecessaryInfo(ref BigProgressBarInfo info) - { - if (info.npcIndexToAimAt < 0 || info.npcIndexToAimAt > 200) - return false; - NPC npc1 = Main.npc[info.npcIndexToAimAt]; - if ((!npc1.active || this.IsInBadAI(npc1)) && !this.TryFindingAnotherMoonLordPiece(ref info)) - return false; - int num1 = 0; - NPCSpawnParams spawnparams = new NPCSpawnParams() - { - strengthMultiplierOverride = new float?(npc1.strengthMultiplier), - playerCountForMultiplayerDifficultyOverride = new int?(npc1.statsAreScaledForThisManyPlayers) - }; - this._referenceDummy.SetDefaults(398, spawnparams); - int num2 = num1 + this._referenceDummy.lifeMax; - this._referenceDummy.SetDefaults(396, spawnparams); - int num3 = num2 + this._referenceDummy.lifeMax; - this._referenceDummy.SetDefaults(397, spawnparams); - int num4 = num3 + this._referenceDummy.lifeMax + this._referenceDummy.lifeMax; - float num5 = 0.0f; - for (int index = 0; index < 200; ++index) - { - NPC npc2 = Main.npc[index]; - if (npc2.active && this.ValidIds.Contains(npc2.type) && !this.IsInBadAI(npc2)) - num5 += (float) npc2.life; - } - this._lifePercentToShow = Utils.Clamp(num5 / (float) num4, 0.0f, 1f); - return true; - } - - private bool IsInBadAI(NPC npc) => npc.type == 398 && ((double) npc.ai[0] == 2.0 || (double) npc.ai[0] == -1.0) || (double) npc.ai[0] == -2.0 || (double) npc.ai[0] == -3.0; - - public void Draw(ref BigProgressBarInfo info, SpriteBatch spriteBatch) - { - int bossHeadTexture = NPCID.Sets.BossHeadTextures[396]; - Texture2D texture2D = TextureAssets.NpcHeadBoss[bossHeadTexture].Value; - Rectangle barIconFrame = texture2D.Frame(); - BigProgressBarHelper.DrawFancyBar(spriteBatch, this._lifePercentToShow, texture2D, barIconFrame); - } - - private bool TryFindingAnotherMoonLordPiece(ref BigProgressBarInfo info) - { - for (int index = 0; index < 200; ++index) - { - NPC npc = Main.npc[index]; - if (npc.active && this.ValidIds.Contains(npc.type) && !this.IsInBadAI(npc)) - { - info.npcIndexToAimAt = index; - return true; - } - } - return false; - } - } -} diff --git a/GameContent/UI/BigProgressBar/NebulaPillarBigProgressBar.cs b/GameContent/UI/BigProgressBar/NebulaPillarBigProgressBar.cs deleted file mode 100644 index b8fa038..0000000 --- a/GameContent/UI/BigProgressBar/NebulaPillarBigProgressBar.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.BigProgressBar.NebulaPillarBigProgressBar -// 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.UI.BigProgressBar -{ - public class NebulaPillarBigProgressBar : LunarPillarBigProgessBar - { - internal override float GetCurrentShieldValue() => (float) NPC.ShieldStrengthTowerNebula; - - internal override float GetMaxShieldValue() => (float) NPC.ShieldStrengthTowerMax; - - internal override bool IsPlayerInCombatArea() => Main.LocalPlayer.ZoneTowerNebula; - } -} diff --git a/GameContent/UI/BigProgressBar/NeverValidProgressBar.cs b/GameContent/UI/BigProgressBar/NeverValidProgressBar.cs deleted file mode 100644 index 6b3f060..0000000 --- a/GameContent/UI/BigProgressBar/NeverValidProgressBar.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.BigProgressBar.NeverValidProgressBar -// 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.Graphics; - -namespace Terraria.GameContent.UI.BigProgressBar -{ - public class NeverValidProgressBar : IBigProgressBar - { - public bool ValidateAndCollectNecessaryInfo(ref BigProgressBarInfo info) => false; - - public void Draw(ref BigProgressBarInfo info, SpriteBatch spriteBatch) - { - } - } -} diff --git a/GameContent/UI/BigProgressBar/PirateShipBigProgressBar.cs b/GameContent/UI/BigProgressBar/PirateShipBigProgressBar.cs deleted file mode 100644 index ae13172..0000000 --- a/GameContent/UI/BigProgressBar/PirateShipBigProgressBar.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.BigProgressBar.PirateShipBigProgressBar -// 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; -using Microsoft.Xna.Framework.Graphics; -using System.Collections.Generic; -using Terraria.ID; - -namespace Terraria.GameContent.UI.BigProgressBar -{ - public class PirateShipBigProgressBar : IBigProgressBar - { - private float _lifePercentToShow; - private NPC _referenceDummy; - private HashSet ValidIds = new HashSet() - { - 491 - }; - - public PirateShipBigProgressBar() => this._referenceDummy = new NPC(); - - public bool ValidateAndCollectNecessaryInfo(ref BigProgressBarInfo info) - { - if (info.npcIndexToAimAt < 0 || info.npcIndexToAimAt > 200) - return false; - NPC npc1 = Main.npc[info.npcIndexToAimAt]; - if (!npc1.active || npc1.type != 491) - { - if (!this.TryFindingAnotherPirateShipPiece(ref info)) - return false; - npc1 = Main.npc[info.npcIndexToAimAt]; - } - int num1 = 0; - this._referenceDummy.SetDefaults(492, npc1.GetMatchingSpawnParams()); - int num2 = num1 + this._referenceDummy.lifeMax * 4; - float num3 = 0.0f; - for (int index1 = 0; index1 < 4; ++index1) - { - int index2 = (int) npc1.ai[index1]; - if (Main.npc.IndexInRange(index2)) - { - NPC npc2 = Main.npc[index2]; - if (npc2.active && npc2.type == 492) - num3 += (float) npc2.life; - } - } - this._lifePercentToShow = Utils.Clamp(num3 / (float) num2, 0.0f, 1f); - return true; - } - - public void Draw(ref BigProgressBarInfo info, SpriteBatch spriteBatch) - { - int bossHeadTexture = NPCID.Sets.BossHeadTextures[491]; - Texture2D texture2D = TextureAssets.NpcHeadBoss[bossHeadTexture].Value; - Rectangle barIconFrame = texture2D.Frame(); - BigProgressBarHelper.DrawFancyBar(spriteBatch, this._lifePercentToShow, texture2D, barIconFrame); - } - - private bool TryFindingAnotherPirateShipPiece(ref BigProgressBarInfo info) - { - for (int index = 0; index < 200; ++index) - { - NPC npc = Main.npc[index]; - if (npc.active && this.ValidIds.Contains(npc.type)) - { - info.npcIndexToAimAt = index; - return true; - } - } - return false; - } - } -} diff --git a/GameContent/UI/BigProgressBar/SolarFlarePillarBigProgressBar.cs b/GameContent/UI/BigProgressBar/SolarFlarePillarBigProgressBar.cs deleted file mode 100644 index 09346f2..0000000 --- a/GameContent/UI/BigProgressBar/SolarFlarePillarBigProgressBar.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.BigProgressBar.SolarFlarePillarBigProgressBar -// 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.UI.BigProgressBar -{ - public class SolarFlarePillarBigProgressBar : LunarPillarBigProgessBar - { - internal override float GetCurrentShieldValue() => (float) NPC.ShieldStrengthTowerSolar; - - internal override float GetMaxShieldValue() => (float) NPC.ShieldStrengthTowerMax; - - internal override bool IsPlayerInCombatArea() => Main.LocalPlayer.ZoneTowerSolar; - } -} diff --git a/GameContent/UI/BigProgressBar/StardustPillarBigProgressBar.cs b/GameContent/UI/BigProgressBar/StardustPillarBigProgressBar.cs deleted file mode 100644 index d7100f3..0000000 --- a/GameContent/UI/BigProgressBar/StardustPillarBigProgressBar.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.BigProgressBar.StardustPillarBigProgressBar -// 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.UI.BigProgressBar -{ - public class StardustPillarBigProgressBar : LunarPillarBigProgessBar - { - internal override float GetCurrentShieldValue() => (float) NPC.ShieldStrengthTowerStardust; - - internal override float GetMaxShieldValue() => (float) NPC.ShieldStrengthTowerMax; - - internal override bool IsPlayerInCombatArea() => Main.LocalPlayer.ZoneTowerStardust; - } -} diff --git a/GameContent/UI/BigProgressBar/TwinsBigProgressBar.cs b/GameContent/UI/BigProgressBar/TwinsBigProgressBar.cs deleted file mode 100644 index 2cf38cc..0000000 --- a/GameContent/UI/BigProgressBar/TwinsBigProgressBar.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.BigProgressBar.TwinsBigProgressBar -// 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; -using Microsoft.Xna.Framework.Graphics; - -namespace Terraria.GameContent.UI.BigProgressBar -{ - public class TwinsBigProgressBar : IBigProgressBar - { - private float _lifePercentToShow; - private int _headIndex; - - public bool ValidateAndCollectNecessaryInfo(ref BigProgressBarInfo info) - { - if (info.npcIndexToAimAt < 0 || info.npcIndexToAimAt > 200) - return false; - NPC npc1 = Main.npc[info.npcIndexToAimAt]; - if (!npc1.active) - return false; - int num = npc1.type == 126 ? 125 : 126; - int lifeMax = npc1.lifeMax; - int life = npc1.life; - for (int index = 0; index < 200; ++index) - { - NPC npc2 = Main.npc[index]; - if (npc2.active && npc2.type == num) - { - lifeMax += npc2.lifeMax; - life += npc2.life; - break; - } - } - this._lifePercentToShow = Utils.Clamp((float) life / (float) lifeMax, 0.0f, 1f); - this._headIndex = npc1.GetBossHeadTextureIndex(); - return true; - } - - public void Draw(ref BigProgressBarInfo info, SpriteBatch spriteBatch) - { - Texture2D texture2D = TextureAssets.NpcHeadBoss[this._headIndex].Value; - Rectangle barIconFrame = texture2D.Frame(); - BigProgressBarHelper.DrawFancyBar(spriteBatch, this._lifePercentToShow, texture2D, barIconFrame); - } - } -} diff --git a/GameContent/UI/BigProgressBar/VortexPillarBigProgressBar.cs b/GameContent/UI/BigProgressBar/VortexPillarBigProgressBar.cs deleted file mode 100644 index 5d8fd67..0000000 --- a/GameContent/UI/BigProgressBar/VortexPillarBigProgressBar.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.BigProgressBar.VortexPillarBigProgressBar -// 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.UI.BigProgressBar -{ - public class VortexPillarBigProgressBar : LunarPillarBigProgessBar - { - internal override float GetCurrentShieldValue() => (float) NPC.ShieldStrengthTowerVortex; - - internal override float GetMaxShieldValue() => (float) NPC.ShieldStrengthTowerMax; - - internal override bool IsPlayerInCombatArea() => Main.LocalPlayer.ZoneTowerVortex; - } -} diff --git a/GameContent/UI/Chat/AchievementTagHandler.cs b/GameContent/UI/Chat/AchievementTagHandler.cs index c6ae195..8ec8dc5 100644 --- a/GameContent/UI/Chat/AchievementTagHandler.cs +++ b/GameContent/UI/Chat/AchievementTagHandler.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.Chat.AchievementTagHandler -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/GameContent/UI/Chat/ColorTagHandler.cs b/GameContent/UI/Chat/ColorTagHandler.cs index 1e8bdb7..8d032bb 100644 --- a/GameContent/UI/Chat/ColorTagHandler.cs +++ b/GameContent/UI/Chat/ColorTagHandler.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.Chat.ColorTagHandler -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/GameContent/UI/Chat/GlyphTagHandler.cs b/GameContent/UI/Chat/GlyphTagHandler.cs index 30e88cd..1a0b3e4 100644 --- a/GameContent/UI/Chat/GlyphTagHandler.cs +++ b/GameContent/UI/Chat/GlyphTagHandler.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.Chat.GlyphTagHandler -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -167,8 +167,8 @@ namespace Terraria.GameContent.UI.Chat { int frameX = this._glyphIndex; if (this._glyphIndex == 25) - frameX = (double) Main.GlobalTimeWrappedHourly % 0.600000023841858 < 0.300000011920929 ? 17 : 18; - Texture2D texture2D = TextureAssets.TextGlyph[0].Value; + frameX = (double) Main.GlobalTime % 0.600000023841858 < 0.300000011920929 ? 17 : 18; + Texture2D texture2D = Main.textGlyphTexture[0]; spriteBatch.Draw(texture2D, position, new Rectangle?(texture2D.Frame(25, frameX: frameX, frameY: (frameX / 25))), color, 0.0f, Vector2.Zero, GlyphTagHandler.GlyphsScale, SpriteEffects.None, 0.0f); } size = new Vector2(26f) * GlyphTagHandler.GlyphsScale; diff --git a/GameContent/UI/Chat/IChatMonitor.cs b/GameContent/UI/Chat/IChatMonitor.cs deleted file mode 100644 index 21929aa..0000000 --- a/GameContent/UI/Chat/IChatMonitor.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Chat.IChatMonitor -// 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.UI.Chat -{ - public interface IChatMonitor - { - void NewText(string newText, byte R = 255, byte G = 255, byte B = 255); - - void NewTextMultiline(string text, bool force = false, Color c = default (Color), int WidthLimit = -1); - - void DrawChat(bool drawingPlayerChat); - - void Clear(); - - void Update(); - - void Offset(int linesOffset); - - void ResetOffset(); - - void OnResolutionChange(); - } -} diff --git a/GameContent/UI/Chat/ItemTagHandler.cs b/GameContent/UI/Chat/ItemTagHandler.cs index e8a52c7..0554663 100644 --- a/GameContent/UI/Chat/ItemTagHandler.cs +++ b/GameContent/UI/Chat/ItemTagHandler.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.Chat.ItemTagHandler -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -39,7 +39,7 @@ namespace Terraria.GameContent.UI.Chat int result2; if (int.TryParse(strArray[index].Substring(1), out result2)) { - obj.Prefix((int) (byte) Utils.Clamp(result2, 0, 85)); + obj.Prefix((int) (byte) Utils.Clamp(result2, 0, 84)); continue; } continue; @@ -107,8 +107,7 @@ namespace Terraria.GameContent.UI.Chat float num2 = 1f; if (Main.netMode != 2 && !Main.dedServ) { - Main.instance.LoadItem(this._item.type); - Texture2D texture2D = TextureAssets.Item[this._item.type].Value; + Texture2D texture2D = Main.itemTexture[this._item.type]; Rectangle rectangle = Main.itemAnimations[this._item.type] == null ? texture2D.Frame() : Main.itemAnimations[this._item.type].GetFrame(texture2D); if (rectangle.Height > 32) num2 = 32f / (float) rectangle.Height; diff --git a/GameContent/UI/Chat/LegacyChatMonitor.cs b/GameContent/UI/Chat/LegacyChatMonitor.cs deleted file mode 100644 index eaeb942..0000000 --- a/GameContent/UI/Chat/LegacyChatMonitor.cs +++ /dev/null @@ -1,188 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Chat.LegacyChatMonitor -// 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; -using System.Collections.Generic; -using Terraria.Audio; -using Terraria.UI.Chat; - -namespace Terraria.GameContent.UI.Chat -{ - public class LegacyChatMonitor : IChatMonitor - { - private int numChatLines; - private ChatLine[] chatLine; - private int chatLength; - private int showCount; - private int startChatLine; - - public int TextMaxLengthForScreen => Main.screenWidth - 320; - - public void OnResolutionChange() - { - } - - public LegacyChatMonitor() - { - this.showCount = 10; - this.numChatLines = 500; - this.chatLength = 600; - this.chatLine = new ChatLine[this.numChatLines]; - for (int index = 0; index < this.numChatLines; ++index) - this.chatLine[index] = new ChatLine(); - } - - public void Clear() - { - for (int index = 0; index < this.numChatLines; ++index) - this.chatLine[index] = new ChatLine(); - } - - public void ResetOffset() => this.startChatLine = 0; - - public void Update() - { - for (int index = 0; index < this.numChatLines; ++index) - this.chatLine[index].UpdateTimeLeft(); - } - - public void Offset(int linesOffset) - { - this.showCount = (int) ((double) (Main.screenHeight / 3) / (double) FontAssets.MouseText.Value.MeasureString("1").Y) - 1; - switch (linesOffset) - { - case -1: - --this.startChatLine; - if (this.startChatLine >= 0) - break; - this.startChatLine = 0; - break; - case 1: - ++this.startChatLine; - if (this.startChatLine + this.showCount >= this.numChatLines - 1) - this.startChatLine = this.numChatLines - this.showCount - 1; - if (!(this.chatLine[this.startChatLine + this.showCount].originalText == "")) - break; - --this.startChatLine; - break; - } - } - - public void NewText(string newText, byte R = 255, byte G = 255, byte B = 255) => this.NewTextMultiline(newText, false, new Color((int) R, (int) G, (int) B), -1); - - public void NewTextInternal(string newText, byte R = 255, byte G = 255, byte B = 255, bool force = false) - { - int maxTextSize = 80; - if (!force && newText.Length > maxTextSize) - { - string oldText = newText; - string newText1 = this.TrimIntoMultipleLines(R, G, B, maxTextSize, oldText); - if (newText1.Length <= 0) - return; - this.NewTextInternal(newText1, R, G, B, true); - } - else - { - for (int index = this.numChatLines - 1; index > 0; --index) - this.chatLine[index].Copy(this.chatLine[index - 1]); - this.chatLine[0].color = new Color((int) R, (int) G, (int) B); - this.chatLine[0].originalText = newText; - this.chatLine[0].parsedText = ChatManager.ParseMessage(this.chatLine[0].originalText, this.chatLine[0].color).ToArray(); - this.chatLine[0].showTime = this.chatLength; - SoundEngine.PlaySound(12); - } - } - - private string TrimIntoMultipleLines(byte R, byte G, byte B, int maxTextSize, string oldText) - { - while (oldText.Length > maxTextSize) - { - int num = maxTextSize; - int startIndex = num; - while (oldText.Substring(startIndex, 1) != " ") - { - --startIndex; - if (startIndex < 1) - break; - } - if (startIndex == 0) - { - while (oldText.Substring(num, 1) != " ") - { - ++num; - if (num >= oldText.Length - 1) - break; - } - } - else - num = startIndex; - if (num >= oldText.Length - 1) - num = oldText.Length; - this.NewTextInternal(oldText.Substring(0, num), R, G, B, true); - oldText = oldText.Substring(num); - if (oldText.Length > 0) - { - while (oldText.Substring(0, 1) == " ") - oldText = oldText.Substring(1); - } - } - return oldText; - } - - public void NewTextMultiline(string text, bool force = false, Color c = default (Color), int WidthLimit = -1) - { - if (c == new Color()) - c = Color.White; - List> textSnippetListList = WidthLimit == -1 ? Utils.WordwrapStringSmart(text, c, FontAssets.MouseText.Value, this.TextMaxLengthForScreen, 10) : Utils.WordwrapStringSmart(text, c, FontAssets.MouseText.Value, WidthLimit, 10); - for (int index = 0; index < textSnippetListList.Count; ++index) - this.NewText(textSnippetListList[index]); - } - - public void NewText(List snippets) - { - for (int index = this.numChatLines - 1; index > 0; --index) - this.chatLine[index].Copy(this.chatLine[index - 1]); - this.chatLine[0].originalText = "this is a hack because draw checks length is higher than 0"; - this.chatLine[0].parsedText = snippets.ToArray(); - this.chatLine[0].showTime = this.chatLength; - SoundEngine.PlaySound(12); - } - - public void DrawChat(bool drawingPlayerChat) - { - int num1 = this.startChatLine; - int num2 = this.startChatLine + this.showCount; - if (num2 >= this.numChatLines) - { - num2 = --this.numChatLines; - num1 = num2 - this.showCount; - } - int num3 = 0; - int index1 = -1; - int index2 = -1; - for (int index3 = num1; index3 < num2; ++index3) - { - if (drawingPlayerChat || this.chatLine[index3].showTime > 0 && this.chatLine[index3].parsedText.Length != 0) - { - int hoveredSnippet = -1; - ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, FontAssets.MouseText.Value, this.chatLine[index3].parsedText, new Vector2(88f, (float) (Main.screenHeight - 30 - 28 - num3 * 21)), 0.0f, Vector2.Zero, Vector2.One, out hoveredSnippet); - if (hoveredSnippet >= 0 && this.chatLine[index3].parsedText[hoveredSnippet].CheckForHover) - { - index1 = index3; - index2 = hoveredSnippet; - } - } - ++num3; - } - if (index1 <= -1) - return; - this.chatLine[index1].parsedText[index2].OnHover(); - if (!Main.mouseLeft || !Main.mouseLeftRelease) - return; - this.chatLine[index1].parsedText[index2].OnClick(); - } - } -} diff --git a/GameContent/UI/Chat/NameTagHandler.cs b/GameContent/UI/Chat/NameTagHandler.cs index 3928ffc..92ec8f2 100644 --- a/GameContent/UI/Chat/NameTagHandler.cs +++ b/GameContent/UI/Chat/NameTagHandler.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.Chat.NameTagHandler -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/GameContent/UI/Chat/PlainTagHandler.cs b/GameContent/UI/Chat/PlainTagHandler.cs index 2848924..a0d2374 100644 --- a/GameContent/UI/Chat/PlainTagHandler.cs +++ b/GameContent/UI/Chat/PlainTagHandler.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.Chat.PlainTagHandler -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/GameContent/UI/Chat/RemadeChatMonitor.cs b/GameContent/UI/Chat/RemadeChatMonitor.cs deleted file mode 100644 index 2eebf05..0000000 --- a/GameContent/UI/Chat/RemadeChatMonitor.cs +++ /dev/null @@ -1,156 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Chat.RemadeChatMonitor -// 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; -using System; -using System.Collections.Generic; -using Terraria.UI.Chat; - -namespace Terraria.GameContent.UI.Chat -{ - public class RemadeChatMonitor : IChatMonitor - { - private const int MaxMessages = 500; - private int _showCount; - private int _startChatLine; - private List _messages; - private bool _recalculateOnNextUpdate; - - public RemadeChatMonitor() - { - this._showCount = 10; - this._startChatLine = 0; - this._messages = new List(); - } - - public void NewText(string newText, byte R = 255, byte G = 255, byte B = 255) => this.AddNewMessage(newText, new Color((int) R, (int) G, (int) B)); - - public void NewTextMultiline(string text, bool force = false, Color c = default (Color), int WidthLimit = -1) => this.AddNewMessage(text, c, WidthLimit); - - public void AddNewMessage(string text, Color color, int widthLimitInPixels = -1) - { - ChatMessageContainer messageContainer = new ChatMessageContainer(); - messageContainer.SetContents(text, color, widthLimitInPixels); - this._messages.Insert(0, messageContainer); - while (this._messages.Count > 500) - this._messages.RemoveAt(this._messages.Count - 1); - } - - public void DrawChat(bool drawingPlayerChat) - { - int startChatLine = this._startChatLine; - int index = 0; - int snippetIndex1 = 0; - while (startChatLine > 0 && index < this._messages.Count) - { - int num = Math.Min(startChatLine, this._messages[index].LineCount); - startChatLine -= num; - snippetIndex1 += num; - if (snippetIndex1 == this._messages[index].LineCount) - { - snippetIndex1 = 0; - ++index; - } - } - int num1 = 0; - int? nullable1 = new int?(); - int snippetIndex2 = -1; - int? nullable2 = new int?(); - int hoveredSnippet = -1; - while (num1 < this._showCount && index < this._messages.Count) - { - ChatMessageContainer message = this._messages[index]; - if (message.Prepared && drawingPlayerChat | message.CanBeShownWhenChatIsClosed) - { - TextSnippet[] withInversedIndex = message.GetSnippetWithInversedIndex(snippetIndex1); - ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, FontAssets.MouseText.Value, withInversedIndex, new Vector2(88f, (float) (Main.screenHeight - 30 - 28 - num1 * 21)), 0.0f, Vector2.Zero, Vector2.One, out hoveredSnippet); - if (hoveredSnippet >= 0) - { - nullable2 = new int?(hoveredSnippet); - nullable1 = new int?(index); - snippetIndex2 = snippetIndex1; - } - ++num1; - ++snippetIndex1; - if (snippetIndex1 >= message.LineCount) - { - snippetIndex1 = 0; - ++index; - } - } - else - break; - } - if (!nullable1.HasValue || !nullable2.HasValue) - return; - TextSnippet[] withInversedIndex1 = this._messages[nullable1.Value].GetSnippetWithInversedIndex(snippetIndex2); - withInversedIndex1[nullable2.Value].OnHover(); - if (!Main.mouseLeft || !Main.mouseLeftRelease) - return; - withInversedIndex1[nullable2.Value].OnClick(); - } - - public void Clear() => this._messages.Clear(); - - public void Update() - { - if (this._recalculateOnNextUpdate) - { - this._recalculateOnNextUpdate = false; - for (int index = 0; index < this._messages.Count; ++index) - this._messages[index].MarkToNeedRefresh(); - } - for (int index = 0; index < this._messages.Count; ++index) - this._messages[index].Update(); - } - - public void Offset(int linesOffset) - { - this._startChatLine += linesOffset; - this.ClampMessageIndex(); - } - - private void ClampMessageIndex() - { - int num1 = 0; - int index = 0; - int num2 = 0; - int num3 = this._startChatLine + this._showCount; - while (num1 < num3 && index < this._messages.Count) - { - int num4 = Math.Min(num3 - num1, this._messages[index].LineCount); - num1 += num4; - if (num1 < num3) - { - ++index; - num2 = 0; - } - else - num2 = num4; - } - int showCount = this._showCount; - while (showCount > 0 && num1 > 0) - { - --num2; - --showCount; - --num1; - if (num2 < 0) - { - --index; - if (index != -1) - num2 = this._messages[index].LineCount - 1; - else - break; - } - } - this._startChatLine = num1; - } - - public void ResetOffset() => this._startChatLine = 0; - - public void OnResolutionChange() => this._recalculateOnNextUpdate = true; - } -} diff --git a/GameContent/UI/ClassicPlayerResourcesDisplaySet.cs b/GameContent/UI/ClassicPlayerResourcesDisplaySet.cs deleted file mode 100644 index cd11e80..0000000 --- a/GameContent/UI/ClassicPlayerResourcesDisplaySet.cs +++ /dev/null @@ -1,164 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.ClassicPlayerResourcesDisplaySet -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Graphics; - -namespace Terraria.GameContent.UI -{ - public class ClassicPlayerResourcesDisplaySet : IPlayerResourcesDisplaySet - { - private int UIDisplay_ManaPerStar = 20; - private float UIDisplay_LifePerHeart = 20f; - private int UI_ScreenAnchorX; - - public void Draw() - { - this.UI_ScreenAnchorX = Main.screenWidth - 800; - this.DrawLife(); - this.DrawMana(); - } - - private void DrawLife() - { - Player localPlayer = Main.LocalPlayer; - SpriteBatch spriteBatch = Main.spriteBatch; - Color color = new Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor); - this.UIDisplay_LifePerHeart = 20f; - if (localPlayer.ghost) - return; - int num1 = localPlayer.statLifeMax / 20; - int num2 = (localPlayer.statLifeMax - 400) / 5; - if (num2 < 0) - num2 = 0; - if (num2 > 0) - { - num1 = localPlayer.statLifeMax / (20 + num2 / 4); - this.UIDisplay_LifePerHeart = (float) localPlayer.statLifeMax / 20f; - } - this.UIDisplay_LifePerHeart += (float) ((localPlayer.statLifeMax2 - localPlayer.statLifeMax) / num1); - int num3 = (int) ((double) localPlayer.statLifeMax2 / (double) this.UIDisplay_LifePerHeart); - if (num3 >= 10) - num3 = 10; - string str = Lang.inter[0].Value + " " + (object) localPlayer.statLifeMax2 + "/" + (object) localPlayer.statLifeMax2; - Vector2 vector2 = FontAssets.MouseText.Value.MeasureString(str); - if (!localPlayer.ghost) - { - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, Lang.inter[0].Value, new Vector2((float) (500 + 13 * num3) - vector2.X * 0.5f + (float) this.UI_ScreenAnchorX, 6f), color, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, localPlayer.statLife.ToString() + "/" + (object) localPlayer.statLifeMax2, new Vector2((float) (500 + 13 * num3) + vector2.X * 0.5f + (float) this.UI_ScreenAnchorX, 6f), color, 0.0f, new Vector2(FontAssets.MouseText.Value.MeasureString(localPlayer.statLife.ToString() + "/" + (object) localPlayer.statLifeMax2).X, 0.0f), 1f, SpriteEffects.None, 0.0f); - } - for (int index = 1; index < (int) ((double) localPlayer.statLifeMax2 / (double) this.UIDisplay_LifePerHeart) + 1; ++index) - { - float scale = 1f; - bool flag = false; - int num4; - if ((double) localPlayer.statLife >= (double) index * (double) this.UIDisplay_LifePerHeart) - { - num4 = (int) byte.MaxValue; - if ((double) localPlayer.statLife == (double) index * (double) this.UIDisplay_LifePerHeart) - flag = true; - } - else - { - float num5 = ((float) localPlayer.statLife - (float) (index - 1) * this.UIDisplay_LifePerHeart) / this.UIDisplay_LifePerHeart; - num4 = (int) (30.0 + 225.0 * (double) num5); - if (num4 < 30) - num4 = 30; - scale = (float) ((double) num5 / 4.0 + 0.75); - if ((double) scale < 0.75) - scale = 0.75f; - if ((double) num5 > 0.0) - flag = true; - } - if (flag) - scale += Main.cursorScale - 1f; - int num6 = 0; - int num7 = 0; - if (index > 10) - { - num6 -= 260; - num7 += 26; - } - int a = (int) ((double) num4 * 0.9); - if (!localPlayer.ghost) - { - if (num2 > 0) - { - --num2; - spriteBatch.Draw(TextureAssets.Heart2.Value, new Vector2((float) (500 + 26 * (index - 1) + num6 + this.UI_ScreenAnchorX + TextureAssets.Heart.Width() / 2), (float) (32.0 + ((double) TextureAssets.Heart.Height() - (double) TextureAssets.Heart.Height() * (double) scale) / 2.0) + (float) num7 + (float) (TextureAssets.Heart.Height() / 2)), new Rectangle?(new Rectangle(0, 0, TextureAssets.Heart.Width(), TextureAssets.Heart.Height())), new Color(num4, num4, num4, a), 0.0f, new Vector2((float) (TextureAssets.Heart.Width() / 2), (float) (TextureAssets.Heart.Height() / 2)), scale, SpriteEffects.None, 0.0f); - } - else - spriteBatch.Draw(TextureAssets.Heart.Value, new Vector2((float) (500 + 26 * (index - 1) + num6 + this.UI_ScreenAnchorX + TextureAssets.Heart.Width() / 2), (float) (32.0 + ((double) TextureAssets.Heart.Height() - (double) TextureAssets.Heart.Height() * (double) scale) / 2.0) + (float) num7 + (float) (TextureAssets.Heart.Height() / 2)), new Rectangle?(new Rectangle(0, 0, TextureAssets.Heart.Width(), TextureAssets.Heart.Height())), new Color(num4, num4, num4, a), 0.0f, new Vector2((float) (TextureAssets.Heart.Width() / 2), (float) (TextureAssets.Heart.Height() / 2)), scale, SpriteEffects.None, 0.0f); - } - } - } - - private void DrawMana() - { - Player localPlayer = Main.LocalPlayer; - SpriteBatch spriteBatch = Main.spriteBatch; - Color color = new Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor); - this.UIDisplay_ManaPerStar = 20; - if (localPlayer.ghost || localPlayer.statManaMax2 <= 0) - return; - int num1 = localPlayer.statManaMax2 / 20; - Vector2 vector2 = FontAssets.MouseText.Value.MeasureString(Lang.inter[2].Value); - int num2 = 50; - if ((double) vector2.X >= 45.0) - num2 = (int) vector2.X + 5; - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, Lang.inter[2].Value, new Vector2((float) (800 - num2 + this.UI_ScreenAnchorX), 6f), color, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - for (int index = 1; index < localPlayer.statManaMax2 / this.UIDisplay_ManaPerStar + 1; ++index) - { - bool flag = false; - float scale = 1f; - int num3; - if (localPlayer.statMana >= index * this.UIDisplay_ManaPerStar) - { - num3 = (int) byte.MaxValue; - if (localPlayer.statMana == index * this.UIDisplay_ManaPerStar) - flag = true; - } - else - { - float num4 = (float) (localPlayer.statMana - (index - 1) * this.UIDisplay_ManaPerStar) / (float) this.UIDisplay_ManaPerStar; - num3 = (int) (30.0 + 225.0 * (double) num4); - if (num3 < 30) - num3 = 30; - scale = (float) ((double) num4 / 4.0 + 0.75); - if ((double) scale < 0.75) - scale = 0.75f; - if ((double) num4 > 0.0) - flag = true; - } - if (flag) - scale += Main.cursorScale - 1f; - int a = (int) ((double) num3 * 0.9); - spriteBatch.Draw(TextureAssets.Mana.Value, new Vector2((float) (775 + this.UI_ScreenAnchorX), (float) (30 + TextureAssets.Mana.Height() / 2) + (float) (((double) TextureAssets.Mana.Height() - (double) TextureAssets.Mana.Height() * (double) scale) / 2.0) + (float) (28 * (index - 1))), new Rectangle?(new Rectangle(0, 0, TextureAssets.Mana.Width(), TextureAssets.Mana.Height())), new Color(num3, num3, num3, a), 0.0f, new Vector2((float) (TextureAssets.Mana.Width() / 2), (float) (TextureAssets.Mana.Height() / 2)), scale, SpriteEffects.None, 0.0f); - } - } - - public void TryToHover() - { - Vector2 mouseScreen = Main.MouseScreen; - Player localPlayer = Main.LocalPlayer; - int num1 = 26 * localPlayer.statLifeMax2 / (int) this.UIDisplay_LifePerHeart; - int num2 = 0; - if (localPlayer.statLifeMax2 > 200) - { - num1 = 260; - num2 += 26; - } - if ((double) mouseScreen.X > (double) (500 + this.UI_ScreenAnchorX) && (double) mouseScreen.X < (double) (500 + num1 + this.UI_ScreenAnchorX) && (double) mouseScreen.Y > 32.0 && (double) mouseScreen.Y < (double) (32 + TextureAssets.Heart.Height() + num2)) - CommonResourceBarMethods.DrawLifeMouseOver(); - int num3 = 24; - int num4 = 28 * localPlayer.statManaMax2 / this.UIDisplay_ManaPerStar; - if ((double) mouseScreen.X <= (double) (762 + this.UI_ScreenAnchorX) || (double) mouseScreen.X >= (double) (762 + num3 + this.UI_ScreenAnchorX) || (double) mouseScreen.Y <= 30.0 || (double) mouseScreen.Y >= (double) (30 + num4)) - return; - CommonResourceBarMethods.DrawManaMouseOver(); - } - } -} diff --git a/GameContent/UI/CommonResourceBarMethods.cs b/GameContent/UI/CommonResourceBarMethods.cs deleted file mode 100644 index d32821f..0000000 --- a/GameContent/UI/CommonResourceBarMethods.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.CommonResourceBarMethods -// 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.UI -{ - public class CommonResourceBarMethods - { - public static void DrawLifeMouseOver() - { - if (Main.mouseText) - return; - Player localPlayer = Main.LocalPlayer; - localPlayer.cursorItemIconEnabled = false; - string text = localPlayer.statLife.ToString() + "/" + (object) localPlayer.statLifeMax2; - Main.instance.MouseTextHackZoom(text); - Main.mouseText = true; - } - - public static void DrawManaMouseOver() - { - if (Main.mouseText) - return; - Player localPlayer = Main.LocalPlayer; - localPlayer.cursorItemIconEnabled = false; - string text = localPlayer.statMana.ToString() + "/" + (object) localPlayer.statManaMax2; - Main.instance.MouseTextHackZoom(text); - Main.mouseText = true; - } - } -} diff --git a/GameContent/UI/CustomCurrencyManager.cs b/GameContent/UI/CustomCurrencyManager.cs index a5fe94b..edbd90c 100644 --- a/GameContent/UI/CustomCurrencyManager.cs +++ b/GameContent/UI/CustomCurrencyManager.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.CustomCurrencyManager -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -13,7 +13,7 @@ namespace Terraria.GameContent.UI { public class CustomCurrencyManager { - private static int _nextCurrencyIndex; + private static int _nextCurrencyIndex = 0; private static Dictionary _currencies = new Dictionary(); public static void Initialize() @@ -43,23 +43,16 @@ namespace Terraria.GameContent.UI long num1 = currency.CountCurrency(out overFlowing, player.bank.item); long num2 = currency.CountCurrency(out overFlowing, player.bank2.item); long num3 = currency.CountCurrency(out overFlowing, player.bank3.item); - long num4 = currency.CountCurrency(out overFlowing, player.bank4.item); - long totalCoins = currency.CombineStacks(out overFlowing, num1, num2, num3, num4); + long totalCoins = currency.CombineStacks(out overFlowing, num1, num2, num3); if (totalCoins <= 0L) return; - Main.instance.LoadItem(4076); - Main.instance.LoadItem(3813); - Main.instance.LoadItem(346); - Main.instance.LoadItem(87); - if (num4 > 0L) - sb.Draw(TextureAssets.Item[4076].Value, Utils.CenteredRectangle(new Vector2(shopx + 96f, shopy + 50f), TextureAssets.Item[4076].Value.Size() * 0.65f), new Rectangle?(), Color.White); if (num3 > 0L) - sb.Draw(TextureAssets.Item[3813].Value, Utils.CenteredRectangle(new Vector2(shopx + 80f, shopy + 50f), TextureAssets.Item[3813].Value.Size() * 0.65f), new Rectangle?(), Color.White); + sb.Draw(Main.itemTexture[3813], Utils.CenteredRectangle(new Vector2(shopx + 80f, shopy + 50f), Main.itemTexture[3813].Size() * 0.65f), new Rectangle?(), Color.White); if (num2 > 0L) - sb.Draw(TextureAssets.Item[346].Value, Utils.CenteredRectangle(new Vector2(shopx + 80f, shopy + 50f), TextureAssets.Item[346].Value.Size() * 0.65f), new Rectangle?(), Color.White); + sb.Draw(Main.itemTexture[346], Utils.CenteredRectangle(new Vector2(shopx + 80f, shopy + 50f), Main.itemTexture[346].Size() * 0.65f), new Rectangle?(), Color.White); if (num1 > 0L) - sb.Draw(TextureAssets.Item[87].Value, Utils.CenteredRectangle(new Vector2(shopx + 70f, shopy + 60f), TextureAssets.Item[87].Value.Size() * 0.65f), new Rectangle?(), Color.White); - Utils.DrawBorderStringFourWay(sb, FontAssets.MouseText.Value, Lang.inter[66].Value, shopx, shopy + 40f, Color.White * ((float) Main.mouseTextColor / (float) byte.MaxValue), Color.Black, Vector2.Zero); + sb.Draw(Main.itemTexture[87], Utils.CenteredRectangle(new Vector2(shopx + 70f, shopy + 60f), Main.itemTexture[87].Size() * 0.65f), new Rectangle?(), Color.White); + Utils.DrawBorderStringFourWay(sb, Main.fontMouseText, Lang.inter[66].Value, shopx, shopy + 40f, Color.White * ((float) Main.mouseTextColor / (float) byte.MaxValue), Color.Black, Vector2.Zero); currency.DrawSavingsMoney(sb, Lang.inter[66].Value, shopx, shopy, totalCoins, horizontal); } @@ -80,8 +73,7 @@ namespace Terraria.GameContent.UI long num2 = currency.CountCurrency(out overFlowing, player.bank.item); long num3 = currency.CountCurrency(out overFlowing, player.bank2.item); long num4 = currency.CountCurrency(out overFlowing, player.bank3.item); - long num5 = currency.CountCurrency(out overFlowing, player.bank4.item); - if (currency.CombineStacks(out overFlowing, num1, num2, num3, num4, num5) < (long) price) + if (currency.CombineStacks(out overFlowing, num1, num2, num3, num4) < (long) price) return false; List objArrayList = new List(); Dictionary> slotsToIgnore = new Dictionary>(); @@ -90,12 +82,10 @@ namespace Terraria.GameContent.UI List pointList2 = new List(); List pointList3 = new List(); List pointList4 = new List(); - List pointList5 = new List(); objArrayList.Add(player.inventory); objArrayList.Add(player.bank.item); objArrayList.Add(player.bank2.item); objArrayList.Add(player.bank3.item); - objArrayList.Add(player.bank4.item); for (int key = 0; key < objArrayList.Count; ++key) slotsToIgnore[key] = new List(); slotsToIgnore[0] = new List() @@ -118,8 +108,7 @@ namespace Terraria.GameContent.UI CustomCurrencyManager.FindEmptySlots(objArrayList, slotsToIgnore, pointList2, 1); CustomCurrencyManager.FindEmptySlots(objArrayList, slotsToIgnore, pointList3, 2); CustomCurrencyManager.FindEmptySlots(objArrayList, slotsToIgnore, pointList4, 3); - CustomCurrencyManager.FindEmptySlots(objArrayList, slotsToIgnore, pointList5, 4); - return currency.TryPurchasing(price, objArrayList, slotCoins, pointList1, pointList2, pointList3, pointList4, pointList5); + return currency.TryPurchasing(price, objArrayList, slotCoins, pointList1, pointList2, pointList3, pointList4); } private static void FindEmptySlots( @@ -134,17 +123,5 @@ namespace Terraria.GameContent.UI emptySlots.Add(new Point(currentInventoryIndex, y)); } } - - public static bool IsCustomCurrency(Item item) - { - foreach (KeyValuePair currency in CustomCurrencyManager._currencies) - { - if (currency.Value.Accepts(item)) - return true; - } - return false; - } - - public static void GetPrices(Item item, out int calcForSelling, out int calcForBuying) => CustomCurrencyManager._currencies[item.shopSpecialCurrency].GetItemExpectedPrice(item, out calcForSelling, out calcForBuying); } } diff --git a/GameContent/UI/CustomCurrencySingleCoin.cs b/GameContent/UI/CustomCurrencySingleCoin.cs index 808a552..67bd993 100644 --- a/GameContent/UI/CustomCurrencySingleCoin.cs +++ b/GameContent/UI/CustomCurrencySingleCoin.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.CustomCurrencySingleCoin -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -33,8 +33,7 @@ namespace Terraria.GameContent.UI List slotsEmpty, List slotEmptyBank, List slotEmptyBank2, - List slotEmptyBank3, - List slotEmptyBank4) + List slotEmptyBank3) { List> cache = this.ItemCacheCreate(inv); int num1 = price; @@ -62,9 +61,6 @@ namespace Terraria.GameContent.UI case 3: slotEmptyBank3.Add(slotCoin); break; - case 4: - slotEmptyBank4.Add(slotCoin); - break; } slotCoins.Remove(slotCoin); --index; @@ -86,20 +82,19 @@ namespace Terraria.GameContent.UI long totalCoins, bool horizontal = false) { - int i = this._valuePerUnit.Keys.ElementAt(0); - Main.instance.LoadItem(i); - Texture2D texture2D = TextureAssets.Item[i].Value; + int index = this._valuePerUnit.Keys.ElementAt(0); + Texture2D texture2D = Main.itemTexture[index]; if (horizontal) { - Vector2 position = new Vector2((float) ((double) shopx + (double) ChatManager.GetStringSize(FontAssets.MouseText.Value, text, Vector2.One).X + 45.0), shopy + 50f); + Vector2 position = new Vector2((float) ((double) shopx + (double) ChatManager.GetStringSize(Main.fontMouseText, text, Vector2.One).X + 45.0), shopy + 50f); sb.Draw(texture2D, position, new Rectangle?(), Color.White, 0.0f, texture2D.Size() / 2f, this.CurrencyDrawScale, SpriteEffects.None, 0.0f); - Utils.DrawBorderStringFourWay(sb, FontAssets.ItemStack.Value, totalCoins.ToString(), position.X - 11f, position.Y, Color.White, Color.Black, new Vector2(0.3f), 0.75f); + Utils.DrawBorderStringFourWay(sb, Main.fontItemStack, totalCoins.ToString(), position.X - 11f, position.Y, Color.White, Color.Black, new Vector2(0.3f), 0.75f); } else { int num = totalCoins > 99L ? -6 : 0; sb.Draw(texture2D, new Vector2(shopx + 11f, shopy + 75f), new Rectangle?(), Color.White, 0.0f, texture2D.Size() / 2f, this.CurrencyDrawScale, SpriteEffects.None, 0.0f); - Utils.DrawBorderStringFourWay(sb, FontAssets.ItemStack.Value, totalCoins.ToString(), shopx + (float) num, shopy + 75f, Color.White, Color.Black, new Vector2(0.3f), 0.75f); + Utils.DrawBorderStringFourWay(sb, Main.fontItemStack, totalCoins.ToString(), shopx + (float) num, shopy + 75f, Color.White, Color.Black, new Vector2(0.3f), 0.75f); } } diff --git a/GameContent/UI/CustomCurrencySystem.cs b/GameContent/UI/CustomCurrencySystem.cs index 7912b32..37a6b50 100644 --- a/GameContent/UI/CustomCurrencySystem.cs +++ b/GameContent/UI/CustomCurrencySystem.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.CustomCurrencySystem -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -67,8 +67,7 @@ namespace Terraria.GameContent.UI List slotsEmpty, List slotEmptyBank, List slotEmptyBank2, - List slotEmptyBank3, - List slotEmptyBank4) + List slotEmptyBank3) { long num1 = (long) price; Dictionary dictionary = new Dictionary(); @@ -125,8 +124,6 @@ namespace Terraria.GameContent.UI pointList = slotEmptyBank2; if (index1 == 3 && slotEmptyBank3.Count > 0) pointList = slotEmptyBank3; - if (index1 == 4 && slotEmptyBank4.Count > 0) - pointList = slotEmptyBank4; if (--inv[slotCoin.X][slotCoin.Y].stack <= 0) { inv[slotCoin.X][slotCoin.Y].SetDefaults(); @@ -161,8 +158,6 @@ namespace Terraria.GameContent.UI pointList = slotEmptyBank2; if (index1 == 3 && slotEmptyBank3.Count > 0) pointList = slotEmptyBank3; - if (index1 == 4 && slotEmptyBank4.Count > 0) - pointList = slotEmptyBank4; if (--inv[slotCoin.X][slotCoin.Y].stack <= 0) { inv[slotCoin.X][slotCoin.Y].SetDefaults(); @@ -188,7 +183,6 @@ namespace Terraria.GameContent.UI slotEmptyBank.Sort(new Comparison(DelegateMethods.CompareYReverse)); slotEmptyBank2.Sort(new Comparison(DelegateMethods.CompareYReverse)); slotEmptyBank3.Sort(new Comparison(DelegateMethods.CompareYReverse)); - slotEmptyBank4.Sort(new Comparison(DelegateMethods.CompareYReverse)); } else { @@ -239,15 +233,5 @@ namespace Terraria.GameContent.UI foreach (Tuple tuple in cache) inventories[tuple.Item1.X][tuple.Item1.Y] = tuple.Item2; } - - public virtual void GetItemExpectedPrice( - Item item, - out int calcForSelling, - out int calcForBuying) - { - int storeValue = item.GetStoreValue(); - calcForSelling = storeValue; - calcForBuying = storeValue; - } } } diff --git a/GameContent/UI/Elements/EmoteButton.cs b/GameContent/UI/Elements/EmoteButton.cs deleted file mode 100644 index 7fe3565..0000000 --- a/GameContent/UI/Elements/EmoteButton.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.EmoteButton -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria.Audio; -using Terraria.Localization; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class EmoteButton : UIElement - { - private Asset _texture; - private Asset _textureBorder; - private int _emoteIndex; - private bool _hovered; - private int _frameCounter; - - public EmoteButton(int emoteIndex) - { - this._texture = Main.Assets.Request("Images/Extra_" + (object) (short) 48, (AssetRequestMode) 1); - this._textureBorder = Main.Assets.Request("Images/UI/EmoteBubbleBorder", (AssetRequestMode) 1); - this._emoteIndex = emoteIndex; - Rectangle frame = this.GetFrame(); - this.Width.Set((float) frame.Width, 0.0f); - this.Height.Set((float) frame.Height, 0.0f); - } - - private Rectangle GetFrame() => this._texture.Frame(8, 38, this._emoteIndex % 4 * 2 + (this._frameCounter >= 10 ? 1 : 0), this._emoteIndex / 4 + 1); - - private void UpdateFrame() - { - if (++this._frameCounter < 20) - return; - this._frameCounter = 0; - } - - public override void Update(GameTime gameTime) - { - this.UpdateFrame(); - base.Update(gameTime); - } - - protected override void DrawSelf(SpriteBatch spriteBatch) - { - CalculatedStyle dimensions = this.GetDimensions(); - Vector2 position = dimensions.Position() + new Vector2(dimensions.Width, dimensions.Height) / 2f; - Rectangle frame = this.GetFrame(); - Rectangle rectangle = frame; - rectangle.X = this._texture.Width() / 8; - rectangle.Y = 0; - Vector2 origin = frame.Size() / 2f; - Color white = Color.White; - Color color = Color.Black; - if (this._hovered) - color = Main.OurFavoriteColor; - spriteBatch.Draw(this._texture.Value, position, new Rectangle?(rectangle), white, 0.0f, origin, 1f, SpriteEffects.None, 0.0f); - spriteBatch.Draw(this._texture.Value, position, new Rectangle?(frame), white, 0.0f, origin, 1f, SpriteEffects.None, 0.0f); - spriteBatch.Draw(this._textureBorder.Value, position - Vector2.One * 2f, new Rectangle?(), color, 0.0f, origin, 1f, SpriteEffects.None, 0.0f); - if (!this._hovered) - return; - string cursorText = "/" + Language.GetTextValue("EmojiName." + EmoteID.Search.GetName(this._emoteIndex)); - Main.instance.MouseText(cursorText); - } - - public override void MouseOver(UIMouseEvent evt) - { - base.MouseOver(evt); - SoundEngine.PlaySound(12); - this._hovered = true; - } - - public override void MouseOut(UIMouseEvent evt) - { - base.MouseOut(evt); - this._hovered = false; - } - - public override void Click(UIMouseEvent evt) - { - base.Click(evt); - if (Main.netMode == 0) - { - EmoteBubble.NewBubble(this._emoteIndex, new WorldUIAnchor((Entity) Main.LocalPlayer), 360); - EmoteBubble.CheckForNPCsToReactToEmoteBubble(this._emoteIndex, Main.LocalPlayer); - } - else - NetMessage.SendData(120, number: Main.myPlayer, number2: ((float) this._emoteIndex)); - IngameFancyUI.Close(); - } - } -} diff --git a/GameContent/UI/Elements/EmotesGroupListItem.cs b/GameContent/UI/Elements/EmotesGroupListItem.cs deleted file mode 100644 index 6dd82b0..0000000 --- a/GameContent/UI/Elements/EmotesGroupListItem.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.EmotesGroupListItem -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria.Localization; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class EmotesGroupListItem : UIElement - { - private const int TITLE_HEIGHT = 20; - private const int SEPARATOR_HEIGHT = 10; - private const int SIZE_PER_EMOTE = 36; - private Asset _tempTex; - private int _groupIndex; - private int _maxEmotesPerRow = 10; - - public EmotesGroupListItem( - LocalizedText groupTitle, - int groupIndex, - int maxEmotesPerRow, - params int[] emotes) - { - maxEmotesPerRow = 14; - this.SetPadding(0.0f); - this._groupIndex = groupIndex; - this._maxEmotesPerRow = maxEmotesPerRow; - this._tempTex = Main.Assets.Request("Images/UI/ButtonFavoriteInactive", (AssetRequestMode) 1); - int num1 = emotes.Length / this._maxEmotesPerRow; - if (emotes.Length % this._maxEmotesPerRow != 0) - ++num1; - this.Height.Set((float) (30 + 36 * num1), 0.0f); - this.Width.Set(0.0f, 1f); - UIElement element = new UIElement() - { - Height = StyleDimension.FromPixels(30f), - Width = StyleDimension.FromPixelsAndPercent(-20f, 1f), - HAlign = 0.5f - }; - element.SetPadding(0.0f); - this.Append(element); - UIHorizontalSeparator horizontalSeparator1 = new UIHorizontalSeparator(); - horizontalSeparator1.Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f); - horizontalSeparator1.VAlign = 1f; - horizontalSeparator1.HAlign = 0.5f; - horizontalSeparator1.Color = Color.Lerp(Color.White, new Color(63, 65, 151, (int) byte.MaxValue), 0.85f) * 0.9f; - UIHorizontalSeparator horizontalSeparator2 = horizontalSeparator1; - element.Append((UIElement) horizontalSeparator2); - UIText uiText1 = new UIText(groupTitle); - uiText1.VAlign = 1f; - uiText1.HAlign = 0.5f; - uiText1.Top = StyleDimension.FromPixels(-6f); - UIText uiText2 = uiText1; - element.Append((UIElement) uiText2); - float num2 = 6f; - for (int id = 0; id < emotes.Length; ++id) - { - int emote = emotes[id]; - int num3 = id / this._maxEmotesPerRow; - int num4 = id % this._maxEmotesPerRow; - int num5 = emotes.Length % this._maxEmotesPerRow; - if (emotes.Length / this._maxEmotesPerRow != num3) - num5 = this._maxEmotesPerRow; - if (num5 == 0) - num5 = this._maxEmotesPerRow; - float num6 = (float) (36.0 * ((double) num5 / 2.0)) - 16f; - float num7 = -16f; - EmoteButton emoteButton1 = new EmoteButton(emote); - emoteButton1.HAlign = 0.0f; - emoteButton1.VAlign = 0.0f; - emoteButton1.Top = StyleDimension.FromPixels((float) (30 + num3 * 36) + num2); - emoteButton1.Left = StyleDimension.FromPixels((float) (36 * num4) - num7); - EmoteButton emoteButton2 = emoteButton1; - this.Append((UIElement) emoteButton2); - emoteButton2.SetSnapPoint("Group " + (object) groupIndex, id); - } - } - - public override int CompareTo(object obj) => obj is EmotesGroupListItem emotesGroupListItem ? this._groupIndex.CompareTo(emotesGroupListItem._groupIndex) : base.CompareTo(obj); - } -} diff --git a/GameContent/UI/Elements/ExtraBestiaryInfoPageInformation.cs b/GameContent/UI/Elements/ExtraBestiaryInfoPageInformation.cs deleted file mode 100644 index 41fd83a..0000000 --- a/GameContent/UI/Elements/ExtraBestiaryInfoPageInformation.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.ExtraBestiaryInfoPageInformation -// 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 Terraria.GameContent.Bestiary; - -namespace Terraria.GameContent.UI.Elements -{ - public struct ExtraBestiaryInfoPageInformation - { - public BestiaryUnlockProgressReport BestiaryProgressReport; - } -} diff --git a/GameContent/UI/Elements/GroupOptionButton`1.cs b/GameContent/UI/Elements/GroupOptionButton`1.cs deleted file mode 100644 index 8aeb554..0000000 --- a/GameContent/UI/Elements/GroupOptionButton`1.cs +++ /dev/null @@ -1,169 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.GroupOptionButton`1 -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using System; -using Terraria.Audio; -using Terraria.ID; -using Terraria.Localization; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class GroupOptionButton : UIElement, IGroupOptionButton where T : IConvertible - { - private T _currentOption; - private readonly Asset _BasePanelTexture; - private readonly Asset _selectedBorderTexture; - private readonly Asset _hoveredBorderTexture; - private readonly Asset _iconTexture; - private readonly T _myOption; - private Color _color; - private Color _borderColor; - public float FadeFromBlack = 1f; - private float _whiteLerp = 0.7f; - private float _opacity = 0.7f; - private bool _hovered; - private bool _soundedHover; - public bool ShowHighlightWhenSelected = true; - private bool _UseOverrideColors; - private Color _overrideUnpickedColor = Color.White; - private Color _overridePickedColor = Color.White; - private float _overrideOpacityPicked; - private float _overrideOpacityUnpicked; - public readonly LocalizedText Description; - private UIText _title; - - public T OptionValue => this._myOption; - - public bool IsSelected => this._currentOption.Equals((object) this._myOption); - - public GroupOptionButton( - T option, - LocalizedText title, - LocalizedText description, - Color textColor, - string iconTexturePath, - float textSize = 1f, - float titleAlignmentX = 0.5f, - float titleWidthReduction = 10f) - { - this._borderColor = Color.White; - this._currentOption = option; - this._myOption = option; - this.Description = description; - this.Width = StyleDimension.FromPixels(44f); - this.Height = StyleDimension.FromPixels(34f); - this._BasePanelTexture = Main.Assets.Request("Images/UI/CharCreation/PanelGrayscale", (AssetRequestMode) 1); - this._selectedBorderTexture = Main.Assets.Request("Images/UI/CharCreation/CategoryPanelHighlight", (AssetRequestMode) 1); - this._hoveredBorderTexture = Main.Assets.Request("Images/UI/CharCreation/CategoryPanelBorder", (AssetRequestMode) 1); - if (iconTexturePath != null) - this._iconTexture = Main.Assets.Request(iconTexturePath, (AssetRequestMode) 1); - this._color = Colors.InventoryDefaultColor; - if (title == null) - return; - UIText uiText1 = new UIText(title, textSize); - uiText1.HAlign = titleAlignmentX; - uiText1.VAlign = 0.5f; - uiText1.Width = StyleDimension.FromPixelsAndPercent(-titleWidthReduction, 1f); - uiText1.Top = StyleDimension.FromPixels(0.0f); - UIText uiText2 = uiText1; - uiText2.TextColor = textColor; - this.Append((UIElement) uiText2); - this._title = uiText2; - } - - public void SetText(LocalizedText text, float textSize, Color color) - { - if (this._title != null) - this._title.Remove(); - UIText uiText1 = new UIText(text, textSize); - uiText1.HAlign = 0.5f; - uiText1.VAlign = 0.5f; - uiText1.Width = StyleDimension.FromPixelsAndPercent(-10f, 1f); - uiText1.Top = StyleDimension.FromPixels(0.0f); - UIText uiText2 = uiText1; - uiText2.TextColor = color; - this.Append((UIElement) uiText2); - this._title = uiText2; - } - - public void SetCurrentOption(T option) => this._currentOption = option; - - protected override void DrawSelf(SpriteBatch spriteBatch) - { - if (this._hovered) - { - if (!this._soundedHover) - SoundEngine.PlaySound(12); - this._soundedHover = true; - } - else - this._soundedHover = false; - CalculatedStyle dimensions = this.GetDimensions(); - Color color1 = this._color; - float num = this._opacity; - bool isSelected = this.IsSelected; - if (this._UseOverrideColors) - { - color1 = isSelected ? this._overridePickedColor : this._overrideUnpickedColor; - num = isSelected ? this._overrideOpacityPicked : this._overrideOpacityUnpicked; - } - Utils.DrawSplicedPanel(spriteBatch, this._BasePanelTexture.Value, (int) dimensions.X, (int) dimensions.Y, (int) dimensions.Width, (int) dimensions.Height, 10, 10, 10, 10, Color.Lerp(Color.Black, color1, this.FadeFromBlack) * num); - if (isSelected && this.ShowHighlightWhenSelected) - Utils.DrawSplicedPanel(spriteBatch, this._selectedBorderTexture.Value, (int) dimensions.X + 7, (int) dimensions.Y + 7, (int) dimensions.Width - 14, (int) dimensions.Height - 14, 10, 10, 10, 10, Color.Lerp(color1, Color.White, this._whiteLerp) * num); - if (this._hovered) - Utils.DrawSplicedPanel(spriteBatch, this._hoveredBorderTexture.Value, (int) dimensions.X, (int) dimensions.Y, (int) dimensions.Width, (int) dimensions.Height, 10, 10, 10, 10, this._borderColor); - if (this._iconTexture == null) - return; - Color color2 = Color.White; - if (!this._hovered && !isSelected) - color2 = Color.Lerp(color1, Color.White, this._whiteLerp) * num; - spriteBatch.Draw(this._iconTexture.Value, new Vector2(dimensions.X + 1f, dimensions.Y + 1f), color2); - } - - public override void MouseDown(UIMouseEvent evt) - { - SoundEngine.PlaySound(12); - base.MouseDown(evt); - } - - public override void MouseOver(UIMouseEvent evt) - { - base.MouseOver(evt); - this._hovered = true; - } - - public override void MouseOut(UIMouseEvent evt) - { - base.MouseOut(evt); - this._hovered = false; - } - - public void SetColor(Color color, float opacity) - { - this._color = color; - this._opacity = opacity; - } - - public void SetColorsBasedOnSelectionState( - Color pickedColor, - Color unpickedColor, - float opacityPicked, - float opacityNotPicked) - { - this._UseOverrideColors = true; - this._overridePickedColor = pickedColor; - this._overrideUnpickedColor = unpickedColor; - this._overrideOpacityPicked = opacityPicked; - this._overrideOpacityUnpicked = opacityNotPicked; - } - - public void SetBorderColor(Color color) => this._borderColor = color; - } -} diff --git a/GameContent/UI/Elements/IColorable.cs b/GameContent/UI/Elements/IColorable.cs deleted file mode 100644 index cd8272b..0000000 --- a/GameContent/UI/Elements/IColorable.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.IColorable -// 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.UI.Elements -{ - public interface IColorable - { - Color Color { get; set; } - } -} diff --git a/GameContent/UI/Elements/IGroupOptionButton.cs b/GameContent/UI/Elements/IGroupOptionButton.cs deleted file mode 100644 index bf155f1..0000000 --- a/GameContent/UI/Elements/IGroupOptionButton.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.IGroupOptionButton -// 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.UI.Elements -{ - public interface IGroupOptionButton - { - void SetColorsBasedOnSelectionState( - Color pickedColor, - Color unpickedColor, - float opacityPicked, - float opacityNotPicked); - - void SetBorderColor(Color color); - } -} diff --git a/GameContent/UI/Elements/IManuallyOrderedUIElement.cs b/GameContent/UI/Elements/IManuallyOrderedUIElement.cs deleted file mode 100644 index 9b278c8..0000000 --- a/GameContent/UI/Elements/IManuallyOrderedUIElement.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.IManuallyOrderedUIElement -// 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.UI.Elements -{ - public interface IManuallyOrderedUIElement - { - int OrderInUIList { get; set; } - } -} diff --git a/GameContent/UI/Elements/PowerStripUIElement.cs b/GameContent/UI/Elements/PowerStripUIElement.cs deleted file mode 100644 index fc718d7..0000000 --- a/GameContent/UI/Elements/PowerStripUIElement.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.PowerStripUIElement -// 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; -using System.Collections.Generic; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class PowerStripUIElement : UIElement - { - private List _buttonsBySorting; - private string _gamepadPointGroupname; - - public PowerStripUIElement(string gamepadGroupName, List buttons) - { - this._buttonsBySorting = new List((IEnumerable) buttons); - this._gamepadPointGroupname = gamepadGroupName; - int count = buttons.Count; - int num1 = 4; - int num2 = 40; - int num3 = 40; - int num4 = num3 + num1; - UIPanel uiPanel1 = new UIPanel(); - uiPanel1.Width = new StyleDimension((float) (num2 + num1 * 2), 0.0f); - uiPanel1.Height = new StyleDimension((float) (num3 * count + num1 * (1 + count)), 0.0f); - UIPanel uiPanel2 = uiPanel1; - this.SetPadding(0.0f); - this.Width = uiPanel2.Width; - this.Height = uiPanel2.Height; - uiPanel2.BorderColor = new Color(89, 116, 213, (int) byte.MaxValue) * 0.9f; - uiPanel2.BackgroundColor = new Color(73, 94, 171) * 0.9f; - uiPanel2.SetPadding(0.0f); - this.Append((UIElement) uiPanel2); - for (int index = 0; index < count; ++index) - { - UIElement button = buttons[index]; - button.HAlign = 0.5f; - button.Top = new StyleDimension((float) (num1 + num4 * index), 0.0f); - button.SetSnapPoint(this._gamepadPointGroupname, index); - uiPanel2.Append(button); - this._buttonsBySorting.Add(button); - } - } - } -} diff --git a/GameContent/UI/Elements/UIAchievementListItem.cs b/GameContent/UI/Elements/UIAchievementListItem.cs index beb0283..97a386c 100644 --- a/GameContent/UI/Elements/UIAchievementListItem.cs +++ b/GameContent/UI/Elements/UIAchievementListItem.cs @@ -1,14 +1,14 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.Elements.UIAchievementListItem -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using System; using Terraria.Achievements; +using Terraria.Graphics; using Terraria.Localization; using Terraria.UI; using Terraria.UI.Chat; @@ -27,9 +27,9 @@ namespace Terraria.GameContent.UI.Elements private Rectangle _iconFrame; private Rectangle _iconFrameUnlocked; private Rectangle _iconFrameLocked; - private Asset _innerPanelTopTexture; - private Asset _innerPanelBottomTexture; - private Asset _categoryTexture; + private Texture2D _innerPanelTopTexture; + private Texture2D _innerPanelBottomTexture; + private Texture2D _categoryTexture; private bool _locked; private bool _large; @@ -53,17 +53,17 @@ namespace Terraria.GameContent.UI.Elements this._iconFrameLocked.X += 528; this._iconFrame = this._iconFrameLocked; this.UpdateIconFrame(); - this._achievementIcon = new UIImageFramed(Main.Assets.Request("Images/UI/Achievements", (AssetRequestMode) 1), this._iconFrame); + this._achievementIcon = new UIImageFramed(TextureManager.Load("Images/UI/Achievements"), this._iconFrame); this._achievementIcon.Left.Set(pixels1, 0.0f); this._achievementIcon.Top.Set(pixels2, 0.0f); this.Append((UIElement) this._achievementIcon); - this._achievementIconBorders = new UIImage(Main.Assets.Request("Images/UI/Achievement_Borders", (AssetRequestMode) 1)); + this._achievementIconBorders = new UIImage(TextureManager.Load("Images/UI/Achievement_Borders")); this._achievementIconBorders.Left.Set(pixels1 - 4f, 0.0f); this._achievementIconBorders.Top.Set(pixels2 - 4f, 0.0f); this.Append((UIElement) this._achievementIconBorders); - this._innerPanelTopTexture = Main.Assets.Request("Images/UI/Achievement_InnerPanelTop", (AssetRequestMode) 1); - this._innerPanelBottomTexture = !this._large ? Main.Assets.Request("Images/UI/Achievement_InnerPanelBottom", (AssetRequestMode) 1) : Main.Assets.Request("Images/UI/Achievement_InnerPanelBottom_Large", (AssetRequestMode) 1); - this._categoryTexture = Main.Assets.Request("Images/UI/Achievement_Categories", (AssetRequestMode) 1); + this._innerPanelTopTexture = TextureManager.Load("Images/UI/Achievement_InnerPanelTop"); + this._innerPanelBottomTexture = !this._large ? TextureManager.Load("Images/UI/Achievement_InnerPanelBottom") : TextureManager.Load("Images/UI/Achievement_InnerPanelBottom_Large"); + this._categoryTexture = TextureManager.Load("Images/UI/Achievement_Categories"); } protected override void DrawSelf(SpriteBatch spriteBatch) @@ -83,10 +83,10 @@ namespace Terraria.GameContent.UI.Elements float num2 = (float) ((double) innerDimensions.Width - (double) dimensions.Width + 1.0) - (float) (num1 * 2); Vector2 baseScale1 = new Vector2(0.85f); Vector2 baseScale2 = new Vector2(0.92f); - string wrappedText = FontAssets.ItemStack.Value.CreateWrappedText(this._achievement.Description.Value, (float) (((double) num2 - 20.0) * (1.0 / (double) baseScale2.X)), Language.ActiveCulture.CultureInfo); - Vector2 stringSize1 = ChatManager.GetStringSize(FontAssets.ItemStack.Value, wrappedText, baseScale2, num2); + string wrappedText = Main.fontItemStack.CreateWrappedText(this._achievement.Description.Value, (float) (((double) num2 - 20.0) * (1.0 / (double) baseScale2.X)), Language.ActiveCulture.CultureInfo); + Vector2 stringSize1 = ChatManager.GetStringSize(Main.fontItemStack, wrappedText, baseScale2, num2); if (!this._large) - stringSize1 = ChatManager.GetStringSize(FontAssets.ItemStack.Value, this._achievement.Description.Value, baseScale2, num2); + stringSize1 = ChatManager.GetStringSize(Main.fontItemStack, this._achievement.Description.Value, baseScale2, num2); float num3 = (float) (38.0 + (this._large ? 20.0 : 0.0)); if ((double) stringSize1.Y > (double) num3) baseScale2.Y *= num3 / stringSize1.Y; @@ -98,22 +98,22 @@ namespace Terraria.GameContent.UI.Elements AchievementCategory category = this._achievement.Category; position1.Y += 2f; position1.X += 4f; - spriteBatch.Draw(this._categoryTexture.Value, position1, new Rectangle?(this._categoryTexture.Frame(4, 2, (int) category)), this.IsMouseHovering ? Color.White : Color.Silver, 0.0f, Vector2.Zero, 0.5f, SpriteEffects.None, 0.0f); + spriteBatch.Draw(this._categoryTexture, position1, new Rectangle?(this._categoryTexture.Frame(4, 2, (int) category)), this.IsMouseHovering ? Color.White : Color.Silver, 0.0f, Vector2.Zero, 0.5f, SpriteEffects.None, 0.0f); position1.X += 4f; position1.X += 17f; - ChatManager.DrawColorCodedStringWithShadow(spriteBatch, FontAssets.ItemStack.Value, this._achievement.FriendlyName.Value, position1, baseColor1, 0.0f, Vector2.Zero, baseScale1, num2); + ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontItemStack, this._achievement.FriendlyName.Value, position1, baseColor1, 0.0f, Vector2.Zero, baseScale1, num2); position1.X -= 17f; Vector2 position2 = vector2_2 + Vector2.UnitY * 27f + vector2_1; this.DrawPanelBottom(spriteBatch, position2, num2, color1); position2.X += 8f; position2.Y += 4f; - ChatManager.DrawColorCodedStringWithShadow(spriteBatch, FontAssets.ItemStack.Value, wrappedText, position2, baseColor2, 0.0f, Vector2.Zero, baseScale2); + ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontItemStack, wrappedText, position2, baseColor2, 0.0f, Vector2.Zero, baseScale2); if (!flag) return; Vector2 position3 = position1 + Vector2.UnitX * num2 + Vector2.UnitY; - string text = ((int) trackerValues.Item1).ToString() + "/" + (object) (int) trackerValues.Item2; + string text = ((int) trackerValues.Item1).ToString() + "/" + ((int) trackerValues.Item2).ToString(); Vector2 baseScale3 = new Vector2(0.75f); - Vector2 stringSize2 = ChatManager.GetStringSize(FontAssets.ItemStack.Value, text, baseScale3); + Vector2 stringSize2 = ChatManager.GetStringSize(Main.fontItemStack, text, baseScale3); float progress = (float) (trackerValues.Item1 / trackerValues.Item2); float Width = 80f; Color color2 = new Color(100, (int) byte.MaxValue, 100); @@ -124,7 +124,7 @@ namespace Terraria.GameContent.UI.Elements BackColor = Color.Lerp(BackColor, Color.Black, 0.25f); this.DrawProgressBar(spriteBatch, progress, position3 - Vector2.UnitX * Width * 0.7f, Width, BackColor, color2, color2.MultiplyRGBA(new Color(new Vector4(1f, 1f, 1f, 0.5f)))); position3.X -= Width * 1.4f + stringSize2.X; - ChatManager.DrawColorCodedStringWithShadow(spriteBatch, FontAssets.ItemStack.Value, text, position3, baseColor1, 0.0f, new Vector2(0.0f, 0.0f), baseScale3, 90f); + ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontItemStack, text, position3, baseColor1, 0.0f, new Vector2(0.0f, 0.0f), baseScale3, 90f); } private void UpdateIconFrame() @@ -137,9 +137,9 @@ namespace Terraria.GameContent.UI.Elements private void DrawPanelTop(SpriteBatch spriteBatch, Vector2 position, float width, Color color) { - spriteBatch.Draw(this._innerPanelTopTexture.Value, position, new Rectangle?(new Rectangle(0, 0, 2, this._innerPanelTopTexture.Height())), color); - spriteBatch.Draw(this._innerPanelTopTexture.Value, new Vector2(position.X + 2f, position.Y), new Rectangle?(new Rectangle(2, 0, 2, this._innerPanelTopTexture.Height())), color, 0.0f, Vector2.Zero, new Vector2((float) (((double) width - 4.0) / 2.0), 1f), SpriteEffects.None, 0.0f); - spriteBatch.Draw(this._innerPanelTopTexture.Value, new Vector2((float) ((double) position.X + (double) width - 2.0), position.Y), new Rectangle?(new Rectangle(4, 0, 2, this._innerPanelTopTexture.Height())), color); + spriteBatch.Draw(this._innerPanelTopTexture, position, new Rectangle?(new Rectangle(0, 0, 2, this._innerPanelTopTexture.Height)), color); + spriteBatch.Draw(this._innerPanelTopTexture, new Vector2(position.X + 2f, position.Y), new Rectangle?(new Rectangle(2, 0, 2, this._innerPanelTopTexture.Height)), color, 0.0f, Vector2.Zero, new Vector2((float) (((double) width - 4.0) / 2.0), 1f), SpriteEffects.None, 0.0f); + spriteBatch.Draw(this._innerPanelTopTexture, new Vector2((float) ((double) position.X + (double) width - 2.0), position.Y), new Rectangle?(new Rectangle(4, 0, 2, this._innerPanelTopTexture.Height)), color); } private void DrawPanelBottom( @@ -148,9 +148,9 @@ namespace Terraria.GameContent.UI.Elements float width, Color color) { - spriteBatch.Draw(this._innerPanelBottomTexture.Value, position, new Rectangle?(new Rectangle(0, 0, 6, this._innerPanelBottomTexture.Height())), color); - spriteBatch.Draw(this._innerPanelBottomTexture.Value, new Vector2(position.X + 6f, position.Y), new Rectangle?(new Rectangle(6, 0, 7, this._innerPanelBottomTexture.Height())), color, 0.0f, Vector2.Zero, new Vector2((float) (((double) width - 12.0) / 7.0), 1f), SpriteEffects.None, 0.0f); - spriteBatch.Draw(this._innerPanelBottomTexture.Value, new Vector2((float) ((double) position.X + (double) width - 6.0), position.Y), new Rectangle?(new Rectangle(13, 0, 6, this._innerPanelBottomTexture.Height())), color); + spriteBatch.Draw(this._innerPanelBottomTexture, position, new Rectangle?(new Rectangle(0, 0, 6, this._innerPanelBottomTexture.Height)), color); + spriteBatch.Draw(this._innerPanelBottomTexture, new Vector2(position.X + 6f, position.Y), new Rectangle?(new Rectangle(6, 0, 7, this._innerPanelBottomTexture.Height)), color, 0.0f, Vector2.Zero, new Vector2((float) (((double) width - 12.0) / 7.0), 1f), SpriteEffects.None, 0.0f); + spriteBatch.Draw(this._innerPanelBottomTexture, new Vector2((float) ((double) position.X + (double) width - 6.0), position.Y), new Rectangle?(new Rectangle(13, 0, 6, this._innerPanelBottomTexture.Height)), color); } public override void MouseOver(UIMouseEvent evt) @@ -200,23 +200,23 @@ namespace Terraria.GameContent.UI.Elements FillingColor = new Color((int) byte.MaxValue, 241, 51); if (BackColor == Color.Transparent) FillingColor = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); - Texture2D texture1 = TextureAssets.ColorBar.Value; - Texture2D texture2D = TextureAssets.ColorBlip.Value; - Texture2D texture2 = TextureAssets.MagicPixel.Value; + Texture2D colorBarTexture = Main.colorBarTexture; + Texture2D colorBlipTexture = Main.colorBlipTexture; + Texture2D magicPixel = Main.magicPixel; float num1 = MathHelper.Clamp(progress, 0.0f, 1f); float num2 = Width * 1f; float y = 8f; float x = num2 / 169f; Vector2 vector2 = spot + Vector2.UnitY * y + Vector2.UnitX * 1f; - spriteBatch.Draw(texture1, spot, new Rectangle?(new Rectangle(5, 0, texture1.Width - 9, texture1.Height)), BackColor, 0.0f, new Vector2(84.5f, 0.0f), new Vector2(x, 1f), SpriteEffects.None, 0.0f); - spriteBatch.Draw(texture1, spot + new Vector2((float) (-(double) x * 84.5 - 5.0), 0.0f), new Rectangle?(new Rectangle(0, 0, 5, texture1.Height)), BackColor, 0.0f, Vector2.Zero, Vector2.One, SpriteEffects.None, 0.0f); - spriteBatch.Draw(texture1, spot + new Vector2(x * 84.5f, 0.0f), new Rectangle?(new Rectangle(texture1.Width - 4, 0, 4, texture1.Height)), BackColor, 0.0f, Vector2.Zero, Vector2.One, SpriteEffects.None, 0.0f); + spriteBatch.Draw(colorBarTexture, spot, new Rectangle?(new Rectangle(5, 0, colorBarTexture.Width - 9, colorBarTexture.Height)), BackColor, 0.0f, new Vector2(84.5f, 0.0f), new Vector2(x, 1f), SpriteEffects.None, 0.0f); + spriteBatch.Draw(colorBarTexture, spot + new Vector2((float) (-(double) x * 84.5 - 5.0), 0.0f), new Rectangle?(new Rectangle(0, 0, 5, colorBarTexture.Height)), BackColor, 0.0f, Vector2.Zero, Vector2.One, SpriteEffects.None, 0.0f); + spriteBatch.Draw(colorBarTexture, spot + new Vector2(x * 84.5f, 0.0f), new Rectangle?(new Rectangle(colorBarTexture.Width - 4, 0, 4, colorBarTexture.Height)), BackColor, 0.0f, Vector2.Zero, Vector2.One, SpriteEffects.None, 0.0f); Vector2 position = vector2 + Vector2.UnitX * (num1 - 0.5f) * num2; --position.X; - spriteBatch.Draw(texture2, position, new Rectangle?(new Rectangle(0, 0, 1, 1)), FillingColor, 0.0f, new Vector2(1f, 0.5f), new Vector2(num2 * num1, y), SpriteEffects.None, 0.0f); + spriteBatch.Draw(magicPixel, position, new Rectangle?(new Rectangle(0, 0, 1, 1)), FillingColor, 0.0f, new Vector2(1f, 0.5f), new Vector2(num2 * num1, y), SpriteEffects.None, 0.0f); if ((double) progress != 0.0) - spriteBatch.Draw(texture2, position, new Rectangle?(new Rectangle(0, 0, 1, 1)), BlipColor, 0.0f, new Vector2(1f, 0.5f), new Vector2(2f, y), SpriteEffects.None, 0.0f); - spriteBatch.Draw(texture2, position, new Rectangle?(new Rectangle(0, 0, 1, 1)), Color.Black, 0.0f, new Vector2(0.0f, 0.5f), new Vector2(num2 * (1f - num1), y), SpriteEffects.None, 0.0f); + spriteBatch.Draw(magicPixel, position, new Rectangle?(new Rectangle(0, 0, 1, 1)), BlipColor, 0.0f, new Vector2(1f, 0.5f), new Vector2(2f, y), SpriteEffects.None, 0.0f); + spriteBatch.Draw(magicPixel, position, new Rectangle?(new Rectangle(0, 0, 1, 1)), Color.Black, 0.0f, new Vector2(0.0f, 0.5f), new Vector2(num2 * (1f - num1), y), SpriteEffects.None, 0.0f); } public override int CompareTo(object obj) diff --git a/GameContent/UI/Elements/UIBestiaryEntryButton.cs b/GameContent/UI/Elements/UIBestiaryEntryButton.cs deleted file mode 100644 index 35160b2..0000000 --- a/GameContent/UI/Elements/UIBestiaryEntryButton.cs +++ /dev/null @@ -1,155 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UIBestiaryEntryButton -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria.Audio; -using Terraria.GameContent.Bestiary; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UIBestiaryEntryButton : UIElement - { - private UIImage _bordersGlow; - private UIImage _bordersOverlay; - private UIImage _borders; - private UIBestiaryEntryIcon _icon; - - public BestiaryEntry Entry { get; private set; } - - public UIBestiaryEntryButton(BestiaryEntry entry, bool isAPrettyPortrait) - { - this.Entry = entry; - this.Height.Set(72f, 0.0f); - this.Width.Set(72f, 0.0f); - this.SetPadding(0.0f); - UIElement element = new UIElement() - { - Width = new StyleDimension(-4f, 1f), - Height = new StyleDimension(-4f, 1f), - IgnoresMouseInteraction = true, - OverflowHidden = true, - HAlign = 0.5f, - VAlign = 0.5f - }; - element.SetPadding(0.0f); - UIImage uiImage1 = new UIImage(Main.Assets.Request("Images/UI/Bestiary/Slot_Back", (AssetRequestMode) 1)); - uiImage1.VAlign = 0.5f; - uiImage1.HAlign = 0.5f; - element.Append((UIElement) uiImage1); - if (isAPrettyPortrait) - { - Asset texture = this.TryGettingBackgroundImageProvider(entry); - if (texture != null) - { - UIElement uiElement = element; - UIImage uiImage2 = new UIImage(texture); - uiImage2.HAlign = 0.5f; - uiImage2.VAlign = 0.5f; - uiElement.Append((UIElement) uiImage2); - } - } - UIBestiaryEntryIcon bestiaryEntryIcon = new UIBestiaryEntryIcon(entry, isAPrettyPortrait); - element.Append((UIElement) bestiaryEntryIcon); - this.Append(element); - this._icon = bestiaryEntryIcon; - int? nullable = this.TryGettingDisplayIndex(entry); - if (nullable.HasValue) - { - UIText uiText = new UIText(nullable.Value.ToString(), 0.9f); - uiText.Top = new StyleDimension(10f, 0.0f); - uiText.Left = new StyleDimension(10f, 0.0f); - uiText.IgnoresMouseInteraction = true; - this.Append((UIElement) uiText); - } - UIImage uiImage3 = new UIImage(Main.Assets.Request("Images/UI/Bestiary/Slot_Selection", (AssetRequestMode) 1)); - uiImage3.VAlign = 0.5f; - uiImage3.HAlign = 0.5f; - uiImage3.IgnoresMouseInteraction = true; - this._bordersGlow = uiImage3; - UIImage uiImage4 = new UIImage(Main.Assets.Request("Images/UI/Bestiary/Slot_Overlay", (AssetRequestMode) 1)); - uiImage4.VAlign = 0.5f; - uiImage4.HAlign = 0.5f; - uiImage4.IgnoresMouseInteraction = true; - uiImage4.Color = Color.White * 0.6f; - this._bordersOverlay = uiImage4; - this.Append((UIElement) this._bordersOverlay); - UIImage uiImage5 = new UIImage(Main.Assets.Request("Images/UI/Bestiary/Slot_Front", (AssetRequestMode) 1)); - uiImage5.VAlign = 0.5f; - uiImage5.HAlign = 0.5f; - uiImage5.IgnoresMouseInteraction = true; - this.Append((UIElement) uiImage5); - this._borders = uiImage5; - if (isAPrettyPortrait) - this.RemoveChild((UIElement) this._bordersOverlay); - if (isAPrettyPortrait) - return; - this.OnMouseOver += new UIElement.MouseEvent(this.MouseOver); - this.OnMouseOut += new UIElement.MouseEvent(this.MouseOut); - } - - private Asset TryGettingBackgroundImageProvider(BestiaryEntry entry) - { - IEnumerable source = entry.Info.Where((Func) (x => x is IBestiaryBackgroundImagePathAndColorProvider)).Select((Func) (x => x as IBestiaryBackgroundImagePathAndColorProvider)); - IEnumerable preferences = entry.Info.OfType(); - foreach (IBestiaryBackgroundImagePathAndColorProvider andColorProvider in source.Where((Func) (provider => preferences.Any((Func) (preference => preference.Matches(provider)))))) - { - Asset backgroundImage = andColorProvider.GetBackgroundImage(); - if (backgroundImage != null) - return backgroundImage; - } - foreach (IBestiaryBackgroundImagePathAndColorProvider andColorProvider in source) - { - Asset backgroundImage = andColorProvider.GetBackgroundImage(); - if (backgroundImage != null) - return backgroundImage; - } - return (Asset) null; - } - - private int? TryGettingDisplayIndex(BestiaryEntry entry) - { - int? nullable = new int?(); - IBestiaryInfoElement bestiaryInfoElement = entry.Info.FirstOrDefault((Func) (x => x is IBestiaryEntryDisplayIndex)); - if (bestiaryInfoElement != null) - nullable = new int?((bestiaryInfoElement as IBestiaryEntryDisplayIndex).BestiaryDisplayIndex); - return nullable; - } - - protected override void DrawSelf(SpriteBatch spriteBatch) - { - if (!this.IsMouseHovering) - return; - Main.instance.MouseText(this._icon.GetHoverText()); - } - - private void MouseOver(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(12); - this.RemoveChild((UIElement) this._borders); - this.RemoveChild((UIElement) this._bordersGlow); - this.RemoveChild((UIElement) this._bordersOverlay); - this.Append((UIElement) this._borders); - this.Append((UIElement) this._bordersGlow); - this._icon.ForceHover = true; - } - - private void MouseOut(UIMouseEvent evt, UIElement listeningElement) - { - this.RemoveChild((UIElement) this._borders); - this.RemoveChild((UIElement) this._bordersGlow); - this.RemoveChild((UIElement) this._bordersOverlay); - this.Append((UIElement) this._bordersOverlay); - this.Append((UIElement) this._borders); - this._icon.ForceHover = false; - } - } -} diff --git a/GameContent/UI/Elements/UIBestiaryEntryGrid.cs b/GameContent/UI/Elements/UIBestiaryEntryGrid.cs deleted file mode 100644 index e4e6dc3..0000000 --- a/GameContent/UI/Elements/UIBestiaryEntryGrid.cs +++ /dev/null @@ -1,124 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UIBestiaryEntryGrid -// 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; -using System; -using System.Collections.Generic; -using Terraria.GameContent.Bestiary; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UIBestiaryEntryGrid : UIElement - { - private List _workingSetEntries; - private UIElement.MouseEvent _clickOnEntryEvent; - private int _atEntryIndex; - private int _lastEntry; - - public event Action OnGridContentsChanged; - - public UIBestiaryEntryGrid( - List workingSet, - UIElement.MouseEvent clickOnEntryEvent) - { - this.Width = new StyleDimension(0.0f, 1f); - this.Height = new StyleDimension(0.0f, 1f); - this._workingSetEntries = workingSet; - this._clickOnEntryEvent = clickOnEntryEvent; - this.SetPadding(0.0f); - this.UpdateEntries(); - this.FillBestiarySpaceWithEntries(); - } - - public void UpdateEntries() => this._lastEntry = this._workingSetEntries.Count; - - public void FillBestiarySpaceWithEntries() - { - this.RemoveAllChildren(); - this.UpdateEntries(); - int maxEntriesWidth; - int maxEntriesHeight; - int maxEntriesToHave; - this.GetEntriesToShow(out maxEntriesWidth, out maxEntriesHeight, out maxEntriesToHave); - this.FixBestiaryRange(0, maxEntriesToHave); - int atEntryIndex = this._atEntryIndex; - int num1 = Math.Min(this._lastEntry, atEntryIndex + maxEntriesToHave); - List bestiaryEntryList = new List(); - for (int index = atEntryIndex; index < num1; ++index) - bestiaryEntryList.Add(this._workingSetEntries[index]); - int num2 = 0; - float num3 = 0.5f / (float) maxEntriesWidth; - float num4 = 0.5f / (float) maxEntriesHeight; - for (int index1 = 0; index1 < maxEntriesHeight; ++index1) - { - for (int index2 = 0; index2 < maxEntriesWidth && num2 < bestiaryEntryList.Count; ++index2) - { - UIElement element = (UIElement) new UIBestiaryEntryButton(bestiaryEntryList[num2], false); - ++num2; - element.OnClick += this._clickOnEntryEvent; - element.VAlign = element.HAlign = 0.5f; - element.Left.Set(0.0f, (float) ((double) index2 / (double) maxEntriesWidth - 0.5) + num3); - element.Top.Set(0.0f, (float) ((double) index1 / (double) maxEntriesHeight - 0.5) + num4); - element.SetSnapPoint("Entries", num2, new Vector2?(new Vector2(0.2f, 0.7f))); - this.Append(element); - } - } - } - - public override void Recalculate() - { - base.Recalculate(); - this.FillBestiarySpaceWithEntries(); - } - - public void GetEntriesToShow( - out int maxEntriesWidth, - out int maxEntriesHeight, - out int maxEntriesToHave) - { - Rectangle rectangle = this.GetDimensions().ToRectangle(); - maxEntriesWidth = rectangle.Width / 72; - maxEntriesHeight = rectangle.Height / 72; - int num = 0; - maxEntriesToHave = maxEntriesWidth * maxEntriesHeight - num; - } - - public string GetRangeText() - { - int maxEntriesToHave; - this.GetEntriesToShow(out int _, out int _, out maxEntriesToHave); - int atEntryIndex = this._atEntryIndex; - int val2 = Math.Min(this._lastEntry, atEntryIndex + maxEntriesToHave); - return string.Format("{0}-{1} ({2})", (object) Math.Min(atEntryIndex + 1, val2), (object) val2, (object) this._lastEntry); - } - - public void MakeButtonGoByOffset(UIElement element, int howManyPages) => element.OnClick += (UIElement.MouseEvent) ((e, v) => this.OffsetLibraryByPages(howManyPages)); - - public void OffsetLibraryByPages(int howManyPages) - { - int maxEntriesToHave; - this.GetEntriesToShow(out int _, out int _, out maxEntriesToHave); - this.OffsetLibrary(howManyPages * maxEntriesToHave); - } - - public void OffsetLibrary(int offset) - { - int maxEntriesToHave; - this.GetEntriesToShow(out int _, out int _, out maxEntriesToHave); - this.FixBestiaryRange(offset, maxEntriesToHave); - this.FillBestiarySpaceWithEntries(); - } - - private void FixBestiaryRange(int offset, int maxEntriesToHave) - { - this._atEntryIndex = Utils.Clamp(this._atEntryIndex + offset, 0, Math.Max(0, this._lastEntry - maxEntriesToHave)); - if (this.OnGridContentsChanged == null) - return; - this.OnGridContentsChanged(); - } - } -} diff --git a/GameContent/UI/Elements/UIBestiaryEntryIcon.cs b/GameContent/UI/Elements/UIBestiaryEntryIcon.cs deleted file mode 100644 index e186d1d..0000000 --- a/GameContent/UI/Elements/UIBestiaryEntryIcon.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UIBestiaryEntryIcon -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria.GameContent.Bestiary; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UIBestiaryEntryIcon : UIElement - { - private BestiaryEntry _entry; - private Asset _notUnlockedTexture; - private bool _isPortrait; - public bool ForceHover; - private BestiaryUICollectionInfo _collectionInfo; - - public UIBestiaryEntryIcon(BestiaryEntry entry, bool isPortrait) - { - this._entry = entry; - this.IgnoresMouseInteraction = true; - this.OverrideSamplerState = Main.DefaultSamplerState; - this.UseImmediateMode = true; - this.Width.Set(0.0f, 1f); - this.Height.Set(0.0f, 1f); - this._notUnlockedTexture = Main.Assets.Request("Images/UI/Bestiary/Icon_Locked", (AssetRequestMode) 1); - this._isPortrait = isPortrait; - this._collectionInfo = this._entry.UIInfoProvider.GetEntryUICollectionInfo(); - } - - public override void Update(GameTime gameTime) - { - this._collectionInfo = this._entry.UIInfoProvider.GetEntryUICollectionInfo(); - CalculatedStyle dimensions = this.GetDimensions(); - bool flag = this.IsMouseHovering || this.ForceHover; - this._entry.Icon.Update(this._collectionInfo, dimensions.ToRectangle(), new EntryIconDrawSettings() - { - iconbox = dimensions.ToRectangle(), - IsPortrait = this._isPortrait, - IsHovered = flag - }); - base.Update(gameTime); - } - - protected override void DrawSelf(SpriteBatch spriteBatch) - { - CalculatedStyle dimensions = this.GetDimensions(); - int num = this._entry.Icon.GetUnlockState(this._collectionInfo) ? 1 : 0; - bool flag = this.IsMouseHovering || this.ForceHover; - if (num != 0) - { - this._entry.Icon.Draw(this._collectionInfo, spriteBatch, new EntryIconDrawSettings() - { - iconbox = dimensions.ToRectangle(), - IsPortrait = this._isPortrait, - IsHovered = flag - }); - } - else - { - Texture2D texture2D = this._notUnlockedTexture.Value; - spriteBatch.Draw(texture2D, dimensions.Center(), new Rectangle?(), Color.White * 0.15f, 0.0f, texture2D.Size() / 2f, 1f, SpriteEffects.None, 0.0f); - } - } - - public string GetHoverText() => this._entry.Icon.GetHoverText(this._collectionInfo); - } -} diff --git a/GameContent/UI/Elements/UIBestiaryEntryInfoPage.cs b/GameContent/UI/Elements/UIBestiaryEntryInfoPage.cs deleted file mode 100644 index 74ddbfb..0000000 --- a/GameContent/UI/Elements/UIBestiaryEntryInfoPage.cs +++ /dev/null @@ -1,188 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UIBestiaryEntryInfoPage -// 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; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria.GameContent.Bestiary; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UIBestiaryEntryInfoPage : UIPanel - { - private UIList _list; - private UIScrollbar _scrollbar; - private bool _isScrollbarAttached; - - public UIBestiaryEntryInfoPage() - { - this.Width.Set(230f, 0.0f); - this.Height.Set(0.0f, 1f); - this.SetPadding(0.0f); - this.BorderColor = new Color(89, 116, 213, (int) byte.MaxValue); - this.BackgroundColor = new Color(73, 94, 171); - UIList uiList1 = new UIList(); - uiList1.Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f); - uiList1.Height = StyleDimension.FromPixelsAndPercent(0.0f, 1f); - UIList uiList2 = uiList1; - uiList2.SetPadding(2f); - uiList2.PaddingBottom = 4f; - uiList2.PaddingTop = 4f; - this.Append((UIElement) uiList2); - this._list = uiList2; - uiList2.ListPadding = 4f; - uiList2.ManualSortMethod = new Action>(this.ManualIfnoSortingMethod); - UIScrollbar uiScrollbar = new UIScrollbar(); - uiScrollbar.SetView(100f, 1000f); - uiScrollbar.Height.Set(-20f, 1f); - uiScrollbar.HAlign = 1f; - uiScrollbar.VAlign = 0.5f; - uiScrollbar.Left.Set(-6f, 0.0f); - this._scrollbar = uiScrollbar; - this._list.SetScrollbar(this._scrollbar); - this.CheckScrollBar(); - this.AppendBorderOverEverything(); - } - - public void UpdateScrollbar(int scrollWheelValue) - { - if (this._scrollbar == null) - return; - this._scrollbar.ViewPosition -= (float) scrollWheelValue; - } - - private void AppendBorderOverEverything() - { - UIPanel uiPanel1 = new UIPanel(); - uiPanel1.Width = new StyleDimension(0.0f, 1f); - uiPanel1.Height = new StyleDimension(0.0f, 1f); - uiPanel1.IgnoresMouseInteraction = true; - UIPanel uiPanel2 = uiPanel1; - uiPanel2.BorderColor = new Color(89, 116, 213, (int) byte.MaxValue); - uiPanel2.BackgroundColor = Color.Transparent; - this.Append((UIElement) uiPanel2); - } - - private void ManualIfnoSortingMethod(List list) - { - } - - public override void Recalculate() - { - base.Recalculate(); - this.CheckScrollBar(); - } - - private void CheckScrollBar() - { - if (this._scrollbar == null) - return; - bool canScroll = this._scrollbar.CanScroll; - bool flag = true; - if (this._isScrollbarAttached && !flag) - { - this.RemoveChild((UIElement) this._scrollbar); - this._isScrollbarAttached = false; - this._list.Width.Set(0.0f, 1f); - } - else - { - if (!(!this._isScrollbarAttached & flag)) - return; - this.Append((UIElement) this._scrollbar); - this._isScrollbarAttached = true; - this._list.Width.Set(-20f, 1f); - } - } - - public void FillInfoForEntry(BestiaryEntry entry, ExtraBestiaryInfoPageInformation extraInfo) - { - this._list.Clear(); - if (entry == null) - return; - this.AddInfoToList(entry, extraInfo); - this.Recalculate(); - } - - private BestiaryUICollectionInfo GetUICollectionInfo( - BestiaryEntry entry, - ExtraBestiaryInfoPageInformation extraInfo) - { - IBestiaryUICollectionInfoProvider uiInfoProvider = entry.UIInfoProvider; - BestiaryUICollectionInfo uiCollectionInfo = uiInfoProvider == null ? new BestiaryUICollectionInfo() : uiInfoProvider.GetEntryUICollectionInfo(); - uiCollectionInfo.OwnerEntry = entry; - return uiCollectionInfo; - } - - private void AddInfoToList(BestiaryEntry entry, ExtraBestiaryInfoPageInformation extraInfo) - { - BestiaryUICollectionInfo uiCollectionInfo = this.GetUICollectionInfo(entry, extraInfo); - IOrderedEnumerable> orderedEnumerable = new List((IEnumerable) entry.Info).GroupBy(new Func(this.GetBestiaryInfoCategory)).OrderBy, UIBestiaryEntryInfoPage.BestiaryInfoCategory>((Func, UIBestiaryEntryInfoPage.BestiaryInfoCategory>) (x => x.Key)); - UIElement uiElement1 = (UIElement) null; - foreach (IGrouping source in (IEnumerable>) orderedEnumerable) - { - if (source.Count() != 0) - { - bool flag = false; - foreach (IBestiaryInfoElement bestiaryInfoElement in (IEnumerable) source) - { - UIElement uiElement2 = bestiaryInfoElement.ProvideUIElement(uiCollectionInfo); - if (uiElement2 != null) - { - this._list.Add(uiElement2); - flag = true; - } - } - if (flag) - { - UIHorizontalSeparator horizontalSeparator1 = new UIHorizontalSeparator(); - horizontalSeparator1.Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f); - horizontalSeparator1.Color = new Color(89, 116, 213, (int) byte.MaxValue) * 0.9f; - UIHorizontalSeparator horizontalSeparator2 = horizontalSeparator1; - this._list.Add((UIElement) horizontalSeparator2); - uiElement1 = (UIElement) horizontalSeparator2; - } - } - } - this._list.Remove(uiElement1); - } - - private UIBestiaryEntryInfoPage.BestiaryInfoCategory GetBestiaryInfoCategory( - IBestiaryInfoElement element) - { - switch (element) - { - case NPCPortraitInfoElement _: - return UIBestiaryEntryInfoPage.BestiaryInfoCategory.Portrait; - case FlavorTextBestiaryInfoElement _: - return UIBestiaryEntryInfoPage.BestiaryInfoCategory.FlavorText; - case NamePlateInfoElement _: - return UIBestiaryEntryInfoPage.BestiaryInfoCategory.Nameplate; - case ItemFromCatchingNPCBestiaryInfoElement _: - return UIBestiaryEntryInfoPage.BestiaryInfoCategory.ItemsFromCatchingNPC; - case ItemDropBestiaryInfoElement _: - return UIBestiaryEntryInfoPage.BestiaryInfoCategory.ItemsFromDrops; - case NPCStatsReportInfoElement _: - return UIBestiaryEntryInfoPage.BestiaryInfoCategory.Stats; - default: - return UIBestiaryEntryInfoPage.BestiaryInfoCategory.Misc; - } - } - - private enum BestiaryInfoCategory - { - Nameplate, - Portrait, - FlavorText, - Stats, - ItemsFromCatchingNPC, - ItemsFromDrops, - Misc, - } - } -} diff --git a/GameContent/UI/Elements/UIBestiaryFilteringOptionsGrid.cs b/GameContent/UI/Elements/UIBestiaryFilteringOptionsGrid.cs deleted file mode 100644 index facbb70..0000000 --- a/GameContent/UI/Elements/UIBestiaryFilteringOptionsGrid.cs +++ /dev/null @@ -1,244 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UIBestiaryFilteringOptionsGrid -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using System; -using System.Collections.Generic; -using Terraria.DataStructures; -using Terraria.GameContent.Bestiary; -using Terraria.ID; -using Terraria.Localization; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UIBestiaryFilteringOptionsGrid : UIPanel - { - private EntryFilterer _filterer; - private List> _filterButtons; - private List _areFiltersAvailable; - private List> _filterAvailabilityTests; - private UIElement _container; - - public event Action OnClickingOption; - - public UIBestiaryFilteringOptionsGrid( - EntryFilterer filterer) - { - this._filterer = filterer; - this._filterButtons = new List>(); - this._areFiltersAvailable = new List(); - this._filterAvailabilityTests = new List>(); - this.Width = new StyleDimension(0.0f, 1f); - this.Height = new StyleDimension(0.0f, 1f); - this.BackgroundColor = new Color(35, 40, 83) * 0.5f; - this.BorderColor = new Color(35, 40, 83) * 0.5f; - this.IgnoresMouseInteraction = false; - this.SetPadding(0.0f); - this.BuildContainer(); - } - - private void BuildContainer() - { - int widthWithSpacing; - int heightWithSpacing; - int perRow; - int howManyRows; - this.GetDisplaySettings(out int _, out int _, out widthWithSpacing, out heightWithSpacing, out perRow, out float _, out float _, out howManyRows); - UIPanel uiPanel1 = new UIPanel(); - uiPanel1.Width = new StyleDimension((float) (perRow * widthWithSpacing + 10), 0.0f); - uiPanel1.Height = new StyleDimension((float) (howManyRows * heightWithSpacing + 10), 0.0f); - uiPanel1.HAlign = 1f; - uiPanel1.VAlign = 0.0f; - uiPanel1.Left = new StyleDimension(0.0f, 0.0f); - uiPanel1.Top = new StyleDimension(0.0f, 0.0f); - UIPanel uiPanel2 = uiPanel1; - uiPanel2.BorderColor = new Color(89, 116, 213, (int) byte.MaxValue) * 0.9f; - uiPanel2.BackgroundColor = new Color(73, 94, 171) * 0.9f; - uiPanel2.SetPadding(0.0f); - this.Append((UIElement) uiPanel2); - this._container = (UIElement) uiPanel2; - } - - public void SetupAvailabilityTest(List allAvailableEntries) - { - this._filterAvailabilityTests.Clear(); - for (int index1 = 0; index1 < this._filterer.AvailableFilters.Count; ++index1) - { - List bestiaryEntryList = new List(); - this._filterAvailabilityTests.Add(bestiaryEntryList); - IBestiaryEntryFilter availableFilter = this._filterer.AvailableFilters[index1]; - for (int index2 = 0; index2 < allAvailableEntries.Count; ++index2) - { - if (availableFilter.FitsFilter(allAvailableEntries[index2])) - bestiaryEntryList.Add(allAvailableEntries[index2]); - } - } - } - - public void UpdateAvailability() - { - int widthPerButton; - int heightPerButton; - int widthWithSpacing; - int heightWithSpacing; - int perRow; - float offsetLeft; - float offsetTop; - this.GetDisplaySettings(out widthPerButton, out heightPerButton, out widthWithSpacing, out heightWithSpacing, out perRow, out offsetLeft, out offsetTop, out int _); - this._container.RemoveAllChildren(); - this._filterButtons.Clear(); - this._areFiltersAvailable.Clear(); - int num1 = -1; - int num2 = -1; - for (int index = 0; index < this._filterer.AvailableFilters.Count; ++index) - { - int num3 = index / perRow; - int num4 = index % perRow; - IBestiaryEntryFilter availableFilter = this._filterer.AvailableFilters[index]; - List availabilityTest = this._filterAvailabilityTests[index]; - if (this.GetIsFilterAvailableForEntries(availableFilter, availabilityTest)) - { - GroupOptionButton groupOptionButton1 = new GroupOptionButton(index, (LocalizedText) null, (LocalizedText) null, Color.White, (string) null); - groupOptionButton1.Width = new StyleDimension((float) widthPerButton, 0.0f); - groupOptionButton1.Height = new StyleDimension((float) heightPerButton, 0.0f); - groupOptionButton1.HAlign = 0.0f; - groupOptionButton1.VAlign = 0.0f; - groupOptionButton1.Top = new StyleDimension(offsetTop + (float) (num3 * heightWithSpacing), 0.0f); - groupOptionButton1.Left = new StyleDimension(offsetLeft + (float) (num4 * widthWithSpacing), 0.0f); - GroupOptionButton groupOptionButton2 = groupOptionButton1; - groupOptionButton2.OnClick += new UIElement.MouseEvent(this.ClickOption); - groupOptionButton2.SetSnapPoint("Filters", index); - groupOptionButton2.ShowHighlightWhenSelected = false; - this.AddOnHover(availableFilter, (UIElement) groupOptionButton2); - this._container.Append((UIElement) groupOptionButton2); - UIElement image = availableFilter.GetImage(); - if (image != null) - { - image.Left = new StyleDimension((float) num1, 0.0f); - image.Top = new StyleDimension((float) num2, 0.0f); - groupOptionButton2.Append(image); - } - this._filterButtons.Add(groupOptionButton2); - } - else - { - this._filterer.ActiveFilters.Remove(availableFilter); - GroupOptionButton groupOptionButton3 = new GroupOptionButton(-2, (LocalizedText) null, (LocalizedText) null, Color.White, (string) null); - groupOptionButton3.Width = new StyleDimension((float) widthPerButton, 0.0f); - groupOptionButton3.Height = new StyleDimension((float) heightPerButton, 0.0f); - groupOptionButton3.HAlign = 0.0f; - groupOptionButton3.VAlign = 0.0f; - groupOptionButton3.Top = new StyleDimension(offsetTop + (float) (num3 * heightWithSpacing), 0.0f); - groupOptionButton3.Left = new StyleDimension(offsetLeft + (float) (num4 * widthWithSpacing), 0.0f); - groupOptionButton3.FadeFromBlack = 0.5f; - GroupOptionButton groupOptionButton4 = groupOptionButton3; - groupOptionButton4.ShowHighlightWhenSelected = false; - groupOptionButton4.SetPadding(0.0f); - groupOptionButton4.SetSnapPoint("Filters", index); - Asset asset = Main.Assets.Request("Images/UI/Bestiary/Icon_Tags_Shadow", (AssetRequestMode) 1); - UIImageFramed uiImageFramed1 = new UIImageFramed(asset, asset.Frame(16, 5, frameY: 4)); - uiImageFramed1.HAlign = 0.5f; - uiImageFramed1.VAlign = 0.5f; - uiImageFramed1.Color = Color.White * 0.2f; - UIImageFramed uiImageFramed2 = uiImageFramed1; - uiImageFramed2.Left = new StyleDimension((float) num1, 0.0f); - uiImageFramed2.Top = new StyleDimension((float) num2, 0.0f); - groupOptionButton4.Append((UIElement) uiImageFramed2); - this._filterButtons.Add(groupOptionButton4); - this._container.Append((UIElement) groupOptionButton4); - } - } - this.UpdateButtonSelections(); - } - - public void GetEntriesToShow( - out int maxEntriesWidth, - out int maxEntriesHeight, - out int maxEntriesToHave) - { - int perRow; - int howManyRows; - this.GetDisplaySettings(out int _, out int _, out int _, out int _, out perRow, out float _, out float _, out howManyRows); - maxEntriesWidth = perRow; - maxEntriesHeight = howManyRows; - maxEntriesToHave = this._filterer.AvailableFilters.Count; - } - - private void GetDisplaySettings( - out int widthPerButton, - out int heightPerButton, - out int widthWithSpacing, - out int heightWithSpacing, - out int perRow, - out float offsetLeft, - out float offsetTop, - out int howManyRows) - { - widthPerButton = 32; - heightPerButton = 32; - int num = 2; - widthWithSpacing = widthPerButton + num; - heightWithSpacing = heightPerButton + num; - perRow = (int) Math.Ceiling(Math.Sqrt((double) this._filterer.AvailableFilters.Count)); - perRow = 12; - howManyRows = (int) Math.Ceiling((double) this._filterer.AvailableFilters.Count / (double) perRow); - offsetLeft = (float) (perRow * widthWithSpacing - num) * 0.5f; - offsetTop = (float) (howManyRows * heightWithSpacing - num) * 0.5f; - offsetLeft = 6f; - offsetTop = 6f; - } - - private void UpdateButtonSelections() - { - foreach (GroupOptionButton filterButton in this._filterButtons) - { - bool flag = this._filterer.IsFilterActive(filterButton.OptionValue); - filterButton.SetCurrentOption(flag ? filterButton.OptionValue : -1); - if (flag) - filterButton.SetColor(new Color(152, 175, 235), 1f); - else - filterButton.SetColor(Colors.InventoryDefaultColor, 0.7f); - } - } - - private bool GetIsFilterAvailableForEntries( - IBestiaryEntryFilter filter, - List entries) - { - bool? forcedDisplay = filter.ForcedDisplay; - if (forcedDisplay.HasValue) - return forcedDisplay.Value; - for (int index = 0; index < entries.Count; ++index) - { - if (filter.FitsFilter(entries[index]) && entries[index].UIInfoProvider.GetEntryUICollectionInfo().UnlockState > BestiaryEntryUnlockState.NotKnownAtAll_0) - return true; - } - return false; - } - - private void AddOnHover(IBestiaryEntryFilter filter, UIElement button) => button.OnUpdate += (UIElement.ElementEvent) (element => this.ShowButtonName(element, filter)); - - private void ShowButtonName(UIElement element, IBestiaryEntryFilter number) - { - if (!element.IsMouseHovering) - return; - string textValue = Language.GetTextValue(number.GetDisplayNameKey()); - Main.instance.MouseText(textValue); - } - - private void ClickOption(UIMouseEvent evt, UIElement listeningElement) - { - this._filterer.ToggleFilter(((GroupOptionButton) listeningElement).OptionValue); - this.UpdateButtonSelections(); - if (this.OnClickingOption == null) - return; - this.OnClickingOption(); - } - } -} diff --git a/GameContent/UI/Elements/UIBestiaryInfoItemLine.cs b/GameContent/UI/Elements/UIBestiaryInfoItemLine.cs deleted file mode 100644 index 8786c01..0000000 --- a/GameContent/UI/Elements/UIBestiaryInfoItemLine.cs +++ /dev/null @@ -1,143 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UIBestiaryInfoItemLine -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using System.Collections.Generic; -using Terraria.Audio; -using Terraria.GameContent.Bestiary; -using Terraria.GameContent.ItemDropRules; -using Terraria.ID; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UIBestiaryInfoItemLine : UIPanel, IManuallyOrderedUIElement - { - private Item _infoDisplayItem; - private bool _hideMouseOver; - - public int OrderInUIList { get; set; } - - public UIBestiaryInfoItemLine( - DropRateInfo info, - BestiaryUICollectionInfo uiinfo, - float textScale = 1f) - { - this._infoDisplayItem = new Item(); - this._infoDisplayItem.SetDefaults(info.itemId); - this.SetBestiaryNotesOnItemCache(info); - this.SetPadding(0.0f); - this.PaddingLeft = 10f; - this.PaddingRight = 10f; - this.Width.Set(-14f, 1f); - this.Height.Set(32f, 0.0f); - this.Left.Set(5f, 0.0f); - this.OnMouseOver += new UIElement.MouseEvent(this.MouseOver); - this.OnMouseOut += new UIElement.MouseEvent(this.MouseOut); - this.BorderColor = new Color(89, 116, 213, (int) byte.MaxValue); - string stackRange; - string droprate; - this.GetDropInfo(info, uiinfo, out stackRange, out droprate); - if (uiinfo.UnlockState < BestiaryEntryUnlockState.CanShowDropsWithoutDropRates_3) - { - this._hideMouseOver = true; - Asset texture = Main.Assets.Request("Images/UI/Bestiary/Icon_Locked", (AssetRequestMode) 1); - UIElement element = new UIElement() - { - Height = new StyleDimension(0.0f, 1f), - Width = new StyleDimension(0.0f, 1f), - HAlign = 0.5f, - VAlign = 0.5f - }; - element.SetPadding(0.0f); - UIImage uiImage1 = new UIImage(texture); - uiImage1.ImageScale = 0.55f; - uiImage1.HAlign = 0.5f; - uiImage1.VAlign = 0.5f; - UIImage uiImage2 = uiImage1; - element.Append((UIElement) uiImage2); - this.Append(element); - } - else - { - UIItemIcon uiItemIcon = new UIItemIcon(this._infoDisplayItem, uiinfo.UnlockState < BestiaryEntryUnlockState.CanShowDropsWithoutDropRates_3); - uiItemIcon.IgnoresMouseInteraction = true; - uiItemIcon.HAlign = 0.0f; - uiItemIcon.Left = new StyleDimension(4f, 0.0f); - this.Append((UIElement) uiItemIcon); - if (!string.IsNullOrEmpty(stackRange)) - droprate = stackRange + " " + droprate; - UITextPanel uiTextPanel = new UITextPanel(droprate, textScale); - uiTextPanel.IgnoresMouseInteraction = true; - uiTextPanel.DrawPanel = false; - uiTextPanel.HAlign = 1f; - uiTextPanel.Top = new StyleDimension(-4f, 0.0f); - this.Append((UIElement) uiTextPanel); - } - } - - protected void GetDropInfo( - DropRateInfo dropRateInfo, - BestiaryUICollectionInfo uiinfo, - out string stackRange, - out string droprate) - { - stackRange = dropRateInfo.stackMin == dropRateInfo.stackMax ? (dropRateInfo.stackMin != 1 ? " (" + (object) dropRateInfo.stackMin + ")" : "") : string.Format(" ({0}-{1})", (object) dropRateInfo.stackMin, (object) dropRateInfo.stackMax); - string originalFormat = "P"; - if ((double) dropRateInfo.dropRate < 0.001) - originalFormat = "P4"; - droprate = (double) dropRateInfo.dropRate == 1.0 ? "100%" : Utils.PrettifyPercentDisplay(dropRateInfo.dropRate, originalFormat); - if (uiinfo.UnlockState == BestiaryEntryUnlockState.CanShowDropsWithDropRates_4) - return; - droprate = "???"; - stackRange = ""; - } - - protected override void DrawSelf(SpriteBatch spriteBatch) - { - base.DrawSelf(spriteBatch); - if (!this.IsMouseHovering || this._hideMouseOver) - return; - this.DrawMouseOver(); - } - - private void DrawMouseOver() - { - Main.HoverItem = this._infoDisplayItem; - Main.instance.MouseText(""); - Main.mouseText = true; - } - - public override int CompareTo(object obj) => obj is IManuallyOrderedUIElement orderedUiElement ? this.OrderInUIList.CompareTo(orderedUiElement.OrderInUIList) : base.CompareTo(obj); - - private void SetBestiaryNotesOnItemCache(DropRateInfo info) - { - List stringList = new List(); - if (info.conditions == null) - return; - foreach (IProvideItemConditionDescription condition in info.conditions) - { - if (condition != null) - { - string conditionDescription = condition.GetConditionDescription(); - if (!string.IsNullOrWhiteSpace(conditionDescription)) - stringList.Add(conditionDescription); - } - } - this._infoDisplayItem.BestiaryNotes = string.Join("\n", (IEnumerable) stringList); - } - - private void MouseOver(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(12); - this.BorderColor = Colors.FancyUIFatButtonMouseOver; - } - - private void MouseOut(UIMouseEvent evt, UIElement listeningElement) => this.BorderColor = new Color(89, 116, 213, (int) byte.MaxValue); - } -} diff --git a/GameContent/UI/Elements/UIBestiaryInfoLine`1.cs b/GameContent/UI/Elements/UIBestiaryInfoLine`1.cs deleted file mode 100644 index 7c999b8..0000000 --- a/GameContent/UI/Elements/UIBestiaryInfoLine`1.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UIBestiaryInfoLine`1 -// 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; -using Microsoft.Xna.Framework.Graphics; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UIBestiaryInfoLine : UIElement, IManuallyOrderedUIElement - { - private T _text; - private float _textScale = 1f; - private Vector2 _textSize = Vector2.Zero; - private Color _color = Color.White; - - public int OrderInUIList { get; set; } - - public float TextScale - { - get => this._textScale; - set => this._textScale = value; - } - - public Vector2 TextSize => this._textSize; - - public string Text => (object) this._text != null ? this._text.ToString() : ""; - - public Color TextColor - { - get => this._color; - set => this._color = value; - } - - public UIBestiaryInfoLine(T text, float textScale = 1f) => this.SetText(text, textScale); - - public override void Recalculate() - { - this.SetText(this._text, this._textScale); - base.Recalculate(); - } - - public void SetText(T text) => this.SetText(text, this._textScale); - - public virtual void SetText(T text, float textScale) - { - Vector2 vector2 = new Vector2(FontAssets.MouseText.Value.MeasureString(text.ToString()).X, 16f) * textScale; - this._text = text; - this._textScale = textScale; - this._textSize = vector2; - this.MinWidth.Set(vector2.X + this.PaddingLeft + this.PaddingRight, 0.0f); - this.MinHeight.Set(vector2.Y + this.PaddingTop + this.PaddingBottom, 0.0f); - } - - protected override void DrawSelf(SpriteBatch spriteBatch) - { - CalculatedStyle innerDimensions = this.GetInnerDimensions(); - Vector2 pos = innerDimensions.Position(); - pos.Y -= 2f * this._textScale; - pos.X += (float) (((double) innerDimensions.Width - (double) this._textSize.X) * 0.5); - Utils.DrawBorderString(spriteBatch, this.Text, pos, this._color, this._textScale); - } - - public override int CompareTo(object obj) => obj is IManuallyOrderedUIElement orderedUiElement ? this.OrderInUIList.CompareTo(orderedUiElement.OrderInUIList) : base.CompareTo(obj); - } -} diff --git a/GameContent/UI/Elements/UIBestiaryNPCEntryPortrait.cs b/GameContent/UI/Elements/UIBestiaryNPCEntryPortrait.cs deleted file mode 100644 index 03136ef..0000000 --- a/GameContent/UI/Elements/UIBestiaryNPCEntryPortrait.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UIBestiaryNPCEntryPortrait -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using System.Collections.Generic; -using Terraria.GameContent.Bestiary; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UIBestiaryNPCEntryPortrait : UIElement - { - public BestiaryEntry Entry { get; private set; } - - public UIBestiaryNPCEntryPortrait( - BestiaryEntry entry, - Asset portraitBackgroundAsset, - Color portraitColor, - List overlays) - { - this.Entry = entry; - this.Height.Set(112f, 0.0f); - this.Width.Set(193f, 0.0f); - this.SetPadding(0.0f); - UIElement element = new UIElement() - { - Width = new StyleDimension(-4f, 1f), - Height = new StyleDimension(-4f, 1f), - IgnoresMouseInteraction = true, - OverflowHidden = true, - HAlign = 0.5f, - VAlign = 0.5f - }; - element.SetPadding(0.0f); - if (portraitBackgroundAsset != null) - { - UIElement uiElement = element; - UIImage uiImage = new UIImage(portraitBackgroundAsset); - uiImage.HAlign = 0.5f; - uiImage.VAlign = 0.5f; - uiImage.ScaleToFit = true; - uiImage.Width = new StyleDimension(0.0f, 1f); - uiImage.Height = new StyleDimension(0.0f, 1f); - uiImage.Color = portraitColor; - uiElement.Append((UIElement) uiImage); - } - for (int index = 0; index < overlays.Count; ++index) - { - Asset backgroundOverlayImage = overlays[index].GetBackgroundOverlayImage(); - Color? backgroundOverlayColor = overlays[index].GetBackgroundOverlayColor(); - UIElement uiElement = element; - UIImage uiImage = new UIImage(backgroundOverlayImage); - uiImage.HAlign = 0.5f; - uiImage.VAlign = 0.5f; - uiImage.ScaleToFit = true; - uiImage.Width = new StyleDimension(0.0f, 1f); - uiImage.Height = new StyleDimension(0.0f, 1f); - uiImage.Color = backgroundOverlayColor.HasValue ? backgroundOverlayColor.Value : Color.Lerp(Color.White, portraitColor, 0.5f); - uiElement.Append((UIElement) uiImage); - } - UIBestiaryEntryIcon bestiaryEntryIcon = new UIBestiaryEntryIcon(entry, true); - element.Append((UIElement) bestiaryEntryIcon); - this.Append(element); - UIImage uiImage1 = new UIImage(Main.Assets.Request("Images/UI/Bestiary/Portrait_Front", (AssetRequestMode) 1)); - uiImage1.VAlign = 0.5f; - uiImage1.HAlign = 0.5f; - uiImage1.IgnoresMouseInteraction = true; - this.Append((UIElement) uiImage1); - } - } -} diff --git a/GameContent/UI/Elements/UIBestiarySortingOptionsGrid.cs b/GameContent/UI/Elements/UIBestiarySortingOptionsGrid.cs deleted file mode 100644 index 096af7e..0000000 --- a/GameContent/UI/Elements/UIBestiarySortingOptionsGrid.cs +++ /dev/null @@ -1,118 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UIBestiarySortingOptionsGrid -// 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; -using System; -using System.Collections.Generic; -using Terraria.DataStructures; -using Terraria.GameContent.Bestiary; -using Terraria.ID; -using Terraria.Localization; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UIBestiarySortingOptionsGrid : UIPanel - { - private EntrySorter _sorter; - private List> _buttonsBySorting; - private int _currentSelected = -1; - private int _defaultStepIndex; - - public event Action OnClickingOption; - - public UIBestiarySortingOptionsGrid( - EntrySorter sorter) - { - this._sorter = sorter; - this._buttonsBySorting = new List>(); - this.Width = new StyleDimension(0.0f, 1f); - this.Height = new StyleDimension(0.0f, 1f); - this.BackgroundColor = new Color(35, 40, 83) * 0.5f; - this.BorderColor = new Color(35, 40, 83) * 0.5f; - this.IgnoresMouseInteraction = false; - this.SetPadding(0.0f); - this.BuildGrid(); - } - - private void BuildGrid() - { - int num1 = 2; - int num2 = 26 + num1; - int num3 = 0; - for (int index = 0; index < this._sorter.Steps.Count; ++index) - { - if (!this._sorter.Steps[index].HiddenFromSortOptions) - ++num3; - } - UIPanel uiPanel1 = new UIPanel(); - uiPanel1.Width = new StyleDimension(126f, 0.0f); - uiPanel1.Height = new StyleDimension((float) (num3 * num2 + 5 + 3), 0.0f); - uiPanel1.HAlign = 1f; - uiPanel1.VAlign = 0.0f; - uiPanel1.Left = new StyleDimension(-118f, 0.0f); - uiPanel1.Top = new StyleDimension(0.0f, 0.0f); - UIPanel uiPanel2 = uiPanel1; - uiPanel2.BorderColor = new Color(89, 116, 213, (int) byte.MaxValue) * 0.9f; - uiPanel2.BackgroundColor = new Color(73, 94, 171) * 0.9f; - uiPanel2.SetPadding(0.0f); - this.Append((UIElement) uiPanel2); - int id = 0; - for (int index = 0; index < this._sorter.Steps.Count; ++index) - { - IBestiarySortStep step = this._sorter.Steps[index]; - if (!step.HiddenFromSortOptions) - { - GroupOptionButton groupOptionButton1 = new GroupOptionButton(index, Language.GetText(step.GetDisplayNameKey()), (LocalizedText) null, Color.White, (string) null, 0.8f); - groupOptionButton1.Width = new StyleDimension(114f, 0.0f); - groupOptionButton1.Height = new StyleDimension((float) (num2 - num1), 0.0f); - groupOptionButton1.HAlign = 0.5f; - groupOptionButton1.Top = new StyleDimension((float) (5 + num2 * id), 0.0f); - GroupOptionButton groupOptionButton2 = groupOptionButton1; - groupOptionButton2.ShowHighlightWhenSelected = false; - groupOptionButton2.OnClick += new UIElement.MouseEvent(this.ClickOption); - groupOptionButton2.SetSnapPoint("SortSteps", id); - uiPanel2.Append((UIElement) groupOptionButton2); - this._buttonsBySorting.Add(groupOptionButton2); - ++id; - } - } - foreach (GroupOptionButton groupOptionButton in this._buttonsBySorting) - groupOptionButton.SetCurrentOption(-1); - } - - private void ClickOption(UIMouseEvent evt, UIElement listeningElement) - { - int index = ((GroupOptionButton) listeningElement).OptionValue; - if (index == this._currentSelected) - index = this._defaultStepIndex; - foreach (GroupOptionButton groupOptionButton in this._buttonsBySorting) - { - bool flag = index == groupOptionButton.OptionValue; - groupOptionButton.SetCurrentOption(flag ? index : -1); - if (flag) - groupOptionButton.SetColor(new Color(152, 175, 235), 1f); - else - groupOptionButton.SetColor(Colors.InventoryDefaultColor, 0.7f); - } - this._currentSelected = index; - this._sorter.SetPrioritizedStepIndex(index); - if (this.OnClickingOption == null) - return; - this.OnClickingOption(); - } - - public void GetEntriesToShow( - out int maxEntriesWidth, - out int maxEntriesHeight, - out int maxEntriesToHave) - { - maxEntriesWidth = 1; - maxEntriesHeight = this._buttonsBySorting.Count; - maxEntriesToHave = this._buttonsBySorting.Count; - } - } -} diff --git a/GameContent/UI/Elements/UICharacter.cs b/GameContent/UI/Elements/UICharacter.cs index fac9e25..2eef6ee 100644 --- a/GameContent/UI/Elements/UICharacter.cs +++ b/GameContent/UI/Elements/UICharacter.cs @@ -1,12 +1,12 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.Elements.UICharacter -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; +using Terraria.Graphics; using Terraria.UI; namespace Terraria.GameContent.UI.Elements @@ -14,66 +14,27 @@ namespace Terraria.GameContent.UI.Elements public class UICharacter : UIElement { private Player _player; - private Asset _texture; + private Texture2D _texture; private static Item _blankItem = new Item(); - private bool _animated; - private bool _drawsBackPanel; - private float _characterScale = 1f; - private int _animationCounter; - public UICharacter(Player player, bool animated = false, bool hasBackPanel = true, float characterScale = 1f) + public UICharacter(Player player) { this._player = player; this.Width.Set(59f, 0.0f); this.Height.Set(58f, 0.0f); - this._texture = Main.Assets.Request("Images/UI/PlayerBackground", (AssetRequestMode) 1); - this.UseImmediateMode = true; - this._animated = animated; - this._drawsBackPanel = hasBackPanel; - this._characterScale = characterScale; - this.OverrideSamplerState = SamplerState.PointClamp; - } - - public override void Update(GameTime gameTime) - { - this._player.ResetEffects(); - this._player.ResetVisibleAccessories(); - this._player.UpdateMiscCounter(); - this._player.UpdateDyes(); - this._player.PlayerFrame(); - if (this._animated) - ++this._animationCounter; - base.Update(gameTime); - } - - private void UpdateAnim() - { - if (!this._animated) - { - this._player.bodyFrame.Y = this._player.legFrame.Y = this._player.headFrame.Y = 0; - } - else - { - this._player.bodyFrame.Y = this._player.legFrame.Y = this._player.headFrame.Y = ((int) ((double) Main.GlobalTimeWrappedHourly / 0.0700000002980232) % 14 + 6) * 56; - this._player.WingFrame(false); - } + this._texture = TextureManager.Load("Images/UI/PlayerBackground"); + this._useImmediateMode = true; } protected override void DrawSelf(SpriteBatch spriteBatch) { CalculatedStyle dimensions = this.GetDimensions(); - if (this._drawsBackPanel) - spriteBatch.Draw(this._texture.Value, dimensions.Position(), Color.White); - this.UpdateAnim(); + spriteBatch.Draw(this._texture, dimensions.Position(), Color.White); Vector2 vector2 = dimensions.Position() + new Vector2(dimensions.Width * 0.5f - (float) (this._player.width >> 1), dimensions.Height * 0.5f - (float) (this._player.height >> 1)); Item obj = this._player.inventory[this._player.selectedItem]; this._player.inventory[this._player.selectedItem] = UICharacter._blankItem; - Main.PlayerRenderer.DrawPlayer(Main.Camera, this._player, vector2 + Main.screenPosition, 0.0f, Vector2.Zero, scale: this._characterScale); + Main.instance.DrawPlayer(this._player, vector2 + Main.screenPosition, 0.0f, Vector2.Zero); this._player.inventory[this._player.selectedItem] = obj; } - - public void SetAnimated(bool animated) => this._animated = animated; - - public bool IsAnimated => this._animated; } } diff --git a/GameContent/UI/Elements/UICharacterListItem.cs b/GameContent/UI/Elements/UICharacterListItem.cs index 4c4f99e..4709642 100644 --- a/GameContent/UI/Elements/UICharacterListItem.cs +++ b/GameContent/UI/Elements/UICharacterListItem.cs @@ -1,14 +1,13 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.Elements.UICharacterListItem -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using System; -using Terraria.Audio; +using Terraria.Graphics; using Terraria.IO; using Terraria.Localization; using Terraria.Social; @@ -19,17 +18,17 @@ namespace Terraria.GameContent.UI.Elements public class UICharacterListItem : UIPanel { private PlayerFileData _data; - private Asset _dividerTexture; - private Asset _innerPanelTexture; + private Texture2D _dividerTexture; + private Texture2D _innerPanelTexture; private UICharacter _playerPanel; private UIText _buttonLabel; private UIText _deleteButtonLabel; - private Asset _buttonCloudActiveTexture; - private Asset _buttonCloudInactiveTexture; - private Asset _buttonFavoriteActiveTexture; - private Asset _buttonFavoriteInactiveTexture; - private Asset _buttonPlayTexture; - private Asset _buttonDeleteTexture; + private Texture2D _buttonCloudActiveTexture; + private Texture2D _buttonCloudInactiveTexture; + private Texture2D _buttonFavoriteActiveTexture; + private Texture2D _buttonFavoriteInactiveTexture; + private Texture2D _buttonPlayTexture; + private Texture2D _buttonDeleteTexture; private UIImageButton _deleteButton; public bool IsFavorite => this._data.IsFavorite; @@ -37,14 +36,14 @@ namespace Terraria.GameContent.UI.Elements public UICharacterListItem(PlayerFileData data, int snapPointIndex) { this.BorderColor = new Color(89, 116, 213) * 0.7f; - this._dividerTexture = Main.Assets.Request("Images/UI/Divider", (AssetRequestMode) 1); - this._innerPanelTexture = Main.Assets.Request("Images/UI/InnerPanelBackground", (AssetRequestMode) 1); - this._buttonCloudActiveTexture = Main.Assets.Request("Images/UI/ButtonCloudActive", (AssetRequestMode) 1); - this._buttonCloudInactiveTexture = Main.Assets.Request("Images/UI/ButtonCloudInactive", (AssetRequestMode) 1); - this._buttonFavoriteActiveTexture = Main.Assets.Request("Images/UI/ButtonFavoriteActive", (AssetRequestMode) 1); - this._buttonFavoriteInactiveTexture = Main.Assets.Request("Images/UI/ButtonFavoriteInactive", (AssetRequestMode) 1); - this._buttonPlayTexture = Main.Assets.Request("Images/UI/ButtonPlay", (AssetRequestMode) 1); - this._buttonDeleteTexture = Main.Assets.Request("Images/UI/ButtonDelete", (AssetRequestMode) 1); + this._dividerTexture = TextureManager.Load("Images/UI/Divider"); + this._innerPanelTexture = TextureManager.Load("Images/UI/InnerPanelBackground"); + this._buttonCloudActiveTexture = TextureManager.Load("Images/UI/ButtonCloudActive"); + this._buttonCloudInactiveTexture = TextureManager.Load("Images/UI/ButtonCloudInactive"); + this._buttonFavoriteActiveTexture = TextureManager.Load("Images/UI/ButtonFavoriteActive"); + this._buttonFavoriteInactiveTexture = TextureManager.Load("Images/UI/ButtonFavoriteInactive"); + this._buttonPlayTexture = TextureManager.Load("Images/UI/ButtonPlay"); + this._buttonDeleteTexture = TextureManager.Load("Images/UI/ButtonDelete"); this.Height.Set(96f, 0.0f); this.Width.Set(0.0f, 1f); this.SetPadding(6f); @@ -83,12 +82,12 @@ namespace Terraria.GameContent.UI.Elements UIImageButton uiImageButton4 = new UIImageButton(this._buttonDeleteTexture); uiImageButton4.VAlign = 1f; uiImageButton4.HAlign = 1f; - if (!this._data.IsFavorite) - uiImageButton4.OnClick += new UIElement.MouseEvent(this.DeleteButtonClick); + uiImageButton4.OnClick += new UIElement.MouseEvent(this.DeleteButtonClick); uiImageButton4.OnMouseOver += new UIElement.MouseEvent(this.DeleteMouseOver); uiImageButton4.OnMouseOut += new UIElement.MouseEvent(this.DeleteMouseOut); this._deleteButton = uiImageButton4; - this.Append((UIElement) uiImageButton4); + if (!this._data.IsFavorite) + this.Append((UIElement) uiImageButton4); this._buttonLabel = new UIText(""); this._buttonLabel.VAlign = 1f; this._buttonLabel.Left.Set(80f, 0.0f); @@ -123,13 +122,7 @@ namespace Terraria.GameContent.UI.Elements private void PlayMouseOver(UIMouseEvent evt, UIElement listeningElement) => this._buttonLabel.SetText(Language.GetTextValue("UI.Play")); - private void DeleteMouseOver(UIMouseEvent evt, UIElement listeningElement) - { - if (this._data.IsFavorite) - this._deleteButtonLabel.SetText(Language.GetTextValue("UI.CannotDeleteFavorited")); - else - this._deleteButtonLabel.SetText(Language.GetTextValue("UI.Delete")); - } + private void DeleteMouseOver(UIMouseEvent evt, UIElement listeningElement) => this._deleteButtonLabel.SetText(Language.GetTextValue("UI.Delete")); private void DeleteMouseOut(UIMouseEvent evt, UIElement listeningElement) => this._deleteButtonLabel.SetText(""); @@ -154,7 +147,7 @@ namespace Terraria.GameContent.UI.Elements { if (Main.PlayerList[index] == this._data) { - SoundEngine.PlaySound(10); + Main.PlaySound(10); Main.selectedPlayer = index; Main.menuMode = 5; break; @@ -177,12 +170,12 @@ namespace Terraria.GameContent.UI.Elements if (this._data.IsFavorite) { this._buttonLabel.SetText(Language.GetTextValue("UI.Unfavorite")); - this._deleteButton.OnClick -= new UIElement.MouseEvent(this.DeleteButtonClick); + this.RemoveChild((UIElement) this._deleteButton); } else { this._buttonLabel.SetText(Language.GetTextValue("UI.Favorite")); - this._deleteButton.OnClick += new UIElement.MouseEvent(this.DeleteButtonClick); + this.Append((UIElement) this._deleteButton); } if (!(this.Parent.Parent is UIList parent)) return; @@ -205,7 +198,6 @@ namespace Terraria.GameContent.UI.Elements base.MouseOver(evt); this.BackgroundColor = new Color(73, 94, 171); this.BorderColor = new Color(89, 116, 213); - this._playerPanel.SetAnimated(true); } public override void MouseOut(UIMouseEvent evt) @@ -213,14 +205,13 @@ namespace Terraria.GameContent.UI.Elements base.MouseOut(evt); this.BackgroundColor = new Color(63, 82, 151) * 0.7f; this.BorderColor = new Color(89, 116, 213) * 0.7f; - this._playerPanel.SetAnimated(false); } private void DrawPanel(SpriteBatch spriteBatch, Vector2 position, float width) { - spriteBatch.Draw(this._innerPanelTexture.Value, position, new Rectangle?(new Rectangle(0, 0, 8, this._innerPanelTexture.Height())), Color.White); - spriteBatch.Draw(this._innerPanelTexture.Value, new Vector2(position.X + 8f, position.Y), new Rectangle?(new Rectangle(8, 0, 8, this._innerPanelTexture.Height())), Color.White, 0.0f, Vector2.Zero, new Vector2((float) (((double) width - 16.0) / 8.0), 1f), SpriteEffects.None, 0.0f); - spriteBatch.Draw(this._innerPanelTexture.Value, new Vector2((float) ((double) position.X + (double) width - 8.0), position.Y), new Rectangle?(new Rectangle(16, 0, 8, this._innerPanelTexture.Height())), Color.White); + spriteBatch.Draw(this._innerPanelTexture, position, new Rectangle?(new Rectangle(0, 0, 8, this._innerPanelTexture.Height)), Color.White); + spriteBatch.Draw(this._innerPanelTexture, new Vector2(position.X + 8f, position.Y), new Rectangle?(new Rectangle(8, 0, 8, this._innerPanelTexture.Height)), Color.White, 0.0f, Vector2.Zero, new Vector2((float) (((double) width - 16.0) / 8.0), 1f), SpriteEffects.None, 0.0f); + spriteBatch.Draw(this._innerPanelTexture, new Vector2((float) ((double) position.X + (double) width - 8.0), position.Y), new Rectangle?(new Rectangle(16, 0, 8, this._innerPanelTexture.Height)), Color.White); } protected override void DrawSelf(SpriteBatch spriteBatch) @@ -230,22 +221,22 @@ namespace Terraria.GameContent.UI.Elements CalculatedStyle dimensions = this._playerPanel.GetDimensions(); float x = dimensions.X + dimensions.Width; Utils.DrawBorderString(spriteBatch, this._data.Name, new Vector2(x + 6f, dimensions.Y - 2f), Color.White); - spriteBatch.Draw(this._dividerTexture.Value, new Vector2(x, innerDimensions.Y + 21f), new Rectangle?(), Color.White, 0.0f, Vector2.Zero, new Vector2((float) (((double) this.GetDimensions().X + (double) this.GetDimensions().Width - (double) x) / 8.0), 1f), SpriteEffects.None, 0.0f); + spriteBatch.Draw(this._dividerTexture, new Vector2(x, innerDimensions.Y + 21f), new Rectangle?(), Color.White, 0.0f, Vector2.Zero, new Vector2((float) (((double) this.GetDimensions().X + (double) this.GetDimensions().Width - (double) x) / 8.0), 1f), SpriteEffects.None, 0.0f); Vector2 vector2 = new Vector2(x + 6f, innerDimensions.Y + 29f); float width1 = 200f; Vector2 position1 = vector2; this.DrawPanel(spriteBatch, position1, width1); - spriteBatch.Draw(TextureAssets.Heart.Value, position1 + new Vector2(5f, 2f), Color.White); - position1.X += 10f + (float) TextureAssets.Heart.Width(); - Utils.DrawBorderString(spriteBatch, this._data.Player.statLifeMax.ToString() + Language.GetTextValue("GameUI.PlayerLifeMax"), position1 + new Vector2(0.0f, 3f), Color.White); + spriteBatch.Draw(Main.heartTexture, position1 + new Vector2(5f, 2f), Color.White); + position1.X += 10f + (float) Main.heartTexture.Width; + Utils.DrawBorderString(spriteBatch, this._data.Player.statLifeMax.ToString() + " HP", position1 + new Vector2(0.0f, 3f), Color.White); position1.X += 65f; - spriteBatch.Draw(TextureAssets.Mana.Value, position1 + new Vector2(5f, 2f), Color.White); - position1.X += 10f + (float) TextureAssets.Mana.Width(); - Utils.DrawBorderString(spriteBatch, this._data.Player.statManaMax.ToString() + Language.GetTextValue("GameUI.PlayerManaMax"), position1 + new Vector2(0.0f, 3f), Color.White); + spriteBatch.Draw(Main.manaTexture, position1 + new Vector2(5f, 2f), Color.White); + position1.X += 10f + (float) Main.manaTexture.Width; + Utils.DrawBorderString(spriteBatch, this._data.Player.statManaMax.ToString() + " MP", position1 + new Vector2(0.0f, 3f), Color.White); vector2.X += width1 + 5f; Vector2 position2 = vector2; float width2 = 140f; - if (GameCulture.FromCultureName(GameCulture.CultureName.Russian).IsActive) + if (GameCulture.Russian.IsActive) width2 = 180f; this.DrawPanel(spriteBatch, position2, width2); string text1 = ""; @@ -263,12 +254,8 @@ namespace Terraria.GameContent.UI.Elements text1 = Language.GetTextValue("UI.Hardcore"); color = Main.hcColor; break; - case 3: - text1 = Language.GetTextValue("UI.Creative"); - color = Main.creativeModeColor; - break; } - Vector2 pos1 = position2 + new Vector2((float) ((double) width2 * 0.5 - (double) FontAssets.MouseText.Value.MeasureString(text1).X * 0.5), 3f); + Vector2 pos1 = position2 + new Vector2((float) ((double) width2 * 0.5 - (double) Main.fontMouseText.MeasureString(text1).X * 0.5), 3f); Utils.DrawBorderString(spriteBatch, text1, pos1, color); vector2.X += width2 + 5f; Vector2 position3 = vector2; @@ -277,7 +264,7 @@ namespace Terraria.GameContent.UI.Elements TimeSpan playTime = this._data.GetPlayTime(); int num = playTime.Days * 24 + playTime.Hours; string text2 = (num < 10 ? (object) "0" : (object) "").ToString() + (object) num + playTime.ToString("\\:mm\\:ss"); - Vector2 pos2 = position3 + new Vector2((float) ((double) width3 * 0.5 - (double) FontAssets.MouseText.Value.MeasureString(text2).X * 0.5), 3f); + Vector2 pos2 = position3 + new Vector2((float) ((double) width3 * 0.5 - (double) Main.fontMouseText.MeasureString(text2).X * 0.5), 3f); Utils.DrawBorderString(spriteBatch, text2, pos2, Color.White); } } diff --git a/GameContent/UI/Elements/UICharacterNameButton.cs b/GameContent/UI/Elements/UICharacterNameButton.cs deleted file mode 100644 index 1f9e3a1..0000000 --- a/GameContent/UI/Elements/UICharacterNameButton.cs +++ /dev/null @@ -1,132 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UICharacterNameButton -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria.Audio; -using Terraria.Localization; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UICharacterNameButton : UIElement - { - private readonly Asset _BasePanelTexture; - private readonly Asset _selectedBorderTexture; - private readonly Asset _hoveredBorderTexture; - private bool _hovered; - private bool _soundedHover; - private readonly LocalizedText _textToShowWhenEmpty; - private string actualContents; - private UIText _text; - private UIText _title; - public readonly LocalizedText Description; - public float DistanceFromTitleToOption = 20f; - - public UICharacterNameButton( - LocalizedText titleText, - LocalizedText emptyContentText, - LocalizedText description = null) - { - this.Width = StyleDimension.FromPixels(400f); - this.Height = StyleDimension.FromPixels(40f); - this.Description = description; - this._BasePanelTexture = Main.Assets.Request("Images/UI/CharCreation/CategoryPanel", (AssetRequestMode) 1); - this._selectedBorderTexture = Main.Assets.Request("Images/UI/CharCreation/CategoryPanelHighlight", (AssetRequestMode) 1); - this._hoveredBorderTexture = Main.Assets.Request("Images/UI/CharCreation/CategoryPanelBorder", (AssetRequestMode) 1); - this._textToShowWhenEmpty = emptyContentText; - float textScale = 1f; - UIText uiText1 = new UIText(titleText, textScale); - uiText1.HAlign = 0.0f; - uiText1.VAlign = 0.5f; - uiText1.Left = StyleDimension.FromPixels(10f); - UIText uiText2 = uiText1; - this.Append((UIElement) uiText2); - this._title = uiText2; - UIText uiText3 = new UIText(Language.GetText("UI.PlayerNameSlot"), textScale); - uiText3.HAlign = 0.0f; - uiText3.VAlign = 0.5f; - uiText3.Left = StyleDimension.FromPixels(150f); - UIText uiText4 = uiText3; - this.Append((UIElement) uiText4); - this._text = uiText4; - this.SetContents((string) null); - } - - protected override void DrawSelf(SpriteBatch spriteBatch) - { - if (this._hovered) - { - if (!this._soundedHover) - SoundEngine.PlaySound(12); - this._soundedHover = true; - } - else - this._soundedHover = false; - CalculatedStyle dimensions = this.GetDimensions(); - Utils.DrawSplicedPanel(spriteBatch, this._BasePanelTexture.Value, (int) dimensions.X, (int) dimensions.Y, (int) dimensions.Width, (int) dimensions.Height, 10, 10, 10, 10, Color.White * 0.5f); - if (!this._hovered) - return; - Utils.DrawSplicedPanel(spriteBatch, this._hoveredBorderTexture.Value, (int) dimensions.X, (int) dimensions.Y, (int) dimensions.Width, (int) dimensions.Height, 10, 10, 10, 10, Color.White); - } - - public void SetContents(string name) - { - this.actualContents = name; - if (string.IsNullOrEmpty(this.actualContents)) - { - this._text.TextColor = Color.Gray; - this._text.SetText(this._textToShowWhenEmpty); - } - else - { - this._text.TextColor = Color.White; - this._text.SetText(this.actualContents); - } - this._text.Left = StyleDimension.FromPixels(this._title.GetInnerDimensions().Width + this.DistanceFromTitleToOption); - } - - public void TrimDisplayIfOverElementDimensions(int padding) - { - CalculatedStyle dimensions1 = this.GetDimensions(); - Point point1 = new Point((int) dimensions1.X, (int) dimensions1.Y); - Point point2 = new Point(point1.X + (int) dimensions1.Width, point1.Y + (int) dimensions1.Height); - Rectangle rectangle1 = new Rectangle(point1.X, point1.Y, point2.X - point1.X, point2.Y - point1.Y); - CalculatedStyle dimensions2 = this._text.GetDimensions(); - Point point3 = new Point((int) dimensions2.X, (int) dimensions2.Y); - Point point4 = new Point(point3.X + (int) dimensions2.Width, point3.Y + (int) dimensions2.Height); - Rectangle rectangle2 = new Rectangle(point3.X, point3.Y, point4.X - point3.X, point4.Y - point3.Y); - int num = 0; - for (; rectangle2.Right > rectangle1.Right - padding; rectangle2 = new Rectangle(point3.X, point3.Y, point4.X - point3.X, point4.Y - point3.Y)) - { - this._text.SetText(this._text.Text.Substring(0, this._text.Text.Length - 1)); - ++num; - this.RecalculateChildren(); - CalculatedStyle dimensions3 = this._text.GetDimensions(); - point3 = new Point((int) dimensions3.X, (int) dimensions3.Y); - point4 = new Point(point3.X + (int) dimensions3.Width, point3.Y + (int) dimensions3.Height); - } - if (num <= 0) - return; - this._text.SetText(this._text.Text.Substring(0, this._text.Text.Length - 1) + "…"); - } - - public override void MouseDown(UIMouseEvent evt) => base.MouseDown(evt); - - public override void MouseOver(UIMouseEvent evt) - { - base.MouseOver(evt); - this._hovered = true; - } - - public override void MouseOut(UIMouseEvent evt) - { - base.MouseOut(evt); - this._hovered = false; - } - } -} diff --git a/GameContent/UI/Elements/UIClothStyleButton.cs b/GameContent/UI/Elements/UIClothStyleButton.cs deleted file mode 100644 index 43ed383..0000000 --- a/GameContent/UI/Elements/UIClothStyleButton.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UIClothStyleButton -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria.Audio; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UIClothStyleButton : UIElement - { - private readonly Player _player; - public readonly int ClothStyleId; - private readonly Asset _BasePanelTexture; - private readonly Asset _selectedBorderTexture; - private readonly Asset _hoveredBorderTexture; - private readonly UICharacter _char; - private bool _hovered; - private bool _soundedHover; - private int _realSkinVariant; - - public UIClothStyleButton(Player player, int clothStyleId) - { - this._player = player; - this.ClothStyleId = clothStyleId; - this.Width = StyleDimension.FromPixels(44f); - this.Height = StyleDimension.FromPixels(80f); - this._BasePanelTexture = Main.Assets.Request("Images/UI/CharCreation/CategoryPanel", (AssetRequestMode) 1); - this._selectedBorderTexture = Main.Assets.Request("Images/UI/CharCreation/CategoryPanelHighlight", (AssetRequestMode) 1); - this._hoveredBorderTexture = Main.Assets.Request("Images/UI/CharCreation/CategoryPanelBorder", (AssetRequestMode) 1); - UICharacter uiCharacter = new UICharacter(this._player, hasBackPanel: false); - uiCharacter.HAlign = 0.5f; - uiCharacter.VAlign = 0.5f; - this._char = uiCharacter; - this.Append((UIElement) this._char); - } - - public override void Draw(SpriteBatch spriteBatch) - { - this._realSkinVariant = this._player.skinVariant; - this._player.skinVariant = this.ClothStyleId; - base.Draw(spriteBatch); - this._player.skinVariant = this._realSkinVariant; - } - - protected override void DrawSelf(SpriteBatch spriteBatch) - { - if (this._hovered) - { - if (!this._soundedHover) - SoundEngine.PlaySound(12); - this._soundedHover = true; - } - else - this._soundedHover = false; - CalculatedStyle dimensions = this.GetDimensions(); - Utils.DrawSplicedPanel(spriteBatch, this._BasePanelTexture.Value, (int) dimensions.X, (int) dimensions.Y, (int) dimensions.Width, (int) dimensions.Height, 10, 10, 10, 10, Color.White * 0.5f); - if (this._realSkinVariant == this.ClothStyleId) - Utils.DrawSplicedPanel(spriteBatch, this._selectedBorderTexture.Value, (int) dimensions.X + 3, (int) dimensions.Y + 3, (int) dimensions.Width - 6, (int) dimensions.Height - 6, 10, 10, 10, 10, Color.White); - if (!this._hovered) - return; - Utils.DrawSplicedPanel(spriteBatch, this._hoveredBorderTexture.Value, (int) dimensions.X, (int) dimensions.Y, (int) dimensions.Width, (int) dimensions.Height, 10, 10, 10, 10, Color.White); - } - - public override void MouseDown(UIMouseEvent evt) - { - this._player.skinVariant = this.ClothStyleId; - SoundEngine.PlaySound(12); - base.MouseDown(evt); - } - - public override void MouseOver(UIMouseEvent evt) - { - base.MouseOver(evt); - this._hovered = true; - this._char.SetAnimated(true); - } - - public override void MouseOut(UIMouseEvent evt) - { - base.MouseOut(evt); - this._hovered = false; - this._char.SetAnimated(false); - } - } -} diff --git a/GameContent/UI/Elements/UIColoredImageButton.cs b/GameContent/UI/Elements/UIColoredImageButton.cs deleted file mode 100644 index c9f09f7..0000000 --- a/GameContent/UI/Elements/UIColoredImageButton.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UIColoredImageButton -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria.Audio; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UIColoredImageButton : UIElement - { - private Asset _backPanelTexture; - private Asset _texture; - private Asset _middleTexture; - private Asset _backPanelHighlightTexture; - private Asset _backPanelBorderTexture; - private Color _color; - private float _visibilityActive = 1f; - private float _visibilityInactive = 0.4f; - private bool _selected; - private bool _hovered; - - public UIColoredImageButton(Asset texture, bool isSmall = false) - { - this._color = Color.White; - this._texture = texture; - this._backPanelTexture = !isSmall ? Main.Assets.Request("Images/UI/CharCreation/CategoryPanel", (AssetRequestMode) 1) : Main.Assets.Request("Images/UI/CharCreation/SmallPanel", (AssetRequestMode) 1); - this.Width.Set((float) this._backPanelTexture.Width(), 0.0f); - this.Height.Set((float) this._backPanelTexture.Height(), 0.0f); - this._backPanelHighlightTexture = Main.Assets.Request("Images/UI/CharCreation/CategoryPanelHighlight", (AssetRequestMode) 1); - if (isSmall) - this._backPanelBorderTexture = Main.Assets.Request("Images/UI/CharCreation/SmallPanelBorder", (AssetRequestMode) 1); - else - this._backPanelBorderTexture = Main.Assets.Request("Images/UI/CharCreation/CategoryPanelBorder", (AssetRequestMode) 1); - } - - public void SetImage(Asset texture) - { - this._texture = texture; - this.Width.Set((float) this._texture.Width(), 0.0f); - this.Height.Set((float) this._texture.Height(), 0.0f); - } - - protected override void DrawSelf(SpriteBatch spriteBatch) - { - CalculatedStyle dimensions = this.GetDimensions(); - Vector2 position = dimensions.Position() + new Vector2(dimensions.Width, dimensions.Height) / 2f; - spriteBatch.Draw(this._backPanelTexture.Value, position, new Rectangle?(), Color.White * (this.IsMouseHovering ? this._visibilityActive : this._visibilityInactive), 0.0f, this._backPanelTexture.Size() / 2f, 1f, SpriteEffects.None, 0.0f); - Color white = Color.White; - if (this._hovered) - spriteBatch.Draw(this._backPanelBorderTexture.Value, position, new Rectangle?(), Color.White, 0.0f, this._backPanelBorderTexture.Size() / 2f, 1f, SpriteEffects.None, 0.0f); - if (this._selected) - spriteBatch.Draw(this._backPanelHighlightTexture.Value, position, new Rectangle?(), Color.White, 0.0f, this._backPanelHighlightTexture.Size() / 2f, 1f, SpriteEffects.None, 0.0f); - if (this._middleTexture != null) - spriteBatch.Draw(this._middleTexture.Value, position, new Rectangle?(), Color.White, 0.0f, this._middleTexture.Size() / 2f, 1f, SpriteEffects.None, 0.0f); - spriteBatch.Draw(this._texture.Value, position, new Rectangle?(), this._color, 0.0f, this._texture.Size() / 2f, 1f, SpriteEffects.None, 0.0f); - } - - public override void MouseOver(UIMouseEvent evt) - { - base.MouseOver(evt); - SoundEngine.PlaySound(12); - this._hovered = true; - } - - public void SetVisibility(float whenActive, float whenInactive) - { - this._visibilityActive = MathHelper.Clamp(whenActive, 0.0f, 1f); - this._visibilityInactive = MathHelper.Clamp(whenInactive, 0.0f, 1f); - } - - public void SetColor(Color color) => this._color = color; - - public void SetMiddleTexture(Asset texAsset) => this._middleTexture = texAsset; - - public void SetSelected(bool selected) => this._selected = selected; - - public override void MouseOut(UIMouseEvent evt) - { - base.MouseOut(evt); - this._hovered = false; - } - } -} diff --git a/GameContent/UI/Elements/UIColoredSlider.cs b/GameContent/UI/Elements/UIColoredSlider.cs deleted file mode 100644 index 51b0e52..0000000 --- a/GameContent/UI/Elements/UIColoredSlider.cs +++ /dev/null @@ -1,150 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UIColoredSlider -// 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; -using Microsoft.Xna.Framework.Graphics; -using System; -using Terraria.Audio; -using Terraria.GameInput; -using Terraria.Localization; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UIColoredSlider : UISliderBase - { - private Color _color; - private LocalizedText _textKey; - private Func _getStatusTextAct; - private Action _slideKeyboardAction; - private Func _blipFunc; - private Action _slideGamepadAction; - private const bool BOTHER_WITH_TEXT = false; - private bool _isReallyMouseOvered; - private bool _alreadyHovered; - private bool _soundedUsage; - - public UIColoredSlider( - LocalizedText textKey, - Func getStatus, - Action setStatusKeyboard, - Action setStatusGamepad, - Func blipColorFunction, - Color color) - { - this._color = color; - this._textKey = textKey; - this._getStatusTextAct = getStatus != null ? getStatus : (Func) (() => 0.0f); - this._slideKeyboardAction = setStatusKeyboard != null ? setStatusKeyboard : (Action) (s => { }); - this._blipFunc = blipColorFunction != null ? blipColorFunction : (Func) (s => Color.Lerp(Color.Black, Color.White, s)); - this._slideGamepadAction = setStatusGamepad; - this._isReallyMouseOvered = false; - } - - protected override void DrawSelf(SpriteBatch spriteBatch) - { - UISliderBase.CurrentAimedSlider = (UIElement) null; - if (!Main.mouseLeft) - UISliderBase.CurrentLockedSlider = (UIElement) null; - int usageLevel = this.GetUsageLevel(); - float num1 = 8f; - base.DrawSelf(spriteBatch); - CalculatedStyle dimensions = this.GetDimensions(); - float num2 = dimensions.Width + 1f; - Vector2 vector2_1 = new Vector2(dimensions.X, dimensions.Y); - bool flag1 = false; - bool flag2 = this.IsMouseHovering; - if (usageLevel == 2) - flag2 = false; - if (usageLevel == 1) - flag2 = true; - Vector2 vector2_2 = new Vector2(0.0f, 2f); - Vector2 drawPosition = vector2_1 + vector2_2; - Color.Lerp(flag1 ? Color.Gold : (flag2 ? Color.White : Color.Silver), Color.White, flag2 ? 0.5f : 0.0f); - Vector2 vector2_3 = new Vector2(0.8f); - drawPosition.X += 8f; - drawPosition.Y += num1; - drawPosition.X -= 17f; - TextureAssets.ColorBar.Frame(); - drawPosition = new Vector2((float) ((double) dimensions.X + (double) dimensions.Width - 10.0), dimensions.Y + 10f + num1); - bool wasInBar; - float num3 = this.DrawValueBar(spriteBatch, drawPosition, 1f, this._getStatusTextAct(), usageLevel, out wasInBar, this._blipFunc); - if (UISliderBase.CurrentLockedSlider == this | wasInBar) - { - UISliderBase.CurrentAimedSlider = (UIElement) this; - if (PlayerInput.Triggers.Current.MouseLeft && !PlayerInput.UsingGamepad && UISliderBase.CurrentLockedSlider == this) - { - this._slideKeyboardAction(num3); - if (!this._soundedUsage) - SoundEngine.PlaySound(12); - this._soundedUsage = true; - } - else - this._soundedUsage = false; - } - if (UISliderBase.CurrentAimedSlider != null && UISliderBase.CurrentLockedSlider == null) - UISliderBase.CurrentLockedSlider = UISliderBase.CurrentAimedSlider; - if (!this._isReallyMouseOvered) - return; - this._slideGamepadAction(); - } - - private float DrawValueBar( - SpriteBatch sb, - Vector2 drawPosition, - float drawScale, - float sliderPosition, - int lockMode, - out bool wasInBar, - Func blipColorFunc) - { - Texture2D texture = TextureAssets.ColorBar.Value; - Vector2 vector2 = new Vector2((float) texture.Width, (float) texture.Height) * drawScale; - drawPosition.X -= (float) (int) vector2.X; - Rectangle destinationRectangle1 = new Rectangle((int) drawPosition.X, (int) drawPosition.Y - (int) vector2.Y / 2, (int) vector2.X, (int) vector2.Y); - Rectangle destinationRectangle2 = destinationRectangle1; - sb.Draw(texture, destinationRectangle1, Color.White); - float num1 = (float) destinationRectangle1.X + 5f * drawScale; - float y = (float) destinationRectangle1.Y + 4f * drawScale; - for (float num2 = 0.0f; (double) num2 < 167.0; ++num2) - { - float num3 = num2 / 167f; - Color color = blipColorFunc(num3); - sb.Draw(TextureAssets.ColorBlip.Value, new Vector2(num1 + num2 * drawScale, y), new Rectangle?(), color, 0.0f, Vector2.Zero, drawScale, SpriteEffects.None, 0.0f); - } - destinationRectangle1.X = (int) num1 - 2; - destinationRectangle1.Y = (int) y; - destinationRectangle1.Width -= 4; - destinationRectangle1.Height -= 8; - bool flag = destinationRectangle1.Contains(new Point(Main.mouseX, Main.mouseY)); - this._isReallyMouseOvered = flag; - if (this.IgnoresMouseInteraction) - flag = false; - if (lockMode == 2) - flag = false; - if (flag || lockMode == 1) - { - sb.Draw(TextureAssets.ColorHighlight.Value, destinationRectangle2, Main.OurFavoriteColor); - if (!this._alreadyHovered) - SoundEngine.PlaySound(12); - this._alreadyHovered = true; - } - else - this._alreadyHovered = false; - wasInBar = false; - if (!this.IgnoresMouseInteraction) - { - sb.Draw(TextureAssets.ColorSlider.Value, new Vector2(num1 + 167f * drawScale * sliderPosition, y + 4f * drawScale), new Rectangle?(), Color.White, 0.0f, new Vector2(0.5f * (float) TextureAssets.ColorSlider.Value.Width, 0.5f * (float) TextureAssets.ColorSlider.Value.Height), drawScale, SpriteEffects.None, 0.0f); - if (Main.mouseX >= destinationRectangle1.X && Main.mouseX <= destinationRectangle1.X + destinationRectangle1.Width) - { - wasInBar = flag; - return (float) (Main.mouseX - destinationRectangle1.X) / (float) destinationRectangle1.Width; - } - } - return destinationRectangle1.X >= Main.mouseX ? 0.0f : 1f; - } - } -} diff --git a/GameContent/UI/Elements/UIColoredSliderSimple.cs b/GameContent/UI/Elements/UIColoredSliderSimple.cs deleted file mode 100644 index cd14e3a..0000000 --- a/GameContent/UI/Elements/UIColoredSliderSimple.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UIColoredSliderSimple -// 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; -using Microsoft.Xna.Framework.Graphics; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UIColoredSliderSimple : UIElement - { - public float FillPercent; - public Color FilledColor = Main.OurFavoriteColor; - public Color EmptyColor = Color.Black; - - protected override void DrawSelf(SpriteBatch spriteBatch) => this.DrawValueBarDynamicWidth(spriteBatch); - - private void DrawValueBarDynamicWidth(SpriteBatch sb) - { - Texture2D texture1 = TextureAssets.ColorBar.Value; - Rectangle rectangle1 = this.GetDimensions().ToRectangle(); - Rectangle rectangle2 = new Rectangle(5, 4, 4, 4); - Utils.DrawSplicedPanel(sb, texture1, rectangle1.X, rectangle1.Y, rectangle1.Width, rectangle1.Height, rectangle2.X, rectangle2.Width, rectangle2.Y, rectangle2.Height, Color.White); - Rectangle destinationRectangle1 = rectangle1; - destinationRectangle1.X += rectangle2.Left; - destinationRectangle1.Width -= rectangle2.Right; - destinationRectangle1.Y += rectangle2.Top; - destinationRectangle1.Height -= rectangle2.Bottom; - Texture2D texture2 = TextureAssets.MagicPixel.Value; - Rectangle rectangle3 = new Rectangle(0, 0, 1, 1); - sb.Draw(texture2, destinationRectangle1, new Rectangle?(rectangle3), this.EmptyColor); - Rectangle destinationRectangle2 = destinationRectangle1; - destinationRectangle2.Width = (int) ((double) destinationRectangle2.Width * (double) this.FillPercent); - sb.Draw(texture2, destinationRectangle2, new Rectangle?(rectangle3), this.FilledColor); - } - } -} diff --git a/GameContent/UI/Elements/UICreativeInfiniteItemsDisplay.cs b/GameContent/UI/Elements/UICreativeInfiniteItemsDisplay.cs deleted file mode 100644 index 81f43ee..0000000 --- a/GameContent/UI/Elements/UICreativeInfiniteItemsDisplay.cs +++ /dev/null @@ -1,574 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UICreativeInfiniteItemsDisplay -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria.Audio; -using Terraria.DataStructures; -using Terraria.GameContent.Creative; -using Terraria.GameContent.UI.States; -using Terraria.Graphics.Renderers; -using Terraria.ID; -using Terraria.Localization; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UICreativeInfiniteItemsDisplay : UIElement - { - private List _itemIdsAvailableTotal; - private List _itemIdsAvailableToShow; - private CreativeUnlocksTracker _lastTrackerCheckedForEdits; - private int _lastCheckedVersionForEdits = -1; - private UISearchBar _searchBar; - private UIPanel _searchBoxPanel; - private UIState _parentUIState; - private string _searchString; - private UIDynamicItemCollection _itemGrid; - private EntryFilterer _filterer; - private EntrySorter _sorter; - private UIElement _containerInfinites; - private UIElement _containerSacrifice; - private bool _showSacrificesInsteadOfInfinites; - public const string SnapPointName_SacrificeSlot = "CreativeSacrificeSlot"; - public const string SnapPointName_SacrificeConfirmButton = "CreativeSacrificeConfirm"; - public const string SnapPointName_InfinitesFilter = "CreativeInfinitesFilter"; - public const string SnapPointName_InfinitesSearch = "CreativeInfinitesSearch"; - public const string SnapPointName_InfinitesItemSlot = "CreativeInfinitesSlot"; - private List _sacrificeCogsSmall = new List(); - private List _sacrificeCogsMedium = new List(); - private List _sacrificeCogsBig = new List(); - private UIImageFramed _sacrificePistons; - private UIParticleLayer _pistonParticleSystem; - private Asset _pistonParticleAsset; - private int _sacrificeAnimationTimeLeft; - private bool _researchComplete; - private bool _hovered; - private int _lastItemIdSacrificed; - private int _lastItemAmountWeHad; - private int _lastItemAmountWeNeededTotal; - - public UICreativeInfiniteItemsDisplay(UIState uiStateThatHoldsThis) - { - this._parentUIState = uiStateThatHoldsThis; - this._itemIdsAvailableTotal = new List(); - this._itemIdsAvailableToShow = new List(); - this._filterer = new EntryFilterer(); - this._filterer.AddFilters(new List() - { - (IItemEntryFilter) new ItemFilters.Weapon(), - (IItemEntryFilter) new ItemFilters.Armor(), - (IItemEntryFilter) new ItemFilters.BuildingBlock(), - (IItemEntryFilter) new ItemFilters.GameplayItems(), - (IItemEntryFilter) new ItemFilters.Accessories(), - (IItemEntryFilter) new ItemFilters.Consumables(), - (IItemEntryFilter) new ItemFilters.Materials() - }); - this._filterer.SetSearchFilterObject(new ItemFilters.BySearch()); - this._sorter = new EntrySorter(); - this._sorter.AddSortSteps(new List() - { - (ICreativeItemSortStep) new SortingSteps.ByCreativeSortingId(), - (ICreativeItemSortStep) new SortingSteps.Alphabetical() - }); - this._itemIdsAvailableTotal.AddRange((IEnumerable) CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId.Keys.ToList()); - this.BuildPage(); - } - - private void BuildPage() - { - this._lastCheckedVersionForEdits = -1; - this.RemoveAllChildren(); - this.SetPadding(0.0f); - UIElement totalContainer1 = new UIElement() - { - Width = StyleDimension.Fill, - Height = StyleDimension.Fill - }; - totalContainer1.SetPadding(0.0f); - this._containerInfinites = totalContainer1; - UIElement totalContainer2 = new UIElement() - { - Width = StyleDimension.Fill, - Height = StyleDimension.Fill - }; - totalContainer2.SetPadding(0.0f); - this._containerSacrifice = totalContainer2; - this.BuildInfinitesMenuContents(totalContainer1); - this.BuildSacrificeMenuContents(totalContainer2); - this.UpdateContents(); - this.OnUpdate += new UIElement.ElementEvent(this.UICreativeInfiniteItemsDisplay_OnUpdate); - } - - private void Hover_OnUpdate(UIElement affectedElement) - { - if (!this._hovered) - return; - Main.LocalPlayer.mouseInterface = true; - } - - private void Hover_OnMouseOut(UIMouseEvent evt, UIElement listeningElement) => this._hovered = false; - - private void Hover_OnMouseOver(UIMouseEvent evt, UIElement listeningElement) => this._hovered = true; - - private static UIPanel CreateBasicPanel() - { - UIPanel uiPanel = new UIPanel(); - UICreativeInfiniteItemsDisplay.SetBasicSizesForCreativeSacrificeOrInfinitesPanel((UIElement) uiPanel); - uiPanel.BackgroundColor *= 0.8f; - uiPanel.BorderColor *= 0.8f; - return uiPanel; - } - - private static void SetBasicSizesForCreativeSacrificeOrInfinitesPanel(UIElement element) - { - element.Width = new StyleDimension(0.0f, 1f); - element.Height = new StyleDimension(-38f, 1f); - element.Top = new StyleDimension(38f, 0.0f); - } - - private void BuildInfinitesMenuContents(UIElement totalContainer) - { - UIPanel basicPanel = UICreativeInfiniteItemsDisplay.CreateBasicPanel(); - totalContainer.Append((UIElement) basicPanel); - basicPanel.OnUpdate += new UIElement.ElementEvent(this.Hover_OnUpdate); - basicPanel.OnMouseOver += new UIElement.MouseEvent(this.Hover_OnMouseOver); - basicPanel.OnMouseOut += new UIElement.MouseEvent(this.Hover_OnMouseOut); - UIDynamicItemCollection dynamicItemCollection = new UIDynamicItemCollection(); - this._itemGrid = dynamicItemCollection; - UIElement uiElement = new UIElement() - { - Height = new StyleDimension(24f, 0.0f), - Width = new StyleDimension(0.0f, 1f) - }; - uiElement.SetPadding(0.0f); - basicPanel.Append(uiElement); - this.AddSearchBar(uiElement); - this._searchBar.SetContents((string) null, true); - UIList uiList1 = new UIList(); - uiList1.Width = new StyleDimension(-25f, 1f); - uiList1.Height = new StyleDimension(-28f, 1f); - uiList1.VAlign = 1f; - uiList1.HAlign = 0.0f; - UIList uiList2 = uiList1; - basicPanel.Append((UIElement) uiList2); - float num = 4f; - UIScrollbar uiScrollbar = new UIScrollbar(); - uiScrollbar.Height = new StyleDimension((float) (-28.0 - (double) num * 2.0), 1f); - uiScrollbar.Top = new StyleDimension(-num, 0.0f); - uiScrollbar.VAlign = 1f; - uiScrollbar.HAlign = 1f; - UIScrollbar scrollbar = uiScrollbar; - basicPanel.Append((UIElement) scrollbar); - uiList2.SetScrollbar(scrollbar); - uiList2.Add((UIElement) dynamicItemCollection); - UICreativeItemsInfiniteFilteringOptions filteringOptions = new UICreativeItemsInfiniteFilteringOptions(this._filterer, "CreativeInfinitesFilter"); - filteringOptions.OnClickingOption += new Action(this.filtersHelper_OnClickingOption); - filteringOptions.Left = new StyleDimension(20f, 0.0f); - totalContainer.Append((UIElement) filteringOptions); - filteringOptions.OnUpdate += new UIElement.ElementEvent(this.Hover_OnUpdate); - filteringOptions.OnMouseOver += new UIElement.MouseEvent(this.Hover_OnMouseOver); - filteringOptions.OnMouseOut += new UIElement.MouseEvent(this.Hover_OnMouseOut); - } - - private void BuildSacrificeMenuContents(UIElement totalContainer) - { - UIPanel basicPanel = UICreativeInfiniteItemsDisplay.CreateBasicPanel(); - basicPanel.VAlign = 0.5f; - basicPanel.Height = new StyleDimension(170f, 0.0f); - basicPanel.Width = new StyleDimension(170f, 0.0f); - basicPanel.Top = new StyleDimension(); - totalContainer.Append((UIElement) basicPanel); - basicPanel.OnUpdate += new UIElement.ElementEvent(this.Hover_OnUpdate); - basicPanel.OnMouseOver += new UIElement.MouseEvent(this.Hover_OnMouseOver); - basicPanel.OnMouseOut += new UIElement.MouseEvent(this.Hover_OnMouseOut); - this.AddCogsForSacrificeMenu((UIElement) basicPanel); - this._pistonParticleAsset = Main.Assets.Request("Images/UI/Creative/Research_Spark", (AssetRequestMode) 1); - float pixels = 0.0f; - UIImage uiImage1 = new UIImage(Main.Assets.Request("Images/UI/Creative/Research_Slots", (AssetRequestMode) 1)); - uiImage1.HAlign = 0.5f; - uiImage1.VAlign = 0.5f; - uiImage1.Top = new StyleDimension(-20f, 0.0f); - uiImage1.Left = new StyleDimension(pixels, 0.0f); - UIImage uiImage2 = uiImage1; - basicPanel.Append((UIElement) uiImage2); - Asset asset = Main.Assets.Request("Images/UI/Creative/Research_FramedPistons", (AssetRequestMode) 1); - UIImageFramed uiImageFramed1 = new UIImageFramed(asset, asset.Frame(verticalFrames: 9)); - uiImageFramed1.HAlign = 0.5f; - uiImageFramed1.VAlign = 0.5f; - uiImageFramed1.Top = new StyleDimension(-20f, 0.0f); - uiImageFramed1.Left = new StyleDimension(pixels, 0.0f); - uiImageFramed1.IgnoresMouseInteraction = true; - UIImageFramed uiImageFramed2 = uiImageFramed1; - basicPanel.Append((UIElement) uiImageFramed2); - this._sacrificePistons = uiImageFramed2; - UIParticleLayer uiParticleLayer = new UIParticleLayer(); - uiParticleLayer.Width = new StyleDimension(0.0f, 1f); - uiParticleLayer.Height = new StyleDimension(0.0f, 1f); - uiParticleLayer.AnchorPositionOffsetByPercents = Vector2.One / 2f; - uiParticleLayer.AnchorPositionOffsetByPixels = Vector2.Zero; - this._pistonParticleSystem = uiParticleLayer; - uiImageFramed2.Append((UIElement) this._pistonParticleSystem); - UIElement element = Main.CreativeMenu.ProvideItemSlotElement(0); - element.HAlign = 0.5f; - element.VAlign = 0.5f; - element.Top = new StyleDimension(-15f, 0.0f); - element.Left = new StyleDimension(pixels, 0.0f); - element.SetSnapPoint("CreativeSacrificeSlot", 0); - uiImage2.Append(element); - UIText uiText1 = new UIText("(0/50)", 0.8f); - uiText1.Top = new StyleDimension(10f, 0.0f); - uiText1.Left = new StyleDimension(pixels, 0.0f); - uiText1.HAlign = 0.5f; - uiText1.VAlign = 0.5f; - uiText1.IgnoresMouseInteraction = true; - UIText uiText2 = uiText1; - uiText2.OnUpdate += new UIElement.ElementEvent(this.descriptionText_OnUpdate); - basicPanel.Append((UIElement) uiText2); - UIPanel uiPanel1 = new UIPanel(); - uiPanel1.Top = new StyleDimension(0.0f, 0.0f); - uiPanel1.Left = new StyleDimension(pixels, 0.0f); - uiPanel1.HAlign = 0.5f; - uiPanel1.VAlign = 1f; - uiPanel1.Width = new StyleDimension(124f, 0.0f); - uiPanel1.Height = new StyleDimension(30f, 0.0f); - UIPanel uiPanel2 = uiPanel1; - UIText uiText3 = new UIText(Language.GetText("CreativePowers.ConfirmInfiniteItemSacrifice"), 0.8f); - uiText3.IgnoresMouseInteraction = true; - uiText3.HAlign = 0.5f; - uiText3.VAlign = 0.5f; - UIText uiText4 = uiText3; - uiPanel2.Append((UIElement) uiText4); - uiPanel2.SetSnapPoint("CreativeSacrificeConfirm", 0); - uiPanel2.OnClick += new UIElement.MouseEvent(this.sacrificeButton_OnClick); - uiPanel2.OnMouseOver += new UIElement.MouseEvent(this.FadedMouseOver); - uiPanel2.OnMouseOut += new UIElement.MouseEvent(this.FadedMouseOut); - uiPanel2.OnUpdate += new UIElement.ElementEvent(this.research_OnUpdate); - basicPanel.Append((UIElement) uiPanel2); - basicPanel.OnUpdate += new UIElement.ElementEvent(this.sacrificeWindow_OnUpdate); - } - - private void research_OnUpdate(UIElement affectedElement) - { - if (!affectedElement.IsMouseHovering) - return; - Main.instance.MouseText(Language.GetTextValue("CreativePowers.ResearchButtonTooltip")); - } - - private void FadedMouseOver(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(12); - ((UIPanel) evt.Target).BackgroundColor = new Color(73, 94, 171); - ((UIPanel) evt.Target).BorderColor = Colors.FancyUIFatButtonMouseOver; - } - - private void FadedMouseOut(UIMouseEvent evt, UIElement listeningElement) - { - ((UIPanel) evt.Target).BackgroundColor = new Color(63, 82, 151) * 0.8f; - ((UIPanel) evt.Target).BorderColor = Color.Black; - } - - private void AddCogsForSacrificeMenu(UIElement sacrificesContainer) - { - UIElement uiElement = new UIElement(); - uiElement.IgnoresMouseInteraction = true; - UICreativeInfiniteItemsDisplay.SetBasicSizesForCreativeSacrificeOrInfinitesPanel(uiElement); - uiElement.VAlign = 0.5f; - uiElement.Height = new StyleDimension(170f, 0.0f); - uiElement.Width = new StyleDimension(280f, 0.0f); - uiElement.Top = new StyleDimension(); - uiElement.SetPadding(0.0f); - sacrificesContainer.Append(uiElement); - Vector2 vector2 = new Vector2(-10f, -10f); - this.AddSymetricalCogsPair(uiElement, new Vector2(22f, 1f) + vector2, "Images/UI/Creative/Research_GearC", this._sacrificeCogsSmall); - this.AddSymetricalCogsPair(uiElement, new Vector2(1f, 28f) + vector2, "Images/UI/Creative/Research_GearB", this._sacrificeCogsMedium); - this.AddSymetricalCogsPair(uiElement, new Vector2(5f, 5f) + vector2, "Images/UI/Creative/Research_GearA", this._sacrificeCogsBig); - } - - private void sacrificeWindow_OnUpdate(UIElement affectedElement) - { - float num1 = 0.05f; - float animationProgress = this.GetSacrificeAnimationProgress(); - double lerpValue = (double) Utils.GetLerpValue(1f, 0.7f, animationProgress, true); - float num2 = 1f + (float) (lerpValue * lerpValue) * 2f; - float num3 = num1 * num2; - float num4 = 1.142857f; - float num5 = 1f; - UICreativeInfiniteItemsDisplay.OffsetRotationsForCogs((float) (2.0 * (double) num3), this._sacrificeCogsSmall); - UICreativeInfiniteItemsDisplay.OffsetRotationsForCogs(num4 * num3, this._sacrificeCogsMedium); - UICreativeInfiniteItemsDisplay.OffsetRotationsForCogs(-num5 * num3, this._sacrificeCogsBig); - int frameY = 0; - if (this._sacrificeAnimationTimeLeft != 0) - { - float num6 = 0.1f; - float num7 = 0.06666667f; - frameY = (double) animationProgress < 1.0 - (double) num6 ? ((double) animationProgress < 1.0 - (double) num6 * 2.0 ? ((double) animationProgress < 1.0 - (double) num6 * 3.0 ? ((double) animationProgress < (double) num7 * 4.0 ? ((double) animationProgress < (double) num7 * 3.0 ? ((double) animationProgress < (double) num7 * 2.0 ? ((double) animationProgress < (double) num7 ? 1 : 2) : 3) : 4) : 5) : 6) : 7) : 8; - if (this._sacrificeAnimationTimeLeft == 56) - { - SoundEngine.PlaySound(63); - Vector2 vector2 = new Vector2(0.0f, 0.1635f); - for (int index = 0; index < 15; ++index) - { - Vector2 initialVelocity = Main.rand.NextVector2Circular(4f, 3f); - if ((double) initialVelocity.Y > 0.0) - initialVelocity.Y = -initialVelocity.Y; - initialVelocity.Y -= 2f; - this._pistonParticleSystem.AddParticle((IParticle) new CreativeSacrificeParticle(this._pistonParticleAsset, new Rectangle?(), initialVelocity, Vector2.Zero) - { - AccelerationPerFrame = vector2, - ScaleOffsetPerFrame = -0.01666667f - }); - } - } - if (this._sacrificeAnimationTimeLeft == 40 && this._researchComplete) - { - this._researchComplete = false; - SoundEngine.PlaySound(64); - } - } - this._sacrificePistons.SetFrame(1, 9, 0, frameY, 0, 0); - } - - private static void OffsetRotationsForCogs(float rotationOffset, List cogsList) - { - cogsList[0].Rotation += rotationOffset; - cogsList[1].Rotation -= rotationOffset; - } - - private void AddSymetricalCogsPair( - UIElement sacrificesContainer, - Vector2 cogOFfsetsInPixels, - string assetPath, - List imagesList) - { - Asset asset = Main.Assets.Request(assetPath, (AssetRequestMode) 1); - cogOFfsetsInPixels += -asset.Size() / 2f; - UIImage uiImage1 = new UIImage(asset); - uiImage1.NormalizedOrigin = Vector2.One / 2f; - uiImage1.Left = new StyleDimension(cogOFfsetsInPixels.X, 0.0f); - uiImage1.Top = new StyleDimension(cogOFfsetsInPixels.Y, 0.0f); - UIImage uiImage2 = uiImage1; - imagesList.Add(uiImage2); - sacrificesContainer.Append((UIElement) uiImage2); - UIImage uiImage3 = new UIImage(asset); - uiImage3.NormalizedOrigin = Vector2.One / 2f; - uiImage3.HAlign = 1f; - uiImage3.Left = new StyleDimension(-cogOFfsetsInPixels.X, 0.0f); - uiImage3.Top = new StyleDimension(cogOFfsetsInPixels.Y, 0.0f); - UIImage uiImage4 = uiImage3; - imagesList.Add(uiImage4); - sacrificesContainer.Append((UIElement) uiImage4); - } - - private void descriptionText_OnUpdate(UIElement affectedElement) - { - UIText uiText = affectedElement as UIText; - int itemIdChecked; - int amountWeHave; - int amountNeededTotal; - bool sacrificeNumbers = Main.CreativeMenu.GetSacrificeNumbers(out itemIdChecked, out amountWeHave, out amountNeededTotal); - Main.CreativeMenu.ShouldDrawSacrificeArea(); - if (!Main.mouseItem.IsAir) - this.ForgetItemSacrifice(); - if (itemIdChecked == 0) - { - if (this._lastItemIdSacrificed != 0 && this._lastItemAmountWeNeededTotal != this._lastItemAmountWeHad) - uiText.SetText(string.Format("({0}/{1})", (object) this._lastItemAmountWeHad, (object) this._lastItemAmountWeNeededTotal)); - else - uiText.SetText("???"); - } - else - { - this.ForgetItemSacrifice(); - if (!sacrificeNumbers) - uiText.SetText("X"); - else - uiText.SetText(string.Format("({0}/{1})", (object) amountWeHave, (object) amountNeededTotal)); - } - } - - private void sacrificeButton_OnClick(UIMouseEvent evt, UIElement listeningElement) - { - int itemIdChecked; - int amountWeHave; - int amountNeededTotal; - Main.CreativeMenu.GetSacrificeNumbers(out itemIdChecked, out amountWeHave, out amountNeededTotal); - int amountWeSacrificed; - switch (Main.CreativeMenu.SacrificeItem(out amountWeSacrificed)) - { - case CreativeUI.ItemSacrificeResult.SacrificedButNotDone: - this._researchComplete = false; - this.BeginSacrificeAnimation(); - this.RememberItemSacrifice(itemIdChecked, amountWeHave + amountWeSacrificed, amountNeededTotal); - break; - case CreativeUI.ItemSacrificeResult.SacrificedAndDone: - this._researchComplete = true; - this.BeginSacrificeAnimation(); - this.RememberItemSacrifice(itemIdChecked, amountWeHave + amountWeSacrificed, amountNeededTotal); - break; - } - } - - private void RememberItemSacrifice(int itemId, int amountWeHave, int amountWeNeedTotal) - { - this._lastItemIdSacrificed = itemId; - this._lastItemAmountWeHad = amountWeHave; - this._lastItemAmountWeNeededTotal = amountWeNeedTotal; - } - - private void ForgetItemSacrifice() - { - this._lastItemIdSacrificed = 0; - this._lastItemAmountWeHad = 0; - this._lastItemAmountWeNeededTotal = 0; - } - - private void BeginSacrificeAnimation() => this._sacrificeAnimationTimeLeft = 60; - - private void UpdateSacrificeAnimation() - { - if (this._sacrificeAnimationTimeLeft <= 0) - return; - --this._sacrificeAnimationTimeLeft; - } - - private float GetSacrificeAnimationProgress() => Utils.GetLerpValue(60f, 0.0f, (float) this._sacrificeAnimationTimeLeft, true); - - public void SetPageTypeToShow( - UICreativeInfiniteItemsDisplay.InfiniteItemsDisplayPage page) - { - this._showSacrificesInsteadOfInfinites = page == UICreativeInfiniteItemsDisplay.InfiniteItemsDisplayPage.InfiniteItemsResearch; - } - - private void UICreativeInfiniteItemsDisplay_OnUpdate(UIElement affectedElement) - { - this.RemoveAllChildren(); - CreativeUnlocksTracker playerCreativeTracker = Main.LocalPlayerCreativeTracker; - if (this._lastTrackerCheckedForEdits != playerCreativeTracker) - { - this._lastTrackerCheckedForEdits = playerCreativeTracker; - this._lastCheckedVersionForEdits = -1; - } - int lastEditId = playerCreativeTracker.ItemSacrifices.LastEditId; - if (this._lastCheckedVersionForEdits != lastEditId) - { - this._lastCheckedVersionForEdits = lastEditId; - this.UpdateContents(); - } - if (this._showSacrificesInsteadOfInfinites) - this.Append(this._containerSacrifice); - else - this.Append(this._containerInfinites); - this.UpdateSacrificeAnimation(); - } - - private void filtersHelper_OnClickingOption() => this.UpdateContents(); - - private void UpdateContents() - { - this._itemIdsAvailableTotal.Clear(); - CreativeItemSacrificesCatalog.Instance.FillListOfItemsThatCanBeObtainedInfinitely(this._itemIdsAvailableTotal); - this._itemIdsAvailableToShow.Clear(); - this._itemIdsAvailableToShow.AddRange(this._itemIdsAvailableTotal.Where((Func) (x => this._filterer.FitsFilter(ContentSamples.ItemsByType[x])))); - this._itemIdsAvailableToShow.Sort((IComparer) this._sorter); - this._itemGrid.SetContentsToShow(this._itemIdsAvailableToShow); - } - - private void AddSearchBar(UIElement searchArea) - { - UIImageButton uiImageButton1 = new UIImageButton(Main.Assets.Request("Images/UI/Bestiary/Button_Search", (AssetRequestMode) 1)); - uiImageButton1.VAlign = 0.5f; - uiImageButton1.HAlign = 0.0f; - UIImageButton uiImageButton2 = uiImageButton1; - uiImageButton2.OnClick += new UIElement.MouseEvent(this.Click_SearchArea); - uiImageButton2.SetHoverImage(Main.Assets.Request("Images/UI/Bestiary/Button_Search_Border", (AssetRequestMode) 1)); - uiImageButton2.SetVisibility(1f, 1f); - uiImageButton2.SetSnapPoint("CreativeInfinitesSearch", 0); - searchArea.Append((UIElement) uiImageButton2); - UIPanel uiPanel1 = new UIPanel(); - uiPanel1.Width = new StyleDimension((float) (-(double) uiImageButton2.Width.Pixels - 3.0), 1f); - uiPanel1.Height = new StyleDimension(0.0f, 1f); - uiPanel1.VAlign = 0.5f; - uiPanel1.HAlign = 1f; - UIPanel uiPanel2 = uiPanel1; - this._searchBoxPanel = uiPanel2; - uiPanel2.BackgroundColor = new Color(35, 40, 83); - uiPanel2.BorderColor = new Color(35, 40, 83); - uiPanel2.SetPadding(0.0f); - searchArea.Append((UIElement) uiPanel2); - UISearchBar uiSearchBar1 = new UISearchBar(Language.GetText("UI.PlayerNameSlot"), 0.8f); - uiSearchBar1.Width = new StyleDimension(0.0f, 1f); - uiSearchBar1.Height = new StyleDimension(0.0f, 1f); - uiSearchBar1.HAlign = 0.0f; - uiSearchBar1.VAlign = 0.5f; - uiSearchBar1.Left = new StyleDimension(0.0f, 0.0f); - uiSearchBar1.IgnoresMouseInteraction = true; - UISearchBar uiSearchBar2 = uiSearchBar1; - this._searchBar = uiSearchBar2; - uiPanel2.OnClick += new UIElement.MouseEvent(this.Click_SearchArea); - uiSearchBar2.OnContentsChanged += new Action(this.OnSearchContentsChanged); - uiPanel2.Append((UIElement) uiSearchBar2); - uiSearchBar2.OnStartTakingInput += new Action(this.OnStartTakingInput); - uiSearchBar2.OnEndTakingInput += new Action(this.OnEndTakingInput); - uiSearchBar2.OnNeedingVirtualKeyboard += new Action(this.OpenVirtualKeyboardWhenNeeded); - uiSearchBar2.OnCancledTakingInput += new Action(this.OnCancledInput); - } - - private void OnCancledInput() => Main.LocalPlayer.ToggleInv(); - - private void Click_SearchArea(UIMouseEvent evt, UIElement listeningElement) => this._searchBar.ToggleTakingText(); - - private void OnSearchContentsChanged(string contents) - { - this._searchString = contents; - this._filterer.SetSearchFilter(contents); - this.UpdateContents(); - } - - private void OnStartTakingInput() => this._searchBoxPanel.BorderColor = Main.OurFavoriteColor; - - private void OnEndTakingInput() => this._searchBoxPanel.BorderColor = new Color(35, 40, 83); - - private void OpenVirtualKeyboardWhenNeeded() - { - int length = 40; - UIVirtualKeyboard uiVirtualKeyboard = new UIVirtualKeyboard(Language.GetText("UI.PlayerNameSlot").Value, this._searchString, new UIVirtualKeyboard.KeyboardSubmitEvent(this.OnFinishedSettingName), new Action(this.GoBackHere), 3, true); - uiVirtualKeyboard.SetMaxInputLength(length); - IngameFancyUI.OpenUIState((UIState) uiVirtualKeyboard); - } - - private static UserInterface GetCurrentInterface() - { - UserInterface activeInstance = UserInterface.ActiveInstance; - return !Main.gameMenu ? Main.InGameUI : Main.MenuUI; - } - - private void OnFinishedSettingName(string name) - { - this._searchBar.SetContents(name.Trim()); - this.GoBackHere(); - } - - private void GoBackHere() - { - IngameFancyUI.Close(); - this._searchBar.ToggleTakingText(); - Main.CreativeMenu.GamepadMoveToSearchButtonHack = true; - } - - public int GetItemsPerLine() => this._itemGrid.GetItemsPerLine(); - - public enum InfiniteItemsDisplayPage - { - InfiniteItemsPickup, - InfiniteItemsResearch, - } - } -} diff --git a/GameContent/UI/Elements/UICreativeItemsInfiniteFilteringOptions.cs b/GameContent/UI/Elements/UICreativeItemsInfiniteFilteringOptions.cs deleted file mode 100644 index 3fbe5cb..0000000 --- a/GameContent/UI/Elements/UICreativeItemsInfiniteFilteringOptions.cs +++ /dev/null @@ -1,112 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UICreativeItemsInfiniteFilteringOptions -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using System; -using System.Collections.Generic; -using Terraria.Audio; -using Terraria.DataStructures; -using Terraria.GameContent.Creative; -using Terraria.Localization; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UICreativeItemsInfiniteFilteringOptions : UIElement - { - private EntryFilterer _filterer; - private Dictionary _filtersByButtons = new Dictionary(); - private Dictionary _iconsByButtons = new Dictionary(); - private const int barFramesX = 2; - private const int barFramesY = 4; - - public event Action OnClickingOption; - - public UICreativeItemsInfiniteFilteringOptions( - EntryFilterer filterer, - string snapPointsName) - { - this._filterer = filterer; - int num1 = 40; - int count = this._filterer.AvailableFilters.Count; - int num2 = num1 * count; - this.Height = new StyleDimension((float) num1, 0.0f); - this.Width = new StyleDimension((float) num2, 0.0f); - this.Top = new StyleDimension(4f, 0.0f); - this.SetPadding(0.0f); - Asset asset = Main.Assets.Request("Images/UI/Creative/Infinite_Tabs_B", (AssetRequestMode) 1); - for (int index = 0; index < this._filterer.AvailableFilters.Count; ++index) - { - IItemEntryFilter availableFilter = this._filterer.AvailableFilters[index]; - asset.Frame(2, 4).OffsetSize(-2, -2); - UIImageFramed uiImageFramed = new UIImageFramed(asset, asset.Frame(2, 4).OffsetSize(-2, -2)); - uiImageFramed.Left.Set((float) (num1 * index), 0.0f); - uiImageFramed.OnClick += new UIElement.MouseEvent(this.singleFilterButtonClick); - uiImageFramed.OnMouseOver += new UIElement.MouseEvent(this.button_OnMouseOver); - uiImageFramed.SetPadding(0.0f); - uiImageFramed.SetSnapPoint(snapPointsName, index); - this.AddOnHover(availableFilter, (UIElement) uiImageFramed, index); - UIElement image = availableFilter.GetImage(); - image.IgnoresMouseInteraction = true; - image.Left = new StyleDimension(6f, 0.0f); - image.HAlign = 0.0f; - uiImageFramed.Append(image); - this._filtersByButtons[uiImageFramed] = availableFilter; - this._iconsByButtons[uiImageFramed] = image; - this.Append((UIElement) uiImageFramed); - this.UpdateVisuals(uiImageFramed, index); - } - } - - private void button_OnMouseOver(UIMouseEvent evt, UIElement listeningElement) => SoundEngine.PlaySound(12); - - private void singleFilterButtonClick(UIMouseEvent evt, UIElement listeningElement) - { - IItemEntryFilter itemEntryFilter; - if (!(evt.Target is UIImageFramed target) || !this._filtersByButtons.TryGetValue(target, out itemEntryFilter)) - return; - int num = this._filterer.AvailableFilters.IndexOf(itemEntryFilter); - if (num == -1) - return; - if (!this._filterer.ActiveFilters.Contains(itemEntryFilter)) - this._filterer.ActiveFilters.Clear(); - this._filterer.ToggleFilter(num); - this.UpdateVisuals(target, num); - if (this.OnClickingOption == null) - return; - this.OnClickingOption(); - } - - private void UpdateVisuals(UIImageFramed button, int indexOfFilter) - { - bool flag = this._filterer.IsFilterActive(indexOfFilter); - bool isMouseHovering = button.IsMouseHovering; - int frameX = flag.ToInt(); - int frameY = flag.ToInt() * 2 + isMouseHovering.ToInt(); - button.SetFrame(2, 4, frameX, frameY, -2, -2); - if (!(this._iconsByButtons[button] is IColorable iconsByButton)) - return; - Color color = flag ? Color.White : Color.White * 0.5f; - iconsByButton.Color = color; - } - - private void AddOnHover(IItemEntryFilter filter, UIElement button, int indexOfFilter) - { - button.OnUpdate += (UIElement.ElementEvent) (element => this.ShowButtonName(element, filter, indexOfFilter)); - button.OnUpdate += (UIElement.ElementEvent) (element => this.UpdateVisuals(button as UIImageFramed, indexOfFilter)); - } - - private void ShowButtonName(UIElement element, IItemEntryFilter number, int indexOfFilter) - { - if (!element.IsMouseHovering) - return; - string textValue = Language.GetTextValue(number.GetDisplayNameKey()); - Main.instance.MouseText(textValue); - } - } -} diff --git a/GameContent/UI/Elements/UICreativePowerButton.cs b/GameContent/UI/Elements/UICreativePowerButton.cs deleted file mode 100644 index ea494fc..0000000 --- a/GameContent/UI/Elements/UICreativePowerButton.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UICreativePowerButton -// 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 Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UICreativePowerButton : UIElement - { - } -} diff --git a/GameContent/UI/Elements/UIDifficultyButton.cs b/GameContent/UI/Elements/UIDifficultyButton.cs deleted file mode 100644 index 439c181..0000000 --- a/GameContent/UI/Elements/UIDifficultyButton.cs +++ /dev/null @@ -1,94 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UIDifficultyButton -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria.Audio; -using Terraria.Localization; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UIDifficultyButton : UIElement - { - private readonly Player _player; - private readonly Asset _BasePanelTexture; - private readonly Asset _selectedBorderTexture; - private readonly Asset _hoveredBorderTexture; - private readonly byte _difficulty; - private readonly Color _color; - private bool _hovered; - private bool _soundedHover; - - public UIDifficultyButton( - Player player, - LocalizedText title, - LocalizedText description, - byte difficulty, - Color color) - { - this._player = player; - this._difficulty = difficulty; - this.Width = StyleDimension.FromPixels(44f); - this.Height = StyleDimension.FromPixels(110f); - this._BasePanelTexture = Main.Assets.Request("Images/UI/CharCreation/PanelGrayscale", (AssetRequestMode) 1); - this._selectedBorderTexture = Main.Assets.Request("Images/UI/CharCreation/CategoryPanelHighlight", (AssetRequestMode) 1); - this._hoveredBorderTexture = Main.Assets.Request("Images/UI/CharCreation/CategoryPanelBorder", (AssetRequestMode) 1); - this._color = color; - UIText uiText = new UIText(title, 0.9f); - uiText.HAlign = 0.5f; - uiText.VAlign = 0.0f; - uiText.Width = StyleDimension.FromPixelsAndPercent(-10f, 1f); - uiText.Top = StyleDimension.FromPixels(5f); - this.Append((UIElement) uiText); - } - - protected override void DrawSelf(SpriteBatch spriteBatch) - { - if (this._hovered) - { - if (!this._soundedHover) - SoundEngine.PlaySound(12); - this._soundedHover = true; - } - else - this._soundedHover = false; - CalculatedStyle dimensions = this.GetDimensions(); - int num1 = 7; - if ((double) dimensions.Height < 30.0) - num1 = 5; - int num2 = 10; - int num3 = 10; - int num4 = (int) this._difficulty == (int) this._player.difficulty ? 1 : 0; - Utils.DrawSplicedPanel(spriteBatch, this._BasePanelTexture.Value, (int) dimensions.X, (int) dimensions.Y, (int) dimensions.Width, (int) dimensions.Height, num2, num2, num3, num3, Color.Lerp(Color.Black, this._color, 0.8f) * 0.5f); - if (num4 != 0) - Utils.DrawSplicedPanel(spriteBatch, this._BasePanelTexture.Value, (int) dimensions.X + num1, (int) dimensions.Y + num1 - 2, (int) dimensions.Width - num1 * 2, (int) dimensions.Height - num1 * 2, num2, num2, num3, num3, Color.Lerp(this._color, Color.White, 0.7f) * 0.5f); - if (!this._hovered) - return; - Utils.DrawSplicedPanel(spriteBatch, this._hoveredBorderTexture.Value, (int) dimensions.X, (int) dimensions.Y, (int) dimensions.Width, (int) dimensions.Height, num2, num2, num3, num3, Color.White); - } - - public override void MouseDown(UIMouseEvent evt) - { - this._player.difficulty = this._difficulty; - SoundEngine.PlaySound(12); - base.MouseDown(evt); - } - - public override void MouseOver(UIMouseEvent evt) - { - base.MouseOver(evt); - this._hovered = true; - } - - public override void MouseOut(UIMouseEvent evt) - { - base.MouseOut(evt); - this._hovered = false; - } - } -} diff --git a/GameContent/UI/Elements/UIDynamicItemCollection.cs b/GameContent/UI/Elements/UIDynamicItemCollection.cs deleted file mode 100644 index 24af841..0000000 --- a/GameContent/UI/Elements/UIDynamicItemCollection.cs +++ /dev/null @@ -1,176 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UIDynamicItemCollection -// 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; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using Terraria.GameInput; -using Terraria.ID; -using Terraria.UI; -using Terraria.UI.Gamepad; - -namespace Terraria.GameContent.UI.Elements -{ - public class UIDynamicItemCollection : UIElement - { - private List _itemIdsAvailableToShow = new List(); - private List _itemIdsToLoadTexturesFor = new List(); - private int _itemsPerLine; - private const int sizePerEntryX = 44; - private const int sizePerEntryY = 44; - private List _dummySnapPoints = new List(); - - public UIDynamicItemCollection() - { - this.Width = new StyleDimension(0.0f, 1f); - this.HAlign = 0.5f; - this.UpdateSize(); - } - - protected override void DrawSelf(SpriteBatch spriteBatch) - { - Main.inventoryScale = 0.8461539f; - int startX; - int startY; - int startItemIndex; - int endItemIndex; - this.GetGridParameters(out startX, out startY, out startItemIndex, out endItemIndex); - int itemsPerLine = this._itemsPerLine; - for (int index = startItemIndex; index < endItemIndex; ++index) - { - int key = this._itemIdsAvailableToShow[index]; - Rectangle itemSlotHitbox = this.GetItemSlotHitbox(startX, startY, startItemIndex, index); - Item inv = ContentSamples.ItemsByType[key]; - int context = 29; - if (TextureAssets.Item[key].State == null) - --itemsPerLine; - bool flag = false; - if (this.IsMouseHovering && itemSlotHitbox.Contains(Main.MouseScreen.ToPoint()) && !PlayerInput.IgnoreMouseInterface) - { - Main.LocalPlayer.mouseInterface = true; - ItemSlot.OverrideHover(ref inv, context); - ItemSlot.LeftClick(ref inv, context); - ItemSlot.RightClick(ref inv, context); - ItemSlot.MouseHover(ref inv, context); - flag = true; - } - UILinkPointNavigator.Shortcuts.CREATIVE_ItemSlotShouldHighlightAsSelected = flag; - ItemSlot.Draw(spriteBatch, ref inv, context, itemSlotHitbox.TopLeft()); - if (itemsPerLine <= 0) - break; - } - while (this._itemIdsToLoadTexturesFor.Count > 0 && itemsPerLine > 0) - { - int i = this._itemIdsToLoadTexturesFor[0]; - this._itemIdsToLoadTexturesFor.RemoveAt(0); - if (TextureAssets.Item[i].State == null) - { - Main.instance.LoadItem(i); - itemsPerLine -= 4; - } - } - } - - private Rectangle GetItemSlotHitbox( - int startX, - int startY, - int startItemIndex, - int i) - { - int num1 = i - startItemIndex; - int num2 = num1 % this._itemsPerLine; - int num3 = num1 / this._itemsPerLine; - return new Rectangle(startX + num2 * 44, startY + num3 * 44, 44, 44); - } - - private void GetGridParameters( - out int startX, - out int startY, - out int startItemIndex, - out int endItemIndex) - { - Rectangle rectangle = this.GetDimensions().ToRectangle(); - Rectangle viewCullingArea = this.Parent.GetViewCullingArea(); - int x = rectangle.Center.X; - startX = x - (int) ((double) (44 * this._itemsPerLine) * 0.5); - startY = rectangle.Top; - startItemIndex = 0; - endItemIndex = this._itemIdsAvailableToShow.Count; - int num1 = (Math.Min(viewCullingArea.Top, rectangle.Top) - viewCullingArea.Top) / 44; - startY += -num1 * 44; - startItemIndex += -num1 * this._itemsPerLine; - int num2 = (int) Math.Ceiling((double) viewCullingArea.Height / 44.0) * this._itemsPerLine; - if (endItemIndex <= num2 + startItemIndex + this._itemsPerLine) - return; - endItemIndex = num2 + startItemIndex + this._itemsPerLine; - } - - public override void Recalculate() - { - base.Recalculate(); - this.UpdateSize(); - } - - public override void Update(GameTime gameTime) - { - base.Update(gameTime); - if (!this.IsMouseHovering) - return; - Main.LocalPlayer.mouseInterface = true; - } - - public void SetContentsToShow(List itemIdsToShow) - { - this._itemIdsAvailableToShow.Clear(); - this._itemIdsToLoadTexturesFor.Clear(); - this._itemIdsAvailableToShow.AddRange((IEnumerable) itemIdsToShow); - this._itemIdsToLoadTexturesFor.AddRange((IEnumerable) itemIdsToShow); - this.UpdateSize(); - } - - public int GetItemsPerLine() => this._itemsPerLine; - - public override List GetSnapPoints() - { - List snapPointList = new List(); - int startX; - int startY; - int startItemIndex; - int endItemIndex; - this.GetGridParameters(out startX, out startY, out startItemIndex, out endItemIndex); - int itemsPerLine = this._itemsPerLine; - Rectangle viewCullingArea = this.Parent.GetViewCullingArea(); - int num1 = endItemIndex - startItemIndex; - while (this._dummySnapPoints.Count < num1) - this._dummySnapPoints.Add(new SnapPoint("CreativeInfinitesSlot", 0, Vector2.Zero, Vector2.Zero)); - int num2 = 0; - Vector2 vector2 = this.GetDimensions().Position(); - for (int i = startItemIndex; i < endItemIndex; ++i) - { - Point center = this.GetItemSlotHitbox(startX, startY, startItemIndex, i).Center; - if (viewCullingArea.Contains(center)) - { - SnapPoint dummySnapPoint = this._dummySnapPoints[num2]; - dummySnapPoint.ThisIsAHackThatChangesTheSnapPointsInfo(Vector2.Zero, center.ToVector2() - vector2, num2); - dummySnapPoint.Calculate((UIElement) this); - ++num2; - snapPointList.Add(dummySnapPoint); - } - } - foreach (UIElement element in this.Elements) - snapPointList.AddRange((IEnumerable) element.GetSnapPoints()); - return snapPointList; - } - - public void UpdateSize() - { - int num = this.GetDimensions().ToRectangle().Width / 44; - this._itemsPerLine = num; - this.MinHeight.Set((float) (44 * (int) Math.Ceiling((double) this._itemIdsAvailableToShow.Count / (double) num)), 0.0f); - } - } -} diff --git a/GameContent/UI/Elements/UIGenProgressBar.cs b/GameContent/UI/Elements/UIGenProgressBar.cs index 7e49611..7306622 100644 --- a/GameContent/UI/Elements/UIGenProgressBar.cs +++ b/GameContent/UI/Elements/UIGenProgressBar.cs @@ -1,35 +1,35 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.Elements.UIGenProgressBar -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; +using Terraria.Graphics; using Terraria.UI; namespace Terraria.GameContent.UI.Elements { public class UIGenProgressBar : UIElement { - private Asset _texOuterCrimson; - private Asset _texOuterCorrupt; - private Asset _texOuterLower; + private Texture2D _texInnerDirt; + private Texture2D _texOuterCrimson; + private Texture2D _texOuterCorrupt; + private Texture2D _texOuterLower; private float _visualOverallProgress; private float _targetOverallProgress; private float _visualCurrentProgress; private float _targetCurrentProgress; - private int _smallBarWidth = 508; - private int _longBarWidth = 570; public UIGenProgressBar() { if (Main.netMode != 2) { - this._texOuterCorrupt = Main.Assets.Request("Images/UI/WorldGen/Outer_Corrupt", (AssetRequestMode) 1); - this._texOuterCrimson = Main.Assets.Request("Images/UI/WorldGen/Outer_Crimson", (AssetRequestMode) 1); - this._texOuterLower = Main.Assets.Request("Images/UI/WorldGen/Outer_Lower", (AssetRequestMode) 1); + this._texInnerDirt = TextureManager.Load("Images/UI/WorldGen/Outer Dirt"); + this._texOuterCorrupt = TextureManager.Load("Images/UI/WorldGen/Outer Corrupt"); + this._texOuterCrimson = TextureManager.Load("Images/UI/WorldGen/Outer Crimson"); + this._texOuterLower = TextureManager.Load("Images/UI/WorldGen/Outer Lower"); } this.Recalculate(); } @@ -51,26 +51,21 @@ namespace Terraria.GameContent.UI.Elements protected override void DrawSelf(SpriteBatch spriteBatch) { - if (!this._texOuterCorrupt.IsLoaded || !this._texOuterCrimson.IsLoaded || !this._texOuterLower.IsLoaded) - return; - bool flag = WorldGen.crimson; - if (WorldGen.drunkWorldGen && Main.rand.Next(2) == 0) - flag = !flag; this._visualOverallProgress = this._targetOverallProgress; this._visualCurrentProgress = this._targetCurrentProgress; CalculatedStyle dimensions = this.GetDimensions(); - int completedWidth1 = (int) ((double) this._visualOverallProgress * (double) this._longBarWidth); - int completedWidth2 = (int) ((double) this._visualCurrentProgress * (double) this._smallBarWidth); + int completedWidth1 = (int) ((double) this._visualOverallProgress * 504.0); + int completedWidth2 = (int) ((double) this._visualCurrentProgress * 504.0); Vector2 vector2 = new Vector2(dimensions.X, dimensions.Y); Color filled = new Color(); - filled.PackedValue = flag ? 4286836223U : 4283888223U; - this.DrawFilling2(spriteBatch, vector2 + new Vector2(20f, 40f), 16, completedWidth1, this._longBarWidth, filled, Color.Lerp(filled, Color.Black, 0.5f), new Color(48, 48, 48)); + filled.PackedValue = WorldGen.crimson ? 4286836223U : 4283888223U; + this.DrawFilling2(spriteBatch, vector2 + new Vector2(20f, 40f), 16, completedWidth1, 564, filled, Color.Lerp(filled, Color.Black, 0.5f), new Color(48, 48, 48)); filled.PackedValue = 4290947159U; - this.DrawFilling2(spriteBatch, vector2 + new Vector2(50f, 60f), 8, completedWidth2, this._smallBarWidth, filled, Color.Lerp(filled, Color.Black, 0.5f), new Color(33, 33, 33)); + this.DrawFilling2(spriteBatch, vector2 + new Vector2(50f, 60f), 8, completedWidth2, 504, filled, Color.Lerp(filled, Color.Black, 0.5f), new Color(33, 33, 33)); Rectangle rectangle = this.GetDimensions().ToRectangle(); rectangle.X -= 8; - spriteBatch.Draw(flag ? this._texOuterCrimson.Value : this._texOuterCorrupt.Value, rectangle.TopLeft(), Color.White); - spriteBatch.Draw(this._texOuterLower.Value, rectangle.TopLeft() + new Vector2(44f, 60f), Color.White); + spriteBatch.Draw(WorldGen.crimson ? this._texOuterCrimson : this._texOuterCorrupt, rectangle.TopLeft(), Color.White); + spriteBatch.Draw(this._texOuterLower, rectangle.TopLeft() + new Vector2(44f, 60f), Color.White); } private void DrawFilling( @@ -100,8 +95,8 @@ namespace Terraria.GameContent.UI.Elements } if (texShadow != null) spritebatch.Draw(texShadow, topLeft, new Rectangle?(new Rectangle(0, 0, completedWidth, texShadow.Height)), Color.White); - spritebatch.Draw(TextureAssets.MagicPixel.Value, new Rectangle((int) topLeft.X + completedWidth, (int) topLeft.Y, totalWidth - completedWidth, tex.Height), new Rectangle?(new Rectangle(0, 0, 1, 1)), empty); - spritebatch.Draw(TextureAssets.MagicPixel.Value, new Rectangle((int) topLeft.X + completedWidth - 2, (int) topLeft.Y, 2, tex.Height), new Rectangle?(new Rectangle(0, 0, 1, 1)), separator); + spritebatch.Draw(Main.magicPixel, new Rectangle((int) topLeft.X + completedWidth, (int) topLeft.Y, totalWidth - completedWidth, tex.Height), new Rectangle?(new Rectangle(0, 0, 1, 1)), empty); + spritebatch.Draw(Main.magicPixel, new Rectangle((int) topLeft.X + completedWidth - 2, (int) topLeft.Y, 2, tex.Height), new Rectangle?(new Rectangle(0, 0, 1, 1)), separator); } private void DrawFilling2( @@ -116,9 +111,9 @@ namespace Terraria.GameContent.UI.Elements { if (completedWidth % 2 != 0) --completedWidth; - spritebatch.Draw(TextureAssets.MagicPixel.Value, new Rectangle((int) topLeft.X, (int) topLeft.Y, completedWidth, height), new Rectangle?(new Rectangle(0, 0, 1, 1)), filled); - spritebatch.Draw(TextureAssets.MagicPixel.Value, new Rectangle((int) topLeft.X + completedWidth, (int) topLeft.Y, totalWidth - completedWidth, height), new Rectangle?(new Rectangle(0, 0, 1, 1)), empty); - spritebatch.Draw(TextureAssets.MagicPixel.Value, new Rectangle((int) topLeft.X + completedWidth - 2, (int) topLeft.Y, 2, height), new Rectangle?(new Rectangle(0, 0, 1, 1)), separator); + spritebatch.Draw(Main.magicPixel, new Rectangle((int) topLeft.X, (int) topLeft.Y, completedWidth, height), new Rectangle?(new Rectangle(0, 0, 1, 1)), filled); + spritebatch.Draw(Main.magicPixel, new Rectangle((int) topLeft.X + completedWidth, (int) topLeft.Y, totalWidth - completedWidth, height), new Rectangle?(new Rectangle(0, 0, 1, 1)), empty); + spritebatch.Draw(Main.magicPixel, new Rectangle((int) topLeft.X + completedWidth - 2, (int) topLeft.Y, 2, height), new Rectangle?(new Rectangle(0, 0, 1, 1)), separator); } } } diff --git a/GameContent/UI/Elements/UIHairStyleButton.cs b/GameContent/UI/Elements/UIHairStyleButton.cs deleted file mode 100644 index 8eeda1b..0000000 --- a/GameContent/UI/Elements/UIHairStyleButton.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UIHairStyleButton -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria.Audio; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UIHairStyleButton : UIImageButton - { - private readonly Player _player; - public readonly int HairStyleId; - private readonly Asset _selectedBorderTexture; - private readonly Asset _hoveredBorderTexture; - private bool _hovered; - private bool _soundedHover; - - public UIHairStyleButton(Player player, int hairStyleId) - : base(Main.Assets.Request("Images/UI/CharCreation/CategoryPanel", (AssetRequestMode) 1)) - { - this._player = player; - this.HairStyleId = hairStyleId; - this.Width = StyleDimension.FromPixels(44f); - this.Height = StyleDimension.FromPixels(44f); - this._selectedBorderTexture = Main.Assets.Request("Images/UI/CharCreation/CategoryPanelHighlight", (AssetRequestMode) 1); - this._hoveredBorderTexture = Main.Assets.Request("Images/UI/CharCreation/CategoryPanelBorder", (AssetRequestMode) 1); - } - - protected override void DrawSelf(SpriteBatch spriteBatch) - { - if (this._hovered) - { - if (!this._soundedHover) - SoundEngine.PlaySound(12); - this._soundedHover = true; - } - else - this._soundedHover = false; - Vector2 vector2 = new Vector2(-5f, -5f); - base.DrawSelf(spriteBatch); - if (this._player.hair == this.HairStyleId) - spriteBatch.Draw(this._selectedBorderTexture.Value, this.GetDimensions().Center() - this._selectedBorderTexture.Size() / 2f, Color.White); - if (this._hovered) - spriteBatch.Draw(this._hoveredBorderTexture.Value, this.GetDimensions().Center() - this._hoveredBorderTexture.Size() / 2f, Color.White); - int hair = this._player.hair; - this._player.hair = this.HairStyleId; - Main.PlayerRenderer.DrawPlayerHead(Main.Camera, this._player, this.GetDimensions().Center() + vector2); - this._player.hair = hair; - } - - public override void MouseDown(UIMouseEvent evt) - { - this._player.hair = this.HairStyleId; - SoundEngine.PlaySound(12); - base.MouseDown(evt); - } - - public override void MouseOver(UIMouseEvent evt) - { - base.MouseOver(evt); - this._hovered = true; - } - - public override void MouseOut(UIMouseEvent evt) - { - base.MouseOut(evt); - this._hovered = false; - } - } -} diff --git a/GameContent/UI/Elements/UIHeader.cs b/GameContent/UI/Elements/UIHeader.cs index 0a0b29c..e6f3582 100644 --- a/GameContent/UI/Elements/UIHeader.cs +++ b/GameContent/UI/Elements/UIHeader.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.Elements.UIHeader -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -23,7 +23,7 @@ namespace Terraria.GameContent.UI.Elements if (!(this._text != value)) return; this._text = value; - Vector2 vector2 = FontAssets.DeathText.Value.MeasureString(this.Text); + Vector2 vector2 = Main.fontDeathText.MeasureString(this.Text); this.Width.Pixels = vector2.X; this.Height.Pixels = vector2.Y; this.Width.Precent = 0.0f; @@ -39,12 +39,7 @@ namespace Terraria.GameContent.UI.Elements protected override void DrawSelf(SpriteBatch spriteBatch) { CalculatedStyle dimensions = this.GetDimensions(); - float num = 1.2f; - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.DeathText.Value, this.Text, new Vector2(dimensions.X - num, dimensions.Y - num), Color.Black); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.DeathText.Value, this.Text, new Vector2(dimensions.X + num, dimensions.Y - num), Color.Black); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.DeathText.Value, this.Text, new Vector2(dimensions.X - num, dimensions.Y + num), Color.Black); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.DeathText.Value, this.Text, new Vector2(dimensions.X + num, dimensions.Y + num), Color.Black); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.DeathText.Value, this.Text, new Vector2(dimensions.X, dimensions.Y), Color.White); + DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, Main.fontDeathText, this.Text, new Vector2(dimensions.X, dimensions.Y), Color.White); } } } diff --git a/GameContent/UI/Elements/UIHorizontalSeparator.cs b/GameContent/UI/Elements/UIHorizontalSeparator.cs deleted file mode 100644 index 314d23e..0000000 --- a/GameContent/UI/Elements/UIHorizontalSeparator.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UIHorizontalSeparator -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UIHorizontalSeparator : UIElement - { - private Asset _texture; - public Color Color; - public int EdgeWidth; - - public UIHorizontalSeparator(int EdgeWidth = 2, bool highlightSideUp = true) - { - this.Color = Color.White; - this._texture = !highlightSideUp ? Main.Assets.Request("Images/UI/CharCreation/Separator2", (AssetRequestMode) 1) : Main.Assets.Request("Images/UI/CharCreation/Separator1", (AssetRequestMode) 1); - this.Width.Set((float) this._texture.Width(), 0.0f); - this.Height.Set((float) this._texture.Height(), 0.0f); - } - - protected override void DrawSelf(SpriteBatch spriteBatch) - { - CalculatedStyle dimensions = this.GetDimensions(); - Utils.DrawPanel(this._texture.Value, this.EdgeWidth, 0, spriteBatch, dimensions.Position(), dimensions.Width, this.Color); - } - - public override bool ContainsPoint(Vector2 point) => false; - } -} diff --git a/GameContent/UI/Elements/UIImage.cs b/GameContent/UI/Elements/UIImage.cs index 138c6c9..b5a0154 100644 --- a/GameContent/UI/Elements/UIImage.cs +++ b/GameContent/UI/Elements/UIImage.cs @@ -1,55 +1,38 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.Elements.UIImage -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using Terraria.UI; namespace Terraria.GameContent.UI.Elements { public class UIImage : UIElement { - private Asset _texture; + private Texture2D _texture; public float ImageScale = 1f; - public float Rotation; - public bool ScaleToFit; - public Color Color = Color.White; - public Vector2 NormalizedOrigin = Vector2.Zero; - public bool RemoveFloatingPointsFromDrawPosition; - public UIImage(Asset texture) + public UIImage(Texture2D texture) { this._texture = texture; - this.Width.Set((float) this._texture.Width(), 0.0f); - this.Height.Set((float) this._texture.Height(), 0.0f); + this.Width.Set((float) this._texture.Width, 0.0f); + this.Height.Set((float) this._texture.Height, 0.0f); } - public void SetImage(Asset texture) + public void SetImage(Texture2D texture) { this._texture = texture; - this.Width.Set((float) this._texture.Width(), 0.0f); - this.Height.Set((float) this._texture.Height(), 0.0f); + this.Width.Set((float) this._texture.Width, 0.0f); + this.Height.Set((float) this._texture.Height, 0.0f); } protected override void DrawSelf(SpriteBatch spriteBatch) { CalculatedStyle dimensions = this.GetDimensions(); - if (this.ScaleToFit) - { - spriteBatch.Draw(this._texture.Value, dimensions.ToRectangle(), this.Color); - } - else - { - Vector2 vector2_1 = this._texture.Value.Size(); - Vector2 vector2_2 = dimensions.Position() + vector2_1 * (1f - this.ImageScale) / 2f + vector2_1 * this.NormalizedOrigin; - if (this.RemoveFloatingPointsFromDrawPosition) - vector2_2 = vector2_2.Floor(); - spriteBatch.Draw(this._texture.Value, vector2_2, new Rectangle?(), this.Color, this.Rotation, vector2_1 * this.NormalizedOrigin, this.ImageScale, SpriteEffects.None, 0.0f); - } + spriteBatch.Draw(this._texture, dimensions.Position() + this._texture.Size() * (1f - this.ImageScale) / 2f, new Rectangle?(), Color.White, 0.0f, Vector2.Zero, this.ImageScale, SpriteEffects.None, 0.0f); } } } diff --git a/GameContent/UI/Elements/UIImageButton.cs b/GameContent/UI/Elements/UIImageButton.cs index 5ef509b..ff414e5 100644 --- a/GameContent/UI/Elements/UIImageButton.cs +++ b/GameContent/UI/Elements/UIImageButton.cs @@ -1,57 +1,47 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.Elements.UIImageButton -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria.Audio; using Terraria.UI; namespace Terraria.GameContent.UI.Elements { public class UIImageButton : UIElement { - private Asset _texture; + private Texture2D _texture; private float _visibilityActive = 1f; private float _visibilityInactive = 0.4f; - private Asset _borderTexture; - public UIImageButton(Asset texture) + public UIImageButton(Texture2D texture) { this._texture = texture; - this.Width.Set((float) this._texture.Width(), 0.0f); - this.Height.Set((float) this._texture.Height(), 0.0f); + this.Width.Set((float) this._texture.Width, 0.0f); + this.Height.Set((float) this._texture.Height, 0.0f); } - public void SetHoverImage(Asset texture) => this._borderTexture = texture; - - public void SetImage(Asset texture) + public void SetImage(Texture2D texture) { this._texture = texture; - this.Width.Set((float) this._texture.Width(), 0.0f); - this.Height.Set((float) this._texture.Height(), 0.0f); + this.Width.Set((float) this._texture.Width, 0.0f); + this.Height.Set((float) this._texture.Height, 0.0f); } protected override void DrawSelf(SpriteBatch spriteBatch) { CalculatedStyle dimensions = this.GetDimensions(); - spriteBatch.Draw(this._texture.Value, dimensions.Position(), Color.White * (this.IsMouseHovering ? this._visibilityActive : this._visibilityInactive)); - if (this._borderTexture == null || !this.IsMouseHovering) - return; - spriteBatch.Draw(this._borderTexture.Value, dimensions.Position(), Color.White); + spriteBatch.Draw(this._texture, dimensions.Position(), Color.White * (this.IsMouseHovering ? this._visibilityActive : this._visibilityInactive)); } public override void MouseOver(UIMouseEvent evt) { base.MouseOver(evt); - SoundEngine.PlaySound(12); + Main.PlaySound(12); } - public override void MouseOut(UIMouseEvent evt) => base.MouseOut(evt); - public void SetVisibility(float whenActive, float whenInactive) { this._visibilityActive = MathHelper.Clamp(whenActive, 0.0f, 1f); diff --git a/GameContent/UI/Elements/UIImageFramed.cs b/GameContent/UI/Elements/UIImageFramed.cs index 4334c1d..9a32b43 100644 --- a/GameContent/UI/Elements/UIImageFramed.cs +++ b/GameContent/UI/Elements/UIImageFramed.cs @@ -1,33 +1,30 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.Elements.UIImageFramed -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using Terraria.UI; namespace Terraria.GameContent.UI.Elements { - public class UIImageFramed : UIElement, IColorable + public class UIImageFramed : UIElement { - private Asset _texture; + private Texture2D _texture; private Rectangle _frame; + public Color Color = Color.White; - public Color Color { get; set; } - - public UIImageFramed(Asset texture, Rectangle frame) + public UIImageFramed(Texture2D texture, Rectangle frame) { this._texture = texture; this._frame = frame; this.Width.Set((float) this._frame.Width, 0.0f); this.Height.Set((float) this._frame.Height, 0.0f); - this.Color = Color.White; } - public void SetImage(Asset texture, Rectangle frame) + public void SetImage(Texture2D texture, Rectangle frame) { this._texture = texture; this._frame = frame; @@ -42,21 +39,10 @@ namespace Terraria.GameContent.UI.Elements this.Height.Set((float) this._frame.Height, 0.0f); } - public void SetFrame( - int frameCountHorizontal, - int frameCountVertical, - int frameX, - int frameY, - int sizeOffsetX, - int sizeOffsetY) - { - this.SetFrame(this._texture.Frame(frameCountHorizontal, frameCountVertical, frameX, frameY).OffsetSize(sizeOffsetX, sizeOffsetY)); - } - protected override void DrawSelf(SpriteBatch spriteBatch) { CalculatedStyle dimensions = this.GetDimensions(); - spriteBatch.Draw(this._texture.Value, dimensions.Position(), new Rectangle?(this._frame), this.Color); + spriteBatch.Draw(this._texture, dimensions.Position(), new Rectangle?(this._frame), this.Color); } } } diff --git a/GameContent/UI/Elements/UIItemIcon.cs b/GameContent/UI/Elements/UIItemIcon.cs deleted file mode 100644 index e2853db..0000000 --- a/GameContent/UI/Elements/UIItemIcon.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UIItemIcon -// 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; -using Microsoft.Xna.Framework.Graphics; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UIItemIcon : UIElement - { - private Item _item; - private bool _blackedOut; - - public UIItemIcon(Item item, bool blackedOut) - { - this._item = item; - this.Width.Set(32f, 0.0f); - this.Height.Set(32f, 0.0f); - this._blackedOut = blackedOut; - } - - protected override void DrawSelf(SpriteBatch spriteBatch) - { - CalculatedStyle dimensions = this.GetDimensions(); - Main.DrawItemIcon(spriteBatch, this._item, dimensions.Center(), this._blackedOut ? Color.Black : Color.White, 32f); - } - } -} diff --git a/GameContent/UI/Elements/UIItemSlot.cs b/GameContent/UI/Elements/UIItemSlot.cs deleted file mode 100644 index aa5aa88..0000000 --- a/GameContent/UI/Elements/UIItemSlot.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UIItemSlot -// 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; -using Microsoft.Xna.Framework.Graphics; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UIItemSlot : UIElement - { - private Item[] _itemArray; - private int _itemIndex; - private int _itemSlotContext; - - public UIItemSlot(Item[] itemArray, int itemIndex, int itemSlotContext) - { - this._itemArray = itemArray; - this._itemIndex = itemIndex; - this._itemSlotContext = itemSlotContext; - this.Width = new StyleDimension(48f, 0.0f); - this.Height = new StyleDimension(48f, 0.0f); - } - - private void HandleItemSlotLogic() - { - if (!this.IsMouseHovering) - return; - Main.LocalPlayer.mouseInterface = true; - Item inv = this._itemArray[this._itemIndex]; - ItemSlot.OverrideHover(ref inv, this._itemSlotContext); - ItemSlot.LeftClick(ref inv, this._itemSlotContext); - ItemSlot.RightClick(ref inv, this._itemSlotContext); - ItemSlot.MouseHover(ref inv, this._itemSlotContext); - this._itemArray[this._itemIndex] = inv; - } - - protected override void DrawSelf(SpriteBatch spriteBatch) - { - this.HandleItemSlotLogic(); - Item inv = this._itemArray[this._itemIndex]; - Vector2 position = this.GetDimensions().Center() + new Vector2(52f, 52f) * -0.5f * Main.inventoryScale; - ItemSlot.Draw(spriteBatch, ref inv, this._itemSlotContext, position); - } - } -} diff --git a/GameContent/UI/Elements/UIKeybindingListItem.cs b/GameContent/UI/Elements/UIKeybindingListItem.cs index c7aa59b..df211f1 100644 --- a/GameContent/UI/Elements/UIKeybindingListItem.cs +++ b/GameContent/UI/Elements/UIKeybindingListItem.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.Elements.UIKeybindingListItem -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -54,7 +54,7 @@ namespace Terraria.GameContent.UI.Elements Utils.DrawSettingsPanel(spriteBatch, position, num2, color); position.X += 8f; position.Y += 2f + num1; - ChatManager.DrawColorCodedStringWithShadow(spriteBatch, FontAssets.ItemStack.Value, this.GetFriendlyName(), position, baseColor, 0.0f, Vector2.Zero, baseScale, num2); + ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontItemStack, this.GetFriendlyName(), position, baseColor, 0.0f, Vector2.Zero, baseScale, num2); position.X -= 17f; string text = this.GenInput(PlayerInput.CurrentProfile.InputModes[this._inputmode].KeyStatus[this._keybind]); if (string.IsNullOrEmpty(text)) @@ -63,12 +63,12 @@ namespace Terraria.GameContent.UI.Elements if (!flag) baseColor = new Color(80, 80, 80); } - Vector2 stringSize = ChatManager.GetStringSize(FontAssets.ItemStack.Value, text, baseScale); + Vector2 stringSize = ChatManager.GetStringSize(Main.fontItemStack, text, baseScale); position = new Vector2((float) ((double) dimensions.X + (double) dimensions.Width - (double) stringSize.X - 10.0), dimensions.Y + 2f + num1); if (this._inputmode == InputMode.XBoxGamepad || this._inputmode == InputMode.XBoxGamepadUI) position += new Vector2(0.0f, -3f); GlyphTagHandler.GlyphsScale = 0.85f; - ChatManager.DrawColorCodedStringWithShadow(spriteBatch, FontAssets.ItemStack.Value, text, position, baseColor, 0.0f, Vector2.Zero, baseScale, num2); + ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontItemStack, text, position, baseColor, 0.0f, Vector2.Zero, baseScale, num2); GlyphTagHandler.GlyphsScale = 1f; } @@ -188,8 +188,6 @@ namespace Terraria.GameContent.UI.Elements return Lang.menu[160].Value; case "Throw": return Lang.menu[153].Value; - case "ToggleCreativeMenu": - return Language.GetTextValue("UI.ToggleCreativeMenu"); case "Up": return Lang.menu[148].Value; case "ViewZoomIn": diff --git a/GameContent/UI/Elements/UIKeybindingSimpleListItem.cs b/GameContent/UI/Elements/UIKeybindingSimpleListItem.cs index 5debbd0..be23ddf 100644 --- a/GameContent/UI/Elements/UIKeybindingSimpleListItem.cs +++ b/GameContent/UI/Elements/UIKeybindingSimpleListItem.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.Elements.UIKeybindingSimpleListItem -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -38,9 +38,9 @@ namespace Terraria.GameContent.UI.Elements position.X += 8f; position.Y += 2f + num1; string text = this._GetTextFunction(); - Vector2 stringSize = ChatManager.GetStringSize(FontAssets.ItemStack.Value, text, baseScale); + Vector2 stringSize = ChatManager.GetStringSize(Main.fontItemStack, text, baseScale); position.X = (float) ((double) dimensions.X + (double) dimensions.Width / 2.0 - (double) stringSize.X / 2.0); - ChatManager.DrawColorCodedStringWithShadow(spriteBatch, FontAssets.ItemStack.Value, text, position, baseColor, 0.0f, Vector2.Zero, baseScale, num2); + ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontItemStack, text, position, baseColor, 0.0f, Vector2.Zero, baseScale, num2); } } } diff --git a/GameContent/UI/Elements/UIKeybindingSliderItem.cs b/GameContent/UI/Elements/UIKeybindingSliderItem.cs index dc25c4f..5463dea 100644 --- a/GameContent/UI/Elements/UIKeybindingSliderItem.cs +++ b/GameContent/UI/Elements/UIKeybindingSliderItem.cs @@ -1,14 +1,14 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.Elements.UIKeybindingSliderItem -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using System; using Terraria.GameInput; +using Terraria.Graphics; using Terraria.UI; using Terraria.UI.Chat; @@ -22,7 +22,7 @@ namespace Terraria.GameContent.UI.Elements private Action _SlideKeyboardAction; private Action _SlideGamepadAction; private int _sliderIDInPage; - private Asset _toggleTexture; + private Texture2D _toggleTexture; public UIKeybindingSliderItem( Func getText, @@ -33,7 +33,7 @@ namespace Terraria.GameContent.UI.Elements Color color) { this._color = color; - this._toggleTexture = Main.Assets.Request("Images/UI/Settings_Toggle", (AssetRequestMode) 1); + this._toggleTexture = TextureManager.Load("Images/UI/Settings_Toggle"); this._TextDisplayFunction = getText != null ? getText : (Func) (() => "???"); this._GetStatusFunction = getStatus != null ? getStatus : (Func) (() => 0.0f); this._SlideKeyboardAction = setStatusKeyboard != null ? setStatusKeyboard : (Action) (s => { }); @@ -68,9 +68,9 @@ namespace Terraria.GameContent.UI.Elements Utils.DrawSettingsPanel(spriteBatch, position, num2, color); position.X += 8f; position.Y += 2f + num1; - ChatManager.DrawColorCodedStringWithShadow(spriteBatch, FontAssets.ItemStack.Value, this._TextDisplayFunction(), position, baseColor, 0.0f, Vector2.Zero, baseScale, num2); + ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontItemStack, this._TextDisplayFunction(), position, baseColor, 0.0f, Vector2.Zero, baseScale, num2); position.X -= 17f; - TextureAssets.ColorBar.Frame(); + Main.colorBarTexture.Frame(); position = new Vector2((float) ((double) dimensions.X + (double) dimensions.Width - 10.0), dimensions.Y + 10f + num1); IngameOptions.valuePosition = position; float num3 = IngameOptions.DrawValueBar(spriteBatch, 1f, this._GetStatusFunction(), lockState); diff --git a/GameContent/UI/Elements/UIKeybindingToggleListItem.cs b/GameContent/UI/Elements/UIKeybindingToggleListItem.cs index ee8041c..1b75d0e 100644 --- a/GameContent/UI/Elements/UIKeybindingToggleListItem.cs +++ b/GameContent/UI/Elements/UIKeybindingToggleListItem.cs @@ -1,13 +1,13 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.Elements.UIKeybindingToggleListItem -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using System; +using Terraria.Graphics; using Terraria.UI; using Terraria.UI.Chat; @@ -18,12 +18,12 @@ namespace Terraria.GameContent.UI.Elements private Color _color; private Func _TextDisplayFunction; private Func _IsOnFunction; - private Asset _toggleTexture; + private Texture2D _toggleTexture; public UIKeybindingToggleListItem(Func getText, Func getStatus, Color color) { this._color = color; - this._toggleTexture = Main.Assets.Request("Images/UI/Settings_Toggle", (AssetRequestMode) 1); + this._toggleTexture = TextureManager.Load("Images/UI/Settings_Toggle"); this._TextDisplayFunction = getText != null ? getText : (Func) (() => "???"); this._IsOnFunction = getStatus != null ? getStatus : (Func) (() => false); } @@ -42,12 +42,12 @@ namespace Terraria.GameContent.UI.Elements Utils.DrawSettingsPanel(spriteBatch, position, num2, color); position.X += 8f; position.Y += 2f + num1; - ChatManager.DrawColorCodedStringWithShadow(spriteBatch, FontAssets.ItemStack.Value, this._TextDisplayFunction(), position, baseColor, 0.0f, Vector2.Zero, baseScale, num2); + ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontItemStack, this._TextDisplayFunction(), position, baseColor, 0.0f, Vector2.Zero, baseScale, num2); position.X -= 17f; - Rectangle rectangle = new Rectangle(this._IsOnFunction() ? (this._toggleTexture.Width() - 2) / 2 + 2 : 0, 0, (this._toggleTexture.Width() - 2) / 2, this._toggleTexture.Height()); + Rectangle rectangle = new Rectangle(this._IsOnFunction() ? (this._toggleTexture.Width - 2) / 2 + 2 : 0, 0, (this._toggleTexture.Width - 2) / 2, this._toggleTexture.Height); Vector2 vector2_2 = new Vector2((float) rectangle.Width, 0.0f); position = new Vector2((float) ((double) dimensions.X + (double) dimensions.Width - (double) vector2_2.X - 10.0), dimensions.Y + 2f + num1); - spriteBatch.Draw(this._toggleTexture.Value, position, new Rectangle?(rectangle), Color.White, 0.0f, Vector2.Zero, Vector2.One, SpriteEffects.None, 0.0f); + spriteBatch.Draw(this._toggleTexture, position, new Rectangle?(rectangle), Color.White, 0.0f, Vector2.Zero, Vector2.One, SpriteEffects.None, 0.0f); } } } diff --git a/GameContent/UI/Elements/UIList.cs b/GameContent/UI/Elements/UIList.cs index 8e6ae90..b07ee09 100644 --- a/GameContent/UI/Elements/UIList.cs +++ b/GameContent/UI/Elements/UIList.cs @@ -1,26 +1,24 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.Elements.UIList -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; -using System.Collections; using System.Collections.Generic; using Terraria.UI; namespace Terraria.GameContent.UI.Elements { - public class UIList : UIElement, IEnumerable, IEnumerable + public class UIList : UIElement { protected List _items = new List(); protected UIScrollbar _scrollbar; private UIElement _innerList = (UIElement) new UIList.UIInnerList(); private float _innerListHeight; public float ListPadding = 5f; - public Action> ManualSortMethod; public int Count => this._items.Count; @@ -88,11 +86,10 @@ namespace Terraria.GameContent.UI.Elements float pixels = 0.0f; for (int index = 0; index < this._items.Count; ++index) { - float num = this._items.Count == 1 ? 0.0f : this.ListPadding; this._items[index].Top.Set(pixels, 0.0f); this._items[index].Recalculate(); CalculatedStyle outerDimensions = this._items[index].GetOuterDimensions(); - pixels += outerDimensions.Height + num; + pixels += outerDimensions.Height + this.ListPadding; } this._innerListHeight = pixels; } @@ -112,10 +109,7 @@ namespace Terraria.GameContent.UI.Elements public void UpdateOrder() { - if (this.ManualSortMethod != null) - this.ManualSortMethod(this._items); - else - this._items.Sort(new Comparison(this.SortMethod)); + this._items.Sort(new Comparison(this.SortMethod)); this.UpdateScrollbar(); } @@ -139,10 +133,6 @@ namespace Terraria.GameContent.UI.Elements this.Recalculate(); } - public IEnumerator GetEnumerator() => ((IEnumerable) this._items).GetEnumerator(); - - IEnumerator IEnumerable.GetEnumerator() => (IEnumerator) ((IEnumerable) this._items).GetEnumerator(); - public delegate bool ElementSearchMethod(UIElement element); private class UIInnerList : UIElement @@ -161,8 +151,6 @@ namespace Terraria.GameContent.UI.Elements element.Draw(spriteBatch); } } - - public override Rectangle GetViewCullingArea() => this.Parent.GetDimensions().ToRectangle(); } } } diff --git a/GameContent/UI/Elements/UIPanel.cs b/GameContent/UI/Elements/UIPanel.cs index 0a35db4..3cc4100 100644 --- a/GameContent/UI/Elements/UIPanel.cs +++ b/GameContent/UI/Elements/UIPanel.cs @@ -1,74 +1,56 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.Elements.UIPanel -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; +using Terraria.Graphics; using Terraria.UI; namespace Terraria.GameContent.UI.Elements { public class UIPanel : UIElement { - private int _cornerSize = 12; - private int _barSize = 4; - private Asset _borderTexture; - private Asset _backgroundTexture; + private static int CORNER_SIZE = 12; + private static int BAR_SIZE = 4; + private static Texture2D _borderTexture; + private static Texture2D _backgroundTexture; public Color BorderColor = Color.Black; public Color BackgroundColor = new Color(63, 82, 151) * 0.7f; public UIPanel() { - if (this._borderTexture == null) - this._borderTexture = Main.Assets.Request("Images/UI/PanelBorder", (AssetRequestMode) 1); - if (this._backgroundTexture == null) - this._backgroundTexture = Main.Assets.Request("Images/UI/PanelBackground", (AssetRequestMode) 1); - this.SetPadding((float) this._cornerSize); - } - - public UIPanel( - Asset customBackground, - Asset customborder, - int customCornerSize = 12, - int customBarSize = 4) - { - if (this._borderTexture == null) - this._borderTexture = customborder; - if (this._backgroundTexture == null) - this._backgroundTexture = customBackground; - this._cornerSize = customCornerSize; - this._barSize = customBarSize; - this.SetPadding((float) this._cornerSize); + if (UIPanel._borderTexture == null) + UIPanel._borderTexture = TextureManager.Load("Images/UI/PanelBorder"); + if (UIPanel._backgroundTexture == null) + UIPanel._backgroundTexture = TextureManager.Load("Images/UI/PanelBackground"); + this.SetPadding((float) UIPanel.CORNER_SIZE); } private void DrawPanel(SpriteBatch spriteBatch, Texture2D texture, Color color) { CalculatedStyle dimensions = this.GetDimensions(); Point point1 = new Point((int) dimensions.X, (int) dimensions.Y); - Point point2 = new Point(point1.X + (int) dimensions.Width - this._cornerSize, point1.Y + (int) dimensions.Height - this._cornerSize); - int width = point2.X - point1.X - this._cornerSize; - int height = point2.Y - point1.Y - this._cornerSize; - spriteBatch.Draw(texture, new Rectangle(point1.X, point1.Y, this._cornerSize, this._cornerSize), new Rectangle?(new Rectangle(0, 0, this._cornerSize, this._cornerSize)), color); - spriteBatch.Draw(texture, new Rectangle(point2.X, point1.Y, this._cornerSize, this._cornerSize), new Rectangle?(new Rectangle(this._cornerSize + this._barSize, 0, this._cornerSize, this._cornerSize)), color); - spriteBatch.Draw(texture, new Rectangle(point1.X, point2.Y, this._cornerSize, this._cornerSize), new Rectangle?(new Rectangle(0, this._cornerSize + this._barSize, this._cornerSize, this._cornerSize)), color); - spriteBatch.Draw(texture, new Rectangle(point2.X, point2.Y, this._cornerSize, this._cornerSize), new Rectangle?(new Rectangle(this._cornerSize + this._barSize, this._cornerSize + this._barSize, this._cornerSize, this._cornerSize)), color); - spriteBatch.Draw(texture, new Rectangle(point1.X + this._cornerSize, point1.Y, width, this._cornerSize), new Rectangle?(new Rectangle(this._cornerSize, 0, this._barSize, this._cornerSize)), color); - spriteBatch.Draw(texture, new Rectangle(point1.X + this._cornerSize, point2.Y, width, this._cornerSize), new Rectangle?(new Rectangle(this._cornerSize, this._cornerSize + this._barSize, this._barSize, this._cornerSize)), color); - spriteBatch.Draw(texture, new Rectangle(point1.X, point1.Y + this._cornerSize, this._cornerSize, height), new Rectangle?(new Rectangle(0, this._cornerSize, this._cornerSize, this._barSize)), color); - spriteBatch.Draw(texture, new Rectangle(point2.X, point1.Y + this._cornerSize, this._cornerSize, height), new Rectangle?(new Rectangle(this._cornerSize + this._barSize, this._cornerSize, this._cornerSize, this._barSize)), color); - spriteBatch.Draw(texture, new Rectangle(point1.X + this._cornerSize, point1.Y + this._cornerSize, width, height), new Rectangle?(new Rectangle(this._cornerSize, this._cornerSize, this._barSize, this._barSize)), color); + Point point2 = new Point(point1.X + (int) dimensions.Width - UIPanel.CORNER_SIZE, point1.Y + (int) dimensions.Height - UIPanel.CORNER_SIZE); + int width = point2.X - point1.X - UIPanel.CORNER_SIZE; + int height = point2.Y - point1.Y - UIPanel.CORNER_SIZE; + spriteBatch.Draw(texture, new Rectangle(point1.X, point1.Y, UIPanel.CORNER_SIZE, UIPanel.CORNER_SIZE), new Rectangle?(new Rectangle(0, 0, UIPanel.CORNER_SIZE, UIPanel.CORNER_SIZE)), color); + spriteBatch.Draw(texture, new Rectangle(point2.X, point1.Y, UIPanel.CORNER_SIZE, UIPanel.CORNER_SIZE), new Rectangle?(new Rectangle(UIPanel.CORNER_SIZE + UIPanel.BAR_SIZE, 0, UIPanel.CORNER_SIZE, UIPanel.CORNER_SIZE)), color); + spriteBatch.Draw(texture, new Rectangle(point1.X, point2.Y, UIPanel.CORNER_SIZE, UIPanel.CORNER_SIZE), new Rectangle?(new Rectangle(0, UIPanel.CORNER_SIZE + UIPanel.BAR_SIZE, UIPanel.CORNER_SIZE, UIPanel.CORNER_SIZE)), color); + spriteBatch.Draw(texture, new Rectangle(point2.X, point2.Y, UIPanel.CORNER_SIZE, UIPanel.CORNER_SIZE), new Rectangle?(new Rectangle(UIPanel.CORNER_SIZE + UIPanel.BAR_SIZE, UIPanel.CORNER_SIZE + UIPanel.BAR_SIZE, UIPanel.CORNER_SIZE, UIPanel.CORNER_SIZE)), color); + spriteBatch.Draw(texture, new Rectangle(point1.X + UIPanel.CORNER_SIZE, point1.Y, width, UIPanel.CORNER_SIZE), new Rectangle?(new Rectangle(UIPanel.CORNER_SIZE, 0, UIPanel.BAR_SIZE, UIPanel.CORNER_SIZE)), color); + spriteBatch.Draw(texture, new Rectangle(point1.X + UIPanel.CORNER_SIZE, point2.Y, width, UIPanel.CORNER_SIZE), new Rectangle?(new Rectangle(UIPanel.CORNER_SIZE, UIPanel.CORNER_SIZE + UIPanel.BAR_SIZE, UIPanel.BAR_SIZE, UIPanel.CORNER_SIZE)), color); + spriteBatch.Draw(texture, new Rectangle(point1.X, point1.Y + UIPanel.CORNER_SIZE, UIPanel.CORNER_SIZE, height), new Rectangle?(new Rectangle(0, UIPanel.CORNER_SIZE, UIPanel.CORNER_SIZE, UIPanel.BAR_SIZE)), color); + spriteBatch.Draw(texture, new Rectangle(point2.X, point1.Y + UIPanel.CORNER_SIZE, UIPanel.CORNER_SIZE, height), new Rectangle?(new Rectangle(UIPanel.CORNER_SIZE + UIPanel.BAR_SIZE, UIPanel.CORNER_SIZE, UIPanel.CORNER_SIZE, UIPanel.BAR_SIZE)), color); + spriteBatch.Draw(texture, new Rectangle(point1.X + UIPanel.CORNER_SIZE, point1.Y + UIPanel.CORNER_SIZE, width, height), new Rectangle?(new Rectangle(UIPanel.CORNER_SIZE, UIPanel.CORNER_SIZE, UIPanel.BAR_SIZE, UIPanel.BAR_SIZE)), color); } protected override void DrawSelf(SpriteBatch spriteBatch) { - if (this._backgroundTexture != null) - this.DrawPanel(spriteBatch, this._backgroundTexture.Value, this.BackgroundColor); - if (this._borderTexture == null) - return; - this.DrawPanel(spriteBatch, this._borderTexture.Value, this.BorderColor); + this.DrawPanel(spriteBatch, UIPanel._backgroundTexture, this.BackgroundColor); + this.DrawPanel(spriteBatch, UIPanel._borderTexture, this.BorderColor); } } } diff --git a/GameContent/UI/Elements/UIParticleLayer.cs b/GameContent/UI/Elements/UIParticleLayer.cs deleted file mode 100644 index 2452b0b..0000000 --- a/GameContent/UI/Elements/UIParticleLayer.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UIParticleLayer -// 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; -using Microsoft.Xna.Framework.Graphics; -using Terraria.Graphics.Renderers; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UIParticleLayer : UIElement - { - public ParticleRenderer ParticleSystem; - public Vector2 AnchorPositionOffsetByPercents; - public Vector2 AnchorPositionOffsetByPixels; - - public UIParticleLayer() - { - this.IgnoresMouseInteraction = true; - this.ParticleSystem = new ParticleRenderer(); - this.OnUpdate += new UIElement.ElementEvent(this.ParticleSystemUpdate); - } - - private void ParticleSystemUpdate(UIElement affectedElement) => this.ParticleSystem.Update(); - - public override void Recalculate() - { - base.Recalculate(); - Rectangle rectangle = this.GetDimensions().ToRectangle(); - this.ParticleSystem.Settings.AnchorPosition = rectangle.TopLeft() + this.AnchorPositionOffsetByPercents * rectangle.Size() + this.AnchorPositionOffsetByPixels; - } - - protected override void DrawSelf(SpriteBatch spriteBatch) => this.ParticleSystem.Draw(spriteBatch); - - public void AddParticle(IParticle particle) => this.ParticleSystem.Add(particle); - } -} diff --git a/GameContent/UI/Elements/UIProgressBar.cs b/GameContent/UI/Elements/UIProgressBar.cs index 0c051f2..4617b72 100644 --- a/GameContent/UI/Elements/UIProgressBar.cs +++ b/GameContent/UI/Elements/UIProgressBar.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.Elements.UIProgressBar -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -43,7 +43,7 @@ namespace Terraria.GameContent.UI.Elements protected override void DrawSelf(SpriteBatch spriteBatch) { CalculatedStyle dimensions = this.GetDimensions(); - spriteBatch.Draw(TextureAssets.MagicPixel.Value, new Vector2(dimensions.X, dimensions.Y), new Rectangle?(), Color.Blue, 0.0f, Vector2.Zero, new Vector2(dimensions.Width, dimensions.Height / 1000f), SpriteEffects.None, 0.0f); + spriteBatch.Draw(Main.magicPixel, new Vector2(dimensions.X, dimensions.Y), new Rectangle?(), Color.Blue, 0.0f, Vector2.Zero, new Vector2(dimensions.Width, dimensions.Height / 1000f), SpriteEffects.None, 0.0f); } } } diff --git a/GameContent/UI/Elements/UIResourcePack.cs b/GameContent/UI/Elements/UIResourcePack.cs deleted file mode 100644 index 2635b82..0000000 --- a/GameContent/UI/Elements/UIResourcePack.cs +++ /dev/null @@ -1,119 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UIResourcePack -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria.IO; -using Terraria.Localization; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UIResourcePack : UIPanel - { - private const int PANEL_PADDING = 5; - private const int ICON_SIZE = 64; - private const int ICON_BORDER_PADDING = 4; - private const int HEIGHT_FLUFF = 10; - private const float HEIGHT = 102f; - private const float MIN_WIDTH = 102f; - private static readonly Color DefaultBackgroundColor = new Color(26, 40, 89) * 0.8f; - private static readonly Color DefaultBorderColor = new Color(13, 20, 44) * 0.8f; - private static readonly Color HoverBackgroundColor = new Color(46, 60, 119); - private static readonly Color HoverBorderColor = new Color(20, 30, 56); - public readonly ResourcePack ResourcePack; - private readonly Asset _iconBorderTexture; - - public int Order { get; set; } - - public UIElement ContentPanel { get; private set; } - - public UIResourcePack(ResourcePack pack, int order) - { - this.ResourcePack = pack; - this.Order = order; - this.BackgroundColor = UIResourcePack.DefaultBackgroundColor; - this.BorderColor = UIResourcePack.DefaultBorderColor; - this.Height = StyleDimension.FromPixels(102f); - this.MinHeight = this.Height; - this.MaxHeight = this.Height; - this.MinWidth = StyleDimension.FromPixels(102f); - this.Width = StyleDimension.FromPercent(1f); - this.SetPadding(5f); - this._iconBorderTexture = Main.Assets.Request("Images/UI/Achievement_Borders", (AssetRequestMode) 1); - this.OverflowHidden = true; - this.BuildChildren(); - } - - private void BuildChildren() - { - StyleDimension styleDimension1 = StyleDimension.FromPixels(77f); - StyleDimension styleDimension2 = StyleDimension.FromPixels(4f); - UIText uiText1 = new UIText(this.ResourcePack.Name); - uiText1.Left = styleDimension1; - uiText1.Top = styleDimension2; - UIText uiText2 = uiText1; - this.Append((UIElement) uiText2); - styleDimension2.Pixels += uiText2.GetOuterDimensions().Height + 6f; - UIText uiText3 = new UIText(Language.GetTextValue("UI.Author", (object) this.ResourcePack.Author), 0.7f); - uiText3.Left = styleDimension1; - uiText3.Top = styleDimension2; - UIText uiText4 = uiText3; - this.Append((UIElement) uiText4); - styleDimension2.Pixels += uiText4.GetOuterDimensions().Height + 10f; - Asset asset = Main.Assets.Request("Images/UI/Divider", (AssetRequestMode) 1); - UIImage uiImage1 = new UIImage(asset); - uiImage1.Left = StyleDimension.FromPixels(72f); - uiImage1.Top = styleDimension2; - uiImage1.Height = StyleDimension.FromPixels((float) asset.Height()); - uiImage1.Width = StyleDimension.FromPixelsAndPercent(-80f, 1f); - uiImage1.ScaleToFit = true; - UIImage uiImage2 = uiImage1; - this.Recalculate(); - this.Append((UIElement) uiImage2); - styleDimension2.Pixels += uiImage2.GetOuterDimensions().Height + 5f; - UIElement element = new UIElement() - { - Left = styleDimension1, - Top = styleDimension2, - Height = StyleDimension.FromPixels(92f - styleDimension2.Pixels), - Width = StyleDimension.FromPixelsAndPercent(-styleDimension1.Pixels, 1f) - }; - this.Append(element); - this.ContentPanel = element; - } - - protected override void DrawSelf(SpriteBatch spriteBatch) - { - base.DrawSelf(spriteBatch); - this.DrawIcon(spriteBatch); - } - - private void DrawIcon(SpriteBatch spriteBatch) - { - CalculatedStyle innerDimensions = this.GetInnerDimensions(); - spriteBatch.Draw(this.ResourcePack.Icon, new Rectangle((int) innerDimensions.X + 4, (int) innerDimensions.Y + 4 + 10, 64, 64), Color.White); - spriteBatch.Draw(this._iconBorderTexture.Value, new Rectangle((int) innerDimensions.X, (int) innerDimensions.Y + 10, 72, 72), Color.White); - } - - public override int CompareTo(object obj) => this.Order.CompareTo(((UIResourcePack) obj).Order); - - public override void MouseOver(UIMouseEvent evt) - { - base.MouseOver(evt); - this.BackgroundColor = UIResourcePack.HoverBackgroundColor; - this.BorderColor = UIResourcePack.HoverBorderColor; - } - - public override void MouseOut(UIMouseEvent evt) - { - base.MouseOut(evt); - this.BackgroundColor = UIResourcePack.DefaultBackgroundColor; - this.BorderColor = UIResourcePack.DefaultBorderColor; - } - } -} diff --git a/GameContent/UI/Elements/UIResourcePackInfoButton`1.cs b/GameContent/UI/Elements/UIResourcePackInfoButton`1.cs deleted file mode 100644 index 88d6616..0000000 --- a/GameContent/UI/Elements/UIResourcePackInfoButton`1.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UIResourcePackInfoButton`1 -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria.IO; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UIResourcePackInfoButton : UITextPanel - { - private readonly Asset _BasePanelTexture; - private readonly Asset _hoveredBorderTexture; - private ResourcePack _resourcePack; - - public ResourcePack ResourcePack - { - get => this._resourcePack; - set => this._resourcePack = value; - } - - public UIResourcePackInfoButton(T text, float textScale = 1f, bool large = false) - : base(text, textScale, large) - { - this._BasePanelTexture = Main.Assets.Request("Images/UI/CharCreation/PanelGrayscale", (AssetRequestMode) 1); - this._hoveredBorderTexture = Main.Assets.Request("Images/UI/CharCreation/CategoryPanelBorder", (AssetRequestMode) 1); - } - - protected override void DrawSelf(SpriteBatch spriteBatch) - { - if (this._drawPanel) - { - CalculatedStyle dimensions = this.GetDimensions(); - int num1 = 10; - int num2 = 10; - Utils.DrawSplicedPanel(spriteBatch, this._BasePanelTexture.Value, (int) dimensions.X, (int) dimensions.Y, (int) dimensions.Width, (int) dimensions.Height, num1, num1, num2, num2, Color.Lerp(Color.Black, this._color, 0.8f) * 0.5f); - if (this.IsMouseHovering) - Utils.DrawSplicedPanel(spriteBatch, this._hoveredBorderTexture.Value, (int) dimensions.X, (int) dimensions.Y, (int) dimensions.Width, (int) dimensions.Height, num1, num1, num2, num2, Color.White); - } - this.DrawText(spriteBatch); - } - } -} diff --git a/GameContent/UI/Elements/UIScrollbar.cs b/GameContent/UI/Elements/UIScrollbar.cs index 093fb73..3ce6b70 100644 --- a/GameContent/UI/Elements/UIScrollbar.cs +++ b/GameContent/UI/Elements/UIScrollbar.cs @@ -1,13 +1,12 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.Elements.UIScrollbar -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria.Audio; +using Terraria.Graphics; using Terraria.UI; namespace Terraria.GameContent.UI.Elements @@ -20,8 +19,8 @@ namespace Terraria.GameContent.UI.Elements private bool _isDragging; private bool _isHoveringOverHandle; private float _dragYOffset; - private Asset _texture; - private Asset _innerTexture; + private Texture2D _texture; + private Texture2D _innerTexture; public float ViewPosition { @@ -29,14 +28,12 @@ namespace Terraria.GameContent.UI.Elements set => this._viewPosition = MathHelper.Clamp(value, 0.0f, this._maxViewSize - this._viewSize); } - public bool CanScroll => (double) this._maxViewSize != (double) this._viewSize; - public UIScrollbar() { this.Width.Set(20f, 0.0f); this.MaxWidth.Set(20f, 0.0f); - this._texture = Main.Assets.Request("Images/UI/Scrollbar", (AssetRequestMode) 1); - this._innerTexture = Main.Assets.Request("Images/UI/ScrollbarInner", (AssetRequestMode) 1); + this._texture = TextureManager.Load("Images/UI/Scrollbar"); + this._innerTexture = TextureManager.Load("Images/UI/ScrollbarInner"); this.PaddingTop = 5f; this.PaddingBottom = 5f; } @@ -84,9 +81,9 @@ namespace Terraria.GameContent.UI.Elements int num = this._isHoveringOverHandle ? 1 : 0; this._isHoveringOverHandle = handleRectangle.Contains(new Point((int) mousePosition.X, (int) mousePosition.Y)); if (num == 0 && this._isHoveringOverHandle && Main.hasFocus) - SoundEngine.PlaySound(12); - this.DrawBar(spriteBatch, this._texture.Value, dimensions.ToRectangle(), Color.White); - this.DrawBar(spriteBatch, this._innerTexture.Value, handleRectangle, Color.White * (this._isDragging || this._isHoveringOverHandle ? 1f : 0.85f)); + Main.PlaySound(12); + this.DrawBar(spriteBatch, this._texture, dimensions.ToRectangle(), Color.White); + this.DrawBar(spriteBatch, this._innerTexture, handleRectangle, Color.White * (this._isDragging || this._isHoveringOverHandle ? 1f : 0.85f)); } public override void MouseDown(UIMouseEvent evt) diff --git a/GameContent/UI/Elements/UISearchBar.cs b/GameContent/UI/Elements/UISearchBar.cs deleted file mode 100644 index 152c32f..0000000 --- a/GameContent/UI/Elements/UISearchBar.cs +++ /dev/null @@ -1,170 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UISearchBar -// 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; -using Microsoft.Xna.Framework.Graphics; -using System; -using Terraria.Audio; -using Terraria.GameInput; -using Terraria.Localization; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UISearchBar : UIElement - { - private readonly LocalizedText _textToShowWhenEmpty; - private UITextBox _text; - private string actualContents; - private float _textScale; - private bool isWritingText; - - public event Action OnContentsChanged; - - public event Action OnStartTakingInput; - - public event Action OnEndTakingInput; - - public event Action OnCancledTakingInput; - - public event Action OnNeedingVirtualKeyboard; - - public UISearchBar(LocalizedText emptyContentText, float scale) - { - this._textToShowWhenEmpty = emptyContentText; - this._textScale = scale; - UITextBox uiTextBox1 = new UITextBox("", scale); - uiTextBox1.HAlign = 0.0f; - uiTextBox1.VAlign = 0.5f; - uiTextBox1.BackgroundColor = Color.Transparent; - uiTextBox1.BorderColor = Color.Transparent; - uiTextBox1.Width = new StyleDimension(0.0f, 1f); - uiTextBox1.Height = new StyleDimension(0.0f, 1f); - uiTextBox1.TextHAlign = 0.0f; - uiTextBox1.ShowInputTicker = false; - UITextBox uiTextBox2 = uiTextBox1; - this.Append((UIElement) uiTextBox2); - this._text = uiTextBox2; - } - - public void SetContents(string contents, bool forced = false) - { - if (this.actualContents == contents && !forced) - return; - this.actualContents = contents; - if (string.IsNullOrEmpty(this.actualContents)) - { - this._text.TextColor = Color.Gray; - this._text.SetText(this._textToShowWhenEmpty.Value, this._textScale, false); - } - else - { - this._text.TextColor = Color.White; - this._text.SetText(this.actualContents); - } - this.TrimDisplayIfOverElementDimensions(0); - if (this.OnContentsChanged == null) - return; - this.OnContentsChanged(contents); - } - - public void TrimDisplayIfOverElementDimensions(int padding) - { - CalculatedStyle dimensions1 = this.GetDimensions(); - if ((double) dimensions1.Width == 0.0 && (double) dimensions1.Height == 0.0) - return; - Point point1 = new Point((int) dimensions1.X, (int) dimensions1.Y); - Point point2 = new Point(point1.X + (int) dimensions1.Width, point1.Y + (int) dimensions1.Height); - Rectangle rectangle1 = new Rectangle(point1.X, point1.Y, point2.X - point1.X, point2.Y - point1.Y); - CalculatedStyle dimensions2 = this._text.GetDimensions(); - Point point3 = new Point((int) dimensions2.X, (int) dimensions2.Y); - Point point4 = new Point(point3.X + (int) dimensions2.Width, point3.Y + (int) dimensions2.Height); - Rectangle rectangle2 = new Rectangle(point3.X, point3.Y, point4.X - point3.X, point4.Y - point3.Y); - int num = 0; - for (; rectangle2.Right > rectangle1.Right - padding && this._text.Text.Length > 0; rectangle2 = new Rectangle(point3.X, point3.Y, point4.X - point3.X, point4.Y - point3.Y)) - { - this._text.SetText(this._text.Text.Substring(0, this._text.Text.Length - 1)); - ++num; - this.RecalculateChildren(); - CalculatedStyle dimensions3 = this._text.GetDimensions(); - point3 = new Point((int) dimensions3.X, (int) dimensions3.Y); - point4 = new Point(point3.X + (int) dimensions3.Width, point3.Y + (int) dimensions3.Height); - } - if (num <= 0 || this._text.Text.Length <= 0) - return; - this._text.SetText(this._text.Text.Substring(0, this._text.Text.Length - 1) + "…"); - } - - public override void MouseDown(UIMouseEvent evt) => base.MouseDown(evt); - - public override void MouseOver(UIMouseEvent evt) - { - base.MouseOver(evt); - SoundEngine.PlaySound(12); - } - - public override void Update(GameTime gameTime) - { - if (this.isWritingText) - { - if (this.NeedsVirtualkeyboard()) - { - if (this.OnNeedingVirtualKeyboard == null) - return; - this.OnNeedingVirtualKeyboard(); - return; - } - PlayerInput.WritingText = true; - Main.CurrentInputTextTakerOverride = (object) this; - } - base.Update(gameTime); - } - - private bool NeedsVirtualkeyboard() => PlayerInput.UsingGamepad; - - protected override void DrawSelf(SpriteBatch spriteBatch) - { - base.DrawSelf(spriteBatch); - if (!this.isWritingText) - return; - PlayerInput.WritingText = true; - Main.instance.HandleIME(); - Vector2 position = new Vector2((float) (Main.screenWidth / 2), (float) (this._text.GetDimensions().ToRectangle().Bottom + 32)); - Main.instance.DrawWindowsIMEPanel(position, 0.5f); - string inputText = Main.GetInputText(this.actualContents); - if (Main.inputTextEnter) - this.ToggleTakingText(); - else if (Main.inputTextEscape) - { - this.ToggleTakingText(); - if (this.OnCancledTakingInput != null) - this.OnCancledTakingInput(); - } - this.SetContents(inputText); - position = new Vector2((float) (Main.screenWidth / 2), (float) (this._text.GetDimensions().ToRectangle().Bottom + 32)); - Main.instance.DrawWindowsIMEPanel(position, 0.5f); - } - - public void ToggleTakingText() - { - this.isWritingText = !this.isWritingText; - this._text.ShowInputTicker = this.isWritingText; - Main.clrInput(); - if (this.isWritingText) - { - if (this.OnStartTakingInput == null) - return; - this.OnStartTakingInput(); - } - else - { - if (this.OnEndTakingInput == null) - return; - this.OnEndTakingInput(); - } - } - } -} diff --git a/GameContent/UI/Elements/UISelectableTextPanel`1.cs b/GameContent/UI/Elements/UISelectableTextPanel`1.cs deleted file mode 100644 index a0b5c71..0000000 --- a/GameContent/UI/Elements/UISelectableTextPanel`1.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UISelectableTextPanel`1 -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using System; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UISelectableTextPanel : UITextPanel - { - private readonly Asset _BasePanelTexture; - private readonly Asset _hoveredBorderTexture; - private Func, bool> _isSelected; - - public Func, bool> IsSelected - { - get => this._isSelected; - set => this._isSelected = value; - } - - public UISelectableTextPanel(T text, float textScale = 1f, bool large = false) - : base(text, textScale, large) - { - this._BasePanelTexture = Main.Assets.Request("Images/UI/CharCreation/PanelGrayscale", (AssetRequestMode) 1); - this._hoveredBorderTexture = Main.Assets.Request("Images/UI/CharCreation/CategoryPanelBorder", (AssetRequestMode) 1); - } - - protected override void DrawSelf(SpriteBatch spriteBatch) - { - if (this._drawPanel) - { - CalculatedStyle dimensions = this.GetDimensions(); - int num1 = 4; - int num2 = 10; - int num3 = 10; - Utils.DrawSplicedPanel(spriteBatch, this._BasePanelTexture.Value, (int) dimensions.X, (int) dimensions.Y, (int) dimensions.Width, (int) dimensions.Height, num2, num2, num3, num3, Color.Lerp(Color.Black, this._color, 0.8f) * 0.5f); - if (this.IsSelected != null && this.IsSelected(this)) - Utils.DrawSplicedPanel(spriteBatch, this._BasePanelTexture.Value, (int) dimensions.X + num1, (int) dimensions.Y + num1, (int) dimensions.Width - num1 * 2, (int) dimensions.Height - num1 * 2, num2, num2, num3, num3, Color.Lerp(this._color, Color.White, 0.7f) * 0.5f); - if (this.IsMouseHovering) - Utils.DrawSplicedPanel(spriteBatch, this._hoveredBorderTexture.Value, (int) dimensions.X, (int) dimensions.Y, (int) dimensions.Width, (int) dimensions.Height, num2, num2, num3, num3, Color.White); - } - this.DrawText(spriteBatch); - } - } -} diff --git a/GameContent/UI/Elements/UISlicedImage.cs b/GameContent/UI/Elements/UISlicedImage.cs deleted file mode 100644 index a7db012..0000000 --- a/GameContent/UI/Elements/UISlicedImage.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UISlicedImage -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UISlicedImage : UIElement - { - private Asset _texture; - private Color _color; - private int _leftSliceDepth; - private int _rightSliceDepth; - private int _topSliceDepth; - private int _bottomSliceDepth; - - public Color Color - { - get => this._color; - set => this._color = value; - } - - public UISlicedImage(Asset texture) - { - this._texture = texture; - this.Width.Set((float) this._texture.Width(), 0.0f); - this.Height.Set((float) this._texture.Height(), 0.0f); - } - - public void SetImage(Asset texture) => this._texture = texture; - - protected override void DrawSelf(SpriteBatch spriteBatch) - { - CalculatedStyle dimensions = this.GetDimensions(); - Utils.DrawSplicedPanel(spriteBatch, this._texture.Value, (int) dimensions.X, (int) dimensions.Y, (int) dimensions.Width, (int) dimensions.Height, this._leftSliceDepth, this._rightSliceDepth, this._topSliceDepth, this._bottomSliceDepth, this._color); - } - - public void SetSliceDepths(int top, int bottom, int left, int right) - { - this._leftSliceDepth = left; - this._rightSliceDepth = right; - this._topSliceDepth = top; - this._bottomSliceDepth = bottom; - } - - public void SetSliceDepths(int fluff) - { - this._leftSliceDepth = fluff; - this._rightSliceDepth = fluff; - this._topSliceDepth = fluff; - this._bottomSliceDepth = fluff; - } - } -} diff --git a/GameContent/UI/Elements/UISliderBase.cs b/GameContent/UI/Elements/UISliderBase.cs deleted file mode 100644 index 8e2bead..0000000 --- a/GameContent/UI/Elements/UISliderBase.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UISliderBase -// 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 Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UISliderBase : UIElement - { - internal const int UsageLevel_NotSelected = 0; - internal const int UsageLevel_SelectedAndLocked = 1; - internal const int UsageLevel_OtherElementIsLocked = 2; - internal static UIElement CurrentLockedSlider; - internal static UIElement CurrentAimedSlider; - - internal int GetUsageLevel() - { - int num = 0; - if (UISliderBase.CurrentLockedSlider == this) - num = 1; - else if (UISliderBase.CurrentLockedSlider != null) - num = 2; - return num; - } - } -} diff --git a/GameContent/UI/Elements/UIText.cs b/GameContent/UI/Elements/UIText.cs index 31e6a2f..56f37c0 100644 --- a/GameContent/UI/Elements/UIText.cs +++ b/GameContent/UI/Elements/UIText.cs @@ -1,13 +1,11 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.Elements.UIText -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Graphics; -using System; using Terraria.Localization; using Terraria.UI; @@ -20,50 +18,18 @@ namespace Terraria.GameContent.UI.Elements private Vector2 _textSize = Vector2.Zero; private bool _isLarge; private Color _color = Color.White; - private bool _isWrapped; - public bool DynamicallyScaleDownToWidth; - private string _visibleText; - private string _lastTextReference; public string Text => this._text.ToString(); - public float TextOriginX { get; set; } - - public float WrappedTextBottomPadding { get; set; } - - public bool IsWrapped - { - get => this._isWrapped; - set - { - this._isWrapped = value; - this.InternalSetText(this._text, this._textScale, this._isLarge); - } - } - - public event Action OnInternalTextChange; - public Color TextColor { get => this._color; set => this._color = value; } - public UIText(string text, float textScale = 1f, bool large = false) - { - this.TextOriginX = 0.5f; - this.IsWrapped = false; - this.WrappedTextBottomPadding = 20f; - this.InternalSetText((object) text, textScale, large); - } + public UIText(string text, float textScale = 1f, bool large = false) => this.InternalSetText((object) text, textScale, large); - public UIText(LocalizedText text, float textScale = 1f, bool large = false) - { - this.TextOriginX = 0.5f; - this.IsWrapped = false; - this.WrappedTextBottomPadding = 20f; - this.InternalSetText((object) text, textScale, large); - } + public UIText(LocalizedText text, float textScale = 1f, bool large = false) => this.InternalSetText((object) text, textScale, large); public override void Recalculate() { @@ -79,49 +45,31 @@ namespace Terraria.GameContent.UI.Elements public void SetText(LocalizedText text, float textScale, bool large) => this.InternalSetText((object) text, textScale, large); + private void InternalSetText(object text, float textScale, bool large) + { + Vector2 vector2 = new Vector2((large ? Main.fontDeathText : Main.fontMouseText).MeasureString(text.ToString()).X, large ? 32f : 16f) * textScale; + this._text = text; + this._textScale = textScale; + this._textSize = vector2; + this._isLarge = large; + this.MinWidth.Set(vector2.X + this.PaddingLeft + this.PaddingRight, 0.0f); + this.MinHeight.Set(vector2.Y + this.PaddingTop + this.PaddingBottom, 0.0f); + } + protected override void DrawSelf(SpriteBatch spriteBatch) { base.DrawSelf(spriteBatch); - this.VerifyTextState(); CalculatedStyle innerDimensions = this.GetInnerDimensions(); Vector2 pos = innerDimensions.Position(); if (this._isLarge) pos.Y -= 10f * this._textScale; else pos.Y -= 2f * this._textScale; - pos.X += (innerDimensions.Width - this._textSize.X) * this.TextOriginX; - float textScale = this._textScale; - if (this.DynamicallyScaleDownToWidth && (double) this._textSize.X > (double) innerDimensions.Width) - textScale *= innerDimensions.Width / this._textSize.X; + pos.X += (float) (((double) innerDimensions.Width - (double) this._textSize.X) * 0.5); if (this._isLarge) - Utils.DrawBorderStringBig(spriteBatch, this._visibleText, pos, this._color, textScale); + Utils.DrawBorderStringBig(spriteBatch, this.Text, pos, this._color, this._textScale); else - Utils.DrawBorderString(spriteBatch, this._visibleText, pos, this._color, textScale); - } - - private void VerifyTextState() - { - if ((object) this._lastTextReference == (object) this.Text) - return; - this.InternalSetText(this._text, this._textScale, this._isLarge); - } - - private void InternalSetText(object text, float textScale, bool large) - { - DynamicSpriteFont dynamicSpriteFont = large ? FontAssets.DeathText.Value : FontAssets.MouseText.Value; - this._text = text; - this._isLarge = large; - this._textScale = textScale; - this._lastTextReference = this._text.ToString(); - this._visibleText = !this.IsWrapped ? this._lastTextReference : dynamicSpriteFont.CreateWrappedText(this._lastTextReference, this.GetInnerDimensions().Width / this._textScale); - Vector2 vector2_1 = dynamicSpriteFont.MeasureString(this._visibleText); - Vector2 vector2_2 = !this.IsWrapped ? new Vector2(vector2_1.X, large ? 32f : 16f) * textScale : new Vector2(vector2_1.X, vector2_1.Y + this.WrappedTextBottomPadding) * textScale; - this._textSize = vector2_2; - this.MinWidth.Set(vector2_2.X + this.PaddingLeft + this.PaddingRight, 0.0f); - this.MinHeight.Set(vector2_2.Y + this.PaddingTop + this.PaddingBottom, 0.0f); - if (this.OnInternalTextChange == null) - return; - this.OnInternalTextChange(); + Utils.DrawBorderString(spriteBatch, this.Text, pos, this._color, this._textScale); } } } diff --git a/GameContent/UI/Elements/UITextBox.cs b/GameContent/UI/Elements/UITextBox.cs index fbbaa07..97f941d 100644 --- a/GameContent/UI/Elements/UITextBox.cs +++ b/GameContent/UI/Elements/UITextBox.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.Elements.UITextBox -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -16,8 +16,6 @@ namespace Terraria.GameContent.UI.Elements private int _cursor; private int _frameCount; private int _maxLength = 20; - public bool ShowInputTicker = true; - public bool HideSelf; public UITextBox(string text, float textScale = 1f, bool large = false) : base(text, textScale, large) @@ -32,10 +30,8 @@ namespace Terraria.GameContent.UI.Elements public override void SetText(string text, float textScale, bool large) { - if (text == null) - text = ""; - if (text.Length > this._maxLength) - text = text.Substring(0, this._maxLength); + if (text.ToString().Length > this._maxLength) + text = text.ToString().Substring(0, this._maxLength); base.SetText(text, textScale, large); this._cursor = Math.Min(this.Text.Length, this._cursor); } @@ -65,21 +61,19 @@ namespace Terraria.GameContent.UI.Elements protected override void DrawSelf(SpriteBatch spriteBatch) { - if (this.HideSelf) - return; this._cursor = this.Text.Length; base.DrawSelf(spriteBatch); ++this._frameCount; - if ((this._frameCount %= 40) > 20 || !this.ShowInputTicker) + if ((this._frameCount %= 40) > 20) return; CalculatedStyle innerDimensions = this.GetInnerDimensions(); Vector2 pos = innerDimensions.Position(); - Vector2 vector2 = new Vector2((this.IsLarge ? FontAssets.DeathText.Value : FontAssets.MouseText.Value).MeasureString(this.Text.Substring(0, this._cursor)).X, this.IsLarge ? 32f : 16f) * this.TextScale; + Vector2 vector2 = new Vector2((this.IsLarge ? Main.fontDeathText : Main.fontMouseText).MeasureString(this.Text.Substring(0, this._cursor)).X, this.IsLarge ? 32f : 16f) * this.TextScale; if (this.IsLarge) pos.Y -= 8f * this.TextScale; else - pos.Y -= 2f * this.TextScale; - pos.X += (float) (((double) innerDimensions.Width - (double) this.TextSize.X) * (double) this.TextHAlign + (double) vector2.X - (this.IsLarge ? 8.0 : 4.0) * (double) this.TextScale + 6.0); + pos.Y += 2f * this.TextScale; + pos.X += (float) (((double) innerDimensions.Width - (double) this.TextSize.X) * 0.5 + (double) vector2.X - (this.IsLarge ? 8.0 : 4.0) * (double) this.TextScale + 6.0); if (this.IsLarge) Utils.DrawBorderStringBig(spriteBatch, "|", pos, this.TextColor, this.TextScale); else diff --git a/GameContent/UI/Elements/UITextPanel`1.cs b/GameContent/UI/Elements/UITextPanel`1.cs index 9a555e2..0440fb4 100644 --- a/GameContent/UI/Elements/UITextPanel`1.cs +++ b/GameContent/UI/Elements/UITextPanel`1.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.Elements.UITextPanel`1 -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -12,13 +12,12 @@ namespace Terraria.GameContent.UI.Elements { public class UITextPanel : UIPanel { - protected T _text; - protected float _textScale = 1f; - protected Vector2 _textSize = Vector2.Zero; - protected bool _isLarge; - protected Color _color = Color.White; - protected bool _drawPanel = true; - public float TextHAlign = 0.5f; + private T _text; + private float _textScale = 1f; + private Vector2 _textSize = Vector2.Zero; + private bool _isLarge; + private Color _color = Color.White; + private bool _drawPanel = true; public bool IsLarge => this._isLarge; @@ -56,7 +55,7 @@ namespace Terraria.GameContent.UI.Elements public virtual void SetText(T text, float textScale, bool large) { - Vector2 vector2 = new Vector2((large ? FontAssets.DeathText.Value : FontAssets.MouseText.Value).MeasureString(text.ToString()).X, large ? 32f : 16f) * textScale; + Vector2 vector2 = new Vector2((large ? Main.fontDeathText : Main.fontMouseText).MeasureString(text.ToString()).X, large ? 32f : 16f) * textScale; this._text = text; this._textScale = textScale; this._textSize = vector2; @@ -69,18 +68,13 @@ namespace Terraria.GameContent.UI.Elements { if (this._drawPanel) base.DrawSelf(spriteBatch); - this.DrawText(spriteBatch); - } - - protected void DrawText(SpriteBatch spriteBatch) - { CalculatedStyle innerDimensions = this.GetInnerDimensions(); Vector2 pos = innerDimensions.Position(); if (this._isLarge) pos.Y -= 10f * this._textScale * this._textScale; else pos.Y -= 2f * this._textScale; - pos.X += (innerDimensions.Width - this._textSize.X) * this.TextHAlign; + pos.X += (float) (((double) innerDimensions.Width - (double) this._textSize.X) * 0.5); if (this._isLarge) Utils.DrawBorderStringBig(spriteBatch, this.Text, pos, this._color, this._textScale); else diff --git a/GameContent/UI/Elements/UIToggleImage.cs b/GameContent/UI/Elements/UIToggleImage.cs index 47a0b8a..e4b553f 100644 --- a/GameContent/UI/Elements/UIToggleImage.cs +++ b/GameContent/UI/Elements/UIToggleImage.cs @@ -1,20 +1,19 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.Elements.UIToggleImage -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using Terraria.UI; namespace Terraria.GameContent.UI.Elements { public class UIToggleImage : UIElement { - private Asset _onTexture; - private Asset _offTexture; + private Texture2D _onTexture; + private Texture2D _offTexture; private int _drawWidth; private int _drawHeight; private Point _onTextureOffset = Point.Zero; @@ -24,7 +23,7 @@ namespace Terraria.GameContent.UI.Elements public bool IsOn => this._isOn; public UIToggleImage( - Asset texture, + Texture2D texture, int width, int height, Point onTextureOffset, @@ -47,12 +46,12 @@ namespace Terraria.GameContent.UI.Elements Point point; if (this._isOn) { - texture = this._onTexture.Value; + texture = this._onTexture; point = this._onTextureOffset; } else { - texture = this._offTexture.Value; + texture = this._offTexture; point = this._offTextureOffset; } Color color = this.IsMouseHovering ? Color.White : Color.Silver; diff --git a/GameContent/UI/Elements/UIVerticalSeparator.cs b/GameContent/UI/Elements/UIVerticalSeparator.cs deleted file mode 100644 index 0eac78a..0000000 --- a/GameContent/UI/Elements/UIVerticalSeparator.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UIVerticalSeparator -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UIVerticalSeparator : UIElement - { - private Asset _texture; - public Color Color; - public int EdgeWidth; - - public UIVerticalSeparator() - { - this.Color = Color.White; - this._texture = Main.Assets.Request("Images/UI/OnePixel", (AssetRequestMode) 1); - this.Width.Set((float) this._texture.Width(), 0.0f); - this.Height.Set((float) this._texture.Height(), 0.0f); - } - - protected override void DrawSelf(SpriteBatch spriteBatch) - { - CalculatedStyle dimensions = this.GetDimensions(); - spriteBatch.Draw(this._texture.Value, dimensions.ToRectangle(), this.Color); - } - - public override bool ContainsPoint(Vector2 point) => false; - } -} diff --git a/GameContent/UI/Elements/UIVerticalSlider.cs b/GameContent/UI/Elements/UIVerticalSlider.cs deleted file mode 100644 index 3f51a12..0000000 --- a/GameContent/UI/Elements/UIVerticalSlider.cs +++ /dev/null @@ -1,122 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UIVerticalSlider -// 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; -using Microsoft.Xna.Framework.Graphics; -using System; -using Terraria.Audio; -using Terraria.GameInput; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UIVerticalSlider : UISliderBase - { - public float FillPercent; - public Color FilledColor = Main.OurFavoriteColor; - public Color EmptyColor = Color.Black; - private Func _getSliderValue; - private Action _slideKeyboardAction; - private Func _blipFunc; - private Action _slideGamepadAction; - private bool _isReallyMouseOvered; - private bool _soundedUsage; - private bool _alreadyHovered; - - public UIVerticalSlider( - Func getStatus, - Action setStatusKeyboard, - Action setStatusGamepad, - Color color) - { - this._getSliderValue = getStatus != null ? getStatus : (Func) (() => 0.0f); - this._slideKeyboardAction = setStatusKeyboard != null ? setStatusKeyboard : (Action) (s => { }); - this._slideGamepadAction = setStatusGamepad; - this._isReallyMouseOvered = false; - } - - protected override void DrawSelf(SpriteBatch spriteBatch) - { - UISliderBase.CurrentAimedSlider = (UIElement) null; - if (!Main.mouseLeft) - UISliderBase.CurrentLockedSlider = (UIElement) null; - this.GetUsageLevel(); - this.FillPercent = this._getSliderValue(); - float sliderValueThatWasSet = this.FillPercent; - bool flag = false; - if (this.DrawValueBarDynamicWidth(spriteBatch, out sliderValueThatWasSet)) - flag = true; - if (UISliderBase.CurrentLockedSlider == this | flag) - { - UISliderBase.CurrentAimedSlider = (UIElement) this; - if (PlayerInput.Triggers.Current.MouseLeft && !PlayerInput.UsingGamepad && UISliderBase.CurrentLockedSlider == this) - { - this._slideKeyboardAction(sliderValueThatWasSet); - if (!this._soundedUsage) - SoundEngine.PlaySound(12); - this._soundedUsage = true; - } - else - this._soundedUsage = false; - } - if (UISliderBase.CurrentAimedSlider != null && UISliderBase.CurrentLockedSlider == null) - UISliderBase.CurrentLockedSlider = UISliderBase.CurrentAimedSlider; - if (!this._isReallyMouseOvered) - return; - this._slideGamepadAction(); - } - - private bool DrawValueBarDynamicWidth(SpriteBatch spriteBatch, out float sliderValueThatWasSet) - { - sliderValueThatWasSet = 0.0f; - Texture2D texture1 = TextureAssets.ColorBar.Value; - Rectangle rectangle1 = this.GetDimensions().ToRectangle(); - Rectangle rectangle2 = new Rectangle(5, 4, 4, 4); - Utils.DrawSplicedPanel(spriteBatch, texture1, rectangle1.X, rectangle1.Y, rectangle1.Width, rectangle1.Height, rectangle2.X, rectangle2.Width, rectangle2.Y, rectangle2.Height, Color.White); - Rectangle destinationRectangle1 = rectangle1; - destinationRectangle1.X += rectangle2.Left; - destinationRectangle1.Width -= rectangle2.Right; - destinationRectangle1.Y += rectangle2.Top; - destinationRectangle1.Height -= rectangle2.Bottom; - Texture2D texture2 = TextureAssets.MagicPixel.Value; - Rectangle rectangle3 = new Rectangle(0, 0, 1, 1); - spriteBatch.Draw(texture2, destinationRectangle1, new Rectangle?(rectangle3), this.EmptyColor); - Rectangle destinationRectangle2 = destinationRectangle1; - destinationRectangle2.Height = (int) ((double) destinationRectangle2.Height * (double) this.FillPercent); - destinationRectangle2.Y += destinationRectangle1.Height - destinationRectangle2.Height; - spriteBatch.Draw(texture2, destinationRectangle2, new Rectangle?(rectangle3), this.FilledColor); - Rectangle destinationRectangle3 = Utils.CenteredRectangle(new Vector2((float) (destinationRectangle2.Center.X + 1), (float) destinationRectangle2.Top), new Vector2((float) (destinationRectangle2.Width + 16), 4f)); - Rectangle destinationRectangle4 = destinationRectangle3; - destinationRectangle4.Inflate(2, 2); - spriteBatch.Draw(texture2, destinationRectangle4, new Rectangle?(rectangle3), Color.Black); - spriteBatch.Draw(texture2, destinationRectangle3, new Rectangle?(rectangle3), Color.White); - Rectangle rectangle4 = destinationRectangle1; - rectangle4.Inflate(4, 0); - bool flag1 = rectangle4.Contains(Main.MouseScreen.ToPoint()); - this._isReallyMouseOvered = flag1; - bool flag2 = flag1; - if (this.IgnoresMouseInteraction) - flag2 = false; - int usageLevel = this.GetUsageLevel(); - if (usageLevel == 2) - flag2 = false; - if (usageLevel == 1) - flag2 = true; - if (flag2 || usageLevel == 1) - { - if (!this._alreadyHovered) - SoundEngine.PlaySound(12); - this._alreadyHovered = true; - } - else - this._alreadyHovered = false; - if (!flag2) - return false; - sliderValueThatWasSet = Utils.GetLerpValue((float) destinationRectangle1.Bottom, (float) destinationRectangle1.Top, (float) Main.mouseY, true); - return true; - } - } -} diff --git a/GameContent/UI/Elements/UIWorldCreationPreview.cs b/GameContent/UI/Elements/UIWorldCreationPreview.cs deleted file mode 100644 index 993cba4..0000000 --- a/GameContent/UI/Elements/UIWorldCreationPreview.cs +++ /dev/null @@ -1,124 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.Elements.UIWorldCreationPreview -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria.UI; - -namespace Terraria.GameContent.UI.Elements -{ - public class UIWorldCreationPreview : UIElement - { - private readonly Asset _BorderTexture; - private readonly Asset _BackgroundExpertTexture; - private readonly Asset _BackgroundNormalTexture; - private readonly Asset _BackgroundMasterTexture; - private readonly Asset _BunnyExpertTexture; - private readonly Asset _BunnyNormalTexture; - private readonly Asset _BunnyCreativeTexture; - private readonly Asset _BunnyMasterTexture; - private readonly Asset _EvilRandomTexture; - private readonly Asset _EvilCorruptionTexture; - private readonly Asset _EvilCrimsonTexture; - private readonly Asset _SizeSmallTexture; - private readonly Asset _SizeMediumTexture; - private readonly Asset _SizeLargeTexture; - private byte _difficulty; - private byte _evil; - private byte _size; - - public UIWorldCreationPreview() - { - this._BorderTexture = Main.Assets.Request("Images/UI/WorldCreation/PreviewBorder", (AssetRequestMode) 1); - this._BackgroundNormalTexture = Main.Assets.Request("Images/UI/WorldCreation/PreviewDifficultyNormal1", (AssetRequestMode) 1); - this._BackgroundExpertTexture = Main.Assets.Request("Images/UI/WorldCreation/PreviewDifficultyExpert1", (AssetRequestMode) 1); - this._BackgroundMasterTexture = Main.Assets.Request("Images/UI/WorldCreation/PreviewDifficultyMaster1", (AssetRequestMode) 1); - this._BunnyNormalTexture = Main.Assets.Request("Images/UI/WorldCreation/PreviewDifficultyNormal2", (AssetRequestMode) 1); - this._BunnyExpertTexture = Main.Assets.Request("Images/UI/WorldCreation/PreviewDifficultyExpert2", (AssetRequestMode) 1); - this._BunnyCreativeTexture = Main.Assets.Request("Images/UI/WorldCreation/PreviewDifficultyCreative2", (AssetRequestMode) 1); - this._BunnyMasterTexture = Main.Assets.Request("Images/UI/WorldCreation/PreviewDifficultyMaster2", (AssetRequestMode) 1); - this._EvilRandomTexture = Main.Assets.Request("Images/UI/WorldCreation/PreviewEvilRandom", (AssetRequestMode) 1); - this._EvilCorruptionTexture = Main.Assets.Request("Images/UI/WorldCreation/PreviewEvilCorruption", (AssetRequestMode) 1); - this._EvilCrimsonTexture = Main.Assets.Request("Images/UI/WorldCreation/PreviewEvilCrimson", (AssetRequestMode) 1); - this._SizeSmallTexture = Main.Assets.Request("Images/UI/WorldCreation/PreviewSizeSmall", (AssetRequestMode) 1); - this._SizeMediumTexture = Main.Assets.Request("Images/UI/WorldCreation/PreviewSizeMedium", (AssetRequestMode) 1); - this._SizeLargeTexture = Main.Assets.Request("Images/UI/WorldCreation/PreviewSizeLarge", (AssetRequestMode) 1); - this.Width.Set((float) this._BackgroundExpertTexture.Width(), 0.0f); - this.Height.Set((float) this._BackgroundExpertTexture.Height(), 0.0f); - } - - public void UpdateOption(byte difficulty, byte evil, byte size) - { - this._difficulty = difficulty; - this._evil = evil; - this._size = size; - } - - protected override void DrawSelf(SpriteBatch spriteBatch) - { - CalculatedStyle dimensions = this.GetDimensions(); - Vector2 position = new Vector2(dimensions.X + 4f, dimensions.Y + 4f); - Color color = Color.White; - switch (this._difficulty) - { - case 0: - case 3: - spriteBatch.Draw(this._BackgroundNormalTexture.Value, position, Color.White); - color = Color.White; - break; - case 1: - spriteBatch.Draw(this._BackgroundExpertTexture.Value, position, Color.White); - color = Color.DarkGray; - break; - case 2: - spriteBatch.Draw(this._BackgroundMasterTexture.Value, position, Color.White); - color = Color.DarkGray; - break; - } - switch (this._size) - { - case 0: - spriteBatch.Draw(this._SizeSmallTexture.Value, position, color); - break; - case 1: - spriteBatch.Draw(this._SizeMediumTexture.Value, position, color); - break; - case 2: - spriteBatch.Draw(this._SizeLargeTexture.Value, position, color); - break; - } - switch (this._evil) - { - case 0: - spriteBatch.Draw(this._EvilRandomTexture.Value, position, color); - break; - case 1: - spriteBatch.Draw(this._EvilCorruptionTexture.Value, position, color); - break; - case 2: - spriteBatch.Draw(this._EvilCrimsonTexture.Value, position, color); - break; - } - switch (this._difficulty) - { - case 0: - spriteBatch.Draw(this._BunnyNormalTexture.Value, position, color); - break; - case 1: - spriteBatch.Draw(this._BunnyExpertTexture.Value, position, color); - break; - case 2: - spriteBatch.Draw(this._BunnyMasterTexture.Value, position, color * 1.2f); - break; - case 3: - spriteBatch.Draw(this._BunnyCreativeTexture.Value, position, color); - break; - } - spriteBatch.Draw(this._BorderTexture.Value, new Vector2(dimensions.X, dimensions.Y), Color.White); - } - } -} diff --git a/GameContent/UI/Elements/UIWorldListItem.cs b/GameContent/UI/Elements/UIWorldListItem.cs index dfe6969..7d2579b 100644 --- a/GameContent/UI/Elements/UIWorldListItem.cs +++ b/GameContent/UI/Elements/UIWorldListItem.cs @@ -1,15 +1,13 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.Elements.UIWorldListItem -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using ReLogic.OS; -using Terraria.Audio; -using Terraria.DataStructures; +using Terraria.Graphics; using Terraria.IO; using Terraria.Localization; using Terraria.Social; @@ -20,29 +18,25 @@ namespace Terraria.GameContent.UI.Elements public class UIWorldListItem : UIPanel { private WorldFileData _data; - private Asset _dividerTexture; - private Asset _innerPanelTexture; + private Texture2D _dividerTexture; + private Texture2D _innerPanelTexture; private UIImage _worldIcon; private UIText _buttonLabel; private UIText _deleteButtonLabel; - private Asset _buttonCloudActiveTexture; - private Asset _buttonCloudInactiveTexture; - private Asset _buttonFavoriteActiveTexture; - private Asset _buttonFavoriteInactiveTexture; - private Asset _buttonPlayTexture; - private Asset _buttonSeedTexture; - private Asset _buttonDeleteTexture; + private Texture2D _buttonCloudActiveTexture; + private Texture2D _buttonCloudInactiveTexture; + private Texture2D _buttonFavoriteActiveTexture; + private Texture2D _buttonFavoriteInactiveTexture; + private Texture2D _buttonPlayTexture; + private Texture2D _buttonSeedTexture; + private Texture2D _buttonDeleteTexture; private UIImageButton _deleteButton; - private int _orderInList; - private bool _canBePlayed; public bool IsFavorite => this._data.IsFavorite; - public UIWorldListItem(WorldFileData data, int orderInList, bool canBePlayed) + public UIWorldListItem(WorldFileData data, int snapPointIndex) { - this._orderInList = orderInList; this._data = data; - this._canBePlayed = canBePlayed; this.LoadTextures(); this.InitializeAppearance(); this._worldIcon = new UIImage(this.GetIcon()); @@ -76,11 +70,11 @@ namespace Terraria.GameContent.UI.Elements uiImageButton3.OnClick += new UIElement.MouseEvent(this.CloudButtonClick); uiImageButton3.OnMouseOver += new UIElement.MouseEvent(this.CloudMouseOver); uiImageButton3.OnMouseOut += new UIElement.MouseEvent(this.ButtonMouseOut); - uiImageButton3.SetSnapPoint("Cloud", orderInList); + uiImageButton3.SetSnapPoint("Cloud", snapPointIndex); this.Append((UIElement) uiImageButton3); pixels3 += 24f; } - if (this._data.WorldGeneratorVersion != 0UL) + if (Main.UseSeedUI && this._data.WorldGeneratorVersion != 0UL) { UIImageButton uiImageButton4 = new UIImageButton(this._buttonSeedTexture); uiImageButton4.VAlign = 1f; @@ -88,19 +82,19 @@ namespace Terraria.GameContent.UI.Elements uiImageButton4.OnClick += new UIElement.MouseEvent(this.SeedButtonClick); uiImageButton4.OnMouseOver += new UIElement.MouseEvent(this.SeedMouseOver); uiImageButton4.OnMouseOut += new UIElement.MouseEvent(this.ButtonMouseOut); - uiImageButton4.SetSnapPoint("Seed", orderInList); + uiImageButton4.SetSnapPoint("Seed", snapPointIndex); this.Append((UIElement) uiImageButton4); pixels3 += 24f; } UIImageButton uiImageButton5 = new UIImageButton(this._buttonDeleteTexture); uiImageButton5.VAlign = 1f; uiImageButton5.HAlign = 1f; - if (!this._data.IsFavorite) - uiImageButton5.OnClick += new UIElement.MouseEvent(this.DeleteButtonClick); + uiImageButton5.OnClick += new UIElement.MouseEvent(this.DeleteButtonClick); uiImageButton5.OnMouseOver += new UIElement.MouseEvent(this.DeleteMouseOver); uiImageButton5.OnMouseOut += new UIElement.MouseEvent(this.DeleteMouseOut); this._deleteButton = uiImageButton5; - this.Append((UIElement) uiImageButton5); + if (!this._data.IsFavorite) + this.Append((UIElement) uiImageButton5); float pixels4 = pixels3 + 4f; this._buttonLabel = new UIText(""); this._buttonLabel.VAlign = 1f; @@ -113,22 +107,22 @@ namespace Terraria.GameContent.UI.Elements this._deleteButtonLabel.Left.Set(-30f, 0.0f); this._deleteButtonLabel.Top.Set(-3f, 0.0f); this.Append((UIElement) this._deleteButtonLabel); - uiImageButton1.SetSnapPoint("Play", orderInList); - uiImageButton2.SetSnapPoint("Favorite", orderInList); - uiImageButton5.SetSnapPoint("Delete", orderInList); + uiImageButton1.SetSnapPoint("Play", snapPointIndex); + uiImageButton2.SetSnapPoint("Favorite", snapPointIndex); + uiImageButton5.SetSnapPoint("Delete", snapPointIndex); } private void LoadTextures() { - this._dividerTexture = Main.Assets.Request("Images/UI/Divider", (AssetRequestMode) 1); - this._innerPanelTexture = Main.Assets.Request("Images/UI/InnerPanelBackground", (AssetRequestMode) 1); - this._buttonCloudActiveTexture = Main.Assets.Request("Images/UI/ButtonCloudActive", (AssetRequestMode) 1); - this._buttonCloudInactiveTexture = Main.Assets.Request("Images/UI/ButtonCloudInactive", (AssetRequestMode) 1); - this._buttonFavoriteActiveTexture = Main.Assets.Request("Images/UI/ButtonFavoriteActive", (AssetRequestMode) 1); - this._buttonFavoriteInactiveTexture = Main.Assets.Request("Images/UI/ButtonFavoriteInactive", (AssetRequestMode) 1); - this._buttonPlayTexture = Main.Assets.Request("Images/UI/ButtonPlay", (AssetRequestMode) 1); - this._buttonSeedTexture = Main.Assets.Request("Images/UI/ButtonSeed", (AssetRequestMode) 1); - this._buttonDeleteTexture = Main.Assets.Request("Images/UI/ButtonDelete", (AssetRequestMode) 1); + this._dividerTexture = TextureManager.Load("Images/UI/Divider"); + this._innerPanelTexture = TextureManager.Load("Images/UI/InnerPanelBackground"); + this._buttonCloudActiveTexture = TextureManager.Load("Images/UI/ButtonCloudActive"); + this._buttonCloudInactiveTexture = TextureManager.Load("Images/UI/ButtonCloudInactive"); + this._buttonFavoriteActiveTexture = TextureManager.Load("Images/UI/ButtonFavoriteActive"); + this._buttonFavoriteInactiveTexture = TextureManager.Load("Images/UI/ButtonFavoriteInactive"); + this._buttonPlayTexture = TextureManager.Load("Images/UI/ButtonPlay"); + this._buttonSeedTexture = TextureManager.Load("Images/UI/ButtonSeed"); + this._buttonDeleteTexture = TextureManager.Load("Images/UI/ButtonDelete"); } private void InitializeAppearance() @@ -136,30 +130,10 @@ namespace Terraria.GameContent.UI.Elements this.Height.Set(96f, 0.0f); this.Width.Set(0.0f, 1f); this.SetPadding(6f); - this.SetColorsToNotHovered(); - } - - private void SetColorsToHovered() - { - this.BackgroundColor = new Color(73, 94, 171); - this.BorderColor = new Color(89, 116, 213); - if (this._canBePlayed) - return; - this.BorderColor = new Color(150, 150, 150) * 1f; - this.BackgroundColor = Color.Lerp(this.BackgroundColor, new Color(120, 120, 120), 0.5f) * 1f; - } - - private void SetColorsToNotHovered() - { - this.BackgroundColor = new Color(63, 82, 151) * 0.7f; this.BorderColor = new Color(89, 116, 213) * 0.7f; - if (this._canBePlayed) - return; - this.BorderColor = new Color((int) sbyte.MaxValue, (int) sbyte.MaxValue, (int) sbyte.MaxValue) * 0.7f; - this.BackgroundColor = Color.Lerp(new Color(63, 82, 151), new Color(80, 80, 80), 0.5f) * 0.7f; } - private Asset GetIcon() => this._data.DrunkWorld ? Main.Assets.Request("Images/UI/Icon" + (this._data.IsHardMode ? "Hallow" : "") + "CorruptionCrimson", (AssetRequestMode) 1) : Main.Assets.Request("Images/UI/Icon" + (this._data.IsHardMode ? "Hallow" : "") + (this._data.HasCorruption ? "Corruption" : "Crimson"), (AssetRequestMode) 1); + private Texture2D GetIcon() => TextureManager.Load("Images/UI/Icon" + (this._data.IsHardMode ? "Hallow" : "") + (this._data.HasCorruption ? "Corruption" : "Crimson")); private void FavoriteMouseOver(UIMouseEvent evt, UIElement listeningElement) { @@ -179,15 +153,9 @@ namespace Terraria.GameContent.UI.Elements private void PlayMouseOver(UIMouseEvent evt, UIElement listeningElement) => this._buttonLabel.SetText(Language.GetTextValue("UI.Play")); - private void SeedMouseOver(UIMouseEvent evt, UIElement listeningElement) => this._buttonLabel.SetText(Language.GetTextValue("UI.CopySeed", (object) this._data.GetFullSeedText())); + private void SeedMouseOver(UIMouseEvent evt, UIElement listeningElement) => this._buttonLabel.SetText(Language.GetTextValue("UI.CopySeed", (object) this._data.SeedText)); - private void DeleteMouseOver(UIMouseEvent evt, UIElement listeningElement) - { - if (this._data.IsFavorite) - this._deleteButtonLabel.SetText(Language.GetTextValue("UI.CannotDeleteFavorited")); - else - this._deleteButtonLabel.SetText(Language.GetTextValue("UI.Delete")); - } + private void DeleteMouseOver(UIMouseEvent evt, UIElement listeningElement) => this._deleteButtonLabel.SetText(Language.GetTextValue("UI.Delete")); private void DeleteMouseOut(UIMouseEvent evt, UIElement listeningElement) => this._deleteButtonLabel.SetText(""); @@ -212,7 +180,7 @@ namespace Terraria.GameContent.UI.Elements { if (Main.WorldList[index] == this._data) { - SoundEngine.PlaySound(10); + Main.PlaySound(10); Main.selectedWorld = index; Main.menuMode = 9; break; @@ -222,10 +190,10 @@ namespace Terraria.GameContent.UI.Elements private void PlayGame(UIMouseEvent evt, UIElement listeningElement) { - if (listeningElement != evt.Target || this.TryMovingToRejectionMenuIfNeeded(this._data.GameMode)) + if (listeningElement != evt.Target) return; this._data.SetAsActive(); - SoundEngine.PlaySound(10); + Main.PlaySound(10); Main.GetInputText(""); Main.menuMode = !Main.menuMultiplayer || SocialAPI.Network == null ? (!Main.menuMultiplayer ? 10 : 30) : 889; if (Main.menuMultiplayer) @@ -233,33 +201,6 @@ namespace Terraria.GameContent.UI.Elements WorldGen.playWorld(); } - private bool TryMovingToRejectionMenuIfNeeded(int worldGameMode) - { - GameModeData gameModeData; - if (!Main.RegisterdGameModes.TryGetValue(worldGameMode, out gameModeData)) - { - SoundEngine.PlaySound(10); - Main.statusText = Language.GetTextValue("UI.WorldCannotBeLoadedBecauseItHasAnInvalidGameMode"); - Main.menuMode = 1000000; - return true; - } - bool flag = Main.ActivePlayerFileData.Player.difficulty == (byte) 3; - bool isJourneyMode = gameModeData.IsJourneyMode; - if (flag && !isJourneyMode) - { - SoundEngine.PlaySound(10); - Main.statusText = Language.GetTextValue("UI.PlayerIsCreativeAndWorldIsNotCreative"); - Main.menuMode = 1000000; - return true; - } - if (!(!flag & isJourneyMode)) - return false; - SoundEngine.PlaySound(10); - Main.statusText = Language.GetTextValue("UI.PlayerIsNotCreativeAndWorldIsCreative"); - Main.menuMode = 1000000; - return true; - } - private void FavoriteButtonClick(UIMouseEvent evt, UIElement listeningElement) { this._data.ToggleFavorite(); @@ -268,12 +209,12 @@ namespace Terraria.GameContent.UI.Elements if (this._data.IsFavorite) { this._buttonLabel.SetText(Language.GetTextValue("UI.Unfavorite")); - this._deleteButton.OnClick -= new UIElement.MouseEvent(this.DeleteButtonClick); + this.RemoveChild((UIElement) this._deleteButton); } else { this._buttonLabel.SetText(Language.GetTextValue("UI.Favorite")); - this._deleteButton.OnClick += new UIElement.MouseEvent(this.DeleteButtonClick); + this.Append((UIElement) this._deleteButton); } if (!(this.Parent.Parent is UIList parent)) return; @@ -282,29 +223,40 @@ namespace Terraria.GameContent.UI.Elements private void SeedButtonClick(UIMouseEvent evt, UIElement listeningElement) { - Platform.Get().Value = this._data.GetFullSeedText(); + ((Platform) Platform.Current).Clipboard = this._data.SeedText; this._buttonLabel.SetText(Language.GetTextValue("UI.SeedCopied")); } - public override int CompareTo(object obj) => obj is UIWorldListItem uiWorldListItem ? this._orderInList.CompareTo(uiWorldListItem._orderInList) : base.CompareTo(obj); + public override int CompareTo(object obj) + { + if (!(obj is UIWorldListItem uiWorldListItem)) + return base.CompareTo(obj); + if (this.IsFavorite && !uiWorldListItem.IsFavorite) + return -1; + if (!this.IsFavorite && uiWorldListItem.IsFavorite) + return 1; + return this._data.Name.CompareTo(uiWorldListItem._data.Name) != 0 ? this._data.Name.CompareTo(uiWorldListItem._data.Name) : this._data.GetFileName().CompareTo(uiWorldListItem._data.GetFileName()); + } public override void MouseOver(UIMouseEvent evt) { base.MouseOver(evt); - this.SetColorsToHovered(); + this.BackgroundColor = new Color(73, 94, 171); + this.BorderColor = new Color(89, 116, 213); } public override void MouseOut(UIMouseEvent evt) { base.MouseOut(evt); - this.SetColorsToNotHovered(); + this.BackgroundColor = new Color(63, 82, 151) * 0.7f; + this.BorderColor = new Color(89, 116, 213) * 0.7f; } private void DrawPanel(SpriteBatch spriteBatch, Vector2 position, float width) { - spriteBatch.Draw(this._innerPanelTexture.Value, position, new Rectangle?(new Rectangle(0, 0, 8, this._innerPanelTexture.Height())), Color.White); - spriteBatch.Draw(this._innerPanelTexture.Value, new Vector2(position.X + 8f, position.Y), new Rectangle?(new Rectangle(8, 0, 8, this._innerPanelTexture.Height())), Color.White, 0.0f, Vector2.Zero, new Vector2((float) (((double) width - 16.0) / 8.0), 1f), SpriteEffects.None, 0.0f); - spriteBatch.Draw(this._innerPanelTexture.Value, new Vector2((float) ((double) position.X + (double) width - 8.0), position.Y), new Rectangle?(new Rectangle(16, 0, 8, this._innerPanelTexture.Height())), Color.White); + spriteBatch.Draw(this._innerPanelTexture, position, new Rectangle?(new Rectangle(0, 0, 8, this._innerPanelTexture.Height)), Color.White); + spriteBatch.Draw(this._innerPanelTexture, new Vector2(position.X + 8f, position.Y), new Rectangle?(new Rectangle(8, 0, 8, this._innerPanelTexture.Height)), Color.White, 0.0f, Vector2.Zero, new Vector2((float) (((double) width - 16.0) / 8.0), 1f), SpriteEffects.None, 0.0f); + spriteBatch.Draw(this._innerPanelTexture, new Vector2((float) ((double) position.X + (double) width - 8.0), position.Y), new Rectangle?(new Rectangle(16, 0, 8, this._innerPanelTexture.Height)), Color.White); } protected override void DrawSelf(SpriteBatch spriteBatch) @@ -313,51 +265,32 @@ namespace Terraria.GameContent.UI.Elements CalculatedStyle innerDimensions = this.GetInnerDimensions(); CalculatedStyle dimensions = this._worldIcon.GetDimensions(); float x1 = dimensions.X + dimensions.Width; - Color color1 = this._data.IsValid ? Color.White : Color.Red; - Utils.DrawBorderString(spriteBatch, this._data.Name, new Vector2(x1 + 6f, dimensions.Y - 2f), color1); - spriteBatch.Draw(this._dividerTexture.Value, new Vector2(x1, innerDimensions.Y + 21f), new Rectangle?(), Color.White, 0.0f, Vector2.Zero, new Vector2((float) (((double) this.GetDimensions().X + (double) this.GetDimensions().Width - (double) x1) / 8.0), 1f), SpriteEffects.None, 0.0f); + Color color = this._data.IsValid ? Color.White : Color.Red; + Utils.DrawBorderString(spriteBatch, this._data.Name, new Vector2(x1 + 6f, dimensions.Y - 2f), color); + spriteBatch.Draw(this._dividerTexture, new Vector2(x1, innerDimensions.Y + 21f), new Rectangle?(), Color.White, 0.0f, Vector2.Zero, new Vector2((float) (((double) this.GetDimensions().X + (double) this.GetDimensions().Width - (double) x1) / 8.0), 1f), SpriteEffects.None, 0.0f); Vector2 position = new Vector2(x1 + 6f, innerDimensions.Y + 29f); float width1 = 100f; this.DrawPanel(spriteBatch, position, width1); - Color color2 = Color.White; - string textValue1; - switch (this._data.GameMode) - { - case 1: - textValue1 = Language.GetTextValue("UI.Expert"); - color2 = Main.mcColor; - break; - case 2: - textValue1 = Language.GetTextValue("UI.Master"); - color2 = Main.hcColor; - break; - case 3: - textValue1 = Language.GetTextValue("UI.Creative"); - color2 = Main.creativeModeColor; - break; - default: - textValue1 = Language.GetTextValue("UI.Normal"); - break; - } - float x2 = FontAssets.MouseText.Value.MeasureString(textValue1).X; + string text = this._data.IsExpertMode ? Language.GetTextValue("UI.Expert") : Language.GetTextValue("UI.Normal"); + float x2 = Main.fontMouseText.MeasureString(text).X; float x3 = (float) ((double) width1 * 0.5 - (double) x2 * 0.5); - Utils.DrawBorderString(spriteBatch, textValue1, position + new Vector2(x3, 3f), color2); + Utils.DrawBorderString(spriteBatch, text, position + new Vector2(x3, 3f), this._data.IsExpertMode ? new Color(217, 143, 244) : Color.White); position.X += width1 + 5f; float width2 = 150f; - if (!GameCulture.FromCultureName(GameCulture.CultureName.English).IsActive) + if (!GameCulture.English.IsActive) width2 += 40f; this.DrawPanel(spriteBatch, position, width2); - string textValue2 = Language.GetTextValue("UI.WorldSizeFormat", (object) this._data.WorldSizeName); - float x4 = FontAssets.MouseText.Value.MeasureString(textValue2).X; + string textValue1 = Language.GetTextValue("UI.WorldSizeFormat", (object) this._data.WorldSizeName); + float x4 = Main.fontMouseText.MeasureString(textValue1).X; float x5 = (float) ((double) width2 * 0.5 - (double) x4 * 0.5); - Utils.DrawBorderString(spriteBatch, textValue2, position + new Vector2(x5, 3f), Color.White); + Utils.DrawBorderString(spriteBatch, textValue1, position + new Vector2(x5, 3f), Color.White); position.X += width2 + 5f; float width3 = innerDimensions.X + innerDimensions.Width - position.X; this.DrawPanel(spriteBatch, position, width3); - string textValue3 = Language.GetTextValue("UI.WorldCreatedFormat", !GameCulture.FromCultureName(GameCulture.CultureName.English).IsActive ? (object) this._data.CreationTime.ToShortDateString() : (object) this._data.CreationTime.ToString("d MMMM yyyy")); - float x6 = FontAssets.MouseText.Value.MeasureString(textValue3).X; + string textValue2 = Language.GetTextValue("UI.WorldCreatedFormat", !GameCulture.English.IsActive ? (object) this._data.CreationTime.ToShortDateString() : (object) this._data.CreationTime.ToString("d MMMM yyyy")); + float x6 = Main.fontMouseText.MeasureString(textValue2).X; float x7 = (float) ((double) width3 * 0.5 - (double) x6 * 0.5); - Utils.DrawBorderString(spriteBatch, textValue3, position + new Vector2(x7, 3f), Color.White); + Utils.DrawBorderString(spriteBatch, textValue2, position + new Vector2(x7, 3f), Color.White); position.X += width3 + 5f; } } diff --git a/GameContent/UI/EmoteBubble.cs b/GameContent/UI/EmoteBubble.cs index 54a7b64..9a2e998 100644 --- a/GameContent/UI/EmoteBubble.cs +++ b/GameContent/UI/EmoteBubble.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.EmoteBubble -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -15,7 +15,7 @@ namespace Terraria.GameContent.UI { public class EmoteBubble { - private static int[] CountNPCs = new int[663]; + private static int[] CountNPCs = new int[580]; public static Dictionary byID = new Dictionary(); private static List toClean = new List(); public static int NextID; @@ -28,9 +28,6 @@ namespace Terraria.GameContent.UI private const int frameSpeed = 8; public int frameCounter; public int frame; - public const int EMOTE_SHEET_HORIZONTAL_FRAMES = 8; - public const int EMOTE_SHEET_EMOTES_PER_ROW = 4; - public const int EMOTE_SHEET_VERTICAL_FRAMES = 38; public static void UpdateAll() { @@ -97,7 +94,6 @@ namespace Terraria.GameContent.UI Tuple tuple = EmoteBubble.SerializeNetAnchor(bubbleAnchor); NetMessage.SendData(91, number: emoteBubble.ID, number2: ((float) tuple.Item1), number3: ((float) tuple.Item2), number4: ((float) time), number5: emoticon); } - EmoteBubble.OnBubbleChange(emoteBubble.ID); return emoteBubble.ID; } @@ -117,23 +113,6 @@ namespace Terraria.GameContent.UI return emoteBubble.ID; } - public static void CheckForNPCsToReactToEmoteBubble(int emoteID, Player player) - { - for (int index = 0; index < 200; ++index) - { - NPC npc = Main.npc[index]; - if (npc != null && npc.active && npc.aiStyle == 7 && npc.townNPC && (double) npc.ai[0] < 2.0 && (player.CanBeTalkedTo && (double) player.Distance(npc.Center) < 200.0 || !Collision.CanHitLine(npc.Top, 0, 0, player.Top, 0, 0))) - { - int directionInt = ((double) npc.position.X < (double) player.position.X).ToDirectionInt(); - npc.ai[0] = 19f; - npc.ai[1] = 220f; - npc.ai[2] = (float) player.whoAmI; - npc.direction = directionInt; - npc.netUpdate = true; - } - } - } - public EmoteBubble(int emotion, WorldUIAnchor bubbleAnchor, int time = 180) { this.anchor = bubbleAnchor; @@ -154,11 +133,11 @@ namespace Terraria.GameContent.UI private void Draw(SpriteBatch sb) { - Texture2D texture2D = TextureAssets.Extra[48].Value; + Texture2D texture2D = Main.extraTexture[48]; SpriteEffects effect = SpriteEffects.None; - Vector2 vector2 = this.GetPosition(out effect).Floor(); + Vector2 vector2 = this.GetPosition(out effect); bool flag = this.lifeTime < 6 || this.lifeTimeStart - this.lifeTime < 6; - Rectangle rectangle = texture2D.Frame(8, 38, flag ? 0 : 1); + Rectangle rectangle = texture2D.Frame(8, 33, flag ? 0 : 1); Vector2 origin = new Vector2((float) (rectangle.Width / 2), (float) rectangle.Height); if ((double) Main.player[Main.myPlayer].gravDir == -1.0) { @@ -171,18 +150,15 @@ namespace Terraria.GameContent.UI return; if (this.emote >= 0) { - if ((this.emote == 87 || this.emote == 89) && effect.HasFlag((Enum) SpriteEffects.FlipHorizontally)) - { - effect &= ~SpriteEffects.FlipHorizontally; - vector2.X += 4f; - } - sb.Draw(texture2D, vector2, new Rectangle?(texture2D.Frame(8, 38, this.emote * 2 % 8 + this.frame, 1 + this.emote / 4)), Color.White, 0.0f, origin, 1f, effect, 0.0f); + if (this.emote == 87) + effect = SpriteEffects.None; + sb.Draw(texture2D, vector2, new Rectangle?(texture2D.Frame(8, 35, this.emote * 2 % 8 + this.frame, 1 + this.emote / 4)), Color.White, 0.0f, origin, 1f, effect, 0.0f); } else { if (this.emote != -1) return; - Texture2D texture = TextureAssets.NpcHead[this.metadata].Value; + Texture2D texture = Main.npcHeadTexture[this.metadata]; float scale = 1f; if ((double) texture.Width / 22.0 > 1.0) scale = 22f / (float) texture.Width; @@ -198,7 +174,7 @@ namespace Terraria.GameContent.UI { case WorldUIAnchor.AnchorType.Entity: effect = this.anchor.entity.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - return new Vector2(this.anchor.entity.Top.X, this.anchor.entity.VisualPosition.Y) + new Vector2((float) (-this.anchor.entity.direction * this.anchor.entity.width) * 0.75f, 2f) - Main.screenPosition; + return this.anchor.entity.Top + new Vector2((float) (-this.anchor.entity.direction * this.anchor.entity.width) * 0.75f, 2f) - Main.screenPosition; case WorldUIAnchor.AnchorType.Tile: effect = SpriteEffects.None; return this.anchor.pos - Main.screenPosition + new Vector2(0.0f, (float) (-(double) this.anchor.size.Y / 2.0)); @@ -211,18 +187,6 @@ namespace Terraria.GameContent.UI } } - public static void OnBubbleChange(int bubbleID) - { - EmoteBubble emoteBubble1 = EmoteBubble.byID[bubbleID]; - if (emoteBubble1.anchor.type != WorldUIAnchor.AnchorType.Entity || !(emoteBubble1.anchor.entity is Player entity)) - return; - foreach (EmoteBubble emoteBubble2 in EmoteBubble.byID.Values) - { - if (emoteBubble2.anchor.type == WorldUIAnchor.AnchorType.Entity && emoteBubble2.anchor.entity == entity && emoteBubble2.ID != bubbleID) - emoteBubble2.lifeTime = 6; - } - } - public void PickNPCEmote(WorldUIAnchor other = null) { Player plr = Main.player[(int) Player.FindClosest(this.anchor.entity.Center, 0, 0)]; @@ -289,7 +253,7 @@ namespace Terraria.GameContent.UI } else list.Add(95); - if (!plr.ZoneHallow) + if (!plr.ZoneHoly) return; list.Add(6); } @@ -302,7 +266,7 @@ namespace Terraria.GameContent.UI list.Add(18); if (Main.eclipse || Main.hardMode && Main.rand.Next(4) == 0) list.Add(19); - if ((!Main.dayTime || WorldGen.spawnMeteor) && NPC.downedBoss2) + if ((!Main.dayTime || WorldGen.spawnMeteor) && WorldGen.shadowOrbSmashed) list.Add(99); if (Main.pumpkinMoon || (NPC.downedHalloweenKing || NPC.downedHalloweenTree) && !Main.dayTime) list.Add(20); @@ -341,7 +305,7 @@ namespace Terraria.GameContent.UI private void ProbeTownNPCs(List list) { - for (int index = 0; index < 663; ++index) + for (int index = 0; index < 580; ++index) EmoteBubble.CountNPCs[index] = 0; for (int index = 0; index < 200; ++index) { @@ -349,7 +313,7 @@ namespace Terraria.GameContent.UI ++EmoteBubble.CountNPCs[Main.npc[index].type]; } int type = ((NPC) this.anchor.entity).type; - for (int index = 0; index < 663; ++index) + for (int index = 0; index < 580; ++index) { if (NPCID.Sets.FaceEmote[index] > 0 && EmoteBubble.CountNPCs[index] > 0 && index != type) list.Add(NPCID.Sets.FaceEmote[index]); @@ -364,7 +328,7 @@ namespace Terraria.GameContent.UI list.Add(31); else if ((double) plr.position.Y / 16.0 > Main.rockLayer) list.Add(30); - else if (plr.ZoneHallow) + else if (plr.ZoneHoly) list.Add(27); else if (plr.ZoneCorrupt) list.Add(26); @@ -433,15 +397,9 @@ namespace Terraria.GameContent.UI list.Add(17); list.Add(87); list.Add(91); - list.Add(136); - list.Add(134); - list.Add(135); - list.Add(137); - list.Add(138); - list.Add(139); if (!Main.bloodMoon || Main.dayTime) return; - int num = Utils.SelectRandom(Main.rand, 16, 1, 138); + int num = Utils.SelectRandom(Main.rand, 16, 1); list.Add(num); list.Add(num); list.Add(num); @@ -529,13 +487,9 @@ namespace Terraria.GameContent.UI list.Add(56); if (NPC.downedHalloweenKing) list.Add(55); - if (NPC.downedHalloweenTree) - list.Add(54); - if (NPC.downedEmpressOfLight) - list.Add(143); - if (!NPC.downedQueenSlime) + if (!NPC.downedHalloweenTree) return; - list.Add(144); + list.Add(54); } private void ProbeExceptions(List list, Player plr, WorldUIAnchor other) diff --git a/GameContent/UI/EmoteID.cs b/GameContent/UI/EmoteID.cs index cf6a6dd..4070a27 100644 --- a/GameContent/UI/EmoteID.cs +++ b/GameContent/UI/EmoteID.cs @@ -1,17 +1,15 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.EmoteID -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe -using ReLogic.Reflection; - namespace Terraria.GameContent.UI { public class EmoteID { public const int ItemDisplay = -1; - public const int Count = 145; + public const int Count = 126; public const int RPSWinScissors = 33; public const int RPSWinRock = 34; public const int RPSWinPaper = 35; @@ -86,8 +84,6 @@ namespace Terraria.GameContent.UI public const int BossSantank = 58; public const int BossPirateship = 59; public const int BossMartianship = 60; - public const int BossEmpressOfLight = 143; - public const int BossQueenSlime = 144; public const int EmotionLove = 0; public const int EmotionAnger = 1; public const int EmotionCry = 2; @@ -102,12 +98,6 @@ namespace Terraria.GameContent.UI public const int EmoteKick = 92; public const int EmoteFight = 93; public const int EmoteEating = 94; - public const int EmoteSadness = 134; - public const int EmoteAnger = 135; - public const int EmoteHappiness = 136; - public const int EmoteWink = 137; - public const int EmoteScowl = 138; - public const int EmoteSilly = 139; public const int MiscTree = 14; public const int MiscFire = 100; public const int BiomeSky = 22; @@ -146,9 +136,6 @@ namespace Terraria.GameContent.UI public const int TownAngler = 123; public const int TownSkeletonMerchant = 124; public const int TownTaxCollector = 125; - public const int TownGolfer = 140; - public const int TownBestiaryGirl = 141; - public const int TownBestiaryGirlFox = 142; public const int PartyPresent = 126; public const int PartyBalloons = 127; public const int PartyCake = 128; @@ -157,6 +144,5 @@ namespace Terraria.GameContent.UI public const int ItemBeer = 131; public const int ItemDefenderMedal = 132; public const int EventOldOnesArmy = 133; - public static readonly IdDictionary Search = IdDictionary.Create(); } } diff --git a/GameContent/UI/FancyClassicPlayerResourcesDisplaySet.cs b/GameContent/UI/FancyClassicPlayerResourcesDisplaySet.cs deleted file mode 100644 index 2afc928..0000000 --- a/GameContent/UI/FancyClassicPlayerResourcesDisplaySet.cs +++ /dev/null @@ -1,297 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.FancyClassicPlayerResourcesDisplaySet -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using ReLogic.Graphics; - -namespace Terraria.GameContent.UI -{ - public class FancyClassicPlayerResourcesDisplaySet : IPlayerResourcesDisplaySet - { - private float _currentPlayerLife; - private float _lifePerHeart; - private int _playerLifeFruitCount; - private int _lastHeartFillingIndex; - private int _lastHeartPanelIndex; - private int _heartCountRow1; - private int _heartCountRow2; - private int _starCount; - private int _lastStarFillingIndex; - private float _manaPerStar; - private float _currentPlayerMana; - private Asset _heartLeft; - private Asset _heartMiddle; - private Asset _heartRight; - private Asset _heartRightFancy; - private Asset _heartFill; - private Asset _heartFillHoney; - private Asset _heartSingleFancy; - private Asset _starTop; - private Asset _starMiddle; - private Asset _starBottom; - private Asset _starSingle; - private Asset _starFill; - private bool _hoverLife; - private bool _hoverMana; - - public FancyClassicPlayerResourcesDisplaySet(string name, AssetRequestMode mode) - { - string str = "Images\\UI\\PlayerResourceSets\\" + name; - this._heartLeft = Main.Assets.Request(str + "\\Heart_Left", mode); - this._heartMiddle = Main.Assets.Request(str + "\\Heart_Middle", mode); - this._heartRight = Main.Assets.Request(str + "\\Heart_Right", mode); - this._heartRightFancy = Main.Assets.Request(str + "\\Heart_Right_Fancy", mode); - this._heartFill = Main.Assets.Request(str + "\\Heart_Fill", mode); - this._heartFillHoney = Main.Assets.Request(str + "\\Heart_Fill_B", mode); - this._heartSingleFancy = Main.Assets.Request(str + "\\Heart_Single_Fancy", mode); - this._starTop = Main.Assets.Request(str + "\\Star_A", mode); - this._starMiddle = Main.Assets.Request(str + "\\Star_B", mode); - this._starBottom = Main.Assets.Request(str + "\\Star_C", mode); - this._starSingle = Main.Assets.Request(str + "\\Star_Single", mode); - this._starFill = Main.Assets.Request(str + "\\Star_Fill", mode); - } - - public void Draw() - { - Player localPlayer = Main.LocalPlayer; - SpriteBatch spriteBatch = Main.spriteBatch; - this.PrepareFields(localPlayer); - this.DrawLifeBar(spriteBatch); - this.DrawManaBar(spriteBatch); - } - - private void DrawLifeBar(SpriteBatch spriteBatch) - { - Vector2 vector2 = new Vector2((float) (Main.screenWidth - 300 + 4), 15f); - bool isHovered = false; - new ResourceDrawSettings() - { - ElementCount = this._heartCountRow1, - ElementIndexOffset = 0, - TopLeftAnchor = vector2, - GetTextureMethod = new ResourceDrawSettings.TextureGetter(this.HeartPanelDrawer), - OffsetPerDraw = Vector2.Zero, - OffsetPerDrawByTexturePercentile = Vector2.UnitX, - OffsetSpriteAnchor = Vector2.Zero, - OffsetSpriteAnchorByTexturePercentile = Vector2.Zero - }.Draw(spriteBatch, ref isHovered); - new ResourceDrawSettings() - { - ElementCount = this._heartCountRow2, - ElementIndexOffset = 10, - TopLeftAnchor = (vector2 + new Vector2(0.0f, 28f)), - GetTextureMethod = new ResourceDrawSettings.TextureGetter(this.HeartPanelDrawer), - OffsetPerDraw = Vector2.Zero, - OffsetPerDrawByTexturePercentile = Vector2.UnitX, - OffsetSpriteAnchor = Vector2.Zero, - OffsetSpriteAnchorByTexturePercentile = Vector2.Zero - }.Draw(spriteBatch, ref isHovered); - new ResourceDrawSettings() - { - ElementCount = this._heartCountRow1, - ElementIndexOffset = 0, - TopLeftAnchor = (vector2 + new Vector2(15f, 15f)), - GetTextureMethod = new ResourceDrawSettings.TextureGetter(this.HeartFillingDrawer), - OffsetPerDraw = (Vector2.UnitX * 2f), - OffsetPerDrawByTexturePercentile = Vector2.UnitX, - OffsetSpriteAnchor = Vector2.Zero, - OffsetSpriteAnchorByTexturePercentile = new Vector2(0.5f, 0.5f) - }.Draw(spriteBatch, ref isHovered); - new ResourceDrawSettings() - { - ElementCount = this._heartCountRow2, - ElementIndexOffset = 10, - TopLeftAnchor = (vector2 + new Vector2(15f, 15f) + new Vector2(0.0f, 28f)), - GetTextureMethod = new ResourceDrawSettings.TextureGetter(this.HeartFillingDrawer), - OffsetPerDraw = (Vector2.UnitX * 2f), - OffsetPerDrawByTexturePercentile = Vector2.UnitX, - OffsetSpriteAnchor = Vector2.Zero, - OffsetSpriteAnchorByTexturePercentile = new Vector2(0.5f, 0.5f) - }.Draw(spriteBatch, ref isHovered); - this._hoverLife = isHovered; - } - - private static void DrawLifeBarText(SpriteBatch spriteBatch, Vector2 topLeftAnchor) - { - Vector2 vector2_1 = topLeftAnchor + new Vector2(130f, -24f); - Player localPlayer = Main.LocalPlayer; - Color color = new Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor); - string str = Lang.inter[0].Value + " " + (object) localPlayer.statLifeMax2 + "/" + (object) localPlayer.statLifeMax2; - Vector2 vector2_2 = FontAssets.MouseText.Value.MeasureString(str); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, Lang.inter[0].Value, vector2_1 + new Vector2((float) (-(double) vector2_2.X * 0.5), 0.0f), color, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, localPlayer.statLife.ToString() + "/" + (object) localPlayer.statLifeMax2, vector2_1 + new Vector2(vector2_2.X * 0.5f, 0.0f), color, 0.0f, new Vector2(FontAssets.MouseText.Value.MeasureString(localPlayer.statLife.ToString() + "/" + (object) localPlayer.statLifeMax2).X, 0.0f), 1f, SpriteEffects.None, 0.0f); - } - - private void DrawManaBar(SpriteBatch spriteBatch) - { - Vector2 vector2 = new Vector2((float) (Main.screenWidth - 40), 22f); - int starCount = this._starCount; - bool isHovered = false; - new ResourceDrawSettings() - { - ElementCount = this._starCount, - ElementIndexOffset = 0, - TopLeftAnchor = vector2, - GetTextureMethod = new ResourceDrawSettings.TextureGetter(this.StarPanelDrawer), - OffsetPerDraw = Vector2.Zero, - OffsetPerDrawByTexturePercentile = Vector2.UnitY, - OffsetSpriteAnchor = Vector2.Zero, - OffsetSpriteAnchorByTexturePercentile = Vector2.Zero - }.Draw(spriteBatch, ref isHovered); - new ResourceDrawSettings() - { - ElementCount = this._starCount, - ElementIndexOffset = 0, - TopLeftAnchor = (vector2 + new Vector2(15f, 16f)), - GetTextureMethod = new ResourceDrawSettings.TextureGetter(this.StarFillingDrawer), - OffsetPerDraw = (Vector2.UnitY * -2f), - OffsetPerDrawByTexturePercentile = Vector2.UnitY, - OffsetSpriteAnchor = Vector2.Zero, - OffsetSpriteAnchorByTexturePercentile = new Vector2(0.5f, 0.5f) - }.Draw(spriteBatch, ref isHovered); - this._hoverMana = isHovered; - } - - private static void DrawManaText(SpriteBatch spriteBatch) - { - Vector2 vector2 = FontAssets.MouseText.Value.MeasureString(Lang.inter[2].Value); - Color color = new Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor); - int num = 50; - if ((double) vector2.X >= 45.0) - num = (int) vector2.X + 5; - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, Lang.inter[2].Value, new Vector2((float) (Main.screenWidth - num), 6f), color, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - } - - private void HeartPanelDrawer( - int elementIndex, - int firstElementIndex, - int lastElementIndex, - out Asset sprite, - out Vector2 offset, - out float drawScale, - out Rectangle? sourceRect) - { - sourceRect = new Rectangle?(); - offset = Vector2.Zero; - sprite = this._heartLeft; - drawScale = 1f; - if (elementIndex == lastElementIndex && elementIndex == firstElementIndex) - { - sprite = this._heartSingleFancy; - offset = new Vector2(-4f, -4f); - } - else if (elementIndex == lastElementIndex && lastElementIndex == this._lastHeartPanelIndex) - { - sprite = this._heartRightFancy; - offset = new Vector2(-8f, -4f); - } - else if (elementIndex == lastElementIndex) - { - sprite = this._heartRight; - } - else - { - if (elementIndex == firstElementIndex) - return; - sprite = this._heartMiddle; - } - } - - private void HeartFillingDrawer( - int elementIndex, - int firstElementIndex, - int lastElementIndex, - out Asset sprite, - out Vector2 offset, - out float drawScale, - out Rectangle? sourceRect) - { - sourceRect = new Rectangle?(); - offset = Vector2.Zero; - sprite = this._heartLeft; - sprite = elementIndex >= this._playerLifeFruitCount ? this._heartFill : this._heartFillHoney; - float lerpValue = Utils.GetLerpValue(this._lifePerHeart * (float) elementIndex, this._lifePerHeart * (float) (elementIndex + 1), this._currentPlayerLife, true); - drawScale = lerpValue; - if (elementIndex != this._lastHeartFillingIndex || (double) lerpValue <= 0.0) - return; - drawScale += Main.cursorScale - 1f; - } - - private void StarPanelDrawer( - int elementIndex, - int firstElementIndex, - int lastElementIndex, - out Asset sprite, - out Vector2 offset, - out float drawScale, - out Rectangle? sourceRect) - { - sourceRect = new Rectangle?(); - offset = Vector2.Zero; - sprite = this._starTop; - drawScale = 1f; - if (elementIndex == lastElementIndex && elementIndex == firstElementIndex) - sprite = this._starSingle; - else if (elementIndex == lastElementIndex) - { - sprite = this._starBottom; - offset = new Vector2(0.0f, 0.0f); - } - else - { - if (elementIndex == firstElementIndex) - return; - sprite = this._starMiddle; - } - } - - private void StarFillingDrawer( - int elementIndex, - int firstElementIndex, - int lastElementIndex, - out Asset sprite, - out Vector2 offset, - out float drawScale, - out Rectangle? sourceRect) - { - sourceRect = new Rectangle?(); - offset = Vector2.Zero; - sprite = this._starFill; - float lerpValue = Utils.GetLerpValue(this._manaPerStar * (float) elementIndex, this._manaPerStar * (float) (elementIndex + 1), this._currentPlayerMana, true); - drawScale = lerpValue; - if (elementIndex != this._lastStarFillingIndex || (double) lerpValue <= 0.0) - return; - drawScale += Main.cursorScale - 1f; - } - - private void PrepareFields(Player player) - { - PlayerStatsSnapshot playerStatsSnapshot = new PlayerStatsSnapshot(player); - this._playerLifeFruitCount = playerStatsSnapshot.LifeFruitCount; - this._lifePerHeart = playerStatsSnapshot.LifePerSegment; - this._currentPlayerLife = (float) playerStatsSnapshot.Life; - this._manaPerStar = playerStatsSnapshot.ManaPerSegment; - this._heartCountRow1 = Utils.Clamp((int) ((double) playerStatsSnapshot.LifeMax / (double) this._lifePerHeart), 0, 10); - this._heartCountRow2 = Utils.Clamp((int) ((double) (playerStatsSnapshot.LifeMax - 200) / (double) this._lifePerHeart), 0, 10); - this._lastHeartFillingIndex = (int) ((double) playerStatsSnapshot.Life / (double) this._lifePerHeart); - this._lastHeartPanelIndex = this._heartCountRow1 + this._heartCountRow2 - 1; - this._starCount = (int) ((double) playerStatsSnapshot.ManaMax / (double) this._manaPerStar); - this._currentPlayerMana = (float) playerStatsSnapshot.Mana; - this._lastStarFillingIndex = (int) ((double) this._currentPlayerMana / (double) this._manaPerStar); - } - - public void TryToHover() - { - if (this._hoverLife) - CommonResourceBarMethods.DrawLifeMouseOver(); - if (!this._hoverMana) - return; - CommonResourceBarMethods.DrawManaMouseOver(); - } - } -} diff --git a/GameContent/UI/GameTipsDisplay.cs b/GameContent/UI/GameTipsDisplay.cs deleted file mode 100644 index c06d471..0000000 --- a/GameContent/UI/GameTipsDisplay.cs +++ /dev/null @@ -1,157 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.GameTipsDisplay -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Graphics; -using System; -using System.Collections.Generic; -using Terraria.GameInput; -using Terraria.Localization; -using Terraria.UI.Chat; - -namespace Terraria.GameContent.UI -{ - public class GameTipsDisplay - { - private LocalizedText[] _tipsDefault; - private LocalizedText[] _tipsGamepad; - private LocalizedText[] _tipsKeyboard; - private readonly List _currentTips = new List(); - private LocalizedText _lastTip; - - public GameTipsDisplay() - { - this._tipsDefault = Language.FindAll(Lang.CreateDialogFilter("LoadingTips_Default.")); - this._tipsGamepad = Language.FindAll(Lang.CreateDialogFilter("LoadingTips_GamePad.")); - this._tipsKeyboard = Language.FindAll(Lang.CreateDialogFilter("LoadingTips_Keyboard.")); - this._lastTip = (LocalizedText) null; - } - - public void Update() - { - double time = Main.gameTimeCache.TotalGameTime.TotalSeconds; - this._currentTips.RemoveAll((Predicate) (x => x.IsExpired(time))); - bool flag = true; - foreach (GameTipsDisplay.GameTip currentTip in this._currentTips) - { - if (!currentTip.IsExpiring(time)) - { - flag = false; - break; - } - } - if (flag) - this.AddNewTip(time); - foreach (GameTipsDisplay.GameTip currentTip in this._currentTips) - currentTip.Update(time); - } - - public void ClearTips() => this._currentTips.Clear(); - - public void Draw() - { - SpriteBatch spriteBatch = Main.spriteBatch; - float screenWidth = (float) Main.screenWidth; - float y = (float) (Main.screenHeight - 150); - float num1 = (float) Main.screenWidth * 0.5f; - foreach (GameTipsDisplay.GameTip currentTip in this._currentTips) - { - if ((double) currentTip.ScreenAnchorX >= -0.5 && (double) currentTip.ScreenAnchorX <= 1.5) - { - DynamicSpriteFont font = FontAssets.MouseText.Value; - string text = font.CreateWrappedText(currentTip.Text, num1, Language.ActiveCulture.CultureInfo); - if (text.Split('\n').Length > 2) - text = font.CreateWrappedText(currentTip.Text, (float) ((double) num1 * 1.5 - 50.0), Language.ActiveCulture.CultureInfo); - if (WorldGen.drunkWorldGenText) - { - text = string.Concat((object) Main.rand.Next(999999999)); - for (int index = 0; index < 14; ++index) - { - if (Main.rand.Next(2) == 0) - text += (string) (object) Main.rand.Next(999999999); - } - } - if (WorldGen.getGoodWorldGen) - { - string str = ""; - for (int startIndex = text.Length - 1; startIndex >= 0; --startIndex) - str += text.Substring(startIndex, 1); - text = str; - } - Vector2 vector2 = font.MeasureString(text); - float num2 = 1.1f; - float num3 = 110f; - if ((double) vector2.Y > (double) num3) - num2 = num3 / vector2.Y; - Vector2 position = new Vector2(screenWidth * currentTip.ScreenAnchorX, y); - position -= vector2 * num2 * 0.5f; - ChatManager.DrawColorCodedStringWithShadow(spriteBatch, font, text, position, Color.White, 0.0f, Vector2.Zero, new Vector2(num2, num2)); - } - } - } - - private void AddNewTip(double currentTime) - { - string textKey = "UI.Back"; - List localizedTextList = new List(); - localizedTextList.AddRange((IEnumerable) this._tipsDefault); - if (PlayerInput.UsingGamepad) - localizedTextList.AddRange((IEnumerable) this._tipsGamepad); - else - localizedTextList.AddRange((IEnumerable) this._tipsKeyboard); - if (this._lastTip != null) - localizedTextList.Remove(this._lastTip); - LocalizedText localizedText = localizedTextList.Count != 0 ? localizedTextList[Main.rand.Next(localizedTextList.Count)] : LocalizedText.Empty; - this._lastTip = localizedText; - string key = localizedText.Key; - if (Language.Exists(key)) - textKey = key; - this._currentTips.Add(new GameTipsDisplay.GameTip(textKey, currentTime)); - } - - private class GameTip - { - private const float APPEAR_FROM = 2.5f; - private const float APPEAR_TO = 0.5f; - private const float DISAPPEAR_TO = -1.5f; - private const float APPEAR_TIME = 0.5f; - private const float DISAPPEAR_TIME = 1f; - private const float DURATION = 16.5f; - private LocalizedText _textKey; - private string _formattedText; - public float ScreenAnchorX; - public readonly float Duration; - public readonly double SpawnTime; - - public string Text => this._textKey == null ? "What?!" : this._formattedText; - - public bool IsExpired(double currentTime) => currentTime >= this.SpawnTime + (double) this.Duration; - - public bool IsExpiring(double currentTime) => currentTime >= this.SpawnTime + (double) this.Duration - 1.0; - - public GameTip(string textKey, double spawnTime) - { - this._textKey = Language.GetText(textKey); - this.SpawnTime = spawnTime; - this.ScreenAnchorX = 2.5f; - this.Duration = 16.5f; - this._formattedText = this._textKey.FormatWith(Lang.CreateDialogSubstitutionObject()); - } - - public void Update(double currentTime) - { - double t = currentTime - this.SpawnTime; - if (t < 0.5) - this.ScreenAnchorX = MathHelper.SmoothStep(2.5f, 0.5f, (float) Utils.GetLerpValue(0.0, 0.5, t, true)); - else if (t >= (double) this.Duration - 1.0) - this.ScreenAnchorX = MathHelper.SmoothStep(0.5f, -1.5f, (float) Utils.GetLerpValue((double) this.Duration - 1.0, (double) this.Duration, t, true)); - else - this.ScreenAnchorX = 0.5f; - } - } - } -} diff --git a/GameContent/UI/HorizontalBarsPlayerReosurcesDisplaySet.cs b/GameContent/UI/HorizontalBarsPlayerReosurcesDisplaySet.cs deleted file mode 100644 index 8009558..0000000 --- a/GameContent/UI/HorizontalBarsPlayerReosurcesDisplaySet.cs +++ /dev/null @@ -1,256 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.HorizontalBarsPlayerReosurcesDisplaySet -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using ReLogic.Graphics; - -namespace Terraria.GameContent.UI -{ - public class HorizontalBarsPlayerReosurcesDisplaySet : IPlayerResourcesDisplaySet - { - private int _maxSegmentCount; - private int _hpSegmentsCount; - private int _mpSegmentsCount; - private int _hpFruitCount; - private float _hpPercent; - private float _mpPercent; - private bool _hpHovered; - private bool _mpHovered; - private Asset _hpFill; - private Asset _hpFillHoney; - private Asset _mpFill; - private Asset _panelLeft; - private Asset _panelMiddleHP; - private Asset _panelRightHP; - private Asset _panelMiddleMP; - private Asset _panelRightMP; - - public HorizontalBarsPlayerReosurcesDisplaySet(string name, AssetRequestMode mode) - { - string str = "Images\\UI\\PlayerResourceSets\\" + name; - this._hpFill = Main.Assets.Request(str + "\\HP_Fill", mode); - this._hpFillHoney = Main.Assets.Request(str + "\\HP_Fill_Honey", mode); - this._mpFill = Main.Assets.Request(str + "\\MP_Fill", mode); - this._panelLeft = Main.Assets.Request(str + "\\Panel_Left", mode); - this._panelMiddleHP = Main.Assets.Request(str + "\\HP_Panel_Middle", mode); - this._panelRightHP = Main.Assets.Request(str + "\\HP_Panel_Right", mode); - this._panelMiddleMP = Main.Assets.Request(str + "\\MP_Panel_Middle", mode); - this._panelRightMP = Main.Assets.Request(str + "\\MP_Panel_Right", mode); - } - - public void Draw() - { - this.PrepareFields(Main.LocalPlayer); - SpriteBatch spriteBatch = Main.spriteBatch; - int num1 = 16; - int num2 = 18; - int num3 = Main.screenWidth - 300 - 22 + num1; - Vector2 vector2_1 = new Vector2((float) num3, (float) num2); - vector2_1.X += (float) ((this._maxSegmentCount - this._hpSegmentsCount) * this._panelMiddleHP.Width()); - bool isHovered1 = false; - new ResourceDrawSettings() - { - ElementCount = (this._hpSegmentsCount + 2), - ElementIndexOffset = 0, - TopLeftAnchor = vector2_1, - GetTextureMethod = new ResourceDrawSettings.TextureGetter(this.LifePanelDrawer), - OffsetPerDraw = Vector2.Zero, - OffsetPerDrawByTexturePercentile = Vector2.UnitX, - OffsetSpriteAnchor = Vector2.Zero, - OffsetSpriteAnchorByTexturePercentile = Vector2.Zero - }.Draw(spriteBatch, ref isHovered1); - new ResourceDrawSettings() - { - ElementCount = this._hpSegmentsCount, - ElementIndexOffset = 0, - TopLeftAnchor = (vector2_1 + new Vector2(6f, 6f)), - GetTextureMethod = new ResourceDrawSettings.TextureGetter(this.LifeFillingDrawer), - OffsetPerDraw = new Vector2((float) this._hpFill.Width(), 0.0f), - OffsetPerDrawByTexturePercentile = Vector2.Zero, - OffsetSpriteAnchor = Vector2.Zero, - OffsetSpriteAnchorByTexturePercentile = Vector2.Zero - }.Draw(spriteBatch, ref isHovered1); - this._hpHovered = isHovered1; - bool isHovered2 = false; - Vector2 vector2_2 = new Vector2((float) (num3 - 10), (float) (num2 + 24)); - vector2_2.X += (float) ((this._maxSegmentCount - this._mpSegmentsCount) * this._panelMiddleMP.Width()); - new ResourceDrawSettings() - { - ElementCount = (this._mpSegmentsCount + 2), - ElementIndexOffset = 0, - TopLeftAnchor = vector2_2, - GetTextureMethod = new ResourceDrawSettings.TextureGetter(this.ManaPanelDrawer), - OffsetPerDraw = Vector2.Zero, - OffsetPerDrawByTexturePercentile = Vector2.UnitX, - OffsetSpriteAnchor = Vector2.Zero, - OffsetSpriteAnchorByTexturePercentile = Vector2.Zero - }.Draw(spriteBatch, ref isHovered2); - new ResourceDrawSettings() - { - ElementCount = this._mpSegmentsCount, - ElementIndexOffset = 0, - TopLeftAnchor = (vector2_2 + new Vector2(6f, 6f)), - GetTextureMethod = new ResourceDrawSettings.TextureGetter(this.ManaFillingDrawer), - OffsetPerDraw = new Vector2((float) this._mpFill.Width(), 0.0f), - OffsetPerDrawByTexturePercentile = Vector2.Zero, - OffsetSpriteAnchor = Vector2.Zero, - OffsetSpriteAnchorByTexturePercentile = Vector2.Zero - }.Draw(spriteBatch, ref isHovered2); - this._mpHovered = isHovered2; - } - - private static void DrawManaText(SpriteBatch spriteBatch) - { - Color color = new Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor); - int num = 180; - Player localPlayer = Main.LocalPlayer; - string str1 = Lang.inter[2].Value + ":"; - string str2 = localPlayer.statMana.ToString() + "/" + (object) localPlayer.statManaMax2; - Vector2 vector2_1 = new Vector2((float) (Main.screenWidth - num), 65f); - string str3 = str1 + " " + str2; - Vector2 vector2_2 = FontAssets.MouseText.Value.MeasureString(str3); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, str1, vector2_1 + new Vector2((float) (-(double) vector2_2.X * 0.5), 0.0f), color, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, str2, vector2_1 + new Vector2(vector2_2.X * 0.5f, 0.0f), color, 0.0f, new Vector2(FontAssets.MouseText.Value.MeasureString(str2).X, 0.0f), 1f, SpriteEffects.None, 0.0f); - } - - private static void DrawLifeBarText(SpriteBatch spriteBatch, Vector2 topLeftAnchor) - { - Vector2 vector2_1 = topLeftAnchor + new Vector2(130f, -20f); - Player localPlayer = Main.LocalPlayer; - Color color = new Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor); - string str = Lang.inter[0].Value + " " + (object) localPlayer.statLifeMax2 + "/" + (object) localPlayer.statLifeMax2; - Vector2 vector2_2 = FontAssets.MouseText.Value.MeasureString(str); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, Lang.inter[0].Value, vector2_1 + new Vector2((float) (-(double) vector2_2.X * 0.5), 0.0f), color, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, localPlayer.statLife.ToString() + "/" + (object) localPlayer.statLifeMax2, vector2_1 + new Vector2(vector2_2.X * 0.5f, 0.0f), color, 0.0f, new Vector2(FontAssets.MouseText.Value.MeasureString(localPlayer.statLife.ToString() + "/" + (object) localPlayer.statLifeMax2).X, 0.0f), 1f, SpriteEffects.None, 0.0f); - } - - private void PrepareFields(Player player) - { - PlayerStatsSnapshot playerStatsSnapshot = new PlayerStatsSnapshot(player); - this._hpSegmentsCount = (int) ((double) playerStatsSnapshot.LifeMax / (double) playerStatsSnapshot.LifePerSegment); - this._mpSegmentsCount = (int) ((double) playerStatsSnapshot.ManaMax / (double) playerStatsSnapshot.ManaPerSegment); - this._maxSegmentCount = 20; - this._hpFruitCount = playerStatsSnapshot.LifeFruitCount; - this._hpPercent = (float) playerStatsSnapshot.Life / (float) playerStatsSnapshot.LifeMax; - this._mpPercent = (float) playerStatsSnapshot.Mana / (float) playerStatsSnapshot.ManaMax; - } - - private void LifePanelDrawer( - int elementIndex, - int firstElementIndex, - int lastElementIndex, - out Asset sprite, - out Vector2 offset, - out float drawScale, - out Rectangle? sourceRect) - { - sourceRect = new Rectangle?(); - offset = Vector2.Zero; - sprite = this._panelLeft; - drawScale = 1f; - if (elementIndex == lastElementIndex) - { - sprite = this._panelRightHP; - offset = new Vector2(-16f, -10f); - } - else - { - if (elementIndex == firstElementIndex) - return; - sprite = this._panelMiddleHP; - } - } - - private void ManaPanelDrawer( - int elementIndex, - int firstElementIndex, - int lastElementIndex, - out Asset sprite, - out Vector2 offset, - out float drawScale, - out Rectangle? sourceRect) - { - sourceRect = new Rectangle?(); - offset = Vector2.Zero; - sprite = this._panelLeft; - drawScale = 1f; - if (elementIndex == lastElementIndex) - { - sprite = this._panelRightMP; - offset = new Vector2(-16f, -6f); - } - else - { - if (elementIndex == firstElementIndex) - return; - sprite = this._panelMiddleMP; - } - } - - private void LifeFillingDrawer( - int elementIndex, - int firstElementIndex, - int lastElementIndex, - out Asset sprite, - out Vector2 offset, - out float drawScale, - out Rectangle? sourceRect) - { - sprite = this._hpFill; - if (elementIndex >= this._hpSegmentsCount - this._hpFruitCount) - sprite = this._hpFillHoney; - HorizontalBarsPlayerReosurcesDisplaySet.FillBarByValues(elementIndex, sprite, this._hpSegmentsCount, this._hpPercent, out offset, out drawScale, out sourceRect); - } - - private static void FillBarByValues( - int elementIndex, - Asset sprite, - int segmentsCount, - float fillPercent, - out Vector2 offset, - out float drawScale, - out Rectangle? sourceRect) - { - sourceRect = new Rectangle?(); - offset = Vector2.Zero; - int num1 = elementIndex; - float num2 = 1f / (float) segmentsCount; - float t = 1f - fillPercent; - float num3 = 1f - Utils.GetLerpValue(num2 * (float) num1, num2 * (float) (num1 + 1), t, true); - drawScale = 1f; - Rectangle rectangle = sprite.Frame(); - int num4 = (int) ((double) rectangle.Width * (1.0 - (double) num3)); - offset.X += (float) num4; - rectangle.X += num4; - rectangle.Width -= num4; - sourceRect = new Rectangle?(rectangle); - } - - private void ManaFillingDrawer( - int elementIndex, - int firstElementIndex, - int lastElementIndex, - out Asset sprite, - out Vector2 offset, - out float drawScale, - out Rectangle? sourceRect) - { - sprite = this._mpFill; - HorizontalBarsPlayerReosurcesDisplaySet.FillBarByValues(elementIndex, sprite, this._mpSegmentsCount, this._mpPercent, out offset, out drawScale, out sourceRect); - } - - public void TryToHover() - { - if (this._hpHovered) - CommonResourceBarMethods.DrawLifeMouseOver(); - if (!this._mpHovered) - return; - CommonResourceBarMethods.DrawManaMouseOver(); - } - } -} diff --git a/GameContent/UI/IMultiplayerClosePlayersOverlay.cs b/GameContent/UI/IMultiplayerClosePlayersOverlay.cs deleted file mode 100644 index 56d00e2..0000000 --- a/GameContent/UI/IMultiplayerClosePlayersOverlay.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.IMultiplayerClosePlayersOverlay -// 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.UI -{ - public interface IMultiplayerClosePlayersOverlay - { - void Draw(); - } -} diff --git a/GameContent/UI/IPlayerResourcesDisplaySet.cs b/GameContent/UI/IPlayerResourcesDisplaySet.cs deleted file mode 100644 index 59b8947..0000000 --- a/GameContent/UI/IPlayerResourcesDisplaySet.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.IPlayerResourcesDisplaySet -// 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.UI -{ - public interface IPlayerResourcesDisplaySet - { - void Draw(); - - void TryToHover(); - } -} diff --git a/GameContent/UI/ItemRarity.cs b/GameContent/UI/ItemRarity.cs index 00189b3..baf16be 100644 --- a/GameContent/UI/ItemRarity.cs +++ b/GameContent/UI/ItemRarity.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.ItemRarity -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/GameContent/UI/LegacyMultiplayerClosePlayersOverlay.cs b/GameContent/UI/LegacyMultiplayerClosePlayersOverlay.cs deleted file mode 100644 index 87c7753..0000000 --- a/GameContent/UI/LegacyMultiplayerClosePlayersOverlay.cs +++ /dev/null @@ -1,146 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.LegacyMultiplayerClosePlayersOverlay -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Graphics; -using System; -using Terraria.GameInput; -using Terraria.Graphics; -using Terraria.Graphics.Renderers; -using Terraria.Localization; -using Terraria.UI.Chat; - -namespace Terraria.GameContent.UI -{ - public class LegacyMultiplayerClosePlayersOverlay : IMultiplayerClosePlayersOverlay - { - public void Draw() - { - int namePlateDistance = Main.teamNamePlateDistance; - if (namePlateDistance <= 0) - return; - SpriteBatch spriteBatch = Main.spriteBatch; - spriteBatch.End(); - spriteBatch.Begin(SpriteSortMode.Immediate, (BlendState) null, (SamplerState) null, (DepthStencilState) null, (RasterizerState) null, (Effect) null, Main.UIScaleMatrix); - PlayerInput.SetZoom_World(); - int screenWidth = Main.screenWidth; - int screenHeight = Main.screenHeight; - Vector2 screenPosition1 = Main.screenPosition; - PlayerInput.SetZoom_UI(); - float uiScale = Main.UIScale; - int num1 = namePlateDistance * 8; - Player[] player1 = Main.player; - int player2 = Main.myPlayer; - SpriteViewMatrix gameViewMatrix = Main.GameViewMatrix; - byte mouseTextColor = Main.mouseTextColor; - Color[] teamColor = Main.teamColor; - Camera camera = Main.Camera; - IPlayerRenderer playerRenderer = Main.PlayerRenderer; - Vector2 screenPosition2 = Main.screenPosition; - for (int index = 0; index < (int) byte.MaxValue; ++index) - { - if (player1[index].active && player2 != index && !player1[index].dead && player1[player2].team > 0 && player1[player2].team == player1[index].team) - { - string name = player1[index].name; - Vector2 namePlatePos = FontAssets.MouseText.Value.MeasureString(name); - float num2 = 0.0f; - if (player1[index].chatOverhead.timeLeft > 0) - num2 = -namePlatePos.Y * uiScale; - else if (player1[index].emoteTime > 0) - num2 = -namePlatePos.Y * uiScale; - Vector2 vector2_1 = new Vector2((float) (screenWidth / 2) + screenPosition1.X, (float) (screenHeight / 2) + screenPosition1.Y); - Vector2 position1 = player1[index].position; - Vector2 vector2_2 = position1 + (position1 - vector2_1) * (gameViewMatrix.Zoom - Vector2.One); - float num3 = 0.0f; - float num4 = (float) mouseTextColor / (float) byte.MaxValue; - Color namePlateColor = new Color((int) (byte) ((double) teamColor[player1[index].team].R * (double) num4), (int) (byte) ((double) teamColor[player1[index].team].G * (double) num4), (int) (byte) ((double) teamColor[player1[index].team].B * (double) num4), (int) mouseTextColor); - float num5 = vector2_2.X + (float) (player1[index].width / 2) - vector2_1.X; - float num6 = (float) ((double) vector2_2.Y - (double) namePlatePos.Y - 2.0) + num2 - vector2_1.Y; - float num7 = (float) Math.Sqrt((double) num5 * (double) num5 + (double) num6 * (double) num6); - int num8 = screenHeight; - if (screenHeight > screenWidth) - num8 = screenWidth; - int num9 = num8 / 2 - 50; - if (num9 < 100) - num9 = 100; - if ((double) num7 < (double) num9) - { - namePlatePos.X = (float) ((double) vector2_2.X + (double) (player1[index].width / 2) - (double) namePlatePos.X / 2.0) - screenPosition1.X; - namePlatePos.Y = (float) ((double) vector2_2.Y - (double) namePlatePos.Y - 2.0) + num2 - screenPosition1.Y; - } - else - { - num3 = num7; - float num10 = (float) num9 / num7; - namePlatePos.X = (float) ((double) (screenWidth / 2) + (double) num5 * (double) num10 - (double) namePlatePos.X / 2.0); - namePlatePos.Y = (float) ((double) (screenHeight / 2) + (double) num6 * (double) num10 + 40.0 * (double) uiScale); - } - Vector2 vector2_3 = FontAssets.MouseText.Value.MeasureString(name); - namePlatePos += vector2_3 / 2f; - namePlatePos *= 1f / uiScale; - namePlatePos -= vector2_3 / 2f; - if ((double) player1[player2].gravDir == -1.0) - namePlatePos.Y = (float) screenHeight - namePlatePos.Y; - if ((double) num3 > 0.0) - { - float num11 = 20f; - float num12 = -27f - (float) (((double) vector2_3.X - 85.0) / 2.0); - float num13 = player1[index].Center.X - player1[player2].Center.X; - float num14 = player1[index].Center.Y - player1[player2].Center.Y; - float num15 = (float) Math.Sqrt((double) num13 * (double) num13 + (double) num14 * (double) num14); - if ((double) num15 <= (double) num1) - { - string textValue = Language.GetTextValue("GameUI.PlayerDistance", (object) (int) ((double) num15 / 16.0 * 2.0)); - Vector2 npDistPos = FontAssets.MouseText.Value.MeasureString(textValue); - npDistPos.X = namePlatePos.X - num12; - npDistPos.Y = (float) ((double) namePlatePos.Y + (double) vector2_3.Y / 2.0 - (double) npDistPos.Y / 2.0) - num11; - LegacyMultiplayerClosePlayersOverlay.DrawPlayerName2(spriteBatch, ref namePlateColor, textValue, ref npDistPos); - Color headBordersColor = Main.GetPlayerHeadBordersColor(player1[index]); - Vector2 position2 = new Vector2(namePlatePos.X, namePlatePos.Y - num11); - position2.X -= 22f + num12; - position2.Y += 8f; - playerRenderer.DrawPlayerHead(camera, player1[index], position2, scale: 0.8f, borderColor: headBordersColor); - Vector2 vector2_4 = npDistPos + screenPosition2 + new Vector2(26f, 20f); - if (player1[index].statLife != player1[index].statLifeMax2) - Main.instance.DrawHealthBar(vector2_4.X, vector2_4.Y, player1[index].statLife, player1[index].statLifeMax2, 1f, 1.25f, true); - ChatManager.DrawColorCodedStringWithShadow(spriteBatch, FontAssets.MouseText.Value, name, namePlatePos + new Vector2(0.0f, -40f), namePlateColor, 0.0f, Vector2.Zero, Vector2.One); - } - } - else - LegacyMultiplayerClosePlayersOverlay.DrawPlayerName(spriteBatch, name, ref namePlatePos, ref namePlateColor); - } - } - } - - private static void DrawPlayerName2( - SpriteBatch spriteBatch, - ref Color namePlateColor, - string npDist, - ref Vector2 npDistPos) - { - float num = 0.85f; - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, npDist, new Vector2(npDistPos.X - 2f, npDistPos.Y), Color.Black, 0.0f, new Vector2(), num, SpriteEffects.None, 0.0f); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, npDist, new Vector2(npDistPos.X + 2f, npDistPos.Y), Color.Black, 0.0f, new Vector2(), num, SpriteEffects.None, 0.0f); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, npDist, new Vector2(npDistPos.X, npDistPos.Y - 2f), Color.Black, 0.0f, new Vector2(), num, SpriteEffects.None, 0.0f); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, npDist, new Vector2(npDistPos.X, npDistPos.Y + 2f), Color.Black, 0.0f, new Vector2(), num, SpriteEffects.None, 0.0f); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, npDist, npDistPos, namePlateColor, 0.0f, new Vector2(), num, SpriteEffects.None, 0.0f); - } - - private static void DrawPlayerName( - SpriteBatch spriteBatch, - string namePlate, - ref Vector2 namePlatePos, - ref Color namePlateColor) - { - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, namePlate, new Vector2(namePlatePos.X - 2f, namePlatePos.Y), Color.Black, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, namePlate, new Vector2(namePlatePos.X + 2f, namePlatePos.Y), Color.Black, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, namePlate, new Vector2(namePlatePos.X, namePlatePos.Y - 2f), Color.Black, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, namePlate, new Vector2(namePlatePos.X, namePlatePos.Y + 2f), Color.Black, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, namePlate, namePlatePos, namePlateColor, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - } - } -} diff --git a/GameContent/UI/MinimapFrame.cs b/GameContent/UI/MinimapFrame.cs deleted file mode 100644 index 2365f4e..0000000 --- a/GameContent/UI/MinimapFrame.cs +++ /dev/null @@ -1,133 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.MinimapFrame -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using System; -using System.Diagnostics; -using Terraria.Audio; -using Terraria.GameInput; - -namespace Terraria.GameContent.UI -{ - public class MinimapFrame - { - private const float DEFAULT_ZOOM = 1.05f; - private const float ZOOM_OUT_MULTIPLIER = 0.975f; - private const float ZOOM_IN_MULTIPLIER = 1.025f; - private readonly Asset _frameTexture; - private readonly Vector2 _frameOffset; - private MinimapFrame.Button _resetButton; - private MinimapFrame.Button _zoomInButton; - private MinimapFrame.Button _zoomOutButton; - - public Vector2 MinimapPosition { get; set; } - - private Vector2 FramePosition - { - get => this.MinimapPosition + this._frameOffset; - set => this.MinimapPosition = value - this._frameOffset; - } - - public MinimapFrame(Asset frameTexture, Vector2 frameOffset) - { - this._frameTexture = frameTexture; - this._frameOffset = frameOffset; - } - - public void SetResetButton(Asset hoverTexture, Vector2 position) => this._resetButton = new MinimapFrame.Button(hoverTexture, position, (Action) (() => this.ResetZoom())); - - private void ResetZoom() => Main.mapMinimapScale = 1.05f; - - public void SetZoomInButton(Asset hoverTexture, Vector2 position) => this._zoomInButton = new MinimapFrame.Button(hoverTexture, position, (Action) (() => this.ZoomInButton())); - - private void ZoomInButton() => Main.mapMinimapScale *= 1.025f; - - public void SetZoomOutButton(Asset hoverTexture, Vector2 position) => this._zoomOutButton = new MinimapFrame.Button(hoverTexture, position, (Action) (() => this.ZoomOutButton())); - - private void ZoomOutButton() => Main.mapMinimapScale *= 0.975f; - - public void Update() - { - MinimapFrame.Button buttonUnderMouse = this.GetButtonUnderMouse(); - this._zoomInButton.IsHighlighted = buttonUnderMouse == this._zoomInButton; - this._zoomOutButton.IsHighlighted = buttonUnderMouse == this._zoomOutButton; - this._resetButton.IsHighlighted = buttonUnderMouse == this._resetButton; - if (buttonUnderMouse == null || Main.LocalPlayer.lastMouseInterface) - return; - buttonUnderMouse.IsHighlighted = true; - if (PlayerInput.IgnoreMouseInterface) - return; - Main.LocalPlayer.mouseInterface = true; - if (!Main.mouseLeft) - return; - buttonUnderMouse.Click(); - if (!Main.mouseLeftRelease) - return; - SoundEngine.PlaySound(12); - } - - public void DrawBackground(SpriteBatch spriteBatch) => spriteBatch.Draw(TextureAssets.MagicPixel.Value, new Rectangle((int) this.MinimapPosition.X - 6, (int) this.MinimapPosition.Y - 6, 244, 244), Color.Black * Main.mapMinimapAlpha); - - public void DrawForeground(SpriteBatch spriteBatch) - { - spriteBatch.Draw(this._frameTexture.Value, this.FramePosition, Color.White); - this._zoomInButton.Draw(spriteBatch, this.FramePosition); - this._zoomOutButton.Draw(spriteBatch, this.FramePosition); - this._resetButton.Draw(spriteBatch, this.FramePosition); - } - - private MinimapFrame.Button GetButtonUnderMouse() - { - Vector2 testPoint = new Vector2((float) Main.mouseX, (float) Main.mouseY); - if (this._zoomInButton.IsTouchingPoint(testPoint, this.FramePosition)) - return this._zoomInButton; - if (this._zoomOutButton.IsTouchingPoint(testPoint, this.FramePosition)) - return this._zoomOutButton; - return this._resetButton.IsTouchingPoint(testPoint, this.FramePosition) ? this._resetButton : (MinimapFrame.Button) null; - } - - [Conditional("DEBUG")] - private void ValidateState() - { - } - - private class Button - { - public bool IsHighlighted; - private readonly Vector2 _position; - private readonly Asset _hoverTexture; - private readonly Action _onMouseDown; - - private Vector2 Size => new Vector2((float) this._hoverTexture.Width(), (float) this._hoverTexture.Height()); - - public Button(Asset hoverTexture, Vector2 position, Action mouseDownCallback) - { - this._position = position; - this._hoverTexture = hoverTexture; - this._onMouseDown = mouseDownCallback; - } - - public void Click() => this._onMouseDown(); - - public void Draw(SpriteBatch spriteBatch, Vector2 parentPosition) - { - if (!this.IsHighlighted) - return; - spriteBatch.Draw(this._hoverTexture.Value, this._position + parentPosition, Color.White); - } - - public bool IsTouchingPoint(Vector2 testPoint, Vector2 parentPosition) - { - Vector2 vector2_1 = this._position + parentPosition + this.Size * 0.5f; - Vector2 vector2_2 = Vector2.Max(this.Size, new Vector2(22f, 22f)) * 0.5f; - Vector2 vector2_3 = testPoint - vector2_1; - return (double) Math.Abs(vector2_3.X) < (double) vector2_2.X && (double) Math.Abs(vector2_3.Y) < (double) vector2_2.Y; - } - } - } -} diff --git a/GameContent/UI/NewMultiplayerClosePlayersOverlay.cs b/GameContent/UI/NewMultiplayerClosePlayersOverlay.cs deleted file mode 100644 index 1a11ff8..0000000 --- a/GameContent/UI/NewMultiplayerClosePlayersOverlay.cs +++ /dev/null @@ -1,250 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.NewMultiplayerClosePlayersOverlay -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Graphics; -using System; -using System.Collections.Generic; -using Terraria.GameInput; -using Terraria.Graphics; -using Terraria.Localization; -using Terraria.UI.Chat; - -namespace Terraria.GameContent.UI -{ - public class NewMultiplayerClosePlayersOverlay : IMultiplayerClosePlayersOverlay - { - private List _playerOnScreenCache = new List(); - private List _playerOffScreenCache = new List(); - - public void Draw() - { - int namePlateDistance = Main.teamNamePlateDistance; - if (namePlateDistance <= 0) - return; - this._playerOnScreenCache.Clear(); - this._playerOffScreenCache.Clear(); - SpriteBatch spriteBatch = Main.spriteBatch; - PlayerInput.SetZoom_World(); - int screenWidth = Main.screenWidth; - int screenHeight = Main.screenHeight; - Vector2 screenPosition1 = Main.screenPosition; - PlayerInput.SetZoom_UI(); - int num1 = namePlateDistance * 8; - Player[] player1 = Main.player; - int player2 = Main.myPlayer; - byte mouseTextColor = Main.mouseTextColor; - Color[] teamColor = Main.teamColor; - Vector2 screenPosition2 = Main.screenPosition; - Player localPlayer = player1[player2]; - float num2 = (float) mouseTextColor / (float) byte.MaxValue; - if (localPlayer.team == 0) - return; - DynamicSpriteFont font = FontAssets.MouseText.Value; - for (int index = 0; index < (int) byte.MaxValue; ++index) - { - if (index != player2) - { - Player player3 = player1[index]; - if (player3.active && !player3.dead && player3.team == localPlayer.team) - { - string name = player3.name; - Vector2 namePlatePos; - float namePlateDist; - Vector2 measurement; - NewMultiplayerClosePlayersOverlay.GetDistance(screenWidth, screenHeight, screenPosition1, localPlayer, font, player3, name, out namePlatePos, out namePlateDist, out measurement); - Color color = new Color((int) (byte) ((double) teamColor[player3.team].R * (double) num2), (int) (byte) ((double) teamColor[player3.team].G * (double) num2), (int) (byte) ((double) teamColor[player3.team].B * (double) num2), (int) mouseTextColor); - if ((double) namePlateDist > 0.0) - { - float num3 = player3.Distance(localPlayer.Center); - if ((double) num3 <= (double) num1) - { - float num4 = 20f; - float num5 = -27f - (float) (((double) measurement.X - 85.0) / 2.0); - string textValue = Language.GetTextValue("GameUI.PlayerDistance", (object) (int) ((double) num3 / 16.0 * 2.0)); - Vector2 npDistPos = font.MeasureString(textValue); - npDistPos.X = namePlatePos.X - num5; - npDistPos.Y = (float) ((double) namePlatePos.Y + (double) measurement.Y / 2.0 - (double) npDistPos.Y / 2.0) - num4; - this._playerOffScreenCache.Add(new NewMultiplayerClosePlayersOverlay.PlayerOffScreenCache(name, namePlatePos, color, npDistPos, textValue, player3, measurement)); - } - } - else - this._playerOnScreenCache.Add(new NewMultiplayerClosePlayersOverlay.PlayerOnScreenCache(name, namePlatePos, color)); - } - } - } - spriteBatch.End(); - spriteBatch.Begin(SpriteSortMode.Deferred, (BlendState) null, (SamplerState) null, (DepthStencilState) null, (RasterizerState) null, (Effect) null, Main.UIScaleMatrix); - for (int index = 0; index < this._playerOnScreenCache.Count; ++index) - this._playerOnScreenCache[index].DrawPlayerName_WhenPlayerIsOnScreen(spriteBatch); - NewMultiplayerClosePlayersOverlay.PlayerOffScreenCache playerOffScreenCache; - for (int index = 0; index < this._playerOffScreenCache.Count; ++index) - { - playerOffScreenCache = this._playerOffScreenCache[index]; - playerOffScreenCache.DrawPlayerName(spriteBatch); - } - for (int index = 0; index < this._playerOffScreenCache.Count; ++index) - { - playerOffScreenCache = this._playerOffScreenCache[index]; - playerOffScreenCache.DrawPlayerDistance(spriteBatch); - } - spriteBatch.End(); - spriteBatch.Begin(SpriteSortMode.Deferred, (BlendState) null, (SamplerState) null, (DepthStencilState) null, (RasterizerState) null, (Effect) null, Main.UIScaleMatrix); - for (int index = 0; index < this._playerOffScreenCache.Count; ++index) - { - playerOffScreenCache = this._playerOffScreenCache[index]; - playerOffScreenCache.DrawLifeBar(); - } - spriteBatch.End(); - spriteBatch.Begin(SpriteSortMode.Immediate, (BlendState) null, (SamplerState) null, (DepthStencilState) null, (RasterizerState) null, (Effect) null, Main.UIScaleMatrix); - for (int index = 0; index < this._playerOffScreenCache.Count; ++index) - { - playerOffScreenCache = this._playerOffScreenCache[index]; - playerOffScreenCache.DrawPlayerHead(); - } - } - - private static void GetDistance( - int testWidth, - int testHeight, - Vector2 testPosition, - Player localPlayer, - DynamicSpriteFont font, - Player player, - string nameToShow, - out Vector2 namePlatePos, - out float namePlateDist, - out Vector2 measurement) - { - float uiScale = Main.UIScale; - SpriteViewMatrix gameViewMatrix = Main.GameViewMatrix; - namePlatePos = font.MeasureString(nameToShow); - float num1 = 0.0f; - if (player.chatOverhead.timeLeft > 0) - num1 = -namePlatePos.Y * uiScale; - else if (player.emoteTime > 0) - num1 = -namePlatePos.Y * uiScale; - Vector2 vector2_1 = new Vector2((float) (testWidth / 2) + testPosition.X, (float) (testHeight / 2) + testPosition.Y); - Vector2 position = player.position; - Vector2 vector2_2 = position + (position - vector2_1) * (gameViewMatrix.Zoom - Vector2.One); - namePlateDist = 0.0f; - float num2 = vector2_2.X + (float) (player.width / 2) - vector2_1.X; - float num3 = (float) ((double) vector2_2.Y - (double) namePlatePos.Y - 2.0) + num1 - vector2_1.Y; - float num4 = (float) Math.Sqrt((double) num2 * (double) num2 + (double) num3 * (double) num3); - int num5 = testHeight; - if (testHeight > testWidth) - num5 = testWidth; - int num6 = num5 / 2 - 50; - if (num6 < 100) - num6 = 100; - if ((double) num4 < (double) num6) - { - namePlatePos.X = (float) ((double) vector2_2.X + (double) (player.width / 2) - (double) namePlatePos.X / 2.0) - testPosition.X; - namePlatePos.Y = (float) ((double) vector2_2.Y - (double) namePlatePos.Y - 2.0) + num1 - testPosition.Y; - } - else - { - namePlateDist = num4; - float num7 = (float) num6 / num4; - namePlatePos.X = (float) ((double) (testWidth / 2) + (double) num2 * (double) num7 - (double) namePlatePos.X / 2.0); - namePlatePos.Y = (float) ((double) (testHeight / 2) + (double) num3 * (double) num7 + 40.0 * (double) uiScale); - } - measurement = font.MeasureString(nameToShow); - namePlatePos += measurement / 2f; - namePlatePos *= 1f / uiScale; - namePlatePos -= measurement / 2f; - if ((double) localPlayer.gravDir != -1.0) - return; - namePlatePos.Y = (float) testHeight - namePlatePos.Y; - } - - private struct PlayerOnScreenCache - { - private string _name; - private Vector2 _pos; - private Color _color; - - public PlayerOnScreenCache(string name, Vector2 pos, Color color) - { - this._name = name; - this._pos = pos; - this._color = color; - } - - public void DrawPlayerName_WhenPlayerIsOnScreen(SpriteBatch spriteBatch) - { - this._pos = this._pos.Floor(); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, this._name, new Vector2(this._pos.X - 2f, this._pos.Y), Color.Black, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, this._name, new Vector2(this._pos.X + 2f, this._pos.Y), Color.Black, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, this._name, new Vector2(this._pos.X, this._pos.Y - 2f), Color.Black, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, this._name, new Vector2(this._pos.X, this._pos.Y + 2f), Color.Black, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, this._name, this._pos, this._color, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - } - } - - private struct PlayerOffScreenCache - { - private Player player; - private string nameToShow; - private Vector2 namePlatePos; - private Color namePlateColor; - private Vector2 distanceDrawPosition; - private string distanceString; - private Vector2 measurement; - - public PlayerOffScreenCache( - string name, - Vector2 pos, - Color color, - Vector2 npDistPos, - string npDist, - Player thePlayer, - Vector2 theMeasurement) - { - this.nameToShow = name; - this.namePlatePos = pos.Floor(); - this.namePlateColor = color; - this.distanceDrawPosition = npDistPos.Floor(); - this.distanceString = npDist; - this.player = thePlayer; - this.measurement = theMeasurement; - } - - public void DrawPlayerName(SpriteBatch spriteBatch) => ChatManager.DrawColorCodedStringWithShadow(spriteBatch, FontAssets.MouseText.Value, this.nameToShow, this.namePlatePos + new Vector2(0.0f, -40f), this.namePlateColor, 0.0f, Vector2.Zero, Vector2.One); - - public void DrawPlayerHead() - { - float num1 = 20f; - float num2 = -27f - (float) (((double) this.measurement.X - 85.0) / 2.0); - Color headBordersColor = Main.GetPlayerHeadBordersColor(this.player); - Vector2 vec = new Vector2(this.namePlatePos.X, this.namePlatePos.Y - num1); - vec.X -= 22f + num2; - vec.Y += 8f; - Vector2 position = vec.Floor(); - Main.MapPlayerRenderer.DrawPlayerHead(Main.Camera, this.player, position, scale: 0.8f, borderColor: headBordersColor); - } - - public void DrawLifeBar() - { - Vector2 vector2 = Main.screenPosition + this.distanceDrawPosition + new Vector2(26f, 20f); - if (this.player.statLife == this.player.statLifeMax2) - return; - Main.instance.DrawHealthBar(vector2.X, vector2.Y, this.player.statLife, this.player.statLifeMax2, 1f, 1.25f, true); - } - - public void DrawPlayerDistance(SpriteBatch spriteBatch) - { - float num = 0.85f; - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, this.distanceString, new Vector2(this.distanceDrawPosition.X - 2f, this.distanceDrawPosition.Y), Color.Black, 0.0f, new Vector2(), num, SpriteEffects.None, 0.0f); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, this.distanceString, new Vector2(this.distanceDrawPosition.X + 2f, this.distanceDrawPosition.Y), Color.Black, 0.0f, new Vector2(), num, SpriteEffects.None, 0.0f); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, this.distanceString, new Vector2(this.distanceDrawPosition.X, this.distanceDrawPosition.Y - 2f), Color.Black, 0.0f, new Vector2(), num, SpriteEffects.None, 0.0f); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, this.distanceString, new Vector2(this.distanceDrawPosition.X, this.distanceDrawPosition.Y + 2f), Color.Black, 0.0f, new Vector2(), num, SpriteEffects.None, 0.0f); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, this.distanceString, this.distanceDrawPosition, this.namePlateColor, 0.0f, new Vector2(), num, SpriteEffects.None, 0.0f); - } - } - } -} diff --git a/GameContent/UI/PlayerStatsSnapshot.cs b/GameContent/UI/PlayerStatsSnapshot.cs deleted file mode 100644 index f4e8303..0000000 --- a/GameContent/UI/PlayerStatsSnapshot.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.PlayerStatsSnapshot -// 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.UI -{ - public struct PlayerStatsSnapshot - { - public int Life; - public int LifeMax; - public int LifeFruitCount; - public float LifePerSegment; - public int Mana; - public int ManaMax; - public float ManaPerSegment; - - public PlayerStatsSnapshot(Player player) - { - this.Life = player.statLife; - this.Mana = player.statMana; - this.LifeMax = player.statLifeMax2; - this.ManaMax = player.statManaMax2; - float num1 = 20f; - int num2 = player.statLifeMax / 20; - int num3 = (player.statLifeMax - 400) / 5; - if (num3 < 0) - num3 = 0; - if (num3 > 0) - { - num2 = player.statLifeMax / (20 + num3 / 4); - num1 = (float) player.statLifeMax / 20f; - } - int num4 = player.statLifeMax2 - player.statLifeMax; - float num5 = num1 + (float) (num4 / num2); - this.LifeFruitCount = num3; - this.LifePerSegment = num5; - this.ManaPerSegment = 20f; - } - } -} diff --git a/GameContent/UI/ResourceDrawSettings.cs b/GameContent/UI/ResourceDrawSettings.cs deleted file mode 100644 index 08e48fe..0000000 --- a/GameContent/UI/ResourceDrawSettings.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.ResourceDrawSettings -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; - -namespace Terraria.GameContent.UI -{ - public struct ResourceDrawSettings - { - public Vector2 TopLeftAnchor; - public int ElementCount; - public int ElementIndexOffset; - public ResourceDrawSettings.TextureGetter GetTextureMethod; - public Vector2 OffsetPerDraw; - public Vector2 OffsetPerDrawByTexturePercentile; - public Vector2 OffsetSpriteAnchor; - public Vector2 OffsetSpriteAnchorByTexturePercentile; - - public void Draw(SpriteBatch spriteBatch, ref bool isHovered) - { - int elementCount = this.ElementCount; - Vector2 topLeftAnchor = this.TopLeftAnchor; - Point point = Main.MouseScreen.ToPoint(); - for (int index = 0; index < elementCount; ++index) - { - Asset texture; - Vector2 drawOffset; - float drawScale; - Rectangle? sourceRect; - this.GetTextureMethod(index + this.ElementIndexOffset, this.ElementIndexOffset, this.ElementIndexOffset + elementCount - 1, out texture, out drawOffset, out drawScale, out sourceRect); - Rectangle r = texture.Frame(); - if (sourceRect.HasValue) - r = sourceRect.Value; - Vector2 position = topLeftAnchor + drawOffset; - Vector2 origin = this.OffsetSpriteAnchor + r.Size() * this.OffsetSpriteAnchorByTexturePercentile; - Rectangle rectangle = r; - rectangle.X += (int) ((double) position.X - (double) origin.X); - rectangle.Y += (int) ((double) position.Y - (double) origin.Y); - if (rectangle.Contains(point)) - isHovered = true; - spriteBatch.Draw(texture.Value, position, new Rectangle?(r), Color.White, 0.0f, origin, drawScale, SpriteEffects.None, 0.0f); - topLeftAnchor += this.OffsetPerDraw + r.Size() * this.OffsetPerDrawByTexturePercentile; - } - } - - public delegate void TextureGetter( - int elementIndex, - int firstElementIndex, - int lastElementIndex, - out Asset texture, - out Vector2 drawOffset, - out float drawScale, - out Rectangle? sourceRect); - } -} diff --git a/GameContent/UI/States/UIAchievementsMenu.cs b/GameContent/UI/States/UIAchievementsMenu.cs index 3bd06d7..f00a3de 100644 --- a/GameContent/UI/States/UIAchievementsMenu.cs +++ b/GameContent/UI/States/UIAchievementsMenu.cs @@ -1,18 +1,16 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.States.UIAchievementsMenu -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using System.Collections.Generic; using Terraria.Achievements; -using Terraria.Audio; using Terraria.GameContent.UI.Elements; using Terraria.GameInput; -using Terraria.ID; +using Terraria.Graphics; using Terraria.Localization; using Terraria.UI; using Terraria.UI.Gamepad; @@ -91,7 +89,7 @@ namespace Terraria.GameContent.UI.States element2.Width.Set(0.0f, 1f); element2.Height.Set(32f, 0.0f); element2.Top.Set(10f, 0.0f); - Asset texture = Main.Assets.Request("Images/UI/Achievement_Categories", (AssetRequestMode) 1); + Texture2D texture = TextureManager.Load("Images/UI/Achievement_Categories"); for (int index = 0; index < 4; ++index) { UIToggleImage uiToggleImage = new UIToggleImage(texture, 32, 32, new Point(34 * index, 0), new Point(34 * index, 34)); @@ -133,13 +131,13 @@ namespace Terraria.GameContent.UI.States textValue = Language.GetTextValue("Achievements.NoCategory"); break; } - float x = FontAssets.MouseText.Value.MeasureString(textValue).X; + float x = Main.fontMouseText.MeasureString(textValue).X; Vector2 vector2 = new Vector2((float) Main.mouseX, (float) Main.mouseY) + new Vector2(16f); if ((double) vector2.Y > (double) (Main.screenHeight - 30)) vector2.Y = (float) (Main.screenHeight - 30); if ((double) vector2.X > (double) Main.screenWidth - (double) x) vector2.X = (float) (Main.screenWidth - 460); - Utils.DrawBorderStringFourWay(spriteBatch, FontAssets.MouseText.Value, textValue, vector2.X, vector2.Y, new Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor), Color.Black, Vector2.Zero); + Utils.DrawBorderStringFourWay(spriteBatch, Main.fontMouseText, textValue, vector2.X, vector2.Y, new Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor), Color.Black, Vector2.Zero); break; } } @@ -156,20 +154,14 @@ namespace Terraria.GameContent.UI.States private void FadedMouseOver(UIMouseEvent evt, UIElement listeningElement) { - SoundEngine.PlaySound(12); + Main.PlaySound(12); ((UIPanel) evt.Target).BackgroundColor = new Color(73, 94, 171); - ((UIPanel) evt.Target).BorderColor = Colors.FancyUIFatButtonMouseOver; } - private void FadedMouseOut(UIMouseEvent evt, UIElement listeningElement) - { - ((UIPanel) evt.Target).BackgroundColor = new Color(63, 82, 151) * 0.8f; - ((UIPanel) evt.Target).BorderColor = Color.Black; - } + private void FadedMouseOut(UIMouseEvent evt, UIElement listeningElement) => ((UIPanel) evt.Target).BackgroundColor = new Color(63, 82, 151) * 0.8f; private void FilterList(UIMouseEvent evt, UIElement listeningElement) { - SoundEngine.PlaySound(12); this._achievementsList.Clear(); foreach (UIAchievementListItem achievementElement in this._achievementElements) { diff --git a/GameContent/UI/States/UIBestiaryTest.cs b/GameContent/UI/States/UIBestiaryTest.cs deleted file mode 100644 index 45cfea0..0000000 --- a/GameContent/UI/States/UIBestiaryTest.cs +++ /dev/null @@ -1,844 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.States.UIBestiaryTest -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria.Audio; -using Terraria.DataStructures; -using Terraria.GameContent.Bestiary; -using Terraria.GameContent.UI.Elements; -using Terraria.GameInput; -using Terraria.ID; -using Terraria.Localization; -using Terraria.UI; -using Terraria.UI.Gamepad; - -namespace Terraria.GameContent.UI.States -{ - public class UIBestiaryTest : UIState - { - private UIElement _bestiarySpace; - private UIBestiaryEntryInfoPage _infoSpace; - private UIBestiaryEntryButton _selectedEntryButton; - private List _originalEntriesList; - private List _workingSetEntries; - private UIText _indexesRangeText; - private EntryFilterer _filterer = new EntryFilterer(); - private EntrySorter _sorter = new EntrySorter(); - private UIBestiaryEntryGrid _entryGrid; - private UIBestiarySortingOptionsGrid _sortingGrid; - private UIBestiaryFilteringOptionsGrid _filteringGrid; - private UISearchBar _searchBar; - private UIPanel _searchBoxPanel; - private UIText _sortingText; - private UIText _filteringText; - private string _searchString; - private BestiaryUnlockProgressReport _progressReport; - private UIText _progressPercentText; - private UIColoredSliderSimple _unlocksProgressBar; - - public UIBestiaryTest(BestiaryDatabase database) - { - this._filterer.SetSearchFilterObject(new Filters.BySearch()); - this._originalEntriesList = new List((IEnumerable) database.Entries); - this._workingSetEntries = new List((IEnumerable) this._originalEntriesList); - this._filterer.AddFilters(database.Filters); - this._sorter.AddSortSteps(database.SortSteps); - this.BuildPage(); - } - - public void OnOpenPage() => this.UpdateBestiaryContents(); - - private void BuildPage() - { - this.RemoveAllChildren(); - int num1 = true.ToInt() * 100; - UIElement uiElement1 = new UIElement(); - uiElement1.Width.Set(0.0f, 0.875f); - uiElement1.MaxWidth.Set(800f + (float) num1, 0.0f); - uiElement1.MinWidth.Set(600f + (float) num1, 0.0f); - uiElement1.Top.Set(220f, 0.0f); - uiElement1.Height.Set(-220f, 1f); - uiElement1.HAlign = 0.5f; - this.Append(uiElement1); - this.MakeExitButton(uiElement1); - UIPanel uiPanel = new UIPanel(); - uiPanel.Width.Set(0.0f, 1f); - uiPanel.Height.Set(-90f, 1f); - uiPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f; - uiElement1.Append((UIElement) uiPanel); - uiPanel.PaddingTop -= 4f; - uiPanel.PaddingBottom -= 4f; - int num2 = 24; - UIElement uiElement2 = new UIElement() - { - Width = new StyleDimension(0.0f, 1f), - Height = new StyleDimension((float) num2, 0.0f), - VAlign = 0.0f - }; - uiElement2.SetPadding(0.0f); - uiPanel.Append(uiElement2); - UIBestiaryEntryInfoPage bestiaryEntryInfoPage = new UIBestiaryEntryInfoPage(); - bestiaryEntryInfoPage.Height = new StyleDimension(12f, 1f); - bestiaryEntryInfoPage.HAlign = 1f; - UIBestiaryEntryInfoPage infoSpace = bestiaryEntryInfoPage; - this.AddSortAndFilterButtons(uiElement2, infoSpace); - this.AddSearchBar(uiElement2, infoSpace); - int num3 = 20; - UIElement element1 = new UIElement() - { - Width = new StyleDimension(0.0f, 1f), - Height = new StyleDimension((float) (-num2 - 6 - num3), 1f), - VAlign = 1f, - Top = new StyleDimension((float) -num3, 0.0f) - }; - element1.SetPadding(0.0f); - uiPanel.Append(element1); - UIElement uiElement3 = new UIElement() - { - Width = new StyleDimension(0.0f, 1f), - Height = new StyleDimension(20f, 0.0f), - VAlign = 1f - }; - uiPanel.Append(uiElement3); - uiElement3.SetPadding(0.0f); - this.FillProgressBottomBar(uiElement3); - UIElement element2 = new UIElement() - { - Width = new StyleDimension(-12f - infoSpace.Width.Pixels, 1f), - Height = new StyleDimension(-4f, 1f), - VAlign = 1f - }; - element1.Append(element2); - element2.SetPadding(0.0f); - this._bestiarySpace = element2; - UIBestiaryEntryGrid bestiaryEntryGrid = new UIBestiaryEntryGrid(this._workingSetEntries, new UIElement.MouseEvent(this.Click_SelectEntryButton)); - element2.Append((UIElement) bestiaryEntryGrid); - this._entryGrid = bestiaryEntryGrid; - this._entryGrid.OnGridContentsChanged += new Action(this.UpdateBestiaryGridRange); - element1.Append((UIElement) infoSpace); - this._infoSpace = infoSpace; - this.AddBackAndForwardButtons(uiElement2); - this._sortingGrid = new UIBestiarySortingOptionsGrid(this._sorter); - this._sortingGrid.OnClick += new UIElement.MouseEvent(this.Click_CloseSortingGrid); - this._sortingGrid.OnClickingOption += new Action(this.UpdateBestiaryContents); - this._filteringGrid = new UIBestiaryFilteringOptionsGrid(this._filterer); - this._filteringGrid.OnClick += new UIElement.MouseEvent(this.Click_CloseFilteringGrid); - this._filteringGrid.OnClickingOption += new Action(this.UpdateBestiaryContents); - this._filteringGrid.SetupAvailabilityTest(this._originalEntriesList); - this._searchBar.SetContents((string) null, true); - this.UpdateBestiaryContents(); - } - - private void FillProgressBottomBar(UIElement container) - { - UIText uiText = new UIText("", 0.8f); - uiText.HAlign = 0.0f; - uiText.VAlign = 1f; - uiText.TextOriginX = 0.0f; - this._progressPercentText = uiText; - UIColoredSliderSimple coloredSliderSimple1 = new UIColoredSliderSimple(); - coloredSliderSimple1.Width = new StyleDimension(0.0f, 1f); - coloredSliderSimple1.Height = new StyleDimension(15f, 0.0f); - coloredSliderSimple1.VAlign = 1f; - coloredSliderSimple1.FilledColor = new Color(51, 137, (int) byte.MaxValue); - coloredSliderSimple1.EmptyColor = new Color(35, 43, 81); - coloredSliderSimple1.FillPercent = 0.0f; - UIColoredSliderSimple coloredSliderSimple2 = coloredSliderSimple1; - coloredSliderSimple2.OnUpdate += new UIElement.ElementEvent(this.ShowStats_Completion); - this._unlocksProgressBar = coloredSliderSimple2; - container.Append((UIElement) coloredSliderSimple2); - } - - private void ShowStats_Completion(UIElement element) - { - if (!element.IsMouseHovering) - return; - string completionPercentText = this.GetCompletionPercentText(); - Main.instance.MouseText(completionPercentText); - } - - private string GetCompletionPercentText() => Language.GetTextValueWith("BestiaryInfo.PercentCollected", (object) new - { - Percent = Utils.PrettifyPercentDisplay(this.GetProgressPercent(), "P2") - }); - - private float GetProgressPercent() => this._progressReport.CompletionPercent; - - private void EmptyInteraction(float input) - { - } - - private void EmptyInteraction2() - { - } - - private Color GetColorAtBlip(float percentile) => (double) percentile < (double) this.GetProgressPercent() ? new Color(51, 137, (int) byte.MaxValue) : new Color(35, 40, 83); - - private void AddBackAndForwardButtons(UIElement innerTopContainer) - { - UIImageButton uiImageButton1 = new UIImageButton(Main.Assets.Request("Images/UI/Bestiary/Button_Back", (AssetRequestMode) 1)); - uiImageButton1.SetHoverImage(Main.Assets.Request("Images/UI/Bestiary/Button_Border", (AssetRequestMode) 1)); - uiImageButton1.SetVisibility(1f, 1f); - uiImageButton1.SetSnapPoint("BackPage", 0); - this._entryGrid.MakeButtonGoByOffset((UIElement) uiImageButton1, -1); - innerTopContainer.Append((UIElement) uiImageButton1); - UIImageButton uiImageButton2 = new UIImageButton(Main.Assets.Request("Images/UI/Bestiary/Button_Forward", (AssetRequestMode) 1)); - uiImageButton2.Left = new StyleDimension(uiImageButton1.Width.Pixels + 1f, 0.0f); - UIImageButton uiImageButton3 = uiImageButton2; - uiImageButton3.SetHoverImage(Main.Assets.Request("Images/UI/Bestiary/Button_Border", (AssetRequestMode) 1)); - uiImageButton3.SetVisibility(1f, 1f); - uiImageButton3.SetSnapPoint("NextPage", 0); - this._entryGrid.MakeButtonGoByOffset((UIElement) uiImageButton3, 1); - innerTopContainer.Append((UIElement) uiImageButton3); - UIPanel uiPanel1 = new UIPanel(); - uiPanel1.Left = new StyleDimension((float) ((double) uiImageButton1.Width.Pixels + 1.0 + (double) uiImageButton3.Width.Pixels + 3.0), 0.0f); - uiPanel1.Width = new StyleDimension(135f, 0.0f); - uiPanel1.Height = new StyleDimension(0.0f, 1f); - uiPanel1.VAlign = 0.5f; - UIPanel uiPanel2 = uiPanel1; - uiPanel2.BackgroundColor = new Color(35, 40, 83); - uiPanel2.BorderColor = new Color(35, 40, 83); - uiPanel2.SetPadding(0.0f); - innerTopContainer.Append((UIElement) uiPanel2); - UIText uiText1 = new UIText("9000-9999 (9001)", 0.8f); - uiText1.HAlign = 0.5f; - uiText1.VAlign = 0.5f; - UIText uiText2 = uiText1; - uiPanel2.Append((UIElement) uiText2); - this._indexesRangeText = uiText2; - } - - private void AddSortAndFilterButtons( - UIElement innerTopContainer, - UIBestiaryEntryInfoPage infoSpace) - { - int num = 17; - UIImageButton uiImageButton1 = new UIImageButton(Main.Assets.Request("Images/UI/Bestiary/Button_Filtering", (AssetRequestMode) 1)); - uiImageButton1.Left = new StyleDimension(-infoSpace.Width.Pixels - (float) num, 0.0f); - uiImageButton1.HAlign = 1f; - UIImageButton uiImageButton2 = uiImageButton1; - uiImageButton2.SetHoverImage(Main.Assets.Request("Images/UI/Bestiary/Button_Wide_Border", (AssetRequestMode) 1)); - uiImageButton2.SetVisibility(1f, 1f); - uiImageButton2.SetSnapPoint("FilterButton", 0); - uiImageButton2.OnClick += new UIElement.MouseEvent(this.OpenOrCloseFilteringGrid); - innerTopContainer.Append((UIElement) uiImageButton2); - UIText uiText1 = new UIText("", 0.8f); - uiText1.Left = new StyleDimension(34f, 0.0f); - uiText1.Top = new StyleDimension(2f, 0.0f); - uiText1.VAlign = 0.5f; - uiText1.TextOriginX = 0.0f; - UIText uiText2 = uiText1; - uiImageButton2.Append((UIElement) uiText2); - this._filteringText = uiText2; - UIImageButton uiImageButton3 = new UIImageButton(Main.Assets.Request("Images/UI/Bestiary/Button_Sorting", (AssetRequestMode) 1)); - uiImageButton3.Left = new StyleDimension((float) (-(double) infoSpace.Width.Pixels - (double) uiImageButton2.Width.Pixels - 3.0) - (float) num, 0.0f); - uiImageButton3.HAlign = 1f; - UIImageButton uiImageButton4 = uiImageButton3; - uiImageButton4.SetHoverImage(Main.Assets.Request("Images/UI/Bestiary/Button_Wide_Border", (AssetRequestMode) 1)); - uiImageButton4.SetVisibility(1f, 1f); - uiImageButton4.SetSnapPoint("SortButton", 0); - uiImageButton4.OnClick += new UIElement.MouseEvent(this.OpenOrCloseSortingOptions); - innerTopContainer.Append((UIElement) uiImageButton4); - UIText uiText3 = new UIText("", 0.8f); - uiText3.Left = new StyleDimension(34f, 0.0f); - uiText3.Top = new StyleDimension(2f, 0.0f); - uiText3.VAlign = 0.5f; - uiText3.TextOriginX = 0.0f; - UIText uiText4 = uiText3; - uiImageButton4.Append((UIElement) uiText4); - this._sortingText = uiText4; - } - - private void AddSearchBar(UIElement innerTopContainer, UIBestiaryEntryInfoPage infoSpace) - { - UIImageButton uiImageButton1 = new UIImageButton(Main.Assets.Request("Images/UI/Bestiary/Button_Search", (AssetRequestMode) 1)); - uiImageButton1.Left = new StyleDimension(-infoSpace.Width.Pixels, 1f); - uiImageButton1.VAlign = 0.5f; - UIImageButton uiImageButton2 = uiImageButton1; - uiImageButton2.OnClick += new UIElement.MouseEvent(this.Click_SearchArea); - uiImageButton2.SetHoverImage(Main.Assets.Request("Images/UI/Bestiary/Button_Search_Border", (AssetRequestMode) 1)); - uiImageButton2.SetVisibility(1f, 1f); - uiImageButton2.SetSnapPoint("SearchButton", 0); - innerTopContainer.Append((UIElement) uiImageButton2); - UIPanel uiPanel1 = new UIPanel(); - uiPanel1.Left = new StyleDimension((float) (-(double) infoSpace.Width.Pixels + (double) uiImageButton2.Width.Pixels + 3.0), 1f); - uiPanel1.Width = new StyleDimension((float) ((double) infoSpace.Width.Pixels - (double) uiImageButton2.Width.Pixels - 3.0), 0.0f); - uiPanel1.Height = new StyleDimension(0.0f, 1f); - uiPanel1.VAlign = 0.5f; - UIPanel uiPanel2 = uiPanel1; - this._searchBoxPanel = uiPanel2; - uiPanel2.BackgroundColor = new Color(35, 40, 83); - uiPanel2.BorderColor = new Color(35, 40, 83); - uiPanel2.SetPadding(0.0f); - innerTopContainer.Append((UIElement) uiPanel2); - UISearchBar uiSearchBar1 = new UISearchBar(Language.GetText("UI.PlayerNameSlot"), 0.8f); - uiSearchBar1.Width = new StyleDimension(0.0f, 1f); - uiSearchBar1.Height = new StyleDimension(0.0f, 1f); - uiSearchBar1.HAlign = 0.0f; - uiSearchBar1.VAlign = 0.5f; - uiSearchBar1.Left = new StyleDimension(0.0f, 0.0f); - uiSearchBar1.IgnoresMouseInteraction = true; - UISearchBar uiSearchBar2 = uiSearchBar1; - this._searchBar = uiSearchBar2; - uiPanel2.OnClick += new UIElement.MouseEvent(this.Click_SearchArea); - uiSearchBar2.OnContentsChanged += new Action(this.OnSearchContentsChanged); - uiPanel2.Append((UIElement) uiSearchBar2); - uiSearchBar2.OnStartTakingInput += new Action(this.OnStartTakingInput); - uiSearchBar2.OnEndTakingInput += new Action(this.OnEndTakingInput); - uiSearchBar2.OnNeedingVirtualKeyboard += new Action(this.OpenVirtualKeyboardWhenNeeded); - } - - private void OpenVirtualKeyboardWhenNeeded() - { - int length = 40; - UIVirtualKeyboard uiVirtualKeyboard = new UIVirtualKeyboard(Language.GetText("UI.PlayerNameSlot").Value, this._searchString, new UIVirtualKeyboard.KeyboardSubmitEvent(this.OnFinishedSettingName), new Action(this.GoBackHere), allowEmpty: true); - uiVirtualKeyboard.SetMaxInputLength(length); - UserInterface.ActiveInstance.SetState((UIState) uiVirtualKeyboard); - } - - private void OnFinishedSettingName(string name) - { - this._searchBar.SetContents(name.Trim()); - this.GoBackHere(); - } - - private void GoBackHere() - { - UserInterface.ActiveInstance.SetState((UIState) this); - this._searchBar.ToggleTakingText(); - } - - private void OnStartTakingInput() => this._searchBoxPanel.BorderColor = Main.OurFavoriteColor; - - private void OnEndTakingInput() => this._searchBoxPanel.BorderColor = new Color(35, 40, 83); - - private void OnSearchContentsChanged(string contents) - { - this._searchString = contents; - this._filterer.SetSearchFilter(contents); - this.UpdateBestiaryContents(); - } - - private void Click_SearchArea(UIMouseEvent evt, UIElement listeningElement) => this._searchBar.ToggleTakingText(); - - private void FilterEntries() - { - this._workingSetEntries.Clear(); - this._workingSetEntries.AddRange(this._originalEntriesList.Where(new Func(this._filterer.FitsFilter))); - } - - private void SortEntries() => this._workingSetEntries.Sort((IComparer) this._sorter); - - private void FillBestiarySpaceWithEntries() - { - if (this._entryGrid == null || this._entryGrid.Parent == null) - return; - this.DeselectEntryButton(); - this._progressReport = this.GetUnlockProgress(); - this._entryGrid.FillBestiarySpaceWithEntries(); - } - - public void UpdateBestiaryGridRange() => this._indexesRangeText.SetText(this._entryGrid.GetRangeText()); - - public override void Recalculate() - { - base.Recalculate(); - this.FillBestiarySpaceWithEntries(); - } - - private void GetEntriesToShow( - out int maxEntriesWidth, - out int maxEntriesHeight, - out int maxEntriesToHave) - { - Rectangle rectangle = this._bestiarySpace.GetDimensions().ToRectangle(); - maxEntriesWidth = rectangle.Width / 72; - maxEntriesHeight = rectangle.Height / 72; - int num = 0; - maxEntriesToHave = maxEntriesWidth * maxEntriesHeight - num; - } - - private void MakeExitButton(UIElement outerContainer) - { - UITextPanel uiTextPanel1 = new UITextPanel(Language.GetText("UI.Back"), 0.7f, true); - uiTextPanel1.Width = StyleDimension.FromPixelsAndPercent(-10f, 0.5f); - uiTextPanel1.Height = StyleDimension.FromPixels(50f); - uiTextPanel1.VAlign = 1f; - uiTextPanel1.HAlign = 0.5f; - uiTextPanel1.Top = StyleDimension.FromPixels(-25f); - UITextPanel uiTextPanel2 = uiTextPanel1; - uiTextPanel2.OnMouseOver += new UIElement.MouseEvent(this.FadedMouseOver); - uiTextPanel2.OnMouseOut += new UIElement.MouseEvent(this.FadedMouseOut); - uiTextPanel2.OnMouseDown += new UIElement.MouseEvent(this.Click_GoBack); - uiTextPanel2.SetSnapPoint("ExitButton", 0); - outerContainer.Append((UIElement) uiTextPanel2); - } - - private void Click_GoBack(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(11); - if (Main.gameMenu) - Main.menuMode = 0; - else - IngameFancyUI.Close(); - } - - private void OpenOrCloseSortingOptions(UIMouseEvent evt, UIElement listeningElement) - { - if (this._sortingGrid.Parent != null) - { - this.CloseSortingGrid(); - } - else - { - this._bestiarySpace.RemoveChild((UIElement) this._sortingGrid); - this._bestiarySpace.RemoveChild((UIElement) this._filteringGrid); - this._bestiarySpace.Append((UIElement) this._sortingGrid); - } - } - - private void OpenOrCloseFilteringGrid(UIMouseEvent evt, UIElement listeningElement) - { - if (this._filteringGrid.Parent != null) - { - this.CloseFilteringGrid(); - } - else - { - this._bestiarySpace.RemoveChild((UIElement) this._sortingGrid); - this._bestiarySpace.RemoveChild((UIElement) this._filteringGrid); - this._bestiarySpace.Append((UIElement) this._filteringGrid); - } - } - - private void Click_CloseFilteringGrid(UIMouseEvent evt, UIElement listeningElement) - { - if (evt.Target != this._filteringGrid) - return; - this.CloseFilteringGrid(); - } - - private void CloseFilteringGrid() - { - this.UpdateBestiaryContents(); - this._bestiarySpace.RemoveChild((UIElement) this._filteringGrid); - } - - private void UpdateBestiaryContents() - { - this._filteringGrid.UpdateAvailability(); - this._sortingText.SetText(this._sorter.GetDisplayName()); - this._filteringText.SetText(this._filterer.GetDisplayName()); - this.FilterEntries(); - this.SortEntries(); - this.FillBestiarySpaceWithEntries(); - this._progressReport = this.GetUnlockProgress(); - this._progressPercentText.SetText(this.GetCompletionPercentText()); - this._unlocksProgressBar.FillPercent = this.GetProgressPercent(); - } - - private void Click_CloseSortingGrid(UIMouseEvent evt, UIElement listeningElement) - { - if (evt.Target != this._sortingGrid) - return; - this.CloseSortingGrid(); - } - - private void CloseSortingGrid() - { - this.UpdateBestiaryContents(); - this._bestiarySpace.RemoveChild((UIElement) this._sortingGrid); - } - - private void FadedMouseOver(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(12); - ((UIPanel) evt.Target).BackgroundColor = new Color(73, 94, 171); - ((UIPanel) evt.Target).BorderColor = Colors.FancyUIFatButtonMouseOver; - } - - private void FadedMouseOut(UIMouseEvent evt, UIElement listeningElement) - { - ((UIPanel) evt.Target).BackgroundColor = new Color(63, 82, 151) * 0.8f; - ((UIPanel) evt.Target).BorderColor = Color.Black; - } - - private void Click_SelectEntryButton(UIMouseEvent evt, UIElement listeningElement) - { - UIBestiaryEntryButton button = (UIBestiaryEntryButton) listeningElement; - if (button == null) - return; - this.SelectEntryButton(button); - } - - private void SelectEntryButton(UIBestiaryEntryButton button) - { - this.DeselectEntryButton(); - this._selectedEntryButton = button; - this._infoSpace.FillInfoForEntry(button.Entry, new ExtraBestiaryInfoPageInformation() - { - BestiaryProgressReport = this._progressReport - }); - } - - private void DeselectEntryButton() => this._infoSpace.FillInfoForEntry((BestiaryEntry) null, new ExtraBestiaryInfoPageInformation()); - - public BestiaryUnlockProgressReport GetUnlockProgress() - { - float num1 = 0.0f; - int num2 = 0; - List originalEntriesList = this._originalEntriesList; - for (int index = 0; index < originalEntriesList.Count; ++index) - { - int num3 = originalEntriesList[index].UIInfoProvider.GetEntryUICollectionInfo().UnlockState > BestiaryEntryUnlockState.NotKnownAtAll_0 ? 1 : 0; - ++num2; - num1 += (float) num3; - } - return new BestiaryUnlockProgressReport() - { - EntriesTotal = num2, - CompletionAmountTotal = num1 - }; - } - - public override void Draw(SpriteBatch spriteBatch) - { - base.Draw(spriteBatch); - this.SetupGamepadPoints(spriteBatch); - } - - private void SetupGamepadPoints(SpriteBatch spriteBatch) - { - UILinkPointNavigator.Shortcuts.BackButtonCommand = 1; - int num1 = 3000; - int num2 = num1; - List snapPoints = this.GetSnapPoints(); - SnapPoint snap1 = (SnapPoint) null; - SnapPoint snap2 = (SnapPoint) null; - SnapPoint snap3 = (SnapPoint) null; - SnapPoint snap4 = (SnapPoint) null; - SnapPoint snap5 = (SnapPoint) null; - SnapPoint snap6 = (SnapPoint) null; - for (int index = 0; index < snapPoints.Count; ++index) - { - SnapPoint snapPoint = snapPoints[index]; - string name = snapPoint.Name; - if (!(name == "BackPage")) - { - if (!(name == "NextPage")) - { - if (!(name == "ExitButton")) - { - if (!(name == "FilterButton")) - { - if (!(name == "SortButton")) - { - if (name == "SearchButton") - snap5 = snapPoint; - } - else - snap3 = snapPoint; - } - else - snap4 = snapPoint; - } - else - snap6 = snapPoint; - } - else - snap2 = snapPoint; - } - else - snap1 = snapPoint; - } - int id1 = num2; - int num3 = id1 + 1; - UILinkPoint uiLinkPoint1 = this.MakeLinkPointFromSnapPoint(id1, snap1); - int id2 = num3; - int num4 = id2 + 1; - UILinkPoint uiLinkPoint2 = this.MakeLinkPointFromSnapPoint(id2, snap2); - int id3 = num4; - int num5 = id3 + 1; - UILinkPoint downSide1 = this.MakeLinkPointFromSnapPoint(id3, snap6); - int id4 = num5; - int num6 = id4 + 1; - UILinkPoint uiLinkPoint3 = this.MakeLinkPointFromSnapPoint(id4, snap4); - int id5 = num6; - int num7 = id5 + 1; - UILinkPoint uiLinkPoint4 = this.MakeLinkPointFromSnapPoint(id5, snap3); - int id6 = num7; - int currentID = id6 + 1; - UILinkPoint rightSide = this.MakeLinkPointFromSnapPoint(id6, snap5); - this.PairLeftRight(uiLinkPoint1, uiLinkPoint2); - this.PairLeftRight(uiLinkPoint2, uiLinkPoint4); - this.PairLeftRight(uiLinkPoint4, uiLinkPoint3); - this.PairLeftRight(uiLinkPoint3, rightSide); - downSide1.Up = uiLinkPoint2.ID; - UILinkPoint[,] gridPoints = new UILinkPoint[1, 1]; - if (this._filteringGrid.Parent != null) - { - int gridWidth; - int gridHeight; - this.SetupPointsForFilterGrid(ref currentID, snapPoints, out gridWidth, out gridHeight, out gridPoints); - this.PairUpDown(uiLinkPoint2, downSide1); - this.PairUpDown(uiLinkPoint1, downSide1); - for (int index = gridWidth - 1; index >= 0; --index) - { - UILinkPoint upSide1 = gridPoints[index, gridHeight - 1]; - if (upSide1 != null) - this.PairUpDown(upSide1, downSide1); - UILinkPoint upSide2 = gridPoints[index, gridHeight - 2]; - if (upSide2 != null && upSide1 == null) - this.PairUpDown(upSide2, downSide1); - UILinkPoint downSide2 = gridPoints[index, 0]; - if (downSide2 != null) - { - if (index < gridWidth - 3) - this.PairUpDown(uiLinkPoint4, downSide2); - else - this.PairUpDown(uiLinkPoint3, downSide2); - } - } - } - else if (this._sortingGrid.Parent != null) - { - int gridWidth; - int gridHeight; - this.SetupPointsForSortingGrid(ref currentID, snapPoints, out gridWidth, out gridHeight, out gridPoints); - this.PairUpDown(uiLinkPoint2, downSide1); - this.PairUpDown(uiLinkPoint1, downSide1); - for (int index = gridWidth - 1; index >= 0; --index) - { - UILinkPoint upSide = gridPoints[index, gridHeight - 1]; - if (upSide != null) - this.PairUpDown(upSide, downSide1); - UILinkPoint downSide3 = gridPoints[index, 0]; - if (downSide3 != null) - { - this.PairUpDown(uiLinkPoint3, downSide3); - this.PairUpDown(uiLinkPoint4, downSide3); - } - } - } - else if (this._entryGrid.Parent != null) - { - int gridWidth; - int gridHeight; - this.SetupPointsForEntryGrid(ref currentID, snapPoints, out gridWidth, out gridHeight, out gridPoints); - for (int index = 0; index < gridWidth; ++index) - { - if (gridHeight - 1 >= 0) - { - UILinkPoint upSide3 = gridPoints[index, gridHeight - 1]; - if (upSide3 != null) - this.PairUpDown(upSide3, downSide1); - if (gridHeight - 2 >= 0) - { - UILinkPoint upSide4 = gridPoints[index, gridHeight - 2]; - if (upSide4 != null && upSide3 == null) - this.PairUpDown(upSide4, downSide1); - } - } - UILinkPoint downSide4 = gridPoints[index, 0]; - if (downSide4 != null) - { - if (index < gridWidth / 2) - this.PairUpDown(uiLinkPoint2, downSide4); - else if (index == gridWidth - 1) - this.PairUpDown(uiLinkPoint3, downSide4); - else - this.PairUpDown(uiLinkPoint4, downSide4); - } - } - UILinkPoint downSide5 = gridPoints[0, 0]; - if (downSide5 != null) - { - this.PairUpDown(uiLinkPoint2, downSide5); - this.PairUpDown(uiLinkPoint1, downSide5); - } - else - { - this.PairUpDown(uiLinkPoint2, downSide1); - this.PairUpDown(uiLinkPoint1, downSide1); - this.PairUpDown(uiLinkPoint3, downSide1); - this.PairUpDown(uiLinkPoint4, downSide1); - } - } - List lostrefpoints = new List(); - for (int key = num1; key < currentID; ++key) - lostrefpoints.Add(UILinkPointNavigator.Points[key]); - if (!PlayerInput.UsingGamepadUI || UILinkPointNavigator.CurrentPoint < currentID) - return; - this.MoveToVisuallyClosestPoint(lostrefpoints); - } - - private void MoveToVisuallyClosestPoint(List lostrefpoints) - { - Dictionary points = UILinkPointNavigator.Points; - Vector2 mouseScreen = Main.MouseScreen; - UILinkPoint uiLinkPoint = (UILinkPoint) null; - foreach (UILinkPoint lostrefpoint in lostrefpoints) - { - if (uiLinkPoint == null || (double) Vector2.Distance(mouseScreen, uiLinkPoint.Position) > (double) Vector2.Distance(mouseScreen, lostrefpoint.Position)) - uiLinkPoint = lostrefpoint; - } - if (uiLinkPoint == null) - return; - UILinkPointNavigator.ChangePoint(uiLinkPoint.ID); - } - - private void SetupPointsForEntryGrid( - ref int currentID, - List pts, - out int gridWidth, - out int gridHeight, - out UILinkPoint[,] gridPoints) - { - List pointsByCategoryName = UIBestiaryTest.GetOrderedPointsByCategoryName(pts, "Entries"); - this._entryGrid.GetEntriesToShow(out gridWidth, out gridHeight, out int _); - gridPoints = new UILinkPoint[gridWidth, gridHeight]; - for (int index1 = 0; index1 < pointsByCategoryName.Count; ++index1) - { - int index2 = index1 % gridWidth; - int index3 = index1 / gridWidth; - gridPoints[index2, index3] = this.MakeLinkPointFromSnapPoint(currentID++, pointsByCategoryName[index1]); - } - for (int index4 = 0; index4 < gridWidth; ++index4) - { - for (int index5 = 0; index5 < gridHeight; ++index5) - { - UILinkPoint uiLinkPoint = gridPoints[index4, index5]; - if (index4 < gridWidth - 1) - { - UILinkPoint rightSide = gridPoints[index4 + 1, index5]; - if (uiLinkPoint != null && rightSide != null) - this.PairLeftRight(uiLinkPoint, rightSide); - } - if (index5 < gridHeight - 1) - { - UILinkPoint downSide = gridPoints[index4, index5 + 1]; - if (uiLinkPoint != null && downSide != null) - this.PairUpDown(uiLinkPoint, downSide); - } - } - } - } - - private void SetupPointsForFilterGrid( - ref int currentID, - List pts, - out int gridWidth, - out int gridHeight, - out UILinkPoint[,] gridPoints) - { - List pointsByCategoryName = UIBestiaryTest.GetOrderedPointsByCategoryName(pts, "Filters"); - this._filteringGrid.GetEntriesToShow(out gridWidth, out gridHeight, out int _); - gridPoints = new UILinkPoint[gridWidth, gridHeight]; - for (int index1 = 0; index1 < pointsByCategoryName.Count; ++index1) - { - int index2 = index1 % gridWidth; - int index3 = index1 / gridWidth; - gridPoints[index2, index3] = this.MakeLinkPointFromSnapPoint(currentID++, pointsByCategoryName[index1]); - } - for (int index4 = 0; index4 < gridWidth; ++index4) - { - for (int index5 = 0; index5 < gridHeight; ++index5) - { - UILinkPoint uiLinkPoint = gridPoints[index4, index5]; - if (index4 < gridWidth - 1) - { - UILinkPoint rightSide = gridPoints[index4 + 1, index5]; - if (uiLinkPoint != null && rightSide != null) - this.PairLeftRight(uiLinkPoint, rightSide); - } - if (index5 < gridHeight - 1) - { - UILinkPoint downSide = gridPoints[index4, index5 + 1]; - if (uiLinkPoint != null && downSide != null) - this.PairUpDown(uiLinkPoint, downSide); - } - } - } - } - - private void SetupPointsForSortingGrid( - ref int currentID, - List pts, - out int gridWidth, - out int gridHeight, - out UILinkPoint[,] gridPoints) - { - List pointsByCategoryName = UIBestiaryTest.GetOrderedPointsByCategoryName(pts, "SortSteps"); - this._sortingGrid.GetEntriesToShow(out gridWidth, out gridHeight, out int _); - gridPoints = new UILinkPoint[gridWidth, gridHeight]; - for (int index1 = 0; index1 < pointsByCategoryName.Count; ++index1) - { - int index2 = index1 % gridWidth; - int index3 = index1 / gridWidth; - gridPoints[index2, index3] = this.MakeLinkPointFromSnapPoint(currentID++, pointsByCategoryName[index1]); - } - for (int index4 = 0; index4 < gridWidth; ++index4) - { - for (int index5 = 0; index5 < gridHeight; ++index5) - { - UILinkPoint uiLinkPoint = gridPoints[index4, index5]; - if (index4 < gridWidth - 1) - { - UILinkPoint rightSide = gridPoints[index4 + 1, index5]; - if (uiLinkPoint != null && rightSide != null) - this.PairLeftRight(uiLinkPoint, rightSide); - } - if (index5 < gridHeight - 1) - { - UILinkPoint downSide = gridPoints[index4, index5 + 1]; - if (uiLinkPoint != null && downSide != null) - this.PairUpDown(uiLinkPoint, downSide); - } - } - } - } - - private static List GetOrderedPointsByCategoryName( - List pts, - string name) - { - return pts.Where((Func) (x => x.Name == name)).OrderBy((Func) (x => x.Id)).ToList(); - } - - private void PairLeftRight(UILinkPoint leftSide, UILinkPoint rightSide) - { - leftSide.Right = rightSide.ID; - rightSide.Left = leftSide.ID; - } - - private void PairUpDown(UILinkPoint upSide, UILinkPoint downSide) - { - upSide.Down = downSide.ID; - downSide.Up = upSide.ID; - } - - private UILinkPoint MakeLinkPointFromSnapPoint(int id, SnapPoint snap) - { - UILinkPointNavigator.SetPosition(id, snap.Position); - UILinkPoint point = UILinkPointNavigator.Points[id]; - point.Unlink(); - return point; - } - - public override void ScrollWheel(UIScrollWheelEvent evt) - { - base.ScrollWheel(evt); - this._infoSpace.UpdateScrollbar(evt.ScrollWheelValue); - } - - public void TryMovingPages(int direction) => this._entryGrid.OffsetLibraryByPages(direction); - } -} diff --git a/GameContent/UI/States/UICharacterCreation.cs b/GameContent/UI/States/UICharacterCreation.cs deleted file mode 100644 index 08a47ff..0000000 --- a/GameContent/UI/States/UICharacterCreation.cs +++ /dev/null @@ -1,1512 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.States.UICharacterCreation -// 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; -using Microsoft.Xna.Framework.Graphics; -using Newtonsoft.Json; -using ReLogic.Content; -using ReLogic.OS; -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using Terraria.Audio; -using Terraria.GameContent.Creative; -using Terraria.GameContent.UI.Elements; -using Terraria.GameInput; -using Terraria.ID; -using Terraria.Initializers; -using Terraria.IO; -using Terraria.Localization; -using Terraria.UI; -using Terraria.UI.Gamepad; - -namespace Terraria.GameContent.UI.States -{ - public class UICharacterCreation : UIState - { - private int[] _validClothStyles = new int[10] - { - 0, - 2, - 1, - 3, - 8, - 4, - 6, - 5, - 7, - 9 - }; - private readonly Player _player; - private UIColoredImageButton[] _colorPickers; - private UICharacterCreation.CategoryId _selectedPicker; - private Vector3 _currentColorHSL; - private UIColoredImageButton _clothingStylesCategoryButton; - private UIColoredImageButton _hairStylesCategoryButton; - private UIColoredImageButton _charInfoCategoryButton; - private UIElement _topContainer; - private UIElement _middleContainer; - private UIElement _hslContainer; - private UIElement _hairstylesContainer; - private UIElement _clothStylesContainer; - private UIElement _infoContainer; - private UIText _hslHexText; - private UIText _difficultyDescriptionText; - private UIElement _copyHexButton; - private UIElement _pasteHexButton; - private UIElement _randomColorButton; - private UIElement _copyTemplateButton; - private UIElement _pasteTemplateButton; - private UIElement _randomizePlayerButton; - private UIColoredImageButton _genderMale; - private UIColoredImageButton _genderFemale; - private UICharacterNameButton _charName; - private UIText _helpGlyphLeft; - private UIText _helpGlyphRight; - private UIGamepadHelper _helper; - private List _foundPoints = new List(); - - public UICharacterCreation(Player player) - { - this._player = player; - this._player.difficulty = (byte) 3; - this.BuildPage(); - } - - private void BuildPage() - { - this.RemoveAllChildren(); - int num = 4; - UIElement uiElement1 = new UIElement() - { - Width = StyleDimension.FromPixels(500f), - Height = StyleDimension.FromPixels((float) (380 + num)), - Top = StyleDimension.FromPixels(220f), - HAlign = 0.5f, - VAlign = 0.0f - }; - uiElement1.SetPadding(0.0f); - this.Append(uiElement1); - UIPanel uiPanel = new UIPanel(); - uiPanel.Width = StyleDimension.FromPercent(1f); - uiPanel.Height = StyleDimension.FromPixels(uiElement1.Height.Pixels - 150f - (float) num); - uiPanel.Top = StyleDimension.FromPixels(50f); - uiPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f; - UIPanel container = uiPanel; - container.SetPadding(0.0f); - uiElement1.Append((UIElement) container); - this.MakeBackAndCreatebuttons(uiElement1); - this.MakeCharPreview(container); - UIElement uiElement2 = new UIElement() - { - Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f), - Height = StyleDimension.FromPixelsAndPercent(50f, 0.0f) - }; - uiElement2.SetPadding(0.0f); - uiElement2.PaddingTop = 4f; - uiElement2.PaddingBottom = 0.0f; - container.Append(uiElement2); - UIElement uiElement3 = new UIElement() - { - Top = StyleDimension.FromPixelsAndPercent(uiElement2.Height.Pixels + 6f, 0.0f), - Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f), - Height = StyleDimension.FromPixelsAndPercent(container.Height.Pixels - 70f, 0.0f) - }; - uiElement3.SetPadding(0.0f); - uiElement3.PaddingTop = 3f; - uiElement3.PaddingBottom = 0.0f; - container.Append(uiElement3); - this._topContainer = uiElement2; - this._middleContainer = uiElement3; - this.MakeInfoMenu(uiElement3); - this.MakeHSLMenu(uiElement3); - this.MakeHairsylesMenu(uiElement3); - this.MakeClothStylesMenu(uiElement3); - this.MakeCategoriesBar(uiElement2); - this.Click_CharInfo((UIMouseEvent) null, (UIElement) null); - } - - private void MakeCharPreview(UIPanel container) - { - float num1 = 70f; - for (float num2 = 0.0f; (double) num2 <= 1.0; ++num2) - { - UICharacter uiCharacter1 = new UICharacter(this._player, true, false, 1.5f); - uiCharacter1.Width = StyleDimension.FromPixels(80f); - uiCharacter1.Height = StyleDimension.FromPixelsAndPercent(80f, 0.0f); - uiCharacter1.Top = StyleDimension.FromPixelsAndPercent(-num1, 0.0f); - uiCharacter1.VAlign = 0.0f; - uiCharacter1.HAlign = 0.5f; - UICharacter uiCharacter2 = uiCharacter1; - container.Append((UIElement) uiCharacter2); - } - } - - private void MakeHairsylesMenu(UIElement middleInnerPanel) - { - Main.Hairstyles.UpdateUnlocks(); - UIElement element = new UIElement() - { - Width = StyleDimension.FromPixelsAndPercent(-10f, 1f), - Height = StyleDimension.FromPixelsAndPercent(0.0f, 1f), - HAlign = 0.5f, - VAlign = 0.5f, - Top = StyleDimension.FromPixels(6f) - }; - middleInnerPanel.Append(element); - element.SetPadding(0.0f); - UIList uiList1 = new UIList(); - uiList1.Width = StyleDimension.FromPixelsAndPercent(-18f, 1f); - uiList1.Height = StyleDimension.FromPixelsAndPercent(-6f, 1f); - UIList uiList2 = uiList1; - uiList2.SetPadding(4f); - element.Append((UIElement) uiList2); - UIScrollbar uiScrollbar = new UIScrollbar(); - uiScrollbar.HAlign = 1f; - uiScrollbar.Height = StyleDimension.FromPixelsAndPercent(-30f, 1f); - uiScrollbar.Top = StyleDimension.FromPixels(10f); - UIScrollbar scrollbar = uiScrollbar; - scrollbar.SetView(100f, 1000f); - uiList2.SetScrollbar(scrollbar); - element.Append((UIElement) scrollbar); - int count = Main.Hairstyles.AvailableHairstyles.Count; - UIElement uiElement = new UIElement() - { - Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f), - Height = StyleDimension.FromPixelsAndPercent((float) (48 * (count / 10 + (count % 10 == 0 ? 0 : 1))), 0.0f) - }; - uiList2.Add(uiElement); - uiElement.SetPadding(0.0f); - for (int index = 0; index < count; ++index) - { - UIHairStyleButton uiHairStyleButton1 = new UIHairStyleButton(this._player, Main.Hairstyles.AvailableHairstyles[index]); - uiHairStyleButton1.Left = StyleDimension.FromPixels((float) ((double) (index % 10) * 46.0 + 6.0)); - uiHairStyleButton1.Top = StyleDimension.FromPixels((float) ((double) (index / 10) * 48.0 + 1.0)); - UIHairStyleButton uiHairStyleButton2 = uiHairStyleButton1; - uiHairStyleButton2.SetSnapPoint("Middle", index); - uiElement.Append((UIElement) uiHairStyleButton2); - } - this._hairstylesContainer = element; - } - - private void MakeClothStylesMenu(UIElement middleInnerPanel) - { - UIElement element1 = new UIElement() - { - Width = StyleDimension.FromPixelsAndPercent(-10f, 1f), - Height = StyleDimension.FromPixelsAndPercent(0.0f, 1f), - HAlign = 0.5f, - VAlign = 0.5f - }; - middleInnerPanel.Append(element1); - element1.SetPadding(0.0f); - int num1 = 15; - for (int id = 0; id < this._validClothStyles.Length; ++id) - { - int num2 = 0; - if (id >= this._validClothStyles.Length / 2) - num2 = 20; - UIClothStyleButton clothStyleButton1 = new UIClothStyleButton(this._player, this._validClothStyles[id]); - clothStyleButton1.Left = StyleDimension.FromPixels((float) ((double) id * 46.0 + (double) num2 + 6.0)); - clothStyleButton1.Top = StyleDimension.FromPixels((float) num1); - UIClothStyleButton clothStyleButton2 = clothStyleButton1; - clothStyleButton2.OnMouseDown += new UIElement.MouseEvent(this.Click_CharClothStyle); - clothStyleButton2.SetSnapPoint("Middle", id); - element1.Append((UIElement) clothStyleButton2); - } - for (int index = 0; index < 2; ++index) - { - int num3 = 0; - if (index >= 1) - num3 = 20; - UIHorizontalSeparator horizontalSeparator1 = new UIHorizontalSeparator(); - horizontalSeparator1.Left = StyleDimension.FromPixels((float) ((double) index * 230.0 + (double) num3 + 6.0)); - horizontalSeparator1.Top = StyleDimension.FromPixels((float) (num1 + 86)); - horizontalSeparator1.Width = StyleDimension.FromPixelsAndPercent(230f, 0.0f); - horizontalSeparator1.Color = Color.Lerp(Color.White, new Color(63, 65, 151, (int) byte.MaxValue), 0.85f) * 0.9f; - UIHorizontalSeparator horizontalSeparator2 = horizontalSeparator1; - element1.Append((UIElement) horizontalSeparator2); - UIColoredImageButton pickerWithoutClick = this.CreatePickerWithoutClick(UICharacterCreation.CategoryId.Clothing, "Images/UI/CharCreation/" + (index == 0 ? "ClothStyleMale" : "ClothStyleFemale"), 0.0f, 0.0f); - pickerWithoutClick.Top = StyleDimension.FromPixelsAndPercent((float) (num1 + 92), 0.0f); - pickerWithoutClick.Left = StyleDimension.FromPixels((float) ((double) index * 230.0 + 92.0 + (double) num3 + 6.0)); - pickerWithoutClick.HAlign = 0.0f; - pickerWithoutClick.VAlign = 0.0f; - element1.Append((UIElement) pickerWithoutClick); - if (index == 0) - { - pickerWithoutClick.OnMouseDown += new UIElement.MouseEvent(this.Click_CharGenderMale); - this._genderMale = pickerWithoutClick; - } - else - { - pickerWithoutClick.OnMouseDown += new UIElement.MouseEvent(this.Click_CharGenderFemale); - this._genderFemale = pickerWithoutClick; - } - pickerWithoutClick.SetSnapPoint("Low", index * 4); - } - UIElement element2 = new UIElement() - { - Width = StyleDimension.FromPixels(130f), - Height = StyleDimension.FromPixels(50f), - HAlign = 0.5f, - VAlign = 1f - }; - element1.Append(element2); - UIColoredImageButton coloredImageButton1 = new UIColoredImageButton(Main.Assets.Request("Images/UI/CharCreation/Copy", (AssetRequestMode) 1), true); - coloredImageButton1.VAlign = 0.5f; - coloredImageButton1.HAlign = 0.0f; - coloredImageButton1.Left = StyleDimension.FromPixelsAndPercent(0.0f, 0.0f); - UIColoredImageButton coloredImageButton2 = coloredImageButton1; - coloredImageButton2.OnMouseDown += new UIElement.MouseEvent(this.Click_CopyPlayerTemplate); - element2.Append((UIElement) coloredImageButton2); - this._copyTemplateButton = (UIElement) coloredImageButton2; - UIColoredImageButton coloredImageButton3 = new UIColoredImageButton(Main.Assets.Request("Images/UI/CharCreation/Paste", (AssetRequestMode) 1), true); - coloredImageButton3.VAlign = 0.5f; - coloredImageButton3.HAlign = 0.5f; - UIColoredImageButton coloredImageButton4 = coloredImageButton3; - coloredImageButton4.OnMouseDown += new UIElement.MouseEvent(this.Click_PastePlayerTemplate); - element2.Append((UIElement) coloredImageButton4); - this._pasteTemplateButton = (UIElement) coloredImageButton4; - UIColoredImageButton coloredImageButton5 = new UIColoredImageButton(Main.Assets.Request("Images/UI/CharCreation/Randomize", (AssetRequestMode) 1), true); - coloredImageButton5.VAlign = 0.5f; - coloredImageButton5.HAlign = 1f; - UIColoredImageButton coloredImageButton6 = coloredImageButton5; - coloredImageButton6.OnMouseDown += new UIElement.MouseEvent(this.Click_RandomizePlayer); - element2.Append((UIElement) coloredImageButton6); - this._randomizePlayerButton = (UIElement) coloredImageButton6; - coloredImageButton2.SetSnapPoint("Low", 1); - coloredImageButton4.SetSnapPoint("Low", 2); - coloredImageButton6.SetSnapPoint("Low", 3); - this._clothStylesContainer = element1; - } - - private void MakeCategoriesBar(UIElement categoryContainer) - { - float xPositionStart = -240f; - float xPositionPerId = 48f; - this._colorPickers = new UIColoredImageButton[10]; - categoryContainer.Append((UIElement) this.CreateColorPicker(UICharacterCreation.CategoryId.HairColor, "Images/UI/CharCreation/ColorHair", xPositionStart, xPositionPerId)); - categoryContainer.Append((UIElement) this.CreateColorPicker(UICharacterCreation.CategoryId.Eye, "Images/UI/CharCreation/ColorEye", xPositionStart, xPositionPerId)); - categoryContainer.Append((UIElement) this.CreateColorPicker(UICharacterCreation.CategoryId.Skin, "Images/UI/CharCreation/ColorSkin", xPositionStart, xPositionPerId)); - categoryContainer.Append((UIElement) this.CreateColorPicker(UICharacterCreation.CategoryId.Shirt, "Images/UI/CharCreation/ColorShirt", xPositionStart, xPositionPerId)); - categoryContainer.Append((UIElement) this.CreateColorPicker(UICharacterCreation.CategoryId.Undershirt, "Images/UI/CharCreation/ColorUndershirt", xPositionStart, xPositionPerId)); - categoryContainer.Append((UIElement) this.CreateColorPicker(UICharacterCreation.CategoryId.Pants, "Images/UI/CharCreation/ColorPants", xPositionStart, xPositionPerId)); - categoryContainer.Append((UIElement) this.CreateColorPicker(UICharacterCreation.CategoryId.Shoes, "Images/UI/CharCreation/ColorShoes", xPositionStart, xPositionPerId)); - this._colorPickers[4].SetMiddleTexture(Main.Assets.Request("Images/UI/CharCreation/ColorEyeBack", (AssetRequestMode) 1)); - this._clothingStylesCategoryButton = this.CreatePickerWithoutClick(UICharacterCreation.CategoryId.Clothing, "Images/UI/CharCreation/ClothStyleMale", xPositionStart, xPositionPerId); - this._clothingStylesCategoryButton.OnMouseDown += new UIElement.MouseEvent(this.Click_ClothStyles); - this._clothingStylesCategoryButton.SetSnapPoint("Top", 1); - categoryContainer.Append((UIElement) this._clothingStylesCategoryButton); - this._hairStylesCategoryButton = this.CreatePickerWithoutClick(UICharacterCreation.CategoryId.HairStyle, "Images/UI/CharCreation/HairStyle_Hair", xPositionStart, xPositionPerId); - this._hairStylesCategoryButton.OnMouseDown += new UIElement.MouseEvent(this.Click_HairStyles); - this._hairStylesCategoryButton.SetMiddleTexture(Main.Assets.Request("Images/UI/CharCreation/HairStyle_Arrow", (AssetRequestMode) 1)); - this._hairStylesCategoryButton.SetSnapPoint("Top", 2); - categoryContainer.Append((UIElement) this._hairStylesCategoryButton); - this._charInfoCategoryButton = this.CreatePickerWithoutClick(UICharacterCreation.CategoryId.CharInfo, "Images/UI/CharCreation/CharInfo", xPositionStart, xPositionPerId); - this._charInfoCategoryButton.OnMouseDown += new UIElement.MouseEvent(this.Click_CharInfo); - this._charInfoCategoryButton.SetSnapPoint("Top", 0); - categoryContainer.Append((UIElement) this._charInfoCategoryButton); - this.UpdateColorPickers(); - UIHorizontalSeparator horizontalSeparator1 = new UIHorizontalSeparator(); - horizontalSeparator1.Width = StyleDimension.FromPixelsAndPercent(-20f, 1f); - horizontalSeparator1.Top = StyleDimension.FromPixels(6f); - horizontalSeparator1.VAlign = 1f; - horizontalSeparator1.HAlign = 0.5f; - horizontalSeparator1.Color = Color.Lerp(Color.White, new Color(63, 65, 151, (int) byte.MaxValue), 0.85f) * 0.9f; - UIHorizontalSeparator horizontalSeparator2 = horizontalSeparator1; - categoryContainer.Append((UIElement) horizontalSeparator2); - int num = 21; - UIText uiText1 = new UIText(PlayerInput.GenerateInputTag_ForCurrentGamemode(false, "HotbarMinus")); - uiText1.Left = new StyleDimension((float) -num, 0.0f); - uiText1.VAlign = 0.5f; - uiText1.Top = new StyleDimension(-4f, 0.0f); - UIText uiText2 = uiText1; - categoryContainer.Append((UIElement) uiText2); - UIText uiText3 = new UIText(PlayerInput.GenerateInputTag_ForCurrentGamemode(false, "HotbarMinus")); - uiText3.HAlign = 1f; - uiText3.Left = new StyleDimension((float) (12 + num), 0.0f); - uiText3.VAlign = 0.5f; - uiText3.Top = new StyleDimension(-4f, 0.0f); - UIText uiText4 = uiText3; - categoryContainer.Append((UIElement) uiText4); - this._helpGlyphLeft = uiText2; - this._helpGlyphRight = uiText4; - categoryContainer.OnUpdate += new UIElement.ElementEvent(this.UpdateHelpGlyphs); - } - - private void UpdateHelpGlyphs(UIElement element) - { - string text1 = ""; - string text2 = ""; - if (PlayerInput.UsingGamepad) - { - text1 = PlayerInput.GenerateInputTag_ForCurrentGamemode(false, "HotbarMinus"); - text2 = PlayerInput.GenerateInputTag_ForCurrentGamemode(false, "HotbarPlus"); - } - this._helpGlyphLeft.SetText(text1); - this._helpGlyphRight.SetText(text2); - } - - private UIColoredImageButton CreateColorPicker( - UICharacterCreation.CategoryId id, - string texturePath, - float xPositionStart, - float xPositionPerId) - { - UIColoredImageButton coloredImageButton = new UIColoredImageButton(Main.Assets.Request(texturePath, (AssetRequestMode) 1)); - this._colorPickers[(int) id] = coloredImageButton; - coloredImageButton.VAlign = 0.0f; - coloredImageButton.HAlign = 0.0f; - coloredImageButton.Left.Set(xPositionStart + (float) id * xPositionPerId, 0.5f); - coloredImageButton.OnMouseDown += new UIElement.MouseEvent(this.Click_ColorPicker); - coloredImageButton.SetSnapPoint("Top", (int) id); - return coloredImageButton; - } - - private UIColoredImageButton CreatePickerWithoutClick( - UICharacterCreation.CategoryId id, - string texturePath, - float xPositionStart, - float xPositionPerId) - { - UIColoredImageButton coloredImageButton = new UIColoredImageButton(Main.Assets.Request(texturePath, (AssetRequestMode) 1)); - coloredImageButton.VAlign = 0.0f; - coloredImageButton.HAlign = 0.0f; - coloredImageButton.Left.Set(xPositionStart + (float) id * xPositionPerId, 0.5f); - return coloredImageButton; - } - - private void MakeInfoMenu(UIElement parentContainer) - { - UIElement element1 = new UIElement() - { - Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f), - Height = StyleDimension.FromPixelsAndPercent(0.0f, 1f), - HAlign = 0.5f, - VAlign = 0.0f - }; - element1.SetPadding(10f); - element1.PaddingBottom = 0.0f; - element1.PaddingTop = 0.0f; - parentContainer.Append(element1); - UICharacterNameButton characterNameButton = new UICharacterNameButton(Language.GetText("UI.WorldCreationName"), Language.GetText("UI.PlayerEmptyName")); - characterNameButton.Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f); - characterNameButton.HAlign = 0.5f; - element1.Append((UIElement) characterNameButton); - this._charName = characterNameButton; - characterNameButton.OnMouseDown += new UIElement.MouseEvent(this.Click_Naming); - characterNameButton.SetSnapPoint("Middle", 0); - float num1 = 4f; - float num2 = 0.0f; - float percent = 0.4f; - UIElement element2 = new UIElement() - { - HAlign = 0.0f, - VAlign = 1f, - Width = StyleDimension.FromPixelsAndPercent(-num1, percent), - Height = StyleDimension.FromPixelsAndPercent(-50f, 1f) - }; - element2.SetPadding(0.0f); - element1.Append(element2); - UISlicedImage uiSlicedImage1 = new UISlicedImage(Main.Assets.Request("Images/UI/CharCreation/CategoryPanelHighlight", (AssetRequestMode) 1)); - uiSlicedImage1.HAlign = 1f; - uiSlicedImage1.VAlign = 1f; - uiSlicedImage1.Width = StyleDimension.FromPixelsAndPercent((float) (-(double) num1 * 2.0), 1f - percent); - uiSlicedImage1.Left = StyleDimension.FromPixels(-num1); - uiSlicedImage1.Height = StyleDimension.FromPixelsAndPercent(element2.Height.Pixels, element2.Height.Precent); - UISlicedImage uiSlicedImage2 = uiSlicedImage1; - uiSlicedImage2.SetSliceDepths(10); - uiSlicedImage2.Color = Color.LightGray * 0.7f; - element1.Append((UIElement) uiSlicedImage2); - float num3 = 4f; - UIDifficultyButton difficultyButton1 = new UIDifficultyButton(this._player, Lang.menu[26], Lang.menu[31], (byte) 0, Color.Cyan); - difficultyButton1.HAlign = 0.0f; - difficultyButton1.VAlign = (float) (1.0 / ((double) num3 - 1.0)); - difficultyButton1.Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f); - difficultyButton1.Height = StyleDimension.FromPixelsAndPercent(-num2, 1f / num3); - UIDifficultyButton difficultyButton2 = difficultyButton1; - UIDifficultyButton difficultyButton3 = new UIDifficultyButton(this._player, Lang.menu[25], Lang.menu[30], (byte) 1, Main.mcColor); - difficultyButton3.HAlign = 0.0f; - difficultyButton3.VAlign = (float) (2.0 / ((double) num3 - 1.0)); - difficultyButton3.Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f); - difficultyButton3.Height = StyleDimension.FromPixelsAndPercent(-num2, 1f / num3); - UIDifficultyButton difficultyButton4 = difficultyButton3; - UIDifficultyButton difficultyButton5 = new UIDifficultyButton(this._player, Lang.menu[24], Lang.menu[29], (byte) 2, Main.hcColor); - difficultyButton5.HAlign = 0.0f; - difficultyButton5.VAlign = 1f; - difficultyButton5.Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f); - difficultyButton5.Height = StyleDimension.FromPixelsAndPercent(-num2, 1f / num3); - UIDifficultyButton difficultyButton6 = difficultyButton5; - UIDifficultyButton difficultyButton7 = new UIDifficultyButton(this._player, Language.GetText("UI.Creative"), Language.GetText("UI.CreativeDescriptionPlayer"), (byte) 3, Main.creativeModeColor); - difficultyButton7.HAlign = 0.0f; - difficultyButton7.VAlign = 0.0f; - difficultyButton7.Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f); - difficultyButton7.Height = StyleDimension.FromPixelsAndPercent(-num2, 1f / num3); - UIDifficultyButton difficultyButton8 = difficultyButton7; - UIText uiText1 = new UIText(Lang.menu[26]); - uiText1.HAlign = 0.0f; - uiText1.VAlign = 0.5f; - uiText1.Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f); - uiText1.Height = StyleDimension.FromPixelsAndPercent(0.0f, 1f); - uiText1.Top = StyleDimension.FromPixelsAndPercent(15f, 0.0f); - uiText1.IsWrapped = true; - UIText uiText2 = uiText1; - uiText2.PaddingLeft = 20f; - uiText2.PaddingRight = 20f; - uiSlicedImage2.Append((UIElement) uiText2); - element2.Append((UIElement) difficultyButton2); - element2.Append((UIElement) difficultyButton4); - element2.Append((UIElement) difficultyButton6); - element2.Append((UIElement) difficultyButton8); - this._infoContainer = element1; - this._difficultyDescriptionText = uiText2; - difficultyButton2.OnMouseDown += new UIElement.MouseEvent(this.UpdateDifficultyDescription); - difficultyButton4.OnMouseDown += new UIElement.MouseEvent(this.UpdateDifficultyDescription); - difficultyButton6.OnMouseDown += new UIElement.MouseEvent(this.UpdateDifficultyDescription); - difficultyButton8.OnMouseDown += new UIElement.MouseEvent(this.UpdateDifficultyDescription); - this.UpdateDifficultyDescription((UIMouseEvent) null, (UIElement) null); - difficultyButton2.SetSnapPoint("Middle", 1); - difficultyButton4.SetSnapPoint("Middle", 2); - difficultyButton6.SetSnapPoint("Middle", 3); - difficultyButton8.SetSnapPoint("Middle", 4); - } - - private void UpdateDifficultyDescription(UIMouseEvent evt, UIElement listeningElement) - { - LocalizedText text = Lang.menu[31]; - switch (this._player.difficulty) - { - case 0: - text = Lang.menu[31]; - break; - case 1: - text = Lang.menu[30]; - break; - case 2: - text = Lang.menu[29]; - break; - case 3: - text = Language.GetText("UI.CreativeDescriptionPlayer"); - break; - } - this._difficultyDescriptionText.SetText(text); - } - - private void MakeHSLMenu(UIElement parentContainer) - { - UIElement element1 = new UIElement() - { - Width = StyleDimension.FromPixelsAndPercent(220f, 0.0f), - Height = StyleDimension.FromPixelsAndPercent(158f, 0.0f), - HAlign = 0.5f, - VAlign = 0.0f - }; - element1.SetPadding(0.0f); - parentContainer.Append(element1); - UIPanel uiPanel1 = new UIPanel(); - uiPanel1.Width = StyleDimension.FromPixelsAndPercent(220f, 0.0f); - uiPanel1.Height = StyleDimension.FromPixelsAndPercent(104f, 0.0f); - uiPanel1.HAlign = 0.5f; - uiPanel1.VAlign = 0.0f; - uiPanel1.Top = StyleDimension.FromPixelsAndPercent(10f, 0.0f); - UIElement element2 = (UIElement) uiPanel1; - element2.SetPadding(0.0f); - element2.PaddingTop = 3f; - element1.Append(element2); - element2.Append((UIElement) this.CreateHSLSlider(UICharacterCreation.HSLSliderId.Hue)); - element2.Append((UIElement) this.CreateHSLSlider(UICharacterCreation.HSLSliderId.Saturation)); - element2.Append((UIElement) this.CreateHSLSlider(UICharacterCreation.HSLSliderId.Luminance)); - UIPanel uiPanel2 = new UIPanel(); - uiPanel2.VAlign = 1f; - uiPanel2.HAlign = 1f; - uiPanel2.Width = StyleDimension.FromPixelsAndPercent(100f, 0.0f); - uiPanel2.Height = StyleDimension.FromPixelsAndPercent(32f, 0.0f); - UIPanel uiPanel3 = uiPanel2; - UIText uiText1 = new UIText("FFFFFF"); - uiText1.VAlign = 0.5f; - uiText1.HAlign = 0.5f; - UIText uiText2 = uiText1; - uiPanel3.Append((UIElement) uiText2); - element1.Append((UIElement) uiPanel3); - UIColoredImageButton coloredImageButton1 = new UIColoredImageButton(Main.Assets.Request("Images/UI/CharCreation/Copy", (AssetRequestMode) 1), true); - coloredImageButton1.VAlign = 1f; - coloredImageButton1.HAlign = 0.0f; - coloredImageButton1.Left = StyleDimension.FromPixelsAndPercent(0.0f, 0.0f); - UIColoredImageButton coloredImageButton2 = coloredImageButton1; - coloredImageButton2.OnMouseDown += new UIElement.MouseEvent(this.Click_CopyHex); - element1.Append((UIElement) coloredImageButton2); - this._copyHexButton = (UIElement) coloredImageButton2; - UIColoredImageButton coloredImageButton3 = new UIColoredImageButton(Main.Assets.Request("Images/UI/CharCreation/Paste", (AssetRequestMode) 1), true); - coloredImageButton3.VAlign = 1f; - coloredImageButton3.HAlign = 0.0f; - coloredImageButton3.Left = StyleDimension.FromPixelsAndPercent(40f, 0.0f); - UIColoredImageButton coloredImageButton4 = coloredImageButton3; - coloredImageButton4.OnMouseDown += new UIElement.MouseEvent(this.Click_PasteHex); - element1.Append((UIElement) coloredImageButton4); - this._pasteHexButton = (UIElement) coloredImageButton4; - UIColoredImageButton coloredImageButton5 = new UIColoredImageButton(Main.Assets.Request("Images/UI/CharCreation/Randomize", (AssetRequestMode) 1), true); - coloredImageButton5.VAlign = 1f; - coloredImageButton5.HAlign = 0.0f; - coloredImageButton5.Left = StyleDimension.FromPixelsAndPercent(80f, 0.0f); - UIColoredImageButton coloredImageButton6 = coloredImageButton5; - coloredImageButton6.OnMouseDown += new UIElement.MouseEvent(this.Click_RandomizeSingleColor); - element1.Append((UIElement) coloredImageButton6); - this._randomColorButton = (UIElement) coloredImageButton6; - this._hslContainer = element1; - this._hslHexText = uiText2; - coloredImageButton2.SetSnapPoint("Low", 0); - coloredImageButton4.SetSnapPoint("Low", 1); - coloredImageButton6.SetSnapPoint("Low", 2); - } - - private UIColoredSlider CreateHSLSlider(UICharacterCreation.HSLSliderId id) - { - UIColoredSlider sliderButtonBase = this.CreateHSLSliderButtonBase(id); - sliderButtonBase.VAlign = 0.0f; - sliderButtonBase.HAlign = 0.0f; - sliderButtonBase.Width = StyleDimension.FromPixelsAndPercent(-10f, 1f); - sliderButtonBase.Top.Set((float) (30 * (int) id), 0.0f); - sliderButtonBase.OnMouseDown += new UIElement.MouseEvent(this.Click_ColorPicker); - sliderButtonBase.SetSnapPoint("Middle", (int) id, offset: new Vector2?(new Vector2(0.0f, 20f))); - return sliderButtonBase; - } - - private UIColoredSlider CreateHSLSliderButtonBase( - UICharacterCreation.HSLSliderId id) - { - UIColoredSlider uiColoredSlider; - switch (id) - { - case UICharacterCreation.HSLSliderId.Saturation: - uiColoredSlider = new UIColoredSlider(LocalizedText.Empty, (Func) (() => this.GetHSLSliderPosition(UICharacterCreation.HSLSliderId.Saturation)), (Action) (x => this.UpdateHSLValue(UICharacterCreation.HSLSliderId.Saturation, x)), new Action(this.UpdateHSL_S), (Func) (x => this.GetHSLSliderColorAt(UICharacterCreation.HSLSliderId.Saturation, x)), Color.Transparent); - break; - case UICharacterCreation.HSLSliderId.Luminance: - uiColoredSlider = new UIColoredSlider(LocalizedText.Empty, (Func) (() => this.GetHSLSliderPosition(UICharacterCreation.HSLSliderId.Luminance)), (Action) (x => this.UpdateHSLValue(UICharacterCreation.HSLSliderId.Luminance, x)), new Action(this.UpdateHSL_L), (Func) (x => this.GetHSLSliderColorAt(UICharacterCreation.HSLSliderId.Luminance, x)), Color.Transparent); - break; - default: - uiColoredSlider = new UIColoredSlider(LocalizedText.Empty, (Func) (() => this.GetHSLSliderPosition(UICharacterCreation.HSLSliderId.Hue)), (Action) (x => this.UpdateHSLValue(UICharacterCreation.HSLSliderId.Hue, x)), new Action(this.UpdateHSL_H), (Func) (x => this.GetHSLSliderColorAt(UICharacterCreation.HSLSliderId.Hue, x)), Color.Transparent); - break; - } - return uiColoredSlider; - } - - private void UpdateHSL_H() => this.UpdateHSLValue(UICharacterCreation.HSLSliderId.Hue, UILinksInitializer.HandleSliderHorizontalInput(this._currentColorHSL.X, 0.0f, 1f, PlayerInput.CurrentProfile.InterfaceDeadzoneX, 0.35f)); - - private void UpdateHSL_S() => this.UpdateHSLValue(UICharacterCreation.HSLSliderId.Saturation, UILinksInitializer.HandleSliderHorizontalInput(this._currentColorHSL.Y, 0.0f, 1f, PlayerInput.CurrentProfile.InterfaceDeadzoneX, 0.35f)); - - private void UpdateHSL_L() => this.UpdateHSLValue(UICharacterCreation.HSLSliderId.Luminance, UILinksInitializer.HandleSliderHorizontalInput(this._currentColorHSL.Z, 0.0f, 1f, PlayerInput.CurrentProfile.InterfaceDeadzoneX, 0.35f)); - - private float GetHSLSliderPosition(UICharacterCreation.HSLSliderId id) - { - switch (id) - { - case UICharacterCreation.HSLSliderId.Hue: - return this._currentColorHSL.X; - case UICharacterCreation.HSLSliderId.Saturation: - return this._currentColorHSL.Y; - case UICharacterCreation.HSLSliderId.Luminance: - return this._currentColorHSL.Z; - default: - return 1f; - } - } - - private void UpdateHSLValue(UICharacterCreation.HSLSliderId id, float value) - { - switch (id) - { - case UICharacterCreation.HSLSliderId.Hue: - this._currentColorHSL.X = value; - break; - case UICharacterCreation.HSLSliderId.Saturation: - this._currentColorHSL.Y = value; - break; - case UICharacterCreation.HSLSliderId.Luminance: - this._currentColorHSL.Z = value; - break; - } - Color rgb = UICharacterCreation.ScaledHslToRgb(this._currentColorHSL.X, this._currentColorHSL.Y, this._currentColorHSL.Z); - this.ApplyPendingColor(rgb); - this._colorPickers[(int) this._selectedPicker]?.SetColor(rgb); - if (this._selectedPicker == UICharacterCreation.CategoryId.HairColor) - this._hairStylesCategoryButton.SetColor(rgb); - this.UpdateHexText(rgb); - } - - private Color GetHSLSliderColorAt(UICharacterCreation.HSLSliderId id, float pointAt) - { - switch (id) - { - case UICharacterCreation.HSLSliderId.Hue: - return UICharacterCreation.ScaledHslToRgb(pointAt, 1f, 0.5f); - case UICharacterCreation.HSLSliderId.Saturation: - return UICharacterCreation.ScaledHslToRgb(this._currentColorHSL.X, pointAt, this._currentColorHSL.Z); - case UICharacterCreation.HSLSliderId.Luminance: - return UICharacterCreation.ScaledHslToRgb(this._currentColorHSL.X, this._currentColorHSL.Y, pointAt); - default: - return Color.White; - } - } - - private void ApplyPendingColor(Color pendingColor) - { - switch (this._selectedPicker) - { - case UICharacterCreation.CategoryId.HairColor: - this._player.hairColor = pendingColor; - break; - case UICharacterCreation.CategoryId.Eye: - this._player.eyeColor = pendingColor; - break; - case UICharacterCreation.CategoryId.Skin: - this._player.skinColor = pendingColor; - break; - case UICharacterCreation.CategoryId.Shirt: - this._player.shirtColor = pendingColor; - break; - case UICharacterCreation.CategoryId.Undershirt: - this._player.underShirtColor = pendingColor; - break; - case UICharacterCreation.CategoryId.Pants: - this._player.pantsColor = pendingColor; - break; - case UICharacterCreation.CategoryId.Shoes: - this._player.shoeColor = pendingColor; - break; - } - } - - private void UpdateHexText(Color pendingColor) => this._hslHexText.SetText(UICharacterCreation.GetHexText(pendingColor)); - - private static string GetHexText(Color pendingColor) => "#" + pendingColor.Hex3().ToUpper(); - - private void MakeBackAndCreatebuttons(UIElement outerContainer) - { - UITextPanel uiTextPanel1 = new UITextPanel(Language.GetText("UI.Back"), 0.7f, true); - uiTextPanel1.Width = StyleDimension.FromPixelsAndPercent(-10f, 0.5f); - uiTextPanel1.Height = StyleDimension.FromPixels(50f); - uiTextPanel1.VAlign = 1f; - uiTextPanel1.HAlign = 0.0f; - uiTextPanel1.Top = StyleDimension.FromPixels(-45f); - UITextPanel uiTextPanel2 = uiTextPanel1; - uiTextPanel2.OnMouseOver += new UIElement.MouseEvent(this.FadedMouseOver); - uiTextPanel2.OnMouseOut += new UIElement.MouseEvent(this.FadedMouseOut); - uiTextPanel2.OnMouseDown += new UIElement.MouseEvent(this.Click_GoBack); - uiTextPanel2.SetSnapPoint("Back", 0); - outerContainer.Append((UIElement) uiTextPanel2); - UITextPanel uiTextPanel3 = new UITextPanel(Language.GetText("UI.Create"), 0.7f, true); - uiTextPanel3.Width = StyleDimension.FromPixelsAndPercent(-10f, 0.5f); - uiTextPanel3.Height = StyleDimension.FromPixels(50f); - uiTextPanel3.VAlign = 1f; - uiTextPanel3.HAlign = 1f; - uiTextPanel3.Top = StyleDimension.FromPixels(-45f); - UITextPanel uiTextPanel4 = uiTextPanel3; - uiTextPanel4.OnMouseOver += new UIElement.MouseEvent(this.FadedMouseOver); - uiTextPanel4.OnMouseOut += new UIElement.MouseEvent(this.FadedMouseOut); - uiTextPanel4.OnMouseDown += new UIElement.MouseEvent(this.Click_NamingAndCreating); - uiTextPanel4.SetSnapPoint("Create", 0); - outerContainer.Append((UIElement) uiTextPanel4); - } - - private void Click_GoBack(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(11); - Main.OpenCharacterSelectUI(); - } - - private void FadedMouseOver(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(12); - ((UIPanel) evt.Target).BackgroundColor = new Color(73, 94, 171); - ((UIPanel) evt.Target).BorderColor = Colors.FancyUIFatButtonMouseOver; - } - - private void FadedMouseOut(UIMouseEvent evt, UIElement listeningElement) - { - ((UIPanel) evt.Target).BackgroundColor = new Color(63, 82, 151) * 0.8f; - ((UIPanel) evt.Target).BorderColor = Color.Black; - } - - private void Click_ColorPicker(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(12); - for (int index = 0; index < this._colorPickers.Length; ++index) - { - if (this._colorPickers[index] == evt.Target) - { - this.SelectColorPicker((UICharacterCreation.CategoryId) index); - break; - } - } - } - - private void Click_ClothStyles(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(12); - this.UnselectAllCategories(); - this._selectedPicker = UICharacterCreation.CategoryId.Clothing; - this._middleContainer.Append(this._clothStylesContainer); - this._clothingStylesCategoryButton.SetSelected(true); - this.UpdateSelectedGender(); - } - - private void Click_HairStyles(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(12); - this.UnselectAllCategories(); - this._selectedPicker = UICharacterCreation.CategoryId.HairStyle; - this._middleContainer.Append(this._hairstylesContainer); - this._hairStylesCategoryButton.SetSelected(true); - } - - private void Click_CharInfo(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(12); - this.UnselectAllCategories(); - this._selectedPicker = UICharacterCreation.CategoryId.CharInfo; - this._middleContainer.Append(this._infoContainer); - this._charInfoCategoryButton.SetSelected(true); - } - - private void Click_CharClothStyle(UIMouseEvent evt, UIElement listeningElement) - { - this._clothingStylesCategoryButton.SetImage(Main.Assets.Request("Images/UI/CharCreation/" + (this._player.Male ? "ClothStyleMale" : "ClothStyleFemale"), (AssetRequestMode) 1)); - this.UpdateSelectedGender(); - } - - private void Click_CharGenderMale(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(12); - this._player.Male = true; - this.Click_CharClothStyle(evt, listeningElement); - this.UpdateSelectedGender(); - } - - private void Click_CharGenderFemale(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(12); - this._player.Male = false; - this.Click_CharClothStyle(evt, listeningElement); - this.UpdateSelectedGender(); - } - - private void UpdateSelectedGender() - { - this._genderMale.SetSelected(this._player.Male); - this._genderFemale.SetSelected(!this._player.Male); - } - - private void Click_CopyHex(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(12); - Platform.Get().Value = this._hslHexText.Text; - } - - private void Click_PasteHex(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(12); - Vector3 hsl; - if (!this.GetHexColor(Platform.Get().Value, out hsl)) - return; - this.ApplyPendingColor(UICharacterCreation.ScaledHslToRgb(hsl.X, hsl.Y, hsl.Z)); - this._currentColorHSL = hsl; - this.UpdateHexText(UICharacterCreation.ScaledHslToRgb(hsl.X, hsl.Y, hsl.Z)); - this.UpdateColorPickers(); - } - - private void Click_CopyPlayerTemplate(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(12); - string text = JsonConvert.SerializeObject((object) new Dictionary() - { - { - "version", - (object) 1 - }, - { - "hairStyle", - (object) this._player.hair - }, - { - "clothingStyle", - (object) this._player.skinVariant - }, - { - "hairColor", - (object) UICharacterCreation.GetHexText(this._player.hairColor) - }, - { - "eyeColor", - (object) UICharacterCreation.GetHexText(this._player.eyeColor) - }, - { - "skinColor", - (object) UICharacterCreation.GetHexText(this._player.skinColor) - }, - { - "shirtColor", - (object) UICharacterCreation.GetHexText(this._player.shirtColor) - }, - { - "underShirtColor", - (object) UICharacterCreation.GetHexText(this._player.underShirtColor) - }, - { - "pantsColor", - (object) UICharacterCreation.GetHexText(this._player.pantsColor) - }, - { - "shoeColor", - (object) UICharacterCreation.GetHexText(this._player.shoeColor) - } - }, new JsonSerializerSettings() - { - TypeNameHandling = (TypeNameHandling) 4, - MetadataPropertyHandling = (MetadataPropertyHandling) 1, - Formatting = (Formatting) 1 - }); - PlayerInput.PrettyPrintProfiles(ref text); - Platform.Get().Value = text; - } - - private void Click_PastePlayerTemplate(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(12); - try - { - string str1 = Platform.Get().Value; - int startIndex = str1.IndexOf("{"); - if (startIndex == -1) - return; - string str2 = str1.Substring(startIndex); - int num1 = str2.LastIndexOf("}"); - if (num1 == -1) - return; - Dictionary dictionary1 = JsonConvert.DeserializeObject>(str2.Substring(0, num1 + 1)); - if (dictionary1 == null) - return; - Dictionary dictionary2 = new Dictionary(); - foreach (KeyValuePair keyValuePair in dictionary1) - dictionary2[keyValuePair.Key.ToLower()] = keyValuePair.Value; - object obj; - if (dictionary2.TryGetValue("version", out obj)) - { - long num2 = (long) obj; - } - if (dictionary2.TryGetValue("hairstyle", out obj)) - { - int num3 = (int) (long) obj; - if (Main.Hairstyles.AvailableHairstyles.Contains(num3)) - this._player.hair = num3; - } - if (dictionary2.TryGetValue("clothingstyle", out obj)) - { - int num4 = (int) (long) obj; - if (((IEnumerable) this._validClothStyles).Contains(num4)) - this._player.skinVariant = num4; - } - Vector3 hsl; - if (dictionary2.TryGetValue("haircolor", out obj) && this.GetHexColor((string) obj, out hsl)) - this._player.hairColor = UICharacterCreation.ScaledHslToRgb(hsl); - if (dictionary2.TryGetValue("eyecolor", out obj) && this.GetHexColor((string) obj, out hsl)) - this._player.eyeColor = UICharacterCreation.ScaledHslToRgb(hsl); - if (dictionary2.TryGetValue("skincolor", out obj) && this.GetHexColor((string) obj, out hsl)) - this._player.skinColor = UICharacterCreation.ScaledHslToRgb(hsl); - if (dictionary2.TryGetValue("shirtcolor", out obj) && this.GetHexColor((string) obj, out hsl)) - this._player.shirtColor = UICharacterCreation.ScaledHslToRgb(hsl); - if (dictionary2.TryGetValue("undershirtcolor", out obj) && this.GetHexColor((string) obj, out hsl)) - this._player.underShirtColor = UICharacterCreation.ScaledHslToRgb(hsl); - if (dictionary2.TryGetValue("pantscolor", out obj) && this.GetHexColor((string) obj, out hsl)) - this._player.pantsColor = UICharacterCreation.ScaledHslToRgb(hsl); - if (dictionary2.TryGetValue("shoecolor", out obj) && this.GetHexColor((string) obj, out hsl)) - this._player.shoeColor = UICharacterCreation.ScaledHslToRgb(hsl); - this.Click_CharClothStyle((UIMouseEvent) null, (UIElement) null); - this.UpdateColorPickers(); - } - catch - { - } - } - - private void Click_RandomizePlayer(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(12); - Player player = this._player; - int index = Main.rand.Next(Main.Hairstyles.AvailableHairstyles.Count); - player.hair = Main.Hairstyles.AvailableHairstyles[index]; - while ((int) player.eyeColor.R + (int) player.eyeColor.G + (int) player.eyeColor.B > 300) - player.eyeColor = UICharacterCreation.ScaledHslToRgb(UICharacterCreation.GetRandomColorVector()); - float num = (float) Main.rand.Next(60, 120) * 0.01f; - if ((double) num > 1.0) - num = 1f; - player.skinColor.R = (byte) ((double) Main.rand.Next(240, (int) byte.MaxValue) * (double) num); - player.skinColor.G = (byte) ((double) Main.rand.Next(110, 140) * (double) num); - player.skinColor.B = (byte) ((double) Main.rand.Next(75, 110) * (double) num); - player.hairColor = UICharacterCreation.ScaledHslToRgb(UICharacterCreation.GetRandomColorVector()); - player.shirtColor = UICharacterCreation.ScaledHslToRgb(UICharacterCreation.GetRandomColorVector()); - player.underShirtColor = UICharacterCreation.ScaledHslToRgb(UICharacterCreation.GetRandomColorVector()); - player.pantsColor = UICharacterCreation.ScaledHslToRgb(UICharacterCreation.GetRandomColorVector()); - player.shoeColor = UICharacterCreation.ScaledHslToRgb(UICharacterCreation.GetRandomColorVector()); - player.skinVariant = this._validClothStyles[Main.rand.Next(this._validClothStyles.Length)]; - switch (player.hair + 1) - { - case 5: - case 6: - case 7: - case 10: - case 12: - case 19: - case 22: - case 23: - case 26: - case 27: - case 30: - case 33: - player.Male = false; - break; - default: - player.Male = true; - break; - } - this.Click_CharClothStyle((UIMouseEvent) null, (UIElement) null); - this.UpdateSelectedGender(); - this.UpdateColorPickers(); - } - - private void Click_Naming(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(10); - this._player.name = ""; - Main.clrInput(); - UIVirtualKeyboard uiVirtualKeyboard = new UIVirtualKeyboard(Lang.menu[45].Value, "", new UIVirtualKeyboard.KeyboardSubmitEvent(this.OnFinishedNaming), new Action(this.OnCancledNaming), allowEmpty: true); - uiVirtualKeyboard.SetMaxInputLength(20); - Main.MenuUI.SetState((UIState) uiVirtualKeyboard); - } - - private void Click_NamingAndCreating(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(10); - if (string.IsNullOrEmpty(this._player.name)) - { - this._player.name = ""; - Main.clrInput(); - UIVirtualKeyboard uiVirtualKeyboard = new UIVirtualKeyboard(Lang.menu[45].Value, "", new UIVirtualKeyboard.KeyboardSubmitEvent(this.OnFinishedNamingAndCreating), new Action(this.OnCancledNaming)); - uiVirtualKeyboard.SetMaxInputLength(20); - Main.MenuUI.SetState((UIState) uiVirtualKeyboard); - } - else - this.FinishCreatingCharacter(); - } - - private void OnFinishedNaming(string name) - { - this._player.name = name.Trim(); - Main.MenuUI.SetState((UIState) this); - this._charName.SetContents(this._player.name); - } - - private void OnCancledNaming() => Main.MenuUI.SetState((UIState) this); - - private void OnFinishedNamingAndCreating(string name) - { - this._player.name = name.Trim(); - Main.MenuUI.SetState((UIState) this); - this._charName.SetContents(this._player.name); - this.FinishCreatingCharacter(); - } - - private void FinishCreatingCharacter() - { - this.SetupPlayerStatsAndInventoryBasedOnDifficulty(); - PlayerFileData.CreateAndSave(this._player); - Main.LoadPlayers(); - Main.menuMode = 1; - } - - private void SetupPlayerStatsAndInventoryBasedOnDifficulty() - { - int index1 = 0; - int num1; - if (this._player.difficulty == (byte) 3) - { - this._player.statLife = this._player.statLifeMax = 100; - this._player.statMana = this._player.statManaMax = 20; - this._player.inventory[index1].SetDefaults(6); - Item[] inventory1 = this._player.inventory; - int index2 = index1; - int index3 = index2 + 1; - inventory1[index2].Prefix(-1); - this._player.inventory[index3].SetDefaults(1); - Item[] inventory2 = this._player.inventory; - int index4 = index3; - int index5 = index4 + 1; - inventory2[index4].Prefix(-1); - this._player.inventory[index5].SetDefaults(10); - Item[] inventory3 = this._player.inventory; - int index6 = index5; - int index7 = index6 + 1; - inventory3[index6].Prefix(-1); - this._player.inventory[index7].SetDefaults(7); - Item[] inventory4 = this._player.inventory; - int index8 = index7; - int index9 = index8 + 1; - inventory4[index8].Prefix(-1); - this._player.inventory[index9].SetDefaults(4281); - Item[] inventory5 = this._player.inventory; - int index10 = index9; - int index11 = index10 + 1; - inventory5[index10].Prefix(-1); - this._player.inventory[index11].SetDefaults(8); - Item[] inventory6 = this._player.inventory; - int index12 = index11; - int index13 = index12 + 1; - inventory6[index12].stack = 100; - this._player.inventory[index13].SetDefaults(965); - Item[] inventory7 = this._player.inventory; - int index14 = index13; - int num2 = index14 + 1; - inventory7[index14].stack = 100; - Item[] inventory8 = this._player.inventory; - int index15 = num2; - num1 = index15 + 1; - inventory8[index15].SetDefaults(50); - this._player.armor[3].SetDefaults(4978); - this._player.armor[3].Prefix(-1); - this._player.AddBuff(216, 3600); - } - else - { - this._player.inventory[index1].SetDefaults(3507); - Item[] inventory9 = this._player.inventory; - int index16 = index1; - int index17 = index16 + 1; - inventory9[index16].Prefix(-1); - this._player.inventory[index17].SetDefaults(3509); - Item[] inventory10 = this._player.inventory; - int index18 = index17; - int index19 = index18 + 1; - inventory10[index18].Prefix(-1); - this._player.inventory[index19].SetDefaults(3506); - Item[] inventory11 = this._player.inventory; - int index20 = index19; - num1 = index20 + 1; - inventory11[index20].Prefix(-1); - } - if (Main.runningCollectorsEdition) - { - Item[] inventory = this._player.inventory; - int index21 = num1; - int num3 = index21 + 1; - inventory[index21].SetDefaults(603); - } - this._player.savedPerPlayerFieldsThatArentInThePlayerClass = new Player.SavedPlayerDataWithAnnoyingRules(); - CreativePowerManager.Instance.ResetDataForNewPlayer(this._player); - } - - private bool GetHexColor(string hexString, out Vector3 hsl) - { - if (hexString.StartsWith("#")) - hexString = hexString.Substring(1); - uint result; - if (hexString.Length <= 6 && uint.TryParse(hexString, NumberStyles.HexNumber, (IFormatProvider) CultureInfo.CurrentCulture, out result)) - { - uint num1 = result & (uint) byte.MaxValue; - uint num2 = result >> 8 & (uint) byte.MaxValue; - uint num3 = result >> 16 & (uint) byte.MaxValue; - hsl = UICharacterCreation.RgbToScaledHsl(new Color((int) num3, (int) num2, (int) num1)); - return true; - } - hsl = Vector3.Zero; - return false; - } - - private void Click_RandomizeSingleColor(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(12); - Vector3 randomColorVector = UICharacterCreation.GetRandomColorVector(); - this.ApplyPendingColor(UICharacterCreation.ScaledHslToRgb(randomColorVector.X, randomColorVector.Y, randomColorVector.Z)); - this._currentColorHSL = randomColorVector; - this.UpdateHexText(UICharacterCreation.ScaledHslToRgb(randomColorVector.X, randomColorVector.Y, randomColorVector.Z)); - this.UpdateColorPickers(); - } - - private static Vector3 GetRandomColorVector() => new Vector3(Main.rand.NextFloat(), Main.rand.NextFloat(), Main.rand.NextFloat()); - - private void UnselectAllCategories() - { - foreach (UIColoredImageButton colorPicker in this._colorPickers) - colorPicker?.SetSelected(false); - this._clothingStylesCategoryButton.SetSelected(false); - this._hairStylesCategoryButton.SetSelected(false); - this._charInfoCategoryButton.SetSelected(false); - this._hslContainer.Remove(); - this._hairstylesContainer.Remove(); - this._clothStylesContainer.Remove(); - this._infoContainer.Remove(); - } - - private void SelectColorPicker(UICharacterCreation.CategoryId selection) - { - this._selectedPicker = selection; - switch (selection) - { - case UICharacterCreation.CategoryId.CharInfo: - this.Click_CharInfo((UIMouseEvent) null, (UIElement) null); - break; - case UICharacterCreation.CategoryId.Clothing: - this.Click_ClothStyles((UIMouseEvent) null, (UIElement) null); - break; - case UICharacterCreation.CategoryId.HairStyle: - this.Click_HairStyles((UIMouseEvent) null, (UIElement) null); - break; - default: - this.UnselectAllCategories(); - this._middleContainer.Append(this._hslContainer); - for (int index = 0; index < this._colorPickers.Length; ++index) - { - if (this._colorPickers[index] != null) - this._colorPickers[index].SetSelected((UICharacterCreation.CategoryId) index == selection); - } - Vector3 vector3 = Vector3.One; - switch (this._selectedPicker) - { - case UICharacterCreation.CategoryId.HairColor: - vector3 = UICharacterCreation.RgbToScaledHsl(this._player.hairColor); - break; - case UICharacterCreation.CategoryId.Eye: - vector3 = UICharacterCreation.RgbToScaledHsl(this._player.eyeColor); - break; - case UICharacterCreation.CategoryId.Skin: - vector3 = UICharacterCreation.RgbToScaledHsl(this._player.skinColor); - break; - case UICharacterCreation.CategoryId.Shirt: - vector3 = UICharacterCreation.RgbToScaledHsl(this._player.shirtColor); - break; - case UICharacterCreation.CategoryId.Undershirt: - vector3 = UICharacterCreation.RgbToScaledHsl(this._player.underShirtColor); - break; - case UICharacterCreation.CategoryId.Pants: - vector3 = UICharacterCreation.RgbToScaledHsl(this._player.pantsColor); - break; - case UICharacterCreation.CategoryId.Shoes: - vector3 = UICharacterCreation.RgbToScaledHsl(this._player.shoeColor); - break; - } - this._currentColorHSL = vector3; - this.UpdateHexText(UICharacterCreation.ScaledHslToRgb(vector3.X, vector3.Y, vector3.Z)); - break; - } - } - - private void UpdateColorPickers() - { - int selectedPicker = (int) this._selectedPicker; - this._colorPickers[3].SetColor(this._player.hairColor); - this._hairStylesCategoryButton.SetColor(this._player.hairColor); - this._colorPickers[4].SetColor(this._player.eyeColor); - this._colorPickers[5].SetColor(this._player.skinColor); - this._colorPickers[6].SetColor(this._player.shirtColor); - this._colorPickers[7].SetColor(this._player.underShirtColor); - this._colorPickers[8].SetColor(this._player.pantsColor); - this._colorPickers[9].SetColor(this._player.shoeColor); - } - - public override void Draw(SpriteBatch spriteBatch) - { - base.Draw(spriteBatch); - string text = (string) null; - if (this._copyHexButton.IsMouseHovering) - text = Language.GetTextValue("UI.CopyColorToClipboard"); - if (this._pasteHexButton.IsMouseHovering) - text = Language.GetTextValue("UI.PasteColorFromClipboard"); - if (this._randomColorButton.IsMouseHovering) - text = Language.GetTextValue("UI.RandomizeColor"); - if (this._copyTemplateButton.IsMouseHovering) - text = Language.GetTextValue("UI.CopyPlayerToClipboard"); - if (this._pasteTemplateButton.IsMouseHovering) - text = Language.GetTextValue("UI.PastePlayerFromClipboard"); - if (this._randomizePlayerButton.IsMouseHovering) - text = Language.GetTextValue("UI.RandomizePlayer"); - if (text != null) - { - float x = FontAssets.MouseText.Value.MeasureString(text).X; - Vector2 vector2 = new Vector2((float) Main.mouseX, (float) Main.mouseY) + new Vector2(16f); - if ((double) vector2.Y > (double) (Main.screenHeight - 30)) - vector2.Y = (float) (Main.screenHeight - 30); - if ((double) vector2.X > (double) Main.screenWidth - (double) x) - vector2.X = (float) (Main.screenWidth - 460); - Utils.DrawBorderStringFourWay(spriteBatch, FontAssets.MouseText.Value, text, vector2.X, vector2.Y, new Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor), Color.Black, Vector2.Zero); - } - this.SetupGamepadPoints(spriteBatch); - } - - private void SetupGamepadPoints(SpriteBatch spriteBatch) - { - UILinkPointNavigator.Shortcuts.BackButtonCommand = 1; - int num1 = 3000; - int num2 = num1 + 20; - int num3 = num1; - List snapPoints = this.GetSnapPoints(); - SnapPoint snapPoint1 = snapPoints.First((Func) (a => a.Name == "Back")); - SnapPoint snapPoint2 = snapPoints.First((Func) (a => a.Name == "Create")); - UILinkPoint point1 = UILinkPointNavigator.Points[num3]; - point1.Unlink(); - UILinkPointNavigator.SetPosition(num3, snapPoint1.Position); - int num4 = num3 + 1; - UILinkPoint point2 = UILinkPointNavigator.Points[num4]; - point2.Unlink(); - UILinkPointNavigator.SetPosition(num4, snapPoint2.Position); - int num5 = num4 + 1; - point1.Right = point2.ID; - point2.Left = point1.ID; - this._foundPoints.Clear(); - this._foundPoints.Add(point1.ID); - this._foundPoints.Add(point2.ID); - List list1 = snapPoints.Where((Func) (a => a.Name == "Top")).ToList(); - list1.Sort(new Comparison(this.SortPoints)); - for (int index = 0; index < list1.Count; ++index) - { - UILinkPoint point3 = UILinkPointNavigator.Points[num5]; - point3.Unlink(); - UILinkPointNavigator.SetPosition(num5, list1[index].Position); - point3.Left = num5 - 1; - point3.Right = num5 + 1; - point3.Down = num2; - if (index == 0) - point3.Left = -3; - if (index == list1.Count - 1) - point3.Right = -4; - if (this._selectedPicker == UICharacterCreation.CategoryId.HairStyle || this._selectedPicker == UICharacterCreation.CategoryId.Clothing) - point3.Down = num2 + index; - this._foundPoints.Add(num5); - ++num5; - } - List list2 = snapPoints.Where((Func) (a => a.Name == "Middle")).ToList(); - list2.Sort(new Comparison(this.SortPoints)); - int ptid1 = num2; - switch (this._selectedPicker) - { - case UICharacterCreation.CategoryId.CharInfo: - for (int index = 0; index < list2.Count; ++index) - { - UILinkPoint andSet = this.GetAndSet(ptid1, list2[index]); - andSet.Up = andSet.ID - 1; - andSet.Down = andSet.ID + 1; - if (index == 0) - andSet.Up = num1 + 2; - if (index == list2.Count - 1) - { - andSet.Down = point1.ID; - point1.Up = andSet.ID; - point2.Up = andSet.ID; - } - this._foundPoints.Add(ptid1); - ++ptid1; - } - break; - case UICharacterCreation.CategoryId.Clothing: - List list3 = snapPoints.Where((Func) (a => a.Name == "Low")).ToList(); - list3.Sort(new Comparison(this.SortPoints)); - int num6 = -2; - int num7 = -2; - int ptid2 = num2 + 20; - for (int index = 0; index < list3.Count; ++index) - { - UILinkPoint andSet = this.GetAndSet(ptid2, list3[index]); - andSet.Up = num2 + index + 2; - andSet.Down = point1.ID; - if (index >= 3) - { - ++andSet.Up; - andSet.Down = point2.ID; - } - andSet.Left = andSet.ID - 1; - andSet.Right = andSet.ID + 1; - if (index == 0) - { - num6 = andSet.ID; - andSet.Left = andSet.ID + 4; - point1.Up = andSet.ID; - } - if (index == list3.Count - 1) - { - num7 = andSet.ID; - andSet.Right = andSet.ID - 4; - point2.Up = andSet.ID; - } - this._foundPoints.Add(ptid2); - ++ptid2; - } - int ptid3 = num2; - for (int index = 0; index < list2.Count; ++index) - { - UILinkPoint andSet = this.GetAndSet(ptid3, list2[index]); - andSet.Up = num1 + 2 + index; - andSet.Left = andSet.ID - 1; - andSet.Right = andSet.ID + 1; - if (index == 0) - andSet.Left = andSet.ID + 9; - if (index == list2.Count - 1) - andSet.Right = andSet.ID - 9; - andSet.Down = num6; - if (index >= 5) - andSet.Down = num7; - this._foundPoints.Add(ptid3); - ++ptid3; - } - break; - case UICharacterCreation.CategoryId.HairStyle: - if (list2.Count != 0) - { - this._helper.CullPointsOutOfElementArea(spriteBatch, list2, this._hairstylesContainer); - SnapPoint snapPoint3 = list2[list2.Count - 1]; - int num8 = snapPoint3.Id / 10; - int num9 = snapPoint3.Id % 10; - int count = Main.Hairstyles.AvailableHairstyles.Count; - for (int index = 0; index < list2.Count; ++index) - { - SnapPoint snap = list2[index]; - UILinkPoint andSet = this.GetAndSet(ptid1, snap); - andSet.Left = andSet.ID - 1; - if (snap.Id == 0) - andSet.Left = -3; - andSet.Right = andSet.ID + 1; - if (snap.Id == count - 1) - andSet.Right = -4; - andSet.Up = andSet.ID - 10; - if (index < 10) - andSet.Up = num1 + 2 + index; - andSet.Down = andSet.ID + 10; - if (snap.Id + 10 > snapPoint3.Id) - andSet.Down = snap.Id % 10 >= 5 ? point2.ID : point1.ID; - if (index == list2.Count - 1) - { - point1.Up = andSet.ID; - point2.Up = andSet.ID; - } - this._foundPoints.Add(ptid1); - ++ptid1; - } - break; - } - break; - default: - List list4 = snapPoints.Where((Func) (a => a.Name == "Low")).ToList(); - list4.Sort(new Comparison(this.SortPoints)); - int ptid4 = num2 + 20; - for (int index = 0; index < list4.Count; ++index) - { - UILinkPoint andSet = this.GetAndSet(ptid4, list4[index]); - andSet.Up = num2 + 2; - andSet.Down = point1.ID; - andSet.Left = andSet.ID - 1; - andSet.Right = andSet.ID + 1; - if (index == 0) - { - andSet.Left = andSet.ID + 2; - point1.Up = andSet.ID; - } - if (index == list4.Count - 1) - { - andSet.Right = andSet.ID - 2; - point2.Up = andSet.ID; - } - this._foundPoints.Add(ptid4); - ++ptid4; - } - int ptid5 = num2; - for (int index = 0; index < list2.Count; ++index) - { - UILinkPoint andSet = this.GetAndSet(ptid5, list2[index]); - andSet.Up = andSet.ID - 1; - andSet.Down = andSet.ID + 1; - if (index == 0) - andSet.Up = num1 + 2 + 5; - if (index == list2.Count - 1) - andSet.Down = num2 + 20 + 2; - this._foundPoints.Add(ptid5); - ++ptid5; - } - break; - } - if (!PlayerInput.UsingGamepadUI || this._foundPoints.Contains(UILinkPointNavigator.CurrentPoint)) - return; - this.MoveToVisuallyClosestPoint(); - } - - private void MoveToVisuallyClosestPoint() - { - Dictionary points = UILinkPointNavigator.Points; - Vector2 mouseScreen = Main.MouseScreen; - UILinkPoint uiLinkPoint1 = (UILinkPoint) null; - foreach (int foundPoint in this._foundPoints) - { - UILinkPoint uiLinkPoint2; - if (!points.TryGetValue(foundPoint, out uiLinkPoint2)) - return; - if (uiLinkPoint1 == null || (double) Vector2.Distance(mouseScreen, uiLinkPoint1.Position) > (double) Vector2.Distance(mouseScreen, uiLinkPoint2.Position)) - uiLinkPoint1 = uiLinkPoint2; - } - if (uiLinkPoint1 == null) - return; - UILinkPointNavigator.ChangePoint(uiLinkPoint1.ID); - } - - public void TryMovingCategory(int direction) - { - int num = (int) (this._selectedPicker + direction) % 10; - if (num < 0) - num += 10; - this.SelectColorPicker((UICharacterCreation.CategoryId) num); - } - - private UILinkPoint GetAndSet(int ptid, SnapPoint snap) - { - UILinkPoint point = UILinkPointNavigator.Points[ptid]; - point.Unlink(); - UILinkPointNavigator.SetPosition(point.ID, snap.Position); - return point; - } - - private bool PointWithName(SnapPoint a, string comp) => a.Name == comp; - - private int SortPoints(SnapPoint a, SnapPoint b) => a.Id.CompareTo(b.Id); - - private static Color ScaledHslToRgb(Vector3 hsl) => UICharacterCreation.ScaledHslToRgb(hsl.X, hsl.Y, hsl.Z); - - private static Color ScaledHslToRgb(float hue, float saturation, float luminosity) => Main.hslToRgb(hue, saturation, (float) ((double) luminosity * 0.850000023841858 + 0.150000005960464)); - - private static Vector3 RgbToScaledHsl(Color color) - { - Vector3 hsl = Main.rgbToHsl(color); - hsl.Z = (float) (((double) hsl.Z - 0.150000005960464) / 0.850000023841858); - return Vector3.Clamp(hsl, Vector3.Zero, Vector3.One); - } - - private enum CategoryId - { - CharInfo, - Clothing, - HairStyle, - HairColor, - Eye, - Skin, - Shirt, - Undershirt, - Pants, - Shoes, - Count, - } - - private enum HSLSliderId - { - Hue, - Saturation, - Luminance, - } - } -} diff --git a/GameContent/UI/States/UICharacterSelect.cs b/GameContent/UI/States/UICharacterSelect.cs index d177b50..b8443a8 100644 --- a/GameContent/UI/States/UICharacterSelect.cs +++ b/GameContent/UI/States/UICharacterSelect.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.States.UICharacterSelect -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -9,10 +9,8 @@ using Microsoft.Xna.Framework.Graphics; using System; using System.Collections.Generic; using System.Linq; -using Terraria.Audio; using Terraria.GameContent.UI.Elements; using Terraria.GameInput; -using Terraria.ID; using Terraria.IO; using Terraria.Localization; using Terraria.UI; @@ -22,12 +20,11 @@ namespace Terraria.GameContent.UI.States { public class UICharacterSelect : UIState { + private static string noteToEveryone = "This code is terrible and you will risk cancer reading it --Yoraiz0r"; private UIList _playerList; private UITextPanel _backPanel; private UITextPanel _newPanel; private UIPanel _containerPanel; - private UIScrollbar _scrollbar; - private bool _isScrollbarAttached; private List> favoritesCache = new List>(); private bool skipDraw; @@ -46,18 +43,19 @@ namespace Terraria.GameContent.UI.States this._containerPanel = uiPanel; element.Append((UIElement) uiPanel); this._playerList = new UIList(); - this._playerList.Width.Set(0.0f, 1f); + this._playerList.Width.Set(-25f, 1f); this._playerList.Height.Set(0.0f, 1f); this._playerList.ListPadding = 5f; uiPanel.Append((UIElement) this._playerList); - this._scrollbar = new UIScrollbar(); - this._scrollbar.SetView(100f, 1000f); - this._scrollbar.Height.Set(0.0f, 1f); - this._scrollbar.HAlign = 1f; - this._playerList.SetScrollbar(this._scrollbar); + UIScrollbar scrollbar = new UIScrollbar(); + scrollbar.SetView(100f, 1000f); + scrollbar.Height.Set(0.0f, 1f); + scrollbar.HAlign = 1f; + uiPanel.Append((UIElement) scrollbar); + this._playerList.SetScrollbar(scrollbar); UITextPanel uiTextPanel1 = new UITextPanel(Language.GetText("UI.SelectPlayer"), 0.8f, true); uiTextPanel1.HAlign = 0.5f; - uiTextPanel1.Top.Set(-40f, 0.0f); + uiTextPanel1.Top.Set(-35f, 0.0f); uiTextPanel1.SetPadding(15f); uiTextPanel1.BackgroundColor = new Color(73, 94, 171); element.Append((UIElement) uiTextPanel1); @@ -84,57 +82,38 @@ namespace Terraria.GameContent.UI.States this.Append(element); } - public override void Recalculate() - { - if (this._scrollbar != null) - { - if (this._isScrollbarAttached && !this._scrollbar.CanScroll) - { - this._containerPanel.RemoveChild((UIElement) this._scrollbar); - this._isScrollbarAttached = false; - this._playerList.Width.Set(0.0f, 1f); - } - else if (!this._isScrollbarAttached && this._scrollbar.CanScroll) - { - this._containerPanel.Append((UIElement) this._scrollbar); - this._isScrollbarAttached = true; - this._playerList.Width.Set(-25f, 1f); - } - } - base.Recalculate(); - } - private void NewCharacterClick(UIMouseEvent evt, UIElement listeningElement) { - SoundEngine.PlaySound(10); - Main.PendingPlayer = new Player(); - Main.MenuUI.SetState((UIState) new UICharacterCreation(Main.PendingPlayer)); - Main.menuMode = 888; + Main.PlaySound(10); + Player player = new Player(); + player.inventory[0].SetDefaults(3507); + player.inventory[0].Prefix(-1); + player.inventory[1].SetDefaults(3509); + player.inventory[1].Prefix(-1); + player.inventory[2].SetDefaults(3506); + player.inventory[2].Prefix(-1); + Main.PendingPlayer = player; + Main.menuMode = 2; } private void GoBackClick(UIMouseEvent evt, UIElement listeningElement) { - SoundEngine.PlaySound(11); + Main.PlaySound(11); Main.menuMode = 0; } private void FadedMouseOver(UIMouseEvent evt, UIElement listeningElement) { - SoundEngine.PlaySound(12); + Main.PlaySound(12); ((UIPanel) evt.Target).BackgroundColor = new Color(73, 94, 171); - ((UIPanel) evt.Target).BorderColor = Colors.FancyUIFatButtonMouseOver; } - private void FadedMouseOut(UIMouseEvent evt, UIElement listeningElement) - { - ((UIPanel) evt.Target).BackgroundColor = new Color(63, 82, 151) * 0.7f; - ((UIPanel) evt.Target).BorderColor = Color.Black; - } + private void FadedMouseOut(UIMouseEvent evt, UIElement listeningElement) => ((UIPanel) evt.Target).BackgroundColor = new Color(63, 82, 151) * 0.7f; public override void OnActivate() { + Main.ClearPendingPlayerSelectCallbacks(); Main.LoadPlayers(); - Main.ActivePlayerFileData = new PlayerFileData(); this.UpdatePlayersList(); if (!PlayerInput.UsingGamepadUI) return; @@ -226,10 +205,9 @@ namespace Terraria.GameContent.UI.States UILinkPoint point2 = UILinkPointNavigator.Points[key2]; point2.Unlink(); point2.Left = key2 - 1; - float num2 = 1f / Main.UIScale; Rectangle clippingRectangle = this._containerPanel.GetClippingRectangle(spriteBatch); - Vector2 minimum = clippingRectangle.TopLeft() * num2; - Vector2 maximum = clippingRectangle.BottomRight() * num2; + Vector2 minimum = clippingRectangle.TopLeft(); + Vector2 maximum = clippingRectangle.BottomRight(); List snapPoints = this.GetSnapPoints(); for (int index = 0; index < snapPoints.Count; ++index) { @@ -241,14 +219,14 @@ namespace Terraria.GameContent.UI.States } SnapPoint[,] snapPointArray = new SnapPoint[this._playerList.Count, 4]; foreach (SnapPoint snapPoint in snapPoints.Where((Func) (a => a.Name == "Play"))) - snapPointArray[snapPoint.Id, 0] = snapPoint; + snapPointArray[snapPoint.ID, 0] = snapPoint; foreach (SnapPoint snapPoint in snapPoints.Where((Func) (a => a.Name == "Favorite"))) - snapPointArray[snapPoint.Id, 1] = snapPoint; + snapPointArray[snapPoint.ID, 1] = snapPoint; foreach (SnapPoint snapPoint in snapPoints.Where((Func) (a => a.Name == "Cloud"))) - snapPointArray[snapPoint.Id, 2] = snapPoint; + snapPointArray[snapPoint.ID, 2] = snapPoint; foreach (SnapPoint snapPoint in snapPoints.Where((Func) (a => a.Name == "Delete"))) - snapPointArray[snapPoint.Id, 3] = snapPoint; - int num3 = num1 + 2; + snapPointArray[snapPoint.ID, 3] = snapPoint; + int num2 = num1 + 2; int[] numArray = new int[this._playerList.Count]; for (int index = 0; index < numArray.Length; ++index) numArray[index] = -1; @@ -259,26 +237,26 @@ namespace Terraria.GameContent.UI.States { if (snapPointArray[index2, index1] != null) { - UILinkPoint point3 = UILinkPointNavigator.Points[num3]; + UILinkPoint point3 = UILinkPointNavigator.Points[num2]; point3.Unlink(); - UILinkPointNavigator.SetPosition(num3, snapPointArray[index2, index1].Position); + UILinkPointNavigator.SetPosition(num2, snapPointArray[index2, index1].Position); if (key3 != -1) { point3.Up = key3; - UILinkPointNavigator.Points[key3].Down = num3; + UILinkPointNavigator.Points[key3].Down = num2; } if (numArray[index2] != -1) { point3.Left = numArray[index2]; - UILinkPointNavigator.Points[numArray[index2]].Right = num3; + UILinkPointNavigator.Points[numArray[index2]].Right = num2; } point3.Down = num1; if (index1 == 0) - UILinkPointNavigator.Points[num1].Up = UILinkPointNavigator.Points[num1 + 1].Up = num3; - key3 = num3; - numArray[index2] = num3; - UILinkPointNavigator.Shortcuts.FANCYUI_HIGHEST_INDEX = num3; - ++num3; + UILinkPointNavigator.Points[num1].Up = UILinkPointNavigator.Points[num1 + 1].Up = num2; + key3 = num2; + numArray[index2] = num2; + UILinkPointNavigator.Shortcuts.FANCYUI_HIGHEST_INDEX = num2; + ++num2; } } } diff --git a/GameContent/UI/States/UICreativePowersMenu.cs b/GameContent/UI/States/UICreativePowersMenu.cs deleted file mode 100644 index 638869f..0000000 --- a/GameContent/UI/States/UICreativePowersMenu.cs +++ /dev/null @@ -1,481 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.States.UICreativePowersMenu -// 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; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using Terraria.GameContent.Creative; -using Terraria.GameContent.UI.Elements; -using Terraria.Localization; -using Terraria.UI; -using Terraria.UI.Gamepad; - -namespace Terraria.GameContent.UI.States -{ - public class UICreativePowersMenu : UIState - { - private bool _hovered; - private PowerStripUIElement _mainPowerStrip; - private PowerStripUIElement _timePowersStrip; - private PowerStripUIElement _weatherPowersStrip; - private PowerStripUIElement _personalPowersStrip; - private UICreativeInfiniteItemsDisplay _infiniteItemsWindow; - private UIElement _container; - private UICreativePowersMenu.MenuTree _mainCategory = new UICreativePowersMenu.MenuTree(UICreativePowersMenu.OpenMainSubCategory.None); - private UICreativePowersMenu.MenuTree _weatherCategory = new UICreativePowersMenu.MenuTree(UICreativePowersMenu.WeatherSubcategory.None); - private UICreativePowersMenu.MenuTree _timeCategory = new UICreativePowersMenu.MenuTree(UICreativePowersMenu.TimeSubcategory.None); - private UICreativePowersMenu.MenuTree _personalCategory = new UICreativePowersMenu.MenuTree(UICreativePowersMenu.PersonalSubcategory.None); - private const int INITIAL_LEFT_PIXELS = 20; - private const int LEFT_PIXELS_PER_STRIP_DEPTH = 60; - private const string STRIP_MAIN = "strip 0"; - private const string STRIP_DEPTH_1 = "strip 1"; - private const string STRIP_DEPTH_2 = "strip 2"; - private UIGamepadHelper _helper; - - public bool IsShowingResearchMenu => this._mainCategory.CurrentOption == 2; - - public override void OnActivate() => this.InitializePage(); - - private void InitializePage() - { - int num1 = 270; - int num2 = 20; - this._container = new UIElement() - { - HAlign = 0.0f, - VAlign = 0.0f, - Width = new StyleDimension(0.0f, 1f), - Height = new StyleDimension((float) (-num1 - num2), 1f), - Top = new StyleDimension((float) num1, 0.0f) - }; - this.Append(this._container); - PowerStripUIElement powerStripUiElement1 = new PowerStripUIElement("strip 0", this.CreateMainPowerStrip()); - powerStripUiElement1.HAlign = 0.0f; - powerStripUiElement1.VAlign = 0.5f; - powerStripUiElement1.Left = new StyleDimension(20f, 0.0f); - PowerStripUIElement powerStripUiElement2 = powerStripUiElement1; - powerStripUiElement2.OnMouseOver += new UIElement.MouseEvent(this.strip_OnMouseOver); - powerStripUiElement2.OnMouseOut += new UIElement.MouseEvent(this.strip_OnMouseOut); - this._mainPowerStrip = powerStripUiElement2; - PowerStripUIElement powerStripUiElement3 = new PowerStripUIElement("strip 1", this.CreateTimePowerStrip()); - powerStripUiElement3.HAlign = 0.0f; - powerStripUiElement3.VAlign = 0.5f; - powerStripUiElement3.Left = new StyleDimension(80f, 0.0f); - PowerStripUIElement powerStripUiElement4 = powerStripUiElement3; - powerStripUiElement4.OnMouseOver += new UIElement.MouseEvent(this.strip_OnMouseOver); - powerStripUiElement4.OnMouseOut += new UIElement.MouseEvent(this.strip_OnMouseOut); - this._timePowersStrip = powerStripUiElement4; - PowerStripUIElement powerStripUiElement5 = new PowerStripUIElement("strip 1", this.CreateWeatherPowerStrip()); - powerStripUiElement5.HAlign = 0.0f; - powerStripUiElement5.VAlign = 0.5f; - powerStripUiElement5.Left = new StyleDimension(80f, 0.0f); - PowerStripUIElement powerStripUiElement6 = powerStripUiElement5; - powerStripUiElement6.OnMouseOver += new UIElement.MouseEvent(this.strip_OnMouseOver); - powerStripUiElement6.OnMouseOut += new UIElement.MouseEvent(this.strip_OnMouseOut); - this._weatherPowersStrip = powerStripUiElement6; - PowerStripUIElement powerStripUiElement7 = new PowerStripUIElement("strip 1", this.CreatePersonalPowerStrip()); - powerStripUiElement7.HAlign = 0.0f; - powerStripUiElement7.VAlign = 0.5f; - powerStripUiElement7.Left = new StyleDimension(80f, 0.0f); - PowerStripUIElement powerStripUiElement8 = powerStripUiElement7; - powerStripUiElement8.OnMouseOver += new UIElement.MouseEvent(this.strip_OnMouseOver); - powerStripUiElement8.OnMouseOut += new UIElement.MouseEvent(this.strip_OnMouseOut); - this._personalPowersStrip = powerStripUiElement8; - UICreativeInfiniteItemsDisplay infiniteItemsDisplay = new UICreativeInfiniteItemsDisplay((UIState) this); - infiniteItemsDisplay.HAlign = 0.0f; - infiniteItemsDisplay.VAlign = 0.5f; - infiniteItemsDisplay.Left = new StyleDimension(80f, 0.0f); - infiniteItemsDisplay.Width = new StyleDimension(480f, 0.0f); - infiniteItemsDisplay.Height = new StyleDimension(-88f, 1f); - this._infiniteItemsWindow = infiniteItemsDisplay; - this.RefreshElementsOrder(); - this.OnUpdate += new UIElement.ElementEvent(this.UICreativePowersMenu_OnUpdate); - } - - private List CreateMainPowerStrip() - { - UICreativePowersMenu.MenuTree mainCategory = this._mainCategory; - mainCategory.Buttons.Clear(); - List elements = new List(); - CreativePowerUIElementRequestInfo request = new CreativePowerUIElementRequestInfo() - { - PreferredButtonWidth = 40, - PreferredButtonHeight = 40 - }; - GroupOptionButton categoryButton1 = CreativePowersHelper.CreateCategoryButton(request, 1, 0); - categoryButton1.Append((UIElement) CreativePowersHelper.GetIconImage(CreativePowersHelper.CreativePowerIconLocations.ItemDuplication)); - categoryButton1.OnClick += new UIElement.MouseEvent(this.MainCategoryButtonClick); - categoryButton1.OnUpdate += new UIElement.ElementEvent(this.itemsWindowButton_OnUpdate); - mainCategory.Buttons.Add(1, categoryButton1); - elements.Add((UIElement) categoryButton1); - GroupOptionButton categoryButton2 = CreativePowersHelper.CreateCategoryButton(request, 2, 0); - categoryButton2.Append((UIElement) CreativePowersHelper.GetIconImage(CreativePowersHelper.CreativePowerIconLocations.ItemResearch)); - categoryButton2.OnClick += new UIElement.MouseEvent(this.MainCategoryButtonClick); - categoryButton2.OnUpdate += new UIElement.ElementEvent(this.researchWindowButton_OnUpdate); - mainCategory.Buttons.Add(2, categoryButton2); - elements.Add((UIElement) categoryButton2); - GroupOptionButton categoryButton3 = CreativePowersHelper.CreateCategoryButton(request, 3, 0); - categoryButton3.Append((UIElement) CreativePowersHelper.GetIconImage(CreativePowersHelper.CreativePowerIconLocations.TimeCategory)); - categoryButton3.OnClick += new UIElement.MouseEvent(this.MainCategoryButtonClick); - categoryButton3.OnUpdate += new UIElement.ElementEvent(this.timeCategoryButton_OnUpdate); - mainCategory.Buttons.Add(3, categoryButton3); - elements.Add((UIElement) categoryButton3); - GroupOptionButton categoryButton4 = CreativePowersHelper.CreateCategoryButton(request, 4, 0); - categoryButton4.Append((UIElement) CreativePowersHelper.GetIconImage(CreativePowersHelper.CreativePowerIconLocations.WeatherCategory)); - categoryButton4.OnClick += new UIElement.MouseEvent(this.MainCategoryButtonClick); - categoryButton4.OnUpdate += new UIElement.ElementEvent(this.weatherCategoryButton_OnUpdate); - mainCategory.Buttons.Add(4, categoryButton4); - elements.Add((UIElement) categoryButton4); - GroupOptionButton categoryButton5 = CreativePowersHelper.CreateCategoryButton(request, 6, 0); - categoryButton5.Append((UIElement) CreativePowersHelper.GetIconImage(CreativePowersHelper.CreativePowerIconLocations.PersonalCategory)); - categoryButton5.OnClick += new UIElement.MouseEvent(this.MainCategoryButtonClick); - categoryButton5.OnUpdate += new UIElement.ElementEvent(this.personalCategoryButton_OnUpdate); - mainCategory.Buttons.Add(6, categoryButton5); - elements.Add((UIElement) categoryButton5); - CreativePowerManager.Instance.GetPower().ProvidePowerButtons(request, elements); - GroupOptionButton subcategoryButton = this.CreateSubcategoryButton(ref request, 1, "strip 1", 5, 0, mainCategory.Buttons, mainCategory.Sliders); - subcategoryButton.OnClick += new UIElement.MouseEvent(this.MainCategoryButtonClick); - elements.Add((UIElement) subcategoryButton); - return elements; - } - - private static void CategoryButton_OnUpdate_DisplayTooltips( - UIElement affectedElement, - string categoryNameKey) - { - GroupOptionButton groupOptionButton = affectedElement as GroupOptionButton; - if (!affectedElement.IsMouseHovering) - return; - string textValue = Language.GetTextValue(groupOptionButton.IsSelected ? categoryNameKey + "Opened" : categoryNameKey + "Closed"); - CreativePowersHelper.AddDescriptionIfNeeded(ref textValue, categoryNameKey); - Main.instance.MouseTextNoOverride(textValue); - } - - private void itemsWindowButton_OnUpdate(UIElement affectedElement) => UICreativePowersMenu.CategoryButton_OnUpdate_DisplayTooltips(affectedElement, "CreativePowers.InfiniteItemsCategory"); - - private void researchWindowButton_OnUpdate(UIElement affectedElement) => UICreativePowersMenu.CategoryButton_OnUpdate_DisplayTooltips(affectedElement, "CreativePowers.ResearchItemsCategory"); - - private void timeCategoryButton_OnUpdate(UIElement affectedElement) => UICreativePowersMenu.CategoryButton_OnUpdate_DisplayTooltips(affectedElement, "CreativePowers.TimeCategory"); - - private void weatherCategoryButton_OnUpdate(UIElement affectedElement) => UICreativePowersMenu.CategoryButton_OnUpdate_DisplayTooltips(affectedElement, "CreativePowers.WeatherCategory"); - - private void personalCategoryButton_OnUpdate(UIElement affectedElement) => UICreativePowersMenu.CategoryButton_OnUpdate_DisplayTooltips(affectedElement, "CreativePowers.PersonalCategory"); - - private void UICreativePowersMenu_OnUpdate(UIElement affectedElement) - { - if (!this._hovered) - return; - Main.LocalPlayer.mouseInterface = true; - } - - private void strip_OnMouseOut(UIMouseEvent evt, UIElement listeningElement) => this._hovered = false; - - private void strip_OnMouseOver(UIMouseEvent evt, UIElement listeningElement) => this._hovered = true; - - private void MainCategoryButtonClick(UIMouseEvent evt, UIElement listeningElement) - { - this.ToggleMainCategory((listeningElement as GroupOptionButton).OptionValue); - this.RefreshElementsOrder(); - } - - private void ToggleMainCategory(int option) => this.ToggleCategory(this._mainCategory, option, UICreativePowersMenu.OpenMainSubCategory.None); - - private void ToggleWeatherCategory(int option) => this.ToggleCategory(this._weatherCategory, option, UICreativePowersMenu.WeatherSubcategory.None); - - private void ToggleTimeCategory(int option) => this.ToggleCategory(this._timeCategory, option, UICreativePowersMenu.TimeSubcategory.None); - - private void TogglePersonalCategory(int option) => this.ToggleCategory(this._personalCategory, option, UICreativePowersMenu.PersonalSubcategory.None); - - private void ToggleCategory( - UICreativePowersMenu.MenuTree tree, - int option, - TEnum defaultOption) - where TEnum : struct, IConvertible - { - if (tree.CurrentOption == option) - option = defaultOption.ToInt32((IFormatProvider) null); - tree.CurrentOption = option; - foreach (GroupOptionButton groupOptionButton in tree.Buttons.Values) - groupOptionButton.SetCurrentOption(option); - } - - private List CreateTimePowerStrip() - { - UICreativePowersMenu.MenuTree timeCategory = this._timeCategory; - List elements = new List(); - CreativePowerUIElementRequestInfo request = new CreativePowerUIElementRequestInfo() - { - PreferredButtonWidth = 40, - PreferredButtonHeight = 40 - }; - CreativePowerManager.Instance.GetPower().ProvidePowerButtons(request, elements); - CreativePowerManager.Instance.GetPower().ProvidePowerButtons(request, elements); - CreativePowerManager.Instance.GetPower().ProvidePowerButtons(request, elements); - CreativePowerManager.Instance.GetPower().ProvidePowerButtons(request, elements); - CreativePowerManager.Instance.GetPower().ProvidePowerButtons(request, elements); - GroupOptionButton subcategoryButton = this.CreateSubcategoryButton(ref request, 2, "strip 2", 1, 0, timeCategory.Buttons, timeCategory.Sliders); - subcategoryButton.OnClick += new UIElement.MouseEvent(this.TimeCategoryButtonClick); - elements.Add((UIElement) subcategoryButton); - return elements; - } - - private List CreatePersonalPowerStrip() - { - UICreativePowersMenu.MenuTree personalCategory = this._personalCategory; - List elements = new List(); - CreativePowerUIElementRequestInfo request = new CreativePowerUIElementRequestInfo() - { - PreferredButtonWidth = 40, - PreferredButtonHeight = 40 - }; - CreativePowerManager.Instance.GetPower().ProvidePowerButtons(request, elements); - CreativePowerManager.Instance.GetPower().ProvidePowerButtons(request, elements); - GroupOptionButton subcategoryButton = this.CreateSubcategoryButton(ref request, 2, "strip 2", 1, 0, personalCategory.Buttons, personalCategory.Sliders); - subcategoryButton.OnClick += new UIElement.MouseEvent(this.PersonalCategoryButtonClick); - elements.Add((UIElement) subcategoryButton); - return elements; - } - - private List CreateWeatherPowerStrip() - { - UICreativePowersMenu.MenuTree weatherCategory = this._weatherCategory; - List elements = new List(); - CreativePowerUIElementRequestInfo request = new CreativePowerUIElementRequestInfo() - { - PreferredButtonWidth = 40, - PreferredButtonHeight = 40 - }; - GroupOptionButton subcategoryButton1 = this.CreateSubcategoryButton(ref request, 2, "strip 2", 1, 0, weatherCategory.Buttons, weatherCategory.Sliders); - subcategoryButton1.OnClick += new UIElement.MouseEvent(this.WeatherCategoryButtonClick); - elements.Add((UIElement) subcategoryButton1); - CreativePowerManager.Instance.GetPower().ProvidePowerButtons(request, elements); - GroupOptionButton subcategoryButton2 = this.CreateSubcategoryButton(ref request, 2, "strip 2", 2, 0, weatherCategory.Buttons, weatherCategory.Sliders); - subcategoryButton2.OnClick += new UIElement.MouseEvent(this.WeatherCategoryButtonClick); - elements.Add((UIElement) subcategoryButton2); - CreativePowerManager.Instance.GetPower().ProvidePowerButtons(request, elements); - return elements; - } - - private GroupOptionButton CreateSubcategoryButton( - ref CreativePowerUIElementRequestInfo request, - int subcategoryDepth, - string subcategoryName, - int subcategoryIndex, - int currentSelectedInSubcategory, - Dictionary> subcategoryButtons, - Dictionary slidersSet) - where T : ICreativePower, IProvideSliderElement, IPowerSubcategoryElement - { - T power = CreativePowerManager.Instance.GetPower(); - UIElement uiElement = power.ProvideSlider(); - uiElement.Left = new StyleDimension((float) (20 + subcategoryDepth * 60), 0.0f); - slidersSet[subcategoryIndex] = uiElement; - uiElement.SetSnapPoint(subcategoryName, 0, new Vector2?(new Vector2(0.0f, 0.5f)), new Vector2?(new Vector2(28f, 0.0f))); - GroupOptionButton optionButton = power.GetOptionButton(request, subcategoryIndex, currentSelectedInSubcategory); - subcategoryButtons[subcategoryIndex] = optionButton; - CreativePowersHelper.UpdateUnlockStateByPower((ICreativePower) power, (UIElement) optionButton, CreativePowersHelper.CommonSelectedColor); - return optionButton; - } - - private void WeatherCategoryButtonClick(UIMouseEvent evt, UIElement listeningElement) - { - GroupOptionButton groupOptionButton = listeningElement as GroupOptionButton; - switch (groupOptionButton.OptionValue) - { - case 1: - if (!CreativePowerManager.Instance.GetPower().GetIsUnlocked()) - return; - break; - case 2: - if (!CreativePowerManager.Instance.GetPower().GetIsUnlocked()) - return; - break; - } - this.ToggleWeatherCategory(groupOptionButton.OptionValue); - this.RefreshElementsOrder(); - } - - private void TimeCategoryButtonClick(UIMouseEvent evt, UIElement listeningElement) - { - GroupOptionButton groupOptionButton = listeningElement as GroupOptionButton; - if (groupOptionButton.OptionValue == 1 && !CreativePowerManager.Instance.GetPower().GetIsUnlocked()) - return; - this.ToggleTimeCategory(groupOptionButton.OptionValue); - this.RefreshElementsOrder(); - } - - private void PersonalCategoryButtonClick(UIMouseEvent evt, UIElement listeningElement) - { - GroupOptionButton groupOptionButton = listeningElement as GroupOptionButton; - if (groupOptionButton.OptionValue == 1 && !CreativePowerManager.Instance.GetPower().GetIsUnlocked()) - return; - this.TogglePersonalCategory(groupOptionButton.OptionValue); - this.RefreshElementsOrder(); - } - - private void RefreshElementsOrder() - { - this._container.RemoveAllChildren(); - this._container.Append((UIElement) this._mainPowerStrip); - UIElement element = (UIElement) null; - UICreativePowersMenu.MenuTree mainCategory = this._mainCategory; - if (mainCategory.Sliders.TryGetValue(mainCategory.CurrentOption, out element)) - this._container.Append(element); - if (mainCategory.CurrentOption == 1) - { - this._infiniteItemsWindow.SetPageTypeToShow(UICreativeInfiniteItemsDisplay.InfiniteItemsDisplayPage.InfiniteItemsPickup); - this._container.Append((UIElement) this._infiniteItemsWindow); - } - if (mainCategory.CurrentOption == 2) - { - this._infiniteItemsWindow.SetPageTypeToShow(UICreativeInfiniteItemsDisplay.InfiniteItemsDisplayPage.InfiniteItemsResearch); - this._container.Append((UIElement) this._infiniteItemsWindow); - } - if (mainCategory.CurrentOption == 3) - { - this._container.Append((UIElement) this._timePowersStrip); - UICreativePowersMenu.MenuTree timeCategory = this._timeCategory; - if (timeCategory.Sliders.TryGetValue(timeCategory.CurrentOption, out element)) - this._container.Append(element); - } - if (mainCategory.CurrentOption == 4) - { - this._container.Append((UIElement) this._weatherPowersStrip); - UICreativePowersMenu.MenuTree weatherCategory = this._weatherCategory; - if (weatherCategory.Sliders.TryGetValue(weatherCategory.CurrentOption, out element)) - this._container.Append(element); - } - if (mainCategory.CurrentOption != 6) - return; - this._container.Append((UIElement) this._personalPowersStrip); - UICreativePowersMenu.MenuTree personalCategory = this._personalCategory; - if (!personalCategory.Sliders.TryGetValue(personalCategory.CurrentOption, out element)) - return; - this._container.Append(element); - } - - public override void Draw(SpriteBatch spriteBatch) - { - base.Draw(spriteBatch); - this.SetupGamepadPoints(spriteBatch); - } - - private void SetupGamepadPoints(SpriteBatch spriteBatch) - { - int currentID = 10000; - List snapPoints = this.GetSnapPoints(); - List pointsByCategoryName1 = this._helper.GetOrderedPointsByCategoryName(snapPoints, "strip 0"); - List pointsByCategoryName2 = this._helper.GetOrderedPointsByCategoryName(snapPoints, "strip 1"); - List pointsByCategoryName3 = this._helper.GetOrderedPointsByCategoryName(snapPoints, "strip 2"); - UILinkPoint[] uiLinkPointArray1 = (UILinkPoint[]) null; - UILinkPoint[] uiLinkPointArray2 = (UILinkPoint[]) null; - UILinkPoint[] stripOnRight = (UILinkPoint[]) null; - if (pointsByCategoryName1.Count > 0) - uiLinkPointArray1 = this._helper.CreateUILinkStripVertical(ref currentID, pointsByCategoryName1); - if (pointsByCategoryName2.Count > 0) - uiLinkPointArray2 = this._helper.CreateUILinkStripVertical(ref currentID, pointsByCategoryName2); - if (pointsByCategoryName3.Count > 0) - stripOnRight = this._helper.CreateUILinkStripVertical(ref currentID, pointsByCategoryName3); - if (uiLinkPointArray1 != null && uiLinkPointArray2 != null) - this._helper.LinkVerticalStrips(uiLinkPointArray1, uiLinkPointArray2, (uiLinkPointArray1.Length - uiLinkPointArray2.Length) / 2); - if (uiLinkPointArray2 != null && stripOnRight != null) - this._helper.LinkVerticalStrips(uiLinkPointArray2, stripOnRight, (uiLinkPointArray1.Length - uiLinkPointArray2.Length) / 2); - UILinkPoint downSide = (UILinkPoint) null; - UILinkPoint uiLinkPoint = (UILinkPoint) null; - for (int index = 0; index < snapPoints.Count; ++index) - { - SnapPoint snap = snapPoints[index]; - string name = snap.Name; - if (!(name == "CreativeSacrificeConfirm")) - { - if (name == "CreativeInfinitesSearch") - { - uiLinkPoint = this._helper.MakeLinkPointFromSnapPoint(currentID++, snap); - Main.CreativeMenu.GamepadPointIdForInfiniteItemSearchHack = uiLinkPoint.ID; - } - } - else - downSide = this._helper.MakeLinkPointFromSnapPoint(currentID++, snap); - } - UILinkPoint point = UILinkPointNavigator.Points[15000]; - List pointsByCategoryName4 = this._helper.GetOrderedPointsByCategoryName(snapPoints, "CreativeInfinitesFilter"); - if (pointsByCategoryName4.Count > 0) - { - UILinkPoint[] linkStripHorizontal = this._helper.CreateUILinkStripHorizontal(ref currentID, pointsByCategoryName4); - if (uiLinkPoint != null) - { - uiLinkPoint.Up = linkStripHorizontal[0].ID; - for (int index = 0; index < linkStripHorizontal.Length; ++index) - linkStripHorizontal[index].Down = uiLinkPoint.ID; - } - } - List pointsByCategoryName5 = this._helper.GetOrderedPointsByCategoryName(snapPoints, "CreativeInfinitesSlot"); - UILinkPoint[,] uiLinkPointArray3 = (UILinkPoint[,]) null; - if (pointsByCategoryName5.Count > 0) - { - uiLinkPointArray3 = this._helper.CreateUILinkPointGrid(ref currentID, pointsByCategoryName5, this._infiniteItemsWindow.GetItemsPerLine(), uiLinkPoint, uiLinkPointArray1[0]); - this._helper.LinkVerticalStripRightSideToSingle(uiLinkPointArray1, uiLinkPointArray3[0, 0]); - } - else if (uiLinkPoint != null) - this._helper.LinkVerticalStripRightSideToSingle(uiLinkPointArray1, uiLinkPoint); - if (uiLinkPoint != null && uiLinkPointArray3 != null) - this._helper.PairUpDown(uiLinkPoint, uiLinkPointArray3[0, 0]); - if (point != null && this.IsShowingResearchMenu) - this._helper.LinkVerticalStripRightSideToSingle(uiLinkPointArray1, point); - if (downSide != null) - { - this._helper.PairUpDown(point, downSide); - downSide.Left = uiLinkPointArray1[0].ID; - } - if (!Main.CreativeMenu.GamepadMoveToSearchButtonHack) - return; - Main.CreativeMenu.GamepadMoveToSearchButtonHack = false; - if (uiLinkPoint == null) - return; - UILinkPointNavigator.ChangePoint(uiLinkPoint.ID); - } - - private class MenuTree where TEnum : struct, IConvertible - { - public int CurrentOption; - public Dictionary> Buttons = new Dictionary>(); - public Dictionary Sliders = new Dictionary(); - - public MenuTree(TEnum defaultValue) => this.CurrentOption = defaultValue.ToInt32((IFormatProvider) null); - } - - private enum OpenMainSubCategory - { - None, - InfiniteItems, - ResearchWindow, - Time, - Weather, - EnemyStrengthSlider, - PersonalPowers, - } - - private enum WeatherSubcategory - { - None, - WindSlider, - RainSlider, - } - - private enum TimeSubcategory - { - None, - TimeRate, - } - - private enum PersonalSubcategory - { - None, - EnemySpawnRateSlider, - } - } -} diff --git a/GameContent/UI/States/UIEmotesMenu.cs b/GameContent/UI/States/UIEmotesMenu.cs deleted file mode 100644 index 9710df7..0000000 --- a/GameContent/UI/States/UIEmotesMenu.cs +++ /dev/null @@ -1,633 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.States.UIEmotesMenu -// 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; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria.Audio; -using Terraria.GameContent.Events; -using Terraria.GameContent.UI.Elements; -using Terraria.ID; -using Terraria.Localization; -using Terraria.UI; -using Terraria.UI.Gamepad; - -namespace Terraria.GameContent.UI.States -{ - public class UIEmotesMenu : UIState - { - private UIElement _outerContainer; - private UIElement _backPanel; - private UIElement _container; - private UIList _list; - private UIScrollbar _scrollBar; - private bool _isScrollbarAttached; - - public override void OnActivate() - { - this.InitializePage(); - if (Main.gameMenu) - { - this._outerContainer.Top.Set(220f, 0.0f); - this._outerContainer.Height.Set(-220f, 1f); - } - else - { - this._outerContainer.Top.Set(120f, 0.0f); - this._outerContainer.Height.Set(-120f, 1f); - } - } - - public void InitializePage() - { - this.RemoveAllChildren(); - UIElement element = new UIElement(); - element.Width.Set(590f, 0.0f); - element.Top.Set(220f, 0.0f); - element.Height.Set(-220f, 1f); - element.HAlign = 0.5f; - this._outerContainer = element; - this.Append(element); - UIPanel uiPanel = new UIPanel(); - uiPanel.Width.Set(0.0f, 1f); - uiPanel.Height.Set(-110f, 1f); - uiPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f; - uiPanel.PaddingTop = 0.0f; - element.Append((UIElement) uiPanel); - this._container = (UIElement) uiPanel; - UIList uiList = new UIList(); - uiList.Width.Set(-25f, 1f); - uiList.Height.Set(-50f, 1f); - uiList.Top.Set(50f, 0.0f); - uiList.HAlign = 0.5f; - uiList.ListPadding = 14f; - uiPanel.Append((UIElement) uiList); - this._list = uiList; - UIScrollbar scrollbar = new UIScrollbar(); - scrollbar.SetView(100f, 1000f); - scrollbar.Height.Set(-20f, 1f); - scrollbar.HAlign = 1f; - scrollbar.VAlign = 1f; - scrollbar.Top = StyleDimension.FromPixels(-5f); - uiList.SetScrollbar(scrollbar); - this._scrollBar = scrollbar; - UITextPanel uiTextPanel = new UITextPanel(Language.GetText("UI.Back"), 0.7f, true); - uiTextPanel.Width.Set(-10f, 0.5f); - uiTextPanel.Height.Set(50f, 0.0f); - uiTextPanel.VAlign = 1f; - uiTextPanel.HAlign = 0.5f; - uiTextPanel.Top.Set(-45f, 0.0f); - uiTextPanel.OnMouseOver += new UIElement.MouseEvent(this.FadedMouseOver); - uiTextPanel.OnMouseOut += new UIElement.MouseEvent(this.FadedMouseOut); - uiTextPanel.OnClick += new UIElement.MouseEvent(this.GoBackClick); - uiTextPanel.SetSnapPoint("Back", 0); - element.Append((UIElement) uiTextPanel); - this._backPanel = (UIElement) uiTextPanel; - int currentGroupIndex = 0; - this.TryAddingList(Language.GetText("UI.EmoteCategoryGeneral"), ref currentGroupIndex, 10, this.GetEmotesGeneral()); - this.TryAddingList(Language.GetText("UI.EmoteCategoryRPS"), ref currentGroupIndex, 10, this.GetEmotesRPS()); - this.TryAddingList(Language.GetText("UI.EmoteCategoryItems"), ref currentGroupIndex, 11, this.GetEmotesItems()); - this.TryAddingList(Language.GetText("UI.EmoteCategoryBiomesAndEvents"), ref currentGroupIndex, 8, this.GetEmotesBiomesAndEvents()); - this.TryAddingList(Language.GetText("UI.EmoteCategoryTownNPCs"), ref currentGroupIndex, 9, this.GetEmotesTownNPCs()); - this.TryAddingList(Language.GetText("UI.EmoteCategoryCritters"), ref currentGroupIndex, 7, this.GetEmotesCritters()); - this.TryAddingList(Language.GetText("UI.EmoteCategoryBosses"), ref currentGroupIndex, 8, this.GetEmotesBosses()); - } - - private void TryAddingList( - LocalizedText title, - ref int currentGroupIndex, - int maxEmotesPerRow, - List emoteIds) - { - if (emoteIds == null || emoteIds.Count == 0) - return; - this._list.Add((UIElement) new EmotesGroupListItem(title, currentGroupIndex++, maxEmotesPerRow, emoteIds.ToArray())); - } - - private List GetEmotesGeneral() => new List() - { - 0, - 1, - 2, - 3, - 15, - 136, - 94, - 16, - 135, - 134, - 137, - 138, - 139, - 17, - 87, - 88, - 89, - 91, - 92, - 93, - 8, - 9, - 10, - 11, - 14, - 100 - }; - - private List GetEmotesRPS() => new List() - { - 36, - 37, - 38, - 33, - 34, - 35 - }; - - private List GetEmotesItems() => new List() - { - 7, - 73, - 74, - 75, - 76, - 131, - 78, - 79, - 80, - 81, - 82, - 83, - 84, - 85, - 86, - 90, - 132, - 126, - (int) sbyte.MaxValue, - 128, - 129 - }; - - private List GetEmotesBiomesAndEvents() => new List() - { - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 30, - 31, - 32, - 18, - 19, - 20, - 21, - 99, - 4, - 5, - 6, - 95, - 96, - 97, - 98 - }; - - private List GetEmotesTownNPCs() => new List() - { - 101, - 102, - 103, - 104, - 105, - 106, - 107, - 108, - 109, - 110, - 111, - 112, - 113, - 114, - 115, - 116, - 117, - 118, - 119, - 120, - 121, - 122, - 123, - 124, - 125, - 130, - 140, - 141, - 142 - }; - - private List GetEmotesCritters() - { - List intList = new List(); - intList.AddRange((IEnumerable) new int[5] - { - 12, - 13, - 61, - 62, - 63 - }); - intList.AddRange((IEnumerable) new int[4] - { - 67, - 68, - 69, - 70 - }); - intList.Add(72); - if (NPC.downedGoblins) - intList.Add(64); - if (NPC.downedFrost) - intList.Add(66); - if (NPC.downedPirates) - intList.Add(65); - if (NPC.downedMartians) - intList.Add(71); - return intList; - } - - private List GetEmotesBosses() - { - List intList = new List(); - if (NPC.downedBoss1) - intList.Add(39); - if (NPC.downedBoss2) - { - intList.Add(40); - intList.Add(41); - } - if (NPC.downedSlimeKing) - intList.Add(51); - if (NPC.downedQueenBee) - intList.Add(42); - if (NPC.downedBoss3) - intList.Add(43); - if (Main.hardMode) - intList.Add(44); - if (NPC.downedQueenSlime) - intList.Add(144); - if (NPC.downedMechBoss1) - intList.Add(45); - if (NPC.downedMechBoss3) - intList.Add(46); - if (NPC.downedMechBoss2) - intList.Add(47); - if (NPC.downedPlantBoss) - intList.Add(48); - if (NPC.downedGolemBoss) - intList.Add(49); - if (NPC.downedFishron) - intList.Add(50); - if (NPC.downedEmpressOfLight) - intList.Add(143); - if (NPC.downedAncientCultist) - intList.Add(52); - if (NPC.downedMoonlord) - intList.Add(53); - if (NPC.downedHalloweenTree) - intList.Add(54); - if (NPC.downedHalloweenKing) - intList.Add(55); - if (NPC.downedChristmasTree) - intList.Add(56); - if (NPC.downedChristmasIceQueen) - intList.Add(57); - if (NPC.downedChristmasSantank) - intList.Add(58); - if (NPC.downedPirates) - intList.Add(59); - if (NPC.downedMartians) - intList.Add(60); - if (DD2Event.DownedInvasionAnyDifficulty) - intList.Add(133); - return intList; - } - - public override void Recalculate() - { - if (this._scrollBar != null) - { - if (this._isScrollbarAttached && !this._scrollBar.CanScroll) - { - this._container.RemoveChild((UIElement) this._scrollBar); - this._isScrollbarAttached = false; - this._list.Width.Set(0.0f, 1f); - } - else if (!this._isScrollbarAttached && this._scrollBar.CanScroll) - { - this._container.Append((UIElement) this._scrollBar); - this._isScrollbarAttached = true; - this._list.Width.Set(-25f, 1f); - } - } - base.Recalculate(); - } - - private void GoBackClick(UIMouseEvent evt, UIElement listeningElement) - { - Main.menuMode = 0; - IngameFancyUI.Close(); - } - - private void FadedMouseOver(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(12); - ((UIPanel) evt.Target).BackgroundColor = new Color(73, 94, 171); - ((UIPanel) evt.Target).BorderColor = Colors.FancyUIFatButtonMouseOver; - } - - private void FadedMouseOut(UIMouseEvent evt, UIElement listeningElement) - { - ((UIPanel) evt.Target).BackgroundColor = new Color(63, 82, 151) * 0.8f; - ((UIPanel) evt.Target).BorderColor = Color.Black; - } - - public override void Draw(SpriteBatch spriteBatch) - { - base.Draw(spriteBatch); - this.SetupGamepadPoints2(spriteBatch); - } - - private void SetupGamepadPoints2(SpriteBatch spriteBatch) - { - int num1 = 7; - UILinkPointNavigator.Shortcuts.BackButtonCommand = 1; - int ID; - int key1 = ID = 3001; - List snapPoints = this.GetSnapPoints(); - this.RemoveSnapPointsOutOfScreen(spriteBatch, snapPoints); - Vector2 vector2 = this._backPanel.GetInnerDimensions().ToRectangle().Center.ToVector2(); - UILinkPointNavigator.SetPosition(ID, vector2); - UILinkPoint point1 = UILinkPointNavigator.Points[key1]; - point1.Unlink(); - point1.Up = key1 + 1; - UILinkPoint uiLinkPoint = point1; - int num2 = key1 + 1; - int length = 0; - List> snapPointListList = new List>(); - for (int groupIndex = 0; groupIndex < num1; ++groupIndex) - { - List emoteGroup = this.GetEmoteGroup(snapPoints, groupIndex); - if (emoteGroup.Count > 0) - snapPointListList.Add(emoteGroup); - length += (int) Math.Ceiling((double) emoteGroup.Count / 14.0); - } - SnapPoint[,] snapPointArray = new SnapPoint[14, length]; - int num3 = 0; - for (int index1 = 0; index1 < snapPointListList.Count; ++index1) - { - List snapPointList = snapPointListList[index1]; - for (int index2 = 0; index2 < snapPointList.Count; ++index2) - { - int index3 = num3 + index2 / 14; - int index4 = index2 % 14; - snapPointArray[index4, index3] = snapPointList[index2]; - } - num3 += (int) Math.Ceiling((double) snapPointList.Count / 14.0); - } - int[,] grid = new int[14, length]; - int num4 = 0; - for (int index5 = 0; index5 < snapPointArray.GetLength(1); ++index5) - { - for (int index6 = 0; index6 < snapPointArray.GetLength(0); ++index6) - { - SnapPoint snapPoint = snapPointArray[index6, index5]; - if (snapPoint != null) - { - UILinkPointNavigator.Points[num2].Unlink(); - UILinkPointNavigator.SetPosition(num2, snapPoint.Position); - grid[index6, index5] = num2; - if (index6 == 0) - num4 = num2; - ++num2; - } - } - } - uiLinkPoint.Up = num4; - for (int y1 = 0; y1 < snapPointArray.GetLength(1); ++y1) - { - for (int x1 = 0; x1 < snapPointArray.GetLength(0); ++x1) - { - int key2 = grid[x1, y1]; - if (key2 != 0) - { - UILinkPoint point2 = UILinkPointNavigator.Points[key2]; - if (this.TryGetPointOnGrid(grid, x1, y1, -1, 0)) - { - point2.Left = grid[x1 - 1, y1]; - } - else - { - point2.Left = point2.ID; - for (int x2 = x1; x2 < snapPointArray.GetLength(0); ++x2) - { - if (this.TryGetPointOnGrid(grid, x2, y1, 0, 0)) - point2.Left = grid[x2, y1]; - } - } - if (this.TryGetPointOnGrid(grid, x1, y1, 1, 0)) - { - point2.Right = grid[x1 + 1, y1]; - } - else - { - point2.Right = point2.ID; - for (int x3 = x1; x3 >= 0; --x3) - { - if (this.TryGetPointOnGrid(grid, x3, y1, 0, 0)) - point2.Right = grid[x3, y1]; - } - } - if (this.TryGetPointOnGrid(grid, x1, y1, 0, -1)) - { - point2.Up = grid[x1, y1 - 1]; - } - else - { - point2.Up = point2.ID; - for (int y2 = y1 - 1; y2 >= 0; --y2) - { - if (this.TryGetPointOnGrid(grid, x1, y2, 0, 0)) - { - point2.Up = grid[x1, y2]; - break; - } - } - } - if (this.TryGetPointOnGrid(grid, x1, y1, 0, 1)) - { - point2.Down = grid[x1, y1 + 1]; - } - else - { - point2.Down = point2.ID; - for (int y3 = y1 + 1; y3 < snapPointArray.GetLength(1); ++y3) - { - if (this.TryGetPointOnGrid(grid, x1, y3, 0, 0)) - { - point2.Down = grid[x1, y3]; - break; - } - } - if (point2.Down == point2.ID) - point2.Down = uiLinkPoint.ID; - } - } - } - } - } - - private bool TryGetPointOnGrid(int[,] grid, int x, int y, int offsetX, int offsetY) => x + offsetX >= 0 && x + offsetX < grid.GetLength(0) && y + offsetY >= 0 && y + offsetY < grid.GetLength(1) && grid[x + offsetX, y + offsetY] != 0; - - private void RemoveSnapPointsOutOfScreen(SpriteBatch spriteBatch, List pts) - { - float num = 1f / Main.UIScale; - Rectangle clippingRectangle = this._container.GetClippingRectangle(spriteBatch); - Vector2 minimum = clippingRectangle.TopLeft() * num; - Vector2 maximum = clippingRectangle.BottomRight() * num; - for (int index = 0; index < pts.Count; ++index) - { - if (!pts[index].Position.Between(minimum, maximum)) - { - pts.Remove(pts[index]); - --index; - } - } - } - - private void SetupGamepadPoints(SpriteBatch spriteBatch) - { - UILinkPointNavigator.Shortcuts.BackButtonCommand = 1; - int ID = 3001; - int key = ID; - List snapPoints = this.GetSnapPoints(); - UILinkPointNavigator.SetPosition(ID, this._backPanel.GetInnerDimensions().ToRectangle().Center.ToVector2()); - UILinkPoint point1 = UILinkPointNavigator.Points[key]; - point1.Unlink(); - point1.Up = key + 1; - UILinkPoint uiLinkPoint = point1; - int num1 = key + 1; - float num2 = 1f / Main.UIScale; - Rectangle clippingRectangle = this._container.GetClippingRectangle(spriteBatch); - Vector2 minimum = clippingRectangle.TopLeft() * num2; - Vector2 maximum = clippingRectangle.BottomRight() * num2; - for (int index = 0; index < snapPoints.Count; ++index) - { - if (!snapPoints[index].Position.Between(minimum, maximum)) - { - snapPoints.Remove(snapPoints[index]); - --index; - } - } - int num3 = 0; - int num4 = 7; - List> snapPointListList = new List>(); - for (int groupIndex = 0; groupIndex < num4; ++groupIndex) - { - List emoteGroup = this.GetEmoteGroup(snapPoints, groupIndex); - if (emoteGroup.Count > 0) - snapPointListList.Add(emoteGroup); - } - List[] array = snapPointListList.ToArray(); - for (int index1 = 0; index1 < array.Length; ++index1) - { - List snapPointList = array[index1]; - int num5 = snapPointList.Count / 14; - if (snapPointList.Count % 14 > 0) - ++num5; - int num6 = 14; - if (snapPointList.Count % 14 != 0) - num6 = snapPointList.Count % 14; - for (int index2 = 0; index2 < snapPointList.Count; ++index2) - { - UILinkPoint point2 = UILinkPointNavigator.Points[num1]; - point2.Unlink(); - UILinkPointNavigator.SetPosition(num1, snapPointList[index2].Position); - int num7 = 14; - if (index2 / 14 == num5 - 1 && snapPointList.Count % 14 != 0) - num7 = snapPointList.Count % 14; - int num8 = index2 % 14; - point2.Left = num1 - 1; - point2.Right = num1 + 1; - point2.Up = num1 - 14; - point2.Down = num1 + 14; - if (num8 == num7 - 1) - point2.Right = num1 - num7 + 1; - if (num8 == 0) - point2.Left = num1 + num7 - 1; - if (num8 == 0) - uiLinkPoint.Up = num1; - if (index2 < 14) - { - if (num3 == 0) - { - point2.Up = -1; - } - else - { - point2.Up = num1 - 14; - if (num8 >= num3) - point2.Up -= 14; - for (int index3 = index1 - 1; index3 > 0 && array[index3].Count <= num8; --index3) - point2.Up -= 14; - } - } - int num9 = ID; - if (index1 == array.Length - 1) - { - if (index2 / 14 < num5 - 1 && num8 >= snapPointList.Count % 14) - point2.Down = num9; - if (index2 / 14 == num5 - 1) - point2.Down = num9; - } - else if (index2 / 14 == num5 - 1) - { - point2.Down = num1 + 14; - for (int index4 = index1 + 1; index4 < array.Length && array[index4].Count <= num8; ++index4) - point2.Down += 14; - if (index1 == array.Length - 1) - point2.Down = num9; - } - else if (num8 >= num6) - { - point2.Down = num1 + 14 + 14; - for (int index5 = index1 + 1; index5 < array.Length && array[index5].Count <= num8; ++index5) - point2.Down += 14; - } - ++num1; - } - num3 = num6; - int num10 = 14 - num3; - num1 += num10; - } - } - - private List GetEmoteGroup(List ptsOnPage, int groupIndex) - { - string groupName = "Group " + (object) groupIndex; - List list = ptsOnPage.Where((Func) (a => a.Name == groupName)).ToList(); - list.Sort(new Comparison(this.SortPoints)); - return list; - } - - private int SortPoints(SnapPoint a, SnapPoint b) => a.Id.CompareTo(b.Id); - } -} diff --git a/GameContent/UI/States/UIGamepadHelper.cs b/GameContent/UI/States/UIGamepadHelper.cs deleted file mode 100644 index e44b00c..0000000 --- a/GameContent/UI/States/UIGamepadHelper.cs +++ /dev/null @@ -1,237 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.States.UIGamepadHelper -// 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; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; -using Terraria.GameInput; -using Terraria.UI; -using Terraria.UI.Gamepad; - -namespace Terraria.GameContent.UI.States -{ - [StructLayout(LayoutKind.Sequential, Size = 1)] - public struct UIGamepadHelper - { - public UILinkPoint[,] CreateUILinkPointGrid( - ref int currentID, - List pointsForGrid, - int pointsPerLine, - UILinkPoint topLinkPoint, - UILinkPoint leftLinkPoint) - { - int length = (int) Math.Ceiling((double) pointsForGrid.Count / (double) pointsPerLine); - UILinkPoint[,] uiLinkPointArray = new UILinkPoint[pointsPerLine, length]; - for (int index1 = 0; index1 < pointsForGrid.Count; ++index1) - { - int index2 = index1 % pointsPerLine; - int index3 = index1 / pointsPerLine; - uiLinkPointArray[index2, index3] = this.MakeLinkPointFromSnapPoint(currentID++, pointsForGrid[index1]); - } - for (int index4 = 0; index4 < uiLinkPointArray.GetLength(0); ++index4) - { - for (int index5 = 0; index5 < uiLinkPointArray.GetLength(1); ++index5) - { - UILinkPoint uiLinkPoint = uiLinkPointArray[index4, index5]; - if (uiLinkPoint != null) - { - if (index4 < uiLinkPointArray.GetLength(0) - 1) - { - UILinkPoint rightSide = uiLinkPointArray[index4 + 1, index5]; - if (rightSide != null) - this.PairLeftRight(uiLinkPoint, rightSide); - } - if (index5 < uiLinkPointArray.GetLength(1) - 1) - { - UILinkPoint downSide = uiLinkPointArray[index4, index5 + 1]; - if (downSide != null) - this.PairUpDown(uiLinkPoint, downSide); - } - if (index4 == 0) - uiLinkPoint.Left = leftLinkPoint.ID; - if (index5 == 0) - uiLinkPoint.Up = topLinkPoint.ID; - } - } - } - return uiLinkPointArray; - } - - public void LinkVerticalStrips( - UILinkPoint[] stripOnLeft, - UILinkPoint[] stripOnRight, - int leftStripStartOffset) - { - if (stripOnLeft == null || stripOnRight == null) - return; - int num1 = Math.Max(stripOnLeft.Length, stripOnRight.Length); - int num2 = Math.Min(stripOnLeft.Length, stripOnRight.Length); - for (int index = 0; index < leftStripStartOffset; ++index) - this.PairLeftRight(stripOnLeft[index], stripOnRight[0]); - for (int index = 0; index < num2; ++index) - this.PairLeftRight(stripOnLeft[index + leftStripStartOffset], stripOnRight[index]); - for (int index = num2; index < num1; ++index) - { - if (stripOnLeft.Length > index) - stripOnLeft[index].Right = stripOnRight[stripOnRight.Length - 1].ID; - if (stripOnRight.Length > index) - stripOnRight[index].Left = stripOnLeft[stripOnLeft.Length - 1].ID; - } - } - - public void LinkVerticalStripRightSideToSingle(UILinkPoint[] strip, UILinkPoint theSingle) - { - if (strip == null || theSingle == null) - return; - int num1 = Math.Max(strip.Length, 1); - int num2 = Math.Min(strip.Length, 1); - for (int index = 0; index < num2; ++index) - this.PairLeftRight(strip[index], theSingle); - for (int index = num2; index < num1; ++index) - { - if (strip.Length > index) - strip[index].Right = theSingle.ID; - } - } - - public void LinkVerticalStripBottomSideToSingle(UILinkPoint[] strip, UILinkPoint theSingle) - { - if (strip == null || theSingle == null) - return; - this.PairUpDown(strip[strip.Length - 1], theSingle); - } - - public UILinkPoint[] CreateUILinkStripVertical( - ref int currentID, - List currentStrip) - { - UILinkPoint[] uiLinkPointArray = new UILinkPoint[currentStrip.Count]; - for (int index = 0; index < currentStrip.Count; ++index) - uiLinkPointArray[index] = this.MakeLinkPointFromSnapPoint(currentID++, currentStrip[index]); - for (int index = 0; index < currentStrip.Count - 1; ++index) - this.PairUpDown(uiLinkPointArray[index], uiLinkPointArray[index + 1]); - return uiLinkPointArray; - } - - public UILinkPoint[] CreateUILinkStripHorizontal( - ref int currentID, - List currentStrip) - { - UILinkPoint[] uiLinkPointArray = new UILinkPoint[currentStrip.Count]; - for (int index = 0; index < currentStrip.Count; ++index) - uiLinkPointArray[index] = this.MakeLinkPointFromSnapPoint(currentID++, currentStrip[index]); - for (int index = 0; index < currentStrip.Count - 1; ++index) - this.PairLeftRight(uiLinkPointArray[index], uiLinkPointArray[index + 1]); - return uiLinkPointArray; - } - - public void TryMovingBackIntoCreativeGridIfOutOfIt(int start, int currentID) - { - List lostrefpoints = new List(); - for (int key = start; key < currentID; ++key) - lostrefpoints.Add(UILinkPointNavigator.Points[key]); - if (!PlayerInput.UsingGamepadUI || UILinkPointNavigator.CurrentPoint < currentID) - return; - this.MoveToVisuallyClosestPoint(lostrefpoints); - } - - public void MoveToVisuallyClosestPoint(List lostrefpoints) - { - Dictionary points = UILinkPointNavigator.Points; - Vector2 mouseScreen = Main.MouseScreen; - UILinkPoint uiLinkPoint = (UILinkPoint) null; - foreach (UILinkPoint lostrefpoint in lostrefpoints) - { - if (uiLinkPoint == null || (double) Vector2.Distance(mouseScreen, uiLinkPoint.Position) > (double) Vector2.Distance(mouseScreen, lostrefpoint.Position)) - uiLinkPoint = lostrefpoint; - } - if (uiLinkPoint == null) - return; - UILinkPointNavigator.ChangePoint(uiLinkPoint.ID); - } - - public List GetOrderedPointsByCategoryName( - List pts, - string name) - { - return pts.Where((Func) (x => x.Name == name)).OrderBy((Func) (x => x.Id)).ToList(); - } - - public void PairLeftRight(UILinkPoint leftSide, UILinkPoint rightSide) - { - leftSide.Right = rightSide.ID; - rightSide.Left = leftSide.ID; - } - - public void PairUpDown(UILinkPoint upSide, UILinkPoint downSide) - { - upSide.Down = downSide.ID; - downSide.Up = upSide.ID; - } - - public UILinkPoint MakeLinkPointFromSnapPoint(int id, SnapPoint snap) - { - UILinkPointNavigator.SetPosition(id, snap.Position); - UILinkPoint point = UILinkPointNavigator.Points[id]; - point.Unlink(); - return point; - } - - public UILinkPoint[] GetVerticalStripFromCategoryName( - ref int currentID, - List pts, - string categoryName) - { - List pointsByCategoryName = this.GetOrderedPointsByCategoryName(pts, categoryName); - UILinkPoint[] uiLinkPointArray = (UILinkPoint[]) null; - if (pointsByCategoryName.Count > 0) - uiLinkPointArray = this.CreateUILinkStripVertical(ref currentID, pointsByCategoryName); - return uiLinkPointArray; - } - - public void MoveToVisuallyClosestPoint(int idRangeStartInclusive, int idRangeEndExclusive) - { - if (UILinkPointNavigator.CurrentPoint >= idRangeStartInclusive && UILinkPointNavigator.CurrentPoint < idRangeEndExclusive) - return; - Dictionary points = UILinkPointNavigator.Points; - Vector2 mouseScreen = Main.MouseScreen; - UILinkPoint uiLinkPoint1 = (UILinkPoint) null; - for (int key = idRangeStartInclusive; key < idRangeEndExclusive; ++key) - { - UILinkPoint uiLinkPoint2; - if (!points.TryGetValue(key, out uiLinkPoint2)) - return; - if (uiLinkPoint1 == null || (double) Vector2.Distance(mouseScreen, uiLinkPoint1.Position) > (double) Vector2.Distance(mouseScreen, uiLinkPoint2.Position)) - uiLinkPoint1 = uiLinkPoint2; - } - if (uiLinkPoint1 == null) - return; - UILinkPointNavigator.ChangePoint(uiLinkPoint1.ID); - } - - public void CullPointsOutOfElementArea( - SpriteBatch spriteBatch, - List pointsAtMiddle, - UIElement container) - { - float num = 1f / Main.UIScale; - Rectangle clippingRectangle = container.GetClippingRectangle(spriteBatch); - Vector2 minimum = clippingRectangle.TopLeft() * num; - Vector2 maximum = clippingRectangle.BottomRight() * num; - for (int index = 0; index < pointsAtMiddle.Count; ++index) - { - if (!pointsAtMiddle[index].Position.Between(minimum, maximum)) - { - pointsAtMiddle.Remove(pointsAtMiddle[index]); - --index; - } - } - } - } -} diff --git a/GameContent/UI/States/UIManageControls.cs b/GameContent/UI/States/UIManageControls.cs index 99382dc..cf90bd6 100644 --- a/GameContent/UI/States/UIManageControls.cs +++ b/GameContent/UI/States/UIManageControls.cs @@ -1,20 +1,18 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.States.UIManageControls -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -using ReLogic.Content; using System; using System.Collections.Generic; using System.Linq; -using Terraria.Audio; using Terraria.GameContent.UI.Elements; using Terraria.GameInput; -using Terraria.ID; +using Terraria.Graphics; using Terraria.Initializers; using Terraria.Localization; using Terraria.UI; @@ -33,7 +31,6 @@ namespace Terraria.GameContent.UI.States "RadialHotbar", "RadialQuickbar", "LockOn", - "ToggleCreativeMenu", "sp3", "sp4", "sp5", @@ -74,18 +71,18 @@ namespace Terraria.GameContent.UI.States private UIImageFramed _buttonVs2; private UIImageFramed _buttonBorderVs1; private UIImageFramed _buttonBorderVs2; - private Asset _KeyboardGamepadTexture; - private Asset _keyboardGamepadBorderTexture; - private Asset _GameplayVsUITexture; - private Asset _GameplayVsUIBorderTexture; - private static int SnapPointIndex; + private Texture2D _KeyboardGamepadTexture; + private Texture2D _keyboardGamepadBorderTexture; + private Texture2D _GameplayVsUITexture; + private Texture2D _GameplayVsUIBorderTexture; + private static int SnapPointIndex = 0; public override void OnInitialize() { - this._KeyboardGamepadTexture = Main.Assets.Request("Images/UI/Settings_Inputs", (AssetRequestMode) 1); - this._keyboardGamepadBorderTexture = Main.Assets.Request("Images/UI/Settings_Inputs_Border", (AssetRequestMode) 1); - this._GameplayVsUITexture = Main.Assets.Request("Images/UI/Settings_Inputs_2", (AssetRequestMode) 1); - this._GameplayVsUIBorderTexture = Main.Assets.Request("Images/UI/Settings_Inputs_2_Border", (AssetRequestMode) 1); + this._KeyboardGamepadTexture = TextureManager.Load("Images/UI/Settings_Inputs"); + this._keyboardGamepadBorderTexture = TextureManager.Load("Images/UI/Settings_Inputs_Border"); + this._GameplayVsUITexture = TextureManager.Load("Images/UI/Settings_Inputs_2"); + this._GameplayVsUIBorderTexture = TextureManager.Load("Images/UI/Settings_Inputs_2_Border"); UIElement element = new UIElement(); element.Width.Set(0.0f, 0.8f); element.MaxWidth.Set(600f, 0.0f); @@ -122,7 +119,6 @@ namespace Terraria.GameContent.UI.States this._buttonBorder1.Left.Set(0.0f, 0.0f); this._buttonBorder1.Top.Set(8f, 0.0f); this._buttonBorder1.Color = Color.Silver; - this._buttonBorder1.IgnoresMouseInteraction = true; uiPanel.Append((UIElement) this._buttonBorder1); this._buttonBorder2 = new UIImageFramed(this._keyboardGamepadBorderTexture, this._keyboardGamepadBorderTexture.Frame()); this._buttonBorder2.VAlign = 0.0f; @@ -130,7 +126,6 @@ namespace Terraria.GameContent.UI.States this._buttonBorder2.Left.Set(76f, 0.0f); this._buttonBorder2.Top.Set(8f, 0.0f); this._buttonBorder2.Color = Color.Transparent; - this._buttonBorder2.IgnoresMouseInteraction = true; uiPanel.Append((UIElement) this._buttonBorder2); this._buttonVs1 = new UIImageFramed(this._GameplayVsUITexture, this._GameplayVsUITexture.Frame(2, 2)); this._buttonVs1.VAlign = 0.0f; @@ -156,7 +151,6 @@ namespace Terraria.GameContent.UI.States this._buttonBorderVs1.Left.Set(172f, 0.0f); this._buttonBorderVs1.Top.Set(8f, 0.0f); this._buttonBorderVs1.Color = Color.Silver; - this._buttonBorderVs1.IgnoresMouseInteraction = true; uiPanel.Append((UIElement) this._buttonBorderVs1); this._buttonBorderVs2 = new UIImageFramed(this._GameplayVsUIBorderTexture, this._GameplayVsUIBorderTexture.Frame()); this._buttonBorderVs2.VAlign = 0.0f; @@ -164,9 +158,8 @@ namespace Terraria.GameContent.UI.States this._buttonBorderVs2.Left.Set(212f, 0.0f); this._buttonBorderVs2.Top.Set(8f, 0.0f); this._buttonBorderVs2.Color = Color.Transparent; - this._buttonBorderVs2.IgnoresMouseInteraction = true; uiPanel.Append((UIElement) this._buttonBorderVs2); - this._buttonProfile = new UIKeybindingSimpleListItem((Func) (() => PlayerInput.CurrentProfile.ShowName), new Color(73, 94, 171, (int) byte.MaxValue) * 0.9f); + this._buttonProfile = new UIKeybindingSimpleListItem((Func) (() => PlayerInput.CurrentProfile.Name), new Color(73, 94, 171, (int) byte.MaxValue) * 0.9f); this._buttonProfile.VAlign = 0.0f; this._buttonProfile.HAlign = 1f; this._buttonProfile.Width.Set(180f, 0.0f); @@ -234,7 +227,6 @@ namespace Terraria.GameContent.UI.States "QuickBuff", "Throw", "Inventory", - "ToggleCreativeMenu", "ViewZoomIn", "ViewZoomOut", "sp9" @@ -547,7 +539,7 @@ namespace Terraria.GameContent.UI.States PlayerInput.CurrentProfile.HotbarRadialHoldTimeRequired = -1; }), (Action) (() => { - PlayerInput.CurrentProfile.HotbarRadialHoldTimeRequired = (int) ((double) UILinksInitializer.HandleSliderHorizontalInput(PlayerInput.CurrentProfile.HotbarRadialHoldTimeRequired == -1 ? 1f : (float) PlayerInput.CurrentProfile.HotbarRadialHoldTimeRequired / 301f, 0.0f, 1f, PlayerInput.CurrentProfile.InterfaceDeadzoneX) * 301.0); + PlayerInput.CurrentProfile.HotbarRadialHoldTimeRequired = (int) ((double) UILinksInitializer.HandleSlider(PlayerInput.CurrentProfile.HotbarRadialHoldTimeRequired == -1 ? 1f : (float) PlayerInput.CurrentProfile.HotbarRadialHoldTimeRequired / 301f, 0.0f, 1f, PlayerInput.CurrentProfile.InterfaceDeadzoneX) * 301.0); if ((double) PlayerInput.CurrentProfile.HotbarRadialHoldTimeRequired != 301.0) return; PlayerInput.CurrentProfile.HotbarRadialHoldTimeRequired = -1; @@ -557,35 +549,35 @@ namespace Terraria.GameContent.UI.States { int inventoryMoveCd = PlayerInput.CurrentProfile.InventoryMoveCD; return Lang.menu[252].Value + " (" + ((float) inventoryMoveCd / 60f).ToString("F2") + "s)"; - }), (Func) (() => Utils.GetLerpValue(4f, 12f, (float) PlayerInput.CurrentProfile.InventoryMoveCD, true)), (Action) (f => PlayerInput.CurrentProfile.InventoryMoveCD = (int) Math.Round((double) MathHelper.Lerp(4f, 12f, f))), (Action) (() => + }), (Func) (() => Utils.InverseLerp(4f, 12f, (float) PlayerInput.CurrentProfile.InventoryMoveCD, true)), (Action) (f => PlayerInput.CurrentProfile.InventoryMoveCD = (int) Math.Round((double) MathHelper.Lerp(4f, 12f, f))), (Action) (() => { if (UILinkPointNavigator.Shortcuts.INV_MOVE_OPTION_CD > 0) --UILinkPointNavigator.Shortcuts.INV_MOVE_OPTION_CD; if (UILinkPointNavigator.Shortcuts.INV_MOVE_OPTION_CD != 0) return; - float lerpValue = Utils.GetLerpValue(4f, 12f, (float) PlayerInput.CurrentProfile.InventoryMoveCD, true); - float num = UILinksInitializer.HandleSliderHorizontalInput(lerpValue, 0.0f, 1f, PlayerInput.CurrentProfile.InterfaceDeadzoneX); - if ((double) lerpValue == (double) num) + float currentValue = Utils.InverseLerp(4f, 12f, (float) PlayerInput.CurrentProfile.InventoryMoveCD, true); + float num = UILinksInitializer.HandleSlider(currentValue, 0.0f, 1f, PlayerInput.CurrentProfile.InterfaceDeadzoneX); + if ((double) currentValue == (double) num) return; UILinkPointNavigator.Shortcuts.INV_MOVE_OPTION_CD = 8; - PlayerInput.CurrentProfile.InventoryMoveCD = (int) MathHelper.Clamp((float) (PlayerInput.CurrentProfile.InventoryMoveCD + Math.Sign(num - lerpValue)), 4f, 12f); + PlayerInput.CurrentProfile.InventoryMoveCD = (int) MathHelper.Clamp((float) (PlayerInput.CurrentProfile.InventoryMoveCD + Math.Sign(num - currentValue)), 4f, 12f); }), 1008, color); case "sp2": UIKeybindingToggleListItem keybindingToggleListItem6 = new UIKeybindingToggleListItem((Func) (() => Lang.menu[197].Value), (Func) (() => PlayerInput.CurrentProfile.InputModes[InputMode.XBoxGamepad].KeyStatus["DpadRadial1"].Contains(Buttons.DPadUp.ToString()) && PlayerInput.CurrentProfile.InputModes[InputMode.XBoxGamepad].KeyStatus["DpadRadial2"].Contains(Buttons.DPadRight.ToString()) && PlayerInput.CurrentProfile.InputModes[InputMode.XBoxGamepad].KeyStatus["DpadRadial3"].Contains(Buttons.DPadDown.ToString()) && PlayerInput.CurrentProfile.InputModes[InputMode.XBoxGamepad].KeyStatus["DpadRadial4"].Contains(Buttons.DPadLeft.ToString()) && PlayerInput.CurrentProfile.InputModes[InputMode.XBoxGamepadUI].KeyStatus["DpadRadial1"].Contains(Buttons.DPadUp.ToString()) && PlayerInput.CurrentProfile.InputModes[InputMode.XBoxGamepadUI].KeyStatus["DpadRadial2"].Contains(Buttons.DPadRight.ToString()) && PlayerInput.CurrentProfile.InputModes[InputMode.XBoxGamepadUI].KeyStatus["DpadRadial3"].Contains(Buttons.DPadDown.ToString()) && PlayerInput.CurrentProfile.InputModes[InputMode.XBoxGamepadUI].KeyStatus["DpadRadial4"].Contains(Buttons.DPadLeft.ToString())), color); keybindingToggleListItem6.OnClick += new UIElement.MouseEvent(this.RadialButtonClick); return (UIElement) keybindingToggleListItem6; case "sp3": - return (UIElement) new UIKeybindingSliderItem((Func) (() => Lang.menu[199].Value + " (" + PlayerInput.CurrentProfile.TriggersDeadzone.ToString("P1") + ")"), (Func) (() => PlayerInput.CurrentProfile.TriggersDeadzone), (Action) (f => PlayerInput.CurrentProfile.TriggersDeadzone = f), (Action) (() => PlayerInput.CurrentProfile.TriggersDeadzone = UILinksInitializer.HandleSliderHorizontalInput(PlayerInput.CurrentProfile.TriggersDeadzone, 0.0f, 0.95f, PlayerInput.CurrentProfile.InterfaceDeadzoneX, 0.35f)), 1000, color); + return (UIElement) new UIKeybindingSliderItem((Func) (() => Lang.menu[199].Value + " (" + PlayerInput.CurrentProfile.TriggersDeadzone.ToString("P1") + ")"), (Func) (() => PlayerInput.CurrentProfile.TriggersDeadzone), (Action) (f => PlayerInput.CurrentProfile.TriggersDeadzone = f), (Action) (() => PlayerInput.CurrentProfile.TriggersDeadzone = UILinksInitializer.HandleSlider(PlayerInput.CurrentProfile.TriggersDeadzone, 0.0f, 0.95f, PlayerInput.CurrentProfile.InterfaceDeadzoneX, 0.35f)), 1000, color); case "sp4": - return (UIElement) new UIKeybindingSliderItem((Func) (() => Lang.menu[200].Value + " (" + PlayerInput.CurrentProfile.InterfaceDeadzoneX.ToString("P1") + ")"), (Func) (() => PlayerInput.CurrentProfile.InterfaceDeadzoneX), (Action) (f => PlayerInput.CurrentProfile.InterfaceDeadzoneX = f), (Action) (() => PlayerInput.CurrentProfile.InterfaceDeadzoneX = UILinksInitializer.HandleSliderHorizontalInput(PlayerInput.CurrentProfile.InterfaceDeadzoneX, 0.0f, 0.95f, 0.35f, 0.35f)), 1001, color); + return (UIElement) new UIKeybindingSliderItem((Func) (() => Lang.menu[200].Value + " (" + PlayerInput.CurrentProfile.InterfaceDeadzoneX.ToString("P1") + ")"), (Func) (() => PlayerInput.CurrentProfile.InterfaceDeadzoneX), (Action) (f => PlayerInput.CurrentProfile.InterfaceDeadzoneX = f), (Action) (() => PlayerInput.CurrentProfile.InterfaceDeadzoneX = UILinksInitializer.HandleSlider(PlayerInput.CurrentProfile.InterfaceDeadzoneX, 0.0f, 0.95f, 0.35f, 0.35f)), 1001, color); case "sp5": - return (UIElement) new UIKeybindingSliderItem((Func) (() => Lang.menu[201].Value + " (" + PlayerInput.CurrentProfile.LeftThumbstickDeadzoneX.ToString("P1") + ")"), (Func) (() => PlayerInput.CurrentProfile.LeftThumbstickDeadzoneX), (Action) (f => PlayerInput.CurrentProfile.LeftThumbstickDeadzoneX = f), (Action) (() => PlayerInput.CurrentProfile.LeftThumbstickDeadzoneX = UILinksInitializer.HandleSliderHorizontalInput(PlayerInput.CurrentProfile.LeftThumbstickDeadzoneX, 0.0f, 0.95f, PlayerInput.CurrentProfile.InterfaceDeadzoneX, 0.35f)), 1002, color); + return (UIElement) new UIKeybindingSliderItem((Func) (() => Lang.menu[201].Value + " (" + PlayerInput.CurrentProfile.LeftThumbstickDeadzoneX.ToString("P1") + ")"), (Func) (() => PlayerInput.CurrentProfile.LeftThumbstickDeadzoneX), (Action) (f => PlayerInput.CurrentProfile.LeftThumbstickDeadzoneX = f), (Action) (() => PlayerInput.CurrentProfile.LeftThumbstickDeadzoneX = UILinksInitializer.HandleSlider(PlayerInput.CurrentProfile.LeftThumbstickDeadzoneX, 0.0f, 0.95f, PlayerInput.CurrentProfile.InterfaceDeadzoneX, 0.35f)), 1002, color); case "sp6": - return (UIElement) new UIKeybindingSliderItem((Func) (() => Lang.menu[202].Value + " (" + PlayerInput.CurrentProfile.LeftThumbstickDeadzoneY.ToString("P1") + ")"), (Func) (() => PlayerInput.CurrentProfile.LeftThumbstickDeadzoneY), (Action) (f => PlayerInput.CurrentProfile.LeftThumbstickDeadzoneY = f), (Action) (() => PlayerInput.CurrentProfile.LeftThumbstickDeadzoneY = UILinksInitializer.HandleSliderHorizontalInput(PlayerInput.CurrentProfile.LeftThumbstickDeadzoneY, 0.0f, 0.95f, PlayerInput.CurrentProfile.InterfaceDeadzoneX, 0.35f)), 1003, color); + return (UIElement) new UIKeybindingSliderItem((Func) (() => Lang.menu[202].Value + " (" + PlayerInput.CurrentProfile.LeftThumbstickDeadzoneY.ToString("P1") + ")"), (Func) (() => PlayerInput.CurrentProfile.LeftThumbstickDeadzoneY), (Action) (f => PlayerInput.CurrentProfile.LeftThumbstickDeadzoneY = f), (Action) (() => PlayerInput.CurrentProfile.LeftThumbstickDeadzoneY = UILinksInitializer.HandleSlider(PlayerInput.CurrentProfile.LeftThumbstickDeadzoneY, 0.0f, 0.95f, PlayerInput.CurrentProfile.InterfaceDeadzoneX, 0.35f)), 1003, color); case "sp7": - return (UIElement) new UIKeybindingSliderItem((Func) (() => Lang.menu[203].Value + " (" + PlayerInput.CurrentProfile.RightThumbstickDeadzoneX.ToString("P1") + ")"), (Func) (() => PlayerInput.CurrentProfile.RightThumbstickDeadzoneX), (Action) (f => PlayerInput.CurrentProfile.RightThumbstickDeadzoneX = f), (Action) (() => PlayerInput.CurrentProfile.RightThumbstickDeadzoneX = UILinksInitializer.HandleSliderHorizontalInput(PlayerInput.CurrentProfile.RightThumbstickDeadzoneX, 0.0f, 0.95f, PlayerInput.CurrentProfile.InterfaceDeadzoneX, 0.35f)), 1004, color); + return (UIElement) new UIKeybindingSliderItem((Func) (() => Lang.menu[203].Value + " (" + PlayerInput.CurrentProfile.RightThumbstickDeadzoneX.ToString("P1") + ")"), (Func) (() => PlayerInput.CurrentProfile.RightThumbstickDeadzoneX), (Action) (f => PlayerInput.CurrentProfile.RightThumbstickDeadzoneX = f), (Action) (() => PlayerInput.CurrentProfile.RightThumbstickDeadzoneX = UILinksInitializer.HandleSlider(PlayerInput.CurrentProfile.RightThumbstickDeadzoneX, 0.0f, 0.95f, PlayerInput.CurrentProfile.InterfaceDeadzoneX, 0.35f)), 1004, color); case "sp8": - return (UIElement) new UIKeybindingSliderItem((Func) (() => Lang.menu[204].Value + " (" + PlayerInput.CurrentProfile.RightThumbstickDeadzoneY.ToString("P1") + ")"), (Func) (() => PlayerInput.CurrentProfile.RightThumbstickDeadzoneY), (Action) (f => PlayerInput.CurrentProfile.RightThumbstickDeadzoneY = f), (Action) (() => PlayerInput.CurrentProfile.RightThumbstickDeadzoneY = UILinksInitializer.HandleSliderHorizontalInput(PlayerInput.CurrentProfile.RightThumbstickDeadzoneY, 0.0f, 0.95f, PlayerInput.CurrentProfile.InterfaceDeadzoneX, 0.35f)), 1005, color); + return (UIElement) new UIKeybindingSliderItem((Func) (() => Lang.menu[204].Value + " (" + PlayerInput.CurrentProfile.RightThumbstickDeadzoneY.ToString("P1") + ")"), (Func) (() => PlayerInput.CurrentProfile.RightThumbstickDeadzoneY), (Action) (f => PlayerInput.CurrentProfile.RightThumbstickDeadzoneY = f), (Action) (() => PlayerInput.CurrentProfile.RightThumbstickDeadzoneY = UILinksInitializer.HandleSlider(PlayerInput.CurrentProfile.RightThumbstickDeadzoneY, 0.0f, 0.95f, PlayerInput.CurrentProfile.InterfaceDeadzoneX, 0.35f)), 1005, color); case "sp9": UIKeybindingSimpleListItem keybindingSimpleListItem5 = new UIKeybindingSimpleListItem((Func) (() => Lang.menu[86].Value), color); keybindingSimpleListItem5.OnClick += (UIElement.MouseEvent) ((evt, listeningElement) => @@ -640,7 +632,7 @@ namespace Terraria.GameContent.UI.States { if (!PlayerInput.CurrentProfile.AllowEditting) return; - SoundEngine.PlaySound(12); + Main.PlaySound(12); List keyStatu1 = PlayerInput.CurrentProfile.InputModes[InputMode.XBoxGamepad].KeyStatus["DpadSnap1"]; Buttons buttons = Buttons.DPadUp; string str1 = buttons.ToString(); @@ -752,7 +744,7 @@ namespace Terraria.GameContent.UI.States { if (!PlayerInput.CurrentProfile.AllowEditting) return; - SoundEngine.PlaySound(12); + Main.PlaySound(12); List keyStatu1 = PlayerInput.CurrentProfile.InputModes[InputMode.XBoxGamepad].KeyStatus["DpadRadial1"]; Buttons buttons = Buttons.DPadUp; string str1 = buttons.ToString(); @@ -952,16 +944,11 @@ namespace Terraria.GameContent.UI.States private void FadedMouseOver(UIMouseEvent evt, UIElement listeningElement) { - SoundEngine.PlaySound(12); + Main.PlaySound(12); ((UIPanel) evt.Target).BackgroundColor = new Color(73, 94, 171); - ((UIPanel) evt.Target).BorderColor = Colors.FancyUIFatButtonMouseOver; } - private void FadedMouseOut(UIMouseEvent evt, UIElement listeningElement) - { - ((UIPanel) evt.Target).BackgroundColor = new Color(63, 82, 151) * 0.7f; - ((UIPanel) evt.Target).BorderColor = Color.Black; - } + private void FadedMouseOut(UIMouseEvent evt, UIElement listeningElement) => ((UIPanel) evt.Target).BackgroundColor = new Color(63, 82, 151) * 0.7f; private void GoBackClick(UIMouseEvent evt, UIElement listeningElement) { @@ -1031,7 +1018,7 @@ namespace Terraria.GameContent.UI.States --index; } } - snapPoints.Sort((Comparison) ((x, y) => x.Id.CompareTo(y.Id))); + snapPoints.Sort((Comparison) ((x, y) => x.ID.CompareTo(y.ID))); for (int index = 0; index < snapPoints.Count; ++index) { int num3 = num1 + 6 + index; diff --git a/GameContent/UI/States/UIResourcePackInfoMenu.cs b/GameContent/UI/States/UIResourcePackInfoMenu.cs deleted file mode 100644 index bb1488a..0000000 --- a/GameContent/UI/States/UIResourcePackInfoMenu.cs +++ /dev/null @@ -1,209 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.States.UIResourcePackInfoMenu -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using System.Collections.Generic; -using Terraria.Audio; -using Terraria.GameContent.UI.Elements; -using Terraria.GameInput; -using Terraria.ID; -using Terraria.IO; -using Terraria.Localization; -using Terraria.UI; -using Terraria.UI.Gamepad; - -namespace Terraria.GameContent.UI.States -{ - public class UIResourcePackInfoMenu : UIState - { - private UIResourcePackSelectionMenu _resourceMenu; - private ResourcePack _pack; - private UIElement _container; - private UIList _list; - private UIScrollbar _scrollbar; - private bool _isScrollbarAttached; - private const string _backPointName = "GoBack"; - private UIGamepadHelper _helper; - - public UIResourcePackInfoMenu(UIResourcePackSelectionMenu parent, ResourcePack pack) - { - this._resourceMenu = parent; - this._pack = pack; - this.BuildPage(); - } - - private void BuildPage() - { - this.RemoveAllChildren(); - UIElement element1 = new UIElement(); - element1.Width.Set(0.0f, 0.8f); - element1.MaxWidth.Set(500f, 0.0f); - element1.MinWidth.Set(300f, 0.0f); - element1.Top.Set(230f, 0.0f); - element1.Height.Set(-element1.Top.Pixels, 1f); - element1.HAlign = 0.5f; - this.Append(element1); - UIPanel uiPanel = new UIPanel(); - uiPanel.Width.Set(0.0f, 1f); - uiPanel.Height.Set(-110f, 1f); - uiPanel.BackgroundColor = new Color(33, 43, 79) * 0.8f; - element1.Append((UIElement) uiPanel); - UIElement element2 = new UIElement() - { - Width = StyleDimension.Fill, - Height = StyleDimension.FromPixelsAndPercent(0.0f, 1f) - }; - uiPanel.Append(element2); - UIElement element3 = new UIElement() - { - Width = new StyleDimension(0.0f, 1f), - Height = new StyleDimension(52f, 0.0f) - }; - element3.SetPadding(0.0f); - element2.Append(element3); - UIText uiText1 = new UIText(this._pack.Name, 0.7f, true) - { - TextColor = Color.Gold - }; - uiText1.HAlign = 0.5f; - uiText1.VAlign = 0.0f; - element3.Append((UIElement) uiText1); - UIText uiText2 = new UIText(Language.GetTextValue("UI.Author", (object) this._pack.Author), 0.9f); - uiText2.HAlign = 0.0f; - uiText2.VAlign = 1f; - UIText uiText3 = uiText2; - uiText3.Top.Set(-6f, 0.0f); - element3.Append((UIElement) uiText3); - UIText uiText4 = new UIText(Language.GetTextValue("UI.Version", (object) this._pack.Version.GetFormattedVersion()), 0.9f); - uiText4.HAlign = 1f; - uiText4.VAlign = 1f; - uiText4.TextColor = Color.Silver; - UIText uiText5 = uiText4; - uiText5.Top.Set(-6f, 0.0f); - element3.Append((UIElement) uiText5); - Asset asset = Main.Assets.Request("Images/UI/Divider", (AssetRequestMode) 1); - UIImage uiImage1 = new UIImage(asset); - uiImage1.Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f); - uiImage1.Height = StyleDimension.FromPixels((float) asset.Height()); - uiImage1.ScaleToFit = true; - UIImage uiImage2 = uiImage1; - uiImage2.Top.Set(52f, 0.0f); - uiImage2.SetPadding(6f); - element2.Append((UIElement) uiImage2); - UIElement element4 = new UIElement() - { - HAlign = 0.5f, - VAlign = 1f, - Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f), - Height = StyleDimension.FromPixelsAndPercent(-74f, 1f) - }; - element2.Append(element4); - this._container = element4; - UIText uiText6 = new UIText(this._pack.Description); - uiText6.HAlign = 0.5f; - uiText6.VAlign = 0.0f; - uiText6.Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f); - uiText6.Height = StyleDimension.FromPixelsAndPercent(0.0f, 0.0f); - uiText6.IsWrapped = true; - uiText6.WrappedTextBottomPadding = 0.0f; - UIText uiText7 = uiText6; - UIList uiList1 = new UIList(); - uiList1.HAlign = 0.5f; - uiList1.VAlign = 0.0f; - uiList1.Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f); - uiList1.Height = StyleDimension.FromPixelsAndPercent(0.0f, 1f); - uiList1.PaddingRight = 20f; - UIList uiList2 = uiList1; - uiList2.ListPadding = 5f; - uiList2.Add((UIElement) uiText7); - element4.Append((UIElement) uiList2); - this._list = uiList2; - UIScrollbar scrollbar = new UIScrollbar(); - scrollbar.SetView(100f, 1000f); - scrollbar.Height.Set(0.0f, 1f); - scrollbar.HAlign = 1f; - this._scrollbar = scrollbar; - uiList2.SetScrollbar(scrollbar); - UITextPanel uiTextPanel = new UITextPanel(Language.GetText("UI.Back"), 0.7f, true); - uiTextPanel.Width.Set(-10f, 0.5f); - uiTextPanel.Height.Set(50f, 0.0f); - uiTextPanel.VAlign = 1f; - uiTextPanel.HAlign = 0.5f; - uiTextPanel.Top.Set(-45f, 0.0f); - uiTextPanel.OnMouseOver += new UIElement.MouseEvent(UIResourcePackInfoMenu.FadedMouseOver); - uiTextPanel.OnMouseOut += new UIElement.MouseEvent(UIResourcePackInfoMenu.FadedMouseOut); - uiTextPanel.OnClick += new UIElement.MouseEvent(this.GoBackClick); - uiTextPanel.SetSnapPoint("GoBack", 0); - element1.Append((UIElement) uiTextPanel); - } - - public override void Recalculate() - { - if (this._scrollbar != null) - { - if (this._isScrollbarAttached && !this._scrollbar.CanScroll) - { - this._container.RemoveChild((UIElement) this._scrollbar); - this._isScrollbarAttached = false; - this._list.Width.Set(0.0f, 1f); - } - else if (!this._isScrollbarAttached && this._scrollbar.CanScroll) - { - this._container.Append((UIElement) this._scrollbar); - this._isScrollbarAttached = true; - this._list.Width.Set(-25f, 1f); - } - } - base.Recalculate(); - } - - private void GoBackClick(UIMouseEvent evt, UIElement listeningElement) => Main.MenuUI.SetState((UIState) this._resourceMenu); - - private static void FadedMouseOver(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(12); - ((UIPanel) evt.Target).BackgroundColor = new Color(73, 94, 171); - ((UIPanel) evt.Target).BorderColor = Colors.FancyUIFatButtonMouseOver; - } - - private static void FadedMouseOut(UIMouseEvent evt, UIElement listeningElement) - { - ((UIPanel) evt.Target).BackgroundColor = new Color(63, 82, 151) * 0.8f; - ((UIPanel) evt.Target).BorderColor = Color.Black; - } - - public override void Draw(SpriteBatch spriteBatch) - { - base.Draw(spriteBatch); - this.SetupGamepadPoints(spriteBatch); - } - - private void SetupGamepadPoints(SpriteBatch spriteBatch) - { - UILinkPointNavigator.Shortcuts.BackButtonCommand = 1; - int idRangeStartInclusive = 3000; - int idRangeEndExclusive = idRangeStartInclusive; - List snapPoints = this.GetSnapPoints(); - UILinkPoint uiLinkPoint = (UILinkPoint) null; - for (int index = 0; index < snapPoints.Count; ++index) - { - SnapPoint snap = snapPoints[index]; - if (snap.Name == "GoBack") - uiLinkPoint = this._helper.MakeLinkPointFromSnapPoint(idRangeEndExclusive++, snap); - } - if (PlayerInput.UsingGamepadUI) - this._helper.MoveToVisuallyClosestPoint(idRangeStartInclusive, idRangeEndExclusive); - if (!Main.CreativeMenu.GamepadMoveToSearchButtonHack) - return; - Main.CreativeMenu.GamepadMoveToSearchButtonHack = false; - if (uiLinkPoint == null) - return; - UILinkPointNavigator.ChangePoint(uiLinkPoint.ID); - } - } -} diff --git a/GameContent/UI/States/UIResourcePackSelectionMenu.cs b/GameContent/UI/States/UIResourcePackSelectionMenu.cs deleted file mode 100644 index 337dfb3..0000000 --- a/GameContent/UI/States/UIResourcePackSelectionMenu.cs +++ /dev/null @@ -1,516 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.States.UIResourcePackSelectionMenu -// 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; -using Microsoft.Xna.Framework.Graphics; -using Newtonsoft.Json.Linq; -using ReLogic.Content; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria.Audio; -using Terraria.GameContent.UI.Elements; -using Terraria.GameInput; -using Terraria.ID; -using Terraria.Initializers; -using Terraria.IO; -using Terraria.Localization; -using Terraria.UI; -using Terraria.UI.Gamepad; - -namespace Terraria.GameContent.UI.States -{ - public class UIResourcePackSelectionMenu : UIState - { - private readonly AssetSourceController _sourceController; - private UIList _availablePacksList; - private UIList _enabledPacksList; - private ResourcePackList _packsList; - private UIText _titleAvailable; - private UIText _titleEnabled; - private const string _snapCategory_ToggleFromOffToOn = "ToggleToOn"; - private const string _snapCategory_ToggleFromOnToOff = "ToggleToOff"; - private const string _snapCategory_InfoWhenOff = "InfoOff"; - private const string _snapCategory_InfoWhenOn = "InfoOn"; - private const string _snapCategory_OffsetOrderUp = "OrderUp"; - private const string _snapCategory_OffsetOrderDown = "OrderDown"; - private const string _snapPointName_goBack = "GoBack"; - private const string _snapPointName_openFolder = "OpenFolder"; - private UIGamepadHelper _helper; - - public UIResourcePackSelectionMenu( - AssetSourceController sourceController, - ResourcePackList currentResourcePackList) - { - this._sourceController = sourceController; - this.BuildPage(); - this._packsList = currentResourcePackList; - this.PopulatePackList(); - } - - private void PopulatePackList() - { - this._availablePacksList.Clear(); - this._enabledPacksList.Clear(); - this.CleanUpResourcePackPriority(); - IEnumerable enabledPacks = this._packsList.EnabledPacks; - IEnumerable disabledPacks = this._packsList.DisabledPacks; - int num1 = 0; - foreach (ResourcePack resourcePack in disabledPacks) - { - UIResourcePack uiResourcePack1 = new UIResourcePack(resourcePack, num1); - uiResourcePack1.Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f); - UIResourcePack uiResourcePack2 = uiResourcePack1; - UIElement packToggleButton = this.CreatePackToggleButton(resourcePack); - packToggleButton.OnUpdate += new UIElement.ElementEvent(this.EnablePackUpdate); - packToggleButton.SetSnapPoint("ToggleToOn", num1); - uiResourcePack2.ContentPanel.Append(packToggleButton); - UIElement packInfoButton = this.CreatePackInfoButton(resourcePack); - packInfoButton.OnUpdate += new UIElement.ElementEvent(this.SeeInfoUpdate); - packInfoButton.SetSnapPoint("InfoOff", num1); - uiResourcePack2.ContentPanel.Append(packInfoButton); - this._availablePacksList.Add((UIElement) uiResourcePack2); - ++num1; - } - int num2 = 0; - foreach (ResourcePack resourcePack in enabledPacks) - { - UIResourcePack uiResourcePack3 = new UIResourcePack(resourcePack, num2); - uiResourcePack3.Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f); - UIResourcePack uiResourcePack4 = uiResourcePack3; - if (resourcePack.IsEnabled) - { - UIElement packToggleButton = this.CreatePackToggleButton(resourcePack); - packToggleButton.Left = new StyleDimension(0.0f, 0.0f); - packToggleButton.Width = new StyleDimension(0.0f, 0.5f); - packToggleButton.OnUpdate += new UIElement.ElementEvent(this.DisablePackUpdate); - packToggleButton.SetSnapPoint("ToggleToOff", num2); - uiResourcePack4.ContentPanel.Append(packToggleButton); - UIElement packInfoButton = this.CreatePackInfoButton(resourcePack); - packInfoButton.OnUpdate += new UIElement.ElementEvent(this.SeeInfoUpdate); - packInfoButton.Left = new StyleDimension(0.0f, 0.5f); - packInfoButton.Width = new StyleDimension(0.0f, 0.1666667f); - packInfoButton.SetSnapPoint("InfoOn", num2); - uiResourcePack4.ContentPanel.Append(packInfoButton); - UIElement offsetButton1 = this.CreateOffsetButton(resourcePack, -1); - offsetButton1.Left = new StyleDimension(0.0f, 0.6666667f); - offsetButton1.Width = new StyleDimension(0.0f, 0.1666667f); - offsetButton1.SetSnapPoint("OrderUp", num2); - uiResourcePack4.ContentPanel.Append(offsetButton1); - UIElement offsetButton2 = this.CreateOffsetButton(resourcePack, 1); - offsetButton2.Left = new StyleDimension(0.0f, 0.8333334f); - offsetButton2.Width = new StyleDimension(0.0f, 0.1666667f); - offsetButton2.SetSnapPoint("OrderDown", num2); - uiResourcePack4.ContentPanel.Append(offsetButton2); - } - this._enabledPacksList.Add((UIElement) uiResourcePack4); - ++num2; - } - this.UpdateTitles(); - } - - private UIElement CreateOffsetButton(ResourcePack resourcePack, int offset) - { - GroupOptionButton groupOptionButton1 = new GroupOptionButton(true, (LocalizedText) null, (LocalizedText) null, Color.White, (string) null, 0.8f); - groupOptionButton1.Left = StyleDimension.FromPercent(0.5f); - groupOptionButton1.Width = StyleDimension.FromPixelsAndPercent(0.0f, 0.5f); - groupOptionButton1.Height = StyleDimension.Fill; - GroupOptionButton groupOptionButton2 = groupOptionButton1; - int num = (offset != -1 ? 0 : (resourcePack.SortingOrder == 0 ? 1 : 0)) | (offset != 1 ? 0 : (resourcePack.SortingOrder == this._packsList.EnabledPacks.Count() - 1 ? 1 : 0)); - Color lightCyan = Color.LightCyan; - groupOptionButton2.SetColorsBasedOnSelectionState(lightCyan, lightCyan, 0.7f, 0.7f); - groupOptionButton2.ShowHighlightWhenSelected = false; - groupOptionButton2.SetPadding(0.0f); - Asset asset = Main.Assets.Request("Images/UI/TexturePackButtons", (AssetRequestMode) 1); - UIImageFramed uiImageFramed1 = new UIImageFramed(asset, asset.Frame(2, 2, offset == 1 ? 1 : 0)); - uiImageFramed1.HAlign = 0.5f; - uiImageFramed1.VAlign = 0.5f; - uiImageFramed1.IgnoresMouseInteraction = true; - UIImageFramed uiImageFramed2 = uiImageFramed1; - groupOptionButton2.Append((UIElement) uiImageFramed2); - groupOptionButton2.OnMouseOver += (UIElement.MouseEvent) ((evt, listeningElement) => SoundEngine.PlaySound(12)); - int offsetLocalForLambda = offset; - if (num != 0) - groupOptionButton2.OnClick += (UIElement.MouseEvent) ((evt, listeningElement) => SoundEngine.PlaySound(12)); - else - groupOptionButton2.OnClick += (UIElement.MouseEvent) ((evt, listeningElement) => - { - SoundEngine.PlaySound(12); - this.OffsetResourcePackPriority(resourcePack, offsetLocalForLambda); - this.PopulatePackList(); - Main.instance.TilePaintSystem.Reset(); - }); - if (offset == 1) - groupOptionButton2.OnUpdate += new UIElement.ElementEvent(this.OffsetFrontwardUpdate); - else - groupOptionButton2.OnUpdate += new UIElement.ElementEvent(this.OffsetBackwardUpdate); - return (UIElement) groupOptionButton2; - } - - private UIElement CreatePackToggleButton(ResourcePack resourcePack) - { - Language.GetText(resourcePack.IsEnabled ? "GameUI.Enabled" : "GameUI.Disabled"); - GroupOptionButton groupOptionButton = new GroupOptionButton(true, (LocalizedText) null, (LocalizedText) null, Color.White, (string) null, 0.8f); - groupOptionButton.Left = StyleDimension.FromPercent(0.5f); - groupOptionButton.Width = StyleDimension.FromPixelsAndPercent(0.0f, 0.5f); - groupOptionButton.Height = StyleDimension.Fill; - groupOptionButton.SetColorsBasedOnSelectionState(Color.LightGreen, Color.PaleVioletRed, 0.7f, 0.7f); - groupOptionButton.SetCurrentOption(resourcePack.IsEnabled); - groupOptionButton.ShowHighlightWhenSelected = false; - groupOptionButton.SetPadding(0.0f); - Asset asset = Main.Assets.Request("Images/UI/TexturePackButtons", (AssetRequestMode) 1); - UIImageFramed uiImageFramed = new UIImageFramed(asset, asset.Frame(2, 2, resourcePack.IsEnabled ? 0 : 1, 1)); - uiImageFramed.HAlign = 0.5f; - uiImageFramed.VAlign = 0.5f; - uiImageFramed.IgnoresMouseInteraction = true; - groupOptionButton.Append((UIElement) uiImageFramed); - groupOptionButton.OnMouseOver += (UIElement.MouseEvent) ((evt, listeningElement) => SoundEngine.PlaySound(12)); - groupOptionButton.OnClick += (UIElement.MouseEvent) ((evt, listeningElement) => - { - SoundEngine.PlaySound(12); - resourcePack.IsEnabled = !resourcePack.IsEnabled; - this.SetResourcePackAsTopPriority(resourcePack); - this.PopulatePackList(); - Main.instance.TilePaintSystem.Reset(); - }); - return (UIElement) groupOptionButton; - } - - private void SetResourcePackAsTopPriority(ResourcePack resourcePack) - { - if (!resourcePack.IsEnabled) - return; - int num = -1; - foreach (ResourcePack enabledPack in this._packsList.EnabledPacks) - { - if (num < enabledPack.SortingOrder && enabledPack != resourcePack) - num = enabledPack.SortingOrder; - } - resourcePack.SortingOrder = num + 1; - } - - private void OffsetResourcePackPriority(ResourcePack resourcePack, int offset) - { - if (!resourcePack.IsEnabled) - return; - List list = this._packsList.EnabledPacks.ToList(); - int index1 = list.IndexOf(resourcePack); - int index2 = Utils.Clamp(index1 + offset, 0, list.Count - 1); - if (index2 == index1) - return; - int sortingOrder = list[index1].SortingOrder; - list[index1].SortingOrder = list[index2].SortingOrder; - list[index2].SortingOrder = sortingOrder; - } - - private UIElement CreatePackInfoButton(ResourcePack resourcePack) - { - UIResourcePackInfoButton resourcePackInfoButton = new UIResourcePackInfoButton("", 0.8f); - resourcePackInfoButton.Width = StyleDimension.FromPixelsAndPercent(0.0f, 0.5f); - resourcePackInfoButton.Height = StyleDimension.Fill; - resourcePackInfoButton.ResourcePack = resourcePack; - resourcePackInfoButton.SetPadding(0.0f); - UIImage uiImage = new UIImage(Main.Assets.Request("Images/UI/CharCreation/CharInfo", (AssetRequestMode) 1)); - uiImage.HAlign = 0.5f; - uiImage.VAlign = 0.5f; - uiImage.IgnoresMouseInteraction = true; - resourcePackInfoButton.Append((UIElement) uiImage); - resourcePackInfoButton.OnMouseOver += (UIElement.MouseEvent) ((evt, listeningElement) => SoundEngine.PlaySound(12)); - resourcePackInfoButton.OnClick += new UIElement.MouseEvent(this.Click_Info); - return (UIElement) resourcePackInfoButton; - } - - private void Click_Info(UIMouseEvent evt, UIElement listeningElement) - { - if (!(listeningElement is UIResourcePackInfoButton resourcePackInfoButton)) - return; - SoundEngine.PlaySound(10); - Main.MenuUI.SetState((UIState) new UIResourcePackInfoMenu(this, resourcePackInfoButton.ResourcePack)); - } - - private void ApplyListChanges() => this._sourceController.UseResourcePacks(new ResourcePackList(this._enabledPacksList.Select((Func) (uiPack => ((UIResourcePack) uiPack).ResourcePack)))); - - private void CleanUpResourcePackPriority() - { - IOrderedEnumerable orderedEnumerable = this._packsList.EnabledPacks.OrderBy((Func) (pack => pack.SortingOrder)); - int num = 0; - foreach (ResourcePack resourcePack in (IEnumerable) orderedEnumerable) - resourcePack.SortingOrder = num++; - } - - private void BuildPage() - { - this.RemoveAllChildren(); - UIElement uiElement = new UIElement(); - uiElement.Width.Set(0.0f, 0.8f); - uiElement.MaxWidth.Set(800f, 0.0f); - uiElement.MinWidth.Set(600f, 0.0f); - uiElement.Top.Set(240f, 0.0f); - uiElement.Height.Set(-240f, 1f); - uiElement.HAlign = 0.5f; - this.Append(uiElement); - UIPanel uiPanel1 = new UIPanel(); - uiPanel1.Width = StyleDimension.Fill; - uiPanel1.Height = new StyleDimension(-110f, 1f); - uiPanel1.BackgroundColor = new Color(33, 43, 79) * 0.8f; - uiPanel1.PaddingRight = 0.0f; - uiPanel1.PaddingLeft = 0.0f; - UIPanel uiPanel2 = uiPanel1; - uiElement.Append((UIElement) uiPanel2); - int num1 = 35; - int num2 = num1; - int num3 = 30; - UIElement element1 = new UIElement() - { - Width = StyleDimension.Fill, - Height = StyleDimension.FromPixelsAndPercent((float) -(num3 + 4 + 5), 1f), - VAlign = 1f - }; - element1.SetPadding(0.0f); - uiPanel2.Append(element1); - UIElement element2 = new UIElement() - { - Width = new StyleDimension(-20f, 0.5f), - Height = new StyleDimension(0.0f, 1f), - Left = new StyleDimension(10f, 0.0f) - }; - element2.SetPadding(0.0f); - element1.Append(element2); - UIElement element3 = new UIElement() - { - Width = new StyleDimension(-20f, 0.5f), - Height = new StyleDimension(0.0f, 1f), - Left = new StyleDimension(-10f, 0.0f), - HAlign = 1f - }; - element3.SetPadding(0.0f); - element1.Append(element3); - UIList uiList1 = new UIList(); - uiList1.Width = new StyleDimension(-25f, 1f); - uiList1.Height = new StyleDimension(0.0f, 1f); - uiList1.ListPadding = 5f; - uiList1.HAlign = 1f; - UIList uiList2 = uiList1; - element2.Append((UIElement) uiList2); - this._availablePacksList = uiList2; - UIList uiList3 = new UIList(); - uiList3.Width = new StyleDimension(-25f, 1f); - uiList3.Height = new StyleDimension(0.0f, 1f); - uiList3.ListPadding = 5f; - uiList3.HAlign = 0.0f; - uiList3.Left = new StyleDimension(0.0f, 0.0f); - UIList uiList4 = uiList3; - element3.Append((UIElement) uiList4); - this._enabledPacksList = uiList4; - UIText uiText1 = new UIText(Language.GetText("UI.AvailableResourcePacksTitle")); - uiText1.HAlign = 0.0f; - uiText1.Left = new StyleDimension(25f, 0.0f); - uiText1.Width = new StyleDimension(-25f, 0.5f); - uiText1.VAlign = 0.0f; - uiText1.Top = new StyleDimension(10f, 0.0f); - UIText uiText2 = uiText1; - this._titleAvailable = uiText2; - uiPanel2.Append((UIElement) uiText2); - UIText uiText3 = new UIText(Language.GetText("UI.EnabledResourcePacksTitle")); - uiText3.HAlign = 1f; - uiText3.Left = new StyleDimension(-25f, 0.0f); - uiText3.Width = new StyleDimension(-25f, 0.5f); - uiText3.VAlign = 0.0f; - uiText3.Top = new StyleDimension(10f, 0.0f); - UIText uiText4 = uiText3; - this._titleEnabled = uiText4; - uiPanel2.Append((UIElement) uiText4); - UITextPanel uiTextPanel1 = new UITextPanel(Language.GetText("UI.ResourcePacks"), large: true); - uiTextPanel1.HAlign = 0.5f; - uiTextPanel1.VAlign = 0.0f; - uiTextPanel1.Top = new StyleDimension(-44f, 0.0f); - uiTextPanel1.BackgroundColor = new Color(73, 94, 171); - UITextPanel uiTextPanel2 = uiTextPanel1; - uiTextPanel2.SetPadding(13f); - uiElement.Append((UIElement) uiTextPanel2); - UIScrollbar uiScrollbar1 = new UIScrollbar(); - uiScrollbar1.Height = new StyleDimension(0.0f, 1f); - uiScrollbar1.HAlign = 0.0f; - uiScrollbar1.Left = new StyleDimension(0.0f, 0.0f); - UIScrollbar scrollbar1 = uiScrollbar1; - element2.Append((UIElement) scrollbar1); - this._availablePacksList.SetScrollbar(scrollbar1); - UIVerticalSeparator verticalSeparator1 = new UIVerticalSeparator(); - verticalSeparator1.Height = new StyleDimension(-12f, 1f); - verticalSeparator1.HAlign = 0.5f; - verticalSeparator1.VAlign = 1f; - verticalSeparator1.Color = new Color(89, 116, 213, (int) byte.MaxValue) * 0.9f; - UIVerticalSeparator verticalSeparator2 = verticalSeparator1; - uiPanel2.Append((UIElement) verticalSeparator2); - UIHorizontalSeparator horizontalSeparator1 = new UIHorizontalSeparator(); - horizontalSeparator1.Width = new StyleDimension((float) -num2, 0.5f); - horizontalSeparator1.VAlign = 0.0f; - horizontalSeparator1.HAlign = 0.0f; - horizontalSeparator1.Color = new Color(89, 116, 213, (int) byte.MaxValue) * 0.9f; - horizontalSeparator1.Top = new StyleDimension((float) num3, 0.0f); - horizontalSeparator1.Left = new StyleDimension((float) num1, 0.0f); - UIHorizontalSeparator horizontalSeparator2 = new UIHorizontalSeparator(); - horizontalSeparator2.Width = new StyleDimension((float) -num2, 0.5f); - horizontalSeparator2.VAlign = 0.0f; - horizontalSeparator2.HAlign = 1f; - horizontalSeparator2.Color = new Color(89, 116, 213, (int) byte.MaxValue) * 0.9f; - horizontalSeparator2.Top = new StyleDimension((float) num3, 0.0f); - horizontalSeparator2.Left = new StyleDimension((float) -num1, 0.0f); - UIScrollbar uiScrollbar2 = new UIScrollbar(); - uiScrollbar2.Height = new StyleDimension(0.0f, 1f); - uiScrollbar2.HAlign = 1f; - UIScrollbar scrollbar2 = uiScrollbar2; - element3.Append((UIElement) scrollbar2); - this._enabledPacksList.SetScrollbar(scrollbar2); - this.AddBackAndFolderButtons(uiElement); - } - - private void UpdateTitles() - { - this._titleAvailable.SetText(Language.GetText("UI.AvailableResourcePacksTitle").FormatWith((object) new - { - Amount = this._availablePacksList.Count - })); - this._titleEnabled.SetText(Language.GetText("UI.EnabledResourcePacksTitle").FormatWith((object) new - { - Amount = this._enabledPacksList.Count - })); - } - - private void AddBackAndFolderButtons(UIElement outerContainer) - { - UITextPanel uiTextPanel1 = new UITextPanel(Language.GetText("UI.Back"), 0.7f, true); - uiTextPanel1.Width = new StyleDimension(-8f, 0.5f); - uiTextPanel1.Height = new StyleDimension(50f, 0.0f); - uiTextPanel1.VAlign = 1f; - uiTextPanel1.HAlign = 0.0f; - uiTextPanel1.Top = new StyleDimension(-45f, 0.0f); - UITextPanel uiTextPanel2 = uiTextPanel1; - uiTextPanel2.OnMouseOver += new UIElement.MouseEvent(UIResourcePackSelectionMenu.FadedMouseOver); - uiTextPanel2.OnMouseOut += new UIElement.MouseEvent(UIResourcePackSelectionMenu.FadedMouseOut); - uiTextPanel2.OnClick += new UIElement.MouseEvent(this.GoBackClick); - uiTextPanel2.SetSnapPoint("GoBack", 0); - outerContainer.Append((UIElement) uiTextPanel2); - UITextPanel uiTextPanel3 = new UITextPanel(Language.GetText("GameUI.OpenFileFolder"), 0.7f, true); - uiTextPanel3.Width = new StyleDimension(-8f, 0.5f); - uiTextPanel3.Height = new StyleDimension(50f, 0.0f); - uiTextPanel3.VAlign = 1f; - uiTextPanel3.HAlign = 1f; - uiTextPanel3.Top = new StyleDimension(-45f, 0.0f); - UITextPanel uiTextPanel4 = uiTextPanel3; - uiTextPanel4.OnMouseOver += new UIElement.MouseEvent(UIResourcePackSelectionMenu.FadedMouseOver); - uiTextPanel4.OnMouseOut += new UIElement.MouseEvent(UIResourcePackSelectionMenu.FadedMouseOut); - uiTextPanel4.OnClick += new UIElement.MouseEvent(this.OpenFoldersClick); - uiTextPanel4.SetSnapPoint("OpenFolder", 0); - outerContainer.Append((UIElement) uiTextPanel4); - } - - private void OpenFoldersClick(UIMouseEvent evt, UIElement listeningElement) - { - string resourcePackFolder; - AssetInitializer.GetResourcePacksFolderPathAndConfirmItExists(out JArray _, out resourcePackFolder); - SoundEngine.PlaySound(12); - Utils.OpenFolder(resourcePackFolder); - } - - private void GoBackClick(UIMouseEvent evt, UIElement listeningElement) - { - this.ApplyListChanges(); - Main.SaveSettings(); - Main.menuMode = 0; - IngameFancyUI.Close(); - } - - private static void FadedMouseOver(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(12); - ((UIPanel) evt.Target).BackgroundColor = new Color(73, 94, 171); - ((UIPanel) evt.Target).BorderColor = Colors.FancyUIFatButtonMouseOver; - } - - private static void FadedMouseOut(UIMouseEvent evt, UIElement listeningElement) - { - ((UIPanel) evt.Target).BackgroundColor = new Color(63, 82, 151) * 0.8f; - ((UIPanel) evt.Target).BorderColor = Color.Black; - } - - private void OffsetBackwardUpdate(UIElement affectedElement) => UIResourcePackSelectionMenu.DisplayMouseTextIfHovered(affectedElement, "UI.OffsetTexturePackPriorityDown"); - - private void OffsetFrontwardUpdate(UIElement affectedElement) => UIResourcePackSelectionMenu.DisplayMouseTextIfHovered(affectedElement, "UI.OffsetTexturePackPriorityUp"); - - private void EnablePackUpdate(UIElement affectedElement) => UIResourcePackSelectionMenu.DisplayMouseTextIfHovered(affectedElement, "UI.EnableTexturePack"); - - private void DisablePackUpdate(UIElement affectedElement) => UIResourcePackSelectionMenu.DisplayMouseTextIfHovered(affectedElement, "UI.DisableTexturePack"); - - private void SeeInfoUpdate(UIElement affectedElement) => UIResourcePackSelectionMenu.DisplayMouseTextIfHovered(affectedElement, "UI.SeeTexturePackInfo"); - - private static void DisplayMouseTextIfHovered(UIElement affectedElement, string textKey) - { - if (!affectedElement.IsMouseHovering) - return; - string textValue = Language.GetTextValue(textKey); - Main.instance.MouseText(textValue); - } - - public override void Draw(SpriteBatch spriteBatch) - { - base.Draw(spriteBatch); - this.SetupGamepadPoints(spriteBatch); - } - - private void SetupGamepadPoints(SpriteBatch spriteBatch) - { - UILinkPointNavigator.Shortcuts.BackButtonCommand = 1; - int idRangeStartInclusive = 3000; - int currentID = idRangeStartInclusive; - List snapPoints1 = this.GetSnapPoints(); - List snapPoints2 = this._availablePacksList.GetSnapPoints(); - this._helper.CullPointsOutOfElementArea(spriteBatch, snapPoints2, (UIElement) this._availablePacksList); - List snapPoints3 = this._enabledPacksList.GetSnapPoints(); - this._helper.CullPointsOutOfElementArea(spriteBatch, snapPoints3, (UIElement) this._enabledPacksList); - UILinkPoint[] fromCategoryName1 = this._helper.GetVerticalStripFromCategoryName(ref currentID, snapPoints2, "ToggleToOn"); - UILinkPoint[] fromCategoryName2 = this._helper.GetVerticalStripFromCategoryName(ref currentID, snapPoints2, "InfoOff"); - UILinkPoint[] fromCategoryName3 = this._helper.GetVerticalStripFromCategoryName(ref currentID, snapPoints3, "ToggleToOff"); - UILinkPoint[] fromCategoryName4 = this._helper.GetVerticalStripFromCategoryName(ref currentID, snapPoints3, "InfoOn"); - UILinkPoint[] fromCategoryName5 = this._helper.GetVerticalStripFromCategoryName(ref currentID, snapPoints3, "OrderUp"); - UILinkPoint[] fromCategoryName6 = this._helper.GetVerticalStripFromCategoryName(ref currentID, snapPoints3, "OrderDown"); - UILinkPoint uiLinkPoint1 = (UILinkPoint) null; - UILinkPoint uiLinkPoint2 = (UILinkPoint) null; - for (int index = 0; index < snapPoints1.Count; ++index) - { - SnapPoint snap = snapPoints1[index]; - string name = snap.Name; - if (!(name == "GoBack")) - { - if (name == "OpenFolder") - uiLinkPoint2 = this._helper.MakeLinkPointFromSnapPoint(currentID++, snap); - } - else - uiLinkPoint1 = this._helper.MakeLinkPointFromSnapPoint(currentID++, snap); - } - this._helper.LinkVerticalStrips(fromCategoryName2, fromCategoryName1, 0); - this._helper.LinkVerticalStrips(fromCategoryName1, fromCategoryName3, 0); - this._helper.LinkVerticalStrips(fromCategoryName3, fromCategoryName4, 0); - this._helper.LinkVerticalStrips(fromCategoryName4, fromCategoryName5, 0); - this._helper.LinkVerticalStrips(fromCategoryName5, fromCategoryName6, 0); - this._helper.LinkVerticalStripBottomSideToSingle(fromCategoryName1, uiLinkPoint1); - this._helper.LinkVerticalStripBottomSideToSingle(fromCategoryName2, uiLinkPoint1); - this._helper.LinkVerticalStripBottomSideToSingle(fromCategoryName5, uiLinkPoint2); - this._helper.LinkVerticalStripBottomSideToSingle(fromCategoryName6, uiLinkPoint2); - this._helper.LinkVerticalStripBottomSideToSingle(fromCategoryName3, uiLinkPoint2); - this._helper.LinkVerticalStripBottomSideToSingle(fromCategoryName4, uiLinkPoint2); - this._helper.PairLeftRight(uiLinkPoint1, uiLinkPoint2); - if (PlayerInput.UsingGamepadUI) - this._helper.MoveToVisuallyClosestPoint(idRangeStartInclusive, currentID); - if (!Main.CreativeMenu.GamepadMoveToSearchButtonHack) - return; - Main.CreativeMenu.GamepadMoveToSearchButtonHack = false; - if (uiLinkPoint1 == null) - return; - UILinkPointNavigator.ChangePoint(uiLinkPoint1.ID); - } - } -} diff --git a/GameContent/UI/States/UISortableElement.cs b/GameContent/UI/States/UISortableElement.cs index a05d005..1d16a7a 100644 --- a/GameContent/UI/States/UISortableElement.cs +++ b/GameContent/UI/States/UISortableElement.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.States.UISortableElement -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Terraria.UI; diff --git a/GameContent/UI/States/UIVirtualKeyboard.cs b/GameContent/UI/States/UIVirtualKeyboard.cs index 5f0129c..4dc02ad 100644 --- a/GameContent/UI/States/UIVirtualKeyboard.cs +++ b/GameContent/UI/States/UIVirtualKeyboard.cs @@ -1,17 +1,15 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.States.UIVirtualKeyboard -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using System; -using Terraria.Audio; using Terraria.GameContent.UI.Elements; using Terraria.GameInput; -using Terraria.ID; +using Terraria.Graphics; using Terraria.Localization; using Terraria.UI; using Terraria.UI.Gamepad; @@ -39,8 +37,8 @@ namespace Terraria.GameContent.UI.States private UITextPanel _enterButton; private UITextPanel _spacebarButton; private UITextPanel _restoreButton; - private Asset _textureShift; - private Asset _textureBackspace; + private Texture2D _textureShift; + private Texture2D _textureBackspace; private Color _internalBorderColor = new Color(89, 116, 213); private Color _internalBorderColorSelected = Main.OurFavoriteColor; private UITextPanel _submitButton2; @@ -52,8 +50,7 @@ namespace Terraria.GameContent.UI.States private UIVirtualKeyboard.KeyboardSubmitEvent _submitAction; private Action _cancelAction; private int _lastOffsetDown; - public static int OffsetDown; - public static bool ShouldHideText; + public static int OffsetDown = 0; private int _keyboardContext; private bool _edittingSign; private bool _edittingChest; @@ -82,32 +79,31 @@ namespace Terraria.GameContent.UI.States this._keyboardContext = inputMode; this._allowEmpty = allowEmpty; UIVirtualKeyboard.OffsetDown = 0; - UIVirtualKeyboard.ShouldHideText = false; this._lastOffsetDown = 0; this._edittingSign = this._keyboardContext == 1; this._edittingChest = this._keyboardContext == 2; UIVirtualKeyboard._currentInstance = this; this._submitAction = submitAction; this._cancelAction = cancelAction; - this._textureShift = Main.Assets.Request("Images/UI/VK_Shift", (AssetRequestMode) 1); - this._textureBackspace = Main.Assets.Request("Images/UI/VK_Backspace", (AssetRequestMode) 1); + this._textureShift = TextureManager.Load("Images/UI/VK_Shift"); + this._textureBackspace = TextureManager.Load("Images/UI/VK_Backspace"); this.Top.Pixels = (float) this._lastOffsetDown; float num1 = (float) (-5000 * this._edittingSign.ToInt()); - float num2 = 270f; - float num3 = 0.0f; - float num4 = 516f; + float maxValue = (float) byte.MaxValue; + float num2 = 0.0f; + float num3 = 516f; UIElement element = new UIElement(); - element.Width.Pixels = (float) ((double) num4 + 8.0 + 16.0); - element.Top.Precent = num3; - element.Top.Pixels = num2; + element.Width.Pixels = (float) ((double) num3 + 8.0 + 16.0); + element.Top.Precent = num2; + element.Top.Pixels = maxValue; element.Height.Pixels = 266f; element.HAlign = 0.5f; element.SetPadding(0.0f); this.outerLayer1 = element; UIElement uiElement = new UIElement(); - uiElement.Width.Pixels = (float) ((double) num4 + 8.0 + 16.0); - uiElement.Top.Precent = num3; - uiElement.Top.Pixels = num2; + uiElement.Width.Pixels = (float) ((double) num3 + 8.0 + 16.0); + uiElement.Top.Precent = num2; + uiElement.Top.Pixels = maxValue; uiElement.Height.Pixels = 266f; uiElement.HAlign = 0.5f; uiElement.SetPadding(0.0f); @@ -117,14 +113,14 @@ namespace Terraria.GameContent.UI.States mainPanel.Height.Pixels = 225f; mainPanel.BackgroundColor = new Color(23, 33, 69) * 0.7f; element.Append((UIElement) mainPanel); - float num5 = -50f; + float num4 = -79f; this._textBox = new UITextBox("", 0.78f, true); this._textBox.BackgroundColor = Color.Transparent; this._textBox.BorderColor = Color.Transparent; this._textBox.HAlign = 0.5f; - this._textBox.Width.Pixels = num4; - this._textBox.Top.Pixels = (float) ((double) num5 + (double) num2 - 10.0) + num1; - this._textBox.Top.Precent = num3; + this._textBox.Width.Pixels = num3; + this._textBox.Top.Pixels = (float) ((double) num4 + (double) maxValue - 10.0) + num1; + this._textBox.Top.Precent = num2; this._textBox.Height.Pixels = 37f; this.Append((UIElement) this._textBox); for (int x = 0; x < 10; ++x) @@ -158,7 +154,7 @@ namespace Terraria.GameContent.UI.States }); this._shiftButton.OnClick += (UIElement.MouseEvent) ((evt, listeningElement) => { - SoundEngine.PlaySound(12); + Main.PlaySound(12); this.SetKeyState(this._keyState == UIVirtualKeyboard.KeyState.Shift ? UIVirtualKeyboard.KeyState.Default : UIVirtualKeyboard.KeyState.Shift); }); UIImage uiImage1 = new UIImage(this._textureShift); @@ -188,7 +184,7 @@ namespace Terraria.GameContent.UI.States }); this._symbolButton.OnClick += (UIElement.MouseEvent) ((evt, listeningElement) => { - SoundEngine.PlaySound(12); + Main.PlaySound(12); this.SetKeyState(this._keyState == UIVirtualKeyboard.KeyState.Symbol ? UIVirtualKeyboard.KeyState.Default : UIVirtualKeyboard.KeyState.Symbol); }); mainPanel.Append((UIElement) this._symbolButton); @@ -201,11 +197,16 @@ namespace Terraria.GameContent.UI.States this._submitButton.PaddingLeft = 0.0f; this._submitButton.PaddingRight = 0.0f; this.ValidateText(); - this._submitButton.OnMouseOver += new UIElement.MouseEvent(this.FadedMouseOver); - this._submitButton.OnMouseOut += new UIElement.MouseEvent(this.FadedMouseOut); this._submitButton.OnMouseOver += (UIElement.MouseEvent) ((evt, listeningElement) => this.ValidateText()); this._submitButton.OnMouseOut += (UIElement.MouseEvent) ((evt, listeningElement) => this.ValidateText()); - this._submitButton.OnClick += (UIElement.MouseEvent) ((evt, listeningElement) => UIVirtualKeyboard.Submit()); + this._submitButton.OnClick += (UIElement.MouseEvent) ((evt, listeningElement) => + { + string text = this.Text.Trim(); + if (text.Length <= 0 && !this._edittingSign && !this._edittingChest && !this._allowEmpty) + return; + Main.PlaySound(10); + this._submitAction(text); + }); element.Append((UIElement) this._submitButton); this._cancelButton = new UITextPanel(Language.GetText("UI.Cancel"), 0.4f, true); this.StyleKey(this._cancelButton, true); @@ -214,11 +215,9 @@ namespace Terraria.GameContent.UI.States this._cancelButton.VAlign = 1f; this._cancelButton.OnClick += (UIElement.MouseEvent) ((evt, listeningElement) => { - SoundEngine.PlaySound(11); + Main.PlaySound(11); this._cancelAction(); }); - this._cancelButton.OnMouseOver += new UIElement.MouseEvent(this.FadedMouseOver); - this._cancelButton.OnMouseOut += new UIElement.MouseEvent(this.FadedMouseOut); element.Append((UIElement) this._cancelButton); this._submitButton2 = new UITextPanel(this._edittingSign || this._edittingChest ? Language.GetText("UI.Save") : Language.GetText("UI.Submit"), 0.72f, true); this._submitButton2.TextColor = Color.Silver; @@ -243,14 +242,12 @@ namespace Terraria.GameContent.UI.States this.ValidateText(); this._submitButton2.OnMouseOver += (UIElement.MouseEvent) ((evt, listeningElement) => this.ValidateText()); this._submitButton2.OnMouseOut += (UIElement.MouseEvent) ((evt, listeningElement) => this.ValidateText()); - this._submitButton2.OnMouseOver += new UIElement.MouseEvent(this.FadedMouseOver); - this._submitButton2.OnMouseOut += new UIElement.MouseEvent(this.FadedMouseOut); this._submitButton2.OnClick += (UIElement.MouseEvent) ((evt, listeningElement) => { string text = this.Text.Trim(); if (text.Length <= 0 && !this._edittingSign && !this._edittingChest && !this._allowEmpty) return; - SoundEngine.PlaySound(10); + Main.PlaySound(10); this._submitAction(text); }); this.outerLayer2.Append((UIElement) this._submitButton2); @@ -274,14 +271,14 @@ namespace Terraria.GameContent.UI.States this._cancelButton2.HAlign = 0.5f; this._cancelButton2.OnClick += (UIElement.MouseEvent) ((evt, listeningElement) => { - SoundEngine.PlaySound(11); + Main.PlaySound(11); this._cancelAction(); }); this.outerLayer2.Append((UIElement) this._cancelButton2); UITextPanel keyboardButton1 = this.CreateKeyboardButton((object) "", 8, 4, 2); keyboardButton1.OnClick += (UIElement.MouseEvent) ((evt, listeningElement) => { - SoundEngine.PlaySound(12); + Main.PlaySound(12); this._textBox.Backspace(); this.ValidateText(); }); @@ -296,24 +293,21 @@ namespace Terraria.GameContent.UI.States mainPanel.Append((UIElement) keyboardButton1); UIText uiText = new UIText(labelText, 0.75f, true); uiText.HAlign = 0.5f; - uiText.Width.Pixels = num4; - uiText.Top.Pixels = (float) ((double) num5 - 37.0 - 4.0) + num2 + num1; - uiText.Top.Precent = num3; + uiText.Width.Pixels = num3; + uiText.Top.Pixels = (float) ((double) num4 - 37.0 - 4.0) + maxValue + num1; + uiText.Top.Precent = num2; uiText.Height.Pixels = 37f; this.Append((UIElement) uiText); this._label = uiText; this.Append(element); - this._textBox.SetTextMaxLength(this._edittingSign ? 1200 : 20); + this._textBox.SetTextMaxLength(this._edittingSign ? 99999 : 20); this.Text = startingText; if (this.Text.Length == 0) this.SetKeyState(UIVirtualKeyboard.KeyState.Shift); - UIVirtualKeyboard.ShouldHideText = true; UIVirtualKeyboard.OffsetDown = 9999; this.UpdateOffsetDown(); } - public void SetMaxInputLength(int length) => this._textBox.SetTextMaxLength(length); - private void BuildSpaceBarArea(UIPanel mainPanel) { Action createTheseTwo = (Action) (() => @@ -325,7 +319,7 @@ namespace Terraria.GameContent.UI.States UITextPanel keyboardButton1 = this.CreateKeyboardButton((object) Language.GetText("UI.SpaceButton"), 2, 4, this._edittingSign || this._edittingChest & flag ? width : 6); keyboardButton1.OnClick += (UIElement.MouseEvent) ((evt, listeningElement) => { - SoundEngine.PlaySound(12); + Main.PlaySound(12); this._textBox.Write(" "); this.ValidateText(); }); @@ -336,7 +330,7 @@ namespace Terraria.GameContent.UI.States UITextPanel keyboardButton2 = this.CreateKeyboardButton((object) Language.GetText("UI.EnterButton"), x, 4, width); keyboardButton2.OnClick += (UIElement.MouseEvent) ((evt, listeningElement) => { - SoundEngine.PlaySound(12); + Main.PlaySound(12); this._textBox.Write("\n"); this.ValidateText(); }); @@ -349,7 +343,7 @@ namespace Terraria.GameContent.UI.States UITextPanel restoreBar = this.CreateKeyboardButton((object) Language.GetText("UI.RestoreButton"), 6, 4, 2); restoreBar.OnClick += (UIElement.MouseEvent) ((evt, listeningElement) => { - SoundEngine.PlaySound(12); + Main.PlaySound(12); this.RestoreCancelledInput(this._keyboardContext); this.ValidateText(); restoreBar.Remove(); @@ -370,7 +364,7 @@ namespace Terraria.GameContent.UI.States private void TypeText(UIMouseEvent evt, UIElement listeningElement) { - SoundEngine.PlaySound(12); + Main.PlaySound(12); int num = this.Text.Length == 0 ? 1 : 0; this._textBox.Write(((UITextPanel) listeningElement).Text); this.ValidateText(); @@ -543,13 +537,17 @@ namespace Terraria.GameContent.UI.States base.DrawSelf(spriteBatch); this.UpdateOffsetDown(); UIVirtualKeyboard.OffsetDown = 0; - UIVirtualKeyboard.ShouldHideText = false; this.SetupGamepadPoints(spriteBatch); PlayerInput.WritingText = true; Main.instance.HandleIME(); - Vector2 position = new Vector2((float) (Main.screenWidth / 2), (float) (this._textBox.GetDimensions().ToRectangle().Bottom + 32)); + Vector2 position; + ref Vector2 local1 = ref position; + double num1 = (double) (Main.screenWidth / 2); + Rectangle rectangle = this._textBox.GetDimensions().ToRectangle(); + double num2 = (double) (rectangle.Bottom + 32); + local1 = new Vector2((float) num1, (float) num2); Main.instance.DrawWindowsIMEPanel(position, 0.5f); - string inputText = Main.GetInputText(this.Text, this._edittingSign); + string inputText = Main.GetInputText(this.Text); if (this._edittingSign && Main.inputTextEnter) { inputText += "\n"; @@ -564,8 +562,6 @@ namespace Terraria.GameContent.UI.States } if (Main.inputTextEnter && UIVirtualKeyboard.CanSubmit) UIVirtualKeyboard.Submit(); - else if (this._edittingChest && Main.player[Main.myPlayer].chest < 0) - ChestUI.RenameChestCancel(); else if (Main.inputTextEscape) { if (this._edittingSign) @@ -585,18 +581,21 @@ namespace Terraria.GameContent.UI.States if (this._edittingChest) this.CopyTextToChest(); } - byte num = (byte) (((int) byte.MaxValue + (int) Main.tileColor.R * 2) / 3); - Color color = new Color((int) num, (int) num, (int) num, (int) byte.MaxValue); + byte num3 = (byte) (((int) byte.MaxValue + (int) Main.tileColor.R * 2) / 3); + Color color = new Color((int) num3, (int) num3, (int) num3, (int) byte.MaxValue); this._textBox.TextColor = Color.Lerp(Color.White, color, 0.2f); this._label.TextColor = Color.Lerp(Color.White, color, 0.2f); - position = new Vector2((float) (Main.screenWidth / 2), (float) (this._textBox.GetDimensions().ToRectangle().Bottom + 32)); + ref Vector2 local2 = ref position; + double num4 = (double) (Main.screenWidth / 2); + rectangle = this._textBox.GetDimensions().ToRectangle(); + double num5 = (double) (rectangle.Bottom + 32); + local2 = new Vector2((float) num4, (float) num5); Main.instance.DrawWindowsIMEPanel(position, 0.5f); } } private void UpdateOffsetDown() { - this._textBox.HideSelf = UIVirtualKeyboard.ShouldHideText; int num1 = UIVirtualKeyboard.OffsetDown - this._lastOffsetDown; int num2 = num1; if (Math.Abs(num1) < 10) @@ -686,7 +685,7 @@ namespace Terraria.GameContent.UI.States { if (UIVirtualKeyboard._currentInstance == null) return; - SoundEngine.PlaySound(12); + Main.PlaySound(12); UIVirtualKeyboard._currentInstance._textBox.Backspace(); UIVirtualKeyboard._currentInstance.ValidateText(); } @@ -697,23 +696,18 @@ namespace Terraria.GameContent.UI.States { if (UIVirtualKeyboard._currentInstance == null) return; - UIVirtualKeyboard._currentInstance.InternalSubmit(); - } - - private void InternalSubmit() - { - string text = this.Text.Trim(); - if (text.Length <= 0 && !this._edittingSign && !this._edittingChest && !this._allowEmpty) + string text = UIVirtualKeyboard._currentInstance.Text.Trim(); + if (text.Length <= 0) return; - SoundEngine.PlaySound(10); - this._submitAction(text); + Main.PlaySound(10); + UIVirtualKeyboard._currentInstance._submitAction(text); } public static void Cancel() { if (UIVirtualKeyboard._currentInstance == null) return; - SoundEngine.PlaySound(11); + Main.PlaySound(11); UIVirtualKeyboard._currentInstance._cancelAction(); } @@ -721,7 +715,7 @@ namespace Terraria.GameContent.UI.States { if (UIVirtualKeyboard._currentInstance == null) return; - SoundEngine.PlaySound(12); + Main.PlaySound(12); int num = UIVirtualKeyboard._currentInstance.Text.Length == 0 ? 1 : 0; UIVirtualKeyboard._currentInstance._textBox.Write(text); UIVirtualKeyboard._currentInstance.ValidateText(); @@ -734,7 +728,7 @@ namespace Terraria.GameContent.UI.States { if (UIVirtualKeyboard._currentInstance == null) return; - SoundEngine.PlaySound(12); + Main.PlaySound(12); UIVirtualKeyboard._currentInstance._textBox.CursorLeft(); } @@ -742,7 +736,7 @@ namespace Terraria.GameContent.UI.States { if (UIVirtualKeyboard._currentInstance == null) return; - SoundEngine.PlaySound(12); + Main.PlaySound(12); UIVirtualKeyboard._currentInstance._textBox.CursorRight(); } @@ -783,19 +777,6 @@ namespace Terraria.GameContent.UI.States Main.npcChatText = this.Text; } - private void FadedMouseOver(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(12); - ((UIPanel) evt.Target).BackgroundColor = new Color(73, 94, 171); - ((UIPanel) evt.Target).BorderColor = Colors.FancyUIFatButtonMouseOver; - } - - private void FadedMouseOut(UIMouseEvent evt, UIElement listeningElement) - { - ((UIPanel) evt.Target).BackgroundColor = new Color(63, 82, 151) * 0.7f; - ((UIPanel) evt.Target).BorderColor = Color.Black; - } - public delegate void KeyboardSubmitEvent(string text); public enum KeyState diff --git a/GameContent/UI/States/UIWorldCreation.cs b/GameContent/UI/States/UIWorldCreation.cs deleted file mode 100644 index 223628b..0000000 --- a/GameContent/UI/States/UIWorldCreation.cs +++ /dev/null @@ -1,927 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.UI.States.UIWorldCreation -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria.Audio; -using Terraria.GameContent.UI.Elements; -using Terraria.ID; -using Terraria.IO; -using Terraria.Localization; -using Terraria.Social; -using Terraria.UI; -using Terraria.UI.Gamepad; - -namespace Terraria.GameContent.UI.States -{ - public class UIWorldCreation : UIState - { - private UIWorldCreation.WorldSizeId _optionSize; - private UIWorldCreation.WorldDifficultyId _optionDifficulty; - private UIWorldCreation.WorldEvilId _optionEvil; - private string _optionwWorldName; - private string _optionSeed; - private UICharacterNameButton _namePlate; - private UICharacterNameButton _seedPlate; - private UIWorldCreationPreview _previewPlate; - private GroupOptionButton[] _sizeButtons; - private GroupOptionButton[] _difficultyButtons; - private GroupOptionButton[] _evilButtons; - private UIText _descriptionText; - private const int MAX_NAME_LENGTH = 27; - private const int MAX_SEED_LENGTH = 40; - - public UIWorldCreation() => this.BuildPage(); - - private void BuildPage() - { - int num = 18; - this.RemoveAllChildren(); - UIElement uiElement1 = new UIElement() - { - Width = StyleDimension.FromPixels(500f), - Height = StyleDimension.FromPixels(434f + (float) num), - Top = StyleDimension.FromPixels(170f - (float) num), - HAlign = 0.5f, - VAlign = 0.0f - }; - uiElement1.SetPadding(0.0f); - this.Append(uiElement1); - UIPanel uiPanel1 = new UIPanel(); - uiPanel1.Width = StyleDimension.FromPercent(1f); - uiPanel1.Height = StyleDimension.FromPixels((float) (280 + num)); - uiPanel1.Top = StyleDimension.FromPixels(50f); - uiPanel1.BackgroundColor = new Color(33, 43, 79) * 0.8f; - UIPanel uiPanel2 = uiPanel1; - uiPanel2.SetPadding(0.0f); - uiElement1.Append((UIElement) uiPanel2); - this.MakeBackAndCreatebuttons(uiElement1); - UIElement uiElement2 = new UIElement() - { - Top = StyleDimension.FromPixelsAndPercent(0.0f, 0.0f), - Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f), - Height = StyleDimension.FromPixelsAndPercent(0.0f, 1f), - HAlign = 1f - }; - uiElement2.SetPadding(0.0f); - uiElement2.PaddingTop = 8f; - uiElement2.PaddingBottom = 12f; - uiPanel2.Append(uiElement2); - this.MakeInfoMenu(uiElement2); - } - - private void MakeInfoMenu(UIElement parentContainer) - { - UIElement uiElement = new UIElement() - { - Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f), - Height = StyleDimension.FromPixelsAndPercent(0.0f, 1f), - HAlign = 0.5f, - VAlign = 0.0f - }; - uiElement.SetPadding(10f); - uiElement.PaddingBottom = 0.0f; - uiElement.PaddingTop = 0.0f; - parentContainer.Append(uiElement); - float pixels1 = 0.0f; - float num1 = 44f; - float num2 = (float) (88.0 + (double) num1); - float pixels2 = num1; - GroupOptionButton groupOptionButton1 = new GroupOptionButton(true, (LocalizedText) null, Language.GetText("UI.WorldCreationRandomizeNameDescription"), Color.White, "Images/UI/WorldCreation/IconRandomName"); - groupOptionButton1.Width = StyleDimension.FromPixelsAndPercent(40f, 0.0f); - groupOptionButton1.Height = new StyleDimension(40f, 0.0f); - groupOptionButton1.HAlign = 0.0f; - groupOptionButton1.Top = StyleDimension.FromPixelsAndPercent(pixels1, 0.0f); - groupOptionButton1.ShowHighlightWhenSelected = false; - GroupOptionButton groupOptionButton2 = groupOptionButton1; - groupOptionButton2.OnMouseDown += new UIElement.MouseEvent(this.ClickRandomizeName); - groupOptionButton2.OnMouseOver += new UIElement.MouseEvent(this.ShowOptionDescription); - groupOptionButton2.OnMouseOut += new UIElement.MouseEvent(this.ClearOptionDescription); - groupOptionButton2.SetSnapPoint("RandomizeName", 0); - uiElement.Append((UIElement) groupOptionButton2); - UICharacterNameButton characterNameButton1 = new UICharacterNameButton(Language.GetText("UI.WorldCreationName"), Language.GetText("UI.WorldCreationNameEmpty"), Language.GetText("UI.WorldDescriptionName")); - characterNameButton1.Width = StyleDimension.FromPixelsAndPercent(-num2, 1f); - characterNameButton1.HAlign = 0.0f; - characterNameButton1.Left = new StyleDimension(pixels2, 0.0f); - characterNameButton1.Top = StyleDimension.FromPixelsAndPercent(pixels1, 0.0f); - UICharacterNameButton characterNameButton2 = characterNameButton1; - characterNameButton2.OnMouseDown += new UIElement.MouseEvent(this.Click_SetName); - characterNameButton2.OnMouseOver += new UIElement.MouseEvent(this.ShowOptionDescription); - characterNameButton2.OnMouseOut += new UIElement.MouseEvent(this.ClearOptionDescription); - characterNameButton2.SetSnapPoint("Name", 0); - uiElement.Append((UIElement) characterNameButton2); - this._namePlate = characterNameButton2; - CalculatedStyle dimensions1 = characterNameButton2.GetDimensions(); - float pixels3 = pixels1 + (dimensions1.Height + 4f); - GroupOptionButton groupOptionButton3 = new GroupOptionButton(true, (LocalizedText) null, Language.GetText("UI.WorldCreationRandomizeSeedDescription"), Color.White, "Images/UI/WorldCreation/IconRandomSeed"); - groupOptionButton3.Width = StyleDimension.FromPixelsAndPercent(40f, 0.0f); - groupOptionButton3.Height = new StyleDimension(40f, 0.0f); - groupOptionButton3.HAlign = 0.0f; - groupOptionButton3.Top = StyleDimension.FromPixelsAndPercent(pixels3, 0.0f); - groupOptionButton3.ShowHighlightWhenSelected = false; - GroupOptionButton groupOptionButton4 = groupOptionButton3; - groupOptionButton4.OnMouseDown += new UIElement.MouseEvent(this.ClickRandomizeSeed); - groupOptionButton4.OnMouseOver += new UIElement.MouseEvent(this.ShowOptionDescription); - groupOptionButton4.OnMouseOut += new UIElement.MouseEvent(this.ClearOptionDescription); - groupOptionButton4.SetSnapPoint("RandomizeSeed", 0); - uiElement.Append((UIElement) groupOptionButton4); - UICharacterNameButton characterNameButton3 = new UICharacterNameButton(Language.GetText("UI.WorldCreationSeed"), Language.GetText("UI.WorldCreationSeedEmpty"), Language.GetText("UI.WorldDescriptionSeed")); - characterNameButton3.Width = StyleDimension.FromPixelsAndPercent(-num2, 1f); - characterNameButton3.HAlign = 0.0f; - characterNameButton3.Left = new StyleDimension(pixels2, 0.0f); - characterNameButton3.Top = StyleDimension.FromPixelsAndPercent(pixels3, 0.0f); - characterNameButton3.DistanceFromTitleToOption = 29f; - UICharacterNameButton characterNameButton4 = characterNameButton3; - characterNameButton4.OnMouseDown += new UIElement.MouseEvent(this.Click_SetSeed); - characterNameButton4.OnMouseOver += new UIElement.MouseEvent(this.ShowOptionDescription); - characterNameButton4.OnMouseOut += new UIElement.MouseEvent(this.ClearOptionDescription); - characterNameButton4.SetSnapPoint("Seed", 0); - uiElement.Append((UIElement) characterNameButton4); - this._seedPlate = characterNameButton4; - UIWorldCreationPreview worldCreationPreview1 = new UIWorldCreationPreview(); - worldCreationPreview1.Width = StyleDimension.FromPixels(84f); - worldCreationPreview1.Height = StyleDimension.FromPixels(84f); - worldCreationPreview1.HAlign = 1f; - worldCreationPreview1.VAlign = 0.0f; - UIWorldCreationPreview worldCreationPreview2 = worldCreationPreview1; - uiElement.Append((UIElement) worldCreationPreview2); - this._previewPlate = worldCreationPreview2; - CalculatedStyle dimensions2 = characterNameButton4.GetDimensions(); - float accumualtedHeight1 = pixels3 + (dimensions2.Height + 10f); - UIWorldCreation.AddHorizontalSeparator(uiElement, accumualtedHeight1 + 2f); - float usableWidthPercent = 1f; - this.AddWorldSizeOptions(uiElement, accumualtedHeight1, new UIElement.MouseEvent(this.ClickSizeOption), "size", usableWidthPercent); - float accumualtedHeight2 = accumualtedHeight1 + 48f; - UIWorldCreation.AddHorizontalSeparator(uiElement, accumualtedHeight2); - this.AddWorldDifficultyOptions(uiElement, accumualtedHeight2, new UIElement.MouseEvent(this.ClickDifficultyOption), "difficulty", usableWidthPercent); - float accumualtedHeight3 = accumualtedHeight2 + 48f; - UIWorldCreation.AddHorizontalSeparator(uiElement, accumualtedHeight3); - this.AddWorldEvilOptions(uiElement, accumualtedHeight3, new UIElement.MouseEvent(this.ClickEvilOption), "evil", usableWidthPercent); - float num3 = accumualtedHeight3 + 48f; - UIWorldCreation.AddHorizontalSeparator(uiElement, num3); - this.AddDescriptionPanel(uiElement, num3, "desc"); - this.SetDefaultOptions(); - } - - private static void AddHorizontalSeparator(UIElement Container, float accumualtedHeight) - { - UIHorizontalSeparator horizontalSeparator1 = new UIHorizontalSeparator(); - horizontalSeparator1.Width = StyleDimension.FromPercent(1f); - horizontalSeparator1.Top = StyleDimension.FromPixels(accumualtedHeight - 8f); - horizontalSeparator1.Color = Color.Lerp(Color.White, new Color(63, 65, 151, (int) byte.MaxValue), 0.85f) * 0.9f; - UIHorizontalSeparator horizontalSeparator2 = horizontalSeparator1; - Container.Append((UIElement) horizontalSeparator2); - } - - private void SetDefaultOptions() - { - this.AssignRandomWorldName(); - this.AssignRandomWorldSeed(); - this.UpdateInputFields(); - foreach (GroupOptionButton sizeButton in this._sizeButtons) - sizeButton.SetCurrentOption(UIWorldCreation.WorldSizeId.Small); - if (Main.ActivePlayerFileData.Player.difficulty == (byte) 3) - { - foreach (GroupOptionButton difficultyButton in this._difficultyButtons) - difficultyButton.SetCurrentOption(UIWorldCreation.WorldDifficultyId.Creative); - this._optionDifficulty = UIWorldCreation.WorldDifficultyId.Creative; - this.UpdatePreviewPlate(); - } - else - { - foreach (GroupOptionButton difficultyButton in this._difficultyButtons) - difficultyButton.SetCurrentOption(UIWorldCreation.WorldDifficultyId.Normal); - } - foreach (GroupOptionButton evilButton in this._evilButtons) - evilButton.SetCurrentOption(UIWorldCreation.WorldEvilId.Random); - } - - private void AddDescriptionPanel(UIElement container, float accumulatedHeight, string tagGroup) - { - float num = 0.0f; - UISlicedImage uiSlicedImage1 = new UISlicedImage(Main.Assets.Request("Images/UI/CharCreation/CategoryPanelHighlight", (AssetRequestMode) 1)); - uiSlicedImage1.HAlign = 0.5f; - uiSlicedImage1.VAlign = 1f; - uiSlicedImage1.Width = StyleDimension.FromPixelsAndPercent((float) (-(double) num * 2.0), 1f); - uiSlicedImage1.Left = StyleDimension.FromPixels(-num); - uiSlicedImage1.Height = StyleDimension.FromPixelsAndPercent(40f, 0.0f); - uiSlicedImage1.Top = StyleDimension.FromPixels(2f); - UISlicedImage uiSlicedImage2 = uiSlicedImage1; - uiSlicedImage2.SetSliceDepths(10); - uiSlicedImage2.Color = Color.LightGray * 0.7f; - container.Append((UIElement) uiSlicedImage2); - UIText uiText1 = new UIText(Language.GetText("UI.WorldDescriptionDefault"), 0.82f); - uiText1.HAlign = 0.0f; - uiText1.VAlign = 0.0f; - uiText1.Width = StyleDimension.FromPixelsAndPercent(0.0f, 1f); - uiText1.Height = StyleDimension.FromPixelsAndPercent(0.0f, 1f); - uiText1.Top = StyleDimension.FromPixelsAndPercent(5f, 0.0f); - UIText uiText2 = uiText1; - uiText2.PaddingLeft = 20f; - uiText2.PaddingRight = 20f; - uiText2.PaddingTop = 6f; - uiSlicedImage2.Append((UIElement) uiText2); - this._descriptionText = uiText2; - } - - private void AddWorldSizeOptions( - UIElement container, - float accumualtedHeight, - UIElement.MouseEvent clickEvent, - string tagGroup, - float usableWidthPercent) - { - UIWorldCreation.WorldSizeId[] worldSizeIdArray = new UIWorldCreation.WorldSizeId[3] - { - UIWorldCreation.WorldSizeId.Small, - UIWorldCreation.WorldSizeId.Medium, - UIWorldCreation.WorldSizeId.Large - }; - LocalizedText[] localizedTextArray1 = new LocalizedText[3] - { - Lang.menu[92], - Lang.menu[93], - Lang.menu[94] - }; - LocalizedText[] localizedTextArray2 = new LocalizedText[3] - { - Language.GetText("UI.WorldDescriptionSizeSmall"), - Language.GetText("UI.WorldDescriptionSizeMedium"), - Language.GetText("UI.WorldDescriptionSizeLarge") - }; - Color[] colorArray = new Color[3] - { - Color.Cyan, - Color.Lerp(Color.Cyan, Color.LimeGreen, 0.5f), - Color.LimeGreen - }; - string[] strArray = new string[3] - { - "Images/UI/WorldCreation/IconSizeSmall", - "Images/UI/WorldCreation/IconSizeMedium", - "Images/UI/WorldCreation/IconSizeLarge" - }; - GroupOptionButton[] groupOptionButtonArray = new GroupOptionButton[worldSizeIdArray.Length]; - for (int id = 0; id < groupOptionButtonArray.Length; ++id) - { - GroupOptionButton groupOptionButton = new GroupOptionButton(worldSizeIdArray[id], localizedTextArray1[id], localizedTextArray2[id], colorArray[id], strArray[id], titleAlignmentX: 1f, titleWidthReduction: 16f); - groupOptionButton.Width = StyleDimension.FromPixelsAndPercent((float) (-4 * (groupOptionButtonArray.Length - 1)), 1f / (float) groupOptionButtonArray.Length * usableWidthPercent); - groupOptionButton.Left = StyleDimension.FromPercent(1f - usableWidthPercent); - groupOptionButton.HAlign = (float) id / (float) (groupOptionButtonArray.Length - 1); - groupOptionButton.Top.Set(accumualtedHeight, 0.0f); - groupOptionButton.OnMouseDown += clickEvent; - groupOptionButton.OnMouseOver += new UIElement.MouseEvent(this.ShowOptionDescription); - groupOptionButton.OnMouseOut += new UIElement.MouseEvent(this.ClearOptionDescription); - groupOptionButton.SetSnapPoint(tagGroup, id); - container.Append((UIElement) groupOptionButton); - groupOptionButtonArray[id] = groupOptionButton; - } - this._sizeButtons = groupOptionButtonArray; - } - - private void AddWorldDifficultyOptions( - UIElement container, - float accumualtedHeight, - UIElement.MouseEvent clickEvent, - string tagGroup, - float usableWidthPercent) - { - UIWorldCreation.WorldDifficultyId[] worldDifficultyIdArray = new UIWorldCreation.WorldDifficultyId[4] - { - UIWorldCreation.WorldDifficultyId.Creative, - UIWorldCreation.WorldDifficultyId.Normal, - UIWorldCreation.WorldDifficultyId.Expert, - UIWorldCreation.WorldDifficultyId.Master - }; - LocalizedText[] localizedTextArray1 = new LocalizedText[4] - { - Language.GetText("UI.Creative"), - Language.GetText("UI.Normal"), - Language.GetText("UI.Expert"), - Language.GetText("UI.Master") - }; - LocalizedText[] localizedTextArray2 = new LocalizedText[4] - { - Language.GetText("UI.WorldDescriptionCreative"), - Language.GetText("UI.WorldDescriptionNormal"), - Language.GetText("UI.WorldDescriptionExpert"), - Language.GetText("UI.WorldDescriptionMaster") - }; - Color[] colorArray = new Color[4] - { - Main.creativeModeColor, - Color.White, - Main.mcColor, - Main.hcColor - }; - string[] strArray = new string[4] - { - "Images/UI/WorldCreation/IconDifficultyCreative", - "Images/UI/WorldCreation/IconDifficultyNormal", - "Images/UI/WorldCreation/IconDifficultyExpert", - "Images/UI/WorldCreation/IconDifficultyMaster" - }; - GroupOptionButton[] groupOptionButtonArray = new GroupOptionButton[worldDifficultyIdArray.Length]; - for (int id = 0; id < groupOptionButtonArray.Length; ++id) - { - GroupOptionButton groupOptionButton = new GroupOptionButton(worldDifficultyIdArray[id], localizedTextArray1[id], localizedTextArray2[id], colorArray[id], strArray[id], titleAlignmentX: 1f, titleWidthReduction: 16f); - groupOptionButton.Width = StyleDimension.FromPixelsAndPercent((float) (-1 * (groupOptionButtonArray.Length - 1)), 1f / (float) groupOptionButtonArray.Length * usableWidthPercent); - groupOptionButton.Left = StyleDimension.FromPercent(1f - usableWidthPercent); - groupOptionButton.HAlign = (float) id / (float) (groupOptionButtonArray.Length - 1); - groupOptionButton.Top.Set(accumualtedHeight, 0.0f); - groupOptionButton.OnMouseDown += clickEvent; - groupOptionButton.OnMouseOver += new UIElement.MouseEvent(this.ShowOptionDescription); - groupOptionButton.OnMouseOut += new UIElement.MouseEvent(this.ClearOptionDescription); - groupOptionButton.SetSnapPoint(tagGroup, id); - container.Append((UIElement) groupOptionButton); - groupOptionButtonArray[id] = groupOptionButton; - } - this._difficultyButtons = groupOptionButtonArray; - } - - private void AddWorldEvilOptions( - UIElement container, - float accumualtedHeight, - UIElement.MouseEvent clickEvent, - string tagGroup, - float usableWidthPercent) - { - UIWorldCreation.WorldEvilId[] worldEvilIdArray = new UIWorldCreation.WorldEvilId[3] - { - UIWorldCreation.WorldEvilId.Random, - UIWorldCreation.WorldEvilId.Corruption, - UIWorldCreation.WorldEvilId.Crimson - }; - LocalizedText[] localizedTextArray1 = new LocalizedText[3] - { - Lang.misc[103], - Lang.misc[101], - Lang.misc[102] - }; - LocalizedText[] localizedTextArray2 = new LocalizedText[3] - { - Language.GetText("UI.WorldDescriptionEvilRandom"), - Language.GetText("UI.WorldDescriptionEvilCorrupt"), - Language.GetText("UI.WorldDescriptionEvilCrimson") - }; - Color[] colorArray = new Color[3] - { - Color.White, - Color.MediumPurple, - Color.IndianRed - }; - string[] strArray = new string[3] - { - "Images/UI/WorldCreation/IconEvilRandom", - "Images/UI/WorldCreation/IconEvilCorruption", - "Images/UI/WorldCreation/IconEvilCrimson" - }; - GroupOptionButton[] groupOptionButtonArray = new GroupOptionButton[worldEvilIdArray.Length]; - for (int id = 0; id < groupOptionButtonArray.Length; ++id) - { - GroupOptionButton groupOptionButton = new GroupOptionButton(worldEvilIdArray[id], localizedTextArray1[id], localizedTextArray2[id], colorArray[id], strArray[id], titleAlignmentX: 1f, titleWidthReduction: 16f); - groupOptionButton.Width = StyleDimension.FromPixelsAndPercent((float) (-4 * (groupOptionButtonArray.Length - 1)), 1f / (float) groupOptionButtonArray.Length * usableWidthPercent); - groupOptionButton.Left = StyleDimension.FromPercent(1f - usableWidthPercent); - groupOptionButton.HAlign = (float) id / (float) (groupOptionButtonArray.Length - 1); - groupOptionButton.Top.Set(accumualtedHeight, 0.0f); - groupOptionButton.OnMouseDown += clickEvent; - groupOptionButton.OnMouseOver += new UIElement.MouseEvent(this.ShowOptionDescription); - groupOptionButton.OnMouseOut += new UIElement.MouseEvent(this.ClearOptionDescription); - groupOptionButton.SetSnapPoint(tagGroup, id); - container.Append((UIElement) groupOptionButton); - groupOptionButtonArray[id] = groupOptionButton; - } - this._evilButtons = groupOptionButtonArray; - } - - private void ClickRandomizeName(UIMouseEvent evt, UIElement listeningElement) - { - this.AssignRandomWorldName(); - this.UpdateInputFields(); - this.UpdateSliders(); - this.UpdatePreviewPlate(); - } - - private void ClickRandomizeSeed(UIMouseEvent evt, UIElement listeningElement) - { - this.AssignRandomWorldSeed(); - this.UpdateInputFields(); - this.UpdateSliders(); - this.UpdatePreviewPlate(); - } - - private void ClickSizeOption(UIMouseEvent evt, UIElement listeningElement) - { - GroupOptionButton groupOptionButton = (GroupOptionButton) listeningElement; - this._optionSize = groupOptionButton.OptionValue; - foreach (GroupOptionButton sizeButton in this._sizeButtons) - sizeButton.SetCurrentOption(groupOptionButton.OptionValue); - this.UpdatePreviewPlate(); - } - - private void ClickDifficultyOption(UIMouseEvent evt, UIElement listeningElement) - { - GroupOptionButton groupOptionButton = (GroupOptionButton) listeningElement; - this._optionDifficulty = groupOptionButton.OptionValue; - foreach (GroupOptionButton difficultyButton in this._difficultyButtons) - difficultyButton.SetCurrentOption(groupOptionButton.OptionValue); - this.UpdatePreviewPlate(); - } - - private void ClickEvilOption(UIMouseEvent evt, UIElement listeningElement) - { - GroupOptionButton groupOptionButton = (GroupOptionButton) listeningElement; - this._optionEvil = groupOptionButton.OptionValue; - foreach (GroupOptionButton evilButton in this._evilButtons) - evilButton.SetCurrentOption(groupOptionButton.OptionValue); - this.UpdatePreviewPlate(); - } - - private void UpdatePreviewPlate() => this._previewPlate.UpdateOption((byte) this._optionDifficulty, (byte) this._optionEvil, (byte) this._optionSize); - - private void UpdateSliders() - { - foreach (GroupOptionButton sizeButton in this._sizeButtons) - sizeButton.SetCurrentOption(this._optionSize); - foreach (GroupOptionButton difficultyButton in this._difficultyButtons) - difficultyButton.SetCurrentOption(this._optionDifficulty); - foreach (GroupOptionButton evilButton in this._evilButtons) - evilButton.SetCurrentOption(this._optionEvil); - } - - public void ShowOptionDescription(UIMouseEvent evt, UIElement listeningElement) - { - LocalizedText text = (LocalizedText) null; - if (listeningElement is GroupOptionButton groupOptionButton1) - text = groupOptionButton1.Description; - if (listeningElement is GroupOptionButton groupOptionButton2) - text = groupOptionButton2.Description; - if (listeningElement is GroupOptionButton groupOptionButton3) - text = groupOptionButton3.Description; - if (listeningElement is UICharacterNameButton characterNameButton) - text = characterNameButton.Description; - if (listeningElement is GroupOptionButton groupOptionButton4) - text = groupOptionButton4.Description; - if (text == null) - return; - this._descriptionText.SetText(text); - } - - public void ClearOptionDescription(UIMouseEvent evt, UIElement listeningElement) => this._descriptionText.SetText(Language.GetText("UI.WorldDescriptionDefault")); - - private void MakeBackAndCreatebuttons(UIElement outerContainer) - { - UITextPanel uiTextPanel1 = new UITextPanel(Language.GetText("UI.Back"), 0.7f, true); - uiTextPanel1.Width = StyleDimension.FromPixelsAndPercent(-10f, 0.5f); - uiTextPanel1.Height = StyleDimension.FromPixels(50f); - uiTextPanel1.VAlign = 1f; - uiTextPanel1.HAlign = 0.0f; - uiTextPanel1.Top = StyleDimension.FromPixels(-45f); - UITextPanel uiTextPanel2 = uiTextPanel1; - uiTextPanel2.OnMouseOver += new UIElement.MouseEvent(this.FadedMouseOver); - uiTextPanel2.OnMouseOut += new UIElement.MouseEvent(this.FadedMouseOut); - uiTextPanel2.OnMouseDown += new UIElement.MouseEvent(this.Click_GoBack); - uiTextPanel2.SetSnapPoint("Back", 0); - outerContainer.Append((UIElement) uiTextPanel2); - UITextPanel uiTextPanel3 = new UITextPanel(Language.GetText("UI.Create"), 0.7f, true); - uiTextPanel3.Width = StyleDimension.FromPixelsAndPercent(-10f, 0.5f); - uiTextPanel3.Height = StyleDimension.FromPixels(50f); - uiTextPanel3.VAlign = 1f; - uiTextPanel3.HAlign = 1f; - uiTextPanel3.Top = StyleDimension.FromPixels(-45f); - UITextPanel uiTextPanel4 = uiTextPanel3; - uiTextPanel4.OnMouseOver += new UIElement.MouseEvent(this.FadedMouseOver); - uiTextPanel4.OnMouseOut += new UIElement.MouseEvent(this.FadedMouseOut); - uiTextPanel4.OnMouseDown += new UIElement.MouseEvent(this.Click_NamingAndCreating); - uiTextPanel4.SetSnapPoint("Create", 0); - outerContainer.Append((UIElement) uiTextPanel4); - } - - private void Click_GoBack(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(11); - Main.OpenWorldSelectUI(); - } - - private void FadedMouseOver(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(12); - ((UIPanel) evt.Target).BackgroundColor = new Color(73, 94, 171); - ((UIPanel) evt.Target).BorderColor = Colors.FancyUIFatButtonMouseOver; - } - - private void FadedMouseOut(UIMouseEvent evt, UIElement listeningElement) - { - ((UIPanel) evt.Target).BackgroundColor = new Color(63, 82, 151) * 0.8f; - ((UIPanel) evt.Target).BorderColor = Color.Black; - } - - private void Click_SetName(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(10); - Main.clrInput(); - UIVirtualKeyboard uiVirtualKeyboard = new UIVirtualKeyboard(Lang.menu[48].Value, "", new UIVirtualKeyboard.KeyboardSubmitEvent(this.OnFinishedSettingName), new Action(this.GoBackHere), allowEmpty: true); - uiVirtualKeyboard.SetMaxInputLength(27); - Main.MenuUI.SetState((UIState) uiVirtualKeyboard); - } - - private void Click_SetSeed(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(10); - Main.clrInput(); - UIVirtualKeyboard uiVirtualKeyboard = new UIVirtualKeyboard(Language.GetTextValue("UI.EnterSeed"), "", new UIVirtualKeyboard.KeyboardSubmitEvent(this.OnFinishedSettingSeed), new Action(this.GoBackHere), allowEmpty: true); - uiVirtualKeyboard.SetMaxInputLength(40); - Main.MenuUI.SetState((UIState) uiVirtualKeyboard); - } - - private void Click_NamingAndCreating(UIMouseEvent evt, UIElement listeningElement) - { - SoundEngine.PlaySound(10); - if (string.IsNullOrEmpty(this._optionwWorldName)) - { - this._optionwWorldName = ""; - Main.clrInput(); - UIVirtualKeyboard uiVirtualKeyboard = new UIVirtualKeyboard(Lang.menu[48].Value, "", new UIVirtualKeyboard.KeyboardSubmitEvent(this.OnFinishedNamingAndCreating), new Action(this.GoBackHere)); - uiVirtualKeyboard.SetMaxInputLength(27); - Main.MenuUI.SetState((UIState) uiVirtualKeyboard); - } - else - this.FinishCreatingWorld(); - } - - private void OnFinishedSettingName(string name) - { - this._optionwWorldName = name.Trim(); - this.UpdateInputFields(); - this.GoBackHere(); - } - - private void UpdateInputFields() - { - this._namePlate.SetContents(this._optionwWorldName); - this._namePlate.TrimDisplayIfOverElementDimensions(27); - this._namePlate.Recalculate(); - this._seedPlate.SetContents(this._optionSeed); - this._seedPlate.TrimDisplayIfOverElementDimensions(40); - this._seedPlate.Recalculate(); - } - - private void OnFinishedSettingSeed(string seed) - { - this._optionSeed = seed.Trim(); - string processedSeed; - this.ProcessSeed(out processedSeed); - this._optionSeed = processedSeed; - this.UpdateInputFields(); - this.UpdateSliders(); - this.UpdatePreviewPlate(); - this.GoBackHere(); - } - - private void GoBackHere() => Main.MenuUI.SetState((UIState) this); - - private void OnFinishedNamingAndCreating(string name) - { - this.OnFinishedSettingName(name); - this.FinishCreatingWorld(); - } - - private void FinishCreatingWorld() - { - string processedSeed; - this.ProcessSeed(out processedSeed); - switch (this._optionSize) - { - case UIWorldCreation.WorldSizeId.Small: - Main.maxTilesX = 4200; - Main.maxTilesY = 1200; - break; - case UIWorldCreation.WorldSizeId.Medium: - Main.maxTilesX = 6400; - Main.maxTilesY = 1800; - break; - case UIWorldCreation.WorldSizeId.Large: - Main.maxTilesX = 8400; - Main.maxTilesY = 2400; - break; - } - WorldGen.setWorldSize(); - switch (this._optionDifficulty) - { - case UIWorldCreation.WorldDifficultyId.Normal: - Main.GameMode = 0; - break; - case UIWorldCreation.WorldDifficultyId.Expert: - Main.GameMode = 1; - break; - case UIWorldCreation.WorldDifficultyId.Master: - Main.GameMode = 2; - break; - case UIWorldCreation.WorldDifficultyId.Creative: - Main.GameMode = 3; - break; - } - switch (this._optionEvil) - { - case UIWorldCreation.WorldEvilId.Random: - WorldGen.WorldGenParam_Evil = -1; - break; - case UIWorldCreation.WorldEvilId.Corruption: - WorldGen.WorldGenParam_Evil = 0; - break; - case UIWorldCreation.WorldEvilId.Crimson: - WorldGen.WorldGenParam_Evil = 1; - break; - } - Main.ActiveWorldFileData = WorldFile.CreateMetadata(Main.worldName = this._optionwWorldName.Trim(), SocialAPI.Cloud != null && SocialAPI.Cloud.EnabledByDefault, Main.GameMode); - if (processedSeed.Length == 0) - Main.ActiveWorldFileData.SetSeedToRandom(); - else - Main.ActiveWorldFileData.SetSeed(processedSeed); - Main.menuMode = 10; - WorldGen.CreateNewWorld(); - } - - private void ProcessSeed(out string processedSeed) - { - processedSeed = this._optionSeed; - WorldGen.notTheBees = processedSeed.ToLower() == "not the bees" || processedSeed.ToLower() == "not the bees!"; - WorldGen.getGoodWorldGen = processedSeed.ToLower() == "for the worthy"; - string[] strArray = this._optionSeed.Split('.'); - if (strArray.Length != 4) - return; - int result; - if (int.TryParse(strArray[0], out result)) - { - switch (result) - { - case 1: - this._optionSize = UIWorldCreation.WorldSizeId.Small; - break; - case 2: - this._optionSize = UIWorldCreation.WorldSizeId.Medium; - break; - case 3: - this._optionSize = UIWorldCreation.WorldSizeId.Large; - break; - } - } - if (int.TryParse(strArray[1], out result)) - { - switch (result) - { - case 1: - this._optionDifficulty = UIWorldCreation.WorldDifficultyId.Normal; - break; - case 2: - this._optionDifficulty = UIWorldCreation.WorldDifficultyId.Expert; - break; - case 3: - this._optionDifficulty = UIWorldCreation.WorldDifficultyId.Master; - break; - case 4: - this._optionDifficulty = UIWorldCreation.WorldDifficultyId.Creative; - break; - } - } - if (int.TryParse(strArray[2], out result)) - { - switch (result) - { - case 1: - this._optionEvil = UIWorldCreation.WorldEvilId.Corruption; - break; - case 2: - this._optionEvil = UIWorldCreation.WorldEvilId.Crimson; - break; - } - } - processedSeed = strArray[3]; - } - - private void AssignRandomWorldName() - { - do - { - LocalizedText localizedText = Language.SelectRandom(Lang.CreateDialogFilter("RandomWorldName_Composition.")); - var data = new - { - Adjective = Language.SelectRandom(Lang.CreateDialogFilter("RandomWorldName_Adjective.")).Value, - Location = Language.SelectRandom(Lang.CreateDialogFilter("RandomWorldName_Location.")).Value, - Noun = Language.SelectRandom(Lang.CreateDialogFilter("RandomWorldName_Noun.")).Value - }; - this._optionwWorldName = localizedText.FormatWith((object) data); - } - while (this._optionwWorldName.Length > 27); - } - - private void AssignRandomWorldSeed() => this._optionSeed = Main.rand.Next().ToString(); - - public override void Draw(SpriteBatch spriteBatch) - { - base.Draw(spriteBatch); - this.SetupGamepadPoints(spriteBatch); - } - - private void SetupGamepadPoints(SpriteBatch spriteBatch) - { - UILinkPointNavigator.Shortcuts.BackButtonCommand = 1; - int num1 = 3000; - List snapPoints = this.GetSnapPoints(); - SnapPoint snapPoint1 = (SnapPoint) null; - SnapPoint snapPoint2 = (SnapPoint) null; - SnapPoint snapPoint3 = (SnapPoint) null; - SnapPoint snapPoint4 = (SnapPoint) null; - SnapPoint snapPoint5 = (SnapPoint) null; - SnapPoint snapPoint6 = (SnapPoint) null; - for (int index = 0; index < snapPoints.Count; ++index) - { - SnapPoint snapPoint7 = snapPoints[index]; - string name = snapPoint7.Name; - if (!(name == "Back")) - { - if (!(name == "Create")) - { - if (!(name == "Name")) - { - if (!(name == "Seed")) - { - if (!(name == "RandomizeName")) - { - if (name == "RandomizeSeed") - snapPoint6 = snapPoint7; - } - else - snapPoint5 = snapPoint7; - } - else - snapPoint4 = snapPoint7; - } - else - snapPoint3 = snapPoint7; - } - else - snapPoint2 = snapPoint7; - } - else - snapPoint1 = snapPoint7; - } - List snapGroup1 = this.GetSnapGroup(snapPoints, "size"); - List snapGroup2 = this.GetSnapGroup(snapPoints, "difficulty"); - List snapGroup3 = this.GetSnapGroup(snapPoints, "evil"); - UILinkPointNavigator.SetPosition(num1, snapPoint1.Position); - UILinkPoint point1 = UILinkPointNavigator.Points[num1]; - point1.Unlink(); - UILinkPoint uiLinkPoint1 = point1; - int num2 = num1 + 1; - UILinkPointNavigator.SetPosition(num2, snapPoint2.Position); - UILinkPoint point2 = UILinkPointNavigator.Points[num2]; - point2.Unlink(); - UILinkPoint uiLinkPoint2 = point2; - int num3 = num2 + 1; - UILinkPointNavigator.SetPosition(num3, snapPoint5.Position); - UILinkPoint point3 = UILinkPointNavigator.Points[num3]; - point3.Unlink(); - UILinkPoint uiLinkPoint3 = point3; - int num4 = num3 + 1; - UILinkPointNavigator.SetPosition(num4, snapPoint3.Position); - UILinkPoint point4 = UILinkPointNavigator.Points[num4]; - point4.Unlink(); - UILinkPoint uiLinkPoint4 = point4; - int num5 = num4 + 1; - UILinkPointNavigator.SetPosition(num5, snapPoint6.Position); - UILinkPoint point5 = UILinkPointNavigator.Points[num5]; - point5.Unlink(); - UILinkPoint uiLinkPoint5 = point5; - int num6 = num5 + 1; - UILinkPointNavigator.SetPosition(num6, snapPoint4.Position); - UILinkPoint point6 = UILinkPointNavigator.Points[num6]; - point6.Unlink(); - UILinkPoint uiLinkPoint6 = point6; - int num7 = num6 + 1; - UILinkPoint[] uiLinkPointArray1 = new UILinkPoint[snapGroup1.Count]; - for (int index = 0; index < snapGroup1.Count; ++index) - { - UILinkPointNavigator.SetPosition(num7, snapGroup1[index].Position); - UILinkPoint point7 = UILinkPointNavigator.Points[num7]; - point7.Unlink(); - uiLinkPointArray1[index] = point7; - ++num7; - } - UILinkPoint[] uiLinkPointArray2 = new UILinkPoint[snapGroup2.Count]; - for (int index = 0; index < snapGroup2.Count; ++index) - { - UILinkPointNavigator.SetPosition(num7, snapGroup2[index].Position); - UILinkPoint point8 = UILinkPointNavigator.Points[num7]; - point8.Unlink(); - uiLinkPointArray2[index] = point8; - ++num7; - } - UILinkPoint[] uiLinkPointArray3 = new UILinkPoint[snapGroup3.Count]; - for (int index = 0; index < snapGroup3.Count; ++index) - { - UILinkPointNavigator.SetPosition(num7, snapGroup3[index].Position); - UILinkPoint point9 = UILinkPointNavigator.Points[num7]; - point9.Unlink(); - uiLinkPointArray3[index] = point9; - ++num7; - } - this.LoopHorizontalLineLinks(uiLinkPointArray1); - this.LoopHorizontalLineLinks(uiLinkPointArray2); - this.EstablishUpDownRelationship(uiLinkPointArray1, uiLinkPointArray2); - for (int index = 0; index < uiLinkPointArray1.Length; ++index) - uiLinkPointArray1[index].Up = uiLinkPoint6.ID; - if (true) - { - this.LoopHorizontalLineLinks(uiLinkPointArray3); - this.EstablishUpDownRelationship(uiLinkPointArray2, uiLinkPointArray3); - for (int index = 0; index < uiLinkPointArray3.Length; ++index) - uiLinkPointArray3[index].Down = uiLinkPoint1.ID; - uiLinkPointArray3[uiLinkPointArray3.Length - 1].Down = uiLinkPoint2.ID; - uiLinkPoint2.Up = uiLinkPointArray3[uiLinkPointArray3.Length - 1].ID; - uiLinkPoint1.Up = uiLinkPointArray3[0].ID; - } - else - { - for (int index = 0; index < uiLinkPointArray2.Length; ++index) - uiLinkPointArray2[index].Down = uiLinkPoint1.ID; - uiLinkPointArray2[uiLinkPointArray2.Length - 1].Down = uiLinkPoint2.ID; - uiLinkPoint2.Up = uiLinkPointArray2[uiLinkPointArray2.Length - 1].ID; - uiLinkPoint1.Up = uiLinkPointArray2[0].ID; - } - uiLinkPoint2.Left = uiLinkPoint1.ID; - uiLinkPoint1.Right = uiLinkPoint2.ID; - uiLinkPoint4.Down = uiLinkPoint6.ID; - uiLinkPoint4.Left = uiLinkPoint3.ID; - uiLinkPoint3.Right = uiLinkPoint4.ID; - uiLinkPoint6.Up = uiLinkPoint4.ID; - uiLinkPoint6.Down = uiLinkPointArray1[0].ID; - uiLinkPoint6.Left = uiLinkPoint5.ID; - uiLinkPoint5.Right = uiLinkPoint6.ID; - uiLinkPoint5.Up = uiLinkPoint3.ID; - uiLinkPoint5.Down = uiLinkPointArray1[0].ID; - uiLinkPoint3.Down = uiLinkPoint5.ID; - } - - private void EstablishUpDownRelationship(UILinkPoint[] topSide, UILinkPoint[] bottomSide) - { - int num = Math.Max(topSide.Length, bottomSide.Length); - for (int val1 = 0; val1 < num; ++val1) - { - int index1 = Math.Min(val1, topSide.Length - 1); - int index2 = Math.Min(val1, bottomSide.Length - 1); - topSide[index1].Down = bottomSide[index2].ID; - bottomSide[index2].Up = topSide[index1].ID; - } - } - - private void LoopHorizontalLineLinks(UILinkPoint[] pointsLine) - { - for (int index = 1; index < pointsLine.Length - 1; ++index) - { - pointsLine[index - 1].Right = pointsLine[index].ID; - pointsLine[index].Left = pointsLine[index - 1].ID; - pointsLine[index].Right = pointsLine[index + 1].ID; - pointsLine[index + 1].Left = pointsLine[index].ID; - } - } - - private List GetSnapGroup(List ptsOnPage, string groupName) - { - List list = ptsOnPage.Where((Func) (a => a.Name == groupName)).ToList(); - list.Sort(new Comparison(this.SortPoints)); - return list; - } - - private int SortPoints(SnapPoint a, SnapPoint b) => a.Id.CompareTo(b.Id); - - private enum WorldSizeId - { - Small, - Medium, - Large, - } - - private enum WorldDifficultyId - { - Normal, - Expert, - Master, - Creative, - } - - private enum WorldEvilId - { - Random, - Corruption, - Crimson, - } - } -} diff --git a/GameContent/UI/States/UIWorldLoad.cs b/GameContent/UI/States/UIWorldLoad.cs index 9a01f44..6052acd 100644 --- a/GameContent/UI/States/UIWorldLoad.cs +++ b/GameContent/UI/States/UIWorldLoad.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.States.UIWorldLoad -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -9,10 +9,9 @@ using Microsoft.Xna.Framework.Graphics; using System; using Terraria.GameContent.UI.Elements; using Terraria.GameInput; -using Terraria.Localization; using Terraria.UI; using Terraria.UI.Gamepad; -using Terraria.WorldBuilding; +using Terraria.World.Generation; namespace Terraria.GameContent.UI.States { @@ -22,15 +21,16 @@ namespace Terraria.GameContent.UI.States private UIHeader _progressMessage = new UIHeader(); private GenerationProgress _progress; - public UIWorldLoad() + public UIWorldLoad(GenerationProgress progress) { - this._progressBar.Top.Pixels = 270f; + this._progressBar.Top.Pixels = 370f; this._progressBar.HAlign = 0.5f; this._progressBar.VAlign = 0.0f; this._progressBar.Recalculate(); this._progressMessage.CopyStyle((UIElement) this._progressBar); this._progressMessage.Top.Pixels -= 70f; this._progressMessage.Recalculate(); + this._progress = progress; this.Append((UIElement) this._progressBar); this.Append((UIElement) this._progressMessage); } @@ -43,66 +43,20 @@ namespace Terraria.GameContent.UI.States UILinkPointNavigator.ChangePoint(3000); } - public override void Update(GameTime gameTime) - { - this._progressBar.Top.Pixels = MathHelper.Lerp(270f, 370f, Utils.GetLerpValue(600f, 700f, (float) Main.screenHeight, true)); - this._progressMessage.Top.Pixels = this._progressBar.Top.Pixels - 70f; - this._progressBar.Recalculate(); - this._progressMessage.Recalculate(); - base.Update(gameTime); - } - - public override void Draw(SpriteBatch spriteBatch) - { - this._progress = WorldGenerator.CurrentGenerationProgress; - if (this._progress == null) - return; - base.Draw(spriteBatch); - } - protected override void DrawSelf(SpriteBatch spriteBatch) { - float overallProgress = 0.0f; - float currentProgress = 0.0f; - string str1 = string.Empty; - if (this._progress != null) - { - overallProgress = this._progress.TotalProgress; - currentProgress = this._progress.Value; - str1 = this._progress.Message; - } - this._progressBar.SetProgress(overallProgress, currentProgress); - this._progressMessage.Text = str1; - if (WorldGen.drunkWorldGenText && !WorldGen.placingTraps) - { - this._progressMessage.Text = string.Concat((object) Main.rand.Next(999999999)); - for (int index = 0; index < 3; ++index) - { - if (Main.rand.Next(2) == 0) - this._progressMessage.Text += (string) (object) Main.rand.Next(999999999); - } - } - if (WorldGen.notTheBees) - this._progressMessage.Text = Language.GetTextValue("UI.WorldGenEasterEgg_GeneratingBees"); - if (WorldGen.getGoodWorldGen) - { - string str2 = ""; - for (int startIndex = this._progressMessage.Text.Length - 1; startIndex >= 0; --startIndex) - str2 += this._progressMessage.Text.Substring(startIndex, 1); - this._progressMessage.Text = str2; - } - Main.gameTips.Update(); - Main.gameTips.Draw(); + this._progressBar.SetProgress(this._progress.TotalProgress, this._progress.Value); + this._progressMessage.Text = this._progress.Message; this.UpdateGamepadSquiggle(); } private void UpdateGamepadSquiggle() { - Vector2 vector2 = new Vector2((float) Math.Cos((double) Main.GlobalTimeWrappedHourly * 6.28318548202515), (float) Math.Sin((double) Main.GlobalTimeWrappedHourly * 6.28318548202515 * 2.0)) * new Vector2(30f, 15f) + Vector2.UnitY * 20f; + Vector2 vector2 = new Vector2((float) Math.Cos((double) Main.GlobalTime * 6.28318548202515), (float) Math.Sin((double) Main.GlobalTime * 6.28318548202515 * 2.0)) * new Vector2(30f, 15f) + Vector2.UnitY * 20f; UILinkPointNavigator.Points[3000].Unlink(); UILinkPointNavigator.SetPosition(3000, new Vector2((float) Main.screenWidth, (float) Main.screenHeight) / 2f + vector2); } - public string GetStatusText() => this._progress == null ? string.Format("{0:0.0%} - ... - {1:0.0%}", (object) 0, (object) 0) : string.Format("{0:0.0%} - " + this._progress.Message + " - {1:0.0%}", (object) this._progress.TotalProgress, (object) this._progress.Value); + public string GetStatusText() => string.Format("{0:0.0%} - " + this._progress.Message + " - {1:0.0%}", (object) this._progress.TotalProgress, (object) this._progress.Value); } } diff --git a/GameContent/UI/States/UIWorldSelect.cs b/GameContent/UI/States/UIWorldSelect.cs index ac2a2bb..ba8517c 100644 --- a/GameContent/UI/States/UIWorldSelect.cs +++ b/GameContent/UI/States/UIWorldSelect.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.States.UIWorldSelect -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -9,10 +9,8 @@ using Microsoft.Xna.Framework.Graphics; using System; using System.Collections.Generic; using System.Linq; -using Terraria.Audio; using Terraria.GameContent.UI.Elements; using Terraria.GameInput; -using Terraria.ID; using Terraria.IO; using Terraria.Localization; using Terraria.UI; @@ -26,8 +24,6 @@ namespace Terraria.GameContent.UI.States private UITextPanel _backPanel; private UITextPanel _newPanel; private UIPanel _containerPanel; - private UIScrollbar _scrollbar; - private bool _isScrollbarAttached; private List> favoritesCache = new List>(); private bool skipDraw; @@ -46,18 +42,19 @@ namespace Terraria.GameContent.UI.States element.Append((UIElement) uiPanel); this._containerPanel = uiPanel; this._worldList = new UIList(); - this._worldList.Width.Set(0.0f, 1f); + this._worldList.Width.Set(-25f, 1f); this._worldList.Height.Set(0.0f, 1f); this._worldList.ListPadding = 5f; uiPanel.Append((UIElement) this._worldList); - this._scrollbar = new UIScrollbar(); - this._scrollbar.SetView(100f, 1000f); - this._scrollbar.Height.Set(0.0f, 1f); - this._scrollbar.HAlign = 1f; - this._worldList.SetScrollbar(this._scrollbar); + UIScrollbar scrollbar = new UIScrollbar(); + scrollbar.SetView(100f, 1000f); + scrollbar.Height.Set(0.0f, 1f); + scrollbar.HAlign = 1f; + uiPanel.Append((UIElement) scrollbar); + this._worldList.SetScrollbar(scrollbar); UITextPanel uiTextPanel1 = new UITextPanel(Language.GetText("UI.SelectWorld"), 0.8f, true); uiTextPanel1.HAlign = 0.5f; - uiTextPanel1.Top.Set(-40f, 0.0f); + uiTextPanel1.Top.Set(-35f, 0.0f); uiTextPanel1.SetPadding(15f); uiTextPanel1.BackgroundColor = new Color(73, 94, 171); element.Append((UIElement) uiTextPanel1); @@ -82,52 +79,26 @@ namespace Terraria.GameContent.UI.States this.Append(element); } - public override void Recalculate() - { - if (this._scrollbar != null) - { - if (this._isScrollbarAttached && !this._scrollbar.CanScroll) - { - this._containerPanel.RemoveChild((UIElement) this._scrollbar); - this._isScrollbarAttached = false; - this._worldList.Width.Set(0.0f, 1f); - } - else if (!this._isScrollbarAttached && this._scrollbar.CanScroll) - { - this._containerPanel.Append((UIElement) this._scrollbar); - this._isScrollbarAttached = true; - this._worldList.Width.Set(-25f, 1f); - } - } - base.Recalculate(); - } - private void NewWorldClick(UIMouseEvent evt, UIElement listeningElement) { - SoundEngine.PlaySound(10); + Main.PlaySound(10); + Main.menuMode = 16; Main.newWorldName = Lang.gen[57].Value + " " + (object) (Main.WorldList.Count + 1); - Main.MenuUI.SetState((UIState) new UIWorldCreation()); - Main.menuMode = 888; } private void GoBackClick(UIMouseEvent evt, UIElement listeningElement) { - SoundEngine.PlaySound(11); + Main.PlaySound(11); Main.menuMode = Main.menuMultiplayer ? 12 : 1; } private void FadedMouseOver(UIMouseEvent evt, UIElement listeningElement) { - SoundEngine.PlaySound(12); + Main.PlaySound(12); ((UIPanel) evt.Target).BackgroundColor = new Color(73, 94, 171); - ((UIPanel) evt.Target).BorderColor = Colors.FancyUIFatButtonMouseOver; } - private void FadedMouseOut(UIMouseEvent evt, UIElement listeningElement) - { - ((UIPanel) evt.Target).BackgroundColor = new Color(63, 82, 151) * 0.7f; - ((UIPanel) evt.Target).BorderColor = Color.Black; - } + private void FadedMouseOut(UIMouseEvent evt, UIElement listeningElement) => ((UIPanel) evt.Target).BackgroundColor = new Color(63, 82, 151) * 0.7f; public override void OnActivate() { @@ -141,14 +112,20 @@ namespace Terraria.GameContent.UI.States private void UpdateWorldsList() { this._worldList.Clear(); - IOrderedEnumerable orderedEnumerable = new List((IEnumerable) Main.WorldList).OrderByDescending(new Func(this.CanWorldBePlayed)).ThenByDescending((Func) (x => x.IsFavorite)).ThenBy((Func) (x => x.Name)).ThenBy((Func) (x => x.GetFileName())); + List worldFileDataList = new List((IEnumerable) Main.WorldList); + worldFileDataList.Sort((Comparison) ((x, y) => + { + if (x.IsFavorite && !y.IsFavorite) + return -1; + if (!x.IsFavorite && y.IsFavorite) + return 1; + return x.Name.CompareTo(y.Name) != 0 ? x.Name.CompareTo(y.Name) : x.GetFileName().CompareTo(y.GetFileName()); + })); int num = 0; - foreach (WorldFileData worldFileData in (IEnumerable) orderedEnumerable) - this._worldList.Add((UIElement) new UIWorldListItem(worldFileData, num++, this.CanWorldBePlayed(worldFileData))); + foreach (WorldFileData data in worldFileDataList) + this._worldList.Add((UIElement) new UIWorldListItem(data, num++)); } - private bool CanWorldBePlayed(WorldFileData file) => Main.ActivePlayerFileData.Player.difficulty == (byte) 3 == (file.GameMode == 3); - public override void Draw(SpriteBatch spriteBatch) { if (this.skipDraw) @@ -217,10 +194,9 @@ namespace Terraria.GameContent.UI.States UILinkPoint point2 = UILinkPointNavigator.Points[key2]; point2.Unlink(); point2.Left = key2 - 1; - float num2 = 1f / Main.UIScale; Rectangle clippingRectangle = this._containerPanel.GetClippingRectangle(spriteBatch); - Vector2 minimum = clippingRectangle.TopLeft() * num2; - Vector2 maximum = clippingRectangle.BottomRight() * num2; + Vector2 minimum = clippingRectangle.TopLeft(); + Vector2 maximum = clippingRectangle.BottomRight(); List snapPoints = this.GetSnapPoints(); for (int index = 0; index < snapPoints.Count; ++index) { @@ -232,16 +208,16 @@ namespace Terraria.GameContent.UI.States } SnapPoint[,] snapPointArray = new SnapPoint[this._worldList.Count, 5]; foreach (SnapPoint snapPoint in snapPoints.Where((Func) (a => a.Name == "Play"))) - snapPointArray[snapPoint.Id, 0] = snapPoint; + snapPointArray[snapPoint.ID, 0] = snapPoint; foreach (SnapPoint snapPoint in snapPoints.Where((Func) (a => a.Name == "Favorite"))) - snapPointArray[snapPoint.Id, 1] = snapPoint; + snapPointArray[snapPoint.ID, 1] = snapPoint; foreach (SnapPoint snapPoint in snapPoints.Where((Func) (a => a.Name == "Cloud"))) - snapPointArray[snapPoint.Id, 2] = snapPoint; + snapPointArray[snapPoint.ID, 2] = snapPoint; foreach (SnapPoint snapPoint in snapPoints.Where((Func) (a => a.Name == "Seed"))) - snapPointArray[snapPoint.Id, 3] = snapPoint; + snapPointArray[snapPoint.ID, 3] = snapPoint; foreach (SnapPoint snapPoint in snapPoints.Where((Func) (a => a.Name == "Delete"))) - snapPointArray[snapPoint.Id, 4] = snapPoint; - int num3 = num1 + 2; + snapPointArray[snapPoint.ID, 4] = snapPoint; + int num2 = num1 + 2; int[] numArray = new int[this._worldList.Count]; for (int index = 0; index < numArray.Length; ++index) numArray[index] = -1; @@ -252,26 +228,26 @@ namespace Terraria.GameContent.UI.States { if (snapPointArray[index2, index1] != null) { - UILinkPoint point3 = UILinkPointNavigator.Points[num3]; + UILinkPoint point3 = UILinkPointNavigator.Points[num2]; point3.Unlink(); - UILinkPointNavigator.SetPosition(num3, snapPointArray[index2, index1].Position); + UILinkPointNavigator.SetPosition(num2, snapPointArray[index2, index1].Position); if (key3 != -1) { point3.Up = key3; - UILinkPointNavigator.Points[key3].Down = num3; + UILinkPointNavigator.Points[key3].Down = num2; } if (numArray[index2] != -1) { point3.Left = numArray[index2]; - UILinkPointNavigator.Points[numArray[index2]].Right = num3; + UILinkPointNavigator.Points[numArray[index2]].Right = num2; } point3.Down = num1; if (index1 == 0) - UILinkPointNavigator.Points[num1].Up = UILinkPointNavigator.Points[num1 + 1].Up = num3; - key3 = num3; - numArray[index2] = num3; - UILinkPointNavigator.Shortcuts.FANCYUI_HIGHEST_INDEX = num3; - ++num3; + UILinkPointNavigator.Points[num1].Up = UILinkPointNavigator.Points[num1 + 1].Up = num2; + key3 = num2; + numArray[index2] = num2; + UILinkPointNavigator.Shortcuts.FANCYUI_HIGHEST_INDEX = num2; + ++num2; } } } diff --git a/GameContent/UI/WiresUI.cs b/GameContent/UI/WiresUI.cs index ecf3c5f..3fee3cb 100644 --- a/GameContent/UI/WiresUI.cs +++ b/GameContent/UI/WiresUI.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.WiresUI -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -26,7 +26,7 @@ namespace Terraria.GameContent.UI public static class Settings { public static WiresUI.Settings.MultiToolMode ToolMode = WiresUI.Settings.MultiToolMode.Red; - private static int _lastActuatorEnabled; + private static int _lastActuatorEnabled = 0; public static bool DrawWires { @@ -103,12 +103,12 @@ namespace Terraria.GameContent.UI flag2 = false; this._lineOpacity = 0.0f; } - else if (player.cursorItemIconEnabled && player.cursorItemIconID != 0 && player.cursorItemIconID != 3625) + else if (player.showItemIcon && player.showItemIcon2 != 0 && player.showItemIcon2 != 3625) { flag2 = false; this._lineOpacity = 0.0f; } - else if (!player.cursorItemIconEnabled && (!PlayerInput.UsingGamepad && !WiresUI.Settings.DrawToolAllowActuators || player.mouseInterface || player.lastMouseInterface) || Main.ingameOptionsWindow || Main.InGameUI.IsVisible) + else if (!player.showItemIcon && (!PlayerInput.UsingGamepad && !WiresUI.Settings.DrawToolAllowActuators || player.mouseInterface || player.lastMouseInterface) || Main.ingameOptionsWindow || Main.InGameUI.IsVisible) { flag2 = false; this._lineOpacity = 0.0f; @@ -138,7 +138,7 @@ namespace Terraria.GameContent.UI else { this.OnWiresMenu = false; - if (!Main.mouseRight || !Main.mouseRightRelease || PlayerInput.LockGamepadTileUseButton || player.noThrow != 0 || Main.HoveringOverAnNPC || player.talkNPC != -1) + if (!Main.mouseRight || !Main.mouseRightRelease || PlayerInput.LockTileUseButton || player.noThrow != 0 || Main.HoveringOverAnNPC || player.talkNPC != -1) return; if (this.active) { @@ -216,7 +216,7 @@ namespace Terraria.GameContent.UI flag3 = false; if (flag3) flag1 = true; - Texture2D texture2D1 = TextureAssets.WireUi[(WiresUI.Settings.ToolMode.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Cutter) ? 8 : 0) + (flag3 ? 1 : 0)].Value; + Texture2D texture2D1 = Main.wireUITexture[(WiresUI.Settings.ToolMode.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Cutter) ? 8 : 0) + (flag3 ? 1 : 0)]; Texture2D texture2D2 = (Texture2D) null; switch (index) { @@ -224,13 +224,13 @@ namespace Terraria.GameContent.UI case 1: case 2: case 3: - texture2D2 = TextureAssets.WireUi[2 + index].Value; + texture2D2 = Main.wireUITexture[2 + index]; break; case 4: - texture2D2 = TextureAssets.WireUi[WiresUI.Settings.ToolMode.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Cutter) ? 7 : 6].Value; + texture2D2 = Main.wireUITexture[WiresUI.Settings.ToolMode.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Cutter) ? 7 : 6]; break; case 5: - texture2D2 = TextureAssets.WireUi[10].Value; + texture2D2 = Main.wireUITexture[10]; break; } Color color1 = Color.White; @@ -364,7 +364,7 @@ namespace Terraria.GameContent.UI flag3 = false; if (flag3) flag1 = true; - Texture2D texture2D1 = TextureAssets.WireUi[(WiresUI.Settings.ToolMode.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Cutter) ? 8 : 0) + (flag3 ? 1 : 0)].Value; + Texture2D texture2D1 = Main.wireUITexture[(WiresUI.Settings.ToolMode.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Cutter) ? 8 : 0) + (flag3 ? 1 : 0)]; Texture2D texture2D2 = (Texture2D) null; switch (index) { @@ -372,13 +372,13 @@ namespace Terraria.GameContent.UI case 1: case 2: case 3: - texture2D2 = TextureAssets.WireUi[2 + index].Value; + texture2D2 = Main.wireUITexture[2 + index]; break; case 4: - texture2D2 = TextureAssets.WireUi[WiresUI.Settings.ToolMode.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Cutter) ? 7 : 6].Value; + texture2D2 = Main.wireUITexture[WiresUI.Settings.ToolMode.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Cutter) ? 7 : 6]; break; case 5: - texture2D2 = TextureAssets.WireUi[10].Value; + texture2D2 = Main.wireUITexture[10]; break; } Color color1 = Color.White; @@ -452,8 +452,8 @@ namespace Terraria.GameContent.UI else vector2 += new Vector2(0.0f, 10f); } - Texture2D texture1 = TextureAssets.BuilderAcc.Value; - Texture2D texture2 = texture1; + Texture2D builderAccTexture = Main.builderAccTexture; + Texture2D texture = builderAccTexture; Rectangle r1 = new Rectangle(140, 2, 6, 6); Rectangle r2 = new Rectangle(148, 2, 6, 6); Rectangle r3 = new Rectangle(128, 0, 10, 10); @@ -583,10 +583,10 @@ namespace Terraria.GameContent.UI } } Vector2 position = vec.Floor(); - spriteBatch.Draw(texture2, position, new Rectangle?(r3), color1 * num2, 0.0f, r3.Size() / 2f, scale, SpriteEffects.None, 0.0f); - spriteBatch.Draw(texture1, position, new Rectangle?(r1), color2 * num2, 0.0f, r1.Size() / 2f, scale, SpriteEffects.None, 0.0f); + spriteBatch.Draw(texture, position, new Rectangle?(r3), color1 * num2, 0.0f, r3.Size() / 2f, scale, SpriteEffects.None, 0.0f); + spriteBatch.Draw(builderAccTexture, position, new Rectangle?(r1), color2 * num2, 0.0f, r1.Size() / 2f, scale, SpriteEffects.None, 0.0f); if (WiresUI.Settings.ToolMode.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Cutter)) - spriteBatch.Draw(texture1, position, new Rectangle?(r2), color1 * num2, 0.0f, r2.Size() / 2f, scale, SpriteEffects.None, 0.0f); + spriteBatch.Draw(builderAccTexture, position, new Rectangle?(r2), color1 * num2, 0.0f, r2.Size() / 2f, scale, SpriteEffects.None, 0.0f); } } } diff --git a/GameContent/UI/WorldUIAnchor.cs b/GameContent/UI/WorldUIAnchor.cs index 25a03ea..2dac9b7 100644 --- a/GameContent/UI/WorldUIAnchor.cs +++ b/GameContent/UI/WorldUIAnchor.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameContent.UI.WorldUIAnchor -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/GameContent/VanillaContentValidator.cs b/GameContent/VanillaContentValidator.cs deleted file mode 100644 index 818040e..0000000 --- a/GameContent/VanillaContentValidator.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.VanillaContentValidator -// 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.Graphics; -using ReLogic.Content; -using System.Collections.Generic; -using System.Text.RegularExpressions; - -namespace Terraria.GameContent -{ - public class VanillaContentValidator : IContentValidator - { - public static VanillaContentValidator Instance; - private Dictionary _info = new Dictionary(); - - public VanillaContentValidator(string infoFilePath) - { - foreach (string str in Regex.Split(Utils.ReadEmbeddedResource(infoFilePath), "\r\n|\r|\n")) - { - if (!str.StartsWith("//")) - { - string[] strArray = str.Split('\t'); - int result1; - int result2; - if (strArray.Length >= 3 && int.TryParse(strArray[1], out result1) && int.TryParse(strArray[2], out result2)) - this._info[strArray[0].Replace('/', '\\')] = new VanillaContentValidator.TextureMetaData() - { - Width = result1, - Height = result2 - }; - } - } - } - - public bool AssetIsValid(T content, string contentPath, out IRejectionReason rejectReason) where T : class - { - Texture2D texture = (object) content as Texture2D; - rejectReason = (IRejectionReason) null; - VanillaContentValidator.TextureMetaData textureMetaData; - return texture == null || !this._info.TryGetValue(contentPath, out textureMetaData) || textureMetaData.Matches(texture, out rejectReason); - } - - private struct TextureMetaData - { - public int Width; - public int Height; - - public bool Matches(Texture2D texture, out IRejectionReason rejectReason) - { - if (texture.Width != this.Width || texture.Height != this.Height) - { - rejectReason = (IRejectionReason) new ContentRejectionFromSize(this.Width, this.Height, texture.Width, texture.Height); - return false; - } - rejectReason = (IRejectionReason) null; - return true; - } - } - } -} diff --git a/GameContent/VoidLensHelper.cs b/GameContent/VoidLensHelper.cs deleted file mode 100644 index 7025137..0000000 --- a/GameContent/VoidLensHelper.cs +++ /dev/null @@ -1,105 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.VoidLensHelper -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using System.Collections.Generic; -using Terraria.DataStructures; -using Terraria.ID; - -namespace Terraria.GameContent -{ - public struct VoidLensHelper - { - private readonly Vector2 _position; - private readonly float _opacity; - private readonly int _frameNumber; - - public VoidLensHelper(Projectile proj) - { - this._position = proj.Center; - this._opacity = proj.Opacity; - this._frameNumber = proj.frame; - } - - public VoidLensHelper(Vector2 worldPosition, float opacity) - { - worldPosition.Y -= 2f; - this._position = worldPosition; - this._opacity = opacity; - this._frameNumber = (int) (((double) Main.tileFrameCounter[491] + (double) this._position.X + (double) this._position.Y) % 40.0) / 5; - } - - public void Update() - { - Lighting.AddLight(this._position, 0.4f, 0.2f, 0.9f); - this.SpawnVoidLensDust(); - } - - public void SpawnVoidLensDust() - { - if (Main.rand.Next(3) != 0) - return; - if (Main.rand.Next(2) == 0) - { - Vector2 vector2 = Vector2.UnitY.RotatedByRandom(6.28318548202515) * new Vector2(0.5f, 1f); - Dust dust = Dust.NewDustDirect(this._position - vector2 * 30f, 0, 0, Utils.SelectRandom(Main.rand, 86, 88)); - dust.noGravity = true; - dust.noLightEmittence = true; - dust.position = this._position - vector2.SafeNormalize(Vector2.Zero) * (float) Main.rand.Next(10, 21); - dust.velocity = vector2.RotatedBy(1.57079637050629) * 2f; - dust.scale = 0.5f + Main.rand.NextFloat(); - dust.fadeIn = 0.5f; - dust.customData = (object) this; - dust.position += dust.velocity * 10f; - dust.velocity *= -1f; - } - else - { - Vector2 vector2 = Vector2.UnitY.RotatedByRandom(6.28318548202515) * new Vector2(0.5f, 1f); - Dust dust = Dust.NewDustDirect(this._position - vector2 * 30f, 0, 0, Utils.SelectRandom(Main.rand, 86, 88)); - dust.noGravity = true; - dust.noLightEmittence = true; - dust.position = this._position - vector2.SafeNormalize(Vector2.Zero) * (float) Main.rand.Next(5, 10); - dust.velocity = vector2.RotatedBy(-1.57079637050629) * 3f; - dust.scale = 0.5f + Main.rand.NextFloat(); - dust.fadeIn = 0.5f; - dust.customData = (object) this; - dust.position += dust.velocity * 10f; - dust.velocity *= -1f; - } - } - - public void DrawToDrawData(List drawDataList, int selectionMode) - { - Main.instance.LoadProjectile(734); - Asset tex = TextureAssets.Projectile[734]; - Rectangle r = tex.Frame(verticalFrames: 8, frameY: this._frameNumber); - Color color = Color.Lerp(Lighting.GetColor(this._position.ToTileCoordinates()), Color.White, 0.5f) * this._opacity; - DrawData drawData1 = new DrawData(tex.Value, this._position - Main.screenPosition, new Rectangle?(r), color, 0.0f, r.Size() / 2f, 1f, SpriteEffects.None, 0); - drawDataList.Add(drawData1); - for (float num = 0.0f; (double) num < 1.0; num += 0.34f) - { - DrawData drawData2 = drawData1; - drawData2.color = new Color((int) sbyte.MaxValue, 50, (int) sbyte.MaxValue, 0) * this._opacity; - drawData2.scale *= 1.1f; - float x = ((float) ((double) Main.GlobalTimeWrappedHourly / 5.0 * 6.28318548202515)).ToRotationVector2().X; - drawData2.color *= (float) ((double) x * 0.100000001490116 + 0.300000011920929); - drawData2.position += ((float) (((double) Main.GlobalTimeWrappedHourly / 5.0 + (double) num) * 6.28318548202515)).ToRotationVector2() * (float) ((double) x * 1.0 + 2.0); - drawDataList.Add(drawData2); - } - if (selectionMode == 0) - return; - int averageTileLighting = ((int) color.R + (int) color.G + (int) color.B) / 3; - if (averageTileLighting <= 10) - return; - Color selectionGlowColor = Colors.GetSelectionGlowColor(selectionMode == 2, averageTileLighting); - drawData1 = new DrawData(TextureAssets.Extra[93].Value, this._position - Main.screenPosition, new Rectangle?(r), selectionGlowColor, 0.0f, r.Size() / 2f, 1f, SpriteEffects.None, 0); - drawDataList.Add(drawData1); - } - } -} diff --git a/GameContent/WellFedHelper.cs b/GameContent/WellFedHelper.cs deleted file mode 100644 index 3b6d2cb..0000000 --- a/GameContent/WellFedHelper.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameContent.WellFedHelper -// 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 -{ - public struct WellFedHelper - { - private const int MAXIMUM_TIME_LEFT_PER_COUNTER = 72000; - private int _timeLeftRank1; - private int _timeLeftRank2; - private int _timeLeftRank3; - - public int TimeLeft => this._timeLeftRank1 + this._timeLeftRank2 + this._timeLeftRank3; - - public int Rank - { - get - { - if (this._timeLeftRank3 > 0) - return 3; - if (this._timeLeftRank2 > 0) - return 2; - return this._timeLeftRank1 > 0 ? 1 : 0; - } - } - - public void Eat(int foodRank, int foodBuffTime) - { - int timeLeftToAdd = foodBuffTime; - if (foodRank >= 3) - this.AddTimeTo(ref this._timeLeftRank3, ref timeLeftToAdd, 72000); - if (foodRank >= 2) - this.AddTimeTo(ref this._timeLeftRank2, ref timeLeftToAdd, 72000); - if (foodRank < 1) - return; - this.AddTimeTo(ref this._timeLeftRank1, ref timeLeftToAdd, 72000); - } - - public void Update() => this.ReduceTimeLeft(); - - public void Clear() - { - this._timeLeftRank1 = 0; - this._timeLeftRank2 = 0; - this._timeLeftRank3 = 0; - } - - private void AddTimeTo(ref int foodTimeCounter, ref int timeLeftToAdd, int counterMaximumTime) - { - if (timeLeftToAdd == 0) - return; - int num = timeLeftToAdd; - if (foodTimeCounter + num > counterMaximumTime) - num = counterMaximumTime - foodTimeCounter; - foodTimeCounter += num; - timeLeftToAdd -= num; - } - - private void ReduceTimeLeft() - { - if (this._timeLeftRank3 > 0) - --this._timeLeftRank3; - else if (this._timeLeftRank2 > 0) - { - --this._timeLeftRank2; - } - else - { - if (this._timeLeftRank1 <= 0) - return; - --this._timeLeftRank1; - } - } - } -} diff --git a/GameContent/WorldBuilding/Configuration.json b/GameContent/WorldBuilding/Configuration.json deleted file mode 100644 index 4875dba..0000000 --- a/GameContent/WorldBuilding/Configuration.json +++ /dev/null @@ -1,261 +0,0 @@ -{ - "Biomes": { - "CaveHouseBiome": { - // Min: 0.0, Max: 1.0 - "IceChestChance": 1.0, - // Min: 0.0, Max: 1.0 - "JungleChestChance": 1.0, - // Min: 0.0, Max: 1.0 - "GoldChestChance": 1.0, - // Min: 0.0, Max: 1.0 - "GraniteChestChance": 1.0, - // Min: 0.0, Max: 1.0 - "MarbleChestChance": 1.0, - // Min: 0.0, Max: 1.0 - "MushroomChestChance": 1.0, - // Min: 0.0, Max: 1.0 - "DesertChestChance": 1.0 - }, - "DesertBiome": { - // Min: 0.0, Max: 1.0 - "ChanceOfEntrance": .5 - }, - "DunesBiome": { - // Min: 0.1, Max: 3.0 - "HeightScale": 1.0, - // Min: 10 - "SingleDunesWidth": { - "Min": 150, - "Max": 250, - "ScaleWith": "None" - } - }, - "EnchantedSwordBiome": { - // Min: 0.0, Max: 1.0 - "ChanceOfEntrance": 0.3333333, - // Min: 0.0, Max: 1.0 - "ChanceOfRealSword": 1.0 - } - }, - "Passes": { - "Reset": {}, - "Terrain": { - // Min: 0 - "FlatBeachPadding": 5 - }, - "Dunes": { - // Min: 0 - "Count": { - "Min": 1, - "Max": 2, - "ScaleWith": "WorldWidth" - }, - // Min: 0.0, Max: 1.0 - "ChanceOfPyramid": 0.4 - }, - "Tunnels": {}, - "Ocean Sand": {}, - "Mount Caves": {}, - "Dirt Wall Backgrounds": {}, - "Rocks In Dirt": {}, - "Dirt In Rocks": {}, - "Clay": {}, - "Small Holes": {}, - "Dirt Layer Caves": {}, - "Rock Layer Caves": {}, - "Surface Caves": {}, - "Slush Check": {}, - "Grass": {}, - "Jungle": {}, - "Marble": { - // Min: 0 - "Count": { - "Min": 4, - "Max": 8, - "ScaleWith": "WorldArea" - } - }, - "Granite": { - // Min: 0 - "Count": { - "Min": 4, - "Max": 8, - "ScaleWith": "WorldWidth" - } - }, - "Mud Caves To Grass": {}, - "Full Desert": {}, - "Floating Islands": {}, - "Mushroom Patches": {}, - "Mud To Dirt": {}, - "Silt": {}, - "Shinies": {}, - "Webs": {}, - "Underworld": {}, - "Lakes": {}, - "Corruption": {}, - "Dungeon": { - "MinimumDistanceToBeach": 50 - }, - "Slush": {}, - "Mountain Caves": {}, - "Beaches": {}, - "Gems": {}, - "Gravitating Sand": {}, - "Clean Up Dirt": {}, - "Pyramids": {}, - "Dirt Rock Wall Runner": {}, - "Living Trees": {}, - "Wood Tree Walls": {}, - "Altars": {}, - "Wet Jungle": {}, - "Remove Water From Sand": {}, - "Jungle Temple": {}, - "Hives": {}, - "Jungle Chests": {}, - "Smooth World": {}, - "Settle Liquids": {}, - "Waterfalls": {}, - "Ice": {}, - "Wall Variety": {}, - "Traps": {}, - "Life Crystals": {}, - "Statues": {}, - "Buried Chests": { - // Min: 0 - "CaveHouseCount": { - "Min": 35, - "Max": 40, - "ScaleWith": "WorldArea" - }, - // Min: 0 - "CaveChestCount": { - "Min": 35, - "Max": 40, - "ScaleWith": "WorldArea" - }, - // Min: 0 - "UnderworldChestCount": { - "Min": 7, - "Max": 10, - "ScaleWith": "WorldWidth" - }, - // Min: 0 - "AdditionalDesertHouseCount": { - "Min": 2, - "Max": 2, - "ScaleWith": "WorldArea" - } - }, - "Surface Chests": {}, - "Jungle Chests Placement": {}, - "Water Chests": {}, - "Spider Caves": {}, - "Gem Caves": {}, - "Moss": {}, - "Temple": {}, - "Ice Walls": {}, - "Jungle Trees": {}, - "Floating Island Houses": {}, - "Quick Cleanup": {}, - "Pots": {}, - "Hellforge": {}, - "Spreading Grass": {}, - "Piles": {}, - "Cactus": {}, - "Spawn Point": {}, - "Grass Wall": {}, - "Guide": {}, - "Sunflowers": {}, - "Planting Trees": {}, - "Herbs": {}, - "Dye Plants": {}, - "Webs And Honey": {}, - "Weeds": {}, - "Mud Caves To Grass 2": {}, - "Jungle Plants": {}, - "Vines": {}, - "Flowers": {}, - "Mushrooms": {}, - "Stalac": {}, - "Gems In Ice Biome": {}, - "Random Gems": {}, - "Moss Grass": {}, - "Muds Walls In Jungle": {}, - "Larva": {}, - "Temple Cleanup": {}, - "Settle Liquids Again": {}, - "Tile Cleanup": {}, - "Lihzahrd Altars": {}, - "Micro Biomes": { - "DeadManChests": { - "Min": 10, - "Max": 20, - "ScaleWith": "WorldWidth" - }, - // Min: 0 - "SwordShrineAttempts": { - "Min": 1, - "Max": 2, - "ScaleWith": "WorldWidth" - }, - // Min: 0, Max: 1 - "SwordShrinePlacementChance": 0.25, - // Min: 0 - "ThinIcePatchCount": { - "Min": 3, - "Max": 5, - "ScaleWith": "WorldWidth" - }, - // Min: 0 - "CampsiteCount": { - "Min": 6, - "Max": 11, - "ScaleWith": "WorldArea" - }, - // Min: 0 - "ExplosiveTrapCount": { - "Min": 14, - "Max": 29, - "ScaleWith": "WorldArea" - }, - // Min: 0 - "LivingTreeCount": { - "Min": 6, - "Max": 11, - "ScaleWith": "WorldWidth" - }, - // Min: 0 - "CorruptionPitCount": { - "Min": 1, - "Max": 2, - "ScaleWith": "WorldArea" - }, - // Min: 0 - "StandardTrackCount": { - "Min": 4, - "Max": 7, - "ScaleWith": "WorldArea" - }, - // Min: 1 - "StandardTrackLength": { - "Min": 150, - "Max": 300, - "ScaleWith": "WorldWidth" - }, - // Min: 0 - "LongTrackCount": { - "Min": 1, - "Max": 2, - "ScaleWith": "WorldWidth" - }, - // Min: 1 - "LongTrackLength": { - "Min": 400, - "Max": 1000, - "ScaleWith": "WorldWidth" - } - }, - "Final Cleanup": {} - } -} \ No newline at end of file diff --git a/GameInput/InputMode.cs b/GameInput/InputMode.cs index d6294fb..3cbcef6 100644 --- a/GameInput/InputMode.cs +++ b/GameInput/InputMode.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameInput.InputMode -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.GameInput diff --git a/GameInput/KeyConfiguration.cs b/GameInput/KeyConfiguration.cs index 9a97f83..70bf00e 100644 --- a/GameInput/KeyConfiguration.cs +++ b/GameInput/KeyConfiguration.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameInput.KeyConfiguration -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System.Collections.Generic; @@ -65,15 +65,15 @@ namespace Terraria.GameInput dictionary.Add(keyStatu.Key, keyStatu.Value.ToList()); } if (!dictionary.ContainsKey("MouseLeft") || dictionary["MouseLeft"].Count == 0) - dictionary["MouseLeft"] = new List() + dictionary.Add("MouseLeft", new List() { "Mouse1" - }; + }); if (!dictionary.ContainsKey("Inventory") || dictionary["Inventory"].Count == 0) - dictionary["Inventory"] = new List() + dictionary.Add("Inventory", new List() { "Escape" - }; + }); return dictionary; } } diff --git a/GameInput/LockOnHelper.cs b/GameInput/LockOnHelper.cs index e679dea..fd2b378 100644 --- a/GameInput/LockOnHelper.cs +++ b/GameInput/LockOnHelper.cs @@ -1,14 +1,13 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameInput.LockOnHelper -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.Collections.Generic; -using Terraria.GameContent; using Terraria.ID; namespace Terraria.GameInput @@ -19,14 +18,12 @@ namespace Terraria.GameInput private const int LOCKON_HOLD_LIFETIME = 40; public static LockOnHelper.LockOnMode UseMode = LockOnHelper.LockOnMode.ThreeDS; private static bool _enabled; - private static bool _canLockOn; + private static bool _canLockOn = false; private static List _targets = new List(); private static int _pickedTarget; private static int _lifeTimeCounter; private static int _lifeTimeArrowDisplay; private static int _threeDSTarget = -1; - private static int _targetClosestTarget = -1; - public static bool ForceUsability = false; private static float[,] _drawProgress = new float[200, 2]; public static void CycleUseModes() @@ -87,7 +84,7 @@ namespace Terraria.GameInput public static void Update() { LockOnHelper._canLockOn = false; - if (!LockOnHelper.CanUseLockonSystem()) + if (!PlayerInput.UsingGamepad) { LockOnHelper.SetActive(false); } @@ -95,8 +92,7 @@ namespace Terraria.GameInput { if (--LockOnHelper._lifeTimeArrowDisplay < 0) LockOnHelper._lifeTimeArrowDisplay = 0; - LockOnHelper.FindMostViableTarget(LockOnHelper.LockOnMode.ThreeDS, ref LockOnHelper._threeDSTarget); - LockOnHelper.FindMostViableTarget(LockOnHelper.LockOnMode.TargetClosest, ref LockOnHelper._targetClosestTarget); + LockOnHelper.Handle3DSTarget(); if (PlayerInput.Triggers.JustPressed.LockOn && !PlayerInput.WritingText) { LockOnHelper._lifeTimeCounter = 40; @@ -135,8 +131,6 @@ namespace Terraria.GameInput } } - public static bool CanUseLockonSystem() => LockOnHelper.ForceUsability || PlayerInput.UsingGamepad; - public static void SetUP() { if (!LockOnHelper._canLockOn) @@ -166,10 +160,10 @@ namespace Terraria.GameInput public static bool Enabled => LockOnHelper._enabled; - private static void FindMostViableTarget(LockOnHelper.LockOnMode context, ref int targetVar) + private static void Handle3DSTarget() { - targetVar = -1; - if (LockOnHelper.UseMode != context || !LockOnHelper.CanUseLockonSystem()) + LockOnHelper._threeDSTarget = -1; + if (LockOnHelper.UseMode != LockOnHelper.LockOnMode.ThreeDS || !PlayerInput.UsingGamepad) return; List t1_1 = new List(); int t1_2 = -1; @@ -180,7 +174,7 @@ namespace Terraria.GameInput Utils.Swap>(ref t1_1, ref LockOnHelper._targets); Utils.Swap(ref t1_2, ref LockOnHelper._pickedTarget); if (t1_2 >= 0) - targetVar = t1_1[t1_2]; + LockOnHelper._threeDSTarget = t1_1[t1_2]; t1_1.Clear(); } @@ -261,8 +255,6 @@ namespace Terraria.GameInput LockOnHelper._enabled = false; LockOnHelper._targets.Clear(); LockOnHelper._lifeTimeCounter = 0; - LockOnHelper._threeDSTarget = -1; - LockOnHelper._targetClosestTarget = -1; } } @@ -271,11 +263,11 @@ namespace Terraria.GameInput LockOnHelper._targets.Clear(); Rectangle rectangle = Utils.CenteredRectangle(Main.player[Main.myPlayer].Center, new Vector2(1920f, 1200f)); Vector2 center = Main.player[Main.myPlayer].Center; - Main.player[Main.myPlayer].DirectionTo(Main.MouseWorld); + Vector2 vector2 = Main.player[Main.myPlayer].DirectionTo(Main.MouseWorld); for (int index = 0; index < Main.npc.Length; ++index) { NPC n = Main.npc[index]; - if (LockOnHelper.ValidTarget(n) && (double) n.Distance(position) <= (double) radius && rectangle.Intersects(n.Hitbox) && (double) Lighting.GetSubLight(n.Center).Length() / 3.0 >= 0.0299999993294477) + if (LockOnHelper.ValidTarget(n) && (double) n.Distance(position) <= (double) radius && rectangle.Intersects(n.Hitbox) && (double) Lighting.GetSubLight(n.Center).Length() / 3.0 >= 0.00999999977648258 && (LockOnHelper.UseMode != LockOnHelper.LockOnMode.ThreeDS || (double) Vector2.Dot(n.DirectionFrom(center), vector2) >= 0.649999976158142)) LockOnHelper._targets.Add(index); } } @@ -315,7 +307,7 @@ namespace Terraria.GameInput } } - private static bool ValidTarget(NPC n) => n != null && n.active && !n.dontTakeDamage && !n.friendly && !n.isLikeATownNPC && n.life >= 1 && !n.immortal && (n.aiStyle != 25 || (double) n.ai[0] != 0.0); + private static bool ValidTarget(NPC n) => n != null && n.active && !n.dontTakeDamage && !n.friendly && !n.townNPC && n.life >= 1 && !n.immortal && (n.aiStyle != 25 || (double) n.ai[0] != 0.0); private static void SetLockPosition(Vector2 position) { @@ -335,14 +327,14 @@ namespace Terraria.GameInput { if (Main.gameMenu) return; - Texture2D texture = TextureAssets.LockOnCursor.Value; - Rectangle r1 = new Rectangle(0, 0, texture.Width, 12); - Rectangle r2 = new Rectangle(0, 16, texture.Width, 12); + Texture2D lockOnCursorTexture = Main.LockOnCursorTexture; + Rectangle r1 = new Rectangle(0, 0, lockOnCursorTexture.Width, 12); + Rectangle r2 = new Rectangle(0, 16, lockOnCursorTexture.Width, 12); Color color1 = Main.OurFavoriteColor.MultiplyRGBA(new Color(0.75f, 0.75f, 0.75f, 1f)); color1.A = (byte) 220; Color favoriteColor = Main.OurFavoriteColor; favoriteColor.A = (byte) 220; - float num1 = (float) (0.939999997615814 + Math.Sin((double) Main.GlobalTimeWrappedHourly * 6.28318548202515) * 0.0599999986588955); + float num1 = (float) (0.939999997615814 + Math.Sin((double) Main.GlobalTime * 6.28318548202515) * 0.0599999986588955); favoriteColor *= num1; Color t1 = color1 * num1; Utils.Swap(ref t1, ref favoriteColor); @@ -361,7 +353,7 @@ namespace Terraria.GameInput int num8 = 0; if (LockOnHelper._pickedTarget != -1 && LockOnHelper._targets.Count > 0 && i == LockOnHelper._targets[LockOnHelper._pickedTarget]) num8 = 2; - else if (flag && LockOnHelper._targets.Contains(i) || LockOnHelper.UseMode == LockOnHelper.LockOnMode.ThreeDS && LockOnHelper._threeDSTarget == i || LockOnHelper.UseMode == LockOnHelper.LockOnMode.TargetClosest && LockOnHelper._targetClosestTarget == i) + else if (flag && LockOnHelper._targets.Contains(i) || LockOnHelper.UseMode == LockOnHelper.LockOnMode.ThreeDS && LockOnHelper._threeDSTarget == i) num8 = 1; LockOnHelper._drawProgress[i, 0] = MathHelper.Clamp(LockOnHelper._drawProgress[i, 0] + (num8 == 1 ? num3 : -num3), 0.0f, 1f); LockOnHelper._drawProgress[i, 1] = MathHelper.Clamp(LockOnHelper._drawProgress[i, 1] + (num8 == 2 ? num3 : -num3), 0.0f, 1f); @@ -369,9 +361,9 @@ namespace Terraria.GameInput if ((double) num9 > 0.0) { float num10 = (float) (1.0 - (double) num9 * (double) num9); - Vector2 position = Main.ReverseGravitySupport(Main.npc[i].Top + new Vector2(0.0f, (float) (-(double) num7 - (double) num10 * (double) num6)) * gravDir - Main.screenPosition, (float) Main.npc[i].height); - spriteBatch.Draw(texture, position, new Rectangle?(r1), color2 * num9, 0.0f, r1.Size() / 2f, new Vector2(0.58f, 1f) * num2 * num4 * (1f + num9) / 2f, SpriteEffects.None, 0.0f); - spriteBatch.Draw(texture, position, new Rectangle?(r2), color3 * num9 * num9, 0.0f, r2.Size() / 2f, new Vector2(0.58f, 1f) * num2 * num4 * (1f + num9) / 2f, SpriteEffects.None, 0.0f); + Vector2 position = Main.ReverseGravitySupport(Main.npc[i].Top + new Vector2(0.0f, (float) (-(double) num7 - (double) num10 * (double) num6)) - Main.screenPosition, (float) Main.npc[i].height); + spriteBatch.Draw(lockOnCursorTexture, position, new Rectangle?(r1), color2 * num9, 0.0f, r1.Size() / 2f, new Vector2(0.58f, 1f) * num2 * num4 * (1f + num9) / 2f, SpriteEffects.None, 0.0f); + spriteBatch.Draw(lockOnCursorTexture, position, new Rectangle?(r2), color3 * num9 * num9, 0.0f, r2.Size() / 2f, new Vector2(0.58f, 1f) * num2 * num4 * (1f + num9) / 2f, SpriteEffects.None, 0.0f); } float num11 = LockOnHelper._drawProgress[i, 1]; if ((double) num11 > 0.0) @@ -389,12 +381,12 @@ namespace Terraria.GameInput vector2_1 = pos; for (int index = 0; (double) index < (double) num14; ++index) { - float num15 = (float) (6.28318548202515 / (double) num14 * (double) index + (double) Main.GlobalTimeWrappedHourly * 6.28318548202515 * 0.25); + float num15 = (float) (6.28318548202515 / (double) num14 * (double) index + (double) Main.GlobalTime * 6.28318548202515 * 0.25); Vector2 vector2_2 = new Vector2(0.0f, (float) (num13 / 2)).RotatedBy((double) num15); Vector2 position = Main.ReverseGravitySupport(vector2_1 + vector2_2 - Main.screenPosition); float rotation = (float) ((double) num15 * ((double) gravDir == 1.0 ? 1.0 : -1.0) + 3.14159274101257 * ((double) gravDir == 1.0 ? 1.0 : 0.0)); - spriteBatch.Draw(texture, position, new Rectangle?(r1), t1 * num11, rotation, r1.Size() / 2f, new Vector2(0.58f, 1f) * num2 * num5 * (1f + num11) / 2f, SpriteEffects.None, 0.0f); - spriteBatch.Draw(texture, position, new Rectangle?(r2), favoriteColor * num11 * num11, rotation, r2.Size() / 2f, new Vector2(0.58f, 1f) * num2 * num5 * (1f + num11) / 2f, SpriteEffects.None, 0.0f); + spriteBatch.Draw(lockOnCursorTexture, position, new Rectangle?(r1), t1 * num11, rotation, r1.Size() / 2f, new Vector2(0.58f, 1f) * num2 * num5 * (1f + num11) / 2f, SpriteEffects.None, 0.0f); + spriteBatch.Draw(lockOnCursorTexture, position, new Rectangle?(r2), favoriteColor * num11 * num11, rotation, r2.Size() / 2f, new Vector2(0.58f, 1f) * num2 * num5 * (1f + num11) / 2f, SpriteEffects.None, 0.0f); } } } diff --git a/GameInput/PlayerInput.cs b/GameInput/PlayerInput.cs index 078f701..c596899 100644 --- a/GameInput/PlayerInput.cs +++ b/GameInput/PlayerInput.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameInput.PlayerInput -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -9,7 +9,6 @@ using Microsoft.Xna.Framework.Input; using System; using System.Collections.Generic; using System.Linq; -using Terraria.Audio; using Terraria.GameContent.UI; using Terraria.GameContent.UI.Chat; using Terraria.GameContent.UI.States; @@ -23,7 +22,6 @@ namespace Terraria.GameInput { public class PlayerInput { - public static Vector2 RawMouseScale = Vector2.One; public static TriggersPack Triggers = new TriggersPack(); public static List KnownTriggers = new List() { @@ -77,12 +75,11 @@ namespace Terraria.GameInput "MenuRight", "LockOn", "ViewZoomIn", - "ViewZoomOut", - "ToggleCreativeMenu" + "ViewZoomOut" }; private static bool _canReleaseRebindingLock = true; private static int _memoOfLastPoint = -1; - public static int NavigatorRebindingLock; + public static int NavigatorRebindingLock = 0; public static string BlockedKey = ""; private static string _listeningTrigger; private static InputMode _listeningInputMode; @@ -92,20 +89,19 @@ namespace Terraria.GameInput private static PlayerInputProfile _currentProfile; public static InputMode CurrentInputMode = InputMode.Keyboard; private static Buttons[] ButtonsGamepad = (Buttons[]) Enum.GetValues(typeof (Buttons)); - public static bool GrappleAndInteractAreShared; - public static SmartSelectGamepadPointer smartSelectPointer = new SmartSelectGamepadPointer(); + public static bool GrappleAndInteractAreShared = false; private static string _invalidatorCheck = ""; - private static bool _lastActivityState; + private static bool _lastActivityState = false; public static MouseState MouseInfo; public static MouseState MouseInfoOld; public static int MouseX; public static int MouseY; - public static bool LockGamepadTileUseButton = false; + public static bool LockTileUseButton = false; public static List MouseKeys = new List(); - public static int PreUIX; - public static int PreUIY; - public static int PreLockOnX; - public static int PreLockOnY; + public static int PreUIX = 0; + public static int PreUIY = 0; + public static int PreLockOnX = 0; + public static int PreLockOnY = 0; public static int ScrollWheelValue; public static int ScrollWheelValueOld; public static int ScrollWheelDelta; @@ -114,12 +110,9 @@ namespace Terraria.GameInput public static int GamepadScrollValue; public static Vector2 GamepadThumbstickLeft = Vector2.Zero; public static Vector2 GamepadThumbstickRight = Vector2.Zero; - private const int _fastUseMouseItemSlotType = -2; - private const int _fastUseEmpty = -1; - private static int _fastUseItemInventorySlot = -1; - private static bool _InBuildingMode; + private static bool _InBuildingMode = false; private static int _UIPointForBuildingMode = -1; - public static bool WritingText; + public static bool WritingText = false; private static int _originalMouseX; private static int _originalMouseY; private static int _originalLastMouseX; @@ -129,10 +122,6 @@ namespace Terraria.GameInput private static ZoomContext _currentWantedZoom; private static int[] DpadSnapCooldown = new int[4]; - public static event Action OnBindingChange; - - public static event Action OnActionableInput; - public static void ListenFor(string triggerName, InputMode inputmode) { PlayerInput._listeningTrigger = triggerName; @@ -147,7 +136,7 @@ namespace Terraria.GameInput { get { - if (((Main.gameMenu || Main.ingameOptionsWindow || Main.playerInventory || Main.player[Main.myPlayer].talkNPC != -1 || Main.player[Main.myPlayer].sign != -1 ? 1 : (Main.InGameUI.CurrentState != null ? 1 : 0)) == 0 || PlayerInput._InBuildingMode ? 0 : (Main.InvisibleCursorForGamepad ? 1 : 0)) != 0) + if (((Main.gameMenu || Main.ingameOptionsWindow || Main.playerInventory || Main.player[Main.myPlayer].talkNPC != -1 ? 1 : (Main.player[Main.myPlayer].sign != -1 ? 1 : 0)) == 0 || PlayerInput._InBuildingMode ? 0 : (Main.InvisibleCursorForGamepad ? 1 : 0)) != 0) return true; return PlayerInput.CursorIsBusy && !PlayerInput._InBuildingMode; } @@ -161,24 +150,15 @@ namespace Terraria.GameInput public static bool UsingGamepadUI => PlayerInput.CurrentInputMode == InputMode.XBoxGamepadUI; - public static bool IgnoreMouseInterface - { - get - { - if (PlayerInput.UsingGamepad && !UILinkPointNavigator.Available) - return true; - return Main.LocalPlayer.itemAnimation > 0 && !PlayerInput.UsingGamepad; - } - } + public static bool IgnoreMouseInterface => PlayerInput.UsingGamepad && !UILinkPointNavigator.Available; private static bool InvalidateKeyboardSwap() { if (PlayerInput._invalidatorCheck.Length == 0) return false; string str = ""; - List pressedKeys = PlayerInput.GetPressedKeys(); - for (int index = 0; index < pressedKeys.Count; ++index) - str = str + (object) pressedKeys[index] + ", "; + foreach (Keys pressedKey in Main.keyState.GetPressedKeys()) + str = str + pressedKey.ToString() + ", "; if (str == PlayerInput._invalidatorCheck) return true; PlayerInput._invalidatorCheck = ""; @@ -199,56 +179,20 @@ namespace Terraria.GameInput PlayerInput.Triggers.Reset(); PlayerInput.Triggers.Reset(); string str = ""; - List pressedKeys = PlayerInput.GetPressedKeys(); - for (int index = 0; index < pressedKeys.Count; ++index) - str = str + (object) pressedKeys[index] + ", "; + foreach (Keys pressedKey in Main.keyState.GetPressedKeys()) + str = str + pressedKey.ToString() + ", "; PlayerInput._invalidatorCheck = str; } PlayerInput._lastActivityState = isActive; } - public static List GetPressedKeys() - { - List list = ((IEnumerable) Main.keyState.GetPressedKeys()).ToList(); - for (int index = list.Count - 1; index >= 0; --index) - { - if (list[index] == Keys.None) - list.RemoveAt(index); - } - return list; - } - - public static void TryEnteringFastUseModeForInventorySlot(int inventorySlot) - { - PlayerInput._fastUseItemInventorySlot = inventorySlot; - if (inventorySlot >= 50 || inventorySlot < 0) - return; - Player localPlayer = Main.LocalPlayer; - ItemSlot.PickupItemIntoMouse(localPlayer.inventory, 0, inventorySlot, localPlayer); - } - - public static void TryEnteringFastUseModeForMouseItem() => PlayerInput._fastUseItemInventorySlot = -2; - - public static bool ShouldFastUseItem => PlayerInput._fastUseItemInventorySlot != -1; - - public static void TryEndingFastUse() - { - if (PlayerInput._fastUseItemInventorySlot >= 0 && PlayerInput._fastUseItemInventorySlot != -2) - { - Player localPlayer = Main.LocalPlayer; - if (localPlayer.inventory[PlayerInput._fastUseItemInventorySlot].IsAir) - Utils.Swap(ref Main.mouseItem, ref localPlayer.inventory[PlayerInput._fastUseItemInventorySlot]); - } - PlayerInput._fastUseItemInventorySlot = -1; - } - public static bool InBuildingMode => PlayerInput._InBuildingMode; public static void EnterBuildingMode() { - SoundEngine.PlaySound(10); PlayerInput._InBuildingMode = true; PlayerInput._UIPointForBuildingMode = UILinkPointNavigator.CurrentPoint; + Main.SmartCursorEnabled = true; if (Main.mouseItem.stack > 0) return; int pointForBuildingMode = PlayerInput._UIPointForBuildingMode; @@ -259,7 +203,6 @@ namespace Terraria.GameInput public static void ExitBuildingMode() { - SoundEngine.PlaySound(11); PlayerInput._InBuildingMode = false; UILinkPointNavigator.ChangePoint(PlayerInput._UIPointForBuildingMode); if (Main.mouseItem.stack > 0 && Main.player[Main.myPlayer].itemAnimation == 0) @@ -510,7 +453,8 @@ namespace Terraria.GameInput PlayerInput._canReleaseRebindingLock = true; PlayerInput.VerifyBuildingMode(); PlayerInput.MouseInput(); - int num = 0 | (PlayerInput.KeyboardInput() ? 1 : 0) | (PlayerInput.GamePadInput() ? 1 : 0); + PlayerInput.KeyboardInput(); + PlayerInput.GamePadInput(); PlayerInput.Triggers.Update(); PlayerInput.PostInput(); PlayerInput.ScrollWheelDelta = PlayerInput.ScrollWheelValue - PlayerInput.ScrollWheelValueOld; @@ -520,9 +464,6 @@ namespace Terraria.GameInput Main.mouseLeft = PlayerInput.Triggers.Current.MouseLeft; Main.mouseRight = PlayerInput.Triggers.Current.MouseRight; PlayerInput.CacheZoomableValues(); - if (num == 0 || PlayerInput.OnActionableInput == null) - return; - PlayerInput.OnActionableInput(); } public static void UpdateMainMouse() @@ -560,9 +501,7 @@ namespace Terraria.GameInput PlayerInput._originalScreenHeight = Main.screenHeight; } - public static Vector2 OriginalScreenSize => new Vector2((float) PlayerInput._originalScreenWidth, (float) PlayerInput._originalScreenHeight); - - private static bool GamePadInput() + private static void GamePadInput() { bool flag1 = false; PlayerInput.ScrollWheelValue += PlayerInput.GamepadScrollValue; @@ -578,8 +517,8 @@ namespace Terraria.GameInput break; } } - if (Main.SettingBlockGamepadsEntirely || !flag2 || !Main.instance.IsActive && !Main.AllowUnfocusedInputOnGamepad) - return false; + if (!flag2 || !Main.instance.IsActive && !Main.AllowUnfocusedInputOnGamepad) + return; Player player = Main.player[Main.myPlayer]; bool flag3 = UILinkPointNavigator.Available && !PlayerInput.InBuildingMode; InputMode key = InputMode.XBoxGamepad; @@ -600,7 +539,7 @@ namespace Terraria.GameInput if (((Buttons) num1 & PlayerInput.ButtonsGamepad[index]) <= (Buttons) 0 && gamePadState.IsButtonDown(PlayerInput.ButtonsGamepad[index])) { if (PlayerInput.CheckRebindingProcessGamepad(PlayerInput.ButtonsGamepad[index].ToString())) - return false; + return; inputMode.Processkey(PlayerInput.Triggers.Current, PlayerInput.ButtonsGamepad[index].ToString()); flag1 = true; } @@ -628,7 +567,7 @@ namespace Terraria.GameInput if ((double) Vector2.Dot(-Vector2.UnitX, vector2_2) >= (double) num2 && (double) gamepadThumbstickLeft.X < -(double) PlayerInput.CurrentProfile.LeftThumbstickDeadzoneX) { if (PlayerInput.CheckRebindingProcessGamepad(Buttons.LeftThumbstickLeft.ToString())) - return false; + return; KeyConfiguration keyConfiguration = inputMode; TriggersSet current = PlayerInput.Triggers.Current; buttons = Buttons.LeftThumbstickLeft; @@ -640,7 +579,7 @@ namespace Terraria.GameInput { buttons = Buttons.LeftThumbstickRight; if (PlayerInput.CheckRebindingProcessGamepad(buttons.ToString())) - return false; + return; KeyConfiguration keyConfiguration = inputMode; TriggersSet current = PlayerInput.Triggers.Current; buttons = Buttons.LeftThumbstickRight; @@ -652,7 +591,7 @@ namespace Terraria.GameInput { buttons = Buttons.LeftThumbstickUp; if (PlayerInput.CheckRebindingProcessGamepad(buttons.ToString())) - return false; + return; KeyConfiguration keyConfiguration = inputMode; TriggersSet current = PlayerInput.Triggers.Current; buttons = Buttons.LeftThumbstickUp; @@ -664,7 +603,7 @@ namespace Terraria.GameInput { buttons = Buttons.LeftThumbstickDown; if (PlayerInput.CheckRebindingProcessGamepad(buttons.ToString())) - return false; + return; KeyConfiguration keyConfiguration = inputMode; TriggersSet current = PlayerInput.Triggers.Current; buttons = Buttons.LeftThumbstickDown; @@ -676,7 +615,7 @@ namespace Terraria.GameInput { buttons = Buttons.RightThumbstickLeft; if (PlayerInput.CheckRebindingProcessGamepad(buttons.ToString())) - return false; + return; KeyConfiguration keyConfiguration = inputMode; TriggersSet current = PlayerInput.Triggers.Current; buttons = Buttons.RightThumbstickLeft; @@ -688,7 +627,7 @@ namespace Terraria.GameInput { buttons = Buttons.RightThumbstickRight; if (PlayerInput.CheckRebindingProcessGamepad(buttons.ToString())) - return false; + return; KeyConfiguration keyConfiguration = inputMode; TriggersSet current = PlayerInput.Triggers.Current; buttons = Buttons.RightThumbstickRight; @@ -700,7 +639,7 @@ namespace Terraria.GameInput { buttons = Buttons.RightThumbstickUp; if (PlayerInput.CheckRebindingProcessGamepad(buttons.ToString())) - return false; + return; KeyConfiguration keyConfiguration = inputMode; TriggersSet current = PlayerInput.Triggers.Current; buttons = Buttons.RightThumbstickUp; @@ -712,7 +651,7 @@ namespace Terraria.GameInput { buttons = Buttons.RightThumbstickDown; if (PlayerInput.CheckRebindingProcessGamepad(buttons.ToString())) - return false; + return; KeyConfiguration keyConfiguration = inputMode; TriggersSet current = PlayerInput.Triggers.Current; buttons = Buttons.RightThumbstickDown; @@ -724,7 +663,7 @@ namespace Terraria.GameInput { buttons = Buttons.LeftTrigger; if (PlayerInput.CheckRebindingProcessGamepad(buttons.ToString())) - return false; + return; KeyConfiguration keyConfiguration = inputMode; TriggersSet current = PlayerInput.Triggers.Current; buttons = Buttons.LeftTrigger; @@ -736,7 +675,7 @@ namespace Terraria.GameInput { buttons = Buttons.RightTrigger; if (PlayerInput.CheckRebindingProcessGamepad(buttons.ToString())) - return false; + return; KeyConfiguration keyConfiguration = inputMode; TriggersSet current = PlayerInput.Triggers.Current; buttons = Buttons.RightTrigger; @@ -771,11 +710,6 @@ namespace Terraria.GameInput } if (((!(player.velocity == Vector2.Zero) || !(gamepadThumbstickLeft == Vector2.Zero) ? 0 : (gamepadThumbstickRight == Vector2.Zero ? 1 : 0)) & (flag6 ? 1 : 0)) != 0) num4 += player.direction * 10; - float m11_1 = Main.GameViewMatrix.ZoomMatrix.M11; - PlayerInput.smartSelectPointer.UpdateSize(new Vector2((float) (Player.tileRangeX * 16 + num3 * 16), (float) (Player.tileRangeY * 16 + num3 * 16)) * m11_1); - if (flag4) - PlayerInput.smartSelectPointer.UpdateSize(new Vector2((float) (Math.Max(Main.screenWidth, Main.screenHeight) / 2))); - PlayerInput.smartSelectPointer.UpdateCenter(new Vector2((float) num4, (float) num5)); if (gamepadThumbstickRight != Vector2.Zero & flag7) { Vector2 vector2_3 = new Vector2(8f); @@ -796,8 +730,8 @@ namespace Terraria.GameInput else vector2_3 += new Vector2((float) num3) / 4f; } - float m11_2 = Main.GameViewMatrix.ZoomMatrix.M11; - Vector2 vector2_4 = gamepadThumbstickRight * vector2_3 * m11_2; + float m11 = Main.GameViewMatrix.ZoomMatrix.M11; + Vector2 vector2_4 = gamepadThumbstickRight * vector2_3 * m11; int num6 = PlayerInput.MouseX - num4; int num7 = PlayerInput.MouseY - num5; if (flag6) @@ -824,17 +758,17 @@ namespace Terraria.GameInput } else if (!flag5 && Main.SmartCursorEnabled) { - float m11_3 = Main.GameViewMatrix.ZoomMatrix.M11; - Vector2 vector2_6 = gamepadThumbstickLeft * new Vector2((float) (Player.tileRangeX * 16), (float) (Player.tileRangeY * 16)) * m11_3; + float m11 = Main.GameViewMatrix.ZoomMatrix.M11; + Vector2 vector2_6 = gamepadThumbstickLeft * new Vector2((float) (Player.tileRangeX * 16), (float) (Player.tileRangeY * 16)) * m11; if (num3 != 0) - vector2_6 = gamepadThumbstickLeft * new Vector2((float) ((Player.tileRangeX + num3) * 16), (float) ((Player.tileRangeY + num3) * 16)) * m11_3; + vector2_6 = gamepadThumbstickLeft * new Vector2((float) ((Player.tileRangeX + num3) * 16), (float) ((Player.tileRangeY + num3) * 16)) * m11; if (flag4) vector2_6 = new Vector2((float) (Math.Max(Main.screenWidth, Main.screenHeight) / 2)) * gamepadThumbstickLeft; int x = (int) vector2_6.X; int y = (int) vector2_6.Y; - PlayerInput.MouseX = x + num4; - int num11 = num5; - PlayerInput.MouseY = y + num11; + int num11 = num4; + PlayerInput.MouseX = x + num11; + PlayerInput.MouseY = y + num5; } flag1 = true; } @@ -857,23 +791,17 @@ namespace Terraria.GameInput } else { - float num19 = 0.0f; - if (player.HeldItem.createTile >= 0 || player.HeldItem.createWall > 0 || player.HeldItem.tileWand >= 0) - num19 = 0.5f; - float m11_4 = Main.GameViewMatrix.ZoomMatrix.M11; - float num20 = (float) (-((double) (Player.tileRangeY + num3) - (double) num19) * 16.0) * m11_4; - float max = (float) (((double) (Player.tileRangeY + num3) - (double) num19) * 16.0) * m11_4; - float min = num20 - (float) (player.height / 16 / 2 * 16); - num14 = (int) Utils.Clamp((float) num12, (float) (-((double) (Player.tileRangeX + num3) - (double) num19) * 16.0) * m11_4, (float) (((double) (Player.tileRangeX + num3) - (double) num19) * 16.0) * m11_4); - num15 = (int) Utils.Clamp((float) num13, min, max); + float m11 = Main.GameViewMatrix.ZoomMatrix.M11; + num14 = (int) Utils.Clamp((float) num12, (float) (-(Player.tileRangeX + num3) * 16) * m11, (float) ((Player.tileRangeX + num3) * 16) * m11); + num15 = (int) Utils.Clamp((float) num13, (float) (-(Player.tileRangeY + num3) * 16) * m11, (float) ((Player.tileRangeY + num3) * 16) * m11); } if (flag6 && !flag1 | flag4) { - float num21 = 0.81f; + float num19 = 0.81f; if (flag4) - num21 = 0.95f; - num14 = (int) ((double) num14 * (double) num21); - num15 = (int) ((double) num15 * (double) num21); + num19 = 0.95f; + num14 = (int) ((double) num14 * (double) num19); + num15 = (int) ((double) num15 * (double) num19); } } else @@ -887,9 +815,9 @@ namespace Terraria.GameInput } if (flag1) PlayerInput.CurrentInputMode = key; - if (PlayerInput.CurrentInputMode == InputMode.XBoxGamepad) - Main.SetCameraGamepadLerp(0.1f); - return flag1; + if (PlayerInput.CurrentInputMode != InputMode.XBoxGamepad) + return; + Main.SetCameraGamepadLerp(0.1f); } private static void MouseInput() @@ -898,10 +826,12 @@ namespace Terraria.GameInput PlayerInput.MouseInfoOld = PlayerInput.MouseInfo; PlayerInput.MouseInfo = Mouse.GetState(); PlayerInput.ScrollWheelValue += PlayerInput.MouseInfo.ScrollWheelValue; - if (PlayerInput.MouseInfo.X != PlayerInput.MouseInfoOld.X || PlayerInput.MouseInfo.Y != PlayerInput.MouseInfoOld.Y || PlayerInput.MouseInfo.ScrollWheelValue != PlayerInput.MouseInfoOld.ScrollWheelValue) + int num1 = PlayerInput.MouseInfo.X - PlayerInput.MouseInfoOld.X; + int num2 = PlayerInput.MouseInfo.Y - PlayerInput.MouseInfoOld.Y; + if (num1 != 0 || num2 != 0 || PlayerInput.MouseInfo.ScrollWheelValue != PlayerInput.MouseInfoOld.ScrollWheelValue) { - PlayerInput.MouseX = (int) ((double) PlayerInput.MouseInfo.X * (double) PlayerInput.RawMouseScale.X); - PlayerInput.MouseY = (int) ((double) PlayerInput.MouseInfo.Y * (double) PlayerInput.RawMouseScale.Y); + PlayerInput.MouseX = PlayerInput.MouseInfo.X; + PlayerInput.MouseY = PlayerInput.MouseInfo.Y; flag = true; } PlayerInput.MouseKeys.Clear(); @@ -939,21 +869,19 @@ namespace Terraria.GameInput PlayerInput.Triggers.Current.UsedMovementKey = false; } - private static bool KeyboardInput() + private static void KeyboardInput() { bool flag1 = false; bool flag2 = false; - List pressedKeys = PlayerInput.GetPressedKeys(); - PlayerInput.DebugKeys(pressedKeys); - if (pressedKeys.Count == 0 && PlayerInput.MouseKeys.Count == 0) - return false; - for (int index = 0; index < pressedKeys.Count; ++index) + Keys[] pressedKeys = Main.keyState.GetPressedKeys(); + if (PlayerInput.InvalidateKeyboardSwap() && PlayerInput.MouseKeys.Count == 0) + return; + for (int index = 0; index < pressedKeys.Length; ++index) { if (pressedKeys[index] == Keys.LeftShift || pressedKeys[index] == Keys.RightShift) flag1 = true; else if (pressedKeys[index] == Keys.LeftAlt || pressedKeys[index] == Keys.RightAlt) flag2 = true; - Main.ChromaPainter.PressKey(pressedKeys[index]); } string blockKey = Main.blockKey; Keys keys = Keys.None; @@ -961,10 +889,9 @@ namespace Terraria.GameInput if (blockKey != str1) { bool flag3 = false; - for (int index = 0; index < pressedKeys.Count; ++index) + for (int index = 0; index < pressedKeys.Length; ++index) { - keys = pressedKeys[index]; - if (keys.ToString() == Main.blockKey) + if (pressedKeys[index].ToString() == Main.blockKey) { pressedKeys[index] = Keys.None; flag3 = true; @@ -979,98 +906,64 @@ namespace Terraria.GameInput KeyConfiguration inputMode = PlayerInput.CurrentProfile.InputModes[InputMode.Keyboard]; if (Main.gameMenu && !PlayerInput.WritingText) inputMode = PlayerInput.CurrentProfile.InputModes[InputMode.KeyboardUI]; - List stringList1 = new List(pressedKeys.Count); - for (int index = 0; index < pressedKeys.Count; ++index) - { - List stringList2 = stringList1; - keys = pressedKeys[index]; - string str2 = keys.ToString(); - stringList2.Add(str2); - } + List stringList = new List(pressedKeys.Length); + for (int index = 0; index < pressedKeys.Length; ++index) + stringList.Add(pressedKeys[index].ToString()); if (PlayerInput.WritingText) - stringList1.Clear(); - int count = stringList1.Count; - stringList1.AddRange((IEnumerable) PlayerInput.MouseKeys); + stringList.Clear(); + int count = stringList.Count; + stringList.AddRange((IEnumerable) PlayerInput.MouseKeys); bool flag4 = false; - for (int index = 0; index < stringList1.Count; ++index) + for (int index = 0; index < stringList.Count; ++index) { - if (index >= count || pressedKeys[index] != Keys.None) + string newKey = stringList[index].ToString(); + string str2 = stringList[index]; + keys = Keys.Tab; + string str3 = keys.ToString(); + if (!(str2 == str3) || ((!flag1 ? 0 : (SocialAPI.Mode == SocialMode.Steam ? 1 : 0)) | (flag2 ? 1 : 0)) == 0) { - string newKey = stringList1[index]; - string str3 = stringList1[index]; - keys = Keys.Tab; - string str4 = keys.ToString(); - if (!(str3 == str4) || ((!flag1 ? 0 : (SocialAPI.Mode == SocialMode.Steam ? 1 : 0)) | (flag2 ? 1 : 0)) == 0) - { - if (PlayerInput.CheckRebindingProcessKeyboard(newKey)) - return false; - KeyboardState oldKeyState = Main.oldKeyState; - if (index >= count || !Main.oldKeyState.IsKeyDown(pressedKeys[index])) - inputMode.Processkey(PlayerInput.Triggers.Current, newKey); - else - inputMode.CopyKeyState(PlayerInput.Triggers.Old, PlayerInput.Triggers.Current, newKey); - if (index >= count || pressedKeys[index] != Keys.None) - flag4 = true; - } + if (PlayerInput.CheckRebindingProcessKeyboard(newKey)) + return; + KeyboardState oldKeyState = Main.oldKeyState; + if (index >= count || !Main.oldKeyState.IsKeyDown(pressedKeys[index])) + inputMode.Processkey(PlayerInput.Triggers.Current, newKey); + else + inputMode.CopyKeyState(PlayerInput.Triggers.Old, PlayerInput.Triggers.Current, newKey); + if (index >= count || pressedKeys[index] != Keys.None) + flag4 = true; } } - if (flag4) - PlayerInput.CurrentInputMode = InputMode.Keyboard; - return flag4; - } - - private static void DebugKeys(List keys) - { + if (!flag4) + return; + PlayerInput.CurrentInputMode = InputMode.Keyboard; } private static void FixDerpedRebinds() { - List triggers = new List() + List stringList = new List() { "MouseLeft", "MouseRight", "Inventory" }; - foreach (InputMode inputMode in Enum.GetValues(typeof (InputMode))) + foreach (InputMode key1 in Enum.GetValues(typeof (InputMode))) { - if (inputMode != InputMode.Mouse) + if (key1 != InputMode.Mouse) { - PlayerInput.FixKeysConflict(inputMode, triggers); - foreach (string str in triggers) + foreach (string key2 in stringList) { - if (PlayerInput.CurrentProfile.InputModes[inputMode].KeyStatus[str].Count < 1) - PlayerInput.ResetKeyBinding(inputMode, str); + if (PlayerInput.CurrentProfile.InputModes[key1].KeyStatus[key2].Count < 1) + { + string key3 = "Redigit's Pick"; + if (PlayerInput.OriginalProfiles.ContainsKey(PlayerInput._selectedProfile)) + key3 = PlayerInput._selectedProfile; + PlayerInput.CurrentProfile.InputModes[key1].KeyStatus[key2].AddRange((IEnumerable) PlayerInput.OriginalProfiles[key3].InputModes[key1].KeyStatus[key2]); + } } } } } - private static void FixKeysConflict(InputMode inputMode, List triggers) - { - for (int index1 = 0; index1 < triggers.Count; ++index1) - { - for (int index2 = index1 + 1; index2 < triggers.Count; ++index2) - { - List keyStatu1 = PlayerInput.CurrentProfile.InputModes[inputMode].KeyStatus[triggers[index1]]; - List keyStatu2 = PlayerInput.CurrentProfile.InputModes[inputMode].KeyStatus[triggers[index2]]; - foreach (string str in keyStatu1.Intersect((IEnumerable) keyStatu2).ToList()) - { - keyStatu1.Remove(str); - keyStatu2.Remove(str); - } - } - } - } - - private static void ResetKeyBinding(InputMode inputMode, string trigger) - { - string key = "Redigit's Pick"; - if (PlayerInput.OriginalProfiles.ContainsKey(PlayerInput._selectedProfile)) - key = PlayerInput._selectedProfile; - PlayerInput.CurrentProfile.InputModes[inputMode].KeyStatus[trigger].Clear(); - PlayerInput.CurrentProfile.InputModes[inputMode].KeyStatus[trigger].AddRange((IEnumerable) PlayerInput.OriginalProfiles[key].InputModes[inputMode].KeyStatus[trigger]); - } - private static bool CheckRebindingProcessGamepad(string newKey) { PlayerInput._canReleaseRebindingLock = false; @@ -1078,7 +971,7 @@ namespace Terraria.GameInput { PlayerInput.NavigatorRebindingLock = 3; PlayerInput._memoOfLastPoint = UILinkPointNavigator.CurrentPoint; - SoundEngine.PlaySound(12); + Main.PlaySound(12); if (PlayerInput.CurrentProfile.InputModes[InputMode.XBoxGamepad].KeyStatus[PlayerInput.ListeningTrigger].Contains(newKey)) PlayerInput.CurrentProfile.InputModes[InputMode.XBoxGamepad].KeyStatus[PlayerInput.ListeningTrigger].Remove(newKey); else @@ -1092,7 +985,7 @@ namespace Terraria.GameInput { PlayerInput.NavigatorRebindingLock = 3; PlayerInput._memoOfLastPoint = UILinkPointNavigator.CurrentPoint; - SoundEngine.PlaySound(12); + Main.PlaySound(12); if (PlayerInput.CurrentProfile.InputModes[InputMode.XBoxGamepadUI].KeyStatus[PlayerInput.ListeningTrigger].Contains(newKey)) PlayerInput.CurrentProfile.InputModes[InputMode.XBoxGamepadUI].KeyStatus[PlayerInput.ListeningTrigger].Remove(newKey); else @@ -1103,8 +996,6 @@ namespace Terraria.GameInput PlayerInput.ListenFor((string) null, InputMode.XBoxGamepadUI); } PlayerInput.FixDerpedRebinds(); - if (PlayerInput.OnBindingChange != null) - PlayerInput.OnBindingChange(); return PlayerInput.NavigatorRebindingLock > 0; } @@ -1115,7 +1006,7 @@ namespace Terraria.GameInput { PlayerInput.NavigatorRebindingLock = 3; PlayerInput._memoOfLastPoint = UILinkPointNavigator.CurrentPoint; - SoundEngine.PlaySound(12); + Main.PlaySound(12); if (PlayerInput.CurrentProfile.InputModes[InputMode.Keyboard].KeyStatus[PlayerInput.ListeningTrigger].Contains(newKey)) PlayerInput.CurrentProfile.InputModes[InputMode.Keyboard].KeyStatus[PlayerInput.ListeningTrigger].Remove(newKey); else @@ -1126,13 +1017,12 @@ namespace Terraria.GameInput PlayerInput.ListenFor((string) null, InputMode.Keyboard); Main.blockKey = newKey; Main.blockInput = false; - Main.ChromaPainter.CollectBoundKeys(); } if (PlayerInput.CurrentlyRebinding && PlayerInput._listeningInputMode == InputMode.KeyboardUI) { PlayerInput.NavigatorRebindingLock = 3; PlayerInput._memoOfLastPoint = UILinkPointNavigator.CurrentPoint; - SoundEngine.PlaySound(12); + Main.PlaySound(12); if (PlayerInput.CurrentProfile.InputModes[InputMode.KeyboardUI].KeyStatus[PlayerInput.ListeningTrigger].Contains(newKey)) PlayerInput.CurrentProfile.InputModes[InputMode.KeyboardUI].KeyStatus[PlayerInput.ListeningTrigger].Remove(newKey); else @@ -1143,11 +1033,8 @@ namespace Terraria.GameInput PlayerInput.ListenFor((string) null, InputMode.KeyboardUI); Main.blockKey = newKey; Main.blockInput = false; - Main.ChromaPainter.CollectBoundKeys(); } PlayerInput.FixDerpedRebinds(); - if (PlayerInput.OnBindingChange != null) - PlayerInput.OnBindingChange(); return PlayerInput.NavigatorRebindingLock > 0; } @@ -1223,14 +1110,9 @@ namespace Terraria.GameInput if (!(zero != Vector2.Zero)) return; Main.SmartCursorEnabled = false; - Matrix zoomMatrix = Main.GameViewMatrix.ZoomMatrix; - Matrix matrix1 = Matrix.Invert(zoomMatrix); - Vector2 mouseScreen = Main.MouseScreen; - Vector2.Transform(Main.screenPosition, matrix1); - Matrix matrix2 = matrix1; - Vector2 vector2_1 = Vector2.Transform((Vector2.Transform(mouseScreen, matrix2) + zero * new Vector2(16f) + Main.screenPosition).ToTileCoordinates().ToWorldCoordinates() - Main.screenPosition, zoomMatrix); - PlayerInput.MouseX = (int) vector2_1.X; - PlayerInput.MouseY = (int) vector2_1.Y; + Point tileCoordinates = (Main.MouseScreen + Main.screenPosition + zero * new Vector2(16f)).ToTileCoordinates(); + PlayerInput.MouseX = tileCoordinates.X * 16 + 8 - (int) Main.screenPosition.X; + PlayerInput.MouseY = tileCoordinates.Y * 16 + 8 - (int) Main.screenPosition.Y; } public static string ComposeInstructionsForGamepad() @@ -1247,7 +1129,7 @@ namespace Terraria.GameInput string str2; if (Main.mapFullscreen && !Main.gameMenu) { - str2 = str1 + " " + PlayerInput.BuildCommand(Lang.misc[56].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Inventory"]) + PlayerInput.BuildCommand(Lang.inter[118].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["HotbarPlus"]) + PlayerInput.BuildCommand(Lang.inter[119].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["HotbarMinus"]); + str2 = str1 + " " + PlayerInput.BuildCommand(Lang.misc[56].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Inventory"]) + PlayerInput.BuildCommand(Lang.inter[118].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["HotbarMinus"]) + PlayerInput.BuildCommand(Lang.inter[119].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["HotbarPlus"]); if (Main.netMode == 1 && Main.player[Main.myPlayer].HasItem(2997)) str2 += PlayerInput.BuildCommand(Lang.inter[120].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseRight"]); } @@ -1257,6 +1139,8 @@ namespace Terraria.GameInput } else { + if (!PlayerInput.GrappleAndInteractAreShared || !WiresUI.Settings.DrawToolModeUI && (!Main.SmartInteractShowingGenuine || Main.SmartInteractNPC == -1 && (Main.SmartInteractX == -1 || Main.SmartInteractY == -1))) + str1 += PlayerInput.BuildCommand(Lang.misc[57].Value, false, inputMode.KeyStatus["Grapple"]); string str3 = str1 + PlayerInput.BuildCommand(Lang.misc[58].Value, false, inputMode.KeyStatus["Jump"]) + PlayerInput.BuildCommand(Lang.misc[59].Value, false, inputMode.KeyStatus["HotbarMinus"], inputMode.KeyStatus["HotbarPlus"]); if (PlayerInput.InBuildingMode) str3 += PlayerInput.BuildCommand(Lang.menu[6].Value, false, inputMode.KeyStatus["Inventory"], inputMode.KeyStatus["MouseRight"]); @@ -1273,27 +1157,12 @@ namespace Terraria.GameInput str2 = str3 + PlayerInput.BuildCommand(Lang.misc[61].Value, false, inputMode.KeyStatus["MouseLeft"]); else str2 = str3 + PlayerInput.BuildCommand(Lang.misc[63].Value, false, inputMode.KeyStatus["MouseLeft"]); - bool flag1 = true; - bool flag2 = Main.SmartInteractProj != -1 || Main.HasInteractibleObjectThatIsNotATile; - bool flag3 = !Main.SmartInteractShowingGenuine && Main.SmartInteractShowingFake; - if (((Main.SmartInteractShowingGenuine ? 1 : (Main.SmartInteractShowingFake ? 1 : 0)) | (flag2 ? 1 : 0)) != 0) + if (Main.SmartInteractShowingGenuine) { if (Main.SmartInteractNPC != -1) - { - if (flag3) - flag1 = false; str2 += PlayerInput.BuildCommand(Lang.misc[80].Value, false, inputMode.KeyStatus["MouseRight"]); - } - else if (flag2) - { - if (flag3) - flag1 = false; - str2 += PlayerInput.BuildCommand(Lang.misc[79].Value, false, inputMode.KeyStatus["MouseRight"]); - } else if (Main.SmartInteractX != -1 && Main.SmartInteractY != -1) { - if (flag3) - flag1 = false; Tile tile = Main.tile[Main.SmartInteractX, Main.SmartInteractY]; if (TileID.Sets.TileInteractRead[(int) tile.type]) str2 += PlayerInput.BuildCommand(Lang.misc[81].Value, false, inputMode.KeyStatus["MouseRight"]); @@ -1303,8 +1172,6 @@ namespace Terraria.GameInput } else if (WiresUI.Settings.DrawToolModeUI) str2 += PlayerInput.BuildCommand(Lang.misc[89].Value, false, inputMode.KeyStatus["MouseRight"]); - if ((!PlayerInput.GrappleAndInteractAreShared || !WiresUI.Settings.DrawToolModeUI && (!Main.SmartInteractShowingGenuine || !Main.HasSmartInteractTarget) && (!Main.SmartInteractShowingFake || flag1)) && Main.LocalPlayer.QuickGrapple_GetItemToUse() != null) - str2 += PlayerInput.BuildCommand(Lang.misc[57].Value, false, inputMode.KeyStatus["Grapple"]); } } return str2; @@ -1318,12 +1185,12 @@ namespace Terraria.GameInput string str1 = ""; if (Bindings.Length == 0) return str1; - string str2 = str1 + PlayerInput.GenerateGlyphList(Bindings[0]); + string str2 = str1 + PlayerInput.GenInput(Bindings[0]); for (int index = 1; index < Bindings.Length; ++index) { - string glyphList = PlayerInput.GenerateGlyphList(Bindings[index]); - if (glyphList.Length > 0) - str2 = str2 + "/" + glyphList; + string str3 = PlayerInput.GenInput(Bindings[index]); + if (str3.Length > 0) + str2 = str2 + "/" + str3; } if (str2.Length > 0) { @@ -1334,75 +1201,7 @@ namespace Terraria.GameInput return str2; } - public static string GenerateInputTag_ForCurrentGamemode_WithHacks( - bool tagForGameplay, - string triggerName) - { - InputMode inputMode = PlayerInput.CurrentInputMode; - switch (inputMode) - { - case InputMode.KeyboardUI: - case InputMode.Mouse: - inputMode = InputMode.Keyboard; - break; - } - if (!(triggerName == "SmartSelect")) - { - if (triggerName == "SmartCursor" && inputMode == InputMode.Keyboard) - return PlayerInput.GenerateRawInputList(new List() - { - Keys.LeftAlt.ToString() - }); - } - else if (inputMode == InputMode.Keyboard) - return PlayerInput.GenerateRawInputList(new List() - { - Keys.LeftControl.ToString() - }); - return PlayerInput.GenerateInputTag_ForCurrentGamemode(tagForGameplay, triggerName); - } - - public static string GenerateInputTag_ForCurrentGamemode( - bool tagForGameplay, - string triggerName) - { - InputMode key = PlayerInput.CurrentInputMode; - switch (key) - { - case InputMode.KeyboardUI: - case InputMode.Mouse: - key = InputMode.Keyboard; - break; - } - if (tagForGameplay) - { - switch (key) - { - case InputMode.XBoxGamepad: - case InputMode.XBoxGamepadUI: - return PlayerInput.GenerateGlyphList(PlayerInput.CurrentProfile.InputModes[InputMode.XBoxGamepad].KeyStatus[triggerName]); - default: - return PlayerInput.GenerateRawInputList(PlayerInput.CurrentProfile.InputModes[key].KeyStatus[triggerName]); - } - } - else - { - switch (key) - { - case InputMode.XBoxGamepad: - case InputMode.XBoxGamepadUI: - return PlayerInput.GenerateGlyphList(PlayerInput.CurrentProfile.InputModes[InputMode.XBoxGamepadUI].KeyStatus[triggerName]); - default: - return PlayerInput.GenerateRawInputList(PlayerInput.CurrentProfile.InputModes[key].KeyStatus[triggerName]); - } - } - } - - public static string GenerateInputTags_GamepadUI(string triggerName) => PlayerInput.GenerateGlyphList(PlayerInput.CurrentProfile.InputModes[InputMode.XBoxGamepadUI].KeyStatus[triggerName]); - - public static string GenerateInputTags_Gamepad(string triggerName) => PlayerInput.GenerateGlyphList(PlayerInput.CurrentProfile.InputModes[InputMode.XBoxGamepad].KeyStatus[triggerName]); - - private static string GenerateGlyphList(List list) + private static string GenInput(List list) { if (list.Count == 0) return ""; @@ -1412,16 +1211,6 @@ namespace Terraria.GameInput return str; } - private static string GenerateRawInputList(List list) - { - if (list.Count == 0) - return ""; - string str = list[0]; - for (int index = 1; index < list.Count; ++index) - str = str + "/" + list[index]; - return str; - } - public static void NavigatorCachePosition() { PlayerInput.PreUIX = PlayerInput.MouseX; @@ -1518,7 +1307,6 @@ namespace Terraria.GameInput c.KeyStatus["Hotbar10"].Add("D0"); c.KeyStatus["ViewZoomOut"].Add("OemMinus"); c.KeyStatus["ViewZoomIn"].Add("OemPlus"); - c.KeyStatus["ToggleCreativeMenu"].Add("C"); return; case InputMode.KeyboardUI: c.KeyStatus["MouseLeft"].Add("Mouse1"); @@ -1552,8 +1340,8 @@ namespace Terraria.GameInput c.KeyStatus["Grapple"].Add(string.Concat((object) Buttons.B)); c.KeyStatus["LockOn"].Add(string.Concat((object) Buttons.X)); c.KeyStatus["QuickMount"].Add(string.Concat((object) Buttons.A)); - c.KeyStatus["SmartSelect"].Add(string.Concat((object) Buttons.RightStick)); - c.KeyStatus["SmartCursor"].Add(string.Concat((object) Buttons.LeftStick)); + c.KeyStatus["SmartSelect"].Add(string.Concat((object) Buttons.LeftStick)); + c.KeyStatus["SmartCursor"].Add(string.Concat((object) Buttons.RightStick)); c.KeyStatus["HotbarMinus"].Add(string.Concat((object) Buttons.LeftShoulder)); c.KeyStatus["HotbarPlus"].Add(string.Concat((object) Buttons.RightShoulder)); c.KeyStatus["MapFull"].Add(string.Concat((object) Buttons.Start)); @@ -1628,7 +1416,6 @@ namespace Terraria.GameInput c.KeyStatus["Hotbar10"].Add("D0"); c.KeyStatus["ViewZoomOut"].Add("OemMinus"); c.KeyStatus["ViewZoomIn"].Add("OemPlus"); - c.KeyStatus["ToggleCreativeMenu"].Add("C"); return; case InputMode.KeyboardUI: c.KeyStatus["MouseLeft"].Add("Mouse1"); @@ -1737,7 +1524,6 @@ namespace Terraria.GameInput c.KeyStatus["Hotbar10"].Add("D0"); c.KeyStatus["ViewZoomOut"].Add("OemMinus"); c.KeyStatus["ViewZoomIn"].Add("OemPlus"); - c.KeyStatus["ToggleCreativeMenu"].Add("C"); return; case InputMode.KeyboardUI: c.KeyStatus["MouseLeft"].Add("Mouse1"); @@ -1846,7 +1632,6 @@ namespace Terraria.GameInput c.KeyStatus["Hotbar10"].Add("D0"); c.KeyStatus["ViewZoomOut"].Add("OemMinus"); c.KeyStatus["ViewZoomIn"].Add("OemPlus"); - c.KeyStatus["ToggleCreativeMenu"].Add("C"); return; case InputMode.KeyboardUI: c.KeyStatus["MouseLeft"].Add("Mouse1"); diff --git a/GameInput/PlayerInputProfile.cs b/GameInput/PlayerInputProfile.cs index f9bd673..519f9cd 100644 --- a/GameInput/PlayerInputProfile.cs +++ b/GameInput/PlayerInputProfile.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameInput.PlayerInputProfile -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework.Input; @@ -48,8 +48,6 @@ namespace Terraria.GameInput public bool RightThumbstickInvertY; public int InventoryMoveCD = 6; - public string ShowName => this.Name; - public bool HotbarAllowsRadial => this.HotbarRadialHoldTimeRequired != -1; public PlayerInputProfile(string name) => this.Name = name; @@ -84,18 +82,6 @@ namespace Terraria.GameInput this.InputModes[InputMode.Keyboard].KeyStatus["ViewZoomOut"] = new List(); this.InputModes[InputMode.Keyboard].KeyStatus["ViewZoomOut"].AddRange((IEnumerable) PlayerInput.OriginalProfiles["Redigit's Pick"].InputModes[InputMode.Keyboard].KeyStatus["ViewZoomOut"]); } - if (num < 218) - { - this.InputModes[InputMode.Keyboard].KeyStatus["ToggleCreativeMenu"] = new List(); - this.InputModes[InputMode.Keyboard].KeyStatus["ToggleCreativeMenu"].AddRange((IEnumerable) PlayerInput.OriginalProfiles["Redigit's Pick"].InputModes[InputMode.Keyboard].KeyStatus["ToggleCreativeMenu"]); - } - if (num < 227) - { - List keyStatu = this.InputModes[InputMode.KeyboardUI].KeyStatus["MouseLeft"]; - string str = "Mouse1"; - if (!keyStatu.Contains(str)) - keyStatu.Add(str); - } if (dict.TryGetValue("Settings", out obj)) { Dictionary dictionary = JsonConvert.DeserializeObject>(((object) (JObject) obj).ToString()); @@ -133,7 +119,7 @@ namespace Terraria.GameInput { Dictionary dictionary1 = new Dictionary(); Dictionary dictionary2 = new Dictionary(); - dictionary1.Add("Last Launched Version", (object) 230); + dictionary1.Add("Last Launched Version", (object) 194); dictionary2.Add("Edittable", (object) this.AllowEditting); dictionary2.Add("Gamepad - HotbarRadialHoldTime", (object) this.HotbarRadialHoldTimeRequired); dictionary2.Add("Gamepad - LeftThumbstickDeadzoneX", (object) this.LeftThumbstickDeadzoneX); @@ -207,7 +193,7 @@ namespace Terraria.GameInput public void CopyGameplaySettingsFrom(PlayerInputProfile profile, InputMode mode) { - string[] keysToCopy = new string[19] + string[] keysToCopy = new string[18] { "MouseLeft", "MouseRight", @@ -226,8 +212,7 @@ namespace Terraria.GameInput "Throw", "Inventory", "ViewZoomIn", - "ViewZoomOut", - "ToggleCreativeMenu" + "ViewZoomOut" }; this.CopyKeysFrom(profile, mode, keysToCopy); } diff --git a/GameInput/PresetProfiles.cs b/GameInput/PresetProfiles.cs index 61bb24e..c05ae22 100644 --- a/GameInput/PresetProfiles.cs +++ b/GameInput/PresetProfiles.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameInput.PresetProfiles -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.GameInput diff --git a/GameInput/SmartSelectGamepadPointer.cs b/GameInput/SmartSelectGamepadPointer.cs deleted file mode 100644 index b878430..0000000 --- a/GameInput/SmartSelectGamepadPointer.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GameInput.SmartSelectGamepadPointer -// 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; -using System; - -namespace Terraria.GameInput -{ - public class SmartSelectGamepadPointer - { - private Vector2 _size; - private Vector2 _center; - private Vector2 _distUniform = new Vector2(80f, 64f); - - public bool ShouldBeUsed() => PlayerInput.UsingGamepad && Main.LocalPlayer.controlTorch && Main.SmartCursorEnabled; - - public void SmartSelectLookup_GetTargetTile(Player player, out int tX, out int tY) - { - tX = (int) (((double) Main.mouseX + (double) Main.screenPosition.X) / 16.0); - tY = (int) (((double) Main.mouseY + (double) Main.screenPosition.Y) / 16.0); - if ((double) player.gravDir == -1.0) - tY = (int) (((double) Main.screenPosition.Y + (double) Main.screenHeight - (double) Main.mouseY) / 16.0); - if (!this.ShouldBeUsed()) - return; - Point point = this.GetPointerPosition().ToPoint(); - tX = (int) (((double) point.X + (double) Main.screenPosition.X) / 16.0); - tY = (int) (((double) point.Y + (double) Main.screenPosition.Y) / 16.0); - if ((double) player.gravDir != -1.0) - return; - tY = (int) (((double) Main.screenPosition.Y + (double) Main.screenHeight - (double) point.Y) / 16.0); - } - - public void UpdateSize(Vector2 size) => this._size = size; - - public void UpdateCenter(Vector2 center) => this._center = center; - - public Vector2 GetPointerPosition() - { - Vector2 vector2 = (new Vector2((float) Main.mouseX, (float) Main.mouseY) - this._center) / this._size; - float num = Math.Abs(vector2.X); - if ((double) num < (double) Math.Abs(vector2.Y)) - num = Math.Abs(vector2.Y); - if ((double) num > 1.0) - vector2 /= num; - return vector2 * Main.GameViewMatrix.Zoom.X * this._distUniform + this._center; - } - } -} diff --git a/GameInput/TriggerNames.cs b/GameInput/TriggerNames.cs index d6ad41c..5b92a7b 100644 --- a/GameInput/TriggerNames.cs +++ b/GameInput/TriggerNames.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameInput.TriggerNames -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.GameInput @@ -59,6 +59,5 @@ namespace Terraria.GameInput public const string LockOn = "LockOn"; public const string ViewZoomIn = "ViewZoomIn"; public const string ViewZoomOut = "ViewZoomOut"; - public const string ToggleCreativeMenu = "ToggleCreativeMenu"; } } diff --git a/GameInput/TriggersPack.cs b/GameInput/TriggersPack.cs index cd3aa3a..ffc78b9 100644 --- a/GameInput/TriggersPack.cs +++ b/GameInput/TriggersPack.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameInput.TriggersPack -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System.Linq; diff --git a/GameInput/TriggersSet.cs b/GameInput/TriggersSet.cs index 7fe8223..4f5eda3 100644 --- a/GameInput/TriggersSet.cs +++ b/GameInput/TriggersSet.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.GameInput.TriggersSet -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -323,12 +323,6 @@ namespace Terraria.GameInput set => this.KeyStatus[nameof (ViewZoomOut)] = value; } - public bool OpenCreativePowersMenu - { - get => this.KeyStatus["ToggleCreativeMenu"]; - set => this.KeyStatus["ToggleCreativeMenu"] = value; - } - public void Reset() { foreach (string key in this.KeyStatus.Keys.ToArray()) @@ -357,7 +351,7 @@ namespace Terraria.GameInput public Vector2 GetNavigatorDirections() { - bool flag1 = Main.gameMenu || Main.ingameOptionsWindow || Main.editChest || Main.editSign || (Main.playerInventory || Main.LocalPlayer.talkNPC != -1) && PlayerInput.CurrentProfile.UsingDpadMovekeys(); + bool flag1 = Main.gameMenu || Main.ingameOptionsWindow || Main.editChest || Main.editSign || Main.playerInventory && PlayerInput.CurrentProfile.UsingDpadMovekeys(); bool flag2 = this.Up || flag1 && this.MenuUp; int num = this.Right ? 1 : (!flag1 ? 0 : (this.MenuRight ? 1 : 0)); bool flag3 = this.Down || flag1 && this.MenuDown; @@ -380,7 +374,6 @@ namespace Terraria.GameInput p.controlMount = this.QuickMount; p.controlQuickHeal = this.QuickHeal; p.controlQuickMana = this.QuickMana; - p.controlCreativeMenu = this.OpenCreativePowersMenu; if (this.QuickBuff) p.QuickBuff(); } @@ -400,8 +393,8 @@ namespace Terraria.GameInput else Main.blockMouse = false; if (!this.MouseRight && !Main.playerInventory) - PlayerInput.LockGamepadTileUseButton = false; - if (this.MouseRight && !p.mouseInterface && !Main.blockMouse && !this.ShouldLockTileUsage() && !PlayerInput.InBuildingMode) + PlayerInput.LockTileUseButton = false; + if (this.MouseRight && !p.mouseInterface && !Main.blockMouse & !PlayerInput.LockTileUseButton && !PlayerInput.InBuildingMode) p.controlUseTile = true; if (PlayerInput.InBuildingMode && this.MouseRight) p.controlInv = true; @@ -425,8 +418,8 @@ namespace Terraria.GameInput else Main.blockMouse = false; if (!this.MouseRight && !Main.playerInventory) - PlayerInput.LockGamepadTileUseButton = false; - if (this.MouseRight && !p.mouseInterface && !Main.blockMouse && !this.ShouldLockTileUsage() && !PlayerInput.InBuildingMode) + PlayerInput.LockTileUseButton = false; + if (this.MouseRight && !p.mouseInterface && !Main.blockMouse & !PlayerInput.LockTileUseButton && !PlayerInput.InBuildingMode) p.controlUseTile = true; bool flag = PlayerInput.Triggers.Current.HotbarPlus || PlayerInput.Triggers.Current.HotbarMinus; if (flag) @@ -437,7 +430,5 @@ namespace Terraria.GameInput return; --this.HotbarScrollCD; } - - private bool ShouldLockTileUsage() => PlayerInput.LockGamepadTileUseButton && PlayerInput.UsingGamepad; } } diff --git a/GetItemSettings.cs b/GetItemSettings.cs deleted file mode 100644 index b319bab..0000000 --- a/GetItemSettings.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.GetItemSettings -// 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 -{ - public struct GetItemSettings - { - public static GetItemSettings InventoryEntityToPlayerInventorySettings = new GetItemSettings(NoText: true); - public static GetItemSettings NPCEntityToPlayerInventorySettings = new GetItemSettings(true); - public static GetItemSettings LootAllSettings = new GetItemSettings(); - public static GetItemSettings PickupItemFromWorld = new GetItemSettings(CanGoIntoVoidVault: true); - public static GetItemSettings GetItemInDropItemCheck = new GetItemSettings(NoText: true); - public static GetItemSettings InventoryUIToInventorySettings = new GetItemSettings(); - public static GetItemSettings InventoryUIToInventorySettingsShowAsNew = new GetItemSettings(NoText: true, StepAfterHandlingSlotNormally: new Action(GetItemSettings.MakeNewAndShiny)); - public static GetItemSettings ItemCreatedFromItemUsage = new GetItemSettings(); - public readonly bool LongText; - public readonly bool NoText; - public readonly bool CanGoIntoVoidVault; - public readonly Action StepAfterHandlingSlotNormally; - - public GetItemSettings( - bool LongText = false, - bool NoText = false, - bool CanGoIntoVoidVault = false, - Action StepAfterHandlingSlotNormally = null) - { - this.LongText = LongText; - this.NoText = NoText; - this.CanGoIntoVoidVault = CanGoIntoVoidVault; - this.StepAfterHandlingSlotNormally = StepAfterHandlingSlotNormally; - } - - public void HandlePostAction(Item item) - { - if (this.StepAfterHandlingSlotNormally == null) - return; - this.StepAfterHandlingSlotNormally(item); - } - - private static void MakeNewAndShiny(Item item) => item.newAndShiny = true; - } -} diff --git a/Gore.cs b/Gore.cs index ca688fd..23d44d7 100644 --- a/Gore.cs +++ b/Gore.cs @@ -1,13 +1,11 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Gore -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using System; -using Terraria.Audio; -using Terraria.DataStructures; using Terraria.GameContent; using Terraria.GameContent.Shaders; using Terraria.Graphics.Effects; @@ -30,949 +28,552 @@ namespace Terraria public bool sticky = true; public int timeLeft = Gore.goreTime; public bool behindTiles; + public byte frame; public byte frameCounter; - public SpriteFrame Frame = new SpriteFrame((byte) 1, (byte) 1); - - public float Width => TextureAssets.Gore[this.type].IsLoaded ? this.scale * (float) this.Frame.GetSourceRectangle(TextureAssets.Gore[this.type].Value).Width : 1f; - - public float Height => TextureAssets.Gore[this.type].IsLoaded ? this.scale * (float) this.Frame.GetSourceRectangle(TextureAssets.Gore[this.type].Value).Height : 1f; - - public Rectangle AABBRectangle - { - get - { - if (!TextureAssets.Gore[this.type].IsLoaded) - return new Rectangle(0, 0, 1, 1); - Rectangle sourceRectangle = this.Frame.GetSourceRectangle(TextureAssets.Gore[this.type].Value); - return new Rectangle((int) this.position.X, (int) this.position.Y, (int) ((double) sourceRectangle.Width * (double) this.scale), (int) ((double) sourceRectangle.Height * (double) this.scale)); - } - } - - [Obsolete("Please use Frame instead.")] - public byte frame - { - get => this.Frame.CurrentRow; - set => this.Frame.CurrentRow = value; - } - - [Obsolete("Please use Frame instead.")] - public byte numFrames - { - get => this.Frame.RowCount; - set => this.Frame = new SpriteFrame(this.Frame.ColumnCount, value) - { - CurrentColumn = this.Frame.CurrentColumn, - CurrentRow = this.Frame.CurrentRow - }; - } - - private void UpdateAmbientFloorCloud() - { - this.timeLeft -= GoreID.Sets.DisappearSpeed[this.type]; - if (this.timeLeft <= 0) - { - this.active = false; - } - else - { - bool flag = false; - Point tileCoordinates = (this.position + new Vector2(15f, 0.0f)).ToTileCoordinates(); - Tile testTile1 = Main.tile[tileCoordinates.X, tileCoordinates.Y]; - Tile testTile2 = Main.tile[tileCoordinates.X, tileCoordinates.Y + 1]; - Tile testTile3 = Main.tile[tileCoordinates.X, tileCoordinates.Y + 2]; - if (testTile1 == null || testTile2 == null || testTile3 == null) - { - this.active = false; - } - else - { - if (WorldGen.SolidTile(testTile1) || !WorldGen.SolidTile(testTile2) && !WorldGen.SolidTile(testTile3)) - flag = true; - if (this.timeLeft <= 30) - flag = true; - this.velocity.X = 0.4f * Main.WindForVisuals; - if (!flag) - { - if (this.alpha > 220) - --this.alpha; - } - else - { - ++this.alpha; - if (this.alpha >= (int) byte.MaxValue) - { - this.active = false; - return; - } - } - this.position += this.velocity; - } - } - } - - private void UpdateAmbientAirborneCloud() - { - this.timeLeft -= GoreID.Sets.DisappearSpeed[this.type]; - if (this.timeLeft <= 0) - { - this.active = false; - } - else - { - bool flag = false; - Point tileCoordinates = (this.position + new Vector2(15f, 0.0f)).ToTileCoordinates(); - this.rotation = this.velocity.ToRotation(); - Tile testTile = Main.tile[tileCoordinates.X, tileCoordinates.Y]; - if (testTile == null) - { - this.active = false; - } - else - { - if (WorldGen.SolidTile(testTile)) - flag = true; - if (this.timeLeft <= 60) - flag = true; - if (!flag) - { - if (this.alpha > 240 && Main.rand.Next(5) == 0) - --this.alpha; - } - else - { - if (Main.rand.Next(5) == 0) - ++this.alpha; - if (this.alpha >= (int) byte.MaxValue) - { - this.active = false; - return; - } - } - this.position += this.velocity; - } - } - } - - private void UpdateFogMachineCloud() - { - this.timeLeft -= GoreID.Sets.DisappearSpeed[this.type]; - if (this.timeLeft <= 0) - { - this.active = false; - } - else - { - bool flag = false; - Point tileCoordinates = (this.position + new Vector2(15f, 0.0f)).ToTileCoordinates(); - if (WorldGen.SolidTile(Main.tile[tileCoordinates.X, tileCoordinates.Y])) - flag = true; - if (this.timeLeft <= 240) - flag = true; - if (!flag) - { - if (this.alpha > 225 && Main.rand.Next(2) == 0) - --this.alpha; - } - else - { - if (Main.rand.Next(2) == 0) - ++this.alpha; - if (this.alpha >= (int) byte.MaxValue) - { - this.active = false; - return; - } - } - this.position += this.velocity; - } - } - - private void UpdateLightningBunnySparks() - { - if (this.frameCounter == (byte) 0) - { - this.frameCounter = (byte) 1; - this.Frame.CurrentRow = (byte) Main.rand.Next(3); - } - this.timeLeft -= GoreID.Sets.DisappearSpeed[this.type]; - if (this.timeLeft <= 0) - { - this.active = false; - } - else - { - this.alpha = (int) MathHelper.Lerp((float) byte.MaxValue, 0.0f, (float) this.timeLeft / 15f); - float num = (float) (((double) byte.MaxValue - (double) this.alpha) / (double) byte.MaxValue) * this.scale; - Lighting.AddLight(this.position + new Vector2(this.Width / 2f, this.Height / 2f), num * 0.4f, num, num); - this.position += this.velocity; - } - } - - private float ChumFloatingChunk_GetWaterLine(int X, int Y) - { - float num = this.position.Y + this.Height; - if (Main.tile[X, Y - 1] == null) - Main.tile[X, Y - 1] = new Tile(); - if (Main.tile[X, Y] == null) - Main.tile[X, Y] = new Tile(); - if (Main.tile[X, Y + 1] == null) - Main.tile[X, Y + 1] = new Tile(); - if (Main.tile[X, Y - 1].liquid > (byte) 0) - num = (float) (Y * 16) - (float) ((int) Main.tile[X, Y - 1].liquid / 16); - else if (Main.tile[X, Y].liquid > (byte) 0) - num = (float) ((Y + 1) * 16) - (float) ((int) Main.tile[X, Y].liquid / 16); - else if (Main.tile[X, Y + 1].liquid > (byte) 0) - num = (float) ((Y + 2) * 16) - (float) ((int) Main.tile[X, Y + 1].liquid / 16); - return num; - } + public byte numFrames = 1; public void Update() { if (Main.netMode == 2 || !this.active) return; - switch (GoreID.Sets.SpecialAI[this.type]) + bool flag = this.type >= 1024 && this.type <= 1026; + if (this.type >= 276 && this.type <= 282) { - case 4: - this.UpdateAmbientFloorCloud(); - break; - case 5: - this.UpdateAmbientAirborneCloud(); - break; - case 6: - this.UpdateFogMachineCloud(); - break; - case 7: - this.UpdateLightningBunnySparks(); - break; - default: - if ((this.type == 1217 || this.type == 1218) && this.frameCounter == (byte) 0) + this.velocity.X *= 0.98f; + this.velocity.Y *= 0.98f; + if ((double) this.velocity.Y < (double) this.scale) + this.velocity.Y += 0.05f; + if ((double) this.velocity.Y > 0.1) + { + if ((double) this.velocity.X > 0.0) + this.rotation += 0.01f; + else + this.rotation -= 0.01f; + } + } + if (this.type >= 570 && this.type <= 572) + { + this.scale -= 1f / 1000f; + if ((double) this.scale <= 0.01) + { + this.scale = 0.01f; + Gore.goreTime = 0; + } + this.sticky = false; + this.rotation = this.velocity.X * 0.1f; + } + else if (this.type >= 706 && this.type <= 717 || this.type == 943) + { + this.alpha = (double) this.position.Y >= Main.worldSurface * 16.0 + 8.0 ? 100 : 0; + int num1 = 4; + ++this.frameCounter; + if (this.frame <= (byte) 4) + { + int x = (int) ((double) this.position.X / 16.0); + int y = (int) ((double) this.position.Y / 16.0) - 1; + if (WorldGen.InWorld(x, y) && !Main.tile[x, y].active()) + this.active = false; + if (this.frame == (byte) 0) + num1 = 24 + Main.rand.Next(256); + if (this.frame == (byte) 1) + num1 = 24 + Main.rand.Next(256); + if (this.frame == (byte) 2) + num1 = 24 + Main.rand.Next(256); + if (this.frame == (byte) 3) + num1 = 24 + Main.rand.Next(96); + if (this.frame == (byte) 5) + num1 = 16 + Main.rand.Next(64); + if (this.type == 716) + num1 *= 2; + if (this.type == 717) + num1 *= 4; + if (this.type == 943 && this.frame < (byte) 6) + num1 = 4; + if ((int) this.frameCounter >= num1) { - this.frameCounter = (byte) 1; - this.Frame.CurrentRow = (byte) Main.rand.Next(3); - } - bool flag1 = this.type >= 1024 && this.type <= 1026; - if (this.type >= 276 && this.type <= 282) - { - this.velocity.X *= 0.98f; - this.velocity.Y *= 0.98f; - if ((double) this.velocity.Y < (double) this.scale) - this.velocity.Y += 0.05f; - if ((double) this.velocity.Y > 0.1) + this.frameCounter = (byte) 0; + ++this.frame; + if (this.frame == (byte) 5) { - if ((double) this.velocity.X > 0.0) - this.rotation += 0.01f; - else - this.rotation -= 0.01f; + int index = Gore.NewGore(this.position, this.velocity, this.type); + Main.gore[index].frame = (byte) 9; + Main.gore[index].velocity *= 0.0f; } - } - if (this.type >= 570 && this.type <= 572) - { - this.scale -= 1f / 1000f; - if ((double) this.scale <= 0.01) - { - this.scale = 0.01f; - this.timeLeft = 0; - } - this.sticky = false; - this.rotation = this.velocity.X * 0.1f; - } - else if (this.type >= 706 && this.type <= 717 || this.type == 943 || this.type == 1147 || this.type >= 1160 && this.type <= 1162) - { - this.alpha = this.type == 943 || this.type >= 1160 && this.type <= 1162 ? 0 : ((double) this.position.Y >= Main.worldSurface * 16.0 + 8.0 ? 100 : 0); - int num1 = 4; - ++this.frameCounter; - if (this.frame <= (byte) 4) - { - int x = (int) ((double) this.position.X / 16.0); - int y = (int) ((double) this.position.Y / 16.0) - 1; - if (WorldGen.InWorld(x, y) && !Main.tile[x, y].active()) - this.active = false; - if (this.frame == (byte) 0) - num1 = 24 + Main.rand.Next(256); - if (this.frame == (byte) 1) - num1 = 24 + Main.rand.Next(256); - if (this.frame == (byte) 2) - num1 = 24 + Main.rand.Next(256); - if (this.frame == (byte) 3) - num1 = 24 + Main.rand.Next(96); - if (this.frame == (byte) 5) - num1 = 16 + Main.rand.Next(64); - if (this.type == 716) - num1 *= 2; - if (this.type == 717) - num1 *= 4; - if ((this.type == 943 || this.type >= 1160 && this.type <= 1162) && this.frame < (byte) 6) - num1 = 4; - if ((int) this.frameCounter >= num1) - { - this.frameCounter = (byte) 0; - ++this.frame; - if (this.frame == (byte) 5) - { - int index = Gore.NewGore(this.position, this.velocity, this.type); - Main.gore[index].frame = (byte) 9; - Main.gore[index].velocity *= 0.0f; - } - } - } - else if (this.frame <= (byte) 6) - { - int num2 = 8; - if (this.type == 716) - num2 *= 2; - if (this.type == 717) - num2 *= 3; - if ((int) this.frameCounter >= num2) - { - this.frameCounter = (byte) 0; - ++this.frame; - if (this.frame == (byte) 7) - this.active = false; - } - } - else if (this.frame <= (byte) 9) - { - int num3 = 6; - if (this.type == 716) - { - num3 = (int) ((double) num3 * 1.5); - this.velocity.Y += 0.175f; - } - else if (this.type == 717) - { - num3 *= 2; - this.velocity.Y += 0.15f; - } - else if (this.type == 943) - { - num3 = (int) ((double) num3 * 1.5); - this.velocity.Y += 0.2f; - } - else - this.velocity.Y += 0.2f; - if ((double) this.velocity.Y < 0.5) - this.velocity.Y = 0.5f; - if ((double) this.velocity.Y > 12.0) - this.velocity.Y = 12f; - if ((int) this.frameCounter >= num3) - { - this.frameCounter = (byte) 0; - ++this.frame; - } - if (this.frame > (byte) 9) - this.frame = (byte) 7; - } - else - { - if (this.type == 716) - num1 *= 2; - else if (this.type == 717) - num1 *= 6; - this.velocity.Y += 0.1f; - if ((int) this.frameCounter >= num1) - { - this.frameCounter = (byte) 0; - ++this.frame; - } - this.velocity *= 0.0f; - if (this.frame > (byte) 14) - this.active = false; - } - } - else if (this.type == 11 || this.type == 12 || this.type == 13 || this.type == 61 || this.type == 62 || this.type == 63 || this.type == 99 || this.type == 220 || this.type == 221 || this.type == 222 || this.type >= 375 && this.type <= 377 || this.type >= 435 && this.type <= 437 || this.type >= 861 && this.type <= 862) - { - this.velocity.Y *= 0.98f; - this.velocity.X *= 0.98f; - this.scale -= 0.007f; - if ((double) this.scale < 0.1) - { - this.scale = 0.1f; - this.alpha = (int) byte.MaxValue; - } - } - else if (this.type == 16 || this.type == 17) - { - this.velocity.Y *= 0.98f; - this.velocity.X *= 0.98f; - this.scale -= 0.01f; - if ((double) this.scale < 0.1) - { - this.scale = 0.1f; - this.alpha = (int) byte.MaxValue; - } - } - else if (this.type == 1201) - { - if (this.frameCounter == (byte) 0) - { - this.frameCounter = (byte) 1; - this.Frame.CurrentRow = (byte) Main.rand.Next(4); - } - this.scale -= 1f / 500f; - if ((double) this.scale < 0.1) - { - this.scale = 0.1f; - this.alpha = (int) byte.MaxValue; - } - this.rotation += this.velocity.X * 0.1f; - int index1 = (int) ((double) this.position.X + 6.0) / 16; - int index2 = (int) ((double) this.position.Y - 6.0) / 16; - if ((Main.tile[index1, index2] == null ? 0 : (Main.tile[index1, index2].liquid > (byte) 0 ? 1 : 0)) == 0) - { - this.velocity.Y += 0.2f; - if ((double) this.velocity.Y < 0.0) - this.velocity *= 0.92f; - } - else - { - this.velocity.Y += 0.005f; - float num = this.velocity.Length(); - if ((double) num > 1.0) - this.velocity *= 0.1f; - else if ((double) num > 0.100000001490116) - this.velocity *= 0.98f; - } - } - else if (this.type == 1208) - { - if (this.frameCounter == (byte) 0) - { - this.frameCounter = (byte) 1; - this.Frame.CurrentRow = (byte) Main.rand.Next(4); - } - Vector2 vector2 = this.position + new Vector2(this.Width, this.Height) / 2f; - int index3 = (int) vector2.X / 16; - int index4 = (int) vector2.Y / 16; - bool flag2 = Main.tile[index3, index4] != null && Main.tile[index3, index4].liquid > (byte) 0; - this.scale -= 0.0005f; - if ((double) this.scale < 0.1) - { - this.scale = 0.1f; - this.alpha = (int) byte.MaxValue; - } - this.rotation += this.velocity.X * 0.1f; - if (flag2) - { - this.velocity.X *= 0.9f; - int index5 = (int) vector2.X / 16; - int index6 = (int) ((double) vector2.Y / 16.0); - double num = (double) this.position.Y / 16.0; - int index7 = (int) (((double) this.position.Y + (double) this.Height) / 16.0); - if (Main.tile[index5, index6] == null) - Main.tile[index5, index6] = new Tile(); - if (Main.tile[index5, index7] == null) - Main.tile[index5, index7] = new Tile(); - if ((double) this.velocity.Y > 0.0) - this.velocity.Y *= 0.5f; - float waterLine = this.ChumFloatingChunk_GetWaterLine((int) ((double) vector2.X / 16.0), (int) ((double) vector2.Y / 16.0)); - if ((double) vector2.Y > (double) waterLine) - { - this.velocity.Y -= 0.1f; - if ((double) this.velocity.Y < -8.0) - this.velocity.Y = -8f; - if ((double) vector2.Y + (double) this.velocity.Y < (double) waterLine) - this.velocity.Y = waterLine - vector2.Y; - } - else - this.velocity.Y = waterLine - vector2.Y; - bool flag3 = !flag2 && (double) this.velocity.Length() < 0.800000011920929; - int maxValue = flag2 ? 270 : 15; - if (Main.rand.Next(maxValue) == 0 && !flag3) - { - Gore gore = Gore.NewGoreDirect(this.position + Vector2.UnitY * 6f, Vector2.Zero, 1201, this.scale * 0.7f); - if (flag2) - gore.velocity = Vector2.UnitX * Main.rand.NextFloatDirection() * 0.5f + Vector2.UnitY * Main.rand.NextFloat(); - else if ((double) gore.velocity.Y < 0.0) - gore.velocity.Y = -gore.velocity.Y; - } - } - else - { - if ((double) this.velocity.Y == 0.0) - this.velocity.X *= 0.95f; - this.velocity.X *= 0.98f; - this.velocity.Y += 0.3f; - if ((double) this.velocity.Y > 15.8999996185303) - this.velocity.Y = 15.9f; - } - } - else if (this.type == 331) - { - this.alpha += 5; - this.velocity.Y *= 0.95f; - this.velocity.X *= 0.95f; - this.rotation = this.velocity.X * 0.1f; - } - else if (GoreID.Sets.SpecialAI[this.type] == 3) - { - if (++this.frameCounter >= (byte) 8 && (double) this.velocity.Y > 0.200000002980232) - { - this.frameCounter = (byte) 0; - int num = (int) this.Frame.CurrentRow / 4; - if ((int) ++this.Frame.CurrentRow >= 4 + num * 4) - this.Frame.CurrentRow = (byte) (num * 4); - } - } - else if (GoreID.Sets.SpecialAI[this.type] != 1 && GoreID.Sets.SpecialAI[this.type] != 2) - { - if (this.type >= 907 && this.type <= 909) - { - this.rotation = 0.0f; - this.velocity.X *= 0.98f; - if ((double) this.velocity.Y > 0.0 && (double) this.velocity.Y < 1.0 / 1000.0) - this.velocity.Y = (float) ((double) Main.rand.NextFloat() * -3.0 - 0.5); - if ((double) this.velocity.Y > -1.0) - this.velocity.Y -= 0.1f; - if ((double) this.scale < 1.0) - this.scale += 0.1f; - if (++this.frameCounter >= (byte) 8) - { - this.frameCounter = (byte) 0; - if (++this.frame >= (byte) 3) - this.frame = (byte) 0; - } - } - else if (this.type == 1218) - { - if (this.timeLeft > 8) - this.timeLeft = 8; - this.velocity.X *= 0.95f; - if ((double) Math.Abs(this.velocity.X) <= 0.100000001490116) - this.velocity.X = 0.0f; - if (this.alpha < 100 && (double) this.velocity.Length() > 0.0 && Main.rand.Next(5) == 0) - { - int Type = 246; - switch (this.Frame.CurrentRow) - { - case 0: - Type = 246; - break; - case 1: - Type = 245; - break; - case 2: - Type = 244; - break; - } - int index = Dust.NewDust(this.position + new Vector2(6f, 4f), 4, 4, Type); - Main.dust[index].alpha = (int) byte.MaxValue; - Main.dust[index].scale = 0.8f; - Main.dust[index].velocity = Vector2.Zero; - } - this.velocity.Y += 0.2f; - this.rotation = 0.0f; - } - else if (this.type < 411 || this.type > 430) - { - this.velocity.Y += 0.2f; - this.rotation += this.velocity.X * 0.05f; - } - else if (GoreID.Sets.SpecialAI[this.type] != 3) - this.rotation += this.velocity.X * 0.1f; - } - if (this.type >= 580 && this.type <= 582) - { - this.rotation = 0.0f; - this.velocity.X *= 0.95f; - } - if (GoreID.Sets.SpecialAI[this.type] == 2) - { - if (this.timeLeft < 60) - this.alpha += Main.rand.Next(1, 7); - else if (this.alpha > 100) - this.alpha -= Main.rand.Next(1, 4); - if (this.alpha < 0) - this.alpha = 0; - if (this.alpha > (int) byte.MaxValue) - this.timeLeft = 0; - this.velocity.X = (float) (((double) this.velocity.X * 50.0 + (double) Main.WindForVisuals * 2.0 + (double) Main.rand.Next(-10, 11) * 0.100000001490116) / 51.0); - float num4 = 0.0f; - if ((double) this.velocity.X < 0.0) - num4 = this.velocity.X * 0.2f; - this.velocity.Y = (float) (((double) this.velocity.Y * 50.0 - 0.349999994039536 + (double) num4 + (double) Main.rand.Next(-10, 11) * 0.200000002980232) / 51.0); - this.rotation = this.velocity.X * 0.6f; - float num5 = -1f; - if (TextureAssets.Gore[this.type].IsLoaded) - { - Rectangle rectangle1 = new Rectangle((int) this.position.X, (int) this.position.Y, (int) ((double) TextureAssets.Gore[this.type].Width() * (double) this.scale), (int) ((double) TextureAssets.Gore[this.type].Height() * (double) this.scale)); - for (int index = 0; index < (int) byte.MaxValue; ++index) - { - if (Main.player[index].active && !Main.player[index].dead) - { - Rectangle rectangle2 = new Rectangle((int) Main.player[index].position.X, (int) Main.player[index].position.Y, Main.player[index].width, Main.player[index].height); - if (rectangle1.Intersects(rectangle2)) - { - this.timeLeft = 0; - num5 = Main.player[index].velocity.Length(); - break; - } - } - } - } - if (this.timeLeft > 0) + if (this.type == 943 && this.frame > (byte) 4) { if (Main.rand.Next(2) == 0) - --this.timeLeft; - if (Main.rand.Next(50) == 0) - this.timeLeft -= 5; - if (Main.rand.Next(100) == 0) - this.timeLeft -= 10; - } - else - { - this.alpha = (int) byte.MaxValue; - if (TextureAssets.Gore[this.type].IsLoaded && (double) num5 != -1.0) { - float num6 = (float) ((double) TextureAssets.Gore[this.type].Width() * (double) this.scale * 0.800000011920929); - float x = this.position.X; - float y = this.position.Y; - float num7 = (float) TextureAssets.Gore[this.type].Width() * this.scale; - float num8 = (float) TextureAssets.Gore[this.type].Height() * this.scale; - int Type = 31; - for (int index8 = 0; (double) index8 < (double) num6; ++index8) - { - int index9 = Dust.NewDust(new Vector2(x, y), (int) num7, (int) num8, Type); - Main.dust[index9].velocity *= (float) ((1.0 + (double) num5) / 3.0); - Main.dust[index9].noGravity = true; - Main.dust[index9].alpha = 100; - Main.dust[index9].scale = this.scale; - } + Gore gore = Main.gore[Gore.NewGore(this.position, this.velocity, this.type, this.scale)]; + gore.frameCounter = (byte) 0; + gore.frame = (byte) 7; + gore.velocity = Vector2.UnitY * 1f; + } + if (Main.rand.Next(2) == 0) + { + Gore gore = Main.gore[Gore.NewGore(this.position, this.velocity, this.type, this.scale)]; + gore.frameCounter = (byte) 0; + gore.frame = (byte) 7; + gore.velocity = Vector2.UnitY * 2f; } } } - if (this.type >= 411 && this.type <= 430) + } + else if (this.frame <= (byte) 6) + { + int num2 = 8; + if (this.type == 716) + num2 *= 2; + if (this.type == 717) + num2 *= 3; + if ((int) this.frameCounter >= num2) { - this.alpha = 50; - this.velocity.X = (float) (((double) this.velocity.X * 50.0 + (double) Main.WindForVisuals * 2.0 + (double) Main.rand.Next(-10, 11) * 0.100000001490116) / 51.0); - this.velocity.Y = (float) (((double) this.velocity.Y * 50.0 - 0.25 + (double) Main.rand.Next(-10, 11) * 0.200000002980232) / 51.0); - this.rotation = this.velocity.X * 0.3f; - if (TextureAssets.Gore[this.type].IsLoaded) + this.frameCounter = (byte) 0; + ++this.frame; + if (this.frame == (byte) 7) + this.active = false; + } + } + else if (this.frame <= (byte) 9) + { + int num3 = 6; + if (this.type == 716) + { + num3 = (int) ((double) num3 * 1.5); + this.velocity.Y += 0.175f; + } + else if (this.type == 717) + { + num3 *= 2; + this.velocity.Y += 0.15f; + } + else if (this.type == 943) + { + num3 = (int) ((double) num3 * 1.5); + this.velocity.Y += 0.2f; + } + else + this.velocity.Y += 0.2f; + if ((double) this.velocity.Y < 0.5) + this.velocity.Y = 0.5f; + if ((double) this.velocity.Y > 12.0) + this.velocity.Y = 12f; + if ((int) this.frameCounter >= num3) + { + this.frameCounter = (byte) 0; + ++this.frame; + } + if (this.frame > (byte) 9) + this.frame = (byte) 7; + } + else + { + if (this.type == 716) + num1 *= 2; + else if (this.type == 717) + num1 *= 6; + this.velocity.Y += 0.1f; + if ((int) this.frameCounter >= num1) + { + this.frameCounter = (byte) 0; + ++this.frame; + } + this.velocity *= 0.0f; + if (this.frame > (byte) 14) + this.active = false; + } + } + else if (this.type == 11 || this.type == 12 || this.type == 13 || this.type == 61 || this.type == 62 || this.type == 63 || this.type == 99 || this.type == 220 || this.type == 221 || this.type == 222 || this.type >= 375 && this.type <= 377 || this.type >= 435 && this.type <= 437 || this.type >= 861 && this.type <= 862) + { + this.velocity.Y *= 0.98f; + this.velocity.X *= 0.98f; + this.scale -= 0.007f; + if ((double) this.scale < 0.1) + { + this.scale = 0.1f; + this.alpha = (int) byte.MaxValue; + } + } + else if (this.type == 16 || this.type == 17) + { + this.velocity.Y *= 0.98f; + this.velocity.X *= 0.98f; + this.scale -= 0.01f; + if ((double) this.scale < 0.1) + { + this.scale = 0.1f; + this.alpha = (int) byte.MaxValue; + } + } + else if (this.type == 331) + { + this.alpha += 5; + this.velocity.Y *= 0.95f; + this.velocity.X *= 0.95f; + this.rotation = this.velocity.X * 0.1f; + } + else if (GoreID.Sets.SpecialAI[this.type] == 3) + { + if (++this.frameCounter >= (byte) 8 && (double) this.velocity.Y > 0.200000002980232) + { + this.frameCounter = (byte) 0; + int num = (int) this.frame / 4; + if ((int) ++this.frame >= 4 + num * 4) + this.frame = (byte) (num * 4); + } + } + else if (GoreID.Sets.SpecialAI[this.type] != 1 && GoreID.Sets.SpecialAI[this.type] != 2) + { + if (this.type >= 907 && this.type <= 909) + { + this.rotation = 0.0f; + this.velocity.X *= 0.98f; + if ((double) this.velocity.Y > 0.0 && (double) this.velocity.Y < 1.0 / 1000.0) + this.velocity.Y = (float) ((double) Main.rand.NextFloat() * -3.0 - 0.5); + if ((double) this.velocity.Y > -1.0) + this.velocity.Y -= 0.1f; + if ((double) this.scale < 1.0) + this.scale += 0.1f; + if (++this.frameCounter >= (byte) 8) + { + this.frameCounter = (byte) 0; + if (++this.frame >= (byte) 3) + this.frame = (byte) 0; + } + } + else if (this.type < 411 || this.type > 430) + this.velocity.Y += 0.2f; + } + this.rotation += this.velocity.X * 0.1f; + if (this.type >= 580 && this.type <= 582) + { + this.rotation = 0.0f; + this.velocity.X *= 0.95f; + } + if (GoreID.Sets.SpecialAI[this.type] == 2) + { + if (this.timeLeft < 60) + this.alpha += Main.rand.Next(1, 7); + else if (this.alpha > 100) + this.alpha -= Main.rand.Next(1, 4); + if (this.alpha < 0) + this.alpha = 0; + if (this.alpha > (int) byte.MaxValue) + this.timeLeft = 0; + this.velocity.X = (float) (((double) this.velocity.X * 50.0 + (double) Main.windSpeed * 2.0 + (double) Main.rand.Next(-10, 11) * 0.100000001490116) / 51.0); + float num4 = 0.0f; + if ((double) this.velocity.X < 0.0) + num4 = this.velocity.X * 0.2f; + this.velocity.Y = (float) (((double) this.velocity.Y * 50.0 - 0.349999994039536 + (double) num4 + (double) Main.rand.Next(-10, 11) * 0.200000002980232) / 51.0); + this.rotation = this.velocity.X * 0.6f; + float num5 = -1f; + if (Main.goreLoaded[this.type]) + { + Rectangle rectangle1 = new Rectangle((int) this.position.X, (int) this.position.Y, (int) ((double) Main.goreTexture[this.type].Width * (double) this.scale), (int) ((double) Main.goreTexture[this.type].Height * (double) this.scale)); + for (int index = 0; index < (int) byte.MaxValue; ++index) + { + if (Main.player[index].active && !Main.player[index].dead) { - Rectangle rectangle3 = new Rectangle((int) this.position.X, (int) this.position.Y, (int) ((double) TextureAssets.Gore[this.type].Width() * (double) this.scale), (int) ((double) TextureAssets.Gore[this.type].Height() * (double) this.scale)); - for (int index = 0; index < (int) byte.MaxValue; ++index) + Rectangle rectangle2 = new Rectangle((int) Main.player[index].position.X, (int) Main.player[index].position.Y, Main.player[index].width, Main.player[index].height); + if (rectangle1.Intersects(rectangle2)) { - if (Main.player[index].active && !Main.player[index].dead) - { - Rectangle rectangle4 = new Rectangle((int) Main.player[index].position.X, (int) Main.player[index].position.Y, Main.player[index].width, Main.player[index].height); - if (rectangle3.Intersects(rectangle4)) - this.timeLeft = 0; - } + this.timeLeft = 0; + num5 = Main.player[index].velocity.Length(); + break; } - if (Collision.SolidCollision(this.position, (int) ((double) TextureAssets.Gore[this.type].Width() * (double) this.scale), (int) ((double) TextureAssets.Gore[this.type].Height() * (double) this.scale))) + } + } + } + if (this.timeLeft > 0) + { + if (Main.rand.Next(2) == 0) + --this.timeLeft; + if (Main.rand.Next(50) == 0) + this.timeLeft -= 5; + if (Main.rand.Next(100) == 0) + this.timeLeft -= 10; + } + else + { + this.alpha = (int) byte.MaxValue; + if (Main.goreLoaded[this.type] && (double) num5 != -1.0) + { + float num6 = (float) ((double) Main.goreTexture[this.type].Width * (double) this.scale * 0.800000011920929); + float x = this.position.X; + float y = this.position.Y; + float num7 = (float) Main.goreTexture[this.type].Width * this.scale; + float num8 = (float) Main.goreTexture[this.type].Height * this.scale; + int Type = 31; + for (int index1 = 0; (double) index1 < (double) num6; ++index1) + { + int index2 = Dust.NewDust(new Vector2(x, y), (int) num7, (int) num8, Type); + Main.dust[index2].velocity *= (float) ((1.0 + (double) num5) / 3.0); + Main.dust[index2].noGravity = true; + Main.dust[index2].alpha = 100; + Main.dust[index2].scale = this.scale; + } + } + } + } + if (this.type >= 411 && this.type <= 430) + { + this.alpha = 50; + this.velocity.X = (float) (((double) this.velocity.X * 50.0 + (double) Main.windSpeed * 2.0 + (double) Main.rand.Next(-10, 11) * 0.100000001490116) / 51.0); + this.velocity.Y = (float) (((double) this.velocity.Y * 50.0 - 0.25 + (double) Main.rand.Next(-10, 11) * 0.200000002980232) / 51.0); + this.rotation = this.velocity.X * 0.3f; + if (Main.goreLoaded[this.type]) + { + Rectangle rectangle3 = new Rectangle((int) this.position.X, (int) this.position.Y, (int) ((double) Main.goreTexture[this.type].Width * (double) this.scale), (int) ((double) Main.goreTexture[this.type].Height * (double) this.scale)); + for (int index = 0; index < (int) byte.MaxValue; ++index) + { + if (Main.player[index].active && !Main.player[index].dead) + { + Rectangle rectangle4 = new Rectangle((int) Main.player[index].position.X, (int) Main.player[index].position.Y, Main.player[index].width, Main.player[index].height); + if (rectangle3.Intersects(rectangle4)) this.timeLeft = 0; } - if (this.timeLeft > 0) - { - if (Main.rand.Next(2) == 0) - --this.timeLeft; - if (Main.rand.Next(50) == 0) - this.timeLeft -= 5; - if (Main.rand.Next(100) == 0) - this.timeLeft -= 10; - } - else - { - this.alpha = (int) byte.MaxValue; - if (TextureAssets.Gore[this.type].IsLoaded) - { - float num9 = (float) ((double) TextureAssets.Gore[this.type].Width() * (double) this.scale * 0.800000011920929); - float x = this.position.X; - float y = this.position.Y; - float num10 = (float) TextureAssets.Gore[this.type].Width() * this.scale; - float num11 = (float) TextureAssets.Gore[this.type].Height() * this.scale; - int Type = 176; - if (this.type >= 416 && this.type <= 420) - Type = 177; - if (this.type >= 421 && this.type <= 425) - Type = 178; - if (this.type >= 426 && this.type <= 430) - Type = 179; - for (int index10 = 0; (double) index10 < (double) num9; ++index10) - { - int index11 = Dust.NewDust(new Vector2(x, y), (int) num10, (int) num11, Type); - Main.dust[index11].noGravity = true; - Main.dust[index11].alpha = 100; - Main.dust[index11].scale = this.scale; - } - } - } } - else if (GoreID.Sets.SpecialAI[this.type] != 3 && GoreID.Sets.SpecialAI[this.type] != 1) - { - if (this.type >= 706 && this.type <= 717 || this.type == 943 || this.type == 1147 || this.type >= 1160 && this.type <= 1162) - { - if (this.type == 716) - { - float num12 = 0.6f; - float num13 = this.frame != (byte) 0 ? (this.frame != (byte) 1 ? (this.frame != (byte) 2 ? (this.frame != (byte) 3 ? (this.frame != (byte) 4 ? (this.frame != (byte) 5 ? (this.frame != (byte) 6 ? (this.frame > (byte) 9 ? (this.frame != (byte) 10 ? (this.frame != (byte) 11 ? (this.frame != (byte) 12 ? (this.frame != (byte) 13 ? (this.frame != (byte) 14 ? 0.0f : num12 * 0.1f) : num12 * 0.2f) : num12 * 0.3f) : num12 * 0.4f) : num12 * 0.5f) : num12 * 0.5f) : num12 * 0.2f) : num12 * 0.4f) : num12 * 0.5f) : num12 * 0.4f) : num12 * 0.3f) : num12 * 0.2f) : num12 * 0.1f; - Lighting.AddLight(this.position + new Vector2(8f, 8f), 1f * num13, 0.5f * num13, 0.1f * num13); - } - Vector2 velocity = this.velocity; - this.velocity = Collision.TileCollision(this.position, this.velocity, 16, 14); - if (this.velocity != velocity) - { - if (this.frame < (byte) 10) - { - this.frame = (byte) 10; - this.frameCounter = (byte) 0; - if (this.type != 716 && this.type != 717 && this.type != 943 && (this.type < 1160 || this.type > 1162)) - SoundEngine.PlaySound(39, (int) this.position.X + 8, (int) this.position.Y + 8, Main.rand.Next(2)); - } - } - else if (Collision.WetCollision(this.position + this.velocity, 16, 14)) - { - if (this.frame < (byte) 10) - { - this.frame = (byte) 10; - this.frameCounter = (byte) 0; - if (this.type != 716 && this.type != 717 && this.type != 943 && (this.type < 1160 || this.type > 1162)) - SoundEngine.PlaySound(39, (int) this.position.X + 8, (int) this.position.Y + 8, 2); - ((WaterShaderData) Filters.Scene["WaterDistortion"].GetShader()).QueueRipple(this.position + new Vector2(8f, 8f)); - } - int index12 = (int) ((double) this.position.X + 8.0) / 16; - int index13 = (int) ((double) this.position.Y + 14.0) / 16; - if (Main.tile[index12, index13] != null && Main.tile[index12, index13].liquid > (byte) 0) - { - this.velocity *= 0.0f; - this.position.Y = (float) (index13 * 16 - (int) Main.tile[index12, index13].liquid / 16); - } - } - } - else if (this.sticky) - { - int num14 = 32; - if (TextureAssets.Gore[this.type].IsLoaded) - { - num14 = TextureAssets.Gore[this.type].Width(); - if (TextureAssets.Gore[this.type].Height() < num14) - num14 = TextureAssets.Gore[this.type].Height(); - } - if (flag1) - num14 = 4; - int num15 = (int) ((double) num14 * 0.899999976158142); - Vector2 velocity = this.velocity; - this.velocity = Collision.TileCollision(this.position, this.velocity, (int) ((double) num15 * (double) this.scale), (int) ((double) num15 * (double) this.scale)); - if ((double) this.velocity.Y == 0.0) - { - if (flag1) - this.velocity.X *= 0.94f; - else - this.velocity.X *= 0.97f; - if ((double) this.velocity.X > -0.01 && (double) this.velocity.X < 0.01) - this.velocity.X = 0.0f; - } - if (this.timeLeft > 0) - this.timeLeft -= GoreID.Sets.DisappearSpeed[this.type]; - else - this.alpha += GoreID.Sets.DisappearSpeedAlpha[this.type]; - } - else - this.alpha += 2 * GoreID.Sets.DisappearSpeedAlpha[this.type]; - } - if (this.type >= 907 && this.type <= 909) - { - int num16 = 32; - if (TextureAssets.Gore[this.type].IsLoaded) - { - num16 = TextureAssets.Gore[this.type].Width(); - if (TextureAssets.Gore[this.type].Height() < num16) - num16 = TextureAssets.Gore[this.type].Height(); - } - int num17 = (int) ((double) num16 * 0.899999976158142); - Vector4 vector4 = Collision.SlopeCollision(this.position, this.velocity, num17, num17, fall: true); - this.position.X = vector4.X; - this.position.Y = vector4.Y; - this.velocity.X = vector4.Z; - this.velocity.Y = vector4.W; - } - if (GoreID.Sets.SpecialAI[this.type] == 1) - this.Gore_UpdateSail(); - else if (GoreID.Sets.SpecialAI[this.type] == 3) - this.Gore_UpdateLeaf(); - else - this.position += this.velocity; - if (this.alpha >= (int) byte.MaxValue) - this.active = false; - if ((double) this.light <= 0.0) - break; - float r = this.light * this.scale; - float g = this.light * this.scale; - float b = this.light * this.scale; - if (this.type == 16) - { - b *= 0.3f; - g *= 0.8f; - } - else if (this.type == 17) - { - g *= 0.6f; - r *= 0.3f; - } - if (TextureAssets.Gore[this.type].IsLoaded) - { - Lighting.AddLight((int) (((double) this.position.X + (double) TextureAssets.Gore[this.type].Width() * (double) this.scale / 2.0) / 16.0), (int) (((double) this.position.Y + (double) TextureAssets.Gore[this.type].Height() * (double) this.scale / 2.0) / 16.0), r, g, b); - break; - } - Lighting.AddLight((int) (((double) this.position.X + 32.0 * (double) this.scale / 2.0) / 16.0), (int) (((double) this.position.Y + 32.0 * (double) this.scale / 2.0) / 16.0), r, g, b); - break; - } - } - - private void Gore_UpdateLeaf() - { - Vector2 Position = this.position + new Vector2(12f) / 2f - new Vector2(4f) / 2f; - Position.Y -= 4f; - Vector2 vector2_1 = this.position - Position; - if ((double) this.velocity.Y < 0.0) - { - Vector2 vector2_2 = new Vector2(this.velocity.X, -0.2f); - int num1 = (int) (4.0 * 0.899999976158142); - Point tileCoordinates = (new Vector2((float) num1, (float) num1) / 2f + Position).ToTileCoordinates(); - if (!WorldGen.InWorld(tileCoordinates.X, tileCoordinates.Y)) + if (Collision.SolidCollision(this.position, (int) ((double) Main.goreTexture[this.type].Width * (double) this.scale), (int) ((double) Main.goreTexture[this.type].Height * (double) this.scale))) + this.timeLeft = 0; + } + if (this.timeLeft > 0) { - this.active = false; + if (Main.rand.Next(2) == 0) + --this.timeLeft; + if (Main.rand.Next(50) == 0) + this.timeLeft -= 5; + if (Main.rand.Next(100) == 0) + this.timeLeft -= 10; } else { - Tile tile = Main.tile[tileCoordinates.X, tileCoordinates.Y]; - if (tile == null) + this.alpha = (int) byte.MaxValue; + if (Main.goreLoaded[this.type]) { - this.active = false; - } - else - { - int num2 = 6; - Rectangle rectangle1 = new Rectangle(tileCoordinates.X * 16, tileCoordinates.Y * 16 + (int) tile.liquid / 16, 16, 16 - (int) tile.liquid / 16); - Rectangle rectangle2 = new Rectangle((int) Position.X, (int) Position.Y + num2, num1, num1); - bool flag = tile != null && tile.liquid > (byte) 0 && rectangle1.Intersects(rectangle2); - if (flag) + float num9 = (float) ((double) Main.goreTexture[this.type].Width * (double) this.scale * 0.800000011920929); + float x = this.position.X; + float y = this.position.Y; + float num10 = (float) Main.goreTexture[this.type].Width * this.scale; + float num11 = (float) Main.goreTexture[this.type].Height * this.scale; + int Type = 176; + if (this.type >= 416 && this.type <= 420) + Type = 177; + if (this.type >= 421 && this.type <= 425) + Type = 178; + if (this.type >= 426 && this.type <= 430) + Type = 179; + for (int index3 = 0; (double) index3 < (double) num9; ++index3) { - if (tile.honey()) - vector2_2.X = 0.0f; - else if (tile.lava()) - { - this.active = false; - for (int index = 0; index < 5; ++index) - Dust.NewDust(this.position, num1, num1, 31, SpeedY: -0.2f); - } - else - vector2_2.X = Main.WindForVisuals; - if ((double) this.position.Y > Main.worldSurface * 16.0) - vector2_2.X = 0.0f; + int index4 = Dust.NewDust(new Vector2(x, y), (int) num10, (int) num11, Type); + Main.dust[index4].noGravity = true; + Main.dust[index4].alpha = 100; + Main.dust[index4].scale = this.scale; } - if (!WorldGen.SolidTile(tileCoordinates.X, tileCoordinates.Y + 1) && !flag) - { - this.velocity.Y = 0.1f; - this.timeLeft = 0; - this.alpha += 20; - } - vector2_2 = Collision.TileCollision(Position, vector2_2, num1, num1); - if (flag) - this.rotation = vector2_2.ToRotation() + 1.570796f; - vector2_2.X *= 0.94f; - if (!flag || (double) vector2_2.X > -0.01 && (double) vector2_2.X < 0.01) - vector2_2.X = 0.0f; - if (this.timeLeft > 0) - this.timeLeft -= GoreID.Sets.DisappearSpeed[this.type]; - else - this.alpha += GoreID.Sets.DisappearSpeedAlpha[this.type]; - this.velocity.X = vector2_2.X; - this.position.X += this.velocity.X; } } } - else + else if (GoreID.Sets.SpecialAI[this.type] != 3 && GoreID.Sets.SpecialAI[this.type] != 1) { - this.velocity.Y += (float) Math.PI / 180f; - Vector2 vector2_3 = new Vector2(Vector2.UnitY.RotatedBy((double) this.velocity.Y).X * 1f, Math.Abs(Vector2.UnitY.RotatedBy((double) this.velocity.Y).Y) * 1f); - int num3 = 4; - if ((double) this.position.Y < Main.worldSurface * 16.0) - vector2_3.X += Main.WindForVisuals * 4f; - Vector2 vector2_4 = vector2_3; - vector2_3 = Collision.TileCollision(Position, vector2_3, num3, num3); - Vector4 vector4 = Collision.SlopeCollision(Position, vector2_3, num3, num3, 1f); + if (this.type >= 706 && this.type <= 717 || this.type == 943) + { + if (this.type == 716) + { + float num12 = 0.6f; + float num13 = this.frame != (byte) 0 ? (this.frame != (byte) 1 ? (this.frame != (byte) 2 ? (this.frame != (byte) 3 ? (this.frame != (byte) 4 ? (this.frame != (byte) 5 ? (this.frame != (byte) 6 ? (this.frame > (byte) 9 ? (this.frame != (byte) 10 ? (this.frame != (byte) 11 ? (this.frame != (byte) 12 ? (this.frame != (byte) 13 ? (this.frame != (byte) 14 ? 0.0f : num12 * 0.1f) : num12 * 0.2f) : num12 * 0.3f) : num12 * 0.4f) : num12 * 0.5f) : num12 * 0.5f) : num12 * 0.2f) : num12 * 0.4f) : num12 * 0.5f) : num12 * 0.4f) : num12 * 0.3f) : num12 * 0.2f) : num12 * 0.1f; + Lighting.AddLight(this.position + new Vector2(8f, 8f), 1f * num13, 0.5f * num13, 0.1f * num13); + } + Vector2 velocity = this.velocity; + this.velocity = Collision.TileCollision(this.position, this.velocity, 16, 14); + if (this.velocity != velocity) + { + if (this.frame < (byte) 10) + { + this.frame = (byte) 10; + this.frameCounter = (byte) 0; + if (this.type != 716 && this.type != 717 && this.type != 943) + Main.PlaySound(39, (int) this.position.X + 8, (int) this.position.Y + 8, Main.rand.Next(2)); + } + } + else if (Collision.WetCollision(this.position + this.velocity, 16, 14)) + { + if (this.frame < (byte) 10) + { + this.frame = (byte) 10; + this.frameCounter = (byte) 0; + if (this.type != 716 && this.type != 717 && this.type != 943) + Main.PlaySound(39, (int) this.position.X + 8, (int) this.position.Y + 8, 2); + ((WaterShaderData) Filters.Scene["WaterDistortion"].GetShader()).QueueRipple(this.position + new Vector2(8f, 8f)); + } + int index5 = (int) ((double) this.position.X + 8.0) / 16; + int index6 = (int) ((double) this.position.Y + 14.0) / 16; + if (Main.tile[index5, index6] != null && Main.tile[index5, index6].liquid > (byte) 0) + { + this.velocity *= 0.0f; + this.position.Y = (float) (index6 * 16 - (int) Main.tile[index5, index6].liquid / 16); + } + } + } + else if (this.sticky) + { + int num14 = 32; + if (Main.goreLoaded[this.type]) + { + num14 = Main.goreTexture[this.type].Width; + if (Main.goreTexture[this.type].Height < num14) + num14 = Main.goreTexture[this.type].Height; + } + if (flag) + num14 = 4; + int num15 = (int) ((double) num14 * 0.899999976158142); + Vector2 velocity = this.velocity; + this.velocity = Collision.TileCollision(this.position, this.velocity, (int) ((double) num15 * (double) this.scale), (int) ((double) num15 * (double) this.scale)); + if ((double) this.velocity.Y == 0.0) + { + if (flag) + this.velocity.X *= 0.94f; + else + this.velocity.X *= 0.97f; + if ((double) this.velocity.X > -0.01 && (double) this.velocity.X < 0.01) + this.velocity.X = 0.0f; + } + if (this.timeLeft > 0) + this.timeLeft -= GoreID.Sets.DisappearSpeed[this.type]; + else + this.alpha += GoreID.Sets.DisappearSpeedAlpha[this.type]; + } + else + this.alpha += 2 * GoreID.Sets.DisappearSpeedAlpha[this.type]; + } + if (this.type >= 907 && this.type <= 909) + { + int num16 = 32; + if (Main.goreLoaded[this.type]) + { + num16 = Main.goreTexture[this.type].Width; + if (Main.goreTexture[this.type].Height < num16) + num16 = Main.goreTexture[this.type].Height; + } + int num17 = (int) ((double) num16 * 0.899999976158142); + Vector4 vector4 = Collision.SlopeCollision(this.position, this.velocity, num17, num17, fall: true); this.position.X = vector4.X; this.position.Y = vector4.Y; - vector2_3.X = vector4.Z; - vector2_3.Y = vector4.W; - this.position += vector2_1; - if (vector2_3 != vector2_4) - this.velocity.Y = -1f; - Point tileCoordinates = (new Vector2(this.Width, this.Height) * 0.5f + this.position).ToTileCoordinates(); - if (!WorldGen.InWorld(tileCoordinates.X, tileCoordinates.Y)) + this.velocity.X = vector4.Z; + this.velocity.Y = vector4.W; + } + if (GoreID.Sets.SpecialAI[this.type] == 1) + { + if ((double) this.velocity.Y < 0.0) { - this.active = false; + Vector2 Velocity = new Vector2(this.velocity.X, 0.6f); + int num18 = 32; + if (Main.goreLoaded[this.type]) + { + num18 = Main.goreTexture[this.type].Width; + if (Main.goreTexture[this.type].Height < num18) + num18 = Main.goreTexture[this.type].Height; + } + int num19 = (int) ((double) num18 * 0.899999976158142); + Vector2 vector2 = Collision.TileCollision(this.position, Velocity, (int) ((double) num19 * (double) this.scale), (int) ((double) num19 * (double) this.scale)); + vector2.X *= 0.97f; + if ((double) vector2.X > -0.01 && (double) vector2.X < 0.01) + vector2.X = 0.0f; + if (this.timeLeft > 0) + --this.timeLeft; + else + ++this.alpha; + this.velocity.X = vector2.X; } else { - Tile tile = Main.tile[tileCoordinates.X, tileCoordinates.Y]; - if (tile == null) + this.velocity.Y += (float) Math.PI / 60f; + Vector2 Velocity = new Vector2(Vector2.UnitY.RotatedBy((double) this.velocity.Y).X * 2f, Math.Abs(Vector2.UnitY.RotatedBy((double) this.velocity.Y).Y) * 3f) * 2f; + int num = 32; + if (Main.goreLoaded[this.type]) { - this.active = false; + num = Main.goreTexture[this.type].Width; + if (Main.goreTexture[this.type].Height < num) + num = Main.goreTexture[this.type].Height; } + Vector2 vector2 = Velocity; + Vector2 v = Collision.TileCollision(this.position, Velocity, (int) ((double) num * (double) this.scale), (int) ((double) num * (double) this.scale)); + if (v != vector2) + this.velocity.Y = -1f; + this.position += v; + this.rotation = v.ToRotation() + 3.141593f; + if (this.timeLeft > 0) + --this.timeLeft; else - { - int num4 = 6; - Rectangle rectangle3 = new Rectangle(tileCoordinates.X * 16, tileCoordinates.Y * 16 + (int) tile.liquid / 16, 16, 16 - (int) tile.liquid / 16); - Rectangle rectangle4 = new Rectangle((int) Position.X, (int) Position.Y + num4, num3, num3); - if (tile != null && tile.liquid > (byte) 0 && rectangle3.Intersects(rectangle4)) - this.velocity.Y = -1f; - this.position += vector2_3; - this.rotation = vector2_3.ToRotation() + 1.570796f; - if (this.timeLeft > 0) - this.timeLeft -= GoreID.Sets.DisappearSpeed[this.type]; - else - this.alpha += GoreID.Sets.DisappearSpeedAlpha[this.type]; - } + ++this.alpha; } } - } - - private void Gore_UpdateSail() - { - if ((double) this.velocity.Y < 0.0) + else if (GoreID.Sets.SpecialAI[this.type] == 3) { - Vector2 Velocity = new Vector2(this.velocity.X, 0.6f); - int num1 = 32; - if (TextureAssets.Gore[this.type].IsLoaded) + if ((double) this.velocity.Y < 0.0) { - num1 = TextureAssets.Gore[this.type].Width(); - if (TextureAssets.Gore[this.type].Height() < num1) - num1 = TextureAssets.Gore[this.type].Height(); + Vector2 Velocity = new Vector2(this.velocity.X, -0.2f); + int num20 = 8; + if (Main.goreLoaded[this.type]) + { + num20 = Main.goreTexture[this.type].Width; + if (Main.goreTexture[this.type].Height < num20) + num20 = Main.goreTexture[this.type].Height; + } + int num21 = (int) ((double) num20 * 0.899999976158142); + Vector2 vector2 = Collision.TileCollision(this.position, Velocity, (int) ((double) num21 * (double) this.scale), (int) ((double) num21 * (double) this.scale)); + vector2.X *= 0.94f; + if ((double) vector2.X > -0.01 && (double) vector2.X < 0.01) + vector2.X = 0.0f; + if (this.timeLeft > 0) + this.timeLeft -= GoreID.Sets.DisappearSpeed[this.type]; + else + this.alpha += GoreID.Sets.DisappearSpeedAlpha[this.type]; + this.velocity.X = vector2.X; } - int num2 = (int) ((double) num1 * 0.899999976158142); - Vector2 vector2 = Collision.TileCollision(this.position, Velocity, (int) ((double) num2 * (double) this.scale), (int) ((double) num2 * (double) this.scale)); - vector2.X *= 0.97f; - if ((double) vector2.X > -0.01 && (double) vector2.X < 0.01) - vector2.X = 0.0f; - if (this.timeLeft > 0) - --this.timeLeft; else - ++this.alpha; - this.velocity.X = vector2.X; + { + this.velocity.Y += (float) Math.PI / 180f; + Vector2 Velocity = new Vector2(Vector2.UnitY.RotatedBy((double) this.velocity.Y).X * 1f, Math.Abs(Vector2.UnitY.RotatedBy((double) this.velocity.Y).Y) * 1f); + int num = 8; + if (Main.goreLoaded[this.type]) + { + num = Main.goreTexture[this.type].Width; + if (Main.goreTexture[this.type].Height < num) + num = Main.goreTexture[this.type].Height; + } + Vector2 vector2 = Velocity; + Vector2 v = Collision.TileCollision(this.position, Velocity, (int) ((double) num * (double) this.scale), (int) ((double) num * (double) this.scale)); + if (v != vector2) + this.velocity.Y = -1f; + this.position += v; + this.rotation = v.ToRotation() + 1.570796f; + if (this.timeLeft > 0) + this.timeLeft -= GoreID.Sets.DisappearSpeed[this.type]; + else + this.alpha += GoreID.Sets.DisappearSpeedAlpha[this.type]; + } } else + this.position += this.velocity; + if (this.alpha >= (int) byte.MaxValue) + this.active = false; + if ((double) this.light <= 0.0) + return; + float R = this.light * this.scale; + float G = this.light * this.scale; + float B = this.light * this.scale; + if (this.type == 16) { - this.velocity.Y += (float) Math.PI / 60f; - Vector2 Velocity = new Vector2(Vector2.UnitY.RotatedBy((double) this.velocity.Y).X * 2f, Math.Abs(Vector2.UnitY.RotatedBy((double) this.velocity.Y).Y) * 3f) * 2f; - int num = 32; - if (TextureAssets.Gore[this.type].IsLoaded) - { - num = TextureAssets.Gore[this.type].Width(); - if (TextureAssets.Gore[this.type].Height() < num) - num = TextureAssets.Gore[this.type].Height(); - } - Vector2 vector2 = Velocity; - Vector2 v = Collision.TileCollision(this.position, Velocity, (int) ((double) num * (double) this.scale), (int) ((double) num * (double) this.scale)); - if (v != vector2) - this.velocity.Y = -1f; - this.position += v; - this.rotation = v.ToRotation() + 3.141593f; - if (this.timeLeft > 0) - --this.timeLeft; - else - ++this.alpha; + B *= 0.3f; + G *= 0.8f; } + else if (this.type == 17) + { + G *= 0.6f; + R *= 0.3f; + } + if (Main.goreLoaded[this.type]) + Lighting.AddLight((int) (((double) this.position.X + (double) Main.goreTexture[this.type].Width * (double) this.scale / 2.0) / 16.0), (int) (((double) this.position.Y + (double) Main.goreTexture[this.type].Height * (double) this.scale / 2.0) / 16.0), R, G, B); + else + Lighting.AddLight((int) (((double) this.position.X + 32.0 * (double) this.scale / 2.0) / 16.0), (int) (((double) this.position.Y + 32.0 * (double) this.scale / 2.0) / 16.0), R, G, B); } public static Gore NewGorePerfect( @@ -998,12 +599,12 @@ namespace Terraria public static int NewGore(Vector2 Position, Vector2 Velocity, int Type, float Scale = 1f) { - if (Main.netMode == 2 || Main.gamePaused || WorldGen.gen) - return 600; + if (Main.netMode == 2 || Main.gamePaused) + return 500; if (Main.rand == null) Main.rand = new UnifiedRandom(); - int index1 = 600; - for (int index2 = 0; index2 < 600; ++index2) + int index1 = 500; + for (int index2 = 0; index2 < 500; ++index2) { if (!Main.gore[index2].active) { @@ -1011,9 +612,10 @@ namespace Terraria break; } } - if (index1 == 600) + if (index1 == 500) return index1; - Main.gore[index1].Frame = new SpriteFrame((byte) 1, (byte) 1); + Main.gore[index1].numFrames = (byte) 1; + Main.gore[index1].frame = (byte) 0; Main.gore[index1].frameCounter = (byte) 0; Main.gore[index1].behindTiles = false; Main.gore[index1].light = 0.0f; @@ -1044,7 +646,7 @@ namespace Terraria Main.gore[index1].sticky = true; Main.gore[index1].timeLeft = Gore.goreTime; } - if (Type >= 706 && Type <= 717 || Type == 943 || Type == 1147 || Type >= 1160 && Type <= 1162) + if (Type >= 706 && Type <= 717 || Type == 943) { Main.gore[index1].numFrames = (byte) 15; Main.gore[index1].behindTiles = true; @@ -1058,42 +660,23 @@ namespace Terraria } if (Type >= 570 && Type <= 572) Main.gore[index1].velocity = Velocity; - if (Type == 1201 || Type == 1208) - Main.gore[index1].Frame = new SpriteFrame((byte) 1, (byte) 4); - if (Type == 1217 || Type == 1218) - Main.gore[index1].Frame = new SpriteFrame((byte) 1, (byte) 3); - if (Type == 1225) - { - Main.gore[index1].Frame = new SpriteFrame((byte) 1, (byte) 3); - Main.gore[index1].timeLeft = 10 + Main.rand.Next(6); - Main.gore[index1].sticky = false; - if (TextureAssets.Gore[Type].IsLoaded) - { - Main.gore[index1].position.X = Position.X - (float) (TextureAssets.Gore[Type].Width() / 2) * Scale; - Main.gore[index1].position.Y = Position.Y - (float) ((double) TextureAssets.Gore[Type].Height() * (double) Scale / 2.0); - } - } - int num1 = GoreID.Sets.SpecialAI[Type]; - if (num1 == 3) + if (GoreID.Sets.SpecialAI[Type] == 3) { Main.gore[index1].velocity = new Vector2((float) (((double) Main.rand.NextFloat() - 0.5) * 1.0), Main.rand.NextFloat() * 6.283185f); - bool flag = Type >= 910 && Type <= 925 || Type >= 1113 && Type <= 1121 || Type >= 1248 && Type <= 1255 || Type >= 1257; - Main.gore[index1].Frame = new SpriteFrame(flag ? (byte) 32 : (byte) 1, (byte) 8) - { - CurrentRow = (byte) Main.rand.Next(8) - }; + Main.gore[index1].numFrames = (byte) 8; + Main.gore[index1].frame = (byte) Main.rand.Next(8); Main.gore[index1].frameCounter = (byte) Main.rand.Next(8); } - if (num1 == 1) + if (GoreID.Sets.SpecialAI[Type] == 1) Main.gore[index1].velocity = new Vector2((float) (((double) Main.rand.NextFloat() - 0.5) * 3.0), Main.rand.NextFloat() * 6.283185f); - if (Type >= 411 && Type <= 430 && TextureAssets.Gore[Type].IsLoaded) + if (Type >= 411 && Type <= 430 && Main.goreLoaded[Type]) { - Main.gore[index1].position.X = Position.X - (float) (TextureAssets.Gore[Type].Width() / 2) * Scale; - Main.gore[index1].position.Y = Position.Y - (float) TextureAssets.Gore[Type].Height() * Scale; + Main.gore[index1].position.X = Position.X - (float) (Main.goreTexture[Type].Width / 2) * Scale; + Main.gore[index1].position.Y = Position.Y - (float) Main.goreTexture[Type].Height * Scale; Main.gore[index1].velocity.Y *= (float) Main.rand.Next(90, 150) * 0.01f; Main.gore[index1].velocity.X *= (float) Main.rand.Next(40, 90) * 0.01f; - int num2 = Main.rand.Next(4) * 5; - Main.gore[index1].type += num2; + int num = Main.rand.Next(4) * 5; + Main.gore[index1].type += num; Main.gore[index1].timeLeft = Main.rand.Next(Gore.goreTime / 2, Gore.goreTime * 2); Main.gore[index1].sticky = true; if (Gore.goreTime == 0) @@ -1107,33 +690,18 @@ namespace Terraria Main.gore[index1].frameCounter = (byte) Main.rand.Next(5); Main.gore[index1].rotation = 0.0f; } - if (num1 == 2) + if (GoreID.Sets.SpecialAI[Type] == 2) { Main.gore[index1].sticky = false; - if (TextureAssets.Gore[Type].IsLoaded) + if (Main.goreLoaded[Type]) { Main.gore[index1].alpha = 150; Main.gore[index1].velocity = Velocity; - Main.gore[index1].position.X = Position.X - (float) (TextureAssets.Gore[Type].Width() / 2) * Scale; - Main.gore[index1].position.Y = Position.Y - (float) ((double) TextureAssets.Gore[Type].Height() * (double) Scale / 2.0); + Main.gore[index1].position.X = Position.X - (float) (Main.goreTexture[Type].Width / 2) * Scale; + Main.gore[index1].position.Y = Position.Y - (float) ((double) Main.goreTexture[Type].Height * (double) Scale / 2.0); Main.gore[index1].timeLeft = Main.rand.Next(Gore.goreTime / 2, Gore.goreTime + 1); } } - if (num1 == 4) - { - Main.gore[index1].alpha = 254; - Main.gore[index1].timeLeft = 300; - } - if (num1 == 5) - { - Main.gore[index1].alpha = 254; - Main.gore[index1].timeLeft = 240; - } - if (num1 == 6) - { - Main.gore[index1].alpha = 254; - Main.gore[index1].timeLeft = 480; - } return index1; } @@ -1160,8 +728,6 @@ namespace Terraria } if (this.type == 331) return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 50); - if (this.type == 1225) - return new Color(num1, num1, num1, num1); r = (int) ((double) newColor.R * (double) num1); g = (int) ((double) newColor.G * (double) num1); b = (int) ((double) newColor.B * (double) num1); @@ -1171,7 +737,7 @@ namespace Terraria a = 0; if (a > (int) byte.MaxValue) a = (int) byte.MaxValue; - return this.type >= 1202 && this.type <= 1204 ? new Color(r, g, b, a < 20 ? a : 20) : new Color(r, g, b, a); + return new Color(r, g, b, a); } } } diff --git a/Graphics/Camera.cs b/Graphics/Camera.cs deleted file mode 100644 index 5fd853b..0000000 --- a/Graphics/Camera.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.Camera -// 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; -using Microsoft.Xna.Framework.Graphics; - -namespace Terraria.Graphics -{ - public class Camera - { - public Vector2 UnscaledPosition => Main.screenPosition; - - public Vector2 UnscaledSize => new Vector2((float) Main.screenWidth, (float) Main.screenHeight); - - public Vector2 ScaledPosition => this.UnscaledPosition + this.GameViewMatrix.Translation; - - public Vector2 ScaledSize => this.UnscaledSize - this.GameViewMatrix.Translation * 2f; - - public RasterizerState Rasterizer => Main.Rasterizer; - - public SamplerState Sampler => Main.DefaultSamplerState; - - public SpriteViewMatrix GameViewMatrix => Main.GameViewMatrix; - - public SpriteBatch SpriteBatch => Main.spriteBatch; - - public Vector2 Center => this.UnscaledPosition + this.UnscaledSize * 0.5f; - } -} diff --git a/Graphics/Capture/CaptureBiome.cs b/Graphics/Capture/CaptureBiome.cs index 1f30d30..86f30bb 100644 --- a/Graphics/Capture/CaptureBiome.cs +++ b/Graphics/Capture/CaptureBiome.cs @@ -1,136 +1,45 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.Capture.CaptureBiome -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Graphics.Capture { public class CaptureBiome { - public static readonly CaptureBiome DefaultPurity = new CaptureBiome(0, 0); - public static CaptureBiome[] BiomesByWaterStyle = new CaptureBiome[15] + public static CaptureBiome[] Biomes = new CaptureBiome[12] { + new CaptureBiome(0, 0, 0), null, + new CaptureBiome(1, 2, 2, CaptureBiome.TileColorStyle.Corrupt), + new CaptureBiome(3, 0, 3, CaptureBiome.TileColorStyle.Jungle), + new CaptureBiome(6, 2, 4), + new CaptureBiome(7, 4, 5), + new CaptureBiome(2, 1, 6), + new CaptureBiome(9, 6, 7, CaptureBiome.TileColorStyle.Mushroom), + new CaptureBiome(0, 0, 8), null, - new CaptureBiome(1, 2, CaptureBiome.TileColorStyle.Corrupt), - new CaptureBiome(3, 3, CaptureBiome.TileColorStyle.Jungle), - new CaptureBiome(6, 4), - new CaptureBiome(7, 5), - new CaptureBiome(2, 6), - new CaptureBiome(0, 7), - new CaptureBiome(0, 8), - new CaptureBiome(0, 9), - new CaptureBiome(8, 10, CaptureBiome.TileColorStyle.Crimson), - null, - new CaptureBiome(2, 12), - new CaptureBiome(4, 0), - new CaptureBiome(9, 7, CaptureBiome.TileColorStyle.Mushroom) + new CaptureBiome(8, 5, 10, CaptureBiome.TileColorStyle.Crimson), + null }; public readonly int WaterStyle; public readonly int BackgroundIndex; + public readonly int BackgroundIndex2; public readonly CaptureBiome.TileColorStyle TileColor; public CaptureBiome( int backgroundIndex, + int backgroundIndex2, int waterStyle, CaptureBiome.TileColorStyle tileColorStyle = CaptureBiome.TileColorStyle.Normal) { this.BackgroundIndex = backgroundIndex; + this.BackgroundIndex2 = backgroundIndex2; this.WaterStyle = waterStyle; this.TileColor = tileColorStyle; } - public static CaptureBiome GetCaptureBiome(int biomeChoice) - { - switch (biomeChoice) - { - case 1: - return CaptureBiome.GetPurityForPlayer(); - case 2: - return CaptureBiome.Styles.Corruption; - case 3: - return CaptureBiome.Styles.Jungle; - case 4: - return CaptureBiome.Styles.Hallow; - case 5: - return CaptureBiome.Styles.Snow; - case 6: - return CaptureBiome.Styles.Desert; - case 7: - return CaptureBiome.Styles.DirtLayer; - case 8: - return CaptureBiome.Styles.RockLayer; - case 9: - return CaptureBiome.Styles.BloodMoon; - case 10: - return CaptureBiome.Styles.UndergroundDesert; - case 11: - return CaptureBiome.Styles.Ocean; - case 12: - return CaptureBiome.Styles.Mushroom; - default: - return CaptureBiome.GetBiomeByLocation() ?? CaptureBiome.GetBiomeByWater() ?? CaptureBiome.GetPurityForPlayer(); - } - } - - private static CaptureBiome GetBiomeByWater() - { - int waterStyle = Main.CalculateWaterStyle(true); - for (int index = 0; index < CaptureBiome.BiomesByWaterStyle.Length; ++index) - { - CaptureBiome captureBiome = CaptureBiome.BiomesByWaterStyle[index]; - if (captureBiome != null && captureBiome.WaterStyle == waterStyle) - return captureBiome; - } - return (CaptureBiome) null; - } - - private static CaptureBiome GetBiomeByLocation() - { - switch (Main.GetPreferredBGStyleForPlayer()) - { - case 0: - return CaptureBiome.Styles.Purity; - case 1: - return CaptureBiome.Styles.Corruption; - case 2: - return CaptureBiome.Styles.Desert; - case 3: - return CaptureBiome.Styles.Jungle; - case 4: - return CaptureBiome.Styles.Ocean; - case 5: - return CaptureBiome.Styles.Desert; - case 6: - return CaptureBiome.Styles.Hallow; - case 7: - return CaptureBiome.Styles.Snow; - case 8: - return CaptureBiome.Styles.Crimson; - case 9: - return CaptureBiome.Styles.Mushroom; - case 10: - return CaptureBiome.Styles.Purity2; - case 11: - return CaptureBiome.Styles.Purity3; - case 12: - return CaptureBiome.Styles.Purity4; - default: - return (CaptureBiome) null; - } - } - - private static CaptureBiome GetPurityForPlayer() - { - int num = (int) Main.LocalPlayer.Center.X / 16; - if (num < Main.treeX[0]) - return CaptureBiome.Styles.Purity; - if (num < Main.treeX[1]) - return CaptureBiome.Styles.Purity2; - return num < Main.treeX[2] ? CaptureBiome.Styles.Purity3 : CaptureBiome.Styles.Purity4; - } - public enum TileColorStyle { Normal, @@ -139,50 +48,5 @@ namespace Terraria.Graphics.Capture Corrupt, Mushroom, } - - public class Sets - { - public class WaterStyles - { - public const int BloodMoon = 9; - } - } - - public class Styles - { - public static CaptureBiome Purity = new CaptureBiome(0, 0); - public static CaptureBiome Purity2 = new CaptureBiome(10, 0); - public static CaptureBiome Purity3 = new CaptureBiome(11, 0); - public static CaptureBiome Purity4 = new CaptureBiome(12, 0); - public static CaptureBiome Corruption = new CaptureBiome(1, 2, CaptureBiome.TileColorStyle.Corrupt); - public static CaptureBiome Jungle = new CaptureBiome(3, 3, CaptureBiome.TileColorStyle.Jungle); - public static CaptureBiome Hallow = new CaptureBiome(6, 4); - public static CaptureBiome Snow = new CaptureBiome(7, 5); - public static CaptureBiome Desert = new CaptureBiome(2, 6); - public static CaptureBiome DirtLayer = new CaptureBiome(0, 7); - public static CaptureBiome RockLayer = new CaptureBiome(0, 8); - public static CaptureBiome BloodMoon = new CaptureBiome(0, 9); - public static CaptureBiome Crimson = new CaptureBiome(8, 10, CaptureBiome.TileColorStyle.Crimson); - public static CaptureBiome UndergroundDesert = new CaptureBiome(2, 12); - public static CaptureBiome Ocean = new CaptureBiome(4, 0); - public static CaptureBiome Mushroom = new CaptureBiome(9, 7, CaptureBiome.TileColorStyle.Mushroom); - } - - private enum BiomeChoiceIndex - { - AutomatedForPlayer = -1, // 0xFFFFFFFF - Purity = 1, - Corruption = 2, - Jungle = 3, - Hallow = 4, - Snow = 5, - Desert = 6, - DirtLayer = 7, - RockLayer = 8, - BloodMoon = 9, - UndergroundDesert = 10, // 0x0000000A - Ocean = 11, // 0x0000000B - Mushroom = 12, // 0x0000000C - } } } diff --git a/Graphics/Capture/CaptureCamera.cs b/Graphics/Capture/CaptureCamera.cs index b2d302c..0cdd472 100644 --- a/Graphics/Capture/CaptureCamera.cs +++ b/Graphics/Capture/CaptureCamera.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.Capture.CaptureCamera -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -13,8 +13,6 @@ using System.Drawing.Imaging; using System.IO; using System.Runtime.InteropServices; using System.Threading; -using Terraria.GameContent.Drawing; -using Terraria.Graphics.Effects; using Terraria.Localization; namespace Terraria.Graphics.Capture @@ -29,8 +27,6 @@ namespace Terraria.Graphics.Capture public const string CAPTURE_DIRECTORY = "Captures"; private RenderTarget2D _frameBuffer; private RenderTarget2D _scaledFrameBuffer; - private RenderTarget2D _filterFrameBuffer1; - private RenderTarget2D _filterFrameBuffer2; private GraphicsDevice _graphics; private readonly object _captureLock = new object(); private bool _isDisposed; @@ -62,9 +58,7 @@ namespace Terraria.Graphics.Capture this._spriteBatch = new SpriteBatch(graphics); try { - this._frameBuffer = new RenderTarget2D(graphics, 2048, 2048, false, graphics.PresentationParameters.BackBufferFormat, DepthFormat.None); - this._filterFrameBuffer1 = new RenderTarget2D(graphics, 2048, 2048, false, graphics.PresentationParameters.BackBufferFormat, DepthFormat.None); - this._filterFrameBuffer2 = new RenderTarget2D(graphics, 2048, 2048, false, graphics.PresentationParameters.BackBufferFormat, DepthFormat.None); + this._frameBuffer = new RenderTarget2D(graphics, 2048, 2048, false, graphics.PresentationParameters.BackBufferFormat, DepthFormat.Depth24); } catch { @@ -85,16 +79,16 @@ namespace Terraria.Graphics.Capture float num1 = 1f; if (settings.UseScaling) { - if (area.Width * 16 > 4096) - num1 = 4096f / (float) (area.Width * 16); - if (area.Height * 16 > 4096) - num1 = Math.Min(num1, 4096f / (float) (area.Height * 16)); + if (area.Width << 4 > 4096) + num1 = 4096f / (float) (area.Width << 4); + if (area.Height << 4 > 4096) + num1 = Math.Min(num1, 4096f / (float) (area.Height << 4)); num1 = Math.Min(1f, num1); - this._outputImageSize = new Size((int) MathHelper.Clamp((float) (int) ((double) num1 * (double) (area.Width * 16)), 1f, 4096f), (int) MathHelper.Clamp((float) (int) ((double) num1 * (double) (area.Height * 16)), 1f, 4096f)); + this._outputImageSize = new Size((int) MathHelper.Clamp((float) (int) ((double) num1 * (double) (area.Width << 4)), 1f, 4096f), (int) MathHelper.Clamp((float) (int) ((double) num1 * (double) (area.Height << 4)), 1f, 4096f)); this._outputData = new byte[4 * this._outputImageSize.Width * this._outputImageSize.Height]; int num2 = (int) Math.Floor((double) num1 * 2048.0); this._scaledFrameData = new byte[4 * num2 * num2]; - this._scaledFrameBuffer = new RenderTarget2D(this._graphics, num2, num2, false, this._graphics.PresentationParameters.BackBufferFormat, DepthFormat.None); + this._scaledFrameBuffer = new RenderTarget2D(this._graphics, num2, num2, false, this._graphics.PresentationParameters.BackBufferFormat, DepthFormat.Depth24); } else this._outputData = new byte[16777216]; @@ -106,10 +100,10 @@ namespace Terraria.Graphics.Capture { int width1 = Math.Min(128, area.X + area.Width - x1); int height1 = Math.Min(128, area.Y + area.Height - y1); - int width2 = (int) Math.Floor((double) num1 * (double) (width1 * 16)); - int height2 = (int) Math.Floor((double) num1 * (double) (height1 * 16)); - int x2 = (int) Math.Floor((double) num1 * (double) ((x1 - area.X) * 16)); - int y2 = (int) Math.Floor((double) num1 * (double) ((y1 - area.Y) * 16)); + int width2 = (int) Math.Floor((double) num1 * (double) (width1 << 4)); + int height2 = (int) Math.Floor((double) num1 * (double) (height1 << 4)); + int x2 = (int) Math.Floor((double) num1 * (double) (x1 - area.X << 4)); + int y2 = (int) Math.Floor((double) num1 * (double) (y1 - area.Y << 4)); this._renderQueue.Enqueue(new CaptureCamera.CaptureChunk(new Microsoft.Xna.Framework.Rectangle(x1, y1, width1, height1), new Microsoft.Xna.Framework.Rectangle(x2, y2, width2, height2))); } } @@ -121,34 +115,12 @@ namespace Terraria.Graphics.Capture Monitor.Enter(this._captureLock); if (this._activeSettings == null) return; - bool notRetro = Lighting.NotRetro; if (this._renderQueue.Count > 0) { CaptureCamera.CaptureChunk captureChunk = this._renderQueue.Dequeue(); - this._graphics.SetRenderTarget((RenderTarget2D) null); - this._graphics.Clear(Microsoft.Xna.Framework.Color.Transparent); - TileDrawing tilesRenderer = Main.instance.TilesRenderer; - Microsoft.Xna.Framework.Rectangle area = captureChunk.Area; - int left = area.Left; - area = captureChunk.Area; - int right = area.Right; - area = captureChunk.Area; - int top = area.Top; - area = captureChunk.Area; - int bottom = area.Bottom; - tilesRenderer.PrepareForAreaDrawing(left, right, top, bottom, false); - Main.instance.TilePaintSystem.PrepareAllRequests(); this._graphics.SetRenderTarget(this._frameBuffer); this._graphics.Clear(Microsoft.Xna.Framework.Color.Transparent); - if (notRetro) - { - Microsoft.Xna.Framework.Color clearColor = this._activeSettings.CaptureBackground ? Microsoft.Xna.Framework.Color.Black : Microsoft.Xna.Framework.Color.Transparent; - Filters.Scene.BeginCapture(this._filterFrameBuffer1, clearColor); - Main.instance.DrawCapture(captureChunk.Area, this._activeSettings); - Filters.Scene.EndCapture(this._frameBuffer, this._filterFrameBuffer1, this._filterFrameBuffer2, clearColor); - } - else - Main.instance.DrawCapture(captureChunk.Area, this._activeSettings); + Main.instance.DrawCapture(captureChunk.Area, this._activeSettings); if (this._activeSettings.UseScaling) { this._graphics.SetRenderTarget(this._scaledFrameBuffer); @@ -205,15 +177,14 @@ namespace Terraria.Graphics.Capture private bool SaveImage(int width, int height, ImageFormat imageFormat, string filename) { - string savePath = Main.SavePath; - char directorySeparatorChar = Path.DirectorySeparatorChar; - string str1 = directorySeparatorChar.ToString(); - directorySeparatorChar = Path.DirectorySeparatorChar; - string str2 = directorySeparatorChar.ToString(); - if (!Utils.TryCreatingDirectory(savePath + str1 + "Captures" + str2)) - return false; try { + string savePath = Main.SavePath; + char directorySeparatorChar = Path.DirectorySeparatorChar; + string str1 = directorySeparatorChar.ToString(); + directorySeparatorChar = Path.DirectorySeparatorChar; + string str2 = directorySeparatorChar.ToString(); + Directory.CreateDirectory(savePath + str1 + "Captures" + str2); using (Bitmap bitmap = new Bitmap(width, height)) { System.Drawing.Rectangle rect = new System.Drawing.Rectangle(0, 0, width, height); @@ -242,8 +213,7 @@ namespace Terraria.Graphics.Capture { string str = Main.SavePath + Path.DirectorySeparatorChar.ToString() + "Captures" + Path.DirectorySeparatorChar.ToString() + foldername; string filename1 = Path.Combine(str, filename); - if (!Utils.TryCreatingDirectory(str)) - return; + Directory.CreateDirectory(str); using (Bitmap bitmap = new Bitmap(width, height)) { System.Drawing.Rectangle rect = new System.Drawing.Rectangle(0, 0, width, height); @@ -324,8 +294,6 @@ label_5: if (this._isDisposed) return; this._frameBuffer.Dispose(); - this._filterFrameBuffer1.Dispose(); - this._filterFrameBuffer2.Dispose(); if (this._scaledFrameBuffer != null) { this._scaledFrameBuffer.Dispose(); diff --git a/Graphics/Capture/CaptureInterface.cs b/Graphics/Capture/CaptureInterface.cs index b661cb7..fcfe4b1 100644 --- a/Graphics/Capture/CaptureInterface.cs +++ b/Graphics/Capture/CaptureInterface.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.Capture.CaptureInterface -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -9,9 +9,8 @@ using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; -using Terraria.Audio; -using Terraria.GameContent; using Terraria.GameContent.UI; using Terraria.GameInput; using Terraria.UI.Chat; @@ -22,18 +21,18 @@ namespace Terraria.Graphics.Capture { private static Dictionary Modes = CaptureInterface.FillModes(); public bool Active; - public static bool JustActivated; + public static bool JustActivated = false; private const Keys KeyToggleActive = Keys.F1; private bool KeyToggleActiveHeld; public int SelectedMode; public int HoveredMode; - public static bool EdgeAPinned; - public static bool EdgeBPinned; - public static Point EdgeA; - public static Point EdgeB; - public static bool CameraLock; - private static float CameraFrame; - private static float CameraWaiting; + public static bool EdgeAPinned = false; + public static bool EdgeBPinned = false; + public static Point EdgeA = new Point(); + public static Point EdgeB = new Point(); + public static bool CameraLock = false; + private static float CameraFrame = 0.0f; + private static float CameraWaiting = 0.0f; private const float CameraMaxFrame = 5f; private const float CameraMaxWait = 60f; private static CaptureSettings CameraSettings; @@ -73,7 +72,7 @@ namespace Terraria.Graphics.Capture if (CaptureInterface.CameraLock) return; bool flag = Main.keyState.IsKeyDown(Keys.F1); - if (flag && !this.KeyToggleActiveHeld && (Main.mouseItem.type == 0 || this.Active) && !Main.CaptureModeDisabled && !Main.player[Main.myPlayer].dead && !Main.player[Main.myPlayer].ghost) + if (flag && !this.KeyToggleActiveHeld && (Main.mouseItem.type == 0 || this.Active) && !Main.CaptureModeDisabled) this.ToggleCamera(!this.Active); this.KeyToggleActiveHeld = flag; if (!this.Active) @@ -96,12 +95,12 @@ namespace Terraria.Graphics.Capture if (!this.Active) return; sb.End(); - sb.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, Main.UIScaleMatrix); + sb.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, Main.UIScaleMatrix); PlayerInput.SetZoom_UI(); foreach (CaptureInterface.CaptureInterfaceMode captureInterfaceMode in CaptureInterface.Modes.Values) captureInterfaceMode.Draw(sb); sb.End(); - sb.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, Main.UIScaleMatrix); + sb.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, Main.UIScaleMatrix); PlayerInput.SetZoom_UI(); Main.mouseText = false; Main.instance.GUIBarsDraw(); @@ -121,7 +120,7 @@ namespace Terraria.Graphics.Capture bool active = this.Active; this.Active = CaptureInterface.Modes.ContainsKey(this.SelectedMode) & On; if (active != this.Active) - SoundEngine.PlaySound(On ? 10 : 11); + Main.PlaySound(12); foreach (KeyValuePair mode in CaptureInterface.Modes) mode.Value.ToggleActive(this.Active && mode.Key == this.SelectedMode); if (!On || active) @@ -153,7 +152,7 @@ namespace Terraria.Graphics.Capture CaptureInterface.StartCamera(new CaptureSettings() { Area = CaptureInterface.GetArea(), - Biome = CaptureBiome.GetCaptureBiome(CaptureInterface.Settings.BiomeChoiceIndex), + Biome = CaptureBiome.Biomes[CaptureInterface.Settings.BiomeChoice], CaptureBackground = !CaptureInterface.Settings.TransparentBackground, CaptureEntities = CaptureInterface.Settings.IncludeEntities, UseScaling = CaptureInterface.Settings.PackImage, @@ -164,7 +163,6 @@ namespace Terraria.Graphics.Capture int num11 = num10 + 1; if (num9 == num10 && flag2 && this.SelectedMode != 0) { - SoundEngine.PlaySound(12); this.SelectedMode = 0; this.ToggleCamera(); } @@ -173,7 +171,6 @@ namespace Terraria.Graphics.Capture int num14 = num13 + 1; if (num12 == num13 && flag2 && this.SelectedMode != 1) { - SoundEngine.PlaySound(12); this.SelectedMode = 1; this.ToggleCamera(); } @@ -181,24 +178,17 @@ namespace Terraria.Graphics.Capture int num16 = num14; int num17 = num16 + 1; if (num15 == num16 && flag2) - { - SoundEngine.PlaySound(12); CaptureInterface.ResetFocus(); - } int num18 = index; int num19 = num17; int num20 = num19 + 1; if (num18 == num19 && flag2 && Main.mapEnabled) - { - SoundEngine.PlaySound(12); Main.mapFullscreen = !Main.mapFullscreen; - } int num21 = index; int num22 = num20; int num23 = num22 + 1; if (num21 == num22 && flag2 && this.SelectedMode != 2) { - SoundEngine.PlaySound(12); this.SelectedMode = 2; this.ToggleCamera(); } @@ -206,10 +196,7 @@ namespace Terraria.Graphics.Capture int num25 = num23; int num26 = num25 + 1; if (num24 == num25 && flag2 & flag1) - { - SoundEngine.PlaySound(12); - Utils.OpenFolder(Path.Combine(Main.SavePath, "Captures")); - } + Process.Start(Path.Combine(Main.SavePath, "Captures")); int num27 = index; int num28 = num26; int num29 = num28 + 1; @@ -232,7 +219,7 @@ namespace Terraria.Graphics.Capture CaptureInterface.StartCamera(new CaptureSettings() { Area = new Rectangle(tileCoordinates1.X, tileCoordinates1.Y, tileCoordinates2.X - tileCoordinates1.X + 1, tileCoordinates2.Y - tileCoordinates1.Y + 1), - Biome = CaptureBiome.GetCaptureBiome(CaptureInterface.Settings.BiomeChoiceIndex), + Biome = CaptureBiome.Biomes[CaptureInterface.Settings.BiomeChoice], CaptureBackground = !CaptureInterface.Settings.TransparentBackground, CaptureEntities = CaptureInterface.Settings.IncludeEntities, UseScaling = CaptureInterface.Settings.PackImage, @@ -246,43 +233,43 @@ namespace Terraria.Graphics.Capture int num = 9; for (int index = 0; index < num; ++index) { - Texture2D texture2D = TextureAssets.InventoryBack.Value; + Texture2D texture2D = Main.inventoryBackTexture; float scale = 0.8f; Vector2 position = new Vector2((float) (24 + 46 * index), 24f); Color color = Main.inventoryBack * 0.8f; if (this.SelectedMode == 0 && index == 2) - texture2D = TextureAssets.InventoryBack14.Value; + texture2D = Main.inventoryBack14Texture; else if (this.SelectedMode == 1 && index == 3) - texture2D = TextureAssets.InventoryBack14.Value; + texture2D = Main.inventoryBack14Texture; else if (this.SelectedMode == 2 && index == 6) - texture2D = TextureAssets.InventoryBack14.Value; + texture2D = Main.inventoryBack14Texture; else if (index >= 2 && index <= 3) - texture2D = TextureAssets.InventoryBack2.Value; + texture2D = Main.inventoryBack2Texture; sb.Draw(texture2D, position, new Rectangle?(), color, 0.0f, new Vector2(), scale, SpriteEffects.None, 0.0f); switch (index) { case 0: - texture2D = TextureAssets.Camera[7].Value; + texture2D = Main.cameraTexture[7]; break; case 1: - texture2D = TextureAssets.Camera[0].Value; + texture2D = Main.cameraTexture[0]; break; case 2: case 3: case 4: - texture2D = TextureAssets.Camera[index].Value; + texture2D = Main.cameraTexture[index]; break; case 5: - texture2D = Main.mapFullscreen ? TextureAssets.MapIcon[0].Value : TextureAssets.MapIcon[4].Value; + texture2D = Main.mapFullscreen ? Main.mapIconTexture[0] : Main.mapIconTexture[4]; break; case 6: - texture2D = TextureAssets.Camera[1].Value; + texture2D = Main.cameraTexture[1]; break; case 7: - texture2D = TextureAssets.Camera[6].Value; + texture2D = Main.cameraTexture[6]; break; case 8: - texture2D = TextureAssets.Camera[5].Value; + texture2D = Main.cameraTexture[5]; break; } sb.Draw(texture2D, position + new Vector2(26f) * scale, new Rectangle?(), Color.White, 0.0f, texture2D.Size() / 2f, 1f, SpriteEffects.None, 0.0f); @@ -300,7 +287,7 @@ namespace Terraria.Graphics.Capture else if (!CaptureInterface.EdgeAPinned || !CaptureInterface.EdgeBPinned) flag = true; if (flag) - sb.Draw(TextureAssets.Cd.Value, position + new Vector2(26f) * scale, new Rectangle?(), Color.White * 0.65f, 0.0f, TextureAssets.Cd.Value.Size() / 2f, 1f, SpriteEffects.None, 0.0f); + sb.Draw(Main.cdTexture, position + new Vector2(26f) * scale, new Rectangle?(), Color.White * 0.65f, 0.0f, Main.cdTexture.Size() / 2f, 1f, SpriteEffects.None, 0.0f); } string cursorText = ""; switch (this.HoveredMode) @@ -412,54 +399,54 @@ namespace Terraria.Graphics.Capture float num16 = (float) (Main.maxTilesX / 840) * Main.mapFullscreenScale; float num17 = x2; float num18 = y2; - float num19 = (float) TextureAssets.Map.Width(); - float num20 = (float) TextureAssets.Map.Height(); + float width = (float) Main.mapTexture.Width; + float height = (float) Main.mapTexture.Height; + float num19; + float num20; float num21; float num22; - float num23; - float num24; switch (Main.maxTilesX) { case 4200: - float num25 = num16 * 0.998f; - num21 = num17 - 37.3f * num25; - num22 = num18 - 1.7f * num25; - num23 = (num19 - 16f) * num25; - num24 = (num20 - 8.31f) * num25; + float num23 = num16 * 0.998f; + num19 = num17 - 37.3f * num23; + num20 = num18 - 1.7f * num23; + num21 = (width - 16f) * num23; + num22 = (height - 8.31f) * num23; break; case 6300: - float num26 = num16 * 1.09f; - num21 = num17 - 39.8f * num26; - num22 = y2 - 4.08f * num26; - num23 = (num19 - 26.69f) * num26; - float num27 = (num20 - 6.92f) * num26; - if ((double) num26 < 1.2) + float num24 = num16 * 1.09f; + num19 = num17 - 39.8f * num24; + num20 = y2 - 4.08f * num24; + num21 = (width - 26.69f) * num24; + float num25 = (height - 6.92f) * num24; + if ((double) num24 < 1.2) { - num24 = num27 + 2f; + num22 = num25 + 2f; break; } break; case 6400: - float num28 = num16 * 1.09f; - num21 = num17 - 38.8f * num28; - num22 = y2 - 3.85f * num28; - num23 = (num19 - 13.6f) * num28; - float num29 = (num20 - 6.92f) * num28; - if ((double) num28 < 1.2) + float num26 = num16 * 1.09f; + num19 = num17 - 38.8f * num26; + num20 = y2 - 3.85f * num26; + num21 = (width - 13.6f) * num26; + float num27 = (height - 6.92f) * num26; + if ((double) num26 < 1.2) { - num24 = num29 + 2f; + num22 = num27 + 2f; break; } break; case 8400: - float num30 = num16 * 0.999f; - num21 = num17 - 40.6f * num30; - num22 = y2 - 5f * num30; - num23 = (num19 - 8.045f) * num30; - float num31 = (num20 + 0.12f) * num30; - if ((double) num30 < 1.2) + float num28 = num16 * 0.999f; + num19 = num17 - 40.6f * num28; + num20 = y2 - 5f * num28; + num21 = (width - 8.045f) * num28; + float num29 = (height + 0.12f) * num28; + if ((double) num28 < 1.2) { - num24 = num31 + 1f; + num22 = num29 + 1f; break; } break; @@ -498,7 +485,7 @@ namespace Terraria.Graphics.Capture private static void ConstraintPoints() { - int offScreenTiles = Lighting.OffScreenTiles; + int offScreenTiles = Lighting.offScreenTiles; if (CaptureInterface.EdgeAPinned) CaptureInterface.PointWorldClamp(ref CaptureInterface.EdgeA, offScreenTiles); if (!CaptureInterface.EdgeBPinned) @@ -542,7 +529,7 @@ namespace Terraria.Graphics.Capture this.SelectedMode -= 2; if (this.SelectedMode == selectedMode) return; - SoundEngine.PlaySound(12); + Main.PlaySound(12); } private void UpdateCamera() @@ -565,7 +552,7 @@ namespace Terraria.Graphics.Capture { if ((double) CaptureInterface.CameraFrame == 0.0) return; - sb.Draw(TextureAssets.MagicPixel.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), new Rectangle?(new Rectangle(0, 0, 1, 1)), Color.Black * (CaptureInterface.CameraFrame / 5f)); + sb.Draw(Main.magicPixel, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), new Rectangle?(new Rectangle(0, 0, 1, 1)), Color.Black * (CaptureInterface.CameraFrame / 5f)); if ((double) CaptureInterface.CameraFrame != 5.0) return; float num1 = (float) ((double) CaptureInterface.CameraWaiting - 60.0 + 5.0); @@ -577,17 +564,17 @@ namespace Terraria.Graphics.Capture num3 = 100f; string text1 = num3.ToString("##") + " "; string text2 = "/ 100%"; - Vector2 vector2_1 = FontAssets.DeathText.Value.MeasureString(text1); - Vector2 vector2_2 = FontAssets.DeathText.Value.MeasureString(text2); + Vector2 vector2_1 = Main.fontDeathText.MeasureString(text1); + Vector2 vector2_2 = Main.fontDeathText.MeasureString(text2); Vector2 vector2_3 = new Vector2(-vector2_1.X, (float) (-(double) vector2_1.Y / 2.0)); Vector2 vector2_4 = new Vector2(0.0f, (float) (-(double) vector2_2.Y / 2.0)); - ChatManager.DrawColorCodedStringWithShadow(sb, FontAssets.DeathText.Value, text1, new Vector2((float) Main.screenWidth, (float) Main.screenHeight) / 2f + vector2_3, Color.White * num2, 0.0f, Vector2.Zero, Vector2.One); - ChatManager.DrawColorCodedStringWithShadow(sb, FontAssets.DeathText.Value, text2, new Vector2((float) Main.screenWidth, (float) Main.screenHeight) / 2f + vector2_4, Color.White * num2, 0.0f, Vector2.Zero, Vector2.One); + ChatManager.DrawColorCodedStringWithShadow(sb, Main.fontDeathText, text1, new Vector2((float) Main.screenWidth, (float) Main.screenHeight) / 2f + vector2_3, Color.White * num2, 0.0f, Vector2.Zero, Vector2.One); + ChatManager.DrawColorCodedStringWithShadow(sb, Main.fontDeathText, text2, new Vector2((float) Main.screenWidth, (float) Main.screenHeight) / 2f + vector2_4, Color.White * num2, 0.0f, Vector2.Zero, Vector2.One); } public static void StartCamera(CaptureSettings settings) { - SoundEngine.PlaySound(40); + Main.PlaySound(40); CaptureInterface.CameraSettings = settings; CaptureInterface.CameraLock = true; CaptureInterface.CameraWaiting = 0.0f; @@ -599,8 +586,8 @@ namespace Terraria.Graphics.Capture { public static bool PackImage = true; public static bool IncludeEntities = true; - public static bool TransparentBackground; - public static int BiomeChoiceIndex = -1; + public static bool TransparentBackground = false; + public static int BiomeChoice = 0; public static int ScreenAnchor = 0; public static Color MarkedAreaColor = new Color(0.8f, 0.8f, 0.8f, 0.0f) * 0.3f; } @@ -633,12 +620,12 @@ namespace Terraria.Graphics.Capture if (!this.Selected) return; sb.End(); - sb.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, Main.CurrentWantedZoomMatrix); + sb.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, Main.CurrentWantedZoomMatrix); PlayerInput.SetZoom_Context(); this.DrawMarkedArea(sb); this.DrawCursors(sb); sb.End(); - sb.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, Main.UIScaleMatrix); + sb.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, Main.UIScaleMatrix); PlayerInput.SetZoom_UI(); } @@ -702,11 +689,11 @@ namespace Terraria.Graphics.Capture if (result.Width == 0 || result.Height == 0) return; result.Offset(-rectangle2.X, -rectangle2.Y); - sb.Draw(TextureAssets.MagicPixel.Value, result, CaptureInterface.Settings.MarkedAreaColor); + sb.Draw(Main.magicPixel, result, CaptureInterface.Settings.MarkedAreaColor); for (int index = 0; index < 2; ++index) { - sb.Draw(TextureAssets.MagicPixel.Value, new Rectangle(result.X, result.Y + (index == 1 ? result.Height : -2), result.Width, 2), Color.White); - sb.Draw(TextureAssets.MagicPixel.Value, new Rectangle(result.X + (index == 1 ? result.Width : -2), result.Y, 2, result.Height), Color.White); + sb.Draw(Main.magicPixel, new Rectangle(result.X, result.Y + (index == 1 ? result.Height : -2), result.Width, 2), Color.White); + sb.Draw(Main.magicPixel, new Rectangle(result.X + (index == 1 ? result.Width : -2), result.Y, 2, result.Height), Color.White); } } else @@ -722,11 +709,11 @@ namespace Terraria.Graphics.Capture if (result3.Width == 0 || result3.Height == 0) return; result3.Offset(-rectangle4.X, -rectangle4.Y); - sb.Draw(TextureAssets.MagicPixel.Value, result3, CaptureInterface.Settings.MarkedAreaColor); + sb.Draw(Main.magicPixel, result3, CaptureInterface.Settings.MarkedAreaColor); for (int index = 0; index < 2; ++index) { - sb.Draw(TextureAssets.MagicPixel.Value, new Rectangle(result3.X, result3.Y + (index == 1 ? result3.Height : -2), result3.Width, 2), Color.White); - sb.Draw(TextureAssets.MagicPixel.Value, new Rectangle(result3.X + (index == 1 ? result3.Width : -2), result3.Y, 2, result3.Height), Color.White); + sb.Draw(Main.magicPixel, new Rectangle(result3.X, result3.Y + (index == 1 ? result3.Height : -2), result3.Width, 2), Color.White); + sb.Draw(Main.magicPixel, new Rectangle(result3.X + (index == 1 ? result3.Width : -2), result3.Y, 2, result3.Height), Color.White); } } } @@ -899,11 +886,11 @@ namespace Terraria.Graphics.Capture if (!this.Selected) return; sb.End(); - sb.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, Main.CurrentWantedZoomMatrix); + sb.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, Main.CurrentWantedZoomMatrix); PlayerInput.SetZoom_Context(); this.DrawMarkedArea(sb); sb.End(); - sb.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, Main.UIScaleMatrix); + sb.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, Main.UIScaleMatrix); PlayerInput.SetZoom_UI(); } @@ -1109,7 +1096,7 @@ label_46: return; result1.Offset(-rectangle4.X, -rectangle4.Y); } - sb.Draw(TextureAssets.MagicPixel.Value, result1, CaptureInterface.Settings.MarkedAreaColor); + sb.Draw(Main.magicPixel, result1, CaptureInterface.Settings.MarkedAreaColor); Rectangle r = Rectangle.Empty; for (int index = 0; index < 2; ++index) { @@ -1132,21 +1119,21 @@ label_46: switch (mode) { case 0: - sb.Draw(TextureAssets.MagicPixel.Value, r, Color.Silver); + sb.Draw(Main.magicPixel, r, Color.Silver); break; case 1: Rectangle destinationRectangle1 = new Rectangle(r.X - 2, r.Y, r.Width + 4, r.Height); - sb.Draw(TextureAssets.MagicPixel.Value, destinationRectangle1, Color.White); + sb.Draw(Main.magicPixel, destinationRectangle1, Color.White); destinationRectangle1 = new Rectangle(r.X, r.Y - 2, r.Width, r.Height + 4); - sb.Draw(TextureAssets.MagicPixel.Value, destinationRectangle1, Color.White); - sb.Draw(TextureAssets.MagicPixel.Value, r, Color.White); + sb.Draw(Main.magicPixel, destinationRectangle1, Color.White); + sb.Draw(Main.magicPixel, r, Color.White); break; case 2: Rectangle destinationRectangle2 = new Rectangle(r.X - 2, r.Y, r.Width + 4, r.Height); - sb.Draw(TextureAssets.MagicPixel.Value, destinationRectangle2, Color.Gold); + sb.Draw(Main.magicPixel, destinationRectangle2, Color.Gold); destinationRectangle2 = new Rectangle(r.X, r.Y - 2, r.Width, r.Height + 4); - sb.Draw(TextureAssets.MagicPixel.Value, destinationRectangle2, Color.Gold); - sb.Draw(TextureAssets.MagicPixel.Value, r, Color.Gold); + sb.Draw(Main.magicPixel, destinationRectangle2, Color.Gold); + sb.Draw(Main.magicPixel, r, Color.Gold); break; } } @@ -1165,6 +1152,12 @@ label_46: { rectangle.X = 227 - rectangle.Width / 2; rectangle.Y = 80; + int index = 0; + Player player = Main.player[Main.myPlayer]; + while (index < player.buffTime.Length && player.buffTime[index] > 0) + ++index; + int num = index / 11 + (index % 11 >= 3 ? 1 : 0); + rectangle.Y += 48 * num; } return rectangle; } @@ -1194,32 +1187,24 @@ label_46: private void PressButton(int button) { - bool flag = false; switch (button) { case 0: CaptureInterface.Settings.PackImage = !CaptureInterface.Settings.PackImage; - flag = true; break; case 1: CaptureInterface.Settings.IncludeEntities = !CaptureInterface.Settings.IncludeEntities; - flag = true; break; case 2: CaptureInterface.Settings.TransparentBackground = !CaptureInterface.Settings.TransparentBackground; - flag = true; break; case 6: - CaptureInterface.Settings.PackImage = true; + CaptureInterface.Settings.PackImage = false; CaptureInterface.Settings.IncludeEntities = true; CaptureInterface.Settings.TransparentBackground = false; - CaptureInterface.Settings.BiomeChoiceIndex = -1; - flag = true; + CaptureInterface.Settings.BiomeChoice = 0; break; } - if (!flag) - return; - SoundEngine.PlaySound(12); } private void DrawWaterChoices(SpriteBatch spritebatch, Point start, Point mouse) @@ -1227,67 +1212,64 @@ label_46: Rectangle r = new Rectangle(0, 0, 20, 20); for (int index1 = 0; index1 < 2; ++index1) { - for (int index2 = 0; index2 < 7; ++index2) + for (int index2 = 0; index2 < 5; ++index2) { - if (index1 != 1 || index2 != 6) + if (index1 != 1 || index2 != 3) { - int num1 = index2 + index1 * 7; + int index3 = index2 + index1 * 5; r.X = start.X + 24 * index2 + 12 * index1; r.Y = start.Y + 24 * index1; - int num2 = num1; - int num3 = 0; + if (index1 == 1 && index2 == 4) + r.X -= 24; + int num1 = 0; if (r.Contains(mouse)) { if (Main.mouseLeft && Main.mouseLeftRelease) - { - SoundEngine.PlaySound(12); - CaptureInterface.Settings.BiomeChoiceIndex = num2; - } - ++num3; + CaptureInterface.Settings.BiomeChoice = this.BiomeWater(index3); + ++num1; } - if (CaptureInterface.Settings.BiomeChoiceIndex == num2) - num3 += 2; - Texture2D texture = TextureAssets.Extra[130].Value; - int x = num1 * 18; + if (CaptureInterface.Settings.BiomeChoice == this.BiomeWater(index3)) + num1 += 2; + Texture2D texture = Main.liquidTexture[this.BiomeWater(index3)]; + int x = (int) Main.wFrame * 18; Color white = Color.White; - float num4 = 1f; - if (num3 < 2) - num4 *= 0.5f; - if (num3 % 2 == 1) - spritebatch.Draw(TextureAssets.MagicPixel.Value, r.TopLeft(), new Rectangle?(new Rectangle(0, 0, 1, 1)), Color.Gold, 0.0f, Vector2.Zero, new Vector2(20f), SpriteEffects.None, 0.0f); + float num2 = 1f; + if (num1 < 2) + num2 *= 0.5f; + if (num1 % 2 == 1) + spritebatch.Draw(Main.magicPixel, r.TopLeft(), new Rectangle?(new Rectangle(0, 0, 1, 1)), Color.Gold, 0.0f, Vector2.Zero, new Vector2(20f), SpriteEffects.None, 0.0f); else - spritebatch.Draw(TextureAssets.MagicPixel.Value, r.TopLeft(), new Rectangle?(new Rectangle(0, 0, 1, 1)), Color.White * num4, 0.0f, Vector2.Zero, new Vector2(20f), SpriteEffects.None, 0.0f); - spritebatch.Draw(texture, r.TopLeft() + new Vector2(2f), new Rectangle?(new Rectangle(x, 0, 16, 16)), Color.White * num4); + spritebatch.Draw(Main.magicPixel, r.TopLeft(), new Rectangle?(new Rectangle(0, 0, 1, 1)), Color.White * num2, 0.0f, Vector2.Zero, new Vector2(20f), SpriteEffects.None, 0.0f); + spritebatch.Draw(texture, r.TopLeft() + new Vector2(2f), new Rectangle?(new Rectangle(x, 0, 16, 16)), Color.White * num2); } } } } - private int UnnecessaryBiomeSelectionTypeConversion(int index) + private int BiomeWater(int index) { switch (index) { case 0: - return -1; - case 1: return 0; - case 2: + case 1: return 2; + case 2: + return 3; case 3: + return 4; case 4: + return 5; case 5: + return 6; case 6: + return 7; case 7: + return 8; case 8: - return index; + return 9; case 9: return 10; - case 10: - return 12; - case 11: - return 13; - case 12: - return 14; default: return 0; } @@ -1324,12 +1306,12 @@ label_46: if (!this.Selected) return; sb.End(); - sb.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, Main.CurrentWantedZoomMatrix); + sb.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, Main.CurrentWantedZoomMatrix); PlayerInput.SetZoom_Context(); ((CaptureInterface.ModeDragBounds) CaptureInterface.Modes[1]).currentAim = -1; ((CaptureInterface.ModeDragBounds) CaptureInterface.Modes[1]).DrawMarkedArea(sb); sb.End(); - sb.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, Main.UIScaleMatrix); + sb.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, Main.UIScaleMatrix); PlayerInput.SetZoom_UI(); Rectangle rect = this.GetRect(); Utils.DrawInvBG(sb, rect, new Color(63, 65, 151, (int) byte.MaxValue) * 0.485f); @@ -1341,10 +1323,10 @@ label_46: Color baseColor = Color.White; if (button == this.hoveredButton) baseColor = Color.Gold; - ChatManager.DrawColorCodedStringWithShadow(sb, FontAssets.ItemStack.Value, key, rect.TopLeft() + new Vector2(20f, (float) (20 + 20 * button)), baseColor, 0.0f, Vector2.Zero, Vector2.One); - ChatManager.DrawColorCodedStringWithShadow(sb, FontAssets.ItemStack.Value, text, rect.TopRight() + new Vector2(-20f, (float) (20 + 20 * button)), baseColor, 0.0f, FontAssets.ItemStack.Value.MeasureString(text) * Vector2.UnitX, Vector2.One); + ChatManager.DrawColorCodedStringWithShadow(sb, Main.fontItemStack, key, rect.TopLeft() + new Vector2(20f, (float) (20 + 20 * button)), baseColor, 0.0f, Vector2.Zero, Vector2.One); + ChatManager.DrawColorCodedStringWithShadow(sb, Main.fontItemStack, text, rect.TopRight() + new Vector2(-20f, (float) (20 + 20 * button)), baseColor, 0.0f, Main.fontItemStack.MeasureString(text) * Vector2.UnitX, Vector2.One); } - this.DrawWaterChoices(sb, (rect.TopLeft() + new Vector2((float) (rect.Width / 2 - 84), 90f)).ToPoint(), Main.MouseScreen.ToPoint()); + this.DrawWaterChoices(sb, (rect.TopLeft() + new Vector2((float) (rect.Width / 2 - 58), 90f)).ToPoint(), Main.MouseScreen.ToPoint()); } public override void ToggleActive(bool tickedOn) diff --git a/Graphics/Capture/CaptureManager.cs b/Graphics/Capture/CaptureManager.cs index 5745a06..5206b2d 100644 --- a/Graphics/Capture/CaptureManager.cs +++ b/Graphics/Capture/CaptureManager.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.Capture.CaptureManager -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/Graphics/Capture/CaptureSettings.cs b/Graphics/Capture/CaptureSettings.cs index b3363c1..433d4ed 100644 --- a/Graphics/Capture/CaptureSettings.cs +++ b/Graphics/Capture/CaptureSettings.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.Capture.CaptureSettings -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -15,7 +15,7 @@ namespace Terraria.Graphics.Capture public bool UseScaling = true; public string OutputName; public bool CaptureEntities = true; - public CaptureBiome Biome = CaptureBiome.DefaultPurity; + public CaptureBiome Biome = CaptureBiome.Biomes[0]; public bool CaptureMech; public bool CaptureBackground; diff --git a/Graphics/Effects/CustomSky.cs b/Graphics/Effects/CustomSky.cs index c43f615..d4618dd 100644 --- a/Graphics/Effects/CustomSky.cs +++ b/Graphics/Effects/CustomSky.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.Effects.CustomSky -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/Graphics/Effects/EffectManager`1.cs b/Graphics/Effects/EffectManager`1.cs index bcfc996..c55801c 100644 --- a/Graphics/Effects/EffectManager`1.cs +++ b/Graphics/Effects/EffectManager`1.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.Effects.EffectManager`1 -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/Graphics/Effects/EffectPriority.cs b/Graphics/Effects/EffectPriority.cs index 1b8bbba..e3fdcbc 100644 --- a/Graphics/Effects/EffectPriority.cs +++ b/Graphics/Effects/EffectPriority.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.Effects.EffectPriority -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Graphics.Effects diff --git a/Graphics/Effects/Filter.cs b/Graphics/Effects/Filter.cs index a078e36..5412e07 100644 --- a/Graphics/Effects/Filter.cs +++ b/Graphics/Effects/Filter.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.Effects.Filter -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -31,16 +31,16 @@ namespace Terraria.Graphics.Effects public ScreenShaderData GetShader() => this._shader; - public override void Activate(Vector2 position, params object[] args) + internal override void Activate(Vector2 position, params object[] args) { this._shader.UseGlobalOpacity(this.Opacity); this._shader.UseTargetPosition(position); this.Active = true; } - public override void Deactivate(params object[] args) => this.Active = false; + internal override void Deactivate(params object[] args) => this.Active = false; - public bool IsInUse() => this.Active || (double) this.Opacity > 0.0; + public bool IsInUse() => this.Active || (double) this.Opacity != 0.0; public bool IsActive() => this.Active; diff --git a/Graphics/Effects/FilterManager.cs b/Graphics/Effects/FilterManager.cs index 0cd44f0..bcb79ab 100644 --- a/Graphics/Effects/FilterManager.cs +++ b/Graphics/Effects/FilterManager.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.Effects.FilterManager -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -73,7 +73,7 @@ namespace Terraria.Graphics.Effects } } - public void BeginCapture(RenderTarget2D screenTarget1, Color clearColor) + public void BeginCapture() { if (this._activeFilterCount == 0 && this.OnPostDraw == null) { @@ -82,8 +82,8 @@ namespace Terraria.Graphics.Effects else { this._captureThisFrame = true; - Main.instance.GraphicsDevice.SetRenderTarget(screenTarget1); - Main.instance.GraphicsDevice.Clear(clearColor); + Main.instance.GraphicsDevice.SetRenderTarget(Main.screenTarget); + Main.instance.GraphicsDevice.Clear(Color.Black); } } @@ -120,29 +120,25 @@ namespace Terraria.Graphics.Effects } } - public void EndCapture( - RenderTarget2D finalTexture, - RenderTarget2D screenTarget1, - RenderTarget2D screenTarget2, - Color clearColor) + public void EndCapture() { if (!this._captureThisFrame) return; LinkedListNode linkedListNode = this._activeFilters.First; int count = this._activeFilters.Count; Filter filter1 = (Filter) null; - RenderTarget2D renderTarget2D = screenTarget1; + RenderTarget2D renderTarget2D = Main.screenTarget; GraphicsDevice graphicsDevice = Main.instance.GraphicsDevice; int num = 0; if ((double) Main.player[Main.myPlayer].gravDir == -1.0) { - RenderTarget2D renderTarget = screenTarget2; - graphicsDevice.SetRenderTarget(renderTarget); - graphicsDevice.Clear(clearColor); + RenderTarget2D screenTargetSwap = Main.screenTargetSwap; + graphicsDevice.SetRenderTarget(screenTargetSwap); + graphicsDevice.Clear(Color.Black); Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.Default, RasterizerState.CullNone, (Effect) null, Matrix.Invert(Main.GameViewMatrix.EffectMatrix)); Main.spriteBatch.Draw((Texture2D) renderTarget2D, Vector2.Zero, Color.White); Main.spriteBatch.End(); - renderTarget2D = screenTarget2; + renderTarget2D = Main.screenTargetSwap; } LinkedListNode next; for (; linkedListNode != null; linkedListNode = next) @@ -156,21 +152,21 @@ namespace Terraria.Graphics.Effects { if (filter1 != null) { - RenderTarget2D renderTarget = renderTarget2D != screenTarget1 ? screenTarget1 : screenTarget2; + RenderTarget2D renderTarget = renderTarget2D != Main.screenTarget ? Main.screenTarget : Main.screenTargetSwap; graphicsDevice.SetRenderTarget(renderTarget); - graphicsDevice.Clear(clearColor); + graphicsDevice.Clear(Color.Black); Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); filter1.Apply(); - Main.spriteBatch.Draw((Texture2D) renderTarget2D, Vector2.Zero, Main.ColorOfTheSkies); + Main.spriteBatch.Draw((Texture2D) renderTarget2D, Vector2.Zero, Main.bgColor); Main.spriteBatch.End(); - renderTarget2D = renderTarget2D != screenTarget1 ? screenTarget1 : screenTarget2; + renderTarget2D = renderTarget2D != Main.screenTarget ? Main.screenTarget : Main.screenTargetSwap; } filter1 = filter2; } } } - graphicsDevice.SetRenderTarget(finalTexture); - graphicsDevice.Clear(clearColor); + graphicsDevice.SetRenderTarget((RenderTarget2D) null); + graphicsDevice.Clear(Color.Black); if ((double) Main.player[Main.myPlayer].gravDir == -1.0) Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.Default, RasterizerState.CullNone, (Effect) null, Main.GameViewMatrix.EffectMatrix); else @@ -178,7 +174,7 @@ namespace Terraria.Graphics.Effects if (filter1 != null) { filter1.Apply(); - Main.spriteBatch.Draw((Texture2D) renderTarget2D, Vector2.Zero, Main.ColorOfTheSkies); + Main.spriteBatch.Draw((Texture2D) renderTarget2D, Vector2.Zero, Main.bgColor); } else Main.spriteBatch.Draw((Texture2D) renderTarget2D, Vector2.Zero, Color.White); diff --git a/Graphics/Effects/Filters.cs b/Graphics/Effects/Filters.cs index 7597e17..1fe0baa 100644 --- a/Graphics/Effects/Filters.cs +++ b/Graphics/Effects/Filters.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.Effects.Filters -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Graphics.Effects diff --git a/Graphics/Effects/GameEffect.cs b/Graphics/Effects/GameEffect.cs index 87d3cee..55f26e0 100644 --- a/Graphics/Effects/GameEffect.cs +++ b/Graphics/Effects/GameEffect.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.Effects.GameEffect -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -32,8 +32,8 @@ namespace Terraria.Graphics.Effects public abstract bool IsVisible(); - public abstract void Activate(Vector2 position, params object[] args); + internal abstract void Activate(Vector2 position, params object[] args); - public abstract void Deactivate(params object[] args); + internal abstract void Deactivate(params object[] args); } } diff --git a/Graphics/Effects/MissingEffectException.cs b/Graphics/Effects/MissingEffectException.cs index f2e562b..66dd161 100644 --- a/Graphics/Effects/MissingEffectException.cs +++ b/Graphics/Effects/MissingEffectException.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.Effects.MissingEffectException -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; diff --git a/Graphics/Effects/Overlay.cs b/Graphics/Effects/Overlay.cs index 8e2f1e3..0539a2b 100644 --- a/Graphics/Effects/Overlay.cs +++ b/Graphics/Effects/Overlay.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.Effects.Overlay -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/Graphics/Effects/OverlayManager.cs b/Graphics/Effects/OverlayManager.cs index a59142e..d653c89 100644 --- a/Graphics/Effects/OverlayManager.cs +++ b/Graphics/Effects/OverlayManager.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.Effects.OverlayManager -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/Graphics/Effects/OverlayMode.cs b/Graphics/Effects/OverlayMode.cs index c7c5ffc..519cfef 100644 --- a/Graphics/Effects/OverlayMode.cs +++ b/Graphics/Effects/OverlayMode.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.Effects.OverlayMode -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Graphics.Effects diff --git a/Graphics/Effects/Overlays.cs b/Graphics/Effects/Overlays.cs index 1e37768..31ccec8 100644 --- a/Graphics/Effects/Overlays.cs +++ b/Graphics/Effects/Overlays.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.Effects.Overlays -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Graphics.Effects diff --git a/Graphics/Effects/RenderLayers.cs b/Graphics/Effects/RenderLayers.cs index 6f6b6fc..fdb876e 100644 --- a/Graphics/Effects/RenderLayers.cs +++ b/Graphics/Effects/RenderLayers.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.Effects.RenderLayers -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Graphics.Effects diff --git a/Graphics/Effects/SimpleOverlay.cs b/Graphics/Effects/SimpleOverlay.cs index 8a3a6dc..946bff7 100644 --- a/Graphics/Effects/SimpleOverlay.cs +++ b/Graphics/Effects/SimpleOverlay.cs @@ -1,19 +1,18 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.Effects.SimpleOverlay -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using Terraria.Graphics.Shaders; namespace Terraria.Graphics.Effects { public class SimpleOverlay : Overlay { - private Asset _texture; + private Ref _texture; private ScreenShaderData _shader; public Vector2 TargetPosition = Vector2.Zero; @@ -24,7 +23,7 @@ namespace Terraria.Graphics.Effects RenderLayers layer = RenderLayers.All) : base(priority, layer) { - this._texture = Main.Assets.Request(textureName == null ? "" : textureName, (AssetRequestMode) 1); + this._texture = TextureManager.AsyncLoad(textureName == null ? "" : textureName); this._shader = shader; } @@ -35,7 +34,7 @@ namespace Terraria.Graphics.Effects RenderLayers layer = RenderLayers.All) : base(priority, layer) { - this._texture = Main.Assets.Request(textureName == null ? "" : textureName, (AssetRequestMode) 1); + this._texture = TextureManager.AsyncLoad(textureName == null ? "" : textureName); this._shader = new ScreenShaderData(Main.ScreenShaderRef, shaderName); } @@ -46,18 +45,18 @@ namespace Terraria.Graphics.Effects this._shader.UseGlobalOpacity(this.Opacity); this._shader.UseTargetPosition(this.TargetPosition); this._shader.Apply(); - spriteBatch.Draw(this._texture.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Main.ColorOfTheSkies); + spriteBatch.Draw(this._texture.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Main.bgColor); } public override void Update(GameTime gameTime) => this._shader.Update(gameTime); - public override void Activate(Vector2 position, params object[] args) + internal override void Activate(Vector2 position, params object[] args) { this.TargetPosition = position; this.Mode = OverlayMode.FadeIn; } - public override void Deactivate(params object[] args) => this.Mode = OverlayMode.FadeOut; + internal override void Deactivate(params object[] args) => this.Mode = OverlayMode.FadeOut; public override bool IsVisible() => (double) this._shader.CombinedOpacity > 0.0; } diff --git a/Graphics/Effects/SkyManager.cs b/Graphics/Effects/SkyManager.cs index 3d16156..8569988 100644 --- a/Graphics/Effects/SkyManager.cs +++ b/Graphics/Effects/SkyManager.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.Effects.SkyManager -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -26,16 +26,13 @@ namespace Terraria.Graphics.Effects public void Update(GameTime gameTime) { LinkedListNode next; - for (int index = 0; index < Main.dayRate; ++index) + for (LinkedListNode node = this._activeSkies.First; node != null; node = next) { - for (LinkedListNode node = this._activeSkies.First; node != null; node = next) - { - CustomSky customSky = node.Value; - next = node.Next; - customSky.Update(gameTime); - if (!customSky.IsActive()) - this._activeSkies.Remove(node); - } + CustomSky customSky = node.Value; + next = node.Next; + customSky.Update(gameTime); + if (!customSky.IsActive()) + this._activeSkies.Remove(node); } } diff --git a/Graphics/EmpressBladeDrawer.cs b/Graphics/EmpressBladeDrawer.cs deleted file mode 100644 index 4ee1d76..0000000 --- a/Graphics/EmpressBladeDrawer.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.EmpressBladeDrawer -// 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; -using Terraria.DataStructures; -using Terraria.Graphics.Shaders; - -namespace Terraria.Graphics -{ - public struct EmpressBladeDrawer - { - public const int TotalIllusions = 1; - public const int FramesPerImportantTrail = 60; - private static VertexStrip _vertexStrip = new VertexStrip(); - public Color ColorStart; - public Color ColorEnd; - - public void Draw(Projectile proj) - { - double num = (double) proj.ai[1]; - MiscShaderData miscShaderData = GameShaders.Misc["EmpressBlade"]; - miscShaderData.UseShaderSpecificData(new Vector4(1f, 0.0f, 0.0f, 0.6f)); - miscShaderData.Apply(new DrawData?()); - EmpressBladeDrawer._vertexStrip.PrepareStrip(proj.oldPos, proj.oldRot, new VertexStrip.StripColorFunction(this.StripColors), new VertexStrip.StripHalfWidthFunction(this.StripWidth), -Main.screenPosition + proj.Size / 2f, new int?(proj.oldPos.Length), true); - EmpressBladeDrawer._vertexStrip.DrawTrail(); - Main.pixelShader.CurrentTechnique.Passes[0].Apply(); - } - - private Color StripColors(float progressOnStrip) - { - Color color = Color.Lerp(this.ColorStart, this.ColorEnd, Utils.GetLerpValue(0.0f, 0.7f, progressOnStrip, true)) * (1f - Utils.GetLerpValue(0.0f, 0.98f, progressOnStrip, true)); - color.A /= (byte) 2; - return color; - } - - private float StripWidth(float progressOnStrip) => 36f; - } -} diff --git a/Graphics/FinalFractalHelper.cs b/Graphics/FinalFractalHelper.cs deleted file mode 100644 index 70804c0..0000000 --- a/Graphics/FinalFractalHelper.cs +++ /dev/null @@ -1,201 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.FinalFractalHelper -// 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; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; -using Terraria.DataStructures; -using Terraria.Graphics.Shaders; - -namespace Terraria.Graphics -{ - [StructLayout(LayoutKind.Sequential, Size = 1)] - public struct FinalFractalHelper - { - public const int TotalIllusions = 4; - public const int FramesPerImportantTrail = 15; - private static VertexStrip _vertexStrip = new VertexStrip(); - private static Dictionary _fractalProfiles = new Dictionary() - { - { - 65, - new FinalFractalHelper.FinalFractalProfile(48f, new Color(236, 62, 192)) - }, - { - 1123, - new FinalFractalHelper.FinalFractalProfile(48f, Main.OurFavoriteColor) - }, - { - 46, - new FinalFractalHelper.FinalFractalProfile(48f, new Color(122, 66, 191)) - }, - { - 121, - new FinalFractalHelper.FinalFractalProfile(76f, new Color(254, 158, 35)) - }, - { - 190, - new FinalFractalHelper.FinalFractalProfile(70f, new Color(107, 203, 0)) - }, - { - 368, - new FinalFractalHelper.FinalFractalProfile(70f, new Color(236, 200, 19)) - }, - { - 674, - new FinalFractalHelper.FinalFractalProfile(70f, new Color(236, 200, 19)) - }, - { - 273, - new FinalFractalHelper.FinalFractalProfile(70f, new Color(179, 54, 201)) - }, - { - 675, - new FinalFractalHelper.FinalFractalProfile(70f, new Color(179, 54, 201)) - }, - { - 2880, - new FinalFractalHelper.FinalFractalProfile(70f, new Color(84, 234, 245)) - }, - { - 989, - new FinalFractalHelper.FinalFractalProfile(48f, new Color(91, 158, 232)) - }, - { - 1826, - new FinalFractalHelper.FinalFractalProfile(76f, new Color(252, 95, 4)) - }, - { - 3063, - new FinalFractalHelper.FinalFractalProfile(76f, new Color(254, 194, 250)) - }, - { - 3065, - new FinalFractalHelper.FinalFractalProfile(70f, new Color(237, 63, 133)) - }, - { - 757, - new FinalFractalHelper.FinalFractalProfile(70f, new Color(80, 222, 122)) - }, - { - 155, - new FinalFractalHelper.FinalFractalProfile(70f, new Color(56, 78, 210)) - }, - { - 795, - new FinalFractalHelper.FinalFractalProfile(70f, new Color(237, 28, 36)) - }, - { - 3018, - new FinalFractalHelper.FinalFractalProfile(80f, new Color(143, 215, 29)) - }, - { - 4144, - new FinalFractalHelper.FinalFractalProfile(45f, new Color(178, (int) byte.MaxValue, 180)) - }, - { - 3507, - new FinalFractalHelper.FinalFractalProfile(45f, new Color(235, 166, 135)) - }, - { - 4956, - new FinalFractalHelper.FinalFractalProfile(86f, new Color(178, (int) byte.MaxValue, 180)) - } - }; - private static FinalFractalHelper.FinalFractalProfile _defaultProfile = new FinalFractalHelper.FinalFractalProfile(50f, Color.White); - - public static int GetRandomProfileIndex() - { - List list = FinalFractalHelper._fractalProfiles.Keys.ToList(); - int index = Main.rand.Next(list.Count); - if (list[index] == 4956) - { - list.RemoveAt(index); - index = Main.rand.Next(list.Count); - } - return list[index]; - } - - public void Draw(Projectile proj) - { - FinalFractalHelper.FinalFractalProfile finalFractalProfile = FinalFractalHelper.GetFinalFractalProfile((int) proj.ai[1]); - MiscShaderData miscShaderData = GameShaders.Misc["FinalFractal"]; - miscShaderData.UseShaderSpecificData(new Vector4(4f, 0.0f, 0.0f, 4f)); - miscShaderData.UseImage0("Images/Extra_" + (object) (short) 201); - miscShaderData.UseImage1("Images/Extra_" + (object) (short) 193); - miscShaderData.Apply(new DrawData?()); - FinalFractalHelper._vertexStrip.PrepareStrip(proj.oldPos, proj.oldRot, finalFractalProfile.colorMethod, finalFractalProfile.widthMethod, -Main.screenPosition + proj.Size / 2f, new int?(proj.oldPos.Length), true); - FinalFractalHelper._vertexStrip.DrawTrail(); - Main.pixelShader.CurrentTechnique.Passes[0].Apply(); - } - - public static FinalFractalHelper.FinalFractalProfile GetFinalFractalProfile( - int usedSwordId) - { - FinalFractalHelper.FinalFractalProfile defaultProfile; - if (!FinalFractalHelper._fractalProfiles.TryGetValue(usedSwordId, out defaultProfile)) - defaultProfile = FinalFractalHelper._defaultProfile; - return defaultProfile; - } - - private Color StripColors(float progressOnStrip) - { - Color color = Color.Lerp(Color.White, Color.Violet, Utils.GetLerpValue(0.0f, 0.7f, progressOnStrip, true)) * (1f - Utils.GetLerpValue(0.0f, 0.98f, progressOnStrip, false)); - color.A /= (byte) 2; - return color; - } - - private float StripWidth(float progressOnStrip) => 50f; - - public delegate void SpawnDustMethod(Vector2 centerPosition, float rotation, Vector2 velocity); - - public struct FinalFractalProfile - { - public float trailWidth; - public Color trailColor; - public FinalFractalHelper.SpawnDustMethod dustMethod; - public VertexStrip.StripColorFunction colorMethod; - public VertexStrip.StripHalfWidthFunction widthMethod; - - public FinalFractalProfile(float fullBladeLength, Color color) - { - this.trailWidth = fullBladeLength / 2f; - this.trailColor = color; - this.widthMethod = (VertexStrip.StripHalfWidthFunction) null; - this.colorMethod = (VertexStrip.StripColorFunction) null; - this.dustMethod = (FinalFractalHelper.SpawnDustMethod) null; - this.widthMethod = new VertexStrip.StripHalfWidthFunction(this.StripWidth); - this.colorMethod = new VertexStrip.StripColorFunction(this.StripColors); - this.dustMethod = new FinalFractalHelper.SpawnDustMethod(this.StripDust); - } - - private void StripDust(Vector2 centerPosition, float rotation, Vector2 velocity) - { - if (Main.rand.Next(9) != 0) - return; - int num = Main.rand.Next(1, 4); - for (int index = 0; index < num; ++index) - { - Dust dust = Dust.NewDustPerfect(centerPosition, 278, Alpha: 100, newColor: Color.Lerp(this.trailColor, Color.White, Main.rand.NextFloat() * 0.3f)); - dust.scale = 0.4f; - dust.fadeIn = (float) (0.400000005960464 + (double) Main.rand.NextFloat() * 0.300000011920929); - dust.noGravity = true; - dust.velocity += rotation.ToRotationVector2() * (float) (3.0 + (double) Main.rand.NextFloat() * 4.0); - } - } - - private Color StripColors(float progressOnStrip) - { - Color color = this.trailColor * (1f - Utils.GetLerpValue(0.0f, 0.98f, progressOnStrip, false)); - color.A /= (byte) 2; - return color; - } - - private float StripWidth(float progressOnStrip) => this.trailWidth; - } - } -} diff --git a/Graphics/FlameLashDrawer.cs b/Graphics/FlameLashDrawer.cs deleted file mode 100644 index 0a414c8..0000000 --- a/Graphics/FlameLashDrawer.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.FlameLashDrawer -// 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; -using Terraria.DataStructures; -using Terraria.Graphics.Shaders; - -namespace Terraria.Graphics -{ - public struct FlameLashDrawer - { - private static VertexStrip _vertexStrip = new VertexStrip(); - private float transitToDark; - - public void Draw(Projectile proj) - { - this.transitToDark = Utils.GetLerpValue(0.0f, 6f, proj.localAI[0], true); - MiscShaderData miscShaderData = GameShaders.Misc["FlameLash"]; - miscShaderData.UseSaturation(-2f); - miscShaderData.UseOpacity(MathHelper.Lerp(4f, 8f, this.transitToDark)); - miscShaderData.Apply(new DrawData?()); - FlameLashDrawer._vertexStrip.PrepareStripWithProceduralPadding(proj.oldPos, proj.oldRot, new VertexStrip.StripColorFunction(this.StripColors), new VertexStrip.StripHalfWidthFunction(this.StripWidth), -Main.screenPosition + proj.Size / 2f); - FlameLashDrawer._vertexStrip.DrawTrail(); - Main.pixelShader.CurrentTechnique.Passes[0].Apply(); - } - - private Color StripColors(float progressOnStrip) - { - float lerpValue = Utils.GetLerpValue((float) (0.0 - 0.100000001490116 * (double) this.transitToDark), (float) (0.699999988079071 - 0.200000002980232 * (double) this.transitToDark), progressOnStrip, true); - Color color = Color.Lerp(Color.Lerp(Color.White, Color.Orange, this.transitToDark * 0.5f), Color.Red, lerpValue) * (1f - Utils.GetLerpValue(0.0f, 0.98f, progressOnStrip, false)); - color.A /= (byte) 8; - return color; - } - - private float StripWidth(float progressOnStrip) - { - float lerpValue = Utils.GetLerpValue(0.0f, (float) (0.0599999986588955 + (double) this.transitToDark * 0.00999999977648258), progressOnStrip, true); - float num = (float) (1.0 - (1.0 - (double) lerpValue) * (1.0 - (double) lerpValue)); - return MathHelper.Lerp((float) (24.0 + (double) this.transitToDark * 16.0), 8f, Utils.GetLerpValue(0.0f, 1f, progressOnStrip, true)) * num; - } - } -} diff --git a/Graphics/Light/ILightingEngine.cs b/Graphics/Light/ILightingEngine.cs deleted file mode 100644 index 46aaa85..0000000 --- a/Graphics/Light/ILightingEngine.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.Light.ILightingEngine -// 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.Graphics.Light -{ - public interface ILightingEngine - { - void Rebuild(); - - void AddLight(int x, int y, Vector3 color); - - void ProcessArea(Rectangle area); - - Vector3 GetColor(int x, int y); - - void Clear(); - } -} diff --git a/Graphics/Light/LegacyLighting.cs b/Graphics/Light/LegacyLighting.cs deleted file mode 100644 index cedaf1a..0000000 --- a/Graphics/Light/LegacyLighting.cs +++ /dev/null @@ -1,1258 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.Light.LegacyLighting -// 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; -using ReLogic.Threading; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using Terraria.DataStructures; -using Terraria.Utilities; - -namespace Terraria.Graphics.Light -{ - public class LegacyLighting : ILightingEngine - { - public static int RenderPhases = 4; - private bool _rgb = true; - private int _offScreenTiles2 = 35; - private float _oldSkyColor; - private float _skyColor; - private int _requestedRectLeft; - private int _requestedRectRight; - private int _requestedRectTop; - private int _requestedRectBottom; - private LegacyLighting.LightingState[][] _states; - private LegacyLighting.LightingState[][] _axisFlipStates; - private LegacyLighting.LightingSwipeData _swipe; - private LegacyLighting.LightingSwipeData[] _threadSwipes; - private int _scrX; - private int _scrY; - private int _minX; - private int _maxX; - private int _minY; - private int _maxY; - private const int MAX_TEMP_LIGHTS = 2000; - private Dictionary _tempLights; - private int _expandedRectLeft; - private int _expandedRectTop; - private int _expandedRectRight; - private int _expandedRectBottom; - private float _negLight = 0.04f; - private float _negLight2 = 0.16f; - private float _wetLightR = 0.16f; - private float _wetLightG = 0.16f; - private float _wetLightB = 0.16f; - private float _honeyLightR = 0.16f; - private float _honeyLightG = 0.16f; - private float _honeyLightB = 0.16f; - private float _blueWave = 1f; - private int _blueDir = 1; - private LegacyLighting.RectArea _minBoundArea; - private LegacyLighting.RectArea _requestedArea; - private LegacyLighting.RectArea _expandedArea; - private LegacyLighting.RectArea _offScreenTiles2ExpandedArea; - private TileLightScanner _tileScanner; - private readonly Camera _camera; - private World _world; - private static FastRandom _swipeRandom = FastRandom.CreateWithRandomSeed(); - private LightMap _lightMap = new LightMap(); - - public int Mode { get; set; } - - public bool IsColorOrWhiteMode => this.Mode < 2; - - public LegacyLighting(Camera camera, World world) - { - this._camera = camera; - this._world = world; - this._tileScanner = new TileLightScanner(world); - } - - public Vector3 GetColor(int x, int y) - { - int index1 = x - this._requestedRectLeft + Lighting.OffScreenTiles; - int index2 = y - this._requestedRectTop + Lighting.OffScreenTiles; - Vector2 unscaledSize = this._camera.UnscaledSize; - if (index1 < 0 || index2 < 0 || (double) index1 >= (double) unscaledSize.X / 16.0 + (double) (Lighting.OffScreenTiles * 2) + 10.0 || (double) index2 >= (double) unscaledSize.Y / 16.0 + (double) (Lighting.OffScreenTiles * 2)) - return Vector3.Zero; - LegacyLighting.LightingState lightingState = this._states[index1][index2]; - return new Vector3(lightingState.R, lightingState.G, lightingState.B); - } - - public void Rebuild() - { - this._tempLights = new Dictionary(); - this._swipe = new LegacyLighting.LightingSwipeData(); - this._threadSwipes = new LegacyLighting.LightingSwipeData[Environment.ProcessorCount]; - for (int index = 0; index < this._threadSwipes.Length; ++index) - this._threadSwipes[index] = new LegacyLighting.LightingSwipeData(); - int width = (int) this._camera.UnscaledSize.X / 16 + 90 + 10; - int height = (int) this._camera.UnscaledSize.Y / 16 + 90 + 10; - this._lightMap.SetSize(width, height); - if (this._states != null && this._states.Length >= width && this._states[0].Length >= height) - return; - this._states = new LegacyLighting.LightingState[width][]; - this._axisFlipStates = new LegacyLighting.LightingState[height][]; - for (int index = 0; index < height; ++index) - this._axisFlipStates[index] = new LegacyLighting.LightingState[width]; - for (int index1 = 0; index1 < width; ++index1) - { - LegacyLighting.LightingState[] lightingStateArray = new LegacyLighting.LightingState[height]; - for (int index2 = 0; index2 < height; ++index2) - { - LegacyLighting.LightingState lightingState = new LegacyLighting.LightingState(); - lightingStateArray[index2] = lightingState; - this._axisFlipStates[index2][index1] = lightingState; - } - this._states[index1] = lightingStateArray; - } - } - - public void AddLight(int x, int y, Vector3 color) - { - float x1 = color.X; - float y1 = color.Y; - float z = color.Z; - if (x - this._requestedRectLeft + Lighting.OffScreenTiles < 0 || (double) (x - this._requestedRectLeft + Lighting.OffScreenTiles) >= (double) this._camera.UnscaledSize.X / 16.0 + (double) (Lighting.OffScreenTiles * 2) + 10.0 || y - this._requestedRectTop + Lighting.OffScreenTiles < 0 || (double) (y - this._requestedRectTop + Lighting.OffScreenTiles) >= (double) this._camera.UnscaledSize.Y / 16.0 + (double) (Lighting.OffScreenTiles * 2) + 10.0 || this._tempLights.Count == 2000) - return; - Point16 key = new Point16(x, y); - LegacyLighting.ColorTriplet colorTriplet; - if (this._tempLights.TryGetValue(key, out colorTriplet)) - { - if (this._rgb) - { - if ((double) colorTriplet.R < (double) x1) - colorTriplet.R = x1; - if ((double) colorTriplet.G < (double) y1) - colorTriplet.G = y1; - if ((double) colorTriplet.B < (double) z) - colorTriplet.B = z; - this._tempLights[key] = colorTriplet; - } - else - { - float averageColor = (float) (((double) x1 + (double) y1 + (double) z) / 3.0); - if ((double) colorTriplet.R >= (double) averageColor) - return; - this._tempLights[key] = new LegacyLighting.ColorTriplet(averageColor); - } - } - else - { - colorTriplet = !this._rgb ? new LegacyLighting.ColorTriplet((float) (((double) x1 + (double) y1 + (double) z) / 3.0)) : new LegacyLighting.ColorTriplet(x1, y1, z); - this._tempLights.Add(key, colorTriplet); - } - } - - public void ProcessArea(Rectangle area) - { - this._oldSkyColor = this._skyColor; - float tileR = (float) Main.tileColor.R / (float) byte.MaxValue; - float tileG = (float) Main.tileColor.G / (float) byte.MaxValue; - float tileB = (float) Main.tileColor.B / (float) byte.MaxValue; - this._skyColor = (float) (((double) tileR + (double) tileG + (double) tileB) / 3.0); - if (this.IsColorOrWhiteMode) - { - this._offScreenTiles2 = 34; - Lighting.OffScreenTiles = 40; - } - else - { - this._offScreenTiles2 = 18; - Lighting.OffScreenTiles = 23; - } - this._requestedRectLeft = area.Left; - this._requestedRectRight = area.Right; - this._requestedRectTop = area.Top; - this._requestedRectBottom = area.Bottom; - this._expandedRectLeft = this._requestedRectLeft - Lighting.OffScreenTiles; - this._expandedRectTop = this._requestedRectTop - Lighting.OffScreenTiles; - this._expandedRectRight = this._requestedRectRight + Lighting.OffScreenTiles; - this._expandedRectBottom = this._requestedRectBottom + Lighting.OffScreenTiles; - ++Main.renderCount; - int maxLightArrayX = (int) this._camera.UnscaledSize.X / 16 + Lighting.OffScreenTiles * 2; - int maxLightArrayY = (int) this._camera.UnscaledSize.Y / 16 + Lighting.OffScreenTiles * 2; - if (Main.renderCount < 3) - this.DoColors(); - if (Main.renderCount == 2) - this.CopyFullyProcessedDataOver(maxLightArrayX, maxLightArrayY); - else if (!Main.renderNow) - { - this.ShiftUnProcessedDataOver(maxLightArrayX, maxLightArrayY); - if (Netplay.Connection.StatusMax > 0) - Main.mapTime = 1; - if (Main.mapDelay > 0) - --Main.mapDelay; - else if (Main.mapTime == 0 && Main.mapEnabled) - { - if (Main.renderCount == 3) - { - try - { - this.TryUpdatingMapWithLight(); - } - catch - { - } - } - } - if ((double) this._oldSkyColor != (double) this._skyColor) - this.UpdateLightToSkyColor(tileR, tileG, tileB); - } - if (Main.renderCount <= LegacyLighting.RenderPhases) - return; - this.PreRenderPhase(); - } - - private void TryUpdatingMapWithLight() - { - Main.mapTime = Main.mapTimeMax; - Main.updateMap = true; - int blackEdgeWidth = Main.Map.BlackEdgeWidth; - Vector2 unscaledPosition = this._camera.UnscaledPosition; - float x = this._camera.UnscaledSize.X; - float y = this._camera.UnscaledSize.Y; - float num1 = (float) (int) ((double) x / (double) Main.GameViewMatrix.Zoom.X); - float num2 = (float) (int) ((double) y / (double) Main.GameViewMatrix.Zoom.Y); - Vector2 translation = Main.GameViewMatrix.Translation; - Vector2 vector2 = unscaledPosition + translation; - int num3 = (int) Math.Floor((double) vector2.X / 16.0); - int num4 = (int) Math.Floor(((double) vector2.X + (double) num1) / 16.0) + 1; - int num5 = (int) Math.Floor((double) vector2.Y / 16.0); - int num6 = (int) Math.Floor(((double) vector2.Y + (double) num2) / 16.0) + 1; - int min1 = Utils.Clamp(num3, Lighting.OffScreenTiles, Main.maxTilesX - Lighting.OffScreenTiles); - int max1 = Utils.Clamp(num4, Lighting.OffScreenTiles, Main.maxTilesX - Lighting.OffScreenTiles); - int min2 = Utils.Clamp(num5, Lighting.OffScreenTiles, Main.maxTilesY - Lighting.OffScreenTiles); - int max2 = Utils.Clamp(num6, Lighting.OffScreenTiles, Main.maxTilesY - Lighting.OffScreenTiles); - Main.mapMinX = Utils.Clamp(this._requestedRectLeft, blackEdgeWidth, this._world.TileColumns - blackEdgeWidth); - Main.mapMaxX = Utils.Clamp(this._requestedRectRight, blackEdgeWidth, this._world.TileColumns - blackEdgeWidth); - Main.mapMinY = Utils.Clamp(this._requestedRectTop, blackEdgeWidth, this._world.TileRows - blackEdgeWidth); - Main.mapMaxY = Utils.Clamp(this._requestedRectBottom, blackEdgeWidth, this._world.TileRows - blackEdgeWidth); - Main.mapMinX = Utils.Clamp(Main.mapMinX, min1, max1); - Main.mapMaxX = Utils.Clamp(Main.mapMaxX, min1, max1); - Main.mapMinY = Utils.Clamp(Main.mapMinY, min2, max2); - Main.mapMaxY = Utils.Clamp(Main.mapMaxY, min2, max2); - int offScreenTiles = Lighting.OffScreenTiles; - for (int mapMinX = Main.mapMinX; mapMinX < Main.mapMaxX; ++mapMinX) - { - LegacyLighting.LightingState[] state = this._states[mapMinX - this._requestedRectLeft + offScreenTiles]; - for (int mapMinY = Main.mapMinY; mapMinY < Main.mapMaxY; ++mapMinY) - { - LegacyLighting.LightingState lightingState = state[mapMinY - this._requestedRectTop + offScreenTiles]; - Tile tile = Main.tile[mapMinX, mapMinY]; - float num7 = 0.0f; - if ((double) lightingState.R > (double) num7) - num7 = lightingState.R; - if ((double) lightingState.G > (double) num7) - num7 = lightingState.G; - if ((double) lightingState.B > (double) num7) - num7 = lightingState.B; - if (this.IsColorOrWhiteMode) - num7 *= 1.5f; - byte light = (byte) Math.Min((float) byte.MaxValue, num7 * (float) byte.MaxValue); - if ((double) mapMinY < Main.worldSurface && !tile.active() && tile.wall == (ushort) 0 && tile.liquid == (byte) 0) - light = (byte) 22; - if (light > (byte) 18 || Main.Map[mapMinX, mapMinY].Light > (byte) 0) - { - if (light < (byte) 22) - light = (byte) 22; - Main.Map.UpdateLighting(mapMinX, mapMinY, light); - } - } - } - } - - private void UpdateLightToSkyColor(float tileR, float tileG, float tileB) - { - int num1 = Utils.Clamp(this._expandedRectLeft, 0, this._world.TileColumns - 1); - int num2 = Utils.Clamp(this._expandedRectRight, 0, this._world.TileColumns - 1); - int num3 = Utils.Clamp(this._expandedRectTop, 0, this._world.TileRows - 1); - int num4 = Utils.Clamp(this._expandedRectBottom, 0, (int) Main.worldSurface - 1); - if ((double) num3 >= Main.worldSurface) - return; - for (int index1 = num1; index1 < num2; ++index1) - { - LegacyLighting.LightingState[] state = this._states[index1 - this._expandedRectLeft]; - for (int index2 = num3; index2 < num4; ++index2) - { - LegacyLighting.LightingState lightingState = state[index2 - this._expandedRectTop]; - Tile tile = Main.tile[index1, index2]; - if (tile == null) - { - tile = new Tile(); - Main.tile[index1, index2] = tile; - } - if ((!tile.active() || !Main.tileNoSunLight[(int) tile.type]) && (double) lightingState.R < (double) this._skyColor && tile.liquid < (byte) 200 && (Main.wallLight[(int) tile.wall] || tile.wall == (ushort) 73)) - { - lightingState.R = tileR; - if ((double) lightingState.G < (double) this._skyColor) - lightingState.G = tileG; - if ((double) lightingState.B < (double) this._skyColor) - lightingState.B = tileB; - } - } - } - } - - private void ShiftUnProcessedDataOver(int maxLightArrayX, int maxLightArrayY) - { - Vector2 screenLastPosition = Main.screenLastPosition; - Vector2 unscaledPosition = this._camera.UnscaledPosition; - int num1 = (int) Math.Floor((double) unscaledPosition.X / 16.0) - (int) Math.Floor((double) screenLastPosition.X / 16.0); - if (num1 > 5 || num1 < -5) - num1 = 0; - int num2; - int num3; - int num4; - if (num1 < 0) - { - num2 = -1; - num1 *= -1; - num3 = maxLightArrayX; - num4 = num1; - } - else - { - num2 = 1; - num3 = 0; - num4 = maxLightArrayX - num1; - } - int num5 = (int) Math.Floor((double) unscaledPosition.Y / 16.0) - (int) Math.Floor((double) screenLastPosition.Y / 16.0); - if (num5 > 5 || num5 < -5) - num5 = 0; - int num6; - int num7; - int num8; - if (num5 < 0) - { - num6 = -1; - num5 *= -1; - num7 = maxLightArrayY; - num8 = num5; - } - else - { - num6 = 1; - num7 = 0; - num8 = maxLightArrayY - num5; - } - if (num1 == 0 && num5 == 0) - return; - for (int index1 = num3; index1 != num4; index1 += num2) - { - LegacyLighting.LightingState[] state1 = this._states[index1]; - LegacyLighting.LightingState[] state2 = this._states[index1 + num1 * num2]; - for (int index2 = num7; index2 != num8; index2 += num6) - { - LegacyLighting.LightingState lightingState1 = state1[index2]; - LegacyLighting.LightingState lightingState2 = state2[index2 + num5 * num6]; - lightingState1.R = lightingState2.R; - lightingState1.G = lightingState2.G; - lightingState1.B = lightingState2.B; - } - } - } - - private void CopyFullyProcessedDataOver(int maxLightArrayX, int maxLightArrayY) - { - Vector2 unscaledPosition = this._camera.UnscaledPosition; - int num1 = (int) Math.Floor((double) unscaledPosition.X / 16.0) - this._scrX; - int num2 = (int) Math.Floor((double) unscaledPosition.Y / 16.0) - this._scrY; - if (num1 > 16) - num1 = 0; - if (num2 > 16) - num2 = 0; - int num3 = 0; - int num4 = maxLightArrayX; - int num5 = 0; - int num6 = maxLightArrayY; - if (num1 < 0) - num3 -= num1; - else - num4 -= num1; - if (num2 < 0) - num5 -= num2; - else - num6 -= num2; - if (this._rgb) - { - int num7 = maxLightArrayX; - if (this._states.Length <= num7 + num1) - num7 = this._states.Length - num1 - 1; - for (int index1 = num3; index1 < num7; ++index1) - { - LegacyLighting.LightingState[] state1 = this._states[index1]; - LegacyLighting.LightingState[] state2 = this._states[index1 + num1]; - int num8 = num6; - if (state2.Length <= num8 + num1) - num8 = state2.Length - num2 - 1; - for (int index2 = num5; index2 < num8; ++index2) - { - LegacyLighting.LightingState lightingState1 = state1[index2]; - LegacyLighting.LightingState lightingState2 = state2[index2 + num2]; - lightingState1.R = lightingState2.R2; - lightingState1.G = lightingState2.G2; - lightingState1.B = lightingState2.B2; - } - } - } - else - { - int num9 = num4; - if (this._states.Length <= num9 + num1) - num9 = this._states.Length - num1 - 1; - for (int index3 = num3; index3 < num9; ++index3) - { - LegacyLighting.LightingState[] state3 = this._states[index3]; - LegacyLighting.LightingState[] state4 = this._states[index3 + num1]; - int num10 = num6; - if (state4.Length <= num10 + num1) - num10 = state4.Length - num2 - 1; - for (int index4 = num5; index4 < num10; ++index4) - { - LegacyLighting.LightingState lightingState3 = state3[index4]; - LegacyLighting.LightingState lightingState4 = state4[index4 + num2]; - lightingState3.R = lightingState4.R2; - lightingState3.G = lightingState4.R2; - lightingState3.B = lightingState4.R2; - } - } - } - } - - public void Clear() - { - int num1 = (int) this._camera.UnscaledSize.X / 16 + Lighting.OffScreenTiles * 2; - int num2 = (int) this._camera.UnscaledSize.Y / 16 + Lighting.OffScreenTiles * 2; - for (int index1 = 0; index1 < num1; ++index1) - { - if (index1 < this._states.Length) - { - LegacyLighting.LightingState[] state = this._states[index1]; - for (int index2 = 0; index2 < num2; ++index2) - { - if (index2 < state.Length) - { - LegacyLighting.LightingState lightingState = state[index2]; - lightingState.R = 0.0f; - lightingState.G = 0.0f; - lightingState.B = 0.0f; - } - } - } - } - } - - private void PreRenderPhase() - { - double num1 = (double) Main.tileColor.R / (double) byte.MaxValue; - double num2 = (double) Main.tileColor.G / (double) byte.MaxValue; - double num3 = (double) Main.tileColor.B / (double) byte.MaxValue; - Stopwatch stopwatch = new Stopwatch(); - stopwatch.Start(); - int num4 = 0; - int num5 = (int) this._camera.UnscaledSize.X / 16 + Lighting.OffScreenTiles * 2 + 10; - int num6 = 0; - int num7 = (int) this._camera.UnscaledSize.Y / 16 + Lighting.OffScreenTiles * 2 + 10; - this._minX = num5; - this._maxX = num4; - this._minY = num7; - this._maxY = num6; - this._rgb = this.Mode == 0 || this.Mode == 3; - for (int index1 = num4; index1 < num5; ++index1) - { - LegacyLighting.LightingState[] state = this._states[index1]; - for (int index2 = num6; index2 < num7; ++index2) - { - LegacyLighting.LightingState lightingState = state[index2]; - lightingState.R2 = 0.0f; - lightingState.G2 = 0.0f; - lightingState.B2 = 0.0f; - lightingState.StopLight = false; - lightingState.WetLight = false; - lightingState.HoneyLight = false; - } - } - if (Main.wofNPCIndex >= 0) - { - if (Main.player[Main.myPlayer].gross) - { - try - { - int num8 = (int) this._camera.UnscaledPosition.Y / 16 - 10; - int num9 = (int) ((double) this._camera.UnscaledPosition.Y + (double) this._camera.UnscaledSize.Y) / 16 + 10; - int num10 = (int) Main.npc[Main.wofNPCIndex].position.X / 16; - int num11 = Main.npc[Main.wofNPCIndex].direction <= 0 ? num10 + 2 : num10 - 3; - int num12 = num11 + 8; - float num13 = (float) (0.5 * (double) Main.demonTorch + 1.0 * (1.0 - (double) Main.demonTorch)); - float num14 = 0.3f; - float num15 = (float) (1.0 * (double) Main.demonTorch + 0.5 * (1.0 - (double) Main.demonTorch)); - float num16 = num13 * 0.2f; - float num17 = num14 * 0.1f; - float num18 = num15 * 0.3f; - for (int index3 = num11; index3 <= num12; ++index3) - { - LegacyLighting.LightingState[] state = this._states[index3 - num11]; - for (int index4 = num8; index4 <= num9; ++index4) - { - LegacyLighting.LightingState lightingState = state[index4 - this._expandedRectTop]; - if ((double) lightingState.R2 < (double) num16) - lightingState.R2 = num16; - if ((double) lightingState.G2 < (double) num17) - lightingState.G2 = num17; - if ((double) lightingState.B2 < (double) num18) - lightingState.B2 = num18; - } - } - } - catch - { - } - } - } - int x = Utils.Clamp(this._expandedRectLeft, 5, this._world.TileColumns - 1); - int num19 = Utils.Clamp(this._expandedRectRight, 5, this._world.TileColumns - 1); - int y = Utils.Clamp(this._expandedRectTop, 5, this._world.TileRows - 1); - int num20 = Utils.Clamp(this._expandedRectBottom, 5, this._world.TileRows - 1); - Main.SceneMetrics.ScanAndExportToMain(new SceneMetricsScanSettings() - { - VisualScanArea = new Rectangle?(new Rectangle(x, y, num19 - x, num20 - y)), - BiomeScanCenterPositionInWorld = new Vector2?(Main.LocalPlayer.Center), - ScanOreFinderData = Main.LocalPlayer.accOreFinder - }); - this._tileScanner.Update(); - this._tileScanner.ExportTo(new Rectangle(x, y, num19 - x, num20 - y), this._lightMap); - for (int index5 = x; index5 < num19; ++index5) - { - LegacyLighting.LightingState[] state = this._states[index5 - this._expandedRectLeft]; - for (int index6 = y; index6 < num20; ++index6) - { - LegacyLighting.LightingState lightingState = state[index6 - this._expandedRectTop]; - if (Main.tile[index5, index6] == null) - { - Tile tile = new Tile(); - Main.tile[index5, index6] = tile; - } - Vector3 color; - this._lightMap.GetLight(index5 - x, index6 - y, out color); - if (this._rgb) - { - lightingState.R2 = color.X; - lightingState.G2 = color.Y; - lightingState.B2 = color.Z; - } - else - { - float num21 = (float) (((double) color.X + (double) color.Y + (double) color.Z) / 3.0); - lightingState.R2 = num21; - lightingState.G2 = num21; - lightingState.B2 = num21; - } - switch (this._lightMap.GetMask(index5 - x, index6 - y)) - { - case LightMaskMode.Solid: - lightingState.StopLight = true; - break; - case LightMaskMode.Water: - lightingState.WetLight = true; - break; - case LightMaskMode.Honey: - lightingState.WetLight = true; - lightingState.HoneyLight = true; - break; - } - if ((double) lightingState.R2 > 0.0 || this._rgb && ((double) lightingState.G2 > 0.0 || (double) lightingState.B2 > 0.0)) - { - int num22 = index5 - this._expandedRectLeft; - int num23 = index6 - this._expandedRectTop; - if (this._minX > num22) - this._minX = num22; - if (this._maxX < num22 + 1) - this._maxX = num22 + 1; - if (this._minY > num23) - this._minY = num23; - if (this._maxY < num23 + 1) - this._maxY = num23 + 1; - } - } - } - foreach (KeyValuePair tempLight in this._tempLights) - { - int index7 = (int) tempLight.Key.X - this._requestedRectLeft + Lighting.OffScreenTiles; - int index8 = (int) tempLight.Key.Y - this._requestedRectTop + Lighting.OffScreenTiles; - if (index7 >= 0 && (double) index7 < (double) this._camera.UnscaledSize.X / 16.0 + (double) (Lighting.OffScreenTiles * 2) + 10.0 && index8 >= 0 && (double) index8 < (double) this._camera.UnscaledSize.Y / 16.0 + (double) (Lighting.OffScreenTiles * 2) + 10.0) - { - LegacyLighting.LightingState lightingState = this._states[index7][index8]; - if ((double) lightingState.R2 < (double) tempLight.Value.R) - lightingState.R2 = tempLight.Value.R; - if ((double) lightingState.G2 < (double) tempLight.Value.G) - lightingState.G2 = tempLight.Value.G; - if ((double) lightingState.B2 < (double) tempLight.Value.B) - lightingState.B2 = tempLight.Value.B; - if (this._minX > index7) - this._minX = index7; - if (this._maxX < index7 + 1) - this._maxX = index7 + 1; - if (this._minY > index8) - this._minY = index8; - if (this._maxY < index8 + 1) - this._maxY = index8 + 1; - } - } - if (!Main.gamePaused) - this._tempLights.Clear(); - this._minX += this._expandedRectLeft; - this._maxX += this._expandedRectLeft; - this._minY += this._expandedRectTop; - this._maxY += this._expandedRectTop; - this._minBoundArea.Set(this._minX, this._maxX, this._minY, this._maxY); - this._requestedArea.Set(this._requestedRectLeft, this._requestedRectRight, this._requestedRectTop, this._requestedRectBottom); - this._expandedArea.Set(this._expandedRectLeft, this._expandedRectRight, this._expandedRectTop, this._expandedRectBottom); - this._offScreenTiles2ExpandedArea.Set(this._requestedRectLeft - this._offScreenTiles2, this._requestedRectRight + this._offScreenTiles2, this._requestedRectTop - this._offScreenTiles2, this._requestedRectBottom + this._offScreenTiles2); - this._scrX = (int) Math.Floor((double) this._camera.UnscaledPosition.X / 16.0); - this._scrY = (int) Math.Floor((double) this._camera.UnscaledPosition.Y / 16.0); - Main.renderCount = 0; - TimeLogger.LightingTime(0, stopwatch.Elapsed.TotalMilliseconds); - this.DoColors(); - } - - private void DoColors() - { - if (this.IsColorOrWhiteMode) - { - this._blueWave += (float) this._blueDir * 0.0001f; - if ((double) this._blueWave > 1.0) - { - this._blueWave = 1f; - this._blueDir = -1; - } - else if ((double) this._blueWave < 0.970000028610229) - { - this._blueWave = 0.97f; - this._blueDir = 1; - } - if (this._rgb) - { - this._negLight = 0.91f; - this._negLight2 = 0.56f; - this._honeyLightG = 0.7f * this._negLight * this._blueWave; - this._honeyLightR = 0.75f * this._negLight * this._blueWave; - this._honeyLightB = 0.6f * this._negLight * this._blueWave; - switch (Main.waterStyle) - { - case 0: - case 1: - case 7: - case 8: - this._wetLightG = 0.96f * this._negLight * this._blueWave; - this._wetLightR = 0.88f * this._negLight * this._blueWave; - this._wetLightB = 1.015f * this._negLight * this._blueWave; - break; - case 2: - this._wetLightG = 0.85f * this._negLight * this._blueWave; - this._wetLightR = 0.94f * this._negLight * this._blueWave; - this._wetLightB = 1.01f * this._negLight * this._blueWave; - break; - case 3: - this._wetLightG = 0.95f * this._negLight * this._blueWave; - this._wetLightR = 0.84f * this._negLight * this._blueWave; - this._wetLightB = 1.015f * this._negLight * this._blueWave; - break; - case 4: - this._wetLightG = 0.86f * this._negLight * this._blueWave; - this._wetLightR = 0.9f * this._negLight * this._blueWave; - this._wetLightB = 1.01f * this._negLight * this._blueWave; - break; - case 5: - this._wetLightG = 0.99f * this._negLight * this._blueWave; - this._wetLightR = 0.84f * this._negLight * this._blueWave; - this._wetLightB = 1.01f * this._negLight * this._blueWave; - break; - case 6: - this._wetLightR = 0.83f * this._negLight * this._blueWave; - this._wetLightG = 0.93f * this._negLight * this._blueWave; - this._wetLightB = 0.98f * this._negLight * this._blueWave; - break; - case 9: - this._wetLightG = 0.88f * this._negLight * this._blueWave; - this._wetLightR = 1f * this._negLight * this._blueWave; - this._wetLightB = 0.84f * this._negLight * this._blueWave; - break; - case 10: - this._wetLightG = 1f * this._negLight * this._blueWave; - this._wetLightR = 0.83f * this._negLight * this._blueWave; - this._wetLightB = 1f * this._negLight * this._blueWave; - break; - case 12: - this._wetLightG = 0.98f * this._negLight * this._blueWave; - this._wetLightR = 0.95f * this._negLight * this._blueWave; - this._wetLightB = 0.85f * this._negLight * this._blueWave; - break; - default: - this._wetLightG = 0.0f; - this._wetLightR = 0.0f; - this._wetLightB = 0.0f; - break; - } - } - else - { - this._negLight = 0.9f; - this._negLight2 = 0.54f; - this._wetLightR = 0.95f * this._negLight * this._blueWave; - } - if (Main.player[Main.myPlayer].nightVision) - { - this._negLight *= 1.03f; - this._negLight2 *= 1.03f; - } - if (Main.player[Main.myPlayer].blind) - { - this._negLight *= 0.95f; - this._negLight2 *= 0.95f; - } - if (Main.player[Main.myPlayer].blackout) - { - this._negLight *= 0.85f; - this._negLight2 *= 0.85f; - } - if (Main.player[Main.myPlayer].headcovered) - { - this._negLight *= 0.85f; - this._negLight2 *= 0.85f; - } - } - else - { - this._negLight = 0.04f; - this._negLight2 = 0.16f; - if (Main.player[Main.myPlayer].nightVision) - { - this._negLight -= 0.013f; - this._negLight2 -= 0.04f; - } - if (Main.player[Main.myPlayer].blind) - { - this._negLight += 0.03f; - this._negLight2 += 0.06f; - } - if (Main.player[Main.myPlayer].blackout) - { - this._negLight += 0.09f; - this._negLight2 += 0.18f; - } - if (Main.player[Main.myPlayer].headcovered) - { - this._negLight += 0.09f; - this._negLight2 += 0.18f; - } - this._wetLightR = this._negLight * 1.2f; - this._wetLightG = this._negLight * 1.1f; - } - int num1; - int num2; - switch (Main.renderCount) - { - case 0: - num1 = 0; - num2 = 1; - break; - case 1: - num1 = 1; - num2 = 3; - break; - case 2: - num1 = 3; - num2 = 4; - break; - default: - num1 = 0; - num2 = 0; - break; - } - Stopwatch stopwatch = new Stopwatch(); - int left = this._expandedArea.Left; - int top = this._expandedArea.Top; - for (int index = num1; index < num2; ++index) - { - stopwatch.Restart(); - int num3 = 0; - int num4 = 0; - switch (index) - { - case 0: - this._swipe.InnerLoop1Start = this._minBoundArea.Top - top; - this._swipe.InnerLoop2Start = this._minBoundArea.Bottom - top; - this._swipe.InnerLoop1End = this._requestedArea.Bottom + LegacyLighting.RenderPhases - top; - this._swipe.InnerLoop2End = this._requestedArea.Top - LegacyLighting.RenderPhases - top; - num3 = this._minBoundArea.Left - left; - num4 = this._minBoundArea.Right - left; - this._swipe.JaggedArray = this._states; - break; - case 1: - this._swipe.InnerLoop1Start = this._minBoundArea.Left - left; - this._swipe.InnerLoop2Start = this._minBoundArea.Right - left; - this._swipe.InnerLoop1End = this._requestedArea.Right + LegacyLighting.RenderPhases - left; - this._swipe.InnerLoop2End = this._requestedArea.Left - LegacyLighting.RenderPhases - left; - num3 = this._minBoundArea.Top - top; - num4 = this._minBoundArea.Bottom - top; - this._swipe.JaggedArray = this._axisFlipStates; - break; - case 2: - this._swipe.InnerLoop1Start = this._offScreenTiles2ExpandedArea.Top - top; - this._swipe.InnerLoop2Start = this._offScreenTiles2ExpandedArea.Bottom - top; - this._swipe.InnerLoop1End = this._requestedArea.Bottom + LegacyLighting.RenderPhases - top; - this._swipe.InnerLoop2End = this._requestedArea.Top - LegacyLighting.RenderPhases - top; - num3 = this._offScreenTiles2ExpandedArea.Left - left; - num4 = this._offScreenTiles2ExpandedArea.Right - left; - this._swipe.JaggedArray = this._states; - break; - case 3: - this._swipe.InnerLoop1Start = this._offScreenTiles2ExpandedArea.Left - left; - this._swipe.InnerLoop2Start = this._offScreenTiles2ExpandedArea.Right - left; - this._swipe.InnerLoop1End = this._requestedArea.Right + LegacyLighting.RenderPhases - left; - this._swipe.InnerLoop2End = this._requestedArea.Left - LegacyLighting.RenderPhases - left; - num3 = this._offScreenTiles2ExpandedArea.Top - top; - num4 = this._offScreenTiles2ExpandedArea.Bottom - top; - this._swipe.JaggedArray = this._axisFlipStates; - break; - } - if (this._swipe.InnerLoop1Start > this._swipe.InnerLoop1End) - this._swipe.InnerLoop1Start = this._swipe.InnerLoop1End; - if (this._swipe.InnerLoop2Start < this._swipe.InnerLoop2End) - this._swipe.InnerLoop2Start = this._swipe.InnerLoop2End; - if (num3 > num4) - num3 = num4; - ParallelForAction parallelForAction; - switch (this.Mode) - { - case 0: - // ISSUE: method pointer - parallelForAction = new ParallelForAction((object) this, __methodptr(doColors_Mode0_Swipe)); - break; - case 1: - // ISSUE: method pointer - parallelForAction = new ParallelForAction((object) this, __methodptr(doColors_Mode1_Swipe)); - break; - case 2: - // ISSUE: method pointer - parallelForAction = new ParallelForAction((object) this, __methodptr(doColors_Mode2_Swipe)); - break; - case 3: - // ISSUE: method pointer - parallelForAction = new ParallelForAction((object) this, __methodptr(doColors_Mode3_Swipe)); - break; - default: - // ISSUE: method pointer - parallelForAction = new ParallelForAction((object) this, __methodptr(doColors_Mode0_Swipe)); - break; - } - FastParallel.For(num3, num4, parallelForAction, (object) this._swipe); - LegacyLighting._swipeRandom.NextSeed(); - TimeLogger.LightingTime(index + 1, stopwatch.Elapsed.TotalMilliseconds); - } - } - - private void doColors_Mode0_Swipe(int outerLoopStart, int outerLoopEnd, object context) - { - LegacyLighting.LightingSwipeData lightingSwipeData = context as LegacyLighting.LightingSwipeData; - FastRandom fastRandom = new FastRandom(); - try - { - bool flag1 = true; - while (true) - { - int num1; - int val2_1; - int val2_2; - if (flag1) - { - num1 = 1; - val2_1 = lightingSwipeData.InnerLoop1Start; - val2_2 = lightingSwipeData.InnerLoop1End; - } - else - { - num1 = -1; - val2_1 = lightingSwipeData.InnerLoop2Start; - val2_2 = lightingSwipeData.InnerLoop2End; - } - int num2 = outerLoopStart; - int num3 = outerLoopEnd; - for (int index1 = num2; index1 < num3; ++index1) - { - LegacyLighting.LightingState[] jagged = lightingSwipeData.JaggedArray[index1]; - float num4 = 0.0f; - float num5 = 0.0f; - float num6 = 0.0f; - int num7 = Math.Min(jagged.Length - 1, Math.Max(0, val2_1)); - int num8 = Math.Min(jagged.Length - 1, Math.Max(0, val2_2)); - for (int index2 = num7; index2 != num8; index2 += num1) - { - LegacyLighting.LightingState lightingState1 = jagged[index2]; - LegacyLighting.LightingState lightingState2 = jagged[index2 + num1]; - bool flag2; - bool flag3 = flag2 = false; - if ((double) lightingState1.R2 > (double) num4) - num4 = lightingState1.R2; - else if ((double) num4 <= 0.0185) - flag3 = true; - else if ((double) lightingState1.R2 < (double) num4) - lightingState1.R2 = num4; - if (lightingState1.WetLight) - fastRandom = LegacyLighting._swipeRandom.WithModifier((ulong) (index1 * 1000 + index2)); - if (!flag3 && (double) lightingState2.R2 <= (double) num4) - { - if (lightingState1.StopLight) - num4 *= this._negLight2; - else if (lightingState1.WetLight) - { - if (lightingState1.HoneyLight) - num4 *= (float) ((double) this._honeyLightR * (double) fastRandom.Next(98, 100) * 0.00999999977648258); - else - num4 *= (float) ((double) this._wetLightR * (double) fastRandom.Next(98, 100) * 0.00999999977648258); - } - else - num4 *= this._negLight; - } - if ((double) lightingState1.G2 > (double) num5) - num5 = lightingState1.G2; - else if ((double) num5 <= 0.0185) - flag2 = true; - else - lightingState1.G2 = num5; - if (!flag2 && (double) lightingState2.G2 <= (double) num5) - { - if (lightingState1.StopLight) - num5 *= this._negLight2; - else if (lightingState1.WetLight) - { - if (lightingState1.HoneyLight) - num5 *= (float) ((double) this._honeyLightG * (double) fastRandom.Next(97, 100) * 0.00999999977648258); - else - num5 *= (float) ((double) this._wetLightG * (double) fastRandom.Next(97, 100) * 0.00999999977648258); - } - else - num5 *= this._negLight; - } - if ((double) lightingState1.B2 > (double) num6) - num6 = lightingState1.B2; - else if ((double) num6 > 0.0185) - lightingState1.B2 = num6; - else - continue; - if ((double) lightingState2.B2 < (double) num6) - { - if (lightingState1.StopLight) - num6 *= this._negLight2; - else if (lightingState1.WetLight) - { - if (lightingState1.HoneyLight) - num6 *= (float) ((double) this._honeyLightB * (double) fastRandom.Next(97, 100) * 0.00999999977648258); - else - num6 *= (float) ((double) this._wetLightB * (double) fastRandom.Next(97, 100) * 0.00999999977648258); - } - else - num6 *= this._negLight; - } - } - } - if (flag1) - flag1 = false; - else - break; - } - } - catch - { - } - } - - private void doColors_Mode1_Swipe(int outerLoopStart, int outerLoopEnd, object context) - { - LegacyLighting.LightingSwipeData lightingSwipeData = context as LegacyLighting.LightingSwipeData; - FastRandom fastRandom1 = new FastRandom(); - try - { - bool flag = true; - while (true) - { - int num1; - int num2; - int num3; - if (flag) - { - num1 = 1; - num2 = lightingSwipeData.InnerLoop1Start; - num3 = lightingSwipeData.InnerLoop1End; - } - else - { - num1 = -1; - num2 = lightingSwipeData.InnerLoop2Start; - num3 = lightingSwipeData.InnerLoop2End; - } - for (int index1 = outerLoopStart; index1 < outerLoopEnd; ++index1) - { - LegacyLighting.LightingState[] jagged = lightingSwipeData.JaggedArray[index1]; - float num4 = 0.0f; - for (int index2 = num2; index2 != num3; index2 += num1) - { - LegacyLighting.LightingState lightingState = jagged[index2]; - if ((double) lightingState.R2 > (double) num4) - num4 = lightingState.R2; - else if ((double) num4 > 0.0185) - { - if ((double) lightingState.R2 < (double) num4) - lightingState.R2 = num4; - } - else - continue; - if ((double) jagged[index2 + num1].R2 <= (double) num4) - { - if (lightingState.StopLight) - num4 *= this._negLight2; - else if (lightingState.WetLight) - { - FastRandom fastRandom2 = LegacyLighting._swipeRandom.WithModifier((ulong) (index1 * 1000 + index2)); - if (lightingState.HoneyLight) - num4 *= (float) ((double) this._honeyLightR * (double) fastRandom2.Next(98, 100) * 0.00999999977648258); - else - num4 *= (float) ((double) this._wetLightR * (double) fastRandom2.Next(98, 100) * 0.00999999977648258); - } - else - num4 *= this._negLight; - } - } - } - if (flag) - flag = false; - else - break; - } - } - catch - { - } - } - - private void doColors_Mode2_Swipe(int outerLoopStart, int outerLoopEnd, object context) - { - LegacyLighting.LightingSwipeData lightingSwipeData = context as LegacyLighting.LightingSwipeData; - try - { - bool flag = true; - while (true) - { - int num1; - int num2; - int num3; - if (flag) - { - num1 = 1; - num2 = lightingSwipeData.InnerLoop1Start; - num3 = lightingSwipeData.InnerLoop1End; - } - else - { - num1 = -1; - num2 = lightingSwipeData.InnerLoop2Start; - num3 = lightingSwipeData.InnerLoop2End; - } - for (int index1 = outerLoopStart; index1 < outerLoopEnd; ++index1) - { - LegacyLighting.LightingState[] jagged = lightingSwipeData.JaggedArray[index1]; - float num4 = 0.0f; - for (int index2 = num2; index2 != num3; index2 += num1) - { - LegacyLighting.LightingState lightingState = jagged[index2]; - if ((double) lightingState.R2 > (double) num4) - num4 = lightingState.R2; - else if ((double) num4 > 0.0) - lightingState.R2 = num4; - else - continue; - if (lightingState.StopLight) - num4 -= this._negLight2; - else if (lightingState.WetLight) - num4 -= this._wetLightR; - else - num4 -= this._negLight; - } - } - if (flag) - flag = false; - else - break; - } - } - catch - { - } - } - - private void doColors_Mode3_Swipe(int outerLoopStart, int outerLoopEnd, object context) - { - LegacyLighting.LightingSwipeData lightingSwipeData = context as LegacyLighting.LightingSwipeData; - try - { - bool flag1 = true; - while (true) - { - int num1; - int num2; - int num3; - if (flag1) - { - num1 = 1; - num2 = lightingSwipeData.InnerLoop1Start; - num3 = lightingSwipeData.InnerLoop1End; - } - else - { - num1 = -1; - num2 = lightingSwipeData.InnerLoop2Start; - num3 = lightingSwipeData.InnerLoop2End; - } - for (int index1 = outerLoopStart; index1 < outerLoopEnd; ++index1) - { - LegacyLighting.LightingState[] jagged = lightingSwipeData.JaggedArray[index1]; - float num4 = 0.0f; - float num5 = 0.0f; - float num6 = 0.0f; - for (int index2 = num2; index2 != num3; index2 += num1) - { - LegacyLighting.LightingState lightingState = jagged[index2]; - bool flag2; - bool flag3 = flag2 = false; - if ((double) lightingState.R2 > (double) num4) - num4 = lightingState.R2; - else if ((double) num4 <= 0.0) - flag3 = true; - else - lightingState.R2 = num4; - if (!flag3) - { - if (lightingState.StopLight) - num4 -= this._negLight2; - else if (lightingState.WetLight) - num4 -= this._wetLightR; - else - num4 -= this._negLight; - } - if ((double) lightingState.G2 > (double) num5) - num5 = lightingState.G2; - else if ((double) num5 <= 0.0) - flag2 = true; - else - lightingState.G2 = num5; - if (!flag2) - { - if (lightingState.StopLight) - num5 -= this._negLight2; - else if (lightingState.WetLight) - num5 -= this._wetLightG; - else - num5 -= this._negLight; - } - if ((double) lightingState.B2 > (double) num6) - num6 = lightingState.B2; - else if ((double) num6 > 0.0) - lightingState.B2 = num6; - else - continue; - if (lightingState.StopLight) - num6 -= this._negLight2; - else - num6 -= this._negLight; - } - } - if (flag1) - flag1 = false; - else - break; - } - } - catch - { - } - } - - public struct RectArea - { - public int Left; - public int Right; - public int Top; - public int Bottom; - - public void Set(int left, int right, int top, int bottom) - { - this.Left = left; - this.Right = right; - this.Top = top; - this.Bottom = bottom; - } - } - - private class LightingSwipeData - { - public int InnerLoop1Start; - public int InnerLoop1End; - public int InnerLoop2Start; - public int InnerLoop2End; - public LegacyLighting.LightingState[][] JaggedArray; - - public LightingSwipeData() - { - this.InnerLoop1Start = 0; - this.InnerLoop1End = 0; - this.InnerLoop2Start = 0; - this.InnerLoop2End = 0; - } - - public void CopyFrom(LegacyLighting.LightingSwipeData from) - { - this.InnerLoop1Start = from.InnerLoop1Start; - this.InnerLoop1End = from.InnerLoop1End; - this.InnerLoop2Start = from.InnerLoop2Start; - this.InnerLoop2End = from.InnerLoop2End; - this.JaggedArray = from.JaggedArray; - } - } - - private class LightingState - { - public float R; - public float R2; - public float G; - public float G2; - public float B; - public float B2; - public bool StopLight; - public bool WetLight; - public bool HoneyLight; - - public Vector3 ToVector3() => new Vector3(this.R, this.G, this.B); - } - - private struct ColorTriplet - { - public float R; - public float G; - public float B; - - public ColorTriplet(float R, float G, float B) - { - this.R = R; - this.G = G; - this.B = B; - } - - public ColorTriplet(float averageColor) => this.R = this.G = this.B = averageColor; - } - } -} diff --git a/Graphics/Light/LightMap.cs b/Graphics/Light/LightMap.cs deleted file mode 100644 index 1ba4cf5..0000000 --- a/Graphics/Light/LightMap.cs +++ /dev/null @@ -1,198 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.Light.LightMap -// 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; -using ReLogic.Threading; -using Terraria.Utilities; - -namespace Terraria.Graphics.Light -{ - public class LightMap - { - private Vector3[] _colors; - private LightMaskMode[] _mask; - private FastRandom _random = FastRandom.CreateWithRandomSeed(); - private const int DEFAULT_WIDTH = 203; - private const int DEFAULT_HEIGHT = 203; - - public int NonVisiblePadding { get; set; } - - public int Width { get; private set; } - - public int Height { get; private set; } - - public float LightDecayThroughAir { get; set; } - - public float LightDecayThroughSolid { get; set; } - - public Vector3 LightDecayThroughWater { get; set; } - - public Vector3 LightDecayThroughHoney { get; set; } - - public Vector3 this[int x, int y] - { - get => this._colors[this.IndexOf(x, y)]; - set => this._colors[this.IndexOf(x, y)] = value; - } - - public LightMap() - { - this.LightDecayThroughAir = 0.91f; - this.LightDecayThroughSolid = 0.56f; - this.LightDecayThroughWater = new Vector3(0.88f, 0.96f, 1.015f) * 0.91f; - this.LightDecayThroughHoney = new Vector3(0.75f, 0.7f, 0.6f) * 0.91f; - this.Width = 203; - this.Height = 203; - this._colors = new Vector3[41209]; - this._mask = new LightMaskMode[41209]; - } - - public void GetLight(int x, int y, out Vector3 color) => color = this._colors[this.IndexOf(x, y)]; - - public LightMaskMode GetMask(int x, int y) => this._mask[this.IndexOf(x, y)]; - - public void Clear() - { - for (int index = 0; index < this._colors.Length; ++index) - { - this._colors[index].X = 0.0f; - this._colors[index].Y = 0.0f; - this._colors[index].Z = 0.0f; - this._mask[index] = LightMaskMode.None; - } - } - - public void SetMaskAt(int x, int y, LightMaskMode mode) => this._mask[this.IndexOf(x, y)] = mode; - - public void Blur() - { - this.BlurPass(); - this.BlurPass(); - this._random.NextSeed(); - } - - private void BlurPass() - { - // ISSUE: method pointer - FastParallel.For(0, this.Width, new ParallelForAction((object) this, __methodptr(\u003CBlurPass\u003Eb__42_0)), (object) null); - // ISSUE: method pointer - FastParallel.For(0, this.Height, new ParallelForAction((object) this, __methodptr(\u003CBlurPass\u003Eb__42_1)), (object) null); - } - - private void BlurLine(int startIndex, int endIndex, int stride) - { - Vector3 zero = Vector3.Zero; - bool flag1 = false; - bool flag2 = false; - bool flag3 = false; - for (int index = startIndex; index != endIndex + stride; index += stride) - { - if ((double) zero.X < (double) this._colors[index].X) - { - zero.X = this._colors[index].X; - flag1 = false; - } - else if (!flag1) - { - if ((double) zero.X < 0.0185000002384186) - flag1 = true; - else - this._colors[index].X = zero.X; - } - if ((double) zero.Y < (double) this._colors[index].Y) - { - zero.Y = this._colors[index].Y; - flag2 = false; - } - else if (!flag2) - { - if ((double) zero.Y < 0.0185000002384186) - flag2 = true; - else - this._colors[index].Y = zero.Y; - } - if ((double) zero.Z < (double) this._colors[index].Z) - { - zero.Z = this._colors[index].Z; - flag3 = false; - } - else if (!flag3) - { - if ((double) zero.Z < 0.0185000002384186) - flag3 = true; - else - this._colors[index].Z = zero.Z; - } - if (!(flag1 & flag3 & flag2)) - { - switch (this._mask[index]) - { - case LightMaskMode.None: - if (!flag1) - zero.X *= this.LightDecayThroughAir; - if (!flag2) - zero.Y *= this.LightDecayThroughAir; - if (!flag3) - { - zero.Z *= this.LightDecayThroughAir; - continue; - } - continue; - case LightMaskMode.Solid: - if (!flag1) - zero.X *= this.LightDecayThroughSolid; - if (!flag2) - zero.Y *= this.LightDecayThroughSolid; - if (!flag3) - { - zero.Z *= this.LightDecayThroughSolid; - continue; - } - continue; - case LightMaskMode.Water: - float num = (float) this._random.WithModifier((ulong) index).Next(98, 100) / 100f; - if (!flag1) - zero.X *= this.LightDecayThroughWater.X * num; - if (!flag2) - zero.Y *= this.LightDecayThroughWater.Y * num; - if (!flag3) - { - zero.Z *= this.LightDecayThroughWater.Z * num; - continue; - } - continue; - case LightMaskMode.Honey: - if (!flag1) - zero.X *= this.LightDecayThroughHoney.X; - if (!flag2) - zero.Y *= this.LightDecayThroughHoney.Y; - if (!flag3) - { - zero.Z *= this.LightDecayThroughHoney.Z; - continue; - } - continue; - default: - continue; - } - } - } - } - - private int IndexOf(int x, int y) => x * this.Height + y; - - public void SetSize(int width, int height) - { - if (width * height > this._colors.Length) - { - this._colors = new Vector3[width * height]; - this._mask = new LightMaskMode[width * height]; - } - this.Width = width; - this.Height = height; - } - } -} diff --git a/Graphics/Light/LightMaskMode.cs b/Graphics/Light/LightMaskMode.cs deleted file mode 100644 index 7359e3a..0000000 --- a/Graphics/Light/LightMaskMode.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.Light.LightMaskMode -// 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.Graphics.Light -{ - public enum LightMaskMode : byte - { - None, - Solid, - Water, - Honey, - } -} diff --git a/Graphics/Light/LightMode.cs b/Graphics/Light/LightMode.cs deleted file mode 100644 index d54cbdb..0000000 --- a/Graphics/Light/LightMode.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.Light.LightMode -// 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.Graphics.Light -{ - public enum LightMode - { - White, - Retro, - Trippy, - Color, - } -} diff --git a/Graphics/Light/LightingEngine.cs b/Graphics/Light/LightingEngine.cs deleted file mode 100644 index 6be6e31..0000000 --- a/Graphics/Light/LightingEngine.cs +++ /dev/null @@ -1,249 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.Light.LightingEngine -// 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; -using ReLogic.Threading; -using System.Collections.Generic; -using System.Diagnostics; - -namespace Terraria.Graphics.Light -{ - public class LightingEngine : ILightingEngine - { - private const int AREA_PADDING = 28; - private const int NON_VISIBLE_PADDING = 18; - private readonly List _perFrameLights = new List(); - private TileLightScanner _tileScanner; - private LightMap _activeLightMap = new LightMap(); - private Rectangle _activeProcessedArea; - private LightMap _workingLightMap = new LightMap(); - private Rectangle _workingProcessedArea; - private readonly Stopwatch _timer = new Stopwatch(); - private LightingEngine.EngineState _state; - - public LightingEngine(World world) => this.SetWorld(world); - - public void AddLight(int x, int y, Vector3 color) => this._perFrameLights.Add(new LightingEngine.PerFrameLight(new Point(x, y), color)); - - public void Clear() - { - this._activeLightMap.Clear(); - this._workingLightMap.Clear(); - this._perFrameLights.Clear(); - } - - public Vector3 GetColor(int x, int y) - { - if (!this._activeProcessedArea.Contains(x, y)) - return Vector3.Zero; - x -= this._activeProcessedArea.X; - y -= this._activeProcessedArea.Y; - return this._activeLightMap[x, y]; - } - - public void ProcessArea(Rectangle area) - { - Main.renderCount = (Main.renderCount + 1) % 4; - this._timer.Start(); - TimeLogger.LightingTime(0, 0.0); - switch (this._state) - { - case LightingEngine.EngineState.MinimapUpdate: - if (Main.mapDelay > 0) - --Main.mapDelay; - else - this.ExportToMiniMap(); - TimeLogger.LightingTime(1, this._timer.Elapsed.TotalMilliseconds); - break; - case LightingEngine.EngineState.ExportMetrics: - area.Inflate(28, 28); - Main.SceneMetrics.ScanAndExportToMain(new SceneMetricsScanSettings() - { - VisualScanArea = new Rectangle?(area), - BiomeScanCenterPositionInWorld = new Vector2?(Main.LocalPlayer.Center), - ScanOreFinderData = Main.LocalPlayer.accOreFinder - }); - TimeLogger.LightingTime(2, this._timer.Elapsed.TotalMilliseconds); - break; - case LightingEngine.EngineState.Scan: - this.ProcessScan(area); - TimeLogger.LightingTime(3, this._timer.Elapsed.TotalMilliseconds); - break; - case LightingEngine.EngineState.Blur: - this.ProcessBlur(); - this.Present(); - TimeLogger.LightingTime(4, this._timer.Elapsed.TotalMilliseconds); - break; - } - this.IncrementState(); - this._timer.Reset(); - } - - private void IncrementState() => this._state = (LightingEngine.EngineState) ((int) (this._state + 1) % 4); - - private void ProcessScan(Rectangle area) - { - area.Inflate(28, 28); - this._workingProcessedArea = area; - this._workingLightMap.SetSize(area.Width, area.Height); - this._workingLightMap.NonVisiblePadding = 18; - this._tileScanner.Update(); - this._tileScanner.ExportTo(area, this._workingLightMap); - } - - private void ProcessBlur() - { - this.UpdateLightDecay(); - this.ApplyPerFrameLights(); - this._workingLightMap.Blur(); - } - - private void Present() - { - Utils.Swap(ref this._activeLightMap, ref this._workingLightMap); - Utils.Swap(ref this._activeProcessedArea, ref this._workingProcessedArea); - } - - private void UpdateLightDecay() - { - LightMap workingLightMap = this._workingLightMap; - workingLightMap.LightDecayThroughAir = 0.91f; - workingLightMap.LightDecayThroughSolid = 0.56f; - workingLightMap.LightDecayThroughHoney = new Vector3(0.75f, 0.7f, 0.6f) * 0.91f; - switch (Main.waterStyle) - { - case 0: - case 1: - case 7: - case 8: - workingLightMap.LightDecayThroughWater = new Vector3(0.88f, 0.96f, 1.015f) * 0.91f; - break; - case 2: - workingLightMap.LightDecayThroughWater = new Vector3(0.94f, 0.85f, 1.01f) * 0.91f; - break; - case 3: - workingLightMap.LightDecayThroughWater = new Vector3(0.84f, 0.95f, 1.015f) * 0.91f; - break; - case 4: - workingLightMap.LightDecayThroughWater = new Vector3(0.9f, 0.86f, 1.01f) * 0.91f; - break; - case 5: - workingLightMap.LightDecayThroughWater = new Vector3(0.84f, 0.99f, 1.01f) * 0.91f; - break; - case 6: - workingLightMap.LightDecayThroughWater = new Vector3(0.83f, 0.93f, 0.98f) * 0.91f; - break; - case 9: - workingLightMap.LightDecayThroughWater = new Vector3(1f, 0.88f, 0.84f) * 0.91f; - break; - case 10: - workingLightMap.LightDecayThroughWater = new Vector3(0.83f, 1f, 1f) * 0.91f; - break; - case 12: - workingLightMap.LightDecayThroughWater = new Vector3(0.95f, 0.98f, 0.85f) * 0.91f; - break; - } - if (Main.player[Main.myPlayer].nightVision) - { - workingLightMap.LightDecayThroughAir *= 1.03f; - workingLightMap.LightDecayThroughSolid *= 1.03f; - } - if (Main.player[Main.myPlayer].blind) - { - workingLightMap.LightDecayThroughAir *= 0.95f; - workingLightMap.LightDecayThroughSolid *= 0.95f; - } - if (Main.player[Main.myPlayer].blackout) - { - workingLightMap.LightDecayThroughAir *= 0.85f; - workingLightMap.LightDecayThroughSolid *= 0.85f; - } - if (!Main.player[Main.myPlayer].headcovered) - return; - workingLightMap.LightDecayThroughAir *= 0.85f; - workingLightMap.LightDecayThroughSolid *= 0.85f; - } - - private void ApplyPerFrameLights() - { - for (int index = 0; index < this._perFrameLights.Count; ++index) - { - Point position = this._perFrameLights[index].Position; - if (this._workingProcessedArea.Contains(position)) - { - Vector3 result = this._perFrameLights[index].Color; - Vector3 workingLight = this._workingLightMap[position.X - this._workingProcessedArea.X, position.Y - this._workingProcessedArea.Y]; - Vector3.Max(ref workingLight, ref result, out result); - this._workingLightMap[position.X - this._workingProcessedArea.X, position.Y - this._workingProcessedArea.Y] = result; - } - } - this._perFrameLights.Clear(); - } - - public void Rebuild() - { - this._activeProcessedArea = Rectangle.Empty; - this._workingProcessedArea = Rectangle.Empty; - this._state = LightingEngine.EngineState.MinimapUpdate; - this._activeLightMap = new LightMap(); - this._workingLightMap = new LightMap(); - } - - private void SetWorld(World world) => this._tileScanner = new TileLightScanner(world); - - private void ExportToMiniMap() - { - // ISSUE: object of a compiler-generated type is created - // ISSUE: variable of a compiler-generated type - LightingEngine.\u003C\u003Ec__DisplayClass24_0 cDisplayClass240 = new LightingEngine.\u003C\u003Ec__DisplayClass24_0(); - // ISSUE: reference to a compiler-generated field - cDisplayClass240.\u003C\u003E4__this = this; - if (!Main.mapEnabled || this._activeProcessedArea.Width <= 0 || this._activeProcessedArea.Height <= 0) - return; - // ISSUE: reference to a compiler-generated field - cDisplayClass240.area = new Rectangle(this._activeProcessedArea.X + 28, this._activeProcessedArea.Y + 28, this._activeProcessedArea.Width - 56, this._activeProcessedArea.Height - 56); - Rectangle rectangle = new Rectangle(0, 0, Main.maxTilesX, Main.maxTilesY); - rectangle.Inflate(-Main.Map.BlackEdgeWidth, -Main.Map.BlackEdgeWidth); - // ISSUE: reference to a compiler-generated field - // ISSUE: reference to a compiler-generated field - cDisplayClass240.area = Rectangle.Intersect(cDisplayClass240.area, rectangle); - // ISSUE: reference to a compiler-generated field - Main.mapMinX = cDisplayClass240.area.Left; - // ISSUE: reference to a compiler-generated field - Main.mapMinY = cDisplayClass240.area.Top; - // ISSUE: reference to a compiler-generated field - Main.mapMaxX = cDisplayClass240.area.Right; - // ISSUE: reference to a compiler-generated field - Main.mapMaxY = cDisplayClass240.area.Bottom; - // ISSUE: reference to a compiler-generated field - // ISSUE: reference to a compiler-generated field - // ISSUE: method pointer - FastParallel.For(cDisplayClass240.area.Left, cDisplayClass240.area.Right, new ParallelForAction((object) cDisplayClass240, __methodptr(\u003CExportToMiniMap\u003Eb__0)), (object) null); - Main.updateMap = true; - } - - private enum EngineState - { - MinimapUpdate, - ExportMetrics, - Scan, - Blur, - Max, - } - - private struct PerFrameLight - { - public readonly Point Position; - public readonly Vector3 Color; - - public PerFrameLight(Point position, Vector3 color) - { - this.Position = position; - this.Color = color; - } - } - } -} diff --git a/Graphics/Light/TileLightScanner.cs b/Graphics/Light/TileLightScanner.cs deleted file mode 100644 index a572433..0000000 --- a/Graphics/Light/TileLightScanner.cs +++ /dev/null @@ -1,2170 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.Light.TileLightScanner -// 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; -using ReLogic.Threading; -using System; -using Terraria.GameContent; -using Terraria.ID; -using Terraria.Utilities; - -namespace Terraria.Graphics.Light -{ - public class TileLightScanner - { - private readonly World _world; - private FastRandom _random = FastRandom.CreateWithRandomSeed(); - - public TileLightScanner(World world) => this._world = world; - - public void ExportTo(Rectangle area, LightMap outputMap) - { - // ISSUE: object of a compiler-generated type is created - // ISSUE: variable of a compiler-generated type - TileLightScanner.\u003C\u003Ec__DisplayClass3_0 cDisplayClass30 = new TileLightScanner.\u003C\u003Ec__DisplayClass3_0(); - // ISSUE: reference to a compiler-generated field - cDisplayClass30.area = area; - // ISSUE: reference to a compiler-generated field - cDisplayClass30.\u003C\u003E4__this = this; - // ISSUE: reference to a compiler-generated field - cDisplayClass30.outputMap = outputMap; - // ISSUE: reference to a compiler-generated field - // ISSUE: reference to a compiler-generated field - // ISSUE: method pointer - FastParallel.For(cDisplayClass30.area.Left, cDisplayClass30.area.Right, new ParallelForAction((object) cDisplayClass30, __methodptr(\u003CExportTo\u003Eb__0)), (object) null); - } - - private bool IsTileNullOrTouchingNull(int x, int y) => !WorldGen.InWorld(x, y, 1) || this._world.Tiles[x, y] == null || this._world.Tiles[x + 1, y] == null || this._world.Tiles[x - 1, y] == null || this._world.Tiles[x, y - 1] == null || this._world.Tiles[x, y + 1] == null; - - public void Update() => this._random.NextSeed(); - - public LightMaskMode GetMaskMode(int x, int y) => TileLightScanner.GetTileMask(this._world.Tiles[x, y]); - - private static LightMaskMode GetTileMask(Tile tile) - { - if ((!tile.active() || !Main.tileBlockLight[(int) tile.type] || tile.type == (ushort) 131 || tile.inActive() ? 0 : (tile.slope() == (byte) 0 ? 1 : 0)) != 0) - return LightMaskMode.Solid; - if (tile.lava() || tile.liquid <= (byte) 128) - return LightMaskMode.None; - return !tile.honey() ? LightMaskMode.Water : LightMaskMode.Honey; - } - - public void GetTileLight(int x, int y, out Vector3 outputColor) - { - outputColor = Vector3.Zero; - Tile tile = this._world.Tiles[x, y]; - FastRandom localRandom = this._random.WithModifier(x, y); - if (y < (int) Main.worldSurface) - this.ApplySurfaceLight(tile, x, y, ref outputColor); - else if (y > Main.UnderworldLayer) - this.ApplyHellLight(tile, x, y, ref outputColor); - TileLightScanner.ApplyWallLight(tile, x, y, ref localRandom, ref outputColor); - if (tile.active()) - this.ApplyTileLight(tile, x, y, ref localRandom, ref outputColor); - TileLightScanner.ApplyLavaLight(tile, ref outputColor); - } - - private static void ApplyLavaLight(Tile tile, ref Vector3 lightColor) - { - if (!tile.lava() || tile.liquid <= (byte) 0) - return; - float num = 0.55f + (float) (270 - (int) Main.mouseTextColor) / 900f; - if ((double) lightColor.X < (double) num) - lightColor.X = num; - if ((double) lightColor.Y < (double) num) - lightColor.Y = num * 0.6f; - if ((double) lightColor.Z >= (double) num) - return; - lightColor.Z = num * 0.2f; - } - - private static void ApplyWallLight( - Tile tile, - int x, - int y, - ref FastRandom localRandom, - ref Vector3 lightColor) - { - float num1 = 0.0f; - float num2 = 0.0f; - float num3 = 0.0f; - switch (tile.wall) - { - case 33: - if (!tile.active() || !Main.tileBlockLight[(int) tile.type]) - { - num1 = 0.09f; - num2 = 0.0525f; - num3 = 0.24f; - break; - } - break; - case 44: - if (!tile.active() || !Main.tileBlockLight[(int) tile.type]) - { - num1 = (float) ((double) Main.DiscoR / (double) byte.MaxValue * 0.150000005960464); - num2 = (float) ((double) Main.DiscoG / (double) byte.MaxValue * 0.150000005960464); - num3 = (float) ((double) Main.DiscoB / (double) byte.MaxValue * 0.150000005960464); - break; - } - break; - case 137: - if (!tile.active() || !Main.tileBlockLight[(int) tile.type]) - { - float num4 = 0.4f + (float) (270 - (int) Main.mouseTextColor) / 1500f + (float) localRandom.Next(0, 50) * 0.0005f; - num1 = 1f * num4; - num2 = 0.5f * num4; - num3 = 0.1f * num4; - break; - } - break; - case 153: - num1 = 0.6f; - num2 = 0.3f; - break; - case 154: - num1 = 0.6f; - num3 = 0.6f; - break; - case 155: - num1 = 0.6f; - num2 = 0.6f; - num3 = 0.6f; - break; - case 156: - num2 = 0.6f; - break; - case 164: - num1 = 0.6f; - break; - case 165: - num3 = 0.6f; - break; - case 166: - num1 = 0.6f; - num2 = 0.6f; - break; - case 174: - if (!tile.active() || !Main.tileBlockLight[(int) tile.type]) - { - num1 = 0.2975f; - break; - } - break; - case 175: - if (!tile.active() || !Main.tileBlockLight[(int) tile.type]) - { - num1 = 0.075f; - num2 = 0.15f; - num3 = 0.4f; - break; - } - break; - case 176: - if (!tile.active() || !Main.tileBlockLight[(int) tile.type]) - { - num1 = 0.1f; - num2 = 0.1f; - num3 = 0.1f; - break; - } - break; - case 182: - if (!tile.active() || !Main.tileBlockLight[(int) tile.type]) - { - num1 = 0.24f; - num2 = 0.12f; - num3 = 0.09f; - break; - } - break; - } - if ((double) lightColor.X < (double) num1) - lightColor.X = num1; - if ((double) lightColor.Y < (double) num2) - lightColor.Y = num2; - if ((double) lightColor.Z >= (double) num3) - return; - lightColor.Z = num3; - } - - private void ApplyTileLight( - Tile tile, - int x, - int y, - ref FastRandom localRandom, - ref Vector3 lightColor) - { - float R = 0.0f; - float G = 0.0f; - float B = 0.0f; - if (Main.tileLighted[(int) tile.type]) - { - switch (tile.type) - { - case 4: - if (tile.frameX < (short) 66) - { - TorchID.TorchColor((int) tile.frameY / 22, out R, out G, out B); - break; - } - break; - case 17: - case 133: - case 302: - R = 0.83f; - G = 0.6f; - B = 0.5f; - break; - case 22: - case 140: - R = 0.12f; - G = 0.07f; - B = 0.32f; - break; - case 26: - case 31: - if (tile.type == (ushort) 31 && tile.frameX >= (short) 36 || tile.type == (ushort) 26 && tile.frameX >= (short) 54) - { - float num = (float) localRandom.Next(-5, 6) * (1f / 400f); - R = (float) (0.5 + (double) num * 2.0); - G = 0.2f + num; - B = 0.1f; - break; - } - float num1 = (float) localRandom.Next(-5, 6) * (1f / 400f); - R = 0.31f + num1; - G = 0.1f; - B = (float) (0.439999997615814 + (double) num1 * 2.0); - break; - case 27: - if (tile.frameY < (short) 36) - { - R = 0.3f; - G = 0.27f; - break; - } - break; - case 33: - if (tile.frameX == (short) 0) - { - switch ((int) tile.frameY / 22) - { - case 0: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 1: - R = 0.55f; - G = 0.85f; - B = 0.35f; - break; - case 2: - R = 0.65f; - G = 0.95f; - B = 0.5f; - break; - case 3: - R = 0.2f; - G = 0.75f; - B = 1f; - break; - case 5: - R = 0.85f; - G = 0.6f; - B = 1f; - break; - case 7: - case 8: - R = 0.75f; - G = 0.85f; - B = 1f; - break; - case 9: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 10: - R = 1f; - G = 0.97f; - B = 0.85f; - break; - case 14: - R = 1f; - G = 1f; - B = 0.6f; - break; - case 15: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 18: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 19: - R = 0.37f; - G = 0.8f; - B = 1f; - break; - case 20: - R = 0.0f; - G = 0.9f; - B = 1f; - break; - case 21: - R = 0.25f; - G = 0.7f; - B = 1f; - break; - case 23: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 24: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 25: - R = (float) (0.5 * (double) Main.demonTorch + 1.0 * (1.0 - (double) Main.demonTorch)); - G = 0.3f; - B = (float) (1.0 * (double) Main.demonTorch + 0.5 * (1.0 - (double) Main.demonTorch)); - break; - case 28: - R = 0.9f; - G = 0.75f; - B = 1f; - break; - case 29: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 30: - Vector3 vector3_1 = Main.hslToRgb((float) ((double) Main.demonTorch * 0.119999997317791 + 0.689999997615814), 1f, 0.75f).ToVector3() * 1.2f; - R = vector3_1.X; - G = vector3_1.Y; - B = vector3_1.Z; - break; - case 31: - R = 1f; - G = 0.97f; - B = 0.85f; - break; - case 32: - R = 0.55f; - G = 0.45f; - B = 0.95f; - break; - case 33: - R = 1f; - G = 0.6f; - B = 0.1f; - break; - case 34: - R = 0.3f; - G = 0.75f; - B = 0.55f; - break; - case 35: - R = 0.9f; - G = 0.55f; - B = 0.7f; - break; - case 36: - R = 0.55f; - G = 0.85f; - B = 1f; - break; - case 37: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 38: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - default: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - } - } - else - break; - break; - case 34: - if ((int) tile.frameX % 108 < 54) - { - switch ((int) tile.frameY / 54 + 37 * ((int) tile.frameX / 108)) - { - case 7: - R = 0.95f; - G = 0.95f; - B = 0.5f; - break; - case 8: - R = 0.85f; - G = 0.6f; - B = 1f; - break; - case 9: - R = 1f; - G = 0.6f; - B = 0.6f; - break; - case 11: - case 12: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 13: - R = 1f; - G = 0.97f; - B = 0.85f; - break; - case 15: - R = 1f; - G = 1f; - B = 0.7f; - break; - case 16: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 17: - R = 0.75f; - G = 0.85f; - B = 1f; - break; - case 18: - R = 1f; - G = 1f; - B = 0.6f; - break; - case 19: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 23: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 24: - R = 0.37f; - G = 0.8f; - B = 1f; - break; - case 25: - R = 0.0f; - G = 0.9f; - B = 1f; - break; - case 26: - R = 0.25f; - G = 0.7f; - B = 1f; - break; - case 27: - R = 0.55f; - G = 0.85f; - B = 0.35f; - break; - case 28: - R = 0.65f; - G = 0.95f; - B = 0.5f; - break; - case 29: - R = 0.2f; - G = 0.75f; - B = 1f; - break; - case 30: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 32: - R = (float) (0.5 * (double) Main.demonTorch + 1.0 * (1.0 - (double) Main.demonTorch)); - G = 0.3f; - B = (float) (1.0 * (double) Main.demonTorch + 0.5 * (1.0 - (double) Main.demonTorch)); - break; - case 35: - R = 0.9f; - G = 0.75f; - B = 1f; - break; - case 36: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 37: - Vector3 vector3_2 = Main.hslToRgb((float) ((double) Main.demonTorch * 0.119999997317791 + 0.689999997615814), 1f, 0.75f).ToVector3() * 1.2f; - R = vector3_2.X; - G = vector3_2.Y; - B = vector3_2.Z; - break; - case 38: - R = 1f; - G = 0.97f; - B = 0.85f; - break; - case 39: - R = 0.55f; - G = 0.45f; - B = 0.95f; - break; - case 40: - R = 1f; - G = 0.6f; - B = 0.1f; - break; - case 41: - R = 0.3f; - G = 0.75f; - B = 0.55f; - break; - case 42: - R = 0.9f; - G = 0.55f; - B = 0.7f; - break; - case 43: - R = 0.55f; - G = 0.85f; - B = 1f; - break; - case 44: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 45: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - default: - R = 1f; - G = 0.95f; - B = 0.8f; - break; - } - } - else - break; - break; - case 35: - if (tile.frameX < (short) 36) - { - R = 0.75f; - G = 0.6f; - B = 0.3f; - break; - } - break; - case 37: - R = 0.56f; - G = 0.43f; - B = 0.15f; - break; - case 42: - if (tile.frameX == (short) 0) - { - switch ((int) tile.frameY / 36) - { - case 0: - R = 0.7f; - G = 0.65f; - B = 0.55f; - break; - case 1: - R = 0.9f; - G = 0.75f; - B = 0.6f; - break; - case 2: - R = 0.8f; - G = 0.6f; - B = 0.6f; - break; - case 3: - R = 0.65f; - G = 0.5f; - B = 0.2f; - break; - case 4: - R = 0.5f; - G = 0.7f; - B = 0.4f; - break; - case 5: - R = 0.9f; - G = 0.4f; - B = 0.2f; - break; - case 6: - R = 0.7f; - G = 0.75f; - B = 0.3f; - break; - case 7: - float num2 = Main.demonTorch * 0.2f; - R = 0.9f - num2; - G = 0.9f - num2; - B = 0.7f + num2; - break; - case 8: - R = 0.75f; - G = 0.6f; - B = 0.3f; - break; - case 9: - float num3 = 1f; - float num4 = 0.3f; - B = 0.5f + Main.demonTorch * 0.2f; - R = num3 - Main.demonTorch * 0.1f; - G = num4 - Main.demonTorch * 0.2f; - break; - case 11: - R = 0.85f; - G = 0.6f; - B = 1f; - break; - case 14: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 15: - case 16: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 17: - R = 1f; - G = 0.97f; - B = 0.85f; - break; - case 18: - R = 0.75f; - G = 0.85f; - B = 1f; - break; - case 21: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 22: - R = 1f; - G = 1f; - B = 0.6f; - break; - case 23: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 27: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 28: - R = 0.37f; - G = 0.8f; - B = 1f; - break; - case 29: - R = 0.0f; - G = 0.9f; - B = 1f; - break; - case 30: - R = 0.25f; - G = 0.7f; - B = 1f; - break; - case 32: - R = (float) (0.5 * (double) Main.demonTorch + 1.0 * (1.0 - (double) Main.demonTorch)); - G = 0.3f; - B = (float) (1.0 * (double) Main.demonTorch + 0.5 * (1.0 - (double) Main.demonTorch)); - break; - case 35: - R = 0.7f; - G = 0.6f; - B = 0.9f; - break; - case 36: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 37: - Vector3 vector3_3 = Main.hslToRgb((float) ((double) Main.demonTorch * 0.119999997317791 + 0.689999997615814), 1f, 0.75f).ToVector3() * 1.2f; - R = vector3_3.X; - G = vector3_3.Y; - B = vector3_3.Z; - break; - case 38: - R = 1f; - G = 0.97f; - B = 0.85f; - break; - case 39: - R = 0.55f; - G = 0.45f; - B = 0.95f; - break; - case 40: - R = 1f; - G = 0.6f; - B = 0.1f; - break; - case 41: - R = 0.3f; - G = 0.75f; - B = 0.55f; - break; - case 42: - R = 0.9f; - G = 0.55f; - B = 0.7f; - break; - case 43: - R = 0.55f; - G = 0.85f; - B = 1f; - break; - case 44: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 45: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - default: - R = 1f; - G = 1f; - B = 1f; - break; - } - } - else - break; - break; - case 49: - if (tile.frameX == (short) 0) - { - R = 0.0f; - G = 0.35f; - B = 0.8f; - break; - } - break; - case 61: - if (tile.frameX == (short) 144) - { - float num5 = (float) (1.0 + (double) (270 - (int) Main.mouseTextColor) / 400.0); - float num6 = (float) (0.800000011920929 - (double) (270 - (int) Main.mouseTextColor) / 400.0); - R = 0.42f * num6; - G = 0.81f * num5; - B = 0.52f * num6; - break; - } - break; - case 70: - case 71: - case 72: - case 190: - case 348: - case 349: - case 528: - case 578: - if (tile.type != (ushort) 349 || tile.frameX >= (short) 36) - { - float num7 = (float) localRandom.Next(28, 42) * 0.005f + (float) (270 - (int) Main.mouseTextColor) / 1000f; - R = 0.0f; - G = (float) (0.200000002980232 + (double) num7 / 2.0); - B = 1f; - break; - } - break; - case 77: - R = 0.75f; - G = 0.45f; - B = 0.25f; - break; - case 83: - if (tile.frameX == (short) 18 && !Main.dayTime) - { - R = 0.1f; - G = 0.4f; - B = 0.6f; - } - if (tile.frameX == (short) 90 && !Main.raining && Main.time > 40500.0) - { - R = 0.9f; - G = 0.72f; - B = 0.18f; - break; - } - break; - case 84: - switch ((int) tile.frameX / 18) - { - case 2: - float num8 = (float) (270 - (int) Main.mouseTextColor) / 800f; - if ((double) num8 > 1.0) - num8 = 1f; - else if ((double) num8 < 0.0) - num8 = 0.0f; - R = num8 * 0.7f; - G = num8; - B = num8 * 0.1f; - break; - case 5: - float num9 = 0.9f; - R = num9; - G = num9 * 0.8f; - B = num9 * 0.2f; - break; - case 6: - float num10 = 0.08f; - G = num10 * 0.8f; - B = num10; - break; - } - break; - case 92: - if (tile.frameY <= (short) 18 && tile.frameX == (short) 0) - { - R = 1f; - G = 1f; - B = 1f; - break; - } - break; - case 93: - if (tile.frameX == (short) 0) - { - switch ((int) tile.frameY / 54) - { - case 1: - R = 0.95f; - G = 0.95f; - B = 0.5f; - break; - case 2: - R = 0.85f; - G = 0.6f; - B = 1f; - break; - case 3: - R = 0.75f; - G = 1f; - B = 0.6f; - break; - case 4: - case 5: - R = 0.75f; - G = 0.85f; - B = 1f; - break; - case 6: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 7: - R = 1f; - G = 0.97f; - B = 0.85f; - break; - case 9: - R = 1f; - G = 1f; - B = 0.7f; - break; - case 10: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 12: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 13: - R = 1f; - G = 1f; - B = 0.6f; - break; - case 14: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 18: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 19: - R = 0.37f; - G = 0.8f; - B = 1f; - break; - case 20: - R = 0.0f; - G = 0.9f; - B = 1f; - break; - case 21: - R = 0.25f; - G = 0.7f; - B = 1f; - break; - case 23: - R = (float) (0.5 * (double) Main.demonTorch + 1.0 * (1.0 - (double) Main.demonTorch)); - G = 0.3f; - B = (float) (1.0 * (double) Main.demonTorch + 0.5 * (1.0 - (double) Main.demonTorch)); - break; - case 24: - R = 0.35f; - G = 0.5f; - B = 0.3f; - break; - case 25: - R = 0.34f; - G = 0.4f; - B = 0.31f; - break; - case 26: - R = 0.25f; - G = 0.32f; - B = 0.5f; - break; - case 29: - R = 0.9f; - G = 0.75f; - B = 1f; - break; - case 30: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 31: - Vector3 vector3_4 = Main.hslToRgb((float) ((double) Main.demonTorch * 0.119999997317791 + 0.689999997615814), 1f, 0.75f).ToVector3() * 1.2f; - R = vector3_4.X; - G = vector3_4.Y; - B = vector3_4.Z; - break; - case 32: - R = 1f; - G = 0.97f; - B = 0.85f; - break; - case 33: - R = 0.55f; - G = 0.45f; - B = 0.95f; - break; - case 34: - R = 1f; - G = 0.6f; - B = 0.1f; - break; - case 35: - R = 0.3f; - G = 0.75f; - B = 0.55f; - break; - case 36: - R = 0.9f; - G = 0.55f; - B = 0.7f; - break; - case 37: - R = 0.55f; - G = 0.85f; - B = 1f; - break; - case 38: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 39: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - default: - R = 1f; - G = 0.97f; - B = 0.85f; - break; - } - } - else - break; - break; - case 95: - if (tile.frameX < (short) 36) - { - R = 1f; - G = 0.95f; - B = 0.8f; - break; - } - break; - case 96: - if (tile.frameX >= (short) 36) - { - R = 0.5f; - G = 0.35f; - B = 0.1f; - break; - } - break; - case 98: - if (tile.frameY == (short) 0) - { - R = 1f; - G = 0.97f; - B = 0.85f; - break; - } - break; - case 100: - case 173: - if (tile.frameX < (short) 36) - { - switch ((int) tile.frameY / 36) - { - case 1: - R = 0.95f; - G = 0.95f; - B = 0.5f; - break; - case 2: - R = 0.85f; - G = 0.6f; - B = 1f; - break; - case 3: - R = 1f; - G = 0.6f; - B = 0.6f; - break; - case 5: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 6: - case 7: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 8: - R = 1f; - G = 0.97f; - B = 0.85f; - break; - case 9: - R = 0.75f; - G = 0.85f; - B = 1f; - break; - case 11: - R = 1f; - G = 1f; - B = 0.7f; - break; - case 12: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 13: - R = 1f; - G = 1f; - B = 0.6f; - break; - case 14: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 18: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 19: - R = 0.37f; - G = 0.8f; - B = 1f; - break; - case 20: - R = 0.0f; - G = 0.9f; - B = 1f; - break; - case 21: - R = 0.25f; - G = 0.7f; - B = 1f; - break; - case 22: - R = 0.35f; - G = 0.5f; - B = 0.3f; - break; - case 23: - R = 0.34f; - G = 0.4f; - B = 0.31f; - break; - case 24: - R = 0.25f; - G = 0.32f; - B = 0.5f; - break; - case 25: - R = (float) (0.5 * (double) Main.demonTorch + 1.0 * (1.0 - (double) Main.demonTorch)); - G = 0.3f; - B = (float) (1.0 * (double) Main.demonTorch + 0.5 * (1.0 - (double) Main.demonTorch)); - break; - case 29: - R = 0.9f; - G = 0.75f; - B = 1f; - break; - case 30: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 31: - Vector3 vector3_5 = Main.hslToRgb((float) ((double) Main.demonTorch * 0.119999997317791 + 0.689999997615814), 1f, 0.75f).ToVector3() * 1.2f; - R = vector3_5.X; - G = vector3_5.Y; - B = vector3_5.Z; - break; - case 32: - R = 1f; - G = 0.97f; - B = 0.85f; - break; - case 33: - R = 0.55f; - G = 0.45f; - B = 0.95f; - break; - case 34: - R = 1f; - G = 0.6f; - B = 0.1f; - break; - case 35: - R = 0.3f; - G = 0.75f; - B = 0.55f; - break; - case 36: - R = 0.9f; - G = 0.55f; - B = 0.7f; - break; - case 37: - R = 0.55f; - G = 0.85f; - B = 1f; - break; - case 38: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - case 39: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - default: - R = 1f; - G = 0.95f; - B = 0.65f; - break; - } - } - else - break; - break; - case 125: - float num11 = (float) localRandom.Next(28, 42) * 0.01f + (float) (270 - (int) Main.mouseTextColor) / 800f; - G = lightColor.Y = 0.3f * num11; - B = lightColor.Z = 0.6f * num11; - break; - case 126: - if (tile.frameX < (short) 36) - { - R = (float) Main.DiscoR / (float) byte.MaxValue; - G = (float) Main.DiscoG / (float) byte.MaxValue; - B = (float) Main.DiscoB / (float) byte.MaxValue; - break; - } - break; - case 129: - switch ((int) tile.frameX / 18 % 3) - { - case 0: - R = 0.0f; - G = 0.05f; - B = 0.25f; - break; - case 1: - R = 0.2f; - G = 0.0f; - B = 0.15f; - break; - case 2: - R = 0.1f; - G = 0.0f; - B = 0.2f; - break; - } - break; - case 149: - if (tile.frameX <= (short) 36) - { - switch ((int) tile.frameX / 18) - { - case 0: - R = 0.1f; - G = 0.2f; - B = 0.5f; - break; - case 1: - R = 0.5f; - G = 0.1f; - B = 0.1f; - break; - case 2: - R = 0.2f; - G = 0.5f; - B = 0.1f; - break; - } - R *= (float) localRandom.Next(970, 1031) * (1f / 1000f); - G *= (float) localRandom.Next(970, 1031) * (1f / 1000f); - B *= (float) localRandom.Next(970, 1031) * (1f / 1000f); - break; - } - break; - case 160: - R = (float) ((double) Main.DiscoR / (double) byte.MaxValue * 0.25); - G = (float) ((double) Main.DiscoG / (double) byte.MaxValue * 0.25); - B = (float) ((double) Main.DiscoB / (double) byte.MaxValue * 0.25); - break; - case 171: - if (tile.frameX < (short) 10) - { - x -= (int) tile.frameX; - y -= (int) tile.frameY; - } - switch (((int) this._world.Tiles[x, y].frameY & 15360) >> 10) - { - case 1: - R = 0.1f; - G = 0.1f; - B = 0.1f; - break; - case 2: - R = 0.2f; - break; - case 3: - G = 0.2f; - break; - case 4: - B = 0.2f; - break; - case 5: - R = 0.125f; - G = 0.125f; - break; - case 6: - R = 0.2f; - G = 0.1f; - break; - case 7: - R = 0.125f; - G = 0.125f; - break; - case 8: - R = 0.08f; - G = 0.175f; - break; - case 9: - G = 0.125f; - B = 0.125f; - break; - case 10: - R = 0.125f; - B = 0.125f; - break; - case 11: - R = 0.1f; - G = 0.1f; - B = 0.2f; - break; - default: - double num12; - B = (float) (num12 = 0.0); - G = (float) num12; - R = (float) num12; - break; - } - R *= 0.5f; - G *= 0.5f; - B *= 0.5f; - break; - case 174: - if (tile.frameX == (short) 0) - { - R = 1f; - G = 0.95f; - B = 0.65f; - break; - } - break; - case 184: - if (tile.frameX == (short) 110) - { - R = 0.25f; - G = 0.1f; - B = 0.0f; - } - if (tile.frameX == (short) 132) - { - R = 0.0f; - G = 0.25f; - B = 0.0f; - } - if (tile.frameX == (short) 154) - { - R = 0.0f; - G = 0.16f; - B = 0.34f; - } - if (tile.frameX == (short) 176) - { - R = 0.3f; - G = 0.0f; - B = 0.17f; - break; - } - break; - case 204: - case 347: - R = 0.35f; - break; - case 209: - if (tile.frameX == (short) 234 || tile.frameX == (short) 252) - { - Vector3 vector3_6 = PortalHelper.GetPortalColor(Main.myPlayer, 0).ToVector3() * 0.65f; - R = vector3_6.X; - G = vector3_6.Y; - B = vector3_6.Z; - break; - } - if (tile.frameX == (short) 306 || tile.frameX == (short) 324) - { - Vector3 vector3_7 = PortalHelper.GetPortalColor(Main.myPlayer, 1).ToVector3() * 0.65f; - R = vector3_7.X; - G = vector3_7.Y; - B = vector3_7.Z; - break; - } - break; - case 215: - if (tile.frameY < (short) 36) - { - float num13 = (float) localRandom.Next(28, 42) * 0.005f + (float) (270 - (int) Main.mouseTextColor) / 700f; - float num14; - float num15; - float num16; - switch ((int) tile.frameX / 54) - { - case 1: - num14 = 0.7f; - num15 = 1f; - num16 = 0.5f; - break; - case 2: - num14 = (float) (0.5 * (double) Main.demonTorch + 1.0 * (1.0 - (double) Main.demonTorch)); - num15 = 0.3f; - num16 = (float) (1.0 * (double) Main.demonTorch + 0.5 * (1.0 - (double) Main.demonTorch)); - break; - case 3: - num14 = 0.45f; - num15 = 0.75f; - num16 = 1f; - break; - case 4: - num14 = 1.15f; - num15 = 1.15f; - num16 = 0.5f; - break; - case 5: - num14 = (float) Main.DiscoR / (float) byte.MaxValue; - num15 = (float) Main.DiscoG / (float) byte.MaxValue; - num16 = (float) Main.DiscoB / (float) byte.MaxValue; - break; - case 6: - num14 = 0.75f; - num15 = 1.2825f; - num16 = 1.2f; - break; - case 7: - num14 = 0.95f; - num15 = 0.65f; - num16 = 1.3f; - break; - case 8: - num14 = 1.4f; - num15 = 0.85f; - num16 = 0.55f; - break; - case 9: - num14 = 0.25f; - num15 = 1.3f; - num16 = 0.8f; - break; - case 10: - num14 = 0.95f; - num15 = 0.4f; - num16 = 1.4f; - break; - case 11: - num14 = 1.4f; - num15 = 0.7f; - num16 = 0.5f; - break; - case 12: - num14 = 1.25f; - num15 = 0.6f; - num16 = 1.2f; - break; - case 13: - num14 = 0.75f; - num15 = 1.45f; - num16 = 0.9f; - break; - default: - num14 = 0.9f; - num15 = 0.3f; - num16 = 0.1f; - break; - } - R = num14 + num13; - G = num15 + num13; - B = num16 + num13; - break; - } - break; - case 235: - if ((double) lightColor.X < 0.6) - lightColor.X = 0.6f; - if ((double) lightColor.Y < 0.6) - { - lightColor.Y = 0.6f; - break; - } - break; - case 237: - R = 0.1f; - G = 0.1f; - break; - case 238: - if ((double) lightColor.X < 0.5) - lightColor.X = 0.5f; - if ((double) lightColor.Z < 0.5) - { - lightColor.Z = 0.5f; - break; - } - break; - case 262: - R = 0.75f; - B = 0.75f; - break; - case 263: - R = 0.75f; - G = 0.75f; - break; - case 264: - B = 0.75f; - break; - case 265: - G = 0.75f; - break; - case 266: - R = 0.75f; - break; - case 267: - R = 0.75f; - G = 0.75f; - B = 0.75f; - break; - case 268: - R = 0.75f; - G = 0.375f; - break; - case 270: - R = 0.73f; - G = 1f; - B = 0.41f; - break; - case 271: - R = 0.45f; - G = 0.95f; - B = 1f; - break; - case 286: - case 619: - R = 0.1f; - G = 0.2f; - B = 0.7f; - break; - case 316: - case 317: - case 318: - int index = (x - (int) tile.frameX / 18) / 2 * ((y - (int) tile.frameY / 18) / 3) % Main.cageFrames; - bool flag1 = Main.jellyfishCageMode[(int) tile.type - 316, index] == (byte) 2; - if (tile.type == (ushort) 316) - { - if (flag1) - { - R = 0.2f; - G = 0.3f; - B = 0.8f; - } - else - { - R = 0.1f; - G = 0.2f; - B = 0.5f; - } - } - if (tile.type == (ushort) 317) - { - if (flag1) - { - R = 0.2f; - G = 0.7f; - B = 0.3f; - } - else - { - R = 0.05f; - G = 0.45f; - B = 0.1f; - } - } - if (tile.type == (ushort) 318) - { - if (flag1) - { - R = 0.7f; - G = 0.2f; - B = 0.5f; - break; - } - R = 0.4f; - G = 0.1f; - B = 0.25f; - break; - } - break; - case 327: - float num17 = 0.5f + (float) (270 - (int) Main.mouseTextColor) / 1500f + (float) localRandom.Next(0, 50) * 0.0005f; - R = 1f * num17; - G = 0.5f * num17; - B = 0.1f * num17; - break; - case 336: - R = 0.85f; - G = 0.5f; - B = 0.3f; - break; - case 340: - R = 0.45f; - G = 1f; - B = 0.45f; - break; - case 341: - R = (float) (0.400000005960464 * (double) Main.demonTorch + 0.600000023841858 * (1.0 - (double) Main.demonTorch)); - G = 0.35f; - B = (float) (1.0 * (double) Main.demonTorch + 0.600000023841858 * (1.0 - (double) Main.demonTorch)); - break; - case 342: - R = 0.5f; - G = 0.5f; - B = 1.1f; - break; - case 343: - R = 0.85f; - G = 0.85f; - B = 0.3f; - break; - case 344: - R = 0.6f; - G = 1.026f; - B = 0.96f; - break; - case 350: - double num18 = Main.timeForVisualEffects * 0.08; - double num19; - R = (float) (num19 = -Math.Cos((int) (num18 / 6.283) % 3 == 1 ? num18 : 0.0) * 0.1 + 0.1); - G = (float) num19; - B = (float) num19; - break; - case 354: - R = 0.65f; - G = 0.35f; - B = 0.15f; - break; - case 370: - R = 0.32f; - G = 0.16f; - B = 0.12f; - break; - case 372: - if (tile.frameX == (short) 0) - { - R = 0.9f; - G = 0.1f; - B = 0.75f; - break; - } - break; - case 381: - case 517: - R = 0.25f; - G = 0.1f; - B = 0.0f; - break; - case 390: - R = 0.4f; - G = 0.2f; - B = 0.1f; - break; - case 391: - R = 0.3f; - G = 0.1f; - B = 0.25f; - break; - case 405: - if (tile.frameX < (short) 54) - { - float num20 = (float) localRandom.Next(28, 42) * 0.005f + (float) (270 - (int) Main.mouseTextColor) / 700f; - float num21; - float num22; - float num23; - switch ((int) tile.frameX / 54) - { - case 1: - num21 = 0.7f; - num22 = 1f; - num23 = 0.5f; - break; - case 2: - num21 = (float) (0.5 * (double) Main.demonTorch + 1.0 * (1.0 - (double) Main.demonTorch)); - num22 = 0.3f; - num23 = (float) (1.0 * (double) Main.demonTorch + 0.5 * (1.0 - (double) Main.demonTorch)); - break; - case 3: - num21 = 0.45f; - num22 = 0.75f; - num23 = 1f; - break; - case 4: - num21 = 1.15f; - num22 = 1.15f; - num23 = 0.5f; - break; - case 5: - num21 = (float) Main.DiscoR / (float) byte.MaxValue; - num22 = (float) Main.DiscoG / (float) byte.MaxValue; - num23 = (float) Main.DiscoB / (float) byte.MaxValue; - break; - default: - num21 = 0.9f; - num22 = 0.3f; - num23 = 0.1f; - break; - } - R = num21 + num20; - G = num22 + num20; - B = num23 + num20; - break; - } - break; - case 415: - R = 0.7f; - G = 0.5f; - B = 0.1f; - break; - case 416: - R = 0.0f; - G = 0.6f; - B = 0.7f; - break; - case 417: - R = 0.6f; - G = 0.2f; - B = 0.6f; - break; - case 418: - R = 0.6f; - G = 0.6f; - B = 0.9f; - break; - case 429: - int num24 = (int) tile.frameX / 18; - bool flag2 = num24 % 2 >= 1; - bool flag3 = num24 % 4 >= 2; - bool flag4 = num24 % 8 >= 4; - int num25 = num24 % 16 >= 8 ? 1 : 0; - if (flag2) - R += 0.5f; - if (flag3) - G += 0.5f; - if (flag4) - B += 0.5f; - if (num25 != 0) - { - R += 0.2f; - G += 0.2f; - break; - } - break; - case 463: - R = 0.2f; - G = 0.4f; - B = 0.8f; - break; - case 491: - R = 0.5f; - G = 0.4f; - B = 0.7f; - break; - case 500: - R = 0.525f; - G = 0.375f; - B = 0.075f; - break; - case 501: - R = 0.0f; - G = 0.45f; - B = 0.525f; - break; - case 502: - R = 0.45f; - G = 0.15f; - B = 0.45f; - break; - case 503: - R = 0.45f; - G = 0.45f; - B = 0.675f; - break; - case 519: - if (tile.frameY == (short) 90) - { - float num26 = (float) localRandom.Next(28, 42) * 0.005f + (float) (270 - (int) Main.mouseTextColor) / 1000f; - R = 0.1f; - G = (float) (0.200000002980232 + (double) num26 / 2.0); - B = 0.7f + num26; - break; - } - break; - case 534: - case 535: - R = 0.0f; - G = 0.25f; - B = 0.0f; - break; - case 536: - case 537: - R = 0.0f; - G = 0.16f; - B = 0.34f; - break; - case 539: - case 540: - R = 0.3f; - G = 0.0f; - B = 0.17f; - break; - case 548: - if ((int) tile.frameX / 54 >= 7) - { - R = 0.7f; - G = 0.3f; - B = 0.2f; - break; - } - break; - case 564: - if (tile.frameX < (short) 36) - { - R = 0.05f; - G = 0.3f; - B = 0.55f; - break; - } - break; - case 568: - R = 1f; - G = 0.61f; - B = 0.65f; - break; - case 569: - R = 0.12f; - G = 1f; - B = 0.66f; - break; - case 570: - R = 0.57f; - G = 0.57f; - B = 1f; - break; - case 572: - switch ((int) tile.frameY / 36) - { - case 0: - R = 0.9f; - G = 0.5f; - B = 0.7f; - break; - case 1: - R = 0.7f; - G = 0.55f; - B = 0.96f; - break; - case 2: - R = 0.45f; - G = 0.96f; - B = 0.95f; - break; - case 3: - R = 0.5f; - G = 0.96f; - B = 0.62f; - break; - case 4: - R = 0.47f; - G = 0.69f; - B = 0.95f; - break; - case 5: - R = 0.92f; - G = 0.57f; - B = 0.51f; - break; - } - break; - case 580: - R = 0.7f; - G = 0.3f; - B = 0.2f; - break; - case 581: - R = 1f; - G = 0.75f; - B = 0.5f; - break; - case 582: - case 598: - R = 0.7f; - G = 0.2f; - B = 0.1f; - break; - case 592: - if (tile.frameY > (short) 0) - { - float num27 = (float) localRandom.Next(28, 42) * 0.005f + (float) (270 - (int) Main.mouseTextColor) / 700f; - float num28 = 1.35f; - float num29 = 0.45f; - float num30 = 0.15f; - R = num28 + num27; - G = num29 + num27; - B = num30 + num27; - break; - } - break; - case 593: - if (tile.frameX < (short) 18) - { - R = 0.8f; - G = 0.3f; - B = 0.1f; - break; - } - break; - case 594: - if (tile.frameX < (short) 36) - { - R = 0.8f; - G = 0.3f; - B = 0.1f; - break; - } - break; - case 597: - switch ((int) tile.frameX / 54) - { - case 0: - R = 0.05f; - G = 0.8f; - B = 0.3f; - break; - case 1: - R = 0.7f; - G = 0.8f; - B = 0.05f; - break; - case 2: - R = 0.7f; - G = 0.5f; - B = 0.9f; - break; - case 3: - R = 0.6f; - G = 0.6f; - B = 0.8f; - break; - case 4: - R = 0.4f; - G = 0.4f; - B = 1.15f; - break; - case 5: - R = 0.85f; - G = 0.45f; - B = 0.1f; - break; - case 6: - R = 0.8f; - G = 0.8f; - B = 1f; - break; - case 7: - R = 0.5f; - G = 0.8f; - B = 1.2f; - break; - } - R *= 0.75f; - G *= 0.75f; - B *= 0.75f; - break; - case 613: - case 614: - R = 0.7f; - G = 0.3f; - B = 0.2f; - break; - case 620: - Color color = new Color(230, 230, 230, 0).MultiplyRGBA(Main.hslToRgb((float) ((double) Main.GlobalTimeWrappedHourly * 0.5 % 1.0), 1f, 0.5f)) * 0.4f; - R = (float) color.R / (float) byte.MaxValue; - G = (float) color.G / (float) byte.MaxValue; - B = (float) color.B / (float) byte.MaxValue; - break; - } - } - if ((double) lightColor.X < (double) R) - lightColor.X = R; - if ((double) lightColor.Y < (double) G) - lightColor.Y = G; - if ((double) lightColor.Z >= (double) B) - return; - lightColor.Z = B; - } - - private void ApplySurfaceLight(Tile tile, int x, int y, ref Vector3 lightColor) - { - float num1 = 0.0f; - float num2 = 0.0f; - float num3 = 0.0f; - float num4 = (float) Main.tileColor.R / (float) byte.MaxValue; - float num5 = (float) Main.tileColor.G / (float) byte.MaxValue; - float num6 = (float) Main.tileColor.B / (float) byte.MaxValue; - float num7 = (float) (((double) num4 + (double) num5 + (double) num6) / 3.0); - if (tile.active() && TileID.Sets.AllowLightInWater[(int) tile.type]) - { - if ((double) lightColor.X < (double) num7 && (Main.wallLight[(int) tile.wall] || tile.wall == (ushort) 73 || tile.wall == (ushort) 227)) - { - num1 = num4; - num2 = num5; - num3 = num6; - } - } - else if ((!tile.active() || !Main.tileNoSunLight[(int) tile.type] || (tile.slope() != (byte) 0 || tile.halfBrick()) && this._world.Tiles[x, y - 1].liquid == (byte) 0 && this._world.Tiles[x, y + 1].liquid == (byte) 0 && this._world.Tiles[x - 1, y].liquid == (byte) 0 && this._world.Tiles[x + 1, y].liquid == (byte) 0) && (double) lightColor.X < (double) num7 && (Main.wallLight[(int) tile.wall] || tile.wall == (ushort) 73 || tile.wall == (ushort) 227) && tile.liquid < (byte) 200 && (!tile.halfBrick() || this._world.Tiles[x, y - 1].liquid < (byte) 200)) - { - num1 = num4; - num2 = num5; - num3 = num6; - } - if ((!tile.active() || tile.halfBrick() || !Main.tileNoSunLight[(int) tile.type]) && (tile.wall >= (ushort) 88 && tile.wall <= (ushort) 93 || tile.wall == (ushort) 241) && tile.liquid < byte.MaxValue) - { - num1 = num4; - num2 = num5; - num3 = num6; - int num8 = (int) tile.wall - 88; - if (tile.wall == (ushort) 241) - num8 = 6; - switch (num8) - { - case 0: - num1 *= 0.9f; - num2 *= 0.15f; - num3 *= 0.9f; - break; - case 1: - num1 *= 0.9f; - num2 *= 0.9f; - num3 *= 0.15f; - break; - case 2: - num1 *= 0.15f; - num2 *= 0.15f; - num3 *= 0.9f; - break; - case 3: - num1 *= 0.15f; - num2 *= 0.9f; - num3 *= 0.15f; - break; - case 4: - num1 *= 0.9f; - num2 *= 0.15f; - num3 *= 0.15f; - break; - case 5: - float num9 = 0.2f; - float num10 = 0.7f - num9; - num1 *= num10 + (float) Main.DiscoR / (float) byte.MaxValue * num9; - num2 *= num10 + (float) Main.DiscoG / (float) byte.MaxValue * num9; - num3 *= num10 + (float) Main.DiscoB / (float) byte.MaxValue * num9; - break; - case 6: - num1 *= 0.9f; - num2 *= 0.5f; - num3 *= 0.0f; - break; - } - } - if ((double) lightColor.X < (double) num1) - lightColor.X = num1; - if ((double) lightColor.Y < (double) num2) - lightColor.Y = num2; - if ((double) lightColor.Z >= (double) num3) - return; - lightColor.Z = num3; - } - - private void ApplyHellLight(Tile tile, int x, int y, ref Vector3 lightColor) - { - float num1 = 0.0f; - float num2 = 0.0f; - float num3 = 0.0f; - float num4 = (float) (0.550000011920929 + Math.Sin((double) Main.GlobalTimeWrappedHourly * 2.0) * 0.0799999982118607); - if ((!tile.active() || !Main.tileNoSunLight[(int) tile.type] || (tile.slope() != (byte) 0 || tile.halfBrick()) && this._world.Tiles[x, y - 1].liquid == (byte) 0 && this._world.Tiles[x, y + 1].liquid == (byte) 0 && this._world.Tiles[x - 1, y].liquid == (byte) 0 && this._world.Tiles[x + 1, y].liquid == (byte) 0) && (double) lightColor.X < (double) num4 && (Main.wallLight[(int) tile.wall] || tile.wall == (ushort) 73 || tile.wall == (ushort) 227) && tile.liquid < (byte) 200 && (!tile.halfBrick() || this._world.Tiles[x, y - 1].liquid < (byte) 200)) - { - num1 = num4; - num2 = num4 * 0.6f; - num3 = num4 * 0.2f; - } - if ((!tile.active() || tile.halfBrick() || !Main.tileNoSunLight[(int) tile.type]) && tile.wall >= (ushort) 88 && tile.wall <= (ushort) 93 && tile.liquid < byte.MaxValue) - { - num1 = num4; - num2 = num4 * 0.6f; - num3 = num4 * 0.2f; - switch (tile.wall) - { - case 88: - num1 *= 0.9f; - num2 *= 0.15f; - num3 *= 0.9f; - break; - case 89: - num1 *= 0.9f; - num2 *= 0.9f; - num3 *= 0.15f; - break; - case 90: - num1 *= 0.15f; - num2 *= 0.15f; - num3 *= 0.9f; - break; - case 91: - num1 *= 0.15f; - num2 *= 0.9f; - num3 *= 0.15f; - break; - case 92: - num1 *= 0.9f; - num2 *= 0.15f; - num3 *= 0.15f; - break; - case 93: - float num5 = 0.2f; - float num6 = 0.7f - num5; - num1 *= num6 + (float) Main.DiscoR / (float) byte.MaxValue * num5; - num2 *= num6 + (float) Main.DiscoG / (float) byte.MaxValue * num5; - num3 *= num6 + (float) Main.DiscoB / (float) byte.MaxValue * num5; - break; - } - } - if ((double) lightColor.X < (double) num1) - lightColor.X = num1; - if ((double) lightColor.Y < (double) num2) - lightColor.Y = num2; - if ((double) lightColor.Z >= (double) num3) - return; - lightColor.Z = num3; - } - } -} diff --git a/Graphics/MagicMissileDrawer.cs b/Graphics/MagicMissileDrawer.cs deleted file mode 100644 index 5344bb9..0000000 --- a/Graphics/MagicMissileDrawer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.MagicMissileDrawer -// 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; -using System.Runtime.InteropServices; -using Terraria.DataStructures; -using Terraria.Graphics.Shaders; - -namespace Terraria.Graphics -{ - [StructLayout(LayoutKind.Sequential, Size = 1)] - public struct MagicMissileDrawer - { - private static VertexStrip _vertexStrip = new VertexStrip(); - - public void Draw(Projectile proj) - { - MiscShaderData miscShaderData = GameShaders.Misc["MagicMissile"]; - miscShaderData.UseSaturation(-2.8f); - miscShaderData.UseOpacity(2f); - miscShaderData.Apply(new DrawData?()); - MagicMissileDrawer._vertexStrip.PrepareStripWithProceduralPadding(proj.oldPos, proj.oldRot, new VertexStrip.StripColorFunction(this.StripColors), new VertexStrip.StripHalfWidthFunction(this.StripWidth), -Main.screenPosition + proj.Size / 2f); - MagicMissileDrawer._vertexStrip.DrawTrail(); - Main.pixelShader.CurrentTechnique.Passes[0].Apply(); - } - - private Color StripColors(float progressOnStrip) - { - Color color = Color.Lerp(Color.White, Color.Violet, Utils.GetLerpValue(0.0f, 0.7f, progressOnStrip, true)) * (1f - Utils.GetLerpValue(0.0f, 0.98f, progressOnStrip, false)); - color.A /= (byte) 2; - return color; - } - - private float StripWidth(float progressOnStrip) => MathHelper.Lerp(26f, 32f, Utils.GetLerpValue(0.0f, 0.2f, progressOnStrip, true)) * Utils.GetLerpValue(0.0f, 0.07f, progressOnStrip, true); - } -} diff --git a/Graphics/RainbowRodDrawer.cs b/Graphics/RainbowRodDrawer.cs deleted file mode 100644 index b4b9667..0000000 --- a/Graphics/RainbowRodDrawer.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.RainbowRodDrawer -// 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; -using System.Runtime.InteropServices; -using Terraria.DataStructures; -using Terraria.Graphics.Shaders; - -namespace Terraria.Graphics -{ - [StructLayout(LayoutKind.Sequential, Size = 1)] - public struct RainbowRodDrawer - { - private static VertexStrip _vertexStrip = new VertexStrip(); - - public void Draw(Projectile proj) - { - MiscShaderData miscShaderData = GameShaders.Misc["RainbowRod"]; - miscShaderData.UseSaturation(-2.8f); - miscShaderData.UseOpacity(4f); - miscShaderData.Apply(new DrawData?()); - RainbowRodDrawer._vertexStrip.PrepareStripWithProceduralPadding(proj.oldPos, proj.oldRot, new VertexStrip.StripColorFunction(this.StripColors), new VertexStrip.StripHalfWidthFunction(this.StripWidth), -Main.screenPosition + proj.Size / 2f); - RainbowRodDrawer._vertexStrip.DrawTrail(); - Main.pixelShader.CurrentTechnique.Passes[0].Apply(); - } - - private Color StripColors(float progressOnStrip) - { - Color color = Color.Lerp(Color.White, Main.hslToRgb((float) (((double) progressOnStrip * 1.60000002384186 - (double) Main.GlobalTimeWrappedHourly) % 1.0), 1f, 0.5f), Utils.GetLerpValue(-0.2f, 0.5f, progressOnStrip, true)) * (1f - Utils.GetLerpValue(0.0f, 0.98f, progressOnStrip, false)); - color.A = (byte) 0; - return color; - } - - private float StripWidth(float progressOnStrip) - { - float num = 1f; - float lerpValue = Utils.GetLerpValue(0.0f, 0.2f, progressOnStrip, true); - return MathHelper.Lerp(0.0f, 32f, num * (float) (1.0 - (1.0 - (double) lerpValue) * (1.0 - (double) lerpValue))); - } - } -} diff --git a/Graphics/Renderers/ABasicParticle.cs b/Graphics/Renderers/ABasicParticle.cs deleted file mode 100644 index e1e8061..0000000 --- a/Graphics/Renderers/ABasicParticle.cs +++ /dev/null @@ -1,88 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.Renderers.ABasicParticle -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; - -namespace Terraria.Graphics.Renderers -{ - public abstract class ABasicParticle : IPooledParticle, IParticle - { - public Vector2 AccelerationPerFrame; - public Vector2 Velocity; - public Vector2 LocalPosition; - protected Asset _texture; - protected Rectangle _frame; - protected Vector2 _origin; - public float Rotation; - public float RotationVelocity; - public float RotationAcceleration; - public Vector2 Scale; - public Vector2 ScaleVelocity; - public Vector2 ScaleAcceleration; - - public bool ShouldBeRemovedFromRenderer { get; protected set; } - - public ABasicParticle() - { - this._texture = (Asset) null; - this._frame = Rectangle.Empty; - this._origin = Vector2.Zero; - this.Velocity = Vector2.Zero; - this.LocalPosition = Vector2.Zero; - this.ShouldBeRemovedFromRenderer = false; - } - - public virtual void SetBasicInfo( - Asset textureAsset, - Rectangle? frame, - Vector2 initialVelocity, - Vector2 initialLocalPosition) - { - this._texture = textureAsset; - this._frame = frame.HasValue ? frame.Value : this._texture.Frame(); - this._origin = this._frame.Size() / 2f; - this.Velocity = initialVelocity; - this.LocalPosition = initialLocalPosition; - this.ShouldBeRemovedFromRenderer = false; - } - - public virtual void Update(ref ParticleRendererSettings settings) - { - this.Velocity += this.AccelerationPerFrame; - this.LocalPosition += this.Velocity; - this.RotationVelocity += this.RotationAcceleration; - this.Rotation += this.RotationVelocity; - this.ScaleVelocity += this.ScaleAcceleration; - this.Scale += this.ScaleVelocity; - } - - public abstract void Draw(ref ParticleRendererSettings settings, SpriteBatch spritebatch); - - public bool IsRestingInPool { get; private set; } - - public void RestInPool() => this.IsRestingInPool = true; - - public virtual void FetchFromPool() - { - this.IsRestingInPool = false; - this.ShouldBeRemovedFromRenderer = false; - this.AccelerationPerFrame = Vector2.Zero; - this.Velocity = Vector2.Zero; - this.LocalPosition = Vector2.Zero; - this._texture = (Asset) null; - this._frame = Rectangle.Empty; - this._origin = Vector2.Zero; - this.Rotation = 0.0f; - this.RotationVelocity = 0.0f; - this.RotationAcceleration = 0.0f; - this.Scale = Vector2.Zero; - this.ScaleVelocity = Vector2.Zero; - this.ScaleAcceleration = Vector2.Zero; - } - } -} diff --git a/Graphics/Renderers/CreativeSacrificeParticle.cs b/Graphics/Renderers/CreativeSacrificeParticle.cs deleted file mode 100644 index 380d5bd..0000000 --- a/Graphics/Renderers/CreativeSacrificeParticle.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.Renderers.CreativeSacrificeParticle -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; - -namespace Terraria.Graphics.Renderers -{ - public class CreativeSacrificeParticle : IParticle - { - public Vector2 AccelerationPerFrame; - public Vector2 Velocity; - public Vector2 LocalPosition; - public float ScaleOffsetPerFrame; - public float StopWhenBelowXScale; - private Asset _texture; - private Rectangle _frame; - private Vector2 _origin; - private float _scale; - - public bool ShouldBeRemovedFromRenderer { get; private set; } - - public CreativeSacrificeParticle( - Asset textureAsset, - Rectangle? frame, - Vector2 initialVelocity, - Vector2 initialLocalPosition) - { - this._texture = textureAsset; - this._frame = frame.HasValue ? frame.Value : this._texture.Frame(); - this._origin = this._frame.Size() / 2f; - this.Velocity = initialVelocity; - this.LocalPosition = initialLocalPosition; - this.StopWhenBelowXScale = 0.0f; - this.ShouldBeRemovedFromRenderer = false; - this._scale = 0.6f; - } - - public void Update(ref ParticleRendererSettings settings) - { - this.Velocity += this.AccelerationPerFrame; - this.LocalPosition += this.Velocity; - this._scale += this.ScaleOffsetPerFrame; - if ((double) this._scale > (double) this.StopWhenBelowXScale) - return; - this.ShouldBeRemovedFromRenderer = true; - } - - public void Draw(ref ParticleRendererSettings settings, SpriteBatch spritebatch) - { - Color color = Color.Lerp(Color.White, new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), Utils.GetLerpValue(0.1f, 0.5f, this._scale, false)); - spritebatch.Draw(this._texture.Value, settings.AnchorPosition + this.LocalPosition, new Rectangle?(this._frame), color, 0.0f, this._origin, this._scale, SpriteEffects.None, 0.0f); - } - } -} diff --git a/Graphics/Renderers/FadingParticle.cs b/Graphics/Renderers/FadingParticle.cs deleted file mode 100644 index 0877ba4..0000000 --- a/Graphics/Renderers/FadingParticle.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.Renderers.FadingParticle -// 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; -using Microsoft.Xna.Framework.Graphics; - -namespace Terraria.Graphics.Renderers -{ - public class FadingParticle : ABasicParticle - { - public float FadeInNormalizedTime; - public float FadeOutNormalizedTime = 1f; - public Color ColorTint = Color.White; - private float _timeTolive; - private float _timeSinceSpawn; - - public override void FetchFromPool() - { - base.FetchFromPool(); - this.FadeInNormalizedTime = 0.0f; - this.FadeOutNormalizedTime = 1f; - this.ColorTint = Color.White; - this._timeTolive = 0.0f; - this._timeSinceSpawn = 0.0f; - } - - public void SetTypeInfo(float timeToLive) => this._timeTolive = timeToLive; - - public override void Update(ref ParticleRendererSettings settings) - { - base.Update(ref settings); - ++this._timeSinceSpawn; - if ((double) this._timeSinceSpawn < (double) this._timeTolive) - return; - this.ShouldBeRemovedFromRenderer = true; - } - - public override void Draw(ref ParticleRendererSettings settings, SpriteBatch spritebatch) - { - Color color = this.ColorTint * Utils.GetLerpValue(0.0f, this.FadeInNormalizedTime, this._timeSinceSpawn / this._timeTolive, true) * Utils.GetLerpValue(1f, this.FadeOutNormalizedTime, this._timeSinceSpawn / this._timeTolive, true); - spritebatch.Draw(this._texture.Value, settings.AnchorPosition + this.LocalPosition, new Rectangle?(this._frame), color, this.Rotation, this._origin, this.Scale, SpriteEffects.None, 0.0f); - } - } -} diff --git a/Graphics/Renderers/FlameParticle.cs b/Graphics/Renderers/FlameParticle.cs deleted file mode 100644 index 6a9ce21..0000000 --- a/Graphics/Renderers/FlameParticle.cs +++ /dev/null @@ -1,77 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.Renderers.FlameParticle -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria.DataStructures; - -namespace Terraria.Graphics.Renderers -{ - public class FlameParticle : ABasicParticle - { - public float FadeOutNormalizedTime = 1f; - private float _timeTolive; - private float _timeSinceSpawn; - private int _indexOfPlayerWhoSpawnedThis; - private int _packedShaderIndex; - - public override void FetchFromPool() - { - base.FetchFromPool(); - this.FadeOutNormalizedTime = 1f; - this._timeTolive = 0.0f; - this._timeSinceSpawn = 0.0f; - this._indexOfPlayerWhoSpawnedThis = 0; - this._packedShaderIndex = 0; - } - - public override void SetBasicInfo( - Asset textureAsset, - Rectangle? frame, - Vector2 initialVelocity, - Vector2 initialLocalPosition) - { - base.SetBasicInfo(textureAsset, frame, initialVelocity, initialLocalPosition); - this._origin = new Vector2((float) (this._frame.Width / 2), (float) (this._frame.Height - 2)); - } - - public void SetTypeInfo(float timeToLive, int indexOfPlayerWhoSpawnedIt, int packedShaderIndex) - { - this._timeTolive = timeToLive; - this._indexOfPlayerWhoSpawnedThis = indexOfPlayerWhoSpawnedIt; - this._packedShaderIndex = packedShaderIndex; - } - - public override void Update(ref ParticleRendererSettings settings) - { - base.Update(ref settings); - ++this._timeSinceSpawn; - if ((double) this._timeSinceSpawn < (double) this._timeTolive) - return; - this.ShouldBeRemovedFromRenderer = true; - } - - public override void Draw(ref ParticleRendererSettings settings, SpriteBatch spritebatch) - { - Color color = new Color(120, 120, 120, 60) * Utils.GetLerpValue(1f, this.FadeOutNormalizedTime, this._timeSinceSpawn / this._timeTolive, true); - Vector2 vector2_1 = settings.AnchorPosition + this.LocalPosition; - ulong seed = Main.TileFrameSeed ^ ((ulong) this.LocalPosition.X << 32 | (ulong) (uint) this.LocalPosition.Y); - Player player = Main.player[this._indexOfPlayerWhoSpawnedThis]; - for (int index = 0; index < 4; ++index) - { - Vector2 vector2_2 = new Vector2((float) Utils.RandomInt(ref seed, -2, 3), (float) Utils.RandomInt(ref seed, -2, 3)); - DrawData cdd = new DrawData(this._texture.Value, vector2_1 + vector2_2 * this.Scale, new Rectangle?(this._frame), color, this.Rotation, this._origin, this.Scale, SpriteEffects.None, 0) - { - shader = this._packedShaderIndex - }; - PlayerDrawHelper.SetShaderForData(player, 0, ref cdd); - cdd.Draw(spritebatch); - } - Main.pixelShader.CurrentTechnique.Passes[0].Apply(); - } - } -} diff --git a/Graphics/Renderers/IParticle.cs b/Graphics/Renderers/IParticle.cs deleted file mode 100644 index fb7e61e..0000000 --- a/Graphics/Renderers/IParticle.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.Renderers.IParticle -// 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.Graphics; - -namespace Terraria.Graphics.Renderers -{ - public interface IParticle - { - bool ShouldBeRemovedFromRenderer { get; } - - void Update(ref ParticleRendererSettings settings); - - void Draw(ref ParticleRendererSettings settings, SpriteBatch spritebatch); - } -} diff --git a/Graphics/Renderers/IPlayerRenderer.cs b/Graphics/Renderers/IPlayerRenderer.cs deleted file mode 100644 index 0b16740..0000000 --- a/Graphics/Renderers/IPlayerRenderer.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.Renderers.IPlayerRenderer -// 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; -using System.Collections.Generic; - -namespace Terraria.Graphics.Renderers -{ - public interface IPlayerRenderer - { - void DrawPlayers(Camera camera, IEnumerable players); - - void DrawPlayerHead( - Camera camera, - Player drawPlayer, - Vector2 position, - float alpha = 1f, - float scale = 1f, - Color borderColor = default (Color)); - - void DrawPlayer( - Camera camera, - Player drawPlayer, - Vector2 position, - float rotation, - Vector2 rotationOrigin, - float shadow = 0.0f, - float scale = 1f); - } -} diff --git a/Graphics/Renderers/IPooledParticle.cs b/Graphics/Renderers/IPooledParticle.cs deleted file mode 100644 index 7b717ef..0000000 --- a/Graphics/Renderers/IPooledParticle.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.Renderers.IPooledParticle -// 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.Graphics.Renderers -{ - public interface IPooledParticle : IParticle - { - bool IsRestingInPool { get; } - - void RestInPool(); - - void FetchFromPool(); - } -} diff --git a/Graphics/Renderers/LegacyPlayerRenderer.cs b/Graphics/Renderers/LegacyPlayerRenderer.cs deleted file mode 100644 index 23977dd..0000000 --- a/Graphics/Renderers/LegacyPlayerRenderer.cs +++ /dev/null @@ -1,453 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.Renderers.LegacyPlayerRenderer -// 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; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using Terraria.DataStructures; -using Terraria.GameContent; -using Terraria.ID; - -namespace Terraria.Graphics.Renderers -{ - public class LegacyPlayerRenderer : IPlayerRenderer - { - private readonly List _drawData = new List(); - private readonly List _dust = new List(); - private readonly List _gore = new List(); - - public static SamplerState MountedSamplerState => !Main.drawToScreen ? SamplerState.AnisotropicClamp : SamplerState.LinearClamp; - - public void DrawPlayers(Camera camera, IEnumerable players) - { - foreach (Player player in players) - this.DrawPlayerFull(camera, player); - } - - public void DrawPlayerHead( - Camera camera, - Player drawPlayer, - Vector2 position, - float alpha = 1f, - float scale = 1f, - Color borderColor = default (Color)) - { - this._drawData.Clear(); - this._dust.Clear(); - this._gore.Clear(); - PlayerDrawHeadSet drawinfo = new PlayerDrawHeadSet(); - drawinfo.BoringSetup(drawPlayer, this._drawData, this._dust, this._gore, position.X, position.Y, alpha, scale); - PlayerDrawHeadLayers.DrawPlayer_00_BackHelmet(ref drawinfo); - PlayerDrawHeadLayers.DrawPlayer_01_FaceSkin(ref drawinfo); - PlayerDrawHeadLayers.DrawPlayer_02_DrawArmorWithFullHair(ref drawinfo); - PlayerDrawHeadLayers.DrawPlayer_03_HelmetHair(ref drawinfo); - PlayerDrawHeadLayers.DrawPlayer_04_JungleRose(ref drawinfo); - PlayerDrawHeadLayers.DrawPlayer_05_TallHats(ref drawinfo); - PlayerDrawHeadLayers.DrawPlayer_06_NormalHats(ref drawinfo); - PlayerDrawHeadLayers.DrawPlayer_07_JustHair(ref drawinfo); - PlayerDrawHeadLayers.DrawPlayer_08_FaceAcc(ref drawinfo); - this.CreateOutlines(alpha, scale, borderColor); - PlayerDrawHeadLayers.DrawPlayer_RenderAllLayers(ref drawinfo); - } - - private void CreateOutlines(float alpha, float scale, Color borderColor) - { - if (!(borderColor != Color.Transparent)) - return; - List drawDataList1 = new List((IEnumerable) this._drawData); - List drawDataList2 = new List((IEnumerable) this._drawData); - float num1 = 2f * scale; - Color color1 = borderColor * (alpha * alpha); - Color color2 = Color.Black * (alpha * alpha); - int colorOnlyShaderIndex = ContentSamples.CommonlyUsedContentSamples.ColorOnlyShaderIndex; - for (int index = 0; index < drawDataList2.Count; ++index) - { - DrawData drawData = drawDataList2[index]; - drawData.shader = colorOnlyShaderIndex; - drawData.color = color2; - drawDataList2[index] = drawData; - } - int num2 = 2; - for (int index1 = -num2; index1 <= num2; ++index1) - { - for (int index2 = -num2; index2 <= num2; ++index2) - { - if (Math.Abs(index1) + Math.Abs(index2) == num2) - { - Vector2 vector2 = new Vector2((float) index1 * num1, (float) index2 * num1); - for (int index3 = 0; index3 < drawDataList2.Count; ++index3) - { - DrawData drawData = drawDataList2[index3]; - drawData.position += vector2; - this._drawData.Add(drawData); - } - } - } - } - for (int index = 0; index < drawDataList2.Count; ++index) - { - DrawData drawData = drawDataList2[index]; - drawData.shader = colorOnlyShaderIndex; - drawData.color = color1; - drawDataList2[index] = drawData; - } - Vector2 vector2_1 = Vector2.Zero; - int num3 = 1; - for (int index4 = -num3; index4 <= num3; ++index4) - { - for (int index5 = -num3; index5 <= num3; ++index5) - { - if (Math.Abs(index4) + Math.Abs(index5) == num3) - { - vector2_1 = new Vector2((float) index4 * num1, (float) index5 * num1); - for (int index6 = 0; index6 < drawDataList2.Count; ++index6) - { - DrawData drawData = drawDataList2[index6]; - drawData.position += vector2_1; - this._drawData.Add(drawData); - } - } - } - } - this._drawData.AddRange((IEnumerable) drawDataList1); - } - - public void DrawPlayer( - Camera camera, - Player drawPlayer, - Vector2 position, - float rotation, - Vector2 rotationOrigin, - float shadow = 0.0f, - float scale = 1f) - { - if (drawPlayer.ShouldNotDraw) - return; - PlayerDrawSet drawinfo = new PlayerDrawSet(); - this._drawData.Clear(); - this._dust.Clear(); - this._gore.Clear(); - drawinfo.BoringSetup(drawPlayer, this._drawData, this._dust, this._gore, position, shadow, rotation, rotationOrigin); - PlayerDrawLayers.DrawPlayer_extra_TorsoPlus(ref drawinfo); - PlayerDrawLayers.DrawPlayer_01_BackHair(ref drawinfo); - PlayerDrawLayers.DrawPlayer_01_2_JimsCloak(ref drawinfo); - PlayerDrawLayers.DrawPlayer_01_3_BackHead(ref drawinfo); - PlayerDrawLayers.DrawPlayer_extra_TorsoMinus(ref drawinfo); - PlayerDrawLayers.DrawPlayer_02_MountBehindPlayer(ref drawinfo); - PlayerDrawLayers.DrawPlayer_03_Carpet(ref drawinfo); - PlayerDrawLayers.DrawPlayer_03_PortableStool(ref drawinfo); - PlayerDrawLayers.DrawPlayer_extra_TorsoPlus(ref drawinfo); - PlayerDrawLayers.DrawPlayer_04_ElectrifiedDebuffBack(ref drawinfo); - PlayerDrawLayers.DrawPlayer_05_ForbiddenSetRing(ref drawinfo); - PlayerDrawLayers.DrawPlayer_05_2_SafemanSun(ref drawinfo); - PlayerDrawLayers.DrawPlayer_06_WebbedDebuffBack(ref drawinfo); - PlayerDrawLayers.DrawPlayer_07_LeinforsHairShampoo(ref drawinfo); - PlayerDrawLayers.DrawPlayer_extra_TorsoMinus(ref drawinfo); - PlayerDrawLayers.DrawPlayer_08_Backpacks(ref drawinfo); - PlayerDrawLayers.DrawPlayer_09_BackAc(ref drawinfo); - PlayerDrawLayers.DrawPlayer_10_Wings(ref drawinfo); - PlayerDrawLayers.DrawPlayer_11_Balloons(ref drawinfo); - if (drawinfo.weaponDrawOrder == WeaponDrawOrder.BehindBackArm) - PlayerDrawLayers.DrawPlayer_27_HeldItem(ref drawinfo); - PlayerDrawLayers.DrawPlayer_12_Skin(ref drawinfo); - if (drawinfo.drawPlayer.wearsRobe && drawinfo.drawPlayer.body != 166) - { - PlayerDrawLayers.DrawPlayer_14_Shoes(ref drawinfo); - PlayerDrawLayers.DrawPlayer_13_Leggings(ref drawinfo); - } - else - { - PlayerDrawLayers.DrawPlayer_13_Leggings(ref drawinfo); - PlayerDrawLayers.DrawPlayer_14_Shoes(ref drawinfo); - } - PlayerDrawLayers.DrawPlayer_extra_TorsoPlus(ref drawinfo); - PlayerDrawLayers.DrawPlayer_15_SkinLongCoat(ref drawinfo); - PlayerDrawLayers.DrawPlayer_16_ArmorLongCoat(ref drawinfo); - PlayerDrawLayers.DrawPlayer_17_Torso(ref drawinfo); - PlayerDrawLayers.DrawPlayer_18_OffhandAcc(ref drawinfo); - PlayerDrawLayers.DrawPlayer_19_WaistAcc(ref drawinfo); - PlayerDrawLayers.DrawPlayer_20_NeckAcc(ref drawinfo); - PlayerDrawLayers.DrawPlayer_21_Head(ref drawinfo); - PlayerDrawLayers.DrawPlayer_22_FaceAcc(ref drawinfo); - if (drawinfo.drawFrontAccInNeckAccLayer) - { - PlayerDrawLayers.DrawPlayer_extra_TorsoMinus(ref drawinfo); - PlayerDrawLayers.DrawPlayer_32_FrontAcc(ref drawinfo); - PlayerDrawLayers.DrawPlayer_extra_TorsoPlus(ref drawinfo); - } - PlayerDrawLayers.DrawPlayer_23_MountFront(ref drawinfo); - PlayerDrawLayers.DrawPlayer_24_Pulley(ref drawinfo); - PlayerDrawLayers.DrawPlayer_25_Shield(ref drawinfo); - PlayerDrawLayers.DrawPlayer_extra_MountPlus(ref drawinfo); - PlayerDrawLayers.DrawPlayer_26_SolarShield(ref drawinfo); - PlayerDrawLayers.DrawPlayer_extra_MountMinus(ref drawinfo); - if (drawinfo.weaponDrawOrder == WeaponDrawOrder.BehindFrontArm) - PlayerDrawLayers.DrawPlayer_27_HeldItem(ref drawinfo); - PlayerDrawLayers.DrawPlayer_28_ArmOverItem(ref drawinfo); - PlayerDrawLayers.DrawPlayer_29_OnhandAcc(ref drawinfo); - PlayerDrawLayers.DrawPlayer_30_BladedGlove(ref drawinfo); - PlayerDrawLayers.DrawPlayer_extra_TorsoMinus(ref drawinfo); - if (!drawinfo.drawFrontAccInNeckAccLayer) - PlayerDrawLayers.DrawPlayer_32_FrontAcc(ref drawinfo); - if (drawinfo.weaponDrawOrder == WeaponDrawOrder.OverFrontArm) - PlayerDrawLayers.DrawPlayer_27_HeldItem(ref drawinfo); - PlayerDrawLayers.DrawPlayer_31_ProjectileOverArm(ref drawinfo); - PlayerDrawLayers.DrawPlayer_33_FrozenOrWebbedDebuff(ref drawinfo); - PlayerDrawLayers.DrawPlayer_34_ElectrifiedDebuffFront(ref drawinfo); - PlayerDrawLayers.DrawPlayer_35_IceBarrier(ref drawinfo); - PlayerDrawLayers.DrawPlayer_36_CTG(ref drawinfo); - PlayerDrawLayers.DrawPlayer_37_BeetleBuff(ref drawinfo); - PlayerDrawLayers.DrawPlayer_MakeIntoFirstFractalAfterImage(ref drawinfo); - PlayerDrawLayers.DrawPlayer_TransformDrawData(ref drawinfo); - if ((double) scale != 1.0) - PlayerDrawLayers.DrawPlayer_ScaleDrawData(ref drawinfo, scale); - PlayerDrawLayers.DrawPlayer_RenderAllLayers(ref drawinfo); - if (!drawinfo.drawPlayer.mount.Active || drawinfo.drawPlayer.mount.Type != 11) - return; - for (int i = 0; i < 1000; ++i) - { - if (Main.projectile[i].active && Main.projectile[i].owner == drawinfo.drawPlayer.whoAmI && Main.projectile[i].type == 591) - Main.instance.DrawProj(i); - } - } - - private void DrawPlayerFull(Camera camera, Player drawPlayer) - { - SpriteBatch spriteBatch = camera.SpriteBatch; - SamplerState samplerState = camera.Sampler; - if (drawPlayer.mount.Active && (double) drawPlayer.fullRotation != 0.0) - samplerState = LegacyPlayerRenderer.MountedSamplerState; - spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, samplerState, DepthStencilState.None, camera.Rasterizer, (Effect) null, camera.GameViewMatrix.TransformationMatrix); - if (Main.gamePaused) - drawPlayer.PlayerFrame(); - if (drawPlayer.ghost) - { - for (int index = 0; index < 3; ++index) - { - Vector2 shadowPo = drawPlayer.shadowPos[index]; - Vector2 position = drawPlayer.position - drawPlayer.velocity * (float) (2 + index * 2); - this.DrawGhost(camera, drawPlayer, position, (float) (0.5 + 0.200000002980232 * (double) index)); - } - this.DrawGhost(camera, drawPlayer, drawPlayer.position); - } - else - { - if (drawPlayer.inventory[drawPlayer.selectedItem].flame || drawPlayer.head == 137 || drawPlayer.wings == 22) - { - --drawPlayer.itemFlameCount; - if (drawPlayer.itemFlameCount <= 0) - { - drawPlayer.itemFlameCount = 5; - for (int index = 0; index < 7; ++index) - { - drawPlayer.itemFlamePos[index].X = (float) Main.rand.Next(-10, 11) * 0.15f; - drawPlayer.itemFlamePos[index].Y = (float) Main.rand.Next(-10, 1) * 0.35f; - } - } - } - if (drawPlayer.armorEffectDrawShadowEOCShield) - { - int num = drawPlayer.eocDash / 4; - if (num > 3) - num = 3; - for (int index = 0; index < num; ++index) - this.DrawPlayer(camera, drawPlayer, drawPlayer.shadowPos[index], drawPlayer.shadowRotation[index], drawPlayer.shadowOrigin[index], (float) (0.5 + 0.200000002980232 * (double) index), 1f); - } - Vector2 position1; - if (drawPlayer.invis) - { - drawPlayer.armorEffectDrawOutlines = false; - drawPlayer.armorEffectDrawShadow = false; - drawPlayer.armorEffectDrawShadowSubtle = false; - position1 = drawPlayer.position; - if (drawPlayer.aggro <= -750) - { - this.DrawPlayer(camera, drawPlayer, position1, drawPlayer.fullRotation, drawPlayer.fullRotationOrigin, 1f, 1f); - } - else - { - drawPlayer.invis = false; - this.DrawPlayer(camera, drawPlayer, position1, drawPlayer.fullRotation, drawPlayer.fullRotationOrigin, 0.0f, 1f); - drawPlayer.invis = true; - } - } - if (drawPlayer.armorEffectDrawOutlines) - { - Vector2 position2 = drawPlayer.position; - if (!Main.gamePaused) - drawPlayer.ghostFade += drawPlayer.ghostDir * 0.075f; - if ((double) drawPlayer.ghostFade < 0.1) - { - drawPlayer.ghostDir = 1f; - drawPlayer.ghostFade = 0.1f; - } - else if ((double) drawPlayer.ghostFade > 0.9) - { - drawPlayer.ghostDir = -1f; - drawPlayer.ghostFade = 0.9f; - } - float num1 = drawPlayer.ghostFade * 5f; - for (int index = 0; index < 4; ++index) - { - float num2; - float num3; - switch (index) - { - case 1: - num2 = -num1; - num3 = 0.0f; - break; - case 2: - num2 = 0.0f; - num3 = num1; - break; - case 3: - num2 = 0.0f; - num3 = -num1; - break; - default: - num2 = num1; - num3 = 0.0f; - break; - } - position1 = new Vector2(drawPlayer.position.X + num2, drawPlayer.position.Y + drawPlayer.gfxOffY + num3); - this.DrawPlayer(camera, drawPlayer, position1, drawPlayer.fullRotation, drawPlayer.fullRotationOrigin, drawPlayer.ghostFade, 1f); - } - } - if (drawPlayer.armorEffectDrawOutlinesForbidden) - { - Vector2 position3 = drawPlayer.position; - if (!Main.gamePaused) - drawPlayer.ghostFade += drawPlayer.ghostDir * 0.025f; - if ((double) drawPlayer.ghostFade < 0.1) - { - drawPlayer.ghostDir = 1f; - drawPlayer.ghostFade = 0.1f; - } - else if ((double) drawPlayer.ghostFade > 0.9) - { - drawPlayer.ghostDir = -1f; - drawPlayer.ghostFade = 0.9f; - } - float num4 = drawPlayer.ghostFade * 5f; - for (int index = 0; index < 4; ++index) - { - float num5; - float num6; - switch (index) - { - case 1: - num5 = -num4; - num6 = 0.0f; - break; - case 2: - num5 = 0.0f; - num6 = num4; - break; - case 3: - num5 = 0.0f; - num6 = -num4; - break; - default: - num5 = num4; - num6 = 0.0f; - break; - } - position1 = new Vector2(drawPlayer.position.X + num5, drawPlayer.position.Y + drawPlayer.gfxOffY + num6); - this.DrawPlayer(camera, drawPlayer, position1, drawPlayer.fullRotation, drawPlayer.fullRotationOrigin, drawPlayer.ghostFade, 1f); - } - } - if (drawPlayer.armorEffectDrawShadowBasilisk) - { - int num = (int) ((double) drawPlayer.basiliskCharge * 3.0); - for (int index = 0; index < num; ++index) - this.DrawPlayer(camera, drawPlayer, drawPlayer.shadowPos[index], drawPlayer.shadowRotation[index], drawPlayer.shadowOrigin[index], (float) (0.5 + 0.200000002980232 * (double) index), 1f); - } - else if (drawPlayer.armorEffectDrawShadow) - { - for (int index = 0; index < 3; ++index) - this.DrawPlayer(camera, drawPlayer, drawPlayer.shadowPos[index], drawPlayer.shadowRotation[index], drawPlayer.shadowOrigin[index], (float) (0.5 + 0.200000002980232 * (double) index), 1f); - } - if (drawPlayer.armorEffectDrawShadowLokis) - { - for (int index = 0; index < 3; ++index) - this.DrawPlayer(camera, drawPlayer, Vector2.Lerp(drawPlayer.shadowPos[index], drawPlayer.position + new Vector2(0.0f, drawPlayer.gfxOffY), 0.5f), drawPlayer.shadowRotation[index], drawPlayer.shadowOrigin[index], MathHelper.Lerp(1f, (float) (0.5 + 0.200000002980232 * (double) index), 0.5f), 1f); - } - if (drawPlayer.armorEffectDrawShadowSubtle) - { - for (int index = 0; index < 4; ++index) - { - position1.X = drawPlayer.position.X + (float) Main.rand.Next(-20, 21) * 0.1f; - position1.Y = drawPlayer.position.Y + (float) Main.rand.Next(-20, 21) * 0.1f + drawPlayer.gfxOffY; - this.DrawPlayer(camera, drawPlayer, position1, drawPlayer.fullRotation, drawPlayer.fullRotationOrigin, 0.9f, 1f); - } - } - if (drawPlayer.shadowDodge) - { - ++drawPlayer.shadowDodgeCount; - if ((double) drawPlayer.shadowDodgeCount > 30.0) - drawPlayer.shadowDodgeCount = 30f; - } - else - { - --drawPlayer.shadowDodgeCount; - if ((double) drawPlayer.shadowDodgeCount < 0.0) - drawPlayer.shadowDodgeCount = 0.0f; - } - if ((double) drawPlayer.shadowDodgeCount > 0.0) - { - Vector2 position4 = drawPlayer.position; - position1.X = drawPlayer.position.X + drawPlayer.shadowDodgeCount; - position1.Y = drawPlayer.position.Y + drawPlayer.gfxOffY; - this.DrawPlayer(camera, drawPlayer, position1, drawPlayer.fullRotation, drawPlayer.fullRotationOrigin, (float) (0.5 + (double) Main.rand.Next(-10, 11) * 0.00499999988824129), 1f); - position1.X = drawPlayer.position.X - drawPlayer.shadowDodgeCount; - this.DrawPlayer(camera, drawPlayer, position1, drawPlayer.fullRotation, drawPlayer.fullRotationOrigin, (float) (0.5 + (double) Main.rand.Next(-10, 11) * 0.00499999988824129), 1f); - } - if (drawPlayer.brainOfConfusionDodgeAnimationCounter > 0) - { - Vector2 vector2 = drawPlayer.position + new Vector2(0.0f, drawPlayer.gfxOffY); - float lerpValue = Utils.GetLerpValue(300f, 270f, (float) drawPlayer.brainOfConfusionDodgeAnimationCounter, false); - float y = MathHelper.Lerp(2f, 120f, lerpValue); - if ((double) lerpValue >= 0.0 && (double) lerpValue <= 1.0) - { - for (float num = 0.0f; (double) num < 6.28318548202515; num += 1.047198f) - { - position1 = vector2 + new Vector2(0.0f, y).RotatedBy(6.28318548202515 * (double) lerpValue * 0.5 + (double) num); - this.DrawPlayer(camera, drawPlayer, position1, drawPlayer.fullRotation, drawPlayer.fullRotationOrigin, lerpValue, 1f); - } - } - } - position1 = drawPlayer.position; - position1.Y += drawPlayer.gfxOffY; - if (drawPlayer.stoned) - this.DrawPlayerStoned(camera, drawPlayer, position1); - else if (!drawPlayer.invis) - this.DrawPlayer(camera, drawPlayer, position1, drawPlayer.fullRotation, drawPlayer.fullRotationOrigin, 0.0f, 1f); - } - spriteBatch.End(); - } - - private void DrawPlayerStoned(Camera camera, Player drawPlayer, Vector2 position) - { - if (drawPlayer.dead) - return; - SpriteEffects effects = drawPlayer.direction != 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - camera.SpriteBatch.Draw(TextureAssets.Extra[37].Value, new Vector2((float) (int) ((double) position.X - (double) camera.UnscaledPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) position.Y - (double) camera.UnscaledPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 8.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Rectangle?(), Lighting.GetColor((int) ((double) position.X + (double) drawPlayer.width * 0.5) / 16, (int) ((double) position.Y + (double) drawPlayer.height * 0.5) / 16, Color.White), 0.0f, new Vector2((float) (TextureAssets.Extra[37].Width() / 2), (float) (TextureAssets.Extra[37].Height() / 2)), 1f, effects, 0.0f); - } - - private void DrawGhost(Camera camera, Player drawPlayer, Vector2 position, float shadow = 0.0f) - { - byte mouseTextColor = Main.mouseTextColor; - SpriteEffects effects = drawPlayer.direction == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - Color immuneAlpha = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int) ((double) drawPlayer.position.X + (double) drawPlayer.width * 0.5) / 16, (int) ((double) drawPlayer.position.Y + (double) drawPlayer.height * 0.5) / 16, new Color((int) mouseTextColor / 2 + 100, (int) mouseTextColor / 2 + 100, (int) mouseTextColor / 2 + 100, (int) mouseTextColor / 2 + 100)), shadow); - immuneAlpha.A = (byte) ((double) immuneAlpha.A * (1.0 - (double) Math.Max(0.5f, shadow - 0.5f))); - Rectangle rectangle = new Rectangle(0, TextureAssets.Ghost.Height() / 4 * drawPlayer.ghostFrame, TextureAssets.Ghost.Width(), TextureAssets.Ghost.Height() / 4); - Vector2 origin = new Vector2((float) rectangle.Width * 0.5f, (float) rectangle.Height * 0.5f); - camera.SpriteBatch.Draw(TextureAssets.Ghost.Value, new Vector2((float) (int) ((double) position.X - (double) camera.UnscaledPosition.X + (double) (rectangle.Width / 2)), (float) (int) ((double) position.Y - (double) camera.UnscaledPosition.Y + (double) (rectangle.Height / 2))), new Rectangle?(rectangle), immuneAlpha, 0.0f, origin, 1f, effects, 0.0f); - } - } -} diff --git a/Graphics/Renderers/MapHeadRenderer.cs b/Graphics/Renderers/MapHeadRenderer.cs deleted file mode 100644 index cfcb225..0000000 --- a/Graphics/Renderers/MapHeadRenderer.cs +++ /dev/null @@ -1,141 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.Renderers.MapHeadRenderer -// 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; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using Terraria.DataStructures; -using Terraria.GameContent; -using Terraria.ID; - -namespace Terraria.Graphics.Renderers -{ - public class MapHeadRenderer : INeedRenderTargetContent - { - private bool _anyDirty; - private PlayerHeadDrawRenderTargetContent[] _playerRenders = new PlayerHeadDrawRenderTargetContent[(int) byte.MaxValue]; - private readonly List _drawData = new List(); - - public MapHeadRenderer() - { - for (int index = 0; index < this._playerRenders.Length; ++index) - this._playerRenders[index] = new PlayerHeadDrawRenderTargetContent(); - } - - public void DrawPlayerHead( - Camera camera, - Player drawPlayer, - Vector2 position, - float alpha = 1f, - float scale = 1f, - Color borderColor = default (Color)) - { - PlayerHeadDrawRenderTargetContent playerRender = this._playerRenders[drawPlayer.whoAmI]; - playerRender.UsePlayer(drawPlayer); - playerRender.UseColor(borderColor); - playerRender.Request(); - this._anyDirty = true; - this._drawData.Clear(); - if (!playerRender.IsReady) - return; - RenderTarget2D target = playerRender.GetTarget(); - this._drawData.Add(new DrawData((Texture2D) target, position, new Rectangle?(), Color.White, 0.0f, target.Size() / 2f, scale, SpriteEffects.None, 0)); - this.RenderDrawData(drawPlayer); - } - - private void RenderDrawData(Player drawPlayer) - { - Effect pixelShader = Main.pixelShader; - Projectile[] projectile = Main.projectile; - SpriteBatch spriteBatch = Main.spriteBatch; - for (int index = 0; index < this._drawData.Count; ++index) - { - DrawData cdd = this._drawData[index]; - if (!cdd.sourceRect.HasValue) - cdd.sourceRect = new Rectangle?(cdd.texture.Frame()); - PlayerDrawHelper.SetShaderForData(drawPlayer, drawPlayer.cHead, ref cdd); - if (cdd.texture != null) - cdd.Draw(spriteBatch); - } - pixelShader.CurrentTechnique.Passes[0].Apply(); - } - - public bool IsReady => !this._anyDirty; - - public void PrepareRenderTarget(GraphicsDevice device, SpriteBatch spriteBatch) - { - if (!this._anyDirty) - return; - for (int index = 0; index < this._playerRenders.Length; ++index) - this._playerRenders[index].PrepareRenderTarget(device, spriteBatch); - this._anyDirty = false; - } - - private void CreateOutlines(float alpha, float scale, Color borderColor) - { - if (!(borderColor != Color.Transparent)) - return; - List drawDataList1 = new List((IEnumerable) this._drawData); - List drawDataList2 = new List((IEnumerable) this._drawData); - this._drawData.Clear(); - float num1 = 2f * scale; - Color color1 = borderColor * (alpha * alpha); - Color color2 = Color.Black * (alpha * alpha); - int colorOnlyShaderIndex = ContentSamples.CommonlyUsedContentSamples.ColorOnlyShaderIndex; - for (int index = 0; index < drawDataList2.Count; ++index) - { - DrawData drawData = drawDataList2[index]; - drawData.shader = colorOnlyShaderIndex; - drawData.color = color2; - drawDataList2[index] = drawData; - } - int num2 = 2; - for (int index1 = -num2; index1 <= num2; ++index1) - { - for (int index2 = -num2; index2 <= num2; ++index2) - { - if (Math.Abs(index1) + Math.Abs(index2) == num2) - { - Vector2 vector2 = new Vector2((float) index1 * num1, (float) index2 * num1); - for (int index3 = 0; index3 < drawDataList2.Count; ++index3) - { - DrawData drawData = drawDataList2[index3]; - drawData.position += vector2; - this._drawData.Add(drawData); - } - } - } - } - for (int index = 0; index < drawDataList2.Count; ++index) - { - DrawData drawData = drawDataList2[index]; - drawData.shader = colorOnlyShaderIndex; - drawData.color = color1; - drawDataList2[index] = drawData; - } - Vector2 vector2_1 = Vector2.Zero; - int num3 = 1; - for (int index4 = -num3; index4 <= num3; ++index4) - { - for (int index5 = -num3; index5 <= num3; ++index5) - { - if (Math.Abs(index4) + Math.Abs(index5) == num3) - { - vector2_1 = new Vector2((float) index4 * num1, (float) index5 * num1); - for (int index6 = 0; index6 < drawDataList2.Count; ++index6) - { - DrawData drawData = drawDataList2[index6]; - drawData.position += vector2_1; - this._drawData.Add(drawData); - } - } - } - } - this._drawData.AddRange((IEnumerable) drawDataList1); - } - } -} diff --git a/Graphics/Renderers/NPCHeadRenderer.cs b/Graphics/Renderers/NPCHeadRenderer.cs deleted file mode 100644 index 0916191..0000000 --- a/Graphics/Renderers/NPCHeadRenderer.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.Renderers.NPCHeadRenderer -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria.GameContent; - -namespace Terraria.Graphics.Renderers -{ - public class NPCHeadRenderer : INeedRenderTargetContent - { - private NPCHeadDrawRenderTargetContent[] _contents; - private Asset[] _matchingArray; - - public NPCHeadRenderer(Asset[] matchingArray) - { - this._matchingArray = matchingArray; - this._contents = new NPCHeadDrawRenderTargetContent[matchingArray.Length]; - } - - public void DrawWithOutlines( - Entity entity, - int headId, - Vector2 position, - Color color, - float rotation, - float scale, - SpriteEffects effects) - { - if (this._contents[headId] == null) - { - this._contents[headId] = new NPCHeadDrawRenderTargetContent(); - this._contents[headId].SetTexture(this._matchingArray[headId].Value); - } - NPCHeadDrawRenderTargetContent content = this._contents[headId]; - if (content.IsReady) - { - RenderTarget2D target = content.GetTarget(); - Main.spriteBatch.Draw((Texture2D) target, position, new Rectangle?(), color, rotation, target.Size() / 2f, scale, effects, 0.0f); - } - else - content.Request(); - } - - public bool IsReady => false; - - public void PrepareRenderTarget(GraphicsDevice device, SpriteBatch spriteBatch) - { - for (int index = 0; index < this._contents.Length; ++index) - { - if (this._contents[index] != null && !this._contents[index].IsReady) - this._contents[index].PrepareRenderTarget(device, spriteBatch); - } - } - } -} diff --git a/Graphics/Renderers/ParticlePool`1.cs b/Graphics/Renderers/ParticlePool`1.cs deleted file mode 100644 index c579276..0000000 --- a/Graphics/Renderers/ParticlePool`1.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.Renderers.ParticlePool`1 -// 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.Collections.Generic; - -namespace Terraria.Graphics.Renderers -{ - public class ParticlePool where T : IPooledParticle - { - private ParticlePool.ParticleInstantiator _instantiator; - private List _particles; - - public ParticlePool(int initialPoolSize, ParticlePool.ParticleInstantiator instantiator) - { - this._particles = new List(initialPoolSize); - this._instantiator = instantiator; - } - - public T RequestParticle() - { - int count = this._particles.Count; - for (int index = 0; index < count; ++index) - { - T particle = this._particles[index]; - if (particle.IsRestingInPool) - { - particle = this._particles[index]; - particle.FetchFromPool(); - return this._particles[index]; - } - } - T obj = this._instantiator(); - this._particles.Add(obj); - obj.FetchFromPool(); - return obj; - } - - public delegate T ParticleInstantiator() where T : IPooledParticle; - } -} diff --git a/Graphics/Renderers/ParticleRenderer.cs b/Graphics/Renderers/ParticleRenderer.cs deleted file mode 100644 index 42d7584..0000000 --- a/Graphics/Renderers/ParticleRenderer.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.Renderers.ParticleRenderer -// 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.Graphics; -using System.Collections.Generic; - -namespace Terraria.Graphics.Renderers -{ - public class ParticleRenderer - { - public ParticleRendererSettings Settings; - public List Particles = new List(); - - public ParticleRenderer() => this.Settings = new ParticleRendererSettings(); - - public void Add(IParticle particle) => this.Particles.Add(particle); - - public void Update() - { - for (int index = 0; index < this.Particles.Count; ++index) - { - if (this.Particles[index].ShouldBeRemovedFromRenderer) - { - if (this.Particles[index] is IPooledParticle particle3) - particle3.RestInPool(); - this.Particles.RemoveAt(index); - --index; - } - else - this.Particles[index].Update(ref this.Settings); - } - } - - public void Draw(SpriteBatch spriteBatch) - { - for (int index = 0; index < this.Particles.Count; ++index) - { - if (!this.Particles[index].ShouldBeRemovedFromRenderer) - this.Particles[index].Draw(ref this.Settings, spriteBatch); - } - } - } -} diff --git a/Graphics/Renderers/ParticleRendererSettings.cs b/Graphics/Renderers/ParticleRendererSettings.cs deleted file mode 100644 index 1282d1b..0000000 --- a/Graphics/Renderers/ParticleRendererSettings.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.Renderers.ParticleRendererSettings -// 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.Graphics.Renderers -{ - public struct ParticleRendererSettings - { - public Vector2 AnchorPosition; - } -} diff --git a/Graphics/Renderers/PrettySparkleParticle.cs b/Graphics/Renderers/PrettySparkleParticle.cs deleted file mode 100644 index 23c33dc..0000000 --- a/Graphics/Renderers/PrettySparkleParticle.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.Renderers.PrettySparkleParticle -// 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; -using Microsoft.Xna.Framework.Graphics; -using Terraria.GameContent; - -namespace Terraria.Graphics.Renderers -{ - public class PrettySparkleParticle : ABasicParticle - { - public Color ColorTint; - public float Opacity; - private float _timeSinceSpawn; - - public override void FetchFromPool() - { - base.FetchFromPool(); - this.ColorTint = Color.Transparent; - this._timeSinceSpawn = 0.0f; - this.Opacity = 0.0f; - } - - public override void Update(ref ParticleRendererSettings settings) - { - base.Update(ref settings); - ++this._timeSinceSpawn; - this.Opacity = Utils.GetLerpValue(0.0f, 0.05f, this._timeSinceSpawn / 60f, true) * Utils.GetLerpValue(1f, 0.9f, this._timeSinceSpawn / 60f, true); - if ((double) this._timeSinceSpawn < 60.0) - return; - this.ShouldBeRemovedFromRenderer = true; - } - - public override void Draw(ref ParticleRendererSettings settings, SpriteBatch spritebatch) - { - Color color1 = Color.White * this.Opacity * 0.9f; - color1.A /= (byte) 2; - Texture2D texture2D = TextureAssets.Extra[98].Value; - Color color2 = this.ColorTint * this.Opacity * 0.5f; - color2.A = (byte) 0; - Vector2 origin = texture2D.Size() / 2f; - Color color3 = color1 * 0.5f; - float num = Utils.GetLerpValue(0.0f, 20f, this._timeSinceSpawn, true) * Utils.GetLerpValue(45f, 30f, this._timeSinceSpawn, true); - Vector2 scale1 = new Vector2(0.3f, 2f) * num * this.Scale; - Vector2 scale2 = new Vector2(0.3f, 1f) * num * this.Scale; - Color color4 = color2 * num; - Color color5 = color3 * num; - Vector2 position = settings.AnchorPosition + this.LocalPosition; - SpriteEffects effects = SpriteEffects.None; - spritebatch.Draw(texture2D, position, new Rectangle?(), color4, 1.570796f + this.Rotation, origin, scale1, effects, 0.0f); - spritebatch.Draw(texture2D, position, new Rectangle?(), color4, 0.0f + this.Rotation, origin, scale2, effects, 0.0f); - spritebatch.Draw(texture2D, position, new Rectangle?(), color5, 1.570796f + this.Rotation, origin, scale1 * 0.6f, effects, 0.0f); - spritebatch.Draw(texture2D, position, new Rectangle?(), color5, 0.0f + this.Rotation, origin, scale2 * 0.6f, effects, 0.0f); - } - } -} diff --git a/Graphics/Renderers/RandomizedFrameParticle.cs b/Graphics/Renderers/RandomizedFrameParticle.cs deleted file mode 100644 index 877627d..0000000 --- a/Graphics/Renderers/RandomizedFrameParticle.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.Renderers.RandomizedFrameParticle -// 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; -using Microsoft.Xna.Framework.Graphics; - -namespace Terraria.Graphics.Renderers -{ - public class RandomizedFrameParticle : ABasicParticle - { - public float FadeInNormalizedTime; - public float FadeOutNormalizedTime = 1f; - public Color ColorTint = Color.White; - public int AnimationFramesAmount; - public int GameFramesPerAnimationFrame; - private float _timeTolive; - private float _timeSinceSpawn; - private int _gameFramesCounted; - - public override void FetchFromPool() - { - base.FetchFromPool(); - this.FadeInNormalizedTime = 0.0f; - this.FadeOutNormalizedTime = 1f; - this.ColorTint = Color.White; - this.AnimationFramesAmount = 0; - this.GameFramesPerAnimationFrame = 0; - this._timeTolive = 0.0f; - this._timeSinceSpawn = 0.0f; - this._gameFramesCounted = 0; - } - - public void SetTypeInfo( - int animationFramesAmount, - int gameFramesPerAnimationFrame, - float timeToLive) - { - this._timeTolive = timeToLive; - this.GameFramesPerAnimationFrame = gameFramesPerAnimationFrame; - this.AnimationFramesAmount = animationFramesAmount; - this.RandomizeFrame(); - } - - private void RandomizeFrame() - { - this._frame = this._texture.Frame(verticalFrames: this.AnimationFramesAmount, frameY: Main.rand.Next(this.AnimationFramesAmount)); - this._origin = this._frame.Size() / 2f; - } - - public override void Update(ref ParticleRendererSettings settings) - { - base.Update(ref settings); - ++this._timeSinceSpawn; - if ((double) this._timeSinceSpawn >= (double) this._timeTolive) - this.ShouldBeRemovedFromRenderer = true; - if (++this._gameFramesCounted < this.GameFramesPerAnimationFrame) - return; - this._gameFramesCounted = 0; - this.RandomizeFrame(); - } - - public override void Draw(ref ParticleRendererSettings settings, SpriteBatch spritebatch) - { - Color color = this.ColorTint * Utils.GetLerpValue(0.0f, this.FadeInNormalizedTime, this._timeSinceSpawn / this._timeTolive, true) * Utils.GetLerpValue(1f, this.FadeOutNormalizedTime, this._timeSinceSpawn / this._timeTolive, true); - spritebatch.Draw(this._texture.Value, settings.AnchorPosition + this.LocalPosition, new Rectangle?(this._frame), color, this.Rotation, this._origin, this.Scale, SpriteEffects.None, 0.0f); - } - } -} diff --git a/Graphics/Renderers/ReturnGatePlayerRenderer.cs b/Graphics/Renderers/ReturnGatePlayerRenderer.cs deleted file mode 100644 index 1bd6a8f..0000000 --- a/Graphics/Renderers/ReturnGatePlayerRenderer.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.Renderers.ReturnGatePlayerRenderer -// 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; -using Microsoft.Xna.Framework.Graphics; -using System.Collections.Generic; -using Terraria.DataStructures; -using Terraria.GameContent; -using Terraria.GameContent.ObjectInteractions; - -namespace Terraria.Graphics.Renderers -{ - internal class ReturnGatePlayerRenderer : IPlayerRenderer - { - private List _voidLensData = new List(); - private PotionOfReturnGateInteractionChecker _interactionChecker = new PotionOfReturnGateInteractionChecker(); - - public void DrawPlayers(Camera camera, IEnumerable players) - { - foreach (Player player in players) - this.DrawReturnGateInWorld(camera, player); - } - - public void DrawPlayerHead( - Camera camera, - Player drawPlayer, - Vector2 position, - float alpha = 1f, - float scale = 1f, - Color borderColor = default (Color)) - { - this.DrawReturnGateInMap(camera, drawPlayer); - } - - public void DrawPlayer( - Camera camera, - Player drawPlayer, - Vector2 position, - float rotation, - Vector2 rotationOrigin, - float shadow = 0.0f, - float scale = 1f) - { - this.DrawReturnGateInWorld(camera, drawPlayer); - } - - private void DrawReturnGateInMap(Camera camera, Player player) - { - } - - private void DrawReturnGateInWorld(Camera camera, Player player) - { - Rectangle homeHitbox = Rectangle.Empty; - if (!PotionOfReturnHelper.TryGetGateHitbox(player, out homeHitbox)) - return; - if (player == Main.LocalPlayer) - { - int num = (int) this._interactionChecker.AttemptInteraction(player, homeHitbox); - } - int selectionMode = 0; - if (!player.PotionOfReturnOriginalUsePosition.HasValue) - return; - SpriteBatch spriteBatch = camera.SpriteBatch; - SamplerState sampler = camera.Sampler; - spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, sampler, DepthStencilState.None, camera.Rasterizer, (Effect) null, camera.GameViewMatrix.TransformationMatrix); - float opacity = player.whoAmI == Main.myPlayer ? 1f : 0.1f; - Vector2 worldPosition = player.PotionOfReturnOriginalUsePosition.Value + new Vector2(0.0f, (float) (-player.height / 2)); - Vector2 vector2 = homeHitbox.Center.ToVector2(); - PotionOfReturnGateHelper returnGateHelper1 = new PotionOfReturnGateHelper(PotionOfReturnGateHelper.GateType.ExitPoint, worldPosition, opacity); - PotionOfReturnGateHelper returnGateHelper2 = new PotionOfReturnGateHelper(PotionOfReturnGateHelper.GateType.EntryPoint, vector2, opacity); - if (!Main.gamePaused) - { - returnGateHelper1.Update(); - returnGateHelper2.Update(); - } - this._voidLensData.Clear(); - returnGateHelper1.DrawToDrawData(this._voidLensData, 0); - returnGateHelper2.DrawToDrawData(this._voidLensData, selectionMode); - foreach (DrawData drawData in this._voidLensData) - drawData.Draw(spriteBatch); - spriteBatch.End(); - } - } -} diff --git a/Graphics/Shaders/ArmorShaderData.cs b/Graphics/Shaders/ArmorShaderData.cs index 457e9b3..8bb4d51 100644 --- a/Graphics/Shaders/ArmorShaderData.cs +++ b/Graphics/Shaders/ArmorShaderData.cs @@ -1,12 +1,11 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.Shaders.ArmorShaderData -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using System; using Terraria.DataStructures; @@ -18,8 +17,7 @@ namespace Terraria.Graphics.Shaders private Vector3 _uSecondaryColor = Vector3.One; private float _uSaturation = 1f; private float _uOpacity = 1f; - private Asset _uImage; - private Vector2 _uTargetPosition = Vector2.One; + private Ref _uImage; public ArmorShaderData(Ref shader, string passName) : base(shader, passName) @@ -31,41 +29,29 @@ namespace Terraria.Graphics.Shaders this.Shader.Parameters["uColor"].SetValue(this._uColor); this.Shader.Parameters["uSaturation"].SetValue(this._uSaturation); this.Shader.Parameters["uSecondaryColor"].SetValue(this._uSecondaryColor); - this.Shader.Parameters["uTime"].SetValue(Main.GlobalTimeWrappedHourly); + this.Shader.Parameters["uTime"].SetValue(Main.GlobalTime); this.Shader.Parameters["uOpacity"].SetValue(this._uOpacity); - this.Shader.Parameters["uTargetPosition"].SetValue(this._uTargetPosition); if (drawData.HasValue) { DrawData drawData1 = drawData.Value; - Vector4 vector4 = !drawData1.sourceRect.HasValue ? new Vector4(0.0f, 0.0f, (float) drawData1.texture.Width, (float) drawData1.texture.Height) : new Vector4((float) drawData1.sourceRect.Value.X, (float) drawData1.sourceRect.Value.Y, (float) drawData1.sourceRect.Value.Width, (float) drawData1.sourceRect.Value.Height); - this.Shader.Parameters["uSourceRect"].SetValue(vector4); - this.Shader.Parameters["uLegacyArmorSourceRect"].SetValue(vector4); + this.Shader.Parameters["uSourceRect"].SetValue(!drawData1.sourceRect.HasValue ? new Vector4(0.0f, 0.0f, (float) drawData1.texture.Width, (float) drawData1.texture.Height) : new Vector4((float) drawData1.sourceRect.Value.X, (float) drawData1.sourceRect.Value.Y, (float) drawData1.sourceRect.Value.Width, (float) drawData1.sourceRect.Value.Height)); this.Shader.Parameters["uWorldPosition"].SetValue(Main.screenPosition + drawData1.position); this.Shader.Parameters["uImageSize0"].SetValue(new Vector2((float) drawData1.texture.Width, (float) drawData1.texture.Height)); - this.Shader.Parameters["uLegacyArmorSheetSize"].SetValue(new Vector2((float) drawData1.texture.Width, (float) drawData1.texture.Height)); this.Shader.Parameters["uRotation"].SetValue(drawData1.rotation * (drawData1.effect.HasFlag((Enum) SpriteEffects.FlipHorizontally) ? -1f : 1f)); this.Shader.Parameters["uDirection"].SetValue(drawData1.effect.HasFlag((Enum) SpriteEffects.FlipHorizontally) ? -1 : 1); } else { - Vector4 vector4 = new Vector4(0.0f, 0.0f, 4f, 4f); - this.Shader.Parameters["uSourceRect"].SetValue(vector4); - this.Shader.Parameters["uLegacyArmorSourceRect"].SetValue(vector4); + this.Shader.Parameters["uSourceRect"].SetValue(new Vector4(0.0f, 0.0f, 4f, 4f)); this.Shader.Parameters["uRotation"].SetValue(0.0f); } if (this._uImage != null) { Main.graphics.GraphicsDevice.Textures[1] = (Texture) this._uImage.Value; - this.Shader.Parameters["uImageSize1"].SetValue(new Vector2((float) this._uImage.Width(), (float) this._uImage.Height())); + this.Shader.Parameters["uImageSize1"].SetValue(new Vector2((float) this._uImage.Value.Width, (float) this._uImage.Value.Height)); } if (entity != null) this.Shader.Parameters["uDirection"].SetValue((float) entity.direction); - if (entity is Player player) - { - Rectangle bodyFrame = player.bodyFrame; - this.Shader.Parameters["uLegacyArmorSourceRect"].SetValue(new Vector4((float) bodyFrame.X, (float) bodyFrame.Y, (float) bodyFrame.Width, (float) bodyFrame.Height)); - this.Shader.Parameters["uLegacyArmorSheetSize"].SetValue(new Vector2(40f, 1120f)); - } this.Apply(); } @@ -81,7 +67,7 @@ namespace Terraria.Graphics.Shaders public ArmorShaderData UseImage(string path) { - this._uImage = Main.Assets.Request(path, (AssetRequestMode) 1); + this._uImage = TextureManager.AsyncLoad(path); return this; } @@ -91,12 +77,6 @@ namespace Terraria.Graphics.Shaders return this; } - public ArmorShaderData UseTargetPosition(Vector2 position) - { - this._uTargetPosition = position; - return this; - } - public ArmorShaderData UseSecondaryColor(float r, float g, float b) => this.UseSecondaryColor(new Vector3(r, g, b)); public ArmorShaderData UseSecondaryColor(Color color) => this.UseSecondaryColor(color.ToVector3()); diff --git a/Graphics/Shaders/ArmorShaderDataSet.cs b/Graphics/Shaders/ArmorShaderDataSet.cs index 525b46c..fedea1c 100644 --- a/Graphics/Shaders/ArmorShaderDataSet.cs +++ b/Graphics/Shaders/ArmorShaderDataSet.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.Shaders.ArmorShaderDataSet -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System.Collections.Generic; @@ -24,7 +24,7 @@ namespace Terraria.Graphics.Shaders public void Apply(int shaderId, Entity entity, DrawData? drawData = null) { - if (shaderId >= 1 && shaderId <= this._shaderDataCount) + if (shaderId != 0 && shaderId <= this._shaderDataCount) this._shaderData[shaderId - 1].Apply(entity, drawData); else Main.pixelShader.CurrentTechnique.Passes[0].Apply(); @@ -32,7 +32,7 @@ namespace Terraria.Graphics.Shaders public void ApplySecondary(int shaderId, Entity entity, DrawData? drawData = null) { - if (shaderId >= 1 && shaderId <= this._shaderDataCount) + if (shaderId != 0 && shaderId <= this._shaderDataCount) this._shaderData[shaderId - 1].GetSecondaryShader(entity).Apply(entity, drawData); else Main.pixelShader.CurrentTechnique.Passes[0].Apply(); diff --git a/Graphics/Shaders/GameShaders.cs b/Graphics/Shaders/GameShaders.cs index 59976c7..1fc168e 100644 --- a/Graphics/Shaders/GameShaders.cs +++ b/Graphics/Shaders/GameShaders.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.Shaders.GameShaders -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System.Collections.Generic; diff --git a/Graphics/Shaders/HairShaderData.cs b/Graphics/Shaders/HairShaderData.cs index f52af00..4d134d3 100644 --- a/Graphics/Shaders/HairShaderData.cs +++ b/Graphics/Shaders/HairShaderData.cs @@ -1,12 +1,11 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.Shaders.HairShaderData -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using Terraria.DataStructures; namespace Terraria.Graphics.Shaders @@ -17,9 +16,8 @@ namespace Terraria.Graphics.Shaders protected Vector3 _uSecondaryColor = Vector3.One; protected float _uSaturation = 1f; protected float _uOpacity = 1f; - protected Asset _uImage; + protected Ref _uImage; protected bool _shaderDisabled; - private Vector2 _uTargetPosition = Vector2.One; public bool ShaderDisabled => this._shaderDisabled; @@ -35,9 +33,8 @@ namespace Terraria.Graphics.Shaders this.Shader.Parameters["uColor"].SetValue(this._uColor); this.Shader.Parameters["uSaturation"].SetValue(this._uSaturation); this.Shader.Parameters["uSecondaryColor"].SetValue(this._uSecondaryColor); - this.Shader.Parameters["uTime"].SetValue(Main.GlobalTimeWrappedHourly); + this.Shader.Parameters["uTime"].SetValue(Main.GlobalTime); this.Shader.Parameters["uOpacity"].SetValue(this._uOpacity); - this.Shader.Parameters["uTargetPosition"].SetValue(this._uTargetPosition); if (drawData.HasValue) { DrawData drawData1 = drawData.Value; @@ -50,7 +47,7 @@ namespace Terraria.Graphics.Shaders if (this._uImage != null) { Main.graphics.GraphicsDevice.Textures[1] = (Texture) this._uImage.Value; - this.Shader.Parameters["uImageSize1"].SetValue(new Vector2((float) this._uImage.Width(), (float) this._uImage.Height())); + this.Shader.Parameters["uImageSize1"].SetValue(new Vector2((float) this._uImage.Value.Width, (float) this._uImage.Value.Height)); } if (player != null) this.Shader.Parameters["uDirection"].SetValue((float) player.direction); @@ -71,7 +68,7 @@ namespace Terraria.Graphics.Shaders public HairShaderData UseImage(string path) { - this._uImage = Main.Assets.Request(path, (AssetRequestMode) 1); + this._uImage = TextureManager.AsyncLoad(path); return this; } @@ -96,11 +93,5 @@ namespace Terraria.Graphics.Shaders this._uSaturation = saturation; return this; } - - public HairShaderData UseTargetPosition(Vector2 position) - { - this._uTargetPosition = position; - return this; - } } } diff --git a/Graphics/Shaders/HairShaderDataSet.cs b/Graphics/Shaders/HairShaderDataSet.cs index 0095c47..844b89b 100644 --- a/Graphics/Shaders/HairShaderDataSet.cs +++ b/Graphics/Shaders/HairShaderDataSet.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.Shaders.HairShaderDataSet -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/Graphics/Shaders/MiscShaderData.cs b/Graphics/Shaders/MiscShaderData.cs index e4d8367..eff7b18 100644 --- a/Graphics/Shaders/MiscShaderData.cs +++ b/Graphics/Shaders/MiscShaderData.cs @@ -1,12 +1,11 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.Shaders.MiscShaderData -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using Terraria.DataStructures; namespace Terraria.Graphics.Shaders @@ -17,11 +16,7 @@ namespace Terraria.Graphics.Shaders private Vector3 _uSecondaryColor = Vector3.One; private float _uSaturation = 1f; private float _uOpacity = 1f; - private Asset _uImage0; - private Asset _uImage1; - private Asset _uImage2; - private bool _useProjectionMatrix; - private Vector4 _shaderSpecificData = Vector4.Zero; + private Ref _uImage; public MiscShaderData(Ref shader, string passName) : base(shader, passName) @@ -33,9 +28,8 @@ namespace Terraria.Graphics.Shaders this.Shader.Parameters["uColor"].SetValue(this._uColor); this.Shader.Parameters["uSaturation"].SetValue(this._uSaturation); this.Shader.Parameters["uSecondaryColor"].SetValue(this._uSecondaryColor); - this.Shader.Parameters["uTime"].SetValue(Main.GlobalTimeWrappedHourly); + this.Shader.Parameters["uTime"].SetValue(Main.GlobalTime); this.Shader.Parameters["uOpacity"].SetValue(this._uOpacity); - this.Shader.Parameters["uShaderSpecificData"].SetValue(this._shaderSpecificData); if (drawData.HasValue) { DrawData drawData1 = drawData.Value; @@ -48,26 +42,11 @@ namespace Terraria.Graphics.Shaders } else this.Shader.Parameters["uSourceRect"].SetValue(new Vector4(0.0f, 0.0f, 4f, 4f)); - if (this._uImage0 != null) + if (this._uImage != null) { - Main.graphics.GraphicsDevice.Textures[0] = (Texture) this._uImage0.Value; - Main.graphics.GraphicsDevice.SamplerStates[0] = SamplerState.LinearWrap; - this.Shader.Parameters["uImageSize0"].SetValue(new Vector2((float) this._uImage0.Width(), (float) this._uImage0.Height())); + Main.graphics.GraphicsDevice.Textures[1] = (Texture) this._uImage.Value; + this.Shader.Parameters["uImageSize1"].SetValue(new Vector2((float) this._uImage.Value.Width, (float) this._uImage.Value.Height)); } - if (this._uImage1 != null) - { - Main.graphics.GraphicsDevice.Textures[1] = (Texture) this._uImage1.Value; - Main.graphics.GraphicsDevice.SamplerStates[1] = SamplerState.LinearWrap; - this.Shader.Parameters["uImageSize1"].SetValue(new Vector2((float) this._uImage1.Width(), (float) this._uImage1.Height())); - } - if (this._uImage2 != null) - { - Main.graphics.GraphicsDevice.Textures[2] = (Texture) this._uImage2.Value; - Main.graphics.GraphicsDevice.SamplerStates[2] = SamplerState.LinearWrap; - this.Shader.Parameters["uImageSize2"].SetValue(new Vector2((float) this._uImage2.Width(), (float) this._uImage2.Height())); - } - if (this._useProjectionMatrix) - this.Shader.Parameters["uMatrixTransform0"].SetValue(Main.GameViewMatrix.NormalizedTransformationmatrix); this.Apply(); } @@ -81,21 +60,9 @@ namespace Terraria.Graphics.Shaders return this; } - public MiscShaderData UseImage0(string path) + public MiscShaderData UseImage(string path) { - this._uImage0 = Main.Assets.Request(path, (AssetRequestMode) 1); - return this; - } - - public MiscShaderData UseImage1(string path) - { - this._uImage1 = Main.Assets.Request(path, (AssetRequestMode) 1); - return this; - } - - public MiscShaderData UseImage2(string path) - { - this._uImage2 = Main.Assets.Request(path, (AssetRequestMode) 1); + this._uImage = TextureManager.AsyncLoad(path); return this; } @@ -115,12 +82,6 @@ namespace Terraria.Graphics.Shaders return this; } - public MiscShaderData UseProjectionMatrix(bool doUse) - { - this._useProjectionMatrix = doUse; - return this; - } - public MiscShaderData UseSaturation(float saturation) { this._uSaturation = saturation; @@ -128,11 +89,5 @@ namespace Terraria.Graphics.Shaders } public virtual MiscShaderData GetSecondaryShader(Entity entity) => this; - - public MiscShaderData UseShaderSpecificData(Vector4 specificData) - { - this._shaderSpecificData = specificData; - return this; - } } } diff --git a/Graphics/Shaders/ScreenShaderData.cs b/Graphics/Shaders/ScreenShaderData.cs index a891955..7f4f1c0 100644 --- a/Graphics/Shaders/ScreenShaderData.cs +++ b/Graphics/Shaders/ScreenShaderData.cs @@ -1,12 +1,11 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.Shaders.ScreenShaderData -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; namespace Terraria.Graphics.Shaders { @@ -21,8 +20,7 @@ namespace Terraria.Graphics.Shaders private Vector2 _uDirection = new Vector2(0.0f, 1f); private float _uProgress; private Vector2 _uImageOffset = Vector2.Zero; - private Asset[] _uAssetImages = new Asset[3]; - private Texture2D[] _uCustomImages = new Texture2D[3]; + private Ref[] _uImages = new Ref[3]; private SamplerState[] _samplerStates = new SamplerState[3]; private Vector2[] _imageScales = new Vector2[3] { @@ -49,7 +47,7 @@ namespace Terraria.Graphics.Shaders { } - public override void Apply() + public new virtual void Apply() { Vector2 vector2_1 = new Vector2((float) Main.offScreenRange, (float) Main.offScreenRange); Vector2 vector2_2 = new Vector2((float) Main.screenWidth, (float) Main.screenHeight) / Main.GameViewMatrix.Zoom; @@ -58,7 +56,7 @@ namespace Terraria.Graphics.Shaders this.Shader.Parameters["uColor"].SetValue(this._uColor); this.Shader.Parameters["uOpacity"].SetValue(this.CombinedOpacity); this.Shader.Parameters["uSecondaryColor"].SetValue(this._uSecondaryColor); - this.Shader.Parameters["uTime"].SetValue(Main.GlobalTimeWrappedHourly); + this.Shader.Parameters["uTime"].SetValue(Main.GlobalTime); this.Shader.Parameters["uScreenResolution"].SetValue(vector2_2); this.Shader.Parameters["uScreenPosition"].SetValue(vector2_4 - vector2_1); this.Shader.Parameters["uTargetPosition"].SetValue(this._uTargetPosition - vector2_1); @@ -67,16 +65,13 @@ namespace Terraria.Graphics.Shaders this.Shader.Parameters["uProgress"].SetValue(this._uProgress); this.Shader.Parameters["uDirection"].SetValue(this._uDirection); this.Shader.Parameters["uZoom"].SetValue(Main.GameViewMatrix.Zoom); - for (int index = 0; index < this._uAssetImages.Length; ++index) + for (int index = 0; index < this._uImages.Length; ++index) { - Texture2D uCustomImage = this._uCustomImages[index]; - if (this._uAssetImages[index] != null && this._uAssetImages[index].IsLoaded) - uCustomImage = this._uAssetImages[index].Value; - if (uCustomImage != null) + if (this._uImages[index] != null && this._uImages[index].Value != null) { - Main.graphics.GraphicsDevice.Textures[index + 1] = (Texture) uCustomImage; - int width = uCustomImage.Width; - int height = uCustomImage.Height; + Main.graphics.GraphicsDevice.Textures[index + 1] = (Texture) this._uImages[index].Value; + int width = this._uImages[index].Value.Width; + int height = this._uImages[index].Value.Height; Main.graphics.GraphicsDevice.SamplerStates[index + 1] = this._samplerStates[index] == null ? (!Utils.IsPowerOfTwo(width) || !Utils.IsPowerOfTwo(height) ? SamplerState.AnisotropicClamp : SamplerState.LinearWrap) : this._samplerStates[index]; this.Shader.Parameters["uImageSize" + (object) (index + 1)].SetValue(new Vector2((float) width, (float) height) * this._imageScales[index]); } @@ -110,8 +105,10 @@ namespace Terraria.Graphics.Shaders SamplerState samplerState = null) { this._samplerStates[index] = samplerState; - this._uAssetImages[index] = (Asset) null; - this._uCustomImages[index] = image; + if (this._uImages[index] == null) + this._uImages[index] = new Ref(image); + else + this._uImages[index].Value = image; return this; } @@ -120,8 +117,7 @@ namespace Terraria.Graphics.Shaders int index = 0, SamplerState samplerState = null) { - this._uAssetImages[index] = Main.Assets.Request(path, (AssetRequestMode) 1); - this._uCustomImages[index] = (Texture2D) null; + this._uImages[index] = TextureManager.AsyncLoad(path); this._samplerStates[index] = samplerState; return this; } diff --git a/Graphics/Shaders/ShaderData.cs b/Graphics/Shaders/ShaderData.cs index e8d2223..4655d73 100644 --- a/Graphics/Shaders/ShaderData.cs +++ b/Graphics/Shaders/ShaderData.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.Shaders.ShaderData -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework.Graphics; @@ -10,9 +10,10 @@ namespace Terraria.Graphics.Shaders { public class ShaderData { - private readonly Ref _shader; - private string _passName; + protected Ref _shader; + protected string _passName; private EffectPass _effectPass; + private Effect _lastEffect; public Effect Shader => this._shader != null ? this._shader.Value : (Effect) null; @@ -30,9 +31,9 @@ namespace Terraria.Graphics.Shaders this._effectPass = this.Shader.CurrentTechnique.Passes[passName]; } - public virtual void Apply() + protected virtual void Apply() { - if (this._shader != null && this.Shader != null && this._passName != null) + if (this._shader != null && this._lastEffect != this._shader.Value && this.Shader != null && this._passName != null) this._effectPass = this.Shader.CurrentTechnique.Passes[this._passName]; this._effectPass.Apply(); } diff --git a/Graphics/SpriteRenderTargetHelper.cs b/Graphics/SpriteRenderTargetHelper.cs deleted file mode 100644 index cb0508d..0000000 --- a/Graphics/SpriteRenderTargetHelper.cs +++ /dev/null @@ -1,79 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.SpriteRenderTargetHelper -// 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; -using System.Collections.Generic; -using System.Runtime.InteropServices; -using Terraria.DataStructures; - -namespace Terraria.Graphics -{ - [StructLayout(LayoutKind.Sequential, Size = 1)] - public struct SpriteRenderTargetHelper - { - public static void GetDrawBoundary( - List playerDrawData, - out Vector2 lowest, - out Vector2 highest) - { - lowest = Vector2.Zero; - highest = Vector2.Zero; - for (int index = 0; index <= playerDrawData.Count; ++index) - { - if (index != playerDrawData.Count) - { - DrawData cdd = playerDrawData[index]; - if (index == 0) - { - lowest = cdd.position; - highest = cdd.position; - } - SpriteRenderTargetHelper.GetHighsAndLowsOf(ref lowest, ref highest, ref cdd); - } - } - } - - public static void GetHighsAndLowsOf(ref Vector2 lowest, ref Vector2 highest, ref DrawData cdd) - { - Vector2 origin = cdd.origin; - Rectangle rectangle = cdd.destinationRectangle; - if (cdd.sourceRect.HasValue) - rectangle = cdd.sourceRect.Value; - if (!cdd.sourceRect.HasValue) - rectangle = cdd.texture.Frame(); - rectangle.X = 0; - rectangle.Y = 0; - Vector2 position = cdd.position; - SpriteRenderTargetHelper.GetHighsAndLowsOf(ref lowest, ref highest, ref cdd, ref position, ref origin, new Vector2(0.0f, 0.0f)); - SpriteRenderTargetHelper.GetHighsAndLowsOf(ref lowest, ref highest, ref cdd, ref position, ref origin, new Vector2((float) rectangle.Width, 0.0f)); - SpriteRenderTargetHelper.GetHighsAndLowsOf(ref lowest, ref highest, ref cdd, ref position, ref origin, new Vector2(0.0f, (float) rectangle.Height)); - SpriteRenderTargetHelper.GetHighsAndLowsOf(ref lowest, ref highest, ref cdd, ref position, ref origin, new Vector2((float) rectangle.Width, (float) rectangle.Height)); - } - - public static void GetHighsAndLowsOf( - ref Vector2 lowest, - ref Vector2 highest, - ref DrawData cdd, - ref Vector2 pos, - ref Vector2 origin, - Vector2 corner) - { - Vector2 corner1 = SpriteRenderTargetHelper.GetCorner(ref cdd, ref pos, ref origin, corner); - lowest = Vector2.Min(lowest, corner1); - highest = Vector2.Max(highest, corner1); - } - - public static Vector2 GetCorner( - ref DrawData cdd, - ref Vector2 pos, - ref Vector2 origin, - Vector2 corner) - { - Vector2 spinningpoint = corner - origin; - return pos + spinningpoint.RotatedBy((double) cdd.rotation) * cdd.scale; - } - } -} diff --git a/Graphics/SpriteViewMatrix.cs b/Graphics/SpriteViewMatrix.cs index fe3613f..6b02571 100644 --- a/Graphics/SpriteViewMatrix.cs +++ b/Graphics/SpriteViewMatrix.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.SpriteViewMatrix -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -16,7 +16,6 @@ namespace Terraria.Graphics private Vector2 _translation = Vector2.Zero; private Matrix _zoomMatrix = Matrix.Identity; private Matrix _transformationMatrix = Matrix.Identity; - private Matrix _normalizedTransformationMatrix = Matrix.Identity; private SpriteEffects _effects; private Matrix _effectMatrix; private GraphicsDevice _graphicsDevice; @@ -66,16 +65,6 @@ namespace Terraria.Graphics } } - public Matrix NormalizedTransformationmatrix - { - get - { - if (this.ShouldRebuild()) - this.Rebuild(); - return this._normalizedTransformationMatrix; - } - } - public SpriteEffects Effects { get => this._effects; @@ -112,12 +101,10 @@ namespace Terraria.Graphics identity *= Matrix.CreateScale(1f, -1f, 1f) * Matrix.CreateTranslation(0.0f, vector2_1.Y, 0.0f); Vector2 vector2_2 = vector2_1 * 0.5f; Vector2 vector2_3 = vector2_2 - vector2_2 / this._zoom; - Matrix orthographicOffCenter = Matrix.CreateOrthographicOffCenter(0.0f, vector2_1.X, vector2_1.Y, 0.0f, 0.0f, 1f); this._translation = vector2_3; this._zoomMatrix = Matrix.CreateTranslation(-vector2_3.X, -vector2_3.Y, 0.0f) * Matrix.CreateScale(this._zoom.X, this._zoom.Y, 1f); this._effectMatrix = identity; this._transformationMatrix = identity * this._zoomMatrix; - this._normalizedTransformationMatrix = Matrix.Invert(identity) * this._zoomMatrix * orthographicOffCenter; this._needsRebuild = false; } diff --git a/Graphics/TextureManager.cs b/Graphics/TextureManager.cs new file mode 100644 index 0000000..933dcd8 --- /dev/null +++ b/Graphics/TextureManager.cs @@ -0,0 +1,87 @@ +// Decompiled with JetBrains decompiler +// Type: Terraria.Graphics.TextureManager +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 +// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe + +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Collections.Concurrent; +using System.Threading; + +namespace Terraria.Graphics +{ + public static class TextureManager + { + private static ConcurrentDictionary _textures = new ConcurrentDictionary(); + private static ConcurrentQueue _loadQueue = new ConcurrentQueue(); + private static Thread _loadThread; + private static readonly object _loadThreadLock = new object(); + public static Texture2D BlankTexture; + + public static void Initialize() => TextureManager.BlankTexture = new Texture2D(Main.graphics.GraphicsDevice, 4, 4); + + public static Texture2D Load(string name) + { + if (TextureManager._textures.ContainsKey(name)) + return TextureManager._textures[name]; + Texture2D texture2D = TextureManager.BlankTexture; + if (name != "") + { + if (name != null) + { + try + { + texture2D = Main.instance.OurLoad(name); + } + catch (Exception ex) + { + texture2D = TextureManager.BlankTexture; + } + } + } + TextureManager._textures[name] = texture2D; + return texture2D; + } + + public static Ref AsyncLoad(string name) => new Ref(TextureManager.Load(name)); + + private static void Run(object context) + { + bool looping = true; + Main.instance.Exiting += (EventHandler) ((obj, args) => + { + looping = false; + if (!Monitor.TryEnter(TextureManager._loadThreadLock)) + return; + Monitor.Pulse(TextureManager._loadThreadLock); + Monitor.Exit(TextureManager._loadThreadLock); + }); + Monitor.Enter(TextureManager._loadThreadLock); + while (looping) + { + if (TextureManager._loadQueue.Count != 0) + { + TextureManager.LoadPair result; + if (TextureManager._loadQueue.TryDequeue(out result)) + result.TextureRef.Value = TextureManager.Load(result.Path); + } + else + Monitor.Wait(TextureManager._loadThreadLock); + } + Monitor.Exit(TextureManager._loadThreadLock); + } + + private struct LoadPair + { + public string Path; + public Ref TextureRef; + + public LoadPair(string path, Ref textureRef) + { + this.Path = path; + this.TextureRef = textureRef; + } + } + } +} diff --git a/Graphics/TileBatch.cs b/Graphics/TileBatch.cs index 224aa68..cb1f8cf 100644 --- a/Graphics/TileBatch.cs +++ b/Graphics/TileBatch.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.TileBatch -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -52,7 +52,7 @@ namespace Terraria.Graphics { this._vertexBuffer = new DynamicVertexBuffer(this._graphicsDevice, typeof (VertexPositionColorTexture), 8192, BufferUsage.WriteOnly); this._vertexBufferPosition = 0; - this._vertexBuffer.ContentLost += (EventHandler) ((_param1, _param2) => this._vertexBufferPosition = 0); + this._vertexBuffer.ContentLost += (EventHandler) ((sender, e) => this._vertexBufferPosition = 0); } if (this._indexBuffer != null && !this._indexBuffer.IsDisposed) return; @@ -71,7 +71,7 @@ namespace Terraria.Graphics } this._indexBuffer = new DynamicIndexBuffer(this._graphicsDevice, typeof (short), 12288, BufferUsage.WriteOnly); this._indexBuffer.SetData(this._fallbackIndexData); - this._indexBuffer.ContentLost += (EventHandler) ((_param1, _param2) => this._indexBuffer.SetData(this._fallbackIndexData)); + this._indexBuffer.ContentLost += (EventHandler) ((sender, e) => this._indexBuffer.SetData(this._fallbackIndexData)); } private void FlushRenderState() diff --git a/Graphics/VertexColors.cs b/Graphics/VertexColors.cs index d82eca6..f127eeb 100644 --- a/Graphics/VertexColors.cs +++ b/Graphics/VertexColors.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Graphics.VertexColors -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/Graphics/VertexStrip.cs b/Graphics/VertexStrip.cs deleted file mode 100644 index 30c97d3..0000000 --- a/Graphics/VertexStrip.cs +++ /dev/null @@ -1,194 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.VertexStrip -// 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; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; - -namespace Terraria.Graphics -{ - public class VertexStrip - { - private VertexStrip.CustomVertexInfo[] _vertices = new VertexStrip.CustomVertexInfo[1]; - private int _vertexAmountCurrentlyMaintained; - private short[] _indices = new short[1]; - private int _indicesAmountCurrentlyMaintained; - private List _temporaryPositionsCache = new List(); - private List _temporaryRotationsCache = new List(); - - public void PrepareStrip( - Vector2[] positions, - float[] rotations, - VertexStrip.StripColorFunction colorFunction, - VertexStrip.StripHalfWidthFunction widthFunction, - Vector2 offsetForAllPositions = default (Vector2), - int? expectedVertexPairsAmount = null, - bool includeBacksides = false) - { - int vertexPaidsAdded = positions.Length; - int newSize = vertexPaidsAdded * 2; - this._vertexAmountCurrentlyMaintained = newSize; - if (this._vertices.Length < newSize) - Array.Resize(ref this._vertices, newSize); - int num = vertexPaidsAdded; - if (expectedVertexPairsAmount.HasValue) - num = expectedVertexPairsAmount.Value; - for (int index = 0; index < vertexPaidsAdded; ++index) - { - if (positions[index] == Vector2.Zero) - { - vertexPaidsAdded = index - 1; - this._vertexAmountCurrentlyMaintained = vertexPaidsAdded * 2; - break; - } - Vector2 pos = positions[index] + offsetForAllPositions; - float rot = MathHelper.WrapAngle(rotations[index]); - int indexOnVertexArray = index * 2; - float progressOnStrip = (float) index / (float) (num - 1); - this.AddVertex(colorFunction, widthFunction, pos, rot, indexOnVertexArray, progressOnStrip); - } - this.PrepareIndices(vertexPaidsAdded, includeBacksides); - } - - public void PrepareStripWithProceduralPadding( - Vector2[] positions, - float[] rotations, - VertexStrip.StripColorFunction colorFunction, - VertexStrip.StripHalfWidthFunction widthFunction, - Vector2 offsetForAllPositions = default (Vector2), - bool includeBacksides = false) - { - int length = positions.Length; - this._temporaryPositionsCache.Clear(); - this._temporaryRotationsCache.Clear(); - for (int index = 0; index < length && !(positions[index] == Vector2.Zero); ++index) - { - Vector2 position1 = positions[index]; - float f1 = MathHelper.WrapAngle(rotations[index]); - this._temporaryPositionsCache.Add(position1); - this._temporaryRotationsCache.Add(f1); - if (index + 1 < length && positions[index + 1] != Vector2.Zero) - { - Vector2 position2 = positions[index + 1]; - float f2 = MathHelper.WrapAngle(rotations[index + 1]); - int num1 = (int) ((double) Math.Abs(MathHelper.WrapAngle(f2 - f1)) / 0.261799395084381); - if (num1 != 0) - { - float num2 = position1.Distance(position2); - Vector2 vector2_1 = position1 + f1.ToRotationVector2() * num2; - Vector2 vector2_2 = position2 + f2.ToRotationVector2() * -num2; - float num3 = 1f / (float) (num1 + 2); - Vector2 Target = position1; - for (float amount = num3; (double) amount < 1.0; amount += num3) - { - Vector2 Origin = Vector2.CatmullRom(vector2_1, position1, position2, vector2_2, amount); - float num4 = MathHelper.WrapAngle(Origin.DirectionTo(Target).ToRotation()); - this._temporaryPositionsCache.Add(Origin); - this._temporaryRotationsCache.Add(num4); - Target = Origin; - } - } - } - } - int count = this._temporaryPositionsCache.Count; - for (int index = 0; index < count; ++index) - { - Vector2 pos = this._temporaryPositionsCache[index] + offsetForAllPositions; - float rot = this._temporaryRotationsCache[index]; - int indexOnVertexArray = index * 2; - float progressOnStrip = (float) index / (float) (count - 1); - this.AddVertex(colorFunction, widthFunction, pos, rot, indexOnVertexArray, progressOnStrip); - } - this._vertexAmountCurrentlyMaintained = count * 2; - this.PrepareIndices(count, includeBacksides); - } - - private void PrepareIndices(int vertexPaidsAdded, bool includeBacksides) - { - int num1 = vertexPaidsAdded - 1; - int num2 = 6 + includeBacksides.ToInt() * 6; - int newSize = num1 * num2; - this._indicesAmountCurrentlyMaintained = newSize; - if (this._indices.Length < newSize) - Array.Resize(ref this._indices, newSize); - for (short index = 0; (int) index < num1; ++index) - { - short num3 = (short) ((int) index * num2); - int num4 = (int) index * 2; - this._indices[(int) num3] = (short) num4; - this._indices[(int) num3 + 1] = (short) (num4 + 1); - this._indices[(int) num3 + 2] = (short) (num4 + 2); - this._indices[(int) num3 + 3] = (short) (num4 + 2); - this._indices[(int) num3 + 4] = (short) (num4 + 1); - this._indices[(int) num3 + 5] = (short) (num4 + 3); - if (includeBacksides) - { - this._indices[(int) num3 + 6] = (short) (num4 + 2); - this._indices[(int) num3 + 7] = (short) (num4 + 1); - this._indices[(int) num3 + 8] = (short) num4; - this._indices[(int) num3 + 9] = (short) (num4 + 2); - this._indices[(int) num3 + 10] = (short) (num4 + 3); - this._indices[(int) num3 + 11] = (short) (num4 + 1); - } - } - } - - private void AddVertex( - VertexStrip.StripColorFunction colorFunction, - VertexStrip.StripHalfWidthFunction widthFunction, - Vector2 pos, - float rot, - int indexOnVertexArray, - float progressOnStrip) - { - while (indexOnVertexArray + 1 >= this._vertices.Length) - Array.Resize(ref this._vertices, this._vertices.Length * 2); - Color color = colorFunction(progressOnStrip); - float num = widthFunction(progressOnStrip); - Vector2 vector2 = MathHelper.WrapAngle(rot - 1.570796f).ToRotationVector2() * num; - this._vertices[indexOnVertexArray].Position = pos + vector2; - this._vertices[indexOnVertexArray + 1].Position = pos - vector2; - this._vertices[indexOnVertexArray].TexCoord = new Vector3(progressOnStrip, num, num); - this._vertices[indexOnVertexArray + 1].TexCoord = new Vector3(progressOnStrip, 0.0f, num); - this._vertices[indexOnVertexArray].Color = color; - this._vertices[indexOnVertexArray + 1].Color = color; - } - - public void DrawTrail() - { - if (this._vertexAmountCurrentlyMaintained < 3) - return; - Main.instance.GraphicsDevice.DrawUserIndexedPrimitives(PrimitiveType.TriangleList, this._vertices, 0, this._vertexAmountCurrentlyMaintained, this._indices, 0, this._indicesAmountCurrentlyMaintained / 3); - } - - public delegate Color StripColorFunction(float progressOnStrip); - - public delegate float StripHalfWidthFunction(float progressOnStrip); - - private struct CustomVertexInfo : IVertexType - { - public Vector2 Position; - public Color Color; - public Vector3 TexCoord; - private static VertexDeclaration _vertexDeclaration = new VertexDeclaration(new VertexElement[3] - { - new VertexElement(0, VertexElementFormat.Vector2, VertexElementUsage.Position, 0), - new VertexElement(8, VertexElementFormat.Color, VertexElementUsage.Color, 0), - new VertexElement(12, VertexElementFormat.Vector3, VertexElementUsage.TextureCoordinate, 0) - }); - - public CustomVertexInfo(Vector2 position, Color color, Vector3 texCoord) - { - this.Position = position; - this.Color = color; - this.TexCoord = texCoord; - } - - public VertexDeclaration VertexDeclaration => VertexStrip.CustomVertexInfo._vertexDeclaration; - } - } -} diff --git a/Graphics/VirtualCamera.cs b/Graphics/VirtualCamera.cs deleted file mode 100644 index 2e2a0c7..0000000 --- a/Graphics/VirtualCamera.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.VirtualCamera -// 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.Graphics -{ - public struct VirtualCamera - { - public readonly Player Player; - - public VirtualCamera(Player player) => this.Player = player; - - public Vector2 Position => this.Center - this.Size * 0.5f; - - public Vector2 Size => new Vector2((float) Main.maxScreenW, (float) Main.maxScreenH); - - public Vector2 Center => this.Player.Center; - } -} diff --git a/Graphics/WindowStateController.cs b/Graphics/WindowStateController.cs deleted file mode 100644 index f52520e..0000000 --- a/Graphics/WindowStateController.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Graphics.WindowStateController -// 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.Drawing; -using System.Windows.Forms; - -namespace Terraria.Graphics -{ - public class WindowStateController - { - public bool CanMoveWindowAcrossScreens => true; - - public string ScreenDeviceName => Main.instance.Window.ScreenDeviceName; - - public void TryMovingToScreen(string screenDeviceName) - { - Rectangle bounds; - if (!this.CanMoveWindowAcrossScreens || !this.TryGetBounds(screenDeviceName, out bounds) || !this.IsVisibleOnAnyScreen(bounds)) - return; - Form form = (Form) Control.FromHandle(Main.instance.Window.Handle); - if (!this.WouldViewFitInScreen(form.Bounds, bounds)) - return; - form.Location = new Point(bounds.Width / 2 - form.Width / 2 + bounds.X, bounds.Height / 2 - form.Height / 2 + bounds.Y); - } - - private bool TryGetBounds(string screenDeviceName, out Rectangle bounds) - { - bounds = new Rectangle(); - foreach (Screen allScreen in Screen.AllScreens) - { - if (allScreen.DeviceName == screenDeviceName) - { - bounds = allScreen.Bounds; - return true; - } - } - return false; - } - - private bool WouldViewFitInScreen(Rectangle view, Rectangle screen) => view.Width <= screen.Width && view.Height <= screen.Height; - - private bool IsVisibleOnAnyScreen(Rectangle rect) - { - foreach (Screen allScreen in Screen.AllScreens) - { - if (allScreen.WorkingArea.IntersectsWith(rect)) - return true; - } - return false; - } - } -} diff --git a/HitTile.cs b/HitTile.cs index dd852bb..0fc7a9f 100644 --- a/HitTile.cs +++ b/HitTile.cs @@ -1,13 +1,12 @@ // Decompiled with JetBrains decompiler // Type: Terraria.HitTile -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; -using Terraria.GameContent; using Terraria.Utilities; namespace Terraria @@ -17,7 +16,7 @@ namespace Terraria internal const int UNUSED = 0; internal const int TILE = 1; internal const int WALL = 2; - internal const int MAX_HITTILES = 500; + internal const int MAX_HITTILES = 20; internal const int TIMETOLIVE = 60; private static UnifiedRandom rand; private static int lastCrack = -1; @@ -25,34 +24,12 @@ namespace Terraria private int[] order; private int bufferLocation; - public static void ClearAllTilesAtThisLocation(int x, int y) - { - for (int index = 0; index < (int) byte.MaxValue; ++index) - { - if (Main.player[index].active) - Main.player[index].hitTile.ClearThisTile(x, y); - } - } - - public void ClearThisTile(int x, int y) - { - for (int tileId = 0; tileId <= 500; ++tileId) - { - HitTile.HitTileObject hitTileObject = this.data[this.order[tileId]]; - if (hitTileObject.X == x && hitTileObject.Y == y) - { - this.Clear(tileId); - this.Prune(); - } - } - } - public HitTile() { HitTile.rand = new UnifiedRandom(); - this.data = new HitTile.HitTileObject[501]; - this.order = new int[501]; - for (int index = 0; index <= 500; ++index) + this.data = new HitTile.HitTileObject[21]; + this.order = new int[21]; + for (int index = 0; index <= 20; ++index) { this.data[index] = new HitTile.HitTileObject(); this.order[index] = index; @@ -60,35 +37,9 @@ namespace Terraria this.bufferLocation = 0; } - public int TryFinding(int x, int y, int hitType) - { - for (int index1 = 0; index1 <= 500; ++index1) - { - int index2 = this.order[index1]; - HitTile.HitTileObject hitTileObject = this.data[index2]; - if (hitTileObject.type == hitType) - { - if (hitTileObject.X == x && hitTileObject.Y == y) - return index2; - } - else if (index1 != 0 && hitTileObject.type == 0) - break; - } - return -1; - } - - public void TryClearingAndPruning(int x, int y, int hitType) - { - int tileId = this.TryFinding(x, y, hitType); - if (tileId == -1) - return; - this.Clear(tileId); - this.Prune(); - } - public int HitObject(int x, int y, int hitType) { - for (int index1 = 0; index1 <= 500; ++index1) + for (int index1 = 0; index1 <= 20; ++index1) { int index2 = this.order[index1]; HitTile.HitTileObject hitTileObject = this.data[index2]; @@ -109,7 +60,7 @@ namespace Terraria public void UpdatePosition(int tileId, int x, int y) { - if (tileId < 0 || tileId > 500) + if (tileId < 0 || tileId > 20) return; HitTile.HitTileObject hitTileObject = this.data[tileId]; hitTileObject.X = x; @@ -118,7 +69,7 @@ namespace Terraria public int AddDamage(int tileId, int damageAmount, bool updateAmount = true) { - if (tileId < 0 || tileId > 500 || tileId == this.bufferLocation && damageAmount == 0) + if (tileId < 0 || tileId > 20 || tileId == this.bufferLocation && damageAmount == 0) return 0; HitTile.HitTileObject hitTileObject = this.data[tileId]; if (!updateAmount) @@ -127,25 +78,18 @@ namespace Terraria hitTileObject.timeToLive = 60; hitTileObject.animationTimeElapsed = 0; hitTileObject.animationDirection = (Main.rand.NextFloat() * 6.283185f).ToRotationVector2() * 2f; - this.SortSlots(tileId); - return hitTileObject.damage; - } - - private void SortSlots(int tileId) - { if (tileId == this.bufferLocation) { - this.bufferLocation = this.order[500]; - if (tileId != this.bufferLocation) - this.data[this.bufferLocation].Clear(); - for (int index = 500; index > 0; --index) + this.bufferLocation = this.order[20]; + this.data[this.bufferLocation].Clear(); + for (int index = 20; index > 0; --index) this.order[index] = this.order[index - 1]; this.order[0] = this.bufferLocation; } else { int index = 0; - while (index <= 500 && this.order[index] != tileId) + while (index <= 20 && this.order[index] != tileId) ++index; for (; index > 1; --index) { @@ -155,25 +99,26 @@ namespace Terraria } this.order[1] = tileId; } + return hitTileObject.damage; } public void Clear(int tileId) { - if (tileId < 0 || tileId > 500) + if (tileId < 0 || tileId > 20) return; this.data[tileId].Clear(); int index = 0; - while (index < 500 && this.order[index] != tileId) + while (index < 20 && this.order[index] != tileId) ++index; - for (; index < 500; ++index) + for (; index < 20; ++index) this.order[index] = this.order[index + 1]; - this.order[500] = tileId; + this.order[20] = tileId; } public void Prune() { bool flag = false; - for (int index = 0; index <= 500; ++index) + for (int index = 0; index <= 20; ++index) { HitTile.HitTileObject hitTileObject = this.data[index]; if (hitTileObject.type != 0) @@ -208,7 +153,7 @@ namespace Terraria flag = true; } } - else if (tile.wall == (ushort) 0) + else if (tile.wall == (byte) 0) { hitTileObject.Clear(); flag = true; @@ -222,7 +167,7 @@ namespace Terraria while (flag) { flag = false; - for (int index = num1; index < 500; ++index) + for (int index = num1; index < 20; ++index) { if (this.data[this.order[index]].type == 0 && this.data[this.order[index + 1]].type != 0) { @@ -261,7 +206,7 @@ namespace Terraria if (flag1 && num1 == 1) flag1 = flag1 && Main.tile[x, y].active() && Main.tileSolid[(int) Main.tile[x, y].type]; if (flag1 && num1 == 2) - flag1 = flag1 && Main.tile[x, y].wall > (ushort) 0; + flag1 = flag1 && Main.tile[x, y].wall > (byte) 0; if (flag1) { bool flag2 = false; @@ -270,7 +215,7 @@ namespace Terraria flag2 = false; else if (Main.tileSolid[(int) Main.tile[x, y].type] && !Main.tileSolidTop[(int) Main.tile[x, y].type]) flag2 = true; - else if (WorldGen.IsTreeType((int) Main.tile[x, y].type)) + else if (Main.tile[x, y].type == (ushort) 5) { flag3 = true; int num2 = (int) Main.tile[x, y].frameX / 22; @@ -312,22 +257,19 @@ namespace Terraria num7 = 1f - num7; Tile tileSafely = Framing.GetTileSafely(x, y); Tile tile = tileSafely; - Texture2D requestIfNotReady = Main.instance.TilePaintSystem.TryGetTileAndRequestIfNotReady((int) tileSafely.type, 0, (int) tileSafely.color()); - if (requestIfNotReady != null) - { - Vector2 origin = new Vector2(8f); - Vector2 vector2_2 = new Vector2(1f); - double num8 = (double) num7 * 0.200000002980232 + 1.0; - float num9 = 1f - num7; - float num10 = 1f; - Color color2 = color1 * (float) ((double) num10 * (double) num10 * 0.800000011920929); - Vector2 vector2_3 = vector2_2; - Vector2 scale = (float) num8 * vector2_3; - Vector2 position = (new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + vector2_1 + origin + zero).Floor(); - spriteBatch.Draw(requestIfNotReady, position, new Rectangle?(new Rectangle((int) tile.frameX, (int) tile.frameY, 16, 16)), color2, rotation, origin, scale, SpriteEffects.None, 0.0f); - color2.A = (byte) 180; - spriteBatch.Draw(TextureAssets.TileCrack.Value, position, new Rectangle?(rectangle), color2, rotation, origin, scale, SpriteEffects.None, 0.0f); - } + Texture2D texture = !Main.canDrawColorTile(tileSafely.type, (int) tileSafely.color()) ? Main.tileTexture[(int) tileSafely.type] : (Texture2D) Main.tileAltTexture[(int) tileSafely.type, (int) tileSafely.color()]; + Vector2 origin = new Vector2(8f); + Vector2 vector2_2 = new Vector2(1f); + double num8 = (double) num7 * 0.200000002980232 + 1.0; + float num9 = 1f - num7; + float num10 = 1f; + Color color2 = color1 * (float) ((double) num10 * (double) num10 * 0.800000011920929); + Vector2 vector2_3 = vector2_2; + Vector2 scale = (float) num8 * vector2_3; + Vector2 position = (new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + vector2_1 + origin + zero).Floor(); + spriteBatch.Draw(texture, position, new Rectangle?(new Rectangle((int) tile.frameX, (int) tile.frameY, 16, 16)), color2, rotation, origin, scale, SpriteEffects.None, 0.0f); + color2.A = (byte) 180; + spriteBatch.Draw(Main.tileCrackTexture, position, new Rectangle?(rectangle), color2, rotation, origin, scale, SpriteEffects.None, 0.0f); } } } diff --git a/ID/AchievementHelperID.cs b/ID/AchievementHelperID.cs index 76d2b82..8294f41 100644 --- a/ID/AchievementHelperID.cs +++ b/ID/AchievementHelperID.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.AchievementHelperID -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.ID @@ -32,7 +32,6 @@ namespace Terraria.ID public const int UnlockedGoldenChest = 19; public const int UnlockedBiomeChest = 20; public const int DefeatedMechaMayhem = 21; - public const int TempleRaider = 22; } public class Special diff --git a/ID/AmmoID.cs b/ID/AmmoID.cs index b8815f2..fb1804e 100644 --- a/ID/AmmoID.cs +++ b/ID/AmmoID.cs @@ -1,11 +1,9 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.AmmoID -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe -using System.Collections.Generic; - namespace Terraria.ID { public static class AmmoID @@ -27,282 +25,5 @@ namespace Terraria.ID public static int JackOLantern = 1785; public static int Stake = 1836; public static int NailFriendly = 3108; - - public class Sets - { - public static Dictionary> SpecificLauncherAmmoProjectileMatches = new Dictionary>() - { - { - 759, - new Dictionary() - { - { - 771, - 134 - }, - { - 772, - 137 - }, - { - 773, - 140 - }, - { - 774, - 143 - }, - { - 4445, - 776 - }, - { - 4446, - 780 - }, - { - 4457, - 793 - }, - { - 4458, - 796 - }, - { - 4459, - 799 - }, - { - 4447, - 784 - }, - { - 4448, - 787 - }, - { - 4449, - 790 - } - } - }, - { - 758, - new Dictionary() - { - { - 771, - 133 - }, - { - 772, - 136 - }, - { - 773, - 139 - }, - { - 774, - 142 - }, - { - 4445, - 777 - }, - { - 4446, - 781 - }, - { - 4457, - 794 - }, - { - 4458, - 797 - }, - { - 4459, - 800 - }, - { - 4447, - 785 - }, - { - 4448, - 788 - }, - { - 4449, - 791 - } - } - }, - { - 760, - new Dictionary() - { - { - 771, - 135 - }, - { - 772, - 138 - }, - { - 773, - 141 - }, - { - 774, - 144 - }, - { - 4445, - 778 - }, - { - 4446, - 782 - }, - { - 4457, - 795 - }, - { - 4458, - 798 - }, - { - 4459, - 801 - }, - { - 4447, - 786 - }, - { - 4448, - 789 - }, - { - 4449, - 792 - } - } - }, - { - 1946, - new Dictionary() - { - { - 771, - 338 - }, - { - 772, - 339 - }, - { - 773, - 340 - }, - { - 774, - 341 - }, - { - 4445, - 803 - }, - { - 4446, - 804 - }, - { - 4457, - 808 - }, - { - 4458, - 809 - }, - { - 4459, - 810 - }, - { - 4447, - 805 - }, - { - 4448, - 806 - }, - { - 4449, - 807 - } - } - }, - { - 3930, - new Dictionary() - { - { - 771, - 715 - }, - { - 772, - 716 - }, - { - 773, - 717 - }, - { - 774, - 718 - }, - { - 4445, - 717 - }, - { - 4446, - 718 - }, - { - 4457, - 717 - }, - { - 4458, - 718 - }, - { - 4459, - 717 - }, - { - 4447, - 717 - }, - { - 4448, - 717 - }, - { - 4449, - 717 - } - } - } - }; - } } } diff --git a/ID/AnimationID.cs b/ID/AnimationID.cs index 9f53f94..64d9558 100644 --- a/ID/AnimationID.cs +++ b/ID/AnimationID.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.AnimationID -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.ID @@ -11,7 +11,5 @@ namespace Terraria.ID public const short MushroomStatueTurningOn = 0; public const short MushroomStatueTurningOff = 1; public const short FakeChestOpening = 2; - public const short VolcanosTurningOn = 3; - public const short VolcanosTurningOff = 4; } } diff --git a/ID/ArmorIDs.cs b/ID/ArmorIDs.cs index 99cd9fe..ab67d80 100644 --- a/ID/ArmorIDs.cs +++ b/ID/ArmorIDs.cs @@ -1,12 +1,10 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.ArmorIDs -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe -using System; using System.Collections.Generic; -using Terraria.DataStructures; namespace Terraria.ID { @@ -52,8 +50,6 @@ namespace Terraria.ID public const int AdamantiteHeadgear = 35; public const int AdamantiteHelmet = 36; public const int AdamantiteMask = 37; - public const int Werewolf = 38; - public const int Merman = 39; public const int ClownHat = 40; public const int HallowedHelmet = 41; public const int HallowedHeadgear = 42; @@ -230,63 +226,7 @@ namespace Terraria.ID public const int ShinobiInfiltrator = 213; public const int ArkhalisHat = 214; public const int LeinforsHat = 215; - public const int UltraBrightHelmet = 216; - public const int Maid = 217; - public const int MaidAlt = 218; - public const int GolfHat = 219; - public const int GolfVisor = 220; - public const int GoldGoldfishBowl = 221; - public const int StarPrincessCrown = 222; - public const int DemonHorns = 223; - public const int BunnyEars = 224; - public const int DevilHorns = 225; - public const int Fedora = 226; - public const int ChefHat = 227; - public const int StarHairpin = 228; - public const int HeartHairpin = 229; - public const int SuperHeroMask = 230; - public const int UndertakerHat = 231; - public const int PrettyPinkRibbon = 232; - public const int FuneralHat = 233; - public const int VictorianGothHat = 234; - public const int GhostarSkullPin = 235; - public const int DrManFlyMask = 236; - public const int ButcherMask = 237; - public const int SafemanSunHair = 238; - public const int FoodBarbarianHelm = 239; - public const int GroxTheGreatHelm = 240; - public const int RockGolemHead = 241; - public const int DogEars = 242; - public const int FoxEars = 243; - public const int LizardEars = 244; - public const int PandaEars = 245; - public const int DogEarsBack = 246; - public const int FoxEarsBack = 247; - public const int LizardEarsBack = 248; - public const int PandaEarsBack = 249; - public const int MushroomHat = 250; - public const int FairyQueenMask = 251; - public const int CatEarsBack = 252; - public const int BunnyEarsBack = 253; - public const int HallowedHood = 254; - public const int AncientHallowedMask = 255; - public const int AncientHallowedHelmet = 256; - public const int AncientHallowedHeadgear = 257; - public const int AncientHallowedHood = 258; - public const int RabbitOrder = 259; - public const int QueenSlimeMask = 260; - public const int CrystalNinjaHelmet = 261; - public const int GraduationCapBlue = 262; - public const int GraduationCapMaroon = 263; - public const int GraduationCapBlack = 264; - public const int BadgersHat = 265; - public const int Count = 266; - - public class Sets - { - public static SetFactory Factory = new SetFactory(266); - public static int[] FrontToBackID = ArmorIDs.Head.Sets.Factory.CreateIntSet(-1, 242, 246, 243, 247, 244, 248, 245, 249, 133, 252, 224, 253); - } + public const int Count = 216; } public class Body @@ -312,8 +252,6 @@ namespace Terraria.ID public const int MythrilChainmail = 18; public const int AdamantiteBreastplate = 19; public const int MiningShirt = 20; - public const int Werewolf = 21; - public const int Merfolk = 22; public const int ClownShirt = 23; public const int HallowedPlateMail = 24; public const int SantaShirt = 25; @@ -443,60 +381,12 @@ namespace Terraria.ID public const int ShinobiInfiltrator = 207; public const int ArkhalisShirt = 208; public const int LeinforsShirt = 209; - public const int Maid = 210; - public const int MaidAlt = 211; - public const int Golf = 212; - public const int AmberRobe = 213; - public const int GameMasterShirt = 214; - public const int StarPrincessDress = 215; - public const int ChefOutfit = 216; - public const int SuperHeroCostume = 217; - public const int PrettyPinkDress = 218; - public const int UndertakerCoat = 219; - public const int FuneralCoat = 220; - public const int VictorianGothDress = 221; - public const int GhostarShirt = 222; - public const int DrManFlyLabCoat = 223; - public const int ButcherApron = 224; - public const int SafemanSunDress = 225; - public const int FoodBarbarianArmor = 226; - public const int GroxTheGreatArmor = 227; - public const int MushroomVest = 228; - public const int AncientHallowedPlateMail = 229; - public const int CrystalNinjaChestplate = 230; - public const int GraduationGownBlue = 231; - public const int GraduationGownMaroon = 232; - public const int GraduationGownBlack = 233; - public const int DeadMansSweater = 234; - public const int Count = 235; + public const int Count = 210; public class Sets { - public static SetFactory Factory = new SetFactory(235); - public static bool[] NeedsToDrawArm = ArmorIDs.Body.Sets.Factory.CreateBoolSet(false, 200, 202, 201, 203, 195, 205, 207, 206, 228); - public static int[] IncludedCapeBack = ArmorIDs.Body.Sets.Factory.CreateIntSet(-1, 207, 13, 206, 12, 205, 11, 185, 17, 96, 18, 94, 19, 80, 21, 217, 22, 24, 29); - public static int[] IncludedCapeBackFemale = ArmorIDs.Body.Sets.Factory.CreateIntSet(-1, 207, 13, 206, 12, 205, 11, 185, 17, 96, 18, 94, 19, 80, 21, 217, 23, 24, 29); - public static int[] IncludedCapeFront = ArmorIDs.Body.Sets.Factory.CreateIntSet(-1, 184, 6); - public static ArmorIDs.Body.Sets.IncludeCapeFrontAndBackInfo[] IncludeCapeFrontAndBack = ArmorIDs.Body.Sets.Factory.CreateCustomSet(new ArmorIDs.Body.Sets.IncludeCapeFrontAndBackInfo() - { - backCape = (sbyte) -1, - frontCape = (sbyte) -1 - }, (object) 85, (object) new ArmorIDs.Body.Sets.IncludeCapeFrontAndBackInfo() - { - backCape = (sbyte) 20, - frontCape = (sbyte) 7 - }); - public static bool[] UsesNewFramingCode = ArmorIDs.Body.Sets.Factory.CreateBoolSet(false, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234); - public static bool[] showsShouldersWhileJumping = ArmorIDs.Body.Sets.Factory.CreateBoolSet(177, 190, 95, 46, 73, 92, 24, 54, 55, 56, 65, 66, 67, 69, 70, 71, 75, 105, 106, 175, 176, 182, 183, 187, 194, 197, 198, 201, 204, 226, 227, 229); - public static bool[] shouldersAreAlwaysInTheBack = ArmorIDs.Body.Sets.Factory.CreateBoolSet(190); - - public struct IncludeCapeFrontAndBackInfo - { - public sbyte frontCape; - public sbyte backCape; - - public bool Invalid => this.frontCape == (sbyte) -1 && this.backCape == (sbyte) -1; - } + public static SetFactory Factory = new SetFactory(210); + public static bool[] NeedsToDrawArm = ArmorIDs.Body.Sets.Factory.CreateBoolSet(false, 200, 202, 201, 203, 195, 205, 207, 206); } } @@ -635,68 +525,11 @@ namespace Terraria.ID public const int ArkhalisPants_Female = 158; public const int LeinforsPants = 159; public const int LeinforsPantsCoat = 160; - public const int ShinobiInfiltratorBodyExtension = 161; - public const int ForbiddenArmorBodyExtension = 162; - public const int GladiatorBreastplateBodyExtension = 163; - public const int BeeBreastplateBodyExtension = 164; - public const int ReaperRobe = 165; - public const int BrideOfFrankensteinDress = 166; - public const int WitchDress = 167; - public const int PrincessDress = 168; - public const int GhostShirt = 169; - public const int DTownBreastplateBodyExtension = 170; - public const int RaincoatMaleBodyExtension = 171; - public const int RaincoatFemaleBodyExtension = 172; - public const int ObsidianLongcoatBodyExtension = 173; - public const int ApprenticeDarkBodyExtension = 174; - public const int TikiShirtBodyExtensionMale = 175; - public const int TikiShirtBodyExtensionFemale = 176; - public const int MaidBodyExtensionFemale = 177; - public const int MaidBodyExtensionMale = 178; - public const int MaidFemale = 179; - public const int MaidMale = 180; - public const int MaidAltBodyExtensionFemale = 181; - public const int MaidAltBodyExtensionMale = 182; - public const int MaidAltFemale = 183; - public const int MaidAltMale = 184; - public const int Golf = 185; - public const int WitchDressBodyExtension = 186; - public const int AmberRobe = 187; - public const int GameMasterPants = 188; - public const int StarPrincessDress = 189; - public const int ChefPants = 190; - public const int SuperHeroTightsMale = 191; - public const int SuperHeroTightsFemale = 192; - public const int PrettyPinkDressPantsMale = 193; - public const int PrettyPinkDressPantsFemale = 194; - public const int PrettyPinkDressSkirt = 195; - public const int UndertakerCoat = 196; - public const int FuneralPantsMale = 197; - public const int FuneralPantsFemale = 198; - public const int VictorianGothDressExtension = 199; - public const int GhostarShirtExtensionFemale = 200; - public const int GhostarShirtExtensionMale = 201; - public const int GhostarLegsFemale = 202; - public const int GhostarLegsMale = 203; - public const int DrManFlyLabCoatLegs = 204; - public const int ButcherPants = 205; - public const int SafemanSunDressExtension = 206; - public const int SafemanDressLeggingsFemale = 207; - public const int SafemanDressLeggingsMale = 208; - public const int FoodBarbarianGreaves = 209; - public const int GroxTheGreatGreaves = 210; - public const int MushroomPants = 211; - public const int AncientHallowedGreaves = 212; - public const int CrystalNinjaLeggings = 213; - public const int GraduationGownBlueExtension = 214; - public const int GraduationGownMaroonExtension = 215; - public const int GraduationGownBlackExtension = 216; - public const int MoonLordLegs = 217; - public const int Count = 218; + public const int Count = 161; public class Sets { - public static SetFactory Factory = new SetFactory(218); + public static SetFactory Factory = new SetFactory(161); public static List MannequinIncompatible = new List(); } } @@ -724,16 +557,7 @@ namespace Terraria.ID public const sbyte CelestialCuffs = 17; public const sbyte YoyoGlove = 18; public const sbyte HuntressBuckler = 19; - public const sbyte BersekerGlove = 20; - public const sbyte FrogWebbing = 21; - public const int Count = 22; - - public class Sets - { - public static SetFactory Factory = new SetFactory(22); - public static bool[] UsesNewFramingCode = ArmorIDs.HandOn.Sets.Factory.CreateBoolSet(false, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 16, 17, 18, 19, 20, 21); - public static bool[] UsesOldFramingTexturesForWalking = ArmorIDs.HandOn.Sets.Factory.CreateBoolSet(false, 12, 8, 17); - } + public const int Count = 20; } public class HandOff @@ -751,15 +575,7 @@ namespace Terraria.ID public const sbyte FeralClaws = 9; public const sbyte CelestialCuffs = 10; public const sbyte YoyoGlove = 11; - public const sbyte BersekerGlove = 12; - public const sbyte FrogWebbing = 13; - public const int Count = 14; - - public class Sets - { - public static SetFactory Factory = new SetFactory(14); - public static bool[] UsesNewFramingCode = ArmorIDs.HandOff.Sets.Factory.CreateBoolSet(false, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13); - } + public const int Count = 12; } public class Back @@ -777,23 +593,7 @@ namespace Terraria.ID public const sbyte ApprenticeDark = 11; public const sbyte RedRidingHuntress = 12; public const sbyte ShinobiInfiltrator = 13; - public const sbyte ManaCloak = 14; - public const sbyte MoltenQuiver = 15; - public const sbyte StalkersQuiver = 16; - public const sbyte ClothiersJacket = 17; - public const sbyte SpaceCreatureShirt = 18; - public const sbyte FoxShirt = 19; - public const sbyte VampireShirt = 20; - public const sbyte CatShirt = 21; - public const sbyte SuperHeroCostumeMale = 22; - public const sbyte SuperHeroCostumeFemale = 23; - public const sbyte HunterCloak = 24; - public const sbyte DogTail = 25; - public const sbyte FoxTail = 26; - public const sbyte LizardTail = 27; - public const sbyte BunnyTail = 28; - public const sbyte HallowedCape = 29; - public const int Count = 30; + public const int Count = 14; } public class Front @@ -802,17 +602,7 @@ namespace Terraria.ID public const sbyte MysteriousCape = 2; public const sbyte RedCape = 3; public const sbyte WinterCape = 4; - public const sbyte ManaCloak = 5; - public const sbyte TaxCollectorsSuit = 6; - public const sbyte VampireShirt = 7; - public const sbyte HunterCloak = 8; - public const int Count = 9; - - public class Sets - { - public static SetFactory Factory = new SetFactory(9); - public static bool[] DrawsInNeckLayer = ArmorIDs.Front.Sets.Factory.CreateBoolSet(false, 6); - } + public const int Count = 5; } public class Shoe @@ -835,14 +625,7 @@ namespace Terraria.ID public const sbyte FrogLeg = 15; public const sbyte FlowerBoots = 16; public const sbyte SailfishBoots = 17; - public const sbyte AmphibianBoots = 18; - public const sbyte FairyBoots = 19; - public const sbyte FrogFlipper = 20; - public const sbyte SandBoots = 21; - public const sbyte FlameWakerBoots = 22; - public const sbyte HellfireTreads = 23; - public const sbyte TerrasparkBoots = 24; - public const int Count = 25; + public const int Count = 18; } public class Waist @@ -860,17 +643,7 @@ namespace Terraria.ID public const sbyte BlackBelt = 10; public const sbyte TsunamiinaBottle = 11; public const sbyte MonkBelt = 12; - public const sbyte BlizzardinaBottle = 13; - public const sbyte FartinaJar = 14; - public const sbyte SandstorminaBottle = 15; - public const sbyte TreasureMagnet = 16; - public const int Count = 17; - - public class Sets - { - public static SetFactory Factory = new SetFactory(17); - public static bool[] UsesTorsoFraming = ArmorIDs.Waist.Sets.Factory.CreateBoolSet(false, 5, 10, 10, 12); - } + public const int Count = 13; } public class Wing @@ -914,19 +687,7 @@ namespace Terraria.ID public const sbyte BetsyWings = 37; public const sbyte ArkhalisWings = 38; public const sbyte LeinforsWings = 39; - public const sbyte GhostarsWings = 40; - public const sbyte SafemanWings = 41; - public const sbyte FoodBarbarianWings = 42; - public const sbyte GroxTheGreatWings = 43; - public const sbyte RainbowWings = 44; - public const sbyte LongTrailRainbowWings = 45; - public const sbyte CreativeWings = 46; - public const int Count = 47; - - public class Sets - { - public static WingStats[] Stats; - } + public const int Count = 40; } public class Shield @@ -937,10 +698,7 @@ namespace Terraria.ID public const sbyte AnkhShield = 4; public const sbyte ShieldofCthulhu = 5; public const sbyte SquireShield = 6; - public const sbyte Frozen = 7; - public const sbyte Hero = 8; - public const sbyte BouncingShield = 9; - public const int Count = 10; + public const int Count = 7; } public class Neck @@ -954,8 +712,7 @@ namespace Terraria.ID public const sbyte SharkToothNecklace = 7; public const sbyte WormScarf = 8; public const sbyte ApprenticeScarf = 9; - public const sbyte Stinger = 10; - public const int Count = 11; + public const int Count = 10; } public class Face @@ -968,21 +725,7 @@ namespace Terraria.ID public const sbyte ObsidianRose = 6; public const sbyte AngelHalo = 7; public const sbyte GingerBeard = 8; - public const sbyte ArcaneFlower = 9; - public const sbyte LavaSkull = 10; - public const sbyte MoltenSkullRose = 11; - public const sbyte ObsidianSkull = 12; - public const sbyte ObsidianSkullRose = 13; - public const sbyte SpectreGoggles = 14; - [Obsolete("Deprecated.")] - public const sbyte UnusedID = 15; - public const sbyte Count = 16; - - public class Sets - { - public static SetFactory Factory = new SetFactory(16); - public static bool[] PreventHairDraw = ArmorIDs.Face.Sets.Factory.CreateBoolSet(false, 2, 3, 4, 10, 11, 12, 13); - } + public const int Count = 9; } public class Balloon @@ -1006,14 +749,5 @@ namespace Terraria.ID public const sbyte BalloonAnimal = 17; public const int Count = 18; } - - public class RocketBoots - { - public const int None = 0; - public const int SimpleRocketBoots = 1; - public const int SpectreBoots = 2; - public const int FrostsparkBoots = 3; - public const int TerrasparkBoots = 4; - } } } diff --git a/ID/BiomeID.cs b/ID/BiomeID.cs deleted file mode 100644 index 44002c6..0000000 --- a/ID/BiomeID.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.ID.BiomeID -// 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.ID -{ - internal class BiomeID - { - public const int Forest = 0; - public const int NormalUnderground = 1; - public const int Snow = 2; - public const int Desert = 3; - public const int Jungle = 4; - public const int Ocean = 5; - public const int Hallow = 6; - public const int Mushroom = 7; - public const int Dungeon = 8; - public const int Corruption = 9; - public const int Crimson = 10; - } -} diff --git a/ID/BuffID.cs b/ID/BuffID.cs index f02cd93..44cd5bc 100644 --- a/ID/BuffID.cs +++ b/ID/BuffID.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.BuffID -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.ID @@ -213,339 +213,6 @@ namespace Terraria.ID public const int BetsysCurse = 203; public const int Oiled = 204; public const int BallistaPanic = 205; - public const int WellFed2 = 206; - public const int WellFed3 = 207; - public const int DesertMinecartRight = 208; - public const int DesertMinecartLeft = 209; - public const int FishMinecartRight = 210; - public const int FishMinecartLeft = 211; - public const int GolfCartMount = 212; - public const int BatOfLight = 213; - public const int VampireFrog = 214; - public const int CatBast = 215; - public const int BabyBird = 216; - public const int UpbeatStar = 217; - public const int SugarGlider = 218; - public const int SharkPup = 219; - public const int BeeMinecartRight = 220; - public const int BeeMinecartLeft = 221; - public const int LadybugMinecartRight = 222; - public const int LadybugMinecartLeft = 223; - public const int PigronMinecartRight = 224; - public const int PigronMinecartLeft = 225; - public const int SunflowerMinecartRight = 226; - public const int SunflowerMinecartLeft = 227; - public const int HellMinecartRight = 228; - public const int HellMinecartLeft = 229; - public const int WitchBroom = 230; - public const int ShroomMinecartRight = 231; - public const int ShroomMinecartLeft = 232; - public const int AmethystMinecartRight = 233; - public const int AmethystMinecartLeft = 234; - public const int TopazMinecartRight = 235; - public const int TopazMinecartLeft = 236; - public const int SapphireMinecartRight = 237; - public const int SapphireMinecartLeft = 238; - public const int EmeraldMinecartRight = 239; - public const int EmeraldMinecartLeft = 240; - public const int RubyMinecartRight = 241; - public const int RubyMinecartLeft = 242; - public const int DiamondMinecartRight = 243; - public const int DiamondMinecartLeft = 244; - public const int AmberMinecartRight = 245; - public const int AmberMinecartLeft = 246; - public const int BeetleMinecartRight = 247; - public const int BeetleMinecartLeft = 248; - public const int MeowmereMinecartRight = 249; - public const int MeowmereMinecartLeft = 250; - public const int PartyMinecartRight = 251; - public const int PartyMinecartLeft = 252; - public const int PirateMinecartRight = 253; - public const int PirateMinecartLeft = 254; - public const int SteampunkMinecartRight = 255; - public const int SteampunkMinecartLeft = 256; - public const int Lucky = 257; - public const int LilHarpy = 258; - public const int FennecFox = 259; - public const int GlitteryButterfly = 260; - public const int BabyImp = 261; - public const int BabyRedPanda = 262; - public const int StormTiger = 263; - public const int Plantero = 264; - public const int Flamingo = 265; - public const int DynamiteKitten = 266; - public const int BabyWerewolf = 267; - public const int ShadowMimic = 268; - public const int CoffinMinecartRight = 269; - public const int CoffinMinecartLeft = 270; - public const int Smolstar = 271; - public const int DiggingMoleMinecartRight = 272; - public const int DiggingMoleMinecartLeft = 273; - public const int VoltBunny = 274; - public const int PaintedHorseMount = 275; - public const int MajesticHorseMount = 276; - public const int DarkHorseMount = 277; - public const int PogoStickMount = 278; - public const int PirateShipMount = 279; - public const int SpookyWoodMount = 280; - public const int SantankMount = 281; - public const int WallOfFleshGoatMount = 282; - public const int DarkMageBookMount = 283; - public const int KingSlimePet = 284; - public const int EyeOfCthulhuPet = 285; - public const int EaterOfWorldsPet = 286; - public const int BrainOfCthulhuPet = 287; - public const int SkeletronPet = 288; - public const int QueenBeePet = 289; - public const int DestroyerPet = 290; - public const int TwinsPet = 291; - public const int SkeletronPrimePet = 292; - public const int PlanteraPet = 293; - public const int GolemPet = 294; - public const int DukeFishronPet = 295; - public const int LunaticCultistPet = 296; - public const int MoonLordPet = 297; - public const int FairyQueenPet = 298; - public const int PumpkingPet = 299; - public const int EverscreamPet = 300; - public const int IceQueenPet = 301; - public const int MartianPet = 302; - public const int DD2OgrePet = 303; - public const int DD2BetsyPet = 304; - public const int LavaSharkMount = 305; - public const int TitaniumStorm = 306; - public const int BlandWhipEnemyDebuff = 307; - public const int SwordWhipPlayerBuff = 308; - public const int SwordWhipNPCDebuff = 309; - public const int ScytheWhipEnemyDebuff = 310; - public const int ScytheWhipPlayerBuff = 311; - public const int CoolWhipPlayerBuff = 312; - public const int FlameWhipEnemyDebuff = 313; - public const int ThornWhipPlayerBuff = 314; - public const int ThornWhipNPCDebuff = 315; - public const int RainbowWhipNPCDebuff = 316; - public const int QueenSlimePet = 317; - public const int QueenSlimeMount = 318; - public const int MaceWhipNPCDebuff = 319; - public const int GelBalloonBuff = 320; - public const int BrainOfConfusionBuff = 321; - public const int EmpressBlade = 322; - public const int Count = 323; - - public class Sets - { - public static SetFactory Factory = new SetFactory(323); - public static bool[] IsWellFed = BuffID.Sets.Factory.CreateBoolSet(26, 206, 207); - public static bool[] TimeLeftDoesNotDecrease = BuffID.Sets.Factory.CreateBoolSet(28); - public static bool[] CanBeRemovedByNetMessage = BuffID.Sets.Factory.CreateBoolSet(313); - public static bool[] IsAFlaskBuff = BuffID.Sets.Factory.CreateBoolSet(71, 72, 73, 74, 75, 76, 77, 78, 79); - public static BuffID.Sets.BuffMountData[] BasicMountData = BuffID.Sets.Factory.CreateCustomSet((BuffID.Sets.BuffMountData) null, (object) 118, (object) new BuffID.Sets.BuffMountData() - { - mountID = 6, - faceLeft = true - }, (object) 138, (object) new BuffID.Sets.BuffMountData() - { - mountID = 6, - faceLeft = false - }, (object) 184, (object) new BuffID.Sets.BuffMountData() - { - mountID = 13, - faceLeft = true - }, (object) 185, (object) new BuffID.Sets.BuffMountData() - { - mountID = 13, - faceLeft = false - }, (object) 211, (object) new BuffID.Sets.BuffMountData() - { - mountID = 16, - faceLeft = true - }, (object) 210, (object) new BuffID.Sets.BuffMountData() - { - mountID = 16, - faceLeft = false - }, (object) 209, (object) new BuffID.Sets.BuffMountData() - { - mountID = 15, - faceLeft = true - }, (object) 208, (object) new BuffID.Sets.BuffMountData() - { - mountID = 15, - faceLeft = false - }, (object) 221, (object) new BuffID.Sets.BuffMountData() - { - mountID = 18, - faceLeft = true - }, (object) 220, (object) new BuffID.Sets.BuffMountData() - { - mountID = 18, - faceLeft = false - }, (object) 223, (object) new BuffID.Sets.BuffMountData() - { - mountID = 19, - faceLeft = true - }, (object) 222, (object) new BuffID.Sets.BuffMountData() - { - mountID = 19, - faceLeft = false - }, (object) 225, (object) new BuffID.Sets.BuffMountData() - { - mountID = 20, - faceLeft = true - }, (object) 224, (object) new BuffID.Sets.BuffMountData() - { - mountID = 20, - faceLeft = false - }, (object) 227, (object) new BuffID.Sets.BuffMountData() - { - mountID = 21, - faceLeft = true - }, (object) 226, (object) new BuffID.Sets.BuffMountData() - { - mountID = 21, - faceLeft = false - }, (object) 229, (object) new BuffID.Sets.BuffMountData() - { - mountID = 22, - faceLeft = true - }, (object) 228, (object) new BuffID.Sets.BuffMountData() - { - mountID = 22, - faceLeft = false - }, (object) 232, (object) new BuffID.Sets.BuffMountData() - { - mountID = 24, - faceLeft = true - }, (object) 231, (object) new BuffID.Sets.BuffMountData() - { - mountID = 24, - faceLeft = false - }, (object) 234, (object) new BuffID.Sets.BuffMountData() - { - mountID = 25, - faceLeft = true - }, (object) 233, (object) new BuffID.Sets.BuffMountData() - { - mountID = 25, - faceLeft = false - }, (object) 236, (object) new BuffID.Sets.BuffMountData() - { - mountID = 26, - faceLeft = true - }, (object) 235, (object) new BuffID.Sets.BuffMountData() - { - mountID = 26, - faceLeft = false - }, (object) 238, (object) new BuffID.Sets.BuffMountData() - { - mountID = 27, - faceLeft = true - }, (object) 237, (object) new BuffID.Sets.BuffMountData() - { - mountID = 27, - faceLeft = false - }, (object) 240, (object) new BuffID.Sets.BuffMountData() - { - mountID = 28, - faceLeft = true - }, (object) 239, (object) new BuffID.Sets.BuffMountData() - { - mountID = 28, - faceLeft = false - }, (object) 242, (object) new BuffID.Sets.BuffMountData() - { - mountID = 29, - faceLeft = true - }, (object) 241, (object) new BuffID.Sets.BuffMountData() - { - mountID = 29, - faceLeft = false - }, (object) 244, (object) new BuffID.Sets.BuffMountData() - { - mountID = 30, - faceLeft = true - }, (object) 243, (object) new BuffID.Sets.BuffMountData() - { - mountID = 30, - faceLeft = false - }, (object) 246, (object) new BuffID.Sets.BuffMountData() - { - mountID = 31, - faceLeft = true - }, (object) 245, (object) new BuffID.Sets.BuffMountData() - { - mountID = 31, - faceLeft = false - }, (object) 248, (object) new BuffID.Sets.BuffMountData() - { - mountID = 32, - faceLeft = true - }, (object) 247, (object) new BuffID.Sets.BuffMountData() - { - mountID = 32, - faceLeft = false - }, (object) 250, (object) new BuffID.Sets.BuffMountData() - { - mountID = 33, - faceLeft = true - }, (object) 249, (object) new BuffID.Sets.BuffMountData() - { - mountID = 33, - faceLeft = false - }, (object) 252, (object) new BuffID.Sets.BuffMountData() - { - mountID = 34, - faceLeft = true - }, (object) 251, (object) new BuffID.Sets.BuffMountData() - { - mountID = 34, - faceLeft = false - }, (object) 254, (object) new BuffID.Sets.BuffMountData() - { - mountID = 35, - faceLeft = true - }, (object) 253, (object) new BuffID.Sets.BuffMountData() - { - mountID = 35, - faceLeft = false - }, (object) 256, (object) new BuffID.Sets.BuffMountData() - { - mountID = 36, - faceLeft = true - }, (object) (int) byte.MaxValue, (object) new BuffID.Sets.BuffMountData() - { - mountID = 36, - faceLeft = false - }, (object) 270, (object) new BuffID.Sets.BuffMountData() - { - mountID = 38, - faceLeft = true - }, (object) 269, (object) new BuffID.Sets.BuffMountData() - { - mountID = 38, - faceLeft = false - }, (object) 273, (object) new BuffID.Sets.BuffMountData() - { - mountID = 39, - faceLeft = true - }, (object) 272, (object) new BuffID.Sets.BuffMountData() - { - mountID = 39, - faceLeft = false - }, (object) 167, (object) new BuffID.Sets.BuffMountData() - { - mountID = 11, - faceLeft = true - }, (object) 166, (object) new BuffID.Sets.BuffMountData() - { - mountID = 11, - faceLeft = false - }); - - public class BuffMountData - { - public int mountID; - public bool faceLeft; - } - } + public const int Count = 206; } } diff --git a/ID/ChainID.cs b/ID/ChainID.cs index befd5bb..b686619 100644 --- a/ID/ChainID.cs +++ b/ID/ChainID.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.ChainID -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.ID diff --git a/ID/CloudID.cs b/ID/CloudID.cs deleted file mode 100644 index 9ba114b..0000000 --- a/ID/CloudID.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.ID.CloudID -// 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.ID -{ - public static class CloudID - { - public const int Regular1 = 0; - public const int Regular2 = 1; - public const int Regular3 = 2; - public const int Regular4 = 3; - public const int CirroCumulus1 = 4; - public const int CirroCumulus2 = 5; - public const int CirroCumulus3 = 6; - public const int CirroCumulus4 = 7; - public const int CirroCumulus5 = 8; - public const int Cirrus1 = 9; - public const int Cirrus2 = 10; - public const int Cirrus3 = 11; - public const int Cirrus4 = 12; - public const int Cirrus5 = 13; - public const int Cummulus1 = 14; - public const int Cummulus2 = 15; - public const int Cummulus3 = 16; - public const int Cummulus4 = 17; - public const int Cumulonimbus1 = 18; - public const int Cumulonimbus2 = 19; - public const int Cumulonimbus3 = 20; - public const int Cumulonimbus4 = 21; - public const int Rare_Bird = 22; - public const int Rare_Bunny = 23; - public const int Rare_Eater = 24; - public const int Rare_EOC1 = 25; - public const int Rare_EOC2 = 26; - public const int Rare_Goldfish = 27; - public const int Rare_Redigit = 28; - public const int Rare_Heart = 29; - public const int Rare_Pumpking = 30; - public const int Rare_Skeletron = 31; - public const int Rare_Star = 32; - public const int Rare_Sword = 33; - public const int Rare_Tree = 34; - public const int Rare_Wyvern = 35; - public const int Rare_BOC = 36; - public const int Count = 37; - } -} diff --git a/ID/Colors.cs b/ID/Colors.cs index a8ab99a..c08fc1b 100644 --- a/ID/Colors.cs +++ b/ID/Colors.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.Colors -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -26,16 +26,8 @@ namespace Terraria.ID public static readonly Color CoinGold = new Color(224, 201, 92); public static readonly Color CoinSilver = new Color(181, 192, 193); public static readonly Color CoinCopper = new Color(246, 138, 96); - public static readonly Color AmbientNPCGastropodLight = new Color(102, 0, 63); - public static readonly Color JourneyMode = Color.Lerp(Color.HotPink, Color.White, 0.1f); - public static readonly Color Mediumcore = new Color(1f, 0.6f, 0.0f); - public static readonly Color Hardcore = new Color(1f, 0.15f, 0.1f); - public static readonly Color LanternBG = new Color(120, 50, 20); public static readonly Color[] _waterfallColors; public static readonly Color[] _liquidColors; - public static readonly Color FancyUIFatButtonMouseOver; - public static readonly Color InventoryDefaultColor; - public static readonly Color InventoryDefaultColorWithOpacity; public static Color CurrentLiquidColor { @@ -62,8 +54,6 @@ namespace Terraria.ID public static Color AlphaDarken(Color input) => input * ((float) Main.mouseTextColor / (float) byte.MaxValue); - public static Color GetSelectionGlowColor(bool isTileSelected, int averageTileLighting) => !isTileSelected ? new Color(averageTileLighting / 2, averageTileLighting / 2, averageTileLighting / 2, averageTileLighting) : new Color(averageTileLighting, averageTileLighting, averageTileLighting / 3, averageTileLighting); - static Colors() { Color[] colorArray = new Color[22]; @@ -103,9 +93,6 @@ namespace Terraria.ID new Color(177, 54, 79), new Color((int) byte.MaxValue, 156, 12) }; - Colors.FancyUIFatButtonMouseOver = Main.OurFavoriteColor; - Colors.InventoryDefaultColor = new Color(63, 65, 151, (int) byte.MaxValue); - Colors.InventoryDefaultColorWithOpacity = new Color(63, 65, 151, (int) byte.MaxValue) * 0.785f; } } } diff --git a/ID/ContentSamples.cs b/ID/ContentSamples.cs deleted file mode 100644 index 20495e2..0000000 --- a/ID/ContentSamples.cs +++ /dev/null @@ -1,887 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.ID.ContentSamples -// 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.GameContent.Bestiary; -using Terraria.Graphics.Shaders; - -namespace Terraria.ID -{ - public static class ContentSamples - { - public static Dictionary NpcsByNetId = new Dictionary(); - public static Dictionary ProjectilesByType = new Dictionary(); - public static Dictionary ItemsByType = new Dictionary(); - public static Dictionary ItemNetIdsByPersistentIds = new Dictionary(); - public static Dictionary ItemPersistentIdsByNetIds = new Dictionary(); - public static Dictionary NpcNetIdsByPersistentIds = new Dictionary(); - public static Dictionary NpcPersistentIdsByNetIds = new Dictionary(); - public static Dictionary NpcBestiarySortingId = new Dictionary(); - public static Dictionary NpcBestiaryRarityStars = new Dictionary(); - public static Dictionary NpcBestiaryCreditIdsByNpcNetIds = new Dictionary(); - public static Dictionary ItemCreativeSortingId = new Dictionary(); - - public static void Initialize() - { - ContentSamples.NpcsByNetId.Clear(); - ContentSamples.NpcNetIdsByPersistentIds.Clear(); - ContentSamples.NpcPersistentIdsByNetIds.Clear(); - ContentSamples.NpcBestiarySortingId.Clear(); - for (int index = -65; index < 663; ++index) - { - NPC npc = new NPC(); - npc.SetDefaults(index); - ContentSamples.NpcsByNetId[index] = npc; - string name = NPCID.Search.GetName(npc.netID); - ContentSamples.NpcPersistentIdsByNetIds[index] = name; - ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[index] = name; - ContentSamples.NpcNetIdsByPersistentIds[name] = index; - } - ContentSamples.ModifyNPCIds(); - ContentSamples.ProjectilesByType.Clear(); - for (int index = 0; index < 950; ++index) - { - Projectile projectile = new Projectile(); - projectile.SetDefaults(index); - ContentSamples.ProjectilesByType[index] = projectile; - } - ContentSamples.ItemsByType.Clear(); - for (int index = 0; index < 5045; ++index) - { - Item obj = new Item(); - obj.SetDefaults(index); - ContentSamples.ItemsByType[index] = obj; - string name = ItemID.Search.GetName(obj.netID); - ContentSamples.ItemPersistentIdsByNetIds[index] = name; - ContentSamples.ItemNetIdsByPersistentIds[name] = index; - } - foreach (int num in ItemID.Sets.ItemsThatAreProcessedAfterNormalContentSample) - { - Item obj = new Item(); - obj.SetDefaults(num); - ContentSamples.ItemsByType[num] = obj; - string name = ItemID.Search.GetName(obj.netID); - ContentSamples.ItemPersistentIdsByNetIds[num] = name; - ContentSamples.ItemNetIdsByPersistentIds[name] = num; - } - ContentSamples.FillNpcRarities(); - } - - public static void FixItemsAfterRecipesAreAdded() - { - foreach (KeyValuePair keyValuePair in ContentSamples.ItemsByType) - keyValuePair.Value.material = ItemID.Sets.IsAMaterial[keyValuePair.Key]; - } - - public static void RebuildBestiarySortingIDsByBestiaryDatabaseContents(BestiaryDatabase database) - { - ContentSamples.NpcBestiarySortingId.Clear(); - ContentSamples.CreateBestiarySortingIds(database); - } - - public static void RebuildItemCreativeSortingIDsAfterRecipesAreSetUp() - { - ContentSamples.ItemCreativeSortingId.Clear(); - ContentSamples.CreateCreativeItemSortingIds(); - } - - private static void ModifyNPCIds() - { - Dictionary creditIdsByNpcNetIds = ContentSamples.NpcBestiaryCreditIdsByNpcNetIds; - creditIdsByNpcNetIds[-65] = creditIdsByNpcNetIds[42]; - creditIdsByNpcNetIds[-64] = creditIdsByNpcNetIds[42]; - creditIdsByNpcNetIds[-63] = creditIdsByNpcNetIds[42]; - creditIdsByNpcNetIds[-62] = creditIdsByNpcNetIds[42]; - creditIdsByNpcNetIds[-61] = creditIdsByNpcNetIds[42]; - creditIdsByNpcNetIds[-60] = creditIdsByNpcNetIds[42]; - creditIdsByNpcNetIds[-59] = creditIdsByNpcNetIds[42]; - creditIdsByNpcNetIds[-58] = creditIdsByNpcNetIds[42]; - creditIdsByNpcNetIds[-57] = creditIdsByNpcNetIds[42]; - creditIdsByNpcNetIds[-56] = creditIdsByNpcNetIds[42]; - creditIdsByNpcNetIds[-55] = creditIdsByNpcNetIds[223]; - creditIdsByNpcNetIds[-54] = creditIdsByNpcNetIds[223]; - creditIdsByNpcNetIds[-53] = creditIdsByNpcNetIds[21]; - creditIdsByNpcNetIds[-52] = creditIdsByNpcNetIds[21]; - creditIdsByNpcNetIds[-51] = creditIdsByNpcNetIds[21]; - creditIdsByNpcNetIds[-50] = creditIdsByNpcNetIds[21]; - creditIdsByNpcNetIds[-49] = creditIdsByNpcNetIds[21]; - creditIdsByNpcNetIds[-48] = creditIdsByNpcNetIds[21]; - creditIdsByNpcNetIds[-47] = creditIdsByNpcNetIds[21]; - creditIdsByNpcNetIds[-46] = creditIdsByNpcNetIds[21]; - creditIdsByNpcNetIds[-45] = creditIdsByNpcNetIds[3]; - creditIdsByNpcNetIds[-44] = creditIdsByNpcNetIds[3]; - creditIdsByNpcNetIds[-43] = creditIdsByNpcNetIds[2]; - creditIdsByNpcNetIds[-42] = creditIdsByNpcNetIds[2]; - creditIdsByNpcNetIds[-41] = creditIdsByNpcNetIds[2]; - creditIdsByNpcNetIds[-40] = creditIdsByNpcNetIds[2]; - creditIdsByNpcNetIds[-39] = creditIdsByNpcNetIds[2]; - creditIdsByNpcNetIds[-38] = creditIdsByNpcNetIds[2]; - creditIdsByNpcNetIds[-37] = creditIdsByNpcNetIds[3]; - creditIdsByNpcNetIds[-36] = creditIdsByNpcNetIds[3]; - creditIdsByNpcNetIds[-35] = creditIdsByNpcNetIds[3]; - creditIdsByNpcNetIds[-34] = creditIdsByNpcNetIds[3]; - creditIdsByNpcNetIds[-33] = creditIdsByNpcNetIds[3]; - creditIdsByNpcNetIds[-32] = creditIdsByNpcNetIds[3]; - creditIdsByNpcNetIds[-31] = creditIdsByNpcNetIds[186]; - creditIdsByNpcNetIds[-30] = creditIdsByNpcNetIds[186]; - creditIdsByNpcNetIds[-27] = creditIdsByNpcNetIds[3]; - creditIdsByNpcNetIds[-26] = creditIdsByNpcNetIds[3]; - creditIdsByNpcNetIds[-23] = creditIdsByNpcNetIds[173]; - creditIdsByNpcNetIds[-22] = creditIdsByNpcNetIds[173]; - creditIdsByNpcNetIds[-25] = creditIdsByNpcNetIds[183]; - creditIdsByNpcNetIds[-24] = creditIdsByNpcNetIds[183]; - creditIdsByNpcNetIds[-21] = creditIdsByNpcNetIds[176]; - creditIdsByNpcNetIds[-20] = creditIdsByNpcNetIds[176]; - creditIdsByNpcNetIds[-19] = creditIdsByNpcNetIds[176]; - creditIdsByNpcNetIds[-18] = creditIdsByNpcNetIds[176]; - creditIdsByNpcNetIds[-17] = creditIdsByNpcNetIds[42]; - creditIdsByNpcNetIds[-16] = creditIdsByNpcNetIds[42]; - creditIdsByNpcNetIds[-15] = creditIdsByNpcNetIds[77]; - creditIdsByNpcNetIds[-14] = creditIdsByNpcNetIds[31]; - creditIdsByNpcNetIds[-13] = creditIdsByNpcNetIds[31]; - creditIdsByNpcNetIds[-12] = creditIdsByNpcNetIds[6]; - creditIdsByNpcNetIds[-11] = creditIdsByNpcNetIds[6]; - creditIdsByNpcNetIds[497] = creditIdsByNpcNetIds[496]; - creditIdsByNpcNetIds[495] = creditIdsByNpcNetIds[494]; - short num = 499; - for (int key = 498; key <= 506; ++key) - creditIdsByNpcNetIds[key] = creditIdsByNpcNetIds[(int) num]; - creditIdsByNpcNetIds[591] = creditIdsByNpcNetIds[590]; - creditIdsByNpcNetIds[430] = creditIdsByNpcNetIds[3]; - creditIdsByNpcNetIds[436] = creditIdsByNpcNetIds[200]; - creditIdsByNpcNetIds[431] = creditIdsByNpcNetIds[161]; - creditIdsByNpcNetIds[432] = creditIdsByNpcNetIds[186]; - creditIdsByNpcNetIds[433] = creditIdsByNpcNetIds[187]; - creditIdsByNpcNetIds[434] = creditIdsByNpcNetIds[188]; - creditIdsByNpcNetIds[435] = creditIdsByNpcNetIds[189]; - creditIdsByNpcNetIds[164] = creditIdsByNpcNetIds[165]; - creditIdsByNpcNetIds[236] = creditIdsByNpcNetIds[237]; - creditIdsByNpcNetIds[163] = creditIdsByNpcNetIds[238]; - creditIdsByNpcNetIds[239] = creditIdsByNpcNetIds[240]; - creditIdsByNpcNetIds[530] = creditIdsByNpcNetIds[531]; - creditIdsByNpcNetIds[449] = creditIdsByNpcNetIds[21]; - creditIdsByNpcNetIds[450] = creditIdsByNpcNetIds[201]; - creditIdsByNpcNetIds[451] = creditIdsByNpcNetIds[202]; - creditIdsByNpcNetIds[452] = creditIdsByNpcNetIds[203]; - creditIdsByNpcNetIds[595] = creditIdsByNpcNetIds[599]; - creditIdsByNpcNetIds[596] = creditIdsByNpcNetIds[599]; - creditIdsByNpcNetIds[597] = creditIdsByNpcNetIds[599]; - creditIdsByNpcNetIds[598] = creditIdsByNpcNetIds[599]; - creditIdsByNpcNetIds[600] = creditIdsByNpcNetIds[599]; - creditIdsByNpcNetIds[230] = creditIdsByNpcNetIds[55]; - creditIdsByNpcNetIds[593] = creditIdsByNpcNetIds[592]; - creditIdsByNpcNetIds[-2] = creditIdsByNpcNetIds[121]; - creditIdsByNpcNetIds[195] = creditIdsByNpcNetIds[196]; - creditIdsByNpcNetIds[198] = creditIdsByNpcNetIds[199]; - creditIdsByNpcNetIds[158] = creditIdsByNpcNetIds[159]; - creditIdsByNpcNetIds[568] = creditIdsByNpcNetIds[569]; - creditIdsByNpcNetIds[566] = creditIdsByNpcNetIds[567]; - creditIdsByNpcNetIds[576] = creditIdsByNpcNetIds[577]; - creditIdsByNpcNetIds[558] = creditIdsByNpcNetIds[560]; - creditIdsByNpcNetIds[559] = creditIdsByNpcNetIds[560]; - creditIdsByNpcNetIds[552] = creditIdsByNpcNetIds[554]; - creditIdsByNpcNetIds[553] = creditIdsByNpcNetIds[554]; - creditIdsByNpcNetIds[564] = creditIdsByNpcNetIds[565]; - creditIdsByNpcNetIds[570] = creditIdsByNpcNetIds[571]; - creditIdsByNpcNetIds[555] = creditIdsByNpcNetIds[557]; - creditIdsByNpcNetIds[556] = creditIdsByNpcNetIds[557]; - creditIdsByNpcNetIds[574] = creditIdsByNpcNetIds[575]; - creditIdsByNpcNetIds[561] = creditIdsByNpcNetIds[563]; - creditIdsByNpcNetIds[562] = creditIdsByNpcNetIds[563]; - creditIdsByNpcNetIds[572] = creditIdsByNpcNetIds[573]; - creditIdsByNpcNetIds[14] = creditIdsByNpcNetIds[13]; - creditIdsByNpcNetIds[15] = creditIdsByNpcNetIds[13]; - } - - private static void CreateBestiarySortingIds(BestiaryDatabase database) - { - List> bestiaryEntriesList = ContentSamples.BestiaryHelper.GetSortedBestiaryEntriesList(database); - int num = 1; - foreach (KeyValuePair keyValuePair in bestiaryEntriesList) - { - ContentSamples.NpcBestiarySortingId[keyValuePair.Key] = num; - ++num; - } - } - - private static void FillNpcRarities() - { - NPCSpawnParams spawnparams = new NPCSpawnParams() - { - gameModeData = Main.RegisterdGameModes[0] - }; - for (int index = -65; index < 663; ++index) - { - NPC npc = new NPC(); - npc.SetDefaults(index, spawnparams); - ContentSamples.NpcBestiaryRarityStars[index] = ContentSamples.GetNPCBestiaryRarityStarsCount(npc); - } - ContentSamples.NpcBestiaryRarityStars[22] = 1; - ContentSamples.NpcBestiaryRarityStars[17] = 1; - ContentSamples.NpcBestiaryRarityStars[18] = 1; - ContentSamples.NpcBestiaryRarityStars[38] = 1; - ContentSamples.NpcBestiaryRarityStars[369] = 2; - ContentSamples.NpcBestiaryRarityStars[20] = 3; - ContentSamples.NpcBestiaryRarityStars[19] = 1; - ContentSamples.NpcBestiaryRarityStars[227] = 2; - ContentSamples.NpcBestiaryRarityStars[353] = 2; - ContentSamples.NpcBestiaryRarityStars[550] = 2; - ContentSamples.NpcBestiaryRarityStars[588] = 2; - ContentSamples.NpcBestiaryRarityStars[107] = 3; - ContentSamples.NpcBestiaryRarityStars[228] = 2; - ContentSamples.NpcBestiaryRarityStars[124] = 2; - ContentSamples.NpcBestiaryRarityStars[54] = 2; - ContentSamples.NpcBestiaryRarityStars[108] = 3; - ContentSamples.NpcBestiaryRarityStars[178] = 3; - ContentSamples.NpcBestiaryRarityStars[216] = 3; - ContentSamples.NpcBestiaryRarityStars[160] = 5; - ContentSamples.NpcBestiaryRarityStars[441] = 5; - ContentSamples.NpcBestiaryRarityStars[209] = 3; - ContentSamples.NpcBestiaryRarityStars[208] = 4; - ContentSamples.NpcBestiaryRarityStars[142] = 5; - ContentSamples.NpcBestiaryRarityStars[368] = 3; - ContentSamples.NpcBestiaryRarityStars[453] = 4; - ContentSamples.NpcBestiaryRarityStars[37] = 2; - ContentSamples.NpcBestiaryRarityStars[633] = 5; - ContentSamples.NpcBestiaryRarityStars[638] = 3; - ContentSamples.NpcBestiaryRarityStars[637] = 3; - ContentSamples.NpcBestiaryRarityStars[656] = 3; - ContentSamples.NpcBestiaryRarityStars[484] = 5; - ContentSamples.NpcBestiaryRarityStars[614] = 4; - ContentSamples.NpcBestiaryRarityStars[303] = 4; - ContentSamples.NpcBestiaryRarityStars[337] = 4; - ContentSamples.NpcBestiaryRarityStars[360] = 3; - ContentSamples.NpcBestiaryRarityStars[655] = 2; - ContentSamples.NpcBestiaryRarityStars[374] = 3; - ContentSamples.NpcBestiaryRarityStars[661] = 3; - ContentSamples.NpcBestiaryRarityStars[362] = 2; - ContentSamples.NpcBestiaryRarityStars[364] = 2; - ContentSamples.NpcBestiaryRarityStars[616] = 2; - ContentSamples.NpcBestiaryRarityStars[298] = 2; - ContentSamples.NpcBestiaryRarityStars[599] = 3; - ContentSamples.NpcBestiaryRarityStars[355] = 2; - ContentSamples.NpcBestiaryRarityStars[358] = 3; - ContentSamples.NpcBestiaryRarityStars[654] = 3; - ContentSamples.NpcBestiaryRarityStars[653] = 2; - ContentSamples.NpcBestiaryRarityStars[540] = 2; - ContentSamples.NpcBestiaryRarityStars[604] = 3; - ContentSamples.NpcBestiaryRarityStars[611] = 3; - ContentSamples.NpcBestiaryRarityStars[612] = 2; - ContentSamples.NpcBestiaryRarityStars[608] = 2; - ContentSamples.NpcBestiaryRarityStars[607] = 2; - ContentSamples.NpcBestiaryRarityStars[615] = 3; - ContentSamples.NpcBestiaryRarityStars[626] = 2; - ContentSamples.NpcBestiaryRarityStars[485] = 2; - ContentSamples.NpcBestiaryRarityStars[487] = 3; - ContentSamples.NpcBestiaryRarityStars[149] = 2; - ContentSamples.NpcBestiaryRarityStars[366] = 2; - ContentSamples.NpcBestiaryRarityStars[47] = 3; - ContentSamples.NpcBestiaryRarityStars[57] = 3; - ContentSamples.NpcBestiaryRarityStars[168] = 3; - ContentSamples.NpcBestiaryRarityStars[464] = 3; - ContentSamples.NpcBestiaryRarityStars[465] = 3; - ContentSamples.NpcBestiaryRarityStars[470] = 3; - ContentSamples.NpcBestiaryRarityStars[301] = 2; - ContentSamples.NpcBestiaryRarityStars[316] = 3; - ContentSamples.NpcBestiaryRarityStars[546] = 2; - ContentSamples.NpcBestiaryRarityStars[170] = 3; - ContentSamples.NpcBestiaryRarityStars[180] = 3; - ContentSamples.NpcBestiaryRarityStars[171] = 3; - ContentSamples.NpcBestiaryRarityStars[29] = 2; - ContentSamples.NpcBestiaryRarityStars[471] = 4; - ContentSamples.NpcBestiaryRarityStars[66] = 3; - ContentSamples.NpcBestiaryRarityStars[223] = 2; - ContentSamples.NpcBestiaryRarityStars[161] = 2; - ContentSamples.NpcBestiaryRarityStars[491] = 4; - ContentSamples.NpcBestiaryRarityStars[-9] = 3; - ContentSamples.NpcBestiaryRarityStars[594] = 2; - ContentSamples.NpcBestiaryRarityStars[628] = 2; - ContentSamples.NpcBestiaryRarityStars[225] = 2; - ContentSamples.NpcBestiaryRarityStars[224] = 2; - ContentSamples.NpcBestiaryRarityStars[250] = 3; - ContentSamples.NpcBestiaryRarityStars[16] = 2; - ContentSamples.NpcBestiaryRarityStars[481] = 2; - ContentSamples.NpcBestiaryRarityStars[483] = 2; - ContentSamples.NpcBestiaryRarityStars[184] = 2; - ContentSamples.NpcBestiaryRarityStars[185] = 3; - ContentSamples.NpcBestiaryRarityStars[206] = 3; - ContentSamples.NpcBestiaryRarityStars[541] = 4; - ContentSamples.NpcBestiaryRarityStars[537] = 2; - ContentSamples.NpcBestiaryRarityStars[205] = 4; - ContentSamples.NpcBestiaryRarityStars[499] = 2; - ContentSamples.NpcBestiaryRarityStars[494] = 2; - ContentSamples.NpcBestiaryRarityStars[496] = 2; - ContentSamples.NpcBestiaryRarityStars[302] = 3; - ContentSamples.NpcBestiaryRarityStars[317] = 3; - ContentSamples.NpcBestiaryRarityStars[318] = 3; - ContentSamples.NpcBestiaryRarityStars[319] = 3; - ContentSamples.NpcBestiaryRarityStars[320] = 3; - ContentSamples.NpcBestiaryRarityStars[321] = 3; - ContentSamples.NpcBestiaryRarityStars[331] = 3; - ContentSamples.NpcBestiaryRarityStars[332] = 3; - ContentSamples.NpcBestiaryRarityStars[322] = 3; - ContentSamples.NpcBestiaryRarityStars[323] = 3; - ContentSamples.NpcBestiaryRarityStars[324] = 3; - ContentSamples.NpcBestiaryRarityStars[335] = 3; - ContentSamples.NpcBestiaryRarityStars[336] = 3; - ContentSamples.NpcBestiaryRarityStars[333] = 3; - ContentSamples.NpcBestiaryRarityStars[334] = 3; - ContentSamples.NpcBestiaryRarityStars[4] = 2; - ContentSamples.NpcBestiaryRarityStars[50] = 2; - ContentSamples.NpcBestiaryRarityStars[35] = 3; - ContentSamples.NpcBestiaryRarityStars[13] = 3; - ContentSamples.NpcBestiaryRarityStars[134] = 4; - ContentSamples.NpcBestiaryRarityStars[262] = 4; - } - - private static int GetNPCBestiaryRarityStarsCount(NPC npc) - { - float num1 = 1f + (float) npc.rarity; - if (npc.rarity == 1) - ++num1; - else if (npc.rarity == 2) - num1 += 1.5f; - else if (npc.rarity == 3) - num1 += 2f; - else if (npc.rarity == 4) - num1 += 2.5f; - else if (npc.rarity == 5) - num1 += 3f; - else if (npc.rarity > 0) - num1 += 3.5f; - if (npc.boss) - num1 += 0.5f; - int num2 = npc.damage + npc.defense + npc.lifeMax / 4; - if (num2 > 10000) - num1 += 3.5f; - else if (num2 > 5000) - num1 += 3f; - else if (num2 > 1000) - num1 += 2.5f; - else if (num2 > 500) - num1 += 2f; - else if (num2 > 150) - num1 += 1.5f; - else if (num2 > 50) - ++num1; - if ((double) num1 > 5.0) - num1 = 5f; - return (int) num1; - } - - private static void CreateCreativeItemSortingIds() => ContentSamples.CreativeHelper.SetCreativeMenuOrder(); - - public static class CommonlyUsedContentSamples - { - public static int TeamDyeShaderIndex = -1; - public static int ColorOnlyShaderIndex = -1; - - public static void PrepareAfterEverythingElseLoaded() - { - ContentSamples.CommonlyUsedContentSamples.TeamDyeShaderIndex = (int) GameShaders.Hair.GetShaderIdFromItemId(1984); - ContentSamples.CommonlyUsedContentSamples.ColorOnlyShaderIndex = GameShaders.Armor.GetShaderIdFromItemId(3978); - } - } - - public static class CreativeHelper - { - private static List _manualEventItemsOrder = new List() - { - 361, - 1315, - 2767, - 602, - 1844, - 1958 - }; - private static List _manualBossSpawnItemsOrder = new List() - { - 43, - 560, - 70, - 1331, - 1133, - 1307, - 267, - 4988, - 544, - 557, - 556, - 1293, - 2673, - 4961, - 3601 - }; - private static List _manualGolfItemsOrder = new List() - { - 4095, - 4596, - 4597, - 4595, - 4598, - 4592, - 4593, - 4591, - 4594, - 4092, - 4093, - 4039, - 4094, - 4588, - 4589, - 4587, - 4590, - 3989, - 4242, - 4243, - 4244, - 4245, - 4246, - 4247, - 4248, - 4249, - 4250, - 4251, - 4252, - 4253, - 4254, - 4255, - 4040, - 4086, - 4085, - 4088, - 4084, - 4083, - 4087 - }; - - public static ContentSamples.CreativeHelper.ItemGroup GetItemGroup( - Item item, - out int orderInGroup) - { - orderInGroup = 0; - int num1 = ContentSamples.CreativeHelper._manualGolfItemsOrder.IndexOf(item.type); - if (num1 != -1) - { - orderInGroup = num1; - return ContentSamples.CreativeHelper.ItemGroup.Golf; - } - int num2 = ItemID.Sets.SortingPriorityWiring[item.type]; - if (num2 != -1) - { - orderInGroup = -num2; - return ContentSamples.CreativeHelper.ItemGroup.Wiring; - } - if (item.type == 3620) - return ContentSamples.CreativeHelper.ItemGroup.Wiring; - if (item.type == 327 || item.type == 329 || item.type == 1141 || item.type == 1533 || item.type == 1537 || item.type == 1536 || item.type == 1534 || item.type == 1535 || item.type == 3092 || item.type == 3091 || item.type == 4714) - { - orderInGroup = -item.rare; - return ContentSamples.CreativeHelper.ItemGroup.Keys; - } - if (item.type == 985 || item.type == 3079 || item.type == 3005 || item.type == 3080) - return ContentSamples.CreativeHelper.ItemGroup.Rope; - if (item.type == 781 || item.type == 783 || item.type == 780 || item.type == 782 || item.type == 784) - return ContentSamples.CreativeHelper.ItemGroup.Solutions; - if (item.type == 282 || item.type == 3112 || item.type == 4776 || item.type == 3002 || item.type == 286) - { - if (item.type == 282) - orderInGroup = -1; - return ContentSamples.CreativeHelper.ItemGroup.Glowsticks; - } - if (item.type == 166 || item.type == 3115 || item.type == 235 || item.type == 167 || item.type == 3547 || item.type == 2896 || item.type == 3196 || item.type == 4908 || item.type == 4909 || item.type == 4827 || item.type == 4826 || item.type == 4825 || item.type == 4423 || item.type == 4824) - return ContentSamples.CreativeHelper.ItemGroup.Bombs; - if (item.createTile == 376) - return ContentSamples.CreativeHelper.ItemGroup.Crates; - if (item.type == 1774 || item.type == 1869 || item.type == 4345 || item.type == 3093 || item.type == 4410) - return ContentSamples.CreativeHelper.ItemGroup.GoodieBags; - if (item.type >= 3318 && item.type <= 3332 || item.type >= 3860 && item.type <= 3862 || item.type == 4782 || item.type == 4957) - return ContentSamples.CreativeHelper.ItemGroup.BossBags; - if (item.type == 1115 || item.type == 1114 || item.type == 1110 || item.type == 1112 || item.type == 1108 || item.type == 1107 || item.type == 1116 || item.type == 1109 || item.type == 1111 || item.type == 1118 || item.type == 1117 || item.type == 1113 || item.type == 1119) - return ContentSamples.CreativeHelper.ItemGroup.DyeMaterial; - if (item.type == 3385 || item.type == 3386 || item.type == 3387 || item.type == 3388) - { - orderInGroup = -1; - return ContentSamples.CreativeHelper.ItemGroup.DyeMaterial; - } - if (item.dye != (byte) 0) - return ContentSamples.CreativeHelper.ItemGroup.Dye; - if (item.hairDye != (short) -1) - return ContentSamples.CreativeHelper.ItemGroup.HairDye; - if (item.IsACoin) - { - if (item.type == 71) - orderInGroup = 4; - else if (item.type == 72) - orderInGroup = 3; - else if (item.type == 73) - orderInGroup = 2; - else if (item.type == 74) - orderInGroup = 1; - return ContentSamples.CreativeHelper.ItemGroup.Coin; - } - if (item.createWall > 0) - return ContentSamples.CreativeHelper.ItemGroup.Walls; - if (item.createTile == 82) - return ContentSamples.CreativeHelper.ItemGroup.AlchemySeeds; - if (item.type == 315 || item.type == 313 || item.type == 316 || item.type == 318 || item.type == 314 || item.type == 2358 || item.type == 317) - return ContentSamples.CreativeHelper.ItemGroup.AlchemyPlants; - if (item.createTile == 30 || item.createTile == 321 || item.createTile == 322 || item.createTile == 157 || item.createTile == 158 || item.createTile == 208 || item.createTile == 159 || item.createTile == 253 || item.createTile == 311) - { - orderInGroup = item.createTile != 30 ? (item.createTile != 311 ? 50 : 100) : 0; - return ContentSamples.CreativeHelper.ItemGroup.Wood; - } - if (item.createTile >= 0) - { - if (item.type == 213) - { - orderInGroup = -1; - return ContentSamples.CreativeHelper.ItemGroup.Pickaxe; - } - if (item.tileWand >= 0) - return ContentSamples.CreativeHelper.ItemGroup.Wands; - if (item.createTile == 213 || item.createTile == 353 || item.createTile == 365 || item.createTile == 366 || item.createTile == 214) - return ContentSamples.CreativeHelper.ItemGroup.Rope; - if (!Main.tileSolid[item.createTile] || Main.tileSolidTop[item.createTile] || item.createTile == 10) - { - if (item.createTile == 4) - { - orderInGroup = item.placeStyle != 0 ? 10 : 5; - return ContentSamples.CreativeHelper.ItemGroup.Torches; - } - orderInGroup = item.createTile != 178 ? (item.createTile != 239 ? (item.type == 27 || item.type == 4857 || item.type == 4852 || item.type == 4856 || item.type == 4854 || item.type == 4855 || item.type == 4853 || item.type == 4851 ? 8 : (!TileID.Sets.Platforms[item.createTile] ? (item.createTile != 18 ? (item.createTile == 16 || item.createTile == 134 ? (item.placeStyle != 0 ? 40 : 39) : (item.createTile == 133 || item.createTile == 17 ? (item.placeStyle != 0 ? 50 : 49) : (item.createTile != 10 ? (item.createTile != 15 ? (item.createTile != 497 ? (item.createTile != 79 ? (item.createTile != 14 ? (item.createTile != 469 ? (item.createTile != 21 ? (item.createTile != 467 ? (item.createTile != 441 ? (item.createTile != 468 ? item.createTile + 1000 : 130) : 120) : 110) : (item.placeStyle != 0 ? 100 : 99)) : 90) : (item.placeStyle != 0 ? 80 : 79)) : (item.placeStyle != 0 ? 75 : 74)) : 72) : (item.placeStyle != 0 ? 70 : 69)) : (item.placeStyle != 0 ? 60 : 59)))) : (item.placeStyle != 0 ? 30 : 29)) : (item.placeStyle != 0 ? 20 : 19))) : 7) : 5; - return ContentSamples.CreativeHelper.ItemGroup.PlacableObjects; - } - orderInGroup = TileID.Sets.Conversion.Grass[item.createTile] || item.type == 194 ? 5 : 10000; - if (item.type == 2) - orderInGroup = 10; - else if (item.type == 3) - orderInGroup = 20; - else if (item.type == 133) - orderInGroup = 30; - else if (item.type == 424) - orderInGroup = 40; - else if (item.type == 1103) - orderInGroup = 50; - else if (item.type == 169) - orderInGroup = 60; - else if (item.type == 170) - orderInGroup = 70; - else if (item.type == 176) - orderInGroup = 80; - else if (item.type == 276) - orderInGroup = 80; - return ContentSamples.CreativeHelper.ItemGroup.Blocks; - } - if (item.mountType != -1) - return MountID.Sets.Cart[item.mountType] ? ContentSamples.CreativeHelper.ItemGroup.Minecart : ContentSamples.CreativeHelper.ItemGroup.Mount; - if (item.bait > 0) - { - orderInGroup = -item.bait; - return ContentSamples.CreativeHelper.ItemGroup.FishingBait; - } - if (item.makeNPC > (short) 0) - return ContentSamples.CreativeHelper.ItemGroup.Critters; - if (item.fishingPole > 1) - { - orderInGroup = -item.fishingPole; - return ContentSamples.CreativeHelper.ItemGroup.FishingRods; - } - if (item.questItem) - return ContentSamples.CreativeHelper.ItemGroup.FishingQuestFish; - if (item.type >= 2297 && item.type <= 2321 || item.type == 4402 || item.type == 4401 || item.type == 2290) - { - orderInGroup = -item.rare; - return ContentSamples.CreativeHelper.ItemGroup.FishingQuestFish; - } - int num3 = ItemID.Sets.SortingPriorityPainting[item.type]; - if (num3 != -1 || item.paint != (byte) 0) - { - orderInGroup = -num3; - return ContentSamples.CreativeHelper.ItemGroup.Paint; - } - int num4 = ContentSamples.CreativeHelper._manualBossSpawnItemsOrder.IndexOf(item.type); - if (num4 != -1) - { - orderInGroup = num4; - return ContentSamples.CreativeHelper.ItemGroup.BossItem; - } - int num5 = ContentSamples.CreativeHelper._manualEventItemsOrder.IndexOf(item.type); - if (num5 != -1) - { - orderInGroup = num5; - return ContentSamples.CreativeHelper.ItemGroup.EventItem; - } - if (item.shoot != 0 && Main.projHook[item.shoot]) - return ContentSamples.CreativeHelper.ItemGroup.Hook; - if (item.type == 2756 || item.type == 2351 || item.type == 4870 || item.type == 2350 || item.type == 2997 || item.type == 2352 || item.type == 2353) - return ContentSamples.CreativeHelper.ItemGroup.BuffPotion; - if (item.buffType != 0) - { - if (BuffID.Sets.IsWellFed[item.buffType]) - { - orderInGroup = -item.buffType * 10000000 - item.buffTime; - return ContentSamples.CreativeHelper.ItemGroup.Food; - } - if (BuffID.Sets.IsAFlaskBuff[item.buffType]) - return ContentSamples.CreativeHelper.ItemGroup.Flask; - if (Main.vanityPet[item.buffType] || Main.lightPet[item.buffType]) - return ContentSamples.CreativeHelper.ItemGroup.VanityPet; - if (item.damage == -1) - return ContentSamples.CreativeHelper.ItemGroup.BuffPotion; - } - if (item.headSlot >= 0) - { - orderInGroup = -item.defense; - orderInGroup -= item.rare * 1000; - if (item.vanity) - orderInGroup += 100000; - return ContentSamples.CreativeHelper.ItemGroup.Headgear; - } - if (item.bodySlot >= 0) - { - orderInGroup = -item.defense; - orderInGroup -= item.rare * 1000; - if (item.vanity) - orderInGroup += 100000; - return ContentSamples.CreativeHelper.ItemGroup.Torso; - } - if (item.legSlot >= 0) - { - orderInGroup = -item.defense; - orderInGroup -= item.rare * 1000; - if (item.vanity) - orderInGroup += 100000; - return ContentSamples.CreativeHelper.ItemGroup.Pants; - } - if (item.accessory) - { - orderInGroup = item.vanity.ToInt() - item.expert.ToInt(); - if (item.type >= 3293 && item.type <= 3308) - orderInGroup -= 200000; - else if (item.type >= 3309 && item.type <= 3314) - orderInGroup -= 100000; - orderInGroup -= item.rare * 10000; - if (item.vanity) - orderInGroup += 100000; - return ContentSamples.CreativeHelper.ItemGroup.Accessories; - } - if (item.pick > 0) - { - orderInGroup = -item.pick; - return ContentSamples.CreativeHelper.ItemGroup.Pickaxe; - } - if (item.axe > 0) - { - orderInGroup = -item.axe; - return ContentSamples.CreativeHelper.ItemGroup.Axe; - } - if (item.hammer > 0) - { - orderInGroup = -item.hammer; - return ContentSamples.CreativeHelper.ItemGroup.Hammer; - } - if (item.healLife > 0) - { - orderInGroup = item.type != 3544 ? (item.type != 499 ? (item.type != 188 ? (item.type != 28 ? -item.healLife + 1000 : 3) : 2) : 1) : 0; - return ContentSamples.CreativeHelper.ItemGroup.LifePotions; - } - if (item.healMana > 0) - { - orderInGroup = -item.healMana; - return ContentSamples.CreativeHelper.ItemGroup.ManaPotions; - } - if (item.ammo != AmmoID.None && !item.notAmmo && item.type != 23 && item.type != 75) - { - orderInGroup = -item.ammo * 10000; - orderInGroup += -item.damage; - return ContentSamples.CreativeHelper.ItemGroup.Ammo; - } - if (item.consumable) - { - if (item.damage > 0) - { - orderInGroup = item.type == 422 || item.type == 423 || item.type == 3477 ? -100000 : -item.damage; - return ContentSamples.CreativeHelper.ItemGroup.ConsumableThatDamages; - } - if (item.type == 4910 || item.type == 4829 || item.type == 4830) - orderInGroup = 10; - else if (item.type == 66 || item.type == 2886 || item.type == 67) - orderInGroup = -10; - else if (item.type >= 1874 && item.type <= 1905) - orderInGroup = 5; - return ContentSamples.CreativeHelper.ItemGroup.ConsumableThatDoesNotDamage; - } - if (item.damage > 0) - { - orderInGroup = -item.damage; - if (item.melee) - return ContentSamples.CreativeHelper.ItemGroup.MeleeWeapon; - if (item.ranged) - return ContentSamples.CreativeHelper.ItemGroup.RangedWeapon; - if (item.magic) - return ContentSamples.CreativeHelper.ItemGroup.MagicWeapon; - if (item.summon) - return ContentSamples.CreativeHelper.ItemGroup.SummonWeapon; - } - orderInGroup = -item.rare; - if (item.useStyle > 0) - return ContentSamples.CreativeHelper.ItemGroup.RemainingUseItems; - return item.material ? ContentSamples.CreativeHelper.ItemGroup.Material : ContentSamples.CreativeHelper.ItemGroup.EverythingElse; - } - - public static void SetCreativeMenuOrder() - { - List source1 = new List(); - for (int Type = 1; Type < 5045; ++Type) - { - Item obj = new Item(); - obj.SetDefaults(Type); - source1.Add(obj); - } - IOrderedEnumerable> source2 = source1.Select((Func) (x => new ContentSamples.CreativeHelper.ItemGroupAndOrderInGroup(x))).GroupBy((Func) (x => x.Group)).OrderBy, int>((Func, int>) (group => (int) group.Key)); - foreach (IEnumerable groupAndOrderInGroups in (IEnumerable>) source2) - { - foreach (ContentSamples.CreativeHelper.ItemGroupAndOrderInGroup groupAndOrderInGroup in groupAndOrderInGroups) - ContentSamples.ItemCreativeSortingId[groupAndOrderInGroup.ItemType] = groupAndOrderInGroup; - } - source2.SelectMany, ContentSamples.CreativeHelper.ItemGroupAndOrderInGroup>((Func, IEnumerable>) (group => (IEnumerable) group.ToList())).ToList(); - } - - public static bool ShouldRemoveFromList(Item item) => ItemID.Sets.Deprecated[item.type]; - - public enum ItemGroup - { - Coin = 10, // 0x0000000A - Torches = 20, // 0x00000014 - Glowsticks = 25, // 0x00000019 - Wood = 30, // 0x0000001E - Bombs = 40, // 0x00000028 - LifePotions = 50, // 0x00000032 - ManaPotions = 51, // 0x00000033 - BuffPotion = 52, // 0x00000034 - Flask = 53, // 0x00000035 - Food = 54, // 0x00000036 - Crates = 60, // 0x0000003C - BossBags = 70, // 0x00000046 - GoodieBags = 80, // 0x00000050 - AlchemyPlants = 83, // 0x00000053 - AlchemySeeds = 84, // 0x00000054 - DyeMaterial = 87, // 0x00000057 - BossItem = 90, // 0x0000005A - EventItem = 91, // 0x0000005B - ConsumableThatDoesNotDamage = 94, // 0x0000005E - Solutions = 95, // 0x0000005F - Ammo = 96, // 0x00000060 - ConsumableThatDamages = 97, // 0x00000061 - PlacableObjects = 100, // 0x00000064 - Blocks = 120, // 0x00000078 - Wands = 130, // 0x00000082 - Rope = 140, // 0x0000008C - Walls = 150, // 0x00000096 - Wiring = 200, // 0x000000C8 - Pickaxe = 500, // 0x000001F4 - Axe = 510, // 0x000001FE - Hammer = 520, // 0x00000208 - MeleeWeapon = 530, // 0x00000212 - RangedWeapon = 540, // 0x0000021C - MagicWeapon = 550, // 0x00000226 - SummonWeapon = 560, // 0x00000230 - Headgear = 600, // 0x00000258 - Torso = 610, // 0x00000262 - Pants = 620, // 0x0000026C - Accessories = 630, // 0x00000276 - Hook = 700, // 0x000002BC - Mount = 710, // 0x000002C6 - Minecart = 720, // 0x000002D0 - VanityPet = 800, // 0x00000320 - LightPet = 810, // 0x0000032A - Golf = 900, // 0x00000384 - Dye = 910, // 0x0000038E - HairDye = 920, // 0x00000398 - Paint = 930, // 0x000003A2 - FishingRods = 1000, // 0x000003E8 - FishingQuestFish = 1010, // 0x000003F2 - Fish = 1015, // 0x000003F7 - FishingBait = 1020, // 0x000003FC - Critters = 1030, // 0x00000406 - Keys = 2000, // 0x000007D0 - RemainingUseItems = 5000, // 0x00001388 - Material = 10000, // 0x00002710 - EverythingElse = 11000, // 0x00002AF8 - } - - public struct ItemGroupAndOrderInGroup - { - public int ItemType; - public ContentSamples.CreativeHelper.ItemGroup Group; - public int OrderInGroup; - - public ItemGroupAndOrderInGroup(Item item) - { - this.ItemType = item.type; - this.Group = ContentSamples.CreativeHelper.GetItemGroup(item, out this.OrderInGroup); - } - } - } - - public static class BestiaryHelper - { - public static List> GetSortedBestiaryEntriesList( - BestiaryDatabase database) - { - List commonFilters = BestiaryDatabaseNPCsPopulator.CommonTags.GetCommonInfoElementsForFilters(); - List> list = ContentSamples.NpcsByNetId.ToList>().OrderBy, int>((Func, int>) (x => ContentSamples.BestiaryHelper.GetBestiaryTownPriority(x.Value))).ThenBy, bool>((Func, bool>) (x => !x.Value.isLikeATownNPC)).ThenBy, int>((Func, int>) (x => ContentSamples.BestiaryHelper.GetBestiaryNormalGoldCritterPriority(x.Value))).ThenBy, bool>((Func, bool>) (x => !x.Value.CountsAsACritter)).ThenBy, int>((Func, int>) (x => ContentSamples.BestiaryHelper.GetBestiaryBossPriority(x.Value))).ThenBy, bool>((Func, bool>) (x => x.Value.boss || NPCID.Sets.ShouldBeCountedAsBoss[x.Value.type])).ThenBy, int>((Func, int>) (x => ContentSamples.BestiaryHelper.GetLowestBiomeGroupIndex(x.Value, database, commonFilters))).ThenBy, int>((Func, int>) (x => x.Value.aiStyle)).ThenBy, float>((Func, float>) (x => ContentSamples.BestiaryHelper.GetBestiaryPowerLevel(x.Value))).ThenBy, int>((Func, int>) (x => ContentSamples.BestiaryHelper.GetBestiaryStarsPriority(x.Value))).ToList>(); - list.RemoveAll((Predicate>) (x => ContentSamples.BestiaryHelper.ShouldHideBestiaryEntry(x.Value))); - return list; - } - - public static int GetLowestBiomeGroupIndex( - NPC npc, - BestiaryDatabase database, - List commonElements) - { - List info = database.FindEntryByNPCID(npc.netID).Info; - for (int index = commonElements.Count - 1; index >= 0; --index) - { - if (info.IndexOf(commonElements[index]) != -1) - return index; - } - return int.MaxValue; - } - - public static bool ShouldHideBestiaryEntry(NPC npc) - { - NPCID.Sets.NPCBestiaryDrawModifiers bestiaryDrawModifiers; - return NPCID.Sets.NPCBestiaryDrawOffset.TryGetValue(npc.netID, out bestiaryDrawModifiers) && bestiaryDrawModifiers.Hide; - } - - public static float GetBestiaryPowerLevel(NPC npc) => (float) (npc.damage + npc.defense + npc.lifeMax / 4); - - public static int GetBestiaryTownPriority(NPC npc) - { - int num = NPCID.Sets.TownNPCBestiaryPriority.IndexOf(npc.netID); - if (num == -1) - num = int.MaxValue; - return num; - } - - public static int GetBestiaryNormalGoldCritterPriority(NPC npc) - { - int num = NPCID.Sets.NormalGoldCritterBestiaryPriority.IndexOf(npc.netID); - if (num == -1) - num = int.MaxValue; - return num; - } - - public static int GetBestiaryBossPriority(NPC npc) => NPCID.Sets.BossBestiaryPriority.IndexOf(npc.netID); - - public static int GetBestiaryStarsPriority(NPC npc) => ContentSamples.NpcBestiaryRarityStars[npc.type]; - } - } -} diff --git a/ID/CustomCurrencyID.cs b/ID/CustomCurrencyID.cs index f91e7e2..e5f7f2d 100644 --- a/ID/CustomCurrencyID.cs +++ b/ID/CustomCurrencyID.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.CustomCurrencyID -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.ID diff --git a/ID/DustID.cs b/ID/DustID.cs index cbb0395..9eac874 100644 --- a/ID/DustID.cs +++ b/ID/DustID.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.DustID -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.ID @@ -12,67 +12,36 @@ namespace Terraria.ID public const short Stone = 1; public const short Grass = 2; public const short GrassBlades = 3; - public const short TintableDust = 4; public const short Blood = 5; - public const short Torch = 6; + public const short Fire = 6; public const short Iron = 8; public const short Copper = 9; public const short Gold = 10; public const short Silver = 11; - public const short Cloud = 16; - public const short CorruptPlants = 17; - public const short CorruptGibs = 18; - public const short Bone = 26; public const short Shadowflame = 27; - public const short WaterCandle = 29; public const short Web = 30; public const short Smoke = 31; - public const short Sand = 32; - public const short Lava = 35; - public const short JunglePlants = 40; - public const short TintableDustLighted = 43; - public const short HallowedPlants = 47; - public const short BlueTorch = 59; - public const short RedTorch = 60; - public const short GreenTorch = 61; - public const short PurpleTorch = 62; - public const short WhiteTorch = 63; - public const short YellowTorch = 64; - public const short DemonTorch = 65; - public const short RainbowTorch = 66; + public const short Rainbow = 66; public const short BlueCrystalShard = 68; public const short PinkCrystalShard = 69; public const short PurpleCrystalShard = 70; - public const short CursedTorch = 75; public const short Ice = 80; public const short Tin = 81; public const short Lead = 82; public const short Tungsten = 83; public const short Platinum = 84; - public const short GreenMoss = 93; - public const short BrownMoss = 94; - public const short RedMoss = 95; - public const short BlueMoss = 96; - public const short PurpleMoss = 97; - public const short CrimsonPlants = 125; - public const short IceTorch = 135; public const short Confetti = 139; - public const short Honey = 152; - public const short UltraBrightTorch = 156; - public const short OrangeTorch = 158; - public const short IchorTorch = 169; public const short Fireworks = 219; public const short Electric = 226; public const short GoldFlame = 228; public const short Vortex = 229; - public const short BoneTorch = 234; public const short Marble = 236; public const short Mothron = 237; public const short MothronEgg = 238; public const short Silk = 239; public const short Granite = 240; public const short MarblePot = 241; - public const short PinkTorch = 242; + public const short PinkFlame = 242; public const short PinkSlime = 243; public const short CopperCoin = 244; public const short SilverCoin = 245; @@ -103,36 +72,7 @@ namespace Terraria.ID public const short WitherLightning = 272; public const short GreenBlood = 273; public const short ApprenticeStorm = 274; - public const short DungeonBlue = 275; - public const short DungeonGreen = 276; - public const short DungeonPink = 277; - public const short FireworksRGB = 278; - public const short SilverFlame = 279; - public const short BeachShell = 280; - public const short RedStarfish = 281; - public const short PinkStarfish = 282; - public const short YellowStarfish = 283; - public const short FoodPiece = 284; - public const short GolfPaticle = 285; - public const short OrangeStainedGlass = 286; - public const short DesertPot = 287; - public const short DesertWater2 = 288; - public const short SeaOatsOasis = 289; - public const short SeaOatsBeach = 290; - public const short OasisCactus = 291; - public const short YellowStarDust = 292; - public const short DesertTorch = 293; - public const short CoralTorch = 294; - public const short CorruptTorch = 295; - public const short CrimsonTorch = 296; - public const short HallowedTorch = 297; - public const short JungleTorch = 298; - public const short KryptonMoss = 299; - public const short XenonMoss = 300; - public const short ArgonMoss = 301; - public const short Terragrim = 302; - public const short SteampunkSteam = 303; - public const short Count = 304; + public const short Count = 275; public const short t_BorealWood = 214; public const short t_Slime = 4; public const short t_SteampunkMetal = 8; @@ -149,12 +89,5 @@ namespace Terraria.ID public const short t_Lihzahrd = 148; public const short t_Flesh = 5; public const short t_Frozen = 80; - public const short GemAmethyst = 86; - public const short GemTopaz = 87; - public const short GemSapphire = 88; - public const short GemEmerald = 89; - public const short GemRuby = 90; - public const short GemDiamond = 91; - public const short GemAmber = 138; } } diff --git a/ID/ExtrasID.cs b/ID/ExtrasID.cs index d38e592..eb5f44b 100644 --- a/ID/ExtrasID.cs +++ b/ID/ExtrasID.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.ExtrasID -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.ID @@ -99,127 +99,6 @@ namespace Terraria.ID public const short DD2LightningAuraT3 = 88; public const short ThePerfectGlow = 89; public const short ArkhalisMask = 90; - public const short FallingStar = 91; - public const short LawnMower = 92; - public const short VoidLensOutline = 93; - public const short MoneyTroughOutline = 94; - public const short AmberHookChain = 95; - public const short GolfCartBody = 96; - public const short GolfCartWheels = 97; - public const short SharpTears = 98; - public const short DripplerFlail = 99; - public const short BirdNestHead = 100; - public const short TombstoneGlow = 101; - public const short PortableStool = 102; - public const short KiteRibbons = 103; - public const short KiteRibbonsWyvern = 104; - public const short FloatingTube = 105; - public const short GolemLights4 = 106; - public const short GolemLights5 = 107; - public const short BeeMinecart = 108; - public const short LadybugMinecart = 109; - public const short PigronMinecart = 110; - public const short SunflowerMinecart = 111; - public const short HellMinecart = 112; - public const short WitchBroom = 113; - public const short WitchBroomTrinket = 114; - public const short ShroomMinecart = 115; - public const short ShroomMinecartGlow = 116; - public const short AmethystMinecart = 117; - public const short TopazMinecart = 118; - public const short SapphireMinecart = 119; - public const short EmeraldMinecart = 120; - public const short RubyMinecart = 121; - public const short DiamondMinecart = 122; - public const short AmberMinecart = 123; - public const short BeetleMinecart = 124; - public const short MeowmereMinecart = 125; - public const short PartyMinecart = 126; - public const short PirateMinecart = 127; - public const short SteampunkMinecart = 128; - public const short BloodNautilusMouth = 129; - public const short MapBiomeIcons = 130; - public const short BloodNautilusCallForHelp = 131; - public const short KiteRibbonsBoneSerpent = 132; - public const short KiteRibbonsWorldFeeder = 133; - public const short LanternSkyLanterns = 134; - public const short KiteRibbonsManEater = 135; - public const short KiteRibbonsJellyfishBlue = 136; - public const short KiteRibbonsJellyfishPink = 137; - public const short KiteRibbonsShark = 138; - public const short KiteRibbonsSandShark = 139; - public const short KiteRibbonsGoldfish = 140; - public const short PartyCartBalloons = 141; - public const short PirateMinecartFlag = 142; - public const short PlayerUnicornHorn = 143; - public const short KiteRibbonsAngryTrapper = 144; - public const short KiteRibbonsKoi = 145; - public const short KiteRibbonsCrawltipede = 146; - public const short KiteRibbonsSpectrum = 147; - public const short KiteRibbonsEyeball = 148; - public const short FlamingoMount = 149; - public const short CoffinMinecart = 150; - public const short CoffinMinecartLid = 151; - public const short SafemanSun = 152; - public const short JimCloak = 153; - public const short SquirrelHookChain = 154; - public const short DiggingMoleMinecart = 155; - public const short HallowBossGradient = 156; - public const short HallowBossWings = 157; - public const short HallowBossArmsLeft = 158; - public const short HallowBossWingsBack = 159; - public const short HallowBossArmsRight = 160; - public const short PaintedHorseMount = 161; - public const short MajesticHorseMount = 162; - public const short DarkHorseMount = 163; - public const short PogoStickMount = 164; - public const short DiggingMoleMinecartArm = 165; - public const short PirateShipMount = 166; - public const short SpookyWoodMount = 167; - public const short SantankMount = 168; - public const short WallOfFleshGoatMount = 169; - public const short DarkMageBookMount = 170; - public const short PlayerRainbowWings = 171; - public const short LavaSharkMount = 172; - public const short PotionOfReturnMinimapIcon = 173; - public const short KeybrandRing = 174; - public const short PotionOfReturnMinimapHome = 175; - public const short GolfBallMinimapOutline = 176; - public const short QueenSlimeCrown = 177; - public const short FairyQueenLance = 178; - public const short Voronoi = 179; - public const short QueenSlimeGradient = 180; - public const short PylonCrystals = 181; - public const short PylonMapIcons = 182; - public const short PotionOfReturnGateIn = 183; - public const short PotionOfReturnGateOut = 184; - public const short QueenSlimeWing = 185; - public const short QueenSlimeCrystalCore = 186; - public const short HallowBossTentacles = 187; - public const short HallowBossSkirt = 188; - public const short FlameLashTrailShape = 189; - public const short FlameLashTrailErosion = 190; - public const short FlameLashTrailColorGradient = 191; - public const short MagicMissileTrailColorGradient = 192; - public const short MagicMissileTrailErosion = 193; - public const short MagicMissileTrailShape = 194; - public const short RainbowRodTrailColorGradient = 195; - public const short RainbowRodTrailErosion = 196; - public const short RainbowRodTrailShape = 197; - public const short MasterTrophyHeads = 198; - public const short WhipMarkers = 199; - public const short IceWhipSlicerBody = 200; - public const short FinalFractal = 201; - public const short EmpressButterflyJar = 202; - public const short SlimeQueenHookChain = 203; - public const short QueenSlimeMount = 204; - public const short QueenSlimeSaddle = 205; - public const short QueenSlimeWingFront = 206; - public const short QueenSlimeWingBack = 207; - public const short QueenSlimeHookRope = 208; - public const short EmpressBladeTrail = 209; - public const short EmpressBladeErosion = 210; - public const short BiomeTorchIconUI = 211; - public const short Count = 212; + public const short Count = 91; } } diff --git a/ID/GameEventClearedID.cs b/ID/GameEventClearedID.cs deleted file mode 100644 index 1ca5cc9..0000000 --- a/ID/GameEventClearedID.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.ID.GameEventClearedID -// 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.ID -{ - public class GameEventClearedID - { - public const int DefeatedGoblinArmy = 0; - public const int DefeatedFrostArmy = 1; - public const int DefeatedPirates = 2; - public const int DefeatedMartians = 3; - public const int DefeatedHalloweenTree = 4; - public const int DefeatedHalloweenKing = 5; - public const int DefeatedGolem = 6; - public const int DefeatedFishron = 7; - public const int DefeatedQueenBee = 8; - public const int DefeatedAncientCultist = 9; - public const int DefeatedMoonlord = 10; - public const int DefeatedSlimeKing = 11; - public const int DefeatedPlantera = 12; - public const int DefeatedEyeOfCthulu = 13; - public const int DefeatedEaterOfWorldsOrBrainOfChtulu = 14; - public const int DefeatedSkeletron = 15; - public const int DefeatedDestroyer = 16; - public const int DefeatedTheTwins = 17; - public const int DefeatedSkeletronPrime = 18; - public const int DefeatedWallOfFleshAndStartedHardmode = 19; - public const int DefeatedIceQueen = 20; - public const int DefeatedChristmassTree = 21; - public const int DefeatedSantank = 22; - public const int DefeatedEmpressOfLight = 23; - public const int DefeatedQueenSlime = 24; - } -} diff --git a/ID/GameModeID.cs b/ID/GameModeID.cs deleted file mode 100644 index 72a512e..0000000 --- a/ID/GameModeID.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.ID.GameModeID -// 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.ID -{ - internal class GameModeID - { - public const short Normal = 0; - public const short Expert = 1; - public const short Master = 2; - public const short Creative = 3; - } -} diff --git a/ID/GlowMaskID.cs b/ID/GlowMaskID.cs index 9b7819c..fe8e561 100644 --- a/ID/GlowMaskID.cs +++ b/ID/GlowMaskID.cs @@ -1,14 +1,13 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.GlowMaskID -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.ID { public static class GlowMaskID { - public const short FakeUser = -2; public const short None = -1; public const short UFOMinion = 0; public const short VortexAxe = 1; @@ -262,55 +261,6 @@ namespace Terraria.ID public const short ArkhalisPants_Male = 249; public const short ArkhalisPants_Female = 250; public const short ArkhalisWings = 251; - public const short BoulderStaffOfEarth = 252; - public const short Everscream = 253; - public const short Santank = 254; - public const short HeadlessHorseman = 255; - public const short UltraBrightHelmet = 256; - public const short JackOLantern = 257; - public const short LavaMossBrick = 258; - public const short KryptonMoss = 259; - public const short KryptonMossBrick = 260; - public const short XenonMoss = 261; - public const short XenonMossBrick = 262; - public const short ArgonMoss = 263; - public const short ArgonMossBrick = 264; - public const short VoidMonolith = 265; - public const short ScarabBomb = 266; - public const short PlasmaLamp = 267; - public const short PinkFairyJar = 268; - public const short GreenFairyJar = 269; - public const short BlueFairyJar = 270; - public const short FirstFractal = 271; - public const short GroxTheGreatWings = 272; - public const short GroxTheGreatHelm = 273; - public const short GroxTheGreatGreaves = 274; - public const short DestroyerPet = 275; - public const short SkeletronPrimePet = 276; - public const short GolemPet = 277; - public const short PumpkingPet = 278; - public const short EverscreamPet = 279; - public const short FairyQueenPet = 280; - public const short MartianPet = 281; - public const short MoonLordPet = 282; - public const short SpookyWoodMount = 283; - public const short WallOfFleshGoatMount = 284; - public const short LavaSharkMount = 285; - public const short GemSquirrel = 286; - public const short GemBunny = 287; - public const short HellButterfly = 288; - public const short HellButterflyJar = 289; - public const short Lavafly = 290; - public const short LavaflyinaBottle = 291; - public const short MagmaSnail = 292; - public const short MagmaSnailCage = 293; - public const short BrazierSuspended = 294; - public const short VolcanoSmall = 295; - public const short VolcanoLarge = 296; - public const short PottedPlants2 = 297; - public const short PottedLavaPlants = 298; - public const short PottedLavaPlantTendrils = 299; - public const short TruffleWormCage = 300; - public const short Count = 301; + public const short Count = 252; } } diff --git a/ID/GoreID.cs b/ID/GoreID.cs index bbbf78c..943d544 100644 --- a/ID/GoreID.cs +++ b/ID/GoreID.cs @@ -1,16 +1,13 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.GoreID -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.ID { public static class GoreID { - public const int Smoke1 = 61; - public const int Smoke2 = 62; - public const int Smoke3 = 63; public const int ChargedBlasterRing = 618; public const int MoonLordHeart1 = 619; public const int MoonLordHeart2 = 620; @@ -180,14 +177,14 @@ namespace Terraria.ID public const int VortexSoldier1 = 808; public const int VortexSoldier2 = 809; public const int VortexSoldier3 = 810; - public const int GiantWalkingAntlion1 = 811; - public const int GiantWalkingAntlion2 = 812; - public const int GiantWalkingAntlion3 = 813; - public const int GiantWalkingAntlion4 = 814; - public const int GiantFlyingAntlion1 = 815; - public const int GiantFlyingAntlion2 = 816; - public const int GiantFlyingAntlion3 = 817; - public const int GiantFlyingAntlion4 = 818; + public const int WalkingAntlion1 = 811; + public const int WalkingAntlion2 = 812; + public const int WalkingAntlion3 = 813; + public const int WalkingAntlion4 = 814; + public const int FlyingAntlion1 = 815; + public const int FlyingAntlion2 = 816; + public const int FlyingAntlion3 = 817; + public const int FlyingAntlion4 = 818; public const int DuneSplicerHead = 819; public const int DuneSplicerBody = 820; public const int DuneSplicerTail = 821; @@ -287,7 +284,7 @@ namespace Terraria.ID public const int TreeLeaf_Corruption = 915; public const int TreeLeaf_Crimson = 916; public const int TreeLeaf_Hallow = 917; - public const int TreeLeaf_HallowLast = 925; + public const int TreeLeaf_Last = 925; public const int PartyHatBlue = 926; public const int PartyHatDemolitionist = 927; public const int PartyHatDyeTrader = 928; @@ -449,189 +446,14 @@ namespace Terraria.ID public const int DD2BetsyWing2 = 1084; public const int DD2BetsyHand = 1085; public const int DD2BetsyButt = 1086; - public const int AmbientFloorCloud1 = 1087; - public const int AmbientFloorCloud2 = 1088; - public const int AmbientFloorCloud3 = 1089; - public const int AmbientFloorCloud4 = 1090; - public const int AmbientAirborneCloud1 = 1091; - public const int AmbientAirborneCloud2 = 1092; - public const int AmbientAirborneCloud3 = 1093; - public const int WalkingAntlion1 = 1094; - public const int WalkingAntlion2 = 1095; - public const int WalkingAntlion3 = 1096; - public const int WalkingAntlion4 = 1097; - public const int FlyingAntlion1 = 1098; - public const int FlyingAntlion2 = 1099; - public const int FlyingAntlion3 = 1100; - public const int FlyingAntlion4 = 1101; - public const int LarvaeAntlion1 = 1102; - public const int LarvaeAntlion2 = 1103; - public const short EyeballFlyingFish1 = 1104; - public const short EyeballFlyingFish2 = 1105; - public const short ZombieMerman1 = 1106; - public const short ZombieMerman2 = 1107; - public const short ZombieMerman3 = 1108; - public const short Golfer1 = 1109; - public const short Golfer2 = 1110; - public const short Golfer3 = 1111; - public const short Golfer4 = 1112; - public const int TreeLeaf_HallowJim = 1113; - public const int TreeLeaf_HallowLastJim = 1121; - public const short DesertPot1 = 1122; - public const short DesertPot2 = 1123; - public const short DesertPot3 = 1124; - public const short Balloon_White_1 = 1125; - public const short Balloon_White_2 = 1126; - public const short Balloon_White_3 = 1127; - public const short Balloon_Red_1 = 1128; - public const short Balloon_Red_2 = 1129; - public const short Balloon_Red_3 = 1130; - public const short Balloon_Orange_1 = 1131; - public const short Balloon_Orange_2 = 1132; - public const short Balloon_Orange_3 = 1133; - public const short Balloon_Yellow_1 = 1134; - public const short Balloon_Yellow_2 = 1135; - public const short Balloon_Yellow_3 = 1136; - public const short Balloon_Green_1 = 1137; - public const short Balloon_Green_2 = 1138; - public const short Balloon_Green_3 = 1139; - public const short Balloon_Blue_1 = 1140; - public const short Balloon_Blue_2 = 1141; - public const short Balloon_Blue_3 = 1142; - public const short Balloon_Purple_1 = 1143; - public const short Balloon_Purple_2 = 1144; - public const short Balloon_Purple_3 = 1145; - public const short Balloon_String = 1146; - public const int WaterDripDesert2 = 1147; - public const int Ladybug1 = 1148; - public const int Ladybug2 = 1149; - public const int Seagull1 = 1150; - public const int Seagull2 = 1151; - public const int Pupfish1 = 1152; - public const int Pupfish2 = 1153; - public const int Grebe1 = 1154; - public const int Grebe2 = 1155; - public const int Grebe3 = 1156; - public const int Rat1 = 1157; - public const int Rat2 = 1158; - public const int Rat3 = 1159; - public const int EbonsandDrip = 1160; - public const int CrimsandDrip = 1161; - public const int PearlsandDrip = 1162; - public const int LittleRat1 = 1163; - public const int Owl1 = 1164; - public const int Owl2 = 1165; - public const short Turtle1 = 1166; - public const short Turtle2 = 1167; - public const short Turtle3 = 1168; - public const short TurtleJungle1 = 1169; - public const short TurtleJungle2 = 1170; - public const short TurtleJungle3 = 1171; - public const short BloodNautilus1 = 1172; - public const short BloodNautilus2 = 1173; - public const short BloodNautilus3 = 1174; - public const short BloodNautilus4 = 1175; - public const short BloodNautilus5 = 1176; - public const short BloodNautilus6 = 1177; - public const short BloodNautilus7 = 1178; - public const short BloodSquid1 = 1179; - public const short BloodSquid2 = 1180; - public const short BloodSquid3 = 1181; - public const short BloodSquid4 = 1182; - public const short GoblinShark1 = 1183; - public const short GoblinShark2 = 1184; - public const short GoblinShark3 = 1185; - public const short GoblinShark4 = 1186; - public const short BloodEel1 = 1187; - public const short BloodEel2 = 1188; - public const short BloodEel3 = 1189; - public const short Gnome1 = 1190; - public const short Gnome2 = 1191; - public const short Gnome3 = 1192; - public const short Gnome4 = 1193; - public const short SeaTurtle1 = 1194; - public const short SeaTurtle2 = 1195; - public const short SeaTurtle3 = 1196; - public const short Seahorse1 = 1197; - public const short Dolphin1 = 1198; - public const short Dolphin2 = 1199; - public const short Dolphin3 = 1200; - public const short ChumBucket = 1201; - public const int FogMachineCloud1 = 1202; - public const int FogMachineCloud2 = 1203; - public const int FogMachineCloud3 = 1204; - public const int Dandelion1 = 1205; - public const int Dandelion2 = 1206; - public const int Dandelion3 = 1207; - public const int ChumBucketFloatingChunks = 1208; - public const int SparkleGuitar = 1209; - public const int RockGolem1 = 1210; - public const int RockGolem2 = 1211; - public const int RockGolem3 = 1212; - public const int RockGolem4 = 1213; - public const int MaggotZombie1 = 1214; - public const int MaggotZombie2 = 1215; - public const int MaggotZombie3 = 1216; - public const int MaggotZombieMaggotPieces = 1217; - public const int ShadowMimicCoins = 1218; - public const int BestiaryGirl1 = 1219; - public const int BestiaryGirl2 = 1220; - public const int BestiaryGirl3 = 1221; - public const int BestiaryGirl4 = 1222; - public const int BestiaryGirlFox1 = 1223; - public const int BestiaryGirlFox2 = 1224; - public const int LightningBunnySparks = 1225; - public const int KingSlimePetCrown = 1226; - public const int GemSquirrelAmethyst = 1227; - public const int GemSquirrelTopaz = 1228; - public const int GemSquirrelSapphire = 1229; - public const int GemSquirrelEmerald = 1230; - public const int GemSquirrelRuby = 1231; - public const int GemSquirrelDiamond = 1232; - public const int GemSquirrelAmber = 1233; - public const int GemBunnyAmethystHead = 1234; - public const int GemBunnyAmethystBack = 1235; - public const int GemBunnyTopazHead = 1236; - public const int GemBunnyTopazBack = 1237; - public const int GemBunnySapphireHead = 1238; - public const int GemBunnySapphireBack = 1239; - public const int GemBunnyEmeraldHead = 1240; - public const int GemBunnyEmeraldBack = 1241; - public const int GemBunnyRubyHead = 1242; - public const int GemBunnyRubyBack = 1243; - public const int GemBunnyDiamondHead = 1244; - public const int GemBunnyDiamondBack = 1245; - public const int GemBunnyAmberHead = 1246; - public const int GemBunnyAmberBack = 1247; - public const int TreeLeaf_VanityTreeSakura = 1248; - public const int TreeLeaf_GemTreeTopaz = 1249; - public const int TreeLeaf_GemTreeAmethyst = 1250; - public const int TreeLeaf_GemTreeSapphire = 1251; - public const int TreeLeaf_GemTreeEmerald = 1252; - public const int TreeLeaf_GemTreeRuby = 1253; - public const int TreeLeaf_GemTreeDiamond = 1254; - public const int TreeLeaf_GemTreeAmber = 1255; - public const int MagmaSnailShell = 1256; - public const int TreeLeaf_VanityTreeYellowWillow = 1257; - public const int QueenSlimeCrown = 1258; - public const int QueenSlimeWing = 1259; - public const int QueenSlimeMinionPurpleWing = 1260; - public const int QueenSlimePetCrown = 1261; - public const int HallowBoss1 = 1262; - public const int HallowBoss2 = 1263; - public const int HallowBoss3 = 1264; - public const int HallowBoss4 = 1265; - public const int HallowBoss5 = 1266; - public const int HallowBoss6 = 1267; - public const int HallowBoss7 = 1268; - public const short Count = 1269; + public const short Count = 1087; public static class Sets { - public static SetFactory Factory = new SetFactory(1269); - public static int[] SpecialAI = GoreID.Sets.Factory.CreateIntSet(0, 860, 1, 892, 1, 893, 1, 825, 2, 826, 2, 827, 2, 1014, 1, 1015, 1, 1016, 1, 910, 3, 911, 3, 912, 3, 913, 3, 914, 3, 915, 3, 916, 3, 917, 3, 918, 3, 919, 3, 920, 3, 921, 3, 922, 3, 923, 3, 924, 3, 925, 3, 1113, 3, 1114, 3, 1115, 3, 1116, 3, 1117, 3, 1118, 3, 1119, 3, 1120, 3, 1121, 3, 1248, 3, 1249, 3, 1250, 3, 1251, 3, 1252, 3, 1253, 3, 1254, 3, 1255, 3, 1257, 3, 1007, 3, 1008, 3, 1087, 4, 1088, 4, 1089, 4, 1090, 4, 1091, 5, 1092, 5, 1093, 5, 1202, 6, 1203, 6, 1204, 6, 1225, 7); + public static SetFactory Factory = new SetFactory(1087); + public static int[] SpecialAI = GoreID.Sets.Factory.CreateIntSet(0, 860, 1, 892, 1, 893, 1, 825, 2, 826, 2, 827, 2, 1014, 1, 1015, 1, 1016, 1, 910, 3, 911, 3, 912, 3, 913, 3, 914, 3, 915, 3, 916, 3, 917, 3, 918, 3, 919, 3, 920, 3, 921, 3, 922, 3, 923, 3, 924, 3, 925, 3, 1007, 3, 1008, 3); public static int[] DisappearSpeed = GoreID.Sets.Factory.CreateIntSet(1, 1007, 3, 1008, 10, 1024, 7, 1025, 7, 1026, 7); - public static int[] DisappearSpeedAlpha = GoreID.Sets.Factory.CreateIntSet(1, 1007, 3, 1008, 10, 1024, 7, 1025, 7, 1026, 7, 1218, 3); + public static int[] DisappearSpeedAlpha = GoreID.Sets.Factory.CreateIntSet(1, 1007, 3, 1008, 10, 1024, 7, 1025, 7, 1026, 7); } } } diff --git a/ID/HousingCategoryID.cs b/ID/HousingCategoryID.cs deleted file mode 100644 index 5ede5b0..0000000 --- a/ID/HousingCategoryID.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.ID.HousingCategoryID -// 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.ID -{ - public class HousingCategoryID - { - public const int CommonNPCs = 0; - public const int PetNPCs = 1; - } -} diff --git a/ID/InvasionID.cs b/ID/InvasionID.cs index 5c3e56d..14f1a4d 100644 --- a/ID/InvasionID.cs +++ b/ID/InvasionID.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.InvasionID -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.ID diff --git a/ID/ItemAlternativeFunctionID.cs b/ID/ItemAlternativeFunctionID.cs index a8d3882..52434a5 100644 --- a/ID/ItemAlternativeFunctionID.cs +++ b/ID/ItemAlternativeFunctionID.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.ItemAlternativeFunctionID -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.ID diff --git a/ID/ItemHoldStyleID.cs b/ID/ItemHoldStyleID.cs deleted file mode 100644 index ef26a4a..0000000 --- a/ID/ItemHoldStyleID.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.ID.ItemHoldStyleID -// 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.ID -{ - public class ItemHoldStyleID - { - public const int None = 0; - public const int HoldFront = 1; - public const int HoldUp = 2; - public const int HoldHeavy = 3; - public const int HoldGolfClub = 4; - public const int HoldGuitar = 5; - public const int HoldLamp = 6; - } -} diff --git a/ID/ItemID.cs b/ID/ItemID.cs index 50bffb8..959c443 100644 --- a/ID/ItemID.cs +++ b/ID/ItemID.cs @@ -1,13 +1,11 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.ItemID -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe -using Microsoft.Xna.Framework; using ReLogic.Reflection; using System.Collections.Generic; -using Terraria.DataStructures; namespace Terraria.ID { @@ -2538,7 +2536,7 @@ namespace Terraria.ID public const short GuideVoodooFish = 2472; public const short Wyverntail = 2473; public const short ZombieFish = 2474; - public const short AmanitaFungifin = 2475; + public const short AmanitiaFungifin = 2475; public const short Angelfish = 2476; public const short BloodyManowar = 2477; public const short Bonefish = 2478; @@ -3993,1122 +3991,7 @@ namespace Terraria.ID public const short LeinforsPants = 3927; public const short LeinforsWings = 3928; public const short LeinforsAccessory = 3929; - public const short Celeb2 = 3930; - public const short SpiderBathtub = 3931; - public const short SpiderBed = 3932; - public const short SpiderBookcase = 3933; - public const short SpiderDresser = 3934; - public const short SpiderCandelabra = 3935; - public const short SpiderCandle = 3936; - public const short SpiderChair = 3937; - public const short SpiderChandelier = 3938; - public const short SpiderChest = 3939; - public const short SpiderClock = 3940; - public const short SpiderDoor = 3941; - public const short SpiderLamp = 3942; - public const short SpiderLantern = 3943; - public const short SpiderPiano = 3944; - public const short SpiderPlatform = 3945; - public const short SpiderSinkSpiderSinkDoesWhateverASpiderSinkDoes = 3946; - public const short SpiderSofa = 3947; - public const short SpiderTable = 3948; - public const short SpiderWorkbench = 3949; - public const short Fake_SpiderChest = 3950; - public const short IronBrick = 3951; - public const short IronBrickWall = 3952; - public const short LeadBrick = 3953; - public const short LeadBrickWall = 3954; - public const short LesionBlock = 3955; - public const short LesionBlockWall = 3956; - public const short LesionPlatform = 3957; - public const short LesionBathtub = 3958; - public const short LesionBed = 3959; - public const short LesionBookcase = 3960; - public const short LesionCandelabra = 3961; - public const short LesionCandle = 3962; - public const short LesionChair = 3963; - public const short LesionChandelier = 3964; - public const short LesionChest = 3965; - public const short LesionClock = 3966; - public const short LesionDoor = 3967; - public const short LesionDresser = 3968; - public const short LesionLamp = 3969; - public const short LesionLantern = 3970; - public const short LesionPiano = 3971; - public const short LesionSink = 3972; - public const short LesionSofa = 3973; - public const short LesionTable = 3974; - public const short LesionWorkbench = 3975; - public const short Fake_LesionChest = 3976; - public const short HatRack = 3977; - public const short ColorOnlyDye = 3978; - public const short WoodenCrateHard = 3979; - public const short IronCrateHard = 3980; - public const short GoldenCrateHard = 3981; - public const short CorruptFishingCrateHard = 3982; - public const short CrimsonFishingCrateHard = 3983; - public const short DungeonFishingCrateHard = 3984; - public const short FloatingIslandFishingCrateHard = 3985; - public const short HallowedFishingCrateHard = 3986; - public const short JungleFishingCrateHard = 3987; - public const short DeadMansChest = 3988; - public const short GolfBall = 3989; - public const short AmphibianBoots = 3990; - public const short ArcaneFlower = 3991; - public const short BerserkerGlove = 3992; - public const short FairyBoots = 3993; - public const short FrogFlipper = 3994; - public const short FrogGear = 3995; - public const short FrogWebbing = 3996; - public const short FrozenShield = 3997; - public const short HeroShield = 3998; - public const short LavaSkull = 3999; - public const short MagnetFlower = 4000; - public const short ManaCloak = 4001; - public const short MoltenQuiver = 4002; - public const short MoltenSkullRose = 4003; - public const short ObsidianSkullRose = 4004; - public const short ReconScope = 4005; - public const short StalkersQuiver = 4006; - public const short StingerNecklace = 4007; - public const short UltrabrightHelmet = 4008; - public const short Apple = 4009; - public const short ApplePieSlice = 4010; - public const short ApplePie = 4011; - public const short BananaSplit = 4012; - public const short BBQRibs = 4013; - public const short BunnyStew = 4014; - public const short Burger = 4015; - public const short ChickenNugget = 4016; - public const short ChocolateChipCookie = 4017; - public const short CreamSoda = 4018; - public const short Escargot = 4019; - public const short FriedEgg = 4020; - public const short Fries = 4021; - public const short GoldenDelight = 4022; - public const short Grapes = 4023; - public const short GrilledSquirrel = 4024; - public const short Hotdog = 4025; - public const short IceCream = 4026; - public const short Milkshake = 4027; - public const short Nachos = 4028; - public const short Pizza = 4029; - public const short PotatoChips = 4030; - public const short RoastedBird = 4031; - public const short RoastedDuck = 4032; - public const short SauteedFrogLegs = 4033; - public const short SeafoodDinner = 4034; - public const short ShrimpPoBoy = 4035; - public const short Spaghetti = 4036; - public const short Steak = 4037; - public const short MoltenCharm = 4038; - public const short GolfClubIron = 4039; - public const short GolfCup = 4040; - public const short FlowerPacketBlue = 4041; - public const short FlowerPacketMagenta = 4042; - public const short FlowerPacketPink = 4043; - public const short FlowerPacketRed = 4044; - public const short FlowerPacketYellow = 4045; - public const short FlowerPacketViolet = 4046; - public const short FlowerPacketWhite = 4047; - public const short FlowerPacketTallGrass = 4048; - public const short LawnMower = 4049; - public const short CrimstoneBrick = 4050; - public const short SmoothSandstone = 4051; - public const short CrimstoneBrickWall = 4052; - public const short SmoothSandstoneWall = 4053; - public const short BloodMoonMonolith = 4054; - public const short SandBoots = 4055; - public const short AncientChisel = 4056; - public const short CarbonGuitar = 4057; - public const short SkeletonBow = 4058; - public const short FossilPickaxe = 4059; - public const short SuperStarCannon = 4060; - public const short ThunderSpear = 4061; - public const short ThunderStaff = 4062; - public const short DrumSet = 4063; - public const short PicnicTable = 4064; - public const short PicnicTableWithCloth = 4065; - public const short DesertMinecart = 4066; - public const short FishMinecart = 4067; - public const short FairyCritterPink = 4068; - public const short FairyCritterGreen = 4069; - public const short FairyCritterBlue = 4070; - public const short JunoniaShell = 4071; - public const short LightningWhelkShell = 4072; - public const short TulipShell = 4073; - public const short PinWheel = 4074; - public const short WeatherVane = 4075; - public const short VoidVault = 4076; - public const short MusicBoxOceanAlt = 4077; - public const short MusicBoxSlimeRain = 4078; - public const short MusicBoxSpaceAlt = 4079; - public const short MusicBoxTownDay = 4080; - public const short MusicBoxTownNight = 4081; - public const short MusicBoxWindyDay = 4082; - public const short GolfCupFlagWhite = 4083; - public const short GolfCupFlagRed = 4084; - public const short GolfCupFlagGreen = 4085; - public const short GolfCupFlagBlue = 4086; - public const short GolfCupFlagYellow = 4087; - public const short GolfCupFlagPurple = 4088; - public const short GolfTee = 4089; - public const short ShellPileBlock = 4090; - public const short AntiPortalBlock = 4091; - public const short GolfClubPutter = 4092; - public const short GolfClubWedge = 4093; - public const short GolfClubDriver = 4094; - public const short GolfWhistle = 4095; - public const short ToiletEbonyWood = 4096; - public const short ToiletRichMahogany = 4097; - public const short ToiletPearlwood = 4098; - public const short ToiletLivingWood = 4099; - public const short ToiletCactus = 4100; - public const short ToiletBone = 4101; - public const short ToiletFlesh = 4102; - public const short ToiletMushroom = 4103; - public const short ToiletSunplate = 4104; - public const short ToiletShadewood = 4105; - public const short ToiletLihzhard = 4106; - public const short ToiletDungeonBlue = 4107; - public const short ToiletDungeonGreen = 4108; - public const short ToiletDungeonPink = 4109; - public const short ToiletObsidian = 4110; - public const short ToiletFrozen = 4111; - public const short ToiletGlass = 4112; - public const short ToiletHoney = 4113; - public const short ToiletSteampunk = 4114; - public const short ToiletPumpkin = 4115; - public const short ToiletSpooky = 4116; - public const short ToiletDynasty = 4117; - public const short ToiletPalm = 4118; - public const short ToiletBoreal = 4119; - public const short ToiletSlime = 4120; - public const short ToiletMartian = 4121; - public const short ToiletGranite = 4122; - public const short ToiletMarble = 4123; - public const short ToiletCrystal = 4124; - public const short ToiletSpider = 4125; - public const short ToiletLesion = 4126; - public const short ToiletDiamond = 4127; - public const short MaidHead = 4128; - public const short MaidShirt = 4129; - public const short MaidPants = 4130; - public const short VoidLens = 4131; - public const short MaidHead2 = 4132; - public const short MaidShirt2 = 4133; - public const short MaidPants2 = 4134; - public const short GolfHat = 4135; - public const short GolfShirt = 4136; - public const short GolfPants = 4137; - public const short GolfVisor = 4138; - public const short SpiderBlock = 4139; - public const short SpiderWall = 4140; - public const short ToiletMeteor = 4141; - public const short LesionStation = 4142; - public const short ManaCloakStar = 4143; - public const short Terragrim = 4144; - public const short SolarBathtub = 4145; - public const short SolarBed = 4146; - public const short SolarBookcase = 4147; - public const short SolarDresser = 4148; - public const short SolarCandelabra = 4149; - public const short SolarCandle = 4150; - public const short SolarChair = 4151; - public const short SolarChandelier = 4152; - public const short SolarChest = 4153; - public const short SolarClock = 4154; - public const short SolarDoor = 4155; - public const short SolarLamp = 4156; - public const short SolarLantern = 4157; - public const short SolarPiano = 4158; - public const short SolarPlatform = 4159; - public const short SolarSink = 4160; - public const short SolarSofa = 4161; - public const short SolarTable = 4162; - public const short SolarWorkbench = 4163; - public const short Fake_SolarChest = 4164; - public const short SolarToilet = 4165; - public const short VortexBathtub = 4166; - public const short VortexBed = 4167; - public const short VortexBookcase = 4168; - public const short VortexDresser = 4169; - public const short VortexCandelabra = 4170; - public const short VortexCandle = 4171; - public const short VortexChair = 4172; - public const short VortexChandelier = 4173; - public const short VortexChest = 4174; - public const short VortexClock = 4175; - public const short VortexDoor = 4176; - public const short VortexLamp = 4177; - public const short VortexLantern = 4178; - public const short VortexPiano = 4179; - public const short VortexPlatform = 4180; - public const short VortexSink = 4181; - public const short VortexSofa = 4182; - public const short VortexTable = 4183; - public const short VortexWorkbench = 4184; - public const short Fake_VortexChest = 4185; - public const short VortexToilet = 4186; - public const short NebulaBathtub = 4187; - public const short NebulaBed = 4188; - public const short NebulaBookcase = 4189; - public const short NebulaDresser = 4190; - public const short NebulaCandelabra = 4191; - public const short NebulaCandle = 4192; - public const short NebulaChair = 4193; - public const short NebulaChandelier = 4194; - public const short NebulaChest = 4195; - public const short NebulaClock = 4196; - public const short NebulaDoor = 4197; - public const short NebulaLamp = 4198; - public const short NebulaLantern = 4199; - public const short NebulaPiano = 4200; - public const short NebulaPlatform = 4201; - public const short NebulaSink = 4202; - public const short NebulaSofa = 4203; - public const short NebulaTable = 4204; - public const short NebulaWorkbench = 4205; - public const short Fake_NebulaChest = 4206; - public const short NebulaToilet = 4207; - public const short StardustBathtub = 4208; - public const short StardustBed = 4209; - public const short StardustBookcase = 4210; - public const short StardustDresser = 4211; - public const short StardustCandelabra = 4212; - public const short StardustCandle = 4213; - public const short StardustChair = 4214; - public const short StardustChandelier = 4215; - public const short StardustChest = 4216; - public const short StardustClock = 4217; - public const short StardustDoor = 4218; - public const short StardustLamp = 4219; - public const short StardustLantern = 4220; - public const short StardustPiano = 4221; - public const short StardustPlatform = 4222; - public const short StardustSink = 4223; - public const short StardustSofa = 4224; - public const short StardustTable = 4225; - public const short StardustWorkbench = 4226; - public const short Fake_StardustChest = 4227; - public const short StardustToilet = 4228; - public const short SolarBrick = 4229; - public const short VortexBrick = 4230; - public const short NebulaBrick = 4231; - public const short StardustBrick = 4232; - public const short SolarBrickWall = 4233; - public const short VortexBrickWall = 4234; - public const short NebulaBrickWall = 4235; - public const short StardustBrickWall = 4236; - public const short MusicBoxDayRemix = 4237; - public const short CrackedBlueBrick = 4238; - public const short CrackedGreenBrick = 4239; - public const short CrackedPinkBrick = 4240; - public const short FlowerPacketWild = 4241; - public const short GolfBallDyedBlack = 4242; - public const short GolfBallDyedBlue = 4243; - public const short GolfBallDyedBrown = 4244; - public const short GolfBallDyedCyan = 4245; - public const short GolfBallDyedGreen = 4246; - public const short GolfBallDyedLimeGreen = 4247; - public const short GolfBallDyedOrange = 4248; - public const short GolfBallDyedPink = 4249; - public const short GolfBallDyedPurple = 4250; - public const short GolfBallDyedRed = 4251; - public const short GolfBallDyedSkyBlue = 4252; - public const short GolfBallDyedTeal = 4253; - public const short GolfBallDyedViolet = 4254; - public const short GolfBallDyedYellow = 4255; - public const short AmberRobe = 4256; - public const short AmberHook = 4257; - public const short OrangePhaseblade = 4258; - public const short OrangePhasesaber = 4259; - public const short OrangeStainedGlass = 4260; - public const short OrangePressurePlate = 4261; - public const short MysticCoilSnake = 4262; - public const short MagicConch = 4263; - public const short GolfCart = 4264; - public const short GolfChest = 4265; - public const short Fake_GolfChest = 4266; - public const short DesertChest = 4267; - public const short Fake_DesertChest = 4268; - public const short SanguineStaff = 4269; - public const short SharpTears = 4270; - public const short BloodMoonStarter = 4271; - public const short DripplerFlail = 4272; - public const short VampireFrogStaff = 4273; - public const short GoldGoldfish = 4274; - public const short GoldGoldfishBowl = 4275; - public const short CatBast = 4276; - public const short GoldStarryGlassBlock = 4277; - public const short BlueStarryGlassBlock = 4278; - public const short GoldStarryGlassWall = 4279; - public const short BlueStarryGlassWall = 4280; - public const short BabyBirdStaff = 4281; - public const short Apricot = 4282; - public const short Banana = 4283; - public const short BlackCurrant = 4284; - public const short BloodOrange = 4285; - public const short Cherry = 4286; - public const short Coconut = 4287; - public const short Dragonfruit = 4288; - public const short Elderberry = 4289; - public const short Grapefruit = 4290; - public const short Lemon = 4291; - public const short Mango = 4292; - public const short Peach = 4293; - public const short Pineapple = 4294; - public const short Plum = 4295; - public const short Rambutan = 4296; - public const short Starfruit = 4297; - public const short SandstoneBathtub = 4298; - public const short SandstoneBed = 4299; - public const short SandstoneBookcase = 4300; - public const short SandstoneDresser = 4301; - public const short SandstoneCandelabra = 4302; - public const short SandstoneCandle = 4303; - public const short SandstoneChair = 4304; - public const short SandstoneChandelier = 4305; - public const short SandstoneClock = 4306; - public const short SandstoneDoor = 4307; - public const short SandstoneLamp = 4308; - public const short SandstoneLantern = 4309; - public const short SandstonePiano = 4310; - public const short SandstonePlatform = 4311; - public const short SandstoneSink = 4312; - public const short SandstoneSofa = 4313; - public const short SandstoneTable = 4314; - public const short SandstoneWorkbench = 4315; - public const short SandstoneToilet = 4316; - public const short BloodHamaxe = 4317; - public const short VoidMonolith = 4318; - public const short ArrowSign = 4319; - public const short PaintedArrowSign = 4320; - public const short GameMasterShirt = 4321; - public const short GameMasterPants = 4322; - public const short StarPrincessCrown = 4323; - public const short StarPrincessDress = 4324; - public const short BloodFishingRod = 4325; - public const short FoodPlatter = 4326; - public const short BlackDragonflyJar = 4327; - public const short BlueDragonflyJar = 4328; - public const short GreenDragonflyJar = 4329; - public const short OrangeDragonflyJar = 4330; - public const short RedDragonflyJar = 4331; - public const short YellowDragonflyJar = 4332; - public const short GoldDragonflyJar = 4333; - public const short BlackDragonfly = 4334; - public const short BlueDragonfly = 4335; - public const short GreenDragonfly = 4336; - public const short OrangeDragonfly = 4337; - public const short RedDragonfly = 4338; - public const short YellowDragonfly = 4339; - public const short GoldDragonfly = 4340; - public const short PortableStool = 4341; - public const short DragonflyStatue = 4342; - public const short PaperAirplaneA = 4343; - public const short PaperAirplaneB = 4344; - public const short CanOfWorms = 4345; - public const short EncumberingStone = 4346; - public const short ZapinatorGray = 4347; - public const short ZapinatorOrange = 4348; - public const short GreenMoss = 4349; - public const short BrownMoss = 4350; - public const short RedMoss = 4351; - public const short BlueMoss = 4352; - public const short PurpleMoss = 4353; - public const short LavaMoss = 4354; - public const short BoulderStatue = 4355; - public const short MusicBoxTitleAlt = 4356; - public const short MusicBoxStorm = 4357; - public const short MusicBoxGraveyard = 4358; - public const short Seagull = 4359; - public const short SeagullStatue = 4360; - public const short LadyBug = 4361; - public const short GoldLadyBug = 4362; - public const short Maggot = 4363; - public const short MaggotCage = 4364; - public const short CelestialWand = 4365; - public const short EucaluptusSap = 4366; - public const short KiteBlue = 4367; - public const short KiteBlueAndYellow = 4368; - public const short KiteRed = 4369; - public const short KiteRedAndYellow = 4370; - public const short KiteYellow = 4371; - public const short IvyGuitar = 4372; - public const short Pupfish = 4373; - public const short Grebe = 4374; - public const short Rat = 4375; - public const short RatCage = 4376; - public const short KryptonMoss = 4377; - public const short XenonMoss = 4378; - public const short KiteWyvern = 4379; - public const short LadybugCage = 4380; - public const short BloodRainBow = 4381; - public const short CombatBook = 4382; - public const short DesertTorch = 4383; - public const short CoralTorch = 4384; - public const short CorruptTorch = 4385; - public const short CrimsonTorch = 4386; - public const short HallowedTorch = 4387; - public const short JungleTorch = 4388; - public const short ArgonMoss = 4389; - public const short RollingCactus = 4390; - public const short ThinIce = 4391; - public const short EchoBlock = 4392; - public const short ScarabFish = 4393; - public const short ScorpioFish = 4394; - public const short Owl = 4395; - public const short OwlCage = 4396; - public const short OwlStatue = 4397; - public const short PupfishBowl = 4398; - public const short GoldLadybugCage = 4399; - public const short Geode = 4400; - public const short Flounder = 4401; - public const short RockLobster = 4402; - public const short LobsterTail = 4403; - public const short FloatingTube = 4404; - public const short FrozenCrate = 4405; - public const short FrozenCrateHard = 4406; - public const short OasisCrate = 4407; - public const short OasisCrateHard = 4408; - public const short SpectreGoggles = 4409; - public const short Oyster = 4410; - public const short ShuckedOyster = 4411; - public const short WhitePearl = 4412; - public const short BlackPearl = 4413; - public const short PinkPearl = 4414; - public const short StoneDoor = 4415; - public const short StonePlatform = 4416; - public const short OasisFountain = 4417; - public const short WaterStrider = 4418; - public const short GoldWaterStrider = 4419; - public const short LawnFlamingo = 4420; - public const short MusicBoxUndergroundJungle = 4421; - public const short Grate = 4422; - public const short ScarabBomb = 4423; - public const short WroughtIronFence = 4424; - public const short SharkBait = 4425; - public const short BeeMinecart = 4426; - public const short LadybugMinecart = 4427; - public const short PigronMinecart = 4428; - public const short SunflowerMinecart = 4429; - public const short PottedForestCedar = 4430; - public const short PottedJungleCedar = 4431; - public const short PottedHallowCedar = 4432; - public const short PottedForestTree = 4433; - public const short PottedJungleTree = 4434; - public const short PottedHallowTree = 4435; - public const short PottedForestPalm = 4436; - public const short PottedJunglePalm = 4437; - public const short PottedHallowPalm = 4438; - public const short PottedForestBamboo = 4439; - public const short PottedJungleBamboo = 4440; - public const short PottedHallowBamboo = 4441; - public const short ScarabFishingRod = 4442; - public const short HellMinecart = 4443; - public const short WitchBroom = 4444; - public const short ClusterRocketI = 4445; - public const short ClusterRocketII = 4446; - public const short WetRocket = 4447; - public const short LavaRocket = 4448; - public const short HoneyRocket = 4449; - public const short ShroomMinecart = 4450; - public const short AmethystMinecart = 4451; - public const short TopazMinecart = 4452; - public const short SapphireMinecart = 4453; - public const short EmeraldMinecart = 4454; - public const short RubyMinecart = 4455; - public const short DiamondMinecart = 4456; - public const short MiniNukeI = 4457; - public const short MiniNukeII = 4458; - public const short DryRocket = 4459; - public const short SandcastleBucket = 4460; - public const short TurtleCage = 4461; - public const short TurtleJungleCage = 4462; - public const short Gladius = 4463; - public const short Turtle = 4464; - public const short TurtleJungle = 4465; - public const short TurtleStatue = 4466; - public const short AmberMinecart = 4467; - public const short BeetleMinecart = 4468; - public const short MeowmereMinecart = 4469; - public const short PartyMinecart = 4470; - public const short PirateMinecart = 4471; - public const short SteampunkMinecart = 4472; - public const short GrebeCage = 4473; - public const short SeagullCage = 4474; - public const short WaterStriderCage = 4475; - public const short GoldWaterStriderCage = 4476; - public const short LuckPotionLesser = 4477; - public const short LuckPotion = 4478; - public const short LuckPotionGreater = 4479; - public const short Seahorse = 4480; - public const short SeahorseCage = 4481; - public const short GoldSeahorse = 4482; - public const short GoldSeahorseCage = 4483; - public const short TimerOneHalfSecond = 4484; - public const short TimerOneFourthSecond = 4485; - public const short EbonstoneEcho = 4486; - public const short MudWallEcho = 4487; - public const short PearlstoneEcho = 4488; - public const short SnowWallEcho = 4489; - public const short AmethystEcho = 4490; - public const short TopazEcho = 4491; - public const short SapphireEcho = 4492; - public const short EmeraldEcho = 4493; - public const short RubyEcho = 4494; - public const short DiamondEcho = 4495; - public const short Cave1Echo = 4496; - public const short Cave2Echo = 4497; - public const short Cave3Echo = 4498; - public const short Cave4Echo = 4499; - public const short Cave5Echo = 4500; - public const short Cave6Echo = 4501; - public const short Cave7Echo = 4502; - public const short SpiderEcho = 4503; - public const short CorruptGrassEcho = 4504; - public const short HallowedGrassEcho = 4505; - public const short IceEcho = 4506; - public const short ObsidianBackEcho = 4507; - public const short CrimsonGrassEcho = 4508; - public const short CrimstoneEcho = 4509; - public const short CaveWall1Echo = 4510; - public const short CaveWall2Echo = 4511; - public const short Cave8Echo = 4512; - public const short Corruption1Echo = 4513; - public const short Corruption2Echo = 4514; - public const short Corruption3Echo = 4515; - public const short Corruption4Echo = 4516; - public const short Crimson1Echo = 4517; - public const short Crimson2Echo = 4518; - public const short Crimson3Echo = 4519; - public const short Crimson4Echo = 4520; - public const short Dirt1Echo = 4521; - public const short Dirt2Echo = 4522; - public const short Dirt3Echo = 4523; - public const short Dirt4Echo = 4524; - public const short Hallow1Echo = 4525; - public const short Hallow2Echo = 4526; - public const short Hallow3Echo = 4527; - public const short Hallow4Echo = 4528; - public const short Jungle1Echo = 4529; - public const short Jungle2Echo = 4530; - public const short Jungle3Echo = 4531; - public const short Jungle4Echo = 4532; - public const short Lava1Echo = 4533; - public const short Lava2Echo = 4534; - public const short Lava3Echo = 4535; - public const short Lava4Echo = 4536; - public const short Rocks1Echo = 4537; - public const short Rocks2Echo = 4538; - public const short Rocks3Echo = 4539; - public const short Rocks4Echo = 4540; - public const short TheBrideBanner = 4541; - public const short ZombieMermanBanner = 4542; - public const short EyeballFlyingFishBanner = 4543; - public const short BloodSquidBanner = 4544; - public const short BloodEelBanner = 4545; - public const short GoblinSharkBanner = 4546; - public const short LargeBambooBlock = 4547; - public const short LargeBambooBlockWall = 4548; - public const short DemonHorns = 4549; - public const short BambooLeaf = 4550; - public const short HellCake = 4551; - public const short FogMachine = 4552; - public const short PlasmaLamp = 4553; - public const short MarbleColumn = 4554; - public const short ChefHat = 4555; - public const short ChefShirt = 4556; - public const short ChefPants = 4557; - public const short StarHairpin = 4558; - public const short HeartHairpin = 4559; - public const short BunnyEars = 4560; - public const short DevilHorns = 4561; - public const short Fedora = 4562; - public const short UnicornHornHat = 4563; - public const short BambooBlock = 4564; - public const short BambooBlockWall = 4565; - public const short BambooBathtub = 4566; - public const short BambooBed = 4567; - public const short BambooBookcase = 4568; - public const short BambooDresser = 4569; - public const short BambooCandelabra = 4570; - public const short BambooCandle = 4571; - public const short BambooChair = 4572; - public const short BambooChandelier = 4573; - public const short BambooChest = 4574; - public const short BambooClock = 4575; - public const short BambooDoor = 4576; - public const short BambooLamp = 4577; - public const short BambooLantern = 4578; - public const short BambooPiano = 4579; - public const short BambooPlatform = 4580; - public const short BambooSink = 4581; - public const short BambooSofa = 4582; - public const short BambooTable = 4583; - public const short BambooWorkbench = 4584; - public const short Fake_BambooChest = 4585; - public const short BambooToilet = 4586; - public const short GolfClubStoneIron = 4587; - public const short GolfClubRustyPutter = 4588; - public const short GolfClubBronzeWedge = 4589; - public const short GolfClubWoodDriver = 4590; - public const short GolfClubMythrilIron = 4591; - public const short GolfClubLeadPutter = 4592; - public const short GolfClubGoldWedge = 4593; - public const short GolfClubPearlwoodDriver = 4594; - public const short GolfClubTitaniumIron = 4595; - public const short GolfClubShroomitePutter = 4596; - public const short GolfClubDiamondWedge = 4597; - public const short GolfClubChlorophyteDriver = 4598; - public const short GolfTrophyBronze = 4599; - public const short GolfTrophySilver = 4600; - public const short GolfTrophyGold = 4601; - public const short BloodNautilusBanner = 4602; - public const short BirdieRattle = 4603; - public const short ExoticEasternChewToy = 4604; - public const short BedazzledNectar = 4605; - public const short MusicBoxJungleNight = 4606; - public const short StormTigerStaff = 4607; - public const short ChumBucket = 4608; - public const short GardenGnome = 4609; - public const short KiteBoneSerpent = 4610; - public const short KiteWorldFeeder = 4611; - public const short KiteBunny = 4612; - public const short KitePigron = 4613; - public const short AppleJuice = 4614; - public const short GrapeJuice = 4615; - public const short Lemonade = 4616; - public const short BananaDaiquiri = 4617; - public const short PeachSangria = 4618; - public const short PinaColada = 4619; - public const short TropicalSmoothie = 4620; - public const short BloodyMoscato = 4621; - public const short SmoothieofDarkness = 4622; - public const short PrismaticPunch = 4623; - public const short FruitJuice = 4624; - public const short FruitSalad = 4625; - public const short AndrewSphinx = 4626; - public const short WatchfulAntlion = 4627; - public const short BurningSpirit = 4628; - public const short JawsOfDeath = 4629; - public const short TheSandsOfSlime = 4630; - public const short SnakesIHateSnakes = 4631; - public const short LifeAboveTheSand = 4632; - public const short Oasis = 4633; - public const short PrehistoryPreserved = 4634; - public const short AncientTablet = 4635; - public const short Uluru = 4636; - public const short VisitingThePyramids = 4637; - public const short BandageBoy = 4638; - public const short DivineEye = 4639; - public const short AmethystStoneBlock = 4640; - public const short TopazStoneBlock = 4641; - public const short SapphireStoneBlock = 4642; - public const short EmeraldStoneBlock = 4643; - public const short RubyStoneBlock = 4644; - public const short DiamondStoneBlock = 4645; - public const short AmberStoneBlock = 4646; - public const short AmberStoneWallEcho = 4647; - public const short KiteManEater = 4648; - public const short KiteJellyfishBlue = 4649; - public const short KiteJellyfishPink = 4650; - public const short KiteShark = 4651; - public const short SuperHeroMask = 4652; - public const short SuperHeroCostume = 4653; - public const short SuperHeroTights = 4654; - public const short PinkFairyJar = 4655; - public const short GreenFairyJar = 4656; - public const short BlueFairyJar = 4657; - public const short GolfPainting1 = 4658; - public const short GolfPainting2 = 4659; - public const short GolfPainting3 = 4660; - public const short GolfPainting4 = 4661; - public const short FogboundDye = 4662; - public const short BloodbathDye = 4663; - public const short PrettyPinkDressSkirt = 4664; - public const short PrettyPinkDressPants = 4665; - public const short PrettyPinkRibbon = 4666; - public const short BambooFence = 4667; - public const short GlowPaint = 4668; - public const short KiteSandShark = 4669; - public const short KiteBunnyCorrupt = 4670; - public const short KiteBunnyCrimson = 4671; - public const short BlandWhip = 4672; - public const short DrumStick = 4673; - public const short KiteGoldfish = 4674; - public const short KiteAngryTrapper = 4675; - public const short KiteKoi = 4676; - public const short KiteCrawltipede = 4677; - public const short SwordWhip = 4678; - public const short MaceWhip = 4679; - public const short ScytheWhip = 4680; - public const short KiteSpectrum = 4681; - public const short ReleaseDoves = 4682; - public const short KiteWanderingEye = 4683; - public const short KiteUnicorn = 4684; - public const short UndertakerHat = 4685; - public const short UndertakerCoat = 4686; - public const short DandelionBanner = 4687; - public const short GnomeBanner = 4688; - public const short DesertCampfire = 4689; - public const short CoralCampfire = 4690; - public const short CorruptCampfire = 4691; - public const short CrimsonCampfire = 4692; - public const short HallowedCampfire = 4693; - public const short JungleCampfire = 4694; - public const short SoulBottleLight = 4695; - public const short SoulBottleNight = 4696; - public const short SoulBottleFlight = 4697; - public const short SoulBottleSight = 4698; - public const short SoulBottleMight = 4699; - public const short SoulBottleFright = 4700; - public const short MudBud = 4701; - public const short ReleaseLantern = 4702; - public const short QuadBarrelShotgun = 4703; - public const short FuneralHat = 4704; - public const short FuneralCoat = 4705; - public const short FuneralPants = 4706; - public const short TragicUmbrella = 4707; - public const short VictorianGothHat = 4708; - public const short VictorianGothDress = 4709; - public const short TatteredWoodSign = 4710; - public const short GravediggerShovel = 4711; - public const short DungeonDesertChest = 4712; - public const short Fake_DungeonDesertChest = 4713; - public const short DungeonDesertKey = 4714; - public const short SparkleGuitar = 4715; - public const short MolluskWhistle = 4716; - public const short BorealBeam = 4717; - public const short RichMahoganyBeam = 4718; - public const short GraniteColumn = 4719; - public const short SandstoneColumn = 4720; - public const short MushroomBeam = 4721; - public const short FirstFractal = 4722; - public const short Nevermore = 4723; - public const short Reborn = 4724; - public const short Graveyard = 4725; - public const short GhostManifestation = 4726; - public const short WickedUndead = 4727; - public const short BloodyGoblet = 4728; - public const short StillLife = 4729; - public const short GhostarsWings = 4730; - public const short TerraToilet = 4731; - public const short GhostarSkullPin = 4732; - public const short GhostarShirt = 4733; - public const short GhostarPants = 4734; - public const short BallOfFuseWire = 4735; - public const short FullMoonSqueakyToy = 4736; - public const short OrnateShadowKey = 4737; - public const short DrManFlyMask = 4738; - public const short DrManFlyLabCoat = 4739; - public const short ButcherMask = 4740; - public const short ButcherApron = 4741; - public const short ButcherPants = 4742; - public const short Football = 4743; - public const short HunterCloak = 4744; - public const short CoffinMinecart = 4745; - public const short SafemanWings = 4746; - public const short SafemanSunHair = 4747; - public const short SafemanSunDress = 4748; - public const short SafemanDressLeggings = 4749; - public const short FoodBarbarianWings = 4750; - public const short FoodBarbarianHelm = 4751; - public const short FoodBarbarianArmor = 4752; - public const short FoodBarbarianGreaves = 4753; - public const short GroxTheGreatWings = 4754; - public const short GroxTheGreatHelm = 4755; - public const short GroxTheGreatArmor = 4756; - public const short GroxTheGreatGreaves = 4757; - public const short Smolstar = 4758; - public const short SquirrelHook = 4759; - public const short BouncingShield = 4760; - public const short RockGolemHead = 4761; - public const short CritterShampoo = 4762; - public const short DiggingMoleMinecart = 4763; - public const short Shroomerang = 4764; - public const short TreeGlobe = 4765; - public const short WorldGlobe = 4766; - public const short DontHurtCrittersBook = 4767; - public const short DogEars = 4768; - public const short DogTail = 4769; - public const short FoxEars = 4770; - public const short FoxTail = 4771; - public const short LizardEars = 4772; - public const short LizardTail = 4773; - public const short PandaEars = 4774; - public const short BunnyTail = 4775; - public const short FairyGlowstick = 4776; - public const short LightningCarrot = 4777; - public const short HallowBossDye = 4778; - public const short MushroomHat = 4779; - public const short MushroomVest = 4780; - public const short MushroomPants = 4781; - public const short FairyQueenBossBag = 4782; - public const short FairyQueenTrophy = 4783; - public const short FairyQueenMask = 4784; - public const short PaintedHorseSaddle = 4785; - public const short MajesticHorseSaddle = 4786; - public const short DarkHorseSaddle = 4787; - public const short JoustingLance = 4788; - public const short ShadowJoustingLance = 4789; - public const short HallowJoustingLance = 4790; - public const short PogoStick = 4791; - public const short PirateShipMountItem = 4792; - public const short SpookyWoodMountItem = 4793; - public const short SantankMountItem = 4794; - public const short WallOfFleshGoatMountItem = 4795; - public const short DarkMageBookMountItem = 4796; - public const short KingSlimePetItem = 4797; - public const short EyeOfCthulhuPetItem = 4798; - public const short EaterOfWorldsPetItem = 4799; - public const short BrainOfCthulhuPetItem = 4800; - public const short SkeletronPetItem = 4801; - public const short QueenBeePetItem = 4802; - public const short DestroyerPetItem = 4803; - public const short TwinsPetItem = 4804; - public const short SkeletronPrimePetItem = 4805; - public const short PlanteraPetItem = 4806; - public const short GolemPetItem = 4807; - public const short DukeFishronPetItem = 4808; - public const short LunaticCultistPetItem = 4809; - public const short MoonLordPetItem = 4810; - public const short FairyQueenPetItem = 4811; - public const short PumpkingPetItem = 4812; - public const short EverscreamPetItem = 4813; - public const short IceQueenPetItem = 4814; - public const short MartianPetItem = 4815; - public const short DD2OgrePetItem = 4816; - public const short DD2BetsyPetItem = 4817; - public const short CombatWrench = 4818; - public const short DemonConch = 4819; - public const short BottomlessLavaBucket = 4820; - public const short FireproofBugNet = 4821; - public const short FlameWakerBoots = 4822; - public const short RainbowWings = 4823; - public const short WetBomb = 4824; - public const short LavaBomb = 4825; - public const short HoneyBomb = 4826; - public const short DryBomb = 4827; - public const short SuperheatedBlood = 4828; - public const short LicenseCat = 4829; - public const short LicenseDog = 4830; - public const short GemSquirrelAmethyst = 4831; - public const short GemSquirrelTopaz = 4832; - public const short GemSquirrelSapphire = 4833; - public const short GemSquirrelEmerald = 4834; - public const short GemSquirrelRuby = 4835; - public const short GemSquirrelDiamond = 4836; - public const short GemSquirrelAmber = 4837; - public const short GemBunnyAmethyst = 4838; - public const short GemBunnyTopaz = 4839; - public const short GemBunnySapphire = 4840; - public const short GemBunnyEmerald = 4841; - public const short GemBunnyRuby = 4842; - public const short GemBunnyDiamond = 4843; - public const short GemBunnyAmber = 4844; - public const short HellButterfly = 4845; - public const short HellButterflyJar = 4846; - public const short Lavafly = 4847; - public const short LavaflyinaBottle = 4848; - public const short MagmaSnail = 4849; - public const short MagmaSnailCage = 4850; - public const short GemTreeTopazSeed = 4851; - public const short GemTreeAmethystSeed = 4852; - public const short GemTreeSapphireSeed = 4853; - public const short GemTreeEmeraldSeed = 4854; - public const short GemTreeRubySeed = 4855; - public const short GemTreeDiamondSeed = 4856; - public const short GemTreeAmberSeed = 4857; - public const short PotSuspended = 4858; - public const short PotSuspendedDaybloom = 4859; - public const short PotSuspendedMoonglow = 4860; - public const short PotSuspendedWaterleaf = 4861; - public const short PotSuspendedShiverthorn = 4862; - public const short PotSuspendedBlinkroot = 4863; - public const short PotSuspendedDeathweedCorrupt = 4864; - public const short PotSuspendedDeathweedCrimson = 4865; - public const short PotSuspendedFireblossom = 4866; - public const short BrazierSuspended = 4867; - public const short VolcanoSmall = 4868; - public const short VolcanoLarge = 4869; - public const short PotionOfReturn = 4870; - public const short VanityTreeSakuraSeed = 4871; - public const short LavaAbsorbantSponge = 4872; - public const short HallowedHood = 4873; - public const short HellfireTreads = 4874; - public const short TeleportationPylonJungle = 4875; - public const short TeleportationPylonPurity = 4876; - public const short LavaCrate = 4877; - public const short LavaCrateHard = 4878; - public const short ObsidianLockbox = 4879; - public const short LavaFishbowl = 4880; - public const short LavaFishingHook = 4881; - public const short AmethystBunnyCage = 4882; - public const short TopazBunnyCage = 4883; - public const short SapphireBunnyCage = 4884; - public const short EmeraldBunnyCage = 4885; - public const short RubyBunnyCage = 4886; - public const short DiamondBunnyCage = 4887; - public const short AmberBunnyCage = 4888; - public const short AmethystSquirrelCage = 4889; - public const short TopazSquirrelCage = 4890; - public const short SapphireSquirrelCage = 4891; - public const short EmeraldSquirrelCage = 4892; - public const short RubySquirrelCage = 4893; - public const short DiamondSquirrelCage = 4894; - public const short AmberSquirrelCage = 4895; - public const short AncientHallowedMask = 4896; - public const short AncientHallowedHelmet = 4897; - public const short AncientHallowedHeadgear = 4898; - public const short AncientHallowedHood = 4899; - public const short AncientHallowedPlateMail = 4900; - public const short AncientHallowedGreaves = 4901; - public const short PottedLavaPlantPalm = 4902; - public const short PottedLavaPlantBush = 4903; - public const short PottedLavaPlantBramble = 4904; - public const short PottedLavaPlantBulb = 4905; - public const short PottedLavaPlantTendrils = 4906; - public const short VanityTreeYellowWillowSeed = 4907; - public const short DirtBomb = 4908; - public const short DirtStickyBomb = 4909; - public const short LicenseBunny = 4910; - public const short CoolWhip = 4911; - public const short FireWhip = 4912; - public const short ThornWhip = 4913; - public const short RainbowWhip = 4914; - public const short TungstenBullet = 4915; - public const short TeleportationPylonHallow = 4916; - public const short TeleportationPylonUnderground = 4917; - public const short TeleportationPylonOcean = 4918; - public const short TeleportationPylonDesert = 4919; - public const short TeleportationPylonSnow = 4920; - public const short TeleportationPylonMushroom = 4921; - public const short CavernFountain = 4922; - public const short PiercingStarlight = 4923; - public const short EyeofCthulhuMasterTrophy = 4924; - public const short EaterofWorldsMasterTrophy = 4925; - public const short BrainofCthulhuMasterTrophy = 4926; - public const short SkeletronMasterTrophy = 4927; - public const short QueenBeeMasterTrophy = 4928; - public const short KingSlimeMasterTrophy = 4929; - public const short WallofFleshMasterTrophy = 4930; - public const short TwinsMasterTrophy = 4931; - public const short DestroyerMasterTrophy = 4932; - public const short SkeletronPrimeMasterTrophy = 4933; - public const short PlanteraMasterTrophy = 4934; - public const short GolemMasterTrophy = 4935; - public const short DukeFishronMasterTrophy = 4936; - public const short LunaticCultistMasterTrophy = 4937; - public const short MoonLordMasterTrophy = 4938; - public const short UFOMasterTrophy = 4939; - public const short FlyingDutchmanMasterTrophy = 4940; - public const short MourningWoodMasterTrophy = 4941; - public const short PumpkingMasterTrophy = 4942; - public const short IceQueenMasterTrophy = 4943; - public const short EverscreamMasterTrophy = 4944; - public const short SantankMasterTrophy = 4945; - public const short DarkMageMasterTrophy = 4946; - public const short OgreMasterTrophy = 4947; - public const short BetsyMasterTrophy = 4948; - public const short FairyQueenMasterTrophy = 4949; - public const short QueenSlimeMasterTrophy = 4950; - public const short TeleportationPylonVictory = 4951; - public const short FairyQueenMagicItem = 4952; - public const short FairyQueenRangedItem = 4953; - public const short LongRainbowTrailWings = 4954; - public const short RabbitOrder = 4955; - public const short Zenith = 4956; - public const short QueenSlimeBossBag = 4957; - public const short QueenSlimeTrophy = 4958; - public const short QueenSlimeMask = 4959; - public const short QueenSlimePetItem = 4960; - public const short EmpressButterfly = 4961; - public const short AccentSlab = 4962; - public const short TruffleWormCage = 4963; - public const short EmpressButterflyJar = 4964; - public const short RockGolemBanner = 4965; - public const short BloodMummyBanner = 4966; - public const short SporeSkeletonBanner = 4967; - public const short SporeBatBanner = 4968; - public const short LarvaeAntlionBanner = 4969; - public const short CrimsonBunnyBanner = 4970; - public const short CrimsonGoldfishBanner = 4971; - public const short CrimsonPenguinBanner = 4972; - public const short BigMimicCorruptionBanner = 4973; - public const short BigMimicCrimsonBanner = 4974; - public const short BigMimicHallowBanner = 4975; - public const short MossHornetBanner = 4976; - public const short WanderingEyeBanner = 4977; - public const short CreativeWings = 4978; - public const short MusicBoxQueenSlime = 4979; - public const short QueenSlimeHook = 4980; - public const short QueenSlimeMountSaddle = 4981; - public const short CrystalNinjaHelmet = 4982; - public const short CrystalNinjaChestplate = 4983; - public const short CrystalNinjaLeggings = 4984; - public const short MusicBoxEmpressOfLight = 4985; - public const short GelBalloon = 4986; - public const short VolatileGelatin = 4987; - public const short QueenSlimeCrystal = 4988; - public const short EmpressFlightBooster = 4989; - public const short MusicBoxDukeFishron = 4990; - public const short MusicBoxMorningRain = 4991; - public const short MusicBoxConsoleTitle = 4992; - public const short ChippysCouch = 4993; - public const short GraduationCapBlue = 4994; - public const short GraduationCapMaroon = 4995; - public const short GraduationCapBlack = 4996; - public const short GraduationGownBlue = 4997; - public const short GraduationGownMaroon = 4998; - public const short GraduationGownBlack = 4999; - public const short TerrasparkBoots = 5000; - public const short MoonLordLegs = 5001; - public const short OceanCrate = 5002; - public const short OceanCrateHard = 5003; - public const short BadgersHat = 5004; - public const short EmpressBlade = 5005; - public const short MusicBoxUndergroundDesert = 5006; - public const short DeadMansSweater = 5007; - public const short TeaKettle = 5008; - public const short Teacup = 5009; - public const short TreasureMagnet = 5010; - public const short Mace = 5011; - public const short FlamingMace = 5012; - public const short SleepingIcon = 5013; - public const short MusicBoxOWRain = 5014; - public const short MusicBoxOWDay = 5015; - public const short MusicBoxOWNight = 5016; - public const short MusicBoxOWUnderground = 5017; - public const short MusicBoxOWDesert = 5018; - public const short MusicBoxOWOcean = 5019; - public const short MusicBoxOWMushroom = 5020; - public const short MusicBoxOWDungeon = 5021; - public const short MusicBoxOWSpace = 5022; - public const short MusicBoxOWUnderworld = 5023; - public const short MusicBoxOWSnow = 5024; - public const short MusicBoxOWCorruption = 5025; - public const short MusicBoxOWUndergroundCorruption = 5026; - public const short MusicBoxOWCrimson = 5027; - public const short MusicBoxOWUndergroundCrimson = 5028; - public const short MusicBoxOWUndergroundSnow = 5029; - public const short MusicBoxOWUndergroundHallow = 5030; - public const short MusicBoxOWBloodMoon = 5031; - public const short MusicBoxOWBoss2 = 5032; - public const short MusicBoxOWBoss1 = 5033; - public const short MusicBoxOWInvasion = 5034; - public const short MusicBoxOWTowers = 5035; - public const short MusicBoxOWMoonLord = 5036; - public const short MusicBoxOWPlantera = 5037; - public const short MusicBoxOWJungle = 5038; - public const short MusicBoxOWWallOfFlesh = 5039; - public const short MusicBoxOWHallow = 5040; - public const short MilkCarton = 5041; - public const short CoffeeCup = 5042; - public const short TorchGodsFavor = 5043; - public const short MusicBoxCredits = 5044; - public const short Count = 5045; + public const short Count = 3930; private static Dictionary GenerateLegacyItemDictionary() => new Dictionary() { @@ -7896,1002 +6779,39 @@ namespace Terraria.ID public class Sets { - public static SetFactory Factory = new SetFactory(5045); - public static List ItemsThatAreProcessedAfterNormalContentSample = new List() - { - 1533, - 1534, - 1535, - 1536, - 1537 - }; - public static bool[] ItemsThatAllowRepeatedRightClick = ItemID.Sets.Factory.CreateBoolSet(false, 3384, 3858, 3852); - public static bool[] ItemsThatCountAsBombsForDemolitionistToSpawn = ItemID.Sets.Factory.CreateBoolSet(false, 168, 2586, 3116, 166, 235, 3115, 167, 2896, 3547, 3196, 4423, 1130, 1168, 4824, 4825, 4826, 4827, 4908, 4909); - public static int[] NewItemSpawnPriority = ItemID.Sets.Factory.CreateIntSet(0, 2, 200, 3, 150, 61, 150, 836, 150, 409, 150, 593, 200, 664, 100, 834, 100, 833, 100, 835, 100, 169, 100, 370, 100, 1246, 100, 408, 100, 3271, 150, 3277, 150, 3339, 150, 3276, 150, 3272, 150, 3274, 150, 3275, 150, 3338, 150, 176, 100, 172, 200, 424, 50, 1103, 50, 3087, 100, 3066, 100); - public static bool?[] CanBeQuickusedOnGamepad = ItemID.Sets.Factory.CreateCustomSet(new bool?(), (object) (short) 50, (object) true, (object) (short) 3199, (object) true, (object) (short) 3124, (object) true, (object) (short) 2350, (object) true, (object) (short) 2351, (object) true, (object) (short) 29, (object) true, (object) (short) 109, (object) true, (object) (short) 1291, (object) true, (object) (short) 4870, (object) true); - public static bool?[] ForcesBreaksSleeping = ItemID.Sets.Factory.CreateCustomSet(new bool?(), (object) (short) 1991, (object) true, (object) (short) 4821, (object) true, (object) (short) 3183, (object) true); - public static bool[] SkipsInitialUseSound = ItemID.Sets.Factory.CreateBoolSet(false, 2350, 4870); - public static bool[] UsesCursedByPlanteraTooltip = ItemID.Sets.Factory.CreateBoolSet(false, 1533, 1534, 1535, 1536, 1537, 4714); - public static bool[] IsAKite = ItemID.Sets.Factory.CreateBoolSet(false, 4367, 4368, 4369, 4370, 4371, 4379, 4610, 4611, 4612, 4613, 4648, 4649, 4650, 4651, 4669, 4670, 4671, 4674, 4675, 4676, 4677, 4681, 4683, 4684); - public static bool?[] ForceConsumption = ItemID.Sets.Factory.CreateCustomSet(new bool?(), (object) (short) 2350, (object) false, (object) (short) 4870, (object) false, (object) (short) 2351, (object) false, (object) (short) 2756, (object) false, (object) (short) 4343, (object) true, (object) (short) 4344, (object) true); - public static bool[] HasAProjectileThatHasAUsabilityCheck = ItemID.Sets.Factory.CreateBoolSet(false, 4367, 4368, 4369, 4370, 4371, 4379, 4610, 4611, 4612, 4613, 4648, 4649, 4650, 4651, 4669, 4670, 4671, 4674, 4675, 4676, 4677, 4681, 4683, 4684); - public static bool[] CanGetPrefixes = ItemID.Sets.Factory.CreateBoolSet(true, 267, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 576, 1307, 1596, 1597, 1598, 1599, 1600, 1601, 1602, 1603, 1604, 1605, 1606, 1607, 1608, 1609, 1610); - public static List NonColorfulDyeItems = new List() - { - 3599, - 3530, - 3534 - }; - public static bool[] ColorfulDyeValues = new bool[0]; - public static FlowerPacketInfo[] flowerPacketInfo = ItemID.Sets.Factory.CreateCustomSet((FlowerPacketInfo) null, (object) (short) 4041, (object) new FlowerPacketInfo() - { - stylesOnPurity = { - 9, - 16, - 20 - } - }, (object) (short) 4042, (object) new FlowerPacketInfo() - { - stylesOnPurity = { - 6, - 30, - 31, - 32 - } - }, (object) (short) 4043, (object) new FlowerPacketInfo() - { - stylesOnPurity = { - 7, - 17, - 33, - 34, - 35 - } - }, (object) (short) 4044, (object) new FlowerPacketInfo() - { - stylesOnPurity = { - 19, - 21, - 22, - 23, - 39, - 40, - 41 - } - }, (object) (short) 4045, (object) new FlowerPacketInfo() - { - stylesOnPurity = { - 10, - 11, - 13, - 18, - 24, - 25, - 26 - } - }, (object) (short) 4046, (object) new FlowerPacketInfo() - { - stylesOnPurity = { - 12, - 42, - 43, - 44 - } - }, (object) (short) 4047, (object) new FlowerPacketInfo() - { - stylesOnPurity = { - 14, - 15, - 27, - 28, - 29, - 36, - 37, - 38 - } - }, (object) (short) 4241, (object) new FlowerPacketInfo() - { - stylesOnPurity = { - 6, - 7, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 30, - 31, - 32, - 33, - 34, - 35, - 36, - 37, - 38, - 39, - 40, - 41, - 42, - 43, - 44 - } - }, (object) (short) 4048, (object) new FlowerPacketInfo() - { - stylesOnPurity = { - 0, - 1, - 2, - 3, - 4, - 5 - } - }); - public static bool[] IsAMaterial = ItemID.Sets.Factory.CreateBoolSet(); - public static bool[] IgnoresEncumberingStone = ItemID.Sets.Factory.CreateBoolSet(58, 184, 1734, 1735, 1867, 1868, 3453, 3454, 3455, 4143); - public static float[] ToolTipDamageMultiplier = ItemID.Sets.Factory.CreateFloatSet(1f, 162f, 2f, 801f, 2f, 163f, 2f, 220f, 2f, 389f, 2f, 1259f, 2f, 4272f, 2f, 5011f, 2f, 5012f, 2f); - public static bool[] IsAPickup = ItemID.Sets.Factory.CreateBoolSet(58, 184, 1734, 1735, 1867, 1868, 3453, 3454, 3455); - public static bool[] IsDrill = ItemID.Sets.Factory.CreateBoolSet(388, 1231, 385, 386, 2779, 1196, 1189, 2784, 3464, 1203, 2774, 579); - public static bool[] IsChainsaw = ItemID.Sets.Factory.CreateBoolSet(387, 3098, 1232, 383, 384, 2778, 1197, 1190, 2783, 3463, 1204, 2773, 2342, 579); - public static bool[] IsPaintScraper = ItemID.Sets.Factory.CreateBoolSet(1100, 1545); - public static bool[] SummonerWeaponThatScalesWithAttackSpeed = ItemID.Sets.Factory.CreateBoolSet(4672, 4679, 4680, 4678, 4913, 4912, 4911, 4914); - public static bool[] IsFood = ItemID.Sets.Factory.CreateBoolSet(353, 357, 1787, 1911, 1912, 1919, 1920, 2266, 2267, 2268, 2425, 2426, 2427, 3195, 3532, 4009, 4010, 4011, 4012, 4013, 4014, 4015, 4016, 4017, 4018, 4019, 4020, 4021, 4022, 4023, 4024, 4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 4033, 4034, 4035, 4036, 4037, 967, 969, 4282, 4283, 4284, 4285, 4286, 4287, 4288, 4289, 4290, 4291, 4292, 4293, 4294, 4295, 4296, 4297, 4403, 4411, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 5009, 5042, 5041); - public static Color[][] FoodParticleColors = ItemID.Sets.Factory.CreateCustomSet(new Color[0], (object) (short) 357, (object) new Color[2] - { - new Color(253, 209, 77), - new Color(253, 178, 78) - }, (object) (short) 1787, (object) new Color[3] - { - new Color(215, 146, 96), - new Color(250, 160, 15), - new Color(226, 130, 33) - }, (object) (short) 1911, (object) new Color[4] - { - new Color(219, 219, 213), - new Color((int) byte.MaxValue, 228, 133), - new Color(237, 159, 85), - new Color(207, 32, 51) - }, (object) (short) 1919, (object) new Color[4] - { - new Color(206, 168, 119), - new Color(73, 182, 126), - new Color(230, 89, 92), - new Color(228, 238, 241) - }, (object) (short) 1920, (object) new Color[4] - { - new Color(218, 167, 69), - new Color(204, 209, 219), - new Color(204, 22, 40), - new Color(0, 212, 47) - }, (object) (short) 2267, (object) new Color[3] - { - new Color(229, 129, 82), - new Color((int) byte.MaxValue, 223, 126), - new Color(190, 226, 65) - }, (object) (short) 2268, (object) new Color[3] - { - new Color(250, 232, 220), - new Color(216, 189, 157), - new Color(190, 226, 65) - }, (object) (short) 2425, (object) new Color[4] - { - new Color(199, 166, 129), - new Color((int) sbyte.MaxValue, 105, 81), - new Color(128, 151, 43), - new Color(193, 14, 7) - }, (object) (short) 2426, (object) new Color[2] - { - new Color(246, 187, 165), - new Color((int) byte.MaxValue, 134, 86) - }, (object) (short) 2427, (object) new Color[3] - { - new Color(235, 122, 128), - new Color(216, 193, 186), - new Color(252, 108, 40) - }, (object) (short) 3195, (object) new Color[4] - { - new Color(139, 86, 218), - new Color(218, 86, 104), - new Color(218, 182, 86), - new Color(36, 203, 185) - }, (object) (short) 3532, (object) new Color[2] - { - new Color(218, 113, 90), - new Color(183, 65, 68) - }, (object) (short) 4009, (object) new Color[2] - { - new Color(221, 67, 87), - new Color((int) byte.MaxValue, 252, 217) - }, (object) (short) 4011, (object) new Color[2] - { - new Color(224, 143, 91), - new Color(214, 170, 105) - }, (object) (short) 4012, (object) new Color[4] - { - new Color((int) byte.MaxValue, 236, 184), - new Color(242, 183, 236), - new Color(215, 137, 122), - new Color(242, 70, 88) - }, (object) (short) 4013, (object) new Color[2] - { - new Color(216, 93, 61), - new Color(159, 48, 28) - }, (object) (short) 4014, (object) new Color[3] - { - new Color(216, 93, 61), - new Color(205, 150, 71), - new Color(123, 72, 27) - }, (object) (short) 4015, (object) new Color[4] - { - new Color(197, 136, 85), - new Color(143, 86, 59), - new Color(100, 156, 58), - new Color(216, 93, 61) - }, (object) (short) 4016, (object) new Color[2] - { - new Color(241, 167, 70), - new Color(215, 121, 64) - }, (object) (short) 4017, (object) new Color[3] - { - new Color(200, 133, 84), - new Color(141, 71, 19), - new Color(103, 54, 18) - }, (object) (short) 4019, (object) new Color[3] - { - new Color(248, 234, 196), - new Color(121, 92, 18), - new Color(128, 151, 43) - }, (object) (short) 4020, (object) new Color[2] - { - new Color(237, 243, 248), - new Color((int) byte.MaxValue, 200, 82) - }, (object) (short) 4021, (object) new Color[3] - { - new Color((int) byte.MaxValue, 221, 119), - new Color(241, 167, 70), - new Color(215, 121, 64) - }, (object) (short) 4022, (object) new Color[3] - { - new Color((int) byte.MaxValue, 249, 181), - new Color(203, 179, 73), - new Color(216, 93, 61) - }, (object) (short) 4023, (object) new Color[2] - { - new Color(189, 0, 107) * 0.5f, - new Color(123, 0, 57) * 0.5f - }, (object) (short) 4024, (object) new Color[2] - { - new Color(217, 134, 83), - new Color(179, 80, 54) - }, (object) (short) 4025, (object) new Color[3] - { - new Color(229, 114, 63), - new Color((int) byte.MaxValue, 184, 51), - new Color(197, 136, 85) - }, (object) (short) 4026, (object) new Color[4] - { - new Color(245, 247, 250), - new Color(142, 96, 60), - new Color(204, 209, 219), - new Color(234, 85, 79) - }, (object) (short) 4028, (object) new Color[3] - { - new Color((int) byte.MaxValue, 250, 184), - new Color(217, 123, 0), - new Color(209, 146, 33) - }, (object) (short) 4029, (object) new Color[4] - { - new Color((int) byte.MaxValue, 250, 184), - new Color(167, 57, 68), - new Color(209, 146, 33), - new Color(220, 185, 152) - }, (object) (short) 4030, (object) new Color[3] - { - new Color(247, 237, (int) sbyte.MaxValue), - new Color(215, 187, 59), - new Color(174, 139, 43) - }, (object) (short) 4031, (object) new Color[3] - { - new Color((int) byte.MaxValue, 198, 134), - new Color(219, 109, 68), - new Color(160, 83, 63) - }, (object) (short) 4032, (object) new Color[3] - { - new Color(228, 152, 107), - new Color(170, 81, 57), - new Color(128, 49, 49) - }, (object) (short) 4033, (object) new Color[3] - { - new Color(190, 226, 65), - new Color(63, 69, 15), - new Color(173, 50, 37) - }, (object) (short) 4034, (object) new Color[4] - { - new Color((int) byte.MaxValue, 134, 86), - new Color(193, 57, 37), - new Color(186, 155, 130), - new Color(178, 206, 46) - }, (object) (short) 4035, (object) new Color[4] - { - new Color(234, 244, 82), - new Color((int) byte.MaxValue, 182, 121), - new Color(205, 89, 0), - new Color(240, 157, 81) - }, (object) (short) 4036, (object) new Color[4] - { - new Color(223, 207, 74), - new Color(189, 158, 36), - new Color(226, 45, 38), - new Color(131, 9, 0) - }, (object) (short) 4037, (object) new Color[3] - { - new Color(195, 109, 68), - new Color(162, 69, 59), - new Color(209, 194, 189) - }, (object) (short) 4282, (object) new Color[2] - { - new Color(237, 169, 78), - new Color(211, 106, 62) - }, (object) (short) 4283, (object) new Color[3] - { - new Color(242, 235, 172), - new Color(254, 247, 177), - new Color((int) byte.MaxValue, 230, 122) - }, (object) (short) 4284, (object) new Color[3] - { - new Color(59, 81, 114), - new Color(105, 62, 118), - new Color(35, 22, 57) - }, (object) (short) 4285, (object) new Color[3] - { - new Color(231, 115, 68), - new Color(212, 42, 55), - new Color(168, 16, 37) - }, (object) (short) 4286, (object) new Color[2] - { - new Color(185, 27, 68), - new Color(124, 17, 53) - }, (object) (short) 4287, (object) new Color[3] - { - new Color(199, 163, 121), - new Color(250, 245, 218), - new Color(252, 250, 235) - }, (object) (short) 4288, (object) new Color[4] - { - new Color(209, 44, 90), - new Color(83, 83, 83), - new Color(245, 245, 245), - new Color(250, 250, 250) - }, (object) (short) 4289, (object) new Color[3] - { - new Color(59, 81, 114), - new Color(105, 62, 118), - new Color(35, 22, 57) - }, (object) (short) 4290, (object) new Color[3] - { - new Color(247, 178, 52), - new Color(221, 60, 96), - new Color(225, 83, 115) - }, (object) (short) 4291, (object) new Color[2] - { - new Color(254, 231, 67), - new Color(253, 239, 117) - }, (object) (short) 4292, (object) new Color[3] - { - new Color(231, 121, 68), - new Color(216, 139, 33), - new Color(251, 220, 77) - }, (object) (short) 4293, (object) new Color[2] - { - new Color(242, 153, 80), - new Color(248, 208, 52) - }, (object) (short) 4294, (object) new Color[2] - { - new Color(253, 208, 17), - new Color(253, 239, 117) - }, (object) (short) 4295, (object) new Color[3] - { - new Color(192, 47, 129), - new Color(247, 178, 52), - new Color(251, 220, 77) - }, (object) (short) 4296, (object) new Color[3] - { - new Color(212, 42, 55), - new Color(250, 245, 218), - new Color(252, 250, 235) - }, (object) (short) 4297, (object) new Color[2] - { - new Color(253, 239, 117), - new Color(254, 247, 177) - }, (object) (short) 4403, (object) new Color[4] - { - new Color((int) byte.MaxValue, 134, 86), - new Color(193, 57, 37), - new Color(242, 202, 174), - new Color(128, 151, 43) - }, (object) (short) 4411, (object) new Color[2] - { - new Color(191, 157, 174), - new Color(222, 196, 197) - }, (object) (short) 4625, (object) new Color[3] - { - new Color((int) byte.MaxValue, 230, 122), - new Color(216, 69, 33), - new Color(128, 151, 43) - }); - public static Color[][] DrinkParticleColors = ItemID.Sets.Factory.CreateCustomSet(new Color[0], (object) (short) 28, (object) new Color[3] - { - new Color(164, 16, 47), - new Color(246, 34, 79), - new Color((int) byte.MaxValue, 95, 129) - }, (object) (short) 110, (object) new Color[3] - { - new Color(16, 45, 152), - new Color(11, 61, 245), - new Color(93, (int) sbyte.MaxValue, (int) byte.MaxValue) - }, (object) (short) 126, (object) new Color[3] - { - new Color(9, 61, 191), - new Color(30, 84, 220), - new Color(51, 107, 249) - }, (object) (short) 188, (object) new Color[3] - { - new Color(164, 16, 47), - new Color(246, 34, 79), - new Color((int) byte.MaxValue, 95, 129) - }, (object) (short) 189, (object) new Color[3] - { - new Color(16, 45, 152), - new Color(11, 61, 245), - new Color(93, (int) sbyte.MaxValue, (int) byte.MaxValue) - }, (object) (short) 226, (object) new Color[3] - { - new Color(200, 25, 116), - new Color(229, 30, 202), - new Color(254, 149, 210) - }, (object) (short) 227, (object) new Color[3] - { - new Color(200, 25, 116), - new Color(229, 30, 202), - new Color(254, 149, 210) - }, (object) (short) 288, (object) new Color[3] - { - new Color(58, 48, 102), - new Color(90, 72, 168), - new Color(132, 116, 199) - }, (object) (short) 289, (object) new Color[3] - { - new Color(174, 13, 97), - new Color((int) byte.MaxValue, 156, 209), - new Color((int) byte.MaxValue, 56, 162) - }, (object) (short) 290, (object) new Color[3] - { - new Color(83, 137, 13), - new Color(100, 164, 16), - new Color(134, 230, 10) - }, (object) (short) 291, (object) new Color[3] - { - new Color(13, 74, 137), - new Color(16, 89, 164), - new Color(10, 119, 230) - }, (object) (short) 292, (object) new Color[3] - { - new Color(164, 159, 16), - new Color(230, 222, 10), - new Color((int) byte.MaxValue, 252, 159) - }, (object) (short) 293, (object) new Color[3] - { - new Color(137, 13, 86), - new Color(230, 10, 139), - new Color((int) byte.MaxValue, 144, 210) - }, (object) (short) 294, (object) new Color[3] - { - new Color(66, 13, 137), - new Color(103, 10, 230), - new Color(163, 95, (int) byte.MaxValue) - }, (object) (short) 295, (object) new Color[3] - { - new Color(13, 106, 137), - new Color(10, 176, 230), - new Color(146, 229, (int) byte.MaxValue) - }, (object) (short) 296, (object) new Color[3] - { - new Color(146, 102, 14), - new Color(225, 185, 22), - new Color(250, 213, 64) - }, (object) (short) 297, (object) new Color[3] - { - new Color(9, 101, 110), - new Color(15, 164, 177), - new Color(34, 229, 246) - }, (object) (short) 298, (object) new Color[3] - { - new Color(133, 137, 13), - new Color(222, 230, 10), - new Color(252, 254, 161) - }, (object) (short) 299, (object) new Color[3] - { - new Color(92, 137, 13), - new Color(121, 184, 11), - new Color(189, (int) byte.MaxValue, 73) - }, (object) (short) 300, (object) new Color[3] - { - new Color(81, 60, 120), - new Color((int) sbyte.MaxValue, 96, 184), - new Color(165, 142, 208) - }, (object) (short) 301, (object) new Color[3] - { - new Color(112, 137, 13), - new Color(163, 202, 7), - new Color(204, 246, 34) - }, (object) (short) 302, (object) new Color[3] - { - new Color(12, 63, 131), - new Color(16, 79, 164), - new Color(34, 124, 246) - }, (object) (short) 303, (object) new Color[3] - { - new Color(164, 96, 16), - new Color(230, 129, 10), - new Color((int) byte.MaxValue, 200, 134) - }, (object) (short) 304, (object) new Color[3] - { - new Color(137, 63, 13), - new Color(197, 87, 13), - new Color(230, 98, 10) - }, (object) (short) 305, (object) new Color[3] - { - new Color(69, 13, 131), - new Color(134, 34, 246), - new Color(170, 95, (int) byte.MaxValue) - }, (object) (short) 499, (object) new Color[3] - { - new Color(164, 16, 47), - new Color(246, 34, 79), - new Color((int) byte.MaxValue, 95, 129) - }, (object) (short) 500, (object) new Color[3] - { - new Color(16, 45, 152), - new Color(11, 61, 245), - new Color(93, (int) sbyte.MaxValue, (int) byte.MaxValue) - }, (object) (short) 678, (object) new Color[2] - { - new Color(254, 0, 38), - new Color(199, 29, 15) - }, (object) (short) 967, (object) new Color[2] - { - new Color(221, 226, 229), - new Color(180, 189, 194) - }, (object) (short) 969, (object) new Color[3] - { - new Color(150, 99, 69), - new Color(219, 170, 132), - new Color(251, 244, 240) - }, (object) (short) 1134, (object) new Color[3] - { - new Color(235, 144, 10), - new Color(254, 194, 20), - new Color(254, 246, 37) - }, (object) (short) 1340, (object) new Color[3] - { - new Color(151, 79, 162), - new Color(185, 128, 193), - new Color(240, 185, 217) - }, (object) (short) 1353, (object) new Color[3] - { - new Color(77, 227, 45), - new Color(218, 253, 9), - new Color(96, 248, 2) - }, (object) (short) 1354, (object) new Color[3] - { - new Color(235, 36, 1), - new Color((int) byte.MaxValue, (int) sbyte.MaxValue, 39), - new Color((int) byte.MaxValue, 203, 83) - }, (object) (short) 1355, (object) new Color[3] - { - new Color(148, 126, 24), - new Color(233, 207, 137), - new Color((int) byte.MaxValue, 249, 183) - }, (object) (short) 1356, (object) new Color[3] - { - new Color(253, 152, 0), - new Color(254, 202, 80), - new Color((int) byte.MaxValue, 251, 166) - }, (object) (short) 1357, (object) new Color[3] - { - new Color(106, 107, 134), - new Color(118, 134, 207), - new Color(120, 200, 226) - }, (object) (short) 1358, (object) new Color[3] - { - new Color(202, 0, 147), - new Color((int) byte.MaxValue, 66, 222), - new Color((int) byte.MaxValue, 170, 253) - }, (object) (short) 1359, (object) new Color[3] - { - new Color(45, 174, 76), - new Color(112, 218, 138), - new Color(182, 236, 195) - }, (object) (short) 1977, (object) new Color[3] - { - new Color(221, 0, 0), - new Color(146, 17, 17), - new Color(51, 21, 21) - }, (object) (short) 1978, (object) new Color[3] - { - new Color(24, 92, 248), - new Color(97, 112, 169), - new Color(228, 228, 228) - }, (object) (short) 1979, (object) new Color[4] - { - new Color(128, 128, 128), - new Color(151, 107, 75), - new Color(13, 101, 36), - new Color(28, 216, 94) - }, (object) (short) 1980, (object) new Color[3] - { - new Color(122, 92, 10), - new Color(185, 164, 23), - new Color(241, 227, 75) - }, (object) (short) 1981, (object) new Color[2] - { - new Color((int) byte.MaxValue, 186, 0), - new Color(87, 20, 170) - }, (object) (short) 1982, (object) new Color[4] - { - new Color(218, 183, 59), - new Color(59, 218, 85), - new Color(59, 149, 218), - new Color(218, 59, 59) - }, (object) (short) 1983, (object) new Color[4] - { - new Color(208, 80, 80), - new Color(109, 106, 174), - new Color(143, 215, 29), - new Color(30, 150, 72) - }, (object) (short) 1984, (object) new Color[4] - { - new Color((int) byte.MaxValue, 9, 172), - new Color(219, 4, 121), - new Color(111, 218, 171), - new Color(72, 175, 130) - }, (object) (short) 1985, (object) new Color[4] - { - new Color(176, 101, 239), - new Color(101, 238, 239), - new Color(221, 0, 0), - new Color(62, 235, 137) - }, (object) (short) 1986, (object) new Color[3] - { - new Color(55, 246, 211), - new Color(20, 223, 168), - new Color(0, 181, 128) - }, (object) (short) 1990, (object) new Color[3] - { - new Color(254, 254, 254), - new Color(214, 232, 240), - new Color(234, 242, 246) - }, (object) (short) 2209, (object) new Color[3] - { - new Color(16, 45, 152), - new Color(11, 61, 245), - new Color(93, (int) sbyte.MaxValue, (int) byte.MaxValue) - }, (object) (short) 2322, (object) new Color[3] - { - new Color(55, 92, 95), - new Color(84, 149, 154), - new Color(149, 196, 200) - }, (object) (short) 2323, (object) new Color[3] - { - new Color(91, 8, 106), - new Color(184, 9, 131), - new Color(250, 64, 188) - }, (object) (short) 2324, (object) new Color[3] - { - new Color(21, 40, 138), - new Color(102, 101, 201), - new Color(122, 147, 196) - }, (object) (short) 2325, (object) new Color[3] - { - new Color(100, 67, 50), - new Color(141, 93, 68), - new Color(182, 126, 97) - }, (object) (short) 2326, (object) new Color[3] - { - new Color(159, 224, 124), - new Color(92, 175, 46), - new Color(51, 95, 27) - }, (object) (short) 2327, (object) new Color[3] - { - new Color(95, 194, (int) byte.MaxValue), - new Color(12, 109, 167), - new Color(13, 76, 115) - }, (object) (short) 2328, (object) new Color[3] - { - new Color(215, 241, 109), - new Color(150, 178, 31), - new Color(105, 124, 25) - }, (object) (short) 2329, (object) new Color[3] - { - new Color(251, 105, 29), - new Color(220, 73, 4), - new Color(140, 33, 10) - }, (object) (short) 2344, (object) new Color[3] - { - new Color(166, 166, 166), - new Color((int) byte.MaxValue, 186, 0), - new Color(165, 58, 0) - }, (object) (short) 2345, (object) new Color[3] - { - new Color(239, 17, 0), - new Color(209, 15, 0), - new Color(136, 9, 0) - }, (object) (short) 2346, (object) new Color[3] - { - new Color(156, 157, 153), - new Color(99, 99, 99), - new Color(63, 62, 58) - }, (object) (short) 2347, (object) new Color[3] - { - new Color(243, 11, 11), - new Color((int) byte.MaxValue, 188, 55), - new Color(252, 136, 58) - }, (object) (short) 2348, (object) new Color[3] - { - new Color((int) byte.MaxValue, 227, 0), - new Color((int) byte.MaxValue, 135, 0), - new Color(226, 56, 0) - }, (object) (short) 2349, (object) new Color[3] - { - new Color(120, 36, 30), - new Color(216, 73, 63), - new Color(233, 125, 117) - }, (object) (short) 2351, (object) new Color[3] - { - new Color((int) byte.MaxValue, 95, 252), - new Color(147, 0, 240), - new Color(67, 0, 150) - }, (object) (short) 2354, (object) new Color[3] - { - new Color(117, 233, 164), - new Color(40, 199, 103), - new Color(30, 120, 66) - }, (object) (short) 2355, (object) new Color[3] - { - new Color(217, 254, 161), - new Color(69, 110, 9), - new Color(135, 219, 11) - }, (object) (short) 2356, (object) new Color[3] - { - new Color(233, 175, 117), - new Color(199, 120, 40), - new Color(143, 89, 36) - }, (object) (short) 2359, (object) new Color[3] - { - new Color((int) byte.MaxValue, 51, 0), - new Color(248, 184, 0), - new Color((int) byte.MaxValue, 215, 0) - }, (object) (short) 2756, (object) new Color[4] - { - new Color(178, 236, (int) byte.MaxValue), - new Color(92, 214, (int) byte.MaxValue), - new Color(184, 96, 163), - new Color((int) byte.MaxValue, 78, 178) - }, (object) (short) 2863, (object) new Color[3] - { - new Color(97, 199, 224), - new Color(98, 152, 177), - new Color(26, 232, 249) - }, (object) (short) 3001, (object) new Color[3] - { - new Color(104, 25, 103), - new Color(155, 32, 154), - new Color(190, 138, 223) - }, (object) (short) 3259, (object) new Color[4] - { - new Color(40, 20, 66), - new Color(186, 68, (int) byte.MaxValue), - new Color(26, 8, 49), - new Color((int) byte.MaxValue, 122, (int) byte.MaxValue) - }, (object) (short) 3544, (object) new Color[3] - { - new Color(164, 16, 47), - new Color(246, 34, 79), - new Color((int) byte.MaxValue, 95, 129) - }, (object) (short) 353, (object) new Color[3] - { - new Color(205, 152, 2) * 0.5f, - new Color(240, 208, 88) * 0.5f, - new Color(251, 243, 215) * 0.5f - }, (object) (short) 1912, (object) new Color[3] - { - new Color(237, 159, 85), - new Color((int) byte.MaxValue, 228, 133), - new Color(149, 97, 45) - }, (object) (short) 2266, (object) new Color[1] - { - new Color(233, 233, 218) * 0.3f - }, (object) (short) 4018, (object) new Color[2] - { - new Color(214, 170, 105) * 0.5f, - new Color(180, 132, 73) * 0.5f - }, (object) (short) 4027, (object) new Color[4] - { - new Color(242, 183, 236), - new Color(245, 242, 193), - new Color(226, 133, 217), - new Color(242, 70, 88) - }, (object) (short) 4477, (object) new Color[2] - { - new Color(161, 192, 220), - new Color(143, 154, 201) - }, (object) (short) 4478, (object) new Color[2] - { - new Color(40, 60, 70), - new Color(26, 27, 36) - }, (object) (short) 4479, (object) new Color[2] - { - new Color(224, 0, 152), - new Color(137, 13, 126) - }, (object) (short) 4614, (object) new Color[2] - { - new Color(153, 62, 2), - new Color(208, 166, 59) - }, (object) (short) 4615, (object) new Color[2] - { - new Color(164, 88, 178), - new Color(124, 64, 152) - }, (object) (short) 4616, (object) new Color[2] - { - new Color((int) byte.MaxValue, 245, 109), - new Color(235, 210, 89) - }, (object) (short) 4617, (object) new Color[2] - { - new Color(245, 247, 250), - new Color((int) byte.MaxValue, 250, 133) - }, (object) (short) 4618, (object) new Color[2] - { - new Color((int) byte.MaxValue, 175, 133), - new Color(237, 93, 85) - }, (object) (short) 4619, (object) new Color[2] - { - new Color(247, 245, 224), - new Color(232, 214, 179) - }, (object) (short) 4620, (object) new Color[2] - { - new Color(181, 215, 0), - new Color((int) byte.MaxValue, 112, 4) - }, (object) (short) 4621, (object) new Color[2] - { - new Color(242, 134, 81), - new Color(153, 2, 42) - }, (object) (short) 4622, (object) new Color[2] - { - new Color(90, 62, 123), - new Color(59, 49, 104) - }, (object) (short) 4623, (object) new Color[3] - { - new Color((int) byte.MaxValue, 175, 152), - new Color(147, (int) byte.MaxValue, 228), - new Color(231, 247, 150) - }, (object) (short) 4624, (object) new Color[2] - { - new Color(155, 0, 67), - new Color(208, 124, 59) - }, (object) (short) 5009, (object) new Color[2] - { - new Color(210, 130, 10), - new Color((int) byte.MaxValue, 195, 20) - }, (object) (short) 5041, (object) new Color[2] - { - new Color(221, 226, 229), - new Color(180, 189, 194) - }, (object) (short) 5042, (object) new Color[2] - { - new Color(70, 43, 21), - new Color(142, 96, 60) - }); + public static SetFactory Factory = new SetFactory(3930); private static ItemID.BannerEffect DD2BannerEffect = ItemID.BannerEffect.None; public static ItemID.BannerEffect[] BannerStrength = ItemID.Sets.Factory.CreateCustomSet(new ItemID.BannerEffect(), (object) (short) 3838, (object) ItemID.Sets.DD2BannerEffect, (object) (short) 3845, (object) ItemID.Sets.DD2BannerEffect, (object) (short) 3837, (object) ItemID.Sets.DD2BannerEffect, (object) (short) 3844, (object) ItemID.Sets.DD2BannerEffect, (object) (short) 3843, (object) ItemID.Sets.DD2BannerEffect, (object) (short) 3839, (object) ItemID.Sets.DD2BannerEffect, (object) (short) 3840, (object) ItemID.Sets.DD2BannerEffect, (object) (short) 3842, (object) ItemID.Sets.DD2BannerEffect, (object) (short) 3841, (object) ItemID.Sets.DD2BannerEffect, (object) (short) 3846, (object) ItemID.Sets.DD2BannerEffect); - public static int[] KillsToBanner = ItemID.Sets.Factory.CreateIntSet(50, 3838, 1000, 3845, 200, 3837, 500, 3844, 200, 3843, 50, 3839, 200, 3840, 100, 3842, 200, 3841, 100, 3846, 50, 2971, 200, 2982, 100, 2994, 100); + public static int[] KillsToBanner = ItemID.Sets.Factory.CreateIntSet(50, 3838, 1000, 3845, 200, 3837, 500, 3844, 200, 3843, 50, 3839, 200, 3840, 100, 3842, 200, 3841, 100, 3846, 50); public static bool[] CanFishInLava = ItemID.Sets.Factory.CreateBoolSet(2422); - public static bool[] IsLavaBait = ItemID.Sets.Factory.CreateBoolSet(4849, 4845, 4847); - private const int healingItemsDecayRate = 4; - public static int[] ItemSpawnDecaySpeed = ItemID.Sets.Factory.CreateIntSet(1, 58, 4, 184, 4, 1867, 4, 1868, 4, 1734, 4, 1735, 4); - public static bool[] IsFishingCrate = ItemID.Sets.Factory.CreateBoolSet(2334, 2335, 2336, 3203, 3204, 3205, 3206, 3207, 3208, 4405, 4407, 4877, 5002, 3979, 3980, 3981, 3982, 3983, 3984, 3985, 3986, 3987, 4406, 4408, 4878, 5003); - public static bool[] IsFishingCrateHardmode = ItemID.Sets.Factory.CreateBoolSet(3979, 3980, 3981, 3982, 3983, 3984, 3985, 3986, 3987, 4406, 4408, 4878, 5003); - public static bool[] CanBePlacedOnWeaponRacks = ItemID.Sets.Factory.CreateBoolSet(3196, 166, 235, 3115, 167, 2896, 3547, 580, 937, 4423, 4824, 4825, 4908, 4909, 4094, 4039, 4092, 4093, 4587, 4588, 4589, 4590, 4591, 4592, 4593, 4594, 4595, 4596, 4597, 4598, 905, 1326, 3225, 2303, 2299, 2290, 2317, 2305, 2304, 2313, 2318, 2312, 2306, 2308, 2319, 2314, 2302, 2315, 2307, 2310, 2301, 2298, 2316, 2309, 2321, 2297, 2300, 2311, 2420, 2438, 2437, 2436, 4401, 4402, 2475, 2476, 2450, 2477, 2478, 2451, 2479, 2480, 2452, 2453, 2481, 2454, 2482, 2483, 2455, 2456, 2457, 2458, 2459, 2460, 2484, 2472, 2461, 2462, 2463, 2485, 2464, 2465, 2486, 2466, 2467, 2468, 2487, 2469, 2488, 2470, 2471, 2473, 2474, 4393, 4394); - public static int[] TextureCopyLoad = ItemID.Sets.Factory.CreateIntSet(-1, 3665, 48, 3666, 306, 3667, 328, 3668, 625, 3669, 626, 3670, 627, 3671, 680, 3672, 681, 3673, 831, 3674, 838, 3675, 914, 3676, 952, 3677, 1142, 3678, 1298, 3679, 1528, 3680, 1529, 3681, 1530, 3682, 1531, 3683, 1532, 3684, 2230, 3685, 2249, 3686, 2250, 3687, 2526, 3688, 2544, 3689, 2559, 3690, 2574, 3691, 2612, 3692, 2613, 3693, 2614, 3694, 2615, 3695, 2616, 3696, 2617, 3697, 2618, 3698, 2619, 3699, 2620, 3700, 2748, 3701, 2814, 3703, 3125, 3702, 3180, 3704, 3181, 3705, 3665, 3706, 3665, 4713, 4712); - public static bool[] TrapSigned = ItemID.Sets.Factory.CreateBoolSet(false, 3665, 3666, 3667, 3668, 3669, 3670, 3671, 3672, 3673, 3674, 3675, 3676, 3677, 3678, 3679, 3680, 3681, 3682, 3683, 3684, 3685, 3686, 3687, 3688, 3689, 3690, 3691, 3692, 3693, 3694, 3695, 3696, 3697, 3698, 3699, 3700, 3701, 3703, 3702, 3704, 3705, 3706, 3886, 3887, 3950, 3976, 4164, 4185, 4206, 4227, 4266, 4268, 4585, 4713); - public static bool[] Deprecated = ItemID.Sets.Factory.CreateBoolSet(2783, 2785, 2782, 2773, 2775, 2772, 2778, 2780, 2777, 3463, 3465, 3462, 2881, 3847, 3848, 3849, 3850, 3851, 3850, 3861, 3862, 4010, 4058, 5013, 4722, 3978); - public static bool[] NeverAppearsAsNewInInventory = ItemID.Sets.Factory.CreateBoolSet(71, 72, 73, 74); - public static bool[] CommonCoin = ItemID.Sets.Factory.CreateBoolSet(71, 72, 73, 74); + public static int[] TextureCopyLoad = ItemID.Sets.Factory.CreateIntSet(-1, 3665, 48, 3666, 306, 3667, 328, 3668, 625, 3669, 626, 3670, 627, 3671, 680, 3672, 681, 3673, 831, 3674, 838, 3675, 914, 3676, 952, 3677, 1142, 3678, 1298, 3679, 1528, 3680, 1529, 3681, 1530, 3682, 1531, 3683, 1532, 3684, 2230, 3685, 2249, 3686, 2250, 3687, 2526, 3688, 2544, 3689, 2559, 3690, 2574, 3691, 2612, 3692, 2613, 3693, 2614, 3694, 2615, 3695, 2616, 3696, 2617, 3697, 2618, 3698, 2619, 3699, 2620, 3700, 2748, 3701, 2814, 3703, 3125, 3702, 3180, 3704, 3181, 3705, 3665, 3706, 3665); + public static bool[] TrapSigned = ItemID.Sets.Factory.CreateBoolSet(false, 3665, 3666, 3667, 3668, 3669, 3670, 3671, 3672, 3673, 3674, 3675, 3676, 3677, 3678, 3679, 3680, 3681, 3682, 3683, 3684, 3685, 3686, 3687, 3688, 3689, 3690, 3691, 3692, 3693, 3694, 3695, 3696, 3697, 3698, 3699, 3700, 3701, 3703, 3702, 3704, 3705, 3706, 3886, 3887); + public static bool[] Deprecated = ItemID.Sets.Factory.CreateBoolSet(2784, 2783, 2785, 2782, 2774, 2773, 2775, 2772, 2779, 2778, 2780, 2777, 3464, 3463, 3465, 3462, 3341, 3342, 3343, 3340, 3344, 3345, 3346, 3273, 2881, 3750, 3847, 3848, 3849, 3850, 3851, 3850, 3861, 3862); + public static bool[] NeverShiny = ItemID.Sets.Factory.CreateBoolSet(71, 72, 73, 74); public static bool[] ItemIconPulse = ItemID.Sets.Factory.CreateBoolSet(520, 521, 575, 549, 548, 547, 3456, 3457, 3458, 3459, 3580, 3581); - public static bool[] ItemNoGravity = ItemID.Sets.Factory.CreateBoolSet(520, 521, 575, 549, 548, 547, 3453, 3454, 3455, 3456, 3457, 3458, 3459, 3580, 3581, 4143); + public static bool[] ItemNoGravity = ItemID.Sets.Factory.CreateBoolSet(520, 521, 575, 549, 548, 547, 3453, 3454, 3455, 3456, 3457, 3458, 3459, 3580, 3581); public static int[] ExtractinatorMode = ItemID.Sets.Factory.CreateIntSet(-1, 424, 0, 1103, 0, 3347, 1); public static int[] StaffMinionSlotsRequired = ItemID.Sets.Factory.CreateIntSet(1); public static bool[] ExoticPlantsForDyeTrade = ItemID.Sets.Factory.CreateBoolSet(3385, 3386, 3387, 3388); public static bool[] NebulaPickup = ItemID.Sets.Factory.CreateBoolSet(3453, 3454, 3455); public static bool[] AnimatesAsSoul = ItemID.Sets.Factory.CreateBoolSet(575, 547, 520, 548, 521, 549, 3580, 3581); - public static bool[] gunProj = ItemID.Sets.Factory.CreateBoolSet(3475, 3540, 3854, 3930); - public static int[] SortingPriorityBossSpawns = ItemID.Sets.Factory.CreateIntSet(-1, 43, 1, 560, 2, 70, 3, 1331, 3, 361, 4, 1133, 5, 4988, 5, 544, 6, 556, 7, 557, 8, 2495, 9, 2673, 10, 602, 11, 1844, 12, 1958, 13, 1293, 14, 2767, 15, 4271, 15, 3601, 16, 1291, 17, 109, 18, 29, 19, 50, 20, 3199, 20, 3124, 21); - public static int[] SortingPriorityWiring = ItemID.Sets.Factory.CreateIntSet(-1, 510, 103, 3625, 102, 509, 101, 851, 100, 850, 99, 3612, 98, 849, 97, 4485, 96, 4484, 95, 583, 94, 584, 93, 585, 92, 538, 91, 513, 90, 3545, 90, 853, 89, 541, 88, 529, 88, 1151, 87, 852, 87, 543, 87, 542, 87, 3707, 87, 2492, 86, 530, 85, 581, 84, 582, 84, 1263, 83); + public static bool[] gunProj = ItemID.Sets.Factory.CreateBoolSet(3475, 3540, 3854); + public static int[] SortingPriorityBossSpawns = ItemID.Sets.Factory.CreateIntSet(-1, 43, 1, 560, 2, 70, 3, 1331, 3, 361, 4, 1133, 5, 544, 6, 556, 7, 557, 8, 2495, 9, 2673, 10, 602, 11, 1844, 12, 1958, 13, 1293, 14, 2767, 15, 3601, 16, 1291, 17, 109, 18, 29, 19, 50, 20, 3199, 20, 3124, 21); + public static int[] SortingPriorityWiring = ItemID.Sets.Factory.CreateIntSet(-1, 510, 101, 3625, 100, 509, 99, 851, 98, 850, 97, 3612, 96, 849, 95, 583, 94, 584, 93, 585, 92, 538, 91, 513, 90, 3545, 90, 853, 89, 541, 88, 529, 88, 1151, 87, 852, 87, 543, 87, 542, 87, 3707, 87, 2492, 86, 530, 85, 581, 84, 582, 84, 1263, 83); public static int[] SortingPriorityMaterials = ItemID.Sets.Factory.CreateIntSet(-1, 3467, 100, 3460, 99, 3458, 98, 3456, 97, 3457, 96, 3459, 95, 3261, 94, 1508, 93, 1552, 92, 1006, 91, 947, 90, 1225, 89, 1198, 88, 1106, 87, 391, 86, 366, 85, 1191, 84, 1105, 83, 382, 82, 365, 81, 1184, 80, 1104, 79, 381, 78, 364, 77, 548, 76, 547, 75, 549, 74, 575, 73, 521, 72, 520, 71, 175, 70, 174, 69, 3380, 68, 1329, 67, 1257, 66, 880, 65, 86, 64, 57, 63, 56, 62, 117, 61, 116, 60, 706, 59, 702, 58, 19, 57, 13, 56, 705, 55, 701, 54, 21, 53, 14, 52, 704, 51, 700, 50, 22, 49, 11, 48, 703, 47, 699, 46, 20, 45, 12, 44, 999, 43, 182, 42, 178, 41, 179, 40, 177, 39, 180, 38, 181, 37); public static int[] SortingPriorityExtractibles = ItemID.Sets.Factory.CreateIntSet(-1, 997, 4, 3347, 3, 1103, 2, 424, 1); public static int[] SortingPriorityRopes = ItemID.Sets.Factory.CreateIntSet(-1, 965, 1, 85, 1, 210, 1, 3077, 1, 3078, 1); public static int[] SortingPriorityPainting = ItemID.Sets.Factory.CreateIntSet(-1, 1543, 100, 1544, 99, 1545, 98, 1071, 97, 1072, 96, 1100, 95); public static int[] SortingPriorityTerraforming = ItemID.Sets.Factory.CreateIntSet(-1, 779, 100, 780, 99, 783, 98, 781, 97, 782, 96, 784, 95, 422, 94, 423, 93, 3477, 92, 66, 91, 67, 90, 2886, 89); public static int[] GamepadExtraRange = ItemID.Sets.Factory.CreateIntSet(0, 2797, 20, 3278, 4, 3285, 6, 3279, 8, 3280, 8, 3281, 9, 3262, 10, 3317, 10, 3282, 10, 3315, 10, 3316, 11, 3283, 12, 3290, 13, 3289, 11, 3284, 13, 3286, 13, 3287, 18, 3288, 18, 3291, 17, 3292, 18, 3389, 21); - public static bool[] GamepadWholeScreenUseRange = ItemID.Sets.Factory.CreateBoolSet(1326, 1256, 1244, 3014, 113, 218, 495, 114, 496, 2796, 494, 3006, 65, 1931, 3570, 2750, 3065, 3029, 3030, 4381, 1309, 2364, 2365, 2551, 2535, 2584, 1157, 2749, 1802, 2621, 3249, 3531, 3474, 2366, 1572, 3569, 3571, 4269, 4273, 4281, 3611, 1299, 1254); - public static float[] BonusMeleeSpeedMultiplier = ItemID.Sets.Factory.CreateFloatSet(1f, 1827f, 0.5f, 3013f, 0.25f, 3106f, 0.33f); + public static bool[] GamepadWholeScreenUseRange = ItemID.Sets.Factory.CreateBoolSet(1326, 1256, 1244, 3014, 113, 218, 495, 114, 496, 2796, 494, 3006, 65, 1931, 3570, 2750, 3065, 3029, 3030, 1309, 2364, 2365, 2551, 2535, 2584, 1157, 2749, 1802, 2621, 3249, 3531, 3474, 2366, 1572, 3569, 3571, 3611, 1299, 1254); public static bool[] GamepadSmartQuickReach = ItemID.Sets.Factory.CreateBoolSet(2798, 2797, 3030, 3262, 3278, 3279, 3280, 3281, 3282, 3283, 3284, 3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 3315, 3316, 3317, 3389, 2798, 65, 1931, 3570, 2750, 3065, 3029, 1256, 1244, 3014, 113, 218, 495); public static bool[] Yoyo = ItemID.Sets.Factory.CreateBoolSet(3262, 3278, 3279, 3280, 3281, 3282, 3283, 3284, 3285, 3286, 3287, 3288, 3289, 3290, 3291, 3292, 3315, 3316, 3317, 3389); - public static bool[] AlsoABuildingItem = ItemID.Sets.Factory.CreateBoolSet(3031, 205, 1128, 207, 206, 3032, 849, 3620, 509, 851, 850, 3625, 510, 1071, 1543, 1072, 1544, 1100, 1545, 4820, 4872); - public static bool[] LockOnIgnoresCollision = ItemID.Sets.Factory.CreateBoolSet(64, 3570, 1327, 3006, 1227, 788, 756, 1228, 65, 3065, 3473, 3051, 1309, 2364, 2365, 2551, 2535, 2584, 1157, 2749, 1802, 2621, 3249, 3531, 3474, 2366, 1572, 4269, 4273, 4281, 4607, 3014, 3569, 3571); + public static bool[] AlsoABuildingItem = ItemID.Sets.Factory.CreateBoolSet(3031, 205, 1128, 207, 206, 3032, 849, 3620, 509, 851, 850, 3625, 510, 1071, 1543, 1072, 1544, 1100, 1545); + public static bool[] LockOnIgnoresCollision = ItemID.Sets.Factory.CreateBoolSet(64, 3570, 1327, 3006, 1227, 788, 756, 1228, 65, 3065, 3473, 3051, 1309, 2364, 2365, 2551, 2535, 2584, 1157, 2749, 1802, 2621, 3249, 3531, 3474, 2366, 1572, 3014, 3569, 3571); public static int[] LockOnAimAbove = ItemID.Sets.Factory.CreateIntSet(0, 1256, 15, 1244, 15, 3014, 15, 3569, 15, 3571, 15); public static float?[] LockOnAimCompensation = ItemID.Sets.Factory.CreateCustomSet(new float?(), (object) (short) 1336, (object) 0.2f, (object) (short) 157, (object) 0.29f, (object) (short) 2590, (object) 0.4f, (object) (short) 3821, (object) 0.4f, (object) (short) 160, (object) 0.4f); - public static bool[] SingleUseInGamepad = ItemID.Sets.Factory.CreateBoolSet(8, 427, 3004, 523, 433, 429, 974, 1333, 1245, 3114, 430, 3045, 428, 2274, 431, 432, 4383, 4384, 4385, 4386, 4387, 4388); - public static bool[] Torches = ItemID.Sets.Factory.CreateBoolSet(8, 427, 3004, 523, 433, 429, 974, 1333, 1245, 3114, 430, 3045, 428, 2274, 431, 432, 4383, 4384, 4385, 4386, 4387, 4388); - public static bool[] WaterTorches = ItemID.Sets.Factory.CreateBoolSet(523, 1333, 4384); - public static short[] Workbenches = new short[41] - { - (short) 36, - (short) 635, - (short) 636, - (short) 637, - (short) 673, - (short) 811, - (short) 812, - (short) 813, - (short) 814, - (short) 815, - (short) 916, - (short) 1145, - (short) 1398, - (short) 1401, - (short) 1404, - (short) 1461, - (short) 1511, - (short) 1795, - (short) 1817, - (short) 2229, - (short) 2251, - (short) 2252, - (short) 2253, - (short) 2534, - (short) 2631, - (short) 2632, - (short) 2633, - (short) 2826, - (short) 3156, - (short) 3157, - (short) 3158, - (short) 3909, - (short) 3910, - (short) 3949, - (short) 3975, - (short) 4163, - (short) 4184, - (short) 4205, - (short) 4226, - (short) 4315, - (short) 4584 - }; + public static bool[] SingleUseInGamepad = ItemID.Sets.Factory.CreateBoolSet(8, 427, 3004, 523, 433, 429, 974, 1333, 1245, 3114, 430, 3045, 428, 2274, 431, 432); } } } diff --git a/ID/ItemUseStyleID.cs b/ID/ItemUseStyleID.cs deleted file mode 100644 index 6b01a03..0000000 --- a/ID/ItemUseStyleID.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.ID.ItemUseStyleID -// 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.ID -{ - public class ItemUseStyleID - { - public const int None = 0; - public const int Swing = 1; - public const int DrinkOld = 7; - public const int Thrust = 3; - public const int HoldUp = 4; - public const int Shoot = 5; - public const int DrinkLong = 6; - public const int EatFood = 2; - public const int GolfPlay = 8; - public const int DrinkLiquid = 9; - public const int HiddenAnimation = 10; - public const int MowTheLawn = 11; - public const int Guitar = 12; - public const int Rapier = 13; - public const int RaiseLamp = 14; - } -} diff --git a/ID/MenuID.cs b/ID/MenuID.cs deleted file mode 100644 index 8b28818..0000000 --- a/ID/MenuID.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.ID.MenuID -// 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.ID -{ - public static class MenuID - { - public const int None = -1; - public const int LanguageSelectFirstRun = 1212; - public const int LanguageSelect = 1213; - public const int ServerPasswordRequested = 31; - public const int MultiplayerJoining = 14; - public const int SteamMultiplayer = 882; - public const int ServerPasswordSet = 30; - public const int SteamMultiplayerOptions = 889; - public const int Error = 15; - public const int LoadFailedWithBackup = 200; - public const int LoadFailedNoBackup = 201; - public const int Status = 10; - public const int AutomaticServerConnect = 100; - public const int Title = 0; - public const int CharacterSelect = 1; - public const int CharacterCreation = 2; - public const int HardcoreOption = 222; - public const int ClothesSelect = 20; - public const int HairColor = 17; - public const int EyeColor = 18; - public const int SkinColor = 19; - public const int ShirtColor = 21; - public const int UndershirtColor = 22; - public const int PantsColor = 23; - public const int ShoeColor = 24; - public const int CharacterName = 3; - public const int CharacterDeletion = 4; - public const int CharacterDeletionConfirmation = 5; - public const int WorldSelect = 6; - public const int WorldExpert = -7; - public const int WorldEvil = -71; - public const int WorldName = 7; - public const int WorldSeed = 5000; - public const int WorldDeletion = 8; - public const int WorldDeletionConfirmation = 9; - public const int Settings = 11; - public const int GeneralSettings = 112; - public const int UISettings = 1112; - public const int VideoSettings = 1111; - public const int EffectsSettings = 2008; - public const int FullscreenSettings = 111; - public const int CursorSettings = 1125; - public const int CursorColor = 25; - public const int CursorEdgeColor = 252; - public const int VolumeSettings = 26; - public const int BackgroundScrollSettings = 28; - public const int MapKeybindSettings = 272727; - public const int KeybindSettings = 27; - public const int ControlSettings = 1127; - public const int Multiplayer = 12; - public const int ServerIP = 13; - public const int ServerPort = 131; - public const int WorldSize = 16; - public const int FancyUI = 888; - public const int RejectedWorld = 1000000; - } -} diff --git a/ID/MessageID.cs b/ID/MessageID.cs index a608966..d0a6ecd 100644 --- a/ID/MessageID.cs +++ b/ID/MessageID.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.MessageID -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; @@ -11,49 +11,48 @@ namespace Terraria.ID public class MessageID { public const byte NeverCalled = 0; - public const byte Hello = 1; + public const byte Unknown1 = 1; public const byte Kick = 2; - public const byte PlayerInfo = 3; + public const byte Unknown3 = 3; public const byte SyncPlayer = 4; public const byte SyncEquipment = 5; - public const byte RequestWorldData = 6; + public const byte Unknown6 = 6; public const byte WorldData = 7; - public const byte SpawnTileData = 8; - public const byte StatusTextSize = 9; + public const byte Unknown8 = 8; + public const byte Unknown9 = 9; public const byte TileSection = 10; - public const byte TileFrameSection = 11; - public const byte PlayerSpawn = 12; - public const byte PlayerControls = 13; - public const byte PlayerActive = 14; - [Obsolete("Deprecated.")] + public const byte Unknown11 = 11; + public const byte Unknown12 = 12; + public const byte Unknown13 = 13; + public const byte Unknown14 = 14; public const byte Unknown15 = 15; - public const byte PlayerLifeMana = 16; - public const byte TileManipulation = 17; - public const byte SetTime = 18; - public const byte ToggleDoorState = 19; + public const byte Unknown16 = 16; + public const byte Unknown17 = 17; + public const byte Unknown18 = 18; + public const byte Unknown19 = 19; public const byte Unknown20 = 20; public const byte SyncItem = 21; - public const byte ItemOwner = 22; - public const byte SyncNPC = 23; - public const byte UnusedMeleeStrike = 24; + public const byte Unknown22 = 22; + public const byte Unknown23 = 23; + public const byte Unknown24 = 24; [Obsolete("Deprecated. Use NetTextModule instead.")] - public const byte Unused25 = 25; + public const byte Unknown25 = 25; [Obsolete("Deprecated.")] - public const byte Unused26 = 26; - public const byte SyncProjectile = 27; - public const byte DamageNPC = 28; - public const byte KillProjectile = 29; - public const byte TogglePVP = 30; + public const byte Unknown26 = 26; + public const byte Unknown27 = 27; + public const byte Unknown28 = 28; + public const byte Unknown29 = 29; + public const byte Unknown30 = 30; public const byte RequestChestOpen = 31; public const byte SyncChestItem = 32; public const byte SyncPlayerChest = 33; public const byte ChestUpdates = 34; - public const byte PlayerHeal = 35; - public const byte SyncPlayerZone = 36; - public const byte RequestPassword = 37; - public const byte SendPassword = 38; - public const byte ReleaseItemOwnership = 39; - public const byte SyncTalkNPC = 40; + public const byte Unknown35 = 35; + public const byte Unknown36 = 36; + public const byte Unknown37 = 37; + public const byte Unknown38 = 38; + public const byte Unknown39 = 39; + public const byte Unknown40 = 40; public const byte Unknown41 = 41; public const byte Unknown42 = 42; public const byte Unknown43 = 43; @@ -70,17 +69,17 @@ namespace Terraria.ID public const byte Unknown52 = 52; public const byte Unknown53 = 53; public const byte Unknown54 = 54; - public const byte AddPlayerBuff = 55; - public const byte UniqueTownNPCInfoSyncRequest = 56; + public const byte Unknown55 = 55; + public const byte SyncNPCName = 56; public const byte Unknown57 = 57; - public const byte InstrumentSound = 58; - public const byte HitSwitch = 59; + public const byte Unknown58 = 58; + public const byte Unknown59 = 59; public const byte Unknown60 = 60; public const byte Unknown61 = 61; public const byte Unknown62 = 62; public const byte Unknown63 = 63; public const byte Unknown64 = 64; - public const byte TeleportEntity = 65; + public const byte Unknown65 = 65; public const byte Unknown66 = 66; public const byte Unknown67 = 67; public const byte Unknown68 = 68; @@ -88,10 +87,10 @@ namespace Terraria.ID public const byte BugCatching = 70; public const byte BugReleasing = 71; public const byte TravelMerchantItems = 72; - public const byte RequestTeleportationByServer = 73; + public const byte TeleportationPotion = 73; public const byte AnglerQuest = 74; public const byte AnglerQuestFinished = 75; - public const byte QuestsCountSync = 76; + public const byte AnglerQuestCountSync = 76; public const byte TemporaryAnimation = 77; public const byte InvasionProgressReport = 78; public const byte PlaceObject = 79; @@ -110,7 +109,7 @@ namespace Terraria.ID public const byte SyncExtraValue = 92; public const byte SocialHandshake = 93; public const byte Deprecated1 = 94; - public const byte MurderSomeoneElsesPortal = 95; + public const byte MurderSomeoneElsesProjectile = 95; public const byte TeleportPlayerThroughPortal = 96; public const byte AchievementMessageNPCKilled = 97; public const byte AchievementMessageEventHappened = 98; @@ -135,26 +134,6 @@ namespace Terraria.ID public const byte PlayerHurtV2 = 117; public const byte PlayerDeathV2 = 118; public const byte CombatTextString = 119; - public const byte Emoji = 120; - public const byte TEDisplayDollItemSync = 121; - public const byte RequestTileEntityInteraction = 122; - public const byte WeaponsRackTryPlacing = 123; - public const byte TEHatRackItemSync = 124; - public const byte SyncTilePicking = 125; - public const byte SyncRevengeMarker = 126; - public const byte RemoveRevengeMarker = 127; - public const byte LandGolfBallInCup = 128; - public const byte FinishedConnectingToServer = 129; - public const byte FishOutNPC = 130; - public const byte TamperWithNPC = 131; - public const byte PlayLegacySound = 132; - public const byte FoodPlatterTryPlacing = 133; - public const byte UpdatePlayerLuckFactors = 134; - public const byte DeadPlayer = 135; - public const byte SyncCavernMonsterType = 136; - public const byte RequestNPCBuffRemoval = 137; - public const byte ClientSyncedInventory = 138; - public const byte SetCountsAsHostForGameplay = 139; - public const byte Count = 140; + public const byte Count = 120; } } diff --git a/ID/MountID.cs b/ID/MountID.cs index ef4d2bc..83cdff3 100644 --- a/ID/MountID.cs +++ b/ID/MountID.cs @@ -1,72 +1,19 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.MountID -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.ID { public static class MountID { - public const int None = -1; - public const int Rudolph = 0; - public const int Bunny = 1; - public const int Pigron = 2; - public const int Slime = 3; - public const int Turtle = 4; - public const int Bee = 5; - public const int Minecart = 6; - public const int UFO = 7; - public const int Drill = 8; - public const int Scutlix = 9; - public const int Unicorn = 10; - public const int MinecartMech = 11; - public const int CuteFishron = 12; - public const int MinecartWood = 13; - public const int Basilisk = 14; - public const int DesertMinecart = 15; - public const int FishMinecart = 16; - public const int GolfCartSomebodySaveMe = 17; - public const int BeeMinecart = 18; - public const int LadybugMinecart = 19; - public const int PigronMinecart = 20; - public const int SunflowerMinecart = 21; - public const int HellMinecart = 22; - public const int WitchBroom = 23; - public const int ShroomMinecart = 24; - public const int AmethystMinecart = 25; - public const int TopazMinecart = 26; - public const int SapphireMinecart = 27; - public const int EmeraldMinecart = 28; - public const int RubyMinecart = 29; - public const int DiamondMinecart = 30; - public const int AmberMinecart = 31; - public const int BeetleMinecart = 32; - public const int MeowmereMinecart = 33; - public const int PartyMinecart = 34; - public const int PirateMinecart = 35; - public const int SteampunkMinecart = 36; - public const int Flamingo = 37; - public const int CoffinMinecart = 38; - public const int DiggingMoleMinecart = 39; - public const int PaintedHorse = 40; - public const int MajesticHorse = 41; - public const int DarkHorse = 42; - public const int PogoStick = 43; - public const int PirateShip = 44; - public const int SpookyWood = 45; - public const int Santank = 46; - public const int WallOfFleshGoat = 47; - public const int DarkMageBook = 48; - public const int LavaShark = 49; - public const int QueenSlime = 50; - public static int Count = 51; + public static int Count = 15; public static class Sets { public static SetFactory Factory = new SetFactory(MountID.Count); - public static bool[] Cart = MountID.Sets.Factory.CreateBoolSet(6, 11, 13, 15, 16, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 38, 39); - public static bool[] FacePlayersVelocity = MountID.Sets.Factory.CreateBoolSet(15, 16, 11, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 38, 39); + public static bool[] Cart = MountID.Sets.Factory.CreateBoolSet(6, 11, 13); } } } diff --git a/ID/NPCHeadID.cs b/ID/NPCHeadID.cs deleted file mode 100644 index 7fc1e54..0000000 --- a/ID/NPCHeadID.cs +++ /dev/null @@ -1,64 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.ID.NPCHeadID -// 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.ID -{ - public class NPCHeadID - { - public const int HousingQuery = 0; - public const int Guide = 1; - public const int Merchant = 2; - public const int Nurse = 3; - public const int Demolitionist = 4; - public const int Dryad = 5; - public const int ArmsDealer = 6; - public const int Clothier = 7; - public const int Mechanic = 8; - public const int GoblinTinkerer = 9; - public const int Wizard = 10; - public const int SantaClaus = 11; - public const int Truffle = 12; - public const int Steampunker = 13; - public const int DyeTrader = 14; - public const int PartyGirl = 15; - public const int Cyborg = 16; - public const int Painter = 17; - public const int WitchDoctor = 18; - public const int Pirate = 19; - public const int Stylist = 20; - public const int TravellingMerchant = 21; - public const int Angler = 22; - public const int TaxCollector = 23; - public const int DD2Bartender = 24; - public const int Golfer = 25; - public const int BestiaryGirl = 26; - public const int CatSiamese = 27; - public const int CatBlack = 28; - public const int CatOrangeTabby = 29; - public const int CatRussianBlue = 30; - public const int CatSilver = 31; - public const int CatWhite = 32; - public const int DogLabrador = 33; - public const int DogPitBull = 34; - public const int DogBeagle = 35; - public const int DogCorgi = 36; - public const int DogDalmation = 37; - public const int DogHusky = 38; - public const int BunnyWhite = 39; - public const int BunnyAngora = 40; - public const int BunnyDutch = 41; - public const int BunnyFlemish = 42; - public const int BunnyLop = 43; - public const int BunnySilver = 44; - public const int Count = 45; - - public static class Sets - { - public static SetFactory Factory = new SetFactory(45); - public static bool[] CannotBeDrawnInHousingUI = NPCHeadID.Sets.Factory.CreateBoolSet(21); - } - } -} diff --git a/ID/NPCID.cs b/ID/NPCID.cs index 228d93b..fdbcdd2 100644 --- a/ID/NPCID.cs +++ b/ID/NPCID.cs @@ -1,11 +1,10 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.NPCID -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; -using ReLogic.Reflection; using System.Collections.Generic; namespace Terraria.ID @@ -1975,8 +1974,6 @@ namespace Terraria.ID 578 } }; - public static readonly IdDictionary Search = IdDictionary.Create(); - public const short NegativeIDCount = -66; public const short BigHornetStingy = -65; public const short LittleHornetStingy = -64; public const short BigHornetSpikey = -63; @@ -2550,8 +2547,8 @@ namespace Terraria.ID public const short LunarTowerNebula = 507; public const short LunarTowerVortex = 422; public const short TaxCollector = 441; - public const short GiantWalkingAntlion = 508; - public const short GiantFlyingAntlion = 509; + public const short WalkingAntlion = 508; + public const short FlyingAntlion = 509; public const short DuneSplicerHead = 510; public const short DuneSplicerBody = 511; public const short DuneSplicerTail = 512; @@ -2622,90 +2619,7 @@ namespace Terraria.ID public const short DD2OgreT3 = 577; public const short DD2LightningBugT3 = 578; public const short BartenderUnconscious = 579; - public const short WalkingAntlion = 580; - public const short FlyingAntlion = 581; - public const short LarvaeAntlion = 582; - public const short FairyCritterPink = 583; - public const short FairyCritterGreen = 584; - public const short FairyCritterBlue = 585; - public const short ZombieMerman = 586; - public const short EyeballFlyingFish = 587; - public const short Golfer = 588; - public const short GolferRescue = 589; - public const short TorchZombie = 590; - public const short ArmedTorchZombie = 591; - public const short GoldGoldfish = 592; - public const short GoldGoldfishWalker = 593; - public const short WindyBalloon = 594; - public const short BlackDragonfly = 595; - public const short BlueDragonfly = 596; - public const short GreenDragonfly = 597; - public const short OrangeDragonfly = 598; - public const short RedDragonfly = 599; - public const short YellowDragonfly = 600; - public const short GoldDragonfly = 601; - public const short Seagull = 602; - public const short Seagull2 = 603; - public const short LadyBug = 604; - public const short GoldLadyBug = 605; - public const short Maggot = 606; - public const short Pupfish = 607; - public const short Grebe = 608; - public const short Grebe2 = 609; - public const short Rat = 610; - public const short Owl = 611; - public const short WaterStrider = 612; - public const short GoldWaterStrider = 613; - public const short ExplosiveBunny = 614; - public const short Dolphin = 615; - public const short Turtle = 616; - public const short TurtleJungle = 617; - public const short BloodNautilus = 618; - public const short BloodSquid = 619; - public const short GoblinShark = 620; - public const short BloodEelHead = 621; - public const short BloodEelBody = 622; - public const short BloodEelTail = 623; - public const short Gnome = 624; - public const short SeaTurtle = 625; - public const short Seahorse = 626; - public const short GoldSeahorse = 627; - public const short Dandelion = 628; - public const short IceMimic = 629; - public const short BloodMummy = 630; - public const short RockGolem = 631; - public const short MaggotZombie = 632; - public const short BestiaryGirl = 633; - public const short SporeBat = 634; - public const short SporeSkeleton = 635; - public const short HallowBoss = 636; - public const short TownCat = 637; - public const short TownDog = 638; - public const short GemSquirrelAmethyst = 639; - public const short GemSquirrelTopaz = 640; - public const short GemSquirrelSapphire = 641; - public const short GemSquirrelEmerald = 642; - public const short GemSquirrelRuby = 643; - public const short GemSquirrelDiamond = 644; - public const short GemSquirrelAmber = 645; - public const short GemBunnyAmethyst = 646; - public const short GemBunnyTopaz = 647; - public const short GemBunnySapphire = 648; - public const short GemBunnyEmerald = 649; - public const short GemBunnyRuby = 650; - public const short GemBunnyDiamond = 651; - public const short GemBunnyAmber = 652; - public const short HellButterfly = 653; - public const short Lavafly = 654; - public const short MagmaSnail = 655; - public const short TownBunny = 656; - public const short QueenSlimeBoss = 657; - public const short QueenSlimeMinionBlue = 658; - public const short QueenSlimeMinionPink = 659; - public const short QueenSlimeMinionPurple = 660; - public const short EmpressButterfly = 661; - public const short PirateGhost = 662; - public const short Count = 663; + public const short Count = 580; public static int FromLegacyName(string name) { @@ -2717,411 +2631,69 @@ namespace Terraria.ID public static class Sets { - public static SetFactory Factory = new SetFactory(663); - public static Dictionary SpecialSpawningRules = new Dictionary() - { - { - 259, - 0 - }, - { - 260, - 0 - }, - { - 175, - 0 - }, - { - 43, - 0 - }, - { - 56, - 0 - }, - { - 101, - 0 - } - }; - public static Dictionary NPCBestiaryDrawOffset = NPCID.Sets.NPCBestiaryDrawOffsetCreation(); - public static List NormalGoldCritterBestiaryPriority = new List() - { - 46, - 540, - 614, - 303, - 337, - 443, - 74, - 297, - 298, - 442, - 55, - 230, - 592, - 593, - 299, - 538, - 539, - 300, - 447, - 361, - 445, - 377, - 446, - 356, - 444, - 357, - 448, - 595, - 596, - 597, - 598, - 599, - 600, - 601, - 626, - 627, - 612, - 613, - 604, - 605 - }; - public static List BossBestiaryPriority = new List() - { - 4, - 5, - 50, - 535, - 13, - 14, - 15, - 266, - 267, - 35, - 36, - 222, - 113, - 114, - 117, - 115, - 116, - 657, - 658, - 659, - 660, - 125, - 126, - 134, - 135, - 136, - 139, - (int) sbyte.MaxValue, - 128, - 131, - 129, - 130, - 262, - 263, - 264, - 636, - 245, - 246, - 249, - 247, - 248, - 370, - 372, - 373, - 439, - 438, - 379, - 380, - 440, - 521, - 454, - 507, - 517, - 422, - 493, - 398, - 396, - 397, - 400, - 401 - }; - public static List TownNPCBestiaryPriority = new List() - { - 22, - 17, - 18, - 38, - 369, - 20, - 19, - 207, - 227, - 353, - 633, - 550, - 588, - 107, - 228, - 124, - 54, - 108, - 178, - 229, - 160, - 441, - 209, - 208, - 142, - 637, - 638, - 656, - 368, - 453, - 37 - }; - public static bool[] DontDoHardmodeScaling = NPCID.Sets.Factory.CreateBoolSet(5, 13, 14, 15, 267, 113, 114, 115, 116, 117, 118, 119, 658, 659, 660, 400); - public static bool[] IsTownPet = NPCID.Sets.Factory.CreateBoolSet(637, 638, 656); - public static List GoldCrittersCollection = new List() - { - 443, - 442, - 592, - 444, - 601, - 445, - 446, - 605, - 447, - 627, - 613, - 448, - 539 - }; - public static bool[] CantTakeLunchMoney = NPCID.Sets.Factory.CreateBoolSet(394, 393, 392, 492, 491, 662, 384, 478, 658, 659, 660, 128, 131, 129, 130, 139, 267, 247, 248, 246, 249, 245, 397, 396, 401, 400, 440, 68); - public static Dictionary RespawnEnemyID = new Dictionary() - { - { - 492, - 0 - }, - { - 491, - 0 - }, - { - 394, - 0 - }, - { - 393, - 0 - }, - { - 392, - 0 - }, - { - 13, - 0 - }, - { - 14, - 0 - }, - { - 15, - 0 - }, - { - 412, - 0 - }, - { - 413, - 0 - }, - { - 414, - 0 - }, - { - 134, - 0 - }, - { - 135, - 0 - }, - { - 136, - 0 - }, - { - 454, - 0 - }, - { - 455, - 0 - }, - { - 456, - 0 - }, - { - 457, - 0 - }, - { - 458, - 0 - }, - { - 459, - 0 - }, - { - 8, - 7 - }, - { - 9, - 7 - }, - { - 11, - 10 - }, - { - 12, - 10 - }, - { - 40, - 39 - }, - { - 41, - 39 - }, - { - 96, - 95 - }, - { - 97, - 95 - }, - { - 99, - 98 - }, - { - 100, - 98 - }, - { - 88, - 87 - }, - { - 89, - 87 - }, - { - 90, - 87 - }, - { - 91, - 87 - }, - { - 92, - 87 - }, - { - 118, - 117 - }, - { - 119, - 117 - }, - { - 514, - 513 - }, - { - 515, - 513 - }, - { - 511, - 510 - }, - { - 512, - 510 - }, - { - 622, - 621 - }, - { - 623, - 621 - } - }; - public static int[] TrailingMode = NPCID.Sets.Factory.CreateIntSet(-1, 439, 0, 440, 0, 370, 1, 372, 1, 373, 1, 396, 1, 400, 1, 401, 1, 473, 2, 474, 2, 475, 2, 476, 2, 4, 3, 471, 3, 477, 3, 479, 3, 120, 4, 137, 4, 138, 4, 94, 5, 125, 6, 126, 6, (int) sbyte.MaxValue, 6, 128, 6, 129, 6, 130, 6, 131, 6, 139, 6, 140, 6, 407, 6, 420, 6, 425, 6, 427, 6, 426, 6, 581, 6, 516, 6, 542, 6, 543, 6, 544, 6, 545, 6, 402, 7, 417, 7, 419, 7, 418, 7, 574, 7, 575, 7, 519, 7, 521, 7, 522, 7, 546, 7, 558, 7, 559, 7, 560, 7, 551, 7, 620, 7, 657, 6, 636, 7); - public static bool[] IsDragonfly = NPCID.Sets.Factory.CreateBoolSet(595, 596, 597, 598, 599, 600, 601); + public static SetFactory Factory = new SetFactory(580); + public static int[] TrailingMode = NPCID.Sets.Factory.CreateIntSet(-1, 439, 0, 440, 0, 370, 1, 372, 1, 373, 1, 396, 1, 400, 1, 401, 1, 473, 2, 474, 2, 475, 2, 476, 2, 4, 3, 471, 3, 477, 3, 479, 3, 120, 4, 137, 4, 138, 4, 94, 5, 125, 6, 126, 6, (int) sbyte.MaxValue, 6, 128, 6, 129, 6, 130, 6, 131, 6, 139, 6, 140, 6, 407, 6, 420, 6, 425, 6, 427, 6, 426, 6, 509, 6, 516, 6, 542, 6, 543, 6, 544, 6, 545, 6, 402, 7, 417, 7, 419, 7, 418, 7, 574, 7, 575, 7, 519, 7, 521, 7, 522, 7, 546, 7, 558, 7, 559, 7, 560, 7, 551, 7); public static bool[] BelongsToInvasionOldOnesArmy = NPCID.Sets.Factory.CreateBoolSet(552, 553, 554, 561, 562, 563, 555, 556, 557, 558, 559, 560, 576, 577, 568, 569, 566, 567, 570, 571, 572, 573, 548, 549, 564, 565, 574, 575, 551, 578); public static bool[] TeleportationImmune = NPCID.Sets.Factory.CreateBoolSet(552, 553, 554, 561, 562, 563, 555, 556, 557, 558, 559, 560, 576, 577, 568, 569, 566, 567, 570, 571, 572, 573, 548, 549, 564, 565, 574, 575, 551, 578); - public static bool[] UsesNewTargetting = NPCID.Sets.Factory.CreateBoolSet(547, 552, 553, 554, 561, 562, 563, 555, 556, 557, 558, 559, 560, 576, 577, 568, 569, 566, 567, 570, 571, 572, 573, 564, 565, 574, 575, 551, 578, 210, 211, 620); - public static bool[] TakesDamageFromHostilesWithoutBeingFriendly = NPCID.Sets.Factory.CreateBoolSet(46, 55, 74, 148, 149, 230, 297, 298, 299, 303, 355, 356, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 377, 357, 374, 442, 443, 444, 445, 446, 448, 538, 539, 337, 540, 484, 485, 486, 487, 592, 593, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 611, 612, 613, 614, 615, 616, 617, 625, 626, 627, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 583, 584, 585); - public static bool[] AllNPCs = NPCID.Sets.Factory.CreateBoolSet(true); - public static bool[] HurtingBees = NPCID.Sets.Factory.CreateBoolSet(210, 211, 222); + public static bool[] UsesNewTargetting = NPCID.Sets.Factory.CreateBoolSet(547, 552, 553, 554, 561, 562, 563, 555, 556, 557, 558, 559, 560, 576, 577, 568, 569, 566, 567, 570, 571, 572, 573, 564, 565, 574, 575, 551, 578); public static bool[] FighterUsesDD2PortalAppearEffect = NPCID.Sets.Factory.CreateBoolSet(552, 553, 554, 561, 562, 563, 555, 556, 557, 576, 577, 568, 569, 570, 571, 572, 573, 564, 565); - public static float[] StatueSpawnedDropRarity = NPCID.Sets.Factory.CreateCustomSet(-1f, (object) (short) 480, (object) 0.05f, (object) (short) 82, (object) 0.05f, (object) (short) 86, (object) 0.05f, (object) (short) 48, (object) 0.05f, (object) (short) 490, (object) 0.05f, (object) (short) 489, (object) 0.05f, (object) (short) 170, (object) 0.05f, (object) (short) 180, (object) 0.05f, (object) (short) 171, (object) 0.05f, (object) (short) 167, (object) 0.25f, (object) (short) 73, (object) 0.01f, (object) (short) 24, (object) 0.05f, (object) (short) 481, (object) 0.05f, (object) (short) 42, (object) 0.05f, (object) (short) 6, (object) 0.05f, (object) (short) 2, (object) 0.05f, (object) (short) 49, (object) 0.2f, (object) (short) 3, (object) 0.2f, (object) (short) 58, (object) 0.2f, (object) (short) 21, (object) 0.2f, (object) (short) 65, (object) 0.2f, (object) (short) 449, (object) 0.2f, (object) (short) 482, (object) 0.2f, (object) (short) 103, (object) 0.2f, (object) (short) 64, (object) 0.2f, (object) (short) 63, (object) 0.2f, (object) (short) 85, (object) 0.0f); + public static float[] StatueSpawnedDropRarity = NPCID.Sets.Factory.CreateCustomSet(-1f, (object) (short) 480, (object) 0.05f, (object) (short) 82, (object) 0.05f, (object) (short) 86, (object) 0.05f, (object) (short) 48, (object) 0.05f, (object) (short) 490, (object) 0.05f, (object) (short) 489, (object) 0.05f, (object) (short) 170, (object) 0.05f, (object) (short) 180, (object) 0.05f, (object) (short) 171, (object) 0.05f, (object) (short) 167, (object) 0.25f); public static bool[] NoEarlymodeLootWhenSpawnedFromStatue = NPCID.Sets.Factory.CreateBoolSet(480, 82, 86, 170, 180, 171); - public static bool[] NeedsExpertScaling = NPCID.Sets.Factory.CreateBoolSet(25, 30, 33, 112, 261, 265, 371, 516, 519, 522, 397, 396, 398, 491); + public static bool[] NeedsExpertScaling = NPCID.Sets.Factory.CreateBoolSet(25, 30, 33, 112, 261, 265, 371, 516, 519, 522, 397, 396, 398); public static bool[] ProjectileNPC = NPCID.Sets.Factory.CreateBoolSet(25, 30, 33, 112, 261, 265, 371, 516, 519, 522); public static bool[] SavesAndLoads = NPCID.Sets.Factory.CreateBoolSet(422, 507, 517, 493); - public static int[] TrailCacheLength = NPCID.Sets.Factory.CreateIntSet(10, 402, 36, 519, 20, 522, 20, 620, 20); - public static bool[] NoMultiplayerSmoothingByType = NPCID.Sets.Factory.CreateBoolSet(113, 114, 50, 657, 120, 245, 247, 248, 246, 370, 222); - public static bool[] NoMultiplayerSmoothingByAI = NPCID.Sets.Factory.CreateBoolSet(6, 8, 37); - public static bool[] MPAllowedEnemies = NPCID.Sets.Factory.CreateBoolSet(4, 13, 50, 126, 125, 134, (int) sbyte.MaxValue, 128, 131, 129, 130, 222, 245, 266, 370, 657); - public static bool[] TownCritter = NPCID.Sets.Factory.CreateBoolSet(46, 148, 149, 230, 299, 300, 303, 337, 361, 362, 364, 366, 367, 443, 445, 447, 538, 539, 540, 583, 584, 585, 592, 593, 602, 607, 608, 610, 616, 617, 625, 626, 627, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652); - public static bool[] CountsAsCritter = NPCID.Sets.Factory.CreateBoolSet(46, 303, 337, 540, 443, 74, 297, 298, 442, 611, 377, 446, 612, 613, 356, 444, 595, 596, 597, 598, 599, 600, 601, 604, 605, 357, 448, 374, 484, 355, 358, 606, 359, 360, 485, 486, 487, 148, 149, 55, 230, 592, 593, 299, 538, 539, 300, 447, 361, 445, 362, 363, 364, 365, 367, 366, 583, 584, 585, 602, 603, 607, 608, 609, 610, 616, 617, 625, 626, 627, 615, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 661); - public static bool[] HasNoPartyText = NPCID.Sets.Factory.CreateBoolSet(441, 453); - public static int[] HatOffsetY = NPCID.Sets.Factory.CreateIntSet(0, 227, 4, 107, 2, 108, 2, 229, 4, 17, 2, 38, 8, 160, -10, 208, 2, 142, 2, 124, 2, 453, 2, 37, 4, 54, 4, 209, 4, 369, 6, 441, 6, 353, -2, 633, -2, 550, -2, 588, 2, 637, 0, 638, 0, 656, 4); - public static int[] FaceEmote = NPCID.Sets.Factory.CreateIntSet(0, 17, 101, 18, 102, 19, 103, 20, 104, 22, 105, 37, 106, 38, 107, 54, 108, 107, 109, 108, 110, 124, 111, 142, 112, 160, 113, 178, 114, 207, 115, 208, 116, 209, 117, 227, 118, 228, 119, 229, 120, 353, 121, 368, 122, 369, 123, 453, 124, 441, 125, 588, 140, 633, 141); - public static int[] ExtraFramesCount = NPCID.Sets.Factory.CreateIntSet(0, 17, 9, 18, 9, 19, 9, 20, 7, 22, 10, 37, 5, 38, 9, 54, 7, 107, 9, 108, 7, 124, 9, 142, 9, 160, 7, 178, 9, 207, 9, 208, 9, 209, 10, 227, 9, 228, 10, 229, 10, 353, 9, 633, 9, 368, 10, 369, 9, 453, 9, 441, 9, 550, 9, 588, 9, 637, 18, 638, 11, 656, 20); - public static int[] AttackFrameCount = NPCID.Sets.Factory.CreateIntSet(0, 17, 4, 18, 4, 19, 4, 20, 2, 22, 5, 37, 0, 38, 4, 54, 2, 107, 4, 108, 2, 124, 4, 142, 4, 160, 2, 178, 4, 207, 4, 208, 4, 209, 5, 227, 4, 228, 5, 229, 5, 353, 4, 633, 4, 368, 5, 369, 4, 453, 4, 441, 4, 550, 4, 588, 4, 637, 0, 638, 0, 656, 0); - public static int[] DangerDetectRange = NPCID.Sets.Factory.CreateIntSet(-1, 38, 300, 17, 320, 107, 300, 19, 900, 22, 700, 124, 800, 228, 800, 178, 900, 18, 300, 229, 1000, 209, 1000, 54, 700, 108, 700, 160, 700, 20, 1200, 369, 300, 453, 300, 368, 900, 207, 60, 227, 800, 208, 400, 142, 500, 441, 50, 353, 60, 633, 100, 550, 120, 588, 120, 638, 250, 637, 250, 656, 250); - public static int[] AttackTime = NPCID.Sets.Factory.CreateIntSet(-1, 38, 34, 17, 34, 107, 60, 19, 40, 22, 30, 124, 34, 228, 40, 178, 24, 18, 34, 229, 60, 209, 60, 54, 60, 108, 30, 160, 60, 20, 600, 369, 34, 453, 34, 368, 60, 207, 15, 227, 60, 208, 34, 142, 34, 441, 15, 353, 12, 633, 12, 550, 34, 588, 20, 638, -1, 637, -1, 656, -1); - public static int[] AttackAverageChance = NPCID.Sets.Factory.CreateIntSet(1, 38, 40, 17, 30, 107, 60, 19, 30, 22, 30, 124, 30, 228, 50, 178, 50, 18, 60, 229, 40, 209, 30, 54, 30, 108, 30, 160, 60, 20, 60, 369, 50, 453, 30, 368, 40, 207, 1, 227, 30, 208, 50, 142, 50, 441, 1, 353, 1, 633, 1, 550, 40, 588, 20, 638, 1, 637, 1, 656, 1); - public static int[] AttackType = NPCID.Sets.Factory.CreateIntSet(-1, 38, 0, 17, 0, 107, 0, 19, 1, 22, 1, 124, 0, 228, 1, 178, 1, 18, 0, 229, 1, 209, 1, 54, 2, 108, 2, 160, 2, 20, 2, 369, 0, 453, 0, 368, 1, 207, 3, 227, 1, 208, 0, 142, 0, 441, 3, 353, 3, 633, 0, 550, 0, 588, 0, 638, -1, 637, -1, 656, -1); + public static int[] TrailCacheLength = NPCID.Sets.Factory.CreateIntSet(10, 402, 36, 519, 20, 522, 20); + public static bool[] MPAllowedEnemies = NPCID.Sets.Factory.CreateBoolSet(4, 13, 50, 126, 125, 134, (int) sbyte.MaxValue, 128, 131, 129, 130, 222, 245, 266, 370); + public static bool[] TownCritter = NPCID.Sets.Factory.CreateBoolSet(46, 148, 149, 230, 299, 300, 303, 337, 361, 362, 364, 366, 367, 443, 445, 447, 538, 539, 540); + public static int[] HatOffsetY = NPCID.Sets.Factory.CreateIntSet(0, 227, 4, 107, 2, 108, 2, 229, 4, 17, 2, 38, 8, 160, -10, 208, 2, 142, 2, 124, 2, 453, 2, 37, 4, 54, 4, 209, 4, 369, 6, 441, 6, 353, -2, 550, -2); + public static int[] FaceEmote = NPCID.Sets.Factory.CreateIntSet(0, 17, 101, 18, 102, 19, 103, 20, 104, 22, 105, 37, 106, 38, 107, 54, 108, 107, 109, 108, 110, 124, 111, 142, 112, 160, 113, 178, 114, 207, 115, 208, 116, 209, 117, 227, 118, 228, 119, 229, 120, 353, 121, 368, 122, 369, 123, 453, 124, 441, 125); + public static int[] ExtraFramesCount = NPCID.Sets.Factory.CreateIntSet(0, 17, 9, 18, 9, 19, 9, 20, 7, 22, 10, 37, 5, 38, 9, 54, 7, 107, 9, 108, 7, 124, 9, 142, 9, 160, 7, 178, 9, 207, 9, 208, 9, 209, 10, 227, 9, 228, 10, 229, 10, 353, 9, 368, 10, 369, 9, 453, 9, 441, 9, 550, 9); + public static int[] AttackFrameCount = NPCID.Sets.Factory.CreateIntSet(0, 17, 4, 18, 4, 19, 4, 20, 2, 22, 5, 37, 0, 38, 4, 54, 2, 107, 4, 108, 2, 124, 4, 142, 4, 160, 2, 178, 4, 207, 4, 208, 4, 209, 5, 227, 4, 228, 5, 229, 5, 353, 4, 368, 5, 369, 4, 453, 4, 441, 4, 550, 4); + public static int[] DangerDetectRange = NPCID.Sets.Factory.CreateIntSet(-1, 38, 300, 17, 320, 107, 300, 19, 900, 22, 700, 124, 800, 228, 800, 178, 900, 18, 300, 229, 1000, 209, 1000, 54, 700, 108, 700, 160, 700, 20, 1200, 369, 300, 453, 300, 368, 900, 207, 60, 227, 800, 208, 400, 142, 500, 441, 50, 353, 60, 550, 120); + public static int[] AttackTime = NPCID.Sets.Factory.CreateIntSet(-1, 38, 34, 17, 34, 107, 60, 19, 40, 22, 30, 124, 34, 228, 40, 178, 24, 18, 34, 229, 60, 209, 60, 54, 60, 108, 30, 160, 60, 20, 600, 369, 34, 453, 34, 368, 60, 207, 15, 227, 60, 208, 34, 142, 34, 441, 15, 353, 12, 550, 34); + public static int[] AttackAverageChance = NPCID.Sets.Factory.CreateIntSet(1, 38, 40, 17, 30, 107, 60, 19, 30, 22, 30, 124, 30, 228, 50, 178, 50, 18, 60, 229, 40, 209, 30, 54, 30, 108, 30, 160, 60, 20, 60, 369, 50, 453, 30, 368, 40, 207, 1, 227, 30, 208, 50, 142, 50, 441, 1, 353, 1, 550, 40); + public static int[] AttackType = NPCID.Sets.Factory.CreateIntSet(-1, 38, 0, 17, 0, 107, 0, 19, 1, 22, 1, 124, 0, 228, 1, 178, 1, 18, 0, 229, 1, 209, 1, 54, 2, 108, 2, 160, 2, 20, 2, 369, 0, 453, 0, 368, 1, 207, 3, 227, 1, 208, 0, 142, 0, 441, 3, 353, 3, 550, 0); public static int[] PrettySafe = NPCID.Sets.Factory.CreateIntSet(-1, 19, 300, 22, 200, 124, 200, 228, 300, 178, 300, 229, 300, 209, 300, 54, 100, 108, 100, 160, 100, 20, 200, 368, 200, 227, 200); public static Color[] MagicAuraColor = NPCID.Sets.Factory.CreateCustomSet(Color.White, (object) (short) 54, (object) new Color(100, 4, 227, (int) sbyte.MaxValue), (object) (short) 108, (object) new Color((int) byte.MaxValue, 80, 60, (int) sbyte.MaxValue), (object) (short) 160, (object) new Color(40, 80, (int) byte.MaxValue, (int) sbyte.MaxValue), (object) (short) 20, (object) new Color(40, (int) byte.MaxValue, 80, (int) sbyte.MaxValue)); - public static bool[] DemonEyes = NPCID.Sets.Factory.CreateBoolSet(2, 190, 192, 193, 191, 194, 317, 318); - public static bool[] Zombies = NPCID.Sets.Factory.CreateBoolSet(3, 132, 186, 187, 188, 189, 200, 223, 161, 254, (int) byte.MaxValue, 52, 53, 536, 319, 320, 321, 332, 436, 431, 432, 433, 434, 435, 331, 430, 590); - public static bool[] Skeletons = NPCID.Sets.Factory.CreateBoolSet(77, 449, 450, 451, 452, 481, 201, 202, 203, 21, 324, 110, 323, 293, 291, 322, 292, 197, 167, 44, 635); - public static int[] BossHeadTextures = NPCID.Sets.Factory.CreateIntSet(-1, 4, 0, 13, 2, 344, 3, 370, 4, 246, 5, 249, 5, 345, 6, 50, 7, 396, 8, 395, 9, 325, 10, 262, 11, 327, 13, 222, 14, 125, 15, 126, 20, 346, 17, (int) sbyte.MaxValue, 18, 35, 19, 68, 19, 113, 22, 266, 23, 439, 24, 440, 24, 134, 25, 491, 26, 517, 27, 422, 28, 507, 29, 493, 30, 549, 35, 564, 32, 565, 32, 576, 33, 577, 33, 551, 34, 548, 36, 636, 37, 657, 38); - public static bool[] PositiveNPCTypesExcludedFromDeathTally = NPCID.Sets.Factory.CreateBoolSet(121, 384, 406, 478, 479, 410); - public static bool[] ShouldBeCountedAsBoss = NPCID.Sets.Factory.CreateBoolSet(false, 517, 422, 507, 493, 13); - public static bool[] DangerThatPreventsOtherDangers = NPCID.Sets.Factory.CreateBoolSet(517, 422, 507, 493, 399); + public static List Skeletons = new List() + { + 77, + -49, + -51, + -53, + -47, + 449, + 450, + 451, + 452, + 481, + 201, + -15, + 202, + 203, + 21, + 324, + 110, + 323, + 293, + 291, + 322, + -48, + -50, + -52, + -46, + 292, + 197, + 167, + 44 + }; + public static int[] BossHeadTextures = NPCID.Sets.Factory.CreateIntSet(-1, 4, 0, 13, 2, 344, 3, 370, 4, 246, 5, 249, 5, 345, 6, 50, 7, 396, 8, 395, 9, 325, 10, 262, 11, 327, 13, 222, 14, 125, 15, 126, 16, 346, 17, (int) sbyte.MaxValue, 18, 35, 19, 68, 19, 113, 22, 266, 23, 439, 24, 440, 24, 134, 25, 491, 26, 517, 27, 422, 28, 507, 29, 493, 30, 549, 35, 564, 32, 565, 32, 576, 33, 577, 33, 551, 34, 548, 36); + public static bool[] ExcludedFromDeathTally = NPCID.Sets.Factory.CreateBoolSet(false, 121, 384, 406); + public static bool[] TechnicallyABoss = NPCID.Sets.Factory.CreateBoolSet(517, 422, 507, 493, 399); public static bool[] MustAlwaysDraw = NPCID.Sets.Factory.CreateBoolSet(113, 114, 115, 116, 126, 125); - public static int[] ExtraTextureCount = NPCID.Sets.Factory.CreateIntSet(0, 38, 1, 17, 1, 107, 0, 19, 0, 22, 0, 124, 1, 228, 0, 178, 1, 18, 1, 229, 1, 209, 1, 54, 1, 108, 1, 160, 0, 20, 0, 369, 1, 453, 1, 368, 1, 207, 1, 227, 1, 208, 0, 142, 1, 441, 1, 353, 1, 633, 1, 550, 0, 588, 1, 633, 2, 638, 0, 637, 0, 656, 0); - public static int[] NPCFramingGroup = NPCID.Sets.Factory.CreateIntSet(0, 18, 1, 20, 1, 208, 1, 178, 1, 124, 1, 353, 1, 633, 1, 369, 2, 160, 3, 637, 4, 638, 5, 656, 6); - public static int[][] TownNPCsFramingGroups = new int[7][] + public static int[] ExtraTextureCount = NPCID.Sets.Factory.CreateIntSet(0, 38, 1, 17, 1, 107, 0, 19, 0, 22, 0, 124, 1, 228, 0, 178, 1, 18, 1, 229, 1, 209, 1, 54, 1, 108, 1, 160, 0, 20, 0, 369, 1, 453, 1, 368, 1, 207, 1, 227, 1, 208, 0, 142, 1, 441, 1, 353, 1, 550, 0); + public static int[] NPCFramingGroup = NPCID.Sets.Factory.CreateIntSet(0, 18, 1, 20, 1, 208, 1, 178, 1, 124, 1, 353, 1, 369, 2, 160, 3); + public static int[][] TownNPCsFramingGroups = new int[4][] { new int[26] { @@ -3233,2670 +2805,8 @@ namespace Terraria.ID 0, 2, 6 - }, - new int[28] - { - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 2, - 2, - 4, - 6, - 4, - 2, - 2, - -2, - -4, - -6, - -4, - -2, - -4, - -4, - -6, - -6, - -6, - -4 - }, - new int[28] - { - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - -2, - -2, - -2, - 0, - 0, - -2, - -2, - 0, - 0, - 4, - 6, - 6, - 6, - 6, - 4, - 4, - 4, - 4, - 4, - 4 - }, - new int[26] - { - 0, - 0, - -2, - -4, - -4, - -2, - 0, - -2, - 0, - 0, - 2, - 4, - 6, - 4, - 2, - 0, - -2, - -4, - -6, - -6, - -6, - -6, - -6, - -6, - -4, - -2 } }; - - public static Dictionary NPCBestiaryDrawOffsetCreation() - { - Dictionary redigitEntries = NPCID.Sets.GetRedigitEntries(); - Dictionary leinforsEntries = NPCID.Sets.GetLeinforsEntries(); - Dictionary groxEntries = NPCID.Sets.GetGroxEntries(); - Dictionary dictionary = new Dictionary(); - foreach (KeyValuePair keyValuePair in groxEntries) - dictionary[keyValuePair.Key] = keyValuePair.Value; - foreach (KeyValuePair keyValuePair in leinforsEntries) - dictionary[keyValuePair.Key] = keyValuePair.Value; - foreach (KeyValuePair keyValuePair in redigitEntries) - dictionary[keyValuePair.Key] = keyValuePair.Value; - return dictionary; - } - - private static Dictionary GetRedigitEntries() - { - Dictionary dictionary = new Dictionary(); - NPCID.Sets.NPCBestiaryDrawModifiers bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(430, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(431, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(432, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(433, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(434, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(435, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(436, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(591, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(449, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(450, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(451, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(452, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(595, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(596, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(597, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(598, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(600, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(495, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(497, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(498, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(500, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(501, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(502, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(503, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(504, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(505, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(506, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(230, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(593, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(158, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-2, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(440, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(568, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(566, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(576, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(558, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(559, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(552, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(553, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(564, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(570, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(555, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(556, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(574, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(561, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(562, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(572, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(535, bestiaryDrawModifiers); - return dictionary; - } - - private static Dictionary GetGroxEntries() => new Dictionary(); - - private static Dictionary GetLeinforsEntries() - { - Dictionary dictionary = new Dictionary(); - NPCID.Sets.NPCBestiaryDrawModifiers bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-65, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-64, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-63, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-62, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(2f, 4f); - bestiaryDrawModifiers.Scale = 1.1f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-61, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(1f, 3f); - bestiaryDrawModifiers.Scale = 0.9f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-60, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-59, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-58, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-57, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-56, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Scale = 1.1f; - dictionary.Add(-55, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Scale = 0.9f; - dictionary.Add(-54, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Scale = 1.1f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-53, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Scale = 0.9f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-52, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Scale = 1.1f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-51, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Scale = 0.9f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-50, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Scale = 1.1f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-49, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Scale = 0.9f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-48, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Scale = 1.1f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-47, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Scale = 0.9f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-46, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Scale = 1.1f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-45, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Scale = 0.9f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-44, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(5f, -15f); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-43, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(5f, -15f); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-42, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(5f, -15f); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-41, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(5f, -15f); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-40, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(5f, -15f); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-39, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(5f, -15f); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-38, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Scale = 1.1f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-37, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Scale = 0.9f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-36, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Scale = 1.1f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-35, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Scale = 0.9f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-34, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Scale = 1.1f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-33, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Scale = 0.9f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-32, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Scale = 1.1f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-31, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Scale = 0.9f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-30, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Scale = 1.1f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-29, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Scale = 0.9f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-28, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Scale = 1.1f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-27, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Scale = 0.9f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-26, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(5f, -9f); - bestiaryDrawModifiers.Rotation = 0.75f; - bestiaryDrawModifiers.Scale = 1.2f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-23, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(5f, -9f); - bestiaryDrawModifiers.Rotation = 0.75f; - bestiaryDrawModifiers.Scale = 0.8f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-22, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-25, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-24, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(2f, 5f); - bestiaryDrawModifiers.Scale = 1.2f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-21, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(2f, 4f); - bestiaryDrawModifiers.Scale = 1.1f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-20, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(1f, 3f); - bestiaryDrawModifiers.Scale = 0.9f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-19, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 2f); - bestiaryDrawModifiers.Scale = 0.8f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-18, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 3f); - bestiaryDrawModifiers.Scale = 1.2f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-17, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(2f, 3f); - bestiaryDrawModifiers.Scale = 0.8f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-16, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Scale = 1.2f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-15, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Scale = 1.1f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-14, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Scale = 0.9f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-13, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(5f, -9f); - bestiaryDrawModifiers.Rotation = 0.75f; - bestiaryDrawModifiers.Scale = 1.2f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-12, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(5f, -9f); - bestiaryDrawModifiers.Rotation = 0.75f; - bestiaryDrawModifiers.Scale = 0.8f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(-11, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(6f, -15f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-35f); - dictionary.Add(2, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(2f); - dictionary.Add(3, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(25f, -30f); - bestiaryDrawModifiers.Rotation = 0.7f; - bestiaryDrawModifiers.Frame = new int?(4); - dictionary.Add(4, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(3f, 4f); - bestiaryDrawModifiers.Rotation = 1.5f; - dictionary.Add(5, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(5f, -9f); - bestiaryDrawModifiers.Rotation = 0.75f; - dictionary.Add(6, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.CustomTexturePath = "Images/UI/Bestiary/NPCs/NPC_7"; - bestiaryDrawModifiers.Position = new Vector2(20f, 29f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(10f); - dictionary.Add(7, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(8, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(9, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.CustomTexturePath = "Images/UI/Bestiary/NPCs/NPC_10"; - bestiaryDrawModifiers.Position = new Vector2(2f, 24f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(10f); - dictionary.Add(10, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(11, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(12, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.CustomTexturePath = "Images/UI/Bestiary/NPCs/NPC_13"; - bestiaryDrawModifiers.Position = new Vector2(40f, 22f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(10f); - dictionary.Add(13, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(14, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(15, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(17, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(2f); - dictionary.Add(18, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(19, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(2f); - dictionary.Add(20, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(22, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(25, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(26, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(27, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(28, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(30, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(31, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(33, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Direction = new int?(1); - dictionary.Add(34, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(21, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, -12f); - bestiaryDrawModifiers.Scale = 0.9f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(-1f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-3f); - dictionary.Add(35, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(36, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(38, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(37, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.CustomTexturePath = "Images/UI/Bestiary/NPCs/NPC_39"; - bestiaryDrawModifiers.Position = new Vector2(40f, 23f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(10f); - dictionary.Add(39, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(40, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(41, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(4f, -6f); - bestiaryDrawModifiers.Rotation = 2.356194f; - dictionary.Add(43, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(44, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(46, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(47, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(2f, -14f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-30f); - dictionary.Add(48, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, -13f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-30f); - dictionary.Add(49, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 90f); - bestiaryDrawModifiers.PortraitScale = new float?(1.1f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(70f); - dictionary.Add(50, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, -13f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-30f); - dictionary.Add(51, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(52, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(53, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(54, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 6f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(7f); - bestiaryDrawModifiers.IsWet = true; - dictionary.Add(55, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(4f, -6f); - bestiaryDrawModifiers.Rotation = 2.356194f; - dictionary.Add(56, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 6f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(6f); - bestiaryDrawModifiers.IsWet = true; - dictionary.Add(57, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 6f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(6f); - bestiaryDrawModifiers.IsWet = true; - dictionary.Add(58, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, -19f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-36f); - dictionary.Add(60, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 0.05f; - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-15f); - dictionary.Add(61, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, -10f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-25f); - dictionary.Add(62, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(35f, 4f); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(5f); - bestiaryDrawModifiers.IsWet = true; - dictionary.Add(65, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, -6f); - bestiaryDrawModifiers.Scale = 0.9f; - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-15f); - dictionary.Add(66, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-1f, -12f); - bestiaryDrawModifiers.Scale = 0.9f; - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-3f); - dictionary.Add(68, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(70, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(72, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(73, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(1f, -14f); - bestiaryDrawModifiers.Velocity = 0.05f; - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-30f); - dictionary.Add(74, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 6f); - dictionary.Add(75, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(76, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(77, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 0.5f; - dictionary.Add(78, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 0.5f; - dictionary.Add(79, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 0.5f; - dictionary.Add(80, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-4f, -4f); - bestiaryDrawModifiers.Scale = 0.9f; - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-25f); - dictionary.Add(83, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(6f, -11f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-28f); - dictionary.Add(84, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(20f, 6f); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(2f); - dictionary.Add(86, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.CustomTexturePath = "Images/UI/Bestiary/NPCs/NPC_87"; - bestiaryDrawModifiers.Position = new Vector2(55f, 15f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(4f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(10f); - dictionary.Add(87, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(88, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(89, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(90, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(91, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(92, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(4f, -11f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-30f); - dictionary.Add(93, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(8f, 0.0f); - bestiaryDrawModifiers.Rotation = 0.75f; - dictionary.Add(94, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.CustomTexturePath = "Images/UI/Bestiary/NPCs/NPC_95"; - bestiaryDrawModifiers.Position = new Vector2(20f, 28f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(10f); - dictionary.Add(95, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(96, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(97, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.CustomTexturePath = "Images/UI/Bestiary/NPCs/NPC_98"; - bestiaryDrawModifiers.Position = new Vector2(40f, 24f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(12f); - dictionary.Add(98, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(99, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(100, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-2f, 6f); - bestiaryDrawModifiers.Rotation = 2.356194f; - dictionary.Add(101, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 6f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(6f); - bestiaryDrawModifiers.IsWet = true; - dictionary.Add(102, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(104, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(105, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(106, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(107, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(108, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 35f); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(0.0f); - dictionary.Add(109, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 3f; - dictionary.Add(110, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 3f; - dictionary.Add(111, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(112, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.CustomTexturePath = "Images/UI/Bestiary/NPCs/NPC_113"; - bestiaryDrawModifiers.Position = new Vector2(56f, 5f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(10f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(0.0f); - dictionary.Add(113, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(114, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.CustomTexturePath = "Images/UI/Bestiary/NPCs/NPC_115"; - bestiaryDrawModifiers.Position = new Vector2(56f, 3f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(55f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(0.0f); - dictionary.Add(115, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(3f, -5f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(4f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-26f); - dictionary.Add(116, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.CustomTexturePath = "Images/UI/Bestiary/NPCs/NPC_117"; - bestiaryDrawModifiers.Position = new Vector2(10f, 20f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(0.0f); - dictionary.Add(117, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(118, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(119, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(120, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(123, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(2f); - dictionary.Add(124, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-2f, -4f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-20f); - dictionary.Add(121, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 4f); - dictionary.Add(122, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-28f, -23f); - bestiaryDrawModifiers.Rotation = -0.75f; - dictionary.Add(125, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(28f, 30f); - bestiaryDrawModifiers.Rotation = 2.25f; - dictionary.Add(126, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.CustomTexturePath = "Images/UI/Bestiary/NPCs/NPC_127"; - bestiaryDrawModifiers.Position = new Vector2(0.0f, 0.0f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(1f); - dictionary.Add((int) sbyte.MaxValue, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-6f, -2f); - bestiaryDrawModifiers.Rotation = -0.75f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(128, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(4f, 4f); - bestiaryDrawModifiers.Rotation = 0.75f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(129, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(6f, 8f); - bestiaryDrawModifiers.Rotation = 2.25f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(130, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-8f, 8f); - bestiaryDrawModifiers.Rotation = -2.25f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(131, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(132, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, -5f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-25f); - dictionary.Add(133, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.CustomTexturePath = "Images/UI/Bestiary/NPCs/NPC_134"; - bestiaryDrawModifiers.Position = new Vector2(60f, 8f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(3f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(0.0f); - dictionary.Add(134, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(135, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(136, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(4f, -11f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-30f); - dictionary.Add(137, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(140, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(1f); - dictionary.Add(142, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(146, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(148, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(149, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, -11f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-30f); - dictionary.Add(150, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, -11f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-30f); - dictionary.Add(151, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(2f, -11f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-30f); - dictionary.Add(152, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(20f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - dictionary.Add(153, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(20f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - dictionary.Add(154, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(15f, 0.0f); - bestiaryDrawModifiers.Velocity = 3f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - dictionary.Add(155, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-15f); - dictionary.Add(156, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(20f, 5f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(5f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(10f); - bestiaryDrawModifiers.IsWet = true; - dictionary.Add(157, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(160, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, -11f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-30f); - dictionary.Add(158, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(159, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(161, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(162, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(163, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(164, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Rotation = -1.6f; - bestiaryDrawModifiers.Velocity = 2f; - dictionary.Add(165, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(167, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(168, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(10f, 5f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-12f); - dictionary.Add(170, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(10f, 5f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-12f); - dictionary.Add(171, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Rotation = 0.75f; - bestiaryDrawModifiers.Position = new Vector2(0.0f, -5f); - dictionary.Add(173, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, -5f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(174, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(4f, -2f); - bestiaryDrawModifiers.Rotation = 2.356194f; - dictionary.Add(175, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 5f); - dictionary.Add(176, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(10f, 15f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(-4f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(1f); - bestiaryDrawModifiers.Frame = new int?(0); - dictionary.Add(177, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(2f); - dictionary.Add(178, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-5f, 12f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-7f); - dictionary.Add(179, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(10f, 5f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-12f); - dictionary.Add(180, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(181, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(185, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(186, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(187, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(188, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(189, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(6f, -15f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-35f); - dictionary.Add(190, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(6f, -15f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-35f); - dictionary.Add(191, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(6f, -15f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-35f); - dictionary.Add(192, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(5f, -15f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-35f); - dictionary.Add(193, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(5f, -15f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-35f); - dictionary.Add(194, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(196, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(197, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(198, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(199, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(2f); - dictionary.Add(200, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(201, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(202, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(203, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 2f; - dictionary.Add(206, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(207, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(2f); - dictionary.Add(208, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(209, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(212, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(213, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 3f; - dictionary.Add(214, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 3f; - dictionary.Add(215, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 3f; - dictionary.Add(216, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 5f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(221, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(10f, 55f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(40f); - dictionary.Add(222, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(223, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(5f, -10f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-30f); - dictionary.Add(224, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(5f, 3f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-15f); - dictionary.Add(226, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(-3f); - dictionary.Add(227, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(-5f); - dictionary.Add(228, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(229, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(2f, 0.0f); - dictionary.Add(225, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(230, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 5f); - dictionary.Add(231, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 5f); - dictionary.Add(232, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 5f); - dictionary.Add(233, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 5f); - dictionary.Add(234, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 5f); - dictionary.Add(235, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(236, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Rotation = -1.6f; - bestiaryDrawModifiers.Velocity = 2f; - dictionary.Add(237, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Rotation = -1.6f; - bestiaryDrawModifiers.Velocity = 2f; - dictionary.Add(238, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(239, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Rotation = -1.6f; - bestiaryDrawModifiers.Velocity = 2f; - dictionary.Add(240, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 6f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(6f); - bestiaryDrawModifiers.IsWet = true; - dictionary.Add(241, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 10f); - dictionary.Add(242, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 60f); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(15f); - dictionary.Add(243, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.CustomTexturePath = "Images/UI/Bestiary/NPCs/NPC_245"; - bestiaryDrawModifiers.Position = new Vector2(2f, 48f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(24f); - dictionary.Add(245, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(246, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(247, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(248, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(249, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, -6f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-26f); - dictionary.Add(250, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(251, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(3f, 3f); - bestiaryDrawModifiers.Velocity = 0.05f; - dictionary.Add(252, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 5f); - dictionary.Add(253, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(254, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(-2f); - dictionary.Add((int) byte.MaxValue, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 5f); - dictionary.Add(256, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(257, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(258, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.CustomTexturePath = "Images/UI/Bestiary/NPCs/NPC_259"; - bestiaryDrawModifiers.Position = new Vector2(0.0f, 25f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(8f); - dictionary.Add(259, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.CustomTexturePath = "Images/UI/Bestiary/NPCs/NPC_260"; - bestiaryDrawModifiers.Position = new Vector2(0.0f, 25f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(1f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(4f); - dictionary.Add(260, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(261, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 20f); - bestiaryDrawModifiers.Scale = 0.8f; - dictionary.Add(262, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(264, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(263, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(265, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(5f, 5f); - bestiaryDrawModifiers.Frame = new int?(4); - dictionary.Add(266, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(2f, -5f); - dictionary.Add(268, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-5f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(269, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-5f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(270, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-2f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(271, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-5f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(272, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-5f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(273, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-3f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(274, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-3f, 2f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(3f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(275, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-5f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(276, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-5f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(277, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-2f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(278, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-5f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(279, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-3f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(280, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(287, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(2f, 10f); - bestiaryDrawModifiers.Direction = new int?(1); - dictionary.Add(289, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(4f, 6f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(290, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(291, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(292, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(293, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(294, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(295, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(296, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(1f, -14f); - bestiaryDrawModifiers.Velocity = 0.05f; - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-30f); - dictionary.Add(297, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(1f, -14f); - bestiaryDrawModifiers.Velocity = 0.05f; - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-30f); - dictionary.Add(298, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(299, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-20f); - bestiaryDrawModifiers.Direction = new int?(-1); - bestiaryDrawModifiers.SpriteDirection = new int?(1); - bestiaryDrawModifiers.Velocity = 0.05f; - dictionary.Add(301, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(303, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 0.05f; - dictionary.Add(305, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 0.05f; - dictionary.Add(306, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 0.05f; - dictionary.Add(307, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 0.05f; - dictionary.Add(308, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 0.05f; - dictionary.Add(309, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(310, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(311, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(312, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(313, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(314, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(14f, 26f); - bestiaryDrawModifiers.Velocity = 2f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(0.0f); - dictionary.Add(315, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 4f); - dictionary.Add(316, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(5f, -15f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-35f); - dictionary.Add(317, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(5f, -13f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-31f); - dictionary.Add(318, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(319, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(320, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(2f); - dictionary.Add(321, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(322, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(323, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(324, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 36f); - dictionary.Add(325, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(326, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, -8f); - dictionary.Add(327, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(328, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 2f; - dictionary.Add(329, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(2f, 14f); - dictionary.Add(330, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(331, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(332, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(337, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(338, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(339, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(340, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(342, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(5f, 25f); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(0.0f); - dictionary.Add(343, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 90f); - dictionary.Add(344, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-1f, 90f); - dictionary.Add(345, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(30f, 80f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(60f); - dictionary.Add(346, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 4f); - dictionary.Add(347, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(348, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-3f, 18f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(0.0f); - dictionary.Add(349, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(3f, 0.0f); - bestiaryDrawModifiers.Velocity = 2f; - dictionary.Add(350, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(6f, 60f); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(30f); - dictionary.Add(351, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(2f); - dictionary.Add(353, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(2f); - dictionary.Add(633, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(354, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(1f, 2f); - dictionary.Add(355, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(2f, 3f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(1f); - dictionary.Add(356, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 2f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(357, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(1f, 2f); - dictionary.Add(358, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 18f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(40f); - dictionary.Add(359, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(1f, 17f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(39f); - dictionary.Add(360, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(3f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(362, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(363, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(3f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(364, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Hide = true; - dictionary.Add(365, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(1f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(366, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(2f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(367, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(368, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(2f); - dictionary.Add(369, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(56f, -4f); - bestiaryDrawModifiers.Direction = new int?(1); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(0.0f); - dictionary.Add(370, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(371, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(35f, 4f); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(10f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-3f); - dictionary.Add(372, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(373, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(374, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(375, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(376, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(379, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(380, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-2f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(381, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-2f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(382, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-2f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(383, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(384, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-2f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(385, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-2f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(386, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(2f, 0.0f); - bestiaryDrawModifiers.Velocity = 3f; - dictionary.Add(387, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Direction = new int?(1); - dictionary.Add(388, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-6f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(389, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(12f, 0.0f); - bestiaryDrawModifiers.Direction = new int?(-1); - bestiaryDrawModifiers.SpriteDirection = new int?(1); - bestiaryDrawModifiers.Velocity = 2f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-12f); - dictionary.Add(390, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(16f, 12f); - bestiaryDrawModifiers.Direction = new int?(-1); - bestiaryDrawModifiers.SpriteDirection = new int?(1); - bestiaryDrawModifiers.Velocity = 2f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(3f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(0.0f); - dictionary.Add(391, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(392, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.CustomTexturePath = "Images/UI/Bestiary/NPCs/NPC_395"; - bestiaryDrawModifiers.Position = new Vector2(-1f, 18f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(1f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(0.0f); - dictionary.Add(395, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(393, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(394, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(396, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(397, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.CustomTexturePath = "Images/UI/Bestiary/NPCs/NPC_398"; - bestiaryDrawModifiers.Position = new Vector2(0.0f, 5f); - bestiaryDrawModifiers.Scale = 0.4f; - bestiaryDrawModifiers.PortraitScale = new float?(0.7f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(0.0f); - dictionary.Add(398, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(400, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(401, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.CustomTexturePath = "Images/UI/Bestiary/NPCs/NPC_402"; - bestiaryDrawModifiers.Position = new Vector2(42f, 15f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(0.0f); - dictionary.Add(402, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(403, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(404, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(408, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(410, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Direction = new int?(-1); - bestiaryDrawModifiers.SpriteDirection = new int?(1); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(411, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.CustomTexturePath = "Images/UI/Bestiary/NPCs/NPC_412"; - bestiaryDrawModifiers.Position = new Vector2(50f, 28f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(4f); - dictionary.Add(412, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(413, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(414, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(26f, 0.0f); - bestiaryDrawModifiers.Velocity = 3f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(5f); - dictionary.Add(415, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(6f, 20f); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(0.0f); - dictionary.Add(416, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-2f, 8f); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(0.0f); - dictionary.Add(417, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(2f, 4f); - dictionary.Add(418, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-2f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(419, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 4f); - bestiaryDrawModifiers.Direction = new int?(1); - dictionary.Add(420, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(1f, -1f); - dictionary.Add(421, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(1f, 44f); - bestiaryDrawModifiers.Scale = 0.4f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(2f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(134f); - dictionary.Add(422, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Direction = new int?(-1); - bestiaryDrawModifiers.SpriteDirection = new int?(1); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(423, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(4f, 0.0f); - bestiaryDrawModifiers.Direction = new int?(-1); - bestiaryDrawModifiers.SpriteDirection = new int?(1); - bestiaryDrawModifiers.Velocity = 2f; - dictionary.Add(424, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(4f, 0.0f); - bestiaryDrawModifiers.Direction = new int?(-1); - bestiaryDrawModifiers.SpriteDirection = new int?(1); - bestiaryDrawModifiers.Velocity = 2f; - dictionary.Add(425, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(2f, 8f); - bestiaryDrawModifiers.Velocity = 2f; - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(0.0f); - dictionary.Add(426, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-4f); - dictionary.Add(427, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(428, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(2f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(429, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(430, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(431, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(432, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(433, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(434, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(435, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(436, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(437, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(439, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(440, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(441, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(1f, -14f); - bestiaryDrawModifiers.Velocity = 0.05f; - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-30f); - dictionary.Add(442, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(443, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(2f, 2f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(0.0f); - dictionary.Add(444, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(448, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(449, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(450, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(451, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(452, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(453, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.CustomTexturePath = "Images/UI/Bestiary/NPCs/NPC_454"; - bestiaryDrawModifiers.Position = new Vector2(57f, 10f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(5f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(0.0f); - dictionary.Add(454, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(455, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(456, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(457, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(458, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(459, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(460, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-2f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(461, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(462, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(463, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(464, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 6f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(6f); - bestiaryDrawModifiers.IsWet = true; - dictionary.Add(465, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(466, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(467, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(468, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(469, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(470, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(471, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 0.0f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-30f); - bestiaryDrawModifiers.SpriteDirection = new int?(-1); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(472, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(476, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(25f, 6f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(10f); - dictionary.Add(477, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(478, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(5f, 4f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-15f); - dictionary.Add(479, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(481, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(482, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, -10f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-30f); - dictionary.Add(483, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(484, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 0.5f; - dictionary.Add(487, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 0.5f; - dictionary.Add(486, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 0.5f; - dictionary.Add(485, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(489, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.CustomTexturePath = "Images/UI/Bestiary/NPCs/NPC_491"; - bestiaryDrawModifiers.Position = new Vector2(30f, -5f); - bestiaryDrawModifiers.Scale = 0.8f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(1f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-1f); - dictionary.Add(491, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(492, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(1f, 44f); - bestiaryDrawModifiers.Scale = 0.4f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(2f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(134f); - dictionary.Add(493, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(494, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-4f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(495, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 0.5f; - dictionary.Add(496, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 0.5f; - dictionary.Add(497, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(498, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(499, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(500, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(501, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(502, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(503, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(504, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(505, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(506, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(1f, 44f); - bestiaryDrawModifiers.Scale = 0.4f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(2f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(134f); - dictionary.Add(507, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Position = new Vector2(10f, 0.0f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - dictionary.Add(508, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(6f, 0.0f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(-10f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-20f); - dictionary.Add(509, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.CustomTexturePath = "Images/UI/Bestiary/NPCs/NPC_510"; - bestiaryDrawModifiers.Position = new Vector2(55f, 18f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(10f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(12f); - dictionary.Add(510, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(512, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(511, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.CustomTexturePath = "Images/UI/Bestiary/NPCs/NPC_513"; - bestiaryDrawModifiers.Position = new Vector2(37f, 24f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(10f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(17f); - dictionary.Add(513, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(514, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(515, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(516, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(1f, 44f); - bestiaryDrawModifiers.Scale = 0.4f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(2f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(135f); - dictionary.Add(517, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-17f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(518, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(519, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 56f); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(10f); - dictionary.Add(520, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(5f, 5f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-10f); - bestiaryDrawModifiers.SpriteDirection = new int?(-1); - bestiaryDrawModifiers.Velocity = 0.05f; - dictionary.Add(521, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(522, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(523, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(524, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(525, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(526, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(527, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(528, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(529, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(530, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 4f); - bestiaryDrawModifiers.Velocity = 2f; - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(10f); - dictionary.Add(531, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(6f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(532, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(3f, 5f); - dictionary.Add(533, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(534, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-2f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(536, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(538, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(539, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(540, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 30f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(0.0f); - dictionary.Add(541, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(35f, -3f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - dictionary.Add(542, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(35f, -3f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - dictionary.Add(543, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(35f, -3f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - dictionary.Add(544, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(35f, -3f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - dictionary.Add(545, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, -3f); - bestiaryDrawModifiers.Direction = new int?(1); - dictionary.Add(546, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(547, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(548, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(549, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(-2f); - dictionary.Add(550, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(95f, -4f); - dictionary.Add(551, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(552, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(553, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(554, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(555, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(556, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(557, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(3f, -2f); - dictionary.Add(558, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(3f, -2f); - dictionary.Add(559, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(3f, -2f); - dictionary.Add(560, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(561, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(562, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(563, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-3f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(566, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-3f, 0.0f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(567, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(568, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(569, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(10f, 5f); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(2f); - dictionary.Add(570, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(10f, 5f); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(0.0f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(2f); - dictionary.Add(571, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(572, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(573, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 4f); - dictionary.Add(578, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(16f, 6f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(574, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(16f, 6f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(575, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(20f, 70f); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(10f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(0.0f); - bestiaryDrawModifiers.PortraitScale = new float?(0.75f); - dictionary.Add(576, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(20f, 70f); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(10f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(0.0f); - bestiaryDrawModifiers.PortraitScale = new float?(0.75f); - dictionary.Add(577, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 0.0f); - bestiaryDrawModifiers.Scale = 0.9f; - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(580, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, -8f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-30f); - dictionary.Add(581, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(582, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 1f); - bestiaryDrawModifiers.Direction = new int?(1); - dictionary.Add(585, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 1f); - bestiaryDrawModifiers.Direction = new int?(1); - dictionary.Add(584, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 1f); - bestiaryDrawModifiers.Direction = new int?(1); - dictionary.Add(583, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(586, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(579, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(1f); - dictionary.Add(588, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(2f, -14f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-30f); - dictionary.Add(587, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(9f, 0.0f); - dictionary.Add(591, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(2f); - dictionary.Add(590, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 6f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(7f); - bestiaryDrawModifiers.IsWet = true; - dictionary.Add(592, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(593, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.CustomTexturePath = "Images/UI/Bestiary/NPCs/NPC_594"; - bestiaryDrawModifiers.Scale = 0.8f; - dictionary.Add(594, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(589, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(602, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(603, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(2f, 22f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(41f); - dictionary.Add(604, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(2f, 22f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(41f); - dictionary.Add(605, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(606, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 6f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(7f); - bestiaryDrawModifiers.IsWet = true; - dictionary.Add(607, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(608, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(609, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 0.0f); - bestiaryDrawModifiers.Direction = new int?(-1); - bestiaryDrawModifiers.SpriteDirection = new int?(1); - dictionary.Add(611, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(612, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(613, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(614, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 10f); - bestiaryDrawModifiers.Scale = 0.88f; - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(20f); - bestiaryDrawModifiers.IsWet = true; - dictionary.Add(615, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(616, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(617, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(12f, -5f); - bestiaryDrawModifiers.Scale = 0.9f; - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(0.0f); - dictionary.Add(618, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(1f, 7f); - bestiaryDrawModifiers.Scale = 0.85f; - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(10f); - dictionary.Add(619, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(6f, 5f); - bestiaryDrawModifiers.Scale = 0.78f; - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(620, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.CustomTexturePath = "Images/UI/Bestiary/NPCs/NPC_621"; - bestiaryDrawModifiers.Position = new Vector2(46f, 20f); - bestiaryDrawModifiers.PortraitPositionXOverride = new float?(10f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(17f); - dictionary.Add(621, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(622, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(623, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 2f; - dictionary.Add(624, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, -12f); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(625, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, -16f); - dictionary.Add(626, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, -16f); - dictionary.Add(627, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Direction = new int?(1); - dictionary.Add(628, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 0.5f; - dictionary.Add(630, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(632, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 0.75f; - dictionary.Add(631, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - bestiaryDrawModifiers.Position = new Vector2(0.0f, -13f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-30f); - dictionary.Add(634, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(635, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 50f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(30f); - dictionary.Add(636, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(639, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(640, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(641, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(642, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(643, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(644, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(645, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(646, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(647, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(648, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(649, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(650, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(651, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(652, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 0.25f; - dictionary.Add(637, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(638, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(2f, 3f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(1f); - dictionary.Add(653, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(1f, 2f); - dictionary.Add(654, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(1f, 17f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(39f); - dictionary.Add(655, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Velocity = 1f; - dictionary.Add(656, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(0.0f, 60f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(40f); - dictionary.Add(657, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(-2f, -4f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(-20f); - dictionary.Add(660, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Position = new Vector2(2f, 3f); - bestiaryDrawModifiers.PortraitPositionYOverride = new float?(1f); - dictionary.Add(661, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(662, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(0, bestiaryDrawModifiers); - bestiaryDrawModifiers = new NPCID.Sets.NPCBestiaryDrawModifiers(0); - bestiaryDrawModifiers.Hide = true; - dictionary.Add(488, bestiaryDrawModifiers); - return dictionary; - } - - public struct NPCBestiaryDrawModifiers - { - public Vector2 Position; - public float? PortraitPositionXOverride; - public float? PortraitPositionYOverride; - public float Rotation; - public float Scale; - public float? PortraitScale; - public bool Hide; - public bool IsWet; - public int? Frame; - public int? Direction; - public int? SpriteDirection; - public float Velocity; - public string CustomTexturePath; - - public NPCBestiaryDrawModifiers( - int seriouslyWhyCantStructsHaveParameterlessConstructors) - { - this.Position = new Vector2(); - this.Rotation = 0.0f; - this.Scale = 1f; - this.PortraitScale = new float?(1f); - this.Hide = false; - this.IsWet = false; - this.Frame = new int?(); - this.Direction = new int?(); - this.SpriteDirection = new int?(); - this.Velocity = 0.0f; - this.PortraitPositionXOverride = new float?(); - this.PortraitPositionYOverride = new float?(); - this.CustomTexturePath = (string) null; - } - } } } } diff --git a/ID/PaintID.cs b/ID/PaintID.cs deleted file mode 100644 index a1d17a2..0000000 --- a/ID/PaintID.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.ID.PaintID -// 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.ID -{ - public static class PaintID - { - public const byte GLOW_PAINT = 31; - } -} diff --git a/ID/PlayerDifficultyID.cs b/ID/PlayerDifficultyID.cs deleted file mode 100644 index d32f9ee..0000000 --- a/ID/PlayerDifficultyID.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.ID.PlayerDifficultyID -// 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.ID -{ - public class PlayerDifficultyID - { - public const byte SoftCore = 0; - public const byte MediumCore = 1; - public const byte Hardcore = 2; - public const byte Creative = 3; - } -} diff --git a/ID/PlayerTextureID.cs b/ID/PlayerTextureID.cs index daea5f6..3ae8a04 100644 --- a/ID/PlayerTextureID.cs +++ b/ID/PlayerTextureID.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.PlayerTextureID -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.ID @@ -23,7 +23,6 @@ namespace Terraria.ID public const int Shoes = 12; public const int ArmShirt = 13; public const int Extra = 14; - public const int EyeBlink = 15; - public const int Count = 16; + public const int Count = 15; } } diff --git a/ID/PlayerVariantID.cs b/ID/PlayerVariantID.cs index 5a70a5a..4ac0f44 100644 --- a/ID/PlayerVariantID.cs +++ b/ID/PlayerVariantID.cs @@ -1,14 +1,14 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.PlayerVariantID -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.ID { public static class PlayerVariantID { - public static SetFactory Factory = new SetFactory(12); + public static SetFactory Factory = new SetFactory(10); public const int MaleStarter = 0; public const int MaleSticker = 1; public const int MaleGangster = 2; @@ -19,31 +19,27 @@ namespace Terraria.ID public const int FemaleCoat = 7; public const int MaleDress = 8; public const int FemaleDress = 9; - public const int MaleDisplayDoll = 10; - public const int FemaleDisplayDoll = 11; - public const int Count = 12; + public const int Count = 10; public class Sets { - public static bool[] Male = PlayerVariantID.Factory.CreateBoolSet(0, 1, 2, 3, 8, 10); - public static int[] AltGenderReference = PlayerVariantID.Factory.CreateIntSet(0, 0, 4, 4, 0, 1, 5, 5, 1, 2, 6, 6, 2, 3, 7, 7, 3, 8, 9, 9, 8, 10, 11, 11, 10); - public static int[] VariantOrderMale = new int[6] + public static bool[] Male = PlayerVariantID.Factory.CreateBoolSet(0, 1, 2, 3, 8); + public static int[] AltGenderReference = PlayerVariantID.Factory.CreateIntSet(0, 0, 4, 4, 0, 1, 5, 5, 1, 2, 6, 6, 2, 3, 7, 7, 3, 8, 9, 9, 8); + public static int[] VariantOrderMale = new int[5] { 0, 1, 2, 3, - 8, - 10 + 8 }; - public static int[] VariantOrderFemale = new int[6] + public static int[] VariantOrderFemale = new int[5] { 4, 5, 6, 7, - 9, - 11 + 9 }; } } diff --git a/ID/PrefixID.cs b/ID/PrefixID.cs index 3d6674f..0d06b8a 100644 --- a/ID/PrefixID.cs +++ b/ID/PrefixID.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.PrefixID -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.ID @@ -91,7 +91,6 @@ namespace Terraria.ID public const int Legendary = 81; public const int Unreal = 82; public const int Mythical = 83; - public const int Legendary2 = 84; - public const int Count = 85; + public const int Count = 84; } } diff --git a/ID/ProjectileID.cs b/ID/ProjectileID.cs index 574a8fa..fd223e9 100644 --- a/ID/ProjectileID.cs +++ b/ID/ProjectileID.cs @@ -1,11 +1,9 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.ProjectileID -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe -using Terraria.WorldBuilding; - namespace Terraria.ID { public class ProjectileID @@ -724,285 +722,30 @@ namespace Terraria.ID public const short ApprenticeStaffT3Shot = 711; public const short BookStaffShot = 712; public const short DD2Win = 713; - public const short Celeb2Weapon = 714; - public const short Celeb2Rocket = 715; - public const short Celeb2RocketExplosive = 716; - public const short Celeb2RocketLarge = 717; - public const short Celeb2RocketExplosiveLarge = 718; - public const short QueenBeeStinger = 719; - public const short FallingStarSpawner = 720; - public const short DirtGolfBall = 721; - public const short GolfClubHelper = 722; - public const short ManaCloakStar = 723; - public const short BeeCloakStar = 724; - public const short StarVeilStar = 725; - public const short StarCloakStar = 726; - public const short RollingCactus = 727; - public const short SuperStar = 728; - public const short SuperStarSlash = 729; - public const short ThunderSpear = 730; - public const short ThunderStaffShot = 731; - public const short ThunderSpearShot = 732; - public const short ToiletEffect = 733; - public const short VoidLens = 734; - public const short Terragrim = 735; - public const short BlueDungeonDebris = 736; - public const short GreenDungeonDebris = 737; - public const short PinkDungeonDebris = 738; - public const short GolfBallDyedBlack = 739; - public const short GolfBallDyedBlue = 740; - public const short GolfBallDyedBrown = 741; - public const short GolfBallDyedCyan = 742; - public const short GolfBallDyedGreen = 743; - public const short GolfBallDyedLimeGreen = 744; - public const short GolfBallDyedOrange = 745; - public const short GolfBallDyedPink = 746; - public const short GolfBallDyedPurple = 747; - public const short GolfBallDyedRed = 748; - public const short GolfBallDyedSkyBlue = 749; - public const short GolfBallDyedTeal = 750; - public const short GolfBallDyedViolet = 751; - public const short GolfBallDyedYellow = 752; - public const short AmberHook = 753; - public const short MysticSnakeCoil = 754; - public const short BatOfLight = 755; - public const short SharpTears = 756; - public const short DripplerFlail = 757; - public const short VampireFrog = 758; - public const short BabyBird = 759; - public const short BobberBloody = 760; - public const short PaperAirplaneA = 761; - public const short PaperAirplaneB = 762; - public const short RollingCactusSpike = 763; - public const short UpbeatStar = 764; - public const short SugarGlider = 765; - public const short KiteBlue = 766; - public const short KiteBlueAndYellow = 767; - public const short KiteRed = 768; - public const short KiteRedAndYellow = 769; - public const short KiteYellow = 770; - public const short KiteWyvern = 771; - public const short Geode = 772; - public const short ScarabBomb = 773; - public const short SharkPup = 774; - public const short BobberScarab = 775; - public const short ClusterRocketI = 776; - public const short ClusterGrenadeI = 777; - public const short ClusterMineI = 778; - public const short ClusterFragmentsI = 779; - public const short ClusterRocketII = 780; - public const short ClusterGrenadeII = 781; - public const short ClusterMineII = 782; - public const short ClusterFragmentsII = 783; - public const short WetRocket = 784; - public const short WetGrenade = 785; - public const short WetMine = 786; - public const short LavaRocket = 787; - public const short LavaGrenade = 788; - public const short LavaMine = 789; - public const short HoneyRocket = 790; - public const short HoneyGrenade = 791; - public const short HoneyMine = 792; - public const short MiniNukeRocketI = 793; - public const short MiniNukeGrenadeI = 794; - public const short MiniNukeMineI = 795; - public const short MiniNukeRocketII = 796; - public const short MiniNukeGrenadeII = 797; - public const short MiniNukeMineII = 798; - public const short DryRocket = 799; - public const short DryGrenade = 800; - public const short DryMine = 801; - public const short GladiusStab = 802; - public const short ClusterSnowmanRocketI = 803; - public const short ClusterSnowmanRocketII = 804; - public const short WetSnowmanRocket = 805; - public const short LavaSnowmanRocket = 806; - public const short HoneySnowmanRocket = 807; - public const short MiniNukeSnowmanRocketI = 808; - public const short MiniNukeSnowmanRocketII = 809; - public const short DrySnowmanRocket = 810; - public const short BloodShot = 811; - public const short ShellPileFalling = 812; - public const short BloodNautilusTears = 813; - public const short BloodNautilusShot = 814; - public const short LilHarpy = 815; - public const short FennecFox = 816; - public const short GlitteryButterfly = 817; - public const short WhiteTigerPounce = 818; - public const short BloodArrow = 819; - public const short ChumBucket = 820; - public const short BabyImp = 821; - public const short KiteBoneSerpent = 822; - public const short KiteWorldFeeder = 823; - public const short KiteBunny = 824; - public const short BabyRedPanda = 825; - public const short KitePigron = 826; - public const short KiteManEater = 827; - public const short KiteJellyfishBlue = 828; - public const short KiteJellyfishPink = 829; - public const short KiteShark = 830; - public const short StormTigerGem = 831; - public const short StormTigerAttack = 832; - public const short StormTigerTier1 = 833; - public const short StormTigerTier2 = 834; - public const short StormTigerTier3 = 835; - public const short DandelionSeed = 836; - public const short BookOfSkullsSkull = 837; - public const short KiteSandShark = 838; - public const short KiteBunnyCorrupt = 839; - public const short KiteBunnyCrimson = 840; - public const short BlandWhip = 841; - public const short RulerStab = 842; - public const short KiteGoldfish = 843; - public const short KiteAngryTrapper = 844; - public const short KiteKoi = 845; - public const short KiteCrawltipede = 846; - public const short SwordWhip = 847; - public const short MaceWhip = 848; - public const short ScytheWhip = 849; - public const short KiteSpectrum = 850; - public const short ReleaseDoves = 851; - public const short KiteWanderingEye = 852; - public const short KiteUnicorn = 853; - public const short Plantero = 854; - public const short ReleaseLantern = 855; - public const short SparkleGuitar = 856; - public const short FirstFractal = 857; - public const short DynamiteKitten = 858; - public const short BabyWerewolf = 859; - public const short ShadowMimic = 860; - public const short Football = 861; - public const short ClusterSnowmanFragmentsI = 862; - public const short ClusterSnowmanFragmentsII = 863; - public const short Smolstar = 864; - public const short SquirrelHook = 865; - public const short BouncingShield = 866; - public const short Shroomerang = 867; - public const short TreeGlobe = 868; - public const short WorldGlobe = 869; - public const short FairyGlowstick = 870; - public const short HallowBossSplitShotCore = 871; - public const short HallowBossLastingRainbow = 872; - public const short HallowBossRainbowStreak = 873; - public const short HallowBossDeathAurora = 874; - public const short VoltBunny = 875; - public const short ZapinatorLaser = 876; - public const short JoustingLance = 877; - public const short ShadowJoustingLance = 878; - public const short HallowJoustingLance = 879; - public const short ZoologistStrikeGreen = 880; - public const short KingSlimePet = 881; - public const short EyeOfCthulhuPet = 882; - public const short EaterOfWorldsPet = 883; - public const short BrainOfCthulhuPet = 884; - public const short SkeletronPet = 885; - public const short QueenBeePet = 886; - public const short DestroyerPet = 887; - public const short TwinsPet = 888; - public const short SkeletronPrimePet = 889; - public const short PlanteraPet = 890; - public const short GolemPet = 891; - public const short DukeFishronPet = 892; - public const short LunaticCultistPet = 893; - public const short MoonLordPet = 894; - public const short FairyQueenPet = 895; - public const short PumpkingPet = 896; - public const short EverscreamPet = 897; - public const short IceQueenPet = 898; - public const short MartianPet = 899; - public const short DD2OgrePet = 900; - public const short DD2BetsyPet = 901; - public const short CombatWrench = 902; - public const short WetBomb = 903; - public const short LavaBomb = 904; - public const short HoneyBomb = 905; - public const short DryBomb = 906; - public const short OrnamentStar = 907; - public const short TitaniumStormShard = 908; - public const short RockGolemRock = 909; - public const short DirtBomb = 910; - public const short DirtStickyBomb = 911; - public const short CoolWhip = 912; - public const short FireWhip = 913; - public const short ThornWhip = 914; - public const short RainbowWhip = 915; - public const short ScytheWhipProj = 916; - public const short CoolWhipProj = 917; - public const short FireWhipProj = 918; - public const short FairyQueenLance = 919; - public const short QueenSlimeMinionBlueSpike = 920; - public const short QueenSlimeMinionPinkBall = 921; - public const short QueenSlimeSmash = 922; - public const short FairyQueenSunDance = 923; - public const short FairyQueenHymn = 924; - public const short StardustPunch = 925; - public const short QueenSlimeGelAttack = 926; - public const short PiercingStarlight = 927; - public const short DripplerFlailExtraBall = 928; - public const short ZoologistStrikeRed = 929; - public const short SantankMountRocket = 930; - public const short FairyQueenMagicItemShot = 931; - public const short FairyQueenRangedItemShot = 932; - public const short FinalFractal = 933; - public const short QueenSlimePet = 934; - public const short QueenSlimeHook = 935; - public const short GelBalloon = 936; - public const short VolatileGelatinBall = 937; - public const short CopperShortswordStab = 938; - public const short TinShortswordStab = 939; - public const short IronShortswordStab = 940; - public const short LeadShortswordStab = 941; - public const short SilverShortswordStab = 942; - public const short TungstenShortswordStab = 943; - public const short GoldShortswordStab = 944; - public const short PlatinumShortswordStab = 945; - public const short EmpressBlade = 946; - public const short Mace = 947; - public const short FlamingMace = 948; - public const short TorchGod = 949; - public const short Count = 950; + public const short Count = 714; public static class Sets { - public static SetFactory Factory = new SetFactory(950); - public static bool[] DontApplyParryDamageBuff = ProjectileID.Sets.Factory.CreateBoolSet(false, 524, 321, 181, 566); - public static bool[] IsAWhip = ProjectileID.Sets.Factory.CreateBoolSet(false, 847, 841, 848, 849, 912, 913, 914, 915); - public static bool[] ImmediatelyUpdatesNPCBuffFlags = ProjectileID.Sets.Factory.CreateBoolSet(636); - public static bool?[] WindPhysicsImmunity = ProjectileID.Sets.Factory.CreateCustomSet(new bool?(), (object) (short) 20, (object) true, (object) (short) 27, (object) true, (object) (short) 83, (object) true, (object) (short) 84, (object) true, (object) (short) 88, (object) true, (object) (short) 100, (object) true, (object) (short) 359, (object) true, (object) (short) 119, (object) true, (object) (short) 121, (object) true, (object) (short) 122, (object) true, (object) (short) 123, (object) true, (object) (short) 124, (object) true, (object) (short) 125, (object) true, (object) (short) 126, (object) true, (object) (short) 309, (object) true, (object) (short) 128, (object) true, (object) (short) 129, (object) true, (object) (short) 257, (object) true, (object) (short) 258, (object) true, (object) (short) 259, (object) true, (object) (short) 299, (object) true, (object) (short) 496, (object) true, (object) (short) 302, (object) true, (object) (short) 306, (object) true, (object) (short) 337, (object) true, (object) (short) 344, (object) true, (object) (short) 343, (object) true, (object) (short) 342, (object) true, (object) (short) 348, (object) true, (object) (short) 349, (object) true, (object) (short) 389, (object) true, (object) (short) 436, (object) true, (object) (short) 435, (object) true, (object) (short) 437, (object) true, (object) (short) 439, (object) true, (object) (short) 592, (object) true, (object) (short) 449, (object) true, (object) (short) 442, (object) true, (object) (short) 459, (object) true, (object) (short) 462, (object) true, (object) (short) 467, (object) true, (object) (short) 468, (object) true, (object) (short) 538, (object) true, (object) (short) 576, (object) true, (object) (short) 577, (object) true, (object) (short) 584, (object) true, (object) (short) 583, (object) true, (object) (short) 594, (object) true, (object) (short) 622, (object) true, (object) (short) 597, (object) true, (object) (short) 601, (object) true, (object) (short) 617, (object) true, (object) (short) 619, (object) true, (object) (short) 620, (object) true, (object) (short) 618, (object) true, (object) (short) 634, (object) true, (object) (short) 635, (object) true, (object) (short) 640, (object) true, (object) (short) 639, (object) true, (object) (short) 645, (object) true, (object) (short) 660, (object) true, (object) (short) 661, (object) true, (object) (short) 675, (object) true, (object) (short) 684, (object) true, (object) (short) 709, (object) true, (object) (short) 593, (object) true, (object) (short) 606, (object) true, (object) (short) 732, (object) true, (object) (short) 731, (object) true); - public static bool[] RocketsSkipDamageForPlayers = ProjectileID.Sets.Factory.CreateBoolSet(338, 339, 340, 341, 803, 804, 862, 863, 805, 806, 807, 808, 809, 810, 930); + public static SetFactory Factory = new SetFactory(714); public static float[] YoyosLifeTimeMultiplier = ProjectileID.Sets.Factory.CreateFloatSet(-1f, 541f, 3f, 548f, 5f, 542f, 7f, 543f, 6f, 544f, 8f, 534f, 9f, 564f, 11f, 545f, 13f, 563f, 10f, 562f, 8f, 553f, 12f, 546f, 16f, 552f, 15f, 549f, 14f); public static float[] YoyosMaximumRange = ProjectileID.Sets.Factory.CreateFloatSet(200f, 541f, 130f, 548f, 170f, 542f, 195f, 543f, 207f, 544f, 215f, 534f, 220f, 564f, 225f, 545f, 235f, 562f, 235f, 563f, 250f, 546f, 275f, 552f, 270f, 553f, 275f, 547f, 280f, 549f, 290f, 554f, 340f, 550f, 370f, 551f, 370f, 555f, 360f, 603f, 400f); - public static bool[] IsAGolfBall = ProjectileID.Sets.Factory.CreateBoolSet(false, 721, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752); public static float[] YoyosTopSpeed = ProjectileID.Sets.Factory.CreateFloatSet(10f, 541f, 9f, 548f, 11f, 542f, 12.5f, 543f, 12f, 544f, 13f, 534f, 13f, 564f, 14f, 545f, 14f, 562f, 15f, 563f, 12f, 546f, 17f, 552f, 14f, 553f, 15f, 547f, 17f, 549f, 16f, 554f, 16f, 550f, 16f, 551f, 16f, 555f, 16.5f, 603f, 17.5f); public static bool[] CanDistortWater = ProjectileID.Sets.Factory.CreateBoolSet(true, 7, 8, 152, 151, 150, 493, 494); - public static bool[] MinionShot = ProjectileID.Sets.Factory.CreateBoolSet(374, 376, 389, 195, 408, 433, 614); + public static bool[] MinionShot = ProjectileID.Sets.Factory.CreateBoolSet(374, 376, 389, 195, 385, 433, 614); public static bool[] SentryShot = ProjectileID.Sets.Factory.CreateBoolSet(680, 664, 666, 668, 694, 695, 696, 644, 642, 378, 379, 309); - public static bool?[] ForcePlateDetection = ProjectileID.Sets.Factory.CreateCustomSet(new bool?(), (object) (short) 397, (object) true, (object) (short) 37, (object) true, (object) (short) 470, (object) true, (object) (short) 53, (object) true, (object) (short) 911, (object) true, (object) (short) 773, (object) true, (object) (short) 519, (object) true, (object) (short) 171, (object) true, (object) (short) 505, (object) true, (object) (short) 475, (object) true, (object) (short) 506, (object) true, (object) (short) 186, (object) true, (object) (short) 80, (object) true, (object) (short) 40, (object) true, (object) (short) 241, (object) true, (object) (short) 411, (object) true, (object) (short) 56, (object) true, (object) (short) 413, (object) true, (object) (short) 67, (object) true, (object) (short) 414, (object) true, (object) (short) 31, (object) true, (object) (short) 412, (object) true, (object) (short) 812, (object) true, (object) (short) 17, (object) true, (object) (short) 166, (object) true, (object) (short) 109, (object) true, (object) (short) 354, (object) true, (object) (short) 65, (object) true, (object) (short) 68, (object) true, (object) (short) 42, (object) true, (object) (short) 99, (object) false, (object) (short) 727, (object) false, (object) (short) 655, (object) false); - public static int[] TrailingMode = ProjectileID.Sets.Factory.CreateIntSet(-1, 94, 0, 301, 0, 388, 0, 385, 0, 408, 0, 409, 0, 435, 0, 436, 0, 437, 0, 438, 0, 452, 0, 459, 0, 462, 0, 502, 0, 503, 0, 466, 1, 532, 0, 533, 0, 573, 0, 580, 1, 582, 0, 585, 0, 592, 0, 601, 0, 617, 0, 636, 0, 638, 0, 639, 0, 640, 0, 424, 0, 425, 0, 426, 0, 660, 0, 661, 0, 671, 2, 664, 0, 666, 0, 668, 0, 675, 0, 680, 2, 682, 0, 684, 0, 686, 2, 700, 0, 706, 0, 709, 0, 710, 2, 711, 2, 712, 0, 715, 2, 716, 2, 717, 2, 718, 2, 261, 0, 721, 0, 729, 2, 732, 0, 731, 0, 739, 0, 740, 0, 741, 0, 742, 0, 743, 0, 744, 0, 745, 0, 746, 0, 747, 0, 748, 0, 749, 0, 750, 0, 751, 0, 752, 0, 755, 2, 766, 2, 767, 2, 768, 2, 769, 2, 770, 2, 771, 2, 811, 2, 814, 2, 822, 2, 823, 2, 824, 2, 826, 2, 827, 2, 828, 2, 829, 2, 830, 2, 838, 2, 839, 2, 840, 2, 843, 2, 844, 2, 845, 2, 846, 2, 850, 2, 852, 2, 853, 2, 856, 0, 857, 0, 864, 2, 873, 2, 872, 2, 833, 2, 834, 2, 835, 2, 818, 2, 902, 0, 883, 0, 887, 0, 893, 0, 894, 0, 909, 0, 916, 2, 34, 3, 16, 3, 79, 3, 931, 2, 933, 4, 946, 2); - public static int[] TrailCacheLength = ProjectileID.Sets.Factory.CreateIntSet(10, 466, 20, 502, 25, 580, 20, 636, 20, 640, 20, 686, 20, 711, 20, 715, 20, 716, 20, 717, 20, 718, 20, 261, 20, 721, 20, 729, 20, 731, 20, 739, 20, 740, 20, 741, 20, 742, 20, 743, 20, 744, 20, 745, 20, 746, 20, 747, 20, 748, 20, 749, 20, 750, 20, 751, 20, 752, 20, 766, 60, 767, 60, 768, 60, 769, 60, 770, 60, 771, 80, 814, 40, 822, 80, 823, 80, 824, 60, 826, 60, 827, 65, 828, 60, 829, 60, 830, 80, 838, 80, 839, 60, 840, 60, 843, 60, 844, 65, 845, 80, 846, 80, 850, 80, 852, 60, 853, 60, 856, 2, 857, 2, 864, 60, 873, 60, 872, 120, 833, 20, 834, 20, 835, 20, 818, 20, 883, 41, 887, 51, 893, 71, 894, 10, 909, 10, 916, 20, 34, 30, 16, 30, 79, 60, 931, 20, 933, 60, 946, 20); - public static bool[] LightPet = ProjectileID.Sets.Factory.CreateBoolSet(18, 500, 72, 87, 86, 211, 492, 650, 702, 891, 896, 895); - public static bool[] CountsAsHoming = ProjectileID.Sets.Factory.CreateBoolSet(207, 182, 247, 338, 339, 340, 341, 191, 192, 193, 194, 266, 390, 391, 392, 307, 316, 190, 227, 226, 254, (int) byte.MaxValue, 297, 308, 317, 321, 407, 423, 375, 373, 376, 374, 379, 387, 408, 389, 388, 405, 409, 451, 535, 536, 483, 484, 477); + public static bool?[] ForcePlateDetection = ProjectileID.Sets.Factory.CreateCustomSet(new bool?(), (object) (short) 397, (object) true, (object) (short) 37, (object) true, (object) (short) 470, (object) true, (object) (short) 53, (object) true, (object) (short) 519, (object) true, (object) (short) 171, (object) true, (object) (short) 505, (object) true, (object) (short) 475, (object) true, (object) (short) 506, (object) true, (object) (short) 186, (object) true, (object) (short) 80, (object) true, (object) (short) 40, (object) true, (object) (short) 241, (object) true, (object) (short) 411, (object) true, (object) (short) 56, (object) true, (object) (short) 413, (object) true, (object) (short) 67, (object) true, (object) (short) 414, (object) true, (object) (short) 31, (object) true, (object) (short) 412, (object) true, (object) (short) 17, (object) true, (object) (short) 166, (object) true, (object) (short) 109, (object) true, (object) (short) 354, (object) true, (object) (short) 65, (object) true, (object) (short) 68, (object) true, (object) (short) 42, (object) true, (object) (short) 99, (object) false, (object) (short) 655, (object) false); + public static int[] TrailingMode = ProjectileID.Sets.Factory.CreateIntSet(-1, 94, 0, 301, 0, 388, 0, 385, 0, 408, 0, 409, 0, 435, 0, 436, 0, 437, 0, 438, 0, 452, 0, 459, 0, 462, 0, 502, 0, 503, 0, 466, 1, 532, 0, 533, 0, 573, 0, 580, 1, 582, 0, 585, 0, 592, 0, 601, 0, 617, 0, 636, 0, 638, 0, 639, 0, 640, 0, 424, 0, 425, 0, 426, 0, 660, 0, 661, 0, 671, 2, 664, 0, 666, 0, 668, 0, 675, 0, 680, 2, 682, 0, 684, 0, 686, 2, 700, 0, 706, 0, 709, 0, 710, 2, 711, 2, 712, 0); + public static int[] TrailCacheLength = ProjectileID.Sets.Factory.CreateIntSet(10, 466, 20, 502, 25, 580, 20, 636, 20, 640, 20, 686, 20, 711, 20); + public static bool[] LightPet = ProjectileID.Sets.Factory.CreateBoolSet(18, 500, 72, 87, 86, 211, 492, 650, 702); + public static bool[] Homing = ProjectileID.Sets.Factory.CreateBoolSet(207, 182, 247, 338, 339, 340, 341, 191, 192, 193, 194, 266, 390, 391, 392, 307, 316, 190, 227, 226, 254, (int) byte.MaxValue, 297, 308, 317, 321, 407, 423, 375, 373, 376, 374, 379, 387, 408, 389, 388, 405, 409, 451, 535, 536, 483, 484, 477); public static bool[] IsADD2Turret = ProjectileID.Sets.Factory.CreateBoolSet(663, 665, 667, 677, 678, 679, 688, 689, 690, 691, 692, 693); public static bool[] TurretFeature = ProjectileID.Sets.Factory.CreateBoolSet(); - public static bool[] MinionTargettingFeature = ProjectileID.Sets.Factory.CreateBoolSet(191, 192, 193, 194, 266, 317, 373, 375, 387, 388, 390, 393, 407, 423, 533, 613, 625, 755, 758, 759, 831, 833, 834, 835, 864, 946, 377, 308, 643, 641, 663, 665, 667, 677, 678, 679, 688, 689, 690, 691, 692, 693); - public static bool[] MinionSacrificable = ProjectileID.Sets.Factory.CreateBoolSet(191, 192, 193, 194, 266, 317, 373, 375, 387, 388, 390, 393, 407, 423, 533, 613, 755, 758, 759, 831, 864, 946, 625, 626, 627, 628); - public static bool[] DontAttachHideToAlpha = ProjectileID.Sets.Factory.CreateBoolSet(598, 641, 617, 636, 579, 578, 625, 626, 627, 628, 759, 813, 525); - public static GenSearch[] ExtendedCanHitCheckSearch = ProjectileID.Sets.Factory.CreateCustomSet((GenSearch) null, (object) (short) 833, (object) new Searches.Up(3), (object) (short) 834, (object) new Searches.Up(3), (object) (short) 835, (object) new Searches.Up(3)); - public static float[] ExtendedCanHitCheckRange = ProjectileID.Sets.Factory.CreateFloatSet(0.0f, 833f, 48f, 834f, 48f, 835f, 48f); + public static bool[] MinionTargettingFeature = ProjectileID.Sets.Factory.CreateBoolSet(191, 192, 193, 194, 266, 317, 373, 375, 387, 388, 390, 393, 407, 423, 533, 613, 625, 377, 308, 643, 641, 663, 665, 667, 677, 678, 679, 688, 689, 690, 691, 692, 693); + public static bool[] MinionSacrificable = ProjectileID.Sets.Factory.CreateBoolSet(191, 192, 193, 194, 266, 317, 373, 375, 387, 388, 390, 393, 407, 423, 533, 613, 625, 626, 627, 628); + public static bool[] DontAttachHideToAlpha = ProjectileID.Sets.Factory.CreateBoolSet(598, 641, 617, 636, 579, 578, 625, 626, 627, 628); public static bool[] NeedsUUID = ProjectileID.Sets.Factory.CreateBoolSet(625, 626, 627, 628); public static bool[] StardustDragon = ProjectileID.Sets.Factory.CreateBoolSet(625, 626, 627, 628); - public static bool[] StormTiger = ProjectileID.Sets.Factory.CreateBoolSet(833, 834, 835); - public static int[] StormTigerIds = new int[3] - { - 833, - 834, - 835 - }; - public static bool[] IsARocketThatDealsDoubleDamageToPrimaryEnemy = ProjectileID.Sets.Factory.CreateBoolSet(134, 137, 140, 143, 776, 780, 793, 796, 799, 784, 787, 790, 246); - public static bool[] IsAMineThatDealsTripleDamageWhenStationary = ProjectileID.Sets.Factory.CreateBoolSet(135, 138, 141, 144, 778, 782, 795, 798, 801, 786, 789, 792); public static bool[] NoLiquidDistortion = ProjectileID.Sets.Factory.CreateBoolSet(511, 512, 513); - public static bool[] DismountsPlayersOnHit = ProjectileID.Sets.Factory.CreateBoolSet(877, 878, 879); - public static int[] DrawScreenCheckFluff = ProjectileID.Sets.Factory.CreateIntSet(480, 461, 1600, 632, 1600, 447, 1600, 455, 2400, 754, 800, 872, 1600, 873, 1600, 871, 1600, 919, 2400, 923, 2400, 931, 960, 16, 960, 34, 960, 79, 960, 933, 480); } } } diff --git a/ID/RecipeGroupID.cs b/ID/RecipeGroupID.cs index a2e4148..77f1b5d 100644 --- a/ID/RecipeGroupID.cs +++ b/ID/RecipeGroupID.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.RecipeGroupID -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.ID @@ -16,10 +16,5 @@ namespace Terraria.ID public static int Butterflies = 5; public static int Fireflies = 6; public static int Snails = 7; - public static int FishForDinner = 8; - public static int GoldenCritter = 9; - public static int Dragonflies = 10; - public static int Turtles = 11; - public static int Fruit = 12; } } diff --git a/ID/SetFactory.cs b/ID/SetFactory.cs index cb6b2e7..6457273 100644 --- a/ID/SetFactory.cs +++ b/ID/SetFactory.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.SetFactory -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; @@ -12,10 +12,10 @@ namespace Terraria.ID public class SetFactory { protected int _size; - private readonly Queue _intBufferCache = new Queue(); - private readonly Queue _ushortBufferCache = new Queue(); - private readonly Queue _boolBufferCache = new Queue(); - private readonly Queue _floatBufferCache = new Queue(); + private Queue _intBufferCache = new Queue(); + private Queue _ushortBufferCache = new Queue(); + private Queue _boolBufferCache = new Queue(); + private Queue _floatBufferCache = new Queue(); private object _queueLock = new object(); public SetFactory(int size) => this._size = size; @@ -119,15 +119,7 @@ namespace Terraria.ID if (inputs != null) { for (int index = 0; index < inputs.Length; index += 2) - { - T obj = !typeof (T).IsPrimitive ? (!typeof (T).IsGenericType || !(typeof (T).GetGenericTypeDefinition() == typeof (Nullable<>)) ? (!typeof (T).IsClass ? (T) Convert.ChangeType(inputs[index + 1], typeof (T)) : (T) inputs[index + 1]) : (T) inputs[index + 1]) : (T) inputs[index + 1]; - if (inputs[index] is ushort) - objArray[(int) (ushort) inputs[index]] = obj; - else if (inputs[index] is int) - objArray[(int) inputs[index]] = obj; - else - objArray[(int) (short) inputs[index]] = obj; - } + objArray[(int) (short) inputs[index]] = (T) inputs[index + 1]; } return objArray; } diff --git a/ID/SoundID.cs b/ID/SoundID.cs index b46daba..281734e 100644 --- a/ID/SoundID.cs +++ b/ID/SoundID.cs @@ -1,18 +1,15 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.SoundID -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // 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 System.Reflection; using Terraria.Audio; namespace Terraria.ID { - public class SoundID + public static class SoundID { private static readonly SoundID.SoundStyleDefaults ItemDefaults = new SoundID.SoundStyleDefaults(1f, 0.06f); public const int Dig = 0; @@ -58,29 +55,6 @@ namespace Terraria.ID public const int Camera = 40; public const int MoonLord = 41; public const int Trackable = 42; - public const int Thunder = 43; - public const int Seagull = 44; - public const int Dolphin = 45; - public const int Owl = 46; - public const int GuitarC = 47; - public const int GuitarD = 48; - public const int GuitarEm = 49; - public const int GuitarG = 50; - public const int GuitarAm = 51; - public const int GuitarF = 52; - public const int DrumHiHat = 53; - public const int DrumTomHigh = 54; - public const int DrumTomLow = 55; - public const int DrumTomMid = 56; - public const int DrumClosedHiHat = 57; - public const int DrumCymbal1 = 58; - public const int DrumCymbal2 = 59; - public const int DrumKick = 60; - public const int DrumTamaSnare = 61; - public const int DrumFloorTom = 62; - public const int Research = 63; - public const int ResearchComplete = 64; - public const int QueenSlime = 65; public static readonly LegacySoundStyle NPCHit1 = new LegacySoundStyle(3, 1); public static readonly LegacySoundStyle NPCHit2 = new LegacySoundStyle(3, 2); public static readonly LegacySoundStyle NPCHit3 = new LegacySoundStyle(3, 3); @@ -200,10 +174,6 @@ namespace Terraria.ID public static readonly LegacySoundStyle NPCDeath60 = new LegacySoundStyle(4, 60); public static readonly LegacySoundStyle NPCDeath61 = new LegacySoundStyle(4, 61); public static readonly LegacySoundStyle NPCDeath62 = new LegacySoundStyle(4, 62); - public static readonly LegacySoundStyle NPCDeath63 = new LegacySoundStyle(4, 63); - public static readonly LegacySoundStyle NPCDeath64 = new LegacySoundStyle(4, 64); - public static readonly LegacySoundStyle NPCDeath65 = new LegacySoundStyle(4, 65); - public static short NPCDeathCount = 66; public static readonly LegacySoundStyle Item1 = new LegacySoundStyle(2, 1); public static readonly LegacySoundStyle Item2 = new LegacySoundStyle(2, 2); public static readonly LegacySoundStyle Item3 = new LegacySoundStyle(2, 3); @@ -329,56 +299,7 @@ namespace Terraria.ID public static readonly LegacySoundStyle Item123 = new LegacySoundStyle(2, 123); public static readonly LegacySoundStyle Item124 = new LegacySoundStyle(2, 124); public static readonly LegacySoundStyle Item125 = new LegacySoundStyle(2, 125); - public static readonly LegacySoundStyle Item126 = new LegacySoundStyle(2, 126); - public static readonly LegacySoundStyle Item127 = new LegacySoundStyle(2, (int) sbyte.MaxValue); - public static readonly LegacySoundStyle Item128 = new LegacySoundStyle(2, 128); - public static readonly LegacySoundStyle Item129 = new LegacySoundStyle(2, 129); - public static readonly LegacySoundStyle Item130 = new LegacySoundStyle(2, 130); - public static readonly LegacySoundStyle Item131 = new LegacySoundStyle(2, 131); - public static readonly LegacySoundStyle Item132 = new LegacySoundStyle(2, 132); - public static readonly LegacySoundStyle Item133 = new LegacySoundStyle(2, 133); - public static readonly LegacySoundStyle Item134 = new LegacySoundStyle(2, 134); - public static readonly LegacySoundStyle Item135 = new LegacySoundStyle(2, 135); - public static readonly LegacySoundStyle Item136 = new LegacySoundStyle(2, 136); - public static readonly LegacySoundStyle Item137 = new LegacySoundStyle(2, 137); - public static readonly LegacySoundStyle Item138 = new LegacySoundStyle(2, 138); - public static readonly LegacySoundStyle Item139 = new LegacySoundStyle(2, 139); - public static readonly LegacySoundStyle Item140 = new LegacySoundStyle(2, 140); - public static readonly LegacySoundStyle Item141 = new LegacySoundStyle(2, 141); - public static readonly LegacySoundStyle Item142 = new LegacySoundStyle(2, 142); - public static readonly LegacySoundStyle Item143 = new LegacySoundStyle(2, 143); - public static readonly LegacySoundStyle Item144 = new LegacySoundStyle(2, 144); - public static readonly LegacySoundStyle Item145 = new LegacySoundStyle(2, 145); - public static readonly LegacySoundStyle Item146 = new LegacySoundStyle(2, 146); - public static readonly LegacySoundStyle Item147 = new LegacySoundStyle(2, 147); - public static readonly LegacySoundStyle Item148 = new LegacySoundStyle(2, 148); - public static readonly LegacySoundStyle Item149 = new LegacySoundStyle(2, 149); - public static readonly LegacySoundStyle Item150 = new LegacySoundStyle(2, 150); - public static readonly LegacySoundStyle Item151 = new LegacySoundStyle(2, 151); - public static readonly LegacySoundStyle Item152 = new LegacySoundStyle(2, 152); - public static readonly LegacySoundStyle Item153 = new LegacySoundStyle(2, 153); - public static readonly LegacySoundStyle Item154 = new LegacySoundStyle(2, 154); - public static readonly LegacySoundStyle Item155 = new LegacySoundStyle(2, 155); - public static readonly LegacySoundStyle Item156 = new LegacySoundStyle(2, 156); - public static readonly LegacySoundStyle Item157 = new LegacySoundStyle(2, 157); - public static readonly LegacySoundStyle Item158 = new LegacySoundStyle(2, 158); - public static readonly LegacySoundStyle Item159 = new LegacySoundStyle(2, 159); - public static readonly LegacySoundStyle Item160 = new LegacySoundStyle(2, 160); - public static readonly LegacySoundStyle Item161 = new LegacySoundStyle(2, 161); - public static readonly LegacySoundStyle Item162 = new LegacySoundStyle(2, 162); - public static readonly LegacySoundStyle Item163 = new LegacySoundStyle(2, 163); - public static readonly LegacySoundStyle Item164 = new LegacySoundStyle(2, 164); - public static readonly LegacySoundStyle Item165 = new LegacySoundStyle(2, 165); - public static readonly LegacySoundStyle Item166 = new LegacySoundStyle(2, 166); - public static readonly LegacySoundStyle Item167 = new LegacySoundStyle(2, 167); - public static readonly LegacySoundStyle Item168 = new LegacySoundStyle(2, 168); - public static readonly LegacySoundStyle Item169 = new LegacySoundStyle(2, 169); - public static readonly LegacySoundStyle Item170 = new LegacySoundStyle(2, 170); - public static readonly LegacySoundStyle Item171 = new LegacySoundStyle(2, 171); - public static readonly LegacySoundStyle Item172 = new LegacySoundStyle(2, 172); - public static short ItemSoundCount = 173; public static readonly LegacySoundStyle DD2_GoblinBomb = new LegacySoundStyle(2, 14).WithVolume(0.5f); - public static readonly LegacySoundStyle AchievementComplete = SoundID.CreateTrackable("achievement_complete"); public static readonly LegacySoundStyle BlizzardInsideBuildingLoop = SoundID.CreateTrackable("blizzard_inside_building_loop", SoundType.Ambient); public static readonly LegacySoundStyle BlizzardStrongLoop = SoundID.CreateTrackable("blizzard_strong_loop", SoundType.Ambient).WithVolume(0.5f); public static readonly LegacySoundStyle LiquidsHoneyWater = SoundID.CreateTrackable("liquids_honey_water", 3, SoundType.Ambient); @@ -470,9 +391,6 @@ namespace Terraria.ID public static readonly LegacySoundStyle DD2_SkyDragonsFuryShot = SoundID.CreateTrackable("dd2_sky_dragons_fury_shot", 3); public static readonly LegacySoundStyle DD2_SkyDragonsFurySwing = SoundID.CreateTrackable("dd2_sky_dragons_fury_swing", 4); private static List _trackableLegacySoundPathList; - public static Dictionary SoundByName = (Dictionary) null; - public static Dictionary IndexByName = (Dictionary) null; - public static Dictionary SoundByIndex = (Dictionary) null; public static int TrackableLegacySoundCount => SoundID._trackableLegacySoundPathList.Count; @@ -515,26 +433,6 @@ namespace Terraria.ID return new LegacySoundStyle(42, count, variations, type); } - public static void FillAccessMap() - { - Dictionary ret = new Dictionary(); - Dictionary ret2 = new Dictionary(); - Dictionary ret3 = new Dictionary(); - ushort nextIndex = 0; - List list = ((IEnumerable) typeof (SoundID).GetFields(BindingFlags.Static | BindingFlags.Public)).Where((Func) (f => f.FieldType == typeof (LegacySoundStyle))).ToList(); - list.Sort((Comparison) ((a, b) => string.Compare(a.Name, b.Name))); - list.ForEach((Action) (field => - { - ret[field.Name] = (LegacySoundStyle) field.GetValue((object) null); - ret2[field.Name] = nextIndex; - ret3[nextIndex] = (LegacySoundStyle) field.GetValue((object) null); - ++nextIndex; - })); - SoundID.SoundByName = ret; - SoundID.IndexByName = ret2; - SoundID.SoundByIndex = ret3; - } - private struct SoundStyleDefaults { public readonly float PitchVariance; diff --git a/ID/StatusID.cs b/ID/StatusID.cs index 4e00fb5..28fb2cd 100644 --- a/ID/StatusID.cs +++ b/ID/StatusID.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.StatusID -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.ID diff --git a/ID/SurfaceBackgroundID.cs b/ID/SurfaceBackgroundID.cs deleted file mode 100644 index 776c955..0000000 --- a/ID/SurfaceBackgroundID.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.ID.SurfaceBackgroundID -// 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.ID -{ - public static class SurfaceBackgroundID - { - public const int Forest1 = 0; - public const int Corruption = 1; - public const int Desert = 2; - public const int Jungle = 3; - public const int Ocean = 4; - public const int GoodEvilDesert = 5; - public const int Hallow = 6; - public const int Snow = 7; - public const int Crimson = 8; - public const int Mushroom = 9; - public const int Forest2 = 10; - public const int Forest3 = 11; - public const int Forest4 = 12; - public const int Empty = 13; - } -} diff --git a/ID/TeleportationSide.cs b/ID/TeleportationSide.cs deleted file mode 100644 index b02b6ea..0000000 --- a/ID/TeleportationSide.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.ID.TeleportationSide -// 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.ID -{ - public enum TeleportationSide - { - Entry, - Exit, - } -} diff --git a/ID/TeleportationStyleID.cs b/ID/TeleportationStyleID.cs deleted file mode 100644 index 16bc05f..0000000 --- a/ID/TeleportationStyleID.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.ID.TeleportationStyleID -// 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.ID -{ - public static class TeleportationStyleID - { - public const int TeleporterTile = 0; - public const int RodOfDiscord = 1; - public const int TeleportationPotion = 2; - public const int RecallPotion = 3; - public const int Portal = 4; - public const int MagicConch = 5; - public const int DebugTeleport = 6; - public const int DemonConch = 7; - public const int PotionOfReturn = 8; - public const int TeleportationPylon = 9; - public const int QueenSlimeHook = 10; - } -} diff --git a/ID/TileChangeType.cs b/ID/TileChangeType.cs index 987d5f4..d0a86a7 100644 --- a/ID/TileChangeType.cs +++ b/ID/TileChangeType.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.TileChangeType -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.ID diff --git a/ID/TileEntityID.cs b/ID/TileEntityID.cs index 0d2d185..bdeb557 100644 --- a/ID/TileEntityID.cs +++ b/ID/TileEntityID.cs @@ -1,12 +1,15 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.TileEntityID -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.ID { public class TileEntityID { + public const byte TrainingDummy = 0; + public const byte ItemFrame = 1; + public const byte LogicSensor = 2; } } diff --git a/ID/TileID.cs b/ID/TileID.cs index 6868993..6852ff6 100644 --- a/ID/TileID.cs +++ b/ID/TileID.cs @@ -1,16 +1,13 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.TileID -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe -using ReLogic.Reflection; - namespace Terraria.ID { public class TileID { - public static readonly IdDictionary Search = IdDictionary.Create(); public const ushort Dirt = 0; public const ushort Stone = 1; public const ushort Grass = 2; @@ -210,9 +207,9 @@ namespace Terraria.ID public const ushort RainCloud = 196; public const ushort FrozenSlimeBlock = 197; public const ushort Asphalt = 198; - public const ushort CrimsonGrass = 199; + public const ushort FleshGrass = 199; public const ushort FleshIce = 200; - public const ushort CrimsonPlants = 201; + public const ushort FleshWeeds = 201; public const ushort Sunplate = 202; public const ushort Crimstone = 203; public const ushort Crimtane = 204; @@ -363,7 +360,7 @@ namespace Terraria.ID public const ushort MushroomStatue = 349; public const ushort MartianConduitPlating = 350; public const ushort ChimneySmoke = 351; - public const ushort CrimsonThorns = 352; + public const ushort CrimtaneThorns = 352; public const ushort VineRope = 353; public const ushort BewitchingTable = 354; public const ushort AlchemyTable = 355; @@ -481,209 +478,19 @@ namespace Terraria.ID public const ushort Containers2 = 467; public const ushort FakeContainers2 = 468; public const ushort Tables2 = 469; - public const ushort DisplayDoll = 470; - public const ushort WeaponsRack2 = 471; - public const ushort IronBrick = 472; - public const ushort LeadBrick = 473; - public const ushort LesionBlock = 474; - public const ushort HatRack = 475; - public const ushort GolfHole = 476; - public const ushort GolfGrass = 477; - public const ushort CrimstoneBrick = 478; - public const ushort SmoothSandstone = 479; - public const ushort BloodMoonMonolith = 480; - public const ushort CrackedBlueDungeonBrick = 481; - public const ushort CrackedGreenDungeonBrick = 482; - public const ushort CrackedPinkDungeonBrick = 483; - public const ushort RollingCactus = 484; - public const ushort AntlionLarva = 485; - public const ushort DrumSet = 486; - public const ushort PicnicTable = 487; - public const ushort FallenLog = 488; - public const ushort PinWheel = 489; - public const ushort WeatherVane = 490; - public const ushort VoidVault = 491; - public const ushort GolfGrassHallowed = 492; - public const ushort GolfCupFlag = 493; - public const ushort GolfTee = 494; - public const ushort ShellPile = 495; - public const ushort AntiPortalBlock = 496; - public const ushort Toilets = 497; - public const ushort Spider = 498; - public const ushort LesionStation = 499; - public const ushort SolarBrick = 500; - public const ushort VortexBrick = 501; - public const ushort NebulaBrick = 502; - public const ushort StardustBrick = 503; - public const ushort MysticSnakeRope = 504; - public const ushort GoldGoldfishBowl = 505; - public const ushort CatBast = 506; - public const ushort GoldStarryGlassBlock = 507; - public const ushort BlueStarryGlassBlock = 508; - public const ushort VoidMonolith = 509; - public const ushort ArrowSign = 510; - public const ushort PaintedArrowSign = 511; - public const ushort GreenMossBrick = 512; - public const ushort BrownMossBrick = 513; - public const ushort RedMossBrick = 514; - public const ushort BlueMossBrick = 515; - public const ushort PurpleMossBrick = 516; - public const ushort LavaMossBrick = 517; - public const ushort LilyPad = 518; - public const ushort Cattail = 519; - public const ushort FoodPlatter = 520; - public const ushort BlackDragonflyJar = 521; - public const ushort BlueDragonflyJar = 522; - public const ushort GreenDragonflyJar = 523; - public const ushort OrangeDragonflyJar = 524; - public const ushort RedDragonflyJar = 525; - public const ushort YellowDragonflyJar = 526; - public const ushort GoldDragonflyJar = 527; - public const ushort MushroomVines = 528; - public const ushort SeaOats = 529; - public const ushort OasisPlants = 530; - public const ushort BoulderStatue = 531; - public const ushort MaggotCage = 532; - public const ushort RatCage = 533; - public const ushort KryptonMoss = 534; - public const ushort KryptonMossBrick = 535; - public const ushort XenonMoss = 536; - public const ushort XenonMossBrick = 537; - public const ushort LadybugCage = 538; - public const ushort ArgonMoss = 539; - public const ushort ArgonMossBrick = 540; - public const ushort EchoBlock = 541; - public const ushort OwlCage = 542; - public const ushort PupfishBowl = 543; - public const ushort GoldLadybugCage = 544; - public const ushort LawnFlamingo = 545; - public const ushort Grate = 546; - public const ushort PottedPlants1 = 547; - public const ushort PottedPlants2 = 548; - public const ushort Seaweed = 549; - public const ushort TurtleCage = 550; - public const ushort TurtleJungleCage = 551; - public const ushort Sandcastles = 552; - public const ushort GrebeCage = 553; - public const ushort SeagullCage = 554; - public const ushort WaterStriderCage = 555; - public const ushort GoldWaterStriderCage = 556; - public const ushort GrateClosed = 557; - public const ushort SeahorseCage = 558; - public const ushort GoldSeahorseCage = 559; - public const ushort GolfTrophies = 560; - public const ushort MarbleColumn = 561; - public const ushort BambooBlock = 562; - public const ushort LargeBambooBlock = 563; - public const ushort PlasmaLamp = 564; - public const ushort FogMachine = 565; - public const ushort AmberStoneBlock = 566; - public const ushort GardenGnome = 567; - public const ushort PinkFairyJar = 568; - public const ushort GreenFairyJar = 569; - public const ushort BlueFairyJar = 570; - public const ushort Bamboo = 571; - public const ushort SoulBottles = 572; - public const ushort TatteredWoodSign = 573; - public const ushort BorealBeam = 574; - public const ushort RichMahoganyBeam = 575; - public const ushort GraniteColumn = 576; - public const ushort SandstoneColumn = 577; - public const ushort MushroomBeam = 578; - public const ushort RockGolemHead = 579; - public const ushort HellButterflyJar = 580; - public const ushort LavaflyinaBottle = 581; - public const ushort MagmaSnailCage = 582; - public const ushort TreeTopaz = 583; - public const ushort TreeAmethyst = 584; - public const ushort TreeSapphire = 585; - public const ushort TreeEmerald = 586; - public const ushort TreeRuby = 587; - public const ushort TreeDiamond = 588; - public const ushort TreeAmber = 589; - public const ushort GemSaplings = 590; - public const ushort PotsSuspended = 591; - public const ushort BrazierSuspended = 592; - public const ushort VolcanoSmall = 593; - public const ushort VolcanoLarge = 594; - public const ushort VanityTreeSakuraSaplings = 595; - public const ushort VanityTreeSakura = 596; - public const ushort TeleportationPylon = 597; - public const ushort LavafishBowl = 598; - public const ushort AmethystBunnyCage = 599; - public const ushort TopazBunnyCage = 600; - public const ushort SapphireBunnyCage = 601; - public const ushort EmeraldBunnyCage = 602; - public const ushort RubyBunnyCage = 603; - public const ushort DiamondBunnyCage = 604; - public const ushort AmberBunnyCage = 605; - public const ushort AmethystSquirrelCage = 606; - public const ushort TopazSquirrelCage = 607; - public const ushort SapphireSquirrelCage = 608; - public const ushort EmeraldSquirrelCage = 609; - public const ushort RubySquirrelCage = 610; - public const ushort DiamondSquirrelCage = 611; - public const ushort AmberSquirrelCage = 612; - public const ushort PottedLavaPlants = 613; - public const ushort PottedLavaPlantTendrils = 614; - public const ushort VanityTreeWillowSaplings = 615; - public const ushort VanityTreeYellowWillow = 616; - public const ushort MasterTrophyBase = 617; - public const ushort AccentSlab = 618; - public const ushort TruffleWormCage = 619; - public const ushort EmpressButterflyJar = 620; - public const ushort SliceOfCake = 621; - public const ushort TeaKettle = 622; - public const ushort Count = 623; + public const ushort Count = 470; public static class Sets { - public static SetFactory Factory = new SetFactory(623); - public static bool[] IsATreeTrunk = TileID.Sets.Factory.CreateBoolSet(false, 5, 72, 583, 584, 585, 586, 587, 588, 589, 596, 616); - public static bool[] IsShakeable = TileID.Sets.Factory.CreateBoolSet(false, 5, 72, 323, 583, 584, 585, 586, 587, 588, 589, 596, 616); - public static bool[] GetsDestroyedForMeteors = TileID.Sets.Factory.CreateBoolSet(false, 5, 32, 352, 583, 584, 585, 586, 587, 588, 589, 596, 616); - public static bool[] GetsCheckedForLeaves = TileID.Sets.Factory.CreateBoolSet(false, 5, 323, 72, 583, 584, 585, 586, 587, 588, 589, 596, 616); - public static bool[] PreventsTileRemovalIfOnTopOfIt = TileID.Sets.Factory.CreateBoolSet(false, 5, 323, 72, 488, 26, 583, 584, 585, 586, 587, 588, 589, 596, 616); - public static bool[] PreventsTileReplaceIfOnTopOfIt = TileID.Sets.Factory.CreateBoolSet(false, 5, 323, 72, 583, 584, 585, 586, 587, 588, 589, 596, 616); - public static bool[] CommonSapling = TileID.Sets.Factory.CreateBoolSet(false, 20, 590, 595, 615); - public static bool[] AllBlocksWithSmoothBordersToResolveHalfBlockIssue = TileID.Sets.Factory.CreateBoolSet(false, 321, 157, 208, 159, 190, 80, 251, 202, 229, 56, 38, 39, 152, 118, 151, 148, 206, 119, 175, 46, 176, 45, 140, 347, 370, 121, 122, 346, 160, 226, 54, 156, 155, 153, 154, 150, 250, 198, 273, 274, 325, 284, 348, 385, 327, 326, 345, 328, 329, 357, 369, 268, 261, 262, (int) byte.MaxValue, 267, 260, 265, 258, 266, 259, 264, 257, 263, 256, 311, 431, 426, 433, 430, 434, 432, 272, 145, 146, 350, (int) sbyte.MaxValue, 472, 473, 477, 478, 479, 492, 496, 507, 508, 563, 618); - public static bool[] CanBeDugByShovel = TileID.Sets.Factory.CreateBoolSet(false, 0, 59, 57, 123, 224, 147, 2, 109, 23, 199, 60, 70, 477, 492, 53, 116, 112, 234, 40, 495); - public static bool[] NonSolidSaveSlopes = TileID.Sets.Factory.CreateBoolSet(false, 131); - public static bool[] ResetsHalfBrickPlacementAttempt = TileID.Sets.Factory.CreateBoolSet(true, 2, 23, 60, 70, 199, 109, 477, 492, 179, 512, 180, 513, 181, 514, 182, 515, 183, 516, 381, 517, 534, 535, 536, 537, 539, 540); - public static bool[] CrackedBricks = TileID.Sets.Factory.CreateBoolSet(481, 482, 483); - public static bool[] ForcedDirtMerging = TileID.Sets.Factory.CreateBoolSet(75, 76, 508, 507, 226, 409, 273, 274, 459, 458, 326, 327, 345, 328, 329, 192, 384, 284, 325, 272, 268, 262, 267, 265, 266, 264, 263, 54); - public static bool[] Paintings = TileID.Sets.Factory.CreateBoolSet(245, 246, 240, 241, 242); - public static bool[] isDesertBiomeSand = TileID.Sets.Factory.CreateBoolSet(53, 397, 396, 400, 403, 401); - public static bool[] MergesWithClouds = TileID.Sets.Factory.CreateBoolSet(196, 460); - public static bool[] Boulders = TileID.Sets.Factory.CreateBoolSet(138, 484); - public static bool[] Clouds = TileID.Sets.Factory.CreateBoolSet(189, 196, 460); - public static int[] SmartCursorPickaxePriorityOverride = TileID.Sets.Factory.CreateIntSet(0, 12, 1); - public static bool[] IgnoreSmartCursorPriorityAxe = TileID.Sets.Factory.CreateBoolSet(false, 488); - public static bool[] CanBeSatOnForNPCs = TileID.Sets.Factory.CreateBoolSet(false, 15, 497); - public static bool[] CanBeSatOnForPlayers = TileID.Sets.Factory.CreateBoolSet(false, 15, 497, 89, 102, 487); - public static bool[] CanBeSleptIn = TileID.Sets.Factory.CreateBoolSet(false, 79); - public static bool[] IgnoresTileReplacementDropCheckWhenBeingPlaced = TileID.Sets.Factory.CreateBoolSet(false, 158, 30); - public static bool?[] DrawTileInSolidLayer = TileID.Sets.Factory.CreateCustomSet(new bool?(), (object) (ushort) 11, (object) true, (object) (ushort) 470, (object) true, (object) (ushort) 475, (object) true, (object) (ushort) 78, (object) true, (object) (ushort) 579, (object) true); - public static bool[] DoesntPlaceWithTileReplacement = TileID.Sets.Factory.CreateBoolSet(2, 70, 109, 199, 23); - public static bool[] DoesntGetReplacedWithTileReplacement = TileID.Sets.Factory.CreateBoolSet(58, 225, 171, (int) sbyte.MaxValue, 481, 482, 483); - public static bool[] IsVine = TileID.Sets.Factory.CreateBoolSet(52, 382, 62, 115, 205, 528); - public static bool[] IsBeam = TileID.Sets.Factory.CreateBoolSet(124, 561, 574, 575, 576, 577, 578); + public static SetFactory Factory = new SetFactory(470); public static bool[] Platforms = TileID.Sets.Factory.CreateBoolSet(19, 427, 435, 436, 437, 438, 439); - public static bool[] ReplaceTileBreakUp = TileID.Sets.Factory.CreateBoolSet(27, 20, 227, 24, 201, 110, 113, 61, 74, 71, 3, 73, 186, 187, 185, 233, 530, 236, 238, 254, 484, 485, 84, 82, 83, 529, 549, 590, 595, 615); - public static bool[] ReplaceTileBreakDown = TileID.Sets.Factory.CreateBoolSet(205, 115, 62, 52, 382, 444, 528); - public static bool[] SlowlyDiesInWater = TileID.Sets.Factory.CreateBoolSet(3, 20, 24, 27, 73, 201, 80, 110, 529, 530, 590, 595, 615); - public static bool[] DrawsWalls = TileID.Sets.Factory.CreateBoolSet(10, 54, 138, 484, 388, 191, 137, 328, 162, 387, 48, 232, (int) sbyte.MaxValue, 459, 541, 546); + public static bool[] DrawsWalls = TileID.Sets.Factory.CreateBoolSet(10, 54, 138, 388, 191, 137, 328, 162, 387, 48, 232, (int) sbyte.MaxValue, 459); public static ushort[] GemsparkFramingTypes = TileID.Sets.Factory.CreateUshortSet((ushort) 0, (ushort) 265, (ushort) 265, (ushort) 258, (ushort) 258, (ushort) 264, (ushort) 264, (ushort) 257, (ushort) 257, (ushort) 267, (ushort) 267, (ushort) 260, (ushort) 260, (ushort) 266, (ushort) 266, (ushort) 259, (ushort) 259, (ushort) 263, (ushort) 263, (ushort) 256, (ushort) 256, (ushort) 262, (ushort) 262, (ushort) byte.MaxValue, (ushort) byte.MaxValue, (ushort) 268, (ushort) 268, (ushort) 261, (ushort) 261, (ushort) 385, (ushort) 385, (ushort) 446, (ushort) 446, (ushort) 447, (ushort) 447, (ushort) 448, (ushort) 448); public static bool[] TeamTiles = TileID.Sets.Factory.CreateBoolSet(426, 430, 431, 432, 433, 434, 427, 435, 436, 437, 438, 439); public static int[] ConveyorDirection = TileID.Sets.Factory.CreateIntSet(0, 421, 1, 422, -1); - public static bool[] VineThreads = TileID.Sets.Factory.CreateBoolSet(382, 62, 115, 205, 52, 528); - public static bool[] ReverseVineThreads = TileID.Sets.Factory.CreateBoolSet(549); public static bool[] HasSlopeFrames = TileID.Sets.Factory.CreateBoolSet(421, 422); - public static bool[] TileInteractRead = TileID.Sets.Factory.CreateBoolSet(55, 85, 425, 573); - public static bool[] IgnoresNearbyHalfbricksWhenDrawn = TileID.Sets.Factory.CreateBoolSet(380, 476, 235, 138, 137, 484, 421, 422); - public static bool[] SwaysInWindBasic = TileID.Sets.Factory.CreateBoolSet(3, 20, 24, 61, 71, 73, 74, 83, 84, 110, 113, 201, 227, 529, 590, 595, 615); - public static int[] DrawFlipMode = TileID.Sets.Factory.CreateIntSet(0, 3, 1, 13, 1, 20, 1, 24, 1, 49, 1, 372, 1, 50, 1, 52, 1, 61, 1, 62, 1, 71, 1, 73, 1, 74, 1, 81, 1, 82, 1, 83, 1, 84, 1, 91, 1, 92, 1, 93, 1, 110, 1, 113, 1, 115, 1, 135, 1, 141, 1, 165, 1, 174, 1, 201, 1, 205, 1, 227, 1, 270, 1, 271, 1, 382, 1, 184, 2, 185, 3, 528, 1, 529, 1, 590, 1, 595, 1, 615, 1); - public static bool[] HasOutlines = TileID.Sets.Factory.CreateBoolSet(10, 11, 15, 21, 29, 55, 79, 85, 88, 89, 97, 102, 104, 125, 132, 136, 139, 144, 207, 209, 212, 215, 216, 237, 287, 335, 338, 354, 356, 377, 386, 387, 388, 389, 410, 411, 425, 441, 455, 463, 467, 468, 470, 475, 487, 480, 494, 497, 509, 510, 511, 621); + public static bool[] TileInteractRead = TileID.Sets.Factory.CreateBoolSet(55, 85, 425); + public static bool[] HasOutlines = TileID.Sets.Factory.CreateBoolSet(10, 11, 21, 29, 55, 79, 85, 88, 97, 104, 125, 132, 136, 139, 144, 207, 209, 212, 215, 216, 237, 287, 335, 338, 354, 356, 377, 386, 387, 388, 389, 410, 411, 425, 441, 455, 463, 467, 468); public static bool[] AllTiles = TileID.Sets.Factory.CreateBoolSet(true); public static bool[] Mud = TileID.Sets.Factory.CreateBoolSet(59); public static bool[] Snow = TileID.Sets.Factory.CreateBoolSet(147); @@ -694,57 +501,42 @@ namespace Terraria.ID public static bool[] JungleSpecial = TileID.Sets.Factory.CreateBoolSet(226, 225, 211); public static bool[] HellSpecial = TileID.Sets.Factory.CreateBoolSet(58, 76, 75); public static bool[] Leaves = TileID.Sets.Factory.CreateBoolSet(384, 192); - public static bool[] tileMossBrick = TileID.Sets.Factory.CreateBoolSet(false, 512, 513, 514, 515, 516, 517, 535, 537, 540); - public static bool[] GeneralPlacementTiles = TileID.Sets.Factory.CreateBoolSet(true, 225, 41, 481, 43, 482, 44, 483, 226, 203, 112, 25, 70, 151, 21, 31, 467, 12); + public static bool[] GeneralPlacementTiles = TileID.Sets.Factory.CreateBoolSet(true, 225, 41, 43, 44, 226, 203, 112, 25, 70, 151, 21, 31, 467, 12); public static bool[] BasicChest = TileID.Sets.Factory.CreateBoolSet(21, 467); public static bool[] BasicChestFake = TileID.Sets.Factory.CreateBoolSet(441, 468); - public static bool[] BasicDresser = TileID.Sets.Factory.CreateBoolSet(88); - public static bool[] CanBeClearedDuringGeneration = TileID.Sets.Factory.CreateBoolSet(true, 396, 400, 401, 397, 398, 399, 404, 368, 367, 226, 237); + public static bool[] CanBeClearedDuringGeneration = TileID.Sets.Factory.CreateBoolSet(true, 396, 400, 401, 397, 398, 399, 404, 368, 367); public static bool[] Corrupt = TileID.Sets.Factory.CreateBoolSet(23, 25, 112, 163, 398, 400); public static bool[] Hallow = TileID.Sets.Factory.CreateBoolSet(109, 117, 116, 164, 402, 403, 115); public static bool[] Crimson = TileID.Sets.Factory.CreateBoolSet(199, 203, 234, 200, 399, 401, 205); - public static bool[] IsSkippedForNPCSpawningGroundTypeCheck = TileID.Sets.Factory.CreateBoolSet(false, 421, 422); - public static bool[] BlocksStairs = TileID.Sets.Factory.CreateBoolSet(386, 387, 54, 541); + public static bool[] BlocksStairs = TileID.Sets.Factory.CreateBoolSet(386, 387, 54); public static bool[] BlocksStairsAbove = TileID.Sets.Factory.CreateBoolSet(386, 387); public static bool[] NotReallySolid = TileID.Sets.Factory.CreateBoolSet(387, 388, 10); - public static bool[] BlocksWaterDrawingBehindSelf = TileID.Sets.Factory.CreateBoolSet(false, 54, 541, 328, 470); - public static bool[] AllowLightInWater = TileID.Sets.Factory.CreateBoolSet(false, 54, 541, 328); public static bool[] NeedsGrassFraming = TileID.Sets.Factory.CreateBoolSet(); public static int[] NeedsGrassFramingDirt = TileID.Sets.Factory.CreateIntSet(0); - public static bool[] ChecksForMerge = TileID.Sets.Factory.CreateBoolSet(0, 2, 60, 70, 199, 109, 477, 492, 57, 58, 75, 76, 147, 161, 164, 163, 200, 162, 189, 196, 460, 224, 191, 383, 211, 225, 59, 226, 396, 397, 398, 399, 402, 400, 401, 403, 404, 234, 112, 407); - public static bool[] FramesOnKillWall = TileID.Sets.Factory.CreateBoolSet(440, 240, 241, 242, 245, 246, 4, 136, 334, 132, 55, 395, 425, 440, 471, 510, 511, 573); - public static bool[] AvoidedByNPCs = TileID.Sets.Factory.CreateBoolSet(21, 467, 55, 85, 395, 88, 463, 334, 29, 97, 99, 356, 425, 440, 209, 441, 468, 471, 491, 510, 511, 520, 573); - public static bool[] InteractibleByNPCs = TileID.Sets.Factory.CreateBoolSet(17, 77, 133, 12, 26, 35, 36, 55, 395, 471, 21, 467, 29, 97, 88, 99, 463, 491, 33, 372, 174, 49, 100, 173, 78, 79, 94, 96, 101, 50, 103, 282, 106, 114, 125, 171, 172, 207, 215, 220, 219, 244, 228, 237, 247, 128, 269, 354, 355, 377, 287, 378, 390, 302, 405, 406, 411, 425, 209, 441, 468, 452, 454, 455, 457, 462, 470, 475, 494, 499, 505, 511, 510, 520, 543, 565, 573, 597, 598, 617, 621); + public static bool[] ChecksForMerge = TileID.Sets.Factory.CreateBoolSet(0, 2, 60, 70, 199, 109, 57, 58, 75, 76, 147, 161, 164, 163, 200, 162, 189, 196, 224, 191, 383, 211, 225, 59, 226, 396, 397, 398, 399, 402, 400, 401, 403, 404, 234, 112, 407); + public static bool[] FramesOnKillWall = TileID.Sets.Factory.CreateBoolSet(440, 240, 241, 242, 245, 246, 4, 136, 334, 132, 55, 395, 425, 440); + public static bool[] AvoidedByNPCs = TileID.Sets.Factory.CreateBoolSet(21, 467, 55, 85, 395, 88, 463, 334, 29, 97, 99, 356, 425, 440, 209, 441, 468); + public static bool[] InteractibleByNPCs = TileID.Sets.Factory.CreateBoolSet(17, 77, 133, 12, 26, 35, 36, 55, 395, 21, 467, 29, 97, 88, 99, 463, 33, 372, 174, 49, 100, 173, 78, 79, 94, 96, 101, 50, 103, 282, 106, 114, 125, 171, 172, 207, 215, 220, 219, 244, 228, 237, 247, 128, 269, 354, 355, 377, 287, 378, 390, 302, 405, 406, 411, 425, 209, 441, 468, 452, 454, 455, 457, 462); public static bool[] HousingWalls = TileID.Sets.Factory.CreateBoolSet(11, 389, 386); - public static bool[] BreakableWhenPlacing = TileID.Sets.Factory.CreateBoolSet(324, 186, 187, 185, 165, 530, 233, 227, 485, 81); + public static bool[] BreakableWhenPlacing = TileID.Sets.Factory.CreateBoolSet(324, 186, 187, 185, 165); public static int[] TouchDamageVines = TileID.Sets.Factory.CreateIntSet(0, 32, 10, 69, 17, 80, 6, 352, 10); public static int[] TouchDamageSands = TileID.Sets.Factory.CreateIntSet(0, 53, 15, 112, 15, 116, 15, 123, 15, 224, 15, 234, 15, 57, 15, 69, 15); public static int[] TouchDamageHot = TileID.Sets.Factory.CreateIntSet(0, 37, 20, 58, 20, 76, 20); public static int[] TouchDamageOther = TileID.Sets.Factory.CreateIntSet(0, 48, 40, 232, 60); - public static bool[] Falling = TileID.Sets.Factory.CreateBoolSet(53, 234, 112, 116, 224, 123, 330, 331, 332, 333, 495); - public static bool[] OreMergesWithMud = TileID.Sets.Factory.CreateBoolSet(7, 166, 6, 167, 9, 168, 8, 169, 22, 204, 37, 58, 107, 221, 108, 222, 111, 223); + public static bool[] Falling = TileID.Sets.Factory.CreateBoolSet(53, 234, 112, 116, 224, 123); public static bool[] Ore = TileID.Sets.Factory.CreateBoolSet(7, 166, 6, 167, 9, 168, 8, 169, 22, 204, 37, 58, 107, 221, 108, 222, 111, 223, 211); - public static bool[] IsAContainer = TileID.Sets.Factory.CreateBoolSet(21, 467, 88); - public static bool[] IsAMechanism = TileID.Sets.Factory.CreateBoolSet(137, 443, 105, 349, 141, 142, 143, 42, 34, 130, 131, 506, 546, 557, 593, 594); - public static bool[] IsATrigger = TileID.Sets.Factory.CreateBoolSet(135, 136, 132, 144, 411, 441, 468); - public static bool[] FriendlyFairyCanLureTo = TileID.Sets.Factory.CreateBoolSet(8, 169, 21, 467, 107, 108, 111, 221, 222, 223, 211, 12, 236, 227); - public static bool[] IgnoredInHouseScore = TileID.Sets.Factory.CreateBoolSet(4, 3, 73, 82, 83, 84); - public static bool[] SpreadOverground = TileID.Sets.Factory.CreateBoolSet(2, 23, 32, 60, 70, 109, 199, 352, 477, 492); - public static bool[] SpreadUnderground = TileID.Sets.Factory.CreateBoolSet(23, 109, 199, 60, 70); + public static bool[] ForceObsidianKill = TileID.Sets.Factory.CreateBoolSet(21, 467, 88); public static class Conversion { - public static bool[] MergesWithDirtInASpecialWay = TileID.Sets.Factory.CreateBoolSet(2, 23, 109, 199, 477, 492); - public static bool[] Grass = TileID.Sets.Factory.CreateBoolSet(2, 23, 60, 199, 109, 477, 492); - public static bool[] GolfGrass = TileID.Sets.Factory.CreateBoolSet(477, 492); + public static bool[] Grass = TileID.Sets.Factory.CreateBoolSet(2, 23, 60, 199, 109); public static bool[] Stone = TileID.Sets.Factory.CreateBoolSet(1, 25, 117, 203); public static bool[] Ice = TileID.Sets.Factory.CreateBoolSet(161, 163, 164, 200); public static bool[] Sand = TileID.Sets.Factory.CreateBoolSet(53, 112, 116, 234); public static bool[] HardenedSand = TileID.Sets.Factory.CreateBoolSet(397, 398, 402, 399); public static bool[] Sandstone = TileID.Sets.Factory.CreateBoolSet(396, 400, 403, 401); public static bool[] Thorn = TileID.Sets.Factory.CreateBoolSet(32, 352, 69); - public static bool[] Moss = TileID.Sets.Factory.CreateBoolSet(182, 180, 179, 381, 183, 181, 534, 536, 539); - public static bool[] MossBrick = TileID.Sets.Factory.CreateBoolSet(512, 513, 514, 515, 516, 517, 535, 537, 540); + public static bool[] Moss = TileID.Sets.Factory.CreateBoolSet(182, 180, 179, 381, 183, 181); } public static class ForAdvancedCollision @@ -754,16 +546,14 @@ namespace Terraria.ID public static class RoomNeeds { - public static int[] CountsAsChair = new int[6] + public static int[] CountsAsChair = new int[4] { 15, 79, 89, - 102, - 487, - 497 + 102 }; - public static int[] CountsAsTable = new int[11] + public static int[] CountsAsTable = new int[10] { 14, 18, @@ -774,10 +564,9 @@ namespace Terraria.ID 354, 355, 464, - 469, - 487 + 469 }; - public static int[] CountsAsTorch = new int[23] + public static int[] CountsAsTorch = new int[20] { 4, 33, @@ -797,11 +586,8 @@ namespace Terraria.ID 316, 317, 318, - 92, 372, - 405, - 592, - 572 + 405 }; public static int[] CountsAsDoor = new int[13] { diff --git a/ID/TorchID.cs b/ID/TorchID.cs deleted file mode 100644 index 7963707..0000000 --- a/ID/TorchID.cs +++ /dev/null @@ -1,139 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.ID.TorchID -// 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.Runtime.InteropServices; - -namespace Terraria.ID -{ - public static class TorchID - { - public static int[] Dust = new int[22] - { - 6, - 59, - 60, - 61, - 62, - 63, - 64, - 65, - 75, - 135, - 158, - 169, - 156, - 234, - 66, - 242, - 293, - 294, - 295, - 296, - 297, - 298 - }; - private static TorchID.ITorchLightProvider[] _lights; - public const short Torch = 0; - public const short Blue = 1; - public const short Red = 2; - public const short Green = 3; - public const short Purple = 4; - public const short White = 5; - public const short Yellow = 6; - public const short Demon = 7; - public const short Cursed = 8; - public const short Ice = 9; - public const short Orange = 10; - public const short Ichor = 11; - public const short UltraBright = 12; - public const short Bone = 13; - public const short Rainbow = 14; - public const short Pink = 15; - public const short Desert = 16; - public const short Coral = 17; - public const short Corrupt = 18; - public const short Crimson = 19; - public const short Hallowed = 20; - public const short Jungle = 21; - public const short Count = 22; - - public static void Initialize() => TorchID._lights = new TorchID.ITorchLightProvider[22] - { - (TorchID.ITorchLightProvider) new TorchID.ConstantTorchLight(1f, 0.95f, 0.8f), - (TorchID.ITorchLightProvider) new TorchID.ConstantTorchLight(0.0f, 0.1f, 1.3f), - (TorchID.ITorchLightProvider) new TorchID.ConstantTorchLight(1f, 0.1f, 0.1f), - (TorchID.ITorchLightProvider) new TorchID.ConstantTorchLight(0.0f, 1f, 0.1f), - (TorchID.ITorchLightProvider) new TorchID.ConstantTorchLight(0.9f, 0.0f, 0.9f), - (TorchID.ITorchLightProvider) new TorchID.ConstantTorchLight(1.4f, 1.4f, 1.4f), - (TorchID.ITorchLightProvider) new TorchID.ConstantTorchLight(0.9f, 0.9f, 0.0f), - (TorchID.ITorchLightProvider) new TorchID.DemonTorchLight(), - (TorchID.ITorchLightProvider) new TorchID.ConstantTorchLight(1f, 1.6f, 0.5f), - (TorchID.ITorchLightProvider) new TorchID.ConstantTorchLight(0.75f, 0.85f, 1.4f), - (TorchID.ITorchLightProvider) new TorchID.ConstantTorchLight(1f, 0.5f, 0.0f), - (TorchID.ITorchLightProvider) new TorchID.ConstantTorchLight(1.4f, 1.4f, 0.7f), - (TorchID.ITorchLightProvider) new TorchID.ConstantTorchLight(0.75f, 1.35f, 1.5f), - (TorchID.ITorchLightProvider) new TorchID.ConstantTorchLight(0.95f, 0.75f, 1.3f), - (TorchID.ITorchLightProvider) new TorchID.DiscoTorchLight(), - (TorchID.ITorchLightProvider) new TorchID.ConstantTorchLight(1f, 0.0f, 1f), - (TorchID.ITorchLightProvider) new TorchID.ConstantTorchLight(1.4f, 0.85f, 0.55f), - (TorchID.ITorchLightProvider) new TorchID.ConstantTorchLight(0.25f, 1.3f, 0.8f), - (TorchID.ITorchLightProvider) new TorchID.ConstantTorchLight(0.95f, 0.4f, 1.4f), - (TorchID.ITorchLightProvider) new TorchID.ConstantTorchLight(1.4f, 0.7f, 0.5f), - (TorchID.ITorchLightProvider) new TorchID.ConstantTorchLight(1.25f, 0.6f, 1.2f), - (TorchID.ITorchLightProvider) new TorchID.ConstantTorchLight(0.75f, 1.45f, 0.9f) - }; - - public static void TorchColor(int torchID, out float R, out float G, out float B) => TorchID._lights[torchID].GetRGB(out R, out G, out B); - - private interface ITorchLightProvider - { - void GetRGB(out float r, out float g, out float b); - } - - private struct ConstantTorchLight : TorchID.ITorchLightProvider - { - public float R; - public float G; - public float B; - - public ConstantTorchLight(float Red, float Green, float Blue) - { - this.R = Red; - this.G = Green; - this.B = Blue; - } - - public void GetRGB(out float r, out float g, out float b) - { - r = this.R; - g = this.G; - b = this.B; - } - } - - [StructLayout(LayoutKind.Sequential, Size = 1)] - private struct DemonTorchLight : TorchID.ITorchLightProvider - { - public void GetRGB(out float r, out float g, out float b) - { - r = (float) (0.5 * (double) Main.demonTorch + (1.0 - (double) Main.demonTorch)); - g = 0.3f; - b = Main.demonTorch + (float) (0.5 * (1.0 - (double) Main.demonTorch)); - } - } - - [StructLayout(LayoutKind.Sequential, Size = 1)] - private struct DiscoTorchLight : TorchID.ITorchLightProvider - { - public void GetRGB(out float r, out float g, out float b) - { - r = (float) Main.DiscoR / (float) byte.MaxValue; - g = (float) Main.DiscoG / (float) byte.MaxValue; - b = (float) Main.DiscoB / (float) byte.MaxValue; - } - } - } -} diff --git a/ID/TreeTopID.cs b/ID/TreeTopID.cs deleted file mode 100644 index 195773d..0000000 --- a/ID/TreeTopID.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.ID.TreeTopID -// 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.ID -{ - public static class TreeTopID - { - public const int GemRuby = 26; - } -} diff --git a/ID/WallID.cs b/ID/WallID.cs index c8f1063..1a01db6 100644 --- a/ID/WallID.cs +++ b/ID/WallID.cs @@ -1,352 +1,260 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ID.WallID -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.ID { public class WallID { - public const ushort None = 0; - public const ushort Stone = 1; - public const ushort DirtUnsafe = 2; - public const ushort EbonstoneUnsafe = 3; - public const ushort Wood = 4; - public const ushort GrayBrick = 5; - public const ushort RedBrick = 6; - public const ushort BlueDungeonUnsafe = 7; - public const ushort GreenDungeonUnsafe = 8; - public const ushort PinkDungeonUnsafe = 9; - public const ushort GoldBrick = 10; - public const ushort SilverBrick = 11; - public const ushort CopperBrick = 12; - public const ushort HellstoneBrickUnsafe = 13; - public const ushort ObsidianBrickUnsafe = 14; - public const ushort MudUnsafe = 15; - public const ushort Dirt = 16; - public const ushort BlueDungeon = 17; - public const ushort GreenDungeon = 18; - public const ushort PinkDungeon = 19; - public const ushort ObsidianBrick = 20; - public const ushort Glass = 21; - public const ushort PearlstoneBrick = 22; - public const ushort IridescentBrick = 23; - public const ushort MudstoneBrick = 24; - public const ushort CobaltBrick = 25; - public const ushort MythrilBrick = 26; - public const ushort Planked = 27; - public const ushort PearlstoneBrickUnsafe = 28; - public const ushort CandyCane = 29; - public const ushort GreenCandyCane = 30; - public const ushort SnowBrick = 31; - public const ushort AdamantiteBeam = 32; - public const ushort DemoniteBrick = 33; - public const ushort SandstoneBrick = 34; - public const ushort EbonstoneBrick = 35; - public const ushort RedStucco = 36; - public const ushort YellowStucco = 37; - public const ushort GreenStucco = 38; - public const ushort Gray = 39; - public const ushort SnowWallUnsafe = 40; - public const ushort Ebonwood = 41; - public const ushort RichMaogany = 42; - public const ushort Pearlwood = 43; - public const ushort RainbowBrick = 44; - public const ushort TinBrick = 45; - public const ushort TungstenBrick = 46; - public const ushort PlatinumBrick = 47; - public const ushort AmethystUnsafe = 48; - public const ushort TopazUnsafe = 49; - public const ushort SapphireUnsafe = 50; - public const ushort EmeraldUnsafe = 51; - public const ushort RubyUnsafe = 52; - public const ushort DiamondUnsafe = 53; - public const ushort CaveUnsafe = 54; - public const ushort Cave2Unsafe = 55; - public const ushort Cave3Unsafe = 56; - public const ushort Cave4Unsafe = 57; - public const ushort Cave5Unsafe = 58; - public const ushort Cave6Unsafe = 59; - public const ushort LivingLeaf = 60; - public const ushort Cave7Unsafe = 61; - public const ushort SpiderUnsafe = 62; - public const ushort GrassUnsafe = 63; - public const ushort JungleUnsafe = 64; - public const ushort FlowerUnsafe = 65; - public const ushort Grass = 66; - public const ushort Jungle = 67; - public const ushort Flower = 68; - public const ushort CorruptGrassUnsafe = 69; - public const ushort HallowedGrassUnsafe = 70; - public const ushort IceUnsafe = 71; - public const ushort Cactus = 72; - public const ushort Cloud = 73; - public const ushort Mushroom = 74; - public const ushort Bone = 75; - public const ushort Slime = 76; - public const ushort Flesh = 77; - public const ushort LivingWood = 78; - public const ushort ObsidianBackUnsafe = 79; - public const ushort MushroomUnsafe = 80; - public const ushort CrimsonGrassUnsafe = 81; - public const ushort DiscWall = 82; - public const ushort CrimstoneUnsafe = 83; - public const ushort IceBrick = 84; - public const ushort Shadewood = 85; - public const ushort HiveUnsafe = 86; - public const ushort LihzahrdBrickUnsafe = 87; - public const ushort PurpleStainedGlass = 88; - public const ushort YellowStainedGlass = 89; - public const ushort BlueStainedGlass = 90; - public const ushort GreenStainedGlass = 91; - public const ushort RedStainedGlass = 92; - public const ushort RainbowStainedGlass = 93; - public const ushort BlueDungeonSlabUnsafe = 94; - public const ushort BlueDungeonTileUnsafe = 95; - public const ushort PinkDungeonSlabUnsafe = 96; - public const ushort PinkDungeonTileUnsafe = 97; - public const ushort GreenDungeonSlabUnsafe = 98; - public const ushort GreenDungeonTileUnsafe = 99; - public const ushort BlueDungeonSlab = 100; - public const ushort BlueDungeonTile = 101; - public const ushort PinkDungeonSlab = 102; - public const ushort PinkDungeonTile = 103; - public const ushort GreenDungeonSlab = 104; - public const ushort GreenDungeonTile = 105; - public const ushort WoodenFence = 106; - public const ushort MetalFence = 107; - public const ushort Hive = 108; - public const ushort PalladiumColumn = 109; - public const ushort BubblegumBlock = 110; - public const ushort TitanstoneBlock = 111; - public const ushort LihzahrdBrick = 112; - public const ushort Pumpkin = 113; - public const ushort Hay = 114; - public const ushort SpookyWood = 115; - public const ushort ChristmasTreeWallpaper = 116; - public const ushort OrnamentWallpaper = 117; - public const ushort CandyCaneWallpaper = 118; - public const ushort FestiveWallpaper = 119; - public const ushort StarsWallpaper = 120; - public const ushort SquigglesWallpaper = 121; - public const ushort SnowflakeWallpaper = 122; - public const ushort KrampusHornWallpaper = 123; - public const ushort BluegreenWallpaper = 124; - public const ushort GrinchFingerWallpaper = 125; - public const ushort FancyGrayWallpaper = 126; - public const ushort IceFloeWallpaper = 127; - public const ushort MusicWallpaper = 128; - public const ushort PurpleRainWallpaper = 129; - public const ushort RainbowWallpaper = 130; - public const ushort SparkleStoneWallpaper = 131; - public const ushort StarlitHeavenWallpaper = 132; - public const ushort BubbleWallpaper = 133; - public const ushort CopperPipeWallpaper = 134; - public const ushort DuckyWallpaper = 135; - public const ushort Waterfall = 136; - public const ushort Lavafall = 137; - public const ushort EbonwoodFence = 138; - public const ushort RichMahoganyFence = 139; - public const ushort PearlwoodFence = 140; - public const ushort ShadewoodFence = 141; - public const ushort WhiteDynasty = 142; - public const ushort BlueDynasty = 143; - public const ushort ArcaneRunes = 144; - public const ushort IronFence = 145; - public const ushort CopperPlating = 146; - public const ushort StoneSlab = 147; - public const ushort Sail = 148; - public const ushort BorealWood = 149; - public const ushort BorealWoodFence = 150; - public const ushort PalmWood = 151; - public const ushort PalmWoodFence = 152; - public const ushort AmberGemspark = 153; - public const ushort AmethystGemspark = 154; - public const ushort DiamondGemspark = 155; - public const ushort EmeraldGemspark = 156; - public const ushort AmberGemsparkOff = 157; - public const ushort AmethystGemsparkOff = 158; - public const ushort DiamondGemsparkOff = 159; - public const ushort EmeraldGemsparkOff = 160; - public const ushort RubyGemsparkOff = 161; - public const ushort SapphireGemsparkOff = 162; - public const ushort TopazGemsparkOff = 163; - public const ushort RubyGemspark = 164; - public const ushort SapphireGemspark = 165; - public const ushort TopazGemspark = 166; - public const ushort TinPlating = 167; - public const ushort Confetti = 168; - public const ushort ConfettiBlack = 169; - public const ushort CaveWall = 170; - public const ushort CaveWall2 = 171; - public const ushort Honeyfall = 172; - public const ushort ChlorophyteBrick = 173; - public const ushort CrimtaneBrick = 174; - public const ushort ShroomitePlating = 175; - public const ushort MartianConduit = 176; - public const ushort HellstoneBrick = 177; - public const ushort MarbleUnsafe = 178; - public const ushort MarbleBlock = 179; - public const ushort GraniteUnsafe = 180; - public const ushort GraniteBlock = 181; - public const ushort MeteoriteBrick = 182; - public const ushort Marble = 183; - public const ushort Granite = 184; - public const ushort Cave8Unsafe = 185; - public const ushort Crystal = 186; - public const ushort Sandstone = 187; - public const ushort CorruptionUnsafe1 = 188; - public const ushort CorruptionUnsafe2 = 189; - public const ushort CorruptionUnsafe3 = 190; - public const ushort CorruptionUnsafe4 = 191; - public const ushort CrimsonUnsafe1 = 192; - public const ushort CrimsonUnsafe2 = 193; - public const ushort CrimsonUnsafe3 = 194; - public const ushort CrimsonUnsafe4 = 195; - public const ushort DirtUnsafe1 = 196; - public const ushort DirtUnsafe2 = 197; - public const ushort DirtUnsafe3 = 198; - public const ushort DirtUnsafe4 = 199; - public const ushort HallowUnsafe1 = 200; - public const ushort HallowUnsafe2 = 201; - public const ushort HallowUnsafe3 = 202; - public const ushort HallowUnsafe4 = 203; - public const ushort JungleUnsafe1 = 204; - public const ushort JungleUnsafe2 = 205; - public const ushort JungleUnsafe3 = 206; - public const ushort JungleUnsafe4 = 207; - public const ushort LavaUnsafe1 = 208; - public const ushort LavaUnsafe2 = 209; - public const ushort LavaUnsafe3 = 210; - public const ushort LavaUnsafe4 = 211; - public const ushort RocksUnsafe1 = 212; - public const ushort RocksUnsafe2 = 213; - public const ushort RocksUnsafe3 = 214; - public const ushort RocksUnsafe4 = 215; - public const ushort HardenedSand = 216; - public const ushort CorruptHardenedSand = 217; - public const ushort CrimsonHardenedSand = 218; - public const ushort HallowHardenedSand = 219; - public const ushort CorruptSandstone = 220; - public const ushort CrimsonSandstone = 221; - public const ushort HallowSandstone = 222; - public const ushort DesertFossil = 223; - public const ushort LunarBrickWall = 224; - public const ushort CogWall = 225; - public const ushort SandFall = 226; - public const ushort SnowFall = 227; - public const ushort SillyBalloonPinkWall = 228; - public const ushort SillyBalloonPurpleWall = 229; - public const ushort SillyBalloonGreenWall = 230; - public const ushort IronBrick = 231; - public const ushort LeadBrick = 232; - public const ushort LesionBlock = 233; - public const ushort CrimstoneBrick = 234; - public const ushort SmoothSandstone = 235; - public const ushort Spider = 236; - public const ushort SolarBrick = 237; - public const ushort VortexBrick = 238; - public const ushort NebulaBrick = 239; - public const ushort StardustBrick = 240; - public const ushort OrangeStainedGlass = 241; - public const ushort GoldStarryGlassWall = 242; - public const ushort BlueStarryGlassWall = 243; - public const ushort LivingWoodUnsafe = 244; - public const ushort WroughtIronFence = 245; - public const ushort EbonstoneEcho = 246; - public const ushort MudWallEcho = 247; - public const ushort PearlstoneEcho = 248; - public const ushort SnowWallEcho = 249; - public const ushort AmethystEcho = 250; - public const ushort TopazEcho = 251; - public const ushort SapphireEcho = 252; - public const ushort EmeraldEcho = 253; - public const ushort RubyEcho = 254; - public const ushort DiamondEcho = 255; - public const ushort Cave1Echo = 256; - public const ushort Cave2Echo = 257; - public const ushort Cave3Echo = 258; - public const ushort Cave4Echo = 259; - public const ushort Cave5Echo = 260; - public const ushort Cave6Echo = 261; - public const ushort Cave7Echo = 262; - public const ushort SpiderEcho = 263; - public const ushort CorruptGrassEcho = 264; - public const ushort HallowedGrassEcho = 265; - public const ushort IceEcho = 266; - public const ushort ObsidianBackEcho = 267; - public const ushort CrimsonGrassEcho = 268; - public const ushort CrimstoneEcho = 269; - public const ushort CaveWall1Echo = 270; - public const ushort CaveWall2Echo = 271; - public const ushort MarbleEchoUnused = 272; - public const ushort GraniteEchoUnused = 273; - public const ushort Cave8Echo = 274; - public const ushort SandstoneEcho = 275; - public const ushort Corruption1Echo = 276; - public const ushort Corruption2Echo = 277; - public const ushort Corruption3Echo = 278; - public const ushort Corruption4Echo = 279; - public const ushort Crimson1Echo = 280; - public const ushort Crimson2Echo = 281; - public const ushort Crimson3Echo = 282; - public const ushort Crimson4Echo = 283; - public const ushort Dirt1Echo = 284; - public const ushort Dirt2Echo = 285; - public const ushort Dirt3Echo = 286; - public const ushort Dirt4Echo = 287; - public const ushort Hallow1Echo = 288; - public const ushort Hallow2Echo = 289; - public const ushort Hallow3Echo = 290; - public const ushort Hallow4Echo = 291; - public const ushort Jungle1Echo = 292; - public const ushort Jungle2Echo = 293; - public const ushort Jungle3Echo = 294; - public const ushort Jungle4Echo = 295; - public const ushort Lava1Echo = 296; - public const ushort Lava2Echo = 297; - public const ushort Lava3Echo = 298; - public const ushort Lava4Echo = 299; - public const ushort Rocks1Echo = 300; - public const ushort Rocks2Echo = 301; - public const ushort Rocks3Echo = 302; - public const ushort Rocks4Echo = 303; - public const ushort HardenedSandEcho = 304; - public const ushort CorruptHardenedSandEcho = 305; - public const ushort CrimsonHardenedSandEcho = 306; - public const ushort HallowHardenedSandEcho = 307; - public const ushort CorruptSandstoneEcho = 308; - public const ushort CrimsonSandstoneEcho = 309; - public const ushort HallowSandstoneEcho = 310; - public const ushort DesertFossilEcho = 311; - public const ushort BambooBlockWall = 312; - public const ushort LargeBambooBlockWall = 313; - public const ushort AmberStoneWallEcho = 314; - public const ushort BambooFence = 315; - public const ushort Count = 316; + public const byte None = 0; + public const byte Stone = 1; + public const byte DirtUnsafe = 2; + public const byte EbonstoneUnsafe = 3; + public const byte Wood = 4; + public const byte GrayBrick = 5; + public const byte RedBrick = 6; + public const byte BlueDungeonUnsafe = 7; + public const byte GreenDungeonUnsafe = 8; + public const byte PinkDungeonUnsafe = 9; + public const byte GoldBrick = 10; + public const byte SilverBrick = 11; + public const byte CopperBrick = 12; + public const byte HellstoneBrickUnsafe = 13; + public const byte ObsidianBrickUnsafe = 14; + public const byte MudUnsafe = 15; + public const byte Dirt = 16; + public const byte BlueDungeon = 17; + public const byte GreenDungeon = 18; + public const byte PinkDungeon = 19; + public const byte ObsidianBrick = 20; + public const byte Glass = 21; + public const byte PearlstoneBrick = 22; + public const byte IridescentBrick = 23; + public const byte MudstoneBrick = 24; + public const byte CobaltBrick = 25; + public const byte MythrilBrick = 26; + public const byte Planked = 27; + public const byte PearlstoneBrickUnsafe = 28; + public const byte CandyCane = 29; + public const byte GreenCandyCane = 30; + public const byte SnowBrick = 31; + public const byte AdamantiteBeam = 32; + public const byte DemoniteBrick = 33; + public const byte SandstoneBrick = 34; + public const byte EbonstoneBrick = 35; + public const byte RedStucco = 36; + public const byte YellowStucco = 37; + public const byte GreenStucco = 38; + public const byte Gray = 39; + public const byte SnowWallUnsafe = 40; + public const byte Ebonwood = 41; + public const byte RichMaogany = 42; + public const byte Pearlwood = 43; + public const byte RainbowBrick = 44; + public const byte TinBrick = 45; + public const byte TungstenBrick = 46; + public const byte PlatinumBrick = 47; + public const byte AmethystUnsafe = 48; + public const byte TopazUnsafe = 49; + public const byte SapphireUnsafe = 50; + public const byte EmeraldUnsafe = 51; + public const byte RubyUnsafe = 52; + public const byte DiamondUnsafe = 53; + public const byte CaveUnsafe = 54; + public const byte Cave2Unsafe = 55; + public const byte Cave3Unsafe = 56; + public const byte Cave4Unsafe = 57; + public const byte Cave5Unsafe = 58; + public const byte Cave6Unsafe = 59; + public const byte LivingLeaf = 60; + public const byte Cave7Unsafe = 61; + public const byte SpiderUnsafe = 62; + public const byte GrassUnsafe = 63; + public const byte JungleUnsafe = 64; + public const byte FlowerUnsafe = 65; + public const byte Grass = 66; + public const byte Jungle = 67; + public const byte Flower = 68; + public const byte CorruptGrassUnsafe = 69; + public const byte HallowedGrassUnsafe = 70; + public const byte IceUnsafe = 71; + public const byte Cactus = 72; + public const byte Cloud = 73; + public const byte Mushroom = 74; + public const byte Bone = 75; + public const byte Slime = 76; + public const byte Flesh = 77; + public const byte LivingWood = 78; + public const byte ObsidianBackUnsafe = 79; + public const byte MushroomUnsafe = 80; + public const byte CrimsonGrassUnsafe = 81; + public const byte DiscWall = 82; + public const byte CrimstoneUnsafe = 83; + public const byte IceBrick = 84; + public const byte Shadewood = 85; + public const byte HiveUnsafe = 86; + public const byte LihzahrdBrickUnsafe = 87; + public const byte PurpleStainedGlass = 88; + public const byte YellowStainedGlass = 89; + public const byte BlueStainedGlass = 90; + public const byte GreenStainedGlass = 91; + public const byte RedStainedGlass = 92; + public const byte RainbowStainedGlass = 93; + public const byte BlueDungeonSlabUnsafe = 94; + public const byte BlueDungeonTileUnsafe = 95; + public const byte PinkDungeonSlabUnsafe = 96; + public const byte PinkDungeonTileUnsafe = 97; + public const byte GreenDungeonSlabUnsafe = 98; + public const byte GreenDungeonTileUnsafe = 99; + public const byte BlueDungeonSlab = 100; + public const byte BlueDungeonTile = 101; + public const byte PinkDungeonSlab = 102; + public const byte PinkDungeonTile = 103; + public const byte GreenDungeonSlab = 104; + public const byte GreenDungeonTile = 105; + public const byte WoodenFence = 106; + public const byte MetalFence = 107; + public const byte Hive = 108; + public const byte PalladiumColumn = 109; + public const byte BubblegumBlock = 110; + public const byte TitanstoneBlock = 111; + public const byte LihzahrdBrick = 112; + public const byte Pumpkin = 113; + public const byte Hay = 114; + public const byte SpookyWood = 115; + public const byte ChristmasTreeWallpaper = 116; + public const byte OrnamentWallpaper = 117; + public const byte CandyCaneWallpaper = 118; + public const byte FestiveWallpaper = 119; + public const byte StarsWallpaper = 120; + public const byte SquigglesWallpaper = 121; + public const byte SnowflakeWallpaper = 122; + public const byte KrampusHornWallpaper = 123; + public const byte BluegreenWallpaper = 124; + public const byte GrinchFingerWallpaper = 125; + public const byte FancyGrayWallpaper = 126; + public const byte IceFloeWallpaper = 127; + public const byte MusicWallpaper = 128; + public const byte PurpleRainWallpaper = 129; + public const byte RainbowWallpaper = 130; + public const byte SparkleStoneWallpaper = 131; + public const byte StarlitHeavenWallpaper = 132; + public const byte BubbleWallpaper = 133; + public const byte CopperPipeWallpaper = 134; + public const byte DuckyWallpaper = 135; + public const byte Waterfall = 136; + public const byte Lavafall = 137; + public const byte EbonwoodFence = 138; + public const byte RichMahoganyFence = 139; + public const byte PearlwoodFence = 140; + public const byte ShadewoodFence = 141; + public const byte WhiteDynasty = 142; + public const byte BlueDynasty = 143; + public const byte ArcaneRunes = 144; + public const byte IronFence = 145; + public const byte CopperPlating = 146; + public const byte StoneSlab = 147; + public const byte Sail = 148; + public const byte BorealWood = 149; + public const byte BorealWoodFence = 150; + public const byte PalmWood = 151; + public const byte PalmWoodFence = 152; + public const byte AmberGemspark = 153; + public const byte AmethystGemspark = 154; + public const byte DiamondGemspark = 155; + public const byte EmeraldGemspark = 156; + public const byte AmberGemsparkOff = 157; + public const byte AmethystGemsparkOff = 158; + public const byte DiamondGemsparkOff = 159; + public const byte EmeraldGemsparkOff = 160; + public const byte RubyGemsparkOff = 161; + public const byte SapphireGemsparkOff = 162; + public const byte TopazGemsparkOff = 163; + public const byte RubyGemspark = 164; + public const byte SapphireGemspark = 165; + public const byte TopazGemspark = 166; + public const byte TinPlating = 167; + public const byte Confetti = 168; + public const byte ConfettiBlack = 169; + public const byte CaveWall = 170; + public const byte CaveWall2 = 171; + public const byte Honeyfall = 172; + public const byte ChlorophyteBrick = 173; + public const byte CrimtaneBrick = 174; + public const byte ShroomitePlating = 175; + public const byte MartianConduit = 176; + public const byte HellstoneBrick = 177; + public const byte MarbleUnsafe = 178; + public const byte MarbleBlock = 179; + public const byte GraniteUnsafe = 180; + public const byte GraniteBlock = 181; + public const byte MeteoriteBrick = 182; + public const byte Marble = 183; + public const byte Granite = 184; + public const byte Cave8Unsafe = 185; + public const byte Crystal = 186; + public const byte Sandstone = 187; + public const byte CorruptionUnsafe1 = 188; + public const byte CorruptionUnsafe2 = 189; + public const byte CorruptionUnsafe3 = 190; + public const byte CorruptionUnsafe4 = 191; + public const byte CrimsonUnsafe1 = 192; + public const byte CrimsonUnsafe2 = 193; + public const byte CrimsonUnsafe3 = 194; + public const byte CrimsonUnsafe4 = 195; + public const byte DirtUnsafe1 = 196; + public const byte DirtUnsafe2 = 197; + public const byte DirtUnsafe3 = 198; + public const byte DirtUnsafe4 = 199; + public const byte HallowUnsafe1 = 200; + public const byte HallowUnsafe2 = 201; + public const byte HallowUnsafe3 = 202; + public const byte HallowUnsafe4 = 203; + public const byte JungleUnsafe1 = 204; + public const byte JungleUnsafe2 = 205; + public const byte JungleUnsafe3 = 206; + public const byte JungleUnsafe4 = 207; + public const byte LavaUnsafe1 = 208; + public const byte LavaUnsafe2 = 209; + public const byte LavaUnsafe3 = 210; + public const byte LavaUnsafe4 = 211; + public const byte RocksUnsafe1 = 212; + public const byte RocksUnsafe2 = 213; + public const byte RocksUnsafe3 = 214; + public const byte RocksUnsafe4 = 215; + public const byte HardenedSand = 216; + public const byte CorruptHardenedSand = 217; + public const byte CrimsonHardenedSand = 218; + public const byte HallowHardenedSand = 219; + public const byte CorruptSandstone = 220; + public const byte CrimsonSandstone = 221; + public const byte HallowSandstone = 222; + public const byte DesertFossil = 223; + public const byte LunarBrickWall = 224; + public const byte CogWall = 225; + public const byte SandFall = 226; + public const byte SnowFall = 227; + public const byte SillyBalloonPinkWall = 228; + public const byte SillyBalloonPurpleWall = 229; + public const byte SillyBalloonGreenWall = 230; + public const byte Count = 231; public static class Sets { - public static SetFactory Factory = new SetFactory(316); - public static bool[] CanBeConvertedToGlowingMushroom = WallID.Sets.Factory.CreateBoolSet(64, 67, 15, 247); - public static bool[] Transparent = WallID.Sets.Factory.CreateBoolSet(88, 89, 90, 91, 92, 241); + public static SetFactory Factory = new SetFactory(231); + public static bool[] Transparent = WallID.Sets.Factory.CreateBoolSet(88, 89, 90, 91, 92); public static bool[] Corrupt = WallID.Sets.Factory.CreateBoolSet(69, 217, 220, 3); public static bool[] Crimson = WallID.Sets.Factory.CreateBoolSet(83, 81, 218, 221); public static bool[] Hallow = WallID.Sets.Factory.CreateBoolSet(70, 219, 222, 28); - public static bool[] AllowsWind = WallID.Sets.Factory.CreateBoolSet(0, 150, 138, 145, 107, 152, 140, 139, 141, 106, 245, 315); public static class Conversion { - public static bool[] Grass = WallID.Sets.Factory.CreateBoolSet(63, 64, 65, 66, 67, 68, 69, 70, 81, 264, 265, 268); - public static bool[] Stone = WallID.Sets.Factory.CreateBoolSet(1, 61, 185, 3, 28, 83, 262, 274, 246, 248, 269); - public static bool[] Sandstone = WallID.Sets.Factory.CreateBoolSet(187, 220, 222, 221, 275, 308, 310, 309); - public static bool[] HardenedSand = WallID.Sets.Factory.CreateBoolSet(216, 217, 219, 218, 304, 305, 307, 306); - public static bool[] PureSand = WallID.Sets.Factory.CreateBoolSet(216, 187, 304, 275); - public static bool[] NewWall1 = WallID.Sets.Factory.CreateBoolSet(188, 192, 200, 204, 212, 276, 280, 288, 292, 300); - public static bool[] NewWall2 = WallID.Sets.Factory.CreateBoolSet(189, 193, 201, 205, 213, 277, 281, 289, 293, 301); - public static bool[] NewWall3 = WallID.Sets.Factory.CreateBoolSet(190, 194, 202, 206, 214, 278, 282, 290, 294, 302); - public static bool[] NewWall4 = WallID.Sets.Factory.CreateBoolSet(191, 195, 203, 207, 215, 279, 283, 291, 295, 303); + public static bool[] Grass = WallID.Sets.Factory.CreateBoolSet(63, 64, 65, 66, 67, 68, 69, 70, 81); + public static bool[] Stone = WallID.Sets.Factory.CreateBoolSet(1, 3, 28, 83); + public static bool[] Sandstone = WallID.Sets.Factory.CreateBoolSet(187, 220, 222, 221); + public static bool[] HardenedSand = WallID.Sets.Factory.CreateBoolSet(216, 217, 219, 218); } } } diff --git a/ID/WaterStyleID.cs b/ID/WaterStyleID.cs deleted file mode 100644 index 5e1c70f..0000000 --- a/ID/WaterStyleID.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.ID.WaterStyleID -// 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.ID -{ - public static class WaterStyleID - { - public const int Purity = 0; - public const int Lava = 1; - public const int Corrupt = 2; - public const int Jungle = 3; - public const int Hallow = 4; - public const int Snow = 5; - public const int Desert = 6; - public const int Underground = 7; - public const int Cavern = 8; - public const int Bloodmoon = 9; - public const int Crimson = 10; - public const int Honey = 11; - public const int UndergroundDesert = 12; - public const int Count = 13; - } -} diff --git a/IO/Data/ResourcePacksDefaultInfo.tsv b/IO/Data/ResourcePacksDefaultInfo.tsv deleted file mode 100644 index 63a8226..0000000 Binary files a/IO/Data/ResourcePacksDefaultInfo.tsv and /dev/null differ diff --git a/IO/FavoritesFile.cs b/IO/FavoritesFile.cs index 481c369..8af8806 100644 --- a/IO/FavoritesFile.cs +++ b/IO/FavoritesFile.cs @@ -1,14 +1,12 @@ // Decompiled with JetBrains decompiler // Type: Terraria.IO.FavoritesFile -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Newtonsoft.Json; -using System; using System.Collections.Generic; using System.Text; -using Terraria.UI; using Terraria.Utilities; namespace Terraria.IO @@ -50,19 +48,7 @@ namespace Terraria.IO return this._data[fileData.Type].TryGetValue(fileName, out flag) && flag; } - public void Save() - { - try - { - FileUtilities.WriteAllBytes(this.Path, Encoding.ASCII.GetBytes(JsonConvert.SerializeObject((object) this._data, (Formatting) 1)), this.IsCloudSave); - } - catch (Exception ex) - { - string path = this.Path; - FancyErrorPrinter.ShowFileSavingFailError(ex, path); - throw; - } - } + public void Save() => FileUtilities.WriteAllBytes(this.Path, Encoding.ASCII.GetBytes(JsonConvert.SerializeObject((object) this._data, (Formatting) 1)), this.IsCloudSave); public void Load() { @@ -72,17 +58,10 @@ namespace Terraria.IO } else { - try - { - this._data = JsonConvert.DeserializeObject>>(Encoding.ASCII.GetString(FileUtilities.ReadAllBytes(this.Path, this.IsCloudSave))); - if (this._data != null) - return; - this._data = new Dictionary>(); - } - catch (Exception ex) - { - Console.WriteLine("Unable to load favorites.json file ({0} : {1})", (object) this.Path, this.IsCloudSave ? (object) "Cloud Save" : (object) "Local Save"); - } + this._data = JsonConvert.DeserializeObject>>(Encoding.ASCII.GetString(FileUtilities.ReadAllBytes(this.Path, this.IsCloudSave))); + if (this._data != null) + return; + this._data = new Dictionary>(); } } } diff --git a/IO/FileData.cs b/IO/FileData.cs index 87bf32a..f601c54 100644 --- a/IO/FileData.cs +++ b/IO/FileData.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.IO.FileData -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Terraria.Utilities; diff --git a/IO/FileMetadata.cs b/IO/FileMetadata.cs index c161a4b..5fd9a9f 100644 --- a/IO/FileMetadata.cs +++ b/IO/FileMetadata.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.IO.FileMetadata -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; diff --git a/IO/FileType.cs b/IO/FileType.cs index 9acb6c6..f73f031 100644 --- a/IO/FileType.cs +++ b/IO/FileType.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.IO.FileType -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.IO diff --git a/IO/GameConfiguration.cs b/IO/GameConfiguration.cs deleted file mode 100644 index 5a0c2f0..0000000 --- a/IO/GameConfiguration.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.IO.GameConfiguration -// 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 Newtonsoft.Json.Linq; - -namespace Terraria.IO -{ - public class GameConfiguration - { - private readonly JObject _root; - - public GameConfiguration(JObject configurationRoot) => this._root = configurationRoot; - - public T Get(string entry) => this._root[entry].ToObject(); - } -} diff --git a/IO/PlayerFileData.cs b/IO/PlayerFileData.cs index f057511..05ede1a 100644 --- a/IO/PlayerFileData.cs +++ b/IO/PlayerFileData.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.IO.PlayerFileData -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; @@ -17,7 +17,7 @@ namespace Terraria.IO { private Player _player; private TimeSpan _playTime = TimeSpan.Zero; - private readonly Stopwatch _timer = new Stopwatch(); + private Stopwatch _timer = new Stopwatch(); private bool _isTimerActive; public Player Player @@ -106,11 +106,7 @@ namespace Terraria.IO public void UpdatePlayTimer() { - bool flag1 = Main.gamePaused && !Main.hasFocus; - bool flag2 = Main.instance.IsActive && !flag1; - if (Main.gameMenu) - flag2 = false; - if (flag2) + if (Main.instance.IsActive && !Main.gamePaused && Main.hasFocus && this._isTimerActive) this.StartPlayTimer(); else this.PausePlayTimer(); @@ -118,32 +114,23 @@ namespace Terraria.IO public void StartPlayTimer() { - if (this._isTimerActive) - return; this._isTimerActive = true; if (this._timer.IsRunning) return; this._timer.Start(); } - public void PausePlayTimer() => this.StopPlayTimer(); + public void PausePlayTimer() + { + if (!this._timer.IsRunning) + return; + this._timer.Stop(); + } public TimeSpan GetPlayTime() => this._timer.IsRunning ? this._playTime + this._timer.Elapsed : this._playTime; - public void UpdatePlayTimerAndKeepState() - { - int num = this._timer.IsRunning ? 1 : 0; - this._playTime += this._timer.Elapsed; - this._timer.Reset(); - if (num == 0) - return; - this._timer.Start(); - } - public void StopPlayTimer() { - if (!this._isTimerActive) - return; this._isTimerActive = false; if (!this._timer.IsRunning) return; diff --git a/IO/Preferences.cs b/IO/Preferences.cs index 9f26a47..f6f0b23 100644 --- a/IO/Preferences.cs +++ b/IO/Preferences.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.IO.Preferences -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Newtonsoft.Json; @@ -11,6 +11,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; +using System.Threading; using Terraria.Localization; namespace Terraria.IO @@ -81,7 +82,7 @@ namespace Terraria.IO } } - public bool Save(bool canCreateFile = true) + public bool Save(bool createFile = true) { lock (this._lock) { @@ -89,10 +90,10 @@ namespace Terraria.IO { if (this.OnSave != null) this.OnSave(this); - if (!canCreateFile && !File.Exists(this._path)) + if (!createFile && !File.Exists(this._path)) return false; Directory.GetParent(this._path).Create(); - if (File.Exists(this._path)) + if (!createFile) File.SetAttributes(this._path, FileAttributes.Normal); if (!this.UseBson) { @@ -118,6 +119,7 @@ namespace Terraria.IO { Console.WriteLine(Language.GetTextValue("Error.UnableToWritePreferences", (object) this._path)); Console.WriteLine(ex.ToString()); + Monitor.Exit(this._lock); return false; } return true; diff --git a/IO/ResourcePack.cs b/IO/ResourcePack.cs deleted file mode 100644 index fc3a7ca..0000000 --- a/IO/ResourcePack.cs +++ /dev/null @@ -1,119 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.IO.ResourcePack -// 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 Ionic.Zip; -using Microsoft.Xna.Framework.Graphics; -using Newtonsoft.Json.Linq; -using ReLogic.Content; -using ReLogic.Content.Sources; -using ReLogic.Utilities; -using System; -using System.Collections.Generic; -using System.IO; -using Terraria.GameContent; - -namespace Terraria.IO -{ - public class ResourcePack - { - public readonly string FullPath; - public readonly string FileName; - private readonly IServiceProvider _services; - private readonly bool _isCompressed; - private readonly ZipFile _zipFile; - private Texture2D _icon; - private IContentSource _contentSource; - private bool _needsReload = true; - private const string ICON_FILE_NAME = "icon.png"; - private const string PACK_FILE_NAME = "pack.json"; - - public Texture2D Icon - { - get - { - if (this._icon == null) - this._icon = this.CreateIcon(); - return this._icon; - } - } - - public string Name { get; private set; } - - public string Description { get; private set; } - - public string Author { get; private set; } - - public ResourcePackVersion Version { get; private set; } - - public bool IsEnabled { get; set; } - - public int SortingOrder { get; set; } - - public ResourcePack(IServiceProvider services, string path) - { - if (File.Exists(path)) - this._isCompressed = true; - else if (!Directory.Exists(path)) - throw new FileNotFoundException("Unable to find file or folder for resource pack at: " + path); - this.FileName = Path.GetFileName(path); - this._services = services; - this.FullPath = path; - if (this._isCompressed) - this._zipFile = ZipFile.Read(path); - this.LoadManifest(); - } - - public void Refresh() => this._needsReload = true; - - public IContentSource GetContentSource() - { - if (this._needsReload) - { - this._contentSource = !this._isCompressed ? (IContentSource) new FileSystemContentSource(Path.Combine(this.FullPath, "Content")) : (IContentSource) new ZipContentSource(this.FullPath, "Content"); - this._contentSource.ContentValidator = (IContentValidator) VanillaContentValidator.Instance; - this._needsReload = false; - } - return this._contentSource; - } - - private Texture2D CreateIcon() - { - if (!this.HasFile("icon.png")) - return XnaExtensions.Get(this._services).Request("Images/UI/DefaultResourcePackIcon", (AssetRequestMode) 1).Value; - using (Stream stream = this.OpenStream("icon.png")) - return XnaExtensions.Get(this._services).Read(stream, ".png"); - } - - private void LoadManifest() - { - if (!this.HasFile("pack.json")) - throw new FileNotFoundException(string.Format("Resource Pack at \"{0}\" must contain a {1} file.", (object) this.FullPath, (object) "pack.json")); - JObject jobject; - using (Stream stream = this.OpenStream("pack.json")) - { - using (StreamReader streamReader = new StreamReader(stream)) - jobject = JObject.Parse(streamReader.ReadToEnd()); - } - this.Name = Extensions.Value((IEnumerable) jobject["Name"]); - this.Description = Extensions.Value((IEnumerable) jobject["Description"]); - this.Author = Extensions.Value((IEnumerable) jobject["Author"]); - this.Version = jobject["Version"].ToObject(); - } - - private Stream OpenStream(string fileName) - { - if (!this._isCompressed) - return (Stream) File.OpenRead(Path.Combine(this.FullPath, fileName)); - ZipEntry zipEntry = this._zipFile[fileName]; - MemoryStream memoryStream = new MemoryStream((int) zipEntry.UncompressedSize); - zipEntry.Extract((Stream) memoryStream); - memoryStream.Position = 0L; - return (Stream) memoryStream; - } - - private bool HasFile(string fileName) => !this._isCompressed ? File.Exists(Path.Combine(this.FullPath, fileName)) : this._zipFile.ContainsEntry(fileName); - } -} diff --git a/IO/ResourcePackList.cs b/IO/ResourcePackList.cs deleted file mode 100644 index fb81ba0..0000000 --- a/IO/ResourcePackList.cs +++ /dev/null @@ -1,130 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.IO.ResourcePackList -// 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 Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; - -namespace Terraria.IO -{ - public class ResourcePackList - { - private readonly List _resourcePacks = new List(); - - public IEnumerable EnabledPacks => (IEnumerable) this._resourcePacks.Where((Func) (pack => pack.IsEnabled)).OrderBy((Func) (pack => pack.SortingOrder)).ThenBy((Func) (pack => pack.Name)).ThenBy((Func) (pack => pack.Version)).ThenBy((Func) (pack => pack.FileName)); - - public IEnumerable DisabledPacks => (IEnumerable) this._resourcePacks.Where((Func) (pack => !pack.IsEnabled)).OrderBy((Func) (pack => pack.Name)).ThenBy((Func) (pack => pack.Version)).ThenBy((Func) (pack => pack.FileName)); - - public IEnumerable AllPacks => (IEnumerable) this._resourcePacks.OrderBy((Func) (pack => pack.Name)).ThenBy((Func) (pack => pack.Version)).ThenBy((Func) (pack => pack.FileName)); - - public ResourcePackList() - { - } - - public ResourcePackList(IEnumerable resourcePacks) => this._resourcePacks.AddRange(resourcePacks); - - public JArray ToJson() - { - List resourcePackEntryList = new List(this._resourcePacks.Count); - resourcePackEntryList.AddRange(this._resourcePacks.Select((Func) (pack => new ResourcePackList.ResourcePackEntry(pack.FileName, pack.IsEnabled, pack.SortingOrder)))); - return JArray.FromObject((object) resourcePackEntryList); - } - - public static ResourcePackList FromJson( - JArray serializedState, - IServiceProvider services, - string searchPath) - { - if (!Directory.Exists(searchPath)) - return new ResourcePackList(); - List source = new List(); - foreach (ResourcePackList.ResourcePackEntry resourcePackEntry in ResourcePackList.CreatePackEntryListFromJson(serializedState)) - { - if (resourcePackEntry.FileName != null) - { - string path = Path.Combine(searchPath, resourcePackEntry.FileName); - try - { - if (!File.Exists(path)) - { - if (!Directory.Exists(path)) - continue; - } - ResourcePack resourcePack = new ResourcePack(services, path) - { - IsEnabled = resourcePackEntry.Enabled, - SortingOrder = resourcePackEntry.SortingOrder - }; - source.Add(resourcePack); - } - catch (Exception ex) - { - Console.WriteLine("Failed to read resource pack {0}: {1}", (object) path, (object) ex); - } - } - } - foreach (string file in Directory.GetFiles(searchPath, "*.zip")) - { - try - { - string fileName = Path.GetFileName(file); - if (source.All((Func) (pack => pack.FileName != fileName))) - source.Add(new ResourcePack(services, file)); - } - catch (Exception ex) - { - Console.WriteLine("Failed to read resource pack {0}: {1}", (object) file, (object) ex); - } - } - foreach (string directory in Directory.GetDirectories(searchPath)) - { - try - { - string folderName = Path.GetFileName(directory); - if (source.All((Func) (pack => pack.FileName != folderName))) - source.Add(new ResourcePack(services, directory)); - } - catch (Exception ex) - { - Console.WriteLine("Failed to read resource pack {0}: {1}", (object) directory, (object) ex); - } - } - return new ResourcePackList((IEnumerable) source); - } - - private static IEnumerable CreatePackEntryListFromJson( - JArray serializedState) - { - try - { - if (((JContainer) serializedState).Count != 0) - return (IEnumerable) ((JToken) serializedState).ToObject>(); - } - catch (JsonReaderException ex) - { - Console.WriteLine("Failed to parse configuration entry for resource pack list. {0}", (object) ex); - } - return (IEnumerable) new List(); - } - - private struct ResourcePackEntry - { - public string FileName; - public bool Enabled; - public int SortingOrder; - - public ResourcePackEntry(string name, bool enabled, int sortingOrder) - { - this.FileName = name; - this.Enabled = enabled; - this.SortingOrder = sortingOrder; - } - } - } -} diff --git a/IO/ResourcePackVersion.cs b/IO/ResourcePackVersion.cs deleted file mode 100644 index a02da8c..0000000 --- a/IO/ResourcePackVersion.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.IO.ResourcePackVersion -// 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 Newtonsoft.Json; -using System; -using System.Diagnostics; - -namespace Terraria.IO -{ - [DebuggerDisplay("Version {Major}.{Minor}")] - public struct ResourcePackVersion : IComparable, IComparable - { - [JsonProperty("major")] - public int Major { get; private set; } - - [JsonProperty("minor")] - public int Minor { get; private set; } - - public int CompareTo(object obj) - { - if (obj == null) - return 1; - if (!(obj is ResourcePackVersion other)) - throw new ArgumentException("A RatingInformation object is required for comparison.", nameof (obj)); - return this.CompareTo(other); - } - - public int CompareTo(ResourcePackVersion other) - { - int num = this.Major.CompareTo(other.Major); - return num != 0 ? num : this.Minor.CompareTo(other.Minor); - } - - public static bool operator ==(ResourcePackVersion lhs, ResourcePackVersion rhs) => lhs.CompareTo(rhs) == 0; - - public static bool operator !=(ResourcePackVersion lhs, ResourcePackVersion rhs) => !(lhs == rhs); - - public static bool operator <(ResourcePackVersion lhs, ResourcePackVersion rhs) => lhs.CompareTo(rhs) < 0; - - public static bool operator >(ResourcePackVersion lhs, ResourcePackVersion rhs) => lhs.CompareTo(rhs) > 0; - - public override bool Equals(object obj) => obj is ResourcePackVersion other && this.CompareTo(other) == 0; - - public override int GetHashCode() => ((long) this.Major << 32 | (long) this.Minor).GetHashCode(); - - public string GetFormattedVersion() => this.Major.ToString() + "." + (object) this.Minor; - } -} diff --git a/IO/WorldFile.cs b/IO/WorldFile.cs index d9466fd..04799c3 100644 --- a/IO/WorldFile.cs +++ b/IO/WorldFile.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.IO.WorldFile -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -9,300 +9,160 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; -using System.Threading; using Terraria.DataStructures; using Terraria.GameContent; -using Terraria.GameContent.Creative; using Terraria.GameContent.Events; using Terraria.GameContent.Tile_Entities; using Terraria.ID; using Terraria.Localization; using Terraria.Social; -using Terraria.UI; using Terraria.Utilities; namespace Terraria.IO { public class WorldFile { - private static readonly object IOLock = new object(); - private static double _tempTime = Main.time; - private static bool _tempRaining; - private static float _tempMaxRain; - private static int _tempRainTime; - private static bool _tempDayTime = Main.dayTime; - private static bool _tempBloodMoon = Main.bloodMoon; - private static bool _tempEclipse = Main.eclipse; - private static int _tempMoonPhase = Main.moonPhase; - private static int _tempCultistDelay = CultistRitual.delay; - private static int _versionNumber; - private static bool _isWorldOnCloud; - private static bool _tempPartyGenuine; - private static bool _tempPartyManual; - private static int _tempPartyCooldown; - private static readonly List TempPartyCelebratingNPCs = new List(); - private static bool _hasCache; - private static bool? _cachedDayTime; - private static double? _cachedTime; - private static int? _cachedMoonPhase; - private static bool? _cachedBloodMoon; - private static bool? _cachedEclipse; - private static int? _cachedCultistDelay; - private static bool? _cachedPartyGenuine; - private static bool? _cachedPartyManual; - private static int? _cachedPartyDaysOnCooldown; - private static readonly List CachedCelebratingNPCs = new List(); - private static bool? _cachedSandstormHappening; - private static bool _tempSandstormHappening; - private static int? _cachedSandstormTimeLeft; - private static int _tempSandstormTimeLeft; - private static float? _cachedSandstormSeverity; - private static float _tempSandstormSeverity; - private static float? _cachedSandstormIntendedSeverity; - private static float _tempSandstormIntendedSeverity; - private static bool _tempLanternNightGenuine; - private static bool _tempLanternNightManual; - private static bool _tempLanternNightNextNightIsGenuine; - private static int _tempLanternNightCooldown; - private static bool? _cachedLanternNightGenuine; - private static bool? _cachedLanternNightManual; - private static bool? _cachedLanternNightNextNightIsGenuine; - private static int? _cachedLanternNightCooldown; - public static Exception LastThrownLoadException; + private static object padlock = new object(); + public static double tempTime = Main.time; + public static bool tempRaining = false; + public static float tempMaxRain = 0.0f; + public static int tempRainTime = 0; + public static bool tempDayTime = Main.dayTime; + public static bool tempBloodMoon = Main.bloodMoon; + public static bool tempEclipse = Main.eclipse; + public static int tempMoonPhase = Main.moonPhase; + public static int tempCultistDelay = CultistRitual.delay; + public static int versionNumber; + public static bool IsWorldOnCloud = false; + public static bool tempPartyGenuine = false; + public static bool tempPartyManual = false; + public static int tempPartyCooldown = 0; + public static List tempPartyCelebratingNPCs = new List(); + private static bool HasCache = false; + private static bool? CachedDayTime = new bool?(); + private static double? CachedTime = new double?(); + private static int? CachedMoonPhase = new int?(); + private static bool? CachedBloodMoon = new bool?(); + private static bool? CachedEclipse = new bool?(); + private static int? CachedCultistDelay = new int?(); + private static bool? CachedPartyGenuine = new bool?(); + private static bool? CachedPartyManual = new bool?(); + private static int? CachedPartyDaysOnCooldown = new int?(); + private static List CachedCelebratingNPCs = new List(); + private static bool? Cached_Sandstorm_Happening = new bool?(); + private static bool Temp_Sandstorm_Happening = false; + private static int? Cached_Sandstorm_TimeLeft = new int?(); + private static int Temp_Sandstorm_TimeLeft = 0; + private static float? Cached_Sandstorm_Severity = new float?(); + private static float Temp_Sandstorm_Severity = 0.0f; + private static float? Cached_Sandstorm_IntendedSeverity = new float?(); + private static float Temp_Sandstorm_IntendedSeverity = 0.0f; public static event Action OnWorldLoad; public static void CacheSaveTime() { - WorldFile._hasCache = true; - WorldFile._cachedDayTime = new bool?(Main.dayTime); - WorldFile._cachedTime = new double?(Main.time); - WorldFile._cachedMoonPhase = new int?(Main.moonPhase); - WorldFile._cachedBloodMoon = new bool?(Main.bloodMoon); - WorldFile._cachedEclipse = new bool?(Main.eclipse); - WorldFile._cachedCultistDelay = new int?(CultistRitual.delay); - WorldFile._cachedPartyGenuine = new bool?(BirthdayParty.GenuineParty); - WorldFile._cachedPartyManual = new bool?(BirthdayParty.ManualParty); - WorldFile._cachedPartyDaysOnCooldown = new int?(BirthdayParty.PartyDaysOnCooldown); + WorldFile.HasCache = true; + WorldFile.CachedDayTime = new bool?(Main.dayTime); + WorldFile.CachedTime = new double?(Main.time); + WorldFile.CachedMoonPhase = new int?(Main.moonPhase); + WorldFile.CachedBloodMoon = new bool?(Main.bloodMoon); + WorldFile.CachedEclipse = new bool?(Main.eclipse); + WorldFile.CachedCultistDelay = new int?(CultistRitual.delay); + WorldFile.CachedPartyGenuine = new bool?(BirthdayParty.GenuineParty); + WorldFile.CachedPartyManual = new bool?(BirthdayParty.ManualParty); + WorldFile.CachedPartyDaysOnCooldown = new int?(BirthdayParty.PartyDaysOnCooldown); WorldFile.CachedCelebratingNPCs.Clear(); WorldFile.CachedCelebratingNPCs.AddRange((IEnumerable) BirthdayParty.CelebratingNPCs); - WorldFile._cachedSandstormHappening = new bool?(Sandstorm.Happening); - WorldFile._cachedSandstormTimeLeft = new int?(Sandstorm.TimeLeft); - WorldFile._cachedSandstormSeverity = new float?(Sandstorm.Severity); - WorldFile._cachedSandstormIntendedSeverity = new float?(Sandstorm.IntendedSeverity); - WorldFile._cachedLanternNightCooldown = new int?(LanternNight.LanternNightsOnCooldown); - WorldFile._cachedLanternNightGenuine = new bool?(LanternNight.GenuineLanterns); - WorldFile._cachedLanternNightManual = new bool?(LanternNight.ManualLanterns); - WorldFile._cachedLanternNightNextNightIsGenuine = new bool?(LanternNight.NextNightIsLanternNight); + WorldFile.Cached_Sandstorm_Happening = new bool?(Sandstorm.Happening); + WorldFile.Cached_Sandstorm_TimeLeft = new int?(Sandstorm.TimeLeft); + WorldFile.Cached_Sandstorm_Severity = new float?(Sandstorm.Severity); + WorldFile.Cached_Sandstorm_IntendedSeverity = new float?(Sandstorm.IntendedSeverity); + } + + private static void ResetTempsToDayTime() + { + WorldFile.tempDayTime = true; + WorldFile.tempTime = 13500.0; + WorldFile.tempMoonPhase = 0; + WorldFile.tempBloodMoon = false; + WorldFile.tempEclipse = false; + WorldFile.tempCultistDelay = 86400; + WorldFile.tempPartyManual = false; + WorldFile.tempPartyGenuine = false; + WorldFile.tempPartyCooldown = 0; + WorldFile.tempPartyCelebratingNPCs.Clear(); + WorldFile.Temp_Sandstorm_Happening = false; + WorldFile.Temp_Sandstorm_TimeLeft = 0; + WorldFile.Temp_Sandstorm_Severity = 0.0f; + WorldFile.Temp_Sandstorm_IntendedSeverity = 0.0f; + } + + private static void SetTempToOngoing() + { + WorldFile.tempDayTime = Main.dayTime; + WorldFile.tempTime = Main.time; + WorldFile.tempMoonPhase = Main.moonPhase; + WorldFile.tempBloodMoon = Main.bloodMoon; + WorldFile.tempEclipse = Main.eclipse; + WorldFile.tempCultistDelay = CultistRitual.delay; + WorldFile.tempPartyManual = BirthdayParty.ManualParty; + WorldFile.tempPartyGenuine = BirthdayParty.GenuineParty; + WorldFile.tempPartyCooldown = BirthdayParty.PartyDaysOnCooldown; + WorldFile.tempPartyCelebratingNPCs.Clear(); + WorldFile.tempPartyCelebratingNPCs.AddRange((IEnumerable) BirthdayParty.CelebratingNPCs); + WorldFile.Temp_Sandstorm_Happening = Sandstorm.Happening; + WorldFile.Temp_Sandstorm_TimeLeft = Sandstorm.TimeLeft; + WorldFile.Temp_Sandstorm_Severity = Sandstorm.Severity; + WorldFile.Temp_Sandstorm_IntendedSeverity = Sandstorm.IntendedSeverity; + } + + private static void SetTempToCache() + { + WorldFile.HasCache = false; + WorldFile.tempDayTime = WorldFile.CachedDayTime.Value; + WorldFile.tempTime = WorldFile.CachedTime.Value; + WorldFile.tempMoonPhase = WorldFile.CachedMoonPhase.Value; + WorldFile.tempBloodMoon = WorldFile.CachedBloodMoon.Value; + WorldFile.tempEclipse = WorldFile.CachedEclipse.Value; + WorldFile.tempCultistDelay = WorldFile.CachedCultistDelay.Value; + WorldFile.tempPartyManual = WorldFile.CachedPartyManual.Value; + WorldFile.tempPartyGenuine = WorldFile.CachedPartyGenuine.Value; + WorldFile.tempPartyCooldown = WorldFile.CachedPartyDaysOnCooldown.Value; + WorldFile.tempPartyCelebratingNPCs.Clear(); + WorldFile.tempPartyCelebratingNPCs.AddRange((IEnumerable) WorldFile.CachedCelebratingNPCs); + WorldFile.Temp_Sandstorm_Happening = WorldFile.Cached_Sandstorm_Happening.Value; + WorldFile.Temp_Sandstorm_TimeLeft = WorldFile.Cached_Sandstorm_TimeLeft.Value; + WorldFile.Temp_Sandstorm_Severity = WorldFile.Cached_Sandstorm_Severity.Value; + WorldFile.Temp_Sandstorm_IntendedSeverity = WorldFile.Cached_Sandstorm_IntendedSeverity.Value; } public static void SetOngoingToTemps() { - Main.dayTime = WorldFile._tempDayTime; - Main.time = WorldFile._tempTime; - Main.moonPhase = WorldFile._tempMoonPhase; - Main.bloodMoon = WorldFile._tempBloodMoon; - Main.eclipse = WorldFile._tempEclipse; - Main.raining = WorldFile._tempRaining; - Main.rainTime = WorldFile._tempRainTime; - Main.maxRaining = WorldFile._tempMaxRain; - Main.cloudAlpha = WorldFile._tempMaxRain; - CultistRitual.delay = WorldFile._tempCultistDelay; - BirthdayParty.ManualParty = WorldFile._tempPartyManual; - BirthdayParty.GenuineParty = WorldFile._tempPartyGenuine; - BirthdayParty.PartyDaysOnCooldown = WorldFile._tempPartyCooldown; + Main.dayTime = WorldFile.tempDayTime; + Main.time = WorldFile.tempTime; + Main.moonPhase = WorldFile.tempMoonPhase; + Main.bloodMoon = WorldFile.tempBloodMoon; + Main.eclipse = WorldFile.tempEclipse; + Main.raining = WorldFile.tempRaining; + Main.rainTime = WorldFile.tempRainTime; + Main.maxRaining = WorldFile.tempMaxRain; + Main.cloudAlpha = WorldFile.tempMaxRain; + CultistRitual.delay = WorldFile.tempCultistDelay; + BirthdayParty.ManualParty = WorldFile.tempPartyManual; + BirthdayParty.GenuineParty = WorldFile.tempPartyGenuine; + BirthdayParty.PartyDaysOnCooldown = WorldFile.tempPartyCooldown; BirthdayParty.CelebratingNPCs.Clear(); - BirthdayParty.CelebratingNPCs.AddRange((IEnumerable) WorldFile.TempPartyCelebratingNPCs); - Sandstorm.Happening = WorldFile._tempSandstormHappening; - Sandstorm.TimeLeft = WorldFile._tempSandstormTimeLeft; - Sandstorm.Severity = WorldFile._tempSandstormSeverity; - Sandstorm.IntendedSeverity = WorldFile._tempSandstormIntendedSeverity; - LanternNight.GenuineLanterns = WorldFile._tempLanternNightGenuine; - LanternNight.LanternNightsOnCooldown = WorldFile._tempLanternNightCooldown; - LanternNight.ManualLanterns = WorldFile._tempLanternNightManual; - LanternNight.NextNightIsLanternNight = WorldFile._tempLanternNightNextNightIsGenuine; + BirthdayParty.CelebratingNPCs.AddRange((IEnumerable) WorldFile.tempPartyCelebratingNPCs); + Sandstorm.Happening = WorldFile.Temp_Sandstorm_Happening; + Sandstorm.TimeLeft = WorldFile.Temp_Sandstorm_TimeLeft; + Sandstorm.Severity = WorldFile.Temp_Sandstorm_Severity; + Sandstorm.IntendedSeverity = WorldFile.Temp_Sandstorm_IntendedSeverity; } - public static bool IsValidWorld(string file, bool cloudSave) => WorldFile.GetFileMetadata(file, cloudSave) != null; - - public static WorldFileData GetAllMetadata(string file, bool cloudSave) + public static void loadWorld(bool loadFromCloud) { - if (file == null || cloudSave && SocialAPI.Cloud == null) - return (WorldFileData) null; - WorldFileData worldFileData = new WorldFileData(file, cloudSave); - if (!FileUtilities.Exists(file, cloudSave)) - { - worldFileData.CreationTime = DateTime.Now; - worldFileData.Metadata = FileMetadata.FromCurrentSettings(FileType.World); - return worldFileData; - } - try - { - using (Stream input = cloudSave ? (Stream) new MemoryStream(SocialAPI.Cloud.Read(file)) : (Stream) new FileStream(file, FileMode.Open)) - { - using (BinaryReader reader = new BinaryReader(input)) - { - int num1 = reader.ReadInt32(); - if (num1 >= 135) - worldFileData.Metadata = FileMetadata.Read(reader, FileType.World); - else - worldFileData.Metadata = FileMetadata.FromCurrentSettings(FileType.World); - if (num1 <= 230) - { - int num2 = (int) reader.ReadInt16(); - input.Position = (long) reader.ReadInt32(); - worldFileData.Name = reader.ReadString(); - if (num1 >= 179) - { - string seedText = num1 != 179 ? reader.ReadString() : reader.ReadInt32().ToString(); - worldFileData.SetSeed(seedText); - worldFileData.WorldGeneratorVersion = reader.ReadUInt64(); - } - else - { - worldFileData.SetSeedToEmpty(); - worldFileData.WorldGeneratorVersion = 0UL; - } - worldFileData.UniqueId = num1 < 181 ? Guid.Empty : new Guid(reader.ReadBytes(16)); - reader.ReadInt32(); - reader.ReadInt32(); - reader.ReadInt32(); - reader.ReadInt32(); - reader.ReadInt32(); - int y = reader.ReadInt32(); - int x = reader.ReadInt32(); - worldFileData.SetWorldSize(x, y); - if (num1 >= 209) - { - worldFileData.GameMode = reader.ReadInt32(); - if (num1 >= 222) - { - worldFileData.DrunkWorld = reader.ReadBoolean(); - if (num1 >= 227) - reader.ReadBoolean(); - } - } - else if (num1 >= 112) - worldFileData.GameMode = !reader.ReadBoolean() ? 0 : 1; - worldFileData.CreationTime = num1 < 141 ? (cloudSave ? DateTime.Now : File.GetCreationTime(file)) : DateTime.FromBinary(reader.ReadInt64()); - int num3 = (int) reader.ReadByte(); - reader.ReadInt32(); - reader.ReadInt32(); - reader.ReadInt32(); - reader.ReadInt32(); - reader.ReadInt32(); - reader.ReadInt32(); - reader.ReadInt32(); - reader.ReadInt32(); - reader.ReadInt32(); - reader.ReadInt32(); - reader.ReadInt32(); - reader.ReadInt32(); - reader.ReadInt32(); - reader.ReadInt32(); - reader.ReadInt32(); - reader.ReadInt32(); - reader.ReadInt32(); - reader.ReadInt32(); - reader.ReadInt32(); - reader.ReadDouble(); - reader.ReadDouble(); - reader.ReadDouble(); - reader.ReadBoolean(); - reader.ReadInt32(); - reader.ReadBoolean(); - reader.ReadBoolean(); - reader.ReadInt32(); - reader.ReadInt32(); - worldFileData.HasCrimson = reader.ReadBoolean(); - reader.ReadBoolean(); - reader.ReadBoolean(); - reader.ReadBoolean(); - reader.ReadBoolean(); - reader.ReadBoolean(); - reader.ReadBoolean(); - reader.ReadBoolean(); - reader.ReadBoolean(); - reader.ReadBoolean(); - reader.ReadBoolean(); - int num4 = num1 < 118 ? 0 : (reader.ReadBoolean() ? 1 : 0); - reader.ReadBoolean(); - reader.ReadBoolean(); - reader.ReadBoolean(); - reader.ReadBoolean(); - reader.ReadBoolean(); - reader.ReadBoolean(); - reader.ReadBoolean(); - reader.ReadBoolean(); - reader.ReadBoolean(); - int num5 = (int) reader.ReadByte(); - reader.ReadInt32(); - worldFileData.IsHardMode = reader.ReadBoolean(); - return worldFileData; - } - } - } - } - catch (Exception ex) - { - } - return (WorldFileData) null; - } - - public static WorldFileData CreateMetadata( - string name, - bool cloudSave, - int GameMode) - { - WorldFileData worldFileData = new WorldFileData(Main.GetWorldPathFromName(name, cloudSave), cloudSave); - if (Main.autoGenFileLocation != null && Main.autoGenFileLocation != "") - { - worldFileData = new WorldFileData(Main.autoGenFileLocation, cloudSave); - Main.autoGenFileLocation = (string) null; - } - worldFileData.Name = name; - worldFileData.GameMode = GameMode; - worldFileData.CreationTime = DateTime.Now; - worldFileData.Metadata = FileMetadata.FromCurrentSettings(FileType.World); - worldFileData.SetFavorite(false); - worldFileData.WorldGeneratorVersion = 987842478081UL; - worldFileData.UniqueId = Guid.NewGuid(); - if (Main.DefaultSeed == "") - worldFileData.SetSeedToRandom(); - else - worldFileData.SetSeed(Main.DefaultSeed); - return worldFileData; - } - - public static void ResetTemps() - { - WorldFile._tempRaining = false; - WorldFile._tempMaxRain = 0.0f; - WorldFile._tempRainTime = 0; - WorldFile._tempDayTime = true; - WorldFile._tempBloodMoon = false; - WorldFile._tempEclipse = false; - WorldFile._tempMoonPhase = 0; - Main.anglerWhoFinishedToday.Clear(); - Main.anglerQuestFinished = false; - } - - private static void ClearTempTiles() - { - for (int i = 0; i < Main.maxTilesX; ++i) - { - for (int j = 0; j < Main.maxTilesY; ++j) - { - if (Main.tile[i, j].type == (ushort) sbyte.MaxValue || Main.tile[i, j].type == (ushort) 504) - WorldGen.KillTile(i, j); - } - } - } - - public static void LoadWorld(bool loadFromCloud) - { - Main.lockMenuBGChange = true; - WorldFile._isWorldOnCloud = loadFromCloud; + WorldFile.IsWorldOnCloud = loadFromCloud; Main.checkXMas(); Main.checkHalloween(); bool flag = loadFromCloud && SocialAPI.Cloud != null; @@ -314,20 +174,20 @@ namespace Terraria.IO { if (Main.worldPathName.Substring(index, 1) == (Path.DirectorySeparatorChar.ToString() ?? "")) { - Utils.TryCreatingDirectory(Main.worldPathName.Substring(0, index)); + Directory.CreateDirectory(Main.worldPathName.Substring(0, index)); break; } } } WorldGen.clearWorld(); - Main.ActiveWorldFileData = WorldFile.CreateMetadata(Main.worldName == "" ? "World" : Main.worldName, flag, Main.GameMode); + Main.ActiveWorldFileData = WorldFile.CreateMetadata(Main.worldName == "" ? "World" : Main.worldName, flag, Main.expertMode); string seedText = (Main.AutogenSeedName ?? "").Trim(); if (seedText.Length == 0) Main.ActiveWorldFileData.SetSeedToRandom(); else Main.ActiveWorldFileData.SetSeed(seedText); - WorldGen.GenerateWorld(Main.ActiveWorldFileData.Seed, Main.AutogenProgress); - WorldFile.SaveWorld(); + WorldGen.generateWorld(Main.ActiveWorldFileData.Seed, Main.AutogenProgress); + WorldFile.saveWorld(); } using (MemoryStream memoryStream = new MemoryStream(FileUtilities.ReadAllBytes(Main.worldPathName, flag))) { @@ -337,17 +197,11 @@ namespace Terraria.IO { WorldGen.loadFailed = false; WorldGen.loadSuccess = false; - int num1 = binaryReader.ReadInt32(); - WorldFile._versionNumber = num1; - if (WorldFile._versionNumber <= 0 || WorldFile._versionNumber > 230) - { - WorldGen.loadFailed = true; - return; - } - int num2 = num1 > 87 ? WorldFile.LoadWorld_Version2(binaryReader) : WorldFile.LoadWorld_Version1_Old_BeforeRelease88(binaryReader); + int num1; + WorldFile.versionNumber = num1 = binaryReader.ReadInt32(); + int num2 = num1 > 87 ? WorldFile.LoadWorld_Version2(binaryReader) : WorldFile.LoadWorld_Version1(binaryReader); if (num1 < 141) Main.ActiveWorldFileData.CreationTime = loadFromCloud ? DateTime.Now : File.GetCreationTime(Main.worldPathName); - WorldFile.CheckSavedOreTiers(); binaryReader.Close(); memoryStream.Close(); if (num2 != 0) @@ -356,8 +210,6 @@ namespace Terraria.IO WorldGen.loadSuccess = true; if (WorldGen.loadFailed || !WorldGen.loadSuccess) return; - WorldFile.ConvertOldTileEntities(); - WorldFile.ClearTempTiles(); WorldGen.gen = true; WorldGen.waterLine = Main.maxTilesY; Liquid.QuickWater(2); @@ -385,13 +237,13 @@ namespace Terraria.IO WorldGen.WaterCheck(); WorldGen.gen = false; NPC.setFireFlyChance(); + Main.InitLifeBytes(); if (Main.slimeRainTime > 0.0) Main.StartSlimeRain(false); - NPC.SetWorldSpecificMonstersByWorldID(); + NPC.setWorldMonsters(); } - catch (Exception ex) + catch { - WorldFile.LastThrownLoadException = ex; WorldGen.loadFailed = true; WorldGen.loadSuccess = false; try @@ -412,1841 +264,84 @@ namespace Terraria.IO WorldFile.OnWorldLoad(); } - public static void CheckSavedOreTiers() - { - if (WorldGen.SavedOreTiers.Copper != -1 && WorldGen.SavedOreTiers.Iron != -1 && WorldGen.SavedOreTiers.Silver != -1 && WorldGen.SavedOreTiers.Gold != -1) - return; - int[] numArray = WorldGen.CountTileTypesInWorld(7, 166, 6, 167, 9, 168, 8, 169); - for (int index = 0; index < numArray.Length; index += 2) - { - int num1 = numArray[index]; - int num2 = numArray[index + 1]; - switch (index) - { - case 0: - WorldGen.SavedOreTiers.Copper = num1 <= num2 ? 166 : 7; - break; - case 2: - WorldGen.SavedOreTiers.Iron = num1 <= num2 ? 167 : 6; - break; - case 4: - WorldGen.SavedOreTiers.Silver = num1 <= num2 ? 168 : 9; - break; - case 6: - WorldGen.SavedOreTiers.Gold = num1 <= num2 ? 169 : 8; - break; - } - } - } + public static void saveWorld() => WorldFile.saveWorld(WorldFile.IsWorldOnCloud); - public static void SaveWorld() - { - try - { - WorldFile.SaveWorld(WorldFile._isWorldOnCloud); - } - catch (Exception ex) - { - string worldPath = Main.WorldPath; - FancyErrorPrinter.ShowFileSavingFailError(ex, worldPath); - throw; - } - } - - public static void SaveWorld(bool useCloudSaving, bool resetTime = false) + public static void saveWorld(bool useCloudSaving, bool resetTime = false) { if (useCloudSaving && SocialAPI.Cloud == null) return; if (Main.worldName == "") Main.worldName = "World"; + if (WorldGen.saveLock) + return; + WorldGen.saveLock = true; while (WorldGen.IsGeneratingHardMode) Main.statusText = Lang.gen[48].Value; - if (!Monitor.TryEnter(WorldFile.IOLock)) - return; - try - { - FileUtilities.ProtectedInvoke((Action) (() => WorldFile.InternalSaveWorld(useCloudSaving, resetTime))); - } - finally - { - Monitor.Exit(WorldFile.IOLock); - } - } - - private static void InternalSaveWorld(bool useCloudSaving, bool resetTime) - { - Utils.TryCreatingDirectory(Main.WorldPath); - if (Main.skipMenu) - return; - if (WorldFile._hasCache) - WorldFile.SetTempToCache(); - else - WorldFile.SetTempToOngoing(); - if (resetTime) - WorldFile.ResetTempsToDayTime(); - if (Main.worldPathName == null) - return; - new Stopwatch().Start(); - byte[] array; - int length; - using (MemoryStream memoryStream = new MemoryStream(7000000)) - { - using (BinaryWriter writer = new BinaryWriter((Stream) memoryStream)) - WorldFile.SaveWorld_Version2(writer); - array = memoryStream.ToArray(); - length = array.Length; - } - byte[] data = (byte[]) null; - if (FileUtilities.Exists(Main.worldPathName, useCloudSaving)) - data = FileUtilities.ReadAllBytes(Main.worldPathName, useCloudSaving); - FileUtilities.Write(Main.worldPathName, array, length, useCloudSaving); - byte[] buffer = FileUtilities.ReadAllBytes(Main.worldPathName, useCloudSaving); - string str = (string) null; - using (MemoryStream memoryStream = new MemoryStream(buffer, 0, length, false)) - { - using (BinaryReader fileIO = new BinaryReader((Stream) memoryStream)) - { - if (!Main.validateSaves || WorldFile.ValidateWorld(fileIO)) - { - if (data != null) - { - str = Main.worldPathName + ".bak"; - Main.statusText = Lang.gen[50].Value; - } - WorldFile.DoRollingBackups(str); - } - else - str = Main.worldPathName; - } - } - if (str == null || data == null) - return; - FileUtilities.WriteAllBytes(str, data, useCloudSaving); - } - - private static void DoRollingBackups(string backupWorldWritePath) - { - if (Main.WorldRollingBackupsCountToKeep <= 1) - return; - int num1 = Main.WorldRollingBackupsCountToKeep; - if (num1 > 9) - num1 = 9; - int num2 = 1; - for (int index = 1; index < num1; ++index) - { - string path = backupWorldWritePath + (object) index; - if (index == 1) - path = backupWorldWritePath; - if (FileUtilities.Exists(path, false)) - num2 = index + 1; - else - break; - } - for (int index = num2 - 1; index > 0; --index) - { - string str = backupWorldWritePath + (object) index; - if (index == 1) - str = backupWorldWritePath; - string destination = backupWorldWritePath + (object) (index + 1); - if (FileUtilities.Exists(str, false)) - FileUtilities.Move(str, destination, false); - } - } - - private static void ResetTempsToDayTime() - { - WorldFile._tempDayTime = true; - WorldFile._tempTime = 13500.0; - WorldFile._tempMoonPhase = 0; - WorldFile._tempBloodMoon = false; - WorldFile._tempEclipse = false; - WorldFile._tempCultistDelay = 86400; - WorldFile._tempPartyManual = false; - WorldFile._tempPartyGenuine = false; - WorldFile._tempPartyCooldown = 0; - WorldFile.TempPartyCelebratingNPCs.Clear(); - WorldFile._tempSandstormHappening = false; - WorldFile._tempSandstormTimeLeft = 0; - WorldFile._tempSandstormSeverity = 0.0f; - WorldFile._tempSandstormIntendedSeverity = 0.0f; - WorldFile._tempLanternNightCooldown = 0; - WorldFile._tempLanternNightGenuine = false; - WorldFile._tempLanternNightManual = false; - WorldFile._tempLanternNightNextNightIsGenuine = false; - } - - private static void SetTempToOngoing() - { - WorldFile._tempDayTime = Main.dayTime; - WorldFile._tempTime = Main.time; - WorldFile._tempMoonPhase = Main.moonPhase; - WorldFile._tempBloodMoon = Main.bloodMoon; - WorldFile._tempEclipse = Main.eclipse; - WorldFile._tempCultistDelay = CultistRitual.delay; - WorldFile._tempPartyManual = BirthdayParty.ManualParty; - WorldFile._tempPartyGenuine = BirthdayParty.GenuineParty; - WorldFile._tempPartyCooldown = BirthdayParty.PartyDaysOnCooldown; - WorldFile.TempPartyCelebratingNPCs.Clear(); - WorldFile.TempPartyCelebratingNPCs.AddRange((IEnumerable) BirthdayParty.CelebratingNPCs); - WorldFile._tempSandstormHappening = Sandstorm.Happening; - WorldFile._tempSandstormTimeLeft = Sandstorm.TimeLeft; - WorldFile._tempSandstormSeverity = Sandstorm.Severity; - WorldFile._tempSandstormIntendedSeverity = Sandstorm.IntendedSeverity; - WorldFile._tempRaining = Main.raining; - WorldFile._tempRainTime = Main.rainTime; - WorldFile._tempMaxRain = Main.maxRaining; - WorldFile._tempLanternNightCooldown = LanternNight.LanternNightsOnCooldown; - WorldFile._tempLanternNightGenuine = LanternNight.GenuineLanterns; - WorldFile._tempLanternNightManual = LanternNight.ManualLanterns; - WorldFile._tempLanternNightNextNightIsGenuine = LanternNight.NextNightIsLanternNight; - } - - private static void SetTempToCache() - { - WorldFile._hasCache = false; - WorldFile._tempDayTime = WorldFile._cachedDayTime.Value; - WorldFile._tempTime = WorldFile._cachedTime.Value; - WorldFile._tempMoonPhase = WorldFile._cachedMoonPhase.Value; - WorldFile._tempBloodMoon = WorldFile._cachedBloodMoon.Value; - WorldFile._tempEclipse = WorldFile._cachedEclipse.Value; - WorldFile._tempCultistDelay = WorldFile._cachedCultistDelay.Value; - WorldFile._tempPartyManual = WorldFile._cachedPartyManual.Value; - WorldFile._tempPartyGenuine = WorldFile._cachedPartyGenuine.Value; - WorldFile._tempPartyCooldown = WorldFile._cachedPartyDaysOnCooldown.Value; - WorldFile.TempPartyCelebratingNPCs.Clear(); - WorldFile.TempPartyCelebratingNPCs.AddRange((IEnumerable) WorldFile.CachedCelebratingNPCs); - WorldFile._tempSandstormHappening = WorldFile._cachedSandstormHappening.Value; - WorldFile._tempSandstormTimeLeft = WorldFile._cachedSandstormTimeLeft.Value; - WorldFile._tempSandstormSeverity = WorldFile._cachedSandstormSeverity.Value; - WorldFile._tempSandstormIntendedSeverity = WorldFile._cachedSandstormIntendedSeverity.Value; - WorldFile._tempRaining = Main.raining; - WorldFile._tempRainTime = Main.rainTime; - WorldFile._tempMaxRain = Main.maxRaining; - WorldFile._tempLanternNightCooldown = WorldFile._cachedLanternNightCooldown.Value; - WorldFile._tempLanternNightGenuine = WorldFile._cachedLanternNightGenuine.Value; - WorldFile._tempLanternNightManual = WorldFile._cachedLanternNightManual.Value; - WorldFile._tempLanternNightNextNightIsGenuine = WorldFile._cachedLanternNightNextNightIsGenuine.Value; - } - - private static void ConvertOldTileEntities() - { - List pointList1 = new List(); - List pointList2 = new List(); - for (int x = 0; x < Main.maxTilesX; ++x) - { - for (int y = 0; y < Main.maxTilesY; ++y) - { - Tile tile = Main.tile[x, y]; - if ((tile.type == (ushort) 128 || tile.type == (ushort) 269) && tile.frameY == (short) 0 && ((int) tile.frameX % 100 == 0 || (int) tile.frameX % 100 == 36)) - pointList1.Add(new Point(x, y)); - if (tile.type == (ushort) 334 && tile.frameY == (short) 0 && (int) tile.frameX % 54 == 0) - pointList2.Add(new Point(x, y)); - if (tile.type == (ushort) 49 && (tile.frameX == (short) -1 || tile.frameY == (short) -1)) - { - tile.frameX = (short) 0; - tile.frameY = (short) 0; - } - } - } - foreach (Point point in pointList1) - { - if (WorldGen.InWorld(point.X, point.Y, 5)) - { - int frameX1 = (int) Main.tile[point.X, point.Y].frameX; - int frameX2 = (int) Main.tile[point.X, point.Y + 1].frameX; - int frameX3 = (int) Main.tile[point.X, point.Y + 2].frameX; - for (int index1 = 0; index1 < 2; ++index1) - { - for (int index2 = 0; index2 < 3; ++index2) - { - Tile tile = Main.tile[point.X + index1, point.Y + index2]; - tile.frameX %= (short) 100; - if (tile.type == (ushort) 269) - tile.frameX += (short) 72; - tile.type = (ushort) 470; - } - } - int key = TEDisplayDoll.Place(point.X, point.Y); - if (key != -1) - (TileEntity.ByID[key] as TEDisplayDoll).SetInventoryFromMannequin(frameX1, frameX2, frameX3); - } - } - foreach (Point point in pointList2) - { - if (WorldGen.InWorld(point.X, point.Y, 5)) - { - bool flag1 = Main.tile[point.X, point.Y].frameX >= (short) 54; - int frameX4 = (int) Main.tile[point.X, point.Y + 1].frameX; - int frameX5 = (int) Main.tile[point.X + 1, point.Y + 1].frameX; - bool flag2 = frameX4 >= 5000; - int netid = frameX4 % 5000 - 100; - int prefix = frameX5 - (frameX5 >= 25000 ? 25000 : 10000); - for (int index3 = 0; index3 < 3; ++index3) - { - for (int index4 = 0; index4 < 3; ++index4) - { - Tile tile = Main.tile[point.X + index3, point.Y + index4]; - tile.type = (ushort) 471; - tile.frameX = (short) ((flag1 ? 54 : 0) + index3 * 18); - tile.frameY = (short) (index4 * 18); - } - } - if (TEWeaponsRack.Place(point.X, point.Y) != -1 & flag2) - TEWeaponsRack.TryPlacing(point.X, point.Y, netid, prefix, 1); - } - } - } - - private static void SaveWorld_Version2(BinaryWriter writer) - { - int[] pointers = new int[11] - { - WorldFile.SaveFileFormatHeader(writer), - WorldFile.SaveWorldHeader(writer), - WorldFile.SaveWorldTiles(writer), - WorldFile.SaveChests(writer), - WorldFile.SaveSigns(writer), - WorldFile.SaveNPCs(writer), - WorldFile.SaveTileEntities(writer), - WorldFile.SaveWeightedPressurePlates(writer), - WorldFile.SaveTownManager(writer), - WorldFile.SaveBestiary(writer), - WorldFile.SaveCreativePowers(writer) - }; - WorldFile.SaveFooter(writer); - WorldFile.SaveHeaderPointers(writer, pointers); - } - - private static int SaveFileFormatHeader(BinaryWriter writer) - { - short num1 = 623; - short num2 = 11; - writer.Write(230); - Main.WorldFileMetadata.IncrementAndWrite(writer); - writer.Write(num2); - for (int index = 0; index < (int) num2; ++index) - writer.Write(0); - writer.Write(num1); - byte num3 = 0; - byte num4 = 1; - for (int index = 0; index < (int) num1; ++index) - { - if (Main.tileFrameImportant[index]) - num3 |= num4; - if (num4 == (byte) 128) - { - writer.Write(num3); - num3 = (byte) 0; - num4 = (byte) 1; - } - else - num4 <<= 1; - } - if (num4 != (byte) 1) - writer.Write(num3); - return (int) writer.BaseStream.Position; - } - - private static int SaveHeaderPointers(BinaryWriter writer, int[] pointers) - { - writer.BaseStream.Position = 0L; - writer.Write(230); - writer.BaseStream.Position += 20L; - writer.Write((short) pointers.Length); - for (int index = 0; index < pointers.Length; ++index) - writer.Write(pointers[index]); - return (int) writer.BaseStream.Position; - } - - private static int SaveWorldHeader(BinaryWriter writer) - { - writer.Write(Main.worldName); - writer.Write(Main.ActiveWorldFileData.SeedText); - writer.Write(Main.ActiveWorldFileData.WorldGeneratorVersion); - writer.Write(Main.ActiveWorldFileData.UniqueId.ToByteArray()); - writer.Write(Main.worldID); - writer.Write((int) Main.leftWorld); - writer.Write((int) Main.rightWorld); - writer.Write((int) Main.topWorld); - writer.Write((int) Main.bottomWorld); - writer.Write(Main.maxTilesY); - writer.Write(Main.maxTilesX); - writer.Write(Main.GameMode); - writer.Write(Main.drunkWorld); - writer.Write(Main.getGoodWorld); - writer.Write(Main.ActiveWorldFileData.CreationTime.ToBinary()); - writer.Write((byte) Main.moonType); - writer.Write(Main.treeX[0]); - writer.Write(Main.treeX[1]); - writer.Write(Main.treeX[2]); - writer.Write(Main.treeStyle[0]); - writer.Write(Main.treeStyle[1]); - writer.Write(Main.treeStyle[2]); - writer.Write(Main.treeStyle[3]); - writer.Write(Main.caveBackX[0]); - writer.Write(Main.caveBackX[1]); - writer.Write(Main.caveBackX[2]); - writer.Write(Main.caveBackStyle[0]); - writer.Write(Main.caveBackStyle[1]); - writer.Write(Main.caveBackStyle[2]); - writer.Write(Main.caveBackStyle[3]); - writer.Write(Main.iceBackStyle); - writer.Write(Main.jungleBackStyle); - writer.Write(Main.hellBackStyle); - writer.Write(Main.spawnTileX); - writer.Write(Main.spawnTileY); - writer.Write(Main.worldSurface); - writer.Write(Main.rockLayer); - writer.Write(WorldFile._tempTime); - writer.Write(WorldFile._tempDayTime); - writer.Write(WorldFile._tempMoonPhase); - writer.Write(WorldFile._tempBloodMoon); - writer.Write(WorldFile._tempEclipse); - writer.Write(Main.dungeonX); - writer.Write(Main.dungeonY); - writer.Write(WorldGen.crimson); - writer.Write(NPC.downedBoss1); - writer.Write(NPC.downedBoss2); - writer.Write(NPC.downedBoss3); - writer.Write(NPC.downedQueenBee); - writer.Write(NPC.downedMechBoss1); - writer.Write(NPC.downedMechBoss2); - writer.Write(NPC.downedMechBoss3); - writer.Write(NPC.downedMechBossAny); - writer.Write(NPC.downedPlantBoss); - writer.Write(NPC.downedGolemBoss); - writer.Write(NPC.downedSlimeKing); - writer.Write(NPC.savedGoblin); - writer.Write(NPC.savedWizard); - writer.Write(NPC.savedMech); - writer.Write(NPC.downedGoblins); - writer.Write(NPC.downedClown); - writer.Write(NPC.downedFrost); - writer.Write(NPC.downedPirates); - writer.Write(WorldGen.shadowOrbSmashed); - writer.Write(WorldGen.spawnMeteor); - writer.Write((byte) WorldGen.shadowOrbCount); - writer.Write(WorldGen.altarCount); - writer.Write(Main.hardMode); - writer.Write(Main.invasionDelay); - writer.Write(Main.invasionSize); - writer.Write(Main.invasionType); - writer.Write(Main.invasionX); - writer.Write(Main.slimeRainTime); - writer.Write((byte) Main.sundialCooldown); - writer.Write(WorldFile._tempRaining); - writer.Write(WorldFile._tempRainTime); - writer.Write(WorldFile._tempMaxRain); - writer.Write(WorldGen.SavedOreTiers.Cobalt); - writer.Write(WorldGen.SavedOreTiers.Mythril); - writer.Write(WorldGen.SavedOreTiers.Adamantite); - writer.Write((byte) WorldGen.treeBG1); - writer.Write((byte) WorldGen.corruptBG); - writer.Write((byte) WorldGen.jungleBG); - writer.Write((byte) WorldGen.snowBG); - writer.Write((byte) WorldGen.hallowBG); - writer.Write((byte) WorldGen.crimsonBG); - writer.Write((byte) WorldGen.desertBG); - writer.Write((byte) WorldGen.oceanBG); - writer.Write((int) Main.cloudBGActive); - writer.Write((short) Main.numClouds); - writer.Write(Main.windSpeedTarget); - writer.Write(Main.anglerWhoFinishedToday.Count); - for (int index = 0; index < Main.anglerWhoFinishedToday.Count; ++index) - writer.Write(Main.anglerWhoFinishedToday[index]); - writer.Write(NPC.savedAngler); - writer.Write(Main.anglerQuest); - writer.Write(NPC.savedStylist); - writer.Write(NPC.savedTaxCollector); - writer.Write(NPC.savedGolfer); - writer.Write(Main.invasionSizeStart); - writer.Write(WorldFile._tempCultistDelay); - writer.Write((short) 663); - for (int index = 0; index < 663; ++index) - writer.Write(NPC.killCount[index]); - writer.Write(Main.fastForwardTime); - writer.Write(NPC.downedFishron); - writer.Write(NPC.downedMartians); - writer.Write(NPC.downedAncientCultist); - writer.Write(NPC.downedMoonlord); - writer.Write(NPC.downedHalloweenKing); - writer.Write(NPC.downedHalloweenTree); - writer.Write(NPC.downedChristmasIceQueen); - writer.Write(NPC.downedChristmasSantank); - writer.Write(NPC.downedChristmasTree); - writer.Write(NPC.downedTowerSolar); - writer.Write(NPC.downedTowerVortex); - writer.Write(NPC.downedTowerNebula); - writer.Write(NPC.downedTowerStardust); - writer.Write(NPC.TowerActiveSolar); - writer.Write(NPC.TowerActiveVortex); - writer.Write(NPC.TowerActiveNebula); - writer.Write(NPC.TowerActiveStardust); - writer.Write(NPC.LunarApocalypseIsUp); - writer.Write(WorldFile._tempPartyManual); - writer.Write(WorldFile._tempPartyGenuine); - writer.Write(WorldFile._tempPartyCooldown); - writer.Write(WorldFile.TempPartyCelebratingNPCs.Count); - for (int index = 0; index < WorldFile.TempPartyCelebratingNPCs.Count; ++index) - writer.Write(WorldFile.TempPartyCelebratingNPCs[index]); - writer.Write(WorldFile._tempSandstormHappening); - writer.Write(WorldFile._tempSandstormTimeLeft); - writer.Write(WorldFile._tempSandstormSeverity); - writer.Write(WorldFile._tempSandstormIntendedSeverity); - writer.Write(NPC.savedBartender); - DD2Event.Save(writer); - writer.Write((byte) WorldGen.mushroomBG); - writer.Write((byte) WorldGen.underworldBG); - writer.Write((byte) WorldGen.treeBG2); - writer.Write((byte) WorldGen.treeBG3); - writer.Write((byte) WorldGen.treeBG4); - writer.Write(NPC.combatBookWasUsed); - writer.Write(WorldFile._tempLanternNightCooldown); - writer.Write(WorldFile._tempLanternNightGenuine); - writer.Write(WorldFile._tempLanternNightManual); - writer.Write(WorldFile._tempLanternNightNextNightIsGenuine); - WorldGen.TreeTops.Save(writer); - writer.Write(Main.forceHalloweenForToday); - writer.Write(Main.forceXMasForToday); - writer.Write(WorldGen.SavedOreTiers.Copper); - writer.Write(WorldGen.SavedOreTiers.Iron); - writer.Write(WorldGen.SavedOreTiers.Silver); - writer.Write(WorldGen.SavedOreTiers.Gold); - writer.Write(NPC.boughtCat); - writer.Write(NPC.boughtDog); - writer.Write(NPC.boughtBunny); - writer.Write(NPC.downedEmpressOfLight); - writer.Write(NPC.downedQueenSlime); - return (int) writer.BaseStream.Position; - } - - private static int SaveWorldTiles(BinaryWriter writer) - { - byte[] buffer = new byte[15]; - for (int index1 = 0; index1 < Main.maxTilesX; ++index1) - { - float num1 = (float) index1 / (float) Main.maxTilesX; - Main.statusText = Lang.gen[49].Value + " " + (object) (int) ((double) num1 * 100.0 + 1.0) + "%"; - int num2; - for (int index2 = 0; index2 < Main.maxTilesY; index2 = num2 + 1) - { - Tile tile = Main.tile[index1, index2]; - int index3 = 3; - int num3; - byte num4 = (byte) (num3 = 0); - byte num5 = (byte) num3; - byte num6 = (byte) num3; - bool flag = false; - if (tile.active()) - flag = true; - if (flag) - { - num6 |= (byte) 2; - buffer[index3] = (byte) tile.type; - ++index3; - if (tile.type > (ushort) byte.MaxValue) - { - buffer[index3] = (byte) ((uint) tile.type >> 8); - ++index3; - num6 |= (byte) 32; - } - if (Main.tileFrameImportant[(int) tile.type]) - { - buffer[index3] = (byte) ((uint) tile.frameX & (uint) byte.MaxValue); - int index4 = index3 + 1; - buffer[index4] = (byte) (((int) tile.frameX & 65280) >> 8); - int index5 = index4 + 1; - buffer[index5] = (byte) ((uint) tile.frameY & (uint) byte.MaxValue); - int index6 = index5 + 1; - buffer[index6] = (byte) (((int) tile.frameY & 65280) >> 8); - index3 = index6 + 1; - } - if (tile.color() != (byte) 0) - { - num4 |= (byte) 8; - buffer[index3] = tile.color(); - ++index3; - } - } - if (tile.wall != (ushort) 0) - { - num6 |= (byte) 4; - buffer[index3] = (byte) tile.wall; - ++index3; - if (tile.wallColor() != (byte) 0) - { - num4 |= (byte) 16; - buffer[index3] = tile.wallColor(); - ++index3; - } - } - if (tile.liquid != (byte) 0) - { - if (tile.lava()) - num6 |= (byte) 16; - else if (tile.honey()) - num6 |= (byte) 24; - else - num6 |= (byte) 8; - buffer[index3] = tile.liquid; - ++index3; - } - if (tile.wire()) - num5 |= (byte) 2; - if (tile.wire2()) - num5 |= (byte) 4; - if (tile.wire3()) - num5 |= (byte) 8; - int num7 = !tile.halfBrick() ? (tile.slope() == (byte) 0 ? 0 : (int) tile.slope() + 1 << 4) : 16; - byte num8 = (byte) ((uint) num5 | (uint) (byte) num7); - if (tile.actuator()) - num4 |= (byte) 2; - if (tile.inActive()) - num4 |= (byte) 4; - if (tile.wire4()) - num4 |= (byte) 32; - if (tile.wall > (ushort) byte.MaxValue) - { - buffer[index3] = (byte) ((uint) tile.wall >> 8); - ++index3; - num4 |= (byte) 64; - } - int index7 = 2; - if (num4 != (byte) 0) - { - num8 |= (byte) 1; - buffer[index7] = num4; - --index7; - } - if (num8 != (byte) 0) - { - num6 |= (byte) 1; - buffer[index7] = num8; - --index7; - } - short num9 = 0; - int index8 = index2 + 1; - for (int index9 = Main.maxTilesY - index2 - 1; index9 > 0 && tile.isTheSameAs(Main.tile[index1, index8]); ++index8) - { - ++num9; - --index9; - } - num2 = index2 + (int) num9; - if (num9 > (short) 0) - { - buffer[index3] = (byte) ((uint) num9 & (uint) byte.MaxValue); - ++index3; - if (num9 > (short) byte.MaxValue) - { - num6 |= (byte) 128; - buffer[index3] = (byte) (((int) num9 & 65280) >> 8); - ++index3; - } - else - num6 |= (byte) 64; - } - buffer[index7] = num6; - writer.Write(buffer, index7, index3 - index7); - } - } - return (int) writer.BaseStream.Position; - } - - private static int SaveChests(BinaryWriter writer) - { - short num = 0; - for (int index = 0; index < 8000; ++index) - { - Chest chest = Main.chest[index]; - if (chest != null) - { - bool flag = false; - for (int x = chest.x; x <= chest.x + 1; ++x) - { - for (int y = chest.y; y <= chest.y + 1; ++y) - { - if (x < 0 || y < 0 || x >= Main.maxTilesX || y >= Main.maxTilesY) - { - flag = true; - break; - } - Tile tile = Main.tile[x, y]; - if (!tile.active() || !Main.tileContainer[(int) tile.type]) - { - flag = true; - break; - } - } - } - if (flag) - Main.chest[index] = (Chest) null; - else - ++num; - } - } - writer.Write(num); - writer.Write((short) 40); - for (int index1 = 0; index1 < 8000; ++index1) - { - Chest chest = Main.chest[index1]; - if (chest != null) - { - writer.Write(chest.x); - writer.Write(chest.y); - writer.Write(chest.name); - for (int index2 = 0; index2 < 40; ++index2) - { - Item obj = chest.item[index2]; - if (obj == null) - { - writer.Write((short) 0); - } - else - { - if (obj.stack > obj.maxStack) - obj.stack = obj.maxStack; - if (obj.stack < 0) - obj.stack = 1; - writer.Write((short) obj.stack); - if (obj.stack > 0) - { - writer.Write(obj.netID); - writer.Write(obj.prefix); - } - } - } - } - } - return (int) writer.BaseStream.Position; - } - - private static int SaveSigns(BinaryWriter writer) - { - short num = 0; - for (int index = 0; index < 1000; ++index) - { - Sign sign = Main.sign[index]; - if (sign != null && sign.text != null) - ++num; - } - writer.Write(num); - for (int index = 0; index < 1000; ++index) - { - Sign sign = Main.sign[index]; - if (sign != null && sign.text != null) - { - writer.Write(sign.text); - writer.Write(sign.x); - writer.Write(sign.y); - } - } - return (int) writer.BaseStream.Position; - } - - private static int SaveNPCs(BinaryWriter writer) - { - for (int index = 0; index < Main.npc.Length; ++index) - { - NPC npc = Main.npc[index]; - if (npc.active && npc.townNPC && npc.type != 368) - { - writer.Write(npc.active); - writer.Write(npc.netID); - writer.Write(npc.GivenName); - writer.Write(npc.position.X); - writer.Write(npc.position.Y); - writer.Write(npc.homeless); - writer.Write(npc.homeTileX); - writer.Write(npc.homeTileY); - BitsByte bitsByte = (BitsByte) (byte) 0; - bitsByte[0] = npc.townNPC; - writer.Write((byte) bitsByte); - if (bitsByte[0]) - writer.Write(npc.townNpcVariationIndex); - } - } - writer.Write(false); - for (int index = 0; index < Main.npc.Length; ++index) - { - NPC npc = Main.npc[index]; - if (npc.active && NPCID.Sets.SavesAndLoads[npc.type]) - { - writer.Write(npc.active); - writer.Write(npc.netID); - writer.WriteVector2(npc.position); - } - } - writer.Write(false); - return (int) writer.BaseStream.Position; - } - - private static int SaveFooter(BinaryWriter writer) - { - writer.Write(true); - writer.Write(Main.worldName); - writer.Write(Main.worldID); - return (int) writer.BaseStream.Position; - } - - private static int LoadWorld_Version2(BinaryReader reader) - { - reader.BaseStream.Position = 0L; - bool[] importance; - int[] positions; - if (!WorldFile.LoadFileFormatHeader(reader, out importance, out positions) || reader.BaseStream.Position != (long) positions[0]) - return 5; - WorldFile.LoadHeader(reader); - if (reader.BaseStream.Position != (long) positions[1]) - return 5; - WorldFile.LoadWorldTiles(reader, importance); - if (reader.BaseStream.Position != (long) positions[2]) - return 5; - WorldFile.LoadChests(reader); - if (reader.BaseStream.Position != (long) positions[3]) - return 5; - WorldFile.LoadSigns(reader); - if (reader.BaseStream.Position != (long) positions[4]) - return 5; - WorldFile.LoadNPCs(reader); - if (reader.BaseStream.Position != (long) positions[5]) - return 5; - if (WorldFile._versionNumber >= 116) - { - if (WorldFile._versionNumber < 122) - { - WorldFile.LoadDummies(reader); - if (reader.BaseStream.Position != (long) positions[6]) - return 5; - } - else - { - WorldFile.LoadTileEntities(reader); - if (reader.BaseStream.Position != (long) positions[6]) - return 5; - } - } - if (WorldFile._versionNumber >= 170) - { - WorldFile.LoadWeightedPressurePlates(reader); - if (reader.BaseStream.Position != (long) positions[7]) - return 5; - } - if (WorldFile._versionNumber >= 189) - { - WorldFile.LoadTownManager(reader); - if (reader.BaseStream.Position != (long) positions[8]) - return 5; - } - if (WorldFile._versionNumber >= 210) - { - WorldFile.LoadBestiary(reader, WorldFile._versionNumber); - if (reader.BaseStream.Position != (long) positions[9]) - return 5; - } - else - WorldFile.LoadBestiaryForVersionsBefore210(); - if (WorldFile._versionNumber >= 220) - { - WorldFile.LoadCreativePowers(reader, WorldFile._versionNumber); - if (reader.BaseStream.Position != (long) positions[10]) - return 5; - } - return WorldFile.LoadFooter(reader); - } - - private static bool LoadFileFormatHeader( - BinaryReader reader, - out bool[] importance, - out int[] positions) - { - importance = (bool[]) null; - positions = (int[]) null; - if ((WorldFile._versionNumber = reader.ReadInt32()) >= 135) + lock (WorldFile.padlock) { try { - Main.WorldFileMetadata = FileMetadata.Read(reader, FileType.World); + Directory.CreateDirectory(Main.WorldPath); } - catch (FileFormatException ex) + catch { - Console.WriteLine(Language.GetTextValue("Error.UnableToLoadWorld")); - Console.WriteLine((object) ex); - return false; - } - } - else - Main.WorldFileMetadata = FileMetadata.FromCurrentSettings(FileType.World); - short num1 = reader.ReadInt16(); - positions = new int[(int) num1]; - for (int index = 0; index < (int) num1; ++index) - positions[index] = reader.ReadInt32(); - short num2 = reader.ReadInt16(); - importance = new bool[(int) num2]; - byte num3 = 0; - byte num4 = 128; - for (int index = 0; index < (int) num2; ++index) - { - if (num4 == (byte) 128) - { - num3 = reader.ReadByte(); - num4 = (byte) 1; } + if (Main.skipMenu) + return; + if (WorldFile.HasCache) + WorldFile.SetTempToCache(); else - num4 <<= 1; - if (((int) num3 & (int) num4) == (int) num4) - importance[index] = true; - } - return true; - } - - private static void LoadHeader(BinaryReader reader) - { - int versionNumber = WorldFile._versionNumber; - Main.worldName = reader.ReadString(); - if (versionNumber >= 179) - { - string seedText = versionNumber != 179 ? reader.ReadString() : reader.ReadInt32().ToString(); - Main.ActiveWorldFileData.SetSeed(seedText); - Main.ActiveWorldFileData.WorldGeneratorVersion = reader.ReadUInt64(); - } - Main.ActiveWorldFileData.UniqueId = versionNumber < 181 ? Guid.NewGuid() : new Guid(reader.ReadBytes(16)); - Main.worldID = reader.ReadInt32(); - Main.leftWorld = (float) reader.ReadInt32(); - Main.rightWorld = (float) reader.ReadInt32(); - Main.topWorld = (float) reader.ReadInt32(); - Main.bottomWorld = (float) reader.ReadInt32(); - Main.maxTilesY = reader.ReadInt32(); - Main.maxTilesX = reader.ReadInt32(); - WorldGen.clearWorld(); - if (versionNumber >= 209) - { - Main.GameMode = reader.ReadInt32(); - if (versionNumber >= 222) - Main.drunkWorld = reader.ReadBoolean(); - if (versionNumber >= 227) - Main.getGoodWorld = reader.ReadBoolean(); - } - else - { - Main.GameMode = versionNumber < 112 ? 0 : (reader.ReadBoolean() ? 1 : 0); - if (versionNumber == 208 && reader.ReadBoolean()) - Main.GameMode = 2; - } - if (versionNumber >= 141) - Main.ActiveWorldFileData.CreationTime = DateTime.FromBinary(reader.ReadInt64()); - Main.moonType = (int) reader.ReadByte(); - Main.treeX[0] = reader.ReadInt32(); - Main.treeX[1] = reader.ReadInt32(); - Main.treeX[2] = reader.ReadInt32(); - Main.treeStyle[0] = reader.ReadInt32(); - Main.treeStyle[1] = reader.ReadInt32(); - Main.treeStyle[2] = reader.ReadInt32(); - Main.treeStyle[3] = reader.ReadInt32(); - Main.caveBackX[0] = reader.ReadInt32(); - Main.caveBackX[1] = reader.ReadInt32(); - Main.caveBackX[2] = reader.ReadInt32(); - Main.caveBackStyle[0] = reader.ReadInt32(); - Main.caveBackStyle[1] = reader.ReadInt32(); - Main.caveBackStyle[2] = reader.ReadInt32(); - Main.caveBackStyle[3] = reader.ReadInt32(); - Main.iceBackStyle = reader.ReadInt32(); - Main.jungleBackStyle = reader.ReadInt32(); - Main.hellBackStyle = reader.ReadInt32(); - Main.spawnTileX = reader.ReadInt32(); - Main.spawnTileY = reader.ReadInt32(); - Main.worldSurface = reader.ReadDouble(); - Main.rockLayer = reader.ReadDouble(); - WorldFile._tempTime = reader.ReadDouble(); - WorldFile._tempDayTime = reader.ReadBoolean(); - WorldFile._tempMoonPhase = reader.ReadInt32(); - WorldFile._tempBloodMoon = reader.ReadBoolean(); - WorldFile._tempEclipse = reader.ReadBoolean(); - Main.eclipse = WorldFile._tempEclipse; - Main.dungeonX = reader.ReadInt32(); - Main.dungeonY = reader.ReadInt32(); - WorldGen.crimson = reader.ReadBoolean(); - NPC.downedBoss1 = reader.ReadBoolean(); - NPC.downedBoss2 = reader.ReadBoolean(); - NPC.downedBoss3 = reader.ReadBoolean(); - NPC.downedQueenBee = reader.ReadBoolean(); - NPC.downedMechBoss1 = reader.ReadBoolean(); - NPC.downedMechBoss2 = reader.ReadBoolean(); - NPC.downedMechBoss3 = reader.ReadBoolean(); - NPC.downedMechBossAny = reader.ReadBoolean(); - NPC.downedPlantBoss = reader.ReadBoolean(); - NPC.downedGolemBoss = reader.ReadBoolean(); - if (versionNumber >= 118) - NPC.downedSlimeKing = reader.ReadBoolean(); - NPC.savedGoblin = reader.ReadBoolean(); - NPC.savedWizard = reader.ReadBoolean(); - NPC.savedMech = reader.ReadBoolean(); - NPC.downedGoblins = reader.ReadBoolean(); - NPC.downedClown = reader.ReadBoolean(); - NPC.downedFrost = reader.ReadBoolean(); - NPC.downedPirates = reader.ReadBoolean(); - WorldGen.shadowOrbSmashed = reader.ReadBoolean(); - WorldGen.spawnMeteor = reader.ReadBoolean(); - WorldGen.shadowOrbCount = (int) reader.ReadByte(); - WorldGen.altarCount = reader.ReadInt32(); - Main.hardMode = reader.ReadBoolean(); - Main.invasionDelay = reader.ReadInt32(); - Main.invasionSize = reader.ReadInt32(); - Main.invasionType = reader.ReadInt32(); - Main.invasionX = reader.ReadDouble(); - if (versionNumber >= 118) - Main.slimeRainTime = reader.ReadDouble(); - if (versionNumber >= 113) - Main.sundialCooldown = (int) reader.ReadByte(); - WorldFile._tempRaining = reader.ReadBoolean(); - WorldFile._tempRainTime = reader.ReadInt32(); - WorldFile._tempMaxRain = reader.ReadSingle(); - WorldGen.SavedOreTiers.Cobalt = reader.ReadInt32(); - WorldGen.SavedOreTiers.Mythril = reader.ReadInt32(); - WorldGen.SavedOreTiers.Adamantite = reader.ReadInt32(); - WorldGen.setBG(0, (int) reader.ReadByte()); - WorldGen.setBG(1, (int) reader.ReadByte()); - WorldGen.setBG(2, (int) reader.ReadByte()); - WorldGen.setBG(3, (int) reader.ReadByte()); - WorldGen.setBG(4, (int) reader.ReadByte()); - WorldGen.setBG(5, (int) reader.ReadByte()); - WorldGen.setBG(6, (int) reader.ReadByte()); - WorldGen.setBG(7, (int) reader.ReadByte()); - Main.cloudBGActive = (float) reader.ReadInt32(); - Main.cloudBGAlpha = (double) Main.cloudBGActive < 1.0 ? 0.0f : 1f; - Main.cloudBGActive = (float) -WorldGen.genRand.Next(8640, 86400); - Main.numClouds = (int) reader.ReadInt16(); - Main.windSpeedTarget = reader.ReadSingle(); - Main.windSpeedCurrent = Main.windSpeedTarget; - if (versionNumber < 95) - return; - Main.anglerWhoFinishedToday.Clear(); - for (int index = reader.ReadInt32(); index > 0; --index) - Main.anglerWhoFinishedToday.Add(reader.ReadString()); - if (versionNumber < 99) - return; - NPC.savedAngler = reader.ReadBoolean(); - if (versionNumber < 101) - return; - Main.anglerQuest = reader.ReadInt32(); - if (versionNumber < 104) - return; - NPC.savedStylist = reader.ReadBoolean(); - if (versionNumber >= 129) - NPC.savedTaxCollector = reader.ReadBoolean(); - if (versionNumber >= 201) - NPC.savedGolfer = reader.ReadBoolean(); - if (versionNumber < 107) - { - if (Main.invasionType > 0 && Main.invasionSize > 0) - Main.FakeLoadInvasionStart(); - } - else - Main.invasionSizeStart = reader.ReadInt32(); - WorldFile._tempCultistDelay = versionNumber >= 108 ? reader.ReadInt32() : 86400; - if (versionNumber < 109) - return; - int num1 = (int) reader.ReadInt16(); - for (int index = 0; index < num1; ++index) - { - if (index < 663) - NPC.killCount[index] = reader.ReadInt32(); - else - reader.ReadInt32(); - } - if (versionNumber < 128) - return; - Main.fastForwardTime = reader.ReadBoolean(); - Main.UpdateTimeRate(); - if (versionNumber < 131) - return; - NPC.downedFishron = reader.ReadBoolean(); - NPC.downedMartians = reader.ReadBoolean(); - NPC.downedAncientCultist = reader.ReadBoolean(); - NPC.downedMoonlord = reader.ReadBoolean(); - NPC.downedHalloweenKing = reader.ReadBoolean(); - NPC.downedHalloweenTree = reader.ReadBoolean(); - NPC.downedChristmasIceQueen = reader.ReadBoolean(); - NPC.downedChristmasSantank = reader.ReadBoolean(); - NPC.downedChristmasTree = reader.ReadBoolean(); - if (versionNumber < 140) - return; - NPC.downedTowerSolar = reader.ReadBoolean(); - NPC.downedTowerVortex = reader.ReadBoolean(); - NPC.downedTowerNebula = reader.ReadBoolean(); - NPC.downedTowerStardust = reader.ReadBoolean(); - NPC.TowerActiveSolar = reader.ReadBoolean(); - NPC.TowerActiveVortex = reader.ReadBoolean(); - NPC.TowerActiveNebula = reader.ReadBoolean(); - NPC.TowerActiveStardust = reader.ReadBoolean(); - NPC.LunarApocalypseIsUp = reader.ReadBoolean(); - if (NPC.TowerActiveSolar) - NPC.ShieldStrengthTowerSolar = NPC.ShieldStrengthTowerMax; - if (NPC.TowerActiveVortex) - NPC.ShieldStrengthTowerVortex = NPC.ShieldStrengthTowerMax; - if (NPC.TowerActiveNebula) - NPC.ShieldStrengthTowerNebula = NPC.ShieldStrengthTowerMax; - if (NPC.TowerActiveStardust) - NPC.ShieldStrengthTowerStardust = NPC.ShieldStrengthTowerMax; - if (versionNumber < 170) - { - WorldFile._tempPartyManual = false; - WorldFile._tempPartyGenuine = false; - WorldFile._tempPartyCooldown = 0; - WorldFile.TempPartyCelebratingNPCs.Clear(); - } - else - { - WorldFile._tempPartyManual = reader.ReadBoolean(); - WorldFile._tempPartyGenuine = reader.ReadBoolean(); - WorldFile._tempPartyCooldown = reader.ReadInt32(); - int num2 = reader.ReadInt32(); - WorldFile.TempPartyCelebratingNPCs.Clear(); - for (int index = 0; index < num2; ++index) - WorldFile.TempPartyCelebratingNPCs.Add(reader.ReadInt32()); - } - if (versionNumber < 174) - { - WorldFile._tempSandstormHappening = false; - WorldFile._tempSandstormTimeLeft = 0; - WorldFile._tempSandstormSeverity = 0.0f; - WorldFile._tempSandstormIntendedSeverity = 0.0f; - } - else - { - WorldFile._tempSandstormHappening = reader.ReadBoolean(); - WorldFile._tempSandstormTimeLeft = reader.ReadInt32(); - WorldFile._tempSandstormSeverity = reader.ReadSingle(); - WorldFile._tempSandstormIntendedSeverity = reader.ReadSingle(); - } - DD2Event.Load(reader, versionNumber); - if (versionNumber > 194) - WorldGen.setBG(8, (int) reader.ReadByte()); - else - WorldGen.setBG(8, 0); - if (versionNumber >= 215) - WorldGen.setBG(9, (int) reader.ReadByte()); - else - WorldGen.setBG(9, 0); - if (versionNumber > 195) - { - WorldGen.setBG(10, (int) reader.ReadByte()); - WorldGen.setBG(11, (int) reader.ReadByte()); - WorldGen.setBG(12, (int) reader.ReadByte()); - } - else - { - WorldGen.setBG(10, WorldGen.treeBG1); - WorldGen.setBG(11, WorldGen.treeBG1); - WorldGen.setBG(12, WorldGen.treeBG1); - } - if (versionNumber >= 204) - NPC.combatBookWasUsed = reader.ReadBoolean(); - if (versionNumber < 207) - { - WorldFile._tempLanternNightCooldown = 0; - WorldFile._tempLanternNightGenuine = false; - WorldFile._tempLanternNightManual = false; - WorldFile._tempLanternNightNextNightIsGenuine = false; - } - else - { - WorldFile._tempLanternNightCooldown = reader.ReadInt32(); - WorldFile._tempLanternNightGenuine = reader.ReadBoolean(); - WorldFile._tempLanternNightManual = reader.ReadBoolean(); - WorldFile._tempLanternNightNextNightIsGenuine = reader.ReadBoolean(); - } - WorldGen.TreeTops.Load(reader, versionNumber); - if (versionNumber >= 212) - { - Main.forceHalloweenForToday = reader.ReadBoolean(); - Main.forceXMasForToday = reader.ReadBoolean(); - } - else - { - Main.forceHalloweenForToday = false; - Main.forceXMasForToday = false; - } - if (versionNumber >= 216) - { - WorldGen.SavedOreTiers.Copper = reader.ReadInt32(); - WorldGen.SavedOreTiers.Iron = reader.ReadInt32(); - WorldGen.SavedOreTiers.Silver = reader.ReadInt32(); - WorldGen.SavedOreTiers.Gold = reader.ReadInt32(); - } - else - { - WorldGen.SavedOreTiers.Copper = -1; - WorldGen.SavedOreTiers.Iron = -1; - WorldGen.SavedOreTiers.Silver = -1; - WorldGen.SavedOreTiers.Gold = -1; - } - if (versionNumber >= 217) - { - NPC.boughtCat = reader.ReadBoolean(); - NPC.boughtDog = reader.ReadBoolean(); - NPC.boughtBunny = reader.ReadBoolean(); - } - else - { - NPC.boughtCat = false; - NPC.boughtDog = false; - NPC.boughtBunny = false; - } - if (versionNumber >= 223) - { - NPC.downedEmpressOfLight = reader.ReadBoolean(); - NPC.downedQueenSlime = reader.ReadBoolean(); - } - else - { - NPC.downedEmpressOfLight = false; - NPC.downedQueenSlime = false; - } - } - - private static void LoadWorldTiles(BinaryReader reader, bool[] importance) - { - for (int index1 = 0; index1 < Main.maxTilesX; ++index1) - { - float num1 = (float) index1 / (float) Main.maxTilesX; - Main.statusText = Lang.gen[51].Value + " " + (object) (int) ((double) num1 * 100.0 + 1.0) + "%"; - for (int index2 = 0; index2 < Main.maxTilesY; ++index2) + WorldFile.SetTempToOngoing(); + if (resetTime) + WorldFile.ResetTempsToDayTime(); + if (Main.worldPathName == null) + return; + new Stopwatch().Start(); + byte[] data1 = (byte[]) null; + int num = 0; + using (MemoryStream memoryStream = new MemoryStream(7000000)) { - int index3 = -1; - byte num2; - byte num3 = num2 = (byte) 0; - Tile from = Main.tile[index1, index2]; - byte num4 = reader.ReadByte(); - if (((int) num4 & 1) == 1) + using (BinaryWriter writer = new BinaryWriter((Stream) memoryStream)) + WorldFile.SaveWorld_Version2(writer); + data1 = memoryStream.ToArray(); + num = data1.Length; + } + if (data1 == null) + return; + byte[] data2 = (byte[]) null; + if (FileUtilities.Exists(Main.worldPathName, useCloudSaving)) + data2 = FileUtilities.ReadAllBytes(Main.worldPathName, useCloudSaving); + FileUtilities.Write(Main.worldPathName, data1, num, useCloudSaving); + byte[] buffer = FileUtilities.ReadAllBytes(Main.worldPathName, useCloudSaving); + string path = (string) null; + using (MemoryStream memoryStream = new MemoryStream(buffer, 0, num, false)) + { + using (BinaryReader fileIO = new BinaryReader((Stream) memoryStream)) { - num3 = reader.ReadByte(); - if (((int) num3 & 1) == 1) - num2 = reader.ReadByte(); - } - if (((int) num4 & 2) == 2) - { - from.active(true); - if (((int) num4 & 32) == 32) + if (!Main.validateSaves || WorldFile.validateWorld(fileIO)) { - byte num5 = reader.ReadByte(); - index3 = (int) reader.ReadByte() << 8 | (int) num5; - } - else - index3 = (int) reader.ReadByte(); - from.type = (ushort) index3; - if (importance[index3]) - { - from.frameX = reader.ReadInt16(); - from.frameY = reader.ReadInt16(); - if (from.type == (ushort) 144) - from.frameY = (short) 0; - } - else - { - from.frameX = (short) -1; - from.frameY = (short) -1; - } - if (((int) num2 & 8) == 8) - from.color(reader.ReadByte()); - } - if (((int) num4 & 4) == 4) - { - from.wall = (ushort) reader.ReadByte(); - if (from.wall >= (ushort) 316) - from.wall = (ushort) 0; - if (((int) num2 & 16) == 16) - from.wallColor(reader.ReadByte()); - } - byte num6 = (byte) (((int) num4 & 24) >> 3); - if (num6 != (byte) 0) - { - from.liquid = reader.ReadByte(); - if (num6 > (byte) 1) - { - if (num6 == (byte) 2) - from.lava(true); - else - from.honey(true); - } - } - if (num3 > (byte) 1) - { - if (((int) num3 & 2) == 2) - from.wire(true); - if (((int) num3 & 4) == 4) - from.wire2(true); - if (((int) num3 & 8) == 8) - from.wire3(true); - byte num7 = (byte) (((int) num3 & 112) >> 4); - if (num7 != (byte) 0 && (Main.tileSolid[(int) from.type] || TileID.Sets.NonSolidSaveSlopes[(int) from.type])) - { - if (num7 == (byte) 1) - from.halfBrick(true); - else - from.slope((byte) ((uint) num7 - 1U)); - } - } - if (num2 > (byte) 0) - { - if (((int) num2 & 2) == 2) - from.actuator(true); - if (((int) num2 & 4) == 4) - from.inActive(true); - if (((int) num2 & 32) == 32) - from.wire4(true); - if (((int) num2 & 64) == 64) - { - byte num8 = reader.ReadByte(); - from.wall = (ushort) ((uint) num8 << 8 | (uint) from.wall); - if (from.wall >= (ushort) 316) - from.wall = (ushort) 0; - } - } - int num9; - switch ((byte) (((int) num4 & 192) >> 6)) - { - case 0: - num9 = 0; - break; - case 1: - num9 = (int) reader.ReadByte(); - break; - default: - num9 = (int) reader.ReadInt16(); - break; - } - if (index3 != -1) - { - if ((double) index2 <= Main.worldSurface) - { - if ((double) (index2 + num9) <= Main.worldSurface) + if (data2 != null) { - WorldGen.tileCounts[index3] += (num9 + 1) * 5; - } - else - { - int num10 = (int) (Main.worldSurface - (double) index2 + 1.0); - int num11 = num9 + 1 - num10; - WorldGen.tileCounts[index3] += num10 * 5 + num11; + path = Main.worldPathName + ".bak"; + Main.statusText = Lang.gen[50].Value; } } else - WorldGen.tileCounts[index3] += num9 + 1; - } - for (; num9 > 0; --num9) - { - ++index2; - Main.tile[index1, index2].CopyFrom(from); + path = Main.worldPathName; } } + if (path != null && data2 != null) + FileUtilities.WriteAllBytes(path, data2, useCloudSaving); + WorldGen.saveLock = false; } - WorldGen.AddUpAlignmentCounts(true); - if (WorldFile._versionNumber >= 105) - return; - WorldGen.FixHearts(); + Main.serverGenLock = false; } - private static void LoadChests(BinaryReader reader) - { - int num1 = (int) reader.ReadInt16(); - int num2 = (int) reader.ReadInt16(); - int num3; - int num4; - if (num2 < 40) - { - num3 = num2; - num4 = 0; - } - else - { - num3 = 40; - num4 = num2 - 40; - } - int index1; - for (index1 = 0; index1 < num1; ++index1) - { - Chest chest = new Chest(); - chest.x = reader.ReadInt32(); - chest.y = reader.ReadInt32(); - chest.name = reader.ReadString(); - for (int index2 = 0; index2 < num3; ++index2) - { - short num5 = reader.ReadInt16(); - Item obj = new Item(); - if (num5 > (short) 0) - { - obj.netDefaults(reader.ReadInt32()); - obj.stack = (int) num5; - obj.Prefix((int) reader.ReadByte()); - } - else if (num5 < (short) 0) - { - obj.netDefaults(reader.ReadInt32()); - obj.Prefix((int) reader.ReadByte()); - obj.stack = 1; - } - chest.item[index2] = obj; - } - for (int index3 = 0; index3 < num4; ++index3) - { - if (reader.ReadInt16() > (short) 0) - { - reader.ReadInt32(); - int num6 = (int) reader.ReadByte(); - } - } - Main.chest[index1] = chest; - } - List point16List = new List(); - for (int index4 = 0; index4 < index1; ++index4) - { - if (Main.chest[index4] != null) - { - Point16 point16 = new Point16(Main.chest[index4].x, Main.chest[index4].y); - if (point16List.Contains(point16)) - Main.chest[index4] = (Chest) null; - else - point16List.Add(point16); - } - } - for (; index1 < 8000; ++index1) - Main.chest[index1] = (Chest) null; - if (WorldFile._versionNumber >= 115) - return; - WorldFile.FixDresserChests(); - } - - private static void LoadSigns(BinaryReader reader) - { - short num = reader.ReadInt16(); - int index1; - for (index1 = 0; index1 < (int) num; ++index1) - { - string str = reader.ReadString(); - int index2 = reader.ReadInt32(); - int index3 = reader.ReadInt32(); - Tile tile = Main.tile[index2, index3]; - Sign sign; - if (tile.active() && Main.tileSign[(int) tile.type]) - { - sign = new Sign(); - sign.text = str; - sign.x = index2; - sign.y = index3; - } - else - sign = (Sign) null; - Main.sign[index1] = sign; - } - List point16List = new List(); - for (int index4 = 0; index4 < 1000; ++index4) - { - if (Main.sign[index4] != null) - { - Point16 point16 = new Point16(Main.sign[index4].x, Main.sign[index4].y); - if (point16List.Contains(point16)) - Main.sign[index4] = (Sign) null; - else - point16List.Add(point16); - } - } - for (; index1 < 1000; ++index1) - Main.sign[index1] = (Sign) null; - } - - private static void LoadDummies(BinaryReader reader) - { - int num = reader.ReadInt32(); - for (int index = 0; index < num; ++index) - DeprecatedClassLeftInForLoading.dummies[index] = new DeprecatedClassLeftInForLoading((int) reader.ReadInt16(), (int) reader.ReadInt16()); - for (int index = num; index < 1000; ++index) - DeprecatedClassLeftInForLoading.dummies[index] = (DeprecatedClassLeftInForLoading) null; - } - - private static void LoadNPCs(BinaryReader reader) - { - int index = 0; - for (bool flag = reader.ReadBoolean(); flag; flag = reader.ReadBoolean()) - { - NPC npc = Main.npc[index]; - if (WorldFile._versionNumber >= 190) - npc.SetDefaults(reader.ReadInt32()); - else - npc.SetDefaults(NPCID.FromLegacyName(reader.ReadString())); - npc.GivenName = reader.ReadString(); - npc.position.X = reader.ReadSingle(); - npc.position.Y = reader.ReadSingle(); - npc.homeless = reader.ReadBoolean(); - npc.homeTileX = reader.ReadInt32(); - npc.homeTileY = reader.ReadInt32(); - if (WorldFile._versionNumber >= 213 && ((BitsByte) reader.ReadByte())[0]) - npc.townNpcVariationIndex = reader.ReadInt32(); - ++index; - } - if (WorldFile._versionNumber < 140) - return; - for (bool flag = reader.ReadBoolean(); flag; flag = reader.ReadBoolean()) - { - NPC npc = Main.npc[index]; - if (WorldFile._versionNumber >= 190) - npc.SetDefaults(reader.ReadInt32()); - else - npc.SetDefaults(NPCID.FromLegacyName(reader.ReadString())); - npc.position = reader.ReadVector2(); - ++index; - } - } - - private static void ValidateLoadNPCs(BinaryReader fileIO) - { - for (bool flag = fileIO.ReadBoolean(); flag; flag = fileIO.ReadBoolean()) - { - fileIO.ReadInt32(); - fileIO.ReadString(); - double num1 = (double) fileIO.ReadSingle(); - double num2 = (double) fileIO.ReadSingle(); - fileIO.ReadBoolean(); - fileIO.ReadInt32(); - fileIO.ReadInt32(); - if (((BitsByte) fileIO.ReadByte())[0]) - fileIO.ReadInt32(); - } - for (bool flag = fileIO.ReadBoolean(); flag; flag = fileIO.ReadBoolean()) - { - fileIO.ReadInt32(); - double num3 = (double) fileIO.ReadSingle(); - double num4 = (double) fileIO.ReadSingle(); - } - } - - private static int LoadFooter(BinaryReader reader) => !reader.ReadBoolean() || reader.ReadString() != Main.worldName || reader.ReadInt32() != Main.worldID ? 6 : 0; - - private static bool ValidateWorld(BinaryReader fileIO) - { - new Stopwatch().Start(); - try - { - Stream baseStream = fileIO.BaseStream; - int num1 = fileIO.ReadInt32(); - if (num1 == 0 || num1 > 230) - return false; - baseStream.Position = 0L; - bool[] importance; - int[] positions; - if (!WorldFile.LoadFileFormatHeader(fileIO, out importance, out positions)) - return false; - string str1 = fileIO.ReadString(); - if (num1 >= 179) - { - if (num1 == 179) - fileIO.ReadInt32(); - else - fileIO.ReadString(); - long num2 = (long) fileIO.ReadUInt64(); - } - if (num1 >= 181) - fileIO.ReadBytes(16); - int num3 = fileIO.ReadInt32(); - fileIO.ReadInt32(); - fileIO.ReadInt32(); - fileIO.ReadInt32(); - fileIO.ReadInt32(); - int num4 = fileIO.ReadInt32(); - int num5 = fileIO.ReadInt32(); - baseStream.Position = (long) positions[1]; - for (int index1 = 0; index1 < num5; ++index1) - { - float num6 = (float) index1 / (float) Main.maxTilesX; - Main.statusText = Lang.gen[73].Value + " " + (object) (int) ((double) num6 * 100.0 + 1.0) + "%"; - int num7; - for (int index2 = 0; index2 < num4; index2 = index2 + num7 + 1) - { - byte num8 = 0; - byte num9 = fileIO.ReadByte(); - if (((int) num9 & 1) == 1 && ((int) fileIO.ReadByte() & 1) == 1) - num8 = fileIO.ReadByte(); - if (((int) num9 & 2) == 2) - { - int index3; - if (((int) num9 & 32) == 32) - { - byte num10 = fileIO.ReadByte(); - index3 = (int) fileIO.ReadByte() << 8 | (int) num10; - } - else - index3 = (int) fileIO.ReadByte(); - if (importance[index3]) - { - int num11 = (int) fileIO.ReadInt16(); - int num12 = (int) fileIO.ReadInt16(); - } - if (((int) num8 & 8) == 8) - { - int num13 = (int) fileIO.ReadByte(); - } - } - if (((int) num9 & 4) == 4) - { - int num14 = (int) fileIO.ReadByte(); - if (((int) num8 & 16) == 16) - { - int num15 = (int) fileIO.ReadByte(); - } - } - if (((int) num9 & 24) >> 3 != 0) - { - int num16 = (int) fileIO.ReadByte(); - } - if (((int) num8 & 64) == 64) - { - int num17 = (int) fileIO.ReadByte(); - } - switch ((byte) (((int) num9 & 192) >> 6)) - { - case 0: - num7 = 0; - break; - case 1: - num7 = (int) fileIO.ReadByte(); - break; - default: - num7 = (int) fileIO.ReadInt16(); - break; - } - } - } - if (baseStream.Position != (long) positions[2]) - return false; - int num18 = (int) fileIO.ReadInt16(); - int num19 = (int) fileIO.ReadInt16(); - for (int index4 = 0; index4 < num18; ++index4) - { - fileIO.ReadInt32(); - fileIO.ReadInt32(); - fileIO.ReadString(); - for (int index5 = 0; index5 < num19; ++index5) - { - if (fileIO.ReadInt16() > (short) 0) - { - fileIO.ReadInt32(); - int num20 = (int) fileIO.ReadByte(); - } - } - } - if (baseStream.Position != (long) positions[3]) - return false; - int num21 = (int) fileIO.ReadInt16(); - for (int index = 0; index < num21; ++index) - { - fileIO.ReadString(); - fileIO.ReadInt32(); - fileIO.ReadInt32(); - } - if (baseStream.Position != (long) positions[4]) - return false; - WorldFile.ValidateLoadNPCs(fileIO); - if (baseStream.Position != (long) positions[5]) - return false; - if (WorldFile._versionNumber >= 116 && WorldFile._versionNumber <= 121) - { - int num22 = fileIO.ReadInt32(); - for (int index = 0; index < num22; ++index) - { - int num23 = (int) fileIO.ReadInt16(); - int num24 = (int) fileIO.ReadInt16(); - } - if (baseStream.Position != (long) positions[6]) - return false; - } - if (WorldFile._versionNumber >= 122) - { - int num25 = fileIO.ReadInt32(); - for (int index = 0; index < num25; ++index) - TileEntity.Read(fileIO); - } - if (WorldFile._versionNumber >= 170) - { - int num26 = fileIO.ReadInt32(); - for (int index = 0; index < num26; ++index) - fileIO.ReadInt64(); - } - if (WorldFile._versionNumber >= 189) - { - int num27 = fileIO.ReadInt32(); - fileIO.ReadBytes(12 * num27); - } - if (WorldFile._versionNumber >= 210) - Main.BestiaryTracker.ValidateWorld(fileIO, WorldFile._versionNumber); - if (WorldFile._versionNumber >= 220) - CreativePowerManager.Instance.ValidateWorld(fileIO, WorldFile._versionNumber); - int num28 = fileIO.ReadBoolean() ? 1 : 0; - string str2 = fileIO.ReadString(); - int num29 = fileIO.ReadInt32(); - bool flag = false; - if (num28 != 0 && (str2 == str1 || num29 == num3)) - flag = true; - return flag; - } - catch (Exception ex) - { - using (StreamWriter streamWriter = new StreamWriter("client-crashlog.txt", true)) - { - streamWriter.WriteLine((object) DateTime.Now); - streamWriter.WriteLine((object) ex); - streamWriter.WriteLine(""); - } - return false; - } - } - - private static FileMetadata GetFileMetadata(string file, bool cloudSave) - { - if (file == null) - return (FileMetadata) null; - try - { - byte[] buffer = (byte[]) null; - int num = !cloudSave ? 0 : (SocialAPI.Cloud != null ? 1 : 0); - if (num != 0) - { - int length = 24; - buffer = new byte[length]; - SocialAPI.Cloud.Read(file, buffer, length); - } - using (Stream input = num != 0 ? (Stream) new MemoryStream(buffer) : (Stream) new FileStream(file, FileMode.Open)) - { - using (BinaryReader reader = new BinaryReader(input)) - return reader.ReadInt32() >= 135 ? FileMetadata.Read(reader, FileType.World) : FileMetadata.FromCurrentSettings(FileType.World); - } - } - catch - { - } - return (FileMetadata) null; - } - - private static void FixDresserChests() - { - for (int X = 0; X < Main.maxTilesX; ++X) - { - for (int Y = 0; Y < Main.maxTilesY; ++Y) - { - Tile tile = Main.tile[X, Y]; - if (tile.active() && tile.type == (ushort) 88 && (int) tile.frameX % 54 == 0 && (int) tile.frameY % 36 == 0) - Chest.CreateChest(X, Y); - } - } - } - - private static int SaveTileEntities(BinaryWriter writer) - { - lock (TileEntity.ByID) - { - writer.Write(TileEntity.ByID.Count); - foreach (KeyValuePair keyValuePair in TileEntity.ByID) - TileEntity.Write(writer, keyValuePair.Value); - } - return (int) writer.BaseStream.Position; - } - - private static void LoadTileEntities(BinaryReader reader) - { - TileEntity.ByID.Clear(); - TileEntity.ByPosition.Clear(); - int num1 = reader.ReadInt32(); - int num2 = 0; - for (int index = 0; index < num1; ++index) - { - TileEntity tileEntity1 = TileEntity.Read(reader); - tileEntity1.ID = num2++; - TileEntity.ByID[tileEntity1.ID] = tileEntity1; - TileEntity tileEntity2; - if (TileEntity.ByPosition.TryGetValue(tileEntity1.Position, out tileEntity2)) - TileEntity.ByID.Remove(tileEntity2.ID); - TileEntity.ByPosition[tileEntity1.Position] = tileEntity1; - } - TileEntity.TileEntitiesNextID = num1; - List point16List = new List(); - foreach (KeyValuePair keyValuePair in TileEntity.ByPosition) - { - if (!WorldGen.InWorld((int) keyValuePair.Value.Position.X, (int) keyValuePair.Value.Position.Y, 1)) - point16List.Add(keyValuePair.Value.Position); - else if (!TileEntity.manager.CheckValidTile((int) keyValuePair.Value.type, (int) keyValuePair.Value.Position.X, (int) keyValuePair.Value.Position.Y)) - point16List.Add(keyValuePair.Value.Position); - } - try - { - foreach (Point16 key in point16List) - { - TileEntity tileEntity = TileEntity.ByPosition[key]; - if (TileEntity.ByID.ContainsKey(tileEntity.ID)) - TileEntity.ByID.Remove(tileEntity.ID); - if (TileEntity.ByPosition.ContainsKey(key)) - TileEntity.ByPosition.Remove(key); - } - } - catch - { - } - } - - private static int SaveWeightedPressurePlates(BinaryWriter writer) - { - lock (PressurePlateHelper.PressurePlatesPressed) - { - writer.Write(PressurePlateHelper.PressurePlatesPressed.Count); - foreach (KeyValuePair keyValuePair in PressurePlateHelper.PressurePlatesPressed) - { - writer.Write(keyValuePair.Key.X); - writer.Write(keyValuePair.Key.Y); - } - } - return (int) writer.BaseStream.Position; - } - - private static void LoadWeightedPressurePlates(BinaryReader reader) - { - PressurePlateHelper.Reset(); - PressurePlateHelper.NeedsFirstUpdate = true; - int num = reader.ReadInt32(); - for (int index = 0; index < num; ++index) - { - Point key = new Point(reader.ReadInt32(), reader.ReadInt32()); - PressurePlateHelper.PressurePlatesPressed.Add(key, new bool[(int) byte.MaxValue]); - } - } - - private static int SaveTownManager(BinaryWriter writer) - { - WorldGen.TownManager.Save(writer); - return (int) writer.BaseStream.Position; - } - - private static void LoadTownManager(BinaryReader reader) => WorldGen.TownManager.Load(reader); - - private static int SaveBestiary(BinaryWriter writer) - { - Main.BestiaryTracker.Save(writer); - return (int) writer.BaseStream.Position; - } - - private static void LoadBestiary(BinaryReader reader, int loadVersionNumber) => Main.BestiaryTracker.Load(reader, loadVersionNumber); - - private static void LoadBestiaryForVersionsBefore210() => Main.BestiaryTracker.FillBasedOnVersionBefore210(); - - private static int SaveCreativePowers(BinaryWriter writer) - { - CreativePowerManager.Instance.SaveToWorld(writer); - return (int) writer.BaseStream.Position; - } - - private static void LoadCreativePowers(BinaryReader reader, int loadVersionNumber) => CreativePowerManager.Instance.LoadFromWorld(reader, loadVersionNumber); - - private static int LoadWorld_Version1_Old_BeforeRelease88(BinaryReader fileIO) + public static int LoadWorld_Version1(BinaryReader fileIO) { Main.WorldFileMetadata = FileMetadata.FromCurrentSettings(FileType.World); - int versionNumber = WorldFile._versionNumber; - if (versionNumber > 230) + int versionNumber = WorldFile.versionNumber; + if (versionNumber > 194) return 1; Main.worldName = fileIO.ReadString(); Main.worldID = fileIO.ReadInt32(); @@ -2256,7 +351,7 @@ namespace Terraria.IO Main.bottomWorld = (float) fileIO.ReadInt32(); Main.maxTilesY = fileIO.ReadInt32(); Main.maxTilesX = fileIO.ReadInt32(); - Main.GameMode = versionNumber < 112 ? 0 : (fileIO.ReadBoolean() ? 1 : 0); + Main.expertMode = versionNumber >= 112 && fileIO.ReadBoolean(); if (versionNumber >= 63) Main.moonType = (int) fileIO.ReadByte(); else @@ -2294,14 +389,14 @@ namespace Terraria.IO Main.spawnTileY = fileIO.ReadInt32(); Main.worldSurface = fileIO.ReadDouble(); Main.rockLayer = fileIO.ReadDouble(); - WorldFile._tempTime = fileIO.ReadDouble(); - WorldFile._tempDayTime = fileIO.ReadBoolean(); - WorldFile._tempMoonPhase = fileIO.ReadInt32(); - WorldFile._tempBloodMoon = fileIO.ReadBoolean(); + WorldFile.tempTime = fileIO.ReadDouble(); + WorldFile.tempDayTime = fileIO.ReadBoolean(); + WorldFile.tempMoonPhase = fileIO.ReadInt32(); + WorldFile.tempBloodMoon = fileIO.ReadBoolean(); if (versionNumber >= 70) { - WorldFile._tempEclipse = fileIO.ReadBoolean(); - Main.eclipse = WorldFile._tempEclipse; + WorldFile.tempEclipse = fileIO.ReadBoolean(); + Main.eclipse = WorldFile.tempEclipse; } Main.dungeonX = fileIO.ReadInt32(); Main.dungeonY = fileIO.ReadInt32(); @@ -2335,8 +430,6 @@ namespace Terraria.IO } if (versionNumber >= 129) NPC.savedTaxCollector = fileIO.ReadBoolean(); - if (versionNumber >= 201) - NPC.savedGolfer = fileIO.ReadBoolean(); NPC.downedGoblins = fileIO.ReadBoolean(); } if (versionNumber >= 32) @@ -2361,27 +454,27 @@ namespace Terraria.IO Main.sundialCooldown = (int) fileIO.ReadByte(); if (versionNumber >= 53) { - WorldFile._tempRaining = fileIO.ReadBoolean(); - WorldFile._tempRainTime = fileIO.ReadInt32(); - WorldFile._tempMaxRain = fileIO.ReadSingle(); + WorldFile.tempRaining = fileIO.ReadBoolean(); + WorldFile.tempRainTime = fileIO.ReadInt32(); + WorldFile.tempMaxRain = fileIO.ReadSingle(); } if (versionNumber >= 54) { - WorldGen.SavedOreTiers.Cobalt = fileIO.ReadInt32(); - WorldGen.SavedOreTiers.Mythril = fileIO.ReadInt32(); - WorldGen.SavedOreTiers.Adamantite = fileIO.ReadInt32(); + WorldGen.oreTier1 = fileIO.ReadInt32(); + WorldGen.oreTier2 = fileIO.ReadInt32(); + WorldGen.oreTier3 = fileIO.ReadInt32(); } else if (versionNumber >= 23 && WorldGen.altarCount == 0) { - WorldGen.SavedOreTiers.Cobalt = -1; - WorldGen.SavedOreTiers.Mythril = -1; - WorldGen.SavedOreTiers.Adamantite = -1; + WorldGen.oreTier1 = -1; + WorldGen.oreTier2 = -1; + WorldGen.oreTier3 = -1; } else { - WorldGen.SavedOreTiers.Cobalt = 107; - WorldGen.SavedOreTiers.Mythril = 108; - WorldGen.SavedOreTiers.Adamantite = 111; + WorldGen.oreTier1 = 107; + WorldGen.oreTier2 = 108; + WorldGen.oreTier3 = 111; } int style1 = 0; int style2 = 0; @@ -2391,8 +484,6 @@ namespace Terraria.IO int style6 = 0; int style7 = 0; int style8 = 0; - int style9 = 0; - int style10 = 0; if (versionNumber >= 55) { style1 = (int) fileIO.ReadByte(); @@ -2415,11 +506,6 @@ namespace Terraria.IO WorldGen.setBG(5, style6); WorldGen.setBG(6, style7); WorldGen.setBG(7, style8); - WorldGen.setBG(8, style9); - WorldGen.setBG(9, style10); - WorldGen.setBG(10, style1); - WorldGen.setBG(11, style1); - WorldGen.setBG(12, style1); if (versionNumber >= 60) { Main.cloudBGActive = (float) fileIO.ReadInt32(); @@ -2430,8 +516,8 @@ namespace Terraria.IO if (versionNumber >= 62) { Main.numClouds = (int) fileIO.ReadInt16(); - Main.windSpeedTarget = fileIO.ReadSingle(); - Main.windSpeedCurrent = Main.windSpeedTarget; + Main.windSpeedSet = fileIO.ReadSingle(); + Main.windSpeed = Main.windSpeedSet; } else WorldGen.RandomizeWeather(); @@ -2448,7 +534,7 @@ namespace Terraria.IO { index3 = versionNumber <= 77 ? (int) fileIO.ReadByte() : (int) fileIO.ReadUInt16(); tile.type = (ushort) index3; - if (tile.type == (ushort) sbyte.MaxValue || tile.type == (ushort) 504) + if (tile.type == (ushort) sbyte.MaxValue) tile.active(false); if (versionNumber < 72 && (tile.type == (ushort) 35 || tile.type == (ushort) 36 || tile.type == (ushort) 170 || tile.type == (ushort) 171 || tile.type == (ushort) 172)) { @@ -2467,11 +553,6 @@ namespace Terraria.IO tile.frameX = (short) 0; tile.frameY = (short) 0; } - else if (versionNumber < 195 && tile.type == (ushort) 49) - { - tile.frameX = (short) 0; - tile.frameY = (short) 0; - } else { tile.frameX = fileIO.ReadInt16(); @@ -2492,9 +573,7 @@ namespace Terraria.IO fileIO.ReadBoolean(); if (fileIO.ReadBoolean()) { - tile.wall = (ushort) fileIO.ReadByte(); - if (tile.wall >= (ushort) 316) - tile.wall = (ushort) 0; + tile.wall = fileIO.ReadByte(); if (versionNumber >= 48 && fileIO.ReadBoolean()) tile.wallColor(fileIO.ReadByte()); } @@ -2515,12 +594,12 @@ namespace Terraria.IO if (versionNumber >= 41) { tile.halfBrick(fileIO.ReadBoolean()); - if (!Main.tileSolid[(int) tile.type] && !TileID.Sets.NonSolidSaveSlopes[(int) tile.type]) + if (!Main.tileSolid[(int) tile.type]) tile.halfBrick(false); if (versionNumber >= 49) { tile.slope(fileIO.ReadByte()); - if (!Main.tileSolid[(int) tile.type] && !TileID.Sets.NonSolidSaveSlopes[(int) tile.type]) + if (!Main.tileSolid[(int) tile.type]) tile.slope((byte) 0); } } @@ -2566,8 +645,7 @@ namespace Terraria.IO int num5 = 40; if (versionNumber < 58) num5 = 20; - int num6 = 1000; - for (int index5 = 0; index5 < num6; ++index5) + for (int index5 = 0; index5 < 1000; ++index5) { if (fileIO.ReadBoolean()) { @@ -2586,8 +664,8 @@ namespace Terraria.IO Main.chest[index5].item[index6] = new Item(); if (index6 < num5) { - int num7 = versionNumber < 59 ? (int) fileIO.ReadByte() : (int) fileIO.ReadInt16(); - if (num7 > 0) + int num6 = versionNumber < 59 ? (int) fileIO.ReadByte() : (int) fileIO.ReadInt16(); + if (num6 > 0) { if (versionNumber >= 38) { @@ -2595,10 +673,10 @@ namespace Terraria.IO } else { - short num8 = ItemID.FromLegacyName(fileIO.ReadString(), versionNumber); - Main.chest[index5].item[index6].SetDefaults((int) num8); + short num7 = ItemID.FromLegacyName(fileIO.ReadString(), versionNumber); + Main.chest[index5].item[index6].SetDefaults((int) num7); } - Main.chest[index5].item[index6].stack = num7; + Main.chest[index5].item[index6].stack = num6; if (versionNumber >= 36) Main.chest[index5].item[index6].Prefix((int) fileIO.ReadByte()); } @@ -2673,10 +751,1632 @@ namespace Terraria.IO Main.FakeLoadInvasionStart(); if (versionNumber < 7) return 0; - int num9 = fileIO.ReadBoolean() ? 1 : 0; + int num8 = fileIO.ReadBoolean() ? 1 : 0; string str1 = fileIO.ReadString(); - int num10 = fileIO.ReadInt32(); - return num9 != 0 && (str1 == Main.worldName || num10 == Main.worldID) ? 0 : 2; + int num9 = fileIO.ReadInt32(); + return num8 != 0 && (str1 == Main.worldName || num9 == Main.worldID) ? 0 : 2; } + + public static void SaveWorld_Version2(BinaryWriter writer) + { + int[] pointers = new int[10] + { + WorldFile.SaveFileFormatHeader(writer), + WorldFile.SaveWorldHeader(writer), + WorldFile.SaveWorldTiles(writer), + WorldFile.SaveChests(writer), + WorldFile.SaveSigns(writer), + WorldFile.SaveNPCs(writer), + WorldFile.SaveTileEntities(writer), + WorldFile.SaveWeightedPressurePlates(writer), + WorldFile.SaveTownManager(writer), + 0 + }; + WorldFile.SaveFooter(writer); + WorldFile.SaveHeaderPointers(writer, pointers); + } + + private static int SaveFileFormatHeader(BinaryWriter writer) + { + short num1 = 470; + short num2 = 10; + writer.Write(194); + Main.WorldFileMetadata.IncrementAndWrite(writer); + writer.Write(num2); + for (int index = 0; index < (int) num2; ++index) + writer.Write(0); + writer.Write(num1); + byte num3 = 0; + byte num4 = 1; + for (int index = 0; index < (int) num1; ++index) + { + if (Main.tileFrameImportant[index]) + num3 |= num4; + if (num4 == (byte) 128) + { + writer.Write(num3); + num3 = (byte) 0; + num4 = (byte) 1; + } + else + num4 <<= 1; + } + if (num4 != (byte) 1) + writer.Write(num3); + return (int) writer.BaseStream.Position; + } + + private static int SaveHeaderPointers(BinaryWriter writer, int[] pointers) + { + writer.BaseStream.Position = 0L; + writer.Write(194); + writer.BaseStream.Position += 20L; + writer.Write((short) pointers.Length); + for (int index = 0; index < pointers.Length; ++index) + writer.Write(pointers[index]); + return (int) writer.BaseStream.Position; + } + + private static int SaveWorldHeader(BinaryWriter writer) + { + writer.Write(Main.worldName); + writer.Write(Main.ActiveWorldFileData.SeedText); + writer.Write(Main.ActiveWorldFileData.WorldGeneratorVersion); + writer.Write(Main.ActiveWorldFileData.UniqueId.ToByteArray()); + writer.Write(Main.worldID); + writer.Write((int) Main.leftWorld); + writer.Write((int) Main.rightWorld); + writer.Write((int) Main.topWorld); + writer.Write((int) Main.bottomWorld); + writer.Write(Main.maxTilesY); + writer.Write(Main.maxTilesX); + writer.Write(Main.expertMode); + writer.Write(Main.ActiveWorldFileData.CreationTime.ToBinary()); + writer.Write((byte) Main.moonType); + writer.Write(Main.treeX[0]); + writer.Write(Main.treeX[1]); + writer.Write(Main.treeX[2]); + writer.Write(Main.treeStyle[0]); + writer.Write(Main.treeStyle[1]); + writer.Write(Main.treeStyle[2]); + writer.Write(Main.treeStyle[3]); + writer.Write(Main.caveBackX[0]); + writer.Write(Main.caveBackX[1]); + writer.Write(Main.caveBackX[2]); + writer.Write(Main.caveBackStyle[0]); + writer.Write(Main.caveBackStyle[1]); + writer.Write(Main.caveBackStyle[2]); + writer.Write(Main.caveBackStyle[3]); + writer.Write(Main.iceBackStyle); + writer.Write(Main.jungleBackStyle); + writer.Write(Main.hellBackStyle); + writer.Write(Main.spawnTileX); + writer.Write(Main.spawnTileY); + writer.Write(Main.worldSurface); + writer.Write(Main.rockLayer); + writer.Write(WorldFile.tempTime); + writer.Write(WorldFile.tempDayTime); + writer.Write(WorldFile.tempMoonPhase); + writer.Write(WorldFile.tempBloodMoon); + writer.Write(WorldFile.tempEclipse); + writer.Write(Main.dungeonX); + writer.Write(Main.dungeonY); + writer.Write(WorldGen.crimson); + writer.Write(NPC.downedBoss1); + writer.Write(NPC.downedBoss2); + writer.Write(NPC.downedBoss3); + writer.Write(NPC.downedQueenBee); + writer.Write(NPC.downedMechBoss1); + writer.Write(NPC.downedMechBoss2); + writer.Write(NPC.downedMechBoss3); + writer.Write(NPC.downedMechBossAny); + writer.Write(NPC.downedPlantBoss); + writer.Write(NPC.downedGolemBoss); + writer.Write(NPC.downedSlimeKing); + writer.Write(NPC.savedGoblin); + writer.Write(NPC.savedWizard); + writer.Write(NPC.savedMech); + writer.Write(NPC.downedGoblins); + writer.Write(NPC.downedClown); + writer.Write(NPC.downedFrost); + writer.Write(NPC.downedPirates); + writer.Write(WorldGen.shadowOrbSmashed); + writer.Write(WorldGen.spawnMeteor); + writer.Write((byte) WorldGen.shadowOrbCount); + writer.Write(WorldGen.altarCount); + writer.Write(Main.hardMode); + writer.Write(Main.invasionDelay); + writer.Write(Main.invasionSize); + writer.Write(Main.invasionType); + writer.Write(Main.invasionX); + writer.Write(Main.slimeRainTime); + writer.Write((byte) Main.sundialCooldown); + writer.Write(WorldFile.tempRaining); + writer.Write(WorldFile.tempRainTime); + writer.Write(WorldFile.tempMaxRain); + writer.Write(WorldGen.oreTier1); + writer.Write(WorldGen.oreTier2); + writer.Write(WorldGen.oreTier3); + writer.Write((byte) WorldGen.treeBG); + writer.Write((byte) WorldGen.corruptBG); + writer.Write((byte) WorldGen.jungleBG); + writer.Write((byte) WorldGen.snowBG); + writer.Write((byte) WorldGen.hallowBG); + writer.Write((byte) WorldGen.crimsonBG); + writer.Write((byte) WorldGen.desertBG); + writer.Write((byte) WorldGen.oceanBG); + writer.Write((int) Main.cloudBGActive); + writer.Write((short) Main.numClouds); + writer.Write(Main.windSpeedSet); + writer.Write(Main.anglerWhoFinishedToday.Count); + for (int index = 0; index < Main.anglerWhoFinishedToday.Count; ++index) + writer.Write(Main.anglerWhoFinishedToday[index]); + writer.Write(NPC.savedAngler); + writer.Write(Main.anglerQuest); + writer.Write(NPC.savedStylist); + writer.Write(NPC.savedTaxCollector); + writer.Write(Main.invasionSizeStart); + writer.Write(WorldFile.tempCultistDelay); + writer.Write((short) 580); + for (int index = 0; index < 580; ++index) + writer.Write(NPC.killCount[index]); + writer.Write(Main.fastForwardTime); + writer.Write(NPC.downedFishron); + writer.Write(NPC.downedMartians); + writer.Write(NPC.downedAncientCultist); + writer.Write(NPC.downedMoonlord); + writer.Write(NPC.downedHalloweenKing); + writer.Write(NPC.downedHalloweenTree); + writer.Write(NPC.downedChristmasIceQueen); + writer.Write(NPC.downedChristmasSantank); + writer.Write(NPC.downedChristmasTree); + writer.Write(NPC.downedTowerSolar); + writer.Write(NPC.downedTowerVortex); + writer.Write(NPC.downedTowerNebula); + writer.Write(NPC.downedTowerStardust); + writer.Write(NPC.TowerActiveSolar); + writer.Write(NPC.TowerActiveVortex); + writer.Write(NPC.TowerActiveNebula); + writer.Write(NPC.TowerActiveStardust); + writer.Write(NPC.LunarApocalypseIsUp); + writer.Write(WorldFile.tempPartyManual); + writer.Write(WorldFile.tempPartyGenuine); + writer.Write(WorldFile.tempPartyCooldown); + writer.Write(WorldFile.tempPartyCelebratingNPCs.Count); + for (int index = 0; index < WorldFile.tempPartyCelebratingNPCs.Count; ++index) + writer.Write(WorldFile.tempPartyCelebratingNPCs[index]); + writer.Write(WorldFile.Temp_Sandstorm_Happening); + writer.Write(WorldFile.Temp_Sandstorm_TimeLeft); + writer.Write(WorldFile.Temp_Sandstorm_Severity); + writer.Write(WorldFile.Temp_Sandstorm_IntendedSeverity); + writer.Write(NPC.savedBartender); + DD2Event.Save(writer); + return (int) writer.BaseStream.Position; + } + + private static int SaveWorldTiles(BinaryWriter writer) + { + byte[] buffer = new byte[13]; + for (int i = 0; i < Main.maxTilesX; ++i) + { + float num1 = (float) i / (float) Main.maxTilesX; + Main.statusText = Lang.gen[49].Value + " " + (object) (int) ((double) num1 * 100.0 + 1.0) + "%"; + int num2; + for (int j = 0; j < Main.maxTilesY; j = num2 + 1) + { + Tile tile = Main.tile[i, j]; + int index1 = 3; + int num3; + byte num4 = (byte) (num3 = 0); + byte num5 = (byte) num3; + byte num6 = (byte) num3; + bool flag = false; + if (tile.active()) + { + flag = true; + if (tile.type == (ushort) sbyte.MaxValue) + { + WorldGen.KillTile(i, j); + if (!tile.active()) + { + flag = false; + if (Main.netMode != 0) + NetMessage.SendData(17, number2: ((float) i), number3: ((float) j)); + } + } + } + if (flag) + { + num6 |= (byte) 2; + if (tile.type == (ushort) sbyte.MaxValue) + { + WorldGen.KillTile(i, j); + if (!tile.active() && Main.netMode != 0) + NetMessage.SendData(17, number2: ((float) i), number3: ((float) j)); + } + buffer[index1] = (byte) tile.type; + ++index1; + if (tile.type > (ushort) byte.MaxValue) + { + buffer[index1] = (byte) ((uint) tile.type >> 8); + ++index1; + num6 |= (byte) 32; + } + if (Main.tileFrameImportant[(int) tile.type]) + { + buffer[index1] = (byte) ((uint) tile.frameX & (uint) byte.MaxValue); + int index2 = index1 + 1; + buffer[index2] = (byte) (((int) tile.frameX & 65280) >> 8); + int index3 = index2 + 1; + buffer[index3] = (byte) ((uint) tile.frameY & (uint) byte.MaxValue); + int index4 = index3 + 1; + buffer[index4] = (byte) (((int) tile.frameY & 65280) >> 8); + index1 = index4 + 1; + } + if (tile.color() != (byte) 0) + { + num4 |= (byte) 8; + buffer[index1] = tile.color(); + ++index1; + } + } + if (tile.wall != (byte) 0) + { + num6 |= (byte) 4; + buffer[index1] = tile.wall; + ++index1; + if (tile.wallColor() != (byte) 0) + { + num4 |= (byte) 16; + buffer[index1] = tile.wallColor(); + ++index1; + } + } + if (tile.liquid != (byte) 0) + { + if (tile.lava()) + num6 |= (byte) 16; + else if (tile.honey()) + num6 |= (byte) 24; + else + num6 |= (byte) 8; + buffer[index1] = tile.liquid; + ++index1; + } + if (tile.wire()) + num5 |= (byte) 2; + if (tile.wire2()) + num5 |= (byte) 4; + if (tile.wire3()) + num5 |= (byte) 8; + int num7 = !tile.halfBrick() ? (tile.slope() == (byte) 0 ? 0 : (int) tile.slope() + 1 << 4) : 16; + byte num8 = (byte) ((uint) num5 | (uint) (byte) num7); + if (tile.actuator()) + num4 |= (byte) 2; + if (tile.inActive()) + num4 |= (byte) 4; + if (tile.wire4()) + num4 |= (byte) 32; + int index5 = 2; + if (num4 != (byte) 0) + { + num8 |= (byte) 1; + buffer[index5] = num4; + --index5; + } + if (num8 != (byte) 0) + { + num6 |= (byte) 1; + buffer[index5] = num8; + --index5; + } + short num9 = 0; + int index6 = j + 1; + for (int index7 = Main.maxTilesY - j - 1; index7 > 0 && tile.isTheSameAs(Main.tile[i, index6]); ++index6) + { + ++num9; + --index7; + } + num2 = j + (int) num9; + if (num9 > (short) 0) + { + buffer[index1] = (byte) ((uint) num9 & (uint) byte.MaxValue); + ++index1; + if (num9 > (short) byte.MaxValue) + { + num6 |= (byte) 128; + buffer[index1] = (byte) (((int) num9 & 65280) >> 8); + ++index1; + } + else + num6 |= (byte) 64; + } + buffer[index5] = num6; + writer.Write(buffer, index5, index1 - index5); + } + } + return (int) writer.BaseStream.Position; + } + + private static int SaveChests(BinaryWriter writer) + { + short num = 0; + for (int index = 0; index < 1000; ++index) + { + Chest chest = Main.chest[index]; + if (chest != null) + { + bool flag = false; + for (int x = chest.x; x <= chest.x + 1; ++x) + { + for (int y = chest.y; y <= chest.y + 1; ++y) + { + if (x < 0 || y < 0 || x >= Main.maxTilesX || y >= Main.maxTilesY) + { + flag = true; + break; + } + Tile tile = Main.tile[x, y]; + if (!tile.active() || !Main.tileContainer[(int) tile.type]) + { + flag = true; + break; + } + } + } + if (flag) + Main.chest[index] = (Chest) null; + else + ++num; + } + } + writer.Write(num); + writer.Write((short) 40); + for (int index1 = 0; index1 < 1000; ++index1) + { + Chest chest = Main.chest[index1]; + if (chest != null) + { + writer.Write(chest.x); + writer.Write(chest.y); + writer.Write(chest.name); + for (int index2 = 0; index2 < 40; ++index2) + { + Item obj = chest.item[index2]; + if (obj == null) + { + writer.Write((short) 0); + } + else + { + if (obj.stack > obj.maxStack) + obj.stack = obj.maxStack; + if (obj.stack < 0) + obj.stack = 1; + writer.Write((short) obj.stack); + if (obj.stack > 0) + { + writer.Write(obj.netID); + writer.Write(obj.prefix); + } + } + } + } + } + return (int) writer.BaseStream.Position; + } + + private static int SaveSigns(BinaryWriter writer) + { + short num = 0; + for (int index = 0; index < 1000; ++index) + { + Sign sign = Main.sign[index]; + if (sign != null && sign.text != null) + ++num; + } + writer.Write(num); + for (int index = 0; index < 1000; ++index) + { + Sign sign = Main.sign[index]; + if (sign != null && sign.text != null) + { + writer.Write(sign.text); + writer.Write(sign.x); + writer.Write(sign.y); + } + } + return (int) writer.BaseStream.Position; + } + + private static int SaveDummies(BinaryWriter writer) + { + int num = 0; + for (int index = 0; index < 1000; ++index) + { + if (DeprecatedClassLeftInForLoading.dummies[index] != null) + ++num; + } + writer.Write(num); + for (int index = 0; index < 1000; ++index) + { + DeprecatedClassLeftInForLoading dummy = DeprecatedClassLeftInForLoading.dummies[index]; + if (dummy != null) + { + writer.Write(dummy.x); + writer.Write(dummy.y); + } + } + return (int) writer.BaseStream.Position; + } + + private static int SaveNPCs(BinaryWriter writer) + { + for (int index = 0; index < Main.npc.Length; ++index) + { + NPC npc = Main.npc[index]; + if (npc.active && npc.townNPC && npc.type != 368) + { + writer.Write(npc.active); + writer.Write(npc.netID); + writer.Write(npc.GivenName); + writer.Write(npc.position.X); + writer.Write(npc.position.Y); + writer.Write(npc.homeless); + writer.Write(npc.homeTileX); + writer.Write(npc.homeTileY); + } + } + writer.Write(false); + for (int index = 0; index < Main.npc.Length; ++index) + { + NPC npc = Main.npc[index]; + if (npc.active && NPCID.Sets.SavesAndLoads[npc.type]) + { + writer.Write(npc.active); + writer.Write(npc.netID); + writer.WriteVector2(npc.position); + } + } + writer.Write(false); + return (int) writer.BaseStream.Position; + } + + private static int SaveFooter(BinaryWriter writer) + { + writer.Write(true); + writer.Write(Main.worldName); + writer.Write(Main.worldID); + return (int) writer.BaseStream.Position; + } + + public static int LoadWorld_Version2(BinaryReader reader) + { + reader.BaseStream.Position = 0L; + bool[] importance; + int[] positions; + if (!WorldFile.LoadFileFormatHeader(reader, out importance, out positions) || reader.BaseStream.Position != (long) positions[0]) + return 5; + WorldFile.LoadHeader(reader); + if (reader.BaseStream.Position != (long) positions[1]) + return 5; + WorldFile.LoadWorldTiles(reader, importance); + if (reader.BaseStream.Position != (long) positions[2]) + return 5; + WorldFile.LoadChests(reader); + if (reader.BaseStream.Position != (long) positions[3]) + return 5; + WorldFile.LoadSigns(reader); + if (reader.BaseStream.Position != (long) positions[4]) + return 5; + WorldFile.LoadNPCs(reader); + if (reader.BaseStream.Position != (long) positions[5]) + return 5; + if (WorldFile.versionNumber >= 116) + { + if (WorldFile.versionNumber < 122) + { + WorldFile.LoadDummies(reader); + if (reader.BaseStream.Position != (long) positions[6]) + return 5; + } + else + { + WorldFile.LoadTileEntities(reader); + if (reader.BaseStream.Position != (long) positions[6]) + return 5; + } + } + if (WorldFile.versionNumber >= 170) + { + WorldFile.LoadWeightedPressurePlates(reader); + if (reader.BaseStream.Position != (long) positions[7]) + return 5; + } + if (WorldFile.versionNumber >= 189) + { + WorldFile.LoadTownManager(reader); + if (reader.BaseStream.Position != (long) positions[8]) + return 5; + } + return WorldFile.LoadFooter(reader); + } + + private static bool LoadFileFormatHeader( + BinaryReader reader, + out bool[] importance, + out int[] positions) + { + importance = (bool[]) null; + positions = (int[]) null; + if ((WorldFile.versionNumber = reader.ReadInt32()) >= 135) + { + try + { + Main.WorldFileMetadata = FileMetadata.Read(reader, FileType.World); + } + catch (FileFormatException ex) + { + Console.WriteLine(Language.GetTextValue("Error.UnableToLoadWorld")); + Console.WriteLine((object) ex); + return false; + } + } + else + Main.WorldFileMetadata = FileMetadata.FromCurrentSettings(FileType.World); + short num1 = reader.ReadInt16(); + positions = new int[(int) num1]; + for (int index = 0; index < (int) num1; ++index) + positions[index] = reader.ReadInt32(); + short num2 = reader.ReadInt16(); + importance = new bool[(int) num2]; + byte num3 = 0; + byte num4 = 128; + for (int index = 0; index < (int) num2; ++index) + { + if (num4 == (byte) 128) + { + num3 = reader.ReadByte(); + num4 = (byte) 1; + } + else + num4 <<= 1; + if (((int) num3 & (int) num4) == (int) num4) + importance[index] = true; + } + return true; + } + + private static void LoadHeader(BinaryReader reader) + { + int versionNumber = WorldFile.versionNumber; + Main.worldName = reader.ReadString(); + if (versionNumber >= 179) + { + string seedText = versionNumber != 179 ? reader.ReadString() : reader.ReadInt32().ToString(); + Main.ActiveWorldFileData.SetSeed(seedText); + Main.ActiveWorldFileData.WorldGeneratorVersion = reader.ReadUInt64(); + } + Main.ActiveWorldFileData.UniqueId = versionNumber < 181 ? Guid.NewGuid() : new Guid(reader.ReadBytes(16)); + Main.worldID = reader.ReadInt32(); + Main.leftWorld = (float) reader.ReadInt32(); + Main.rightWorld = (float) reader.ReadInt32(); + Main.topWorld = (float) reader.ReadInt32(); + Main.bottomWorld = (float) reader.ReadInt32(); + Main.maxTilesY = reader.ReadInt32(); + Main.maxTilesX = reader.ReadInt32(); + WorldGen.clearWorld(); + Main.expertMode = versionNumber >= 112 && reader.ReadBoolean(); + if (versionNumber >= 141) + Main.ActiveWorldFileData.CreationTime = DateTime.FromBinary(reader.ReadInt64()); + Main.moonType = (int) reader.ReadByte(); + Main.treeX[0] = reader.ReadInt32(); + Main.treeX[1] = reader.ReadInt32(); + Main.treeX[2] = reader.ReadInt32(); + Main.treeStyle[0] = reader.ReadInt32(); + Main.treeStyle[1] = reader.ReadInt32(); + Main.treeStyle[2] = reader.ReadInt32(); + Main.treeStyle[3] = reader.ReadInt32(); + Main.caveBackX[0] = reader.ReadInt32(); + Main.caveBackX[1] = reader.ReadInt32(); + Main.caveBackX[2] = reader.ReadInt32(); + Main.caveBackStyle[0] = reader.ReadInt32(); + Main.caveBackStyle[1] = reader.ReadInt32(); + Main.caveBackStyle[2] = reader.ReadInt32(); + Main.caveBackStyle[3] = reader.ReadInt32(); + Main.iceBackStyle = reader.ReadInt32(); + Main.jungleBackStyle = reader.ReadInt32(); + Main.hellBackStyle = reader.ReadInt32(); + Main.spawnTileX = reader.ReadInt32(); + Main.spawnTileY = reader.ReadInt32(); + Main.worldSurface = reader.ReadDouble(); + Main.rockLayer = reader.ReadDouble(); + WorldFile.tempTime = reader.ReadDouble(); + WorldFile.tempDayTime = reader.ReadBoolean(); + WorldFile.tempMoonPhase = reader.ReadInt32(); + WorldFile.tempBloodMoon = reader.ReadBoolean(); + WorldFile.tempEclipse = reader.ReadBoolean(); + Main.eclipse = WorldFile.tempEclipse; + Main.dungeonX = reader.ReadInt32(); + Main.dungeonY = reader.ReadInt32(); + WorldGen.crimson = reader.ReadBoolean(); + NPC.downedBoss1 = reader.ReadBoolean(); + NPC.downedBoss2 = reader.ReadBoolean(); + NPC.downedBoss3 = reader.ReadBoolean(); + NPC.downedQueenBee = reader.ReadBoolean(); + NPC.downedMechBoss1 = reader.ReadBoolean(); + NPC.downedMechBoss2 = reader.ReadBoolean(); + NPC.downedMechBoss3 = reader.ReadBoolean(); + NPC.downedMechBossAny = reader.ReadBoolean(); + NPC.downedPlantBoss = reader.ReadBoolean(); + NPC.downedGolemBoss = reader.ReadBoolean(); + if (versionNumber >= 118) + NPC.downedSlimeKing = reader.ReadBoolean(); + NPC.savedGoblin = reader.ReadBoolean(); + NPC.savedWizard = reader.ReadBoolean(); + NPC.savedMech = reader.ReadBoolean(); + NPC.downedGoblins = reader.ReadBoolean(); + NPC.downedClown = reader.ReadBoolean(); + NPC.downedFrost = reader.ReadBoolean(); + NPC.downedPirates = reader.ReadBoolean(); + WorldGen.shadowOrbSmashed = reader.ReadBoolean(); + WorldGen.spawnMeteor = reader.ReadBoolean(); + WorldGen.shadowOrbCount = (int) reader.ReadByte(); + WorldGen.altarCount = reader.ReadInt32(); + Main.hardMode = reader.ReadBoolean(); + Main.invasionDelay = reader.ReadInt32(); + Main.invasionSize = reader.ReadInt32(); + Main.invasionType = reader.ReadInt32(); + Main.invasionX = reader.ReadDouble(); + if (versionNumber >= 118) + Main.slimeRainTime = reader.ReadDouble(); + if (versionNumber >= 113) + Main.sundialCooldown = (int) reader.ReadByte(); + WorldFile.tempRaining = reader.ReadBoolean(); + WorldFile.tempRainTime = reader.ReadInt32(); + WorldFile.tempMaxRain = reader.ReadSingle(); + WorldGen.oreTier1 = reader.ReadInt32(); + WorldGen.oreTier2 = reader.ReadInt32(); + WorldGen.oreTier3 = reader.ReadInt32(); + WorldGen.setBG(0, (int) reader.ReadByte()); + WorldGen.setBG(1, (int) reader.ReadByte()); + WorldGen.setBG(2, (int) reader.ReadByte()); + WorldGen.setBG(3, (int) reader.ReadByte()); + WorldGen.setBG(4, (int) reader.ReadByte()); + WorldGen.setBG(5, (int) reader.ReadByte()); + WorldGen.setBG(6, (int) reader.ReadByte()); + WorldGen.setBG(7, (int) reader.ReadByte()); + Main.cloudBGActive = (float) reader.ReadInt32(); + Main.cloudBGAlpha = (double) Main.cloudBGActive < 1.0 ? 0.0f : 1f; + Main.cloudBGActive = (float) -WorldGen.genRand.Next(8640, 86400); + Main.numClouds = (int) reader.ReadInt16(); + Main.windSpeedSet = reader.ReadSingle(); + Main.windSpeed = Main.windSpeedSet; + if (versionNumber < 95) + return; + Main.anglerWhoFinishedToday.Clear(); + for (int index = reader.ReadInt32(); index > 0; --index) + Main.anglerWhoFinishedToday.Add(reader.ReadString()); + if (versionNumber < 99) + return; + NPC.savedAngler = reader.ReadBoolean(); + if (versionNumber < 101) + return; + Main.anglerQuest = reader.ReadInt32(); + if (versionNumber < 104) + return; + NPC.savedStylist = reader.ReadBoolean(); + if (versionNumber >= 129) + NPC.savedTaxCollector = reader.ReadBoolean(); + if (versionNumber < 107) + { + if (Main.invasionType > 0 && Main.invasionSize > 0) + Main.FakeLoadInvasionStart(); + } + else + Main.invasionSizeStart = reader.ReadInt32(); + WorldFile.tempCultistDelay = versionNumber >= 108 ? reader.ReadInt32() : 86400; + if (versionNumber < 109) + return; + int num1 = (int) reader.ReadInt16(); + for (int index = 0; index < num1; ++index) + { + if (index < 580) + NPC.killCount[index] = reader.ReadInt32(); + else + reader.ReadInt32(); + } + if (versionNumber < 128) + return; + Main.fastForwardTime = reader.ReadBoolean(); + Main.UpdateSundial(); + if (versionNumber < 131) + return; + NPC.downedFishron = reader.ReadBoolean(); + NPC.downedMartians = reader.ReadBoolean(); + NPC.downedAncientCultist = reader.ReadBoolean(); + NPC.downedMoonlord = reader.ReadBoolean(); + NPC.downedHalloweenKing = reader.ReadBoolean(); + NPC.downedHalloweenTree = reader.ReadBoolean(); + NPC.downedChristmasIceQueen = reader.ReadBoolean(); + NPC.downedChristmasSantank = reader.ReadBoolean(); + NPC.downedChristmasTree = reader.ReadBoolean(); + if (versionNumber < 140) + return; + NPC.downedTowerSolar = reader.ReadBoolean(); + NPC.downedTowerVortex = reader.ReadBoolean(); + NPC.downedTowerNebula = reader.ReadBoolean(); + NPC.downedTowerStardust = reader.ReadBoolean(); + NPC.TowerActiveSolar = reader.ReadBoolean(); + NPC.TowerActiveVortex = reader.ReadBoolean(); + NPC.TowerActiveNebula = reader.ReadBoolean(); + NPC.TowerActiveStardust = reader.ReadBoolean(); + NPC.LunarApocalypseIsUp = reader.ReadBoolean(); + if (NPC.TowerActiveSolar) + NPC.ShieldStrengthTowerSolar = NPC.ShieldStrengthTowerMax; + if (NPC.TowerActiveVortex) + NPC.ShieldStrengthTowerVortex = NPC.ShieldStrengthTowerMax; + if (NPC.TowerActiveNebula) + NPC.ShieldStrengthTowerNebula = NPC.ShieldStrengthTowerMax; + if (NPC.TowerActiveStardust) + NPC.ShieldStrengthTowerStardust = NPC.ShieldStrengthTowerMax; + if (versionNumber < 170) + { + WorldFile.tempPartyManual = false; + WorldFile.tempPartyGenuine = false; + WorldFile.tempPartyCooldown = 0; + WorldFile.tempPartyCelebratingNPCs.Clear(); + } + else + { + WorldFile.tempPartyManual = reader.ReadBoolean(); + WorldFile.tempPartyGenuine = reader.ReadBoolean(); + WorldFile.tempPartyCooldown = reader.ReadInt32(); + int num2 = reader.ReadInt32(); + WorldFile.tempPartyCelebratingNPCs.Clear(); + for (int index = 0; index < num2; ++index) + WorldFile.tempPartyCelebratingNPCs.Add(reader.ReadInt32()); + } + if (versionNumber < 174) + { + WorldFile.Temp_Sandstorm_Happening = false; + WorldFile.Temp_Sandstorm_TimeLeft = 0; + WorldFile.Temp_Sandstorm_Severity = 0.0f; + WorldFile.Temp_Sandstorm_IntendedSeverity = 0.0f; + } + else + { + WorldFile.Temp_Sandstorm_Happening = reader.ReadBoolean(); + WorldFile.Temp_Sandstorm_TimeLeft = reader.ReadInt32(); + WorldFile.Temp_Sandstorm_Severity = reader.ReadSingle(); + WorldFile.Temp_Sandstorm_IntendedSeverity = reader.ReadSingle(); + } + DD2Event.Load(reader, versionNumber); + } + + private static void LoadWorldTiles(BinaryReader reader, bool[] importance) + { + for (int index1 = 0; index1 < Main.maxTilesX; ++index1) + { + float num1 = (float) index1 / (float) Main.maxTilesX; + Main.statusText = Lang.gen[51].Value + " " + (object) (int) ((double) num1 * 100.0 + 1.0) + "%"; + for (int index2 = 0; index2 < Main.maxTilesY; ++index2) + { + int index3 = -1; + byte num2; + byte num3 = num2 = (byte) 0; + Tile from = Main.tile[index1, index2]; + byte num4 = reader.ReadByte(); + if (((int) num4 & 1) == 1) + { + num3 = reader.ReadByte(); + if (((int) num3 & 1) == 1) + num2 = reader.ReadByte(); + } + if (((int) num4 & 2) == 2) + { + from.active(true); + if (((int) num4 & 32) == 32) + { + byte num5 = reader.ReadByte(); + index3 = (int) reader.ReadByte() << 8 | (int) num5; + } + else + index3 = (int) reader.ReadByte(); + from.type = (ushort) index3; + if (importance[index3]) + { + from.frameX = reader.ReadInt16(); + from.frameY = reader.ReadInt16(); + if (from.type == (ushort) 144) + from.frameY = (short) 0; + } + else + { + from.frameX = (short) -1; + from.frameY = (short) -1; + } + if (((int) num2 & 8) == 8) + from.color(reader.ReadByte()); + } + if (((int) num4 & 4) == 4) + { + from.wall = reader.ReadByte(); + if (((int) num2 & 16) == 16) + from.wallColor(reader.ReadByte()); + } + byte num6 = (byte) (((int) num4 & 24) >> 3); + if (num6 != (byte) 0) + { + from.liquid = reader.ReadByte(); + if (num6 > (byte) 1) + { + if (num6 == (byte) 2) + from.lava(true); + else + from.honey(true); + } + } + if (num3 > (byte) 1) + { + if (((int) num3 & 2) == 2) + from.wire(true); + if (((int) num3 & 4) == 4) + from.wire2(true); + if (((int) num3 & 8) == 8) + from.wire3(true); + byte num7 = (byte) (((int) num3 & 112) >> 4); + if (num7 != (byte) 0 && Main.tileSolid[(int) from.type]) + { + if (num7 == (byte) 1) + from.halfBrick(true); + else + from.slope((byte) ((uint) num7 - 1U)); + } + } + if (num2 > (byte) 0) + { + if (((int) num2 & 2) == 2) + from.actuator(true); + if (((int) num2 & 4) == 4) + from.inActive(true); + if (((int) num2 & 32) == 32) + from.wire4(true); + } + int num8; + switch ((byte) (((int) num4 & 192) >> 6)) + { + case 0: + num8 = 0; + break; + case 1: + num8 = (int) reader.ReadByte(); + break; + default: + num8 = (int) reader.ReadInt16(); + break; + } + if (index3 != -1) + { + if ((double) index2 <= Main.worldSurface) + { + if ((double) (index2 + num8) <= Main.worldSurface) + { + WorldGen.tileCounts[index3] += (num8 + 1) * 5; + } + else + { + int num9 = (int) (Main.worldSurface - (double) index2 + 1.0); + int num10 = num8 + 1 - num9; + WorldGen.tileCounts[index3] += num9 * 5 + num10; + } + } + else + WorldGen.tileCounts[index3] += num8 + 1; + } + for (; num8 > 0; --num8) + { + ++index2; + Main.tile[index1, index2].CopyFrom(from); + } + } + } + WorldGen.AddUpAlignmentCounts(true); + if (WorldFile.versionNumber >= 105) + return; + WorldGen.FixHearts(); + } + + private static void LoadChests(BinaryReader reader) + { + int num1 = (int) reader.ReadInt16(); + int num2 = (int) reader.ReadInt16(); + int num3; + int num4; + if (num2 < 40) + { + num3 = num2; + num4 = 0; + } + else + { + num3 = 40; + num4 = num2 - 40; + } + int index1; + for (index1 = 0; index1 < num1; ++index1) + { + Chest chest = new Chest(); + chest.x = reader.ReadInt32(); + chest.y = reader.ReadInt32(); + chest.name = reader.ReadString(); + for (int index2 = 0; index2 < num3; ++index2) + { + short num5 = reader.ReadInt16(); + Item obj = new Item(); + if (num5 > (short) 0) + { + obj.netDefaults(reader.ReadInt32()); + obj.stack = (int) num5; + obj.Prefix((int) reader.ReadByte()); + } + else if (num5 < (short) 0) + { + obj.netDefaults(reader.ReadInt32()); + obj.Prefix((int) reader.ReadByte()); + obj.stack = 1; + } + chest.item[index2] = obj; + } + for (int index3 = 0; index3 < num4; ++index3) + { + if (reader.ReadInt16() > (short) 0) + { + reader.ReadInt32(); + int num6 = (int) reader.ReadByte(); + } + } + Main.chest[index1] = chest; + } + List point16List = new List(); + for (int index4 = 0; index4 < index1; ++index4) + { + if (Main.chest[index4] != null) + { + Point16 point16 = new Point16(Main.chest[index4].x, Main.chest[index4].y); + if (point16List.Contains(point16)) + Main.chest[index4] = (Chest) null; + else + point16List.Add(point16); + } + } + for (; index1 < 1000; ++index1) + Main.chest[index1] = (Chest) null; + if (WorldFile.versionNumber >= 115) + return; + WorldFile.FixDresserChests(); + } + + private static void LoadSigns(BinaryReader reader) + { + short num = reader.ReadInt16(); + int index1; + for (index1 = 0; index1 < (int) num; ++index1) + { + string str = reader.ReadString(); + int index2 = reader.ReadInt32(); + int index3 = reader.ReadInt32(); + Tile tile = Main.tile[index2, index3]; + Sign sign; + if (tile.active() && Main.tileSign[(int) tile.type]) + { + sign = new Sign(); + sign.text = str; + sign.x = index2; + sign.y = index3; + } + else + sign = (Sign) null; + Main.sign[index1] = sign; + } + List point16List = new List(); + for (int index4 = 0; index4 < 1000; ++index4) + { + if (Main.sign[index4] != null) + { + Point16 point16 = new Point16(Main.sign[index4].x, Main.sign[index4].y); + if (point16List.Contains(point16)) + Main.sign[index4] = (Sign) null; + else + point16List.Add(point16); + } + } + for (; index1 < 1000; ++index1) + Main.sign[index1] = (Sign) null; + } + + private static void LoadDummies(BinaryReader reader) + { + int num = reader.ReadInt32(); + for (int index = 0; index < num; ++index) + DeprecatedClassLeftInForLoading.dummies[index] = new DeprecatedClassLeftInForLoading((int) reader.ReadInt16(), (int) reader.ReadInt16()); + for (int index = num; index < 1000; ++index) + DeprecatedClassLeftInForLoading.dummies[index] = (DeprecatedClassLeftInForLoading) null; + } + + private static void LoadNPCs(BinaryReader reader) + { + int index = 0; + for (bool flag = reader.ReadBoolean(); flag; flag = reader.ReadBoolean()) + { + NPC npc = Main.npc[index]; + if (WorldFile.versionNumber >= 190) + npc.SetDefaults(reader.ReadInt32()); + else + npc.SetDefaults(NPCID.FromLegacyName(reader.ReadString())); + npc.GivenName = reader.ReadString(); + npc.position.X = reader.ReadSingle(); + npc.position.Y = reader.ReadSingle(); + npc.homeless = reader.ReadBoolean(); + npc.homeTileX = reader.ReadInt32(); + npc.homeTileY = reader.ReadInt32(); + ++index; + } + if (WorldFile.versionNumber < 140) + return; + for (bool flag = reader.ReadBoolean(); flag; flag = reader.ReadBoolean()) + { + NPC npc = Main.npc[index]; + if (WorldFile.versionNumber >= 190) + npc.SetDefaults(reader.ReadInt32()); + else + npc.SetDefaults(NPCID.FromLegacyName(reader.ReadString())); + npc.position = reader.ReadVector2(); + ++index; + } + } + + private static int LoadFooter(BinaryReader reader) => !reader.ReadBoolean() || reader.ReadString() != Main.worldName || reader.ReadInt32() != Main.worldID ? 6 : 0; + + public static bool validateWorld(BinaryReader fileIO) + { + new Stopwatch().Start(); + try + { + Stream baseStream = fileIO.BaseStream; + int num1 = fileIO.ReadInt32(); + if (num1 == 0 || num1 > 194) + return false; + baseStream.Position = 0L; + bool[] importance; + int[] positions; + if (!WorldFile.LoadFileFormatHeader(fileIO, out importance, out positions)) + return false; + string str1 = fileIO.ReadString(); + if (num1 >= 179) + { + if (num1 == 179) + fileIO.ReadInt32(); + else + fileIO.ReadString(); + long num2 = (long) fileIO.ReadUInt64(); + } + if (num1 >= 181) + fileIO.ReadBytes(16); + int num3 = fileIO.ReadInt32(); + fileIO.ReadInt32(); + fileIO.ReadInt32(); + fileIO.ReadInt32(); + fileIO.ReadInt32(); + int num4 = fileIO.ReadInt32(); + int num5 = fileIO.ReadInt32(); + baseStream.Position = (long) positions[1]; + for (int index1 = 0; index1 < num5; ++index1) + { + float num6 = (float) index1 / (float) Main.maxTilesX; + Main.statusText = Lang.gen[73].Value + " " + (object) (int) ((double) num6 * 100.0 + 1.0) + "%"; + int num7; + for (int index2 = 0; index2 < num4; index2 = index2 + num7 + 1) + { + byte num8 = 0; + byte num9 = fileIO.ReadByte(); + if (((int) num9 & 1) == 1 && ((int) fileIO.ReadByte() & 1) == 1) + num8 = fileIO.ReadByte(); + if (((int) num9 & 2) == 2) + { + int index3; + if (((int) num9 & 32) == 32) + { + byte num10 = fileIO.ReadByte(); + index3 = (int) fileIO.ReadByte() << 8 | (int) num10; + } + else + index3 = (int) fileIO.ReadByte(); + if (importance[index3]) + { + int num11 = (int) fileIO.ReadInt16(); + int num12 = (int) fileIO.ReadInt16(); + } + if (((int) num8 & 8) == 8) + { + int num13 = (int) fileIO.ReadByte(); + } + } + if (((int) num9 & 4) == 4) + { + int num14 = (int) fileIO.ReadByte(); + if (((int) num8 & 16) == 16) + { + int num15 = (int) fileIO.ReadByte(); + } + } + if (((int) num9 & 24) >> 3 != 0) + { + int num16 = (int) fileIO.ReadByte(); + } + switch ((byte) (((int) num9 & 192) >> 6)) + { + case 0: + num7 = 0; + break; + case 1: + num7 = (int) fileIO.ReadByte(); + break; + default: + num7 = (int) fileIO.ReadInt16(); + break; + } + } + } + if (baseStream.Position != (long) positions[2]) + return false; + int num17 = (int) fileIO.ReadInt16(); + int num18 = (int) fileIO.ReadInt16(); + for (int index4 = 0; index4 < num17; ++index4) + { + fileIO.ReadInt32(); + fileIO.ReadInt32(); + fileIO.ReadString(); + for (int index5 = 0; index5 < num18; ++index5) + { + if (fileIO.ReadInt16() > (short) 0) + { + fileIO.ReadInt32(); + int num19 = (int) fileIO.ReadByte(); + } + } + } + if (baseStream.Position != (long) positions[3]) + return false; + int num20 = (int) fileIO.ReadInt16(); + for (int index = 0; index < num20; ++index) + { + fileIO.ReadString(); + fileIO.ReadInt32(); + fileIO.ReadInt32(); + } + if (baseStream.Position != (long) positions[4]) + return false; + for (bool flag = fileIO.ReadBoolean(); flag; flag = fileIO.ReadBoolean()) + { + fileIO.ReadInt32(); + fileIO.ReadString(); + double num21 = (double) fileIO.ReadSingle(); + double num22 = (double) fileIO.ReadSingle(); + fileIO.ReadBoolean(); + fileIO.ReadInt32(); + fileIO.ReadInt32(); + } + for (bool flag = fileIO.ReadBoolean(); flag; flag = fileIO.ReadBoolean()) + { + fileIO.ReadInt32(); + double num23 = (double) fileIO.ReadSingle(); + double num24 = (double) fileIO.ReadSingle(); + } + if (baseStream.Position != (long) positions[5]) + return false; + if (WorldFile.versionNumber >= 116 && WorldFile.versionNumber <= 121) + { + int num25 = fileIO.ReadInt32(); + for (int index = 0; index < num25; ++index) + { + int num26 = (int) fileIO.ReadInt16(); + int num27 = (int) fileIO.ReadInt16(); + } + if (baseStream.Position != (long) positions[6]) + return false; + } + if (WorldFile.versionNumber >= 122) + { + int num28 = fileIO.ReadInt32(); + for (int index = 0; index < num28; ++index) + TileEntity.Read(fileIO); + } + if (WorldFile.versionNumber >= 170) + { + int num29 = fileIO.ReadInt32(); + for (int index = 0; index < num29; ++index) + fileIO.ReadInt64(); + } + if (WorldFile.versionNumber >= 189) + { + int num30 = fileIO.ReadInt32(); + fileIO.ReadBytes(12 * num30); + } + int num31 = fileIO.ReadBoolean() ? 1 : 0; + string str2 = fileIO.ReadString(); + int num32 = fileIO.ReadInt32(); + bool flag1 = false; + if (num31 != 0 && (str2 == str1 || num32 == num3)) + flag1 = true; + return flag1; + } + catch (Exception ex) + { + using (StreamWriter streamWriter = new StreamWriter("client-crashlog.txt", true)) + { + streamWriter.WriteLine((object) DateTime.Now); + streamWriter.WriteLine((object) ex); + streamWriter.WriteLine(""); + } + return false; + } + } + + public static string GetWorldName(string WorldFileName) + { + if (WorldFileName == null) + return string.Empty; + try + { + using (FileStream fileStream = new FileStream(WorldFileName, FileMode.Open)) + { + using (BinaryReader binaryReader = new BinaryReader((Stream) fileStream)) + { + int num1 = binaryReader.ReadInt32(); + if (num1 > 0) + { + if (num1 <= 194) + { + if (num1 <= 87) + { + string str = binaryReader.ReadString(); + binaryReader.Close(); + return str; + } + if (num1 >= 135) + binaryReader.BaseStream.Position += 20L; + int num2 = (int) binaryReader.ReadInt16(); + fileStream.Position = (long) binaryReader.ReadInt32(); + string str1 = binaryReader.ReadString(); + binaryReader.Close(); + return str1; + } + } + } + } + } + catch + { + } + string[] strArray = WorldFileName.Split(Path.DirectorySeparatorChar); + string str2 = strArray[strArray.Length - 1]; + return str2.Substring(0, str2.Length - 4); + } + + public static bool GetWorldDifficulty(string WorldFileName) + { + if (WorldFileName == null) + return false; + try + { + using (FileStream fileStream = new FileStream(WorldFileName, FileMode.Open)) + { + using (BinaryReader binaryReader = new BinaryReader((Stream) fileStream)) + { + int num1 = binaryReader.ReadInt32(); + if (num1 >= 135) + binaryReader.BaseStream.Position += 20L; + if (num1 >= 112) + { + if (num1 <= 194) + { + int num2 = (int) binaryReader.ReadInt16(); + fileStream.Position = (long) binaryReader.ReadInt32(); + binaryReader.ReadString(); + binaryReader.ReadInt32(); + binaryReader.ReadInt32(); + binaryReader.ReadInt32(); + binaryReader.ReadInt32(); + binaryReader.ReadInt32(); + binaryReader.ReadInt32(); + binaryReader.ReadInt32(); + return binaryReader.ReadBoolean(); + } + } + } + } + } + catch + { + } + return false; + } + + public static bool IsValidWorld(string file, bool cloudSave) => WorldFile.GetFileMetadata(file, cloudSave) != null; + + public static WorldFileData GetAllMetadata(string file, bool cloudSave) + { + if (file == null || cloudSave && SocialAPI.Cloud == null) + return (WorldFileData) null; + WorldFileData worldFileData = new WorldFileData(file, cloudSave); + if (!FileUtilities.Exists(file, cloudSave)) + { + worldFileData.CreationTime = DateTime.Now; + worldFileData.Metadata = FileMetadata.FromCurrentSettings(FileType.World); + return worldFileData; + } + try + { + using (Stream input = cloudSave ? (Stream) new MemoryStream(SocialAPI.Cloud.Read(file)) : (Stream) new FileStream(file, FileMode.Open)) + { + using (BinaryReader reader = new BinaryReader(input)) + { + int num1 = reader.ReadInt32(); + if (num1 >= 135) + worldFileData.Metadata = FileMetadata.Read(reader, FileType.World); + else + worldFileData.Metadata = FileMetadata.FromCurrentSettings(FileType.World); + if (num1 <= 194) + { + int num2 = (int) reader.ReadInt16(); + input.Position = (long) reader.ReadInt32(); + worldFileData.Name = reader.ReadString(); + if (num1 >= 179) + { + string seedText = num1 != 179 ? reader.ReadString() : reader.ReadInt32().ToString(); + worldFileData.SetSeed(seedText); + worldFileData.WorldGeneratorVersion = reader.ReadUInt64(); + } + else + { + worldFileData.SetSeedToEmpty(); + worldFileData.WorldGeneratorVersion = 0UL; + } + worldFileData.UniqueId = num1 < 181 ? Guid.Empty : new Guid(reader.ReadBytes(16)); + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadInt32(); + int y = reader.ReadInt32(); + int x = reader.ReadInt32(); + worldFileData.SetWorldSize(x, y); + worldFileData.IsExpertMode = num1 >= 112 && reader.ReadBoolean(); + worldFileData.CreationTime = num1 < 141 ? (cloudSave ? DateTime.Now : File.GetCreationTime(file)) : DateTime.FromBinary(reader.ReadInt64()); + int num3 = (int) reader.ReadByte(); + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadInt32(); + reader.ReadDouble(); + reader.ReadDouble(); + reader.ReadDouble(); + reader.ReadBoolean(); + reader.ReadInt32(); + reader.ReadBoolean(); + reader.ReadBoolean(); + reader.ReadInt32(); + reader.ReadInt32(); + worldFileData.HasCrimson = reader.ReadBoolean(); + reader.ReadBoolean(); + reader.ReadBoolean(); + reader.ReadBoolean(); + reader.ReadBoolean(); + reader.ReadBoolean(); + reader.ReadBoolean(); + reader.ReadBoolean(); + reader.ReadBoolean(); + reader.ReadBoolean(); + reader.ReadBoolean(); + int num4 = num1 < 118 ? 0 : (reader.ReadBoolean() ? 1 : 0); + reader.ReadBoolean(); + reader.ReadBoolean(); + reader.ReadBoolean(); + reader.ReadBoolean(); + reader.ReadBoolean(); + reader.ReadBoolean(); + reader.ReadBoolean(); + reader.ReadBoolean(); + reader.ReadBoolean(); + int num5 = (int) reader.ReadByte(); + reader.ReadInt32(); + worldFileData.IsHardMode = reader.ReadBoolean(); + return worldFileData; + } + } + } + } + catch (Exception ex) + { + } + return (WorldFileData) null; + } + + public static WorldFileData CreateMetadata( + string name, + bool cloudSave, + bool isExpertMode) + { + WorldFileData worldFileData = new WorldFileData(Main.GetWorldPathFromName(name, cloudSave), cloudSave); + worldFileData.Name = name; + worldFileData.IsExpertMode = isExpertMode; + worldFileData.CreationTime = DateTime.Now; + worldFileData.Metadata = FileMetadata.FromCurrentSettings(FileType.World); + worldFileData.SetFavorite(false); + worldFileData.WorldGeneratorVersion = 833223655425UL; + worldFileData.UniqueId = Guid.NewGuid(); + if (Main.DefaultSeed == "") + worldFileData.SetSeedToRandom(); + else + worldFileData.SetSeed(Main.DefaultSeed); + return worldFileData; + } + + public static FileMetadata GetFileMetadata(string file, bool cloudSave) + { + if (file == null) + return (FileMetadata) null; + try + { + byte[] buffer = (byte[]) null; + int num = !cloudSave ? 0 : (SocialAPI.Cloud != null ? 1 : 0); + if (num != 0) + { + int length = 24; + buffer = new byte[length]; + SocialAPI.Cloud.Read(file, buffer, length); + } + using (Stream input = num != 0 ? (Stream) new MemoryStream(buffer) : (Stream) new FileStream(file, FileMode.Open)) + { + using (BinaryReader reader = new BinaryReader(input)) + return reader.ReadInt32() >= 135 ? FileMetadata.Read(reader, FileType.World) : FileMetadata.FromCurrentSettings(FileType.World); + } + } + catch + { + } + return (FileMetadata) null; + } + + public static void ResetTemps() + { + WorldFile.tempRaining = false; + WorldFile.tempMaxRain = 0.0f; + WorldFile.tempRainTime = 0; + WorldFile.tempDayTime = true; + WorldFile.tempBloodMoon = false; + WorldFile.tempEclipse = false; + WorldFile.tempMoonPhase = 0; + Main.anglerWhoFinishedToday.Clear(); + Main.anglerQuestFinished = false; + } + + public static void FixDresserChests() + { + for (int X = 0; X < Main.maxTilesX; ++X) + { + for (int Y = 0; Y < Main.maxTilesY; ++Y) + { + Tile tile = Main.tile[X, Y]; + if (tile.active() && tile.type == (ushort) 88 && (int) tile.frameX % 54 == 0 && (int) tile.frameY % 36 == 0) + Chest.CreateChest(X, Y); + } + } + } + + private static int SaveTileEntities(BinaryWriter writer) + { + writer.Write(TileEntity.ByID.Count); + foreach (KeyValuePair keyValuePair in TileEntity.ByID) + TileEntity.Write(writer, keyValuePair.Value); + return (int) writer.BaseStream.Position; + } + + private static void LoadTileEntities(BinaryReader reader) + { + TileEntity.ByID.Clear(); + TileEntity.ByPosition.Clear(); + int num1 = reader.ReadInt32(); + int num2 = 0; + for (int index = 0; index < num1; ++index) + { + TileEntity tileEntity1 = TileEntity.Read(reader); + tileEntity1.ID = num2++; + TileEntity.ByID[tileEntity1.ID] = tileEntity1; + TileEntity tileEntity2; + if (TileEntity.ByPosition.TryGetValue(tileEntity1.Position, out tileEntity2)) + TileEntity.ByID.Remove(tileEntity2.ID); + TileEntity.ByPosition[tileEntity1.Position] = tileEntity1; + } + TileEntity.TileEntitiesNextID = num1; + List point16List = new List(); + foreach (KeyValuePair keyValuePair in TileEntity.ByPosition) + { + if (!WorldGen.InWorld((int) keyValuePair.Value.Position.X, (int) keyValuePair.Value.Position.Y, 1)) + { + point16List.Add(keyValuePair.Value.Position); + } + else + { + if (keyValuePair.Value.type == (byte) 0 && !TETrainingDummy.ValidTile((int) keyValuePair.Value.Position.X, (int) keyValuePair.Value.Position.Y)) + point16List.Add(keyValuePair.Value.Position); + if (keyValuePair.Value.type == (byte) 2 && !TELogicSensor.ValidTile((int) keyValuePair.Value.Position.X, (int) keyValuePair.Value.Position.Y)) + point16List.Add(keyValuePair.Value.Position); + if (keyValuePair.Value.type == (byte) 1 && !TEItemFrame.ValidTile((int) keyValuePair.Value.Position.X, (int) keyValuePair.Value.Position.Y)) + point16List.Add(keyValuePair.Value.Position); + } + } + try + { + foreach (Point16 key in point16List) + { + TileEntity tileEntity = TileEntity.ByPosition[key]; + if (TileEntity.ByID.ContainsKey(tileEntity.ID)) + TileEntity.ByID.Remove(tileEntity.ID); + if (TileEntity.ByPosition.ContainsKey(key)) + TileEntity.ByPosition.Remove(key); + } + } + catch + { + } + } + + private static int SaveWeightedPressurePlates(BinaryWriter writer) + { + writer.Write(PressurePlateHelper.PressurePlatesPressed.Count); + foreach (KeyValuePair keyValuePair in PressurePlateHelper.PressurePlatesPressed) + { + writer.Write(keyValuePair.Key.X); + writer.Write(keyValuePair.Key.Y); + } + return (int) writer.BaseStream.Position; + } + + private static void LoadWeightedPressurePlates(BinaryReader reader) + { + PressurePlateHelper.Reset(); + PressurePlateHelper.NeedsFirstUpdate = true; + int num = reader.ReadInt32(); + for (int index = 0; index < num; ++index) + { + Point key = new Point(reader.ReadInt32(), reader.ReadInt32()); + PressurePlateHelper.PressurePlatesPressed.Add(key, new bool[(int) byte.MaxValue]); + } + } + + private static int SaveTownManager(BinaryWriter writer) + { + WorldGen.TownManager.Save(writer); + return (int) writer.BaseStream.Position; + } + + private static void LoadTownManager(BinaryReader reader) => WorldGen.TownManager.Load(reader); } } diff --git a/IO/WorldFileData.cs b/IO/WorldFileData.cs index 6d0d996..1c9b379 100644 --- a/IO/WorldFileData.cs +++ b/IO/WorldFileData.cs @@ -1,10 +1,9 @@ // Decompiled with JetBrains decompiler // Type: Terraria.IO.WorldFileData -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe -using ReLogic.Utilities; using System; using System.IO; using Terraria.Localization; @@ -24,8 +23,7 @@ namespace Terraria.IO public bool IsValid = true; public Guid UniqueId; public LocalizedText _worldSizeName; - public int GameMode; - public bool DrunkWorld; + public bool IsExpertMode; public bool HasCorruption = true; public bool IsHardMode; @@ -45,24 +43,6 @@ namespace Terraria.IO public bool UseGuidAsMapName => this.WorldGeneratorVersion >= 777389080577UL; - public string GetFullSeedText() - { - int num1 = 0; - if (this.WorldSizeX == 4200 && this.WorldSizeY == 1200) - num1 = 1; - if (this.WorldSizeX == 6400 && this.WorldSizeY == 1800) - num1 = 2; - if (this.WorldSizeX == 8400 && this.WorldSizeY == 2400) - num1 = 3; - int num2 = 0; - if (this.HasCorruption) - num2 = 1; - if (this.HasCrimson) - num2 = 2; - int num3 = this.GameMode + 1; - return string.Format("{0}.{1}.{2}.{3}", (object) num1, (object) num3, (object) num2, (object) this._seedText); - } - public WorldFileData() : base("World") { @@ -99,7 +79,7 @@ namespace Terraria.IO public static WorldFileData FromInvalidWorld(string path, bool cloudSave) { WorldFileData worldFileData = new WorldFileData(path, cloudSave); - worldFileData.GameMode = 0; + worldFileData.IsExpertMode = false; worldFileData.SetSeedToEmpty(); worldFileData.WorldGeneratorVersion = 0UL; worldFileData.Metadata = FileMetadata.FromCurrentSettings(FileType.World); @@ -118,10 +98,9 @@ namespace Terraria.IO public void SetSeed(string seedText) { this._seedText = seedText; - WorldGen.currentWorldSeed = seedText; if (!int.TryParse(seedText, out this._seed)) - this._seed = Crc32.Calculate(seedText); - this._seed = this._seed == int.MinValue ? int.MaxValue : Math.Abs(this._seed); + this._seed = seedText.GetHashCode(); + this._seed = Math.Abs(this._seed); } public void SetSeedToRandom() => this.SetSeed(new UnifiedRandom().Next().ToString()); diff --git a/IngameOptions.cs b/IngameOptions.cs index 50a17e5..008d746 100644 --- a/IngameOptions.cs +++ b/IngameOptions.cs @@ -1,17 +1,13 @@ // Decompiled with JetBrains decompiler // Type: Terraria.IngameOptions -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; -using System.Collections.Generic; -using System.Linq; -using Terraria.Audio; using Terraria.GameContent; -using Terraria.GameContent.UI; using Terraria.GameInput; using Terraria.Localization; using Terraria.Social; @@ -24,7 +20,7 @@ namespace Terraria { public const int width = 670; public const int height = 480; - public static float[] leftScale = new float[10] + public static float[] leftScale = new float[9] { 0.7f, 0.7f, @@ -34,10 +30,9 @@ namespace Terraria 0.7f, 0.7f, 0.7f, - 0.7f, 0.7f }; - public static float[] rightScale = new float[16] + public static float[] rightScale = new float[15] { 0.7f, 0.7f, @@ -53,50 +48,28 @@ namespace Terraria 0.7f, 0.7f, 0.7f, - 0.7f, 0.7f }; - private static Dictionary _leftSideCategoryMapping = new Dictionary() - { - { - 0, - 0 - }, - { - 1, - 1 - }, - { - 2, - 2 - }, - { - 3, - 3 - } - }; public static bool[] skipRightSlot = new bool[20]; public static int leftHover = -1; public static int rightHover = -1; public static int oldLeftHover = -1; public static int oldRightHover = -1; public static int rightLock = -1; - public static bool inBar; - public static bool notBar; - public static bool noSound; - private static Rectangle _GUIHover; - public static int category; + public static bool inBar = false; + public static bool notBar = false; + public static bool noSound = false; + private static Rectangle _GUIHover = new Rectangle(); + public static int category = 0; public static Vector2 valuePosition = Vector2.Zero; private static string _mouseOverText; public static void Open() { - Main.ClosePlayerChat(); - Main.chatText = ""; Main.playerInventory = false; Main.editChest = false; Main.npcChatText = ""; - SoundEngine.PlaySound(10); + Main.PlaySound(10); Main.ingameOptionsWindow = true; IngameOptions.category = 0; for (int index = 0; index < IngameOptions.leftScale.Length; ++index) @@ -118,7 +91,7 @@ namespace Terraria if (Main.setKey != -1) return; Main.ingameOptionsWindow = false; - SoundEngine.PlaySound(11); + Main.PlaySound(11); Recipe.FindRecipes(); Main.playerInventory = true; Main.SaveSettings(); @@ -126,1082 +99,983 @@ namespace Terraria public static void Draw(Main mainInstance, SpriteBatch sb) { - for (int index = 0; index < IngameOptions.skipRightSlot.Length; ++index) - IngameOptions.skipRightSlot[index] = false; - bool flag1 = GameCulture.FromCultureName(GameCulture.CultureName.Russian).IsActive || GameCulture.FromCultureName(GameCulture.CultureName.Portuguese).IsActive || GameCulture.FromCultureName(GameCulture.CultureName.Polish).IsActive || GameCulture.FromCultureName(GameCulture.CultureName.French).IsActive; - bool isActive1 = GameCulture.FromCultureName(GameCulture.CultureName.Polish).IsActive; - bool isActive2 = GameCulture.FromCultureName(GameCulture.CultureName.German).IsActive; - bool flag2 = GameCulture.FromCultureName(GameCulture.CultureName.Italian).IsActive || GameCulture.FromCultureName(GameCulture.CultureName.Spanish).IsActive; - bool flag3 = false; - int num1 = 70; - float scale = 0.75f; - float num2 = 60f; - float num3 = 300f; - if (flag1) - flag3 = true; - if (isActive1) - num3 = 200f; - Vector2 vector2_1 = new Vector2((float) Main.mouseX, (float) Main.mouseY); - bool flag4 = Main.mouseLeft && Main.mouseLeftRelease; - Vector2 vector2_2 = new Vector2((float) Main.screenWidth, (float) Main.screenHeight); - Vector2 vector2_3 = new Vector2(670f, 480f); - Vector2 vector2_4 = vector2_2 / 2f - vector2_3 / 2f; - int num4 = 20; - IngameOptions._GUIHover = new Rectangle((int) ((double) vector2_4.X - (double) num4), (int) ((double) vector2_4.Y - (double) num4), (int) ((double) vector2_3.X + (double) (num4 * 2)), (int) ((double) vector2_3.Y + (double) (num4 * 2))); - Utils.DrawInvBG(sb, vector2_4.X - (float) num4, vector2_4.Y - (float) num4, vector2_3.X + (float) (num4 * 2), vector2_3.Y + (float) (num4 * 2), new Color(33, 15, 91, (int) byte.MaxValue) * 0.685f); - if (new Rectangle((int) vector2_4.X - num4, (int) vector2_4.Y - num4, (int) vector2_3.X + num4 * 2, (int) vector2_3.Y + num4 * 2).Contains(new Point(Main.mouseX, Main.mouseY))) - Main.player[Main.myPlayer].mouseInterface = true; - Utils.DrawBorderString(sb, Language.GetTextValue("GameUI.SettingsMenu"), vector2_4 + vector2_3 * new Vector2(0.5f, 0.0f), Color.White, anchorx: 0.5f); - if (flag1) + if (Main.player[Main.myPlayer].dead && !Main.player[Main.myPlayer].ghost) { - Utils.DrawInvBG(sb, vector2_4.X + (float) (num4 / 2), vector2_4.Y + (float) (num4 * 5 / 2), vector2_3.X / 3f - (float) num4, vector2_3.Y - (float) (num4 * 3)); - Utils.DrawInvBG(sb, vector2_4.X + vector2_3.X / 3f + (float) num4, vector2_4.Y + (float) (num4 * 5 / 2), (float) ((double) vector2_3.X * 2.0 / 3.0) - (float) (num4 * 3 / 2), vector2_3.Y - (float) (num4 * 3)); + Main.setKey = -1; + IngameOptions.Close(); + Main.playerInventory = false; } else { - Utils.DrawInvBG(sb, vector2_4.X + (float) (num4 / 2), vector2_4.Y + (float) (num4 * 5 / 2), vector2_3.X / 2f - (float) num4, vector2_3.Y - (float) (num4 * 3)); - Utils.DrawInvBG(sb, vector2_4.X + vector2_3.X / 2f + (float) num4, vector2_4.Y + (float) (num4 * 5 / 2), vector2_3.X / 2f - (float) (num4 * 3 / 2), vector2_3.Y - (float) (num4 * 3)); - } - float num5 = 0.7f; - float num6 = 0.8f; - float num7 = 0.01f; - if (flag1) - { - num5 = 0.4f; - num6 = 0.44f; - } - if (isActive2) - { - num5 = 0.55f; - num6 = 0.6f; - } - if (IngameOptions.oldLeftHover != IngameOptions.leftHover && IngameOptions.leftHover != -1) - SoundEngine.PlaySound(12); - if (IngameOptions.oldRightHover != IngameOptions.rightHover && IngameOptions.rightHover != -1) - SoundEngine.PlaySound(12); - if (flag4 && IngameOptions.rightHover != -1 && !IngameOptions.noSound) - SoundEngine.PlaySound(12); - IngameOptions.oldLeftHover = IngameOptions.leftHover; - IngameOptions.oldRightHover = IngameOptions.rightHover; - IngameOptions.noSound = false; - bool flag5 = SocialAPI.Network != null && SocialAPI.Network.CanInvite(); - int num8 = 5 + (flag5 ? 1 : 0) + 2; - Vector2 anchor1 = new Vector2(vector2_4.X + vector2_3.X / 4f, vector2_4.Y + (float) (num4 * 5 / 2)); - Vector2 offset1 = new Vector2(0.0f, vector2_3.Y - (float) (num4 * 5)) / (float) (num8 + 1); - if (flag1) - anchor1.X -= 55f; - UILinkPointNavigator.Shortcuts.INGAMEOPTIONS_BUTTONS_LEFT = num8 + 1; - for (int key = 0; key <= num8; ++key) - { - bool flag6 = false; - int num9; - if (IngameOptions._leftSideCategoryMapping.TryGetValue(key, out num9)) - flag6 = IngameOptions.category == num9; - if (IngameOptions.leftHover == key | flag6) - IngameOptions.leftScale[key] += num7; + for (int index = 0; index < IngameOptions.skipRightSlot.Length; ++index) + IngameOptions.skipRightSlot[index] = false; + bool flag1 = GameCulture.Russian.IsActive || GameCulture.Portuguese.IsActive || GameCulture.Polish.IsActive || GameCulture.French.IsActive; + bool isActive1 = GameCulture.Polish.IsActive; + bool isActive2 = GameCulture.German.IsActive; + bool flag2 = GameCulture.Italian.IsActive || GameCulture.Spanish.IsActive; + bool flag3 = false; + int num1 = 70; + float scale = 0.75f; + float num2 = 60f; + float num3 = 300f; + if (flag1) + flag3 = true; + if (isActive1) + num3 = 200f; + Vector2 vector2_1 = new Vector2((float) Main.mouseX, (float) Main.mouseY); + bool flag4 = Main.mouseLeft && Main.mouseLeftRelease; + Vector2 vector2_2 = new Vector2((float) Main.screenWidth, (float) Main.screenHeight); + Vector2 vector2_3 = new Vector2(670f, 480f); + Vector2 vector2_4 = vector2_2 / 2f - vector2_3 / 2f; + int num4 = 20; + IngameOptions._GUIHover = new Rectangle((int) ((double) vector2_4.X - (double) num4), (int) ((double) vector2_4.Y - (double) num4), (int) ((double) vector2_3.X + (double) (num4 * 2)), (int) ((double) vector2_3.Y + (double) (num4 * 2))); + Utils.DrawInvBG(sb, vector2_4.X - (float) num4, vector2_4.Y - (float) num4, vector2_3.X + (float) (num4 * 2), vector2_3.Y + (float) (num4 * 2), new Color(33, 15, 91, (int) byte.MaxValue) * 0.685f); + if (new Rectangle((int) vector2_4.X - num4, (int) vector2_4.Y - num4, (int) vector2_3.X + num4 * 2, (int) vector2_3.Y + num4 * 2).Contains(new Point(Main.mouseX, Main.mouseY))) + Main.player[Main.myPlayer].mouseInterface = true; + Utils.DrawBorderString(sb, Language.GetTextValue("GameUI.SettingsMenu"), vector2_4 + vector2_3 * new Vector2(0.5f, 0.0f), Color.White, anchorx: 0.5f); + if (flag1) + { + Utils.DrawInvBG(sb, vector2_4.X + (float) (num4 / 2), vector2_4.Y + (float) (num4 * 5 / 2), vector2_3.X / 3f - (float) num4, vector2_3.Y - (float) (num4 * 3)); + Utils.DrawInvBG(sb, vector2_4.X + vector2_3.X / 3f + (float) num4, vector2_4.Y + (float) (num4 * 5 / 2), (float) ((double) vector2_3.X * 2.0 / 3.0) - (float) (num4 * 3 / 2), vector2_3.Y - (float) (num4 * 3)); + } else - IngameOptions.leftScale[key] -= num7; - if ((double) IngameOptions.leftScale[key] < (double) num5) - IngameOptions.leftScale[key] = num5; - if ((double) IngameOptions.leftScale[key] > (double) num6) - IngameOptions.leftScale[key] = num6; - } - IngameOptions.leftHover = -1; - int category1 = IngameOptions.category; - int i1 = 0; - if (IngameOptions.DrawLeftSide(sb, Lang.menu[114].Value, i1, anchor1, offset1, IngameOptions.leftScale)) - { - IngameOptions.leftHover = i1; - if (flag4) { - IngameOptions.category = 0; - SoundEngine.PlaySound(10); + Utils.DrawInvBG(sb, vector2_4.X + (float) (num4 / 2), vector2_4.Y + (float) (num4 * 5 / 2), vector2_3.X / 2f - (float) num4, vector2_3.Y - (float) (num4 * 3)); + Utils.DrawInvBG(sb, vector2_4.X + vector2_3.X / 2f + (float) num4, vector2_4.Y + (float) (num4 * 5 / 2), vector2_3.X / 2f - (float) (num4 * 3 / 2), vector2_3.Y - (float) (num4 * 3)); } - } - int i2 = i1 + 1; - if (IngameOptions.DrawLeftSide(sb, Lang.menu[210].Value, i2, anchor1, offset1, IngameOptions.leftScale)) - { - IngameOptions.leftHover = i2; - if (flag4) + float num5 = 0.7f; + float num6 = 0.8f; + float num7 = 0.01f; + if (flag1) { - IngameOptions.category = 1; - SoundEngine.PlaySound(10); + num5 = 0.4f; + num6 = 0.44f; } - } - int i3 = i2 + 1; - if (IngameOptions.DrawLeftSide(sb, Lang.menu[63].Value, i3, anchor1, offset1, IngameOptions.leftScale)) - { - IngameOptions.leftHover = i3; - if (flag4) + if (isActive2) { - IngameOptions.category = 2; - SoundEngine.PlaySound(10); + num5 = 0.55f; + num6 = 0.6f; } - } - int i4 = i3 + 1; - if (IngameOptions.DrawLeftSide(sb, Lang.menu[218].Value, i4, anchor1, offset1, IngameOptions.leftScale)) - { - IngameOptions.leftHover = i4; - if (flag4) + if (IngameOptions.oldLeftHover != IngameOptions.leftHover && IngameOptions.leftHover != -1) + Main.PlaySound(12); + if (IngameOptions.oldRightHover != IngameOptions.rightHover && IngameOptions.rightHover != -1) + Main.PlaySound(12); + if (flag4 && IngameOptions.rightHover != -1 && !IngameOptions.noSound) + Main.PlaySound(12); + IngameOptions.oldLeftHover = IngameOptions.leftHover; + IngameOptions.oldRightHover = IngameOptions.rightHover; + IngameOptions.noSound = false; + bool flag5 = SocialAPI.Network != null && SocialAPI.Network.CanInvite(); + int num8 = 5 + (flag5 ? 1 : 0) + 2; + Vector2 anchor1 = new Vector2(vector2_4.X + vector2_3.X / 4f, vector2_4.Y + (float) (num4 * 5 / 2)); + Vector2 offset1 = new Vector2(0.0f, vector2_3.Y - (float) (num4 * 5)) / (float) (num8 + 1); + if (flag1) + anchor1.X -= 55f; + UILinkPointNavigator.Shortcuts.INGAMEOPTIONS_BUTTONS_LEFT = num8 + 1; + for (int index = 0; index <= num8; ++index) { - IngameOptions.category = 3; - SoundEngine.PlaySound(10); + if (IngameOptions.leftHover == index || index == IngameOptions.category) + IngameOptions.leftScale[index] += num7; + else + IngameOptions.leftScale[index] -= num7; + if ((double) IngameOptions.leftScale[index] < (double) num5) + IngameOptions.leftScale[index] = num5; + if ((double) IngameOptions.leftScale[index] > (double) num6) + IngameOptions.leftScale[index] = num6; } - } - int i5 = i4 + 1; - if (IngameOptions.DrawLeftSide(sb, Lang.menu[66].Value, i5, anchor1, offset1, IngameOptions.leftScale)) - { - IngameOptions.leftHover = i5; - if (flag4) + IngameOptions.leftHover = -1; + int category1 = IngameOptions.category; + int i1 = 0; + if (IngameOptions.DrawLeftSide(sb, Lang.menu[114].Value, i1, anchor1, offset1, IngameOptions.leftScale)) { - IngameOptions.Close(); - IngameFancyUI.OpenKeybinds(); - } - } - int i6 = i5 + 1; - if (flag5 && IngameOptions.DrawLeftSide(sb, Lang.menu[147].Value, i6, anchor1, offset1, IngameOptions.leftScale)) - { - IngameOptions.leftHover = i6; - if (flag4) - { - IngameOptions.Close(); - SocialAPI.Network.OpenInviteInterface(); - } - } - if (flag5) - ++i6; - if (IngameOptions.DrawLeftSide(sb, Lang.menu[131].Value, i6, anchor1, offset1, IngameOptions.leftScale)) - { - IngameOptions.leftHover = i6; - if (flag4) - { - IngameOptions.Close(); - IngameFancyUI.OpenAchievements(); - } - } - int i7 = i6 + 1; - if (IngameOptions.DrawLeftSide(sb, Lang.menu[118].Value, i7, anchor1, offset1, IngameOptions.leftScale)) - { - IngameOptions.leftHover = i7; - if (flag4) - IngameOptions.Close(); - } - int i8 = i7 + 1; - if (IngameOptions.DrawLeftSide(sb, Lang.inter[35].Value, i8, anchor1, offset1, IngameOptions.leftScale)) - { - IngameOptions.leftHover = i8; - if (flag4) - { - IngameOptions.Close(); - Main.menuMode = 10; - Main.gameMenu = true; - WorldGen.SaveAndQuit(); - } - } - int num10 = i8 + 1; - int category2 = IngameOptions.category; - if (category1 != category2) - { - for (int index = 0; index < IngameOptions.rightScale.Length; ++index) - IngameOptions.rightScale[index] = 0.0f; - } - int num11 = 0; - int num12 = 0; - switch (IngameOptions.category) - { - case 0: - num12 = 16; - num5 = 1f; - num6 = 1.001f; - num7 = 1f / 1000f; - break; - case 1: - num12 = 10; - num5 = 1f; - num6 = 1.001f; - num7 = 1f / 1000f; - break; - case 2: - num12 = 12; - num5 = 1f; - num6 = 1.001f; - num7 = 1f / 1000f; - break; - case 3: - num12 = 15; - num5 = 1f; - num6 = 1.001f; - num7 = 1f / 1000f; - break; - } - if (flag1) - { - num5 -= 0.1f; - num6 -= 0.1f; - } - if (isActive2 && IngameOptions.category == 3) - { - num5 -= 0.15f; - num6 -= 0.15f; - } - if (flag2 && (IngameOptions.category == 0 || IngameOptions.category == 3)) - { - num5 -= 0.2f; - num6 -= 0.2f; - } - UILinkPointNavigator.Shortcuts.INGAMEOPTIONS_BUTTONS_RIGHT = num12; - Vector2 anchor2 = new Vector2(vector2_4.X + (float) ((double) vector2_3.X * 3.0 / 4.0), vector2_4.Y + (float) (num4 * 5 / 2)); - Vector2 offset2 = new Vector2(0.0f, vector2_3.Y - (float) (num4 * 3)) / (float) (num12 + 1); - if (IngameOptions.category == 2) - offset2.Y -= 2f; - Vector2 vector2_5 = new Vector2(8f, 0.0f); - if (flag1) - anchor2.X = vector2_4.X + (float) ((double) vector2_3.X * 2.0 / 3.0); - for (int index = 0; index < IngameOptions.rightScale.Length; ++index) - { - if (IngameOptions.rightLock == index || IngameOptions.rightHover == index && IngameOptions.rightLock == -1) - IngameOptions.rightScale[index] += num7; - else - IngameOptions.rightScale[index] -= num7; - if ((double) IngameOptions.rightScale[index] < (double) num5) - IngameOptions.rightScale[index] = num5; - if ((double) IngameOptions.rightScale[index] > (double) num6) - IngameOptions.rightScale[index] = num6; - } - IngameOptions.inBar = false; - IngameOptions.rightHover = -1; - if (!Main.mouseLeft) - IngameOptions.rightLock = -1; - if (IngameOptions.rightLock == -1) - IngameOptions.notBar = false; - if (IngameOptions.category == 0) - { - int i9 = 0; - IngameOptions.DrawRightSide(sb, Lang.menu[65].Value, i9, anchor2, offset2, IngameOptions.rightScale[i9], 1f); - IngameOptions.skipRightSlot[i9] = true; - int i10 = i9 + 1; - anchor2.X -= (float) num1; - if (IngameOptions.DrawRightSide(sb, Lang.menu[99].Value + " " + (object) Math.Round((double) Main.musicVolume * 100.0) + "%", i10, anchor2, offset2, IngameOptions.rightScale[i10], (float) (((double) IngameOptions.rightScale[i10] - (double) num5) / ((double) num6 - (double) num5)))) - { - if (IngameOptions.rightLock == -1) - IngameOptions.notBar = true; - IngameOptions.noSound = true; - IngameOptions.rightHover = i10; - } - IngameOptions.valuePosition.X = (float) ((double) vector2_4.X + (double) vector2_3.X - (double) (num4 / 2) - 20.0); - IngameOptions.valuePosition.Y -= 3f; - float num13 = IngameOptions.DrawValueBar(sb, scale, Main.musicVolume); - if ((IngameOptions.inBar || IngameOptions.rightLock == i10) && !IngameOptions.notBar) - { - IngameOptions.rightHover = i10; - if (Main.mouseLeft && IngameOptions.rightLock == i10) - Main.musicVolume = num13; - } - if ((double) Main.mouseX > (double) vector2_4.X + (double) vector2_3.X * 2.0 / 3.0 + (double) num4 && (double) Main.mouseX < (double) IngameOptions.valuePosition.X + 3.75 && (double) Main.mouseY > (double) IngameOptions.valuePosition.Y - 10.0 && (double) Main.mouseY <= (double) IngameOptions.valuePosition.Y + 10.0) - { - if (IngameOptions.rightLock == -1) - IngameOptions.notBar = true; - IngameOptions.rightHover = i10; - } - if (IngameOptions.rightHover == i10) - UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 2; - int i11 = i10 + 1; - if (IngameOptions.DrawRightSide(sb, Lang.menu[98].Value + " " + (object) Math.Round((double) Main.soundVolume * 100.0) + "%", i11, anchor2, offset2, IngameOptions.rightScale[i11], (float) (((double) IngameOptions.rightScale[i11] - (double) num5) / ((double) num6 - (double) num5)))) - { - if (IngameOptions.rightLock == -1) - IngameOptions.notBar = true; - IngameOptions.rightHover = i11; - } - IngameOptions.valuePosition.X = (float) ((double) vector2_4.X + (double) vector2_3.X - (double) (num4 / 2) - 20.0); - IngameOptions.valuePosition.Y -= 3f; - float num14 = IngameOptions.DrawValueBar(sb, scale, Main.soundVolume); - if ((IngameOptions.inBar || IngameOptions.rightLock == i11) && !IngameOptions.notBar) - { - IngameOptions.rightHover = i11; - if (Main.mouseLeft && IngameOptions.rightLock == i11) + IngameOptions.leftHover = i1; + if (flag4) { - Main.soundVolume = num14; - IngameOptions.noSound = true; + IngameOptions.category = 0; + Main.PlaySound(10); } } - if ((double) Main.mouseX > (double) vector2_4.X + (double) vector2_3.X * 2.0 / 3.0 + (double) num4 && (double) Main.mouseX < (double) IngameOptions.valuePosition.X + 3.75 && (double) Main.mouseY > (double) IngameOptions.valuePosition.Y - 10.0 && (double) Main.mouseY <= (double) IngameOptions.valuePosition.Y + 10.0) + int i2 = i1 + 1; + if (IngameOptions.DrawLeftSide(sb, Lang.menu[210].Value, i2, anchor1, offset1, IngameOptions.leftScale)) { - if (IngameOptions.rightLock == -1) - IngameOptions.notBar = true; - IngameOptions.rightHover = i11; - } - if (IngameOptions.rightHover == i11) - UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 3; - int i12 = i11 + 1; - if (IngameOptions.DrawRightSide(sb, Lang.menu[119].Value + " " + (object) Math.Round((double) Main.ambientVolume * 100.0) + "%", i12, anchor2, offset2, IngameOptions.rightScale[i12], (float) (((double) IngameOptions.rightScale[i12] - (double) num5) / ((double) num6 - (double) num5)))) - { - if (IngameOptions.rightLock == -1) - IngameOptions.notBar = true; - IngameOptions.rightHover = i12; - } - IngameOptions.valuePosition.X = (float) ((double) vector2_4.X + (double) vector2_3.X - (double) (num4 / 2) - 20.0); - IngameOptions.valuePosition.Y -= 3f; - float num15 = IngameOptions.DrawValueBar(sb, scale, Main.ambientVolume); - if ((IngameOptions.inBar || IngameOptions.rightLock == i12) && !IngameOptions.notBar) - { - IngameOptions.rightHover = i12; - if (Main.mouseLeft && IngameOptions.rightLock == i12) + IngameOptions.leftHover = i2; + if (flag4) { - Main.ambientVolume = num15; - IngameOptions.noSound = true; + IngameOptions.category = 1; + Main.PlaySound(10); } } - if ((double) Main.mouseX > (double) vector2_4.X + (double) vector2_3.X * 2.0 / 3.0 + (double) num4 && (double) Main.mouseX < (double) IngameOptions.valuePosition.X + 3.75 && (double) Main.mouseY > (double) IngameOptions.valuePosition.Y - 10.0 && (double) Main.mouseY <= (double) IngameOptions.valuePosition.Y + 10.0) + int i3 = i2 + 1; + if (IngameOptions.DrawLeftSide(sb, Lang.menu[63].Value, i3, anchor1, offset1, IngameOptions.leftScale)) { - if (IngameOptions.rightLock == -1) - IngameOptions.notBar = true; - IngameOptions.rightHover = i12; - } - if (IngameOptions.rightHover == i12) - UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 4; - int i13 = i12 + 1; - anchor2.X += (float) num1; - IngameOptions.DrawRightSide(sb, "", i13, anchor2, offset2, IngameOptions.rightScale[i13], 1f); - IngameOptions.skipRightSlot[i13] = true; - int i14 = i13 + 1; - IngameOptions.DrawRightSide(sb, Language.GetTextValue("GameUI.ZoomCategory"), i14, anchor2, offset2, IngameOptions.rightScale[i14], 1f); - IngameOptions.skipRightSlot[i14] = true; - int i15 = i14 + 1; - anchor2.X -= (float) num1; - string txt1 = Language.GetTextValue("GameUI.GameZoom", (object) Math.Round((double) Main.GameZoomTarget * 100.0), (object) Math.Round((double) Main.GameViewMatrix.Zoom.X * 100.0)); - if (flag3) - txt1 = FontAssets.ItemStack.Value.CreateWrappedText(txt1, num3, Language.ActiveCulture.CultureInfo); - if (IngameOptions.DrawRightSide(sb, txt1, i15, anchor2, offset2, IngameOptions.rightScale[i15] * 0.85f, (float) (((double) IngameOptions.rightScale[i15] - (double) num5) / ((double) num6 - (double) num5)))) - { - if (IngameOptions.rightLock == -1) - IngameOptions.notBar = true; - IngameOptions.rightHover = i15; - } - IngameOptions.valuePosition.X = (float) ((double) vector2_4.X + (double) vector2_3.X - (double) (num4 / 2) - 20.0); - IngameOptions.valuePosition.Y -= 3f; - float num16 = IngameOptions.DrawValueBar(sb, scale, Main.GameZoomTarget - 1f); - if ((IngameOptions.inBar || IngameOptions.rightLock == i15) && !IngameOptions.notBar) - { - IngameOptions.rightHover = i15; - if (Main.mouseLeft && IngameOptions.rightLock == i15) - Main.GameZoomTarget = num16 + 1f; - } - if ((double) Main.mouseX > (double) vector2_4.X + (double) vector2_3.X * 2.0 / 3.0 + (double) num4 && (double) Main.mouseX < (double) IngameOptions.valuePosition.X + 3.75 && (double) Main.mouseY > (double) IngameOptions.valuePosition.Y - 10.0 && (double) Main.mouseY <= (double) IngameOptions.valuePosition.Y + 10.0) - { - if (IngameOptions.rightLock == -1) - IngameOptions.notBar = true; - IngameOptions.rightHover = i15; - } - if (IngameOptions.rightHover == i15) - UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 10; - int i16 = i15 + 1; - bool flag7 = false; - if ((double) Main.temporaryGUIScaleSlider == -1.0) - Main.temporaryGUIScaleSlider = Main.UIScaleWanted; - string txt2 = Language.GetTextValue("GameUI.UIScale", (object) Math.Round((double) Main.temporaryGUIScaleSlider * 100.0), (object) Math.Round((double) Main.UIScale * 100.0)); - if (flag3) - txt2 = FontAssets.ItemStack.Value.CreateWrappedText(txt2, num3, Language.ActiveCulture.CultureInfo); - if (IngameOptions.DrawRightSide(sb, txt2, i16, anchor2, offset2, IngameOptions.rightScale[i16] * 0.75f, (float) (((double) IngameOptions.rightScale[i16] - (double) num5) / ((double) num6 - (double) num5)))) - { - if (IngameOptions.rightLock == -1) - IngameOptions.notBar = true; - IngameOptions.rightHover = i16; - } - IngameOptions.valuePosition.X = (float) ((double) vector2_4.X + (double) vector2_3.X - (double) (num4 / 2) - 20.0); - IngameOptions.valuePosition.Y -= 3f; - float num17 = IngameOptions.DrawValueBar(sb, scale, MathHelper.Clamp((float) (((double) Main.temporaryGUIScaleSlider - 0.5) / 1.5), 0.0f, 1f)); - if ((IngameOptions.inBar || IngameOptions.rightLock == i16) && !IngameOptions.notBar) - { - IngameOptions.rightHover = i16; - if (Main.mouseLeft && IngameOptions.rightLock == i16) + IngameOptions.leftHover = i3; + if (flag4) { - Main.temporaryGUIScaleSlider = (float) ((double) num17 * 1.5 + 0.5); - Main.temporaryGUIScaleSlider = (float) (int) ((double) Main.temporaryGUIScaleSlider * 100.0) / 100f; - Main.temporaryGUIScaleSliderUpdate = true; - flag7 = true; + IngameOptions.category = 2; + Main.PlaySound(10); } } - if (!flag7 && Main.temporaryGUIScaleSliderUpdate && (double) Main.temporaryGUIScaleSlider != -1.0) + int i4 = i3 + 1; + if (IngameOptions.DrawLeftSide(sb, Lang.menu[218].Value, i4, anchor1, offset1, IngameOptions.leftScale)) { - Main.UIScale = Main.temporaryGUIScaleSlider; - Main.temporaryGUIScaleSliderUpdate = false; - } - if ((double) Main.mouseX > (double) vector2_4.X + (double) vector2_3.X * 2.0 / 3.0 + (double) num4 && (double) Main.mouseX < (double) IngameOptions.valuePosition.X + 3.75 && (double) Main.mouseY > (double) IngameOptions.valuePosition.Y - 10.0 && (double) Main.mouseY <= (double) IngameOptions.valuePosition.Y + 10.0) - { - if (IngameOptions.rightLock == -1) - IngameOptions.notBar = true; - IngameOptions.rightHover = i16; - } - if (IngameOptions.rightHover == i16) - UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 11; - int i17 = i16 + 1; - anchor2.X += (float) num1; - IngameOptions.DrawRightSide(sb, "", i17, anchor2, offset2, IngameOptions.rightScale[i17], 1f); - IngameOptions.skipRightSlot[i17] = true; - int i18 = i17 + 1; - IngameOptions.DrawRightSide(sb, Language.GetTextValue("GameUI.Gameplay"), i18, anchor2, offset2, IngameOptions.rightScale[i18], 1f); - IngameOptions.skipRightSlot[i18] = true; - int i19 = i18 + 1; - if (IngameOptions.DrawRightSide(sb, Main.autoSave ? Lang.menu[67].Value : Lang.menu[68].Value, i19, anchor2, offset2, IngameOptions.rightScale[i19], (float) (((double) IngameOptions.rightScale[i19] - (double) num5) / ((double) num6 - (double) num5)))) - { - IngameOptions.rightHover = i19; + IngameOptions.leftHover = i4; if (flag4) - Main.autoSave = !Main.autoSave; + { + IngameOptions.category = 3; + Main.PlaySound(10); + } } - int i20 = i19 + 1; - if (IngameOptions.DrawRightSide(sb, Main.autoPause ? Lang.menu[69].Value : Lang.menu[70].Value, i20, anchor2, offset2, IngameOptions.rightScale[i20], (float) (((double) IngameOptions.rightScale[i20] - (double) num5) / ((double) num6 - (double) num5)))) + int i5 = i4 + 1; + if (IngameOptions.DrawLeftSide(sb, Lang.menu[66].Value, i5, anchor1, offset1, IngameOptions.leftScale)) { - IngameOptions.rightHover = i20; + IngameOptions.leftHover = i5; if (flag4) - Main.autoPause = !Main.autoPause; + { + IngameOptions.Close(); + IngameFancyUI.OpenKeybinds(); + } } - int i21 = i20 + 1; - if (IngameOptions.DrawRightSide(sb, Main.ReversedUpDownArmorSetBonuses ? Lang.menu[220].Value : Lang.menu[221].Value, i21, anchor2, offset2, IngameOptions.rightScale[i21], (float) (((double) IngameOptions.rightScale[i21] - (double) num5) / ((double) num6 - (double) num5)))) + int i6 = i5 + 1; + if (flag5 && IngameOptions.DrawLeftSide(sb, Lang.menu[147].Value, i6, anchor1, offset1, IngameOptions.leftScale)) { - IngameOptions.rightHover = i21; + IngameOptions.leftHover = i6; if (flag4) - Main.ReversedUpDownArmorSetBonuses = !Main.ReversedUpDownArmorSetBonuses; + { + IngameOptions.Close(); + SocialAPI.Network.OpenInviteInterface(); + } } - int i22 = i21 + 1; - string textValue1; - switch (DoorOpeningHelper.PreferenceSettings) + if (flag5) + ++i6; + if (IngameOptions.DrawLeftSide(sb, Lang.menu[131].Value, i6, anchor1, offset1, IngameOptions.leftScale)) { - case DoorOpeningHelper.DoorAutoOpeningPreference.EnabledForGamepadOnly: - textValue1 = Language.GetTextValue("UI.SmartDoorsGamepad"); + IngameOptions.leftHover = i6; + if (flag4) + { + IngameOptions.Close(); + IngameFancyUI.OpenAchievements(); + } + } + int i7 = i6 + 1; + if (IngameOptions.DrawLeftSide(sb, Lang.menu[118].Value, i7, anchor1, offset1, IngameOptions.leftScale)) + { + IngameOptions.leftHover = i7; + if (flag4) + IngameOptions.Close(); + } + int i8 = i7 + 1; + if (IngameOptions.DrawLeftSide(sb, Lang.inter[35].Value, i8, anchor1, offset1, IngameOptions.leftScale)) + { + IngameOptions.leftHover = i8; + if (flag4) + { + IngameOptions.Close(); + Main.menuMode = 10; + WorldGen.SaveAndQuit(); + } + } + int num9 = i8 + 1; + int category2 = IngameOptions.category; + if (category1 != category2) + { + for (int index = 0; index < IngameOptions.rightScale.Length; ++index) + IngameOptions.rightScale[index] = 0.0f; + } + int num10 = 0; + switch (IngameOptions.category) + { + case 0: + num10 = 15; + num5 = 1f; + num6 = 1.001f; + num7 = 1f / 1000f; break; - case DoorOpeningHelper.DoorAutoOpeningPreference.EnabledForEverything: - textValue1 = Language.GetTextValue("UI.SmartDoorsEnabled"); - break; - default: - textValue1 = Language.GetTextValue("UI.SmartDoorsDisabled"); - break; - } - if (IngameOptions.DrawRightSide(sb, textValue1, i22, anchor2, offset2, IngameOptions.rightScale[i22], (float) (((double) IngameOptions.rightScale[i22] - (double) num5) / ((double) num6 - (double) num5)))) - { - IngameOptions.rightHover = i22; - if (flag4) - DoorOpeningHelper.CyclePreferences(); - } - int i23 = i22 + 1; - string textValue2; - if (Player.Settings.HoverControl != Player.Settings.HoverControlMode.Hold) - textValue2 = Language.GetTextValue("UI.HoverControlSettingIsClick"); - else - textValue2 = Language.GetTextValue("UI.HoverControlSettingIsHold"); - if (IngameOptions.DrawRightSide(sb, textValue2, i23, anchor2, offset2, IngameOptions.rightScale[i23], (float) (((double) IngameOptions.rightScale[i23] - (double) num5) / ((double) num6 - (double) num5)))) - { - IngameOptions.rightHover = i23; - if (flag4) - Player.Settings.CycleHoverControl(); - } - int i24 = i23 + 1; - IngameOptions.DrawRightSide(sb, "", i24, anchor2, offset2, IngameOptions.rightScale[i24], 1f); - IngameOptions.skipRightSlot[i24] = true; - int num18 = i24 + 1; - } - if (IngameOptions.category == 1) - { - int i25 = 0; - if (IngameOptions.DrawRightSide(sb, Main.showItemText ? Lang.menu[71].Value : Lang.menu[72].Value, i25, anchor2, offset2, IngameOptions.rightScale[i25], (float) (((double) IngameOptions.rightScale[i25] - (double) num5) / ((double) num6 - (double) num5)))) - { - IngameOptions.rightHover = i25; - if (flag4) - Main.showItemText = !Main.showItemText; - } - int i26 = i25 + 1; - if (IngameOptions.DrawRightSide(sb, Lang.menu[123].Value + " " + (object) Lang.menu[124 + Main.invasionProgressMode], i26, anchor2, offset2, IngameOptions.rightScale[i26], (float) (((double) IngameOptions.rightScale[i26] - (double) num5) / ((double) num6 - (double) num5)))) - { - IngameOptions.rightHover = i26; - if (flag4) - { - ++Main.invasionProgressMode; - if (Main.invasionProgressMode >= 3) - Main.invasionProgressMode = 0; - } - } - int i27 = i26 + 1; - if (IngameOptions.DrawRightSide(sb, Main.placementPreview ? Lang.menu[128].Value : Lang.menu[129].Value, i27, anchor2, offset2, IngameOptions.rightScale[i27], (float) (((double) IngameOptions.rightScale[i27] - (double) num5) / ((double) num6 - (double) num5)))) - { - IngameOptions.rightHover = i27; - if (flag4) - Main.placementPreview = !Main.placementPreview; - } - int i28 = i27 + 1; - if (IngameOptions.DrawRightSide(sb, ItemSlot.Options.HighlightNewItems ? Lang.inter[117].Value : Lang.inter[116].Value, i28, anchor2, offset2, IngameOptions.rightScale[i28], (float) (((double) IngameOptions.rightScale[i28] - (double) num5) / ((double) num6 - (double) num5)))) - { - IngameOptions.rightHover = i28; - if (flag4) - ItemSlot.Options.HighlightNewItems = !ItemSlot.Options.HighlightNewItems; - } - int i29 = i28 + 1; - if (IngameOptions.DrawRightSide(sb, Main.MouseShowBuildingGrid ? Lang.menu[229].Value : Lang.menu[230].Value, i29, anchor2, offset2, IngameOptions.rightScale[i29], (float) (((double) IngameOptions.rightScale[i29] - (double) num5) / ((double) num6 - (double) num5)))) - { - IngameOptions.rightHover = i29; - if (flag4) - Main.MouseShowBuildingGrid = !Main.MouseShowBuildingGrid; - } - int i30 = i29 + 1; - if (IngameOptions.DrawRightSide(sb, Main.GamepadDisableInstructionsDisplay ? Lang.menu[241].Value : Lang.menu[242].Value, i30, anchor2, offset2, IngameOptions.rightScale[i30], (float) (((double) IngameOptions.rightScale[i30] - (double) num5) / ((double) num6 - (double) num5)))) - { - IngameOptions.rightHover = i30; - if (flag4) - Main.GamepadDisableInstructionsDisplay = !Main.GamepadDisableInstructionsDisplay; - } - int i31 = i30 + 1; - string str1 = ""; - MinimapFrame minimapFrame1 = (MinimapFrame) null; - foreach (KeyValuePair minimapFrame2 in Main.MinimapFrames) - { - MinimapFrame minimapFrame3 = minimapFrame2.Value; - if (minimapFrame3 == Main.ActiveMinimapFrame) - { - str1 = Language.GetTextValue("UI.MinimapFrame_" + minimapFrame2.Key); - break; - } - minimapFrame1 = minimapFrame3; - } - if (minimapFrame1 == null) - minimapFrame1 = Main.MinimapFrames.Values.Last(); - if (IngameOptions.DrawRightSide(sb, Language.GetTextValue("UI.SelectMapBorder", (object) str1), i31, anchor2, offset2, IngameOptions.rightScale[i31], (float) (((double) IngameOptions.rightScale[i31] - (double) num5) / ((double) num6 - (double) num5)))) - { - IngameOptions.rightHover = i31; - if (flag4) - Main.ActiveMinimapFrame = minimapFrame1; - } - int i32 = i31 + 1; - anchor2.X -= (float) num1; - string txt = Language.GetTextValue("GameUI.MapScale", (object) Math.Round((double) Main.MapScale * 100.0)); - if (flag3) - txt = FontAssets.ItemStack.Value.CreateWrappedText(txt, num3, Language.ActiveCulture.CultureInfo); - if (IngameOptions.DrawRightSide(sb, txt, i32, anchor2, offset2, IngameOptions.rightScale[i32] * 0.85f, (float) (((double) IngameOptions.rightScale[i32] - (double) num5) / ((double) num6 - (double) num5)))) - { - if (IngameOptions.rightLock == -1) - IngameOptions.notBar = true; - IngameOptions.rightHover = i32; - } - IngameOptions.valuePosition.X = (float) ((double) vector2_4.X + (double) vector2_3.X - (double) (num4 / 2) - 20.0); - IngameOptions.valuePosition.Y -= 3f; - float num19 = IngameOptions.DrawValueBar(sb, scale, (float) (((double) Main.MapScale - 0.5) / 0.5)); - if ((IngameOptions.inBar || IngameOptions.rightLock == i32) && !IngameOptions.notBar) - { - IngameOptions.rightHover = i32; - if (Main.mouseLeft && IngameOptions.rightLock == i32) - Main.MapScale = (float) ((double) num19 * 0.5 + 0.5); - } - if ((double) Main.mouseX > (double) vector2_4.X + (double) vector2_3.X * 2.0 / 3.0 + (double) num4 && (double) Main.mouseX < (double) IngameOptions.valuePosition.X + 3.75 && (double) Main.mouseY > (double) IngameOptions.valuePosition.Y - 10.0 && (double) Main.mouseY <= (double) IngameOptions.valuePosition.Y + 10.0) - { - if (IngameOptions.rightLock == -1) - IngameOptions.notBar = true; - IngameOptions.rightHover = i32; - } - if (IngameOptions.rightHover == i32) - UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 12; - int i33 = i32 + 1; - anchor2.X += (float) num1; - string str2 = ""; - IPlayerResourcesDisplaySet resourcesDisplaySet1 = (IPlayerResourcesDisplaySet) null; - foreach (KeyValuePair playerResourcesSet in Main.PlayerResourcesSets) - { - IPlayerResourcesDisplaySet resourcesDisplaySet2 = playerResourcesSet.Value; - if (resourcesDisplaySet2 == Main.ActivePlayerResourcesSet) - { - str2 = Language.GetTextValue("UI.HealthManaStyle_" + playerResourcesSet.Key); - break; - } - resourcesDisplaySet1 = resourcesDisplaySet2; - } - if (resourcesDisplaySet1 == null) - resourcesDisplaySet1 = Main.PlayerResourcesSets.Values.Last(); - if (IngameOptions.DrawRightSide(sb, Language.GetTextValue("UI.SelectHealthStyle", (object) str2), i33, anchor2, offset2, IngameOptions.rightScale[i33], (float) (((double) IngameOptions.rightScale[i33] - (double) num5) / ((double) num6 - (double) num5)))) - { - IngameOptions.rightHover = i33; - if (flag4) - Main.ActivePlayerResourcesSet = resourcesDisplaySet1; - } - int i34 = i33 + 1; - if (IngameOptions.DrawRightSide(sb, Main.SettingsEnabled_OpaqueBoxBehindTooltips ? Language.GetTextValue("GameUI.HoverTextBoxesOn") : Language.GetTextValue("GameUI.HoverTextBoxesOff"), i34, anchor2, offset2, IngameOptions.rightScale[i34], (float) (((double) IngameOptions.rightScale[i34] - (double) num5) / ((double) num6 - (double) num5)))) - { - IngameOptions.rightHover = i34; - if (flag4) - Main.SettingsEnabled_OpaqueBoxBehindTooltips = !Main.SettingsEnabled_OpaqueBoxBehindTooltips; - } - int num20 = i34 + 1; - } - if (IngameOptions.category == 2) - { - int i35 = 0; - if (IngameOptions.DrawRightSide(sb, Main.graphics.IsFullScreen ? Lang.menu[49].Value : Lang.menu[50].Value, i35, anchor2, offset2, IngameOptions.rightScale[i35], (float) (((double) IngameOptions.rightScale[i35] - (double) num5) / ((double) num6 - (double) num5)))) - { - IngameOptions.rightHover = i35; - if (flag4) - Main.ToggleFullScreen(); - } - int i36 = i35 + 1; - if (IngameOptions.DrawRightSide(sb, Lang.menu[51].Value + ": " + (object) Main.PendingResolutionWidth + "x" + (object) Main.PendingResolutionHeight, i36, anchor2, offset2, IngameOptions.rightScale[i36], (float) (((double) IngameOptions.rightScale[i36] - (double) num5) / ((double) num6 - (double) num5)))) - { - IngameOptions.rightHover = i36; - if (flag4) - { - int num21 = 0; - for (int index = 0; index < Main.numDisplayModes; ++index) - { - if (Main.displayWidth[index] == Main.PendingResolutionWidth && Main.displayHeight[index] == Main.PendingResolutionHeight) - { - num21 = index; - break; - } - } - int index1 = num21 + 1; - if (index1 >= Main.numDisplayModes) - index1 = 0; - Main.PendingResolutionWidth = Main.displayWidth[index1]; - Main.PendingResolutionHeight = Main.displayHeight[index1]; - Main.SetResolution(Main.PendingResolutionWidth, Main.PendingResolutionHeight); - } - } - int i37 = i36 + 1; - anchor2.X -= (float) num1; - if (IngameOptions.DrawRightSide(sb, Lang.menu[52].Value + ": " + (object) Main.bgScroll + "%", i37, anchor2, offset2, IngameOptions.rightScale[i37], (float) (((double) IngameOptions.rightScale[i37] - (double) num5) / ((double) num6 - (double) num5)))) - { - if (IngameOptions.rightLock == -1) - IngameOptions.notBar = true; - IngameOptions.noSound = true; - IngameOptions.rightHover = i37; - } - IngameOptions.valuePosition.X = (float) ((double) vector2_4.X + (double) vector2_3.X - (double) (num4 / 2) - 20.0); - IngameOptions.valuePosition.Y -= 3f; - float num22 = IngameOptions.DrawValueBar(sb, scale, (float) Main.bgScroll / 100f); - if ((IngameOptions.inBar || IngameOptions.rightLock == i37) && !IngameOptions.notBar) - { - IngameOptions.rightHover = i37; - if (Main.mouseLeft && IngameOptions.rightLock == i37) - { - Main.bgScroll = (int) ((double) num22 * 100.0); - Main.caveParallax = (float) (1.0 - (double) Main.bgScroll / 500.0); - } - } - if ((double) Main.mouseX > (double) vector2_4.X + (double) vector2_3.X * 2.0 / 3.0 + (double) num4 && (double) Main.mouseX < (double) IngameOptions.valuePosition.X + 3.75 && (double) Main.mouseY > (double) IngameOptions.valuePosition.Y - 10.0 && (double) Main.mouseY <= (double) IngameOptions.valuePosition.Y + 10.0) - { - if (IngameOptions.rightLock == -1) - IngameOptions.notBar = true; - IngameOptions.rightHover = i37; - } - if (IngameOptions.rightHover == i37) - UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 1; - int i38 = i37 + 1; - anchor2.X += (float) num1; - if (IngameOptions.DrawRightSide(sb, Lang.menu[247 + Main.FrameSkipMode].Value, i38, anchor2, offset2, IngameOptions.rightScale[i38], (float) (((double) IngameOptions.rightScale[i38] - (double) num5) / ((double) num6 - (double) num5)))) - { - IngameOptions.rightHover = i38; - if (flag4) - { - ++Main.FrameSkipMode; - if (Main.FrameSkipMode < 0 || Main.FrameSkipMode > 2) - Main.FrameSkipMode = 0; - } - } - int i39 = i38 + 1; - if (IngameOptions.DrawRightSide(sb, Language.GetTextValue("UI.LightMode_" + (object) Lighting.Mode), i39, anchor2, offset2, IngameOptions.rightScale[i39], (float) (((double) IngameOptions.rightScale[i39] - (double) num5) / ((double) num6 - (double) num5)))) - { - IngameOptions.rightHover = i39; - if (flag4) - Lighting.NextLightMode(); - } - int i40 = i39 + 1; - if (IngameOptions.DrawRightSide(sb, Lang.menu[59 + Main.qaStyle].Value, i40, anchor2, offset2, IngameOptions.rightScale[i40], (float) (((double) IngameOptions.rightScale[i40] - (double) num5) / ((double) num6 - (double) num5)))) - { - IngameOptions.rightHover = i40; - if (flag4) - { - ++Main.qaStyle; - if (Main.qaStyle > 3) - Main.qaStyle = 0; - } - } - int i41 = i40 + 1; - if (IngameOptions.DrawRightSide(sb, Main.BackgroundEnabled ? Lang.menu[100].Value : Lang.menu[101].Value, i41, anchor2, offset2, IngameOptions.rightScale[i41], (float) (((double) IngameOptions.rightScale[i41] - (double) num5) / ((double) num6 - (double) num5)))) - { - IngameOptions.rightHover = i41; - if (flag4) - Main.BackgroundEnabled = !Main.BackgroundEnabled; - } - int i42 = i41 + 1; - if (IngameOptions.DrawRightSide(sb, ChildSafety.Disabled ? Lang.menu[132].Value : Lang.menu[133].Value, i42, anchor2, offset2, IngameOptions.rightScale[i42], (float) (((double) IngameOptions.rightScale[i42] - (double) num5) / ((double) num6 - (double) num5)))) - { - IngameOptions.rightHover = i42; - if (flag4) - ChildSafety.Disabled = !ChildSafety.Disabled; - } - int i43 = i42 + 1; - if (IngameOptions.DrawRightSide(sb, Language.GetTextValue("GameUI.HeatDistortion", Main.UseHeatDistortion ? (object) Language.GetTextValue("GameUI.Enabled") : (object) Language.GetTextValue("GameUI.Disabled")), i43, anchor2, offset2, IngameOptions.rightScale[i43], (float) (((double) IngameOptions.rightScale[i43] - (double) num5) / ((double) num6 - (double) num5)))) - { - IngameOptions.rightHover = i43; - if (flag4) - Main.UseHeatDistortion = !Main.UseHeatDistortion; - } - int i44 = i43 + 1; - if (IngameOptions.DrawRightSide(sb, Language.GetTextValue("GameUI.StormEffects", Main.UseStormEffects ? (object) Language.GetTextValue("GameUI.Enabled") : (object) Language.GetTextValue("GameUI.Disabled")), i44, anchor2, offset2, IngameOptions.rightScale[i44], (float) (((double) IngameOptions.rightScale[i44] - (double) num5) / ((double) num6 - (double) num5)))) - { - IngameOptions.rightHover = i44; - if (flag4) - Main.UseStormEffects = !Main.UseStormEffects; - } - int i45 = i44 + 1; - string textValue; - switch (Main.WaveQuality) - { case 1: - textValue = Language.GetTextValue("GameUI.QualityLow"); + num10 = 6; + num5 = 1f; + num6 = 1.001f; + num7 = 1f / 1000f; break; case 2: - textValue = Language.GetTextValue("GameUI.QualityMedium"); + num10 = 12; + num5 = 1f; + num6 = 1.001f; + num7 = 1f / 1000f; break; case 3: - textValue = Language.GetTextValue("GameUI.QualityHigh"); - break; - default: - textValue = Language.GetTextValue("GameUI.QualityOff"); + num10 = 15; + num5 = 1f; + num6 = 1.001f; + num7 = 1f / 1000f; break; } - if (IngameOptions.DrawRightSide(sb, Language.GetTextValue("GameUI.WaveQuality", (object) textValue), i45, anchor2, offset2, IngameOptions.rightScale[i45], (float) (((double) IngameOptions.rightScale[i45] - (double) num5) / ((double) num6 - (double) num5)))) - { - IngameOptions.rightHover = i45; - if (flag4) - Main.WaveQuality = (Main.WaveQuality + 1) % 4; - } - int i46 = i45 + 1; - if (IngameOptions.DrawRightSide(sb, Language.GetTextValue("UI.TilesSwayInWind" + (Main.SettingsEnabled_TilesSwayInWind ? "On" : "Off")), i46, anchor2, offset2, IngameOptions.rightScale[i46], (float) (((double) IngameOptions.rightScale[i46] - (double) num5) / ((double) num6 - (double) num5)))) - { - IngameOptions.rightHover = i46; - if (flag4) - Main.SettingsEnabled_TilesSwayInWind = !Main.SettingsEnabled_TilesSwayInWind; - } - int num23 = i46 + 1; - } - if (IngameOptions.category == 3) - { - int i47 = 0; - float num24 = (float) num1; if (flag1) - num2 = 126f; - Vector3 hslVector1 = Main.mouseColorSlider.GetHSLVector(); - Main.mouseColorSlider.ApplyToMainLegacyBars(); - IngameOptions.DrawRightSide(sb, Lang.menu[64].Value, i47, anchor2, offset2, IngameOptions.rightScale[i47], 1f); - IngameOptions.skipRightSlot[i47] = true; - int i48 = i47 + 1; - anchor2.X -= num24; - if (IngameOptions.DrawRightSide(sb, "", i48, anchor2, offset2, IngameOptions.rightScale[i48], (float) (((double) IngameOptions.rightScale[i48] - (double) num5) / ((double) num6 - (double) num5)))) { - if (IngameOptions.rightLock == -1) - IngameOptions.notBar = true; - IngameOptions.rightHover = i48; + num5 -= 0.1f; + num6 -= 0.1f; } - IngameOptions.valuePosition.X = (float) ((double) vector2_4.X + (double) vector2_3.X - (double) (num4 / 2) - 20.0); - IngameOptions.valuePosition.Y -= 3f; - IngameOptions.valuePosition.X -= num2; - DelegateMethods.v3_1 = hslVector1; - float num25 = IngameOptions.DrawValueBar(sb, scale, hslVector1.X, colorMethod: new Utils.ColorLerpMethod(DelegateMethods.ColorLerp_HSL_H)); - if ((IngameOptions.inBar || IngameOptions.rightLock == i48) && !IngameOptions.notBar) + if (isActive2 && IngameOptions.category == 3) { - IngameOptions.rightHover = i48; - if (Main.mouseLeft && IngameOptions.rightLock == i48) + num5 -= 0.15f; + num6 -= 0.15f; + } + if (flag2 && (IngameOptions.category == 0 || IngameOptions.category == 3)) + { + num5 -= 0.2f; + num6 -= 0.2f; + } + UILinkPointNavigator.Shortcuts.INGAMEOPTIONS_BUTTONS_RIGHT = num10; + Vector2 anchor2 = new Vector2(vector2_4.X + (float) ((double) vector2_3.X * 3.0 / 4.0), vector2_4.Y + (float) (num4 * 5 / 2)); + if (flag1) + anchor2.X = vector2_4.X + (float) ((double) vector2_3.X * 2.0 / 3.0); + Vector2 offset2 = new Vector2(0.0f, vector2_3.Y - (float) (num4 * 3)) / (float) (num10 + 1); + if (IngameOptions.category == 2) + offset2.Y -= 2f; + for (int index = 0; index < 15; ++index) + { + if (IngameOptions.rightLock == index || IngameOptions.rightHover == index && IngameOptions.rightLock == -1) + IngameOptions.rightScale[index] += num7; + else + IngameOptions.rightScale[index] -= num7; + if ((double) IngameOptions.rightScale[index] < (double) num5) + IngameOptions.rightScale[index] = num5; + if ((double) IngameOptions.rightScale[index] > (double) num6) + IngameOptions.rightScale[index] = num6; + } + IngameOptions.inBar = false; + IngameOptions.rightHover = -1; + if (!Main.mouseLeft) + IngameOptions.rightLock = -1; + if (IngameOptions.rightLock == -1) + IngameOptions.notBar = false; + if (IngameOptions.category == 0) + { + int i9 = 0; + IngameOptions.DrawRightSide(sb, Lang.menu[65].Value, i9, anchor2, offset2, IngameOptions.rightScale[i9], 1f); + IngameOptions.skipRightSlot[i9] = true; + int i10 = i9 + 1; + anchor2.X -= (float) num1; + if (IngameOptions.DrawRightSide(sb, Lang.menu[99].Value + " " + (object) Math.Round((double) Main.musicVolume * 100.0) + "%", i10, anchor2, offset2, IngameOptions.rightScale[i10], (float) (((double) IngameOptions.rightScale[i10] - (double) num5) / ((double) num6 - (double) num5)))) { - hslVector1.X = num25; + if (IngameOptions.rightLock == -1) + IngameOptions.notBar = true; IngameOptions.noSound = true; + IngameOptions.rightHover = i10; + } + IngameOptions.valuePosition.X = (float) ((double) vector2_4.X + (double) vector2_3.X - (double) (num4 / 2) - 20.0); + IngameOptions.valuePosition.Y -= 3f; + float num11 = IngameOptions.DrawValueBar(sb, scale, Main.musicVolume); + if ((IngameOptions.inBar || IngameOptions.rightLock == i10) && !IngameOptions.notBar) + { + IngameOptions.rightHover = i10; + if (Main.mouseLeft && IngameOptions.rightLock == i10) + Main.musicVolume = num11; + } + if ((double) Main.mouseX > (double) vector2_4.X + (double) vector2_3.X * 2.0 / 3.0 + (double) num4 && (double) Main.mouseX < (double) IngameOptions.valuePosition.X + 3.75 && (double) Main.mouseY > (double) IngameOptions.valuePosition.Y - 10.0 && (double) Main.mouseY <= (double) IngameOptions.valuePosition.Y + 10.0) + { + if (IngameOptions.rightLock == -1) + IngameOptions.notBar = true; + IngameOptions.rightHover = i10; + } + if (IngameOptions.rightHover == i10) + UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 2; + int i11 = i10 + 1; + if (IngameOptions.DrawRightSide(sb, Lang.menu[98].Value + " " + (object) Math.Round((double) Main.soundVolume * 100.0) + "%", i11, anchor2, offset2, IngameOptions.rightScale[i11], (float) (((double) IngameOptions.rightScale[i11] - (double) num5) / ((double) num6 - (double) num5)))) + { + if (IngameOptions.rightLock == -1) + IngameOptions.notBar = true; + IngameOptions.rightHover = i11; + } + IngameOptions.valuePosition.X = (float) ((double) vector2_4.X + (double) vector2_3.X - (double) (num4 / 2) - 20.0); + IngameOptions.valuePosition.Y -= 3f; + float num12 = IngameOptions.DrawValueBar(sb, scale, Main.soundVolume); + if ((IngameOptions.inBar || IngameOptions.rightLock == i11) && !IngameOptions.notBar) + { + IngameOptions.rightHover = i11; + if (Main.mouseLeft && IngameOptions.rightLock == i11) + { + Main.soundVolume = num12; + IngameOptions.noSound = true; + } + } + if ((double) Main.mouseX > (double) vector2_4.X + (double) vector2_3.X * 2.0 / 3.0 + (double) num4 && (double) Main.mouseX < (double) IngameOptions.valuePosition.X + 3.75 && (double) Main.mouseY > (double) IngameOptions.valuePosition.Y - 10.0 && (double) Main.mouseY <= (double) IngameOptions.valuePosition.Y + 10.0) + { + if (IngameOptions.rightLock == -1) + IngameOptions.notBar = true; + IngameOptions.rightHover = i11; + } + if (IngameOptions.rightHover == i11) + UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 3; + int i12 = i11 + 1; + if (IngameOptions.DrawRightSide(sb, Lang.menu[119].Value + " " + (object) Math.Round((double) Main.ambientVolume * 100.0) + "%", i12, anchor2, offset2, IngameOptions.rightScale[i12], (float) (((double) IngameOptions.rightScale[i12] - (double) num5) / ((double) num6 - (double) num5)))) + { + if (IngameOptions.rightLock == -1) + IngameOptions.notBar = true; + IngameOptions.rightHover = i12; + } + IngameOptions.valuePosition.X = (float) ((double) vector2_4.X + (double) vector2_3.X - (double) (num4 / 2) - 20.0); + IngameOptions.valuePosition.Y -= 3f; + float num13 = IngameOptions.DrawValueBar(sb, scale, Main.ambientVolume); + if ((IngameOptions.inBar || IngameOptions.rightLock == i12) && !IngameOptions.notBar) + { + IngameOptions.rightHover = i12; + if (Main.mouseLeft && IngameOptions.rightLock == i12) + { + Main.ambientVolume = num13; + IngameOptions.noSound = true; + } + } + if ((double) Main.mouseX > (double) vector2_4.X + (double) vector2_3.X * 2.0 / 3.0 + (double) num4 && (double) Main.mouseX < (double) IngameOptions.valuePosition.X + 3.75 && (double) Main.mouseY > (double) IngameOptions.valuePosition.Y - 10.0 && (double) Main.mouseY <= (double) IngameOptions.valuePosition.Y + 10.0) + { + if (IngameOptions.rightLock == -1) + IngameOptions.notBar = true; + IngameOptions.rightHover = i12; + } + if (IngameOptions.rightHover == i12) + UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 4; + int i13 = i12 + 1; + anchor2.X += (float) num1; + IngameOptions.DrawRightSide(sb, "", i13, anchor2, offset2, IngameOptions.rightScale[i13], 1f); + IngameOptions.skipRightSlot[i13] = true; + int i14 = i13 + 1; + IngameOptions.DrawRightSide(sb, Language.GetTextValue("GameUI.ZoomCategory"), i14, anchor2, offset2, IngameOptions.rightScale[i14], 1f); + IngameOptions.skipRightSlot[i14] = true; + int i15 = i14 + 1; + anchor2.X -= (float) num1; + string txt1 = Language.GetTextValue("GameUI.GameZoom", (object) Math.Round((double) Main.GameZoomTarget * 100.0), (object) Math.Round((double) Main.GameViewMatrix.Zoom.X * 100.0)); + if (flag3) + txt1 = Main.fontItemStack.CreateWrappedText(txt1, num3, Language.ActiveCulture.CultureInfo); + if (IngameOptions.DrawRightSide(sb, txt1, i15, anchor2, offset2, IngameOptions.rightScale[i15] * 0.85f, (float) (((double) IngameOptions.rightScale[i15] - (double) num5) / ((double) num6 - (double) num5)))) + { + if (IngameOptions.rightLock == -1) + IngameOptions.notBar = true; + IngameOptions.rightHover = i15; + } + IngameOptions.valuePosition.X = (float) ((double) vector2_4.X + (double) vector2_3.X - (double) (num4 / 2) - 20.0); + IngameOptions.valuePosition.Y -= 3f; + float num14 = IngameOptions.DrawValueBar(sb, scale, Main.GameZoomTarget - 1f); + if ((IngameOptions.inBar || IngameOptions.rightLock == i15) && !IngameOptions.notBar) + { + IngameOptions.rightHover = i15; + if (Main.mouseLeft && IngameOptions.rightLock == i15) + Main.GameZoomTarget = num14 + 1f; + } + if ((double) Main.mouseX > (double) vector2_4.X + (double) vector2_3.X * 2.0 / 3.0 + (double) num4 && (double) Main.mouseX < (double) IngameOptions.valuePosition.X + 3.75 && (double) Main.mouseY > (double) IngameOptions.valuePosition.Y - 10.0 && (double) Main.mouseY <= (double) IngameOptions.valuePosition.Y + 10.0) + { + if (IngameOptions.rightLock == -1) + IngameOptions.notBar = true; + IngameOptions.rightHover = i15; + } + if (IngameOptions.rightHover == i15) + UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 10; + int i16 = i15 + 1; + bool flag6 = false; + if ((double) Main.temporaryGUIScaleSlider == -1.0) + Main.temporaryGUIScaleSlider = Main.UIScaleWanted; + string txt2 = Language.GetTextValue("GameUI.UIScale", (object) Math.Round((double) Main.temporaryGUIScaleSlider * 100.0), (object) Math.Round((double) Main.UIScale * 100.0)); + if (flag3) + txt2 = Main.fontItemStack.CreateWrappedText(txt2, num3, Language.ActiveCulture.CultureInfo); + if (IngameOptions.DrawRightSide(sb, txt2, i16, anchor2, offset2, IngameOptions.rightScale[i16] * 0.75f, (float) (((double) IngameOptions.rightScale[i16] - (double) num5) / ((double) num6 - (double) num5)))) + { + if (IngameOptions.rightLock == -1) + IngameOptions.notBar = true; + IngameOptions.rightHover = i16; + } + IngameOptions.valuePosition.X = (float) ((double) vector2_4.X + (double) vector2_3.X - (double) (num4 / 2) - 20.0); + IngameOptions.valuePosition.Y -= 3f; + float num15 = IngameOptions.DrawValueBar(sb, scale, Main.temporaryGUIScaleSlider - 1f); + if ((IngameOptions.inBar || IngameOptions.rightLock == i16) && !IngameOptions.notBar) + { + IngameOptions.rightHover = i16; + if (Main.mouseLeft && IngameOptions.rightLock == i16) + { + Main.temporaryGUIScaleSlider = num15 + 1f; + Main.temporaryGUIScaleSliderUpdate = true; + flag6 = true; + } + } + if (!flag6 && Main.temporaryGUIScaleSliderUpdate && (double) Main.temporaryGUIScaleSlider != -1.0) + { + Main.UIScale = Main.temporaryGUIScaleSlider; + Main.temporaryGUIScaleSliderUpdate = false; + } + if ((double) Main.mouseX > (double) vector2_4.X + (double) vector2_3.X * 2.0 / 3.0 + (double) num4 && (double) Main.mouseX < (double) IngameOptions.valuePosition.X + 3.75 && (double) Main.mouseY > (double) IngameOptions.valuePosition.Y - 10.0 && (double) Main.mouseY <= (double) IngameOptions.valuePosition.Y + 10.0) + { + if (IngameOptions.rightLock == -1) + IngameOptions.notBar = true; + IngameOptions.rightHover = i16; + } + if (IngameOptions.rightHover == i16) + UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 11; + int i17 = i16 + 1; + anchor2.X += (float) num1; + IngameOptions.DrawRightSide(sb, "", i17, anchor2, offset2, IngameOptions.rightScale[i17], 1f); + IngameOptions.skipRightSlot[i17] = true; + int i18 = i17 + 1; + IngameOptions.DrawRightSide(sb, Language.GetTextValue("GameUI.Gameplay"), i18, anchor2, offset2, IngameOptions.rightScale[i18], 1f); + IngameOptions.skipRightSlot[i18] = true; + int i19 = i18 + 1; + if (IngameOptions.DrawRightSide(sb, Main.autoSave ? Lang.menu[67].Value : Lang.menu[68].Value, i19, anchor2, offset2, IngameOptions.rightScale[i19], (float) (((double) IngameOptions.rightScale[i19] - (double) num5) / ((double) num6 - (double) num5)))) + { + IngameOptions.rightHover = i19; + if (flag4) + Main.autoSave = !Main.autoSave; + } + int i20 = i19 + 1; + if (IngameOptions.DrawRightSide(sb, Main.autoPause ? Lang.menu[69].Value : Lang.menu[70].Value, i20, anchor2, offset2, IngameOptions.rightScale[i20], (float) (((double) IngameOptions.rightScale[i20] - (double) num5) / ((double) num6 - (double) num5)))) + { + IngameOptions.rightHover = i20; + if (flag4) + Main.autoPause = !Main.autoPause; + } + int i21 = i20 + 1; + if (IngameOptions.DrawRightSide(sb, Player.SmartCursorSettings.SmartWallReplacement ? Lang.menu[226].Value : Lang.menu[225].Value, i21, anchor2, offset2, IngameOptions.rightScale[i21], (float) (((double) IngameOptions.rightScale[i21] - (double) num5) / ((double) num6 - (double) num5)))) + { + IngameOptions.rightHover = i21; + if (flag4) + Player.SmartCursorSettings.SmartWallReplacement = !Player.SmartCursorSettings.SmartWallReplacement; + } + int i22 = i21 + 1; + if (IngameOptions.DrawRightSide(sb, Main.ReversedUpDownArmorSetBonuses ? Lang.menu[220].Value : Lang.menu[221].Value, i22, anchor2, offset2, IngameOptions.rightScale[i22], (float) (((double) IngameOptions.rightScale[i22] - (double) num5) / ((double) num6 - (double) num5)))) + { + IngameOptions.rightHover = i22; + if (flag4) + Main.ReversedUpDownArmorSetBonuses = !Main.ReversedUpDownArmorSetBonuses; + } + int i23 = i22 + 1; + IngameOptions.DrawRightSide(sb, "", i23, anchor2, offset2, IngameOptions.rightScale[i23], 1f); + IngameOptions.skipRightSlot[i23] = true; + int num16 = i23 + 1; + } + if (IngameOptions.category == 1) + { + int i24 = 0; + if (IngameOptions.DrawRightSide(sb, Main.showItemText ? Lang.menu[71].Value : Lang.menu[72].Value, i24, anchor2, offset2, IngameOptions.rightScale[i24], (float) (((double) IngameOptions.rightScale[i24] - (double) num5) / ((double) num6 - (double) num5)))) + { + IngameOptions.rightHover = i24; + if (flag4) + Main.showItemText = !Main.showItemText; + } + int i25 = i24 + 1; + if (IngameOptions.DrawRightSide(sb, Lang.menu[123].Value + " " + (object) Lang.menu[124 + Main.invasionProgressMode], i25, anchor2, offset2, IngameOptions.rightScale[i25], (float) (((double) IngameOptions.rightScale[i25] - (double) num5) / ((double) num6 - (double) num5)))) + { + IngameOptions.rightHover = i25; + if (flag4) + { + ++Main.invasionProgressMode; + if (Main.invasionProgressMode >= 3) + Main.invasionProgressMode = 0; + } + } + int i26 = i25 + 1; + if (IngameOptions.DrawRightSide(sb, Main.placementPreview ? Lang.menu[128].Value : Lang.menu[129].Value, i26, anchor2, offset2, IngameOptions.rightScale[i26], (float) (((double) IngameOptions.rightScale[i26] - (double) num5) / ((double) num6 - (double) num5)))) + { + IngameOptions.rightHover = i26; + if (flag4) + Main.placementPreview = !Main.placementPreview; + } + int i27 = i26 + 1; + if (IngameOptions.DrawRightSide(sb, ItemSlot.Options.HighlightNewItems ? Lang.inter[117].Value : Lang.inter[116].Value, i27, anchor2, offset2, IngameOptions.rightScale[i27], (float) (((double) IngameOptions.rightScale[i27] - (double) num5) / ((double) num6 - (double) num5)))) + { + IngameOptions.rightHover = i27; + if (flag4) + ItemSlot.Options.HighlightNewItems = !ItemSlot.Options.HighlightNewItems; + } + int i28 = i27 + 1; + if (IngameOptions.DrawRightSide(sb, Main.MouseShowBuildingGrid ? Lang.menu[229].Value : Lang.menu[230].Value, i28, anchor2, offset2, IngameOptions.rightScale[i28], (float) (((double) IngameOptions.rightScale[i28] - (double) num5) / ((double) num6 - (double) num5)))) + { + IngameOptions.rightHover = i28; + if (flag4) + Main.MouseShowBuildingGrid = !Main.MouseShowBuildingGrid; + } + int i29 = i28 + 1; + if (IngameOptions.DrawRightSide(sb, Main.GamepadDisableInstructionsDisplay ? Lang.menu[241].Value : Lang.menu[242].Value, i29, anchor2, offset2, IngameOptions.rightScale[i29], (float) (((double) IngameOptions.rightScale[i29] - (double) num5) / ((double) num6 - (double) num5)))) + { + IngameOptions.rightHover = i29; + if (flag4) + Main.GamepadDisableInstructionsDisplay = !Main.GamepadDisableInstructionsDisplay; + } + int num17 = i29 + 1; + } + if (IngameOptions.category == 2) + { + int i30 = 0; + if (IngameOptions.DrawRightSide(sb, Main.graphics.IsFullScreen ? Lang.menu[49].Value : Lang.menu[50].Value, i30, anchor2, offset2, IngameOptions.rightScale[i30], (float) (((double) IngameOptions.rightScale[i30] - (double) num5) / ((double) num6 - (double) num5)))) + { + IngameOptions.rightHover = i30; + if (flag4) + Main.ToggleFullScreen(); + } + int i31 = i30 + 1; + if (IngameOptions.DrawRightSide(sb, Lang.menu[51].Value + ": " + (object) Main.PendingResolutionWidth + "x" + (object) Main.PendingResolutionHeight, i31, anchor2, offset2, IngameOptions.rightScale[i31], (float) (((double) IngameOptions.rightScale[i31] - (double) num5) / ((double) num6 - (double) num5)))) + { + IngameOptions.rightHover = i31; + if (flag4) + { + int num18 = 0; + for (int index = 0; index < Main.numDisplayModes; ++index) + { + if (Main.displayWidth[index] == Main.PendingResolutionWidth && Main.displayHeight[index] == Main.PendingResolutionHeight) + { + num18 = index; + break; + } + } + int index1 = num18 + 1; + if (index1 >= Main.numDisplayModes) + index1 = 0; + Main.PendingResolutionWidth = Main.displayWidth[index1]; + Main.PendingResolutionHeight = Main.displayHeight[index1]; + } + } + int i32 = i31 + 1; + anchor2.X -= (float) num1; + if (IngameOptions.DrawRightSide(sb, Lang.menu[52].Value + ": " + (object) Main.bgScroll + "%", i32, anchor2, offset2, IngameOptions.rightScale[i32], (float) (((double) IngameOptions.rightScale[i32] - (double) num5) / ((double) num6 - (double) num5)))) + { + if (IngameOptions.rightLock == -1) + IngameOptions.notBar = true; + IngameOptions.noSound = true; + IngameOptions.rightHover = i32; + } + IngameOptions.valuePosition.X = (float) ((double) vector2_4.X + (double) vector2_3.X - (double) (num4 / 2) - 20.0); + IngameOptions.valuePosition.Y -= 3f; + float num19 = IngameOptions.DrawValueBar(sb, scale, (float) Main.bgScroll / 100f); + if ((IngameOptions.inBar || IngameOptions.rightLock == i32) && !IngameOptions.notBar) + { + IngameOptions.rightHover = i32; + if (Main.mouseLeft && IngameOptions.rightLock == i32) + { + Main.bgScroll = (int) ((double) num19 * 100.0); + Main.caveParallax = (float) (1.0 - (double) Main.bgScroll / 500.0); + } + } + if ((double) Main.mouseX > (double) vector2_4.X + (double) vector2_3.X * 2.0 / 3.0 + (double) num4 && (double) Main.mouseX < (double) IngameOptions.valuePosition.X + 3.75 && (double) Main.mouseY > (double) IngameOptions.valuePosition.Y - 10.0 && (double) Main.mouseY <= (double) IngameOptions.valuePosition.Y + 10.0) + { + if (IngameOptions.rightLock == -1) + IngameOptions.notBar = true; + IngameOptions.rightHover = i32; + } + if (IngameOptions.rightHover == i32) + UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 1; + int i33 = i32 + 1; + anchor2.X += (float) num1; + if (IngameOptions.DrawRightSide(sb, Lang.menu[247 + Main.FrameSkipMode].Value, i33, anchor2, offset2, IngameOptions.rightScale[i33], (float) (((double) IngameOptions.rightScale[i33] - (double) num5) / ((double) num6 - (double) num5)))) + { + IngameOptions.rightHover = i33; + if (flag4) + { + ++Main.FrameSkipMode; + if (Main.FrameSkipMode < 0 || Main.FrameSkipMode > 2) + Main.FrameSkipMode = 0; + } + } + int i34 = i33 + 1; + if (IngameOptions.DrawRightSide(sb, Lang.menu[55 + Lighting.lightMode].Value, i34, anchor2, offset2, IngameOptions.rightScale[i34], (float) (((double) IngameOptions.rightScale[i34] - (double) num5) / ((double) num6 - (double) num5)))) + { + IngameOptions.rightHover = i34; + if (flag4) + Lighting.NextLightMode(); + } + int i35 = i34 + 1; + if (IngameOptions.DrawRightSide(sb, Lang.menu[116].Value + " " + (Lighting.LightingThreads > 0 ? string.Concat((object) (Lighting.LightingThreads + 1)) : Lang.menu[117].Value), i35, anchor2, offset2, IngameOptions.rightScale[i35], (float) (((double) IngameOptions.rightScale[i35] - (double) num5) / ((double) num6 - (double) num5)))) + { + IngameOptions.rightHover = i35; + if (flag4) + { + ++Lighting.LightingThreads; + if (Lighting.LightingThreads > Environment.ProcessorCount - 1) + Lighting.LightingThreads = 0; + } + } + int i36 = i35 + 1; + if (IngameOptions.DrawRightSide(sb, Lang.menu[59 + Main.qaStyle].Value, i36, anchor2, offset2, IngameOptions.rightScale[i36], (float) (((double) IngameOptions.rightScale[i36] - (double) num5) / ((double) num6 - (double) num5)))) + { + IngameOptions.rightHover = i36; + if (flag4) + { + ++Main.qaStyle; + if (Main.qaStyle > 3) + Main.qaStyle = 0; + } + } + int i37 = i36 + 1; + if (IngameOptions.DrawRightSide(sb, Main.BackgroundEnabled ? Lang.menu[100].Value : Lang.menu[101].Value, i37, anchor2, offset2, IngameOptions.rightScale[i37], (float) (((double) IngameOptions.rightScale[i37] - (double) num5) / ((double) num6 - (double) num5)))) + { + IngameOptions.rightHover = i37; + if (flag4) + Main.BackgroundEnabled = !Main.BackgroundEnabled; + } + int i38 = i37 + 1; + if (IngameOptions.DrawRightSide(sb, ChildSafety.Disabled ? Lang.menu[132].Value : Lang.menu[133].Value, i38, anchor2, offset2, IngameOptions.rightScale[i38], (float) (((double) IngameOptions.rightScale[i38] - (double) num5) / ((double) num6 - (double) num5)))) + { + IngameOptions.rightHover = i38; + if (flag4) + ChildSafety.Disabled = !ChildSafety.Disabled; + } + int i39 = i38 + 1; + if (IngameOptions.DrawRightSide(sb, Language.GetTextValue("GameUI.HeatDistortion", Main.UseHeatDistortion ? (object) Language.GetTextValue("GameUI.Enabled") : (object) Language.GetTextValue("GameUI.Disabled")), i39, anchor2, offset2, IngameOptions.rightScale[i39], (float) (((double) IngameOptions.rightScale[i39] - (double) num5) / ((double) num6 - (double) num5)))) + { + IngameOptions.rightHover = i39; + if (flag4) + Main.UseHeatDistortion = !Main.UseHeatDistortion; + } + int i40 = i39 + 1; + if (IngameOptions.DrawRightSide(sb, Language.GetTextValue("GameUI.StormEffects", Main.UseStormEffects ? (object) Language.GetTextValue("GameUI.Enabled") : (object) Language.GetTextValue("GameUI.Disabled")), i40, anchor2, offset2, IngameOptions.rightScale[i40], (float) (((double) IngameOptions.rightScale[i40] - (double) num5) / ((double) num6 - (double) num5)))) + { + IngameOptions.rightHover = i40; + if (flag4) + Main.UseStormEffects = !Main.UseStormEffects; + } + int i41 = i40 + 1; + string textValue; + switch (Main.WaveQuality) + { + case 1: + textValue = Language.GetTextValue("GameUI.QualityLow"); + break; + case 2: + textValue = Language.GetTextValue("GameUI.QualityMedium"); + break; + case 3: + textValue = Language.GetTextValue("GameUI.QualityHigh"); + break; + default: + textValue = Language.GetTextValue("GameUI.QualityOff"); + break; + } + if (IngameOptions.DrawRightSide(sb, Language.GetTextValue("GameUI.WaveQuality", (object) textValue), i41, anchor2, offset2, IngameOptions.rightScale[i41], (float) (((double) IngameOptions.rightScale[i41] - (double) num5) / ((double) num6 - (double) num5)))) + { + IngameOptions.rightHover = i41; + if (flag4) + Main.WaveQuality = (Main.WaveQuality + 1) % 4; + } + int num20 = i41 + 1; + } + if (IngameOptions.category == 3) + { + int i42 = 0; + float num21 = (float) num1; + if (flag1) + num2 = 126f; + Vector3 hslVector = Main.mouseColorSlider.GetHSLVector(); + Main.mouseColorSlider.ApplyToMainLegacyBars(); + IngameOptions.DrawRightSide(sb, Lang.menu[64].Value, i42, anchor2, offset2, IngameOptions.rightScale[i42], 1f); + IngameOptions.skipRightSlot[i42] = true; + int i43 = i42 + 1; + anchor2.X -= num21; + if (IngameOptions.DrawRightSide(sb, "", i43, anchor2, offset2, IngameOptions.rightScale[i43], (float) (((double) IngameOptions.rightScale[i43] - (double) num5) / ((double) num6 - (double) num5)))) + { + if (IngameOptions.rightLock == -1) + IngameOptions.notBar = true; + IngameOptions.rightHover = i43; + } + IngameOptions.valuePosition.X = (float) ((double) vector2_4.X + (double) vector2_3.X - (double) (num4 / 2) - 20.0); + IngameOptions.valuePosition.Y -= 3f; + IngameOptions.valuePosition.X -= num2; + DelegateMethods.v3_1 = hslVector; + float num22 = IngameOptions.DrawValueBar(sb, scale, hslVector.X, colorMethod: new Utils.ColorLerpMethod(DelegateMethods.ColorLerp_HSL_H)); + if ((IngameOptions.inBar || IngameOptions.rightLock == i43) && !IngameOptions.notBar) + { + IngameOptions.rightHover = i43; + if (Main.mouseLeft && IngameOptions.rightLock == i43) + { + hslVector.X = num22; + IngameOptions.noSound = true; + } + } + if ((double) Main.mouseX > (double) vector2_4.X + (double) vector2_3.X * 2.0 / 3.0 + (double) num4 && (double) Main.mouseX < (double) IngameOptions.valuePosition.X + 3.75 && (double) Main.mouseY > (double) IngameOptions.valuePosition.Y - 10.0 && (double) Main.mouseY <= (double) IngameOptions.valuePosition.Y + 10.0) + { + if (IngameOptions.rightLock == -1) + IngameOptions.notBar = true; + IngameOptions.rightHover = i43; + } + if (IngameOptions.rightHover == i43) + { + UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 5; + Main.menuMode = 25; + } + int i44 = i43 + 1; + if (IngameOptions.DrawRightSide(sb, "", i44, anchor2, offset2, IngameOptions.rightScale[i44], (float) (((double) IngameOptions.rightScale[i44] - (double) num5) / ((double) num6 - (double) num5)))) + { + if (IngameOptions.rightLock == -1) + IngameOptions.notBar = true; + IngameOptions.rightHover = i44; + } + IngameOptions.valuePosition.X = (float) ((double) vector2_4.X + (double) vector2_3.X - (double) (num4 / 2) - 20.0); + IngameOptions.valuePosition.Y -= 3f; + IngameOptions.valuePosition.X -= num2; + DelegateMethods.v3_1 = hslVector; + float num23 = IngameOptions.DrawValueBar(sb, scale, hslVector.Y, colorMethod: new Utils.ColorLerpMethod(DelegateMethods.ColorLerp_HSL_S)); + if ((IngameOptions.inBar || IngameOptions.rightLock == i44) && !IngameOptions.notBar) + { + IngameOptions.rightHover = i44; + if (Main.mouseLeft && IngameOptions.rightLock == i44) + { + hslVector.Y = num23; + IngameOptions.noSound = true; + } + } + if ((double) Main.mouseX > (double) vector2_4.X + (double) vector2_3.X * 2.0 / 3.0 + (double) num4 && (double) Main.mouseX < (double) IngameOptions.valuePosition.X + 3.75 && (double) Main.mouseY > (double) IngameOptions.valuePosition.Y - 10.0 && (double) Main.mouseY <= (double) IngameOptions.valuePosition.Y + 10.0) + { + if (IngameOptions.rightLock == -1) + IngameOptions.notBar = true; + IngameOptions.rightHover = i44; + } + if (IngameOptions.rightHover == i44) + { + UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 6; + Main.menuMode = 25; + } + int i45 = i44 + 1; + if (IngameOptions.DrawRightSide(sb, "", i45, anchor2, offset2, IngameOptions.rightScale[i45], (float) (((double) IngameOptions.rightScale[i45] - (double) num5) / ((double) num6 - (double) num5)))) + { + if (IngameOptions.rightLock == -1) + IngameOptions.notBar = true; + IngameOptions.rightHover = i45; + } + IngameOptions.valuePosition.X = (float) ((double) vector2_4.X + (double) vector2_3.X - (double) (num4 / 2) - 20.0); + IngameOptions.valuePosition.Y -= 3f; + IngameOptions.valuePosition.X -= num2; + DelegateMethods.v3_1 = hslVector; + DelegateMethods.v3_1.Z = Utils.InverseLerp(0.15f, 1f, DelegateMethods.v3_1.Z, true); + float num24 = IngameOptions.DrawValueBar(sb, scale, DelegateMethods.v3_1.Z, colorMethod: new Utils.ColorLerpMethod(DelegateMethods.ColorLerp_HSL_L)); + if ((IngameOptions.inBar || IngameOptions.rightLock == i45) && !IngameOptions.notBar) + { + IngameOptions.rightHover = i45; + if (Main.mouseLeft && IngameOptions.rightLock == i45) + { + hslVector.Z = (float) ((double) num24 * 0.850000023841858 + 0.150000005960464); + IngameOptions.noSound = true; + } + } + if ((double) Main.mouseX > (double) vector2_4.X + (double) vector2_3.X * 2.0 / 3.0 + (double) num4 && (double) Main.mouseX < (double) IngameOptions.valuePosition.X + 3.75 && (double) Main.mouseY > (double) IngameOptions.valuePosition.Y - 10.0 && (double) Main.mouseY <= (double) IngameOptions.valuePosition.Y + 10.0) + { + if (IngameOptions.rightLock == -1) + IngameOptions.notBar = true; + IngameOptions.rightHover = i45; + } + if (IngameOptions.rightHover == i45) + { + UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 7; + Main.menuMode = 25; + } + int i46 = i45 + 1; + if ((double) hslVector.Z < 0.150000005960464) + hslVector.Z = 0.15f; + Main.mouseColorSlider.SetHSL(hslVector); + Main.mouseColor = Main.mouseColorSlider.GetColor(); + anchor2.X += num21; + IngameOptions.DrawRightSide(sb, "", i46, anchor2, offset2, IngameOptions.rightScale[i46], 1f); + IngameOptions.skipRightSlot[i46] = true; + int i47 = i46 + 1; + hslVector = Main.mouseBorderColorSlider.GetHSLVector(); + if (PlayerInput.UsingGamepad && IngameOptions.rightHover == -1) + Main.mouseBorderColorSlider.ApplyToMainLegacyBars(); + IngameOptions.DrawRightSide(sb, Lang.menu[217].Value, i47, anchor2, offset2, IngameOptions.rightScale[i47], 1f); + IngameOptions.skipRightSlot[i47] = true; + int i48 = i47 + 1; + anchor2.X -= num21; + if (IngameOptions.DrawRightSide(sb, "", i48, anchor2, offset2, IngameOptions.rightScale[i48], (float) (((double) IngameOptions.rightScale[i48] - (double) num5) / ((double) num6 - (double) num5)))) + { + if (IngameOptions.rightLock == -1) + IngameOptions.notBar = true; + IngameOptions.rightHover = i48; + } + IngameOptions.valuePosition.X = (float) ((double) vector2_4.X + (double) vector2_3.X - (double) (num4 / 2) - 20.0); + IngameOptions.valuePosition.Y -= 3f; + IngameOptions.valuePosition.X -= num2; + DelegateMethods.v3_1 = hslVector; + float num25 = IngameOptions.DrawValueBar(sb, scale, hslVector.X, colorMethod: new Utils.ColorLerpMethod(DelegateMethods.ColorLerp_HSL_H)); + if ((IngameOptions.inBar || IngameOptions.rightLock == i48) && !IngameOptions.notBar) + { + IngameOptions.rightHover = i48; + if (Main.mouseLeft && IngameOptions.rightLock == i48) + { + hslVector.X = num25; + IngameOptions.noSound = true; + } + } + if ((double) Main.mouseX > (double) vector2_4.X + (double) vector2_3.X * 2.0 / 3.0 + (double) num4 && (double) Main.mouseX < (double) IngameOptions.valuePosition.X + 3.75 && (double) Main.mouseY > (double) IngameOptions.valuePosition.Y - 10.0 && (double) Main.mouseY <= (double) IngameOptions.valuePosition.Y + 10.0) + { + if (IngameOptions.rightLock == -1) + IngameOptions.notBar = true; + IngameOptions.rightHover = i48; + } + if (IngameOptions.rightHover == i48) + { + UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 5; + Main.menuMode = 252; + } + int i49 = i48 + 1; + if (IngameOptions.DrawRightSide(sb, "", i49, anchor2, offset2, IngameOptions.rightScale[i49], (float) (((double) IngameOptions.rightScale[i49] - (double) num5) / ((double) num6 - (double) num5)))) + { + if (IngameOptions.rightLock == -1) + IngameOptions.notBar = true; + IngameOptions.rightHover = i49; + } + IngameOptions.valuePosition.X = (float) ((double) vector2_4.X + (double) vector2_3.X - (double) (num4 / 2) - 20.0); + IngameOptions.valuePosition.Y -= 3f; + IngameOptions.valuePosition.X -= num2; + DelegateMethods.v3_1 = hslVector; + float num26 = IngameOptions.DrawValueBar(sb, scale, hslVector.Y, colorMethod: new Utils.ColorLerpMethod(DelegateMethods.ColorLerp_HSL_S)); + if ((IngameOptions.inBar || IngameOptions.rightLock == i49) && !IngameOptions.notBar) + { + IngameOptions.rightHover = i49; + if (Main.mouseLeft && IngameOptions.rightLock == i49) + { + hslVector.Y = num26; + IngameOptions.noSound = true; + } + } + if ((double) Main.mouseX > (double) vector2_4.X + (double) vector2_3.X * 2.0 / 3.0 + (double) num4 && (double) Main.mouseX < (double) IngameOptions.valuePosition.X + 3.75 && (double) Main.mouseY > (double) IngameOptions.valuePosition.Y - 10.0 && (double) Main.mouseY <= (double) IngameOptions.valuePosition.Y + 10.0) + { + if (IngameOptions.rightLock == -1) + IngameOptions.notBar = true; + IngameOptions.rightHover = i49; + } + if (IngameOptions.rightHover == i49) + { + UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 6; + Main.menuMode = 252; + } + int i50 = i49 + 1; + if (IngameOptions.DrawRightSide(sb, "", i50, anchor2, offset2, IngameOptions.rightScale[i50], (float) (((double) IngameOptions.rightScale[i50] - (double) num5) / ((double) num6 - (double) num5)))) + { + if (IngameOptions.rightLock == -1) + IngameOptions.notBar = true; + IngameOptions.rightHover = i50; + } + IngameOptions.valuePosition.X = (float) ((double) vector2_4.X + (double) vector2_3.X - (double) (num4 / 2) - 20.0); + IngameOptions.valuePosition.Y -= 3f; + IngameOptions.valuePosition.X -= num2; + DelegateMethods.v3_1 = hslVector; + float num27 = IngameOptions.DrawValueBar(sb, scale, hslVector.Z, colorMethod: new Utils.ColorLerpMethod(DelegateMethods.ColorLerp_HSL_L)); + if ((IngameOptions.inBar || IngameOptions.rightLock == i50) && !IngameOptions.notBar) + { + IngameOptions.rightHover = i50; + if (Main.mouseLeft && IngameOptions.rightLock == i50) + { + hslVector.Z = num27; + IngameOptions.noSound = true; + } + } + if ((double) Main.mouseX > (double) vector2_4.X + (double) vector2_3.X * 2.0 / 3.0 + (double) num4 && (double) Main.mouseX < (double) IngameOptions.valuePosition.X + 3.75 && (double) Main.mouseY > (double) IngameOptions.valuePosition.Y - 10.0 && (double) Main.mouseY <= (double) IngameOptions.valuePosition.Y + 10.0) + { + if (IngameOptions.rightLock == -1) + IngameOptions.notBar = true; + IngameOptions.rightHover = i50; + } + if (IngameOptions.rightHover == i50) + { + UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 7; + Main.menuMode = 252; + } + int i51 = i50 + 1; + if (IngameOptions.DrawRightSide(sb, "", i51, anchor2, offset2, IngameOptions.rightScale[i51], (float) (((double) IngameOptions.rightScale[i51] - (double) num5) / ((double) num6 - (double) num5)))) + { + if (IngameOptions.rightLock == -1) + IngameOptions.notBar = true; + IngameOptions.rightHover = i51; + } + IngameOptions.valuePosition.X = (float) ((double) vector2_4.X + (double) vector2_3.X - (double) (num4 / 2) - 20.0); + IngameOptions.valuePosition.Y -= 3f; + IngameOptions.valuePosition.X -= num2; + DelegateMethods.v3_1 = hslVector; + float perc = Main.mouseBorderColorSlider.Alpha; + float num28 = IngameOptions.DrawValueBar(sb, scale, perc, colorMethod: new Utils.ColorLerpMethod(DelegateMethods.ColorLerp_HSL_O)); + if ((IngameOptions.inBar || IngameOptions.rightLock == i51) && !IngameOptions.notBar) + { + IngameOptions.rightHover = i51; + if (Main.mouseLeft && IngameOptions.rightLock == i51) + { + perc = num28; + IngameOptions.noSound = true; + } + } + if ((double) Main.mouseX > (double) vector2_4.X + (double) vector2_3.X * 2.0 / 3.0 + (double) num4 && (double) Main.mouseX < (double) IngameOptions.valuePosition.X + 3.75 && (double) Main.mouseY > (double) IngameOptions.valuePosition.Y - 10.0 && (double) Main.mouseY <= (double) IngameOptions.valuePosition.Y + 10.0) + { + if (IngameOptions.rightLock == -1) + IngameOptions.notBar = true; + IngameOptions.rightHover = i51; + } + if (IngameOptions.rightHover == i51) + { + UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 8; + Main.menuMode = 252; + } + int i52 = i51 + 1; + Main.mouseBorderColorSlider.SetHSL(hslVector); + Main.mouseBorderColorSlider.Alpha = perc; + Main.MouseBorderColor = Main.mouseBorderColorSlider.GetColor(); + anchor2.X += num21; + IngameOptions.DrawRightSide(sb, "", i52, anchor2, offset2, IngameOptions.rightScale[i52], 1f); + IngameOptions.skipRightSlot[i52] = true; + int i53 = i52 + 1; + string txt = ""; + switch (LockOnHelper.UseMode) + { + case LockOnHelper.LockOnMode.FocusTarget: + txt = Lang.menu[232].Value; + break; + case LockOnHelper.LockOnMode.TargetClosest: + txt = Lang.menu[233].Value; + break; + case LockOnHelper.LockOnMode.ThreeDS: + txt = Lang.menu[234].Value; + break; + } + if (IngameOptions.DrawRightSide(sb, txt, i53, anchor2, offset2, IngameOptions.rightScale[i53] * 0.9f, (float) (((double) IngameOptions.rightScale[i53] - (double) num5) / ((double) num6 - (double) num5)))) + { + IngameOptions.rightHover = i53; + if (flag4) + LockOnHelper.CycleUseModes(); + } + int i54 = i53 + 1; + if (IngameOptions.DrawRightSide(sb, Player.SmartCursorSettings.SmartBlocksEnabled ? Lang.menu[215].Value : Lang.menu[216].Value, i54, anchor2, offset2, IngameOptions.rightScale[i54] * 0.9f, (float) (((double) IngameOptions.rightScale[i54] - (double) num5) / ((double) num6 - (double) num5)))) + { + IngameOptions.rightHover = i54; + if (flag4) + Player.SmartCursorSettings.SmartBlocksEnabled = !Player.SmartCursorSettings.SmartBlocksEnabled; + } + int i55 = i54 + 1; + if (IngameOptions.DrawRightSide(sb, Main.cSmartCursorToggle ? Lang.menu[121].Value : Lang.menu[122].Value, i55, anchor2, offset2, IngameOptions.rightScale[i55], (float) (((double) IngameOptions.rightScale[i55] - (double) num5) / ((double) num6 - (double) num5)))) + { + IngameOptions.rightHover = i55; + if (flag4) + Main.cSmartCursorToggle = !Main.cSmartCursorToggle; + } + int i56 = i55 + 1; + if (IngameOptions.DrawRightSide(sb, Player.SmartCursorSettings.SmartAxeAfterPickaxe ? Lang.menu[214].Value : Lang.menu[213].Value, i56, anchor2, offset2, IngameOptions.rightScale[i56] * 0.9f, (float) (((double) IngameOptions.rightScale[i56] - (double) num5) / ((double) num6 - (double) num5)))) + { + IngameOptions.rightHover = i56; + if (flag4) + Player.SmartCursorSettings.SmartAxeAfterPickaxe = !Player.SmartCursorSettings.SmartAxeAfterPickaxe; + } + int num29 = i56 + 1; + } + if (IngameOptions.rightHover != -1 && IngameOptions.rightLock == -1) + IngameOptions.rightLock = IngameOptions.rightHover; + for (int index = 0; index < num8 + 1; ++index) + UILinkPointNavigator.SetPosition(2900 + index, anchor1 + offset1 * (float) (index + 1)); + int num30 = 0; + Vector2 zero = Vector2.Zero; + if (flag1) + zero.X = -40f; + for (int index = 0; index < num10; ++index) + { + if (!IngameOptions.skipRightSlot[index]) + { + UILinkPointNavigator.SetPosition(2930 + num30, anchor2 + zero + offset2 * (float) (index + 1)); + ++num30; } } - if ((double) Main.mouseX > (double) vector2_4.X + (double) vector2_3.X * 2.0 / 3.0 + (double) num4 && (double) Main.mouseX < (double) IngameOptions.valuePosition.X + 3.75 && (double) Main.mouseY > (double) IngameOptions.valuePosition.Y - 10.0 && (double) Main.mouseY <= (double) IngameOptions.valuePosition.Y + 10.0) - { - if (IngameOptions.rightLock == -1) - IngameOptions.notBar = true; - IngameOptions.rightHover = i48; - } - if (IngameOptions.rightHover == i48) - { - UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 5; - Main.menuMode = 25; - } - int i49 = i48 + 1; - if (IngameOptions.DrawRightSide(sb, "", i49, anchor2, offset2, IngameOptions.rightScale[i49], (float) (((double) IngameOptions.rightScale[i49] - (double) num5) / ((double) num6 - (double) num5)))) - { - if (IngameOptions.rightLock == -1) - IngameOptions.notBar = true; - IngameOptions.rightHover = i49; - } - IngameOptions.valuePosition.X = (float) ((double) vector2_4.X + (double) vector2_3.X - (double) (num4 / 2) - 20.0); - IngameOptions.valuePosition.Y -= 3f; - IngameOptions.valuePosition.X -= num2; - DelegateMethods.v3_1 = hslVector1; - float num26 = IngameOptions.DrawValueBar(sb, scale, hslVector1.Y, colorMethod: new Utils.ColorLerpMethod(DelegateMethods.ColorLerp_HSL_S)); - if ((IngameOptions.inBar || IngameOptions.rightLock == i49) && !IngameOptions.notBar) - { - IngameOptions.rightHover = i49; - if (Main.mouseLeft && IngameOptions.rightLock == i49) - { - hslVector1.Y = num26; - IngameOptions.noSound = true; - } - } - if ((double) Main.mouseX > (double) vector2_4.X + (double) vector2_3.X * 2.0 / 3.0 + (double) num4 && (double) Main.mouseX < (double) IngameOptions.valuePosition.X + 3.75 && (double) Main.mouseY > (double) IngameOptions.valuePosition.Y - 10.0 && (double) Main.mouseY <= (double) IngameOptions.valuePosition.Y + 10.0) - { - if (IngameOptions.rightLock == -1) - IngameOptions.notBar = true; - IngameOptions.rightHover = i49; - } - if (IngameOptions.rightHover == i49) - { - UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 6; - Main.menuMode = 25; - } - int i50 = i49 + 1; - if (IngameOptions.DrawRightSide(sb, "", i50, anchor2, offset2, IngameOptions.rightScale[i50], (float) (((double) IngameOptions.rightScale[i50] - (double) num5) / ((double) num6 - (double) num5)))) - { - if (IngameOptions.rightLock == -1) - IngameOptions.notBar = true; - IngameOptions.rightHover = i50; - } - IngameOptions.valuePosition.X = (float) ((double) vector2_4.X + (double) vector2_3.X - (double) (num4 / 2) - 20.0); - IngameOptions.valuePosition.Y -= 3f; - IngameOptions.valuePosition.X -= num2; - DelegateMethods.v3_1 = hslVector1; - DelegateMethods.v3_1.Z = Utils.GetLerpValue(0.15f, 1f, DelegateMethods.v3_1.Z, true); - float num27 = IngameOptions.DrawValueBar(sb, scale, DelegateMethods.v3_1.Z, colorMethod: new Utils.ColorLerpMethod(DelegateMethods.ColorLerp_HSL_L)); - if ((IngameOptions.inBar || IngameOptions.rightLock == i50) && !IngameOptions.notBar) - { - IngameOptions.rightHover = i50; - if (Main.mouseLeft && IngameOptions.rightLock == i50) - { - hslVector1.Z = (float) ((double) num27 * 0.850000023841858 + 0.150000005960464); - IngameOptions.noSound = true; - } - } - if ((double) Main.mouseX > (double) vector2_4.X + (double) vector2_3.X * 2.0 / 3.0 + (double) num4 && (double) Main.mouseX < (double) IngameOptions.valuePosition.X + 3.75 && (double) Main.mouseY > (double) IngameOptions.valuePosition.Y - 10.0 && (double) Main.mouseY <= (double) IngameOptions.valuePosition.Y + 10.0) - { - if (IngameOptions.rightLock == -1) - IngameOptions.notBar = true; - IngameOptions.rightHover = i50; - } - if (IngameOptions.rightHover == i50) - { - UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 7; - Main.menuMode = 25; - } - int i51 = i50 + 1; - if ((double) hslVector1.Z < 0.150000005960464) - hslVector1.Z = 0.15f; - Main.mouseColorSlider.SetHSL(hslVector1); - Main.mouseColor = Main.mouseColorSlider.GetColor(); - anchor2.X += num24; - IngameOptions.DrawRightSide(sb, "", i51, anchor2, offset2, IngameOptions.rightScale[i51], 1f); - IngameOptions.skipRightSlot[i51] = true; - int i52 = i51 + 1; - Vector3 hslVector2 = Main.mouseBorderColorSlider.GetHSLVector(); - if (PlayerInput.UsingGamepad && IngameOptions.rightHover == -1) - Main.mouseBorderColorSlider.ApplyToMainLegacyBars(); - IngameOptions.DrawRightSide(sb, Lang.menu[217].Value, i52, anchor2, offset2, IngameOptions.rightScale[i52], 1f); - IngameOptions.skipRightSlot[i52] = true; - int i53 = i52 + 1; - anchor2.X -= num24; - if (IngameOptions.DrawRightSide(sb, "", i53, anchor2, offset2, IngameOptions.rightScale[i53], (float) (((double) IngameOptions.rightScale[i53] - (double) num5) / ((double) num6 - (double) num5)))) - { - if (IngameOptions.rightLock == -1) - IngameOptions.notBar = true; - IngameOptions.rightHover = i53; - } - IngameOptions.valuePosition.X = (float) ((double) vector2_4.X + (double) vector2_3.X - (double) (num4 / 2) - 20.0); - IngameOptions.valuePosition.Y -= 3f; - IngameOptions.valuePosition.X -= num2; - DelegateMethods.v3_1 = hslVector2; - float num28 = IngameOptions.DrawValueBar(sb, scale, hslVector2.X, colorMethod: new Utils.ColorLerpMethod(DelegateMethods.ColorLerp_HSL_H)); - if ((IngameOptions.inBar || IngameOptions.rightLock == i53) && !IngameOptions.notBar) - { - IngameOptions.rightHover = i53; - if (Main.mouseLeft && IngameOptions.rightLock == i53) - { - hslVector2.X = num28; - IngameOptions.noSound = true; - } - } - if ((double) Main.mouseX > (double) vector2_4.X + (double) vector2_3.X * 2.0 / 3.0 + (double) num4 && (double) Main.mouseX < (double) IngameOptions.valuePosition.X + 3.75 && (double) Main.mouseY > (double) IngameOptions.valuePosition.Y - 10.0 && (double) Main.mouseY <= (double) IngameOptions.valuePosition.Y + 10.0) - { - if (IngameOptions.rightLock == -1) - IngameOptions.notBar = true; - IngameOptions.rightHover = i53; - } - if (IngameOptions.rightHover == i53) - { - UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 5; - Main.menuMode = 252; - } - int i54 = i53 + 1; - if (IngameOptions.DrawRightSide(sb, "", i54, anchor2, offset2, IngameOptions.rightScale[i54], (float) (((double) IngameOptions.rightScale[i54] - (double) num5) / ((double) num6 - (double) num5)))) - { - if (IngameOptions.rightLock == -1) - IngameOptions.notBar = true; - IngameOptions.rightHover = i54; - } - IngameOptions.valuePosition.X = (float) ((double) vector2_4.X + (double) vector2_3.X - (double) (num4 / 2) - 20.0); - IngameOptions.valuePosition.Y -= 3f; - IngameOptions.valuePosition.X -= num2; - DelegateMethods.v3_1 = hslVector2; - float num29 = IngameOptions.DrawValueBar(sb, scale, hslVector2.Y, colorMethod: new Utils.ColorLerpMethod(DelegateMethods.ColorLerp_HSL_S)); - if ((IngameOptions.inBar || IngameOptions.rightLock == i54) && !IngameOptions.notBar) - { - IngameOptions.rightHover = i54; - if (Main.mouseLeft && IngameOptions.rightLock == i54) - { - hslVector2.Y = num29; - IngameOptions.noSound = true; - } - } - if ((double) Main.mouseX > (double) vector2_4.X + (double) vector2_3.X * 2.0 / 3.0 + (double) num4 && (double) Main.mouseX < (double) IngameOptions.valuePosition.X + 3.75 && (double) Main.mouseY > (double) IngameOptions.valuePosition.Y - 10.0 && (double) Main.mouseY <= (double) IngameOptions.valuePosition.Y + 10.0) - { - if (IngameOptions.rightLock == -1) - IngameOptions.notBar = true; - IngameOptions.rightHover = i54; - } - if (IngameOptions.rightHover == i54) - { - UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 6; - Main.menuMode = 252; - } - int i55 = i54 + 1; - if (IngameOptions.DrawRightSide(sb, "", i55, anchor2, offset2, IngameOptions.rightScale[i55], (float) (((double) IngameOptions.rightScale[i55] - (double) num5) / ((double) num6 - (double) num5)))) - { - if (IngameOptions.rightLock == -1) - IngameOptions.notBar = true; - IngameOptions.rightHover = i55; - } - IngameOptions.valuePosition.X = (float) ((double) vector2_4.X + (double) vector2_3.X - (double) (num4 / 2) - 20.0); - IngameOptions.valuePosition.Y -= 3f; - IngameOptions.valuePosition.X -= num2; - DelegateMethods.v3_1 = hslVector2; - float num30 = IngameOptions.DrawValueBar(sb, scale, hslVector2.Z, colorMethod: new Utils.ColorLerpMethod(DelegateMethods.ColorLerp_HSL_L)); - if ((IngameOptions.inBar || IngameOptions.rightLock == i55) && !IngameOptions.notBar) - { - IngameOptions.rightHover = i55; - if (Main.mouseLeft && IngameOptions.rightLock == i55) - { - hslVector2.Z = num30; - IngameOptions.noSound = true; - } - } - if ((double) Main.mouseX > (double) vector2_4.X + (double) vector2_3.X * 2.0 / 3.0 + (double) num4 && (double) Main.mouseX < (double) IngameOptions.valuePosition.X + 3.75 && (double) Main.mouseY > (double) IngameOptions.valuePosition.Y - 10.0 && (double) Main.mouseY <= (double) IngameOptions.valuePosition.Y + 10.0) - { - if (IngameOptions.rightLock == -1) - IngameOptions.notBar = true; - IngameOptions.rightHover = i55; - } - if (IngameOptions.rightHover == i55) - { - UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 7; - Main.menuMode = 252; - } - int i56 = i55 + 1; - if (IngameOptions.DrawRightSide(sb, "", i56, anchor2, offset2, IngameOptions.rightScale[i56], (float) (((double) IngameOptions.rightScale[i56] - (double) num5) / ((double) num6 - (double) num5)))) - { - if (IngameOptions.rightLock == -1) - IngameOptions.notBar = true; - IngameOptions.rightHover = i56; - } - IngameOptions.valuePosition.X = (float) ((double) vector2_4.X + (double) vector2_3.X - (double) (num4 / 2) - 20.0); - IngameOptions.valuePosition.Y -= 3f; - IngameOptions.valuePosition.X -= num2; - DelegateMethods.v3_1 = hslVector2; - float perc = Main.mouseBorderColorSlider.Alpha; - float num31 = IngameOptions.DrawValueBar(sb, scale, perc, colorMethod: new Utils.ColorLerpMethod(DelegateMethods.ColorLerp_HSL_O)); - if ((IngameOptions.inBar || IngameOptions.rightLock == i56) && !IngameOptions.notBar) - { - IngameOptions.rightHover = i56; - if (Main.mouseLeft && IngameOptions.rightLock == i56) - { - perc = num31; - IngameOptions.noSound = true; - } - } - if ((double) Main.mouseX > (double) vector2_4.X + (double) vector2_3.X * 2.0 / 3.0 + (double) num4 && (double) Main.mouseX < (double) IngameOptions.valuePosition.X + 3.75 && (double) Main.mouseY > (double) IngameOptions.valuePosition.Y - 10.0 && (double) Main.mouseY <= (double) IngameOptions.valuePosition.Y + 10.0) - { - if (IngameOptions.rightLock == -1) - IngameOptions.notBar = true; - IngameOptions.rightHover = i56; - } - if (IngameOptions.rightHover == i56) - { - UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 8; - Main.menuMode = 252; - } - int i57 = i56 + 1; - Main.mouseBorderColorSlider.SetHSL(hslVector2); - Main.mouseBorderColorSlider.Alpha = perc; - Main.MouseBorderColor = Main.mouseBorderColorSlider.GetColor(); - anchor2.X += num24; - IngameOptions.DrawRightSide(sb, "", i57, anchor2, offset2, IngameOptions.rightScale[i57], 1f); - IngameOptions.skipRightSlot[i57] = true; - int i58 = i57 + 1; - string txt = ""; - switch (LockOnHelper.UseMode) - { - case LockOnHelper.LockOnMode.FocusTarget: - txt = Lang.menu[232].Value; - break; - case LockOnHelper.LockOnMode.TargetClosest: - txt = Lang.menu[233].Value; - break; - case LockOnHelper.LockOnMode.ThreeDS: - txt = Lang.menu[234].Value; - break; - } - if (IngameOptions.DrawRightSide(sb, txt, i58, anchor2, offset2, IngameOptions.rightScale[i58] * 0.9f, (float) (((double) IngameOptions.rightScale[i58] - (double) num5) / ((double) num6 - (double) num5)))) - { - IngameOptions.rightHover = i58; - if (flag4) - LockOnHelper.CycleUseModes(); - } - int i59 = i58 + 1; - if (IngameOptions.DrawRightSide(sb, Player.SmartCursorSettings.SmartBlocksEnabled ? Lang.menu[215].Value : Lang.menu[216].Value, i59, anchor2, offset2, IngameOptions.rightScale[i59] * 0.9f, (float) (((double) IngameOptions.rightScale[i59] - (double) num5) / ((double) num6 - (double) num5)))) - { - IngameOptions.rightHover = i59; - if (flag4) - Player.SmartCursorSettings.SmartBlocksEnabled = !Player.SmartCursorSettings.SmartBlocksEnabled; - } - int i60 = i59 + 1; - if (IngameOptions.DrawRightSide(sb, Main.cSmartCursorModeIsToggleAndNotHold ? Lang.menu[121].Value : Lang.menu[122].Value, i60, anchor2, offset2, IngameOptions.rightScale[i60], (float) (((double) IngameOptions.rightScale[i60] - (double) num5) / ((double) num6 - (double) num5)))) - { - IngameOptions.rightHover = i60; - if (flag4) - Main.cSmartCursorModeIsToggleAndNotHold = !Main.cSmartCursorModeIsToggleAndNotHold; - } - int i61 = i60 + 1; - if (IngameOptions.DrawRightSide(sb, Player.SmartCursorSettings.SmartAxeAfterPickaxe ? Lang.menu[214].Value : Lang.menu[213].Value, i61, anchor2, offset2, IngameOptions.rightScale[i61] * 0.9f, (float) (((double) IngameOptions.rightScale[i61] - (double) num5) / ((double) num6 - (double) num5)))) - { - IngameOptions.rightHover = i61; - if (flag4) - Player.SmartCursorSettings.SmartAxeAfterPickaxe = !Player.SmartCursorSettings.SmartAxeAfterPickaxe; - } - int num32 = i61 + 1; + UILinkPointNavigator.Shortcuts.INGAMEOPTIONS_BUTTONS_RIGHT = num30; + Main.DrawGamepadInstructions(); + Main.mouseText = false; + Main.instance.GUIBarsDraw(); + Main.instance.DrawMouseOver(); + Main.DrawCursor(Main.DrawThickCursor()); } - if (IngameOptions.rightHover != -1 && IngameOptions.rightLock == -1) - IngameOptions.rightLock = IngameOptions.rightHover; - for (int index = 0; index < num8 + 1; ++index) - UILinkPointNavigator.SetPosition(2900 + index, anchor1 + offset1 * (float) (index + 1)); - Vector2 zero = Vector2.Zero; - if (flag1) - zero.X = -40f; - for (int index = 0; index < num12; ++index) - { - if (!IngameOptions.skipRightSlot[index]) - { - UILinkPointNavigator.SetPosition(2930 + num11, anchor2 + zero + offset2 * (float) (index + 1)); - ++num11; - } - } - UILinkPointNavigator.Shortcuts.INGAMEOPTIONS_BUTTONS_RIGHT = num11; - Main.DrawInterface_29_SettingsButton(); - Main.DrawGamepadInstructions(); - Main.mouseText = false; - Main.instance.GUIBarsDraw(); - Main.instance.DrawMouseOver(); - Main.DrawCursor(Main.DrawThickCursor()); } public static void MouseOver() @@ -1226,12 +1100,9 @@ namespace Terraria float maxscale = 0.8f, float scalespeed = 0.01f) { - bool flag = false; - int num; - if (IngameOptions._leftSideCategoryMapping.TryGetValue(i, out num)) - flag = IngameOptions.category == num; + int num = i == IngameOptions.category ? 1 : 0; Color color = Color.Lerp(Color.Gray, Color.White, (float) (((double) scales[i] - (double) minscale) / ((double) maxscale - (double) minscale))); - if (flag) + if (num != 0) color = Color.Gold; Vector2 vector2 = Utils.DrawBorderStringBig(sb, txt, anchor + offset * (float) (1 + i), color, scales[i], 0.5f, 0.5f); return new Rectangle((int) anchor.X - (int) vector2.X / 2, (int) anchor.Y + (int) ((double) offset.Y * (double) (1 + i)) - (int) vector2.Y / 2, (int) vector2.X, (int) vector2.Y).Contains(new Point(Main.mouseX, Main.mouseY)); @@ -1255,19 +1126,10 @@ namespace Terraria return new Rectangle((int) anchor.X - (int) vector2.X / 2, (int) anchor.Y + (int) ((double) offset.Y * (double) (1 + i)) - (int) vector2.Y / 2, (int) vector2.X, (int) vector2.Y).Contains(new Point(Main.mouseX, Main.mouseY)); } - public static Rectangle GetExpectedRectangleForNotification( - int itemIndex, - Vector2 anchor, - Vector2 offset, - int areaWidth) - { - return Utils.CenteredRectangle(anchor + offset * (float) (1 + itemIndex), new Vector2((float) areaWidth, offset.Y - 4f)); - } - public static bool DrawValue(SpriteBatch sb, string txt, int i, float scale, Color over = default (Color)) { Color color = Color.Gray; - Vector2 vector2 = FontAssets.MouseText.Value.MeasureString(txt) * scale; + Vector2 vector2 = Main.fontMouseText.MeasureString(txt) * scale; int num = new Rectangle((int) IngameOptions.valuePosition.X, (int) IngameOptions.valuePosition.Y - (int) vector2.Y / 2, (int) vector2.X, (int) vector2.Y).Contains(new Point(Main.mouseX, Main.mouseY)) ? 1 : 0; if (num != 0) color = Color.White; @@ -1287,27 +1149,28 @@ namespace Terraria { if (colorMethod == null) colorMethod = new Utils.ColorLerpMethod(Utils.ColorLerp_BlackToWhite); - Texture2D texture = TextureAssets.ColorBar.Value; - Vector2 vector2 = new Vector2((float) texture.Width, (float) texture.Height) * scale; + Texture2D colorBarTexture = Main.colorBarTexture; + Vector2 vector2 = new Vector2((float) colorBarTexture.Width, (float) colorBarTexture.Height) * scale; IngameOptions.valuePosition.X -= (float) (int) vector2.X; Rectangle destinationRectangle1 = new Rectangle((int) IngameOptions.valuePosition.X, (int) IngameOptions.valuePosition.Y - (int) vector2.Y / 2, (int) vector2.X, (int) vector2.Y); Rectangle destinationRectangle2 = destinationRectangle1; - sb.Draw(texture, destinationRectangle1, Color.White); + sb.Draw(colorBarTexture, destinationRectangle1, Color.White); int num1 = 167; float num2 = (float) destinationRectangle1.X + 5f * scale; float y = (float) destinationRectangle1.Y + 4f * scale; for (float num3 = 0.0f; (double) num3 < (double) num1; ++num3) { float percent = num3 / (float) num1; - sb.Draw(TextureAssets.ColorBlip.Value, new Vector2(num2 + num3 * scale, y), new Rectangle?(), colorMethod(percent), 0.0f, Vector2.Zero, scale, SpriteEffects.None, 0.0f); + sb.Draw(Main.colorBlipTexture, new Vector2(num2 + num3 * scale, y), new Rectangle?(), colorMethod(percent), 0.0f, Vector2.Zero, scale, SpriteEffects.None, 0.0f); } - destinationRectangle1.Inflate((int) (-5.0 * (double) scale), 0); + destinationRectangle1.X = (int) num2; + destinationRectangle1.Y = (int) y; bool flag = destinationRectangle1.Contains(new Point(Main.mouseX, Main.mouseY)); if (lockState == 2) flag = false; if (flag || lockState == 1) - sb.Draw(TextureAssets.ColorHighlight.Value, destinationRectangle2, Main.OurFavoriteColor); - sb.Draw(TextureAssets.ColorSlider.Value, new Vector2(num2 + 167f * scale * perc, y + 4f * scale), new Rectangle?(), Color.White, 0.0f, new Vector2(0.5f * (float) TextureAssets.ColorSlider.Width(), 0.5f * (float) TextureAssets.ColorSlider.Height()), scale, SpriteEffects.None, 0.0f); + sb.Draw(Main.colorHighlightTexture, destinationRectangle2, Main.OurFavoriteColor); + sb.Draw(Main.colorSliderTexture, new Vector2(num2 + 167f * scale * perc, y + 4f * scale), new Rectangle?(), Color.White, 0.0f, new Vector2(0.5f * (float) Main.colorSliderTexture.Width, 0.5f * (float) Main.colorSliderTexture.Height), scale, SpriteEffects.None, 0.0f); if (Main.mouseX >= destinationRectangle1.X && Main.mouseX <= destinationRectangle1.X + destinationRectangle1.Width) { IngameOptions.inBar = flag; diff --git a/Initializers/AchievementInitializer.cs b/Initializers/AchievementInitializer.cs index 157f16b..029ba10 100644 --- a/Initializers/AchievementInitializer.cs +++ b/Initializers/AchievementInitializer.cs @@ -1,14 +1,12 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Initializers.AchievementInitializer -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Terraria.Achievements; -using Terraria.Audio; using Terraria.GameContent.Achievements; using Terraria.GameContent.UI.Chat; -using Terraria.ID; using Terraria.Localization; namespace Terraria.Initializers @@ -22,285 +20,282 @@ namespace Terraria.Initializers Achievement achievement1 = new Achievement("TIMBER"); achievement1.AddCondition(ItemPickupCondition.Create((short) 9, (short) 619, (short) 2504, (short) 620, (short) 2503, (short) 2260, (short) 621, (short) 911, (short) 1729)); Main.Achievements.Register(achievement1); - Achievement achievement2 = new Achievement("BENCHED"); - achievement2.AddCondition(ItemCraftCondition.Create(ItemID.Sets.Workbenches)); + Achievement achievement2 = new Achievement("NO_HOBO"); + achievement2.AddCondition((AchievementCondition) ProgressionEventCondition.Create(8)); Main.Achievements.Register(achievement2); - Achievement achievement3 = new Achievement("NO_HOBO"); - achievement3.AddCondition((AchievementCondition) ProgressionEventCondition.Create(8)); + Achievement achievement3 = new Achievement("OBTAIN_HAMMER"); + achievement3.AddCondition(ItemPickupCondition.Create((short) 2775, (short) 2746, (short) 3505, (short) 654, (short) 3517, (short) 7, (short) 3493, (short) 2780, (short) 1513, (short) 2516, (short) 660, (short) 3481, (short) 657, (short) 922, (short) 3511, (short) 2785, (short) 3499, (short) 3487, (short) 196, (short) 367, (short) 104, (short) 797, (short) 2320, (short) 787, (short) 1234, (short) 1262, (short) 3465, (short) 204, (short) 217, (short) 1507, (short) 3524, (short) 3522, (short) 3525, (short) 3523, (short) 1305)); Main.Achievements.Register(achievement3); - Achievement achievement4 = new Achievement("OBTAIN_HAMMER"); - achievement4.AddCondition(ItemPickupCondition.Create((short) 2775, (short) 2746, (short) 3505, (short) 654, (short) 3517, (short) 7, (short) 3493, (short) 2780, (short) 1513, (short) 2516, (short) 660, (short) 3481, (short) 657, (short) 922, (short) 3511, (short) 2785, (short) 3499, (short) 3487, (short) 196, (short) 367, (short) 104, (short) 797, (short) 2320, (short) 787, (short) 1234, (short) 1262, (short) 3465, (short) 204, (short) 217, (short) 1507, (short) 3524, (short) 3522, (short) 3525, (short) 3523, (short) 4317, (short) 1305)); + Achievement achievement4 = new Achievement("OOO_SHINY"); + achievement4.AddCondition(TileDestroyedCondition.Create((ushort) 7, (ushort) 6, (ushort) 9, (ushort) 8, (ushort) 166, (ushort) 167, (ushort) 168, (ushort) 169, (ushort) 22, (ushort) 204, (ushort) 58, (ushort) 107, (ushort) 108, (ushort) 111, (ushort) 221, (ushort) 222, (ushort) 223, (ushort) 211)); Main.Achievements.Register(achievement4); - Achievement achievement5 = new Achievement("OOO_SHINY"); - achievement5.AddCondition(TileDestroyedCondition.Create((ushort) 7, (ushort) 6, (ushort) 9, (ushort) 8, (ushort) 166, (ushort) 167, (ushort) 168, (ushort) 169, (ushort) 22, (ushort) 204, (ushort) 58, (ushort) 107, (ushort) 108, (ushort) 111, (ushort) 221, (ushort) 222, (ushort) 223, (ushort) 211)); + Achievement achievement5 = new Achievement("HEART_BREAKER"); + achievement5.AddCondition(TileDestroyedCondition.Create((ushort) 12)); Main.Achievements.Register(achievement5); - Achievement achievement6 = new Achievement("HEART_BREAKER"); - achievement6.AddCondition(TileDestroyedCondition.Create((ushort) 12)); + Achievement achievement6 = new Achievement("HEAVY_METAL"); + achievement6.AddCondition(ItemPickupCondition.Create((short) 35, (short) 716)); Main.Achievements.Register(achievement6); - Achievement achievement7 = new Achievement("HEAVY_METAL"); - achievement7.AddCondition(ItemPickupCondition.Create((short) 35, (short) 716)); + Achievement achievement7 = new Achievement("I_AM_LOOT"); + achievement7.AddCondition(CustomFlagCondition.Create("Peek")); Main.Achievements.Register(achievement7); - Achievement achievement8 = new Achievement("I_AM_LOOT"); - achievement8.AddCondition(CustomFlagCondition.Create("Peek")); + Achievement achievement8 = new Achievement("STAR_POWER"); + achievement8.AddCondition(CustomFlagCondition.Create("Use")); Main.Achievements.Register(achievement8); - Achievement achievement9 = new Achievement("STAR_POWER"); - achievement9.AddCondition(CustomFlagCondition.Create("Use")); + Achievement achievement9 = new Achievement("HOLD_ON_TIGHT"); + achievement9.AddCondition(CustomFlagCondition.Create("Equip")); Main.Achievements.Register(achievement9); - Achievement achievement10 = new Achievement("HOLD_ON_TIGHT"); - achievement10.AddCondition(CustomFlagCondition.Create("Equip")); + Achievement achievement10 = new Achievement("EYE_ON_YOU"); + achievement10.AddCondition(NPCKilledCondition.Create((short) 4)); Main.Achievements.Register(achievement10); - Achievement achievement11 = new Achievement("EYE_ON_YOU"); - achievement11.AddCondition(NPCKilledCondition.Create((short) 4)); + Achievement achievement11 = new Achievement("SMASHING_POPPET"); + achievement11.AddCondition((AchievementCondition) ProgressionEventCondition.Create(7)); Main.Achievements.Register(achievement11); - Achievement achievement12 = new Achievement("SMASHING_POPPET"); - achievement12.AddCondition((AchievementCondition) ProgressionEventCondition.Create(7)); + Achievement achievement12 = new Achievement("WORM_FODDER"); + achievement12.AddCondition(NPCKilledCondition.Create((short) 13, (short) 14, (short) 15)); Main.Achievements.Register(achievement12); - Achievement achievement13 = new Achievement("WORM_FODDER"); - achievement13.AddCondition(NPCKilledCondition.Create((short) 13, (short) 14, (short) 15)); + Achievement achievement13 = new Achievement("MASTERMIND"); + achievement13.AddCondition(NPCKilledCondition.Create((short) 266)); Main.Achievements.Register(achievement13); - Achievement achievement14 = new Achievement("MASTERMIND"); - achievement14.AddCondition(NPCKilledCondition.Create((short) 266)); + Achievement achievement14 = new Achievement("WHERES_MY_HONEY"); + achievement14.AddCondition(CustomFlagCondition.Create("Reach")); Main.Achievements.Register(achievement14); - Achievement achievement15 = new Achievement("WHERES_MY_HONEY"); - achievement15.AddCondition(CustomFlagCondition.Create("Reach")); + Achievement achievement15 = new Achievement("STING_OPERATION"); + achievement15.AddCondition(NPCKilledCondition.Create((short) 222)); Main.Achievements.Register(achievement15); - Achievement achievement16 = new Achievement("STING_OPERATION"); - achievement16.AddCondition(NPCKilledCondition.Create((short) 222)); + Achievement achievement16 = new Achievement("BONED"); + achievement16.AddCondition(NPCKilledCondition.Create((short) 35)); Main.Achievements.Register(achievement16); - Achievement achievement17 = new Achievement("BONED"); - achievement17.AddCondition(NPCKilledCondition.Create((short) 35)); + Achievement achievement17 = new Achievement("DUNGEON_HEIST"); + achievement17.AddCondition(ItemPickupCondition.Create((short) 327)); + achievement17.AddCondition((AchievementCondition) ProgressionEventCondition.Create(19)); Main.Achievements.Register(achievement17); - Achievement achievement18 = new Achievement("DUNGEON_HEIST"); - achievement18.AddCondition(ItemPickupCondition.Create((short) 327)); - achievement18.AddCondition((AchievementCondition) ProgressionEventCondition.Create(19)); + Achievement achievement18 = new Achievement("ITS_GETTING_HOT_IN_HERE"); + achievement18.AddCondition(CustomFlagCondition.Create("Reach")); Main.Achievements.Register(achievement18); - Achievement achievement19 = new Achievement("ITS_GETTING_HOT_IN_HERE"); - achievement19.AddCondition(CustomFlagCondition.Create("Reach")); + Achievement achievement19 = new Achievement("MINER_FOR_FIRE"); + achievement19.AddCondition(ItemCraftCondition.Create((short) 122)); Main.Achievements.Register(achievement19); - Achievement achievement20 = new Achievement("MINER_FOR_FIRE"); - achievement20.AddCondition(ItemCraftCondition.Create((short) 122)); + Achievement achievement20 = new Achievement("STILL_HUNGRY"); + achievement20.AddCondition(NPCKilledCondition.Create((short) 113, (short) 114)); Main.Achievements.Register(achievement20); - Achievement achievement21 = new Achievement("STILL_HUNGRY"); - achievement21.AddCondition(NPCKilledCondition.Create((short) 113, (short) 114)); + Achievement achievement21 = new Achievement("ITS_HARD"); + achievement21.AddCondition((AchievementCondition) ProgressionEventCondition.Create(9)); Main.Achievements.Register(achievement21); - Achievement achievement22 = new Achievement("ITS_HARD"); - achievement22.AddCondition((AchievementCondition) ProgressionEventCondition.Create(9)); + Achievement achievement22 = new Achievement("BEGONE_EVIL"); + achievement22.AddCondition((AchievementCondition) ProgressionEventCondition.Create(6)); Main.Achievements.Register(achievement22); - Achievement achievement23 = new Achievement("BEGONE_EVIL"); - achievement23.AddCondition((AchievementCondition) ProgressionEventCondition.Create(6)); + Achievement achievement23 = new Achievement("EXTRA_SHINY"); + achievement23.AddCondition(TileDestroyedCondition.Create((ushort) 107, (ushort) 108, (ushort) 111, (ushort) 221, (ushort) 222, (ushort) 223)); Main.Achievements.Register(achievement23); - Achievement achievement24 = new Achievement("EXTRA_SHINY"); - achievement24.AddCondition(TileDestroyedCondition.Create((ushort) 107, (ushort) 108, (ushort) 111, (ushort) 221, (ushort) 222, (ushort) 223)); + Achievement achievement24 = new Achievement("HEAD_IN_THE_CLOUDS"); + achievement24.AddCondition(CustomFlagCondition.Create("Equip")); Main.Achievements.Register(achievement24); - Achievement achievement25 = new Achievement("HEAD_IN_THE_CLOUDS"); - achievement25.AddCondition(CustomFlagCondition.Create("Equip")); + Achievement achievement25 = new Achievement("LIKE_A_BOSS"); + achievement25.AddCondition(ItemPickupCondition.Create((short) 1133, (short) 1331, (short) 1307, (short) 267, (short) 1293, (short) 557, (short) 544, (short) 556, (short) 560, (short) 43, (short) 70)); Main.Achievements.Register(achievement25); - Achievement achievement26 = new Achievement("LIKE_A_BOSS"); - achievement26.AddCondition(ItemPickupCondition.Create((short) 1133, (short) 1331, (short) 1307, (short) 267, (short) 1293, (short) 557, (short) 544, (short) 556, (short) 560, (short) 43, (short) 70)); + Achievement achievement26 = new Achievement("BUCKETS_OF_BOLTS"); + achievement26.AddCondition(NPCKilledCondition.Create((short) 125, (short) 126)); + achievement26.AddConditions(NPCKilledCondition.CreateMany((short) sbyte.MaxValue, (short) 134)); + achievement26.UseConditionsCompletedTracker(); Main.Achievements.Register(achievement26); - Achievement achievement27 = new Achievement("BUCKETS_OF_BOLTS"); - achievement27.AddCondition(NPCKilledCondition.Create((short) 125, (short) 126)); - achievement27.AddConditions(NPCKilledCondition.CreateMany((short) sbyte.MaxValue, (short) 134)); - achievement27.UseConditionsCompletedTracker(); + Achievement achievement27 = new Achievement("DRAX_ATTAX"); + achievement27.AddCondition(ItemCraftCondition.Create((short) 579, (short) 990)); Main.Achievements.Register(achievement27); - Achievement achievement28 = new Achievement("DRAX_ATTAX"); - achievement28.AddCondition(ItemCraftCondition.Create((short) 579, (short) 990)); + Achievement achievement28 = new Achievement("PHOTOSYNTHESIS"); + achievement28.AddCondition(TileDestroyedCondition.Create((ushort) 211)); Main.Achievements.Register(achievement28); - Achievement achievement29 = new Achievement("PHOTOSYNTHESIS"); - achievement29.AddCondition(TileDestroyedCondition.Create((ushort) 211)); + Achievement achievement29 = new Achievement("GET_A_LIFE"); + achievement29.AddCondition(CustomFlagCondition.Create("Use")); Main.Achievements.Register(achievement29); - Achievement achievement30 = new Achievement("GET_A_LIFE"); - achievement30.AddCondition(CustomFlagCondition.Create("Use")); + Achievement achievement30 = new Achievement("THE_GREAT_SOUTHERN_PLANTKILL"); + achievement30.AddCondition(NPCKilledCondition.Create((short) 262)); Main.Achievements.Register(achievement30); - Achievement achievement31 = new Achievement("THE_GREAT_SOUTHERN_PLANTKILL"); - achievement31.AddCondition(NPCKilledCondition.Create((short) 262)); + Achievement achievement31 = new Achievement("TEMPLE_RAIDER"); + achievement31.AddCondition(TileDestroyedCondition.Create((ushort) 226)); Main.Achievements.Register(achievement31); - Achievement achievement32 = new Achievement("TEMPLE_RAIDER"); - achievement32.AddCondition((AchievementCondition) ProgressionEventCondition.Create(22)); + Achievement achievement32 = new Achievement("LIHZAHRDIAN_IDOL"); + achievement32.AddCondition(NPCKilledCondition.Create((short) 245)); Main.Achievements.Register(achievement32); - Achievement achievement33 = new Achievement("LIHZAHRDIAN_IDOL"); - achievement33.AddCondition(NPCKilledCondition.Create((short) 245)); + Achievement achievement33 = new Achievement("ROBBING_THE_GRAVE"); + achievement33.AddCondition(ItemPickupCondition.Create((short) 1513, (short) 938, (short) 963, (short) 977, (short) 1300, (short) 1254, (short) 1514, (short) 679, (short) 759, (short) 1446, (short) 1445, (short) 1444, (short) 1183, (short) 1266, (short) 671)); Main.Achievements.Register(achievement33); - Achievement achievement34 = new Achievement("ROBBING_THE_GRAVE"); - achievement34.AddCondition(ItemPickupCondition.Create((short) 1513, (short) 938, (short) 963, (short) 977, (short) 1300, (short) 1254, (short) 1514, (short) 679, (short) 759, (short) 1446, (short) 1445, (short) 1444, (short) 1183, (short) 1266, (short) 671, (short) 3291, (short) 4679)); + Achievement achievement34 = new Achievement("BIG_BOOTY"); + achievement34.AddCondition((AchievementCondition) ProgressionEventCondition.Create(20)); Main.Achievements.Register(achievement34); - Achievement achievement35 = new Achievement("BIG_BOOTY"); - achievement35.AddCondition((AchievementCondition) ProgressionEventCondition.Create(20)); + Achievement achievement35 = new Achievement("FISH_OUT_OF_WATER"); + achievement35.AddCondition(NPCKilledCondition.Create((short) 370)); Main.Achievements.Register(achievement35); - Achievement achievement36 = new Achievement("FISH_OUT_OF_WATER"); - achievement36.AddCondition(NPCKilledCondition.Create((short) 370)); + Achievement achievement36 = new Achievement("OBSESSIVE_DEVOTION"); + achievement36.AddCondition(NPCKilledCondition.Create((short) 439)); Main.Achievements.Register(achievement36); - Achievement achievement37 = new Achievement("OBSESSIVE_DEVOTION"); - achievement37.AddCondition(NPCKilledCondition.Create((short) 439)); + Achievement achievement37 = new Achievement("STAR_DESTROYER"); + achievement37.AddConditions(NPCKilledCondition.CreateMany((short) 517, (short) 422, (short) 507, (short) 493)); Main.Achievements.Register(achievement37); - Achievement achievement38 = new Achievement("STAR_DESTROYER"); - achievement38.AddConditions(NPCKilledCondition.CreateMany((short) 517, (short) 422, (short) 507, (short) 493)); + Achievement achievement38 = new Achievement("CHAMPION_OF_TERRARIA"); + achievement38.AddCondition(NPCKilledCondition.Create((short) 398)); Main.Achievements.Register(achievement38); - Achievement achievement39 = new Achievement("CHAMPION_OF_TERRARIA"); - achievement39.AddCondition(NPCKilledCondition.Create((short) 398)); + Achievement achievement39 = new Achievement("BLOODBATH"); + achievement39.AddCondition((AchievementCondition) ProgressionEventCondition.Create(5)); Main.Achievements.Register(achievement39); - Achievement achievement40 = new Achievement("BLOODBATH"); - achievement40.AddCondition((AchievementCondition) ProgressionEventCondition.Create(5)); + Achievement achievement40 = new Achievement("SLIPPERY_SHINOBI"); + achievement40.AddCondition(NPCKilledCondition.Create((short) 50)); Main.Achievements.Register(achievement40); - Achievement achievement41 = new Achievement("SLIPPERY_SHINOBI"); - achievement41.AddCondition(NPCKilledCondition.Create((short) 50)); + Achievement achievement41 = new Achievement("GOBLIN_PUNTER"); + achievement41.AddCondition((AchievementCondition) ProgressionEventCondition.Create(10)); Main.Achievements.Register(achievement41); - Achievement achievement42 = new Achievement("GOBLIN_PUNTER"); - achievement42.AddCondition((AchievementCondition) ProgressionEventCondition.Create(10)); + Achievement achievement42 = new Achievement("WALK_THE_PLANK"); + achievement42.AddCondition((AchievementCondition) ProgressionEventCondition.Create(11)); Main.Achievements.Register(achievement42); - Achievement achievement43 = new Achievement("WALK_THE_PLANK"); - achievement43.AddCondition((AchievementCondition) ProgressionEventCondition.Create(11)); + Achievement achievement43 = new Achievement("KILL_THE_SUN"); + achievement43.AddCondition((AchievementCondition) ProgressionEventCondition.Create(3)); Main.Achievements.Register(achievement43); - Achievement achievement44 = new Achievement("KILL_THE_SUN"); - achievement44.AddCondition((AchievementCondition) ProgressionEventCondition.Create(3)); + Achievement achievement44 = new Achievement("DO_YOU_WANT_TO_SLAY_A_SNOWMAN"); + achievement44.AddCondition((AchievementCondition) ProgressionEventCondition.Create(12)); Main.Achievements.Register(achievement44); - Achievement achievement45 = new Achievement("DO_YOU_WANT_TO_SLAY_A_SNOWMAN"); - achievement45.AddCondition((AchievementCondition) ProgressionEventCondition.Create(12)); + Achievement achievement45 = new Achievement("TIN_FOIL_HATTER"); + achievement45.AddCondition((AchievementCondition) ProgressionEventCondition.Create(13)); Main.Achievements.Register(achievement45); - Achievement achievement46 = new Achievement("TIN_FOIL_HATTER"); - achievement46.AddCondition((AchievementCondition) ProgressionEventCondition.Create(13)); + Achievement achievement46 = new Achievement("BALEFUL_HARVEST"); + achievement46.AddCondition((AchievementCondition) ProgressionEventCondition.Create(15)); Main.Achievements.Register(achievement46); - Achievement achievement47 = new Achievement("BALEFUL_HARVEST"); - achievement47.AddCondition((AchievementCondition) ProgressionEventCondition.Create(15)); + Achievement achievement47 = new Achievement("ICE_SCREAM"); + achievement47.AddCondition((AchievementCondition) ProgressionEventCondition.Create(14)); Main.Achievements.Register(achievement47); - Achievement achievement48 = new Achievement("ICE_SCREAM"); - achievement48.AddCondition((AchievementCondition) ProgressionEventCondition.Create(14)); + Achievement achievement48 = new Achievement("STICKY_SITUATION"); + achievement48.AddCondition((AchievementCondition) ProgressionEventCondition.Create(16)); Main.Achievements.Register(achievement48); - Achievement achievement49 = new Achievement("STICKY_SITUATION"); - achievement49.AddCondition((AchievementCondition) ProgressionEventCondition.Create(16)); + Achievement achievement49 = new Achievement("REAL_ESTATE_AGENT"); + achievement49.AddCondition((AchievementCondition) ProgressionEventCondition.Create(17)); Main.Achievements.Register(achievement49); - Achievement achievement50 = new Achievement("REAL_ESTATE_AGENT"); - achievement50.AddCondition((AchievementCondition) ProgressionEventCondition.Create(17)); + Achievement achievement50 = new Achievement("NOT_THE_BEES"); + achievement50.AddCondition(CustomFlagCondition.Create("Use")); Main.Achievements.Register(achievement50); - Achievement achievement51 = new Achievement("NOT_THE_BEES"); - achievement51.AddCondition(CustomFlagCondition.Create("Use")); + Achievement achievement51 = new Achievement("JEEPERS_CREEPERS"); + achievement51.AddCondition(CustomFlagCondition.Create("Reach")); Main.Achievements.Register(achievement51); - Achievement achievement52 = new Achievement("JEEPERS_CREEPERS"); + Achievement achievement52 = new Achievement("FUNKYTOWN"); achievement52.AddCondition(CustomFlagCondition.Create("Reach")); Main.Achievements.Register(achievement52); - Achievement achievement53 = new Achievement("FUNKYTOWN"); + Achievement achievement53 = new Achievement("INTO_ORBIT"); achievement53.AddCondition(CustomFlagCondition.Create("Reach")); Main.Achievements.Register(achievement53); - Achievement achievement54 = new Achievement("INTO_ORBIT"); + Achievement achievement54 = new Achievement("ROCK_BOTTOM"); achievement54.AddCondition(CustomFlagCondition.Create("Reach")); Main.Achievements.Register(achievement54); - Achievement achievement55 = new Achievement("ROCK_BOTTOM"); - achievement55.AddCondition(CustomFlagCondition.Create("Reach")); + Achievement achievement55 = new Achievement("MECHA_MAYHEM"); + achievement55.AddCondition((AchievementCondition) ProgressionEventCondition.Create(21)); Main.Achievements.Register(achievement55); - Achievement achievement56 = new Achievement("MECHA_MAYHEM"); - achievement56.AddCondition((AchievementCondition) ProgressionEventCondition.Create(21)); + Achievement achievement56 = new Achievement("GELATIN_WORLD_TOUR"); + achievement56.AddConditions(NPCKilledCondition.CreateMany((short) -5, (short) -6, (short) 1, (short) 81, (short) 71, (short) -3, (short) 147, (short) 138, (short) -10, (short) 50, (short) 59, (short) 16, (short) -7, (short) 244, (short) -8, (short) -1, (short) -2, (short) 184, (short) 204, (short) 225, (short) -9, (short) 141, (short) 183, (short) -4)); + achievement56.UseConditionsCompletedTracker(); Main.Achievements.Register(achievement56); - Achievement achievement57 = new Achievement("GELATIN_WORLD_TOUR"); - achievement57.AddConditions(NPCKilledCondition.CreateMany((short) -5, (short) -6, (short) 1, (short) 81, (short) 71, (short) -3, (short) 147, (short) 138, (short) -10, (short) 50, (short) 59, (short) 16, (short) -7, (short) 244, (short) -8, (short) -1, (short) -2, (short) 184, (short) 204, (short) 225, (short) -9, (short) 141, (short) 183, (short) -4)); - achievement57.UseConditionsCompletedTracker(); + Achievement achievement57 = new Achievement("FASHION_STATEMENT"); + achievement57.AddCondition(CustomFlagCondition.Create("Equip")); Main.Achievements.Register(achievement57); - Achievement achievement58 = new Achievement("FASHION_STATEMENT"); - achievement58.AddCondition(CustomFlagCondition.Create("Equip")); + Achievement achievement58 = new Achievement("VEHICULAR_MANSLAUGHTER"); + achievement58.AddCondition(CustomFlagCondition.Create("Hit")); Main.Achievements.Register(achievement58); - Achievement achievement59 = new Achievement("VEHICULAR_MANSLAUGHTER"); - achievement59.AddCondition(CustomFlagCondition.Create("Hit")); + Achievement achievement59 = new Achievement("BULLDOZER"); + achievement59.AddCondition(CustomIntCondition.Create("Pick", 10000)); + achievement59.UseTrackerFromCondition("Pick"); Main.Achievements.Register(achievement59); - Achievement achievement60 = new Achievement("BULLDOZER"); - achievement60.AddCondition(CustomIntCondition.Create("Pick", 10000)); - achievement60.UseTrackerFromCondition("Pick"); + Achievement achievement60 = new Achievement("THERE_ARE_SOME_WHO_CALL_HIM"); + achievement60.AddCondition(NPCKilledCondition.Create((short) 45)); Main.Achievements.Register(achievement60); - Achievement achievement61 = new Achievement("THERE_ARE_SOME_WHO_CALL_HIM"); - achievement61.AddCondition(NPCKilledCondition.Create((short) 45)); + Achievement achievement61 = new Achievement("DECEIVER_OF_FOOLS"); + achievement61.AddCondition(NPCKilledCondition.Create((short) 196)); Main.Achievements.Register(achievement61); - Achievement achievement62 = new Achievement("DECEIVER_OF_FOOLS"); - achievement62.AddCondition(NPCKilledCondition.Create((short) 196)); + Achievement achievement62 = new Achievement("SWORD_OF_THE_HERO"); + achievement62.AddCondition(ItemPickupCondition.Create((short) 757)); Main.Achievements.Register(achievement62); - Achievement achievement63 = new Achievement("SWORD_OF_THE_HERO"); - achievement63.AddCondition(ItemPickupCondition.Create((short) 757)); + Achievement achievement63 = new Achievement("LUCKY_BREAK"); + achievement63.AddCondition(CustomFlagCondition.Create("Hit")); Main.Achievements.Register(achievement63); - Achievement achievement64 = new Achievement("LUCKY_BREAK"); - achievement64.AddCondition(CustomFlagCondition.Create("Hit")); + Achievement achievement64 = new Achievement("THROWING_LINES"); + achievement64.AddCondition(CustomFlagCondition.Create("Use")); Main.Achievements.Register(achievement64); - Achievement achievement65 = new Achievement("THROWING_LINES"); - achievement65.AddCondition(CustomFlagCondition.Create("Use")); + Achievement achievement65 = new Achievement("DYE_HARD"); + achievement65.AddCondition(CustomFlagCondition.Create("Equip")); Main.Achievements.Register(achievement65); - Achievement achievement66 = new Achievement("DYE_HARD"); - achievement66.AddCondition(CustomFlagCondition.Create("Equip")); + Achievement achievement66 = new Achievement("SICK_THROW"); + achievement66.AddCondition(ItemPickupCondition.Create((short) 3389)); Main.Achievements.Register(achievement66); - Achievement achievement67 = new Achievement("SICK_THROW"); - achievement67.AddCondition(ItemPickupCondition.Create((short) 3389)); + Achievement achievement67 = new Achievement("FREQUENT_FLYER"); + achievement67.AddCondition(CustomFloatCondition.Create("Pay", 10000f)); + achievement67.UseTrackerFromCondition("Pay"); Main.Achievements.Register(achievement67); - Achievement achievement68 = new Achievement("FREQUENT_FLYER"); - achievement68.AddCondition(CustomFloatCondition.Create("Pay", 10000f)); - achievement68.UseTrackerFromCondition("Pay"); + Achievement achievement68 = new Achievement("THE_CAVALRY"); + achievement68.AddCondition(CustomFlagCondition.Create("Equip")); Main.Achievements.Register(achievement68); - Achievement achievement69 = new Achievement("THE_CAVALRY"); - achievement69.AddCondition(CustomFlagCondition.Create("Equip")); + Achievement achievement69 = new Achievement("COMPLETELY_AWESOME"); + achievement69.AddCondition(ItemPickupCondition.Create((short) 98)); Main.Achievements.Register(achievement69); - Achievement achievement70 = new Achievement("COMPLETELY_AWESOME"); - achievement70.AddCondition(ItemPickupCondition.Create((short) 98)); + Achievement achievement70 = new Achievement("TIL_DEATH"); + achievement70.AddCondition(NPCKilledCondition.Create((short) 53)); Main.Achievements.Register(achievement70); - Achievement achievement71 = new Achievement("TIL_DEATH"); - achievement71.AddCondition(NPCKilledCondition.Create((short) 53)); + Achievement achievement71 = new Achievement("ARCHAEOLOGIST"); + achievement71.AddCondition(NPCKilledCondition.Create((short) 52)); Main.Achievements.Register(achievement71); - Achievement achievement72 = new Achievement("ARCHAEOLOGIST"); - achievement72.AddCondition(NPCKilledCondition.Create((short) 52)); + Achievement achievement72 = new Achievement("PRETTY_IN_PINK"); + achievement72.AddCondition(NPCKilledCondition.Create((short) -4)); Main.Achievements.Register(achievement72); - Achievement achievement73 = new Achievement("PRETTY_IN_PINK"); - achievement73.AddCondition(NPCKilledCondition.Create((short) -4)); + Achievement achievement73 = new Achievement("RAINBOWS_AND_UNICORNS"); + achievement73.AddCondition(CustomFlagCondition.Create("Use")); Main.Achievements.Register(achievement73); - Achievement achievement74 = new Achievement("RAINBOWS_AND_UNICORNS"); - achievement74.AddCondition(CustomFlagCondition.Create("Use")); + Achievement achievement74 = new Achievement("YOU_AND_WHAT_ARMY"); + achievement74.AddCondition(CustomFlagCondition.Create("Spawn")); Main.Achievements.Register(achievement74); - Achievement achievement75 = new Achievement("YOU_AND_WHAT_ARMY"); - achievement75.AddCondition(CustomFlagCondition.Create("Spawn")); + Achievement achievement75 = new Achievement("PRISMANCER"); + achievement75.AddCondition(ItemPickupCondition.Create((short) 495)); Main.Achievements.Register(achievement75); - Achievement achievement76 = new Achievement("PRISMANCER"); - achievement76.AddCondition(ItemPickupCondition.Create((short) 495)); + Achievement achievement76 = new Achievement("IT_CAN_TALK"); + achievement76.AddCondition((AchievementCondition) ProgressionEventCondition.Create(18)); Main.Achievements.Register(achievement76); - Achievement achievement77 = new Achievement("IT_CAN_TALK"); - achievement77.AddCondition((AchievementCondition) ProgressionEventCondition.Create(18)); + Achievement achievement77 = new Achievement("WATCH_YOUR_STEP"); + achievement77.AddCondition(CustomFlagCondition.Create("Hit")); Main.Achievements.Register(achievement77); - Achievement achievement78 = new Achievement("WATCH_YOUR_STEP"); - achievement78.AddCondition(CustomFlagCondition.Create("Hit")); + Achievement achievement78 = new Achievement("MARATHON_MEDALIST"); + achievement78.AddCondition(CustomFloatCondition.Create("Move", 1106688f)); + achievement78.UseTrackerFromCondition("Move"); Main.Achievements.Register(achievement78); - Achievement achievement79 = new Achievement("MARATHON_MEDALIST"); - achievement79.AddCondition(CustomFloatCondition.Create("Move", 1106688f)); - achievement79.UseTrackerFromCondition("Move"); + Achievement achievement79 = new Achievement("GLORIOUS_GOLDEN_POLE"); + achievement79.AddCondition(ItemPickupCondition.Create((short) 2294)); Main.Achievements.Register(achievement79); - Achievement achievement80 = new Achievement("GLORIOUS_GOLDEN_POLE"); - achievement80.AddCondition(ItemPickupCondition.Create((short) 2294)); + Achievement achievement80 = new Achievement("SERVANT_IN_TRAINING"); + achievement80.AddCondition(CustomFlagCondition.Create("Finish")); Main.Achievements.Register(achievement80); - Achievement achievement81 = new Achievement("SERVANT_IN_TRAINING"); - achievement81.AddCondition(CustomFlagCondition.Create("Finish")); + Achievement achievement81 = new Achievement("GOOD_LITTLE_SLAVE"); + achievement81.AddCondition(CustomIntCondition.Create("Finish", 10)); + achievement81.UseTrackerFromCondition("Finish"); Main.Achievements.Register(achievement81); - Achievement achievement82 = new Achievement("GOOD_LITTLE_SLAVE"); - achievement82.AddCondition(CustomIntCondition.Create("Finish", 10)); + Achievement achievement82 = new Achievement("TROUT_MONKEY"); + achievement82.AddCondition(CustomIntCondition.Create("Finish", 25)); achievement82.UseTrackerFromCondition("Finish"); Main.Achievements.Register(achievement82); - Achievement achievement83 = new Achievement("TROUT_MONKEY"); - achievement83.AddCondition(CustomIntCondition.Create("Finish", 25)); + Achievement achievement83 = new Achievement("FAST_AND_FISHIOUS"); + achievement83.AddCondition(CustomIntCondition.Create("Finish", 50)); achievement83.UseTrackerFromCondition("Finish"); Main.Achievements.Register(achievement83); - Achievement achievement84 = new Achievement("FAST_AND_FISHIOUS"); - achievement84.AddCondition(CustomIntCondition.Create("Finish", 50)); + Achievement achievement84 = new Achievement("SUPREME_HELPER_MINION"); + achievement84.AddCondition(CustomIntCondition.Create("Finish", 200)); achievement84.UseTrackerFromCondition("Finish"); Main.Achievements.Register(achievement84); - Achievement achievement85 = new Achievement("SUPREME_HELPER_MINION"); - achievement85.AddCondition(CustomIntCondition.Create("Finish", 200)); - achievement85.UseTrackerFromCondition("Finish"); + Achievement achievement85 = new Achievement("TOPPED_OFF"); + achievement85.AddCondition(CustomFlagCondition.Create("Use")); Main.Achievements.Register(achievement85); - Achievement achievement86 = new Achievement("TOPPED_OFF"); - achievement86.AddCondition(CustomFlagCondition.Create("Use")); + Achievement achievement86 = new Achievement("SLAYER_OF_WORLDS"); + achievement86.AddCondition(NPCKilledCondition.Create((short) 13, (short) 14, (short) 15)); + achievement86.AddCondition(NPCKilledCondition.Create((short) 113, (short) 114)); + achievement86.AddCondition(NPCKilledCondition.Create((short) 125, (short) 126)); + achievement86.AddConditions(NPCKilledCondition.CreateMany((short) 4, (short) 35, (short) 50, (short) 222, (short) 113, (short) 134, (short) sbyte.MaxValue, (short) 262, (short) 245, (short) 439, (short) 398, (short) 370)); + achievement86.UseConditionsCompletedTracker(); Main.Achievements.Register(achievement86); - Achievement achievement87 = new Achievement("SLAYER_OF_WORLDS"); - achievement87.AddCondition(NPCKilledCondition.Create((short) 13, (short) 14, (short) 15)); - achievement87.AddCondition(NPCKilledCondition.Create((short) 113, (short) 114)); - achievement87.AddCondition(NPCKilledCondition.Create((short) 125, (short) 126)); - achievement87.AddConditions(NPCKilledCondition.CreateMany((short) 4, (short) 266, (short) 35, (short) 50, (short) 222, (short) 134, (short) sbyte.MaxValue, (short) 262, (short) 245, (short) 439, (short) 398, (short) 370)); - achievement87.UseConditionsCompletedTracker(); + Achievement achievement87 = new Achievement("YOU_CAN_DO_IT"); + achievement87.AddCondition((AchievementCondition) ProgressionEventCondition.Create(1)); Main.Achievements.Register(achievement87); - Achievement achievement88 = new Achievement("YOU_CAN_DO_IT"); - achievement88.AddCondition((AchievementCondition) ProgressionEventCondition.Create(1)); + Achievement achievement88 = new Achievement("MATCHING_ATTIRE"); + achievement88.AddCondition(CustomFlagCondition.Create("Equip")); Main.Achievements.Register(achievement88); - Achievement achievement89 = new Achievement("MATCHING_ATTIRE"); - achievement89.AddCondition(CustomFlagCondition.Create("Equip")); - Main.Achievements.Register(achievement89); int num1 = 0; AchievementManager achievements1 = Main.Achievements; int iconIndex1 = num1; @@ -654,10 +649,6 @@ namespace Terraria.Initializers int iconIndex88 = num88; int num89 = iconIndex88 + 1; achievements88.RegisterIconIndex("MATCHING_ATTIRE", iconIndex88); - AchievementManager achievements89 = Main.Achievements; - int iconIndex89 = num89; - int num90 = iconIndex89 + 1; - achievements89.RegisterIconIndex("BENCHED", iconIndex89); AchievementCategory category1 = AchievementCategory.Slayer; Main.Achievements.RegisterAchievementCategory("EYE_ON_YOU", category1); Main.Achievements.RegisterAchievementCategory("SLIPPERY_SHINOBI", category1); @@ -732,7 +723,6 @@ namespace Terraria.Initializers Main.Achievements.RegisterAchievementCategory("SUPREME_HELPER_MINION", category3); AchievementCategory category4 = AchievementCategory.Collector; Main.Achievements.RegisterAchievementCategory("OBTAIN_HAMMER", category4); - Main.Achievements.RegisterAchievementCategory("BENCHED", category4); Main.Achievements.RegisterAchievementCategory("HEAVY_METAL", category4); Main.Achievements.RegisterAchievementCategory("STAR_POWER", category4); Main.Achievements.RegisterAchievementCategory("MINER_FOR_FIRE", category4); @@ -756,12 +746,6 @@ namespace Terraria.Initializers AchievementsHelper.Initialize(); } - private static void OnAchievementCompleted(Achievement achievement) - { - Main.NewText(Language.GetTextValue("Achievements.Completed", (object) AchievementTagHandler.GenerateTag(achievement))); - if (SoundEngine.FindActiveSound((SoundStyle) SoundID.AchievementComplete) != null) - return; - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.AchievementComplete); - } + private static void OnAchievementCompleted(Achievement achievement) => Main.NewText(Language.GetTextValue("Achievements.Completed", (object) AchievementTagHandler.GenerateTag(achievement))); } } diff --git a/Initializers/AssetInitializer.cs b/Initializers/AssetInitializer.cs deleted file mode 100644 index 55c3ff8..0000000 --- a/Initializers/AssetInitializer.cs +++ /dev/null @@ -1,549 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Initializers.AssetInitializer -// 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; -using Microsoft.Xna.Framework.Graphics; -using Newtonsoft.Json.Linq; -using ReLogic.Content; -using ReLogic.Content.Readers; -using ReLogic.Graphics; -using ReLogic.Utilities; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Terraria.Audio; -using Terraria.GameContent; -using Terraria.GameContent.UI; -using Terraria.ID; -using Terraria.IO; -using Terraria.Utilities; - -namespace Terraria.Initializers -{ - public static class AssetInitializer - { - public static void CreateAssetServices(GameServiceContainer services) - { - AssetReaderCollection readerCollection = new AssetReaderCollection(); - readerCollection.RegisterReader((IAssetReader) new PngReader(XnaExtensions.Get((IServiceProvider) services).GraphicsDevice), new string[1] - { - ".png" - }); - readerCollection.RegisterReader((IAssetReader) new XnbReader((IServiceProvider) services), new string[1] - { - ".xnb" - }); - AsyncAssetLoader asyncAssetLoader = new AsyncAssetLoader(readerCollection, 20); - asyncAssetLoader.RequireTypeCreationOnTransfer(typeof (Texture2D)); - asyncAssetLoader.RequireTypeCreationOnTransfer(typeof (DynamicSpriteFont)); - asyncAssetLoader.RequireTypeCreationOnTransfer(typeof (SpriteFont)); - IAssetRepository iassetRepository = (IAssetRepository) new AssetRepository((IAssetLoader) new AssetLoader(readerCollection), (IAsyncAssetLoader) asyncAssetLoader); - services.AddService(typeof (AssetReaderCollection), (object) readerCollection); - services.AddService(typeof (IAssetRepository), (object) iassetRepository); - } - - public static ResourcePackList CreateResourcePackList(IServiceProvider services) - { - JArray resourcePackJson; - string resourcePackFolder; - AssetInitializer.GetResourcePacksFolderPathAndConfirmItExists(out resourcePackJson, out resourcePackFolder); - return ResourcePackList.FromJson(resourcePackJson, services, resourcePackFolder); - } - - public static void GetResourcePacksFolderPathAndConfirmItExists( - out JArray resourcePackJson, - out string resourcePackFolder) - { - resourcePackJson = Main.Configuration.Get("ResourcePacks", new JArray()); - resourcePackFolder = Path.Combine(Main.SavePath, "ResourcePacks"); - Utils.TryCreatingDirectory(resourcePackFolder); - } - - public static void LoadSplashAssets(bool asyncLoadForSounds) - { - TextureAssets.SplashTexture16x9 = AssetInitializer.LoadAsset("Images\\SplashScreens\\Splash_1", (AssetRequestMode) 1); - TextureAssets.SplashTexture4x3 = AssetInitializer.LoadAsset("Images\\logo_" + (object) new UnifiedRandom().Next(1, 9), (AssetRequestMode) 1); - TextureAssets.SplashTextureLegoResonanace = AssetInitializer.LoadAsset("Images\\SplashScreens\\ResonanceArray", (AssetRequestMode) 1); - int num = new UnifiedRandom().Next(1, 10); - TextureAssets.SplashTextureLegoBack = AssetInitializer.LoadAsset("Images\\SplashScreens\\Splash_" + (object) num + "_0", (AssetRequestMode) 1); - TextureAssets.SplashTextureLegoTree = AssetInitializer.LoadAsset("Images\\SplashScreens\\Splash_" + (object) num + "_1", (AssetRequestMode) 1); - TextureAssets.SplashTextureLegoFront = AssetInitializer.LoadAsset("Images\\SplashScreens\\Splash_" + (object) num + "_2", (AssetRequestMode) 1); - TextureAssets.Item[75] = AssetInitializer.LoadAsset("Images\\Item_" + (object) (short) 75, (AssetRequestMode) 1); - TextureAssets.LoadingSunflower = AssetInitializer.LoadAsset("Images\\UI\\Sunflower_Loading", (AssetRequestMode) 1); - } - - public static void LoadAssetsWhileInInitialBlackScreen() - { - AssetInitializer.LoadFonts((AssetRequestMode) 1); - AssetInitializer.LoadTextures((AssetRequestMode) 1); - AssetInitializer.LoadRenderTargetAssets((AssetRequestMode) 1); - AssetInitializer.LoadSounds((AssetRequestMode) 1); - } - - public static void Load(bool asyncLoad) - { - } - - private static void LoadFonts(AssetRequestMode mode) - { - FontAssets.ItemStack = AssetInitializer.LoadAsset("Fonts/Item_Stack", mode); - FontAssets.MouseText = AssetInitializer.LoadAsset("Fonts/Mouse_Text", mode); - FontAssets.DeathText = AssetInitializer.LoadAsset("Fonts/Death_Text", mode); - FontAssets.CombatText[0] = AssetInitializer.LoadAsset("Fonts/Combat_Text", mode); - FontAssets.CombatText[1] = AssetInitializer.LoadAsset("Fonts/Combat_Crit", mode); - } - - private static void LoadSounds(AssetRequestMode mode) => SoundEngine.Load((IServiceProvider) Main.instance.Services); - - private static void LoadRenderTargetAssets(AssetRequestMode mode) - { - AssetInitializer.RegisterRenderTargetAsset((INeedRenderTargetContent) (TextureAssets.RenderTargets.PlayerRainbowWings = new PlayerRainbowWingsTextureContent())); - AssetInitializer.RegisterRenderTargetAsset((INeedRenderTargetContent) (TextureAssets.RenderTargets.PlayerTitaniumStormBuff = new PlayerTitaniumStormBuffTextureContent())); - AssetInitializer.RegisterRenderTargetAsset((INeedRenderTargetContent) (TextureAssets.RenderTargets.QueenSlimeMount = new PlayerQueenSlimeMountTextureContent())); - } - - private static void RegisterRenderTargetAsset(INeedRenderTargetContent content) => Main.ContentThatNeedsRenderTargets.Add(content); - - private static void LoadTextures(AssetRequestMode mode) - { - for (int index1 = 0; index1 < TextureAssets.Item.Length; ++index1) - { - int index2 = ItemID.Sets.TextureCopyLoad[index1]; - TextureAssets.Item[index1] = index2 == -1 ? AssetInitializer.LoadAsset("Images/Item_" + (object) index1, (AssetRequestMode) 0) : TextureAssets.Item[index2]; - } - for (int index = 0; index < TextureAssets.Npc.Length; ++index) - TextureAssets.Npc[index] = AssetInitializer.LoadAsset("Images/NPC_" + (object) index, (AssetRequestMode) 0); - for (int index = 0; index < TextureAssets.Projectile.Length; ++index) - TextureAssets.Projectile[index] = AssetInitializer.LoadAsset("Images/Projectile_" + (object) index, (AssetRequestMode) 0); - for (int index = 0; index < TextureAssets.Gore.Length; ++index) - TextureAssets.Gore[index] = AssetInitializer.LoadAsset("Images/Gore_" + (object) index, (AssetRequestMode) 0); - for (int index = 0; index < TextureAssets.Wall.Length; ++index) - TextureAssets.Wall[index] = AssetInitializer.LoadAsset("Images/Wall_" + (object) index, (AssetRequestMode) 0); - for (int index = 0; index < TextureAssets.Tile.Length; ++index) - TextureAssets.Tile[index] = AssetInitializer.LoadAsset("Images/Tiles_" + (object) index, (AssetRequestMode) 0); - for (int index = 0; index < TextureAssets.ItemFlame.Length; ++index) - TextureAssets.ItemFlame[index] = AssetInitializer.LoadAsset("Images/ItemFlame_" + (object) index, (AssetRequestMode) 0); - for (int index = 0; index < TextureAssets.Wings.Length; ++index) - TextureAssets.Wings[index] = AssetInitializer.LoadAsset("Images/Wings_" + (object) index, (AssetRequestMode) 0); - for (int index = 0; index < TextureAssets.PlayerHair.Length; ++index) - TextureAssets.PlayerHair[index] = AssetInitializer.LoadAsset("Images/Player_Hair_" + (object) (index + 1), (AssetRequestMode) 0); - for (int index = 0; index < TextureAssets.PlayerHairAlt.Length; ++index) - TextureAssets.PlayerHairAlt[index] = AssetInitializer.LoadAsset("Images/Player_HairAlt_" + (object) (index + 1), (AssetRequestMode) 0); - for (int index = 0; index < TextureAssets.ArmorHead.Length; ++index) - TextureAssets.ArmorHead[index] = AssetInitializer.LoadAsset("Images/Armor_Head_" + (object) index, (AssetRequestMode) 0); - for (int index = 0; index < TextureAssets.FemaleBody.Length; ++index) - TextureAssets.FemaleBody[index] = AssetInitializer.LoadAsset("Images/Female_Body_" + (object) index, (AssetRequestMode) 0); - for (int index = 0; index < TextureAssets.ArmorBody.Length; ++index) - TextureAssets.ArmorBody[index] = AssetInitializer.LoadAsset("Images/Armor_Body_" + (object) index, (AssetRequestMode) 0); - for (int index = 0; index < TextureAssets.ArmorBodyComposite.Length; ++index) - TextureAssets.ArmorBodyComposite[index] = AssetInitializer.LoadAsset("Images/Armor/Armor_" + (object) index, (AssetRequestMode) 0); - for (int index = 0; index < TextureAssets.ArmorArm.Length; ++index) - TextureAssets.ArmorArm[index] = AssetInitializer.LoadAsset("Images/Armor_Arm_" + (object) index, (AssetRequestMode) 0); - for (int index = 0; index < TextureAssets.ArmorLeg.Length; ++index) - TextureAssets.ArmorLeg[index] = AssetInitializer.LoadAsset("Images/Armor_Legs_" + (object) index, (AssetRequestMode) 0); - for (int index = 0; index < TextureAssets.AccHandsOn.Length; ++index) - TextureAssets.AccHandsOn[index] = AssetInitializer.LoadAsset("Images/Acc_HandsOn_" + (object) index, (AssetRequestMode) 0); - for (int index = 0; index < TextureAssets.AccHandsOff.Length; ++index) - TextureAssets.AccHandsOff[index] = AssetInitializer.LoadAsset("Images/Acc_HandsOff_" + (object) index, (AssetRequestMode) 0); - for (int index = 0; index < TextureAssets.AccHandsOnComposite.Length; ++index) - TextureAssets.AccHandsOnComposite[index] = AssetInitializer.LoadAsset("Images/Accessories/Acc_HandsOn_" + (object) index, (AssetRequestMode) 0); - for (int index = 0; index < TextureAssets.AccHandsOffComposite.Length; ++index) - TextureAssets.AccHandsOffComposite[index] = AssetInitializer.LoadAsset("Images/Accessories/Acc_HandsOff_" + (object) index, (AssetRequestMode) 0); - for (int index = 0; index < TextureAssets.AccBack.Length; ++index) - TextureAssets.AccBack[index] = AssetInitializer.LoadAsset("Images/Acc_Back_" + (object) index, (AssetRequestMode) 0); - for (int index = 0; index < TextureAssets.AccFront.Length; ++index) - TextureAssets.AccFront[index] = AssetInitializer.LoadAsset("Images/Acc_Front_" + (object) index, (AssetRequestMode) 0); - for (int index = 0; index < TextureAssets.AccShoes.Length; ++index) - TextureAssets.AccShoes[index] = AssetInitializer.LoadAsset("Images/Acc_Shoes_" + (object) index, (AssetRequestMode) 0); - for (int index = 0; index < TextureAssets.AccWaist.Length; ++index) - TextureAssets.AccWaist[index] = AssetInitializer.LoadAsset("Images/Acc_Waist_" + (object) index, (AssetRequestMode) 0); - for (int index = 0; index < TextureAssets.AccShield.Length; ++index) - TextureAssets.AccShield[index] = AssetInitializer.LoadAsset("Images/Acc_Shield_" + (object) index, (AssetRequestMode) 0); - for (int index = 0; index < TextureAssets.AccNeck.Length; ++index) - TextureAssets.AccNeck[index] = AssetInitializer.LoadAsset("Images/Acc_Neck_" + (object) index, (AssetRequestMode) 0); - for (int index = 0; index < TextureAssets.AccFace.Length; ++index) - TextureAssets.AccFace[index] = AssetInitializer.LoadAsset("Images/Acc_Face_" + (object) index, (AssetRequestMode) 0); - for (int index = 0; index < TextureAssets.AccBalloon.Length; ++index) - TextureAssets.AccBalloon[index] = AssetInitializer.LoadAsset("Images/Acc_Balloon_" + (object) index, (AssetRequestMode) 0); - for (int index = 0; index < TextureAssets.Background.Length; ++index) - TextureAssets.Background[index] = AssetInitializer.LoadAsset("Images/Background_" + (object) index, (AssetRequestMode) 0); - TextureAssets.FlameRing = AssetInitializer.LoadAsset("Images/FlameRing", (AssetRequestMode) 0); - TextureAssets.TileCrack = AssetInitializer.LoadAsset("Images\\TileCracks", mode); - TextureAssets.ChestStack[0] = AssetInitializer.LoadAsset("Images\\ChestStack_0", mode); - TextureAssets.ChestStack[1] = AssetInitializer.LoadAsset("Images\\ChestStack_1", mode); - TextureAssets.SmartDig = AssetInitializer.LoadAsset("Images\\SmartDig", mode); - TextureAssets.IceBarrier = AssetInitializer.LoadAsset("Images\\IceBarrier", mode); - TextureAssets.Frozen = AssetInitializer.LoadAsset("Images\\Frozen", mode); - for (int index = 0; index < TextureAssets.Pvp.Length; ++index) - TextureAssets.Pvp[index] = AssetInitializer.LoadAsset("Images\\UI\\PVP_" + (object) index, mode); - for (int index = 0; index < TextureAssets.EquipPage.Length; ++index) - TextureAssets.EquipPage[index] = AssetInitializer.LoadAsset("Images\\UI\\DisplaySlots_" + (object) index, mode); - TextureAssets.HouseBanner = AssetInitializer.LoadAsset("Images\\UI\\House_Banner", mode); - for (int index = 0; index < TextureAssets.CraftToggle.Length; ++index) - TextureAssets.CraftToggle[index] = AssetInitializer.LoadAsset("Images\\UI\\Craft_Toggle_" + (object) index, mode); - for (int index = 0; index < TextureAssets.InventorySort.Length; ++index) - TextureAssets.InventorySort[index] = AssetInitializer.LoadAsset("Images\\UI\\Sort_" + (object) index, mode); - for (int index = 0; index < TextureAssets.TextGlyph.Length; ++index) - TextureAssets.TextGlyph[index] = AssetInitializer.LoadAsset("Images\\UI\\Glyphs_" + (object) index, mode); - for (int index = 0; index < TextureAssets.HotbarRadial.Length; ++index) - TextureAssets.HotbarRadial[index] = AssetInitializer.LoadAsset("Images\\UI\\HotbarRadial_" + (object) index, mode); - for (int index = 0; index < TextureAssets.InfoIcon.Length; ++index) - TextureAssets.InfoIcon[index] = AssetInitializer.LoadAsset("Images\\UI\\InfoIcon_" + (object) index, mode); - for (int index = 0; index < TextureAssets.Reforge.Length; ++index) - TextureAssets.Reforge[index] = AssetInitializer.LoadAsset("Images\\UI\\Reforge_" + (object) index, mode); - for (int index = 0; index < TextureAssets.Camera.Length; ++index) - TextureAssets.Camera[index] = AssetInitializer.LoadAsset("Images\\UI\\Camera_" + (object) index, mode); - for (int index = 0; index < TextureAssets.WireUi.Length; ++index) - TextureAssets.WireUi[index] = AssetInitializer.LoadAsset("Images\\UI\\Wires_" + (object) index, mode); - TextureAssets.BuilderAcc = AssetInitializer.LoadAsset("Images\\UI\\BuilderIcons", mode); - TextureAssets.QuicksIcon = AssetInitializer.LoadAsset("Images\\UI\\UI_quickicon1", mode); - TextureAssets.CraftUpButton = AssetInitializer.LoadAsset("Images\\RecUp", mode); - TextureAssets.CraftDownButton = AssetInitializer.LoadAsset("Images\\RecDown", mode); - TextureAssets.ScrollLeftButton = AssetInitializer.LoadAsset("Images\\RecLeft", mode); - TextureAssets.ScrollRightButton = AssetInitializer.LoadAsset("Images\\RecRight", mode); - TextureAssets.OneDropLogo = AssetInitializer.LoadAsset("Images\\OneDropLogo", mode); - TextureAssets.Pulley = AssetInitializer.LoadAsset("Images\\PlayerPulley", mode); - TextureAssets.Timer = AssetInitializer.LoadAsset("Images\\Timer", mode); - TextureAssets.EmoteMenuButton = AssetInitializer.LoadAsset("Images\\UI\\Emotes", mode); - TextureAssets.BestiaryMenuButton = AssetInitializer.LoadAsset("Images\\UI\\Bestiary", mode); - TextureAssets.Wof = AssetInitializer.LoadAsset("Images\\WallOfFlesh", mode); - TextureAssets.WallOutline = AssetInitializer.LoadAsset("Images\\Wall_Outline", mode); - TextureAssets.Fade = AssetInitializer.LoadAsset("Images\\fade-out", mode); - TextureAssets.Ghost = AssetInitializer.LoadAsset("Images\\Ghost", mode); - TextureAssets.EvilCactus = AssetInitializer.LoadAsset("Images\\Evil_Cactus", mode); - TextureAssets.GoodCactus = AssetInitializer.LoadAsset("Images\\Good_Cactus", mode); - TextureAssets.CrimsonCactus = AssetInitializer.LoadAsset("Images\\Crimson_Cactus", mode); - TextureAssets.WraithEye = AssetInitializer.LoadAsset("Images\\Wraith_Eyes", mode); - TextureAssets.Firefly = AssetInitializer.LoadAsset("Images\\Firefly", mode); - TextureAssets.FireflyJar = AssetInitializer.LoadAsset("Images\\FireflyJar", mode); - TextureAssets.Lightningbug = AssetInitializer.LoadAsset("Images\\LightningBug", mode); - TextureAssets.LightningbugJar = AssetInitializer.LoadAsset("Images\\LightningBugJar", mode); - for (int index = 1; index <= 3; ++index) - TextureAssets.JellyfishBowl[index - 1] = AssetInitializer.LoadAsset("Images\\jellyfishBowl" + (object) index, mode); - TextureAssets.GlowSnail = AssetInitializer.LoadAsset("Images\\GlowSnail", mode); - TextureAssets.IceQueen = AssetInitializer.LoadAsset("Images\\IceQueen", mode); - TextureAssets.SantaTank = AssetInitializer.LoadAsset("Images\\SantaTank", mode); - TextureAssets.JackHat = AssetInitializer.LoadAsset("Images\\JackHat", mode); - TextureAssets.TreeFace = AssetInitializer.LoadAsset("Images\\TreeFace", mode); - TextureAssets.PumpkingFace = AssetInitializer.LoadAsset("Images\\PumpkingFace", mode); - TextureAssets.ReaperEye = AssetInitializer.LoadAsset("Images\\Reaper_Eyes", mode); - TextureAssets.MapDeath = AssetInitializer.LoadAsset("Images\\MapDeath", mode); - TextureAssets.DukeFishron = AssetInitializer.LoadAsset("Images\\DukeFishron", mode); - TextureAssets.MiniMinotaur = AssetInitializer.LoadAsset("Images\\MiniMinotaur", mode); - TextureAssets.Map = AssetInitializer.LoadAsset("Images\\Map", mode); - for (int index = 0; index < TextureAssets.MapBGs.Length; ++index) - TextureAssets.MapBGs[index] = AssetInitializer.LoadAsset("Images\\MapBG" + (object) (index + 1), mode); - TextureAssets.Hue = AssetInitializer.LoadAsset("Images\\Hue", mode); - TextureAssets.ColorSlider = AssetInitializer.LoadAsset("Images\\ColorSlider", mode); - TextureAssets.ColorBar = AssetInitializer.LoadAsset("Images\\ColorBar", mode); - TextureAssets.ColorBlip = AssetInitializer.LoadAsset("Images\\ColorBlip", mode); - TextureAssets.ColorHighlight = AssetInitializer.LoadAsset("Images\\UI\\Slider_Highlight", mode); - TextureAssets.LockOnCursor = AssetInitializer.LoadAsset("Images\\UI\\LockOn_Cursor", mode); - TextureAssets.Rain = AssetInitializer.LoadAsset("Images\\Rain", mode); - for (int index = 0; index < 301; ++index) - TextureAssets.GlowMask[index] = AssetInitializer.LoadAsset("Images\\Glow_" + (object) index, mode); - for (int index = 0; index < TextureAssets.HighlightMask.Length; ++index) - { - if (TileID.Sets.HasOutlines[index]) - TextureAssets.HighlightMask[index] = AssetInitializer.LoadAsset("Images\\Misc\\TileOutlines\\Tiles_" + (object) index, mode); - } - for (int index = 0; index < 212; ++index) - TextureAssets.Extra[index] = AssetInitializer.LoadAsset("Images\\Extra_" + (object) index, mode); - for (int index = 0; index < 4; ++index) - TextureAssets.Coin[index] = AssetInitializer.LoadAsset("Images\\Coin_" + (object) index, mode); - TextureAssets.MagicPixel = AssetInitializer.LoadAsset("Images\\MagicPixel", mode); - TextureAssets.SettingsPanel = AssetInitializer.LoadAsset("Images\\UI\\Settings_Panel", mode); - TextureAssets.SettingsPanel2 = AssetInitializer.LoadAsset("Images\\UI\\Settings_Panel_2", mode); - for (int index = 0; index < TextureAssets.XmasTree.Length; ++index) - TextureAssets.XmasTree[index] = AssetInitializer.LoadAsset("Images\\Xmas_" + (object) index, mode); - for (int index = 0; index < 6; ++index) - TextureAssets.Clothes[index] = AssetInitializer.LoadAsset("Images\\Clothes_" + (object) index, mode); - for (int index = 0; index < TextureAssets.Flames.Length; ++index) - TextureAssets.Flames[index] = AssetInitializer.LoadAsset("Images\\Flame_" + (object) index, mode); - for (int index = 0; index < 8; ++index) - TextureAssets.MapIcon[index] = AssetInitializer.LoadAsset("Images\\Map_" + (object) index, mode); - for (int index = 0; index < TextureAssets.Underworld.Length; ++index) - TextureAssets.Underworld[index] = AssetInitializer.LoadAsset("Images/Backgrounds/Underworld " + (object) index, (AssetRequestMode) 0); - TextureAssets.Dest[0] = AssetInitializer.LoadAsset("Images\\Dest1", mode); - TextureAssets.Dest[1] = AssetInitializer.LoadAsset("Images\\Dest2", mode); - TextureAssets.Dest[2] = AssetInitializer.LoadAsset("Images\\Dest3", mode); - TextureAssets.Actuator = AssetInitializer.LoadAsset("Images\\Actuator", mode); - TextureAssets.Wire = AssetInitializer.LoadAsset("Images\\Wires", mode); - TextureAssets.Wire2 = AssetInitializer.LoadAsset("Images\\Wires2", mode); - TextureAssets.Wire3 = AssetInitializer.LoadAsset("Images\\Wires3", mode); - TextureAssets.Wire4 = AssetInitializer.LoadAsset("Images\\Wires4", mode); - TextureAssets.WireNew = AssetInitializer.LoadAsset("Images\\WiresNew", mode); - TextureAssets.FlyingCarpet = AssetInitializer.LoadAsset("Images\\FlyingCarpet", mode); - TextureAssets.Hb1 = AssetInitializer.LoadAsset("Images\\HealthBar1", mode); - TextureAssets.Hb2 = AssetInitializer.LoadAsset("Images\\HealthBar2", mode); - for (int index = 0; index < TextureAssets.NpcHead.Length; ++index) - TextureAssets.NpcHead[index] = AssetInitializer.LoadAsset("Images\\NPC_Head_" + (object) index, mode); - for (int index = 0; index < TextureAssets.NpcHeadBoss.Length; ++index) - TextureAssets.NpcHeadBoss[index] = AssetInitializer.LoadAsset("Images\\NPC_Head_Boss_" + (object) index, mode); - for (int index = 1; index < TextureAssets.BackPack.Length; ++index) - TextureAssets.BackPack[index] = AssetInitializer.LoadAsset("Images\\BackPack_" + (object) index, mode); - for (int index = 1; index < 323; ++index) - TextureAssets.Buff[index] = AssetInitializer.LoadAsset("Images\\Buff_" + (object) index, mode); - Main.instance.LoadBackground(0); - Main.instance.LoadBackground(49); - TextureAssets.MinecartMount = AssetInitializer.LoadAsset("Images\\Mount_Minecart", mode); - for (int index = 0; index < TextureAssets.RudolphMount.Length; ++index) - TextureAssets.RudolphMount[index] = AssetInitializer.LoadAsset("Images\\Rudolph_" + (object) index, mode); - TextureAssets.BunnyMount = AssetInitializer.LoadAsset("Images\\Mount_Bunny", mode); - TextureAssets.PigronMount = AssetInitializer.LoadAsset("Images\\Mount_Pigron", mode); - TextureAssets.SlimeMount = AssetInitializer.LoadAsset("Images\\Mount_Slime", mode); - TextureAssets.TurtleMount = AssetInitializer.LoadAsset("Images\\Mount_Turtle", mode); - TextureAssets.UnicornMount = AssetInitializer.LoadAsset("Images\\Mount_Unicorn", mode); - TextureAssets.BasiliskMount = AssetInitializer.LoadAsset("Images\\Mount_Basilisk", mode); - TextureAssets.MinecartMechMount[0] = AssetInitializer.LoadAsset("Images\\Mount_MinecartMech", mode); - TextureAssets.MinecartMechMount[1] = AssetInitializer.LoadAsset("Images\\Mount_MinecartMechGlow", mode); - TextureAssets.CuteFishronMount[0] = AssetInitializer.LoadAsset("Images\\Mount_CuteFishron1", mode); - TextureAssets.CuteFishronMount[1] = AssetInitializer.LoadAsset("Images\\Mount_CuteFishron2", mode); - TextureAssets.MinecartWoodMount = AssetInitializer.LoadAsset("Images\\Mount_MinecartWood", mode); - TextureAssets.DesertMinecartMount = AssetInitializer.LoadAsset("Images\\Mount_MinecartDesert", mode); - TextureAssets.FishMinecartMount = AssetInitializer.LoadAsset("Images\\Mount_MinecartMineCarp", mode); - TextureAssets.BeeMount[0] = AssetInitializer.LoadAsset("Images\\Mount_Bee", mode); - TextureAssets.BeeMount[1] = AssetInitializer.LoadAsset("Images\\Mount_BeeWings", mode); - TextureAssets.UfoMount[0] = AssetInitializer.LoadAsset("Images\\Mount_UFO", mode); - TextureAssets.UfoMount[1] = AssetInitializer.LoadAsset("Images\\Mount_UFOGlow", mode); - TextureAssets.DrillMount[0] = AssetInitializer.LoadAsset("Images\\Mount_DrillRing", mode); - TextureAssets.DrillMount[1] = AssetInitializer.LoadAsset("Images\\Mount_DrillSeat", mode); - TextureAssets.DrillMount[2] = AssetInitializer.LoadAsset("Images\\Mount_DrillDiode", mode); - TextureAssets.DrillMount[3] = AssetInitializer.LoadAsset("Images\\Mount_Glow_DrillRing", mode); - TextureAssets.DrillMount[4] = AssetInitializer.LoadAsset("Images\\Mount_Glow_DrillSeat", mode); - TextureAssets.DrillMount[5] = AssetInitializer.LoadAsset("Images\\Mount_Glow_DrillDiode", mode); - TextureAssets.ScutlixMount[0] = AssetInitializer.LoadAsset("Images\\Mount_Scutlix", mode); - TextureAssets.ScutlixMount[1] = AssetInitializer.LoadAsset("Images\\Mount_ScutlixEyes", mode); - TextureAssets.ScutlixMount[2] = AssetInitializer.LoadAsset("Images\\Mount_ScutlixEyeGlow", mode); - for (int index = 0; index < TextureAssets.Gem.Length; ++index) - TextureAssets.Gem[index] = AssetInitializer.LoadAsset("Images\\Gem_" + (object) index, mode); - for (int index = 0; index < 37; ++index) - TextureAssets.Cloud[index] = AssetInitializer.LoadAsset("Images\\Cloud_" + (object) index, mode); - for (int index = 0; index < 4; ++index) - TextureAssets.Star[index] = AssetInitializer.LoadAsset("Images\\Star_" + (object) index, mode); - for (int index = 0; index < 13; ++index) - { - TextureAssets.Liquid[index] = AssetInitializer.LoadAsset("Images\\Liquid_" + (object) index, mode); - TextureAssets.LiquidSlope[index] = AssetInitializer.LoadAsset("Images\\LiquidSlope_" + (object) index, mode); - } - Main.instance.waterfallManager.LoadContent(); - TextureAssets.NpcToggle[0] = AssetInitializer.LoadAsset("Images\\House_1", mode); - TextureAssets.NpcToggle[1] = AssetInitializer.LoadAsset("Images\\House_2", mode); - TextureAssets.HbLock[0] = AssetInitializer.LoadAsset("Images\\Lock_0", mode); - TextureAssets.HbLock[1] = AssetInitializer.LoadAsset("Images\\Lock_1", mode); - TextureAssets.blockReplaceIcon[0] = AssetInitializer.LoadAsset("Images\\UI\\BlockReplace_0", mode); - TextureAssets.blockReplaceIcon[1] = AssetInitializer.LoadAsset("Images\\UI\\BlockReplace_1", mode); - TextureAssets.Grid = AssetInitializer.LoadAsset("Images\\Grid", mode); - TextureAssets.Trash = AssetInitializer.LoadAsset("Images\\Trash", mode); - TextureAssets.Cd = AssetInitializer.LoadAsset("Images\\CoolDown", mode); - TextureAssets.Logo = AssetInitializer.LoadAsset("Images\\Logo", mode); - TextureAssets.Logo2 = AssetInitializer.LoadAsset("Images\\Logo2", mode); - TextureAssets.Logo3 = AssetInitializer.LoadAsset("Images\\Logo3", mode); - TextureAssets.Logo4 = AssetInitializer.LoadAsset("Images\\Logo4", mode); - TextureAssets.Dust = AssetInitializer.LoadAsset("Images\\Dust", mode); - TextureAssets.Sun = AssetInitializer.LoadAsset("Images\\Sun", mode); - TextureAssets.Sun2 = AssetInitializer.LoadAsset("Images\\Sun2", mode); - TextureAssets.Sun3 = AssetInitializer.LoadAsset("Images\\Sun3", mode); - TextureAssets.BlackTile = AssetInitializer.LoadAsset("Images\\Black_Tile", mode); - TextureAssets.Heart = AssetInitializer.LoadAsset("Images\\Heart", mode); - TextureAssets.Heart2 = AssetInitializer.LoadAsset("Images\\Heart2", mode); - TextureAssets.Bubble = AssetInitializer.LoadAsset("Images\\Bubble", mode); - TextureAssets.Flame = AssetInitializer.LoadAsset("Images\\Flame", mode); - TextureAssets.Mana = AssetInitializer.LoadAsset("Images\\Mana", mode); - for (int index = 0; index < TextureAssets.Cursors.Length; ++index) - TextureAssets.Cursors[index] = AssetInitializer.LoadAsset("Images\\UI\\Cursor_" + (object) index, mode); - TextureAssets.CursorRadial = AssetInitializer.LoadAsset("Images\\UI\\Radial", mode); - TextureAssets.Ninja = AssetInitializer.LoadAsset("Images\\Ninja", mode); - TextureAssets.AntLion = AssetInitializer.LoadAsset("Images\\AntlionBody", mode); - TextureAssets.SpikeBase = AssetInitializer.LoadAsset("Images\\Spike_Base", mode); - TextureAssets.Wood[0] = AssetInitializer.LoadAsset("Images\\Tiles_5_0", mode); - TextureAssets.Wood[1] = AssetInitializer.LoadAsset("Images\\Tiles_5_1", mode); - TextureAssets.Wood[2] = AssetInitializer.LoadAsset("Images\\Tiles_5_2", mode); - TextureAssets.Wood[3] = AssetInitializer.LoadAsset("Images\\Tiles_5_3", mode); - TextureAssets.Wood[4] = AssetInitializer.LoadAsset("Images\\Tiles_5_4", mode); - TextureAssets.Wood[5] = AssetInitializer.LoadAsset("Images\\Tiles_5_5", mode); - TextureAssets.Wood[6] = AssetInitializer.LoadAsset("Images\\Tiles_5_6", mode); - TextureAssets.SmileyMoon = AssetInitializer.LoadAsset("Images\\Moon_Smiley", mode); - TextureAssets.PumpkinMoon = AssetInitializer.LoadAsset("Images\\Moon_Pumpkin", mode); - TextureAssets.SnowMoon = AssetInitializer.LoadAsset("Images\\Moon_Snow", mode); - for (int index = 0; index < TextureAssets.Moon.Length; ++index) - TextureAssets.Moon[index] = AssetInitializer.LoadAsset("Images\\Moon_" + (object) index, mode); - for (int index = 0; index < TextureAssets.TreeTop.Length; ++index) - TextureAssets.TreeTop[index] = AssetInitializer.LoadAsset("Images\\Tree_Tops_" + (object) index, mode); - for (int index = 0; index < TextureAssets.TreeBranch.Length; ++index) - TextureAssets.TreeBranch[index] = AssetInitializer.LoadAsset("Images\\Tree_Branches_" + (object) index, mode); - TextureAssets.ShroomCap = AssetInitializer.LoadAsset("Images\\Shroom_Tops", mode); - TextureAssets.InventoryBack = AssetInitializer.LoadAsset("Images\\Inventory_Back", mode); - TextureAssets.InventoryBack2 = AssetInitializer.LoadAsset("Images\\Inventory_Back2", mode); - TextureAssets.InventoryBack3 = AssetInitializer.LoadAsset("Images\\Inventory_Back3", mode); - TextureAssets.InventoryBack4 = AssetInitializer.LoadAsset("Images\\Inventory_Back4", mode); - TextureAssets.InventoryBack5 = AssetInitializer.LoadAsset("Images\\Inventory_Back5", mode); - TextureAssets.InventoryBack6 = AssetInitializer.LoadAsset("Images\\Inventory_Back6", mode); - TextureAssets.InventoryBack7 = AssetInitializer.LoadAsset("Images\\Inventory_Back7", mode); - TextureAssets.InventoryBack8 = AssetInitializer.LoadAsset("Images\\Inventory_Back8", mode); - TextureAssets.InventoryBack9 = AssetInitializer.LoadAsset("Images\\Inventory_Back9", mode); - TextureAssets.InventoryBack10 = AssetInitializer.LoadAsset("Images\\Inventory_Back10", mode); - TextureAssets.InventoryBack11 = AssetInitializer.LoadAsset("Images\\Inventory_Back11", mode); - TextureAssets.InventoryBack12 = AssetInitializer.LoadAsset("Images\\Inventory_Back12", mode); - TextureAssets.InventoryBack13 = AssetInitializer.LoadAsset("Images\\Inventory_Back13", mode); - TextureAssets.InventoryBack14 = AssetInitializer.LoadAsset("Images\\Inventory_Back14", mode); - TextureAssets.InventoryBack15 = AssetInitializer.LoadAsset("Images\\Inventory_Back15", mode); - TextureAssets.InventoryBack16 = AssetInitializer.LoadAsset("Images\\Inventory_Back16", mode); - TextureAssets.InventoryBack17 = AssetInitializer.LoadAsset("Images\\Inventory_Back17", mode); - TextureAssets.InventoryBack18 = AssetInitializer.LoadAsset("Images\\Inventory_Back18", mode); - TextureAssets.HairStyleBack = AssetInitializer.LoadAsset("Images\\HairStyleBack", mode); - TextureAssets.ClothesStyleBack = AssetInitializer.LoadAsset("Images\\ClothesStyleBack", mode); - TextureAssets.InventoryTickOff = AssetInitializer.LoadAsset("Images\\Inventory_Tick_Off", mode); - TextureAssets.InventoryTickOn = AssetInitializer.LoadAsset("Images\\Inventory_Tick_On", mode); - TextureAssets.TextBack = AssetInitializer.LoadAsset("Images\\Text_Back", mode); - TextureAssets.Chat = AssetInitializer.LoadAsset("Images\\Chat", mode); - TextureAssets.Chat2 = AssetInitializer.LoadAsset("Images\\Chat2", mode); - TextureAssets.ChatBack = AssetInitializer.LoadAsset("Images\\Chat_Back", mode); - TextureAssets.Team = AssetInitializer.LoadAsset("Images\\Team", mode); - PlayerDataInitializer.Load(); - TextureAssets.Chaos = AssetInitializer.LoadAsset("Images\\Chaos", mode); - TextureAssets.EyeLaser = AssetInitializer.LoadAsset("Images\\Eye_Laser", mode); - TextureAssets.BoneEyes = AssetInitializer.LoadAsset("Images\\Bone_Eyes", mode); - TextureAssets.BoneLaser = AssetInitializer.LoadAsset("Images\\Bone_Laser", mode); - TextureAssets.LightDisc = AssetInitializer.LoadAsset("Images\\Light_Disc", mode); - TextureAssets.Confuse = AssetInitializer.LoadAsset("Images\\Confuse", mode); - TextureAssets.Probe = AssetInitializer.LoadAsset("Images\\Probe", mode); - TextureAssets.SunOrb = AssetInitializer.LoadAsset("Images\\SunOrb", mode); - TextureAssets.SunAltar = AssetInitializer.LoadAsset("Images\\SunAltar", mode); - TextureAssets.XmasLight = AssetInitializer.LoadAsset("Images\\XmasLight", mode); - TextureAssets.Beetle = AssetInitializer.LoadAsset("Images\\BeetleOrb", mode); - for (int index = 0; index < 17; ++index) - TextureAssets.Chains[index] = AssetInitializer.LoadAsset("Images\\Chains_" + (object) index, mode); - TextureAssets.Chain20 = AssetInitializer.LoadAsset("Images\\Chain20", mode); - TextureAssets.FishingLine = AssetInitializer.LoadAsset("Images\\FishingLine", mode); - TextureAssets.Chain = AssetInitializer.LoadAsset("Images\\Chain", mode); - TextureAssets.Chain2 = AssetInitializer.LoadAsset("Images\\Chain2", mode); - TextureAssets.Chain3 = AssetInitializer.LoadAsset("Images\\Chain3", mode); - TextureAssets.Chain4 = AssetInitializer.LoadAsset("Images\\Chain4", mode); - TextureAssets.Chain5 = AssetInitializer.LoadAsset("Images\\Chain5", mode); - TextureAssets.Chain6 = AssetInitializer.LoadAsset("Images\\Chain6", mode); - TextureAssets.Chain7 = AssetInitializer.LoadAsset("Images\\Chain7", mode); - TextureAssets.Chain8 = AssetInitializer.LoadAsset("Images\\Chain8", mode); - TextureAssets.Chain9 = AssetInitializer.LoadAsset("Images\\Chain9", mode); - TextureAssets.Chain10 = AssetInitializer.LoadAsset("Images\\Chain10", mode); - TextureAssets.Chain11 = AssetInitializer.LoadAsset("Images\\Chain11", mode); - TextureAssets.Chain12 = AssetInitializer.LoadAsset("Images\\Chain12", mode); - TextureAssets.Chain13 = AssetInitializer.LoadAsset("Images\\Chain13", mode); - TextureAssets.Chain14 = AssetInitializer.LoadAsset("Images\\Chain14", mode); - TextureAssets.Chain15 = AssetInitializer.LoadAsset("Images\\Chain15", mode); - TextureAssets.Chain16 = AssetInitializer.LoadAsset("Images\\Chain16", mode); - TextureAssets.Chain17 = AssetInitializer.LoadAsset("Images\\Chain17", mode); - TextureAssets.Chain18 = AssetInitializer.LoadAsset("Images\\Chain18", mode); - TextureAssets.Chain19 = AssetInitializer.LoadAsset("Images\\Chain19", mode); - TextureAssets.Chain20 = AssetInitializer.LoadAsset("Images\\Chain20", mode); - TextureAssets.Chain21 = AssetInitializer.LoadAsset("Images\\Chain21", mode); - TextureAssets.Chain22 = AssetInitializer.LoadAsset("Images\\Chain22", mode); - TextureAssets.Chain23 = AssetInitializer.LoadAsset("Images\\Chain23", mode); - TextureAssets.Chain24 = AssetInitializer.LoadAsset("Images\\Chain24", mode); - TextureAssets.Chain25 = AssetInitializer.LoadAsset("Images\\Chain25", mode); - TextureAssets.Chain26 = AssetInitializer.LoadAsset("Images\\Chain26", mode); - TextureAssets.Chain27 = AssetInitializer.LoadAsset("Images\\Chain27", mode); - TextureAssets.Chain28 = AssetInitializer.LoadAsset("Images\\Chain28", mode); - TextureAssets.Chain29 = AssetInitializer.LoadAsset("Images\\Chain29", mode); - TextureAssets.Chain30 = AssetInitializer.LoadAsset("Images\\Chain30", mode); - TextureAssets.Chain31 = AssetInitializer.LoadAsset("Images\\Chain31", mode); - TextureAssets.Chain32 = AssetInitializer.LoadAsset("Images\\Chain32", mode); - TextureAssets.Chain33 = AssetInitializer.LoadAsset("Images\\Chain33", mode); - TextureAssets.Chain34 = AssetInitializer.LoadAsset("Images\\Chain34", mode); - TextureAssets.Chain35 = AssetInitializer.LoadAsset("Images\\Chain35", mode); - TextureAssets.Chain36 = AssetInitializer.LoadAsset("Images\\Chain36", mode); - TextureAssets.Chain37 = AssetInitializer.LoadAsset("Images\\Chain37", mode); - TextureAssets.Chain38 = AssetInitializer.LoadAsset("Images\\Chain38", mode); - TextureAssets.Chain39 = AssetInitializer.LoadAsset("Images\\Chain39", mode); - TextureAssets.Chain40 = AssetInitializer.LoadAsset("Images\\Chain40", mode); - TextureAssets.Chain41 = AssetInitializer.LoadAsset("Images\\Chain41", mode); - TextureAssets.Chain42 = AssetInitializer.LoadAsset("Images\\Chain42", mode); - TextureAssets.Chain43 = AssetInitializer.LoadAsset("Images\\Chain43", mode); - TextureAssets.EyeLaserSmall = AssetInitializer.LoadAsset("Images\\Eye_Laser_Small", mode); - TextureAssets.BoneArm = AssetInitializer.LoadAsset("Images\\Arm_Bone", mode); - TextureAssets.PumpkingArm = AssetInitializer.LoadAsset("Images\\PumpkingArm", mode); - TextureAssets.PumpkingCloak = AssetInitializer.LoadAsset("Images\\PumpkingCloak", mode); - TextureAssets.BoneArm2 = AssetInitializer.LoadAsset("Images\\Arm_Bone_2", mode); - for (int index = 1; index < TextureAssets.GemChain.Length; ++index) - TextureAssets.GemChain[index] = AssetInitializer.LoadAsset("Images\\GemChain_" + (object) index, mode); - for (int index = 1; index < TextureAssets.Golem.Length; ++index) - TextureAssets.Golem[index] = AssetInitializer.LoadAsset("Images\\GolemLights" + (object) index, mode); - TextureAssets.GolfSwingBarFill = AssetInitializer.LoadAsset("Images\\UI\\GolfSwingBarFill", mode); - TextureAssets.GolfSwingBarPanel = AssetInitializer.LoadAsset("Images\\UI\\GolfSwingBarPanel", mode); - TextureAssets.SpawnPoint = AssetInitializer.LoadAsset("Images\\UI\\SpawnPoint", mode); - TextureAssets.SpawnBed = AssetInitializer.LoadAsset("Images\\UI\\SpawnBed", mode); - TextureAssets.MapPing = AssetInitializer.LoadAsset("Images\\UI\\MapPing", mode); - TextureAssets.GolfBallArrow = AssetInitializer.LoadAsset("Images\\UI\\GolfBall_Arrow", mode); - TextureAssets.GolfBallArrowShadow = AssetInitializer.LoadAsset("Images\\UI\\GolfBall_Arrow_Shadow", mode); - TextureAssets.GolfBallOutline = AssetInitializer.LoadAsset("Images\\Misc\\GolfBallOutline", mode); - AssetInitializer.LoadMinimapFrames(mode); - AssetInitializer.LoadPlayerResourceSets(mode); - Main.AchievementAdvisor.LoadContent(); - } - - private static void LoadMinimapFrames(AssetRequestMode mode) - { - float num1 = 2f; - float num2 = 6f; - AssetInitializer.LoadMinimap("Default", new Vector2(-8f, -15f), new Vector2(148f + num1, 234f + num2), new Vector2(200f + num1, 234f + num2), new Vector2(174f + num1, 234f + num2), mode); - AssetInitializer.LoadMinimap("Golden", new Vector2(-10f, -10f), new Vector2(136f, 248f), new Vector2(96f, 248f), new Vector2(116f, 248f), mode); - AssetInitializer.LoadMinimap("Remix", new Vector2(-10f, -10f), new Vector2(200f, 234f), new Vector2(148f, 234f), new Vector2(174f, 234f), mode); - AssetInitializer.LoadMinimap("Sticks", new Vector2(-10f, -10f), new Vector2(148f, 234f), new Vector2(200f, 234f), new Vector2(174f, 234f), mode); - AssetInitializer.LoadMinimap("StoneGold", new Vector2(-15f, -15f), new Vector2(220f, 244f), new Vector2(244f, 188f), new Vector2(244f, 216f), mode); - AssetInitializer.LoadMinimap("TwigLeaf", new Vector2(-20f, -20f), new Vector2(206f, 242f), new Vector2(162f, 242f), new Vector2(184f, 242f), mode); - AssetInitializer.LoadMinimap("Leaf", new Vector2(-20f, -20f), new Vector2(212f, 244f), new Vector2(168f, 246f), new Vector2(190f, 246f), mode); - AssetInitializer.LoadMinimap("Retro", new Vector2(-10f, -10f), new Vector2(150f, 236f), new Vector2(202f, 236f), new Vector2(176f, 236f), mode); - AssetInitializer.LoadMinimap("Valkyrie", new Vector2(-10f, -10f), new Vector2(154f, 242f), new Vector2(206f, 240f), new Vector2(180f, 244f), mode); - string frameName = Main.Configuration.Get("MinimapFrame", "Default"); - Main.ActiveMinimapFrame = Main.MinimapFrames.FirstOrDefault>((Func, bool>) (pair => pair.Key == frameName)).Value; - if (Main.ActiveMinimapFrame == null) - Main.ActiveMinimapFrame = Main.MinimapFrames.Values.First(); - Main.Configuration.OnSave += new Action(AssetInitializer.Configuration_OnSave_MinimapFrame); - } - - private static void Configuration_OnSave_MinimapFrame(Preferences obj) - { - string str = Main.MinimapFrames.FirstOrDefault>((Func, bool>) (pair => pair.Value == Main.ActiveMinimapFrame)).Key ?? "Default"; - obj.Put("MinimapFrame", (object) str); - } - - private static void LoadMinimap( - string name, - Vector2 frameOffset, - Vector2 resetPosition, - Vector2 zoomInPosition, - Vector2 zoomOutPosition, - AssetRequestMode mode) - { - MinimapFrame minimapFrame = new MinimapFrame(AssetInitializer.LoadAsset("Images\\UI\\Minimap\\" + name + "\\MinimapFrame", mode), frameOffset); - minimapFrame.SetResetButton(AssetInitializer.LoadAsset("Images\\UI\\Minimap\\" + name + "\\MinimapButton_Reset", mode), resetPosition); - minimapFrame.SetZoomOutButton(AssetInitializer.LoadAsset("Images\\UI\\Minimap\\" + name + "\\MinimapButton_ZoomOut", mode), zoomOutPosition); - minimapFrame.SetZoomInButton(AssetInitializer.LoadAsset("Images\\UI\\Minimap\\" + name + "\\MinimapButton_ZoomIn", mode), zoomInPosition); - Main.MinimapFrames[name] = minimapFrame; - } - - private static void LoadPlayerResourceSets(AssetRequestMode mode) - { - Main.PlayerResourcesSets["Default"] = (IPlayerResourcesDisplaySet) new ClassicPlayerResourcesDisplaySet(); - Main.PlayerResourcesSets["New"] = (IPlayerResourcesDisplaySet) new FancyClassicPlayerResourcesDisplaySet("FancyClassic", mode); - Main.PlayerResourcesSets["HorizontalBars"] = (IPlayerResourcesDisplaySet) new HorizontalBarsPlayerReosurcesDisplaySet("HorizontalBars", mode); - string frameName = Main.Configuration.Get("PlayerResourcesSet", "New"); - Main.ActivePlayerResourcesSet = Main.PlayerResourcesSets.FirstOrDefault>((Func, bool>) (pair => pair.Key == frameName)).Value; - if (Main.ActivePlayerResourcesSet == null) - Main.ActivePlayerResourcesSet = Main.PlayerResourcesSets.Values.First(); - Main.Configuration.OnSave += new Action(AssetInitializer.Configuration_OnSave_PlayerResourcesSet); - } - - private static void Configuration_OnSave_PlayerResourcesSet(Preferences obj) - { - string str = Main.PlayerResourcesSets.FirstOrDefault>((Func, bool>) (pair => pair.Value == Main.ActivePlayerResourcesSet)).Key ?? "New"; - obj.Put("PlayerResourcesSet", (object) str); - } - - private static Asset LoadAsset(string assetName, AssetRequestMode mode) where T : class => Main.Assets.Request(assetName, mode); - } -} diff --git a/Initializers/ChatInitializer.cs b/Initializers/ChatInitializer.cs index 828a2cd..fa96bb8 100644 --- a/Initializers/ChatInitializer.cs +++ b/Initializers/ChatInitializer.cs @@ -1,13 +1,11 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Initializers.ChatInitializer -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Terraria.Chat.Commands; -using Terraria.GameContent.UI; using Terraria.GameContent.UI.Chat; -using Terraria.Localization; using Terraria.UI.Chat; namespace Terraria.Initializers @@ -21,13 +19,7 @@ namespace Terraria.Initializers ChatManager.Register("n", "name"); ChatManager.Register("a", "achievement"); ChatManager.Register("g", "glyph"); - ChatManager.Commands.AddCommand().AddCommand().AddCommand().AddCommand().AddCommand().AddCommand().AddCommand().AddDefaultCommand(); - for (int index = 0; index < 145; ++index) - { - string name = EmoteID.Search.GetName(index); - string key = "EmojiCommand." + name; - ChatManager.Commands.AddAlias(Language.GetText(key), NetworkText.FromFormattable("{0} {1}", (object) Language.GetText("ChatCommand.Emoji_1"), (object) Language.GetText("EmojiName." + name))); - } + ChatManager.Commands.AddCommand().AddCommand().AddCommand().AddCommand().AddDefaultCommand(); } } } diff --git a/Initializers/ChromaInitializer.cs b/Initializers/ChromaInitializer.cs deleted file mode 100644 index 2e24814..0000000 --- a/Initializers/ChromaInitializer.cs +++ /dev/null @@ -1,161 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Initializers.ChromaInitializer -// 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; -using ReLogic.Graphics; -using ReLogic.Peripherals.RGB; -using ReLogic.Peripherals.RGB.Corsair; -using ReLogic.Peripherals.RGB.Logitech; -using ReLogic.Peripherals.RGB.Razer; -using System; -using System.Diagnostics; -using Terraria.GameContent.RGB; -using Terraria.Graphics.Effects; -using Terraria.IO; - -namespace Terraria.Initializers -{ - public static class ChromaInitializer - { - private static ChromaEngine _engine; - - private static void AddDevices() - { - VendorColorProfile razerColorProfile = Main.Configuration.Get("RazerColorProfile", new VendorColorProfile(new Vector3(1f, 0.765f, 0.568f))); - VendorColorProfile corsairColorProfile = Main.Configuration.Get("CorsairColorProfile", new VendorColorProfile()); - VendorColorProfile logitechColorProfile = Main.Configuration.Get("LogitechColorProfile", new VendorColorProfile()); - ChromaInitializer._engine.AddDeviceGroup("Razer", (RgbDeviceGroup) new RazerDeviceGroup(razerColorProfile)); - ChromaInitializer._engine.AddDeviceGroup("Corsair", (RgbDeviceGroup) new CorsairDeviceGroup(corsairColorProfile)); - ChromaInitializer._engine.AddDeviceGroup("Logitech", (RgbDeviceGroup) new LogitechDeviceGroup(logitechColorProfile)); - bool useRazer = Main.Configuration.Get("UseRazerRGB", true); - bool useCorsair = Main.Configuration.Get("UseCorsairRGB", true); - bool useLogitech = Main.Configuration.Get("UseLogitechRGB", true); - float rgbUpdateRate = Main.Configuration.Get("RGBUpdatesPerSecond", 45f); - if ((double) rgbUpdateRate <= 1.0000000116861E-07) - rgbUpdateRate = 45f; - ChromaInitializer._engine.FrameTimeInSeconds = 1f / rgbUpdateRate; - Main.Configuration.OnSave += (Action) (config => - { - config.Put("UseRazerRGB", (object) useRazer); - config.Put("UseCorsairRGB", (object) useCorsair); - config.Put("UseLogitechRGB", (object) useLogitech); - config.Put("RazerColorProfile", (object) razerColorProfile); - config.Put("CorsairColorProfile", (object) corsairColorProfile); - config.Put("LogitechColorProfile", (object) logitechColorProfile); - config.Put("RGBUpdatesPerSecond", (object) rgbUpdateRate); - }); - if (useRazer) - ChromaInitializer._engine.EnableDeviceGroup("Razer"); - if (useCorsair) - ChromaInitializer._engine.EnableDeviceGroup("Corsair"); - if (useLogitech) - ChromaInitializer._engine.EnableDeviceGroup("Logitech"); - AppDomain.CurrentDomain.ProcessExit += new EventHandler(ChromaInitializer.OnProcessExit); - } - - private static void OnProcessExit(object sender, EventArgs e) => ChromaInitializer._engine.DisableAllDeviceGroups(); - - public static void Load() - { - ChromaInitializer._engine = Main.Chroma; - ChromaInitializer.AddDevices(); - Color color = new Color(46, 23, 12); - ChromaInitializer.RegisterShader("Base", (ChromaShader) new SurfaceBiomeShader(Color.Green, color), CommonConditions.InMenu, (ShaderLayer) 9); - ChromaInitializer.RegisterShader("Surface Mushroom", (ChromaShader) new SurfaceBiomeShader(Color.DarkBlue, new Color(33, 31, 27)), CommonConditions.DrunkMenu, (ShaderLayer) 9); - ChromaInitializer.RegisterShader("Sky", (ChromaShader) new SkyShader(new Color(34, 51, 128), new Color(5, 5, 5)), CommonConditions.Depth.Sky, (ShaderLayer) 1); - ChromaInitializer.RegisterShader("Surface", (ChromaShader) new SurfaceBiomeShader(Color.Green, color), CommonConditions.Depth.Surface, (ShaderLayer) 1); - ChromaInitializer.RegisterShader("Vines", (ChromaShader) new VineShader(), CommonConditions.Depth.Vines, (ShaderLayer) 1); - ChromaInitializer.RegisterShader("Underground", (ChromaShader) new CavernShader(new Color(122, 62, 32), new Color(25, 13, 7), 0.5f), CommonConditions.Depth.Underground, (ShaderLayer) 1); - ChromaInitializer.RegisterShader("Caverns", (ChromaShader) new CavernShader(color, new Color(25, 25, 25), 0.5f), CommonConditions.Depth.Caverns, (ShaderLayer) 1); - ChromaInitializer.RegisterShader("Magma", (ChromaShader) new CavernShader(new Color(181, 17, 0), new Color(25, 25, 25), 0.5f), CommonConditions.Depth.Magma, (ShaderLayer) 1); - ChromaInitializer.RegisterShader("Underworld", (ChromaShader) new UnderworldShader(Color.Red, new Color(1f, 0.5f, 0.0f), 1f), CommonConditions.Depth.Underworld, (ShaderLayer) 1); - ChromaInitializer.RegisterShader("Surface Desert", (ChromaShader) new SurfaceBiomeShader(new Color(84, 49, 0), new Color(245, 225, 33)), CommonConditions.SurfaceBiome.Desert, (ShaderLayer) 2); - ChromaInitializer.RegisterShader("Surface Jungle", (ChromaShader) new SurfaceBiomeShader(Color.Green, Color.Teal), CommonConditions.SurfaceBiome.Jungle, (ShaderLayer) 2); - ChromaInitializer.RegisterShader("Surface Ocean", (ChromaShader) new SurfaceBiomeShader(Color.SkyBlue, Color.Blue), CommonConditions.SurfaceBiome.Ocean, (ShaderLayer) 2); - ChromaInitializer.RegisterShader("Surface Snow", (ChromaShader) new SurfaceBiomeShader(new Color(0, 10, 50), new Color(0.5f, 0.75f, 1f)), CommonConditions.SurfaceBiome.Snow, (ShaderLayer) 2); - ChromaInitializer.RegisterShader("Surface Mushroom", (ChromaShader) new SurfaceBiomeShader(Color.DarkBlue, new Color(33, 31, 27)), CommonConditions.SurfaceBiome.Mushroom, (ShaderLayer) 2); - ChromaInitializer.RegisterShader("Surface Hallow", (ChromaShader) new HallowSurfaceShader(), CommonConditions.SurfaceBiome.Hallow, (ShaderLayer) 3); - ChromaInitializer.RegisterShader("Surface Crimson", (ChromaShader) new CorruptSurfaceShader(Color.Red, new Color(25, 25, 40)), CommonConditions.SurfaceBiome.Crimson, (ShaderLayer) 3); - ChromaInitializer.RegisterShader("Surface Corruption", (ChromaShader) new CorruptSurfaceShader(new Color(73, 0, (int) byte.MaxValue), new Color(15, 15, 27)), CommonConditions.SurfaceBiome.Corruption, (ShaderLayer) 3); - ChromaInitializer.RegisterShader("Hive", (ChromaShader) new DrippingShader(new Color(0.05f, 0.01f, 0.0f), new Color((int) byte.MaxValue, 150, 0), 0.5f), CommonConditions.UndergroundBiome.Hive, (ShaderLayer) 3); - ChromaInitializer.RegisterShader("Underground Mushroom", (ChromaShader) new UndergroundMushroomShader(), CommonConditions.UndergroundBiome.Mushroom, (ShaderLayer) 2); - ChromaInitializer.RegisterShader("Underground Corrutpion", (ChromaShader) new UndergroundCorruptionShader(), CommonConditions.UndergroundBiome.Corrupt, (ShaderLayer) 2); - ChromaInitializer.RegisterShader("Underground Crimson", (ChromaShader) new DrippingShader(new Color(0.05f, 0.0f, 0.0f), new Color((int) byte.MaxValue, 0, 0)), CommonConditions.UndergroundBiome.Crimson, (ShaderLayer) 2); - ChromaInitializer.RegisterShader("Underground Hallow", (ChromaShader) new UndergroundHallowShader(), CommonConditions.UndergroundBiome.Hallow, (ShaderLayer) 2); - ChromaInitializer.RegisterShader("Meteorite", (ChromaShader) new MeteoriteShader(), CommonConditions.MiscBiome.Meteorite, (ShaderLayer) 3); - ChromaInitializer.RegisterShader("Temple", (ChromaShader) new TempleShader(), CommonConditions.UndergroundBiome.Temple, (ShaderLayer) 3); - ChromaInitializer.RegisterShader("Dungeon", (ChromaShader) new DungeonShader(), CommonConditions.UndergroundBiome.Dungeon, (ShaderLayer) 3); - ChromaInitializer.RegisterShader("Granite", (ChromaShader) new CavernShader(new Color(14, 19, 46), new Color(5, 0, 30), 0.5f), CommonConditions.UndergroundBiome.Granite, (ShaderLayer) 3); - ChromaInitializer.RegisterShader("Marble", (ChromaShader) new CavernShader(new Color(100, 100, 100), new Color(20, 20, 20), 0.5f), CommonConditions.UndergroundBiome.Marble, (ShaderLayer) 3); - ChromaInitializer.RegisterShader("Gem Cave", (ChromaShader) new GemCaveShader(color, new Color(25, 25, 25)), CommonConditions.UndergroundBiome.GemCave, (ShaderLayer) 3); - ChromaInitializer.RegisterShader("Underground Jungle", (ChromaShader) new JungleShader(), CommonConditions.UndergroundBiome.Jungle, (ShaderLayer) 2); - ChromaInitializer.RegisterShader("Underground Ice", (ChromaShader) new IceShader(new Color(0, 10, 50), new Color(0.5f, 0.75f, 1f)), CommonConditions.UndergroundBiome.Ice, (ShaderLayer) 2); - ChromaInitializer.RegisterShader("Corrupt Ice", (ChromaShader) new IceShader(new Color(5, 0, 25), new Color(152, 102, (int) byte.MaxValue)), CommonConditions.UndergroundBiome.CorruptIce, (ShaderLayer) 3); - ChromaInitializer.RegisterShader("Crimson Ice", (ChromaShader) new IceShader(new Color(0.1f, 0.0f, 0.0f), new Color(1f, 0.45f, 0.4f)), CommonConditions.UndergroundBiome.CrimsonIce, (ShaderLayer) 3); - ChromaInitializer.RegisterShader("Hallow Ice", (ChromaShader) new IceShader(new Color(0.2f, 0.0f, 0.1f), new Color(1f, 0.7f, 0.7f)), CommonConditions.UndergroundBiome.HallowIce, (ShaderLayer) 3); - ChromaInitializer.RegisterShader("Underground Desert", (ChromaShader) new DesertShader(new Color(60, 10, 0), new Color((int) byte.MaxValue, 165, 0)), CommonConditions.UndergroundBiome.Desert, (ShaderLayer) 2); - ChromaInitializer.RegisterShader("Corrupt Desert", (ChromaShader) new DesertShader(new Color(15, 0, 15), new Color(116, 103, (int) byte.MaxValue)), CommonConditions.UndergroundBiome.CorruptDesert, (ShaderLayer) 3); - ChromaInitializer.RegisterShader("Crimson Desert", (ChromaShader) new DesertShader(new Color(20, 10, 0), new Color(195, 0, 0)), CommonConditions.UndergroundBiome.CrimsonDesert, (ShaderLayer) 3); - ChromaInitializer.RegisterShader("Hallow Desert", (ChromaShader) new DesertShader(new Color(29, 0, 56), new Color((int) byte.MaxValue, 221, (int) byte.MaxValue)), CommonConditions.UndergroundBiome.HallowDesert, (ShaderLayer) 3); - ChromaInitializer.RegisterShader("Pumpkin Moon", (ChromaShader) new MoonShader(new Color(13, 0, 26), Color.Orange), CommonConditions.Events.PumpkinMoon, (ShaderLayer) 4); - ChromaInitializer.RegisterShader("Blood Moon", (ChromaShader) new MoonShader(new Color(10, 0, 0), Color.Red, Color.Red, new Color((int) byte.MaxValue, 150, 125)), CommonConditions.Events.BloodMoon, (ShaderLayer) 4); - ChromaInitializer.RegisterShader("Frost Moon", (ChromaShader) new MoonShader(new Color(0, 4, 13), new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue)), CommonConditions.Events.FrostMoon, (ShaderLayer) 4); - ChromaInitializer.RegisterShader("Solar Eclipse", (ChromaShader) new MoonShader(new Color(0.02f, 0.02f, 0.02f), Color.Orange, Color.Black), CommonConditions.Events.SolarEclipse, (ShaderLayer) 4); - ChromaInitializer.RegisterShader("Pirate Invasion", (ChromaShader) new PirateInvasionShader(new Color(173, 173, 173), new Color(101, 101, (int) byte.MaxValue), Color.Blue, Color.Black), CommonConditions.Events.PirateInvasion, (ShaderLayer) 4); - ChromaInitializer.RegisterShader("DD2 Event", (ChromaShader) new DD2Shader(new Color(222, 94, 245), Color.White), CommonConditions.Events.DD2Event, (ShaderLayer) 4); - ChromaInitializer.RegisterShader("Goblin Army", (ChromaShader) new GoblinArmyShader(new Color(14, 0, 79), new Color(176, 0, 144)), CommonConditions.Events.GoblinArmy, (ShaderLayer) 4); - ChromaInitializer.RegisterShader("Frost Legion", (ChromaShader) new FrostLegionShader(Color.White, new Color(27, 80, 201)), CommonConditions.Events.FrostLegion, (ShaderLayer) 4); - ChromaInitializer.RegisterShader("Martian Madness", (ChromaShader) new MartianMadnessShader(new Color(64, 64, 64), new Color(64, 113, 122), new Color((int) byte.MaxValue, (int) byte.MaxValue, 0), new Color(3, 3, 18)), CommonConditions.Events.MartianMadness, (ShaderLayer) 4); - ChromaInitializer.RegisterShader("Solar Pillar", (ChromaShader) new PillarShader(Color.Red, Color.Orange), CommonConditions.Events.SolarPillar, (ShaderLayer) 4); - ChromaInitializer.RegisterShader("Nebula Pillar", (ChromaShader) new PillarShader(new Color((int) byte.MaxValue, 144, 209), new Color(100, 0, 76)), CommonConditions.Events.NebulaPillar, (ShaderLayer) 4); - ChromaInitializer.RegisterShader("Vortex Pillar", (ChromaShader) new PillarShader(Color.Green, Color.Black), CommonConditions.Events.VortexPillar, (ShaderLayer) 4); - ChromaInitializer.RegisterShader("Stardust Pillar", (ChromaShader) new PillarShader(new Color(46, 63, (int) byte.MaxValue), Color.White), CommonConditions.Events.StardustPillar, (ShaderLayer) 4); - ChromaInitializer.RegisterShader("Eater of Worlds", (ChromaShader) new WormShader(new Color(14, 0, 15), new Color(47, 51, 59), new Color(20, 25, 11)), CommonConditions.Boss.EaterOfWorlds, (ShaderLayer) 5); - ChromaInitializer.RegisterShader("Eye of Cthulhu", (ChromaShader) new EyeOfCthulhuShader(new Color(145, 145, 126), new Color(138, 0, 0), new Color(3, 3, 18)), CommonConditions.Boss.EyeOfCthulhu, (ShaderLayer) 5); - ChromaInitializer.RegisterShader("Skeletron", (ChromaShader) new SkullShader(new Color(110, 92, 47), new Color(36, 32, 51), new Color(0, 0, 0)), CommonConditions.Boss.Skeletron, (ShaderLayer) 5); - ChromaInitializer.RegisterShader("Brain Of Cthulhu", (ChromaShader) new BrainShader(new Color(54, 0, 0), new Color(186, 137, 139)), CommonConditions.Boss.BrainOfCthulhu, (ShaderLayer) 5); - ChromaInitializer.RegisterShader("Empress of Light", (ChromaShader) new EmpressShader(), CommonConditions.Boss.Empress, (ShaderLayer) 5); - ChromaInitializer.RegisterShader("Queen Slime", (ChromaShader) new QueenSlimeShader(new Color(72, 41, 130), new Color(126, 220, (int) byte.MaxValue)), CommonConditions.Boss.QueenSlime, (ShaderLayer) 5); - ChromaInitializer.RegisterShader("King Slime", (ChromaShader) new KingSlimeShader(new Color(41, 70, 130), Color.White), CommonConditions.Boss.KingSlime, (ShaderLayer) 5); - ChromaInitializer.RegisterShader("Queen Bee", (ChromaShader) new QueenBeeShader(new Color(5, 5, 0), new Color((int) byte.MaxValue, 235, 0)), CommonConditions.Boss.QueenBee, (ShaderLayer) 5); - ChromaInitializer.RegisterShader("Wall of Flesh", (ChromaShader) new WallOfFleshShader(new Color(112, 48, 60), new Color(5, 0, 0)), CommonConditions.Boss.WallOfFlesh, (ShaderLayer) 5); - ChromaInitializer.RegisterShader("Destroyer", (ChromaShader) new WormShader(new Color(25, 25, 25), new Color(192, 0, 0), new Color(10, 0, 0)), CommonConditions.Boss.Destroyer, (ShaderLayer) 5); - ChromaInitializer.RegisterShader("Skeletron Prime", (ChromaShader) new SkullShader(new Color(110, 92, 47), new Color(79, 0, 0), new Color((int) byte.MaxValue, 29, 0)), CommonConditions.Boss.SkeletronPrime, (ShaderLayer) 5); - ChromaInitializer.RegisterShader("The Twins", (ChromaShader) new TwinsShader(new Color(145, 145, 126), new Color(138, 0, 0), new Color(138, 0, 0), new Color(20, 20, 20), new Color(65, 140, 0), new Color(3, 3, 18)), CommonConditions.Boss.TheTwins, (ShaderLayer) 5); - ChromaInitializer.RegisterShader("Duke Fishron", (ChromaShader) new DukeFishronShader(new Color(0, 0, 122), new Color(100, 254, 194)), CommonConditions.Boss.DukeFishron, (ShaderLayer) 5); - ChromaInitializer.RegisterShader("Plantera", (ChromaShader) new PlanteraShader(new Color((int) byte.MaxValue, 0, 220), new Color(0, (int) byte.MaxValue, 0), new Color(12, 4, 0)), CommonConditions.Boss.Plantera, (ShaderLayer) 5); - ChromaInitializer.RegisterShader("Golem", (ChromaShader) new GolemShader(new Color((int) byte.MaxValue, 144, 0), new Color((int) byte.MaxValue, 198, 0), new Color(10, 10, 0)), CommonConditions.Boss.Golem, (ShaderLayer) 5); - ChromaInitializer.RegisterShader("Cultist", (ChromaShader) new CultistShader(), CommonConditions.Boss.Cultist, (ShaderLayer) 5); - ChromaInitializer.RegisterShader("Moon Lord", (ChromaShader) new EyeballShader(false), CommonConditions.Boss.MoonLord, (ShaderLayer) 5); - ChromaInitializer.RegisterShader("Rain", (ChromaShader) new RainShader(), CommonConditions.Weather.Rain, (ShaderLayer) 6); - ChromaInitializer.RegisterShader("Snowstorm", (ChromaShader) new BlizzardShader(), CommonConditions.Weather.Blizzard, (ShaderLayer) 6); - ChromaInitializer.RegisterShader("Sandstorm", (ChromaShader) new SandstormShader(), CommonConditions.Weather.Sandstorm, (ShaderLayer) 6); - ChromaInitializer.RegisterShader("Slime Rain", (ChromaShader) new SlimeRainShader(), CommonConditions.Weather.SlimeRain, (ShaderLayer) 6); - ChromaInitializer.RegisterShader("Drowning", (ChromaShader) new DrowningShader(), CommonConditions.Alert.Drowning, (ShaderLayer) 7); - ChromaInitializer.RegisterShader("Keybinds", (ChromaShader) new KeybindsMenuShader(), CommonConditions.Alert.Keybinds, (ShaderLayer) 7); - ChromaInitializer.RegisterShader("Lava Indicator", (ChromaShader) new LavaIndicatorShader(Color.Black, Color.Red, new Color((int) byte.MaxValue, 188, 0)), CommonConditions.Alert.LavaIndicator, (ShaderLayer) 7); - ChromaInitializer.RegisterShader("Moon Lord Spawn", (ChromaShader) new EyeballShader(true), CommonConditions.Alert.MoonlordComing, (ShaderLayer) 7); - ChromaInitializer.RegisterShader("Low Life", (ChromaShader) new LowLifeShader(), CommonConditions.CriticalAlert.LowLife, (ShaderLayer) 8); - ChromaInitializer.RegisterShader("Death", (ChromaShader) new DeathShader(new Color(36, 0, 10), new Color(158, 28, 53)), CommonConditions.CriticalAlert.Death, (ShaderLayer) 8); - } - - private static void RegisterShader( - string name, - ChromaShader shader, - ChromaCondition condition, - ShaderLayer layer) - { - ChromaInitializer._engine.RegisterShader(shader, condition, layer); - } - - [Conditional("DEBUG")] - private static void AddDebugDraw() - { - BasicDebugDrawer basicDebugDrawer = new BasicDebugDrawer(Main.instance.GraphicsDevice); - Filters.Scene.OnPostDraw += (Action) (() => { }); - } - } -} diff --git a/Initializers/DyeInitializer.cs b/Initializers/DyeInitializer.cs index b16a6c2..38cff87 100644 --- a/Initializers/DyeInitializer.cs +++ b/Initializers/DyeInitializer.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Initializers.DyeInitializer -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -9,7 +9,6 @@ using Microsoft.Xna.Framework.Graphics; using System; using Terraria.GameContent.Dyes; using Terraria.Graphics.Shaders; -using Terraria.ID; namespace Terraria.Initializers { @@ -106,7 +105,7 @@ namespace Terraria.Initializers GameShaders.Armor.BindShader(2884, new ArmorShaderData(pixelShaderRef, "ArmorWisp")).UseColor(1f, 0.0f, 1f).UseSecondaryColor(1f, 0.3f, 0.6f); GameShaders.Armor.BindShader(2883, new ArmorShaderData(pixelShaderRef, "ArmorHighContrastGlow")).UseColor(0.0f, 1f, 0.0f); GameShaders.Armor.BindShader(3025, new ArmorShaderData(pixelShaderRef, "ArmorFlow")).UseColor(1f, 0.5f, 1f).UseSecondaryColor(0.6f, 0.1f, 1f); - GameShaders.Armor.BindShader(3039, new TwilightDyeShaderData(pixelShaderRef, "ArmorTwilight")).UseImage("Images/Misc/noise").UseColor(0.5f, 0.1f, 1f); + GameShaders.Armor.BindShader(3039, new ArmorShaderData(pixelShaderRef, "ArmorTwilight")).UseImage("Images/Misc/noise").UseColor(0.5f, 0.1f, 1f); GameShaders.Armor.BindShader(3040, new ArmorShaderData(pixelShaderRef, "ArmorAcid")).UseColor(0.5f, 1f, 0.3f); GameShaders.Armor.BindShader(3041, new ArmorShaderData(pixelShaderRef, "ArmorMushroom")).UseColor(0.05f, 0.2f, 1f); GameShaders.Armor.BindShader(3042, new ArmorShaderData(pixelShaderRef, "ArmorPhase")).UseImage("Images/Misc/noise").UseColor(0.4f, 0.2f, 1.5f); @@ -114,13 +113,9 @@ namespace Terraria.Initializers GameShaders.Armor.BindShader(3561, new ArmorShaderData(pixelShaderRef, "ArmorGel")).UseImage("Images/Misc/noise").UseColor(0.4f, 0.7f, 1.4f).UseSecondaryColor(0.0f, 0.0f, 0.1f); GameShaders.Armor.BindShader(3562, new ArmorShaderData(pixelShaderRef, "ArmorGel")).UseImage("Images/Misc/noise").UseColor(1.4f, 0.75f, 1f).UseSecondaryColor(0.45f, 0.1f, 0.3f); GameShaders.Armor.BindShader(3024, new ArmorShaderData(pixelShaderRef, "ArmorGel")).UseImage("Images/Misc/noise").UseColor(-0.5f, -1f, 0.0f).UseSecondaryColor(1.5f, 1f, 2.2f); - GameShaders.Armor.BindShader(4663, new ArmorShaderData(pixelShaderRef, "ArmorGel")).UseImage("Images/Misc/noise").UseColor(2.6f, 0.6f, 0.6f).UseSecondaryColor(0.2f, -0.2f, -0.2f); - GameShaders.Armor.BindShader(4662, new ArmorShaderData(pixelShaderRef, "ArmorFog")).UseImage("Images/Misc/noise").UseColor(0.95f, 0.95f, 0.95f).UseSecondaryColor(0.3f, 0.3f, 0.3f); - GameShaders.Armor.BindShader(4778, new ArmorShaderData(pixelShaderRef, "ArmorHallowBoss")).UseImage("Images/Extra_" + (object) (short) 156); GameShaders.Armor.BindShader(3534, new ArmorShaderData(pixelShaderRef, "ArmorMirage")); GameShaders.Armor.BindShader(3028, new ArmorShaderData(pixelShaderRef, "ArmorAcid")).UseColor(0.5f, 0.7f, 1.5f); GameShaders.Armor.BindShader(3557, new ArmorShaderData(pixelShaderRef, "ArmorPolarized")); - GameShaders.Armor.BindShader(3978, new ArmorShaderData(pixelShaderRef, "ColorOnly")); GameShaders.Armor.BindShader(3038, new ArmorShaderData(pixelShaderRef, "ArmorHades")).UseColor(0.5f, 0.7f, 1.3f).UseSecondaryColor(0.5f, 0.7f, 1.3f); GameShaders.Armor.BindShader(3600, new ArmorShaderData(pixelShaderRef, "ArmorHades")).UseColor(0.7f, 0.4f, 1.5f).UseSecondaryColor(0.7f, 0.4f, 1.5f); GameShaders.Armor.BindShader(3597, new ArmorShaderData(pixelShaderRef, "ArmorHades")).UseColor(1.5f, 0.6f, 0.4f).UseSecondaryColor(1.5f, 0.6f, 0.4f); @@ -140,7 +135,7 @@ namespace Terraria.Initializers { Ref pixelShaderRef = Main.PixelShaderRef; DyeInitializer.LoadLegacyHairdyes(); - GameShaders.Hair.BindShader(3259, new TwilightHairDyeShaderData(pixelShaderRef, "ArmorTwilight")).UseImage("Images/Misc/noise").UseColor(0.5f, 0.1f, 1f); + GameShaders.Hair.BindShader(3259, new HairShaderData(pixelShaderRef, "ArmorTwilight")).UseImage("Images/Misc/noise").UseColor(0.5f, 0.1f, 1f); } private static void LoadLegacyHairdyes() @@ -344,9 +339,6 @@ namespace Terraria.Initializers case 10: color9 = new Color(208, 80, 80); break; - case 12: - color9 = new Color(230, 219, 100); - break; default: color9 = new Color(28, 216, 94); break; @@ -372,6 +364,33 @@ namespace Terraria.Initializers GameShaders.Hair.BindShader(1984, new LegacyHairShaderData().UseLegacyMethod((LegacyHairShaderData.ColorProcessingMethod) ((Player player, Color newColor, ref bool lighting) => { newColor = new Color(244, 22, 175); + if (!Main.gameMenu && !Main.gamePaused) + { + if (Main.rand.Next(45) == 0) + { + int Type = Main.rand.Next(139, 143); + int index = Dust.NewDust(player.position, player.width, 8, Type, Scale: 1.2f); + Main.dust[index].velocity.X *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); + Main.dust[index].velocity.Y *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); + Main.dust[index].velocity.X += (float) Main.rand.Next(-50, 51) * 0.01f; + Main.dust[index].velocity.Y += (float) Main.rand.Next(-50, 51) * 0.01f; + --Main.dust[index].velocity.Y; + Main.dust[index].scale *= (float) (0.699999988079071 + (double) Main.rand.Next(-30, 31) * 0.00999999977648258); + Main.dust[index].velocity += player.velocity * 0.2f; + } + if (Main.rand.Next(225) == 0) + { + int Type = Main.rand.Next(276, 283); + int index = Gore.NewGore(new Vector2(player.position.X + (float) Main.rand.Next(player.width), player.position.Y + (float) Main.rand.Next(8)), player.velocity, Type); + Main.gore[index].velocity.X *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); + Main.gore[index].velocity.Y *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); + Main.gore[index].scale *= (float) (1.0 + (double) Main.rand.Next(-20, 21) * 0.00999999977648258); + Main.gore[index].velocity.X += (float) Main.rand.Next(-50, 51) * 0.01f; + Main.gore[index].velocity.Y += (float) Main.rand.Next(-50, 51) * 0.01f; + --Main.gore[index].velocity.Y; + Main.gore[index].velocity += player.velocity * 0.2f; + } + } return newColor; }))); GameShaders.Hair.BindShader(1985, new LegacyHairShaderData().UseLegacyMethod((LegacyHairShaderData.ColorProcessingMethod) ((Player player, Color newColor, ref bool lighting) => @@ -410,42 +429,6 @@ namespace Terraria.Initializers GameShaders.Misc["WaterProcessor"] = new MiscShaderData(pixelShaderRef, "WaterProcessor"); GameShaders.Misc["WaterDistortionObject"] = new MiscShaderData(pixelShaderRef, "WaterDistortionObject"); GameShaders.Misc["WaterDebugDraw"] = new MiscShaderData(Main.ScreenShaderRef, "WaterDebugDraw"); - GameShaders.Misc["HallowBoss"] = new MiscShaderData(pixelShaderRef, "HallowBoss"); - GameShaders.Misc["HallowBoss"].UseImage1("Images/Extra_" + (object) (short) 156); - GameShaders.Misc["QueenSlime"] = new MiscShaderData(pixelShaderRef, "QueenSlime"); - GameShaders.Misc["QueenSlime"].UseImage1("Images/Extra_" + (object) (short) 180); - GameShaders.Misc["QueenSlime"].UseImage2("Images/Extra_" + (object) (short) 179); - int type = 3530; - bool[] flagArray = new bool[GameShaders.Armor.GetShaderIdFromItemId(type) + 1]; - for (int index = 0; index < flagArray.Length; ++index) - flagArray[index] = true; - foreach (int nonColorfulDyeItem in ItemID.Sets.NonColorfulDyeItems) - flagArray[GameShaders.Armor.GetShaderIdFromItemId(nonColorfulDyeItem)] = false; - ItemID.Sets.ColorfulDyeValues = flagArray; - DyeInitializer.LoadMiscVertexShaders(); - } - - private static void LoadMiscVertexShaders() - { - Ref vertexPixelShaderRef = Main.VertexPixelShaderRef; - GameShaders.Misc["MagicMissile"] = new MiscShaderData(vertexPixelShaderRef, "MagicMissile").UseProjectionMatrix(true); - GameShaders.Misc["MagicMissile"].UseImage0("Images/Extra_" + (object) (short) 192); - GameShaders.Misc["MagicMissile"].UseImage1("Images/Extra_" + (object) (short) 194); - GameShaders.Misc["MagicMissile"].UseImage2("Images/Extra_" + (object) (short) 193); - GameShaders.Misc["FlameLash"] = new MiscShaderData(vertexPixelShaderRef, "MagicMissile").UseProjectionMatrix(true); - GameShaders.Misc["FlameLash"].UseImage0("Images/Extra_" + (object) (short) 191); - GameShaders.Misc["FlameLash"].UseImage1("Images/Extra_" + (object) (short) 189); - GameShaders.Misc["FlameLash"].UseImage2("Images/Extra_" + (object) (short) 190); - GameShaders.Misc["RainbowRod"] = new MiscShaderData(vertexPixelShaderRef, "MagicMissile").UseProjectionMatrix(true); - GameShaders.Misc["RainbowRod"].UseImage0("Images/Extra_" + (object) (short) 195); - GameShaders.Misc["RainbowRod"].UseImage1("Images/Extra_" + (object) (short) 197); - GameShaders.Misc["RainbowRod"].UseImage2("Images/Extra_" + (object) (short) 196); - GameShaders.Misc["FinalFractal"] = new MiscShaderData(vertexPixelShaderRef, "FinalFractalVertex").UseProjectionMatrix(true); - GameShaders.Misc["FinalFractal"].UseImage0("Images/Extra_" + (object) (short) 195); - GameShaders.Misc["FinalFractal"].UseImage1("Images/Extra_" + (object) (short) 197); - GameShaders.Misc["EmpressBlade"] = new MiscShaderData(vertexPixelShaderRef, "FinalFractalVertex").UseProjectionMatrix(true); - GameShaders.Misc["EmpressBlade"].UseImage0("Images/Extra_" + (object) (short) 209); - GameShaders.Misc["EmpressBlade"].UseImage1("Images/Extra_" + (object) (short) 210); } public static void Load() diff --git a/Initializers/LaunchInitializer.cs b/Initializers/LaunchInitializer.cs index 5257fb2..9454530 100644 --- a/Initializers/LaunchInitializer.cs +++ b/Initializers/LaunchInitializer.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Initializers.LaunchInitializer -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System.Diagnostics; @@ -46,7 +46,7 @@ namespace Terraria.Initializers string str; if ((str = LaunchInitializer.TryParameter(strArray2)) != null) { - Netplay.ServerPassword = Main.ConvertFromSafeArgument(str); + Netplay.ServerPassword = str; game.AutoPass(); } if (!LaunchInitializer.HasParameter("-host")) @@ -119,7 +119,7 @@ namespace Terraria.Initializers }; string str1; if ((str1 = LaunchInitializer.TryParameter(strArray2)) != null) - Netplay.ServerPassword = Main.ConvertFromSafeArgument(str1); + Netplay.ServerPassword = str1; string[] strArray3 = new string[1]{ "-lang" }; string s2; int result2; @@ -144,40 +144,33 @@ namespace Terraria.Initializers if (LaunchInitializer.HasParameter("-autoshutdown")) game.EnableAutoShutdown(); if (LaunchInitializer.HasParameter("-secure")) - Netplay.SpamCheck = true; - string[] strArray8 = new string[1] - { - "-worldrollbackstokeep" - }; - string rollBacksToKeep; - if ((rollBacksToKeep = LaunchInitializer.TryParameter(strArray8)) != null) - game.setServerWorldRollbacks(rollBacksToKeep); - string[] strArray9 = new string[1]{ "-autocreate" }; + Netplay.spamCheck = true; + string[] strArray8 = new string[1]{ "-autocreate" }; string worldSize; - if ((worldSize = LaunchInitializer.TryParameter(strArray9)) != null) + if ((worldSize = LaunchInitializer.TryParameter(strArray8)) != null) game.autoCreate(worldSize); if (LaunchInitializer.HasParameter("-noupnp")) Netplay.UseUPNP = false; if (LaunchInitializer.HasParameter("-experimental")) Main.UseExperimentalFeatures = true; - string[] strArray10 = new string[1]{ "-world" }; + string[] strArray9 = new string[1]{ "-world" }; string world2; - if ((world2 = LaunchInitializer.TryParameter(strArray10)) != null) + if ((world2 = LaunchInitializer.TryParameter(strArray9)) != null) game.SetWorld(world2, false); else if (SocialAPI.Mode == SocialMode.Steam) { - string[] strArray11 = new string[1]{ "-cloudworld" }; + string[] strArray10 = new string[1]{ "-cloudworld" }; string world3; - if ((world3 = LaunchInitializer.TryParameter(strArray11)) != null) + if ((world3 = LaunchInitializer.TryParameter(strArray10)) != null) game.SetWorld(world3, true); } - string[] strArray12 = new string[1]{ "-config" }; + string[] strArray11 = new string[1]{ "-config" }; string configPath; - if ((configPath = LaunchInitializer.TryParameter(strArray12)) != null) + if ((configPath = LaunchInitializer.TryParameter(strArray11)) != null) game.LoadDedConfig(configPath); - string[] strArray13 = new string[1]{ "-seed" }; + string[] strArray12 = new string[1]{ "-seed" }; string str3; - if ((str3 = LaunchInitializer.TryParameter(strArray13)) == null) + if ((str3 = LaunchInitializer.TryParameter(strArray12)) == null) return; Main.AutogenSeedName = str3; } diff --git a/Initializers/NetworkInitializer.cs b/Initializers/NetworkInitializer.cs index e2bfdd6..fa8fb0d 100644 --- a/Initializers/NetworkInitializer.cs +++ b/Initializers/NetworkInitializer.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Initializers.NetworkInitializer -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Terraria.GameContent.NetModules; @@ -15,15 +15,6 @@ namespace Terraria.Initializers { NetManager.Instance.Register(); NetManager.Instance.Register(); - NetManager.Instance.Register(); - NetManager.Instance.Register(); - NetManager.Instance.Register(); - NetManager.Instance.Register(); - NetManager.Instance.Register(); - NetManager.Instance.Register(); - NetManager.Instance.Register(); - NetManager.Instance.Register(); - NetManager.Instance.Register(); } } } diff --git a/Initializers/PlayerDataInitializer.cs b/Initializers/PlayerDataInitializer.cs index 03bb9b2..1746483 100644 --- a/Initializers/PlayerDataInitializer.cs +++ b/Initializers/PlayerDataInitializer.cs @@ -1,12 +1,11 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Initializers.PlayerDataInitializer -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria.GameContent; +using Terraria.Graphics; namespace Terraria.Initializers { @@ -14,7 +13,7 @@ namespace Terraria.Initializers { public static void Load() { - TextureAssets.Players = new Asset[12, 16]; + Main.playerTextures = new Texture2D[10, 15]; PlayerDataInitializer.LoadStarterMale(); PlayerDataInitializer.LoadStarterFemale(); PlayerDataInitializer.LoadStickerMale(); @@ -25,25 +24,38 @@ namespace Terraria.Initializers PlayerDataInitializer.LoadDressFemale(); PlayerDataInitializer.LoadDressMale(); PlayerDataInitializer.LoadCoatFemale(); - PlayerDataInitializer.LoadDisplayDollMale(); - PlayerDataInitializer.LoadDisplayDollFemale(); + } + + private static void LoadDebugs() + { + PlayerDataInitializer.CopyVariant(8, 0); + PlayerDataInitializer.CopyVariant(9, 4); + for (int index = 8; index < 10; ++index) + { + Main.playerTextures[index, 4] = Main.armorArmTexture[191]; + Main.playerTextures[index, 6] = Main.armorArmTexture[191]; + Main.playerTextures[index, 11] = Main.armorArmTexture[191]; + Main.playerTextures[index, 12] = Main.armorArmTexture[191]; + Main.playerTextures[index, 13] = Main.armorArmTexture[191]; + Main.playerTextures[index, 8] = Main.armorArmTexture[191]; + } } private static void LoadVariant(int ID, int[] pieceIDs) { for (int index = 0; index < pieceIDs.Length; ++index) - TextureAssets.Players[ID, pieceIDs[index]] = Main.Assets.Request("Images/Player_" + (object) ID + "_" + (object) pieceIDs[index], (AssetRequestMode) 2); + Main.playerTextures[ID, pieceIDs[index]] = TextureManager.Load("Images/Player_" + (object) ID + "_" + (object) pieceIDs[index]); } private static void CopyVariant(int to, int from) { - for (int index = 0; index < 16; ++index) - TextureAssets.Players[to, index] = TextureAssets.Players[from, index]; + for (int index = 0; index < 15; ++index) + Main.playerTextures[to, index] = Main.playerTextures[from, index]; } private static void LoadStarterMale() { - PlayerDataInitializer.LoadVariant(0, new int[15] + PlayerDataInitializer.LoadVariant(0, new int[14] { 0, 1, @@ -58,10 +70,9 @@ namespace Terraria.Initializers 10, 11, 12, - 13, - 15 + 13 }); - TextureAssets.Players[0, 14] = (Asset) Asset.Empty; + Main.playerTextures[0, 14] = TextureManager.BlankTexture; } private static void LoadStickerMale() @@ -197,53 +208,5 @@ namespace Terraria.Initializers 13 }); } - - private static void LoadDisplayDollMale() - { - PlayerDataInitializer.CopyVariant(10, 0); - PlayerDataInitializer.LoadVariant(10, new int[7] - { - 0, - 2, - 3, - 5, - 7, - 9, - 10 - }); - Asset player = TextureAssets.Players[10, 2]; - TextureAssets.Players[10, 2] = player; - TextureAssets.Players[10, 1] = player; - TextureAssets.Players[10, 4] = player; - TextureAssets.Players[10, 6] = player; - TextureAssets.Players[10, 11] = player; - TextureAssets.Players[10, 12] = player; - TextureAssets.Players[10, 13] = player; - TextureAssets.Players[10, 8] = player; - TextureAssets.Players[10, 15] = player; - } - - private static void LoadDisplayDollFemale() - { - PlayerDataInitializer.CopyVariant(11, 10); - PlayerDataInitializer.LoadVariant(11, new int[5] - { - 3, - 5, - 7, - 9, - 10 - }); - Asset player = TextureAssets.Players[10, 2]; - TextureAssets.Players[11, 2] = player; - TextureAssets.Players[11, 1] = player; - TextureAssets.Players[11, 4] = player; - TextureAssets.Players[11, 6] = player; - TextureAssets.Players[11, 11] = player; - TextureAssets.Players[11, 12] = player; - TextureAssets.Players[11, 13] = player; - TextureAssets.Players[11, 8] = player; - TextureAssets.Players[11, 15] = player; - } } } diff --git a/Initializers/ScreenEffectInitializer.cs b/Initializers/ScreenEffectInitializer.cs index e27f7c3..7f06787 100644 --- a/Initializers/ScreenEffectInitializer.cs +++ b/Initializers/ScreenEffectInitializer.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Initializers.ScreenEffectInitializer -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -16,18 +16,16 @@ namespace Terraria.Initializers { public static void Load() { - Filters.Scene["Nebula"] = new Filter(new ScreenShaderData("FilterTower").UseColor(1f, 0.0f, 0.9f).UseOpacity(0.35f), EffectPriority.High); + Filters.Scene["Nebula"] = new Filter(new ScreenShaderData("FilterTower").UseColor(1f, 0.0f, 0.9f).UseOpacity(0.5f), EffectPriority.High); Filters.Scene["Solar"] = new Filter(new ScreenShaderData("FilterTower").UseColor(1f, 0.7f, 0.0f).UseOpacity(0.3f), EffectPriority.High); Filters.Scene["Stardust"] = new Filter(new ScreenShaderData("FilterTower").UseColor(0.0f, 0.5f, 1f).UseOpacity(0.5f), EffectPriority.High); Filters.Scene["Vortex"] = new Filter(new ScreenShaderData("FilterTower").UseColor(0.0f, 0.7f, 0.7f).UseOpacity(0.5f), EffectPriority.High); - Filters.Scene["MonolithNebula"] = new Filter(new ScreenShaderData("FilterMiniTower").UseColor(1f, 0.0f, 0.9f).UseOpacity(0.35f), EffectPriority.Medium); + Filters.Scene["MonolithNebula"] = new Filter(new ScreenShaderData("FilterMiniTower").UseColor(1f, 0.0f, 0.9f).UseOpacity(0.5f), EffectPriority.Medium); Filters.Scene["MonolithSolar"] = new Filter(new ScreenShaderData("FilterMiniTower").UseColor(1f, 0.7f, 0.0f).UseOpacity(0.3f), EffectPriority.Medium); Filters.Scene["MonolithStardust"] = new Filter(new ScreenShaderData("FilterMiniTower").UseColor(0.0f, 0.5f, 1f).UseOpacity(0.5f), EffectPriority.Medium); Filters.Scene["MonolithVortex"] = new Filter(new ScreenShaderData("FilterMiniTower").UseColor(0.0f, 0.7f, 0.7f).UseOpacity(0.5f), EffectPriority.Medium); - Filters.Scene["MoonLord"] = new Filter((ScreenShaderData) new MoonLordScreenShaderData("FilterMoonLord", false), EffectPriority.VeryHigh); - Filters.Scene["MoonLordShake"] = new Filter((ScreenShaderData) new MoonLordScreenShaderData("FilterMoonLordShake", false), EffectPriority.VeryHigh); - Filters.Scene["MonolithMoonLord"] = new Filter((ScreenShaderData) new MoonLordScreenShaderData("FilterMoonLord", true), EffectPriority.Medium); - Filters.Scene["Graveyard"] = new Filter(new ScreenShaderData("FilterGraveyard"), EffectPriority.Medium); + Filters.Scene["MoonLord"] = new Filter((ScreenShaderData) new MoonLordScreenShaderData("FilterMoonLord"), EffectPriority.VeryHigh); + Filters.Scene["MoonLordShake"] = new Filter((ScreenShaderData) new MoonLordScreenShaderData("FilterMoonLordShake"), EffectPriority.VeryHigh); Filters.Scene["testInvert"] = new Filter(new ScreenShaderData("FilterInvert"), EffectPriority.VeryHigh); Filters.Scene["BloodMoon"] = new Filter(new BloodMoonScreenShaderData("FilterBloodMoon").UseColor(2f, -0.8f, -0.6f), EffectPriority.Medium); Filters.Scene["Sandstorm"] = new Filter(new SandstormShaderData("FilterSandstormForeground").UseColor(1.1f, 1f, 0.5f).UseSecondaryColor(0.7f, 0.5f, 0.3f).UseImage("Images/Misc/noise").UseIntensity(0.4f), EffectPriority.High); @@ -41,7 +39,6 @@ namespace Terraria.Initializers Filters.Scene["CrystalWin"] = new Filter(new ScreenShaderData("FilterCrystalWin"), EffectPriority.VeryHigh); Filters.Scene["Test"] = new Filter(new ScreenShaderData("FilterTest"), EffectPriority.VeryHigh); Filters.Scene["Test2"] = new Filter(new ScreenShaderData("FilterTest2"), EffectPriority.VeryHigh); - Filters.Scene["Test3"] = new Filter(new ScreenShaderData("FilterTest3").UseImage("Images/Extra_" + (object) (short) 156), EffectPriority.VeryHigh); Overlays.Scene.Load(); Filters.Scene.Load(); ScreenEffectInitializer.LoadSkies(); @@ -56,17 +53,13 @@ namespace Terraria.Initializers SkyManager.Instance["Vortex"] = (CustomSky) new VortexSky(); SkyManager.Instance["Solar"] = (CustomSky) new SolarSky(); SkyManager.Instance["Slime"] = (CustomSky) new SlimeSky(); - SkyManager.Instance["MoonLord"] = (CustomSky) new MoonLordSky(false); - SkyManager.Instance["CreditsRoll"] = (CustomSky) new CreditsRollSky(); + SkyManager.Instance["MoonLord"] = (CustomSky) new MoonLordSky(); SkyManager.Instance["MonolithNebula"] = (CustomSky) new NebulaSky(); SkyManager.Instance["MonolithStardust"] = (CustomSky) new StardustSky(); SkyManager.Instance["MonolithVortex"] = (CustomSky) new VortexSky(); SkyManager.Instance["MonolithSolar"] = (CustomSky) new SolarSky(); - SkyManager.Instance["MonolithMoonLord"] = (CustomSky) new MoonLordSky(true); SkyManager.Instance["Sandstorm"] = (CustomSky) new SandstormSky(); SkyManager.Instance["Blizzard"] = (CustomSky) new BlizzardSky(); - SkyManager.Instance["Ambience"] = (CustomSky) new AmbientSky(); - SkyManager.Instance["Lantern"] = (CustomSky) new LanternSky(); SkyManager.Instance.Load(); } } diff --git a/Initializers/UILinksInitializer.cs b/Initializers/UILinksInitializer.cs index 5e14406..8f4d729 100644 --- a/Initializers/UILinksInitializer.cs +++ b/Initializers/UILinksInitializer.cs @@ -1,14 +1,11 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Initializers.UILinksInitializer -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using System; -using Terraria.Audio; -using Terraria.DataStructures; -using Terraria.GameContent.Tile_Entities; using Terraria.GameContent.UI.States; using Terraria.GameInput; using Terraria.UI; @@ -20,7 +17,7 @@ namespace Terraria.Initializers { public static bool NothingMoreImportantThanNPCChat() => !Main.hairWindow && Main.npcShop == 0 && Main.player[Main.myPlayer].chest == -1; - public static float HandleSliderHorizontalInput( + public static float HandleSlider( float currentValue, float min, float max, @@ -32,18 +29,6 @@ namespace Terraria.Initializers return MathHelper.Clamp((float) (((double) currentValue - (double) min) / ((double) max - (double) min)) + num, 0.0f, 1f) * (max - min) + min; } - public static float HandleSliderVerticalInput( - float currentValue, - float min, - float max, - float deadZone = 0.2f, - float sensitivity = 0.5f) - { - float num1 = -PlayerInput.GamepadThumbstickLeft.Y; - float num2 = (double) num1 < -(double) deadZone || (double) num1 > (double) deadZone ? MathHelper.Lerp(0.0f, sensitivity / 60f, (float) (((double) Math.Abs(num1) - (double) deadZone) / (1.0 - (double) deadZone))) * (float) Math.Sign(num1) : 0.0f; - return MathHelper.Clamp((float) (((double) currentValue - (double) min) / ((double) max - (double) min)) + num2, 0.0f, 1f) * (max - min) + min; - } - public static void Load() { Func func1 = (Func) (() => PlayerInput.BuildCommand(Lang.misc[53].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"])); @@ -65,16 +50,8 @@ namespace Terraria.Initializers UILinkPage cp1 = new UILinkPage(); cp1.LinkMap.Add(2500, new UILinkPoint(2500, true, -3, 2501, -1, -2)); cp1.LinkMap.Add(2501, new UILinkPoint(2501, true, 2500, 2502, -1, -2)); - cp1.LinkMap.Add(2502, new UILinkPoint(2502, true, 2501, 2503, -1, -2)); - cp1.LinkMap.Add(2503, new UILinkPoint(2503, true, 2502, -4, -1, -2)); - cp1.UpdateEvent += (Action) (() => - { - cp1.LinkMap[2501].Right = UILinkPointNavigator.Shortcuts.NPCCHAT_ButtonsRight ? 2502 : -4; - if (cp1.LinkMap[2501].Right == -4 && UILinkPointNavigator.Shortcuts.NPCCHAT_ButtonsRight2) - cp1.LinkMap[2501].Right = 2503; - cp1.LinkMap[2502].Right = UILinkPointNavigator.Shortcuts.NPCCHAT_ButtonsRight2 ? 2503 : -4; - cp1.LinkMap[2503].Left = UILinkPointNavigator.Shortcuts.NPCCHAT_ButtonsRight ? 2502 : 2501; - }); + cp1.LinkMap.Add(2502, new UILinkPoint(2502, true, 2501, -4, -1, -2)); + cp1.UpdateEvent += (Action) (() => cp1.LinkMap[2501].Right = UILinkPointNavigator.Shortcuts.NPCCHAT_ButtonsRight ? 2502 : -4); cp1.OnSpecialInteracts += (Func) (() => PlayerInput.BuildCommand(Lang.misc[53].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]) + PlayerInput.BuildCommand(Lang.misc[56].Value, true, PlayerInput.ProfileGamepadUI.KeyStatus["Inventory"])); cp1.IsValidEvent += (Func) (() => (Main.player[Main.myPlayer].talkNPC != -1 || Main.player[Main.myPlayer].sign != -1) && UILinksInitializer.NothingMoreImportantThanNPCChat()); cp1.CanEnterEvent += (Func) (() => (Main.player[Main.myPlayer].talkNPC != -1 || Main.player[Main.myPlayer].sign != -1) && UILinksInitializer.NothingMoreImportantThanNPCChat()); @@ -82,7 +59,7 @@ namespace Terraria.Initializers cp1.LeaveEvent += (Action) (() => { Main.npcChatRelease = false; - Main.player[Main.myPlayer].LockGamepadTileInteractions(); + Main.player[Main.myPlayer].releaseUseTile = false; }); UILinkPointNavigator.RegisterPage(cp1, 1003); UILinkPage cp2 = new UILinkPage(); @@ -118,97 +95,63 @@ namespace Terraria.Initializers cp2.LinkMap[20].Left = 55; cp2.LinkMap[30].Left = 56; cp2.LinkMap[40].Left = 57; - cp2.LinkMap.Add(300, new UILinkPoint(300, true, 309, 310, 49, -2)); - cp2.LinkMap.Add(309, new UILinkPoint(309, true, 310, 300, 302, 54)); - cp2.LinkMap.Add(310, new UILinkPoint(310, true, 300, 309, 301, 50)); + cp2.LinkMap.Add(300, new UILinkPoint(300, true, 302, 301, 49, -2)); cp2.LinkMap.Add(301, new UILinkPoint(301, true, 300, 302, 53, 50)); - cp2.LinkMap.Add(302, new UILinkPoint(302, true, 301, 310, 57, 54)); - cp2.LinkMap.Add(311, new UILinkPoint(311, true, -3, -4, 40, -2)); + cp2.LinkMap.Add(302, new UILinkPoint(302, true, 301, 300, 57, 54)); cp2.LinkMap[301].OnSpecialInteracts += func1; cp2.LinkMap[302].OnSpecialInteracts += func1; - cp2.LinkMap[309].OnSpecialInteracts += func1; - cp2.LinkMap[310].OnSpecialInteracts += func1; cp2.LinkMap[300].OnSpecialInteracts += func3; cp2.UpdateEvent += (Action) (() => { bool inReforgeMenu = Main.InReforgeMenu; bool flag1 = Main.player[Main.myPlayer].chest != -1; bool flag2 = (uint) Main.npcShop > 0U; - TileEntity tileEntity = Main.LocalPlayer.tileEntityAnchor.GetTileEntity(); - bool flag3 = tileEntity is TEHatRack; - bool flag4 = tileEntity is TEDisplayDoll; for (int key = 40; key <= 49; ++key) - cp2.LinkMap[key].Down = !inReforgeMenu ? (!flag1 ? (!flag2 ? (key != 40 ? -2 : 311) : 2700 + key - 40) : 400 + key - 40) : (key < 45 ? 303 : 304); - if (flag4) - { - for (int key = 40; key <= 47; ++key) - cp2.LinkMap[key].Down = 5100 + key - 40; - } - if (flag3) - { - for (int key = 44; key <= 45; ++key) - cp2.LinkMap[key].Down = 5000 + key - 44; - } + cp2.LinkMap[key].Down = !inReforgeMenu ? (!flag1 ? (!flag2 ? -2 : 2700 + key - 40) : 400 + key - 40) : (key < 45 ? 303 : 304); if (flag1) { cp2.LinkMap[300].Up = 439; cp2.LinkMap[300].Right = -4; - cp2.LinkMap[300].Left = 309; - cp2.LinkMap[309].Up = 438; - cp2.LinkMap[309].Right = 300; - cp2.LinkMap[309].Left = 310; - cp2.LinkMap[310].Up = 437; - cp2.LinkMap[310].Right = 309; - cp2.LinkMap[310].Left = -3; + cp2.LinkMap[300].Left = -3; } else if (flag2) { cp2.LinkMap[300].Up = 2739; cp2.LinkMap[300].Right = -4; - cp2.LinkMap[300].Left = 309; - cp2.LinkMap[309].Up = 2738; - cp2.LinkMap[309].Right = 300; - cp2.LinkMap[309].Left = 310; - cp2.LinkMap[310].Up = 2737; - cp2.LinkMap[310].Right = 309; - cp2.LinkMap[310].Left = -3; + cp2.LinkMap[300].Left = -3; } else { - cp2.LinkMap[49].Down = 300; - cp2.LinkMap[48].Down = 309; - cp2.LinkMap[47].Down = 310; cp2.LinkMap[300].Up = 49; cp2.LinkMap[300].Right = 301; - cp2.LinkMap[300].Left = 309; - cp2.LinkMap[309].Up = 48; - cp2.LinkMap[309].Right = 300; - cp2.LinkMap[309].Left = 310; - cp2.LinkMap[310].Up = 47; - cp2.LinkMap[310].Right = 309; - cp2.LinkMap[310].Left = 302; + cp2.LinkMap[300].Left = 302; + cp2.LinkMap[49].Down = 300; } - cp2.LinkMap[0].Left = 9; cp2.LinkMap[10].Left = 54; cp2.LinkMap[20].Left = 55; cp2.LinkMap[30].Left = 56; cp2.LinkMap[40].Left = 57; - if (UILinkPointNavigator.Shortcuts.BUILDERACCCOUNT > 0) - cp2.LinkMap[0].Left = 6000; - if (UILinkPointNavigator.Shortcuts.BUILDERACCCOUNT > 2) - cp2.LinkMap[10].Left = 6002; - if (UILinkPointNavigator.Shortcuts.BUILDERACCCOUNT > 4) - cp2.LinkMap[20].Left = 6004; - if (UILinkPointNavigator.Shortcuts.BUILDERACCCOUNT > 6) - cp2.LinkMap[30].Left = 6006; if (UILinkPointNavigator.Shortcuts.BUILDERACCCOUNT > 8) - cp2.LinkMap[40].Left = 6008; - cp2.PageOnLeft = 9; - if (Main.CreativeMenu.Enabled) - cp2.PageOnLeft = 1005; - if (!Main.InReforgeMenu) - return; - cp2.PageOnLeft = 5; + { + cp2.LinkMap[0].Left = 4000; + cp2.LinkMap[10].Left = 4002; + cp2.LinkMap[20].Left = 4004; + cp2.LinkMap[30].Left = 4006; + cp2.LinkMap[40].Left = 4008; + } + else + { + cp2.LinkMap[0].Left = 9; + if (UILinkPointNavigator.Shortcuts.BUILDERACCCOUNT > 0) + cp2.LinkMap[10].Left = 4000; + if (UILinkPointNavigator.Shortcuts.BUILDERACCCOUNT > 2) + cp2.LinkMap[20].Left = 4002; + if (UILinkPointNavigator.Shortcuts.BUILDERACCCOUNT > 4) + cp2.LinkMap[30].Left = 4004; + if (UILinkPointNavigator.Shortcuts.BUILDERACCCOUNT > 6) + cp2.LinkMap[40].Left = 4006; + } + cp2.PageOnLeft = Main.InReforgeMenu ? 5 : 9; }); cp2.IsValidEvent += (Func) (() => Main.playerInventory); cp2.PageOnLeft = 9; @@ -334,30 +277,27 @@ namespace Terraria.Initializers uiLinkPoint.Down = 308; uiLinkPoint.Left = 1557; } - if (num == 8) - uiLinkPoint.Left = 1570; cp5.LinkMap.Add(index, uiLinkPoint); } cp5.IsValidEvent += (Func) (() => Main.playerInventory && Main.EquipPage == 0); cp5.UpdateEvent += (Action) (() => { int num1 = 107; - int accessorySlotsToShow = Main.player[Main.myPlayer].GetAmountOfExtraAccessorySlotsToShow(); - for (int index = 0; index < accessorySlotsToShow; ++index) + int extraAccessorySlots = Main.player[Main.myPlayer].extraAccessorySlots; + for (int index = 0; index < extraAccessorySlots; ++index) { cp5.LinkMap[num1 + index].Down = num1 + index + 1; cp5.LinkMap[num1 - 100 + 120 + index].Down = num1 - 100 + 120 + index + 1; cp5.LinkMap[num1 + 10 + index].Down = num1 + 10 + index + 1; } - cp5.LinkMap[num1 + accessorySlotsToShow].Down = 308; - cp5.LinkMap[num1 + 10 + accessorySlotsToShow].Down = 308; - cp5.LinkMap[num1 - 100 + 120 + accessorySlotsToShow].Down = 308; + cp5.LinkMap[num1 + extraAccessorySlots].Down = 308; + cp5.LinkMap[num1 - 100 + 120 + extraAccessorySlots].Down = 308; + cp5.LinkMap[num1 + 10 + extraAccessorySlots].Down = 308; bool shouldPvpDraw = Main.ShouldPVPDraw; for (int key = 120; key <= 129; ++key) { UILinkPoint link = cp5.LinkMap[key]; int num2 = key - 120; - link.Left = -3; if (num2 == 0) link.Left = shouldPvpDraw ? 1550 : -3; if (num2 == 1) @@ -370,9 +310,9 @@ namespace Terraria.Initializers link.Left = UILinkPointNavigator.Shortcuts.INFOACCCOUNT >= 5 ? 1562 : -3; if (num2 == 5) link.Left = UILinkPointNavigator.Shortcuts.INFOACCCOUNT >= 9 ? 1566 : -3; + if (num2 == 7) + link.Left = shouldPvpDraw ? 1557 : -3; } - cp5.LinkMap[num1 - 100 + 120 + accessorySlotsToShow].Left = 1557; - cp5.LinkMap[num1 - 100 + 120 + accessorySlotsToShow - 1].Left = 1570; }); cp5.PageOnLeft = 8; cp5.PageOnRight = 8; @@ -386,9 +326,6 @@ namespace Terraria.Initializers Item[] inv = Main.player[Main.myPlayer].bank.item; switch (Main.player[Main.myPlayer].chest) { - case -5: - inv = Main.player[Main.myPlayer].bank4.item; - goto case -2; case -4: inv = Main.player[Main.myPlayer].bank3.item; goto case -2; @@ -426,93 +363,33 @@ namespace Terraria.Initializers page2.LinkMap.Add(503, new UILinkPoint(503, true, 439, -4, 502, 505)); page2.LinkMap.Add(505, new UILinkPoint(505, true, 439, -4, 503, 504)); page2.LinkMap.Add(504, new UILinkPoint(504, true, 439, -4, 505, 50)); - page2.LinkMap.Add(506, new UILinkPoint(506, true, 439, -4, 505, 50)); page2.LinkMap[500].OnSpecialInteracts += func1; page2.LinkMap[501].OnSpecialInteracts += func1; page2.LinkMap[502].OnSpecialInteracts += func1; page2.LinkMap[503].OnSpecialInteracts += func1; page2.LinkMap[504].OnSpecialInteracts += func1; page2.LinkMap[505].OnSpecialInteracts += func1; - page2.LinkMap[506].OnSpecialInteracts += func1; page2.LinkMap[409].Right = 500; page2.LinkMap[419].Right = 501; page2.LinkMap[429].Right = 502; page2.LinkMap[439].Right = 503; page2.LinkMap[439].Down = 300; - page2.LinkMap[438].Down = 309; - page2.LinkMap[437].Down = 310; page2.PageOnLeft = 0; page2.PageOnRight = 0; - page2.DefaultPoint = 400; + page2.DefaultPoint = 500; UILinkPointNavigator.RegisterPage(page2, 4, false); page2.IsValidEvent += (Func) (() => Main.playerInventory && Main.player[Main.myPlayer].chest != -1); UILinkPage page3 = new UILinkPage(); page3.OnSpecialInteracts += (Func) (() => PlayerInput.BuildCommand(Lang.misc[56].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Inventory"]) + PlayerInput.BuildCommand(Lang.misc[64].Value, true, PlayerInput.ProfileGamepadUI.KeyStatus["HotbarMinus"], PlayerInput.ProfileGamepadUI.KeyStatus["HotbarPlus"])); Func func9 = (Func) (() => { - int slot = UILinkPointNavigator.CurrentPoint - 5100; - return !(Main.LocalPlayer.tileEntityAnchor.GetTileEntity() is TEDisplayDoll tileEntity2) ? "" : tileEntity2.GetItemGamepadInstructions(slot); - }); - for (int index = 5100; index <= 5115; ++index) - { - UILinkPoint uiLinkPoint = new UILinkPoint(index, true, index - 1, index + 1, index - 8, index + 8); - uiLinkPoint.OnSpecialInteracts += func9; - int num = index - 5100; - if (num < 8) - uiLinkPoint.Up = 40 + num; - if (num >= 8) - uiLinkPoint.Down = -2; - if (num % 8 == 7) - uiLinkPoint.Right = -4; - if (num % 8 == 0) - uiLinkPoint.Left = -3; - page3.LinkMap.Add(index, uiLinkPoint); - } - page3.PageOnLeft = 0; - page3.PageOnRight = 0; - page3.DefaultPoint = 5100; - UILinkPointNavigator.RegisterPage(page3, 20, false); - page3.IsValidEvent += (Func) (() => Main.playerInventory && Main.LocalPlayer.tileEntityAnchor.GetTileEntity() is TEDisplayDoll); - UILinkPage page4 = new UILinkPage(); - page4.OnSpecialInteracts += (Func) (() => PlayerInput.BuildCommand(Lang.misc[56].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Inventory"]) + PlayerInput.BuildCommand(Lang.misc[64].Value, true, PlayerInput.ProfileGamepadUI.KeyStatus["HotbarMinus"], PlayerInput.ProfileGamepadUI.KeyStatus["HotbarPlus"])); - Func func10 = (Func) (() => - { - int slot = UILinkPointNavigator.CurrentPoint - 5000; - return !(Main.LocalPlayer.tileEntityAnchor.GetTileEntity() is TEHatRack tileEntity4) ? "" : tileEntity4.GetItemGamepadInstructions(slot); - }); - for (int index = 5000; index <= 5003; ++index) - { - UILinkPoint uiLinkPoint = new UILinkPoint(index, true, index - 1, index + 1, index - 2, index + 2); - uiLinkPoint.OnSpecialInteracts += func10; - int num = index - 5000; - if (num < 2) - uiLinkPoint.Up = 44 + num; - if (num >= 2) - uiLinkPoint.Down = -2; - if (num % 2 == 1) - uiLinkPoint.Right = -4; - if (num % 2 == 0) - uiLinkPoint.Left = -3; - page4.LinkMap.Add(index, uiLinkPoint); - } - page4.PageOnLeft = 0; - page4.PageOnRight = 0; - page4.DefaultPoint = 5000; - UILinkPointNavigator.RegisterPage(page4, 21, false); - page4.IsValidEvent += (Func) (() => Main.playerInventory && Main.LocalPlayer.tileEntityAnchor.GetTileEntity() is TEHatRack); - UILinkPage page5 = new UILinkPage(); - page5.OnSpecialInteracts += (Func) (() => PlayerInput.BuildCommand(Lang.misc[56].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Inventory"]) + PlayerInput.BuildCommand(Lang.misc[64].Value, true, PlayerInput.ProfileGamepadUI.KeyStatus["HotbarMinus"], PlayerInput.ProfileGamepadUI.KeyStatus["HotbarPlus"])); - Func func11 = (Func) (() => - { - if (Main.npcShop == 0) - return ""; int slot = UILinkPointNavigator.CurrentPoint - 2700; return ItemSlot.GetGamepadInstructions(Main.instance.shop[Main.npcShop].item, 15, slot); }); for (int index = 2700; index <= 2739; ++index) { UILinkPoint uiLinkPoint = new UILinkPoint(index, true, index - 1, index + 1, index - 10, index + 10); - uiLinkPoint.OnSpecialInteracts += func11; + uiLinkPoint.OnSpecialInteracts += func9; int num = index - 2700; if (num < 10) uiLinkPoint.Up = 40 + num; @@ -522,21 +399,19 @@ namespace Terraria.Initializers uiLinkPoint.Right = -4; if (num % 10 == 0) uiLinkPoint.Left = -3; - page5.LinkMap.Add(index, uiLinkPoint); + page3.LinkMap.Add(index, uiLinkPoint); } - page5.LinkMap[2739].Down = 300; - page5.LinkMap[2738].Down = 309; - page5.LinkMap[2737].Down = 310; - page5.PageOnLeft = 0; - page5.PageOnRight = 0; - UILinkPointNavigator.RegisterPage(page5, 13); - page5.IsValidEvent += (Func) (() => Main.playerInventory && (uint) Main.npcShop > 0U); + page3.LinkMap[2739].Down = 300; + page3.PageOnLeft = 0; + page3.PageOnRight = 0; + UILinkPointNavigator.RegisterPage(page3, 13); + page3.IsValidEvent += (Func) (() => Main.playerInventory && (uint) Main.npcShop > 0U); UILinkPage cp6 = new UILinkPage(); cp6.LinkMap.Add(303, new UILinkPoint(303, true, 304, 304, 40, -2)); cp6.LinkMap.Add(304, new UILinkPoint(304, true, 303, 303, 40, -2)); cp6.OnSpecialInteracts += (Func) (() => PlayerInput.BuildCommand(Lang.misc[56].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Inventory"]) + PlayerInput.BuildCommand(Lang.misc[64].Value, true, PlayerInput.ProfileGamepadUI.KeyStatus["HotbarMinus"], PlayerInput.ProfileGamepadUI.KeyStatus["HotbarPlus"])); - Func func12 = (Func) (() => ItemSlot.GetGamepadInstructions(ref Main.reforgeItem, 5)); - cp6.LinkMap[303].OnSpecialInteracts += func12; + Func func10 = (Func) (() => ItemSlot.GetGamepadInstructions(ref Main.reforgeItem, 5)); + cp6.LinkMap[303].OnSpecialInteracts += func10; cp6.LinkMap[304].OnSpecialInteracts += (Func) (() => Lang.misc[53].Value); cp6.UpdateEvent += (Action) (() => { @@ -559,42 +434,24 @@ namespace Terraria.Initializers UILinkPage cp7 = new UILinkPage(); cp7.OnSpecialInteracts += (Func) (() => { - bool flag5 = UILinkPointNavigator.CurrentPoint == 600; - bool flag6 = !flag5 && WorldGen.IsNPCEvictable(UILinkPointNavigator.Shortcuts.NPCS_LastHovered); if (PlayerInput.Triggers.JustPressed.Grapple) { Point tileCoordinates = Main.player[Main.myPlayer].Center.ToTileCoordinates(); - if (flag5) + if (UILinkPointNavigator.CurrentPoint == 600) { if (WorldGen.MoveTownNPC(tileCoordinates.X, tileCoordinates.Y, -1)) Main.NewText(Lang.inter[39].Value, G: (byte) 240, B: (byte) 20); - SoundEngine.PlaySound(12); + Main.PlaySound(12); } else if (WorldGen.MoveTownNPC(tileCoordinates.X, tileCoordinates.Y, UILinkPointNavigator.Shortcuts.NPCS_LastHovered)) { WorldGen.moveRoom(tileCoordinates.X, tileCoordinates.Y, UILinkPointNavigator.Shortcuts.NPCS_LastHovered); - SoundEngine.PlaySound(12); + Main.PlaySound(12); } } if (PlayerInput.Triggers.JustPressed.SmartSelect) UILinkPointNavigator.Shortcuts.NPCS_IconsDisplay = !UILinkPointNavigator.Shortcuts.NPCS_IconsDisplay; - if (flag6 && PlayerInput.Triggers.JustPressed.MouseRight) - WorldGen.kickOut(UILinkPointNavigator.Shortcuts.NPCS_LastHovered); - string[] strArray = new string[5] - { - PlayerInput.BuildCommand(Lang.misc[56].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Inventory"]), - PlayerInput.BuildCommand(Lang.misc[64].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["HotbarMinus"], PlayerInput.ProfileGamepadUI.KeyStatus["HotbarPlus"]), - PlayerInput.BuildCommand(Lang.misc[70].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Grapple"]), - PlayerInput.BuildCommand(Lang.misc[69].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["SmartSelect"]), - null - }; - string str; - if (!flag6) - str = ""; - else - str = PlayerInput.BuildCommand("Evict", false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseRight"]); - strArray[4] = str; - return string.Concat(strArray); + return PlayerInput.BuildCommand(Lang.misc[56].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Inventory"]) + PlayerInput.BuildCommand(Lang.misc[64].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["HotbarMinus"], PlayerInput.ProfileGamepadUI.KeyStatus["HotbarPlus"]) + PlayerInput.BuildCommand(Lang.misc[70].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Grapple"]) + PlayerInput.BuildCommand(Lang.misc[69].Value, true, PlayerInput.ProfileGamepadUI.KeyStatus["SmartSelect"]); }); for (int index = 600; index <= 650; ++index) { @@ -622,32 +479,32 @@ namespace Terraria.Initializers UILinkPointNavigator.RegisterPage(cp7, 6); UILinkPage cp8 = new UILinkPage(); cp8.OnSpecialInteracts += (Func) (() => PlayerInput.BuildCommand(Lang.misc[56].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Inventory"]) + PlayerInput.BuildCommand(Lang.misc[64].Value, true, PlayerInput.ProfileGamepadUI.KeyStatus["HotbarMinus"], PlayerInput.ProfileGamepadUI.KeyStatus["HotbarPlus"])); - Func func13 = (Func) (() => + Func func11 = (Func) (() => { int slot = UILinkPointNavigator.CurrentPoint - 180; return ItemSlot.GetGamepadInstructions(Main.player[Main.myPlayer].miscEquips, 20, slot); }); - Func func14 = (Func) (() => + Func func12 = (Func) (() => { int slot = UILinkPointNavigator.CurrentPoint - 180; return ItemSlot.GetGamepadInstructions(Main.player[Main.myPlayer].miscEquips, 19, slot); }); - Func func15 = (Func) (() => + Func func13 = (Func) (() => { int slot = UILinkPointNavigator.CurrentPoint - 180; return ItemSlot.GetGamepadInstructions(Main.player[Main.myPlayer].miscEquips, 18, slot); }); - Func func16 = (Func) (() => + Func func14 = (Func) (() => { int slot = UILinkPointNavigator.CurrentPoint - 180; return ItemSlot.GetGamepadInstructions(Main.player[Main.myPlayer].miscEquips, 17, slot); }); - Func func17 = (Func) (() => + Func func15 = (Func) (() => { int slot = UILinkPointNavigator.CurrentPoint - 180; return ItemSlot.GetGamepadInstructions(Main.player[Main.myPlayer].miscEquips, 16, slot); }); - Func func18 = (Func) (() => + Func func16 = (Func) (() => { int slot = UILinkPointNavigator.CurrentPoint - 185; return ItemSlot.GetGamepadInstructions(Main.player[Main.myPlayer].miscDyes, 12, slot); @@ -664,26 +521,26 @@ namespace Terraria.Initializers switch (index) { case 180: - uiLinkPoint.OnSpecialInteracts += func14; + uiLinkPoint.OnSpecialInteracts += func12; break; case 181: - uiLinkPoint.OnSpecialInteracts += func13; + uiLinkPoint.OnSpecialInteracts += func11; break; case 182: - uiLinkPoint.OnSpecialInteracts += func15; + uiLinkPoint.OnSpecialInteracts += func13; break; case 183: - uiLinkPoint.OnSpecialInteracts += func16; + uiLinkPoint.OnSpecialInteracts += func14; break; case 184: - uiLinkPoint.OnSpecialInteracts += func17; + uiLinkPoint.OnSpecialInteracts += func15; break; } } for (int index = 185; index <= 189; ++index) { UILinkPoint uiLinkPoint = new UILinkPoint(index, true, -3, index - 5, index - 1, index + 1); - uiLinkPoint.OnSpecialInteracts += func18; + uiLinkPoint.OnSpecialInteracts += func16; int num = index - 185; if (num == 0) uiLinkPoint.Up = 306; @@ -718,7 +575,7 @@ namespace Terraria.Initializers cp9.LinkMap[305].Down = 100; cp9.LinkMap[306].Down = 110; cp9.LinkMap[307].Down = 120; - cp9.LinkMap[308].Up = 108 + Main.player[Main.myPlayer].GetAmountOfExtraAccessorySlotsToShow() - 1; + cp9.LinkMap[308].Up = 108 + Main.player[Main.myPlayer].extraAccessorySlots - 1; break; case 1: cp9.LinkMap[305].Down = 600; @@ -738,7 +595,6 @@ namespace Terraria.Initializers cp9.LinkMap[308].Up = UILinkPointNavigator.Shortcuts.BUFFS_DRAWN > 0 ? 9000 : 184; break; } - cp9.PageOnRight = UILinksInitializer.GetCornerWrapPageIdFromRightToLeft(); }); cp9.IsValidEvent += (Func) (() => Main.playerInventory); cp9.PageOnLeft = 0; @@ -746,7 +602,7 @@ namespace Terraria.Initializers UILinkPointNavigator.RegisterPage(cp9, 8); UILinkPage cp10 = new UILinkPage(); cp10.OnSpecialInteracts += (Func) (() => PlayerInput.BuildCommand(Lang.misc[56].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Inventory"]) + PlayerInput.BuildCommand(Lang.misc[64].Value, true, PlayerInput.ProfileGamepadUI.KeyStatus["HotbarMinus"], PlayerInput.ProfileGamepadUI.KeyStatus["HotbarPlus"])); - Func func19 = (Func) (() => ItemSlot.GetGamepadInstructions(ref Main.guideItem, 7)); + Func func17 = (Func) (() => ItemSlot.GetGamepadInstructions(ref Main.guideItem, 7)); Func HandleItem2 = (Func) (() => Main.mouseItem.type < 1 ? "" : ItemSlot.GetGamepadInstructions(ref Main.mouseItem, 22)); for (int index = 1500; index < 1550; ++index) { @@ -755,7 +611,7 @@ namespace Terraria.Initializers uiLinkPoint.OnSpecialInteracts += HandleItem2; cp10.LinkMap.Add(index, uiLinkPoint); } - cp10.LinkMap[1500].OnSpecialInteracts += func19; + cp10.LinkMap[1500].OnSpecialInteracts += func17; cp10.UpdateEvent += (Action) (() => { int num3 = UILinkPointNavigator.Shortcuts.CRAFT_CurrentIngridientsCount; @@ -774,8 +630,7 @@ namespace Terraria.Initializers cp10.LinkMap[1500 + index].Right = index == num3 - 2 ? -4 : 1500 + index + 1; } cp10.LinkMap[1501].Left = -3; - if (num3 > 0) - cp10.LinkMap[1500 + num3 - 1].Right = -4; + cp10.LinkMap[1500 + num3 - 1].Right = -4; cp10.LinkMap[1500].Down = num3 >= 2 ? 1502 : -2; cp10.LinkMap[1500].Left = num3 >= 1 ? 1501 : -3; cp10.LinkMap[1502].Up = Main.InGuideCraftMenu ? 1500 : -1; @@ -786,21 +641,19 @@ namespace Terraria.Initializers return ""; string str = ""; Player player = Main.player[Main.myPlayer]; - bool flag7 = false; - Item createItem = Main.recipe[Main.availableRecipe[Main.focusRecipe]].createItem; - if (Main.mouseItem.type == 0 && createItem.maxStack > 1 && player.ItemSpace(createItem).CanTakeItemToPersonalInventory && !player.HasLockedInventory()) + bool flag3 = false; + if (Main.mouseItem.type == 0 && player.ItemSpace(Main.recipe[Main.availableRecipe[Main.focusRecipe]].createItem) && !player.IsStackingItems()) { - flag7 = true; + flag3 = true; if (PlayerInput.Triggers.Current.Grapple && Main.stackSplit <= 1) { if (PlayerInput.Triggers.JustPressed.Grapple) UILinksInitializer.SomeVarsForUILinkers.SequencedCraftingCurrent = Main.recipe[Main.availableRecipe[Main.focusRecipe]]; - ItemSlot.RefreshStackSplitCooldown(); - Main.preventStackSplitReset = true; + Main.stackSplit = Main.stackSplit != 0 ? Main.stackDelay : 15; if (UILinksInitializer.SomeVarsForUILinkers.SequencedCraftingCurrent == Main.recipe[Main.availableRecipe[Main.focusRecipe]]) { Main.CraftItem(Main.recipe[Main.availableRecipe[Main.focusRecipe]]); - Main.mouseItem = player.GetItem(player.whoAmI, Main.mouseItem, new GetItemSettings(NoText: true)); + Main.mouseItem = player.GetItem(player.whoAmI, Main.mouseItem); } } } @@ -810,21 +663,21 @@ namespace Terraria.Initializers if (PlayerInput.Triggers.JustPressed.Grapple) { ItemSlot.SwapEquip(ref Main.mouseItem); - if (Main.player[Main.myPlayer].ItemSpace(Main.mouseItem).CanTakeItemToPersonalInventory) - Main.mouseItem = player.GetItem(player.whoAmI, Main.mouseItem, GetItemSettings.InventoryUIToInventorySettings); + if (Main.player[Main.myPlayer].ItemSpace(Main.mouseItem)) + Main.mouseItem = player.GetItem(player.whoAmI, Main.mouseItem); } } - bool flag8 = Main.mouseItem.stack <= 0; - if (flag8 || Main.mouseItem.type == createItem.type && Main.mouseItem.stack < Main.mouseItem.maxStack) + bool flag4 = Main.mouseItem.stack <= 0; + if (flag4 || Main.mouseItem.type == Main.recipe[Main.availableRecipe[Main.focusRecipe]].createItem.type && Main.mouseItem.stack < Main.mouseItem.maxStack) { - if (flag8) + if (flag4) str += PlayerInput.BuildCommand(Lang.misc[72].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"], PlayerInput.ProfileGamepadUI.KeyStatus["MouseRight"]); else str += PlayerInput.BuildCommand(Lang.misc[72].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); } - if (!flag8 && Main.mouseItem.type == createItem.type && Main.mouseItem.stack < Main.mouseItem.maxStack) + if (!flag4 && Main.mouseItem.type == Main.recipe[Main.availableRecipe[Main.focusRecipe]].createItem.type && Main.mouseItem.stack < Main.mouseItem.maxStack) str += PlayerInput.BuildCommand(Lang.misc[93].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseRight"]); - if (flag7) + if (flag3) str += PlayerInput.BuildCommand(Lang.misc[71].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Grapple"]); return str + HandleItem2(); }); @@ -900,18 +753,18 @@ namespace Terraria.Initializers if (IHateLambda + Main.recStart < Main.numAvailableRecipes) { int index = Main.recStart + IHateLambda - 700; - if (Main.mouseItem.type == 0 && Main.recipe[Main.availableRecipe[index]].createItem.maxStack > 1 && player.ItemSpace(Main.recipe[Main.availableRecipe[index]].createItem).CanTakeItemToPersonalInventory && !player.HasLockedInventory()) + if (Main.mouseItem.type == 0 && player.ItemSpace(Main.recipe[Main.availableRecipe[index]].createItem) && !player.IsStackingItems()) { flag = true; if (PlayerInput.Triggers.JustPressed.Grapple) UILinksInitializer.SomeVarsForUILinkers.SequencedCraftingCurrent = Main.recipe[Main.availableRecipe[index]]; if (PlayerInput.Triggers.Current.Grapple && Main.stackSplit <= 1) { - ItemSlot.RefreshStackSplitCooldown(); + Main.stackSplit = Main.stackSplit != 0 ? Main.stackDelay : 15; if (UILinksInitializer.SomeVarsForUILinkers.SequencedCraftingCurrent == Main.recipe[Main.availableRecipe[index]]) { Main.CraftItem(Main.recipe[Main.availableRecipe[index]]); - Main.mouseItem = player.GetItem(player.whoAmI, Main.mouseItem, GetItemSettings.InventoryUIToInventorySettings); + Main.mouseItem = player.GetItem(player.whoAmI, Main.mouseItem); } } } @@ -941,7 +794,6 @@ namespace Terraria.Initializers cp11.LinkMap[700 + index].Down = index < num6 - num5 ? 700 + index + num5 : -2; cp11.LinkMap[700 + index].Up = index < num5 ? -1 : 700 + index - num5; } - cp11.PageOnLeft = UILinksInitializer.GetCornerWrapPageIdFromLeftToRight(); }); cp11.ReachEndEvent += (Action) ((current, next) => { @@ -950,7 +802,7 @@ namespace Terraria.Initializers { case -2: Main.recStart += craftIconsPerRow; - SoundEngine.PlaySound(12); + Main.PlaySound(12); if (Main.recStart <= Main.numAvailableRecipes - craftIconsPerRow) break; Main.recStart = Main.numAvailableRecipes - craftIconsPerRow; @@ -983,11 +835,11 @@ namespace Terraria.Initializers int num7 = 5; int num8 = 3; int num9 = num7 * num8; - int count = Main.Hairstyles.AvailableHairstyles.Count; + int num10 = Main.UnlockedMaxHair(); for (int index = 0; index < num9; ++index) { cp12.LinkMap[2605 + index].Left = index % num7 == 0 ? -3 : 2605 + index - 1; - cp12.LinkMap[2605 + index].Right = (index + 1) % num7 == 0 || index == count - 1 ? -4 : 2605 + index + 1; + cp12.LinkMap[2605 + index].Right = (index + 1) % num7 == 0 || index == num10 - 1 ? -4 : 2605 + index + 1; cp12.LinkMap[2605 + index].Down = index < num9 - num7 ? 2605 + index + num7 : -2; cp12.LinkMap[2605 + index].Up = index < num7 ? -1 : 2605 + index - num7; } @@ -998,14 +850,14 @@ namespace Terraria.Initializers if (next == -1) { Main.hairStart -= num; - SoundEngine.PlaySound(12); + Main.PlaySound(12); } else { if (next != -2) return; Main.hairStart += num; - SoundEngine.PlaySound(12); + Main.PlaySound(12); } }); cp12.CanEnterEvent += (Func) (() => Main.hairWindow); @@ -1013,14 +865,14 @@ namespace Terraria.Initializers cp12.PageOnLeft = 12; cp12.PageOnRight = 12; UILinkPointNavigator.RegisterPage(cp12, 11); - UILinkPage page6 = new UILinkPage(); - page6.OnSpecialInteracts += (Func) (() => PlayerInput.BuildCommand(Lang.misc[56].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Inventory"]) + PlayerInput.BuildCommand(Lang.misc[64].Value, true, PlayerInput.ProfileGamepadUI.KeyStatus["HotbarMinus"], PlayerInput.ProfileGamepadUI.KeyStatus["HotbarPlus"])); - page6.LinkMap.Add(2600, new UILinkPoint(2600, true, -3, -4, -1, 2601)); - page6.LinkMap.Add(2601, new UILinkPoint(2601, true, -3, -4, 2600, 2602)); - page6.LinkMap.Add(2602, new UILinkPoint(2602, true, -3, -4, 2601, 2603)); - page6.LinkMap.Add(2603, new UILinkPoint(2603, true, -3, 2604, 2602, -2)); - page6.LinkMap.Add(2604, new UILinkPoint(2604, true, 2603, -4, 2602, -2)); - page6.UpdateEvent += (Action) (() => + UILinkPage page4 = new UILinkPage(); + page4.OnSpecialInteracts += (Func) (() => PlayerInput.BuildCommand(Lang.misc[56].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Inventory"]) + PlayerInput.BuildCommand(Lang.misc[64].Value, true, PlayerInput.ProfileGamepadUI.KeyStatus["HotbarMinus"], PlayerInput.ProfileGamepadUI.KeyStatus["HotbarPlus"])); + page4.LinkMap.Add(2600, new UILinkPoint(2600, true, -3, -4, -1, 2601)); + page4.LinkMap.Add(2601, new UILinkPoint(2601, true, -3, -4, 2600, 2602)); + page4.LinkMap.Add(2602, new UILinkPoint(2602, true, -3, -4, 2601, 2603)); + page4.LinkMap.Add(2603, new UILinkPoint(2603, true, -3, 2604, 2602, -2)); + page4.LinkMap.Add(2604, new UILinkPoint(2604, true, 2603, -4, 2602, -2)); + page4.UpdateEvent += (Action) (() => { Vector3 hsl = Main.rgbToHsl(Main.selColor); float interfaceDeadzoneX = PlayerInput.CurrentProfile.InterfaceDeadzoneX; @@ -1040,13 +892,13 @@ namespace Terraria.Initializers return; if (Main.hairWindow) Main.player[Main.myPlayer].hairColor = Main.selColor = Main.hslToRgb(Main.hBar, Main.sBar, Main.lBar); - SoundEngine.PlaySound(12); + Main.PlaySound(12); }); - page6.CanEnterEvent += (Func) (() => Main.hairWindow); - page6.IsValidEvent += (Func) (() => Main.hairWindow); - page6.PageOnLeft = 11; - page6.PageOnRight = 11; - UILinkPointNavigator.RegisterPage(page6, 12); + page4.CanEnterEvent += (Func) (() => Main.hairWindow); + page4.IsValidEvent += (Func) (() => Main.hairWindow); + page4.PageOnLeft = 11; + page4.PageOnRight = 11; + UILinkPointNavigator.RegisterPage(page4, 12); UILinkPage cp13 = new UILinkPage(); for (int index = 0; index < 30; ++index) { @@ -1059,28 +911,28 @@ namespace Terraria.Initializers if (UILinkPointNavigator.CurrentPage != cp13.ID) return; int num = cp13.CurrentPoint - 2900; - if (num >= 5) + if (num >= 4) return; IngameOptions.category = num; }); cp13.UpdateEvent += (Action) (() => { - int num10 = UILinkPointNavigator.Shortcuts.INGAMEOPTIONS_BUTTONS_LEFT; - if (num10 == 0) - num10 = 5; - if (UILinkPointNavigator.OverridePoint == -1 && cp13.CurrentPoint < 2930 && cp13.CurrentPoint > 2900 + num10 - 1) + int num11 = UILinkPointNavigator.Shortcuts.INGAMEOPTIONS_BUTTONS_LEFT; + if (num11 == 0) + num11 = 5; + if (UILinkPointNavigator.OverridePoint == -1 && cp13.CurrentPoint < 2930 && cp13.CurrentPoint > 2900 + num11 - 1) UILinkPointNavigator.ChangePoint(2900); - for (int key = 2900; key < 2900 + num10; ++key) + for (int key = 2900; key < 2900 + num11; ++key) { cp13.LinkMap[key].Up = key - 1; cp13.LinkMap[key].Down = key + 1; } - cp13.LinkMap[2900].Up = 2900 + num10 - 1; - cp13.LinkMap[2900 + num10 - 1].Down = 2900; - int num11 = cp13.CurrentPoint - 2900; - if (num11 >= 5 || !PlayerInput.Triggers.JustPressed.MouseLeft) + cp13.LinkMap[2900].Up = 2900 + num11 - 1; + cp13.LinkMap[2900 + num11 - 1].Down = 2900; + int num12 = cp13.CurrentPoint - 2900; + if (num12 >= 4 || !PlayerInput.Triggers.JustPressed.MouseLeft) return; - IngameOptions.category = num11; + IngameOptions.category = num12; UILinkPointNavigator.ChangePage(1002); }); cp13.EnterEvent += (Action) (() => cp13.CurrentPoint = 2900 + IngameOptions.category); @@ -1094,23 +946,22 @@ namespace Terraria.Initializers cp14.LinkMap.Add(2930 + index, new UILinkPoint(2930 + index, true, -3, -4, -1, -2)); cp14.LinkMap[2930 + index].OnSpecialInteracts += func1; } - cp14.EnterEvent += (Action) (() => Main.mouseLeftRelease = false); cp14.OnSpecialInteracts += (Func) (() => PlayerInput.BuildCommand(Lang.misc[56].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Inventory"]) + PlayerInput.BuildCommand(Lang.misc[64].Value, true, PlayerInput.ProfileGamepadUI.KeyStatus["HotbarMinus"], PlayerInput.ProfileGamepadUI.KeyStatus["HotbarPlus"])); cp14.UpdateEvent += (Action) (() => { - int num12 = UILinkPointNavigator.Shortcuts.INGAMEOPTIONS_BUTTONS_RIGHT; - if (num12 == 0) - num12 = 5; - if (UILinkPointNavigator.OverridePoint == -1 && cp14.CurrentPoint >= 2930 && cp14.CurrentPoint > 2930 + num12 - 1) + int num13 = UILinkPointNavigator.Shortcuts.INGAMEOPTIONS_BUTTONS_RIGHT; + if (num13 == 0) + num13 = 5; + if (UILinkPointNavigator.OverridePoint == -1 && cp14.CurrentPoint >= 2930 && cp14.CurrentPoint > 2930 + num13 - 1) UILinkPointNavigator.ChangePoint(2930); - for (int key = 2930; key < 2930 + num12; ++key) + for (int key = 2930; key < 2930 + num13; ++key) { cp14.LinkMap[key].Up = key - 1; cp14.LinkMap[key].Down = key + 1; } cp14.LinkMap[2930].Up = -1; - cp14.LinkMap[2930 + num12 - 1].Down = -2; - int num13 = PlayerInput.Triggers.JustPressed.Inventory ? 1 : 0; + cp14.LinkMap[2930 + num13 - 1].Down = -2; + int num14 = PlayerInput.Triggers.JustPressed.Inventory ? 1 : 0; UILinksInitializer.HandleOptionsSpecials(); }); cp14.PageOnLeft = cp14.PageOnRight = 1001; @@ -1148,37 +999,33 @@ namespace Terraria.Initializers cp15.LinkMap[1552].Up = 1550; cp15.LinkMap[1552].Right = 121; cp15.LinkMap[1554].Right = 121; - cp15.LinkMap[1555].Down = 1570; - cp15.LinkMap[1556].Down = 1570; + cp15.LinkMap[1555].Down = 1557; + cp15.LinkMap[1556].Down = 1557; cp15.LinkMap[1556].Right = 122; - cp15.LinkMap[1557].Up = 1570; + cp15.LinkMap[1557].Up = 1555; cp15.LinkMap[1557].Down = 308; cp15.LinkMap[1557].Right = (int) sbyte.MaxValue; - cp15.LinkMap.Add(1570, new UILinkPoint(1570, true, -3, -4, -1, -2)); - cp15.LinkMap[1570].Up = 1555; - cp15.LinkMap[1570].Down = 1557; - cp15.LinkMap[1570].Right = 126; for (int index = 0; index < 7; ++index) cp15.LinkMap[1550 + index].OnSpecialInteracts += func1; cp15.UpdateEvent += (Action) (() => { if (!Main.ShouldPVPDraw) { - if (UILinkPointNavigator.OverridePoint == -1 && cp15.CurrentPoint != 1557 && cp15.CurrentPoint != 1570) + if (UILinkPointNavigator.OverridePoint == -1 && cp15.CurrentPoint != 1557) UILinkPointNavigator.ChangePoint(1557); - cp15.LinkMap[1570].Up = -1; + cp15.LinkMap[1557].Up = -1; cp15.LinkMap[1557].Down = 308; cp15.LinkMap[1557].Right = (int) sbyte.MaxValue; } else { - cp15.LinkMap[1570].Up = 1555; + cp15.LinkMap[1557].Up = 1555; cp15.LinkMap[1557].Down = 308; cp15.LinkMap[1557].Right = (int) sbyte.MaxValue; } int infoacccount = UILinkPointNavigator.Shortcuts.INFOACCCOUNT; if (infoacccount > 0) - cp15.LinkMap[1570].Up = 1558 + (infoacccount - 1) / 2 * 2; + cp15.LinkMap[1557].Up = 1558 + (infoacccount - 1) / 2 * 2; if (!Main.ShouldPVPDraw) return; if (infoacccount >= 1) @@ -1188,13 +1035,13 @@ namespace Terraria.Initializers } else { - cp15.LinkMap[1555].Down = 1570; - cp15.LinkMap[1556].Down = 1570; + cp15.LinkMap[1555].Down = 1557; + cp15.LinkMap[1556].Down = 1557; } if (infoacccount >= 2) cp15.LinkMap[1556].Down = 1559; else - cp15.LinkMap[1556].Down = 1570; + cp15.LinkMap[1556].Down = 1557; }); cp15.IsValidEvent += (Func) (() => Main.playerInventory); cp15.PageOnLeft = 8; @@ -1234,7 +1081,7 @@ namespace Terraria.Initializers { bool flag = index % 2 == 0; int key = index + 1558; - cp16.LinkMap[key].Down = index < infoacccount - 2 ? key + 2 : 1570; + cp16.LinkMap[key].Down = index < infoacccount - 2 ? key + 2 : 1557; cp16.LinkMap[key].Up = index > 1 ? key - 2 : (Main.ShouldPVPDraw ? (flag ? 1555 : 1556) : -1); cp16.LinkMap[key].Right = !flag || index + 1 >= infoacccount ? 123 + index / 4 : key + 1; cp16.LinkMap[key].Left = flag ? -3 : key - 1; @@ -1246,27 +1093,29 @@ namespace Terraria.Initializers UILinkPointNavigator.RegisterPage(cp16, 17); UILinkPage cp17 = new UILinkPage(); cp17.OnSpecialInteracts += (Func) (() => PlayerInput.BuildCommand(Lang.misc[56].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Inventory"]) + PlayerInput.BuildCommand(Lang.misc[64].Value, true, PlayerInput.ProfileGamepadUI.KeyStatus["HotbarMinus"], PlayerInput.ProfileGamepadUI.KeyStatus["HotbarPlus"])); - for (int index = 6000; index < 6012; ++index) + for (int index = 4000; index < 4010; ++index) { UILinkPoint uiLinkPoint = new UILinkPoint(index, true, -3, -4, -1, -2); - switch (index - 6000) + switch (index - 4000) { case 0: + case 1: uiLinkPoint.Right = 0; break; - case 1: case 2: + case 3: uiLinkPoint.Right = 10; break; - case 3: case 4: + case 5: uiLinkPoint.Right = 20; break; - case 5: case 6: + case 7: uiLinkPoint.Right = 30; break; - default: + case 8: + case 9: uiLinkPoint.Right = 40; break; } @@ -1275,12 +1124,12 @@ namespace Terraria.Initializers cp17.UpdateEvent += (Action) (() => { int builderacccount = UILinkPointNavigator.Shortcuts.BUILDERACCCOUNT; - if (UILinkPointNavigator.OverridePoint == -1 && cp17.CurrentPoint - 6000 >= builderacccount) - UILinkPointNavigator.ChangePoint(6000 + builderacccount - 1); + if (UILinkPointNavigator.OverridePoint == -1 && cp17.CurrentPoint - 4000 >= builderacccount) + UILinkPointNavigator.ChangePoint(4000 + builderacccount - 1); for (int index = 0; index < builderacccount; ++index) { int num = index % 2; - int key = index + 6000; + int key = index + 4000; cp17.LinkMap[key].Down = index < builderacccount - 1 ? key + 1 : -2; cp17.LinkMap[key].Up = index > 0 ? key - 1 : -1; } @@ -1289,40 +1138,38 @@ namespace Terraria.Initializers cp17.PageOnLeft = 8; cp17.PageOnRight = 8; UILinkPointNavigator.RegisterPage(cp17, 18); - UILinkPage page7 = new UILinkPage(); - page7.OnSpecialInteracts += (Func) (() => PlayerInput.BuildCommand(Lang.misc[56].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Inventory"]) + PlayerInput.BuildCommand(Lang.misc[64].Value, true, PlayerInput.ProfileGamepadUI.KeyStatus["HotbarMinus"], PlayerInput.ProfileGamepadUI.KeyStatus["HotbarPlus"])); - page7.LinkMap.Add(2806, new UILinkPoint(2806, true, 2805, 2807, -1, 2808)); - page7.LinkMap.Add(2807, new UILinkPoint(2807, true, 2806, 2810, -1, 2809)); - page7.LinkMap.Add(2808, new UILinkPoint(2808, true, 2805, 2809, 2806, -2)); - page7.LinkMap.Add(2809, new UILinkPoint(2809, true, 2808, 2811, 2807, -2)); - page7.LinkMap.Add(2810, new UILinkPoint(2810, true, 2807, -4, -1, 2811)); - page7.LinkMap.Add(2811, new UILinkPoint(2811, true, 2809, -4, 2810, -2)); - page7.LinkMap.Add(2805, new UILinkPoint(2805, true, -3, 2806, -1, -2)); - page7.LinkMap[2806].OnSpecialInteracts += func1; - page7.LinkMap[2807].OnSpecialInteracts += func1; - page7.LinkMap[2808].OnSpecialInteracts += func1; - page7.LinkMap[2809].OnSpecialInteracts += func1; - page7.LinkMap[2805].OnSpecialInteracts += func1; - page7.CanEnterEvent += (Func) (() => Main.clothesWindow); - page7.IsValidEvent += (Func) (() => Main.clothesWindow); - page7.EnterEvent += (Action) (() => Main.player[Main.myPlayer].releaseInventory = false); - page7.LeaveEvent += (Action) (() => Main.player[Main.myPlayer].LockGamepadTileInteractions()); - page7.PageOnLeft = 15; - page7.PageOnRight = 15; - UILinkPointNavigator.RegisterPage(page7, 14); - UILinkPage page8 = new UILinkPage(); - page8.OnSpecialInteracts += (Func) (() => PlayerInput.BuildCommand(Lang.misc[56].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Inventory"]) + PlayerInput.BuildCommand(Lang.misc[64].Value, true, PlayerInput.ProfileGamepadUI.KeyStatus["HotbarMinus"], PlayerInput.ProfileGamepadUI.KeyStatus["HotbarPlus"])); - page8.LinkMap.Add(2800, new UILinkPoint(2800, true, -3, -4, -1, 2801)); - page8.LinkMap.Add(2801, new UILinkPoint(2801, true, -3, -4, 2800, 2802)); - page8.LinkMap.Add(2802, new UILinkPoint(2802, true, -3, -4, 2801, 2803)); - page8.LinkMap.Add(2803, new UILinkPoint(2803, true, -3, 2804, 2802, -2)); - page8.LinkMap.Add(2804, new UILinkPoint(2804, true, 2803, -4, 2802, -2)); - page8.LinkMap[2800].OnSpecialInteracts += func1; - page8.LinkMap[2801].OnSpecialInteracts += func1; - page8.LinkMap[2802].OnSpecialInteracts += func1; - page8.LinkMap[2803].OnSpecialInteracts += func1; - page8.LinkMap[2804].OnSpecialInteracts += func1; - page8.UpdateEvent += (Action) (() => + UILinkPage page5 = new UILinkPage(); + page5.OnSpecialInteracts += (Func) (() => PlayerInput.BuildCommand(Lang.misc[56].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Inventory"]) + PlayerInput.BuildCommand(Lang.misc[64].Value, true, PlayerInput.ProfileGamepadUI.KeyStatus["HotbarMinus"], PlayerInput.ProfileGamepadUI.KeyStatus["HotbarPlus"])); + page5.LinkMap.Add(2806, new UILinkPoint(2806, true, 2805, 2807, -1, 2808)); + page5.LinkMap.Add(2807, new UILinkPoint(2807, true, 2806, -4, -1, 2809)); + page5.LinkMap.Add(2808, new UILinkPoint(2808, true, 2805, 2809, 2806, -2)); + page5.LinkMap.Add(2809, new UILinkPoint(2809, true, 2808, -4, 2807, -2)); + page5.LinkMap.Add(2805, new UILinkPoint(2805, true, -3, 2806, -1, -2)); + page5.LinkMap[2806].OnSpecialInteracts += func1; + page5.LinkMap[2807].OnSpecialInteracts += func1; + page5.LinkMap[2808].OnSpecialInteracts += func1; + page5.LinkMap[2809].OnSpecialInteracts += func1; + page5.LinkMap[2805].OnSpecialInteracts += func1; + page5.CanEnterEvent += (Func) (() => Main.clothesWindow); + page5.IsValidEvent += (Func) (() => Main.clothesWindow); + page5.EnterEvent += (Action) (() => Main.player[Main.myPlayer].releaseInventory = false); + page5.LeaveEvent += (Action) (() => Main.player[Main.myPlayer].releaseUseTile = false); + page5.PageOnLeft = 15; + page5.PageOnRight = 15; + UILinkPointNavigator.RegisterPage(page5, 14); + UILinkPage page6 = new UILinkPage(); + page6.OnSpecialInteracts += (Func) (() => PlayerInput.BuildCommand(Lang.misc[56].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Inventory"]) + PlayerInput.BuildCommand(Lang.misc[64].Value, true, PlayerInput.ProfileGamepadUI.KeyStatus["HotbarMinus"], PlayerInput.ProfileGamepadUI.KeyStatus["HotbarPlus"])); + page6.LinkMap.Add(2800, new UILinkPoint(2800, true, -3, -4, -1, 2801)); + page6.LinkMap.Add(2801, new UILinkPoint(2801, true, -3, -4, 2800, 2802)); + page6.LinkMap.Add(2802, new UILinkPoint(2802, true, -3, -4, 2801, 2803)); + page6.LinkMap.Add(2803, new UILinkPoint(2803, true, -3, 2804, 2802, -2)); + page6.LinkMap.Add(2804, new UILinkPoint(2804, true, 2803, -4, 2802, -2)); + page6.LinkMap[2800].OnSpecialInteracts += func1; + page6.LinkMap[2801].OnSpecialInteracts += func1; + page6.LinkMap[2802].OnSpecialInteracts += func1; + page6.LinkMap[2803].OnSpecialInteracts += func1; + page6.LinkMap[2804].OnSpecialInteracts += func1; + page6.UpdateEvent += (Action) (() => { Vector3 hsl = Main.rgbToHsl(Main.selColor); float interfaceDeadzoneX = PlayerInput.CurrentProfile.InterfaceDeadzoneX; @@ -1359,19 +1206,19 @@ namespace Terraria.Initializers break; } } - SoundEngine.PlaySound(12); + Main.PlaySound(12); }); - page8.CanEnterEvent += (Func) (() => Main.clothesWindow); - page8.IsValidEvent += (Func) (() => Main.clothesWindow); - page8.EnterEvent += (Action) (() => Main.player[Main.myPlayer].releaseInventory = false); - page8.LeaveEvent += (Action) (() => Main.player[Main.myPlayer].LockGamepadTileInteractions()); - page8.PageOnLeft = 14; - page8.PageOnRight = 14; - UILinkPointNavigator.RegisterPage(page8, 15); + page6.CanEnterEvent += (Func) (() => Main.clothesWindow); + page6.IsValidEvent += (Func) (() => Main.clothesWindow); + page6.EnterEvent += (Action) (() => Main.player[Main.myPlayer].releaseInventory = false); + page6.LeaveEvent += (Action) (() => Main.player[Main.myPlayer].releaseUseTile = false); + page6.PageOnLeft = 14; + page6.PageOnRight = 14; + UILinkPointNavigator.RegisterPage(page6, 15); UILinkPage cp18 = new UILinkPage(); cp18.UpdateEvent += (Action) (() => PlayerInput.GamepadAllowScrolling = true); - for (int index = 3000; index <= 4999; ++index) - cp18.LinkMap.Add(index, new UILinkPoint(index, true, -3, -4, -1, -2)); + for (int index = 0; index < 200; ++index) + cp18.LinkMap.Add(3000 + index, new UILinkPoint(3000 + index, true, -3, -4, -1, -2)); cp18.OnSpecialInteracts += (Func) (() => PlayerInput.BuildCommand(Lang.misc[53].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]) + PlayerInput.BuildCommand(Lang.misc[82].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Inventory"]) + UILinksInitializer.FancyUISpecialInstructions()); cp18.UpdateEvent += (Action) (() => { @@ -1382,74 +1229,38 @@ namespace Terraria.Initializers cp18.EnterEvent += (Action) (() => cp18.CurrentPoint = 3002); cp18.CanEnterEvent += (Func) (() => Main.MenuUI.IsVisible || Main.InGameUI.IsVisible); cp18.IsValidEvent += (Func) (() => Main.MenuUI.IsVisible || Main.InGameUI.IsVisible); - cp18.OnPageMoveAttempt += new Action(UILinksInitializer.OnFancyUIPageMoveAttempt); UILinkPointNavigator.RegisterPage(cp18, 1004); UILinkPage cp19 = new UILinkPage(); - cp19.UpdateEvent += (Action) (() => PlayerInput.GamepadAllowScrolling = true); - for (int index = 10000; index <= 11000; ++index) - cp19.LinkMap.Add(index, new UILinkPoint(index, true, -3, -4, -1, -2)); - for (int index = 15000; index <= 15000; ++index) - cp19.LinkMap.Add(index, new UILinkPoint(index, true, -3, -4, -1, -2)); - cp19.OnSpecialInteracts += (Func) (() => PlayerInput.BuildCommand(Lang.misc[53].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]) + PlayerInput.BuildCommand(Lang.misc[82].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Inventory"]) + UILinksInitializer.FancyUISpecialInstructions()); - cp19.UpdateEvent += (Action) (() => - { - if (PlayerInput.Triggers.JustPressed.Inventory) - UILinksInitializer.FancyExit(); - UILinkPointNavigator.Shortcuts.BackButtonInUse = false; - }); - cp19.EnterEvent += (Action) (() => cp19.CurrentPoint = 10000); - cp19.CanEnterEvent += new Func(UILinksInitializer.CanEnterCreativeMenu); - cp19.IsValidEvent += new Func(UILinksInitializer.CanEnterCreativeMenu); - cp19.OnPageMoveAttempt += new Action(UILinksInitializer.OnFancyUIPageMoveAttempt); - cp19.PageOnLeft = 8; - cp19.PageOnRight = 0; - UILinkPointNavigator.RegisterPage(cp19, 1005); - UILinkPage cp20 = new UILinkPage(); - cp20.OnSpecialInteracts += (Func) (() => PlayerInput.BuildCommand(Lang.misc[56].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Inventory"]) + PlayerInput.BuildCommand(Lang.misc[64].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["HotbarMinus"], PlayerInput.ProfileGamepadUI.KeyStatus["HotbarPlus"])); - Func func20 = (Func) (() => PlayerInput.BuildCommand(Lang.misc[94].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"])); + cp19.OnSpecialInteracts += (Func) (() => PlayerInput.BuildCommand(Lang.misc[56].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Inventory"]) + PlayerInput.BuildCommand(Lang.misc[64].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["HotbarMinus"], PlayerInput.ProfileGamepadUI.KeyStatus["HotbarPlus"])); + Func func18 = (Func) (() => PlayerInput.BuildCommand(Lang.misc[94].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"])); for (int index = 9000; index <= 9050; ++index) { UILinkPoint uiLinkPoint = new UILinkPoint(index, true, index + 10, index - 10, index - 1, index + 1); - cp20.LinkMap.Add(index, uiLinkPoint); - uiLinkPoint.OnSpecialInteracts += func20; + cp19.LinkMap.Add(index, uiLinkPoint); + uiLinkPoint.OnSpecialInteracts += func18; } - cp20.UpdateEvent += (Action) (() => + cp19.UpdateEvent += (Action) (() => { int num = UILinkPointNavigator.Shortcuts.BUFFS_PER_COLUMN; if (num == 0) num = 100; for (int index = 0; index < 50; ++index) { - cp20.LinkMap[9000 + index].Up = index % num == 0 ? -1 : 9000 + index - 1; - if (cp20.LinkMap[9000 + index].Up == -1) - cp20.LinkMap[9000 + index].Up = index < num ? 189 : 184; - cp20.LinkMap[9000 + index].Down = (index + 1) % num == 0 || index == UILinkPointNavigator.Shortcuts.BUFFS_DRAWN - 1 ? 308 : 9000 + index + 1; - cp20.LinkMap[9000 + index].Left = index < UILinkPointNavigator.Shortcuts.BUFFS_DRAWN - num ? 9000 + index + num : -3; - cp20.LinkMap[9000 + index].Right = index < num ? -4 : 9000 + index - num; + cp19.LinkMap[9000 + index].Up = index % num == 0 ? -1 : 9000 + index - 1; + if (cp19.LinkMap[9000 + index].Up == -1) + cp19.LinkMap[9000 + index].Up = index < num ? 189 : 184; + cp19.LinkMap[9000 + index].Down = (index + 1) % num == 0 || index == UILinkPointNavigator.Shortcuts.BUFFS_DRAWN - 1 ? 308 : 9000 + index + 1; + cp19.LinkMap[9000 + index].Left = index < UILinkPointNavigator.Shortcuts.BUFFS_DRAWN - num ? 9000 + index + num : -3; + cp19.LinkMap[9000 + index].Right = index < num ? -4 : 9000 + index - num; } }); - cp20.IsValidEvent += (Func) (() => Main.playerInventory && Main.EquipPage == 2 && UILinkPointNavigator.Shortcuts.BUFFS_DRAWN > 0); - cp20.PageOnLeft = 8; - cp20.PageOnRight = 8; - UILinkPointNavigator.RegisterPage(cp20, 19); - UILinkPage page9 = UILinkPointNavigator.Pages[UILinkPointNavigator.CurrentPage]; - page9.CurrentPoint = page9.DefaultPoint; - page9.Enter(); - } - - private static bool CanEnterCreativeMenu() => Main.LocalPlayer.chest == -1 && Main.LocalPlayer.talkNPC == -1 && Main.playerInventory && Main.CreativeMenu.Enabled; - - private static int GetCornerWrapPageIdFromLeftToRight() => 8; - - private static int GetCornerWrapPageIdFromRightToLeft() => Main.CreativeMenu.Enabled ? 1005 : 10; - - private static void OnFancyUIPageMoveAttempt(int direction) - { - if (Main.MenuUI.CurrentState is UICharacterCreation currentState1) - currentState1.TryMovingCategory(direction); - if (!(UserInterface.ActiveInstance.CurrentState is UIBestiaryTest currentState2)) - return; - currentState2.TryMovingPages(direction); + cp19.IsValidEvent += (Func) (() => Main.playerInventory && Main.EquipPage == 2 && UILinkPointNavigator.Shortcuts.BUFFS_DRAWN > 0); + cp19.PageOnLeft = 8; + cp19.PageOnRight = 8; + UILinkPointNavigator.RegisterPage(cp19, 19); + UILinkPage page7 = UILinkPointNavigator.Pages[UILinkPointNavigator.CurrentPage]; + page7.CurrentPoint = page7.DefaultPoint; + page7.Enter(); } public static void FancyExit() @@ -1457,11 +1268,11 @@ namespace Terraria.Initializers switch (UILinkPointNavigator.Shortcuts.BackButtonCommand) { case 1: - SoundEngine.PlaySound(11); + Main.PlaySound(11); Main.menuMode = 0; break; case 2: - SoundEngine.PlaySound(11); + Main.PlaySound(11); Main.menuMode = Main.menuMultiplayer ? 12 : 1; break; case 3: @@ -1469,11 +1280,11 @@ namespace Terraria.Initializers IngameFancyUI.Close(); break; case 4: - SoundEngine.PlaySound(11); + Main.PlaySound(11); Main.menuMode = 11; break; case 5: - SoundEngine.PlaySound(11); + Main.PlaySound(11); Main.menuMode = 11; break; case 6: @@ -1511,21 +1322,21 @@ namespace Terraria.Initializers switch (UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE) { case 1: - Main.bgScroll = (int) UILinksInitializer.HandleSliderHorizontalInput((float) Main.bgScroll, 0.0f, 100f, PlayerInput.CurrentProfile.InterfaceDeadzoneX, 1f); + Main.bgScroll = (int) UILinksInitializer.HandleSlider((float) Main.bgScroll, 0.0f, 100f, PlayerInput.CurrentProfile.InterfaceDeadzoneX, 1f); Main.caveParallax = (float) (1.0 - (double) Main.bgScroll / 500.0); break; case 2: - Main.musicVolume = UILinksInitializer.HandleSliderHorizontalInput(Main.musicVolume, 0.0f, 1f, PlayerInput.CurrentProfile.InterfaceDeadzoneX, 0.35f); + Main.musicVolume = UILinksInitializer.HandleSlider(Main.musicVolume, 0.0f, 1f, PlayerInput.CurrentProfile.InterfaceDeadzoneX, 0.35f); break; case 3: - Main.soundVolume = UILinksInitializer.HandleSliderHorizontalInput(Main.soundVolume, 0.0f, 1f, PlayerInput.CurrentProfile.InterfaceDeadzoneX, 0.35f); + Main.soundVolume = UILinksInitializer.HandleSlider(Main.soundVolume, 0.0f, 1f, PlayerInput.CurrentProfile.InterfaceDeadzoneX, 0.35f); break; case 4: - Main.ambientVolume = UILinksInitializer.HandleSliderHorizontalInput(Main.ambientVolume, 0.0f, 1f, PlayerInput.CurrentProfile.InterfaceDeadzoneX, 0.35f); + Main.ambientVolume = UILinksInitializer.HandleSlider(Main.ambientVolume, 0.0f, 1f, PlayerInput.CurrentProfile.InterfaceDeadzoneX, 0.35f); break; case 5: double hBar = (double) Main.hBar; - float num1 = Main.hBar = UILinksInitializer.HandleSliderHorizontalInput((float) hBar, 0.0f, 1f); + float num1 = Main.hBar = UILinksInitializer.HandleSlider((float) hBar, 0.0f, 1f); if (hBar == (double) num1) break; switch (Main.menuMode) @@ -1558,11 +1369,11 @@ namespace Terraria.Initializers Main.mouseBorderColorSlider.Hue = num1; break; } - SoundEngine.PlaySound(12); + Main.PlaySound(12); break; case 6: double sBar = (double) Main.sBar; - float num2 = Main.sBar = UILinksInitializer.HandleSliderHorizontalInput((float) sBar, 0.0f, 1f, PlayerInput.CurrentProfile.InterfaceDeadzoneX); + float num2 = Main.sBar = UILinksInitializer.HandleSlider((float) sBar, 0.0f, 1f, PlayerInput.CurrentProfile.InterfaceDeadzoneX); if (sBar == (double) num2) break; switch (Main.menuMode) @@ -1595,16 +1406,15 @@ namespace Terraria.Initializers Main.mouseBorderColorSlider.Saturation = num2; break; } - SoundEngine.PlaySound(12); + Main.PlaySound(12); break; case 7: - double lBar1 = (double) Main.lBar; + double lBar = (double) Main.lBar; float min = 0.15f; if (Main.menuMode == 252) min = 0.0f; - Main.lBar = UILinksInitializer.HandleSliderHorizontalInput((float) lBar1, min, 1f, PlayerInput.CurrentProfile.InterfaceDeadzoneX); - float lBar2 = Main.lBar; - if (lBar1 == (double) lBar2) + float num3 = Main.lBar = UILinksInitializer.HandleSlider((float) lBar, min, 1f, PlayerInput.CurrentProfile.InterfaceDeadzoneX); + if (lBar == (double) num3) break; switch (Main.menuMode) { @@ -1630,22 +1440,22 @@ namespace Terraria.Initializers Main.player[Main.myPlayer].shoeColor = Main.selColor = Main.hslToRgb(Main.hBar, Main.sBar, Main.lBar); break; case 25: - Main.mouseColorSlider.Luminance = lBar2; + Main.mouseColorSlider.Luminance = num3; break; case 252: - Main.mouseBorderColorSlider.Luminance = lBar2; + Main.mouseBorderColorSlider.Luminance = num3; break; } - SoundEngine.PlaySound(12); + Main.PlaySound(12); break; case 8: double aBar = (double) Main.aBar; - float num3 = Main.aBar = UILinksInitializer.HandleSliderHorizontalInput((float) aBar, 0.0f, 1f, PlayerInput.CurrentProfile.InterfaceDeadzoneX); - if (aBar == (double) num3) + float num4 = Main.aBar = UILinksInitializer.HandleSlider((float) aBar, 0.0f, 1f, PlayerInput.CurrentProfile.InterfaceDeadzoneX); + if (aBar == (double) num4) break; if (Main.menuMode == 252) - Main.mouseBorderColorSlider.Alpha = num3; - SoundEngine.PlaySound(12); + Main.mouseBorderColorSlider.Alpha = num4; + Main.PlaySound(12); break; case 9: bool left = PlayerInput.Triggers.Current.Left; @@ -1662,23 +1472,20 @@ namespace Terraria.Initializers ++Main.PendingPlayer.hair; UILinksInitializer.SomeVarsForUILinkers.HairMoveCD = 12; } - int num4 = 51; - if (Main.PendingPlayer.hair >= num4) + int num5 = 51; + if (Main.PendingPlayer.hair >= num5) Main.PendingPlayer.hair = 0; if (Main.PendingPlayer.hair >= 0) break; - Main.PendingPlayer.hair = num4 - 1; + Main.PendingPlayer.hair = num5 - 1; break; case 10: - Main.GameZoomTarget = UILinksInitializer.HandleSliderHorizontalInput(Main.GameZoomTarget, 1f, 2f, PlayerInput.CurrentProfile.InterfaceDeadzoneX, 0.35f); + Main.GameZoomTarget = UILinksInitializer.HandleSlider(Main.GameZoomTarget, 1f, 2f, PlayerInput.CurrentProfile.InterfaceDeadzoneX, 0.35f); break; case 11: - Main.UIScale = UILinksInitializer.HandleSliderHorizontalInput(Main.UIScaleWanted, 0.5f, 2f, PlayerInput.CurrentProfile.InterfaceDeadzoneX, 0.35f); + Main.UIScale = UILinksInitializer.HandleSlider(Main.UIScaleWanted, 1f, 2f, PlayerInput.CurrentProfile.InterfaceDeadzoneX, 0.35f); Main.temporaryGUIScaleSlider = Main.UIScaleWanted; break; - case 12: - Main.MapScale = UILinksInitializer.HandleSliderHorizontalInput(Main.MapScale, 0.5f, 1f, PlayerInput.CurrentProfile.InterfaceDeadzoneX, 0.7f); - break; } } diff --git a/Initializers/WingStatsInitializer.cs b/Initializers/WingStatsInitializer.cs deleted file mode 100644 index 8301781..0000000 --- a/Initializers/WingStatsInitializer.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Initializers.WingStatsInitializer -// 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 Terraria.DataStructures; -using Terraria.ID; - -namespace Terraria.Initializers -{ - public class WingStatsInitializer - { - public static void Load() - { - WingStats[] wingStatsArray = new WingStats[47]; - float flySpeedOverride1 = 3f; - float flySpeedOverride2 = 6f; - float flySpeedOverride3 = 6.25f; - float flySpeedOverride4 = 6.5f; - float flySpeedOverride5 = 6.75f; - float flySpeedOverride6 = 7f; - float flySpeedOverride7 = 7.5f; - float flySpeedOverride8 = 8f; - float flySpeedOverride9 = 9f; - int flyTime1 = 25; - int flyTime2 = 100; - int flyTime3 = 130; - int flyTime4 = 150; - int flyTime5 = 160; - int flyTime6 = 170; - int flyTime7 = 180; - int flyTime8 = 150; - wingStatsArray[46] = new WingStats(flyTime1, flySpeedOverride1); - wingStatsArray[1] = new WingStats(flyTime2, flySpeedOverride3); - wingStatsArray[2] = new WingStats(flyTime2, flySpeedOverride3); - wingStatsArray[13] = new WingStats(flyTime2, flySpeedOverride3); - wingStatsArray[25] = new WingStats(flyTime3, flySpeedOverride5); - wingStatsArray[7] = new WingStats(flyTime3, flySpeedOverride5); - wingStatsArray[6] = new WingStats(flyTime3, flySpeedOverride5); - wingStatsArray[10] = new WingStats(flyTime3, flySpeedOverride5); - wingStatsArray[4] = new WingStats(flyTime4, flySpeedOverride4); - wingStatsArray[15] = new WingStats(flyTime5, flySpeedOverride7); - wingStatsArray[5] = new WingStats(flyTime5, flySpeedOverride7); - wingStatsArray[14] = new WingStats(flyTime5, flySpeedOverride7); - wingStatsArray[9] = new WingStats(flyTime5, flySpeedOverride7); - wingStatsArray[11] = new WingStats(flyTime6, flySpeedOverride7); - wingStatsArray[8] = new WingStats(flyTime6, flySpeedOverride7); - wingStatsArray[27] = new WingStats(flyTime6, flySpeedOverride7); - wingStatsArray[24] = new WingStats(flyTime6, flySpeedOverride7); - wingStatsArray[22] = new WingStats(flyTime6, flySpeedOverride4, hasHoldDownHoverFeatures: true, hoverFlySpeedOverride: 10f, hoverAccelerationMultiplier: 10f); - wingStatsArray[21] = new WingStats(flyTime7, flySpeedOverride7); - wingStatsArray[20] = new WingStats(flyTime7, flySpeedOverride7); - wingStatsArray[12] = new WingStats(flyTime7, flySpeedOverride7); - wingStatsArray[23] = new WingStats(flyTime7, flySpeedOverride7); - wingStatsArray[26] = new WingStats(flyTime7, flySpeedOverride8, 2f); - wingStatsArray[45] = new WingStats(flyTime7, flySpeedOverride8, 4.5f, true, 16f, 16f); - wingStatsArray[37] = new WingStats(flyTime4, flySpeedOverride6, 2.5f, true, 12f, 12f); - wingStatsArray[44] = new WingStats(flyTime4, flySpeedOverride8, 2f); - WingStats wingStats1 = new WingStats(flyTime4, flySpeedOverride2, 2.5f, true, 12f, 12f); - wingStatsArray[29] = new WingStats(flyTime7, flySpeedOverride9, 2.5f); - wingStatsArray[32] = new WingStats(flyTime7, flySpeedOverride9, 2.5f); - wingStatsArray[30] = new WingStats(flyTime7, flySpeedOverride4, 1.5f, true, 12f, 12f); - wingStatsArray[31] = new WingStats(flyTime7, flySpeedOverride4, 1.5f, true, 12f, 12f); - WingStats wingStats2 = new WingStats(flyTime8, flySpeedOverride6); - wingStatsArray[3] = wingStats2; - wingStatsArray[16] = wingStats2; - wingStatsArray[17] = wingStats2; - wingStatsArray[18] = wingStats2; - wingStatsArray[19] = wingStats2; - wingStatsArray[28] = wingStats2; - wingStatsArray[33] = wingStats2; - wingStatsArray[34] = wingStats2; - wingStatsArray[35] = wingStats2; - wingStatsArray[36] = wingStats2; - wingStatsArray[38] = wingStats2; - wingStatsArray[39] = wingStats2; - wingStatsArray[40] = wingStats2; - wingStatsArray[42] = wingStats2; - wingStatsArray[41] = wingStats2; - wingStatsArray[43] = wingStats2; - ArmorIDs.Wing.Sets.Stats = wingStatsArray; - } - } -} diff --git a/Item.cs b/Item.cs index 6e71981..9df3c29 100644 --- a/Item.cs +++ b/Item.cs @@ -1,17 +1,13 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Item -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using System; -using System.IO; using Terraria.Audio; -using Terraria.Enums; -using Terraria.GameContent; using Terraria.GameContent.Events; -using Terraria.GameContent.UI; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.UI; @@ -22,50 +18,37 @@ namespace Terraria public class Item : Entity { private string _nameOverride; - public const int luckPotionDuration1 = 10800; - public const int luckPotionDuration2 = 18000; - public const int luckPotionDuration3 = 36000; public const int flaskTime = 72000; public const int copper = 1; public const int silver = 100; public const int gold = 10000; public const int platinum = 1000000; - public const int goldCritterRarityColor = 3; - private readonly int shadowOrbPrice = Item.sellPrice(gold: 1, silver: 50); - private readonly int dungeonPrice = Item.sellPrice(gold: 1, silver: 75); - private readonly int queenBeePrice = Item.sellPrice(gold: 2); - private readonly int hellPrice = Item.sellPrice(gold: 2, silver: 50); - private readonly int eclipsePrice = Item.sellPrice(gold: 7, silver: 50); - private readonly int eclipsePostPlanteraPrice = Item.sellPrice(gold: 10); - private readonly int eclipseMothronPrice = Item.sellPrice(gold: 12, silver: 50); - public static int[] cachedItemSpawnsByType = ItemID.Sets.Factory.CreateIntSet(-1); + public static int[] itemCaches = ItemID.Sets.Factory.CreateIntSet(-1); public static int potionDelay = 3600; - public static int restorationDelay = 2700; + public static int restorationDelay = 3000; public bool questItem; - public static int[] headType = new int[266]; - public static int[] bodyType = new int[235]; - public static int[] legType = new int[218]; - public static bool[] staff = new bool[5045]; - public static bool[] claw = new bool[5045]; + public static int[] headType = new int[216]; + public static int[] bodyType = new int[210]; + public static int[] legType = new int[161]; + public static bool[] staff = new bool[3930]; + public static bool[] claw = new bool[3930]; public bool flame; public bool mech; public int noGrabDelay; public bool beingGrabbed; - public int timeSinceItemSpawned; + public bool isBeingGrabbed; + public int spawnTime; public int tileWand = -1; public bool wornArmor; - public int tooltipContext = -1; public byte dye; public int fishingPole = 1; public int bait; public static int coinGrabRange = 350; public static int manaGrabRange = 300; public static int lifeGrabRange = 250; - public static int treasureGrabRange = 150; public short makeNPC; public bool expertOnly; public bool expert; - public bool isAShopItem; public short hairDye = -1; public byte paint; public bool instanced; @@ -119,8 +102,7 @@ namespace Terraria public sbyte balloonSlot = -1; public int stringColor; public ItemTooltip ToolTip; - public string BestiaryNotes; - public int playerIndexTheItemIsReservedFor = (int) byte.MaxValue; + public int owner = (int) byte.MaxValue; public int rare; public int shoot; public float shootSpeed; @@ -133,7 +115,7 @@ namespace Terraria public int mana; public bool noUseGraphic; public bool noMelee; - public int timeSinceTheItemHasBeenReservedForSomeone; + public int release; public int value; public bool buy; public bool social; @@ -154,13 +136,11 @@ namespace Terraria public bool melee; public bool magic; public bool ranged; + public bool thrown; public bool summon; public bool sentry; public int reuseDelay; public bool newAndShiny; - public bool canBePlacedInVanityRegardlessOfConditions; - public const int WALL_PLACEMENT_USETIME = 7; - public static int numberOfNewItems = 0; public string Name => this._nameOverride ?? Lang.GetItemNameValue(this.type); @@ -177,42 +157,34 @@ namespace Terraria public static void StartCachingType(int t) { - if (Item.cachedItemSpawnsByType[t] != -1) + if (Item.itemCaches[t] != -1) return; - Item.cachedItemSpawnsByType[t] = 0; + Item.itemCaches[t] = 0; } public static void DropCache(Vector2 pos, Vector2 spread, int t, bool stopCaching = true) { - if (Item.cachedItemSpawnsByType[t] == -1) + if (Item.itemCaches[t] == -1) return; - int num = Item.cachedItemSpawnsByType[t]; - Item.cachedItemSpawnsByType[t] = stopCaching ? -1 : 0; + int itemCach = Item.itemCaches[t]; + Item.itemCaches[t] = stopCaching ? -1 : 0; Item obj = new Item(); obj.SetDefaults(t); int Stack; - for (; num > 0; num -= Stack) + for (; itemCach > 0; itemCach -= Stack) { Stack = obj.maxStack; - if (num < Stack) - Stack = num; + if (itemCach < Stack) + Stack = itemCach; Item.NewItem((int) pos.X, (int) pos.Y, (int) spread.X, (int) spread.Y, t, Stack); } } - public bool FitsAccessoryVanitySlot => this.canBePlacedInVanityRegardlessOfConditions || this.handOnSlot != (sbyte) -1 || this.handOffSlot != (sbyte) -1 || this.backSlot != (sbyte) -1 || this.frontSlot != (sbyte) -1 || this.shoeSlot != (sbyte) -1 || this.waistSlot != (sbyte) -1 || this.wingSlot != (sbyte) -1 || this.shieldSlot != (sbyte) -1 || this.neckSlot != (sbyte) -1 || this.faceSlot != (sbyte) -1 || this.balloonSlot != (sbyte) -1; - - public int OriginalRarity => ContentSamples.ItemsByType[this.type].rare; - - public int OriginalDamage => ContentSamples.ItemsByType[this.type].damage; - - public int OriginalDefense => ContentSamples.ItemsByType[this.type].defense; - public override string ToString() => string.Format("{{Name: \"{0}\" NetID: {1} Stack: {2}", (object) this.Name, (object) this.netID, (object) this.stack); public bool Prefix(int pre) { - if (!WorldGen.gen && Main.rand == null) + if (Main.rand == null) Main.rand = new UnifiedRandom(); if (pre == 0 || this.type == 0) return false; @@ -242,7 +214,7 @@ namespace Terraria num1 = -1; if (num1 == -1 || num1 == -2 || num1 == -3) { - if (this.type == 1 || this.type == 4 || this.type == 6 || this.type == 7 || this.type == 10 || this.type == 24 || this.type == 45 || this.type == 46 || this.type == 65 || this.type == 103 || this.type == 104 || this.type == 121 || this.type == 122 || this.type == 155 || this.type == 190 || this.type == 196 || this.type == 198 || this.type == 199 || this.type == 200 || this.type == 201 || this.type == 202 || this.type == 203 || this.type == 4258 || this.type == 204 || this.type == 213 || this.type == 217 || this.type == 273 || this.type == 367 || this.type == 368 || this.type == 426 || this.type == 482 || this.type == 483 || this.type == 484 || this.type == 653 || this.type == 654 || this.type == 656 || this.type == 657 || this.type == 659 || this.type == 660 || this.type == 671 || this.type == 672 || this.type == 674 || this.type == 675 || this.type == 676 || this.type == 723 || this.type == 724 || this.type == 757 || this.type == 776 || this.type == 777 || this.type == 778 || this.type == 787 || this.type == 795 || this.type == 797 || this.type == 798 || this.type == 799 || this.type == 881 || this.type == 882 || this.type == 921 || this.type == 922 || this.type == 989 || this.type == 990 || this.type == 991 || this.type == 992 || this.type == 993 || this.type == 1123 || this.type == 1166 || this.type == 1185 || this.type == 1188 || this.type == 1192 || this.type == 1195 || this.type == 1199 || this.type == 1202 || this.type == 1222 || this.type == 1223 || this.type == 1224 || this.type == 1226 || this.type == 1227 || this.type == 1230 || this.type == 1233 || this.type == 1234 || this.type == 1294 || this.type == 1304 || this.type == 1305 || this.type == 1306 || this.type == 1320 || this.type == 1327 || this.type == 1506 || this.type == 1507 || this.type == 1786 || this.type == 1826 || this.type == 1827 || this.type == 1909 || this.type == 1917 || this.type == 1928 || this.type == 2176 || this.type == 2273 || this.type == 2608 || this.type == 2341 || this.type == 2330 || this.type == 2320 || this.type == 2516 || this.type == 2517 || this.type == 2746 || this.type == 2745 || this.type == 3063 || this.type == 3018 || this.type == 3211 || this.type == 3013 || this.type == 3258 || this.type == 3106 || this.type == 3065 || this.type == 2880 || this.type == 3481 || this.type == 3482 || this.type == 3483 || this.type == 3484 || this.type == 3485 || this.type == 3487 || this.type == 3488 || this.type == 3489 || this.type == 3490 || this.type == 3491 || this.type == 3493 || this.type == 3494 || this.type == 3495 || this.type == 3496 || this.type == 3497 || this.type == 3499 || this.type == 3500 || this.type == 3501 || this.type == 3502 || this.type == 3503 || this.type == 3505 || this.type == 3506 || this.type == 3507 || this.type == 3508 || this.type == 3509 || this.type == 3511 || this.type == 3512 || this.type == 3513 || this.type == 3514 || this.type == 3515 || this.type == 3517 || this.type == 3518 || this.type == 3519 || this.type == 3520 || this.type == 3521 || this.type == 3522 || this.type == 3523 || this.type == 3524 || this.type == 3525 || this.type >= 3462 && this.type <= 3466 || this.type >= 2772 && this.type <= 2786 || this.type == 3349 || this.type == 3352 || this.type == 3351 || this.type >= 3764 && this.type <= 3769 || this.type == 4259 || this.type == 3772 || this.type == 3823 || this.type == 3827 || this.type == 186 || this.type == 946 || this.type == 4059 || this.type == 4317 || this.type == 4463 || this.type == 486 || this.type == 4707 || this.type == 4711 || this.type == 4956 || this.type == 4923 || this.type == 4788 || this.type == 4790 || this.type == 4789 || this.type == 4672 || this.type == 4913 || this.type == 4912 || this.type == 4911 || this.type == 4678 || this.type == 4679 || this.type == 4680 || this.type == 4914) + if (this.type == 1 || this.type == 4 || this.type == 6 || this.type == 7 || this.type == 10 || this.type == 24 || this.type == 45 || this.type == 46 || this.type == 65 || this.type == 103 || this.type == 104 || this.type == 121 || this.type == 122 || this.type == 155 || this.type == 190 || this.type == 196 || this.type == 198 || this.type == 199 || this.type == 200 || this.type == 201 || this.type == 202 || this.type == 203 || this.type == 204 || this.type == 213 || this.type == 217 || this.type == 273 || this.type == 367 || this.type == 368 || this.type == 426 || this.type == 482 || this.type == 483 || this.type == 484 || this.type == 653 || this.type == 654 || this.type == 656 || this.type == 657 || this.type == 659 || this.type == 660 || this.type == 671 || this.type == 672 || this.type == 674 || this.type == 675 || this.type == 676 || this.type == 723 || this.type == 724 || this.type == 757 || this.type == 776 || this.type == 777 || this.type == 778 || this.type == 787 || this.type == 795 || this.type == 797 || this.type == 798 || this.type == 799 || this.type == 881 || this.type == 882 || this.type == 921 || this.type == 922 || this.type == 989 || this.type == 990 || this.type == 991 || this.type == 992 || this.type == 993 || this.type == 1123 || this.type == 1166 || this.type == 1185 || this.type == 1188 || this.type == 1192 || this.type == 1195 || this.type == 1199 || this.type == 1202 || this.type == 1222 || this.type == 1223 || this.type == 1224 || this.type == 1226 || this.type == 1227 || this.type == 1230 || this.type == 1233 || this.type == 1234 || this.type == 1294 || this.type == 1304 || this.type == 1305 || this.type == 1306 || this.type == 1320 || this.type == 1327 || this.type == 1506 || this.type == 1507 || this.type == 1786 || this.type == 1826 || this.type == 1827 || this.type == 1909 || this.type == 1917 || this.type == 1928 || this.type == 2176 || this.type == 2273 || this.type == 2608 || this.type == 2341 || this.type == 2330 || this.type == 2320 || this.type == 2516 || this.type == 2517 || this.type == 2746 || this.type == 2745 || this.type == 3063 || this.type == 3018 || this.type == 3211 || this.type == 3013 || this.type == 3258 || this.type == 3106 || this.type == 3065 || this.type == 2880 || this.type == 3481 || this.type == 3482 || this.type == 3483 || this.type == 3484 || this.type == 3485 || this.type == 3487 || this.type == 3488 || this.type == 3489 || this.type == 3490 || this.type == 3491 || this.type == 3493 || this.type == 3494 || this.type == 3495 || this.type == 3496 || this.type == 3497 || this.type == 3498 || this.type == 3500 || this.type == 3501 || this.type == 3502 || this.type == 3503 || this.type == 3504 || this.type == 3505 || this.type == 3506 || this.type == 3507 || this.type == 3508 || this.type == 3509 || this.type == 3511 || this.type == 3512 || this.type == 3513 || this.type == 3514 || this.type == 3515 || this.type == 3517 || this.type == 3518 || this.type == 3519 || this.type == 3520 || this.type == 3521 || this.type == 3522 || this.type == 3523 || this.type == 3524 || this.type == 3525 || this.type >= 3462 && this.type <= 3466 || this.type >= 2772 && this.type <= 2786 || this.type == 3349 || this.type == 3352 || this.type == 3351 || this.type >= 3764 && this.type <= 3769 || this.type == 3772 || this.type == 3823 || this.type == 3827) { int num9 = unifiedRandom.Next(40); if (num9 == 0) @@ -326,7 +298,7 @@ namespace Terraria if (num9 == 39) num1 = 81; } - else if (this.type == 162 || this.type == 5011 || this.type == 5012 || this.type == 160 || this.type == 163 || this.type == 220 || this.type == 274 || this.type == 277 || this.type == 280 || this.type == 383 || this.type == 384 || this.type == 385 || this.type == 386 || this.type == 387 || this.type == 388 || this.type == 389 || this.type == 390 || this.type == 406 || this.type == 537 || this.type == 550 || this.type == 579 || this.type == 756 || this.type == 759 || this.type == 801 || this.type == 802 || this.type == 1186 || this.type == 1189 || this.type == 1190 || this.type == 1193 || this.type == 1196 || this.type == 1197 || this.type == 1200 || this.type == 1203 || this.type == 1204 || this.type == 1228 || this.type == 1231 || this.type == 1232 || this.type == 1259 || this.type == 1262 || this.type == 1297 || this.type == 1314 || this.type == 1325 || this.type == 1947 || this.type == 2332 || this.type == 2331 || this.type == 2342 || this.type == 2424 || this.type == 2611 || this.type == 2798 || this.type == 3012 || this.type == 3473 || this.type == 3098 || this.type == 3368 || this.type == 3835 || this.type == 3836 || this.type == 3858 || this.type == 4061 || this.type == 4144 || this.type == 4272 || this.type == 2774 || this.type == 2773 || this.type == 2779 || this.type == 2778 || this.type == 2784 || this.type == 2783 || this.type == 3464 || this.type == 3463) + else if (this.type == 162 || this.type == 160 || this.type == 163 || this.type == 220 || this.type == 274 || this.type == 277 || this.type == 280 || this.type == 383 || this.type == 384 || this.type == 385 || this.type == 386 || this.type == 387 || this.type == 388 || this.type == 389 || this.type == 390 || this.type == 406 || this.type == 537 || this.type == 550 || this.type == 579 || this.type == 756 || this.type == 759 || this.type == 801 || this.type == 802 || this.type == 1186 || this.type == 1189 || this.type == 1190 || this.type == 1193 || this.type == 1196 || this.type == 1197 || this.type == 1200 || this.type == 1203 || this.type == 1204 || this.type == 1228 || this.type == 1231 || this.type == 1232 || this.type == 1259 || this.type == 1262 || this.type == 1297 || this.type == 1314 || this.type == 1325 || this.type == 1947 || this.type == 2332 || this.type == 2331 || this.type == 2342 || this.type == 2424 || this.type == 2611 || this.type == 2798 || this.type == 3012 || this.type == 3473 || this.type == 3098 || this.type == 3368 || this.type == 3835 || this.type == 3836 || this.type == 3858) { int num10 = unifiedRandom.Next(14); if (num10 == 0) @@ -358,9 +330,9 @@ namespace Terraria if (num10 == 13) num1 = 61; } - else if (this.type == 39 || this.type == 44 || this.type == 95 || this.type == 96 || this.type == 98 || this.type == 99 || this.type == 120 || this.type == 164 || this.type == 197 || this.type == 219 || this.type == 266 || this.type == 281 || this.type == 434 || this.type == 435 || this.type == 436 || this.type == 481 || this.type == 506 || this.type == 533 || this.type == 534 || this.type == 578 || this.type == 655 || this.type == 658 || this.type == 661 || this.type == 679 || this.type == 682 || this.type == 725 || this.type == 758 || this.type == 759 || this.type == 760 || this.type == 796 || this.type == 800 || this.type == 905 || this.type == 923 || this.type == 964 || this.type == 986 || this.type == 1156 || this.type == 1187 || this.type == 1194 || this.type == 1201 || this.type == 1229 || this.type == 1254 || this.type == 1255 || this.type == 1258 || this.type == 1265 || this.type == 1319 || this.type == 1553 || this.type == 1782 || this.type == 1784 || this.type == 1835 || this.type == 1870 || this.type == 1910 || this.type == 1929 || this.type == 1946 || this.type == 2223 || this.type == 2269 || this.type == 2270 || this.type == 2624 || this.type == 2515 || this.type == 2747 || this.type == 2796 || this.type == 2797 || this.type == 3052 || this.type == 2888 || this.type == 3019 || this.type == 3029 || this.type == 3007 || this.type == 3008 || this.type == 3210 || this.type == 3107 || this.type == 3245 || this.type == 3475 || this.type == 3540 || this.type == 3854 || this.type == 3859 || this.type == 3821 || this.type == 3930 || this.type == 3480 || this.type == 3486 || this.type == 3492 || this.type == 3498 || this.type == 3504 || this.type == 3510 || this.type == 3516 || this.type == 3350 || this.type == 3546 || this.type == 3788 || this.type == 4058 || this.type == 4060 || this.type == 4381 || this.type == 4703 || this.type == 4953) + else if (this.type == 39 || this.type == 44 || this.type == 95 || this.type == 96 || this.type == 98 || this.type == 99 || this.type == 120 || this.type == 164 || this.type == 197 || this.type == 219 || this.type == 266 || this.type == 281 || this.type == 434 || this.type == 435 || this.type == 436 || this.type == 481 || this.type == 506 || this.type == 533 || this.type == 534 || this.type == 578 || this.type == 655 || this.type == 658 || this.type == 661 || this.type == 679 || this.type == 682 || this.type == 725 || this.type == 758 || this.type == 759 || this.type == 760 || this.type == 796 || this.type == 800 || this.type == 905 || this.type == 923 || this.type == 964 || this.type == 986 || this.type == 1156 || this.type == 1187 || this.type == 1194 || this.type == 1201 || this.type == 1229 || this.type == 1254 || this.type == 1255 || this.type == 1258 || this.type == 1265 || this.type == 1319 || this.type == 1553 || this.type == 1782 || this.type == 1784 || this.type == 1835 || this.type == 1870 || this.type == 1910 || this.type == 1929 || this.type == 1946 || this.type == 2223 || this.type == 2269 || this.type == 2270 || this.type == 2624 || this.type == 2515 || this.type == 2747 || this.type == 2796 || this.type == 2797 || this.type == 3052 || this.type == 2888 || this.type == 3019 || this.type == 3029 || this.type == 3007 || this.type == 3008 || this.type == 3210 || this.type == 3107 || this.type == 3245 || this.type == 3475 || this.type == 3540 || this.type == 3854 || this.type == 3859 || this.type == 3821 || this.type == 3480 || this.type == 3486 || this.type == 3492 || this.type == 3498 || this.type == 3504 || this.type == 3510 || this.type == 3516 || this.type == 3350 || this.type == 3546 || this.type == 3788) { - int num11 = unifiedRandom.Next(35); + int num11 = unifiedRandom.Next(36); if (num11 == 0) num1 = 16; if (num11 == 1) @@ -406,33 +378,35 @@ namespace Terraria if (num11 == 21) num1 = 57; if (num11 == 22) - num1 = 43; + num1 = 42; if (num11 == 23) - num1 = 44; + num1 = 43; if (num11 == 24) - num1 = 45; + num1 = 44; if (num11 == 25) - num1 = 46; + num1 = 45; if (num11 == 26) - num1 = 47; + num1 = 46; if (num11 == 27) - num1 = 48; + num1 = 47; if (num11 == 28) - num1 = 49; + num1 = 48; if (num11 == 29) - num1 = 50; + num1 = 49; if (num11 == 30) - num1 = 51; + num1 = 50; if (num11 == 31) - num1 = 59; + num1 = 51; if (num11 == 32) - num1 = 60; + num1 = 59; if (num11 == 33) - num1 = 61; + num1 = 60; if (num11 == 34) + num1 = 61; + if (num11 == 35) num1 = 82; } - else if (this.type == 64 || this.type == 112 || this.type == 113 || this.type == (int) sbyte.MaxValue || this.type == 157 || this.type == 165 || this.type == 218 || this.type == 272 || this.type == 494 || this.type == 495 || this.type == 496 || this.type == 514 || this.type == 517 || this.type == 518 || this.type == 519 || this.type == 683 || this.type == 726 || this.type == 739 || this.type == 740 || this.type == 741 || this.type == 742 || this.type == 743 || this.type == 744 || this.type == 788 || this.type == 1121 || this.type == 1155 || this.type == 1157 || this.type == 1178 || this.type == 1244 || this.type == 1256 || this.type == 1260 || this.type == 1264 || this.type == 1266 || this.type == 1295 || this.type == 1296 || this.type == 1308 || this.type == 1309 || this.type == 1313 || this.type == 1336 || this.type == 1444 || this.type == 1445 || this.type == 1446 || this.type == 1572 || this.type == 1801 || this.type == 1802 || this.type == 1930 || this.type == 1931 || this.type == 2188 || this.type == 2622 || this.type == 2621 || this.type == 2584 || this.type == 2551 || this.type == 2366 || this.type == 2535 || this.type == 2365 || this.type == 2364 || this.type == 2623 || this.type == 2750 || this.type == 2795 || this.type == 3053 || this.type == 3051 || this.type == 3209 || this.type == 3014 || this.type == 3105 || this.type == 2882 || this.type == 3269 || this.type == 3006 || this.type == 3377 || this.type == 3069 || this.type == 2749 || this.type == 3249 || this.type == 3476 || this.type == 3474 || this.type == 3531 || this.type == 3541 || this.type == 3542 || this.type == 3569 || this.type == 3570 || this.type == 3571 || this.type == 3779 || this.type == 3787 || this.type == 3531 || this.type == 3852 || this.type == 3870 || this.type == 4269 || this.type == 4273 || this.type == 4281 || this.type == 4347 || this.type == 4348 || this.type == 4270 || this.type == 4758 || this.type == 4715 || this.type == 4952 || this.type == 4607 || this.type == 5005 || this.type == 3824 || this.type == 3818 || this.type == 3829 || this.type == 3832 || this.type == 3825 || this.type == 3819 || this.type == 3830 || this.type == 3833 || this.type == 3826 || this.type == 3820 || this.type == 3831 || this.type == 3834 || this.type == 4062) + else if (this.type == 64 || this.type == 112 || this.type == 113 || this.type == (int) sbyte.MaxValue || this.type == 157 || this.type == 165 || this.type == 218 || this.type == 272 || this.type == 494 || this.type == 495 || this.type == 496 || this.type == 514 || this.type == 517 || this.type == 518 || this.type == 519 || this.type == 683 || this.type == 726 || this.type == 739 || this.type == 740 || this.type == 741 || this.type == 742 || this.type == 743 || this.type == 744 || this.type == 788 || this.type == 1121 || this.type == 1155 || this.type == 1157 || this.type == 1178 || this.type == 1244 || this.type == 1256 || this.type == 1260 || this.type == 1264 || this.type == 1266 || this.type == 1295 || this.type == 1296 || this.type == 1308 || this.type == 1309 || this.type == 1313 || this.type == 1336 || this.type == 1444 || this.type == 1445 || this.type == 1446 || this.type == 1572 || this.type == 1801 || this.type == 1802 || this.type == 1930 || this.type == 1931 || this.type == 2188 || this.type == 2622 || this.type == 2621 || this.type == 2584 || this.type == 2551 || this.type == 2366 || this.type == 2535 || this.type == 2365 || this.type == 2364 || this.type == 2623 || this.type == 2750 || this.type == 2795 || this.type == 3053 || this.type == 3051 || this.type == 3209 || this.type == 3014 || this.type == 3105 || this.type == 2882 || this.type == 3269 || this.type == 3006 || this.type == 3377 || this.type == 3069 || this.type == 2749 || this.type == 3249 || this.type == 3476 || this.type == 3474 || this.type == 3531 || this.type == 3541 || this.type == 3542 || this.type == 3569 || this.type == 3570 || this.type == 3571 || this.type == 3779 || this.type == 3787 || this.type == 3531 || this.type == 3852 || this.type == 3870 || this.type == 3824 || this.type == 3818 || this.type == 3829 || this.type == 3832 || this.type == 3825 || this.type == 3819 || this.type == 3830 || this.type == 3833 || this.type == 3826 || this.type == 3820 || this.type == 3831 || this.type == 3834) { int num12 = unifiedRandom.Next(36); if (num12 == 0) @@ -508,11 +482,9 @@ namespace Terraria if (num12 == 35) num1 = 83; } - else if (this.type == 55 || this.type == 119 || this.type == 191 || this.type == 284 || this.type == 670 || this.type == 1122 || this.type == 1513 || this.type == 1569 || this.type == 1571 || this.type == 1825 || this.type == 1918 || this.type == 3054 || this.type == 3262 || this.type >= 3278 && this.type <= 3292 || this.type >= 3315 && this.type <= 3317 || this.type == 3389 || this.type == 3030 || this.type == 3543 || this.type == 4764 || this.type == 4818 || this.type == 4760) + else if (this.type == 55 || this.type == 119 || this.type == 191 || this.type == 284 || this.type == 670 || this.type == 1122 || this.type == 1513 || this.type == 1569 || this.type == 1571 || this.type == 1825 || this.type == 1918 || this.type == 3054 || this.type == 3262 || this.type >= 3278 && this.type <= 3292 || this.type >= 3315 && this.type <= 3317 || this.type == 3389 || this.type == 3030 || this.type == 3543) { int num13 = unifiedRandom.Next(14); - if (this.type == 3389) - num13 = unifiedRandom.Next(15); if (num13 == 0) num1 = 36; if (num13 == 1) @@ -541,12 +513,10 @@ namespace Terraria num1 = 60; if (num13 == 13) num1 = 61; - if (num13 == 14) - num1 = 84; } else { - if (!this.IsAPrefixableAccessory()) + if (!this.accessory || this.type == 267 || this.type == 562 || this.type == 563 || this.type == 564 || this.type == 565 || this.type == 566 || this.type == 567 || this.type == 568 || this.type == 569 || this.type == 570 || this.type == 571 || this.type == 572 || this.type == 573 || this.type == 574 || this.type == 576 || this.type == 1307 || this.type >= 1596 && this.type < 1610 || this.vanity) return false; num1 = unifiedRandom.Next(62, 81); } @@ -832,11 +802,6 @@ namespace Terraria num4 = 0.9f; num7 = 0.9f; break; - case 84: - num3 = 1.17f; - num2 = 1.17f; - num8 = 8; - break; } if ((double) num2 != 1.0 && Math.Round((double) this.damage * (double) num2) == (double) this.damage) { @@ -873,7 +838,7 @@ namespace Terraria this.scale *= num5; this.shootSpeed *= num6; this.crit += num8; - float num14 = (float) (1.0 * (double) num2 * (2.0 - (double) num4) * (2.0 - (double) num7) * (double) num5 * (double) num3 * (double) num6 * (1.0 + (double) num8 * 0.0199999995529652)); + float num14 = (float) (1.0 * (double) num2 * (2.0 - (double) num4) * (2.0 - (double) num7) * (double) num5 * (double) num3 * (double) num6 * (1.0 + (double) this.crit * 0.0199999995529652)); if (num1 == 62 || num1 == 69 || num1 == 73 || num1 == 77) num14 *= 1.05f; if (num1 == 63 || num1 == 70 || num1 == 74 || num1 == 78 || num1 == 67) @@ -902,8 +867,6 @@ namespace Terraria return true; } - private bool IsAPrefixableAccessory() => this.accessory && !this.vanity && ItemID.Sets.CanGetPrefixes[this.type]; - public string AffixName() { if (this.prefix < (byte) 0 || (int) this.prefix >= Lang.prefix.Length) @@ -914,12 +877,7 @@ namespace Terraria return str.StartsWith("(") ? this.Name + " " + str : str + " " + this.Name; } - public void RebuildTooltip() - { - if (this.type < 0) - return; - this.ToolTip = Lang.GetTooltip(this.netID); - } + public void RebuildTooltip() => this.ToolTip = Lang.GetTooltip(this.netID); public Rectangle getRect() => new Rectangle((int) this.position.X, (int) this.position.Y, this.width, this.height); @@ -930,6 +888,17 @@ namespace Terraria this.material = false; return false; } + for (int index1 = 0; index1 < Recipe.numRecipes; ++index1) + { + for (int index2 = 0; Main.recipe[index1].requiredItem[index2].type > 0; ++index2) + { + if (this.netID == Main.recipe[index1].requiredItem[index2].netID) + { + this.material = true; + return true; + } + } + } switch (this.type) { case 529: @@ -939,33 +908,9 @@ namespace Terraria case 852: case 853: case 1151: - case 3272: - case 3274: - case 3275: - case 3338: - case 4261: - case 4282: - case 4286: - case 4290: - case 4295: this.material = true; return true; - case 4076: - case 4131: - this.material = false; - return false; default: - for (int index1 = 0; index1 < Recipe.numRecipes; ++index1) - { - for (int index2 = 0; Main.recipe[index1].requiredItem[index2].type > 0; ++index2) - { - if (this.netID == Main.recipe[index1].requiredItem[index2].netID) - { - this.material = true; - return true; - } - } - } this.material = false; return false; } @@ -1127,7 +1072,7 @@ namespace Terraria this.SetDefaults(type); } - public static int BannerToItem(int banner) => banner < 276 ? (banner < 274 ? (banner != 273 ? (banner < 267 ? (banner < 257 ? (banner < 252 ? (banner != 251 ? (banner < 249 ? (banner < 186 ? (banner < 88 ? 1615 + banner - 1 : 2897 + banner - 88) : 3390 + banner - 186) : 3593 + banner - 249) : 3780) : 3789 + banner - 252) : 3837 + banner - 257) : 4541 + banner - 267) : 4602) : 4687 + banner - 274) : 4965 + banner - 276; + public static int BannerToItem(int banner) => banner < 257 ? (banner < 252 ? (banner != 251 ? (banner < 249 ? (banner < 186 ? (banner < 88 ? 1615 + banner - 1 : 2897 + banner - 88) : 3390 + banner - 186) : 3593 + banner - 249) : 3780) : 3789 + banner - 252) : 3837 + banner - 257; public static int NPCtoBanner(int i) { @@ -1143,9 +1088,6 @@ namespace Terraria return 155; case -6: return 90; - case -5: - case 16: - return 146; case -4: return 151; case -3: @@ -1153,9 +1095,6 @@ namespace Terraria case -2: case 121: return 167; - case -1: - case 81: - return 99; case 1: case 302: case 333: @@ -1164,6 +1103,7 @@ namespace Terraria case 336: return 69; case 2: + case 133: case 190: case 191: case 192: @@ -1190,9 +1130,6 @@ namespace Terraria case 434: case 435: case 436: - case 590: - case 591: - case 632: return 87; case 6: return 27; @@ -1205,6 +1142,8 @@ namespace Terraria case 96: case 97: return 84; + case 16: + return 146; case 21: case 201: case 202: @@ -1240,6 +1179,7 @@ namespace Terraria case 41: return 13; case 42: + case 176: case 231: case 232: case 233: @@ -1313,6 +1253,8 @@ namespace Terraria return 245; case 80: return 246; + case 81: + return 99; case 82: return 85; case 83: @@ -1320,7 +1262,6 @@ namespace Terraria case 84: return 28; case 85: - case 629: return 16; case 86: return 77; @@ -1357,8 +1298,6 @@ namespace Terraria return 15; case 122: return 37; - case 133: - return 288; case 137: return 128; case 138: @@ -1428,8 +1367,6 @@ namespace Terraria return 46; case 175: return 88; - case 176: - return 287; case 177: return 26; case 179: @@ -1642,7 +1579,6 @@ namespace Terraria case 408: return 218; case 409: - case 410: return 219; case 411: return 216; @@ -1653,7 +1589,6 @@ namespace Terraria case 415: return 226; case 416: - case 518: return 225; case 417: return 223; @@ -1679,8 +1614,6 @@ namespace Terraria return 232; case 429: return 235; - case 438: - return 93; case 460: return 196; case 461: @@ -1689,10 +1622,6 @@ namespace Terraria return 190; case 463: return 199; - case 464: - return 281; - case 465: - return 282; case 466: return 197; case 467: @@ -1701,19 +1630,9 @@ namespace Terraria return 192; case 469: return 195; - case 470: - return 283; case 471: return 186; - case 473: - return 284; - case 474: - return 285; - case 475: - return 286; case 477: - case 478: - case 479: return 193; case 480: return 201; @@ -1744,10 +1663,8 @@ namespace Terraria case 506: return 187; case 508: - case 580: return 210; case 509: - case 581: return 209; case 510: case 511: @@ -1774,8 +1691,6 @@ namespace Terraria return 214; case 533: return 213; - case 536: - return 267; case 537: return 249; case 541: @@ -1823,34 +1738,6 @@ namespace Terraria return 261; case 578: return 266; - case 582: - return 280; - case 586: - return 268; - case 587: - return 269; - case 618: - return 273; - case 619: - return 270; - case 620: - return 272; - case 621: - case 622: - case 623: - return 271; - case 624: - return 275; - case 628: - return 274; - case 630: - return 277; - case 631: - return 276; - case 634: - return 279; - case 635: - return 278; default: return 0; } @@ -2044,8 +1931,6 @@ namespace Terraria return 273; case 92: return 379; - case 93: - return 438; case 95: return 287; case 96: @@ -2267,9 +2152,9 @@ namespace Terraria case 208: return 510; case 209: - return 581; + return 509; case 210: - return 580; + return 508; case 211: return 524; case 212: @@ -2380,59 +2265,11 @@ namespace Terraria return 561; case 266: return 578; - case 267: - return 536; - case 268: - return 586; - case 269: - return 587; - case 270: - return 619; - case 271: - return 621; - case 272: - return 620; - case 273: - return 618; - case 274: - return 628; - case 275: - return 624; - case 276: - return 631; - case 277: - return 630; - case 278: - return 635; - case 279: - return 634; - case 280: - return 582; - case 281: - return 464; - case 282: - return 465; - case 283: - return 470; - case 284: - return 473; - case 285: - return 474; - case 286: - return 475; - case 287: - return 176; - case 288: - return 133; default: return 0; } } - public bool FitsAmmoSlot() => (this.type == 0 || this.ammo > 0 || this.bait > 0 || this.type == 530 || this.type == 849 || this.paint > (byte) 0) && !this.notAmmo || this.type == 353; - - public bool CanFillEmptyAmmoSlot() => this.bait <= 0 && this.paint == (byte) 0 && this.type != 353 && this.type != 849 && this.type != 169 && this.type != 75 && this.type != 23 && this.type != 408 && this.type != 370 && this.type != 1246 && this.type != 154 && !this.notAmmo; - public void SetDefaults1(int type) { if (type == 1) @@ -2509,21 +2346,19 @@ namespace Terraria } else if (type == 6) { - this.autoReuse = false; - this.useStyle = 13; + this.useStyle = 3; + this.useTurn = false; this.useAnimation = 12; this.useTime = 12; - this.width = 50; - this.height = 18; - this.shoot = 940; - this.UseSound = SoundID.Item1; + this.width = 24; + this.height = 28; this.damage = 8; this.knockBack = 4f; - this.shootSpeed = 2.1f; - this.noMelee = true; - this.SetShopValues(ItemRarityColor.White0, Item.sellPrice(silver: 2, copper: 80)); + this.scale = 0.9f; + this.UseSound = SoundID.Item1; + this.useTurn = true; + this.value = 1400; this.melee = true; - this.noUseGraphic = true; } else if (type == 7) { @@ -2552,7 +2387,7 @@ namespace Terraria this.useTime = 10; this.holdStyle = 1; this.autoReuse = true; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 4; this.width = 10; @@ -2629,7 +2464,7 @@ namespace Terraria this.createTile = 8; this.width = 12; this.height = 12; - this.value = Item.sellPrice(silver: 3); + this.value = 2000; } else if (type == 14) { @@ -2643,7 +2478,7 @@ namespace Terraria this.createTile = 9; this.width = 12; this.height = 12; - this.value = Item.sellPrice(silver: 1, copper: 50); + this.value = 1000; } else if (type == 15) { @@ -2682,7 +2517,7 @@ namespace Terraria { this.width = 20; this.height = 20; - this.maxStack = 999; + this.maxStack = 99; this.value = 6000; this.useStyle = 1; this.useTurn = true; @@ -2697,7 +2532,7 @@ namespace Terraria { this.width = 20; this.height = 20; - this.maxStack = 999; + this.maxStack = 99; this.value = 750; this.useStyle = 1; this.useTurn = true; @@ -2712,7 +2547,7 @@ namespace Terraria { this.width = 20; this.height = 20; - this.maxStack = 999; + this.maxStack = 99; this.value = 3000; this.useStyle = 1; this.useTurn = true; @@ -2728,7 +2563,7 @@ namespace Terraria this.color = new Color(160, 145, 130, 110); this.width = 20; this.height = 20; - this.maxStack = 999; + this.maxStack = 99; this.value = 1500; this.useStyle = 1; this.useTurn = true; @@ -2796,9 +2631,8 @@ namespace Terraria this.useStyle = 1; this.useAnimation = 15; this.useTime = 10; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; - this.autoReuse = true; this.createTile = 20; this.width = 18; this.height = 18; @@ -2808,7 +2642,7 @@ namespace Terraria { this.UseSound = SoundID.Item3; this.healLife = 50; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -3004,7 +2838,7 @@ namespace Terraria this.noUseGraphic = true; this.noMelee = true; this.value = 15; - this.ranged = true; + this.thrown = true; } else if (type == 43) { @@ -3015,7 +2849,6 @@ namespace Terraria this.useAnimation = 45; this.useTime = 45; this.maxStack = 20; - this.rare = 1; } else if (type == 44) { @@ -3061,7 +2894,7 @@ namespace Terraria this.width = 24; this.height = 28; this.damage = 17; - this.scale = 1.4f; + this.scale = 1.1f; this.UseSound = SoundID.Item1; this.rare = 1; this.value = 13500; @@ -3199,15 +3032,15 @@ namespace Terraria this.width = 12; this.height = 12; this.rare = 1; - this.value = Item.sellPrice(silver: 10); + this.value = 4000; } else if (type == 57) { this.width = 20; this.height = 20; - this.maxStack = 999; + this.maxStack = 99; this.rare = 1; - this.value = Item.sellPrice(silver: 30); + this.value = 16000; this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; @@ -3228,7 +3061,7 @@ namespace Terraria this.useStyle = 1; this.useAnimation = 15; this.useTime = 10; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 23; this.width = 14; @@ -3262,7 +3095,7 @@ namespace Terraria this.useStyle = 1; this.useAnimation = 15; this.useTime = 10; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 2; this.width = 14; @@ -3281,7 +3114,7 @@ namespace Terraria this.createTile = 27; this.width = 26; this.height = 26; - this.value = Item.buyPrice(silver: 50); + this.value = 200; } else if (type == 64) { @@ -3292,12 +3125,13 @@ namespace Terraria this.shoot = 7; this.width = 26; this.height = 28; + this.UseSound = SoundID.Item8; this.useAnimation = 28; this.useTime = 28; this.rare = 1; this.noMelee = true; this.knockBack = 1f; - this.value = this.shadowOrbPrice; + this.value = 10000; this.magic = true; } else if (type == 65) @@ -3373,7 +3207,6 @@ namespace Terraria this.width = 28; this.height = 28; this.maxStack = 20; - this.rare = 1; } else if (type == 71) { @@ -3462,8 +3295,8 @@ namespace Terraria else if (type == 75) { this.width = 18; - this.height = 18; - this.maxStack = 999; + this.height = 20; + this.maxStack = 99; this.alpha = 75; this.ammo = AmmoID.FallenStar; this.value = Item.sellPrice(silver: 5); @@ -3481,7 +3314,7 @@ namespace Terraria this.height = 18; this.defense = 1; this.legSlot = 1; - this.value = 1000; + this.value = 750; } else if (type == 77) { @@ -3489,7 +3322,7 @@ namespace Terraria this.height = 18; this.defense = 2; this.legSlot = 2; - this.value = 4000; + this.value = 3000; } else if (type == 78) { @@ -3497,7 +3330,7 @@ namespace Terraria this.height = 18; this.defense = 3; this.legSlot = 3; - this.value = 10000; + this.value = 7500; } else if (type == 79) { @@ -3505,7 +3338,7 @@ namespace Terraria this.height = 18; this.defense = 4; this.legSlot = 4; - this.value = 20000; + this.value = 15000; } else if (type == 80) { @@ -3513,7 +3346,7 @@ namespace Terraria this.height = 18; this.defense = 2; this.bodySlot = 1; - this.value = 1250; + this.value = 1000; } else if (type == 81) { @@ -3521,7 +3354,7 @@ namespace Terraria this.height = 18; this.defense = 3; this.bodySlot = 2; - this.value = 5000; + this.value = 4000; } else if (type == 82) { @@ -3529,7 +3362,7 @@ namespace Terraria this.height = 18; this.defense = 4; this.bodySlot = 3; - this.value = 12500; + this.value = 10000; } else if (type == 83) { @@ -3537,7 +3370,7 @@ namespace Terraria this.height = 18; this.defense = 5; this.bodySlot = 4; - this.value = 25000; + this.value = 20000; } else if (type == 84) { @@ -3575,7 +3408,7 @@ namespace Terraria { this.width = 14; this.height = 18; - this.maxStack = 999; + this.maxStack = 99; this.rare = 1; this.value = 500; } @@ -3608,7 +3441,7 @@ namespace Terraria this.height = 18; this.defense = 1; this.headSlot = 1; - this.value = 750; + this.value = 1250; } else if (type == 90) { @@ -3616,7 +3449,7 @@ namespace Terraria this.height = 18; this.defense = 2; this.headSlot = 2; - this.value = 3000; + this.value = 5000; } else if (type == 91) { @@ -3624,7 +3457,7 @@ namespace Terraria this.height = 18; this.defense = 3; this.headSlot = 3; - this.value = 7500; + this.value = 12500; } else if (type == 92) { @@ -3632,7 +3465,7 @@ namespace Terraria this.height = 18; this.defense = 4; this.headSlot = 4; - this.value = 15000; + this.value = 25000; } else if (type == 93) { @@ -3692,7 +3525,7 @@ namespace Terraria this.damage = 31; this.shootSpeed = 9f; this.noMelee = true; - this.value = this.shadowOrbPrice; + this.value = 100000; this.knockBack = 5.25f; this.rare = 1; this.ranged = true; @@ -3822,7 +3655,6 @@ namespace Terraria this.createTile = 33; this.width = 8; this.height = 18; - this.value = Item.sellPrice(silver: 3); this.holdStyle = 1; } else if (type == 106) @@ -3885,7 +3717,7 @@ namespace Terraria { this.UseSound = SoundID.Item3; this.healMana = 50; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -3901,7 +3733,7 @@ namespace Terraria this.height = 22; this.accessory = true; this.rare = 1; - this.value = this.shadowOrbPrice; + this.value = 50000; this.handOnSlot = (sbyte) 3; } else if (type == 112) @@ -3919,12 +3751,12 @@ namespace Terraria this.rare = 3; this.noMelee = true; this.knockBack = 5.5f; - this.value = this.hellPrice; + this.value = 10000; this.magic = true; } else if (type == 113) { - this.mana = 12; + this.mana = 10; this.channel = true; this.damage = 27; this.useStyle = 1; @@ -3933,12 +3765,12 @@ namespace Terraria this.width = 26; this.height = 28; this.UseSound = SoundID.Item9; - this.useAnimation = 18; - this.useTime = 18; + this.useAnimation = 17; + this.useTime = 17; this.rare = 2; this.noMelee = true; this.knockBack = 7.5f; - this.value = this.dungeonPrice; + this.value = 10000; this.magic = true; } else if (type == 114) @@ -3969,7 +3801,7 @@ namespace Terraria this.useTime = 20; this.rare = 1; this.noMelee = true; - this.value = this.shadowOrbPrice; + this.value = 10000; this.buffType = 19; } else if (type == 116) @@ -3990,7 +3822,7 @@ namespace Terraria { this.width = 20; this.height = 20; - this.maxStack = 999; + this.maxStack = 99; this.rare = 1; this.value = 7000; this.useStyle = 1; @@ -4050,7 +3882,7 @@ namespace Terraria else if (type == 121) { this.useStyle = 1; - this.useAnimation = 30; + this.useAnimation = 34; this.knockBack = 6.5f; this.width = 24; this.height = 28; @@ -4110,7 +3942,7 @@ namespace Terraria { this.UseSound = SoundID.Item3; this.healLife = 20; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -4131,7 +3963,7 @@ namespace Terraria this.height = 28; this.shoot = 20; this.mana = 7; - this.UseSound = SoundID.Item157; + this.UseSound = SoundID.Item12; this.knockBack = 0.75f; this.damage = 19; this.shootSpeed = 10f; @@ -4253,7 +4085,6 @@ namespace Terraria this.createTile = 42; this.width = 12; this.height = 28; - this.value = Item.sellPrice(copper: 30); } else if (type == 137) { @@ -4412,7 +4243,6 @@ namespace Terraria this.createTile = 49; this.width = 8; this.height = 18; - this.value = Item.sellPrice(silver: 1); this.holdStyle = 1; this.rare = 1; } @@ -4488,8 +4318,9 @@ namespace Terraria this.damage = 20; this.knockBack = 2.3f; this.shoot = 21; - this.ranged = true; + this.thrown = true; this.ammo = 154; + this.notAmmo = false; } else if (type == 155) { @@ -4499,11 +4330,11 @@ namespace Terraria this.useAnimation = 18; this.width = 40; this.height = 40; - this.damage = 21; + this.damage = 19; this.scale = 1.1f; this.UseSound = SoundID.Item1; this.rare = 2; - this.value = this.dungeonPrice; + this.value = 27000; this.knockBack = 2.5f; this.melee = true; } @@ -4512,7 +4343,7 @@ namespace Terraria this.width = 24; this.height = 28; this.rare = 2; - this.value = this.dungeonPrice; + this.value = 27000; this.accessory = true; this.defense = 1; this.shieldSlot = (sbyte) 1; @@ -4534,7 +4365,7 @@ namespace Terraria this.UseSound = SoundID.Item13; this.noMelee = true; this.rare = 2; - this.value = this.dungeonPrice; + this.value = 27000; this.magic = true; } else if (type == 158) @@ -4550,7 +4381,7 @@ namespace Terraria this.width = 14; this.height = 28; this.rare = 1; - this.value = Item.sellPrice(gold: 1, silver: 50); + this.value = 27000; this.accessory = true; this.balloonSlot = (sbyte) 8; } @@ -4590,14 +4421,14 @@ namespace Terraria this.noUseGraphic = true; this.noMelee = true; this.value = 80; - this.ranged = true; + this.thrown = true; } else if (type == 162) { this.useStyle = 5; this.useAnimation = 45; this.useTime = 45; - this.knockBack = 5.5f; + this.knockBack = 6.5f; this.width = 30; this.height = 10; this.damage = 15; @@ -4607,7 +4438,7 @@ namespace Terraria this.shootSpeed = 12f; this.UseSound = SoundID.Item1; this.rare = 1; - this.value = this.shadowOrbPrice; + this.value = 27000; this.melee = true; this.channel = true; this.noMelee = true; @@ -4618,17 +4449,17 @@ namespace Terraria this.useStyle = 5; this.useAnimation = 45; this.useTime = 45; - this.knockBack = 6f; + this.knockBack = 7f; this.width = 30; this.height = 10; - this.damage = 27; + this.damage = 23; this.scale = 1.1f; this.noUseGraphic = true; this.shoot = 26; this.shootSpeed = 12f; this.UseSound = SoundID.Item1; this.rare = 2; - this.value = this.dungeonPrice; + this.value = 27000; this.melee = true; this.channel = true; } @@ -4636,8 +4467,8 @@ namespace Terraria { this.autoReuse = false; this.useStyle = 5; - this.useAnimation = 10; - this.useTime = 10; + this.useAnimation = 12; + this.useTime = 12; this.width = 24; this.height = 24; this.shoot = 14; @@ -4647,7 +4478,7 @@ namespace Terraria this.damage = 17; this.shootSpeed = 10f; this.noMelee = true; - this.value = this.dungeonPrice; + this.value = 50000; this.scale = 0.85f; this.rare = 2; this.ranged = true; @@ -4670,7 +4501,7 @@ namespace Terraria this.shootSpeed = 4.5f; this.knockBack = 5f; this.magic = true; - this.value = Item.sellPrice(gold: 1, silver: 50); + this.value = 50000; } else if (type == 166) { @@ -4696,7 +4527,7 @@ namespace Terraria this.shoot = 29; this.width = 8; this.height = 28; - this.maxStack = 99; + this.maxStack = 30; this.consumable = true; this.UseSound = SoundID.Item1; this.useAnimation = 40; @@ -4723,7 +4554,7 @@ namespace Terraria this.value = 75; this.damage = 60; this.knockBack = 8f; - this.ranged = true; + this.thrown = true; } else if (type == 169) { @@ -4738,7 +4569,6 @@ namespace Terraria this.width = 12; this.height = 12; this.ammo = AmmoID.Sand; - this.notAmmo = true; } else if (type == 170) { @@ -4805,13 +4635,12 @@ namespace Terraria this.width = 12; this.height = 12; this.rare = 2; - this.value = Item.sellPrice(silver: 2, copper: 50); } else if (type == 175) { this.width = 20; this.height = 20; - this.maxStack = 999; + this.maxStack = 99; this.rare = 2; this.value = 20000; this.useStyle = 1; @@ -4975,13 +4804,6 @@ namespace Terraria this.rare = 1; this.value = 10000; this.holdStyle = 2; - this.useStyle = 1; - this.useAnimation = 27; - this.useTime = 19; - this.knockBack = 4f; - this.damage = 10; - this.UseSound = SoundID.Item1; - this.melee = true; } else if (type == 187) { @@ -4996,7 +4818,7 @@ namespace Terraria { this.UseSound = SoundID.Item3; this.healLife = 100; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -5012,7 +4834,7 @@ namespace Terraria { this.UseSound = SoundID.Item3; this.healMana = 100; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -5075,7 +4897,6 @@ namespace Terraria this.rare = 2; this.value = 27000; this.accessory = true; - this.faceSlot = (sbyte) 12; this.defense = 1; } else if (type == 194) @@ -5085,7 +4906,7 @@ namespace Terraria this.useStyle = 1; this.useAnimation = 15; this.useTime = 10; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 70; this.width = 14; @@ -5099,7 +4920,7 @@ namespace Terraria this.useStyle = 1; this.useAnimation = 15; this.useTime = 10; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 60; this.width = 14; @@ -5368,7 +5189,7 @@ namespace Terraria this.width = 20; this.height = 20; this.rare = 1; - this.value = Item.sellPrice(silver: 20); + this.value = 1500; this.accessory = true; this.defense = 1; this.handOffSlot = (sbyte) 7; @@ -5390,26 +5211,26 @@ namespace Terraria this.scale = 1.4f; this.UseSound = SoundID.Item1; this.rare = 3; - this.value = 27000; + this.value = 15000; this.melee = true; } else if (type == 218) { - this.mana = 18; + this.mana = 12; this.channel = true; - this.damage = 36; + this.damage = 40; this.useStyle = 1; this.shootSpeed = 6f; this.shoot = 34; this.width = 26; this.height = 28; this.UseSound = SoundID.Item20; - this.useAnimation = 30; - this.useTime = 30; + this.useAnimation = 20; + this.useTime = 20; this.rare = 3; this.noMelee = true; this.knockBack = 6.5f; - this.value = this.hellPrice; + this.value = 10000; this.magic = true; } else if (type == 219) @@ -5427,7 +5248,7 @@ namespace Terraria this.damage = 24; this.shootSpeed = 13f; this.noMelee = true; - this.value = Item.sellPrice(gold: 3, silver: 50); + this.value = 50000; this.scale = 0.85f; this.rare = 3; this.ranged = true; @@ -5438,7 +5259,7 @@ namespace Terraria this.useStyle = 5; this.useAnimation = 45; this.useTime = 45; - this.knockBack = 6.75f; + this.knockBack = 7.75f; this.width = 30; this.height = 10; this.damage = 35; @@ -5449,7 +5270,7 @@ namespace Terraria this.shootSpeed = 12f; this.UseSound = SoundID.Item1; this.rare = 3; - this.value = this.hellPrice; + this.value = 27000; this.melee = true; this.channel = true; } @@ -5512,14 +5333,15 @@ namespace Terraria } else if (type == 226 || type == 227) { - this.type = 227; + type = 227; this.UseSound = SoundID.Item3; - this.healLife = 90; - this.useStyle = 9; + this.healMana = 80; + this.healLife = 80; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; - this.maxStack = 30; + this.maxStack = 20; this.consumable = true; this.width = 14; this.height = 24; @@ -5599,7 +5421,7 @@ namespace Terraria this.shoot = 37; this.width = 20; this.height = 20; - this.maxStack = 99; + this.maxStack = 50; this.consumable = true; this.UseSound = SoundID.Item1; this.useAnimation = 25; @@ -5914,7 +5736,7 @@ namespace Terraria this.noMelee = true; this.knockBack = 5f; this.scale = 0.9f; - this.value = Item.sellPrice(gold: 1, silver: 50); + this.value = 10000; this.magic = true; break; case 273: @@ -5928,7 +5750,7 @@ namespace Terraria this.scale = 1.15f; this.UseSound = SoundID.Item1; this.rare = 3; - this.value = Item.sellPrice(gold: 4); + this.value = 54000; this.melee = true; break; case 274: @@ -5944,7 +5766,7 @@ namespace Terraria this.UseSound = SoundID.Item1; this.shoot = 46; this.rare = 3; - this.value = this.hellPrice; + this.value = 27000; this.noMelee = true; this.noUseGraphic = true; this.melee = true; @@ -5960,7 +5782,7 @@ namespace Terraria this.createTile = 81; this.width = 20; this.height = 22; - this.value = Item.sellPrice(silver: 2); + this.value = 400; break; case 276: this.useStyle = 1; @@ -5980,10 +5802,10 @@ namespace Terraria this.useAnimation = 31; this.useTime = 31; this.shootSpeed = 4f; - this.knockBack = 6f; + this.knockBack = 5f; this.width = 40; this.height = 40; - this.damage = 14; + this.damage = 11; this.scale = 1.1f; this.UseSound = SoundID.Item1; this.shoot = 47; @@ -6022,7 +5844,7 @@ namespace Terraria this.noMelee = true; this.value = 50; this.knockBack = 2f; - this.ranged = true; + this.thrown = true; break; case 280: this.useStyle = 5; @@ -6065,7 +5887,7 @@ namespace Terraria this.shoot = 50; this.width = 12; this.height = 12; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.UseSound = SoundID.Item1; this.useAnimation = 15; @@ -6104,7 +5926,7 @@ namespace Terraria this.width = 24; this.height = 8; this.accessory = true; - this.value = Item.sellPrice(silver: 50); + this.value = 5000; break; case 286: this.color = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); @@ -6113,7 +5935,7 @@ namespace Terraria this.shoot = 53; this.width = 12; this.height = 12; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.UseSound = SoundID.Item1; this.useAnimation = 15; @@ -6140,11 +5962,11 @@ namespace Terraria this.noMelee = true; this.value = 60; this.knockBack = 2.4f; - this.ranged = true; + this.thrown = true; break; case 288: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -6153,13 +5975,13 @@ namespace Terraria this.width = 14; this.height = 24; this.buffType = 1; - this.buffTime = 21600; + this.buffTime = 14400; this.value = 1000; this.rare = 1; break; case 289: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -6168,13 +5990,13 @@ namespace Terraria this.width = 14; this.height = 24; this.buffType = 2; - this.buffTime = 28800; + this.buffTime = 18000; this.value = 1000; this.rare = 1; break; case 290: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -6183,13 +6005,13 @@ namespace Terraria this.width = 14; this.height = 24; this.buffType = 3; - this.buffTime = 28800; + this.buffTime = 14400; this.value = 1000; this.rare = 1; break; case 291: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -6198,13 +6020,13 @@ namespace Terraria this.width = 14; this.height = 24; this.buffType = 4; - this.buffTime = 14400; + this.buffTime = 7200; this.value = 1000; this.rare = 1; break; case 292: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -6213,13 +6035,13 @@ namespace Terraria this.width = 14; this.height = 24; this.buffType = 5; - this.buffTime = 28800; + this.buffTime = 18000; this.value = 1000; this.rare = 1; break; case 293: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -6228,13 +6050,13 @@ namespace Terraria this.width = 14; this.height = 24; this.buffType = 6; - this.buffTime = 28800; + this.buffTime = 25200; this.value = 1000; this.rare = 1; break; case 294: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -6243,13 +6065,13 @@ namespace Terraria this.width = 14; this.height = 24; this.buffType = 7; - this.buffTime = 14400; + this.buffTime = 7200; this.value = 1000; this.rare = 1; break; case 295: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -6258,13 +6080,13 @@ namespace Terraria this.width = 14; this.height = 24; this.buffType = 8; - this.buffTime = 36000; + this.buffTime = 18000; this.value = 1000; this.rare = 1; break; case 296: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -6279,7 +6101,7 @@ namespace Terraria break; case 297: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -6288,13 +6110,13 @@ namespace Terraria this.width = 14; this.height = 24; this.buffType = 10; - this.buffTime = 10800; + this.buffTime = 7200; this.value = 1000; this.rare = 1; break; case 298: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -6303,13 +6125,13 @@ namespace Terraria this.width = 14; this.height = 24; this.buffType = 11; - this.buffTime = 36000; + this.buffTime = 18000; this.value = 1000; this.rare = 1; break; case 299: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -6318,13 +6140,13 @@ namespace Terraria this.width = 14; this.height = 24; this.buffType = 12; - this.buffTime = 36000; + this.buffTime = 14400; this.value = 1000; this.rare = 1; break; case 300: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -6339,7 +6161,7 @@ namespace Terraria break; case 301: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -6348,13 +6170,13 @@ namespace Terraria this.width = 14; this.height = 24; this.buffType = 14; - this.buffTime = 28800; + this.buffTime = 7200; this.value = 1000; this.rare = 1; break; case 302: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -6363,13 +6185,13 @@ namespace Terraria this.width = 14; this.height = 24; this.buffType = 15; - this.buffTime = 36000; + this.buffTime = 18000; this.value = 1000; this.rare = 1; break; case 303: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -6378,13 +6200,13 @@ namespace Terraria this.width = 14; this.height = 24; this.buffType = 16; - this.buffTime = 28800; + this.buffTime = 14400; this.value = 1000; this.rare = 1; break; case 304: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -6393,13 +6215,13 @@ namespace Terraria this.width = 14; this.height = 24; this.buffType = 17; - this.buffTime = 28800; + this.buffTime = 18000; this.value = 1000; this.rare = 1; break; case 305: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -6432,7 +6254,7 @@ namespace Terraria this.useStyle = 1; this.useAnimation = 15; this.useTime = 10; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 82; this.placeStyle = 0; @@ -6446,7 +6268,7 @@ namespace Terraria this.useStyle = 1; this.useAnimation = 15; this.useTime = 10; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 82; this.placeStyle = 1; @@ -6460,7 +6282,7 @@ namespace Terraria this.useStyle = 1; this.useAnimation = 15; this.useTime = 10; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 82; this.placeStyle = 2; @@ -6474,7 +6296,7 @@ namespace Terraria this.useStyle = 1; this.useAnimation = 15; this.useTime = 10; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 82; this.placeStyle = 3; @@ -6488,7 +6310,7 @@ namespace Terraria this.useStyle = 1; this.useAnimation = 15; this.useTime = 10; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 82; this.placeStyle = 4; @@ -6502,7 +6324,7 @@ namespace Terraria this.useStyle = 1; this.useAnimation = 15; this.useTime = 10; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 82; this.placeStyle = 5; @@ -6511,37 +6333,37 @@ namespace Terraria this.value = 80; break; case 313: - this.maxStack = 999; + this.maxStack = 99; this.width = 12; this.height = 14; this.value = 100; break; case 314: - this.maxStack = 999; + this.maxStack = 99; this.width = 12; this.height = 14; this.value = 100; break; case 315: - this.maxStack = 999; + this.maxStack = 99; this.width = 12; this.height = 14; this.value = 100; break; case 316: - this.maxStack = 999; + this.maxStack = 99; this.width = 12; this.height = 14; this.value = 100; break; case 317: - this.maxStack = 999; + this.maxStack = 99; this.width = 12; this.height = 14; this.value = 100; break; case 318: - this.maxStack = 999; + this.maxStack = 99; this.width = 12; this.height = 14; this.value = 100; @@ -6575,7 +6397,6 @@ namespace Terraria this.width = 20; this.height = 20; this.value = 20000; - this.vanity = true; break; case 323: this.width = 10; @@ -6626,7 +6447,7 @@ namespace Terraria this.width = 14; this.height = 20; this.maxStack = 1; - this.value = this.dungeonPrice; + this.value = 75000; break; case 330: this.useStyle = 1; @@ -6927,6 +6748,23 @@ namespace Terraria this.height = 24; this.value = 600; break; + case 353: + this.UseSound = SoundID.Item3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 99; + this.consumable = true; + this.width = 10; + this.height = 10; + this.buffType = 25; + this.buffTime = 7200; + this.value = 100; + this.holdStyle = 1; + this.ammo = 353; + this.notAmmo = true; + break; case 354: this.useStyle = 1; this.useTurn = true; @@ -6966,6 +6804,21 @@ namespace Terraria this.height = 24; this.value = 20; break; + case 357: + this.UseSound = SoundID.Item3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 10; + this.height = 10; + this.buffType = 26; + this.buffTime = 108000; + this.rare = 1; + this.value = 1000; + break; case 358: this.useStyle = 1; this.useTurn = true; @@ -7096,12 +6949,12 @@ namespace Terraria case 368: this.autoReuse = true; this.useStyle = 1; - this.useAnimation = 20; - this.useTime = 20; + this.useAnimation = 25; + this.useTime = 25; this.knockBack = 4.5f; this.width = 40; this.height = 40; - this.damage = 66; + this.damage = 50; this.scale = 1.15f; this.UseSound = SoundID.Item1; this.rare = 5; @@ -7114,7 +6967,7 @@ namespace Terraria this.useStyle = 1; this.useAnimation = 15; this.useTime = 10; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 109; this.width = 14; @@ -7134,7 +6987,6 @@ namespace Terraria this.width = 12; this.height = 12; this.ammo = AmmoID.Sand; - this.notAmmo = true; break; case 371: this.width = 18; @@ -7219,7 +7071,7 @@ namespace Terraria case 381: this.width = 20; this.height = 20; - this.maxStack = 999; + this.maxStack = 99; this.value = 10500; this.rare = 3; this.useStyle = 1; @@ -7234,7 +7086,7 @@ namespace Terraria case 382: this.width = 20; this.height = 20; - this.maxStack = 999; + this.maxStack = 99; this.value = 22000; this.rare = 3; this.useStyle = 1; @@ -7249,7 +7101,7 @@ namespace Terraria case 383: this.useStyle = 5; this.useAnimation = 25; - this.useTime = 13; + this.useTime = 8; this.shootSpeed = 40f; this.knockBack = 2.75f; this.width = 20; @@ -7268,7 +7120,7 @@ namespace Terraria case 384: this.useStyle = 5; this.useAnimation = 25; - this.useTime = 10; + this.useTime = 8; this.shootSpeed = 40f; this.knockBack = 3f; this.width = 20; @@ -7325,7 +7177,7 @@ namespace Terraria case 387: this.useStyle = 5; this.useAnimation = 25; - this.useTime = 8; + this.useTime = 6; this.shootSpeed = 40f; this.knockBack = 4.5f; this.width = 20; @@ -7344,7 +7196,7 @@ namespace Terraria case 388: this.useStyle = 5; this.useAnimation = 25; - this.useTime = 8; + this.useTime = 7; this.shootSpeed = 32f; this.knockBack = 0.0f; this.width = 20; @@ -7365,10 +7217,10 @@ namespace Terraria this.useStyle = 5; this.useAnimation = 45; this.useTime = 45; - this.knockBack = 6f; + this.knockBack = 7f; this.width = 30; this.height = 10; - this.damage = 50; + this.damage = 63; this.scale = 1.1f; this.noUseGraphic = true; this.shoot = 63; @@ -7400,7 +7252,7 @@ namespace Terraria case 391: this.width = 20; this.height = 20; - this.maxStack = 999; + this.maxStack = 99; this.value = 37500; this.rare = 3; this.useStyle = 1; @@ -7450,7 +7302,7 @@ namespace Terraria this.width = 24; this.height = 28; this.rare = 4; - this.value = Item.buyPrice(gold: 6); + this.value = 100000; this.accessory = true; break; case 397: @@ -7569,7 +7421,6 @@ namespace Terraria this.width = 12; this.height = 12; this.ammo = AmmoID.Sand; - this.notAmmo = true; break; case 409: this.useStyle = 1; @@ -7753,7 +7604,7 @@ namespace Terraria this.useTime = 15; this.noUseGraphic = true; this.noMelee = true; - this.value = 100; + this.value = 200; break; case 424: this.useStyle = 1; @@ -7783,11 +7634,11 @@ namespace Terraria break; case 426: this.useStyle = 1; - this.useAnimation = 29; + this.useAnimation = 30; this.knockBack = 8f; this.width = 60; this.height = 70; - this.damage = 43; + this.damage = 39; this.scale = 1.05f; this.UseSound = SoundID.Item1; this.rare = 4; @@ -7803,7 +7654,7 @@ namespace Terraria this.useTime = 10; this.holdStyle = 1; this.autoReuse = true; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 4; this.placeStyle = 1; @@ -7820,7 +7671,7 @@ namespace Terraria this.useTime = 10; this.holdStyle = 1; this.autoReuse = true; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 4; this.placeStyle = 2; @@ -7837,7 +7688,7 @@ namespace Terraria this.useTime = 10; this.holdStyle = 1; this.autoReuse = true; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 4; this.placeStyle = 3; @@ -7854,7 +7705,7 @@ namespace Terraria this.useTime = 10; this.holdStyle = 1; this.autoReuse = true; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 4; this.placeStyle = 4; @@ -7871,7 +7722,7 @@ namespace Terraria this.useTime = 10; this.holdStyle = 1; this.autoReuse = true; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 4; this.placeStyle = 5; @@ -7888,7 +7739,7 @@ namespace Terraria this.useTime = 10; this.holdStyle = 1; this.autoReuse = true; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 4; this.placeStyle = 6; @@ -7905,7 +7756,7 @@ namespace Terraria this.useTime = 10; this.holdStyle = 1; this.autoReuse = true; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 4; this.placeStyle = 7; @@ -7924,7 +7775,7 @@ namespace Terraria this.shoot = 10; this.useAmmo = AmmoID.Bullet; this.UseSound = SoundID.Item31; - this.damage = 17; + this.damage = 19; this.shootSpeed = 7.75f; this.noMelee = true; this.value = 150000; @@ -7934,8 +7785,8 @@ namespace Terraria case 435: this.useStyle = 5; this.autoReuse = true; - this.useAnimation = 24; - this.useTime = 24; + this.useAnimation = 25; + this.useTime = 25; this.width = 50; this.height = 18; this.shoot = 1; @@ -7952,8 +7803,8 @@ namespace Terraria case 436: this.useStyle = 5; this.autoReuse = true; - this.useAnimation = 22; - this.useTime = 22; + this.useAnimation = 23; + this.useTime = 23; this.width = 50; this.height = 18; this.shoot = 1; @@ -7981,7 +7832,7 @@ namespace Terraria this.useTime = 20; this.rare = 4; this.noMelee = true; - this.value = Item.buyPrice(gold: 15); + this.value = 200000; break; case 438: this.useStyle = 1; @@ -8583,8 +8434,8 @@ namespace Terraria case 481: this.useStyle = 5; this.autoReuse = true; - this.useAnimation = 19; - this.useTime = 19; + this.useAnimation = 20; + this.useTime = 20; this.width = 50; this.height = 18; this.shoot = 1; @@ -8599,14 +8450,13 @@ namespace Terraria this.knockBack = 2.5f; break; case 482: - this.autoReuse = true; this.useStyle = 1; - this.useAnimation = 26; - this.useTime = 26; + this.useAnimation = 27; + this.useTime = 27; this.knockBack = 6f; this.width = 40; this.height = 40; - this.damage = 56; + this.damage = 44; this.scale = 1.2f; this.UseSound = SoundID.Item1; this.rare = 4; @@ -8622,7 +8472,7 @@ namespace Terraria this.knockBack = 3.85f; this.width = 40; this.height = 40; - this.damage = 39; + this.damage = 34; this.scale = 1.1f; this.UseSound = SoundID.Item1; this.rare = 4; @@ -8630,14 +8480,13 @@ namespace Terraria this.melee = true; break; case 484: - this.autoReuse = true; this.useStyle = 1; this.useAnimation = 26; this.useTime = 26; this.knockBack = 6f; this.width = 40; this.height = 40; - this.damage = 49; + this.damage = 39; this.scale = 1.15f; this.UseSound = SoundID.Item1; this.rare = 4; @@ -8650,25 +8499,13 @@ namespace Terraria this.height = 28; this.accessory = true; this.value = 150000; - this.canBePlacedInVanityRegardlessOfConditions = true; break; case 486: - this.autoReuse = true; - this.useStyle = 13; - this.useAnimation = 20; - this.useTime = 5; - this.reuseDelay = 10; - this.width = 40; - this.height = 18; - this.shoot = 842; - this.UseSound = SoundID.Item1; - this.damage = 12; - this.shootSpeed = 2.4f; - this.noMelee = true; - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(silver: 10)); - this.melee = true; - this.knockBack = 0.5f; - this.noUseGraphic = true; + this.width = 10; + this.height = 26; + this.accessory = true; + this.value = 10000; + this.rare = 1; break; case 487: this.useStyle = 1; @@ -8753,17 +8590,17 @@ namespace Terraria break; case 495: this.rare = 5; - this.mana = 21; + this.mana = 18; this.channel = true; - this.damage = 50; + this.damage = 74; this.useStyle = 1; this.shootSpeed = 6f; this.shoot = 79; this.width = 26; this.height = 28; this.UseSound = SoundID.Item28; - this.useAnimation = 25; - this.useTime = 25; + this.useAnimation = 18; + this.useTime = 18; this.noMelee = true; this.knockBack = 6f; this.value = 200000; @@ -8793,9 +8630,8 @@ namespace Terraria this.width = 24; this.height = 28; this.accessory = true; - this.value = this.eclipsePrice; + this.value = 150000; this.rare = 5; - this.canBePlacedInVanityRegardlessOfConditions = true; break; case 498: this.useStyle = 1; @@ -8808,13 +8644,11 @@ namespace Terraria this.createTile = 128; this.width = 12; this.height = 12; - this.createTile = 470; - this.placeStyle = 0; break; case 499: this.UseSound = SoundID.Item3; this.healLife = 150; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -8829,7 +8663,7 @@ namespace Terraria case 500: this.UseSound = SoundID.Item3; this.healMana = 200; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -8895,7 +8729,7 @@ namespace Terraria this.shoot = 85; this.useAmmo = AmmoID.Gel; this.UseSound = SoundID.Item34; - this.damage = 35; + this.damage = 27; this.knockBack = 0.3f; this.shootSpeed = 7f; this.noMelee = true; @@ -9060,11 +8894,11 @@ namespace Terraria case 518: this.autoReuse = true; this.rare = 4; - this.mana = 5; + this.mana = 4; this.UseSound = SoundID.Item9; this.noMelee = true; this.useStyle = 5; - this.damage = 32; + this.damage = 25; this.useAnimation = 7; this.useTime = 7; this.width = 24; @@ -9074,18 +8908,18 @@ namespace Terraria this.shootSpeed = 16f; this.knockBack = 5f; this.magic = true; - this.value = Item.sellPrice(gold: 4); + this.value = 500000; break; case 519: this.autoReuse = true; this.rare = 4; - this.mana = 9; + this.mana = 12; this.UseSound = SoundID.Item20; this.noMelee = true; this.useStyle = 5; - this.damage = 50; - this.useAnimation = 15; - this.useTime = 15; + this.damage = 36; + this.useAnimation = 20; + this.useTime = 20; this.width = 24; this.height = 28; this.shoot = 95; @@ -9093,7 +8927,7 @@ namespace Terraria this.shootSpeed = 10f; this.knockBack = 6.5f; this.magic = true; - this.value = Item.sellPrice(gold: 4); + this.value = 500000; break; case 520: this.width = 18; @@ -9124,13 +8958,13 @@ namespace Terraria this.useTime = 10; this.holdStyle = 1; this.autoReuse = true; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 4; this.placeStyle = 8; this.width = 10; this.height = 12; - this.value = 150; + this.value = 300; this.rare = 1; break; case 524: @@ -9204,6 +9038,7 @@ namespace Terraria this.maxStack = 999; this.value = 500; this.mech = true; + this.notAmmo = true; break; case 531: this.width = 12; @@ -9233,7 +9068,7 @@ namespace Terraria this.damage = 25; this.shootSpeed = 10f; this.noMelee = true; - this.value = Item.buyPrice(gold: 35); + this.value = 300000; this.rare = 5; this.knockBack = 1f; this.ranged = true; @@ -9395,7 +9230,7 @@ namespace Terraria this.consumable = true; this.ammo = AmmoID.Arrow; this.knockBack = 3f; - this.value = 40; + this.value = 80; this.ranged = true; this.rare = 3; break; @@ -9480,7 +9315,7 @@ namespace Terraria case 554: this.width = 20; this.height = 24; - this.value = Item.buyPrice(gold: 10); + this.value = 1500; this.accessory = true; this.rare = 4; this.neckSlot = (sbyte) 2; @@ -9556,7 +9391,7 @@ namespace Terraria this.noUseGraphic = true; this.rare = 5; this.maxStack = 5; - this.value = Item.sellPrice(gold: 6); + this.value = 500000; break; case 562: this.useStyle = 1; @@ -9572,7 +9407,6 @@ namespace Terraria this.rare = 4; this.value = 100000; this.accessory = true; - this.canBePlacedInVanityRegardlessOfConditions = true; break; case 563: this.useStyle = 1; @@ -9588,7 +9422,6 @@ namespace Terraria this.rare = 4; this.value = 100000; this.accessory = true; - this.canBePlacedInVanityRegardlessOfConditions = true; break; case 564: this.useStyle = 1; @@ -9604,7 +9437,6 @@ namespace Terraria this.rare = 4; this.value = 100000; this.accessory = true; - this.canBePlacedInVanityRegardlessOfConditions = true; break; case 565: this.useStyle = 1; @@ -9620,7 +9452,6 @@ namespace Terraria this.rare = 4; this.value = 100000; this.accessory = true; - this.canBePlacedInVanityRegardlessOfConditions = true; break; case 566: this.useStyle = 1; @@ -9636,7 +9467,6 @@ namespace Terraria this.rare = 4; this.value = 100000; this.accessory = true; - this.canBePlacedInVanityRegardlessOfConditions = true; break; case 567: this.useStyle = 1; @@ -9652,7 +9482,6 @@ namespace Terraria this.rare = 4; this.value = 100000; this.accessory = true; - this.canBePlacedInVanityRegardlessOfConditions = true; break; case 568: this.useStyle = 1; @@ -9668,7 +9497,6 @@ namespace Terraria this.rare = 4; this.value = 100000; this.accessory = true; - this.canBePlacedInVanityRegardlessOfConditions = true; break; case 569: this.useStyle = 1; @@ -9684,7 +9512,6 @@ namespace Terraria this.rare = 4; this.value = 100000; this.accessory = true; - this.canBePlacedInVanityRegardlessOfConditions = true; break; case 570: this.useStyle = 1; @@ -9700,7 +9527,6 @@ namespace Terraria this.rare = 4; this.value = 100000; this.accessory = true; - this.canBePlacedInVanityRegardlessOfConditions = true; break; case 571: this.useStyle = 1; @@ -9716,7 +9542,6 @@ namespace Terraria this.rare = 4; this.value = 100000; this.accessory = true; - this.canBePlacedInVanityRegardlessOfConditions = true; break; case 572: this.useStyle = 1; @@ -9732,7 +9557,6 @@ namespace Terraria this.rare = 4; this.value = 100000; this.accessory = true; - this.canBePlacedInVanityRegardlessOfConditions = true; break; case 573: this.useStyle = 1; @@ -9748,7 +9572,6 @@ namespace Terraria this.rare = 4; this.value = 100000; this.accessory = true; - this.canBePlacedInVanityRegardlessOfConditions = true; break; case 574: this.useStyle = 1; @@ -9764,7 +9587,6 @@ namespace Terraria this.rare = 4; this.value = 100000; this.accessory = true; - this.canBePlacedInVanityRegardlessOfConditions = true; break; case 575: this.width = 18; @@ -9795,14 +9617,14 @@ namespace Terraria case 578: this.useStyle = 5; this.autoReuse = true; - this.useAnimation = 16; - this.useTime = 16; + this.useAnimation = 19; + this.useTime = 19; this.width = 50; this.height = 18; this.shoot = 1; this.useAmmo = AmmoID.Arrow; this.UseSound = SoundID.Item5; - this.damage = 53; + this.damage = 43; this.shootSpeed = 11f; this.noMelee = true; this.value = 200000; @@ -9842,7 +9664,6 @@ namespace Terraria this.createTile = 141; this.width = 12; this.height = 12; - this.value = Item.sellPrice(silver: 10); break; case 581: this.mech = true; @@ -9934,7 +9755,7 @@ namespace Terraria this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; - this.useTime = 7; + this.useTime = 10; this.autoReuse = true; this.maxStack = 999; this.consumable = true; @@ -9979,7 +9800,7 @@ namespace Terraria this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; - this.useTime = 7; + this.useTime = 10; this.autoReuse = true; this.maxStack = 999; this.consumable = true; @@ -10015,7 +9836,7 @@ namespace Terraria this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; - this.useTime = 7; + this.useTime = 10; this.autoReuse = true; this.maxStack = 999; this.consumable = true; @@ -10088,7 +9909,6 @@ namespace Terraria this.width = 28; this.height = 28; this.rare = 2; - this.maxStack = 20; break; case 603: this.damage = 0; @@ -10410,7 +10230,6 @@ namespace Terraria this.placeStyle = 2; this.width = 12; this.height = 30; - this.value = 150; break; case 629: this.useStyle = 1; @@ -10424,7 +10243,6 @@ namespace Terraria this.placeStyle = 3; this.width = 12; this.height = 30; - this.value = 150; break; case 630: this.useStyle = 1; @@ -10438,7 +10256,6 @@ namespace Terraria this.placeStyle = 4; this.width = 12; this.height = 30; - this.value = 150; break; case 631: this.useStyle = 1; @@ -10884,20 +10701,18 @@ namespace Terraria this.createTile = 160; this.width = 12; this.height = 12; - this.rare = 1; break; case 663: this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; - this.useTime = 7; + this.useTime = 10; this.autoReuse = true; this.maxStack = 999; this.consumable = true; this.createWall = 44; this.width = 12; this.height = 12; - this.rare = 1; break; case 664: this.useStyle = 1; @@ -10925,7 +10740,6 @@ namespace Terraria this.headSlot = 45; this.rare = 9; this.vanity = true; - this.value = Item.sellPrice(gold: 5); break; case 667: this.width = 18; @@ -10933,7 +10747,6 @@ namespace Terraria this.bodySlot = 26; this.rare = 9; this.vanity = true; - this.value = Item.sellPrice(gold: 5); break; case 668: this.width = 18; @@ -10941,7 +10754,6 @@ namespace Terraria this.legSlot = 25; this.rare = 9; this.vanity = true; - this.value = Item.sellPrice(gold: 5); break; case 669: this.damage = 0; @@ -10984,11 +10796,11 @@ namespace Terraria this.knockBack = 6.5f; this.width = 40; this.height = 40; - this.damage = 85; + this.damage = 70; this.scale = 1.2f; this.UseSound = SoundID.Item1; this.rare = 8; - this.value = Item.buyPrice(gold: 20); + this.value = 138000; this.melee = true; break; case 672: @@ -11045,7 +10857,7 @@ namespace Terraria this.knockBack = 4.75f; this.width = 40; this.height = 40; - this.damage = 105; + this.damage = 90; this.scale = 1.15f; this.UseSound = SoundID.Item1; this.rare = 8; @@ -11085,7 +10897,7 @@ namespace Terraria break; case 678: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -11093,7 +10905,7 @@ namespace Terraria this.consumable = true; this.width = 14; this.height = 24; - this.rare = 4; + this.rare = 9; break; case 679: this.autoReuse = true; @@ -11109,7 +10921,7 @@ namespace Terraria this.damage = 29; this.shootSpeed = 6f; this.noMelee = true; - this.value = Item.buyPrice(gold: 40); + this.value = 700000; this.rare = 8; this.ranged = true; break; @@ -11150,7 +10962,7 @@ namespace Terraria this.shoot = 1; this.useAmmo = AmmoID.Arrow; this.UseSound = SoundID.Item5; - this.damage = 50; + this.damage = 40; this.shootSpeed = 11f; this.knockBack = 4.7f; this.rare = 5; @@ -11163,13 +10975,13 @@ namespace Terraria case 683: this.autoReuse = true; this.rare = 6; - this.mana = 19; + this.mana = 25; this.UseSound = SoundID.Item20; this.noMelee = true; this.useStyle = 5; this.damage = 73; - this.useAnimation = 17; - this.useTime = 17; + this.useAnimation = 22; + this.useTime = 22; this.width = 30; this.height = 30; this.shoot = 114; @@ -11207,84 +11019,84 @@ namespace Terraria this.height = 18; this.defense = 2; this.headSlot = 47; - this.value = 1125; + this.value = 1875; break; case 688: this.width = 18; this.height = 18; this.defense = 2; this.bodySlot = 28; - this.value = 1875; + this.value = Item.sellPrice(copper: 50); break; case 689: this.width = 18; this.height = 18; this.defense = 1; this.legSlot = 27; - this.value = 1500; + this.value = 1125; break; case 690: this.width = 18; this.height = 18; this.defense = 3; this.headSlot = 48; - this.value = 4500; + this.value = 7500; break; case 691: this.width = 18; this.height = 18; this.defense = 3; this.bodySlot = 29; - this.value = 7500; + this.value = 6000; break; case 692: this.width = 18; this.height = 18; this.defense = 2; this.legSlot = 28; - this.value = 6000; + this.value = 4500; break; case 693: this.width = 18; this.height = 18; this.defense = 4; this.headSlot = 49; - this.value = 11250; + this.value = 7500; break; case 694: this.width = 18; this.height = 18; this.defense = 5; this.bodySlot = 30; - this.value = 18750; + this.value = 6000; break; case 695: this.width = 18; this.height = 18; this.defense = 3; this.legSlot = 29; - this.value = 15000; + this.value = 4500; break; case 696: this.width = 18; this.height = 18; this.defense = 5; this.headSlot = 50; - this.value = 22500; + this.value = 7500; break; case 697: this.width = 18; this.height = 18; this.defense = 6; this.bodySlot = 31; - this.value = 37500; + this.value = 6000; break; case 698: this.width = 18; this.height = 18; this.defense = 5; this.legSlot = 30; - this.value = 30000; + this.value = 4500; break; case 699: this.useStyle = 1; @@ -11323,7 +11135,7 @@ namespace Terraria this.createTile = 168; this.width = 12; this.height = 12; - this.value = Item.sellPrice(silver: 2, copper: 25); + this.value = 1500; break; case 702: this.useStyle = 1; @@ -11336,12 +11148,12 @@ namespace Terraria this.createTile = 169; this.width = 12; this.height = 12; - this.value = Item.sellPrice(silver: 4, copper: 50); + this.value = 3000; break; case 703: this.width = 20; this.height = 20; - this.maxStack = 999; + this.maxStack = 99; this.value = 1125; this.useStyle = 1; this.useTurn = true; @@ -11355,7 +11167,7 @@ namespace Terraria case 704: this.width = 20; this.height = 20; - this.maxStack = 999; + this.maxStack = 99; this.value = 2250; this.useStyle = 1; this.useTurn = true; @@ -11369,7 +11181,7 @@ namespace Terraria case 705: this.width = 20; this.height = 20; - this.maxStack = 999; + this.maxStack = 99; this.value = 4500; this.useStyle = 1; this.useTurn = true; @@ -11383,7 +11195,7 @@ namespace Terraria case 706: this.width = 20; this.height = 20; - this.maxStack = 999; + this.maxStack = 99; this.value = 9000; this.useStyle = 1; this.useTurn = true; @@ -11471,7 +11283,6 @@ namespace Terraria this.createTile = 174; this.width = 8; this.height = 18; - this.value = Item.sellPrice(silver: 3); this.holdStyle = 1; break; case 714: @@ -11485,7 +11296,6 @@ namespace Terraria this.createTile = 173; this.width = 20; this.height = 20; - this.value = Item.buyPrice(silver: 15); break; case 715: this.width = 18; @@ -11585,7 +11395,7 @@ namespace Terraria this.UseSound = SoundID.Item1; this.useStyle = 1; this.damage = 52; - this.useAnimation = 20; + this.useAnimation = 15; this.useTime = 60; this.width = 30; this.height = 30; @@ -11593,7 +11403,7 @@ namespace Terraria this.shootSpeed = 11f; this.knockBack = 6.5f; this.melee = true; - this.value = Item.sellPrice(gold: 3); + this.value = 500000; break; case 724: this.autoReuse = true; @@ -11614,40 +11424,38 @@ namespace Terraria break; case 725: this.useStyle = 5; - this.useAnimation = 16; - this.useTime = 16; + this.useAnimation = 21; + this.useTime = 21; this.width = 12; this.height = 28; this.shoot = 1; this.useAmmo = AmmoID.Arrow; this.UseSound = SoundID.Item5; - this.damage = 39; + this.damage = 46; this.shootSpeed = 10f; this.knockBack = 4.5f; this.alpha = 30; this.rare = 5; this.noMelee = true; - this.value = Item.sellPrice(gold: 5); + this.value = Item.sellPrice(gold: 3, silver: 50); this.ranged = true; - this.channel = true; - this.autoReuse = true; break; case 726: this.autoReuse = true; this.rare = 5; - this.mana = 12; + this.mana = 14; this.UseSound = SoundID.Item20; this.useStyle = 5; this.damage = 46; - this.useAnimation = 16; - this.useTime = 16; + this.useAnimation = 20; + this.useTime = 20; this.width = 30; this.height = 30; this.shoot = 359; this.shootSpeed = 16f; this.knockBack = 5f; this.magic = true; - this.value = Item.sellPrice(gold: 4); + this.value = 500000; this.noMelee = true; break; case 727: @@ -11984,8 +11792,8 @@ namespace Terraria case 758: this.useStyle = 5; this.autoReuse = true; - this.useAnimation = 20; - this.useTime = 20; + this.useAnimation = 30; + this.useTime = 30; this.useAmmo = AmmoID.Rocket; this.width = 50; this.height = 20; @@ -11994,7 +11802,7 @@ namespace Terraria this.damage = 60; this.shootSpeed = 10f; this.noMelee = true; - this.value = Item.buyPrice(gold: 35); + this.value = 100000; this.knockBack = 4f; this.rare = 8; this.ranged = true; @@ -12009,10 +11817,10 @@ namespace Terraria this.height = 20; this.shoot = 134; this.UseSound = SoundID.Item11; - this.damage = 45; + this.damage = 50; this.shootSpeed = 5f; this.noMelee = true; - this.value = Item.buyPrice(gold: 40); + this.value = 100000; this.knockBack = 4f; this.rare = 8; this.ranged = true; @@ -12020,8 +11828,8 @@ namespace Terraria case 760: this.useStyle = 5; this.autoReuse = true; - this.useAnimation = 50; - this.useTime = 50; + this.useAnimation = 40; + this.useTime = 40; this.useAmmo = AmmoID.Rocket; this.width = 50; this.height = 20; @@ -12251,7 +12059,7 @@ namespace Terraria case 778: this.useStyle = 1; this.useAnimation = 25; - this.useTime = 8; + this.useTime = 7; this.knockBack = 5f; this.useTurn = true; this.autoReuse = true; @@ -12365,13 +12173,14 @@ namespace Terraria this.melee = true; break; case 788: - this.mana = 12; - this.damage = 35; + this.mana = 10; + this.damage = 28; this.useStyle = 5; this.shootSpeed = 32f; this.shoot = 150; this.width = 26; this.height = 28; + this.UseSound = SoundID.Item8; this.useAnimation = 25; this.useTime = 25; this.autoReuse = true; @@ -12540,7 +12349,7 @@ namespace Terraria this.shootSpeed = 6f; this.noMelee = true; this.knockBack = 1f; - this.value = this.shadowOrbPrice; + this.value = 50000; this.scale = 0.9f; this.rare = 1; this.ranged = true; @@ -12549,10 +12358,10 @@ namespace Terraria this.useStyle = 5; this.useAnimation = 45; this.useTime = 45; - this.knockBack = 5.5f; + this.knockBack = 6.5f; this.width = 30; this.height = 10; - this.damage = 17; + this.damage = 16; this.scale = 1.1f; this.noUseGraphic = true; this.shoot = 154; @@ -12577,7 +12386,7 @@ namespace Terraria this.UseSound = SoundID.Item1; this.shoot = 153; this.rare = 1; - this.value = this.shadowOrbPrice; + this.value = 10000; this.noMelee = true; this.noUseGraphic = true; this.melee = true; @@ -12615,7 +12424,6 @@ namespace Terraria this.placeStyle = 5; this.width = 12; this.height = 30; - this.value = 150; break; case 807: this.useStyle = 1; @@ -12629,7 +12437,6 @@ namespace Terraria this.placeStyle = 6; this.width = 12; this.height = 30; - this.value = 150; break; case 808: this.useStyle = 1; @@ -12643,7 +12450,6 @@ namespace Terraria this.placeStyle = 7; this.width = 12; this.height = 30; - this.value = 150; break; case 809: this.useStyle = 1; @@ -12657,7 +12463,6 @@ namespace Terraria this.placeStyle = 8; this.width = 12; this.height = 30; - this.value = 150; break; case 810: this.useStyle = 1; @@ -12671,7 +12476,6 @@ namespace Terraria this.placeStyle = 9; this.width = 12; this.height = 30; - this.value = 150; break; case 811: this.useStyle = 1; @@ -12870,7 +12674,6 @@ namespace Terraria this.placeStyle = 10; this.width = 12; this.height = 30; - this.value = 150; break; case 827: this.useStyle = 1; @@ -12953,7 +12756,6 @@ namespace Terraria this.width = 8; this.height = 10; this.rare = 1; - this.value = Item.sellPrice(silver: 25); break; case 833: this.useStyle = 1; @@ -13060,7 +12862,6 @@ namespace Terraria this.headSlot = 60; this.rare = 1; this.vanity = true; - this.value = Item.sellPrice(silver: 50); break; case 843: this.width = 18; @@ -13068,7 +12869,6 @@ namespace Terraria this.bodySlot = 40; this.rare = 1; this.vanity = true; - this.value = Item.sellPrice(silver: 50); break; case 844: this.width = 18; @@ -13076,7 +12876,6 @@ namespace Terraria this.legSlot = 38; this.rare = 1; this.vanity = true; - this.value = Item.sellPrice(silver: 50); break; case 845: this.useStyle = 1; @@ -13224,7 +13023,6 @@ namespace Terraria this.accessory = true; this.rare = 2; this.value = 50000; - this.waistSlot = (sbyte) 15; break; case 858: this.useStyle = 1; @@ -13260,7 +13058,7 @@ namespace Terraria this.accessory = true; this.rare = 6; this.lifeRegen = 1; - this.value = Item.buyPrice(gold: 20); + this.value = 500000; this.handOnSlot = (sbyte) 4; break; case 861: @@ -13268,15 +13066,14 @@ namespace Terraria this.height = 24; this.accessory = true; this.rare = 6; - this.value = Item.buyPrice(gold: 40); - this.canBePlacedInVanityRegardlessOfConditions = true; + this.value = 500000; break; case 862: this.width = 16; this.height = 24; this.accessory = true; this.rare = 6; - this.value = Item.buyPrice(gold: 10); + this.value = 500000; this.neckSlot = (sbyte) 5; break; case 863: @@ -13315,8 +13112,7 @@ namespace Terraria this.height = 20; this.headSlot = 63; this.rare = 1; - this.defense = 2; - this.value = Item.sellPrice(silver: 50); + this.vanity = true; break; case 868: this.width = 28; @@ -13423,17 +13219,17 @@ namespace Terraria this.width = 12; this.height = 12; this.rare = 1; - this.value = Item.sellPrice(silver: 13); + this.value = 4500; break; case 881: this.useStyle = 1; this.useTurn = false; - this.useAnimation = 32; - this.useTime = 32; + this.useAnimation = 25; + this.useTime = 25; this.width = 24; this.height = 28; - this.damage = 8; - this.knockBack = 4.5f; + this.damage = 9; + this.knockBack = 5f; this.UseSound = SoundID.Item1; this.scale = 1f; this.value = 1800; @@ -13442,12 +13238,12 @@ namespace Terraria case 882: this.useStyle = 1; this.useTurn = true; - this.useAnimation = 25; - this.useTime = 16; + this.useAnimation = 23; + this.useTime = 15; this.autoReuse = true; this.width = 24; this.height = 28; - this.damage = 4; + this.damage = 5; this.pick = 35; this.UseSound = SoundID.Item1; this.knockBack = 2f; @@ -13470,7 +13266,7 @@ namespace Terraria this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; - this.useTime = 7; + this.useTime = 10; this.autoReuse = true; this.maxStack = 999; this.consumable = true; @@ -13547,28 +13343,25 @@ namespace Terraria this.height = 18; this.defense = 1; this.headSlot = 70; - this.value = Item.sellPrice(copper: 40); break; case 895: this.width = 18; this.height = 18; - this.defense = 1; + this.defense = 2; this.bodySlot = 46; - this.value = Item.sellPrice(copper: 60); break; case 896: this.width = 18; this.height = 18; this.defense = 1; this.legSlot = 42; - this.value = Item.sellPrice(copper: 50); break; case 897: this.width = 16; this.height = 24; this.accessory = true; this.rare = 5; - this.value = Item.buyPrice(gold: 20); + this.value = 300000; this.handOffSlot = (sbyte) 5; this.handOnSlot = (sbyte) 10; break; @@ -13593,7 +13386,7 @@ namespace Terraria this.height = 24; this.accessory = true; this.rare = 5; - this.value = this.eclipsePrice; + this.value = 300000; this.handOnSlot = (sbyte) 14; break; case 901: @@ -13654,7 +13447,7 @@ namespace Terraria this.height = 24; this.accessory = true; this.rare = 4; - this.value = Item.buyPrice(gold: 30); + this.value = 500000; this.shoeSlot = (sbyte) 11; break; case 908: @@ -13678,7 +13471,6 @@ namespace Terraria this.width = 26; this.height = 36; this.value = Item.buyPrice(gold: 4); - this.rare = 1; break; case 910: this.useStyle = 1; @@ -13693,7 +13485,6 @@ namespace Terraria this.width = 26; this.height = 36; this.value = Item.buyPrice(gold: 4); - this.rare = 1; break; case 911: this.useStyle = 1; @@ -13759,7 +13550,6 @@ namespace Terraria this.placeStyle = 11; this.width = 12; this.height = 30; - this.value = 150; break; case 916: this.useStyle = 1; @@ -13974,7 +13764,6 @@ namespace Terraria this.width = 8; this.height = 10; this.rare = 1; - this.value = Item.sellPrice(silver: 50); break; case 933: this.tileWand = 9; @@ -13987,7 +13776,6 @@ namespace Terraria this.width = 8; this.height = 10; this.rare = 1; - this.value = Item.sellPrice(silver: 25); break; case 934: this.width = 34; @@ -14008,7 +13796,7 @@ namespace Terraria this.height = 24; this.accessory = true; this.rare = 6; - this.value = Item.buyPrice(gold: 25); + this.value = 300000; this.handOffSlot = (sbyte) 4; this.handOnSlot = (sbyte) 9; break; @@ -14066,7 +13854,6 @@ namespace Terraria this.width = 26; this.height = 36; this.value = Item.buyPrice(gold: 4); - this.rare = 1; break; case 941: this.useStyle = 1; @@ -14081,7 +13868,6 @@ namespace Terraria this.width = 26; this.height = 36; this.value = Item.buyPrice(gold: 4); - this.rare = 1; break; case 942: this.useStyle = 1; @@ -14096,7 +13882,6 @@ namespace Terraria this.width = 26; this.height = 36; this.value = Item.buyPrice(gold: 4); - this.rare = 1; break; case 943: this.useStyle = 1; @@ -14111,7 +13896,6 @@ namespace Terraria this.width = 26; this.height = 36; this.value = Item.buyPrice(gold: 4); - this.rare = 1; break; case 944: this.useStyle = 1; @@ -14126,7 +13910,6 @@ namespace Terraria this.width = 26; this.height = 36; this.value = Item.buyPrice(gold: 4); - this.rare = 1; break; case 945: this.useStyle = 1; @@ -14141,7 +13924,6 @@ namespace Terraria this.width = 26; this.height = 36; this.value = Item.buyPrice(gold: 4); - this.rare = 1; break; case 946: this.width = 44; @@ -14149,13 +13931,6 @@ namespace Terraria this.rare = 1; this.value = 10000; this.holdStyle = 2; - this.useStyle = 3; - this.useAnimation = 22; - this.useTime = 22; - this.damage = 10; - this.knockBack = 5f; - this.UseSound = SoundID.Item1; - this.melee = true; break; case 947: this.useStyle = 1; @@ -14169,15 +13944,16 @@ namespace Terraria this.width = 12; this.height = 12; this.rare = 7; - this.value = Item.sellPrice(silver: 15); + this.value = 3000; break; case 948: this.width = 24; this.height = 8; this.accessory = true; + this.value = 400000; this.rare = 8; this.wingSlot = (sbyte) 12; - this.value = Item.buyPrice(3); + this.value = Item.buyPrice(1); break; case 949: this.useStyle = 1; @@ -14194,7 +13970,7 @@ namespace Terraria this.useTime = 19; this.noUseGraphic = true; this.noMelee = true; - this.ranged = true; + this.thrown = true; this.knockBack = 5.75f; break; case 950: @@ -14238,7 +14014,7 @@ namespace Terraria this.height = 24; this.accessory = true; this.rare = 1; - this.value = Item.sellPrice(silver: 50); + this.value = 50000; this.handOnSlot = (sbyte) 11; this.handOffSlot = (sbyte) 6; break; @@ -14317,7 +14093,7 @@ namespace Terraria this.height = 24; this.accessory = true; this.rare = 7; - this.value = Item.buyPrice(gold: 15); + this.value = 50000; this.waistSlot = (sbyte) 10; break; case 964: @@ -14375,6 +14151,22 @@ namespace Terraria this.height = 12; this.value = 200; break; + case 969: + this.UseSound = SoundID.Item2; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 12; + this.height = 12; + this.buffType = 26; + this.buffTime = 36000; + this.rare = 1; + this.value = 1000; + this.value = 1000; + break; case 970: this.createTile = 216; this.placeStyle = 0; @@ -14443,7 +14235,7 @@ namespace Terraria this.useTime = 10; this.holdStyle = 1; this.autoReuse = true; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 4; this.placeStyle = 9; @@ -14475,7 +14267,7 @@ namespace Terraria this.height = 24; this.accessory = true; this.rare = 7; - this.value = Item.buyPrice(gold: 15); + this.value = 50000; this.shoeSlot = (sbyte) 3; break; case 978: @@ -14573,7 +14365,6 @@ namespace Terraria this.accessory = true; this.rare = 1; this.value = 50000; - this.waistSlot = (sbyte) 13; break; case 988: this.shootSpeed = 3.75f; @@ -14593,17 +14384,17 @@ namespace Terraria this.rare = 2; this.UseSound = SoundID.Item1; this.useStyle = 1; - this.damage = 23; - this.useAnimation = 21; + this.damage = 24; + this.useAnimation = 18; this.useTime = 45; this.scale = 1.1f; this.width = 30; this.height = 30; this.shoot = 173; this.shootSpeed = 9.5f; - this.knockBack = 4.25f; + this.knockBack = 5.25f; this.melee = true; - this.value = Item.sellPrice(gold: 3); + this.value = 20000; break; case 990: this.useTurn = true; @@ -14628,7 +14419,7 @@ namespace Terraria this.autoReuse = true; this.useStyle = 1; this.useAnimation = 35; - this.useTime = 13; + this.useTime = 8; this.knockBack = 5f; this.width = 20; this.height = 12; @@ -14645,7 +14436,7 @@ namespace Terraria this.autoReuse = true; this.useStyle = 1; this.useAnimation = 35; - this.useTime = 10; + this.useTime = 8; this.knockBack = 6f; this.width = 20; this.height = 12; @@ -14662,7 +14453,7 @@ namespace Terraria this.autoReuse = true; this.useStyle = 1; this.useAnimation = 35; - this.useTime = 8; + this.useTime = 6; this.knockBack = 7f; this.width = 20; this.height = 12; @@ -14685,7 +14476,7 @@ namespace Terraria this.useTime = 20; this.rare = 3; this.noMelee = true; - this.value = Item.sellPrice(gold: 7, silver: 50); + this.value = 0; this.buffType = 45; break; case 995: @@ -14782,7 +14573,7 @@ namespace Terraria case 1001: this.width = 18; this.height = 18; - this.defense = 20; + this.defense = 25; this.headSlot = 78; this.rare = 7; this.value = 300000; @@ -14822,7 +14613,7 @@ namespace Terraria case 1006: this.width = 20; this.height = 20; - this.maxStack = 999; + this.maxStack = 99; this.value = Item.sellPrice(silver: 90); this.rare = 7; this.useStyle = 1; @@ -15517,7 +15308,7 @@ namespace Terraria this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; - this.useTime = 7; + this.useTime = 10; this.autoReuse = true; this.maxStack = 999; this.consumable = true; @@ -15752,7 +15543,7 @@ namespace Terraria this.damage = 9; this.shootSpeed = 8f; this.noMelee = true; - this.value = this.queenBeePrice; + this.value = Item.sellPrice(gold: 3); this.rare = 2; this.magic = true; this.scale = 0.8f; @@ -15770,22 +15561,23 @@ namespace Terraria this.useTime = 14; this.noUseGraphic = true; this.noMelee = true; - this.value = Item.buyPrice(gold: 35); + this.value = 500000; this.knockBack = 5f; this.melee = true; this.rare = 7; break; case 1123: this.useStyle = 1; - this.useAnimation = 22; - this.knockBack = 5f; + this.useAnimation = 20; + this.knockBack = 5.3f; + this.autoReuse = true; this.width = 40; this.height = 40; - this.damage = 24; + this.damage = 26; this.scale = 1.1f; this.UseSound = SoundID.Item1; this.rare = 3; - this.value = this.queenBeePrice; + this.value = 27000; this.melee = true; break; case 1124: @@ -15809,7 +15601,7 @@ namespace Terraria this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; - this.useTime = 7; + this.useTime = 10; this.autoReuse = true; this.maxStack = 999; this.consumable = true; @@ -15850,7 +15642,6 @@ namespace Terraria this.width = 8; this.height = 10; this.rare = 1; - this.value = Item.sellPrice(silver: 50); break; case 1130: this.useStyle = 1; @@ -15868,14 +15659,14 @@ namespace Terraria this.noUseGraphic = true; this.noMelee = true; this.value = 200; - this.ranged = true; + this.thrown = true; break; case 1131: this.width = 22; this.height = 22; this.accessory = true; this.rare = 8; - this.value = Item.sellPrice(gold: 40); + this.value = 50000; this.expert = true; break; case 1132: @@ -15893,12 +15684,11 @@ namespace Terraria this.width = 28; this.height = 28; this.maxStack = 20; - this.rare = 1; break; case 1134: this.UseSound = SoundID.Item3; this.healLife = 80; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -16007,7 +15797,6 @@ namespace Terraria this.placeStyle = 12; this.width = 12; this.height = 30; - this.value = 150; break; case 1144: this.useStyle = 1; @@ -16169,14 +15958,14 @@ namespace Terraria case 1155: this.useStyle = 5; this.autoReuse = true; - this.useAnimation = 18; - this.useTime = 18; - this.mana = 10; + this.useAnimation = 11; + this.useTime = 11; + this.mana = 6; this.width = 50; this.height = 18; this.shoot = 189; this.UseSound = SoundID.Item11; - this.damage = 31; + this.damage = 21; this.shootSpeed = 9f; this.noMelee = true; this.value = 500000; @@ -16197,7 +15986,7 @@ namespace Terraria this.shootSpeed = 14f; this.UseSound = SoundID.Item10; this.rare = 8; - this.value = Item.sellPrice(gold: 20); + this.value = Item.sellPrice(gold: 5, silver: 50); this.ranged = true; this.noMelee = true; break; @@ -16216,7 +16005,7 @@ namespace Terraria this.noMelee = true; this.knockBack = 3f; this.buffType = 49; - this.value = Item.buyPrice(gold: 35); + this.value = 100000; this.summon = true; break; case 1158: @@ -16255,7 +16044,7 @@ namespace Terraria this.width = 24; this.height = 8; this.accessory = true; - this.value = Item.buyPrice(gold: 75); + this.value = Item.buyPrice(1); this.wingSlot = (sbyte) 13; this.rare = 5; break; @@ -16525,7 +16314,7 @@ namespace Terraria case 1184: this.width = 20; this.height = 20; - this.maxStack = 999; + this.maxStack = 99; this.value = 13500; this.rare = 3; this.useStyle = 1; @@ -16546,7 +16335,7 @@ namespace Terraria this.knockBack = 4.75f; this.width = 40; this.height = 40; - this.damage = 45; + this.damage = 36; this.scale = 1.125f; this.UseSound = SoundID.Item1; this.rare = 4; @@ -16574,8 +16363,8 @@ namespace Terraria case 1187: this.useStyle = 5; this.autoReuse = true; - this.useAnimation = 23; - this.useTime = 23; + this.useAnimation = 24; + this.useTime = 24; this.width = 50; this.height = 18; this.shoot = 1; @@ -16594,7 +16383,7 @@ namespace Terraria this.useTurn = true; this.autoReuse = true; this.useAnimation = 25; - this.useTime = 12; + this.useTime = 11; this.knockBack = 5f; this.width = 20; this.height = 12; @@ -16609,7 +16398,7 @@ namespace Terraria case 1189: this.useStyle = 5; this.useAnimation = 25; - this.useTime = 12; + this.useTime = 11; this.shootSpeed = 32f; this.knockBack = 0.0f; this.width = 20; @@ -16628,7 +16417,7 @@ namespace Terraria case 1190: this.useStyle = 5; this.useAnimation = 25; - this.useTime = 12; + this.useTime = 8; this.shootSpeed = 40f; this.knockBack = 2.9f; this.width = 20; @@ -16647,8 +16436,8 @@ namespace Terraria case 1191: this.width = 20; this.height = 20; - this.maxStack = 999; - this.value = Item.sellPrice(silver: 52); + this.maxStack = 99; + this.value = 22000; this.rare = 3; this.useStyle = 1; this.useTurn = true; @@ -16660,14 +16449,13 @@ namespace Terraria this.placeStyle = 14; break; case 1192: - this.autoReuse = true; this.useStyle = 1; - this.useAnimation = 25; - this.useTime = 25; + this.useAnimation = 26; + this.useTime = 26; this.knockBack = 6f; this.width = 40; this.height = 40; - this.damage = 50; + this.damage = 41; this.scale = 1.17f; this.UseSound = SoundID.Item1; this.rare = 4; @@ -16695,8 +16483,8 @@ namespace Terraria case 1194: this.useStyle = 5; this.autoReuse = true; - this.useAnimation = 21; - this.useTime = 21; + this.useAnimation = 22; + this.useTime = 22; this.width = 50; this.height = 18; this.shoot = 1; @@ -16713,7 +16501,7 @@ namespace Terraria case 1195: this.useStyle = 1; this.useAnimation = 25; - this.useTime = 9; + this.useTime = 8; this.knockBack = 5f; this.useTurn = true; this.autoReuse = true; @@ -16730,7 +16518,7 @@ namespace Terraria case 1196: this.useStyle = 5; this.useAnimation = 25; - this.useTime = 9; + this.useTime = 10; this.shootSpeed = 32f; this.knockBack = 0.0f; this.width = 20; @@ -16749,7 +16537,7 @@ namespace Terraria case 1197: this.useStyle = 5; this.useAnimation = 25; - this.useTime = 9; + this.useTime = 7; this.shootSpeed = 40f; this.knockBack = 3.75f; this.width = 20; @@ -16768,8 +16556,8 @@ namespace Terraria case 1198: this.width = 20; this.height = 20; - this.maxStack = 999; - this.value = Item.sellPrice(silver: 85); + this.maxStack = 99; + this.value = 37500; this.rare = 3; this.useStyle = 1; this.useTurn = true; @@ -16781,14 +16569,13 @@ namespace Terraria this.placeStyle = 16; break; case 1199: - this.autoReuse = true; this.useStyle = 1; - this.useAnimation = 25; - this.useTime = 25; + this.useAnimation = 26; + this.useTime = 26; this.knockBack = 6f; this.width = 40; this.height = 40; - this.damage = 58; + this.damage = 46; this.scale = 1.2f; this.UseSound = SoundID.Item1; this.rare = 4; @@ -16816,8 +16603,8 @@ namespace Terraria case 1201: this.useStyle = 5; this.autoReuse = true; - this.useAnimation = 18; - this.useTime = 18; + this.useAnimation = 19; + this.useTime = 19; this.width = 50; this.height = 18; this.shoot = 1; @@ -16870,7 +16657,7 @@ namespace Terraria case 1204: this.useStyle = 5; this.useAnimation = 25; - this.useTime = 7; + this.useTime = 6; this.shootSpeed = 40f; this.knockBack = 4.6f; this.width = 20; @@ -17041,7 +16828,7 @@ namespace Terraria this.autoReuse = true; this.useStyle = 1; this.useAnimation = 35; - this.useTime = 12; + this.useTime = 8; this.knockBack = 5.5f; this.width = 20; this.height = 12; @@ -17058,7 +16845,7 @@ namespace Terraria this.autoReuse = true; this.useStyle = 1; this.useAnimation = 35; - this.useTime = 9; + this.useTime = 7; this.knockBack = 6.5f; this.width = 20; this.height = 12; @@ -17075,7 +16862,7 @@ namespace Terraria this.autoReuse = true; this.useStyle = 1; this.useAnimation = 35; - this.useTime = 7; + this.useTime = 6; this.knockBack = 7.5f; this.width = 20; this.height = 12; @@ -17083,14 +16870,14 @@ namespace Terraria this.axe = 21; this.UseSound = SoundID.Item1; this.rare = 4; - this.value = 126000; + this.value = 108000; this.melee = true; this.scale = 1.1f; break; case 1225: this.width = 20; this.height = 20; - this.maxStack = 999; + this.maxStack = 99; this.value = Item.sellPrice(silver: 40); this.rare = 4; this.useStyle = 1; @@ -17111,7 +16898,7 @@ namespace Terraria this.knockBack = 6f; this.width = 40; this.height = 40; - this.damage = 80; + this.damage = 75; this.UseSound = SoundID.Item1; this.rare = 7; this.value = 276000; @@ -17234,7 +17021,7 @@ namespace Terraria this.autoReuse = true; this.useStyle = 1; this.useAnimation = 30; - this.useTime = 7; + this.useTime = 6; this.knockBack = 7f; this.width = 20; this.height = 12; @@ -17414,14 +17201,13 @@ namespace Terraria this.magic = true; break; case 1245: - this.flame = true; this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; this.useTime = 10; this.holdStyle = 1; this.autoReuse = true; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 4; this.placeStyle = 10; @@ -17442,7 +17228,6 @@ namespace Terraria this.width = 12; this.height = 12; this.ammo = AmmoID.Sand; - this.notAmmo = true; break; case 1247: this.width = 20; @@ -17456,14 +17241,14 @@ namespace Terraria this.width = 24; this.height = 24; this.accessory = true; - this.value = Item.buyPrice(gold: 25); + this.value = 100000; this.rare = 7; break; case 1249: this.width = 14; this.height = 28; this.rare = 2; - this.value = Item.sellPrice(gold: 2); + this.value = 54000; this.accessory = true; this.balloonSlot = (sbyte) 7; break; @@ -17471,7 +17256,7 @@ namespace Terraria this.width = 20; this.height = 22; this.rare = 4; - this.value = Item.buyPrice(gold: 15); + this.value = 45000; this.accessory = true; this.balloonSlot = (sbyte) 2; break; @@ -17479,7 +17264,7 @@ namespace Terraria this.width = 20; this.height = 22; this.rare = 4; - this.value = Item.buyPrice(gold: 15); + this.value = 45000; this.accessory = true; this.balloonSlot = (sbyte) 9; break; @@ -17487,7 +17272,7 @@ namespace Terraria this.width = 20; this.height = 22; this.rare = 4; - this.value = Item.buyPrice(gold: 15); + this.value = 45000; this.accessory = true; this.balloonSlot = (sbyte) 10; break; @@ -17511,7 +17296,7 @@ namespace Terraria this.damage = 185; this.shootSpeed = 16f; this.noMelee = true; - this.value = Item.buyPrice(gold: 40); + this.value = 100000; this.knockBack = 8f; this.rare = 8; this.ranged = true; @@ -17527,7 +17312,7 @@ namespace Terraria this.knockBack = 5.5f; this.useAmmo = AmmoID.Bullet; this.UseSound = SoundID.Item41; - this.damage = 50; + this.damage = 38; this.shootSpeed = 13.5f; this.noMelee = true; this.value = Item.sellPrice(gold: 5); @@ -17549,15 +17334,15 @@ namespace Terraria this.rare = 1; this.noMelee = true; this.knockBack = 0.0f; - this.value = this.shadowOrbPrice; + this.value = 10000; this.magic = true; break; case 1257: this.width = 20; this.height = 20; - this.maxStack = 999; + this.maxStack = 99; this.rare = 1; - this.value = Item.sellPrice(silver: 39); + this.value = 20000; this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; @@ -17581,7 +17366,7 @@ namespace Terraria this.knockBack = 5f; this.shootSpeed = 9f; this.noMelee = true; - this.value = Item.buyPrice(gold: 35); + this.value = 350000; this.rare = 7; this.ranged = true; break; @@ -17590,7 +17375,7 @@ namespace Terraria this.useStyle = 5; this.useAnimation = 40; this.useTime = 40; - this.knockBack = 6.5f; + this.knockBack = 7.5f; this.width = 30; this.height = 10; this.damage = 65; @@ -17616,7 +17401,7 @@ namespace Terraria this.knockBack = 2.5f; this.shootSpeed = 16f; this.noMelee = true; - this.value = Item.sellPrice(gold: 20); + this.value = 350000; this.rare = 8; this.magic = true; this.mana = 20; @@ -17670,20 +17455,20 @@ namespace Terraria this.mech = true; break; case 1264: - this.mana = 11; - this.damage = 60; + this.mana = 17; + this.damage = 55; this.useStyle = 1; this.shootSpeed = 7f; this.shoot = 253; this.width = 26; this.height = 28; this.UseSound = SoundID.Item20; - this.useAnimation = 12; - this.useTime = 12; - this.rare = 5; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 6; this.noMelee = true; this.knockBack = 6.5f; - this.value = Item.sellPrice(gold: 5); + this.value = 10000; this.magic = true; break; case 1265: @@ -17700,7 +17485,7 @@ namespace Terraria this.damage = 30; this.shootSpeed = 13f; this.noMelee = true; - this.value = Item.sellPrice(gold: 7); + this.value = 50000; this.scale = 0.75f; this.rare = 7; this.ranged = true; @@ -17869,7 +17654,6 @@ namespace Terraria this.height = 20; this.headSlot = 98; this.rare = 1; - this.value = Item.sellPrice(silver: 75); this.vanity = true; break; case 1282: @@ -17938,7 +17722,7 @@ namespace Terraria this.height = 22; this.accessory = true; this.rare = 1; - this.value = this.shadowOrbPrice; + this.value = 50000; this.neckSlot = (sbyte) 3; break; case 1291: @@ -17996,13 +17780,13 @@ namespace Terraria this.mana = 8; this.useStyle = 5; this.autoReuse = true; - this.useAnimation = 10; - this.useTime = 10; + this.useAnimation = 16; + this.useTime = 16; this.width = 24; this.height = 18; this.shoot = 260; this.UseSound = SoundID.Item12; - this.damage = 80; + this.damage = 55; this.shootSpeed = 15f; this.noMelee = true; this.value = 350000; @@ -18011,20 +17795,20 @@ namespace Terraria this.magic = true; break; case 1296: - this.mana = 18; - this.damage = 125; - this.useStyle = 5; - this.crit = 20; - this.shootSpeed = 12f; + this.mana = 15; + this.damage = 73; + this.useStyle = 1; + this.shootSpeed = 11f; this.shoot = 261; this.width = 26; this.height = 28; this.UseSound = SoundID.Item69; - this.useAnimation = this.useTime = 24; + this.useAnimation = 40; + this.useTime = 40; this.rare = 7; this.noMelee = true; this.knockBack = 7.5f; - this.value = Item.buyPrice(gold: 35); + this.value = Item.sellPrice(gold: 10); this.magic = true; break; case 1297: @@ -18035,13 +17819,13 @@ namespace Terraria this.knockBack = 12f; this.width = 30; this.height = 10; - this.damage = 90; + this.damage = 76; this.scale = 0.9f; this.shoot = 262; this.shootSpeed = 14f; this.UseSound = SoundID.Item10; this.rare = 7; - this.value = Item.buyPrice(gold: 35); + this.value = Item.sellPrice(gold: 5); this.melee = true; this.noMelee = true; break; @@ -18128,6 +17912,7 @@ namespace Terraria this.hammer = 100; this.tileBoost = 1; this.scale = 1.15f; + this.UseSound = SoundID.Item47; this.rare = 8; this.value = Item.sellPrice(gold: 10); this.melee = true; @@ -18159,7 +17944,7 @@ namespace Terraria this.mana = 22; this.UseSound = SoundID.Item43; this.useStyle = 5; - this.damage = 43; + this.damage = 48; this.useAnimation = 36; this.useTime = 36; this.width = 40; @@ -18244,12 +18029,12 @@ namespace Terraria this.useTime = 26; this.width = 24; this.height = 28; - this.shoot = 837; + this.shoot = 270; this.scale = 0.9f; this.shootSpeed = 3.5f; this.knockBack = 3.5f; this.magic = true; - this.value = Item.sellPrice(gold: 1, silver: 50); + this.value = 50000; break; case 1314: this.autoReuse = true; @@ -18265,7 +18050,7 @@ namespace Terraria this.shootSpeed = 15f; this.UseSound = SoundID.Item10; this.rare = 4; - this.value = Item.sellPrice(gold: 3, silver: 50); + this.value = 27000; this.melee = true; this.noMelee = true; break; @@ -18276,7 +18061,6 @@ namespace Terraria this.useTime = 45; this.width = 28; this.height = 28; - this.maxStack = 20; break; case 1316: this.width = 18; @@ -18331,7 +18115,7 @@ namespace Terraria this.width = 24; this.height = 28; this.damage = 8; - this.pick = 55; + this.pick = 50; this.UseSound = SoundID.Item1; this.knockBack = 3f; this.rare = 1; @@ -18389,12 +18173,12 @@ namespace Terraria this.knockBack = 3.5f; this.width = 30; this.height = 10; - this.damage = 12; + this.damage = 11; this.shoot = 273; this.shootSpeed = 12f; this.UseSound = SoundID.Item1; - this.rare = 1; - this.value = Item.sellPrice(silver: 25); + this.rare = 2; + this.value = 1000; this.melee = true; this.noUseGraphic = true; break; @@ -18423,7 +18207,7 @@ namespace Terraria this.rare = 6; this.shoot = 274; this.shootSpeed = 9f; - this.value = this.eclipsePrice; + this.value = 250000; this.melee = true; break; case 1328: @@ -18436,7 +18220,7 @@ namespace Terraria case 1329: this.width = 14; this.height = 18; - this.maxStack = 999; + this.maxStack = 99; this.rare = 1; this.value = 750; break; @@ -18454,7 +18238,6 @@ namespace Terraria this.width = 28; this.height = 28; this.maxStack = 20; - this.rare = 1; break; case 1332: this.width = 12; @@ -18471,13 +18254,13 @@ namespace Terraria this.useTime = 10; this.holdStyle = 1; this.autoReuse = true; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 4; this.placeStyle = 11; this.width = 10; this.height = 12; - this.value = 160; + this.value = 330; this.rare = 1; break; case 1334: @@ -18490,7 +18273,7 @@ namespace Terraria this.consumable = true; this.ammo = AmmoID.Arrow; this.knockBack = 3f; - this.value = 40; + this.value = 80; this.ranged = true; this.rare = 3; break; @@ -18522,7 +18305,7 @@ namespace Terraria this.shootSpeed = 10f; this.UseSound = SoundID.Item13; this.rare = 4; - this.value = Item.sellPrice(gold: 4); + this.value = 500000; this.magic = true; this.noMelee = true; break; @@ -18541,7 +18324,6 @@ namespace Terraria this.value = Item.buyPrice(gold: 50); break; case 1338: - this.noUseGraphic = true; this.useStyle = 1; this.useTurn = true; this.useAnimation = 20; @@ -18554,17 +18336,16 @@ namespace Terraria this.damage = 350; this.noMelee = true; this.value = Item.buyPrice(silver: 35); - this.makeNPC = (short) 614; break; case 1339: this.width = 12; this.height = 20; this.maxStack = 99; - this.value = Item.buyPrice(silver: 15); + this.value = Item.buyPrice(silver: 10); break; case 1340: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -18580,7 +18361,7 @@ namespace Terraria case 1341: this.shootSpeed = 4.3f; this.shoot = 282; - this.damage = 19; + this.damage = 17; this.width = 10; this.height = 28; this.maxStack = 999; @@ -18594,7 +18375,7 @@ namespace Terraria case 1342: this.shootSpeed = 5.3f; this.shoot = 283; - this.damage = 15; + this.damage = 14; this.width = 8; this.height = 8; this.maxStack = 999; @@ -18631,7 +18412,7 @@ namespace Terraria this.width = 12; this.height = 20; this.maxStack = 99; - this.value = Item.buyPrice(silver: 2); + this.value = Item.buyPrice(silver: 1); this.noMelee = true; this.useStyle = 1; this.useAnimation = this.useTime = 20; @@ -18642,7 +18423,7 @@ namespace Terraria this.width = 12; this.height = 20; this.maxStack = 99; - this.value = Item.buyPrice(silver: 15); + this.value = Item.buyPrice(silver: 10); break; case 1347: this.width = 12; @@ -18666,14 +18447,14 @@ namespace Terraria this.consumable = true; this.ammo = AmmoID.Bullet; this.knockBack = 5f; - this.value = 10; + this.value = 40; this.ranged = true; this.rare = 3; break; case 1350: this.shootSpeed = 4.6f; this.shoot = 285; - this.damage = 15; + this.damage = 10; this.width = 8; this.height = 8; this.maxStack = 999; @@ -18714,7 +18495,7 @@ namespace Terraria break; case 1353: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -18729,7 +18510,7 @@ namespace Terraria break; case 1354: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -18744,7 +18525,7 @@ namespace Terraria break; case 1355: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -18759,7 +18540,7 @@ namespace Terraria break; case 1356: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -18774,7 +18555,7 @@ namespace Terraria break; case 1357: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -18789,7 +18570,7 @@ namespace Terraria break; case 1358: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -18799,12 +18580,12 @@ namespace Terraria this.height = 24; this.buffType = 78; this.buffTime = 72000; - this.value = Item.sellPrice(silver: 3); + this.value = Item.sellPrice(silver: 5); this.rare = 4; break; case 1359: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -19240,7 +19021,6 @@ namespace Terraria this.createTile = 42; this.width = 12; this.height = 28; - this.value = Item.sellPrice(copper: 30); this.placeStyle = 1; break; case 1391: @@ -19254,7 +19034,6 @@ namespace Terraria this.createTile = 42; this.width = 12; this.height = 28; - this.value = Item.sellPrice(copper: 30); this.placeStyle = 2; break; case 1392: @@ -19268,7 +19047,6 @@ namespace Terraria this.createTile = 42; this.width = 12; this.height = 28; - this.value = Item.sellPrice(copper: 30); this.placeStyle = 3; break; case 1393: @@ -19282,7 +19060,6 @@ namespace Terraria this.createTile = 42; this.width = 12; this.height = 28; - this.value = Item.sellPrice(copper: 30); this.placeStyle = 4; break; case 1394: @@ -19296,7 +19073,6 @@ namespace Terraria this.createTile = 42; this.width = 12; this.height = 28; - this.value = Item.sellPrice(copper: 30); this.placeStyle = 5; break; case 1395: @@ -19310,7 +19086,6 @@ namespace Terraria this.createTile = 42; this.width = 12; this.height = 28; - this.value = Item.sellPrice(copper: 30); this.placeStyle = 6; break; case 1396: @@ -19325,7 +19100,6 @@ namespace Terraria this.placeStyle = 13; this.width = 12; this.height = 30; - this.value = 150; break; case 1397: this.useStyle = 1; @@ -19367,7 +19141,6 @@ namespace Terraria this.placeStyle = 14; this.width = 12; this.height = 30; - this.value = 150; break; case 1400: this.useStyle = 1; @@ -19409,7 +19182,6 @@ namespace Terraria this.placeStyle = 15; this.width = 12; this.height = 30; - this.value = 150; break; case 1403: this.useStyle = 1; @@ -19451,7 +19223,6 @@ namespace Terraria this.createTile = 33; this.width = 8; this.height = 18; - this.value = Item.sellPrice(copper: 60); this.placeStyle = 1; break; case 1406: @@ -19466,7 +19237,6 @@ namespace Terraria this.createTile = 33; this.width = 8; this.height = 18; - this.value = Item.sellPrice(copper: 60); this.placeStyle = 2; break; case 1407: @@ -19481,7 +19251,6 @@ namespace Terraria this.createTile = 33; this.width = 8; this.height = 18; - this.value = Item.sellPrice(copper: 60); this.placeStyle = 3; break; case 1408: @@ -19805,14 +19574,13 @@ namespace Terraria this.createTile = 42; this.width = 12; this.height = 28; - this.value = Item.sellPrice(silver: 5); this.placeStyle = 7; break; case 1432: this.width = 12; this.height = 20; this.maxStack = 999; - this.value = Item.buyPrice(copper: 5); + this.value = Item.buyPrice(copper: 3); break; case 1433: this.useStyle = 1; @@ -20004,10 +19772,10 @@ namespace Terraria this.rare = 8; break; case 1446: - this.mana = 15; + this.mana = 11; this.UseSound = SoundID.Item43; this.useStyle = 5; - this.damage = 65; + this.damage = 72; this.autoReuse = true; this.useAnimation = 24; this.useTime = 24; @@ -20194,7 +19962,6 @@ namespace Terraria this.placeStyle = 16; this.width = 12; this.height = 30; - this.value = 150; break; case 1460: this.useStyle = 1; @@ -20551,7 +20318,6 @@ namespace Terraria this.placeStyle = 17; this.width = 12; this.height = 30; - this.value = 150; return; case 1510: this.useStyle = 1; @@ -20710,7 +20476,7 @@ namespace Terraria this.autoReuse = true; this.width = 24; this.height = 24; - this.value = Item.sellPrice(gold: 6); + this.value = 10000; this.tileBoost += 3; return; } @@ -20772,7 +20538,7 @@ namespace Terraria case 1552: this.width = 20; this.height = 20; - this.maxStack = 999; + this.maxStack = 99; this.rare = 7; this.value = Item.sellPrice(gold: 1); this.useStyle = 1; @@ -20795,7 +20561,7 @@ namespace Terraria this.shoot = 10; this.useAmmo = AmmoID.Bullet; this.UseSound = SoundID.Item40; - this.damage = 85; + this.damage = 77; this.shootSpeed = 12f; this.noMelee = true; this.value = 750000; @@ -20809,7 +20575,6 @@ namespace Terraria this.rare = 9; this.vanity = true; this.headSlot = 106; - this.value = Item.sellPrice(gold: 5); return; case 1555: this.width = 18; @@ -20817,7 +20582,6 @@ namespace Terraria this.rare = 9; this.vanity = true; this.bodySlot = 68; - this.value = Item.sellPrice(gold: 5); return; case 1556: this.width = 18; @@ -20825,7 +20589,6 @@ namespace Terraria this.rare = 9; this.vanity = true; this.legSlot = 57; - this.value = Item.sellPrice(gold: 5); return; case 1557: this.width = 18; @@ -20833,7 +20596,6 @@ namespace Terraria this.rare = 9; this.vanity = true; this.headSlot = 107; - this.value = Item.sellPrice(gold: 5); return; case 1558: this.width = 18; @@ -20841,7 +20603,6 @@ namespace Terraria this.rare = 9; this.vanity = true; this.bodySlot = 69; - this.value = Item.sellPrice(gold: 5); return; case 1559: this.width = 18; @@ -20849,7 +20610,6 @@ namespace Terraria this.rare = 9; this.vanity = true; this.legSlot = 58; - this.value = Item.sellPrice(gold: 5); return; case 1560: this.width = 18; @@ -20857,7 +20617,6 @@ namespace Terraria this.rare = 9; this.vanity = true; this.headSlot = 108; - this.value = Item.sellPrice(gold: 5); return; case 1561: this.width = 18; @@ -20865,7 +20624,6 @@ namespace Terraria this.rare = 9; this.vanity = true; this.bodySlot = 70; - this.value = Item.sellPrice(gold: 5); return; case 1562: this.width = 18; @@ -20873,7 +20631,6 @@ namespace Terraria this.rare = 9; this.vanity = true; this.legSlot = 59; - this.value = Item.sellPrice(gold: 5); return; case 1563: this.width = 18; @@ -20881,7 +20638,6 @@ namespace Terraria this.rare = 9; this.vanity = true; this.headSlot = 109; - this.value = Item.sellPrice(gold: 5); return; case 1564: this.width = 18; @@ -20889,7 +20645,6 @@ namespace Terraria this.rare = 9; this.vanity = true; this.bodySlot = 71; - this.value = Item.sellPrice(gold: 5); return; case 1565: this.width = 18; @@ -20897,7 +20652,6 @@ namespace Terraria this.rare = 9; this.vanity = true; this.legSlot = 60; - this.value = Item.sellPrice(gold: 5); return; case 1566: this.width = 18; @@ -20905,7 +20659,6 @@ namespace Terraria this.rare = 9; this.vanity = true; this.headSlot = 110; - this.value = Item.sellPrice(gold: 5); return; case 1567: this.width = 18; @@ -20913,7 +20666,6 @@ namespace Terraria this.rare = 9; this.vanity = true; this.bodySlot = 72; - this.value = Item.sellPrice(gold: 5); return; case 1568: this.width = 18; @@ -20921,7 +20673,6 @@ namespace Terraria this.rare = 9; this.vanity = true; this.legSlot = 61; - this.value = Item.sellPrice(gold: 5); return; case 1569: this.autoReuse = true; @@ -20946,7 +20697,7 @@ namespace Terraria this.height = 18; this.maxStack = 99; this.rare = 8; - this.value = this.eclipsePrice; + this.value = Item.sellPrice(gold: 2); return; case 1571: this.autoReuse = true; @@ -21053,7 +20804,6 @@ namespace Terraria this.rare = 9; this.vanity = true; this.headSlot = 111; - this.value = Item.sellPrice(gold: 5); return; case 1581: this.width = 18; @@ -21061,7 +20811,6 @@ namespace Terraria this.rare = 9; this.vanity = true; this.bodySlot = 73; - this.value = Item.sellPrice(gold: 5); return; case 1582: this.width = 18; @@ -21069,7 +20818,6 @@ namespace Terraria this.rare = 9; this.vanity = true; this.legSlot = 62; - this.value = Item.sellPrice(gold: 5); return; case 1583: this.width = 24; @@ -21109,7 +20857,6 @@ namespace Terraria this.rare = 9; this.vanity = true; this.bodySlot = 74; - this.value = Item.sellPrice(gold: 5); return; case 1588: this.width = 18; @@ -21117,7 +20864,6 @@ namespace Terraria this.rare = 9; this.vanity = true; this.legSlot = 63; - this.value = Item.sellPrice(gold: 5); return; case 1589: this.useStyle = 1; @@ -21216,7 +20962,6 @@ namespace Terraria this.rare = 4; this.value = 100000; this.accessory = true; - this.canBePlacedInVanityRegardlessOfConditions = true; return; } switch (type) @@ -21303,7 +21048,6 @@ namespace Terraria this.placeStyle = 18 + type - 1703; this.width = 12; this.height = 30; - this.value = 150; return; } if (type >= 1709 && type <= 1712) @@ -21371,8 +21115,7 @@ namespace Terraria this.height = 24; this.accessory = true; this.rare = 2; - this.value = 50000; - this.waistSlot = (sbyte) 14; + this.value = 75000; return; case 1725: this.useStyle = 1; @@ -21809,7 +21552,7 @@ namespace Terraria this.damage = 44; this.shootSpeed = 10f; this.noMelee = true; - this.value = Item.sellPrice(gold: 10); + this.value = 750000; this.rare = 8; this.knockBack = 2f; this.ranged = true; @@ -21841,7 +21584,7 @@ namespace Terraria this.damage = 65; this.shootSpeed = 7f; this.noMelee = true; - this.value = Item.sellPrice(gold: 10); + this.value = 750000; this.rare = 8; this.knockBack = 5f; this.ranged = true; @@ -21872,6 +21615,21 @@ namespace Terraria this.value = Item.buyPrice(silver: 60); this.melee = true; return; + case 1787: + this.UseSound = SoundID.Item2; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 10; + this.height = 10; + this.buffType = 26; + this.buffTime = 162000; + this.rare = 1; + this.value = 1000; + return; case 1788: this.width = 18; this.height = 18; @@ -21919,7 +21677,6 @@ namespace Terraria this.placeStyle = 24; this.width = 12; this.height = 30; - this.value = 150; return; case 1793: this.useStyle = 1; @@ -22016,7 +21773,7 @@ namespace Terraria this.damage = 0; this.knockBack = 7f; this.useStyle = 5; - this.shootSpeed = 13.5f; + this.shootSpeed = 15.5f; this.shoot = 315; this.width = 18; this.height = 28; @@ -22025,14 +21782,14 @@ namespace Terraria this.useTime = 20; this.rare = 3; this.noMelee = true; - this.value = Item.sellPrice(gold: 1, silver: 50); + this.value = Item.sellPrice(gold: 2); return; case 1801: this.useStyle = 5; this.autoReuse = true; this.useAnimation = 12; this.useTime = 12; - this.mana = 6; + this.mana = 3; this.width = 50; this.height = 18; this.shoot = 316; @@ -22040,14 +21797,14 @@ namespace Terraria this.damage = 45; this.shootSpeed = 10f; this.noMelee = true; - this.value = Item.sellPrice(gold: 10); + this.value = 500000; this.rare = 8; this.magic = true; this.knockBack = 3f; return; case 1802: this.mana = 10; - this.damage = 55; + this.damage = 37; this.useStyle = 1; this.shootSpeed = 10f; this.shoot = 317; @@ -22060,7 +21817,7 @@ namespace Terraria this.noMelee = true; this.knockBack = 3f; this.buffType = 83; - this.value = Item.sellPrice(gold: 10); + this.value = 100000; this.summon = true; return; default: @@ -22095,7 +21852,7 @@ namespace Terraria this.useTime = 19; this.noUseGraphic = true; this.noMelee = true; - this.ranged = true; + this.thrown = true; this.knockBack = 6.5f; return; case 1810: @@ -22156,7 +21913,6 @@ namespace Terraria this.placeStyle = 25; this.width = 12; this.height = 30; - this.value = 150; return; case 1815: this.useStyle = 1; @@ -22309,7 +22065,7 @@ namespace Terraria this.useAnimation = 15; this.useTime = 10; this.autoReuse = true; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 254; this.width = 8; @@ -22352,7 +22108,7 @@ namespace Terraria this.height = 18; this.headSlot = 134; this.value = Item.sellPrice(gold: 1); - this.defense = 9; + this.defense = 8; this.rare = 8; return; case 1833: @@ -22360,7 +22116,7 @@ namespace Terraria this.height = 18; this.bodySlot = 95; this.value = Item.sellPrice(gold: 1); - this.defense = 11; + this.defense = 10; this.rare = 8; return; case 1834: @@ -22368,7 +22124,7 @@ namespace Terraria this.height = 18; this.legSlot = 79; this.value = Item.sellPrice(gold: 1); - this.defense = 10; + this.defense = 9; this.rare = 8; return; case 1835: @@ -22385,7 +22141,7 @@ namespace Terraria this.damage = 75; this.shootSpeed = 9f; this.noMelee = true; - this.value = Item.sellPrice(gold: 10); + this.value = 750000; this.rare = 8; this.knockBack = 6.5f; this.ranged = true; @@ -22569,8 +22325,6 @@ namespace Terraria this.width = 12; this.height = 28; this.placeStyle = 9; - this.value = 75000; - this.rare = 2; return; case 1860: this.width = 24; @@ -22767,7 +22521,7 @@ namespace Terraria this.shoot = 85; this.useAmmo = AmmoID.Gel; this.UseSound = SoundID.Item34; - this.damage = 60; + this.damage = 40; this.knockBack = 0.425f; this.shootSpeed = 8.5f; this.noMelee = true; @@ -22775,10 +22529,25 @@ namespace Terraria this.rare = 8; this.ranged = true; return; + case 1911: + this.UseSound = SoundID.Item2; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 10; + this.height = 10; + this.buffType = 26; + this.buffTime = 126000; + this.rare = 1; + this.value = 1000; + return; case 1912: this.UseSound = SoundID.Item3; this.healLife = 80; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -22805,7 +22574,7 @@ namespace Terraria this.noUseGraphic = true; this.noMelee = true; this.value = 25; - this.ranged = true; + this.thrown = true; return; case 1914: this.useStyle = 1; @@ -22833,7 +22602,7 @@ namespace Terraria this.useTime = 20; this.rare = 7; this.noMelee = true; - this.value = Item.sellPrice(gold: 2); + this.value = Item.sellPrice(gold: 4); return; case 1916: this.noUseGraphic = true; @@ -22883,6 +22652,36 @@ namespace Terraria this.value = 50000; this.melee = true; return; + case 1919: + this.UseSound = SoundID.Item2; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 10; + this.height = 10; + this.buffType = 26; + this.buffTime = 108000; + this.rare = 1; + this.value = 1000; + return; + case 1920: + this.UseSound = SoundID.Item2; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 10; + this.height = 10; + this.buffType = 26; + this.buffTime = 108000; + this.rare = 1; + this.value = 1000; + return; case 1921: this.width = 16; this.height = 24; @@ -22928,7 +22727,6 @@ namespace Terraria this.placeStyle = 26; this.width = 12; this.height = 30; - this.value = 150; return; case 1926: this.useStyle = 1; @@ -22959,7 +22757,6 @@ namespace Terraria return; case 1928: this.useStyle = 1; - this.autoReuse = true; this.useAnimation = 23; this.useTime = 23; this.knockBack = 7f; @@ -22967,8 +22764,8 @@ namespace Terraria this.height = 40; this.damage = 86; this.scale = 1.1f; - this.shoot = 907; - this.shootSpeed = 5f; + this.shoot = 335; + this.shootSpeed = 14f; this.UseSound = SoundID.Item1; this.rare = 8; this.value = Item.sellPrice(gold: 10); @@ -22987,7 +22784,7 @@ namespace Terraria this.damage = 31; this.shootSpeed = 14f; this.noMelee = true; - this.value = Item.buyPrice(gold: 45); + this.value = Item.sellPrice(gold: 5); this.rare = 8; this.knockBack = 1.75f; this.ranged = true; @@ -23005,7 +22802,7 @@ namespace Terraria this.shoot = 336; this.shootSpeed = 12f; this.knockBack = 3.25f; - this.value = Item.buyPrice(gold: 45); + this.value = Item.sellPrice(gold: 5); this.magic = true; this.rare = 8; this.noMelee = true; @@ -23022,7 +22819,7 @@ namespace Terraria this.shoot = 337; this.shootSpeed = 10f; this.knockBack = 4.5f; - this.value = Item.buyPrice(gold: 45); + this.value = Item.sellPrice(gold: 5); this.magic = true; this.rare = 8; this.noMelee = true; @@ -23138,7 +22935,7 @@ namespace Terraria this.damage = 67; this.shootSpeed = 15f; this.noMelee = true; - this.value = Item.buyPrice(gold: 45); + this.value = Item.sellPrice(gold: 20); this.knockBack = 4f; this.rare = 8; this.ranged = true; @@ -23156,7 +22953,7 @@ namespace Terraria this.UseSound = SoundID.Item1; this.shoot = 342; this.rare = 7; - this.value = Item.buyPrice(gold: 45); + this.value = 180000; this.noMelee = true; this.noUseGraphic = true; this.melee = true; @@ -23237,7 +23034,6 @@ namespace Terraria this.rare = 4; this.value = 100000; this.accessory = true; - this.canBePlacedInVanityRegardlessOfConditions = true; return; case 1964: this.useStyle = 1; @@ -23253,7 +23049,6 @@ namespace Terraria this.rare = 4; this.value = 100000; this.accessory = true; - this.canBePlacedInVanityRegardlessOfConditions = true; return; case 1965: this.useStyle = 1; @@ -23269,7 +23064,6 @@ namespace Terraria this.rare = 4; this.value = 100000; this.accessory = true; - this.canBePlacedInVanityRegardlessOfConditions = true; return; case 1966: this.paint = (byte) 28; @@ -23328,7 +23122,7 @@ namespace Terraria if (type == 1985) this.value = Item.buyPrice(gold: 15); this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -23366,8 +23160,6 @@ namespace Terraria this.createTile = 269; this.width = 22; this.height = 32; - this.createTile = 470; - this.placeStyle = 2; return; case 1990: this.width = 20; @@ -23376,7 +23168,7 @@ namespace Terraria this.value = Item.buyPrice(gold: 2); this.rare = 2; this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.hairDye = (short) 0; this.useAnimation = 17; @@ -23775,7 +23567,6 @@ namespace Terraria this.width = 12; this.height = 28; this.placeStyle = 10; - this.value = 150; return; case 2033: this.useStyle = 1; @@ -23789,7 +23580,6 @@ namespace Terraria this.width = 12; this.height = 28; this.placeStyle = 11; - this.value = 150; return; case 2034: this.useStyle = 1; @@ -23803,7 +23593,6 @@ namespace Terraria this.width = 12; this.height = 28; this.placeStyle = 12; - this.value = 150; return; case 2035: this.useStyle = 1; @@ -23817,7 +23606,6 @@ namespace Terraria this.width = 12; this.height = 28; this.placeStyle = 13; - this.value = 150; return; case 2036: this.useStyle = 1; @@ -23831,7 +23619,6 @@ namespace Terraria this.width = 12; this.height = 28; this.placeStyle = 14; - this.value = 150; return; case 2037: this.useStyle = 1; @@ -23845,7 +23632,6 @@ namespace Terraria this.width = 12; this.height = 28; this.placeStyle = 15; - this.value = 150; return; case 2038: this.useStyle = 1; @@ -23859,7 +23645,6 @@ namespace Terraria this.width = 12; this.height = 28; this.placeStyle = 16; - this.value = 150; return; case 2039: this.useStyle = 1; @@ -23873,7 +23658,6 @@ namespace Terraria this.width = 12; this.height = 28; this.placeStyle = 17; - this.value = 150; return; case 2040: this.useStyle = 1; @@ -23887,7 +23671,6 @@ namespace Terraria this.width = 12; this.height = 28; this.placeStyle = 18; - this.value = 150; return; case 2041: this.useStyle = 1; @@ -23901,7 +23684,6 @@ namespace Terraria this.width = 12; this.height = 28; this.placeStyle = 19; - this.value = 150; return; case 2042: this.useStyle = 1; @@ -23915,7 +23697,6 @@ namespace Terraria this.width = 12; this.height = 28; this.placeStyle = 20; - this.value = 150; return; case 2043: this.useStyle = 1; @@ -23929,7 +23710,6 @@ namespace Terraria this.width = 12; this.height = 28; this.placeStyle = 21; - this.value = 150; return; case 2044: this.useStyle = 1; @@ -23958,7 +23738,6 @@ namespace Terraria this.createTile = 33; this.width = 8; this.height = 18; - this.value = Item.sellPrice(copper: 60); this.placeStyle = 4 + type - 2045; return; } @@ -24048,7 +23827,6 @@ namespace Terraria this.height = 20; this.headSlot = type + 146 - 2104; this.rare = 1; - this.value = Item.sellPrice(silver: 75); this.vanity = true; return; } @@ -24244,7 +24022,6 @@ namespace Terraria this.width = 12; this.height = 28; this.placeStyle = 22 + type - 2145; - this.value = 150; return; } if (type >= 2149 && type <= 2152) @@ -24276,7 +24053,6 @@ namespace Terraria this.createTile = 33; this.width = 8; this.height = 18; - this.value = Item.sellPrice(copper: 60); this.placeStyle = 14 + type - 2153; return; } @@ -24382,7 +24158,7 @@ namespace Terraria this.useStyle = 1; this.useAnimation = 15; this.useTime = 10; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 199; this.width = 14; @@ -24444,7 +24220,7 @@ namespace Terraria this.axe = 25; this.UseSound = SoundID.Item1; this.rare = 8; - this.value = Item.sellPrice(gold: 4); + this.value = Item.sellPrice(gold: 1); this.melee = true; --this.tileBoost; return; @@ -24494,7 +24270,7 @@ namespace Terraria this.mana = 25; this.UseSound = SoundID.Item43; this.useStyle = 5; - this.damage = 44; + this.damage = 63; this.useAnimation = 30; this.useTime = 30; this.width = 40; @@ -24611,7 +24387,7 @@ namespace Terraria { this.UseSound = SoundID.Item3; this.healMana = 300; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -24688,15 +24464,15 @@ namespace Terraria case 2223: this.autoReuse = true; this.useStyle = 5; - this.useAnimation = 20; - this.useTime = 20; + this.useAnimation = 22; + this.useTime = 22; this.width = 50; this.height = 18; this.shoot = 10; this.useAmmo = AmmoID.Arrow; this.UseSound = SoundID.Item75; this.crit = 7; - this.damage = 85; + this.damage = 65; this.knockBack = 3f; this.shootSpeed = 7.75f; this.noMelee = true; @@ -24716,7 +24492,7 @@ namespace Terraria this.placeStyle = 22; this.width = 26; this.height = 26; - this.value = 160; + this.value = 3000; return; case 2225: this.useStyle = 1; @@ -24730,7 +24506,7 @@ namespace Terraria this.placeStyle = 17; this.width = 10; this.height = 24; - this.value = 120; + this.value = 500; return; case 2226: this.useStyle = 1; @@ -24744,7 +24520,6 @@ namespace Terraria this.width = 12; this.height = 28; this.placeStyle = 26; - this.value = 200; return; case 2227: this.useStyle = 1; @@ -24758,7 +24533,7 @@ namespace Terraria this.placeStyle = 17; this.width = 20; this.height = 20; - this.value = 120; + this.value = 1500; return; case 2228: this.useStyle = 1; @@ -24772,7 +24547,6 @@ namespace Terraria this.placeStyle = 27; this.width = 12; this.height = 30; - this.value = 150; return; case 2229: this.useStyle = 1; @@ -24800,7 +24574,7 @@ namespace Terraria this.placeStyle = 28; this.width = 26; this.height = 22; - this.value = 320; + this.value = 2500; return; case 2231: this.useStyle = 1; @@ -24814,7 +24588,7 @@ namespace Terraria this.placeStyle = 21; this.width = 28; this.height = 20; - this.value = 600; + this.value = 2000; return; case 2232: this.useStyle = 1; @@ -24884,7 +24658,6 @@ namespace Terraria this.createTile = 33; this.width = 8; this.height = 18; - this.value = Item.sellPrice(copper: 60); this.placeStyle = 17; return; default: @@ -25074,7 +24847,7 @@ namespace Terraria this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; - this.useTime = 7; + this.useTime = 10; this.autoReuse = true; this.maxStack = 999; this.consumable = true; @@ -25100,7 +24873,7 @@ namespace Terraria return; case 2266: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -25113,6 +24886,36 @@ namespace Terraria this.rare = 1; this.value = Item.buyPrice(silver: 5); return; + case 2267: + this.UseSound = SoundID.Item3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 10; + this.height = 10; + this.buffType = 26; + this.buffTime = 36000; + this.rare = 1; + this.value = Item.buyPrice(silver: 20); + return; + case 2268: + this.UseSound = SoundID.Item3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 10; + this.height = 10; + this.buffType = 26; + this.buffTime = 54000; + this.rare = 1; + this.value = Item.buyPrice(silver: 30); + return; case 2269: this.autoReuse = false; this.useStyle = 5; @@ -25155,7 +24958,7 @@ namespace Terraria this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; - this.useTime = 7; + this.useTime = 10; this.autoReuse = true; this.maxStack = 999; this.consumable = true; @@ -25189,7 +24992,7 @@ namespace Terraria this.scale = 1f; this.UseSound = SoundID.Item1; this.rare = 1; - this.value = Item.buyPrice(gold: 10); + this.value = Item.buyPrice(gold: 4); this.melee = true; return; case 2274: @@ -25201,7 +25004,7 @@ namespace Terraria this.useTime = 10; this.holdStyle = 1; this.autoReuse = true; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 4; this.placeStyle = 12; @@ -25300,7 +25103,6 @@ namespace Terraria this.placeStyle = 28; this.width = 12; this.height = 30; - this.value = 150; return; } if (type == 2289 || type >= 2291 && type <= 2296) @@ -25318,12 +25120,10 @@ namespace Terraria this.fishingPole = 5; this.shootSpeed = 9f; this.shoot = 360; - this.value = Item.sellPrice(copper: 60); return; case 2291: this.fishingPole = 15; this.shootSpeed = 11f; - this.value = Item.sellPrice(silver: 24); return; case 2292: this.fishingPole = 27; @@ -25335,7 +25135,6 @@ namespace Terraria this.fishingPole = 20; this.shootSpeed = 13f; this.rare = 1; - this.value = Item.sellPrice(gold: 2, silver: 40); return; case 2294: this.fishingPole = 50; @@ -25375,7 +25174,6 @@ namespace Terraria this.fishingPole = 22; this.shootSpeed = 13.5f; this.rare = 1; - this.value = Item.sellPrice(gold: 3, silver: 12); return; } this.fishingPole = 45; @@ -25522,7 +25320,7 @@ namespace Terraria { case 2322: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -25531,13 +25329,13 @@ namespace Terraria this.width = 14; this.height = 24; this.buffType = 104; - this.buffTime = 36000; + this.buffTime = 28800; this.value = 1000; this.rare = 1; return; case 2323: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -25552,7 +25350,7 @@ namespace Terraria return; case 2324: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -25561,13 +25359,13 @@ namespace Terraria this.width = 14; this.height = 24; this.buffType = 106; - this.buffTime = 28800; + this.buffTime = 18000; this.value = 1000; this.rare = 1; return; case 2325: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -25576,13 +25374,13 @@ namespace Terraria this.width = 14; this.height = 24; this.buffType = 107; - this.buffTime = 162000; + this.buffTime = 54000; this.value = 1000; this.rare = 1; return; case 2326: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -25591,13 +25389,13 @@ namespace Terraria this.width = 14; this.height = 24; this.buffType = 108; - this.buffTime = 28800; + this.buffTime = 14400; this.value = 1000; this.rare = 1; return; case 2327: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -25612,7 +25410,7 @@ namespace Terraria return; case 2328: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -25621,13 +25419,13 @@ namespace Terraria this.width = 14; this.height = 24; this.buffType = 110; - this.buffTime = 28800; + this.buffTime = 21600; this.value = 1000; this.rare = 1; return; case 2329: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -25778,7 +25576,7 @@ namespace Terraria this.width = 24; this.height = 28; this.damage = 16; - this.pick = 59; + this.pick = 100; this.scale = 1.15f; this.UseSound = SoundID.Item1; this.knockBack = 3f; @@ -25814,7 +25612,7 @@ namespace Terraria return; case 2344: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -25823,13 +25621,13 @@ namespace Terraria this.width = 14; this.height = 24; this.buffType = 112; - this.buffTime = 28800; + this.buffTime = 25200; this.value = 1000; this.rare = 1; return; case 2345: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -25838,13 +25636,13 @@ namespace Terraria this.width = 14; this.height = 24; this.buffType = 113; - this.buffTime = 28800; + this.buffTime = 18000; this.value = 1000; this.rare = 1; return; case 2346: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -25859,7 +25657,7 @@ namespace Terraria return; case 2347: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -25874,7 +25672,7 @@ namespace Terraria return; case 2348: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -25889,7 +25687,7 @@ namespace Terraria return; case 2349: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -25904,9 +25702,10 @@ namespace Terraria return; case 2350: this.UseSound = SoundID.Item6; - this.useStyle = 6; + this.useStyle = 2; this.useTurn = true; - this.useTime = this.useAnimation = 30; + this.useAnimation = 17; + this.useTime = 17; this.maxStack = 30; this.consumable = true; this.width = 14; @@ -25916,7 +25715,7 @@ namespace Terraria return; case 2351: this.UseSound = SoundID.Item6; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -25959,7 +25758,7 @@ namespace Terraria return; case 2354: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -25974,7 +25773,7 @@ namespace Terraria return; case 2355: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -25983,13 +25782,13 @@ namespace Terraria this.width = 14; this.height = 24; this.buffType = 122; - this.buffTime = 28800; + this.buffTime = 14400; this.value = 1000; this.rare = 1; return; case 2356: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -26008,7 +25807,7 @@ namespace Terraria this.useStyle = 1; this.useAnimation = 15; this.useTime = 10; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 82; this.placeStyle = 6; @@ -26017,14 +25816,14 @@ namespace Terraria this.value = 80; return; case 2358: - this.maxStack = 999; + this.maxStack = 99; this.width = 12; this.height = 14; this.value = 100; return; case 2359: this.UseSound = SoundID.Item3; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -26096,7 +25895,7 @@ namespace Terraria return; case 2365: this.mana = 10; - this.damage = 17; + this.damage = 21; this.useStyle = 1; this.shootSpeed = 10f; this.shoot = 375; @@ -26203,9 +26002,6 @@ namespace Terraria this.width = 20; this.height = 20; this.value = 300; - if (type != 2379) - return; - this.value = Item.buyPrice(gold: 10); return; } if (type >= 2386 && type <= 2396) @@ -26222,9 +26018,6 @@ namespace Terraria this.width = 20; this.height = 20; this.value = 300; - if (type != 2389) - return; - this.value = Item.buyPrice(gold: 10); return; } if (type >= 2397 && type <= 2416) @@ -26293,1509 +26086,130 @@ namespace Terraria this.useStyle = 1; this.shootSpeed = 20f; this.shoot = 383; - this.damage = 55; + this.damage = 30; this.knockBack = 5f; this.width = 34; this.height = 34; this.UseSound = SoundID.Item1; - this.useAnimation = 20; - this.useTime = 20; + this.useAnimation = 30; + this.useTime = 30; this.noUseGraphic = true; this.rare = 3; this.value = 50000; this.melee = true; return; - case 2428: - this.useStyle = 1; - this.width = 16; - this.height = 30; - this.UseSound = SoundID.Item79; - this.useAnimation = 20; - this.useTime = 20; - this.rare = 8; - this.noMelee = true; - this.mountType = 1; - this.value = Item.sellPrice(gold: 5); - return; - case 2429: - this.useStyle = 1; - this.width = 16; - this.height = 30; - this.UseSound = SoundID.Item80; - this.useAnimation = 20; - this.useTime = 20; - this.rare = 8; - this.noMelee = true; - this.mountType = 2; - this.value = Item.sellPrice(gold: 5); - return; - case 2430: - this.useStyle = 1; - this.width = 16; - this.height = 30; - this.UseSound = SoundID.Item81; - this.useAnimation = 20; - this.useTime = 20; - this.rare = 8; - this.noMelee = true; - this.mountType = 3; - this.value = Item.sellPrice(gold: 5); - return; - case 2431: - this.width = 18; - this.height = 16; - this.maxStack = 99; - this.value = 100; - return; default: - if (type >= 2432 && type <= 2434) + if (type >= 2425 && type <= 2427) { - this.useStyle = 1; + this.UseSound = SoundID.Item2; + this.useStyle = 2; this.useTurn = true; - this.useAnimation = 15; - this.useTime = 7; - this.autoReuse = true; - this.maxStack = 999; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; this.consumable = true; - this.createWall = 146 + type - 2432; - this.width = 12; - this.height = 12; - if (type != 2434) - return; - this.value = Item.buyPrice(copper: 50); - return; - } - if (type == 2435) - { - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 315; - this.width = 12; - this.height = 12; - this.value = Item.buyPrice(copper: 50); - return; - } - if (type >= 2436 && type <= 2438) - { - this.useStyle = 1; - this.autoReuse = true; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.maxStack = 999; - this.consumable = true; - this.width = 12; - this.height = 12; - this.noUseGraphic = true; - this.bait = 20; - this.value = Item.sellPrice(gold: 3, silver: 50); - return; - } - if (type >= 2439 && type <= 2441) - { - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 316 + type - 2439; - this.width = 12; - this.height = 12; - return; - } - if (type >= 2442 && type <= 2449) - { - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 240; - this.width = 30; - this.height = 30; - this.value = Item.sellPrice(silver: 50); - this.placeStyle = 46 + type - 2442; - return; - } - if (type >= 2450 && type <= 2488) - { - this.DefaultToQuestFish(); + this.width = 10; + this.height = 10; + this.buffType = 26; + this.buffTime = 72000; + this.rare = 1; + this.value = Item.sellPrice(silver: 5); return; } switch (type) { - case 2413: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 89; - this.placeStyle = 23; - this.width = 20; - this.height = 20; - this.value = 300; - return; - case 2489: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 240; - this.width = 30; - this.height = 30; - this.value = Item.sellPrice(gold: 1); - this.placeStyle = 54; - this.rare = 1; - return; - case 2490: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 319; - this.width = 12; - this.height = 12; - this.value = Item.sellPrice(gold: 3); - return; - case 2491: + case 2428: this.useStyle = 1; this.width = 16; this.height = 30; - this.UseSound = SoundID.Item25; + this.UseSound = SoundID.Item79; this.useAnimation = 20; this.useTime = 20; this.rare = 8; this.noMelee = true; - this.mountType = 4; + this.mountType = 1; this.value = Item.sellPrice(gold: 5); return; - case 2492: + case 2429: this.useStyle = 1; - this.useAnimation = 15; - this.useTime = 7; - this.useTurn = true; - this.autoReuse = true; this.width = 16; + this.height = 30; + this.UseSound = SoundID.Item80; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 8; + this.noMelee = true; + this.mountType = 2; + this.value = Item.sellPrice(gold: 5); + return; + case 2430: + this.useStyle = 1; + this.width = 16; + this.height = 30; + this.UseSound = SoundID.Item81; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 8; + this.noMelee = true; + this.mountType = 3; + this.value = Item.sellPrice(gold: 5); + return; + case 2431: + this.width = 18; this.height = 16; this.maxStack = 99; - this.createTile = 314; - this.placeStyle = 1; - this.consumable = true; - this.cartTrack = true; - this.mech = true; - this.tileBoost = 2; - this.value = Item.sellPrice(silver: 10); - return; - case 2493: - this.width = 28; - this.height = 20; - this.headSlot = 164; - this.rare = 1; - this.value = Item.sellPrice(silver: 75); - this.vanity = true; - return; - case 2494: - this.width = 22; - this.height = 20; - this.accessory = true; - this.value = Item.buyPrice(gold: 40); - this.rare = 4; - this.wingSlot = (sbyte) 25; - return; - case 2495: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 242; - this.width = 30; - this.height = 30; - this.value = Item.sellPrice(gold: 1); - this.placeStyle = 25; - return; - case 2496: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 320; - this.placeStyle = 0; - this.width = 22; - this.height = 30; - this.value = Item.sellPrice(gold: 1); - return; - case 2497: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 242; - this.width = 30; - this.height = 30; - this.value = Item.sellPrice(silver: 50); - this.placeStyle = 26; - return; - case 2498: - this.width = 18; - this.height = 18; - this.headSlot = 165; - this.vanity = true; - this.value = Item.sellPrice(gold: 1); - return; - case 2499: - this.width = 18; - this.height = 18; - this.bodySlot = 172; - this.vanity = true; - this.value = Item.sellPrice(gold: 1); - return; - case 2500: - this.width = 18; - this.height = 18; - this.legSlot = 107; - this.vanity = true; - this.value = Item.sellPrice(gold: 1); - return; - case 2501: - this.width = 18; - this.height = 12; - this.maxStack = 1; - this.value = Item.sellPrice(gold: 1); - this.rare = 5; - this.accessory = true; - this.faceSlot = (sbyte) 8; - this.vanity = true; - return; - case 2502: - this.useStyle = 1; - this.width = 16; - this.height = 30; - this.UseSound = SoundID.Item25; - this.useAnimation = 20; - this.useTime = 20; - this.rare = 8; - this.noMelee = true; - this.mountType = 5; - this.value = Item.sellPrice(gold: 5); - return; - case 2503: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 321; - this.width = 8; - this.height = 10; - return; - case 2504: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 322; - this.width = 8; - this.height = 10; - return; - case 2505: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 7; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createWall = 149; - this.width = 12; - this.height = 12; - return; - case 2506: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 7; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createWall = 151; - this.width = 12; - this.height = 12; - return; - case 2507: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 7; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createWall = 150; - this.width = 12; - this.height = 12; - return; - case 2508: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 7; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createWall = 152; - this.width = 12; - this.height = 12; - return; - case 2509: - this.width = 18; - this.height = 18; - this.defense = 1; - this.headSlot = 166; - return; - case 2510: - this.width = 18; - this.height = 18; - this.defense = 1; - this.bodySlot = 173; - return; - case 2511: - this.width = 18; - this.height = 18; - this.defense = 1; - this.legSlot = 108; - return; - case 2512: - this.width = 18; - this.height = 18; - this.defense = 1; - this.headSlot = 167; - return; - case 2513: - this.width = 18; - this.height = 18; - this.defense = 1; - this.bodySlot = 174; - return; - case 2514: - this.width = 18; - this.height = 18; - this.defense = 1; - this.legSlot = 109; - return; - case 2515: - this.useStyle = 5; - this.useAnimation = 29; - this.useTime = 29; - this.width = 12; - this.height = 28; - this.shoot = 1; - this.useAmmo = AmmoID.Arrow; - this.UseSound = SoundID.Item5; - this.damage = 6; - this.shootSpeed = 6.6f; - this.noMelee = true; this.value = 100; - this.ranged = true; - return; - case 2516: - this.autoReuse = true; - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 33; - this.useTime = 23; - this.hammer = 35; - this.width = 24; - this.height = 28; - this.damage = 4; - this.knockBack = 5.5f; - this.scale = 1.1f; - this.UseSound = SoundID.Item1; - this.value = 50; - this.melee = true; - return; - case 2517: - this.useStyle = 1; - this.useTurn = false; - this.useAnimation = 23; - this.useTime = 23; - this.width = 24; - this.height = 28; - this.damage = 8; - this.knockBack = 5f; - this.UseSound = SoundID.Item1; - this.scale = 1f; - this.value = 100; - this.melee = true; - return; - case 2518: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 19; - this.placeStyle = 17; - this.width = 8; - this.height = 10; - return; - case 2519: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 90; - this.placeStyle = 17; - this.width = 20; - this.height = 20; - this.value = 300; - return; - case 2520: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.maxStack = 99; - this.consumable = true; - this.autoReuse = true; - this.createTile = 79; - this.placeStyle = 22; - this.width = 28; - this.height = 20; - this.value = 2000; - return; - case 2521: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 89; - this.placeStyle = 21; - this.width = 20; - this.height = 20; - this.value = 300; - return; - case 2522: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 100; - this.placeStyle = 18; - this.width = 20; - this.height = 20; - this.value = 1500; - return; - case 2523: - this.noWet = true; - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 33; - this.placeStyle = 18; - this.width = 8; - this.value = Item.sellPrice(copper: 60); - this.height = 18; - return; - case 2524: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 15; - this.placeStyle = 29; - this.width = 12; - this.height = 30; - this.value = 150; - return; - case 2525: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 34; - this.placeStyle = 23; - this.width = 26; - this.height = 26; - this.value = 3000; - return; - case 2526: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 21; - this.placeStyle = 31; - this.width = 26; - this.height = 22; - this.value = 500; - return; - case 2527: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 89; - this.placeStyle = 22; - this.width = 20; - this.height = 20; - this.value = 300; - return; - case 2528: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.maxStack = 99; - this.consumable = true; - this.createTile = 10; - this.placeStyle = 29; - this.width = 14; - this.height = 28; - this.value = 200; - return; - case 2529: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 88; - this.placeStyle = 16; - this.width = 20; - this.height = 20; - this.value = 300; - return; - case 2530: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 42; - this.width = 12; - this.height = 28; - this.placeStyle = 27; - this.value = 150; - return; - case 2531: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 87; - this.placeStyle = 21; - this.width = 20; - this.height = 20; - this.value = 300; - return; - case 2532: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 14; - this.placeStyle = 26; - this.width = 26; - this.height = 20; - this.value = 300; - return; - case 2533: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 93; - this.placeStyle = 18; - this.width = 10; - this.height = 24; - this.value = 500; - return; - case 2534: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 18; - this.placeStyle = 22; - this.width = 28; - this.height = 14; - this.value = 150; - return; - case 2535: - this.mana = 10; - this.damage = 30; - this.useStyle = 1; - this.shootSpeed = 10f; - this.shoot = 387; - this.width = 26; - this.height = 28; - this.UseSound = SoundID.Item82; - this.useAnimation = 36; - this.useTime = 36; - this.rare = 5; - this.noMelee = true; - this.knockBack = 2f; - this.buffType = 134; - this.value = Item.buyPrice(gold: 10); - this.summon = true; - return; - case 2536: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 101; - this.width = 20; - this.height = 20; - this.value = 300; - this.placeStyle = 23; - return; - case 2537: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 90; - this.placeStyle = 18; - this.width = 20; - this.height = 20; - this.value = 300; - return; - case 2538: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.maxStack = 99; - this.consumable = true; - this.autoReuse = true; - this.createTile = 79; - this.placeStyle = 23; - this.width = 28; - this.height = 20; - this.value = 2000; - return; - case 2539: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 89; - this.placeStyle = 23; - this.width = 20; - this.height = 20; - this.value = 300; - return; - case 2540: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 101; - this.width = 20; - this.height = 20; - this.value = 300; - this.placeStyle = 24; - return; - case 2541: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 100; - this.placeStyle = 19; - this.width = 20; - this.height = 20; - this.value = 1500; - return; - case 2542: - this.noWet = true; - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 33; - this.placeStyle = 19; - this.width = 8; - this.value = Item.sellPrice(copper: 60); - this.height = 18; - return; - case 2543: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 34; - this.placeStyle = 24; - this.width = 26; - this.height = 26; - this.value = 3000; - return; - case 2544: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 21; - this.placeStyle = 32; - this.width = 26; - this.height = 22; - this.value = 500; - return; - case 2545: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 88; - this.placeStyle = 17; - this.width = 20; - this.height = 20; - this.value = 300; - return; - case 2546: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 42; - this.width = 12; - this.height = 28; - this.placeStyle = 28; - this.value = 150; - return; - case 2547: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 93; - this.placeStyle = 19; - this.width = 10; - this.height = 24; - this.value = 500; - return; - case 2548: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 87; - this.placeStyle = 22; - this.width = 20; - this.height = 20; - this.value = 300; - return; - case 2549: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 19; - this.placeStyle = 18; - this.width = 8; - this.height = 10; - return; - case 2550: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 14; - this.placeStyle = 27; - this.width = 26; - this.height = 20; - this.value = 300; - return; - case 2551: - this.mana = 10; - this.damage = 26; - this.useStyle = 1; - this.shootSpeed = 10f; - this.shoot = 390; - this.width = 26; - this.height = 28; - this.UseSound = SoundID.Item83; - this.useAnimation = 36; - this.useTime = 36; - this.rare = 4; - this.noMelee = true; - this.knockBack = 3f; - this.buffType = 133; - this.value = Item.buyPrice(gold: 5); - this.summon = true; - return; - case 2552: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 90; - this.placeStyle = 19; - this.width = 20; - this.height = 20; - this.value = 300; - return; - case 2553: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.maxStack = 99; - this.consumable = true; - this.autoReuse = true; - this.createTile = 79; - this.placeStyle = 24; - this.width = 28; - this.height = 20; - this.value = 2000; - return; - case 2554: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 101; - this.width = 20; - this.height = 20; - this.value = 300; - this.placeStyle = 25; - return; - case 2555: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 100; - this.placeStyle = 20; - this.width = 20; - this.height = 20; - this.value = 1500; - return; - case 2556: - this.noWet = true; - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 33; - this.placeStyle = 20; - this.width = 8; - this.value = Item.sellPrice(copper: 60); - this.height = 18; - return; - case 2557: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 15; - this.placeStyle = 30; - this.width = 12; - this.height = 30; - this.value = 150; - return; - case 2558: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 34; - this.placeStyle = 25; - this.width = 26; - this.height = 26; - this.value = 3000; - return; - case 2559: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 21; - this.placeStyle = 33; - this.width = 26; - this.height = 22; - this.value = 500; - return; - case 2560: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 104; - this.placeStyle = 6; - this.width = 20; - this.height = 20; - this.value = 300; - return; - case 2561: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.maxStack = 99; - this.consumable = true; - this.createTile = 10; - this.placeStyle = 30; - this.width = 14; - this.height = 28; - this.value = 200; - return; - case 2562: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 88; - this.placeStyle = 18; - this.width = 20; - this.height = 20; - this.value = 300; - return; - case 2563: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 93; - this.placeStyle = 20; - this.width = 10; - this.height = 24; - this.value = 500; - return; - case 2564: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 42; - this.placeStyle = 29; - this.width = 12; - this.height = 28; - this.value = 150; - return; - case 2565: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 87; - this.placeStyle = 23; - this.width = 20; - this.height = 20; - this.value = 300; - return; - case 2566: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 19; - this.placeStyle = 19; - this.width = 8; - this.height = 10; - return; - case 2567: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 90; - this.placeStyle = 20; - this.width = 20; - this.height = 20; - this.value = 300; - return; - case 2568: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.maxStack = 99; - this.consumable = true; - this.autoReuse = true; - this.createTile = 79; - this.placeStyle = 25; - this.width = 28; - this.height = 20; - this.value = 2000; - return; - case 2569: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 101; - this.placeStyle = 26; - this.width = 20; - this.height = 20; - this.value = 300; - return; - case 2570: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 100; - this.placeStyle = 21; - this.width = 20; - this.height = 20; - this.value = 1500; - return; - case 2571: - this.noWet = true; - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 33; - this.placeStyle = 21; - this.width = 8; - this.value = Item.sellPrice(copper: 60); - this.height = 18; - return; - case 2572: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 15; - this.placeStyle = 31; - this.width = 12; - this.height = 30; - this.value = 150; - return; - case 2573: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 34; - this.placeStyle = 26; - this.width = 26; - this.height = 26; - this.value = 3000; - return; - case 2574: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 21; - this.placeStyle = 34; - this.width = 26; - this.height = 22; - this.value = 500; - return; - case 2575: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 104; - this.placeStyle = 7; - this.width = 20; - this.height = 20; - this.value = 300; - return; - case 2576: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.maxStack = 99; - this.consumable = true; - this.createTile = 10; - this.placeStyle = 31; - this.width = 14; - this.height = 28; - this.value = 200; - return; - case 2577: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 88; - this.placeStyle = 19; - this.width = 20; - this.height = 20; - this.value = 300; - return; - case 2578: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 93; - this.placeStyle = 21; - this.width = 10; - this.height = 24; - this.value = 500; - return; - case 2579: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 42; - this.placeStyle = 30; - this.width = 12; - this.height = 28; - this.value = 150; - return; - case 2580: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 87; - this.placeStyle = 24; - this.width = 20; - this.height = 20; - this.value = 300; - return; - case 2581: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 19; - this.placeStyle = 20; - this.width = 8; - this.height = 10; - return; - case 2582: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 89; - this.placeStyle = 25; - this.width = 20; - this.height = 20; - this.value = 300; - return; - case 2583: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 14; - this.placeStyle = 29; - this.width = 26; - this.height = 20; - this.value = 300; - return; - case 2584: - this.mana = 10; - this.damage = 40; - this.useStyle = 1; - this.shootSpeed = 10f; - this.shoot = 393; - this.width = 26; - this.height = 28; - this.UseSound = SoundID.Item44; - this.useAnimation = 36; - this.useTime = 36; - this.rare = 5; - this.noMelee = true; - this.knockBack = 6f; - this.buffType = 135; - this.value = Item.buyPrice(gold: 5); - this.summon = true; - return; - case 2585: - this.noUseGraphic = true; - this.damage = 0; - this.useStyle = 5; - this.shootSpeed = 13f; - this.shoot = 396; - this.width = 18; - this.height = 28; - this.UseSound = SoundID.Item1; - this.useAnimation = 20; - this.useTime = 20; - this.rare = 3; - this.noMelee = true; - this.value = 20000; - return; - case 2586: - this.useStyle = 5; - this.shootSpeed = 5.5f; - this.shoot = 397; - this.width = 20; - this.height = 20; - this.maxStack = 99; - this.consumable = true; - this.UseSound = SoundID.Item1; - this.useAnimation = 45; - this.useTime = 45; - this.noUseGraphic = true; - this.noMelee = true; - this.value = 75; - this.damage = 60; - this.knockBack = 8f; - this.ranged = true; - return; - case 2587: - this.damage = 0; - this.useStyle = 1; - this.shoot = 398; - this.width = 16; - this.height = 30; - this.UseSound = SoundID.Item2; - this.useAnimation = 20; - this.useTime = 20; - this.rare = 3; - this.noMelee = true; - this.buffType = 136; - this.value = Item.sellPrice(gold: 2); - return; - case 2588: - this.width = 28; - this.height = 20; - this.headSlot = 168; - this.rare = 1; - this.value = Item.sellPrice(silver: 75); - this.vanity = true; - return; - case 2589: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 240; - this.width = 30; - this.height = 30; - this.value = Item.sellPrice(gold: 1); - this.placeStyle = 55; - this.rare = 1; - return; - case 2590: - this.useStyle = 5; - this.shootSpeed = 6.5f; - this.shoot = 399; - this.width = 20; - this.height = 20; - this.maxStack = 99; - this.consumable = true; - this.UseSound = SoundID.Item1; - this.useAnimation = 40; - this.useTime = 40; - this.noUseGraphic = true; - this.noMelee = true; - this.value = Item.sellPrice(silver: 1); - this.damage = 23; - this.knockBack = 7f; - this.ranged = true; - this.rare = 1; return; default: - if (type >= 2591 && type <= 2606) + if (type >= 2432 && type <= 2434) + { + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 146 + type - 2432; + this.width = 12; + this.height = 12; + if (type != 2434) + return; + this.value = Item.buyPrice(copper: 50); + return; + } + if (type == 2435) + { + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 315; + this.width = 12; + this.height = 12; + this.value = Item.buyPrice(copper: 50); + return; + } + if (type >= 2436 && type <= 2438) + { + this.useStyle = 1; + this.autoReuse = true; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 999; + this.consumable = true; + this.width = 12; + this.height = 12; + this.noUseGraphic = true; + this.bait = 20; + this.value = Item.sellPrice(gold: 3, silver: 50); + return; + } + if (type >= 2439 && type <= 2441) { this.useStyle = 1; this.useTurn = true; @@ -27804,78 +26218,1389 @@ namespace Terraria this.autoReuse = true; this.maxStack = 99; this.consumable = true; - this.createTile = 104; - this.placeStyle = 8 + type - 2591; - this.width = 20; - this.height = 20; - this.value = 300; + this.createTile = 316 + type - 2439; + this.width = 12; + this.height = 12; + return; + } + if (type >= 2442 && type <= 2449) + { + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(silver: 50); + this.placeStyle = 46 + type - 2442; + return; + } + if (type >= 2450 && type <= 2488) + { + this.questItem = true; + this.maxStack = 1; + this.width = 26; + this.height = 26; + this.uniqueStack = true; + this.rare = -11; return; } switch (type) { - case 2607: + case 2413: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; this.maxStack = 99; + this.consumable = true; + this.createTile = 89; + this.placeStyle = 23; + this.width = 20; + this.height = 20; + this.value = 300; + return; + case 2489: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(gold: 1); + this.placeStyle = 54; + this.rare = 1; + return; + case 2490: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 319; this.width = 12; this.height = 12; - this.rare = 4; - this.value = Item.sellPrice(silver: 5); + this.value = Item.sellPrice(gold: 3); return; - case 2608: - this.autoReuse = true; - this.scale = 1.05f; + case 2491: this.useStyle = 1; + this.width = 16; + this.height = 30; + this.UseSound = SoundID.Item25; this.useAnimation = 20; - this.knockBack = 6f; - this.width = 24; - this.height = 28; - this.damage = 25; - this.scale = 1.05f; - this.UseSound = SoundID.Item1; - this.rare = 4; - this.value = 10000; - this.melee = true; + this.useTime = 20; + this.rare = 8; + this.noMelee = true; + this.mountType = 4; + this.value = Item.sellPrice(gold: 5); return; - case 2609: + case 2492: + this.useStyle = 1; + this.useAnimation = 15; + this.useTime = 7; + this.useTurn = true; + this.autoReuse = true; + this.width = 16; + this.height = 16; + this.maxStack = 99; + this.createTile = 314; + this.placeStyle = 1; + this.consumable = true; + this.cartTrack = true; + this.mech = true; + this.tileBoost = 2; + this.value = Item.sellPrice(silver: 10); + return; + case 2493: + this.width = 28; + this.height = 20; + this.headSlot = 164; + this.rare = 1; + this.vanity = true; + return; + case 2494: this.width = 22; this.height = 20; this.accessory = true; - this.value = Item.buyPrice(gold: 40); - this.rare = 8; - this.wingSlot = (sbyte) 26; + this.value = Item.sellPrice(gold: 10); + this.rare = 4; + this.wingSlot = (sbyte) 25; return; - case 2610: - this.useStyle = 5; - this.useAnimation = 12; - this.useTime = 12; - this.width = 38; - this.height = 10; - this.damage = 0; - this.scale = 0.9f; - this.shoot = 406; - this.shootSpeed = 8f; + case 2495: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; this.autoReuse = true; - this.value = Item.buyPrice(gold: 1, silver: 50); + this.maxStack = 99; + this.consumable = true; + this.createTile = 242; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(gold: 1); + this.placeStyle = 25; return; - case 2611: - this.autoReuse = false; - this.useStyle = 5; + case 2496: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 320; + this.placeStyle = 0; + this.width = 22; + this.height = 30; + this.value = Item.sellPrice(gold: 1); + return; + case 2497: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 242; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(silver: 50); + this.placeStyle = 26; + return; + case 2498: + this.width = 18; + this.height = 18; + this.headSlot = 165; + this.vanity = true; + this.value = Item.sellPrice(gold: 1); + return; + case 2499: + this.width = 18; + this.height = 18; + this.bodySlot = 172; + this.vanity = true; + this.value = Item.sellPrice(gold: 1); + return; + case 2500: + this.width = 18; + this.height = 18; + this.legSlot = 107; + this.vanity = true; + this.value = Item.sellPrice(gold: 1); + return; + case 2501: + this.width = 18; + this.height = 12; + this.maxStack = 1; + this.value = Item.buyPrice(gold: 40); + this.rare = 5; + this.accessory = true; + this.faceSlot = (sbyte) 8; + this.vanity = true; + return; + case 2502: + this.useStyle = 1; + this.width = 16; + this.height = 30; + this.UseSound = SoundID.Item25; this.useAnimation = 20; this.useTime = 20; - this.autoReuse = true; - this.knockBack = 4.5f; - this.width = 30; - this.height = 10; - this.damage = 66; - this.shoot = 404; - this.shootSpeed = 14f; - this.UseSound = SoundID.Item1; this.rare = 8; + this.noMelee = true; + this.mountType = 5; this.value = Item.sellPrice(gold: 5); + return; + case 2503: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 321; + this.width = 8; + this.height = 10; + return; + case 2504: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 322; + this.width = 8; + this.height = 10; + return; + case 2505: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 149; + this.width = 12; + this.height = 12; + return; + case 2506: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 151; + this.width = 12; + this.height = 12; + return; + case 2507: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 150; + this.width = 12; + this.height = 12; + return; + case 2508: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 152; + this.width = 12; + this.height = 12; + return; + case 2509: + this.width = 18; + this.height = 18; + this.defense = 1; + this.headSlot = 166; + return; + case 2510: + this.width = 18; + this.height = 18; + this.defense = 1; + this.bodySlot = 173; + return; + case 2511: + this.width = 18; + this.height = 18; + this.defense = 1; + this.legSlot = 108; + return; + case 2512: + this.width = 18; + this.height = 18; + this.defense = 1; + this.headSlot = 167; + return; + case 2513: + this.width = 18; + this.height = 18; + this.defense = 1; + this.bodySlot = 174; + return; + case 2514: + this.width = 18; + this.height = 18; + this.defense = 1; + this.legSlot = 109; + return; + case 2515: + this.useStyle = 5; + this.useAnimation = 29; + this.useTime = 29; + this.width = 12; + this.height = 28; + this.shoot = 1; + this.useAmmo = AmmoID.Arrow; + this.UseSound = SoundID.Item5; + this.damage = 6; + this.shootSpeed = 6.6f; + this.noMelee = true; + this.value = 100; + this.ranged = true; + return; + case 2516: + this.autoReuse = true; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 33; + this.useTime = 23; + this.hammer = 35; + this.width = 24; + this.height = 28; + this.damage = 4; + this.knockBack = 5.5f; + this.scale = 1.1f; + this.UseSound = SoundID.Item1; + this.value = 50; this.melee = true; + return; + case 2517: + this.useStyle = 1; + this.useTurn = false; + this.useAnimation = 23; + this.useTime = 23; + this.width = 24; + this.height = 28; + this.damage = 8; + this.knockBack = 5f; + this.UseSound = SoundID.Item1; + this.scale = 1f; + this.value = 100; + this.melee = true; + return; + case 2518: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 19; + this.placeStyle = 17; + this.width = 8; + this.height = 10; + return; + case 2519: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 90; + this.placeStyle = 17; + this.width = 20; + this.height = 20; + this.value = 300; + return; + case 2520: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.autoReuse = true; + this.createTile = 79; + this.placeStyle = 22; + this.width = 28; + this.height = 20; + this.value = 2000; + return; + case 2521: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 89; + this.placeStyle = 21; + this.width = 20; + this.height = 20; + this.value = 300; + return; + case 2522: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 100; + this.placeStyle = 18; + this.width = 20; + this.height = 20; + this.value = 1500; + return; + case 2523: + this.noWet = true; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 33; + this.placeStyle = 18; + this.width = 8; + this.height = 18; + return; + case 2524: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 15; + this.placeStyle = 29; + this.width = 12; + this.height = 30; + return; + case 2525: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 34; + this.placeStyle = 23; + this.width = 26; + this.height = 26; + this.value = 3000; + return; + case 2526: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 21; + this.placeStyle = 31; + this.width = 26; + this.height = 22; + this.value = 500; + return; + case 2527: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 89; + this.placeStyle = 22; + this.width = 20; + this.height = 20; + this.value = 300; + return; + case 2528: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 10; + this.placeStyle = 29; + this.width = 14; + this.height = 28; + this.value = 200; + return; + case 2529: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 88; + this.placeStyle = 16; + this.width = 20; + this.height = 20; + this.value = 300; + return; + case 2530: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 42; + this.width = 12; + this.height = 28; + this.placeStyle = 27; + return; + case 2531: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 87; + this.placeStyle = 21; + this.width = 20; + this.height = 20; + this.value = 300; + return; + case 2532: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 14; + this.placeStyle = 26; + this.width = 26; + this.height = 20; + this.value = 300; + return; + case 2533: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 93; + this.placeStyle = 18; + this.width = 10; + this.height = 24; + this.value = 500; + return; + case 2534: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 18; + this.placeStyle = 22; + this.width = 28; + this.height = 14; + this.value = 150; + return; + case 2535: + this.mana = 10; + this.damage = 30; + this.useStyle = 1; + this.shootSpeed = 10f; + this.shoot = 387; + this.width = 26; + this.height = 28; + this.UseSound = SoundID.Item82; + this.useAnimation = 36; + this.useTime = 36; + this.rare = 5; + this.noMelee = true; + this.knockBack = 2f; + this.buffType = 134; + this.value = Item.buyPrice(gold: 10); + this.summon = true; + return; + case 2536: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 101; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 23; + return; + case 2537: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 90; + this.placeStyle = 18; + this.width = 20; + this.height = 20; + this.value = 300; + return; + case 2538: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.autoReuse = true; + this.createTile = 79; + this.placeStyle = 23; + this.width = 28; + this.height = 20; + this.value = 2000; + return; + case 2539: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 89; + this.placeStyle = 23; + this.width = 20; + this.height = 20; + this.value = 300; + return; + case 2540: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 101; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 24; + return; + case 2541: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 100; + this.placeStyle = 19; + this.width = 20; + this.height = 20; + this.value = 1500; + return; + case 2542: + this.noWet = true; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 33; + this.placeStyle = 19; + this.width = 8; + this.height = 18; + return; + case 2543: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 34; + this.placeStyle = 24; + this.width = 26; + this.height = 26; + this.value = 3000; + return; + case 2544: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 21; + this.placeStyle = 32; + this.width = 26; + this.height = 22; + this.value = 500; + return; + case 2545: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 88; + this.placeStyle = 17; + this.width = 20; + this.height = 20; + this.value = 300; + return; + case 2546: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 42; + this.width = 12; + this.height = 28; + this.placeStyle = 28; + return; + case 2547: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 93; + this.placeStyle = 19; + this.width = 10; + this.height = 24; + this.value = 500; + return; + case 2548: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 87; + this.placeStyle = 22; + this.width = 20; + this.height = 20; + this.value = 300; + return; + case 2549: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 19; + this.placeStyle = 18; + this.width = 8; + this.height = 10; + return; + case 2550: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 14; + this.placeStyle = 27; + this.width = 26; + this.height = 20; + this.value = 300; + return; + case 2551: + this.mana = 10; + this.damage = 26; + this.useStyle = 1; + this.shootSpeed = 10f; + this.shoot = 390; + this.width = 26; + this.height = 28; + this.UseSound = SoundID.Item83; + this.useAnimation = 36; + this.useTime = 36; + this.rare = 4; + this.noMelee = true; + this.knockBack = 3f; + this.buffType = 133; + this.value = Item.buyPrice(gold: 5); + this.summon = true; + return; + case 2552: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 90; + this.placeStyle = 19; + this.width = 20; + this.height = 20; + this.value = 300; + return; + case 2553: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.autoReuse = true; + this.createTile = 79; + this.placeStyle = 24; + this.width = 28; + this.height = 20; + this.value = 2000; + return; + case 2554: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 101; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 25; + return; + case 2555: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 100; + this.placeStyle = 20; + this.width = 20; + this.height = 20; + this.value = 1500; + return; + case 2556: + this.noWet = true; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 33; + this.placeStyle = 20; + this.width = 8; + this.height = 18; + return; + case 2557: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 15; + this.placeStyle = 30; + this.width = 12; + this.height = 30; + return; + case 2558: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 34; + this.placeStyle = 25; + this.width = 26; + this.height = 26; + this.value = 3000; + return; + case 2559: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 21; + this.placeStyle = 33; + this.width = 26; + this.height = 22; + this.value = 500; + return; + case 2560: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 104; + this.placeStyle = 6; + this.width = 20; + this.height = 20; + this.value = 300; + return; + case 2561: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 10; + this.placeStyle = 30; + this.width = 14; + this.height = 28; + this.value = 200; + return; + case 2562: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 88; + this.placeStyle = 18; + this.width = 20; + this.height = 20; + this.value = 300; + return; + case 2563: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 93; + this.placeStyle = 20; + this.width = 10; + this.height = 24; + this.value = 500; + return; + case 2564: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 42; + this.placeStyle = 29; + this.width = 12; + this.height = 28; + return; + case 2565: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 87; + this.placeStyle = 23; + this.width = 20; + this.height = 20; + this.value = 300; + return; + case 2566: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 19; + this.placeStyle = 19; + this.width = 8; + this.height = 10; + return; + case 2567: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 90; + this.placeStyle = 20; + this.width = 20; + this.height = 20; + this.value = 300; + return; + case 2568: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.autoReuse = true; + this.createTile = 79; + this.placeStyle = 25; + this.width = 28; + this.height = 20; + this.value = 2000; + return; + case 2569: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 101; + this.placeStyle = 26; + this.width = 20; + this.height = 20; + this.value = 300; + return; + case 2570: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 100; + this.placeStyle = 21; + this.width = 20; + this.height = 20; + this.value = 1500; + return; + case 2571: + this.noWet = true; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 33; + this.placeStyle = 21; + this.width = 8; + this.height = 18; + return; + case 2572: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 15; + this.placeStyle = 31; + this.width = 12; + this.height = 30; + return; + case 2573: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 34; + this.placeStyle = 26; + this.width = 26; + this.height = 26; + this.value = 3000; + return; + case 2574: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 21; + this.placeStyle = 34; + this.width = 26; + this.height = 22; + this.value = 500; + return; + case 2575: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 104; + this.placeStyle = 7; + this.width = 20; + this.height = 20; + this.value = 300; + return; + case 2576: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 10; + this.placeStyle = 31; + this.width = 14; + this.height = 28; + this.value = 200; + return; + case 2577: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 88; + this.placeStyle = 19; + this.width = 20; + this.height = 20; + this.value = 300; + return; + case 2578: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 93; + this.placeStyle = 21; + this.width = 10; + this.height = 24; + this.value = 500; + return; + case 2579: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 42; + this.placeStyle = 30; + this.width = 12; + this.height = 28; + return; + case 2580: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 87; + this.placeStyle = 24; + this.width = 20; + this.height = 20; + this.value = 300; + return; + case 2581: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 19; + this.placeStyle = 20; + this.width = 8; + this.height = 10; + return; + case 2582: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 89; + this.placeStyle = 25; + this.width = 20; + this.height = 20; + this.value = 300; + return; + case 2583: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 14; + this.placeStyle = 29; + this.width = 26; + this.height = 20; + this.value = 300; + return; + case 2584: + this.mana = 10; + this.damage = 40; + this.useStyle = 1; + this.shootSpeed = 10f; + this.shoot = 393; + this.width = 26; + this.height = 28; + this.UseSound = SoundID.Item44; + this.useAnimation = 36; + this.useTime = 36; + this.rare = 5; + this.noMelee = true; + this.knockBack = 6f; + this.buffType = 135; + this.value = Item.buyPrice(gold: 5); + this.summon = true; + return; + case 2585: this.noUseGraphic = true; + this.damage = 0; + this.useStyle = 5; + this.shootSpeed = 13f; + this.shoot = 396; + this.width = 18; + this.height = 28; + this.UseSound = SoundID.Item1; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 3; + this.noMelee = true; + this.value = 20000; + return; + case 2586: + this.useStyle = 5; + this.shootSpeed = 5.5f; + this.shoot = 397; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.consumable = true; + this.UseSound = SoundID.Item1; + this.useAnimation = 45; + this.useTime = 45; + this.noUseGraphic = true; + this.noMelee = true; + this.value = 75; + this.damage = 60; + this.knockBack = 8f; + this.thrown = true; + return; + case 2587: + this.damage = 0; + this.useStyle = 1; + this.shoot = 398; + this.width = 16; + this.height = 30; + this.UseSound = SoundID.Item2; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 3; + this.noMelee = true; + this.buffType = 136; + this.value = Item.sellPrice(gold: 2); + return; + case 2588: + this.width = 28; + this.height = 20; + this.headSlot = 168; + this.rare = 1; + this.vanity = true; + return; + case 2589: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 240; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(gold: 1); + this.placeStyle = 55; + this.rare = 1; + return; + case 2590: + this.useStyle = 5; + this.shootSpeed = 6.5f; + this.shoot = 399; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.consumable = true; + this.UseSound = SoundID.Item1; + this.useAnimation = 40; + this.useTime = 40; + this.noUseGraphic = true; + this.noMelee = true; + this.value = Item.sellPrice(silver: 1); + this.damage = 23; + this.knockBack = 7f; + this.thrown = true; + this.rare = 1; return; default: - if (type >= 2612 && type <= 2620) + if (type >= 2591 && type <= 2606) { this.useStyle = 1; this.useTurn = true; @@ -27884,92 +27609,78 @@ namespace Terraria this.autoReuse = true; this.maxStack = 99; this.consumable = true; - this.createTile = 21; - this.placeStyle = type > 2614 ? 41 + type - 2615 : 35 + (type - 2612) * 2; - this.width = 26; - this.height = 22; - this.value = 500; + this.createTile = 104; + this.placeStyle = 8 + type - 2591; + this.width = 20; + this.height = 20; + this.value = 300; return; } switch (type) { - case 2621: - this.mana = 10; - this.damage = 50; - this.useStyle = 1; - this.shootSpeed = 10f; - this.shoot = 407; - this.width = 26; - this.height = 28; - this.UseSound = SoundID.Item44; - this.useAnimation = 36; - this.useTime = 36; - this.rare = 8; - this.noMelee = true; - this.knockBack = 2f; - this.buffType = 139; - this.value = Item.sellPrice(gold: 5); - this.summon = true; + case 2607: + this.maxStack = 99; + this.width = 12; + this.height = 12; + this.rare = 4; + this.value = Item.sellPrice(silver: 5); return; - case 2622: - this.mana = 16; - this.damage = 60; - this.useStyle = 5; - this.shootSpeed = 6f; - this.shoot = 409; - this.width = 26; + case 2608: + this.autoReuse = true; + this.scale = 1.05f; + this.useStyle = 1; + this.useAnimation = 15; + this.knockBack = 6f; + this.width = 24; this.height = 28; - this.UseSound = SoundID.Item84; - this.useAnimation = 40; + this.damage = 30; + this.scale = 1.05f; + this.UseSound = SoundID.Item1; + this.rare = 4; + this.value = 10000; + this.melee = true; + return; + case 2609: + this.width = 22; + this.height = 20; + this.accessory = true; + this.value = Item.buyPrice(gold: 10); + this.rare = 8; + this.wingSlot = (sbyte) 26; + return; + case 2610: + this.useStyle = 5; + this.useAnimation = 12; + this.useTime = 12; + this.width = 38; + this.height = 10; + this.damage = 0; + this.scale = 0.9f; + this.shoot = 406; + this.shootSpeed = 8f; + this.autoReuse = true; + this.value = Item.buyPrice(gold: 1, silver: 50); + return; + case 2611: + this.autoReuse = false; + this.useStyle = 5; + this.useAnimation = 20; this.useTime = 20; this.autoReuse = true; + this.knockBack = 4.5f; + this.width = 30; + this.height = 10; + this.damage = 66; + this.shoot = 404; + this.shootSpeed = 14f; + this.UseSound = SoundID.Item1; this.rare = 8; - this.noMelee = true; - this.knockBack = 5f; - this.scale = 0.9f; this.value = Item.sellPrice(gold: 5); - this.magic = true; - return; - case 2624: - this.useStyle = 5; - this.autoReuse = true; - this.useAnimation = 24; - this.useTime = 24; - this.width = 50; - this.height = 18; - this.shoot = 1; - this.useAmmo = AmmoID.Arrow; - this.UseSound = SoundID.Item5; - this.damage = 60; - this.shootSpeed = 10f; - this.noMelee = true; - this.value = Item.sellPrice(gold: 5); - this.ranged = true; - this.rare = 8; - this.knockBack = 2f; + this.melee = true; + this.noUseGraphic = true; return; default: - if (type == 2625 || type == 2626) - { - this.DefaultToSeaShelll(); - return; - } - if (type >= 2627 && type <= 2630) - { - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 19; - this.placeStyle = 21 + type - 2627; - this.width = 8; - this.height = 10; - return; - } - if (type >= 2631 && type <= 2633) + if (type >= 2612 && type <= 2620) { this.useStyle = 1; this.useTurn = true; @@ -27978,414 +27689,286 @@ namespace Terraria this.autoReuse = true; this.maxStack = 99; this.consumable = true; - this.createTile = 18; - this.placeStyle = 24 + type - 2631; - this.width = 28; - this.height = 14; - this.value = 150; - return; - } - if (type >= 2634 && type <= 2636) - { - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 89; - this.placeStyle = 26 + type - 2634; - this.width = 20; - this.height = 20; - this.value = 300; - return; - } - if (type == 2623) - { - this.autoReuse = true; - this.mana = 4; - this.UseSound = SoundID.Item85; - this.useStyle = 5; - this.damage = 70; - this.useAnimation = 9; - this.useTime = 9; - this.width = 40; - this.height = 40; - this.shoot = 410; - this.shootSpeed = 11f; - this.knockBack = 3f; - this.value = Item.sellPrice(gold: 5); - this.magic = true; - this.rare = 8; - this.noMelee = true; - return; - } - if (type >= 2637 && type <= 2640) - { - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 88; - this.placeStyle = 20 + type - 2637; - this.width = 20; - this.height = 20; - this.value = 300; - return; - } - if (type == 2641 || type == 2642) - { - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 42; - this.placeStyle = type != 2641 ? 32 : 31; - this.width = 12; - this.height = 28; - this.value = 150; - return; - } - if (type >= 2643 && type <= 2647) - { - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 93; - this.placeStyle = 22 + type - 2643; - this.width = 10; - this.height = 24; - this.value = 500; - return; - } - if (type >= 2648 && type <= 2651) - { - this.noWet = true; - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 33; - this.width = 8; - this.height = 18; - this.value = Item.sellPrice(copper: 60); - this.placeStyle = 22 + type - 2648; - return; - } - if (type >= 2652 && type <= 2657) - { - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 34; - this.placeStyle = 27 + type - 2652; + this.createTile = 21; + this.placeStyle = type > 2614 ? 41 + type - 2615 : 35 + (type - 2612) * 2; this.width = 26; - this.height = 26; - this.value = 3000; - return; - } - if (type >= 2658 && type <= 2663) - { - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 90; - this.placeStyle = 21 + type - 2658; - this.width = 20; - this.height = 20; - this.value = 300; - return; - } - if (type >= 2664 && type <= 2668) - { - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 100; - this.placeStyle = 22 + type - 2664; - this.width = 20; - this.height = 20; - this.value = 1500; + this.height = 22; + this.value = 500; return; } switch (type) { - case 2669: + case 2621: + this.mana = 10; + this.damage = 50; this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.maxStack = 99; - this.consumable = true; - this.autoReuse = true; - this.createTile = 79; - this.placeStyle = 26; - this.width = 28; - this.height = 20; - this.value = 2000; + this.shootSpeed = 10f; + this.shoot = 407; + this.width = 26; + this.height = 28; + this.UseSound = SoundID.Item44; + this.useAnimation = 36; + this.useTime = 36; + this.rare = 8; + this.noMelee = true; + this.knockBack = 2f; + this.buffType = 139; + this.value = Item.sellPrice(gold: 5); + this.summon = true; return; - case 2670: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; + case 2622: + this.mana = 16; + this.damage = 60; + this.useStyle = 5; + this.shootSpeed = 6f; + this.shoot = 409; + this.width = 26; + this.height = 28; + this.UseSound = SoundID.Item84; + this.useAnimation = 40; + this.useTime = 20; this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 101; - this.width = 20; - this.height = 20; - this.value = 300; - this.placeStyle = 27; + this.rare = 8; + this.noMelee = true; + this.knockBack = 5f; + this.scale = 0.9f; + this.value = Item.sellPrice(gold: 5); + this.magic = true; return; - case 2671: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; + case 2624: + this.useStyle = 5; this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 87; - this.placeStyle = 25; - this.width = 20; - this.height = 20; - this.value = 300; - return; - case 2672: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 105; - this.width = 20; - this.height = 20; - this.value = 300; - this.placeStyle = 50; - return; - case 2673: - this.useStyle = 1; - this.autoReuse = true; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.maxStack = 999; - this.consumable = true; - this.width = 12; - this.height = 12; - this.makeNPC = (short) 374; - this.noUseGraphic = true; - this.bait = 666; + this.useAnimation = 24; + this.useTime = 24; + this.width = 50; + this.height = 18; + this.shoot = 1; + this.useAmmo = AmmoID.Arrow; + this.UseSound = SoundID.Item5; + this.damage = 60; + this.shootSpeed = 10f; + this.noMelee = true; + this.value = Item.sellPrice(gold: 5); + this.ranged = true; + this.rare = 8; + this.knockBack = 2f; return; default: - if (type >= 2674 && type <= 2676) + if (type == 2625 || type == 2626) { - this.maxStack = 999; + this.useStyle = 1; + this.autoReuse = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; this.consumable = true; - this.width = 12; - this.height = 12; - if (type == 2675) + this.createTile = 324; + if (type == 2626) { - this.bait = 30; - this.value = Item.sellPrice(silver: 3); + this.placeStyle = 1; + this.width = 26; + this.height = 24; return; } - if (type == 2676) - { - this.bait = 50; - this.value = Item.sellPrice(silver: 10); - return; - } - this.bait = 15; - this.value = Item.sellPrice(silver: 1); + this.width = 22; + this.height = 22; return; } - if (type >= 2677 && type <= 2690) + if (type >= 2627 && type <= 2630) { this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; - this.useTime = 7; + this.useTime = 10; this.autoReuse = true; this.maxStack = 999; this.consumable = true; - switch (type) - { - case 2677: - this.createWall = 153; - break; - case 2678: - this.createWall = 157; - break; - case 2679: - this.createWall = 154; - break; - case 2680: - this.createWall = 158; - break; - case 2681: - this.createWall = 155; - break; - case 2682: - this.createWall = 159; - break; - case 2683: - this.createWall = 156; - break; - case 2684: - this.createWall = 160; - break; - case 2685: - this.createWall = 164; - break; - case 2686: - this.createWall = 161; - break; - case 2687: - this.createWall = 165; - break; - case 2688: - this.createWall = 162; - break; - case 2689: - this.createWall = 166; - break; - case 2690: - this.createWall = 163; - break; - } + this.createTile = 19; + this.placeStyle = 21 + type - 2627; + this.width = 8; + this.height = 10; + return; + } + if (type >= 2631 && type <= 2633) + { + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 18; + this.placeStyle = 24 + type - 2631; + this.width = 28; + this.height = 14; + this.value = 150; + return; + } + if (type >= 2634 && type <= 2636) + { + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 89; + this.placeStyle = 26 + type - 2634; + this.width = 20; + this.height = 20; + this.value = 300; + return; + } + if (type == 2623) + { + this.autoReuse = true; + this.mana = 4; + this.UseSound = SoundID.Item85; + this.useStyle = 5; + this.damage = 70; + this.useAnimation = 9; + this.useTime = 9; + this.width = 40; + this.height = 40; + this.shoot = 410; + this.shootSpeed = 11f; + this.knockBack = 3f; + this.value = Item.sellPrice(gold: 5); + this.magic = true; + this.rare = 8; + this.noMelee = true; + return; + } + if (type >= 2637 && type <= 2640) + { + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 88; + this.placeStyle = 20 + type - 2637; + this.width = 20; + this.height = 20; + this.value = 300; + return; + } + if (type == 2641 || type == 2642) + { + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 42; + this.placeStyle = type != 2641 ? 32 : 31; this.width = 12; - this.height = 12; + this.height = 28; + return; + } + if (type >= 2643 && type <= 2647) + { + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 93; + this.placeStyle = 22 + type - 2643; + this.width = 10; + this.height = 24; + this.value = 500; + return; + } + if (type >= 2648 && type <= 2651) + { + this.noWet = true; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 33; + this.width = 8; + this.height = 18; + this.placeStyle = 22 + type - 2648; + return; + } + if (type >= 2652 && type <= 2657) + { + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 34; + this.placeStyle = 27 + type - 2652; + this.width = 26; + this.height = 26; + this.value = 3000; + return; + } + if (type >= 2658 && type <= 2663) + { + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 90; + this.placeStyle = 21 + type - 2658; + this.width = 20; + this.height = 20; + this.value = 300; + return; + } + if (type >= 2664 && type <= 2668) + { + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 100; + this.placeStyle = 22 + type - 2664; + this.width = 20; + this.height = 20; + this.value = 1500; return; } switch (type) { - case 2691: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 7; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createWall = 167; - this.width = 12; - this.height = 12; - return; - case 2692: + case 2669: this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; - this.createTile = 325; - this.width = 12; - this.height = 12; - return; - case 2693: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 326; - this.width = 12; - this.height = 12; + this.createTile = 79; + this.placeStyle = 26; + this.width = 28; + this.height = 20; + this.value = 2000; return; - case 2694: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 327; - this.width = 12; - this.height = 12; - return; - case 2695: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 328; - this.width = 12; - this.height = 12; - return; - case 2696: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 7; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createWall = 168; - this.width = 12; - this.height = 12; - return; - case 2697: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 329; - this.width = 12; - this.height = 12; - return; - case 2698: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 7; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createWall = 169; - this.width = 12; - this.height = 12; - return; - case 2699: + case 2670: this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; @@ -28393,12 +27976,13 @@ namespace Terraria this.autoReuse = true; this.maxStack = 99; this.consumable = true; - this.createTile = 471; - this.width = 30; - this.height = 30; - this.value = Item.sellPrice(copper: 50); + this.createTile = 101; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 27; return; - case 2700: + case 2671: this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; @@ -28406,132 +27990,136 @@ namespace Terraria this.autoReuse = true; this.maxStack = 99; this.consumable = true; - this.createTile = 335; - this.width = 26; - this.height = 22; - this.value = Item.buyPrice(gold: 5); - this.mech = true; + this.createTile = 87; + this.placeStyle = 25; + this.width = 20; + this.height = 20; + this.value = 300; return; - case 2701: + case 2672: this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; this.useTime = 10; this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 105; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 50; + return; + case 2673: + this.useStyle = 1; + this.autoReuse = true; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; this.maxStack = 999; this.consumable = true; - this.createTile = 336; this.width = 12; this.height = 12; + this.makeNPC = (short) 374; + this.noUseGraphic = true; + this.bait = 666; return; default: - if (type >= 2702 && type <= 2737) + if (type >= 2674 && type <= 2676) + { + this.maxStack = 999; + this.consumable = true; + this.width = 12; + this.height = 12; + if (type == 2675) + { + this.bait = 30; + this.value = Item.sellPrice(silver: 3); + return; + } + if (type == 2676) + { + this.bait = 50; + this.value = Item.sellPrice(silver: 10); + return; + } + this.bait = 15; + this.value = Item.sellPrice(silver: 1); + return; + } + if (type >= 2677 && type <= 2690) { this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; this.useTime = 10; this.autoReuse = true; - this.maxStack = 99; + this.maxStack = 999; this.consumable = true; - this.createTile = 337; - this.width = 20; - this.height = 20; - this.value = 300; - this.placeStyle = type - 2702; + switch (type) + { + case 2677: + this.createWall = 153; + break; + case 2678: + this.createWall = 157; + break; + case 2679: + this.createWall = 154; + break; + case 2680: + this.createWall = 158; + break; + case 2681: + this.createWall = 155; + break; + case 2682: + this.createWall = 159; + break; + case 2683: + this.createWall = 156; + break; + case 2684: + this.createWall = 160; + break; + case 2685: + this.createWall = 164; + break; + case 2686: + this.createWall = 161; + break; + case 2687: + this.createWall = 165; + break; + case 2688: + this.createWall = 162; + break; + case 2689: + this.createWall = 166; + break; + case 2690: + this.createWall = 163; + break; + } + this.width = 12; + this.height = 12; return; } switch (type) { - case 2738: - this.createTile = 338; - this.placeStyle = 0; + case 2691: this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.width = 12; - this.height = 30; - this.value = Item.buyPrice(gold: 3); - this.mech = true; - return; - case 2739: - this.useStyle = 1; - this.useAnimation = 15; this.useTime = 7; - this.useTurn = true; this.autoReuse = true; - this.width = 16; - this.height = 16; - this.maxStack = 99; - this.createTile = 314; - this.placeStyle = 2; - this.consumable = true; - this.cartTrack = true; - this.mech = true; - this.tileBoost = 2; - this.value = Item.buyPrice(silver: 50); - return; - case 2740: - this.useStyle = 1; - this.autoReuse = true; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; this.maxStack = 999; this.consumable = true; - this.width = 12; - this.height = 12; - this.makeNPC = (short) 377; - this.noUseGraphic = true; - this.bait = 10; - return; - case 2741: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 339; + this.createWall = 167; this.width = 12; this.height = 12; return; - case 2742: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.consumable = true; - this.createTile = 139; - this.placeStyle = 31; - this.width = 24; - this.height = 24; - this.rare = 4; - this.value = 100000; - this.accessory = true; - this.canBePlacedInVanityRegardlessOfConditions = true; - return; - case 2743: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 14; - this.placeStyle = 30; - this.width = 26; - this.height = 20; - this.value = 300; - return; - case 2744: + case 2692: this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; @@ -28539,57 +28127,83 @@ namespace Terraria this.autoReuse = true; this.maxStack = 999; this.consumable = true; - this.createTile = 19; - this.placeStyle = 25; - this.width = 8; - this.height = 10; + this.createTile = 325; + this.width = 12; + this.height = 12; return; - case 2745: - this.useStyle = 1; - this.useTurn = false; - this.useAnimation = 23; - this.useTime = 23; - this.width = 24; - this.height = 28; - this.damage = 8; - this.knockBack = 5f; - this.UseSound = SoundID.Item1; - this.scale = 1f; - this.value = 100; - this.melee = true; - return; - case 2746: - this.autoReuse = true; + case 2693: this.useStyle = 1; this.useTurn = true; - this.useAnimation = 33; - this.useTime = 23; - this.hammer = 35; - this.width = 24; - this.height = 28; - this.damage = 4; - this.knockBack = 5.5f; - this.scale = 1.1f; - this.UseSound = SoundID.Item1; - this.value = 50; - this.melee = true; - return; - case 2747: - this.useStyle = 5; - this.useAnimation = 29; - this.useTime = 29; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 326; this.width = 12; - this.height = 28; - this.shoot = 1; - this.useAmmo = AmmoID.Arrow; - this.UseSound = SoundID.Item5; - this.damage = 6; - this.shootSpeed = 6.6f; - this.noMelee = true; - this.value = 100; - this.ranged = true; + this.height = 12; return; - case 2748: + case 2694: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 327; + this.width = 12; + this.height = 12; + return; + case 2695: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 328; + this.width = 12; + this.height = 12; + return; + case 2696: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 168; + this.width = 12; + this.height = 12; + return; + case 2697: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 329; + this.width = 12; + this.height = 12; + return; + case 2698: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 169; + this.width = 12; + this.height = 12; + return; + case 2699: this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; @@ -28597,368 +28211,144 @@ namespace Terraria this.autoReuse = true; this.maxStack = 99; this.consumable = true; - this.createTile = 21; - this.placeStyle = 47; + this.createTile = 334; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(copper: 50); + return; + case 2700: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 335; this.width = 26; this.height = 22; - this.value = 500; + this.value = Item.buyPrice(gold: 5); + this.mech = true; return; - case 2749: - this.mana = 10; - this.damage = 36; + case 2701: this.useStyle = 1; - this.shootSpeed = 10f; - this.shoot = 423; - this.width = 26; - this.height = 28; - this.UseSound = SoundID.Item44; - this.useAnimation = 36; - this.useTime = 36; - this.rare = 8; - this.noMelee = true; - this.knockBack = 2f; - this.buffType = 140; - this.value = Item.sellPrice(gold: 10); - this.summon = true; - return; - case 2750: - this.autoReuse = true; - this.mana = 13; - this.useStyle = 5; - this.damage = 50; - this.useAnimation = 10; + this.useTurn = true; + this.useAnimation = 15; this.useTime = 10; - this.width = 40; - this.height = 40; - this.shoot = 424; - this.shootSpeed = 10f; - this.knockBack = 4.5f; - this.value = Item.sellPrice(gold: 2); - this.magic = true; - this.rare = 5; - this.noMelee = true; - this.UseSound = SoundID.Item88; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 336; + this.width = 12; + this.height = 12; return; default: - if (type >= 2751 && type <= 2755) + if (type >= 2702 && type <= 2737) { this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; this.useTime = 10; this.autoReuse = true; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; - this.createTile = 340 + type - 2751; - this.width = 12; - this.height = 12; + this.createTile = 337; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = type - 2702; return; } switch (type) { - case 2756: - this.UseSound = SoundID.Item6; - this.useStyle = 9; + case 2738: + this.createTile = 338; + this.placeStyle = 0; + this.useStyle = 1; this.useTurn = true; - this.useAnimation = 17; - this.useTime = 17; - this.maxStack = 30; - this.consumable = true; - this.width = 14; - this.height = 24; - this.value = 1000; - this.rare = 1; - return; - case 2757: - this.width = 18; - this.height = 18; - this.defense = 14; - this.headSlot = 169; - this.glowMask = (short) 26; - this.rare = 10; - this.value = Item.sellPrice(gold: 7); - return; - case 2758: - this.width = 18; - this.height = 18; - this.defense = 28; - this.bodySlot = 175; - this.glowMask = (short) 27; - this.rare = 10; - this.value = Item.sellPrice(gold: 7) * 2; - return; - case 2759: - this.width = 18; - this.height = 18; - this.defense = 20; - this.legSlot = 110; - this.rare = 10; - this.value = (int) ((double) Item.sellPrice(gold: 7) * 1.5); - return; - case 2760: - this.width = 18; - this.height = 18; - this.defense = 14; - this.headSlot = 170; - this.glowMask = (short) 28; - this.rare = 10; - this.value = Item.sellPrice(gold: 7); - return; - case 2761: - this.width = 18; - this.height = 18; - this.defense = 18; - this.bodySlot = 176; - this.glowMask = (short) 29; - this.rare = 10; - this.value = Item.sellPrice(gold: 7) * 2; - return; - case 2762: - this.width = 18; - this.height = 18; - this.defense = 14; - this.legSlot = 111; - this.glowMask = (short) 30; - this.rare = 10; - this.value = (int) ((double) Item.sellPrice(gold: 7) * 1.5); - return; - case 2763: - this.width = 18; - this.height = 18; - this.defense = 24; - this.headSlot = 171; - this.rare = 10; - this.value = Item.sellPrice(gold: 7); - return; - case 2764: - this.width = 18; - this.height = 18; - this.defense = 34; - this.bodySlot = 177; - this.rare = 10; - this.value = Item.sellPrice(gold: 7) * 2; - return; - case 2765: - this.width = 18; - this.height = 18; - this.defense = 20; - this.legSlot = 112; - this.rare = 10; - this.value = (int) ((double) Item.sellPrice(gold: 7) * 1.5); - return; - case 2766: - this.width = 22; - this.height = 14; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; this.maxStack = 99; - this.rare = 8; - return; - case 2767: - this.useStyle = 4; - this.width = 22; - this.height = 14; this.consumable = true; - this.useAnimation = 45; - this.useTime = 45; - this.maxStack = 20; - this.rare = 8; - return; - case 2768: - this.useStyle = 1; - this.width = 32; + this.width = 12; this.height = 30; - this.UseSound = SoundID.Item25; - this.useAnimation = 20; - this.useTime = 20; - this.rare = 8; - this.noMelee = true; - this.mountType = 8; - this.value = Item.sellPrice(gold: 5); + this.value = Item.buyPrice(gold: 3); + this.mech = true; return; - case 2769: + case 2739: this.useStyle = 1; - this.width = 32; - this.height = 30; - this.UseSound = SoundID.Item25; - this.useAnimation = 20; - this.useTime = 20; - this.rare = 8; - this.noMelee = true; - this.mountType = 7; - this.value = Item.sellPrice(gold: 5); + this.useAnimation = 15; + this.useTime = 7; + this.useTurn = true; + this.autoReuse = true; + this.width = 16; + this.height = 16; + this.maxStack = 99; + this.createTile = 314; + this.placeStyle = 2; + this.consumable = true; + this.cartTrack = true; + this.mech = true; + this.tileBoost = 2; + this.value = Item.buyPrice(silver: 50); return; - case 2770: - this.width = 22; - this.height = 20; + case 2740: + this.useStyle = 1; + this.autoReuse = true; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 999; + this.consumable = true; + this.width = 12; + this.height = 12; + this.makeNPC = (short) 377; + this.noUseGraphic = true; + this.bait = 10; + return; + case 2741: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 339; + this.width = 12; + this.height = 12; + return; + case 2742: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 139; + this.placeStyle = 31; + this.width = 24; + this.height = 24; + this.rare = 4; + this.value = 100000; this.accessory = true; - this.value = this.eclipseMothronPrice; - this.rare = 8; - this.wingSlot = (sbyte) 27; return; - case 2771: + case 2743: this.useStyle = 1; - this.channel = true; - this.width = 34; - this.height = 34; - this.UseSound = SoundID.Item90; - this.useAnimation = 20; - this.useTime = 20; - this.rare = 8; - this.noMelee = true; - this.mountType = 9; - this.value = Item.sellPrice(gold: 5); - return; - case 2772: - this.autoReuse = true; - this.useStyle = 1; - this.useAnimation = 25; - this.knockBack = 6f; - this.useTime = 7; - this.width = 54; - this.height = 54; - this.damage = 100; - this.axe = 27; - this.UseSound = SoundID.Item1; - this.rare = 10; - this.scale = 1.05f; - this.value = Item.sellPrice(gold: 6); - this.melee = true; - this.glowMask = (short) 1; - this.tileBoost += 4; - return; - case 2773: - this.useStyle = 5; - this.useAnimation = 25; - this.useTime = 7; - this.shootSpeed = 28f; - this.knockBack = 4f; - this.width = 56; - this.height = 22; - this.damage = 80; - this.axe = 27; - this.UseSound = SoundID.Item23; - this.shoot = 427; - this.rare = 10; - this.value = Item.sellPrice(gold: 6); - this.noMelee = true; - this.noUseGraphic = true; - this.melee = true; - this.channel = true; - this.glowMask = (short) 20; - this.tileBoost += 4; - return; - case 2774: - this.useStyle = 5; - this.useAnimation = 25; - this.useTime = 4; - this.shootSpeed = 32f; - this.knockBack = 0.0f; - this.width = 54; - this.height = 26; - this.damage = 50; - this.pick = 225; - this.UseSound = SoundID.Item23; - this.shoot = 428; - this.rare = 10; - this.value = Item.sellPrice(gold: 7); - this.noMelee = true; - this.noUseGraphic = true; - this.melee = true; - this.channel = true; - this.glowMask = (short) 21; - this.tileBoost += 3; - return; - case 2775: this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; this.autoReuse = true; - this.useStyle = 1; - this.useAnimation = 30; - this.useTime = 7; - this.knockBack = 7f; - this.width = 44; - this.height = 42; - this.damage = 110; - this.hammer = 100; - this.UseSound = SoundID.Item1; - this.rare = 10; - this.value = Item.sellPrice(gold: 8); - this.melee = true; - this.scale = 1.1f; - this.glowMask = (short) 4; - this.tileBoost += 4; + this.maxStack = 99; + this.consumable = true; + this.createTile = 14; + this.placeStyle = 30; + this.width = 26; + this.height = 20; + this.value = 300; return; - case 2776: - this.useStyle = 1; - this.useAnimation = 12; - this.useTime = 6; - this.knockBack = 5.5f; - this.useTurn = true; - this.autoReuse = true; - this.width = 36; - this.height = 36; - this.damage = 80; - this.pick = 225; - this.UseSound = SoundID.Item1; - this.rare = 10; - this.value = Item.sellPrice(gold: 7); - this.melee = true; - this.glowMask = (short) 5; - this.tileBoost += 4; - return; - case 2777: - this.SetDefaults3(2772); - type = 2777; - this.glowMask = (short) 6; - return; - case 2778: - this.SetDefaults3(2773); - type = 2778; - this.shoot = 429; - this.glowMask = (short) 22; - return; - case 2779: - this.SetDefaults3(2774); - type = 2779; - this.shoot = 430; - this.glowMask = (short) 23; - return; - case 2780: - this.SetDefaults3(2775); - type = 2780; - this.glowMask = (short) 9; - return; - case 2781: - this.SetDefaults3(2776); - type = 2781; - this.glowMask = (short) 10; - return; - case 2782: - this.SetDefaults3(2772); - type = 2782; - this.glowMask = (short) -1; - return; - case 2783: - this.SetDefaults3(2773); - type = 2783; - this.shoot = 431; - this.glowMask = (short) -1; - return; - case 2784: - this.SetDefaults3(2774); - type = 2784; - this.shoot = 432; - this.glowMask = (short) -1; - return; - case 2785: - this.SetDefaults3(2775); - type = 2785; - this.glowMask = (short) -1; - return; - case 2786: - this.SetDefaults3(2776); - type = 2786; - this.glowMask = (short) -1; - return; - case 2787: + case 2744: this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; @@ -28966,38 +28356,108 @@ namespace Terraria this.autoReuse = true; this.maxStack = 999; this.consumable = true; - this.createTile = 345; - this.width = 12; - this.height = 12; + this.createTile = 19; + this.placeStyle = 25; + this.width = 8; + this.height = 10; return; - case 2788: + case 2745: + this.useStyle = 1; + this.useTurn = false; + this.useAnimation = 23; + this.useTime = 23; + this.width = 24; + this.height = 28; + this.damage = 8; + this.knockBack = 5f; + this.UseSound = SoundID.Item1; + this.scale = 1f; + this.value = 100; + this.melee = true; + return; + case 2746: + this.autoReuse = true; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 33; + this.useTime = 23; + this.hammer = 35; + this.width = 24; + this.height = 28; + this.damage = 4; + this.knockBack = 5.5f; + this.scale = 1.1f; + this.UseSound = SoundID.Item1; + this.value = 50; + this.melee = true; + return; + case 2747: + this.useStyle = 5; + this.useAnimation = 29; + this.useTime = 29; + this.width = 12; + this.height = 28; + this.shoot = 1; + this.useAmmo = AmmoID.Arrow; + this.UseSound = SoundID.Item5; + this.damage = 6; + this.shootSpeed = 6.6f; + this.noMelee = true; + this.value = 100; + this.ranged = true; + return; + case 2748: this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; - this.useTime = 7; + this.useTime = 10; this.autoReuse = true; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; - this.createWall = 172; - this.width = 12; - this.height = 12; + this.createTile = 21; + this.placeStyle = 47; + this.width = 26; + this.height = 22; + this.value = 500; + return; + case 2749: + this.mana = 10; + this.damage = 36; + this.useStyle = 1; + this.shootSpeed = 10f; + this.shoot = 423; + this.width = 26; + this.height = 28; + this.UseSound = SoundID.Item44; + this.useAnimation = 36; + this.useTime = 36; + this.rare = 8; + this.noMelee = true; + this.knockBack = 2f; + this.buffType = 140; + this.value = Item.sellPrice(gold: 10); + this.summon = true; + return; + case 2750: + this.autoReuse = true; + this.mana = 13; + this.useStyle = 5; + this.damage = 50; + this.useAnimation = 10; + this.useTime = 10; + this.width = 40; + this.height = 40; + this.shoot = 424; + this.shootSpeed = 10f; + this.knockBack = 4.5f; + this.value = Item.sellPrice(gold: 2); + this.magic = true; + this.rare = 5; + this.noMelee = true; + this.UseSound = SoundID.Item88; return; default: - if (type >= 2789 && type <= 2791) - { - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 7; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createWall = 173 + type - 2789; - this.width = 12; - this.height = 12; - return; - } - if (type >= 2792 && type <= 2794) + if (type >= 2751 && type <= 2755) { this.useStyle = 1; this.useTurn = true; @@ -29006,325 +28466,307 @@ namespace Terraria this.autoReuse = true; this.maxStack = 999; this.consumable = true; - this.createTile = 346 + type - 2792; + this.createTile = 340 + type - 2751; this.width = 12; this.height = 12; return; } switch (type) { - case 2795: - this.useStyle = 5; + case 2756: + this.UseSound = SoundID.Item6; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.value = 1000; + this.rare = 1; + return; + case 2757: + this.width = 18; + this.height = 18; + this.defense = 14; + this.headSlot = 169; + this.glowMask = (short) 26; + this.rare = 10; + return; + case 2758: + this.width = 18; + this.height = 18; + this.defense = 28; + this.bodySlot = 175; + this.glowMask = (short) 27; + this.rare = 10; + return; + case 2759: + this.width = 18; + this.height = 18; + this.defense = 20; + this.legSlot = 110; + this.rare = 10; + return; + case 2760: + this.width = 18; + this.height = 18; + this.defense = 14; + this.headSlot = 170; + this.glowMask = (short) 28; + this.rare = 10; + return; + case 2761: + this.width = 18; + this.height = 18; + this.defense = 18; + this.bodySlot = 176; + this.glowMask = (short) 29; + this.rare = 10; + return; + case 2762: + this.width = 18; + this.height = 18; + this.defense = 14; + this.legSlot = 111; + this.glowMask = (short) 30; + this.rare = 10; + return; + case 2763: + this.width = 18; + this.height = 18; + this.defense = 24; + this.headSlot = 171; + this.rare = 10; + return; + case 2764: + this.width = 18; + this.height = 18; + this.defense = 34; + this.bodySlot = 177; + this.rare = 10; + return; + case 2765: + this.width = 18; + this.height = 18; + this.defense = 20; + this.legSlot = 112; + this.rare = 10; + return; + case 2766: + this.width = 22; + this.height = 14; + this.maxStack = 99; + this.rare = 8; + return; + case 2767: + this.useStyle = 4; + this.width = 22; + this.height = 14; + this.consumable = true; + this.useAnimation = 45; + this.useTime = 45; + this.maxStack = 20; + this.rare = 8; + return; + case 2768: + this.useStyle = 1; + this.width = 32; + this.height = 30; + this.UseSound = SoundID.Item25; this.useAnimation = 20; this.useTime = 20; - this.shootSpeed = 20f; - this.knockBack = 2f; - this.width = 20; - this.height = 12; - this.damage = 60; - this.shoot = 439; - this.mana = 6; this.rare = 8; - this.value = Item.sellPrice(gold: 10); this.noMelee = true; - this.noUseGraphic = true; - this.magic = true; + this.mountType = 8; + this.value = Item.sellPrice(gold: 5); + return; + case 2769: + this.useStyle = 1; + this.width = 32; + this.height = 30; + this.UseSound = SoundID.Item25; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 8; + this.noMelee = true; + this.mountType = 7; + this.value = Item.sellPrice(gold: 5); + return; + case 2770: + this.width = 22; + this.height = 20; + this.accessory = true; + this.value = 400000; + this.rare = 8; + this.wingSlot = (sbyte) 27; + return; + case 2771: + this.useStyle = 1; this.channel = true; - this.glowMask = (short) 47; - return; - case 2796: - this.useStyle = 5; - this.useAnimation = 12; - this.useTime = 12; - this.width = 50; - this.height = 18; - this.shoot = 442; - this.useAmmo = 771; - this.glowMask = (short) 36; - this.UseSound = SoundID.Item92; - this.damage = 40; - this.shootSpeed = 12f; - this.noMelee = true; - this.value = Item.sellPrice(gold: 10); - this.ranged = true; + this.width = 34; + this.height = 34; + this.UseSound = SoundID.Item90; + this.useAnimation = 20; + this.useTime = 20; this.rare = 8; - this.knockBack = 2f; + this.noMelee = true; + this.mountType = 9; + this.value = Item.sellPrice(gold: 5); return; - case 2797: - this.useStyle = 5; - this.useAnimation = 21; - this.useTime = 21; + case 2772: this.autoReuse = true; - this.width = 50; - this.height = 18; - this.shoot = 444; - this.useAmmo = AmmoID.Bullet; - this.glowMask = (short) 38; - this.UseSound = SoundID.Item95; - this.damage = 45; - this.shootSpeed = 12f; - this.noMelee = true; - this.value = Item.sellPrice(gold: 10); - this.ranged = true; - this.rare = 8; - this.knockBack = 3f; + this.useStyle = 1; + this.useAnimation = 25; + this.knockBack = 6f; + this.useTime = 7; + this.width = 54; + this.height = 54; + this.damage = 100; + this.axe = 27; + this.UseSound = SoundID.Item1; + this.rare = 10; + this.scale = 1.05f; + this.value = Item.sellPrice(gold: 5); + this.melee = true; + this.glowMask = (short) 1; + this.tileBoost += 4; return; - case 2798: + case 2773: this.useStyle = 5; this.useAnimation = 25; - this.useTime = 6; - this.shootSpeed = 36f; - this.knockBack = 4.75f; - this.width = 20; - this.height = 12; - this.damage = 35; - this.pick = 230; - this.shoot = 445; - this.rare = 8; - this.value = Item.sellPrice(gold: 10); - this.tileBoost = 11; + this.useTime = 7; + this.shootSpeed = 28f; + this.knockBack = 4f; + this.width = 56; + this.height = 22; + this.damage = 80; + this.axe = 27; + this.UseSound = SoundID.Item23; + this.shoot = 427; + this.rare = 10; + this.value = Item.sellPrice(gold: 5); this.noMelee = true; this.noUseGraphic = true; this.melee = true; this.channel = true; - this.glowMask = (short) 39; + this.glowMask = (short) 20; + this.tileBoost += 4; return; - case 2799: - this.width = 10; - this.height = 26; - this.accessory = true; - this.value = Item.buyPrice(gold: 1); - this.rare = 1; - return; - case 2800: - this.noUseGraphic = true; - this.damage = 0; - this.knockBack = 7f; + case 2774: this.useStyle = 5; - this.shootSpeed = 14f; - this.shoot = 446; - this.width = 18; - this.height = 28; - this.UseSound = SoundID.Item1; - this.useAnimation = 20; - this.useTime = 20; - this.rare = 7; - this.noMelee = true; - this.value = Item.sellPrice(gold: 2, silver: 50); - return; - case 2801: - this.width = 28; - this.height = 20; - this.headSlot = 172; - this.rare = 1; - this.vanity = true; - return; - case 2802: - this.width = 28; - this.height = 20; - this.headSlot = 173; - this.rare = 1; - this.vanity = true; - return; - case 2803: - this.width = 18; - this.height = 18; - this.headSlot = 174; - this.vanity = true; - this.value = Item.sellPrice(gold: 1); - return; - case 2804: - this.width = 18; - this.height = 18; - this.bodySlot = 178; - this.vanity = true; - this.value = Item.sellPrice(gold: 1); - return; - case 2805: - this.width = 18; - this.height = 18; - this.legSlot = 113; - this.vanity = true; - this.value = Item.sellPrice(gold: 1); - return; - case 2806: - this.width = 18; - this.height = 18; - this.headSlot = 175; - this.vanity = true; - this.value = Item.sellPrice(gold: 1); - this.glowMask = (short) 46; - return; - case 2807: - this.width = 18; - this.height = 18; - this.bodySlot = 179; - this.vanity = true; - this.value = Item.sellPrice(gold: 1); - this.glowMask = (short) 45; - return; - case 2808: - this.width = 18; - this.height = 18; - this.legSlot = 114; - this.vanity = true; - this.value = Item.sellPrice(gold: 1); - return; - case 2809: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 104; - this.width = 20; - this.height = 20; - this.value = 300; - this.placeStyle = 24; - return; - case 2810: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 90; - this.placeStyle = 27; - this.width = 20; - this.height = 20; - this.value = 300; - return; - case 2811: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.maxStack = 99; - this.consumable = true; - this.autoReuse = true; - this.createTile = 79; - this.placeStyle = 27; - this.width = 28; - this.height = 20; - this.value = 2000; - return; - case 2812: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 15; - this.placeStyle = 32; - this.width = 12; - this.height = 30; - this.value = 150; - return; - case 2813: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 34; - this.placeStyle = 33; - this.width = 26; + this.useAnimation = 25; + this.useTime = 9; + this.shootSpeed = 32f; + this.knockBack = 0.0f; + this.width = 54; this.height = 26; - this.value = 3000; + this.damage = 50; + this.pick = 225; + this.UseSound = SoundID.Item23; + this.shoot = 428; + this.rare = 10; + this.value = Item.sellPrice(gold: 5); + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + this.channel = true; + this.glowMask = (short) 21; + this.tileBoost += 4; return; - case 2814: - this.useStyle = 1; + case 2775: this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 21; - this.placeStyle = 48; - this.width = 26; - this.height = 22; - this.value = 500; - return; - case 2815: this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.maxStack = 99; - this.consumable = true; - this.createTile = 10; - this.placeStyle = 32; - this.width = 14; - this.height = 28; - this.value = 200; + this.useAnimation = 30; + this.useTime = 7; + this.knockBack = 7f; + this.width = 44; + this.height = 42; + this.damage = 110; + this.hammer = 100; + this.UseSound = SoundID.Item1; + this.rare = 10; + this.value = Item.sellPrice(gold: 5); + this.melee = true; + this.scale = 1.1f; + this.glowMask = (short) 4; + this.tileBoost += 4; return; - case 2816: + case 2776: this.useStyle = 1; + this.useAnimation = 12; + this.useTime = 6; + this.knockBack = 5.5f; this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 88; - this.placeStyle = 24; - this.width = 20; - this.height = 20; - this.value = 300; + this.width = 36; + this.height = 36; + this.damage = 80; + this.pick = 225; + this.UseSound = SoundID.Item1; + this.rare = 10; + this.value = Item.sellPrice(gold: 5); + this.melee = true; + this.glowMask = (short) 5; + this.tileBoost += 4; return; - case 2817: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 101; - this.width = 20; - this.height = 20; - this.value = 300; - this.placeStyle = 28; + case 2777: + this.SetDefaults3(2772); + type = 2777; + this.glowMask = (short) 6; return; - case 2818: - this.noWet = true; - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 33; - this.placeStyle = 26; - this.width = 8; - this.value = Item.sellPrice(copper: 60); - this.height = 18; + case 2778: + this.SetDefaults3(2773); + type = 2778; + this.shoot = 429; + this.glowMask = (short) 22; return; - case 2819: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 93; - this.placeStyle = 27; - this.width = 10; - this.height = 24; - this.value = 500; + case 2779: + this.SetDefaults3(2774); + type = 2779; + this.shoot = 430; + this.glowMask = (short) 23; return; - case 2820: + case 2780: + this.SetDefaults3(2775); + type = 2780; + this.glowMask = (short) 9; + return; + case 2781: + this.SetDefaults3(2776); + type = 2781; + this.glowMask = (short) 10; + return; + case 2782: + this.SetDefaults3(2772); + type = 2782; + this.glowMask = (short) -1; + return; + case 2783: + this.SetDefaults3(2773); + type = 2783; + this.shoot = 431; + this.glowMask = (short) -1; + return; + case 2784: + this.SetDefaults3(2774); + type = 2784; + this.shoot = 432; + this.glowMask = (short) -1; + return; + case 2785: + this.SetDefaults3(2775); + type = 2785; + this.glowMask = (short) -1; + return; + case 2786: + this.SetDefaults3(2776); + type = 2786; + this.glowMask = (short) -1; + return; + case 2787: this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; @@ -29332,479 +28774,462 @@ namespace Terraria this.autoReuse = true; this.maxStack = 999; this.consumable = true; - this.createTile = 42; + this.createTile = 345; this.width = 12; - this.height = 28; - this.placeStyle = 33; - this.value = 150; + this.height = 12; return; - case 2821: + case 2788: this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 87; - this.placeStyle = 26; - this.width = 20; - this.height = 20; - this.value = 300; - return; - case 2822: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; + this.useTime = 7; this.autoReuse = true; this.maxStack = 999; this.consumable = true; - this.createTile = 19; - this.placeStyle = 26; - this.width = 8; - this.height = 10; - return; - case 2823: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 89; - this.placeStyle = 29; - this.width = 20; - this.height = 20; - this.value = 300; - return; - case 2824: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 14; - this.placeStyle = 31; - this.width = 26; - this.height = 20; - this.value = 300; - return; - case 2825: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 100; - this.placeStyle = 27; - this.width = 20; - this.height = 20; - this.value = 1500; - return; - case 2826: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 18; - this.placeStyle = 27; - this.width = 28; - this.height = 14; - this.value = 150; + this.createWall = 172; + this.width = 12; + this.height = 12; return; default: - if (type >= 2827 && type <= 2855) + if (type >= 2789 && type <= 2791) + { + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createWall = 173 + type - 2789; + this.width = 12; + this.height = 12; + return; + } + if (type >= 2792 && type <= 2794) { this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; this.useTime = 10; this.autoReuse = true; - this.maxStack = 99; + this.maxStack = 999; this.consumable = true; - this.createTile = 172; - this.placeStyle = type - 2827; - this.width = 20; - this.height = 20; - this.value = 300; - if (type != 2843) - return; - this.value = Item.buyPrice(gold: 10); + this.createTile = 346 + type - 2792; + this.width = 12; + this.height = 12; return; } switch (type) { - case 2856: - this.width = 28; - this.height = 20; - this.headSlot = 176; - this.rare = 1; - this.vanity = true; - this.value = Item.buyPrice(gold: 10); - return; - case 2857: - this.width = 28; - this.height = 20; - this.headSlot = 177; - this.rare = 1; - this.vanity = true; - this.value = Item.buyPrice(gold: 10); - return; - case 2858: - this.width = 18; - this.height = 14; - this.bodySlot = 180; - this.rare = 1; - this.vanity = true; - this.value = Item.buyPrice(gold: 10); - return; - case 2859: - this.width = 18; - this.height = 14; - this.bodySlot = 181; - this.rare = 1; - this.vanity = true; - this.value = Item.buyPrice(gold: 10); - return; - case 2860: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.glowMask = (short) 93; - this.createTile = 350; - this.width = 12; - this.height = 12; - return; - case 2861: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 7; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.glowMask = (short) 95; - this.createWall = 176; - this.width = 12; - this.height = 12; - return; - case 2862: - this.width = 28; - this.height = 12; - this.headSlot = 178; - this.rare = 3; - this.value = Item.sellPrice(gold: 1); - this.vanity = true; - this.glowMask = (short) 97; - return; - case 2863: - this.width = 20; - this.height = 26; - this.maxStack = 99; - this.rare = 3; - this.glowMask = (short) 98; - this.value = Item.buyPrice(gold: 30); - this.UseSound = SoundID.Item3; - this.useStyle = 9; - this.useTurn = true; - this.useAnimation = 17; - this.useTime = 17; - this.consumable = true; - return; - case 2864: - this.glowMask = (short) 99; - this.width = 20; - this.height = 20; - this.maxStack = 99; - this.value = Item.sellPrice(gold: 1, silver: 50); - this.rare = 3; - return; - case 2865: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 242; - this.width = 30; - this.height = 30; - this.value = Item.buyPrice(gold: 2); - this.placeStyle = 27; - return; - case 2866: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 242; - this.width = 30; - this.height = 30; - this.value = Item.buyPrice(gold: 2); - this.placeStyle = 28; - return; - case 2867: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 242; - this.width = 30; - this.height = 30; - this.value = Item.buyPrice(gold: 2); - this.placeStyle = 29; - return; - case 2868: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 351; - this.width = 12; - this.height = 12; - this.value = Item.buyPrice(silver: 1); - return; - case 2869: - this.width = 20; - this.height = 20; - this.maxStack = 99; - this.value = Item.sellPrice(gold: 1, silver: 50); - this.rare = 3; - return; - case 2870: - this.width = 20; - this.height = 20; - this.maxStack = 99; - this.value = Item.sellPrice(gold: 1, silver: 50); - this.rare = 3; - return; - case 2871: - this.width = 20; - this.height = 20; - this.maxStack = 99; - this.value = Item.sellPrice(silver: 75); - this.rare = 2; - return; - case 2872: - this.width = 20; - this.height = 20; - this.maxStack = 99; - this.value = Item.sellPrice(silver: 75); - this.rare = 2; - return; - case 2873: - this.width = 20; - this.height = 20; - this.maxStack = 99; - this.value = Item.sellPrice(gold: 1, silver: 50); - this.rare = 3; - return; - case 2874: - this.width = 20; - this.height = 20; - this.maxStack = 99; - this.value = 10000; - this.rare = 1; - return; - case 2875: - this.width = 20; - this.height = 20; - this.maxStack = 99; - this.value = 10000; - this.rare = 1; - return; - case 2876: - this.width = 20; - this.height = 20; - this.maxStack = 99; - this.value = 10000; - this.rare = 1; - return; - case 2877: - this.width = 20; - this.height = 20; - this.maxStack = 99; - this.value = 10000; - this.rare = 1; - return; - case 2878: - this.width = 20; - this.height = 20; - this.maxStack = 99; - this.value = Item.sellPrice(gold: 1, silver: 50); - this.rare = 3; - this.glowMask = (short) 105; - return; - case 2879: - this.width = 20; - this.height = 20; - this.maxStack = 99; - this.value = Item.sellPrice(gold: 1, silver: 50); - this.rare = 3; - this.glowMask = (short) 104; - return; - case 2880: - this.useStyle = 1; - this.useAnimation = 20; - this.useTime = 20; - this.autoReuse = true; - this.shoot = 451; - this.shootSpeed = 11f; - this.knockBack = 4.5f; - this.width = 40; - this.height = 40; - this.damage = 110; - this.scale = 1.05f; - this.UseSound = SoundID.Item1; - this.rare = 8; - this.value = Item.sellPrice(gold: 10); - this.melee = true; - return; - case 2882: + case 2795: this.useStyle = 5; this.useAnimation = 20; this.useTime = 20; - this.shootSpeed = 14f; + this.shootSpeed = 20f; this.knockBack = 2f; - this.width = 16; - this.height = 16; - this.damage = 100; - this.UseSound = SoundID.Item75; - this.shoot = 460; - this.mana = 14; + this.width = 20; + this.height = 12; + this.damage = 60; + this.shoot = 439; + this.mana = 6; this.rare = 8; this.value = Item.sellPrice(gold: 10); this.noMelee = true; this.noUseGraphic = true; this.magic = true; this.channel = true; - this.glowMask = (short) 102; + this.glowMask = (short) 47; return; - case 2883: + case 2796: + this.useStyle = 5; + this.useAnimation = 12; + this.useTime = 12; + this.width = 50; + this.height = 18; + this.shoot = 442; + this.useAmmo = 771; + this.glowMask = (short) 36; + this.UseSound = SoundID.Item92; + this.damage = 40; + this.shootSpeed = 12f; + this.noMelee = true; + this.value = Item.sellPrice(gold: 10); + this.ranged = true; + this.rare = 8; + this.knockBack = 2f; + return; + case 2797: + this.useStyle = 5; + this.useAnimation = 21; + this.useTime = 21; + this.autoReuse = true; + this.width = 50; + this.height = 18; + this.shoot = 444; + this.useAmmo = AmmoID.Bullet; + this.glowMask = (short) 38; + this.UseSound = SoundID.Item95; + this.damage = 45; + this.shootSpeed = 12f; + this.noMelee = true; + this.value = Item.sellPrice(gold: 10); + this.ranged = true; + this.rare = 8; + this.knockBack = 3f; + return; + case 2798: + this.useStyle = 5; + this.useAnimation = 25; + this.useTime = 7; + this.shootSpeed = 36f; + this.knockBack = 4.75f; this.width = 20; - this.height = 20; - this.maxStack = 99; - this.value = Item.sellPrice(gold: 1, silver: 50); - this.rare = 3; - this.glowMask = (short) 103; + this.height = 12; + this.damage = 35; + this.pick = 230; + this.axe = 30; + this.UseSound = SoundID.Item23; + this.shoot = 445; + this.rare = 8; + this.value = Item.sellPrice(gold: 10); + this.tileBoost = 10; + this.noMelee = true; + this.noUseGraphic = true; + this.melee = true; + this.channel = true; + this.glowMask = (short) 39; return; - case 2884: - this.width = 20; - this.height = 20; - this.maxStack = 99; - this.value = Item.sellPrice(gold: 1, silver: 50); - this.rare = 3; - this.glowMask = (short) 107; + case 2799: + this.width = 10; + this.height = 26; + this.accessory = true; + this.value = Item.buyPrice(gold: 1); + this.rare = 1; return; - case 2885: - this.width = 20; - this.height = 20; - this.maxStack = 99; - this.value = Item.sellPrice(gold: 1, silver: 50); - this.rare = 3; - this.glowMask = (short) 106; - return; - case 2886: + case 2800: + this.noUseGraphic = true; this.damage = 0; + this.knockBack = 7f; + this.useStyle = 5; + this.shootSpeed = 14f; + this.shoot = 446; + this.width = 18; + this.height = 28; + this.UseSound = SoundID.Item1; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 7; + this.noMelee = true; + this.value = Item.sellPrice(gold: 1); + return; + case 2801: + this.width = 28; + this.height = 20; + this.headSlot = 172; + this.rare = 1; + this.vanity = true; + return; + case 2802: + this.width = 28; + this.height = 20; + this.headSlot = 173; + this.rare = 1; + this.vanity = true; + return; + case 2803: + this.width = 18; + this.height = 18; + this.headSlot = 174; + this.vanity = true; + this.value = Item.sellPrice(gold: 1); + return; + case 2804: + this.width = 18; + this.height = 18; + this.bodySlot = 178; + this.vanity = true; + this.value = Item.sellPrice(gold: 1); + return; + case 2805: + this.width = 18; + this.height = 18; + this.legSlot = 113; + this.vanity = true; + this.value = Item.sellPrice(gold: 1); + return; + case 2806: + this.width = 18; + this.height = 18; + this.headSlot = 175; + this.vanity = true; + this.value = Item.sellPrice(gold: 1); + this.glowMask = (short) 46; + return; + case 2807: + this.width = 18; + this.height = 18; + this.bodySlot = 179; + this.vanity = true; + this.value = Item.sellPrice(gold: 1); + this.glowMask = (short) 45; + return; + case 2808: + this.width = 18; + this.height = 18; + this.legSlot = 114; + this.vanity = true; + this.value = Item.sellPrice(gold: 1); + return; + case 2809: this.useStyle = 1; - this.shootSpeed = 4f; - this.shoot = 463; - this.width = 16; - this.height = 24; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; this.maxStack = 99; this.consumable = true; - this.UseSound = SoundID.Item1; + this.createTile = 104; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 24; + return; + case 2810: + this.useStyle = 1; + this.useTurn = true; this.useAnimation = 15; - this.useTime = 15; - this.noMelee = true; - this.value = 100; - return; - case 2887: - this.width = 16; - this.height = 18; + this.useTime = 10; + this.autoReuse = true; this.maxStack = 99; - this.value = 50; + this.consumable = true; + this.createTile = 90; + this.placeStyle = 27; + this.width = 20; + this.height = 20; + this.value = 300; return; - case 2888: - this.useStyle = 5; - this.useAnimation = 24; - this.useTime = 23; + case 2811: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.autoReuse = true; + this.createTile = 79; + this.placeStyle = 27; + this.width = 28; + this.height = 20; + this.value = 2000; + return; + case 2812: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 15; + this.placeStyle = 32; + this.width = 12; + this.height = 30; + return; + case 2813: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 34; + this.placeStyle = 33; + this.width = 26; + this.height = 26; + this.value = 3000; + return; + case 2814: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 21; + this.placeStyle = 48; + this.width = 26; + this.height = 22; + this.value = 500; + return; + case 2815: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 10; + this.placeStyle = 32; + this.width = 14; + this.height = 28; + this.value = 200; + return; + case 2816: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 88; + this.placeStyle = 24; + this.width = 20; + this.height = 20; + this.value = 300; + return; + case 2817: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 101; + this.width = 20; + this.height = 20; + this.value = 300; + this.placeStyle = 28; + return; + case 2818: + this.noWet = true; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 33; + this.placeStyle = 26; + this.width = 8; + this.height = 18; + return; + case 2819: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 93; + this.placeStyle = 27; + this.width = 10; + this.height = 24; + this.value = 500; + return; + case 2820: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 42; this.width = 12; this.height = 28; - this.shoot = 469; - this.useAmmo = AmmoID.Arrow; - this.UseSound = SoundID.Item97; - this.damage = 23; - this.shootSpeed = 8f; - this.knockBack = 3f; - this.rare = 3; - this.noMelee = true; - this.value = this.queenBeePrice; - this.ranged = true; + this.placeStyle = 33; + return; + case 2821: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 87; + this.placeStyle = 26; + this.width = 20; + this.height = 20; + this.value = 300; + return; + case 2822: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 19; + this.placeStyle = 26; + this.width = 8; + this.height = 10; + return; + case 2823: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 89; + this.placeStyle = 29; + this.width = 20; + this.height = 20; + this.value = 300; + return; + case 2824: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 14; + this.placeStyle = 31; + this.width = 26; + this.height = 20; + this.value = 300; + return; + case 2825: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 100; + this.placeStyle = 27; + this.width = 20; + this.height = 20; + this.value = 1500; + return; + case 2826: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 18; + this.placeStyle = 27; + this.width = 28; + this.height = 14; + this.value = 150; return; default: - if (type >= 2889 && type <= 2895) - { - this.useStyle = 1; - this.autoReuse = true; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.maxStack = 999; - this.consumable = true; - this.width = 12; - this.height = 12; - this.makeNPC = (short) (442 + type - 2889); - this.noUseGraphic = true; - this.value = Item.sellPrice(gold: 10); - this.rare = 3; - if (type != 2895 && type != 2893 && type != 2891) - return; - this.bait = 50; - return; - } - if (type == 2896) - { - this.useStyle = 1; - this.shootSpeed = 4f; - this.shoot = 470; - this.width = 8; - this.height = 28; - this.maxStack = 99; - this.consumable = true; - this.UseSound = SoundID.Item1; - this.useAnimation = 40; - this.useTime = 40; - this.noUseGraphic = true; - this.noMelee = true; - this.value = Item.buyPrice(silver: 20); - this.rare = 1; - return; - } - if (type >= 2897 && type <= 2994) + if (type >= 2827 && type <= 2855) { this.useStyle = 1; this.useTurn = true; @@ -29813,17 +29238,105 @@ namespace Terraria this.autoReuse = true; this.maxStack = 99; this.consumable = true; - this.createTile = 91; - this.placeStyle = 109 + type - 2897; - this.width = 10; - this.height = 24; - this.value = 1000; - this.rare = 1; + this.createTile = 172; + this.placeStyle = type - 2827; + this.width = 20; + this.height = 20; + this.value = 300; return; } switch (type) { - case 2995: + case 2856: + this.width = 28; + this.height = 20; + this.headSlot = 176; + this.rare = 1; + this.vanity = true; + this.value = Item.buyPrice(gold: 10); + return; + case 2857: + this.width = 28; + this.height = 20; + this.headSlot = 177; + this.rare = 1; + this.vanity = true; + this.value = Item.buyPrice(gold: 10); + return; + case 2858: + this.width = 18; + this.height = 14; + this.bodySlot = 180; + this.rare = 1; + this.vanity = true; + this.value = Item.buyPrice(gold: 10); + return; + case 2859: + this.width = 18; + this.height = 14; + this.bodySlot = 181; + this.rare = 1; + this.vanity = true; + this.value = Item.buyPrice(gold: 10); + return; + case 2860: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.glowMask = (short) 93; + this.createTile = 350; + this.width = 12; + this.height = 12; + return; + case 2861: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.glowMask = (short) 95; + this.createWall = 176; + this.width = 12; + this.height = 12; + return; + case 2862: + this.width = 28; + this.height = 12; + this.headSlot = 178; + this.rare = 3; + this.value = Item.sellPrice(gold: 1); + this.vanity = true; + this.glowMask = (short) 97; + return; + case 2863: + this.width = 20; + this.height = 26; + this.maxStack = 99; + this.rare = 3; + this.glowMask = (short) 98; + this.value = Item.buyPrice(gold: 30); + this.UseSound = SoundID.Item3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.consumable = true; + return; + case 2864: + this.glowMask = (short) 99; + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = Item.sellPrice(gold: 1, silver: 50); + this.rare = 3; + return; + case 2865: this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; @@ -29834,39 +29347,38 @@ namespace Terraria this.createTile = 242; this.width = 30; this.height = 30; - this.value = Item.sellPrice(silver: 10); - this.placeStyle = 30; + this.value = Item.buyPrice(gold: 2); + this.placeStyle = 27; return; - case 2996: + case 2866: this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; - this.useTime = 8; + this.useTime = 10; this.autoReuse = true; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; - this.createTile = 353; - this.width = 12; - this.height = 12; - this.tileBoost += 3; + this.createTile = 242; + this.width = 30; + this.height = 30; + this.value = Item.buyPrice(gold: 2); + this.placeStyle = 28; return; - case 2997: - this.maxStack = 30; + case 2867: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; this.consumable = true; - this.width = 14; - this.height = 24; - this.value = 1000; - this.rare = 1; + this.createTile = 242; + this.width = 30; + this.height = 30; + this.value = Item.buyPrice(gold: 2); + this.placeStyle = 29; return; - case 2998: - this.width = 24; - this.height = 24; - this.accessory = true; - this.value = 100000; - this.rare = 4; - return; - case 2999: - this.rare = 1; + case 2868: this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; @@ -29874,27 +29386,320 @@ namespace Terraria this.autoReuse = true; this.maxStack = 999; this.consumable = true; - this.createTile = 354; + this.createTile = 351; this.width = 12; this.height = 12; - this.value = 100000; + this.value = Item.buyPrice(silver: 1); return; - case 3000: + case 2869: + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = Item.sellPrice(gold: 1, silver: 50); + this.rare = 3; + return; + case 2870: + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = Item.sellPrice(gold: 1, silver: 50); + this.rare = 3; + return; + case 2871: + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = Item.sellPrice(silver: 75); + this.rare = 2; + return; + case 2872: + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = Item.sellPrice(silver: 75); + this.rare = 2; + return; + case 2873: + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = Item.sellPrice(gold: 1, silver: 50); + this.rare = 3; + return; + case 2874: + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 10000; this.rare = 1; + return; + case 2875: + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 10000; + this.rare = 1; + return; + case 2876: + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 10000; + this.rare = 1; + return; + case 2877: + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = 10000; + this.rare = 1; + return; + case 2878: + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = Item.sellPrice(gold: 1, silver: 50); + this.rare = 3; + this.glowMask = (short) 105; + return; + case 2879: + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = Item.sellPrice(gold: 1, silver: 50); + this.rare = 3; + this.glowMask = (short) 104; + return; + case 2880: this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; + this.useAnimation = 20; + this.useTime = 20; this.autoReuse = true; - this.maxStack = 999; + this.shoot = 451; + this.shootSpeed = 11f; + this.knockBack = 4.5f; + this.width = 40; + this.height = 40; + this.damage = 110; + this.scale = 1.05f; + this.UseSound = SoundID.Item1; + this.rare = 8; + this.value = Item.sellPrice(gold: 10); + this.melee = true; + return; + case 2882: + this.useStyle = 5; + this.useAnimation = 20; + this.useTime = 20; + this.shootSpeed = 14f; + this.knockBack = 2f; + this.width = 16; + this.height = 16; + this.damage = 50; + this.UseSound = SoundID.Item13; + this.shoot = 460; + this.mana = 14; + this.rare = 8; + this.value = Item.sellPrice(gold: 10); + this.noMelee = true; + this.noUseGraphic = true; + this.magic = true; + this.channel = true; + this.glowMask = (short) 102; + return; + case 2883: + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = Item.sellPrice(gold: 1, silver: 50); + this.rare = 3; + this.glowMask = (short) 103; + return; + case 2884: + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = Item.sellPrice(gold: 1, silver: 50); + this.rare = 3; + this.glowMask = (short) 107; + return; + case 2885: + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.value = Item.sellPrice(gold: 1, silver: 50); + this.rare = 3; + this.glowMask = (short) 106; + return; + case 2886: + this.damage = 0; + this.useStyle = 1; + this.shootSpeed = 4f; + this.shoot = 463; + this.width = 16; + this.height = 24; + this.maxStack = 99; this.consumable = true; - this.createTile = 355; + this.UseSound = SoundID.Item1; + this.useAnimation = 15; + this.useTime = 15; + this.noMelee = true; + this.value = 100; + return; + case 2887: + this.width = 16; + this.height = 18; + this.maxStack = 99; + this.value = 50; + return; + case 2888: + this.useStyle = 5; + this.useAnimation = 23; + this.useTime = 23; this.width = 12; - this.height = 12; - this.value = 100000; + this.height = 28; + this.shoot = 469; + this.useAmmo = AmmoID.Arrow; + this.UseSound = SoundID.Item97; + this.damage = 26; + this.shootSpeed = 8f; + this.knockBack = 3f; + this.rare = 3; + this.noMelee = true; + this.value = 27000; + this.ranged = true; return; default: - return; + if (type >= 2889 && type <= 2895) + { + this.useStyle = 1; + this.autoReuse = true; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 999; + this.consumable = true; + this.width = 12; + this.height = 12; + this.makeNPC = (short) (442 + type - 2889); + this.noUseGraphic = true; + this.value = Item.sellPrice(gold: 10); + this.rare = 2; + if (type != 2895 && type != 2893 && type != 2891) + return; + this.bait = 50; + return; + } + if (type == 2896) + { + this.useStyle = 1; + this.shootSpeed = 4f; + this.shoot = 470; + this.width = 8; + this.height = 28; + this.maxStack = 30; + this.consumable = true; + this.UseSound = SoundID.Item1; + this.useAnimation = 40; + this.useTime = 40; + this.noUseGraphic = true; + this.noMelee = true; + this.value = Item.buyPrice(silver: 20); + this.rare = 1; + return; + } + if (type >= 2897 && type <= 2994) + { + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 91; + this.placeStyle = 109 + type - 2897; + this.width = 10; + this.height = 24; + this.value = 1000; + this.rare = 1; + return; + } + switch (type) + { + case 2995: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 242; + this.width = 30; + this.height = 30; + this.value = Item.sellPrice(silver: 10); + this.placeStyle = 30; + return; + case 2996: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 8; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 353; + this.width = 12; + this.height = 12; + this.tileBoost += 3; + return; + case 2997: + this.maxStack = 30; + this.consumable = true; + this.width = 14; + this.height = 24; + this.value = 1000; + this.rare = 1; + return; + case 2998: + this.width = 24; + this.height = 24; + this.accessory = true; + this.value = 100000; + this.rare = 4; + return; + case 2999: + this.rare = 1; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 354; + this.width = 12; + this.height = 12; + this.value = 100000; + return; + case 3000: + this.rare = 1; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 355; + this.width = 12; + this.height = 12; + this.value = 100000; + return; + default: + return; + } } } } @@ -29918,16 +29723,6 @@ namespace Terraria } } - private void DefaultToQuestFish() - { - this.questItem = true; - this.maxStack = 1; - this.width = 26; - this.height = 26; - this.uniqueStack = true; - this.rare = -11; - } - public void SetDefaults4(int type) { switch (type) @@ -29937,7 +29732,7 @@ namespace Terraria this.UseSound = SoundID.Item3; this.healLife = 80; this.healMana = 400; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -29957,7 +29752,7 @@ namespace Terraria this.shoot = 473; this.width = 12; this.height = 12; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.UseSound = SoundID.Item1; this.useAnimation = 15; @@ -29988,7 +29783,7 @@ namespace Terraria this.useTime = 10; this.holdStyle = 1; this.autoReuse = true; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 4; this.placeStyle = 13; @@ -30038,10 +29833,10 @@ namespace Terraria this.shoot = 10; this.useAmmo = AmmoID.Dart; this.UseSound = SoundID.Item98; - this.damage = 33; + this.damage = 28; this.shootSpeed = 13f; this.noMelee = true; - this.value = Item.sellPrice(gold: 8); + this.value = Item.sellPrice(gold: 5); this.knockBack = 3.5f; this.useAmmo = AmmoID.Dart; this.ranged = true; @@ -30058,10 +29853,10 @@ namespace Terraria this.shoot = 10; this.useAmmo = AmmoID.Dart; this.UseSound = SoundID.Item99; - this.damage = 62; + this.damage = 52; this.shootSpeed = 14.5f; this.noMelee = true; - this.value = Item.sellPrice(gold: 8); + this.value = Item.sellPrice(gold: 5); this.knockBack = 5.5f; this.useAmmo = AmmoID.Dart; this.ranged = true; @@ -30074,12 +29869,11 @@ namespace Terraria this.height = 8; this.maxStack = 999; this.ammo = AmmoID.Dart; - this.damage = 14; + this.damage = 15; this.knockBack = 3.5f; this.shootSpeed = 1f; this.ranged = true; this.rare = 3; - this.value = Item.sellPrice(copper: 6); this.consumable = true; break; case 3010: @@ -30088,12 +29882,11 @@ namespace Terraria this.height = 8; this.maxStack = 999; this.ammo = AmmoID.Dart; - this.damage = 10; + this.damage = 9; this.knockBack = 2.2f; this.shootSpeed = 3f; this.ranged = true; this.rare = 3; - this.value = Item.sellPrice(copper: 6); this.consumable = true; break; case 3011: @@ -30102,12 +29895,11 @@ namespace Terraria this.height = 8; this.maxStack = 999; this.ammo = AmmoID.Dart; - this.damage = 12; + this.damage = 10; this.knockBack = 2.5f; this.shootSpeed = 3f; this.ranged = true; this.rare = 3; - this.value = Item.sellPrice(copper: 6); this.consumable = true; break; case 3012: @@ -30124,20 +29916,19 @@ namespace Terraria this.shootSpeed = 14f; this.UseSound = SoundID.Item1; this.rare = 5; - this.value = Item.sellPrice(gold: 8); + this.value = 1000; this.melee = true; this.noUseGraphic = true; - this.noMelee = true; break; case 3013: this.useStyle = 1; this.useTurn = true; this.autoReuse = true; - this.useAnimation = 8; - this.useTime = 8; + this.useAnimation = 7; + this.useTime = 7; this.width = 24; this.height = 28; - this.damage = 60; + this.damage = 70; this.knockBack = 6f; this.UseSound = SoundID.Item1; this.scale = 1.35f; @@ -30184,7 +29975,7 @@ namespace Terraria this.height = 24; this.accessory = true; this.rare = 7; - this.value = Item.sellPrice(gold: 6); + this.value = Item.sellPrice(gold: 8); this.shoeSlot = (sbyte) 16; break; case 3018: @@ -30206,18 +29997,18 @@ namespace Terraria case 3019: this.autoReuse = true; this.useStyle = 5; - this.useAnimation = 13; - this.useTime = 13; + this.useAnimation = 14; + this.useTime = 14; this.width = 18; this.height = 46; this.shoot = 485; this.useAmmo = AmmoID.Arrow; this.UseSound = SoundID.Item5; - this.damage = 22; - this.knockBack = 5.5f; + this.damage = 20; + this.knockBack = 5f; this.shootSpeed = 6f; this.noMelee = true; - this.value = this.hellPrice; + this.value = Item.sellPrice(gold: 4); this.rare = 3; this.ranged = true; break; @@ -30258,10 +30049,7 @@ namespace Terraria this.useTime = 20; this.rare = 6; this.noMelee = true; - this.value = Item.sellPrice(gold: 6); - if (type != 3021) - break; - this.shootSpeed = 16f; + this.value = Item.sellPrice(gold: 8); break; } switch (type) @@ -30297,7 +30085,7 @@ namespace Terraria this.shoot = 1; this.useAmmo = AmmoID.Arrow; this.UseSound = SoundID.Item5; - this.damage = 38; + this.damage = 43; this.shootSpeed = 12.5f; this.noMelee = true; this.value = Item.sellPrice(gold: 8); @@ -30473,7 +30261,6 @@ namespace Terraria this.rare = 4; this.value = 100000; this.accessory = true; - this.canBePlacedInVanityRegardlessOfConditions = true; return; case 3045: this.flame = true; @@ -30484,13 +30271,13 @@ namespace Terraria this.useTime = 10; this.holdStyle = 1; this.autoReuse = true; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 4; this.placeStyle = 14; this.width = 10; this.height = 12; - this.value = 250; + this.value = 500; this.rare = 1; return; default: @@ -30513,12 +30300,13 @@ namespace Terraria { case 3051: this.mana = 13; - this.damage = 25; + this.damage = 19; this.useStyle = 5; this.shootSpeed = 32f; this.shoot = 494; this.width = 26; this.height = 28; + this.UseSound = SoundID.Item101; this.useAnimation = 33; this.useTime = 33; this.rare = 5; @@ -30631,7 +30419,7 @@ namespace Terraria this.useTime = 20; this.rare = 1; this.noMelee = true; - this.value = this.shadowOrbPrice; + this.value = 10000; this.buffType = 155; return; case 3063: @@ -30711,24 +30499,23 @@ namespace Terraria this.height = 24; this.accessory = true; this.rare = 1; - this.value = Item.sellPrice(silver: 50); + this.value = 50000; return; case 3069: this.mana = 2; - this.damage = 14; + this.damage = 8; this.useStyle = 1; this.shootSpeed = 7f; this.shoot = 504; this.width = 26; this.height = 28; this.UseSound = SoundID.Item8; - this.useAnimation = 26; - this.useTime = 26; + this.useAnimation = 28; + this.useTime = 28; this.rare = 1; this.noMelee = true; this.value = 5000; this.magic = true; - this.crit = 10; return; default: if (type >= 3070 && type <= 3076) @@ -30744,7 +30531,7 @@ namespace Terraria this.width = 12; this.height = 12; this.value = Item.sellPrice(gold: 10); - this.rare = 3; + this.rare = 2; return; } switch (type) @@ -30850,7 +30637,7 @@ namespace Terraria this.height = 18; this.accessory = true; this.rare = 1; - this.value = Item.sellPrice(silver: 50); + this.value = Item.sellPrice(gold: 1); return; case 3085: this.width = 12; @@ -30949,8 +30736,7 @@ namespace Terraria this.noUseGraphic = true; this.noMelee = true; this.knockBack = 4.75f; - this.value = Item.sellPrice(copper: 5); - this.ranged = true; + this.thrown = true; return; case 3095: this.width = 24; @@ -30965,7 +30751,7 @@ namespace Terraria this.width = 24; this.height = 28; this.rare = 1; - this.value = Item.sellPrice(gold: 2); + this.value = Item.sellPrice(silver: 30); this.accessory = true; this.defense = 2; this.shieldSlot = (sbyte) 5; @@ -30985,7 +30771,7 @@ namespace Terraria this.UseSound = SoundID.Item23; this.shoot = 509; this.rare = 8; - this.value = this.eclipsePostPlanteraPrice; + this.value = Item.sellPrice(gold: 4); this.noMelee = true; this.noUseGraphic = true; this.melee = true; @@ -31037,7 +30823,7 @@ namespace Terraria this.height = 26; this.ammo = AmmoID.Arrow; this.knockBack = 2f; - this.value = Item.sellPrice(gold: 1); + this.value = Item.sellPrice(gold: 2); this.ranged = true; this.rare = 2; return; @@ -31049,7 +30835,7 @@ namespace Terraria this.height = 26; this.ammo = AmmoID.Bullet; this.knockBack = 2f; - this.value = Item.sellPrice(gold: 1); + this.value = Item.sellPrice(gold: 2); this.ranged = true; this.rare = 2; return; @@ -31069,21 +30855,21 @@ namespace Terraria this.useTime = 28; this.noUseGraphic = true; this.noMelee = true; - this.value = this.eclipsePostPlanteraPrice; + this.value = Item.sellPrice(gold: 2); return; case 3106: this.autoReuse = true; this.useStyle = 1; - this.useAnimation = 8; - this.useTime = 8; + this.useAnimation = 20; + this.useTime = 20; this.knockBack = 3.5f; this.width = 30; this.height = 30; - this.damage = 85; + this.damage = 70; this.scale = 1.1f; this.UseSound = SoundID.Item1; this.rare = 8; - this.value = this.eclipsePostPlanteraPrice; + this.value = Item.sellPrice(gold: 5); this.melee = true; return; case 3107: @@ -31099,7 +30885,7 @@ namespace Terraria this.damage = 85; this.shootSpeed = 10f; this.noMelee = true; - this.value = this.eclipsePostPlanteraPrice; + this.value = Item.sellPrice(gold: 10); this.rare = 8; this.ranged = true; return; @@ -31120,10 +30906,10 @@ namespace Terraria case 3109: this.width = 22; this.height = 22; - this.defense = 4; + this.defense = 2; this.headSlot = 179; - this.rare = 2; - this.value = Item.sellPrice(gold: 1); + this.rare = 3; + this.value = Item.sellPrice(gold: 2); return; case 3110: this.width = 16; @@ -31131,7 +30917,6 @@ namespace Terraria this.accessory = true; this.rare = 8; this.value = 700000; - this.canBePlacedInVanityRegardlessOfConditions = true; return; case 3111: this.width = 10; @@ -31147,7 +30932,7 @@ namespace Terraria this.shoot = 515; this.width = 12; this.height = 12; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.UseSound = SoundID.Item1; this.useAnimation = 15; @@ -31173,7 +30958,7 @@ namespace Terraria this.noWet = true; this.holdStyle = 1; this.autoReuse = true; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; this.createTile = 4; this.placeStyle = 15; @@ -31217,7 +31002,7 @@ namespace Terraria this.value = 100; this.damage = 65; this.knockBack = 8f; - this.ranged = true; + this.thrown = true; return; case 3117: this.flame = true; @@ -31233,7 +31018,6 @@ namespace Terraria this.useTime = 10; this.autoReuse = true; this.maxStack = 99; - this.value = Item.sellPrice(silver: 1); this.consumable = true; return; default: @@ -31337,8 +31121,8 @@ namespace Terraria this.UseSound = SoundID.Item111; this.useStyle = 5; this.damage = 43; - this.useAnimation = 10; - this.useTime = 10; + this.useAnimation = 14; + this.useTime = 14; this.width = 30; this.height = 28; this.shoot = 523; @@ -31510,7 +31294,6 @@ namespace Terraria this.createTile = 33; this.width = 8; this.height = 18; - this.value = Item.sellPrice(copper: 60); switch (type) { case 3171: @@ -31538,7 +31321,6 @@ namespace Terraria this.createTile = 15; this.width = 12; this.height = 30; - this.value = 150; switch (type) { case 3174: @@ -31721,356 +31503,438 @@ namespace Terraria return; } } + else if (type == 3138 || type == 3139 || type == 3140) + { + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 42; + this.width = 12; + this.height = 28; + switch (type) + { + case 3138: + this.placeStyle = 34; + return; + case 3139: + this.placeStyle = 36; + return; + case 3140: + this.placeStyle = 35; + return; + default: + return; + } + } + else if (type == 3141 || type == 3142 || type == 3143) + { + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 87; + this.width = 20; + this.height = 20; + this.value = 300; + switch (type) + { + case 3141: + this.placeStyle = 27; + return; + case 3142: + this.placeStyle = 29; + return; + case 3143: + this.placeStyle = 28; + return; + default: + return; + } + } + else if (type == 3144 || type == 3145 || type == 3146) + { + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 19; + this.width = 8; + this.height = 10; + switch (type) + { + case 3144: + this.placeStyle = 27; + return; + case 3145: + this.placeStyle = 29; + return; + case 3146: + this.placeStyle = 28; + return; + default: + return; + } + } + else if (type == 3147 || type == 3148 || type == 3149) + { + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 172; + this.width = 20; + this.height = 20; + this.value = 300; + switch (type) + { + case 3147: + this.placeStyle = 29; + return; + case 3148: + this.placeStyle = 31; + return; + case 3149: + this.placeStyle = 30; + return; + default: + return; + } + } + else if (type == 3150 || type == 3151 || type == 3152) + { + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 89; + this.width = 20; + this.height = 20; + this.value = 300; + switch (type) + { + case 3150: + this.placeStyle = 30; + return; + case 3151: + this.placeStyle = 32; + return; + case 3152: + this.placeStyle = 31; + return; + default: + return; + } + } + else if (type == 3153 || type == 3154 || type == 3155) + { + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 14; + this.width = 26; + this.height = 20; + this.value = 300; + switch (type) + { + case 3153: + this.placeStyle = 32; + return; + case 3154: + this.placeStyle = 34; + return; + case 3155: + this.placeStyle = 33; + return; + default: + return; + } + } + else if (type == 3156 || type == 3157 || type == 3158) + { + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 18; + this.width = 28; + this.height = 14; + this.value = 150; + switch (type) + { + case 3156: + this.placeStyle = 28; + return; + case 3157: + this.placeStyle = 30; + return; + case 3158: + this.placeStyle = 29; + return; + default: + return; + } + } else { - if (type == 3138 || type == 3139 || type == 3140) + switch (type) { - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 42; - this.width = 12; - this.height = 28; - switch (type) - { - case 3138: - this.placeStyle = 34; - break; - case 3139: - this.placeStyle = 36; - break; - case 3140: - this.placeStyle = 35; - break; - } - this.value = 150; - return; - } - if (type == 3141 || type == 3142 || type == 3143) - { - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 87; - this.width = 20; - this.height = 20; - this.value = 300; - switch (type) - { - case 3141: - this.placeStyle = 27; - return; - case 3142: - this.placeStyle = 29; - return; - case 3143: - this.placeStyle = 28; - return; - default: - return; - } - } - else if (type == 3144 || type == 3145 || type == 3146) - { - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 19; - this.width = 8; - this.height = 10; - switch (type) - { - case 3144: - this.placeStyle = 27; - return; - case 3145: - this.placeStyle = 29; - return; - case 3146: - this.placeStyle = 28; - return; - default: - return; - } - } - else if (type == 3147 || type == 3148 || type == 3149) - { - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 172; - this.width = 20; - this.height = 20; - this.value = 300; - switch (type) - { - case 3147: - this.placeStyle = 29; - return; - case 3148: - this.placeStyle = 31; - return; - case 3149: - this.placeStyle = 30; - return; - default: - return; - } - } - else if (type == 3150 || type == 3151 || type == 3152) - { - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 89; - this.width = 20; - this.height = 20; - this.value = 300; - switch (type) - { - case 3150: - this.placeStyle = 30; - return; - case 3151: - this.placeStyle = 32; - return; - case 3152: - this.placeStyle = 31; - return; - default: - return; - } - } - else if (type == 3153 || type == 3154 || type == 3155) - { - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 14; - this.width = 26; - this.height = 20; - this.value = 300; - switch (type) - { - case 3153: - this.placeStyle = 32; - return; - case 3154: - this.placeStyle = 34; - return; - case 3155: - this.placeStyle = 33; - return; - default: - return; - } - } - else if (type == 3156 || type == 3157 || type == 3158) - { - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 18; - this.width = 28; - this.height = 14; - this.value = 150; - switch (type) - { - case 3156: - this.placeStyle = 28; - return; - case 3157: - this.placeStyle = 30; - return; - case 3158: - this.placeStyle = 29; - return; - default: - return; - } - } - else - { - switch (type) - { - case 3182: + case 3182: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 373; + this.width = 24; + this.height = 24; + this.value = Item.sellPrice(silver: 1); + return; + case 3183: + this.useTurn = true; + this.useStyle = 1; + this.useAnimation = 18; + this.width = 24; + this.height = 28; + this.UseSound = SoundID.Item1; + this.value = Item.sellPrice(gold: 5); + this.autoReuse = true; + this.rare = 4; + this.scale = 1.15f; + return; + case 3184: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 374; + this.width = 24; + this.height = 24; + this.value = Item.sellPrice(silver: 1); + return; + case 3185: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 375; + this.width = 24; + this.height = 24; + this.value = Item.sellPrice(silver: 1); + return; + case 3186: + this.maxStack = 999; + this.width = 24; + this.height = 24; + this.value = Item.buyPrice(silver: 1); + return; + case 3187: + this.width = 18; + this.height = 18; + this.defense = 2; + this.headSlot = 180; + this.value = 20000; + return; + case 3188: + this.width = 18; + this.height = 18; + this.defense = 3; + this.bodySlot = 182; + this.value = 16000; + return; + case 3189: + this.width = 18; + this.height = 18; + this.defense = 2; + this.legSlot = 122; + this.value = 12000; + return; + default: + if (type >= 3191 && type <= 3194) + { this.useStyle = 1; + this.autoReuse = true; this.useTurn = true; this.useAnimation = 15; this.useTime = 10; - this.autoReuse = true; this.maxStack = 999; this.consumable = true; - this.createTile = 373; - this.width = 24; - this.height = 24; - this.value = Item.sellPrice(copper: 40); - return; - case 3183: - this.useTurn = true; - this.useStyle = 1; - this.useAnimation = 18; - this.width = 24; - this.height = 28; - this.UseSound = SoundID.Item1; - this.value = Item.sellPrice(gold: 5); - this.autoReuse = true; - this.rare = 4; - this.scale = 1.15f; - return; - case 3184: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 374; - this.width = 24; - this.height = 24; - this.value = Item.sellPrice(copper: 40); - return; - case 3185: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 375; - this.width = 24; - this.height = 24; - this.value = Item.sellPrice(copper: 40); - return; - case 3186: - this.maxStack = 999; - this.width = 24; - this.height = 24; - this.value = Item.buyPrice(silver: 1); - return; - case 3187: - this.width = 18; - this.height = 18; - this.defense = 3; - this.headSlot = 180; - this.value = 17500; - return; - case 3188: - this.width = 18; - this.height = 18; - this.defense = 4; - this.bodySlot = 182; - this.value = 14000; - return; - case 3189: - this.width = 18; - this.height = 18; - this.defense = 3; - this.legSlot = 122; - this.value = 10500; - return; - default: - if (type >= 3191 && type <= 3194) + this.width = 12; + this.height = 12; + this.makeNPC = (short) (484 + type - 3191); + this.noUseGraphic = true; + switch (type) { - this.useStyle = 1; - this.autoReuse = true; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.maxStack = 999; - this.consumable = true; - this.width = 12; - this.height = 12; - this.makeNPC = (short) (484 + type - 3191); - this.noUseGraphic = true; - switch (type) - { - case 3192: - this.bait = 15; - return; - case 3193: - this.bait = 25; - return; - case 3194: - this.bait = 40; - return; - default: - this.bait = 35; - return; - } + case 3192: + this.bait = 15; + return; + case 3193: + this.bait = 25; + return; + case 3194: + this.bait = 40; + return; + default: + this.bait = 35; + return; } - else + } + else + { + switch (type) { - switch (type) - { - case 3196: - this.useStyle = 1; - this.shootSpeed = 6f; - this.shoot = 519; - this.width = 26; - this.height = 26; - this.maxStack = 99; - this.consumable = true; - this.UseSound = SoundID.Item1; - this.useAnimation = 25; - this.useTime = 25; - this.noUseGraphic = true; - this.noMelee = true; - this.value = Item.sellPrice(silver: 2); - this.damage = 0; - this.rare = 1; - return; - case 3197: - this.rare = 1; - this.useStyle = 1; - this.shootSpeed = 12.5f; - this.shoot = 520; - this.damage = 17; - this.width = 28; - this.height = 28; - this.maxStack = 999; - this.consumable = true; - this.UseSound = SoundID.Item1; - this.useAnimation = 13; - this.useTime = 13; - this.noUseGraphic = true; - this.noMelee = true; - this.value = 80; - this.knockBack = 3.5f; - this.ranged = true; - return; - case 3198: - this.rare = 1; + case 3195: + this.UseSound = SoundID.Item3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 10; + this.height = 10; + this.buffType = 26; + this.buffTime = 108000; + this.rare = 1; + this.value = 1000; + return; + case 3196: + this.useStyle = 1; + this.shootSpeed = 6f; + this.shoot = 519; + this.width = 26; + this.height = 26; + this.maxStack = 99; + this.consumable = true; + this.UseSound = SoundID.Item1; + this.useAnimation = 25; + this.useTime = 25; + this.noUseGraphic = true; + this.noMelee = true; + this.value = Item.sellPrice(silver: 2); + this.damage = 0; + this.rare = 1; + return; + case 3197: + this.rare = 1; + this.useStyle = 1; + this.shootSpeed = 12.5f; + this.shoot = 520; + this.damage = 17; + this.width = 28; + this.height = 28; + this.maxStack = 999; + this.consumable = true; + this.UseSound = SoundID.Item1; + this.useAnimation = 13; + this.useTime = 13; + this.noUseGraphic = true; + this.noMelee = true; + this.value = 80; + this.knockBack = 3.5f; + this.thrown = true; + return; + case 3198: + this.rare = 1; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 377; + this.width = 28; + this.height = 22; + this.value = 100000; + return; + case 3199: + this.useTurn = true; + this.width = 20; + this.height = 20; + this.useStyle = 4; + this.useTime = 90; + this.UseSound = SoundID.Item6; + this.useAnimation = 90; + this.rare = 1; + this.value = 50000; + return; + case 3200: + this.width = 28; + this.height = 24; + this.accessory = true; + this.rare = 1; + this.value = 50000; + this.shoeSlot = (sbyte) 17; + return; + case 3201: + this.width = 16; + this.height = 24; + this.accessory = true; + this.rare = 1; + this.value = 50000; + this.waistSlot = (sbyte) 11; + return; + case 3202: + this.rare = 1; + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 378; + this.width = 20; + this.height = 30; + this.value = Item.sellPrice(silver: 1); + return; + case 3214: + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 379; + this.width = 12; + this.height = 12; + this.value = Item.buyPrice(silver: 2); + return; + default: + if (type >= 3215 && type <= 3222) + { this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; @@ -32078,150 +31942,123 @@ namespace Terraria this.autoReuse = true; this.maxStack = 999; this.consumable = true; - this.createTile = 377; - this.width = 28; - this.height = 22; - this.value = 100000; - return; - case 3199: - this.useTurn = true; - this.width = 20; + this.createTile = 380; + this.placeStyle = type - 3215; + this.width = 24; this.height = 20; - this.useStyle = 4; - this.useTime = 90; - this.UseSound = SoundID.Item6; - this.useAnimation = 90; - this.rare = 1; - this.value = 50000; + this.value = Item.buyPrice(silver: 1); return; - case 3200: - this.width = 28; - this.height = 24; - this.accessory = true; - this.rare = 1; - this.value = 50000; - this.shoeSlot = (sbyte) 17; - return; - case 3201: - this.width = 16; - this.height = 24; - this.accessory = true; - this.rare = 1; - this.value = 50000; - this.waistSlot = (sbyte) 11; - return; - case 3202: - this.rare = 1; - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 378; - this.width = 20; - this.height = 30; - this.value = Item.sellPrice(silver: 1); - return; - case 3214: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 379; - this.width = 12; - this.height = 12; - this.value = Item.buyPrice(silver: 2); - return; - default: - if (type >= 3215 && type <= 3222) - { - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 380; - this.placeStyle = type - 3215; - this.width = 24; - this.height = 20; - this.value = Item.buyPrice(silver: 1); + } + switch (type) + { + case 3223: + this.width = 22; + this.height = 22; + this.accessory = true; + this.rare = 1; + this.value = 50000; + this.expert = true; return; - } - switch (type) - { - case 3223: - this.width = 22; - this.height = 22; - this.accessory = true; - this.rare = 1; - this.value = 100000; - this.expert = true; - return; - case 3224: - this.width = 22; - this.height = 22; - this.accessory = true; - this.rare = 1; - this.value = 100000; - this.neckSlot = (sbyte) 8; - this.expert = true; - return; - case 3225: - this.width = 14; - this.height = 28; - this.rare = 1; - this.value = Item.sellPrice(gold: 2, silver: 50); - this.accessory = true; - this.balloonSlot = (sbyte) 11; - return; - case 3226: - this.width = 28; + case 3224: + this.width = 22; + this.height = 22; + this.accessory = true; + this.rare = 1; + this.value = 50000; + this.neckSlot = (sbyte) 8; + this.expert = true; + return; + case 3225: + this.width = 14; + this.height = 28; + this.rare = 1; + this.value = 27000; + this.accessory = true; + this.balloonSlot = (sbyte) 11; + return; + case 3226: + this.width = 28; + this.height = 20; + this.headSlot = 181; + this.rare = 9; + this.vanity = true; + return; + case 3227: + this.width = 18; + this.height = 14; + this.bodySlot = 183; + this.rare = 9; + this.vanity = true; + return; + case 3228: + this.width = 24; + this.height = 8; + this.accessory = true; + this.rare = 9; + this.wingSlot = (sbyte) 28; + this.value = 400000; + return; + default: + if (type >= 3229 && type <= 3233) + { + this.useTurn = true; + this.useStyle = 1; + this.useAnimation = 15; + this.useTime = 10; + this.maxStack = 99; + this.consumable = true; + this.createTile = 85; + this.placeStyle = 6 + type - 3229; + this.width = 20; this.height = 20; - this.headSlot = 181; - this.rare = 9; - this.vanity = true; - this.value = Item.sellPrice(gold: 5); return; - case 3227: - this.width = 18; - this.height = 14; - this.bodySlot = 183; - this.rare = 9; - this.vanity = true; - this.value = Item.sellPrice(gold: 5); + } + if (type == 3234) + { + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 999; + this.consumable = true; + this.createTile = 385; + this.width = 12; + this.height = 12; return; - case 3228: + } + if (type >= 3235 && type <= 3237) + { + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.consumable = true; + this.createTile = 139; + this.placeStyle = 33 + type - 3235; this.width = 24; - this.height = 8; + this.height = 24; + this.rare = 4; + this.value = 100000; this.accessory = true; - this.rare = 9; - this.wingSlot = (sbyte) 28; - this.value = 400000; return; - default: - if (type >= 3229 && type <= 3233) - { - this.useTurn = true; + } + switch (type) + { + case 3238: this.useStyle = 1; + this.useTurn = true; this.useAnimation = 15; - this.useTime = 10; - this.maxStack = 99; + this.useTime = 7; + this.autoReuse = true; + this.maxStack = 999; this.consumable = true; - this.createTile = 85; - this.placeStyle = 6 + type - 3229; - this.width = 20; - this.height = 20; + this.createWall = 186; + this.width = 12; + this.height = 12; return; - } - if (type == 3234) - { + case 3239: this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; @@ -32229,257 +32066,354 @@ namespace Terraria this.autoReuse = true; this.maxStack = 999; this.consumable = true; - this.createTile = 385; - this.width = 12; + this.createTile = 387; + this.width = 20; this.height = 12; return; - } - if (type >= 3235 && type <= 3237) - { + case 3240: this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; this.useTime = 10; this.autoReuse = true; + this.maxStack = 999; this.consumable = true; - this.createTile = 139; - this.placeStyle = 33 + type - 3235; - this.width = 24; - this.height = 24; - this.rare = 4; - this.value = 100000; - this.accessory = true; - this.canBePlacedInVanityRegardlessOfConditions = true; + this.createTile = 388; + this.width = 18; + this.height = 26; return; - } - switch (type) - { - case 3238: + case 3241: + this.width = 14; + this.height = 28; + this.rare = 1; + this.value = 27000; + this.accessory = true; + this.balloonSlot = (sbyte) 12; + return; + case 3242: + this.width = 18; + this.height = 18; + this.value = Item.buyPrice(gold: 3); + this.vanity = true; + this.headSlot = 182; + return; + case 3243: + this.width = 18; + this.height = 18; + this.value = Item.buyPrice(gold: 3); + this.vanity = true; + this.bodySlot = 184; + return; + case 3244: + this.width = 18; + this.height = 18; + this.value = Item.buyPrice(gold: 3); + this.vanity = true; + this.legSlot = 124; + return; + case 3245: + this.width = 16; + this.height = 16; + this.value = Item.sellPrice(gold: 1); + this.useAnimation = 17; + this.useTime = 17; + this.useStyle = 1; + this.UseSound = SoundID.Item1; + this.noMelee = true; + this.shootSpeed = 1f; + this.damage = 11; + this.knockBack = 1.8f; + this.shoot = 21; + this.thrown = true; + this.rare = 2; + this.useAmmo = 154; + this.noUseGraphic = true; + this.expert = true; + return; + case 3246: + this.width = 18; + this.height = 18; + this.value = Item.buyPrice(gold: 3); + this.vanity = true; + this.bodySlot = 185; + return; + case 3247: + this.width = 18; + this.height = 18; + this.value = Item.buyPrice(gold: 3); + this.vanity = true; + this.legSlot = 125; + return; + case 3248: + this.width = 18; + this.height = 18; + this.value = Item.buyPrice(gold: 3); + this.vanity = true; + this.headSlot = 183; + return; + case 3249: + this.mana = 10; + this.damage = 50; + this.useStyle = 1; + this.shootSpeed = 10f; + this.shoot = 533; + this.buffType = 161; + this.width = 26; + this.height = 28; + this.UseSound = SoundID.Item113; + this.useAnimation = 36; + this.useTime = 36; + this.rare = 8; + this.noMelee = true; + this.knockBack = 2f; + this.value = Item.sellPrice(gold: 5); + this.summon = true; + return; + default: + if (type == 3250 || type == 3251 || type == 3252) + { + this.width = 20; + this.height = 22; + this.rare = 4; + this.value = 45000; + this.accessory = true; + this.balloonSlot = (sbyte) (13 + type - 3250); + return; + } + if (type == 3253) + { this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; - this.useTime = 7; + this.useTime = 10; this.autoReuse = true; - this.maxStack = 999; + this.maxStack = 99; this.consumable = true; - this.createWall = 186; + this.createTile = 390; + this.width = 12; + this.height = 30; + this.value = Item.buyPrice(gold: 2); + this.rare = 1; + this.glowMask = (short) 129; + return; + } + if (type >= 3254 && type <= 3257) + { + this.useStyle = 1; + this.useTurn = true; + this.useAnimation = 15; + this.useTime = 10; + this.autoReuse = true; + this.maxStack = 99; + this.consumable = true; + this.createTile = 391 + type - 3254; this.width = 12; this.height = 12; return; - case 3239: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 387; - this.width = 20; - this.height = 12; - return; - case 3240: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 388; - this.width = 18; - this.height = 26; - return; - case 3241: - this.width = 14; - this.height = 28; - this.rare = 1; - this.value = Item.sellPrice(gold: 3); - this.accessory = true; - this.balloonSlot = (sbyte) 12; - return; - case 3242: - this.width = 18; - this.height = 18; - this.value = Item.buyPrice(gold: 3); - this.vanity = true; - this.headSlot = 182; - return; - case 3243: - this.width = 18; - this.height = 18; - this.value = Item.buyPrice(gold: 3); - this.vanity = true; - this.bodySlot = 184; - return; - case 3244: - this.width = 18; - this.height = 18; - this.value = Item.buyPrice(gold: 3); - this.vanity = true; - this.legSlot = 124; - return; - case 3245: - this.width = 16; - this.height = 16; - this.value = Item.sellPrice(gold: 2); - this.useAnimation = 17; - this.useTime = 17; - this.useStyle = 1; - this.UseSound = SoundID.Item1; - this.noMelee = true; - this.shootSpeed = 1f; - this.damage = 11; - this.knockBack = 1.8f; - this.shoot = 21; - this.ranged = true; - this.rare = 2; - this.useAmmo = 154; - this.noUseGraphic = true; - this.expert = true; - return; - case 3246: - this.width = 18; - this.height = 18; - this.value = Item.buyPrice(gold: 3); - this.vanity = true; - this.bodySlot = 185; - return; - case 3247: - this.width = 18; - this.height = 18; - this.value = Item.buyPrice(gold: 3); - this.vanity = true; - this.legSlot = 125; - return; - case 3248: - this.width = 18; - this.height = 18; - this.value = Item.buyPrice(gold: 3); - this.vanity = true; - this.headSlot = 183; - return; - case 3249: - this.mana = 10; - this.damage = 50; - this.useStyle = 1; - this.shootSpeed = 10f; - this.shoot = 533; - this.buffType = 161; - this.width = 26; - this.height = 28; - this.UseSound = SoundID.Item113; - this.useAnimation = 36; - this.useTime = 36; - this.rare = 8; - this.noMelee = true; - this.knockBack = 2f; - this.value = this.eclipsePostPlanteraPrice; - this.summon = true; - return; - default: - if (type == 3250 || type == 3251 || type == 3252) - { - this.width = 20; - this.height = 22; + } + switch (type) + { + case 3258: + this.useStyle = 1; + this.useAnimation = 21; + this.useTime = 21; + this.autoReuse = true; + this.knockBack = 20f; + this.width = 36; + this.height = 36; + this.damage = 35; + this.scale = 1.1f; + this.UseSound = SoundID.Item1; this.rare = 4; - this.value = Item.buyPrice(gold: 15); - this.accessory = true; - this.balloonSlot = (sbyte) (13 + type - 3250); + this.value = Item.buyPrice(gold: 25); + this.melee = true; + this.crit = 15; return; - } - if (type == 3253) - { + case 3259: + this.width = 20; + this.height = 26; + this.maxStack = 99; + this.rare = 3; + this.value = Item.buyPrice(gold: 30); + this.UseSound = SoundID.Item3; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.consumable = true; + return; + case 3260: + this.useStyle = 4; + this.channel = true; + this.width = 34; + this.height = 34; + this.UseSound = SoundID.Item25; + this.useAnimation = 20; + this.useTime = 20; + this.rare = 8; + this.noMelee = true; + this.mountType = 10; + this.value = Item.sellPrice(gold: 5); + return; + case 3261: + this.width = 20; + this.height = 20; + this.maxStack = 99; + this.rare = 7; + this.value = Item.sellPrice(gold: 1); this.useStyle = 1; this.useTurn = true; this.useAnimation = 15; this.useTime = 10; this.autoReuse = true; - this.maxStack = 99; this.consumable = true; - this.createTile = 390; - this.width = 12; - this.height = 30; - this.value = Item.buyPrice(gold: 2); - this.rare = 1; - this.glowMask = (short) 129; + this.createTile = 239; + this.placeStyle = 21; return; - } - if (type >= 3254 && type <= 3257) - { - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 391 + type - 3254; - this.width = 12; - this.height = 12; - return; - } - switch (type) - { - case 3258: - this.useStyle = 1; - this.useAnimation = 21; - this.useTime = 21; - this.autoReuse = true; - this.knockBack = 20f; - this.width = 36; - this.height = 36; - this.damage = 35; - this.scale = 1.1f; + default: + if (type == 3262 || type >= 3278 && type <= 3292 || type >= 3315 && type <= 3317) + { + this.useStyle = 5; + this.width = 24; + this.height = 24; + this.noUseGraphic = true; this.UseSound = SoundID.Item1; - this.rare = 4; - this.value = Item.buyPrice(gold: 25); this.melee = true; - this.crit = 15; - return; - case 3259: - this.width = 20; - this.height = 26; - this.maxStack = 99; - this.rare = 3; - this.value = Item.buyPrice(gold: 30); - this.UseSound = SoundID.Item3; - this.useStyle = 9; - this.useTurn = true; - this.useAnimation = 17; - this.useTime = 17; - this.consumable = true; - return; - case 3260: - this.useStyle = 4; this.channel = true; - this.width = 34; - this.height = 34; - this.UseSound = SoundID.Item25; - this.useAnimation = 20; - this.useTime = 20; - this.rare = 8; this.noMelee = true; - this.mountType = 10; - this.value = Item.sellPrice(gold: 5); - return; - case 3261: - this.width = 20; - this.height = 20; - this.maxStack = 999; - this.rare = 7; - this.value = Item.sellPrice(gold: 1); - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.consumable = true; - this.createTile = 239; - this.placeStyle = 21; - return; - default: - if (type == 3262 || type >= 3278 && type <= 3292 || type >= 3315 && type <= 3317) + this.shoot = 541 + type - 3278; + this.useAnimation = 25; + this.useTime = 25; + this.shootSpeed = 16f; + switch (type) + { + case 3262: + this.knockBack = 3.25f; + this.damage = 21; + this.value = Item.buyPrice(gold: 5); + this.rare = 2; + this.shoot = 534; + return; + case 3278: + this.knockBack = 2.5f; + this.damage = 9; + this.value = Item.sellPrice(silver: 1); + this.rare = 0; + return; + case 3279: + this.knockBack = 4.5f; + this.damage = 16; + this.value = Item.sellPrice(gold: 1); + this.rare = 1; + return; + case 3280: + this.knockBack = 4f; + this.damage = 17; + this.value = Item.sellPrice(gold: 1); + this.rare = 1; + return; + case 3281: + this.knockBack = 3.75f; + this.damage = 20; + this.value = Item.sellPrice(gold: 1, silver: 30); + this.rare = 3; + return; + case 3282: + this.knockBack = 4.3f; + this.damage = 27; + this.value = Item.sellPrice(gold: 1, silver: 80); + this.rare = 3; + return; + case 3283: + this.knockBack = 3.15f; + this.damage = 39; + this.value = Item.sellPrice(gold: 4); + this.rare = 4; + return; + case 3284: + this.knockBack = 3.8f; + this.damage = 47; + this.value = Item.buyPrice(gold: 25); + this.rare = 5; + return; + case 3285: + this.knockBack = 3.5f; + this.damage = 14; + this.value = Item.sellPrice(silver: 50); + this.rare = 1; + return; + case 3286: + this.knockBack = 3.1f; + this.damage = 60; + this.value = Item.sellPrice(gold: 5); + this.rare = 7; + return; + case 3289: + this.knockBack = 2.8f; + this.damage = 43; + this.value = Item.sellPrice(gold: 4); + this.rare = 4; + return; + case 3290: + this.knockBack = 4.5f; + this.damage = 41; + this.value = Item.sellPrice(gold: 4); + this.rare = 4; + return; + case 3291: + this.knockBack = 4.3f; + this.damage = 90; + this.value = Item.sellPrice(gold: 11); + this.rare = 8; + return; + case 3315: + this.knockBack = 3.25f; + this.damage = 29; + this.value = Item.sellPrice(gold: 4); + this.rare = 3; + this.shoot = 562; + return; + case 3316: + this.knockBack = 3.8f; + this.damage = 34; + this.value = Item.sellPrice(gold: 4); + this.rare = 3; + this.shoot = 563; + return; + case 3317: + this.knockBack = 3.85f; + this.damage = 22; + this.value = Item.sellPrice(gold: 1, silver: 50); + this.rare = 3; + this.shoot = 564; + return; + default: + if (type == 3288 || type == 3287) + { + this.knockBack = 4.5f; + this.damage = 70; + this.rare = 9; + this.value = Item.sellPrice(gold: 4); + return; + } + if (type == 3292) + { + this.knockBack = 3.5f; + this.damage = 115; + this.value = Item.sellPrice(gold: 11); + this.rare = 8; + return; + } + this.knockBack = 4f; + this.damage = 15; + this.rare = 2; + this.value = Item.sellPrice(gold: 1); + return; + } + } + else + { + if (type == 3389) { this.useStyle = 5; this.width = 24; @@ -32489,171 +32423,45 @@ namespace Terraria this.melee = true; this.channel = true; this.noMelee = true; - this.shoot = 541 + type - 3278; + this.shoot = 603; this.useAnimation = 25; this.useTime = 25; this.shootSpeed = 16f; + this.damage = 190; + this.knockBack = 6.5f; + this.value = Item.sellPrice(gold: 10); + this.crit = 10; + this.rare = 10; + return; + } + if (type >= 3293 && type <= 3308) + { + this.width = 24; + this.height = 24; + this.rare = 1; + this.value = Item.sellPrice(silver: 3); + this.accessory = true; switch (type) { - case 3262: - this.knockBack = 3.25f; - this.damage = 21; - this.value = Item.buyPrice(gold: 5); - this.rare = 2; - this.shoot = 534; + case 3305: + this.stringColor = 28; return; - case 3278: - this.knockBack = 2.5f; - this.damage = 9; - this.value = Item.sellPrice(silver: 1); - this.rare = 0; + case 3306: + this.stringColor = 14; return; - case 3279: - this.knockBack = 4.5f; - this.damage = 16; - this.value = Item.sellPrice(gold: 1); - this.rare = 1; + case 3307: + this.stringColor = 27; return; - case 3280: - this.knockBack = 4f; - this.damage = 17; - this.value = Item.sellPrice(gold: 1); - this.rare = 1; - return; - case 3281: - this.knockBack = 3.75f; - this.damage = 18; - this.value = Item.sellPrice(gold: 1, silver: 30); - this.rare = 3; - return; - case 3282: - this.knockBack = 4.3f; - this.damage = 27; - this.value = Item.sellPrice(gold: 1, silver: 80); - this.rare = 3; - return; - case 3283: - this.knockBack = 3.3f; - this.damage = 38; - this.value = Item.sellPrice(gold: 4); - this.rare = 4; - return; - case 3284: - this.knockBack = 3.8f; - this.damage = 54; - this.value = Item.buyPrice(gold: 25); - this.rare = 5; - return; - case 3285: - this.knockBack = 3.5f; - this.damage = 14; - this.value = Item.sellPrice(silver: 50); - this.rare = 1; - return; - case 3286: - this.knockBack = 3.1f; - this.damage = 60; - this.value = Item.sellPrice(gold: 5); - this.rare = 7; - return; - case 3289: - this.knockBack = 2.8f; - this.damage = 47; - this.value = Item.sellPrice(gold: 4); - this.rare = 4; - return; - case 3290: - this.knockBack = 4.5f; - this.damage = 45; - this.value = Item.sellPrice(gold: 4); - this.rare = 4; - return; - case 3291: - this.knockBack = 4.3f; - this.damage = 95; - this.value = Item.sellPrice(gold: 11); - this.rare = 8; - this.crit += 10; - return; - case 3315: - this.knockBack = 3.25f; - this.damage = 35; - this.value = Item.sellPrice(gold: 4); - this.rare = 3; - this.shoot = 562; - return; - case 3316: - this.knockBack = 3.8f; - this.damage = 44; - this.value = Item.sellPrice(gold: 4); - this.rare = 3; - this.shoot = 563; - return; - case 3317: - this.knockBack = 3.85f; - this.damage = 22; - this.value = this.dungeonPrice; - this.rare = 3; - this.shoot = 564; + case 3308: + this.stringColor = 13; return; default: - if (type == 3288 || type == 3287) - { - this.knockBack = 4.5f; - this.damage = 70; - this.rare = 9; - this.value = Item.sellPrice(gold: 4); - return; - } - if (type == 3292) - { - this.knockBack = 3.5f; - this.damage = 115; - this.value = this.eclipseMothronPrice; - this.rare = 8; - return; - } - this.knockBack = 4f; - this.damage = 15; - this.rare = 2; - this.value = Item.sellPrice(gold: 1); + this.stringColor = 1 + type - 3293; return; } } else { - if (type == 3389) - { - this.useStyle = 5; - this.width = 24; - this.height = 24; - this.noUseGraphic = true; - this.UseSound = SoundID.Item1; - this.melee = true; - this.channel = true; - this.noMelee = true; - this.shoot = 603; - this.useAnimation = 25; - this.useTime = 25; - this.shootSpeed = 16f; - this.damage = 190; - this.knockBack = 6.5f; - this.value = Item.sellPrice(gold: 10); - this.crit = 10; - this.rare = 10; - return; - } - if (type >= 3293 && type <= 3308) - { - this.width = 24; - this.height = 24; - this.rare = 1; - this.value = Item.sellPrice(silver: 3); - this.accessory = true; - this.stringColor = type != 3307 ? (type != 3306 ? (type != 3308 ? (type != 3305 ? 1 + type - 3293 : 28) : 13) : 14) : 27; - this.canBePlacedInVanityRegardlessOfConditions = true; - return; - } if (type >= 3309 && type <= 3314) { this.width = 24; @@ -32717,12 +32525,12 @@ namespace Terraria this.knockBack = 2f; this.width = 16; this.height = 16; - this.damage = 40; + this.damage = 45; this.UseSound = (LegacySoundStyle) null; this.shoot = 535; - this.mana = 15; + this.mana = 10; this.rare = 4; - this.value = Item.sellPrice(gold: 4); + this.value = Item.sellPrice(gold: 1); this.noMelee = true; this.noUseGraphic = true; this.magic = true; @@ -32739,6 +32547,7 @@ namespace Terraria this.createTile = 395; this.width = 28; this.height = 28; + this.rare = 1; return; case 3271: this.useStyle = 1; @@ -32772,7 +32581,7 @@ namespace Terraria this.autoReuse = true; this.maxStack = 999; this.consumable = true; - this.createWall = 275; + this.createWall = 187; this.width = 12; this.height = 12; return; @@ -32856,7 +32665,7 @@ namespace Terraria this.autoReuse = true; this.maxStack = 999; this.consumable = true; - this.createWall = 304; + this.createWall = 216; this.width = 12; this.height = 12; return; @@ -32868,7 +32677,7 @@ namespace Terraria this.autoReuse = true; this.maxStack = 999; this.consumable = true; - this.createWall = 305; + this.createWall = 217; this.width = 12; this.height = 12; return; @@ -32880,7 +32689,7 @@ namespace Terraria this.autoReuse = true; this.maxStack = 999; this.consumable = true; - this.createWall = 306; + this.createWall = 218; this.width = 12; this.height = 12; return; @@ -32892,7 +32701,7 @@ namespace Terraria this.autoReuse = true; this.maxStack = 999; this.consumable = true; - this.createWall = 307; + this.createWall = 219; this.width = 12; this.height = 12; return; @@ -32904,7 +32713,7 @@ namespace Terraria this.autoReuse = true; this.maxStack = 999; this.consumable = true; - this.createWall = 308; + this.createWall = 220; this.width = 12; this.height = 12; return; @@ -32916,7 +32725,7 @@ namespace Terraria this.autoReuse = true; this.maxStack = 999; this.consumable = true; - this.createWall = 309; + this.createWall = 221; this.width = 12; this.height = 12; return; @@ -32928,7 +32737,7 @@ namespace Terraria this.autoReuse = true; this.maxStack = 999; this.consumable = true; - this.createWall = 310; + this.createWall = 222; this.width = 12; this.height = 12; return; @@ -32952,7 +32761,7 @@ namespace Terraria this.autoReuse = true; this.maxStack = 999; this.consumable = true; - this.createWall = 311; + this.createWall = 223; this.width = 12; this.height = 12; return; @@ -33091,7 +32900,6 @@ namespace Terraria this.width = 8; this.height = 10; this.rare = 1; - this.value = Item.sellPrice(silver: 25); return; case 3361: this.tileWand = 620; @@ -33104,7 +32912,6 @@ namespace Terraria this.width = 8; this.height = 10; this.rare = 1; - this.value = Item.sellPrice(silver: 25); return; case 3362: this.width = 28; @@ -33152,7 +32959,7 @@ namespace Terraria this.width = 24; this.height = 24; this.rare = 4; - this.value = Item.buyPrice(gold: 50); + this.value = Item.sellPrice(gold: 3); this.accessory = true; return; case 3367: @@ -33175,7 +32982,7 @@ namespace Terraria this.useAnimation = 25; this.useTime = 15; this.useStyle = 5; - this.rare = 9; + this.rare = 2; this.noUseGraphic = true; this.channel = true; this.noMelee = true; @@ -33186,7 +32993,7 @@ namespace Terraria this.melee = true; this.shoot = 595; this.shootSpeed = 15f; - this.value = Item.sellPrice(gold: 5); + this.value = 40000; return; case 3369: this.useStyle = 1; @@ -33217,7 +33024,6 @@ namespace Terraria this.rare = 4; this.value = 100000; this.accessory = true; - this.canBePlacedInVanityRegardlessOfConditions = true; return; case 3371: this.useStyle = 1; @@ -33233,7 +33039,6 @@ namespace Terraria this.rare = 4; this.value = 100000; this.accessory = true; - this.canBePlacedInVanityRegardlessOfConditions = true; return; default: if (type >= 3372 && type <= 3373) @@ -33242,7 +33047,6 @@ namespace Terraria this.height = 20; this.headSlot = type + 186 - 3372; this.rare = 1; - this.value = Item.sellPrice(silver: 75); this.vanity = true; return; } @@ -33251,7 +33055,7 @@ namespace Terraria case 3374: this.width = 18; this.height = 18; - this.defense = 2; + this.defense = 3; this.headSlot = 188; this.rare = 1; this.value = Item.sellPrice(silver: 30); @@ -33259,7 +33063,7 @@ namespace Terraria case 3375: this.width = 18; this.height = 18; - this.defense = 4; + this.defense = 6; this.bodySlot = 189; this.rare = 1; this.value = Item.sellPrice(silver: 50); @@ -33267,7 +33071,7 @@ namespace Terraria case 3376: this.width = 18; this.height = 18; - this.defense = 2; + this.defense = 4; this.legSlot = 129; this.rare = 1; this.value = Item.sellPrice(silver: 40); @@ -33276,7 +33080,7 @@ namespace Terraria this.mana = 7; this.UseSound = SoundID.Item43; this.useStyle = 5; - this.damage = 21; + this.damage = 20; this.useAnimation = 28; this.useTime = 28; this.width = 40; @@ -33293,9 +33097,9 @@ namespace Terraria case 3378: this.shoot = 598; this.shootSpeed = 10f; - this.damage = 20; + this.damage = 29; this.knockBack = 5f; - this.ranged = true; + this.thrown = true; this.useStyle = 1; this.UseSound = SoundID.Item1; this.useAnimation = 25; @@ -33327,7 +33131,7 @@ namespace Terraria this.noMelee = true; this.value = 50; this.knockBack = 1.5f; - this.ranged = true; + this.thrown = true; this.rare = 1; return; case 3380: @@ -33349,7 +33153,6 @@ namespace Terraria this.defense = 10; this.headSlot = 189; this.rare = 10; - this.value = Item.sellPrice(gold: 7); return; case 3382: this.width = 18; @@ -33357,7 +33160,6 @@ namespace Terraria this.defense = 16; this.bodySlot = 190; this.rare = 10; - this.value = Item.sellPrice(gold: 7) * 2; return; case 3383: this.width = 18; @@ -33365,7 +33167,6 @@ namespace Terraria this.defense = 12; this.legSlot = 130; this.rare = 10; - this.value = (int) ((double) Item.sellPrice(gold: 7) * 1.5); return; case 3384: this.useStyle = 5; @@ -33525,7 +33326,7 @@ namespace Terraria this.width = 22; this.height = 20; this.accessory = true; - this.value = Item.buyPrice(gold: 40); + this.value = Item.buyPrice(gold: 10); this.rare = 10; this.wingSlot = (sbyte) (29 + type - 3468); return; @@ -33552,6 +33353,7 @@ namespace Terraria this.knockBack = 2f; this.width = 16; this.height = 16; + this.UseSound = SoundID.Item116; this.shoot = 611; this.rare = 10; this.value = Item.sellPrice(gold: 10); @@ -33589,7 +33391,7 @@ namespace Terraria this.width = 20; this.height = 12; this.damage = 50; - this.UseSound = (LegacySoundStyle) null; + this.UseSound = SoundID.Item13; this.shoot = 615; this.rare = 10; this.value = Item.sellPrice(gold: 10); @@ -33637,7 +33439,7 @@ namespace Terraria this.useTime = 15; this.noUseGraphic = true; this.noMelee = true; - this.value = 100; + this.value = 200; return; case 3478: this.width = 18; @@ -33777,9 +33579,6 @@ namespace Terraria this.type = type; this.damage = 13; this.useAnimation = 10; - this.useTime = 10; - this.knockBack = 5f; - this.shoot = 945; this.scale = 0.975f; this.value = 10500; return; @@ -33827,16 +33626,13 @@ namespace Terraria this.useAnimation = 26; this.scale = 1.15f; this.damage = 7; - this.value = 6000; + this.value = 4000; return; case 3489: this.SetDefaults1(6); this.type = type; this.damage = 10; this.useAnimation = 11; - this.useTime = 11; - this.knockBack = 4f; - this.shoot = 943; this.scale = 0.95f; this.value = 5250; return; @@ -33891,9 +33687,6 @@ namespace Terraria this.type = type; this.damage = 9; this.useAnimation = 12; - this.useTime = 12; - this.knockBack = 4f; - this.shoot = 941; this.scale = 0.925f; this.value = 2100; return; @@ -33947,9 +33740,6 @@ namespace Terraria this.type = type; this.damage = 7; this.useAnimation = 12; - this.useTime = 12; - this.knockBack = 4f; - this.shoot = 939; this.scale = 0.85f; this.value = 525; return; @@ -34005,9 +33795,6 @@ namespace Terraria this.type = type; this.damage = 5; this.useAnimation = 13; - this.useTime = 13; - this.knockBack = 4f; - this.shoot = 938; this.scale = 0.8f; this.value = 350; return; @@ -34062,9 +33849,6 @@ namespace Terraria this.type = type; this.damage = 9; this.useAnimation = 12; - this.useTime = 12; - this.knockBack = 4f; - this.shoot = 942; this.scale = 0.95f; this.value = 3500; return; @@ -34116,11 +33900,8 @@ namespace Terraria case 3519: this.SetDefaults1(6); this.type = type; - this.damage = 12; + this.damage = 11; this.useAnimation = 11; - this.useTime = 11; - this.knockBack = 5f; - this.shoot = 944; this.scale = 0.95f; this.value = 7000; return; @@ -34195,6 +33976,21 @@ namespace Terraria this.value = Item.sellPrice(gold: 10); this.summon = true; return; + case 3532: + this.UseSound = SoundID.Item2; + this.useStyle = 2; + this.useTurn = true; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; + this.consumable = true; + this.width = 10; + this.height = 10; + this.buffType = 26; + this.buffTime = 108000; + this.rare = 1; + this.value = 1000; + return; case 3533: this.width = 20; this.height = 20; @@ -34307,7 +34103,7 @@ namespace Terraria this.width = 16; this.height = 16; this.damage = 100; - this.UseSound = (LegacySoundStyle) null; + this.UseSound = SoundID.Item13; this.shoot = 633; this.mana = 12; this.rare = 10; @@ -34319,8 +34115,8 @@ namespace Terraria return; case 3542: this.useStyle = 5; - this.useAnimation = 12; - this.useTime = 12; + this.useAnimation = 15; + this.useTime = 15; this.shootSpeed = 6f; this.knockBack = 0.0f; this.width = 16; @@ -34328,7 +34124,7 @@ namespace Terraria this.damage = 130; this.UseSound = SoundID.Item20; this.shoot = 634; - this.mana = 12; + this.mana = 18; this.rare = 10; this.value = Item.sellPrice(gold: 10); this.noMelee = true; @@ -34358,7 +34154,7 @@ namespace Terraria case 3544: this.UseSound = SoundID.Item3; this.healLife = 200; - this.useStyle = 9; + this.useStyle = 2; this.useTurn = true; this.useAnimation = 17; this.useTime = 17; @@ -34368,7 +34164,7 @@ namespace Terraria this.width = 14; this.height = 24; this.rare = 7; - this.value = Item.sellPrice(silver: 30); + this.value = 1500; return; case 3545: this.useStyle = 1; @@ -34383,9 +34179,9 @@ namespace Terraria this.height = 28; this.rare = 1; this.mech = true; - this.value = Item.sellPrice(silver: 20); return; case 3546: + this.crit = 10; this.useStyle = 5; this.autoReuse = true; this.useAnimation = 30; @@ -34394,13 +34190,13 @@ namespace Terraria this.width = 50; this.height = 20; this.shoot = 134; - this.UseSound = SoundID.Item156; - this.damage = 25; + this.UseSound = SoundID.Item11; + this.damage = 65; this.shootSpeed = 15f; this.noMelee = true; - this.value = Item.buyPrice(gold: 80); + this.value = Item.sellPrice(gold: 10); this.knockBack = 4f; - this.rare = 8; + this.rare = 10; this.ranged = true; return; case 3547: @@ -34409,7 +34205,7 @@ namespace Terraria this.shoot = 637; this.width = 8; this.height = 28; - this.maxStack = 99; + this.maxStack = 30; this.consumable = true; this.UseSound = SoundID.Item1; this.useAnimation = 40; @@ -34436,7 +34232,7 @@ namespace Terraria this.damage = 30; this.knockBack = 6f; this.rare = 2; - this.ranged = true; + this.thrown = true; return; case 3549: this.useStyle = 1; @@ -34568,7 +34364,7 @@ namespace Terraria this.makeNPC = (short) 539; this.noUseGraphic = true; this.value = Item.sellPrice(gold: 10); - this.rare = 3; + this.rare = 2; return; case 3565: this.useStyle = 1; @@ -34594,7 +34390,7 @@ namespace Terraria this.width = 12; this.height = 12; this.value = Item.sellPrice(gold: 10); - this.rare = 3; + this.rare = 2; return; case 3567: this.shootSpeed = 2f; @@ -34664,7 +34460,7 @@ namespace Terraria return; case 3571: this.mana = 10; - this.damage = 80; + this.damage = 150; this.useStyle = 1; this.shootSpeed = 14f; this.shoot = 643; @@ -34684,7 +34480,7 @@ namespace Terraria this.noUseGraphic = true; this.damage = 0; this.useStyle = 5; - this.shootSpeed = 18f; + this.shootSpeed = 16f; this.shoot = 646; this.width = 18; this.height = 28; @@ -34726,14 +34522,12 @@ namespace Terraria this.noMelee = true; this.value = Item.sellPrice(gold: 10); this.buffType = 190; - this.expert = true; return; case 3578: this.width = 28; this.height = 20; this.bodySlot = 192; this.rare = 9; - this.value = Item.sellPrice(gold: 5); this.vanity = true; return; case 3579: @@ -34741,7 +34535,6 @@ namespace Terraria this.height = 14; this.legSlot = 132; this.rare = 9; - this.value = Item.sellPrice(gold: 5); this.vanity = true; return; case 3580: @@ -34757,9 +34550,7 @@ namespace Terraria this.height = 14; this.rare = 9; this.vanity = true; - this.value = Item.sellPrice(gold: 5); this.accessory = true; - this.canBePlacedInVanityRegardlessOfConditions = true; return; case 3582: this.width = 24; @@ -34774,7 +34565,6 @@ namespace Terraria this.height = 20; this.headSlot = 191; this.rare = 9; - this.value = Item.sellPrice(gold: 5); this.vanity = true; return; case 3584: @@ -34794,7 +34584,6 @@ namespace Terraria this.height = 20; this.headSlot = 192; this.rare = 9; - this.value = Item.sellPrice(gold: 5); this.vanity = true; return; case 3586: @@ -34802,7 +34591,6 @@ namespace Terraria this.height = 20; this.bodySlot = 193; this.rare = 9; - this.value = Item.sellPrice(gold: 5); this.vanity = true; return; case 3587: @@ -34810,7 +34598,6 @@ namespace Terraria this.height = 14; this.legSlot = 133; this.rare = 9; - this.value = Item.sellPrice(gold: 5); this.vanity = true; return; case 3588: @@ -34826,7 +34613,6 @@ namespace Terraria this.height = 20; this.headSlot = 193; this.rare = 9; - this.value = Item.sellPrice(gold: 5); this.vanity = true; return; case 3590: @@ -34834,7 +34620,6 @@ namespace Terraria this.height = 20; this.bodySlot = 194; this.rare = 9; - this.value = Item.sellPrice(gold: 5); this.vanity = true; return; case 3591: @@ -34842,7 +34627,6 @@ namespace Terraria this.height = 14; this.legSlot = 134; this.rare = 9; - this.value = Item.sellPrice(gold: 5); this.vanity = true; return; case 3592: @@ -34985,7 +34769,7 @@ namespace Terraria this.shoot = 651; this.channel = true; this.shootSpeed = 10f; - this.value = Item.sellPrice(gold: 4); + this.value = Item.buyPrice(gold: 15); this.rare = 2; this.UseSound = SoundID.Item64; this.mech = true; @@ -35146,7 +34930,7 @@ namespace Terraria this.width = 24; this.height = 28; this.rare = 1; - this.value = Item.buyPrice(gold: 12); + this.value = 100000; this.tileBoost = 20; this.mech = true; return; @@ -35618,7 +35402,7 @@ namespace Terraria this.width = 12; this.height = 30; this.value = Item.buyPrice(gold: 20); - this.rare = 3; + this.rare = 9; return; case 3748: this.createTile = 456; @@ -35648,18 +35432,17 @@ namespace Terraria this.rare = 1; return; case 3750: - this.useStyle = 1; + this.UseSound = SoundID.Item3; + this.useStyle = 2; this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; + this.useAnimation = 17; + this.useTime = 17; + this.maxStack = 30; this.consumable = true; - this.createTile = 621; - this.width = 22; - this.height = 22; - this.value = Item.sellPrice(silver: 50); - this.rare = 3; + this.width = 14; + this.height = 24; + this.value = 1000; + this.rare = 1; return; case 3751: this.useStyle = 1; @@ -35787,14 +35570,11 @@ namespace Terraria { this.SetDefaults(198); this.type = type; - this.damage = 42; - this.useTime = 20; - this.useAnimation = 20; + this.damage = 41; this.scale = 1.15f; this.autoReuse = true; this.useTurn = true; this.rare = 4; - this.value = Item.sellPrice(gold: 1); return; } switch (type) @@ -35885,7 +35665,7 @@ namespace Terraria this.value = 150000; return; case 3779: - this.mana = 14; + this.mana = 18; this.damage = 85; this.useStyle = 5; this.shootSpeed = 3f; @@ -35893,8 +35673,8 @@ namespace Terraria this.width = 26; this.height = 28; this.UseSound = SoundID.Item117; - this.useAnimation = 22; - this.useTime = 22; + this.useAnimation = 30; + this.useTime = 30; this.autoReuse = true; this.noMelee = true; this.knockBack = 5f; @@ -35936,7 +35716,7 @@ namespace Terraria this.createTile = 461; this.width = 24; this.height = 24; - this.value = Item.sellPrice(copper: 40); + this.value = Item.sellPrice(silver: 1); return; case 3783: this.width = 18; @@ -35982,7 +35762,7 @@ namespace Terraria this.UseSound = SoundID.Item9; this.crit = 20; this.shoot = 660; - this.mana = 17; + this.mana = 14; this.rare = 4; this.value = 300000; this.noMelee = true; @@ -36061,7 +35841,6 @@ namespace Terraria this.rare = 4; this.value = 100000; this.accessory = true; - this.canBePlacedInVanityRegardlessOfConditions = true; return; case 3797: this.width = 18; @@ -36092,7 +35871,7 @@ namespace Terraria this.height = 18; this.headSlot = 204; this.rare = 8; - this.defense = 13; + this.defense = 12; this.value = Item.sellPrice(gold: 3); return; case 3801: @@ -36108,7 +35887,7 @@ namespace Terraria this.height = 18; this.legSlot = 145; this.rare = 8; - this.defense = 18; + this.defense = 17; this.value = Item.sellPrice(gold: 3); return; case 3803: @@ -36387,7 +36166,7 @@ namespace Terraria this.value = Item.sellPrice(silver: 1); this.damage = 20; this.knockBack = 7f; - this.ranged = true; + this.thrown = true; this.rare = 1; this.useAmmo = 353; return; @@ -36400,7 +36179,7 @@ namespace Terraria case 3823: this.UseSound = SoundID.Item1; this.useStyle = 1; - this.damage = 85; + this.damage = 44; this.useAnimation = 25; this.useTime = 25; this.width = 34; @@ -36525,13 +36304,13 @@ namespace Terraria return; case 3852: this.useStyle = 5; - this.useAnimation = 25; + this.useAnimation = 30; this.useTime = 3; this.shootSpeed = 11f; this.knockBack = 9f; this.width = 16; this.height = 16; - this.damage = 32; + this.damage = 24; this.UseSound = SoundID.DD2_BookStaffCast; this.shoot = 712; this.mana = 20; @@ -36543,13 +36322,13 @@ namespace Terraria return; case 3854: this.useStyle = 5; - this.useAnimation = 18; - this.useTime = 18; + this.useAnimation = 20; + this.useTime = 20; this.shootSpeed = 20f; this.knockBack = 2f; this.width = 20; this.height = 12; - this.damage = 32; + this.damage = 24; this.UseSound = SoundID.Item5; this.shoot = 705; this.rare = 5; @@ -36623,7 +36402,6 @@ namespace Terraria this.height = 20; this.rare = 1; this.vanity = true; - this.value = Item.sellPrice(silver: 75); switch (type) { case 3863: @@ -36678,7 +36456,6 @@ namespace Terraria this.rare = 4; this.value = 100000; this.accessory = true; - this.canBePlacedInVanityRegardlessOfConditions = true; return; case 3870: this.useStyle = 5; @@ -36704,7 +36481,7 @@ namespace Terraria this.width = 18; this.height = 18; this.rare = 8; - this.defense = 20; + this.defense = 14; this.value = Item.sellPrice(gold: 3); this.headSlot = 210; return; @@ -36712,7 +36489,7 @@ namespace Terraria this.width = 18; this.height = 18; this.rare = 8; - this.defense = 24; + this.defense = 30; this.value = Item.sellPrice(gold: 3); this.bodySlot = 204; return; @@ -36720,7 +36497,7 @@ namespace Terraria this.width = 18; this.height = 18; this.rare = 8; - this.defense = 24; + this.defense = 20; this.value = Item.sellPrice(gold: 3); this.legSlot = 152; return; @@ -36739,6 +36516,7 @@ namespace Terraria this.defense = 21; this.value = Item.sellPrice(gold: 3); this.bodySlot = 205; + this.backSlot = (sbyte) 11; return; case 3876: this.width = 18; @@ -36763,6 +36541,7 @@ namespace Terraria this.defense = 24; this.value = Item.sellPrice(gold: 3); this.bodySlot = 206; + this.backSlot = (sbyte) 12; return; case 3879: this.width = 18; @@ -36787,6 +36566,7 @@ namespace Terraria this.defense = 26; this.value = Item.sellPrice(gold: 3); this.bodySlot = 207; + this.backSlot = (sbyte) 13; return; case 3882: this.width = 18; @@ -36800,7 +36580,7 @@ namespace Terraria this.width = 22; this.height = 20; this.accessory = true; - this.value = Item.buyPrice(gold: 40); + this.value = Item.sellPrice(gold: 5); this.rare = 8; this.wingSlot = (sbyte) 37; return; @@ -36829,7 +36609,7 @@ namespace Terraria this.createTile = 467; this.width = 26; this.height = 22; - this.value = Item.buyPrice(gold: 10); + this.value = 500; this.placeStyle = 1; return; case 3886: @@ -36885,7 +36665,6 @@ namespace Terraria this.width = 12; this.height = 30; this.placeStyle = 36; - this.value = 150; return; case 3890: this.noWet = true; @@ -36899,7 +36678,6 @@ namespace Terraria this.createTile = 33; this.width = 8; this.height = 18; - this.value = Item.sellPrice(copper: 60); this.placeStyle = 30; return; case 3891: @@ -36914,7 +36692,6 @@ namespace Terraria this.width = 12; this.height = 28; this.placeStyle = 37; - this.value = 150; return; case 3892: this.useStyle = 1; @@ -37060,7 +36837,7 @@ namespace Terraria this.createTile = 18; this.width = 28; this.height = 14; - this.value = Item.buyPrice(gold: 10); + this.value = 150; this.placeStyle = 32; return; } @@ -37159,7 +36936,6 @@ namespace Terraria this.height = 20; this.headSlot = 214; this.rare = 9; - this.value = Item.sellPrice(gold: 5); this.vanity = true; return; case 3922: @@ -37167,7 +36943,6 @@ namespace Terraria this.height = 20; this.bodySlot = 208; this.rare = 9; - this.value = Item.sellPrice(gold: 5); this.vanity = true; return; case 3923: @@ -37175,7 +36950,6 @@ namespace Terraria this.height = 14; this.legSlot = 158; this.rare = 9; - this.value = Item.sellPrice(gold: 5); this.vanity = true; return; case 3924: @@ -37191,7 +36965,6 @@ namespace Terraria this.height = 20; this.headSlot = 215; this.rare = 9; - this.value = Item.sellPrice(gold: 5); this.vanity = true; return; case 3926: @@ -37199,7 +36972,6 @@ namespace Terraria this.height = 20; this.bodySlot = 209; this.rare = 9; - this.value = Item.sellPrice(gold: 5); this.vanity = true; return; case 3927: @@ -37207,7 +36979,6 @@ namespace Terraria this.height = 14; this.legSlot = 159; this.rare = 9; - this.value = Item.sellPrice(gold: 5); this.vanity = true; return; case 3928: @@ -37223,758 +36994,9 @@ namespace Terraria this.height = 14; this.rare = 9; this.vanity = true; - this.value = Item.sellPrice(gold: 5); this.accessory = true; - this.canBePlacedInVanityRegardlessOfConditions = true; - return; - case 3930: - this.useStyle = 5; - this.useAnimation = 6; - this.useTime = 6; - this.shootSpeed = 17f; - this.knockBack = 10f; - this.width = 20; - this.height = 12; - this.damage = 40; - this.UseSound = (LegacySoundStyle) null; - this.shoot = 714; - this.rare = 10; - this.value = Item.sellPrice(gold: 10); - this.noMelee = true; - this.noUseGraphic = true; - this.ranged = true; - this.channel = true; - this.autoReuse = true; - this.useAmmo = AmmoID.Rocket; - return; - case 3931: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 90; - this.width = 20; - this.height = 20; - this.value = 300; - this.placeStyle = 32; - return; - case 3932: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.maxStack = 99; - this.consumable = true; - this.autoReuse = true; - this.createTile = 79; - this.width = 28; - this.height = 20; - this.value = 2000; - this.placeStyle = 32; - return; - case 3933: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 101; - this.width = 20; - this.height = 20; - this.value = 300; - this.placeStyle = 33; - return; - case 3934: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 88; - this.width = 20; - this.height = 20; - this.value = 300; - this.placeStyle = 32; - return; - case 3935: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 100; - this.width = 20; - this.height = 20; - this.value = 1500; - this.placeStyle = 32; - return; - case 3936: - this.noWet = true; - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 33; - this.width = 8; - this.height = 18; - this.value = Item.sellPrice(copper: 60); - this.placeStyle = 31; - return; - case 3937: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 15; - this.width = 12; - this.height = 30; - this.placeStyle = 37; - this.value = 150; - return; - case 3938: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 34; - this.width = 26; - this.height = 26; - this.value = 3000; - this.placeStyle = 38; - return; - case 3939: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 467; - this.width = 26; - this.height = 22; - this.value = 500; - this.placeStyle = 2; - return; - case 3940: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 104; - this.width = 20; - this.height = 20; - this.value = 300; - this.placeStyle = 33; - return; - case 3941: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.maxStack = 99; - this.consumable = true; - this.createTile = 10; - this.width = 14; - this.height = 28; - this.value = 200; - this.placeStyle = 37; - return; - case 3942: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 93; - this.width = 10; - this.height = 24; - this.value = 500; - this.placeStyle = 32; - return; - case 3943: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 42; - this.width = 12; - this.height = 28; - this.placeStyle = 38; - this.value = 150; - return; - case 3944: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 87; - this.width = 20; - this.height = 20; - this.value = 300; - this.placeStyle = 32; - return; - case 3945: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 19; - this.width = 8; - this.height = 10; - this.placeStyle = 36; - return; - case 3946: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 172; - this.width = 20; - this.height = 20; - this.value = 300; - this.placeStyle = 33; - return; - case 3947: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 89; - this.width = 20; - this.height = 20; - this.value = 300; - this.placeStyle = 35; - return; - case 3948: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 469; - this.width = 26; - this.height = 20; - this.value = 300; - this.placeStyle = 1; - return; - case 3949: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 18; - this.width = 28; - this.height = 14; - this.value = 150; - this.placeStyle = 33; - return; - case 3950: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 468; - this.width = 26; - this.height = 22; - this.value = 500; - this.placeStyle = 2; - return; - case 3951: - this.createTile = 472; - this.width = 16; - this.height = 16; - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - return; - case 3952: - this.createWall = 231; - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 7; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.width = 12; - this.height = 12; - return; - case 3953: - this.createTile = 473; - this.width = 16; - this.height = 16; - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - return; - case 3954: - this.createWall = 232; - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 7; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.width = 12; - this.height = 12; - return; - case 3955: - this.createTile = 474; - this.width = 16; - this.height = 16; - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - return; - case 3956: - this.createWall = 233; - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 7; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.width = 12; - this.height = 12; - return; - case 3957: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 19; - this.width = 8; - this.height = 10; - this.placeStyle = 37; - return; - case 3958: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 90; - this.width = 20; - this.height = 20; - this.value = 300; - this.placeStyle = 33; - return; - case 3959: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.maxStack = 99; - this.consumable = true; - this.autoReuse = true; - this.createTile = 79; - this.width = 28; - this.height = 20; - this.value = 2000; - this.placeStyle = 33; - return; - case 3960: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 101; - this.width = 20; - this.height = 20; - this.value = 300; - this.placeStyle = 34; - return; - case 3961: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 100; - this.width = 20; - this.height = 20; - this.value = 1500; - this.placeStyle = 33; - return; - case 3962: - this.noWet = true; - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 33; - this.width = 8; - this.height = 18; - this.value = Item.sellPrice(copper: 60); - this.placeStyle = 32; - return; - case 3963: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 15; - this.width = 12; - this.height = 30; - this.placeStyle = 38; - this.value = 150; - return; - case 3964: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 34; - this.width = 26; - this.height = 26; - this.value = 3000; - this.placeStyle = 39; - return; - case 3965: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 467; - this.width = 26; - this.height = 22; - this.value = 500; - this.placeStyle = 3; - return; - case 3966: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 104; - this.width = 20; - this.height = 20; - this.value = 300; - this.placeStyle = 34; - return; - case 3967: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.maxStack = 99; - this.consumable = true; - this.createTile = 10; - this.width = 14; - this.height = 28; - this.value = 200; - this.placeStyle = 38; - return; - case 3968: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 88; - this.width = 20; - this.height = 20; - this.value = 300; - this.placeStyle = 33; - return; - case 3969: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 93; - this.width = 10; - this.height = 24; - this.value = 500; - this.placeStyle = 33; - return; - case 3970: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 42; - this.width = 12; - this.height = 28; - this.placeStyle = 39; - this.value = 150; - return; - case 3971: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 87; - this.width = 20; - this.height = 20; - this.value = 300; - this.placeStyle = 33; - return; - case 3972: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 172; - this.width = 20; - this.height = 20; - this.value = 300; - this.placeStyle = 34; - return; - case 3973: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 89; - this.width = 20; - this.height = 20; - this.value = 300; - this.placeStyle = 36; - return; - case 3974: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 469; - this.width = 26; - this.height = 20; - this.value = 300; - this.placeStyle = 2; - return; - case 3975: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 18; - this.width = 28; - this.height = 14; - this.value = 150; - this.placeStyle = 34; - return; - case 3976: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 468; - this.width = 26; - this.height = 22; - this.value = 500; - this.placeStyle = 3; - return; - case 3977: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 269; - this.width = 22; - this.height = 32; - this.createTile = 475; - return; - case 3978: - this.width = 20; - this.height = 20; - this.maxStack = 99; - this.value = Item.sellPrice(gold: 1, silver: 50); - this.rare = 3; - return; - case 3979: - this.width = 12; - this.height = 12; - this.rare = 1; - this.maxStack = 99; - this.value = Item.sellPrice(silver: 10); - this.createTile = 376; - this.placeStyle = 9; - this.useAnimation = 15; - this.useTime = 15; - this.autoReuse = true; - this.useStyle = 1; - this.consumable = true; - return; - case 3980: - this.width = 12; - this.height = 12; - this.rare = 2; - this.maxStack = 99; - this.value = Item.sellPrice(silver: 50); - this.createTile = 376; - this.placeStyle = 10; - this.useAnimation = 15; - this.useTime = 15; - this.autoReuse = true; - this.useStyle = 1; - this.consumable = true; - return; - case 3981: - this.width = 12; - this.height = 12; - this.rare = 3; - this.maxStack = 99; - this.value = Item.sellPrice(gold: 2); - this.createTile = 376; - this.placeStyle = 11; - this.useAnimation = 15; - this.useTime = 15; - this.autoReuse = true; - this.useStyle = 1; - this.consumable = true; return; default: - if (type >= 3982 && type <= 3987) - { - this.width = 12; - this.height = 12; - this.rare = 2; - this.maxStack = 99; - this.createTile = 376; - this.placeStyle = 12 + type - 3982; - this.useAnimation = 15; - this.useTime = 15; - this.autoReuse = true; - this.useStyle = 1; - this.consumable = true; - this.value = Item.sellPrice(gold: 1); - return; - } - if (type == 3988) - { - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 467; - this.width = 26; - this.height = 22; - this.value = 500; - this.placeStyle = 4; - return; - } - if (type != 3989) - return; - this.DefaultToGolfBall(721); return; } } @@ -38000,12 +37022,12 @@ namespace Terraria } } } - } - } - } - } + } + } + } + } } - } + } } } } @@ -38018,6146 +37040,147 @@ namespace Terraria } } - private void DefaultToGolfBall(int projid) + public void SetDefaults(int Type = 0, bool noMatCheck = false) { - this.shoot = projid; - this.useStyle = 1; - this.shootSpeed = 12f; - this.width = 18; - this.height = 20; - this.maxStack = 1; - this.UseSound = SoundID.Item1; - this.useAnimation = 15; - this.useTime = 15; - this.noUseGraphic = true; - this.noMelee = true; - this.value = 0; - this.accessory = true; - this.SetShopValues(ItemRarityColor.Green2, Item.buyPrice(gold: 1)); - this.canBePlacedInVanityRegardlessOfConditions = true; - } - - public void SetDefaults5(int type) - { - switch (type) - { - case 3990: - this.DefaultToAccessory(36, 28); - this.shoeSlot = (sbyte) 18; - this.SetShopValues(ItemRarityColor.Pink5, Item.sellPrice(gold: 2)); - break; - case 3991: - this.DefaultToAccessory(30, 42); - this.faceSlot = (sbyte) 9; - this.SetShopValues(ItemRarityColor.Pink5, Item.sellPrice(gold: 10)); - break; - case 3992: - this.defense = 7; - this.DefaultToAccessory(20, 40); - this.handOnSlot = (sbyte) 20; - this.handOffSlot = (sbyte) 12; - this.SetShopValues(ItemRarityColor.Pink5, Item.sellPrice(gold: 15)); - break; - case 3993: - this.DefaultToAccessory(34, 30); - this.shoeSlot = (sbyte) 19; - this.SetShopValues(ItemRarityColor.Pink5, Item.sellPrice(gold: 10)); - break; - case 3994: - this.DefaultToAccessory(newheight: 30); - this.shoeSlot = (sbyte) 20; - this.SetShopValues(ItemRarityColor.Pink5, Item.sellPrice(gold: 2)); - break; - case 3995: - this.DefaultToAccessory(34, 32); - this.handOnSlot = (sbyte) 21; - this.handOffSlot = (sbyte) 13; - this.shoeSlot = (sbyte) 20; - this.SetShopValues(ItemRarityColor.Pink5, Item.sellPrice(gold: 5)); - break; - case 3996: - this.DefaultToAccessory(28, 30); - this.handOnSlot = (sbyte) 21; - this.handOffSlot = (sbyte) 13; - this.SetShopValues(ItemRarityColor.Pink5, Item.sellPrice(gold: 2)); - break; - case 3997: - this.defense = 6; - this.DefaultToAccessory(36, 38); - this.shieldSlot = (sbyte) 7; - this.SetShopValues(ItemRarityColor.Pink5, Item.sellPrice(gold: 10)); - break; - case 3998: - this.defense = 7; - this.DefaultToAccessory(36, 40); - this.shieldSlot = (sbyte) 8; - this.SetShopValues(ItemRarityColor.Pink5, Item.sellPrice(gold: 15)); - break; - case 3999: - this.DefaultToAccessory(22, 32); - this.faceSlot = (sbyte) 10; - this.SetShopValues(ItemRarityColor.Pink5, Item.sellPrice(gold: 2, silver: 50)); - break; - case 4000: - this.DefaultToAccessory(28, 32); - this.SetShopValues(ItemRarityColor.Pink5, Item.sellPrice(gold: 4)); - break; - case 4001: - this.DefaultToAccessory(26, 36); - this.backSlot = (sbyte) 14; - this.frontSlot = (sbyte) 5; - this.SetShopValues(ItemRarityColor.Pink5, Item.sellPrice(gold: 3)); - break; - case 4002: - this.DefaultToAccessory(34, 36); - this.backSlot = (sbyte) 15; - this.SetShopValues(ItemRarityColor.Pink5, Item.sellPrice(gold: 7, silver: 50)); - break; - case 4003: - this.DefaultToAccessory(30, 34); - this.faceSlot = (sbyte) 11; - this.SetShopValues(ItemRarityColor.LightPurple6, Item.sellPrice(gold: 5)); - break; - case 4004: - this.DefaultToAccessory(30, 32); - this.faceSlot = (sbyte) 13; - this.SetShopValues(ItemRarityColor.Pink5, Item.sellPrice(gold: 3)); - break; - case 4005: - this.DefaultToAccessory(30, 30); - this.SetShopValues(ItemRarityColor.Pink5, Item.sellPrice(gold: 15)); - break; - case 4006: - this.DefaultToAccessory(36, 38); - this.backSlot = (sbyte) 16; - this.SetShopValues(ItemRarityColor.Pink5, Item.sellPrice(gold: 15)); - break; - case 4007: - this.DefaultToAccessory(26, 30); - this.neckSlot = (sbyte) 10; - this.SetShopValues(ItemRarityColor.Pink5, Item.sellPrice(gold: 3)); - break; - case 4008: - this.defense = 4; - this.DefaultToHeadgear(24, 22, 216); - this.SetShopValues(ItemRarityColor.Pink5, Item.sellPrice(gold: 2)); - break; - case 4038: - this.DefaultToAccessory(28, 34); - this.SetShopValues(ItemRarityColor.Pink5, Item.sellPrice(gold: 7, silver: 50)); - break; - case 4039: - this.DefaultToGolfClub(20, 20); - this.SetShopValues(ItemRarityColor.Green2, Item.buyPrice(gold: 1)); - break; - case 4040: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 476; - this.width = 12; - this.height = 12; - this.SetShopValues(ItemRarityColor.Green2, Item.buyPrice(gold: 1)); - break; - case 4041: - case 4042: - case 4043: - case 4044: - case 4045: - case 4046: - case 4047: - case 4048: - case 4241: - this.DefaultToPlacableTile((ushort) 3, 0); - this.SetShopValues(ItemRarityColor.White0, Item.buyPrice(silver: 5)); - this.autoReuse = false; - this.useTime = this.useAnimation; - break; - case 4049: - this.DefaultToLawnMower(20, 20); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4050: - this.DefaultToPlacableTile((ushort) 478, 0); - break; - case 4051: - this.DefaultToPlacableTile((ushort) 479, 0); - break; - case 4052: - this.DefaultToPlacableWall((ushort) 234); - break; - case 4053: - this.DefaultToPlacableWall((ushort) 235); - break; - case 4054: - this.DefaultToPlacableTile((ushort) 480, 0); - this.width = 22; - this.height = 32; - this.rare = 3; - this.value = Item.sellPrice(gold: 1); - break; - case 4055: - this.DefaultToAccessory(34, 30); - this.shoeSlot = (sbyte) 21; - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(gold: 1)); - break; - case 4056: - this.DefaultToAccessory(30, 30); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(gold: 1)); - break; - case 4057: - this.SetShopValues(ItemRarityColor.Orange3, Item.buyPrice(gold: 1)); - this.DefaultToGuitar(); - break; - case 4058: - this.SetShopValues(ItemRarityColor.Orange3, Item.buyPrice(gold: 10)); - this.DefaultToBow(17, 11f); - this.SetWeaponValues(8, 5f); - break; - case 4059: - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(silver: 30)); - this.SetWeaponValues(8, 4f); - this.melee = true; - this.autoReuse = true; - this.useTurn = true; - this.useTime = 14; - this.useAnimation = 18; - this.useStyle = 1; - this.pick = 55; - this.UseSound = SoundID.Item1; - break; - case 4060: - this.width = 42; - this.height = 20; - this.SetShopValues(ItemRarityColor.Orange3, Item.buyPrice(gold: 50)); - this.DefaultToRangedWeapon(728, AmmoID.FallenStar, 12, 20f, true); - this.SetWeaponValues(70, 5f); - break; - case 4061: - this.DefaultToSpear(730, 3.5f, 28); - this.SetWeaponValues(12, 6f); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(silver: 30)); - break; - case 4062: - this.DefaultToStaff(731, 8f, 17, 5); - this.SetWeaponValues(12, 2f); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(silver: 30)); - break; - case 4063: - this.DefaultToPlacableTile((ushort) 486, 0); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 10)); - break; - case 4064: - this.DefaultToPlacableTile((ushort) 487, 0); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(copper: 80)); - break; - case 4065: - this.DefaultToPlacableTile((ushort) 487, 1); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(silver: 1)); - break; - case 4066: - this.DefaultToMount(15); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(silver: 50)); - break; - case 4067: - this.DefaultToMount(16); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(gold: 1)); - break; - case 4068: - this.DefaultToCapturedCritter((short) 583); - this.rare = 1; - this.value = Item.sellPrice(gold: 1); - break; - case 4069: - this.DefaultToCapturedCritter((short) 584); - this.rare = 1; - this.value = Item.sellPrice(gold: 1); - break; - case 4070: - this.DefaultToCapturedCritter((short) 585); - this.rare = 1; - this.value = Item.sellPrice(gold: 1); - break; - case 4071: - case 4072: - case 4073: - this.DefaultToSeaShelll(); - break; - case 4074: - this.DefaultToPlacableTile((ushort) 489, 0); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(silver: 20)); - break; - case 4075: - this.DefaultToPlacableTile((ushort) 490, 0); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(silver: 10)); - break; - case 4076: - this.rare = 3; - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 491; - this.width = 12; - this.height = 12; - this.value = 100000; - break; - case 4077: - this.DefaultToMusicBox(43); - break; - case 4078: - this.DefaultToMusicBox(41); - break; - case 4079: - this.DefaultToMusicBox(42); - break; - case 4080: - this.DefaultToMusicBox(44); - break; - case 4081: - this.DefaultToMusicBox(45); - break; - case 4082: - this.DefaultToMusicBox(40); - break; - case 4083: - case 4084: - case 4085: - case 4086: - case 4087: - case 4088: - this.DefaultToPlacableTile((ushort) 493, type - 4083); - this.SetShopValues(ItemRarityColor.White0, Item.buyPrice(silver: 20)); - break; - case 4089: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 494; - this.width = 12; - this.height = 12; - this.SetShopValues(ItemRarityColor.Green2, Item.buyPrice(gold: 1)); - break; - case 4090: - this.DefaultToPlacableTile((ushort) 495, 0); - this.SetShopValues(ItemRarityColor.White0, 0); - break; - case 4091: - this.DefaultToPlacableTile((ushort) 496, 0); - this.SetShopValues(ItemRarityColor.White0, Item.buyPrice(silver: 1)); - break; - case 4092: - this.DefaultToGolfClub(20, 20); - this.SetShopValues(ItemRarityColor.Green2, Item.buyPrice(gold: 1)); - break; - case 4093: - this.DefaultToGolfClub(20, 20); - this.SetShopValues(ItemRarityColor.Green2, Item.buyPrice(gold: 1)); - break; - case 4094: - this.DefaultToGolfClub(20, 20); - this.SetShopValues(ItemRarityColor.Green2, Item.buyPrice(gold: 1)); - break; - case 4095: - this.maxStack = 1; - this.consumable = false; - this.width = 18; - this.height = 18; - this.useStyle = 4; - this.useTime = 10; - this.UseSound = SoundID.Item128; - this.useAnimation = 10; - this.rare = 4; - this.value = Item.sellPrice(gold: 2); - break; - case 4096: - case 4097: - case 4098: - case 4099: - case 4100: - case 4101: - case 4102: - case 4103: - case 4104: - case 4105: - case 4106: - case 4107: - case 4108: - case 4109: - case 4110: - case 4111: - case 4112: - case 4113: - case 4114: - case 4115: - case 4116: - case 4117: - case 4118: - case 4119: - case 4120: - case 4121: - case 4122: - case 4123: - case 4124: - case 4125: - case 4126: - this.DefaultToPlacableTile((ushort) 497, type - 4096); - this.maxStack = 99; - this.value = 150; - break; - case 4127: - this.DefaultToPlacableTile((ushort) 497, type - 4096); - this.maxStack = 99; - this.value = 100000; - break; - case 4128: - this.width = 18; - this.height = 18; - this.headSlot = 217; - this.rare = 3; - this.vanity = true; - this.value = Item.sellPrice(silver: 50); - break; - case 4129: - this.width = 18; - this.height = 18; - this.bodySlot = 210; - this.rare = 3; - this.vanity = true; - this.value = Item.sellPrice(silver: 50); - break; - case 4130: - this.width = 18; - this.height = 18; - this.legSlot = 180; - this.rare = 3; - this.vanity = true; - this.value = Item.sellPrice(silver: 50); - break; - case 4131: - this.useStyle = 1; - this.shootSpeed = 4f; - this.shoot = 734; - this.width = 26; - this.height = 24; - this.UseSound = SoundID.Item130; - this.useAnimation = 28; - this.useTime = 28; - this.rare = 3; - this.value = Item.sellPrice(gold: 2); - break; - case 4132: - this.width = 18; - this.height = 18; - this.headSlot = 218; - this.rare = 3; - this.vanity = true; - this.value = Item.sellPrice(silver: 50); - break; - case 4133: - this.width = 18; - this.height = 18; - this.bodySlot = 211; - this.rare = 3; - this.vanity = true; - this.value = Item.sellPrice(silver: 50); - break; - case 4134: - this.width = 18; - this.height = 18; - this.legSlot = 184; - this.rare = 3; - this.vanity = true; - this.value = Item.sellPrice(silver: 50); - break; - case 4135: - this.width = 18; - this.height = 18; - this.headSlot = 219; - this.rare = 3; - this.vanity = true; - this.value = Item.sellPrice(silver: 50); - break; - case 4136: - this.width = 18; - this.height = 18; - this.bodySlot = 212; - this.rare = 3; - this.vanity = true; - this.value = Item.sellPrice(silver: 50); - break; - case 4137: - this.width = 18; - this.height = 18; - this.legSlot = 185; - this.rare = 3; - this.vanity = true; - this.value = Item.sellPrice(silver: 50); - break; - case 4138: - this.width = 18; - this.height = 18; - this.headSlot = 220; - this.rare = 3; - this.vanity = true; - this.value = Item.sellPrice(silver: 50); - break; - case 4139: - this.DefaultToPlacableTile((ushort) 498, 0); - this.SetShopValues(ItemRarityColor.White0, 0); - break; - case 4140: - this.DefaultToPlacableWall((ushort) 236); - this.SetShopValues(ItemRarityColor.White0, 0); - break; - case 4141: - this.DefaultToPlacableTile((ushort) 497, 32); - this.maxStack = 99; - this.value = 150; - break; - case 4142: - this.DefaultToPlacableTile((ushort) 499, 0); - this.maxStack = 99; - this.SetShopValues(ItemRarityColor.White0, 100000); - break; - case 4143: - this.width = 12; - this.height = 12; - break; - case 4144: - this.width = 14; - this.height = 38; - this.useAnimation = 25; - this.useTime = 15; - this.useStyle = 5; - this.rare = 2; - this.noUseGraphic = true; - this.channel = true; - this.noMelee = true; - this.damage = 17; - this.knockBack = 3f; - this.autoReuse = false; - this.noMelee = true; - this.melee = true; - this.shoot = 735; - this.shootSpeed = 15f; - this.value = Item.sellPrice(gold: 5); - break; - case 4145: - this.DefaultToPlacableTile((ushort) 90, 34); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4146: - this.DefaultToPlacableTile((ushort) 79, 34); - this.SetShopValues(ItemRarityColor.White0, 2000); - this.maxStack = 99; - this.width = 28; - this.height = 20; - break; - case 4147: - this.DefaultToPlacableTile((ushort) 101, 35); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4148: - this.DefaultToPlacableTile((ushort) 88, 34); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4149: - this.DefaultToPlacableTile((ushort) 100, 34); - this.SetShopValues(ItemRarityColor.White0, 1500); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4150: - this.DefaultToPlacableTile((ushort) 33, 33); - this.SetShopValues(ItemRarityColor.White0, 0); - this.maxStack = 99; - this.width = 8; - this.height = 18; - this.value = Item.sellPrice(copper: 60); - this.noWet = true; - break; - case 4151: - this.DefaultToPlacableTile((ushort) 15, 39); - this.SetShopValues(ItemRarityColor.White0, 150); - this.maxStack = 99; - this.width = 12; - this.height = 30; - break; - case 4152: - this.DefaultToPlacableTile((ushort) 34, 40); - this.SetShopValues(ItemRarityColor.White0, 3000); - this.maxStack = 99; - this.width = 26; - this.height = 26; - break; - case 4153: - this.DefaultToPlacableTile((ushort) 467, 5); - this.SetShopValues(ItemRarityColor.White0, 500); - this.maxStack = 99; - this.width = 26; - this.height = 22; - break; - case 4154: - this.DefaultToPlacableTile((ushort) 104, 35); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4155: - this.DefaultToPlacableTile((ushort) 10, 39); - this.SetShopValues(ItemRarityColor.White0, 200); - this.maxStack = 99; - this.width = 14; - this.height = 28; - break; - case 4156: - this.DefaultToPlacableTile((ushort) 93, 34); - this.SetShopValues(ItemRarityColor.White0, 500); - this.maxStack = 99; - this.width = 10; - this.height = 24; - break; - case 4157: - this.DefaultToPlacableTile((ushort) 42, 40); - this.SetShopValues(ItemRarityColor.White0, 150); - this.maxStack = 99; - this.width = 12; - this.height = 28; - break; - case 4158: - this.DefaultToPlacableTile((ushort) 87, 34); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4159: - this.DefaultToPlacableTile((ushort) 19, 38); - this.SetShopValues(ItemRarityColor.White0, 0); - this.width = 8; - this.height = 10; - break; - case 4160: - this.DefaultToPlacableTile((ushort) 172, 35); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4161: - this.DefaultToPlacableTile((ushort) 89, 37); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4162: - this.DefaultToPlacableTile((ushort) 469, 3); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 26; - this.height = 20; - break; - case 4163: - this.DefaultToPlacableTile((ushort) 18, 35); - this.SetShopValues(ItemRarityColor.White0, 150); - this.maxStack = 99; - this.width = 28; - this.height = 14; - break; - case 4164: - this.DefaultToPlacableTile((ushort) 468, 5); - this.SetShopValues(ItemRarityColor.White0, 500); - this.maxStack = 99; - this.width = 26; - this.height = 22; - break; - case 4165: - this.DefaultToPlacableTile((ushort) 497, 33); - this.maxStack = 99; - this.value = 150; - break; - case 4166: - this.DefaultToPlacableTile((ushort) 90, 35); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4167: - this.DefaultToPlacableTile((ushort) 79, 35); - this.SetShopValues(ItemRarityColor.White0, 2000); - this.maxStack = 99; - this.width = 28; - this.height = 20; - break; - case 4168: - this.DefaultToPlacableTile((ushort) 101, 36); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4169: - this.DefaultToPlacableTile((ushort) 88, 35); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4170: - this.DefaultToPlacableTile((ushort) 100, 35); - this.SetShopValues(ItemRarityColor.White0, 1500); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4171: - this.DefaultToPlacableTile((ushort) 33, 34); - this.SetShopValues(ItemRarityColor.White0, 0); - this.maxStack = 99; - this.width = 8; - this.height = 18; - this.value = Item.sellPrice(copper: 60); - this.noWet = true; - break; - case 4172: - this.DefaultToPlacableTile((ushort) 15, 40); - this.SetShopValues(ItemRarityColor.White0, 150); - this.maxStack = 99; - this.width = 12; - this.height = 30; - break; - case 4173: - this.DefaultToPlacableTile((ushort) 34, 41); - this.SetShopValues(ItemRarityColor.White0, 3000); - this.maxStack = 99; - this.width = 26; - this.height = 26; - break; - case 4174: - this.DefaultToPlacableTile((ushort) 467, 6); - this.SetShopValues(ItemRarityColor.White0, 500); - this.maxStack = 99; - this.width = 26; - this.height = 22; - break; - case 4175: - this.DefaultToPlacableTile((ushort) 104, 36); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4176: - this.DefaultToPlacableTile((ushort) 10, 40); - this.SetShopValues(ItemRarityColor.White0, 200); - this.maxStack = 99; - this.width = 14; - this.height = 28; - break; - case 4177: - this.DefaultToPlacableTile((ushort) 93, 35); - this.SetShopValues(ItemRarityColor.White0, 500); - this.maxStack = 99; - this.width = 10; - this.height = 24; - break; - case 4178: - this.DefaultToPlacableTile((ushort) 42, 41); - this.SetShopValues(ItemRarityColor.White0, 150); - this.maxStack = 99; - this.width = 12; - this.height = 28; - break; - case 4179: - this.DefaultToPlacableTile((ushort) 87, 35); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4180: - this.DefaultToPlacableTile((ushort) 19, 39); - this.SetShopValues(ItemRarityColor.White0, 0); - this.width = 8; - this.height = 10; - break; - case 4181: - this.DefaultToPlacableTile((ushort) 172, 36); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4182: - this.DefaultToPlacableTile((ushort) 89, 38); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4183: - this.DefaultToPlacableTile((ushort) 469, 4); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 26; - this.height = 20; - break; - case 4184: - this.DefaultToPlacableTile((ushort) 18, 36); - this.SetShopValues(ItemRarityColor.White0, 150); - this.maxStack = 99; - this.width = 28; - this.height = 14; - break; - case 4185: - this.DefaultToPlacableTile((ushort) 468, 6); - this.SetShopValues(ItemRarityColor.White0, 500); - this.maxStack = 99; - this.width = 26; - this.height = 22; - break; - case 4186: - this.DefaultToPlacableTile((ushort) 497, 34); - this.maxStack = 99; - this.value = 150; - break; - case 4187: - this.DefaultToPlacableTile((ushort) 90, 36); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4188: - this.DefaultToPlacableTile((ushort) 79, 36); - this.SetShopValues(ItemRarityColor.White0, 2000); - this.maxStack = 99; - this.width = 28; - this.height = 20; - break; - case 4189: - this.DefaultToPlacableTile((ushort) 101, 37); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4190: - this.DefaultToPlacableTile((ushort) 88, 36); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4191: - this.DefaultToPlacableTile((ushort) 100, 36); - this.SetShopValues(ItemRarityColor.White0, 1500); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4192: - this.DefaultToPlacableTile((ushort) 33, 35); - this.SetShopValues(ItemRarityColor.White0, 0); - this.maxStack = 99; - this.width = 8; - this.height = 18; - this.value = Item.sellPrice(copper: 60); - this.noWet = true; - break; - case 4193: - this.DefaultToPlacableTile((ushort) 15, 41); - this.SetShopValues(ItemRarityColor.White0, 150); - this.maxStack = 99; - this.width = 12; - this.height = 30; - break; - case 4194: - this.DefaultToPlacableTile((ushort) 34, 42); - this.SetShopValues(ItemRarityColor.White0, 3000); - this.maxStack = 99; - this.width = 26; - this.height = 26; - break; - case 4195: - this.DefaultToPlacableTile((ushort) 467, 7); - this.SetShopValues(ItemRarityColor.White0, 500); - this.maxStack = 99; - this.width = 26; - this.height = 22; - break; - case 4196: - this.DefaultToPlacableTile((ushort) 104, 37); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4197: - this.DefaultToPlacableTile((ushort) 10, 41); - this.SetShopValues(ItemRarityColor.White0, 200); - this.maxStack = 99; - this.width = 14; - this.height = 28; - break; - case 4198: - this.DefaultToPlacableTile((ushort) 93, 36); - this.SetShopValues(ItemRarityColor.White0, 500); - this.maxStack = 99; - this.width = 10; - this.height = 24; - break; - case 4199: - this.DefaultToPlacableTile((ushort) 42, 42); - this.SetShopValues(ItemRarityColor.White0, 150); - this.maxStack = 99; - this.width = 12; - this.height = 28; - break; - case 4200: - this.DefaultToPlacableTile((ushort) 87, 36); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4201: - this.DefaultToPlacableTile((ushort) 19, 40); - this.SetShopValues(ItemRarityColor.White0, 0); - this.width = 8; - this.height = 10; - break; - case 4202: - this.DefaultToPlacableTile((ushort) 172, 37); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4203: - this.DefaultToPlacableTile((ushort) 89, 39); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4204: - this.DefaultToPlacableTile((ushort) 469, 5); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 26; - this.height = 20; - break; - case 4205: - this.DefaultToPlacableTile((ushort) 18, 37); - this.SetShopValues(ItemRarityColor.White0, 150); - this.maxStack = 99; - this.width = 28; - this.height = 14; - break; - case 4206: - this.DefaultToPlacableTile((ushort) 468, 7); - this.SetShopValues(ItemRarityColor.White0, 500); - this.maxStack = 99; - this.width = 26; - this.height = 22; - break; - case 4207: - this.DefaultToPlacableTile((ushort) 497, 35); - this.maxStack = 99; - this.value = 150; - break; - case 4208: - this.DefaultToPlacableTile((ushort) 90, 37); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4209: - this.DefaultToPlacableTile((ushort) 79, 37); - this.SetShopValues(ItemRarityColor.White0, 2000); - this.maxStack = 99; - this.width = 28; - this.height = 20; - break; - case 4210: - this.DefaultToPlacableTile((ushort) 101, 38); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4211: - this.DefaultToPlacableTile((ushort) 88, 37); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4212: - this.DefaultToPlacableTile((ushort) 100, 37); - this.SetShopValues(ItemRarityColor.White0, 1500); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4213: - this.DefaultToPlacableTile((ushort) 33, 36); - this.SetShopValues(ItemRarityColor.White0, 0); - this.maxStack = 99; - this.width = 8; - this.height = 18; - this.value = Item.sellPrice(copper: 60); - this.noWet = true; - break; - case 4214: - this.DefaultToPlacableTile((ushort) 15, 42); - this.SetShopValues(ItemRarityColor.White0, 150); - this.maxStack = 99; - this.width = 12; - this.height = 30; - break; - case 4215: - this.DefaultToPlacableTile((ushort) 34, 43); - this.SetShopValues(ItemRarityColor.White0, 3000); - this.maxStack = 99; - this.width = 26; - this.height = 26; - break; - case 4216: - this.DefaultToPlacableTile((ushort) 467, 8); - this.SetShopValues(ItemRarityColor.White0, 500); - this.maxStack = 99; - this.width = 26; - this.height = 22; - break; - case 4217: - this.DefaultToPlacableTile((ushort) 104, 38); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4218: - this.DefaultToPlacableTile((ushort) 10, 42); - this.SetShopValues(ItemRarityColor.White0, 200); - this.maxStack = 99; - this.width = 14; - this.height = 28; - break; - case 4219: - this.DefaultToPlacableTile((ushort) 93, 37); - this.SetShopValues(ItemRarityColor.White0, 500); - this.maxStack = 99; - this.width = 10; - this.height = 24; - break; - case 4220: - this.DefaultToPlacableTile((ushort) 42, 43); - this.SetShopValues(ItemRarityColor.White0, 150); - this.maxStack = 99; - this.width = 12; - this.height = 28; - break; - case 4221: - this.DefaultToPlacableTile((ushort) 87, 37); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4222: - this.DefaultToPlacableTile((ushort) 19, 41); - this.SetShopValues(ItemRarityColor.White0, 0); - this.width = 8; - this.height = 10; - break; - case 4223: - this.DefaultToPlacableTile((ushort) 172, 38); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4224: - this.DefaultToPlacableTile((ushort) 89, 40); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4225: - this.DefaultToPlacableTile((ushort) 469, 6); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 26; - this.height = 20; - break; - case 4226: - this.DefaultToPlacableTile((ushort) 18, 38); - this.SetShopValues(ItemRarityColor.White0, 150); - this.maxStack = 99; - this.width = 28; - this.height = 14; - break; - case 4227: - this.DefaultToPlacableTile((ushort) 468, 8); - this.SetShopValues(ItemRarityColor.White0, 500); - this.maxStack = 99; - this.width = 26; - this.height = 22; - break; - case 4228: - this.DefaultToPlacableTile((ushort) 497, 36); - this.maxStack = 99; - this.value = 150; - break; - case 4229: - this.DefaultToPlacableTile((ushort) 500, 0); - break; - case 4230: - this.DefaultToPlacableTile((ushort) 501, 0); - break; - case 4231: - this.DefaultToPlacableTile((ushort) 502, 0); - break; - case 4232: - this.DefaultToPlacableTile((ushort) 503, 0); - break; - case 4233: - this.DefaultToPlacableWall((ushort) 237); - break; - case 4234: - this.DefaultToPlacableWall((ushort) 238); - break; - case 4235: - this.DefaultToPlacableWall((ushort) 239); - break; - case 4236: - this.DefaultToPlacableWall((ushort) 240); - break; - case 4237: - this.DefaultToMusicBox(46); - break; - case 4238: - this.DefaultToPlacableTile((ushort) 481, 0); - break; - case 4239: - this.DefaultToPlacableTile((ushort) 482, 0); - break; - case 4240: - this.DefaultToPlacableTile((ushort) 483, 0); - break; - case 4242: - this.DefaultToGolfBall(739); - break; - case 4243: - this.DefaultToGolfBall(740); - break; - case 4244: - this.DefaultToGolfBall(741); - break; - case 4245: - this.DefaultToGolfBall(742); - break; - case 4246: - this.DefaultToGolfBall(743); - break; - case 4247: - this.DefaultToGolfBall(744); - break; - case 4248: - this.DefaultToGolfBall(745); - break; - case 4249: - this.DefaultToGolfBall(746); - break; - case 4250: - this.DefaultToGolfBall(747); - break; - case 4251: - this.DefaultToGolfBall(748); - break; - case 4252: - this.DefaultToGolfBall(749); - break; - case 4253: - this.DefaultToGolfBall(750); - break; - case 4254: - this.DefaultToGolfBall(751); - break; - case 4255: - this.DefaultToGolfBall(752); - break; - case 4256: - this.defense = 3; - this.width = 18; - this.height = 14; - this.bodySlot = 213; - this.value = Item.sellPrice(silver: 50) * 6; - this.rare = 2; - break; - case 4257: - this.noUseGraphic = true; - this.damage = 0; - this.knockBack = 7f; - this.useStyle = 5; - this.shootSpeed = 12.5f; - this.shoot = 753; - this.width = 18; - this.height = 28; - this.UseSound = SoundID.Item1; - this.useAnimation = 20; - this.useTime = 20; - this.rare = 1; - this.noMelee = true; - this.value = 20000; - break; - case 4258: - this.useStyle = 1; - this.useAnimation = 25; - this.knockBack = 3f; - this.width = 40; - this.height = 40; - this.damage = 21; - this.scale = 1f; - this.UseSound = SoundID.Item15; - this.rare = 1; - this.value = 27000; - this.melee = true; - break; - case 4259: - this.SetDefaults(198); - this.type = type; - this.damage = 42; - this.useTime = 20; - this.useAnimation = 20; - this.scale = 1.15f; - this.autoReuse = true; - this.useTurn = true; - this.rare = 4; - this.value = Item.sellPrice(gold: 1); - break; - case 4260: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 7; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createWall = 241; - this.width = 12; - this.height = 12; - this.value = Item.sellPrice(silver: 5); - break; - case 4261: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 135; - this.width = 12; - this.height = 12; - this.placeStyle = 7; - this.mech = true; - this.value = 5000; - break; - case 4262: - this.useTurn = true; - this.width = 20; - this.height = 20; - this.useStyle = 5; - this.useTime = 90; - this.UseSound = SoundID.Item151; - this.useAnimation = 90; - this.rare = 1; - this.value = 50000; - this.shoot = 754; - break; - case 4263: - this.useTurn = true; - this.width = 20; - this.height = 20; - this.useStyle = 4; - this.useTime = 90; - this.UseSound = SoundID.Item6; - this.useAnimation = 90; - this.rare = 1; - this.value = 50000; - break; - case 4264: - this.useStyle = 4; - this.channel = true; - this.width = 34; - this.height = 34; - this.UseSound = SoundID.Item25; - this.useAnimation = 20; - this.useTime = 20; - this.rare = 8; - this.noMelee = true; - this.mountType = 17; - this.value = Item.sellPrice(gold: 10); - break; - case 4265: - this.DefaultToPlacableTile((ushort) 467, 9); - this.SetShopValues(ItemRarityColor.White0, Item.buyPrice(gold: 3)); - this.maxStack = 99; - this.width = 26; - this.height = 22; - break; - case 4266: - this.DefaultToPlacableTile((ushort) 468, 9); - this.SetShopValues(ItemRarityColor.White0, 500); - this.maxStack = 99; - this.width = 26; - this.height = 22; - break; - case 4267: - this.DefaultToPlacableTile((ushort) 467, 10); - this.SetShopValues(ItemRarityColor.White0, 500); - this.maxStack = 99; - this.width = 26; - this.height = 22; - break; - case 4268: - this.DefaultToPlacableTile((ushort) 468, 10); - this.SetShopValues(ItemRarityColor.White0, 500); - this.maxStack = 99; - this.width = 26; - this.height = 22; - break; - case 4269: - this.mana = 10; - this.damage = 35; - this.useStyle = 1; - this.shootSpeed = 10f; - this.shoot = 755; - this.buffType = 213; - this.width = 26; - this.height = 28; - this.UseSound = SoundID.Item113; - this.useAnimation = 36; - this.useTime = 36; - this.rare = 4; - this.noMelee = true; - this.knockBack = 8f; - this.value = Item.sellPrice(gold: 5); - this.summon = true; - break; - case 4270: - this.mana = 20; - this.damage = 29; - this.useStyle = 4; - this.shootSpeed = 32f; - this.shoot = 756; - this.width = 26; - this.height = 28; - this.useAnimation = 21; - this.useTime = 7; - this.rare = 4; - this.noMelee = true; - this.knockBack = 1f; - this.value = Item.sellPrice(gold: 4); - this.magic = true; - this.autoReuse = true; - break; - case 4271: - this.useStyle = 4; - this.width = 22; - this.height = 14; - this.consumable = true; - this.useAnimation = 45; - this.useTime = 45; - this.maxStack = 20; - this.rare = 2; - break; - case 4272: - this.noMelee = true; - this.useStyle = 5; - this.useAnimation = 40; - this.useTime = 40; - this.knockBack = 6.5f; - this.width = 30; - this.height = 10; - this.damage = 55; - this.scale = 1.1f; - this.noUseGraphic = true; - this.shoot = 757; - this.shootSpeed = 15.9f; - this.UseSound = SoundID.Item1; - this.rare = 4; - this.value = Item.sellPrice(gold: 4); - this.melee = true; - this.channel = true; - break; - case 4273: - this.mana = 10; - this.damage = 11; - this.useStyle = 1; - this.shootSpeed = 10f; - this.shoot = 758; - this.width = 26; - this.height = 28; - this.UseSound = SoundID.Item44; - this.useAnimation = 36; - this.useTime = 36; - this.noMelee = true; - this.knockBack = 5f; - this.buffType = 214; - this.value = Item.sellPrice(gold: 1); - this.rare = 3; - this.summon = true; - break; - case 4274: - this.useStyle = 1; - this.autoReuse = true; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.maxStack = 999; - this.consumable = true; - this.width = 12; - this.height = 12; - this.noUseGraphic = true; - this.value = Item.sellPrice(gold: 10); - this.rare = 3; - this.makeNPC = (short) 592; - break; - case 4275: - this.width = 18; - this.height = 18; - this.headSlot = 221; - this.value = Item.sellPrice(gold: 10); - this.rare = 3; - this.vanity = true; - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 505; - this.width = 12; - this.height = 12; - break; - case 4276: - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 10)); - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 506; - this.width = 20; - this.height = 20; - break; - case 4277: - this.DefaultToPlacableTile((ushort) 507, 0); - break; - case 4278: - this.DefaultToPlacableTile((ushort) 508, 0); - break; - case 4279: - this.DefaultToPlacableWall((ushort) 242); - break; - case 4280: - this.DefaultToPlacableWall((ushort) 243); - break; - case 4281: - this.mana = 10; - this.damage = 7; - this.useStyle = 1; - this.shootSpeed = 10f; - this.shoot = 759; - this.buffType = 216; - this.width = 26; - this.height = 28; - this.UseSound = SoundID.Item113; - this.useAnimation = 36; - this.useTime = 36; - this.rare = 1; - this.noMelee = true; - this.knockBack = 4f; - this.value = Item.sellPrice(gold: 1); - this.summon = true; - break; - case 4298: - this.DefaultToPlacableTile((ushort) 90, 38); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4299: - this.DefaultToPlacableTile((ushort) 79, 38); - this.SetShopValues(ItemRarityColor.White0, 2000); - this.maxStack = 99; - this.width = 28; - this.height = 20; - break; - case 4300: - this.DefaultToPlacableTile((ushort) 101, 39); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4301: - this.DefaultToPlacableTile((ushort) 88, 38); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4302: - this.DefaultToPlacableTile((ushort) 100, 38); - this.SetShopValues(ItemRarityColor.White0, 1500); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4303: - this.DefaultToPlacableTile((ushort) 33, 37); - this.SetShopValues(ItemRarityColor.White0, 0); - this.maxStack = 99; - this.width = 8; - this.height = 18; - this.value = Item.sellPrice(copper: 60); - this.noWet = true; - break; - case 4304: - this.DefaultToPlacableTile((ushort) 15, 43); - this.SetShopValues(ItemRarityColor.White0, 150); - this.maxStack = 99; - this.width = 12; - this.height = 30; - break; - case 4305: - this.DefaultToPlacableTile((ushort) 34, 44); - this.SetShopValues(ItemRarityColor.White0, 3000); - this.maxStack = 99; - this.width = 26; - this.height = 26; - break; - case 4306: - this.DefaultToPlacableTile((ushort) 104, 39); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4307: - this.DefaultToPlacableTile((ushort) 10, 43); - this.SetShopValues(ItemRarityColor.White0, 200); - this.maxStack = 99; - this.width = 14; - this.height = 28; - break; - case 4308: - this.DefaultToPlacableTile((ushort) 93, 38); - this.SetShopValues(ItemRarityColor.White0, 500); - this.maxStack = 99; - this.width = 10; - this.height = 24; - break; - case 4309: - this.DefaultToPlacableTile((ushort) 42, 44); - this.SetShopValues(ItemRarityColor.White0, 150); - this.maxStack = 99; - this.width = 12; - this.height = 28; - break; - case 4310: - this.DefaultToPlacableTile((ushort) 87, 38); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4311: - this.DefaultToPlacableTile((ushort) 19, 42); - this.SetShopValues(ItemRarityColor.White0, 0); - this.width = 8; - this.height = 10; - break; - case 4312: - this.DefaultToPlacableTile((ushort) 172, 39); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4313: - this.DefaultToPlacableTile((ushort) 89, 41); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4314: - this.DefaultToPlacableTile((ushort) 469, 7); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 26; - this.height = 20; - break; - case 4315: - this.DefaultToPlacableTile((ushort) 18, 39); - this.SetShopValues(ItemRarityColor.White0, 150); - this.maxStack = 99; - this.width = 28; - this.height = 14; - break; - case 4316: - this.DefaultToPlacableTile((ushort) 497, 37); - this.maxStack = 99; - this.value = 150; - break; - case 4317: - this.SetShopValues(ItemRarityColor.LightRed4, Item.sellPrice(gold: 2)); - this.SetWeaponValues(30, 7f); - this.melee = true; - this.autoReuse = true; - this.useTime = 11; - this.useAnimation = 27; - this.useStyle = 1; - this.hammer = 80; - this.axe = 30; - this.UseSound = SoundID.Item1; - this.width = 20; - this.height = 20; - break; - case 4318: - this.DefaultToPlacableTile((ushort) 509, 0); - this.width = 22; - this.height = 32; - this.rare = 9; - this.value = Item.sellPrice(gold: 25); - break; - case 4319: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 510; - this.width = 28; - this.height = 28; - this.SetShopValues(ItemRarityColor.White0, Item.buyPrice(silver: 20)); - break; - case 4320: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 511; - this.width = 28; - this.height = 28; - this.SetShopValues(ItemRarityColor.White0, Item.buyPrice(silver: 20)); - break; - case 4321: - this.width = 18; - this.height = 18; - this.bodySlot = 214; - this.rare = 3; - this.vanity = true; - this.value = Item.buyPrice(gold: 5); - break; - case 4322: - this.width = 18; - this.height = 18; - this.legSlot = 188; - this.rare = 3; - this.vanity = true; - this.value = Item.buyPrice(gold: 5); - break; - case 4323: - this.width = 18; - this.height = 18; - this.headSlot = 222; - this.rare = 3; - this.vanity = true; - this.value = Item.buyPrice(gold: 50); - break; - case 4324: - this.width = 18; - this.height = 14; - this.bodySlot = 215; - this.value = Item.buyPrice(gold: 50); - this.rare = 3; - this.vanity = true; - break; - case 4325: - this.useStyle = 1; - this.useAnimation = 8; - this.useTime = 8; - this.width = 24; - this.height = 28; - this.UseSound = SoundID.Item1; - this.shoot = 760; - this.fishingPole = 25; - this.shootSpeed = 15f; - this.rare = 2; - this.value = Item.sellPrice(gold: 2); - break; - case 4326: - this.DefaultToPlacableTile((ushort) 520, 0); - this.maxStack = 99; - this.value = 150; - break; - case 4327: - case 4328: - case 4329: - case 4330: - case 4331: - case 4332: - this.DefaultToPlacableTile((ushort) (type - 4327 + 521), 0); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4333: - this.DefaultToPlacableTile((ushort) 527, 0); - this.value = Item.sellPrice(gold: 10); - this.rare = 3; - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4334: - case 4335: - case 4336: - case 4337: - case 4338: - case 4339: - this.DefaultToCapturedCritter((short) (type - 4334 + 595)); - this.SetShopValues(ItemRarityColor.White0, Item.sellPrice(silver: 10)); - this.width = 20; - this.height = 20; - this.bait = 20; - break; - case 4340: - this.DefaultToCapturedCritter((short) 601); - this.value = Item.sellPrice(gold: 10); - this.rare = 3; - this.width = 20; - this.height = 20; - this.bait = 50; - break; - case 4341: - this.DefaultToAccessory(30, 30); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(gold: 1)); - break; - case 4342: - this.DefaultToPlacableTile((ushort) 105, 78); - this.SetShopValues(ItemRarityColor.White0, Item.sellPrice(copper: 60)); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4343: - this.width = 22; - this.height = 16; - this.SetShopValues(ItemRarityColor.White0, Item.sellPrice(silver: 10)); - this.DefaultToThrownWeapon(761, 17, 5f); - this.SetWeaponValues(4, 2f); - break; - case 4344: - this.width = 22; - this.height = 16; - this.SetShopValues(ItemRarityColor.White0, Item.sellPrice(silver: 10)); - this.DefaultToThrownWeapon(762, 17, 5f); - this.SetWeaponValues(4, 2f); - break; - case 4345: - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(silver: 5)); - this.maxStack = 99; - this.width = 12; - this.height = 12; - break; - case 4346: - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 5)); - this.width = 30; - this.height = 30; - break; - case 4347: - this.SetShopValues(ItemRarityColor.Green2, Item.buyPrice(gold: 17)); - this.DefaultToMagicWeapon(876, 37, 15f); - this.mana = 16; - this.width = 40; - this.height = 40; - this.knockBack = 6f; - this.scale = 0.75f; - this.damage = 42; - this.UseSound = SoundID.Item158; - break; - case 4348: - this.SetShopValues(ItemRarityColor.Pink5, Item.buyPrice(gold: 50)); - this.DefaultToMagicWeapon(876, 37, 15f); - this.mana = 16; - this.width = 40; - this.height = 40; - this.knockBack = 6f; - this.scale = 0.75f; - this.damage = 100; - this.UseSound = SoundID.Item158; - break; - case 4349: - case 4350: - case 4351: - case 4352: - case 4353: - this.DefaultToPlacableTile(179 + type - 4349); - break; - case 4354: - this.DefaultToPlacableTile((ushort) 381, 0); - break; - case 4355: - this.DefaultToPlacableTile((ushort) 531, 0); - this.SetShopValues(ItemRarityColor.White0, Item.sellPrice(copper: 60)); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4356: - this.DefaultToMusicBox(47); - break; - case 4357: - this.DefaultToMusicBox(48); - break; - case 4358: - this.DefaultToMusicBox(49); - break; - case 4359: - this.DefaultToCapturedCritter((short) 602); - this.SetShopValues(ItemRarityColor.White0, Item.sellPrice(silver: 7, copper: 50)); - this.width = 20; - this.height = 20; - break; - case 4360: - this.DefaultToPlacableTile((ushort) 105, 77); - this.SetShopValues(ItemRarityColor.White0, Item.sellPrice(copper: 60)); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4361: - this.DefaultToCapturedCritter((short) 604); - this.SetShopValues(ItemRarityColor.White0, Item.sellPrice(silver: 10)); - this.width = 20; - this.height = 20; - this.bait = 17; - break; - case 4362: - this.DefaultToCapturedCritter((short) 605); - this.value = Item.sellPrice(gold: 10); - this.rare = 3; - this.width = 20; - this.height = 20; - this.bait = 50; - break; - case 4363: - this.DefaultToCapturedCritter((short) 606); - this.SetShopValues(ItemRarityColor.White0, Item.sellPrice(silver: 5)); - this.width = 12; - this.height = 12; - this.bait = 22; - break; - case 4364: - this.DefaultToPlacableTile((ushort) 532, 0); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4365: - this.DefaultToVanitypet(764, 217); - this.SetShopValues(ItemRarityColor.Pink5, Item.buyPrice(1)); - break; - case 4366: - this.DefaultToVanitypet(765, 218); - break; - case 4367: - case 4368: - case 4369: - case 4370: - case 4371: - this.DefaultTokite(type - 4367 + 766); - break; - case 4372: - this.SetShopValues(ItemRarityColor.Orange3, Item.buyPrice(gold: 1)); - this.DefaultToGuitar(); - break; - case 4373: - this.DefaultToCapturedCritter((short) 607); - this.SetShopValues(ItemRarityColor.White0, Item.sellPrice(silver: 7, copper: 50)); - this.width = 12; - this.height = 12; - break; - case 4374: - this.DefaultToCapturedCritter((short) 608); - this.SetShopValues(ItemRarityColor.White0, Item.sellPrice(silver: 7, copper: 50)); - this.width = 12; - this.height = 12; - break; - case 4375: - this.DefaultToCapturedCritter((short) 610); - this.SetShopValues(ItemRarityColor.White0, Item.sellPrice(silver: 10)); - this.width = 12; - this.height = 12; - break; - case 4376: - this.DefaultToPlacableTile((ushort) 533, 0); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4377: - this.DefaultToPlacableTile((ushort) 534, 0); - this.rare = 1; - break; - case 4378: - this.DefaultToPlacableTile((ushort) 536, 0); - this.rare = 1; - break; - case 4379: - this.DefaultTokite(771); - break; - case 4380: - this.DefaultToPlacableTile((ushort) 538, 0); - this.maxStack = 99; - break; - case 4381: - this.DefaultToBow(19, 9f, true); - this.SetWeaponValues(14, 3f); - this.value = Item.sellPrice(gold: 1); - this.rare = 3; - break; - case 4382: - this.useStyle = 4; - this.consumable = true; - this.useAnimation = 45; - this.useTime = 45; - this.UseSound = SoundID.Item92; - this.width = 28; - this.height = 28; - this.maxStack = 20; - this.rare = 2; - break; - case 4383: - this.DefaultToTorch(16); - break; - case 4384: - this.DefaultToTorch(17, true); - break; - case 4385: - this.DefaultToTorch(18); - break; - case 4386: - this.DefaultToTorch(19); - break; - case 4387: - this.DefaultToTorch(20); - break; - case 4388: - this.DefaultToTorch(21); - break; - case 4389: - this.DefaultToPlacableTile((ushort) 539, 0); - this.rare = 1; - break; - case 4390: - this.DefaultToPlacableTile((ushort) 484, 0); - break; - case 4391: - this.DefaultToPlacableTile((ushort) 162, 0); - break; - case 4392: - this.DefaultToPlacableTile((ushort) 541, 0); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(silver: 10)); - break; - case 4393: - case 4394: - this.DefaultToQuestFish(); - break; - case 4395: - this.DefaultToCapturedCritter((short) 611); - this.SetShopValues(ItemRarityColor.White0, Item.sellPrice(silver: 10)); - this.width = 12; - this.height = 12; - break; - case 4396: - this.DefaultToPlacableTile((ushort) 542, 0); - this.maxStack = 99; - break; - case 4397: - this.DefaultToPlacableTile((ushort) 105, 76); - this.SetShopValues(ItemRarityColor.White0, Item.sellPrice(copper: 60)); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4398: - this.DefaultToPlacableTile((ushort) 543, 0); - this.maxStack = 99; - this.width = 20; - this.height = 20; - this.value = Item.sellPrice(silver: 20); - break; - case 4399: - this.DefaultToPlacableTile((ushort) 544, 0); - this.value = Item.sellPrice(gold: 10); - this.rare = 3; - this.maxStack = 99; - break; - case 4400: - this.useStyle = 1; - this.shootSpeed = 7f; - this.shoot = 772; - this.width = 22; - this.height = 22; - this.UseSound = SoundID.Item1; - this.useAnimation = 15; - this.noUseGraphic = true; - this.useTime = 15; - this.rare = 2; - this.value = Item.sellPrice(silver: 5); - this.consumable = true; - this.maxStack = 999; - break; - case 4401: - this.SetShopValues(ItemRarityColor.White0, Item.buyPrice(silver: 7, copper: 50)); - this.maxStack = 999; - this.width = 26; - this.height = 26; - break; - case 4402: - this.SetShopValues(ItemRarityColor.White0, Item.buyPrice(gold: 1)); - this.maxStack = 999; - this.width = 26; - this.height = 26; - break; - case 4404: - this.DefaultToAccessory(20, 12); - this.SetShopValues(ItemRarityColor.White0, Item.buyPrice(gold: 1)); - this.canBePlacedInVanityRegardlessOfConditions = true; - break; - case 4405: - case 4406: - case 4407: - case 4408: - this.DefaultToPlacableTile((ushort) 376, 18 + type - 4405); - this.SetShopValues(ItemRarityColor.Green2, Item.sellPrice(gold: 1)); - this.maxStack = 99; - break; - case 4409: - this.DefaultToAccessory(28); - this.faceSlot = (sbyte) 14; - this.SetShopValues(ItemRarityColor.Pink5, Item.buyPrice(gold: 10)); - break; - case 4410: - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(silver: 1)); - this.maxStack = 99; - this.width = 32; - this.height = 22; - break; - case 4412: - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(gold: 1)); - this.maxStack = 999; - this.width = 22; - this.height = 22; - break; - case 4413: - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(gold: 5)); - this.maxStack = 999; - this.width = 22; - this.height = 22; - break; - case 4414: - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(gold: 25)); - this.maxStack = 999; - this.width = 22; - this.height = 22; - break; - case 4415: - this.DefaultToPlacableTile((ushort) 10, 44); - this.SetShopValues(ItemRarityColor.White0, Item.sellPrice(copper: 40)); - this.maxStack = 99; - this.width = 14; - this.height = 28; - break; - case 4416: - this.DefaultToPlacableTile((ushort) 19, 43); - this.SetShopValues(ItemRarityColor.White0, 0); - this.width = 8; - this.height = 10; - break; - case 4417: - this.DefaultToPlacableTile((ushort) 207, 9); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 4)); - this.width = 8; - this.height = 10; - break; - case 4418: - this.DefaultToCapturedCritter((short) 612); - this.SetShopValues(ItemRarityColor.White0, Item.sellPrice(silver: 10)); - this.width = 20; - this.height = 20; - this.bait = 17; - break; - case 4419: - this.DefaultToCapturedCritter((short) 613); - this.value = Item.sellPrice(gold: 10); - this.rare = 3; - this.width = 20; - this.height = 20; - this.bait = 50; - break; - case 4420: - this.DefaultToPlacableTile((ushort) 545, 0); - this.SetShopValues(ItemRarityColor.White0, Item.buyPrice(gold: 5)); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4421: - this.DefaultToMusicBox(50); - break; - case 4422: - this.DefaultToPlacableTile((ushort) 546, 0); - break; - case 4423: - this.useStyle = 1; - this.shootSpeed = 5f; - this.shoot = 773; - this.width = 20; - this.height = 20; - this.maxStack = 99; - this.UseSound = SoundID.Item1; - this.consumable = true; - this.useAnimation = 25; - this.noUseGraphic = true; - this.useTime = 25; - this.value = Item.sellPrice(silver: 3); - this.rare = 1; - break; - case 4424: - this.DefaultToPlacableWall((ushort) 245); - break; - case 4425: - this.DefaultToVanitypet(774, 219); - this.SetShopValues(ItemRarityColor.Pink5, Item.sellPrice(gold: 1)); - break; - case 4426: - this.DefaultToMount(18); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(gold: 1)); - break; - case 4427: - this.DefaultToMount(19); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(silver: 50)); - break; - case 4428: - this.DefaultToMount(20); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(gold: 1)); - break; - case 4429: - this.DefaultToMount(21); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(silver: 50)); - break; - case 4430: - this.DefaultToPlacableTile((ushort) 547, 0); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 3)); - break; - case 4431: - this.DefaultToPlacableTile((ushort) 547, 1); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 3)); - break; - case 4432: - this.DefaultToPlacableTile((ushort) 547, 2); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 3)); - break; - case 4433: - this.DefaultToPlacableTile((ushort) 547, 3); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 3)); - break; - case 4434: - this.DefaultToPlacableTile((ushort) 547, 4); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 3)); - break; - case 4435: - this.DefaultToPlacableTile((ushort) 548, 0); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 3)); - break; - case 4436: - this.DefaultToPlacableTile((ushort) 548, 1); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 3)); - break; - case 4437: - this.DefaultToPlacableTile((ushort) 548, 2); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 3)); - break; - case 4438: - this.DefaultToPlacableTile((ushort) 548, 3); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 3)); - break; - case 4439: - this.DefaultToPlacableTile((ushort) 548, 4); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 3)); - break; - case 4440: - this.DefaultToPlacableTile((ushort) 548, 5); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 3)); - break; - case 4441: - this.DefaultToPlacableTile((ushort) 548, 6); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 3)); - break; - case 4442: - this.useStyle = 1; - this.useAnimation = 8; - this.useTime = 8; - this.width = 24; - this.height = 28; - this.UseSound = SoundID.Item1; - this.shoot = 775; - this.fishingPole = 25; - this.shootSpeed = 15f; - this.rare = 1; - this.value = Item.sellPrice(gold: 2); - break; - case 4443: - this.DefaultToMount(22); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(gold: 1)); - break; - case 4444: - this.useStyle = 4; - this.channel = true; - this.width = 34; - this.height = 34; - this.UseSound = SoundID.Item25; - this.useAnimation = 20; - this.useTime = 20; - this.rare = 8; - this.noMelee = true; - this.mountType = 23; - this.value = Item.sellPrice(gold: 5); - this.expert = true; - break; - case 4445: - this.damage = 50; - this.width = 20; - this.height = 14; - this.maxStack = 999; - this.consumable = true; - this.ammo = AmmoID.Rocket; - this.knockBack = 4f; - this.value = Item.buyPrice(silver: 7, copper: 50); - this.ranged = true; - break; - case 4446: - this.damage = 50; - this.width = 20; - this.height = 14; - this.maxStack = 999; - this.consumable = true; - this.ammo = AmmoID.Rocket; - this.knockBack = 4f; - this.value = Item.buyPrice(silver: 15); - this.ranged = true; - break; - case 4447: - this.damage = 40; - this.width = 20; - this.height = 14; - this.maxStack = 999; - this.consumable = true; - this.ammo = AmmoID.Rocket; - this.knockBack = 4f; - this.value = Item.sellPrice(silver: 10); - this.ranged = true; - break; - case 4448: - this.damage = 40; - this.width = 20; - this.height = 14; - this.maxStack = 999; - this.consumable = true; - this.ammo = AmmoID.Rocket; - this.knockBack = 4f; - this.value = Item.sellPrice(silver: 10); - this.ranged = true; - break; - case 4449: - this.damage = 40; - this.width = 20; - this.height = 14; - this.maxStack = 999; - this.consumable = true; - this.ammo = AmmoID.Rocket; - this.knockBack = 4f; - this.value = Item.sellPrice(silver: 10); - this.ranged = true; - break; - case 4450: - this.DefaultToMount(24); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(gold: 1)); - break; - case 4451: - this.DefaultToMount(25); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(gold: 1)); - break; - case 4452: - this.DefaultToMount(26); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(gold: 1)); - break; - case 4453: - this.DefaultToMount(27); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(gold: 1)); - break; - case 4454: - this.DefaultToMount(28); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(gold: 1)); - break; - case 4455: - this.DefaultToMount(29); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(gold: 1)); - break; - case 4456: - this.DefaultToMount(30); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(gold: 1)); - break; - case 4457: - this.damage = 75; - this.width = 20; - this.height = 14; - this.maxStack = 999; - this.consumable = true; - this.ammo = AmmoID.Rocket; - this.knockBack = 4f; - this.value = Item.buyPrice(silver: 5); - this.ranged = true; - break; - case 4458: - this.damage = 75; - this.width = 20; - this.height = 14; - this.maxStack = 999; - this.consumable = true; - this.ammo = AmmoID.Rocket; - this.knockBack = 4f; - this.value = Item.buyPrice(silver: 10); - this.ranged = true; - break; - case 4459: - this.damage = 40; - this.width = 20; - this.height = 14; - this.maxStack = 999; - this.consumable = true; - this.ammo = AmmoID.Rocket; - this.knockBack = 4f; - this.value = Item.buyPrice(silver: 50); - this.ranged = true; - break; - case 4460: - this.tileWand = 169; - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.createTile = 552; - this.width = 8; - this.height = 10; - this.rare = 1; - this.value = Item.sellPrice(gold: 1); - break; - case 4461: - this.DefaultToPlacableTile((ushort) 550, 0); - this.maxStack = 99; - break; - case 4462: - this.DefaultToPlacableTile((ushort) 551, 0); - this.maxStack = 99; - break; - case 4463: - this.autoReuse = false; - this.useStyle = 13; - this.useAnimation = 21; - this.useTime = 7; - this.reuseDelay = 14; - this.width = 50; - this.height = 18; - this.shoot = 802; - this.UseSound = SoundID.Item1; - this.damage = 15; - this.shootSpeed = 2.4f; - this.noMelee = true; - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(silver: 30)); - this.melee = true; - this.knockBack = 0.5f; - this.noUseGraphic = true; - break; - case 4464: - this.DefaultToCapturedCritter((short) 616); - this.value = Item.sellPrice(silver: 10); - break; - case 4465: - this.DefaultToCapturedCritter((short) 617); - this.value = Item.sellPrice(silver: 10); - break; - case 4466: - this.DefaultToPlacableTile((ushort) 105, 79); - this.SetShopValues(ItemRarityColor.White0, Item.sellPrice(copper: 60)); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4467: - this.DefaultToMount(31); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(gold: 1)); - break; - case 4468: - this.DefaultToMount(32); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(gold: 4)); - break; - case 4469: - this.DefaultToMount(33); - this.SetShopValues(ItemRarityColor.StrongRed10, Item.sellPrice(gold: 10)); - break; - case 4470: - this.DefaultToMount(34); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 10)); - break; - case 4471: - this.DefaultToMount(35); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(gold: 1)); - break; - case 4472: - this.DefaultToMount(36); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 10)); - break; - case 4473: - this.DefaultToPlacableTile((ushort) 553, 0); - this.maxStack = 99; - break; - case 4474: - this.DefaultToPlacableTile((ushort) 554, 0); - this.maxStack = 99; - break; - case 4475: - this.DefaultToPlacableTile((ushort) 555, 0); - this.maxStack = 99; - break; - case 4476: - this.DefaultToPlacableTile((ushort) 556, 0); - this.maxStack = 99; - this.value = Item.sellPrice(gold: 10); - this.rare = 3; - break; - case 4477: - this.UseSound = SoundID.Item3; - this.useStyle = 9; - this.useTurn = true; - this.useAnimation = 17; - this.useTime = 17; - this.maxStack = 30; - this.consumable = true; - this.width = 14; - this.height = 24; - this.buffType = 257; - this.buffTime = 10800; - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(gold: 1)); - break; - case 4478: - this.UseSound = SoundID.Item3; - this.useStyle = 9; - this.useTurn = true; - this.useAnimation = 17; - this.useTime = 17; - this.maxStack = 30; - this.consumable = true; - this.width = 14; - this.height = 24; - this.buffType = 257; - this.buffTime = 18000; - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(gold: 5)); - break; - case 4479: - this.UseSound = SoundID.Item3; - this.useStyle = 9; - this.useTurn = true; - this.useAnimation = 17; - this.useTime = 17; - this.maxStack = 30; - this.consumable = true; - this.width = 14; - this.height = 24; - this.buffType = 257; - this.buffTime = 36000; - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(gold: 25)); - break; - case 4480: - this.DefaultToCapturedCritter((short) 626); - this.value = Item.sellPrice(silver: 15); - break; - case 4481: - this.DefaultToPlacableTile((ushort) 558, 0); - this.maxStack = 99; - break; - case 4482: - this.DefaultToCapturedCritter((short) 627); - this.value = Item.sellPrice(gold: 10); - this.rare = 3; - break; - case 4483: - this.DefaultToPlacableTile((ushort) 559, 0); - this.value = Item.sellPrice(gold: 10); - this.rare = 3; - this.maxStack = 99; - break; - case 4484: - case 4485: - this.mech = true; - this.noWet = true; - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 144; - this.placeStyle = type - 4484 + 3; - this.width = 10; - this.height = 12; - this.SetShopValues(ItemRarityColor.White0, Item.buyPrice(gold: 2)); - break; - case 4486: - case 4487: - case 4488: - case 4489: - case 4490: - case 4491: - case 4492: - case 4493: - case 4494: - case 4495: - case 4496: - case 4497: - case 4498: - case 4499: - case 4500: - case 4501: - case 4502: - case 4503: - this.DefaultToPlacableWall((ushort) (246 + type - 4486)); - break; - case 4504: - case 4505: - this.DefaultToPlacableWall((ushort) (264 + type - 4504)); - this.value = 250; - break; - case 4506: - case 4507: - this.DefaultToPlacableWall((ushort) (266 + type - 4506)); - break; - case 4508: - this.DefaultToPlacableWall((ushort) (268 + type - 4508)); - this.value = 250; - break; - case 4509: - case 4510: - case 4511: - this.DefaultToPlacableWall((ushort) (269 + type - 4509)); - break; - case 4512: - this.DefaultToPlacableWall((ushort) 274); - break; - case 4513: - case 4514: - case 4515: - case 4516: - case 4517: - case 4518: - case 4519: - case 4520: - case 4521: - case 4522: - case 4523: - case 4524: - case 4525: - case 4526: - case 4527: - case 4528: - case 4529: - case 4530: - case 4531: - case 4532: - case 4533: - case 4534: - case 4535: - case 4536: - case 4537: - case 4538: - case 4539: - case 4540: - this.DefaultToPlacableWall((ushort) (276 + type - 4513)); - break; - case 4541: - case 4542: - case 4543: - case 4544: - case 4545: - case 4546: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 91; - this.placeStyle = 288 + (type - 4541); - this.width = 10; - this.height = 24; - this.value = 1000; - this.rare = 1; - break; - case 4547: - this.DefaultToPlacableTile((ushort) 563, 0); - this.SetShopValues(ItemRarityColor.White0, Item.sellPrice(copper: 20)); - break; - case 4548: - this.DefaultToPlacableWall((ushort) 313); - break; - case 4549: - this.width = 18; - this.height = 18; - this.headSlot = 223; - this.rare = 3; - this.vanity = true; - this.value = Item.sellPrice(silver: 50); - break; - case 4550: - this.DefaultToVanitypet(825, 262); - this.SetShopValues(ItemRarityColor.Orange3, Item.buyPrice(1)); - break; - case 4551: - this.DefaultToVanitypet(821, 261); - break; - case 4552: - this.DefaultToPlacableTile((ushort) 565, 0); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 4)); - break; - case 4553: - this.DefaultToPlacableTile((ushort) 564, 0); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 2)); - break; - case 4554: - this.DefaultToPlacableTile((ushort) 561, 0); - break; - case 4555: - this.width = 18; - this.height = 18; - this.headSlot = 227; - this.rare = 0; - this.vanity = true; - this.value = Item.sellPrice(silver: 50); - break; - case 4556: - this.width = 18; - this.height = 18; - this.bodySlot = 216; - this.rare = 0; - this.vanity = true; - this.value = Item.sellPrice(silver: 50); - break; - case 4557: - this.width = 18; - this.height = 18; - this.legSlot = 190; - this.rare = 0; - this.vanity = true; - this.value = Item.sellPrice(silver: 50); - break; - case 4558: - this.width = 18; - this.height = 18; - this.headSlot = 228; - this.rare = 3; - this.vanity = true; - this.value = Item.buyPrice(gold: 2); - break; - case 4559: - this.width = 18; - this.height = 18; - this.headSlot = 229; - this.rare = 3; - this.vanity = true; - this.value = Item.buyPrice(gold: 2); - break; - case 4560: - this.width = 18; - this.height = 18; - this.headSlot = 224; - this.rare = 1; - this.vanity = true; - this.value = Item.buyPrice(gold: 3); - break; - case 4561: - this.width = 18; - this.height = 18; - this.headSlot = 225; - this.rare = 3; - this.vanity = true; - this.value = Item.sellPrice(silver: 50); - break; - case 4562: - this.width = 18; - this.height = 18; - this.headSlot = 226; - this.rare = 3; - this.vanity = true; - this.value = Item.sellPrice(silver: 50); - break; - case 4563: - this.DefaultToAccessory(18, 18); - this.rare = 3; - this.vanity = true; - this.value = Item.sellPrice(silver: 50); - this.canBePlacedInVanityRegardlessOfConditions = true; - break; - case 4564: - this.DefaultToPlacableTile((ushort) 562, 0); - this.SetShopValues(ItemRarityColor.White0, Item.buyPrice(silver: 1)); - break; - case 4565: - this.DefaultToPlacableWall((ushort) 312); - break; - case 4566: - this.DefaultToPlacableTile((ushort) 90, 39); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4567: - this.DefaultToPlacableTile((ushort) 79, 39); - this.SetShopValues(ItemRarityColor.White0, 2000); - this.maxStack = 99; - this.width = 28; - this.height = 20; - break; - case 4568: - this.DefaultToPlacableTile((ushort) 101, 40); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4569: - this.DefaultToPlacableTile((ushort) 88, 39); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4570: - this.DefaultToPlacableTile((ushort) 100, 39); - this.SetShopValues(ItemRarityColor.White0, 1500); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4571: - this.DefaultToPlacableTile((ushort) 33, 38); - this.SetShopValues(ItemRarityColor.White0, 0); - this.maxStack = 99; - this.width = 8; - this.height = 18; - this.value = Item.sellPrice(copper: 60); - this.noWet = true; - break; - case 4572: - this.DefaultToPlacableTile((ushort) 15, 44); - this.SetShopValues(ItemRarityColor.White0, 150); - this.maxStack = 99; - this.width = 12; - this.height = 30; - break; - case 4573: - this.DefaultToPlacableTile((ushort) 34, 45); - this.SetShopValues(ItemRarityColor.White0, 2000); - this.maxStack = 99; - this.width = 26; - this.height = 26; - break; - case 4574: - this.DefaultToPlacableTile((ushort) 467, 11); - this.SetShopValues(ItemRarityColor.White0, 500); - this.maxStack = 99; - this.width = 26; - this.height = 22; - break; - case 4575: - this.DefaultToPlacableTile((ushort) 104, 40); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4576: - this.DefaultToPlacableTile((ushort) 10, 45); - this.SetShopValues(ItemRarityColor.White0, 200); - this.maxStack = 99; - this.width = 14; - this.height = 28; - break; - case 4577: - this.DefaultToPlacableTile((ushort) 93, 39); - this.SetShopValues(ItemRarityColor.White0, 500); - this.maxStack = 99; - this.width = 10; - this.height = 24; - break; - case 4578: - this.DefaultToPlacableTile((ushort) 42, 45); - this.SetShopValues(ItemRarityColor.White0, 150); - this.maxStack = 99; - this.width = 12; - this.height = 28; - break; - case 4579: - this.DefaultToPlacableTile((ushort) 87, 39); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4580: - this.DefaultToPlacableTile((ushort) 19, 44); - this.SetShopValues(ItemRarityColor.White0, 0); - this.width = 8; - this.height = 10; - break; - case 4581: - this.DefaultToPlacableTile((ushort) 172, 40); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4582: - this.DefaultToPlacableTile((ushort) 89, 42); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4583: - this.DefaultToPlacableTile((ushort) 469, 8); - this.SetShopValues(ItemRarityColor.White0, 300); - this.maxStack = 99; - this.width = 26; - this.height = 20; - break; - case 4584: - this.DefaultToPlacableTile((ushort) 18, 40); - this.SetShopValues(ItemRarityColor.White0, 150); - this.maxStack = 99; - this.width = 28; - this.height = 14; - break; - case 4585: - this.DefaultToPlacableTile((ushort) 468, 11); - this.SetShopValues(ItemRarityColor.White0, 500); - this.maxStack = 99; - this.width = 26; - this.height = 22; - break; - case 4586: - this.DefaultToPlacableTile((ushort) 497, 38); - this.maxStack = 99; - this.value = 150; - break; - case 4587: - case 4588: - case 4589: - case 4590: - this.DefaultToGolfClub(20, 20); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(silver: 10)); - break; - case 4591: - case 4592: - case 4593: - case 4594: - this.DefaultToGolfClub(20, 20); - this.SetShopValues(ItemRarityColor.Orange3, Item.buyPrice(gold: 10)); - break; - case 4595: - case 4596: - case 4597: - case 4598: - this.DefaultToGolfClub(20, 20); - this.SetShopValues(ItemRarityColor.LightRed4, Item.buyPrice(gold: 25)); - break; - case 4599: - case 4600: - case 4601: - this.DefaultToPlacableTile((ushort) 560, type - 4599); - this.SetShopValues(ItemRarityColor.Orange3, Item.buyPrice(gold: 1)); - this.maxStack = 99; - break; - case 4602: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 91; - this.placeStyle = 294; - this.width = 10; - this.height = 24; - this.value = 1000; - this.rare = 1; - break; - case 4603: - this.DefaultToVanitypet(815, 258); - this.SetShopValues(ItemRarityColor.Orange3, Item.buyPrice(1)); - break; - case 4604: - this.DefaultToVanitypet(816, 259); - this.SetShopValues(ItemRarityColor.Orange3, Item.buyPrice(1)); - break; - case 4605: - this.DefaultToVanitypet(817, 260); - this.SetShopValues(ItemRarityColor.Orange3, Item.buyPrice(1)); - break; - case 4606: - this.DefaultToMusicBox(51); - break; - case 4607: - this.mana = 10; - this.damage = 33; - this.useStyle = 1; - this.shootSpeed = 10f; - this.shoot = 831; - this.buffType = 263; - this.width = 26; - this.height = 28; - this.UseSound = SoundID.Item113; - this.useAnimation = 36; - this.useTime = 36; - this.rare = 8; - this.noMelee = true; - this.knockBack = 4f; - this.value = Item.sellPrice(gold: 20); - this.summon = true; - break; - case 4608: - this.useStyle = 1; - this.shootSpeed = 7f; - this.shoot = 820; - this.width = 18; - this.height = 20; - this.maxStack = 999; - this.consumable = true; - this.UseSound = SoundID.Item1; - this.useAnimation = 19; - this.useTime = 19; - this.noMelee = true; - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(silver: 5)); - break; - case 4609: - this.DefaultToPlacableTile((ushort) 567, 0); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(gold: 1)); - break; - case 4610: - this.DefaultTokite(822); - break; - case 4611: - this.DefaultTokite(823); - break; - case 4612: - this.DefaultTokite(824); - break; - case 4613: - this.DefaultTokite(826); - break; - case 4626: - case 4627: - case 4628: - case 4629: - case 4630: - case 4631: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 240; - this.width = 30; - this.height = 30; - this.value = Item.sellPrice(silver: 10); - this.placeStyle = 63 + (type - 4626); - break; - case 4632: - case 4633: - case 4634: - case 4635: - case 4636: - case 4637: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 242; - this.width = 30; - this.height = 30; - this.value = Item.sellPrice(silver: 10); - this.placeStyle = 37 + (type - 4632); - break; - case 4638: - case 4639: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 245; - this.width = 30; - this.height = 30; - this.value = Item.sellPrice(silver: 10); - this.placeStyle = 7 + (type - 4638); - break; - case 4640: - this.DefaultToPlacableTile((ushort) 67, 0); - this.SetShopValues(ItemRarityColor.White0, Item.sellPrice(silver: 1)); - break; - case 4641: - this.DefaultToPlacableTile((ushort) 66, 0); - this.SetShopValues(ItemRarityColor.White0, Item.sellPrice(silver: 1)); - break; - case 4642: - this.DefaultToPlacableTile((ushort) 63, 0); - this.SetShopValues(ItemRarityColor.White0, Item.sellPrice(silver: 1)); - break; - case 4643: - this.DefaultToPlacableTile((ushort) 65, 0); - this.SetShopValues(ItemRarityColor.White0, Item.sellPrice(silver: 1)); - break; - case 4644: - this.DefaultToPlacableTile((ushort) 64, 0); - this.SetShopValues(ItemRarityColor.White0, Item.sellPrice(silver: 1)); - break; - case 4645: - this.DefaultToPlacableTile((ushort) 68, 0); - this.SetShopValues(ItemRarityColor.White0, Item.sellPrice(silver: 1)); - break; - case 4646: - this.DefaultToPlacableTile((ushort) 566, 0); - this.SetShopValues(ItemRarityColor.White0, Item.sellPrice(silver: 1)); - break; - case 4647: - this.DefaultToPlacableWall((ushort) 314); - break; - case 4648: - case 4649: - case 4650: - case 4651: - this.DefaultTokite(827 + (type - 4648)); - break; - case 4652: - this.width = 18; - this.height = 18; - this.headSlot = 230; - this.rare = 3; - this.vanity = true; - this.value = Item.sellPrice(silver: 50); - break; - case 4653: - this.width = 18; - this.height = 18; - this.bodySlot = 217; - this.rare = 3; - this.vanity = true; - this.value = Item.sellPrice(silver: 50); - break; - case 4654: - this.width = 18; - this.height = 18; - this.legSlot = 191; - this.rare = 3; - this.vanity = true; - this.value = Item.sellPrice(silver: 50); - break; - case 4655: - this.DefaultToPlacableTile((ushort) 568, 0); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4656: - this.DefaultToPlacableTile((ushort) 569, 0); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4657: - this.DefaultToPlacableTile((ushort) 570, 0); - this.maxStack = 99; - this.width = 20; - this.height = 20; - break; - case 4658: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 242; - this.width = 30; - this.height = 30; - this.value = Item.sellPrice(silver: 20); - this.placeStyle = 43; - break; - case 4659: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 245; - this.width = 30; - this.height = 30; - this.value = Item.sellPrice(silver: 20); - this.placeStyle = 9; - break; - case 4660: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 240; - this.width = 30; - this.height = 30; - this.value = Item.sellPrice(silver: 20); - this.placeStyle = 69; - break; - case 4661: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 246; - this.width = 30; - this.height = 30; - this.value = Item.sellPrice(silver: 20); - this.placeStyle = 19; - break; - case 4662: - case 4663: - case 4778: - this.width = 20; - this.height = 20; - this.maxStack = 99; - this.value = Item.sellPrice(gold: 1, silver: 50); - this.rare = 3; - break; - case 4664: - this.width = 18; - this.height = 18; - this.bodySlot = 218; - this.rare = 3; - this.vanity = true; - this.value = Item.buyPrice(gold: 20); - break; - case 4665: - this.width = 18; - this.height = 18; - this.legSlot = 193; - this.rare = 3; - this.vanity = true; - this.value = Item.buyPrice(gold: 20); - break; - case 4666: - this.width = 18; - this.height = 18; - this.headSlot = 232; - this.rare = 3; - this.vanity = true; - this.value = Item.buyPrice(gold: 15); - break; - case 4667: - this.DefaultToPlacableWall((ushort) 315); - break; - case 4668: - this.paint = (byte) 31; - this.width = 24; - this.height = 24; - this.value = Item.buyPrice(silver: 2); - this.maxStack = 999; - break; - case 4669: - this.DefaultTokite(838); - break; - case 4670: - this.DefaultTokite(839); - break; - case 4671: - this.DefaultTokite(840); - break; - case 4672: - this.DefaultToWhip(841, 14, 0.5f, 4f); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 15)); - break; - case 4673: - this.autoReuse = true; - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 12; - this.useTime = 12; - this.width = 16; - this.height = 16; - this.scale = 1f; - this.value = Item.buyPrice(silver: 50); - break; - case 4674: - this.DefaultTokite(843); - break; - case 4675: - this.DefaultTokite(844); - break; - case 4676: - this.DefaultTokite(845); - this.value = Item.buyPrice(gold: 2); - break; - case 4677: - this.DefaultTokite(846); - break; - case 4678: - this.DefaultToWhip(847, 55, 2f, 4f); - this.SetShopValues(ItemRarityColor.Pink5, Item.sellPrice(gold: 4, silver: 60)); - break; - case 4679: - this.DefaultToWhip(848, 180, 11f, 4f, 45); - this.SetShopValues(ItemRarityColor.Yellow8, Item.sellPrice(gold: 6)); - this.crit = 10; - break; - case 4680: - this.DefaultToWhip(849, 100, 3f, 4f); - this.SetShopValues(ItemRarityColor.Yellow8, Item.sellPrice(gold: 10)); - break; - case 4681: - this.DefaultTokite(850); - this.value = Item.buyPrice(gold: 2); - break; - case 4682: - this.width = 20; - this.height = 24; - this.DefaultToThrownWeapon(851, 25, 4f); - this.value = Item.buyPrice(silver: 1); - this.ranged = false; - this.noUseGraphic = true; - break; - case 4683: - this.DefaultTokite(852); - break; - case 4684: - this.DefaultTokite(853); - break; - case 4685: - this.width = 18; - this.height = 18; - this.headSlot = 231; - this.vanity = true; - this.value = Item.buyPrice(gold: 10); - break; - case 4686: - this.width = 18; - this.height = 18; - this.bodySlot = 219; - this.vanity = true; - this.value = Item.buyPrice(gold: 10); - break; - case 4687: - case 4688: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 91; - this.placeStyle = 295 + (type - 4687); - this.width = 10; - this.height = 24; - this.value = 1000; - this.rare = 1; - break; - case 4689: - case 4690: - case 4691: - case 4692: - case 4693: - case 4694: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 215; - this.placeStyle = 8 + type - 4689; - this.width = 12; - this.height = 12; - break; - case 4695: - case 4696: - case 4697: - case 4698: - case 4699: - case 4700: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 572; - this.placeStyle = type - 4695; - this.width = 12; - this.height = 28; - if (type >= 4695 && type <= 4697) - { - this.value = 1000; - break; - } - this.value = 40000; - break; - case 4701: - this.DefaultToVanitypet(854, 264); - this.SetShopValues(ItemRarityColor.Orange3, Item.buyPrice(gold: 50)); - break; - case 4702: - this.width = 20; - this.height = 24; - this.DefaultToThrownWeapon(855, 25, 4f); - this.value = Item.buyPrice(silver: 1); - this.ranged = false; - this.noUseGraphic = true; - break; - case 4703: - this.DefaultToRangedWeapon(14, AmmoID.Bullet, 45, 7f); - this.knockBack = 6.5f; - this.width = 50; - this.height = 14; - this.UseSound = SoundID.Item36; - this.damage = 24; - this.value = Item.buyPrice(gold: 35); - this.rare = 3; - break; - case 4704: - this.width = 18; - this.height = 18; - this.headSlot = 233; - this.vanity = true; - this.value = Item.buyPrice(gold: 10); - break; - case 4705: - this.width = 18; - this.height = 18; - this.bodySlot = 220; - this.vanity = true; - this.value = Item.buyPrice(gold: 10); - break; - case 4706: - this.width = 18; - this.height = 18; - this.legSlot = 197; - this.vanity = true; - this.value = Item.buyPrice(gold: 10); - break; - case 4707: - this.width = 44; - this.height = 44; - this.rare = 2; - this.value = Item.buyPrice(gold: 10); - this.holdStyle = 2; - this.useStyle = 3; - this.useAnimation = 22; - this.useTime = 22; - this.damage = 15; - this.knockBack = 5f; - this.UseSound = SoundID.Item1; - this.melee = true; - break; - case 4708: - this.width = 18; - this.height = 18; - this.headSlot = 234; - this.vanity = true; - this.value = Item.buyPrice(gold: 10); - break; - case 4709: - this.width = 18; - this.height = 18; - this.bodySlot = 221; - this.vanity = true; - this.value = Item.buyPrice(gold: 10); - break; - case 4710: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 573; - this.width = 28; - this.height = 28; - break; - case 4711: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 22; - this.useTime = 14; - this.autoReuse = true; - this.width = 24; - this.height = 28; - this.damage = 12; - this.UseSound = SoundID.Item1; - this.knockBack = 3.5f; - this.rare = 1; - this.value = Item.sellPrice(silver: 10); - this.melee = true; - break; - case 4712: - this.DefaultToPlacableTile((ushort) 467, 12); - this.SetShopValues(ItemRarityColor.White0, Item.buyPrice(silver: 25)); - this.maxStack = 99; - this.width = 26; - this.height = 22; - break; - case 4713: - this.DefaultToPlacableTile((ushort) 468, 12); - this.SetShopValues(ItemRarityColor.White0, Item.buyPrice(silver: 5)); - this.maxStack = 99; - this.width = 26; - this.height = 22; - break; - case 4714: - this.width = 14; - this.height = 20; - this.maxStack = 99; - this.rare = 8; - break; - case 4715: - this.SetShopValues(ItemRarityColor.Pink5, Item.buyPrice(gold: 50)); - this.DefaultToGuitar(); - this.useAnimation = this.useTime = 12; - this.useTime /= 2; - this.shoot = 856; - this.damage = 75; - this.magic = true; - this.shootSpeed = 1f; - this.crit = 20; - this.mana = 12; - this.noMelee = true; - break; - case 4716: - this.useStyle = 4; - this.channel = true; - this.width = 34; - this.height = 34; - this.UseSound = SoundID.Item43; - this.useAnimation = 20; - this.useTime = 20; - this.rare = 8; - this.noMelee = true; - this.mountType = 37; - this.value = Item.buyPrice(gold: 20); - break; - case 4717: - case 4718: - case 4719: - case 4720: - case 4721: - this.DefaultToPlacableTile(574 + type - 4717); - break; - case 4722: - this.useStyle = 5; - this.width = 24; - this.height = 24; - this.noUseGraphic = true; - this.UseSound = SoundID.Item1; - this.autoReuse = true; - this.melee = true; - this.channel = true; - this.noMelee = true; - this.shoot = 857; - this.useAnimation = 35; - this.useTime = this.useAnimation / 5; - this.shootSpeed = 16f; - this.damage = 190; - this.knockBack = 6.5f; - this.value = Item.sellPrice(gold: 20); - this.crit = 10; - this.rare = 10; - this.glowMask = (short) 271; - break; - case 4723: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 240; - this.width = 30; - this.height = 30; - this.value = Item.sellPrice(silver: 20); - this.placeStyle = 70; - break; - case 4724: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 240; - this.width = 30; - this.height = 30; - this.value = Item.sellPrice(silver: 20); - this.placeStyle = 71; - break; - case 4725: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 242; - this.width = 30; - this.height = 30; - this.value = Item.sellPrice(silver: 20); - this.placeStyle = 44; - break; - case 4726: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 245; - this.width = 30; - this.height = 30; - this.value = Item.sellPrice(silver: 20); - this.placeStyle = 10; - break; - case 4727: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 245; - this.width = 30; - this.height = 30; - this.value = Item.sellPrice(silver: 20); - this.placeStyle = 11; - break; - case 4728: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 245; - this.width = 30; - this.height = 30; - this.value = Item.sellPrice(silver: 20); - this.placeStyle = 12; - break; - case 4729: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 246; - this.width = 30; - this.height = 30; - this.value = Item.sellPrice(silver: 20); - this.placeStyle = 20; - break; - case 4730: - this.width = 24; - this.height = 8; - this.accessory = true; - this.rare = 9; - this.wingSlot = (sbyte) 40; - this.value = 400000; - break; - case 4731: - this.DefaultToPlacableTile((ushort) 497, 39); - this.maxStack = 99; - this.value = 150; - this.rare = 8; - break; - case 4732: - this.width = 18; - this.height = 18; - this.headSlot = 235; - this.rare = 9; - this.vanity = true; - this.value = Item.sellPrice(gold: 5); - break; - case 4733: - this.width = 18; - this.height = 18; - this.bodySlot = 222; - this.rare = 9; - this.vanity = true; - this.value = Item.sellPrice(gold: 5); - break; - case 4734: - this.width = 18; - this.height = 18; - this.legSlot = 203; - this.rare = 9; - this.vanity = true; - this.value = Item.sellPrice(gold: 5); - break; - case 4735: - this.DefaultToVanitypet(858, 266); - this.value = Item.buyPrice(gold: 50); - break; - case 4736: - this.DefaultToVanitypet(859, 267); - this.value = Item.buyPrice(gold: 30); - break; - case 4737: - this.DefaultToVanitypet(860, 268); - break; - case 4738: - this.width = 18; - this.height = 18; - this.headSlot = 236; - this.rare = 2; - this.vanity = true; - this.value = Item.sellPrice(silver: 50); - break; - case 4739: - this.width = 18; - this.height = 18; - this.bodySlot = 223; - this.rare = 2; - this.vanity = true; - this.value = Item.sellPrice(silver: 50); - break; - case 4740: - this.width = 18; - this.height = 18; - this.headSlot = 237; - this.rare = 2; - this.vanity = true; - this.value = Item.sellPrice(silver: 50); - break; - case 4741: - this.width = 18; - this.height = 18; - this.bodySlot = 224; - this.rare = 2; - this.vanity = true; - this.value = Item.sellPrice(silver: 50); - break; - case 4742: - this.width = 18; - this.height = 18; - this.legSlot = 205; - this.rare = 2; - this.vanity = true; - this.value = Item.sellPrice(silver: 50); - break; - case 4743: - this.useStyle = 1; - this.shootSpeed = 11f; - this.shoot = 861; - this.damage = 0; - this.width = 10; - this.height = 10; - this.maxStack = 1; - this.consumable = true; - this.UseSound = SoundID.Item1; - this.useAnimation = 15; - this.useTime = 15; - this.noUseGraphic = true; - this.noMelee = true; - this.value = 20; - break; - case 4744: - this.DefaultToAccessory(26, 36); - this.backSlot = (sbyte) 24; - this.frontSlot = (sbyte) 8; - this.SetShopValues(ItemRarityColor.Pink5, Item.sellPrice(gold: 3)); - this.vanity = true; - break; - case 4745: - this.DefaultToMount(38); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(silver: 2)); - break; - case 4746: - this.width = 24; - this.height = 8; - this.accessory = true; - this.rare = 9; - this.wingSlot = (sbyte) 41; - this.value = 400000; - break; - case 4747: - this.width = 18; - this.height = 18; - this.headSlot = 238; - this.rare = 9; - this.vanity = true; - this.value = Item.sellPrice(gold: 5); - break; - case 4748: - this.width = 18; - this.height = 18; - this.bodySlot = 225; - this.rare = 9; - this.vanity = true; - this.value = Item.sellPrice(gold: 5); - break; - case 4749: - this.width = 18; - this.height = 18; - this.legSlot = 208; - this.rare = 9; - this.vanity = true; - this.value = Item.sellPrice(gold: 5); - break; - case 4750: - this.width = 24; - this.height = 8; - this.accessory = true; - this.rare = 9; - this.wingSlot = (sbyte) 42; - this.value = 400000; - break; - case 4751: - this.width = 18; - this.height = 18; - this.headSlot = 239; - this.rare = 9; - this.vanity = true; - this.value = Item.sellPrice(gold: 5); - break; - case 4752: - this.width = 18; - this.height = 18; - this.bodySlot = 226; - this.rare = 9; - this.vanity = true; - this.value = Item.sellPrice(gold: 5); - break; - case 4753: - this.width = 18; - this.height = 18; - this.legSlot = 209; - this.rare = 9; - this.vanity = true; - this.value = Item.sellPrice(gold: 5); - break; - case 4754: - this.width = 24; - this.height = 8; - this.accessory = true; - this.rare = 9; - this.wingSlot = (sbyte) 43; - this.value = 400000; - break; - case 4755: - this.width = 18; - this.height = 18; - this.headSlot = 240; - this.rare = 9; - this.vanity = true; - this.value = Item.sellPrice(gold: 5); - break; - case 4756: - this.width = 18; - this.height = 18; - this.bodySlot = 227; - this.rare = 9; - this.vanity = true; - this.value = Item.sellPrice(gold: 5); - break; - case 4757: - this.width = 18; - this.height = 18; - this.legSlot = 210; - this.rare = 9; - this.vanity = true; - this.value = Item.sellPrice(gold: 5); - break; - case 4758: - this.mana = 10; - this.damage = 6; - this.useStyle = 1; - this.shootSpeed = 10f; - this.shoot = 864; - this.buffType = 271; - this.width = 26; - this.height = 28; - this.UseSound = SoundID.Item113; - this.useAnimation = 36; - this.useTime = 36; - this.rare = 5; - this.noMelee = true; - this.knockBack = 0.0f; - this.value = Item.sellPrice(gold: 1); - this.summon = true; - break; - case 4759: - this.noUseGraphic = true; - this.damage = 0; - this.knockBack = 7f; - this.useStyle = 5; - this.shootSpeed = 11.5f; - this.shoot = 865; - this.width = 18; - this.height = 28; - this.UseSound = SoundID.Item1; - this.useAnimation = 20; - this.useTime = 20; - this.rare = 1; - this.noMelee = true; - this.value = 20000; - break; - case 4760: - this.damage = 60; - this.useStyle = 1; - this.shootSpeed = 10f; - this.shoot = 866; - this.width = 26; - this.height = 28; - this.UseSound = SoundID.Item1; - this.useAnimation = 36; - this.useTime = 36; - this.rare = 5; - this.noMelee = true; - this.value = Item.buyPrice(gold: 35); - this.melee = true; - this.noUseGraphic = true; - break; - case 4761: - this.width = 12; - this.height = 12; - this.headSlot = 241; - this.rare = 3; - this.vanity = true; - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 579; - break; - case 4762: - this.width = 24; - this.height = 24; - this.accessory = true; - this.vanity = true; - this.rare = 1; - this.value = Item.buyPrice(gold: 10); - this.canBePlacedInVanityRegardlessOfConditions = true; - break; - case 4763: - this.DefaultToMount(39); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 50)); - break; - case 4764: - this.noMelee = true; - this.useStyle = 1; - this.shootSpeed = 10.5f; - this.shoot = 867; - this.damage = 14; - this.knockBack = 7f; - this.width = 14; - this.height = 28; - this.UseSound = SoundID.Item1; - this.useAnimation = 15; - this.useTime = 15; - this.noUseGraphic = true; - this.rare = 1; - this.value = 30000; - this.melee = true; - break; - case 4765: - case 4766: - this.DefaultToThrownWeapon(type - 4765 + 868, 20, 8f); - this.UseSound = SoundID.Item106; - this.SetShopValues(ItemRarityColor.Green2, Item.buyPrice(gold: 3)); - break; - case 4767: - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 5)); - this.width = 30; - this.height = 30; - break; - case 4768: - this.width = 18; - this.height = 18; - this.headSlot = 242; - this.rare = 1; - this.vanity = true; - this.value = Item.buyPrice(gold: 3); - break; - case 4769: - this.DefaultToAccessory(18, 18); - this.backSlot = (sbyte) 25; - this.rare = 1; - this.vanity = true; - this.value = Item.buyPrice(gold: 3); - break; - case 4770: - this.width = 18; - this.height = 18; - this.headSlot = 243; - this.rare = 1; - this.vanity = true; - this.value = Item.buyPrice(gold: 3); - break; - case 4771: - this.DefaultToAccessory(18, 18); - this.backSlot = (sbyte) 26; - this.rare = 1; - this.vanity = true; - this.value = Item.buyPrice(gold: 3); - break; - case 4772: - this.width = 18; - this.height = 18; - this.headSlot = 244; - this.rare = 1; - this.vanity = true; - this.value = Item.buyPrice(gold: 3); - break; - case 4773: - this.DefaultToAccessory(18, 18); - this.backSlot = (sbyte) 27; - this.rare = 1; - this.vanity = true; - this.value = Item.buyPrice(gold: 3); - break; - case 4774: - this.width = 18; - this.height = 18; - this.headSlot = 245; - this.rare = 1; - this.vanity = true; - this.value = Item.sellPrice(silver: 50); - break; - case 4775: - this.DefaultToAccessory(18, 18); - this.backSlot = (sbyte) 28; - this.rare = 1; - this.vanity = true; - this.value = Item.buyPrice(gold: 3); - break; - case 4776: - this.color = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); - this.useStyle = 1; - this.shootSpeed = 6f; - this.shoot = 870; - this.width = 12; - this.height = 12; - this.maxStack = 999; - this.consumable = true; - this.UseSound = SoundID.Item1; - this.useAnimation = 15; - this.useTime = 15; - this.noMelee = true; - this.rare = 1; - this.value = Item.buyPrice(copper: 75); - this.holdStyle = 1; - break; - case 4777: - this.DefaultToVanitypet(875, 274); - this.value = Item.buyPrice(gold: 50); - break; - case 4779: - this.width = 18; - this.height = 18; - this.headSlot = 250; - this.rare = 1; - this.vanity = true; - break; - case 4780: - this.width = 18; - this.height = 18; - this.bodySlot = 228; - this.rare = 1; - this.vanity = true; - break; - case 4781: - this.width = 18; - this.height = 18; - this.legSlot = 211; - this.rare = 1; - this.vanity = true; - break; - case 4782: - this.maxStack = 999; - this.consumable = true; - this.width = 24; - this.height = 24; - this.rare = 6; - this.expert = true; - break; - case 4783: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 240; - this.width = 30; - this.height = 30; - this.value = Item.sellPrice(gold: 1); - this.rare = 1; - this.placeStyle = 72; - break; - case 4784: - this.width = 18; - this.height = 18; - this.headSlot = 251; - this.rare = 1; - this.value = Item.sellPrice(silver: 75); - this.vanity = true; - break; - case 4785: - case 4786: - case 4787: - this.useStyle = 4; - this.channel = true; - this.width = 34; - this.height = 34; - this.UseSound = SoundID.Item76; - this.useAnimation = 20; - this.useTime = 20; - this.rare = 8; - this.noMelee = true; - this.mountType = 40 + (type - 4785); - this.value = Item.sellPrice(gold: 5); - break; - case 4788: - this.DefaultToSpear(877, 3.5f, 24); - this.SetWeaponValues(56, 12f); - this.SetShopValues(ItemRarityColor.LightRed4, Item.buyPrice(gold: 6)); - this.channel = true; - break; - case 4789: - this.DefaultToSpear(878, 3.5f, 24); - this.SetWeaponValues(108, 14f); - this.SetShopValues(ItemRarityColor.Yellow8, Item.sellPrice(gold: 10)); - this.channel = true; - break; - case 4790: - this.DefaultToSpear(879, 3.5f, 24); - this.SetWeaponValues(78, 13f); - this.SetShopValues(ItemRarityColor.Pink5, 230000); - this.channel = true; - break; - case 4791: - this.useStyle = 4; - this.channel = true; - this.width = 10; - this.height = 32; - this.UseSound = SoundID.Item25; - this.useAnimation = 20; - this.useTime = 20; - this.rare = 8; - this.noMelee = true; - this.noUseGraphic = true; - this.mountType = 43; - this.value = Item.sellPrice(gold: 5); - break; - case 4792: - case 4793: - case 4794: - case 4795: - case 4796: - this.useStyle = 4; - this.channel = true; - this.width = 10; - this.height = 32; - this.UseSound = SoundID.Item25; - this.useAnimation = 20; - this.useTime = 20; - this.rare = -13; - this.noMelee = true; - this.noUseGraphic = true; - this.mountType = 44 + type - 4792; - this.value = Item.sellPrice(gold: 5); - break; - case 4797: - case 4798: - case 4799: - case 4800: - case 4801: - case 4802: - case 4803: - case 4804: - case 4805: - case 4806: - case 4807: - case 4808: - case 4809: - case 4810: - case 4811: - case 4812: - case 4813: - case 4814: - case 4815: - case 4816: - case 4817: - this.DefaultToVanitypet(881 + type - 4797, 284 + type - 4797); - this.value = Item.buyPrice(gold: 25); - this.rare = -13; - break; - case 4818: - this.noMelee = true; - this.useStyle = 1; - this.shootSpeed = 8.5f; - this.shoot = 902; - this.damage = 25; - this.knockBack = 3.5f; - this.width = 14; - this.height = 28; - this.UseSound = SoundID.Item1; - this.useAnimation = 15; - this.useTime = 15; - this.noUseGraphic = true; - this.rare = 2; - this.value = Item.sellPrice(silver: 50); - this.melee = true; - break; - case 4819: - this.useTurn = true; - this.width = 20; - this.height = 20; - this.useStyle = 4; - this.useTime = 90; - this.UseSound = SoundID.Item6; - this.useAnimation = 90; - this.SetShopValues(ItemRarityColor.LightRed4, Item.buyPrice(gold: 5)); - break; - case 4820: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 12; - this.useTime = 5; - this.width = 20; - this.height = 20; - this.autoReuse = true; - this.rare = 7; - this.value = Item.sellPrice(gold: 10); - this.tileBoost += 2; - break; - case 4821: - this.useTurn = true; - this.useStyle = 1; - this.useAnimation = 21; - this.width = 24; - this.height = 28; - this.UseSound = SoundID.Item1; - this.value = Item.sellPrice(gold: 5); - this.autoReuse = true; - this.rare = 3; - this.scale = 0.85f; - break; - case 4822: - this.DefaultToAccessory(34, 30); - this.shoeSlot = (sbyte) 22; - this.SetShopValues(ItemRarityColor.Orange3, Item.sellPrice(gold: 2)); - this.vanity = true; - break; - case 4823: - this.width = 24; - this.height = 8; - this.accessory = true; - this.rare = 9; - this.wingSlot = (sbyte) 44; - this.value = Item.buyPrice(gold: 40); - break; - case 4824: - case 4825: - case 4826: - case 4827: - this.useStyle = 1; - this.shootSpeed = 5f; - this.shoot = 903 + (type - 4824); - this.width = 20; - this.height = 20; - this.maxStack = 99; - this.UseSound = SoundID.Item1; - this.consumable = true; - this.useAnimation = 25; - this.noUseGraphic = true; - this.useTime = 25; - this.value = Item.sellPrice(silver: 5); - this.rare = 1; - break; - case 4828: - this.useStyle = 4; - this.channel = true; - this.width = 10; - this.height = 32; - this.UseSound = SoundID.Item25; - this.useAnimation = 20; - this.useTime = 20; - this.rare = 8; - this.noMelee = true; - this.noUseGraphic = true; - this.mountType = 49; - this.value = Item.sellPrice(gold: 5); - break; - case 4829: - case 4830: - this.useStyle = 4; - this.consumable = true; - this.useAnimation = 45; - this.useTime = 45; - this.UseSound = SoundID.Item92; - this.width = 28; - this.height = 28; - this.maxStack = 20; - this.SetShopValues(ItemRarityColor.Green2, Item.buyPrice(gold: 5)); - break; - case 4831: - case 4832: - case 4833: - case 4834: - case 4835: - case 4836: - case 4837: - this.useStyle = 1; - this.autoReuse = true; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.maxStack = 999; - this.consumable = true; - this.width = 12; - this.height = 12; - this.noUseGraphic = true; - this.value = Item.sellPrice(silver: 10); - this.makeNPC = (short) (639 + (type - 4831)); - break; - case 4838: - case 4839: - case 4840: - case 4841: - case 4842: - case 4843: - case 4844: - this.useStyle = 1; - this.autoReuse = true; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.maxStack = 999; - this.consumable = true; - this.width = 12; - this.height = 12; - this.noUseGraphic = true; - this.value = Item.sellPrice(silver: 10); - this.makeNPC = (short) (646 + (type - 4838)); - break; - case 4845: - this.DefaultToCapturedCritter((short) 653); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(silver: 20)); - this.width = 12; - this.height = 12; - this.bait = 15; - break; - case 4846: - this.DefaultToPlacableTile((ushort) 580, 0); - this.maxStack = 99; - break; - case 4847: - this.DefaultToCapturedCritter((short) 654); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(silver: 20)); - this.width = 12; - this.height = 12; - this.bait = 25; - break; - case 4848: - this.DefaultToPlacableTile((ushort) 581, 0); - this.maxStack = 99; - break; - case 4849: - this.DefaultToCapturedCritter((short) 655); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(silver: 50)); - this.width = 12; - this.height = 12; - this.bait = 35; - break; - case 4850: - this.DefaultToPlacableTile((ushort) 582, 0); - this.maxStack = 99; - break; - case 4851: - this.DefaultToPlacableTile((ushort) 590, 0); - this.value = Item.sellPrice(silver: 7, copper: 50); - break; - case 4852: - this.DefaultToPlacableTile((ushort) 590, 1); - this.value = Item.sellPrice(silver: 3, copper: 75); - break; - case 4853: - this.DefaultToPlacableTile((ushort) 590, 2); - this.value = Item.sellPrice(silver: 11, copper: 25); - break; - case 4854: - this.DefaultToPlacableTile((ushort) 590, 3); - this.value = Item.sellPrice(silver: 15); - break; - case 4855: - this.DefaultToPlacableTile((ushort) 590, 4); - this.value = Item.sellPrice(silver: 22, copper: 50); - break; - case 4856: - this.DefaultToPlacableTile((ushort) 590, 5); - this.value = Item.sellPrice(silver: 30); - break; - case 4857: - this.DefaultToPlacableTile((ushort) 590, 6); - this.value = Item.sellPrice(silver: 30); - break; - case 4858: - case 4859: - case 4860: - case 4861: - case 4862: - case 4863: - case 4864: - case 4865: - case 4866: - this.DefaultToPlacableTile((ushort) 591, type - 4858); - this.value = Item.sellPrice(silver: 25); - break; - case 4867: - this.DefaultToPlacableTile((ushort) 592, 0); - this.value = Item.sellPrice(silver: 25); - break; - case 4868: - case 4869: - this.DefaultToPlacableTile(593 + (type - 4868)); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 2)); - break; - case 4870: - this.UseSound = SoundID.Item6; - this.useStyle = 6; - this.useTurn = true; - this.useTime = this.useAnimation = 30; - this.maxStack = 30; - this.consumable = true; - this.width = 14; - this.height = 24; - this.value = 1000; - this.rare = 1; - break; - case 4871: - this.DefaultToPlacableTile((ushort) 595, 0); - this.value = Item.buyPrice(gold: 3); - break; - case 4872: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 12; - this.useTime = 5; - this.width = 20; - this.height = 20; - this.autoReuse = true; - this.rare = 7; - this.value = Item.sellPrice(gold: 10); - this.tileBoost += 2; - break; - case 4873: - this.width = 18; - this.height = 18; - this.defense = 1; - this.headSlot = 254; - this.rare = 5; - this.value = 250000; - break; - case 4874: - this.DefaultToAccessory(34, 30); - this.shoeSlot = (sbyte) 23; - this.SetShopValues(ItemRarityColor.Lime7, Item.sellPrice(gold: 12)); - this.canBePlacedInVanityRegardlessOfConditions = true; - break; - case 4875: - this.DefaultToPlacableTile((ushort) 597, 1); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 10)); - break; - case 4876: - this.DefaultToPlacableTile((ushort) 597, 0); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 10)); - break; - case 4877: - case 4878: - this.DefaultToPlacableTile((ushort) 376, 22 + type - 4877); - this.SetShopValues(ItemRarityColor.Green2, Item.sellPrice(gold: 1)); - this.maxStack = 99; - break; - case 4879: - this.width = 12; - this.height = 12; - this.rare = 2; - this.maxStack = 99; - this.value = Item.buyPrice(gold: 2); - break; - case 4880: - this.DefaultToPlacableTile((ushort) 598, 0); - this.maxStack = 99; - this.width = 20; - this.height = 20; - this.value = Item.sellPrice(silver: 20); - break; - case 4881: - this.DefaultToAccessory(34, 30); - this.SetShopValues(ItemRarityColor.Lime7, Item.sellPrice(gold: 2)); - break; - case 4882: - case 4883: - case 4884: - case 4885: - case 4886: - case 4887: - case 4888: - case 4889: - case 4890: - case 4891: - case 4892: - case 4893: - case 4894: - case 4895: - this.DefaultToPlacableTile(599 + (type - 4882)); - this.maxStack = 99; - break; - case 4896: - this.width = 18; - this.height = 18; - this.defense = 24; - this.headSlot = (int) byte.MaxValue; - this.rare = 5; - this.value = 250000; - break; - case 4897: - this.width = 18; - this.height = 18; - this.defense = 9; - this.headSlot = 256; - this.rare = 5; - this.value = 250000; - break; - case 4898: - this.width = 18; - this.height = 18; - this.defense = 5; - this.headSlot = 257; - this.rare = 5; - this.value = 250000; - break; - case 4899: - this.width = 18; - this.height = 18; - this.defense = 1; - this.headSlot = 258; - this.rare = 5; - this.value = 250000; - break; - case 4900: - this.width = 18; - this.height = 18; - this.defense = 15; - this.bodySlot = 229; - this.rare = 5; - this.value = 200000; - break; - case 4901: - this.width = 18; - this.height = 18; - this.defense = 11; - this.legSlot = 212; - this.rare = 5; - this.value = 150000; - break; - case 4902: - this.DefaultToPlacableTile((ushort) 548, 7); - this.SetShopValues(ItemRarityColor.Orange3, Item.buyPrice(gold: 3)); - break; - case 4903: - this.DefaultToPlacableTile((ushort) 548, 8); - this.SetShopValues(ItemRarityColor.Orange3, Item.buyPrice(gold: 3)); - break; - case 4904: - this.DefaultToPlacableTile((ushort) 613, 0); - this.SetShopValues(ItemRarityColor.Orange3, Item.buyPrice(gold: 3)); - break; - case 4905: - this.DefaultToPlacableTile((ushort) 613, 1); - this.SetShopValues(ItemRarityColor.Orange3, Item.buyPrice(gold: 3)); - break; - case 4906: - this.DefaultToPlacableTile((ushort) 614, 0); - this.SetShopValues(ItemRarityColor.Orange3, Item.buyPrice(gold: 3)); - break; - case 4907: - this.DefaultToPlacableTile((ushort) 615, 0); - this.value = Item.buyPrice(gold: 3); - break; - case 4908: - case 4909: - this.useStyle = 1; - this.shootSpeed = 5f; - this.shoot = 910 + (type - 4908); - this.width = 20; - this.height = 20; - this.maxStack = 99; - this.UseSound = SoundID.Item1; - this.consumable = true; - this.useAnimation = 25; - this.noUseGraphic = true; - this.useTime = 25; - this.value = Item.sellPrice(silver: 1); - this.rare = 1; - break; - case 4910: - this.useStyle = 4; - this.consumable = true; - this.useAnimation = 45; - this.useTime = 45; - this.UseSound = SoundID.Item92; - this.width = 28; - this.height = 28; - this.maxStack = 20; - this.SetShopValues(ItemRarityColor.Green2, Item.buyPrice(gold: 5)); - break; - case 4911: - this.DefaultToWhip(912, 50, 1.5f, 4f); - this.SetShopValues(ItemRarityColor.LightRed4, Item.sellPrice(gold: 4)); - break; - case 4912: - this.DefaultToWhip(913, 40, 2f, 4f); - this.SetShopValues(ItemRarityColor.LightRed4, Item.sellPrice(gold: 3)); - break; - case 4913: - this.DefaultToWhip(914, 18, 1f, 4f); - this.SetShopValues(ItemRarityColor.Orange3, Item.sellPrice(gold: 1)); - break; - case 4914: - this.DefaultToWhip(915, 165, 4f, 4f); - this.SetShopValues(ItemRarityColor.Yellow8, Item.sellPrice(gold: 5)); - break; - case 4915: - this.shootSpeed = 4.5f; - this.shoot = 14; - this.damage = 9; - this.width = 8; - this.height = 8; - this.maxStack = 999; - this.consumable = true; - this.ammo = AmmoID.Bullet; - this.knockBack = 4f; - this.value = 18; - this.ranged = true; - break; - case 4916: - this.DefaultToPlacableTile((ushort) 597, 2); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 10)); - break; - case 4917: - this.DefaultToPlacableTile((ushort) 597, 3); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 10)); - break; - case 4918: - this.DefaultToPlacableTile((ushort) 597, 4); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 10)); - break; - case 4919: - this.DefaultToPlacableTile((ushort) 597, 5); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 10)); - break; - case 4920: - this.DefaultToPlacableTile((ushort) 597, 6); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 10)); - break; - case 4921: - this.DefaultToPlacableTile((ushort) 597, 7); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 10)); - break; - case 4922: - this.DefaultToPlacableTile((ushort) 207, 8); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 4)); - this.width = 8; - this.height = 10; - break; - case 4923: - this.width = 14; - this.height = 38; - this.rare = 8; - this.noUseGraphic = true; - this.channel = true; - this.noMelee = true; - this.damage = 70; - this.knockBack = 4f; - this.autoReuse = false; - this.noMelee = true; - this.melee = true; - this.shoot = 927; - this.shootSpeed = 15f; - this.value = Item.sellPrice(gold: 5); - this.useStyle = 13; - this.useAnimation = 18; - this.useTime = 6; - break; - case 4924: - case 4925: - case 4926: - case 4927: - case 4928: - case 4929: - case 4930: - case 4931: - case 4932: - case 4933: - case 4934: - case 4935: - case 4936: - case 4937: - case 4938: - case 4939: - case 4940: - case 4941: - case 4942: - case 4943: - case 4944: - case 4945: - case 4946: - case 4947: - case 4948: - case 4949: - case 4950: - this.DefaultToPlacableTile((ushort) 617, type - 4924); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 5)); - this.rare = -13; - this.maxStack = 99; - break; - case 4951: - this.DefaultToPlacableTile((ushort) 597, 8); - this.SetShopValues(ItemRarityColor.Cyan9, Item.buyPrice(1)); - break; - case 4952: - this.autoReuse = true; - this.useStyle = 14; - this.holdStyle = 6; - this.scale = 0.7f; - this.useAnimation = 36; - this.useTime = 2; - this.width = 36; - this.height = 22; - this.shoot = 931; - this.mana = 26; - this.UseSound = SoundID.Item82; - this.knockBack = 2.5f; - this.damage = 50; - this.shootSpeed = 17f; - this.noMelee = true; - this.rare = 8; - this.magic = true; - this.value = Item.sellPrice(gold: 5); - this.flame = true; - break; - case 4953: - this.useStyle = 5; - this.autoReuse = true; - this.useAnimation = 30; - this.useTime = 2; - this.width = 50; - this.height = 18; - this.shoot = 1; - this.useAmmo = AmmoID.Arrow; - this.UseSound = SoundID.Item5; - this.damage = 50; - this.shootSpeed = 10f; - this.noMelee = true; - this.value = Item.sellPrice(gold: 5); - this.ranged = true; - this.rare = 8; - this.knockBack = 2f; - break; - case 4954: - this.width = 24; - this.height = 8; - this.accessory = true; - this.rare = 9; - this.wingSlot = (sbyte) 45; - this.value = Item.sellPrice(gold: 10); - this.expert = true; - break; - case 4955: - this.width = 18; - this.height = 18; - this.headSlot = 259; - this.value = Item.buyPrice(gold: 15); - this.rare = 5; - this.vanity = true; - break; - case 4956: - this.useStyle = 1; - this.width = 24; - this.height = 24; - this.UseSound = SoundID.Item169; - this.autoReuse = true; - this.melee = true; - this.melee = true; - this.shoot = 933; - this.useAnimation = 30; - this.useTime = this.useAnimation / 3; - this.shootSpeed = 16f; - this.damage = 190; - this.knockBack = 6.5f; - this.value = Item.sellPrice(gold: 20); - this.crit = 10; - this.rare = 10; - this.noUseGraphic = true; - this.noMelee = true; - break; - case 4957: - this.maxStack = 999; - this.consumable = true; - this.width = 24; - this.height = 24; - this.rare = 6; - this.expert = true; - break; - case 4958: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 240; - this.width = 30; - this.height = 30; - this.value = Item.sellPrice(gold: 1); - this.rare = 1; - this.placeStyle = 73; - break; - case 4959: - this.width = 18; - this.height = 18; - this.headSlot = 260; - this.rare = 1; - this.value = Item.sellPrice(silver: 75); - this.vanity = true; - break; - case 4960: - this.DefaultToVanitypet(934, 317); - this.value = Item.buyPrice(gold: 25); - this.rare = -13; - break; - case 4961: - this.DefaultToCapturedCritter((short) 661); - this.SetShopValues(ItemRarityColor.Orange3, Item.sellPrice(gold: 5)); - this.width = 12; - this.height = 12; - break; - case 4962: - this.DefaultToPlacableTile((ushort) 618, 0); - break; - case 4963: - this.DefaultToPlacableTile((ushort) 619, 0); - this.maxStack = 99; - break; - case 4964: - this.DefaultToPlacableTile((ushort) 620, 0); - this.maxStack = 99; - break; - case 4965: - case 4966: - case 4967: - case 4968: - case 4969: - case 4970: - case 4971: - case 4972: - case 4973: - case 4974: - case 4975: - case 4976: - case 4977: - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.maxStack = 99; - this.consumable = true; - this.createTile = 91; - this.placeStyle = 297 + (type - 4965); - this.width = 10; - this.height = 24; - this.value = 1000; - this.rare = 1; - break; - case 4978: - this.width = 24; - this.height = 8; - this.accessory = true; - this.rare = 0; - this.wingSlot = (sbyte) 46; - this.value = 2000; - break; - case 4979: - this.DefaultToMusicBox(52); - break; - case 4980: - this.noUseGraphic = true; - this.damage = 0; - this.knockBack = 7f; - this.useStyle = 5; - this.shootSpeed = 4f; - this.shoot = 935; - this.width = 18; - this.height = 28; - this.UseSound = SoundID.Item1; - this.useAnimation = 20; - this.useTime = 20; - this.rare = 5; - this.noMelee = true; - this.value = Item.sellPrice(gold: 5); - break; - case 4981: - this.useStyle = 4; - this.channel = true; - this.width = 10; - this.height = 32; - this.UseSound = SoundID.Item25; - this.useAnimation = 20; - this.useTime = 20; - this.rare = 8; - this.noMelee = true; - this.noUseGraphic = true; - this.mountType = 50; - this.value = Item.sellPrice(gold: 5); - break; - case 4982: - this.width = 18; - this.height = 18; - this.defense = 12; - this.headSlot = 261; - this.rare = 5; - this.value = Item.sellPrice(gold: 2); - break; - case 4983: - this.width = 18; - this.height = 18; - this.defense = 14; - this.bodySlot = 230; - this.rare = 5; - this.value = Item.sellPrice(gold: 2); - break; - case 4984: - this.width = 18; - this.height = 18; - this.defense = 10; - this.legSlot = 213; - this.rare = 5; - this.value = Item.sellPrice(gold: 2); - break; - case 4985: - this.DefaultToMusicBox(53); - break; - case 4986: - this.useStyle = 1; - this.shootSpeed = 9f; - this.shoot = 936; - this.width = 18; - this.height = 20; - this.maxStack = 99; - this.consumable = true; - this.UseSound = SoundID.Item1; - this.useAnimation = 15; - this.useTime = 15; - this.noUseGraphic = true; - this.noMelee = true; - this.value = 200; - break; - case 4987: - this.width = 16; - this.height = 24; - this.accessory = true; - this.rare = 6; - this.value = Item.sellPrice(gold: 5); - this.expert = true; - break; - case 4988: - this.useStyle = 4; - this.width = 20; - this.height = 20; - this.consumable = true; - this.useAnimation = 45; - this.useTime = 45; - this.maxStack = 20; - this.rare = 6; - this.value = Item.sellPrice(gold: 1); - break; - case 4989: - this.width = 22; - this.height = 22; - this.accessory = true; - this.rare = 1; - this.value = Item.sellPrice(gold: 10); - this.expert = true; - break; - case 4990: - this.DefaultToMusicBox(54); - break; - case 4991: - this.DefaultToMusicBox(55); - break; - case 4992: - this.DefaultToMusicBox(56); - break; - case 4993: - this.DefaultToPlacableTile((ushort) 89, 43); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(silver: 50)); - this.maxStack = 99; - this.width = 20; - this.height = 20; - this.rare = 9; - break; - case 4994: - this.width = 18; - this.height = 14; - this.headSlot = 262; - this.rare = 2; - this.value = Item.buyPrice(gold: 10); - this.vanity = true; - break; - case 4995: - this.width = 18; - this.height = 14; - this.headSlot = 263; - this.rare = 2; - this.value = Item.buyPrice(gold: 10); - this.vanity = true; - break; - case 4996: - this.width = 18; - this.height = 14; - this.headSlot = 264; - this.rare = 2; - this.value = Item.buyPrice(gold: 10); - this.vanity = true; - break; - case 4997: - this.width = 18; - this.height = 14; - this.vanity = true; - this.bodySlot = 231; - this.value = Item.buyPrice(gold: 10); - this.rare = 2; - break; - case 4998: - this.width = 18; - this.height = 14; - this.vanity = true; - this.bodySlot = 232; - this.value = Item.buyPrice(gold: 10); - this.rare = 2; - break; - case 4999: - this.width = 18; - this.height = 14; - this.vanity = true; - this.bodySlot = 233; - this.value = Item.buyPrice(gold: 10); - this.rare = 2; - break; - case 5000: - this.DefaultToAccessory(34, 30); - this.shoeSlot = (sbyte) 24; - this.SetShopValues(ItemRarityColor.Lime7, Item.sellPrice(gold: 15)); - this.canBePlacedInVanityRegardlessOfConditions = true; - break; - case 5001: - this.width = 18; - this.height = 14; - this.defense = 3; - this.legSlot = 217; - this.value = Item.buyPrice(gold: 10); - this.rare = 2; - break; - case 5002: - case 5003: - this.DefaultToPlacableTile((ushort) 376, 24 + type - 5002); - this.SetShopValues(ItemRarityColor.Green2, Item.sellPrice(gold: 1)); - this.maxStack = 99; - break; - case 5004: - this.width = 18; - this.height = 14; - this.headSlot = 265; - this.rare = 9; - this.value = Item.sellPrice(silver: 30); - this.vanity = true; - break; - case 5005: - this.mana = 10; - this.damage = 90; - this.useStyle = 1; - this.shootSpeed = 10f; - this.shoot = 946; - this.buffType = 322; - this.width = 26; - this.height = 28; - this.UseSound = SoundID.Item113; - this.useAnimation = 36; - this.useTime = 36; - this.rare = 5; - this.noMelee = true; - this.knockBack = 4f; - this.value = Item.sellPrice(gold: 20); - this.summon = true; - break; - case 5006: - this.DefaultToMusicBox(57); - break; - case 5007: - this.width = 18; - this.height = 18; - this.bodySlot = 234; - this.rare = 2; - this.value = Item.sellPrice(silver: 20); - this.vanity = true; - break; - case 5008: - this.DefaultToPlacableTile((ushort) 622, 0); - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(silver: 2)); - break; - case 5010: - this.DefaultToAccessory(34, 30); - this.waistSlot = (sbyte) 16; - this.SetShopValues(ItemRarityColor.Blue1, Item.sellPrice(gold: 5)); - break; - case 5011: - case 5012: - this.noMelee = true; - this.useStyle = 5; - this.useAnimation = 45; - this.useTime = 45; - this.knockBack = 4.6f; - this.width = 28; - this.height = 28; - this.damage = 9; - this.scale = 1f; - this.noUseGraphic = true; - this.shoot = 947; - if (type == 5012) - this.shoot = 948; - this.shootSpeed = 11f; - this.UseSound = SoundID.Item1; - this.rare = 1; - this.value = Item.sellPrice(gold: 2); - this.melee = true; - this.channel = true; - break; - case 5014: - this.DefaultToMusicBox(58); - break; - case 5015: - this.DefaultToMusicBox(59); - break; - case 5016: - this.DefaultToMusicBox(60); - break; - case 5017: - this.DefaultToMusicBox(61); - break; - case 5018: - this.DefaultToMusicBox(62); - break; - case 5019: - this.DefaultToMusicBox(63); - break; - case 5020: - this.DefaultToMusicBox(64); - break; - case 5021: - this.DefaultToMusicBox(65); - break; - case 5022: - this.DefaultToMusicBox(66); - break; - case 5023: - this.DefaultToMusicBox(67); - break; - case 5024: - this.DefaultToMusicBox(68); - break; - case 5025: - this.DefaultToMusicBox(69); - break; - case 5026: - this.DefaultToMusicBox(70); - break; - case 5027: - this.DefaultToMusicBox(71); - break; - case 5028: - this.DefaultToMusicBox(72); - break; - case 5029: - this.DefaultToMusicBox(73); - break; - case 5030: - this.DefaultToMusicBox(74); - break; - case 5031: - this.DefaultToMusicBox(75); - break; - case 5032: - this.DefaultToMusicBox(76); - break; - case 5033: - this.DefaultToMusicBox(77); - break; - case 5034: - this.DefaultToMusicBox(78); - break; - case 5035: - this.DefaultToMusicBox(79); - break; - case 5036: - this.DefaultToMusicBox(80); - break; - case 5037: - this.DefaultToMusicBox(81); - break; - case 5038: - this.DefaultToMusicBox(82); - break; - case 5039: - this.DefaultToMusicBox(83); - break; - case 5040: - this.DefaultToMusicBox(84); - break; - case 5043: - this.maxStack = 99; - this.consumable = true; - this.width = 18; - this.height = 18; - this.useStyle = 4; - this.useTime = 30; - this.UseSound = SoundID.Item4; - this.useAnimation = 30; - this.rare = 4; - this.value = Item.sellPrice(gold: 2); - break; - case 5044: - this.DefaultToMusicBox(85); - break; - } - } - - private void DefaultToWhip( - int projectileId, - int dmg, - float kb, - float shootspeed, - int animationTotalTime = 30) - { - this.autoReuse = false; - this.useStyle = 1; - this.useAnimation = animationTotalTime; - this.useTime = animationTotalTime; - this.width = 18; - this.height = 18; - this.shoot = projectileId; - this.UseSound = SoundID.Item152; - this.noMelee = true; - this.summon = true; - this.noUseGraphic = true; - this.damage = dmg; - this.knockBack = kb; - this.shootSpeed = shootspeed; - } - - public void DefaultTokite(int projId) - { - this.width = 20; - this.height = 28; - this.DefaultToThrownWeapon(projId, 30, 2f); - this.consumable = false; - this.ranged = false; - this.noUseGraphic = true; - this.maxStack = 1; - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 2)); - } - - public void DefaultToVanitypet(int projId, int buffID) - { - this.damage = 0; - this.useStyle = 1; - this.width = 16; - this.height = 30; - this.UseSound = SoundID.Item2; - this.useAnimation = 20; - this.useTime = 20; - this.rare = 3; - this.noMelee = true; - this.value = Item.sellPrice(gold: 2); - this.buffType = buffID; - this.shoot = projId; - } - - public bool IsACoin - { - get - { - switch (this.type) - { - case 71: - case 72: - case 73: - case 74: - return true; - default: - return false; - } - } - } - - public static bool IsAGolfingItem(Item item) - { - if (ProjectileID.Sets.IsAGolfBall[item.shoot]) - return true; - int type = item.type; - switch (type) - { - case 4039: - case 4092: - case 4093: - case 4094: - case 4095: - return true; - default: - if ((uint) (type - 4587) > 11U) - return false; - goto case 4039; - } - } - - private void DefaultToSeaShelll() - { - this.useStyle = 1; - this.autoReuse = true; - this.useAnimation = 15; - this.useTime = 10; - this.maxStack = 999; - this.consumable = true; - this.createTile = 324; - this.width = 22; - this.height = 22; - switch (this.type) - { - case 2626: - this.placeStyle = 1; - this.value = Item.sellPrice(silver: 10); - break; - case 4071: - this.placeStyle = 4; - this.value = Item.sellPrice(gold: 1); - break; - case 4072: - this.placeStyle = 2; - this.value = Item.sellPrice(silver: 20); - break; - case 4073: - this.placeStyle = 3; - this.value = Item.sellPrice(silver: 20); - break; - default: - this.value = Item.sellPrice(silver: 5); - break; - } - } - - private void DefaultToCapturedCritter(short npcIdToSpawnOnUse) - { - this.useStyle = 1; - this.autoReuse = true; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.maxStack = 999; - this.consumable = true; - this.width = 12; - this.height = 12; - this.noUseGraphic = true; - this.makeNPC = npcIdToSpawnOnUse; - } - - private void DefaultToStaff( - int projType, - float pushForwardSpeed, - int singleShotTime, - int manaPerShot) - { - this.DefaultToMagicWeapon(projType, singleShotTime, pushForwardSpeed, true); - this.mana = manaPerShot; - this.width = 40; - this.height = 40; - this.UseSound = SoundID.Item43; - } - - private void DefaultToSpear(int projType, float pushForwardSpeed, int animationTime) - { - this.useStyle = 5; - this.useAnimation = 31; - this.useTime = 31; - this.shootSpeed = pushForwardSpeed; - this.width = 32; - this.height = 32; - this.UseSound = SoundID.Item1; - this.shoot = projType; - this.noMelee = true; - this.noUseGraphic = true; - this.melee = true; - this.useAnimation = this.useTime = animationTime; - } - - private void SetFoodDefaults(int type) - { - switch (type) - { - case 353: - this.DefaultToFood(22, 22, 25, 7200, true); - this.SetShopValues(ItemRarityColor.White0, 100); - this.maxStack = 99; - this.holdStyle = 1; - this.ammo = 353; - this.notAmmo = true; - break; - case 357: - this.DefaultToFood(22, 22, 206, 28800, true); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 967: - this.DefaultToFood(12, 12, 26, 3600); - this.SetShopValues(ItemRarityColor.White0, Item.buyPrice(silver: 1)); - this.useStyle = 9; - break; - case 969: - this.DefaultToFood(12, 12, 26, 36000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(silver: 2)); - this.useStyle = 9; - break; - case 1787: - this.DefaultToFood(22, 22, 206, 28800); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(silver: 10)); - break; - case 1911: - this.DefaultToFood(22, 22, 207, 14400, true); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(silver: 10)); - break; - case 1912: - this.DefaultToHealingPotion(22, 22, 80); - this.SetShopValues(ItemRarityColor.Blue1, 40); - break; - case 1919: - this.DefaultToFood(22, 22, 207, 14400); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(silver: 25)); - break; - case 1920: - this.DefaultToFood(22, 22, 207, 14400); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(silver: 25)); - break; - case 2266: - this.DefaultToFood(22, 22, 25, 14400, true); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(silver: 5)); - break; - case 2267: - this.DefaultToFood(22, 22, 206, 28800); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(silver: 30)); - break; - case 2268: - this.DefaultToFood(22, 22, 206, 36000, true); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(silver: 50)); - break; - case 2425: - this.DefaultToFood(22, 22, 26, 28800); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(silver: 25)); - break; - case 2426: - this.DefaultToFood(22, 22, 206, 36000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(silver: 75)); - break; - case 2427: - this.DefaultToFood(22, 22, 206, 28800); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(silver: 25)); - break; - case 3195: - this.DefaultToFood(22, 22, 206, 36000, true); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 3532: - this.DefaultToFood(22, 22, 207, 86400); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 5)); - break; - case 4009: - this.DefaultToFood(22, 22, 26, 18000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4011: - this.DefaultToFood(22, 22, 207, 57600); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 3)); - break; - case 4012: - this.DefaultToFood(22, 22, 206, 36000, true); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4013: - this.DefaultToFood(22, 22, 207, 86400); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 5)); - break; - case 4014: - this.DefaultToFood(22, 22, 26, 36000, true); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4015: - this.DefaultToFood(22, 22, 207, 28800); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 2)); - break; - case 4016: - this.DefaultToFood(22, 22, 206, 50400); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 2)); - break; - case 4017: - this.DefaultToFood(22, 22, 206, 72000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 3)); - break; - case 4018: - this.DefaultToFood(22, 22, 206, 57600, true); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 2)); - break; - case 4019: - this.DefaultToFood(22, 22, 206, 36000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4020: - this.DefaultToFood(22, 22, 206, 50400); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 2)); - break; - case 4021: - this.DefaultToFood(22, 22, 206, 36000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4022: - this.DefaultToFood(22, 22, 207, 172800); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 50)); - break; - case 4023: - this.DefaultToFood(22, 22, 206, 57600); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 2)); - break; - case 4024: - this.DefaultToFood(22, 22, 26, 36000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4025: - this.DefaultToFood(22, 22, 206, 72000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 3)); - break; - case 4026: - this.DefaultToFood(22, 22, 206, 50400, true); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 2)); - break; - case 4027: - this.DefaultToFood(22, 22, 207, 57600, true); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 3)); - break; - case 4028: - this.DefaultToFood(22, 22, 206, 57600); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 2)); - break; - case 4029: - this.DefaultToFood(22, 22, 207, 28800); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 2)); - break; - case 4030: - this.DefaultToFood(22, 22, 26, 64800); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1, silver: 50)); - break; - case 4031: - this.DefaultToFood(22, 22, 26, 36000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4032: - this.DefaultToFood(22, 22, 206, 36000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4033: - this.DefaultToFood(22, 22, 206, 36000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4034: - this.DefaultToFood(22, 22, 207, 14400); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(silver: 50)); - break; - case 4035: - this.DefaultToFood(22, 22, 206, 64800); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 2, silver: 50)); - break; - case 4036: - this.DefaultToFood(22, 22, 207, 28800); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 2)); - break; - case 4037: - this.DefaultToFood(22, 22, 207, 57600); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 3)); - break; - case 4282: - this.DefaultToFood(22, 22, 26, 18000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4283: - this.DefaultToFood(22, 22, 26, 18000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4284: - this.DefaultToFood(22, 22, 26, 18000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4285: - this.DefaultToFood(22, 22, 26, 18000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4286: - this.DefaultToFood(22, 22, 26, 18000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4287: - this.DefaultToFood(22, 22, 26, 18000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4288: - this.DefaultToFood(22, 22, 206, 18000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4289: - this.DefaultToFood(22, 22, 26, 18000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4290: - this.DefaultToFood(22, 22, 26, 18000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4291: - this.DefaultToFood(22, 22, 26, 18000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4292: - this.DefaultToFood(22, 22, 26, 18000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4293: - this.DefaultToFood(22, 22, 26, 18000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4294: - this.DefaultToFood(22, 22, 26, 18000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4295: - this.DefaultToFood(22, 22, 26, 18000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4296: - this.DefaultToFood(22, 22, 26, 18000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4297: - this.DefaultToFood(22, 22, 206, 18000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4403: - this.DefaultToFood(22, 22, 206, 36000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4411: - this.DefaultToFood(22, 22, 26, 36000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4614: - this.DefaultToFood(22, 22, 26, 36000, true); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4615: - this.DefaultToFood(22, 22, 207, 57600, true); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 4)); - break; - case 4616: - this.DefaultToFood(22, 22, 26, 36000, true); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4617: - this.DefaultToFood(22, 22, 26, 54000, true); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4618: - this.DefaultToFood(22, 22, 26, 36000, true); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 4619: - this.DefaultToFood(22, 22, 26, 72000, true); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 2)); - break; - case 4620: - this.DefaultToFood(22, 22, 26, 72000, true); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 2)); - break; - case 4621: - this.DefaultToFood(22, 22, 26, 72000, true); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 2)); - break; - case 4622: - this.DefaultToFood(22, 22, 26, 72000, true); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 2)); - break; - case 4623: - this.DefaultToFood(22, 22, 206, 72000, true); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 2)); - break; - case 4624: - this.DefaultToFood(22, 22, 26, 54000, true); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 2)); - break; - case 4625: - this.DefaultToFood(22, 22, 26, 90000); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 3)); - break; - case 5009: - this.DefaultToFood(22, 22, 26, 18000, true); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(copper: 20)); - break; - case 5041: - this.DefaultToFood(22, 22, 26, 54000, true); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - case 5042: - this.DefaultToFood(22, 22, 206, 36000, true); - this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(gold: 1)); - break; - } - float num = 0.0f; - this.rare = (int) ((double) ((this.buffType != 207 ? (this.buffType != 206 ? num + 3f : num + 8f) : num + 12f) + (float) (this.buffTime / 14400)) / 4.0); - } - - private void DefaultToMount(int mount) - { - this.width = 36; - this.height = 26; - this.mountType = mount; - } - - private void DefaultToPlacableWall(ushort wallToPlace) - { - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 7; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createWall = (int) wallToPlace; - this.width = 12; - this.height = 12; - } - - private void SetWeaponValues(int dmg, float knockback, int bonusCritChance = 0) - { - this.damage = dmg; - this.knockBack = knockback; - this.crit = bonusCritChance; - } - - private void DefaultToBow(int singleShotTime, float shotVelocity, bool hasAutoReuse = false) - { - this.DefaultToRangedWeapon(1, AmmoID.Arrow, singleShotTime, shotVelocity, hasAutoReuse); - this.width = 14; - this.height = 30; - this.UseSound = SoundID.Item5; - } - - private void DefaultToMagicWeapon( - int projType, - int singleShotTime, - float shotVelocity, - bool hasAutoReuse = false) - { - this.autoReuse = hasAutoReuse; - this.useStyle = 5; - this.useAnimation = singleShotTime; - this.useTime = singleShotTime; - this.shoot = projType; - this.shootSpeed = shotVelocity; - this.noMelee = true; - this.magic = true; - } - - private void DefaultToRangedWeapon( - int baseProjType, - int ammoID, - int singleShotTime, - float shotVelocity, - bool hasAutoReuse = false) - { - this.autoReuse = hasAutoReuse; - this.useStyle = 5; - this.useAnimation = singleShotTime; - this.useTime = singleShotTime; - this.shoot = baseProjType; - this.useAmmo = ammoID; - this.shootSpeed = shotVelocity; - this.noMelee = true; - this.ranged = true; - } - - private void DefaultToThrownWeapon( - int baseProjType, - int singleShotTime, - float shotVelocity, - bool hasAutoReuse = false) - { - this.autoReuse = hasAutoReuse; - this.useStyle = 1; - this.useAnimation = singleShotTime; - this.useTime = singleShotTime; - this.shoot = baseProjType; - this.shootSpeed = shotVelocity; - this.noMelee = true; - this.ranged = true; - this.consumable = true; - this.maxStack = 999; - } - - private void DefaultToTorch(int tileStyleToPlace, bool allowWaterPlacement = false) - { - this.flame = true; - this.noWet = !allowWaterPlacement; - this.holdStyle = 1; - this.autoReuse = true; - this.maxStack = 999; - this.consumable = true; - this.createTile = 4; - this.placeStyle = tileStyleToPlace; - this.width = 10; - this.height = 12; - this.value = 60; - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - } - - private void DefaultToPlacableTile(int tileIDToPlace, int tileStyleToPlace = 0) => this.DefaultToPlacableTile((ushort) tileIDToPlace, tileStyleToPlace); - - private void DefaultToPlacableTile(ushort tileIDToPlace, int tileStyleToPlace = 0) - { - this.createTile = (int) tileIDToPlace; - this.placeStyle = tileStyleToPlace; - this.width = 14; - this.height = 14; - this.useStyle = 1; - this.useAnimation = 15; - this.useTime = 10; - this.maxStack = 999; - this.useTurn = true; - this.autoReuse = true; - this.consumable = true; - } - - private void DefaultToGolfClub(int newwidth, int newheight) - { - this.width = newwidth; - this.height = newheight; - this.channel = true; - this.useStyle = 8; - this.holdStyle = 4; - this.shootSpeed = 6f; - this.shoot = 722; - this.UseSound = (LegacySoundStyle) null; - this.useAnimation = this.useTime = 12; - this.noMelee = true; - } - - private void DefaultToLawnMower(int newwidth, int newheight) - { - this.width = newwidth; - this.height = newheight; - this.holdStyle = 1; - this.useStyle = 11; - this.useAnimation = 30; - this.useTime = 10; - this.UseSound = SoundID.Item23; - this.autoReuse = true; - } - - private void DefaultToFood( - int newwidth, - int newheight, - int foodbuff, - int foodbuffduration, - bool useGulpSound = false, - int animationTime = 17) - { - this.UseSound = !useGulpSound ? SoundID.Item2 : SoundID.Item3; - this.useStyle = !useGulpSound ? 2 : 9; - this.useTurn = true; - this.useAnimation = this.useTime = animationTime; - this.maxStack = 30; - this.consumable = true; - this.width = newwidth; - this.height = newheight; - this.buffType = foodbuff; - this.buffTime = foodbuffduration; - this.rare = 1; - this.value = Item.buyPrice(silver: 20); - } - - private void DefaultToHealingPotion( - int newwidth, - int newheight, - int healingAmount, - int animationTime = 17) - { - this.UseSound = SoundID.Item3; - this.useStyle = 9; - this.useTurn = true; - this.useAnimation = this.useTime = animationTime; - this.maxStack = 30; - this.consumable = true; - this.width = newwidth; - this.height = newheight; - this.rare = 1; - this.value = Item.buyPrice(silver: 20); - this.potion = true; - this.healLife = healingAmount; - } - - private void SetShopValues(ItemRarityColor rarity, int coinValue) - { - this.rare = (int) rarity; - this.value = coinValue; - } - - private void DefaultToHeadgear(int newwidth, int newheight, int helmetArtID) - { - this.width = newwidth; - this.height = newheight; - this.headSlot = helmetArtID; - } - - private void DefaultToAccessory(int newwidth = 24, int newheight = 24) - { - this.width = newwidth; - this.height = newheight; - this.accessory = true; - } - - private void DefaultToGuitar(int newwidth = 24, int newheight = 24) - { - this.width = newwidth; - this.height = newheight; - this.autoReuse = true; - this.holdStyle = 5; - this.useStyle = 12; - this.useAnimation = this.useTime = 12; - } - - private void DefaultToMusicBox(int style) - { - this.useStyle = 1; - this.useTurn = true; - this.useAnimation = 15; - this.useTime = 10; - this.autoReuse = true; - this.consumable = true; - this.createTile = 139; - this.placeStyle = style; - this.width = 24; - this.height = 24; - this.rare = 4; - this.value = 100000; - this.accessory = true; - this.canBePlacedInVanityRegardlessOfConditions = true; - } - - public void SetDefaults(int Type = 0) => this.SetDefaults(Type, false); - - public void SetDefaults(int Type, bool noMatCheck = false) - { - if (Type < 0) - { - this.netDefaults(Type); - } - else - { - this.playerIndexTheItemIsReservedFor = Main.netMode == 1 || Main.netMode == 2 ? (int) byte.MaxValue : Main.myPlayer; - this.ResetStats(Type); - if (this.type >= 5045) - this.type = 0; - if (this.type == 0) - { - this.netID = 0; - this.stack = 0; - } - else if (ItemID.Sets.IsFood[this.type]) - this.SetFoodDefaults(this.type); - else if (this.type <= 1000) - this.SetDefaults1(this.type); - else if (this.type <= 2001) - this.SetDefaults2(this.type); - else if (this.type <= 3000) - this.SetDefaults3(this.type); - else if (this.type <= 3989) - this.SetDefaults4(this.type); - else - this.SetDefaults5(this.type); - this.dye = (byte) GameShaders.Armor.GetShaderIdFromItemId(this.type); - if (this.hairDye != (short) 0) - this.hairDye = GameShaders.Hair.GetShaderIdFromItemId(this.type); - if (this.type == 2015) - this.value = Item.sellPrice(silver: 5); - if (this.type == 2016) - this.value = Item.sellPrice(silver: 7, copper: 50); - if (this.type == 2017) - this.value = Item.sellPrice(silver: 7, copper: 50); - if (this.type == 2019) - this.value = Item.sellPrice(silver: 5); - if (this.type == 2018) - this.value = Item.sellPrice(silver: 5); - if (this.type == 3563) - this.value = Item.sellPrice(silver: 5); - if (this.type == 261) - this.value = Item.sellPrice(silver: 7, copper: 50); - if (this.type == 2205) - this.value = Item.sellPrice(silver: 12, copper: 50); - if (this.type == 2123) - this.value = Item.sellPrice(silver: 7, copper: 50); - if (this.type == 2122) - this.value = Item.sellPrice(silver: 7, copper: 50); - if (this.type == 2003) - this.value = Item.sellPrice(silver: 10); - if (this.type == 2156) - this.value = Item.sellPrice(silver: 15); - if (this.type == 2157) - this.value = Item.sellPrice(silver: 15); - if (this.type == 2121) - this.value = Item.sellPrice(silver: 15); - if (this.type == 1992) - this.value = Item.sellPrice(silver: 3); - if (this.type == 2004) - this.value = Item.sellPrice(silver: 5); - if (this.type == 2002) - this.value = Item.sellPrice(silver: 5); - if (this.type == 2740) - this.value = Item.sellPrice(silver: 2, copper: 50); - if (this.type == 2006) - this.value = Item.sellPrice(silver: 10); - if (this.type == 3191) - this.value = Item.sellPrice(silver: 20); - if (this.type == 3192) - this.value = Item.sellPrice(silver: 2, copper: 50); - if (this.type == 3193) - this.value = Item.sellPrice(silver: 5); - if (this.type == 3194) - this.value = Item.sellPrice(silver: 10); - if (this.type == 2007) - this.value = Item.sellPrice(silver: 50); - if (this.type == 2673) - this.value = Item.sellPrice(gold: 10); - if (this.bait > 0) - { - if (this.bait >= 50) - this.rare = 3; - else if (this.bait >= 30) - this.rare = 2; - else if (this.bait >= 15) - this.rare = 1; - } - if (this.type >= 1994 && this.type <= 2001) - { - int num = this.type - 1994; - if (num == 0) - this.value = Item.sellPrice(silver: 5); - if (num == 4) - this.value = Item.sellPrice(silver: 10); - if (num == 6) - this.value = Item.sellPrice(silver: 15); - if (num == 3) - this.value = Item.sellPrice(silver: 20); - if (num == 7) - this.value = Item.sellPrice(silver: 30); - if (num == 2) - this.value = Item.sellPrice(silver: 40); - if (num == 1) - this.value = Item.sellPrice(silver: 75); - if (num == 5) - this.value = Item.sellPrice(gold: 1); - } - if (this.type == 2663 || this.type == 1720 || this.type == 2137 || this.type == 2155 || this.type == 2151 || this.type == 1704 || this.type == 2143 || this.type == 1710 || this.type == 2238 || this.type == 2133 || this.type == 2147 || this.type == 2405 || this.type == 1716 || this.type == 1705) - this.value = Item.sellPrice(gold: 2); - if (Main.projHook[this.shoot]) - { - this.useStyle = 0; - this.useTime = 0; - this.useAnimation = 0; - } - if (ItemID.Sets.IsDrill[this.type] || ItemID.Sets.IsChainsaw[this.type]) - { - this.useTime = (int) ((double) this.useTime * 0.6); - if (this.useTime < 1) - this.useTime = 1; - this.useAnimation = (int) ((double) this.useAnimation * 0.6); - if (this.useAnimation < 1) - this.useAnimation = 1; - --this.tileBoost; - } - if (ItemID.Sets.IsFood[this.type]) - this.holdStyle = 1; - if (this.type >= 1803 && this.type <= 1807) - this.SetDefaults(1533 + this.type - 1803); - if (this.dye > (byte) 0) - this.maxStack = 99; - if (this.createTile == 19) - this.maxStack = 999; - this.netID = this.type; - if (!noMatCheck) - this.material = ItemID.Sets.IsAMaterial[this.type]; - this.RebuildTooltip(); - if (this.type <= 0 || this.type >= 5045 || !ItemID.Sets.Deprecated[this.type]) - return; - this.netID = 0; + this.owner = Main.netMode == 1 || Main.netMode == 2 ? (int) byte.MaxValue : Main.myPlayer; + this.ResetStats(Type); + if (this.type >= 3930) this.type = 0; + if (this.type == 0) + { + this.netID = 0; this.stack = 0; } + else if (this.type <= 1000) + this.SetDefaults1(this.type); + else if (this.type <= 2001) + this.SetDefaults2(this.type); + else if (this.type <= 3000) + this.SetDefaults3(this.type); + else + this.SetDefaults4(this.type); + this.dye = (byte) GameShaders.Armor.GetShaderIdFromItemId(this.type); + if (this.hairDye != (short) 0) + this.hairDye = GameShaders.Hair.GetShaderIdFromItemId(this.type); + if (this.type == 2015) + this.value = Item.sellPrice(silver: 5); + if (this.type == 2016) + this.value = Item.sellPrice(silver: 7, copper: 50); + if (this.type == 2017) + this.value = Item.sellPrice(silver: 7, copper: 50); + if (this.type == 2019) + this.value = Item.sellPrice(silver: 5); + if (this.type == 2018) + this.value = Item.sellPrice(silver: 5); + if (this.type == 3563) + this.value = Item.sellPrice(silver: 5); + if (this.type == 261) + this.value = Item.sellPrice(silver: 7, copper: 50); + if (this.type == 2205) + this.value = Item.sellPrice(silver: 12, copper: 50); + if (this.type == 2123) + this.value = Item.sellPrice(silver: 7, copper: 50); + if (this.type == 2122) + this.value = Item.sellPrice(silver: 7, copper: 50); + if (this.type == 2003) + this.value = Item.sellPrice(silver: 20); + if (this.type == 2156) + this.value = Item.sellPrice(silver: 15); + if (this.type == 2157) + this.value = Item.sellPrice(silver: 15); + if (this.type == 2121) + this.value = Item.sellPrice(silver: 15); + if (this.type == 1992) + this.value = Item.sellPrice(silver: 3); + if (this.type == 2004) + this.value = Item.sellPrice(silver: 5); + if (this.type == 2002) + this.value = Item.sellPrice(silver: 5); + if (this.type == 2740) + this.value = Item.sellPrice(silver: 2, copper: 50); + if (this.type == 2006) + this.value = Item.sellPrice(silver: 20); + if (this.type == 3191) + this.value = Item.sellPrice(silver: 20); + if (this.type == 3192) + this.value = Item.sellPrice(silver: 2, copper: 50); + if (this.type == 3193) + this.value = Item.sellPrice(silver: 5); + if (this.type == 3194) + this.value = Item.sellPrice(silver: 10); + if (this.type == 2007) + this.value = Item.sellPrice(silver: 50); + if (this.type == 2673) + this.value = Item.sellPrice(gold: 10); + if (this.bait > 0) + { + if (this.bait >= 50) + this.rare = 3; + else if (this.bait >= 30) + this.rare = 2; + else if (this.bait >= 15) + this.rare = 1; + } + if (this.type >= 1994 && this.type <= 2001) + { + int num = this.type - 1994; + if (num == 0) + this.value = Item.sellPrice(silver: 5); + if (num == 4) + this.value = Item.sellPrice(silver: 10); + if (num == 6) + this.value = Item.sellPrice(silver: 15); + if (num == 3) + this.value = Item.sellPrice(silver: 20); + if (num == 7) + this.value = Item.sellPrice(silver: 30); + if (num == 2) + this.value = Item.sellPrice(silver: 40); + if (num == 1) + this.value = Item.sellPrice(silver: 75); + if (num == 5) + this.value = Item.sellPrice(gold: 1); + } + if (this.type == 483 || this.type == 1192 || this.type == 482 || this.type == 1185 || this.type == 484 || this.type == 1199 || this.type == 368) + { + this.autoReuse = true; + this.damage = (int) ((double) this.damage * 1.15); + } + if (this.type == 2663 || this.type == 1720 || this.type == 2137 || this.type == 2155 || this.type == 2151 || this.type == 1704 || this.type == 2143 || this.type == 1710 || this.type == 2238 || this.type == 2133 || this.type == 2147 || this.type == 2405 || this.type == 1716 || this.type == 1705) + this.value = Item.sellPrice(gold: 2); + if (Main.projHook[this.shoot]) + { + this.useStyle = 0; + this.useTime = 0; + this.useAnimation = 0; + } + if (this.type >= 1803 && this.type <= 1807) + this.SetDefaults(1533 + this.type - 1803); + if (this.dye > (byte) 0) + this.maxStack = 99; + if (this.createTile == 19) + this.maxStack = 999; + this.netID = this.type; + if (!noMatCheck) + this.checkMat(); + this.RebuildTooltip(); + if (this.type <= 0 || this.type >= 3930 || !ItemID.Sets.Deprecated[this.type]) + return; + this.netID = 0; + this.type = 0; + this.stack = 0; } public void ResetStats(int Type) { - this.tooltipContext = -1; - this.BestiaryNotes = (string) null; this.sentry = false; - this.canBePlacedInVanityRegardlessOfConditions = false; this.DD2Summon = false; this.shopSpecialCurrency = -1; this.shopCustomPrice = new int?(); this.expert = false; - this.isAShopItem = false; this.expertOnly = false; this.instanced = false; + this.thrown = false; this.questItem = false; this.fishingPole = 0; this.bait = 0; @@ -44191,7 +37214,7 @@ namespace Terraria this.lavaWet = false; this.channel = false; this.manaIncrease = 0; - this.timeSinceTheItemHasBeenReservedForSomeone = 0; + this.release = 0; this.noMelee = false; this.noUseGraphic = false; this.lifeRegen = 0; @@ -44252,263 +37275,107 @@ namespace Terraria public Color GetAlpha(Color newColor) { - int type = this.type; - if (type <= 1572) + switch (this.type) { - if (type <= 549) - { - if (type <= 184) - { - if (type <= 58) - { - if (type == 51) - return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); - if (type == 58) - goto label_64; - else - goto label_92; - } - else if (type != 75) - { - if ((uint) (type - 119) > 3U) - { - if (type == 184) - goto label_64; - else - goto label_92; - } - } - else - goto label_59; - } - else if (type <= 501) - { - if ((uint) (type - 198) <= 5U) - return Color.White; - if ((uint) (type - 217) > 3U) - { - if (type == 501) - return new Color(200, 200, 200, 50); - goto label_92; - } - } - else - { - if (type == 502) - return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 150); - if ((uint) (type - 520) <= 2U || (uint) (type - 547) <= 2U) - goto label_63; - else - goto label_92; - } + case 51: + return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); + case 58: + case 184: + case 1734: + case 1735: + case 1867: + case 1868: + return new Color(200, 200, 200, 200); + case 75: + case 3065: + case 3858: + return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) newColor.A - this.alpha); + case 119: + case 120: + case 121: + case 122: + case 217: + case 218: + case 219: + case 220: return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); - } - if (type <= 1306) - { - if (type <= 757) - { - if (type != 575) - { - if (type == 757) - goto label_62; - else - goto label_92; - } - else - goto label_63; - } - else - { - if (type == 787) - return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 175); - if (type == 1260) - return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 175); - if (type == 1306) - goto label_62; - else - goto label_92; - } - } - else - { - if (type <= 1507) - { - if (type != 1332) - { - if (type != 1446 && (uint) (type - 1506) > 1U) - goto label_92; - } - else - goto label_63; - } - else - { - if (type == 1508) - return new Color(200, 200, 200, 0); - if ((uint) (type - 1543) > 2U) - { - if (type == 1572) - return new Color(200, 200, (int) byte.MaxValue, 125); - goto label_92; - } - } + case 198: + case 199: + case 200: + case 201: + case 202: + case 203: + return Color.White; + case 501: + return new Color(200, 200, 200, 50); + case 502: + return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 150); + case 520: + case 521: + case 522: + case 547: + case 548: + case 549: + case 575: + case 1332: + case 3453: + case 3454: + case 3455: + case 3580: + return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 50); + case 757: + case 1306: + case 3456: + case 3457: + case 3458: + case 3459: + return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 200); + case 787: + return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 175); + case 1260: + return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 175); + case 1446: + case 1506: + case 1507: + case 1543: + case 1544: + case 1545: return new Color((int) newColor.R, (int) newColor.G, (int) newColor.B, (int) Main.gFade); - } - } - else - { - if (type <= 3522) - { - if (type <= 2786) - { - if (type <= 1826) - { - if ((uint) (type - 1734) > 1U) - { - if (type == 1826) - return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 200); - goto label_92; - } - else - goto label_64; - } - else if ((uint) (type - 1867) > 1U) - { - if ((uint) (type - 2763) > 2U && (uint) (type - 2782) > 4U) - goto label_92; - } - else - goto label_64; - } - else if (type <= 3332) - { - if (type != 3065) - { - if (type == 3191) - return new Color(250, 250, 250, 200); - if ((uint) (type - 3318) <= 14U) - goto label_56; - else - goto label_92; - } - else - goto label_58; - } - else if ((uint) (type - 3453) > 2U) - { - if ((uint) (type - 3456) > 3U) - { - if (type != 3522) - goto label_92; - } - else - goto label_62; - } - else - goto label_63; + case 1508: + return new Color(200, 200, 200, 0); + case 1572: + return new Color(200, 200, (int) byte.MaxValue, 125); + case 1826: + return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 200); + case 2763: + case 2764: + case 2765: + case 2782: + case 2783: + case 2784: + case 2785: + case 2786: + case 3522: return new Color(250, 250, 250, (int) byte.MaxValue - this.alpha); - } - if (type <= 4354) - { - if (type <= 3858) - { - if (type != 3580) - { - if (type == 3822) - return Color.Lerp(Color.White, newColor, 0.5f) * (float) (((double) byte.MaxValue - (double) this.alpha) / (double) byte.MaxValue); - if (type == 3858) - goto label_59; - else - goto label_92; - } - else - goto label_63; - } - else if ((uint) (type - 3860) > 2U) - { - if (type == 4143) - return Color.Lerp(Color.White, newColor, 0.0f) * (float) (((double) byte.MaxValue - (double) this.alpha) / (double) byte.MaxValue); - if (type != 4354) - goto label_92; - } - else - goto label_56; - } - else if (type <= 4782) - { - if ((uint) (type - 4377) > 1U && type != 4389) - { - if (type == 4782) - goto label_56; - else - goto label_92; - } - } - else if (type != 4956) - { - if (type != 4957) - { - if (type == 5043) - return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) newColor.A - this.alpha); - goto label_92; - } - else - goto label_56; - } - else - goto label_58; - Color color = new Color(); - switch (this.type) - { - case 4377: - color = new Color(50, (int) byte.MaxValue, 50, 200); - break; - case 4378: - color = new Color(50, 200, (int) byte.MaxValue, (int) byte.MaxValue); - break; - case 4389: - color = new Color((int) byte.MaxValue, 50, 125, 200); - break; - default: - color = new Color((int) byte.MaxValue, 150, 150, 200); - break; - } - if ((int) newColor.R > (int) color.R) - color.R = newColor.R; - if ((int) newColor.G > (int) color.G) - color.G = newColor.G; - if ((int) newColor.B > (int) color.B) - color.B = newColor.B; - if ((int) newColor.A > (int) color.A) - color.A = newColor.A; - return color; -label_56: - return Color.Lerp(newColor, Color.White, 0.4f); -label_58: - return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) newColor.A - this.alpha); + case 3191: + return new Color(250, 250, 250, 200); + case 3822: + return Color.Lerp(Color.White, newColor, 0.5f) * (float) (((double) byte.MaxValue - (double) this.alpha) / (double) byte.MaxValue); + default: + float num1 = (float) ((int) byte.MaxValue - this.alpha) / (float) byte.MaxValue; + int r = (int) ((double) newColor.R * (double) num1); + int num2 = (int) ((double) newColor.G * (double) num1); + int num3 = (int) ((double) newColor.B * (double) num1); + int num4 = (int) newColor.A - this.alpha; + if (num4 < 0) + num4 = 0; + if (num4 > (int) byte.MaxValue) + num4 = (int) byte.MaxValue; + int g = num2; + int b = num3; + int a = num4; + return new Color(r, g, b, a); } -label_59: - return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); -label_62: - return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 200); -label_63: - return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 50); -label_64: - return new Color(200, 200, 200, 200); -label_92: - float num1 = (float) ((int) byte.MaxValue - this.alpha) / (float) byte.MaxValue; - int r = (int) ((double) newColor.R * (double) num1); - int num2 = (int) ((double) newColor.G * (double) num1); - int num3 = (int) ((double) newColor.B * (double) num1); - int num4 = (int) newColor.A - this.alpha; - if (num4 < 0) - num4 = 0; - if (num4 > (int) byte.MaxValue) - num4 = (int) byte.MaxValue; - int g = num2; - int b = num3; - int a = num4; - return new Color(r, g, b, a); } public Color GetColor(Color newColor) @@ -44565,725 +37432,567 @@ label_92: public void UpdateItem(int i) { - if (Main.timeItemSlotCannotBeReusedFor[i] > 0) + if (Main.itemLockoutTime[i] > 0) { - if (Main.netMode == 2) - { - --Main.timeItemSlotCannotBeReusedFor[i]; - return; - } - Main.timeItemSlotCannotBeReusedFor[i] = 0; - } - if (!this.active) - return; - if (this.instanced) - { - if (Main.netMode == 2) - { - this.active = false; - return; - } - this.keepTime = 6000; - this.ownTime = 0; - this.noGrabDelay = 0; - this.playerIndexTheItemIsReservedFor = Main.myPlayer; - } - if (Main.netMode == 0) - this.playerIndexTheItemIsReservedFor = Main.myPlayer; - float gravity = 0.1f; - float maxFallSpeed = 7f; - if (Main.netMode == 1) - { - int index1 = (int) ((double) this.position.X + (double) (this.width / 2)) / 16; - int index2 = (int) ((double) this.position.Y + (double) (this.height / 2)) / 16; - if (index1 >= 0 && index2 >= 0 && index1 < Main.maxTilesX && index2 < Main.maxTilesY && Main.tile[index1, index2] == null) - { - gravity = 0.0f; - this.velocity.X = 0.0f; - this.velocity.Y = 0.0f; - } - } - if (this.honeyWet) - { - gravity = 0.05f; - maxFallSpeed = 3f; - } - else if (this.wet) - { - maxFallSpeed = 5f; - gravity = 0.08f; - } - if (this.ownTime > 0) - --this.ownTime; - else - this.ownIgnore = -1; - if (this.keepTime > 0) - --this.keepTime; - Vector2 wetVelocity = this.velocity * 0.5f; - if (!this.beingGrabbed) - { - this.TryCombiningIntoNearbyItems(i); - if (Main.netMode != 2 && Main.expertMode && this.playerIndexTheItemIsReservedFor == Main.myPlayer && this.type >= 71 && this.type <= 74) - this.GetPickedUpByMonsters(i); - this.MoveInWorld(gravity, maxFallSpeed, ref wetVelocity); - if (this.lavaWet) - this.CheckLavaDeath(i); - this.DespawnIfMeetingConditions(i); + --Main.itemLockoutTime[i]; } else - this.beingGrabbed = false; - this.UpdateItem_VisualEffects(); - if (this.timeSinceItemSpawned < 2147483547) - this.timeSinceItemSpawned += ItemID.Sets.ItemSpawnDecaySpeed[this.type]; - if (Main.netMode == 2 && this.playerIndexTheItemIsReservedFor != Main.myPlayer) { - ++this.timeSinceTheItemHasBeenReservedForSomeone; - if (this.timeSinceTheItemHasBeenReservedForSomeone >= 300) - { - this.timeSinceTheItemHasBeenReservedForSomeone = 0; - NetMessage.SendData(39, this.playerIndexTheItemIsReservedFor, number: i); - } - } - if (this.wet) - this.position = this.position + wetVelocity; - else - this.position = this.position + this.velocity; - if (this.noGrabDelay <= 0) - return; - --this.noGrabDelay; - } - - private void DespawnIfMeetingConditions(int i) - { - if (this.type == 75 && Main.dayTime) - { - for (int index = 0; index < 10; ++index) - Dust.NewDust(this.position, this.width, this.height, 15, this.velocity.X, this.velocity.Y, 150, Scale: 1.2f); - for (int index = 0; index < 3; ++index) - Gore.NewGore(this.position, new Vector2(this.velocity.X, this.velocity.Y), Main.rand.Next(16, 18)); - this.active = false; - this.type = 0; - this.stack = 0; - if (Main.netMode == 2) - NetMessage.SendData(21, number: i); - } - if (this.type == 4143 && this.timeSinceItemSpawned > 300) - { - for (int index = 0; index < 20; ++index) - Dust.NewDust(this.position, this.width, this.height, 15, this.velocity.X, this.velocity.Y, 150, Color.Lerp(Color.CornflowerBlue, Color.Indigo, Main.rand.NextFloat()), 1.2f); - this.active = false; - this.type = 0; - this.stack = 0; - if (Main.netMode == 2) - NetMessage.SendData(21, number: i); - } - if (this.type != 3822 || DD2Event.Ongoing) - return; - int num = Main.rand.Next(18, 24); - for (int index1 = 0; index1 < num; ++index1) - { - int index2 = Dust.NewDust(this.Center, 0, 0, 61, Scale: 1.7f); - Main.dust[index2].velocity *= 8f; - --Main.dust[index2].velocity.Y; - Main.dust[index2].position = Vector2.Lerp(Main.dust[index2].position, this.Center, 0.5f); - Main.dust[index2].noGravity = true; - Main.dust[index2].noLight = true; - } - this.active = false; - this.type = 0; - this.stack = 0; - if (Main.netMode != 2) - return; - NetMessage.SendData(21, number: i); - } - - public void TryCombiningIntoNearbyItems(int i) - { - bool flag = true; - switch (this.type) - { - case 71: - case 72: - case 73: - case 74: - flag = false; - break; - } - if (ItemID.Sets.NebulaPickup[this.type]) - flag = false; - if (!(this.playerIndexTheItemIsReservedFor == Main.myPlayer & flag)) - return; - this.CombineWithNearbyItems(i); - } - - private void CheckLavaDeath(int i) - { - if (this.type == 267) - { - if (Main.netMode == 1) + if (!this.active) return; - this.active = false; - this.type = 0; - this.stack = 0; - for (int number = 0; number < 200; ++number) + if (this.instanced) { - if (Main.npc[number].active && Main.npc[number].type == 22) + if (Main.netMode == 2) { - if (Main.netMode == 2) - NetMessage.SendData(28, number: number, number2: 9999f, number3: 10f, number4: ((float) -Main.npc[number].direction)); - Main.npc[number].StrikeNPCNoInteraction(9999, 10f, -Main.npc[number].direction); - NPC.SpawnWOF(this.position); + this.active = false; + return; } + this.keepTime = 600; } - NetMessage.SendData(21, number: i); - } - else - { - if (this.playerIndexTheItemIsReservedFor != Main.myPlayer || this.type == 312 || this.type == 318 || this.type == 173 || this.type == 174 || this.type == 4422 || this.type == 175 || this.type == 2701 || this.rare != 0) - return; - this.active = false; - this.type = 0; - this.stack = 0; if (Main.netMode == 0) - return; - NetMessage.SendData(21, number: i); - } - } - - private void MoveInWorld(float gravity, float maxFallSpeed, ref Vector2 wetVelocity) - { - if (ItemID.Sets.ItemNoGravity[this.type]) - { - this.velocity.X *= 0.95f; - if ((double) this.velocity.X < 0.1 && (double) this.velocity.X > -0.1) - this.velocity.X = 0.0f; - this.velocity.Y *= 0.95f; - if ((double) this.velocity.Y < 0.1 && (double) this.velocity.Y > -0.1) - this.velocity.Y = 0.0f; - } - else - { - this.velocity.Y += gravity; - if ((double) this.velocity.Y > (double) maxFallSpeed) - this.velocity.Y = maxFallSpeed; - this.velocity.X *= 0.95f; - if ((double) this.velocity.X < 0.1 && (double) this.velocity.X > -0.1) - this.velocity.X = 0.0f; - } - bool flag = Collision.LavaCollision(this.position, this.width, this.height); - if (flag) - this.lavaWet = true; - int num = Collision.WetCollision(this.position, this.width, this.height) ? 1 : 0; - if (Collision.honey) - this.honeyWet = true; - if (num != 0) - { - if (!this.wet) + this.owner = Main.myPlayer; + float gravity = 0.1f; + float num1 = 7f; + if (Main.netMode == 1) { - if (this.wetCount == (byte) 0) + int index1 = (int) ((double) this.position.X + (double) (this.width / 2)) / 16; + int index2 = (int) ((double) this.position.Y + (double) (this.height / 2)) / 16; + if (index1 >= 0 && index2 >= 0 && index1 < Main.maxTilesX && index2 < Main.maxTilesY && Main.tile[index1, index2] == null) { - this.wetCount = (byte) 20; - if (!flag) + gravity = 0.0f; + this.velocity.X = 0.0f; + this.velocity.Y = 0.0f; + } + } + if (this.honeyWet) + { + gravity = 0.05f; + num1 = 3f; + } + else if (this.wet) + { + num1 = 5f; + gravity = 0.08f; + } + if (this.ownTime > 0) + --this.ownTime; + else + this.ownIgnore = -1; + if (this.keepTime > 0) + --this.keepTime; + this.isBeingGrabbed = this.beingGrabbed; + Vector2 vector2 = this.velocity * 0.5f; + if (!this.beingGrabbed) + { + bool flag1 = true; + switch (this.type) + { + case 71: + case 72: + case 73: + case 74: + flag1 = false; + break; + } + if (ItemID.Sets.NebulaPickup[this.type]) + flag1 = false; + if (this.owner == Main.myPlayer & flag1 && (this.createTile >= 0 || this.createWall > 0 || this.ammo > 0 && !this.notAmmo || this.consumable || this.type >= 205 && this.type <= 207 || this.type == 1128 || this.type == 530 || this.dye > (byte) 0 || this.paint > (byte) 0 || this.material) && this.stack < this.maxStack) + { + for (int number = i + 1; number < 400; ++number) { - if (this.honeyWet) + if (Main.item[number].active && Main.item[number].type == this.type && Main.item[number].stack > 0 && Main.item[number].owner == this.owner && (double) Math.Abs((float) ((double) this.position.X + (double) (this.width / 2) - ((double) Main.item[number].position.X + (double) (Main.item[number].width / 2)))) + (double) Math.Abs((float) ((double) this.position.Y + (double) (this.height / 2) - ((double) Main.item[number].position.Y + (double) (Main.item[number].height / 2)))) < 30.0) { - for (int index1 = 0; index1 < 5; ++index1) + this.position = (this.position + Main.item[number].position) / 2f; + this.velocity = (this.velocity + Main.item[number].velocity) / 2f; + int num2 = Main.item[number].stack; + if (num2 > this.maxStack - this.stack) + num2 = this.maxStack - this.stack; + Main.item[number].stack -= num2; + this.stack += num2; + if (Main.item[number].stack <= 0) { - int index2 = Dust.NewDust(new Vector2(this.position.X - 6f, (float) ((double) this.position.Y + (double) (this.height / 2) - 8.0)), this.width + 12, 24, 152); - --Main.dust[index2].velocity.Y; - Main.dust[index2].velocity.X *= 2.5f; - Main.dust[index2].scale = 1.3f; - Main.dust[index2].alpha = 100; - Main.dust[index2].noGravity = true; + Main.item[number].SetDefaults(); + Main.item[number].active = false; } - SoundEngine.PlaySound(19, (int) this.position.X, (int) this.position.Y); - } - else - { - for (int index3 = 0; index3 < 10; ++index3) + if (Main.netMode != 0 && this.owner == Main.myPlayer) { - int index4 = Dust.NewDust(new Vector2(this.position.X - 6f, (float) ((double) this.position.Y + (double) (this.height / 2) - 8.0)), this.width + 12, 24, Dust.dustWater()); - Main.dust[index4].velocity.Y -= 4f; - Main.dust[index4].velocity.X *= 2.5f; - Main.dust[index4].scale *= 0.8f; - Main.dust[index4].alpha = 100; - Main.dust[index4].noGravity = true; + NetMessage.SendData(21, number: i); + NetMessage.SendData(21, number: number); } - SoundEngine.PlaySound(19, (int) this.position.X, (int) this.position.Y); } } - else - { - for (int index5 = 0; index5 < 5; ++index5) - { - int index6 = Dust.NewDust(new Vector2(this.position.X - 6f, (float) ((double) this.position.Y + (double) (this.height / 2) - 8.0)), this.width + 12, 24, 35); - Main.dust[index6].velocity.Y -= 1.5f; - Main.dust[index6].velocity.X *= 2.5f; - Main.dust[index6].scale = 1.3f; - Main.dust[index6].alpha = 100; - Main.dust[index6].noGravity = true; - } - SoundEngine.PlaySound(19, (int) this.position.X, (int) this.position.Y); - } } - this.wet = true; - } - } - else if (this.wet) - { - this.wet = false; - int wetCount = (int) this.wetCount; - } - if (!this.wet) - { - this.lavaWet = false; - this.honeyWet = false; - } - if (this.wetCount > (byte) 0) - --this.wetCount; - if (this.wet) - { - if (this.wet) - { - Vector2 velocity = this.velocity; - this.velocity = Collision.TileCollision(this.position, this.velocity, this.width, this.height); - if ((double) this.velocity.X != (double) velocity.X) - wetVelocity.X = this.velocity.X; - if ((double) this.velocity.Y != (double) velocity.Y) - wetVelocity.Y = this.velocity.Y; - } - } - else - this.velocity = Collision.TileCollision(this.position, this.velocity, this.width, this.height); - Vector4 vector4 = Collision.SlopeCollision(this.position, this.velocity, this.width, this.height, gravity); - this.position.X = vector4.X; - this.position.Y = vector4.Y; - this.velocity.X = vector4.Z; - this.velocity.Y = vector4.W; - Collision.StepConveyorBelt((Entity) this, 1f); - } - - private void GetPickedUpByMonsters(int i) - { - Rectangle rectangle1 = new Rectangle((int) this.position.X, (int) this.position.Y, this.width, this.height); - for (int index1 = 0; index1 < 200; ++index1) - { - if (Main.npc[index1].active && Main.npc[index1].lifeMax > 5 && !Main.npc[index1].friendly && !Main.npc[index1].immortal && !Main.npc[index1].dontTakeDamage && !NPCID.Sets.CantTakeLunchMoney[Main.npc[index1].type]) - { - float stack = (float) this.stack; - float num1 = 1f; - if (this.type == 72) - num1 = 100f; - if (this.type == 73) - num1 = 10000f; - if (this.type == 74) - num1 = 1000000f; - float num2 = stack * num1; - float extraValue = (float) Main.npc[index1].extraValue; - int index2 = Main.npc[index1].realLife; - if (index2 >= 0 && Main.npc[index2].active) - extraValue = (float) Main.npc[index2].extraValue; + if (Main.netMode != 2 && Main.expertMode && this.owner == Main.myPlayer && this.type >= 71 && this.type <= 74) + { + Rectangle rectangle1 = new Rectangle((int) this.position.X, (int) this.position.Y, this.width, this.height); + for (int index3 = 0; index3 < 200; ++index3) + { + if (Main.npc[index3].active && Main.npc[index3].lifeMax > 5 && !Main.npc[index3].friendly && !Main.npc[index3].immortal && !Main.npc[index3].dontTakeDamage) + { + float stack = (float) this.stack; + float num3 = 1f; + if (this.type == 72) + num3 = 100f; + if (this.type == 73) + num3 = 10000f; + if (this.type == 74) + num3 = 1000000f; + float num4 = stack * num3; + float extraValue = Main.npc[index3].extraValue; + int index4 = Main.npc[index3].realLife; + if (index4 >= 0 && Main.npc[index4].active) + extraValue = Main.npc[index4].extraValue; + else + index4 = -1; + if ((double) extraValue < (double) num4) + { + Rectangle rectangle2 = new Rectangle((int) Main.npc[index3].position.X, (int) Main.npc[index3].position.Y, Main.npc[index3].width, Main.npc[index3].height); + if (rectangle1.Intersects(rectangle2)) + { + float num5 = (float) Main.rand.Next(50, 76) * 0.01f; + if (this.type == 71) + num5 += (float) Main.rand.Next(51) * 0.01f; + if (this.type == 72) + num5 += (float) Main.rand.Next(26) * 0.01f; + if ((double) num5 > 1.0) + num5 = 1f; + int num6 = (int) ((double) this.stack * (double) num5); + if (num6 < 1) + num6 = 1; + if (num6 > this.stack) + num6 = this.stack; + this.stack -= num6; + float number2 = (float) num6 * num3; + int number = index3; + if (index4 >= 0) + number = index4; + Main.npc[number].extraValue += number2; + if (Main.netMode == 0) + Main.npc[number].moneyPing(this.position); + else + NetMessage.SendData(92, number: number, number2: number2, number3: this.position.X, number4: this.position.Y); + if (this.stack <= 0) + { + this.SetDefaults(); + this.active = false; + } + NetMessage.SendData(21, number: i); + } + } + } + } + } + if (ItemID.Sets.ItemNoGravity[this.type]) + { + this.velocity.X *= 0.95f; + if ((double) this.velocity.X < 0.1 && (double) this.velocity.X > -0.1) + this.velocity.X = 0.0f; + this.velocity.Y *= 0.95f; + if ((double) this.velocity.Y < 0.1 && (double) this.velocity.Y > -0.1) + this.velocity.Y = 0.0f; + } else - index2 = -1; - if ((double) extraValue < (double) num2 && (double) extraValue + (double) num2 < 999000000.0) { - Rectangle rectangle2 = new Rectangle((int) Main.npc[index1].position.X, (int) Main.npc[index1].position.Y, Main.npc[index1].width, Main.npc[index1].height); - if (rectangle1.Intersects(rectangle2)) + this.velocity.Y += gravity; + if ((double) this.velocity.Y > (double) num1) + this.velocity.Y = num1; + this.velocity.X *= 0.95f; + if ((double) this.velocity.X < 0.1 && (double) this.velocity.X > -0.1) + this.velocity.X = 0.0f; + } + bool flag2 = Collision.LavaCollision(this.position, this.width, this.height); + if (flag2) + this.lavaWet = true; + int num7 = Collision.WetCollision(this.position, this.width, this.height) ? 1 : 0; + if (Collision.honey) + this.honeyWet = true; + if (num7 != 0) + { + if (!this.wet) { - float num3 = (float) Main.rand.Next(50, 76) * 0.01f; - if (this.type == 71) - num3 += (float) Main.rand.Next(51) * 0.01f; - if (this.type == 72) - num3 += (float) Main.rand.Next(26) * 0.01f; - if ((double) num3 > 1.0) - num3 = 1f; - int num4 = (int) ((double) this.stack * (double) num3); - if (num4 < 1) - num4 = 1; - if (num4 > this.stack) - num4 = this.stack; - this.stack -= num4; - int num5 = (int) ((double) num4 * (double) num1); - int number = index1; - if (index2 >= 0) - number = index2; - Main.npc[number].extraValue += num5; - if (Main.netMode == 0) - Main.npc[number].moneyPing(this.position); - else - NetMessage.SendData(92, number: number, number2: ((float) num5), number3: this.position.X, number4: this.position.Y); - if (this.stack <= 0) + if (this.wetCount == (byte) 0) { - this.SetDefaults(); - this.active = false; + this.wetCount = (byte) 20; + if (!flag2) + { + if (this.honeyWet) + { + for (int index5 = 0; index5 < 5; ++index5) + { + int index6 = Dust.NewDust(new Vector2(this.position.X - 6f, (float) ((double) this.position.Y + (double) (this.height / 2) - 8.0)), this.width + 12, 24, 152); + --Main.dust[index6].velocity.Y; + Main.dust[index6].velocity.X *= 2.5f; + Main.dust[index6].scale = 1.3f; + Main.dust[index6].alpha = 100; + Main.dust[index6].noGravity = true; + } + Main.PlaySound(19, (int) this.position.X, (int) this.position.Y); + } + else + { + for (int index7 = 0; index7 < 10; ++index7) + { + int index8 = Dust.NewDust(new Vector2(this.position.X - 6f, (float) ((double) this.position.Y + (double) (this.height / 2) - 8.0)), this.width + 12, 24, Dust.dustWater()); + Main.dust[index8].velocity.Y -= 4f; + Main.dust[index8].velocity.X *= 2.5f; + Main.dust[index8].scale *= 0.8f; + Main.dust[index8].alpha = 100; + Main.dust[index8].noGravity = true; + } + Main.PlaySound(19, (int) this.position.X, (int) this.position.Y); + } + } + else + { + for (int index9 = 0; index9 < 5; ++index9) + { + int index10 = Dust.NewDust(new Vector2(this.position.X - 6f, (float) ((double) this.position.Y + (double) (this.height / 2) - 8.0)), this.width + 12, 24, 35); + Main.dust[index10].velocity.Y -= 1.5f; + Main.dust[index10].velocity.X *= 2.5f; + Main.dust[index10].scale = 1.3f; + Main.dust[index10].alpha = 100; + Main.dust[index10].noGravity = true; + } + Main.PlaySound(19, (int) this.position.X, (int) this.position.Y); + } } - NetMessage.SendData(21, number: i); + this.wet = true; } } - } - } - } - - private void CombineWithNearbyItems(int myItemIndex) - { - if (!this.CanCombineStackInWorld() || this.stack >= this.maxStack) - return; - for (int number = myItemIndex + 1; number < 400; ++number) - { - Item obj = Main.item[number]; - if (obj.active && obj.type == this.type && obj.stack > 0 && obj.playerIndexTheItemIsReservedFor == this.playerIndexTheItemIsReservedFor) - { - double num1 = (double) Math.Abs((float) ((double) this.position.X + (double) (this.width / 2) - ((double) obj.position.X + (double) (obj.width / 2)))) + (double) Math.Abs((float) ((double) this.position.Y + (double) (this.height / 2) - ((double) obj.position.Y + (double) (obj.height / 2)))); - int num2 = 30; - if ((double) Item.numberOfNewItems > 40.0) - num2 *= 2; - if ((double) Item.numberOfNewItems > 80.0) - num2 *= 2; - if ((double) Item.numberOfNewItems > 120.0) - num2 *= 2; - if ((double) Item.numberOfNewItems > 160.0) - num2 *= 2; - if ((double) Item.numberOfNewItems > 200.0) - num2 *= 2; - if ((double) Item.numberOfNewItems > 240.0) - num2 *= 2; - double num3 = (double) num2; - if (num1 < num3) + else if (this.wet) { - this.position = (this.position + obj.position) / 2f; - this.velocity = (this.velocity + obj.velocity) / 2f; - int num4 = obj.stack; - if (num4 > this.maxStack - this.stack) - num4 = this.maxStack - this.stack; - obj.stack -= num4; - this.stack += num4; - if (obj.stack <= 0) + this.wet = false; + int wetCount = (int) this.wetCount; + } + if (!this.wet) + { + this.lavaWet = false; + this.honeyWet = false; + } + if (this.wetCount > (byte) 0) + --this.wetCount; + if (this.wet) + { + if (this.wet) { - obj.SetDefaults(); - obj.active = false; - } - if (Main.netMode != 0 && this.playerIndexTheItemIsReservedFor == Main.myPlayer) - { - NetMessage.SendData(21, number: myItemIndex); - NetMessage.SendData(21, number: number); + Vector2 velocity = this.velocity; + this.velocity = Collision.TileCollision(this.position, this.velocity, this.width, this.height); + if ((double) this.velocity.X != (double) velocity.X) + vector2.X = this.velocity.X; + if ((double) this.velocity.Y != (double) velocity.Y) + vector2.Y = this.velocity.Y; } } + else + this.velocity = Collision.TileCollision(this.position, this.velocity, this.width, this.height); + Vector4 vector4 = Collision.SlopeCollision(this.position, this.velocity, this.width, this.height, gravity); + this.position.X = vector4.X; + this.position.Y = vector4.Y; + this.velocity.X = vector4.Z; + this.velocity.Y = vector4.W; + Collision.StepConveyorBelt((Entity) this, 1f); + if (this.lavaWet) + { + if (this.type == 267) + { + if (Main.netMode != 1) + { + this.active = false; + this.type = 0; + this.stack = 0; + for (int number = 0; number < 200; ++number) + { + if (Main.npc[number].active && Main.npc[number].type == 22) + { + if (Main.netMode == 2) + NetMessage.SendData(28, number: number, number2: 9999f, number3: 10f, number4: ((float) -Main.npc[number].direction)); + Main.npc[number].StrikeNPCNoInteraction(9999, 10f, -Main.npc[number].direction); + NPC.SpawnWOF(this.position); + } + } + NetMessage.SendData(21, number: i); + } + } + else if (this.owner == Main.myPlayer && this.type != 312 && this.type != 318 && this.type != 173 && this.type != 174 && this.type != 175 && this.type != 2701 && this.rare == 0) + { + this.active = false; + this.type = 0; + this.stack = 0; + if (Main.netMode != 0) + NetMessage.SendData(21, number: i); + } + } + if (this.type == 3191) + { + float num8 = (float) Main.rand.Next(90, 111) * 0.01f * (float) (((double) Main.essScale + 0.5) / 2.0); + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.3f * num8, 0.1f * num8, 0.25f * num8); + } + else if (this.type == 520 || this.type == 3454) + { + float num9 = (float) Main.rand.Next(90, 111) * 0.01f * Main.essScale; + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.5f * num9, 0.1f * num9, 0.25f * num9); + } + else if (this.type == 521 || this.type == 3455) + { + float num10 = (float) Main.rand.Next(90, 111) * 0.01f * Main.essScale; + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.25f * num10, 0.1f * num10, 0.5f * num10); + } + else if (this.type == 547 || this.type == 3453) + { + float num11 = (float) Main.rand.Next(90, 111) * 0.01f * Main.essScale; + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.5f * num11, 0.3f * num11, 0.05f * num11); + } + else if (this.type == 548) + { + float num12 = (float) Main.rand.Next(90, 111) * 0.01f * Main.essScale; + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.1f * num12, 0.1f * num12, 0.6f * num12); + } + else if (this.type == 575) + { + float num13 = (float) Main.rand.Next(90, 111) * 0.01f * Main.essScale; + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.1f * num13, 0.3f * num13, 0.5f * num13); + } + else if (this.type == 549) + { + float num14 = (float) Main.rand.Next(90, 111) * 0.01f * Main.essScale; + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.1f * num14, 0.5f * num14, 0.2f * num14); + } + else if (this.type == 58 || this.type == 1734 || this.type == 1867) + { + float num15 = (float) Main.rand.Next(90, 111) * 0.01f * (Main.essScale * 0.5f); + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.5f * num15, 0.1f * num15, 0.1f * num15); + } + else if (this.type == 184 || this.type == 1735 || this.type == 1868) + { + float num16 = (float) Main.rand.Next(90, 111) * 0.01f * (Main.essScale * 0.5f); + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.1f * num16, 0.1f * num16, 0.5f * num16); + } + else if (this.type == 522) + { + float num17 = (float) Main.rand.Next(90, 111) * 0.01f * (Main.essScale * 0.2f); + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.5f * num17, 1f * num17, 0.1f * num17); + } + else if (this.type == 1332) + { + float num18 = (float) Main.rand.Next(90, 111) * 0.01f * (Main.essScale * 0.2f); + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 1f * num18, 1f * num18, 0.1f * num18); + } + else if (this.type == 3456) + Lighting.AddLight(this.Center, new Vector3(0.2f, 0.4f, 0.5f) * Main.essScale); + else if (this.type == 3457) + Lighting.AddLight(this.Center, new Vector3(0.4f, 0.2f, 0.5f) * Main.essScale); + else if (this.type == 3458) + Lighting.AddLight(this.Center, new Vector3(0.5f, 0.4f, 0.2f) * Main.essScale); + else if (this.type == 3459) + Lighting.AddLight(this.Center, new Vector3(0.2f, 0.2f, 0.5f) * Main.essScale); + if (this.type == 75 && Main.dayTime) + { + for (int index = 0; index < 10; ++index) + Dust.NewDust(this.position, this.width, this.height, 15, this.velocity.X, this.velocity.Y, 150, Scale: 1.2f); + for (int index = 0; index < 3; ++index) + Gore.NewGore(this.position, new Vector2(this.velocity.X, this.velocity.Y), Main.rand.Next(16, 18)); + this.active = false; + this.type = 0; + this.stack = 0; + if (Main.netMode == 2) + NetMessage.SendData(21, number: i); + } + if (this.type == 3822 && !DD2Event.Ongoing) + { + int num19 = Main.rand.Next(18, 24); + for (int index11 = 0; index11 < num19; ++index11) + { + int index12 = Dust.NewDust(this.Center, 0, 0, 61, Scale: 1.7f); + Main.dust[index12].velocity *= 8f; + --Main.dust[index12].velocity.Y; + Main.dust[index12].position = Vector2.Lerp(Main.dust[index12].position, this.Center, 0.5f); + Main.dust[index12].noGravity = true; + Main.dust[index12].noLight = true; + } + this.active = false; + this.type = 0; + this.stack = 0; + if (Main.netMode == 2) + NetMessage.SendData(21, number: i); + } } - } - } - - public bool CanCombineStackInWorld() - { - if (this.type == 75) - return false; - return this.createTile >= 0 || this.createWall > 0 || this.ammo > 0 && !this.notAmmo || this.consumable || this.type >= 205 && this.type <= 207 || this.type == 1128 || this.type == 530 || this.dye > (byte) 0 || this.paint > (byte) 0 || this.material; - } - - private void UpdateItem_VisualEffects() - { - if (this.type == 5043) - { - float num = (float) Main.rand.Next(90, 111) * 0.01f * (float) (((double) Main.essScale + 0.5) / 2.0); - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.25f * num, 0.25f * num, 0.25f * num); - } - else if (this.type == 3191) - { - float num = (float) Main.rand.Next(90, 111) * 0.01f * (float) (((double) Main.essScale + 0.5) / 2.0); - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.3f * num, 0.1f * num, 0.25f * num); - } - else if (this.type == 520 || this.type == 3454) - { - float num = (float) Main.rand.Next(90, 111) * 0.01f * Main.essScale; - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.5f * num, 0.1f * num, 0.25f * num); - } - else if (this.type == 521 || this.type == 3455) - { - float num = (float) Main.rand.Next(90, 111) * 0.01f * Main.essScale; - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.25f * num, 0.1f * num, 0.5f * num); - } - else if (this.type == 547 || this.type == 3453) - { - float num = (float) Main.rand.Next(90, 111) * 0.01f * Main.essScale; - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.5f * num, 0.3f * num, 0.05f * num); - } - else if (this.type == 548) - { - float num = (float) Main.rand.Next(90, 111) * 0.01f * Main.essScale; - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.1f * num, 0.1f * num, 0.6f * num); - } - else if (this.type == 575) - { - float num = (float) Main.rand.Next(90, 111) * 0.01f * Main.essScale; - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.1f * num, 0.3f * num, 0.5f * num); - } - else if (this.type == 549) - { - float num = (float) Main.rand.Next(90, 111) * 0.01f * Main.essScale; - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.1f * num, 0.5f * num, 0.2f * num); - } - else if (this.type == 58 || this.type == 1734 || this.type == 1867) - { - float num = (float) Main.rand.Next(90, 111) * 0.01f * (Main.essScale * 0.5f); - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.5f * num, 0.1f * num, 0.1f * num); - } - else if (this.type == 184 || this.type == 1735 || this.type == 1868 || this.type == 4143) - { - float num = (float) Main.rand.Next(90, 111) * 0.01f * (Main.essScale * 0.5f); - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.1f * num, 0.1f * num, 0.5f * num); - } - else if (this.type == 522) - { - float num = (float) Main.rand.Next(90, 111) * 0.01f * (Main.essScale * 0.2f); - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.5f * num, 1f * num, 0.1f * num); - } - else if (this.type == 1332) - { - float num = (float) Main.rand.Next(90, 111) * 0.01f * (Main.essScale * 0.2f); - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 1f * num, 1f * num, 0.1f * num); - } - else if (this.type == 3456) - Lighting.AddLight(this.Center, new Vector3(0.2f, 0.4f, 0.5f) * Main.essScale); - else if (this.type == 3457) - Lighting.AddLight(this.Center, new Vector3(0.4f, 0.2f, 0.5f) * Main.essScale); - else if (this.type == 3458) - Lighting.AddLight(this.Center, new Vector3(0.5f, 0.4f, 0.2f) * Main.essScale); - else if (this.type == 3459) - Lighting.AddLight(this.Center, new Vector3(0.2f, 0.2f, 0.5f) * Main.essScale); - else if (this.type == 501) - { - if (Main.rand.Next(6) != 0) - return; - int index = Dust.NewDust(this.position, this.width, this.height, 55, Alpha: 200, newColor: this.color); - Main.dust[index].velocity *= 0.3f; - Main.dust[index].scale *= 0.5f; - } - else if (this.type == 3822) - Lighting.AddLight(this.Center, 0.1f, 0.3f, 0.1f); - else if (this.type == 1970) - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.75f, 0.0f, 0.75f); - else if (this.type == 1972) - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.0f, 0.0f, 0.75f); - else if (this.type == 1971) - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.75f, 0.75f, 0.0f); - else if (this.type == 1973) - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.0f, 0.75f, 0.0f); - else if (this.type == 1974) - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.75f, 0.0f, 0.0f); - else if (this.type == 1975) - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.75f, 0.75f, 0.75f); - else if (this.type == 1976) - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.75f, 0.375f, 0.0f); - else if (this.type == 2679) - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.6f, 0.0f, 0.6f); - else if (this.type == 2687) - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.0f, 0.0f, 0.6f); - else if (this.type == 2689) - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.6f, 0.6f, 0.0f); - else if (this.type == 2683) - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.0f, 0.6f, 0.0f); - else if (this.type == 2685) - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.6f, 0.0f, 0.0f); - else if (this.type == 2681) - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.6f, 0.6f, 0.6f); - else if (this.type == 2677) - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.6f, 0.375f, 0.0f); - else if (this.type == 105) - { - if (this.wet) - return; - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 1f, 0.95f, 0.8f); - } - else if (this.type == 2701) - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.7f, 0.65f, 0.55f); - else if (this.createTile == 4) - { - int placeStyle = this.placeStyle; - if ((this.wet || !ItemID.Sets.Torches[this.type]) && !ItemID.Sets.WaterTorches[this.type]) - return; - Lighting.AddLight(this.Center, placeStyle); - } - else if (this.type == 3114) - { - if (this.wet) - return; - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 1f, 0.0f, 1f); - } - else if (this.type == 1245) - { - if (this.wet) - return; - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 1f, 0.5f, 0.0f); - } - else if (this.type == 433) - { - if (this.wet) - return; - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), (float) (0.5 * (double) Main.demonTorch + 1.0 * (1.0 - (double) Main.demonTorch)), 0.3f, (float) (1.0 * (double) Main.demonTorch + 0.5 * (1.0 - (double) Main.demonTorch))); - } - else if (this.type == 523) - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.85f, 1.2f, 0.7f); - else if (this.type == 974) - { - if (this.wet) - return; - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.75f, 0.85f, 1.4f); - } - else if (this.type == 1333) - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 1.25f, 1.25f, 0.7f); - else if (this.type == 4383) - { - if (this.wet) - return; - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 1.4f, 0.85f, 0.55f); - } - else if (this.type == 4384) - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.25f, 1.3f, 0.8f); - else if (this.type == 3045) - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), (float) Main.DiscoR / (float) byte.MaxValue, (float) Main.DiscoG / (float) byte.MaxValue, (float) Main.DiscoB / (float) byte.MaxValue); - else if (this.type == 3004) - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.95f, 0.65f, 1.3f); - else if (this.type == 2274) - { - float r = 0.75f; - float g = 1.35f; - float b = 1.5f; - if (this.wet) - return; - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), r, g, b); - } - else if (this.type >= 427 && this.type <= 432) - { - if (this.wet) - return; - float r = 0.0f; - float g = 0.0f; - float b = 0.0f; - int num = this.type - 426; - if (num == 1) + else + this.beingGrabbed = false; + if (this.type == 501) { - r = 0.1f; - g = 0.2f; - b = 1.1f; + if (Main.rand.Next(6) == 0) + { + int index = Dust.NewDust(this.position, this.width, this.height, 55, Alpha: 200, newColor: this.color); + Main.dust[index].velocity *= 0.3f; + Main.dust[index].scale *= 0.5f; + } } - if (num == 2) + else if (this.type == 3822) + Lighting.AddLight(this.Center, 0.1f, 0.3f, 0.1f); + else if (this.type == 1970) + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.75f, 0.0f, 0.75f); + else if (this.type == 1972) + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.0f, 0.0f, 0.75f); + else if (this.type == 1971) + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.75f, 0.75f, 0.0f); + else if (this.type == 1973) + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.0f, 0.75f, 0.0f); + else if (this.type == 1974) + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.75f, 0.0f, 0.0f); + else if (this.type == 1975) + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.75f, 0.75f, 0.75f); + else if (this.type == 1976) + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.75f, 0.375f, 0.0f); + else if (this.type == 2679) + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.6f, 0.0f, 0.6f); + else if (this.type == 2687) + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.0f, 0.0f, 0.6f); + else if (this.type == 2689) + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.6f, 0.6f, 0.0f); + else if (this.type == 2683) + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.0f, 0.6f, 0.0f); + else if (this.type == 2685) + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.6f, 0.0f, 0.0f); + else if (this.type == 2681) + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.6f, 0.6f, 0.6f); + else if (this.type == 2677) + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.6f, 0.375f, 0.0f); + else if (this.type == 8 || this.type == 105) { - r = 1f; - g = 0.1f; - b = 0.1f; + if (!this.wet) + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 1f, 0.95f, 0.8f); } - if (num == 3) + else if (this.type == 2701) + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.7f, 0.65f, 0.55f); + else if (this.type == 523) + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.85f, 1f, 0.7f); + else if (this.type == 974) { - r = 0.0f; - g = 1f; - b = 0.1f; + if (!this.wet) + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.7f, 0.85f, 1f); } - if (num == 4) + else if (this.type == 1333) + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 1.25f, 1.25f, 0.8f); + else if (this.type == 3045) + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), (float) Main.DiscoR / (float) byte.MaxValue, (float) Main.DiscoG / (float) byte.MaxValue, (float) Main.DiscoB / (float) byte.MaxValue); + else if (this.type == 3004) + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.95f, 0.65f, 1.3f); + else if (this.type == 2274) { - r = 0.9f; - g = 0.0f; - b = 0.9f; + float R = 0.75f; + float G = 1.35f; + float B = 1.5f; + if (!this.wet) + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), R, G, B); } - if (num == 5) + else if (this.type >= 427 && this.type <= 432) { - r = 1.3f; - g = 1.3f; - b = 1.3f; + if (!this.wet) + { + float R = 0.0f; + float G = 0.0f; + float B = 0.0f; + int num20 = this.type - 426; + if (num20 == 1) + { + R = 0.1f; + G = 0.2f; + B = 1.1f; + } + if (num20 == 2) + { + R = 1f; + G = 0.1f; + B = 0.1f; + } + if (num20 == 3) + { + R = 0.0f; + G = 1f; + B = 0.1f; + } + if (num20 == 4) + { + R = 0.9f; + G = 0.0f; + B = 0.9f; + } + if (num20 == 5) + { + R = 1.3f; + G = 1.3f; + B = 1.3f; + } + if (num20 == 6) + { + R = 0.9f; + G = 0.9f; + B = 0.0f; + } + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), R, G, B); + } } - if (num == 6) + else if (this.type == 2777 || this.type == 2778 || this.type == 2779 || this.type == 2780 || this.type == 2781 || this.type == 2760 || this.type == 2761 || this.type == 2762 || this.type == 3524) + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.4f, 0.16f, 0.36f); + else if (this.type == 2772 || this.type == 2773 || this.type == 2774 || this.type == 2775 || this.type == 2776 || this.type == 2757 || this.type == 2758 || this.type == 2759 || this.type == 3523) + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.0f, 0.36f, 0.4f); + else if (this.type == 2782 || this.type == 2783 || this.type == 2784 || this.type == 2785 || this.type == 2786 || this.type == 2763 || this.type == 2764 || this.type == 2765 || this.type == 3522) + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.5f, 0.25f, 0.05f); + else if (this.type == 3462 || this.type == 3463 || this.type == 3464 || this.type == 3465 || this.type == 3466 || this.type == 3381 || this.type == 3382 || this.type == 3383 || this.type == 3525) + Lighting.AddLight(this.Center, 0.3f, 0.3f, 0.2f); + else if (this.type == 41) { - r = 0.9f; - g = 0.9f; - b = 0.0f; + if (!this.wet) + Lighting.AddLight((int) (((double) this.position.X + (double) this.width) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 1f, 0.75f, 0.55f); + } + else if (this.type == 988) + { + if (!this.wet) + Lighting.AddLight((int) (((double) this.position.X + (double) this.width) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.35f, 0.65f, 1f); + } + else if (this.type == 282) + Lighting.AddLight((int) (((double) this.position.X + (double) this.width) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.7f, 1f, 0.8f); + else if (this.type == 286) + Lighting.AddLight((int) (((double) this.position.X + (double) this.width) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.7f, 0.8f, 1f); + else if (this.type == 3112) + Lighting.AddLight((int) (((double) this.position.X + (double) this.width) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 1f, 0.6f, 0.85f); + else if (this.type == 3002) + Lighting.AddLight((int) (((double) this.position.X + (double) this.width) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 1.05f, 0.95f, 0.55f); + else if (this.type == 331) + Lighting.AddLight((int) (((double) this.position.X + (double) this.width) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.55f, 0.75f, 0.6f); + else if (this.type == 183) + Lighting.AddLight((int) (((double) this.position.X + (double) this.width) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.15f, 0.45f, 0.9f); + else if (this.type == 75) + Lighting.AddLight((int) (((double) this.position.X + (double) this.width) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.8f, 0.7f, 0.1f); + if (this.type == 75) + { + if (Main.rand.Next(25) == 0) + Dust.NewDust(this.position, this.width, this.height, 58, this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 150, Scale: 1.2f); + if (Main.rand.Next(50) == 0) + Gore.NewGore(this.position, new Vector2(this.velocity.X * 0.2f, this.velocity.Y * 0.2f), Main.rand.Next(16, 18)); + } + if (this.spawnTime < 2147483646) + { + if (this.type == 58 || this.type == 184 || this.type == 1867 || this.type == 1868 || this.type == 1734 || this.type == 1735) + this.spawnTime += 4; + ++this.spawnTime; + } + if (Main.netMode == 2 && this.owner != Main.myPlayer) + { + ++this.release; + if (this.release >= 300) + { + this.release = 0; + NetMessage.SendData(39, this.owner, number: i); + } } - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), r, g, b); - } - else if (this.type == 2777 || this.type == 2778 || this.type == 2779 || this.type == 2780 || this.type == 2781 || this.type == 2760 || this.type == 2761 || this.type == 2762 || this.type == 3524) - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.4f, 0.16f, 0.36f); - else if (this.type == 2772 || this.type == 2773 || this.type == 2774 || this.type == 2775 || this.type == 2776 || this.type == 2757 || this.type == 2758 || this.type == 2759 || this.type == 3523) - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.0f, 0.36f, 0.4f); - else if (this.type == 2782 || this.type == 2783 || this.type == 2784 || this.type == 2785 || this.type == 2786 || this.type == 2763 || this.type == 2764 || this.type == 2765 || this.type == 3522) - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.5f, 0.25f, 0.05f); - else if (this.type == 3462 || this.type == 3463 || this.type == 3464 || this.type == 3465 || this.type == 3466 || this.type == 3381 || this.type == 3382 || this.type == 3383 || this.type == 3525) - Lighting.AddLight(this.Center, 0.3f, 0.3f, 0.2f); - else if (this.type == 41) - { if (this.wet) + this.position = this.position + vector2; + else + this.position = this.position + this.velocity; + if (this.noGrabDelay <= 0) return; - Lighting.AddLight((int) (((double) this.position.X + (double) this.width) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 1f, 0.75f, 0.55f); - } - else if (this.type == 988) - { - if (this.wet) - return; - Lighting.AddLight((int) (((double) this.position.X + (double) this.width) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.35f, 0.65f, 1f); - } - else if (this.type == 282) - Lighting.AddLight((int) (((double) this.position.X + (double) this.width) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.7f, 1f, 0.8f); - else if (this.type == 286) - Lighting.AddLight((int) (((double) this.position.X + (double) this.width) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.7f, 0.8f, 1f); - else if (this.type == 3112) - Lighting.AddLight((int) (((double) this.position.X + (double) this.width) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 1f, 0.6f, 0.85f); - else if (this.type == 4776) - Lighting.AddLight((int) (((double) this.position.X + (double) this.width) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.7f, 0.0f, 1f); - else if (this.type == 3002) - Lighting.AddLight((int) (((double) this.position.X + (double) this.width) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 1.05f, 0.95f, 0.55f); - else if (this.type == 331) - Lighting.AddLight((int) (((double) this.position.X + (double) this.width) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.55f, 0.75f, 0.6f); - else if (this.type == 183) - Lighting.AddLight((int) (((double) this.position.X + (double) this.width) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.15f, 0.45f, 0.9f); - else if (this.type == 75) - { - Lighting.AddLight((int) (((double) this.position.X + (double) this.width) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.8f, 0.7f, 0.1f); - if (this.timeSinceItemSpawned % 12 != 0) - return; - Dust dust = Dust.NewDustPerfect(this.Center + new Vector2(0.0f, (float) this.height * 0.2f) + Main.rand.NextVector2CircularEdge((float) this.width, (float) this.height * 0.6f) * (float) (0.300000011920929 + (double) Main.rand.NextFloat() * 0.5), 228, new Vector2?(new Vector2(0.0f, (float) (-(double) Main.rand.NextFloat() * 0.300000011920929 - 1.5))), (int) sbyte.MaxValue); - dust.scale = 0.5f; - dust.fadeIn = 1.1f; - dust.noGravity = true; - dust.noLight = true; - } - else - { - if ((this.type < 3318 || this.type > 3332) && this.type != 3860 && this.type != 3862 && this.type != 3861 && this.type != 4782 && this.type != 4957) - return; - Lighting.AddLight((int) (((double) this.position.X + (double) this.width) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 0.4f, 0.4f, 0.4f); - if (this.timeSinceItemSpawned % 12 != 0) - return; - Dust dust = Dust.NewDustPerfect(this.Center + new Vector2(0.0f, (float) this.height * -0.1f) + Main.rand.NextVector2CircularEdge((float) this.width * 0.6f, (float) this.height * 0.6f) * (float) (0.300000011920929 + (double) Main.rand.NextFloat() * 0.5), 279, new Vector2?(new Vector2(0.0f, (float) (-(double) Main.rand.NextFloat() * 0.300000011920929 - 1.5))), (int) sbyte.MaxValue); - dust.scale = 0.5f; - dust.fadeIn = 1.1f; - dust.noGravity = true; - dust.noLight = true; - dust.alpha = 0; - } - } - - public static Rectangle GetDrawHitbox(int type, Player user) - { - Main.instance.LoadItem(type); - if (ItemID.Sets.IsFood[type]) - return TextureAssets.Item[type].Frame(verticalFrames: 3, frameY: 1); - switch (type) - { - case 75: - return TextureAssets.Item[type].Frame(verticalFrames: 8); - case 520: - case 521: - case 547: - case 548: - case 549: - case 575: - case 3453: - case 3454: - case 3455: - case 3580: - case 3581: - case 4068: - case 4069: - case 4070: - return TextureAssets.Item[type].Frame(verticalFrames: 4); - default: - return TextureAssets.Item[type].Frame(); + --this.noGrabDelay; } } @@ -45330,6 +38039,8 @@ label_92: return 0; if (Main.rand == null) Main.rand = new UnifiedRandom(); + int index1 = 400; + Main.item[400] = new Item(); if (Main.halloween) { if (Type == 58) @@ -45344,136 +38055,109 @@ label_92: if (Type == 184) Type = 1868; } - if (Type > 0 && Item.cachedItemSpawnsByType[Type] != -1) + if (Item.itemCaches[Type] != -1) { - Item.cachedItemSpawnsByType[Type] += Stack; + Item.itemCaches[Type] += Stack; return 400; } - Main.item[400] = new Item(); - int index = 400; if (Main.netMode != 1) - index = Item.PickAnItemSlotToSpawnItemOn(reverseLookup, index); - Main.timeItemSlotCannotBeReusedFor[index] = 0; - Main.item[index] = new Item(); - Item obj1 = Main.item[index]; - obj1.SetDefaults(Type); - obj1.Prefix(pfix); - obj1.stack = Stack; - obj1.position.X = (float) (X + Width / 2 - obj1.width / 2); - obj1.position.Y = (float) (Y + Height / 2 - obj1.height / 2); - obj1.wet = Collision.WetCollision(obj1.position, obj1.width, obj1.height); - obj1.velocity.X = (float) Main.rand.Next(-30, 31) * 0.1f; - obj1.velocity.Y = (float) Main.rand.Next(-40, -15) * 0.1f; - if (Type == 859 || Type == 4743) { - Item obj2 = obj1; - obj2.velocity = obj2.velocity * 0.0f; - } - if (Type == 520 || Type == 521 || obj1.type >= 0 && ItemID.Sets.NebulaPickup[obj1.type]) - { - obj1.velocity.X = (float) Main.rand.Next(-30, 31) * 0.1f; - obj1.velocity.Y = (float) Main.rand.Next(-30, 31) * 0.1f; - } - obj1.active = true; - obj1.timeSinceItemSpawned = ItemID.Sets.NewItemSpawnPriority[obj1.type]; - ++Item.numberOfNewItems; - if (ItemSlot.Options.HighlightNewItems && obj1.type >= 0 && !ItemID.Sets.NeverAppearsAsNewInInventory[obj1.type]) - obj1.newAndShiny = true; - if (Main.netMode == 2 && !noBroadcast) - NetMessage.SendData(21, number: index, number2: ((float) noGrabDelay.ToInt())); - else if (Main.netMode == 0) - obj1.playerIndexTheItemIsReservedFor = Main.myPlayer; - return index; - } - - private static int PickAnItemSlotToSpawnItemOn(bool reverseLookup, int nextItem) - { - int num1 = 0; - int num2 = 400; - int num3 = 1; - if (reverseLookup) - { - num1 = 399; - num2 = -1; - num3 = -1; - } - bool flag = false; - for (int index = num1; index != num2; index += num3) - { - if (!Main.item[index].active && Main.timeItemSlotCannotBeReusedFor[index] == 0) + if (reverseLookup) { - nextItem = index; - flag = true; - break; - } - } - if (!flag) - { - int num4 = 0; - for (int index = 0; index < 400; ++index) - { - if (Main.timeItemSlotCannotBeReusedFor[index] == 0 && !Main.item[index].instanced && Main.item[index].timeSinceItemSpawned > num4) + for (int index2 = 399; index2 >= 0; --index2) { - num4 = Main.item[index].timeSinceItemSpawned; - nextItem = index; - flag = true; + if (!Main.item[index2].active && Main.itemLockoutTime[index2] == 0) + { + index1 = index2; + break; + } } } - if (!flag) + else { - for (int index = 0; index < 400; ++index) + for (int index3 = 0; index3 < 400; ++index3) { - if (Main.item[index].timeSinceItemSpawned - Main.timeItemSlotCannotBeReusedFor[index] > num4) + if (!Main.item[index3].active && Main.itemLockoutTime[index3] == 0) { - num4 = Main.item[index].timeSinceItemSpawned - Main.timeItemSlotCannotBeReusedFor[index]; - nextItem = index; + index1 = index3; + break; } } } } - return nextItem; + if (index1 == 400 && Main.netMode != 1) + { + int num = 0; + for (int index4 = 0; index4 < 400; ++index4) + { + if (Main.item[index4].spawnTime - Main.itemLockoutTime[index4] > num) + { + num = Main.item[index4].spawnTime - Main.itemLockoutTime[index4]; + index1 = index4; + } + } + } + Main.itemLockoutTime[index1] = 0; + Main.item[index1] = new Item(); + Main.item[index1].SetDefaults(Type); + Main.item[index1].Prefix(pfix); + Main.item[index1].position.X = (float) (X + Width / 2 - Main.item[index1].width / 2); + Main.item[index1].position.Y = (float) (Y + Height / 2 - Main.item[index1].height / 2); + Main.item[index1].wet = Collision.WetCollision(Main.item[index1].position, Main.item[index1].width, Main.item[index1].height); + Main.item[index1].velocity.X = (float) Main.rand.Next(-30, 31) * 0.1f; + Main.item[index1].velocity.Y = (float) Main.rand.Next(-40, -15) * 0.1f; + if (Type == 859) + { + Item obj = Main.item[index1]; + obj.velocity = obj.velocity * 0.0f; + } + if (Type == 520 || Type == 521 || Main.item[index1].type >= 0 && ItemID.Sets.NebulaPickup[Main.item[index1].type]) + { + Main.item[index1].velocity.X = (float) Main.rand.Next(-30, 31) * 0.1f; + Main.item[index1].velocity.Y = (float) Main.rand.Next(-30, 31) * 0.1f; + } + Main.item[index1].active = true; + Main.item[index1].spawnTime = 0; + Main.item[index1].stack = Stack; + if (ItemSlot.Options.HighlightNewItems && Main.item[index1].type >= 0 && !ItemID.Sets.NeverShiny[Main.item[index1].type]) + Main.item[index1].newAndShiny = true; + if (Main.netMode == 2 && !noBroadcast) + { + int num = 0; + if (noGrabDelay) + num = 1; + NetMessage.SendData(21, number: index1, number2: ((float) num)); + Main.item[index1].FindOwner(index1); + } + else if (Main.netMode == 0) + Main.item[index1].owner = Main.myPlayer; + return index1; } public void FindOwner(int whoAmI) { if (this.keepTime > 0) return; - int itemIsReservedFor = this.playerIndexTheItemIsReservedFor; - this.playerIndexTheItemIsReservedFor = (int) byte.MaxValue; - bool flag = true; - if (this.type == 267 && this.ownIgnore != -1) - flag = false; - if (flag) + int owner = this.owner; + this.owner = (int) byte.MaxValue; + float num1 = 999999f; + for (int index = 0; index < (int) byte.MaxValue; ++index) { - float num1 = (float) NPC.sWidth; - for (int index = 0; index < (int) byte.MaxValue; ++index) + if (this.ownIgnore != index && Main.player[index].active && Main.player[index].ItemSpace(Main.item[whoAmI])) { - if (this.ownIgnore != index) + float num2 = Math.Abs(Main.player[index].position.X + (float) (Main.player[index].width / 2) - this.position.X - (float) (this.width / 2)) + Math.Abs(Main.player[index].position.Y + (float) (Main.player[index].height / 2) - this.position.Y - (float) this.height); + if (Main.player[index].manaMagnet && (this.type == 184 || this.type == 1735 || this.type == 1868)) + num2 -= (float) Item.manaGrabRange; + if (Main.player[index].lifeMagnet && (this.type == 58 || this.type == 1734 || this.type == 1867)) + num2 -= (float) Item.lifeGrabRange; + if ((double) num2 < (double) NPC.sWidth && (double) num2 < (double) num1) { - Player player = Main.player[index]; - if (player.active) - { - Player.ItemSpaceStatus status = player.ItemSpace(Main.item[whoAmI]); - if (player.CanPullItem(Main.item[whoAmI], status)) - { - float num2 = Math.Abs(player.position.X + (float) (player.width / 2) - this.position.X - (float) (this.width / 2)) + Math.Abs(player.position.Y + (float) (player.height / 2) - this.position.Y - (float) this.height); - if (player.manaMagnet && (this.type == 184 || this.type == 1735 || this.type == 1868)) - num2 -= (float) Item.manaGrabRange; - if (player.lifeMagnet && (this.type == 58 || this.type == 1734 || this.type == 1867)) - num2 -= (float) Item.lifeGrabRange; - if (this.type == 4143) - num2 -= (float) Item.manaGrabRange; - if ((double) num1 > (double) num2) - { - num1 = num2; - this.playerIndexTheItemIsReservedFor = index; - } - } - } + num1 = num2; + this.owner = index; } } } - if (this.playerIndexTheItemIsReservedFor == itemIsReservedFor || (itemIsReservedFor != Main.myPlayer || Main.netMode != 1) && (itemIsReservedFor != (int) byte.MaxValue || Main.netMode != 2) && (itemIsReservedFor == (int) byte.MaxValue || Main.player[itemIsReservedFor].active)) + if (this.owner == owner || (owner != Main.myPlayer || Main.netMode != 1) && (owner != (int) byte.MaxValue || Main.netMode != 2) && (owner == (int) byte.MaxValue || Main.player[owner].active)) return; NetMessage.SendData(21, number: whoAmI); if (!this.active) @@ -45500,9 +38184,6 @@ label_92: this.type = 0; this.stack = 0; this.netID = 0; - this.dye = (byte) 0; - this.shoot = 0; - this.mountType = -1; } public void OnPurchase(Item item) @@ -45514,54 +38195,5 @@ label_92: } public int GetStoreValue() => this.shopCustomPrice.HasValue ? this.shopCustomPrice.Value : this.value; - - public void Serialize(BinaryWriter writer, ItemSerializationContext context) - { - if (context != ItemSerializationContext.SavingAndLoading) - return; - writer.Write(this.netID); - writer.Write(this.stack); - writer.Write(this.prefix); - } - - public void DeserializeFrom(BinaryReader reader, ItemSerializationContext context) - { - if (context == ItemSerializationContext.SavingAndLoading) - { - this.netDefaults(reader.ReadInt32()); - this.stack = reader.ReadInt32(); - this.Prefix((int) reader.ReadByte()); - } - if (this.type < 5045) - return; - this.TurnToAir(); - } - - public bool IsCurrency => this.type >= 71 && this.type <= 74 || CustomCurrencyManager.IsCustomCurrency(this); - - public void Refresh() - { - bool favorited = this.favorited; - int stack = this.stack; - int netId = this.netID; - int prefix = (int) this.prefix; - this.netDefaults(netId); - this.Prefix(prefix); - this.stack = stack; - this.favorited = favorited; - } - - public bool CanBeQuickUsed - { - get - { - if (this.IsAir) - return false; - bool? nullable = ItemID.Sets.CanBeQuickusedOnGamepad[this.type]; - if (nullable.HasValue) - return nullable.Value; - return this.healLife > 0 || this.healMana > 0 || this.buffType > 0 && this.buffTime > 0; - } - } } } diff --git a/ItemSerializationContext.cs b/ItemSerializationContext.cs deleted file mode 100644 index de20bdc..0000000 --- a/ItemSerializationContext.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.ItemSerializationContext -// 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 -{ - public enum ItemSerializationContext - { - SavingAndLoading, - Syncing, - } -} diff --git a/ItemText.cs b/ItemText.cs new file mode 100644 index 0000000..a70df62 --- /dev/null +++ b/ItemText.cs @@ -0,0 +1,395 @@ +// Decompiled with JetBrains decompiler +// Type: Terraria.ItemText +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 +// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe + +using Microsoft.Xna.Framework; +using Terraria.Localization; + +namespace Terraria +{ + public class ItemText + { + public Vector2 position; + public Vector2 velocity; + public float alpha; + public int alphaDir = 1; + public string name; + public int stack; + public float scale = 1f; + public float rotation; + public Color color; + public bool active; + public int lifeTime; + public static int activeTime = 60; + public static int numActive; + public bool NoStack; + public bool coinText; + public int coinValue; + public bool expert; + + public static float TargetScale => Main.UIScale / Main.GameViewMatrix.Zoom.X; + + public static void NewText(Item newItem, int stack, bool noStack = false, bool longText = false) + { + bool flag = newItem.type >= 71 && newItem.type <= 74; + if (!Main.showItemText || newItem.Name == null || !newItem.active || Main.netMode == 2) + return; + for (int index = 0; index < 20; ++index) + { + if (Main.itemText[index].active && (Main.itemText[index].name == newItem.AffixName() || flag && Main.itemText[index].coinText) && !Main.itemText[index].NoStack && !noStack) + { + string str1 = newItem.Name + " (" + (object) (Main.itemText[index].stack + stack) + ")"; + string str2 = newItem.Name; + if (Main.itemText[index].stack > 1) + str2 = str2 + " (" + (object) Main.itemText[index].stack + ")"; + Main.fontMouseText.MeasureString(str2); + Vector2 vector2 = Main.fontMouseText.MeasureString(str1); + if (Main.itemText[index].lifeTime < 0) + Main.itemText[index].scale = 1f; + if (Main.itemText[index].lifeTime < 60) + Main.itemText[index].lifeTime = 60; + if (flag && Main.itemText[index].coinText) + { + int num = 0; + if (newItem.type == 71) + num += newItem.stack; + else if (newItem.type == 72) + num += 100 * newItem.stack; + else if (newItem.type == 73) + num += 10000 * newItem.stack; + else if (newItem.type == 74) + num += 1000000 * newItem.stack; + Main.itemText[index].coinValue += num; + string name = ItemText.ValueToName(Main.itemText[index].coinValue); + vector2 = Main.fontMouseText.MeasureString(name); + Main.itemText[index].name = name; + if (Main.itemText[index].coinValue >= 1000000) + { + if (Main.itemText[index].lifeTime < 300) + Main.itemText[index].lifeTime = 300; + Main.itemText[index].color = new Color(220, 220, 198); + } + else if (Main.itemText[index].coinValue >= 10000) + { + if (Main.itemText[index].lifeTime < 240) + Main.itemText[index].lifeTime = 240; + Main.itemText[index].color = new Color(224, 201, 92); + } + else if (Main.itemText[index].coinValue >= 100) + { + if (Main.itemText[index].lifeTime < 180) + Main.itemText[index].lifeTime = 180; + Main.itemText[index].color = new Color(181, 192, 193); + } + else if (Main.itemText[index].coinValue >= 1) + { + if (Main.itemText[index].lifeTime < 120) + Main.itemText[index].lifeTime = 120; + Main.itemText[index].color = new Color(246, 138, 96); + } + } + Main.itemText[index].stack += stack; + Main.itemText[index].scale = 0.0f; + Main.itemText[index].rotation = 0.0f; + Main.itemText[index].position.X = (float) ((double) newItem.position.X + (double) newItem.width * 0.5 - (double) vector2.X * 0.5); + Main.itemText[index].position.Y = (float) ((double) newItem.position.Y + (double) newItem.height * 0.25 - (double) vector2.Y * 0.5); + Main.itemText[index].velocity.Y = -7f; + if (!Main.itemText[index].coinText) + return; + Main.itemText[index].stack = 1; + return; + } + } + int index1 = -1; + for (int index2 = 0; index2 < 20; ++index2) + { + if (!Main.itemText[index2].active) + { + index1 = index2; + break; + } + } + if (index1 == -1) + { + double num = (double) Main.bottomWorld; + for (int index3 = 0; index3 < 20; ++index3) + { + if (num > (double) Main.itemText[index3].position.Y) + { + index1 = index3; + num = (double) Main.itemText[index3].position.Y; + } + } + } + if (index1 < 0) + return; + string str = newItem.AffixName(); + if (stack > 1) + str = str + " (" + (object) stack + ")"; + Vector2 vector2_1 = Main.fontMouseText.MeasureString(str); + Main.itemText[index1].alpha = 1f; + Main.itemText[index1].alphaDir = -1; + Main.itemText[index1].active = true; + Main.itemText[index1].scale = 0.0f; + Main.itemText[index1].NoStack = noStack; + Main.itemText[index1].rotation = 0.0f; + Main.itemText[index1].position.X = (float) ((double) newItem.position.X + (double) newItem.width * 0.5 - (double) vector2_1.X * 0.5); + Main.itemText[index1].position.Y = (float) ((double) newItem.position.Y + (double) newItem.height * 0.25 - (double) vector2_1.Y * 0.5); + Main.itemText[index1].color = Color.White; + if (newItem.rare == 1) + Main.itemText[index1].color = new Color(150, 150, (int) byte.MaxValue); + else if (newItem.rare == 2) + Main.itemText[index1].color = new Color(150, (int) byte.MaxValue, 150); + else if (newItem.rare == 3) + Main.itemText[index1].color = new Color((int) byte.MaxValue, 200, 150); + else if (newItem.rare == 4) + Main.itemText[index1].color = new Color((int) byte.MaxValue, 150, 150); + else if (newItem.rare == 5) + Main.itemText[index1].color = new Color((int) byte.MaxValue, 150, (int) byte.MaxValue); + else if (newItem.rare == -11) + Main.itemText[index1].color = new Color((int) byte.MaxValue, 175, 0); + else if (newItem.rare == -1) + Main.itemText[index1].color = new Color(130, 130, 130); + else if (newItem.rare == 6) + Main.itemText[index1].color = new Color(210, 160, (int) byte.MaxValue); + else if (newItem.rare == 7) + Main.itemText[index1].color = new Color(150, (int) byte.MaxValue, 10); + else if (newItem.rare == 8) + Main.itemText[index1].color = new Color((int) byte.MaxValue, (int) byte.MaxValue, 10); + else if (newItem.rare == 9) + Main.itemText[index1].color = new Color(5, 200, (int) byte.MaxValue); + else if (newItem.rare == 10) + Main.itemText[index1].color = new Color((int) byte.MaxValue, 40, 100); + else if (newItem.rare >= 11) + Main.itemText[index1].color = new Color(180, 40, (int) byte.MaxValue); + Main.itemText[index1].expert = newItem.expert; + Main.itemText[index1].name = newItem.AffixName(); + Main.itemText[index1].stack = stack; + Main.itemText[index1].velocity.Y = -7f; + Main.itemText[index1].lifeTime = 60; + if (longText) + Main.itemText[index1].lifeTime *= 5; + Main.itemText[index1].coinValue = 0; + Main.itemText[index1].coinText = newItem.type >= 71 && newItem.type <= 74; + if (!Main.itemText[index1].coinText) + return; + if (newItem.type == 71) + Main.itemText[index1].coinValue += Main.itemText[index1].stack; + else if (newItem.type == 72) + Main.itemText[index1].coinValue += 100 * Main.itemText[index1].stack; + else if (newItem.type == 73) + Main.itemText[index1].coinValue += 10000 * Main.itemText[index1].stack; + else if (newItem.type == 74) + Main.itemText[index1].coinValue += 1000000 * Main.itemText[index1].stack; + Main.itemText[index1].ValueToName(); + Main.itemText[index1].stack = 1; + int index4 = index1; + if (Main.itemText[index4].coinValue >= 1000000) + { + if (Main.itemText[index4].lifeTime < 300) + Main.itemText[index4].lifeTime = 300; + Main.itemText[index4].color = new Color(220, 220, 198); + } + else if (Main.itemText[index4].coinValue >= 10000) + { + if (Main.itemText[index4].lifeTime < 240) + Main.itemText[index4].lifeTime = 240; + Main.itemText[index4].color = new Color(224, 201, 92); + } + else if (Main.itemText[index4].coinValue >= 100) + { + if (Main.itemText[index4].lifeTime < 180) + Main.itemText[index4].lifeTime = 180; + Main.itemText[index4].color = new Color(181, 192, 193); + } + else + { + if (Main.itemText[index4].coinValue < 1) + return; + if (Main.itemText[index4].lifeTime < 120) + Main.itemText[index4].lifeTime = 120; + Main.itemText[index4].color = new Color(246, 138, 96); + } + } + + private static string ValueToName(int coinValue) + { + int num1 = 0; + int num2 = 0; + int num3 = 0; + int num4 = 0; + int num5 = coinValue; + while (num5 > 0) + { + if (num5 >= 1000000) + { + num5 -= 1000000; + ++num1; + } + else if (num5 >= 10000) + { + num5 -= 10000; + ++num2; + } + else if (num5 >= 100) + { + num5 -= 100; + ++num3; + } + else if (num5 >= 1) + { + --num5; + ++num4; + } + } + string str = ""; + if (num1 > 0) + str = str + (object) num1 + string.Format(" {0} ", (object) Language.GetTextValue("Currency.Platinum")); + if (num2 > 0) + str = str + (object) num2 + string.Format(" {0} ", (object) Language.GetTextValue("Currency.Gold")); + if (num3 > 0) + str = str + (object) num3 + string.Format(" {0} ", (object) Language.GetTextValue("Currency.Silver")); + if (num4 > 0) + str = str + (object) num4 + string.Format(" {0} ", (object) Language.GetTextValue("Currency.Copper")); + if (str.Length > 1) + str = str.Substring(0, str.Length - 1); + return str; + } + + private void ValueToName() + { + int num1 = 0; + int num2 = 0; + int num3 = 0; + int num4 = 0; + int coinValue = this.coinValue; + while (coinValue > 0) + { + if (coinValue >= 1000000) + { + coinValue -= 1000000; + ++num1; + } + else if (coinValue >= 10000) + { + coinValue -= 10000; + ++num2; + } + else if (coinValue >= 100) + { + coinValue -= 100; + ++num3; + } + else if (coinValue >= 1) + { + --coinValue; + ++num4; + } + } + this.name = ""; + if (num1 > 0) + this.name = this.name + (object) num1 + string.Format(" {0} ", (object) Language.GetTextValue("Currency.Platinum")); + if (num2 > 0) + this.name = this.name + (object) num2 + string.Format(" {0} ", (object) Language.GetTextValue("Currency.Gold")); + if (num3 > 0) + this.name = this.name + (object) num3 + string.Format(" {0} ", (object) Language.GetTextValue("Currency.Silver")); + if (num4 > 0) + this.name = this.name + (object) num4 + string.Format(" {0} ", (object) Language.GetTextValue("Currency.Copper")); + if (this.name.Length <= 1) + return; + this.name = this.name.Substring(0, this.name.Length - 1); + } + + public void Update(int whoAmI) + { + if (!this.active) + return; + float targetScale = ItemText.TargetScale; + this.alpha += (float) this.alphaDir * 0.01f; + if ((double) this.alpha <= 0.7) + { + this.alpha = 0.7f; + this.alphaDir = 1; + } + if ((double) this.alpha >= 1.0) + { + this.alpha = 1f; + this.alphaDir = -1; + } + if (this.expert && this.expert) + this.color = new Color((int) (byte) Main.DiscoR, (int) (byte) Main.DiscoG, (int) (byte) Main.DiscoB, (int) Main.mouseTextColor); + bool flag = false; + string str1 = this.name; + if (this.stack > 1) + str1 = str1 + " (" + (object) this.stack + ")"; + Vector2 vector2_1 = Main.fontMouseText.MeasureString(str1) * this.scale; + vector2_1.Y *= 0.8f; + Rectangle rectangle1 = new Rectangle((int) ((double) this.position.X - (double) vector2_1.X / 2.0), (int) ((double) this.position.Y - (double) vector2_1.Y / 2.0), (int) vector2_1.X, (int) vector2_1.Y); + for (int index = 0; index < 20; ++index) + { + if (Main.itemText[index].active && index != whoAmI) + { + string str2 = Main.itemText[index].name; + if (Main.itemText[index].stack > 1) + str2 = str2 + " (" + (object) Main.itemText[index].stack + ")"; + Vector2 vector2_2 = Main.fontMouseText.MeasureString(str2) * Main.itemText[index].scale; + vector2_2.Y *= 0.8f; + Rectangle rectangle2 = new Rectangle((int) ((double) Main.itemText[index].position.X - (double) vector2_2.X / 2.0), (int) ((double) Main.itemText[index].position.Y - (double) vector2_2.Y / 2.0), (int) vector2_2.X, (int) vector2_2.Y); + if (rectangle1.Intersects(rectangle2) && ((double) this.position.Y < (double) Main.itemText[index].position.Y || (double) this.position.Y == (double) Main.itemText[index].position.Y && whoAmI < index)) + { + flag = true; + int num = ItemText.numActive; + if (num > 3) + num = 3; + Main.itemText[index].lifeTime = ItemText.activeTime + 15 * num; + this.lifeTime = ItemText.activeTime + 15 * num; + } + } + } + if (!flag) + { + this.velocity.Y *= 0.86f; + if ((double) this.scale == (double) targetScale) + this.velocity.Y *= 0.4f; + } + else if ((double) this.velocity.Y > -6.0) + this.velocity.Y -= 0.2f; + else + this.velocity.Y *= 0.86f; + this.velocity.X *= 0.93f; + this.position += this.velocity; + --this.lifeTime; + if (this.lifeTime <= 0) + { + this.scale -= 0.03f * targetScale; + if ((double) this.scale < 0.1 * (double) targetScale) + this.active = false; + this.lifeTime = 0; + } + else + { + if ((double) this.scale < (double) targetScale) + this.scale += 0.1f * targetScale; + if ((double) this.scale <= (double) targetScale) + return; + this.scale = targetScale; + } + } + + public static void UpdateItemText() + { + int num = 0; + for (int whoAmI = 0; whoAmI < 20; ++whoAmI) + { + if (Main.itemText[whoAmI].active) + { + ++num; + Main.itemText[whoAmI].Update(whoAmI); + } + } + ItemText.numActive = num; + } + } +} diff --git a/Lang.cs b/Lang.cs index 0635b1f..41e108f 100644 --- a/Lang.cs +++ b/Lang.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Lang -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; @@ -9,7 +9,6 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; using Terraria.GameContent.Events; -using Terraria.GameContent.UI; using Terraria.GameInput; using Terraria.ID; using Terraria.Localization; @@ -23,31 +22,30 @@ namespace Terraria [Obsolete("Lang arrays have been replaced with the new Language.GetText system.")] public static LocalizedText[] menu = new LocalizedText[253]; [Obsolete("Lang arrays have been replaced with the new Language.GetText system.")] - public static LocalizedText[] gen = new LocalizedText[91]; + public static LocalizedText[] gen = new LocalizedText[82]; [Obsolete("Lang arrays have been replaced with the new Language.GetText system.")] public static LocalizedText[] misc = new LocalizedText[201]; [Obsolete("Lang arrays have been replaced with the new Language.GetText system.")] public static LocalizedText[] inter = new LocalizedText[129]; [Obsolete("Lang arrays have been replaced with the new Language.GetText system.")] - public static LocalizedText[] tip = new LocalizedText[61]; + public static LocalizedText[] tip = new LocalizedText[60]; [Obsolete("Lang arrays have been replaced with the new Language.GetText system.")] public static LocalizedText[] mp = new LocalizedText[23]; [Obsolete("Lang arrays have been replaced with the new Language.GetText system.")] public static LocalizedText[] chestType = new LocalizedText[52]; [Obsolete("Lang arrays have been replaced with the new Language.GetText system.")] - public static LocalizedText[] dresserType = new LocalizedText[40]; + public static LocalizedText[] dresserType = new LocalizedText[32]; [Obsolete("Lang arrays have been replaced with the new Language.GetText system.")] - public static LocalizedText[] chestType2 = new LocalizedText[14]; - public static LocalizedText[] prefix = new LocalizedText[85]; + public static LocalizedText[] chestType2 = new LocalizedText[2]; + public static LocalizedText[] prefix = new LocalizedText[84]; public static LocalizedText[] _mapLegendCache; - private static LocalizedText[] _itemNameCache = new LocalizedText[5045]; - private static LocalizedText[] _projectileNameCache = new LocalizedText[950]; - private static LocalizedText[] _npcNameCache = new LocalizedText[663]; + private static LocalizedText[] _itemNameCache = new LocalizedText[3930]; + private static LocalizedText[] _projectileNameCache = new LocalizedText[714]; + private static LocalizedText[] _npcNameCache = new LocalizedText[580]; private static LocalizedText[] _negativeNpcNameCache = new LocalizedText[65]; - private static LocalizedText[] _buffNameCache = new LocalizedText[323]; - private static LocalizedText[] _buffDescriptionCache = new LocalizedText[323]; - private static ItemTooltip[] _itemTooltipCache = new ItemTooltip[5045]; - private static LocalizedText[] _emojiNameCache = new LocalizedText[145]; + private static LocalizedText[] _buffNameCache = new LocalizedText[206]; + private static LocalizedText[] _buffDescriptionCache = new LocalizedText[206]; + private static ItemTooltip[] _itemTooltipCache = new ItemTooltip[3930]; public static string GetMapObjectName(int id) => Lang._mapLegendCache != null ? Lang._mapLegendCache[id].Value : string.Empty; @@ -75,32 +73,14 @@ namespace Terraria TravelingMerchant = NPC.GetFirstNPCNameOrNull(368), Angler = NPC.GetFirstNPCNameOrNull(369), Bartender = NPC.GetFirstNPCNameOrNull(550), - WorldName = Main.worldName, + WorldName = Main.ActiveWorldFileData.Name, Day = Main.dayTime, BloodMoon = Main.bloodMoon, - Eclipse = Main.eclipse, MoonLordDefeated = NPC.downedMoonlord, HardMode = Main.hardMode, Homeless = (npc != null && npc.homeless), InventoryKey = Main.cInv, - PlayerName = Main.player[Main.myPlayer].name, - GolfGuy = NPC.GetFirstNPCNameOrNull(588), - TaxCollector = NPC.GetFirstNPCNameOrNull(441), - Rain = Main.raining, - Graveyard = Main.LocalPlayer.ZoneGraveyard, - AnglerCompletedQuestsCount = Main.LocalPlayer.anglerQuestsFinished, - InputTriggerUI_BuildFromInventory = PlayerInput.GenerateInputTag_ForCurrentGamemode(false, "QuickMount"), - InputTriggerUI_SellItem = PlayerInput.GenerateInputTag_ForCurrentGamemode(false, "SmartSelect"), - InputTriggerUI_Trash = PlayerInput.GenerateInputTag_ForCurrentGamemode_WithHacks(false, "SmartSelect"), - InputTriggerUI_FavoriteItem = PlayerInput.GenerateInputTag_ForCurrentGamemode_WithHacks(false, "SmartCursor"), - InputTrigger_QuickEquip = PlayerInput.GenerateInputTag_ForCurrentGamemode(false, "Grapple"), - InputTrigger_LockOn = PlayerInput.GenerateInputTag_ForCurrentGamemode(true, "LockOn"), - InputTrigger_RadialQuickbar = PlayerInput.GenerateInputTag_ForCurrentGamemode(true, "HotbarMinus"), - InputTrigger_RadialHotbar = PlayerInput.GenerateInputTag_ForCurrentGamemode(true, "HotbarPlus"), - InputTrigger_SmartCursor = PlayerInput.GenerateInputTag_ForCurrentGamemode(true, "SmartCursor"), - InputTrigger_UseOrAttack = PlayerInput.GenerateInputTag_ForCurrentGamemode(true, "MouseLeft"), - InputTrigger_InteractWithTile = PlayerInput.GenerateInputTag_ForCurrentGamemode(true, "MouseRight"), - InputTrigger_SmartSelect = PlayerInput.GenerateInputTag_ForCurrentGamemode(true, "SmartSelect") + PlayerName = Main.player[Main.myPlayer].name }; [Obsolete("dialog is deprecated. Please use Language.GetText instead.")] @@ -110,7 +90,7 @@ namespace Terraria public static LocalizedText GetNPCName(int netID) { - if (netID > 0 && netID < 663) + if (netID > 0 && netID < 580) return Lang._npcNameCache[netID]; return netID < 0 && -netID - 1 < Lang._negativeNpcNameCache.Length ? Lang._negativeNpcNameCache[-netID - 1] : LocalizedText.Empty; } @@ -120,11 +100,9 @@ namespace Terraria public static LocalizedText GetItemName(int id) { id = (int) ItemID.FromNetId((short) id); - return id > 0 && id < 5045 && Lang._itemNameCache[id] != null ? Lang._itemNameCache[id] : LocalizedText.Empty; + return id > 0 && id < 3930 && Lang._itemNameCache[id] != null ? Lang._itemNameCache[id] : LocalizedText.Empty; } - public static LocalizedText GetEmojiName(int id) => id >= 0 && id < 145 && Lang._emojiNameCache[id] != null ? Lang._emojiNameCache[id] : LocalizedText.Empty; - public static string GetItemNameValue(int id) => Lang.GetItemName(id).Value; public static string GetBuffName(int id) => Lang._buffNameCache[id].Value; @@ -157,7 +135,7 @@ namespace Terraria return Language.GetTextValue("DryadSpecialText.WorldStatusPure", (object) Main.worldName); textValue = Language.GetTextValue("DryadSpecialText.WorldStatusHallow", (object) Main.worldName, (object) tGood); } - string str = (double) tGood * 1.2 < (double) (tEvil + tBlood) || (double) tGood * 0.8 > (double) (tEvil + tBlood) ? (tGood < tEvil + tBlood ? (tEvil + tBlood <= tGood + 20 ? (tEvil + tBlood <= 5 ? Language.GetTextValue("DryadSpecialText.WorldDescriptionClose") : Language.GetTextValue("DryadSpecialText.WorldDescriptionWork")) : Language.GetTextValue("DryadSpecialText.WorldDescriptionGrim")) : Language.GetTextValue("DryadSpecialText.WorldDescriptionFairyTale")) : Language.GetTextValue("DryadSpecialText.WorldDescriptionBalanced"); + string str = (double) tGood * 1.2 < (double) (tEvil + tBlood) || (double) tGood * 0.8 > (double) (tEvil + tBlood) ? (tGood < tEvil + tBlood ? (tEvil + tBlood <= tGood + 20 ? (tEvil + tBlood <= 10 ? Language.GetTextValue("DryadSpecialText.WorldDescriptionClose") : Language.GetTextValue("DryadSpecialText.WorldDescriptionWork")) : Language.GetTextValue("DryadSpecialText.WorldDescriptionGrim")) : Language.GetTextValue("DryadSpecialText.WorldDescriptionFairyTale")) : Language.GetTextValue("DryadSpecialText.WorldDescriptionBalanced"); return string.Format("{0} {1}", (object) textValue, (object) str); } @@ -170,12 +148,6 @@ namespace Terraria return all[Main.rand.Next(all.Length)].FormatWith(substitutionObject); } - public static string AnglerQuestCountChat(NPC npc) - { - object substitutionObject = Lang.CreateDialogSubstitutionObject(npc); - return Language.SelectRandom(Lang.CreateDialogFilter("AnglerQuestChatter.", substitutionObject)).FormatWith(substitutionObject); - } - public static string BartenderHelpText(NPC npc) { object substitutionObject = Lang.CreateDialogSubstitutionObject(npc); @@ -187,7 +159,7 @@ namespace Terraria newItem.SetDefaults(3817); newItem.stack = 5; newItem.position = player.Center; - Item obj = player.GetItem(player.whoAmI, newItem, GetItemSettings.NPCEntityToPlayerInventorySettings); + Item obj = player.GetItem(player.whoAmI, newItem, true); if (obj.stack > 0) { int number = Item.NewItem((int) player.position.X, (int) player.position.Y, player.width, player.height, obj.type, obj.stack, noGrabDelay: true); @@ -208,41 +180,6 @@ namespace Terraria return Main.rand.Next(5) == 0 ? Language.GetTextValueWith(!DD2Event.DownedInvasionT3 ? (!DD2Event.DownedInvasionT2 ? (!DD2Event.DownedInvasionT1 ? "BartenderSpecialText.BeforeDD2Tier1" : "BartenderSpecialText.AfterDD2Tier1") : "BartenderSpecialText.AfterDD2Tier2") : "BartenderSpecialText.AfterDD2Tier3", substitutionObject) : Language.SelectRandom(Lang.CreateDialogFilter("BartenderChatter.", substitutionObject)).FormatWith(substitutionObject); } - public static string GolferChat(NPC npc) - { - object substitutionObject = Lang.CreateDialogSubstitutionObject(npc); - return Language.SelectRandom(Lang.CreateDialogFilter("GolferChatter.", substitutionObject)).FormatWith(substitutionObject); - } - - public static string BestiaryGirlChat(NPC npc) - { - object substitutionObject = Lang.CreateDialogSubstitutionObject(npc); - string startsWith = "BestiaryGirlChatter."; - if (npc.ShouldBestiaryGirlBeLycantrope()) - startsWith = "BestiaryGirlLycantropeChatter."; - return Language.SelectRandom(Lang.CreateDialogFilter(startsWith, substitutionObject)).FormatWith(substitutionObject); - } - - public static string CatChat(NPC npc) - { - object substitutionObject = Lang.CreateDialogSubstitutionObject(npc); - return Language.SelectRandom(Lang.CreateDialogFilter("CatChatter.", substitutionObject)).FormatWith(substitutionObject); - } - - public static string DogChat(NPC npc) - { - object substitutionObject = Lang.CreateDialogSubstitutionObject(npc); - return Language.SelectRandom(Lang.CreateDialogFilter("DogChatter.", substitutionObject)).FormatWith(substitutionObject); - } - - public static string BunnyChat(NPC npc) - { - object substitutionObject = Lang.CreateDialogSubstitutionObject(npc); - return Language.SelectRandom(Lang.CreateDialogFilter("BunnyChatter.", substitutionObject)).FormatWith(substitutionObject); - } - - public static string GetNPCHouseBannerText(NPC npc, int bannerStyle) => bannerStyle == 1 ? Language.GetTextValue("Game.ReservedForNPC", (object) npc.FullName) : npc.FullName; - public static LanguageSearchFilter CreateDialogFilter( string startsWith, object substitutions) @@ -277,13 +214,13 @@ namespace Terraria ((IEnumerable) typeof (IdClass).GetFields(BindingFlags.Static | BindingFlags.Public)).Where((Func) (f => f.FieldType == typeof (IdType))).ToList().ForEach((Action) (field => { long int64 = Convert.ToInt64((object) (IdType) field.GetValue((object) null)); - if (int64 >= 0L && int64 < (long) nameCache.Length) + if (int64 > 0L && int64 < (long) nameCache.Length) { nameCache[(IntPtr) int64] = !leaveMissingEntriesBlank || Language.Exists(category + "." + field.Name) ? Language.GetText(category + "." + field.Name) : LocalizedText.Empty; } else { - if (!(field.Name == "None")) + if (int64 != 0L || !(field.Name == "None")) return; nameCache[int64] = LocalizedText.Empty; } @@ -316,7 +253,6 @@ namespace Terraria Lang.FillNameCacheArray("NPCName", Lang._npcNameCache); Lang.FillNameCacheArray("BuffName", Lang._buffNameCache); Lang.FillNameCacheArray("BuffDescription", Lang._buffDescriptionCache); - Lang.FillNameCacheArray("EmojiName", Lang._emojiNameCache, true); for (int id = -65; id < 0; ++id) Lang._negativeNpcNameCache[-id - 1] = Lang._npcNameCache[NPCID.FromNetId(id)]; Lang._negativeNpcNameCache[0] = Language.GetText("NPCName.Slimeling"); @@ -346,19 +282,6 @@ namespace Terraria else tooltip = tooltip.Replace("", Language.GetTextValue("Controls.RightClick")); } - if (tooltip.Contains("")) - { - InputMode key = InputMode.XBoxGamepad; - if (PlayerInput.UsingGamepad) - key = InputMode.XBoxGamepadUI; - if (key == InputMode.XBoxGamepadUI) - { - string newValue = PlayerInput.BuildCommand("", true, PlayerInput.CurrentProfile.InputModes[key].KeyStatus["MouseLeft"]).Replace(": ", ""); - tooltip = tooltip.Replace("", newValue); - } - else - tooltip = tooltip.Replace("", Language.GetTextValue("Controls.LeftClick")); - } return tooltip; })); for (int index = 0; index < Lang._itemTooltipCache.Length; ++index) @@ -377,13 +300,9 @@ namespace Terraria Lang._mapLegendCache = new LocalizedText[MapHelper.LookupCount()]; for (int index = 0; index < Lang._mapLegendCache.Length; ++index) Lang._mapLegendCache[index] = LocalizedText.Empty; - for (int tileType = 0; tileType < TileID.Sets.IsATreeTrunk.Length; ++tileType) - { - if (TileID.Sets.IsATreeTrunk[tileType]) - Lang._mapLegendCache[MapHelper.TileToLookup(tileType, 0)] = Language.GetText("MapObject.Tree"); - } Lang._mapLegendCache[MapHelper.TileToLookup(4, 0)] = Lang._itemNameCache[8]; Lang._mapLegendCache[MapHelper.TileToLookup(4, 1)] = Lang._itemNameCache[8]; + Lang._mapLegendCache[MapHelper.TileToLookup(5, 0)] = Language.GetText("MapObject.Tree"); Lang._mapLegendCache[MapHelper.TileToLookup(6, 0)] = Language.GetText("MapObject.Iron"); Lang._mapLegendCache[MapHelper.TileToLookup(7, 0)] = Language.GetText("MapObject.Copper"); Lang._mapLegendCache[MapHelper.TileToLookup(8, 0)] = Language.GetText("MapObject.Gold"); @@ -394,20 +313,11 @@ namespace Terraria Lang._mapLegendCache[MapHelper.TileToLookup(13, 0)] = Lang._itemNameCache[31]; Lang._mapLegendCache[MapHelper.TileToLookup(14, 0)] = Language.GetText("MapObject.Table"); Lang._mapLegendCache[MapHelper.TileToLookup(469, 0)] = Language.GetText("MapObject.Table"); - Lang._mapLegendCache[MapHelper.TileToLookup(486, 0)] = Lang._itemNameCache[4063]; - Lang._mapLegendCache[MapHelper.TileToLookup(487, 0)] = Lang._itemNameCache[4064]; - Lang._mapLegendCache[MapHelper.TileToLookup(487, 1)] = Lang._itemNameCache[4065]; - Lang._mapLegendCache[MapHelper.TileToLookup(489, 0)] = Lang._itemNameCache[4074]; - Lang._mapLegendCache[MapHelper.TileToLookup(490, 0)] = Lang._itemNameCache[4075]; Lang._mapLegendCache[MapHelper.TileToLookup(15, 0)] = Language.GetText("MapObject.Chair"); - Lang._mapLegendCache[MapHelper.TileToLookup(15, 1)] = Language.GetText("MapObject.Toilet"); Lang._mapLegendCache[MapHelper.TileToLookup(16, 0)] = Language.GetText("MapObject.Anvil"); Lang._mapLegendCache[MapHelper.TileToLookup(17, 0)] = Lang._itemNameCache[33]; Lang._mapLegendCache[MapHelper.TileToLookup(18, 0)] = Lang._itemNameCache[36]; Lang._mapLegendCache[MapHelper.TileToLookup(20, 0)] = Language.GetText("MapObject.Sapling"); - Lang._mapLegendCache[MapHelper.TileToLookup(590, 0)] = Language.GetText("MapObject.Sapling"); - Lang._mapLegendCache[MapHelper.TileToLookup(595, 0)] = Language.GetText("MapObject.Sapling"); - Lang._mapLegendCache[MapHelper.TileToLookup(615, 0)] = Language.GetText("MapObject.Sapling"); Lang._mapLegendCache[MapHelper.TileToLookup(21, 0)] = Lang._itemNameCache[48]; Lang._mapLegendCache[MapHelper.TileToLookup(467, 0)] = Lang._itemNameCache[48]; Lang._mapLegendCache[MapHelper.TileToLookup(22, 0)] = Language.GetText("MapObject.Demonite"); @@ -418,7 +328,6 @@ namespace Terraria Lang._mapLegendCache[MapHelper.TileToLookup(412, 0)] = Lang._itemNameCache[3549]; Lang._mapLegendCache[MapHelper.TileToLookup(441, 0)] = Lang._itemNameCache[48]; Lang._mapLegendCache[MapHelper.TileToLookup(468, 0)] = Lang._itemNameCache[48]; - Lang._mapLegendCache[MapHelper.TileToLookup(404, 0)] = Language.GetText("MapObject.DesertFossil"); for (int option = 0; option < 9; ++option) Lang._mapLegendCache[MapHelper.TileToLookup(28, option)] = Language.GetText("MapObject.Pot"); Lang._mapLegendCache[MapHelper.TileToLookup(37, 0)] = Lang._itemNameCache[116]; @@ -430,7 +339,6 @@ namespace Terraria Lang._mapLegendCache[MapHelper.TileToLookup(34, 0)] = Language.GetText("MapObject.Chandelier"); Lang._mapLegendCache[MapHelper.TileToLookup(35, 0)] = Lang._itemNameCache[1813]; Lang._mapLegendCache[MapHelper.TileToLookup(36, 0)] = Lang._itemNameCache[1869]; - Lang._mapLegendCache[MapHelper.TileToLookup(476, 0)] = Lang._itemNameCache[4040]; Lang._mapLegendCache[MapHelper.TileToLookup(42, 0)] = Language.GetText("MapObject.Lantern"); Lang._mapLegendCache[MapHelper.TileToLookup(48, 0)] = Lang._itemNameCache[147]; Lang._mapLegendCache[MapHelper.TileToLookup(49, 0)] = Lang._itemNameCache[148]; @@ -444,14 +352,12 @@ namespace Terraria Lang._mapLegendCache[MapHelper.TileToLookup(453, 0)] = Lang._itemNameCache[3744]; Lang._mapLegendCache[MapHelper.TileToLookup(453, 1)] = Lang._itemNameCache[3745]; Lang._mapLegendCache[MapHelper.TileToLookup(453, 2)] = Lang._itemNameCache[3743]; - Lang._mapLegendCache[MapHelper.TileToLookup(573, 0)] = Lang._itemNameCache[4710]; Lang._mapLegendCache[MapHelper.TileToLookup(63, 0)] = Lang._itemNameCache[177]; Lang._mapLegendCache[MapHelper.TileToLookup(64, 0)] = Lang._itemNameCache[178]; Lang._mapLegendCache[MapHelper.TileToLookup(65, 0)] = Lang._itemNameCache[179]; Lang._mapLegendCache[MapHelper.TileToLookup(66, 0)] = Lang._itemNameCache[180]; Lang._mapLegendCache[MapHelper.TileToLookup(67, 0)] = Lang._itemNameCache[181]; Lang._mapLegendCache[MapHelper.TileToLookup(68, 0)] = Lang._itemNameCache[182]; - Lang._mapLegendCache[MapHelper.TileToLookup(566, 0)] = Lang._itemNameCache[999]; Lang._mapLegendCache[MapHelper.TileToLookup(69, 0)] = Language.GetText("MapObject.Thorn"); Lang._mapLegendCache[MapHelper.TileToLookup(72, 0)] = Language.GetText("MapObject.GiantMushroom"); Lang._mapLegendCache[MapHelper.TileToLookup(77, 0)] = Lang._itemNameCache[221]; @@ -577,7 +483,6 @@ namespace Terraria Lang._mapLegendCache[MapHelper.TileToLookup(238, 0)] = Language.GetText("MapObject.PlanterasBulb"); Lang._mapLegendCache[MapHelper.TileToLookup(239, 0)] = Language.GetText("MapObject.MetalBar"); Lang._mapLegendCache[MapHelper.TileToLookup(240, 0)] = Language.GetText("MapObject.Trophy"); - Lang._mapLegendCache[MapHelper.TileToLookup(240, 1)] = Language.GetText("MapObject.Painting"); Lang._mapLegendCache[MapHelper.TileToLookup(240, 2)] = Lang._npcNameCache[21]; Lang._mapLegendCache[MapHelper.TileToLookup(240, 3)] = Language.GetText("MapObject.ItemRack"); Lang._mapLegendCache[MapHelper.TileToLookup(240, 4)] = Lang._itemNameCache[2442]; @@ -591,22 +496,8 @@ namespace Terraria Lang._mapLegendCache[MapHelper.TileToLookup(247, 0)] = Lang._itemNameCache[1551]; Lang._mapLegendCache[MapHelper.TileToLookup(254, 0)] = Lang._itemNameCache[1725]; Lang._mapLegendCache[MapHelper.TileToLookup(269, 0)] = Lang._itemNameCache[1989]; - Lang._mapLegendCache[MapHelper.TileToLookup(475, 0)] = Lang._itemNameCache[3977]; - Lang._mapLegendCache[MapHelper.TileToLookup(597, 0)] = Lang._itemNameCache[4876]; - Lang._mapLegendCache[MapHelper.TileToLookup(597, 1)] = Lang._itemNameCache[4875]; - Lang._mapLegendCache[MapHelper.TileToLookup(597, 2)] = Lang._itemNameCache[4916]; - Lang._mapLegendCache[MapHelper.TileToLookup(597, 3)] = Lang._itemNameCache[4917]; - Lang._mapLegendCache[MapHelper.TileToLookup(597, 4)] = Lang._itemNameCache[4918]; - Lang._mapLegendCache[MapHelper.TileToLookup(597, 5)] = Lang._itemNameCache[4919]; - Lang._mapLegendCache[MapHelper.TileToLookup(597, 6)] = Lang._itemNameCache[4920]; - Lang._mapLegendCache[MapHelper.TileToLookup(597, 7)] = Lang._itemNameCache[4921]; - Lang._mapLegendCache[MapHelper.TileToLookup(597, 8)] = Lang._itemNameCache[4951]; - Lang._mapLegendCache[MapHelper.TileToLookup(617, 0)] = Language.GetText("MapObject.Relic"); - Lang._mapLegendCache[MapHelper.TileToLookup(621, 0)] = Lang._itemNameCache[3750]; - Lang._mapLegendCache[MapHelper.TileToLookup(622, 0)] = Lang._itemNameCache[5008]; Lang._mapLegendCache[MapHelper.TileToLookup(270, 0)] = Lang._itemNameCache[1993]; Lang._mapLegendCache[MapHelper.TileToLookup(271, 0)] = Lang._itemNameCache[2005]; - Lang._mapLegendCache[MapHelper.TileToLookup(581, 0)] = Lang._itemNameCache[4848]; Lang._mapLegendCache[MapHelper.TileToLookup(275, 0)] = Lang._itemNameCache[2162]; Lang._mapLegendCache[MapHelper.TileToLookup(276, 0)] = Lang._itemNameCache[2163]; Lang._mapLegendCache[MapHelper.TileToLookup(277, 0)] = Lang._itemNameCache[2164]; @@ -615,13 +506,10 @@ namespace Terraria Lang._mapLegendCache[MapHelper.TileToLookup(280, 0)] = Lang._itemNameCache[2167]; Lang._mapLegendCache[MapHelper.TileToLookup(281, 0)] = Lang._itemNameCache[2168]; Lang._mapLegendCache[MapHelper.TileToLookup(282, 0)] = Lang._itemNameCache[250]; - Lang._mapLegendCache[MapHelper.TileToLookup(543, 0)] = Lang._itemNameCache[4398]; - Lang._mapLegendCache[MapHelper.TileToLookup(598, 0)] = Lang._itemNameCache[4880]; Lang._mapLegendCache[MapHelper.TileToLookup(413, 0)] = Language.GetText("MapObject.OrangeSquirrelCage"); Lang._mapLegendCache[MapHelper.TileToLookup(283, 0)] = Lang._itemNameCache[2172]; Lang._mapLegendCache[MapHelper.TileToLookup(285, 0)] = Lang._itemNameCache[2174]; Lang._mapLegendCache[MapHelper.TileToLookup(286, 0)] = Lang._itemNameCache[2175]; - Lang._mapLegendCache[MapHelper.TileToLookup(582, 0)] = Lang._itemNameCache[4850]; Lang._mapLegendCache[MapHelper.TileToLookup(287, 0)] = Lang._itemNameCache[2177]; Lang._mapLegendCache[MapHelper.TileToLookup(288, 0)] = Lang._itemNameCache[2178]; Lang._mapLegendCache[MapHelper.TileToLookup(289, 0)] = Lang._itemNameCache[2179]; @@ -631,9 +519,6 @@ namespace Terraria Lang._mapLegendCache[MapHelper.TileToLookup(293, 0)] = Lang._itemNameCache[2183]; Lang._mapLegendCache[MapHelper.TileToLookup(294, 0)] = Lang._itemNameCache[2184]; Lang._mapLegendCache[MapHelper.TileToLookup(295, 0)] = Lang._itemNameCache[2185]; - Lang._mapLegendCache[MapHelper.TileToLookup(580, 0)] = Lang._itemNameCache[4846]; - Lang._mapLegendCache[MapHelper.TileToLookup(620, 0)] = Lang._itemNameCache[4964]; - Lang._mapLegendCache[MapHelper.TileToLookup(619, 0)] = Lang._itemNameCache[4963]; Lang._mapLegendCache[MapHelper.TileToLookup(296, 0)] = Lang._itemNameCache[2186]; Lang._mapLegendCache[MapHelper.TileToLookup(297, 0)] = Lang._itemNameCache[2187]; Lang._mapLegendCache[MapHelper.TileToLookup(298, 0)] = Lang._itemNameCache[2190]; @@ -649,7 +534,6 @@ namespace Terraria Lang._mapLegendCache[MapHelper.TileToLookup(308, 0)] = Lang._itemNameCache[2204]; Lang._mapLegendCache[MapHelper.TileToLookup(309, 0)] = Lang._itemNameCache[2206]; Lang._mapLegendCache[MapHelper.TileToLookup(310, 0)] = Lang._itemNameCache[2207]; - Lang._mapLegendCache[MapHelper.TileToLookup(391, 0)] = Lang._itemNameCache[3254]; Lang._mapLegendCache[MapHelper.TileToLookup(316, 0)] = Lang._itemNameCache[2439]; Lang._mapLegendCache[MapHelper.TileToLookup(317, 0)] = Lang._itemNameCache[2440]; Lang._mapLegendCache[MapHelper.TileToLookup(318, 0)] = Lang._itemNameCache[2441]; @@ -661,31 +545,12 @@ namespace Terraria Lang._mapLegendCache[MapHelper.TileToLookup(354, 0)] = Lang._itemNameCache[2999]; Lang._mapLegendCache[MapHelper.TileToLookup(355, 0)] = Lang._itemNameCache[3000]; Lang._mapLegendCache[MapHelper.TileToLookup(356, 0)] = Lang._itemNameCache[3064]; - Lang._mapLegendCache[MapHelper.TileToLookup(358, 0)] = Lang._itemNameCache[3070]; - Lang._mapLegendCache[MapHelper.TileToLookup(359, 0)] = Lang._itemNameCache[3071]; - Lang._mapLegendCache[MapHelper.TileToLookup(360, 0)] = Lang._itemNameCache[3072]; - Lang._mapLegendCache[MapHelper.TileToLookup(361, 0)] = Lang._itemNameCache[3073]; - Lang._mapLegendCache[MapHelper.TileToLookup(362, 0)] = Lang._itemNameCache[3074]; - Lang._mapLegendCache[MapHelper.TileToLookup(363, 0)] = Lang._itemNameCache[3075]; - Lang._mapLegendCache[MapHelper.TileToLookup(364, 0)] = Lang._itemNameCache[3076]; - Lang._mapLegendCache[MapHelper.TileToLookup(414, 0)] = Lang._itemNameCache[3566]; - Lang._mapLegendCache[MapHelper.TileToLookup(521, 0)] = Lang._itemNameCache[4327]; - Lang._mapLegendCache[MapHelper.TileToLookup(522, 0)] = Lang._itemNameCache[4328]; - Lang._mapLegendCache[MapHelper.TileToLookup(523, 0)] = Lang._itemNameCache[4329]; - Lang._mapLegendCache[MapHelper.TileToLookup(524, 0)] = Lang._itemNameCache[4330]; - Lang._mapLegendCache[MapHelper.TileToLookup(525, 0)] = Lang._itemNameCache[4331]; - Lang._mapLegendCache[MapHelper.TileToLookup(526, 0)] = Lang._itemNameCache[4332]; - Lang._mapLegendCache[MapHelper.TileToLookup(527, 0)] = Lang._itemNameCache[4333]; - Lang._mapLegendCache[MapHelper.TileToLookup(542, 0)] = Lang._itemNameCache[4396]; Lang._mapLegendCache[MapHelper.TileToLookup(365, 0)] = Lang._itemNameCache[3077]; Lang._mapLegendCache[MapHelper.TileToLookup(366, 0)] = Lang._itemNameCache[3078]; Lang._mapLegendCache[MapHelper.TileToLookup(373, 0)] = Language.GetText("MapObject.DrippingWater"); Lang._mapLegendCache[MapHelper.TileToLookup(374, 0)] = Language.GetText("MapObject.DrippingLava"); Lang._mapLegendCache[MapHelper.TileToLookup(375, 0)] = Language.GetText("MapObject.DrippingHoney"); Lang._mapLegendCache[MapHelper.TileToLookup(461, 0)] = Language.GetText("MapObject.SandFlow"); - Lang._mapLegendCache[MapHelper.TileToLookup(461, 1)] = Language.GetText("MapObject.SandFlow"); - Lang._mapLegendCache[MapHelper.TileToLookup(461, 2)] = Language.GetText("MapObject.SandFlow"); - Lang._mapLegendCache[MapHelper.TileToLookup(461, 3)] = Language.GetText("MapObject.SandFlow"); Lang._mapLegendCache[MapHelper.TileToLookup(377, 0)] = Lang._itemNameCache[3198]; Lang._mapLegendCache[MapHelper.TileToLookup(372, 0)] = Lang._itemNameCache[3117]; Lang._mapLegendCache[MapHelper.TileToLookup(425, 0)] = Lang._itemNameCache[3617]; @@ -709,67 +574,10 @@ namespace Terraria Lang._mapLegendCache[MapHelper.TileToLookup(440, 4)] = Lang._itemNameCache[3648]; Lang._mapLegendCache[MapHelper.TileToLookup(440, 5)] = Lang._itemNameCache[3649]; Lang._mapLegendCache[MapHelper.TileToLookup(440, 6)] = Lang._itemNameCache[3650]; - Lang._mapLegendCache[MapHelper.TileToLookup(443, 0)] = Lang._itemNameCache[3722]; - Lang._mapLegendCache[MapHelper.TileToLookup(429, 0)] = Lang._itemNameCache[3629]; Lang._mapLegendCache[MapHelper.TileToLookup(424, 0)] = Lang._itemNameCache[3616]; Lang._mapLegendCache[MapHelper.TileToLookup(444, 0)] = Language.GetText("MapObject.BeeHive"); Lang._mapLegendCache[MapHelper.TileToLookup(466, 0)] = Lang._itemNameCache[3816]; Lang._mapLegendCache[MapHelper.TileToLookup(463, 0)] = Lang._itemNameCache[3813]; - Lang._mapLegendCache[MapHelper.TileToLookup(491, 0)] = Lang._itemNameCache[4076]; - Lang._mapLegendCache[MapHelper.TileToLookup(494, 0)] = Lang._itemNameCache[4089]; - Lang._mapLegendCache[MapHelper.TileToLookup(499, 0)] = Lang._itemNameCache[4142]; - Lang._mapLegendCache[MapHelper.TileToLookup(488, 0)] = Language.GetText("MapObject.FallenLog"); - Lang._mapLegendCache[MapHelper.TileToLookup(505, 0)] = Lang._itemNameCache[4275]; - Lang._mapLegendCache[MapHelper.TileToLookup(521, 0)] = Lang._itemNameCache[4327]; - Lang._mapLegendCache[MapHelper.TileToLookup(522, 0)] = Lang._itemNameCache[4328]; - Lang._mapLegendCache[MapHelper.TileToLookup(523, 0)] = Lang._itemNameCache[4329]; - Lang._mapLegendCache[MapHelper.TileToLookup(524, 0)] = Lang._itemNameCache[4330]; - Lang._mapLegendCache[MapHelper.TileToLookup(525, 0)] = Lang._itemNameCache[4331]; - Lang._mapLegendCache[MapHelper.TileToLookup(526, 0)] = Lang._itemNameCache[4332]; - Lang._mapLegendCache[MapHelper.TileToLookup(527, 0)] = Lang._itemNameCache[4333]; - Lang._mapLegendCache[MapHelper.TileToLookup(531, 0)] = Language.GetText("MapObject.Statue"); - Lang._mapLegendCache[MapHelper.TileToLookup(349, 0)] = Language.GetText("MapObject.Statue"); - Lang._mapLegendCache[MapHelper.TileToLookup(532, 0)] = Lang._itemNameCache[4364]; - Lang._mapLegendCache[MapHelper.TileToLookup(538, 0)] = Lang._itemNameCache[4380]; - Lang._mapLegendCache[MapHelper.TileToLookup(544, 0)] = Lang._itemNameCache[4399]; - Lang._mapLegendCache[MapHelper.TileToLookup(506, 0)] = Lang._itemNameCache[4276]; - Lang._mapLegendCache[MapHelper.TileToLookup(545, 0)] = Lang._itemNameCache[4420]; - Lang._mapLegendCache[MapHelper.TileToLookup(550, 0)] = Lang._itemNameCache[4461]; - Lang._mapLegendCache[MapHelper.TileToLookup(551, 0)] = Lang._itemNameCache[4462]; - Lang._mapLegendCache[MapHelper.TileToLookup(533, 0)] = Lang._itemNameCache[4376]; - Lang._mapLegendCache[MapHelper.TileToLookup(553, 0)] = Lang._itemNameCache[4473]; - Lang._mapLegendCache[MapHelper.TileToLookup(554, 0)] = Lang._itemNameCache[4474]; - Lang._mapLegendCache[MapHelper.TileToLookup(555, 0)] = Lang._itemNameCache[4475]; - Lang._mapLegendCache[MapHelper.TileToLookup(556, 0)] = Lang._itemNameCache[4476]; - Lang._mapLegendCache[MapHelper.TileToLookup(558, 0)] = Lang._itemNameCache[4481]; - Lang._mapLegendCache[MapHelper.TileToLookup(559, 0)] = Lang._itemNameCache[4483]; - Lang._mapLegendCache[MapHelper.TileToLookup(599, 0)] = Lang._itemNameCache[4882]; - Lang._mapLegendCache[MapHelper.TileToLookup(600, 0)] = Lang._itemNameCache[4883]; - Lang._mapLegendCache[MapHelper.TileToLookup(601, 0)] = Lang._itemNameCache[4884]; - Lang._mapLegendCache[MapHelper.TileToLookup(602, 0)] = Lang._itemNameCache[4885]; - Lang._mapLegendCache[MapHelper.TileToLookup(603, 0)] = Lang._itemNameCache[4886]; - Lang._mapLegendCache[MapHelper.TileToLookup(604, 0)] = Lang._itemNameCache[4887]; - Lang._mapLegendCache[MapHelper.TileToLookup(605, 0)] = Lang._itemNameCache[4888]; - Lang._mapLegendCache[MapHelper.TileToLookup(606, 0)] = Lang._itemNameCache[4889]; - Lang._mapLegendCache[MapHelper.TileToLookup(607, 0)] = Lang._itemNameCache[4890]; - Lang._mapLegendCache[MapHelper.TileToLookup(608, 0)] = Lang._itemNameCache[4891]; - Lang._mapLegendCache[MapHelper.TileToLookup(609, 0)] = Lang._itemNameCache[4892]; - Lang._mapLegendCache[MapHelper.TileToLookup(610, 0)] = Lang._itemNameCache[4893]; - Lang._mapLegendCache[MapHelper.TileToLookup(611, 0)] = Lang._itemNameCache[4894]; - Lang._mapLegendCache[MapHelper.TileToLookup(612, 0)] = Lang._itemNameCache[4895]; - Lang._mapLegendCache[MapHelper.TileToLookup(560, 0)] = Lang._itemNameCache[4599]; - Lang._mapLegendCache[MapHelper.TileToLookup(560, 1)] = Lang._itemNameCache[4600]; - Lang._mapLegendCache[MapHelper.TileToLookup(560, 2)] = Lang._itemNameCache[4601]; - Lang._mapLegendCache[MapHelper.TileToLookup(568, 0)] = Lang._itemNameCache[4655]; - Lang._mapLegendCache[MapHelper.TileToLookup(569, 0)] = Lang._itemNameCache[4656]; - Lang._mapLegendCache[MapHelper.TileToLookup(570, 0)] = Lang._itemNameCache[4657]; - Lang._mapLegendCache[MapHelper.TileToLookup(572, 0)] = Lang._itemNameCache[4695]; - Lang._mapLegendCache[MapHelper.TileToLookup(572, 1)] = Lang._itemNameCache[4696]; - Lang._mapLegendCache[MapHelper.TileToLookup(572, 2)] = Lang._itemNameCache[4697]; - Lang._mapLegendCache[MapHelper.TileToLookup(572, 3)] = Lang._itemNameCache[4698]; - Lang._mapLegendCache[MapHelper.TileToLookup(572, 4)] = Lang._itemNameCache[4699]; - Lang._mapLegendCache[MapHelper.TileToLookup(572, 5)] = Lang._itemNameCache[4700]; - Lang._mapLegendCache[MapHelper.TileToLookup(497, 0)] = Language.GetText("MapObject.Toilet"); } public static NetworkText CreateDeathMessage( @@ -859,9 +667,6 @@ namespace Terraria case 15: networkText5 = NetworkText.FromKey("DeathText.Teleport_2_Female", (object) deadPlayerName); break; - case 16: - networkText5 = NetworkText.FromKey("DeathText.Inferno", (object) deadPlayerName); - break; case 254: networkText5 = NetworkText.Empty; break; @@ -899,33 +704,24 @@ namespace Terraria bool showAllAvailableUnits) { string str1 = ""; - abbreviated |= !GameCulture.FromCultureName(GameCulture.CultureName.English).IsActive; + abbreviated |= !GameCulture.English.IsActive; if (time.Days > 0) { - int days = time.Days; - if (!showAllAvailableUnits && time > TimeSpan.FromDays(1.0)) - ++days; - string str2 = str1 + (object) days + (abbreviated ? (object) (" " + Language.GetTextValue("Misc.ShortDays")) : (days == 1 ? (object) " day" : (object) " days")); + string str2 = str1 + (object) time.Days + (abbreviated ? (object) (" " + Language.GetTextValue("Misc.ShortDays")) : (time.Days == 1 ? (object) " day" : (object) " days")); if (!showAllAvailableUnits) return str2; str1 = str2 + " "; } if (time.Hours > 0) { - int hours = time.Hours; - if (!showAllAvailableUnits && time > TimeSpan.FromHours(1.0)) - ++hours; - string str3 = str1 + (object) hours + (abbreviated ? (object) (" " + Language.GetTextValue("Misc.ShortHours")) : (hours == 1 ? (object) " hour" : (object) " hours")); + string str3 = str1 + (object) time.Hours + (abbreviated ? (object) (" " + Language.GetTextValue("Misc.ShortHours")) : (time.Hours == 1 ? (object) " hour" : (object) " hours")); if (!showAllAvailableUnits) return str3; str1 = str3 + " "; } if (time.Minutes > 0) { - int minutes = time.Minutes; - if (!showAllAvailableUnits && time > TimeSpan.FromMinutes(1.0)) - ++minutes; - string str4 = str1 + (object) minutes + (abbreviated ? (object) (" " + Language.GetTextValue("Misc.ShortMinutes")) : (minutes == 1 ? (object) " minute" : (object) " minutes")); + string str4 = str1 + (object) time.Minutes + (abbreviated ? (object) (" " + Language.GetTextValue("Misc.ShortMinutes")) : (time.Minutes == 1 ? (object) " minute" : (object) " minutes")); if (!showAllAvailableUnits) return str4; str1 = str4 + " "; diff --git a/Libraries/RailSDK/Windows/RailSDK/Net.dll b/Libraries/RailSDK/Windows/RailSDK/Net.dll deleted file mode 100644 index e0aa636..0000000 Binary files a/Libraries/RailSDK/Windows/RailSDK/Net.dll and /dev/null differ diff --git a/Libraries/ReLogic/ReLogic.dll b/Libraries/ReLogic/ReLogic.dll index 4a6035f..8cf49ca 100644 Binary files a/Libraries/ReLogic/ReLogic.dll and b/Libraries/ReLogic/ReLogic.dll differ diff --git a/Lighting.cs b/Lighting.cs index f044776..a3391d9 100644 --- a/Lighting.cs +++ b/Lighting.cs @@ -1,423 +1,3274 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Lighting -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Threading; +using Terraria.DataStructures; +using Terraria.GameContent; using Terraria.Graphics; -using Terraria.Graphics.Light; using Terraria.ID; +using Terraria.Utilities; namespace Terraria { public class Lighting { - private const float DEFAULT_GLOBAL_BRIGHTNESS = 1.2f; - private const float BLIND_GLOBAL_BRIGHTNESS = 1f; - [Obsolete] - public static int OffScreenTiles = 45; - private static LightMode _mode = LightMode.Color; - private static readonly LightingEngine NewEngine = new LightingEngine(Main.ActiveWorld); - private static readonly LegacyLighting LegacyEngine = new LegacyLighting(Main.Camera, Main.ActiveWorld); - private static ILightingEngine _activeEngine; + public static int maxRenderCount = 4; + public static float brightness = 1f; + public static float defBrightness = 1f; + public static int lightMode = 0; + public static bool RGB = true; + private static float oldSkyColor = 0.0f; + private static float skyColor = 0.0f; + private static int lightCounter = 0; + public static int offScreenTiles = 45; + public static int offScreenTiles2 = 35; + private static int firstTileX; + private static int lastTileX; + private static int firstTileY; + private static int lastTileY; + public static int LightingThreads = 0; + private static Lighting.LightingState[][] states; + private static Lighting.LightingState[][] axisFlipStates; + private static Lighting.LightingSwipeData swipe; + private static Lighting.LightingSwipeData[] threadSwipes; + private static CountdownEvent countdown; + public static int scrX; + public static int scrY; + public static int minX; + public static int maxX; + public static int minY; + public static int maxY; + private static int maxTempLights = 2000; + private static Dictionary tempLights; + private static int firstToLightX; + private static int firstToLightY; + private static int lastToLightX; + private static int lastToLightY; + private static float negLight = 0.04f; + private static float negLight2 = 0.16f; + private static float wetLightR = 0.16f; + private static float wetLightG = 0.16f; + private static float wetLightB = 0.16f; + private static float honeyLightR = 0.16f; + private static float honeyLightG = 0.16f; + private static float honeyLightB = 0.16f; + private static float blueWave = 1f; + private static int blueDir = 1; + private static int minX7; + private static int maxX7; + private static int minY7; + private static int maxY7; + private static int firstTileX7; + private static int lastTileX7; + private static int lastTileY7; + private static int firstTileY7; + private static int firstToLightX7; + private static int lastToLightX7; + private static int firstToLightY7; + private static int lastToLightY7; + private static int firstToLightX27; + private static int lastToLightX27; + private static int firstToLightY27; + private static int lastToLightY27; - public static float GlobalBrightness { get; set; } - - public static LightMode Mode - { - get => Lighting._mode; - set - { - Lighting._mode = value; - switch (Lighting._mode) - { - case LightMode.White: - Lighting._activeEngine = (ILightingEngine) Lighting.LegacyEngine; - Lighting.LegacyEngine.Mode = 1; - break; - case LightMode.Retro: - Lighting._activeEngine = (ILightingEngine) Lighting.LegacyEngine; - Lighting.LegacyEngine.Mode = 2; - break; - case LightMode.Trippy: - Lighting._activeEngine = (ILightingEngine) Lighting.LegacyEngine; - Lighting.LegacyEngine.Mode = 3; - break; - case LightMode.Color: - Lighting._activeEngine = (ILightingEngine) Lighting.NewEngine; - Lighting.LegacyEngine.Mode = 0; - Lighting.OffScreenTiles = 35; - break; - } - Main.renderCount = 0; - Main.renderNow = false; - } - } - - public static bool NotRetro => Lighting.Mode != LightMode.Retro && Lighting.Mode != LightMode.Trippy; - - public static bool UsingNewLighting => Lighting.Mode == LightMode.Color; + public static bool NotRetro => Lighting.lightMode < 2; public static bool UpdateEveryFrame => Main.LightingEveryFrame && !Main.RenderTargetsRequired && !Lighting.NotRetro; - public static void Initialize() + public static bool LightingDrawToScreen => Main.drawToScreen; + + public static void Initialize(bool resize = false) { - Lighting.GlobalBrightness = 1.2f; - Lighting.NewEngine.Rebuild(); - Lighting.LegacyEngine.Rebuild(); - if (Lighting._activeEngine != null) + if (!resize) + { + Lighting.tempLights = new Dictionary(); + Lighting.swipe = new Lighting.LightingSwipeData(); + Lighting.countdown = new CountdownEvent(0); + Lighting.threadSwipes = new Lighting.LightingSwipeData[Environment.ProcessorCount]; + for (int index = 0; index < Lighting.threadSwipes.Length; ++index) + Lighting.threadSwipes[index] = new Lighting.LightingSwipeData(); + } + int length1 = Main.screenWidth / 16 + Lighting.offScreenTiles * 2 + 10; + int length2 = Main.screenHeight / 16 + Lighting.offScreenTiles * 2 + 10; + if (Lighting.states != null && Lighting.states.Length >= length1 && Lighting.states[0].Length >= length2) return; - Lighting.Mode = LightMode.Color; + Lighting.states = new Lighting.LightingState[length1][]; + Lighting.axisFlipStates = new Lighting.LightingState[length2][]; + for (int index = 0; index < length2; ++index) + Lighting.axisFlipStates[index] = new Lighting.LightingState[length1]; + for (int index1 = 0; index1 < length1; ++index1) + { + Lighting.LightingState[] lightingStateArray = new Lighting.LightingState[length2]; + for (int index2 = 0; index2 < length2; ++index2) + { + Lighting.LightingState lightingState = new Lighting.LightingState(); + lightingStateArray[index2] = lightingState; + Lighting.axisFlipStates[index2][index1] = lightingState; + } + Lighting.states[index1] = lightingStateArray; + } } public static void LightTiles(int firstX, int lastX, int firstY, int lastY) { Main.render = true; - Lighting.UpdateGlobalBrightness(); - Lighting._activeEngine.ProcessArea(new Rectangle(firstX, firstY, lastX - firstX, lastY - firstY)); - } - - private static void UpdateGlobalBrightness() - { - Lighting.GlobalBrightness = 1.2f; - if (!Main.player[Main.myPlayer].blind) + Lighting.oldSkyColor = Lighting.skyColor; + float num1 = (float) Main.tileColor.R / (float) byte.MaxValue; + float num2 = (float) Main.tileColor.G / (float) byte.MaxValue; + float num3 = (float) Main.tileColor.B / (float) byte.MaxValue; + Lighting.skyColor = (float) (((double) num1 + (double) num2 + (double) num3) / 3.0); + if (Lighting.lightMode < 2) + { + Lighting.brightness = 1.2f; + Lighting.offScreenTiles2 = 34; + Lighting.offScreenTiles = 40; + } + else + { + Lighting.brightness = 1f; + Lighting.offScreenTiles2 = 18; + Lighting.offScreenTiles = 23; + } + Lighting.brightness = 1.2f; + if (Main.player[Main.myPlayer].blind) + Lighting.brightness = 1f; + Lighting.defBrightness = Lighting.brightness; + Lighting.firstTileX = firstX; + Lighting.lastTileX = lastX; + Lighting.firstTileY = firstY; + Lighting.lastTileY = lastY; + Lighting.firstToLightX = Lighting.firstTileX - Lighting.offScreenTiles; + Lighting.firstToLightY = Lighting.firstTileY - Lighting.offScreenTiles; + Lighting.lastToLightX = Lighting.lastTileX + Lighting.offScreenTiles; + Lighting.lastToLightY = Lighting.lastTileY + Lighting.offScreenTiles; + ++Lighting.lightCounter; + ++Main.renderCount; + int num4 = Main.screenWidth / 16 + Lighting.offScreenTiles * 2; + int num5 = Main.screenHeight / 16 + Lighting.offScreenTiles * 2; + Vector2 screenLastPosition = Main.screenLastPosition; + if (Main.renderCount < 3) + Lighting.doColors(); + if (Main.renderCount == 2) + { + Vector2 screenPosition = Main.screenPosition; + int num6 = (int) Math.Floor((double) Main.screenPosition.X / 16.0) - Lighting.scrX; + int num7 = (int) Math.Floor((double) Main.screenPosition.Y / 16.0) - Lighting.scrY; + if (num6 > 16) + num6 = 0; + if (num7 > 16) + num7 = 0; + int num8 = 0; + int num9 = num4; + int num10 = 0; + int num11 = num5; + if (num6 < 0) + num8 -= num6; + else + num9 -= num6; + if (num7 < 0) + num10 -= num7; + else + num11 -= num7; + if (Lighting.RGB) + { + int num12 = num4; + if (Lighting.states.Length <= num12 + num6) + num12 = Lighting.states.Length - num6 - 1; + for (int index1 = num8; index1 < num12; ++index1) + { + Lighting.LightingState[] state1 = Lighting.states[index1]; + Lighting.LightingState[] state2 = Lighting.states[index1 + num6]; + int num13 = num11; + if (state2.Length <= num13 + num6) + num13 = state2.Length - num7 - 1; + for (int index2 = num10; index2 < num13; ++index2) + { + Lighting.LightingState lightingState1 = state1[index2]; + Lighting.LightingState lightingState2 = state2[index2 + num7]; + lightingState1.r = lightingState2.r2; + lightingState1.g = lightingState2.g2; + lightingState1.b = lightingState2.b2; + } + } + } + else + { + int num14 = num9; + if (Lighting.states.Length <= num14 + num6) + num14 = Lighting.states.Length - num6 - 1; + for (int index3 = num8; index3 < num14; ++index3) + { + Lighting.LightingState[] state3 = Lighting.states[index3]; + Lighting.LightingState[] state4 = Lighting.states[index3 + num6]; + int num15 = num11; + if (state4.Length <= num15 + num6) + num15 = state4.Length - num7 - 1; + for (int index4 = num10; index4 < num15; ++index4) + { + Lighting.LightingState lightingState3 = state3[index4]; + Lighting.LightingState lightingState4 = state4[index4 + num7]; + lightingState3.r = lightingState4.r2; + lightingState3.g = lightingState4.r2; + lightingState3.b = lightingState4.r2; + } + } + } + } + else if (!Main.renderNow) + { + int num16 = (int) Math.Floor((double) Main.screenPosition.X / 16.0) - (int) Math.Floor((double) screenLastPosition.X / 16.0); + if (num16 > 5 || num16 < -5) + num16 = 0; + int num17; + int num18; + int num19; + if (num16 < 0) + { + num17 = -1; + num16 *= -1; + num18 = num4; + num19 = num16; + } + else + { + num17 = 1; + num18 = 0; + num19 = num4 - num16; + } + int num20 = (int) Math.Floor((double) Main.screenPosition.Y / 16.0) - (int) Math.Floor((double) screenLastPosition.Y / 16.0); + if (num20 > 5 || num20 < -5) + num20 = 0; + int num21; + int num22; + int num23; + if (num20 < 0) + { + num21 = -1; + num20 *= -1; + num22 = num5; + num23 = num20; + } + else + { + num21 = 1; + num22 = 0; + num23 = num5 - num20; + } + if (num16 != 0 || num20 != 0) + { + for (int index5 = num18; index5 != num19; index5 += num17) + { + Lighting.LightingState[] state5 = Lighting.states[index5]; + Lighting.LightingState[] state6 = Lighting.states[index5 + num16 * num17]; + for (int index6 = num22; index6 != num23; index6 += num21) + { + Lighting.LightingState lightingState5 = state5[index6]; + Lighting.LightingState lightingState6 = state6[index6 + num20 * num21]; + lightingState5.r = lightingState6.r; + lightingState5.g = lightingState6.g; + lightingState5.b = lightingState6.b; + } + } + } + if (Netplay.Connection.StatusMax > 0) + Main.mapTime = 1; + if (Main.mapTime == 0 && Main.mapEnabled) + { + if (Main.renderCount == 3) + { + try + { + Main.mapTime = Main.mapTimeMax; + Main.updateMap = true; + Main.mapMinX = Utils.Clamp(Lighting.firstToLightX + Lighting.offScreenTiles, 0, Main.maxTilesX - 1); + Main.mapMaxX = Utils.Clamp(Lighting.lastToLightX - Lighting.offScreenTiles, 0, Main.maxTilesX - 1); + Main.mapMinY = Utils.Clamp(Lighting.firstToLightY + Lighting.offScreenTiles, 0, Main.maxTilesY - 1); + Main.mapMaxY = Utils.Clamp(Lighting.lastToLightY - Lighting.offScreenTiles, 0, Main.maxTilesY - 1); + for (int mapMinX = Main.mapMinX; mapMinX < Main.mapMaxX; ++mapMinX) + { + Lighting.LightingState[] state = Lighting.states[mapMinX - Lighting.firstTileX + Lighting.offScreenTiles]; + for (int mapMinY = Main.mapMinY; mapMinY < Main.mapMaxY; ++mapMinY) + { + Lighting.LightingState lightingState = state[mapMinY - Lighting.firstTileY + Lighting.offScreenTiles]; + Tile tile = Main.tile[mapMinX, mapMinY]; + float num24 = 0.0f; + if ((double) lightingState.r > (double) num24) + num24 = lightingState.r; + if ((double) lightingState.g > (double) num24) + num24 = lightingState.g; + if ((double) lightingState.b > (double) num24) + num24 = lightingState.b; + if (Lighting.lightMode < 2) + num24 *= 1.5f; + byte light = (byte) Math.Min((float) byte.MaxValue, num24 * (float) byte.MaxValue); + if ((double) mapMinY < Main.worldSurface && !tile.active() && tile.wall == (byte) 0 && tile.liquid == (byte) 0) + light = (byte) 22; + if (light > (byte) 18 || Main.Map[mapMinX, mapMinY].Light > (byte) 0) + { + if (light < (byte) 22) + light = (byte) 22; + Main.Map.UpdateLighting(mapMinX, mapMinY, light); + } + } + } + } + catch + { + } + } + } + if ((double) Lighting.oldSkyColor != (double) Lighting.skyColor) + { + int num25 = Utils.Clamp(Lighting.firstToLightX, 0, Main.maxTilesX - 1); + int num26 = Utils.Clamp(Lighting.lastToLightX, 0, Main.maxTilesX - 1); + int num27 = Utils.Clamp(Lighting.firstToLightY, 0, Main.maxTilesY - 1); + int num28 = Utils.Clamp(Lighting.lastToLightY, 0, (int) Main.worldSurface - 1); + if ((double) num27 < Main.worldSurface) + { + for (int index7 = num25; index7 < num26; ++index7) + { + Lighting.LightingState[] state = Lighting.states[index7 - Lighting.firstToLightX]; + for (int index8 = num27; index8 < num28; ++index8) + { + Lighting.LightingState lightingState = state[index8 - Lighting.firstToLightY]; + Tile tile = Main.tile[index7, index8]; + if (tile == null) + { + tile = new Tile(); + Main.tile[index7, index8] = tile; + } + if ((!tile.active() || !Main.tileNoSunLight[(int) tile.type]) && (double) lightingState.r < (double) Lighting.skyColor && tile.liquid < (byte) 200 && (Main.wallLight[(int) tile.wall] || tile.wall == (byte) 73)) + { + lightingState.r = num1; + if ((double) lightingState.g < (double) Lighting.skyColor) + lightingState.g = num2; + if ((double) lightingState.b < (double) Lighting.skyColor) + lightingState.b = num3; + } + } + } + } + } + } + else + Lighting.lightCounter = 0; + if (Main.renderCount <= Lighting.maxRenderCount) return; - Lighting.GlobalBrightness = 1f; + Lighting.PreRenderPhase(); } - public static float Brightness(int x, int y) + public static void PreRenderPhase() { - Vector3 color = Lighting._activeEngine.GetColor(x, y); - return (float) ((double) Lighting.GlobalBrightness * ((double) color.X + (double) color.Y + (double) color.Z) / 3.0); + float num1 = (float) Main.tileColor.R / (float) byte.MaxValue; + float num2 = (float) Main.tileColor.G / (float) byte.MaxValue; + float num3 = (float) Main.tileColor.B / (float) byte.MaxValue; + Stopwatch stopwatch = new Stopwatch(); + stopwatch.Start(); + int num4 = 0; + int num5 = Main.screenWidth / 16 + Lighting.offScreenTiles * 2 + 10; + int num6 = 0; + int num7 = Main.screenHeight / 16 + Lighting.offScreenTiles * 2 + 10; + Lighting.minX = num5; + Lighting.maxX = num4; + Lighting.minY = num7; + Lighting.maxY = num6; + Lighting.RGB = Lighting.lightMode == 0 || Lighting.lightMode == 3; + for (int index1 = num4; index1 < num5; ++index1) + { + Lighting.LightingState[] state = Lighting.states[index1]; + for (int index2 = num6; index2 < num7; ++index2) + { + Lighting.LightingState lightingState = state[index2]; + lightingState.r2 = 0.0f; + lightingState.g2 = 0.0f; + lightingState.b2 = 0.0f; + lightingState.stopLight = false; + lightingState.wetLight = false; + lightingState.honeyLight = false; + } + } + if (Main.wof >= 0) + { + if (Main.player[Main.myPlayer].gross) + { + try + { + int num8 = (int) Main.screenPosition.Y / 16 - 10; + int num9 = (int) ((double) Main.screenPosition.Y + (double) Main.screenHeight) / 16 + 10; + int num10 = (int) Main.npc[Main.wof].position.X / 16; + int num11 = Main.npc[Main.wof].direction <= 0 ? num10 + 2 : num10 - 3; + int num12 = num11 + 8; + float num13 = (float) (0.5 * (double) Main.demonTorch + 1.0 * (1.0 - (double) Main.demonTorch)); + float num14 = 0.3f; + float num15 = (float) (1.0 * (double) Main.demonTorch + 0.5 * (1.0 - (double) Main.demonTorch)); + float num16 = num13 * 0.2f; + float num17 = num14 * 0.1f; + float num18 = num15 * 0.3f; + for (int index3 = num11; index3 <= num12; ++index3) + { + Lighting.LightingState[] state = Lighting.states[index3 - num11]; + for (int index4 = num8; index4 <= num9; ++index4) + { + Lighting.LightingState lightingState = state[index4 - Lighting.firstToLightY]; + if ((double) lightingState.r2 < (double) num16) + lightingState.r2 = num16; + if ((double) lightingState.g2 < (double) num17) + lightingState.g2 = num17; + if ((double) lightingState.b2 < (double) num18) + lightingState.b2 = num18; + } + } + } + catch + { + } + } + } + Main.sandTiles = 0; + Main.evilTiles = 0; + Main.bloodTiles = 0; + Main.shroomTiles = 0; + Main.snowTiles = 0; + Main.holyTiles = 0; + Main.meteorTiles = 0; + Main.jungleTiles = 0; + Main.dungeonTiles = 0; + Main.campfire = false; + Main.sunflower = false; + Main.starInBottle = false; + Main.heartLantern = false; + Main.campfire = false; + Main.clock = false; + Main.musicBox = -1; + Main.waterCandles = 0; + for (int index = 0; index < Main.player[Main.myPlayer].NPCBannerBuff.Length; ++index) + Main.player[Main.myPlayer].NPCBannerBuff[index] = false; + Main.player[Main.myPlayer].hasBanner = false; + int[] screenTileCounts = Main.screenTileCounts; + Array.Clear((Array) screenTileCounts, 0, screenTileCounts.Length); + int num19 = Utils.Clamp(Lighting.firstToLightX, 5, Main.maxTilesX - 1); + int num20 = Utils.Clamp(Lighting.lastToLightX, 5, Main.maxTilesX - 1); + int num21 = Utils.Clamp(Lighting.firstToLightY, 5, Main.maxTilesY - 1); + int num22 = Utils.Clamp(Lighting.lastToLightY, 5, Main.maxTilesY - 1); + int num23 = (num20 - num19 - Main.zoneX) / 2; + int num24 = (num22 - num21 - Main.zoneY) / 2; + Main.fountainColor = -1; + Main.monolithType = -1; + for (int index5 = num19; index5 < num20; ++index5) + { + Lighting.LightingState[] state = Lighting.states[index5 - Lighting.firstToLightX]; + for (int index6 = num21; index6 < num22; ++index6) + { + Lighting.LightingState lightingState = state[index6 - Lighting.firstToLightY]; + Tile tile = Main.tile[index5, index6]; + if (tile == null) + { + tile = new Tile(); + Main.tile[index5, index6] = tile; + } + float num25 = 0.0f; + float num26 = 0.0f; + float num27 = 0.0f; + if ((double) index6 < Main.worldSurface) + { + if ((!tile.active() || !Main.tileNoSunLight[(int) tile.type] || (tile.slope() != (byte) 0 || tile.halfBrick()) && Main.tile[index5, index6 - 1].liquid == (byte) 0 && Main.tile[index5, index6 + 1].liquid == (byte) 0 && Main.tile[index5 - 1, index6].liquid == (byte) 0 && Main.tile[index5 + 1, index6].liquid == (byte) 0) && (double) lightingState.r2 < (double) Lighting.skyColor && (Main.wallLight[(int) tile.wall] || tile.wall == (byte) 73 || tile.wall == (byte) 227) && tile.liquid < (byte) 200 && (!tile.halfBrick() || Main.tile[index5, index6 - 1].liquid < (byte) 200)) + { + num25 = num1; + num26 = num2; + num27 = num3; + } + if ((!tile.active() || tile.halfBrick() || !Main.tileNoSunLight[(int) tile.type]) && tile.wall >= (byte) 88 && tile.wall <= (byte) 93 && tile.liquid < byte.MaxValue) + { + num25 = num1; + num26 = num2; + num27 = num3; + switch (tile.wall) + { + case 88: + num25 *= 0.9f; + num26 *= 0.15f; + num27 *= 0.9f; + break; + case 89: + num25 *= 0.9f; + num26 *= 0.9f; + num27 *= 0.15f; + break; + case 90: + num25 *= 0.15f; + num26 *= 0.15f; + num27 *= 0.9f; + break; + case 91: + num25 *= 0.15f; + num26 *= 0.9f; + num27 *= 0.15f; + break; + case 92: + num25 *= 0.9f; + num26 *= 0.15f; + num27 *= 0.15f; + break; + case 93: + float num28 = 0.2f; + float num29 = 0.7f - num28; + num25 *= num29 + (float) Main.DiscoR / (float) byte.MaxValue * num28; + num26 *= num29 + (float) Main.DiscoG / (float) byte.MaxValue * num28; + num27 *= num29 + (float) Main.DiscoB / (float) byte.MaxValue * num28; + break; + } + } + if (!Lighting.RGB) + { + double num30; + num27 = (float) (num30 = ((double) num25 + (double) num26 + (double) num27) / 3.0); + num26 = (float) num30; + num25 = (float) num30; + } + if ((double) lightingState.r2 < (double) num25) + lightingState.r2 = num25; + if ((double) lightingState.g2 < (double) num26) + lightingState.g2 = num26; + if ((double) lightingState.b2 < (double) num27) + lightingState.b2 = num27; + } + float num31 = (float) (0.550000011920929 + Math.Sin((double) Main.GlobalTime * 2.0) * 0.0799999982118607); + if (index6 > Main.maxTilesY - 200) + { + if ((!tile.active() || !Main.tileNoSunLight[(int) tile.type] || (tile.slope() != (byte) 0 || tile.halfBrick()) && Main.tile[index5, index6 - 1].liquid == (byte) 0 && Main.tile[index5, index6 + 1].liquid == (byte) 0 && Main.tile[index5 - 1, index6].liquid == (byte) 0 && Main.tile[index5 + 1, index6].liquid == (byte) 0) && (double) lightingState.r2 < (double) num31 && (Main.wallLight[(int) tile.wall] || tile.wall == (byte) 73 || tile.wall == (byte) 227) && tile.liquid < (byte) 200 && (!tile.halfBrick() || Main.tile[index5, index6 - 1].liquid < (byte) 200)) + { + num25 = num31; + num26 = num31 * 0.6f; + num27 = num31 * 0.2f; + } + if ((!tile.active() || tile.halfBrick() || !Main.tileNoSunLight[(int) tile.type]) && tile.wall >= (byte) 88 && tile.wall <= (byte) 93 && tile.liquid < byte.MaxValue) + { + num25 = num31; + num26 = num31 * 0.6f; + num27 = num31 * 0.2f; + switch (tile.wall) + { + case 88: + num25 *= 0.9f; + num26 *= 0.15f; + num27 *= 0.9f; + break; + case 89: + num25 *= 0.9f; + num26 *= 0.9f; + num27 *= 0.15f; + break; + case 90: + num25 *= 0.15f; + num26 *= 0.15f; + num27 *= 0.9f; + break; + case 91: + num25 *= 0.15f; + num26 *= 0.9f; + num27 *= 0.15f; + break; + case 92: + num25 *= 0.9f; + num26 *= 0.15f; + num27 *= 0.15f; + break; + case 93: + float num32 = 0.2f; + float num33 = 0.7f - num32; + num25 *= num33 + (float) Main.DiscoR / (float) byte.MaxValue * num32; + num26 *= num33 + (float) Main.DiscoG / (float) byte.MaxValue * num32; + num27 *= num33 + (float) Main.DiscoB / (float) byte.MaxValue * num32; + break; + } + } + if (!Lighting.RGB) + { + double num34; + num27 = (float) (num34 = ((double) num25 + (double) num26 + (double) num27) / 3.0); + num26 = (float) num34; + num25 = (float) num34; + } + if ((double) lightingState.r2 < (double) num25) + lightingState.r2 = num25; + if ((double) lightingState.g2 < (double) num26) + lightingState.g2 = num26; + if ((double) lightingState.b2 < (double) num27) + lightingState.b2 = num27; + } + switch (tile.wall) + { + case 33: + if (!tile.active() || !Main.tileBlockLight[(int) tile.type]) + { + num25 = 0.09f; + num26 = 0.0525f; + num27 = 0.24f; + break; + } + break; + case 44: + if (!tile.active() || !Main.tileBlockLight[(int) tile.type]) + { + num25 = (float) ((double) Main.DiscoR / (double) byte.MaxValue * 0.150000005960464); + num26 = (float) ((double) Main.DiscoG / (double) byte.MaxValue * 0.150000005960464); + num27 = (float) ((double) Main.DiscoB / (double) byte.MaxValue * 0.150000005960464); + break; + } + break; + case 137: + if (!tile.active() || !Main.tileBlockLight[(int) tile.type]) + { + float num35 = 0.4f + (float) (270 - (int) Main.mouseTextColor) / 1500f + (float) Main.rand.Next(0, 50) * 0.0005f; + num25 = 1f * num35; + num26 = 0.5f * num35; + num27 = 0.1f * num35; + break; + } + break; + case 153: + num25 = 0.6f; + num26 = 0.3f; + break; + case 154: + num25 = 0.6f; + num27 = 0.6f; + break; + case 155: + num25 = 0.6f; + num26 = 0.6f; + num27 = 0.6f; + break; + case 156: + num26 = 0.6f; + break; + case 164: + num25 = 0.6f; + break; + case 165: + num27 = 0.6f; + break; + case 166: + num25 = 0.6f; + num26 = 0.6f; + break; + case 174: + if (!tile.active() || !Main.tileBlockLight[(int) tile.type]) + { + num25 = 0.2975f; + break; + } + break; + case 175: + if (!tile.active() || !Main.tileBlockLight[(int) tile.type]) + { + num25 = 0.075f; + num26 = 0.15f; + num27 = 0.4f; + break; + } + break; + case 176: + if (!tile.active() || !Main.tileBlockLight[(int) tile.type]) + { + num25 = 0.1f; + num26 = 0.1f; + num27 = 0.1f; + break; + } + break; + case 182: + if (!tile.active() || !Main.tileBlockLight[(int) tile.type]) + { + num25 = 0.24f; + num26 = 0.12f; + num27 = 0.09f; + break; + } + break; + } + if (tile.active()) + { + if (index5 > num19 + num23 && index5 < num20 - num23 && index6 > num21 + num24 && index6 < num22 - num24) + { + ++screenTileCounts[(int) tile.type]; + if (tile.type == (ushort) 215 && tile.frameY < (short) 36) + Main.campfire = true; + if (tile.type == (ushort) 405) + Main.campfire = true; + if (tile.type == (ushort) 42 && tile.frameY >= (short) 324 && tile.frameY <= (short) 358) + Main.heartLantern = true; + if (tile.type == (ushort) 42 && tile.frameY >= (short) 252 && tile.frameY <= (short) 286) + Main.starInBottle = true; + if (tile.type == (ushort) 91 && (tile.frameX >= (short) 396 || tile.frameY >= (short) 54)) + { + int banner = (int) tile.frameX / 18 - 21; + for (int frameY = (int) tile.frameY; frameY >= 54; frameY -= 54) + banner = banner + 90 + 21; + int index7 = Item.BannerToItem(banner); + if (ItemID.Sets.BannerStrength[index7].Enabled) + { + Main.player[Main.myPlayer].NPCBannerBuff[banner] = true; + Main.player[Main.myPlayer].hasBanner = true; + } + } + } + switch (tile.type) + { + case 139: + if (tile.frameX >= (short) 36) + { + Main.musicBox = (int) tile.frameY / 36; + break; + } + break; + case 207: + if (tile.frameY >= (short) 72) + { + switch ((int) tile.frameX / 36) + { + case 0: + Main.fountainColor = 0; + break; + case 1: + Main.fountainColor = 6; + break; + case 2: + Main.fountainColor = 3; + break; + case 3: + Main.fountainColor = 5; + break; + case 4: + Main.fountainColor = 2; + break; + case 5: + Main.fountainColor = 10; + break; + case 6: + Main.fountainColor = 4; + break; + case 7: + Main.fountainColor = 9; + break; + default: + Main.fountainColor = -1; + break; + } + } + else + break; + break; + case 410: + if (tile.frameY >= (short) 56) + { + Main.monolithType = (int) tile.frameX / 36; + break; + } + break; + } + if (Main.tileBlockLight[(int) tile.type] && (Lighting.lightMode >= 2 || tile.type != (ushort) 131 && !tile.inActive() && tile.slope() == (byte) 0)) + lightingState.stopLight = true; + if (tile.type == (ushort) 104) + Main.clock = true; + if (Main.tileLighted[(int) tile.type]) + { + switch (tile.type) + { + case 4: + if (tile.frameX < (short) 66) + { + switch ((int) tile.frameY / 22) + { + case 0: + num25 = 1f; + num26 = 0.95f; + num27 = 0.8f; + break; + case 1: + num25 = 0.0f; + num26 = 0.1f; + num27 = 1.3f; + break; + case 2: + num25 = 1f; + num26 = 0.1f; + num27 = 0.1f; + break; + case 3: + num25 = 0.0f; + num26 = 1f; + num27 = 0.1f; + break; + case 4: + num25 = 0.9f; + num26 = 0.0f; + num27 = 0.9f; + break; + case 5: + num25 = 1.3f; + num26 = 1.3f; + num27 = 1.3f; + break; + case 6: + num25 = 0.9f; + num26 = 0.9f; + num27 = 0.0f; + break; + case 7: + num25 = (float) (0.5 * (double) Main.demonTorch + 1.0 * (1.0 - (double) Main.demonTorch)); + num26 = 0.3f; + num27 = (float) (1.0 * (double) Main.demonTorch + 0.5 * (1.0 - (double) Main.demonTorch)); + break; + case 8: + num25 = 0.85f; + num26 = 1f; + num27 = 0.7f; + break; + case 9: + num25 = 0.7f; + num26 = 0.85f; + num27 = 1f; + break; + case 10: + num25 = 1f; + num26 = 0.5f; + num27 = 0.0f; + break; + case 11: + num25 = 1.25f; + num26 = 1.25f; + num27 = 0.8f; + break; + case 12: + num25 = 0.75f; + num26 = 1.2825f; + num27 = 1.2f; + break; + case 13: + num25 = 0.95f; + num26 = 0.65f; + num27 = 1.3f; + break; + case 14: + num25 = (float) Main.DiscoR / (float) byte.MaxValue; + num26 = (float) Main.DiscoG / (float) byte.MaxValue; + num27 = (float) Main.DiscoB / (float) byte.MaxValue; + break; + case 15: + num25 = 1f; + num26 = 0.0f; + num27 = 1f; + break; + default: + num25 = 1f; + num26 = 0.95f; + num27 = 0.8f; + break; + } + } + else + break; + break; + case 17: + case 133: + case 302: + num25 = 0.83f; + num26 = 0.6f; + num27 = 0.5f; + break; + case 22: + case 140: + num25 = 0.12f; + num26 = 0.07f; + num27 = 0.32f; + break; + case 26: + case 31: + if (tile.type == (ushort) 31 && tile.frameX >= (short) 36 || tile.type == (ushort) 26 && tile.frameX >= (short) 54) + { + float num36 = (float) Main.rand.Next(-5, 6) * (1f / 400f); + num25 = (float) (0.5 + (double) num36 * 2.0); + num26 = 0.2f + num36; + num27 = 0.1f; + break; + } + float num37 = (float) Main.rand.Next(-5, 6) * (1f / 400f); + num25 = 0.31f + num37; + num26 = 0.1f; + num27 = (float) (0.439999997615814 + (double) num37 * 2.0); + break; + case 27: + if (tile.frameY < (short) 36) + { + num25 = 0.3f; + num26 = 0.27f; + break; + } + break; + case 33: + if (tile.frameX == (short) 0) + { + switch ((int) tile.frameY / 22) + { + case 0: + num25 = 1f; + num26 = 0.95f; + num27 = 0.65f; + break; + case 1: + num25 = 0.55f; + num26 = 0.85f; + num27 = 0.35f; + break; + case 2: + num25 = 0.65f; + num26 = 0.95f; + num27 = 0.5f; + break; + case 3: + num25 = 0.2f; + num26 = 0.75f; + num27 = 1f; + break; + case 14: + num25 = 1f; + num26 = 1f; + num27 = 0.6f; + break; + case 19: + num25 = 0.37f; + num26 = 0.8f; + num27 = 1f; + break; + case 20: + num25 = 0.0f; + num26 = 0.9f; + num27 = 1f; + break; + case 21: + num25 = 0.25f; + num26 = 0.7f; + num27 = 1f; + break; + case 25: + num25 = (float) (0.5 * (double) Main.demonTorch + 1.0 * (1.0 - (double) Main.demonTorch)); + num26 = 0.3f; + num27 = (float) (1.0 * (double) Main.demonTorch + 0.5 * (1.0 - (double) Main.demonTorch)); + break; + case 28: + num25 = 0.9f; + num26 = 0.75f; + num27 = 1f; + break; + case 30: + Vector3 vector3_1 = Main.hslToRgb((float) ((double) Main.demonTorch * 0.119999997317791 + 0.689999997615814), 1f, 0.75f).ToVector3() * 1.2f; + num25 = vector3_1.X; + num26 = vector3_1.Y; + num27 = vector3_1.Z; + break; + default: + num25 = 1f; + num26 = 0.95f; + num27 = 0.65f; + break; + } + } + else + break; + break; + case 34: + if ((int) tile.frameX % 108 < 54) + { + switch ((int) tile.frameY / 54 + 37 * ((int) tile.frameX / 108)) + { + case 7: + num25 = 0.95f; + num26 = 0.95f; + num27 = 0.5f; + break; + case 8: + num25 = 0.85f; + num26 = 0.6f; + num27 = 1f; + break; + case 9: + num25 = 1f; + num26 = 0.6f; + num27 = 0.6f; + break; + case 11: + case 17: + num25 = 0.75f; + num26 = 0.9f; + num27 = 1f; + break; + case 15: + num25 = 1f; + num26 = 1f; + num27 = 0.7f; + break; + case 18: + num25 = 1f; + num26 = 1f; + num27 = 0.6f; + break; + case 24: + num25 = 0.37f; + num26 = 0.8f; + num27 = 1f; + break; + case 25: + num25 = 0.0f; + num26 = 0.9f; + num27 = 1f; + break; + case 26: + num25 = 0.25f; + num26 = 0.7f; + num27 = 1f; + break; + case 27: + num25 = 0.55f; + num26 = 0.85f; + num27 = 0.35f; + break; + case 28: + num25 = 0.65f; + num26 = 0.95f; + num27 = 0.5f; + break; + case 29: + num25 = 0.2f; + num26 = 0.75f; + num27 = 1f; + break; + case 32: + num25 = (float) (0.5 * (double) Main.demonTorch + 1.0 * (1.0 - (double) Main.demonTorch)); + num26 = 0.3f; + num27 = (float) (1.0 * (double) Main.demonTorch + 0.5 * (1.0 - (double) Main.demonTorch)); + break; + case 35: + num25 = 0.9f; + num26 = 0.75f; + num27 = 1f; + break; + case 37: + Vector3 vector3_2 = Main.hslToRgb((float) ((double) Main.demonTorch * 0.119999997317791 + 0.689999997615814), 1f, 0.75f).ToVector3() * 1.2f; + num25 = vector3_2.X; + num26 = vector3_2.Y; + num27 = vector3_2.Z; + break; + default: + num25 = 1f; + num26 = 0.95f; + num27 = 0.8f; + break; + } + } + else + break; + break; + case 35: + if (tile.frameX < (short) 36) + { + num25 = 0.75f; + num26 = 0.6f; + num27 = 0.3f; + break; + } + break; + case 37: + num25 = 0.56f; + num26 = 0.43f; + num27 = 0.15f; + break; + case 42: + if (tile.frameX == (short) 0) + { + switch ((int) tile.frameY / 36) + { + case 0: + num25 = 0.7f; + num26 = 0.65f; + num27 = 0.55f; + break; + case 1: + num25 = 0.9f; + num26 = 0.75f; + num27 = 0.6f; + break; + case 2: + num25 = 0.8f; + num26 = 0.6f; + num27 = 0.6f; + break; + case 3: + num25 = 0.65f; + num26 = 0.5f; + num27 = 0.2f; + break; + case 4: + num25 = 0.5f; + num26 = 0.7f; + num27 = 0.4f; + break; + case 5: + num25 = 0.9f; + num26 = 0.4f; + num27 = 0.2f; + break; + case 6: + num25 = 0.7f; + num26 = 0.75f; + num27 = 0.3f; + break; + case 7: + float num38 = Main.demonTorch * 0.2f; + num25 = 0.9f - num38; + num26 = 0.9f - num38; + num27 = 0.7f + num38; + break; + case 8: + num25 = 0.75f; + num26 = 0.6f; + num27 = 0.3f; + break; + case 9: + float num39 = 1f; + float num40 = 0.3f; + num27 = 0.5f + Main.demonTorch * 0.2f; + num25 = num39 - Main.demonTorch * 0.1f; + num26 = num40 - Main.demonTorch * 0.2f; + break; + case 28: + num25 = 0.37f; + num26 = 0.8f; + num27 = 1f; + break; + case 29: + num25 = 0.0f; + num26 = 0.9f; + num27 = 1f; + break; + case 30: + num25 = 0.25f; + num26 = 0.7f; + num27 = 1f; + break; + case 32: + num25 = (float) (0.5 * (double) Main.demonTorch + 1.0 * (1.0 - (double) Main.demonTorch)); + num26 = 0.3f; + num27 = (float) (1.0 * (double) Main.demonTorch + 0.5 * (1.0 - (double) Main.demonTorch)); + break; + case 35: + num25 = 0.7f; + num26 = 0.6f; + num27 = 0.9f; + break; + case 37: + Vector3 vector3_3 = Main.hslToRgb((float) ((double) Main.demonTorch * 0.119999997317791 + 0.689999997615814), 1f, 0.75f).ToVector3() * 1.2f; + num25 = vector3_3.X; + num26 = vector3_3.Y; + num27 = vector3_3.Z; + break; + default: + num25 = 1f; + num26 = 1f; + num27 = 1f; + break; + } + } + else + break; + break; + case 49: + num25 = 0.0f; + num26 = 0.35f; + num27 = 0.8f; + break; + case 61: + if (tile.frameX == (short) 144) + { + float num41 = (float) (1.0 + (double) (270 - (int) Main.mouseTextColor) / 400.0); + float num42 = (float) (0.800000011920929 - (double) (270 - (int) Main.mouseTextColor) / 400.0); + num25 = 0.42f * num42; + num26 = 0.81f * num41; + num27 = 0.52f * num42; + break; + } + break; + case 70: + case 71: + case 72: + case 190: + case 348: + case 349: + if (tile.type != (ushort) 349 || tile.frameX >= (short) 36) + { + float num43 = (float) Main.rand.Next(28, 42) * 0.005f + (float) (270 - (int) Main.mouseTextColor) / 1000f; + num25 = 0.1f; + num26 = (float) (0.200000002980232 + (double) num43 / 2.0); + num27 = 0.7f + num43; + break; + } + break; + case 77: + num25 = 0.75f; + num26 = 0.45f; + num27 = 0.25f; + break; + case 83: + if (tile.frameX == (short) 18 && !Main.dayTime) + { + num25 = 0.1f; + num26 = 0.4f; + num27 = 0.6f; + } + if (tile.frameX == (short) 90 && !Main.raining && Main.time > 40500.0) + { + num25 = 0.9f; + num26 = 0.72f; + num27 = 0.18f; + break; + } + break; + case 84: + switch ((int) tile.frameX / 18) + { + case 2: + float num44 = (float) (270 - (int) Main.mouseTextColor) / 800f; + if ((double) num44 > 1.0) + num44 = 1f; + else if ((double) num44 < 0.0) + num44 = 0.0f; + num25 = num44 * 0.7f; + num26 = num44; + num27 = num44 * 0.1f; + break; + case 5: + float num45 = 0.9f; + num25 = num45; + num26 = num45 * 0.8f; + num27 = num45 * 0.2f; + break; + case 6: + float num46 = 0.08f; + num26 = num46 * 0.8f; + num27 = num46; + break; + } + break; + case 92: + if (tile.frameY <= (short) 18 && tile.frameX == (short) 0) + { + num25 = 1f; + num26 = 1f; + num27 = 1f; + break; + } + break; + case 93: + if (tile.frameX == (short) 0) + { + switch ((int) tile.frameY / 54) + { + case 1: + num25 = 0.95f; + num26 = 0.95f; + num27 = 0.5f; + break; + case 2: + num25 = 0.85f; + num26 = 0.6f; + num27 = 1f; + break; + case 3: + num25 = 0.75f; + num26 = 1f; + num27 = 0.6f; + break; + case 4: + case 5: + num25 = 0.75f; + num26 = 0.9f; + num27 = 1f; + break; + case 9: + num25 = 1f; + num26 = 1f; + num27 = 0.7f; + break; + case 13: + num25 = 1f; + num26 = 1f; + num27 = 0.6f; + break; + case 19: + num25 = 0.37f; + num26 = 0.8f; + num27 = 1f; + break; + case 20: + num25 = 0.0f; + num26 = 0.9f; + num27 = 1f; + break; + case 21: + num25 = 0.25f; + num26 = 0.7f; + num27 = 1f; + break; + case 23: + num25 = (float) (0.5 * (double) Main.demonTorch + 1.0 * (1.0 - (double) Main.demonTorch)); + num26 = 0.3f; + num27 = (float) (1.0 * (double) Main.demonTorch + 0.5 * (1.0 - (double) Main.demonTorch)); + break; + case 24: + num25 = 0.35f; + num26 = 0.5f; + num27 = 0.3f; + break; + case 25: + num25 = 0.34f; + num26 = 0.4f; + num27 = 0.31f; + break; + case 26: + num25 = 0.25f; + num26 = 0.32f; + num27 = 0.5f; + break; + case 29: + num25 = 0.9f; + num26 = 0.75f; + num27 = 1f; + break; + case 31: + Vector3 vector3_4 = Main.hslToRgb((float) ((double) Main.demonTorch * 0.119999997317791 + 0.689999997615814), 1f, 0.75f).ToVector3() * 1.2f; + num25 = vector3_4.X; + num26 = vector3_4.Y; + num27 = vector3_4.Z; + break; + default: + num25 = 1f; + num26 = 0.97f; + num27 = 0.85f; + break; + } + } + else + break; + break; + case 95: + if (tile.frameX < (short) 36) + { + num25 = 1f; + num26 = 0.95f; + num27 = 0.8f; + break; + } + break; + case 96: + if (tile.frameX >= (short) 36) + { + num25 = 0.5f; + num26 = 0.35f; + num27 = 0.1f; + break; + } + break; + case 98: + if (tile.frameY == (short) 0) + { + num25 = 1f; + num26 = 0.97f; + num27 = 0.85f; + break; + } + break; + case 100: + case 173: + if (tile.frameX < (short) 36) + { + switch ((int) tile.frameY / 36) + { + case 1: + num25 = 0.95f; + num26 = 0.95f; + num27 = 0.5f; + break; + case 3: + num25 = 1f; + num26 = 0.6f; + num27 = 0.6f; + break; + case 6: + case 9: + num25 = 0.75f; + num26 = 0.9f; + num27 = 1f; + break; + case 11: + num25 = 1f; + num26 = 1f; + num27 = 0.7f; + break; + case 13: + num25 = 1f; + num26 = 1f; + num27 = 0.6f; + break; + case 19: + num25 = 0.37f; + num26 = 0.8f; + num27 = 1f; + break; + case 20: + num25 = 0.0f; + num26 = 0.9f; + num27 = 1f; + break; + case 21: + num25 = 0.25f; + num26 = 0.7f; + num27 = 1f; + break; + case 22: + num25 = 0.35f; + num26 = 0.5f; + num27 = 0.3f; + break; + case 23: + num25 = 0.34f; + num26 = 0.4f; + num27 = 0.31f; + break; + case 24: + num25 = 0.25f; + num26 = 0.32f; + num27 = 0.5f; + break; + case 25: + num25 = (float) (0.5 * (double) Main.demonTorch + 1.0 * (1.0 - (double) Main.demonTorch)); + num26 = 0.3f; + num27 = (float) (1.0 * (double) Main.demonTorch + 0.5 * (1.0 - (double) Main.demonTorch)); + break; + case 29: + num25 = 0.9f; + num26 = 0.75f; + num27 = 1f; + break; + case 31: + Vector3 vector3_5 = Main.hslToRgb((float) ((double) Main.demonTorch * 0.119999997317791 + 0.689999997615814), 1f, 0.75f).ToVector3() * 1.2f; + num25 = vector3_5.X; + num26 = vector3_5.Y; + num27 = vector3_5.Z; + break; + default: + num25 = 1f; + num26 = 0.95f; + num27 = 0.65f; + break; + } + } + else + break; + break; + case 125: + float num47 = (float) Main.rand.Next(28, 42) * 0.01f + (float) (270 - (int) Main.mouseTextColor) / 800f; + num26 = lightingState.g2 = 0.3f * num47; + num27 = lightingState.b2 = 0.6f * num47; + break; + case 126: + if (tile.frameX < (short) 36) + { + num25 = (float) Main.DiscoR / (float) byte.MaxValue; + num26 = (float) Main.DiscoG / (float) byte.MaxValue; + num27 = (float) Main.DiscoB / (float) byte.MaxValue; + break; + } + break; + case 129: + switch ((int) tile.frameX / 18 % 3) + { + case 0: + num25 = 0.0f; + num26 = 0.05f; + num27 = 0.25f; + break; + case 1: + num25 = 0.2f; + num26 = 0.0f; + num27 = 0.15f; + break; + case 2: + num25 = 0.1f; + num26 = 0.0f; + num27 = 0.2f; + break; + } + break; + case 149: + if (tile.frameX <= (short) 36) + { + switch ((int) tile.frameX / 18) + { + case 0: + num25 = 0.1f; + num26 = 0.2f; + num27 = 0.5f; + break; + case 1: + num25 = 0.5f; + num26 = 0.1f; + num27 = 0.1f; + break; + case 2: + num25 = 0.2f; + num26 = 0.5f; + num27 = 0.1f; + break; + } + num25 *= (float) Main.rand.Next(970, 1031) * (1f / 1000f); + num26 *= (float) Main.rand.Next(970, 1031) * (1f / 1000f); + num27 *= (float) Main.rand.Next(970, 1031) * (1f / 1000f); + break; + } + break; + case 160: + num25 = (float) ((double) Main.DiscoR / (double) byte.MaxValue * 0.25); + num26 = (float) ((double) Main.DiscoG / (double) byte.MaxValue * 0.25); + num27 = (float) ((double) Main.DiscoB / (double) byte.MaxValue * 0.25); + break; + case 171: + int index8 = index5; + int index9 = index6; + if (tile.frameX < (short) 10) + { + index8 -= (int) tile.frameX; + index9 -= (int) tile.frameY; + } + switch (((int) Main.tile[index8, index9].frameY & 15360) >> 10) + { + case 1: + num25 = 0.1f; + num26 = 0.1f; + num27 = 0.1f; + break; + case 2: + num25 = 0.2f; + break; + case 3: + num26 = 0.2f; + break; + case 4: + num27 = 0.2f; + break; + case 5: + num25 = 0.125f; + num26 = 0.125f; + break; + case 6: + num25 = 0.2f; + num26 = 0.1f; + break; + case 7: + num25 = 0.125f; + num26 = 0.125f; + break; + case 8: + num25 = 0.08f; + num26 = 0.175f; + break; + case 9: + num26 = 0.125f; + num27 = 0.125f; + break; + case 10: + num25 = 0.125f; + num27 = 0.125f; + break; + case 11: + num25 = 0.1f; + num26 = 0.1f; + num27 = 0.2f; + break; + default: + double num48; + num27 = (float) (num48 = 0.0); + num26 = (float) num48; + num25 = (float) num48; + break; + } + num25 *= 0.5f; + num26 *= 0.5f; + num27 *= 0.5f; + break; + case 174: + if (tile.frameX == (short) 0) + { + num25 = 1f; + num26 = 0.95f; + num27 = 0.65f; + break; + } + break; + case 184: + if (tile.frameX == (short) 110) + { + num25 = 0.25f; + num26 = 0.1f; + num27 = 0.0f; + break; + } + break; + case 204: + case 347: + num25 = 0.35f; + break; + case 209: + if (tile.frameX == (short) 234 || tile.frameX == (short) 252) + { + Vector3 vector3_6 = PortalHelper.GetPortalColor(Main.myPlayer, 0).ToVector3() * 0.65f; + num25 = vector3_6.X; + num26 = vector3_6.Y; + num27 = vector3_6.Z; + break; + } + if (tile.frameX == (short) 306 || tile.frameX == (short) 324) + { + Vector3 vector3_7 = PortalHelper.GetPortalColor(Main.myPlayer, 1).ToVector3() * 0.65f; + num25 = vector3_7.X; + num26 = vector3_7.Y; + num27 = vector3_7.Z; + break; + } + break; + case 215: + if (tile.frameY < (short) 36) + { + float num49 = (float) Main.rand.Next(28, 42) * 0.005f + (float) (270 - (int) Main.mouseTextColor) / 700f; + float num50; + float num51; + float num52; + switch ((int) tile.frameX / 54) + { + case 1: + num50 = 0.7f; + num51 = 1f; + num52 = 0.5f; + break; + case 2: + num50 = (float) (0.5 * (double) Main.demonTorch + 1.0 * (1.0 - (double) Main.demonTorch)); + num51 = 0.3f; + num52 = (float) (1.0 * (double) Main.demonTorch + 0.5 * (1.0 - (double) Main.demonTorch)); + break; + case 3: + num50 = 0.45f; + num51 = 0.75f; + num52 = 1f; + break; + case 4: + num50 = 1.15f; + num51 = 1.15f; + num52 = 0.5f; + break; + case 5: + num50 = (float) Main.DiscoR / (float) byte.MaxValue; + num51 = (float) Main.DiscoG / (float) byte.MaxValue; + num52 = (float) Main.DiscoB / (float) byte.MaxValue; + break; + case 6: + num50 = 0.75f; + num51 = 1.2825f; + num52 = 1.2f; + break; + case 7: + num50 = 0.95f; + num51 = 0.65f; + num52 = 1.3f; + break; + default: + num50 = 0.9f; + num51 = 0.3f; + num52 = 0.1f; + break; + } + num25 = num50 + num49; + num26 = num51 + num49; + num27 = num52 + num49; + break; + } + break; + case 235: + if ((double) lightingState.r2 < 0.6) + lightingState.r2 = 0.6f; + if ((double) lightingState.g2 < 0.6) + { + lightingState.g2 = 0.6f; + break; + } + break; + case 237: + num25 = 0.1f; + num26 = 0.1f; + break; + case 238: + if ((double) lightingState.r2 < 0.5) + lightingState.r2 = 0.5f; + if ((double) lightingState.b2 < 0.5) + { + lightingState.b2 = 0.5f; + break; + } + break; + case 262: + num25 = 0.75f; + num27 = 0.75f; + break; + case 263: + num25 = 0.75f; + num26 = 0.75f; + break; + case 264: + num27 = 0.75f; + break; + case 265: + num26 = 0.75f; + break; + case 266: + num25 = 0.75f; + break; + case 267: + num25 = 0.75f; + num26 = 0.75f; + num27 = 0.75f; + break; + case 268: + num25 = 0.75f; + num26 = 0.375f; + break; + case 270: + num25 = 0.73f; + num26 = 1f; + num27 = 0.41f; + break; + case 271: + num25 = 0.45f; + num26 = 0.95f; + num27 = 1f; + break; + case 286: + num25 = 0.1f; + num26 = 0.2f; + num27 = 0.7f; + break; + case 316: + case 317: + case 318: + int index10 = (index5 - (int) tile.frameX / 18) / 2 * ((index6 - (int) tile.frameY / 18) / 3) % Main.cageFrames; + bool flag1 = Main.jellyfishCageMode[(int) tile.type - 316, index10] == (byte) 2; + if (tile.type == (ushort) 316) + { + if (flag1) + { + num25 = 0.2f; + num26 = 0.3f; + num27 = 0.8f; + } + else + { + num25 = 0.1f; + num26 = 0.2f; + num27 = 0.5f; + } + } + if (tile.type == (ushort) 317) + { + if (flag1) + { + num25 = 0.2f; + num26 = 0.7f; + num27 = 0.3f; + } + else + { + num25 = 0.05f; + num26 = 0.45f; + num27 = 0.1f; + } + } + if (tile.type == (ushort) 318) + { + if (flag1) + { + num25 = 0.7f; + num26 = 0.2f; + num27 = 0.5f; + break; + } + num25 = 0.4f; + num26 = 0.1f; + num27 = 0.25f; + break; + } + break; + case 327: + float num53 = 0.5f + (float) (270 - (int) Main.mouseTextColor) / 1500f + (float) Main.rand.Next(0, 50) * 0.0005f; + num25 = 1f * num53; + num26 = 0.5f * num53; + num27 = 0.1f * num53; + break; + case 336: + num25 = 0.85f; + num26 = 0.5f; + num27 = 0.3f; + break; + case 340: + num25 = 0.45f; + num26 = 1f; + num27 = 0.45f; + break; + case 341: + num25 = (float) (0.400000005960464 * (double) Main.demonTorch + 0.600000023841858 * (1.0 - (double) Main.demonTorch)); + num26 = 0.35f; + num27 = (float) (1.0 * (double) Main.demonTorch + 0.600000023841858 * (1.0 - (double) Main.demonTorch)); + break; + case 342: + num25 = 0.5f; + num26 = 0.5f; + num27 = 1.1f; + break; + case 343: + num25 = 0.85f; + num26 = 0.85f; + num27 = 0.3f; + break; + case 344: + num25 = 0.6f; + num26 = 1.026f; + num27 = 0.96f; + break; + case 350: + double num54 = Main.time * 0.08; + double num55; + num25 = (float) (num55 = -Math.Cos((int) (num54 / 6.283) % 3 == 1 ? num54 : 0.0) * 0.1 + 0.1); + num26 = (float) num55; + num27 = (float) num55; + break; + case 370: + num25 = 0.32f; + num26 = 0.16f; + num27 = 0.12f; + break; + case 372: + if (tile.frameX == (short) 0) + { + num25 = 0.9f; + num26 = 0.1f; + num27 = 0.75f; + break; + } + break; + case 381: + num25 = 0.25f; + num26 = 0.1f; + num27 = 0.0f; + break; + case 390: + num25 = 0.4f; + num26 = 0.2f; + num27 = 0.1f; + break; + case 391: + num25 = 0.3f; + num26 = 0.1f; + num27 = 0.25f; + break; + case 405: + if (tile.frameX < (short) 54) + { + float num56 = (float) Main.rand.Next(28, 42) * 0.005f + (float) (270 - (int) Main.mouseTextColor) / 700f; + float num57; + float num58; + float num59; + switch ((int) tile.frameX / 54) + { + case 1: + num57 = 0.7f; + num58 = 1f; + num59 = 0.5f; + break; + case 2: + num57 = (float) (0.5 * (double) Main.demonTorch + 1.0 * (1.0 - (double) Main.demonTorch)); + num58 = 0.3f; + num59 = (float) (1.0 * (double) Main.demonTorch + 0.5 * (1.0 - (double) Main.demonTorch)); + break; + case 3: + num57 = 0.45f; + num58 = 0.75f; + num59 = 1f; + break; + case 4: + num57 = 1.15f; + num58 = 1.15f; + num59 = 0.5f; + break; + case 5: + num57 = (float) Main.DiscoR / (float) byte.MaxValue; + num58 = (float) Main.DiscoG / (float) byte.MaxValue; + num59 = (float) Main.DiscoB / (float) byte.MaxValue; + break; + default: + num57 = 0.9f; + num58 = 0.3f; + num59 = 0.1f; + break; + } + num25 = num57 + num56; + num26 = num58 + num56; + num27 = num59 + num56; + break; + } + break; + case 415: + num25 = 0.7f; + num26 = 0.5f; + num27 = 0.1f; + break; + case 416: + num25 = 0.0f; + num26 = 0.6f; + num27 = 0.7f; + break; + case 417: + num25 = 0.6f; + num26 = 0.2f; + num27 = 0.6f; + break; + case 418: + num25 = 0.6f; + num26 = 0.6f; + num27 = 0.9f; + break; + case 429: + int num60 = (int) tile.frameX / 18; + bool flag2 = num60 % 2 >= 1; + bool flag3 = num60 % 4 >= 2; + bool flag4 = num60 % 8 >= 4; + int num61 = num60 % 16 >= 8 ? 1 : 0; + if (flag2) + num25 += 0.5f; + if (flag3) + num26 += 0.5f; + if (flag4) + num27 += 0.5f; + if (num61 != 0) + { + num25 += 0.2f; + num26 += 0.2f; + break; + } + break; + case 463: + num25 = 0.2f; + num26 = 0.4f; + num27 = 0.8f; + break; + } + } + } + if (Lighting.RGB) + { + if ((double) lightingState.r2 < (double) num25) + lightingState.r2 = num25; + if ((double) lightingState.g2 < (double) num26) + lightingState.g2 = num26; + if ((double) lightingState.b2 < (double) num27) + lightingState.b2 = num27; + } + else + { + float num62 = (float) (((double) num25 + (double) num26 + (double) num27) / 3.0); + if ((double) lightingState.r2 < (double) num62) + lightingState.r2 = num62; + } + if (tile.lava() && tile.liquid > (byte) 0) + { + if (Lighting.RGB) + { + float num63 = (float) ((double) ((int) tile.liquid / (int) byte.MaxValue) * 0.409999996423721 + 0.140000000596046); + float num64 = 0.55f + (float) (270 - (int) Main.mouseTextColor) / 900f; + if ((double) lightingState.r2 < (double) num64) + lightingState.r2 = num64; + if ((double) lightingState.g2 < (double) num64) + lightingState.g2 = num64 * 0.6f; + if ((double) lightingState.b2 < (double) num64) + lightingState.b2 = num64 * 0.2f; + } + else + { + float num65 = (float) ((double) ((int) tile.liquid / (int) byte.MaxValue) * 0.379999995231628 + 0.0799999982118607) + (float) (270 - (int) Main.mouseTextColor) / 2000f; + if ((double) lightingState.r2 < (double) num65) + lightingState.r2 = num65; + } + } + else if (tile.liquid > (byte) 128) + { + lightingState.wetLight = true; + if (tile.honey()) + lightingState.honeyLight = true; + } + if ((double) lightingState.r2 > 0.0 || Lighting.RGB && ((double) lightingState.g2 > 0.0 || (double) lightingState.b2 > 0.0)) + { + int num66 = index5 - Lighting.firstToLightX; + int num67 = index6 - Lighting.firstToLightY; + if (Lighting.minX > num66) + Lighting.minX = num66; + if (Lighting.maxX < num66 + 1) + Lighting.maxX = num66 + 1; + if (Lighting.minY > num67) + Lighting.minY = num67; + if (Lighting.maxY < num67 + 1) + Lighting.maxY = num67 + 1; + } + } + } + foreach (KeyValuePair tempLight in Lighting.tempLights) + { + int index11 = (int) tempLight.Key.X - Lighting.firstTileX + Lighting.offScreenTiles; + int index12 = (int) tempLight.Key.Y - Lighting.firstTileY + Lighting.offScreenTiles; + if (index11 >= 0 && index11 < Main.screenWidth / 16 + Lighting.offScreenTiles * 2 + 10 && index12 >= 0 && index12 < Main.screenHeight / 16 + Lighting.offScreenTiles * 2 + 10) + { + Lighting.LightingState lightingState = Lighting.states[index11][index12]; + if ((double) lightingState.r2 < (double) tempLight.Value.r) + lightingState.r2 = tempLight.Value.r; + if ((double) lightingState.g2 < (double) tempLight.Value.g) + lightingState.g2 = tempLight.Value.g; + if ((double) lightingState.b2 < (double) tempLight.Value.b) + lightingState.b2 = tempLight.Value.b; + if (Lighting.minX > index11) + Lighting.minX = index11; + if (Lighting.maxX < index11 + 1) + Lighting.maxX = index11 + 1; + if (Lighting.minY > index12) + Lighting.minY = index12; + if (Lighting.maxY < index12 + 1) + Lighting.maxY = index12 + 1; + } + } + if (!Main.gamePaused) + Lighting.tempLights.Clear(); + if (screenTileCounts[27] > 0) + Main.sunflower = true; + Main.holyTiles = screenTileCounts[109] + screenTileCounts[110] + screenTileCounts[113] + screenTileCounts[117] + screenTileCounts[116] + screenTileCounts[164] + screenTileCounts[403] + screenTileCounts[402]; + Main.evilTiles = screenTileCounts[23] + screenTileCounts[24] + screenTileCounts[25] + screenTileCounts[32] + screenTileCounts[112] + screenTileCounts[163] + screenTileCounts[400] + screenTileCounts[398] + -5 * screenTileCounts[27]; + Main.bloodTiles = screenTileCounts[199] + screenTileCounts[203] + screenTileCounts[200] + screenTileCounts[401] + screenTileCounts[399] + screenTileCounts[234] + screenTileCounts[352] - 5 * screenTileCounts[27]; + Main.snowTiles = screenTileCounts[147] + screenTileCounts[148] + screenTileCounts[161] + screenTileCounts[162] + screenTileCounts[164] + screenTileCounts[163] + screenTileCounts[200]; + Main.jungleTiles = screenTileCounts[60] + screenTileCounts[61] + screenTileCounts[62] + screenTileCounts[74] + screenTileCounts[226]; + Main.shroomTiles = screenTileCounts[70] + screenTileCounts[71] + screenTileCounts[72]; + Main.meteorTiles = screenTileCounts[37]; + Main.dungeonTiles = screenTileCounts[41] + screenTileCounts[43] + screenTileCounts[44]; + Main.sandTiles = screenTileCounts[53] + screenTileCounts[112] + screenTileCounts[116] + screenTileCounts[234] + screenTileCounts[397] + screenTileCounts[398] + screenTileCounts[402] + screenTileCounts[399] + screenTileCounts[396] + screenTileCounts[400] + screenTileCounts[403] + screenTileCounts[401]; + Main.waterCandles = screenTileCounts[49]; + Main.peaceCandles = screenTileCounts[372]; + Main.partyMonoliths = screenTileCounts[455]; + if (Main.player[Main.myPlayer].accOreFinder) + { + Main.player[Main.myPlayer].bestOre = -1; + for (int index = 0; index < 470; ++index) + { + if (screenTileCounts[index] > 0 && Main.tileValue[index] > (short) 0 && (Main.player[Main.myPlayer].bestOre < 0 || (int) Main.tileValue[index] > (int) Main.tileValue[Main.player[Main.myPlayer].bestOre])) + Main.player[Main.myPlayer].bestOre = index; + } + } + if (Main.holyTiles < 0) + Main.holyTiles = 0; + if (Main.evilTiles < 0) + Main.evilTiles = 0; + if (Main.bloodTiles < 0) + Main.bloodTiles = 0; + int holyTiles = Main.holyTiles; + Main.holyTiles -= Main.evilTiles; + Main.holyTiles -= Main.bloodTiles; + Main.evilTiles -= holyTiles; + Main.bloodTiles -= holyTiles; + if (Main.holyTiles < 0) + Main.holyTiles = 0; + if (Main.evilTiles < 0) + Main.evilTiles = 0; + if (Main.bloodTiles < 0) + Main.bloodTiles = 0; + Lighting.minX += Lighting.firstToLightX; + Lighting.maxX += Lighting.firstToLightX; + Lighting.minY += Lighting.firstToLightY; + Lighting.maxY += Lighting.firstToLightY; + Lighting.minX7 = Lighting.minX; + Lighting.maxX7 = Lighting.maxX; + Lighting.minY7 = Lighting.minY; + Lighting.maxY7 = Lighting.maxY; + Lighting.firstTileX7 = Lighting.firstTileX; + Lighting.lastTileX7 = Lighting.lastTileX; + Lighting.lastTileY7 = Lighting.lastTileY; + Lighting.firstTileY7 = Lighting.firstTileY; + Lighting.firstToLightX7 = Lighting.firstToLightX; + Lighting.lastToLightX7 = Lighting.lastToLightX; + Lighting.firstToLightY7 = Lighting.firstToLightY; + Lighting.lastToLightY7 = Lighting.lastToLightY; + Lighting.firstToLightX27 = Lighting.firstTileX - Lighting.offScreenTiles2; + Lighting.firstToLightY27 = Lighting.firstTileY - Lighting.offScreenTiles2; + Lighting.lastToLightX27 = Lighting.lastTileX + Lighting.offScreenTiles2; + Lighting.lastToLightY27 = Lighting.lastTileY + Lighting.offScreenTiles2; + Lighting.scrX = (int) Math.Floor((double) Main.screenPosition.X / 16.0); + Lighting.scrY = (int) Math.Floor((double) Main.screenPosition.Y / 16.0); + Main.renderCount = 0; + TimeLogger.LightingTime(0, stopwatch.Elapsed.TotalMilliseconds); + Lighting.doColors(); + } + + public static void doColors() + { + if (Lighting.lightMode < 2) + { + Lighting.blueWave += (float) Lighting.blueDir * 0.0001f; + if ((double) Lighting.blueWave > 1.0) + { + Lighting.blueWave = 1f; + Lighting.blueDir = -1; + } + else if ((double) Lighting.blueWave < 0.970000028610229) + { + Lighting.blueWave = 0.97f; + Lighting.blueDir = 1; + } + if (Lighting.RGB) + { + Lighting.negLight = 0.91f; + Lighting.negLight2 = 0.56f; + Lighting.honeyLightG = 0.7f * Lighting.negLight * Lighting.blueWave; + Lighting.honeyLightR = 0.75f * Lighting.negLight * Lighting.blueWave; + Lighting.honeyLightB = 0.6f * Lighting.negLight * Lighting.blueWave; + switch (Main.waterStyle) + { + case 0: + case 1: + case 7: + case 8: + Lighting.wetLightG = 0.96f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightR = 0.88f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightB = 1.015f * Lighting.negLight * Lighting.blueWave; + break; + case 2: + Lighting.wetLightG = 0.85f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightR = 0.94f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightB = 1.01f * Lighting.negLight * Lighting.blueWave; + break; + case 3: + Lighting.wetLightG = 0.95f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightR = 0.84f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightB = 1.015f * Lighting.negLight * Lighting.blueWave; + break; + case 4: + Lighting.wetLightG = 0.86f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightR = 0.9f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightB = 1.01f * Lighting.negLight * Lighting.blueWave; + break; + case 5: + Lighting.wetLightG = 0.99f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightR = 0.84f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightB = 1.01f * Lighting.negLight * Lighting.blueWave; + break; + case 6: + Lighting.wetLightG = 0.98f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightR = 0.95f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightB = 0.85f * Lighting.negLight * Lighting.blueWave; + break; + case 9: + Lighting.wetLightG = 0.88f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightR = 1f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightB = 0.84f * Lighting.negLight * Lighting.blueWave; + break; + case 10: + Lighting.wetLightG = 1f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightR = 0.83f * Lighting.negLight * Lighting.blueWave; + Lighting.wetLightB = 1f * Lighting.negLight * Lighting.blueWave; + break; + default: + Lighting.wetLightG = 0.0f; + Lighting.wetLightR = 0.0f; + Lighting.wetLightB = 0.0f; + break; + } + } + else + { + Lighting.negLight = 0.9f; + Lighting.negLight2 = 0.54f; + Lighting.wetLightR = 0.95f * Lighting.negLight * Lighting.blueWave; + } + if (Main.player[Main.myPlayer].nightVision) + { + Lighting.negLight *= 1.03f; + Lighting.negLight2 *= 1.03f; + } + if (Main.player[Main.myPlayer].blind) + { + Lighting.negLight *= 0.95f; + Lighting.negLight2 *= 0.95f; + } + if (Main.player[Main.myPlayer].blackout) + { + Lighting.negLight *= 0.85f; + Lighting.negLight2 *= 0.85f; + } + if (Main.player[Main.myPlayer].headcovered) + { + Lighting.negLight *= 0.85f; + Lighting.negLight2 *= 0.85f; + } + } + else + { + Lighting.negLight = 0.04f; + Lighting.negLight2 = 0.16f; + if (Main.player[Main.myPlayer].nightVision) + { + Lighting.negLight -= 0.013f; + Lighting.negLight2 -= 0.04f; + } + if (Main.player[Main.myPlayer].blind) + { + Lighting.negLight += 0.03f; + Lighting.negLight2 += 0.06f; + } + if (Main.player[Main.myPlayer].blackout) + { + Lighting.negLight += 0.09f; + Lighting.negLight2 += 0.18f; + } + if (Main.player[Main.myPlayer].headcovered) + { + Lighting.negLight += 0.09f; + Lighting.negLight2 += 0.18f; + } + Lighting.wetLightR = Lighting.negLight * 1.2f; + Lighting.wetLightG = Lighting.negLight * 1.1f; + } + int num1; + int num2; + switch (Main.renderCount) + { + case 0: + num1 = 0; + num2 = 1; + break; + case 1: + num1 = 1; + num2 = 3; + break; + case 2: + num1 = 3; + num2 = 4; + break; + default: + num1 = 0; + num2 = 0; + break; + } + if (Lighting.LightingThreads < 0) + Lighting.LightingThreads = 0; + if (Lighting.LightingThreads >= Environment.ProcessorCount) + Lighting.LightingThreads = Environment.ProcessorCount - 1; + int lightingThreads = Lighting.LightingThreads; + if (lightingThreads > 0) + ++lightingThreads; + Stopwatch stopwatch = new Stopwatch(); + for (int index1 = num1; index1 < num2; ++index1) + { + stopwatch.Restart(); + switch (index1) + { + case 0: + Lighting.swipe.innerLoop1Start = Lighting.minY7 - Lighting.firstToLightY7; + Lighting.swipe.innerLoop1End = Lighting.lastToLightY27 + Lighting.maxRenderCount - Lighting.firstToLightY7; + Lighting.swipe.innerLoop2Start = Lighting.maxY7 - Lighting.firstToLightY; + Lighting.swipe.innerLoop2End = Lighting.firstTileY7 - Lighting.maxRenderCount - Lighting.firstToLightY7; + Lighting.swipe.outerLoopStart = Lighting.minX7 - Lighting.firstToLightX7; + Lighting.swipe.outerLoopEnd = Lighting.maxX7 - Lighting.firstToLightX7; + Lighting.swipe.jaggedArray = Lighting.states; + break; + case 1: + Lighting.swipe.innerLoop1Start = Lighting.minX7 - Lighting.firstToLightX7; + Lighting.swipe.innerLoop1End = Lighting.lastTileX7 + Lighting.maxRenderCount - Lighting.firstToLightX7; + Lighting.swipe.innerLoop2Start = Lighting.maxX7 - Lighting.firstToLightX7; + Lighting.swipe.innerLoop2End = Lighting.firstTileX7 - Lighting.maxRenderCount - Lighting.firstToLightX7; + Lighting.swipe.outerLoopStart = Lighting.firstToLightY7 - Lighting.firstToLightY7; + Lighting.swipe.outerLoopEnd = Lighting.lastToLightY7 - Lighting.firstToLightY7; + Lighting.swipe.jaggedArray = Lighting.axisFlipStates; + break; + case 2: + Lighting.swipe.innerLoop1Start = Lighting.firstToLightY27 - Lighting.firstToLightY7; + Lighting.swipe.innerLoop1End = Lighting.lastTileY7 + Lighting.maxRenderCount - Lighting.firstToLightY7; + Lighting.swipe.innerLoop2Start = Lighting.lastToLightY27 - Lighting.firstToLightY; + Lighting.swipe.innerLoop2End = Lighting.firstTileY7 - Lighting.maxRenderCount - Lighting.firstToLightY7; + Lighting.swipe.outerLoopStart = Lighting.firstToLightX27 - Lighting.firstToLightX7; + Lighting.swipe.outerLoopEnd = Lighting.lastToLightX27 - Lighting.firstToLightX7; + Lighting.swipe.jaggedArray = Lighting.states; + break; + case 3: + Lighting.swipe.innerLoop1Start = Lighting.firstToLightX27 - Lighting.firstToLightX7; + Lighting.swipe.innerLoop1End = Lighting.lastTileX7 + Lighting.maxRenderCount - Lighting.firstToLightX7; + Lighting.swipe.innerLoop2Start = Lighting.lastToLightX27 - Lighting.firstToLightX7; + Lighting.swipe.innerLoop2End = Lighting.firstTileX7 - Lighting.maxRenderCount - Lighting.firstToLightX7; + Lighting.swipe.outerLoopStart = Lighting.firstToLightY27 - Lighting.firstToLightY7; + Lighting.swipe.outerLoopEnd = Lighting.lastToLightY27 - Lighting.firstToLightY7; + Lighting.swipe.jaggedArray = Lighting.axisFlipStates; + break; + } + if (Lighting.swipe.innerLoop1Start > Lighting.swipe.innerLoop1End) + Lighting.swipe.innerLoop1Start = Lighting.swipe.innerLoop1End; + if (Lighting.swipe.innerLoop2Start < Lighting.swipe.innerLoop2End) + Lighting.swipe.innerLoop2Start = Lighting.swipe.innerLoop2End; + if (Lighting.swipe.outerLoopStart > Lighting.swipe.outerLoopEnd) + Lighting.swipe.outerLoopStart = Lighting.swipe.outerLoopEnd; + switch (Lighting.lightMode) + { + case 0: + Lighting.swipe.function = new Action(Lighting.doColors_Mode0_Swipe); + break; + case 1: + Lighting.swipe.function = new Action(Lighting.doColors_Mode1_Swipe); + break; + case 2: + Lighting.swipe.function = new Action(Lighting.doColors_Mode2_Swipe); + break; + case 3: + Lighting.swipe.function = new Action(Lighting.doColors_Mode3_Swipe); + break; + default: + Lighting.swipe.function = (Action) null; + break; + } + if (lightingThreads == 0) + { + Lighting.swipe.function(Lighting.swipe); + } + else + { + int num3 = Lighting.swipe.outerLoopEnd - Lighting.swipe.outerLoopStart; + int num4 = num3 / lightingThreads; + int num5 = num3 % lightingThreads; + int outerLoopStart = Lighting.swipe.outerLoopStart; + Lighting.countdown.Reset(lightingThreads); + for (int index2 = 0; index2 < lightingThreads; ++index2) + { + Lighting.LightingSwipeData threadSwipe = Lighting.threadSwipes[index2]; + threadSwipe.CopyFrom(Lighting.swipe); + threadSwipe.outerLoopStart = outerLoopStart; + outerLoopStart += num4; + if (num5 > 0) + { + ++outerLoopStart; + --num5; + } + threadSwipe.outerLoopEnd = outerLoopStart; + ThreadPool.QueueUserWorkItem(new WaitCallback(Lighting.callback_LightingSwipe), (object) threadSwipe); + } + while (Lighting.countdown.CurrentCount != 0) + ; + } + TimeLogger.LightingTime(index1 + 1, stopwatch.Elapsed.TotalMilliseconds); + } + } + + private static void callback_LightingSwipe(object obj) + { + Lighting.LightingSwipeData lightingSwipeData = obj as Lighting.LightingSwipeData; + try + { + lightingSwipeData.function(lightingSwipeData); + } + catch + { + } + Lighting.countdown.Signal(); + } + + private static void doColors_Mode0_Swipe(Lighting.LightingSwipeData swipeData) + { + try + { + bool flag1 = true; + while (true) + { + int num1; + int num2; + int num3; + if (flag1) + { + num1 = 1; + num2 = swipeData.innerLoop1Start; + num3 = swipeData.innerLoop1End; + } + else + { + num1 = -1; + num2 = swipeData.innerLoop2Start; + num3 = swipeData.innerLoop2End; + } + int outerLoopStart = swipeData.outerLoopStart; + int outerLoopEnd = swipeData.outerLoopEnd; + for (int index1 = outerLoopStart; index1 < outerLoopEnd; ++index1) + { + Lighting.LightingState[] jagged = swipeData.jaggedArray[index1]; + float num4 = 0.0f; + float num5 = 0.0f; + float num6 = 0.0f; + int num7 = num2; + int num8 = num3; + for (int index2 = num7; index2 != num8; index2 += num1) + { + Lighting.LightingState lightingState1 = jagged[index2]; + Lighting.LightingState lightingState2 = jagged[index2 + num1]; + bool flag2; + bool flag3 = flag2 = false; + if ((double) lightingState1.r2 > (double) num4) + num4 = lightingState1.r2; + else if ((double) num4 <= 0.0185) + flag3 = true; + else if ((double) lightingState1.r2 < (double) num4) + lightingState1.r2 = num4; + if (!flag3 && (double) lightingState2.r2 <= (double) num4) + { + if (lightingState1.stopLight) + num4 *= Lighting.negLight2; + else if (lightingState1.wetLight) + { + if (lightingState1.honeyLight) + num4 *= (float) ((double) Lighting.honeyLightR * (double) swipeData.rand.Next(98, 100) * 0.00999999977648258); + else + num4 *= (float) ((double) Lighting.wetLightR * (double) swipeData.rand.Next(98, 100) * 0.00999999977648258); + } + else + num4 *= Lighting.negLight; + } + if ((double) lightingState1.g2 > (double) num5) + num5 = lightingState1.g2; + else if ((double) num5 <= 0.0185) + flag2 = true; + else + lightingState1.g2 = num5; + if (!flag2 && (double) lightingState2.g2 <= (double) num5) + { + if (lightingState1.stopLight) + num5 *= Lighting.negLight2; + else if (lightingState1.wetLight) + { + if (lightingState1.honeyLight) + num5 *= (float) ((double) Lighting.honeyLightG * (double) swipeData.rand.Next(97, 100) * 0.00999999977648258); + else + num5 *= (float) ((double) Lighting.wetLightG * (double) swipeData.rand.Next(97, 100) * 0.00999999977648258); + } + else + num5 *= Lighting.negLight; + } + if ((double) lightingState1.b2 > (double) num6) + num6 = lightingState1.b2; + else if ((double) num6 > 0.0185) + lightingState1.b2 = num6; + else + continue; + if ((double) lightingState2.b2 < (double) num6) + { + if (lightingState1.stopLight) + num6 *= Lighting.negLight2; + else if (lightingState1.wetLight) + { + if (lightingState1.honeyLight) + num6 *= (float) ((double) Lighting.honeyLightB * (double) swipeData.rand.Next(97, 100) * 0.00999999977648258); + else + num6 *= (float) ((double) Lighting.wetLightB * (double) swipeData.rand.Next(97, 100) * 0.00999999977648258); + } + else + num6 *= Lighting.negLight; + } + } + } + if (flag1) + flag1 = false; + else + break; + } + } + catch + { + } + } + + private static void doColors_Mode1_Swipe(Lighting.LightingSwipeData swipeData) + { + try + { + bool flag = true; + while (true) + { + int num1; + int num2; + int num3; + if (flag) + { + num1 = 1; + num2 = swipeData.innerLoop1Start; + num3 = swipeData.innerLoop1End; + } + else + { + num1 = -1; + num2 = swipeData.innerLoop2Start; + num3 = swipeData.innerLoop2End; + } + int outerLoopStart = swipeData.outerLoopStart; + int outerLoopEnd = swipeData.outerLoopEnd; + for (int index1 = outerLoopStart; index1 < outerLoopEnd; ++index1) + { + Lighting.LightingState[] jagged = swipeData.jaggedArray[index1]; + float num4 = 0.0f; + for (int index2 = num2; index2 != num3; index2 += num1) + { + Lighting.LightingState lightingState = jagged[index2]; + if ((double) lightingState.r2 > (double) num4) + num4 = lightingState.r2; + else if ((double) num4 > 0.0185) + { + if ((double) lightingState.r2 < (double) num4) + lightingState.r2 = num4; + } + else + continue; + if ((double) jagged[index2 + num1].r2 <= (double) num4) + { + if (lightingState.stopLight) + num4 *= Lighting.negLight2; + else if (lightingState.wetLight) + { + if (lightingState.honeyLight) + num4 *= (float) ((double) Lighting.honeyLightR * (double) swipeData.rand.Next(98, 100) * 0.00999999977648258); + else + num4 *= (float) ((double) Lighting.wetLightR * (double) swipeData.rand.Next(98, 100) * 0.00999999977648258); + } + else + num4 *= Lighting.negLight; + } + } + } + if (flag) + flag = false; + else + break; + } + } + catch + { + } + } + + private static void doColors_Mode2_Swipe(Lighting.LightingSwipeData swipeData) + { + try + { + bool flag = true; + while (true) + { + int num1; + int num2; + int num3; + if (flag) + { + num1 = 1; + num2 = swipeData.innerLoop1Start; + num3 = swipeData.innerLoop1End; + } + else + { + num1 = -1; + num2 = swipeData.innerLoop2Start; + num3 = swipeData.innerLoop2End; + } + int outerLoopStart = swipeData.outerLoopStart; + int outerLoopEnd = swipeData.outerLoopEnd; + for (int index1 = outerLoopStart; index1 < outerLoopEnd; ++index1) + { + Lighting.LightingState[] jagged = swipeData.jaggedArray[index1]; + float num4 = 0.0f; + for (int index2 = num2; index2 != num3; index2 += num1) + { + Lighting.LightingState lightingState = jagged[index2]; + if ((double) lightingState.r2 > (double) num4) + num4 = lightingState.r2; + else if ((double) num4 > 0.0) + lightingState.r2 = num4; + else + continue; + if (lightingState.stopLight) + num4 -= Lighting.negLight2; + else if (lightingState.wetLight) + num4 -= Lighting.wetLightR; + else + num4 -= Lighting.negLight; + } + } + if (flag) + flag = false; + else + break; + } + } + catch + { + } + } + + private static void doColors_Mode3_Swipe(Lighting.LightingSwipeData swipeData) + { + try + { + bool flag1 = true; + while (true) + { + int num1; + int num2; + int num3; + if (flag1) + { + num1 = 1; + num2 = swipeData.innerLoop1Start; + num3 = swipeData.innerLoop1End; + } + else + { + num1 = -1; + num2 = swipeData.innerLoop2Start; + num3 = swipeData.innerLoop2End; + } + int outerLoopStart = swipeData.outerLoopStart; + int outerLoopEnd = swipeData.outerLoopEnd; + for (int index1 = outerLoopStart; index1 < outerLoopEnd; ++index1) + { + Lighting.LightingState[] jagged = swipeData.jaggedArray[index1]; + float num4 = 0.0f; + float num5 = 0.0f; + float num6 = 0.0f; + for (int index2 = num2; index2 != num3; index2 += num1) + { + Lighting.LightingState lightingState = jagged[index2]; + bool flag2; + bool flag3 = flag2 = false; + if ((double) lightingState.r2 > (double) num4) + num4 = lightingState.r2; + else if ((double) num4 <= 0.0) + flag3 = true; + else + lightingState.r2 = num4; + if (!flag3) + { + if (lightingState.stopLight) + num4 -= Lighting.negLight2; + else if (lightingState.wetLight) + num4 -= Lighting.wetLightR; + else + num4 -= Lighting.negLight; + } + if ((double) lightingState.g2 > (double) num5) + num5 = lightingState.g2; + else if ((double) num5 <= 0.0) + flag2 = true; + else + lightingState.g2 = num5; + if (!flag2) + { + if (lightingState.stopLight) + num5 -= Lighting.negLight2; + else if (lightingState.wetLight) + num5 -= Lighting.wetLightG; + else + num5 -= Lighting.negLight; + } + if ((double) lightingState.b2 > (double) num6) + num6 = lightingState.b2; + else if ((double) num6 > 0.0) + lightingState.b2 = num6; + else + continue; + if (lightingState.stopLight) + num6 -= Lighting.negLight2; + else + num6 -= Lighting.negLight; + } + } + if (flag1) + flag1 = false; + else + break; + } + } + catch + { + } + } + + public static void AddLight(Vector2 position, Vector3 rgb) => Lighting.AddLight((int) ((double) position.X / 16.0), (int) ((double) position.Y / 16.0), rgb.X, rgb.Y, rgb.Z); + + public static void AddLight(Vector2 position, float R, float G, float B) => Lighting.AddLight((int) ((double) position.X / 16.0), (int) ((double) position.Y / 16.0), R, G, B); + + public static void AddLight(int i, int j, float R, float G, float B) + { + if (Main.gamePaused || Main.netMode == 2 || i - Lighting.firstTileX + Lighting.offScreenTiles < 0 || i - Lighting.firstTileX + Lighting.offScreenTiles >= Main.screenWidth / 16 + Lighting.offScreenTiles * 2 + 10 || j - Lighting.firstTileY + Lighting.offScreenTiles < 0 || j - Lighting.firstTileY + Lighting.offScreenTiles >= Main.screenHeight / 16 + Lighting.offScreenTiles * 2 + 10 || Lighting.tempLights.Count == Lighting.maxTempLights) + return; + Point16 key = new Point16(i, j); + Lighting.ColorTriplet colorTriplet; + if (Lighting.tempLights.TryGetValue(key, out colorTriplet)) + { + if (Lighting.RGB) + { + if ((double) colorTriplet.r < (double) R) + colorTriplet.r = R; + if ((double) colorTriplet.g < (double) G) + colorTriplet.g = G; + if ((double) colorTriplet.b < (double) B) + colorTriplet.b = B; + Lighting.tempLights[key] = colorTriplet; + } + else + { + float averageColor = (float) (((double) R + (double) G + (double) B) / 3.0); + if ((double) colorTriplet.r >= (double) averageColor) + return; + Lighting.tempLights[key] = new Lighting.ColorTriplet(averageColor); + } + } + else + { + colorTriplet = !Lighting.RGB ? new Lighting.ColorTriplet((float) (((double) R + (double) G + (double) B) / 3.0)) : new Lighting.ColorTriplet(R, G, B); + Lighting.tempLights.Add(key, colorTriplet); + } + } + + public static void NextLightMode() + { + Lighting.lightCounter += 100; + ++Lighting.lightMode; + if (Lighting.lightMode >= 4) + Lighting.lightMode = 0; + if (Lighting.lightMode != 2 && Lighting.lightMode != 0) + return; + Main.renderCount = 0; + Main.renderNow = true; + Lighting.BlackOut(); + } + + public static void BlackOut() + { + int num1 = Main.screenWidth / 16 + Lighting.offScreenTiles * 2; + int num2 = Main.screenHeight / 16 + Lighting.offScreenTiles * 2; + for (int index1 = 0; index1 < num1; ++index1) + { + Lighting.LightingState[] state = Lighting.states[index1]; + for (int index2 = 0; index2 < num2; ++index2) + { + Lighting.LightingState lightingState = state[index2]; + lightingState.r = 0.0f; + lightingState.g = 0.0f; + lightingState.b = 0.0f; + } + } + } + + public static Color GetColor(int x, int y, Color oldColor) + { + int index1 = x - Lighting.firstTileX + Lighting.offScreenTiles; + int index2 = y - Lighting.firstTileY + Lighting.offScreenTiles; + if (Main.gameMenu) + return oldColor; + if (index1 < 0 || index2 < 0 || index1 >= Main.screenWidth / 16 + Lighting.offScreenTiles * 2 + 10 || index2 >= Main.screenHeight / 16 + Lighting.offScreenTiles * 2 + 10) + return Color.Black; + Color white = Color.White; + Lighting.LightingState lightingState = Lighting.states[index1][index2]; + int num1 = (int) ((double) oldColor.R * (double) lightingState.r * (double) Lighting.brightness); + int num2 = (int) ((double) oldColor.G * (double) lightingState.g * (double) Lighting.brightness); + int num3 = (int) ((double) oldColor.B * (double) lightingState.b * (double) Lighting.brightness); + if (num1 > (int) byte.MaxValue) + num1 = (int) byte.MaxValue; + if (num2 > (int) byte.MaxValue) + num2 = (int) byte.MaxValue; + if (num3 > (int) byte.MaxValue) + num3 = (int) byte.MaxValue; + white.R = (byte) num1; + white.G = (byte) num2; + white.B = (byte) num3; + return white; + } + + public static Color GetColor(int x, int y) + { + int index1 = x - Lighting.firstTileX + Lighting.offScreenTiles; + int index2 = y - Lighting.firstTileY + Lighting.offScreenTiles; + if (Main.gameMenu) + return Color.White; + if (index1 < 0 || index2 < 0 || index1 >= Main.screenWidth / 16 + Lighting.offScreenTiles * 2 + 10 || index2 >= Main.screenHeight / 16 + Lighting.offScreenTiles * 2) + return Color.Black; + Lighting.LightingState lightingState = Lighting.states[index1][index2]; + int num1 = (int) ((double) byte.MaxValue * (double) lightingState.r * (double) Lighting.brightness); + int num2 = (int) ((double) byte.MaxValue * (double) lightingState.g * (double) Lighting.brightness); + int num3 = (int) ((double) byte.MaxValue * (double) lightingState.b * (double) Lighting.brightness); + if (num1 > (int) byte.MaxValue) + num1 = (int) byte.MaxValue; + if (num2 > (int) byte.MaxValue) + num2 = (int) byte.MaxValue; + if (num3 > (int) byte.MaxValue) + num3 = (int) byte.MaxValue; + return new Color((int) (byte) num1, (int) (byte) num2, (int) (byte) num3, (int) byte.MaxValue); + } + + public static void GetColor9Slice(int centerX, int centerY, ref Color[] slices) + { + int num1 = centerX - Lighting.firstTileX + Lighting.offScreenTiles; + int num2 = centerY - Lighting.firstTileY + Lighting.offScreenTiles; + if (num1 <= 0 || num2 <= 0 || num1 >= Main.screenWidth / 16 + Lighting.offScreenTiles * 2 + 10 - 1 || num2 >= Main.screenHeight / 16 + Lighting.offScreenTiles * 2 - 1) + { + for (int index = 0; index < 9; ++index) + slices[index] = Color.Black; + } + else + { + int index1 = 0; + for (int index2 = num1 - 1; index2 <= num1 + 1; ++index2) + { + Lighting.LightingState[] state = Lighting.states[index2]; + for (int index3 = num2 - 1; index3 <= num2 + 1; ++index3) + { + Lighting.LightingState lightingState = state[index3]; + int num3 = (int) ((double) byte.MaxValue * (double) lightingState.r * (double) Lighting.brightness); + int num4 = (int) ((double) byte.MaxValue * (double) lightingState.g * (double) Lighting.brightness); + int num5 = (int) ((double) byte.MaxValue * (double) lightingState.b * (double) Lighting.brightness); + if (num3 > (int) byte.MaxValue) + num3 = (int) byte.MaxValue; + if (num4 > (int) byte.MaxValue) + num4 = (int) byte.MaxValue; + if (num5 > (int) byte.MaxValue) + num5 = (int) byte.MaxValue; + slices[index1] = new Color((int) (byte) num3, (int) (byte) num4, (int) (byte) num5, (int) byte.MaxValue); + index1 += 3; + } + index1 -= 8; + } + } } public static Vector3 GetSubLight(Vector2 position) { Vector2 vector2_1 = position / 16f - new Vector2(0.5f, 0.5f); Vector2 vector2_2 = new Vector2(vector2_1.X % 1f, vector2_1.Y % 1f); - int x1 = (int) vector2_1.X; - int y = (int) vector2_1.Y; - Vector3 color1 = Lighting._activeEngine.GetColor(x1, y); - Vector3 color2 = Lighting._activeEngine.GetColor(x1 + 1, y); - Vector3 color3 = Lighting._activeEngine.GetColor(x1, y + 1); - Vector3 color4 = Lighting._activeEngine.GetColor(x1 + 1, y + 1); - Vector3 vector3 = color2; - double x2 = (double) vector2_2.X; - return Vector3.Lerp(Vector3.Lerp(color1, vector3, (float) x2), Vector3.Lerp(color3, color4, vector2_2.X), vector2_2.Y); + int index1 = (int) vector2_1.X - Lighting.firstTileX + Lighting.offScreenTiles; + int index2 = (int) vector2_1.Y - Lighting.firstTileY + Lighting.offScreenTiles; + if (index1 <= 0 || index2 <= 0 || index1 >= Main.screenWidth / 16 + Lighting.offScreenTiles * 2 + 10 - 1 || index2 >= Main.screenHeight / 16 + Lighting.offScreenTiles * 2 - 1) + return Vector3.One; + Vector3 vector3_1 = Lighting.states[index1][index2].ToVector3(); + Vector3 vector3_2 = Lighting.states[index1 + 1][index2].ToVector3(); + Vector3 vector3_3 = Lighting.states[index1][index2 + 1].ToVector3(); + Vector3 vector3_4 = Lighting.states[index1 + 1][index2 + 1].ToVector3(); + Vector3 vector3_5 = vector3_2; + double x = (double) vector2_2.X; + return Vector3.Lerp(Vector3.Lerp(vector3_1, vector3_5, (float) x), Vector3.Lerp(vector3_3, vector3_4, vector2_2.X), vector2_2.Y); } - public static void AddLight(Vector2 position, Vector3 rgb) => Lighting.AddLight((int) ((double) position.X / 16.0), (int) ((double) position.Y / 16.0), rgb.X, rgb.Y, rgb.Z); - - public static void AddLight(Vector2 position, float r, float g, float b) => Lighting.AddLight((int) ((double) position.X / 16.0), (int) ((double) position.Y / 16.0), r, g, b); - - public static void AddLight(int i, int j, int torchID, float lightAmount) - { - float R; - float G; - float B; - TorchID.TorchColor(torchID, out R, out G, out B); - Lighting._activeEngine.AddLight(i, j, new Vector3(R * lightAmount, G * lightAmount, B * lightAmount)); - } - - public static void AddLight(Vector2 position, int torchID) - { - float R; - float G; - float B; - TorchID.TorchColor(torchID, out R, out G, out B); - Lighting.AddLight((int) position.X / 16, (int) position.Y / 16, R, G, B); - } - - public static void AddLight(int i, int j, float r, float g, float b) - { - if (Main.gamePaused || Main.netMode == 2) - return; - Lighting._activeEngine.AddLight(i, j, new Vector3(r, g, b)); - } - - public static void NextLightMode() - { - ++Lighting.Mode; - if (!Enum.IsDefined(typeof (LightMode), (object) Lighting.Mode)) - Lighting.Mode = LightMode.White; - Lighting.Clear(); - } - - public static void Clear() => Lighting._activeEngine.Clear(); - - public static Color GetColor(Point tileCoords) => Main.gameMenu ? Color.White : new Color(Lighting._activeEngine.GetColor(tileCoords.X, tileCoords.Y) * Lighting.GlobalBrightness); - - public static Color GetColor(Point tileCoords, Color originalColor) => Main.gameMenu ? originalColor : new Color(Lighting._activeEngine.GetColor(tileCoords.X, tileCoords.Y) * originalColor.ToVector3()); - - public static Color GetColor(int x, int y, Color oldColor) => Main.gameMenu ? oldColor : new Color(Lighting._activeEngine.GetColor(x, y) * oldColor.ToVector3()); - - public static Color GetColor(int x, int y) - { - if (Main.gameMenu) - return Color.White; - Color color1 = new Color(); - Vector3 color2 = Lighting._activeEngine.GetColor(x, y); - float num1 = Lighting.GlobalBrightness * (float) byte.MaxValue; - int num2 = (int) ((double) color2.X * (double) num1); - int num3 = (int) ((double) color2.Y * (double) num1); - int num4 = (int) ((double) color2.Z * (double) num1); - if (num2 > (int) byte.MaxValue) - num2 = (int) byte.MaxValue; - if (num3 > (int) byte.MaxValue) - num3 = (int) byte.MaxValue; - if (num4 > (int) byte.MaxValue) - num4 = (int) byte.MaxValue; - int num5 = num4 << 16; - int num6 = num3 << 8; - color1.PackedValue = (uint) (num2 | num6 | num5 | -16777216); - return color1; - } - - public static void GetColor9Slice(int centerX, int centerY, ref Color[] slices) - { - int index = 0; - for (int x = centerX - 1; x <= centerX + 1; ++x) - { - for (int y = centerY - 1; y <= centerY + 1; ++y) - { - Vector3 color = Lighting._activeEngine.GetColor(x, y); - int num1 = (int) ((double) byte.MaxValue * (double) color.X * (double) Lighting.GlobalBrightness); - int num2 = (int) ((double) byte.MaxValue * (double) color.Y * (double) Lighting.GlobalBrightness); - int num3 = (int) ((double) byte.MaxValue * (double) color.Z * (double) Lighting.GlobalBrightness); - if (num1 > (int) byte.MaxValue) - num1 = (int) byte.MaxValue; - if (num2 > (int) byte.MaxValue) - num2 = (int) byte.MaxValue; - if (num3 > (int) byte.MaxValue) - num3 = (int) byte.MaxValue; - int num4 = num3 << 16; - int num5 = num2 << 8; - slices[index].PackedValue = (uint) (num1 | num5 | num4 | -16777216); - index += 3; - } - index -= 8; - } - } - - public static void GetColor9Slice(int x, int y, ref Vector3[] slices) - { - slices[0] = Lighting._activeEngine.GetColor(x - 1, y - 1) * Lighting.GlobalBrightness; - slices[3] = Lighting._activeEngine.GetColor(x - 1, y) * Lighting.GlobalBrightness; - slices[6] = Lighting._activeEngine.GetColor(x - 1, y + 1) * Lighting.GlobalBrightness; - slices[1] = Lighting._activeEngine.GetColor(x, y - 1) * Lighting.GlobalBrightness; - slices[4] = Lighting._activeEngine.GetColor(x, y) * Lighting.GlobalBrightness; - slices[7] = Lighting._activeEngine.GetColor(x, y + 1) * Lighting.GlobalBrightness; - slices[2] = Lighting._activeEngine.GetColor(x + 1, y - 1) * Lighting.GlobalBrightness; - slices[5] = Lighting._activeEngine.GetColor(x + 1, y) * Lighting.GlobalBrightness; - slices[8] = Lighting._activeEngine.GetColor(x + 1, y + 1) * Lighting.GlobalBrightness; - } - - public static void GetCornerColors( + public static void GetColor4Slice_New( int centerX, int centerY, out VertexColors vertices, float scale = 1f) { - vertices = new VertexColors(); - int x = centerX; - int y = centerY; - Vector3 color1 = Lighting._activeEngine.GetColor(x, y); - Vector3 color2 = Lighting._activeEngine.GetColor(x, y - 1); - Vector3 color3 = Lighting._activeEngine.GetColor(x, y + 1); - Vector3 color4 = Lighting._activeEngine.GetColor(x - 1, y); - Vector3 color5 = Lighting._activeEngine.GetColor(x + 1, y); - Vector3 color6 = Lighting._activeEngine.GetColor(x - 1, y - 1); - Vector3 color7 = Lighting._activeEngine.GetColor(x + 1, y - 1); - Vector3 color8 = Lighting._activeEngine.GetColor(x - 1, y + 1); - Vector3 color9 = Lighting._activeEngine.GetColor(x + 1, y + 1); - float num1 = (float) ((double) Lighting.GlobalBrightness * (double) scale * 63.75); - int num2 = (int) (((double) color2.X + (double) color6.X + (double) color4.X + (double) color1.X) * (double) num1); - int num3 = (int) (((double) color2.Y + (double) color6.Y + (double) color4.Y + (double) color1.Y) * (double) num1); - int num4 = (int) (((double) color2.Z + (double) color6.Z + (double) color4.Z + (double) color1.Z) * (double) num1); - if (num2 > (int) byte.MaxValue) - num2 = (int) byte.MaxValue; - if (num3 > (int) byte.MaxValue) - num3 = (int) byte.MaxValue; - if (num4 > (int) byte.MaxValue) - num4 = (int) byte.MaxValue; - int num5 = num3 << 8; - int num6 = num4 << 16; - vertices.TopLeftColor.PackedValue = (uint) (num2 | num5 | num6 | -16777216); - int num7 = (int) (((double) color2.X + (double) color7.X + (double) color5.X + (double) color1.X) * (double) num1); - int num8 = (int) (((double) color2.Y + (double) color7.Y + (double) color5.Y + (double) color1.Y) * (double) num1); - int num9 = (int) (((double) color2.Z + (double) color7.Z + (double) color5.Z + (double) color1.Z) * (double) num1); - if (num7 > (int) byte.MaxValue) - num7 = (int) byte.MaxValue; - if (num8 > (int) byte.MaxValue) - num8 = (int) byte.MaxValue; - if (num9 > (int) byte.MaxValue) - num9 = (int) byte.MaxValue; - int num10 = num8 << 8; - int num11 = num9 << 16; - vertices.TopRightColor.PackedValue = (uint) (num7 | num10 | num11 | -16777216); - int num12 = (int) (((double) color3.X + (double) color8.X + (double) color4.X + (double) color1.X) * (double) num1); - int num13 = (int) (((double) color3.Y + (double) color8.Y + (double) color4.Y + (double) color1.Y) * (double) num1); - int num14 = (int) (((double) color3.Z + (double) color8.Z + (double) color4.Z + (double) color1.Z) * (double) num1); - if (num12 > (int) byte.MaxValue) - num12 = (int) byte.MaxValue; - if (num13 > (int) byte.MaxValue) - num13 = (int) byte.MaxValue; - if (num14 > (int) byte.MaxValue) - num14 = (int) byte.MaxValue; - int num15 = num13 << 8; - int num16 = num14 << 16; - vertices.BottomLeftColor.PackedValue = (uint) (num12 | num15 | num16 | -16777216); - int num17 = (int) (((double) color3.X + (double) color9.X + (double) color5.X + (double) color1.X) * (double) num1); - int num18 = (int) (((double) color3.Y + (double) color9.Y + (double) color5.Y + (double) color1.Y) * (double) num1); - int num19 = (int) (((double) color3.Z + (double) color9.Z + (double) color5.Z + (double) color1.Z) * (double) num1); - if (num17 > (int) byte.MaxValue) - num17 = (int) byte.MaxValue; - if (num18 > (int) byte.MaxValue) - num18 = (int) byte.MaxValue; - if (num19 > (int) byte.MaxValue) - num19 = (int) byte.MaxValue; - int num20 = num18 << 8; - int num21 = num19 << 16; - vertices.BottomRightColor.PackedValue = (uint) (num17 | num20 | num21 | -16777216); + int index1 = centerX - Lighting.firstTileX + Lighting.offScreenTiles; + int index2 = centerY - Lighting.firstTileY + Lighting.offScreenTiles; + if (index1 <= 0 || index2 <= 0 || index1 >= Main.screenWidth / 16 + Lighting.offScreenTiles * 2 + 10 - 1 || index2 >= Main.screenHeight / 16 + Lighting.offScreenTiles * 2 - 1) + { + vertices.BottomLeftColor = Color.Black; + vertices.BottomRightColor = Color.Black; + vertices.TopLeftColor = Color.Black; + vertices.TopRightColor = Color.Black; + } + else + { + Lighting.LightingState lightingState1 = Lighting.states[index1][index2]; + Lighting.LightingState lightingState2 = Lighting.states[index1][index2 - 1]; + Lighting.LightingState lightingState3 = Lighting.states[index1][index2 + 1]; + Lighting.LightingState lightingState4 = Lighting.states[index1 - 1][index2]; + Lighting.LightingState lightingState5 = Lighting.states[index1 + 1][index2]; + Lighting.LightingState lightingState6 = Lighting.states[index1 - 1][index2 - 1]; + Lighting.LightingState lightingState7 = Lighting.states[index1 + 1][index2 - 1]; + Lighting.LightingState lightingState8 = Lighting.states[index1 - 1][index2 + 1]; + Lighting.LightingState lightingState9 = Lighting.states[index1 + 1][index2 + 1]; + float num1 = (float) ((double) Lighting.brightness * (double) scale * (double) byte.MaxValue * 0.25); + float num2 = (lightingState2.r + lightingState6.r + lightingState4.r + lightingState1.r) * num1; + float num3 = (lightingState2.g + lightingState6.g + lightingState4.g + lightingState1.g) * num1; + float num4 = (lightingState2.b + lightingState6.b + lightingState4.b + lightingState1.b) * num1; + if ((double) num2 > (double) byte.MaxValue) + num2 = (float) byte.MaxValue; + if ((double) num3 > (double) byte.MaxValue) + num3 = (float) byte.MaxValue; + if ((double) num4 > (double) byte.MaxValue) + num4 = (float) byte.MaxValue; + vertices.TopLeftColor = new Color((int) (byte) num2, (int) (byte) num3, (int) (byte) num4, (int) byte.MaxValue); + float num5 = (lightingState2.r + lightingState7.r + lightingState5.r + lightingState1.r) * num1; + float num6 = (lightingState2.g + lightingState7.g + lightingState5.g + lightingState1.g) * num1; + float num7 = (lightingState2.b + lightingState7.b + lightingState5.b + lightingState1.b) * num1; + if ((double) num5 > (double) byte.MaxValue) + num5 = (float) byte.MaxValue; + if ((double) num6 > (double) byte.MaxValue) + num6 = (float) byte.MaxValue; + if ((double) num7 > (double) byte.MaxValue) + num7 = (float) byte.MaxValue; + vertices.TopRightColor = new Color((int) (byte) num5, (int) (byte) num6, (int) (byte) num7, (int) byte.MaxValue); + float num8 = (lightingState3.r + lightingState8.r + lightingState4.r + lightingState1.r) * num1; + float num9 = (lightingState3.g + lightingState8.g + lightingState4.g + lightingState1.g) * num1; + float num10 = (lightingState3.b + lightingState8.b + lightingState4.b + lightingState1.b) * num1; + if ((double) num8 > (double) byte.MaxValue) + num8 = (float) byte.MaxValue; + if ((double) num9 > (double) byte.MaxValue) + num9 = (float) byte.MaxValue; + if ((double) num10 > (double) byte.MaxValue) + num10 = (float) byte.MaxValue; + vertices.BottomLeftColor = new Color((int) (byte) num8, (int) (byte) num9, (int) (byte) num10, (int) byte.MaxValue); + float num11 = (lightingState3.r + lightingState9.r + lightingState5.r + lightingState1.r) * num1; + float num12 = (lightingState3.g + lightingState9.g + lightingState5.g + lightingState1.g) * num1; + float num13 = (lightingState3.b + lightingState9.b + lightingState5.b + lightingState1.b) * num1; + if ((double) num11 > (double) byte.MaxValue) + num11 = (float) byte.MaxValue; + if ((double) num12 > (double) byte.MaxValue) + num12 = (float) byte.MaxValue; + if ((double) num13 > (double) byte.MaxValue) + num13 = (float) byte.MaxValue; + vertices.BottomRightColor = new Color((int) (byte) num11, (int) (byte) num12, (int) (byte) num13, (int) byte.MaxValue); + } + } + + public static void GetColor4Slice_New( + int centerX, + int centerY, + out VertexColors vertices, + Color centerColor, + float scale = 1f) + { + int index1 = centerX - Lighting.firstTileX + Lighting.offScreenTiles; + int index2 = centerY - Lighting.firstTileY + Lighting.offScreenTiles; + if (index1 <= 0 || index2 <= 0 || index1 >= Main.screenWidth / 16 + Lighting.offScreenTiles * 2 + 10 - 1 || index2 >= Main.screenHeight / 16 + Lighting.offScreenTiles * 2 - 1) + { + vertices.BottomLeftColor = Color.Black; + vertices.BottomRightColor = Color.Black; + vertices.TopLeftColor = Color.Black; + vertices.TopRightColor = Color.Black; + } + else + { + float num1 = (float) centerColor.R / (float) byte.MaxValue; + float num2 = (float) centerColor.G / (float) byte.MaxValue; + float num3 = (float) centerColor.B / (float) byte.MaxValue; + Lighting.LightingState lightingState1 = Lighting.states[index1][index2 - 1]; + Lighting.LightingState lightingState2 = Lighting.states[index1][index2 + 1]; + Lighting.LightingState lightingState3 = Lighting.states[index1 - 1][index2]; + Lighting.LightingState lightingState4 = Lighting.states[index1 + 1][index2]; + Lighting.LightingState lightingState5 = Lighting.states[index1 - 1][index2 - 1]; + Lighting.LightingState lightingState6 = Lighting.states[index1 + 1][index2 - 1]; + Lighting.LightingState lightingState7 = Lighting.states[index1 - 1][index2 + 1]; + Lighting.LightingState lightingState8 = Lighting.states[index1 + 1][index2 + 1]; + float num4 = (float) ((double) Lighting.brightness * (double) scale * (double) byte.MaxValue * 0.25); + float num5 = (lightingState1.r + lightingState5.r + lightingState3.r + num1) * num4; + float num6 = (lightingState1.g + lightingState5.g + lightingState3.g + num2) * num4; + float num7 = (lightingState1.b + lightingState5.b + lightingState3.b + num3) * num4; + if ((double) num5 > (double) byte.MaxValue) + num5 = (float) byte.MaxValue; + if ((double) num6 > (double) byte.MaxValue) + num6 = (float) byte.MaxValue; + if ((double) num7 > (double) byte.MaxValue) + num7 = (float) byte.MaxValue; + vertices.TopLeftColor = new Color((int) (byte) num5, (int) (byte) num6, (int) (byte) num7, (int) byte.MaxValue); + float num8 = (lightingState1.r + lightingState6.r + lightingState4.r + num1) * num4; + float num9 = (lightingState1.g + lightingState6.g + lightingState4.g + num2) * num4; + float num10 = (lightingState1.b + lightingState6.b + lightingState4.b + num3) * num4; + if ((double) num8 > (double) byte.MaxValue) + num8 = (float) byte.MaxValue; + if ((double) num9 > (double) byte.MaxValue) + num9 = (float) byte.MaxValue; + if ((double) num10 > (double) byte.MaxValue) + num10 = (float) byte.MaxValue; + vertices.TopRightColor = new Color((int) (byte) num8, (int) (byte) num9, (int) (byte) num10, (int) byte.MaxValue); + float num11 = (lightingState2.r + lightingState7.r + lightingState3.r + num1) * num4; + float num12 = (lightingState2.g + lightingState7.g + lightingState3.g + num2) * num4; + float num13 = (lightingState2.b + lightingState7.b + lightingState3.b + num3) * num4; + if ((double) num11 > (double) byte.MaxValue) + num11 = (float) byte.MaxValue; + if ((double) num12 > (double) byte.MaxValue) + num12 = (float) byte.MaxValue; + if ((double) num13 > (double) byte.MaxValue) + num13 = (float) byte.MaxValue; + vertices.BottomLeftColor = new Color((int) (byte) num11, (int) (byte) num12, (int) (byte) num13, (int) byte.MaxValue); + float num14 = (lightingState2.r + lightingState8.r + lightingState4.r + num1) * num4; + float num15 = (lightingState2.g + lightingState8.g + lightingState4.g + num2) * num4; + float num16 = (lightingState2.b + lightingState8.b + lightingState4.b + num3) * num4; + if ((double) num14 > (double) byte.MaxValue) + num14 = (float) byte.MaxValue; + if ((double) num15 > (double) byte.MaxValue) + num15 = (float) byte.MaxValue; + if ((double) num16 > (double) byte.MaxValue) + num16 = (float) byte.MaxValue; + vertices.BottomRightColor = new Color((int) (byte) num14, (int) (byte) num15, (int) (byte) num16, (int) byte.MaxValue); + } } public static void GetColor4Slice(int centerX, int centerY, ref Color[] slices) { - int x = centerX; - int y = centerY; - Vector3 color1 = Lighting._activeEngine.GetColor(x, y - 1); - Vector3 color2 = Lighting._activeEngine.GetColor(x, y + 1); - Vector3 color3 = Lighting._activeEngine.GetColor(x - 1, y); - Vector3 color4 = Lighting._activeEngine.GetColor(x + 1, y); - double num1 = (double) color1.X + (double) color1.Y + (double) color1.Z; - float num2 = color2.X + color2.Y + color2.Z; - float num3 = color4.X + color4.Y + color4.Z; - float num4 = color3.X + color3.Y + color3.Z; - if (num1 >= (double) num4) + int index1 = centerX - Lighting.firstTileX + Lighting.offScreenTiles; + int index2 = centerY - Lighting.firstTileY + Lighting.offScreenTiles; + if (index1 <= 0 || index2 <= 0 || index1 >= Main.screenWidth / 16 + Lighting.offScreenTiles * 2 + 10 - 1 || index2 >= Main.screenHeight / 16 + Lighting.offScreenTiles * 2 - 1) { - int num5 = (int) ((double) byte.MaxValue * (double) color3.X * (double) Lighting.GlobalBrightness); - int num6 = (int) ((double) byte.MaxValue * (double) color3.Y * (double) Lighting.GlobalBrightness); - int num7 = (int) ((double) byte.MaxValue * (double) color3.Z * (double) Lighting.GlobalBrightness); - if (num5 > (int) byte.MaxValue) - num5 = (int) byte.MaxValue; - if (num6 > (int) byte.MaxValue) - num6 = (int) byte.MaxValue; - if (num7 > (int) byte.MaxValue) - num7 = (int) byte.MaxValue; - slices[0] = new Color((int) (byte) num5, (int) (byte) num6, (int) (byte) num7, (int) byte.MaxValue); + for (int index3 = 0; index3 < 4; ++index3) + slices[index3] = Color.Black; } else { - int num8 = (int) ((double) byte.MaxValue * (double) color1.X * (double) Lighting.GlobalBrightness); - int num9 = (int) ((double) byte.MaxValue * (double) color1.Y * (double) Lighting.GlobalBrightness); - int num10 = (int) ((double) byte.MaxValue * (double) color1.Z * (double) Lighting.GlobalBrightness); - if (num8 > (int) byte.MaxValue) - num8 = (int) byte.MaxValue; - if (num9 > (int) byte.MaxValue) - num9 = (int) byte.MaxValue; - if (num10 > (int) byte.MaxValue) - num10 = (int) byte.MaxValue; - slices[0] = new Color((int) (byte) num8, (int) (byte) num9, (int) (byte) num10, (int) byte.MaxValue); - } - if (num1 >= (double) num3) - { - int num11 = (int) ((double) byte.MaxValue * (double) color4.X * (double) Lighting.GlobalBrightness); - int num12 = (int) ((double) byte.MaxValue * (double) color4.Y * (double) Lighting.GlobalBrightness); - int num13 = (int) ((double) byte.MaxValue * (double) color4.Z * (double) Lighting.GlobalBrightness); - if (num11 > (int) byte.MaxValue) - num11 = (int) byte.MaxValue; - if (num12 > (int) byte.MaxValue) - num12 = (int) byte.MaxValue; - if (num13 > (int) byte.MaxValue) - num13 = (int) byte.MaxValue; - slices[1] = new Color((int) (byte) num11, (int) (byte) num12, (int) (byte) num13, (int) byte.MaxValue); - } - else - { - int num14 = (int) ((double) byte.MaxValue * (double) color1.X * (double) Lighting.GlobalBrightness); - int num15 = (int) ((double) byte.MaxValue * (double) color1.Y * (double) Lighting.GlobalBrightness); - int num16 = (int) ((double) byte.MaxValue * (double) color1.Z * (double) Lighting.GlobalBrightness); - if (num14 > (int) byte.MaxValue) - num14 = (int) byte.MaxValue; - if (num15 > (int) byte.MaxValue) - num15 = (int) byte.MaxValue; - if (num16 > (int) byte.MaxValue) - num16 = (int) byte.MaxValue; - slices[1] = new Color((int) (byte) num14, (int) (byte) num15, (int) (byte) num16, (int) byte.MaxValue); - } - if ((double) num2 >= (double) num4) - { - int num17 = (int) ((double) byte.MaxValue * (double) color3.X * (double) Lighting.GlobalBrightness); - int num18 = (int) ((double) byte.MaxValue * (double) color3.Y * (double) Lighting.GlobalBrightness); - int num19 = (int) ((double) byte.MaxValue * (double) color3.Z * (double) Lighting.GlobalBrightness); - if (num17 > (int) byte.MaxValue) - num17 = (int) byte.MaxValue; - if (num18 > (int) byte.MaxValue) - num18 = (int) byte.MaxValue; - if (num19 > (int) byte.MaxValue) - num19 = (int) byte.MaxValue; - slices[2] = new Color((int) (byte) num17, (int) (byte) num18, (int) (byte) num19, (int) byte.MaxValue); - } - else - { - int num20 = (int) ((double) byte.MaxValue * (double) color2.X * (double) Lighting.GlobalBrightness); - int num21 = (int) ((double) byte.MaxValue * (double) color2.Y * (double) Lighting.GlobalBrightness); - int num22 = (int) ((double) byte.MaxValue * (double) color2.Z * (double) Lighting.GlobalBrightness); - if (num20 > (int) byte.MaxValue) - num20 = (int) byte.MaxValue; - if (num21 > (int) byte.MaxValue) - num21 = (int) byte.MaxValue; - if (num22 > (int) byte.MaxValue) - num22 = (int) byte.MaxValue; - slices[2] = new Color((int) (byte) num20, (int) (byte) num21, (int) (byte) num22, (int) byte.MaxValue); - } - if ((double) num2 >= (double) num3) - { - int num23 = (int) ((double) byte.MaxValue * (double) color4.X * (double) Lighting.GlobalBrightness); - int num24 = (int) ((double) byte.MaxValue * (double) color4.Y * (double) Lighting.GlobalBrightness); - int num25 = (int) ((double) byte.MaxValue * (double) color4.Z * (double) Lighting.GlobalBrightness); - if (num23 > (int) byte.MaxValue) - num23 = (int) byte.MaxValue; - if (num24 > (int) byte.MaxValue) - num24 = (int) byte.MaxValue; - if (num25 > (int) byte.MaxValue) - num25 = (int) byte.MaxValue; - slices[3] = new Color((int) (byte) num23, (int) (byte) num24, (int) (byte) num25, (int) byte.MaxValue); - } - else - { - int num26 = (int) ((double) byte.MaxValue * (double) color2.X * (double) Lighting.GlobalBrightness); - int num27 = (int) ((double) byte.MaxValue * (double) color2.Y * (double) Lighting.GlobalBrightness); - int num28 = (int) ((double) byte.MaxValue * (double) color2.Z * (double) Lighting.GlobalBrightness); - if (num26 > (int) byte.MaxValue) - num26 = (int) byte.MaxValue; - if (num27 > (int) byte.MaxValue) - num27 = (int) byte.MaxValue; - if (num28 > (int) byte.MaxValue) - num28 = (int) byte.MaxValue; - slices[3] = new Color((int) (byte) num26, (int) (byte) num27, (int) (byte) num28, (int) byte.MaxValue); + Lighting.LightingState lightingState1 = Lighting.states[index1][index2 - 1]; + Lighting.LightingState lightingState2 = Lighting.states[index1][index2 + 1]; + Lighting.LightingState lightingState3 = Lighting.states[index1 - 1][index2]; + Lighting.LightingState lightingState4 = Lighting.states[index1 + 1][index2]; + double num1 = (double) lightingState1.r + (double) lightingState1.g + (double) lightingState1.b; + float num2 = lightingState2.r + lightingState2.g + lightingState2.b; + float num3 = lightingState4.r + lightingState4.g + lightingState4.b; + float num4 = lightingState3.r + lightingState3.g + lightingState3.b; + if (num1 >= (double) num4) + { + int num5 = (int) ((double) byte.MaxValue * (double) lightingState3.r * (double) Lighting.brightness); + int num6 = (int) ((double) byte.MaxValue * (double) lightingState3.g * (double) Lighting.brightness); + int num7 = (int) ((double) byte.MaxValue * (double) lightingState3.b * (double) Lighting.brightness); + if (num5 > (int) byte.MaxValue) + num5 = (int) byte.MaxValue; + if (num6 > (int) byte.MaxValue) + num6 = (int) byte.MaxValue; + if (num7 > (int) byte.MaxValue) + num7 = (int) byte.MaxValue; + slices[0] = new Color((int) (byte) num5, (int) (byte) num6, (int) (byte) num7, (int) byte.MaxValue); + } + else + { + int num8 = (int) ((double) byte.MaxValue * (double) lightingState1.r * (double) Lighting.brightness); + int num9 = (int) ((double) byte.MaxValue * (double) lightingState1.g * (double) Lighting.brightness); + int num10 = (int) ((double) byte.MaxValue * (double) lightingState1.b * (double) Lighting.brightness); + if (num8 > (int) byte.MaxValue) + num8 = (int) byte.MaxValue; + if (num9 > (int) byte.MaxValue) + num9 = (int) byte.MaxValue; + if (num10 > (int) byte.MaxValue) + num10 = (int) byte.MaxValue; + slices[0] = new Color((int) (byte) num8, (int) (byte) num9, (int) (byte) num10, (int) byte.MaxValue); + } + if (num1 >= (double) num3) + { + int num11 = (int) ((double) byte.MaxValue * (double) lightingState4.r * (double) Lighting.brightness); + int num12 = (int) ((double) byte.MaxValue * (double) lightingState4.g * (double) Lighting.brightness); + int num13 = (int) ((double) byte.MaxValue * (double) lightingState4.b * (double) Lighting.brightness); + if (num11 > (int) byte.MaxValue) + num11 = (int) byte.MaxValue; + if (num12 > (int) byte.MaxValue) + num12 = (int) byte.MaxValue; + if (num13 > (int) byte.MaxValue) + num13 = (int) byte.MaxValue; + slices[1] = new Color((int) (byte) num11, (int) (byte) num12, (int) (byte) num13, (int) byte.MaxValue); + } + else + { + int num14 = (int) ((double) byte.MaxValue * (double) lightingState1.r * (double) Lighting.brightness); + int num15 = (int) ((double) byte.MaxValue * (double) lightingState1.g * (double) Lighting.brightness); + int num16 = (int) ((double) byte.MaxValue * (double) lightingState1.b * (double) Lighting.brightness); + if (num14 > (int) byte.MaxValue) + num14 = (int) byte.MaxValue; + if (num15 > (int) byte.MaxValue) + num15 = (int) byte.MaxValue; + if (num16 > (int) byte.MaxValue) + num16 = (int) byte.MaxValue; + slices[1] = new Color((int) (byte) num14, (int) (byte) num15, (int) (byte) num16, (int) byte.MaxValue); + } + if ((double) num2 >= (double) num4) + { + int num17 = (int) ((double) byte.MaxValue * (double) lightingState3.r * (double) Lighting.brightness); + int num18 = (int) ((double) byte.MaxValue * (double) lightingState3.g * (double) Lighting.brightness); + int num19 = (int) ((double) byte.MaxValue * (double) lightingState3.b * (double) Lighting.brightness); + if (num17 > (int) byte.MaxValue) + num17 = (int) byte.MaxValue; + if (num18 > (int) byte.MaxValue) + num18 = (int) byte.MaxValue; + if (num19 > (int) byte.MaxValue) + num19 = (int) byte.MaxValue; + slices[2] = new Color((int) (byte) num17, (int) (byte) num18, (int) (byte) num19, (int) byte.MaxValue); + } + else + { + int num20 = (int) ((double) byte.MaxValue * (double) lightingState2.r * (double) Lighting.brightness); + int num21 = (int) ((double) byte.MaxValue * (double) lightingState2.g * (double) Lighting.brightness); + int num22 = (int) ((double) byte.MaxValue * (double) lightingState2.b * (double) Lighting.brightness); + if (num20 > (int) byte.MaxValue) + num20 = (int) byte.MaxValue; + if (num21 > (int) byte.MaxValue) + num21 = (int) byte.MaxValue; + if (num22 > (int) byte.MaxValue) + num22 = (int) byte.MaxValue; + slices[2] = new Color((int) (byte) num20, (int) (byte) num21, (int) (byte) num22, (int) byte.MaxValue); + } + if ((double) num2 >= (double) num3) + { + int num23 = (int) ((double) byte.MaxValue * (double) lightingState4.r * (double) Lighting.brightness); + int num24 = (int) ((double) byte.MaxValue * (double) lightingState4.g * (double) Lighting.brightness); + int num25 = (int) ((double) byte.MaxValue * (double) lightingState4.b * (double) Lighting.brightness); + if (num23 > (int) byte.MaxValue) + num23 = (int) byte.MaxValue; + if (num24 > (int) byte.MaxValue) + num24 = (int) byte.MaxValue; + if (num25 > (int) byte.MaxValue) + num25 = (int) byte.MaxValue; + slices[3] = new Color((int) (byte) num23, (int) (byte) num24, (int) (byte) num25, (int) byte.MaxValue); + } + else + { + int num26 = (int) ((double) byte.MaxValue * (double) lightingState2.r * (double) Lighting.brightness); + int num27 = (int) ((double) byte.MaxValue * (double) lightingState2.g * (double) Lighting.brightness); + int num28 = (int) ((double) byte.MaxValue * (double) lightingState2.b * (double) Lighting.brightness); + if (num26 > (int) byte.MaxValue) + num26 = (int) byte.MaxValue; + if (num27 > (int) byte.MaxValue) + num27 = (int) byte.MaxValue; + if (num28 > (int) byte.MaxValue) + num28 = (int) byte.MaxValue; + slices[3] = new Color((int) (byte) num26, (int) (byte) num27, (int) (byte) num28, (int) byte.MaxValue); + } } } - public static void GetColor4Slice(int x, int y, ref Vector3[] slices) + public static Color GetBlackness(int x, int y) { - Vector3 color1 = Lighting._activeEngine.GetColor(x, y - 1); - Vector3 color2 = Lighting._activeEngine.GetColor(x, y + 1); - Vector3 color3 = Lighting._activeEngine.GetColor(x - 1, y); - Vector3 color4 = Lighting._activeEngine.GetColor(x + 1, y); - double num1 = (double) color1.X + (double) color1.Y + (double) color1.Z; - float num2 = color2.X + color2.Y + color2.Z; - float num3 = color4.X + color4.Y + color4.Z; - float num4 = color3.X + color3.Y + color3.Z; - slices[0] = num1 < (double) num4 ? color1 * Lighting.GlobalBrightness : color3 * Lighting.GlobalBrightness; - slices[1] = num1 < (double) num3 ? color1 * Lighting.GlobalBrightness : color4 * Lighting.GlobalBrightness; - slices[2] = (double) num2 < (double) num4 ? color2 * Lighting.GlobalBrightness : color3 * Lighting.GlobalBrightness; - if ((double) num2 >= (double) num3) - slices[3] = color4 * Lighting.GlobalBrightness; - else - slices[3] = color2 * Lighting.GlobalBrightness; + int index1 = x - Lighting.firstTileX + Lighting.offScreenTiles; + int index2 = y - Lighting.firstTileY + Lighting.offScreenTiles; + return index1 < 0 || index2 < 0 || index1 >= Main.screenWidth / 16 + Lighting.offScreenTiles * 2 + 10 || index2 >= Main.screenHeight / 16 + Lighting.offScreenTiles * 2 + 10 ? Color.Black : new Color(0, 0, 0, (int) (byte) ((double) byte.MaxValue - (double) byte.MaxValue * (double) Lighting.states[index1][index2].r)); + } + + public static float Brightness(int x, int y) + { + int index1 = x - Lighting.firstTileX + Lighting.offScreenTiles; + int index2 = y - Lighting.firstTileY + Lighting.offScreenTiles; + if (index1 < 0 || index2 < 0 || index1 >= Main.screenWidth / 16 + Lighting.offScreenTiles * 2 + 10 || index2 >= Main.screenHeight / 16 + Lighting.offScreenTiles * 2 + 10) + return 0.0f; + Lighting.LightingState lightingState = Lighting.states[index1][index2]; + return (float) ((double) Lighting.brightness * ((double) lightingState.r + (double) lightingState.g + (double) lightingState.b) / 3.0); + } + + public static float BrightnessAverage(int x, int y, int width, int height) + { + int num1 = x - Lighting.firstTileX + Lighting.offScreenTiles; + int num2 = y - Lighting.firstTileY + Lighting.offScreenTiles; + int num3 = num1 + width; + int num4 = num2 + height; + if (num1 < 0) + num1 = 0; + if (num2 < 0) + num2 = 0; + if (num3 >= Main.screenWidth / 16 + Lighting.offScreenTiles * 2 + 10) + num3 = Main.screenWidth / 16 + Lighting.offScreenTiles * 2 + 10; + if (num4 >= Main.screenHeight / 16 + Lighting.offScreenTiles * 2 + 10) + num4 = Main.screenHeight / 16 + Lighting.offScreenTiles * 2 + 10; + float num5 = 0.0f; + float num6 = 0.0f; + for (int index1 = num1; index1 < num3; ++index1) + { + for (int index2 = num2; index2 < num4; ++index2) + { + ++num5; + Lighting.LightingState lightingState = Lighting.states[index1][index2]; + num6 += (float) (((double) lightingState.r + (double) lightingState.g + (double) lightingState.b) / 3.0); + } + } + return (double) num5 == 0.0 ? 0.0f : num6 / num5; + } + + private class LightingSwipeData + { + public int outerLoopStart; + public int outerLoopEnd; + public int innerLoop1Start; + public int innerLoop1End; + public int innerLoop2Start; + public int innerLoop2End; + public UnifiedRandom rand; + public Action function; + public Lighting.LightingState[][] jaggedArray; + + public LightingSwipeData() + { + this.innerLoop1Start = 0; + this.outerLoopStart = 0; + this.innerLoop1End = 0; + this.outerLoopEnd = 0; + this.innerLoop2Start = 0; + this.innerLoop2End = 0; + this.function = (Action) null; + this.rand = new UnifiedRandom(); + } + + public void CopyFrom(Lighting.LightingSwipeData from) + { + this.innerLoop1Start = from.innerLoop1Start; + this.outerLoopStart = from.outerLoopStart; + this.innerLoop1End = from.innerLoop1End; + this.outerLoopEnd = from.outerLoopEnd; + this.innerLoop2Start = from.innerLoop2Start; + this.innerLoop2End = from.innerLoop2End; + this.function = from.function; + this.jaggedArray = from.jaggedArray; + } + } + + private class LightingState + { + public float r; + public float r2; + public float g; + public float g2; + public float b; + public float b2; + public bool stopLight; + public bool wetLight; + public bool honeyLight; + + public Vector3 ToVector3() => new Vector3(this.r, this.g, this.b); + } + + private struct ColorTriplet + { + public float r; + public float g; + public float b; + + public ColorTriplet(float R, float G, float B) + { + this.r = R; + this.g = G; + this.b = B; + } + + public ColorTriplet(float averageColor) => this.r = this.g = this.b = averageColor; } } } diff --git a/Liquid.cs b/Liquid.cs index 3a132a5..64f1e79 100644 --- a/Liquid.cs +++ b/Liquid.cs @@ -1,37 +1,36 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Liquid -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using System; using System.Collections.Generic; -using Terraria.Audio; using Terraria.GameContent.NetModules; using Terraria.ID; using Terraria.Localization; +using Terraria.Net; using Terraria.ObjectData; namespace Terraria { public class Liquid { - public const int maxLiquidBuffer = 50000; - public static int maxLiquid = 25000; - public static int skipCount; - public static int stuckCount; - public static int stuckAmount; + public static int skipCount = 0; + public static int stuckCount = 0; + public static int stuckAmount = 0; public static int cycles = 10; - public static int curMaxLiquid = 0; + public static int resLiquid = 5000; + public static int maxLiquid = 5000; public static int numLiquid; - public static bool stuck; - public static bool quickFall; - public static bool quickSettle; + public static bool stuck = false; + public static bool quickFall = false; + public static bool quickSettle = false; private static int wetCounter; - public static int panicCounter; - public static bool panicMode; - public static int panicY; + public static int panicCounter = 0; + public static bool panicMode = false; + public static int panicY = 0; public int x; public int y; public int kill; @@ -47,28 +46,14 @@ namespace Terraria Liquid._netChangeSet.Add((x & (int) ushort.MaxValue) << 16 | y & (int) ushort.MaxValue); } - public static void tilesIgnoreWater(bool ignoreSolids) - { - Main.tileSolid[138] = !ignoreSolids; - Main.tileSolid[484] = !ignoreSolids; - Main.tileSolid[546] = !ignoreSolids; - } - - public static void worldGenTilesIgnoreWater(bool ignoreSolids) - { - Main.tileSolid[10] = !ignoreSolids; - Main.tileSolid[192] = !ignoreSolids; - Main.tileSolid[191] = !ignoreSolids; - Main.tileSolid[190] = !ignoreSolids; - } - public static void ReInit() { Liquid.skipCount = 0; Liquid.stuckCount = 0; Liquid.stuckAmount = 0; Liquid.cycles = 10; - Liquid.curMaxLiquid = Liquid.maxLiquid; + Liquid.resLiquid = 5000; + Liquid.maxLiquid = 5000; Liquid.numLiquid = 0; Liquid.stuck = false; Liquid.quickFall = false; @@ -77,222 +62,169 @@ namespace Terraria Liquid.panicCounter = 0; Liquid.panicMode = false; Liquid.panicY = 0; - if (!Main.Setting_UseReducedMaxLiquids) - return; - Liquid.curMaxLiquid = 5000; } - public static void QuickWater(int verbose = 0, int minY = -1, int maxY = -1) + public static double QuickWater(int verbose = 0, int minY = -1, int maxY = -1) { Main.tileSolid[379] = true; - Liquid.tilesIgnoreWater(true); + int num1 = 0; if (minY == -1) minY = 3; if (maxY == -1) maxY = Main.maxTilesY - 3; - for (int index = maxY; index >= minY; --index) + for (int index1 = maxY; index1 >= minY; --index1) { - Liquid.UpdateProgressDisplay(verbose, minY, maxY, index); - for (int originX = 4; originX < Main.maxTilesX - 4; ++originX) + if (verbose > 0) { - if (Main.tile[originX, index].liquid != (byte) 0) - Liquid.SettleWaterAt(originX, index); + float num2 = (float) (maxY - index1) / (float) (maxY - minY + 1) / (float) verbose; + Main.statusText = Lang.gen[27].Value + " " + (object) (int) ((double) num2 * 100.0 + 1.0) + "%"; } - } - Liquid.tilesIgnoreWater(false); - } - - private static void SettleWaterAt(int originX, int originY) - { - Tile tile1 = Main.tile[originX, originY]; - Liquid.tilesIgnoreWater(true); - if (tile1.liquid == (byte) 0) - return; - int X = originX; - int Y = originY; - bool tileAtXYHasLava = tile1.lava(); - bool tileAtXYHasHoney = tile1.honey(); - int liquid = (int) tile1.liquid; - byte num1 = tile1.liquidType(); - tile1.liquid = (byte) 0; - bool flag1 = true; - while (true) - { - Tile tile2 = Main.tile[X, Y + 1]; - bool flag2 = false; - for (; Y < Main.maxTilesY - 5 && tile2.liquid == (byte) 0 && (!tile2.nactive() || !Main.tileSolid[(int) tile2.type] || Main.tileSolidTop[(int) tile2.type]); tile2 = Main.tile[X, Y + 1]) + else if (verbose < 0) { - ++Y; - flag2 = true; - flag1 = false; + float num3 = (float) (maxY - index1) / (float) (maxY - minY + 1) / (float) -verbose; + Main.statusText = Lang.gen[18].Value + " " + (object) (int) ((double) num3 * 100.0 + 1.0) + "%"; } - if (flag2 && WorldGen.gen && !tileAtXYHasHoney && Y > WorldGen.waterLine) - num1 = (byte) 1; - int num2 = -1; - int num3 = 0; - int num4 = -1; - int num5 = 0; - bool flag3 = false; - bool flag4 = false; - bool flag5 = false; - while (true) + for (int index2 = 0; index2 < 2; ++index2) { - if (Main.tile[X + num3 * num2, Y].liquid == (byte) 0) + int num4 = 2; + int num5 = Main.maxTilesX - 2; + int num6 = 1; + if (index2 == 1) { - num4 = num2; - num5 = num3; + num4 = Main.maxTilesX - 2; + num5 = 2; + num6 = -1; } - if (num2 == -1 && X + num3 * num2 < 5) - flag4 = true; - else if (num2 == 1 && X + num3 * num2 > Main.maxTilesX - 5) - flag3 = true; - Tile tile3 = Main.tile[X + num3 * num2, Y + 1]; - if (tile3.liquid != (byte) 0 && tile3.liquid != byte.MaxValue && (int) tile3.liquidType() == (int) num1) + for (int index3 = num4; index3 != num5; index3 += num6) { - int num6 = (int) byte.MaxValue - (int) tile3.liquid; - if (num6 > liquid) - num6 = liquid; - tile3.liquid += (byte) num6; - liquid -= num6; - if (liquid == 0) - goto label_34; - } - if (Y >= Main.maxTilesY - 5 || tile3.liquid != (byte) 0 || tile3.nactive() && Main.tileSolid[(int) tile3.type] && !Main.tileSolidTop[(int) tile3.type]) - { - Tile tile4 = Main.tile[X + (num3 + 1) * num2, Y]; - if (tile4.liquid != (byte) 0 && (!flag1 || num2 != 1) || tile4.nactive() && Main.tileSolid[(int) tile4.type] && !Main.tileSolidTop[(int) tile4.type]) + Tile tile = Main.tile[index3, index1]; + if (tile.liquid > (byte) 0) { - if (num2 == 1) - flag3 = true; - else - flag4 = true; - } - if (!(flag4 & flag3)) - { - if (flag3) + int num7 = -num6; + bool flag1 = false; + int x = index3; + int y = index1; + byte num8 = tile.liquidType(); + bool flag2 = tile.lava(); + bool flag3 = tile.honey(); + byte liquid = tile.liquid; + tile.liquid = (byte) 0; + bool flag4 = true; + int num9 = 0; + while (flag4 && x > 3 && x < Main.maxTilesX - 3 && y < Main.maxTilesY - 3) { - num2 = -1; - ++num3; + flag4 = false; + while (Main.tile[x, y + 1].liquid == (byte) 0 && y < Main.maxTilesY - 5 && (!Main.tile[x, y + 1].nactive() || !Main.tileSolid[(int) Main.tile[x, y + 1].type] || Main.tileSolidTop[(int) Main.tile[x, y + 1].type])) + { + flag1 = true; + num7 = num6; + num9 = 0; + flag4 = true; + ++y; + if (y > WorldGen.waterLine && WorldGen.gen && !flag3) + num8 = (byte) 1; + } + if (Main.tile[x, y + 1].liquid > (byte) 0 && Main.tile[x, y + 1].liquid < byte.MaxValue && (int) Main.tile[x, y + 1].liquidType() == (int) num8) + { + int num10 = (int) byte.MaxValue - (int) Main.tile[x, y + 1].liquid; + if (num10 > (int) liquid) + num10 = (int) liquid; + Main.tile[x, y + 1].liquid += (byte) num10; + liquid -= (byte) num10; + if (liquid == (byte) 0) + { + ++num1; + break; + } + } + if (num9 == 0) + { + if (Main.tile[x + num7, y].liquid == (byte) 0 && (!Main.tile[x + num7, y].nactive() || !Main.tileSolid[(int) Main.tile[x + num7, y].type] || Main.tileSolidTop[(int) Main.tile[x + num7, y].type])) + num9 = num7; + else if (Main.tile[x - num7, y].liquid == (byte) 0 && (!Main.tile[x - num7, y].nactive() || !Main.tileSolid[(int) Main.tile[x - num7, y].type] || Main.tileSolidTop[(int) Main.tile[x - num7, y].type])) + num9 = -num7; + } + if (num9 != 0 && Main.tile[x + num9, y].liquid == (byte) 0 && (!Main.tile[x + num9, y].nactive() || !Main.tileSolid[(int) Main.tile[x + num9, y].type] || Main.tileSolidTop[(int) Main.tile[x + num9, y].type])) + { + flag4 = true; + x += num9; + } + if (flag1 && !flag4) + { + flag1 = false; + flag4 = true; + num7 = -num6; + num9 = 0; + } } - else if (flag4) + if (index3 != x && index1 != y) + ++num1; + Main.tile[x, y].liquid = liquid; + Main.tile[x, y].liquidType((int) num8); + if (Main.tile[x - 1, y].liquid > (byte) 0 && Main.tile[x - 1, y].lava() != flag2) { - if (num2 == 1) - ++num3; - num2 = 1; + if (flag2) + Liquid.LavaCheck(x, y); + else + Liquid.LavaCheck(x - 1, y); } - else + else if (Main.tile[x + 1, y].liquid > (byte) 0 && Main.tile[x + 1, y].lava() != flag2) { - if (num2 == 1) - ++num3; - num2 = -num2; + if (flag2) + Liquid.LavaCheck(x, y); + else + Liquid.LavaCheck(x + 1, y); + } + else if (Main.tile[x, y - 1].liquid > (byte) 0 && Main.tile[x, y - 1].lava() != flag2) + { + if (flag2) + Liquid.LavaCheck(x, y); + else + Liquid.LavaCheck(x, y - 1); + } + else if (Main.tile[x, y + 1].liquid > (byte) 0 && Main.tile[x, y + 1].lava() != flag2) + { + if (flag2) + Liquid.LavaCheck(x, y); + else + Liquid.LavaCheck(x, y + 1); + } + if (Main.tile[x, y].liquid > (byte) 0) + { + if (Main.tile[x - 1, y].liquid > (byte) 0 && Main.tile[x - 1, y].honey() != flag3) + { + if (flag3) + Liquid.HoneyCheck(x, y); + else + Liquid.HoneyCheck(x - 1, y); + } + else if (Main.tile[x + 1, y].liquid > (byte) 0 && Main.tile[x + 1, y].honey() != flag3) + { + if (flag3) + Liquid.HoneyCheck(x, y); + else + Liquid.HoneyCheck(x + 1, y); + } + else if (Main.tile[x, y - 1].liquid > (byte) 0 && Main.tile[x, y - 1].honey() != flag3) + { + if (flag3) + Liquid.HoneyCheck(x, y); + else + Liquid.HoneyCheck(x, y - 1); + } + else if (Main.tile[x, y + 1].liquid > (byte) 0 && Main.tile[x, y + 1].honey() != flag3) + { + if (flag3) + Liquid.HoneyCheck(x, y); + else + Liquid.HoneyCheck(x, y + 1); + } } } - else - goto label_34; } - else - break; } - flag5 = true; -label_34: - X += num5 * num4; - if (liquid != 0 && flag5) - ++Y; - else - break; - } - Main.tile[X, Y].liquid = (byte) liquid; - Main.tile[X, Y].liquidType((int) num1); - if (Main.tile[X, Y].liquid > (byte) 0) - { - Liquid.AttemptToMoveLava(X, Y, tileAtXYHasLava); - Liquid.AttemptToMoveHoney(X, Y, tileAtXYHasHoney); - } - Liquid.tilesIgnoreWater(false); - } - - private static void AttemptToMoveHoney(int X, int Y, bool tileAtXYHasHoney) - { - if (Main.tile[X - 1, Y].liquid > (byte) 0 && Main.tile[X - 1, Y].honey() != tileAtXYHasHoney) - { - if (tileAtXYHasHoney) - Liquid.HoneyCheck(X, Y); - else - Liquid.HoneyCheck(X - 1, Y); - } - else if (Main.tile[X + 1, Y].liquid > (byte) 0 && Main.tile[X + 1, Y].honey() != tileAtXYHasHoney) - { - if (tileAtXYHasHoney) - Liquid.HoneyCheck(X, Y); - else - Liquid.HoneyCheck(X + 1, Y); - } - else if (Main.tile[X, Y - 1].liquid > (byte) 0 && Main.tile[X, Y - 1].honey() != tileAtXYHasHoney) - { - if (tileAtXYHasHoney) - Liquid.HoneyCheck(X, Y); - else - Liquid.HoneyCheck(X, Y - 1); - } - else - { - if (Main.tile[X, Y + 1].liquid <= (byte) 0 || Main.tile[X, Y + 1].honey() == tileAtXYHasHoney) - return; - if (tileAtXYHasHoney) - Liquid.HoneyCheck(X, Y); - else - Liquid.HoneyCheck(X, Y + 1); - } - } - - private static void AttemptToMoveLava(int X, int Y, bool tileAtXYHasLava) - { - if (Main.tile[X - 1, Y].liquid > (byte) 0 && Main.tile[X - 1, Y].lava() != tileAtXYHasLava) - { - if (tileAtXYHasLava) - Liquid.LavaCheck(X, Y); - else - Liquid.LavaCheck(X - 1, Y); - } - else if (Main.tile[X + 1, Y].liquid > (byte) 0 && Main.tile[X + 1, Y].lava() != tileAtXYHasLava) - { - if (tileAtXYHasLava) - Liquid.LavaCheck(X, Y); - else - Liquid.LavaCheck(X + 1, Y); - } - else if (Main.tile[X, Y - 1].liquid > (byte) 0 && Main.tile[X, Y - 1].lava() != tileAtXYHasLava) - { - if (tileAtXYHasLava) - Liquid.LavaCheck(X, Y); - else - Liquid.LavaCheck(X, Y - 1); - } - else - { - if (Main.tile[X, Y + 1].liquid <= (byte) 0 || Main.tile[X, Y + 1].lava() == tileAtXYHasLava) - return; - if (tileAtXYHasLava) - Liquid.LavaCheck(X, Y); - else - Liquid.LavaCheck(X, Y + 1); - } - } - - private static void UpdateProgressDisplay(int verbose, int minY, int maxY, int y) - { - if (verbose > 0) - { - float num = (float) (maxY - y) / (float) (maxY - minY + 1) / (float) verbose; - Main.statusText = Lang.gen[27].Value + " " + (object) (int) ((double) num * 100.0 + 1.0) + "%"; - } - else - { - if (verbose >= 0) - return; - float num = (float) (maxY - y) / (float) (maxY - minY + 1) / (float) -verbose; - Main.statusText = Lang.gen[18].Value + " " + (object) (int) ((double) num * 100.0 + 1.0) + "%"; } + return (double) num1; } public void Update() @@ -306,12 +238,12 @@ label_34: if (tile5.nactive() && Main.tileSolid[(int) tile5.type] && !Main.tileSolidTop[(int) tile5.type]) { int type = (int) tile5.type; - this.kill = 999; + this.kill = 9; } else { byte liquid = tile5.liquid; - if (this.y > Main.UnderworldLayer && tile5.liquidType() == (byte) 0 && tile5.liquid > (byte) 0) + if (this.y > Main.maxTilesY - 200 && tile5.liquidType() == (byte) 0 && tile5.liquid > (byte) 0) { byte num = 2; if ((int) tile5.liquid < (int) num) @@ -320,7 +252,7 @@ label_34: } if (tile5.liquid == (byte) 0) { - this.kill = 999; + this.kill = 9; } else { @@ -374,22 +306,20 @@ label_34: } if ((!tile4.nactive() || !Main.tileSolid[(int) tile4.type] || Main.tileSolidTop[(int) tile4.type]) && (tile4.liquid <= (byte) 0 || (int) tile4.liquidType() == (int) tile5.liquidType()) && tile4.liquid < byte.MaxValue) { - bool flag = false; float num = (float) ((int) byte.MaxValue - (int) tile4.liquid); if ((double) num > (double) tile5.liquid) num = (float) tile5.liquid; - if ((double) num == 1.0 && tile5.liquid == byte.MaxValue) - flag = true; - if (!flag) - tile5.liquid -= (byte) num; + tile5.liquid -= (byte) num; tile4.liquid += (byte) num; tile4.liquidType((int) tile5.liquidType()); Liquid.AddWater(this.x, this.y + 1); tile4.skipLiquid(true); tile5.skipLiquid(true); - if (Liquid.quickSettle && tile5.liquid > (byte) 250) + if (tile5.liquid > (byte) 250) + { tile5.liquid = byte.MaxValue; - else if (!flag) + } + else { Liquid.AddWater(this.x - 1, this.y); Liquid.AddWater(this.x + 1, this.y); @@ -424,11 +354,6 @@ label_34: int num1 = 0; if (tile5.liquid < (byte) 3) num1 = -1; - if (tile5.liquid > (byte) 250) - { - flag3 = false; - flag4 = false; - } if (flag1 & flag2) { if (flag3 & flag4) @@ -564,7 +489,7 @@ label_34: } else if (flag3) { - float num6 = (float) Math.Round((double) ((int) tile1.liquid + (int) tile2.liquid + (int) Main.tile[this.x - 2, this.y].liquid + (int) tile5.liquid + num1) / 4.0); + float num6 = (float) Math.Round((double) ((int) tile1.liquid + (int) tile2.liquid + (int) Main.tile[this.x - 2, this.y].liquid + (int) tile5.liquid + num1) / 4.0 + 0.001); tile1.liquidType((int) tile5.liquidType()); if ((int) tile1.liquid != (int) (byte) num6 || (int) tile5.liquid != (int) (byte) num6) { @@ -587,7 +512,7 @@ label_34: } else if (flag4) { - float num7 = (float) Math.Round((double) ((int) tile1.liquid + (int) tile2.liquid + (int) Main.tile[this.x + 2, this.y].liquid + (int) tile5.liquid + num1) / 4.0); + float num7 = (float) Math.Round((double) ((int) tile1.liquid + (int) tile2.liquid + (int) Main.tile[this.x + 2, this.y].liquid + (int) tile5.liquid + num1) / 4.0 + 0.001); tile1.liquidType((int) tile5.liquidType()); if ((int) tile1.liquid != (int) (byte) num7 || (int) tile5.liquid != (int) (byte) num7) { @@ -610,27 +535,23 @@ label_34: } else { - float num8 = (float) Math.Round((double) ((int) tile1.liquid + (int) tile2.liquid + (int) tile5.liquid + num1) / 3.0); - if ((double) num8 == 254.0 && WorldGen.genRand.Next(30) == 0) - num8 = (float) byte.MaxValue; + float num8 = (float) Math.Round((double) ((int) tile1.liquid + (int) tile2.liquid + (int) tile5.liquid + num1) / 3.0 + 0.001); tile1.liquidType((int) tile5.liquidType()); if ((int) tile1.liquid != (int) (byte) num8) - { tile1.liquid = (byte) num8; + if ((int) tile5.liquid != (int) (byte) num8 || (int) tile1.liquid != (int) (byte) num8) Liquid.AddWater(this.x - 1, this.y); - } tile2.liquidType((int) tile5.liquidType()); if ((int) tile2.liquid != (int) (byte) num8) - { tile2.liquid = (byte) num8; + if ((int) tile5.liquid != (int) (byte) num8 || (int) tile2.liquid != (int) (byte) num8) Liquid.AddWater(this.x + 1, this.y); - } tile5.liquid = (byte) num8; } } else if (flag1) { - float num9 = (float) Math.Round((double) ((int) tile1.liquid + (int) tile5.liquid + num1) / 2.0); + float num9 = (float) Math.Round((double) ((int) tile1.liquid + (int) tile5.liquid + num1) / 2.0 + 0.001); if ((int) tile1.liquid != (int) (byte) num9) tile1.liquid = (byte) num9; tile1.liquidType((int) tile5.liquidType()); @@ -640,7 +561,7 @@ label_34: } else if (flag2) { - float num10 = (float) Math.Round((double) ((int) tile2.liquid + (int) tile5.liquid + num1) / 2.0); + float num10 = (float) Math.Round((double) ((int) tile2.liquid + (int) tile5.liquid + num1) / 2.0 + 0.001); if ((int) tile2.liquid != (int) (byte) num10) tile2.liquid = (byte) num10; tile2.liquidType((int) tile5.liquidType()); @@ -653,13 +574,8 @@ label_34: { if (tile5.liquid == (byte) 254 && liquid == byte.MaxValue) { - if (Liquid.quickSettle) - { - tile5.liquid = byte.MaxValue; - ++this.kill; - } - else - ++this.kill; + tile5.liquid = byte.MaxValue; + ++this.kill; } else { @@ -690,30 +606,15 @@ label_34: public static void UpdateLiquid() { - int num1 = 8; - Liquid.tilesIgnoreWater(true); - if (Main.netMode == 2) - { - int num2 = 0; - for (int index = 0; index < 15; ++index) - { - if (Main.player[index].active) - ++num2; - } - Liquid.cycles = 10 + num2 / 3; - Liquid.curMaxLiquid = Liquid.maxLiquid - num2 * 250; - num1 = 10 + num2 / 3; - if (Main.Setting_UseReducedMaxLiquids) - Liquid.curMaxLiquid = 5000; - } + int netMode1 = Main.netMode; if (!WorldGen.gen) { if (!Liquid.panicMode) { - if ((double) LiquidBuffer.numLiquidBuffer >= 45000.0) + if (Liquid.numLiquid + LiquidBuffer.numLiquidBuffer > 4000) { ++Liquid.panicCounter; - if (Liquid.panicCounter > 3600) + if (Liquid.panicCounter > 1800 || Liquid.numLiquid + LiquidBuffer.numLiquidBuffer > 13500) Liquid.StartPanic(); } else @@ -721,10 +622,10 @@ label_34: } if (Liquid.panicMode) { - int num3 = 0; - while (Liquid.panicY >= 3 && num3 < 5) + int num = 0; + while (Liquid.panicY >= 3 && num < 5) { - ++num3; + ++num; Liquid.QuickWater(minY: Liquid.panicY, maxY: Liquid.panicY); --Liquid.panicY; if (Liquid.panicY < 3) @@ -749,25 +650,22 @@ label_34: return; } } - bool quickSettle = Liquid.quickSettle; - if (Main.Setting_UseReducedMaxLiquids) - quickSettle |= Liquid.numLiquid > 2000; - Liquid.quickFall = quickSettle; + Liquid.quickFall = Liquid.quickSettle || Liquid.numLiquid > 2000; ++Liquid.wetCounter; - int num4 = Liquid.curMaxLiquid / Liquid.cycles; - int num5 = num4 * (Liquid.wetCounter - 1); - int num6 = num4 * Liquid.wetCounter; + int num1 = Liquid.maxLiquid / Liquid.cycles; + int num2 = num1 * (Liquid.wetCounter - 1); + int num3 = num1 * Liquid.wetCounter; if (Liquid.wetCounter == Liquid.cycles) - num6 = Liquid.numLiquid; - if (num6 > Liquid.numLiquid) + num3 = Liquid.numLiquid; + if (num3 > Liquid.numLiquid) { - num6 = Liquid.numLiquid; - int netMode = Main.netMode; + num3 = Liquid.numLiquid; + int netMode2 = Main.netMode; Liquid.wetCounter = Liquid.cycles; } if (Liquid.quickFall) { - for (int index = num5; index < num6; ++index) + for (int index = num2; index < num3; ++index) { Main.liquid[index].delay = 10; Main.liquid[index].Update(); @@ -776,7 +674,7 @@ label_34: } else { - for (int index = num5; index < num6; ++index) + for (int index = num2; index < num3; ++index) { if (!Main.tile[Main.liquid[index].x, Main.liquid[index].y].skipLiquid()) Main.liquid[index].Update(); @@ -789,17 +687,13 @@ label_34: Liquid.wetCounter = 0; for (int l = Liquid.numLiquid - 1; l >= 0; --l) { - if (Main.liquid[l].kill >= num1) - { - if (Main.tile[Main.liquid[l].x, Main.liquid[l].y].liquid == (byte) 254) - Main.tile[Main.liquid[l].x, Main.liquid[l].y].liquid = byte.MaxValue; + if (Main.liquid[l].kill > 4) Liquid.DelWater(l); - } } - int num7 = Liquid.curMaxLiquid - (Liquid.curMaxLiquid - Liquid.numLiquid); - if (num7 > LiquidBuffer.numLiquidBuffer) - num7 = LiquidBuffer.numLiquidBuffer; - for (int index = 0; index < num7; ++index) + int num4 = Liquid.maxLiquid - (Liquid.maxLiquid - Liquid.numLiquid); + if (num4 > LiquidBuffer.numLiquidBuffer) + num4 = LiquidBuffer.numLiquidBuffer; + for (int index = 0; index < num4; ++index) { Main.tile[Main.liquidBuffer[0].x, Main.liquidBuffer[0].y].checkingLiquid(false); Liquid.AddWater(Main.liquidBuffer[0].x, Main.liquidBuffer[0].y); @@ -823,32 +717,30 @@ label_34: Liquid.stuckAmount = Liquid.numLiquid; } } - if (!WorldGen.gen && Main.netMode == 2 && Liquid._netChangeSet.Count > 0) - { - Utils.Swap>(ref Liquid._netChangeSet, ref Liquid._swapNetChangeSet); - NetLiquidModule.CreateAndBroadcastByChunk(Liquid._swapNetChangeSet); - Liquid._swapNetChangeSet.Clear(); - } - Liquid.tilesIgnoreWater(false); + if (WorldGen.gen || Main.netMode != 2 || Liquid._netChangeSet.Count <= 0) + return; + Utils.Swap>(ref Liquid._netChangeSet, ref Liquid._swapNetChangeSet); + NetManager.Instance.Broadcast(NetLiquidModule.Serialize(Liquid._swapNetChangeSet)); + Liquid._swapNetChangeSet.Clear(); } public static void AddWater(int x, int y) { Tile checkTile = Main.tile[x, y]; - if (Main.tile[x, y] == null || checkTile.checkingLiquid() || x >= Main.maxTilesX - 5 || y >= Main.maxTilesY - 5 || x < 5 || y < 5 || checkTile.liquid == (byte) 0 || checkTile.nactive() && Main.tileSolid[(int) checkTile.type] && checkTile.type != (ushort) 546 && !Main.tileSolidTop[(int) checkTile.type]) + if (Main.tile[x, y] == null || checkTile.checkingLiquid() || x >= Main.maxTilesX - 5 || y >= Main.maxTilesY - 5 || x < 5 || y < 5 || checkTile.liquid == (byte) 0) return; - if (Liquid.numLiquid >= Liquid.curMaxLiquid - 1) + if (Liquid.numLiquid >= Liquid.maxLiquid - 1) { LiquidBuffer.AddBuffer(x, y); } else { checkTile.checkingLiquid(true); - checkTile.skipLiquid(false); Main.liquid[Liquid.numLiquid].kill = 0; Main.liquid[Liquid.numLiquid].x = x; Main.liquid[Liquid.numLiquid].y = y; Main.liquid[Liquid.numLiquid].delay = 0; + checkTile.skipLiquid(false); ++Liquid.numLiquid; if (Main.netMode == 2) Liquid.NetSendLiquid(x, y); @@ -871,32 +763,8 @@ label_34: } } - private static bool UnderGroundDesertCheck(int x, int y) - { - int num = 3; - for (int x1 = x - num; x1 <= x + num; ++x1) - { - for (int y1 = y - num; y1 <= y + num; ++y1) - { - if (WorldGen.InWorld(x1, y1) && (Main.tile[x1, y1].wall == (ushort) 187 || Main.tile[x1, y1].wall == (ushort) 216)) - return true; - } - } - return false; - } - public static void LavaCheck(int x, int y) { - if (WorldGen.generatingWorld && Liquid.UnderGroundDesertCheck(x, y)) - { - for (int index1 = x - 3; index1 <= x + 3; ++index1) - { - for (int index2 = y - 3; index2 <= y + 3; ++index2) - Main.tile[index1, index2].lava(true); - } - } - if (WorldGen.SolidTile(x, y)) - return; Tile tile1 = Main.tile[x - 1, y]; Tile tile2 = Main.tile[x + 1, y]; Tile tile3 = Main.tile[x, y - 1]; @@ -905,7 +773,7 @@ label_34: if (tile1.liquid > (byte) 0 && !tile1.lava() || tile2.liquid > (byte) 0 && !tile2.lava() || tile3.liquid > (byte) 0 && !tile3.lava()) { int num = 0; - int Type = 56; + int type = 56; if (!tile1.lava()) { num += (int) tile1.liquid; @@ -922,7 +790,7 @@ label_34: tile3.liquid = (byte) 0; } if (tile1.honey() || tile2.honey() || tile3.honey()) - Type = 230; + type = 230; if (num < 24) return; if (tile5.active() && Main.tileObsidianKill[(int) tile5.type]) @@ -931,39 +799,26 @@ label_34: if (Main.netMode == 2) NetMessage.SendData(17, number2: ((float) x), number3: ((float) y)); } - if (WorldGen.getGoodWorldGen) - { - if (!tile1.lava() && !tile2.lava() && !tile3.lava()) - tile5.lava(false); - else - tile5.lava(true); - } + if (tile5.active()) + return; + tile5.liquid = (byte) 0; + tile5.lava(false); + if (type == 56) + Main.PlaySound(SoundID.LiquidsWaterLava, new Vector2((float) (x * 16 + 8), (float) (y * 16 + 8))); else - { - if (tile5.active()) - return; - tile5.liquid = (byte) 0; - tile5.lava(false); - if (!WorldGen.gen) - { - if (Type == 56) - SoundEngine.PlaySound(SoundID.LiquidsWaterLava, new Vector2((float) (x * 16 + 8), (float) (y * 16 + 8))); - else - SoundEngine.PlaySound(SoundID.LiquidsHoneyLava, new Vector2((float) (x * 16 + 8), (float) (y * 16 + 8))); - } - WorldGen.PlaceTile(x, y, Type, true, true); - WorldGen.SquareTileFrame(x, y); - if (Main.netMode != 2) - return; - NetMessage.SendTileSquare(-1, x - 1, y - 1, 3, Type == 56 ? TileChangeType.LavaWater : TileChangeType.HoneyLava); - } + Main.PlaySound(SoundID.LiquidsHoneyLava, new Vector2((float) (x * 16 + 8), (float) (y * 16 + 8))); + WorldGen.PlaceTile(x, y, type, true, true); + WorldGen.SquareTileFrame(x, y); + if (Main.netMode != 2) + return; + NetMessage.SendTileSquare(-1, x - 1, y - 1, 3, type == 56 ? TileChangeType.LavaWater : TileChangeType.HoneyLava); } else { if (tile4.liquid <= (byte) 0 || tile4.lava()) return; bool flag = false; - if (tile5.active() && TileID.Sets.IsAContainer[(int) tile5.type] && !TileID.Sets.IsAContainer[(int) tile4.type]) + if (tile5.active() && TileID.Sets.ForceObsidianKill[(int) tile5.type] && !TileID.Sets.ForceObsidianKill[(int) tile4.type]) flag = true; if (Main.tileCut[(int) tile4.type]) { @@ -987,38 +842,29 @@ label_34: return; NetMessage.SendTileSquare(-1, x - 1, y, 3); } - else if (WorldGen.getGoodWorldGen) - { - if (!tile4.lava()) - tile5.lava(false); - else - tile5.lava(true); - } else { - int Type = 56; + int type = 56; if (tile4.honey()) - Type = 230; + type = 230; tile5.liquid = (byte) 0; tile5.lava(false); tile4.liquid = (byte) 0; - if (Type == 56) - SoundEngine.PlaySound(SoundID.LiquidsWaterLava, new Vector2((float) (x * 16 + 8), (float) (y * 16 + 8))); + if (type == 56) + Main.PlaySound(SoundID.LiquidsWaterLava, new Vector2((float) (x * 16 + 8), (float) (y * 16 + 8))); else - SoundEngine.PlaySound(SoundID.LiquidsHoneyLava, new Vector2((float) (x * 16 + 8), (float) (y * 16 + 8))); - WorldGen.PlaceTile(x, y + 1, Type, true, true); + Main.PlaySound(SoundID.LiquidsHoneyLava, new Vector2((float) (x * 16 + 8), (float) (y * 16 + 8))); + WorldGen.PlaceTile(x, y + 1, type, true, true); WorldGen.SquareTileFrame(x, y + 1); if (Main.netMode != 2) return; - NetMessage.SendTileSquare(-1, x - 1, y, 3, Type == 56 ? TileChangeType.LavaWater : TileChangeType.HoneyLava); + NetMessage.SendTileSquare(-1, x - 1, y, 3, type == 56 ? TileChangeType.LavaWater : TileChangeType.HoneyLava); } } } public static void HoneyCheck(int x, int y) { - if (WorldGen.SolidTile(x, y)) - return; Tile tile1 = Main.tile[x - 1, y]; Tile tile2 = Main.tile[x + 1, y]; Tile tile3 = Main.tile[x, y - 1]; @@ -1059,9 +905,9 @@ label_34: tile5.liquidType(0); WorldGen.PlaceTile(x, y, 229, true, true); if (flag) - SoundEngine.PlaySound(SoundID.LiquidsHoneyLava, new Vector2((float) (x * 16 + 8), (float) (y * 16 + 8))); + Main.PlaySound(SoundID.LiquidsHoneyLava, new Vector2((float) (x * 16 + 8), (float) (y * 16 + 8))); else - SoundEngine.PlaySound(SoundID.LiquidsHoneyWater, new Vector2((float) (x * 16 + 8), (float) (y * 16 + 8))); + Main.PlaySound(SoundID.LiquidsHoneyWater, new Vector2((float) (x * 16 + 8), (float) (y * 16 + 8))); WorldGen.SquareTileFrame(x, y); if (Main.netMode != 2) return; @@ -1102,9 +948,9 @@ label_34: tile4.liquid = (byte) 0; tile4.liquidType(0); if (flag) - SoundEngine.PlaySound(SoundID.LiquidsHoneyLava, new Vector2((float) (x * 16 + 8), (float) (y * 16 + 8))); + Main.PlaySound(SoundID.LiquidsHoneyLava, new Vector2((float) (x * 16 + 8), (float) (y * 16 + 8))); else - SoundEngine.PlaySound(SoundID.LiquidsHoneyWater, new Vector2((float) (x * 16 + 8), (float) (y * 16 + 8))); + Main.PlaySound(SoundID.LiquidsHoneyWater, new Vector2((float) (x * 16 + 8), (float) (y * 16 + 8))); WorldGen.PlaceTile(x, y + 1, 229, true, true); WorldGen.SquareTileFrame(x, y + 1); if (Main.netMode != 2) @@ -1140,7 +986,7 @@ label_34: if ((int) tile1.liquid < (int) tile4.liquid && (!tile1.nactive() || !Main.tileSolid[(int) tile1.type] || Main.tileSolidTop[(int) tile1.type]) || (int) tile2.liquid < (int) tile4.liquid && (!tile2.nactive() || !Main.tileSolid[(int) tile2.type] || Main.tileSolidTop[(int) tile2.type]) || tile3.liquid < byte.MaxValue && (!tile3.nactive() || !Main.tileSolid[(int) tile3.type] || Main.tileSolidTop[(int) tile3.type])) tile4.liquid = (byte) 0; } - else if (tile3.liquid < byte.MaxValue && (!tile3.nactive() || !Main.tileSolid[(int) tile3.type] || Main.tileSolidTop[(int) tile3.type]) && !Liquid.stuck && (!Main.tile[x, y].nactive() || !Main.tileSolid[(int) Main.tile[x, y].type] || Main.tileSolidTop[(int) Main.tile[x, y].type])) + else if (tile3.liquid < byte.MaxValue && (!tile3.nactive() || !Main.tileSolid[(int) tile3.type] || Main.tileSolidTop[(int) tile3.type]) && !Liquid.stuck) { Main.liquid[l].kill = 0; return; @@ -1153,10 +999,11 @@ label_34: } else { - if (tile2.liquid > (byte) 0 && tile2.liquid < (byte) 250 && (!tile2.nactive() || !Main.tileSolid[(int) tile2.type] || Main.tileSolidTop[(int) tile2.type]) && (int) tile4.liquid != (int) tile2.liquid) - Liquid.AddWater(x + 1, y); - if (tile1.liquid > (byte) 0 && tile1.liquid < (byte) 250 && (!tile1.nactive() || !Main.tileSolid[(int) tile1.type] || Main.tileSolidTop[(int) tile1.type]) && (int) tile4.liquid != (int) tile1.liquid) + if (tile2.liquid > (byte) 0 && Main.tile[x + 1, y + 1].liquid < (byte) 250 && !Main.tile[x + 1, y + 1].active() || tile1.liquid > (byte) 0 && Main.tile[x - 1, y + 1].liquid < (byte) 250 && !Main.tile[x - 1, y + 1].active()) + { Liquid.AddWater(x - 1, y); + Liquid.AddWater(x + 1, y); + } if (tile4.lava()) { Liquid.LavaCheck(x, y); @@ -1167,7 +1014,7 @@ label_34: Tile tile5 = Main.tile[i, j]; if (tile5.active()) { - if (tile5.type == (ushort) 2 || tile5.type == (ushort) 23 || tile5.type == (ushort) 109 || tile5.type == (ushort) 199 || tile5.type == (ushort) 477 || tile5.type == (ushort) 492) + if (tile5.type == (ushort) 2 || tile5.type == (ushort) 23 || tile5.type == (ushort) 109 || tile5.type == (ushort) 199) { tile5.type = (ushort) 0; WorldGen.SquareTileFrame(i, j); @@ -1195,21 +1042,9 @@ label_34: Main.liquid[l].x = Main.liquid[Liquid.numLiquid].x; Main.liquid[l].y = Main.liquid[Liquid.numLiquid].y; Main.liquid[l].kill = Main.liquid[Liquid.numLiquid].kill; - if (Main.tileAlch[(int) tile4.type]) - { - WorldGen.CheckAlch(x, y); - } - else - { - if (tile4.type != (ushort) 518) - return; - if (Liquid.quickFall) - WorldGen.CheckLilyPad(x, y); - else if (Main.tile[x, y + 1].liquid < byte.MaxValue || Main.tile[x, y - 1].liquid > (byte) 0) - WorldGen.SquareTileFrame(x, y); - else - WorldGen.CheckLilyPad(x, y); - } + if (!Main.tileAlch[(int) tile4.type]) + return; + WorldGen.CheckAlch(x, y); } } } diff --git a/LiquidBuffer.cs b/LiquidBuffer.cs index bc93059..ebf63a1 100644 --- a/LiquidBuffer.cs +++ b/LiquidBuffer.cs @@ -1,20 +1,21 @@ // Decompiled with JetBrains decompiler // Type: Terraria.LiquidBuffer -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria { public class LiquidBuffer { + public const int maxLiquidBuffer = 10000; public static int numLiquidBuffer; public int x; public int y; public static void AddBuffer(int x, int y) { - if (LiquidBuffer.numLiquidBuffer >= 49998 || Main.tile[x, y].checkingLiquid()) + if (LiquidBuffer.numLiquidBuffer == 9999 || Main.tile[x, y].checkingLiquid()) return; Main.tile[x, y].checkingLiquid(true); Main.liquidBuffer[LiquidBuffer.numLiquidBuffer].x = x; diff --git a/Localization/Content/de-DE.json b/Localization/Content/de-DE.json index 8d21266..11ef502 100644 --- a/Localization/Content/de-DE.json +++ b/Localization/Content/de-DE.json @@ -46,6 +46,7 @@ "48": "Terraria 2: Electric Boogaloo", "49": "Terraria: Und probier auch Minecraft aus!", "5": "Terraria: Die Geschichte eines Häschens", + "50": "Terraria: Und probier auch Edge of Space aus!", "51": "Terraria: Ich will bloß wissen, wo das Gold ist!", "52": "Terraria: Jetzt mit mehr Enten!", "53": "Terraria: 9 + 1 = 11", @@ -231,6 +232,7 @@ "TIMBER_Name": "Holz!!!", "TIN_FOIL_HATTER_Description": "Kämpfe gegen die Invasion vom Mars an, denn diese Außerirdischen kommen, um dein Gehirn zu verwirren und dir Sonden an unangenehme Stellen zu stecken.", "TIN_FOIL_HATTER_Name": "Alufolienirrer", + "TOPPED_OFF_Description": "Erhalte so viel Gesundheit und Mana wie nur möglich ohne Accessoires oder Buffs.", "TOPPED_OFF_Name": "Oberkante Unterlippe", "TROUT_MONKEY_Description": "Schließe deine 25. Quest für den Angler ab.", "TROUT_MONKEY_Name": "Forellenaffe", @@ -244,6 +246,7 @@ "WHERES_MY_HONEY_Name": "Wo ist mein Honig?", "WINTERHEARTED_Description": "Besiege die Eiskönigin, die böse Hexe der kältesten Nächte.", "WINTERHEARTED_Name": "Herz des Winters", + "WORM_FODDER_Description": "Besiege den Weltenfresser, ein massiver Wurm, der im Verderben lebt.", "WORM_FODDER_Name": "Wurmfutter", "YOU_AND_WHAT_ARMY_Description": "Befehlige neun beschworene Günstlinge gleichzeitig.", "YOU_AND_WHAT_ARMY_Name": "Du und welche Armee?", @@ -330,6 +333,7 @@ "Server": "Terraria-Server {0}", "ServerMessage": " {0}", "ServerStarted": "Server gestartet", + "SetInitialMaxPlayers": "Max. Spieler (drücke Eingabe für 8): ", "SetInitialPort": "Server-Port (drücke Eingabe für 7777): ", "SetMOTD_Command": "motd", "SetMOTD_Description": "MOTD ändern.", @@ -370,6 +374,7 @@ }, "Error": { "BadHeaderBufferOverflow": "Fehlerhafter Header hat zu Overflow beim Lesebuffer geführt.", + "CaptureError": "Ein Fehler ist beim Speichern aufgetreten. Neuer Versuch ...", "DataSentAfterConnectionLost": "Hat versucht, nach getrennter Verbindung Daten an den Client zu schicken", "Error": "Fehler", "ExceptionNormal": " Normale Ausnahme: {0}", @@ -428,9 +433,7 @@ "YellowWires": "Gelbe Kabel", "BirthdayParty_1": "Sieht so aus, als würde {0} eine Party schmeißen", "BirthdayParty_2": "Sieht so aus, als würden {0} & {1} eine Party schmeißen", - "BirthdayParty_3": "Sieht so aus, als würden {0}, {1} und {2} eine Party schmeißen", - "RespawnInPrefix": "", - "RespawnInSuffix": "{0}" + "BirthdayParty_3": "Sieht so aus, als würden {0}, {1} und {2} eine Party schmeißen" }, "GameUI": { "ActuationDeviceOff": "Aktuatoraparat AUS", @@ -447,6 +450,7 @@ "CompassCenter": "Zentral", "CompassEast": "{0}' Ost", "CompassWest": "{0}' West", + "CraftingWindow": "Herstellungsfenster", "Depth": "{0}'", "DepthLevel": "Level", "Disabled": "Deaktiviert", @@ -490,11 +494,12 @@ "PartlyCloudy": "Teils bewölkt", "PlayerDistance": "({0} ft)", "PrecentFishingPower": "{0}% Angelkraft", + "QuickStackToNearby": "Schnellstapeln in nahen Truhen", "Rain": "Regen", "RulerOff": "Lineal AUS", "RulerOn": "Lineal EIN", "SettingsMenu": "Einstellungsmenü", - "OpenFileFolder": "{$LegacyInterface.110}", + "SortInventory": "Inventar sortieren", "Speed": "{0} mph", "StormEffects": "Sturmeffekte: {0}", "ThirdQuarter": "Drittes Viertel", @@ -579,8 +584,8 @@ "MoveToCloud": "Zu Wolke hin", "New": "Neu", "Normal": "Normal", - "LightMode_White": "{$LegacyMenu.56}", - "LightMode_Color": "{$LegacyMenu.55}", + "NormalDescription": "(Die typische Terraria-Erfahrung)", + "NormalDescriptionFlavor": "Deine Reise beginnt ...", "Play": "Spielen", "RestoreButton": "Wiederherstellen", "Save": "Speichern", @@ -603,10 +608,7 @@ "SeedCopied": "Seed kopiert", "ZoomIn": "{$LegacyMenu.168}", "ZoomOut": "{$LegacyMenu.169}", - "Ellipsis": "...", - "LightMode_Retro": "{$LegacyMenu.57}", - "LightMode_Trippy": "{$LegacyMenu.58}", - "PlayerEmptyName": "{$Net.EmptyName}" + "Ellipsis": "..." }, "DeathSource": { "NPC": "{0} von {1}.", @@ -628,6 +630,7 @@ "Lava_3": "{0} hat versucht, in Lava zu schwimmen.", "Lava_4": "{0} spielt gerne in Magma.", "Petrified_1": "{0} ist in Stücke zerfallen.", + "Petrified_2": "{0} kann nicht wieder heile gemacht werden.", "Petrified_3": "{0} muss mit dem Besen aufgekehrt werden.", "Petrified_4": "{0} ist zum Dreckhaufen verkommen.", "Poisoned": "{0} konnte das Gegenmittel nicht finden.", @@ -690,8 +693,5 @@ "Chinese": "简体中文 (Vereinfachtes Chinesisch)", "Portuguese": "Português brasileiro (Portugiesisch (Brasilien))", "Polish": "Polski (Polnisch)" - }, - "RandomWorldName_Composition": { - "6": "{Adjective} {Location}" } } \ No newline at end of file diff --git a/Localization/Content/de-DE/Game.json b/Localization/Content/de-DE/Game.json index ff9e356..6f319cb 100644 --- a/Localization/Content/de-DE/Game.json +++ b/Localization/Content/de-DE/Game.json @@ -15,6 +15,9 @@ "AdamantiteCaster": "Um 19% reduzierte Mananutzung", "AdamantiteMelee": "Um 18% erhöhtes Nahkampf-und Bewegungstempo", "AdamantiteRanged": "25% Chance, keine Munition zu verbrauchen", + "HallowCaster": "Um 20% reduzierte Mananutzung", + "HallowMelee": "Um 19% erhöhtes Nahkampf-und Bewegungstempo", + "HallowRanged": "25% Chance, keine Munition zu verbrauchen", "ShadowScale": "Um 15% erhöhte Bewegungsgeschwindigkeit", "Wood": "1 Abwehr", "Crimson": "Erhöht Lebensregeneration deutlich", @@ -25,6 +28,7 @@ "Titanium": "Werde immun nach dem Angriff auf einen Gegner", "Chlorophyte": "Beschwört einen mächtigen Blattkristall mit dem du auf Gegner in der Nähe schießen kannst", "Wizard": "Um 10% erhöhte kritische Magie-Trefferchance", + "Turtle": "Angreifer stecken außerdem vollen Schaden ein", "Meteor": "Weltraumpistole kostet 0 Mana", "SpectreHealing": "Magieschaden bei Gegnern heilen den Spieler mit der niedrigsten Gesundheit", "Shroomite": "Stillstehen tarnt dich, erhöht deine Fernkampffähigkeiten\nund verringert die Chance, dass Gegner auf dich zielen", @@ -36,8 +40,13 @@ "BeetleDefense": "Käfer beschützen dich vor Schaden", "BeetleDamage": "Käfer erhöhen deinen Nahkampfschaden und -geschwindigkeit", "Bee": "Erhöht Günstlingschaden um 10%", + "Bone": "20% Chance, keine Munition zu verbrauchen", "Spider": "Erhöht Günstlingschaden um 12%", + "Ninja": "33% Chance, einen geworfenen Gegenstand nicht zu verbrauchen", + "Fossil": "50% Chance, einen geworfenen Gegenstand nicht zu verbrauchen", + "Solar": "Nach und nach werden Sonnenschilde erstellt, die dich beschützen.\nDu kannst sie verbrauchen, um zu sprinten und Gegner Schaden zuzufügen.", "Vortex": "Doppeltes Antippen {0} um Tarnung an- oder auszuschalten,\ndie Fernkampffähigkeiten zu erhöhen und die Chance zu verringern, dass Feinde auf dich zielen. Verringert allerdings auch Bewegungsgeschwindigkeit.", + "Nebula": "Wenn du Feinden weh tust, hast du die Chance, Buff-Booster zu spawnen.\nHebe sie auf, um gestapelte Buffs zu erhalten.", "Stardust": "Doppeltes Antippen {0}, um deinen Wächter an einen Ort zu lenken.", "Forbidden": "Doppeltes Antippen {0}, um einen alten Sturm über der Postion des Cursors zu beschwören", "Jungle": "Um 16% reduzierte Mananutzung", @@ -88,7 +97,7 @@ "Builder": "Platzierungstempo und Reichweite erhöht", "BunnyMount": "Du hast Schmacht nach Karotten", "Burning": "Verlust an Leben und verlangsamte Bewegung", - "DesertMinecartRight": "{$BuffDescription.MinecartRight}", + "Calm": "Verringerte Gegneraggression", "Campfire": "Lebensregeneration verbessert sich leicht", "ChaosState": "Die Rute der Zwietracht kostet Leben", "Chilled": "Deine Bewegungsgeschwindigkeit wurde verlangsamt", @@ -116,7 +125,7 @@ "FairyGreen": "Eine Fee folgt dir", "FairyRed": "Eine Fee folgt dir", "Featherfall": "Zur Kontrolle der Sinkgeschwindigkeit Hoch oder Runter drücken", - "DesertMinecartLeft": "{$BuffDescription.MinecartLeft}", + "Fishing": "Verbesserter Angellevel", "Flipper": "Ganz normal in Wasser bewegen", "Frostburn": "Ist entweder richtig kalt oder richtig heiß. Auf jeden Fall tut's WEH!", "Frozen": "Du kannst dich nicht bewegen!", @@ -178,7 +187,7 @@ "PetDD2Gato": "Ein Propeller-Gato folgt dir", "PetDD2Ghost": "Ein Flackerdocht folgt dir", "PetLizard": "Abchillen wie ein Reptil", - "FishMinecartRight": "{$BuffDescription.MinecartRight}", + "PetParrot": "Polly will Keks haben", "PetSapling": "Ein kleiner Schößling folgt dir", "PetSpider": "Eine Spinne folgt dir", "PetTurtle": "Frohe Schildkrötenzeit!", @@ -250,7 +259,7 @@ "WeaponImbuePoison": "Nahkampfangriffe vergiften Feinde", "WeaponImbueVenom": "Nahkampfangriffe fügen Zielen Giftschaden zu", "Webbed": "Du steckst fest", - "FishMinecartLeft": "{$BuffDescription.MinecartLeft}", + "WellFed": "Geringe Verbesserung aller Werte", "Werewolf": "Körperliche Leistungsfähigkeit ist erhöht", "Wet": "Du verlierst Wasser", "WindPushed": "Der Wind schiebt dich herum!", @@ -258,45 +267,7 @@ "WitheredArmor": "Deine Rüstung ist verringert!", "WitheredWeapon": "Deine Angriffe sind schwächer!", "Wrath": "Um 10% erhöhter Schaden", - "ZephyrFish": "Schwimmt gern um dich herum", - "BeeMinecartRight": "{$BuffDescription.MinecartRight}", - "BeeMinecartLeft": "{$BuffDescription.MinecartLeft}", - "LadybugMinecartRight": "{$BuffDescription.MinecartRight}", - "LadybugMinecartLeft": "{$BuffDescription.MinecartLeft}", - "PigronMinecartRight": "{$BuffDescription.MinecartRight}", - "PigronMinecartLeft": "{$BuffDescription.MinecartLeft}", - "SunflowerMinecartRight": "{$BuffDescription.MinecartRight}", - "SunflowerMinecartLeft": "{$BuffDescription.MinecartLeft}", - "HellMinecartRight": "{$BuffDescription.MinecartRight}", - "HellMinecartLeft": "{$BuffDescription.MinecartLeft}", - "ShroomMinecartRight": "{$BuffDescription.MinecartRight}", - "ShroomMinecartLeft": "{$BuffDescription.MinecartLeft}", - "AmethystMinecartRight": "{$BuffDescription.MinecartRight}", - "AmethystMinecartLeft": "{$BuffDescription.MinecartLeft}", - "TopazMinecartRight": "{$BuffDescription.MinecartRight}", - "TopazMinecartLeft": "{$BuffDescription.MinecartLeft}", - "SapphireMinecartRight": "{$BuffDescription.MinecartRight}", - "SapphireMinecartLeft": "{$BuffDescription.MinecartLeft}", - "EmeraldMinecartRight": "{$BuffDescription.MinecartRight}", - "EmeraldMinecartLeft": "{$BuffDescription.MinecartLeft}", - "RubyMinecartRight": "{$BuffDescription.MinecartRight}", - "RubyMinecartLeft": "{$BuffDescription.MinecartLeft}", - "DiamondMinecartRight": "{$BuffDescription.MinecartRight}", - "DiamondMinecartLeft": "{$BuffDescription.MinecartLeft}", - "AmberMinecartRight": "{$BuffDescription.MinecartRight}", - "AmberMinecartLeft": "{$BuffDescription.MinecartLeft}", - "BeetleMinecartRight": "{$BuffDescription.MinecartRight}", - "BeetleMinecartLeft": "{$BuffDescription.MinecartLeft}", - "MeowmereMinecartRight": "{$BuffDescription.MinecartRight}", - "MeowmereMinecartLeft": "{$BuffDescription.MinecartLeft}", - "PartyMinecartRight": "{$BuffDescription.MinecartRight}", - "PartyMinecartLeft": "{$BuffDescription.MinecartLeft}", - "PirateMinecartRight": "{$BuffDescription.MinecartRight}", - "PirateMinecartLeft": "{$BuffDescription.MinecartLeft}", - "SteampunkMinecartRight": "{$BuffDescription.MinecartRight}", - "SteampunkMinecartLeft": "{$BuffDescription.MinecartLeft}", - "CoffinMinecartRight": "{$BuffDescription.MinecartRight}", - "CoffinMinecartLeft": "{$BuffDescription.MinecartLeft}" + "ZephyrFish": "Schwimmt gern um dich herum" }, "BuffName": { "AmmoBox": "Munitionskiste", @@ -439,7 +410,7 @@ "Regeneration": "Wiederbelebung", "Rudolph": "Rudolph", "ScutlixMount": "Scutlix-Reittier", - "DesertMinecartRight": "{$BuffName.MinecartRight}", + "ShadowDodge": "Schattenausweichung", "ShadowFlame": "Schattenflamme", "ShadowOrb": "Schattenkugel", "SharknadoMinion": "Hainado", @@ -502,48 +473,7 @@ "WitheredArmor": "Vertrocknete Rüstung", "WitheredWeapon": "Vertrocknete Waffe", "Wrath": "Zorn", - "ZephyrFish": "Zephyrfisch", - "DesertMinecartLeft": "{$BuffName.MinecartLeft}", - "FishMinecartRight": "{$BuffName.MinecartRight}", - "FishMinecartLeft": "{$BuffName.MinecartLeft}", - "BeeMinecartRight": "{$BuffName.MinecartRight}", - "BeeMinecartLeft": "{$BuffName.MinecartLeft}", - "LadybugMinecartRight": "{$BuffName.MinecartRight}", - "LadybugMinecartLeft": "{$BuffName.MinecartLeft}", - "PigronMinecartRight": "{$BuffName.MinecartRight}", - "PigronMinecartLeft": "{$BuffName.MinecartLeft}", - "SunflowerMinecartRight": "{$BuffName.MinecartRight}", - "SunflowerMinecartLeft": "{$BuffName.MinecartLeft}", - "HellMinecartRight": "{$BuffName.MinecartRight}", - "HellMinecartLeft": "{$BuffName.MinecartLeft}", - "ShroomMinecartRight": "{$BuffName.MinecartRight}", - "ShroomMinecartLeft": "{$BuffName.MinecartLeft}", - "AmethystMinecartRight": "{$BuffName.MinecartRight}", - "AmethystMinecartLeft": "{$BuffName.MinecartLeft}", - "TopazMinecartRight": "{$BuffName.MinecartRight}", - "TopazMinecartLeft": "{$BuffName.MinecartLeft}", - "SapphireMinecartRight": "{$BuffName.MinecartRight}", - "SapphireMinecartLeft": "{$BuffName.MinecartLeft}", - "EmeraldMinecartRight": "{$BuffName.MinecartRight}", - "EmeraldMinecartLeft": "{$BuffName.MinecartLeft}", - "RubyMinecartRight": "{$BuffName.MinecartRight}", - "RubyMinecartLeft": "{$BuffName.MinecartLeft}", - "DiamondMinecartRight": "{$BuffName.MinecartRight}", - "DiamondMinecartLeft": "{$BuffName.MinecartLeft}", - "AmberMinecartRight": "{$BuffName.MinecartRight}", - "AmberMinecartLeft": "{$BuffName.MinecartLeft}", - "BeetleMinecartRight": "{$BuffName.MinecartRight}", - "BeetleMinecartLeft": "{$BuffName.MinecartLeft}", - "MeowmereMinecartRight": "{$BuffName.MinecartRight}", - "MeowmereMinecartLeft": "{$BuffName.MinecartLeft}", - "PartyMinecartRight": "{$BuffName.MinecartRight}", - "PartyMinecartLeft": "{$BuffName.MinecartLeft}", - "PirateMinecartRight": "{$BuffName.MinecartRight}", - "PirateMinecartLeft": "{$BuffName.MinecartLeft}", - "SteampunkMinecartRight": "{$BuffName.MinecartRight}", - "SteampunkMinecartLeft": "{$BuffName.MinecartLeft}", - "CoffinMinecartRight": "{$BuffName.MinecartRight}", - "CoffinMinecartLeft": "{$BuffName.MinecartLeft}" + "ZephyrFish": "Zephyrfisch" }, "MapObject": { "Adamantite": "Adamantit", @@ -615,166 +545,5 @@ "Roll": "{$LegacyMultiplayer.8}", "Party": "/g", "Emote": "/ich" - }, - "Bestiary_ItemDropConditions": { - "NotExpert": "", - "NotMasterMode": "", - "LegacyHack_IsBossAndNotExpert": "", - "IsCrimsonAndNotExpert": "", - "IsCorruptionAndNotExpert": "", - "NotFromStatue": "" - }, - "Bestiary_FlavorText": { - "npc_JungleSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_YellowSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_RedSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_PurpleSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_BlackSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_GreenSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_BlueSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_DemonEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_Zombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_Skeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_AngryBones": "{$CommonBestiaryFlavor.AngryBones}", - "npc_Hornet": "{$CommonBestiaryFlavor.Hornet}", - "npc_Hellbat": "{$CommonBestiaryFlavor.LavaBat}", - "npc_BlueJellyfish": "{$CommonBestiaryFlavor.Jellyfish}", - "npc_PinkJellyfish": "{$CommonBestiaryFlavor.Jellyfish}", - "npc_Mummy": "{$CommonBestiaryFlavor.Mummy}", - "npc_DarkMummy": "{$CommonBestiaryFlavor.Mummy}", - "npc_LightMummy": "{$CommonBestiaryFlavor.Mummy}", - "npc_Mimic": "{$CommonBestiaryFlavor.Mimic}", - "npc_GreenJellyfish": "{$CommonBestiaryFlavor.Jellyfish}", - "npc_BaldZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_WanderingEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_Penguin": "{$CommonBestiaryFlavor.Penguin}", - "npc_PenguinBlack": "{$CommonBestiaryFlavor.Penguin}", - "npc_Lavabat": "{$CommonBestiaryFlavor.LavaBat}", - "npc_PigronCorruption": "{$CommonBestiaryFlavor.Pigron}", - "npc_PigronHallow": "{$CommonBestiaryFlavor.Pigron}", - "npc_PigronCrimson": "{$CommonBestiaryFlavor.Pigron}", - "npc_PincushionZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_SwampZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_TwiggyZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_CataractEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_SleepyEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_DialatedEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_GreenEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_PurpleEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_FemaleZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_HeadacheSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_MisassembledSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_PantlessSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_HornetFatty": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetHoney": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetLeafy": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetSpikey": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetStingy": "{$CommonBestiaryFlavor.Hornet}", - "npc_ZombieMushroom": "{$CommonBestiaryFlavor.MushroomZombie}", - "npc_ZombieMushroomHat": "{$CommonBestiaryFlavor.MushroomZombie}", - "npc_FungiBulb": "{$CommonBestiaryFlavor.FungiBulb}", - "npc_GiantFungiBulb": "{$CommonBestiaryFlavor.FungiBulb}", - "npc_RustyArmoredBonesAxe": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_RustyArmoredBonesFlail": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_RustyArmoredBonesSword": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_RustyArmoredBonesSwordNoArmor": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_BlueArmoredBones": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_BlueArmoredBonesMace": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_BlueArmoredBonesNoPants": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_BlueArmoredBonesSword": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_HellArmoredBones": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_HellArmoredBonesSpikeShield": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_HellArmoredBonesMace": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_HellArmoredBonesSword": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_RaggedCaster": "{$CommonBestiaryFlavor.RaggedCaster}", - "npc_RaggedCasterOpenCoat": "{$CommonBestiaryFlavor.RaggedCaster}", - "npc_Necromancer": "{$CommonBestiaryFlavor.Necromancer}", - "npc_NecromancerArmored": "{$CommonBestiaryFlavor.Necromancer}", - "npc_DiabolistRed": "{$CommonBestiaryFlavor.Diabolist}", - "npc_DiabolistWhite": "{$CommonBestiaryFlavor.Diabolist}", - "npc_AngryBonesBig": "{$CommonBestiaryFlavor.AngryBones}", - "npc_AngryBonesBigMuscle": "{$CommonBestiaryFlavor.AngryBones}", - "npc_AngryBonesBigHelmet": "{$CommonBestiaryFlavor.AngryBones}", - "npc_Scarecrow1": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow2": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow3": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow4": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow5": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow6": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow7": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow8": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow9": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow10": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_DemonEyeOwl": "{$CommonBestiaryFlavor.CostumeDemonEye}", - "npc_DemonEyeSpaceship": "{$CommonBestiaryFlavor.CostumeDemonEye}", - "npc_ZombieDoctor": "{$CommonBestiaryFlavor.CostumeZombie}", - "npc_ZombieSuperman": "{$CommonBestiaryFlavor.CostumeZombie}", - "npc_ZombiePixie": "{$CommonBestiaryFlavor.CostumeZombie}", - "npc_SkeletonTopHat": "{$CommonBestiaryFlavor.CostumeSkeleton}", - "npc_SkeletonAstonaut": "{$CommonBestiaryFlavor.CostumeSkeleton}", - "npc_SkeletonAlien": "{$CommonBestiaryFlavor.CostumeSkeleton}", - "npc_ZombieXmas": "{$CommonBestiaryFlavor.ZombieXmas}", - "npc_ZombieSweater": "{$CommonBestiaryFlavor.ZombieXmas}", - "npc_SlimeRibbonWhite": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_SlimeRibbonYellow": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_SlimeRibbonGreen": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_SlimeRibbonRed": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_ZombieElf": "{$CommonBestiaryFlavor.ZombieElf}", - "npc_ZombieElfBeard": "{$CommonBestiaryFlavor.ZombieElf}", - "npc_ZombieElfGirl": "{$CommonBestiaryFlavor.ZombieElf}", - "npc_ArmedZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombiePincushion": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombieSwamp": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombieTwiggy": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombieCenx": "{$CommonBestiaryFlavor.Zombie}", - "npc_GoldBird": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldBunny": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldButterfly": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldFrog": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldGrasshopper": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldMouse": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldWorm": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_BoneThrowingSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_BoneThrowingSkeleton2": "{$CommonBestiaryFlavor.Skeleton}", - "npc_BoneThrowingSkeleton3": "{$CommonBestiaryFlavor.Skeleton}", - "npc_BoneThrowingSkeleton4": "{$CommonBestiaryFlavor.Skeleton}", - "npc_GiantWalkingAntlion": "{$CommonBestiaryFlavor.AntlionCharger}", - "npc_GiantFlyingAntlion": "{$CommonBestiaryFlavor.AntlionSwarmer}", - "npc_DesertLamiaLight": "{$CommonBestiaryFlavor.Lamia}", - "npc_DesertLamiaDark": "{$CommonBestiaryFlavor.Lamia}", - "npc_SquirrelGold": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_SandShark": "{$CommonBestiaryFlavor.Sandshark}", - "npc_SandsharkCorrupt": "{$CommonBestiaryFlavor.Sandshark}", - "npc_SandsharkCrimson": "{$CommonBestiaryFlavor.Sandshark}", - "npc_SandsharkHallow": "{$CommonBestiaryFlavor.Sandshark}", - "npc_WalkingAntlion": "{$CommonBestiaryFlavor.AntlionCharger}", - "npc_FlyingAntlion": "{$CommonBestiaryFlavor.AntlionSwarmer}", - "npc_GoldGoldfish": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldGoldfishWalker": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_BlackDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_BlueDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_GreenDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_OrangeDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_RedDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_YellowDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_GoldDragonfly": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldLadyBug": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldWaterStrider": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldSeahorse": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_IceMimic": "{$CommonBestiaryFlavor.Mimic}", - "npc_GemSquirrelAmethyst": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelTopaz": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelSapphire": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelEmerald": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelRuby": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelDiamond": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelAmber": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemBunnyAmethyst": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyTopaz": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnySapphire": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyEmerald": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyRuby": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyDiamond": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyAmber": "{$CommonBestiaryFlavor.GemBunny}" } } \ No newline at end of file diff --git a/Localization/Content/de-DE/Items.json b/Localization/Content/de-DE/Items.json index 3b740d3..c6e1aba 100644 --- a/Localization/Content/de-DE/Items.json +++ b/Localization/Content/de-DE/Items.json @@ -232,6 +232,7 @@ "RedHusk": "Rote Hülse", "CyanHusk": "Zyan Hülse", "VioletHusk": "Violette Hülse", + "PurpleMucos": "Lila Mukus", "BlackInk": "Schwarze Tinte", "FlowerofFire": "Feuerblume", "DyeVat": "Färbebottich", @@ -538,6 +539,7 @@ "CarriageLantern": "Kutschlaterne", "AlchemyLantern": "Alchemielaterne", "DiablostLamp": "Diablostlampe", + "OilRagSconse": "Öllumpenhalter", "BlueDungeonChair": "Blauer Verliesstuhl", "BlueDungeonTable": "Blauer Verliestisch", "BlueDungeonWorkBench": "Blaue Verlieswerkbank", @@ -690,6 +692,7 @@ "NecroGreaves": "Nekro-Beinschützer", "CrimsonChest": "Purpurne Truhe", "HallowedChest": "Heilige Truhe", + "FrozenChest": "Gefrorene Truhe", "JungleKey": "Dschungelschlüssel", "CorruptionKey": "Verdorbener Schlüssel", "CrimsonKey": "Purpurner Schlüssel", @@ -760,6 +763,7 @@ "TitanstoneBlockWall": "Titansteinblockwand", "MagicCuffs": "Magische Handschellen", "MusicBoxSnow": "Spieluhr (Schnee)", + "MusicBoxSpace": "Spieluhr (Weltall)", "MusicBoxCrimson": "Spieluhr (Purpur)", "MusicBoxBoss4": "Spieluhr (Boss 4)", "SilverWatch": "Silberuhr", @@ -768,6 +772,7 @@ "MusicBoxRain": "Spieluhr (Regen)", "MusicBoxIce": "Spieluhr (Eis)", "MusicBoxDesert": "Spieluhr (Wüste)", + "MusicBoxOcean": "Spieluhr (Ozean)", "MusicBoxDungeon": "Spieluhr (Verlies)", "MusicBoxPlantera": "Spieluhr (Plantera)", "MusicBoxBoss5": "Spieluhr (Boss 5)", @@ -810,6 +815,7 @@ "DerplingBanner": "Derplingbanner", "EaterofSoulsBanner": "Seelenfresserbanner", "EnchantedSwordBanner": "Verzaubertes-Schwert-Banner", + "ZombieEskimoBanner": "Zombieeskimobanner", "FaceMonsterBanner": "Gesichtsmonsterbanner", "FloatyGrossBanner": "Schwebender-Ekel-Banner", "FlyingFishBanner": "Fliegender-Fisch-Banner", @@ -1003,6 +1009,7 @@ "SpookyDoor": "Schaurige Tür", "SpookyTable": "Schauriger Tisch", "SpookyWorkBench": "Schaurige Werkbank", + "SpookyPlatform": "Schaurige Klappe", "ReaperHood": "Sensenmannkapuze", "Diamond": "Diamant", "ReaperRobe": "Sensenmannrobe", @@ -1558,7 +1565,7 @@ "GuideVoodooFish": "Fremdenführer-Vodoofisch", "Wyverntail": "Lindwurmschwanz", "ZombieFish": "Zombiefisch", - "AmanitaFungifin": "Amanita-Pilzflosse", + "AmanitiaFungifin": "Amanitia-Pilzflosse", "Angelfish": "Engelsfisch", "BloodyManowar": "Blutige Galeere", "Bonefish": "Knochenfisch", @@ -1637,7 +1644,7 @@ "SwiftnessPotion": "Flinkheitstrank", "BlueArmoredBonesBanner": "Blaue-Gepanzerte-Knochen-Banner", "BlueCultistArcherBanner": "Blauer-Kultistenbogenschütze-Banner", - "ManaCloakStar": "", + "BlueCultistCasterBanner": "Blauer-Kultistenmagier-Banner", "BlueCultistFighterBanner": "Blauer-Kultistenkrieger-Banner", "BoneLeeBanner": "Bone Lee-Banner", "ClingerBanner": "Klettenbanner", @@ -2203,6 +2210,7 @@ "TacticalShotgun": "Taktische Schrotflinte", "RottenChunk": "Verfaulter Fleischbrocken", "IvyChest": "Efeutruhe", + "IceChest": "Eistruhe", "Marrow": "Mark", "UnholyTrident": "Unheiliger Dreizack", "FrostHelmet": "Frosthelm", @@ -2338,6 +2346,9 @@ "TheUndertaker": "Der Leichenbestatter", "TheMeatball": "Der Fleischklops", "TheRottedFork": "Die verwittere Gabel", + "EskimoHood": "Eskimokapuze", + "EskimoCoat": "Eskimomantel", + "EskimoPants": "Eskimohose", "LivingWoodChair": "Lebendes-Holz-Stuhl", "CactusChair": "Kaktusstuhl", "BoneChair": "Knochenstuhl", @@ -2527,7 +2538,10 @@ "ShoeSpikes": "Schuhspikes", "TigerClimbingGear": "Tiger-Kletterausrüstung", "Tabi": "Tabi", + "PinkEskimoHood": "Rosa Eskimokapuze", + "PinkEskimoCoat": "Rosa Eskimomantel", "Minishark": "Minihai", + "PinkEskimoPants": "Rosa Eskimohose", "PinkThread": "Rosa Faden", "ManaRegenerationBand": "Mana-Regenerationsband", "SandstorminaBalloon": "Sandsturm im Ballon", @@ -2602,6 +2616,7 @@ "AncientBattleArmorPants": "Verbotene Fäden", "AncientBattleArmorShirt": "Verbotene Roben", "AncientCloth": "Uralter Stoff", + "AncientCultistTrophy": "Uralte Kultistentrophäe", "AncientHorn": "Uraltes Horn", "AnglerTackleBag": "Anglerkasten", "AngryBonesBanner": "Wütende-Knochen-Banner", @@ -2697,6 +2712,7 @@ "BorealWoodTable": "Borealholztisch", "BorealWoodWall": "Borealholzwand", "BorealWoodWorkBench": "Borealholzwerkbank", + "BossMaskCultist": "Uralte Kultistenmaske", "BossMaskMoonlord": "Mondherrenmaske", "BottomlessBucket": "Bodenloser Wassereimer", "BouncyBomb": "Federnde Bombe", @@ -2820,6 +2836,7 @@ "DestroyerBossBag": "Schatzbeutel", "DestroyerMask": "Zerstörermaske", "Detonator": "Sprengzünder", + "DevDye": "Skiphs Blut", "DiamondGemsparkWall": "Diamant-Funkenedelstein-Wand", "DiamondGemsparkWallOff": "Offline-Diamant-Funkenedelstein-Wand", "DjinnLamp": "Wüstengeistlampe", @@ -2883,12 +2900,14 @@ "Fake_DynastyChest": "Gefangen Dynastietruhe", "Fake_EbonwoodChest": "Gefangen Ebenholztruhe", "Fake_FleshChest": "Gefangen Fleischtruhe", + "Fake_FrozenChest": "Gefangen Gefrorene Truhe", "Fake_GlassChest": "Gefangen Glastruhe", "Fake_GoldChest": "Gefangen Goldtruhe", "Fake_GraniteChest": "Gefangen Granittruhe", "Fake_GreenDungeonChest": "Gefangen Grüne Verliestruhe", "Fake_HallowedChest": "Gefangen Heilige Truhe", "Fake_HoneyChest": "Gefangen Honigtruhe", + "Fake_IceChest": "Gefangen Eistruhe", "Fake_IvyChest": "Gefangen Efeutruhe", "Fake_JungleChest": "Gefangen Dschungeltruhe", "Fake_LihzahrdChest": "Gefangen Lihzahrdtruhe", @@ -3558,6 +3577,7 @@ "SailfishBoots": "Speerfischstiefel", "SalamanderBanner": "Salamander-Banner", "SandElementalBanner": "Sand-Elementar-Banner", + "SandFallBlock": "Sandstrom", "SandFallWall": "Sandstrom-Wand", "SandsharkBanner": "Sandhai-Banner", "SandsharkCorruptBanner": "Knochenbeißer-Banner", @@ -3621,6 +3641,10 @@ "SkeletronBossBag": "Schatzbeutel", "SkeletronPrimeBossBag": "Schatzbeutel", "SkeletronPrimeMask": "Skeletron-Prime-Maske", + "SkiphsHelm": "Skiphs Maske", + "SkiphsPants": "Skiphs Bärenstiefel", + "SkiphsShirt": "Skiphs Oberkörper", + "SkiphsWings": "Skiphs Pratzen", "SkyBlueString": "Himmelblauer Faden", "SkyFracture": "Himmelsriss", "SkywareBathtub": "Himmelswarenbadewanne", @@ -3662,6 +3686,7 @@ "SmokeBlock": "Rauchblock", "SnailStatue": "Schneckenstatue", "SnowCloudBlock": "Schneewolke", + "SnowFallBlock": "Schneefall", "SnowFallWall": "Schneefall-Wand", "SolarCoriteBanner": "Korit-Banner", "SolarCrawltipedeBanner": "Krabbelfüßler-Banner", @@ -3806,6 +3831,7 @@ "TwilightHairDye": "Zwielicht-Haarfärbemittel", "TwinMask": "Zwillingsmaske", "TwinsBossBag": "Schatzbeutel", + "UltraBrightCampfire": "Ultrahelles Lagerfeuer", "UndeadVikingStatue": "Untoter-Wikinger-Statue", "UnicornStatue": "Einhornstatue", "UnicornWispDye": "Einhorn-Irrlicht-Farbstoff", @@ -3954,6 +3980,7 @@ "DungeonClockPink": "Rosa Verliesuhr", "DynastyDresser": "Dynastiekommode", "DynastyPiano": "Dynastieklavier", + "DynastyPlatform": "Dynastieklappe", "DynastySofa": "Dynastiesofa", "Fake_CrystalChest": "Gefangene Kristalltruhe", "Fake_GoldenChest": "Gefangene Goldtruhe", @@ -3978,6 +4005,10 @@ "SquireAltPants": "Beinschützer des Walhalla-Ritters", "SquireAltShirt": "Brustplatte des Walhalla-Ritters", "SkywareClock2": "Sonnenplattenuhr", + "ArkhalisHat": "Arkhalis Kapuze", + "ArkhalisShirt": "Arkhalis Korsett", + "ArkhalisPants": "Arkhalis Strumpfhose", + "ArkhalisWings": "Arkhalis Lichtschwingen", "LeinforsHat": "Leinfors‘ Haarschutz", "LeinforsShirt": "Leinfors‘ übertriebener Stil", "LeinforsPants": "Leinfors‘ schicke Hose", @@ -4003,7 +4034,7 @@ "Paintbrush": "Verwendet mit Farbe, um Blöcke anzumalen", "PaintRoller": "Verwendet mit Farbe, um Wände anzumalen", "ManaCrystal": "Erhöht maximales Mana dauerhaft um 20", - "GolfBallDyedPink": "{$CommonItemTooltip.GolfBall}", + "PaintScraper": "Zum Entfernen von Farbe", "TealMushroom": "Um blaugrünen Farbstoff herzustellen", "GreenMushroom": "Um grünen Farbstoff herzustellen", "SkyBlueFlower": "Um himmelblauen Farbstoff herzustellen", @@ -4027,7 +4058,7 @@ "MagicMissile": "Wirft eine steuerbare Rakete aus", "Beenade": "Explodiert in einen Schwarm Bienen", "GravityGlobe": "Lässt den Besitzer die Schwerkraft umkehren\nDrücke HOCH, um die Schwerkraft zu ändern", - "KiteRed": "{$CommonItemTooltip.Kite}", + "HoneyComb": "Verströmt Bienen, wenn beschädigt", "Abeemination": "Beschwört die Bienenkönigin", "DirtRod": "Bewegt magisch Dreck", "TempleKey": "Öffnet die Tür zum Dschungeltempel", @@ -4036,10 +4067,10 @@ "LihzahrdPressurePlate": "Wird aktiviert, wenn ein Spieler drauftritt", "PiranhaGun": "Hängt sich an Gegner heran, um durchgehend für Schaden zu sorgen", "PygmyStaff": "Beschwört einen Pygmäen, der für dich kämpft", - "KiteBlueAndYellow": "{$CommonItemTooltip.Kite}", - "KiteBlue": "{$CommonItemTooltip.Kite}", - "KiteWyvern": "{$CommonItemTooltip.Kite}", - "GroxTheGreatGreaves": "{$CommonItemTooltip.DevItem}", + "PygmyNecklace": "Erhöht die maximale Anzahl deiner Günstlinge", + "TikiMask": "Erhöht die maximale Anzahl deiner Günstlinge\nErhöht Günstlingschaden um 10%", + "TikiShirt": "Erhöht die maximale Anzahl deiner Günstlinge\nErhöht Günstlingschaden um 10%", + "TikiPants": "Erhöht die maximale Anzahl deiner Günstlinge\nErhöht Günstlingschaden um 10%", "LeafWings": "{$CommonItemTooltip.FlightAndSlowfall}", "BlizzardinaBalloon": "Ermöglicht einen Doppelsprung\nVergrößert die Sprunghöhe", "BundleofBalloons": "Ermöglicht einen Vierfachsprung\nVergrößert die Sprunghöhe", @@ -4088,19 +4119,19 @@ "MeteorSuit": "Um 7% erhöhter magischer Schaden", "AmberMosquito": "Beschwört einen Babydinosaurier", "NimbusRod": "Beschwört eine Wolke herauf, die sich über deinen Gegnern ausregnet", - "GroxTheGreatArmor": "{$CommonItemTooltip.DevItem}", + "BeeCloak": "Lässt Sterne fallen und verströmt Bienen, wenn verletzt", "EyeoftheGolem": "Kritische Trefferchance um 10% erhöht", "HoneyBalloon": "Vergrößert die Sprunghöhe\nVerströmt Bienen, wenn beschädigt", "MeteorLeggings": "Um 7% erhöhter magischer Schaden", "BlueHorseshoeBalloon": "Ermöglicht einen Doppelsprung\nVerbessert Sprunghöhe und annulliert Fallschaden", "WhiteHorseshoeBalloon": "Ermöglicht einen Doppelsprung\nVerbessert Sprunghöhe und annulliert Fallschaden", "YellowHorseshoeBalloon": "Ermöglicht einen Doppelsprung\nVerbessert Sprunghöhe und annulliert Fallschaden", - "OceanCrate": "{$CommonItemTooltip.RightClickToOpen}", + "FrozenTurtleShell": "Hüllt den Besitzer in einen Panzer, der Schaden reduziert, wenn die Lebenspunkte unter 50% sinken", "SniperRifle": "Verschießt eine mächtige Hochgeschwindigkeitskugel\n zum Rauszoomen", "VenusMagnum": "Verschießt eine mächtige Hochgeschwindigkeitskugel", "CrimsonRod": "Beschwört eine Wolke herauf, die Blut über deinen Gegnern herabregnen lässt", - "SteampunkWings": "{$CommonItemTooltip.FlightAndSlowfall}", - "WingsVortex": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", + "Stynger": "Verschießt einen explosiven Bolzen", + "FlowerPow": "Verschießt rasiermesserscharfe Blütenblätter auf Gegner in der Nähe", "RainbowGun": "Verschießt einen Regenbogen, der dauerhaften Schaden anrichtet", "StyngerBolt": "Explodiert in tödliches Schrapnell", "FlowerofFrost": "Verschießt eine Frostkugel", @@ -4112,11 +4143,11 @@ "EmeraldRobe": "Erhöht das Höchstmana um 60\nReduziert Manaverbrauch um 11%", "RubyRobe": "Erhöht das Höchstmana um 60\nReduziert Manaverbrauch um 13%", "DiamondRobe": "Erhöht das Höchstmana um 80\nReduziert Manaverbrauch um 15%", - "GroxTheGreatHelm": "{$CommonItemTooltip.DevItem}", + "PanicNecklace": "Erhöht Bewegungstempo nach Treffer", "LifeFruit": "Erhöht die maximalen Lebenspunkte um 5", "LihzahrdPowerCell": "Wird am Lihzahrdaltar verwendet", "Picksaw": "Du kannst Lihzahrdziegel abbauen", - "JimsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "HeatRay": "Verschießt einen durchdringenden Hitzestrahl\n'Oolaa!!'", "StaffofEarth": "Beschwört einen mächtigen Felsbrocken", "GolemFist": "Schlägt mit der Kraft eines Golems zu", "Binoculars": "Erhöht Sichtweite, wenn gehalten", @@ -4136,8 +4167,8 @@ "TurtleHelmet": "Um 6% erhöhter Nahkampfschaden\nFeinde greifen dich eher an", "TurtleScaleMail": "Um 8% erhöhter Nahkampfschaden und Chance auf kritischen Treffer\nFeinde greifen dich eher an", "TurtleLeggings": "Um 4% erhöhte kritische Nahkampf-Trefferchance\nFeinde greifen dich eher an", - "KiteWorldFeeder": "{$CommonItemTooltip.Kite}", - "OasisCrateHard": "{$CommonItemTooltip.RightClickToOpen}", + "MagicQuiver": "Erhöht Schaden um 10% und erhöht Pfeilgeschwindigkeit stark\n20%ige Chance, keinen Pfeil zu verwenden", + "MagmaStone": "Richtet beim Angriff Feuerschaden an", "ObsidianRose": "Reduziert den Schaden beim Berühren von Lava", "RodofDiscord": "Teleportiert dich dorthin, wo die Maus ist", "DeathSickle": "Verschießt eine tödliche Sichel", @@ -4147,7 +4178,7 @@ "IchorArrow": "Reduziert die Verteidigung des Ziels", "IchorBullet": "Reduziert die Verteidigung des Ziels", "GoldenShower": "Versprüht einen Schauer von Ichor\nReduziert die Verteidigung des Ziels", - "OasisCrate": "{$CommonItemTooltip.RightClickToOpen}", + "FireGauntlet": "Erhöht Nahkampf-Rückstoß und richtet beim Angriff Feuerschaden an\nUm 10% erhöhter Nahkampfschaden und -geschwindigkeit", "ImbuingStation": "Um Tränkungsfläschchen für Waffen herzustellen", "EmptyBullet": "Um verschiedene Arten von Munition herzustellen", "ShadowbeamStaff": "Erschafft einen Schattenstahl, der von Wänden reflektiert wird", @@ -4176,17 +4207,17 @@ "CorruptionKey": "Öffnet eine Verderben-Truhe im Verlies", "CrimsonKey": "Öffnet eine Purpur-Truhe im Verlies", "HallowedKey": "Öffnet eine Heilige Truhe im Verlies", - "Cherry": "{$CommonItemTooltip.MinorStats}", + "FrozenKey": "Öffnet eine Gefrorene Truhe im Verlies", "SpectrePaintbrush": "Verwendet mit Farbe, um Blöcke anzumalen", "SpectrePaintRoller": "Verwendet mit Farbe, um Wände anzumalen", - "GolfBallDyedOrange": "{$CommonItemTooltip.GolfBall}", + "SpectrePaintScraper": "Zum Entfernen von Farbe", "ShroomiteHeadgear": "Um 15% erhöhter Pfeilschaden\nUm 5% erhöhte kritische Fernkampf-Trefferchance", "ShroomiteMask": "Um 15% erhöhter Kugelschaden\nUm 5% erhöhte kritische Fernkampf-Trefferchance", "ShroomiteHelmet": "Um 15% erhöhter Raketenschaden\nUm 5% erhöhte kritische Fernkampf-Trefferchance", - "KiteBoneSerpent": "{$CommonItemTooltip.Kite}", + "ShroomiteBreastplate": "Um 13% erhöhte kritische Fernkampf-Trefferchance\n20% Chance, keine Munition zu verbrauchen", "ShroomiteLeggings": "Um 7% erhöhte kritische Fernkampf-Trefferchance\nUm 12% erhöhte Bewegungsgeschwindigkeit", "Autohammer": "Verwandelt Grünalgenbarren in Pilzmitbarren", - "Jetpack": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressUpToBooster}", + "SDMG": "50% Chance, keine Munition zu verbrauchen\n‚Es kam vom Rand des Weltraums‘", "CenxsTiara": "{$CommonItemTooltip.DevItem}", "CenxsBreastplate": "{$CommonItemTooltip.DevItem}", "CenxsLeggings": "{$CommonItemTooltip.DevItem}", @@ -4206,17 +4237,17 @@ "VampireKnives": "Du wirst schnell Dolche, die Leben stehlen", "AquaScepter": "Lässt es Wasser herabregnen", "ScourgeoftheCorruptor": "Ein mächtiger Wurfspeer, der kleine Fresser entfesselt", - "Banana": "{$CommonItemTooltip.MinorStats}", + "StaffoftheFrostHydra": "Beschwört eine mächtige Frosthydra, die Eis auf deine Gegner spuckt", "SweetheartNecklace": "Verströmt Bienen und erhöht Bewegungstempo, wenn beschädigt", "FlurryBoots": "Der Träger kann superschnell rennen", "LuckyHorseshoe": "Hebt Sturzschaden auf", "DTownsHelmet": "{$CommonItemTooltip.DevItem}", "DTownsBreastplate": "{$CommonItemTooltip.DevItem}", "DTownsLeggings": "{$CommonItemTooltip.DevItem}", - "GroxTheGreatWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", - "StillLife": "{$PaintingArtist.Crowno}", - "BloodyGoblet": "{$PaintingArtist.Crowno}", - "WickedUndead": "{$PaintingArtist.Crowno}", + "DTownsWings": "{$CommonItemTooltip.DevItem}", + "WillsWings": "{$CommonItemTooltip.DevItem}", + "CrownosWings": "{$CommonItemTooltip.DevItem}", + "CenxsWings": "{$CommonItemTooltip.DevItem}", "CenxsDress": "{$CommonItemTooltip.DevItem}", "CenxsDressPants": "{$CommonItemTooltip.DevItem}", "ShinyRedBalloon": "Vergrößert die Sprunghöhe", @@ -4225,7 +4256,7 @@ "AnkhCharm": "Gibt dir Immunität für die meisten Schwächezauber", "AnkhShield": "Macht immun gegenüber Rückstoß und Feuerblöcken\nGibt dir Immunität für die meisten Schwächezauber", "WaterBolt": "Wirft einen sich langsam bewegenden Wasserbolzen aus", - "GolfBall": "{$CommonItemTooltip.GolfBall}", + "Bomb": "Eine kleine Explosion, die einige Felder zerstören wird", "Dynamite": "Eine große Explosion, die die meisten Felder zerstört", "Grenade": "Eine kleine Explosion, die keine Felder zerstört", "GoldWatch": "Sagt dir die Zeit", @@ -4237,7 +4268,7 @@ "GoodieBag": "{$CommonItemTooltip.RightClickToOpen}", "CandyCornRifle": "33% Chance, keine Munition zu verbrauchen", "Sickle": "Erlaubt das Sammeln von Heu aus Gras", - "KiteAngryTrapper": "{$CommonItemTooltip.Kite}", + "PumpkinPie": "{$CommonItemTooltip.MinorStats}", "TatteredFairyWings": "{$CommonItemTooltip.FlightAndSlowfall}", "SpiderEgg": "Beschwört eine zahme Spinne", "MagicalPumpkinSeed": "Beschwört einen zahmen Kürbisling", @@ -4253,35 +4284,35 @@ "UnluckyYarn": "Beschwört ein schwarzes Kätzchen", "TheHorsemansBlade": "Beschwört Kürbisköpfe, die deine Gegner angreifen", "SpookyWings": "{$CommonItemTooltip.FlightAndSlowfall}", - "GhostManifestation": "{$PaintingArtist.Crowno}", - "Graveyard": "{$PaintingArtist.Crowno}", - "Reborn": "{$PaintingArtist.Crowno}", + "SpookyHelmet": "Erhöht die maximale Anzahl deiner Günstlinge\nErhöht Günstlingschaden um 11%", + "SpookyBreastplate": "Erhöht die maximale Anzahl deiner Günstlinge\nErhöht Günstlingschaden um 11%", + "SpookyLeggings": "Erhöht die maximale Anzahl deiner Günstlinge\nErhöht Günstlingschaden um 11%", "CursedSapling": "Beschwört einen verwünschten Schößling, der dir folgt", "PumpkinMoonMedallion": "Beschwört den Kürbismond", - "Nevermore": "{$PaintingArtist.Crowno}", + "NecromanticScroll": "Erhöht die maximale Anzahl deiner Günstlinge\nErhöht Günstlingschaden um 10%", "SniperScope": "Erhöht Sichtweite für Schusswaffen ( zum Rauszoomen)\nUm 10% erhöhter Fernkampfschaden und kritische Trefferchance", "BreathingReed": "Erhöht Atemzeit und erlaubt es, unter Wasser zu atmen", "JellyfishDivingGear": "Befähigt zum Schwimmen und lässt dich um einiges länger unter Wasser atmen\nSorgt für Licht unter Wasser", "ArcticDivingGear": "Befähigt zum Schwimmen und lässt dich um einiges länger unter Wasser atmen\nSorgt unter Wasser für Licht und für bessere Beweglichkeit auf Eis", - "GnomeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.Gnome}", + "FrostsparkBoots": "Erlaubt Fliegen, superschnelles Rennen und sorgt für bessere Beweglichkeit auf Eis\nUm 7% erhöhte Bewegungsgeschwindigkeit", "FartInABalloon": "Ermöglicht einen Doppelsprung\nVergrößert die Sprunghöhe", - "DandelionBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.Dandelion}", - "GolfPainting3": "{$PaintingArtist.Crowno}", - "ArkhalisWings": "{$ItemTooltip.ArkhalisHat}\n{$CommonItemTooltip.FlightAndSlowfall}", + "PapyrusScarab": "Erhöht die maximale Anzahl deiner Günstlinge\nErhöht Schaden und Rückstoß deiner Günstline", + "CelestialStone": "Leichte Erhöhung bei Schaden, Nahkampfgeschwindigkeit, Chance auf kritischen Treffer,\nLebensregeneration, Verteidigung, Einsammelgeschwindigkeit und Günstling-Rückstoß", + "Hoverboard": "{$CommonItemTooltip.FlightAndSlowfall}\nNach UNTEN und SPRINGEN halten zum Schweben", "Present": "{$CommonItemTooltip.RightClickToOpen}", "Flipper": "Befähigt zum Schwimmen", "RedRyder": "‚Schieß dir nicht dein Auge raus!‘", "FestiveWings": "{$CommonItemTooltip.FlightAndSlowfall}", "BladeofGrass": "Kann Gegner vergiften", "EldMelter": "Verwendet Glibber als Munition", - "KiteGoldfish": "{$CommonItemTooltip.Kite}", + "ChristmasPudding": "{$CommonItemTooltip.MinorStats}", "ReindeerBells": "Beschwört ein Rentier zum Reiten", "CnadyCanePickaxe": "Kann Meteorite abbauen", - "KiteBunnyCrimson": "{$CommonItemTooltip.Kite}", - "KiteBunnyCorrupt": "{$CommonItemTooltip.Kite}", + "SugarCookie": "{$CommonItemTooltip.MinorStats}", + "GingerbreadCookie": "{$CommonItemTooltip.MinorStats}", "HandWarmer": "Macht immun gegen Kälte- und Einfriereffekte", "Coal": "‚Du warst unartig dieses Jahr.‘", - "GolfPainting2": "{$PaintingArtist.Crowno}", + "Toolbox": "Erhöht Itemplatzierung und Werkzeugreichweite um 1", "DogWhistle": "Beschwört einen Welpen", "ChristmasTreeSword": "Verschießt Weihnachtsdekoration", "ChainGun": "50% Chance, keine Munition zu verbrauchen", @@ -4297,7 +4328,7 @@ "JungleRose": "‚Oh, ist das hübsch!‘", "FeralClaws": "Um 12% erhöhtes Nahkampftempo", "AnkletoftheWind": "Um 10% erhöhte Bewegungsgeschwindigkeit", - "GolfClubIron": "{$CommonItemTooltip.GolfIron}", + "StaffofRegrowth": "Lässt Gras und Moos auf Schmutz und Steinen wachsen\nErhöht Sammlung von alchemistischen Pflanzen, wenn es zum Sammeln benutzt wird", "WhoopieCushion": "‚Kann Ärger erregen‘", "HeavyWorkBench": "Für fortgeschrittene Herstellung", "AmmoBox": "Reduziert Munitionsverbrauch um 20%", @@ -4318,7 +4349,7 @@ "SteampunkBoiler": "{$CommonItemTooltip.SpecialCrafting}", "HoneyDispenser": "{$CommonItemTooltip.SpecialCrafting}", "BrickLayer": "Erhöht die Geschwindigkeit, mit der Felder belegt werden", - "GolfPainting1": "{$PaintingArtist.Crowno}", + "ExtendoGrip": "Erhöht Feldreichweite", "PaintSprayer": "Platzierte Gegenstände werden automatisch angemalt", "PortableCementMixer": "Erhöht Platzierungstempo von Wänden", "CelestialMagnet": "Erhöht Einsammelreichweite bei Manasternen", @@ -4327,8 +4358,8 @@ "CelestialCuffs": "Erhöht Einsammelreichweite bei Manasternen\nStellt bei Beschädigung Mana wieder her", "PulseBow": "Verschießt einen geladenen Pfeil", "NaturesGift": "Um 6% reduzierte Mananutzung", - "KiteSandShark": "{$CommonItemTooltip.Kite}", - "KiteShark": "{$CommonItemTooltip.Kite}", + "PadThai": "{$CommonItemTooltip.MinorStats}", + "Pho": "{$CommonItemTooltip.MinorStats}", "RestorationPotion": "Reduzierte Abklingzeit für Tränke", "Gatligator": "50% Chance, keine Munition zu verbrauchen\nHöchst ungenau", "WaterGun": "Versprüht einen harmlosen Wasserstrahl", @@ -4341,14 +4372,14 @@ "Gel": "‚Sowohl lecker als auch entzündlich‘", "JunglePants": "Erhöht das Höchstmana um 20\nUm 4% erhöhte kritische Magie-Trefferchance", "NeonTetra": "‚Die farbigen Schuppen lassen sich sicher gut verkaufen.‘", - "Grapefruit": "{$CommonItemTooltip.MinorStats}", + "GoldenCarp": "So glänzend. Verkauft sich vermutlich gut.", "MiningPotion": "Erhöht Abbautempo um 25%", "HeartreachPotion": "Erhöht Einsammelreichweite bei Lebensherzen", - "DungeonFishingCrateHard": "{$ItemTooltip.DungeonFishingCrate}", + "CalmingPotion": "Verringerte Gegneraggression", "BuilderPotion": "Platzierungstempo und Reichweite erhöht", "TitanPotion": "Verbesserter Rückstoß", "FlipperPotion": "Lässt dich in Flüssigkeit schneller vorankommen", - "DivineEye": "{$PaintingArtist.Darthkitten}", + "SummoningPotion": "Erhöht die maximale Anzahl deiner Günstlinge", "TrapsightPotion": "Ermöglicht es dir, Gefahrenquellen in der Nähe zu sehen", "WoodenCrate": "{$CommonItemTooltip.RightClickToOpen}", "IronCrate": "{$CommonItemTooltip.RightClickToOpen}", @@ -4359,36 +4390,36 @@ "RagePotion": "Erhöht Chance auf kritischen Treffer um 10%", "InfernoPotion": "Setzt Gegner in der Nähe in Brand", "WrathPotion": "Erhöht Schaden um 10%", - "GolfClubDriver": "{$CommonItemTooltip.GolfDriver}", + "StickyBomb": "‚Werfen könnte schwer werden.‘", "RecallPotion": "Teleportiert dich nach Hause", "TeleportationPotion": "Teleportiert dich an einen zufälligen Ort", "LovePotion": "Auf jemanden werfen, damit er sich verliebt", "StinkPotion": "Auf jemanden werfen, um ihn stinken zu lassen", - "BandageBoy": "{$PaintingArtist.Darthkitten}", + "FishingPotion": "Verbessert Angelfähigkeit", "SonarPotion": "Entdeckt Fisch am Haken", "CratePotion": "Erhöht Chance auf Kiste", "WarmthPotion": "Verringert Schaden aus kalten Quellen", - "VisitingThePyramids": "{$PaintingArtist.Leinfors}", - "Uluru": "{$PaintingArtist.darthmorf}", + "BeeHeadgear": "Erhöht Günstlingschaden um 4%\nErhöht die maximale Anzahl deiner Günstlinge", + "BeeBreastplate": "Erhöht Günstlingschaden um 4%\nErhöht die maximale Anzahl deiner Günstlinge", "BeeGreaves": "Erhöht Günstlingschaden um 5%", "HornetStaff": "Beschwört eine Hornisse, die für dich kämpft", "ImpStaff": "Beschwört einen Kobold, der für dich kämpft", - "Oasis": "{$PaintingArtist.Khaios}", - "LifeAboveTheSand": "{$PaintingArtist.Zoomo}", - "SnakesIHateSnakes": "{$PaintingArtist.Xman101}", + "AnglerHat": "Verbessert Angellevel", + "AnglerVest": "Verbessert Angellevel", + "AnglerPants": "Verbessert Angellevel", "Sunglasses": "‚Lässt dich cool aussehen!‘", - "TheSandsOfSlime": "{$PaintingArtist.Criddle}", - "JawsOfDeath": "{$PaintingArtist.Darthkitten}", - "BurningSpirit": "{$PaintingArtist.Zoomo}", + "SpiderMask": "Erhöht die maximale Anzahl deiner Günstlinge\nErhöht Günstlingschaden um 6%", + "SpiderBreastplate": "Erhöht die maximale Anzahl deiner Günstlinge\nErhöht Günstlingschaden um 6%", + "SpiderGreaves": "Erhöht die maximale Anzahl deiner Günstlinge\nErhöht Günstlingschaden um 6%", "HighTestFishingLine": "Angelschnur reißt nie", - "FruitSalad": "{$CommonItemTooltip.MinorStats}", + "AnglerEarring": "Verbessert Angelfähigkeit", "TackleBox": "Verringert die Chance auf Köderverbrauch", "WizardHat": "Um 15% erhöhter magischer Schaden", "ZephyrFish": "Beschwört einen zahmen Zephyrfisch", "FrogLeg": "Erhöht das Sprungtempo und ermöglicht automatisches Springen\nErhöht Fallwiderstand", - "Dragonfruit": "{$CommonItemTooltip.MediumStats}", - "KiteJellyfishPink": "{$CommonItemTooltip.Kite}", - "KiteJellyfishBlue": "{$CommonItemTooltip.Kite}", + "CookedFish": "{$CommonItemTooltip.MinorStats}", + "CookedShrimp": "{$CommonItemTooltip.MinorStats}", + "Sashimi": "{$CommonItemTooltip.MinorStats}", "FinWings": "{$CommonItemTooltip.FlightAndSlowfall}", "OpticStaff": "Beschwört Zwillinge, die für dich kämpfen", "RedHat": "Das riecht komisch ...", @@ -4421,13 +4452,13 @@ "HunterPotion": "Zeigt die Position von Feinden", "GravitationPotion": "Zur Steuerung der Schwerkraft", "IllegalGunParts": "‚An den meisten Orten verboten‘", - "GolfClubWedge": "{$CommonItemTooltip.GolfWedge}", - "BetsyWings": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", + "GoldenKey": "Öffnet eine Gold- oder Verliestruhe", + "ShadowKey": "Öffnet alle Schattentruhen", "Furnace": "Wird für die Verhüttung von Erz verwendet", "Loom": "Verwendet für die Herstellung von Kleidung", "IronAnvil": "Wird verwendet, um Items aus Metallbarren herzustellen", "Keg": "Zum Bierbrauen", - "KiteManEater": "{$CommonItemTooltip.Kite}", + "BowlofSoup": "{$CommonItemTooltip.MinorStats}", "WorkBench": "Wird zur einfachen Herstellung verwendet", "GoblinBattleStandard": "Ruft eine Goblin-Armee herbei", "Sawmill": "Für fortgeschrittene Holzherstellung", @@ -4440,7 +4471,7 @@ "MythrilHat": "Um 12% erhöhter Fernkampfschaden\nUm 7% erhöhte kritische Fernkampf-Trefferchance", "CobaltDrill": "Kann Mithril und Oreichalkos abbauen", "MythrilDrill": "Kann Adamantit und Titan abbauen", - "WingsNebula": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", + "DaoofPow": "Kann Verwirrung stiften\n‚Finde deine inneren Stück‘", "Compass": "Zeigt horizontale Position", "DivingGear": "Befähigt zum Schwimmen\nVerleiht deutlich mehr Atemluft unter Wasser", "GPS": "Zeigt Position an\nSagt dir die Zeit", @@ -4454,14 +4485,14 @@ "AdamantiteBreastplate": "Um 6% erhöhter Schaden", "AdamantiteLeggings": "Kritische Trefferchance um 4% erhöht\nUm 5% erhöhte Bewegungsgeschwindigkeit", "SpectreBoots": "Lässt dich fliegen\nDer Träger kann superschnell rennen", - "FruitJuice": "{$CommonItemTooltip.MinorStats}", + "Toolbelt": "Erweitert den Platzierbereich von Blöcken", "HolyWater": "Verbreitet Heil auf einige Blöcke", - "CrimsonFishingCrateHard": "{$ItemTooltip.CrimsonFishingCrate}", + "UnholyWater": "Verbreitet Verderben auf einige Blöcke", "FairyBell": "Ruft eine magische Fee herbei", "SuspiciousLookingEye": "Ruft das Auge von Cthulhu herbei", "ClockworkAssaultRifle": "Dreifachschuss\nNur der erste Schuss verbraucht Munition", "MoonCharm": "Verwandelt den Besitzer nachts in einen Werwolf", - "KiteCrawltipede": "{$CommonItemTooltip.Kite}", + "Ruler": "Zeigt Linien auf dem Bildschirm zum Platzieren der Blöcke", "SorcererEmblem": "Um 15% erhöhter magischer Schaden", "BandofRegeneration": "Regeneriert langsam Leben", "WarriorEmblem": "Um 15% erhöhter Nahkampfschaden", @@ -4487,16 +4518,16 @@ "AdamantiteForge": "Zum Schmelzen von Adamantit- und Titanerz", "MythrilAnvil": "Zum Herstellen von Gegenständen aus Mithril- Oreichalkos- Adamantit- und Titanbarren", "UnicornHorn": "‚Scharf und magisch!‘", - "CrownosWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "DarkShard": "‚Kreaturen in verderbten Wüsten tragen sie mitunter‘", "LightShard": "‚Werden mitunter von Kreaturen in Lichtwüsten getragen‘", "RedPressurePlate": "Wird beim Drauftreten aktiviert", "CloudinaBottle": "Ermöglicht einen Doppelsprung", "SpellTome": "Kann verzaubert werden", - "PrismaticPunch": "{$CommonItemTooltip.MediumStats}", + "StarCloak": "Lässt Sterne bei Verletzung herabfallen", "Megashark": "50% Chance, keine Munition zu verbrauchen\n'Minihais großer Bruder'", "Shotgun": "Feuert einen Kugelregen ab", - "FrozenCrateHard": "{$CommonItemTooltip.RightClickToOpen}", - "Mango": "{$CommonItemTooltip.MinorStats}", + "PhilosophersStone": "Verringert die Abklingzeit von Heiltränken", + "TitanGlove": "Erhöht Nahkampf-Rückstoß", "HermesBoots": "Der Träger kann superschnell rennen", "GreenPressurePlate": "Wird beim Drauftreten aktiviert", "GrayPressurePlate": "Wird aktiviert, wenn ein Spieler drauftritt", @@ -4510,10 +4541,10 @@ "HallowedHelmet": "Um 15% erhöhter Fernkampfschaden\nUm 8% erhöhte kritische Fernkampf-Trefferchance", "CrossNecklace": "Verlängert die Unbesiegbarkeit nach erlittenem Schaden", "ManaFlower": "Um 8% reduzierte Mananutzung\nManatränke werden automatisch verbraucht, wenn nötig", - "Elderberry": "{$CommonItemTooltip.MinorStats}", + "MechanicalWorm": "Ruft den Zerstörer", "MechanicalSkull": "Ruft Skeletron Prime herbei", "HallowedHeadgear": "Erhöht das Höchstmana um 100\nUm 12% erhöhter Magieschaden und Chance auf kritischen Treffer", - "KiteYellow": "{$CommonItemTooltip.Kite}", + "HallowedMask": "Um 10% erhöhter Nahkampfschaden und Chance auf kritischen Treffer\nUm 10% erhöhte Nahkampfgeschwindigkeit", "DemoniteOre": "‚Durchpulst von dunkler Energie‘", "SlimeCrown": "Ruft Schleimkönig herbei", "LightDisc": "Kann bis zu 5 stapeln", @@ -4535,12 +4566,12 @@ "Vilethorn": "Ruft einen Ekeldorn herbei", "Starfury": "Lässt Sterne vom Himmel regnen\n'Geschmiedet mit Himmelswut'", "PurificationPowder": "Läutert das Böse", - "SmoothieofDarkness": "{$CommonItemTooltip.MinorStats}", + "RedsWings": "{$CommonItemTooltip.DevItem}", "RedsHelmet": "{$CommonItemTooltip.DevItem}", "RedsBreastplate": "{$CommonItemTooltip.DevItem}", "RedsLeggings": "{$CommonItemTooltip.DevItem}", "Fish": "Beschwört einen Babypinguin", - "BloodOrange": "{$CommonItemTooltip.MinorStats}", + "VilePowder": "Verbannt das Heilige", "Frostbrand": "Verschießt einen Eisbolzen", "RedPotion": "Nur für diejenigen, die würdig sind", "RottenChunk": "‚Sieht lecker aus!‘", @@ -4557,7 +4588,7 @@ "IceBlade": "Verschießt einen Eisbolzen", "IceBow": "Verschießt Frostpfeile", "FrostStaff": "Verschießt einen Froststrahl", - "BlueCultistCasterBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CultistDevote}", + "Jetpack": "{$CommonItemTooltip.FlightAndSlowfall}\nNach OBEN gedrückt halten, um schneller zu steigen", "ButterflyWings": "{$CommonItemTooltip.FlightAndSlowfall}", "FallenStar": "Verschwindet nach Sonnenaufgang", "Seaweed": "Beschwört eine zahme Schildkröte", @@ -4588,14 +4619,14 @@ "GreenWrench": "Platziert grünes Kabel", "BluePressurePlate": "Wird aktiviert, wenn ein Spieler drauftritt", "YellowPressurePlate": "Wird aktiviert, wenn etwas anderes als ein Spieler drauftritt", - "FrozenCrate": "{$CommonItemTooltip.RightClickToOpen}", + "DiscountCard": "Läden haben günstigere Preise", "LuckyCoin": "Angegriffene Gegner lassen mehr Münzen fallen", "UnicornonaStick": "‚Ich habe einen Riesenspaß!‘", "SandstorminaBottle": "Ermöglicht einen verbesserten Doppelsprung", - "CanOfWorms": "{$CommonItemTooltip.RightClickToOpen}", + "CharmofMyths": "Bietet Lebensregeneration und verringert die Abklingzeit von Heiltränken", "MoonShell": "Verwandelt den Besitzer nachts in einen Werwolf und beim Hineingehen ins Wasser in einen Meermenschen", "StarVeil": "Lässt Sterne herabfallen und verlängert Unverwundbarkeit nach eingestecktem Schaden", - "BloodyMoscato": "{$CommonItemTooltip.MinorStats}", + "WaterWalkingBoots": "Befähigt, auf dem Wasser zu gehen", "MiningHelmet": "Sorgt beim Tragen für Licht", "AdhesiveBandage": "Immun gegen Bluten", "ArmorPolish": "Immun gegen Beschädigte Rüstung", @@ -4606,28 +4637,28 @@ "Nazar": "Immun gegen Fluch", "Vitamins": "Immun gegen Schwäche", "TrifoldMap": "Immun gegen Verwirrung", - "Lemon": "{$CommonItemTooltip.MinorStats}", - "TropicalSmoothie": "{$CommonItemTooltip.MinorStats}", - "PinaColada": "{$CommonItemTooltip.MinorStats}", - "PeachSangria": "{$CommonItemTooltip.MinorStats}", + "PowerGlove": "Erhöht Nahkampf-Rückstoß\nUm 12% erhöhtes Nahkampftempo", + "LightningBoots": "Lässt dich fliegen\nDer Träger kann superschnell rennen", + "SunStone": "Erhöht alle Werte, wenn tagsüber getragen", + "MoonStone": "Erhöht alle Werte, wenn nachts getragen", "ArmorBracing": "Immun gegen Schwäche und Beschädigte Rüstung", "MedicatedBandage": "Immun gegen Gift und Bluten", "ThePlan": "Immun gegen Langsam und Verwirrung", "CountercurseMantra": "Immun gegen Schweigen und Fluch", "CoinGun": "Verwendet Münzen als Munition\nHöherwertige Münzen richten mehr Schaden an", "LavaCharm": "7 Sekunden Immunität gegen Lava", - "BananaDaiquiri": "{$CommonItemTooltip.MinorStats}", - "Pineapple": "{$CommonItemTooltip.MinorStats}", + "ObsidianWaterWalkingBoots": "Befähigt, auf dem Wasser zu gehen\nMacht immun gegen Feuer-Blöcke", + "LavaWaders": "Befähigt, auf dem Wasser und auf Lava zu gehen\nMacht immun gegen Feuerblöcke und 7 Sekunden lang gegen Lava", "BoneWand": "Platziert Knochen", "LeafWand": "Platziert Blätter", "FlyingCarpet": "Gestattet es dem Besitzer, ein paar Sekunden zu schweben", "AvengerEmblem": "Um 12% erhöhter Schaden", - "Lemonade": "{$CommonItemTooltip.MinorStats}", + "MechanicalGlove": "Erhöht Nahkampf-Rückstoß\nUm 12% erhöhter Schaden und Nahkampfgeschwindigkeit", "LandMine": "Explodiert beim Drauftreten", - "Starfruit": "{$CommonItemTooltip.MediumStats}", + "PaladinsShield": "Absorbiert 25% Schaden, der Spielern in deiner Gruppe zugefügt wird\nNur aktiv bei mehr als 25% Leben", "Umbrella": "Du fällst langsamer, wenn du das hältst", "ChlorophyteOre": "Reagiert auf Licht", - "GrapeJuice": "{$CommonItemTooltip.MajorStats}", + "SteampunkWings": "Ermöglicht Flug und langsames Fallen", "IceSkates": "Zusätzliche Beweglichkeit auf Eis\nEis zerbricht nicht, wenn du darauf fällst", "SnowballLauncher": "Feuert schnell nacheinander Schneebälle ab", "ClimbingClaws": "Ermöglicht es dir, Wände runterzurutschen\nVerbesserte Fähigkeit, wenn mit Schuhspikes kombiniert", @@ -4644,7 +4675,7 @@ "Campfire": "Lebensregeneration wird in der Nähe eines Lagerfeuers erhöht", "Marshmallow": "Auf einen Stock stecken und am Lagerfeuer braten", "MarshmallowonaStick": "Über einem Lagerfeuer braten!", - "Coconut": "{$CommonItemTooltip.MinorStats}", + "CookedMarshmallow": "{$CommonItemTooltip.MinorStats}", "ShoeSpikes": "Ermöglicht es dir, Wände runterzurutschen\nVerbesserte Fähigkeit, wenn es mit Kletterklauen kombiniert ist", "TigerClimbingGear": "Ermöglicht es dir, Wände hochzuklettern", "Tabi": "Ermöglicht es dir zu sprinten\nTippe doppelt in eine Richtung", @@ -4660,19 +4691,19 @@ "EatersBone": "Beschwört einen Baby-Seelenfresser", "BlendOMatic": "Um Objekte herzustellen", "MeatGrinder": "Um Objekte herzustellen", - "Rambutan": "{$CommonItemTooltip.MinorStats}", + "Extractinator": "Verwandelt Schlick/Schlacke/Fossilien in etwas Nützliches\n‚Anleitung: Schlick/Schlacke/Fossilien in den Extraktinator geben‘", "Solidifier": "Um Objekte herzustellen", "ActuationAccessory": "Platziert automatisch Aktoren auf platzierten Objekten", "ActuationRod": "Aktiviert Aktoren", "AlchemyTable": "33% Chance, keine Zutaten für die Trankherstellung zu verbrauchen", "AncientBattleArmorHat": "Um 15% erhöhter Magie- und Günstlingsschaden", - "AppleJuice": "{$CommonItemTooltip.MinorStats}", - "WoodenCrateHard": "{$ItemTooltip.WoodenCrate}", + "AncientBattleArmorPants": "Erhöht die maximale Anzahl deiner Günstlinge", + "AncientBattleArmorShirt": "Erhöht das Höchstmana um 80", "AncientHorn": "Beschwört einen Basilisken zum Reiten", - "BloodNautilusBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodNautilus}", - "GoblinSharkBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.GoblinShark}", + "AnglerTackleBag": "Angelschnur reißt nie, verringert Chance, dass Köder verbraucht wird, erhöht Angelfähigkeit", + "ArchitectGizmoPack": "Erhöht Feld- und Wandplatzierungsgeschwindigkeit und -reichweite\nPlatzierte Gegenstände werden automatisch angemalt", "AviatorSunglasses": "Ruf deinen inneren Flügelmann\n‚Toll, wenn man sich als Wimpel ausgeben will!‘", - "KitePigron": "{$CommonItemTooltip.Kite}", + "Bacon": "{$CommonItemTooltip.MinorStats}\n'Bacon? Bacon.'", "BalloonHorseshoeFart": "Ermöglicht einen Doppelsprung\nVerbessert Sprunghöhe und annulliert Fallschaden", "BalloonHorseshoeHoney": "Verströmt Bienen, wenn beschädigt\nVerbessert Sprunghöhe und annulliert Fallschaden", "BalloonHorseshoeSharkron": "Ermöglicht einen Doppelsprung\nVerbessert Sprunghöhe und annulliert Fallschaden", @@ -4680,26 +4711,26 @@ "BeesKnees": "Holzpfeile verwandelt sich in einen Bienenschwarm", "BejeweledValkyrieBody": "{$CommonItemTooltip.DevItem}\nElegant und mit Edelsteinen geschmückt, genau das Richtige, um durch die gewitterschweren Wolken zu fliegen", "BejeweledValkyrieHead": "{$CommonItemTooltip.DevItem}\nWerde zum Wind und reite auf dem Blitz.", - "BloodEelBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodEelHead}", + "BejeweledValkyrieWing": "{$CommonItemTooltip.DevItem}\nDie Walküren-Satellitenbarrierenklappe ist total sicher. Meistens.", "BewitchingTable": ", um mehr Günstlinge zu erhalten", "Bladetongue": "Speit bei Kontakt einen Ichorstrahl", "BlessedApple": "Beschwört ein Einhorn zum Reiten", - "CorruptFishingCrateHard": "{$ItemTooltip.CorruptFishingCrate}", - "JungleFishingCrateHard": "{$ItemTooltip.JungleFishingCrate}", + "BloodWater": "Verbreitet Purpur auf einige Blöcke", + "BombFish": "Eine kleine Explosion, die einige Felder zerstören wird", "BoneCampfire": "Lebensregeneration wird in der Nähe eines Lagerfeuers erhöht", "BoneRattle": "Beschwört ein Babygesichtmonster", "BoneTorch": "‚Gibt einen tödlichen Glanz ab‘", "BoosterTrack": "Hämmern zum Richtungsändern", - "GolfClubPutter": "{$CommonItemTooltip.GolfPutter}", - "HallowedFishingCrateHard": "{$ItemTooltip.HallowedFishingCrate}", - "KiteRedAndYellow": "{$CommonItemTooltip.Kite}", + "BottomlessBucket": "Enthält eine endlose Menge Wasser", + "BouncyBomb": "Eine kleine Explosion, die einige Felder zerstören wird\nSehr federnd", + "BouncyDynamite": "‚Das wird sich als schreckliche Idee rausstellen‘", "BouncyGlowstick": "Funktioniert bei Nässe", "BouncyGrenade": "Eine kleine Explosion, die keine Felder zerstört\nSehr federnd", - "WillsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "BrainOfConfusion": "Kann Feinde in der Nähe verwirren, wenn sie getroffen wurden", "BrainScrambler": "Beschwört ein Scutlix zum Reiten", "BubbleGun": "Verschießt starke Blasen schnell nacheinander", "ButchersChainsaw": "Getroffene Feinde versprühen Funken", - "BloodSquidBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodSquid}", + "CelestialShell": "Verwandelt den Besitzer nachts in einen Werwolf und beim Hineingehen ins Wasser in einen Meermenschen\nGeringe Verbesserung aller Werte", "CelestialSigil": "Beschwört bevorstehendes Unglück", "CellPhone": "Zeigt alles\nErmöglicht es dir, jederzeit nach Hause zu gelangen", "ClingerStaff": "Beschwört eine Wand aus verfluchten Flammen", @@ -4733,9 +4764,9 @@ "FloatingIslandFishingCrate": "{$CommonItemTooltip.RightClickToOpen}", "FlowerBoots": "Blumen wachsen auf dem Gras, auf dem du gehst", "FlyingKnife": "Wirft ein steuerbares fliegendes Messer", - "GolfBallDyedBrown": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedBlue": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedBlack": "{$CommonItemTooltip.GolfBall}", + "FossilHelm": "Wurfgeschwindigkeit erhöht um 20%", + "FossilPants": "Kritische Trefferchance beim Werfen um 15% erhöht", + "FossilShirt": "Wurfschaden erhöht um 20%", "FragmentNebula": "‚In diesem Fragment befindet sich die Macht einer Galaxie‘", "FragmentSolar": "‚In diesem Fragment befindet sich die Wut des Universums‘", "FragmentStardust": "‚Hypnotisierende Partikel schweben um dieses Fragment‘", @@ -4752,8 +4783,8 @@ "GoblinTech": "Zeigt Bewegungsgeschwindigkeit, Schaden pro Sekunde und wertvolles Erz", "GoldPickaxe": "Kann Meteorite abbauen", "GoldRing": "Erhöht Münzensammelreichweite", - "Plum": "{$CommonItemTooltip.MinorStats}", - "KiteBunny": "{$CommonItemTooltip.Kite}", + "GreedyRing": "Erhöht die Münzsammelreichweite und Läden haben bessere Preise\nAngegriffene Gegner lassen mehr Münzen fallen", + "GrubSoup": "{$CommonItemTooltip.MinorStats}", "HallowedFishingCrate": "{$CommonItemTooltip.RightClickToOpen}", "HardySaddle": "Beschwört eine Schildkröte zum Reiten", "HellwingBow": "Holzpfeile verwandeln sich in brennende Fledermäuse", @@ -4762,7 +4793,7 @@ "HoneyedGoggles": "Beschwört eine Biene zum Reiten", "IceMirror": "Ein Blick in den Spiegel bringt einen zurück nach Hause", "IchorCampfire": "Lebensregeneration wird in der Nähe eines Lagerfeuers erhöht", - "EyeballFlyingFishBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.EyeballFlyingFish}", + "JimsWings": "{$CommonItemTooltip.DevItem}", "JungleFishingCrate": "{$CommonItemTooltip.RightClickToOpen}", "LargeAmber": "Für Schnapp dir den Edelstein. Wird bei deinem Tod fallen gelassen", "LaserRuler": "Zeigt Linien auf dem Bildschirm zum Platzieren der Blöcke", @@ -4790,7 +4821,7 @@ "LokisHelm": "{$CommonItemTooltip.DevItem}\nUnordnung kommt von Ordnung, Angst kommt von Mut, Schwäche kommt von Stärke", "LokisPants": "{$CommonItemTooltip.DevItem}\nDie Mühlen der Gerechtigkeit mahlen langsam, aber fein.", "LokisShirt": "{$CommonItemTooltip.DevItem}\nKenne dich und kenne deinen Feind. Tausend Kämpfe und tausend Siege ...", - "ZombieMermanBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.ZombieMerman}", + "LokisWings": "{$CommonItemTooltip.DevItem}\nMögen deine Plände dunkel und undurchdringbar wie die Nacht sein, und wenn du dich bewegst, fallen sie herab wie Blitze.", "LunarBar": "‚Vibriert mit leuchtender, himmlischer Energie‘", "LunarCraftingStation": "Wird verwendet, um Items aus Mondfragmenten und Luminit herzustellen", "LunarFlareBook": "Lässt es Monderuptionen regnen", @@ -4806,7 +4837,7 @@ "MoneyTrough": "Beschwört ein Sparschwein, in dem du deine Items aufbewahren kannst", "MoonlordArrow": "‚Schießt sie runter mit Schallgeschwindigkeit!‘", "MoonlordBullet": "‚In einer Reihe aufstellen und runterhauen ...‘", - "Apricot": "{$CommonItemTooltip.MinorStats}", + "MoonlordTurretStaff": "Beschwört ein Mondportal, das Laserstrahlen auf deine Feinde schießt", "MothronWings": "{$CommonItemTooltip.FlightAndSlowfall}", "MulticolorWrench": " und gedrückt halten, um Kabeleinstellungen zu bearbeiten", "NebulaArcanum": "‚Beschwöre massenhaft astrale Energie, die deinen Feinden folgt‘", @@ -4817,9 +4848,9 @@ "NebulaMonolith": "‚Du verfügst über eine kleine Menge Macht vom Nebula-Turm‘", "NightKey": "‚Geladen mit der Essenz vieler Seelen‘", "NightVisionHelmet": "Verbessert die Sicht", - "GolfBallDyedLimeGreen": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedGreen": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedCyan": "{$CommonItemTooltip.GolfBall}", + "NinjaHood": "Wurfgeschwindigkeit erhöht um 15%", + "NinjaPants": "Kritische Trefferchance beim Werfen um 10% erhöht", + "NinjaShirt": "Wurfschaden erhöht um 15%", "PartyBundleOfBalloonTile": "‚Zum Wohle aller festgebunden‘", "PartyGirlGrenade": "Eine kleine Explosion, die keine Felder zerstört", "PartyMonolith": "‚Ballons werden vom Himmel regnen‘", @@ -4841,10 +4872,10 @@ "ProjectilePressurePad": "Wird aktiviert, wenn es von einer Kugel berührt wird", "PsychoKnife": "Ermöglicht es dir, dich zu tarnen", "PutridScent": "Feinde greifen dich seltener an\nUm 5% erhöhter Schaden und Chance auf kritischen Treffer", - "GolfBallDyedYellow": "{$CommonItemTooltip.GolfBall}", + "QueenSpiderStaff": "Beschwört eine Spinnenkönigin, die Eier auf deine Feinde speit", "Radar": "Erkennt Feinde um dich herum", "RainbowCampfire": "Lebensregeneration wird in der Nähe eines Lagerfeuers erhöht", - "GolfBallDyedViolet": "{$CommonItemTooltip.GolfBall}", + "RainbowCrystalStaff": "Beschwört einen hellen Kristall, der deine Feinde verbannt\n‚Die Farben, Herzog, die Farben!‘", "RazorbladeTyphoon": "Zaubert schnelle Klingenräder herbei", "RedsYoyo": "{$CommonItemTooltip.DevItem}", "REK": "Zeigt die Anzahl der Monster, den Kill-Count und seltene Kreaturen an", @@ -4875,30 +4906,30 @@ "SkiphsHelm": "{$CommonItemTooltip.DevItem}", "SkiphsPants": "{$CommonItemTooltip.DevItem}", "SkiphsShirt": "{$CommonItemTooltip.DevItem}", - "TheBrideBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.TheBride}", - "DTownsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "SkiphsWings": "{$CommonItemTooltip.DevItem}", + "SliceOfCake": "Rein in den Mund. Rein in den Mund von jemand anderem. Whatever.", "SlimeGun": "Versprüht einen harmlosen Schleimstrahl", "SlimySaddle": "Beschwört einen Schleim zum Reiten", - "KiteKoi": "{$CommonItemTooltip.Kite}", + "SnowCloudBlock": "Da oben wir es ziemlich kalt", "SnowFallBlock": "Sehr viel kälter als eine Schneekugel", "SnowFallWall": "Sehr viel kälter als eine Schneekugel", "SolarEruption": "‚Schlage mit dem Zorn der Sonne zu‘", - "RedsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", - "Hoverboard": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", - "CenxsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "SolarFlareBreastplate": "Um 22% erhöhter Nahkampfschaden\nFeinde greifen dich eher an", + "SolarFlareHelmet": "Um 17% erhöhte kritische Nahkampf-Trefferchance\nFeinde greifen dich eher an", + "SolarFlareLeggings": "Um 15% erhöhte Bewegungs- und Nahkampfgeschwindigkeit\nFeinde greifen dich eher an", "SolarMonolith": "‚Du verfügst über eine kleine Menge Macht vom Sonnenturm‘", "SolarTablet": "Beschwört die Sonnenfinsternis", "SoulDrain": "Zieht Feinden Leben ab", "SpelunkerGlowstick": "Zeigt Schätze in der Nähe", "SpiderStaff": "Beschwört Spinnen, um für dich zu kämpfen", "SporeSac": "Beschwört Sporen, die den Feinden mit der Zeit Schaden zufügen", - "GolfClubChlorophyteDriver": "{$CommonItemTooltip.GolfDriver}", + "StardustBreastplate": "Erhöht die maximale Anzahl deiner Günstlinge\nErhöht Günstlingschaden um 22%", "StardustCellStaff": "Beschwört eine Stenenstaubzelle, die für dich kämpft\nZieh dir die schönste Zellinfektion überhaupt heran‘", "StardustDragonStaff": "Beschwört einen Stenenstaubdrachen, der für dich kämpft\n‚Wer braucht schon eine Horde Günstlinge, wenn du einen riesigen Drachen haben kannst?‘", - "GolfClubDiamondWedge": "{$CommonItemTooltip.GolfWedge}", - "GolfClubShroomitePutter": "{$CommonItemTooltip.GolfPutter}", + "StardustHelmet": "Erhöht die maximale Anzahl deiner Günstlinge\nErhöht Günstlingschaden um 22%", + "StardustLeggings": "Erhöht die maximale Anzahl deiner Günstlinge\nErhöht Günstlingschaden um 22%", "StardustMonolith": "‚Du verfügst über eine kleine Menge Macht vom Sternenstaubturm‘", - "FloatingIslandFishingCrateHard": "{$ItemTooltip.FloatingIslandFishingCrate}", + "StickyDynamite": "‚Werfen könnte schwer werden.‘", "StickyGrenade": "Eine kleine Explosion, die keine Felder zerstört\n‚Werfen könnte schwer werden.‘", "Stopwatch": "Zeigt wie schnell der Spieler sich bewegt", "StrangeBrew": "‚Sieht schrecklich aus und riecht auch so‘", @@ -4921,7 +4952,7 @@ "TungstenPickaxe": "Kann Meteorite abbauen", "UltraBrightCampfire": "Lebensregeneration wird in der Nähe eines Lagerfeuers erhöht", "ValkyrieYoyo": "{$CommonItemTooltip.DevItem}", - "BlackCurrant": "{$CommonItemTooltip.MinorStats}", + "ViciousPowder": "Verbannt das Heilige", "VineRopeCoil": "Werfen, um eine Rankenseil zu erschaffen", "VortexBeater": "66% Chance, keine Munition zu verbrauchen\n‚Eine katastrophische Mischung aus Peng Peng und Bumm Bumm.‘", "VortexBreastplate": "Um 12% erhöhter Fernkampfschaden und kritische Trefferchance\n25% Chance, keine Munition zu verbrauchen", @@ -4935,10 +4966,10 @@ "WeightedPressurePlateOrange": "Wird aktiviert, wenn ein Spieler drauftritt oder runtergeht", "WeightedPressurePlatePink": "Wird aktiviert, wenn ein Spieler drauftritt oder runtergeht", "WeightedPressurePlatePurple": "Wird aktiviert, wenn ein Spieler drauftritt oder runtergeht", - "Peach": "{$CommonItemTooltip.MinorStats}", + "WingsNebula": "{$CommonItemTooltip.FlightAndSlowfall}", "WingsSolar": "{$CommonItemTooltip.FlightAndSlowfall}", "WingsStardust": "{$CommonItemTooltip.FlightAndSlowfall}", - "GolfClubTitaniumIron": "{$CommonItemTooltip.GolfIron}", + "WingsVortex": "{$CommonItemTooltip.FlightAndSlowfall}", "WireBulb": "Erleuchtet Glühbirnen mit jeder Kabelfarbe", "WireKite": "Ermöglicht die ultimative Kontrolle über Kabel!\n und gedrückt halten, um Kabeleinstellungen zu bearbeiten", "WirePipe": "Trennt Kabelpfade\nUnd kann gehämmert werden!", @@ -4950,7 +4981,7 @@ "Yoraiz0rHead": "{$CommonItemTooltip.DevItem}", "Yoraiz0rPants": "{$CommonItemTooltip.DevItem}", "Yoraiz0rShirt": "{$CommonItemTooltip.DevItem}", - "GolfClubPearlwoodDriver": "{$CommonItemTooltip.GolfDriver}", + "Yoraiz0rWings": "{$CommonItemTooltip.DevItem}\nWas auch immer dieses Accessoire mit dir macht ist kein Bug!", "YoyoBag": "Gibt dem Nutzer meisterliche Jojofähigkeiten", "YoYoGlove": "Ermöglicht es dir, zwei Jojos gleichzeitig zu benutzen", "BloodMoonRising": "{$PaintingArtist.Garner}", @@ -5148,7 +5179,7 @@ "BlackSlimeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BlackSlime}", "BlueArmoredBonesBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BlueArmoredBones}", "BlueCultistArcherBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CultistArcherBlue}", - "SkiphsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "BlueCultistCasterBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.None}", "BlueCultistFighterBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.None}", "BoneLeeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BoneLee}", "ClingerBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.Clinger}", @@ -5402,22 +5433,22 @@ "ApprenticeScarf": "{$ItemTooltip.HuntressBuckler}", "SquireShield": "{$ItemTooltip.HuntressBuckler}", "MonkBelt": "{$ItemTooltip.HuntressBuckler}", - "GolfClubStoneIron": "{$CommonItemTooltip.GolfIron}", + "ApprenticeAltHead": "Erhöht die Höchstanzahl deiner Wächter\nUm 10% erhöhter Günstling- & Magieschaden ", "ApprenticeAltPants": "Um 20% erhöhter Günstlingschaden und 25% Chance auf kritischen Magietreffer", "ApprenticeAltShirt": "Um 30% erhöhter Günstlingschaden und 15% erhöhter Magieschaden", - "GolfClubGoldWedge": "{$CommonItemTooltip.GolfWedge}", + "ApprenticeHat": "Erhöht die Höchstanzahl deiner Wächter und verringert Manakosten um 10%", "ApprenticeRobe": "Um 20% erhöhter Günstlingschaden und 10% erhöhter Magieschaden", "ApprenticeStaffT3": "Versprüht Verteidigung, die einen üblen Geruch verströmt", - "GoldenCrateHard": "{$ItemTooltip.GoldenCrate}", + "ApprenticeTrousers": "Um 10% erhöhter Günstlingschaden und 20% erhöhte Bewegungsgeschwindigkeit", "BookStaff": "Da fragt man sich, wer ein Buch des unendlichen Wissens auf einen Stock gesteckt hat ...\n, um einen mächtigen Tornado zu zaubern", - "GolfBallDyedSkyBlue": "{$CommonItemTooltip.GolfBall}", + "DD2BallistraTowerT1Popper": "Ein langsamer Turm, der jedoch hohen Schaden mit durchbohrenden Bolzen verursacht\n{$CommonItemTooltip.EtherianManaCost10}", "DD2BetsyBow": "Verschießt spaltende Pfeile, fügt Feinden in der Luft mehr Schaden zu", "DD2ElderCrystal": "Lege ihn in den Eternia-Kristallständer, um Etherias Portale zu beschwören.", "DD2ElderCrystalStand": "Hält den Eternia-Kristall", "DD2EnergyCrystal": "Wird oft eingesetzt, um den eigenen Willen als körperliche Verteidigungsform zu verwenden", - "GolfBallDyedRed": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedTeal": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedPurple": "{$CommonItemTooltip.GolfBall}", + "DD2ExplosiveTrapT1Popper": "Eine Falle, die explodiert, wenn Feinde in die Nähe kommen\n{$CommonItemTooltip.EtherianManaCost10}", + "DD2FlameburstTowerT1Popper": "Ein Turm mit durchschnittlicher Geschwindigkeit, der explodierende Feuerbälle verschießt\n{$CommonItemTooltip.EtherianManaCost10}", + "DD2LightningAuraT1Popper": "Eine Aura, die Feinden, die hineingelangen, einen Stromstoß verpasst\n{$CommonItemTooltip.EtherianManaCost10}", "DD2PetDragon": "Beschwört einen zahmen Drachen", "DD2PetGato": "Beschwört eine zahme Gato", "DD2PetGhost": "Beschwört einen zahmen Flackerdocht, der dir leuchtet", @@ -5425,77 +5456,47 @@ "DD2SquireBetsySword": "Entfesselt die Energie des Herzens geradeaus", "DD2SquireDemonSword": ", um mit einem Schild zu blocken", "DefenderMedal": "Währung zum Handeln mit dem Tavernenwirt", - "ShuckedOyster": "{$CommonItemTooltip.MinorStats}", + "HuntressAltHead": "Erhöht die Höchstanzahl deiner Wächter\nUm 10% erhöhter Günstlingsschaden und kritische Fernkampfchance", "HuntressAltPants": "Um 25% erhöhter Günstlingschaden und 20% erhöhte Bewegungsgeschwindigkeit", "HuntressAltShirt": "Um 25% erhöhter Günstlings- & Fernkampfschaden", - "GolfClubBronzeWedge": "{$CommonItemTooltip.GolfWedge}", + "HuntressBuckler": "Erhöht die Höchstanzahl deiner Wächter\nErhöht Günstlingsschaden um 10%", "HuntressJerkin": "Um 20% erhöhter Günstlings- und Fernkampfschaden", "HuntressPants": "Um 10% erhöhter Günstlingschaden und 20% erhöhte Bewegungsgeschwindigkeit", - "GolfClubWoodDriver": "{$CommonItemTooltip.GolfDriver}", - "Oyster": "{$CommonItemTooltip.RightClickToOpen}", + "HuntressWig": "Erhöht die Höchstanzahl deiner Wächter und erhöht die kritische Fernkampfchance um 10%", + "MonkAltHead": "Erhöht die Höchstanzahl deiner Wächter und erhöht Nahkampf- & Günstlingschaden um 20%", "MonkAltPants": "Um 20% erhöhter Günstlingschaden, Bewegungsgeschwindigkeit und kritische Nahkampfchance", "MonkAltShirt": "Um 20% erhöhter Günstlingschaden und Nahkampfgeschwindigkeit", - "GolfClubMythrilIron": "{$CommonItemTooltip.GolfIron}", + "MonkBrows": "Erhöht die Höchstanzahl deiner Wächter und erhöht die Angriffsgeschwindigkeit für Nahkampf um 20%", "MonkPants": "Um 10% erhöhter Günstlingsschaden, um 10% erhöhte kritische Angriffschance und um 20% erhöhte Bewegungsgeschwindigkeit", "MonkShirt": "Um 20% erhöhter Günstlings- und Nahkampfschaden", "MonkStaffT1": "Läd Energie auf, während du sie schwingst, um Feinde zu zerschmettern", "MonkStaffT2": "Beschwört einen Geist, der die Feinde angreift", "MonkStaffT3": " und Waffe halten, um einen alternativen Angriff zu starten!", - "GolfClubRustyPutter": "{$CommonItemTooltip.GolfPutter}", - "IronCrateHard": "{$ItemTooltip.IronCrate}", + "SquireAltHead": "Erhöht die Höchstanzahl deiner Wächter und gibt dir 10% Günstlingsschaden", + "SquireAltPants": "Um 20% erhöhter Günstlingsschaden, kritische Angriffschance und um 30% erhöhte Bewegungsgeschwindigkeit", "SquireAltShirt": "Um 30% erhöhter Günstlingschaden und massiv erhöhte Lebensregeneration", - "GolfClubLeadPutter": "{$CommonItemTooltip.GolfPutter}", + "SquireGreatHelm": "Erhöht die Höchstanzahl deiner Wächter und erhöht deine Lebensregeneration", "SquireGreaves": "Um 15% erhöhter Günstlingsschaden, um 20% erhöhte kritische Nahkampfchance und Bewegungsgeschwindigkeit", "SquirePlating": "Um 15% erhöhter Günstlings- und Nahkampfschaden", "ArkhalisShirt": "{$ItemTooltip.ArkhalisHat}", "ArkhalisPants": "{$ItemTooltip.ArkhalisHat}", - "LobsterTail": "{$CommonItemTooltip.MediumStats}", + "ArkhalisWings": "{$ItemTooltip.ArkhalisHat}", "ArkhalisHat": "{$CommonItemTooltip.DevItem}\n'Aus dem Raster hab ich das nicht'", "LeinforsHat": "{$CommonItemTooltip.DevItem}\n'Damit diese vollen Locken so herrlich wie eh und je bleiben'", "LeinforsShirt": "{$CommonItemTooltip.DevItem}\n'Bringt das Sexy wieder zurück'", "LeinforsPants": "{$CommonItemTooltip.DevItem}\n‚Shia á la Überraschung! Von einer Hose hast du das nicht erwartet, oder?‘", - "OceanCrateHard": "{$CommonItemTooltip.RightClickToOpen}", - "LeinforsAccessory": "{$CommonItemTooltip.DevItem}\n‚Beste Ergebnisse erzielt man in Kombination mit einer Pastadiät‘", - "KiteSpectrum": "{$CommonItemTooltip.Kite}", - "KiteWanderingEye": "{$CommonItemTooltip.Kite}", - "KiteUnicorn": "{$CommonItemTooltip.Kite}", - "FairyQueenBossBag": "{$CommonItemTooltip.RightClickToOpen}", - "LavaCrate": "{$CommonItemTooltip.RightClickToOpen}", - "LavaCrateHard": "{$CommonItemTooltip.RightClickToOpen}", - "HotlineFishingHook": "{$CommonItemTooltip.LavaFishing}", - "LavaFishingHook": "{$CommonItemTooltip.LavaFishing}", - "TeleportationPylonJungle": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonPurity": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonHallow": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonUnderground": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonOcean": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonDesert": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonSnow": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonMushroom": "{$CommonItemTooltip.TeleportationPylon}", - "RockGolemBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.RockGolem}", - "BloodMummyBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodMummy}", - "SporeSkeletonBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.SporeSkeleton}", - "SporeBatBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.SporeBat}", - "LarvaeAntlionBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.LarvaeAntlion}", - "CrimsonBunnyBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CrimsonBunny}", - "CrimsonGoldfishBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CrimsonGoldfish}", - "CrimsonPenguinBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CrimsonPenguin}", - "BigMimicCorruptionBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BigMimicCorruption}", - "BigMimicCrimsonBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BigMimicCrimson}", - "BigMimicHallowBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BigMimicHallow}", - "MossHornetBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.MossHornet}", - "WanderingEyeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.WanderingEye}", - "CreativeWings": "{$CommonItemTooltip.FlightAndSlowfall}", - "RainbowWings": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressUpToBooster}", - "LongRainbowTrailWings": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}\n{$CommonItemTooltip.PressUpToBooster}" + "LeinforsWings": "{$CommonItemTooltip.DevItem}\n'Mitten drauf! Was soll das überhaupt bedeuten?!'", + "LeinforsAccessory": "{$CommonItemTooltip.DevItem}\n‚Beste Ergebnisse erzielt man in Kombination mit einer Pastadiät‘" }, "CommonItemTooltip": { "SpecialCrafting": "Wird zur besonderen Herstellung verwendet", "DevItem": "‚Toll, wenn man sich als Dev ausgeben will!‘", "FlightAndSlowfall": "Ermöglicht Flug und langsamen Fall", "RightClickToOpen": " zum Öffnen", + "MinorStats": "Geringe Verbesserung aller Werte", "BannerBonus": "Spieler in der Nähe erhalten einen Bonus gegen: ", "Counterweight": "Wirft ein Gegengewicht, nachdem er einen Feind mit einem Jo-jo getroffen hat", + "EtherianManaCost10": "Verwende 10 etherische Mana, um mehr als einen zu beschwören", "MinuteDuration": "{0} Minuten Dauer", "PlaceableOnXmasTree": "Kann auf einem Weihnachtsbaum platziert werden", "RestoresLife": "Stellt {0} Leben wieder her", diff --git a/Localization/Content/de-DE/Legacy.json b/Localization/Content/de-DE/Legacy.json index 71cf059..6c8815a 100644 --- a/Localization/Content/de-DE/Legacy.json +++ b/Localization/Content/de-DE/Legacy.json @@ -33,6 +33,7 @@ "37": "Gras wird verteilt", "38": "Kakteen wachsen", "39": "Sonnenblumen werden gepflanzt", + "3": "Dreck wird hinter Dreck geschoben", "40": "Bäume werden gepflanzt", "41": "Kräuter werden gepflanzt", "42": "Unkraut wird gepflanzt", @@ -72,8 +73,10 @@ "73": "Weltenspeichern wird bestätigt:", "74": "Schleim fällt vom Himmel!", "75": "Schleim fällt nicht mehr vom Himmel!", + "76": "Strukturen werden erstellt.", "77": "Mehr Gras hinzufügen", "78": "Wüstifizierung", + "79": "Wände erhalten etwas Pepp", "7": "Zufällig platzierte Löcher werden geschaffen", "80": "Marmor wird gemeißelt", "81": "Granit wird wachsen gelassen", @@ -159,6 +162,7 @@ "167": "Kaufe immer etwas mehr Kabel als nötig!", "168": "Hast du dich vergewissert, dass dein Gerät angeschlossen ist?", "169": "Oh, weißt du, was dieses Haus noch braucht? Mehr blinkende Lichter.", + "17": "Achte auf den Preis, kaufe eine Linse!", "170": "Du erkennst den Blutmond an der Rotfärbung des Himmels. Irgendetwas daran lässt Monster ausschwärmen.", "171": "Weißt du vielleicht, wo man Todeskraut findet? Nein, es hat keinen Grund. Ich frag nur so.", "172": "Wenn du mal hochschauen würdest, würdest du bemerken, dass der Mond rot ist.", @@ -177,8 +181,11 @@ "184": "Jetzt, da du etwas Erz hast, musst du es in einen Barren verwandeln, um damit Items zu erschaffen. Dazu brauchst du einen Schmelzofen!", "185": "Du kannst einen Schmelzofen aus Fackeln, Holz und Steinen herstellen. Achte dabei darauf, dass du neben einer Werkbank stehst.", "186": "Zum Herstellen der meisten Sachen aus Metallbarren wirst du einen Amboss brauchen.", + "187": "Ambosse können aus Eisen hergestellt oder von einem Händler gekauft werden.", "188": "Im Untergrund findest du Kristallherzen, mit denen du deine maximale Lebensspanne erhöhen kannst. Du kannst sie mit der Spitzhacke zerschlagen.", + "189": "Wenn du 5 Sternschnuppen gesammelt hast, kannst du daraus Items herstellen, die deine magischen Kapazitäten erhöhen", "19": "{PlayerName}, richtig? Ich habe nur Gutes über dich gehört!", + "190": "Sterne fallen nachts auf der ganzen Welt herunter. Sie können für alle möglichen nützlichen Dinge verwendet werden. Wenn du einen erspäht hast, dann greif ihn dir schnell - sie verschwinden nach Sonnenaufgang.", "191": "Es gibt viele Möglichkeiten, wie du Menschen dazu bewegen kannst, in unsere Stadt zu ziehen. Sie brauchen zuallererst ein Zuhause.", "192": "Damit ein Raum wie ein Heim wirkt, braucht er eine Tür, einen Stuhl, einen Tisch und eine Lichtquelle. Achte darauf, dass das Haus auch Wände hat.", "193": "Zwei Menschen werden nicht im selben Haus leben wollen. Außerdem brauchen sie ein neues Zuhause, wenn ihr Heim zerstört wurde.", @@ -197,6 +204,7 @@ "204": "Wenn du Linsen an einem Dämonenaltar kombinierst, kannst du vielleicht eine Möglichkeit finden, ein mächtiges Monster herbeizurufen. Du solltest jedoch bis zur Nacht warten, bevor du das tust.", "205": "Du kannst einen Wurmköder mit verfaulten Fleischbrocken und Ekelpulver erzeugen. Achte aber darauf, dass du dich vor der Verwendung in einem verdorbenen Gebiet befindest.", "206": "Dämonenaltäre sind gewöhnlich im Verderben zu finden. Du musst aber nahe an ihnen dran stehen, um Items herzustellen", + "207": "Du kannst einen Greifhaken aus einem Haken und 3 Ketten herstellen. Die Skelette tief im Untergrund tragen gewöhnlich Haken bei sich. Die Ketten dazu können aus Eisenbarren gefertigt werden.", "208": "Wenn du einen Topf siehst, so schlage ihn kaputt. Töpfe enthalten alle möglichen nützlichen Zubehörteile.", "209": "Verborgene Schätze sind auf der ganzen Welt zu finden! Einige erstaunliche Dinge sind auch im Untergrund aufzuspüren!", "21": "Engelsstatue, sagst du? Tut mir leid, ich bin kein Nippesverkäufer.", @@ -402,6 +410,7 @@ "400": "Jetzt bettelst du schon?! Sieh mich nicht so an, als würde ich mich über Nacht umentscheiden! ", "401": "Zerschlage jeden Purpur-Altar, den du findest. Etwas Gutes passiert, wenn du das tust!", "402": "Purpur-Altäre sind gewöhnlich im Purpur zu finden. Du musst aber nahe an ihnen dran stehen, um Items herzustellen", + "403": "Mit Wirbeln kannst du eine Blutige Wirbelsäule herstellen. Achte aber darauf, dass du dich vor der Verwendung in einem purpurnen Gebiet befindest.", "41": "Hör schon auf, wie ein Baby zu plärren! Ich habe Schlimmeres gesehen.", "42": "Das geht nicht ohne ein paar Stiche!", "43": "Schon wieder Ärger mit diesen Rabauken?", @@ -435,6 +444,7 @@ "69": "Hast du versucht, das Reinigungspulver auf dem Ebenstein des Verderbens auszuprobieren?", "7": "Die Nacht wird uns bald eingeholt haben, Freund. Entscheide dich, solange du noch kannst.", "70": "Ich wünschte, {ArmsDealer} würde aufhören, mit mir zu flirten. Versteht er nicht, dass ich 500 Jahre alt bin?", + "71": "Warum versucht {Merchant}, mir Engelsstatuen zu verkaufen? Jeder weiß, dass sie nutzlos sind.", "72": "Hast du den Greis im Verlies rumlaufen sehen? Der sieht gar nicht gut aus ...", "73": "Ich verkaufe, was ich will! Dein Pech, wenn du es nicht magst.", "74": "Warum bist du in einer Zeit wie dieser so aggressiv?", @@ -595,6 +605,7 @@ "213": "Smarter Cursorpriorität: Spitzhacke -> Axt", "214": "Smarter Cursorpriorität: Axt -> Spitzhacke", "215": "Smarte Blockplatzierung: Zum Cursor", + "216": "Smarte Blockplatzierung: Auffüllen", "217": "Rahmenfarbe", "218": "Cursor", "219": "Steuerung", @@ -639,7 +650,10 @@ "26": "Softcore", "27": "Zufall", "28": "Erstellen", + "29": "Hardcore-Charaktere bleiben tot", "2": "Trennen", + "30": "Mediumcore-Charaktere lassen beim Sterben Beute zurück", + "31": "Softcore-Charaktere lassen beim Sterben Geld zurück", "32": "Schwierigkeitsgrad wählen", "33": "Hemd", "34": "Unterhemd", @@ -790,6 +804,7 @@ "17": "{0} ist der gelben Gruppe beigetreten.", "18": "Willkommen bei", "19": "{0} ist beigetreten.", + "1": "Falsches Passwort.", "20": "{0} ist weg.", "21": "/Spieler", "22": "{0} ist der rosa Gruppe beigetreten.", @@ -888,6 +903,7 @@ "82": "Zurück", "83": "Favorit", "84": "Du kannst innerhalb der Blöcke deines Teams nicht Teams wechseln!", + "85": "Insekt", "86": "Ente", "87": "Schmetterling", "88": "Glühwürmchen", @@ -1035,6 +1051,7 @@ "LegacyChestType": { "0": "Truhe", "10": "Efeutruhe", + "11": "Eistruhe", "12": "Lebendes-Holz-Truhe", "13": "Himmelswarentruhe", "14": "Schattenholztruhe", @@ -1046,10 +1063,12 @@ "1": "Goldtruhe", "20": "Purpurne Truhe", "21": "Heilige Truhe", + "22": "Gefrorene Truhe", "23": "Verschlossene Dschungeltruhe", "24": "Verschlossene Verdorbene Truhe", "25": "Verschlossene Purpur-Truhe", "26": "Verschlossene Heilige Truhe", + "27": "Verschlossene Gefrorene Truhe", "28": "Dynastietruhe", "29": "Honigtruhe", "2": "Verschlossene Goldtruhe", @@ -1115,29 +1134,10 @@ "28": "{$ItemName.CrystalDresser}", "29": "{$ItemName.DynastyDresser}", "30": "{$ItemName.FrozenDresser}", - "31": "{$ItemName.LivingWoodDresser}", - "32": "{$ItemName.SpiderDresser}", - "33": "{$ItemName.LesionDresser}", - "34": "{$ItemName.SolarDresser}", - "35": "{$ItemName.VortexDresser}", - "36": "{$ItemName.NebulaDresser}", - "37": "{$ItemName.StardustDresser}", - "38": "{$ItemName.SandstoneDresser}", - "39": "{$ItemName.BambooDresser}" + "31": "{$ItemName.LivingWoodDresser}" }, "LegacyChestType2": { - "1": "{$ItemName.GoldenChest}", - "0": "{$ItemName.CrystalChest}", - "2": "{$ItemName.SpiderChest}", - "3": "{$ItemName.LesionChest}", - "4": "{$ItemName.GoldChest}", - "5": "{$ItemName.SolarChest}", - "6": "{$ItemName.VortexChest}", - "7": "{$ItemName.NebulaChest}", - "8": "{$ItemName.StardustChest}", - "9": "{$ItemName.GolfChest}", - "10": "{$ItemName.DesertChest}", - "11": "{$ItemName.BambooChest}", - "12": "{$ItemName.DungeonDesertChest}" + "0": "Kristalltruhe", + "1": "Goldene Truhe" } } \ No newline at end of file diff --git a/Localization/Content/de-DE/NPCs.json b/Localization/Content/de-DE/NPCs.json index d09e2a0..1781a0f 100644 --- a/Localization/Content/de-DE/NPCs.json +++ b/Localization/Content/de-DE/NPCs.json @@ -68,6 +68,7 @@ "Vampire": "Vampir", "MotherSlime": "Schleimmami", "Truffle": "Trüffel", + "ZombieEskimo": "Zombieeskimo", "Frankenstein": "Frankenstein", "BlackRecluse": "Schwarze Einsiedlerin", "WallCreeper": "Wandkriecher", @@ -308,7 +309,9 @@ "SleepingAngler": "Schlafender Angler", "Grasshopper": "Grashüpfer", "ChatteringTeethBomb": "Klappernde Zahnbombe", + "CultistArcherBlue": "Blauer-Kultistenbogenschütze", "Demolitionist": "Sprengmeister", + "CultistArcherWhite": "Weißer-Kultistenbogenschütze", "BrainScrambler": "Gehirnverwirrer", "RayGunner": "Strahlenschütze", "MartianOfficer": "Marsianer-Offizier", @@ -335,6 +338,7 @@ "Hornet": "Hornisse", "ManEater": "Menschenfresser", "ArmedZombie": "Zombie", + "ArmedZombieEskimo": "Zombieeskimo", "ArmedZombiePincussion": "Zombie", "ArmedZombieSlimed": "Zombie", "ArmedZombieSwamp": "Zombie", @@ -424,9 +428,12 @@ "Crawdad": "Flusskrebs", "Crawdad2": "Flusskrebs", "CreatureFromTheDeep": "Kreatur aus der Tiefe", + "CrimsonBunny": "Purpurtan-Häschen", + "CrimsonGoldfish": "Purpurtan-Goldfisch", "CrimsonPenguin": "Böser Pinguin", "CultistBoss": "Irrer Kultist", "CultistBossClone": "Irrer Kultist", + "CultistDevote": "Irrer Anhänger", "CultistDragonBody1": "Phantasm-Drache", "CultistDragonBody2": "Phantasm-Drache", "CultistDragonBody3": "Phantasm-Drache", @@ -459,7 +466,7 @@ "DuneSplicerHead": "Dünenstecher", "DuneSplicerTail": "Dünenstecher", "EnchantedNightcrawler": "Verzauberter Nachtkriecher", - "GiantFlyingAntlion": "Ameisenlöwenschwarm", + "FlyingAntlion": "Ameisenlöwenschwarm", "Fritz": "Fritz", "GiantShelly": "Riesen-Shelly", "GiantShelly2": "Riesen-Shelly", @@ -507,6 +514,7 @@ "SandsharkCrimson": "Fleischräuber", "SandsharkHallow": "Kristalldrescher", "SandSlime": "Sandschleim", + "ShadowFlameApparition": "Schattenflammenerscheinung", "SlimeSpiked": "Gespickter Schleim", "Sluggy": "Sluggy", "SolarFlare": "Sonneneruption", @@ -534,7 +542,7 @@ "VortexLarva": "Alienlarve", "VortexRifleman": "Sturmtaucher", "VortexSoldier": "Vortexianer", - "GiantWalkingAntlion": "Ameisenlöwenläufer", + "WalkingAntlion": "Ameisenlöwenläufer", "DD2GoblinBomberT2": "{$NPCName.DD2GoblinBomberT1}", "DD2WyvernT3": "{$NPCName.DD2WyvernT1}", "DD2WyvernT2": "{$NPCName.DD2WyvernT1}", diff --git a/Localization/Content/de-DE/Projectiles.json b/Localization/Content/de-DE/Projectiles.json index ce43818..13d9f44 100644 --- a/Localization/Content/de-DE/Projectiles.json +++ b/Localization/Content/de-DE/Projectiles.json @@ -713,10 +713,6 @@ "MonkStaffT3": "Wut des Himmelsdrachen", "MonkStaffT3_Alt": "Wut des Himmelsdrachen", "MonkStaffT3_AltShot": "Wut des Himmelsdrachen", - "DD2JavelinHostileT3": "{$ProjectileName.DD2JavelinHostile}", - "Celeb2Rocket": "{$ProjectileName.Celeb2Weapon}", - "Celeb2RocketExplosive": "{$ProjectileName.Celeb2Weapon}", - "Celeb2RocketLarge": "{$ProjectileName.Celeb2Weapon}", - "Celeb2RocketLargeExplosive": "{$ProjectileName.Celeb2Weapon}" + "DD2JavelinHostileT3": "{$ProjectileName.DD2JavelinHostile}" } } \ No newline at end of file diff --git a/Localization/Content/de-DE/Town.json b/Localization/Content/de-DE/Town.json index 6ce0387..f79edb8 100644 --- a/Localization/Content/de-DE/Town.json +++ b/Localization/Content/de-DE/Town.json @@ -49,6 +49,7 @@ "Party": "Glaubst du, es würde jemanden stören, wenn ich einen Kuchen mit Glühbirnen statt mit Kerzen verzieren würde?" }, "BartenderSpecialText": { + "Party": "Ich brauch dringend etwas Geburtstags-Text, Yorai!", "AfterDD2Tier1": "Das war echt super, wie du die Armee des Alten zurückgeschlagen hast! Aber das war bestimmt noch nicht das letzte Mal, dass wir die gesehen haben. Sonderlich angestrengt haben sie sich ja nicht.", "AfterDD2Tier2": "Die Armee des Alten wird immer stärker, und trotzdem setzt du dich gegen sie durch! Aber irgendwie habe ich den Eindruck, dass es das noch nicht gewesen ist.", "AfterDD2Tier3": "Du hast es echt geschafft, den Ansturm der Armee des Alten abzuwehren? Vielleicht solltest du mal nach Etheria kommen.", @@ -74,9 +75,15 @@ "Party": "Keine Frage, ich schmeiße die magischsten Partys.", "AfterDD2Tier1": "Weißt du, so ein Portal habe ich schon mal gesehen, aber das war aus Gold." }, + "SteampunkerSpecialText": { + "Party": "Alle sagen, sie mögen mehrstöckige Torten, deswegen haben meine einen Fahrstuhl gekriegt." + }, "CyborgSpecialText": { "Party": "Die Party wird der Hammer! Oder sogar der Meißel!" }, + "SantaClausSpecialText": { + "Party": "Komm schon, du glaubst doch nicht, dass ich nur Weihnachten feiere, oder?" + }, "DemolitionistSpecialText": { "Party": "Heute solltest du vorsichtig sein. Wir Zwerge haben ziemlich explosive Partys.", "AfterDD2Start": "Ich verstehe nicht, warum wir die Portale nicht einfach in die Luft sprengen können." @@ -109,6 +116,7 @@ "Quest_Catfish": "Endlich habe ich eine Dschungelkatze gefunden, die Wasser mag. Vermutlich, weil sie halb Fisch ist. Ich weiß nicht, warum es so gekommen ist, und ich will es auch nicht wissen. Ich will das Viech einfach nur haben, und zwar zackig!\n\n(Auf der Dschungel-Oberfläche gefangen)", "Quest_Cloudfish": "Gerüchten zufolge gibt es Inseln, die hoch oben am Himmel schweben, und dort sollen unglaubliche Schätze zu holen sein! Aber wen interessiert das schon, wenn es noch viel cooler ist, dass sich manchmal Seen in den Wolken bilden, in denen Fische aus Wolken schwimmen! Ich will wissen, wie die Dinger schmecken, also solltest du einen für mich fangen!\n\n(Gefangen in den Himmelsseen)", "Quest_Cursedfish": "In den Gewässern der tiefsten Verderbtheit schwimmt ein verfluchter Fisch! Er entstand aus den verfluchten Flammen, die von den gefallenen Schrecken ausgehen, die dort unten lauern. Angeblich kann nicht einmal Wasser diese Flammen löschen, heißt es, denn sie brennen auf ewig. Mit einem solchen Fisch könnte man die tollsten Sachen anstellen! Und du wirst ihn mir doch holen, oder bist du zu feige?\n\n(Gefangen im Verderben)", + "Quest_Dirtfish": "Ich war gerade dabei, den großen Dicken an Land zu ziehen, als dieser seltsam sprechende Zombie aus dem Waldsee gesprungen kam und anfing, von dieser 'furchterregenden' Fischart aus Schmutz zu faseln. Er sagte, er könne zehn Typen seiner Größe ersticken oder so ... Ich will ihn! SOFORT!\n\n(Gefangen auf der Oberfläche, Untergrund & Höhlen)", "Quest_DynamiteFish": "Der Abreißer hat wegen einer verlorenen Dynamitstange im Waldsee rumgeheult. Dabei hat er doch so viele davon, da kommt es auf eine doch nicht an. Aber offenbar, weil ihr Flossen wuchsen und sie einfach davonschwamm! Keine Ahnung, woher er das Zeug bekommt, um so was hinzukriegen, aber die ist eindeutig besessen! Zieh sie an Land und bring sie mir. Ich wollte schon immer einen Selbstmordattentat-Fisch besitzen. Frag nicht, warum.\n\n(Auf der Oberfläche gefangen)", "Quest_EaterofPlankton": "Ich wette, du hast nicht den Mumm, den Planktonfresser zu besorgen. Er ist ein pervertierter Fisch, der aus einem abgetrennten Stück des Weltenfressers mutierte. Fang ihn ein und bring ihn mir. Zeig mir, dass du kein Weichei bist!\n\n(Gefangen im Verderben)", "Quest_FallenStarfish": "Ich liebe es, diese strahlend gelben Sterne zu sammeln, die vom Himmel fallen! Und noch mehr liebe ich es, wenn sie jemandem auf den Kopf fallen. Aber ... aber ... es geht nichts über einen Stern, der in einen Waldsee plumpst und sich in einen Fisch verwandelt! Das ist einfach dufte, und du bist so dufte und holst ihn mir!\n\n(Gefangen in den Himmelsseen)", @@ -127,7 +135,7 @@ "Quest_GuideVoodooFish": "Diese Dämonen in der Unterwelt stehen total auf Voodoopuppen, aber da gibt es eine Puppe, die viel zu viel Magie abbekommen hat! Sie hat sich in einen Fisch verwandelt, der sich selbstständig gemacht hat. Ich fordere dich auf, da runter zu gehen, und mir einen zu besorgen! Ich würde auf die kochende Lava aufpassen, denn wenn die dich röstet, bekomme ich meinen Fisch nicht!\n\n(Gefangen in den Höhlen)", "Quest_Wyverntail": "Ich weiß mal was, was duuu nicht weißt! Gut, ich sag‘s dir ja! Es gibt eine fürchterliche Kreatur, die durch den Sternenhimmel fliegt! Das ist kein Quatsch! Man nennt sie einen Lindwurm! A-aber das wusstest du bereits, oder? Nun, dann sag ich dir etwas, das du noch nicht wusstest. Sie werden als Kaulquappen geboren! Das heißt ... Sie sind eigentlich Frösche! Jetzt hüpf mal los und besorg mir einen!\n\n(Gefangen in den Himmelsseen)", "Quest_ZombieFish": "Du glaubst es nicht! Ich habe nachts im Wald einen Fisch gefangen, der schon tot war! Und dann hat er versucht, mich zu fressen! Ich hab ihn weggeschmissen und bin losgerannt! Jetzt will ich ihn jemandem in den Kleiderschrank legen, nur um zu sehen, was geschieht. Also zieh los und hol ihn für mich, okay?\n\n(Auf der Oberfläche gefangen)", - "Quest_AmanitaFungifin": "Ich habe einen Ort mit riesigen leuchtenden Pilzen entdeckt! Da war alles blau! Ich wollte nahe eines glitzernden blauen Sees einen von ihnen pflücken, als er auf einmal nach mir schnappte und wegschwamm! Dem werd ich's zeigen und ordentlich auf ihm rumtrampeln! Das heißt natürlich, du wirst ihn mir besorgen!\n\n(Gefangen im Glühenden Pilzfeld)", + "Quest_AmanitiaFungifin": "Ich habe einen Ort mit riesigen leuchtenden Pilzen entdeckt! Da war alles blau! Ich wollte nahe eines glitzernden blauen Sees einen von ihnen pflücken, als er auf einmal nach mir schnappte und wegschwamm! Dem werd ich's zeigen und ordentlich auf ihm rumtrampeln! Das heißt natürlich, du wirst ihn mir besorgen!\n\n(Gefangen im Glühenden Pilzfeld)", "Quest_Angelfish": "Wusstest du, dass es Zauberinseln gibt, die hoch oben am Himmel schweben? Ich wette, das wusstest du nicht! Angeblich werden sie von Engeln bevölkert. Ich glaube, diese Engel haben Flossen und Kiemen und schwimmen durch die Gegend! Und ich glaube, dass du einen für mich fangen musst!\n\n(Gefangen in den Himmelsseen)", "Quest_BloodyManowar": "Au! Komm mir bloß nicht zu nahe! Ich wurde von einer verdammten Galeere gebissen! Falls du so dumm bist, und nicht weißt, was das ist, das ist die gefährlichste Qualle auf der ganzen Welt {WorldName}! Geh ins ätzende Purpur und fang sie, wenn du dich traust! \n\n(Im Purpur gefangen)", "Quest_Bonefish": "Normalerweise interessiert es mich nicht die Bohne, wenn ich Fischgräten im Wasser im Untergrund treiben sehe, aber die hier ist geschwommen! Was, du dachtest, dass nur menschliche Skelette in dieser Welt herumstolzieren {WorldName}? Capture-o para mim, quero colocá-lo na cama de alguém!\n\n(Gefangen im Untergrund & Höhlen)", @@ -139,6 +147,7 @@ "Quest_Fishron": "Der Legende nach gibt es ein mächtiges Wesen namens Fischrache! Teils Schwein, teils Drache und teils FISCH! Angeblich hängt er in den gefrorenen unterirdischen Seen im kältesten Teil der Welt ab! Ich werd da ganz bestimmt nicht hingehen, aber DU wirst ihn für mich fangen und dafür sorgen, dass er mir in die Hände fällt! Ich freu mich ja so!\n\n(Gefangen in der Untergrund-Tundra)", "Quest_InfectedScabbardfish": "Ein ziemlich langer Fisch, der wie eine Schwertscheide aussieht, schwimmt in den brackigen Gewässern des Verderbens! Er sieht aus wie Ebenstein, also wirst du genau hinsehen müssen! Jawohl, DU! Du wirst ihn fangen, nicht ich!\n\n(Gefangen im Verderben)", "Quest_Mudfish": "Pass auf, wo du hintrittst, wenn du durch die Dschungelgewässer watest! Wieso? Nein, nicht, weil ich Angst hätte, dass dich die Piranhas fressen könnten. Weil ich befürchte, dass du auf meinen Lieblingsfisch trittst, den Schlammfisch! Außerdem hätte ich gern, dass du mir einen als Haustier mitbringst!\n\n(Im Dschungel gefangen)", + "Quest_Slimefish": "Im Wald ist der Schleim ganz schön bäh! Schleimfische sind sogar noch bähiger! Ich will mich nicht vollschleimen lassen, also stibitz einen aus dem Wasser für mich!\n\n(Irgendwo gefangen)", "Quest_TropicalBarracuda": "Piranhas und Haie sind hässlich! Soooo hässlich! Wusstest du, dass es einen Fisch gibt, der wunderschön aussieht, und der dir trotzdem das Gesicht wegfressen kann? Ich würde übrigens 2 Platinmünzen springen lassen, um das zu sehen ... Wie auch immer, du gehst einen für mich fangen. Sorg nur dafür, dass ich ihn habe, bevor du dein Gesicht verlierst!\n\n(Auf der Dschungel-Oberfläche gefangen)", "Quest_TundraTrout": "Fragst du dich auch manchmal, warum die Seen an der Oberfläche der verschneiten {WorldName} niemals zufrieren? Ich nicht. Die Fische, jedoch, frieren ein! Ein Fisch aus Eis wäre ein tolles Opfer für den großen und mächtigen {Angler}! Geh, mein getreuer Untertan, und bringe mir eiligst besagte Tundraforelle!\n\n(Gefangen in der Oberflächen-Tundra)" }, diff --git a/Localization/Content/en-US.json b/Localization/Content/en-US.json index 9991e17..e054cec 100644 --- a/Localization/Content/en-US.json +++ b/Localization/Content/en-US.json @@ -6,7 +6,7 @@ "LoadFailed": "Load failed!", "LoadFailedNoBackup": "Load failed! No backup found.", "InvalidLobbyFlag": "-lobby flag used without \"{0}\" or \"{1}\". Ignoring it.", - "CaptureError": "An error occurred while saving the capture. Attempting again...", + "CaptureError": "An error occured while saving the capture. Attempting again...", "UnableToCapture": "Unable to capture.", "UnableToWritePreferences": "Unable to write file at: {0}", "UnableToLoadWorld": "Unable to load world:", @@ -106,6 +106,7 @@ "Ban_Usage": "Usage: ban ", "BanMessage": "Banned from server.", "InvalidCommand": "Invalid command.", + "SetInitialMaxPlayers": "Max players (press enter for 8): ", "SetInitialPort": "Server port (press enter for 7777): ", "AutomaticPortForward": "Automatically forward port? (y/n): ", "Yes": "yes", @@ -133,9 +134,7 @@ "ServerStarted": "Server started", "EnterSeed": "Enter Seed (Leave Blank For Random):", "NoValidSeed": "This world was generated in an older version that did not support seeds.", - "DisplaySeed": "World Seed: {0}", - "SetInitialMaxPlayers": "Max players (press enter for 16): ", - "ServerIsFull": "This server is full right now, please try again later.", + "DisplaySeed": "World Seed: {0}" }, "UI": { "Effects": "Effects", @@ -146,14 +145,11 @@ "MoveOffCloud": "Move off cloud", "Play": "Play", "Delete": "Delete", - "Softcore": "Classic", + "Softcore": "Softcore", "Mediumcore": "Mediumcore", "Hardcore": "Hardcore", - "Master": "Master", "Expert": "Expert", - "Normal": "Classic", - "Creative": "Journey", - "CreativeDescriptionPlayer": "Journey characters start with extra equipment. Can only be played on Journey worlds.", + "Normal": "Normal", "WorldSizeFormat": "{0} World", "WorldCreatedFormat": "Created: {0}", "SelectWorld": "Select World", @@ -174,8 +170,8 @@ "WorldSizeMedium": "Medium", "WorldSizeLarge": "Large", "WorldSizeUnknown": "Unknown", - "NormalDescriptionFlavor": "Your Adventure Begins...", - "NormalDescription": "(The Standard Terraria Experience)", + "NormalDescriptionFlavor": "Your Journey Begins...", + "NormalDescription": "(The standard Terraria Experience)", "ExpertDescriptionFlavor": "Fortune & Glory, Kid.", "ExpertDescription": "(Far Greater Difficulty & Loot)", "More": "more", @@ -185,97 +181,7 @@ "BartenderHelp": "Eternia Crystal", "ZoomIn": "{$LegacyMenu.168}", "ZoomOut": "{$LegacyMenu.169}", - "Ellipsis": "...", - "ResourcePacks": "Texture Packs", - "LightMode_Color": "{$LegacyMenu.55}", - "LightMode_White": "{$LegacyMenu.56}", - "LightMode_Retro": "{$LegacyMenu.57}", - "LightMode_Trippy": "{$LegacyMenu.58}", - "CopyColorToClipboard": "Copy color code to clipboard", - "PasteColorFromClipboard": "Paste color code from clipboard", - "RandomizeColor": "Randomize color", - "RandomizePlayer": "Randomize player", - "CopyPlayerToClipboard": "Copy player template to clipboard", - "PastePlayerFromClipboard": "Paste player template from clipboard", - "PlayerNameSlot": "Name:", - "PlayerEmptyName": "{$Net.EmptyName}", - "Create": "Create", - "SelectMapBorder": "Minimap Border: {0}", - "MinimapFrame_Default": "Default", - "MinimapFrame_Golden": "Golden", - "MinimapFrame_Remix": "Remix", - "MinimapFrame_Sticks": "Sticks", - "MinimapFrame_StoneGold": "StoneGold", - "MinimapFrame_TwigLeaf": "TwigLeaf", - "MinimapFrame_Leaf": "Leaf", - "MinimapFrame_Retro": "Retro", - "MinimapFrame_Valkyrie": "Valkyrie", - "SelectHealthStyle": "Health and Mana Style: {0}", - "HealthManaStyle_Default": "Classic", - "HealthManaStyle_New": "Fancy", - "HealthManaStyle_HorizontalBars": "Bars", - "SpawnPoint": "Spawn", - "SpawnBed": "Home", - "EmoteCategoryGeneral": "General", - "EmoteCategoryRPS": "Rock, Paper, Scissors!", - "EmoteCategoryItems": "Items", - "EmoteCategoryBiomesAndEvents": "Nature & Weather", - "EmoteCategoryTownNPCs": "Town", - "EmoteCategoryCritters": "Critters & Monsters", - "EmoteCategoryBosses": "Dangers", - "ToggleBank4VacuumIsOn": "Void Pull: On", - "ToggleBank4VacuumIsOff": "Void Pull: Off", - "Author": "by {0}", - "WorldCreationName": "Name:", - "WorldCreationNameEmpty": "", - "WorldCreationRandomizeNameDescription": "Randomize your world's name.", - "WorldCreationSeed": "Seed:", - "WorldCreationSeedEmpty": "", - "WorldCreationRandomizeSeedDescription": "Randomize your world's seed.", - "WorldCreationSize": "Size:", - "WorldCreationDifficulty": "Difficulty:", - "WorldCreationEvil": "Evil:", - "WorldCreationNumberOfWorlds": "# of Worlds:", - "WorldCreationNumberOfWorldsDescription": "Number of worlds to generate at once", - "ItemCannotBePlacedInsideItself": "Placing into itself will be blocked", - "WorldDescriptionName": "Give your world a name! Choose carefully, you cannot change it later!", - "WorldDescriptionSeed": "The DNA marker that defines your world's specific shape and traits.", - "WorldDescriptionSizeSmall": "Ideal for a quick, single player experience.", - "WorldDescriptionSizeMedium": "Bigger and better for prolonged exploration, or bringing a friend.", - "WorldDescriptionSizeLarge": "Super-sized for long term progression and multiple players.", - "WorldDescriptionCreative": "With great power comes great responsibility (Unearth your creativity)", - "WorldDescriptionNormal": "Your Adventure Begins... (The Standard Terraria Experience)", - "WorldDescriptionExpert": "Fortune & Glory, Kid. (Far Greater Difficulty & Loot)", - "WorldDescriptionMaster": "Game over man, game over! (Brutally hard, for the truly brave)", - "WorldDescriptionEvilRandom": "Let nature decide whether corruption or crimson infects your world.", - "WorldDescriptionEvilCorrupt": "Disease-like corruption is guaranteed to be present in your world.", - "WorldDescriptionEvilCrimson": "Macabre, grotesque crimson is guaranteed to be present in your world.", - "WorldDescriptionDefault": "Please choose how your world will be built with the options above.", - "SmartDoorsDisabled": "Smart Doors: Disabled", - "SmartDoorsEnabled": "Smart Doors: Enabled", - "SmartDoorsGamepad": "Smart Doors: Gamepad Only", - "CannotDeleteFavorited": "Cannot Delete (Favorited)", - "NPCCheckHappiness": " Happiness", - "QuickUseItem": "Quick Use", - "TilesSwayInWindOn": "Windy Environment: Enabled", - "TilesSwayInWindOff": "Windy Environment: Disabled", - "Info": "Info", - "Version": "Version {0}", - "AvailableResourcePacksTitle": "Available Packs ({Amount})", - "EnabledResourcePacksTitle": "Enabled Packs ({Amount})", - "OffsetTexturePackPriorityUp": "Move Frontwards", - "OffsetTexturePackPriorityDown": "Move Backwards", - "EnableTexturePack": "Enable", - "DisableTexturePack": "Disable", - "SeeTexturePackInfo": "View Pack Info", - "PlayerIsNotCreativeAndWorldIsCreative": "Only Journey characters may enter a Journey world.", - "PlayerIsCreativeAndWorldIsNotCreative": "Only Non-Journey characters may enter a Non-Journey world.", - "PetTheAnimal": "Pet", - "HoverControlSettingIsClick": "Hover Controls: Click", - "HoverControlSettingIsHold": "Hover Controls: Hold", - "ToggleCreativeMenu": "Toggle Journey Powers", - "WorldCannotBeLoadedBecauseItHasAnInvalidGameMode": "Error: This world has an invalid data!", - "WorldGenEasterEgg_GeneratingBees": "Generating bees" + "Ellipsis": "..." }, "Net": { "ClientStatusComplete": "({0}) {1} {2}: Complete!", @@ -300,19 +206,9 @@ "RequestingTileData": "Requesting tile data", "StatusComplete": "{0}: Complete!", "NameTooLong": "Name is too long.", - "EmptyName": "Empty name.", - "PlayerIsNotCreativeAndWorldIsCreative": "Only Journey characters may enter a Journey server.", - "PlayerIsCreativeAndWorldIsNotCreative": "Only Non-Journey characters may enter a Non-Journey server.", - "CannotTeleportToPylonBecausePlayerIsNotNearAPylon": "You are not close enough to a pylon to teleport with the pylon network", - "CannotTeleportToPylonBecauseNotEnoughNPCs": "There are not enough villagers near that pylon to access it", - "CannotTeleportToPylonBecauseNotEnoughNPCsAtCurrentPylon": "There are not enough villagers near the current pylon", - "CannotTeleportToPylonBecauseThereIsDanger": "Defeat the current threat before you can use the pylon network!", - "CannotTeleportToPylonBecauseNotMeetingBiomeRequirements": "This pylon is not in the correct biome to use", - "CannotTeleportToPylonBecauseAccessingLihzahrdTempleEarly": "Ancient forces prevent you from accessing this location . . .", - + "EmptyName": "Empty name." }, "GameUI": { - "Storm": "Storm", "HeavyRain": "Heavy Rain", "Rain": "Rain", "LightRain": "Light Rain", @@ -363,27 +259,24 @@ "PaintSprayerOff": "Paint sprayer off", "ActuationDeviceOn": "Actuation device on", "ActuationDeviceOff": "Actuation device off", - "BlockReplacerOn": "Block swap on", - "BlockReplacerOff": "Block swap off", "SettingsMenu": "Settings Menu", "Buy": "Buy", "BuyWithValue": "Buy ({0})", "Cancel": "Cancel", "Change": "Change", "Expert": "Expert", - "Master": "Master", "NotEnoughWater": "Not Enough Water!", "FullFishingPower": "{0} ({1}%) Fishing Power", "PrecentFishingPower": "{0}% fishing power", "BaitRequired": "Requires bait to catch fish", "BaitPower": "{0}% bait power", "HairStyle": "Hair Style", - "CraftingWindow": "Crafting Window", - "QuickStackToNearby": "Quick Stack to Nearby Chests", - "SortInventory": "Sort Inventory", + "CraftingWindow": "Crafting window", + "QuickStackToNearby": "Quick stack to nearby chests", + "SortInventory": "Sort inventory", "PlayerDistance": "({0} ft)", "Bright": "Bright", - "Normal": "Classic", + "Normal": "Normal", "Faded": "Faded", "Hidden": "Hidden", "WaveQuality": "Waves Quality: {0}", @@ -402,27 +295,9 @@ "Misc": "Misc", "Gameplay": "Gameplay", "LightingUpdateEveryFrameOn": "Rapid Lighting On", - "LightingUpdateEveryFrameOff": "Rapid Lighting Off", - "MapScale": "Map Scale: {0}%", - "Emote": "Open Emotes Window", - "HoverTextBoxesOn": "Hover Text Boxes On", - "HoverTextBoxesOff": "Hover Text Boxes Off", - "Bestiary": "Open Bestiary", - "TimeAtMorning": "AM", - "TimePastMorning": "PM", - "PlayerLifeMax": " HP", - "PlayerManaMax": " MP", - "NotificationsOptionsCategory": "Notifications", - "ClearAllNotifications": "Clear All", - "OpenFileFolder": "{$LegacyInterface.110}", - "PotionOfReturnExitPortal": "Return Portal Exit", - "PotionOfReturnHomePortal": "Return Portal Entrance", - "Music": "Music", - "TorchTypeSwapperOn": "Biome torch swap on", - "TorchTypeSwapperOff": "Biome torch swap off", + "LightingUpdateEveryFrameOff": "Rapid Lighting Off" }, "Controls": { - "LeftClick": "Left Click", "RightClick": "Right Click" }, "Social": { @@ -448,8 +323,6 @@ "BedObstructed": "Your bed is obstructed.", "PvPFlag": "(PvP)", "DroppedCoins": "dropped {0}", - "RespawnInPrefix": "", - "RespawnInSuffix": "{0}", "InvasionPoints": "{0} points", "WaveMessage": "Wave {0}: {1}", "WaveCleared": "Cleared {0}", @@ -457,7 +330,6 @@ "HasTeleportedTo": "{0} has teleported to {1}", "Time": "Time: {0}", "NPCTitle": "{0} the {1}", - "ReservedForNPC": "Reserved for {0}", "PlayerDeathTime": "{0} died {1} ago", "SpawnPointRemoved": "Spawn point removed!", "SpawnPointSet": "Spawn point set!", @@ -478,19 +350,12 @@ "HouseChair": "a chair", "BirthdayParty_1": "Looks like {0} is throwing a party", "BirthdayParty_2": "Looks like {0} & {1} are throwing a party", - "BirthdayParty_3": "Looks like {0}, {1}, and {2} are throwing a party", - "BallBounceResultGolf_Single": "{0} sunk the {1} in {2} stroke!", - "BallBounceResultGolf_Plural": "{0} sunk the {1} in {2} strokes!" + "BirthdayParty_3": "Looks like {0}, {1}, and {2} are throwing a party" }, "Enemies": { "TheTwins": "The Twins", "MoonLord": "Moon Lord" }, - "Friends": { - "TownCat": "Town Cat", - "TownDog": "Town Dog", - "TownBunny": "Town Bunny" - }, "DeathTextGeneric": { "Slain": "{0} was slain", "Eviscerated": "{0} was eviscerated", @@ -514,7 +379,7 @@ "Snapped": "{0} got snapped in half", "Cut": "{0} was cut down the middle", "Chopped": "{0} was chopped up", - "Plead": "{0}'s plea for death was answered", + "Plead": "{0}'s plead for death was answered", "Ripped": "{0}'s meat was ripped off the bone", "Flailing": "{0}'s flailing about was finally stopped", "HeadRemoved": "{0} had their head removed" @@ -548,10 +413,9 @@ "Lava_3": "{0} tried to swim in lava.", "Lava_4": "{0} likes to play in magma.", "Petrified_1": "{0} shattered into pieces.", - "Petrified_2": "{0} can't be put back together again.", + "Petrified_2": "{0} cant be put back together again.", "Petrified_3": "{0} needs to be swept up.", - "Petrified_4": "{0} just became another dirt pile.", - "Inferno": "{0} was consumed by the inferno." + "Petrified_4": "{0} just became another dirt pile." }, "Misc": { "ForceWaterSettling": "Forcing water to settle.", @@ -560,17 +424,7 @@ "ShortDays": "d", "ShortHours": "h", "ShortMinutes": "m", - "ShortSeconds": "s", - "CombatBookUsed": "The book's knowledge empowers your villagers!", - "Fruit": "Fruit", - "CanBePlacedInVanity": "Can be worn in vanity slots", - "StartedVictoryXmas": "The spirit of Christmas spreads cheer...", - "EndedVictoryXmas": "The spirit of Christmas fades...", - "StartedVictoryHalloween": "The spirit of Halloween penetrates the air...", - "EndedVictoryHalloween": "The spirit of Halloween rests...", - "LicenseCatUsed": "The license teleports away to the cat delivery service...", - "LicenseDogUsed": "The license teleports away to the dog delivery service...", - "LicenseBunnyUsed": "The license teleports away to the bunny delivery service..." + "ShortSeconds": "s" }, "Currency": { "Platinum": "Platinum", @@ -588,8 +442,6 @@ "Completed": "Achievement complete! {0}", "TIMBER_Name": "Timber!!", "TIMBER_Description": "Chop down your first tree.", - "BENCHED_Name": "Benched", - "BENCHED_Description": "Craft your first work bench.", "NO_HOBO_Name": "No Hobo", "NO_HOBO_Description": "Build a house suitable enough for your first town NPC, such as the guide, to move into.", "OBTAIN_HAMMER_Name": "Stop! Hammer Time!", @@ -611,7 +463,7 @@ "SMASHING_POPPET_Name": "Smashing, Poppet!", "SMASHING_POPPET_Description": "Using explosives or your trusty hammer, smash a Shadow Orb or Crimson Heart in the evil parts of your world.", "WORM_FODDER_Name": "Worm Fodder", - "WORM_FODDER_Description": "Defeat the Eater of Worlds, a massive worm who dwells in the corruption.", + "WORM_FODDER_Description": "Defeat the Eater of Worlds, a massive worm whom dwells in the corruption.", "MASTERMIND_Name": "Mastermind", "MASTERMIND_Description": "Defeat the Brain of Cthulhu, an enormous demon brain which haunts the creeping crimson.", "WHERES_MY_HONEY_Name": "Where's My Honey?", @@ -757,7 +609,7 @@ "SUPREME_HELPER_MINION_Name": "Supreme Helper Minion!", "SUPREME_HELPER_MINION_Description": "Complete a grand total of 200 quests for the angler.", "TOPPED_OFF_Name": "Topped Off", - "TOPPED_OFF_Description": "Attain maximum life and mana possible without accessories or buffs.", + "TOPPED_OFF_Description": "Attain maximum health and mana possible without accessories or buffs.", "SLAYER_OF_WORLDS_Name": "Slayer of Worlds", "SLAYER_OF_WORLDS_Description": "Defeat every boss in Terraria.", "YOU_CAN_DO_IT_Name": "You Can Do It!", @@ -832,7 +684,7 @@ "48": "Terraria 2: Electric Boogaloo", "49": "Terraria: Also try Minecraft!", "5": "Terraria: A Bunnies Tale", - "50": "Terraria: Also try Breath of the Wild!", + "50": "Terraria: Also try Edge of Space!", "51": "Terraria: I just wanna know where the gold at?", "52": "Terraria: Now with more ducks!", "53": "Terraria: 9 + 1 = 11", @@ -842,1812 +694,5 @@ "8": "Terraria: The Grass is Greener on This Side", "9": "Terraria: Small Blocks, Not for Children Under the Age of 5", "55": "Terraria: Shut Up and Dig Gaiden!" - }, - "RandomWorldName_Legacy": { - "1": "Redigit's Kingdom", - "2": "Cenx's Turf", - "3": "Cthulhu's Ruins", - "4": "Land of the Moon", - "5": "Working Ant's Nest" - }, - - "RandomWorldName_Composition": { - "1": "The {Adjective} {Location} of {Noun}", - "2": "The {Adjective} {Location} of {Noun}", - "3": "{Adjective} {Location} of {Noun}", - "4": "{Adjective} {Location} of {Noun}", - "5": "The {Adjective} {Location}", - "6": "{Adjective} {Location}", - "7": "The {Location} of {Noun}", - "8": "{Location} of {Noun}" - }, - "RandomWorldName_Adjective": { -"Abandoned": "Abandoned", - "Abhorrent": "Abhorrent", - "Abusive": "Abusive", - "Adorable": "Adorable", - "Adventurous": "Adventurous", - "Ageless": "Ageless", - "Aggravating": "Aggravating", - "Aggressive": "Aggressive", - "Agile": "Agile", - "Agreeable": "Agreeable", - "Alert": "Alert", - "Alien": "Alien", - "Alive": "Alive", - "Alleged": "Alleged", - "Amethyst": "Amethyst", - "Amusing": "Amusing", - "Ancient": "Ancient", - "Angelic": "Angelic", - "Angry": "Angry", - "Annoyed": "Annoyed", - "Annoying": "Annoying", - "Anxious": "Anxious", - "Archaic": "Archaic", - "Ardent": "Ardent", - "Arrogant": "Arrogant", - "Ashamed": "Ashamed", - "Attractive": "Attractive", - "AuntBeckys": "Aunt Becky's", - "Average": "Average", - "Awful": "Awful", - "Awkward": "Awkward", - "Babbling": "Babbling", - "Bad": "Bad", - "Bashful": "Bashful", - "Beautiful": "Beautiful", - "Best": "Best", - "Bewildered": "Bewildered", - "Bitter": "Bitter", - "Bizarre": "Bizarre", - "Black": "Black", - "Blackish": "Blackish", - "Bleeding": "Bleeding", - "Blistering": "Blistering", - "Blocky": "Blocky", - "Bloody": "Bloody", - "Blooming": "Blooming", - "Blue": "Blue", - "Blushful": "Blushful", - "Blushing": "Blushing", - "Boatmurdered": "Boatmurdered", - "Boorish": "Boorish", - "Bored": "Bored", - "Boundless": "Boundless", - "Brainy": "Brainy", - "Brash": "Brash", - "Brave": "Brave", - "Breakable": "Breakable", - "Breakless": "Breakless", - "Breathtaking": "Breathtaking", - "Bright": "Bright", - "Brightish": "Brightish", - "Brilliant": "Brilliant", - "Broken": "Broken", - "Brown": "Brown", - "Brutal": "Brutal", - "Budding": "Budding", - "Burning": "Burning", - "Busy": "Busy", - "Calm": "Calm", - "Canadian": "Canadian", - "Careful": "Careful", - "Cautious": "Cautious", - "Celestial": "Celestial", - "Chads": "Chad's", - "Charming": "Charming", - "Chartreuse": "Chartreuse", - "Cheap": "Cheap", - "Cheerful": "Cheerful", - "Clean": "Clean", - "Clear": "Clear", - "Clearable": "Clearable", - "Clever": "Clever", - "Cleverish": "Cleverish", - "Cloudy": "Cloudy", - "Clumsy": "Clumsy", - "Cold": "Cold", - "Colorful": "Colorful", - "Combative": "Combative", - "Comfortable": "Comfortable", - "Comical": "Comical", - "Common": "Common", - "Complacent": "Complacent", - "Compulsive": "Compulsive", - "Concerned": "Concerned", - "Condemnable": "Condemnable", - "Condemned": "Condemned", - "Confident": "Confident", - "Confusable": "Confusable", - "Confused": "Confused", - "Constant": "Constant", - "Cooperative": "Cooperative", - "Corrupted": "Corrupted", - "Cosmic": "Cosmic", - "Courageous": "Courageous", - "Cracked": "Cracked", - "Cranky": "Cranky", - "Crass": "Crass", - "Crazy": "Crazy", - "Creepy": "Creepy", - "Crowded": "Crowded", - "Crude": "Crude", - "Cruel": "Cruel", - "Cuddly": "Cuddly", - "Curious": "Curious", - "Cursed": "Cursed", - "Cute": "Cute", - "Daft": "Daft", - "Damaged": "Damaged", - "Dangerous": "Dangerous", - "Dank": "Dank", - "Dark": "Dark", - "Daunting": "Daunting", - "Dead": "Dead", - "Decaying": "Decaying", - "Deceased": "Deceased", - "Defeated": "Defeated", - "Defiant": "Defiant", - "Delightful": "Delightful", - "Demented": "Demented", - "Demonic": "Demonic", - "Dense": "Dense", - "Depressed": "Depressed", - "Deranged": "Deranged", - "Desolate": "Desolate", - "Desperate": "Desperate", - "Determined": "Determined", - "Devious": "Devious", - "Diamond": "Diamond", - "Different": "Different", - "Difficult": "Difficult", - "Dire": "Dire", - "Dirty": "Dirty", - "Disappointing": "Disappointing", - "Discarded": "Discarded", - "Disgusting": "Disgusting", - "Disgusting": "Disgusting", - "Disloyal": "Disloyal", - "Distant": "Distant", - "Distinct": "Distinct", - "Distorted": "Distorted", - "Distressing": "Distressing", - "Disturbed": "Disturbed", - "Divine": "Divine", - "Dizzy": "Dizzy", - "Docile": "Docile", - "Doubtful": "Doubtful", - "Drab": "Drab", - "Dreadful": "Dreadful", - "Dreamy": "Dreamy", - "Dry": "Dry", - "Dubious": "Dubious", - "Dull": "Dull", - "Dumb": "Dumb", - "Eager": "Eager", - "Easy": "Easy", - "Eerie": "Eerie", - "Elated": "Elated", - "Elegant": "Elegant", - "Embarrassed": "Embarrassed", - "Embarrassing": "Embarrassing", - "Emerald": "Emerald", - "Empty": "Empty", - "Enchanting": "Enchanting", - "Encouraging": "Encouraging", - "Enduring": "Enduring", - "Energetic": "Energetic", - "Enthusiastic": "Enthusiastic", - "Envious": "Envious", - "Erratic": "Erratic", - "Eternal": "Eternal", - "Euphoric": "Euphoric", - "Everlasting": "Everlasting", - "Evil": "Evil", - "Exalted": "Exalted", - "Excellent": "Excellent", - "Excited": "Excited", - "Exiled": "Exiled", - "Existential": "Existential", - "Exotic": "Exotic", - "Expensive": "Expensive", - "Extinct": "Extinct", - "Extraordinary": "Extraordinary", - "Extravagant": "Extravagant", - "Exuberant": "Exuberant", - "Fabulous": "Fabulous", - "Fair": "Fair", - "Faithful": "Faithful", - "Fallen": "Fallen", - "Famous": "Famous", - "Fancy": "Fancy", - "Fantastic": "Fantastic", - "Far": "Far", - "Faraway": "Faraway", - "Fearful": "Fearful", - "Fearsome": "Fearsome", - "Fierce": "Fierce", - "Filthy": "Filthy", - "Fine": "Fine", - "Firm": "Firm", - "Flaky": "Flaky", - "Flaming": "Flaming", - "Flatulent": "Flatulent", - "Fluffy": "Fluffy", - "Foolhardy": "Foolhardy", - "Foolish": "Foolish", - "Forceful": "Forceful", - "Foreign": "Foreign", - "Forgiving": "Forgiving", - "Forgotten": "Forgotten", - "Forsaken": "Forsaken", - "Foul": "Foul", - "Fragile": "Fragile", - "Frail": "Frail", - "Frantic": "Frantic", - "Fresh": "Fresh", - "Friendly": "Friendly", - "Frightened": "Frightened", - "Frightening": "Frightening", - "Frightening": "Frightening", - "Funny": "Funny", - "Furious": "Furious", - "Gangrenous": "Gangrenous", - "Gentle": "Gentle", - "Gifted": "Gifted", - "Glamorous": "Glamorous", - "Gleaming": "Gleaming", - "Gleamless": "Gleamless", - "Gloomy": "Gloomy", - "Glorious": "Glorious", - "Glowing": "Glowing", - "Godly": "Godly", - "Good": "Good", - "Gorgeous": "Gorgeous", - "Graceful": "Graceful", - "Grand": "Grand", - "Grassy": "Grassy", - "Gray": "Gray", - "Greasy": "Greasy", - "Great": "Great", - "Greedy": "Greedy", - "Green": "Green", - "Grieving": "Grieving", - "Grizzly": "Grizzly", - "Grotesque": "Grotesque", - "Grouchy": "Grouchy", - "Growing": "Growing", - "Gruesome": "Gruesome", - "Grumpy": "Grumpy", - "Guilty": "Guilty", - "Gutless": "Gutless", - "Hallowed": "Hallowed", - "Handsome": "Handsome", - "Happy": "Happy", - "Harsh": "Harsh", - "Hateful": "Hateful", - "Hazardous": "Hazardous", - "Healthy": "Healthy", - "Heartless": "Heartless", - "Heavenly": "Heavenly", - "Heinous": "Heinous", - "Helpful": "Helpful", - "Helpless": "Helpless", - "Hesitant": "Hesitant", - "Hidden": "Hidden", - "Hideous": "Hideous", - "Hilarious": "Hilarious", - "Holy": "Holy", - "Homeless": "Homeless", - "Homely": "Homely", - "Horrible": "Horrible", - "Horrific": "Horrific", - "Horrifying": "Horrifying", - "Hungry": "Hungry", - "Hurt": "Hurt", - "Hurtable": "Hurtable", - "Hurtful": "Hurtful", - "Hyper": "Hyper", - "Hyperalert": "Hyperalert", - "Hyperenergetic": "Hyperenergetic", - "Hyperexcited": "Hyperexcited", - "Hyperhilarious": "Hyperhilarious", - "Hysterical": "Hysterical", - "Ignorant": "Ignorant", - "Illicit": "Illicit", - "Illusive": "Illusive", - "Imaginary": "Imaginary", - "Imaginary": "Imaginary", - "Immortal": "Immortal", - "Incompetent": "Incompetent", - "Inconvenient": "Inconvenient", - "Indecisive": "Indecisive", - "Indifferent": "Indifferent", - "Inferior": "Inferior", - "Infinite": "Infinite", - "Insecure": "Insecure", - "Insolent": "Insolent", - "Intense": "Intense", - "Irresponsible": "Irresponsible", - "Irritating": "Irritating", - "Isolated": "Isolated", - "Jade": "Jade", - "Jealous": "Jealous", - "Jiggly": "Jiggly", - "Jittery": "Jittery", - "Jolly": "Jolly", - "Joyous": "Joyous", - "Judgmental": "Judgmental", - "Karens": "Karen's", - "Keen": "Keen", - "Kind": "Kind", - "Kooky": "Kooky", - "Large": "Large", - "Lasting": "Lasting", - "Lavish": "Lavish", - "Lazy": "Lazy", - "Lazyish": "Lazyish", - "Leafy": "Leafy", - "Legendary": "Legendary", - "Light": "Light", - "Lightful": "Lightful", - "Lime": "Lime", - "Littleknown": "Little Known", - "Lively": "Lively", - "Lonely": "Lonely", - "Long": "Long", - "Lost": "Lost", - "Lousy": "Lousy", - "Lovely": "Lovely", - "Loyal": "Loyal", - "Lucky": "Lucky", - "Mad": "Mad", - "Magical": "Magical", - "Magnificent": "Magnificent", - "Marvelous": "Marvelous", - "Massive": "Massive", - "Menacing": "Menacing", - "Merciless": "Merciless", - "Mischievous": "Mischievous", - "Miserable": "Miserable", - "Misty": "Misty", - "Modern": "Modern", - "Modular": "Modular", - "Moist": "Moist", - "Moldy": "Moldy", - "Mopey": "Mopey", - "Motionless": "Motionless", - "Mourning": "Mourning", - "Muddy": "Muddy", - "Multitalented": "Multitalented", - "Murderous": "Murderous", - "Murky": "Murky", - "Mushy": "Mushy", - "Mysterious": "Mysterious", - "Mythical": "Mythical", - "Naive": "Naive", - "Naked": "Naked", - "Nameless": "Nameless", - "Nasty": "Nasty", - "Natural": "Natural", - "Naughty": "Naughty", - "Nauseating": "Nauseating", - "Navy": "Navy", - "Neglected": "Neglected", - "Nervous": "Nervous", - "New": "New", - "Nice": "Nice", - "Nimble": "Nimble", - "Nude": "Nude", - "Nutty": "Nutty", - "Obedient": "Obedient", - "Obnoxious": "Obnoxious", - "Obsessive": "Obsessive", - "Obstructed": "Obstructed", - "Obtuse": "Obtuse", - "Odd": "Odd", - "Offended": "Offended", - "Offensive": "Offensive", - "Old": "Old", - "OldFashioned": "Old-fashioned", - "Olive": "Olive", - "Open": "Open", - "Optimistic": "Optimistic", - "Outraged": "Outraged", - "Outrageous": "Outrageous", - "Outstanding": "Outstanding", - "Overcrowded": "Overcrowded", - "Overeasy": "Overeasy", - "Overjealous": "Overjealous", - "Overjoyous": "Overjoyous", - "Overrun": "Overrun", - "Pale": "Pale", - "Panicky": "Panicky", - "Peaceful": "Peaceful", - "Perfect": "Perfect", - "Perilous": "Perilous", - "Perpetual": "Perpetual", - "Persistent": "Persistent", - "Petrified": "Petrified", - "Pine": "Pine", - "Placid": "Placid", - "Plain": "Plain", - "Pleasant": "Pleasant", - "Pleasing": "Pleasing", - "Pointy": "Pointy", - "Poised": "Poised", - "Poison": "Poison", - "Poor": "Poor", - "Powerful": "Powerful", - "Precious": "Precious", - "Prickly": "Prickly", - "Proud": "Proud", - "Purified": "Purified", - "Putrid": "Putrid", - "Puzzled": "Puzzled", - "Quaint": "Quaint", - "Quick": "Quick", - "Quiet": "Quiet", - "Quirky": "Quirky", - "Rancid": "Rancid", - "Rank": "Rank", - "Raunchy": "Raunchy", - "Raw": "Raw", - "Real": "Real", - "Reckless": "Reckless", - "Red's": "Red's", - "Reeking": "Reeking", - "Rejected": "Rejected", - "Relentless": "Relentless", - "Relievable": "Relievable", - "Relieved": "Relieved", - "Remote": "Remote", - "Repugnant": "Repugnant", - "Repulsive": "Repulsive", - "Resentful": "Resentful", - "Restful": "Restful", - "Revolting": "Revolting", - "Rich": "Rich", - "Ridiculous": "Ridiculous", - "Risky": "Risky", - "Rotten": "Rotten", - "Rotting": "Rotting", - "Royal": "Royal", - "Ruby": "Ruby", - "Rude": "Rude", - "Ruthless": "Ruthless", - "Sacred": "Sacred", - "Sad": "Sad", - "Sadistic": "Sadistic", - "Sage": "Sage", - "Sallow": "Sallow", - "Sapphire": "Sapphire", - "Savage": "Savage", - "Scandalous": "Scandalous", - "Scary": "Scary", - "Searing": "Searing", - "Sedated": "Sedated", - "Selfish": "Selfish", - "Senseless": "Senseless", - "Sensitive": "Sensitive", - "Serene": "Serene", - "Serious": "Serious", - "Shabby": "Shabby", - "Shameful": "Shameful", - "Sharp": "Sharp", - "Shiny": "Shiny", - "Shocking": "Shocking", - "Shoddy": "Shoddy", - "Shy": "Shy", - "Significant": "Significant", - "Silenced": "Silenced", - "Silly": "Silly", - "Simple": "Simple", - "Sleazy": "Sleazy", - "Sleepy": "Sleepy", - "Slow": "Slow", - "Sluggish": "Sluggish", - "Smelly": "Smelly", - "Smiling": "Smiling", - "Smoggy": "Smoggy", - "Smooth": "Smooth", - "Smouldering": "Smouldering", - "Solid": "Solid", - "Sore": "Sore", - "Sour": "Sour", - "Sparkling": "Sparkling", - "Spastic": "Spastic", - "Spiritual": "Spiritual", - "Splendid": "Splendid", - "Spoiled": "Spoiled", - "Spooky": "Spooky", - "Spotless": "Spotless", - "Stable": "Stable", - "Stalwart": "Stalwart", - "Staunch": "Staunch", - "Stiff": "Stiff", - "Still": "Still", - "Stinky": "Stinky", - "Stormy": "Stormy", - "Strange": "Strange", - "Strong": "Strong", - "Stupid": "Stupid", - "Subaverage": "Subaverage", - "Successful": "Successful", - "Super": "Super", - "Superb": "Superb", - "Superior": "Superior", - "Supreme": "Supreme", - "Sweaty": "Sweaty", - "Tainted": "Tainted", - "Talented": "Talented", - "Tame": "Tame", - "Tasty": "Tasty", - "Teal": "Teal", - "Tender": "Tender", - "Tense": "Tense", - "Terrible": "Terrible", - "Terrified": "Terrified", - "Thankful": "Thankful", - "Thanos": "Thanos'", - "Thick": "Thick", - "Thoughtful": "Thoughtful", - "Thoughtless": "Thoughtless", - "Timeless": "Timeless", - "Tiny": "Tiny", - "Tired": "Tired", - "Topaz": "Topaz", - "Tough": "Tough", - "Tranquil": "Tranquil", - "Trashy": "Trashy", - "Tropical": "Tropical", - "Troubled": "Troubled", - "Trusting": "Trusting", - "Ugliest": "Ugliest", - "Ugly": "Ugly", - "Unbroken": "Unbroken", - "Uncharming": "Uncharming", - "Uncharted": "Uncharted", - "Uncombative": "Uncombative", - "Uncooperative": "Uncooperative", - "Undetermined": "Undetermined", - "Undiscovered": "Undiscovered", - "Undying": "Undying", - "Unending": "Unending", - "Unexplored": "Unexplored", - "Unhappy": "Unhappy", - "Unhurt": "Unhurt", - "Unhurting": "Unhurting", - "Uninterested": "Uninterested", - "Unknown": "Unknown", - "Unlawful": "Unlawful", - "Unpleasant": "Unpleasant", - "Unreal": "Unreal", - "Unruly": "Unruly", - "Unsightly": "Unsightly", - "Unsure": "Unsure", - "Untalented": "Untalented", - "Untamed": "Untamed", - "Unusual": "Unusual", - "Unwicked": "Unwicked", - "Unworried": "Unworried", - "Upset": "Upset", - "Upsetable": "Upsetable", - "Uptight": "Uptight", - "Useless": "Useless", - "Vague": "Vague", - "Vain": "Vain", - "Vast": "Vast", - "Vibrant": "Vibrant", - "Vicious": "Vicious", - "Victorious": "Victorious", - "Vile": "Vile", - "Violent": "Violent", - "Viridian": "Viridian", - "Vivacious": "Vivacious", - "Volatile": "Volatile", - "Vulgar": "Vulgar", - "Wacky": "Wacky", - "Wandering": "Wandering", - "Wary": "Wary", - "Weak": "Weak", - "Weary": "Weary", - "Weepy": "Weepy", - "Weird": "Weird", - "Wellamused": "Wellamused", - "Wellfrightened": "Wellfrightened", - "Wet": "Wet", - "Wicked": "Wicked", - "Wild": "Wild", - "Windy": "Windy", - "Wishful": "Wishful", - "Withered": "Withered", - "Witless": "Witless", - "Witty": "Witty", - "Wonderful": "Wonderful", - "Wondrous": "Wondrous", - "Worried": "Worried", - "Worrisome": "Worrisome", - "Wriggly": "Wriggly", - "Wrong": "Wrong", - "Yellow": "Yellow", - "YOLO": "YOLO", - "Zany": "Zany", - "Zealous": "Zealous", - }, - "RandomWorldName_Location": { - "Abode": "Abode", - "Abyss": "Abyss", - "Acres": "Acres", - "Afterworld": "Afterworld", - "Alcove": "Alcove", - "Alley": "Alley", - "Apogee": "Apogee", - "Arbor": "Arbor", - "Archipelago": "Archipelago", - "Area": "Area", - "Arena": "Arena", - "Armpit": "Armpit", - "Artwork": "Artwork", - "Asylum": "Asylum", - "Backcountry": "Backcountry", - "Backwater": "Backwater", - "Backwoods": "Backwoods", - "Badlands": "Badlands", - "Bank": "Bank", - "Barleycorn": "Barleycorn", - "Barren": "Barren", - "Base": "Base", - "Basin": "Basin", - "Bastion": "Bastion", - "Bay": "Bay", - "Bayou": "Bayou", - "Beach": "Beach", - "Bed": "Bed", - "Bedrock": "Bedrock", - "Beyond": "Beyond", - "Biosphere": "Biosphere", - "Bluff": "Bluff", - "Bog": "Bog", - "Boondocks": "Boondocks", - "Boonies": "Boonies", - "Border": "Border", - "Bottoms": "Bottoms", - "Boundary": "Boundary", - "Breach": "Breach", - "Brewery": "Brewery", - "Brook": "Brook", - "Bubble": "Bubble", - "Bunker": "Bunker", - "Burrow": "Burrow", - "Bush": "Bush", - "Butte": "Butte", - "Camp": "Camp", - "Canal": "Canal", - "Canopy": "Canopy", - "Canvas": "Canvas", - "Canyon": "Canyon", - "Cape": "Cape", - "Center": "Center", - "Chaparral": "Chaparral", - "Chasm": "Chasm", - "Citadel": "Citadel", - "City": "City", - "Clearing": "Clearing", - "Climax": "Climax", - "Cloudland": "Cloudland", - "Coast": "Coast", - "Colony": "Colony", - "Commune": "Commune", - "Confluence": "Confluence", - "Continent": "Continent", - "Convention": "Convention", - "Core": "Core", - "Cosmos": "Cosmos", - "Country": "Country", - "County": "County", - "Court": "Court", - "Courtyard": "Courtyard", - "Cove": "Cove", - "Crater": "Crater", - "Creek": "Creek", - "Crest": "Crest", - "Crick": "Crick", - "Crossing": "Crossing", - "Crossroads": "Crossroads", - "Crown": "Crown", - "Dale": "Dale", - "Dab": "Dab", - "Dam": "Dam", - "Daydream": "Daydream", - "Defecation": "Defecation", - "Dell": "Dell", - "Delta": "Delta", - "Den": "Den", - "Depths": "Depths", - "Desert": "Desert", - "Dimension": "Dimension", - "District": "District", - "Domain": "Domain", - "Dome": "Dome", - "Dream": "Dream", - "Dreamland": "Dreamland", - "Dreamworld": "Dreamworld", - "Dump": "Dump", - "Dune": "Dune", - "Dungeon": "Dungeon", - "Easement": "Easement", - "Edge": "Edge", - "Elevation": "Elevation", - "Empire": "Empire", - "Empyrean": "Empyrean", - "Enclosure": "Enclosure", - "Entity": "Entity", - "Essence": "Essence", - "Estate": "Estate", - "Estuary": "Estuary", - "Eternity": "Eternity", - "Ether": "Ether", - "Everglade": "Everglade", - "Existence": "Existence", - "Expanse": "Expanse", - "Exterior": "Exterior", - "Fable": "Fable", - "Fabrication": "Fabrication", - "Fantasia": "Fantasia", - "Farm": "Farm", - "Field": "Field", - "Figment": "Figment", - "Firmament": "Firmament", - "Fjord": "Fjord", - "Flatland": "Flatland", - "Flats": "Flats", - "Fold": "Fold", - "Foothold": "Foothold", - "Forest": "Forest", - "Forge": "Forge", - "Fortress": "Fortress", - "Foundation": "Foundation", - "Fountain": "Fountain", - "Fraternity": "Fraternity", - "Front": "Front", - "Frontier": "Frontier", - "Galaxy": "Galaxy", - "Garden": "Garden", - "Geyser": "Geyser", - "Glacier": "Glacier", - "Glade": "Glade", - "Globe": "Globe", - "Grange": "Grange", - "Grassland": "Grassland", - "Graveyard": "Graveyard", - "Grounds": "Grounds", - "Grove": "Grove", - "Gulf": "Gulf", - "Gully": "Gully", - "Gutter": "Gutter", - "Hamlet": "Hamlet", - "Harbor": "Harbor", - "Haven": "Haven", - "Heart": "Heart", - "Heaven": "Heaven", - "Hedge": "Hedge", - "Heights": "Heights", - "Hideout": "Hideout", - "Highland": "Highland", - "Hill": "Hill", - "Hilltop": "Hilltop", - "Hinterland": "Hinterland", - "Hive": "Hive", - "Hole": "Hole", - "Homeland": "Homeland", - "Hoosegow": "Hoosegow", - "Hollow": "Hollow", - "Hovel": "Hovel", - "Hub": "Hub", - "Illusion": "Illusion", - "Image": "Image", - "Interior": "Interior", - "Island": "Island", - "Isle": "Isle", - "Islet": "Islet", - "Jungle": "Jungle", - "Keystone": "Keystone", - "Kingdom": "Kingdom", - "Knoll": "Knoll", - "Labyrinth": "Labyrinth", - "Lagoon": "Lagoon", - "Lair": "Lair", - "Lake": "Lake", - "Land": "Land", - "Legend": "Legend", - "Limbo": "Limbo", - "Locale": "Locale", - "Loch": "Loch", - "Marsh": "Marsh", - "Marshland": "Marshland", - "Mass": "Mass", - "Maze": "Maze", - "Meadow": "Meadow", - "Meridian": "Meridian", - "Mesa": "Mesa", - "Midland": "Midland", - "Mine": "Mine", - "Mirage": "Mirage", - "Mire": "Mire", - "Moorland": "Moorland", - "Morass": "Morass", - "Mortuary": "Mortuary", - "Mound": "Mound", - "Mountain": "Mountain", - "Myth": "Myth", - "Nation": "Nation", - "Neighborhood": "Neighborhood", - "Nest": "Nest", - "Niche": "Niche", - "Nightmare": "Nightmare", - "Nirvana": "Nirvana", - "Nursery": "Nursery", - "Oasis": "Oasis", - "Object": "Object", - "OldTownRoad": "Old Town Road", - "Ocean": "Ocean", - "Orchard": "Orchard", - "Origin": "Origin", - "Outback": "Outback", - "Outland": "Outland", - "Outskirts": "Outskirts", - "Outskirts": "Outskirts", - "Overworld": "Overworld", - "Paintbrush": "Paintbrush", - "Parable": "Parable", - "Paradise": "Paradise", - "Park": "Park", - "Passage": "Passage", - "Passing": "Passing", - "Pasture": "Pasture", - "Patch": "Patch", - "Peak": "Peak", - "Pedestal": "Pedestal", - "Peninsula": "Peninsula", - "Picture": "Picture", - "Pinnacle": "Pinnacle", - "Pit": "Pit", - "Place": "Place", - "Plains": "Plains", - "Planet": "Planet", - "Plateau": "Plateau", - "Plaza": "Plaza", - "Plot": "Plot", - "Plumbus": "Plumbus", - "Point": "Point", - "Polestar": "Polestar", - "Pond": "Pond", - "Port": "Port", - "Portrait": "Portrait", - "Pothole": "Pothole", - "Prairie": "Prairie", - "Prison": "Prison", - "Province": "Province", - "Pub": "Pub", - "Quagmire": "Quagmire", - "Quarantine": "Quarantine", - "Ranch": "Ranch", - "Rapids": "Rapids", - "Ravine": "Ravine", - "Reach": "Reach", - "Reality": "Reality", - "Realm": "Realm", - "Reef": "Reef", - "Refuge": "Refuge", - "Region": "Region", - "Remotes": "Remotes", - "Residence": "Residence", - "Rest": "Rest", - "Retreat": "Retreat", - "Ridge": "Ridge", - "Rift": "Rift", - "Ring": "Ring", - "River": "River", - "Roost": "Roost", - "Root": "Root", - "Route": "Route", - "Run": "Run", - "Sanctuary": "Sanctuary", - "Savanna": "Savanna", - "Schmeckle": "Schmeckle", - "Scrubland": "Scrubland", - "Sea": "Sea", - "Seaside": "Seaside", - "Section": "Section", - "Sector": "Sector", - "Settlement": "Settlement", - "Shallows": "Shallows", - "Shanty": "Shanty", - "Shantytown": "Shantytown", - "Sheet": "Sheet", - "Shire": "Shire", - "Shore": "Shore", - "Shrine": "Shrine", - "Shroud": "Shroud", - "Shrubbery": "Shrubbery", - "Shrublands": "Shrublands", - "Site": "Site", - "Slope": "Slope", - "Slumber": "Slumber", - "Snap": "Snap", - "Sod": "Sod", - "Sorority": "Sorority", - "Source": "Source", - "Space": "Space", - "Span": "Span", - "Sphere": "Sphere", - "Spring": "Spring", - "Square": "Square", - "State": "State", - "Station": "Station", - "Steppe": "Steppe", - "Sticks": "Sticks", - "Stonk": "Stonk", - "Story": "Story", - "Strait": "Strait", - "Stream": "Stream", - "Stretch": "Stretch", - "Suburb": "Suburb", - "Summit": "Summit", - "Swale": "Swale", - "Swamp": "Swamp", - "Sweep": "Sweep", - "Taiga": "Taiga", - "Tale": "Tale", - "Temple": "Temple", - "Terrace": "Terrace", - "Terrain": "Terrain", - "Terraria": "Terraria", - "Terrarium": "Terrarium", - "Territory": "Territory", - "Thicket": "Thicket", - "Throne": "Throne", - "Timberland": "Timberland", - "Tilt": "Tilt", - "Tip": "Tip", - "Tomb": "Tomb", - "Towel": "Towel", - "Town": "Town", - "Tract": "Tract", - "Trail": "Trail", - "Trench": "Trench", - "Tributary": "Tributary", - "Tropic": "Tropic", - "Tundra": "Tundra", - "Tunnel": "Tunnel", - "Turf": "Turf", - "Underbelly": "Underbelly", - "Undergrowth": "Undergrowth", - "Underwood": "Underwood", - "Universe": "Universe", - "Unknown": "Unknown", - "Upland": "Upland", - "Utopia": "Utopia", - "Vale": "Vale", - "Valley": "Valley", - "Vault": "Vault", - "Veldt": "Veldt", - "Vicinity": "Vicinity", - "Vineyard": "Vineyard", - "Vision": "Vision", - "Void": "Void", - "Ward": "Ward", - "Waste": "Waste", - "Wasteland": "Wasteland", - "Well": "Well", - "Wetland": "Wetland", - "Wharf": "Wharf", - "Wilderness": "Wilderness", - "Wilds": "Wilds", - "Wildwood": "Wildwood", - "Wonderland": "Wonderland", - "Wood": "Wood", - "Woodland": "Woodland", - "Woods": "Woods", - "World": "World", - "Yard": "Yard", - "Yeet": "Yeet", - "Zone": "Zone" - }, - "RandomWorldName_Noun": { - "Ability": "Ability", - "Absurdity": "Absurdity", - "Accidents": "Accidents", - "Acne": "Acne", - "Acorns": "Acorns", - "Adamantite": "Adamantite", - "Adoration": "Adoration", - "Adulthood": "Adulthood", - "Advantage": "Advantage", - "Adventure": "Adventure", - "Agony": "Agony", - "Alarm": "Alarm", - "Alcohol": "Alcohol", - "Ale": "Ale", - "Allergies": "Allergies", - "Amazement": "Amazement", - "Angels": "Angels", - "Anger": "Anger", - "AngryGamers": "Angry Gamers", - "Bones": "Bones", - "Anguish": "Anguish", - "AnimalCarcasses": "Animal Carcasses", - "Annoyance": "Annoyance", - "Anvils": "Anvils", - "Anxiety": "Anxiety", - "Apples": "Apples", - "Apricots": "Apricots", - "Argon": "Argon", - "Arrows": "Arrows", - "Arsenic": "Arsenic", - "Arson": "Arson", - "Arthritis": "Arthritis", - "Asbestos": "Asbestos", - "Ash": "Ash", - "Assassins": "Assassins", - "Assault": "Assault", - "Atrophy": "Atrophy", - "Awareness": "Awareness", - "Awe": "Awe", - "Boomers": "Boomers", - "Bacon": "Bacon", - "BadDecisions": "Bad Decisions", - "BadJokes": "Bad Jokes", - "BadLuck": "Bad Luck", - "BadOmens": "Bad Omens", - "Balance": "Balance", - "Bamboo": "Bamboo", - "Bananas": "Bananas", - "Bandits": "Bandits", - "Bankruptcy": "Bankruptcy", - "Bark": "Bark", - "Bats": "Bats", - "Beauty": "Beauty", - "Beenades": "Beenades", - "Bees": "Bees", - "Beggars": "Beggars", - "Beheadings": "Beheadings", - "Belief": "Belief", - "Betrayers": "Betrayers", - "Birds": "Birds", - "Birthdays": "Birthdays", - "Bitterness": "Bitterness", - "Bladders": "Bladders", - "Blasphemy": "Blasphemy", - "Blindness": "Blindness", - "Blinkroot": "Blinkroot", - "Blocks": "Blocks", - "Blood": "Blood", - "Bloodletting": "Bloodletting", - "Bloodshed": "Bloodshed", - "Blossoms": "Blossoms", - "Body": "Body", - "Odor": "Odor", - "Bone": "Bone", - "Spurs": "Spurs", - "Boots": "Boots", - "Boredom": "Boredom", - "Boulders": "Boulders", - "Brains": "Brains", - "Branches": "Branches", - "Bravery": "Bravery", - "Bribery": "Bribery", - "Bridges": "Bridges", - "Brilliance": "Brilliance", - "BrokenBones": "Broken Bones", - "BrokenDreams": "Broken Dreams", - "BrokenGlass": "Broken Glass", - "Bronies": "Bronies", - "Bubbles": "Bubbles", - "Buckets": "Buckets", - "Bugs": "Bugs", - "Bums": "Bums", - "Bunnies": "Bunnies", - "Burglars": "Burglars", - "BurningHair": "Burning Hair", - "BurntFlesh": "Burnt Flesh", - "BurntOfferings": "Burnt Offerings", - "Butchery": "Butchery", - "Butterflies": "Butterflies", - "Cacti": "Cacti", - "Calmness": "Calmness", - "Candy": "Candy", - "Care": "Care", - "Carnage": "Carnage", - "Carrion": "Carrion", - "Casualty": "Casualty", - "Cats": "Cats", - "Cattails": "Cattails", - "Caves": "Caves", - "Celebration": "Celebration", - "Chainsaws": "Chainsaws", - "Chaos": "Chaos", - "Charity": "Charity", - "Cheats": "Cheats", - "Cherries": "Cherries", - "Chests": "Chests", - "Childhood": "Childhood", - "Children": "Children", - "Chlorophyte": "Chlorophyte", - "Cilantro": "Cilantro", - "Clarity": "Clarity", - "Clay": "Clay", - "Clentamination": "Clentamination", - "Cleverness": "Cleverness", - "Clouds": "Clouds", - "Cobalt": "Cobalt", - "Coconuts": "Coconuts", - "Coffee": "Coffee", - "Coins": "Coins", - "Coldness": "Coldness", - "Comfort": "Comfort", - "Compassion": "Compassion", - "Compost": "Compost", - "Confidence": "Confidence", - "Confinement": "Confinement", - "Confusion": "Confusion", - "Contentment": "Contentment", - "Convicts": "Convicts", - "Covfefe": "Covfefe", - "Copper": "Copper", - "Corpses": "Corpses", - "Corruption": "Corruption", - "Courage": "Courage", - "Creation": "Creation", - "Creatures": "Creatures", - "Creepers": "Creepers", - "Crests": "Crests", - "Crime": "Crime", - "Criminals": "Criminals", - "Crimtane": "Crimtane", - "CripplingDepression": "Crippling Depression", - "Crooks": "Crooks", - "Crows": "Crows", - "Crystals": "Crystals", - "Cthulhu": "Cthulhu", - "Curiosity": "Curiosity", - "CursedFlames": "Cursed Flames", - "Dabbing": "Dabbing", - "Daisies": "Daisies", - "DankMemes": "Dank Memes", - "Darkness": "Darkness", - "Darts": "Darts", - "Daughters": "Daughters", - "Dawn": "Dawn", - "Daybloom": "Daybloom", - "DeadBodies": "Dead Bodies", - "Deadbeats": "Deadbeats", - "Death": "Death", - "Deathweed": "Deathweed", - "Debauchery": "Debauchery", - "Debt": "Debt", - "Decapitation": "Decapitation", - "DecayingMeat": "Decaying Meat", - "Deceit": "Deceit", - "Deception": "Deception", - "Dedication": "Dedication", - "Defeat": "Defeat", - "Defecation": "Defecation", - "Degradation": "Degradation", - "Delay": "Delay", - "Delusion": "Delusion", - "Dementia": "Dementia", - "Demonite": "Demonite", - "Demilogic": "Demilogic", - "Demons": "Demons", - "Derangement": "Derangement", - "Despair": "Despair", - "Desperation": "Desperation", - "Destruction": "Destruction", - "DijonMustard": "Dijon Mustard", - "Dirt": "Dirt", - "Disappointment": "Disappointment", - "Disgust": "Disgust", - "Dishonesty": "Dishonesty", - "Dismay": "Dismay", - "Distortion": "Distortion", - "Distribution": "Distribution", - "Divorce": "Divorce", - "Doom": "Doom", - "Dragonfruit": "Dragonfruit", - "Dragons": "Dragons", - "Dread": "Dread", - "Dreams": "Dreams", - "Drills": "Drills", - "Drums": "Drums", - "Ducks": "Ducks", - "Dusk": "Dusk", - "Dust": "Dust", - "Duty": "Duty", - "Dysphoria": "Dysphoria", - "Ears": "Ears", - "Education": "Education", - "Eggs": "Eggs", - "Elderberries": "Elderberries", - "Elegance": "Elegance", - "Envy": "Envy", - "Evasion": "Evasion", - "Evil": "Evil", - "Exile": "Exile", - "Exploits": "Exploits", - "Explosives": "Explosives", - "Extortion": "Extortion", - "Eyes": "Eyes", - "Fable": "Fable", - "FaceMonsters": "Face Monsters", - "Failures": "Failures", - "Fairies": "Fairies", - "Faith": "Faith", - "FallingStars": "Falling Stars", - "FalseIdols": "False Idols", - "FalseImprisonment": "False Imprisonment", - "Falsehood": "Falsehood", - "Fame": "Fame", - "Famine": "Famine", - "Fantasy": "Fantasy", - "Fascination": "Fascination", - "Fatality": "Fatality", - "Fear": "Fear", - "Feathers": "Feathers", - "Feces": "Feces", - "Felons": "Felons", - "Ferns": "Ferns", - "Fiction": "Fiction", - "Fiends": "Fiends", - "Fingers": "Fingers", - "Fireblossom": "Fireblossom", - "Fireflies": "Fireflies", - "Fish": "Fish", - "Flails": "Flails", - "Flatulence": "Flatulence", - "Flatus": "Flatus", - "Flesh": "Flesh", - "Floof": "Floof", - "Flowers": "Flowers", - "FlyingFish": "Flying Fish", - "FoodPoisoning": "Food Poisoning", - "Forgery": "Forgery", - "Forks": "Forks", - "Fraud": "Fraud", - "Freaks": "Freaks", - "Freckles": "Freckles", - "Freedom": "Freedom", - "Friendship": "Friendship", - "Fright": "Fright", - "Frogs": "Frogs", - "Frost": "Frost", - "Fruit": "Fruit", - "Gangsters": "Gangsters", - "Garbage": "Garbage", - "GarlicBread": "Garlic Bread", - "Gears": "Gears", - "Gel": "Gel", - "Generation": "Generation", - "GenXers": "Gen-Xers", - "GenYers": "Gen-Yers", - "Ghosts": "Ghosts", - "Giggles": "Giggles", - "Gingers": "Gingers", - "Girls": "Girls", - "Glass": "Glass", - "Gloom": "Gloom", - "Gluttony": "Gluttony", - "Goals": "Goals", - "Goblins": "Goblins", - "Gold": "Gold", - "Goldfish": "Goldfish", - "Gossip": "Gossip", - "Grain": "Grain", - "Grandfathers": "Grandfathers", - "Grandmothers": "Grandmothers", - "Granite": "Granite", - "Grapefruit": "Grapefruit", - "Grapes": "Grapes", - "Grass": "Grass", - "Grasshoppers": "Grasshoppers", - "Graves": "Graves", - "Greed": "Greed", - "Grief": "Grief", - "Guitars": "Guitars", - "Guts": "Guts", - "Hair": "Hair", - "Hamburgers": "Hamburgers", - "Hammers": "Hammers", - "Hands": "Hands", - "Happiness": "Happiness", - "HappyEndings": "Happy Endings", - "Hardship": "Hardship", - "Harpies": "Harpies", - "Hate": "Hate", - "Hatred": "Hatred", - "Heart": "Heart", - "Heartache": "Heartache", - "Hearts": "Hearts", - "Heels": "Heels", - "Hellstone": "Hellstone", - "Herbs": "Herbs", - "Heresy": "Heresy", - "Homicide": "Homicide", - "Honey": "Honey", - "Hoodlums": "Hoodlums", - "Hooks": "Hooks", - "Hooligans": "Hooligans", - "Hopelessness": "Hopelessness", - "Hornets": "Hornets", - "Horns": "Horns", - "Hornswoggle": "Hornswoggle", - "Horror": "Horror", - "Horrors": "Horrors", - "Houses": "Houses", - "Humiliation": "Humiliation", - "Hurt": "Hurt", - "Hysteria": "Hysteria", - "IDidntInhale": "I Didn't Inhale", - "Ice": "Ice", - "Ichor": "Ichor", - "Illness": "Illness", - "Indictments": "Indictments", - "Indigestion": "Indigestion", - "Indignity": "Indignity", - "Infancy": "Infancy", - "Infections": "Infections", - "Inflammation": "Inflammation", - "Inflation": "Inflation", - "Injury": "Injury", - "Insanity": "Insanity", - "Insects": "Insects", - "Intelligence": "Intelligence", - "Intestines": "Intestines", - "Invasions": "Invasions", - "Iron": "Iron", - "Irritation": "Irritation", - "Isolation": "Isolation", - "Ivy": "Ivy", - "Jaws": "Jaws", - "Jealousy": "Jealousy", - "Jellyfish": "Jellyfish", - "Joy": "Joy", - "Justice": "Justice", - "Karens": "Karens", - "Kidneys": "Kidneys", - "Kindness": "Kindness", - "Kittens": "Kittens", - "Knives": "Knives", - "Krypton": "Krypton", - "Lamps": "Lamps", - "Laughter": "Laughter", - "Lava": "Lava", - "Lawsuits": "Lawsuits", - "Lawyers": "Lawyers", - "Lead": "Lead", - "Leaves": "Leaves", - "Legend": "Legend", - "Leggings": "Leggings", - "Legs": "Legs", - "Lemons": "Lemons", - "Leprosy": "Leprosy", - "Letdown": "Letdown", - "Lethargy": "Lethargy", - "Liberty": "Liberty", - "Lies": "Lies", - "Life": "Life", - "LightningBugs": "Lightning Bugs", - "Lilies": "Lilies", - "Lilith": "Lilith", - "Lilypad": "Lilypad", - "Lips": "Lips", - "Litigation": "Litigation", - "Livers": "Livers", - "Loathing": "Loathing", - "Lombago": "Lombago", - "Loneliness": "Loneliness", - "Lore": "Lore", - "Loss": "Loss", - "Love": "Love", - "Luck": "Luck", - "Luggage": "Luggage", - "Luminite": "Luminite", - "Lungs": "Lungs", - "Luxury": "Luxury", - "Madness": "Madness", - "Maggots": "Maggots", - "Mana": "Mana", - "Mangos": "Mangos", - "Mania": "Mania", - "Manslaughter": "Manslaughter", - "Marble": "Marble", - "Markets": "Markets", - "Mastication": "Mastication", - "Maturity": "Maturity", - "Medicine": "Medicine", - "Melancholy": "Melancholy", - "Memes": "Memes", - "Mercy": "Mercy", - "Merica": "Merica", - "Meteorite": "Meteorite", - "Mice": "Mice", - "Midnight": "Midnight", - "MidnightRamen": "Midnight Ramen", - "Millennials": "Millennials", - "Mimics": "Mimics", - "Mirrors": "Mirrors", - "Misery": "Misery", - "Misfortune": "Misfortune", - "MissingLimbs": "Missing Limbs", - "Models": "Models", - "Money": "Money", - "Monotony": "Monotony", - "Moonglow": "Moonglow", - "Moonlight": "Moonlight", - "Morons": "Morons", - "Mortality": "Mortality", - "Moss": "Moss", - "Mourning": "Mourning", - "Mouths": "Mouths", - "Movement": "Movement", - "Muckers": "Muckers", - "Mud": "Mud", - "Muggers": "Muggers", - "Murder": "Murder", - "Murderers": "Murderers", - "Mushrooms": "Mushrooms", - "Music": "Music", - "Mystery": "Mystery", - "Myth": "Myth", - "Mythril": "Mythril", - "Nausea": "Nausea", - "Necromancers": "Necromancers", - "Necromancy": "Necromancy", - "Night": "Night", - "Nightcrawlers": "Nightcrawlers", - "Nightmares": "Nightmares", - "NoRemorse": "No Remorse", - "Nocram": "Nocram", - "Nostalgia": "Nostalgia", - "Nudity": "Nudity", - "Obscurity": "Obscurity", - "Obsidian": "Obsidian", - "OopsieDaisy": "Oopsie Daisy", - "Ooze": "Ooze", - "OpenWounds": "Open Wounds", - "Opportunity": "Opportunity", - "Options": "Options", - "Oranges": "Oranges", - "Organs": "Organs", - "Orichalcum": "Orichalcum", - "Outlaws": "Outlaws", - "Owls": "Owls", - "PadThai": "Pad Thai", - "Pain": "Pain", - "Palladium": "Palladium", - "Panhandlers": "Panhandlers", - "Panic": "Panic", - "Parasites": "Parasites", - "Parties": "Parties", - "PartyTime": "Party Time", - "Patience": "Patience", - "Peace": "Peace", - "Penguins": "Penguins", - "Perjury": "Perjury", - "Perspiration": "Perspiration", - "Pickaxes": "Pickaxes", - "Pickpockets": "Pickpockets", - "Pineapples": "Pineapples", - "Pinky": "Pinky", - "Piranha": "Piranha", - "Piranhas": "Piranhas", - "Pirates": "Pirates", - "Pixies": "Pixies", - "Plantero": "Plantero", - "Plants": "Plants", - "Platinum": "Platinum", - "Pleasure": "Pleasure", - "Plums": "Plums", - "Politicians": "Politicians", - "Ponies": "Ponies", - "Potions": "Potions", - "Poverty": "Poverty", - "Power": "Power", - "Pride": "Pride", - "Prisms": "Prisms", - "Privacy": "Privacy", - "Prophecy": "Prophecy", - "Psychology": "Psychology", - "PublicSpeaking": "Public Speaking", - "Puppies": "Puppies", - "Rain": "Rain", - "Ramen": "Ramen", - "Rats": "Rats", - "Reality": "Reality", - "Regret": "Regret", - "Regurgitation": "Regurgitation", - "Relaxation": "Relaxation", - "Relief": "Relief", - "Remorse": "Remorse", - "Repugnance": "Repugnance", - "RichMahogany": "Rich Mahogany", - "Riches": "Riches", - "Rocks": "Rocks", - "Rope": "Rope", - "Roses": "Roses", - "RottenFruit": "Rotten Fruit", - "RottingFlesh": "Rotting Flesh", - "Rumours": "Rumours", - "Sacrifice": "Sacrifice", - "Sacrilege": "Sacrilege", - "Sadness": "Sadness", - "Salesmen": "Salesmen", - "Sand": "Sand", - "Sandstone": "Sandstone", - "Sanity": "Sanity", - "Sap": "Sap", - "Saplings": "Saplings", - "Sashimi": "Sashimi", - "Satisfaction": "Satisfaction", - "Scandal": "Scandal", - "Scorpions": "Scorpions", - "Seasons": "Seasons", - "Seaweed": "Seaweed", - "Seclusion": "Seclusion", - "Secrecy": "Secrecy", - "Secrets": "Secrets", - "Seeds": "Seeds", - "SelfControl": "Self-control", - "SelfDisgust": "Self-disgust", - "SelfLoathing": "Self-loathing", - "Services": "Services", - "SeveredHeads": "Severed Heads", - "Shade": "Shade", - "Shadows": "Shadows", - "ShatteredHope": "Shattered Hope", - "Shivers": "Shivers", - "Shiverthorn": "Shiverthorn", - "Shock": "Shock", - "Shrimp": "Shrimp", - "Silliness": "Silliness", - "Silt": "Silt", - "Silver": "Silver", - "Sin": "Sin", - "Skeletons": "Skeletons", - "Skill": "Skill", - "Skin": "Skin", - "Skulls": "Skulls", - "Sleep": "Sleep", - "Slime": "Slime", - "Sloth": "Sloth", - "Sloths": "Sloths", - "Smiles": "Smiles", - "Smoke": "Smoke", - "Snails": "Snails", - "Snatchers": "Snatchers", - "Snow": "Snow", - "Solicitation": "Solicitation", - "Sorrow": "Sorrow", - "Spaghetti": "Spaghetti", - "Sparkles": "Sparkles", - "Spears": "Spears", - "Speed": "Speed", - "SpicyRamen": "Spicy Ramen", - "Spikes": "Spikes", - "Spirits": "Spirits", - "Splinters": "Splinters", - "Sponges": "Sponges", - "Sprinkles": "Sprinkles", - "Squid": "Squid", - "Squirrels": "Squirrels", - "StagnantWater": "Stagnant Water", - "Starfruit": "Starfruit", - "Starvation": "Starvation", - "Statues": "Statues", - "Stonks": "Stonks", - "Stone": "Stone", - "Strength": "Strength", - "Strictness": "Strictness", - "Stumps": "Stumps", - "Suffering": "Suffering", - "Sunflowers": "Sunflowers", - "Superstition": "Superstition", - "Surprise": "Surprise", - "Swagger": "Swagger", - "Swindlers": "Swindlers", - "Swords": "Swords", - "Talent": "Talent", - "Taxes": "Taxes", - "TeddysBread": "Teddy's Bread", - "Teeth": "Teeth", - "Terror": "Terror", - "the Ancients": "the Ancients", - "the Angler": "the Angler", - "the Apple": "the Apple", - "the Archer": "the Archer", - "the Aunt": "the Aunt", - "the Axe": "the Axe", - "the Baby": "the Baby", - "the Ball": "the Ball", - "the Balloon": "the Balloon", - "the Bat": "the Bat", - "the Beast": "the Beast", - "the Betrayed": "the Betrayed", - "the Blender": "the Blender", - "the Blood Moon": "the Blood Moon", - "the Bow": "the Bow", - "the Bride": "the Bride", - "the Brony": "the Brony", - "the Bubble": "the Bubble", - "the Bunny": "the Bunny", - "the Cactus": "the Cactus", - "the Cloud": "the Cloud", - "the Coma": "the Coma", - "the Corruptor": "the Corruptor", - "the Crab": "the Crab", - "the Dance": "the Dance", - "the Dark": "the Dark", - "the Dead": "the Dead", - "the Devourer": "the Devourer", - "the Drax": "the Drax", - "the Ducks": "the Ducks", - "the Eclipse": "the Eclipse", - "the Fairy": "the Fairy", - "the Father": "the Father", - "the Flu": "the Flu", - "the Foot": "the Foot", - "the Frozen": "the Frozen", - "the Gift": "the Gift", - "the Ginger": "the Ginger", - "the Goblin": "the Goblin", - "the Golem": "the Golem", - "the GreatestGeneration": "the Greatest Generation", - "the Groom": "the Groom", - "the Guest": "the Guest", - "the Hammer": "the Hammer", - "the Hammush": "the Hammush", - "the Head": "the Head", - "the Heavens": "the Heavens", - "the Hipster": "the Hipster", - "the Hobo": "the Hobo", - "the Homeless": "the Homeless", - "the King": "the King", - "the Law": "the Law", - "the Library": "the Library", - "the Lihzahrd": "the Lihzahrd", - "the Lilith": "the Lilith", - "the Lizard King": "the Lizard King", - "the LostGeneration": "the Lost Generation", - "the Mirror": "the Mirror", - "the Monster": "the Monster", - "the Moon": "the Moon", - "the Mother": "the Mother", - "the Mummy": "the Mummy", - "the Mushroom": "the Mushroom", - "the Narc": "the Narc", - "the Needy": "the Needy", - "the Nude": "the Nude", - "the Old One": "the Old One", - "the Pandemic": "the Pandemic", - "the Pickaxe": "the Pickaxe", - "the Picksaw": "the Picksaw", - "the Pigron": "the Pigron", - "the Po Boy": "the Po Boy", - "the Porcelain God": "the Porcelain God", - "the Prism": "the Prism", - "the Prophecy": "the Prophecy", - "the Pwnhammer": "the Pwnhammer", - "the Queen": "the Queen", - "the Ramen": "the Ramen", - "the Right": "the Right", - "the Scholar": "the Scholar", - "the Shark": "the Shark", - "the Sickle": "the Sickle", - "the Sky": "the Sky", - "the Snap": "the Snap", - "the Snitch": "the Snitch", - "the Spelunker": "the Spelunker", - "the Staff": "the Staff", - "the Stars": "the Stars", - "the Stench": "the Stench", - "the Stooge": "the Stooge", - "the Sun": "the Sun", - "the Sword": "the Sword", - "the Tooth": "the Tooth", - "The Torch God": "The Torch God", - "the Tortoise": "the Tortoise", - "the Tree": "the Tree", - "the Trend": "the Trend", - "the Undead": "the Undead", - "the Unicorn": "the Unicorn", - "the Union": "the Union", - "the Unknown": "the Unknown", - "the Varmint": "the Varmint", - "the Waraxe": "the Waraxe", - "the Yoyo": "the Yoyo", - "TanSuits": "Tan Suits", - "Thieves": "Thieves", - "Thorns": "Thorns", - "Thunder": "Thunder", - "Tin": "Tin", - "Tingling": "Tingling", - "Tiredness": "Tiredness", - "Titanium": "Titanium", - "Tombstones": "Tombstones", - "Torches": "Torches", - "Torment": "Torment", - "TornMuscles": "Torn Muscles", - "Torture": "Torture", - "Traitors": "Traitors", - "Tramps": "Tramps", - "Tranquility": "Tranquility", - "Traps": "Traps", - "Trash": "Trash", - "Treasure": "Treasure", - "Trees": "Trees", - "Trends": "Trends", - "Trouble": "Trouble", - "Truffles": "Truffles", - "Trunks": "Trunks", - "Trust": "Trust", - "Tungsten": "Tungsten", - "Twigs": "Twigs", - "Twilight": "Twilight", - "TwistedAnkles": "Twisted Ankles", - "Umbrellas": "Umbrellas", - "UnjustPrices": "Unjust Prices", - "Upchuck": "Upchuck", - "Vagabonds": "Vagabonds", - "Vampires": "Vampires", - "Vanity": "Vanity", - "Venom": "Venom", - "Victims": "Victims", - "Victory": "Victory", - "Villains": "Villains", - "Vines": "Vines", - "Violets": "Violets", - "Vomit": "Vomit", - "Vultures": "Vultures", - "Wands": "Wands", - "Wariness": "Wariness", - "Warmth": "Warmth", - "Wasps": "Wasps", - "Waterleaf": "Waterleaf", - "Weakness": "Weakness", - "Wealth": "Wealth", - "Webs": "Webs", - "Weeds": "Weeds", - "Werewolves": "Werewolves", - "Whoopsies": "Whoopsies", - "Wings": "Wings", - "Wires": "Wires", - "Wisdom": "Wisdom", - "Woe": "Woe", - "Wood": "Wood", - "Worms": "Worms", - "Worries": "Worries", - "Wrath": "Wrath", - "Wrenches": "Wrenches", - "Wyverns": "Wyverns", - "Xenon": "Xenon", - "Yoyos": "Yoyos", - "Zombies": "Zombies", - "Zoomers": "Zoomers" - }, - - "RichPresence": { - "Spaghet": "Cooking Spaghet", - "InMainMenu": "In Main Menu", - "CreatingPlayer": "Creating a Player", - "CreatingWorld": "Generating a World", - "PlayingSingle": "Playing Single-Player", - "PlayingMulti": "Playing Multi-Player" - }, - - "AssetRejections" : { - "BadSize": "Textures loaded must match the original size, got ({ActualWidth},{ActualHeight}) but expected ({NeededWidth}, {NeededHeight}).", - "BadExtension": "Only textures of type '.png' and '.xnb' may be loaded." } } \ No newline at end of file diff --git a/Localization/Content/en-US/Game.json b/Localization/Content/en-US/Game.json index 51df27b..fa5d146 100644 --- a/Localization/Content/en-US/Game.json +++ b/Localization/Content/en-US/Game.json @@ -1,457 +1,10 @@ { - "WorldGeneration": { - "OceanSand": "Generating ocean sand" - }, - "LoadingTips_Default": { - "1": "Other players can loot your chests! If you don't trust them, use a Safe or Piggy Bank; those items have storage that is exclusive to each player.", - "2": "Info accessories don't need to be equipped to provide you and nearby friends with useful information; you can just leave them in your Inventory.", - "3": "Rope can really help you get around while exploring caves. You can even craft it into a Rope Coil which can be thrown and automatically unfolds!", - "4": "Mushroom Biomes can be grown above ground as well as below. Friendly Truffles will sometimes make themselves at home in Surface Mushroom Biomes.", - "5": "You can change your spawn point by placing and using a bed.", - "6": "If you find a Magic Mirror, you can use it to teleport back to your spawn point.", - "7": "There are Floating Islands in the sky.", - "8": "Sometimes you can find NPCs hidden around the World.", - "9": "During a Blood Moon, Zombies can open doors.", - "10": "Water will break your fall.", - "11": "Torches and Glowsticks can be a light for you in dark places when all other lights go out. Torches won't work underwater, but Glowsticks will.", - "12": "Don't fall into lava without drinking an Obsidian Skin Potion first!", - "13": "You won't take falling damage if you have a Lucky Horseshoe. Look for them on Floating Islands.", - "14": "Walking on Hellstone and Meteorite can burn you! Protect yourself by equipping an Obsidian Skull or similar accessory.", - "15": "Life Crystals are hidden around the World. Use them to increase your health.", - "16": "Torches require Wood and Gel to craft. Gel can be obtained by defeating slimes.", - "17": "Some ores require better pickaxes to mine.", - "18": "Bosses are easier to defeat with friends.", - "19": "Bows and guns require the proper ammo in your Ammo Slots.", - "20": "The Old Man at the Dungeon is a Clothier. If only someone could lift his curse...", - "21": "Merchants love money. If you save up enough, one might move in!", - "22": "Keep an explosive in your inventory or a storage container to attract a Demolitionist to your house.", - "23": "Make sure you have valid housing with empty rooms, and you may attract new inhabitants to your World.", - "24": "When exploring, it helps to keep some Platforms on hand. They can be crafted from numerous materials such as Wood, Glass, or even Bones.", - "25": "Slay a boss to attract a Dryad to your house. She can tell you the state of Corruption, Crimson, and Hallow in your World.", - "26": "Advanced players may wish to remap their buttons; you can do this from the Controls Menu in Settings.", - "27": "Wear a Mining Helmet if you don't want to use Torches.", - "28": "You can wear Buckets on your head!", - "29": "Defeat the boss in The Underworld to change the World forever. Find a Guide Voodoo Doll and hurl it into the infernal lava to summon him.", - "30": "Demon Altars and Crimson Altars can't be destroyed with a normal hammer. You have to pwn them.", - "31": "Killing Bunnies is cruel. Period.", - "32": "Falling Stars sometimes appear at night. Collect 3 of them to craft a Mana Crystal you can use to increase your Mana.", - "33": "Watch out for Meteorites!", - "34": "A pet can be your best friend.", - "35": "If you dig deep enough, you'll end up in The Underworld!", - "36": "Santa Claus is real. He comes to town after the Frost Legion is defeated (and 'tis the season).", - "37": "Don't shake a Snow Globe unless you want to summon the Frost Legion.", - "38": "You can use Hallowed Seeds, Holy Water, or Pearlstone to make Hallow spread.", - "39": "The Hallow is the only place where Corruption and Crimson cannot spread.", - "40": "The Corruption is full of chasms. Mind the gaps.", - "41": "Time heals all wounds.", - "42": "You can plant Acorns to grow new trees.", - "43": "Rocket science gave us Rocket Boots.", - "44": "The Cloud in a Bottle and Shiny Red Balloon accessories both improve your ability to jump. Combine them to make a Cloud in a Balloon.", - "45": "If you store your Coins in a Chest or Piggy Bank, you will be less likely to lose them.", - "46": "To craft potions, place a Bottle on a Table to make an Alchemy Station. Double, double, toil and trouble!", - "47": "If your house doesn't have background walls, monsters will be able to spawn inside.", - "48": "Wearing a full set of armor crafted from the same material gives you an extra bonus.", - "49": "Build a Furnace to craft metal bars out of ore.", - "50": "You can harvest Cobwebs and turn them into Silk. You can use Silk to craft beds, sofas, and more!", - "51": "You can buy Wires from the Mechanic and use them to create traps, pumping systems, or other elaborate devices.", - "52": "The Housing section of the Equipment Menu allows you to decide what rooms you want your NPCs to live in.", - "53": "If you're sick of getting knocked around, try equipping a Cobalt Shield. You can find one in the Dungeon.", - "54": "Grappling Hooks are invaluable tools for exploration. Try crafting them with Hooks or gems.", - "55": "A room in a house can have Wood Platforms as a floor or ceiling, but NPCs need at least one solid block to stand on.", - "56": "You can destroy Shadow Orbs and Crimson Hearts with a hammer or explosives, but prepare yourself for the forces they unleash.", - "57": "When dealing with a Goblin Army, crowd control is key.", - "58": "The best wizards around use Mana Flowers.", - "59": "Use \"suspicious looking items\" at your own risk!", - "60": "Sand is overpowered.", - "61": "The Goblin Tinkerer found in Underground Caverns will sell you many useful items, including a Tinkerer's Workshop.", - "62": "You can check if a room is valid housing from the Housing section of the Inventory Menu.", - "63": "Seeds can be used to grow a variety of useful ingredients for crafting potions.", - "65": "If you get lost or need to find another player, open the World Map.", - "66": "If you need to remove background walls, craft a hammer!", - "67": "Got some extra walls or platforms? You can turn them back into their original materials!", - "68": "Fishing is a fantastic source of crafting ingredients, accessories, and loot crates!", - "69": "Nothing improves your mobility like Wings. Who wouldn't want to fly?", - "70": "Riding Minecarts is one of the best ways of getting around. You can build your own tracks, or find them Underground.", - "71": "Life Crystals not enough for you? Eventually, Life Fruit will grow in the Jungle, and can give you an extra boost to your health.", - "72": "Change your clothes in game at a Dresser or talk to the Stylist for a new hairdo.", - "73": "Mounts grant the player increased mobility and a variety of useful abilities. Each one is unique!", - "74": "Looking for a challenge? Try Expert mode!", - "75": "Be careful around Martian Probes. If they scan you, they'll summon a Martian Invasion!", - "76": "During a Solar Eclipse, be on the lookout for tons of strange and creepy monsters.", - "77": "Sometimes, enemies may even invade from other dimensions . . .", - "78": "A Pumpkin Medallion can be used to summon the Pumpkin Moon. Spooky!", - "79": "Feeling up for the chill of winter? Use a Naughty Present to summon the Frost Moon!", - "80": "When a Sandstorm hits, deserts can be very dangerous. New enemies, reduced visibility, and it can even be hard to move!", - "81": "The Arms Dealer knows more about guns than anyone. If you find one, he might move in.", - "82": "The Mechanic got lost in the Dungeon. You'll have to help her out if you want her to move in.", - "83": "Once you use a Life Crystal, a Nurse might move in! Speak to her for healing at any time . . . for a price, of course.", - "84": "If you ever want to get stylish, try dyes! The Dye Trader can help you turn some materials into new dye colors.", - "85": "The Tavernkeep is a guest from a faraway land called Etheria.", - "86": "If you need a new haircut, go check out a nearby Spider Biome. Stylists always end up lost in them!", - "87": "Regular Wood and Stone not vibrant enough for you? A Painter will move in and sell paints if enough townsfolk move in.", - "88": "It's worth it to explore your Oceans. You can find treasure, dyes, and even sleeping fishermen.", - "89": "You could get a Witch Doctor to come to your World if you defeat the Queen Bee.", - "90": "The Party Girl won't move in unless your World is full of other townsfolk. Afterall, what's a party without lots of guests?", - "91": "The Wizard sells some useful magic artifacts, but he has a tendency to wander off Underground.", - "92": "The Tax Collector spends his days wandering the Underworld as a Tortured Soul. If only there were a way to purify him . . .", - "93": "Pirates are so unpredictable. First they invade your world, and then they move into your houses!", - "94": "If you ever defeat any giant robots, a Steampunker might move in to your World.", - "95": "If you like rockets, the Cyborg may have some for sale.", - "96": "The Traveling Merchant never stays in one place for long, but he always brings different wares when he visits!", - "97": "Not all Skeletons are evil. Some are even known to sell unique items to those that can find them.", - "98": "Not sure what to do next? Take a look at the Achievement Guide for a clue!", - "99": "If an enemy steals your money after you die in Expert Mode, hunt it down! If you defeat it, you can get your money back.", - "100": "With the Block Swap mechanic enabled, you can replace one block with another directly, rather than having to mine it first.", - "101": "Keep an eye out for Goodie Bags around Halloween. If you open them, you can find all sorts of spooky items. Trick or Treat!", - "102": "Clouds are nice and soft, and you won't get hurt falling on them no matter how far you fall.", - "103": "Did you know you can order your Summons to attack a specific target? While holding a Summoning Weapon, Right Click an enemy!", - "104": "Press the + and - keys to zoom in & out! Focus on what matters!", - "105": "Have something on the Map to show a friend? Double click on the Map to ping a location for everyone to see!", - "106": "The Void Bag is a magical artifact that will store items for you when your inventory is full.", - "107": "Enemies aren't the only danger when exploring Underground. Watch out for traps too!", - "108": "Find a cool new Material? Want to know what you can make? Check with your friendly neighborhood Guide!", - "109": "Have some NPCs perished? Don't worry, they'll be back in the morning.", - "110": "Explosives are dangerous!\n...and effective..." - }, - "LoadingTips_GamePad": { - "0": "You can assign your favorite items to the DPad for rapid use by enabling DPad Hotbar in Gamepad Settings!", - "1": "You can continuously use some items by holding down the {InputTrigger_UseOrAttack} button.", - "2": "Press {InputTrigger_SmartCursor} to switch between Cursor Modes.", - "3": "If your Inventory is full, you can press {InputTriggerUI_Trash} to send items to the Trash.", - "4": "When speaking to a vendor, you can sell items in your Inventory by pressing {InputTriggerUI_SellItem}.", - "5": "You can remove Torches with {InputTrigger_InteractWithTile} or with a pickaxe.", - "6": "In your Inventory, you can press {InputTrigger_QuickEquip} to equip items such as armor or accessories directly to a usable slot.", - "7": "Hold {InputTrigger_SmartSelect} to use Auto Select, a versatile feature that adapts to your environment. It will allow you to automatically hold your Torches in dark caves, Glowsticks when underwater, or even select the right tool for breaking something.", - "8": "Press {InputTriggerUI_FavoriteItem} to Favorite an item. Favorited items can no longer be sold, thrown away, or dropped. No more accidentally losing your favorite items!", - "9": "While navigating your Inventory, press {InputTriggerUI_BuildFromInventory} while highlighting a tool or block to build directly from your Inventory.", - "10": "Hold {InputTrigger_RadialQuickbar} and {InputTrigger_RadialHotbar} to bring up the Radial Quickbar and Radial Hotbar menus. These will allow you to quickly access potions, mounts, and the items in your hotbar.", - "11": "There are multiple Gamepad control layouts available in the menu. Choose from Redigit's Pick, Yoraiz0r's Pick, Xbox, Playstation, or even make your own Custom settings!", - "12": "If you select DPad Cursor Snap in the Gamepad settings, you can use the DPad for improved precision when mining or building.", - "13": "When using Gamepad, you can lock on to enemies by pressing {InputTrigger_LockOn}. Locked on targets will be marked by a spinning reticle, and long range weapons will automatically aim at your target!" - }, - "LoadingTips_Keyboard": { - "0": "You can continuously use some items by holding down the {InputTrigger_UseOrAttack} button.", - "1": "Press {InputTrigger_SmartCursor} to switch between Cursor Modes.", - "2": "If your Inventory is full, you can press {InputTriggerUI_Trash} and {InputTrigger_UseOrAttack} to send items to the Trash.", - "3": "When speaking to a vendor, you can sell items in your Inventory by pressing {InputTriggerUI_Trash} and {InputTrigger_UseOrAttack}.", - "4": "You can remove Torches with {InputTrigger_InteractWithTile} or with a pickaxe.", - "5": "In your Inventory, you can press {InputTrigger_InteractWithTile} to equip items such as armor or accessories directly to a usable slot.", - "6": "Hold {InputTrigger_SmartSelect} to use Auto Select, a versatile feature that adapts to your environment. It will allow you to automatically hold your Torches in dark caves, Glowsticks when underwater, or even select the right tool for breaking something.", - "7": "Press {InputTriggerUI_FavoriteItem} and {InputTrigger_UseOrAttack} to Favorite an item. Favorited items can no longer be sold, thrown away, or dropped. No more accidentally losing your favorite items!" - }, "ChatCommand": { "Party": "/p", "Emote": "/me", "Playing_0": "{$LegacyMultiplayer.6}", "Playing_1": "{$LegacyMultiplayer.21}", - "Roll": "{$LegacyMultiplayer.8}", - "Emoji_0": "/emoji", - "Emoji_1": "/e", - "Help": "/help", - "RPS": "/rps" - }, - "ChatCommandDescription": { - "Party": "{$ChatCommand.Party} message: Send the message to your party members", - "Emote": "{$ChatCommand.Emote} message: Send the message in third-person perspective", - "Playing": "{$ChatCommand.Playing_0}: List the names of all players on the server", - "Roll": "{$ChatCommand.Roll}: Roll a number from 1 to 100", - "Emoji": "{$ChatCommand.Emoji_1}: Show your emoji", - "Help": "{$ChatCommand.Help}: Lists all the commands you can use", - "RPS": "{$ChatCommand.RPS}: Randomly uses a Rock, Paper, or Scissors emote" - }, - "EmojiCommand": { - "EmotionLove": "/{$EmojiName.EmotionLove}", - "EmotionAnger": "/{$EmojiName.EmotionAnger}", - "EmotionCry": "/{$EmojiName.EmotionCry}", - "EmotionAlert": "/{$EmojiName.EmotionAlert}", - "WeatherRain": "/{$EmojiName.WeatherRain}", - "WeatherLightning": "/{$EmojiName.WeatherLightning}", - "WeatherRainbow": "/{$EmojiName.WeatherRainbow}", - "ItemRing": "/{$EmojiName.ItemRing}", - "DebuffPoison": "/{$EmojiName.DebuffPoison}", - "DebuffBurn": "/{$EmojiName.DebuffBurn}", - "DebuffSilence": "/{$EmojiName.DebuffSilence}", - "DebuffCurse": "/{$EmojiName.DebuffCurse}", - "CritterBee": "/{$EmojiName.CritterBee}", - "CritterSlime": "/{$EmojiName.CritterSlime}", - "MiscTree": "/{$EmojiName.MiscTree}", - "EmoteLaugh": "/{$EmojiName.EmoteLaugh}", - "EmoteFear": "/{$EmojiName.EmoteFear}", - "EmoteNote": "/{$EmojiName.EmoteNote}", - "EventBloodmoon": "/{$EmojiName.EventBloodmoon}", - "EventEclipse": "/{$EmojiName.EventEclipse}", - "EventPumpkin": "/{$EmojiName.EventPumpkin}", - "EventSnow": "/{$EmojiName.EventSnow}", - "BiomeSky": "/{$EmojiName.BiomeSky}", - "BiomeOtherworld": "/{$EmojiName.BiomeOtherworld}", - "BiomeJungle": "/{$EmojiName.BiomeJungle}", - "BiomeCrimson": "/{$EmojiName.BiomeCrimson}", - "BiomeCorruption": "/{$EmojiName.BiomeCorruption}", - "BiomeHallow": "/{$EmojiName.BiomeHallow}", - "BiomeDesert": "/{$EmojiName.BiomeDesert}", - "BiomeBeach": "/{$EmojiName.BiomeBeach}", - "BiomeRocklayer": "/{$EmojiName.BiomeRocklayer}", - "BiomeLavalayer": "/{$EmojiName.BiomeLavalayer}", - "BiomeSnow": "/{$EmojiName.BiomeSnow}", - "RPSWinScissors": "/{$EmojiName.RPSWinScissors}", - "RPSWinRock": "/{$EmojiName.RPSWinRock}", - "RPSWinPaper": "/{$EmojiName.RPSWinPaper}", - "RPSScissors": "/{$EmojiName.RPSScissors}", - "RPSRock": "/{$EmojiName.RPSRock}", - "RPSPaper": "/{$EmojiName.RPSPaper}", - "BossEoC": "/{$EmojiName.BossEoC}", - "BossEoW": "/{$EmojiName.BossEoW}", - "BossBoC": "/{$EmojiName.BossBoC}", - "BossQueenBee": "/{$EmojiName.BossQueenBee}", - "BossSkeletron": "/{$EmojiName.BossSkeletron}", - "BossWoF": "/{$EmojiName.BossWoF}", - "BossDestroyer": "/{$EmojiName.BossDestroyer}", - "BossSkeletronPrime": "/{$EmojiName.BossSkeletronPrime}", - "BossTwins": "/{$EmojiName.BossTwins}", - "BossPlantera": "/{$EmojiName.BossPlantera}", - "BossGolem": "/{$EmojiName.BossGolem}", - "BossFishron": "/{$EmojiName.BossFishron}", - "BossKingSlime": "/{$EmojiName.BossKingSlime}", - "BossCultist": "/{$EmojiName.BossCultist}", - "BossMoonmoon": "/{$EmojiName.BossMoonmoon}", - "BossMourningWood": "/{$EmojiName.BossMourningWood}", - "BossPumpking": "/{$EmojiName.BossPumpking}", - "BossEverscream": "/{$EmojiName.BossEverscream}", - "BossIceQueen": "/{$EmojiName.BossIceQueen}", - "BossSantank": "/{$EmojiName.BossSantank}", - "BossPirateship": "/{$EmojiName.BossPirateship}", - "BossMartianship": "/{$EmojiName.BossMartianship}", - "CritterZombie": "/{$EmojiName.CritterZombie}", - "CritterBunny": "/{$EmojiName.CritterBunny}", - "CritterButterfly": "/{$EmojiName.CritterButterfly}", - "CritterGoblin": "/{$EmojiName.CritterGoblin}", - "CritterPirate": "/{$EmojiName.CritterPirate}", - "CritterSnowman": "/{$EmojiName.CritterSnowman}", - "CritterSpider": "/{$EmojiName.CritterSpider}", - "CritterBird": "/{$EmojiName.CritterBird}", - "CritterMouse": "/{$EmojiName.CritterMouse}", - "CritterGoldfish": "/{$EmojiName.CritterGoldfish}", - "CritterMartian": "/{$EmojiName.CritterMartian}", - "CritterSkeleton": "/{$EmojiName.CritterSkeleton}", - "ItemLifePotion": "/{$EmojiName.ItemLifePotion}", - "ItemManaPotion": "/{$EmojiName.ItemManaPotion}", - "ItemSoup": "/{$EmojiName.ItemSoup}", - "ItemCookedFish": "/{$EmojiName.ItemCookedFish}", - "ItemAle": "/{$EmojiName.ItemAle}", - "ItemSword": "/{$EmojiName.ItemSword}", - "ItemFishingRod": "/{$EmojiName.ItemFishingRod}", - "ItemBugNet": "/{$EmojiName.ItemBugNet}", - "ItemDynamite": "/{$EmojiName.ItemDynamite}", - "ItemMinishark": "/{$EmojiName.ItemMinishark}", - "ItemCog": "/{$EmojiName.ItemCog}", - "ItemTombstone": "/{$EmojiName.ItemTombstone}", - "ItemGoldpile": "/{$EmojiName.ItemGoldpile}", - "ItemDiamondRing": "/{$EmojiName.ItemDiamondRing}", - "EmoteConfused": "/{$EmojiName.EmoteConfused}", - "EmoteKiss": "/{$EmojiName.EmoteKiss}", - "EmoteSleep": "/{$EmojiName.EmoteSleep}", - "ItemPickaxe": "/{$EmojiName.ItemPickaxe}", - "EmoteRun": "/{$EmojiName.EmoteRun}", - "EmoteKick": "/{$EmojiName.EmoteKick}", - "EmoteFight": "/{$EmojiName.EmoteFight}", - "EmoteEating": "/{$EmojiName.EmoteEating}", - "WeatherSunny": "/{$EmojiName.WeatherSunny}", - "WeatherCloudy": "/{$EmojiName.WeatherCloudy}", - "WeatherStorming": "/{$EmojiName.WeatherStorming}", - "WeatherSnowstorm": "/{$EmojiName.WeatherSnowstorm}", - "EventMeteor": "/{$EmojiName.EventMeteor}", - "MiscFire": "/{$EmojiName.MiscFire}", - "TownMerchant": "/{$EmojiName.TownMerchant}", - "TownNurse": "/{$EmojiName.TownNurse}", - "TownArmsDealer": "/{$EmojiName.TownArmsDealer}", - "TownDryad": "/{$EmojiName.TownDryad}", - "TownGuide": "/{$EmojiName.TownGuide}", - "TownOldman": "/{$EmojiName.TownOldman}", - "TownDemolitionist": "/{$EmojiName.TownDemolitionist}", - "TownClothier": "/{$EmojiName.TownClothier}", - "TownGoblinTinkerer": "/{$EmojiName.TownGoblinTinkerer}", - "TownWizard": "/{$EmojiName.TownWizard}", - "TownMechanic": "/{$EmojiName.TownMechanic}", - "TownSanta": "/{$EmojiName.TownSanta}", - "TownTruffle": "/{$EmojiName.TownTruffle}", - "TownSteampunker": "/{$EmojiName.TownSteampunker}", - "TownDyeTrader": "/{$EmojiName.TownDyeTrader}", - "TownPartyGirl": "/{$EmojiName.TownPartyGirl}", - "TownCyborg": "/{$EmojiName.TownCyborg}", - "TownPainter": "/{$EmojiName.TownPainter}", - "TownWitchDoctor": "/{$EmojiName.TownWitchDoctor}", - "TownPirate": "/{$EmojiName.TownPirate}", - "TownStylist": "/{$EmojiName.TownStylist}", - "TownTravellingMerchant": "/{$EmojiName.TownTravellingMerchant}", - "TownAngler": "/{$EmojiName.TownAngler}", - "TownSkeletonMerchant": "/{$EmojiName.TownSkeletonMerchant}", - "TownTaxCollector": "/{$EmojiName.TownTaxCollector}", - "PartyPresent": "/{$EmojiName.PartyPresent}", - "PartyBalloons": "/{$EmojiName.PartyBalloons}", - "PartyCake": "/{$EmojiName.PartyCake}", - "PartyHats": "/{$EmojiName.PartyHats}", - "TownBartender": "/{$EmojiName.TownBartender}", - "ItemBeer": "/{$EmojiName.ItemBeer}", - "ItemDefenderMedal": "/{$EmojiName.ItemDefenderMedal}", - "EventOldOnesArmy": "/{$EmojiName.EventOldOnesArmy}", - "EmoteSadness": "/{$EmojiName.EmoteSadness}", - "EmoteAnger": "/{$EmojiName.EmoteAnger}", - "EmoteHappiness": "/{$EmojiName.EmoteHappiness}", - "EmoteWink": "/{$EmojiName.EmoteWink}", - "EmoteScowl": "/{$EmojiName.EmoteScowl}", - "EmoteSilly": "/{$EmojiName.EmoteSilly}", - "TownGolfer": "/{$EmojiName.TownGolfer}", - "TownBestiaryGirl": "/{$EmojiName.TownBestiaryGirl}", - "TownBestiaryGirlFox": "/{$EmojiName.TownBestiaryGirlFox}", - "BossEmpressOfLight": "/{$EmojiName.BossEmpressOfLight}", - "BossQueenSlime": "/{$EmojiName.BossQueenSlime}" - }, - "EmojiName": { - "EmotionLove": "heart", - "EmotionAnger": "angry", - "EmotionCry": "cry", - "EmotionAlert": "alert", - "WeatherRain": "rain", - "WeatherLightning": "lightning", - "WeatherRainbow": "rainbow", - "ItemRing": "ring", - "DebuffPoison": "poison", - "DebuffBurn": "burn", - "DebuffSilence": "silent", - "DebuffCurse": "curse", - "CritterBee": "bee", - "CritterSlime": "slime", - "MiscTree": "tree", - "EmoteLaugh": "laugh", - "EmoteFear": "fear", - "EmoteNote": "music", - "EventBloodmoon": "bloodmoon", - "EventEclipse": "eclipse", - "EventPumpkin": "pumpkinmoon", - "EventSnow": "frostmoon", - "BiomeSky": "sky", - "BiomeOtherworld": "surface", - "BiomeJungle": "jungle", - "BiomeCrimson": "crimson", - "BiomeCorruption": "corruption", - "BiomeHallow": "hallow", - "BiomeDesert": "desert", - "BiomeBeach": "beach", - "BiomeRocklayer": "rockbiome", - "BiomeLavalayer": "lavabiome", - "BiomeSnow": "snow", - "RPSWinScissors": "scissorswins", - "RPSWinRock": "rockwins", - "RPSWinPaper": "paperwins", - "RPSScissors": "scissors", - "RPSRock": "rock", - "RPSPaper": "paper", - "BossEoC": "eoc", - "BossEoW": "eow", - "BossBoC": "boc", - "BossQueenBee": "queenbee", - "BossSkeletron": "skeletron", - "BossWoF": "wof", - "BossDestroyer": "destroyer", - "BossSkeletronPrime": "skeletronprime", - "BossTwins": "twins", - "BossPlantera": "plantera", - "BossGolem": "golem", - "BossFishron": "fishron", - "BossKingSlime": "kingslime", - "BossCultist": "cultist", - "BossMoonmoon": "moonlord", - "BossMourningWood": "mourningwood", - "BossPumpking": "pumpking", - "BossEverscream": "everscream", - "BossIceQueen": "icequeen", - "BossSantank": "santank", - "BossPirateship": "pirateship", - "BossMartianship": "martianship", - "CritterZombie": "zombie", - "CritterBunny": "bunny", - "CritterButterfly": "butterfly", - "CritterGoblin": "goblin", - "CritterPirate": "deadeye", - "CritterSnowman": "snowman", - "CritterSpider": "spider", - "CritterBird": "bird", - "CritterMouse": "mouse", - "CritterGoldfish": "goldfish", - "CritterMartian": "martian", - "CritterSkeleton": "skeleton", - "ItemLifePotion": "lifepotion", - "ItemManaPotion": "manapotion", - "ItemSoup": "soup", - "ItemCookedFish": "cookedfish", - "ItemAle": "ale", - "ItemSword": "sword", - "ItemFishingRod": "fishingrod", - "ItemBugNet": "bugnet", - "ItemDynamite": "dynamite", - "ItemMinishark": "minishark", - "ItemCog": "cog", - "ItemTombstone": "tombstone", - "ItemGoldpile": "goldpile", - "ItemDiamondRing": "diamondring", - "EmoteConfused": "confused", - "EmoteKiss": "kiss", - "EmoteSleep": "sleep", - "ItemPickaxe": "pickaxe", - "EmoteRun": "run", - "EmoteKick": "kicking", - "EmoteFight": "fight", - "EmoteEating": "hungry", - "WeatherSunny": "sunny", - "WeatherCloudy": "cloudy", - "WeatherStorming": "storming", - "WeatherSnowstorm": "blizzard", - "EventMeteor": "meteor", - "MiscFire": "fire", - "TownMerchant": "merchant", - "TownNurse": "nurse", - "TownArmsDealer": "armsdealer", - "TownDryad": "dryad", - "TownGuide": "guide", - "TownOldman": "oldman", - "TownDemolitionist": "demo", - "TownClothier": "clothier", - "TownGoblinTinkerer": "tinkerer", - "TownWizard": "wizard", - "TownMechanic": "mechanic", - "TownSanta": "santa", - "TownTruffle": "truffle", - "TownSteampunker": "steampunker", - "TownDyeTrader": "dyetrader", - "TownPartyGirl": "partygirl", - "TownCyborg": "cyborg", - "TownPainter": "painter", - "TownWitchDoctor": "witchdoctor", - "TownPirate": "pirate", - "TownStylist": "stylist", - "TownTravellingMerchant": "travelingmerchant", - "TownAngler": "angler", - "TownSkeletonMerchant": "skeletonmerchant", - "TownTaxCollector": "taxcollector", - "PartyPresent": "present", - "PartyBalloons": "balloon", - "PartyCake": "cake", - "PartyHats": "partyhat", - "TownBartender": "bartender", - "ItemBeer": "beer", - "ItemDefenderMedal": "defendermedal", - "EventOldOnesArmy": "oldonesarmy", - "EmoteSadness": "sad", - "EmoteAnger": "mad", - "EmoteHappiness": "happy", - "EmoteWink": "wink", - "EmoteScowl": "scowl", - "EmoteSilly": "silly", - "TownGolfer": "golfer", - "TownBestiaryGirl": "zoologist", - "TownBestiaryGirlFox": "zoologistfox", - "BossEmpressOfLight": "eol", - "BossQueenSlime": "queenslime" + "Roll": "{$LegacyMultiplayer.8}" }, "Announcement": { "HasBeenDefeated_Single": "{0} has been defeated!", @@ -521,23 +74,7 @@ "DrippingLava": "Dripping Lava", "DrippingHoney": "Dripping Honey", "SandFlow": "Sand Flow", - "BeeHive": "Bee Hive", - "DesertFossil": "Fossil", - "GeyserTrap": "Geyser", - "WireBulb": "Wire Bulb", - "FallenLog": "Fallen Log", - "GoldBirdCage": "Gold Bird Cage", - "GoldBunnyCage": "Gold Bunny Cage", - "GoldButterflyCage": "Gold Butterfly Jar", - "GoldFrogCage": "Gold Frog Cage", - "GoldGrasshopperCage": "Gold Grasshopper Cage", - "GoldMouseCage": "Gold Mouse Cage", - "GoldWormCage": "Gold Worm Cage", - "SquirrelGoldCage": "Gold Squirrel Cage", - "Toilet": "Toilet", - "TeleportationPylon": "Teleportation Pylon", - "Relic": "Relic" - + "BeeHive": "Bee Hive" }, "BuffName": { "ObsidianSkin": "Obsidian Skin", @@ -565,6 +102,7 @@ "Cursed": "Cursed", "OnFire": "On Fire!", "Tipsy": "Tipsy", + "WellFed": "Well Fed", "FairyBlue": "Fairy", "Werewolf": "Werewolf", "Clairvoyance": "Clairvoyance", @@ -597,7 +135,7 @@ "PetSapling": "Pet Sapling", "Wisp": "Wisp", "RapidHealing": "Rapid Healing", - "ShadowDodge": "Holy Protection", + "ShadowDodge": "Shadow Dodge", "LeafCrystal": "Leaf Crystal", "BabyDinosaur": "Baby Dinosaur", "IceBarrier": "Ice Barrier", @@ -742,121 +280,7 @@ "WeaponImbueIchor": "Weapon Imbue: Ichor", "WeaponImbueNanites": "Weapon Imbue: Nanites", "WeaponImbueConfetti": "Weapon Imbue: Confetti", - "WeaponImbuePoison": "Weapon Imbue: Poison", - "WellFed": "Well Fed", - "WellFed2": "Plenty Satisfied", - "WellFed3": "Exquisitely Stuffed", - "DesertMinecartRight": "{$BuffName.MinecartRight}", - "DesertMinecartLeft": "{$BuffName.MinecartLeft}", - "FishMinecartRight": "{$BuffName.MinecartRight}", - "FishMinecartLeft": "{$BuffName.MinecartLeft}", - "GolfCartMount": "Golf Cart", - "BabyBird": "Baby Finch", - "CatBast": "The Bast Defense", - "SugarGlider": "Sugar Glider", - "VampireFrog": "Vampire Frog", - "UpbeatStar": "Estee", - "BatOfLight": "Sanguine Bat", - "BeeMinecartRight": "{$BuffName.MinecartRight}", - "BeeMinecartLeft": "{$BuffName.MinecartLeft}", - "LadybugMinecartRight": "{$BuffName.MinecartRight}", - "LadybugMinecartLeft": "{$BuffName.MinecartLeft}", - "PigronMinecartRight": "{$BuffName.MinecartRight}", - "PigronMinecartLeft": "{$BuffName.MinecartLeft}", - "SunflowerMinecartRight": "{$BuffName.MinecartRight}", - "SunflowerMinecartLeft": "{$BuffName.MinecartLeft}", - "HellMinecartRight": "{$BuffName.MinecartRight}", - "HellMinecartLeft": "{$BuffName.MinecartLeft}", - "ShroomMinecartRight": "{$BuffName.MinecartRight}", - "ShroomMinecartLeft": "{$BuffName.MinecartLeft}", - "AmethystMinecartRight": "{$BuffName.MinecartRight}", - "AmethystMinecartLeft": "{$BuffName.MinecartLeft}", - "TopazMinecartRight": "{$BuffName.MinecartRight}", - "TopazMinecartLeft": "{$BuffName.MinecartLeft}", - "SapphireMinecartRight": "{$BuffName.MinecartRight}", - "SapphireMinecartLeft": "{$BuffName.MinecartLeft}", - "EmeraldMinecartRight": "{$BuffName.MinecartRight}", - "EmeraldMinecartLeft": "{$BuffName.MinecartLeft}", - "RubyMinecartRight": "{$BuffName.MinecartRight}", - "RubyMinecartLeft": "{$BuffName.MinecartLeft}", - "DiamondMinecartRight": "{$BuffName.MinecartRight}", - "DiamondMinecartLeft": "{$BuffName.MinecartLeft}", - "AmberMinecartRight": "{$BuffName.MinecartRight}", - "AmberMinecartLeft": "{$BuffName.MinecartLeft}", - "BeetleMinecartRight": "{$BuffName.MinecartRight}", - "BeetleMinecartLeft": "{$BuffName.MinecartLeft}", - "MeowmereMinecartRight": "{$BuffName.MinecartRight}", - "MeowmereMinecartLeft": "{$BuffName.MinecartLeft}", - "PartyMinecartRight": "{$BuffName.MinecartRight}", - "PartyMinecartLeft": "{$BuffName.MinecartLeft}", - "PirateMinecartRight": "{$BuffName.MinecartRight}", - "PirateMinecartLeft": "{$BuffName.MinecartLeft}", - "SteampunkMinecartRight": "{$BuffName.MinecartRight}", - "SteampunkMinecartLeft": "{$BuffName.MinecartLeft}", - "CoffinMinecartRight": "{$BuffName.MinecartRight}", - "CoffinMinecartLeft": "{$BuffName.MinecartLeft}", - "Lucky": "Lucky", - "LilHarpy": "Lil' Harpy", - "FennecFox": "Fennec Fox", - "GlitteryButterfly": "Glittery Butterfly", - "BabyImp": "Baby Imp", - "BabyRedPanda": "Baby Red Panda", - "WitchBroom": "Witch's Broom", - "SharkPup": "Shark Pup", - "StormTiger": "Desert Tiger", - "Plantero": "Plantero", - "Flamingo": "Flamingo", - "DynamiteKitten": "Dynamite Kitten", - "BabyWerewolf": "Baby Werewolf", - "ShadowMimic": "Shadow Mimic", - "VoltBunny": "Volt Bunny", - "KingSlimePet": "Slime Prince", - "EyeOfCthulhuPet": "Suspicious Eye", - "EaterOfWorldsPet": "Eater of Worms", - "BrainOfCthulhuPet": "Spider Brain", - "SkeletronPet": "Skeletron Jr.", - "QueenBeePet": "Honey Bee", - "DestroyerPet": "Destroyer-Lite", - "TwinsPet": "Rez and Spaz", - "SkeletronPrimePet": "Mini Prime", - "PlanteraPet": "Plantera Seedling", - "GolemPet": "Toy Golem", - "DukeFishronPet": "Tiny Fishron", - "LunaticCultistPet": "Phantasmal Dragon", - "MoonLordPet": "Moonling", - "FairyQueenPet": "Fairy Princess", - "PumpkingPet": "Jack 'O Lantern", - "EverscreamPet": "Everscream Sapling", - "IceQueenPet": "Ice Queen", - "MartianPet": "Alien Skater", - "DD2OgrePet": "Baby Ogre", - "DD2BetsyPet": "Itsy Betsy", - "PirateShipMount": "Pirate Ship Mount", - "SpookyWoodMount": "Tree Mount", - "SantankMount": "Santank Mount", - "WallOfFleshGoatMount": "Goat Mount", - "DarkMageBookMount": "Book Mount", - "PaintedHorseMount": "Painted Horse Mount", - "MajesticHorseMount": "Majestic Horse Mount", - "DarkHorseMount": "Dark Horse Mount", - "LavaSharkMount": "Lava Shark Mount", - "PogoStickMount": "Pogo Stick Mount", - "TitaniumStorm": "Titanium Barrier", - "QueenSlimePet": "Slime Princess", - "ThornWhipPlayerBuff": "Jungle's Fury", - "SwordWhipPlayerBuff": "Durendal's Blessing", - "ScytheWhipPlayerBuff": "Harvest Time", - "CoolWhipPlayerBuff": "A Nice Buff", - "Smolstar": "Enchanted Daggers", - "QueenSlimeMount": "Winged Slime Mount", - "GelBalloonBuff": "Sparkle Slime", - "BrainOfConfusionBuff": "Cerebral Mindtrick", - "SugarRush": "Sugar Rush", - "DiggingMoleMinecartRight": "Digging Molecart", - "DiggingMoleMinecartLeft": "Digging Molecart", - "EmpressBlade": "Terraprisma", - - + "WeaponImbuePoison": "Weapon Imbue: Poison" }, "BuffDescription": { "ObsidianSkin": "Immune to lava", @@ -884,6 +308,7 @@ "Cursed": "Cannot use any items", "OnFire": "Slowly losing life", "Tipsy": "Increased melee abilities, lowered defense", + "WellFed": "Minor improvements to all stats", "FairyBlue": "A fairy is following you", "Werewolf": "Physical abilities are increased", "Clairvoyance": "Magic powers are increased", @@ -911,7 +336,7 @@ "BabyHornet": "It thinks you are its mother", "TikiSpirit": "A friendly spirit is following you", "PetLizard": "Chillin' like a reptilian", - "PetParrot": "Polly wants the cracker", + "PetParrot": "Polly want's the cracker", "BabyTruffle": "Isn't this just soooo cute?", "PetSapling": "A little sapling is following you", "Wisp": "A wisp is following you", @@ -956,7 +381,7 @@ "Wet": "You are dripping water", "Mining": "25% increased mining speed", "Heartreach": "Increased heart pickup range", - "Calm": "Decreased enemy spawn rate", + "Calm": "Reduced enemy aggression", "Builder": "Increased placement speed and range", "Titan": "Increased knockback", "Flipper": "Move like normal in water", @@ -972,7 +397,7 @@ "MinecartRight": "Riding in a minecart", "Lovestruck": "You are in love!", "Stinky": "You smell terrible", - "Fishing": "Increased fishing power", + "Fishing": "Increased fishing level", "Sonar": "You can see what's biting your hook", "Crate": "Greater chance of fishing up a crate", "Warmth": "Reduced damage from cold sources", @@ -1061,120 +486,7 @@ "WeaponImbueIchor": "Melee attacks decrease enemies defense", "WeaponImbueNanites": "Melee attacks confuse enemies", "WeaponImbueConfetti": "Melee attacks cause confetti to appear", - "WeaponImbuePoison": "Melee attacks poison enemies", - "WellFed": "Minor improvements to all stats", - "WellFed2": "Medium improvements to all stats", - "WellFed3": "Major improvements to all stats", - "DesertMinecartRight": "{$BuffDescription.MinecartRight}", - "DesertMinecartLeft": "{$BuffDescription.MinecartLeft}", - "FishMinecartRight": "{$BuffDescription.MinecartRight}", - "FishMinecartLeft": "{$BuffDescription.MinecartLeft}", - "BabyBird": "The baby finch will fight for you", - "CatBast": "Defense is increased by 5", - "SugarGlider": "A sugar glider is following you", - "VampireFrog": "The vampire frog will fight for you", - "UpbeatStar": "Estee is following you", - "BatOfLight": "The sanguine bat will fight for you", - "BeeMinecartRight": "{$BuffDescription.MinecartRight}", - "BeeMinecartLeft": "{$BuffDescription.MinecartLeft}", - "LadybugMinecartRight": "{$BuffDescription.MinecartRight}", - "LadybugMinecartLeft": "{$BuffDescription.MinecartLeft}", - "PigronMinecartRight": "{$BuffDescription.MinecartRight}", - "PigronMinecartLeft": "{$BuffDescription.MinecartLeft}", - "SunflowerMinecartRight": "{$BuffDescription.MinecartRight}", - "SunflowerMinecartLeft": "{$BuffDescription.MinecartLeft}", - "HellMinecartRight": "{$BuffDescription.MinecartRight}", - "HellMinecartLeft": "{$BuffDescription.MinecartLeft}", - "ShroomMinecartRight": "{$BuffDescription.MinecartRight}", - "ShroomMinecartLeft": "{$BuffDescription.MinecartLeft}", - "AmethystMinecartRight": "{$BuffDescription.MinecartRight}", - "AmethystMinecartLeft": "{$BuffDescription.MinecartLeft}", - "TopazMinecartRight": "{$BuffDescription.MinecartRight}", - "TopazMinecartLeft": "{$BuffDescription.MinecartLeft}", - "SapphireMinecartRight": "{$BuffDescription.MinecartRight}", - "SapphireMinecartLeft": "{$BuffDescription.MinecartLeft}", - "EmeraldMinecartRight": "{$BuffDescription.MinecartRight}", - "EmeraldMinecartLeft": "{$BuffDescription.MinecartLeft}", - "RubyMinecartRight": "{$BuffDescription.MinecartRight}", - "RubyMinecartLeft": "{$BuffDescription.MinecartLeft}", - "DiamondMinecartRight": "{$BuffDescription.MinecartRight}", - "DiamondMinecartLeft": "{$BuffDescription.MinecartLeft}", - "AmberMinecartRight": "{$BuffDescription.MinecartRight}", - "AmberMinecartLeft": "{$BuffDescription.MinecartLeft}", - "BeetleMinecartRight": "{$BuffDescription.MinecartRight}", - "BeetleMinecartLeft": "{$BuffDescription.MinecartLeft}", - "MeowmereMinecartRight": "{$BuffDescription.MinecartRight}", - "MeowmereMinecartLeft": "{$BuffDescription.MinecartLeft}", - "PartyMinecartRight": "{$BuffDescription.MinecartRight}", - "PartyMinecartLeft": "{$BuffDescription.MinecartLeft}", - "PirateMinecartRight": "{$BuffDescription.MinecartRight}", - "PirateMinecartLeft": "{$BuffDescription.MinecartLeft}", - "SteampunkMinecartRight": "{$BuffDescription.MinecartRight}", - "SteampunkMinecartLeft": "{$BuffDescription.MinecartLeft}", - "CoffinMinecartRight": "{$BuffDescription.MinecartRight}", - "CoffinMinecartLeft": "{$BuffDescription.MinecartLeft}", - "Lucky": "You are feeling pretty lucky", - "LilHarpy": "Cuteness from above", - "FennecFox": "What does the fox say? Better yet, what does the fox HEAR?!", - "GlitteryButterfly": "Truly, truly outrageous", - "BabyImp": "Just wait till his terrible twos!", - "BabyRedPanda": "A baby red panda is following you", - "WitchBroom": "It flies! WITCHCRAFT!", - "SharkPup": "Doo doo doo doo doo doo", - "GolfCartMount": "A fair way to cross the fairway", - "Plantero": "Little Plantero is following you", - "Flamingo": "Flamingogogo", - "DynamiteKitten": "Not for use in cannons", - "BabyWerewolf": "A baby werewolf is following you", - "ShadowMimic": "A shadow mimic is following you", - "VoltBunny": "A volt bunny is ecstatic about you", - "KingSlimePet": "He answers to a higher authority", - "EyeOfCthulhuPet": "Just keepin' an eye out . . .", - "EaterOfWorldsPet": "May ruin several backyards", - "BrainOfCthulhuPet": "It's crawling around . . . icky", - "SkeletronPet": "Skeletron Jr. Is following you", - "QueenBeePet": "A honey bee is following you", - "DestroyerPet": "For destruction on the go", - "TwinsPet": "You have special eyes!", - "SkeletronPrimePet": "Each tool can commit murder", - "PlanteraPet": "What exactly does it eat, anyway?", - "GolemPet": "Got myself a crying, talking, sleeping, walking, living idol!", - "DukeFishronPet": "A sea-green marquess of the abyss", - "LunaticCultistPet": "It keeps looking at the Moon", - "MoonLordPet": "A friend from beyond", - "FairyQueenPet": "The light of the fair folk illuminates all", - "PumpkingPet": "A small Jack 'O Lantern is fiendishly lighting the way", - "EverscreamPet": "Taking the tree for a walk!", - "IceQueenPet": "Ice Queen has been reborn as your companion", - "MartianPet": "How do you do, fellow humans?", - "DD2OgrePet": "He's got a big stick and he doesn't know how to use it", - "DD2BetsyPet": "Itsy Betsy is following you", - "PirateShipMount": "You're the captain now", - "SpookyWoodMount": "Run, forest, run!", - "SantankMount": "Crossing off the naughty list . . .", - "WallOfFleshGoatMount": "This ride is totally metal!", - "DarkMageBookMount": "The Book is now helping in your guidance", - "PaintedHorseMount": "Riding a Painted Horse", - "MajesticHorseMount": "Riding a Majestic Horse", - "DarkHorseMount": "Riding a Dark Horse", - "LavaSharkMount": "Surfing the molten seas!", - "PogoStickMount": "Kss-shik! Kss-shik! Kss-shik!", - "TitaniumStorm": "Defensive shards surround you", - "QueenSlimePet": "She is the higher authority", - "ThornWhipPlayerBuff": "Melee speed is increased", - "SwordWhipPlayerBuff": "Melee speed is increased", - "ScytheWhipPlayerBuff": "Melee speed is increased", - "CoolWhipPlayerBuff": "Summons a snowflake to fight for you", - "Smolstar": "Death by a thousand cuts", - "QueenSlimeMount": "BOING FLAP BOING!", - "GelBalloonBuff": "You are slimy and sparkly", - "BrainOfConfusionBuff": "Increased critical chance", - "SugarRush": "20% increased movement and mining speed", - "DiggingMoleMinecartRight": "The Molecart will dig for you", - "DiggingMoleMinecartLeft": "The Molecart will dig for you", - "StormTiger": "The desert tiger will fight beside you", - "EmpressBlade": "The Blades of the Empress will fight for you", - + "WeaponImbuePoison": "Melee attacks poison enemies" }, "ArmorSetBonus": { "SquireTier3": "Increases your max number of sentries\nGreatly enhances Ballista effectiveness", @@ -1194,9 +506,9 @@ "AdamantiteCaster": "19% reduced mana usage", "AdamantiteMelee": "18% increased melee and movement speed", "AdamantiteRanged": "25% chance to not consume ammo", - "TitaniumCaster": "19% reduced mana usage", - "TitaniumMelee": "18% increased melee and movement speed", - "TitaniumRanged": "25% chance to not consume ammo", + "HallowCaster": "20% reduced mana usage", + "HallowMelee": "19% increased melee and movement speed", + "HallowRanged": "25% chance to not consume ammo", "ShadowScale": "15% increased movement speed", "Wood": "1 defense", "Crimson": "Greatly increased life regen", @@ -1204,12 +516,10 @@ "Tiki": "Increases your max number of minions", "Palladium": "Greatly increases life regeneration after striking an enemy", "Orichalcum": "Flower petals will fall on your target for extra damage", - "Titanium": "Attacking generates a defensive barrier of titanium shards", - "Hallowed": "Become immune after striking an enemy", + "Titanium": "Become immune after striking an enemy", "Chlorophyte": "Summons a powerful leaf crystal to shoot at nearby enemies", - "ChlorophyteMelee": "Summons a powerful leaf crystal to shoot at nearby enemies\nReduces damage taken by 5%", "Wizard": "10% increased magic critical strike chance", - "Turtle": "Attackers also take double damage\nReduces damage taken by 15%", + "Turtle": "Attackers also take full damage", "Meteor": "Space Gun costs 0 mana", "SpectreHealing": "Magic damage done to enemies heals the player with lowest health", "Shroomite": "Not moving puts you in stealth,\nincreasing ranged ability and reducing chance for enemies to target you", @@ -1221,899 +531,19 @@ "BeetleDefense": "Beetles protect you from damage", "BeetleDamage": "Beetles increase your melee damage and speed", "Bee": "Increases minion damage by 10%", + "Bone": "20% chance to not consume ammo", "Spider": "Increases minion damage by 12%", - "Solar": "Solar shields charge over time to protect you & let you dash\nA charge is used to damage enemies you touch\nConsumed charges explode & damage enemies", + "Ninja": "33% chance to not consume thrown item", + "Fossil": "50% chance to not consume thrown item", + "Solar": "Solar shields generate over time protecting you,\nconsume the shield power to dash, damaging enemies", "Vortex": "Double tap {0} to toggle stealth,\nincreasing ranged ability and reducing chance for enemies to target you but slowing movement speed", - "Nebula": "Magic damage has a chance to spawn buff boosters,\npick boosters up to get stacking buffs", - "Stardust": "A stardust guardian will protect you from nearby enemies", + "Nebula": "Hurting enemies has a chance to spawn buff boosters,\npick boosters up to get stacking buffs", + "Stardust": "Double tap {0} to direct your guardian to a location", "Forbidden": "Double tap {0} to call an ancient storm to the cursor location", "Jungle": "16% reduced mana usage", "Molten": "17% extra melee damage", "Mining": "30% increased mining speed", "CobaltCaster": "14% reduced mana usage", - "CobaltMelee": "15% increased melee speed", - "Bone": "15% increased ranged critical strike chance", - "Ninja": "20% increased movement speed", - "Fossil": "20% chance to not consume ammo", - "HallowedSummoner": "Become immune after striking an enemy,\nand increases your max number of minions by 2", - "CrystalNinja": "10% increased damage and crit chance,\n15% increased movement speed", - }, - "Bestiary_Biomes": { - "Surface": "Surface", - "Graveyard": "Graveyard", - "UndergroundJungle": "Underground Jungle", - "TheUnderworld": "The Underworld", - "TheDungeon": "The Dungeon", - "TheCorruption": "The Corruption", - "Underground": "Underground", - "TheHallow": "The Hallow", - "UndergroundMushroom": "Underground Mushroom", - "StardustPillar": "Stardust Pillar", - "Jungle": "The Jungle", - "Caverns": "Caverns", - "UndergroundSnow": "Underground Snow", - "Ocean": "Ocean", - "SurfaceMushroom": "Surface Mushroom", - "UndergroundDesert": "Underground Desert", - "Snow": "Snow", - "Desert": "Desert", - "Meteor": "Meteor", - "Oasis": "Oasis", - "SpiderNest": "Spider Nest", - "Crimson": "The Crimson", - "SolarPillar": "Solar Pillar", - "VortexPillar": "Vortex Pillar", - "TheTemple": "The Temple", - "UndergroundCorruption": "Underground Corruption", - "Hallow": "The Hallow", - "NebulaPillar": "Nebula Pillar", - "CorruptUndergroundDesert": "Corrupt Cave Desert", - "CrimsonUndergroundDesert": "Crimson Cave Desert", - "HallowUndergroundDesert": "Hallow Cave Desert", - "CorruptDesert": "Corrupt Desert", - "HallowDesert": "Hallow Desert", - "Granite": "Granite", - "UndergroundCrimson": "Underground Crimson", - "UndergroundHallow": "Underground Hallow", - "Marble": "Marble", - "CorruptIce": "Corrupt Ice", - "HallowIce": "Hallow Ice", - "CrimsonIce": "Crimson Ice", - "Sky": "Sky", - "CrimsonDesert": "Crimson Desert", - }, - "Bestiary_Invasions": { - "Goblins": "Goblin Invasion", - "Pirates": "Pirate Invasion", - "Martian": "Martian Madness", - "OldOnesArmy": "Old One's Army", - "PumpkinMoon": "Pumpkin Moon", - "FrostMoon": "Frost Moon", - "FrostLegion": "Frost Legion" - }, - "Bestiary_Times": { - "DayTime": "Daytime", - "NightTime": "Nighttime", - }, - "Bestiary_Events": { - "SlimeRain": "Slime Rain", - "WindyDay": "Windy Day", - "BloodMoon": "Blood Moon", - "Halloween": "Halloween", - "Rain": "Rain", - "Christmas": "Christmas", - "Eclipse": "Eclipse", - "Party": "Party", - "Blizzard": "Blizzard", - "Sandstorm": "Sandstorm" - }, - "BestiaryInfo": { - "Rarity_1": "Is Uncommon", - "Rarity_2": "Is Rare", - "IsBoss": "Boss Enemy", - "UnlockCondition_Hallow": "Reach Hardmode", - "IsRare": "Rare Creature", - "Filters": "Filters ({Count})", - "KnockbackNone": "None", - "KnockbackLow": "Low", - "KnockbackMedium": "Med", - "KnockbackHigh": "High", - "Attack": "Attack", - "Defense": "Defense", - "Knockback": "Knockback Taken", - "Life": "Life", - "IfUnlocked": "If Unlocked", - "IfSearched": "If Searched", - "Sort_Unlocks": "Unlocks", - "Sort_ID": "ID", - "Sort_BestiaryID": "Bestiary ID", - "Sort_Rarity": "Rarity", - "Sort_Alphabetical": "Name", - "Sort_Attack": "Attack", - "Sort_Defense": "Defense", - "Sort_Coins": "Coins", - "Sort_HitPoints": "HP", - "PercentCollected": "{Percent} Collected", - }, - "Bestiary_ItemDropConditions": { - "PirateMap": "Drops in the Hardmode Ocean", - "IsChristmas": "Drops during Christmas", - "NotExpert": "", - "NotMasterMode": "", - "PlayerNeedsHealing": "Drops when the player is hurt", - "LegacyHack_IsBossAndExpert": "Drops in Expert Mode", - "LegacyHack_IsBossAndNotExpert": "", - "IsExpert": "This is an Expert Mode drop rate", - "IsMasterMode": "This is a Master Mode drop rate", - "IsCrimson": "Drops in the Crimson", - "IsCorruption": "Drops in the Corruption", - "IsCrimsonAndNotExpert": "", - "IsCorruptionAndNotExpert": "", - "HalloweenWeapons": "Drops during Halloween season", - "SoulOfNight": "Drops in Underground Crimson or Corruption", - "SoulOfLight": "Drops in Underground Hallow", - "NotFromStatue": "", - "HalloweenGoodieBagDrop": "Drops in early gameplay during Halloween", - "XmasPresentDrop": "Drops in early gameplay during Christmas", - "LivingFlames": "Drops in Hardmode Underworld", - "NamedNPC": "Drops from uniquely named NPCs", - "HallowKeyCondition": "Drops in the Hardmode Hallow", - "JungleKeyCondition": "Drops in the Hardmode Jungle", - "CorruptKeyCondition": "Drops in the Hardmode Corruption", - "CrimsonKeyCondition": "Drops in the Hardmode Crimson", - "FrozenKeyCondition": "Drops in the Hardmode Snow", - "DesertKeyCondition": "Drops in the Hardmode Desert", - "BeatAnyMechBoss": "Drops after defeating any Mech Boss", - "YoyoCascade": "Drops after defeating Skeletron but before Hardmode", - "YoyosAmarok": "Drops in Hardmode", - "YoyosYelets": "Drops after defeating any Mech Boss", - "YoyosKraken": "Drops after defeating Plantera", - "YoyosHelFire": "Drops in Hardmode", - "KOCannon": "Drops during a Hardmode Bloodmoon", - "IsItAHappyWindyDay": "Drops on Windy Days", - "EmpressOfLightOnlyTookDamageWhileEnraged": "Drops if the Empress of Light is only attacked during daytime" - }, - "Bestiary_BiomeText": { - "biome_Goblins": "A ragtag army of crude, barbaric goblins set out to conquer and destroy. Some wield dark, evil magic.", - "biome_Pirates": "A seafaring horde of armed bandits that lust after the riches of the land, collecting treasures and taking no prisoners.", - "biome_Martian": "Technologically advanced beings from another world who want to eradicate all primitive life with their superior weaponry.", - "biome_OldOnesArmy": "Minions from Etheria - they may have mistakenly invaded this world, but they wish to rule it nonetheless!", - "biome_PumpkinMoon": "A bitter harvest rises in the dead of night. Creatures of evil and darkness spook the lands, killing everything in their path.", - "biome_FrostMoon": "Ho Ho Ho! On this not-so-silent night, festive beings wish to shower the world with gifts of blood and carnage. ", - "biome_FrostLegion": "This organized family of cold-hearted killers wish to ice any who cross them, and they don't like snitches... capisce?", - "biome_SlimeRain": "For reasons beyond any meteorological explanation, slimy things are raining down from above by the buckets!", - "biome_WindyDay": "Don't get carried away! Nature is throwing a party and wishes to sweep everybody - and everything - off their feet!", - "biome_BloodMoon": "When the moon rises drenched in blood, the dead rise with it! These macabre creatures seek to add fresh meat to their dripping ranks.", - "biome_Halloween": "Pumpkins grow wildly across the land, and certain creatures masquerade in unusual costumes. Trick or treat!", - "biome_Rain": "When it rains, it pours. Creatures which normally thrive in water may roam the land and sky. Beware the angered clouds.", - "biome_Christmas": "Winter is here! Time to celebrate with twinkling lights, ugly sweaters, and a fat old fellow wearing a bright red suit.", - "biome_Eclipse": "Familiar creatures of horror rapidly grip the lands this day, for no mere mortal can resist the evil of the blackened sun. ", - "biome_Party": "This day, for no particular reason, everyone decided to throw a party. There's always time for a celebration!", - "biome_Blizzard": "The most vile, stone-cold entities emerge in the blinding chaos of bone-piercing icy wind and snow. Every step is cold and dangerous.", - "biome_Sandstorm": "The sands of the desert rage like a stormy sea, with deadly creatures swimming among them.", - "biome_Surface": "Anywhere where one can see the trees, the mountains, and the sky. Not all creatures are powerful or even hostile.", - "biome_Graveyard": "When areas of death become littered with graves, a thick mist of concentrated eeriness blankets the land.", - "biome_UndergroundJungle": "The tangled world beneath the muddy jungle proves perilous to any adventurer. Within, be on guard for voracious plants and bugs.", - "biome_TheUnderworld": "A doomed haven of fire and brimstone - run rampant with demons and devils - offers no sanctuary for the living.", - "biome_TheDungeon": "Constructed long ago as a once thriving city, this dark and evil place now serves as the home for its cursed former inhabitants.", - "biome_TheCorruption": "A cancerous Corruption thriving off the sins of the living. Its sole desire is to consume all things, leaving behind only a lifeless void.", - "biome_Underground": "Just below the surface, there's no shortage of dirt. Basic ore, mundane treasure, and weak monsters live down there.", - "biome_TheHallow": "A divine and overzealous force, 'The Hallow', serves as a cure to combat evil with its majestic, powerful creatures of light.", - "biome_UndergroundMushroom": "A curious deviation of nature, large mushrooms grow densely from glowing blue grass. Tough 'mycanoids' defend the area.", - "biome_StardustPillar": "A blue lunar seal protected by powerful guardians. This one representing a glittering celestial remnant known as 'stardust'.", - "biome_Jungle": "Thick trees, brambled vines, and relentless beasts of nature inhabit this dense canopy of lush growth, sprouted from seemingly limitless mud.", - "biome_Caverns": "Tough monsters, abandoned cabins, and golden treasure adorn the dark, vacant caverns tunneled beneath the underground.", - "biome_UndergroundSnow": "Tunnels carved throughout frigid ice result in slippery pitfalls and freezing pools - all patrolled by the sub-zero denizens of the deep.", - "biome_Ocean": "An endless ocean stretched to the horizon awaits at the world's edge, filled with infinitely hungry creatures from the watery depths.", - "biome_SurfaceMushroom": "Surface mushroom patches must be cultivated by hand, but doing so may draw attention from strong mycanoids.", - "biome_UndergroundDesert": "Beneath the sandy surface lies weathered, hard sandstone. Massive nests of deadly insects and more infest these ancient burrows.", - "biome_Snow": "A persistent arctic jet stream left a part of the world permanently cold. Only the hardiest of beasts can survive this harsh region.", - "biome_Desert": "Endless dunes of sand reside here, scorched by the never-ending sun. Few things have adapted to survive in this environment.", - "biome_Meteor": "The fragments left behind from plummeting meteorites burn endlessly with astrological energy, some of which appears to be alive.", - "biome_Oasis": "This is no mirage! The clandestine pools of water glittering in the desert sun are the only source of life in these desolate sands.", - "biome_SpiderNest": "In this deadly place, there lurk arachnids with many legs, many eyes, and a thirst for blood. They sow thick webs threaded with malice.", - "biome_Crimson": "A hive mind of grotesque, biological infections which aim to consume all life whilst feeling absolutely nothing.", - "biome_SolarPillar": "A red lunar seal protected by powerful guardians. This one representing a flaming celestial event known as 'solar flares'.", - "biome_VortexPillar": "A green lunar seal protected by powerful guardians. This one representing a deep celestial void known as 'vortex'.", - "biome_TheTemple": "Stone-crafted with an ancient mineral alloy, this indomitable temple houses the Lihzahrd; a crude, yet advanced reptilian race.", - "biome_UndergroundCorruption": "With the ancient spirits of light and dark released, the Corruption's reach drastically increased and its minions greatly empowered.", - "biome_NebulaPillar": "A purple lunar seal protected by powerful guardians. This one representing a stormy celestial body known as 'nebula'.", - "biome_CorruptUndergroundDesert": "The Corruption's hold in the sandstone weakened the seals that held an assortment of ancient magicked beings at bay.", - "biome_CrimsonUndergroundDesert": "The Crimson's bloody veins broke up the tombs that once held magicked beings, which are now released to commit mayhem.", - "biome_HallowUndergroundDesert": "The blessing swept through the ancient sands, awakening dangerous creatures once forgotten to time.", - "biome_CorruptDesert": "When the Corruption grows through the desert, vile things long since buried in the sand awaken with pure malice.", - "biome_HallowDesert": "As the Hallow responds to the encroaching evils, it inadvertently awakens things that have slept beneath the sands for centuries.", - "biome_CrimsonDesert": "With the Crimson seeping through the sands, dark things long forgotten rise again to seek out and destroy life.", - "biome_Granite": "A glistening, dark material adorns the caverns here. Granite paves the way for progress in architectural fashion and durable monsters.", - "biome_UndergroundCrimson": "With the ancient spirit of darkness released, the Crimson's veiny growth reaches new depths, and its macabre fiends gain strength.", - "biome_UndergroundHallow": "With the evils now unleashed into the depths of the world, the Hallow fights back with powerful minions of light.", - "biome_Marble": "A smooth material wrought with pleasing veins of color coat the walls of this cavern. An ancient civilization of monsters dwell here.", - "biome_CorruptIce": "Cold ice infused with even colder Corruption results in bitterly-frozen terrors lurking beneath the treacherous icy caverns.", - "biome_HallowIce": "Ice serves as a catalyst for the blessing, the Hallow's luminous source of power. Strong entities take advantage of this light.", - "biome_CrimsonIce": "These bitterly cold caverns of ice, saturated with the blood of Crimson, host a new variety of menacing frozen fiends.", - "biome_Sky": "It is rumored that there is a land far above the clouds, where ancient treasures are guarded by powerful winged creatures.", - "biome_DayTime": "After 4:30am, the sun rises in the sky and the most dangerous of beings flee from the light. It's a great time to explore!", - "biome_NightTime": "After 7:30pm, the moon rises in the sky. All manner of evil things, living and dead, roam the lands in the dark.", - - }, - "CommonBestiaryFlavor": { - "Slime": "A simple, gelatinous creature that swallows anything and everything whole! It takes a long time to digest anything.", - "DemonEye": "That suspicious feeling of being watched may very well come true in the dark of night, when Cthulhu's minions roam the skies.", - "Hornet": "Aggressive flying insects which swarm the jungle depths. Their venomous barbs discharge over great distances at high velocity.", - "Zombie": "Leaving doors open may be an invitation for shambling brain-eaters to enter the home, and nobody likes that.", - "Skeleton": "Who needs muscles, skin, or even eyeballs? Skeletons get by with just the bones on their back, just as deadly as more fleshy foes.", - "GoldCritter": "Rarely, critters are found coated entirely in gold! Shopkeepers will pay handsomely for these, or you can show them off in cages!", - "GoldBaitCritter": "Rarely, critters are found coated entirely in gold! They are worth great coin to shopkeepers and fish absolutely love golden bait!", - "Jellyfish": "That strange tingling sensation in the water may be the unwelcome surging of electrical death from a brainless jellyfish. Swim with care.", - "Pigron": "This elusive dragon-pig hybrid has excellent stealth capabilities despite its rotund figure. It is uncertain how they came to exist.", - "Dragonfly": "A swift-flying insect which hunts mosquitoes. Comes in a variety of colors. Fish are somewhat attracted to these.", - "Mimic": "Talking to a chest doesn't cause craziness, but if the chest answers back, it may cause death! It still contains rare treasure, regardless!", - "Penguin": "Penguins make their home in the coldest regions of the world, waddling around looking for tasty fish.", - "LavaBat": "What's worse than a rabid, fast-flying, and annoying flying rodent? One that is on fire, of course!", - "AngryBones": "Cursed with undeath, the former inhabitants of the Dungeon roam endlessly through its halls, seeking a victim for their unending fury.", - "RustyArmoredBones": "Through use and neglect, the Rusted Company's weapons are jagged and rough, inflicting terrible bleeding wounds upon their foes.", - "BlueArmoredBones": "Disciplined and relentless, the Marching Bones unceasingly pursue their goals, sundering anything, or anyone, in their way.", - "HellArmoredBones": "The fiery glow of the Molten Legion is unmistakable. With their red-hot armaments in hand, they blaze a trail through all those in their way.", - "RaggedCaster": "With their cursed magic, the members of the Ragged Brotherhood leave their victims helplessly lost in utter darkness.", - "Necromancer": "In life, these sorcerers bore the Necromantic Sign of their order, and they shall continue to do so forever . . . even in death.", - "Diabolist": "The undead who bear the Diabolic Sigil wield flames as intense as any in the underworld, consuming all in a scorching inferno.", - "MushroomZombie": "The fungus controlling the minds of these zombies wants only one thing: brains! This is very convenient for the zombie.", - "CostumeDemonEye": "No one knows who dressed these demon eyes up in cute costumes, but the whole process hasn't made them any friendlier.", - "CostumeZombie": "Wearing costumes isn't fooling anyone; these zombies are clearly way too old to be trick or treating.", - "CostumeSkeleton": "Skeletons need to wear very elaborate costumes during Halloween, or else people think they are dressing up as skeletons.", - "ZombieXmas": "Even zombies can celebrate the holidays. Their festive outfits are just right, but their holiday spirit could use some work.", - "RibbonSlime": "A perfectly gift wrapped bundle of slime. A wonderfully deadly present for any festive occasion.", - "ZombieElf": "Elves that used to work for Santa, but have since been zombified. They don't complain much, so they are still pretty good helpers.", - "AntlionCharger": "The soldiers of the antlion species, Antlion Chargers ferociously chase after intruders with a surprising speed.", - "AntlionSwarmer": "Antlion Swarmers patrol their nests with a watchful eye. Should anyone threaten their eggs, they will defend them fiercely.", - "Scarecrow": "Possessed by vengeful spirits of the harvest, these scarecrows are out to cause mischief and mayhem galore.", - "FungiBulb": "When the glowing fungus is ready to spread, these bulbs will sprout to spread its spores to other locations and hosts.", - "Mummy": "With the sands transmogrified by outside forces, those put to rest in the desert, whether good or evil, now rise to maim and kill.", - "Sandshark": "In ancient times, a saltwater river once ran through the desert. These powerful creatures evolved to survive in the now dry sand.", - "Lamia": "By the time glowing red eyes appear in the darkness of the desert caves, it is already too late. The lamias have found their prey.", - "GemSquirrel": "Glistening squirrels who strayed too deep become ensorcelled with residual cursed energy retained in gemstones.", - "GemBunny": "These colorful rabbits made their way so deep, their reaction to magicked gems resulted in a coveted sparkling appearance.", - - }, - "Bestiary_FlavorText": { - "npc_BabySlime": "Clinging tightly to their parents and rarely seen, these miniature slimes will swarm anyone who harms their mother. ", - "npc_MotherSlime": "Critical to the lifecycle of the slime species, these oversized jiggling masses are often found carrying their young deep underground.", - "npc_JungleSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_YellowSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_RedSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_PurpleSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_BlackSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_Pinky": "The smallest slime ever recorded, their extreme cellular density makes them incredibly durable for their small size. They eat money.", - "npc_GreenSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_Slimeling": "The still-animate severed pieces of an injured Corrupt Slime, Slimelings can still put up a fight, and have strength in numbers.", - "npc_BlueSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_DemonEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_Zombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_TorchZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_EyeofCthulhu": "A piece of Cthulhu ripped from his body centuries ago in a bloody war. It wanders the night seeking its host body... and revenge!", - "npc_ServantofCthulhu": "Young Demon Eyes newly birthed from the Eye of Cthulhu, brought forth to protect their master by any means necessary.", - "npc_EaterofSouls": "Birthed from the Corruption as a being of pure malice, its sole instincts are to pursue, punish, and kill.", - "npc_DevourerHead": "Worm-like monstrosities are the Corruption's most favored creatures, tunneling underneath unsuspecting victims.", - "npc_GiantWormHead": "These itty bitty diggy dawgs dig through the earth and take focused spelunkers by surprise, causing unwanted distress.", - "npc_EaterofWorldsHead": "Conceived from the bottomless malice of the Corruption, this mighty abyssal worm tunnels wildly to devour all in its path.", - "npc_Merchant": "The Merchant acts as a simple general store of sorts, providing useful starter tools and supplies needed for exploration.", - "npc_Nurse": "The Nurse's snarky attitude and poor bedside manner may be scary, but for a price, she will cure all that ails a wounded Terrarian.", - "npc_ArmsDealer": "The Arms Dealer has everything anyone could need to shoot things dead, from little round bullets to guns made from sharks.", - "npc_Dryad": "The Dryad is the last of her kind. She is connected with nature and can analyze its purity worldwide. She sells seeds, too!", - "npc_Skeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_SkeletonArcher": "{$CommonBestiaryFlavor.Skeleton}", - "npc_ArmoredSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_Guide": "The Guide always offers useful advice and crafting recipes. His origins and unusual connections to this world remain a mystery.", - "npc_MeteorHead": "When meteorites strike the surface, their fragments lay scattered for the taking. Some pieces are alive, and will attack.", - "npc_FireImp": "A lesser demon imbued with hell magic. Capable of teleporting and hurling phantom fireballs towards their foes.", - "npc_GoblinPeon": "Common footsoldiers of the Goblin Army, these foul creatures are good for little more than cannon fodder... and breaking down doors.", - "npc_GoblinThief": "Quick strike units of the Goblin Army, these pesky foes specialize in nimble movement and close-quarters combat.", - "npc_GoblinWarrior": "The backbone of the Goblin Army infantry, these heavily-armored soldiers can take tremendous damage as they march undeterred.", - "npc_GoblinSorcerer": "As primitive as they are, some goblins have the potential for manipulating magicked shadow energy through a form of hexing.", - "npc_AngryBones": "{$CommonBestiaryFlavor.AngryBones}", - "npc_DarkCaster": "Doomed to watch over the Dungeon, these mages teleport to confuse their prey, before striking them down with a blast of water.", - "npc_CursedSkull": "Exposed to dark rituals, this skull has begun floating around on its own, chasing the living. Its touch leaves its victims defenseless.", - "npc_SkeletronHead": "The disembodied bones of a former tyrant pulsed with a hatred so strong, it left behind a mighty curse which guards the Dungeon.", - "npc_OldMan": "This hapless Old Man carries the burden of a heavy curse. It's said at night he transforms into a horrific demon which guards the Dungeon.", - "npc_Demolitionist": "Tread carefully around this dwarf. The Demolitionist is an explosive fanatic and sells dangerous things that go 'Boom!'", - "npc_BoneSerpentHead": "Mighty serpentine dragons once ruled hell, but long ago shed their obsidian scales. A skeletal husk is all that remains.", - "npc_Hornet": "{$CommonBestiaryFlavor.Hornet}", - "npc_ManEater": "A sharp-toothed plant with a taste for human flesh. It has the ability to hide inside the mud and reach over great distances.", - "npc_UndeadMiner": "There's evidence of spelunkers having explored the caverns in the past... as well as evidence of them having died doing so.", - "npc_Tim": "An enchanter in life, this funny fellow won't give up his robe or wizard hat without a fight. He prefers warmer caverns.", - "npc_Bunny": "Fuzzy wuzzy creatures that prefer safe, friendly locations.", - "npc_CorruptBunny": "Bunnies are pure beings that normally resist all forms of Corruption, but will succumb under the effects of a Blood Moon.", - "npc_Harpy": "Winged, demi-human women defend their territory against invaders by impaling them with their razor-sharp feathers.", - "npc_CaveBat": "They are small, hard to see, and swiftly flap about in unpredictable ways. They often carry diseases, such as rabies.", - "npc_KingSlime": "Slimes normally aren't intelligent, but occasionally they merge together to become a powerful force to swallow all things.", - "npc_JungleBat": "These small, annoying creatures aren't to be underestimated. A deadly end awaits for those swarmed by these fangy rodents.", - "npc_DoctorBones": "This particular zombie has a knack for finding historical artifacts, but has a terrible disdain towards snakes.", - "npc_TheGroom": "Tall, handsome, and dead. This unlucky fellow did not survive his wedding and is ready to take it out on everyone.", - "npc_Clothier": "Once trapped under a curse, the Clothier is the master of thread. If it's fashion that's desired, he's the man! He talks in a familiar way.", - "npc_Goldfish": "A seemingly ordinary goldfish, until it decides to rain.", - "npc_Snatcher": "A sharp-toothed plant with a taste for human flesh. It has the ability to hide inside the mud and reach over great distances.", - "npc_CorruptGoldfish": "Goldfish mutate and become violent when exposed to a Blood Moon, allowing the Corruption to take hold of them.", - "npc_Piranha": "Just one of these sharp-toothed fish can easily end a life. Luckily, they tend to swarm their victims in large groups! Life is grand.", - "npc_LavaSlime": "Due to the heat of the underworld, these slimes have taken on the properties of lava. Slaying them is difficult and dangerous.", - "npc_Hellbat": "{$CommonBestiaryFlavor.LavaBat}", - "npc_Vulture": "Built to survive the desert heat, avian scavengers such as these will peck apart those who come near their carrion.", - "npc_Demon": "Demons are the infantry of the underworld. Unlike their lesser brothers, they cast shadow magic rather than hell magic.", - "npc_BlueJellyfish": "{$CommonBestiaryFlavor.Jellyfish}", - "npc_PinkJellyfish": "{$CommonBestiaryFlavor.Jellyfish}", - "npc_Shark": "Once these ocean predators catch a whiff of blood, they become relentless and unstoppable in their ravenous pursuit.", - "npc_VoodooDemon": "Higher ranking demons can possess a voodoo doll of the chosen one, whose soul is linked with the world's guardian himself.", - "npc_Crab": "This hard shelled coastal creature could snip the toes right off a man, among other things. They are not to be trifled with.", - "npc_DungeonGuardian": "A lethal sentry that stands watch over the Dungeon's gates. Those who are deemed unworthy to enter shall not pass!", - "npc_Antlion": "When antlions are nesting, they hide in the surface. To defend their eggs, they projectile vomit hard globs of sand at trespassers.", - "npc_DungeonSlime": "Slimes in the Dungeon became powerful by feeding off the cursed energy throughout the place. They seem particularly attracted to keys.", - "npc_GoblinScout": "The Goblin Army sends lone soldiers out from the beaches to seek out colonies to conquer. They give warning with a tattered sigil.", - "npc_Bird": "A simple white bird which enjoys a calm sunny day.", - "npc_Pixie": "A larger, more luminous form of fairy. Pixies provide the Hallow with more blessed light and aid in the cleansing of the land.", - "npc_ArmoredSkeleton": "Remnants of a long lost expeditionary force, these stout warriors mindlessly patrol the caves in which they died.", - "npc_Mummy": "{$CommonBestiaryFlavor.Mummy}", - "npc_DarkMummy": "{$CommonBestiaryFlavor.Mummy}", - "npc_LightMummy": "{$CommonBestiaryFlavor.Mummy}", - "npc_CorruptSlime": "Steeped in the power of Corruption, these slimes can survive being cut apart into smaller pieces, unlike their untainted brethren.", - "npc_Wraith": "Souls belonging to the darkest of hearts were once sealed in the world's core. Now, they roam the night to add to their kind.", - "npc_CursedHammer": "Magicked through the pure hatred of the Corruption, this weapon flails about attempting to smash anything that breathes.", - "npc_EnchantedSword": "Animated by the blessed light of the crystals, it will slice through anything to cleanse the world's evils.", - "npc_Mimic": "{$CommonBestiaryFlavor.Mimic}", - "npc_Unicorn": "These majestic single-horned equines storm angrily through the hallowed land in search of lowly intrusions needing to be cleansed away.", - "npc_WyvernHead": "A colossal dragon-like creature unleashed along with the ancient spirits. It rules the skies with its unrivaled might.", - "npc_GiantBat": "The oversized cousins of Cave Bats, these bats are more dangerous and can confuse their enemies with their bite.", - "npc_Corruptor": "Like a cancer, the putrid creatures born from the Corruption mutate and grow into bigger, more deadly forms which discharge acids.", - "npc_DiggerHead": "Exposure to the effects of ancient magicks flowing throughout the cracks of the world causes unusual rapid growths in giant worms.", - "npc_SeekerHead": "Ancient magicks have unleashed the dark influences that gave birth to the Eater of Worlds, producing smaller, but just as deadly worms.", - "npc_Clinger": "In the depths of the darkest corruption lies cursed-fire belching, betentacled nightmares stretching from the very walls themselves.", - "npc_AnglerFish": "Some angler fish are content to lie in wait for their prey, but these are perfectly happy to aggressively chase down an underwater meal.", - "npc_GreenJellyfish": "{$CommonBestiaryFlavor.Jellyfish}", - "npc_Werewolf": "Cursed by the moonlight, these menacing lupines were once human. Now, they feast on their loved ones instinctively.", - "npc_GoblinTinkerer": "Exiled from the rest of goblinkind for being an intelligent pacifist, the Tinkerer sells tools for combining accessories into stronger versions.", - "npc_Wizard": "The Wizard is an absent-minded, demented old man who dabbles in the arcane arts. He sells magical trinkets to train new apprentices.", - "npc_Clown": "His origins unknown, this creepy fiend balances himself on a ball while hurling explosive destruction at everything around him.", - "npc_SkeletonArcher": "Skeleton Archers have a keen eye, despite the general lack of eyes. Distance offers little protection from their blazing arrows.", - "npc_GoblinArcher": "Lending ranged support to the Goblin Army, archers keep a distance and pick off distracted and overwhelmed foes.", - "npc_WallofFlesh": "Serving as the world's core and guardian, the towering demon lord exists to keep powerful ancient spirits sealed away.", - "npc_TheHungry": "The Wall of Flesh's many mouths, attached by bloody veins. As a last resort, they can tear away and hungrily chase down threats.", - "npc_TheHungryII": "The Wall of Flesh's many mouths, attached by bloody veins. As a last resort, they can tear away and hungrily chase down threats.", - "npc_LeechHead": "A worm-like parasite spit forth from the Wall of Flesh, filled with the lifeblood of its host. This blood has healing properties.", - "npc_ChaosElemental": "Once living beings infused by the blessing, they erratically make chase with an uncontrollable surge of luminous power.", - "npc_Slimer": "The Slimer has become airborne with wings of unknown origin. The wings are easily knocked off with force, depriving it of its flight.", - "npc_Gastropod": "Touched by the blessing, these nocturnal slimes evolved into a levitating snail-like creature which spits powerful beams of light.", - "npc_Mechanic": "The Mechanic was imprisoned for her aptitude in engineering. She sells wiring and tools for putting together anything imaginable.", - "npc_Retinazer": "Belonging to a pair of mechanically recreated Eyes of Cthulhu, this one focuses its energy into firing powerful lasers.", - "npc_Spazmatism": "Belonging to a pair of mechanically recreated Eyes of Cthulhu, this one chases at high speed, exhaling cursed flames.", - "npc_SkeletronPrime": "Mechanically reconstructed for reviving Cthulhu, this Skeletron has more arms than ever before, and a variety of fierce weapons.", - "npc_BaldZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_WanderingEye": "Given time to mature, Demon Eyes will continue to grow in size and danger. These ones are old enough that their teeth have come in.", - "npc_TheDestroyer": "A mechanical simulacrum of Cthulhu's spine decorated in laser-armed probes, which detach from its body when damaged.", - "npc_IlluminantBat": "Blessed with the prismatic light of the Hallow, the Illuminant Bats are a vibrant pink blur arcing across the darkness of the Underground.", - "npc_IlluminantSlime": "Slimes exposed to the light of the Hallow's crystals begin to emit that very same light, glowing brightly in the darkness.", - "npc_Probe": "A singular probe detached from the Destroyer's body serves as a remote laser battery, often in a swarm of other probes.", - "npc_PossessedArmor": "Whatever possessed this suit of armor to suddenly walk about and start killing everyone? It lacks a corporeal body.", - "npc_ToxicSludge": "Distantly related to the common slime, the Toxic Sludge takes down its prey with potent toxins and a disarmingly toothy smile.", - "npc_SantaClaus": "Only present during a specific time of year, Santa Claus makes a big entrance and an even bigger, rather explosive exit. Ho! Ho! Ho!", - "npc_SnowmanGangsta": "While the world's inhabitants celebrate festivities, gangster snowmen party by slaying everyone with their tommy guns.", - "npc_MisterStabby": "This stone-cold, yet maniacal gangster never snuffs the celebrating do-gooders without bringing along his 'Lil' Pokey'.", - "npc_SnowBalla": "Nobody underestimates the throwing arm on this disturbed member of the snowman mafioso. He's a real slugger!", - "npc_IceSlime": "Slimes that spent too long in arctic temperatures may begin to partially freeze, developing a shifting layer of ice on their surface.", - "npc_Penguin": "{$CommonBestiaryFlavor.Penguin}", - "npc_PenguinBlack": "{$CommonBestiaryFlavor.Penguin}", - "npc_IceBat": "As if bats weren't enough of a nuisance already, Ice Bats can freeze flesh solid with a touch, leaving their prey defenseless.", - "npc_Lavabat": "{$CommonBestiaryFlavor.LavaBat}", - "npc_GiantFlyingFox": "An oversized cousin of the bat found only in the Jungle, giant flying foxes hunt the night skies looking for prey.", - "npc_GiantTortoise": "No one takes the giant tortoises seriously. Not until they come hurtling through the air, a spinning, spiky ball of death.", - "npc_IceTortoise": "Like their jungle cousins, ice tortoises are an unexpectedly serious threat, possessing surprising speed and mobility. ", - "npc_Wolf": "Living in the harshest of climates, these savage lupines hunt in the dark of night desperately for sustenance.", - "npc_RedDevil": "Conjuring potent spears of dark magic, these elite demons are a serious threat to any who dare enter their abode.", - "npc_Arapaima": "These enormous fish thrive in the jungle waters near veins of unstable magicks, which make them unusually strong and hostile.", - "npc_Vampire": "Whether he is a man who turns into a bat, or a bat who turns into a man, one thing is for sure: he's out for blood!", - "npc_Truffle": "Harnessing the hidden power of the glowing mushroom, the Truffle forges weapons and tools exclusively in his mushroom home.", - "npc_ZombieEskimo": "Zombies found in snow biomes are often found bundled up in winter clothing. It doesn't help them any, they are still dead cold!", - "npc_Frankenstein": "Built from parts of deceased Terrarians, this stout monster resulted from a crazy man's desire to create life with his own hands.", - "npc_WallCreeperWall": "They have eight legs, eight eyes, and eight ways to cocoon and feast upon an unsuspecting victim.", - "npc_SwampThing": "Creeping from the depths of the darkest swamps, this algae-dripped beast desires to drown away anyone in his path.", - "npc_UndeadViking": "Long before there were pirates, stories tell of powerful vikings who raged the seas. Their remains roam the icy caverns below.", - "npc_CorruptPenguin": "During a Blood Moon, the normally docile penguins fall under the hostile influence of the Corruption.", - "npc_IceElemental": "Water elementals become icy when dense strong magicks accumulate in the coldest places. Their frosty shards freeze all.", - "npc_PigronCorruption": "{$CommonBestiaryFlavor.Pigron}", - "npc_PigronHallow": "{$CommonBestiaryFlavor.Pigron}", - "npc_RuneWizard": "Tim's more powerful and much better-looking older brother. He, too, prefers the heat, but not excessively.", - "npc_Crimera": "The most common horror to be born from the Crimson, it seeks to consume pure things with unrelenting hunger.", - "npc_Herpling": "These hyper, demented, slug-like fiends serve the crimson horde with an unstoppable appetite for blood and flesh.", - "npc_AngryTrapper": "When a Man Eater consumes enough human flesh, it undergoes a cocoon-like metamorphosis into a far deadlier form.", - "npc_MossHornet": "The empowered flora of the Jungle has merged with these species of Hornet, strengthening their exoskeletons and stingers.", - "npc_Derpling": "These large, sapphire-shelled fleas leap around incessantly. They can drain the blood content of one man within seconds.", - "npc_Steampunker": "The Steampunker has a particular taste for steam-fueled machinery and gadgets. She sells her gizmos with an endearing accent.", - "npc_CrimsonAxe": "Ensorcelled by the Crimson collective, this weapon moves about and chops its enemies by its own will.", - "npc_PigronCrimson": "{$CommonBestiaryFlavor.Pigron}", - "npc_FaceMonster": "It would be unwise to face off with one of these unfeeling, hungry mutations. Their mouths are large enough to devour all things.", - "npc_FloatyGross": "These buoyant terrors of the darkest crimson depths most definitely, without question, are both floaty and gross.", - "npc_Crimslime": "Taking on the consistency of congealed blood and flesh, Crimslimes seek out and digest more raw material for the Crimson.", - "npc_SpikedIceSlime": "This Ice Slime has large ice shards in its mass from excessive exposure to the cold. Somehow, it is able to launch these at its prey.", - "npc_SnowFlinx": "A strange, round furry mammal with an unusually large, protruding nose. They are extremely lightweight.", - "npc_PincushionZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_SlimedZombie": "Sometimes, a slime's victim will turn into a zombie mid-digestion. Walking around like that is quite awkward for both parties.", - "npc_SwampZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_TwiggyZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_CataractEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_SleepyEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_DialatedEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_GreenEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_PurpleEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_WanderingEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_LostGirl": "Naked and afraid, this girl stands still, deep in the world, as if waiting for someone to rescue her and lead her to the surface.", - "npc_Nymph": "Masterfully deceives explorers by posing as a lost girl, then attacks with ferocious might, blood-lust in her eyes.", - "npc_ArmoredViking": "The most elite vikings were worthy of the strongest armor. It seems that it wasn't terribly effective, given their state now.", - "npc_Lihzahrd": "A reclusive race of reptilian folk found exclusively in the mysterious jungle Temple. They look primitive, but are quite advanced.", - "npc_FemaleZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_HeadacheSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_MisassembledSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_PantlessSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_SpikedJungleSlime": "Frequent consumption of the Jungle's toxins and thorns has resulted in a slime covered in venomous spikes.", - "npc_Moth": "Rarely, exposure to jungle toxins causes certain moths to mutate to enormous size. They release a valuable dust on death.", - "npc_IcyMerman": "Mermen rarely stray far from the ocean. Those that do can become lost, wander into cold caverns, and become icy undead fish men.", - "npc_DyeTrader": "Eccentric and rather snobby to a fault, the Dye Trader has expensive tastes. He is passionate about the materials used in the dyes he sells.", - "npc_PartyGirl": "Positive beyond comprehension, the Party Girl will use any excuse to celebrate. She sells party favors and flashy things.", - "npc_Cyborg": "The Cyborg was built with the combined efforts of the Mechanic and the Steampunker to aid in rocket science and world defense.", - "npc_Bee": "Found in hives and nests all throughout the jungle, these tiny pests will swarm an adventurer at every turn.", - "npc_BeeSmall": "Found in hives and nests all throughout the jungle, these tiny pests will swarm an adventurer at every turn.", - "npc_PirateDeckhand": "They are either washing the deck of their ship of seaweed and ale, or wiping the dirt with the faces of unsuspecting Terrarians.", - "npc_PirateCorsair": "Once mercenaries from a distant land, Corsairs brandish deadly scimitars with unyielding skill and a cut-throat agenda.", - "npc_PirateDeadeye": "Nobody knows if 'Dead Eye' refers to their precise aim, or the fact that one of their eyes is indeed 'dead'... like their targets.", - "npc_PirateCrossbower": "Some wee lasses aren't content staying at port waiting for their men to return from a raid, so they join in on the deadly fun!", - "npc_PirateCaptain": "A pirate captain's love for riches is only rivaled by his obsession with heavy gunpowder and large, rampart-shattering cannons!", - "npc_CochinealBeetle": "Found in deep, dark caverns, these large beetles are sought out for the deep, blood-red secretions stored in their scaly exoskeleton.", - "npc_CyanBeetle": "Hardy to extremely cold temperatures, these beetles contain a desired bluish fluid which can be used to dye textiles.", - "npc_LacBeetle": "These scaly insects thrive in thick subterranean foliage. Their secretions stain many materials in a beautiful violet color.", - "npc_SeaSnail": "This unusually large snail makes its home deep in the ocean. Its mucous can be manufactured into a purple dye.", - "npc_Squid": "A betentacled marine creature which discharges a thick, black ink when threatened. The ink is collected for aesthetic purposes.", - "npc_QueenBee": "This highly aggressive monstrosity responds violently when her larva is disturbed; the honey-laden hives are her home turf.", - "npc_ZombieRaincoat": "Some zombies never leave home without their trusty raincoat. Comfy and dry, they pursue human flesh no matter the weather.", - "npc_FlyingFish": "Certain species of fish gain the most peculiar abilities when it rains. They only like one thing about land-dwellers: their flesh.", - "npc_UmbrellaSlime": "The previous owner of this umbrella learned the hard way: umbrellas are good protection against rain, but not against slime.", - "npc_FlyingSnake": "Kept as pets and guardians by the Lihzahrd race, the flying snakes will attack any who trespass on the Temple's protected grounds.", - "npc_Painter": "The Painter can talk about all the different shades of colors with which one can paint the walls. He'll sell but a handful of them!", - "npc_WitchDoctor": "It's unusual for a Lihzahrd to be outside the Temple. Even more unusual are the voodoo things he sells. He prefers his jungle digs.", - "npc_Pirate": "Ahoy! The only good Pirate Captain is... one that sells cannons and weapons to take out all competing Pirate Captains!", - "npc_HornetFatty": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetHoney": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetLeafy": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetSpikey": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetStingy": "{$CommonBestiaryFlavor.Hornet}", - "npc_JungleCreeperWall": "The itsy bitsy spider climbed up a jungle vine, down came a hapless explorer and the spider got to dine. The End.", - "npc_BlackRecluseWall": "They have eight legs, eight eyes, and eight ways to cocoon and feast upon an unsuspecting victim.", - "npc_BloodCrawlerWall": "Most spiders operate independently, but ones touched by the Crimson hive coordinate together to consume life.", - "npc_BloodFeeder": "Like the piranha, these swarming fish thirst for blood. Birthed from tainted blood themselves, their hunger is truly intense.", - "npc_BloodJelly": "Jellyfish swimming in the bloody waters of the Crimson become infected, converting them to its all-consuming cause.", - "npc_IceGolem": "Sub-zero temperatures, blinding snow flurries, and being blasted apart by an icy construct are some of the dangers of blizzards.", - "npc_RainbowSlime": "These blessing-infused gelatin menaces glow vibrantly in a rainbow of hues. As a result, they require a constant liquid intake.", - "npc_Golem": "A remarkable display of ingenuity constructed by the Lihzahrd clan. Powered by solar energy cells, it is ready to guard the Temple.", - "npc_AngryNimbus": "When severe storms roll through, it is said that the skies are angry. This cloud in particular is especially livid!", - "npc_Eyezor": "A powerful zombie-like creature whose eye can see for miles, and blow away opponents with powerful lasers.", - "npc_Parrot": "A pirate's best friend, the parrot, will tear the eyes out of any greasy landlubber with its sharp, pointy talons.", - "npc_Reaper": "The reaper's list stretches endlessly with the names of those who will soon depart this world. His sickle will make sure of that.", - "npc_ZombieMushroom": "{$CommonBestiaryFlavor.MushroomZombie}", - "npc_ZombieMushroomHat": "{$CommonBestiaryFlavor.MushroomZombie}", - "npc_FungoFish": "Some fish exposed to glowing mushroom spores become a curious mushroom-jellyfish hybrid, glowing softly in the watery depths.", - "npc_AnomuraFungus": "These crab-like creatures scuttle about in glowing mushroom fields, heavily infested by the fungal spores. ", - "npc_MushiLadybug": "This aggressive species of ladybug is quite at home near glowing mushrooms, living symbiotically with the fungus.", - "npc_FungiBulb": "{$CommonBestiaryFlavor.FungiBulb}", - "npc_GiantFungiBulb": "{$CommonBestiaryFlavor.FungiBulb}", - "npc_Plantera": "A dormant, yet powerful floral guardian awoken by the fallout of Cthulhu's destroyed machinations. Its reach spans the entire jungle.", - "npc_BrainofCthulhu": "A piece of Cthulhu torn asunder, this vile mastermind pulses with agony and aids the Crimson to an attempt to avenge its master.", - "npc_Creeper": "Manipulated through the hive mind of the Crimson, Creepers serve as the brain's eyes and orbit around it for defense in numbers.", - "npc_IchorSticker": "Filled to the brim with powerful ichor, these squid-like abominations spew their corrosive bio-fluid at their prey.", - "npc_RustyArmoredBonesAxe": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_RustyArmoredBonesFlail": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_RustyArmoredBonesSword": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_RustyArmoredBonesSwordNoArmor": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_BlueArmoredBones": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_BlueArmoredBonesMace": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_BlueArmoredBonesNoPants": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_BlueArmoredBonesSword": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_HellArmoredBones": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_HellArmoredBonesSpikeShield": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_HellArmoredBonesMace": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_HellArmoredBonesSword": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_RaggedCaster": "{$CommonBestiaryFlavor.RaggedCaster}", - "npc_RaggedCasterOpenCoat": "{$CommonBestiaryFlavor.RaggedCaster}", - "npc_Necromancer": "{$CommonBestiaryFlavor.Necromancer}", - "npc_NecromancerArmored": "{$CommonBestiaryFlavor.Necromancer}", - "npc_DiabolistRed": "{$CommonBestiaryFlavor.Diabolist}", - "npc_DiabolistWhite": "{$CommonBestiaryFlavor.Diabolist}", - "npc_BoneLee": "It's said that centuries ago, there was once a clan of ninjas that hid in the shadows of the world. It seems they are long dead now.", - "npc_DungeonSpirit": "Sometimes, highly concentrated ectoplasm gathers inside the more powerful of the cursed inhabitants of the Dungeon.", - "npc_GiantCursedSkull": "No one knows where these giant skulls came from, but like their smaller cousins, they seek out and curse the living with their magic.", - "npc_Paladin": "In distant history, these mighty undead knights once guarded a prosperous city before a massive curse befell them.", - "npc_SkeletonSniper": "These eagle-eyed sharpshooters let nothing escape their crosshairs. Part of an elite military unit in their past lives.", - "npc_TacticalSkeleton": "With thick armor and mighty boomsticks, it's clear these bones are prepared for a siege. Part of an elite military unit in their past lives.", - "npc_SkeletonCommando": "Rocket-powered and fueled with rage, these cursed skeletons prefer the nuclear option. Part of an elite military unit in their past lives.", - "npc_AngryBonesBig": "{$CommonBestiaryFlavor.AngryBones}", - "npc_AngryBonesBigMuscle": "{$CommonBestiaryFlavor.AngryBones}", - "npc_AngryBonesBigHelmet": "{$CommonBestiaryFlavor.AngryBones}", - "npc_BirdBlue": "This little blue bird came looking for worms.", - "npc_BirdRed": "A rare, red-crested friend of the forest.", - "npc_Squirrel": "Fast moving and erratic woodland creatures with greyish-brown fur. Got nuts? ", - "npc_Mouse": "Mice squeak around harmlessly, looking for small insects in damp underground locations.", - "npc_Raven": "Nevermore. Nevermore. Nevermore. Nevermore. Nevermore. Nevermore. Nevermore. Nevermore.", - "npc_SlimeMasked": "Is it a slime in a bunny costume? Or is it a bunny in a slime costume? Halloween can be very confusing sometimes.", - "npc_BunnySlimed": "Is it a bunny in a slime costume? Or is it a slime in a bunny costume? Halloween can be very confusing sometimes.", - "npc_HoppinJack": "This particular pumpkin seeks revenge for being carved. His hearty leaps become quicker the more he is carved into.", - "npc_Scarecrow1": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow2": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow3": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow4": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow5": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow6": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow7": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow8": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow9": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow10": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_HeadlessHorseman": "This menacing nightmare rides out into the night to harvest living souls on his seeing-eye horse, for he has no head of his own.", - "npc_Ghost": "During the most harrowing times, these apparitions float aimlessly through the depths to steal the life from those they envy.", - "npc_DemonEyeOwl": "{$CommonBestiaryFlavor.CostumeDemonEye}", - "npc_DemonEyeSpaceship": "{$CommonBestiaryFlavor.CostumeDemonEye}", - "npc_ZombieDoctor": "{$CommonBestiaryFlavor.CostumeZombie}", - "npc_ZombieSuperman": "{$CommonBestiaryFlavor.CostumeZombie}", - "npc_ZombiePixie": "{$CommonBestiaryFlavor.CostumeZombie}", - "npc_SkeletonTopHat": "{$CommonBestiaryFlavor.CostumeSkeleton}", - "npc_SkeletonAstonaut": "{$CommonBestiaryFlavor.CostumeSkeleton}", - "npc_SkeletonAlien": "{$CommonBestiaryFlavor.CostumeSkeleton}", - "npc_MourningWood": "These enormous murder trees nightmarishly stomp about, prepared to shower endless fiery destruction upon all life.", - "npc_Splinterling": "Mourning Woods reproduce by snapping cuttings from their bodies and thrusting them into the soil. Splinterlings are the result.", - "npc_Pumpking": "A pumpkin has many faces. A pumpkin will murder all with many sharp blades. A pumpkin is king of the harvest.", - "npc_Hellhound": "Most certainly not a good boy, this vicious demon dog is more than eager to guide living beings to the underworld with every bite.", - "npc_Poltergeist": "The intense hateful energies emanating from these spirits grant them the ability to move objects, truly for the purpose of killing.", - "npc_ZombieXmas": "{$CommonBestiaryFlavor.ZombieXmas}", - "npc_ZombieSweater": "{$CommonBestiaryFlavor.ZombieXmas}", - "npc_SlimeRibbonWhite": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_SlimeRibbonYellow": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_SlimeRibbonGreen": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_SlimeRibbonRed": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_BunnyXmas": "Judging by the outfit, Santa appears to have recruited some bunnies to be his little helpers this year.", - "npc_ZombieElf": "{$CommonBestiaryFlavor.ZombieElf}", - "npc_ZombieElfBeard": "{$CommonBestiaryFlavor.ZombieElf}", - "npc_ZombieElfGirl": "{$CommonBestiaryFlavor.ZombieElf}", - "npc_PresentMimic": "Surprise! The most unexpected gift this holiday season, the Present Mimic is a nicely gift-wrapped box of teeth and death.", - "npc_GingerbreadMan": "A gingerbread man seeking vengeance for his long-eaten brethren. He may look yummy, but this is one tough cookie.", - "npc_Yeti": "An ill-tempered ape from cold, snowy regions to the north. They do not appreciate festivity, so they've come to spoil all the fun.", - "npc_Everscream": "If trees could scream, this evil evergreen would do so constantly. Deadly are the ornaments hurled from its branches.", - "npc_IceQueen": "If this icy towering monstrosity wishes for someone's soul, they'll surely let it go... right from their cold, dead hands.", - "npc_SantaNK1": "This jolly bad boy wants to stuff everyone's stockings with the gift of their entrails. This cranky Kringle's gone postal.", - "npc_ElfCopter": "The elves aren't just flying toy helicopters, these are fully combat ready. All that inventing finally paid off! ", - "npc_NutcrackerSpinning": "Bringing his massive chompers to bear, the Nutcracker frolics through the wintery night. Nuts aren't the only thing he can crack.", - "npc_ElfArcher": "These aren't your typical elven archers. Tinkering all year long, they are excited to gift you with the hottest new arrows this season.", - "npc_Krampus": "Every year, Krampus is tasked to punish all of the naughty children, but he's taken the day off to participate in this mayhem instead!", - "npc_Flocko": "These ferocious flakes are the frozen minions of the Ice Queen. Where this sinister snow falls, so shall her icy judgment.", - "npc_Stylist": "The Stylist loves style, gossip, and hair. Aside from performing a miracle makeover, she sells some hair product as well.", - "npc_Firefly": "Appears at night in calm locations, illuminating the sky with strobing green light. Fish are fairly attracted to these.", - "npc_Butterfly": "Beautiful fluttering insects that love sunrises. Fish are attracted to these based on their color variety.", - "npc_Worm": "A slick, tubular invertebrate found hiding in rocks, dirt, and grass. Loves the rain. Fish are especially attracted to these.", - "npc_LightningBug": "Appears at night in blessed locations, filling the sky with flashing cyan light. Fish are especially attracted to these.", - "npc_Snail": "A slimy mollusk that thrives in damp, dark places. Fish are barely attracted to these.", - "npc_GlowingSnail": "A snail that has mutated to adapt to the glowing mushroom environment. Fish are significantly attracted to these.", - "npc_Frog": "Prefers bodies of water filled with thick growth. Perfectly content both on land and underwater.", - "npc_Duck": "A water fowl with beautiful plumage. Swims in the purest of water, quacking happily.", - "npc_DuckWhite": "A white feathered waterfowl that swims in pure water and basks in the warm sun.", - "npc_ScorpionBlack": "Despite its menacing appearance, it is quite docile unless threatened or facing smaller prey. Fish are occasionally attracted to these.", - "npc_Scorpion": "Harmlessly scuttles around the desert looking for food. Fish are barely attracted to these.", - "npc_TravellingMerchant": "The flamboyantly-dressed Traveling Merchant travels far and wide to bring unique, cultural wares from time to time.", - "npc_Angler": "The Angler, a rude fishing genius, sends others to find weird, rare fish. He rewards random items, entertained by any misfortunes.", - "npc_DukeFishron": "An aquatic pigron mutation from the depths of the ocean who surfaces in search of a rare, savory type of worm.", - "npc_Sharkron": "Duke Fishron's nature as a form of chimera causes his offspring to emerge more shark-like, which he uses as minions in battle.", - "npc_TruffleWorm": "An extremely rare, difficult to catch glowworm. A specific, powerful sea creature is insatiably attracted to these.", - "npc_Grasshopper": "It leaps tall blades of grass in a single bound. Fish are fairly attracted to these.", - "npc_ChatteringTeethBomb": "A playful prank gone wrong, clowns will unleash these explosive chompers on their enemies. Also great for parties!", - "npc_CultistArcherBlue": "Sworn to protect the cultist's ritual, these robed archers will fight to the death defending the lunatic devotees.", - "npc_BrainScrambler": "These Martian soldiers brandish crude laser weaponry that releases dangerous short-range radiation, hence the protective helmets.", - "npc_RayGunner": "The elite specialists in the Martian Invasion Force are equipped with more precise and deadly laser rifles; effectively snipers.", - "npc_MartianOfficer": "Lacking offensive weaponry, officers in the Martian forces favor defensive measures to focus on relaying tactics to the soldiers.", - "npc_GrayGrunt": "Martians are conscripted into military service, and those who do not make the cut are sent out unarmed to distract the enemy as fodder.", - "npc_MartianEngineer": "Martian soldiers who lack combat ability may instead be deployed for their mechanical aptitude, constructing turrets on the field.", - "npc_MartianTurret": "Named after a historic Terrarian, these turrets are built by Martian engineers and rain devastating energy upon anyone nearby.", - "npc_MartianDrone": "The data collected from these drones are sent back to the motherships moments before they self-destruct onto their foes.", - "npc_GigaZapper": "Martians who show great potential in close combat are equipped with powerful energy spears that can atomize anything.", - "npc_ScutlixRider": "Elite Ray Gunners often ride these powerful alien creatures into battle as cavalry. If their mount dies, they will pursue on foot.", - "npc_Scutlix": "Native to the Martian homeworld, these creatures function similarly to horses. That is, if horses could fire lasers from their eyes.", - "npc_MartianSaucerCore": "An advanced flying saucer from somewhere well beyond this world. The destruction from its weaponry is unimaginable.", - "npc_MoonLordCore": "The mastermind behind all terrors which befall the world, freed from his lunar prison. Practically a god, his power knows no limits.", - "npc_MartianProbe": "Sensing growing power on the planet, otherworldly beings send space-age technology to scan for advanced lifeforms.", - "npc_StardustWormHead": "The celestial energies of which this worm is born give its body and tail near unstoppable power as it twists through the skies.", - "npc_StardustCellBig": "A biological single-celled organism that divides and multiplies rapidly with the limitless power of celestial energy.", - "npc_StardustCellSmall": "A biological single-celled organism that divides and multiplies rapidly with the limitless power of celestial energy.", - "npc_StardustJellyfishBig": "A cosmic jellyfish-type creature infused with abundant celestial energies which summons smaller minions to serve as its weaponry.", - "npc_StardustSpiderBig": "This beastly celestial arachnid rapidly spawns swift and relentless offspring to distract its prey as it prepares to devour them.", - "npc_StardustSoldier": "This slow-moving celestial soldier fires cosmic rays at unsuspecting invaders, defending the pillar without hesitation.", - "npc_SolarCrawltipedeHead": "Wrapped in celestial energy, this worm-like creature seems invincible. Having no eyes, it seeks vibrations throughout the air.", - "npc_SolarDrakomire": "These celestial beasts harness the power of the sun, releasing violent flares towards any intruders nearing the pillar.", - "npc_SolarDrakomireRider": "Many drakanians ride the beastly Drakomires as a form of battle steed. Should the Drakomire be slain, they will pursue on foot.", - "npc_SolarSroller": "These humanoid celestial monsters assault their foes by rolling up into a ball and charging them with their sharp, fiery spikes.", - "npc_SolarCorite": "Resembling a large, sentient meteorite, Corites are infused with celestial energy and will charge at anything that moves.", - "npc_SolarSolenian": "These acrobatic celestial warriors can deflect incoming threats whilst spinning with their solar-infused blades.", - "npc_NebulaBrain": "These brain-like celestial beings have psionic capabilities, phasing through space and summoning powerful optical minions.", - "npc_NebulaHeadcrab": "These psionic, squid-like beasts levitate with celestial energy and latch onto the head of their prey, disrupting brain functions.", - "npc_LunarTowerVortex": "Representing a deep celestial void known as 'vortex', this tower holds the seal locking away a terrifying tyrant.", - "npc_NebulaBeast": "Celestial power fuels the aggression of these violent beasts, allowing them to run down those who trespass the pillar's area.", - "npc_NebulaSoldier": "The cosmic power held by these humanoid warriors grant them psychic abilities, in which they use to accurately shoot down foes.", - "npc_VortexRifleman": "These alien soldiers carry a versatile arsenal of celestial rifles and cosmic accessories that allow them to defy gravity.", - "npc_VortexHornetQueen": "The final evolutionary stage of the alien hornet. They fire powerful disruptive energy at their prey, and give birth to many larvae.", - "npc_VortexHornet": "These flying insectoids utilize wormholes to ambush intruders near the celestial pillars. They hunt in pairs and may swiftly evolve.", - "npc_VortexLarva": "The larval stage of the alien hornets. They may seem weak and harmless, but if ignored they will evolve into powerful beings.", - "npc_VortexSoldier": "The cosmic energy surging through these warriors builds up until their untimely demise, resulting in an explosion of lightning.", - "npc_ArmedZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombiePincushion": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombieSwamp": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombieTwiggy": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombieCenx": "{$CommonBestiaryFlavor.Zombie}", - "npc_CultistDevote": "Utterly devoted, Lunatic Devotees unfailingly worship their deity, even when threatened with death. Fear only makes them worship harder.", - "npc_CultistBoss": "A fanatical leader hell-bent on bringing about the apocalypse by reviving the great Cthulhu through behind-the-scenes scheming.", - "npc_CultistBossClone": "Though it is an illusion designed to distract from the true threat, this fake cultist can still use some basic offensive magic as well.", - "npc_TaxCollector": "This grumpy Tax Collector has literally been to hell and back. Greedy to a fault, he's truly only concerned with money.", - "npc_GoldBird": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldBunny": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldButterfly": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldFrog": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldGrasshopper": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldMouse": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldWorm": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_BoneThrowingSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_BoneThrowingSkeleton2": "{$CommonBestiaryFlavor.Skeleton}", - "npc_BoneThrowingSkeleton3": "{$CommonBestiaryFlavor.Skeleton}", - "npc_BoneThrowingSkeleton4": "{$CommonBestiaryFlavor.Skeleton}", - "npc_SkeletonMerchant": "Most skeletons are out for blood, but not the Skeleton Merchant. He just wants to sell supplies, such as rare torches and yo-yo gear.", - "npc_CultistDragonHead": "Wyvern souls are entwined in the atmosphere of the world. Powerful magicks can summon them through the veil with physical form.", - "npc_Butcher": "Soulless and cruel, this pig-masked psychotic killer brandishes a powerful chainsaw in which to dismember every living thing.", - "npc_CreatureFromTheDeep": "Said to have emerged from the blackest lagoons, these fish-men lash at their victims with unmatched submerged mobility.", - "npc_Fritz": "Rumors speak of a small-minded hunchback who assisted in mad science. This small fellow reacts unpredictably when approached.", - "npc_Nailhead": "An intelligent being who seeks out souls to steal, utilizing nails from his own body both as a weapon and as defensive measures.", - "npc_CrimsonBunny": "Bunnies are pure beings that normally cannot be afflicted by Crimson, but will succumb under the effects of a Blood Moon.", - "npc_CrimsonGoldfish": "Goldfish become grotesque, blood-sucking fiends of the Crimson when exposed to a Blood Moon.", - "npc_Psycho": "This masked killer's quiet demeanor and cunning ability to hunt allows him to ambush his victims without being detected.", - "npc_DeadlySphere": "By means unknown, this silvery metamorphic sphere levitates about on its own. It moves about quickly, often producing spikes.", - "npc_DrManFly": "Part man, part fly, all doctor. He's brought his most volatile and dangerous chemicals, and he's buzzing to try them out.", - "npc_ThePossessed": "A Terrarian girl possessed by the most evil of spirits, she gains superhuman abilities and behaves both arbitrarily and violently.", - "npc_CrimsonPenguin": "During a Blood Moon, the normally docile penguins become infested with the contagious growth of the Crimson.", - "npc_GoblinSummoner": "Gifted in the darkest of magics, she summons unfathomable shadowflame ghasts through a powerful hex.", - "npc_ShadowFlameApparition": "The shadowflame magicks are powerful spiritual remnants of twisted goblin ancestors, wrought from powerful summoning.", - "npc_BigMimicCorruption": "Mimics which fall to Corruption grow larger and more powerful as a result. They can be birthed from ordinary chests by force.", - "npc_BigMimicCrimson": "Mimics which are enthralled by the Crimson are empowered dramatically. They can be birthed from ordinary chests by force.", - "npc_BigMimicHallow": "Mimics struck with the blessing surge with energy and become powerful. They can be birthed from ordinary chests by force.", - "npc_Mothron": "A behemoth of an insect attracted to the eerie anti-glow of a solar eclipse. With a rapid gestation period, it multiplies quickly.", - "npc_MothronSpawn": "The creatures which burst from the eggs laid by mothron can be as deadly and as relentless as their daunting mothers.", - "npc_Medusa": "An ancient monster with a petrifying gaze. The snakes which grow from her scalp like hair grant her these powers.", - "npc_GreekSkeleton": "In the ruins of an ancient civilization now deeply buried, some of its spear-hurling soldiers still walk its marble-adorned paths.", - "npc_GraniteGolem": "Strong are the magicked spirits which inhabit the granite masses deep below, this type in particular taking on a humanoid shape.", - "npc_GraniteFlyer": "Earth elementals manifest through many forms by taking on the properties of different materials, such as this hardy granite.", - "npc_EnchantedNightcrawler": "Worms infused with fallen star magic glow with a glittering light. Fish are extremely attracted to these.", - "npc_Grubby": "Slimy, yet satisfying! Fish are especially attracted to these.", - "npc_Sluggy": "Slow and covered in a slick mucous. Fish are somewhat attracted to these.", - "npc_Buggy": "A vibrant beetle-like bug. Fish are extremely attracted to these.", - "npc_BloodZombie": "With enough exposure to a Blood Moon, zombies become twisted and cursed with everflowing blood pouring out from their rotten flesh.", - "npc_Drippler": "Demon eyes become erratic under a Blood Moon, sometimes twisting together into a dripping cluster of cursed blood and eyeballs.", - "npc_PirateShip": "When the pirates face strong opposition in their pillaging raids, they bring their majestic floating galleon as backup. Cannons away!", - "npc_LunarTowerStardust": "Representing a glittering celestial remnant known as 'stardust', this tower holds the seal locking away a terrifying tyrant.", - "npc_Crawdad": "A subterranean form of crayfish which scuttles along the cavern floors, searching for prey to clip apart with its powerful pincers.", - "npc_GiantShelly": "To overcome their slow speed, shellies have developed the ability to hide inside their spiked shell and hurl themselves at their foes.", - "npc_Salamander2": "An unusual amphibious bipedal lizard which inhabits the dark caverns. When threatened, it spews a highly corrosive acid everywhere.", - "npc_LunarTowerNebula": "Representing a stormy celestial body known as 'nebula', this tower holds the seal locking away a terrifying tyrant.", - "npc_GiantWalkingAntlion": "{$CommonBestiaryFlavor.AntlionCharger}", - "npc_GiantFlyingAntlion": "{$CommonBestiaryFlavor.AntlionSwarmer}", - "npc_DuneSplicerHead": "The world's largest, most deadly worm. Strengthened by ancient magicks, it can devour a spicy Terrarian quicker than they realize.", - "npc_TombCrawlerHead": "The desert is home to one of the largest varieties of worms across the land. It has a voracious appetite for careless explorers.", - "npc_LunarTowerSolar": "Representing a flaming celestial event known as 'solar flares', this tower holds the seal locking away a terrifying tyrant.", - "npc_SolarSpearman": "These highly aggressive celestial soldiers carry a large, fiery spear that can melt nearly anything it penetrates.", - "npc_MartianWalker": "A wonder of Martian technology constructed from the strongest metals and infused with biological components.", - "npc_AncientCultistSquidhead": "A vision of a deadly omen wrought forth by a powerful cultist, often appears with reckless cosmic summoning of wyvern spirits.", - "npc_DesertGhoul": "Wandering the dark caverns below the desert dunes, ghouls are the dessicated husks of zombies preserved by the arid environment.", - "npc_DesertGhoulCorruption": "Ghouls twisted by the Corruption ooze a nasty green bile that ignites on contact with skin, scorching their prey with cursed flames.", - "npc_DesertGhoulCrimson": "Ghouls infested by the Crimson leak vile ichor from their mouths, weakening the defenses of their foes with every bite.", - "npc_DesertGhoulHallow": "Ghouls cleansed by the Hallow possess a psychedelic saliva that renders their victims confused and distracted by visions and mirages.", - "npc_DesertLamiaLight": "{$CommonBestiaryFlavor.Lamia}", - "npc_DesertLamiaDark": "{$CommonBestiaryFlavor.Lamia}", - "npc_DesertScorpionWall": "These unnaturally large scorpions have adapted to swiftly pursuing their prey along the walls with their sharp, venomous tails.", - "npc_DesertBeast": "Sturdy as a rock, these lizard-like beasts roam the desert in search of food. Their hardened bodies make them formidable threats.", - "npc_DesertDjinn": "Ancient magicks corrupted the minds of the once friendly desert djinns, releasing them full of hostility from their lamps.", - "npc_DemonTaxCollector": "Sentenced to an eternity of punishment for his lifelong greedy ambitions, this man has long been corrupted into a demonic state.", - "npc_TheBride": "It's uncertain if the bride was wed before or after her death, but the story ends tragically for anyone who crosses her path.", - "npc_SandSlime": "Deserts are very dry, but the Sand Slime seems to have successfully adapted to the harsh conditions by becoming a pile of living sand.", - "npc_SquirrelRed": "Rare, red-furred hyperactive rodents which scurry about the woods.", - "npc_SquirrelGold": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_PartyBunny": "Someone put a party hat on a bunny. It must be a real party animal.", - "npc_SandElemental": "The most intense sandstorms draw forth powerful earth elementals. With this feminine form, her tornadoes tear all asunder.", - "npc_SandShark": "{$CommonBestiaryFlavor.Sandshark}", - "npc_SandsharkCorrupt": "{$CommonBestiaryFlavor.Sandshark}", - "npc_SandsharkCrimson": "{$CommonBestiaryFlavor.Sandshark}", - "npc_SandsharkHallow": "{$CommonBestiaryFlavor.Sandshark}", - "npc_Tumbleweed": "Powerful winds have blown this tumbleweed around the desert, and it is none too pleased. They roll faster with the wind than against it.", - "npc_DD2Bartender": "The Tavern Keep once managed a bar in another universe. He's here to help stop the Old One's Army from conquering this world.", - "npc_DD2Betsy": "A vicious Etherian dragon who leads the minions of the Old One's Army that found their way to this world.", - "npc_DD2GoblinT3": "A unique goblin species from Etheria, they are not related Terrarian goblins. The ferocious footsoldiers of the Old One's Army.", - "npc_DD2GoblinBomberT3": "Hurling bombs with reckless abandon, these sappers serve the Old One's Army with maniacal passion.", - "npc_DD2WyvernT3": "Etherian Wyverns come in a variety of shapes and sizes, and behave more like bats than the majestic Wyverns of this world.", - "npc_DD2JavelinstT3": "These bulky brutes are awkward and ungainly, but their javelins are still razor sharp, and their aim is deadly.", - "npc_DD2DarkMageT1": "A small, levitating sorcerer from Etheria who wields dark magic and can even raise fresh minions for the Old One's Army.", - "npc_DD2DarkMageT3": "A small, levitating sorcerer from Etheria who wields dark magic and can even raise fresh minions for the Old One's Army.", - "npc_DD2SkeletonT3": "Small armies of these skeletons are summoned from the ground by Dark Mages, loyally serving their master's will.", - "npc_DD2WitherBeastT3": "Wither beasts emit a defense-sapping aura from the crystals on their back. While rooted in place, they heal rapidly.", - "npc_DD2DrakinT3": "Etherian reptiles in service of the Old One's Army. Powerful beasts, they are capable of spewing deadly purple flames.", - "npc_DD2KoboldWalkerT3": "Rigged with an explosive payload, Kobolds have no regard for safety. They eagerly blow themselves up, hoping to take their foes with them.", - "npc_DD2KoboldFlyerT3": "Taking the explosive approach to a whole new level, Kobold Gliders soar the skies, seeking to bring death from above.", - "npc_DD2OgreT2": "A tall, hulking demi-human from the Old One's Army with unfathomable strength and vitality. He carries a big stick.", - "npc_DD2OgreT3": "A tall, hulking demi-human from the Old One's Army with unfathomable strength and vitality. He carries a big stick.", - "npc_DD2LightningBugT3": "Lightning Bugs from Etheria aren't just named that for their pretty lights! These ones blast their foes with shocking bolts of electricity.", - "npc_WalkingAntlion": "{$CommonBestiaryFlavor.AntlionCharger}", - "npc_FlyingAntlion": "{$CommonBestiaryFlavor.AntlionSwarmer}", - "npc_LarvaeAntlion": "Freshly hatched from their eggs, larval antlions should not be underestimated. Though young, they are still very aggressive.", - "npc_FairyCritterPink": "Glowing winged humanoid creatures the size of a butterfly. Attuned to the world around them, they excel at finding shiny things.", - "npc_FairyCritterGreen": "Glowing winged humanoid creatures the size of a butterfly. Attuned to the world around them, they excel at finding shiny things.", - "npc_FairyCritterBlue": "Glowing winged humanoid creatures the size of a butterfly. Attuned to the world around them, they excel at finding shiny things.", - "npc_ZombieMerman": "Mermen may be rare and exotic demi-humans, but they can still die... and still come back from that a changed merman.", - "npc_EyeballFlyingFish": "For mysterious reasons, fish are known to mutate with other living things or even man-made objects. This one is especially violent.", - "npc_Golfer": "The Golfer is a wise, middle-aged man who sells all sorts of golfing equipment. He's got game and knows how to score.", - "npc_TorchZombie": "In life, this torch-wielding zombie joined an angry mob to hunt the undead. In death, it joined an undead mob to hunt the living.", - "npc_GoldGoldfish": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldGoldfishWalker": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_WindyBalloon": "Some enterprising slimes ride wind currents with balloons in an effort to find food. Pop their balloons to bring them back down to earth. ", - "npc_BlackDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_BlueDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_GreenDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_OrangeDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_RedDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_YellowDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_GoldDragonfly": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_Seagull": "A larger bird that inhabits coastal areas. Watch out for droppings!", - "npc_LadyBug": "A brilliant red insect often associated with luck. Fishing with these as bait may result in unwanted karma.", - "npc_GoldLadyBug": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_Maggot": "An unsavory larval bug which feasts on dead, rotting matter. Fish are somewhat attracted to these.", - "npc_Pupfish": "These fish prefer isolated, extreme climates where competition is scarce, such as the lakebeds of a desert oasis.", - "npc_Grebe": "An exotic waterfowl that thrives in the desert oasis.", - "npc_Rat": "These fuzzy rodents sniff about in putrid locations scavenging for food. They are avoided in fear of diseases they may carry.", - "npc_Owl": "A large, wise predatory bird which hunts nocturnally from the tree tops. ", - "npc_WaterStrider": "Glides elegantly along the surface of calm bodies of water searching for smaller bugs. Fish are occasionally attracted to these.", - "npc_GoldWaterStrider": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_ExplosiveBunny": "Not the typical garden-variety bunny. This one has been tampered with, and has an explosive temper as a result.", - "npc_Dolphin": "A playful sea mammal whose intelligence rivals that of humanity.", - "npc_Turtle": "These slow, stoic creatures travel between lakes and dry land, carrying a hard shell on their backs for protection.", - "npc_TurtleJungle": "Their hard shells camouflage them from vicious predators by blending in with the thick, jungly environment in which they reside.", - "npc_BloodNautilus": "An enormous shelled water demon which feeds off the negative energy of a Blood Moon. Brutally responds to being pestered.", - "npc_BloodSquid": "Summoned in small groups by the Nautilus to aid their master in battle. Thick are the streams of blood squirted from their bodies.", - "npc_GoblinShark": "Half-shark, half-goblin, completely murderous! One of the numerous reasons to just stay home during a Blood Moon.", - "npc_BloodEelHead": "A large, worm-like demon, dripping with blood - both its own, and its victim's. It's a bloody nightmare of a fiend!", - "npc_Gnome": "A tiny long-bearded sneak who resides in oversized trees. Becomes a lawn ornament when exposed to sunlight.", - "npc_SeaTurtle": "A soft-shelled reptile that prefers saltwater and marine prey.", - "npc_Seahorse": "A gentle critter which swims harmlessly in the ocean depths. ", - "npc_GoldSeahorse": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_Dandelion": "All this wind can make just about anyone angry. Evidently, this includes otherwise harmless dandelions and their deadly seeds.", - "npc_IceMimic": "{$CommonBestiaryFlavor.Mimic}", - "npc_RockGolem": "Dense-minded living stone formation. Awaits weary cavern dwellers to pound them into juicy rubble.", - "npc_BloodMummy": "The blood-dripping organic matter in these mummies display far better preservation than the rest of their ilk.", - "npc_SporeSkeleton": "Skeletons meandering through more moist caverns become hosts for glowing fungal growth, greatly empowering them.", - "npc_SporeBat": "The tables have turned on a variety of rabid bats, themselves enwrought with a deadly fungal infection.", - "npc_BestiaryGirl": "The Zoologist, resident lycanthrope, adores animals. Her fox-like biology resulted from a cursed animal bite.", - "npc_TownCat": "Lazy, devious, might bring presents. Presents might have once been breathing.", - "npc_TownDog": "A loyal companion to many. Excitable and always ready for action.", - "npc_TownBunny": "Guaranteed to keep the vegetable supplies in check. Might possibly become a hat.", - "npc_HellButterfly": "A solemn butterfly seeking blooms rooted in hell. Its wings glimmer with fiery veins.", - "npc_Lavafly": "A variation of firefly which adapted to the intense conditions of the world's infernal core. It mimics sparking embers.", - "npc_MagmaSnail": "A unique species of snail which withstands extreme heat. Its boiling slime trail melts down most weaker surfaces.", - "npc_GemSquirrelAmethyst": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelTopaz": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelSapphire": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelEmerald": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelRuby": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelDiamond": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelAmber": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemBunnyAmethyst": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyTopaz": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnySapphire": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyEmerald": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyRuby": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyDiamond": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyAmber": "{$CommonBestiaryFlavor.GemBunny}", - "npc_HallowBoss": "Beneath the Hallow's cleansing blanket lies a vengeful fae goddess bent on scrubbing the land of any and all impurity.", - "npc_QueenSlimeBoss": "Hallowed slimes consolidated into a haughty, crushing force adorned in dazzling crystals. She is rumored to grow wings.", - "npc_MaggotZombie": "Wanders aimlessly to infest the living with undeath, unaware of its own maggoty infestation.", - "npc_QueenSlimeMinionBlue": "The blue-spectrumed crystal slimes specialize in growing and ejecting pointed crystal shards from their gelatinous bodies.", - "npc_QueenSlimeMinionPink": "On the pink side of the crystal spectrum, these crystal slimes pop off tumor-like gel growths to assault their enemies.", - "npc_QueenSlimeMinionPurple": "Crystal slimes on the purple spectrum grow wings much like their royal creator, becoming aerial threats.", - "npc_EmpressButterfly": "Should one of these luminescent beings perish in the chaos of night, a sleeping tyrant is rumored to violently awaken.", - }, - "CreativePowers": { - "InfiniteItemSacrificeShortDescription": "Researching will consume it", - "ConfirmInfiniteItemSacrifice": "Research", - "ItemWasJustUnlockedInfinitely": "Once enough of is researched, it will be available infinitely!", - "InfiniteItemsCategoryClosed": "Open Duplication Menu", - "InfiniteItemsCategoryOpened": "Close Duplication Menu", - "InfiniteItemsCategory": "Research Infinite Items", - - "ResearchItemsCategoryClosed": "Open Research Menu", - "ResearchItemsCategoryOpened": "Close Research Menu", - - "InfinitePlacementRange_Disabled": "Normal Placement Range", - "InfinitePlacementRange_Enabled": "Increased Placement Range", - - "StopBiomeSpread_Disabled": "Infection Spread Enabled", - "StopBiomeSpread_Enabled": "Infection Spread Disabled", - - "DifficultySlider_Closed": "Open Enemy Difficulty Slider", - "DifficultySlider_Opened": "Close Enemy Difficulty Slider", - - "NPCSpawnRateSlider_Closed": "Open Enemy Spawn Rate Slider", - "NPCSpawnRateSlider_Opened": "Close Enemy Spawn Rate Slider", - - "PowersMenuOpen": "Close Power Menu", - "PowersMenuClosed": "Open Power Menu", - "TimeCategoryClosed": "Open Time Menu", - "TimeCategoryOpened": "Close Time Menu", - "TimeCategory": "Powers relating to controlling time", - "PersonalCategoryClosed": "Open Personal Power Menu", - "PersonalCategoryOpened": "Close Personal Power Menu", - "PersonalCategory": "Powers relating to you", - "FreezeTime_Disabled": "Time Unfrozen", - "FreezeTime_Enabled": "Time Frozen", - "FreezeTime_Description": "Stop the passage of time", - "StartDayImmediately": "Change Time to Dawn", - "StartDayImmediately_Description": "Time is set to 4:30 AM", - "StartNightImmediately": "Change Time to Dusk", - "StartNightImmediately_Description": "Time is set to 7:30 PM", - "StartNoonImmediately": "Change Time to Noon", - "StartNoonImmediately_Description": "Time is set to 12:00 PM", - "StartMidnightImmediately": "Change Time to Midnight", - "StartMidnightImmediately_Description": "Time is set to 12:00 AM", - "WeatherCategoryClosed": "Open Weather Menu", - "WeatherCategoryOpened": "Close Weather Menu", - "WeatherCategory": "Powers relating to controlling weather", - "StartRainImmediately": "Start Rain", - "StartRainImmediately_Description": "Will cause rain to start falling", - "StopRainImmediately": "Stop Rain", - "StopRainImmediately_Description": "Will cause rain to stop falling", - "Godmode_Disabled": "Godmode Disabled", - "Godmode_Enabled": "Godmode Enabled", - "Godmode_Description": "Become invulnerable to damage!", - - "ModifyWindDirectionAndStrength_Closed": "Open Wind Control Slider", - "ModifyWindDirectionAndStrength_Opened": "Close Wind Control Slider", - - "ModifyTimeRate_Closed": "Open Time Speed Slider", - "ModifyTimeRate_Opened": "Close Time Speed Slider", - - "ModifyRainPower_Opened": "Close Rain Control Slider", - "ModifyRainPower_Closed": "Open Rain Control Slider", - - "FreezeRainPower_Disabled": "Rain Change Enabled", - "FreezeRainPower_Enabled": "Rain Change Disabled", - - "FreezeWindDirectionAndStrength_Enabled": "Wind Change Disabled", - "FreezeWindDirectionAndStrength_Disabled": "Wind Change Enabled", - - "NPCSpawnRateSliderEnemySpawnsDisabled": "Disabled", - - "TabSearch": "If Searched For", - "TabBlocks": "Blocks", - "TabWeapons": "Weapons", - "TabArmor": "Armor", - "TabAccessories": "Accessories", - "TabConsumables": "Consumables", - "TabMisc": "Misc", - "TabMaterials": "Materials", - - "WeatherMonsoon": "Monsoon", - "WeatherClearSky": "Clear Sky", - "WeatherDrizzle": "Drizzle", - - "WindWest": "West", - "WindNone": "No Wind", - "WindEast": "East", - - "ResearchButtonTooltip": "Fully researched items can be created freely", - - "Sort_SortingID": "By ID", - "Sort_PlacableObjects": "Placable Objects", - "Sort_Walls": "Walls", - "Sort_Blocks": "Blocks", - "Sort_Alphabetical": "Name", - "CantUsePowerBecauseOfNoPermissionFromServer": "You have no permission for this power" + "CobaltMelee": "15% increased melee speed" } - } \ No newline at end of file diff --git a/Localization/Content/en-US/Items.json b/Localization/Content/en-US/Items.json index 380bb19..41c235a 100644 --- a/Localization/Content/en-US/Items.json +++ b/Localization/Content/en-US/Items.json @@ -13,26 +13,9 @@ "SpecialCrafting": "Used for special crafting", "DevItem": "'Great for impersonating devs!'", "FlightAndSlowfall": "Allows flight and slow fall", - "PressDownToHover": "Press DOWN to toggle hover\nPress UP to deactivate hover", - "PressUpToBooster": "Hold UP to boost faster!", "RightClickToOpen": " to open", "MinorStats": "Minor improvements to all stats", - "MediumStats": "Medium improvements to all stats", - "MajorStats": "Major improvements to all stats", - "TipsyStats": "Minor improvements to melee stats & lowered defense", - "EtherianManaCost10": "Costs 10 Etherian Mana per use while defending an Eternia Crystal", - "GolfBall": "Can be hit with a golf club", - "Sentry": "Summons a sentry", - "GolfIron": "A well-rounded club best for mid-range distances\nGolf balls will carry a good distance with decent vertical loft", - "GolfPutter": "A specialized club for finishing holes\nGolf balls will stay close to the ground over short distances for precision shots", - "GolfWedge": "A specialized club for sand pits or tall obstacles\nGolf balls will gain tons of vertical loft but will not carry very far", - "GolfDriver": "A powerful club for long distances\nGolf balls will carry very far, with little vertical loft", - "Kite": "Kites can be flown on windy days\nReel it in with ", - "LavaFishing": "Allows fishing in lava", - "CreativeSacrificeNeeded": "Research {0} more to unlock duplication", - "CreativeSacrificeComplete": "Duplication unlocked", - "TeleportationPylon": "Teleport to another pylon when 2 villagers are nearby\nYou can only place one per type and in the matching biome", - "Whips": "Your summons will focus struck enemies" + "EtherianManaCost10": "Use 10 Etherian Mana to summon more than one" }, "PaintingArtist": { "Crowno": "'V. Costa Moura'", @@ -46,22 +29,10 @@ "Wright": "'K. Wright'", "Phelps": "'D. Phelps'", "Duncan": "'M. J. Duncan'", - "Ness": "'C. J. Ness'", - "Leinfors": "'J. Parker III'", - "Aurora": "'J. Witzig'", - "Criddle": "'C. Rohde'", - "Darthkitten": "'C. Schneider'", - "darthmorf": "'S. Poirier'", - "Khaios": "'J. Sterling'", - "UnitOne": "'U. One'", - "Xman101": "'X. Calder'", - "Zoomo": "'A. Dale'" - + "Ness": "'C. J. Ness'" }, "BuffDescription": { - "WellFed_Expert": "Minor improvements to all stats and increased life regeneration", - "WellFed2_Expert": "Medium improvements to all stats and increased life regeneration", - "WellFed3_Expert": "Major improvements to all stats and increased life regeneration" + "WellFed_Expert": "Minor improvements to all stats and increased life regeneration" }, "Prefix": { "Dull": "Dull", @@ -143,18 +114,12 @@ "Tiny": "Tiny", "Violent": "Violent", "Legendary": "Legendary", - "Legendary2": "Legendary", "Unreal": "Unreal", "Mythical": "Mythical", "Terrible": "Terrible", "Small": "Small" }, "ItemName": { - "BloodMoonMonolith": "Blood Moon Monolith", - "CrimstoneBrick": "Crimstone Brick", - "CrimstoneBrickWall": "Crimstone Brick Wall", - "SmoothSandstone": "Smooth Sandstone", - "SmoothSandstoneWall": "Smooth Sandstone Wall", "IronPickaxe": "Iron Pickaxe", "IronAxe": "Iron Axe", "ShadowGreaves": "Shadow Greaves", @@ -288,7 +253,7 @@ "RedHusk": "Red Husk", "CyanHusk": "Cyan Husk", "VioletHusk": "Violet Husk", - "PurpleMucos": "Purple Mucus", + "PurpleMucos": "Purple Mucos", "BlackInk": "Black Ink", "FlowerofFire": "Flower of Fire", "DyeVat": "Dye Vat", @@ -524,7 +489,7 @@ "TurtleShell": "Turtle Shell", "TissueSample": "Tissue Sample", "ClayBlock": "Clay Block", - "Vertebrae": "Vertebra", + "Vertebrae": "Vertebrae", "BloodySpine": "Bloody Spine", "Ichor": "Ichor", "IchorTorch": "Ichor Torch", @@ -595,7 +560,7 @@ "CarriageLantern": "Carriage Lantern", "AlchemyLantern": "Alchemy Lantern", "DiablostLamp": "Diabolist Lamp", - "OilRagSconse": "Oil Rag Sconce", + "OilRagSconse": "Oil Rag Sconse", "BlueDungeonChair": "Blue Dungeon Chair", "BlueDungeonTable": "Blue Dungeon Table", "BlueDungeonWorkBench": "Blue Dungeon Work Bench", @@ -748,7 +713,7 @@ "NecroGreaves": "Necro Greaves", "CrimsonChest": "Crimson Chest", "HallowedChest": "Hallowed Chest", - "FrozenChest": "Ice Chest", + "FrozenChest": "Frozen Chest", "JungleKey": "Jungle Key", "CorruptionKey": "Corruption Key", "CrimsonKey": "Crimson Key", @@ -819,7 +784,7 @@ "TitanstoneBlockWall": "Titanstone Block Wall", "MagicCuffs": "Magic Cuffs", "MusicBoxSnow": "Music Box (Snow)", - "MusicBoxSpace": "Music Box (Space Night)", + "MusicBoxSpace": "Music Box (Space)", "MusicBoxCrimson": "Music Box (Crimson)", "MusicBoxBoss4": "Music Box (Boss 4)", "SilverWatch": "Silver Watch", @@ -828,7 +793,7 @@ "MusicBoxRain": "Music Box (Rain)", "MusicBoxIce": "Music Box (Ice)", "MusicBoxDesert": "Music Box (Desert)", - "MusicBoxOcean": "Music Box (Ocean Day)", + "MusicBoxOcean": "Music Box (Ocean)", "MusicBoxDungeon": "Music Box (Dungeon)", "MusicBoxPlantera": "Music Box (Plantera)", "MusicBoxBoss5": "Music Box (Boss 5)", @@ -871,7 +836,7 @@ "DerplingBanner": "Derpling Banner", "EaterofSoulsBanner": "Eater of Souls Banner", "EnchantedSwordBanner": "Enchanted Sword Banner", - "ZombieEskimoBanner": "Frozen Zombie Banner", + "ZombieEskimoBanner": "Zombie Eskimo Banner", "FaceMonsterBanner": "Face Monster Banner", "FloatyGrossBanner": "Floaty Gross Banner", "FlyingFishBanner": "Flying Fish Banner", @@ -1065,7 +1030,7 @@ "SpookyDoor": "Spooky Door", "SpookyTable": "Spooky Table", "SpookyWorkBench": "Spooky Work Bench", - "SpookyPlatform": "Spooky Wood Platform", + "SpookyPlatform": "Spooky Platform", "ReaperHood": "Reaper Hood", "Diamond": "Diamond", "ReaperRobe": "Reaper Robe", @@ -1621,7 +1586,7 @@ "GuideVoodooFish": "Guide Voodoo Fish", "Wyverntail": "Wyverntail", "ZombieFish": "Zombie Fish", - "AmanitaFungifin": "Amanita Fungifin", + "AmanitiaFungifin": "Amanitia Fungifin", "Angelfish": "Angelfish", "BloodyManowar": "Bloody Manowar", "Bonefish": "Bonefish", @@ -1700,7 +1665,7 @@ "SwiftnessPotion": "Swiftness Potion", "BlueArmoredBonesBanner": "Blue Armored Bones Banner", "BlueCultistArcherBanner": "Blue Cultist Archer Banner", - "BlueCultistCasterBanner": "Lunatic Devotee Banner", + "BlueCultistCasterBanner": "Blue Cultist Caster Banner", "BlueCultistFighterBanner": "Blue Cultist Fighter Banner", "BoneLeeBanner": "Bone Lee Banner", "ClingerBanner": "Clinger Banner", @@ -2266,7 +2231,7 @@ "TacticalShotgun": "Tactical Shotgun", "RottenChunk": "Rotten Chunk", "IvyChest": "Ivy Chest", - "IceChest": "Frozen Chest", + "IceChest": "Ice Chest", "Marrow": "Marrow", "UnholyTrident": "Unholy Trident", "FrostHelmet": "Frost Helmet", @@ -2402,9 +2367,9 @@ "TheUndertaker": "The Undertaker", "TheMeatball": "The Meatball", "TheRottedFork": "The Rotted Fork", - "EskimoHood": "Snow Hood", - "EskimoCoat": "Snow Coat", - "EskimoPants": "Snow Pants", + "EskimoHood": "Eskimo Hood", + "EskimoCoat": "Eskimo Coat", + "EskimoPants": "Eskimo Pants", "LivingWoodChair": "Living Wood Chair", "CactusChair": "Cactus Chair", "BoneChair": "Bone Chair", @@ -2594,10 +2559,10 @@ "ShoeSpikes": "Shoe Spikes", "TigerClimbingGear": "Tiger Climbing Gear", "Tabi": "Tabi", - "PinkEskimoHood": "Pink Snow Hood", - "PinkEskimoCoat": "Pink Snow Coat", + "PinkEskimoHood": "Pink Eskimo Hood", + "PinkEskimoCoat": "Pink Eskimo Coat", "Minishark": "Minishark", - "PinkEskimoPants": "Pink Snow Pants", + "PinkEskimoPants": "Pink Eskimo Pants", "PinkThread": "Pink Thread", "ManaRegenerationBand": "Mana Regeneration Band", "SandstorminaBalloon": "Sandstorm in a Balloon", @@ -2672,7 +2637,7 @@ "AncientBattleArmorPants": "Forbidden Treads", "AncientBattleArmorShirt": "Forbidden Robes", "AncientCloth": "Ancient Cloth", - "AncientCultistTrophy": "Lunatic Cultist Trophy", + "AncientCultistTrophy": "Ancient Cultist Trophy", "AncientHorn": "Ancient Horn", "AnglerTackleBag": "Angler Tackle Bag", "AngryBonesBanner": "Angry Bones Banner", @@ -2768,7 +2733,7 @@ "BorealWoodTable": "Boreal Wood Table", "BorealWoodWall": "Boreal Wood Wall", "BorealWoodWorkBench": "Boreal Wood Work Bench", - "BossMaskCultist": "Lunatic Cultist Mask", + "BossMaskCultist": "Ancient Cultist Mask", "BossMaskMoonlord": "Moon Lord Mask", "BottomlessBucket": "Bottomless Water Bucket", "BouncyBomb": "Bouncy Bomb", @@ -2892,7 +2857,7 @@ "DestroyerBossBag": "Treasure Bag", "DestroyerMask": "Destroyer Mask", "Detonator": "Detonator", - "DevDye": "Skiphs' Blood", + "DevDye": "Skiphs's Blood", "DiamondGemsparkWall": "Diamond Gemspark Wall", "DiamondGemsparkWallOff": "Offline Diamond Gemspark Wall", "DjinnLamp": "Desert Spirit Lamp", @@ -2956,14 +2921,14 @@ "Fake_DynastyChest": "Trapped Dynasty Chest", "Fake_EbonwoodChest": "Trapped Ebonwood Chest", "Fake_FleshChest": "Trapped Flesh Chest", - "Fake_FrozenChest": "Trapped Ice Chest", + "Fake_FrozenChest": "Trapped Frozen Chest", "Fake_GlassChest": "Trapped Glass Chest", "Fake_GoldChest": "Trapped Gold Chest", "Fake_GraniteChest": "Trapped Granite Chest", "Fake_GreenDungeonChest": "Trapped Green Dungeon Chest", "Fake_HallowedChest": "Trapped Hallowed Chest", "Fake_HoneyChest": "Trapped Honey Chest", - "Fake_IceChest": "Trapped Frozen Chest", + "Fake_IceChest": "Trapped Ice Chest", "Fake_IvyChest": "Trapped Ivy Chest", "Fake_JungleChest": "Trapped Jungle Chest", "Fake_LihzahrdChest": "Trapped Lihzahrd Chest", @@ -3635,7 +3600,7 @@ "SailfishBoots": "Sailfish Boots", "SalamanderBanner": "Salamander Banner", "SandElementalBanner": "Sand Elemental Banner", - "SandFallBlock": "Sandfall Block", + "SandFallBlock": "Sandfall", "SandFallWall": "Sandfall Wall", "SandsharkBanner": "Sand Shark Banner", "SandsharkCorruptBanner": "Bone Biter Banner", @@ -3699,10 +3664,10 @@ "SkeletronBossBag": "Treasure Bag", "SkeletronPrimeBossBag": "Treasure Bag", "SkeletronPrimeMask": "Skeletron Prime Mask", - "SkiphsHelm": "Skiphs' Mask", - "SkiphsPants": "Skiphs' Bear Butt", - "SkiphsShirt": "Skiphs' Skin", - "SkiphsWings": "Skiphs' Paws", + "SkiphsHelm": "Skiphs's Mask", + "SkiphsPants": "Skiphs's Bear Butt", + "SkiphsShirt": "Skiphs's Skin", + "SkiphsWings": "Skiphs's Paws", "SkyBlueString": "Sky Blue String", "SkyFracture": "Sky Fracture", "SkywareBathtub": "Skyware Bathtub", @@ -3744,7 +3709,7 @@ "SmokeBlock": "Smoke Block", "SnailStatue": "Snail Statue", "SnowCloudBlock": "Snow Cloud", - "SnowFallBlock": "Snowfall Block", + "SnowFallBlock": "Snowfall", "SnowFallWall": "Snowfall Wall", "SolarCoriteBanner": "Corite Banner", "SolarCrawltipedeBanner": "Crawltipede Banner", @@ -3889,7 +3854,7 @@ "TwilightHairDye": "Twilight Hair Dye", "TwinMask": "Twin Mask", "TwinsBossBag": "Treasure Bag", - "UltraBrightCampfire": "Ultrabright Campfire", + "UltraBrightCampfire": "Ultra Bright Campfire", "UndeadVikingStatue": "Undead Viking Statue", "UnicornStatue": "Unicorn Statue", "UnicornWispDye": "Unicorn Wisp Dye", @@ -4047,7 +4012,7 @@ "DungeonClockPink": "Pink Dungeon Clock", "CrystalPlatform": "Crystal Platform", "GoldenPlatform": "Golden Platform", - "DynastyPlatform": "Dynasty Wood Platform", + "DynastyPlatform": "Dynasty Platform", "LihzahrdPlatform": "Lihzahrd Platform", "FleshPlatform": "Flesh Platform", "FrozenPlatform": "Frozen Platform", @@ -4063,1135 +4028,17 @@ "CrystalSofaHowDoesThatEvenWork": "Crystal Sofa", "DynastySofa": "Dynasty Sofa", "CrystalTable": "Crystal Table", - "ArkhalisHat": "Arkhalis' Hood", - "ArkhalisShirt": "Arkhalis' Bodice", - "ArkhalisPants": "Arkhalis' Tights", - "ArkhalisWings": "Arkhalis' Lightwings", + "ArkhalisHat": "Arkhalis's Hood", + "ArkhalisShirt": "Arkhalis's Bodice", + "ArkhalisPants": "Arkhalis's Tights", + "ArkhalisWings": "Arkhalis's Lightwings", "LeinforsHat": "Leinfors' Hair Protector", "LeinforsShirt": "Leinfors' Excessive Style", "LeinforsPants": "Leinfors' Fancypants", "LeinforsWings": "Leinfors' Prehensile Cloak", "LeinforsAccessory": "Leinfors' Luxury Shampoo", "MusicBoxDD2": "Music Box (Old One's Army)", - "BossBagBetsy": "{$ItemName.SkeletronBossBag}", - "Celeb2": "Celebration Mk2", - "SpiderBathtub": "Spider Bathtub", - "SpiderBed": "Spider Bed", - "SpiderBookcase": "Spider Bookcase", - "SpiderDresser": "Spider Dresser", - "SpiderCandelabra": "Spider Candelabra", - "SpiderCandle": "Spider Candle", - "SpiderChair": "Spider Chair", - "SpiderChandelier": "Spider Chandelier", - "SpiderChest": "Spider Chest", - "SpiderClock": "Spider Clock", - "SpiderDoor": "Spider Door", - "SpiderLamp": "Spider Lamp", - "SpiderLantern": "Spider Lantern", - "SpiderPiano": "Spider Piano", - "SpiderPlatform": "Spider Platform", - "SpiderSinkSpiderSinkDoesWhateverASpiderSinkDoes": "Spider Sink", - "SpiderSofa": "Spider Sofa", - "SpiderTable": "Spider Table", - "SpiderWorkbench": "Spider Work Bench", - "Fake_SpiderChest": "Trapped Spider Chest", - "IronBrick": "Iron Brick", - "IronBrickWall": "Iron Brick Wall", - "LeadBrick": "Lead Brick", - "LeadBrickWall": "Lead Brick Wall", - "LesionBlock": "Lesion Block", - "LesionBlockWall": "Lesion Block Wall", - "LesionPlatform": "Lesion Platform", - "LesionBathtub": "Lesion Bathtub", - "LesionBed": "Lesion Bed", - "LesionBookcase": "Lesion Bookcase", - "LesionCandelabra": "Lesion Candelabra", - "LesionCandle": "Lesion Candle", - "LesionChair": "Lesion Chair", - "LesionChandelier": "Lesion Chandelier", - "LesionChest": "Lesion Chest", - "LesionClock": "Lesion Clock", - "LesionDoor": "Lesion Door", - "LesionDresser": "Lesion Dresser", - "LesionLamp": "Lesion Lamp", - "LesionLantern": "Lesion Lantern", - "LesionPiano": "Lesion Piano", - "LesionSink": "Lesion Sink", - "LesionSofa": "Lesion Sofa", - "LesionTable": "Lesion Table", - "LesionWorkbench": "Lesion Work Bench", - "Fake_LesionChest": "Trapped Lesion Chest", - "HatRack": "Hat Rack", - "WoodenCrateHard": "Pearlwood Crate", - "IronCrateHard": "Mythril Crate", - "GoldenCrateHard": "Titanium Crate", - "CorruptFishingCrateHard": "Defiled Crate", - "CrimsonFishingCrateHard": "Hematic Crate", - "DungeonFishingCrateHard": "Stockade Crate", - "FloatingIslandFishingCrateHard": "Azure Crate", - "HallowedFishingCrateHard": "Divine Crate", - "JungleFishingCrateHard": "Bramble Crate", - "DeadMansChest": "Dead Man's Chest", - "AmphibianBoots": "Amphibian Boots", - "ArcaneFlower": "Arcane Flower", - "BerserkerGlove": "Berserker's Glove", - "FairyBoots": "Fairy Boots", - "FrogFlipper": "Frog Flipper", - "FrogGear": "Frog Gear", - "FrogWebbing": "Frog Webbing", - "FrozenShield": "Frozen Shield", - "HeroShield": "Hero Shield", - "LavaSkull": "Magma Skull", - "MagnetFlower": "Magnet Flower", - "ManaCloak": "Mana Cloak", - "MoltenQuiver": "Molten Quiver", - "MoltenSkullRose": "Molten Skull Rose", - "ObsidianSkullRose": "Obsidian Skull Rose", - "ReconScope": "Recon Scope", - "StalkersQuiver": "Stalker's Quiver", - "StingerNecklace": "Stinger Necklace", - "UltrabrightHelmet": "Ultrabright Helmet", - "Apple": "Apple", - "ApplePieSlice": "Apple Pie Slice", - "ApplePie": "Apple Pie", - "BananaSplit": "Banana Split", - "BBQRibs": "BBQ Ribs", - "BunnyStew": "Bunny Stew", - "Burger": "Burger", - "ChickenNugget": "Chicken Nugget", - "ChocolateChipCookie": "Chocolate Chip Cookie", - "CreamSoda": "Cream Soda", - "Escargot": "Escargot", - "FriedEgg": "Fried Egg", - "Fries": "Fries", - "GoldenDelight": "Golden Delight", - "Grapes": "Grapes", - "GrilledSquirrel": "Grilled Squirrel", - "Hotdog": "Hotdog", - "IceCream": "Ice Cream", - "Milkshake": "Milkshake", - "Nachos": "Nachos", - "Pizza": "Pizza", - "PotatoChips": "Potato Chips", - "RoastedBird": "Roasted Bird", - "RoastedDuck": "Roasted Duck", - "SauteedFrogLegs": "Sauteed Frog Legs", - "SeafoodDinner": "Seafood Dinner", - "ShrimpPoBoy": "Shrimp Po' Boy", - "Spaghetti": "Spaghetti", - "Steak": "Steak", - "MoltenCharm": "Molten Charm", - "GolfCup": "Golf Cup", - "FlowerPacketBlue": "Blue Flower Seeds", - "FlowerPacketMagenta": "Magenta Flower Seeds", - "FlowerPacketPink": "Pink Flower Seeds", - "FlowerPacketRed": "Red Flower Seeds", - "FlowerPacketYellow": "Yellow Flower Seeds", - "FlowerPacketViolet": "Violet Flower Seeds", - "FlowerPacketWhite": "White Flower Seeds", - "FlowerPacketTallGrass": "Tall Grass Seeds", - "SandBoots": "Dunerider Boots", - "AncientChisel": "Ancient Chisel", - "CarbonGuitar": "Rain Song", - "SkeletonBow": "Skull Bow", - "FossilPickaxe": "Fossil Pickaxe", - "SuperStarCannon": "Super Star Shooter", - "ThunderSpear": "Storm Spear", - "ThunderStaff": "Thunder Zapper", - "DrumSet": "Drum Set", - "PicnicTable": "Picnic Table", - "PicnicTableWithCloth": "Fancy Picnic Table", - "DesertMinecart": "Desert Minecart", - "FishMinecart": "Minecarp", - "GolfClubIron": "Golf Club (Iron)", - "GolfClubPutter": "Golf Club (Putter)", - "GolfClubWedge": "Golf Club (Wedge)", - "GolfClubDriver": "Golf Club (Driver)", - "GolfWhistle": "Golf Whistle", - "GolfTee": "Golf Tee", - "FairyCritterPink": "Pink Fairy", - "FairyCritterGreen": "Green Fairy", - "FairyCritterBlue": "Blue Fairy", - "JunoniaShell": "Junonia Shell", - "LightningWhelkShell": "Lightning Whelk Shell", - "TulipShell": "Tulip Shell", - "PinWheel": "Pin Wheel", - "WeatherVane": "Weather Vane", - "VoidVault": "Void Vault", - "MusicBoxOceanAlt": "Music Box (Ocean Night)", - "MusicBoxSlimeRain": "Music Box (Slime Rain)", - "MusicBoxSpaceAlt": "Music Box (Space Day)", - "MusicBoxTownDay": "Music Box (Town Day)", - "MusicBoxTownNight": "Music Box (Town Night)", - "MusicBoxWindyDay": "Music Box (Windy Day)", - "GolfCupFlagWhite": "White Pin Flag", - "GolfCupFlagRed": "Red Pin Flag", - "GolfCupFlagGreen": "Green Pin Flag", - "GolfCupFlagBlue": "Blue Pin Flag", - "GolfCupFlagYellow": "Yellow Pin Flag", - "GolfCupFlagPurple": "Purple Pin Flag", - "ShellPileBlock": "Shell Pile", - "AntiPortalBlock": "Anti-Portal Block", - "LawnMower": "Lawn Mower", - "GolfBall": "Golf Ball", - - "ToiletEbonyWood": "Ebonwood Toilet", - "ToiletRichMahogany": "Rich Mahogany Toilet", - "ToiletPearlwood": "Pearlwood Toilet", - "ToiletLivingWood": "Living Wood Toilet", - "ToiletCactus": "Cactus Toilet", - "ToiletBone": "Bone Toilet", - "ToiletFlesh": "Flesh Toilet", - "ToiletMushroom": "Mushroom Toilet", - "ToiletSunplate": "Skyware Toilet", - "ToiletShadewood": "Shadewood Toilet", - "ToiletLihzhard": "Lihzahrd Toilet", - "ToiletDungeonBlue": "Blue Dungeon Toilet", - "ToiletDungeonGreen": "Green Dungeon Toilet", - "ToiletDungeonPink": "Pink Dungeon Toilet", - "ToiletObsidian": "Obsidian Toilet", - "ToiletFrozen": "Frozen Toilet", - "ToiletGlass": "Glass Toilet", - "ToiletHoney": "Honey Toilet", - "ToiletSteampunk": "Steampunk Toilet", - "ToiletPumpkin": "Pumpkin Toilet", - "ToiletSpooky": "Spooky Toilet", - "ToiletDynasty": "Dynasty Toilet", - "ToiletPalm": "Palm Wood Toilet", - "ToiletBoreal": "Boreal Wood Toilet", - "ToiletSlime": "Slime Toilet", - "ToiletMartian": "Martian Toilet", - "ToiletGranite": "Granite Toilet", - "ToiletMarble": "Marble Toilet", - "ToiletCrystal": "Crystal Toilet", - "ToiletSpider": "Spider Toilet", - "ToiletLesion": "Lesion Toilet", - "ToiletDiamond": "Diamond Toilet", - "MaidHead": "Maid Bonnet", - "MaidShirt": "Maid Dress", - "MaidPants": "Maid Shoes", - "VoidLens": "Void Bag", - "MaidHead2": "Pink Maid Bonnet", - "MaidShirt2": "Pink Maid Dress", - "MaidPants2": "Pink Maid Shoes", - "GolfHat": "Country Club Cap", - "GolfShirt": "Country Club Vest", - "GolfPants": "Country Club Trousers", - "GolfVisor": "Country Club Visor", - "SpiderBlock": "Spider Nest Block", - "SpiderWall": "Spider Nest Wall", - "ToiletMeteor": "Meteor Toilet", - "LesionStation": "Decay Chamber", - "ManaCloakStar": "", - "SolarBathtub": "Solar Bathtub", - "SolarBed": "Solar Bed", - "SolarBookcase": "Solar Bookcase", - "SolarDresser": "Solar Dresser", - "SolarCandelabra": "Solar Candelabra", - "SolarCandle": "Solar Candle", - "SolarChair": "Solar Chair", - "SolarChandelier": "Solar Chandelier", - "SolarChest": "Solar Chest", - "SolarClock": "Solar Clock", - "SolarDoor": "Solar Door", - "SolarLamp": "Solar Lamp", - "SolarLantern": "Solar Lantern", - "SolarPiano": "Solar Piano", - "SolarPlatform": "Solar Platform", - "SolarSink": "Solar Sink", - "SolarSofa": "Solar Sofa", - "SolarTable": "Solar Table", - "SolarWorkbench": "Solar Work Bench", - "Fake_SolarChest": "Trapped Solar Chest", - "SolarToilet": "Solar Toilet", - "VortexBathtub": "Vortex Bathtub", - "VortexBed": "Vortex Bed", - "VortexBookcase": "Vortex Bookcase", - "VortexDresser": "Vortex Dresser", - "VortexCandelabra": "Vortex Candelabra", - "VortexCandle": "Vortex Candle", - "VortexChair": "Vortex Chair", - "VortexChandelier": "Vortex Chandelier", - "VortexChest": "Vortex Chest", - "VortexClock": "Vortex Clock", - "VortexDoor": "Vortex Door", - "VortexLamp": "Vortex Lamp", - "VortexLantern": "Vortex Lantern", - "VortexPiano": "Vortex Piano", - "VortexPlatform": "Vortex Platform", - "VortexSink": "Vortex Sink", - "VortexSofa": "Vortex Sofa", - "VortexTable": "Vortex Table", - "VortexWorkbench": "Vortex Work Bench", - "Fake_VortexChest": "Trapped Vortex Chest", - "VortexToilet": "Vortex Toilet", - "NebulaBathtub": "Nebula Bathtub", - "NebulaBed": "Nebula Bed", - "NebulaBookcase": "Nebula Bookcase", - "NebulaDresser": "Nebula Dresser", - "NebulaCandelabra": "Nebula Candelabra", - "NebulaCandle": "Nebula Candle", - "NebulaChair": "Nebula Chair", - "NebulaChandelier": "Nebula Chandelier", - "NebulaChest": "Nebula Chest", - "NebulaClock": "Nebula Clock", - "NebulaDoor": "Nebula Door", - "NebulaLamp": "Nebula Lamp", - "NebulaLantern": "Nebula Lantern", - "NebulaPiano": "Nebula Piano", - "NebulaPlatform": "Nebula Platform", - "NebulaSink": "Nebula Sink", - "NebulaSofa": "Nebula Sofa", - "NebulaTable": "Nebula Table", - "NebulaWorkbench": "Nebula Work Bench", - "Fake_NebulaChest": "Trapped Nebula Chest", - "NebulaToilet": "Nebula Toilet", - "StardustBathtub": "Stardust Bathtub", - "StardustBed": "Stardust Bed", - "StardustBookcase": "Stardust Bookcase", - "StardustDresser": "Stardust Dresser", - "StardustCandelabra": "Stardust Candelabra", - "StardustCandle": "Stardust Candle", - "StardustChair": "Stardust Chair", - "StardustChandelier": "Stardust Chandelier", - "StardustChest": "Stardust Chest", - "StardustClock": "Stardust Clock", - "StardustDoor": "Stardust Door", - "StardustLamp": "Stardust Lamp", - "StardustLantern": "Stardust Lantern", - "StardustPiano": "Stardust Piano", - "StardustPlatform": "Stardust Platform", - "StardustSink": "Stardust Sink", - "StardustSofa": "Stardust Sofa", - "StardustTable": "Stardust Table", - "StardustWorkbench": "Stardust Work Bench", - "Fake_StardustChest": "Trapped Stardust Chest", - "StardustToilet": "Stardust Toilet", - "SolarBrick": "Solar Brick", - "SolarBrickWall": "Solar Brick Wall", - "VortexBrick": "Vortex Brick", - "VortexBrickWall": "Vortex Brick Wall", - "NebulaBrick": "Nebula Brick", - "NebulaBrickWall": "Nebula Brick Wall", - "StardustBrick": "Stardust Brick", - "StardustBrickWall": "Stardust Brick Wall", - - "CrackedBlueBrick": "Cracked Blue Brick", - "CrackedGreenBrick": "Cracked Green Brick", - "CrackedPinkBrick": "Cracked Pink Brick", - "FlowerPacketWild": "Wild Flower Seeds", - - "MusicBoxDayRemix": "Music Box (Day Remix)", - "GolfBallDyedBlack": "Black Golf Ball", - "GolfBallDyedBlue": "Blue Golf Ball", - "GolfBallDyedBrown": "Brown Golf Ball", - "GolfBallDyedCyan": "Cyan Golf Ball", - "GolfBallDyedGreen": "Green Golf Ball", - "GolfBallDyedLimeGreen": "Lime Golf Ball", - "GolfBallDyedOrange": "Orange Golf Ball", - "GolfBallDyedPink": "Pink Golf Ball", - "GolfBallDyedPurple": "Purple Golf Ball", - "GolfBallDyedRed": "Red Golf Ball", - "GolfBallDyedSkyBlue": "Sky Blue Golf Ball", - "GolfBallDyedTeal": "Teal Golf Ball", - "GolfBallDyedViolet": "Violet Golf Ball", - "GolfBallDyedYellow": "Yellow Golf Ball", - - "AmberHook": "Amber Hook", - "OrangePhaseblade": "Orange Phaseblade", - "OrangePhasesaber": "Orange Phasesaber", - "AmberRobe": "Amber Robe", - "OrangeStainedGlass": "Orange Stained Glass", - "OrangePressurePlate": "Orange Pressure Plate", - - "MysticCoilSnake": "Snake Charmer's Flute", - "MagicConch": "Magic Conch", - "GolfCart": "Golf Cart Keys", - - "GolfChest": "Golf Chest", - "Fake_GolfChest": "Trapped Golf Chest", - "DesertChest": "Sandstone Chest", - "Fake_DesertChest": "Trapped Sandstone Chest", - "SharpTears": "Blood Thorn", - "VampireFrogStaff": "Vampire Frog Staff", - "BloodMoonStarter": "Bloody Tear", - "DripplerFlail": "Drippler Crippler", - "GoldGoldfish": "Gold Goldfish", - "GoldGoldfishBowl": "Gold Fish Bowl", - "GoldStarryGlassBlock": "Gold Starry Block", - "BlueStarryGlassBlock": "Blue Starry Block", - "GoldStarryGlassWall": "Gold Starry Wall", - "BlueStarryGlassWall": "Blue Starry Wall", - - "Apricot": "Apricot", - "Banana": "Banana", - "BlackCurrant": "Blackcurrant", - "BloodOrange": "Blood Orange", - "Cherry": "Cherry", - "Coconut": "Coconut", - "Dragonfruit": "Dragon Fruit", - "Elderberry": "Elderberry", - "Grapefruit": "Grapefruit", - "Lemon": "Lemon", - "Mango": "Mango", - "Peach": "Peach", - "Pineapple": "Pineapple", - "Plum": "Plum", - "Rambutan": "Rambutan", - "Starfruit": "Star Fruit", - - "SandstoneBathtub": "Sandstone Bathtub", - "SandstoneBed": "Sandstone Bed", - "SandstoneBookcase": "Sandstone Bookcase", - "SandstoneDresser": "Sandstone Dresser", - "SandstoneCandelabra": "Sandstone Candelabra", - "SandstoneCandle": "Sandstone Candle", - "SandstoneChair": "Sandstone Chair", - "SandstoneChandelier": "Sandstone Chandelier", - "SandstoneClock": "Sandstone Clock", - "SandstoneDoor": "Sandstone Door", - "SandstoneLamp": "Sandstone Lamp", - "SandstoneLantern": "Sandstone Lantern", - "SandstonePiano": "Sandstone Piano", - "SandstonePlatform": "Sandstone Platform", - "SandstoneSink": "Sandstone Sink", - "SandstoneSofa": "Sandstone Sofa", - "SandstoneTable": "Sandstone Table", - "SandstoneWorkbench": "Sandstone Work Bench", - "SandstoneToilet": "Sandstone Toilet", - "BloodHamaxe": "Haemorrhaxe", - "BloodFishingRod": "Chum Caster", - "BabyBirdStaff": "Finch Staff", - "VoidMonolith": "Void Monolith", - "ArrowSign": "Arrow Sign", - "PaintedArrowSign": "Painted Arrow Sign", - "GameMasterShirt": "Master Gamer's Jacket", - "GameMasterPants": "Master Gamer's Pants", - "StarPrincessCrown": "Star Princess Crown", - "StarPrincessDress": "Star Princess Dress", - "SanguineStaff": "Sanguine Staff", - "CatBast": "Bast Statue", - - "FoodPlatter": "Plate", - "BlackDragonflyJar": "Black Dragonfly Jar", - "BlueDragonflyJar": "Blue Dragonfly Jar", - "GreenDragonflyJar": "Green Dragonfly Jar", - "OrangeDragonflyJar": "Orange Dragonfly Jar", - "RedDragonflyJar": "Red Dragonfly Jar", - "YellowDragonflyJar": "Yellow Dragonfly Jar", - "GoldDragonflyJar": "Gold Dragonfly Jar", - "BlackDragonfly": "Black Dragonfly", - "BlueDragonfly": "Blue Dragonfly", - "GreenDragonfly": "Green Dragonfly", - "OrangeDragonfly": "Orange Dragonfly", - "RedDragonfly": "Red Dragonfly", - "YellowDragonfly": "Yellow Dragonfly", - "GoldDragonfly": "Gold Dragonfly", - "DragonflyStatue": "Dragonfly Statue", - "CanOfWorms": "Can Of Worms", - "EncumberingStone": "Encumbering Stone", - - "GreenMoss": "Green Moss", - "RedMoss": "Red Moss", - "BrownMoss": "Brown Moss", - "BlueMoss": "Blue Moss", - "PurpleMoss": "Purple Moss", - "LavaMoss": "Lava Moss", - "BoulderStatue": "Boulder Statue", - "MusicBoxTitleAlt": "Music Box (Journey's Beginning)", - "MusicBoxStorm": "Music Box (Storm)", - "MusicBoxGraveyard": "Music Box (Graveyard)", - "Seagull": "Seagull", - "SeagullStatue": "Seagull Statue", - "LadyBug": "Ladybug", - "GoldLadyBug": "Gold Ladybug", - "Maggot": "Maggot", - "MaggotCage": "Maggot Cage", - "CelestialWand": "Celestial Wand", - "EucaluptusSap": "Eucalyptus Sap", - "KiteBlue": "Blue Kite", - "KiteBlueAndYellow": "Blue and Yellow Kite", - "KiteRed": "Red Kite", - "KiteRedAndYellow": "Red and Yellow Kite", - "KiteYellow": "Yellow Kite", - "Pupfish": "Pupfish", - "Grebe": "Grebe", - "Rat": "Rat", - "RatCage": "Rat Cage", - "PaperAirplaneA": "Paper Airplane", - "PaperAirplaneB": "White Paper Airplane", - "LadybugCage": "Ladybug Cage", - "BloodRainBow": "Blood Rain Bow", - "CombatBook": "Advanced Combat Techniques", - "PortableStool": "Step Stool", - "DesertTorch": "Desert Torch", - "CoralTorch": "Coral Torch", - "CorruptTorch": "Corrupt Torch", - "CrimsonTorch": "Crimson Torch", - "HallowedTorch": "Hallowed Torch", - "JungleTorch": "Jungle Torch", - "KryptonMoss": "Krypton Moss", - "XenonMoss": "Xenon Moss", - "ArgonMoss": "Argon Moss", - "RollingCactus": "Rolling Cactus", - "ScarabFish": "Scarab Fish", - "ScorpioFish": "Scorpio Fish", - "Owl": "Owl", - "OwlCage": "Owl Cage", - "OwlStatue": "Owl Statue", - "PupfishBowl": "Pupfish Bowl", - "GoldLadybugCage": "Gold Ladybug Cage", - "Flounder": "Flounder", - "RockLobster": "Rock Lobster", - "LobsterTail": "Lobster Tail", - "SpectreGoggles": "Spectre Goggles", - "Oyster": "Oyster", - "ShuckedOyster": "Shucked Oyster", - "WhitePearl": "White Pearl", - "BlackPearl": "Black Pearl", - "PinkPearl": "Pink Pearl", - "StoneDoor": "Stone Door", - "StonePlatform": "Stone Platform", - "OasisFountain": "Oasis Water Fountain", - "Geode": "Geode", - "FloatingTube": "Inner Tube", - "FrozenCrate": "Frozen Crate", - "FrozenCrateHard": "Boreal Crate", - "OasisCrate": "Oasis Crate", - "OasisCrateHard": "Mirage Crate", - "WaterStrider": "Water Strider", - "GoldWaterStrider": "Gold Water Strider", - "KiteWyvern": "Wyvern Kite", - "EchoBlock": "Echo Block", - "LawnFlamingo": "Lawn Flamingo", - "MusicBoxUndergroundJungle": "Music Box (Underground Jungle)", - "ScarabBomb": "Scarab Bomb", - "WroughtIronFence": "Wrought Iron Fence", - "BeeMinecart": "Bee Minecart", - "LadybugMinecart": "Ladybug Minecart", - "PigronMinecart": "Pigron Minecart", - "SunflowerMinecart": "Sunflower Minecart", - "ScarabFishingRod": "Scarab Fishing Rod", - "HellMinecart": "Demonic Hellcart", - "ClusterRocketI": "Cluster Rocket I", - "ClusterRocketII": "Cluster Rocket II", - "WetRocket": "Wet Rocket", - "LavaRocket": "Lava Rocket", - "HoneyRocket": "Honey Rocket", - "ShroomMinecart": "Shroom Minecart", - "AmethystMinecart": "Amethyst Minecart", - "TopazMinecart": "Topaz Minecart", - "SapphireMinecart": "Sapphire Minecart", - "EmeraldMinecart": "Emerald Minecart", - "RubyMinecart": "Ruby Minecart", - "DiamondMinecart": "Diamond Minecart", - "MiniNukeI": "Mini Nuke I", - "MiniNukeII": "Mini Nuke II", - "DryRocket": "Dry Rocket", - "SandcastleBucket": "Sandcastle Bucket", - "Turtle": "Turtle", - "TurtleJungle": "Jungle Turtle", - "TurtleStatue": "Turtle Statue", - "TurtleCage": "Turtle Cage", - "TurtleJungleCage": "Jungle Turtle Cage", - "PottedForestCedar": "Potted Forest Cedar", - "PottedJungleCedar": "Potted Jungle Cedar", - "PottedHallowCedar": "Potted Hallow Cedar", - "PottedForestTree": "Potted Forest Tree", - "PottedJungleTree": "Potted Jungle Tree", - "PottedHallowTree": "Potted Hallow Tree", - "PottedForestPalm": "Potted Forest Palm", - "PottedJunglePalm": "Potted Jungle Palm", - "PottedHallowPalm": "Potted Hallow Palm", - "PottedForestBamboo": "Potted Forest Bamboo", - "PottedJungleBamboo": "Potted Jungle Bamboo", - "PottedHallowBamboo": "Potted Hallow Bamboo", - "AmberMinecart": "Amber Minecart", - "GrebeCage": "Grebe Cage", - "SeagullCage": "Seagull Cage", - "WaterStriderCage": "Water Strider Cage", - "GoldWaterStriderCage": "Gold Water Strider Cage", - "BeetleMinecart": "Beetle Minecart", - "MeowmereMinecart": "Meowmere Minecart", - "PartyMinecart": "Party Wagon", - "PirateMinecart": "The Dutchman", - "SteampunkMinecart": "Steampunk Minecart", - "Grate": "Grate", - "LuckPotionLesser": "Lesser Luck Potion", - "LuckPotion": "Luck Potion", - "LuckPotionGreater": "Greater Luck Potion", - "Terragrim": "Terragrim", - "Seahorse": "Seahorse", - "SeahorseCage": "Seahorse Cage", - "GoldSeahorse": "Gold Seahorse", - "GoldSeahorseCage": "Gold Seahorse Cage", - "TimerOneHalfSecond": "1/2 Second Timer", - "TimerOneFourthSecond": "1/4 Second Timer", - "WitchBroom": "Witch's Broom", - "TheBrideBanner": "The Bride Banner", - "ZombieMermanBanner": "Zombie Merman Banner", - "EyeballFlyingFishBanner": "Wandering Eye Fish Banner", - "BloodSquidBanner": "Blood Squid Banner", - "BloodEelBanner": "Blood Eel Banner", - "GoblinSharkBanner": "Hemogoblin Shark Banner", - "EbonstoneEcho": "Ebonstone Wall", - "MudWallEcho": "Mud Wall", - "PearlstoneEcho": "Pearlstone Wall", - "SnowWallEcho": "Snow Wall", - "AmethystEcho": "Amethyst Stone Wall", - "TopazEcho": "Topaz Stone Wall", - "SapphireEcho": "Sapphire Stone Wall", - "EmeraldEcho": "Emerald Stone Wall", - "RubyEcho": "Ruby Stone Wall", - "DiamondEcho": "Diamond Stone Wall", - "Cave1Echo": "Green Mossy Wall", - "Cave2Echo": "Brown Mossy Wall", - "Cave3Echo": "Red Mossy Wall", - "Cave4Echo": "Blue Mossy Wall", - "Cave5Echo": "Purple Mossy Wall", - "Cave6Echo": "Rocky Dirt Wall", - "Cave7Echo": "Old Stone Wall", - "SpiderEcho": "Spider Wall", - "CorruptGrassEcho": "Corrupt Grass Wall", - "HallowedGrassEcho": "Hallowed Grass Wall", - "IceEcho": "Ice Wall", - "ObsidianBackEcho": "Obsidian Wall", - "CrimsonGrassEcho": "Crimson Grass Wall", - "CrimstoneEcho": "Crimstone Wall", - "CaveWall1Echo": "Cave Dirt Wall", - "CaveWall2Echo": "Rough Dirt Wall", - "Cave8Echo": "Craggy Stone Wall", - "Corruption1Echo": "Corrupt Growth Wall", - "Corruption2Echo": "Corrupt Mass Wall", - "Corruption3Echo": "Corrupt Pustule Wall", - "Corruption4Echo": "Corrupt Tendril Wall", - "Crimson1Echo": "Crimson Crust Wall", - "Crimson2Echo": "Crimson Scab Wall", - "Crimson3Echo": "Crimson Teeth Wall", - "Crimson4Echo": "Crimson Blister Wall", - "Dirt1Echo": "Layered Dirt Wall", - "Dirt2Echo": "Crumbling Dirt Wall", - "Dirt3Echo": "Cracked Dirt Wall", - "Dirt4Echo": "Wavy Dirt Wall", - "Hallow1Echo": "Hallowed Prism Wall", - "Hallow2Echo": "Hallowed Cavern Wall", - "Hallow3Echo": "Hallowed Shard Wall", - "Hallow4Echo": "Hallowed Crystalline Wall", - "Jungle1Echo": "Lichen Stone Wall", - "Jungle2Echo": "Leafy Jungle Wall", - "Jungle3Echo": "Ivy Stone Wall", - "Jungle4Echo": "Jungle Vine Wall", - "Lava1Echo": "Ember Wall", - "Lava2Echo": "Cinder Wall", - "Lava3Echo": "Magma Wall", - "Lava4Echo": "Smouldering Stone Wall", - "Rocks1Echo": "Worn Stone Wall", - "Rocks2Echo": "Stalactite Stone Wall", - "Rocks3Echo": "Mottled Stone Wall", - "Rocks4Echo": "Fractured Stone Wall", - "GolfTrophyBronze": "Bronze Golf Trophy", - "GolfTrophySilver": "Silver Golf Trophy", - "GolfTrophyGold": "Gold Golf Trophy", - "GolfClubStoneIron": "Worn Golf Club (Iron)", - "GolfClubRustyPutter": "Worn Golf Club (Putter)", - "GolfClubBronzeWedge": "Worn Golf Club (Wedge)", - "GolfClubWoodDriver": "Worn Golf Club (Driver)", - "GolfClubMythrilIron": "Fancy Golf Club (Iron)", - "GolfClubLeadPutter": "Fancy Golf Club (Putter)", - "GolfClubGoldWedge": "Fancy Golf Club (Wedge)", - "GolfClubPearlwoodDriver": "Fancy Golf Club (Driver)", - "GolfClubTitaniumIron": "Premium Golf Club (Iron)", - "GolfClubShroomitePutter": "Premium Golf Club (Putter)", - "GolfClubDiamondWedge": "Premium Golf Club (Wedge)", - "GolfClubChlorophyteDriver": "Premium Golf Club (Driver)", - "BloodNautilusBanner": "Dreadnautilus Banner", - "MusicBoxJungleNight": "Music Box (Jungle Night)", - "BirdieRattle": "Birdie Rattle", - "ExoticEasternChewToy": "Exotic Chew Toy", - "BedazzledNectar": "Bedazzled Nectar", - "BambooBlock": "Bamboo", - "BambooBlockWall": "Bamboo Wall", - "LargeBambooBlock": "Large Bamboo", - "LargeBambooBlockWall": "Large Bamboo Wall", - "BambooBathtub": "Bamboo Bathtub", - "BambooBed": "Bamboo Bed", - "BambooBookcase": "Bamboo Bookcase", - "BambooDresser": "Bamboo Dresser", - "BambooCandelabra": "Bamboo Candelabra", - "BambooCandle": "Bamboo Candle", - "BambooChair": "Bamboo Chair", - "BambooChandelier": "Bamboo Chandelier", - "BambooChest": "Bamboo Chest", - "BambooClock": "Bamboo Clock", - "BambooDoor": "Bamboo Door", - "BambooLamp": "Bamboo Lamp", - "BambooLantern": "Bamboo Lantern", - "BambooPiano": "Bamboo Piano", - "BambooPlatform": "Bamboo Platform", - "BambooSink": "Bamboo Sink", - "BambooSofa": "Bamboo Sofa", - "BambooTable": "Bamboo Table", - "BambooWorkbench": "Bamboo Work Bench", - "Fake_BambooChest": "Trapped Bamboo Chest", - "BambooToilet": "Bamboo Toilet", - "DemonHorns": "Demon Horns", - "BunnyEars": "Bunny Ears", - "DevilHorns": "Devil Horns", - "Fedora": "Fedora", - "ChefHat": "Chef Hat", - "ChefShirt": "Chef Uniform", - "ChefPants": "Chef Pants", - "MarbleColumn": "Marble Column", - "PlasmaLamp": "Plasma Lamp", - "HellCake": "Slice of Hell Cake", - "ChumBucket": "Chum Bucket", - "GardenGnome": "Garden Gnome", - "KiteBoneSerpent": "Bone Serpent Kite", - "KiteWorldFeeder": "World Feeder Kite", - "KiteBunny": "Bunny Kite", - "StarHairpin": "Star Hairpin", - "HeartHairpin": "Heart Hairpin", - "BambooLeaf": "Bamboo Leaf", - "KitePigron": "Pigron Kite", - "AppleJuice": "Apple Juice", - "GrapeJuice": "Grape Juice", - "Lemonade": "Lemonade", - "BananaDaiquiri": "Frozen Banana Daiquiri", - "PeachSangria": "Peach Sangria", - "PinaColada": "Piña Colada", - "TropicalSmoothie": "Tropical Smoothie", - "BloodyMoscato": "Bloody Moscato", - "SmoothieofDarkness": "Smoothie of Darkness", - "PrismaticPunch": "Prismatic Punch", - "FruitJuice": "Fruit Juice", - "FruitSalad": "Fruit Salad", - "SharkBait": "Shark Bait", - "AndrewSphinx": "Andrew Sphinx", - "WatchfulAntlion": "Watchful Antlion", - "BurningSpirit": "Burning Spirit", - "JawsOfDeath": "Jaws of Death", - "TheSandsOfSlime": "The Sands of Slime", - "SnakesIHateSnakes": "Snakes, I Hate Snakes", - "LifeAboveTheSand": "Life Above the Sand", - "Oasis": "Oasis", - "PrehistoryPreserved": "Prehistory Preserved", - "AncientTablet": "Ancient Tablet", - "Uluru": "Uluru", - "VisitingThePyramids": "Visiting the Pyramids", - "BandageBoy": "Bandage Boy", - "DivineEye": "Divine Eye", - "AmethystStoneBlock": "Amethyst Stone Block", - "TopazStoneBlock": "Topaz Stone Block", - "SapphireStoneBlock": "Sapphire Stone Block", - "EmeraldStoneBlock": "Emerald Stone Block", - "RubyStoneBlock": "Ruby Stone Block", - "DiamondStoneBlock": "Diamond Stone Block", - "AmberStoneBlock": "Amber Stone Block", - "AmberStoneWallEcho": "Amber Stone Wall", - "KiteManEater": "Man Eater Kite", - "KiteJellyfishBlue": "Blue Jellyfish Kite", - "KiteJellyfishPink": "Pink Jellyfish Kite", - "KiteShark": "Shark Kite", - "SuperHeroMask": "Superhero Mask", - "SuperHeroCostume": "Superhero Costume", - "SuperHeroTights": "Superhero Tights", - "PinkFairyJar": "Pink Fairy Jar", - "GreenFairyJar": "Green Fairy Jar", - "BlueFairyJar": "Blue Fairy Jar", - "FogMachine": "Fog Machine", - "GolfPainting1": "The Rolling Greens", - "GolfPainting2": "Study of a Ball at Rest", - "GolfPainting3": "Fore!", - "GolfPainting4": "The Duplicity of Reflections", - "Gladius": "Gladius", - "IvyGuitar": "Ivy", - "PrettyPinkDressSkirt": "Pretty Pink Dress", - "PrettyPinkDressPants": "Pretty Pink Stockings", - "UnicornHornHat": "Fake Unicorn Horn", - "PrettyPinkRibbon": "Pretty Pink Ribbon", - "BambooFence": "Bamboo Fence", - "KiteSandShark": "Sand Shark Kite", - "ThinIce": "Thin Ice", - "KiteBunnyCorrupt": "Corrupt Bunny Kite", - "KiteBunnyCrimson": "Crimson Bunny Kite", - "StormTigerStaff": "Desert Tiger Staff", - "DrumStick": "Drumstick", - "KiteGoldfish": "Goldfish Kite", - "FogboundDye": "Fogbound Dye", - "BloodbathDye": "Bloodbath Dye", - "GlowPaint": "Illuminant Paint", - "KiteAngryTrapper": "Angry Trapper Kite", - "KiteKoi": "Koi Kite", - "KiteCrawltipede": "Crawltipede Kite", - "KiteSpectrum": "Spectrum Kite", - "KiteWanderingEye": "Wandering Eye Kite", - "KiteUnicorn": "Unicorn Kite", - "DandelionBanner": "Angry Dandelion Banner", - "GnomeBanner": "Gnome Banner", - "UndertakerHat": "Gravedigger Hat", - "UndertakerCoat": "Gravedigger Coat", - "DesertCampfire": "Desert Campfire", - "CoralCampfire": "Coral Campfire", - "CorruptCampfire": "Corrupt Campfire", - "CrimsonCampfire": "Crimson Campfire", - "HallowedCampfire": "Hallowed Campfire", - "JungleCampfire": "Jungle Campfire", - "SoulBottleLight": "Soul of Light in a Bottle", - "SoulBottleNight": "Soul of Night in a Bottle", - "SoulBottleFlight": "Soul of Flight in a Bottle", - "SoulBottleSight": "Soul of Sight in a Bottle", - "SoulBottleMight": "Soul of Might in a Bottle", - "SoulBottleFright": "Soul of Fright in a Bottle", - "MudBud": "Mud Bud", - "ReleaseDoves": "Release Doves", - "ReleaseLantern": "Release Lantern", - "QuadBarrelShotgun": "Quad-Barrel Shotgun", - "FuneralHat": "Funeral Hat", - "FuneralCoat": "Funeral Coat", - "FuneralPants": "Funeral Pants", - "TragicUmbrella": "Tragic Umbrella", - "VictorianGothHat": "Victorian Goth Hat", - "VictorianGothDress": "Victorian Goth Dress", - "TatteredWoodSign": "Tattered Wood Sign", - "GravediggerShovel": "Gravedigger's Shovel", - "DungeonDesertChest": "Desert Chest", - "Fake_DungeonDesertChest": "Trapped Desert Chest", - "DungeonDesertKey": "Desert Key", - "MolluskWhistle": "Mollusk Whistle", - "BorealBeam": "Boreal Beam", - "RichMahoganyBeam": "Rich Mahogany Beam", - "GraniteColumn": "Granite Column", - "SandstoneColumn": "Sandstone Column", - "MushroomBeam": "Mushroom Beam", - "Nevermore": "Nevermore", - "Reborn": "Reborn", - "Graveyard": "Graveyard", - "GhostManifestation": "Ghost Manifestation", - "WickedUndead": "Wicked Undead", - "BloodyGoblet": "Bloody Goblet", - "StillLife": "Still Life", - "TerraToilet": "Terra Toilet", - "GhostarsWings": "Ghostar’s Infinity Eight", - "GhostarSkullPin": "Ghostar’s Soul Jar", - "GhostarShirt": "Ghostar’s Garb", - "GhostarPants": "Ghostar’s Tights", - "BallOfFuseWire": "Ball O' Fuse Wire", - "FullMoonSqueakyToy": "Full Moon Squeaky Toy", - "OrnateShadowKey": "Ornate Shadow Key", - "DrManFlyMask": "Dr. Man Fly Mask", - "DrManFlyLabCoat": "Dr. Man Fly's Lab Coat", - "ButcherMask": "Butcher Mask", - "ButcherApron": "Butcher's Bloodstained Apron", - "ButcherPants": "Butcher's Bloodstained Pants", - "Football": "Football", - "CoffinMinecart": "Coffin Minecart", - "FoodBarbarianWings": "FoodBarbarian's Tattered Dragon Wings", - "FoodBarbarianHelm": "FoodBarbarian's Horned Helm", - "FoodBarbarianArmor": "FoodBarbarian's Wild Wolf Spaulders", - "FoodBarbarianGreaves": "FoodBarbarian's Savage Greaves", - "SafemanWings": "Safeman's Blanket Cape", - "SafemanSunHair": "Safeman's Sunny Day", - "SafemanSunDress": "Safeman's Sun Dress", - "SafemanDressLeggings": "Safeman's Pink Leggings", - "GroxTheGreatWings": "Grox The Great's Wings", - "GroxTheGreatHelm": "Grox The Great's Horned Cowl", - "GroxTheGreatArmor": "Grox The Great's Chestplate", - "GroxTheGreatGreaves": "Grox The Great's Greaves", - "SparkleGuitar": "Stellar Tune", - "SquirrelHook": "Squirrel Hook", - "RockGolemHead": "Rock Golem Head", - "CritterShampoo": "Critter Shampoo", - "Shroomerang": "Shroomerang", - "DontHurtCrittersBook": "Guide To Critter Companionship", - "DogEars": "Dog Ears", - "DogTail": "Dog Tail", - "FoxEars": "Fox Ears", - "FoxTail": "Fox Tail", - "LizardEars": "Lizard Ears", - "LizardTail": "Lizard Tail", - "PandaEars": "Panda Ears", - "BunnyTail": "Bunny Tail", - "FairyGlowstick": "Fairy Glowstick", - "LightningCarrot": "Lightning Carrot", - "MushroomHat": "Mushroom Hat", - "MushroomVest": "Mushroom Vest", - "MushroomPants": "Mushroom Pants", - "HunterCloak": "Hunter Cloak", - "ZapinatorGray": "Gray Zapinator", - "ZapinatorOrange": "Orange Zapinator", - "TreeGlobe": "Tree Globe", - "WorldGlobe": "World Globe", - "CombatWrench": "Combat Wrench", - "PaintedHorseSaddle": "Dusty Rawhide Saddle", - "MajesticHorseSaddle": "Royal Gilded Saddle", - "DarkHorseSaddle": "Black Studded Saddle", - "JoustingLance": "Jousting Lance", - "ShadowJoustingLance": "Shadow Jousting Lance", - "HallowJoustingLance": "Hallowed Jousting Lance", - "DemonConch": "Demon Conch", - "BottomlessLavaBucket": "Bottomless Lava Bucket", - "FireproofBugNet": "Lavaproof Bug Net", - "FlameWakerBoots": "Flame Waker Boots", - "WetBomb": "Wet Bomb", - "LavaBomb": "Lava Bomb", - "HoneyBomb": "Honey Bomb", - "DryBomb": "Dry Bomb", - "LicenseCat": "Cat License", - "LicenseDog": "Dog License", - "GemSquirrelAmethyst": "Amethyst Squirrel", - "GemSquirrelTopaz": "Topaz Squirrel", - "GemSquirrelSapphire": "Sapphire Squirrel", - "GemSquirrelEmerald": "Emerald Squirrel", - "GemSquirrelRuby": "Ruby Squirrel", - "GemSquirrelDiamond": "Diamond Squirrel", - "GemSquirrelAmber": "Amber Squirrel", - "GemBunnyAmethyst": "Amethyst Bunny", - "GemBunnyTopaz": "Topaz Bunny", - "GemBunnySapphire": "Sapphire Bunny", - "GemBunnyEmerald": "Emerald Bunny", - "GemBunnyRuby": "Ruby Bunny", - "GemBunnyDiamond": "Diamond Bunny", - "GemBunnyAmber": "Amber Bunny", - "HellButterfly": "Hell Butterfly", - "HellButterflyJar": "Hell Butterfly Jar", - "Lavafly": "Lavafly", - "LavaflyinaBottle": "Lavafly in a Bottle", - "MagmaSnail": "Magma Snail", - "MagmaSnailCage": "Magma Snail Cage", - "GemTreeTopazSeed": "Topaz Gemcorn", - "GemTreeAmethystSeed": "Amethyst Gemcorn", - "GemTreeSapphireSeed": "Sapphire Gemcorn", - "GemTreeEmeraldSeed": "Emerald Gemcorn", - "GemTreeRubySeed": "Ruby Gemcorn", - "GemTreeDiamondSeed": "Diamond Gemcorn", - "GemTreeAmberSeed": "Amber Gemcorn", - "LavaAbsorbantSponge": "Lava Absorbant Sponge", - "HallowedHood": "Hallowed Hood", - "LavaCrate": "Obsidian Crate", - "LavaCrateHard": "Hellstone Crate", - "PotSuspended": "Hanging Pot", - "PotSuspendedDaybloom": "Hanging Daybloom", - "PotSuspendedMoonglow": "Hanging Moonglow", - "PotSuspendedWaterleaf": "Hanging Waterleaf", - "PotSuspendedShiverthorn": "Hanging Shiverthorn", - "PotSuspendedBlinkroot": "Hanging Blinkroot", - "PotSuspendedDeathweedCorrupt": "Hanging Corrupt Deathweed", - "PotSuspendedDeathweedCrimson": "Hanging Crimson Deathweed", - "PotSuspendedFireblossom": "Hanging Fireblossom", - "BrazierSuspended": "Hanging Brazier", - "ObsidianLockbox": "Obsidian Lock Box", - "SuperheatedBlood": "Superheated Blood", - "VolcanoSmall": "Mini Volcano", - "VolcanoLarge": "Large Volcano", - "LavaFishingHook": "Lavaproof Fishing Hook", - "PotionOfReturn": "Potion of Return", - "AmethystBunnyCage": "Amethyst Bunny Cage", - "TopazBunnyCage": "Topaz Bunny Cage", - "SapphireBunnyCage": "Sapphire Bunny Cage", - "EmeraldBunnyCage": "Emerald Bunny Cage", - "RubyBunnyCage": "Ruby Bunny Cage", - "DiamondBunnyCage": "Diamond Bunny Cage", - "AmberBunnyCage": "Amber Bunny Cage", - "AmethystSquirrelCage": "Amethyst Squirrel Cage", - "TopazSquirrelCage": "Topaz Squirrel Cage", - "SapphireSquirrelCage": "Sapphire Squirrel Cage", - "EmeraldSquirrelCage": "Emerald Squirrel Cage", - "RubySquirrelCage": "Ruby Squirrel Cage", - "DiamondSquirrelCage": "Diamond Squirrel Cage", - "AmberSquirrelCage": "Amber Squirrel Cage", - "AncientHallowedMask": "Ancient Hallowed Mask", - "AncientHallowedHelmet": "Ancient Hallowed Helmet", - "AncientHallowedHeadgear": "Ancient Hallowed Headgear", - "AncientHallowedHood": "Ancient Hallowed Hood", - "AncientHallowedPlateMail": "Ancient Hallowed Plate Mail", - "AncientHallowedGreaves": "Ancient Hallowed Greaves", - "VanityTreeSakuraSeed": "Sakura Sapling", - "PottedLavaPlantPalm": "Potted Magma Palm", - "PottedLavaPlantBush": "Potted Brimstone Bush", - "PottedLavaPlantBramble": "Potted Fire Brambles", - "PottedLavaPlantBulb": "Potted Lava Bulb", - "PottedLavaPlantTendrils": "Potted Ember Tendrils", - "HellfireTreads": "Hellfire Treads", - "LavaFishbowl": "Lava Serpent Bowl", - "VanityTreeYellowWillowSeed": "Yellow Willow Sapling", - "PirateShipMountItem": "The Black Spot", - "SpookyWoodMountItem": "Hexxed Branch", - "SantankMountItem": "Toy Tank", - "WallOfFleshGoatMountItem": "Goat Skull", - "DarkMageBookMountItem": "Dark Mage's Tome", - "KingSlimePetItem": "Royal Delight", - "EyeOfCthulhuPetItem": "Suspicious Grinning Eye", - "EaterOfWorldsPetItem": "Writhing Remains", - "BrainOfCthulhuPetItem": "Brain in a Jar", - "SkeletronPetItem": "Possessed Skull", - "QueenBeePetItem": "Sparkling Honey", - "DestroyerPetItem": "Deactivated Probe", - "TwinsPetItem": "Pair of Eyeballs", - "SkeletronPrimePetItem": "Robotic Skull", - "PlanteraPetItem": "Plantera Seedling", - "GolemPetItem": "Guardian Golem", - "DukeFishronPetItem": "Pork of the Sea", - "LunaticCultistPetItem": "Tablet Fragment", - "MoonLordPetItem": "Piece of Moon Squid", - "FairyQueenPetItem": "Jewel of Light", - "PumpkingPetItem": "Pumpkin Scented Candle", - "EverscreamPetItem": "Shrub Star", - "IceQueenPetItem": "Frozen Crown", - "MartianPetItem": "Cosmic Skateboard", - "DD2OgrePetItem": "Ogre's Club", - "DD2BetsyPetItem": "Betsy's Egg", - "PogoStick": "Pogo Stick", - "LicenseBunny": "Bunny License", - "TungstenBullet": "Tungsten Bullet", - "TeleportationPylonJungle": "Jungle Pylon", - "TeleportationPylonPurity": "Forest Pylon", - "TeleportationPylonHallow": "Hallow Pylon", - "TeleportationPylonUnderground": "Cavern Pylon", - "TeleportationPylonOcean": "Ocean Pylon", - "TeleportationPylonDesert": "Desert Pylon", - "TeleportationPylonSnow": "Snow Pylon", - "TeleportationPylonMushroom": "Mushroom Pylon", - "CavernFountain": "Cavern Water Fountain", - "FairyQueenBossBag": "Treasure Bag", - "FairyQueenTrophy": "Empress of Light Trophy", - "FairyQueenMask": "Empress of Light Mask", - "EyeofCthulhuMasterTrophy": "Eye of Cthulhu Relic", - "EaterofWorldsMasterTrophy": "Eater of Worlds Relic", - "BrainofCthulhuMasterTrophy": "Brain of Cthulhu Relic", - "SkeletronMasterTrophy": "Skeletron Relic", - "QueenBeeMasterTrophy": "Queen Bee Relic", - "KingSlimeMasterTrophy": "King Slime Relic", - "WallofFleshMasterTrophy": "Wall of Flesh Relic", - "TwinsMasterTrophy": "Twins Relic", - "DestroyerMasterTrophy": "Destroyer Relic", - "SkeletronPrimeMasterTrophy": "Skeletron Prime Relic", - "PlanteraMasterTrophy": "Plantera Relic", - "GolemMasterTrophy": "Golem Relic", - "DukeFishronMasterTrophy": "Duke Fishron Relic", - "LunaticCultistMasterTrophy": "Lunatic Cultist Relic", - "MoonLordMasterTrophy": "Moon Lord Relic", - "UFOMasterTrophy": "Martian Saucer Relic", - "FlyingDutchmanMasterTrophy": "Flying Dutchman Relic", - "MourningWoodMasterTrophy": "Mourning Wood Relic", - "PumpkingMasterTrophy": "Pumpking Relic", - "IceQueenMasterTrophy": "Ice Queen Relic", - "EverscreamMasterTrophy": "Everscream Relic", - "SantankMasterTrophy": "Santa-NK1 Relic", - "DarkMageMasterTrophy": "Dark Mage Relic", - "OgreMasterTrophy": "Ogre Relic", - "BetsyMasterTrophy": "Betsy Relic", - "FairyQueenMasterTrophy": "Empress of Light Relic", - "QueenSlimeMasterTrophy": "Queen Slime Relic", - "TeleportationPylonVictory": "Victory Pylon", - "HallowBossDye": "Prismatic Dye", - "RainbowWings": "Empress Wings", - "DirtBomb": "Dirt Bomb", - "DirtStickyBomb": "Sticky Dirt Bomb", - "QueenSlimeBossBag": "Treasure Bag", - "QueenSlimeTrophy": "Queen Slime Trophy", - "QueenSlimeMask": "Queen Slime Mask", - "QueenSlimePetItem": "Regal Delicacy", - "AccentSlab": "Stone Accent Slab", - "EmpressButterfly": "Prismatic Lacewing", - "TruffleWormCage": "Truffle Worm Cage", - "EmpressButterflyJar": "Prismatic Lacewing Jar", - "RockGolemBanner": "Rock Golem Banner", - "BloodMummyBanner": "Blood Mummy Banner", - "SporeSkeletonBanner": "Spore Skeleton Banner", - "SporeBatBanner": "Spore Bat Banner", - "LarvaeAntlionBanner": "Antlion Larva Banner", - "CrimsonBunnyBanner": "Vicious Bunny Banner", - "CrimsonGoldfishBanner": "Vicious Goldfish Banner", - "CrimsonPenguinBanner": "Vicious Penguin Banner", - "BigMimicCorruptionBanner": "Corrupt Mimic Banner", - "BigMimicCrimsonBanner": "Crimson Mimic Banner", - "BigMimicHallowBanner": "Hallowed Mimic Banner", - "MossHornetBanner": "Moss Hornet Banner", - "WanderingEyeBanner": "Wandering Eye Banner", - "CreativeWings": "Fledgling Wings", - "MusicBoxQueenSlime": "Music Box (Queen Slime)", - "BouncingShield": "Sergeant United Shield", - "DiggingMoleMinecart": "Digging Molecart", - "BlandWhip": "Leather Whip", - "MaceWhip": "Morning Star", - "ScytheWhip": "Dark Harvest", - "SwordWhip": "Durendal", - "ThornWhip": "Snapthorn", - "FireWhip": "Firecracker", - "CoolWhip": "Cool Whip", - "RainbowWhip": "Kaleidoscope", - "MusicBoxEmpressOfLight": "Music Box (Empress Of Light)", - "CrystalNinjaHelmet": "Crystal Assassin Hood", - "CrystalNinjaChestplate": "Crystal Assassin Shirt", - "CrystalNinjaLeggings": "Crystal Assassin Pants", - "QueenSlimeMountSaddle": "Gelatinous Pillion", - "QueenSlimeHook": "Hook of Dissonance", - "Smolstar": "Blade Staff", - "PiercingStarlight": "Starlight", - "FairyQueenMagicItem": "Nightglow", - "FairyQueenRangedItem": "Eventide", - "RabbitOrder": "Rabbit Perch", - "TeleportationPylonVictory": "Universal Pylon", - "QueenSlimeCrystal": "Gelatin Crystal", - "EmpressFlightBooster": "Soaring Insignia", - "VolatileGelatin": "Volatile Gelatin", - "GelBalloon": "Sparkle Slime Balloon", - "MusicBoxDukeFishron": "Music Box (Duke Fishron)", - "MusicBoxMorningRain": "Music Box (Morning Rain)", - "MusicBoxConsoleTitle": "Music Box (Alt Title)", - "Zenith": "Zenith", - "ChippysCouch": "Chippy's Couch", - "GraduationCapBlue": "Blue Graduation Cap", - "GraduationCapMaroon": "Maroon Graduation Cap", - "GraduationCapBlack": "Black Graduation Cap", - "GraduationGownBlue": "Blue Graduation Gown", - "GraduationGownMaroon": "Maroon Graduation Gown", - "GraduationGownBlack": "Black Graduation Gown", - "LongRainbowTrailWings": "Celestial Starboard", - "TerrasparkBoots": "Terraspark Boots", - "OceanCrate": "Ocean Crate", - "OceanCrateHard": "Seaside Crate", - "MusicBoxUndergroundDesert": "Music Box (Underground Desert)", - "BadgersHat": "Badger's Hat", - "DeadMansSweater": "Dead Man's Sweater", - "TeaKettle": "Teapot", - "Teacup": "Teacup", - "EmpressBlade": "Terraprisma", - "MoonLordLegs": "Moon Lord Legs", - "TreasureMagnet": "Treasure Magnet", - "Mace": "Mace", - "FlamingMace": "Flaming Mace", - "MusicBoxOWRain": "Otherworldly Music Box (Rain)", - "MusicBoxOWDay": "Otherworldly Music Box (Overworld Day)", - "MusicBoxOWNight": "Otherworldly Music Box (Night)", - "MusicBoxOWUnderground": "Otherworldly Music Box (Underground)", - "MusicBoxOWDesert": "Otherworldly Music Box (Desert)", - "MusicBoxOWOcean": "Otherworldly Music Box (Ocean)", - "MusicBoxOWMushroom": "Otherworldly Music Box (Mushrooms)", - "MusicBoxOWDungeon": "Otherworldly Music Box (Dungeon)", - "MusicBoxOWSpace": "Otherworldly Music Box (Space)", - "MusicBoxOWUnderworld": "Otherworldly Music Box (Underworld)", - "MusicBoxOWSnow": "Otherworldly Music Box (Snow)", - "MusicBoxOWCorruption": "Otherworldly Music Box (Corruption)", - "MusicBoxOWUndergroundCorruption": "Otherworldly Music Box (Underground Corruption)", - "MusicBoxOWCrimson": "Otherworldly Music Box (Crimson)", - "MusicBoxOWUndergroundCrimson": "Otherworldly Music Box (Underground Crimson)", - "MusicBoxOWUndergroundSnow": "Otherworldly Music Box (Ice)", - "MusicBoxOWUndergroundHallow": "Otherworldly Music Box (Underground Hallow)", - "MusicBoxOWBloodMoon": "Otherworldly Music Box (Eerie)", - "MusicBoxOWBoss2": "Otherworldly Music Box (Boss 2)", - "MusicBoxOWBoss1": "Otherworldly Music Box (Boss 1)", - "MusicBoxOWInvasion": "Otherworldly Music Box (Invasion)", - "MusicBoxOWTowers": "Otherworldly Music Box (The Towers)", - "MusicBoxOWMoonLord": "Otherworldly Music Box (Lunar Boss)", - "MusicBoxOWPlantera": "Otherworldly Music Box (Plantera)", - "MusicBoxOWJungle": "Otherworldly Music Box (Jungle)", - "MusicBoxOWWallOfFlesh": "Otherworldly Music Box (Wall of Flesh)", - "MusicBoxOWHallow": "Otherworldly Music Box (Hallow)", - "MilkCarton": "Carton of Milk", - "CoffeeCup": "Coffee", - "TorchGodsFavor": "Torch God's Favor", - "MusicBoxCredits": "Music Box (Journey's End)", + "BossBagBetsy": "{$ItemName.SkeletronBossBag}" }, "ItemTooltip": { "ShadowGreaves": "7% increased melee speed", @@ -5208,7 +4055,7 @@ "Paintbrush": "Used with paint to color blocks", "PaintRoller": "Used with paint to color walls", "ManaCrystal": "Permanently increases maximum mana by 20", - "PaintScraper": "Used to remove paint\nCan sometimes collect moss", + "PaintScraper": "Used to remove paint", "TealMushroom": "Used to make Teal Dye", "GreenMushroom": "Used to make Green Dye", "SkyBlueFlower": "Used to make Sky Blue Dye", @@ -5232,7 +4079,7 @@ "MagicMissile": "Casts a controllable missile", "Beenade": "Explodes into a swarm of bees", "GravityGlobe": "Allows the holder to reverse gravity\nPress UP to change gravity", - "HoneyComb": "Releases bees after taking damage", + "HoneyComb": "Releases bees when damaged", "Abeemination": "Summons the Queen Bee", "DirtRod": "Magically moves dirt", "TempleKey": "Opens the jungle temple door", @@ -5241,12 +4088,11 @@ "LihzahrdPressurePlate": "Activates when a player steps on it", "PiranhaGun": "Latches on to enemies for continuous damage", "PygmyStaff": "Summons a Pygmy to fight for you", - "PygmyNecklace": "Increases your max number of minions by 1", - "TikiMask": "Increases your max number of minions by 1\nIncreases minion damage by 10%", - "TikiShirt": "Increases your max number of minions by 1\nIncreases minion damage by 10%", - "TikiPants": "Increases your max number of minions by 1\nIncreases minion damage by 10%", + "PygmyNecklace": "Increases your max number of minions", + "TikiMask": "Increases your max number of minions\nIncreases minion damage by 10%", + "TikiShirt": "Increases your max number of minions\nIncreases minion damage by 10%", + "TikiPants": "Increases your max number of minions\nIncreases minion damage by 10%", "LeafWings": "{$CommonItemTooltip.FlightAndSlowfall}", - "BetsyWings": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", "BlizzardinaBalloon": "Allows the holder to double jump\nIncreases jump height", "BundleofBalloons": "Allows the holder to quadruple jump\nIncreases jump height", "BatWings": "{$CommonItemTooltip.FlightAndSlowfall}", @@ -5294,18 +4140,18 @@ "MeteorSuit": "7% increased magic damage", "AmberMosquito": "Summons a Baby Dinosaur", "NimbusRod": "Summons a cloud to rain down on your foes", - "BeeCloak": "Causes stars to fall and releases bees after taking damage", + "BeeCloak": "Causes stars to fall and releases bees when injured", "EyeoftheGolem": "10% increased critical strike chance", "HoneyBalloon": "Increases jump height\nReleases bees when damaged", "MeteorLeggings": "7% increased magic damage", "BlueHorseshoeBalloon": "Allows the holder to double jump\nIncreases jump height and negates fall damage", "WhiteHorseshoeBalloon": "Allows the holder to double jump\nIncreases jump height and negates fall damage", "YellowHorseshoeBalloon": "Allows the holder to double jump\nIncreases jump height and negates fall damage", - "FrozenTurtleShell": "Puts a shell around the owner when below 50% life that reduces damage by 25%", + "FrozenTurtleShell": "Puts a shell around the owner when below 50% life that reduces damage", "SniperRifle": "Shoots a powerful, high velocity bullet\n to zoom out", "VenusMagnum": "Shoots a powerful, high velocity bullet", "CrimsonRod": "Summons a cloud to rain blood on your foes", - "Stynger": "Shoots an explosive bolt\nDoes extra damage on a direct hit", + "Stynger": "Shoots an explosive bolt", "FlowerPow": "Shoots razor sharp flower petals at nearby enemies", "RainbowGun": "Shoots a rainbow that does continuous damage", "StyngerBolt": "Explodes into deadly shrapnel", @@ -5318,11 +4164,11 @@ "EmeraldRobe": "Increases maximum mana by 60\nReduces mana usage by 11%", "RubyRobe": "Increases maximum mana by 60\nReduces mana usage by 13%", "DiamondRobe": "Increases maximum mana by 80\nReduces mana usage by 15%", - "PanicNecklace": "Increases movement speed after taking damage", + "PanicNecklace": "Increases movement speed after being struck", "LifeFruit": "Permanently increases maximum life by 5", "LihzahrdPowerCell": "Used at the Lihzahrd Altar", "Picksaw": "Capable of mining Lihzahrd Bricks", - "HeatRay": "Shoots a scorching ray of heat\n'Oolaa!!'", + "HeatRay": "Shoots a piercing ray of heat\n'Oolaa!!'", "StaffofEarth": "Summons a powerful boulder", "GolemFist": "Punches with the force of a golem", "Binoculars": "Increases view range when held", @@ -5342,8 +4188,8 @@ "TurtleHelmet": "6% increased melee damage\nEnemies are more likely to target you", "TurtleScaleMail": "8% increased melee damage and critical strike chance\nEnemies are more likely to target you", "TurtleLeggings": "4% increased melee critical strike chance\nEnemies are more likely to target you", - "MagicQuiver": "Increases arrow damage by 10% and greatly increases arrow speed\n20% chance to not consume arrows", - "MagmaStone": "Melee attacks inflict fire damage", + "MagicQuiver": "Increases damage by 10% and greatly increases arrow speed\n20% chance to not consume arrows", + "MagmaStone": "Inflicts fire damage on attack", "ObsidianRose": "Reduces damage from touching lava", "RodofDiscord": "Teleports you to the position of the mouse", "DeathSickle": "Shoots a deathly sickle", @@ -5353,6 +4199,7 @@ "IchorArrow": "Decreases target's defense", "IchorBullet": "Decreases target's defense", "GoldenShower": "Sprays a shower of ichor\nDecreases target's defense", + "FireGauntlet": "Increases melee knockback and inflicts fire damage on attack\n10% increased melee damage and speed", "ImbuingStation": "Used to craft weapon imbuement flasks", "EmptyBullet": "Used to craft various types of ammo", "ShadowbeamStaff": "Creates a shadow beam that bounces off walls", @@ -5366,29 +4213,32 @@ "SpectreHood": "40% decreased magic damage", "SpectreRobe": "7% increased magic damage and critical strike chance", "SpectrePants": "8% increased magic damage\n8% increased movement speed", + "NecroHelmet": "5% increased ranged damage.", "PaladinsHammer": "A powerful returning hammer", "BeeWings": "{$CommonItemTooltip.FlightAndSlowfall}", + "NecroBreastplate": "5% increased ranged damage.", "LargeAmethyst": "For Capture the Gem. It drops when you die", "LargeTopaz": "For Capture the Gem. It drops when you die", "LargeSapphire": "For Capture the Gem. It drops when you die", "LargeEmerald": "For Capture the Gem. It drops when you die", "LargeRuby": "For Capture the Gem. It drops when you die", "LargeDiamond": "For Capture the Gem. It drops when you die", + "NecroGreaves": "5% increased ranged damage.", "JungleKey": "Unlocks a Jungle Chest in the dungeon", "CorruptionKey": "Unlocks a Corruption Chest in the dungeon", "CrimsonKey": "Unlocks a Crimson Chest in the dungeon", "HallowedKey": "Unlocks a Hallowed Chest in the dungeon", - "FrozenKey": "Unlocks an Ice Chest in the dungeon", + "FrozenKey": "Unlocks a Frozen Chest in the dungeon", "SpectrePaintbrush": "Used with paint to color blocks", "SpectrePaintRoller": "Used with paint to color walls", - "SpectrePaintScraper": "Used to remove paint\nCan sometimes collect moss", + "SpectrePaintScraper": "Used to remove paint", "ShroomiteHeadgear": "15% increased arrow damage\n5% increased ranged critical strike chance", "ShroomiteMask": "15% increased bullet damage\n5% increased ranged critical strike chance", "ShroomiteHelmet": "15% increased rocket damage\n5% increased ranged critical strike chance", - "ShroomiteBreastplate": "13% increased ranged damage & critical strike chance\n20% chance to not consume ammo", + "ShroomiteBreastplate": "13% increased ranged critical strike chance\n20% chance to not consume ammo", "ShroomiteLeggings": "7% increased ranged critical strike chance\n12% increased movement speed", "Autohammer": "Converts Chlorophyte Bars into Shroomite Bars", - "SDMG": "66% chance to not consume ammo\n'It came from the edge of space'", + "SDMG": "50% chance to not consume ammo\n'It came from the edge of space'", "CenxsTiara": "{$CommonItemTooltip.DevItem}", "CenxsBreastplate": "{$CommonItemTooltip.DevItem}", "CenxsLeggings": "{$CommonItemTooltip.DevItem}", @@ -5408,17 +4258,17 @@ "VampireKnives": "Rapidly throw life stealing daggers", "AquaScepter": "Sprays out a shower of water", "ScourgeoftheCorruptor": "A powerful javelin that unleashes tiny eaters", - "StaffoftheFrostHydra": "{$CommonItemTooltip.Sentry}\nSummons a powerful frost hydra to spit ice at your enemies", + "StaffoftheFrostHydra": "Summons a powerful frost hydra to spit ice at your enemies", "SweetheartNecklace": "Releases bees and increases movement speed when damaged", "FlurryBoots": "The wearer can run super fast", "LuckyHorseshoe": "Negates fall damage", "DTownsHelmet": "{$CommonItemTooltip.DevItem}", "DTownsBreastplate": "{$CommonItemTooltip.DevItem}", "DTownsLeggings": "{$CommonItemTooltip.DevItem}", - "DTownsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", - "WillsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", - "CrownosWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", - "CenxsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "DTownsWings": "{$CommonItemTooltip.DevItem}", + "WillsWings": "{$CommonItemTooltip.DevItem}", + "CrownosWings": "{$CommonItemTooltip.DevItem}", + "CenxsWings": "{$CommonItemTooltip.DevItem}", "CenxsDress": "{$CommonItemTooltip.DevItem}", "CenxsDressPants": "{$CommonItemTooltip.DevItem}", "ShinyRedBalloon": "Increases jump height", @@ -5427,7 +4277,7 @@ "AnkhCharm": "Grants immunity to most debuffs", "AnkhShield": "Grants immunity to knockback and fire blocks\nGrants immunity to most debuffs", "WaterBolt": "Casts a slow moving bolt of water", - "Bomb": "A small explosion that will destroy most tiles", + "Bomb": "A small explosion that will destroy some tiles", "Dynamite": "A large explosion that will destroy most tiles", "Grenade": "A small explosion that will not destroy tiles", "GoldWatch": "Tells the time", @@ -5439,6 +4289,7 @@ "GoodieBag": "{$CommonItemTooltip.RightClickToOpen}", "CandyCornRifle": "33% chance to not consume ammo", "Sickle": "Allows the collection of hay from grass", + "PumpkinPie": "{$CommonItemTooltip.MinorStats}", "TatteredFairyWings": "{$CommonItemTooltip.FlightAndSlowfall}", "SpiderEgg": "Summons a pet spider", "MagicalPumpkinSeed": "Summons a pet squashling", @@ -5454,32 +4305,35 @@ "UnluckyYarn": "Summons a black kitty", "TheHorsemansBlade": "Summons Pumpkin heads to attack your enemies", "SpookyWings": "{$CommonItemTooltip.FlightAndSlowfall}", - "SpookyHelmet": "Increases your max number of minions by 1\nIncreases minion damage by 11%", - "SpookyBreastplate": "Increases your max number of minions by 2\nIncreases minion damage by 11%", - "SpookyLeggings": "Increases your max number of minions by 1\nIncreases minion damage by 11%\n20% increased movement speed", + "SpookyHelmet": "Increases your max number of minions\nIncreases minion damage by 11%", + "SpookyBreastplate": "Increases your max number of minions\nIncreases minion damage by 11%", + "SpookyLeggings": "Increases your max number of minions\nIncreases minion damage by 11%", "CursedSapling": "Summons a cursed sapling to follow you", "PumpkinMoonMedallion": "Summons the Pumpkin Moon", - "NecromanticScroll": "Increases your max number of minions by 1\nIncreases minion damage by 10%", + "NecromanticScroll": "Increases your max number of minions\nIncreases minion damage by 10%", "SniperScope": "Increases view range for guns ( to zoom out)\n10% increased ranged damage and critical strike chance", "BreathingReed": "Increases breath time and allows breathing in water", "JellyfishDivingGear": "Grants the ability to swim and greatly extends underwater breathing\nProvides light under water", "ArcticDivingGear": "Grants the ability to swim and greatly extends underwater breathing\nProvides light under water and extra mobility on ice", - "FrostsparkBoots": "Allows flight, super fast running, and extra mobility on ice\n8% increased movement speed", + "FrostsparkBoots": "Allows flight, super fast running, and extra mobility on ice\n7% increased movement speed", "FartInABalloon": "Allows the holder to double jump\nIncreases jump height", - "PapyrusScarab": "Increases your max number of minions by 1\nIncreases the damage and knockback of your minions", - "CelestialStone": "Minor increase to damage, melee speed, critical strike chance,\nlife regeneration, defense, mining speed, and minion knockback", - "Hoverboard": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", + "PapyrusScarab": "Increases your max number of minions\nIncreases the damage and knockback of your minions", + "CelestialStone": "Minor increase to damage, melee speed, critical strike chance,\nlife regeneration, defense, pick speed, and minion knockback", + "Hoverboard": "{$CommonItemTooltip.FlightAndSlowfall}\nHold DOWN and JUMP to hover", "Present": "{$CommonItemTooltip.RightClickToOpen}", "Flipper": "Grants the ability to swim", "RedRyder": "'Don't shoot your eye out!'", "FestiveWings": "{$CommonItemTooltip.FlightAndSlowfall}", "BladeofGrass": "Has a chance to poison enemies", "EldMelter": "Uses gel for ammo", + "ChristmasPudding": "{$CommonItemTooltip.MinorStats}", "ReindeerBells": "Summons a rideable reindeer", "CnadyCanePickaxe": "Can mine Meteorite", + "SugarCookie": "{$CommonItemTooltip.MinorStats}", + "GingerbreadCookie": "{$CommonItemTooltip.MinorStats}", "HandWarmer": "Provides immunity to chill and freezing effects", "Coal": "'You've been naughty this year'", - "Toolbox": "Increases block placement & tool range by 1", + "Toolbox": "Increases item placement and tool range by 1", "DogWhistle": "Summons a Puppy", "ChristmasTreeSword": "Shoots Christmas ornaments", "ChainGun": "50% chance to not consume ammo", @@ -5495,7 +4349,7 @@ "JungleRose": "'It's pretty, oh so pretty'", "FeralClaws": "12% increased melee speed", "AnkletoftheWind": "10% increased movement speed", - "StaffofRegrowth": "Creates grass on dirt\nIncreases alchemy plant collection when used to gather", + "StaffofRegrowth": "Creates grass and moss on dirt and stone\nIncreases alchemy plant collection when used to gather", "WhoopieCushion": "'May annoy others'", "HeavyWorkBench": "Used for advanced crafting", "AmmoBox": "Reduces ammo usage by 20%", @@ -5516,7 +4370,7 @@ "SteampunkBoiler": "{$CommonItemTooltip.SpecialCrafting}", "HoneyDispenser": "{$CommonItemTooltip.SpecialCrafting}", "BrickLayer": "Increases tile placement speed", - "ExtendoGrip": "Increases block placement & tool range by 3", + "ExtendoGrip": "Increases tile reach", "PaintSprayer": "Automatically paints placed objects", "PortableCementMixer": "Increases wall placement speed", "CelestialMagnet": "Increases pickup range for mana stars", @@ -5525,6 +4379,8 @@ "CelestialCuffs": "Increases pickup range for mana stars\nRestores mana when damaged", "PulseBow": "Shoots a charged arrow", "NaturesGift": "6% reduced mana usage", + "PadThai": "{$CommonItemTooltip.MinorStats}", + "Pho": "{$CommonItemTooltip.MinorStats}", "RestorationPotion": "Reduced potion cooldown", "Gatligator": "50% chance to not consume ammo\nHighly inaccurate", "WaterGun": "Squirts a harmless stream of water", @@ -5537,14 +4393,14 @@ "Gel": "'Both tasty and flammable'", "JunglePants": "Increases maximum mana by 20\n4% increased magic critical strike chance", "NeonTetra": "'Its colorful scales could sell well.'", - "GoldenCarp": "Quite shiny. This will probably sell well.", + "GoldenCarp": "Quite shiny. This will probably sell well.", "MiningPotion": "Increases mining speed by 25%", "HeartreachPotion": "Increases pickup range for life hearts", - "CalmingPotion": "Decreases enemy spawn rate", + "CalmingPotion": "Reduces enemy aggression", "BuilderPotion": "Increases placement speed and range", "TitanPotion": "Increases knockback", "FlipperPotion": "Lets you move swiftly in liquids", - "SummoningPotion": "Increases your max number of minions by 1", + "SummoningPotion": "Increases your max number of minions", "TrapsightPotion": "Allows you to see nearby danger sources", "WoodenCrate": "{$CommonItemTooltip.RightClickToOpen}", "IronCrate": "{$CommonItemTooltip.RightClickToOpen}", @@ -5555,33 +4411,36 @@ "RagePotion": "Increases critical chance by 10%", "InfernoPotion": "Ignites nearby enemies", "WrathPotion": "Increases damage by 10%", - "StickyBomb": "A small explosion that will destroy most tiles\n'Tossing may be difficult.'", + "StickyBomb": "'Tossing may be difficult.'", "RecallPotion": "Teleports you home", "TeleportationPotion": "Teleports you to a random location", "LovePotion": "Throw this to make someone fall in love", "StinkPotion": "Throw this to make someone smell terrible", - "FishingPotion": "Increases fishing power", + "FishingPotion": "Increases fishing skill", "SonarPotion": "Detects hooked fish", "CratePotion": "Increases chance to get a crate", "WarmthPotion": "Reduces damage from cold sources", - "BeeHeadgear": "Increases minion damage by 4%\nIncreases your max number of minions by 1", - "BeeBreastplate": "Increases minion damage by 4%\nIncreases your max number of minions by 1", + "BeeHeadgear": "Increases minion damage by 4%\nIncreases your max number of minions", + "BeeBreastplate": "Increases minion damage by 4%\nIncreases your max number of minions", "BeeGreaves": "Increases minion damage by 5%", "HornetStaff": "Summons a hornet to fight for you", "ImpStaff": "Summons an imp to fight for you", - "AnglerHat": "Increases fishing power", - "AnglerVest": "Increases fishing power", - "AnglerPants": "Increases fishing power", + "AnglerHat": "Increases fishing level", + "AnglerVest": "Increases fishing level", + "AnglerPants": "Increases fishing level", "Sunglasses": "'Makes you look cool!'", - "SpiderMask": "Increases your max number of minions by 1\nIncreases minion damage by 5%", - "SpiderBreastplate": "Increases your max number of minions by 1\nIncreases minion damage by 5%", - "SpiderGreaves": "Increases your max number of minions by 1\nIncreases minion damage by 6%", + "SpiderMask": "Increases your max number of minions\nIncreases minion damage by 6%", + "SpiderBreastplate": "Increases your max number of minions\nIncreases minion damage by 6%", + "SpiderGreaves": "Increases your max number of minions\nIncreases minion damage by 6%", "HighTestFishingLine": "Fishing line will never break", - "AnglerEarring": "Increases fishing power", + "AnglerEarring": "Increases fishing skill", "TackleBox": "Decreases chance of bait consumption", "WizardHat": "15% increased magic damage", "ZephyrFish": "Summons a pet Zephyr Fish", "FrogLeg": "Increases jump speed and allows auto-jump\nIncreases fall resistance", + "CookedFish": "{$CommonItemTooltip.MinorStats}", + "CookedShrimp": "{$CommonItemTooltip.MinorStats}", + "Sashimi": "{$CommonItemTooltip.MinorStats}", "FinWings": "{$CommonItemTooltip.FlightAndSlowfall}", "OpticStaff": "Summons twins to fight for you", "RedHat": "It smells funny...", @@ -5604,7 +4463,7 @@ "MagicPowerPotion": "20% increased magic damage", "FeatherfallPotion": "Slows falling speed", "SpelunkerPotion": "Shows the location of treasure and ore", - "InvisibilityPotion": "Grants invisibility and lowers the spawn rate of enemies", + "InvisibilityPotion": "Grants invisibility", "ShinePotion": "Emits an aura of light", "NightOwlPotion": "Increases night vision", "BattlePotion": "Increases enemy spawn rate", @@ -5614,12 +4473,13 @@ "HunterPotion": "Shows the location of enemies", "GravitationPotion": "Allows the control of gravity", "IllegalGunParts": "'Banned in most places'", - "GoldenKey": "Opens one locked Gold Chest or Lock Box", - "ShadowKey": "Opens all Shadow Chests and Obsidian Lock Boxes", + "GoldenKey": "Opens one Gold or Dungeon Chest", + "ShadowKey": "Opens all Shadow Chests", "Furnace": "Used for smelting ore", "Loom": "Used for crafting cloth", "IronAnvil": "Used to craft items from metal bars", "Keg": "Used for brewing ale", + "BowlofSoup": "{$CommonItemTooltip.MinorStats}", "WorkBench": "Used for basic crafting", "GoblinBattleStandard": "Summons a Goblin Army", "Sawmill": "Used for advanced wood crafting", @@ -5646,13 +4506,14 @@ "AdamantiteBreastplate": "6% increased damage", "AdamantiteLeggings": "4% increased critical strike chance\n5% increased movement speed", "SpectreBoots": "Allows flight\nThe wearer can run super fast", - "Toolbelt": "Increases block placement range by 1", + "Toolbelt": "Increases block placement range", "HolyWater": "Spreads the Hallow to some blocks", - "UnholyWater": "Spreads the Corruption to some blocks", + "UnholyWater": "Spreads the corruption to some blocks", "FairyBell": "Summons a magical fairy", "SuspiciousLookingEye": "Summons the Eye of Cthulhu", "ClockworkAssaultRifle": "Three round burst\nOnly the first shot consumes ammo", "MoonCharm": "Turns the holder into a werewolf at night", + "Ruler": "Creates measurement lines on screen for block placement", "SorcererEmblem": "15% increased magic damage", "BandofRegeneration": "Slowly regenerates life", "WarriorEmblem": "15% increased melee damage", @@ -5678,15 +4539,16 @@ "AdamantiteForge": "Used to smelt adamantite and titanium ore", "MythrilAnvil": "Used to craft items from mythril, orichalcum, adamantite, and titanium bars", "UnicornHorn": "'Sharp and magical!'", - "DarkShard": "'Sometimes carried by creatures in dark deserts'", + "DarkShard": "'Sometimes carried by creatures in corrupt deserts'", "LightShard": "'Sometimes carried by creatures in light deserts'", "RedPressurePlate": "Activates when stepped on", "CloudinaBottle": "Allows the holder to double jump", "SpellTome": "Can be enchanted", - "StarCloak": "Causes stars to fall after taking damage", + "StarCloak": "Causes stars to fall when injured", "Megashark": "50% chance to not consume ammo\n'Minishark's older brother'", "Shotgun": "Fires a spread of bullets", - "PhilosophersStone": "Reduces the cooldown of healing potions by 25%", + "PhilosophersStone": "Reduces the cooldown of healing potions", + "TitanGlove": "Increases melee knockback", "HermesBoots": "The wearer can run super fast", "GreenPressurePlate": "Activates when stepped on", "GrayPressurePlate": "Activates when a player steps on it", @@ -5700,10 +4562,10 @@ "HallowedHelmet": "15% increased ranged damage\n8% increased ranged critical strike chance", "CrossNecklace": "Increases length of invincibility after taking damage", "ManaFlower": "8% reduced mana usage\nAutomatically use mana potions when needed", - "MechanicalWorm": "Summons The Destroyer", + "MechanicalWorm": "Summons Destroyer", "MechanicalSkull": "Summons Skeletron Prime", "HallowedHeadgear": "Increases maximum mana by 100\n12% increased magic damage and critical strike chance", - "HallowedMask": "10% increased melee damage and critical strike chance\n10% increased melee speed", + "HallowedMask": "10% increased melee damage and critical strike chance\n10% increased melee haste", "DemoniteOre": "'Pulsing with dark energy'", "SlimeCrown": "Summons King Slime", "LightDisc": "Stacks up to 5", @@ -5725,14 +4587,14 @@ "Vilethorn": "Summons a vile thorn", "Starfury": "Causes stars to rain from the sky\n'Forged with the fury of heaven'", "PurificationPowder": "Cleanses the evil", - "RedsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "RedsWings": "{$CommonItemTooltip.DevItem}", "RedsHelmet": "{$CommonItemTooltip.DevItem}", "RedsBreastplate": "{$CommonItemTooltip.DevItem}", "RedsLeggings": "{$CommonItemTooltip.DevItem}", "Fish": "Summons a baby penguin", - "VilePowder": "Spreads the Corruption", + "VilePowder": "Banishes the Hallow", "Frostbrand": "Shoots an icy bolt", - "RedPotion": "'Only for those who are worthy'", + "RedPotion": "Only for those who are worthy", "RottenChunk": "'Looks tasty!'", "UnholyTrident": "Summons the Devil's trident", "FrostHelmet": "16% increased melee and ranged damage", @@ -5747,7 +4609,7 @@ "IceBlade": "Shoots an icy bolt", "IceBow": "Shoots frost arrows", "FrostStaff": "Shoots a stream of frost", - "Jetpack": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressUpToBooster}", + "Jetpack": "{$CommonItemTooltip.FlightAndSlowfall}\nHold UP to rocket faster", "ButterflyWings": "{$CommonItemTooltip.FlightAndSlowfall}", "FallenStar": "Disappears after the sunrise", "Seaweed": "Summons a pet turtle", @@ -5778,14 +4640,14 @@ "GreenWrench": "Places green wire", "BluePressurePlate": "Activates when a player steps on it", "YellowPressurePlate": "Activates when anything but a player steps on it", - "DiscountCard": "Shops prices lowered by 20%", + "DiscountCard": "Shops have lower prices", "LuckyCoin": "Hitting enemies will sometimes drop extra coins", "UnicornonaStick": "'Having a wonderful time!'", "SandstorminaBottle": "Allows the holder to do an improved double jump", - "CharmofMyths": "Provides life regeneration and reduces the cooldown of healing potions by 25%", + "CharmofMyths": "Provides life regeneration and reduces the cooldown of healing potions", "MoonShell": "Turns the holder into a werewolf at night and a merfolk when entering water", "StarVeil": "Causes stars to fall and increases length of invincibility after taking damage", - "WaterWalkingBoots": "Provides the ability to walk on water & honey", + "WaterWalkingBoots": "Provides the ability to walk on water", "MiningHelmet": "Provides light when worn", "AdhesiveBandage": "Immunity to Bleeding", "ArmorPolish": "Immunity to Broken Armor", @@ -5796,32 +4658,35 @@ "Nazar": "Immunity to Curse", "Vitamins": "Immunity to Weakness", "TrifoldMap": "Immunity to Confusion", - "LightningBoots": "Allows flight, super fast running\n8% increased movement speed", - "SunStone": "If worn during the day, grants minor increase to damage, melee speed, critical strike chance,\nlife regeneration, defense, mining speed, and minion knockback", - "MoonStone": "If worn during the night, grants minor increase to damage, melee speed, critical strike chance,\nlife regeneration, defense, mining speed, and minion knockback", + "PowerGlove": "Increases melee knockback\n12% increased melee speed", + "LightningBoots": "Allows flight\nThe wearer can run incredibly fast", + "SunStone": "Increases all stats if worn during the day", + "MoonStone": "Increases all stats if worn during the night", "ArmorBracing": "Immunity to Weakness and Broken Armor", "MedicatedBandage": "Immunity to Poison and Bleeding", "ThePlan": "Immunity to Slow and Confusion", "CountercurseMantra": "Immunity to Silence and Curse", "CoinGun": "Uses coins for ammo\nHigher valued coins do more damage", "LavaCharm": "Provides 7 seconds of immunity to lava", - "ObsidianWaterWalkingBoots": "Provides the ability to walk on water & honey\nGrants immunity to fire blocks", - "LavaWaders": "Provides the ability to walk on water, honey & lava\nGrants immunity to fire blocks and 7 seconds of immunity to lava", + "ObsidianWaterWalkingBoots": "Provides the ability to walk on water\nGrants immunity to fire blocks", + "LavaWaders": "Provides the ability to walk on water and lava\nGrants immunity to fire blocks and 7 seconds of immunity to lava", "BoneWand": "Places bone", "LeafWand": "Places leaves", "FlyingCarpet": "Allows the owner to float for a few seconds", "AvengerEmblem": "12% increased damage", + "MechanicalGlove": "Increases melee knockback\n12% increased damage and melee speed", "LandMine": "Explodes when stepped on", - "PaladinsShield": "Absorbs 25% of damage done to players on your team when above 25% life\nGrants immunity to knockback", + "PaladinsShield": "Absorbs 25% of damage done to players on your team\nOnly active above 25% life", "Umbrella": "You will fall slower while holding this", "ChlorophyteOre": "'Reacts to the light'", - "SteampunkWings": "{$CommonItemTooltip.FlightAndSlowfall}", + "SteampunkWings": "Allows flight and slowfall", "IceSkates": "Provides extra mobility on ice\nIce will not break when you fall on it", "SnowballLauncher": "Rapidly launches snowballs", "ClimbingClaws": "Allows the ability to slide down walls\nImproved ability if combined with Shoe Spikes", "AncientShadowHelmet": "7% increased melee speed", "AncientShadowScalemail": "7% increased melee speed", "AncientShadowGreaves": "7% increased melee speed", + "AncientNecroHelmet": "5% increased ranged damage.", "AncientCobaltHelmet": "Increases maximum mana by 40\n4% increased magic critical strike chance", "AncientCobaltBreastplate": "Increases maximum mana by 20\n4% increased magic critical strike chance", "AncientCobaltLeggings": "Increases maximum mana by 20\n4% increased magic critical strike chance", @@ -5829,8 +4694,9 @@ "Boomstick": "Fires a spread of bullets", "Rope": "Can be climbed on", "Campfire": "Life regen is increased when near a campfire", - "Marshmallow": "Put it on a stick and roast over a campfire\n{$CommonItemTooltip.MinorStats}\n'How many can you fit in your mouth?'", + "Marshmallow": "Put it on a stick and roast over a campfire", "MarshmallowonaStick": "Roast it over a campfire!", + "CookedMarshmallow": "{$CommonItemTooltip.MinorStats}", "ShoeSpikes": "Allows the ability to slide down walls\nImproved ability if combined with Climbing Claws", "TigerClimbingGear": "Allows the ability to climb walls", "Tabi": "Allows the ability to dash\nDouble tap a direction", @@ -5846,18 +4712,19 @@ "EatersBone": "Summons a Baby Eater of Souls", "BlendOMatic": "Used to craft objects", "MeatGrinder": "Used to craft objects", - "Extractinator": "Placing silt/slush/fossil piles into the extractinator turns them into something more useful", + "Extractinator": "Turns silt/slush/fossils into something more useful\n'To use: Place silt/slush/fossils in the extractinator'", "Solidifier": "Used to craft objects", "ActuationAccessory": "Automatically places actuators on placed objects", "ActuationRod": "Activates Actuators", "AlchemyTable": "33% chance to not consume potion crafting ingredients", "AncientBattleArmorHat": "15% increased magic and minion damage", - "AncientBattleArmorPants": "Increases maximum mana by 40\nIncreases your max number of minions by 1", - "AncientBattleArmorShirt": "Increases maximum mana by 40\nIncreases your max number of minions by 1", + "AncientBattleArmorPants": "Increases your max number of minions", + "AncientBattleArmorShirt": "Increases maximum mana by 80", "AncientHorn": "Summons a rideable basilisk mount", - "AnglerTackleBag": "Fishing line will never break, Decreases chance of bait consumption, Increases fishing power", - "ArchitectGizmoPack": "Increases block & wall placement speed\nIncreases block placement & tool range by 3\nAutomatically paints placed objects", + "AnglerTackleBag": "Fishing line will never break, Decreases chance of bait consumption, Increases fishing skill", + "ArchitectGizmoPack": "Increases tile and wall placement speed and reach\nAutomatically paints placed objects", "AviatorSunglasses": "Enables your inner wingman\n'Great for impersonating streamers!'", + "Bacon": "{$CommonItemTooltip.MinorStats}\n'Bacon? Bacon.'", "BalloonHorseshoeFart": "Allows the holder to double jump\nIncreases jump height and negates fall damage", "BalloonHorseshoeHoney": "Releases bees when damaged\nIncreases jump height and negates fall damage", "BalloonHorseshoeSharkron": "Allows the holder to double jump\nIncreases jump height and negates fall damage", @@ -5865,26 +4732,26 @@ "BeesKnees": "Wooden arrows turn into a column of bees", "BejeweledValkyrieBody": "{$CommonItemTooltip.DevItem}\nBejeweled and elegant for soaring through the thundering skies", "BejeweledValkyrieHead": "{$CommonItemTooltip.DevItem}\nBecome the wind, ride the lightning.", - "BejeweledValkyrieWing": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}\nThe Valkyrie Satellite Barrier Platform is totally safe. Most of the time.", + "BejeweledValkyrieWing": "{$CommonItemTooltip.DevItem}\nThe Valkyrie Satellite Barrier Platform is totally safe. Most of the time.", "BewitchingTable": " to have more minions", "Bladetongue": "Spits an Ichor stream on contact", "BlessedApple": "Summons a rideable unicorn mount", - "BloodWater": "Spreads the Crimson to some blocks", - "BombFish": "A small explosion that will destroy most tiles", + "BloodWater": "Spreads the crimson to some blocks", + "BombFish": "A small explosion that will destroy some tiles", "BoneCampfire": "Life regen is increased when near a campfire", "BoneRattle": "Summons a Baby Face Monster", "BoneTorch": "'Emits a deathly glow'", "BoosterTrack": "Hammer to change direction", - "BottomlessBucket": "Contains an endless amount of water\nCan be poured out", - "BouncyBomb": "A small explosion that will destroy most tiles\nVery bouncy", - "BouncyDynamite": "A large explosion that will destroy most tiles\n'This will prove to be a terrible idea'", + "BottomlessBucket": "Contains an endless amount of water", + "BouncyBomb": "A small explosion that will destroy some tiles\nVery bouncy", + "BouncyDynamite": "'This will prove to be terrible idea'", "BouncyGlowstick": "Works when wet", "BouncyGrenade": "A small explosion that will not destroy tiles\nVery bouncy", - "BrainOfConfusion": "Has a chance to create illusions and dodge an attack\nTemporarily increase critical chance after dodge\nMay confuse nearby enemies after being struck", + "BrainOfConfusion": "May confuse nearby enemies after being struck", "BrainScrambler": "Summons a rideable Scutlix mount", "BubbleGun": "Rapidly shoots forceful bubbles", "ButchersChainsaw": "Sparks emit from struck enemies", - "CelestialShell": "Turns the holder into a werewolf at night and a merfolk when entering water\nMinor increase to damage, melee speed, critical strike chance,\nlife regeneration, defense, mining speed, and minion knockback", + "CelestialShell": "Turns the holder into a werewolf at night and a merfolk when entering water\nMinor increases to all stats", "CelestialSigil": "Summons the Impending Doom", "CellPhone": "Displays everything\nAllows you to return home at will", "ClingerStaff": "Summons a wall of cursed flames", @@ -5918,6 +4785,9 @@ "FloatingIslandFishingCrate": "{$CommonItemTooltip.RightClickToOpen}", "FlowerBoots": "Flowers grow on the grass you walk on", "FlyingKnife": "Throws a controllable flying knife", + "FossilHelm": "20% increased throwing velocity", + "FossilPants": "15% increased throwing critical strike chance", + "FossilShirt": "20% increased throwing damage", "FragmentNebula": "'The power of a galaxy resides within this fragment'", "FragmentSolar": "'The fury of the universe lies within this fragment'", "FragmentStardust": "'Entrancing particles revolve around this fragment'", @@ -5934,7 +4804,8 @@ "GoblinTech": "Displays movement speed, damage per second, and valuable ore", "GoldPickaxe": "Can mine Meteorite", "GoldRing": "Increases coin pickup range", - "GreedyRing": "Increases coin pickup range and shops prices lowered by 20%\nHitting enemies will sometimes drop extra coins", + "GreedyRing": "Increases coin pickup range and shops have lower prices\nHitting enemies will sometimes drop extra coins", + "GrubSoup": "{$CommonItemTooltip.MinorStats}", "HallowedFishingCrate": "{$CommonItemTooltip.RightClickToOpen}", "HardySaddle": "Summons a rideable Turtle mount", "HellwingBow": "Wooden arrows turn into flaming bats", @@ -5943,7 +4814,7 @@ "HoneyedGoggles": "Summons a rideable Bee mount", "IceMirror": "Gaze in the mirror to return home", "IchorCampfire": "Life regen is increased when near a campfire", - "JimsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "JimsWings": "{$CommonItemTooltip.DevItem}", "JungleFishingCrate": "{$CommonItemTooltip.RightClickToOpen}", "LargeAmber": "For Capture the Gem. It drops when you die", "LaserRuler": "Creates measurement lines on screen for block placement", @@ -5971,7 +4842,7 @@ "LokisHelm": "{$CommonItemTooltip.DevItem}\nDisorder came from order, fear came from courage, weakness came from strength", "LokisPants": "{$CommonItemTooltip.DevItem}\nWheels of justice grind slow but grind fine.", "LokisShirt": "{$CommonItemTooltip.DevItem}\nKnow thy self, know thy enemy. A thousand battles, a thousand victories…", - "LokisWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}\nLet your plans be dark and impenetrable as night, and when you move, fall like a thunderbolt.", + "LokisWings": "{$CommonItemTooltip.DevItem}\nLet your plans be dark and impenetrable as night, and when you move, fall like a thunderbolt.", "LunarBar": "'It vibrates with luminous celestial energy'", "LunarCraftingStation": "Used to craft items from Lunar Fragments and Luminite", "LunarFlareBook": "Rains down lunar flares", @@ -5987,7 +4858,7 @@ "MoneyTrough": "Summons a flying piggy bank to store your items", "MoonlordArrow": "'Shooting them down at the speed of sound!'", "MoonlordBullet": "'Line 'em up and knock 'em down...'", - "MoonlordTurretStaff": "{$CommonItemTooltip.Sentry}\nSummons a lunar portal to shoot lasers at your enemies", + "MoonlordTurretStaff": "Summons a lunar portal to shoot lasers at your enemies", "MothronWings": "{$CommonItemTooltip.FlightAndSlowfall}", "MulticolorWrench": " while holding to edit wire settings", "NebulaArcanum": "'Conjure masses of astral energy to chase down your foes'", @@ -5998,6 +4869,9 @@ "NebulaMonolith": "'Wield a small amount of power from the Nebula Tower'", "NightKey": "'Charged with the essence of many souls'", "NightVisionHelmet": "Improves vision", + "NinjaHood": "15% increased throwing velocity", + "NinjaPants": "10% increased throwing critical strike chance", + "NinjaShirt": "15% increased throwing damage", "PartyBundleOfBalloonTile": "'Tied down for everyone's pleasure'", "PartyGirlGrenade": "A small explosion that will not destroy tiles", "PartyMonolith": "'Balloons shall rain from the sky'", @@ -6019,10 +4893,10 @@ "ProjectilePressurePad": "Activates when a projectile touches it", "PsychoKnife": "Allows you to go into stealth mode", "PutridScent": "Enemies are less likely to target you\n5% increased damage and critical strike chance", - "QueenSpiderStaff": "{$CommonItemTooltip.Sentry}\nSummons a spider queen to spit eggs at your enemies", + "QueenSpiderStaff": "Summons a spider queen to spit eggs at your enemies", "Radar": "Detects enemies around you", "RainbowCampfire": "Life regen is increased when near a campfire", - "RainbowCrystalStaff": "{$CommonItemTooltip.Sentry}\nSummons a radiant crystal that banishes your enemies\n'The colors, Duke, the colors!'", + "RainbowCrystalStaff": "Summons a radiant crystal that banishes your enemies\n'The colors, Duke, the colors!'", "RazorbladeTyphoon": "Casts fast moving razorwheels", "RedsYoyo": "{$CommonItemTooltip.DevItem}", "REK": "Displays number of monsters, kill count, and rare creatures", @@ -6040,8 +4914,6 @@ "SharpeningStation": "Increases armor penetration for melee weapons", "ShinyStone": "Greatly increases life regen when not moving", "ShrimpyTruffle": "Attracts a legendary creature which flourishes in water & combat", - "SilkRope": "Can be climbed on", - "SilkRopeCoil": "Throw to create a climbable line of silk rope", "SillyBalloonGreen": "'Smells like mint and glee'", "SillyBalloonGreenWall": "'Smells like mint and glee'", "SillyBalloonMachine": "It never stops celebrating!", @@ -6055,30 +4927,30 @@ "SkiphsHelm": "{$CommonItemTooltip.DevItem}", "SkiphsPants": "{$CommonItemTooltip.DevItem}", "SkiphsShirt": "{$CommonItemTooltip.DevItem}", - "SkiphsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", - "SliceOfCake": "'Stuff your face. Stuff someone else's face. Whatever.'", + "SkiphsWings": "{$CommonItemTooltip.DevItem}", + "SliceOfCake": "Stuff your face. Stuff someone else's face. Whatever.", "SlimeGun": "Squirts a harmless stream of slime", "SlimySaddle": "Summons a rideable Slime mount", "SnowCloudBlock": "It gets pretty cold up there", "SnowFallBlock": "A lot cooler than a snow globe", "SnowFallWall": "A lot cooler than a snow globe", "SolarEruption": "'Strike with the fury of the sun'", - "SolarFlareBreastplate": "29% increased melee damage\nGrants minor life regeneration\nEnemies are more likely to target you", - "SolarFlareHelmet": "26% increased melee critical strike chance\nGrants minor life regeneration\nEnemies are more likely to target you", - "SolarFlareLeggings": "15% increased movement and melee speed\nGrants minor life regeneration\nEnemies are more likely to target you", + "SolarFlareBreastplate": "22% increased melee damage\nEnemies are more likely to target you", + "SolarFlareHelmet": "17% increased melee critical strike chance\nEnemies are more likely to target you", + "SolarFlareLeggings": "15% increased movement and melee speed\nEnemies are more likely to target you", "SolarMonolith": "'Wield a small amount of power from the Solar Tower'", "SolarTablet": "Summons the Eclipse", "SoulDrain": "Drains life from enemies", "SpelunkerGlowstick": "Exposes nearby treasure", "SpiderStaff": "Summons spiders to fight for you", "SporeSac": "Summons spores over time that will damage enemies", - "StardustBreastplate": "Increases your max number of minions by 2\nIncreases minion damage by 22%", + "StardustBreastplate": "Increases your max number of minions\nIncreases minion damage by 22%", "StardustCellStaff": "Summons a stardust cell to fight for you\n'Cultivate the most beautiful cellular infection'", "StardustDragonStaff": "Summons a stardust dragon to fight for you\n'Who needs a horde of minions when you have a giant dragon?'", - "StardustHelmet": "Increases your max number of minions by 1\nIncreases minion damage by 22%", - "StardustLeggings": "Increases your max number of minions by 2\nIncreases minion damage by 22%", + "StardustHelmet": "Increases your max number of minions\nIncreases minion damage by 22%", + "StardustLeggings": "Increases your max number of minions\nIncreases minion damage by 22%", "StardustMonolith": "'Wield a small amount of power from the Stardust Tower'", - "StickyDynamite": "A large explosion that will destroy most tiles\n'Tossing may be difficult.'", + "StickyDynamite": "'Tossing may be difficult.'", "StickyGrenade": "A small explosion that will not destroy tiles\n'Tossing may be difficult.'", "Stopwatch": "Displays how fast the player is moving", "StrangeBrew": "'It looks and smells terrible'", @@ -6101,8 +4973,7 @@ "TungstenPickaxe": "Can mine Meteorite", "UltraBrightCampfire": "Life regen is increased when near a campfire", "ValkyrieYoyo": "{$CommonItemTooltip.DevItem}", - "ViciousPowder": "Spreads the Crimson", - "VineRope": "Can be climbed on", + "ViciousPowder": "Banishes the Hallow", "VineRopeCoil": "Throw to create a climbable line of vine rope", "VortexBeater": "66% chance to not consume ammo\n'The catastrophic mixture of pew pew and boom boom.'", "VortexBreastplate": "12% increased ranged damage and critical strike chance\n25% chance not to consume ammo", @@ -6112,16 +4983,14 @@ "WandofSparking": "Shoots a small spark", "WeaponRack": " to place item on weapon rack", "WeatherRadio": "Displays the weather", - "WebRope": "Can be climbed on", - "WebRopeCoil": "Throw to create a climbable line of web rope", "WeightedPressurePlateCyan": "Activates when a player steps on or off it", "WeightedPressurePlateOrange": "Activates when a player steps on or off it", "WeightedPressurePlatePink": "Activates when a player steps on or off it", "WeightedPressurePlatePurple": "Activates when a player steps on or off it", - "WingsNebula": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", + "WingsNebula": "{$CommonItemTooltip.FlightAndSlowfall}", "WingsSolar": "{$CommonItemTooltip.FlightAndSlowfall}", "WingsStardust": "{$CommonItemTooltip.FlightAndSlowfall}", - "WingsVortex": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", + "WingsVortex": "{$CommonItemTooltip.FlightAndSlowfall}", "WireBulb": "Lights up bulbs for each wire color", "WireKite": "Allows ultimate control over wires!\n while holding to edit wire settings", "WirePipe": "Separates wire paths\nIt's also hammerable!", @@ -6133,7 +5002,7 @@ "Yoraiz0rHead": "{$CommonItemTooltip.DevItem}", "Yoraiz0rPants": "{$CommonItemTooltip.DevItem}", "Yoraiz0rShirt": "{$CommonItemTooltip.DevItem}", - "Yoraiz0rWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}\nWhatever this accessory does to you is not a bug!", + "Yoraiz0rWings": "{$CommonItemTooltip.DevItem}\nWhatever this accessory does to you is not a bug!", "YoyoBag": "Gives the user master yoyo skills", "YoYoGlove": "Allows the use of two yoyos at once", "BloodMoonRising": "{$PaintingArtist.Garner}", @@ -6577,16 +5446,16 @@ "DD2ElderCrystalStand": "Holds the Eternia Crystal", "DD2ElderCrystal": "Place in the Eternia Crystal Stand to summon Etheria's portals", "DefenderMedal": "Currency for trading with the Tavernkeep", - "DD2FlameburstTowerT1Popper": "{$CommonItemTooltip.Sentry}\nAn average speed tower that shoots exploding fireballs\n{$CommonItemTooltip.EtherianManaCost10}", + "DD2FlameburstTowerT1Popper": "An average speed tower that shoots exploding fireballs\n{$CommonItemTooltip.EtherianManaCost10}", "DD2FlameburstTowerT2Popper": "{$ItemTooltip.DD2FlameburstTowerT1Popper}", "DD2FlameburstTowerT3Popper": "{$ItemTooltip.DD2FlameburstTowerT1Popper}", - "DD2BallistraTowerT1Popper": "{$CommonItemTooltip.Sentry}\nA slow but high damage tower that shoots piercing bolts\n{$CommonItemTooltip.EtherianManaCost10}", + "DD2BallistraTowerT1Popper": "A slow but high damage tower that shoots piercing bolts\n{$CommonItemTooltip.EtherianManaCost10}", "DD2BallistraTowerT2Popper": "{$ItemTooltip.DD2BallistraTowerT1Popper}", "DD2BallistraTowerT3Popper": "{$ItemTooltip.DD2BallistraTowerT1Popper}", - "DD2ExplosiveTrapT1Popper": "{$CommonItemTooltip.Sentry}\nA trap that explodes when enemies come near\n{$CommonItemTooltip.EtherianManaCost10}", + "DD2ExplosiveTrapT1Popper": "A trap that explodes when enemies come near\n{$CommonItemTooltip.EtherianManaCost10}", "DD2ExplosiveTrapT2Popper": "{$ItemTooltip.DD2ExplosiveTrapT1Popper}", "DD2ExplosiveTrapT3Popper": "{$ItemTooltip.DD2ExplosiveTrapT1Popper}", - "DD2LightningAuraT1Popper": "{$CommonItemTooltip.Sentry}\nAn aura that repeatedly zaps enemies that go inside\n{$CommonItemTooltip.EtherianManaCost10}", + "DD2LightningAuraT1Popper": "An aura that repeatedly zaps enemies that go inside\n{$CommonItemTooltip.EtherianManaCost10}", "DD2LightningAuraT2Popper": "{$ItemTooltip.DD2LightningAuraT1Popper}", "DD2LightningAuraT3Popper": "{$ItemTooltip.DD2LightningAuraT1Popper}", "DD2PetGato": "Summons a pet gato", @@ -6601,578 +5470,43 @@ "MonkStaffT3": " while holding for an alternate attack!", "BookStaff": "Gotta wonder who stuck a tome of infinite wisdom on a stick...\n to cast a powerful tornado", "ApprenticeStaffT3": "Splashes defense reducing miasma!", - "ApprenticeHat": "Increases your max number of sentries by 1 and reduces mana costs by 10%", + "ApprenticeHat": "Increases your max number of sentries and reduces mana costs by 10%", "ApprenticeRobe": "20% increased minion damage and 10% increased magic damage", - "ApprenticeTrousers": "10% increased minion damage, 20% increased magic critical strike chance and movement speed", - "SquireGreatHelm": "Increases your max number of sentries by 1 and increases your life regeneration", + "ApprenticeTrousers": "10% increased minion damage and 20% increased movement speed", + "SquireGreatHelm": "Increases your max number of sentries and increases your life regeneration", "SquirePlating": "15% increased minion and melee damage", "SquireGreaves": "15% increased minion damage, 20% increased melee critical strike chance and movement speed", - "MonkBrows": "Increases your max number of sentries by 1 and increases melee attack speed by 20%", + "MonkBrows": "Increases your max number of sentries and increases melee attack speed by 20%", "MonkShirt": "20% increased minion and melee damage", "MonkPants": "10% increased minion damage,\n10% increased critical strike chance and 20% increased movement speed", - "HuntressWig": "Increases your max number of sentries by 1 and increases ranged critical strike chance by 10%", + "HuntressWig": "Increases your max number of sentries and increases ranged critical strike chance by 10%", "HuntressJerkin": "20% increased minion and ranged damage", "HuntressPants": "10% increased minion damage and 20% increased movement speed", "ApprenticeScarf": "{$ItemTooltip.HuntressBuckler}", "SquireShield": "{$ItemTooltip.HuntressBuckler}", "MonkBelt": "{$ItemTooltip.HuntressBuckler}", - "HuntressBuckler": "Increase your max number of sentries by 1\nIncreases minion damage by 10%", - "SquireAltHead": "Increases your max number of sentries by 2 and grants you 10% minion damage", + "HuntressBuckler": "Increase your max number of sentries\nIncreases minion damage by 10%", + "SquireAltHead": "Increases your max number of sentries and grants you 10% minion damage", "SquireAltShirt": "30% increased minion damage and massively increased life regeneration", - "SquireAltPants": "20% increased minion damage and melee critical strike chance and 30% movement speed", - "ApprenticeAltHead": "Increases your max number of sentries by 2\n10% increased minion & magic damage", + "SquireAltPants": "20% increased minion damage, critical strike chance and 30% movement speed", + "ApprenticeAltHead": "Increases your max number of sentries\n10% increased minion & magic damage", "ApprenticeAltShirt": "30% increased minion damage and 15% increased magic damage", "ApprenticeAltPants": "20% increased minion damage and 25% increased magic critical strike chance", - "HuntressAltHead": "Increases your max number of sentries by 2\n10% increased minion damage and ranged critical strike chance", + "HuntressAltHead": "Increases your max number of sentries\n10% increased minion damage and ranged critical strike chance", "HuntressAltShirt": "25% increased minion & ranged damage", "HuntressAltPants": "25% increased minion damage and 20% increased movement speed", - "MonkAltHead": "Increases your max number of sentries by 2 and increases 20% melee & minion damage", + "MonkAltHead": "Increases your max number of sentries and increases 20% melee & minion damage", "MonkAltShirt": "20% increased minion damage and melee speed", "MonkAltPants": "20% increased minion damage, movement speed and melee critical strike chance", "DD2EnergyCrystal": "Often used to manifest one's will as a physical form of defense", "ArkhalisHat": "{$CommonItemTooltip.DevItem}\n'I didn't get this from the Grid'", "ArkhalisShirt": "{$ItemTooltip.ArkhalisHat}", "ArkhalisPants": "{$ItemTooltip.ArkhalisHat}", - "ArkhalisWings": "{$ItemTooltip.ArkhalisHat}\n{$CommonItemTooltip.FlightAndSlowfall}", + "ArkhalisWings": "{$ItemTooltip.ArkhalisHat}", "LeinforsHat": "{$CommonItemTooltip.DevItem}\n'To keep those luscious locks as gorgeous as ever'", "LeinforsShirt": "{$CommonItemTooltip.DevItem}\n'Bringing sexy back'", - "LeinforsPants": "{$CommonItemTooltip.DevItem}\n'There might be pasta in the pockets'", - "LeinforsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}\n'It's full on! What does it mean?!'", - "LeinforsAccessory": "{$CommonItemTooltip.DevItem}\n'Brought to you by LeinCorp'", - "WoodenCrateHard": "{$ItemTooltip.WoodenCrate}", - "IronCrateHard": "{$ItemTooltip.IronCrate}", - "GoldenCrateHard": "{$ItemTooltip.GoldenCrate}", - "CorruptFishingCrateHard": "{$ItemTooltip.CorruptFishingCrate}", - "CrimsonFishingCrateHard": "{$ItemTooltip.CrimsonFishingCrate}", - "DungeonFishingCrateHard": "{$ItemTooltip.DungeonFishingCrate}", - "FloatingIslandFishingCrateHard": "{$ItemTooltip.FloatingIslandFishingCrate}", - "HallowedFishingCrateHard": "{$ItemTooltip.HallowedFishingCrate}", - "JungleFishingCrateHard": "{$ItemTooltip.JungleFishingCrate}", - "HeartLantern": "Increases life regeneration when placed nearby", - "StarinaBottle": "Increases mana regeneration when placed nearby", - "Cloud": "Prevents fall damage", - "RainCloud": "Prevents fall damage", - "SnowCloudBlock": "Prevents fall damage", - "AmphibianBoots": "The wearer can run super fast\nIncreases jump speed and allows auto-jump\nIncreases fall resistance", - "ArcaneFlower": "8% reduced mana usage\nAutomatically use mana potions when needed\nEnemies are less likely to target you", - "BerserkerGlove": "Increases melee knockback\n12% increased melee speed\nEnables auto swing for melee weapons\nEnemies are more likely to target you", - "FairyBoots": "Allows flight\nThe wearer can run super fast\nFlowers grow on the grass you walk on", - "FrogFlipper": "Grants the ability to swim\nIncreases jump speed and allows auto-jump\nIncreases fall resistance", - "FrogGear": "Grants the ability to swim\nAllows the ability to climb walls\nIncreases jump speed and allows auto-jump\nIncreases fall resistance\n'It ain't easy being green'", - "FrogWebbing": "Allows the ability to climb walls\nIncreases jump speed and allows auto-jump\nIncreases fall resistance", - "FrozenShield": "Grants immunity to knockback\nPuts a shell around the owner when below 50% life that reduces damage by 25%\nAbsorbs 25% of damage done to players on your team when above 25% life", - "HeroShield": "Grants immunity to knockback\nAbsorbs 25% of damage done to players on your team when above 25% life\nEnemies are more likely to target you", - "LavaSkull": "Melee attacks inflict fire damage\nGrants immunity to fire blocks", - "MoltenCharm": "Grants immunity to fire blocks\nProvides 7 seconds of immunity to lava", - "MagnetFlower": "8% reduced mana usage\nAutomatically use mana potions when needed\nIncreases pickup range for mana stars", - "ManaCloak": "8% reduced mana usage\nAutomatically use mana potions when needed\nCauses stars to fall after taking damage\nStars restore mana when collected", - "MoltenQuiver": "Increases arrow damage by 10% and greatly increases arrow speed\n20% chance not to consume arrows\nLights wooden arrows ablaze\n'Quiver in fear!'", - "ObsidianSkullRose": "Grants immunity to fire blocks\nReduces damage from touching lava", - "MoltenSkullRose": "Melee attacks inflict fire damage\nGrants immunity to fire blocks\nReduces damage from touching lava", - "ReconScope": "Increases view range for guns ( to zoom out)\n10% increased ranged damage and critical strike chance\nEnemies are less likely to target you\n'Enemy spotted'", - "StalkersQuiver": "Increases arrow damage by 10% and greatly increases arrow speed\n20% chance not to consume arrows\nEnemies are less likely to target you", - "StingerNecklace": "Increases armor penetration by 5\nReleases bees when damaged", - "UltrabrightHelmet": "Improves vision and provides light when worn\n'The darkness holds no secrets for you'", - "SandBoots": "The wearer can run super fast, and even faster on sand\n'Walk without rhythm and you won't attract the worm'", - "AncientChisel": "Increases mining speed by 25%\n'Ancient problems require ancient solutions'", - "Mannequin": " to customize attire", - "Womannquin": " to customize attire", - "HatRack": " when placed to display hats and helmets", - "DeadMansChest": "Activates when opened", - "GolfBall": "{$CommonItemTooltip.GolfBall}", - "GolfClubIron": "{$CommonItemTooltip.GolfIron}", - "GolfCup": "Aim to sink your golf ball in the cup\nLets everyone know how well you did", - "LawnMower": "Mows Pure and Hallowed grass\nMowed grass reduces enemy spawn chance", - "GolfTee": " to place a golf ball on it", - "AntiPortalBlock": "Portals cannot be created on the surface of these blocks", - "GolfClubPutter": "{$CommonItemTooltip.GolfPutter}", - "GolfClubWedge": "{$CommonItemTooltip.GolfWedge}", - "GolfClubDriver": "{$CommonItemTooltip.GolfDriver}", - "GolfWhistle": "Returns your last hit Golf Ball to its previous position\nHas a one stroke penalty", - "VoidLens": "Summons the void vault\nIf carried, it may pick up items when your inventory is full\n'This pocket dimension is out of this world!'", - "LesionStation": "Used for special crafting", - "TitanGlove": "Increases melee knockback\nEnables auto swing for melee weapons", - "PowerGlove": "Increases melee knockback\n12% increased melee speed\nEnables auto swing for melee weapons", - "MechanicalGlove": "Increases melee knockback\n12% increased melee damage and speed\nEnables auto swing for melee weapons", - "FireGauntlet": "Increases melee knockback and melee attacks inflict fire damage\n10% increased melee damage and speed\nEnables auto swing for melee weapons", - "MusicBoxDayRemix": "Brought to you by Xenon and DJ Sniper", - "GolfBallDyedBlack": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedBlue": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedBrown": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedCyan": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedGreen": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedLimeGreen": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedOrange": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedPink": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedPurple": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedRed": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedSkyBlue": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedTeal": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedViolet": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedYellow": "{$CommonItemTooltip.GolfBall}", - "AmberRobe": "Increases maximum mana by 60\nReduces mana usage by 13%", - "OrangePressurePlate": "Activates and breaks when a player steps on it", - "PumpkinPie": "{$CommonItemTooltip.MediumStats}\n'Stuff it all up in one bite!'", - "ChristmasPudding": "{$CommonItemTooltip.MajorStats}\n'A cozy treat by the fireplace.'", - "SugarCookie": "{$CommonItemTooltip.MajorStats}\n'You'll bounce off the walls!'", - "GingerbreadCookie": "{$CommonItemTooltip.MajorStats}\n'Not the gumdrop buttons!'", - "PadThai": "{$CommonItemTooltip.MediumStats}\n'Spicy level 5!'", - "Pho": "{$CommonItemTooltip.MediumStats}\n'Pho sho...'", - "CookedFish": "{$CommonItemTooltip.MinorStats}\n'Where's the chips!?'", - "CookedShrimp": "{$CommonItemTooltip.MediumStats}\n'Barbecue it, boil it, broil it, bake it...'", - "Sashimi": "{$CommonItemTooltip.MediumStats}\n'It's raw! It's exotic!'", - "BowlofSoup": "{$CommonItemTooltip.MediumStats}\n'Simple, yet refreshing.'", - "CookedMarshmallow": "{$CommonItemTooltip.MinorStats}\n'How can I have some more of nothing?'", - "Bacon": "{$CommonItemTooltip.MajorStats}\n'Bacon? Bacon.'", - "GrubSoup": "{$CommonItemTooltip.MediumStats}\n'Grub's up!'", - "Apple": "{$CommonItemTooltip.MinorStats}\n'An apple a day keeps Dr Bones away!'", - "ApplePieSlice": "{$CommonItemTooltip.MediumStats}\n'Mmmm... pie.'", - "ApplePie": "{$CommonItemTooltip.MajorStats}\n'Nothing is as Terrarian as apple pie.'", - "BananaSplit": "{$CommonItemTooltip.MediumStats}\n'Make like a banana and split!'", - "BBQRibs": "{$CommonItemTooltip.MajorStats}\n'Grilled to perfection!'", - "BunnyStew": "{$CommonItemTooltip.MinorStats}\n'This one's luck has run out.'", - "Burger": "{$CommonItemTooltip.MajorStats}\n'...but wait! It was 99 cents.'", - "ChickenNugget": "{$CommonItemTooltip.MediumStats}\n'Caution: may contain harpy.'", - "ChocolateChipCookie": "{$CommonItemTooltip.MediumStats}\n'Fresh from the oven'", - "CreamSoda": "{$CommonItemTooltip.MediumStats}\n'It's so fizzy!'", - "Escargot": "{$CommonItemTooltip.MediumStats}\n'Look at that S Car Go!'", - "FriedEgg": "{$CommonItemTooltip.MediumStats}\n'Sunny side up!'", - "Fries": "{$CommonItemTooltip.MediumStats}\n'Where's the Ketchup!?'", - "GoldenDelight": "{$CommonItemTooltip.MajorStats}\n'(Au)some!'", - "Grapes": "{$CommonItemTooltip.MediumStats}\n'Wrath not included.'", - "GrilledSquirrel": "{$CommonItemTooltip.MinorStats}\n'That'll keep you out of my birdfeeders...'", - "Hotdog": "{$CommonItemTooltip.MediumStats}\n'Hot diggity!'", - "IceCream": "{$CommonItemTooltip.MediumStats}\n'Eat it before it melts!'", - "Milkshake": "{$CommonItemTooltip.MajorStats}\n'It brings the boys to the yard!'", - "Nachos": "{$CommonItemTooltip.MediumStats}\n'It's nach-yos, it's mine!'", - "Pizza": "{$CommonItemTooltip.MajorStats}\n'With pepperoni and extra cheese.'", - "PotatoChips": "{$CommonItemTooltip.MinorStats}\n'Betcha can't eat just one!'", - "RoastedBird": "{$CommonItemTooltip.MinorStats}\n'Serving Size: 1 child.'", - "RoastedDuck": "{$CommonItemTooltip.MediumStats}\n'Better than chicken from a wall.'", - "SauteedFrogLegs": "{$CommonItemTooltip.MediumStats}\n'The other, other white meat.'", - "SeafoodDinner": "{$CommonItemTooltip.MajorStats}\n'I sea food, I eat it.'", - "ShrimpPoBoy": "{$CommonItemTooltip.MediumStats}\n'Po' Boy are you in for a treat!'", - "Spaghetti": "{$CommonItemTooltip.MajorStats}\n'Al dente!'", - "Steak": "{$CommonItemTooltip.MajorStats}\n'Well done with ketchup!'", - "Ale": "{$CommonItemTooltip.TipsyStats}\n'Down the hatch!'", - "Sake": "{$CommonItemTooltip.TipsyStats}\n'Drink too much of this, and you become karate master.'", - "GolfCart": "Summons a rideable Golf Cart mount", - "BloodMoonStarter": "Summons the Blood Moon\n'What a horrible night to have a curse.'", - "GoldGoldfish": "'Not to be confused with the elusive Gold Gold Goldfish'", - "GoldGoldfishBowl": "'Is it a gold bowl? Or a gold fish?'", - "Apricot": "{$CommonItemTooltip.MinorStats}\n'You'll apricate this!'", - "Banana": "{$CommonItemTooltip.MinorStats}\n'Good source of potassium!'", - "BlackCurrant": "{$CommonItemTooltip.MinorStats}", - "BloodOrange": "{$CommonItemTooltip.MinorStats}\n'A vegan option for vampires'", - "Cherry": "{$CommonItemTooltip.MinorStats}", - "Coconut": "{$CommonItemTooltip.MinorStats}\n'Are you suggesting that coconuts can migrate?'", - "Dragonfruit": "{$CommonItemTooltip.MediumStats}", - "Elderberry": "{$CommonItemTooltip.MinorStats}\n'Smells like your father'", - "Grapefruit": "{$CommonItemTooltip.MinorStats}", - "Lemon": "{$CommonItemTooltip.MinorStats}\n'When life gives you lemons...'", - "Mango": "{$CommonItemTooltip.MinorStats}", - "Peach": "{$CommonItemTooltip.MinorStats}", - "Pineapple": "{$CommonItemTooltip.MinorStats}\n'Goes great with pizza'", - "Plum": "{$CommonItemTooltip.MinorStats}", - "Rambutan": "{$CommonItemTooltip.MinorStats}", - "Starfruit": "{$CommonItemTooltip.MediumStats}", - "StarWrath": "Causes stars to rain from the sky", - "FairyCritterPink": "'Hey! Listen!'", - "FairyCritterGreen": "'Hey! Listen!'", - "FairyCritterBlue": "'Hey! Listen!'", - "BabyBirdStaff": "Summons a baby finch to fight for you", - "MysticCoilSnake": "Summons rope snakes", - "SanguineStaff": "Summons a sanguine bat to fight for you", - "CatBast": "Increases defense by 5 when placed nearby", - "ItemFrame": " to place item on item frame", - "FoodPlatter": " to place item on plate", - "CanOfWorms": "{$CommonItemTooltip.RightClickToOpen}", - "Trident": "Increases mobility in water when held\nHold UP to descend slower", - "EucaluptusSap": "Summons a Pet Sugar Glider", - "CelestialWand": "Summons Estee", - - "NecroHelmet": "5% increased ranged damage", - "NecroBreastplate": "5% increased ranged damage", - "NecroGreaves": "5% increased ranged damage", - "AncientNecroHelmet": "5% increased ranged damage", - - "NinjaHood": "3% increased critical strike chance", - "NinjaPants": "3% increased critical strike chance", - "NinjaShirt": "3% increased critical strike chance", - - "FossilHelm": "3% increased ranged critical strike chance", - "FossilPants": "3% increased ranged critical strike chance", - "FossilShirt": "3% increased ranged critical strike chance", - - "EncumberingStone": "Prevents item pickups while in the inventory\n'You are over-encumbered'", - - "SharpTears": "Summons blood thorns from the ground", - "VampireFrogStaff": "Summons a vampire frog to fight for you", - "CombatBook": "Increases the defense and strength of all villagers\n'Contains offensive and defensive fighting techniques'", - "PortableStool": "Hold UP to reach higher", - - "CoralTorch": "Can be placed in water", - - "KryptonMoss": "'A sight to dwell upon and never forget'", - "XenonMoss": "'A sight to dwell upon and never forget'", - "ArgonMoss": "'A sight to dwell upon and never forget'", - "ThinIce": "Breaks when fallen on\n'Watch your step'", - - "FrozenCrate": "{$CommonItemTooltip.RightClickToOpen}", - "FrozenCrateHard": "{$CommonItemTooltip.RightClickToOpen}", - "OasisCrate": "{$CommonItemTooltip.RightClickToOpen}", - "OasisCrateHard": "{$CommonItemTooltip.RightClickToOpen}", - - "OceanCrate": "{$CommonItemTooltip.RightClickToOpen}", - "OceanCrateHard": "{$CommonItemTooltip.RightClickToOpen}", - - "ArrowSign": " to change directions", - "PaintedArrowSign": " to change directions", - - "SpectreGoggles": "Enables Echo Sight, showing hidden blocks", - "LobsterTail": "{$CommonItemTooltip.MediumStats}\n'Delicious with a bit of butter'", - "Oyster": "{$CommonItemTooltip.RightClickToOpen}", - "ShuckedOyster": "{$CommonItemTooltip.MinorStats}\n'Aw, shucks!'", - "ClusterRocketI": "Will not destroy tiles", - "ClusterRocketII": "Will destroy tiles", - "MiniNukeI": "Huge blast radius. Will not destroy tiles", - "MiniNukeII": "Huge blast radius. Will destroy tiles", - "SandcastleBucket": "Places sandcastles", - "EchoBlock": "Only visible with Echo Sight", - "Grate": "Allows only liquids through\nCan be toggled open or closed\n'They'rrrre great!'", - "LuckPotionLesser": "Increases the Luck of the user", - "LuckPotion": "Increases the Luck of the user", - "LuckPotionGreater": "Increases the Luck of the user", - "MagicConch": "If you listen closely, you can hear the ocean", - "TimerOneHalfSecond": "Activates every half of a second", - "TimerOneFourthSecond": "Activates every fourth of a second", - "Terragrim": "Unleashes a dicing flurry", - "FloatingTube": "Grants the ability to float in water", - "SharkBait": "Summons a Shark Pup\n'Doo, doo, doo, doo, doo, doo'", - "Geode": "May drop valuable shinies when smashed!", - "CrackedBlueBrick": "May break when stepped on", - "CrackedGreenBrick": "May break when stepped on", - "CrackedPinkBrick": "May break when stepped on", - "BloodMoonMonolith": "'Sustain a bloody fraction of the Moon'", - "VoidMonolith": "'Harness a small amount of power from the Void'", - "ScarabBomb": "A narrow explosion that will destroy most tiles\nExplosion aims away from your position", - "GolfClubStoneIron": "{$CommonItemTooltip.GolfIron}", - "GolfClubRustyPutter": "{$CommonItemTooltip.GolfPutter}", - "GolfClubBronzeWedge": "{$CommonItemTooltip.GolfWedge}", - "GolfClubWoodDriver": "{$CommonItemTooltip.GolfDriver}", - "GolfClubMythrilIron": "{$CommonItemTooltip.GolfIron}", - "GolfClubLeadPutter": "{$CommonItemTooltip.GolfPutter}", - "GolfClubGoldWedge": "{$CommonItemTooltip.GolfWedge}", - "GolfClubPearlwoodDriver": "{$CommonItemTooltip.GolfDriver}", - "GolfClubTitaniumIron": "{$CommonItemTooltip.GolfIron}", - "GolfClubShroomitePutter": "{$CommonItemTooltip.GolfPutter}", - "GolfClubDiamondWedge": "{$CommonItemTooltip.GolfWedge}", - "GolfClubChlorophyteDriver": "{$CommonItemTooltip.GolfDriver}", - "FishMinecart": "Allows quick travel in water\n'Deal with it'", - "HellMinecart": "Provides 7 seconds of immunity to lava", - "TheBrideBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.TheBride}", - "ZombieMermanBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.ZombieMerman}", - "EyeballFlyingFishBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.EyeballFlyingFish}", - "BloodSquidBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodSquid}", - "BloodEelBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodEelHead}", - "GoblinSharkBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.GoblinShark}", - "BloodNautilusBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodNautilus}", - "WitchBroom": "'Grants a witching spark of inspiration!'", - "BirdieRattle": "Summons a baby harpy\n'Not for your everyday cockatiel'", - "ExoticEasternChewToy": "Summons a fennec fox\n'It squeaks at a glorious 96kHz!'", - "BedazzledNectar": "Summons a pet butterfly\n'Only the best, most exquisite flower excrement!'", - "HellCake": "Summons a baby imp\n'He hasn't learned how to teleport yet!'", - "BambooLeaf": "Summons a baby red panda", - "Celeb2": "50% chance to not consume ammo\n'All good things end with a bang... or many!'", - "AppleJuice": "{$CommonItemTooltip.MinorStats}\n'Hungry for Apples?'", - "GrapeJuice": "{$CommonItemTooltip.MajorStats}\n'Sugar. Water. Purple.'", - "Lemonade": "{$CommonItemTooltip.MinorStats}\n'...make lemonade!'", - "BananaDaiquiri": "{$CommonItemTooltip.MinorStats}\n'Yellow and mellow'", - "PeachSangria": "{$CommonItemTooltip.MinorStats}\n'Life's a peach'", - "PinaColada": "{$CommonItemTooltip.MinorStats}\n'If you like piña coladas and getting caught in the rain'", - "TropicalSmoothie": "{$CommonItemTooltip.MinorStats}\n'Real smooth'", - "BloodyMoscato": "{$CommonItemTooltip.MinorStats}\n'Not really blood... or is it?'", - "SmoothieofDarkness": "{$CommonItemTooltip.MinorStats}\n'Come to the dark side, we have smoothies'", - "PrismaticPunch": "{$CommonItemTooltip.MediumStats}\n'Feel the rainbow, taste the crystal!'", - "FruitJuice": "{$CommonItemTooltip.MinorStats}\n'With 5% real fruit juice!'", - "FruitSalad": "{$CommonItemTooltip.MinorStats}", - "AndrewSphinx": "{$PaintingArtist.UnitOne} (Restored)", - "WatchfulAntlion": "{$PaintingArtist.Aurora} (Restored)", - "BurningSpirit": "{$PaintingArtist.Zoomo}", - "JawsOfDeath": "{$PaintingArtist.Darthkitten}", - "TheSandsOfSlime": "{$PaintingArtist.Criddle}", - "SnakesIHateSnakes": "{$PaintingArtist.Xman101}", - "LifeAboveTheSand": "{$PaintingArtist.Zoomo}", - "Oasis": "{$PaintingArtist.Khaios}", - "PrehistoryPreserved": "'Unearthed by C. Schneider'", - "AncientTablet": "'Unearthed by C. Schneider'", - "Uluru": "{$PaintingArtist.darthmorf}", - "VisitingThePyramids": "{$PaintingArtist.Leinfors}", - "BandageBoy": "{$PaintingArtist.Darthkitten}", - "DivineEye": "{$PaintingArtist.Darthkitten}", - "FogMachine": "Billows out fog", - "GolfPainting1": "{$PaintingArtist.Crowno}", - "GolfPainting2": "{$PaintingArtist.Crowno}", - "GolfPainting3": "{$PaintingArtist.Crowno}", - "GolfPainting4": "'Ceci n'est pas un club de golf.'\n{$PaintingArtist.Crowno}", - "UnicornHornHat": "'It's a new day, yes it is!'", - "ChumBucket": "Toss in water up to 3 times to increase fishing power\n'Plankton!'", - "GardenGnome": "'Said to bring good fortune and keep evil spirits at bay'", - "BloodFishingRod": "Increased chance to fish up enemies during a Blood Moon", - "IvyGuitar": "Playable Instrument\n'Property of Dead Man's Sweater'", - "CarbonGuitar": "Playable Instrument\n'These licks are spicy'", - "DrumStick": "Playable next to Drum Set\n'The coffee is strong...and vulgar'", - "GlowPaint": "Fully illuminates the painted object", - "WetRocket": "Spreads water on impact", - "LavaRocket": "Spreads lava on impact", - "HoneyRocket": "Spreads honey on impact", - "DryRocket": "Absorbs liquid on impact", - "BloodRainBow": "Rains blood from the sky\n'Reign in Blood'", - "DandelionBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.Dandelion}", - "GnomeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.Gnome}", - "CrystalDart": "Bounces between enemies", - "CursedDart": "Drops cursed flames on the ground", - "IchorDart": "Bursts into multiple darts", - "DeadlySphereStaff": "Summons a deadly sphere to fight for you", - "DesertCampfire": "Life regen is increased when near a campfire", - "CoralCampfire": "Life regen is increased when near a campfire", - "CorruptCampfire": "Life regen is increased when near a campfire", - "CrimsonCampfire": "Life regen is increased when near a campfire", - "HallowedCampfire": "Life regen is increased when near a campfire", - "JungleCampfire": "Life regen is increased when near a campfire", - "EmptyBucket": "Can be used to scoop up a small amount of liquid", - "WaterBucket": "Contains a small amount of water\nCan be poured out", - "LavaBucket": "Contains a small amount of lava\nCan be poured out", - "HoneyBucket": "Contains a small amount of honey\nCan be poured out", - "PiggyBank": "Can be used to store your items\nStored items can only be accessed by you", - "Safe": "Can be used to store your items\nStored items can only be accessed by you", - "DefendersForge": "Can be used to store your items\nStored items can only be accessed by you", - "VoidVault": "Can be used to store your items\nStored items can only be accessed by you\nWill contain items picked up by a void bag", - "MudBud": "Summons little Plantero", - "ReleaseDoves": "'Released during certain ceremonies'", - "TragicUmbrella": "You will fall slower while holding this", - "GravediggerShovel": "Digs in a bigger area than a pickaxe\nOnly digs up soft tiles\n'Can you dig it?'", - "DungeonDesertKey": "Unlocks a Desert Chest in the dungeon", - "MolluskWhistle": "Summons a rideable flamingo mount", - "BreakerBlade": "Deals more damage to unhurt enemies", - "Nevermore": "{$PaintingArtist.Crowno}", - "Reborn": "{$PaintingArtist.Crowno}", - "Graveyard": "{$PaintingArtist.Crowno}", - "GhostManifestation": "{$PaintingArtist.Crowno}", - "WickedUndead": "{$PaintingArtist.Crowno}", - "BloodyGoblet": "{$PaintingArtist.Crowno}", - "StillLife": "{$PaintingArtist.Crowno}", - "GhostarsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}\n'I am right here'", - "GhostarSkullPin": "{$CommonItemTooltip.DevItem}\n'Could this be the real Ghostar?'", - "GhostarShirt": "{$CommonItemTooltip.DevItem}\n'A fine dress handmade by a dragon'", - "GhostarPants": "{$CommonItemTooltip.DevItem}\n'The journey of a thousand miles begins with one step'", - "BallOfFuseWire": "Summons a dynamite kitten\n'It's like yarn, but more exciting!'", - "FullMoonSqueakyToy": "Summons a baby werewolf", - "OrnateShadowKey": "Summons a pet shadow mimic", - "FoodBarbarianWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}\n'The holes cut down on weight.'", - "FoodBarbarianHelm": "{$CommonItemTooltip.DevItem}\n'Safety First'", - "FoodBarbarianArmor": "{$CommonItemTooltip.DevItem}\n'Max was a good boy.'", - "FoodBarbarianGreaves": "{$CommonItemTooltip.DevItem}\n'They don't let me wear a loincloth anymore.'", - "SafemanWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}\n'Can you help me tie this on?'", - "SafemanSunHair": "{$CommonItemTooltip.DevItem}\n'Bright idea'", - "SafemanSunDress": "{$CommonItemTooltip.DevItem}\n'Fashionable and functional'", - "SafemanDressLeggings": "{$CommonItemTooltip.DevItem}\n'Almost like pants'", - "GroxTheGreatWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", - "GroxTheGreatHelm": "{$CommonItemTooltip.DevItem}", - "GroxTheGreatArmor": "{$CommonItemTooltip.DevItem}", - "GroxTheGreatGreaves": "{$CommonItemTooltip.DevItem}", - "KiteWyvern": "{$CommonItemTooltip.Kite}", - "KiteBlue": "{$CommonItemTooltip.Kite}", - "KiteBlueAndYellow": "{$CommonItemTooltip.Kite}", - "KiteRed": "{$CommonItemTooltip.Kite}", - "KiteRedAndYellow": "{$CommonItemTooltip.Kite}", - "KiteYellow": "{$CommonItemTooltip.Kite}", - "KiteBoneSerpent": "{$CommonItemTooltip.Kite}", - "KiteWorldFeeder": "{$CommonItemTooltip.Kite}", - "KiteBunny": "{$CommonItemTooltip.Kite}", - "KitePigron": "{$CommonItemTooltip.Kite}", - "KiteManEater": "{$CommonItemTooltip.Kite}", - "KiteJellyfishBlue": "{$CommonItemTooltip.Kite}", - "KiteJellyfishPink": "{$CommonItemTooltip.Kite}", - "KiteShark": "{$CommonItemTooltip.Kite}", - "KiteSandShark": "{$CommonItemTooltip.Kite}", - "KiteBunnyCorrupt": "{$CommonItemTooltip.Kite}", - "KiteBunnyCrimson": "{$CommonItemTooltip.Kite}", - "KiteGoldfish": "{$CommonItemTooltip.Kite}", - "KiteAngryTrapper": "{$CommonItemTooltip.Kite}", - "KiteKoi": "{$CommonItemTooltip.Kite}", - "KiteCrawltipede": "{$CommonItemTooltip.Kite}", - "KiteSpectrum": "{$CommonItemTooltip.Kite}", - "KiteWanderingEye": "{$CommonItemTooltip.Kite}\n'This one can't wander too far'", - "KiteUnicorn": "{$CommonItemTooltip.Kite}", - "CritterShampoo": "Applies dye to minions", - "DontHurtCrittersBook": "Prevents you from hurting critters while in the inventory", - "FairyGlowstick": "Hovers when thrown\nWorks when wet", - "LightningCarrot": "Summons a volt bunny", - "SquirrelHook": "Grapple onto trees like a real squirrel!\n'In the tree, part of the tree'", - "Football": "Try to catch it!", - "FairyQueenBossBag": "{$CommonItemTooltip.RightClickToOpen}", - "TreeGlobe": "Toss it to change how trees look!\n'Time for a change of scenery'", - "WorldGlobe": "Toss it to change how the world looks!\n'Time for a change of scenery'", - "BottomlessLavaBucket": "Contains an endless amount of lava\nCan be poured out", - "BugNet": "Used to catch critters", - "GoldenBugNet": "Used to catch critters\nCan catch lava critters too!", - "FireproofBugNet": "Used to catch critters\nCan catch lava critters too!", - "WetBomb": "A small explosion that will spread water", - "LavaBomb": "A small explosion that will spread lava", - "HoneyBomb": "A small explosion that will spread honey", - "DryBomb": "A small explosion that will absorb liquid", - "LicenseCat": "Use to let a cat arrive in town", - "LicenseDog": "Use to let a dog arrive in town", - "LavaAbsorbantSponge": "Capable of soaking up an endless amount of lava", - "HallowedHood": "Increases your max number of minions by 1\nIncreases minion damage by 10%", - "FlameWaderBoots": "Provides the ability to walk on water, honey & lava\nGrants immunity to fire blocks and 7 seconds of immunity to lava", - "LavaCrate": "{$CommonItemTooltip.RightClickToOpen}", - "LavaCrateHard": "{$CommonItemTooltip.RightClickToOpen}", - "ObsidianLockbox": "{$CommonItemTooltip.RightClickToOpen}\nRequires a Shadow Key", - "DemonConch": "If you listen closely, you can hear screams\n'Watch your toes'", - "HotlineFishingHook": "{$CommonItemTooltip.LavaFishing}", - "LavaFishingHook": "{$CommonItemTooltip.LavaFishing}", - "AncientHallowedMask": "10% increased melee damage and critical strike chance\n10% increased melee speed", - "AncientHallowedHelmet": "15% increased ranged damage\n8% increased ranged critical strike chance", - "AncientHallowedHeadgear": "Increases maximum mana by 100\n12% increased magic damage and critical strike chance", - "AncientHallowedHood": "Increases your max number of minions by 1\nIncreases minion damage by 10%", - "AncientHallowedPlateMail": "7% increased critical strike chance", - "AncientHallowedGreaves": "7% increased damage\n8% increased movement speed", - "PotionOfReturn": "Teleports you home and creates a portal\nUse portal to return when you are done\n'Good for one round trip!'", - "FlameWakerBoots": "Leaves a trail of flames in your wake", - "HellfireTreads": "Provides the ability to walk on water, honey & lava\nGrants immunity to fire blocks and 7 seconds of immunity to lava\nLeaves a trail of flames in your wake", - "LavaFishbowl": "'No, you can't wear it on your head'", - "PirateShipMountItem": "Summons the Black Spot mount\n'Arrr! This be mutiny!'", - "SpookyWoodMountItem": "Summons a rideable tree mount\n'A wand crafted from the branch of a cursed tree.'", - "SantankMountItem": "Summons a rideable Santank mount\n'For the REALLY naughty ones.'", - "WallOfFleshGoatMountItem": "Summons a rideable death goat mount\n'Brutal!'", - "DarkMageBookMountItem": "Summons a magic tome mount\n'A book said to be at its holder's behest.'", - "KingSlimePetItem": "Summons a Slime Prince\n'A dessert fit for a king!'", - "EyeOfCthulhuPetItem": "Summons a suspicious eye\n'Seems to have lost its look.'", - "EaterOfWorldsPetItem": "Summons the Eater of Worms\n'It'll give you worms!'", - "BrainOfCthulhuPetItem": "Summons a spider brain\n'Pickled and shrunken, this brain can no longer hurt you.'", - "SkeletronPetItem": "Summons a small Skeletron\n'A skull with unimaginable power dulled.'", - "QueenBeePetItem": "Summons a honey bee\n'The secret ingredient for royal bees.'", - "DestroyerPetItem": "Summons a miniature tool of destruction\n'It's safe to operate this right?'", - "TwinsPetItem": "Summons miniature mechanical eyes\n'Two are better than one.'", - "SkeletronPrimePetItem": "Summons a miniature Skeletron Prime\n'We can rebuild it.'", - "PlanteraPetItem": "Summons a newly sprouted Plantera\n'Get to the root of the problem.'", - "GolemPetItem": "Summons a toy golem to light your way\n'Power cells not included.'", - "DukeFishronPetItem": "Summons a tiny Fishron\n'Brined to perfection.'", - "LunaticCultistPetItem": "Summons a baby phantasmal dragon\n'Contains a fragment of Phantasm energy.'", - "MoonLordPetItem": "Summons a Moonling\n'The forbidden calamari.'", - "FairyQueenPetItem": "Summons a fairy princess to provide light\n'A glowing gemstone that houses a powerful fairy.'", - "PumpkingPetItem": "Summons a possessed Jack 'O Lantern\n'The flame cannot be put out!'", - "EverscreamPetItem": "Summons an Everscream sapling\n'Twinkle, Twinkle!'", - "IceQueenPetItem": "Summons a tiny Ice Queen\n'Fit for a queen!'", - "MartianPetItem": "Summons an alien skater\n'Kickflips are a lot easier in Zero-G!'", - "DD2OgrePetItem": "Summons a baby ogre\n'No other uses besides smashing.'", - "DD2BetsyPetItem": "Summons Itsy Betsy\n'No fire sacrifices required!'", - "PaintedHorseSaddle": "Summons a rideable painted horse mount", - "MajesticHorseSaddle": "Summons a rideable white horse mount", - "DarkHorseSaddle": "Summons a rideable dark horse mount", - "SuperheatedBlood": "Summons a rideable lava shark mount\n'Bloody hell!'", - "PogoStick": "Summons a rideable pogo stick mount\nPress Jump again in mid-air to do tricks!", - "LicenseBunny": "Use to let a bunny arrive in town", - "TeleportationPylonJungle": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonPurity": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonHallow": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonUnderground": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonOcean": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonDesert": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonSnow": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonMushroom": "{$CommonItemTooltip.TeleportationPylon}", - "TerraToilet": "Seriously? THIS is what you used the Broken Hero Sword for?", - "QueenSlimePetItem": "Summons a Slime Princess\n'A dessert fit for a queen!'", - "AccentSlab": "A Stone Slab variant that merges differently with nearby blocks\nFavored by advanced builders", - "TeleportationPylonVictory": "Teleport to another pylon\nCan function anywhere\n'You must construct additional pylons'", - "RockGolemBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.RockGolem}", - "BloodMummyBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodMummy}", - "SporeSkeletonBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.SporeSkeleton}", - "SporeBatBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.SporeBat}", - "LarvaeAntlionBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.LarvaeAntlion}", - "CrimsonBunnyBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CrimsonBunny}", - "CrimsonGoldfishBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CrimsonGoldfish}", - "CrimsonPenguinBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CrimsonPenguin}", - "BigMimicCorruptionBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BigMimicCorruption}", - "BigMimicCrimsonBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BigMimicCrimson}", - "BigMimicHallowBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BigMimicHallow}", - "MossHornetBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.MossHornet}", - "WanderingEyeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.WanderingEye}", - "BlueCultistCasterBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CultistDevote}", - "CreativeWings": "{$CommonItemTooltip.FlightAndSlowfall}", - "RainbowWings": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressUpToBooster}", - "LongRainbowTrailWings": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}\n{$CommonItemTooltip.PressUpToBooster}\n'The more you know'", - "DirtBomb": "A small explosion that will spread dirt", - "DirtStickyBomb": "A small explosion that will spread dirt", - "DiggingMoleMinecart": "Will dig through blocks and lay new track if carrying minecart tracks\nOnly digs when underground", - "CrystalNinjaHelmet": "5% increased crit chance", - "CrystalNinjaChestplate": "5% increased damage", - "CrystalNinjaLeggings": "10% increased movement speed", - "QueenSlimeMountSaddle": "Summons a rideable Winged Slime mount", - "QueenSlimeCrystal": "Summons Queen Slime", - "RocketLauncher": "Does extra damage on a direct hit", - "ProximityMineLauncher": "Mines deal triple damage when armed", - "EmpressFlightBooster": "Grants infinite wing and rocket boot flight\nIncreases flight and jump mobility", - "GelBalloon": "Throw this to make someone sparkle", - "Smolstar": "Summons an Enchanted Dagger to fight for you\nIgnores a substantial amount of enemy defense\n'Don't let their small size fool you'", - "QueenSlimeHook": "Teleports you to the location of the hook", - "VolatileGelatin": "Releases volatile gelatin periodically that damages enemies", - "TerrasparkBoots": "Allows flight, super fast running, and extra mobility on ice\n8% increased movement speed\nProvides the ability to walk on water, honey & lava\nGrants immunity to fire blocks and 7 seconds of immunity to lava", - "EmpressButterfly": "'Its wings are so delicate, you must be careful not to damage it...'", - "BlandWhip": "4 summon tag damage\n{$CommonItemTooltip.Whips}\n'Die monster!'", - "MaceWhip": "5 summon tag damage\n5% summon tag critical strike chance\n{$CommonItemTooltip.Whips}", - "ScytheWhip": "{$CommonItemTooltip.Whips}\nStrike enemies with dark energy to gain attack speed\nDark energy jumps from enemies hit by summons", - "SwordWhip": "9 summon tag damage\n{$CommonItemTooltip.Whips}\nStrike enemies to gain attack speed", - "ThornWhip": "6 summon tag damage\n{$CommonItemTooltip.Whips}\nStrike enemies to gain attack speed", - "FireWhip": "{$CommonItemTooltip.Whips}\nStrike enemies with blazing energy\nBlazing energy explodes from enemies hit by summons", - "CoolWhip": "{$CommonItemTooltip.Whips}\nStrike enemies to summon a friendly snowflake\n'Let me have some of that cool whip'", - "RainbowWhip": "20 summon tag damage\n10% summon tag critical strike chance\n{$CommonItemTooltip.Whips}", - "BadgersHat": "You seem to have a problem with your green screen\n'Great for impersonating streamers!'", - "ChippysCouch": "Heeellllllo Terraria enthusiasts!\n'Great for chilling like a streamer!'", - "ZapinatorGray": "'It might be broken'", - "ZapinatorOrange": "'It might be broken'", - "JoustingLance": "Build momentum to increase attack power\n'Have at thee!'", - "ShadowJoustingLance": "Build momentum to increase attack power", - "HallowJoustingLance": "Build momentum to increase attack power", - "StormTigerStaff": "Summons a white tiger to fight for you", - "EmpressBlade": "Summons an Enchanted Sword to fight for you", - "TreasureMagnet": "Increases pickup range for items", - "Mace": "Can be upgraded with torches", - "FlamingMace": "'May the fire light your way'", - "MoonLordLegs": "Slightly increases mobility\n'These might be Steve's'", - "Keybrand": "Deals more damage to injured foes", - "SpiderSinkSpiderSinkDoesWhateverASpiderSinkDoes": "'Spider-sink, Spider-sink, does whatever a spider can...'", - "SuperStarCannon": "'Sure, Brain, but where are you going to get enough stars for this?'", - "DrumSet": "'Badum, psh'", - "ToiletCactus": "'How desperate are you?'", - "GameMasterShirt": "'I thought I told you to clean up your room!'", - "GameMasterPants": "'I thought I told you to clean up your room!'", - "RollingCactus": "'They hatin'...'", - "RockLobster": "'But it wasn't a rock!'", - "ShroomMinecart": "'The shroom goes vroom'", - "Gladius": "'Are you not entertained?!'", - "MeowmereMinecart": "'brrrrrow'", - "PartyMinecart": "'All aboard the party wagon!'", - "SteampunkMinecart": "'Steam powered!'", - "ChefHat": "'This chicken is raw!'", - "Fedora": "'*tips* M'lady'", - "GlowPaint": "'What a bright idea!'", - "PigronMinecart": "'Powered by Bacon!'", - "QuadBarrelShotgun": "'When 2 or 3 just doesn't cut it'", - "SparkleGuitar": "'These chords are out of this world'", - "BouncingShield": "'I can do this all day'", - "BunnyTail": "'That's why they call me Thumper'", - "CombatWrench": "'For fixing things, and breaking them'", - "FireproofBugNet": "'For when things get too hot to handle'", - "FlameWakerBoots": "'Never get cold feet again'", - "RabbitOrder": "'It looks like a bunny, but its actually a bunny'", - "TruffleWormCage": "'Won't be running away now...'", - "GelBalloon": "'Filled with Party Girl bathwater'", - "Teacup": "{$CommonItemTooltip.MinorStats}\n'A must-have for tea parties'", - "MilkCarton": "{$CommonItemTooltip.MinorStats}\n'For strong, healthy bones'", - "CoffeeCup": "{$CommonItemTooltip.MediumStats}\n'Hello darkness my old friend'", - "TorchGodsFavor": "Unlocks an ability toggle to the left of the inventory\nWhen enabled normal torches change according to your biome", + "LeinforsPants": "{$CommonItemTooltip.DevItem}\n'Shia suprise! Didn't expect that from pants, did you?'", + "LeinforsWings": "{$CommonItemTooltip.DevItem}\n'It's full on! What does it mean?!'", + "LeinforsAccessory": "{$CommonItemTooltip.DevItem}\n'For best results, use with pasta-based diet'" } } \ No newline at end of file diff --git a/Localization/Content/en-US/Legacy.json b/Localization/Content/en-US/Legacy.json index 63002ba..948dca6 100644 --- a/Localization/Content/en-US/Legacy.json +++ b/Localization/Content/en-US/Legacy.json @@ -33,7 +33,7 @@ "37": "Spreading grass", "38": "Growing cacti", "39": "Planting sunflowers", - "3": "Putting dirt behind dirt", + "3": "Puttin dirt behind dirt", "40": "Planting trees", "41": "Planting herbs", "42": "Planting weeds", @@ -73,24 +73,15 @@ "73": "Validating world save:", "74": "Slime is falling from the sky!", "75": "Slime has stopped falling from the sky.", - "76": "Generating structures", + "76": "Generating Structures.", "77": "Adding more grass", "78": "Desertification", - "79": "Weathering caverns", + "79": "Spicing up walls", "7": "Making random holes", "80": "Chiseling marble", "81": "Growing granite", "8": "Generating small caves", - "9": "Generating large caves", - "82": "Disarming broken traps", - "83": "Growing rich mahogany", - "84": "Clean up", - "85": "Felling trees", - "86": "Final clean up", - "87": "Finalizing world", - "88": "Growing water plants", - "89": "Placing objects", - "90": "Forming the depths", + "9": "Generating large caves" }, "LegacyDialog": { "1": "I hope a scrawny kid like you isn't all that is standing between us and Cthulhu's Eye.", @@ -171,7 +162,7 @@ "167": "Always buy more wire than you need!", "168": "Did you make sure your device was plugged in?", "169": "Oh, you know what this house needs? More blinking lights.", - "17": "Keep your eye on the prize, buy a lens!", + "17": "Keep your eye on the prize, buy a lense!", "170": "You can tell a Blood Moon is out when the sky turns red. There is something about it that causes monsters to swarm.", "171": "Hey, buddy, do you know where any deathweed is? Oh, no reason; just wondering, is all.", "172": "If you were to look up, you'd see that the moon is red right now.", @@ -190,11 +181,11 @@ "184": "Now that you have some ore, you will need to turn it into a bar in order to make items with it. This requires a furnace!", "185": "You can create a furnace out of torches, wood, and stone. Make sure you are standing near a work bench.", "186": "You will need an anvil to make most things out of metal bars.", - "187": "Anvils can be crafted out of iron or lead, or purchased from a merchant.", + "187": "Anvils can be crafted out of iron, or purchased from a merchant.", "188": "Underground are crystal hearts which can be used to increase your max life. You can smash them with a pickaxe.", - "189": "If you gather 3 fallen stars, they can be combined to create an item that will increase your magic capacity.", + "189": "If you gather 5 fallen stars, they can be combined to create an item that will increase your magic capacity.", "19": "{PlayerName} is it? I've heard good things, friend!", - "190": "Stars fall all over the world at night. They can be used for all sorts of useful things. If you see one, be sure to grab it because they disappear after sunrise.", + "190": "Stars fall all over the world at night. They can be used for all sorts of usefull things. If you see one, be sure to grab it because they disappear after sunrise.", "191": "There are many different ways you can attract people to move in to our town. They will of course need a home to live in.", "192": "In order for a room to be considered a home, it needs to have a door, a chair, a table, and a light source. Make sure the house has walls as well.", "193": "Two people will not live in the same home. Also, if their home is destroyed, they will look for a new place to live.", @@ -213,7 +204,7 @@ "204": "If you combine lenses at a demon altar, you might be able to find a way to summon a powerful monster. You will want to wait until night before using it, though.", "205": "You can create worm bait with rotten chunks and vile powder. Make sure you are in a corrupt area before using it.", "206": "Demonic altars can usually be found in the corruption. You will need to be near them to craft some items.", - "207": "You can make a grappling hook from a hook and 3 chains. Skeletons found deep underground usually carry hooks, and chains can be made from iron bars or lead bars.", + "207": "You can make a grappling hook from a hook and 3 chains. Skeletons found deep underground usually carry hooks, and chains can be made from iron bars.", "208": "If you see a pot, be sure to smash it open. They contain all sorts of useful supplies.", "209": "There is treasure hidden all over the world. Some amazing things can be found deep underground!", "21": "Angel Statue you say? I'm sorry, I'm not a junk dealer.", @@ -419,8 +410,7 @@ "400": "Begging so soon?! Don't look at me like I'll have a change of heart overnight! ", "401": "Make sure to smash any crimson altar you can find. Something good is bound to happen if you do!", "402": "Crimson altars can usually be found in the crimson. You will need to be near them to craft some items.", - "403": "You can create a bloody spine with vertebrae. Make sure you are in a crimson area before using it.", - "404": "I think you are ready for your first major battle. Gather some lenses from the eyeballs at night and take them to a crimson altar.", + "403": "You can create a bloody spine with vertebrae. Make sure you are in a crimtane area before using it.", "41": "Quit being such a baby! I've seen worse.", "42": "That's gonna need stitches!", "43": "Trouble with those bullies again?", @@ -454,7 +444,7 @@ "69": "Have you tried using purification powder on the ebonstone of the corruption?", "7": "Night will be upon us soon, friend. Make your choices while you can.", "70": "I wish {ArmsDealer} would stop flirting with me. Doesn't he realize I'm 500 years old?", - "71": "Why does {Merchant} keep trying to sell me angel statues? Everyone knows that they don't do anything.", + "71": "Why does {Merchant} keep trying to sell me an angel statues? Everyone knows that they don't do anything.", "72": "Have you seen the old man walking around the dungeon? He doesn't look well at all...", "73": "I sell what I want! If you don't like it, too bad.", "74": "Why do you have to be so confrontational during a time like this?", @@ -616,7 +606,7 @@ "213": "Smart Cursor Priority: Pickaxe -> Axe", "214": "Smart Cursor Priority: Axe -> Pickaxe", "215": "Smart Block Placement: To Cursor", - "216": "Smart Block Placement: Disabled", + "216": "Smart Block Placement: Filling", "217": "Border Color", "218": "Cursor", "219": "Controls", @@ -658,13 +648,13 @@ "251": "Miner's Wobble: Disabled", "252": "Interface Movement Delay", "25": "Mediumcore", - "26": "Classic", + "26": "Softcore", "27": "Random", "28": "Create", - "29": "Hardcore characters die for good.", + "29": "Hardcore characters die for good", "2": "Disconnect", - "30": "Mediumcore characters drop items on death.", - "31": "Classic characters drop money on death.", + "30": "Mediumcore characters drop items on death", + "31": "Softcore characters drop money on death", "32": "Select difficulty", "33": "Shirt", "34": "Undershirt", @@ -799,7 +789,6 @@ "59": "It has been cursed by a powerful Jungle creature", "5": "% critical strike chance", "6": "Insanely fast speed", - "60": "Cannot be equipped or removed while shopping", "7": "Very fast speed", "8": "Fast speed", "9": "Average speed" @@ -816,7 +805,7 @@ "17": "{0} has joined the yellow party.", "18": "Welcome to", "19": "{0} has joined.", - "1": "Incorrect password", + "1": "Incorrect password.", "20": "{0} has left.", "21": "/players", "22": "{0} has joined the pink party.", @@ -836,7 +825,6 @@ "102": "Crimson", "103": "Random", "104": "Cannot be used without Etherian Mana until the Eternia Crystal has been defended", - "105": "Dragonfly", "10": "A horrible chill goes down your spine...", "11": "Screams echo around you...", "12": "Your world has been blessed with Cobalt!", @@ -916,7 +904,7 @@ "82": "Back", "83": "Favorite", "84": "You can't change teams inside your team's blocks!", - "85": "Jungle Bug", + "85": "Bug", "86": "Duck", "87": "Butterfly", "88": "Firefly", @@ -962,7 +950,6 @@ "121": "Drop Item", "122": "Sort Items", "123": "Cold Weather", - "124": "Ecto Mist", "12": "Helmet", "13": "Shirt", "14": "Pants", @@ -1064,7 +1051,7 @@ "LegacyChestType": { "0": "Chest", "10": "Ivy Chest", - "11": "Frozen Chest", + "11": "Ice Chest", "12": "Living Wood Chest", "13": "Skyware Chest", "14": "Shadewood Chest", @@ -1076,12 +1063,12 @@ "1": "Gold Chest", "20": "Crimson Chest", "21": "Hallowed Chest", - "22": "Ice Chest", + "22": "Frozen Chest", "23": "Locked Jungle Chest", "24": "Locked Corruption Chest", "25": "Locked Crimson Chest", "26": "Locked Hallowed Chest", - "27": "Locked Ice Chest", + "27": "Locked Frozen Chest", "28": "Dynasty Chest", "29": "Honey Chest", "2": "Locked Gold Chest", @@ -1141,14 +1128,6 @@ "2": "Rich Mahogany Dresser", "30": "{$ItemName.FrozenDresser}", "31": "{$ItemName.LivingWoodDresser}", - "32": "{$ItemName.SpiderDresser}", - "33": "{$ItemName.LesionDresser}", - "34": "{$ItemName.SolarDresser}", - "35": "{$ItemName.VortexDresser}", - "36": "{$ItemName.NebulaDresser}", - "37": "{$ItemName.StardustDresser}", - "38": "{$ItemName.SandstoneDresser}", - "39": "{$ItemName.BambooDresser}", "3": "Pearlwood Dresser", "4": "Shadewood Dresser", "5": "Blue Dungeon Dresser", @@ -1158,19 +1137,7 @@ "9": "Obsidian Dresser" }, "LegacyChestType2": { - "0": "{$ItemName.CrystalChest}", - "1": "{$ItemName.GoldenChest}", - "2": "{$ItemName.SpiderChest}", - "3": "{$ItemName.LesionChest}", - "4": "{$ItemName.GoldChest}", - "5": "{$ItemName.SolarChest}", - "6": "{$ItemName.VortexChest}", - "7": "{$ItemName.NebulaChest}", - "8": "{$ItemName.StardustChest}", - "9": "{$ItemName.GolfChest}", - "10": "{$ItemName.DesertChest}", - "11": "{$ItemName.BambooChest}", - "12": "{$ItemName.DungeonDesertChest}", - "13": "Locked {$ItemName.DungeonDesertChest}" + "0": "Crystal Chest", + "1": "Golden Chest" } } \ No newline at end of file diff --git a/Localization/Content/en-US/NPCs.json b/Localization/Content/en-US/NPCs.json index d0fd837..7c3b200 100644 --- a/Localization/Content/en-US/NPCs.json +++ b/Localization/Content/en-US/NPCs.json @@ -68,7 +68,7 @@ "Vampire": "Vampire", "MotherSlime": "Mother Slime", "Truffle": "Truffle", - "ZombieEskimo": "Frozen Zombie", + "ZombieEskimo": "Zombie Eskimo", "Frankenstein": "Frankenstein", "BlackRecluse": "Black Recluse", "WallCreeper": "Wall Creeper", @@ -309,9 +309,9 @@ "SleepingAngler": "Sleeping Angler", "Grasshopper": "Grasshopper", "ChatteringTeethBomb": "Chattering Teeth Bomb", - "CultistArcherBlue": "Cultist Archer", + "CultistArcherBlue": "Blue Cultist Archer", "Demolitionist": "Demolitionist", - "CultistArcherWhite": "Cultist Archer", + "CultistArcherWhite": "White Cultist Archer", "BrainScrambler": "Brain Scrambler", "RayGunner": "Ray Gunner", "MartianOfficer": "Martian Officer", @@ -338,7 +338,7 @@ "Hornet": "Hornet", "ManEater": "Man Eater", "ArmedZombie": "Zombie", - "ArmedZombieEskimo": "Frozen Zombie", + "ArmedZombieEskimo": "Zombie Eskimo", "ArmedZombiePincussion": "Zombie", "ArmedZombieSlimed": "Zombie", "ArmedZombieSwamp": "Zombie", @@ -428,12 +428,12 @@ "Crawdad": "Crawdad", "Crawdad2": "Crawdad", "CreatureFromTheDeep": "Creature from the Deep", - "CrimsonBunny": "Vicious Bunny", - "CrimsonGoldfish": "Vicious Goldfish", + "CrimsonBunny": "Crimtane Bunny", + "CrimsonGoldfish": "Crimtane Goldfish", "CrimsonPenguin": "Vicious Penguin", "CultistBoss": "Lunatic Cultist", "CultistBossClone": "Lunatic Cultist", - "CultistDevote": "Lunatic Devotee", + "CultistDevote": "Lunatic Devote", "CultistDragonBody1": "Phantasm Dragon", "CultistDragonBody2": "Phantasm Dragon", "CultistDragonBody3": "Phantasm Dragon", @@ -509,7 +509,7 @@ "SandsharkCrimson": "Flesh Reaver", "SandsharkHallow": "Crystal Thresher", "SandSlime": "Sand Slime", - "ShadowFlameApparition": "Shadowflame Apparition", + "ShadowFlameApparition": "Shadowflame Apparation", "SlimeSpiked": "Spiked Slime", "Sluggy": "Sluggy", "SolarFlare": "Solar Flare", @@ -585,89 +585,6 @@ "SkeletonMerchant": "Skeleton Merchant", "PirateShip": "Flying Dutchman", "PirateShipCannon": "Dutchman Cannon", - "BartenderUnconscious": "Unconscious Man", - "GiantWalkingAntlion": "Giant Antlion Charger", - "GiantFlyingAntlion": "Giant Antlion Swarmer", - "LarvaeAntlion": "Antlion Larva", - "FairyCritterPink": "Pink Fairy", - "FairyCritterGreen": "Green Fairy", - "FairyCritterBlue": "Blue Fairy", - "ZombieMerman": "Zombie Merman", - "EyeballFlyingFish": "Wandering Eye Fish", - "Golfer": "Golfer", - "GolferRescue": "Golfer", - "TorchZombie": "Zombie", - "ArmedTorchZombie": "Zombie", - "GoldGoldfish": "Gold Goldfish", - "GoldGoldfishWalker": "Gold Goldfish", - "WindyBalloon": "Windy Balloon", - "BlackDragonfly": "Dragonfly", - "BlueDragonfly": "Dragonfly", - "GreenDragonfly": "Dragonfly", - "OrangeDragonfly": "Dragonfly", - "RedDragonfly": "Dragonfly", - "YellowDragonfly": "Dragonfly", - "GoldDragonfly": "Gold Dragonfly", - "Seagull": "Seagull", - "Seagull2": "Seagull", - "LadyBug": "Ladybug", - "GoldLadyBug": "Gold Ladybug", - "Maggot": "Maggot", - "Pupfish": "Pupfish", - "Grebe": "Grebe", - "Grebe2": "Grebe", - "Rat": "Rat", - "Owl": "Owl", - "ExplosiveBunny": "Explosive Bunny", - "Turtle": "Turtle", - "TurtleJungle": "Jungle Turtle", - "WaterStrider": "Water Strider", - "GoldWaterStrider": "Gold Water Strider", - "Gnome": "Gnome", - "SeaTurtle": "Sea Turtle", - "Seahorse": "Seahorse", - "GoldSeahorse": "Gold Seahorse", - "Dolphin": "Dolphin", - "BloodSquid": "Blood Squid", - "BloodEelHead": "Blood Eel", - "BloodEelBody": "Blood Eel", - "BloodEelTail": "Blood Eel", - "GoblinShark": "Hemogoblin Shark", - "BloodNautilus": "Dreadnautilus", - "Dandelion": "Angry Dandelion", - "IceMimic": "Ice Mimic", - "BloodMummy": "Blood Mummy", - "RockGolem": "Rock Golem", - "MaggotZombie": "Maggot Zombie", - "BestiaryGirl": "Zoologist", - "SporeBat": "Spore Bat", - "SporeSkeleton": "Spore Skeleton", - "TownCat": "Cat", - "TownDog": "Dog", - "GemSquirrelAmethyst": "Amethyst Squirrel", - "GemSquirrelTopaz": "Topaz Squirrel", - "GemSquirrelSapphire": "Sapphire Squirrel", - "GemSquirrelEmerald": "Emerald Squirrel", - "GemSquirrelRuby": "Ruby Squirrel", - "GemSquirrelDiamond": "Diamond Squirrel", - "GemSquirrelAmber": "Amber Squirrel", - "GemBunnyAmethyst": "Amethyst Bunny", - "GemBunnyTopaz": "Topaz Bunny", - "GemBunnySapphire": "Sapphire Bunny", - "GemBunnyEmerald": "Emerald Bunny", - "GemBunnyRuby": "Ruby Bunny", - "GemBunnyDiamond": "Diamond Bunny", - "GemBunnyAmber": "Amber Bunny", - "HellButterfly": "Hell Butterfly", - "Lavafly": "Lavafly", - "MagmaSnail": "Magma Snail", - "TownBunny": "Bunny", - "QueenSlimeBoss": "Queen Slime", - "QueenSlimeMinionBlue": "Crystal Slime", - "QueenSlimeMinionPink": "Bouncy Slime", - "QueenSlimeMinionPurple": "Heavenly Slime", - "HallowBoss": "Empress of Light", - "EmpressButterfly": "Prismatic Lacewing", - "PirateGhost": "Pirate's Curse" + "BartenderUnconscious": "Unconscious Man" } } \ No newline at end of file diff --git a/Localization/Content/en-US/Projectiles.json b/Localization/Content/en-US/Projectiles.json index b24fec2..8592c25 100644 --- a/Localization/Content/en-US/Projectiles.json +++ b/Localization/Content/en-US/Projectiles.json @@ -29,7 +29,6 @@ "BeachBall": "Beach Ball", "Bee": "Bee", "BeeArrow": "Bee Arrow", - "BeeCloakStar": "Bee Cloak", "BeeHive": "Bee Hive", "Beenade": "Beenade", "BlackBolt": "Onyx Blaster", @@ -321,7 +320,6 @@ "MagicMissile": "Magic Missile", "MagnetSphereBall": "Magnet Sphere", "MagnetSphereBolt": "Magnet Sphere", - "ManaCloakStar": "Mana Cloak", "MartianTurretBolt": "Electric Bolt", "MartianWalkerLaser": "Laser Ray", "MechanicalPiranha": "Mechanical Piranha", @@ -444,7 +442,6 @@ "Pygmy4": "Pygmy", "PygmySpear": "Pygmy", "QuarterNote": "Note", - "QueenBeeStinger": "Queen Bee's Stinger", "RainbowBack": "Rainbow", "RainbowCrystal": "Rainbow Crystal", "RainbowCrystalExplosion": "Rainbow Explosion", @@ -565,7 +562,6 @@ "Stake": "Stake", "StarAnise": "Star Anise", "StardustCellMinion": "Stardust Cell", - "StarCloakStar": "Star Cloak", "StardustCellMinionShot": "Stardust Cell", "StardustChainsaw": "Stardust Chainsaw", "StardustDragon1": "Stardust Dragon", @@ -579,7 +575,6 @@ "StardustSoldierLaser": "Stardust Laser", "StardustTowerMark": "Starmark", "Starfury": "Starfury", - "StarVeilStar": "Star Veil", "StarWrath": "Star Wrath", "StaticHook": "Static Hook", "StickyBomb": "Sticky Bomb", @@ -590,8 +585,6 @@ "Stynger": "Stynger", "StyngerShrapnel": "Stynger", "Sunfury": "Sunfury", - "SuperStar": "Super Star Cannon", - "SuperStarSlash": "Super Star Cannon", "SuspiciousTentacle": "Suspicious Looking Tentacle", "SwordBeam": "Sword Beam", "Swordfish": "Swordfish", @@ -608,9 +601,6 @@ "ThornChakram": "Thorn Chakram", "ThornHook": "Hook", "ThrowingKnife": "Throwing Knife", - "ThunderSpear": "Storm Spear", - "ThunderSpearShot": "Storm Spear", - "ThunderStaffShot": "Thunder Zapper", "TiedEighthNote": "Note", "TikiSpirit": "Tiki Spirit", "TinyEater": "Tiny Eater", @@ -723,161 +713,6 @@ "ApprenticeStaffT3Shot": "Betsy's Wrath", "BookStaffShot": "Tome of Infinite Wisdom", "DD2Win": "Victory!", - "DD2JavelinHostileT3": "{$ProjectileName.DD2JavelinHostile}", - "Celeb2Weapon": "Celebration Mk2", - "Celeb2Rocket": "{$ProjectileName.Celeb2Weapon}", - "Celeb2RocketExplosive": "{$ProjectileName.Celeb2Weapon}", - "Celeb2RocketLarge": "{$ProjectileName.Celeb2Weapon}", - "Celeb2RocketLargeExplosive": "{$ProjectileName.Celeb2Weapon}", - "BlueDungeonDebris": "Debris", - "GreenDungeonDebris": "Debris", - "PinkDungeonDebris": "Debris", - "DirtGolfBall": "Golf Ball", - "GolfBallDyedBlack": "Golf Ball", - "GolfBallDyedBlue": "Golf Ball", - "GolfBallDyedBrown": "Golf Ball", - "GolfBallDyedCyan": "Golf Ball", - "GolfBallDyedSkyBlue": "Golf Ball", - "GolfBallDyedGreen": "Golf Ball", - "GolfBallDyedLimeGreen": "Golf Ball", - "GolfBallDyedOrange": "Golf Ball", - "GolfBallDyedPink": "Golf Ball", - "GolfBallDyedPurple": "Golf Ball", - "GolfBallDyedRed": "Golf Ball", - "GolfBallDyedTeal": "Golf Ball", - "GolfBallDyedViolet": "Golf Ball", - "GolfBallDyedYellow": "Golf Ball", - "GolfClubHelper": "Golf Club", - "VampireFrog": "Vampire Frog", - "BatOfLight": "Sanguine Bat", - "SharpTears": "Blood Thorn", - "ScarabBomb": "Scarab Bomb", - "RollingCactus": "Rolling Cactus", - "RollingCactusSpike": "Rolling Cactus Spike", - "Terragrim": "Terragrim", - "DripplerFlail": "Drippler Crippler", - "BabyBird": "Finch", - "PaperAirplaneA": "Paper Airplane", - "PaperAirplaneB": "Paper Airplane", - "ClusterRocketI": "Rocket", - "ClusterGrenadeI": "Grenade", - "ClusterMineI": "Proximity Mine", - "ClusterFragmentsI": "Cluster Fragment", - "ClusterRocketII": "Rocket", - "ClusterGrenadeII": "Grenade", - "ClusterMineII": "Proximity Mine", - "ClusterFragmentsII": "Cluster Fragment", - "WetRocket": "Rocket", - "WetGrenade": "Grenade", - "WetMine": "Proximity Mine", - "LavaRocket": "Rocket", - "LavaGrenade": "Grenade", - "LavaMine": "Proximity Mine", - "HoneyRocket": "Rocket", - "HoneyGrenade": "Grenade", - "HoneyMine": "Proximity Mine", - "MiniNukeRocketI": "Rocket", - "MiniNukeGrenadeI": "Grenade", - "MiniNukeMineI": "Proximity Mine", - "MiniNukeRocketII": "Rocket", - "MiniNukeGrenadeII": "Grenade", - "MiniNukeMineII": "Proximity Mine", - "DryRocket": "Rocket", - "DryGrenade": "Grenade", - "DryMine": "Proximity Mine", - "ClusterSnowmanRocketI": "Rocket", - "ClusterSnowmanRocketII": "Rocket", - "WetSnowmanRocket": "Rocket", - "LavaSnowmanRocket": "Rocket", - "HoneySnowmanRocket": "Rocket", - "MiniNukeSnowmanRocketI": "Rocket", - "MiniNukeSnowmanRocketII": "Rocket", - "DrySnowmanRocket": "Rocket", - "BloodShot": "Blood Shot", - "ShellPileFalling": "Shell Pile", - "SharkPup": "Shark Pup", - "LilHarpy": "Lil' Harpy", - "FennecFox": "Fennec Fox", - "GlitteryButterfly": "Glittery Butterfly", - "BookOfSkullsSkull": "Skull", - "StormTigerTier1": "Desert Tiger", - "StormTigerTier2": "Desert Tiger", - "StormTigerTier3": "Desert Tiger", - "StormTigerAttack": "Desert Tiger", - "WhiteTigerPounce": "Desert Tiger", - "StormTigerGem": "Desert Tiger", - "BloodNautilusShot": "Blood Shot", - "BloodNautilusTears": "Blood Tears", - "GladiusStab": "Gladius", - "BloodArrow": "Blood Rain", - "DandelionSeed": "Dandelion Seed", - "RulerStab": "Ruler", - "DynamiteKitten": "Dynamite Kitten", - "BabyWerewolf": "Baby Werewolf", - "ShadowMimic": "Shadow Mimic", - "ClusterSnowmanFragmentsI": "Cluster Fragment", - "ClusterSnowmanFragmentsII": "Cluster Fragment", - "SparkleGuitar": "Stellar Tune", - "FirstFractal": "First Fractal", - "FairyGlowstick": "Fairy Glowstick", - "VoltBunny": "Volt Bunny", - "CombatWrench": "Combat Wrench", - "Shroomerang": "Shroomerang", - "JoustingLance": "Jousting Lance", - "ShadowJoustingLance": "Shadow Jousting Lance", - "HallowJoustingLance": "Hallowed Jousting Lance", - "WetBomb": "Wet Bomb", - "LavaBomb": "Lava Bomb", - "HoneyBomb": "Honey Bomb", - "DryBomb": "Dry Bomb", - "OrnamentStar": "Ornament", - "RockGolemRock": "Rock", - "TitaniumStormShard": "Titanium Shard", - "HallowBossLastingRainbow": "Everlasting Rainbow", - "HallowBossRainbowStreak": "Prismatic Bolt", - "FairyQueenLance": "Ethereal Lance", - "FairyQueenSunDance": "Sun Dance", - "QueenSlimeMinionBlueSpike": "Crystal Spike", - "QueenSlimeMinionPinkBall": "Bouncy Gel", - "QueenSlimeSmash": "Queenly Smash", - "QueenSlimeGelAttack": "Regal Gel", - "DirtBomb": "Dirt Bomb", - "DirtStickyBomb": "Sticky Dirt Bomb", - "BouncingShield": "Sergeant United Shield", - "DripplerFlailExtraBall": "Drippler Crippler", - "FallingStarSpawner": "Falling Star", - "SantankMountRocket": "Rocket", - "BlandWhip": "Leather Whip", - "SwordWhip": "Durendal", - "MaceWhip": "Morning Star", - "ScytheWhip": "Dark Harvest", - "CoolWhip": "Cool Whip", - "FireWhip": "Firecracker", - "ThornWhip": "Snapthorn", - "ScytheWhipProj": "Reaping", - "CoolWhipProj": "Cool Flake", - "FireWhipProj": "Firecracker", - "RainbowWhip": "Kaleidoscope", - "Smolstar": "Enchanted Dagger", - "PiercingStarlight": "Starlight", - "FairyQueenMagicItemShot": "Nightglow", - "FairyQueenRangedItemShot": "Twilight Lance", - "VolatileGelatinBall": "Volatile Gelatin", - "CopperShortswordStab": "Copper Shortsword", - "TinShortswordStab": "Tin Shortsword", - "IronShortswordStab": "Iron Shortsword", - "LeadShortswordStab": "Lead Shortsword", - "SilverShortswordStab": "Silver Shortsword", - "TungstenShortswordStab": "Tungsten Shortsword", - "GoldShortswordStab": "Gold Shortsword", - "PlatinumShortswordStab": "Platinum Shortsword", - "FinalFractal": "Zenith", - "ZapinatorLaser": "Zapinator", - "GelBalloon": "Sparkle Slime Balloon", - "EmpressBlade": "Terraprisma", - "Mace": "Mace", - "FlamingMace": "Flaming Mace", - "StardustPunch": "Stardust Guardian", - "TorchGod": "The Torch God", + "DD2JavelinHostileT3": "{$ProjectileName.DD2JavelinHostile}" } } \ No newline at end of file diff --git a/Localization/Content/en-US/Town.json b/Localization/Content/en-US/Town.json index 1742130..d27ce56 100644 --- a/Localization/Content/en-US/Town.json +++ b/Localization/Content/en-US/Town.json @@ -24,340 +24,6 @@ "Name_15": "Dani Moo", "Name_16": "Paddy" }, - "GolferNames": { - "Name_1": "Lion Pines", - "Name_2": "Gunner McLovin", - "Name_3": "Harry Madison", - "Name_4": "Arnie Palmfrond", - "Name_5": "Jake Nicklelisp", - "Name_6": "William", - "Name_7": "Billy Bones", - "Name_8": "Jim Mulligan" - }, - "BestiaryGirlNames": { - "Name_1": "Maria", - "Name_2": "MacKenzie", - "Name_3": "Azaria", - "Name_4": "Juanita", - "Name_5": "Astra", - "Name_6": "Hayley", - "Name_7": "Becca", - "Name_8": "Veronica", - "Name_9": "Tia", - "Name_10": "Robyn", - "Name_11": "Arien", - "Name_12": "Jane", - "Name_13": "Bindi", - "Name_14": "Dian", - "Name_15": "Lori", - "Name_16": "Mardy", - "Name_17": "Mollie", - "Name_18": "Lizzy", - "Name_19": "Daphne", - "Name_20": "Ellen" - }, - - "CatNames_Siamese": { - "Zen": "Zen", - "Callie": "Callie", - "Rainha": "Rainha", - "Nust": "Nust", - "Bandit": "Bandit", - "Goliath": "Goliath", - "Valerie": "Valerie", - "Socks": "Socks", - "Iris": "Iris", - "Sekhmet": "Sekhmet", - "Cleo": "Cleo", - "Sappho": "Sappho" - }, - "CatNames_Black": { - "Luna": "Luna", - "Figment": "Figment", - "Ember": "Ember", - "Damien": "Damien", - "Snowball": "Snowball", - "Night": "Night", - "Misu": "Misu", - "Magic": "Magic", - "Tonic": "Tonic", - "Violet": "Violet", - "Jaspers": "Jaspers", - "Gargoyle": "Gargoyle", - "Lilith": "Lilith", - "Salem": "Salem", - "Rascal": "Rascal", - "Bella": "Bella", - "Odin": "Odin", - "Jiji": "Jiji", - "Morgan": "Morgan", - "Arbus": "Arbus", - "Max": "Max", - "George": "George" - }, - "CatNames_OrangeTabby": { - "Linkle": "Linkle", - "Remy": "Remy", - "Lux": "Lux", - "Sunny": "Sunny", - "Tigger": "Tigger", - "Callie": "Callie", - "Sassy": "Sassy", - "Bob": "Bob", - "Leo": "Leo", - "Tiger": "Tiger", - "Caramel": "Caramel", - "Tony": "Tony", - "Garfield": "Garfield", - "Hobbes": "Hobbes", - "Charlie": "Charlie", - "Rascal": "Rascal", - "Critter": "Critter", - "Adol": "Adol" - }, - "CatNames_RussianBlue": { - "Alexi": "Alexi", - "Ruby": "Ruby", - "Bubbles": "Bubbles", - "Lexi": "Lexi", - "Prissy": "Prissy", - "Valery": "Valery", - "Lucy": "Lucy", - "Pete": "Pete", - "Jocelyn": "Jocelyn", - "Light": "Light", - "Lily": "Lily", - "Starlight": "Starlight", - "Cobalt": "Cobalt", - "Tilly": "Tilly", - "Rion": "Rion", - "Momo": "Momo" - }, - "CatNames_Silver": { - "Roo": "Roo", - "Blaze": "Blaze", - "Rebus": "Rebus", - "Polo": "Polo", - "Kelly": "Kelly", - "Kiva": "Kiva", - "Sooty": "Sooty", - "By": "By", - "Tor": "Tor", - "Trudy": "Trudy", - "Nana": "Nana", - "Ange": "Ange", - "Kanako": "Kanako", - "Freya": "Freya", - "Cloud": "Cloud", - "Cutie": "Cutie", - "Renne": "Renne" - }, - "CatNames_White": { - "Misty": "Misty", - "Storm": "Storm", - "Angel": "Angel", - "Vincent": "Vincent", - "MrCat": "Mr. Cat", - "Holly": "Holly", - "Sam": "Sam", - "Rory": "Rory", - "Ichibi": "Ichibi", - "Belle": "Belle", - "Yuki": "Yuki", - "Ater": "Ater", - "Snowdrop": "Snowdrop", - "Snowball": "Snowball", - "Reah": "Reah" - }, - "DogNames_Labrador": { - "Penny": "Penny", - "Pebbles": "Pebbles", - "Puppy": "Puppy", - "Monroe": "Monroe", - "Kittie": "Kittie", - "Buddy": "Buddy", - "Charlie": "Charlie", - "Trulte": "Trulte", - "Daisy": "Daisy", - "Calvin": "Calvin", - "Willow": "Willow", - "Arthur": "Arthur", - "John": "John", - "Bitsy": "Bitsy", - "Mike": "Mike", - "Sparky": "Sparky", - "Lucky": "Lucky" - }, - "DogNames_PitBull": { - "Max": "Max", - "Dexter": "Dexter", - "Chomps": "Chomps", - "Bubba": "Bubba", - "Sampson": "Sampson", - "Spike": "Spike", - "Ginger": "Ginger", - "Kona": "Kona", - "Keith": "Keith", - "Jazzy": "Jazzy", - "Rex": "Rex", - "Toshiro": "Toshiro", - "Buster": "Buster", - "Doug": "Doug" - }, - - "DogNames_Beagle": { - "Zelda": "Zelda", - "Navi": "Navi", - "Ali": "Ali", - "Fred": "Fred", - "Roxie": "Roxie", - "Milo": "Milo", - "Copper": "Copper", - "Darwin": "Darwin", - "Lieselotte": "Lieselotte", - "Wilma": "Wilma", - "Odie": "Odie", - "Feena": "Feena" - }, - "DogNames_Corgi": { - "Bella": "Bella", - "Ellie": "Ellie", - "Baxter": "Baxter", - "Oliver": "Oliver", - "Maya": "Maya", - "Titus": "Titus", - "Shino": "Shino", - "Elizabeth": "Elizabeth", - "Victoria": "Victoria", - "Yona": "Yona", - "Ammy": "Ammy", - "Charles": "Charles", - "Estelle": "Estelle", - "Astro": "Astro" - }, - "DogNames_Dalmation": { - "Spot": "Spot", - "Suzy": "Suzy", - "Lucky": "Lucky", - "Marshall": "Marshall", - "Dotty": "Dotty", - "Pongo": "Pongo", - "Sapphire": "Sapphire", - "Splat": "Splat", - "Aurora": "Aurora", - "Akane": "Akane", - "Firebug": "Firebug", - "Polka": "Polka", - "Mizore": "Mizore" - }, - "DogNames_Husky": { - "Rosalie": "Rosalie", - "Balto": "Balto", - "Miska": "Miska", - "Sky": "Sky", - "Sasha": "Sasha", - "Zoey": "Zoey", - "Toya": "Toya", - "Snowdog": "Snowdog", - "Kayla": "Kayla", - "Hachiko": "Hachiko", - "Indiana": "Indiana", - "Sven": "Sven", - "Bullet": "Bullet", - "Comet": "Comet", - "Ingrid": "Ingrid", - "Dogi": "Dogi" - }, - "BunnyNames_White": { - "Bunnicula": "Bunnicula", - "Ben": "Ben", - "Roger": "Roger", - "Skippy": "Skippy", - "Donnie": "Donnie", - "Alice": "Alice", - "Presto": "Presto", - "Shion": "Shion", - "Lisette": "Lisette", - "Lily": "Lily", - "Inaba": "Inaba", - "Shirayuki": "Shirayuki", - "Lilia": "Lilia", - }, - "BunnyNames_Angora": { - "Breadbuns": "Breadbuns", - "Loaf": "Loaf", - "Babs": "Babs", - "BigB": "Big B", - "Greg": "Greg", - "Fluffy": "Fluffy", - "Pom": "Pom", - "Muffin": "Muffin", - "Maximus": "Maximus", - "Donald": "Donald", - }, - "BunnyNames_Dutch": { - "Oreo": "Oreo", - "Olaf": "Olaf", - "Domino": "Domino", - "Oz": "Oz", - "Yin": "Yin", - "Yang": "Yang", - "Pow": "Pow", - "Kaguya": "Kaguya", - "Mono": "Mono", - "Panda": "Panda", - "Orin": "Orin" - }, - "BunnyNames_Flemish": { - "Thumper": "Thumper", - "Cinnabun": "Cinnabun", - "Peter": "Peter", - "Hazel": "Hazel", - "Loki": "Loki", - "Sunflower": "Sunflower", - "Toby": "Toby", - "Daisy": "Daisy", - "Dusty": "Dusty", - "Jazz": "Jazz", - "Russell": "Russell", - "Honeycomb": "Honeycomb" - }, - "BunnyNames_Lop": { - "Bunbun": "Bunbun", - "Lola": "Lola", - "Max": "Max", - "Tyler": "Tyler", - "Flops": "Flops", - "Flappie": "Flappie", - "Caerbannog": "Caerbannog", - "Mochi": "Mochi", - "Dandy": "Dandy", - "Puff": "Puff", - "Youp": "Youp", - "Boof": "Boof", - "Veidra": "Veidra" - }, - "BunnyNames_Silver": { - "Bugz": "Bugz", - "Buster": "Buster", - "Silvine": "Silvine", - "Bunstar": "Bunstar", - "Lord": "Lord", - "Bunnykins": "Bunnykins", - "Crystal": "Crystal", - "Chrome": "Chrome", - "Vincent": "Vincent", - "Zach": "Zach", - "Joshua": "Joshua", - "Dustbunny": "Dustbunny", - "Dusty": "Dusty" - }, - - - "AnglerQuestChatter": { - "Chatter_1": "Wooow! You've bothered me, like, {AnglerCompletedQuestsCount} times! If I didn't have a cool fish for each time, I would be really mad!", - "Chatter_2": "Did you know I have {AnglerCompletedQuestsCount} amazingly awesome fish now!? That's because as far as errand monkeys go, you're actually a bit useful!" - }, "BartenderChatter": { "Chatter_1": "I've got the cure for what ails ya! Get it? Ale? No?", "Chatter_2": "They say you're strong, well, I know strong. Let's see if you measure up.", @@ -379,66 +45,14 @@ "Chatter_18": "{?HardMode}I know a Lavamancer that would really like that hellstone down in the underworld.", "Chatter_19": "{?Homeless}Know any good places to set up shop? Would love to open up a bar here." }, - "GolferChatter": { - "Chatter_1": "I'm not the type to scream and thrash around just because my ball lands in the water. I stay calm, and collected, and focus on the next shot.", - "Chatter_2": "Huh? You eat WHAT for breakfast?", - "Chatter_3": "An early bird catches the worm, but an early hole catches the birdie.", - "Chatter_4": "Lick your finger and hold it to the wind. Golf balls are lightweight and easily influenced by a breeze.", - "Chatter_5": "If sand is causing you nightmares, your wedge is your dreamcatcher.", - "Chatter_6": "Should I take up fishing? Bribing {Angler} to fetch my balls out of the water is emptying my wallet!", - "Chatter_7": "To strike high, strike far, or to get unstuck? It's all about the club you use. Choose wisely!", - "Chatter_8": "When I offer you to go clubbing, I don't mean downtown. I mean like, with a five iron?", - "Chatter_9": "In this game, only losers go for that high score.", - "Chatter_10": "Landscapers must make a lot of green off us golfers. Heh!", - "Chatter_11": "{Armsdealer} has mistaken my golf balls as ammo for his musket on several occassions.", - "Chatter_12": "According to {Dryad}, I'm murdering a lot of her friends when I mow the lawn. I gotta have a fairway for my course!", - "Chatter_13": "If you land on the green, use a putter! Don't let your balls go flying away when you're THAT close.", - "Chatter_14": "Don't go chasing water hazards, please stick to the fairways and greens that you're used to.", - "Chatter_15": "{?BloodMoon}The blood stains on my club? Have you seen the zombies outside?!", - "Chatter_16": "{?BloodMoon}I don't know what's scarier, a Blood Moon or my sister during a Blood Moon!", - "Chatter_17": "{?Rain}Golfing in THIS weather?! Only if you like swinging around a giant lightning rod!" - }, - "BestiaryGirlChatter": { - "Chatter_1": "I collected critters like you once, then I took a cursed fox bite to the knee!", - "Chatter_2": "{?Eclipse}Like wow, I feel like I belong with the creepy killer things running around right now. So glad I'm not that mindless.", - "Chatter_3": "I may not know, like, a whole lot...but I can talk your head off about nature and critters and animals and wildlife and...", - "Chatter_4": "My older bro calls me a lycanthrope. It means I'm like, part animal or something. He'd know, though, because he spends all his time outside!", - "Chatter_5": "I love animals, like, a lot! I tried to pet this weird looking fox one time, he sooo bit me, and now I became like one! Rad!", - "Chatter_6": "Staahp pulling on my tail, bro, it's totally real, and like...totally hurts when you pull on it!", - "Chatter_7": "Huh?! No, {Stylist} didn't dye my hair. It's naturally this color! It was like, dark brown before I was bitten, though!", - "Chatter_8": "Oh, THESE ears? Haha, totes better to hear you with, my dear!", - "Chatter_9": "This one time, at critter camp, I woke up one morning and everything was torn apart! Like, wow, how did I sleep through THAT?!", - "Chatter_10": "Wow, like, I've never seen a full moon. For some reason, it's like I pass out every time one's around!", - "Chatter_11": "I have noooo idea how I got here, but it's mega rad." - }, - "BestiaryGirlLycantropeChatter": { - "Chatter_1": "Grrr!! Away. Stay. NOW!", - "Chatter_2": "Rawgh! Roo! Danger. Me. Wraaaath!" - }, - "CatChatter": { - "Chatter_1": "Meow!", - "Chatter_2": "Purr...", - "Chatter_3": "Merrooow!" - }, - "DogChatter": { - "Chatter_1": "Woof!", - "Chatter_2": "Bark!", - "Chatter_3": "Woof woof!" - }, - "BunnyChatter": { - "Chatter_1": "*Rabbit noises*", - "Chatter_2": "*Bunny noises*" - }, - "BestiaryGirlSpecialText": { - "Party": "So, uh, I can't wear the hat. Sorry. I'm still here for the party, no worries!", - "Graveyard1": "My instincts are totally going wild. I really need to get out of here!", - "Graveyard2": "Ok, like, this place is totally freaky. It makes my fur stand on end!", - "Windy1": "Running in the wind makes me feel so free and wild. Totes try it sometime!", - "Windy2": "The breeze blows through my hair, it's, like, woah.", - "Storm1": "Eek!! You have NO idea how much thunder hurts my sensitive ears.", - "Storm2": "Is it over yet? I have this, like, irrational fear of thunderstorms.", - "Rain1": "Staaaap! Ugh! Not you, this lame rain.", - "Rain2": "For real!? I can't STAND being wet! It's gross." + "BartenderSpecialText": { + "FirstHelp": "For starters, take a few of these Defender Medals, on the house! I've got some special defenses you can purchase, but only with Defender Medals!", + "FirstMeeting": "Huh? How did I get here? The last thing I remember was a portal opening up in front of me...", + "BeforeDD2Tier1": "We should really do something about the Old One's Army. Ask me about the Eternia Crystal if you want to learn more.", + "AfterDD2Tier1": "Great job on fighting off the Old One's Army! But I'm sure we haven't seen the last of them, they didn't put up much of a fight this time.", + "AfterDD2Tier2": "The Army of the Old One's keeps getting stronger, yet you keep pushing them back! But something tells me they aren't quite finished with us yet.", + "AfterDD2Tier3": "You really kept the full force of the Old One's Army at bay? Maybe you should visit Etheria some time.", + "Party": "I really need some birthday text, Yorai!" }, "BartenderHelpText": { "Help_1": "The first thing you need to know about are the special defensive artifacts I've got for sale, but only if you've got some Defender Medals!", @@ -454,64 +68,14 @@ "Help_11": "I've also heard rumors that the power of the artifacts themselves may be further unlocked if you defeat the Old One's Army. Perhaps you could even use them any time you wish!" }, "GuideHelpText": { - "Help_1063": "Normally I'd try to teach you all about the Old One's Army, but you should probably ask {Bartender} about that.", - "Help_1064": "When the moon goes red, the water becomes like blood. Creatures submerged within may become grotesque and malicious." + "Help_1063": "Normally I'd try to teach you all about the Old One's Army, but you should probably ask {Bartender} about that." }, - - "GuideHelpTextSpecific": { - "Help_1100": "I hear a race of lizardmen live in the jungle. Maybe you can get the attention of one by felling a giant beast of the jungle?", - "Help_1101": "I hear there's a woman out there well-versed in fighting back the forces you just unleashed. Maybe if you prove yourself, you can get her attention.", - "Help_1102": "Machines aren't so bad. Maybe we can build one of our own, if we can just get some explosive weaponry from the jungle...", - "Help_1103": "I once met a stylist in this region. She went off adventuring underground and that was the last I saw of her. Wonder what became of her?", - "Help_1104": "Ever caught a strange fish and you aren't sure what to do with it? I hear a fishing master lives near the ocean who might have a use for those...", - "Help_1105": "The Tortured Soul down in the Underworld sure looks familiar...have you tried using Purification Powder on him?", - "Help_1106": "There have been some pirates sighted around lately. If we befriend one, you think he might show us where he buried his treasure?", - "Help_1107": "There are some special plants and other ingredients that can be used to dye things. Maybe if you keep some with you, you'll find someone to show you how.", - "Help_1108": "I've heard of glowing mushrooms growing big enough on the surface to gain sentience. Wonder if there's any truth to that...", - "Help_1109": "They say sand is terrible for golfing. No self-respecting golfer would ever be caught in a desert...right?", - "Help_1110": "Artists like to practice their craft, and painters like to paint. If enough people move in, we'll have enough homes that a painter might show up to spruce up the place!", - "Help_1111": "A lot of people have moved in lately, haven't they? If it gets much more busy around here, a party girl will surely move in!", - "Help_1112": "Always keep an eye out for strangers in need! You never know when you might meet someone new who is in need of help.", - "Help_1113": "If {Merchant}'s wares don't interest you, a wandering merchant often visits with exotic merchandise you might prefer.", - "Help_1114": "Not all of the undead monsters are hostile. I hear one even sells merchandise deep underground.", - "Help_1115": "This world is full of many exciting and dangerous creatures to discover. There are some experts who might reward you for sharing that knowledge with them!", - "Help_1120": "If you thought rainy days were a drag, wait till you see it raining slime!", - "Help_1121": "On rare occasions, the moon will blot out the sun, bringing out lots of scary monsters!", - "Help_1122": "Ever seen the Goblin Scouts in the outer regions of the world? I wonder if an invasion is imminent...", - "Help_1123": "I think I saw a treasure map floating around in the ocean once, but a shark ate it. Maybe you should go try and find one?", - "Help_1124": "I saw some flashing lights, high up in the sky and far away. The truth is out there, I'm telling you.", - "Help_1125": "Have you ever seen beautiful lanterns floating across the night sky? The people of this world celebrate your victories, wishing you good fortune.", - "Help_1130": "If you place an empty bottle on a table, you can use it to craft all sorts of neat potions!", - "Help_1131": "Hang up any banners you earn from defeating foes, as they will help you in future combat with that creature.", - "Help_1132": "It's pretty cold in the snow biome, but there are some unique treasures there as well. I'd check it out!", - "Help_1133": "There are antlion tunnels deep beneath the desert, full of rare fossils and many hazards!", - "Help_1134": "If you find a marble biome, be careful! They say that those locations are inhabited by some very dangerous creatures!", - "Help_1135": "In granite biomes, the very stone itself is a threat, frequently coming to life and attacking intruders!", - "Help_1136": "Need to craft something with ores you can't find on {WorldName}? Try fishing for crates, or placing silt and slush into the Extractinator!", - "Help_1137": "If you ever need a break from all this adventuring, there's always time for some good old fashioned fishing.", - "Help_1138": "While you explore the underground, you may occasionally encounter helpful fairies. If you follow them, maybe they will lead you to treasure!", - "Help_1140": "Your next step should be to explore the caverns of the Crimson. Find and destroy any Crimson Hearts that you come across.", - "Help_1141": "The Crimstone in the Crimson can be purified using some powder from a Dryad, or it can be destroyed with explosives.", - "Help_1142": "Try to gather some obsidian, formed when water and lava meet. It can be used to protect against intense heat.", - "Help_1143": "Some say there are giant bee hives buried underground in the jungle. I could do with some honey myself.", - "Help_1144": "You found some old fossils in the desert? I wonder if there is a way to extract them from the rock.", - "Help_1145": "It's time to upgrade that old Furnace! Look for a Hellforge in the Underworld, it's the only way to craft Hellstone bars.", - "Help_1146": "Have you seen the Wyverns soaring high up in the clouds? If only I could fly like that...", - "Help_1147": "Try combining a Hellforge with some adamantite ore. I bet you could make some really powerful stuff with that!", - "Help_1148": "Try combining a Hellforge with some titanium ore. I bet you could make some really powerful stuff with that!", - "Help_1149": "Run into any rare fruit growing in the jungle lately? If you eat it, it will increase your max life!", - "Help_1150": "I've heard of glowing pink bulbs growing around the jungle recently. Be ready for anything if you decide to harvest one.", - "Help_1151": "That key you have can be used to unlock the Temple hidden in the jungle. Have you found it yet?", - "Help_1152": "They say that there is a sealed Temple, hidden away in the jungle. I wonder how you could open it?", - "Help_1153": "Wow, that key you have is pretty nifty! I heard keys like that can be used to get rare treasure in the Dungeon!", - "Help_1154": "I've heard reports of a very strange worm in the underground mushroom fields. I wonder if it would be any good as bait?", - "Help_1155": "Ancient prophecies speak of a way to summon the monstrous hordes of Halloween through medallions crafted with pumpkins.", - "Help_1156": "Legends tell of a cursed gift that can turn the most festive of nights into an invasion of horrors!", - "Help_1157": "There are some strange people in hoods loitering outside of the Dungeon. Maybe you should check it out?", - "Help_1158": "Where the heck did those Pillars come from?! You should clear out some of the monsters around them!", - "Help_1159": "If you combine lenses at a crimson altar, you might be able to find a way to summon a powerful monster. You will want to wait until night before using it, though." + "GoblinTinkererChatter": { + "Chatter_1": "You know, these Etherian Goblins are nothing like my people. Really rowdy bunch. Not that my people are much better..." + }, + "AnglerChatter": { + "Chatter_1": "How come {Bartender} won't sell me any ale? I want to try some! What a grouch!" }, - "AnglerQuestText": { "NoQuest_1": "I don't have anything for you to do right now.", "NoQuest_2": "You have entertained me enough for today, go.", @@ -528,7 +92,7 @@ "Quest_Catfish": "I finally found a jungle cat that likes water! I think it's because it's also part fish. I don't know why this happened, and I don't want to know. I just want it in my hands, and make it snappy!\n\n(Caught in Jungle Surface)", "Quest_Cloudfish": "There's a rumor going around that there are islands that float high up in the sky, and that they have amazing treasure! Who cares about that though, what's even cooler is that sometimes lakes form in the clouds, and in those lakes are fish made out of clouds! I wanna know what it tastes like, so you better go catch it for me!\n\n(Caught in Sky Lakes)", "Quest_Cursedfish": "There's a cursed fish swimming in the waters of the deepest corruption! It was forged of the cursed flames that spread from the fallen horrors that lurk down there. They say not even water can put out this fire, and that it can burn forever. I can think of some awesome things I can do with a fish like that! You gonna go get it for me, or are you too chicken!?\n\n(Caught in Corruption)", - "Quest_Dirtfish": "I was reeling in the big one when this funny talking zombie burst out of the forest lake and started rambling on about this 'ferocious' species of fish made out of dirt! He says it could suffocate ten blokes his size, or something like that... I want it! NOW!\n\n(Caught in Surface & Underground)", + "Quest_Dirtfish": "I was reeling in the big one when this funny talking zombie burst out of the forest lake and started rambling on about this 'ferocious' species of fish made out of dirt! He says it could suffocate ten blokes his size, or something like that... I want it! NOW!\n\n(Caught in Surface, Underground, & Caverns)", "Quest_DynamiteFish": "The demolitionist was raising cane about losing a stick of dynamite in the lake out in the forest. He has like, so many, so why does one matter? Apparently, because it grew fins and started swimming away! I don't know where he gets his materials to make those things, but that one is clearly possessed! Reel it in and bring it to me, I always wanted a suicide bombing fish! Don't ask why...\n\n(Caught in Surface)", "Quest_EaterofPlankton": "I bet you're not brave enough to find the Eater of Plankton. A corrupt fish that was mutated from a severed piece of the Eater of Worlds itself! Capture it and bring it to me, and prove to me you're not a wuss!\n\n(Caught in Corruption)", "Quest_FallenStarfish": "I love collecting those bright yellow stars that fall from the sky! I love it even more when they land on someone's head. But.. but.. nothing beats a star that falls in a foresty lake and turns into a fish! That's just totally rad, and you're just rad enough to get it for me!\n\n(Caught in Sky Lakes)", @@ -547,7 +111,7 @@ "Quest_GuideVoodooFish": "Those demons in the underworld really like voodoo dolls, but I think there's a doll out there who was blasted with way too much magic! It turned into a fish and it does stuff on its own. I dare you to go down and get me one! I'd watch out for the boiling lava, because it burns you to death and that won't get me my fish!\n\n(Caught in Caverns)", "Quest_Wyverntail": "I know something youuuuu don't! Fine, I'll tell you, there's a terrifying creature that flies among the stars! I'm not making this up! It's called a Wyvern! But, but, you knew that already, right? Well what you don't know is that they are born and raised as tadpoles! So, they're actually like.. well, a frog! Hop to it and get me one!\n\n(Caught in Sky Lakes)", "Quest_ZombieFish": "You won't believe it! I caught a fish in the forest at night that was already dead! Then it tried to eat me! I threw it away and ran! Now I want to stick it in someone's dresser to see what happens, so go fish it back up for me will ya?!\n\n(Caught in Surface)", - "Quest_AmanitaFungifin": "I found this spectacular place draped in giant glowing mushrooms! Everything was blue! I was picking some of the mushrooms I found next to a glistening blue lake, when one of the mushrooms snapped at me and swam away! I want to give it a taste of its own medicine, and give it a good chompin'! What I mean is, you gotta get it for me!\n\n(Caught in Glowing Mushroom Fields)", + "Quest_AmanitiaFungifin": "I found this spectacular place draped in giant glowing mushrooms! Everything was blue! I was picking some of the mushrooms I found next to a glistening blue lake, when one of the mushrooms snapped at me and swam away! I want to give it a taste of its own medicine, and give it a good chompin'! What I mean is, you gotta get it for me!\n\n(Caught in Glowing Mushroom Fields)", "Quest_Angelfish": "Did you know there's magical islands that float up high in the sky? Bet you didn't! They say angels live in the sky, and I believe those angels have fins and gills and swim around! I believe you must catch one for me!\n\n(Caught in Sky Lakes)", "Quest_BloodyManowar": "Ow! Don't get near me! I got stung by a Bloody Man-O-War! In case you're not smart enough to know what that is, it's the most menacing jellyfish in all of {WorldName}! Go to that rotten crimson and catch it if you dare! \n\n(Caught in Crimson)", "Quest_Bonefish": "Normally I could care less if I see fishbones floating in the water underground, but this one was swimming! What, you thought that only human skeletons still flailed about in {WorldName}? Get it for me so I can stick it in someone's bed!\n\n(Caught in Underground & Caverns)", @@ -559,78 +123,9 @@ "Quest_Fishron": "There's a legend of a mighty being known as the Fishron! It's part pig, part dragon, and part FISH! I hear it hangs around in the frozen subterranean lakes of the coldest part of the world! I'm not going there, so YOU go catch it and makes sure it lands in my hands! I'm so excited!\n\n(Caught in Underground Tundra)", "Quest_InfectedScabbardfish": "A really long fish that looks like a sword's sheath swims in the murky waters of the corruption! It looks a lot like ebonstone, so don't let it fool you! That's right, you. You're catching it, not me!\n\n(Caught in Corruption)", "Quest_Mudfish": "Watch your step when wading through jungle waters! Why? No, not because I care about you being eaten by piranhas. I care because you'll step on one of my favorite kinds of fish, the Mud Fish! I also care a lot that you're going to grab me one as a pet!\n\n(Caught in Jungle)", + "Quest_Slimefish": "In the forest, the slimes are kinda gross. Slimefish are even more so! I don't want to swim with slimes, so yoink one out of the water for me!\n\n(Caught Anywhere)", "Quest_TropicalBarracuda": "Piranhas and sharks are ugly! Soooo ugly! Did you know there's a fish that looks very pretty and still can eat your face off? I would pay 2 platinum to see that happen, by the way... To the point, though, you catchy for me. Just make sure I have it before you lose your face!\n\n(Caught Jungle Surface)", - "Quest_TundraTrout": "You ever wonder why the lakes on the surface of the snowy areas of {WorldName} never ice over? I don't. The fish, however, do! A fish made out of ice would make a great offering to the mighty and amazing {Angler}! Go, my loyal subject, and bring me this Tundra Trout with haste!\n\n(Caught in Surface Tundra)", - "Quest_Slimefish": "In the forest, the slimes are kinda gross. Slimefish are even more so! I don't want to swim with slimes, so yoink one out of the water for me!\n\n(Caught in Surface Forest)", - "Quest_ScarabFish": "I read this ancient story about a fish that looks like a magical scarab! That's beetle, for simpletons like you! Where do you find it? Where do you think? In the desert, duh! Don't look at me like that... it's true! There is actually water out there! I'd go, but I don't like having my eyeballs pecked out by vultures. So... you do it!\n\n(Caught in Desert)", - "Quest_ScorpioFish": "I'm sure someone, a really stupid someone, tried to tell you there was no water in the desert! They were absolutely and positively wrong! There's this thing called an Oasis, and it has water in it! Guess what happens when you have water!? That's right, you have fish! Weird fish that try to sting you and pinch you and do all kinds of other mean things to you! A perfect pet for me, and a perfect job for you!\n\n(Caught in Desert)" - }, - "PirateChatter": { - "Chatter_1": "About time we gotta barkeep around here! Me rum was almost gone!" - }, - "GuideChatter": { - "Chatter_1": "I thought you said you purified {TaxCollector}? He's just as greedy as ever!", - "Chatter_2": "I wonder why my predecessor spontaneously burst into flames. Hopefully it doesn't happen to me..." - }, - "NurseChatter": { - "Chatter_1": "I keep asking for wine, but all {Bartender} gives me are mugs of ale." - }, - "StylistChatter": { - "Chatter_1": "I offered {Bartender} a free trim, but he refused. I mean, I could have at least worked on his mustache!" - }, - "CyborgChatter": { - "Chatter_1": "{Bartender} said I reminded him of a certain \"EV2\". Perhaps I should meet her." - }, - "MechanicChatter": { - "Chatter_1": "{Bartender} offered me a Root Beer, I told him to give it to me in a square cup." - }, - "AnglerChatter": { - "Chatter_1": "How come {Bartender} won't sell me any ale? I want to try some! What a grouch!", - "Chatter_2": "Whaaaat?! Can't you see I'm winding up fishing line??", - "Chatter_3": "I have enough fish! I don't need your help right now!", - "Chatter_4": "There's no chefs in all of {WorldName}, so I have to cook all this fish myself! ", - "Chatter_5": "Hey! Watch it! I'm setting up traps for my biggest prank ever! No one will see it coming! Don't you dare tell anyone!", - "Chatter_6": "Let a kid give you some advice, never touch your tongue to an ice block! Wait, forget what I said, I totally want to see you do it!", - "Chatter_7": "Ever heard of a barking fish?! I haven't, I'm just wondering if you did!", - "Chatter_8": "{WorldName} is filled to the brim with the most outlandish kinds of fish!", - "Chatter_9": "I'm bummed out! There's probably been fish that have gone extinct before I even was born, and that's not fair!", - "Chatter_10": "I don't have a mommy or a daddy, but I have a lot of fish! It's close enough!" - }, - "GoblinTinkererChatter": { - "Chatter_1": "You know, these Etherian Goblins are nothing like my people. Really rowdy bunch. Not that my people are much better..." - }, - "MerchantSpecialText": { - "Party": "You know what would be the best way to party? Buying things for others, specifically from me.", - "Graveyard1": "This eerie atmosphere is bad for business!", - "Graveyard2": "This is a terrible location... I can't sell my wares to the dead!", - "Windy1": "What a blustery day! Stay awhile, and buy a thing or two.", - "Windy2": "I used slime glue to keep my hat from blowing away! Perhaps I can sell you some for a couple gold coins...", - "Storm1": "Wanna buy a lightning rod? Oh, seems I'm out of stock.", - "Storm2": "Storms rollin' in... how 'bout you come in and buy something?", - "Rain1": "Umbrellas! Umbrellas! Get your half-off umbrellas!", - "Rain2": "How dreary! Lighten the mood with 99 torches!" - }, - "NurseSpecialText": { - "Party": "No, I will not tell you how many candles are on my cake.", - "Graveyard1": "Ahh!! I'd rather be working at an abandoned hospital than hanging around here!", - "Graveyard2": "This place creeps me out, and I can't treat dead patients!", - "Windy1": "This breeze is really extra right now! Beware of flying needles.", - "Windy2": "I been chasing my medical instruments all day. This gale is keeping me fit!", - "Storm1": "I do not perform shock therapy, just go stand outside under a tree!", - "Storm2": "Just stay inside! I've already treated too many electrocuted patients today.", - "Rain1": "If you stay out there too long, you'll catch a cold!", - "Rain2": "Great! Now my uniform is all wet. Stop staring!" - }, - "ArmsDealerSpecialText": { - "Party": "Parties are great for getting people to come out of their shell, just like with bullets.", - "Graveyard1": "I hate places like this. I can't kill what's already dead!", - "Graveyard2": "If you see any suspicious activity out in that fog, I wasn't involved.", - "Windy1": "Was tryin' out my new gun, but the wind kept me off target!", - "Windy2": "Don't spray and pray in the wind, buddy!", - "Storm1": "A lightning gun? Don't have time for that, man. I love my bullets!", - "Storm2": "If you time it right, no one will hear your gunshots with the thunder.", - "Rain1": "Heard a rumor that some clouds are literally out to get you! Show 'em whose boss with one of my guns!", - "Rain2": "Flying fish? I call that target practice!" + "Quest_TundraTrout": "You ever wonder why the lakes on the surface of the snowy areas of {WorldName} never ice over? I don't. The fish, however, do! A fish made out of ice would make a great offering to the mighty and amazing {Angler}! Go, my loyal subject, and bring me this Tundra Trout with haste!\n\n(Caught in Surface Tundra)" }, "DryadSpecialText": { "AfterDD2Tier1": "When I was in Etheria, I felt so disconnected from {WorldName}. Its good to be back.", @@ -648,125 +143,39 @@ "WorldDescriptionGrim": "Things are grim indeed...", "WorldDescriptionWork": "You have a lot of work to do.", "WorldDescriptionClose": "You are so close!", - "Party": "I thought I would throw a party to celebrate our victories in the past and those yet to come.", - "Graveyard1": "I can handle the corruption, but the vile air of death in this location wilts the flower in my hair.", - "Graveyard2": "This place... I can hear the cry of nature at those who've fallen here.", - "Windy1": "The wind... it is nature's way of sweeping the dust from the land.", - "Windy2": "Nature's fury strips the leaves from the trees this day.", - "Storm1": "Our mother is angry, and wishes to burn away the filth by raining destructive power on our treetops.", - "Storm2": "It is unwise to traverse openly beneath the flashing dangers from above.", - "Rain1": "The water from the sky is a way for nature to wash away the mud in our streams.", - "Rain2": "When it rains, many kind of fish acquire some mystical properties." + "Party": "I thought I would throw a party to celebrate our victories in the past and those yet to come." }, - "GuideSpecialText": { - "Party": "Never been to a party before? You might want to check around with the others. People sometimes bring out special party favors.", - "Graveyard1": "Graveyards are spooky and very dangerous. I'd watch your step, kid.", - "Graveyard2": "It's cold and ominous around here. I feel something very evil calling out to me.", - "Rain1": "Be advised that certain creatures only come out during rain.", - "Rain2": "Don't be alarmed, it is just water. I hear certain species of fish can fly when it rains!", - "Windy1": "Don't get blown away by the strong gusts going on, and be wary of monsters which take advantage of them!", - "Windy2": "It's windy out there! Now is the best time to fly a kite.", - "Storm1": "It's dangerous to be out in a thunderstorm. Take cover, kid.", - "Storm2": "Lightning is no joke, very powerful fiends come out in this weather.", - "SlimeRain": "If you defeat enough of these slimes, you might invoke the wrath of their king. Be careful!", - "Eclipse": "Huh?! Where is the sun? Why is it so dark? It must be a Solar Eclipse!", - "Lantern1": "What a beautiful night! With your recent victory, the world seems more at peace, and these lanterns are in celebration of that.", - "Lantern2": "Do you see the lanterns? Now that you've saved our world, there are regular celebrations of your victory. Always such a beautiful sight!" + "WitchDoctorSpecialText": { + "AfterDD2Tier1": "I sense a kindred spirit in the Etherian Dark Mages. A pity they are our enemies, I would have liked to learn from them.", + "Party": "I wanted to see how your kind celebrate, I am not disappointed." + }, + "PirateChatter": { + "Chatter_1": "About time we gotta barkeep around here! Me rum was almost gone!" + }, + "NurseChatter": { + "Chatter_1": "I keep asking for wine, but all {Bartender} gives me are mugs of ale." }, "DemolitionistSpecialText": { "AfterDD2Start": "I don't see why we can't just blow up those portals.", - "Party": "You might want to be careful today. Us dwarves tend to have pretty explosive parties.", - "Graveyard1": "The stench of death here is worse than the skeleton-infested caverns where I work!", - "Graveyard2": "All these piles of bones and stones... perfect for blowin' up!", - "Windy1": "Now might not be the best time to lob grenades on the surface, my tall friend!", - "Windy2": "You want boomerang bombs? Throw some out in that gust, they'll come back to you alright!", - "Storm1": "BOOM! Even mother nature likes a taste of gratifying demolition!", - "Storm2": "You shoulda seen it when lightning struck one of my carts filled with explosives!", - "Rain1": "This is a terrible day to be a dwarf.", - "Rain2": "ARGH! Another fuse put out by all this wet stuff! This never happens underground!" + "Party": "You might want to be careful today. Us dwarves tend to have pretty explosive parties." }, - "ClothierSpecialText": { - "Party": "Mama always said you've got to put the past behind you before you can party on.", - "Graveyard1": "I've been cursed! Take me to the hospital!", - "Graveyard2": "It's a big graveyard, we'll divide it up! The dead stay in their half, we'll stay in ours!", - "Windy1": "Sometimes, I guess there's just not enough windmills.", - "Windy2": "The air has certainly got it, today!", - "Storm1": "Remember to keep breathing, because eventually this storm will pass!", - "Storm2": "If it wasn't storming, everyone would go outside. It's the lightning that makes it dangerous.", - "Rain1": "It's raining alright! Little bitty stingin' big ol' fat sideways rain! At least it ain't coming from straight up underneath us!", - "Rain2": "One day it started raining like this, and it didn't quit for four days!" - }, - "GoblinTinkererSpecialText": { - "Party": "Goblin parties are a lot like humans. They both have games like \"Pin the Blame on the Human\" er... I don't play that game at my parties.", - "Graveyard1": "I'm working on a Photon Sack. It's an invention to trap all the ghasts lurking around outside!", - "Graveyard2": "The constant moaning and ear-piercing screeching noises are distracting me from my work!", - "Windy1": "This weather is the reason why I wear goggles! I can't have dirt and sand blowing in my eyes.", - "Windy2": "Now would be a great time to tinker a pinwheel accessory!", - "Storm1": "I'm working on an invention that will harness the energy being released around us!", - "Storm2": "Most goblins hate thunderstorms. Probably because they carry so many spiky balls.", - "Rain1": "All this rainfall makes it hard to see. I should tinker my goggles with a pair of windshield wipers.", - "Rain2": "Humans are a lot taller than goblins. When it floods, we are always in big trouble!" + "StylistChatter": { + "Chatter_1": "I offered {Bartender} a free trim, but he refused. I mean, I could have at least worked on his mustache!" }, "WizardSpecialText": { "AfterDD2Tier1": "You know, I think I've seen a portal like that before, but it was gold.", - "Party": "Clearly I throw the most magical of parties.", - "Graveyard1": "I can't bring anyone back from the dead, so don't ask!", - "Graveyard2": "Funny, when I look far enough into the crystal ball, this is where every customer ends up!", - "Windy1": "This gale got you bothered? There's a spell for that.", - "Windy2": "A blast of wind terrorizing our world? Did I do that?", - "Storm1": "Did somebody steal my spell book again!?", - "Storm2": "You call this lightning!? Back in my day, I .. uh.. Hmm. Oh, did you need something?", - "Rain1": "Yes, I can go out in the rain and not melt. I'm a wizard, dammit!", - "Rain2": "Raindrops falling on my... uh.. Where am I? Who are you? ... Who am I?", - "LuckIsCursed1": "Stay away! You are dragging a behemoth of woeful bad luck in your wake! I want nothing of it!!", - "LuckIsCursed2": "Did you smash every mirror in WorldName!? You hapless fool, you are cursed beyond help!!", - "LuckIsTerrible1": "I feel a terrible fate surrounding you! You should just stay in bed today!", - "LuckIsTerrible2": "What manner of salt did you spill to receive such misfortune!?", - "LuckIsPoor1": "Negative energy is seeping from your pores. I wouldn't take any chances today.", - "LuckIsPoor2": "Unfortunate omens hang over your head. You DID forward that letter, right?", - "LuckIsBad1": "The air feels dull and gloomy where you step. Be wary of ill feelings.", - "LuckIsBad2": "Is something bothering you? Something doesn't feel quite right about you.", - "LuckIsGood1": "I sense a speck of good karma about you, but I could be mistaken.", - "LuckIsGood2": "There's something unusually warm about you. I'm not sure how to place it, but keep walking in that direction.", - "LuckIsGreat1": "You are giving off a positive energy, like something grand could occur at any moment.", - "LuckIsGreat2": "There are vibes of good fortune emanating from you, as though your wishes could possibly come true.", - "LuckIsAmazing1": "Have you a garden of four-leaf clovers? You are bursting with essences of great fortune!", - "LuckIsAmazing2": "Serendipity smiles upon you! It is likely you shall find profit in all things!", - "LuckIsGodly1": "You are overflowing with a blessing of stupendous prosperity!!", - "LuckIsGodly2": "Excessive health and happiness gush from your very being! You are a Godsend!!" + "Party": "Clearly I throw the most magical of parties." }, - "MechanicSpecialText": { - "Party": "Do you think anyone would mind if I wired a cake with bulbs instead of candles?", - "Graveyard1": "I should light up this dark and scary place to keep the monsters away.", - "Graveyard2": "I'd run some wire here, but the spooky dead things are in the way!", - "Windy1": "Oh no! There are pockets of low pressure rolling in, I must secure the power grid.", - "Windy2": "My wires are getting tangled in this cyclone. Watch where you step!", - "Storm1": "Great! There goes another pump. When will the lightning stop frying my equipment?!", - "Storm2": "Don't go outside right now while holding any of my products, you'll attract an unwanted dose of electrical power!", - "Rain1": "If it doesn't stop raining, my wrench is going to get all rusty!", - "Rain2": "Oh Fudge! Shorted out another outlet! I hate this weather." + "PartyGirlSpecialText": { + "AfterDD2Tier1": "Have you seen an ogre yet? I want to ride on the back of one!", + "Party_1": "Hmm? Nothing special today... just kidding! It's party time, and then it's after party time!", + "Party_2": "At last, my time has come!" }, - "TruffleSpecialText": { - "Party": "I would have invited everyone to party in my home, but there's not mushroom.", - "Graveyard1": "This is an excellent place to start a family. Most of my friends were born here!", - "Graveyard2": "This place makes me feel good. I'm not sure why...", - "Windy1": "Our kind is very brittle, I worry for my brothers on this breezy day.", - "Windy2": "Wind is not my friend, I like the dark, calm places.", - "Storm1": "The weather seems detrimental to your species, human.", - "Storm2": "That last roar of thunder startled the spores right out of me!", - "Rain1": "Ahh... nice and damp. I feel so good.", - "Rain2": "Rain is cause for celebration for my people." + "CyborgChatter": { + "Chatter_1": "{Bartender} said I reminded him of a certain \"EV2\". Perhaps I should meet her." }, - "SteampunkerSpecialText": { - "Party": "Everyone said they like stacked cakes, so I installed smokestacks in mine", - "Graveyard1": "Golly! What uncultured swine decided to break ground here?", - "Graveyard2": "Neither blood nor steam pumps in this miserable locale.", - "Windy1": "Ahh... a sip of tea to enjoy the breeze.", - "Windy2": "Why, this windy phenomena has inspired me ideas for a new jetpack engine!", - "Storm1": "Electricity? Don't be ludicrous! Nothing beats the power of steam!", - "Storm2": "Everything I tinker up is made of metal. This current situation surely is a cause for rethinking that!", - "Rain1": "The rain is a double edged sword you see... It provides us water for steam, but it also rusts our equipment.", - "Rain2": "This bloody downpour! I can't get a lick of anything done when it's all wet!" + "MechanicChatter": { + "Chatter_1": "{Bartender} offered me a Root Beer, I told him to give it to me in a square cup." }, "DyeTraderSpecialText": { "HasPlant_0": "Brilliant, my dear! You have brought me an exquisite sample of the world's beautiful colors and aroma. In exchange, you may take this special bottle of dye.", @@ -775,635 +184,54 @@ "NoPlant_0": "Oh no no, this will not do. For these money is no good, you must return to me with a rare specimen of a plant!", "NoPlant_1": "You think you can pull a fast one on {DyeTrader}, I don't think so! I only take the rarest of flowers for these special bottles!", "NoPlant_2": "These dye bottles? Sorry dear friend, these don't take coin. I only take the most precious and rare of flora in exchange for one of this!", - "Party": "I truly love parties, so many beautiful colors and happy people.", - "Graveyard1": "My, my... this is no good. The putrid surroundings are dulling my dye petals.", - "Graveyard2": "You think this a place worthy of my presence? So drab, so dull, these people are literally below me.", - "Windy1": "Marvelous! The wind brings me petals of all colors!", - "Windy2": "Give me a moment, my dear. I must secure my palette from the gusty gales!", - "Storm1": "Egads! I loathe these bothersome storms!", - "Storm2": "Please, do tell when the wrath of nature has ended out there!", - "Rain1": "Too much water dilutes my selection! This rain better pass, soon!", - "Rain2": "No, no, these robes cannot get wet! They will lose their vibrant color!" + "Party": "I truly love parties, so many beautiful colors and happy people." }, - "PartyGirlSpecialText": { - "AfterDD2Tier1": "Have you seen an ogre yet? I want to ride on the back of one!", - "Party_1": "Hmm? Nothing special today... just kidding! It's party time, and then it's after party time!", - "Party_2": "At last, my time has come!", - "Graveyard1": "Woo hoo! It's party time! ...Uh, why isn't anyone moving?", - "Graveyard2": "We should party so loud that we LITERALLY wake the dead! Hee hee!", - "Windy1": "Did somebody say hurricane party!? I'll bring the batteries!", - "Windy2": "This is like, an amazing time to fling confetti everywhere!", - "Storm1": "There was a sudden crash of thunder at the disco, and I panicked!", - "Storm2": "Let's dance! We can shake our hips to the beat of the sky!", - "Rain1": "It's raining outside! Come on in and party!", - "Rain2": "Oh, are you all wet? Well, shake it off!", - "Cake1": "Where ya been!? There's a total party going on! Here, take the cake!", - "Cake2": "Shhh! Don't tell ANYONE I gave you this! It's a party surprise!", - "Cake3": "Party up! You're like, in charge of the cake, {PlayerName}!", - "Music1": "Are the tunes killing your party? I'll shuffle the playlist for you.", - "Music2": "I think this party could use a switch-up! How about these jams?", - "Music3": "We've been partying to this song for years! Let's change it up!" + "GuideSpecialText": { + "Party": "Never been to a party before? You might want to check around with the others. People sometimes bring out special party favors." }, - "CyborgSpecialText": { - "Party": "This party is going to be nuts, maybe even bolts!", - "Graveyard1": "Fascinating. This appears to be a storage unit for broken and malfunctioning humans.", - "Graveyard2": "My sensors indicate an increased density of energy particles. My visual receptors are unable to identify any of them.", - "Windy1": "Sensors indicate strong shifts in barometric pressure. Caution is advised.", - "Windy2": "A strong contrast between high and low pressure detected.", - "Storm1": "BEEP! Severe weather warning. This is not a test. Take shelter, immediately. BEEP!", - "Storm2": "Abnormal levels of negative and positive charged particles detected.", - "Rain1": "Precipitation detected. Advising self to seek shelter. Rust imminent.", - "Rain2": "Flash flood warning. Error 404: Sandbags not found." + "MerchantSpecialText": { + "Party": "You know what would be the best way to party? Buying things for others, specifically from me." }, - "PainterSpecialText": { - "Party": "I tried having a paintball fight, but everyone wanted food and decorations instead.", - "Graveyard1": "I paint walls and furniture, not bones! It isn't Dia de Muertos!", - "Graveyard2": "What a dreary place... it sure could use a splash of color, huh?", - "Windy1": "Feel that draft coming through? It's wafting paint fumes all over the place.", - "Windy2": "This wind storm just blew all the fresh paint right off the wall!", - "Storm1": "When the thunder rolls, and the lightning strikes... it really brings out the colors on the furniture.", - "Storm2": "Blink and you'll miss it. The brightest colors stand out when the lightning flashes.", - "Rain1": "Rain is my worst nightmare. It literally rinses out all my hard work!", - "Rain2": "I painted a mural on this wall just a moment ago. Shoulda bought a weather radio!" + "GoblinTinkererSpecialText": { + "Party": "Goblin parties are a lot like humans. They both have games like \"Pin the Blame on the Human\" er... I don't play that game at my parties." }, - "WitchDoctorSpecialText": { - "AfterDD2Tier1": "I sense a kindred spirit in the Etherian Dark Mages. A pity they are our enemies, I would have liked to learn from them.", - "Party": "I wanted to see how your kind celebrate, I am not disappointed.", - "Graveyard1": "Rise, zombie! Zombie, arise!", - "Graveyard2": "You may remove the reaper from the cemetery, but you may not remove the cemetery from the reaper...", - "Rain1": "The sound of rain is soothing to the soul.", - "Rain2": "Balance is key. We need sun, we need rain. Too much of either leads to ruin.", - "Windy1": "Keep your talismans close... if you wind some, you lose some.", - "Windy2": "The wind blows with the leaves, the leaves blow with the wind.", - "Storm1": "The spirits sound loudly this day, in blinding majesty.", - "Storm2": "Lightning casts powerful shadows, shadows cast powerful lightning." - }, - "PirateSpecialText": { - "Party": "After all that cake, you might have to call me White Beard for a while.", - "Graveyard1": "Arr... hate to say it, but many me mateys put these holes in the ground... if ye catch me drift!", - "Graveyard2": "Hardee harr... the sea be a pirate's graveyard! Ye landlubbers waste ye time!", - "Windy1": "Hoist the sails, ye curs! We pirates startin' a leg of a race! Yarharharr!", - "Windy2": "All hands on deck! A storm of wind be brewin'!", - "Storm1": "Ahoy! Brace fer impact, swashbuckler! 'Tis a'mother of all tempests!", - "Storm2": "Great Charybdis! What manner of wrath er curses have ye sent on us now!?", - "Rain1": "Ha har! Rain!? Jus' another day fer a pirate.", - "Rain2": "Fish do fly in ye rainy skies! I seen it with me own eye!" - }, - "StylistSpecialText": { - "Party": "I may have gotten my hair done up just for today, but honestly, I just want to pop balloons with my scissors.", - "Graveyard1": "Eek! This deathly atmosphere is ruining my perm!", - "Graveyard2": "I kinda want to go out there and collect heads of hair for wigs, but I kinda don't want to GO OUT THERE!", - "Windy1": "Want windswept hair? Go outside, it's free.", - "Windy2": "Ugh! I should just take the day off, this wind will blow away all my hard work!", - "Storm1": "I'm staying inside! The Einstein look is NOT in fashion.", - "Storm2": "Like, really? This crazy storm is bad for business!", - "Rain1": "That totally will not do. Soggy rat is not a hairstyle!", - "Rain2": "What?! It's raining? I just got a perm!" - }, - "AnglerSpecialText": { - "Party": "What, you think I like parties because I am a kid? Well, you're right, so get to partying!", - "Graveyard1": "I'm totally scared right now! It is all YOUR fault!", - "Graveyard2": "How can I fish out there?! Are you crazy, or just stupid!?", - "Windy1": "Wind is usually a great time to fish, but this is too much! I almost hooked my eye out!", - "Windy2": "Is this some kinda hurricane!? I almost got hit by a dolphin!", - "Storm1": "Thunderstorms are the best time to go fishing! Also the most dangerous! That's why I'll send you to do it for me!", - "Storm2": "This one time at fishing camp, lightning struck the lake! Suddenly, all the fish floated up to the surface for free!", - "Rain1": "Yes! It's raining! Now I can watch you get soaking wet while you fish for me!", - "Rain2": "I always go fishing in the rain! It's why I wear this hat!", - "BloodMoonFishing1": "You know, super scary things lurk in the water during a Blood Moon! You should totally go try it! I'll watch from here!", - "BloodMoonFishing2": "You should try fishing when the water is all bloody! It's to die for!" - }, - "TaxCollectorSpecialText": { - "Graveyard1": "Death and taxes, nothing more sure in life than that!", - "Graveyard2": "The people here aren't paying up! They are better off dead! Oh, perhaps they already are.", - "Windy1": "Just because your house blows down, doesn't mean you stop paying taxes!", - "Windy2": "Bah! If this wind keeps up, people will lose their precious possessions and stop paying me!", - "Storm1": "A marvelous storm! A remarkable storm!", - "Storm2": "I am as giddy as a drunken man! I love this weather!", - "Rain1": "Humbug! Someone tried to tell me they saw a fish walking on land. Who do they take ME for?!", - "Rain2": "Why can't it be raining gold coins!? Water is everywhere! Bah, how useless!" - }, - "BartenderSpecialText": { - "FirstHelp": "For starters, take a few of these Defender Medals, on the house! I've got some special defenses you can purchase, but only with Defender Medals!", - "FirstMeeting": "Huh? How did I get here? The last thing I remember was a portal opening up in front of me...", - "BeforeDD2Tier1": "We should really do something about the Old One's Army. Ask me about the Eternia Crystal if you want to learn more.", - "AfterDD2Tier1": "Great job on fighting off the Old One's Army! But I'm sure we haven't seen the last of them, they didn't put up much of a fight this time.", - "AfterDD2Tier2": "The Army of the Old One's keeps getting stronger, yet you keep pushing them back! But something tells me they aren't quite finished with us yet.", - "AfterDD2Tier3": "You really kept the full force of the Old One's Army at bay? Maybe you should visit Etheria some time.", - "Party_1": "There's a party happening here! I had just wiped down the bar, too.", - "Party_2": "You should sit down and have a little fun. Don't worry, I don't think any kobolds will crash this party.", - "Graveyard1": "Etheria has some dark places, but this takes the cake!", - "Graveyard2": "The bar seems kinda dead tonight. Smells like it, too!", - "Windy1": "There goes the roof. I had just had it redone yesterday!", - "Windy2": "Hold onto your bonnet, there's a real breeze out today.", - "Storm1": "Take shelter from the storm! Sit down for a pint.", - "Storm2": "You look a bit frazzled! Perhaps a mug'll calm your singed nerves.", - "Rain1": "You look like a drowned, shaggy dog! How 'bout you down some ale, eh?", - "Rain2": "Wipe your feet before you step in here, the floor was just waxed!" - }, - "GolferSpecialText": { - "FirstMeeting1": "Thank you for the rescue. If I were trapped out here any longer, I could have come down with a heat stroke!", - "FirstMeeting2": "Why, thank you! I been stuck in this sand pit for days. Good thing you can get water out of a cactus.", - "Party_1": "I'm having trouble concentrating on this swing because of the obnoxious party going on around me.", - "Party_2": "I hit a hole in one! That's a good reason for us all to celebrate. Time to put my club down and have a margarita.", - "Graveyard1": "Graveyards creep me out. I don't like practicing my swings on top of my family and friends.", - "Graveyard2": "Don't play golf in a cemetery. The grass grows too efficiently and makes the entire course rough.", - "Windy1": "This wind makes for a very difficult course.", - "Windy2": "A strong gale adds challenge to a game of golf, but this is rather excessive.", - "Storm1": "I don't think so, {PlayerName}.", - "Storm2": "The odds of being struck by lightning are the same as the lottery. Going outside swinging an iron is a winning ticket!", - "Rain1": "Golfing in the rain is less fun. Everything is all slippery!", - "Rain2": "Water hazards are a lot larger when it rains, making it that much harder to reach the green!" - }, - "SantaSpecialText": { - "Party": "Come now, you didn't think I only celebrated on Christmas did you?", - "Graveyard1": "Ho ho ho! Wait, look at this place... did I come two months too early!?", - "Graveyard2": "Naughty or Nice? Hm, how unusual... the people here have all been crossed off my list for some time now.", - "Windy1": "Ho ho! My reindeer will fly at mach speeds, tonight!", - "Storm1": "Oh ho... whoah! There goes Dasher. There went Donner, too!", - "Rain1": "Got a torch? If so, won't you guide my sleigh tonight?!" + "ClothierSpecialText": { + "Party": "Mama always said you've got to put the past behind you before you can party on." }, "TravellingMerchantSpecialText": { - "Party": "Many say that parties give you the richest of memories. So buy something and make this memory rich!", - "Graveyard1": "Whew! Look at my many wares! I totally did NOT take them off the dead buried here, to sell to you.", - "Graveyard2": "In my travels, I've never run across anyone living in a dismal place like this! Ah, well, as long as you have coin...", - "Windy1": "I go where winds take me, but this is ridiculous!", - "Windy2": "I would sell you exotic wind socks, but I'm afraid I forgot to stock them!", - "Storm1": "Hurry up and buy!", - "Storm2": "Whew! That was close! Brick and mortar sounds like a pretty good investment right now.", - "Rain1": "Rain or blue skies, I come from afar to serve you! Do you have some coin?", - "Rain2": "If my exotic coat shrinks, I will be a tad upset!" + "Party": "Many say that parties give you the richest of memories. So buy something and make this memory rich!" }, - "SkeletonMerchantSpecialText": { - "Graveyard1": "As much as you would think I'd belong here, I really don't.", - "Graveyard2": "How did I get here!? These are not my friends!", - "Windy1": "The world above is turbulent and chaotic. I like my bones to stay attached, as it were!", - "Storm1": "The surface is overabundant with destructive weather. Singed bones would be bad for my complexion!", - "Rain1": "Up there? Heard it's pretty wet. Don't want my bones getting soggy and mushy..." + "MechanicSpecialText": { + "Party": "Do you think anyone would mind if I wired a cake with bulbs instead of candles?" }, - "GolferQuestsChatterMaster": { - "1": "You are a God walking among mere mortals! A spectacular golfer!", - "2": "If I had a trophy to give for your amazing swings, I'd give you ten!", - "3": "What a breathtaking golfer! You may be at the top, but never stop reaching for it!" + "PirateSpecialText": { + "Party": "After all that cake, you might have to call me White Beard for a while." }, - "GolferQuestsChatterJourneyman": { - "1": "I'm impressed. Statistically, you are a wedge above the rest!", - "2": "You're doing a good job out there! Should I be worried?", - "3": "Your courses are well below par. That's a good thing!" + "TruffleSpecialText": { + "Party": "I would have invited everyone to party in my home, but there's not mushroom." }, - "GolferQuestsChatterApprentice": { - "1": "You're getting better! I am not fearing for my life anymore.", - "2": "Those are rather mediocre swings. Almost par for the course, if I must say.", - "3": "Not quite champion level, but you'll do." + "NurseSpecialText": { + "Party": "No, I will not tell you how many candles are on my cake." }, - "GolferQuestsChatterBeginner": { - "1": "If you keep swinging like that, you'll end up hurting someone... or yourself!", - "2": "You're going to need a lot of practice, I strongly recommend padding.", - "3": "That poor bird. Duck is tasty, however, so don't give up!" + "SteampunkerSpecialText": { + "Party": "Everyone said they like stacked cakes, so I installed smokestacks in mine." }, - "TownNPCMoodBiomes": { - "Forest": "the Forest", - "NormalUnderground": "the Underground", - "Snow": "the Snow", - "Desert": "the Desert", - "Jungle": "the Jungle", - "Ocean": "the Ocean", - "Hallow": "the Hallow", - "Mushroom": "the Mushroom", - "Dungeon": "the Dungeon", - "Corruption": "the Corruption", - "Crimson": "the Crimson" + "CyborgSpecialText": { + "Party": "This party is going to be nuts, maybe even bolts!" }, - "TownNPCMood": { - "Content": "I am content.", - "NoHome": "I hate not having a home.", - "FarFromHome": "I am too far from home.", - "DislikeCrowded": "I dislike how crowded I am.", - "HateCrowded": "I hate how crowded I am.", - "LoveSpace": "I love having so much space.", - "LikeBiome": "I like {BiomeName}.", - "LoveBiome": "I love {BiomeName}.", - "DislikeBiome": "I dislike {BiomeName}.", - "HateBiome": "I hate {BiomeName}.", - "LikeNPC": "I like {NPCName}.", - "LoveNPC": "I love {NPCName}.", - "DislikeNPC": "I dislike {NPCName}.", - "HateNPC": "I hate {NPCName}.", + "SantaClausSpecialText": { + "Party": "Come now, you didn't think I only celebrated on Christmas did you?" }, - "TownNPCMood_Guide": { - "Content": "I'm feeling quite alright.", - "NoHome": "I'm quite used to not having a home, but I wouldn't mind one.", - "FarFromHome": "I'm far from my home, it seems.", - "DislikeCrowded": "I'm a free spirit. I dislike so many people being close to me.", - "HateCrowded": "I hate overcrowding. I prefer the open world!", - "LoveSpace": "Getting this place to myself... I greatly appreciate it.", - "LikeBiome": "I'm quite fond of wandering through {BiomeName}. I like it here.", - "LoveBiome": "I love {BiomeName}.", - "DislikeBiome": "I don't really like {BiomeName}. There's little to accomplish.", - "HateBiome": "I hate {BiomeName}, the terrors here can tear a person apart in moments.", - "LikeNPC": "I'm quite fond of {NPCName}, we have a lot in common.", - "LoveNPC": "I love being around {NPCName}.", - "DislikeNPC": "{NPCName} rubs me the wrong way. Maybe it's the weird clothing?", - "HateNPC": "I hate that {NPCName} is around. The world is fine the way it was made!", + "ArmsDealerSpecialText": { + "Party": "Parties are great for getting people to come out of their shell, just like with bullets." }, - "TownNPCMood_Merchant": { - "Content": "I'm feeling successful! Want to buy something?", - "NoHome": "I don't have a place to set up shop, friend.", - "FarFromHome": "Boy, I need to make my way back to my merchandise!", - "DislikeCrowded": "The number of neighbors has me a little unsettled.", - "HateCrowded": "I hate how many people hang around, but none of them buy anything!", - "LoveSpace": "This is nice, lots of privacy to store my wares.", - "LikeBiome": "I like the scenery in {BiomeName}, a good view attracts customers!", - "LoveBiome": "I love {BiomeName}.", - "DislikeBiome": "Hmm, {BiomeName} is a terrible place for business, I don't like it.", - "HateBiome": "I don't think I can sell goods to monsters in {BiomeName}!", - "LikeNPC": "{NPCName} makes loads of money, I like deep pockets.", - "LoveNPC": "I love being around {NPCName}.", - "DislikeNPC": "I dislike {NPCName}, too frugal and doesn't ever buy my things.", - "HateNPC": "I hate {NPCName}'s terrible personality!", + "StylistSpecialText": { + "Party": "I may have gotten my hair done up just for today, but honestly, I just want to pop balloons with my scissors." }, - "TownNPCMood_Nurse": { - "Content": "My vital signs are normal, if that's what you're asking.", - "NoHome": "Tch, not having a house REALLY puts me in a bad mood.", - "FarFromHome": "I'm TOO FAR from my house, I hate all this walking.", - "DislikeCrowded": "Hey, I dislike the lack of social distancing here.", - "HateCrowded": "UGH, I hate how unhealthy it is to cram so many people in one place!", - "LoveSpace": "These digs are great - loving the personal space.", - "LikeBiome": "I like how {BiomeName} is a beautiful place to get daily exercise.", - "LoveBiome": "I love {BiomeName}.", - "DislikeBiome": "Eww, I don't like {BiomeName}'s propensity for illness.", - "HateBiome": "Yuck, {BiomeName} is extremely putrid and filthy, it'll make me sick!", - "LikeNPC": "{NPCName} is a smart and likeable goof.", - "LoveNPC": "What? {NPCName}? I don't have a crush! I don't! Shut up!", - "DislikeNPC": "I don't like {NPCName} that much, kinda weirds me out.", - "HateNPC": "Oh, I hate treating {NPCName}, so difficult!", + "PainterSpecialText": { + "Party": "I tried having a paintball fight, but everyone wanted food and decorations instead." }, - "TownNPCMood_Painter": { - "Content": "Yeah, I might be in a good mood. What's it to ya?", - "NoHome": "I ain't got a place to stay!", - "FarFromHome": "I need more paint, but my flat is too far, ya?", - "DislikeCrowded": "I don't like all these people around makin' noise when I'm painting.", - "HateCrowded": "I hate noisy crowds, when will I get some peace and quiet?", - "LoveSpace": "This serene living space has all the quiet I need to focus on my mural.", - "LikeBiome": "There are many ingredients for mixin' new paint in {BiomeName}, and the pretty view don't hurt either!", - "LoveBiome": "I love {BiomeName}.", - "DislikeBiome": "Why don't I like {BiomeName}? Because it's borin'. Green? Brown? That's it?", - "HateBiome": "Woah, {BiomeName} is disgusting, get me outta here!", - "LikeNPC": "{NPCName} and I like the same shade of pink! That's a friend, in my book!", - "LoveNPC": "I would really love to paint {NPCName}... because of the vivid colors, of course!", - "DislikeNPC": "{NPCName} is just too bland for my tastes, I dislike associating with dull types.", - "HateNPC": "I hate being around {NPCName}.", - }, - "TownNPCMood_DyeTrader": { - "Content": "Me? I'm fine, I'm fine.", - "NoHome": "No no, this will not do, need a place to call mine.", - "FarFromHome": "You think I can make brilliant colors so far from my shop? Don't think so!", - "DislikeCrowded": "I truly dislike crowds, unless of course they are here for my vivid colors!", - "HateCrowded": "When I'm not doing business, I'd much rather be alone, yes? I hate feeling crammed in!", - "LoveSpace": "My dear, this palace is quiet enough to sleep like a sultan!", - "LikeBiome": "Ahh, {BiomeName} is really nice, reminds me of my home town, I like it very much so!", - "LoveBiome": "I love {BiomeName}.", - "DislikeBiome": "Oh no, {BiomeName} does not inspire me, don't like, don't like.", - "HateBiome": "Gross, {BiomeName} is draining the color from my palettes!", - "LikeNPC": "{NPCName} has good eyes for vividness and business, I like it, yes?", - "LoveNPC": "I love being around {NPCName}.", - "DislikeNPC": "Oh dear, that {NPCName} has no sense of color or style, I don't like.", - "HateNPC": "I truly, truly hate how unsavory {NPCName} can be.", - }, - "TownNPCMood_PartyGirl": { - "Content": "I'm in my best party mood!", - "NoHome": "I'm ready to party, but I don't have a house for the after-party.", - "FarFromHome": "My party favors, I forgot them at home. Wow, it's pretty far!", - "DislikeCrowded": "There's a lot of people around me, but I don't like that they aren't partying!", - "HateCrowded": "Wow, there's so many people here, I hate that it's not for a party.", - "LoveSpace": "This is all mine? I'm gonna throw the BIGGEST party - for myself!", - "LikeBiome": "Why do I like {BiomeName}? Because it has RAINBOWS!", - "LoveBiome": "I love {BiomeName}.", - "DislikeBiome": "Ew, it's so drab in {BiomeName}. How can you party in a place like this?", - "HateBiome": "Yeesh, {BiomeName} is literally murdering my party vibe.", - "LikeNPC": "I totally like {NPCName}'s party style.", - "LoveNPC": "I love that {NPCName} always dazzles at my parties.", - "DislikeNPC": "I think {NPCName} is a killjoy at parties.", - "HateNPC": "I hate how {NPCName} always tries to shut down my after-parties. What a grump!", - }, - "TownNPCMood_Angler": { - "Content": "I'm good, now fetch me a fish!", - "NoHome": "I'm a kid, you need to give me a house! Are you dumb!?", - "FarFromHome": "I left my fishing pole at home, and it's waaaaay over there! Drat!", - "DislikeCrowded": "I don't like all these people scaring my fish, so make them go away!", - "HateCrowded": "I hate all these strangers - they scared all my fish half to death!", - "LoveSpace": "Yes! I get to be alone with all my fish!", - "LikeBiome": "Why is {BiomeName} my favorite place to go? It has tons of cool fish, duh!", - "LoveBiome": "I love {BiomeName}.", - "DislikeBiome": "Did you hit your head? Duh, {BiomeName} doesn't have fish!", - "HateBiome": "Hey stupid, the fish here in {BiomeName} are all trying to kill me!", - "LikeNPC": "{NPCName} actually knows what they're doing, unlike some OTHER people! I kinda like that!", - "LoveNPC": "I love being around {NPCName}.", - "DislikeNPC": "I dislike {NPCName}.", - "HateNPC": "I hate {NPCName}, and anyone else who treats me like a child!", - }, - "TownNPCMood_Stylist": { - "Content": "I'm feeling fresh today.", - "NoHome": "Sorry hun, I can't style hair without a place to set up my station.", - "FarFromHome": "I'm too far from my tools...", - "DislikeCrowded": "Am I hearing spiders? Oh, just noisy neighbors, I don't like that.", - "HateCrowded": "I absolutely cannot stand having so many people living around me, I can't focus.", - "LoveSpace": "Lovely, I get to keep to myself and study my technique without distraction.", - "LikeBiome": "It's nice, calm atmosphere for cutting hair in {BiomeName}.", - "LoveBiome": "I love {BiomeName}.", - "DislikeBiome": "Hun, I don't like it here in {BiomeName}, how can anyone show off their hair when it's so cold?", - "HateBiome": "Ugh, {BiomeName} is causing severe damage to my hair!", - "LikeNPC": "{NPCName} is strong and mysterious. I like that.", - "LoveNPC": "{NPCName} is quite the looker... so exotic... I think I'm in love...", - "DislikeNPC": "I tried to work on {NPCName}, but was rudely rejected, I don't like stubborn people!", - "HateNPC": "I hate {NPCName}, how can you literally NOT grow hair?", - }, -"TownNPCMood_Demolitionist": { - "Content": "Well, I don't feel like exploding today!", - "NoHome": "I don't have a place to live, did I blow up my last one?", - "FarFromHome": "I need more BOOM, I think I left it way back at home.", - "DislikeCrowded": "I dislike the number of people here, for safety reasons, of course...", - "HateCrowded": "Too many people around! One mistake making dynamite, and... well, they'd HATE the outcome!", - "LoveSpace": "Ah, no one around - I can test new bombs without creating a graveyard for limbs!", - "LikeBiome": "Dwarves are naturally drawn to {BiomeName}, it's in our blood!", - "LoveBiome": "I love {BiomeName}.", - "DislikeBiome": "I can't stand {BiomeName}, my fuses have trouble igniting here!", - "HateBiome": "It reeks of death and malice in {BiomeName}, I wanna blasts holes everywhere!", - "LikeNPC": "{NPCName} is a good friend I like, helps me load the gunpowder!", - "LoveNPC": "I love how well {NPCName} can handle a container of fireball!", - "DislikeNPC": "I wanna strap {NPCName} to a rocket and watch what happens!", - "HateNPC": "I hate being around {NPCName}.", - }, - "TownNPCMood_Dryad": { - "Content": "All is peaceful, don't mess it up.", - "NoHome": "All of nature may be my home, but a house would treat me well.", - "FarFromHome": "A flower doesn't grow very well so far away from its roots!", - "DislikeCrowded": "Is this area becoming rather dense, or is it just me? I dislike the feeling...", - "HateCrowded": "So many others crammed into one spot? The grass is doomed, I hate it!", - "LoveSpace": "Solitude is sometimes good - there's room to grow and to breathe.", - "LikeBiome": "I kissed a tree in {BiomeName} and I liked it.", - "LoveBiome": "I love {BiomeName}.", - "DislikeBiome": "I rather dislike how {BiomeName} is so devoid of life.", - "HateBiome": "I am severely offended by my surroundings - {BiomeName} is my mortal enemy!", - "LikeNPC": "I like that {NPCName} resonates with every fiber of my being!", - "LoveNPC": "I love being around {NPCName}.", - "DislikeNPC": "I don't like that {NPCName} has no respect for other beings.", - "HateNPC": "I hate {NPCName}'s destructive habits towards nature!", - }, - "TownNPCMood_DD2Bartender": { - "Content": "I'm livin' the dream.", - "NoHome": "I feel so out of place without a bar to polish.", - "FarFromHome": "I might want to get back to my place in case anyone needs a drink or two.", - "DislikeCrowded": "Not sure I like living next door to so many people.", - "HateCrowded": "Hate to say it, but I rather hate overcrowded quarters.", - "LoveSpace": "Finally, some peace and quiet... as a bartender this is a luxury!", - "LikeBiome": "Ahh, {BiomeName}... I like it here, it's got character.", - "LoveBiome": "I love {BiomeName}.", - "DislikeBiome": "I'm not a fan of {BiomeName}, it's bitter.", - "HateBiome": "Is this another invasion? Oh, it's just {BiomeName} - even worse!", - "LikeNPC": "I like {NPCName}, it shows you cannot always judge a person by their... origins.", - "LoveNPC": "{NPCName} is one crazy little drinker, I love it!", - "DislikeNPC": "I rather dislike {NPCName}, they put out similar vibes as some of the dark things from Etheria.", - "HateNPC": "{NPCName}'s eccentric and narcissistic personality really makes me want to smash a table!", - }, - "TownNPCMood_ArmsDealer": { - "Content": "I'm good, buddy!", - "NoHome": "I don't have a place to stay, pal!", - "FarFromHome": "I don't like doin' business this far from home.", - "DislikeCrowded": "Shh, I think there's some people nearby, don't like doin' my deals here.", - "HateCrowded": "Hey, I can't do what I do with so many people watchin' me.", - "LoveSpace": "This is what I'm talkin' about, privacy!", - "LikeBiome": "Ya know, {BiomeName} is secluded and great for business, if you catch my drift.", - "LoveBiome": "I love {BiomeName}.", - "DislikeBiome": "Yeah, no, {BiomeName} makes me very uncomfortable.", - "HateBiome": "I hate {BiomeName} - hunting isn't quite as fun if you're the prey!", - "LikeNPC": "Yeah, I like {NPCName}, wicked cool person.", - "LoveNPC": "Think {NPCName} ever, ya know, checks me out?", - "DislikeNPC": "I don't really like {NPCName} bein' on my turf, ya know?", - "HateNPC": "I'd REALLY like to use {NPCName} as a range target sometime.", - }, - "TownNPCMood_GoblinTinkerer": { - "Content": "Feelings are currently nominal.", - "NoHome": "Goblins don't normally need nice homes, but I'm not like most goblins.", - "FarFromHome": "I want to work on my new invention, but my house is way over there!", - "DislikeCrowded": "There appears to be an unlikeable amount of humans gathering around me, hm?", - "HateCrowded": "This crowding triggers bad memories of goblin war camps, I really hate it.", - "LoveSpace": "Perfect, the lack of annoying neighbors adequately meet my needs.", - "LikeBiome": "Ahh, {BiomeName} is a nice, quiet place to construct more gadgets. Major like-age!", - "LoveBiome": "I love {BiomeName}.", - "DislikeBiome": "I don't like {BiomeName}, it is filled with loud, annoying pests that get in the way of my work!", - "HateBiome": "I hate {BiomeName}, I cannot put merge these trinkets into one piece if I'm fighting to keep myself that way!", - "LikeNPC": "{NPCName} understands how fun it is to mix things together, I can respect that!", - "LoveNPC": "{NPCName} makes my cardiac core function improperly, it appears I love how that feels!", - "DislikeNPC": "I detect eerie vibes from {NPCName}, as if they contain dark secrets. I don't like the feeling.", - "HateNPC": "I really hate how {NPCName} humiliated me, all because male goblins cannot grow real hair!", - }, - "TownNPCMood_WitchDoctor": { - "Content": "I embody contentedness.", - "NoHome": "A hut would suffice. Not all of my surroundings embrace tranquility.", - "FarFromHome": "I have strayed far from my calm place.", - "DislikeCrowded": "The close presence of others disrupts my juju and comfort.", - "HateCrowded": "Too many of your kind are gathering too near, growing much malice in my soul.", - "LoveSpace": "Strong energy flows through unimpeded by neighboring presence, very pleasant.", - "LikeBiome": "I cannot fathom existing elsewhere, {BiomeName} is the center of my voodoo spirits.", - "LoveBiome": "I love {BiomeName}.", - "DislikeBiome": "The magicks of {BiomeName} are of oppression, not true purity, my heart and soul are enraged.", - "HateBiome": "I sense a grim evil pervading the land and all living things in {BiomeName}.", - "LikeNPC": "{NPCName} is a kindred spirit of nature, my soul is at peace in their presence.", - "LoveNPC": "I love being around {NPCName}.", - "DislikeNPC": "I dislike the practices of {NPCName}. True healing cannot come from metal and glass.", - "HateNPC": "Fury fills my being as abominations sprout from tainted earth - I speak of {NPCName}.", - }, - "TownNPCMood_Clothier": { - "Content": "What's normal, anyways?", - "NoHome": "No home at all? I will not be subjected to criminal abuse!", - "FarFromHome": "It's a highly tedious procedure, cranking out a spyglass and looking for my house.", - "DislikeCrowded": "The local population is like living with dead weight on my back.", - "HateCrowded": "Overcrowding is as overcrowding does.", - "LoveSpace": "I'm not a popular man, but I know what tranquility is.", - "LikeBiome": "Seeing is believing, but sometimes the most likeable things are in {BiomeName}.", - "LoveBiome": "I love {BiomeName}.", - "DislikeBiome": "There just aren't enough dark rooms in {BiomeName}.", - "HateBiome": "My soul feels torn here in {BiomeName}, as if my very being is at war between good and evil.", - "LikeNPC": "I can't quite place it, but I find {NPCName} fascinating.", - "LoveNPC": "{NPCName}? I hadn't seen anything so delicious in my life.", - "DislikeNPC": "For some reason, being around {NPCName} makes me feel uneasy.", - "HateNPC": "I hate {NPCName} and I don't know why.", - }, - "TownNPCMood_Mechanic": { - "Content": "Everything's working correctly - oh, me? Yeah I'm fine!", - "NoHome": "I need some sort of structure to run these wires through.", - "FarFromHome": "Oh, it seems I'm out of signal range! Hmm.", - "DislikeCrowded": "The flickering lights are bothering me. Is there a load on the grid?", - "HateCrowded": "I'm going to need a way bigger power source for THIS MANY people, I hate it!", - "LoveSpace": "Perfect, no one is in the way for building infrastructure.", - "LikeBiome": "I like {BiomeName}, machines don't overheat here, and the energy flow is efficient.", - "LoveBiome": "I love {BiomeName}.", - "DislikeBiome": "I don't like {BiomeName}, it reminds me of a traumatic experience!", - "HateBiome": "I feel extremely uncomfortable in {BiomeName}, as if creeping eyes are always watching me.", - "LikeNPC": "I feel like I understand {NPCName} better than anyone else.", - "LoveNPC": "Umm... {NPCName} makes my heart flutter, I need to get that checked!", - "DislikeNPC": "I don't really like that {NPCName} won't leave me alone!", - "HateNPC": "I hate how {NPCName} doesn't know how to treat a woman!", - }, - "TownNPCMood_TaxCollector": { - "Content": "What? I AM in a good mood.", - "NoHome": "How can a man of my riches have no home? Preposterous!", - "FarFromHome": "Bah! I'm trying to make my way back home to count my money. Begone!", - "DislikeCrowded": "I'll have you know, I dislike neighbors!", - "HateCrowded": "Go tell all these miserable poor freeloaders to scram, I hate crowds.", - "LoveSpace": "Finally, isolation from all these miserable peasants!", - "LikeBiome": "Living in {BiomeName} forces people to stay indoors and leave me alone. I find that pleasant.", - "LoveBiome": "I love {BiomeName}.", - "DislikeBiome": "What kind of irritating place is {BiomeName}? Poppycock, I tell you!", - "HateBiome": "Even for my standard, {BiomeName} is beyond miserable! Bah!", - "LikeNPC": "Exuberant people tend to give me a headache, but somehow I actually like {NPCName}. I must be losing my mind!", - "LoveNPC": "I highly admire {NPCName}. Anyone who knows the true value of money earns my utmost respect!", - "DislikeNPC": "{NPCName} is just too noisy, away with them and their ilk!", - "HateNPC": "I loathe the very existence of {NPCName}! What kind of lunatic just gives things away for free?", - }, - "TownNPCMood_Pirate": { - "Content": "Yarr. I be in ship shape!", - "NoHome": "The open sea's me true home, but if I be landlocked for awhile... well I need me shelter, matey.", - "FarFromHome": "Me bed and me rum be callin' me name back home.", - "DislikeCrowded": "Avast! Too many landlubbers on me ship be foulin' my mood.", - "HateCrowded": "Ye too hate the feelin' that a mutiny be comin'? Too many scallywags gettin' close to me quarters.", - "LoveSpace": "'Tis like having me very own galleon, matey!", - "LikeBiome": "Hardy har har, matey, {BiomeName} is me true home!", - "LoveBiome": "I love {BiomeName}.", - "DislikeBiome": "Argh, {BiomeName} be a bit cramped for me style, ye scurvy dog!", - "HateBiome": "Arr, {BiomeName} be the foulest chunk 'o dry land ever traversed!", - "LikeNPC": "Har Har! Melikes how {NPCName} brings ye best bottle o' rum.", - "LoveNPC": "Ahoy! Me takes {NPCName} under me wing, landlubber. Me love raisin' sea pups!", - "DislikeNPC": "Ye know me don't like that {NPCName} tries to cut me beard, I've slit scurvy throats fer less!", - "HateNPC": "Me want to make {NPCName} walk ye plank, sea dog! Hate the coddlin' and the dastardly smell!", - }, - "TownNPCMood_Wizard": { - "Content": "I feel magical.", - "NoHome": "Where is my house? Where am I? Who are you? Who am I?", - "FarFromHome": "I could have sworn my house was here somewhere...", - "DislikeCrowded": "Can some of these noisy people move further away? No? Ok.", - "HateCrowded": "This overcrowding is starting to dampen my magic! I think.", - "LoveSpace": "Reminds me of the old days, practicing magic up in a tower in the middle of nowhere!", - "LikeBiome": "What's not to like about {BiomeName}? It has unicorns and rainbows.", - "LoveBiome": "I love {BiomeName}.", - "DislikeBiome": "I dislike {BiomeName}, magic does not flow well in a place like this.", - "HateBiome": "The abominations in {BiomeName} disturb me, like the darkest form of magic.", - "LikeNPC": "{NPCName} and I share a very long history, I like the mutual wisdom.", - "LoveNPC": "I love that there's a lot to talk about with {NPCName}.", - "DislikeNPC": "{NPCName} dabbles in things that shouldn't be disturbed, and I don't like that.", - "HateNPC": "That loathsome {NPCName} is a complete and total abomination to magic!", - }, - "TownNPCMood_Steampunker": { - "Content": "I am jolly good.", - "NoHome": "I could use a flat to bide in.", - "FarFromHome": "I'm wee far from home, an' I forgot my bloody motor!", - "DislikeCrowded": "I dinnae like being surrounded by folk, much.", - "HateCrowded": "Oi, I absolutely hate crowded quarters!", - "LoveSpace": "Plenty o' room just for me and some good steam engines!", - "LikeBiome": "I prefer the wide open spaces here in {BiomeName}, great for jetpack joyrides!", - "LoveBiome": "I love {BiomeName}.", - "DislikeBiome": "The shrubbery and mess of {BiomeName} really grinds my gears!", - "HateBiome": "Truly, {BiomeName} is uncultured and unsightly - nevermind perilous!", - "LikeNPC": "{NPCName} is a likeable sort who helps me spruce up my inventions.", - "LoveNPC": "I love how unique and interesting {NPCName} truly is, remarkable!", - "DislikeNPC": "{NPCName} is too otherworldly! I dinnae like them much.", - "HateNPC": "I hate being near {NPCName}.", - }, - "TownNPCMood_Cyborg": { - "Content": "All neural functions appear to be operating smoothly.", - "NoHome": "Error 404: Living arrangements not found.", - "FarFromHome": "I have wandered beyond the signal range of my datacenter.", - "DislikeCrowded": "Too many other lifeforms. I am experiencing negative emotional neural patterns.", - "HateCrowded": "Lifeform limit exceeded. Neural functions overloaded. Translation: I hate this.", - "LoveSpace": "Zero close proximity life signs detected. This is fortunate.", - "LikeBiome": "My cybernetic functions perform optimally in {BiomeName}'s temperature gradient. This is a plus.", - "LoveBiome": "I love {BiomeName}.", - "DislikeBiome": "The flora and fauna are invading my synthetic exoskeleton: {BiomeName} is an undesired location for myself.", - "HateBiome": "Detecting overwhelming numbers of hostile life signatures in {BiomeName}.", - "LikeNPC": "{NPCName} attempts to treat me favorably like another human. It appears I appreciate that.", - "LoveNPC": "I love being around {NPCName}.", - "DislikeNPC": "{NPCName} does not comprehend my existence, for it deviates from the norm. Unusual. The negative feeling is mutual.", - "HateNPC": "{NPCName}'s functions cannot be scientifically analyzed. Neutral functions overloaded. Translation: I hate this.", - }, - "TownNPCMood_SantaClaus": { - "Content": "I am jolly!", - "NoHome": "I can't just go back to the north pole when I please, ho ho ho! Think you can spot me a temporary house?", - "FarFromHome": "Hello there! I'm far from my temporary home!", - "DislikeCrowded": "I prefer to work alone, in the presence of just my elves. I dislike all the distractions!", - "HateCrowded": "This is a pretty big crowd, each and every one on the naughty list. I hate carrying that heavy bag of coal!", - "LoveSpace": "Ho ho ho! Just me and my elves, a perfect place for my remote workshop.", - "LikeBiome": "I like {BiomeName}.", - "LoveBiome": "I absolutely love it here! Are you surprised? Who thought I wouldn't like {BiomeName}?", - "DislikeBiome": "I dislike {BiomeName}.", - "HateBiome": "I'm adding you to the naughty list for putting me in a awful place like {BiomeName}.", - "LikeNPC": "I like being around {NPCName}.", - "LoveNPC": "I love being around {NPCName}.", - "DislikeNPC": "I dislike being around{NPCName}.", - "HateNPC": "I hate people who don't believe in me! For example, {NPCName}, the naughtiest I've ever known!", - }, - "TownNPCMood_Golfer": { - "Content": "I'm doing fine!", - "NoHome": "I need a place to hang up my clubs.", - "FarFromHome": "I think I've wandered off course. That is not a smart move.", - "DislikeCrowded": "Golf is a sport best enjoyed solo. I dislike my life not being the same way.", - "HateCrowded": "Hate to say it, but I rather hate all the foot traffic here.", - "LoveSpace": "Nothing better than having all this space to yourself.", - "LikeBiome": "I like {BiomeName}. It has all the necessary features for golfing.", - "LoveBiome": "I love {BiomeName}.", - "DislikeBiome": "Tell me something. How am I supposed to golf in a place like {BiomeName}?", - "HateBiome": "I especially think it's unwise to hang around a place like {BiomeName}.", - "LikeNPC": "It's always fun to hang out with {NPCName}. Good people.", - "LoveNPC": "Unpopular opinion: I quite love having {NPCName} around. I get my water hazards returned to me!", - "DislikeNPC": "I dislike being around {NPCName}. Makes me feel uneasy.", - "HateNPC": "I hate {NPCName}'s greedy attitude. It's pretty unnecessary in a world like this.", - }, - "TownNPCMood_Truffle": { - "Content": "I am quite happy, considering.", - "NoHome": "I need a place to feel secure and welcome.", - "FarFromHome": "I don't think I'm comfortable being so far away from my home.", - "DislikeCrowded": "I don't like this anxiety I'm getting from the people gathering around me.", - "HateCrowded": "I hate it. So many people... I... I'm not going to get eaten, right?", - "LoveSpace": "I love having so mush room to myself. What's so funny?", - "LikeBiome": "I feel right at home, like I am one with {BiomeName} biome.", - "LoveBiome": "I love {BiomeName}.", - "DislikeBiome": "I dislike {BiomeName}.", - "HateBiome": "I don't belong in {BiomeName}, I would not survive!", - "LikeNPC": "{NPCName} treats me with respect, as though I'm a true part of nature. I don't know how to feel about that, except I like it.", - "LoveNPC": "I love {NPCName} for being able to talk to me without mysteriously getting hungry.", - "DislikeNPC": "{NPCName} has tried to eat me so many times. I swear, one time they weren't even human! I, obviously, dislike it.", - "HateNPC": "{NPCName} has tried to throw me into a pot filled with other unusual ingredients. I hate that.", - }, - "TownNPCMood_BestiaryGirl": { - "Content": "I'm feeling good, actually! Thanks for askin'!", - "NoHome": "Like, I can't just go live in a burrow, you know. I need a house!", - "FarFromHome": "I'm uh, like, a little homesick,? Plus I need to feed my pets!", - "DislikeCrowded": "I get a little anxious around a lot of people. I like, don't want that.", - "HateCrowded": "Eek! I hate feeling worried about what will happen with all these people around!", - "LoveSpace": "I absolutely love having my own place to be myself! This is like, totally awesome!", - "LikeBiome": "I love animals, so naturally {BiomeName} is like, the best place ever! Yas!", - "LoveBiome": "I love {BiomeName}.", - "DislikeBiome": "It's like, weird having instincts and all, and {BiomeName} really makes me want to run away!", - "HateBiome": "Like, {BiomeName} totally reeks of those curses that fox cub had -- the one that bit me!", - "LikeNPC": "Of course I like {NPCName}! I like, knew them since I was born!", - "LoveNPC": "I can't explain it. I have like, a thing for {NPCName}. Is it because of the tail?", - "DislikeNPC": "I don't like how cruel {NPCName} is!", - "HateNPC": "I really totally hate what {NPCName} does to animals!", - }, - "TownNPCMood_BestiaryGirlTransformed": { - "Content": "Rrrr... feel fine.", - "NoHome": "GRAH! Need HOME! NOW!", - "FarFromHome": "Grrawr... home! far FAR! CANNOT TRACK.", - "DislikeCrowded": "Rawgh! PEOPLE. TOO MANY. Irritate!", - "HateCrowded": "Snarrrrrll... CANNOT. STAND. CROWDING!", - "LoveSpace": "Rrrrr... open space. HAPPY.", - "LikeBiome": "In {BiomeName}... Good RUN! PLAY! HUNT! Yee!", - "LoveBiome": "FAVORITE LAND... {BiomeName}. DELIGHT.", - "DislikeBiome": "Mrrrr... {BiomeName}. NO SMELL GOOD.", - "HateBiome": "Gughhh, {BiomeName}... I LOATHE. BAD SCENERY.", - "LikeNPC": "{NPCName}. Rrr... GOOD. FEEL.", - "LoveNPC": "LOVE. STRONG... {NPCName}. Yeeyee!", - "DislikeNPC": "{NPCName}.... VIBES. BAD! Grrl", - "HateNPC": "Arghl! NO {NPCName}. HATE. FURY. DISGUST!!", + "AnglerSpecialText": { + "Party": "What, you think I like parties because I am a kid? Well, you're right, so get to partying!" } } \ No newline at end of file diff --git a/Localization/Content/es-ES.json b/Localization/Content/es-ES.json index 891247c..d082537 100644 --- a/Localization/Content/es-ES.json +++ b/Localization/Content/es-ES.json @@ -46,6 +46,7 @@ "48": "Terraria 2: Electric Boogaloo", "49": "Terraria: ¡Minecraft también mola!", "5": "Terraria: Historias de conejos", + "50": "Terraria: ¡Edge of Space también mola!", "51": "Terraria: ¡Tan solo quiero saber dónde está el oro!", "52": "Terraria: ¡Ahora con más patos!", "53": "Terraria: 9 + 1 = 11", @@ -231,6 +232,7 @@ "TIMBER_Name": "¡Madera!", "TIN_FOIL_HATTER_Description": "Sobrevive a una invasión marciana en la que seres de otro mudno vienen a trastear con vuestros cerebros y a meteros sondas por sitios incómodos.", "TIN_FOIL_HATTER_Name": "Sombrero de aluminio", + "TOPPED_OFF_Description": "Consigue el máximo de maná y de vida sin accesorios ni mejoras.", "TOPPED_OFF_Name": "A tope", "TROUT_MONKEY_Description": "Completa tu misión número 25 de Rape.", "TROUT_MONKEY_Name": "Amante de la pesca", @@ -244,6 +246,7 @@ "WHERES_MY_HONEY_Name": "¿Dónde está mi miel?", "WINTERHEARTED_Description": "Derrota a la Reina de Hielo, la bruja malvada de las noches más frías.", "WINTERHEARTED_Name": "Corazón invernal", + "WORM_FODDER_Description": "Derrota al Devoramundos, un gigantesco gusano que se alimenta de corrupción.", "WORM_FODDER_Name": "Comida para gusanos", "YOU_AND_WHAT_ARMY_Description": "Ten a nueve súbditos invocados a la vez.", "YOU_AND_WHAT_ARMY_Name": "¿Con qué ejército?", @@ -330,6 +333,7 @@ "Server": "Servidor {0} de Terraria", "ServerMessage": " {0}", "ServerStarted": "Servidor iniciado", + "SetInitialMaxPlayers": "Máximo de jugadores (pulsa Intro para 8): ", "SetInitialPort": "Puerto del servidor (pulsa Intro para 7777): ", "SetMOTD_Command": "motd", "SetMOTD_Description": "Cambiar lema del día.", @@ -370,6 +374,7 @@ }, "Error": { "BadHeaderBufferOverflow": "Un mal titular dio lugar a una sobrecarga del búfer.", + "CaptureError": "Se produjo un error mientras se guardaba la captura. Volviendo a intentarlo...", "DataSentAfterConnectionLost": "Se han enviado datos a un cliente tras perder la conexión.", "Error": "Error", "ExceptionNormal": " Excepción normal: {0}", @@ -428,9 +433,7 @@ "YellowWires": "Cables amarillos", "BirthdayParty_1": "Parece que {0} está celebrando una fiesta.", "BirthdayParty_2": "Parece que {0} y {1} están celebrando una fiesta.", - "BirthdayParty_3": "Parece que {0}, {1} y {2} están celebrando una fiesta.", - "RespawnInPrefix": "", - "RespawnInSuffix": "{0}" + "BirthdayParty_3": "Parece que {0}, {1} y {2} están celebrando una fiesta." }, "GameUI": { "ActuationDeviceOff": "Dispositivo de actuación desactivado", @@ -447,6 +450,7 @@ "CompassCenter": "Centro", "CompassEast": "{0}' Este", "CompassWest": "{0}' Oeste", + "CraftingWindow": "Ventana de creación", "DepthLevel": "Nivel", "DPS": "{0} daño por segundo", "EnemiesNearby": "¡{0} enemigos cerca!", @@ -484,7 +488,7 @@ "RulerOff": "Regla no", "RulerOn": "Regla sí", "SettingsMenu": "Menú de ajustes", - "OpenFileFolder": "{$LegacyInterface.110}", + "SortInventory": "Ordenar inventario", "StormEffects": "Efectos de tormenta: {0}", "ThirdQuarter": "Tercer cuarto", "WaningCrescent": "Cuarto menguante", @@ -503,6 +507,7 @@ "NewMoon": "New Moon", "Normal": "Normal", "PrecentFishingPower": "{0}% de poder de pesca", + "QuickStackToNearby": "Guarda rápido cosas en los cofres cercanos", "Rain": "Lluvia", "Speed": "{0} mph", "Gameplay": "Sistema de juego", @@ -579,8 +584,8 @@ "MoveToCloud": "Subir a la nube", "New": "Nuevo", "Normal": "Normal", - "LightMode_White": "{$LegacyMenu.56}", - "LightMode_Color": "{$LegacyMenu.55}", + "NormalDescription": "(La experiencia básica de Terraria)", + "NormalDescriptionFlavor": "Comienza tu viaje...", "Play": "Jugar", "RestoreButton": "Restablecer", "Save": "Guardar", @@ -603,10 +608,7 @@ "SeedCopied": "Semilla copiada", "ZoomIn": "{$LegacyMenu.168}", "ZoomOut": "{$LegacyMenu.169}", - "Ellipsis": "...", - "LightMode_Retro": "{$LegacyMenu.57}", - "LightMode_Trippy": "{$LegacyMenu.58}", - "PlayerEmptyName": "{$Net.EmptyName}" + "Ellipsis": "..." }, "DeathSource": { "NPC": "{0} por {1}.", @@ -628,6 +630,7 @@ "Lava_3": "{0} ha intentado nadar en la lava.", "Lava_4": "{0} disfruta jugando en el magma.", "Petrified_1": "{0} ha sido troceado.", + "Petrified_2": "{0} no va a poder volver a montarse.", "Petrified_3": "{0} va a tener que salir de aquí en un contenedor.", "Petrified_4": "{0} se ha visto reducido a un montón de basura.", "Poisoned": "{0} no logró encontrar el antídoto..", @@ -690,8 +693,5 @@ "Chinese": "简体中文 (Chino simplificado)", "Portuguese": "Português brasileiro (Portugués de Brasil)", "Polish": "Polski (Polaco)" - }, - "RandomWorldName_Composition": { - "6": "{Adjective} {Location}" } } \ No newline at end of file diff --git a/Localization/Content/es-ES/Game.json b/Localization/Content/es-ES/Game.json index 07c3f78..64bddcb 100644 --- a/Localization/Content/es-ES/Game.json +++ b/Localization/Content/es-ES/Game.json @@ -15,6 +15,9 @@ "AdamantiteCaster": "Reduce el uso de maná en un 19%", "AdamantiteMelee": "Aumenta en un 18% la velocidad de movimiento y del cuerpo a cuerpo", "AdamantiteRanged": "Probabilidad del 25% de no gastar munición", + "HallowCaster": "Reduce el uso de maná en un 20%", + "HallowMelee": "Aumenta en un 19% la velocidad de movimiento y del cuerpo a cuerpo", + "HallowRanged": "Probabilidad del 25% de no gastar munición", "ShadowScale": "Aumenta en un 15% la velocidad de movimiento", "Wood": "1 defensa", "Crimson": "Mejora mucho la regeneración de vida", @@ -25,6 +28,7 @@ "Titanium": "Te vuelves inmune tras golpear a un enemigo", "Chlorophyte": "Invoca una poderosa hoja de cristal que se lanza a los enemigos cercanos", "Wizard": "Aumenta un 10% la probabilidad de impacto mágico crítico", + "Turtle": "Los atacantes también sufren el daño completo", "Meteor": "La pistola espacial no cuesta maná", "SpectreHealing": "El daño mágico infligido a los enemigos curará al jugador con menos vida", "Shroomite": "Si no te mueves entrarás en sigilo,\ncon lo que aumentará tu habilidad de ataque a distancia y se reducirá la posibilidad de que te ataquen los enemigos", @@ -36,8 +40,13 @@ "BeetleDefense": "Los escarabajos te protegen del daño", "BeetleDamage": "Los escarabajos aumentan la velocidad y el daño cuerpo a cuerpo", "Bee": "Aumenta un 10% el daño de los súbditos", + "Bone": "Probabilidad del 20% de no gastar munición", "Spider": "Aumenta un 12% el daño de los súbditos", + "Ninja": "Probabilidad del 33% de no gastar el objeto lanzado", + "Fossil": "Probabilidad del 50% de no gastar el objeto lanzado", + "Solar": "Con el tiempo, se generan escudos solares que te protegen,\nconsumes la energía de escudo al correr y dañas a los enemigos", "Vortex": "Pulsa dos veces {0} para entrar en sigilo o dejarlo,\ncon lo que aumentas tu habilidad a distancia y reduces la probabilidad de que los enemigos te ataquen, aunque se reduce tu velocidad de movimiento", + "Nebula": "Al dañar a los enemigos, tendrás una probabilidad de provocar debilitaciones\ny generar mejoras para acumular potenciadores", "Stardust": "Pulsa dos veces {0} para enviar a tu guardián hacia una posición", "Forbidden": "Pulsa dos veces {0} para invocar una antigua tormenta en la posición del cursor", "Jungle": "Reduce el uso de maná en un 16%", @@ -88,7 +97,7 @@ "Builder": "Aumenta el alcance y la velocidad de colocación", "BunnyMount": "Tienes ganas de zanahorias", "Burning": "Pierdes vida y se ralentizan tus movimientos", - "DesertMinecartRight": "{$BuffDescription.MinecartRight}", + "Calm": "Reduce la agresión de los enemigos", "Campfire": "La regeneración de vida ha aumentado un poco", "ChaosState": "Usar la Varita de la discordia consume vida", "Chilled": "Se ha reducido tu velocidad de movimiento", @@ -116,7 +125,7 @@ "FairyGreen": "Un hada te acompaña", "FairyRed": "Un hada te acompaña", "Featherfall": "Pulsa ARRIBA o ABAJO para controlar la velocidad de descenso", - "DesertMinecartLeft": "{$BuffDescription.MinecartLeft}", + "Fishing": "Aumenta el nivel de pesca", "Flipper": "Te mueves en el agua de forma normal", "Frostburn": "El 25% del daño sufrido se desviará a otro jugador O está muy caliente o está muy frío… lo que está claro es que DUELE", "Frozen": "¡No te puedes mover!", @@ -178,7 +187,7 @@ "PetDD2Gato": "Te está siguiendo un gatocóptero", "PetDD2Ghost": "Te está siguiendo un espirillama", "PetLizard": "Se pasa la vida arrastrado", - "FishMinecartRight": "{$BuffDescription.MinecartRight}", + "PetParrot": "Lorito quiere su galletita", "PetSapling": "Te está siguiendo un pequeño retoño", "PetSpider": "Te está siguiendo una araña", "PetTurtle": "¡Feliz hora de las tortugas!", @@ -250,7 +259,7 @@ "WeaponImbuePoison": "Los ataques cuerpo a cuerpo envenenan a los enemigos", "WeaponImbueVenom": "Los ataques cuerpo a cuerpo infligen Ponzoña a los objetivos", "Webbed": "Te has atascado", - "FishMinecartLeft": "{$BuffDescription.MinecartLeft}", + "WellFed": "Pequeñas mejoras a todas las características", "Werewolf": "Aumenta la capacidad física", "Wet": "Estás chorreando", "WindPushed": "¡El viento te mueve como si nada!", @@ -258,45 +267,7 @@ "WitheredArmor": "¡Se reduce tu armadura!", "WitheredWeapon": "¡Tus ataques son más débiles!", "Wrath": "Aumenta un 10% el daño", - "ZephyrFish": "Le gusta nadar a tu alrededor", - "BeeMinecartRight": "{$BuffDescription.MinecartRight}", - "BeeMinecartLeft": "{$BuffDescription.MinecartLeft}", - "LadybugMinecartRight": "{$BuffDescription.MinecartRight}", - "LadybugMinecartLeft": "{$BuffDescription.MinecartLeft}", - "PigronMinecartRight": "{$BuffDescription.MinecartRight}", - "PigronMinecartLeft": "{$BuffDescription.MinecartLeft}", - "SunflowerMinecartRight": "{$BuffDescription.MinecartRight}", - "SunflowerMinecartLeft": "{$BuffDescription.MinecartLeft}", - "HellMinecartRight": "{$BuffDescription.MinecartRight}", - "HellMinecartLeft": "{$BuffDescription.MinecartLeft}", - "ShroomMinecartRight": "{$BuffDescription.MinecartRight}", - "ShroomMinecartLeft": "{$BuffDescription.MinecartLeft}", - "AmethystMinecartRight": "{$BuffDescription.MinecartRight}", - "AmethystMinecartLeft": "{$BuffDescription.MinecartLeft}", - "TopazMinecartRight": "{$BuffDescription.MinecartRight}", - "TopazMinecartLeft": "{$BuffDescription.MinecartLeft}", - "SapphireMinecartRight": "{$BuffDescription.MinecartRight}", - "SapphireMinecartLeft": "{$BuffDescription.MinecartLeft}", - "EmeraldMinecartRight": "{$BuffDescription.MinecartRight}", - "EmeraldMinecartLeft": "{$BuffDescription.MinecartLeft}", - "RubyMinecartRight": "{$BuffDescription.MinecartRight}", - "RubyMinecartLeft": "{$BuffDescription.MinecartLeft}", - "DiamondMinecartRight": "{$BuffDescription.MinecartRight}", - "DiamondMinecartLeft": "{$BuffDescription.MinecartLeft}", - "AmberMinecartRight": "{$BuffDescription.MinecartRight}", - "AmberMinecartLeft": "{$BuffDescription.MinecartLeft}", - "BeetleMinecartRight": "{$BuffDescription.MinecartRight}", - "BeetleMinecartLeft": "{$BuffDescription.MinecartLeft}", - "MeowmereMinecartRight": "{$BuffDescription.MinecartRight}", - "MeowmereMinecartLeft": "{$BuffDescription.MinecartLeft}", - "PartyMinecartRight": "{$BuffDescription.MinecartRight}", - "PartyMinecartLeft": "{$BuffDescription.MinecartLeft}", - "PirateMinecartRight": "{$BuffDescription.MinecartRight}", - "PirateMinecartLeft": "{$BuffDescription.MinecartLeft}", - "SteampunkMinecartRight": "{$BuffDescription.MinecartRight}", - "SteampunkMinecartLeft": "{$BuffDescription.MinecartLeft}", - "CoffinMinecartRight": "{$BuffDescription.MinecartRight}", - "CoffinMinecartLeft": "{$BuffDescription.MinecartLeft}" + "ZephyrFish": "Le gusta nadar a tu alrededor" }, "BuffName": { "AmmoBox": "Caja de munición", @@ -439,7 +410,7 @@ "Regeneration": "Regeneración", "Rudolph": "Rudolph", "ScutlixMount": "Montura de scutlix", - "DesertMinecartRight": "{$BuffName.MinecartRight}", + "ShadowDodge": "Esquiva sombría", "ShadowFlame": "Llama oscura", "ShadowOrb": "Orbe sombrío", "SharknadoMinion": "Tornado de tiburones", @@ -502,48 +473,7 @@ "WitheredArmor": "Armadura marchita", "WitheredWeapon": "Arma marchita", "Wrath": "Ira", - "ZephyrFish": "Pez de zafiro", - "DesertMinecartLeft": "{$BuffName.MinecartLeft}", - "FishMinecartRight": "{$BuffName.MinecartRight}", - "FishMinecartLeft": "{$BuffName.MinecartLeft}", - "BeeMinecartRight": "{$BuffName.MinecartRight}", - "BeeMinecartLeft": "{$BuffName.MinecartLeft}", - "LadybugMinecartRight": "{$BuffName.MinecartRight}", - "LadybugMinecartLeft": "{$BuffName.MinecartLeft}", - "PigronMinecartRight": "{$BuffName.MinecartRight}", - "PigronMinecartLeft": "{$BuffName.MinecartLeft}", - "SunflowerMinecartRight": "{$BuffName.MinecartRight}", - "SunflowerMinecartLeft": "{$BuffName.MinecartLeft}", - "HellMinecartRight": "{$BuffName.MinecartRight}", - "HellMinecartLeft": "{$BuffName.MinecartLeft}", - "ShroomMinecartRight": "{$BuffName.MinecartRight}", - "ShroomMinecartLeft": "{$BuffName.MinecartLeft}", - "AmethystMinecartRight": "{$BuffName.MinecartRight}", - "AmethystMinecartLeft": "{$BuffName.MinecartLeft}", - "TopazMinecartRight": "{$BuffName.MinecartRight}", - "TopazMinecartLeft": "{$BuffName.MinecartLeft}", - "SapphireMinecartRight": "{$BuffName.MinecartRight}", - "SapphireMinecartLeft": "{$BuffName.MinecartLeft}", - "EmeraldMinecartRight": "{$BuffName.MinecartRight}", - "EmeraldMinecartLeft": "{$BuffName.MinecartLeft}", - "RubyMinecartRight": "{$BuffName.MinecartRight}", - "RubyMinecartLeft": "{$BuffName.MinecartLeft}", - "DiamondMinecartRight": "{$BuffName.MinecartRight}", - "DiamondMinecartLeft": "{$BuffName.MinecartLeft}", - "AmberMinecartRight": "{$BuffName.MinecartRight}", - "AmberMinecartLeft": "{$BuffName.MinecartLeft}", - "BeetleMinecartRight": "{$BuffName.MinecartRight}", - "BeetleMinecartLeft": "{$BuffName.MinecartLeft}", - "MeowmereMinecartRight": "{$BuffName.MinecartRight}", - "MeowmereMinecartLeft": "{$BuffName.MinecartLeft}", - "PartyMinecartRight": "{$BuffName.MinecartRight}", - "PartyMinecartLeft": "{$BuffName.MinecartLeft}", - "PirateMinecartRight": "{$BuffName.MinecartRight}", - "PirateMinecartLeft": "{$BuffName.MinecartLeft}", - "SteampunkMinecartRight": "{$BuffName.MinecartRight}", - "SteampunkMinecartLeft": "{$BuffName.MinecartLeft}", - "CoffinMinecartRight": "{$BuffName.MinecartRight}", - "CoffinMinecartLeft": "{$BuffName.MinecartLeft}" + "ZephyrFish": "Pez de zafiro" }, "MapObject": { "Adamantite": "Adamantita", @@ -615,166 +545,5 @@ "Roll": "{$LegacyMultiplayer.8}", "Party": "/p", "Emote": "/me" - }, - "Bestiary_ItemDropConditions": { - "NotExpert": "", - "NotMasterMode": "", - "LegacyHack_IsBossAndNotExpert": "", - "IsCrimsonAndNotExpert": "", - "IsCorruptionAndNotExpert": "", - "NotFromStatue": "" - }, - "Bestiary_FlavorText": { - "npc_JungleSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_YellowSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_RedSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_PurpleSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_BlackSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_GreenSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_BlueSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_DemonEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_Zombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_Skeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_AngryBones": "{$CommonBestiaryFlavor.AngryBones}", - "npc_Hornet": "{$CommonBestiaryFlavor.Hornet}", - "npc_Hellbat": "{$CommonBestiaryFlavor.LavaBat}", - "npc_BlueJellyfish": "{$CommonBestiaryFlavor.Jellyfish}", - "npc_PinkJellyfish": "{$CommonBestiaryFlavor.Jellyfish}", - "npc_Mummy": "{$CommonBestiaryFlavor.Mummy}", - "npc_DarkMummy": "{$CommonBestiaryFlavor.Mummy}", - "npc_LightMummy": "{$CommonBestiaryFlavor.Mummy}", - "npc_Mimic": "{$CommonBestiaryFlavor.Mimic}", - "npc_GreenJellyfish": "{$CommonBestiaryFlavor.Jellyfish}", - "npc_BaldZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_WanderingEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_Penguin": "{$CommonBestiaryFlavor.Penguin}", - "npc_PenguinBlack": "{$CommonBestiaryFlavor.Penguin}", - "npc_Lavabat": "{$CommonBestiaryFlavor.LavaBat}", - "npc_PigronCorruption": "{$CommonBestiaryFlavor.Pigron}", - "npc_PigronHallow": "{$CommonBestiaryFlavor.Pigron}", - "npc_PigronCrimson": "{$CommonBestiaryFlavor.Pigron}", - "npc_PincushionZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_SwampZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_TwiggyZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_CataractEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_SleepyEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_DialatedEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_GreenEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_PurpleEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_FemaleZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_HeadacheSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_MisassembledSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_PantlessSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_HornetFatty": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetHoney": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetLeafy": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetSpikey": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetStingy": "{$CommonBestiaryFlavor.Hornet}", - "npc_ZombieMushroom": "{$CommonBestiaryFlavor.MushroomZombie}", - "npc_ZombieMushroomHat": "{$CommonBestiaryFlavor.MushroomZombie}", - "npc_FungiBulb": "{$CommonBestiaryFlavor.FungiBulb}", - "npc_GiantFungiBulb": "{$CommonBestiaryFlavor.FungiBulb}", - "npc_RustyArmoredBonesAxe": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_RustyArmoredBonesFlail": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_RustyArmoredBonesSword": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_RustyArmoredBonesSwordNoArmor": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_BlueArmoredBones": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_BlueArmoredBonesMace": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_BlueArmoredBonesNoPants": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_BlueArmoredBonesSword": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_HellArmoredBones": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_HellArmoredBonesSpikeShield": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_HellArmoredBonesMace": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_HellArmoredBonesSword": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_RaggedCaster": "{$CommonBestiaryFlavor.RaggedCaster}", - "npc_RaggedCasterOpenCoat": "{$CommonBestiaryFlavor.RaggedCaster}", - "npc_Necromancer": "{$CommonBestiaryFlavor.Necromancer}", - "npc_NecromancerArmored": "{$CommonBestiaryFlavor.Necromancer}", - "npc_DiabolistRed": "{$CommonBestiaryFlavor.Diabolist}", - "npc_DiabolistWhite": "{$CommonBestiaryFlavor.Diabolist}", - "npc_AngryBonesBig": "{$CommonBestiaryFlavor.AngryBones}", - "npc_AngryBonesBigMuscle": "{$CommonBestiaryFlavor.AngryBones}", - "npc_AngryBonesBigHelmet": "{$CommonBestiaryFlavor.AngryBones}", - "npc_Scarecrow1": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow2": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow3": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow4": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow5": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow6": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow7": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow8": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow9": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow10": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_DemonEyeOwl": "{$CommonBestiaryFlavor.CostumeDemonEye}", - "npc_DemonEyeSpaceship": "{$CommonBestiaryFlavor.CostumeDemonEye}", - "npc_ZombieDoctor": "{$CommonBestiaryFlavor.CostumeZombie}", - "npc_ZombieSuperman": "{$CommonBestiaryFlavor.CostumeZombie}", - "npc_ZombiePixie": "{$CommonBestiaryFlavor.CostumeZombie}", - "npc_SkeletonTopHat": "{$CommonBestiaryFlavor.CostumeSkeleton}", - "npc_SkeletonAstonaut": "{$CommonBestiaryFlavor.CostumeSkeleton}", - "npc_SkeletonAlien": "{$CommonBestiaryFlavor.CostumeSkeleton}", - "npc_ZombieXmas": "{$CommonBestiaryFlavor.ZombieXmas}", - "npc_ZombieSweater": "{$CommonBestiaryFlavor.ZombieXmas}", - "npc_SlimeRibbonWhite": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_SlimeRibbonYellow": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_SlimeRibbonGreen": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_SlimeRibbonRed": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_ZombieElf": "{$CommonBestiaryFlavor.ZombieElf}", - "npc_ZombieElfBeard": "{$CommonBestiaryFlavor.ZombieElf}", - "npc_ZombieElfGirl": "{$CommonBestiaryFlavor.ZombieElf}", - "npc_ArmedZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombiePincushion": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombieSwamp": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombieTwiggy": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombieCenx": "{$CommonBestiaryFlavor.Zombie}", - "npc_GoldBird": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldBunny": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldButterfly": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldFrog": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldGrasshopper": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldMouse": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldWorm": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_BoneThrowingSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_BoneThrowingSkeleton2": "{$CommonBestiaryFlavor.Skeleton}", - "npc_BoneThrowingSkeleton3": "{$CommonBestiaryFlavor.Skeleton}", - "npc_BoneThrowingSkeleton4": "{$CommonBestiaryFlavor.Skeleton}", - "npc_GiantWalkingAntlion": "{$CommonBestiaryFlavor.AntlionCharger}", - "npc_GiantFlyingAntlion": "{$CommonBestiaryFlavor.AntlionSwarmer}", - "npc_DesertLamiaLight": "{$CommonBestiaryFlavor.Lamia}", - "npc_DesertLamiaDark": "{$CommonBestiaryFlavor.Lamia}", - "npc_SquirrelGold": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_SandShark": "{$CommonBestiaryFlavor.Sandshark}", - "npc_SandsharkCorrupt": "{$CommonBestiaryFlavor.Sandshark}", - "npc_SandsharkCrimson": "{$CommonBestiaryFlavor.Sandshark}", - "npc_SandsharkHallow": "{$CommonBestiaryFlavor.Sandshark}", - "npc_WalkingAntlion": "{$CommonBestiaryFlavor.AntlionCharger}", - "npc_FlyingAntlion": "{$CommonBestiaryFlavor.AntlionSwarmer}", - "npc_GoldGoldfish": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldGoldfishWalker": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_BlackDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_BlueDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_GreenDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_OrangeDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_RedDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_YellowDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_GoldDragonfly": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldLadyBug": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldWaterStrider": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldSeahorse": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_IceMimic": "{$CommonBestiaryFlavor.Mimic}", - "npc_GemSquirrelAmethyst": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelTopaz": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelSapphire": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelEmerald": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelRuby": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelDiamond": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelAmber": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemBunnyAmethyst": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyTopaz": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnySapphire": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyEmerald": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyRuby": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyDiamond": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyAmber": "{$CommonBestiaryFlavor.GemBunny}" } } \ No newline at end of file diff --git a/Localization/Content/es-ES/Items.json b/Localization/Content/es-ES/Items.json index c8b72a5..200a083 100644 --- a/Localization/Content/es-ES/Items.json +++ b/Localization/Content/es-ES/Items.json @@ -232,6 +232,7 @@ "RedHusk": "Caparazón rojo", "CyanHusk": "Caparazón turquesa", "VioletHusk": "Caparazón morado", + "PurpleMucos": "Babas moradas", "BlackInk": "Tinta negra", "FlowerofFire": "Flor de fuego", "DyeVat": "Tubo para tinte", @@ -538,6 +539,7 @@ "CarriageLantern": "Linterna de carroza", "AlchemyLantern": "Linterna de alquimia", "DiablostLamp": "Farola del diablo", + "OilRagSconse": "Candelero de aceite", "BlueDungeonChair": "Silla de mazmorra azul", "BlueDungeonTable": "Mesa de mazmorra azul", "BlueDungeonWorkBench": "Banco de trabajo de mazmorra azul", @@ -690,6 +692,7 @@ "NecroGreaves": "Grebas de los muertos", "CrimsonChest": "Cofre carmesí", "HallowedChest": "Cofre sagrado", + "FrozenChest": "Cofre congelado", "JungleKey": "Llave de la selva", "CorruptionKey": "Llave corrupta", "CrimsonKey": "Llave carmesí", @@ -760,6 +763,7 @@ "TitanstoneBlockWall": "Bloque de pared de piedratita", "MagicCuffs": "Esposas mágicas", "MusicBoxSnow": "Caja de música (Nieve)", + "MusicBoxSpace": "Caja de música (Espacio)", "MusicBoxCrimson": "Caja de música (Carmesí)", "MusicBoxBoss4": "Caja de música (Jefe final 4)", "SilverWatch": "Reloj de plata", @@ -768,6 +772,7 @@ "MusicBoxRain": "Caja de música (Lluvia)", "MusicBoxIce": "Caja de música (Hielo)", "MusicBoxDesert": "Caja de música (Desierto)", + "MusicBoxOcean": "Caja de música (Océano)", "MusicBoxDungeon": "Caja de música (Mazmorra)", "MusicBoxPlantera": "Caja de música (Plantera)", "MusicBoxBoss5": "Caja de música (Jefe final 5)", @@ -810,6 +815,7 @@ "DerplingBanner": "Estandarte de tontuno", "EaterofSoulsBanner": "Estandarte de Devoraalmas", "EnchantedSwordBanner": "Estandarte de espada encantada", + "ZombieEskimoBanner": "Estandarte de zombi esquimal", "FaceMonsterBanner": "Estandarte de caramonstruo", "FloatyGrossBanner": "Estandarte de flotasquillo", "FlyingFishBanner": "Estandarte de pez volador", @@ -1003,6 +1009,7 @@ "SpookyDoor": "Puerta tétrica", "SpookyTable": "Mesa tétrica", "SpookyWorkBench": "Banco de trabajo tétrico", + "SpookyPlatform": "Plataforma tétrica", "ReaperHood": "Caperuza de la Muerte", "Diamond": "Diamante", "ReaperRobe": "Vestido de la Muerte", @@ -1558,7 +1565,7 @@ "GuideVoodooFish": "Pez guía vudú", "Wyverntail": "Cola de guiverno", "ZombieFish": "Pez zombi", - "AmanitaFungifin": "Fungifin amanitia", + "AmanitiaFungifin": "Fungifin amanitia", "Angelfish": "Pez ángel", "BloodyManowar": "Buque de guerra sangriento", "Bonefish": "Pez hueso", @@ -1637,7 +1644,7 @@ "SwiftnessPotion": "Poción de rapidez", "BlueArmoredBonesBanner": "Estandarte de huesos azules acorazados", "BlueCultistArcherBanner": "Estandarte de arquero sectario azul", - "ManaCloakStar": "", + "BlueCultistCasterBanner": "Estandarte de mago sectario azul", "BlueCultistFighterBanner": "Estandarte de guerrero sectario azul", "BoneLeeBanner": "Estandarte de Hueso Lee", "ClingerBanner": "Estandarte de lapa", @@ -2203,6 +2210,7 @@ "TacticalShotgun": "Escopeta táctica", "RottenChunk": "Trozo podrido", "IvyChest": "Cofre de hiedra", + "IceChest": "Cofre de hielo", "Marrow": "Médula", "UnholyTrident": "Tridente infame", "FrostHelmet": "Casco helado", @@ -2338,6 +2346,9 @@ "TheUndertaker": "El enterrador", "TheMeatball": "La albóndiga", "TheRottedFork": "El tenedor podrido", + "EskimoHood": "Capucha de esquimal", + "EskimoCoat": "Abrigo de esquimal", + "EskimoPants": "Pantalones de esquimal", "LivingWoodChair": "Silla de madera viviente", "CactusChair": "Silla de cactus", "BoneChair": "Silla de hueso", @@ -2527,7 +2538,10 @@ "ShoeSpikes": "Zapatos de púa", "TigerClimbingGear": "Equipo de escalada de tigre", "Tabi": "Tabi", + "PinkEskimoHood": "Caperuza de esquimal rosa", + "PinkEskimoCoat": "Abrigo de esquimal rosa", "Minishark": "Minitiburón", + "PinkEskimoPants": "Pantalones de esquimal rosas", "PinkThread": "Hilo rosa", "ManaRegenerationBand": "Banda de regeneración de maná", "SandstorminaBalloon": "Tormenta de arena en globo", @@ -2602,6 +2616,7 @@ "AncientBattleArmorPants": "Bandas prohibidas", "AncientBattleArmorShirt": "Vestido prohibido", "AncientCloth": "Ropa antigua", + "AncientCultistTrophy": "Trofeo de Sectario Antiguo", "AncientHorn": "Cuerno antiguo", "AnglerTackleBag": "Bolsa de aparejos de Rape", "AngryBonesBanner": "Estandarte de huesos enfadados", @@ -2697,6 +2712,7 @@ "BorealWoodTable": "Mesa de madera boreal", "BorealWoodWall": "Pared de madera boreal", "BorealWoodWorkBench": "Mesa de trabajo de madera boreal", + "BossMaskCultist": "Máscara de Sectario Antiguo", "BossMaskMoonlord": "Máscara del Señor de la Luna", "BottomlessBucket": "Cubo de agua sin fondo", "BouncyBomb": "Bomba saltarina", @@ -2820,6 +2836,7 @@ "DestroyerBossBag": "Bolsa del tesoro", "DestroyerMask": "Máscara del Destructor", "Detonator": "Detonador", + "DevDye": "Sangre de Skiphs", "DiamondGemsparkWall": "Pared de diamante gemachispa", "DiamondGemsparkWallOff": "Pared sin conexión de diamante gemachispa", "DjinnLamp": "Farola de espíritu del desierto", @@ -2883,12 +2900,14 @@ "Fake_DynastyChest": "Cofre dinástico atrapado", "Fake_EbonwoodChest": "Cofre de madera de ébano atrapado", "Fake_FleshChest": "Cofre de carne atrapado", + "Fake_FrozenChest": "Cofre congelado atrapado", "Fake_GlassChest": "Cofre de cristal atrapado", "Fake_GoldChest": "Cofre de oro atrapado", "Fake_GraniteChest": "Cofre de granito atrapado", "Fake_GreenDungeonChest": "Cofre de mazmorra verde atrapado", "Fake_HallowedChest": "Cofre sagrado atrapado", "Fake_HoneyChest": "Cofre de miel atrapado", + "Fake_IceChest": "Cofre de hielo atrapado", "Fake_IvyChest": "Cofre de hiedra atrapado", "Fake_JungleChest": "Cofre de la selva atrapado", "Fake_LihzahrdChest": "Cofre de lihzahrd atrapado", @@ -3558,6 +3577,7 @@ "SailfishBoots": "Botas de pez vela", "SalamanderBanner": "Estandarte de slamandra", "SandElementalBanner": "Estandarte de elemental de arena", + "SandFallBlock": "Catarata de arena", "SandFallWall": "Pared de catarata de arena", "SandsharkBanner": "Estandarte de tiburón de arena", "SandsharkCorruptBanner": "Estandarte de muertehuesos", @@ -3621,6 +3641,10 @@ "SkeletronBossBag": "Bolsa del tesoro", "SkeletronPrimeBossBag": "Bolsa del tesoro", "SkeletronPrimeMask": "Máscara Esqueletrón mayor", + "SkiphsHelm": "Máscara de Skiphs", + "SkiphsPants": "Culo de oso de Skiphs", + "SkiphsShirt": "Piel de Skiphs", + "SkiphsWings": "Garras de Skiphs", "SkyBlueString": "Hilo azul celeste", "SkyFracture": "Fractura celestial", "SkywareBathtub": "Bañera celestial", @@ -3662,6 +3686,7 @@ "SmokeBlock": "Bloque de humo", "SnailStatue": "Estatua de caracol", "SnowCloudBlock": "Nube de nieve", + "SnowFallBlock": "Nieve", "SnowFallWall": "Pared de nieve", "SolarCoriteBanner": "Estandarte de corita", "SolarCrawltipedeBanner": "Estandarte de arrastrapiés", @@ -3806,6 +3831,7 @@ "TwilightHairDye": "Tinte de pelo de crepúsculo", "TwinMask": "Máscara gemela", "TwinsBossBag": "Bolsa del tesoro", + "UltraBrightCampfire": "Hoguera ultrabrillante", "UndeadVikingStatue": "Estatua de vikingo no muerto", "UnicornStatue": "Estatua de unicornio", "UnicornWispDye": "Tinte de voluta unicornio", @@ -3954,6 +3980,7 @@ "DungeonClockPink": "Reloj de mazmorra rosa", "DynastyDresser": "Aparador dinástico", "DynastyPiano": "Piano dinástico", + "DynastyPlatform": "Plataforma dinástica", "DynastySofa": "Sofá dinástico", "Fake_CrystalChest": "Cofre de cristal con trampa", "Fake_GoldenChest": "Cofre dorado con trampa", @@ -3978,6 +4005,10 @@ "SquireAltPants": "Grebas de Caballero del Valhalla", "SquireAltShirt": "Coraza de Caballero del Valhalla", "SkywareClock2": "Reloj soleado", + "ArkhalisHat": "Caperuza de Arkhalis", + "ArkhalisShirt": "Corpiño de Arkhalis", + "ArkhalisPants": "Mallas de Arkhalis", + "ArkhalisWings": "Alas ligeras de Arkhalis", "LeinforsHat": "Protector capilar de Leinfors", "LeinforsShirt": "Estilo excesivo de Leinfors", "LeinforsPants": "Pantalones molones de Leinfors", @@ -4003,7 +4034,7 @@ "Paintbrush": "Se usa para colorear bloques", "PaintRoller": "Se usa para colorear paredes", "ManaCrystal": "Aumenta el maná máximo en 20 de forma permanente", - "GolfBallDyedPink": "{$CommonItemTooltip.GolfBall}", + "PaintScraper": "Se usa para quitar la pintura", "TealMushroom": "Se usa para hacer tinte verde azulado", "GreenMushroom": "Se usa para hacer tinte verde", "SkyBlueFlower": "Se usa para hacer tinte azul cielo", @@ -4027,7 +4058,7 @@ "MagicMissile": "Lanza un proyectil dirigible", "Beenade": "Explota en un enjambre de abejas", "GravityGlobe": "Permite al portador invertir la gravedad\nPulsa ARRIBA para cambiar la gravedad", - "KiteRed": "{$CommonItemTooltip.Kite}", + "HoneyComb": "Libera abejas al sufrir daños", "Abeemination": "Invoca a la abeja reina", "DirtRod": "Desplaza la tierra por arte de magia", "TempleKey": "Abre la puerta del templo de la selva", @@ -4036,10 +4067,10 @@ "LihzahrdPressurePlate": "Se activa cuando un jugador se pone encima", "PiranhaGun": "Se pega a los enemigos para infligirles daño continuado", "PygmyStaff": "Invoca a un pigmeo para que luche por ti", - "KiteBlueAndYellow": "{$CommonItemTooltip.Kite}", - "KiteBlue": "{$CommonItemTooltip.Kite}", - "KiteWyvern": "{$CommonItemTooltip.Kite}", - "GroxTheGreatGreaves": "{$CommonItemTooltip.DevItem}", + "PygmyNecklace": "Aumenta el máximo de súbditos que puedes tener", + "TikiMask": "Aumenta el máximo de súbditos que puedes tener\nAumenta un 10% el daño de los súbditos", + "TikiShirt": "Aumenta el máximo de súbditos que puedes tener\nAumenta un 10% el daño de los súbditos", + "TikiPants": "Aumenta el máximo de súbditos que puedes tener\nAumenta un 10% el daño de los súbditos", "LeafWings": "{$CommonItemTooltip.FlightAndSlowfall}", "BlizzardinaBalloon": "Su portador puede realizar saltos dobles\nAumenta la altura de los saltos", "BundleofBalloons": "Su portador puede realizar saltos cuádruples\nAumenta la altura de los saltos", @@ -4088,19 +4119,19 @@ "MeteorSuit": "Aumenta el daño de los ataques mágicos en un 7%", "AmberMosquito": "Invoca a un dinosaurio bebé", "NimbusRod": "Invoca una nube para que llueva sobre tus enemigos", - "GroxTheGreatArmor": "{$CommonItemTooltip.DevItem}", + "BeeCloak": "Hace que las estrellas caigan y libera abejas al recibir daños", "EyeoftheGolem": "Aumenta un 10% la probabilidad de ataque crítico", "HoneyBalloon": "Aumenta la altura de los saltos\nLibera abejas al sufrir daños", "MeteorLeggings": "Aumenta el daño de los ataques mágicos en un 7%", "BlueHorseshoeBalloon": "Su portador puede realizar saltos dobles\nAumenta la altura de los saltos y anula el daño al caer", "WhiteHorseshoeBalloon": "Su portador puede realizar saltos dobles\nAumenta la altura de los saltos y anula el daño al caer", "YellowHorseshoeBalloon": "Su portador puede realizar saltos dobles\nAumenta la altura de los saltos y anula el daño al caer", - "OceanCrate": "{$CommonItemTooltip.RightClickToOpen}", + "FrozenTurtleShell": "Cuando el portador está por debajo del 50% de vida, una coraza lo envuelve y reduce el daño", "SniperRifle": "Dispara una potente bala de gran velocidad\n para alejar", "VenusMagnum": "Dispara una potente bala de gran velocidad", "CrimsonRod": "Invoca una nube para que llueva sangre sobre los enemigos", - "SteampunkWings": "{$CommonItemTooltip.FlightAndSlowfall}", - "WingsVortex": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", + "Stynger": "Dispara un proyectil explosivo", + "FlowerPow": "Dispara pétalos de flores afilados como cuchillas a los enemigos cercanos", "RainbowGun": "Dispara un arcoíris que inflige daño continuado", "StyngerBolt": "Explota con una metralla letal", "FlowerofFrost": "Dispara una bola de escarcha", @@ -4112,11 +4143,11 @@ "EmeraldRobe": "Aumenta el maná máximo en 60\nReduce el consumo de maná un 11%", "RubyRobe": "Aumenta el maná máximo en 60\nReduce el consumo de maná un 13%", "DiamondRobe": "Aumenta el maná máximo en 80\nReduce el consumo de maná un 15%", - "GroxTheGreatHelm": "{$CommonItemTooltip.DevItem}", + "PanicNecklace": "Aumenta la velocidad de movimiento tras ser golpeado", "LifeFruit": "Aumenta permanentemente el nivel máximo de vida en 9", "LihzahrdPowerCell": "Se usa en el altar de lihzahrd", "Picksaw": "Capaz de extraer ladrillos de lihzahrd", - "JimsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "HeatRay": "Dispara un penetrante rayo de calor\n¡Hoolaaa!", "StaffofEarth": "Invoca una poderosa roca", "GolemFist": "Golpea con la fuerza de un gólem", "Binoculars": "Al portarlo, aumenta el alcance de la visión", @@ -4136,8 +4167,8 @@ "TurtleHelmet": "Aumenta un 6% el daño cuerpo a cuerpo\nSerá más probable que los enemigos te ataquen", "TurtleScaleMail": "Aumenta un 8% el daño cuerpo a cuerpo y la probabilidad de ataque crítico\nSerá más probable que los enemigos te ataquen", "TurtleLeggings": "Aumenta un 4% la probabilidad de ataque crítico en el cuerpo a cuerpo\nSerá más probable que los enemigos te ataquen", - "KiteWorldFeeder": "{$CommonItemTooltip.Kite}", - "OasisCrateHard": "{$CommonItemTooltip.RightClickToOpen}", + "MagicQuiver": "Aumenta un 10% el daño y aumenta notablemente la velocidad de las flechas\nProbabilidad del 20% de no gastar flechas", + "MagmaStone": "Inflige daño de fuego al atacar", "ObsidianRose": "Reduce el daño al tocar lava", "RodofDiscord": "Te teletransporta a la posición del ratón", "DeathSickle": "Dispara una hoz letal", @@ -4147,7 +4178,7 @@ "IchorArrow": "Reduce la defensa del objetivo", "IchorBullet": "Reduce la defensa del objetivo", "GoldenShower": "Genera una lluvia de icor\nReduce la defensa del objetivo", - "OasisCrate": "{$CommonItemTooltip.RightClickToOpen}", + "FireGauntlet": "Aumenta el retroceso en el cuerpo a cuerpo e inflige daño de fuego al atacar\nAumenta un 10% la velocidad y el daño del cuerpo a cuerpo", "ImbuingStation": "Se usa para crear viales con los que imbuir las armas", "EmptyBullet": "Se usa para crear diferentes tipos de munición", "ShadowbeamStaff": "Crea un rayo de sombra que rebota en las paredes", @@ -4176,17 +4207,17 @@ "CorruptionKey": "Desbloquea un cofre corrupto en esta mazmorra", "CrimsonKey": "Desbloquea un cofre carmesí en esta mazmorra", "HallowedKey": "Desbloquea un cofre sagrado en esta mazmorra", - "Cherry": "{$CommonItemTooltip.MinorStats}", + "FrozenKey": "Desbloquea un cofre congelado en esta mazmorra", "SpectrePaintbrush": "Se usa para colorear bloques", "SpectrePaintRoller": "Se usa para colorear paredes", - "GolfBallDyedOrange": "{$CommonItemTooltip.GolfBall}", + "SpectrePaintScraper": "Se usa para quitar la pintura", "ShroomiteHeadgear": "Aumenta un 15% el daño de las flechas\nAumenta un 5% la probabilidad de asestar ataques críticos a distancia", "ShroomiteMask": "Aumenta un 15% el daño de las balas\nAumenta un 5% la probabilidad de asestar ataques críticos a distancia", "ShroomiteHelmet": "Aumenta un 15% el daño de los cohetes\nAumenta un 5% la probabilidad de asestar ataques críticos a distancia", - "KiteBoneSerpent": "{$CommonItemTooltip.Kite}", + "ShroomiteBreastplate": "Aumenta un 13% la probabilidad de asestar ataques críticos a distancia\nProbabilidad del 20% de no gastar munición", "ShroomiteLeggings": "Aumenta un 7% la probabilidad de asestar ataques críticos a distancia\nAumenta en un 12% la velocidad de movimiento", "Autohammer": "Convierte los lingotes de clorofita en lingotes de piñonita", - "Jetpack": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressUpToBooster}", + "SDMG": "Probabilidad del 50% de no gastar munición\nLlegó desde los confines del espacio", "CenxsTiara": "{$CommonItemTooltip.DevItem}", "CenxsBreastplate": "{$CommonItemTooltip.DevItem}", "CenxsLeggings": "{$CommonItemTooltip.DevItem}", @@ -4206,17 +4237,17 @@ "VampireKnives": "Lanza con rapidez dagas que roban vida", "AquaScepter": "Lanza un chorro de agua", "ScourgeoftheCorruptor": "Una poderosa jabalina que libera a pequeños devoradores", - "Banana": "{$CommonItemTooltip.MinorStats}", + "StaffoftheFrostHydra": "Dispara una poderosa hidra de escarcha para escupir hielo a tus enemigos", "SweetheartNecklace": "Libera abejas y aumenta la velocidad de movimiento al sufrir daños", "FlurryBoots": "El portador podrá correr superrápido", "LuckyHorseshoe": "Anula el daño al caer", "DTownsHelmet": "{$CommonItemTooltip.DevItem}", "DTownsBreastplate": "{$CommonItemTooltip.DevItem}", "DTownsLeggings": "{$CommonItemTooltip.DevItem}", - "GroxTheGreatWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", - "StillLife": "{$PaintingArtist.Crowno}", - "BloodyGoblet": "{$PaintingArtist.Crowno}", - "WickedUndead": "{$PaintingArtist.Crowno}", + "DTownsWings": "{$CommonItemTooltip.DevItem}", + "WillsWings": "{$CommonItemTooltip.DevItem}", + "CrownosWings": "{$CommonItemTooltip.DevItem}", + "CenxsWings": "{$CommonItemTooltip.DevItem}", "CenxsDress": "{$CommonItemTooltip.DevItem}", "CenxsDressPants": "{$CommonItemTooltip.DevItem}", "ShinyRedBalloon": "Aumenta la altura de los saltos", @@ -4225,7 +4256,7 @@ "AnkhCharm": "Otorga inmunidad a la mayoría de estados alterados", "AnkhShield": "Otorga inmunidad al retroceso y a los bloques de fuego\nOtorga inmunidad a la mayoría de estados alterados", "WaterBolt": "Lanza un proyectil de agua a baja velocidad", - "GolfBall": "{$CommonItemTooltip.GolfBall}", + "Bomb": "Pequeña explosión capaz de romper varios ladrillos", "Dynamite": "Gran explosión capaz de romper casi todos los ladrillos", "Grenade": "Pequeña explosión que no rompe ningún ladrillo", "GoldWatch": "Da la hora", @@ -4237,7 +4268,7 @@ "GoodieBag": "{$CommonItemTooltip.RightClickToOpen}", "CandyCornRifle": "Probabilidad del 33% de no gastar munición", "Sickle": "Permite obtener heno de la hierba", - "KiteAngryTrapper": "{$CommonItemTooltip.Kite}", + "PumpkinPie": "{$CommonItemTooltip.MinorStats}", "TatteredFairyWings": "{$CommonItemTooltip.FlightAndSlowfall}", "SpiderEgg": "Invoca a una araña mascota", "MagicalPumpkinSeed": "Invoca a calabacín mascota", @@ -4253,35 +4284,35 @@ "UnluckyYarn": "Invoca a un gatito negro", "TheHorsemansBlade": "Invoca cabezas de calabaza que atacan a tus enemigos", "SpookyWings": "{$CommonItemTooltip.FlightAndSlowfall}", - "GhostManifestation": "{$PaintingArtist.Crowno}", - "Graveyard": "{$PaintingArtist.Crowno}", - "Reborn": "{$PaintingArtist.Crowno}", + "SpookyHelmet": "Aumenta el máximo de súbditos que puedes tener\nAumenta un 11% el daño de los súbditos", + "SpookyBreastplate": "Aumenta el máximo de súbditos que puedes tener\nAumenta un 11% el daño de los súbditos", + "SpookyLeggings": "Aumenta el máximo de súbditos que puedes tener\nAumenta un 11% el daño de los súbditos", "CursedSapling": "Invoca a un retoño maldito para que te siga", "PumpkinMoonMedallion": "Invoca a la Luna calabaza", - "Nevermore": "{$PaintingArtist.Crowno}", + "NecromanticScroll": "Aumenta el máximo de súbditos que puedes tener\nAumenta un 10% el daño de los súbditos", "SniperScope": "Aumenta el alcance de la visión con armas ( para alejar)\nAumenta un 10% el daño a distancia y la probabilidad de impacto crítico", "BreathingReed": "Aumenta el tiempo de respiración y permite respirar bajo el agua", "JellyfishDivingGear": "Otorga la habilidad de nadar y aumenta notablemente el tiempo de respiración bajo el agua\nOfrece luz al estar bajo el agua", "ArcticDivingGear": "Otorga la habilidad de nadar y aumenta notablemente el tiempo de respiración bajo el agua\nOfrece luz bajo el agua y movilidad extra en el hielo", - "GnomeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.Gnome}", + "FrostsparkBoots": "Permite volar, correr muy rápido y tener más movilidad sobre el hielo\nAumenta en un 7% la velocidad de movimiento", "FartInABalloon": "Su portador puede realizar saltos dobles\nAumenta la altura de los saltos", - "DandelionBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.Dandelion}", - "GolfPainting3": "{$PaintingArtist.Crowno}", - "ArkhalisWings": "{$ItemTooltip.ArkhalisHat}\n{$CommonItemTooltip.FlightAndSlowfall}", + "PapyrusScarab": "Aumenta el máximo de súbditos que puedes tener\nAumenta el daño y el retroceso de tus súbditos", + "CelestialStone": "Pequeño aumento del daño, la velocidad y la probabilidad de crítico del cuerpo a cuerpo\nRegeneración de vida, defensa, velocidad y retroceso de los súbditos", + "Hoverboard": "{$CommonItemTooltip.FlightAndSlowfall}\nMantén ABAJO y SALTO para planear", "Present": "{$CommonItemTooltip.RightClickToOpen}", "Flipper": "Permite nadar", "RedRyder": "¡No te saques un ojo!", "FestiveWings": "{$CommonItemTooltip.FlightAndSlowfall}", "BladeofGrass": "Puede envenenar a los enemigos", "EldMelter": "Utiliza gel como munición", - "KiteGoldfish": "{$CommonItemTooltip.Kite}", + "ChristmasPudding": "{$CommonItemTooltip.MinorStats}", "ReindeerBells": "Invoca a un reno que podrás usar", "CnadyCanePickaxe": "Permite excavar meteoritos", - "KiteBunnyCrimson": "{$CommonItemTooltip.Kite}", - "KiteBunnyCorrupt": "{$CommonItemTooltip.Kite}", + "SugarCookie": "{$CommonItemTooltip.MinorStats}", + "GingerbreadCookie": "{$CommonItemTooltip.MinorStats}", "HandWarmer": "Ofrece inmunidad a los efectos de helado y congelación", "Coal": "¡Este año te has portado muy mal!", - "GolfPainting2": "{$PaintingArtist.Crowno}", + "Toolbox": "Aumenta en 1 el alcance de las herramientas y la colocación de objetos", "DogWhistle": "Invoca a un cachorrito", "ChristmasTreeSword": "Dispara adornos navideños", "ChainGun": "Probabilidad del 50% de no gastar munición", @@ -4297,7 +4328,7 @@ "JungleRose": "Hermosa, muy hermosa", "FeralClaws": "Aumenta un 12% la velocidad del cuerpo a cuerpo", "AnkletoftheWind": "Aumenta en un 10% la velocidad de movimiento", - "GolfClubIron": "{$CommonItemTooltip.GolfIron}", + "StaffofRegrowth": "Crea hierba y musgo sobre el barro y la piedra\nAl usarlo para recolectar, aumenta la recolección de plantas de alquimia", "WhoopieCushion": "Una molestia para los demás", "HeavyWorkBench": "Se usa para fabricación avanzada", "AmmoBox": "Reduce un 20% el consumo de munición", @@ -4318,7 +4349,7 @@ "SteampunkBoiler": "{$CommonItemTooltip.SpecialCrafting}", "HoneyDispenser": "{$CommonItemTooltip.SpecialCrafting}", "BrickLayer": "Aumenta la velocidad a la que se colocan baldosas", - "GolfPainting1": "{$PaintingArtist.Crowno}", + "ExtendoGrip": "Aumenta el alcance de las baldosas", "PaintSprayer": "Pinta automáticamente los objetos colocados", "PortableCementMixer": "Aumenta la velocidad de colocación de paredes", "CelestialMagnet": "Aumenta el rango de recogida de estrellas de maná", @@ -4327,8 +4358,8 @@ "CelestialCuffs": "Aumenta el rango de recogida de estrellas de maná\nRecupera maná al sufrir daños", "PulseBow": "Dispara una flecha cargada", "NaturesGift": "Reduce el uso de maná en un 6%", - "KiteSandShark": "{$CommonItemTooltip.Kite}", - "KiteShark": "{$CommonItemTooltip.Kite}", + "PadThai": "{$CommonItemTooltip.MinorStats}", + "Pho": "{$CommonItemTooltip.MinorStats}", "RestorationPotion": "Reduce el tiempo de espera para usar pociones", "Gatligator": "Probabilidad del 50% de no gastar munición\nMuy impreciso", "WaterGun": "Lanza un inofensivo chorro de agua", @@ -4341,14 +4372,14 @@ "Gel": "Sabroso a la par que inflamable", "JunglePants": "Aumenta el maná máximo en 20\nAumenta un 4% la probabilidad de impacto mágico crítico", "NeonTetra": "Sus escamas coloridas se podrían vender a buen precio", - "Grapefruit": "{$CommonItemTooltip.MinorStats}", + "GoldenCarp": "Brilla mucho. Seguro que se puede vender por mucho dinero.", "MiningPotion": "Aumenta un 25% la velocidad de minería", "HeartreachPotion": "Aumenta el rango de recogida de corazones", - "DungeonFishingCrateHard": "{$ItemTooltip.DungeonFishingCrate}", + "CalmingPotion": "Reduce la agresión de los enemigos", "BuilderPotion": "Aumenta el alcance y la velocidad de colocación", "TitanPotion": "Aumenta el retroceso", "FlipperPotion": "Te permite moverte más rápido en líquidos", - "DivineEye": "{$PaintingArtist.Darthkitten}", + "SummoningPotion": "Aumenta el máximo de súbditos que puedes tener", "TrapsightPotion": "Te permite ver los peligros cercanos", "WoodenCrate": "{$CommonItemTooltip.RightClickToOpen}", "IronCrate": "{$CommonItemTooltip.RightClickToOpen}", @@ -4359,36 +4390,36 @@ "RagePotion": "Aumenta un 10% la probabilidad de impacto crítico", "InfernoPotion": "Prende fuego a los enemigos cercanos", "WrathPotion": "Aumenta un 10% el daño", - "GolfClubDriver": "{$CommonItemTooltip.GolfDriver}", + "StickyBomb": "Puede ser difícil de lanzar", "RecallPotion": "Te teletransporta a casa", "TeleportationPotion": "Te teletransporta a una ubicación aleatoria", "LovePotion": "Lánzaselo a alguien para que se enamore", "StinkPotion": "Lánzaselo a alguien para que huela fatal", - "BandageBoy": "{$PaintingArtist.Darthkitten}", + "FishingPotion": "Aumenta la habilidad de pesca", "SonarPotion": "Detecta que un pez ha picado", "CratePotion": "Aumenta la probabilidad de conseguir una caja", "WarmthPotion": "Reduce el daño de las fuentes de frío", - "VisitingThePyramids": "{$PaintingArtist.Leinfors}", - "Uluru": "{$PaintingArtist.darthmorf}", + "BeeHeadgear": "Aumenta un 4% el daño de los súbditos\nAumenta el máximo de súbditos que puedes tener", + "BeeBreastplate": "Aumenta un 4% el daño de los súbditos\nAumenta el máximo de súbditos que puedes tener", "BeeGreaves": "Aumenta un 5% el daño de los súbditos", "HornetStaff": "Invoca a un avispón para que luche por ti", "ImpStaff": "Invoca a un diablillo para que luche por ti", - "Oasis": "{$PaintingArtist.Khaios}", - "LifeAboveTheSand": "{$PaintingArtist.Zoomo}", - "SnakesIHateSnakes": "{$PaintingArtist.Xman101}", + "AnglerHat": "Aumenta el nivel de pesca", + "AnglerVest": "Aumenta el nivel de pesca", + "AnglerPants": "Aumenta el nivel de pesca", "Sunglasses": "¡Te quedan muy bien!", - "TheSandsOfSlime": "{$PaintingArtist.Criddle}", - "JawsOfDeath": "{$PaintingArtist.Darthkitten}", - "BurningSpirit": "{$PaintingArtist.Zoomo}", + "SpiderMask": "Aumenta el máximo de súbditos que puedes tener\nAumenta un 6% el daño de los súbditos", + "SpiderBreastplate": "Aumenta el máximo de súbditos que puedes tener\nAumenta un 6% el daño de los súbditos", + "SpiderGreaves": "Aumenta el máximo de súbditos que puedes tener\nAumenta un 6% el daño de los súbditos", "HighTestFishingLine": "El sedal nunca se romperá", - "FruitSalad": "{$CommonItemTooltip.MinorStats}", + "AnglerEarring": "Aumenta la habilidad de pesca", "TackleBox": "Reduce la probabilidad de consumo del cebo", "WizardHat": "Aumenta el daño de los ataques mágicos en un 15%", "ZephyrFish": "Invoca a un pez zafiro como mascota", "FrogLeg": "Aumenta la velocidad de salto y permite el salto automático\nAumenta la resistencia a las caídas", - "Dragonfruit": "{$CommonItemTooltip.MediumStats}", - "KiteJellyfishPink": "{$CommonItemTooltip.Kite}", - "KiteJellyfishBlue": "{$CommonItemTooltip.Kite}", + "CookedFish": "{$CommonItemTooltip.MinorStats}", + "CookedShrimp": "{$CommonItemTooltip.MinorStats}", + "Sashimi": "{$CommonItemTooltip.MinorStats}", "FinWings": "{$CommonItemTooltip.FlightAndSlowfall}", "OpticStaff": "Invoca a unos gemelos para que peleen por ti", "RedHat": "Esto huele raro...", @@ -4421,13 +4452,13 @@ "HunterPotion": "Muestra la ubicación de los enemigos", "GravitationPotion": "Permite controlar la gravedad", "IllegalGunParts": "Prohibidos en casi todas partes", - "GolfClubWedge": "{$CommonItemTooltip.GolfWedge}", - "BetsyWings": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", + "GoldenKey": "Abre un cofre de oro o un cofre de mazmorra", + "ShadowKey": "Abre todos los cofres de las sombras", "Furnace": "Se usa para fundir minerales", "Loom": "Se usa para confeccionar ropa", "IronAnvil": "Se usa para fabricar objetos con lingotes de metal", "Keg": "Se usa para elaborar cerveza", - "KiteManEater": "{$CommonItemTooltip.Kite}", + "BowlofSoup": "{$CommonItemTooltip.MinorStats}", "WorkBench": "Se usa para creaciones básicas", "GoblinBattleStandard": "Invoca a un ejército de duendes", "Sawmill": "Se usa para fabricar artículos de madera avanzados", @@ -4440,7 +4471,7 @@ "MythrilHat": "Aumenta un 12% el daño de los ataques a distancia\nAumenta un 7% la probabilidad de asestar ataques críticos a distancia", "CobaltDrill": "Permite extraer mithril y oricalco", "MythrilDrill": "Permite extraer adamantita y titanio", - "WingsNebula": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", + "DaoofPow": "Puede llegar a confundir\nBusca en tu interior", "Compass": "Muestra la posición horizontal", "DivingGear": "Permite nadar\nPermite respirar bajo el agua mucho más tiempo", "GPS": "Indica la posición\nDa la hora", @@ -4454,14 +4485,14 @@ "AdamantiteBreastplate": "Aumenta un 6% el daño", "AdamantiteLeggings": "Aumenta un 4% la probabilidad de ataque crítico\nAumenta en un 5% la velocidad de movimiento", "SpectreBoots": "Permite volar\nEl portador podrá correr superrápido", - "FruitJuice": "{$CommonItemTooltip.MinorStats}", + "Toolbelt": "Aumenta la distancia de colocación de bloques", "HolyWater": "Extiende lo sagrado a algunos bloques", - "CrimsonFishingCrateHard": "{$ItemTooltip.CrimsonFishingCrate}", + "UnholyWater": "Extiende la corrupción a algunos bloques", "FairyBell": "Invoca a un hada mágica", "SuspiciousLookingEye": "Invoca al Ojo de Cthulhu", "ClockworkAssaultRifle": "Disparo de tres ráfagas\nSolo gasta munición el primer disparo", "MoonCharm": "Convierte a su portador en hombre lobo durante la noche", - "KiteCrawltipede": "{$CommonItemTooltip.Kite}", + "Ruler": "Dibuja líneas de medidas en pantalla para colocar los bloques", "SorcererEmblem": "Aumenta el daño de los ataques mágicos en un 15%", "BandofRegeneration": "Regenera la vida poco a poco", "WarriorEmblem": "Aumenta un 15% el daño cuerpo a cuerpo", @@ -4487,16 +4518,16 @@ "AdamantiteForge": "Se usa para fundir los minerales de adamantita y titanio", "MythrilAnvil": "Se usa para fabricar objetos con lingotes de mithril, oricalco, adamantita y titanio", "UnicornHorn": "¡Puntiagudo y mágico!", - "CrownosWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "DarkShard": "A veces lo llevan las criaturas de los desiertos corrompidos", "LightShard": "A veces lo llevan las criaturas de los desiertos de luz", "RedPressurePlate": "Se activa al pisarla", "CloudinaBottle": "Su portador puede realizar saltos dobles", "SpellTome": "Se puede hechizar", - "PrismaticPunch": "{$CommonItemTooltip.MediumStats}", + "StarCloak": "Hace que caigan estrellas al sufrir daños", "Megashark": "Probabilidad del 50% de no gastar munición\nEl hermano mayor del minitiburón", "Shotgun": "Dispara una ráfaga dispersa de balas", - "FrozenCrateHard": "{$CommonItemTooltip.RightClickToOpen}", - "Mango": "{$CommonItemTooltip.MinorStats}", + "PhilosophersStone": "Reduce el tiempo de espera para usar pociones curativas", + "TitanGlove": "Aumenta el retroceso en el cuerpo a cuerpo", "HermesBoots": "El portador podrá correr superrápido", "GreenPressurePlate": "Se activa al pisarla", "GrayPressurePlate": "Se activa cuando un jugador se pone encima", @@ -4510,10 +4541,10 @@ "HallowedHelmet": "Aumenta un 15% el daño de los ataques a distancia\nAumenta un 8% la probabilidad de asestar ataques críticos a distancia", "CrossNecklace": "Aumenta el tiempo de invencibilidad tras recibir daños", "ManaFlower": "Reduce el uso de maná en un 8%\nUsa de forma automática pociones de maná cuando se necesitan", - "Elderberry": "{$CommonItemTooltip.MinorStats}", + "MechanicalWorm": "Invoca al Destructor", "MechanicalSkull": "Invoca al Esqueletrón mayor", "HallowedHeadgear": "Aumenta el maná máximo en 100\nAumenta un 12% el daño mágico y la probabilidad de ataque crítico", - "KiteYellow": "{$CommonItemTooltip.Kite}", + "HallowedMask": "Aumenta un 10% el daño cuerpo a cuerpo y la probabilidad de ataque crítico\nAumenta un 10% la velocidad del cuerpo a cuerpo", "DemoniteOre": "Una energía oscura fluye en su interior", "SlimeCrown": "Invoca al rey slime", "LightDisc": "Se acumula hasta 5 veces", @@ -4535,12 +4566,12 @@ "Vilethorn": "Lanza una espina vil", "Starfury": "Hace que lluevan estrellas del cielo\nForjada por la furia del cielo", "PurificationPowder": "Limpia el mal", - "SmoothieofDarkness": "{$CommonItemTooltip.MinorStats}", + "RedsWings": "{$CommonItemTooltip.DevItem}", "RedsHelmet": "{$CommonItemTooltip.DevItem}", "RedsBreastplate": "{$CommonItemTooltip.DevItem}", "RedsLeggings": "{$CommonItemTooltip.DevItem}", "Fish": "Invoca a un bebé pingüino", - "BloodOrange": "{$CommonItemTooltip.MinorStats}", + "VilePowder": "Elimina lo sagrado", "Frostbrand": "Dispara un rayo de hielo", "RedPotion": "Solo para aquellos que sean dignos", "RottenChunk": "¡Qué delicia!", @@ -4557,7 +4588,7 @@ "IceBlade": "Dispara un rayo de hielo", "IceBow": "Lanza flechas de escarcha", "FrostStaff": "Lanza un río de escarcha", - "BlueCultistCasterBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CultistDevote}", + "Jetpack": "{$CommonItemTooltip.FlightAndSlowfall}\nMantén ARRIBA para mayor velocidad", "ButterflyWings": "{$CommonItemTooltip.FlightAndSlowfall}", "FallenStar": "Desaparece al amanecer", "Seaweed": "Invoca a una tortuga mascota", @@ -4588,14 +4619,14 @@ "GreenWrench": "Coloca un cable verde", "BluePressurePlate": "Se activa cuando un jugador se pone encima", "YellowPressurePlate": "Se activa cuando se pone encima cualquier cosa que no sea un jugador", - "FrozenCrate": "{$CommonItemTooltip.RightClickToOpen}", + "DiscountCard": "Las tiendas tienen precios más bajos", "LuckyCoin": "En ocasiones, golpear a los enemigos te dará monedas extra", "UnicornonaStick": "¡Me lo estoy pasando de miedo!", "SandstorminaBottle": "Permite al portador realizar un salto doble mejorado", - "CanOfWorms": "{$CommonItemTooltip.RightClickToOpen}", + "CharmofMyths": "Regenera la vida y reduce el tiempo de espera para usar pociones curativas", "MoonShell": "Convierte a quien lo lleve en hombre lobo por la noche y en tritón al entrar en el agua", "StarVeil": "Provoca que las estrellas caigan y aumenta la duración de la invencibilidad tras sufrir daños", - "BloodyMoscato": "{$CommonItemTooltip.MinorStats}", + "WaterWalkingBoots": "Otorga la habilidad de caminar sobre el agua", "MiningHelmet": "Da luz a su portador", "AdhesiveBandage": "Inmunidad a Hemorragia", "ArmorPolish": "Inmunidad a Armadura rota", @@ -4606,28 +4637,28 @@ "Nazar": "Inmunidad a Maldición", "Vitamins": "Inmunidad a Debilidad", "TrifoldMap": "Inmunidad a Confusión", - "Lemon": "{$CommonItemTooltip.MinorStats}", - "TropicalSmoothie": "{$CommonItemTooltip.MinorStats}", - "PinaColada": "{$CommonItemTooltip.MinorStats}", - "PeachSangria": "{$CommonItemTooltip.MinorStats}", + "PowerGlove": "Aumenta el retroceso en el cuerpo a cuerpo\nAumenta un 12% la velocidad del cuerpo a cuerpo", + "LightningBoots": "Permite volar\nEl portador podrá correr a una velocidad increíble", + "SunStone": "Aumenta todas las características y se usa durante el día", + "MoonStone": "Aumenta todas las características y se usa durante la noche", "ArmorBracing": "Inmunidad a Debilidad y Armadura rota", "MedicatedBandage": "Inmunidad a Veneno y Hemorragia", "ThePlan": "Inmunidad a Lentitud y Confusión", "CountercurseMantra": "Inmunidad a Silencio y Maldición", "CoinGun": "Usa monedas como munición\nLas monedas de mayor valor infligen más daño", "LavaCharm": "Ofrece 7 segundos de inmunidad a la lava", - "BananaDaiquiri": "{$CommonItemTooltip.MinorStats}", - "Pineapple": "{$CommonItemTooltip.MinorStats}", + "ObsidianWaterWalkingBoots": "Otorga la habilidad de caminar sobre el agua\nOfrece inmunidad ante los bloques de fuego", + "LavaWaders": "Otorga la habilidad de caminar sobre el agua y la lava\nOtorga inmunidad a los bloques de fuego y 7 segundos de inmunidad a la lava", "BoneWand": "Coloca un hueso", "LeafWand": "Coloca hojas", "FlyingCarpet": "Permite al propietario flotar durante unos segundos", "AvengerEmblem": "Aumenta un 12% el daño", - "Lemonade": "{$CommonItemTooltip.MinorStats}", + "MechanicalGlove": "Aumenta el retroceso en el cuerpo a cuerpo\nAumenta un 12% el daño y la velocidad del cuerpo a cuerpo", "LandMine": "Explota cuando se pisa", - "Starfruit": "{$CommonItemTooltip.MediumStats}", + "PaladinsShield": "Absorbe un 25% del daño infligido a jugadores de tu equipo\nSolo se activa por encima del 25% de vida", "Umbrella": "Con esto, caerás más despacio", "ChlorophyteOre": "Reacciona a la luz", - "GrapeJuice": "{$CommonItemTooltip.MajorStats}", + "SteampunkWings": "Permite volar y caer despacio", "IceSkates": "Ofrece movilidad extra sobre el hielo\nEl hielo no se romperá al caer sobre él", "SnowballLauncher": "Lanza rápidamente bolas de nieve", "ClimbingClaws": "Otorga la habilidad de deslizarse por paredes\nLa habilidad mejora si se combina con los Zapatos de púa", @@ -4644,7 +4675,7 @@ "Campfire": "La regeneración de vida es mayor junto a una hoguera", "Marshmallow": "Ponlo en un palo y ásalo en una hoguera", "MarshmallowonaStick": "¡Para asar en una hoguera!", - "Coconut": "{$CommonItemTooltip.MinorStats}", + "CookedMarshmallow": "{$CommonItemTooltip.MinorStats}", "ShoeSpikes": "Otorga la habilidad de deslizarse por paredes\nLa habilidad mejora si se combina con las Garras de escalada", "TigerClimbingGear": "Otorga la habilidad de escalar paredes", "Tabi": "Otorga la habilidad de correr\nToca dos veces en una dirección", @@ -4660,19 +4691,19 @@ "EatersBone": "Invoca a un comealmas bebé", "BlendOMatic": "Se usa para crear objetos", "MeatGrinder": "Se usa para crear objetos", - "Rambutan": "{$CommonItemTooltip.MinorStats}", + "Extractinator": "Convierte el limo, el aguanieve o los fósiles en algo más útil\nPara usarlo: Pon limo, aguanieve o fósiles en el Expriminator", "Solidifier": "Se usa para crear objetos", "ActuationAccessory": "Coloca activadores sobre objetos colocados", "ActuationRod": "Activa los activadores", "AlchemyTable": "Probabilidad del 33% de no consumir los ingredientes al crear una poción", "AncientBattleArmorHat": "Aumenta un 15% el daño mágico y el de los súbditos", - "AppleJuice": "{$CommonItemTooltip.MinorStats}", - "WoodenCrateHard": "{$ItemTooltip.WoodenCrate}", + "AncientBattleArmorPants": "Aumenta el máximo de súbditos que puedes tener", + "AncientBattleArmorShirt": "Aumenta el maná máximo en 80", "AncientHorn": "Invoca un basilisco como montura", - "BloodNautilusBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodNautilus}", - "GoblinSharkBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.GoblinShark}", + "AnglerTackleBag": "El sedal nunca se romperá, reduce la probabilidad de consumir cebo y aumenta la habilidad de pesca", + "ArchitectGizmoPack": "Aumenta la velocidad y el alcance de la colocación de paredes y casillas\nPinta automáticamente los objetos colocados", "AviatorSunglasses": "Activa a tu compañero interior\n¡Ideal para suplantar a los retransmisores!", - "KitePigron": "{$CommonItemTooltip.Kite}", + "Bacon": "{$CommonItemTooltip.MinorStats}\n¿Beicon? Beicon.", "BalloonHorseshoeFart": "Su portador puede realizar saltos dobles\nAumenta la altura de los saltos y anula el daño al caer", "BalloonHorseshoeHoney": "Libera abejas al sufrir daños\nAumenta la altura de los saltos y anula el daño al caer", "BalloonHorseshoeSharkron": "Su portador puede realizar saltos dobles\nAumenta la altura de los saltos y anula el daño al caer", @@ -4680,26 +4711,26 @@ "BeesKnees": "Las flechas de madera se convierten en una columna de abejas", "BejeweledValkyrieBody": "{$CommonItemTooltip.DevItem}\nEnjoyado y elegante para moverse bajo cielos de tormenta", "BejeweledValkyrieHead": "{$CommonItemTooltip.DevItem}\nSé el viento, cabalga el rayo.", - "BloodEelBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodEelHead}", + "BejeweledValkyrieWing": "{$CommonItemTooltip.DevItem}\nLa plataforma barrera del satélite valquiria está a salvo. Casi todo el tiempo.", "BewitchingTable": " para tener más súbditos", "Bladetongue": "Al contacto, escupe un río de icor", "BlessedApple": "Invoca un unicornio como montura", - "CorruptFishingCrateHard": "{$ItemTooltip.CorruptFishingCrate}", - "JungleFishingCrateHard": "{$ItemTooltip.JungleFishingCrate}", + "BloodWater": "Extiende el carmesí a algunos bloques", + "BombFish": "Pequeña explosión capaz de romper varios ladrillos", "BoneCampfire": "La regeneración de vida es mayor junto a una hoguera", "BoneRattle": "Invoca a un caramonstruo bebé", "BoneTorch": "Emite un brillo letal", "BoosterTrack": "Golpea para cambiar de dirección", - "GolfClubPutter": "{$CommonItemTooltip.GolfPutter}", - "HallowedFishingCrateHard": "{$ItemTooltip.HallowedFishingCrate}", - "KiteRedAndYellow": "{$CommonItemTooltip.Kite}", + "BottomlessBucket": "Contiene una cantidad ilimitada de agua", + "BouncyBomb": "Pequeña explosión capaz de romper varios ladrillos\nMuy rebotante", + "BouncyDynamite": "Esto te demostrará que es muy mala idea", "BouncyGlowstick": "Funciona si se moja", "BouncyGrenade": "Pequeña explosión que no rompe ningún ladrillo\nMuy rebotante", - "WillsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "BrainOfConfusion": "Puede confundir a los enemigos cercanos tras golpearlos", "BrainScrambler": "Invoca un scutlix como montura", "BubbleGun": "Dispara con rapidez burbujas fuertes", "ButchersChainsaw": "Se emiten chispas al golpear a los enemigos", - "BloodSquidBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodSquid}", + "CelestialShell": "Convierte a quien lo lleve en hombre lobo por la noche y en tritón al entrar en el agua\nPequeñas mejoras a todas las características", "CelestialSigil": "Invoca al Infierno inminente", "CellPhone": "Lo muestra todo\nTe permite regresar a casa cuando quieras", "ClingerStaff": "Invoca un muro de llamas malditas", @@ -4733,9 +4764,9 @@ "FloatingIslandFishingCrate": "{$CommonItemTooltip.RightClickToOpen}", "FlowerBoots": "Crecerán las flores a tu paso cuando andes sobre la hierba", "FlyingKnife": "Lanza un cuchillo volador dirigible", - "GolfBallDyedBrown": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedBlue": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedBlack": "{$CommonItemTooltip.GolfBall}", + "FossilHelm": "Aumenta un 20% la velocidad de lanzamiento", + "FossilPants": "Aumenta un 15% la probabilidad de impacto crítico al lanzar", + "FossilShirt": "Aumenta un 20% el daño de lanzamiento", "FragmentNebula": "El poder de toda una galaxia reside dentro de este fragmento", "FragmentSolar": "La furia del universo reside dentro de este fragmento", "FragmentStardust": "Partículas deslumbrantes giran dentro de este fragmento", @@ -4752,8 +4783,8 @@ "GoblinTech": "Muestra la velocidad de movimiento, el daño por segundo y los minerales valiosos", "GoldPickaxe": "Permite excavar meteoritos", "GoldRing": "Aumenta el alcance de recolección de monedas", - "Plum": "{$CommonItemTooltip.MinorStats}", - "KiteBunny": "{$CommonItemTooltip.Kite}", + "GreedyRing": "Aumenta el alcance de la recolección de monedas y las tiendas tienen precios más bajos\nEn ocasiones, golpear a los enemigos te dará monedas extra", + "GrubSoup": "{$CommonItemTooltip.MinorStats}", "HallowedFishingCrate": "{$CommonItemTooltip.RightClickToOpen}", "HardySaddle": "Invoca una tortuga como montura", "HellwingBow": "Las fechas de madera se convierten en murciélagos en llamas", @@ -4762,7 +4793,7 @@ "HoneyedGoggles": "Invoca una abeja como montura", "IceMirror": "Al mirarte en él regresarás a tu hogar", "IchorCampfire": "La regeneración de vida es mayor junto a una hoguera", - "EyeballFlyingFishBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.EyeballFlyingFish}", + "JimsWings": "{$CommonItemTooltip.DevItem}", "JungleFishingCrate": "{$CommonItemTooltip.RightClickToOpen}", "LargeAmber": "Para Capturar la Gema. Lo sueltas al morir.", "LaserRuler": "Dibuja líneas de medidas en pantalla para colocar los bloques", @@ -4790,7 +4821,7 @@ "LokisHelm": "{$CommonItemTooltip.DevItem}\nEl desorden tiene su origen en el orden, el miedo en el coraje y la debilidad en la fuerza.", "LokisPants": "{$CommonItemTooltip.DevItem}\nLa justicia va lenta, pero sobre seguro.", "LokisShirt": "{$CommonItemTooltip.DevItem}\nConócete a ti mismo, conoce al enemigo. Un millar de batallas, un millar de victorias...", - "ZombieMermanBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.ZombieMerman}", + "LokisWings": "{$CommonItemTooltip.DevItem}\nDeja que tus planes sean tan oscuros e impenetrables como la noche. Al moverte, caerás como un relámpago.", "LunarBar": "Vibra con energía celestial luminosa", "LunarCraftingStation": "Se usa para crear objetos a partir de fragmentos lunares y luminita", "LunarFlareBook": "Llueven bengalas lunares", @@ -4806,7 +4837,7 @@ "MoneyTrough": "Invoca una hucha voladora para guardar tus objetos", "MoonlordArrow": "¡Derribándolos a la velocidad del sonido!", "MoonlordBullet": "Ponlos en línea y derríbalos...", - "Apricot": "{$CommonItemTooltip.MinorStats}", + "MoonlordTurretStaff": "Invoca un portal lunar para disparar lásers a tus enemigos", "MothronWings": "{$CommonItemTooltip.FlightAndSlowfall}", "MulticolorWrench": " mientras mantienes pulsado para editar los ajustes de cableado", "NebulaArcanum": "Conjura masas de energía astral para perseguir a tus enemigos", @@ -4817,9 +4848,9 @@ "NebulaMonolith": "Obtienes una pequeña cantidad de poder de la Torre de la Nebulosa", "NightKey": "Está cargado con la esencia de muchas almas", "NightVisionHelmet": "Mejora la visión", - "GolfBallDyedLimeGreen": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedGreen": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedCyan": "{$CommonItemTooltip.GolfBall}", + "NinjaHood": "Aumenta un 15% la velocidad de lanzamiento", + "NinjaPants": "Aumenta un 10% la probabilidad de impacto crítico al lanzar", + "NinjaShirt": "Aumenta un 15% el daño de lanzamiento", "PartyBundleOfBalloonTile": "Atado para disfrute de todos", "PartyGirlGrenade": "Pequeña explosión que no rompe ningún ladrillo", "PartyMonolith": "Lloverán globos del cielo", @@ -4841,10 +4872,10 @@ "ProjectilePressurePad": "Se activa cuando lo toca un proyectil", "PsychoKnife": "Permite entrar en modo sigilo", "PutridScent": "Será menosprobable que los enemigos te ataquen\nAumenta un 5% el daño y la probabilidad de ataque crítico", - "GolfBallDyedYellow": "{$CommonItemTooltip.GolfBall}", + "QueenSpiderStaff": "Invoca una reina araña que escupe arañas a los enemigos", "Radar": "Detecta a los enemigos a tu alrededor", "RainbowCampfire": "La regeneración de vida es mayor junto a una hoguera", - "GolfBallDyedViolet": "{$CommonItemTooltip.GolfBall}", + "RainbowCrystalStaff": "Invoca un cristal radiante que elimina a tus enemigos\n¡Los colores, duque! ¡Los colores!", "RazorbladeTyphoon": "Lanza cuchillas que se mueven muy rápido", "RedsYoyo": "{$CommonItemTooltip.DevItem}", "REK": "Muestra el número de monstruos, el número de muertes y las criaturas raras", @@ -4875,30 +4906,30 @@ "SkiphsHelm": "{$CommonItemTooltip.DevItem}", "SkiphsPants": "{$CommonItemTooltip.DevItem}", "SkiphsShirt": "{$CommonItemTooltip.DevItem}", - "TheBrideBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.TheBride}", - "DTownsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "SkiphsWings": "{$CommonItemTooltip.DevItem}", + "SliceOfCake": "Rellénate la cara. Rellénale la cara a otra persona. Pues vale.", "SlimeGun": "Lanza un inofensivo chorro de slime", "SlimySaddle": "Invoca un slime como montura", - "KiteKoi": "{$CommonItemTooltip.Kite}", + "SnowCloudBlock": "Hace mucho frío ahí arriba", "SnowFallBlock": "Mola mucho más que un globo de nieve", "SnowFallWall": "Mola mucho más que un globo de nieve", "SolarEruption": "Golpea con la furia del sol", - "RedsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", - "Hoverboard": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", - "CenxsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "SolarFlareBreastplate": "Aumenta un 22% el daño cuerpo a cuerpo\nSerá más probable que los enemigos te ataquen", + "SolarFlareHelmet": "Aumenta un 17% la probabilidad de ataque crítico en el cuerpo a cuerpo\nSerá más probable que los enemigos te ataquen", + "SolarFlareLeggings": "Aumenta un 15% la velocidad de movimiento y del cuerpo a cuerpo\nSerá más probable que los enemigos te ataquen", "SolarMonolith": "Obtienes una pequeña cantidad de poder de la Torre Solar", "SolarTablet": "Invoca al Eclipse", "SoulDrain": "Absorbe vida de los enemigos", "SpelunkerGlowstick": "Expone los tesoros cercanos", "SpiderStaff": "Invoca arañas para que peleen por ti", "SporeSac": "Invoca esporas con el tiempo que dañarán a los enemigos", - "GolfClubChlorophyteDriver": "{$CommonItemTooltip.GolfDriver}", + "StardustBreastplate": "Aumenta el máximo de súbditos que puedes tener\nAumenta un 22% el daño de los súbditos", "StardustCellStaff": "Invoca a una célula de polvo estelar para que luche por ti\nCultiva la infección celular más bella", "StardustDragonStaff": "Invoca a un dragón de polvo estelar para que luche por ti\n¿Quién necesita una horda de súbditos cuando tienes un dragón gigante?", - "GolfClubDiamondWedge": "{$CommonItemTooltip.GolfWedge}", - "GolfClubShroomitePutter": "{$CommonItemTooltip.GolfPutter}", + "StardustHelmet": "Aumenta el máximo de súbditos que puedes tener\nAumenta un 22% el daño de los súbditos", + "StardustLeggings": "Aumenta el máximo de súbditos que puedes tener\nAumenta un 22% el daño de los súbditos", "StardustMonolith": "Obtienes una pequeña cantidad de poder de la Torre de Polvo estelar", - "FloatingIslandFishingCrateHard": "{$ItemTooltip.FloatingIslandFishingCrate}", + "StickyDynamite": "Puede ser difícil de lanzar", "StickyGrenade": "Pequeña explosión que no rompe ningún ladrillo\nPuede ser difícil de lanzar", "Stopwatch": "Muestra lo rápido que avanza el jugador", "StrangeBrew": "Además de su aspecto horrible, huele fatal", @@ -4921,7 +4952,7 @@ "TungstenPickaxe": "Permite excavar meteoritos", "UltraBrightCampfire": "La regeneración de vida es mayor junto a una hoguera", "ValkyrieYoyo": "{$CommonItemTooltip.DevItem}", - "BlackCurrant": "{$CommonItemTooltip.MinorStats}", + "ViciousPowder": "Elimina lo sagrado", "VineRopeCoil": "Se puede lanzar para crear una cuerda de enredadera por la que escalar", "VortexBeater": "Probabilidad del 66% de no gastar munición\nUna catastrófica mezcla de pam, pam y bum, bum.", "VortexBreastplate": "Aumenta un 12% el daño a distancia y la probabilidad de impacto crítico\nProbabilidad del 25% de no gastar munición", @@ -4935,10 +4966,10 @@ "WeightedPressurePlateOrange": "Se activa cuando un jugador se pone encima o se baja", "WeightedPressurePlatePink": "Se activa cuando un jugador se pone encima o se baja", "WeightedPressurePlatePurple": "Se activa cuando un jugador se pone encima o se baja", - "Peach": "{$CommonItemTooltip.MinorStats}", + "WingsNebula": "{$CommonItemTooltip.FlightAndSlowfall}", "WingsSolar": "{$CommonItemTooltip.FlightAndSlowfall}", "WingsStardust": "{$CommonItemTooltip.FlightAndSlowfall}", - "GolfClubTitaniumIron": "{$CommonItemTooltip.GolfIron}", + "WingsVortex": "{$CommonItemTooltip.FlightAndSlowfall}", "WireBulb": "Enciende bombillas de cada color de cable", "WireKite": "¡Otorga el control definitivo sobre los cables!\n mientras mantienes pulsado para editar los ajustes de cableado", "WirePipe": "Separa los caminos de los cables\n¡Se puede usar el martillo!", @@ -4950,7 +4981,7 @@ "Yoraiz0rHead": "{$CommonItemTooltip.DevItem}", "Yoraiz0rPants": "{$CommonItemTooltip.DevItem}", "Yoraiz0rShirt": "{$CommonItemTooltip.DevItem}", - "GolfClubPearlwoodDriver": "{$CommonItemTooltip.GolfDriver}", + "Yoraiz0rWings": "{$CommonItemTooltip.DevItem}\nSea lo que sea lo que haga este accesorio, ¡no es un error!", "YoyoBag": "Le otorga al usuario habilidades expertas con el yoyó", "YoYoGlove": "Te permite usar dos yoyós a la vez", "BloodMoonRising": "{$PaintingArtist.Garner}", @@ -5148,7 +5179,7 @@ "BlackSlimeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BlackSlime}", "BlueArmoredBonesBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BlueArmoredBones}", "BlueCultistArcherBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CultistArcherBlue}", - "SkiphsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "BlueCultistCasterBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.None}", "BlueCultistFighterBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.None}", "BoneLeeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BoneLee}", "ClingerBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.Clinger}", @@ -5402,22 +5433,22 @@ "ApprenticeScarf": "{$ItemTooltip.HuntressBuckler}", "SquireShield": "{$ItemTooltip.HuntressBuckler}", "MonkBelt": "{$ItemTooltip.HuntressBuckler}", - "GolfClubStoneIron": "{$CommonItemTooltip.GolfIron}", + "ApprenticeAltHead": "Aumenta el número máximo de centinelas\nAumenta un 10% el daño mágico y de súbditos", "ApprenticeAltPants": "Aumenta un 20% el daño de súbditos y un 25% la probabilidad de ataque mágico crítico", "ApprenticeAltShirt": "Aumenta un 30% el daño de súbditos y un 15% el daño mágico", - "GolfClubGoldWedge": "{$CommonItemTooltip.GolfWedge}", + "ApprenticeHat": "Aumenta el número máximo de centinelas y se reduce un 10% el coste de maná", "ApprenticeRobe": "Aumenta un 20% el daño de súbditos y un 10% el daño mágico", "ApprenticeStaffT3": "¡Salpica la defensa y reduce la contaminación!", - "GoldenCrateHard": "{$ItemTooltip.GoldenCrate}", + "ApprenticeTrousers": "Aumenta un 10% el daño de súbditos y un 20% la velocidad de movimiento", "BookStaff": "Me pregunto quién clavaría un libro de sabiduría infinita en un palito...\n para liberar un poderoso tornado", - "GolfBallDyedSkyBlue": "{$CommonItemTooltip.GolfBall}", + "DD2BallistraTowerT1Popper": "Una torre lenta, pero que dispara proyectiles perforantes e inflige mucho daño\n{$CommonItemTooltip.EtherianManaCost10}", "DD2BetsyBow": "Dispara flechas que se separan e infligen más daño a los enemigos aéreos", "DD2ElderCrystal": "Colócate en el stand del cristal eternia para invocar portales a Eteria", "DD2ElderCrystalStand": "Contiene el cristal eternia", "DD2EnergyCrystal": "Suele usarse para manifestar la propia voluntad como una forma física de defensa", - "GolfBallDyedRed": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedTeal": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedPurple": "{$CommonItemTooltip.GolfBall}", + "DD2ExplosiveTrapT1Popper": "Una trampa que explota cuando se aproximan enemigos\n{$CommonItemTooltip.EtherianManaCost10}", + "DD2FlameburstTowerT1Popper": "Una torre de velocidad media que dispara bolas de fuego explosivas\n{$CommonItemTooltip.EtherianManaCost10}", + "DD2LightningAuraT1Popper": "Un aura que electrocuta sin parar a los enemigos que entren en su interior\n{$CommonItemTooltip.EtherianManaCost10}", "DD2PetDragon": "Invoca a un dragón mascota", "DD2PetGato": "Invoca a un gato mascota", "DD2PetGhost": "Invoca a una espirillama mascota que te ofrece luz", @@ -5425,77 +5456,47 @@ "DD2SquireBetsySword": "Lanza hacia adelante la energía del corazón", "DD2SquireDemonSword": " para protegerte con un escudo", "DefenderMedal": "Dinero para comerciar con el tabernero", - "ShuckedOyster": "{$CommonItemTooltip.MinorStats}", + "HuntressAltHead": "Aumenta el número máximo de centinelas\nAumenta un 10% el daño de súbditos y la probabilidad de impacto crítico a distancia", "HuntressAltPants": "Aumenta un 25% el daño de súbditos y un 20% la velocidad de movimiento", "HuntressAltShirt": "Aumenta un 25% el daño de súbditos y de ataques a distancia", - "GolfClubBronzeWedge": "{$CommonItemTooltip.GolfWedge}", + "HuntressBuckler": "Aumenta el número máximo de centinelas\nAumenta un 10% el daño de súbditos", "HuntressJerkin": "Aumenta un 20% el daño de súbditos y a distancia", "HuntressPants": "Aumenta un 10% el daño de súbditos y un 20% la velocidad de movimiento", - "GolfClubWoodDriver": "{$CommonItemTooltip.GolfDriver}", - "Oyster": "{$CommonItemTooltip.RightClickToOpen}", + "HuntressWig": "Aumenta el número máximo de centinelas y aumenta un 10% la probabilidad de impacto crítico a distancia", + "MonkAltHead": "Aumenta el número máximo de centinelas y aumenta un 20% el daño de súbditos y cuerpo a cuerpo", "MonkAltPants": "Aumenta un 20% el daño de súbditos, la velocidad de movimiento y la probabilidad de impacto crítico a distancia", "MonkAltShirt": "Aumenta un 20% el daño de súbditos y la velocidad del cuerpo a cuerpo", - "GolfClubMythrilIron": "{$CommonItemTooltip.GolfIron}", + "MonkBrows": "Aumenta el número máximo de centinelas y aumenta un 20% la velocidad de los ataques cuerpo a cuerpo", "MonkPants": "Aumenta un 10% el daño de súbditos\nAumenta un 10% la probabilidad de impacto crítico y un 20% la velocidad de movimiento", "MonkShirt": "Aumenta un 20% el daño de súbditos y la velocidad del cuerpo a cuerpo", "MonkStaffT1": "Carga potencia al lanzarlo para aplastar a los enemigos", "MonkStaffT2": "Invoca a un fantasma al golpear a los enemigos", "MonkStaffT3": " mientras mantienes pulsado para un ataque alternativo.", - "GolfClubRustyPutter": "{$CommonItemTooltip.GolfPutter}", - "IronCrateHard": "{$ItemTooltip.IronCrate}", + "SquireAltHead": "Aumenta el número máximo de centinelas y otorga un 20% de daño de súbditos", + "SquireAltPants": "Aumenta un 20% el daño de súbditos y la probabilidad de impacto crítico, así como un 30% la velocidad de movimiento", "SquireAltShirt": "Aumenta un 30% el daño de súbditos y aumenta drásticamente la regeneración de vida", - "GolfClubLeadPutter": "{$CommonItemTooltip.GolfPutter}", + "SquireGreatHelm": "Aumenta el número máximo de centinelas y aumenta la regeneración de vida", "SquireGreaves": "Aumenta un 15% el daño de súbditos, un 20% la probabilidad de impacto crítico cuerpo a cuerpo y la velocidad de movimiento", "SquirePlating": "Aumenta un 15% el daño de súbditos y la velocidad del cuerpo a cuerpo", "ArkhalisShirt": "{$ItemTooltip.ArkhalisHat}", "ArkhalisPants": "{$ItemTooltip.ArkhalisHat}", - "LobsterTail": "{$CommonItemTooltip.MediumStats}", + "ArkhalisWings": "{$ItemTooltip.ArkhalisHat}", "ArkhalisHat": "{$CommonItemTooltip.DevItem}\n\"No lo he conseguido en la red\".", "LeinforsHat": "{$CommonItemTooltip.DevItem}\n\"Para mantener esos cierres tan preciosos como siempre\".", "LeinforsShirt": "{$CommonItemTooltip.DevItem}\n\"El regreso de la sexualidad\".", "LeinforsPants": "{$CommonItemTooltip.DevItem}\n\"¡Sorpresa! No esperabas algo así de unos pantalones, ¿a que no?\"", - "OceanCrateHard": "{$CommonItemTooltip.RightClickToOpen}", - "LeinforsAccessory": "{$CommonItemTooltip.DevItem}\n\"Para obtener los mejores resultados, se ha de usar con una dieta basada en pasta\".", - "KiteSpectrum": "{$CommonItemTooltip.Kite}", - "KiteWanderingEye": "{$CommonItemTooltip.Kite}", - "KiteUnicorn": "{$CommonItemTooltip.Kite}", - "FairyQueenBossBag": "{$CommonItemTooltip.RightClickToOpen}", - "LavaCrate": "{$CommonItemTooltip.RightClickToOpen}", - "LavaCrateHard": "{$CommonItemTooltip.RightClickToOpen}", - "HotlineFishingHook": "{$CommonItemTooltip.LavaFishing}", - "LavaFishingHook": "{$CommonItemTooltip.LavaFishing}", - "TeleportationPylonJungle": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonPurity": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonHallow": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonUnderground": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonOcean": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonDesert": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonSnow": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonMushroom": "{$CommonItemTooltip.TeleportationPylon}", - "RockGolemBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.RockGolem}", - "BloodMummyBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodMummy}", - "SporeSkeletonBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.SporeSkeleton}", - "SporeBatBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.SporeBat}", - "LarvaeAntlionBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.LarvaeAntlion}", - "CrimsonBunnyBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CrimsonBunny}", - "CrimsonGoldfishBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CrimsonGoldfish}", - "CrimsonPenguinBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CrimsonPenguin}", - "BigMimicCorruptionBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BigMimicCorruption}", - "BigMimicCrimsonBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BigMimicCrimson}", - "BigMimicHallowBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BigMimicHallow}", - "MossHornetBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.MossHornet}", - "WanderingEyeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.WanderingEye}", - "CreativeWings": "{$CommonItemTooltip.FlightAndSlowfall}", - "RainbowWings": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressUpToBooster}", - "LongRainbowTrailWings": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}\n{$CommonItemTooltip.PressUpToBooster}" + "LeinforsWings": "{$CommonItemTooltip.DevItem}\n\"¡A tope! ¡¿Qué significa eso?!\".", + "LeinforsAccessory": "{$CommonItemTooltip.DevItem}\n\"Para obtener los mejores resultados, se ha de usar con una dieta basada en pasta\"." }, "CommonItemTooltip": { "SpecialCrafting": "Se usa para crear cosas especiales", "DevItem": "¡Ideal para suplantar a los desarrolladores!", "FlightAndSlowfall": "Permite volar y caer lentamente", "RightClickToOpen": " para abrir", + "MinorStats": "Pequeñas mejoras a todas las características", "BannerBonus": "Los jugadores cercanos obtienen una bonificación contra: ", "Counterweight": "Lanza un contrapeso tras golpear a un enemigo con un yoyó", + "EtherianManaCost10": "Usa 10 de maná etéreo para invocar más de uno", "MinuteDuration": "{0} minuto(s) de duración", "PlaceableOnXmasTree": "Se puede poner en un árbol de Navidad", "RestoresLife": "Recupera {0} de vida", diff --git a/Localization/Content/es-ES/Legacy.json b/Localization/Content/es-ES/Legacy.json index 1c53c00..3f57203 100644 --- a/Localization/Content/es-ES/Legacy.json +++ b/Localization/Content/es-ES/Legacy.json @@ -33,6 +33,7 @@ "37": "Plantando césped", "38": "Plantando cactus", "39": "Plantando girasoles", + "3": "Amontonando tierra", "40": "Plantando árboles", "41": "Plantando hierbas", "42": "Plantando hierbajos", @@ -72,8 +73,10 @@ "73": "Validando el mundo guardado:", "74": "¡Llueven slimes!", "75": "Han dejado de llover slimes.", + "76": "Generando estructuras", "77": "Añadiendo más hierba", "78": "Desertificando", + "79": "Alegrando las paredes", "7": "Generando agujeros aleatorios", "80": "Cincelando mármol", "81": "Generando granito", @@ -159,6 +162,7 @@ "167": "¡Compra siempre más cable del que necesitas!", "168": "¿Has comprobado si tu dispositivo está enchufado?", "169": "Oh, ¿sabes lo que le vendría bien a esta casa? Más luces intermitentes.", + "17": "No pierdas de vista tus sueños. ¡Compra una lente!", "170": "Cuando el cielo se tiña de rojo, sabrás que se avecina una Luna de Sangre. Hay algo en ella que hace que los monstruos ataquen en grupo.", "171": "Eh, amigo, ¿sabes dónde hay por aquí malahierba? Oh, no es por nada. Solo preguntaba, sin más.", "172": "Si miraras hacia arriba, verías que ahora mismo la luna está roja.", @@ -177,8 +181,11 @@ "184": "Ahora que tienes minerales, tendrás que convertirlos en un lingote para fabricar objetos con ellos. Para ello, necesitas una forja.", "185": "Puedes construir una forja con antorchas, madera y piedra. Asegúrate de que estás cerca de un banco de trabajo.", "186": "Necesitarás un yunque para crear objetos con los lingotes de metal.", + "187": "Los yunques se pueden fabricar con hierro o bien comprarse a un mercader.", "188": "En el subsuelo hay corazones de cristal que puedes usar para aumentar el máximo de vida. Podrás destrozarlos con un pico.", + "189": "Si recoges 5 estrellas fugaces, podrás combinarlas para crear un objeto que aumente tu poder mágico.", "19": "¿Tu nombre era {PlayerName}? ¡Me han hablado bien de ti, amigo!", + "190": "Por la noche, caen estrellas fugaces del cielo. Se pueden utilizar para toda clase de objetos útiles. Si ves una, date prisa en cogerla ya que desaparecen al amanecer.", "191": "Hay muchas formas de hacer que los demás se muden a nuestra ciudad. Por supuesto, necesitarán una casa en la que vivir.", "192": "Para que una habitación pueda ser considerada un hogar, debe tener una puerta, una silla, una mesa y una fuente de luz. Y paredes, claro.", "193": "En la misma casa no pueden vivir dos personas. Además, si se destruye una casa, esa persona deberá buscar un nuevo lugar donde vivir.", @@ -197,6 +204,7 @@ "204": "Si juntas varias lentes en un altar demoníaco, tal vez encuentres la forma de invocar a un monstruo poderoso. Aunque te conviene esperar hasta la noche para hacerlo.", "205": "Puedes crear un cebo de gusanos usando trozos podridos y polvo vil. Asegúrate de estar en una zona corrompida antes de usarlo.", "206": "Los altares demoníacos se suelen encontrar en territorio corrompido. Tendrás que estar cerca de ellos para crear ciertos objetos.", + "207": "Puedes hacerte un gancho de escalada con un gancho y tres cadenas. Los esqueletos se encuentran en las profundidades del subsuelo y suelen llevar ganchos. En cuanto a las cadenas, se pueden fabricar con lingotes de hierro.", "208": "Si ves un jarrón, golpéalo para romperlo. Contienen toda clase de suministros de utilidad.", "209": "Hay tesoros escondidos por todo el mundo. ¡En las profundidades del subsuelo se pueden encontrar objetos maravillosos!", "21": "¿La estatua de un ángel? Lo siento pero no vendo cosas de segunda mano.", @@ -402,6 +410,7 @@ "400": "¿Suplicando tan pronto? ¡No me mires como si fuera a cambiar de idea de un día para otro! ", "401": "Asegúrate de destruir todos los altares carmesís que encuentres. ¡Algo bueno te sucederá si lo haces!", "402": "Los altares carmesís se suelen encontrar en Carmesí. Tendrás que estar cerca de ellos para crear ciertos objetos.", + "403": "Puedes crear una espina dorsal sangrienta con vértebras. Asegúrate de estar en una zona carmesí antes de usarlo.", "41": "¡Deja de comportarte como un bebé! He visto cosas peores.", "42": "¡Voy a tener que darte puntos!", "43": "¿Ya te has vuelto a meter en líos?", @@ -435,6 +444,7 @@ "69": "¿Has probado a usar polvos de purificación sobre la piedra de ébano corrupta?", "7": "La noche caerá pronto, amigo. Haz tus compras mientras puedas.", "70": "Ojalá {ArmsDealer} dejara de flirtear conmigo. ¿No se da cuenta de que tengo 500 años?", + "71": "¿Por qué se empeña {Merchant} en intentar venderme una estatua de ángel? Todo el mundo sabe que no sirven para nada.", "72": "¿Has visto a ese anciano que deambula por la mazmorra? No tiene muy buen aspecto...", "73": "¡Yo vendo lo que quiero! Si no te gusta, mala suerte.", "74": "¿Por qué tienes que ser tan beligerante en estos tiempos que corren?", @@ -595,6 +605,7 @@ "213": "Prioridad de cursor inteligente: Pico -> hacha", "214": "Prioridad de cursor inteligente: Hacha -> pico", "215": "Colocación inteligente de bloques: Al cursor", + "216": "Colocación inteligente de bloques: Rellenando", "217": "Color de bordes", "218": "Cursor", "219": "Controles", @@ -639,7 +650,10 @@ "26": "Núcleo suave", "27": "Aleatorio", "28": "Crear", + "29": "Los personajes extremos mueren para siempre", "2": "Desconectar", + "30": "Los personajes de núcleo medio sueltan objetos al morir", + "31": "Los personajes de núcleo suave sueltan dinero al morir", "32": "Seleccionar dificultad", "33": "Camisa", "34": "Camiseta", @@ -790,6 +804,7 @@ "17": "{0} se ha unido al bando amarillo.", "18": "Te damos la bienvenida a", "19": "{0} se ha unido.", + "1": "Contraseña errónea.", "20": "{0} se ha ido.", "21": "/players", "22": "{0} se ha unido al bando rosa.", @@ -888,6 +903,7 @@ "82": "Atrás", "83": "Favorito", "84": "¡No puedes cambiar de equipo dentro de los bloques de tu equipo!", + "85": "Insecto", "86": "Pato", "87": "Mariposa", "88": "Luciérnaga", @@ -1035,6 +1051,7 @@ "LegacyChestType": { "0": "Cofre", "10": "Cofre de hiedra", + "11": "Cofre de hielo", "12": "Cofre de madera viviente", "13": "Cofre celestial", "14": "Cofre de madera sombría", @@ -1046,10 +1063,12 @@ "1": "Cofre de oro", "20": "Cofre carmesí", "21": "Cofre sagrado", + "22": "Cofre congelado", "23": "Cofre cerrado de la selva", "24": "Cofre cerrado corrompido", "25": "Cofre cerrado carmesí", "26": "Cofre cerrado sagrado", + "27": "Cofre cerrado gélido", "28": "Cofre dinástico", "29": "Cofre de miel", "2": "Cofre dorado cerrado", @@ -1115,29 +1134,10 @@ "28": "{$ItemName.CrystalDresser}", "29": "{$ItemName.DynastyDresser}", "30": "{$ItemName.FrozenDresser}", - "31": "{$ItemName.LivingWoodDresser}", - "32": "{$ItemName.SpiderDresser}", - "33": "{$ItemName.LesionDresser}", - "34": "{$ItemName.SolarDresser}", - "35": "{$ItemName.VortexDresser}", - "36": "{$ItemName.NebulaDresser}", - "37": "{$ItemName.StardustDresser}", - "38": "{$ItemName.SandstoneDresser}", - "39": "{$ItemName.BambooDresser}" + "31": "{$ItemName.LivingWoodDresser}" }, "LegacyChestType2": { - "1": "{$ItemName.GoldenChest}", - "0": "{$ItemName.CrystalChest}", - "2": "{$ItemName.SpiderChest}", - "3": "{$ItemName.LesionChest}", - "4": "{$ItemName.GoldChest}", - "5": "{$ItemName.SolarChest}", - "6": "{$ItemName.VortexChest}", - "7": "{$ItemName.NebulaChest}", - "8": "{$ItemName.StardustChest}", - "9": "{$ItemName.GolfChest}", - "10": "{$ItemName.DesertChest}", - "11": "{$ItemName.BambooChest}", - "12": "{$ItemName.DungeonDesertChest}" + "0": "Cofre de cristal", + "1": "Cofre de oro" } } \ No newline at end of file diff --git a/Localization/Content/es-ES/NPCs.json b/Localization/Content/es-ES/NPCs.json index 2da72df..9812ecb 100644 --- a/Localization/Content/es-ES/NPCs.json +++ b/Localization/Content/es-ES/NPCs.json @@ -68,6 +68,7 @@ "Vampire": "Vampiro", "MotherSlime": "Mamá slime", "Truffle": "Trufa", + "ZombieEskimo": "Zombi esquimal", "Frankenstein": "Frankenstein", "BlackRecluse": "Ermitaño negro", "WallCreeper": "Criatura de pared", @@ -308,7 +309,9 @@ "SleepingAngler": "Rape dormido", "Grasshopper": "Saltamontes", "ChatteringTeethBomb": "Bomba castañeante", + "CultistArcherBlue": "Arquero sectario azul", "Demolitionist": "Demoledor", + "CultistArcherWhite": "Arquero sectario blanco", "BrainScrambler": "Destrozacerebros", "RayGunner": "Artillero de rayos", "MartianOfficer": "Oficial marciano", @@ -335,6 +338,7 @@ "Hornet": "Avispón", "ManEater": "Devorahombres", "ArmedZombie": "Zombi", + "ArmedZombieEskimo": "Zombi esquimal", "ArmedZombiePincussion": "Zombi", "ArmedZombieSlimed": "Zombi", "ArmedZombieSwamp": "Zombi", @@ -424,9 +428,12 @@ "Crawdad": "Padre cangrejo", "Crawdad2": "Papá cangrejo", "CreatureFromTheDeep": "Criatura de las Profundidades", + "CrimsonBunny": "Conejito carmesí", + "CrimsonGoldfish": "Pececillo carmesí", "CrimsonPenguin": "Pingüino violento", "CultistBoss": "Sectario lunático", "CultistBossClone": "Sectario lunático", + "CultistDevote": "Devoto lunático", "CultistDragonBody1": "Dragón fantasma", "CultistDragonBody2": "Dragón fantasma", "CultistDragonBody3": "Dragón fantasma", @@ -459,7 +466,7 @@ "DuneSplicerHead": "Atraviesadunas", "DuneSplicerTail": "Atraviesadunas", "EnchantedNightcrawler": "Rondador encantado", - "GiantFlyingAntlion": "Enjambre de hormigas león", + "FlyingAntlion": "Enjambre de hormigas león", "Fritz": "Fritz", "GiantShelly": "Conchito gigante", "GiantShelly2": "Conchito gigante", @@ -507,6 +514,7 @@ "SandsharkCrimson": "Segador de carne", "SandsharkHallow": "Trilladora de cristal", "SandSlime": "Slime de arena", + "ShadowFlameApparition": "Aparición de Llamas oscuras", "SlimeSpiked": "Slime puntiagudo", "Sluggy": "Baboso", "SolarFlare": "Bengala solar", @@ -534,7 +542,7 @@ "VortexLarva": "Larva alienígena", "VortexRifleman": "Navegatormentas", "VortexSoldier": "Vorticiano", - "GiantWalkingAntlion": "Cargador de hormigas león", + "WalkingAntlion": "Cargador de hormigas león", "DD2GoblinBomberT2": "{$NPCName.DD2GoblinBomberT1}", "DD2WyvernT3": "{$NPCName.DD2WyvernT1}", "DD2WyvernT2": "{$NPCName.DD2WyvernT1}", diff --git a/Localization/Content/es-ES/Projectiles.json b/Localization/Content/es-ES/Projectiles.json index 38a16a1..4d57b46 100644 --- a/Localization/Content/es-ES/Projectiles.json +++ b/Localization/Content/es-ES/Projectiles.json @@ -713,10 +713,6 @@ "MonkStaffT3": "Furia del dragón celestial", "MonkStaffT3_Alt": "Furia del dragón celestial", "MonkStaffT3_AltShot": "Furia del dragón celestial", - "DD2JavelinHostileT3": "{$ProjectileName.DD2JavelinHostile}", - "Celeb2Rocket": "{$ProjectileName.Celeb2Weapon}", - "Celeb2RocketExplosive": "{$ProjectileName.Celeb2Weapon}", - "Celeb2RocketLarge": "{$ProjectileName.Celeb2Weapon}", - "Celeb2RocketLargeExplosive": "{$ProjectileName.Celeb2Weapon}" + "DD2JavelinHostileT3": "{$ProjectileName.DD2JavelinHostile}" } } \ No newline at end of file diff --git a/Localization/Content/es-ES/Town.json b/Localization/Content/es-ES/Town.json index dfe36d6..591e7b5 100644 --- a/Localization/Content/es-ES/Town.json +++ b/Localization/Content/es-ES/Town.json @@ -49,6 +49,7 @@ "Party": "¿Crees que a alguien le importaría que pusiese bombillas en la tarta en lugar de velas?" }, "BartenderSpecialText": { + "Party": "¡Necesito algún mensaje de cumpleaños, Yorai!", "AfterDD2Tier1": "¡Has hecho un gran trabajo deshaciéndote del ejército del Antiguo! Pero seguro que los volveremos a ver. Esta vez no se han defendido demasiado.", "AfterDD2Tier2": "El ejército del Antiguo es cada vez más fuerte... ¡pero tú sigues deshaciéndote de ellos! Pero algo me dice que todavía nos volverán a incordiar.", "AfterDD2Tier3": "¿En serio has conseguido mantener a raya al ejército del Antiguo? Tal vez deberías visitar Eteria alguna vez.", @@ -74,9 +75,15 @@ "Party": "Está claro que celebré la fiesta más mágica de todas.", "AfterDD2Tier1": "Jo, creía haber visto un portal como ese en el pasado... pero era oro." }, + "SteampunkerSpecialText": { + "Party": "Todos decían que les gustaban las tartas apiladas, así que metí chimeneas en la mía." + }, "CyborgSpecialText": { "Party": "¡Esta fiesta será un desmadre! ¡Y hasta un despadre!" }, + "SantaClausSpecialText": { + "Party": "Venga, no creerías que solo celebraba las Navidades, ¿no?" + }, "DemolitionistSpecialText": { "Party": "Puede que hoy quieras andar con cuidado. Los enanos solemos celebrar unas fiestas bastante explosivas.", "AfterDD2Start": "No entiendo por qué no podemos cargarnos esos portales." @@ -109,6 +116,7 @@ "Quest_Catfish": "¡Por fin he encontrado un gato de la jungla al que le gusta el agua! Creo que también es medio pez. No sé por qué ha pasado esto, pero no quiero saberlo. Lo quiero en mi poder. ¡Y que sea rapidito!\n\n(Se encuentra en la superficie de la selva)", "Quest_Cloudfish": "Se rumorea que hay islas que flotan en el cielo y que esconden tesoros increíbles. ¿A quién le importa eso? Lo que mola es que a veces se forman lagos en las nubes… ¡que están repletos de peces hechos de nube! ¡Quiero saber cómo saben! ¡Ve a pescar uno!\n\n(Se encuentra en Lagos Celestiales)", "Quest_Cursedfish": "Hay un pez maldito que nada por las aguas de la corrupción. Está compuesto por las llamas infernales que se expanden a partir de los horrores caídos que acechan aquí abajo. Dicen que ni siquiera el agua puede apagar su fuego, el cual puede arder eternamente. ¡Se me ocurren un par de usos para un pez así! ¿Vas a ir a conseguirme uno o eres un gallina?\n\n(Se encuentra en la Corrupción)", + "Quest_Dirtfish": "Había pescado a uno muy gordo, pero un zombi parlanchín salió del bosque y empezó a divagar sobre una \"feroz\" especie de pescado hecho de basura. Dice que podría ahogar a diez tipos de su tamaño o algo así… ¡Lo quiero! ¡Ya!\n\n(Se encuentra en la superficie, el subterráneo y las cavernas)", "Quest_DynamiteFish": "El demoledor se estaba quejando de que había perdido una barra de dinamita en el lago del bosque. Tiene un montón, ¿por qué le da tanta importancia a una? Por lo visto, le salieron aletas y empezó a nadar. No sé de dónde saca sus materiales para que hagan algo así, ¡pero ese está obviamente poseído! Péscalo y tráemelo. Siempre quise un pez bomba suicida. No me preguntes por qué…\n\n(Se encuentra en la superficie)", "Quest_EaterofPlankton": "Seguro que no serás tan valiente como para encontrar al comedor de plancton. ¡Un pez corrupto se ha transformado en una especie de Comedor de Mundos! ¡Atrápalo, tráemelo y demuéstrame tu valía!\n\n(Se encuentra en la Corrupción)", "Quest_FallenStarfish": "Me encanta coleccionar esas estrellas brillantes y amarillas que caen del cielo. Me encanta todavía más que caigan sobre la cabeza de alguien. Pero… pero… ¡no hay nada mejor que una estrella que cae del cielo en un lago de un bosque y se convierte en pez! Es una locura, ¡pero tú estás lo bastante loco para conseguírmelo!\n\n(Se encuentra en Lagos Celestiales)", @@ -127,7 +135,7 @@ "Quest_GuideVoodooFish": "Esos demonios del inframundo adoran los muñecos de vudú, ¡pero creo que hay un muñeco que ha recibido demasiada magia! Se convirtió en un pez con vida propia. ¡Te desafío a que me consigas uno! Yo de ti tendría cuidado con la lava ardiente, ¡ya que te puede matar y me quedaría sin mi pez!\n\n(Se encuentra en las cavernas)", "Quest_Wyverntail": "¡Sé algo que tú no! Vale, te lo diré: ¡hay una criatura terrible que vuela entre las estrellas! ¡No es mentira! ¡Se llama guiverno! Pero eso ya lo sabías, ¿verdad? ¡Pero lo que no sabes es que nacen y crecen como renacuajos! Así que en realidad son como… ¡como una rana! ¡Ponte a ello y consígueme uno!\n\n(Se encuentra en Lagos Celestiales)", "Quest_ZombieFish": "¡No te lo vas a creer! ¡He pescado un pez ya muerto en el bosque, durante la noche! ¡Intentó comerme! Lo tiré y salí corriendo de allí. Ahora quiero meterlo en el vestidor de alguien para ver qué pasa. ¿Podrías volver a pescarlo para mí?\n\n(Se encuentra en la superficie)", - "Quest_AmanitaFungifin": "Encontré un lugar espectacular que estaba rodeado por setas gigantes y brillantes. ¡Todo era azul! Estaba cogiendo algunas de las setas que encontré junto a un lago azul brillante cuando una de las setas… ¡me atacó y se fue nadando! Quiero darle a probar su propia medicina ¡y darle un buen mordisco! Es decir, ¡tienes que conseguírmela!\n\n(Se encuentra en los campos de champiñones brillantes)", + "Quest_AmanitiaFungifin": "Encontré un lugar espectacular que estaba rodeado por setas gigantes y brillantes. ¡Todo era azul! Estaba cogiendo algunas de las setas que encontré junto a un lago azul brillante cuando una de las setas… ¡me atacó y se fue nadando! Quiero darle a probar su propia medicina ¡y darle un buen mordisco! Es decir, ¡tienes que conseguírmela!\n\n(Se encuentra en los campos de champiñones brillantes)", "Quest_Angelfish": "¿Sabías que hay islas mágicas flotando en lo alto del cielo? ¡Seguro que no! Dicen que en el cielo viven los ángeles. ¡Yo creo que esos ángeles tienen aletas y agallas y se pasan todo el día nadando por ahí! ¡Tendrías que atraparme uno!\n\n(Se encuentra en Lagos Celestiales)", "Quest_BloodyManowar": "¡Ay! ¡No te me acerques! ¡Me ha picado una manowar sangrienta! Por si no sabes lo que es, ¡es la medusa más amenazadora de todo {WorldName}! ¡Ve a atraparme una si te atreves! \n\n(Se encuentra en Carmesí)", "Quest_Bonefish": "Por lo general, me da igual ver espinas en el agua… ¡pero esta estaba nadando! ¿Acaso creías que solo los esqueletos humanos cobraban vida en {WorldName}? ¡Atrápamela para que se la pueda meter en la cama a alguien!\n\n(Se encuentra en el subterráneo y cavernas)", @@ -139,6 +147,7 @@ "Quest_Fishron": "Existe la leyenda de un ser poderoso conocido como pezgrón, ¡mitad cerdo, mitad dragón y mitad pez! Dicen que se encuentra en los lagos subterráneos de la zona más fría del mundo. Yo no pienso ir hasta allí, ¡así que péscamelo y asegúrate de que cae en mis manos! ¡Ay, qué ilusión!\n\n(Se encuentra en el subterráneo de la tundra)", "Quest_InfectedScabbardfish": "Un pez muy largo, que parece una espada, nada por las aguas turbias de la corrupción. Se parece mucho a una piedra de ébano, ¡no dejes que te engañe! Eso es, tú. ¡Lo vas a pescar tú, no yo!\n\n(Se encuentra en la Corrupción)", "Quest_Mudfish": "¡Ten cuidado al adentrarte en las aguas de la jungla! ¿Por qué? No, no es porque me preocupe que te coman las pirañas. Me preocupa que pises sin querer uno de mis tipos de pez favoritos: ¡el pez barro! También me preocupa mucho que me consigas uno como mascota.\n\n(Se encuentra en la selva)", + "Quest_Slimefish": "En el bosque, los slimes dan mucho asco. ¡Y los pez slime, dan más asco todavía! No quiero nadar con slimes, ¡así que sácame uno fuera del agua!\n\n(Se encuentra en cualquier parte)", "Quest_TropicalBarracuda": "¡Las pirañas y los tiburones son horribles! ¡Muy, muy feos! ¿Sabías que hay un pez que parece muy bonito y que podría comerte la cara? Pagaría 2 platinos por verlo, la verdad… Bueno, vayamos al grano: quiero que me lo consigas. ¡Tráemelo antes de que te coma la cara!\n\n(Se encuentra en la superficie de la selva)", "Quest_TundraTrout": "¿Alguna vez te has preguntado por qué en {WorldName} nunca se congelan los lagos de las zonas nevadas? Yo no. ¡Pero los peces sí se congelan! ¡Un pez hecho de hielo sería una gran ofenda al gran y poderoso {Angler}! ¡Ve, mi fiel súbdito! ¡Tráeme esa trucha de la tundra cuanto antes!\n\n(Se encuentra en la superficie de la tundra)" }, diff --git a/Localization/Content/fr-FR.json b/Localization/Content/fr-FR.json index 47ab505..451340e 100644 --- a/Localization/Content/fr-FR.json +++ b/Localization/Content/fr-FR.json @@ -46,6 +46,7 @@ "48": "Terraria 2 : Boogaloo électrique", "49": "Terraria : Essayez aussi Minecraft !", "5": "Terraria : Un conte de lapins", + "50": "Terraria : Essayez aussi Edge of Space !", "51": "Terraria : Je veux juste savoir où est l'or", "52": "Terraria : Maintenant avec plus de canards !", "53": "Terraria : 9+1=11", @@ -231,6 +232,7 @@ "TIMBER_Name": "Du bois !!", "TIN_FOIL_HATTER_Description": "Triomphez contre une invasion martienne, lorsque des êtres d'un autre monde viennent vous brouiller le cerveau et vous sonder à des endroits gênants.", "TIN_FOIL_HATTER_Name": "Soucoupe en alu", + "TOPPED_OFF_Description": "Atteignez la santé et le mana max sans accessoires ni bonus.", "TOPPED_OFF_Name": "À fond", "TROUT_MONKEY_Description": "Terminez votre 25e quête pour le pêcheur.", "TROUT_MONKEY_Name": "Serviable", @@ -244,6 +246,7 @@ "WHERES_MY_HONEY_Name": "Où est mon miel ?", "WINTERHEARTED_Description": "Éliminez la Reinde des glaces, la méchante sorcière des nuits glaciales.", "WINTERHEARTED_Name": "Cœur d'hiver", + "WORM_FODDER_Description": "Éliminez le Dévoreur des mondes, un ver gigantesque qui vit dans la Corruption.", "WORM_FODDER_Name": "Nourriture pour ver", "YOU_AND_WHAT_ARMY_Description": "Commandez neuf sbires invoqués en même temps.", "YOU_AND_WHAT_ARMY_Name": "Vous et une armée de quoi ?", @@ -330,6 +333,7 @@ "Server": "Serveur de Terraria {0}", "ServerMessage": " {0}", "ServerStarted": "Serveur démarré", + "SetInitialMaxPlayers": "Max de joueurs (appuyez sur Entrée pour 8) :", "SetInitialPort": "Port du serveur (appuyez sur Entrée pour 7777) :", "SetMOTD_Command": "motd", "SetMOTD_Description": "Changez les MOTD.", @@ -370,6 +374,7 @@ }, "Error": { "BadHeaderBufferOverflow": "Un mauvais titre cause un excès de lecture de buffer.", + "CaptureError": "Une erreur s'est produite lors de l'enregistrement de la capture. Nouvel essai en cours…", "DataSentAfterConnectionLost": "A essayé d'envoyer des données à un client après avoir perdu la connexion", "Error": "Erreur", "ExceptionNormal": " Exception normale : {0}", @@ -428,9 +433,7 @@ "YellowWires": "Câbles jaunes", "BirthdayParty_1": "On dirait que {0} organise une fête", "BirthdayParty_2": "On dirait que {0} et {1} organisent une fête", - "BirthdayParty_3": "On dirait que {0}, {1} et {2} organisent une fête", - "RespawnInPrefix": "", - "RespawnInSuffix": "{0}" + "BirthdayParty_3": "On dirait que {0}, {1} et {2} organisent une fête" }, "GameUI": { "ActuationDeviceOff": "Actionneur activé", @@ -447,6 +450,7 @@ "CompassCenter": "Centre", "CompassEast": "Est de {0}", "CompassWest": "Ouest de {0}", + "CraftingWindow": "Fenêtre d'artisanat", "Depth": "{0}", "DepthLevel": "Niveau", "Disabled": "Désactivé", @@ -490,11 +494,12 @@ "PartlyCloudy": "Très couvert", "PlayerDistance": "({0} m)", "PrecentFishingPower": "{0} % de puissance de pêche", + "QuickStackToNearby": "Pile rapide vers les coffres à proximité", "Rain": "Pluie", "RulerOff": "Règle désactivée", "RulerOn": "Règle activée", "SettingsMenu": "Menu de paramètres", - "OpenFileFolder": "{$LegacyInterface.110}", + "SortInventory": "Trier l'inventaire", "Speed": "{0} mph", "StormEffects": "Effets de tempête : {0}", "ThirdQuarter": "Troisième quartier", @@ -579,8 +584,8 @@ "MoveToCloud": "Déplacer vers le nuage", "New": "Nouveau", "Normal": "Normal", - "LightMode_White": "{$LegacyMenu.56}", - "LightMode_Color": "{$LegacyMenu.55}", + "NormalDescription": "(L'expérience normale de Terraria)", + "NormalDescriptionFlavor": "Votre aventure commence…", "Play": "Jouer", "RestoreButton": "Restaurer", "Save": "Sauvegarder", @@ -603,10 +608,7 @@ "SeedCopied": "Graine copiée", "ZoomIn": "{$LegacyMenu.168}", "ZoomOut": "{$LegacyMenu.169}", - "Ellipsis": "...", - "LightMode_Retro": "{$LegacyMenu.57}", - "LightMode_Trippy": "{$LegacyMenu.58}", - "PlayerEmptyName": "{$Net.EmptyName}" + "Ellipsis": "..." }, "DeathSource": { "NPC": "{0} par {1}.", @@ -628,6 +630,7 @@ "Lava_3": "{0} a tenté de nager dans la lave.", "Lava_4": "{0} aime jouer dans le magma.", "Petrified_1": "{0} a éclaté en mille morceaux.", + "Petrified_2": "{0} ne peut pas guérir.", "Petrified_3": "{0} n'est plus que poussière à balayer.", "Petrified_4": "{0} est un nouveau tas de poussière.", "Poisoned": "{0} n'a pas trouvé l'antidote.", @@ -690,8 +693,5 @@ "Chinese": "简体中文 (Chinois simplifié)", "Portuguese": "Português brasileiro (Portugais (Brésil))", "Polish": "Polski (Polonais)" - }, - "RandomWorldName_Composition": { - "6": "{Adjective} {Location}" } } \ No newline at end of file diff --git a/Localization/Content/fr-FR/Game.json b/Localization/Content/fr-FR/Game.json index f16b566..5f77a77 100644 --- a/Localization/Content/fr-FR/Game.json +++ b/Localization/Content/fr-FR/Game.json @@ -15,6 +15,9 @@ "AdamantiteCaster": "-19 % d'usage de mana", "AdamantiteMelee": "+18 % de vitesse de déplacement et au corps à corps", "AdamantiteRanged": "25 % de chances de ne pas utiliser de munitions", + "HallowCaster": "-20 % d'usage de mana", + "HallowMelee": "+18 % de vitesse de déplacement et au corps à corps", + "HallowRanged": "25 % de chances de ne pas utiliser de munitions", "ShadowScale": "+15 % de vitesse de déplacement", "Wood": "1 point de défense", "Crimson": "Augmente considérablement la régénération de santé", @@ -25,6 +28,7 @@ "Titanium": "Immunise après avoir touché un ennemi", "Chlorophyte": "Invoque une feuille de cristal puissante pour tirer sur les ennemis à proximité", "Wizard": "+10 % de chances de coup critique magique", + "Turtle": "Les agresseurs subissent aussi tous les dégâts", "Meteor": "Le pistolet spatial consomme 0 point de mana", "SpectreHealing": "Les dégâts magiques infligés aux ennemis soignent le joueur à la santé la plus faible", "Shroomite": "L'immobilité vous met en mode furtif,\naugmentant les capacités à distance et réduisant les chances que les ennemis vous visent", @@ -36,8 +40,13 @@ "BeetleDefense": "Les scarabées vous protègent des dégâts", "BeetleDamage": "Les scarabées augmentent vos dégâts et votre vitesse au corps à corps", "Bee": "+10 % de dégâts des sbires", + "Bone": "20 % de chances de ne pas utiliser de munitions", "Spider": "+12 % de dégâts des sbires", + "Ninja": "33 % de chances de ne pas utiliser d'objets de lancer", + "Fossil": "50 % de chances de ne pas utiliser d'objets de lancer", + "Solar": "Les boucliers solaires génèrent du temps qui vous protège,\nconsomment le pouvoir du bouclier pour foncer, infligeant des dégâts aux ennemis", "Vortex": "Effectuez un double clic sur {0} pour passer en mode furtif :\naugmente les capacités à distance et réduit les chances que les ennemis vous visent, mais ralentit la vitesse de déplacement", + "Nebula": "Blesser des ennemis a une chance de faire apparaître des bonus :\nramassez-les pour cumuler les effets positifs", "Stardust": "Effectuez un double clic sur {0} pour diriger votre gardien vers un lieu", "Forbidden": "Effectuez un double clic sur {0} pour appeler une tempête ancienne à l'emplacement du curseur", "Jungle": "-16 % d'usage de mana", @@ -88,7 +97,7 @@ "Builder": "Vitesse et portée du placement augmentées", "BunnyMount": "Vous avez envie de carottes", "Burning": "Perte de santé et déplacements ralentis", - "DesertMinecartRight": "{$BuffDescription.MinecartRight}", + "Calm": "Agression des ennemis réduite", "Campfire": "Régénération de santé légèrement augmentée", "ChaosState": "Utiliser le bâton de discorde prendra la vie", "Chilled": "Votre vitesse de déplacement a été réduite", @@ -116,7 +125,7 @@ "FairyGreen": "Une fée vous suit", "FairyRed": "Une fée vous suit", "Featherfall": "Appuyez sur HAUT ou BAS pour contrôler la vitesse de descente", - "DesertMinecartLeft": "{$BuffDescription.MinecartLeft}", + "Fishing": "Niveau de pêche augmenté", "Flipper": "Déplacez-vous normalement dans l'eau", "Frostburn": "C'est soit très chaud, soit très froid. Dans les deux cas, ça fait VRAIMENT mal", "Frozen": "Vous ne pouvez pas bouger !", @@ -178,7 +187,7 @@ "PetDD2Gato": "Un gato à hélice vous suit", "PetDD2Ghost": "Un allumèche vous suit", "PetLizard": "Tranquille comme un reptile", - "FishMinecartRight": "{$BuffDescription.MinecartRight}", + "PetParrot": "Coco veut le biscuit", "PetSapling": "Un petit arbuste vous suit", "PetSpider": "Une araignée vous suit", "PetTurtle": "Amusez-vous bien avec votre tortue !", @@ -250,7 +259,7 @@ "WeaponImbuePoison": "Les attaques au corps à corps empoisonnent les ennemis", "WeaponImbueVenom": "Les attaques au corps à corps infligent des dégâts de venin à vos cibles", "Webbed": "Vous ne pouvez pas bouger", - "FishMinecartLeft": "{$BuffDescription.MinecartLeft}", + "WellFed": "Améliorations mineures de toutes les stats", "Werewolf": "Capacités physiques augmentées", "Wet": "Vous dégoulinez d'eau", "WindPushed": "Le vent vous fait bouger !", @@ -258,45 +267,7 @@ "WitheredArmor": "Votre armure est affaiblie !", "WitheredWeapon": "Vos attaques sont plus faibles !", "Wrath": "+10 % de dégâts", - "ZephyrFish": "Il aime nager autour de vous", - "BeeMinecartRight": "{$BuffDescription.MinecartRight}", - "BeeMinecartLeft": "{$BuffDescription.MinecartLeft}", - "LadybugMinecartRight": "{$BuffDescription.MinecartRight}", - "LadybugMinecartLeft": "{$BuffDescription.MinecartLeft}", - "PigronMinecartRight": "{$BuffDescription.MinecartRight}", - "PigronMinecartLeft": "{$BuffDescription.MinecartLeft}", - "SunflowerMinecartRight": "{$BuffDescription.MinecartRight}", - "SunflowerMinecartLeft": "{$BuffDescription.MinecartLeft}", - "HellMinecartRight": "{$BuffDescription.MinecartRight}", - "HellMinecartLeft": "{$BuffDescription.MinecartLeft}", - "ShroomMinecartRight": "{$BuffDescription.MinecartRight}", - "ShroomMinecartLeft": "{$BuffDescription.MinecartLeft}", - "AmethystMinecartRight": "{$BuffDescription.MinecartRight}", - "AmethystMinecartLeft": "{$BuffDescription.MinecartLeft}", - "TopazMinecartRight": "{$BuffDescription.MinecartRight}", - "TopazMinecartLeft": "{$BuffDescription.MinecartLeft}", - "SapphireMinecartRight": "{$BuffDescription.MinecartRight}", - "SapphireMinecartLeft": "{$BuffDescription.MinecartLeft}", - "EmeraldMinecartRight": "{$BuffDescription.MinecartRight}", - "EmeraldMinecartLeft": "{$BuffDescription.MinecartLeft}", - "RubyMinecartRight": "{$BuffDescription.MinecartRight}", - "RubyMinecartLeft": "{$BuffDescription.MinecartLeft}", - "DiamondMinecartRight": "{$BuffDescription.MinecartRight}", - "DiamondMinecartLeft": "{$BuffDescription.MinecartLeft}", - "AmberMinecartRight": "{$BuffDescription.MinecartRight}", - "AmberMinecartLeft": "{$BuffDescription.MinecartLeft}", - "BeetleMinecartRight": "{$BuffDescription.MinecartRight}", - "BeetleMinecartLeft": "{$BuffDescription.MinecartLeft}", - "MeowmereMinecartRight": "{$BuffDescription.MinecartRight}", - "MeowmereMinecartLeft": "{$BuffDescription.MinecartLeft}", - "PartyMinecartRight": "{$BuffDescription.MinecartRight}", - "PartyMinecartLeft": "{$BuffDescription.MinecartLeft}", - "PirateMinecartRight": "{$BuffDescription.MinecartRight}", - "PirateMinecartLeft": "{$BuffDescription.MinecartLeft}", - "SteampunkMinecartRight": "{$BuffDescription.MinecartRight}", - "SteampunkMinecartLeft": "{$BuffDescription.MinecartLeft}", - "CoffinMinecartRight": "{$BuffDescription.MinecartRight}", - "CoffinMinecartLeft": "{$BuffDescription.MinecartLeft}" + "ZephyrFish": "Il aime nager autour de vous" }, "BuffName": { "AmmoBox": "Boîte de munitions", @@ -439,7 +410,7 @@ "Regeneration": "Régénération", "Rudolph": "Rudolphe", "ScutlixMount": "Monture Scutlix", - "DesertMinecartRight": "{$BuffName.MinecartRight}", + "ShadowDodge": "Esquive d'ombre", "ShadowFlame": "Flamme d'ombre", "ShadowOrb": "Orbe de l'ombre", "SharknadoMinion": "Requinade", @@ -502,48 +473,7 @@ "WitheredArmor": "Armure abimée", "WitheredWeapon": "Arme abimée", "Wrath": "Colère", - "ZephyrFish": "Poisson-zéphyr", - "DesertMinecartLeft": "{$BuffName.MinecartLeft}", - "FishMinecartRight": "{$BuffName.MinecartRight}", - "FishMinecartLeft": "{$BuffName.MinecartLeft}", - "BeeMinecartRight": "{$BuffName.MinecartRight}", - "BeeMinecartLeft": "{$BuffName.MinecartLeft}", - "LadybugMinecartRight": "{$BuffName.MinecartRight}", - "LadybugMinecartLeft": "{$BuffName.MinecartLeft}", - "PigronMinecartRight": "{$BuffName.MinecartRight}", - "PigronMinecartLeft": "{$BuffName.MinecartLeft}", - "SunflowerMinecartRight": "{$BuffName.MinecartRight}", - "SunflowerMinecartLeft": "{$BuffName.MinecartLeft}", - "HellMinecartRight": "{$BuffName.MinecartRight}", - "HellMinecartLeft": "{$BuffName.MinecartLeft}", - "ShroomMinecartRight": "{$BuffName.MinecartRight}", - "ShroomMinecartLeft": "{$BuffName.MinecartLeft}", - "AmethystMinecartRight": "{$BuffName.MinecartRight}", - "AmethystMinecartLeft": "{$BuffName.MinecartLeft}", - "TopazMinecartRight": "{$BuffName.MinecartRight}", - "TopazMinecartLeft": "{$BuffName.MinecartLeft}", - "SapphireMinecartRight": "{$BuffName.MinecartRight}", - "SapphireMinecartLeft": "{$BuffName.MinecartLeft}", - "EmeraldMinecartRight": "{$BuffName.MinecartRight}", - "EmeraldMinecartLeft": "{$BuffName.MinecartLeft}", - "RubyMinecartRight": "{$BuffName.MinecartRight}", - "RubyMinecartLeft": "{$BuffName.MinecartLeft}", - "DiamondMinecartRight": "{$BuffName.MinecartRight}", - "DiamondMinecartLeft": "{$BuffName.MinecartLeft}", - "AmberMinecartRight": "{$BuffName.MinecartRight}", - "AmberMinecartLeft": "{$BuffName.MinecartLeft}", - "BeetleMinecartRight": "{$BuffName.MinecartRight}", - "BeetleMinecartLeft": "{$BuffName.MinecartLeft}", - "MeowmereMinecartRight": "{$BuffName.MinecartRight}", - "MeowmereMinecartLeft": "{$BuffName.MinecartLeft}", - "PartyMinecartRight": "{$BuffName.MinecartRight}", - "PartyMinecartLeft": "{$BuffName.MinecartLeft}", - "PirateMinecartRight": "{$BuffName.MinecartRight}", - "PirateMinecartLeft": "{$BuffName.MinecartLeft}", - "SteampunkMinecartRight": "{$BuffName.MinecartRight}", - "SteampunkMinecartLeft": "{$BuffName.MinecartLeft}", - "CoffinMinecartRight": "{$BuffName.MinecartRight}", - "CoffinMinecartLeft": "{$BuffName.MinecartLeft}" + "ZephyrFish": "Poisson-zéphyr" }, "MapObject": { "Adamantite": "Adamantite", @@ -615,166 +545,5 @@ "Roll": "{$LegacyMultiplayer.8}", "Party": "/g", "Emote": "/moi" - }, - "Bestiary_ItemDropConditions": { - "NotExpert": "", - "NotMasterMode": "", - "LegacyHack_IsBossAndNotExpert": "", - "IsCrimsonAndNotExpert": "", - "IsCorruptionAndNotExpert": "", - "NotFromStatue": "" - }, - "Bestiary_FlavorText": { - "npc_JungleSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_YellowSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_RedSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_PurpleSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_BlackSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_GreenSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_BlueSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_DemonEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_Zombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_Skeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_AngryBones": "{$CommonBestiaryFlavor.AngryBones}", - "npc_Hornet": "{$CommonBestiaryFlavor.Hornet}", - "npc_Hellbat": "{$CommonBestiaryFlavor.LavaBat}", - "npc_BlueJellyfish": "{$CommonBestiaryFlavor.Jellyfish}", - "npc_PinkJellyfish": "{$CommonBestiaryFlavor.Jellyfish}", - "npc_Mummy": "{$CommonBestiaryFlavor.Mummy}", - "npc_DarkMummy": "{$CommonBestiaryFlavor.Mummy}", - "npc_LightMummy": "{$CommonBestiaryFlavor.Mummy}", - "npc_Mimic": "{$CommonBestiaryFlavor.Mimic}", - "npc_GreenJellyfish": "{$CommonBestiaryFlavor.Jellyfish}", - "npc_BaldZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_WanderingEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_Penguin": "{$CommonBestiaryFlavor.Penguin}", - "npc_PenguinBlack": "{$CommonBestiaryFlavor.Penguin}", - "npc_Lavabat": "{$CommonBestiaryFlavor.LavaBat}", - "npc_PigronCorruption": "{$CommonBestiaryFlavor.Pigron}", - "npc_PigronHallow": "{$CommonBestiaryFlavor.Pigron}", - "npc_PigronCrimson": "{$CommonBestiaryFlavor.Pigron}", - "npc_PincushionZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_SwampZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_TwiggyZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_CataractEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_SleepyEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_DialatedEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_GreenEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_PurpleEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_FemaleZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_HeadacheSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_MisassembledSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_PantlessSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_HornetFatty": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetHoney": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetLeafy": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetSpikey": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetStingy": "{$CommonBestiaryFlavor.Hornet}", - "npc_ZombieMushroom": "{$CommonBestiaryFlavor.MushroomZombie}", - "npc_ZombieMushroomHat": "{$CommonBestiaryFlavor.MushroomZombie}", - "npc_FungiBulb": "{$CommonBestiaryFlavor.FungiBulb}", - "npc_GiantFungiBulb": "{$CommonBestiaryFlavor.FungiBulb}", - "npc_RustyArmoredBonesAxe": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_RustyArmoredBonesFlail": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_RustyArmoredBonesSword": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_RustyArmoredBonesSwordNoArmor": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_BlueArmoredBones": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_BlueArmoredBonesMace": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_BlueArmoredBonesNoPants": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_BlueArmoredBonesSword": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_HellArmoredBones": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_HellArmoredBonesSpikeShield": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_HellArmoredBonesMace": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_HellArmoredBonesSword": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_RaggedCaster": "{$CommonBestiaryFlavor.RaggedCaster}", - "npc_RaggedCasterOpenCoat": "{$CommonBestiaryFlavor.RaggedCaster}", - "npc_Necromancer": "{$CommonBestiaryFlavor.Necromancer}", - "npc_NecromancerArmored": "{$CommonBestiaryFlavor.Necromancer}", - "npc_DiabolistRed": "{$CommonBestiaryFlavor.Diabolist}", - "npc_DiabolistWhite": "{$CommonBestiaryFlavor.Diabolist}", - "npc_AngryBonesBig": "{$CommonBestiaryFlavor.AngryBones}", - "npc_AngryBonesBigMuscle": "{$CommonBestiaryFlavor.AngryBones}", - "npc_AngryBonesBigHelmet": "{$CommonBestiaryFlavor.AngryBones}", - "npc_Scarecrow1": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow2": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow3": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow4": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow5": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow6": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow7": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow8": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow9": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow10": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_DemonEyeOwl": "{$CommonBestiaryFlavor.CostumeDemonEye}", - "npc_DemonEyeSpaceship": "{$CommonBestiaryFlavor.CostumeDemonEye}", - "npc_ZombieDoctor": "{$CommonBestiaryFlavor.CostumeZombie}", - "npc_ZombieSuperman": "{$CommonBestiaryFlavor.CostumeZombie}", - "npc_ZombiePixie": "{$CommonBestiaryFlavor.CostumeZombie}", - "npc_SkeletonTopHat": "{$CommonBestiaryFlavor.CostumeSkeleton}", - "npc_SkeletonAstonaut": "{$CommonBestiaryFlavor.CostumeSkeleton}", - "npc_SkeletonAlien": "{$CommonBestiaryFlavor.CostumeSkeleton}", - "npc_ZombieXmas": "{$CommonBestiaryFlavor.ZombieXmas}", - "npc_ZombieSweater": "{$CommonBestiaryFlavor.ZombieXmas}", - "npc_SlimeRibbonWhite": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_SlimeRibbonYellow": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_SlimeRibbonGreen": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_SlimeRibbonRed": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_ZombieElf": "{$CommonBestiaryFlavor.ZombieElf}", - "npc_ZombieElfBeard": "{$CommonBestiaryFlavor.ZombieElf}", - "npc_ZombieElfGirl": "{$CommonBestiaryFlavor.ZombieElf}", - "npc_ArmedZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombiePincushion": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombieSwamp": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombieTwiggy": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombieCenx": "{$CommonBestiaryFlavor.Zombie}", - "npc_GoldBird": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldBunny": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldButterfly": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldFrog": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldGrasshopper": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldMouse": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldWorm": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_BoneThrowingSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_BoneThrowingSkeleton2": "{$CommonBestiaryFlavor.Skeleton}", - "npc_BoneThrowingSkeleton3": "{$CommonBestiaryFlavor.Skeleton}", - "npc_BoneThrowingSkeleton4": "{$CommonBestiaryFlavor.Skeleton}", - "npc_GiantWalkingAntlion": "{$CommonBestiaryFlavor.AntlionCharger}", - "npc_GiantFlyingAntlion": "{$CommonBestiaryFlavor.AntlionSwarmer}", - "npc_DesertLamiaLight": "{$CommonBestiaryFlavor.Lamia}", - "npc_DesertLamiaDark": "{$CommonBestiaryFlavor.Lamia}", - "npc_SquirrelGold": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_SandShark": "{$CommonBestiaryFlavor.Sandshark}", - "npc_SandsharkCorrupt": "{$CommonBestiaryFlavor.Sandshark}", - "npc_SandsharkCrimson": "{$CommonBestiaryFlavor.Sandshark}", - "npc_SandsharkHallow": "{$CommonBestiaryFlavor.Sandshark}", - "npc_WalkingAntlion": "{$CommonBestiaryFlavor.AntlionCharger}", - "npc_FlyingAntlion": "{$CommonBestiaryFlavor.AntlionSwarmer}", - "npc_GoldGoldfish": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldGoldfishWalker": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_BlackDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_BlueDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_GreenDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_OrangeDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_RedDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_YellowDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_GoldDragonfly": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldLadyBug": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldWaterStrider": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldSeahorse": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_IceMimic": "{$CommonBestiaryFlavor.Mimic}", - "npc_GemSquirrelAmethyst": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelTopaz": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelSapphire": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelEmerald": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelRuby": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelDiamond": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelAmber": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemBunnyAmethyst": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyTopaz": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnySapphire": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyEmerald": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyRuby": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyDiamond": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyAmber": "{$CommonBestiaryFlavor.GemBunny}" } } \ No newline at end of file diff --git a/Localization/Content/fr-FR/Items.json b/Localization/Content/fr-FR/Items.json index af5367b..e9c46ef 100644 --- a/Localization/Content/fr-FR/Items.json +++ b/Localization/Content/fr-FR/Items.json @@ -232,6 +232,7 @@ "RedHusk": "Coquille rouge", "CyanHusk": "Coquille cyan", "VioletHusk": "Coquille mauve", + "PurpleMucos": "Mucus violet", "BlackInk": "Encre noire", "FlowerofFire": "Fleur de feu", "DyeVat": "Bac à teinture", @@ -538,6 +539,7 @@ "CarriageLantern": "Lanterne de calèche", "AlchemyLantern": "Lanterne d'alchimie", "DiablostLamp": "Lampe diabolique", + "OilRagSconse": "Chiffon huilé", "BlueDungeonChair": "Chaise bleue de donjon", "BlueDungeonTable": "Table bleue de donjon", "BlueDungeonWorkBench": "Établi bleu de donjon", @@ -690,6 +692,7 @@ "NecroGreaves": "Grèves nécro", "CrimsonChest": "Coffre carmin", "HallowedChest": "Coffre sacré", + "FrozenChest": "Coffre gelé", "JungleKey": "Clé de la jungle", "CorruptionKey": "Clé de la corruption", "CrimsonKey": "Clé carmin", @@ -760,6 +763,7 @@ "TitanstoneBlockWall": "Mur en blocs de pierre de titane", "MagicCuffs": "Menottes magiques", "MusicBoxSnow": "Boîte à musique (neige)", + "MusicBoxSpace": "Boîte à musique (espace)", "MusicBoxCrimson": "Boîte à musique (carmin)", "MusicBoxBoss4": "Boîte à musique (boss 4)", "SilverWatch": "Montre en argent", @@ -768,6 +772,7 @@ "MusicBoxRain": "Boîte à musique (pluie)", "MusicBoxIce": "Boîte à musique (glace)", "MusicBoxDesert": "Boîte à musique (désert)", + "MusicBoxOcean": "Boîte à musique (océan)", "MusicBoxDungeon": "Boîte à musique (donjon)", "MusicBoxPlantera": "Boîte à musique (Plantera)", "MusicBoxBoss5": "Boîte à musique (boss 5)", @@ -810,6 +815,7 @@ "DerplingBanner": "Bannière de Benêt", "EaterofSoulsBanner": "Bannière de Dévoreur d'âmes", "EnchantedSwordBanner": "Bannière d'Épée envoûtée", + "ZombieEskimoBanner": "Bannière d'Eskimo zombie", "FaceMonsterBanner": "Bannière de Monstre grimaçant", "FloatyGrossBanner": "Bannière d'Immondice flottante", "FlyingFishBanner": "Bannière de Poisson volant", @@ -1003,6 +1009,7 @@ "SpookyDoor": "Porte sinistre", "SpookyTable": "Table sinistre", "SpookyWorkBench": "Établi sinistre", + "SpookyPlatform": "Plateforme sinistre", "ReaperHood": "Capuche de faucheuse", "Diamond": "Diamant", "ReaperRobe": "Robe de faucheuse", @@ -1558,7 +1565,7 @@ "GuideVoodooFish": "Guide vaudousson", "Wyverntail": "Vouivroisson", "ZombieFish": "Poissombie", - "AmanitaFungifin": "Amanite champoisson", + "AmanitiaFungifin": "Amanite champoisson", "Angelfish": "Angeoisson", "BloodyManowar": "Méduse sanglante", "Bonefish": "Poisquelette", @@ -1637,7 +1644,7 @@ "SwiftnessPotion": "Potion de rapidité", "BlueArmoredBonesBanner": "Bannière de Squelette en armure bleue", "BlueCultistArcherBanner": "Bannière d'Archer adepte bleu", - "ManaCloakStar": "", + "BlueCultistCasterBanner": "Bannière d'Incantateur adepte bleu", "BlueCultistFighterBanner": "Bannière de Guerrier adepte bleu", "BoneLeeBanner": "Bannière de Bones Lee", "ClingerBanner": "Bannière d'Accrocheur", @@ -2203,6 +2210,7 @@ "TacticalShotgun": "Fusil à pompe tactique", "RottenChunk": "Morceau avarié", "IvyChest": "Coffre de lierre", + "IceChest": "Coffre de glace", "Marrow": "Moelle", "UnholyTrident": "Trident profane", "FrostHelmet": "Casque de givre", @@ -2338,6 +2346,9 @@ "TheUndertaker": "Le Croque-mort", "TheMeatball": "La Boulette de viande", "TheRottedFork": "La Fourche pourrie", + "EskimoHood": "Capuche d'Eskimo", + "EskimoCoat": "Manteau d'Eskimo", + "EskimoPants": "Pantalon d'Eskimo", "LivingWoodChair": "Chaise en bois vivant", "CactusChair": "Chaise en cactus", "BoneChair": "Chaise en os", @@ -2527,7 +2538,10 @@ "ShoeSpikes": "Chaussures à pointes", "TigerClimbingGear": "Matériel d'escalade de tigre", "Tabi": "Tabi", + "PinkEskimoHood": "Capuche d'Eskimo rose", + "PinkEskimoCoat": "Manteau d'Eskimo rose", "Minishark": "Minirequin", + "PinkEskimoPants": "Pantalon d'Eskimo rose", "PinkThread": "Fil rose", "ManaRegenerationBand": "Anneau de régénération de mana", "SandstorminaBalloon": "Tempête de sable dans un ballon", @@ -2602,6 +2616,7 @@ "AncientBattleArmorPants": "Pantalon interdit", "AncientBattleArmorShirt": "Robes interdites", "AncientCloth": "Tissu antique", + "AncientCultistTrophy": "Trophée d'Adepte ancien", "AncientHorn": "Corne antique", "AnglerTackleBag": "Sac complet de pêche", "AngryBonesBanner": "Bannière de Squelette furieux", @@ -2697,6 +2712,7 @@ "BorealWoodTable": "Table en bois boréal", "BorealWoodWall": "Mur en bois boréal", "BorealWoodWorkBench": "Établi en bois boréal", + "BossMaskCultist": "Masque d'Adepte ancien", "BossMaskMoonlord": "Masque du Seigneur de la lune", "BottomlessBucket": "Seau d'eau sans fond", "BouncyBomb": "Bombe à rebonds", @@ -2820,6 +2836,7 @@ "DestroyerBossBag": "Sac de trésors", "DestroyerMask": "Masque de Destructeur", "Detonator": "Détonateur", + "DevDye": "Sang de Skiph", "DiamondGemsparkWall": "Mur brillance de diamant", "DiamondGemsparkWallOff": "Mur sans brillance de diamant", "DjinnLamp": "Lampe d'Esprit du désert", @@ -2883,12 +2900,14 @@ "Fake_DynastyChest": "Coffre en dynastie piégé", "Fake_EbonwoodChest": "Coffre en ébène piégé", "Fake_FleshChest": "Coffre en chair piégé", + "Fake_FrozenChest": "Coffre gelé piégé", "Fake_GlassChest": "Coffre en verre piégé", "Fake_GoldChest": "Coffre en or piégé", "Fake_GraniteChest": "Coffre en granite piégé", "Fake_GreenDungeonChest": "Coffre vert de donjon piégé", "Fake_HallowedChest": "Coffre sacré piégé", "Fake_HoneyChest": "Coffre en miel piégé", + "Fake_IceChest": "Coffre de glace piégé", "Fake_IvyChest": "Coffre de lierre piégé", "Fake_JungleChest": "Coffre de la jungle piégé", "Fake_LihzahrdChest": "Coffre en lihzahrd piégé", @@ -3558,6 +3577,7 @@ "SailfishBoots": "Bottes voilier", "SalamanderBanner": "Bannière de Salamandre", "SandElementalBanner": "Bannière d'Élémentaire de sable", + "SandFallBlock": "Chutes de sable", "SandFallWall": "Mur de chute de sable", "SandsharkBanner": "Bannière de Requin des sables", "SandsharkCorruptBanner": "Bannière de Croqueur osseux", @@ -3621,6 +3641,10 @@ "SkeletronBossBag": "Sac de trésors", "SkeletronPrimeBossBag": "Sac de trésors", "SkeletronPrimeMask": "Trophée du Grand Squeletron", + "SkiphsHelm": "Masque de Skiph", + "SkiphsPants": "Derrière de Skiph", + "SkiphsShirt": "Peau de Skiph", + "SkiphsWings": "Pattes de Skiph", "SkyBlueString": "Cordon bleu ciel", "SkyFracture": "Fracture céleste", "SkywareBathtub": "Baignoire céleste", @@ -3662,6 +3686,7 @@ "SmokeBlock": "Bloc de fumée", "SnailStatue": "Statue d'escargot", "SnowCloudBlock": "Nuage de neige", + "SnowFallBlock": "Chute de neige", "SnowFallWall": "Mur de chute de neige", "SolarCoriteBanner": "Bannière de Corite", "SolarCrawltipedeBanner": "Bannière de Rampipède", @@ -3806,6 +3831,7 @@ "TwilightHairDye": "Coloration crépuscule", "TwinMask": "Masque de jumeau", "TwinsBossBag": "Sac de trésors", + "UltraBrightCampfire": "Feu de camp très vif", "UndeadVikingStatue": "Statue de Viking mort-vivant", "UnicornStatue": "Statue de licorne", "UnicornWispDye": "Teinture de volute de licorne", @@ -3954,6 +3980,7 @@ "DungeonClockPink": "Horloge rose de donjon", "DynastyDresser": "Commode de dynastie", "DynastyPiano": "Piano de dynastie", + "DynastyPlatform": "Plateforme de dynastie", "DynastySofa": "Sofa de dynastie", "Fake_CrystalChest": "Coffre de cristal piégé", "Fake_GoldenChest": "Coffre doré piégé", @@ -3978,6 +4005,10 @@ "SquireAltPants": "Grèves de chevalier de Valhalla", "SquireAltShirt": "Plastron de chevalier de Valhalla", "SkywareClock2": "Horloge de soleil", + "ArkhalisHat": "Capuche d'Arkhalis", + "ArkhalisShirt": "Corsage d'Arkhalis", + "ArkhalisPants": "Collants d'Arkhalis", + "ArkhalisWings": "Ailes lumineuses d'Arkhalis", "LeinforsHat": "Après-shampoing de Leinfor", "LeinforsShirt": "Style excessif de Leinfor", "LeinforsPants": "Pantalon fantaisie de Leinfor", @@ -4003,7 +4034,7 @@ "Paintbrush": "Utilisé avec de la peinture pour colorer les blocs", "PaintRoller": "Utilisé avec de la peinture pour colorer les murs", "ManaCrystal": "+20 points de santé max définitifs", - "GolfBallDyedPink": "{$CommonItemTooltip.GolfBall}", + "PaintScraper": "Utilisé pour retirer de la peinture", "TealMushroom": "Utilisé pour fabriquer la teinture cyan", "GreenMushroom": "Utilisé pour fabriquer la teinture verte", "SkyBlueFlower": "Utilisée pour fabriquer la teinture bleu ciel", @@ -4027,7 +4058,7 @@ "MagicMissile": "Lance un missile contrôlable", "Beenade": "Explose en une colonie d'abeilles", "GravityGlobe": "Permet au porteur d'inverser la gravité\nAppuyez sur HAUT pour changer la gravité", - "KiteRed": "{$CommonItemTooltip.Kite}", + "HoneyComb": "Libère des abeilles si endommagée", "Abeemination": "Invoque la Reine des abeilles", "DirtRod": "Déplace de la terre comme par magie", "TempleKey": "Ouvre la porte du temple de la jungle", @@ -4036,10 +4067,10 @@ "LihzahrdPressurePlate": "S'active quand un joueur marche dessus", "PiranhaGun": "S'accroche à l'ennemi et inflige des dégâts en continu", "PygmyStaff": "Invoque un pygmée pour combattre à vos côtés", - "KiteBlueAndYellow": "{$CommonItemTooltip.Kite}", - "KiteBlue": "{$CommonItemTooltip.Kite}", - "KiteWyvern": "{$CommonItemTooltip.Kite}", - "GroxTheGreatGreaves": "{$CommonItemTooltip.DevItem}", + "PygmyNecklace": "Augmente votre nombre maximal de sbires", + "TikiMask": "Augmente votre nombre maximal de sbires\n+10 % de dégâts des sbires", + "TikiShirt": "Augmente votre nombre maximal de sbires\n+10 % de dégâts des sbires", + "TikiPants": "Augmente votre nombre maximal de sbires\n+10 % de dégâts des sbires", "LeafWings": "{$CommonItemTooltip.FlightAndSlowfall}", "BlizzardinaBalloon": "Permet au porteur de faire un double saut\nAugmente la hauteur des sauts", "BundleofBalloons": "Permet au porteur de faire un quadruple saut\nAugmente la hauteur des sauts", @@ -4088,19 +4119,19 @@ "MeteorSuit": "+7 % de dégâts magiques", "AmberMosquito": "Invoque un petit dinosaure", "NimbusRod": "Invoque un nuage pour faire pleuvoir de l'eau sur vos ennemis", - "GroxTheGreatArmor": "{$CommonItemTooltip.DevItem}", + "BeeCloak": "Fait tomber les étoiles et libère les abeilles quand le joueur est blessé", "EyeoftheGolem": "+10 % de chances de coup critique", "HoneyBalloon": "Permet de sauter plus haut\nLibère des abeilles quand il est endommagé", "MeteorLeggings": "+7 % de dégâts magiques", "BlueHorseshoeBalloon": "Permet au porteur de faire un double saut\nAugmente la hauteur de saut et annule les dégâts de chute", "WhiteHorseshoeBalloon": "Permet au porteur de faire un double saut\nAugmente la hauteur de saut et annule les dégâts de chute", "YellowHorseshoeBalloon": "Permet au porteur de faire un double saut\nAugmente la hauteur de saut et annule les dégâts de chute", - "OceanCrate": "{$CommonItemTooltip.RightClickToOpen}", + "FrozenTurtleShell": "Enveloppe le porteur d'une carapace qui réduit les dégâts lorsque sa santé est inférieure à 50 %", "SniperRifle": "Tire une balle puissante très rapide\n pour réduire", "VenusMagnum": "Tire une balle puissante très rapide", "CrimsonRod": "Invoque un nuage pour faire pleuvoir du sang sur vos ennemis", - "SteampunkWings": "{$CommonItemTooltip.FlightAndSlowfall}", - "WingsVortex": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", + "Stynger": "Tire un projectile explosif", + "FlowerPow": "Tire des pétales de fleur acérées aux ennemis à proximité", "RainbowGun": "Tire un arc-en-ciel qui cause des dégâts en continu", "StyngerBolt": "Explose en éclats d'obus mortels", "FlowerofFrost": "Tire une boule de givre", @@ -4112,11 +4143,11 @@ "EmeraldRobe": "+60 points de mana max\n-11 % d'usage de mana", "RubyRobe": "+60 points de mana max\n-13 % d'usage de mana", "DiamondRobe": "+80 points de mana max\n-15 % d'usage de mana", - "GroxTheGreatHelm": "{$CommonItemTooltip.DevItem}", + "PanicNecklace": "Augmente la vitesse de déplacement une fois le joueur touché", "LifeFruit": "+5 points de santé max définitifs", "LihzahrdPowerCell": "Sert d'autel de Lihzahrd", "Picksaw": "Peut extraire des briques de Lihzhard", - "JimsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "HeatRay": "Tire un rayon de chaleur transperçant\nChaud devant !", "StaffofEarth": "Invoque un rocher puissant", "GolemFist": "Donne un coup de poing avec la force d'un golem", "Binoculars": "Augmentent la visibilité si équipées", @@ -4136,8 +4167,8 @@ "TurtleHelmet": "+6 % de dégâts au corps à corps\nLes ennemis sont plus susceptibles de vous viser", "TurtleScaleMail": "+8 % de dégâts au corps à corps et de chances de coup critique\nLes ennemis sont plus susceptibles de vous viser", "TurtleLeggings": "+4 % de chances de coup critique au corps à corps\nLes ennemis sont plus susceptibles de vous viser", - "KiteWorldFeeder": "{$CommonItemTooltip.Kite}", - "OasisCrateHard": "{$CommonItemTooltip.RightClickToOpen}", + "MagicQuiver": "+10 % de dégâts et augmente considérablement la vitesse des flèches\n20 % de chances de ne pas utiliser de munitions", + "MagmaStone": "Inflige des dégâts de feu à l'attaque", "ObsidianRose": "Réduit les dégâts au toucher de la lave", "RodofDiscord": "Vous téléporte à la position du curseur", "DeathSickle": "Lance une faucille de la mort", @@ -4147,7 +4178,7 @@ "IchorArrow": "Réduit la défense de la cible", "IchorBullet": "Réduit la défense de la cible", "GoldenShower": "Vaporise une douche d'ichor\nRéduit la défense de la cible", - "OasisCrate": "{$CommonItemTooltip.RightClickToOpen}", + "FireGauntlet": "Augmente le recul au corps à corps et inflige des dégâts de feu à l'attaque\n+10 % de vitesse et de dégâts au corps à corps", "ImbuingStation": "Utilisée pour fabriquer des flasques d'infusion pour armes", "EmptyBullet": "Utilisée pour fabriquer différents types de munitions", "ShadowbeamStaff": "Crée un faisceau de l'ombre qui rebondit sur les murs", @@ -4176,17 +4207,17 @@ "CorruptionKey": "Ouvre un coffre de la Corruption dans le donjon", "CrimsonKey": "Ouvre un coffre du Monde carmin dans le donjon", "HallowedKey": "Ouvre un coffre sacré dans le donjon", - "Cherry": "{$CommonItemTooltip.MinorStats}", + "FrozenKey": "Ouvre un coffre gelé dans le donjon", "SpectrePaintbrush": "Utilisé avec de la peinture pour colorer les blocs", "SpectrePaintRoller": "Utilisé avec de la peinture pour colorer les murs", - "GolfBallDyedOrange": "{$CommonItemTooltip.GolfBall}", + "SpectrePaintScraper": "Sert à retirer de la peinture", "ShroomiteHeadgear": "+15 % de dégâts de flèches\n+5 % de chances de coup critique à distance", "ShroomiteMask": "+15 % de dégâts de balles\n+5 % de chances de coup critique à distance", "ShroomiteHelmet": "+15 % de dégâts de fusées\n+5 % de chances de coup critique à distance", - "KiteBoneSerpent": "{$CommonItemTooltip.Kite}", + "ShroomiteBreastplate": "+13 % de chances de coup critique à distance\n20 % de chances de ne pas utiliser de munitions", "ShroomiteLeggings": "+7 % de chances de coup critique à distance\n+12 % de vitesse de déplacement", "Autohammer": "Convertit les lingots de chlorophyte en lingots de champignite", - "Jetpack": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressUpToBooster}", + "SDMG": "50 % de chances de ne pas utiliser de munitions\nElle est venue du bout de l'espace", "CenxsTiara": "{$CommonItemTooltip.DevItem}", "CenxsBreastplate": "{$CommonItemTooltip.DevItem}", "CenxsLeggings": "{$CommonItemTooltip.DevItem}", @@ -4206,17 +4237,17 @@ "VampireKnives": "Lancent rapidement des dagues qui volent de la santé", "AquaScepter": "Vaporise une douche d'eau", "ScourgeoftheCorruptor": "Un javelot puissant qui libère de petits dévoreurs", - "Banana": "{$CommonItemTooltip.MinorStats}", + "StaffoftheFrostHydra": "Invoque une hydre givrée puissante qui crache de la glace sur vos ennemis", "SweetheartNecklace": "Libère des abeilles et augmente la vitesse de déplacement quand le joueur a subi des dégâts", "FlurryBoots": "Le porteur peut courir très vite", "LuckyHorseshoe": "Annule tous dégâts de chute", "DTownsHelmet": "{$CommonItemTooltip.DevItem}", "DTownsBreastplate": "{$CommonItemTooltip.DevItem}", "DTownsLeggings": "{$CommonItemTooltip.DevItem}", - "GroxTheGreatWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", - "StillLife": "{$PaintingArtist.Crowno}", - "BloodyGoblet": "{$PaintingArtist.Crowno}", - "WickedUndead": "{$PaintingArtist.Crowno}", + "DTownsWings": "{$CommonItemTooltip.DevItem}", + "WillsWings": "{$CommonItemTooltip.DevItem}", + "CrownosWings": "{$CommonItemTooltip.DevItem}", + "CenxsWings": "{$CommonItemTooltip.DevItem}", "CenxsDress": "{$CommonItemTooltip.DevItem}", "CenxsDressPants": "{$CommonItemTooltip.DevItem}", "ShinyRedBalloon": "Permet de sauter plus haut", @@ -4225,7 +4256,7 @@ "AnkhCharm": "Immunise contre la plupart des altérations", "AnkhShield": "Immunise contre le recul et les blocs de feu\nImmunise contre la plupart des altérations", "WaterBolt": "Lance un jet d'eau qui se déplace lentement", - "GolfBall": "{$CommonItemTooltip.GolfBall}", + "Bomb": "Une petite explosion qui détruira quelques tuiles", "Dynamite": "Une grosse explosion qui détruira la majorité des tuiles", "Grenade": "Une petite explosion qui ne détruira pas de tuiles", "GoldWatch": "Donne l'heure", @@ -4237,7 +4268,7 @@ "GoodieBag": "{$CommonItemTooltip.RightClickToOpen}", "CandyCornRifle": "33 % de ne pas utiliser de munitions", "Sickle": "Permet de couper l'herbe pour faire du foin", - "KiteAngryTrapper": "{$CommonItemTooltip.Kite}", + "PumpkinPie": "{$CommonItemTooltip.MinorStats}", "TatteredFairyWings": "{$CommonItemTooltip.FlightAndSlowfall}", "SpiderEgg": "Invoque un familier araignée", "MagicalPumpkinSeed": "Invoque un familier potiron", @@ -4253,35 +4284,35 @@ "UnluckyYarn": "Invoque un chat noir", "TheHorsemansBlade": "Invoque des têtes de citrouille pour attaquer vos ennemis", "SpookyWings": "{$CommonItemTooltip.FlightAndSlowfall}", - "GhostManifestation": "{$PaintingArtist.Crowno}", - "Graveyard": "{$PaintingArtist.Crowno}", - "Reborn": "{$PaintingArtist.Crowno}", + "SpookyHelmet": "Augmente votre nombre maximal de sbires\n+11 % de dégâts de sbires", + "SpookyBreastplate": "Augmente votre nombre maximal de sbires\n+11 % de dégâts de sbires", + "SpookyLeggings": "Augmente votre nombre maximal de sbires\n+11 % de dégâts de sbires", "CursedSapling": "Invoque un arbuste maudit pour vous suivre", "PumpkinMoonMedallion": "Invoque la Lune citrouille", - "Nevermore": "{$PaintingArtist.Crowno}", + "NecromanticScroll": "Augmente votre nombre maximal de sbires\n+10 % de dégâts de sbires", "SniperScope": "Augmente la visibilité pour les fusils ( pour réduire)\n+10 % de dégâts à distance et de chances de coup critique", "BreathingReed": "Augmente la durée de respiration et permet de respirer sous l'eau", "JellyfishDivingGear": "Permet de nager et rallonge considérablement la respiration sous l'eau\nDonne de la lumière sous l'eau", "ArcticDivingGear": "Permet de nager et rallonge considérablement la respiration sous l'eau\nDonne de la lumière sous l'eau et permet de mieux se déplacer sur la glace", - "GnomeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.Gnome}", + "FrostsparkBoots": "Permettent de voler, de courir très vite et de mieux se déplacer sur la glace\n+7 % de vitesse de déplacement", "FartInABalloon": "Permet au porteur de faire un double saut\nPermet de sauter plus haut", - "DandelionBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.Dandelion}", - "GolfPainting3": "{$PaintingArtist.Crowno}", - "ArkhalisWings": "{$ItemTooltip.ArkhalisHat}\n{$CommonItemTooltip.FlightAndSlowfall}", + "PapyrusScarab": "Augmente votre nombre maximal de sbires\nAugmente les dégâts et le recul de vos sbires", + "CelestialStone": "Augmente légèrement les dégâts, la vitesse au corps à corps et les chances de coup critique\nRégénération de santé, défense, vitesse de collecte et recul de sbires", + "Hoverboard": "{$CommonItemTooltip.FlightAndSlowfall}\nMaintenir BAS et SAUTER pour planer", "Present": "{$CommonItemTooltip.RightClickToOpen}", "Flipper": "Permettent de nager", "RedRyder": "Allez pas vous crever un œil !", "FestiveWings": "{$CommonItemTooltip.FlightAndSlowfall}", "BladeofGrass": "Chance d'empoisonner l'ennemi", "EldMelter": "Utilise du gel comme munitions", - "KiteGoldfish": "{$CommonItemTooltip.Kite}", + "ChristmasPudding": "{$CommonItemTooltip.MinorStats}", "ReindeerBells": "Invoque un renne à monter", "CnadyCanePickaxe": "Peut extraire de la météorite", - "KiteBunnyCrimson": "{$CommonItemTooltip.Kite}", - "KiteBunnyCorrupt": "{$CommonItemTooltip.Kite}", + "SugarCookie": "{$CommonItemTooltip.MinorStats}", + "GingerbreadCookie": "{$CommonItemTooltip.MinorStats}", "HandWarmer": "Immunise contre les effets de froid et de gel", "Coal": "Vous n'avez pas été sage cette année", - "GolfPainting2": "{$PaintingArtist.Crowno}", + "Toolbox": "+1 point de placement d'objets et de portée des outils", "DogWhistle": "Invoque un chien", "ChristmasTreeSword": "Tire des décorations de Noël", "ChainGun": "50 % de chances de ne pas utiliser de munitions", @@ -4297,7 +4328,7 @@ "JungleRose": "Oh, que c'est joli !", "FeralClaws": "+12 % de vitesse au corps à corps", "AnkletoftheWind": "+10 % de vitesse de déplacement", - "GolfClubIron": "{$CommonItemTooltip.GolfIron}", + "StaffofRegrowth": "Crée de l'herbe et de la mousse sur la terre et la pierre\nAugmente la récupération de plantes d'alchimie quand il est utilisé pour la récolte", "WhoopieCushion": "Peut ennuyer certaines personnes", "HeavyWorkBench": "Utilisé pour l'artisanat supérieur", "AmmoBox": "-20 % d'utilisation des munitions", @@ -4318,7 +4349,7 @@ "SteampunkBoiler": "{$CommonItemTooltip.SpecialCrafting}", "HoneyDispenser": "{$CommonItemTooltip.SpecialCrafting}", "BrickLayer": "Augmente la vitesse de placement des tuiles", - "GolfPainting1": "{$PaintingArtist.Crowno}", + "ExtendoGrip": "Augmente la portée des tuiles", "PaintSprayer": "Peint automatiquement les objets placés", "PortableCementMixer": "Augmente la vitesse de placement des murs", "CelestialMagnet": "Augmente la portée de collecte des étoiles de mana", @@ -4327,8 +4358,8 @@ "CelestialCuffs": "Augmente la portée de collecte des étoiles de mana\nRestaure du mana quand le joueur est blessé", "PulseBow": "Tire une flèche chargée", "NaturesGift": "-6 % d'usage de mana", - "KiteSandShark": "{$CommonItemTooltip.Kite}", - "KiteShark": "{$CommonItemTooltip.Kite}", + "PadThai": "{$CommonItemTooltip.MinorStats}", + "Pho": "{$CommonItemTooltip.MinorStats}", "RestorationPotion": "Réduit le temps de recharge des potions", "Gatligator": "50 % de chances ne pas utiliser de munitions\nTrès imprécis", "WaterGun": "Fait jaillir un jet d'eau inoffensif", @@ -4341,14 +4372,14 @@ "Gel": "Aussi délicieux qu'inflammable", "JunglePants": "+20 points de mana max\n+4 % de chance de coup critique magique", "NeonTetra": "Ses écailles colorées se vendraient bien.", - "Grapefruit": "{$CommonItemTooltip.MinorStats}", + "GoldenCarp": "Plutôt brillante. Ça se vendra sûrement bien.", "MiningPotion": "+25 % de vitesse d'extraction", "HeartreachPotion": "Augmente la portée de collecte des cœurs de vie", - "DungeonFishingCrateHard": "{$ItemTooltip.DungeonFishingCrate}", + "CalmingPotion": "Réduit l'agression ennemie", "BuilderPotion": "Augmente la vitesse et la portée du placement", "TitanPotion": "Augmente le recul", "FlipperPotion": "Permet de se déplacer avec aise dans les liquides", - "DivineEye": "{$PaintingArtist.Darthkitten}", + "SummoningPotion": "Augmente votre nombre maximal de sbires", "TrapsightPotion": "Permet de voir les sources de danger à proximité", "WoodenCrate": "{$CommonItemTooltip.RightClickToOpen}", "IronCrate": "{$CommonItemTooltip.RightClickToOpen}", @@ -4359,36 +4390,36 @@ "RagePotion": "+10 % de chances de coup critique", "InfernoPotion": "Met le feu aux ennemis à proximité", "WrathPotion": "+10 % de dégâts", - "GolfClubDriver": "{$CommonItemTooltip.GolfDriver}", + "StickyBomb": "Le lancer peut s'avérer difficile", "RecallPotion": "Vous téléporte chez vous", "TeleportationPotion": "Vous téléporte vers un lieu au hasard", "LovePotion": "Jetez-la pour jouer les cupidons", "StinkPotion": "Jetez-la pour donner une terrible odeur à quelqu'un", - "BandageBoy": "{$PaintingArtist.Darthkitten}", + "FishingPotion": "Améliore les compétences de pêche", "SonarPotion": "Détecte les poissons qui ont mordu à l'hameçon", "CratePotion": "Augmente les chances d'obtenir une caisse", "WarmthPotion": "Réduit les dégâts causés par les sources de froid", - "VisitingThePyramids": "{$PaintingArtist.Leinfors}", - "Uluru": "{$PaintingArtist.darthmorf}", + "BeeHeadgear": "+4 % de dégâts de sbires\nAugmente votre nombre maximal de sbires", + "BeeBreastplate": "+4 % de dégâts de sbires\nReinndit après avoir touché cr mur", "BeeGreaves": "+5 % de dégâts de sbires", "HornetStaff": "Invoque un frelon pour combattre à vos côtés", "ImpStaff": "Invoque un diablotin pour combattre à vos côtés", - "Oasis": "{$PaintingArtist.Khaios}", - "LifeAboveTheSand": "{$PaintingArtist.Zoomo}", - "SnakesIHateSnakes": "{$PaintingArtist.Xman101}", + "AnglerHat": "Améliore le niveau de pêche", + "AnglerVest": "Améliore le niveau de pêche", + "AnglerPants": "Améliore le niveau de pêche", "Sunglasses": "Elles vous donnent un air cool !", - "TheSandsOfSlime": "{$PaintingArtist.Criddle}", - "JawsOfDeath": "{$PaintingArtist.Darthkitten}", - "BurningSpirit": "{$PaintingArtist.Zoomo}", + "SpiderMask": "Augmente votre nombre maximal de sbires\n+6 % de dégâts de sbires", + "SpiderBreastplate": "Augmente votre nombre maximal de sbires\n+6 % de dégâts de sbires", + "SpiderGreaves": "Augmentent votre nombre maximal de sbires\n+6 % de dégâts de sbires", "HighTestFishingLine": "Le fil ne se cassera jamais", - "FruitSalad": "{$CommonItemTooltip.MinorStats}", + "AnglerEarring": "Améliorent les compétences de pêche", "TackleBox": "Réduit les chances d'utilisation d'appâts", "WizardHat": "+15 % de dégâts magiques", "ZephyrFish": "Invoque un poisson-zéphyr", "FrogLeg": "Augmente la vitesse de saut et permet le saut automatique\nAugmente la résistance à la chute", - "Dragonfruit": "{$CommonItemTooltip.MediumStats}", - "KiteJellyfishPink": "{$CommonItemTooltip.Kite}", - "KiteJellyfishBlue": "{$CommonItemTooltip.Kite}", + "CookedFish": "{$CommonItemTooltip.MinorStats}", + "CookedShrimp": "{$CommonItemTooltip.MinorStats}", + "Sashimi": "{$CommonItemTooltip.MinorStats}", "FinWings": "{$CommonItemTooltip.FlightAndSlowfall}", "OpticStaff": "Invoque des jumeaux pour combattre à vos côtés", "RedHat": "Il a une odeur bizarre…", @@ -4421,13 +4452,13 @@ "HunterPotion": "Montre où se trouvent les ennemis", "GravitationPotion": "Permet de contrôler la gravité", "IllegalGunParts": "Interdites presque partout", - "GolfClubWedge": "{$CommonItemTooltip.GolfWedge}", - "BetsyWings": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", + "GoldenKey": "Ouvre un coffre d'or ou de donjon", + "ShadowKey": "Ouvre tous les coffres de l'ombre", "Furnace": "Sert à fondre des minerais", "Loom": "Sert à fabriquer des vêtements", "IronAnvil": "Sert à fabriquer des objets à partir de lingots de métal", "Keg": "Sert à brasser de la bière", - "KiteManEater": "{$CommonItemTooltip.Kite}", + "BowlofSoup": "{$CommonItemTooltip.MinorStats}", "WorkBench": "Sert à l'artisanat de base", "GoblinBattleStandard": "Invoque une armée de gobelins", "Sawmill": "Sert à l'artisanat avancé avec le bois", @@ -4440,7 +4471,7 @@ "MythrilHat": "+12 % de dégâts à distance\n+7 % de chances de coup critique à distance", "CobaltDrill": "Peut extraire du mithril et de l'orichalque", "MythrilDrill": "Peut extraire de l'adamantite et du titane", - "WingsNebula": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", + "DaoofPow": "A une chance de rendre confus\nTrouvez la force intérieure", "Compass": "Affiche la position horizontale", "DivingGear": "Permet de nager\nRallonge considérablement la durée de respiration sous l'eau", "GPS": "Montre la position\nDonne l'heure", @@ -4454,14 +4485,14 @@ "AdamantiteBreastplate": "+6 % de dégâts", "AdamantiteLeggings": "+4 % de chances de coup critique\n+5 % de vitesse de déplacement", "SpectreBoots": "Permettent de voler\nLe porteur peut courir super vite", - "FruitJuice": "{$CommonItemTooltip.MinorStats}", + "Toolbelt": "Augmente la portée de placement de blocs", "HolyWater": "Étend le sacré à certains blocs", - "CrimsonFishingCrateHard": "{$ItemTooltip.CrimsonFishingCrate}", + "UnholyWater": "Étend la corruption à certains blocs", "FairyBell": "Invoque une fée magique", "SuspiciousLookingEye": "Invoque l'Œil de Cthulhu", "ClockworkAssaultRifle": "Trois rafales\nSeul le premier tir consomme des munitions", "MoonCharm": "Transforme le porteur en loup-garou la nuit", - "KiteCrawltipede": "{$CommonItemTooltip.Kite}", + "Ruler": "Crée des lignes de mesure à l'écran pour placer les blocs", "SorcererEmblem": "+15 % de dégâts magiques", "BandofRegeneration": "Régénère lentement la santé", "WarriorEmblem": "+15 % de dégâts au corps à corps", @@ -4487,16 +4518,16 @@ "AdamantiteForge": "Sert à fondre les minerais d'adamantite et de titane", "MythrilAnvil": "Sert à fabriquer des objets à partir de lingots de mithril, d'orichalque, d'adamantite et de titane", "UnicornHorn": "Pointue et magique !", - "CrownosWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "DarkShard": "Parfois, des créatures en portent dans les déserts altérés", "LightShard": "Parfois, des créatures en portent dans les déserts de lumière", "RedPressurePlate": "S'active quand on marche dessus", "CloudinaBottle": "Permet au porteur de faire un double saut", "SpellTome": "Peut être envoûté", - "PrismaticPunch": "{$CommonItemTooltip.MediumStats}", + "StarCloak": "Fait tomber des étoiles quand le joueur est blessé", "Megashark": "50 % de chances de ne pas utiliser de munitions\nLe grand frère de Minirequin", "Shotgun": "Tire une série de balles", - "FrozenCrateHard": "{$CommonItemTooltip.RightClickToOpen}", - "Mango": "{$CommonItemTooltip.MinorStats}", + "PhilosophersStone": "Réduit la recharge des potions de soin", + "TitanGlove": "Augmente le recul en corps à corps", "HermesBoots": "Le porteur peut courir très vite", "GreenPressurePlate": "S'active quand on marche dessus", "GrayPressurePlate": "S'active quand un joueur marche dessus", @@ -4510,10 +4541,10 @@ "HallowedHelmet": "+15 % de dégâts à distance\n+8 % de chances de coup critique à distance", "CrossNecklace": "Augmente la durée d'invincibilité après avoir subi des dégâts", "ManaFlower": "-8 % d'usage de mana\nUtilise automatiquement des potions de mana au besoin", - "Elderberry": "{$CommonItemTooltip.MinorStats}", + "MechanicalWorm": "Invoque le Destructeur", "MechanicalSkull": "Invoque le Grand Squeletron", "HallowedHeadgear": "+100 points de mana max\n+12 % de dégâts magiques et de chances de coup critique", - "KiteYellow": "{$CommonItemTooltip.Kite}", + "HallowedMask": "+10 % de dégâts au corps à corps et de chances de coup critique\n+10 % de vitesse au corps à corps", "DemoniteOre": "Bat d'une énergie noire", "SlimeCrown": "Invoque le Roi des gelées", "LightDisc": "Cumule jusqu'à 5", @@ -4535,12 +4566,12 @@ "Vilethorn": "Invoque une ronce vile", "Starfury": "Fait pleuvoir les étoiles du ciel\nForgée avec la furie des cieux", "PurificationPowder": "Purifie le mal", - "SmoothieofDarkness": "{$CommonItemTooltip.MinorStats}", + "RedsWings": "{$CommonItemTooltip.DevItem}", "RedsHelmet": "{$CommonItemTooltip.DevItem}", "RedsBreastplate": "{$CommonItemTooltip.DevItem}", "RedsLeggings": "{$CommonItemTooltip.DevItem}", "Fish": "Invoque un petit manchot", - "BloodOrange": "{$CommonItemTooltip.MinorStats}", + "VilePowder": "Bannit le sacré", "Frostbrand": "Tire un projectile glacial", "RedPotion": "Uniquement pour ceux qui le valent", "RottenChunk": "Ça a l'air bon !", @@ -4557,7 +4588,7 @@ "IceBlade": "Tire un projectile glacial", "IceBow": "Tire des flèches de givre", "FrostStaff": "Tire un flux de givre", - "BlueCultistCasterBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CultistDevote}", + "Jetpack": "{$CommonItemTooltip.FlightAndSlowfall}\nMaintenir HAUT pour s'envoler plus vite", "ButterflyWings": "{$CommonItemTooltip.FlightAndSlowfall}", "FallenStar": "Disparaît après le lever du soleil", "Seaweed": "Invoque un familier tortue", @@ -4588,14 +4619,14 @@ "GreenWrench": "Place du câble vert", "BluePressurePlate": "S'active quand un joueur marche dessus", "YellowPressurePlate": "S'active quand tout sauf un joueur marche dessus", - "FrozenCrate": "{$CommonItemTooltip.RightClickToOpen}", + "DiscountCard": "Les boutiques font des réductions", "LuckyCoin": "Frapper des ennemis rapporte parfois des pièces en plus", "UnicornonaStick": "Qu'est-ce qu'on s'amuse !", "SandstorminaBottle": "Permet de faire un double saut si équipée", - "CanOfWorms": "{$CommonItemTooltip.RightClickToOpen}", + "CharmofMyths": "Régénère la santé et réduit le temps de recharge des potions de soin", "MoonShell": "Transforme en loup-garou la nuit et en sirène ou triton au contact de l'eau si équipé", "StarVeil": "Fait tomber des étoiles et augmente la durée d'invincibilité après avoir subi des dégâts", - "BloodyMoscato": "{$CommonItemTooltip.MinorStats}", + "WaterWalkingBoots": "Permet de marcher sur l'eau", "MiningHelmet": "Donne de la lumière lorsqu'il est équipé", "AdhesiveBandage": "Immunité contre le saignement", "ArmorPolish": "Immunité contre l'armure cassée", @@ -4606,28 +4637,28 @@ "Nazar": "Immunité contre les malédictions", "Vitamins": "Immunité contre la faiblesse", "TrifoldMap": "Immunité contre la confusion", - "Lemon": "{$CommonItemTooltip.MinorStats}", - "TropicalSmoothie": "{$CommonItemTooltip.MinorStats}", - "PinaColada": "{$CommonItemTooltip.MinorStats}", - "PeachSangria": "{$CommonItemTooltip.MinorStats}", + "PowerGlove": "Augmente le recul en corps à corps\n+12 % de vitesse au corps à corps", + "LightningBoots": "Permettent de voler\nLe porteur peut courir incroyablement vite", + "SunStone": "Augmente toutes les stats si équipée de jour", + "MoonStone": "Augmente toutes les stats si équipée de nuit", "ArmorBracing": "Immunité contre la faiblesse et l'armure cassée", "MedicatedBandage": "Immunité contre le poison et le saignement", "ThePlan": "Immunité contre le ralentissement et la confusion", "CountercurseMantra": "Immunité contre le silence et la malédiction", "CoinGun": "Les munitions sont des pièces\nLes pièces de valeur plus élevée font plus de dégâts", "LavaCharm": "7 secondes d'immunité contre la lave", - "BananaDaiquiri": "{$CommonItemTooltip.MinorStats}", - "Pineapple": "{$CommonItemTooltip.MinorStats}", + "ObsidianWaterWalkingBoots": "Permettent de marcher sur l'eau\nImmunisent contre les blocs de feu", + "LavaWaders": "Permettent de marcher sur l'eau et la lave\nImmunisent contre les blocs de feu et immunisent pendant 7 secondes à la lave", "BoneWand": "Place des os", "LeafWand": "Place des feuilles", "FlyingCarpet": "Permet à qui le possède de voler quelques secondes", "AvengerEmblem": "+12 % de dégâts", - "Lemonade": "{$CommonItemTooltip.MinorStats}", + "MechanicalGlove": "Augmente le recul au corps à corps\n+12 % de dégâts et de vitesse de déplacement", "LandMine": "Explose quand on marche dessus", - "Starfruit": "{$CommonItemTooltip.MediumStats}", + "PaladinsShield": "Absorbe 25 % des dégâts infligés à un joueur de votre équipe\nActif uniquement à un niveau de santé supérieur à 25 %", "Umbrella": "Vous tomberez plus lentement en le tenant", "ChlorophyteOre": "Réagit à la lumière", - "GrapeJuice": "{$CommonItemTooltip.MajorStats}", + "SteampunkWings": "Permet de voler et de ralentir la chute", "IceSkates": "Permet de mieux se déplacer sur la glace\nLa glace ne se cassera pas quand vous tomberez dessus", "SnowballLauncher": "Lance rapidement des boules de neige", "ClimbingClaws": "Permettent de descendre les murs en glissant\nCapacité améliorée si combinées avec les chaussures à pointes", @@ -4644,7 +4675,7 @@ "Campfire": "Régénération de santé augmentée près d'un feu de camp", "Marshmallow": "Faites-en une brochette à faire griller au feu de camp", "MarshmallowonaStick": "Faites-les griller au feu de camp !", - "Coconut": "{$CommonItemTooltip.MinorStats}", + "CookedMarshmallow": "{$CommonItemTooltip.MinorStats}", "ShoeSpikes": "Permettent de descendre les murs en glissant\nCapacité améliorée si combinées avec les griffes d'escalade", "TigerClimbingGear": "Permet d'escalader les murs", "Tabi": "Permet de foncer\nTouchez deux fois une direction", @@ -4660,19 +4691,19 @@ "EatersBone": "Invoque un Petit Dévoreur d'âmes", "BlendOMatic": "Sert à fabriquer des objets", "MeatGrinder": "Sert à fabriquer des objets", - "Rambutan": "{$CommonItemTooltip.MinorStats}", + "Extractinator": "Transforme la vase, la gadoue et les fossiles en quelque chose de plus utile\nPour l'utiliser, placer la vase, la gadoue ou les fossiles dans l'extractinateur", "Solidifier": "Sert à fabriquer des objets", "ActuationAccessory": "Place automatiquement des actionneurs sur des objets placés", "ActuationRod": "Active des actionneurs", "AlchemyTable": "33 % de chances de ne pas consommer d'ingrédients de potion", "AncientBattleArmorHat": "+15 % de dégâts magiques et de sbires", - "AppleJuice": "{$CommonItemTooltip.MinorStats}", - "WoodenCrateHard": "{$ItemTooltip.WoodenCrate}", + "AncientBattleArmorPants": "Augmente votre nombre maximal de sbires", + "AncientBattleArmorShirt": "+80 points de mana max", "AncientHorn": "Invoque une monture basilic", - "BloodNautilusBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodNautilus}", - "GoblinSharkBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.GoblinShark}", + "AnglerTackleBag": "La canne à pêche ne se cassera jamais, réduit les chances de consommer les appâts, augmente les compétences de pêche", + "ArchitectGizmoPack": "Augmente la vitesse et la portée du placement de murs\nPeint automatiquement les objets placés", "AviatorSunglasses": "Fait ressortir l'aviateur en vous\nSuper pour prétendre que vous faites des vidéos", - "KitePigron": "{$CommonItemTooltip.Kite}", + "Bacon": "{$CommonItemTooltip.MinorStats}\n Bacon ? Vous avez dit bacon ?", "BalloonHorseshoeFart": "Permet de faire un double saut si équipé\nPermet de sauter plus haut et annule les dégâts de chute", "BalloonHorseshoeHoney": "Libère des abeilles quand il est endommagé\nPermet de sauter plus haut et annule les dégâts de chute", "BalloonHorseshoeSharkron": "Permet de faire un double saut si équipé\nPermet de sauter plus haut et annule les dégâts de chute", @@ -4680,26 +4711,26 @@ "BeesKnees": "Les flèches en bois se transforment en une colonne d'abeilles", "BejeweledValkyrieBody": "{$CommonItemTooltip.DevItem}\nParée de bijoux et super chic pour s'envoler dans le ciel orageux", "BejeweledValkyrieHead": "{$CommonItemTooltip.DevItem}\nDevenez le vent, chevauchez les éclairs", - "BloodEelBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodEelHead}", + "BejeweledValkyrieWing": "{$CommonItemTooltip.DevItem}\nLa plateforme protectrice du satellite des Valkyries est sécurisée. La plupart du temps.", "BewitchingTable": " pour obtenir plus de sbires", "Bladetongue": "Crache un flot d'ichor au contact", "BlessedApple": "Invoque une monture licorne", - "CorruptFishingCrateHard": "{$ItemTooltip.CorruptFishingCrate}", - "JungleFishingCrateHard": "{$ItemTooltip.JungleFishingCrate}", + "BloodWater": "Étend le carmin à certains blocs", + "BombFish": "Une petite explosion qui détruira quelques tuiles", "BoneCampfire": "Régénération de santé augmentée près d'un feu de camp", "BoneRattle": "Invoque un petit monstre grimaçant", "BoneTorch": "Émet une lueur mortelle", "BoosterTrack": "Un coup de marteau pour changer de direction", - "GolfClubPutter": "{$CommonItemTooltip.GolfPutter}", - "HallowedFishingCrateHard": "{$ItemTooltip.HallowedFishingCrate}", - "KiteRedAndYellow": "{$CommonItemTooltip.Kite}", + "BottomlessBucket": "Contient un volume d'eau infini", + "BouncyBomb": "Une petite explosion qui détruira quelques tuiles\nRebondit beaucoup", + "BouncyDynamite": "Ceci s'avèrera être une idée terrible", "BouncyGlowstick": "Fonctionne même mouillé", "BouncyGrenade": "Une petite explosion qui ne détruira pas de tuiles\nRebondit beaucoup", - "WillsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "BrainOfConfusion": "Les ennemis à proximité peuvent être confus s'ils sont touchés", "BrainScrambler": "Invoque une monture Scutlix", "BubbleGun": "Tire rapidement des bulles puissantes", "ButchersChainsaw": "Étincelles émises par les ennemis touchés", - "BloodSquidBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodSquid}", + "CelestialShell": "Transforme en loup-garou la nuit et en sirène ou triton au contact de l'eau si équipé\nAugmente légèrement toutes les stats", "CelestialSigil": "Invoque l'Apocalypse", "CellPhone": "Affiche tout\nVous permet de rentrer chez vous quand vous voulez", "ClingerStaff": "Invoque un mur de flammes maudites", @@ -4733,9 +4764,9 @@ "FloatingIslandFishingCrate": "{$CommonItemTooltip.RightClickToOpen}", "FlowerBoots": "Des fleurs poussent sur l'herbe que vous foulez", "FlyingKnife": "Lance un couteau volant contrôlable", - "GolfBallDyedBrown": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedBlue": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedBlack": "{$CommonItemTooltip.GolfBall}", + "FossilHelm": "+20 % de rapidité de lancer", + "FossilPants": "+15 % de chances de coup critique au lancer", + "FossilShirt": "+20 % de dégâts de lancer", "FragmentNebula": "Le pouvoir de la galaxie réside dans ce fragment", "FragmentSolar": "La furie de l'univers est à l'intérieur de ce fragment", "FragmentStardust": "Des particules enchanteresses tournent autour de ce fragment", @@ -4752,8 +4783,8 @@ "GoblinTech": "Affiche la vitesse de déplacement, les dégâts par seconde et les minerais précieux", "GoldPickaxe": "Peut extraire des météorites", "GoldRing": "Augmente la portée de récolte de pièces", - "Plum": "{$CommonItemTooltip.MinorStats}", - "KiteBunny": "{$CommonItemTooltip.Kite}", + "GreedyRing": "Augmente la portée de récolte des pièces et les boutiques font des réductions\nFrapper les ennemis peut parfois rapporter des pièces", + "GrubSoup": "{$CommonItemTooltip.MinorStats}", "HallowedFishingCrate": "{$CommonItemTooltip.RightClickToOpen}", "HardySaddle": "Invoque une tortue à chevaucher", "HellwingBow": "Les flèches en bois deviennent des chauves-souris enflammées", @@ -4762,7 +4793,7 @@ "HoneyedGoggles": "Invoque une abeille à chevaucher", "IceMirror": "Regardez le miroir pour rentrer chez vous", "IchorCampfire": "Régénération de santé augmentée près d'un feu de camp", - "EyeballFlyingFishBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.EyeballFlyingFish}", + "JimsWings": "{$CommonItemTooltip.DevItem}", "JungleFishingCrate": "{$CommonItemTooltip.RightClickToOpen}", "LargeAmber": "Pour « Attraper la gemme ». Elle tombe quand vous mourez.", "LaserRuler": "Crée des lignes de mesure sur l'écran pour placer les blocs", @@ -4790,7 +4821,7 @@ "LokisHelm": "{$CommonItemTooltip.DevItem}\nLe désordre vint de l'ordre, la peur vint du courage, la faiblesse vint de la force", "LokisPants": "{$CommonItemTooltip.DevItem}\nLa justice est lente, mais efficace", "LokisShirt": "{$CommonItemTooltip.DevItem}\nConnaissez-vous vous-même, ainsi que votre ennemi. Mille batailles, mille victoires…", - "ZombieMermanBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.ZombieMerman}", + "LokisWings": "{$CommonItemTooltip.DevItem}\nQue vos plans soient aussi obscurs et impénétrables que la nuit, et lorsque vous avancez, tombez comme une éclair.", "LunarBar": "Il vibre d'une énergie céleste lumineuse", "LunarCraftingStation": "Sert à fabriquer des objets à partir de fragments lunaires et de luminite", "LunarFlareBook": "Pleut des lueurs lunaires vives", @@ -4806,7 +4837,7 @@ "MoneyTrough": "Invoque une tirelire volante pour stocker vos objets", "MoonlordArrow": "Ils les fait tomber plus vite que la lumière !", "MoonlordBullet": "Alignez-les pour tous les dégommer !", - "Apricot": "{$CommonItemTooltip.MinorStats}", + "MoonlordTurretStaff": "Invoque un portail lunaire pour tirer au laser sur vos ennemis", "MothronWings": "{$CommonItemTooltip.FlightAndSlowfall}", "MulticolorWrench": " en maintenant pour modifier les paramètres de câbles", "NebulaArcanum": "Fait apparaître des masses d'énergie astrale pour pourchasser vos ennemis", @@ -4817,9 +4848,9 @@ "NebulaMonolith": "Exerce une petite quantité de pouvoir de la tour nébuleuse", "NightKey": "Chargée de l'essence de nombreuses âmes", "NightVisionHelmet": "Améliore la vision", - "GolfBallDyedLimeGreen": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedGreen": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedCyan": "{$CommonItemTooltip.GolfBall}", + "NinjaHood": "+15 % de vitesse de lancer", + "NinjaPants": "+10 % de chances de coup critique au lancer", + "NinjaShirt": "+15 % de dégâts de lancer", "PartyBundleOfBalloonTile": "Attachés pour le plaisir de tous", "PartyGirlGrenade": "Une petite explosion qui ne détruira pas de tuiles", "PartyMonolith": "Les ballons tomberont du ciel", @@ -4841,10 +4872,10 @@ "ProjectilePressurePad": "S'active quand un projectile le touche", "PsychoKnife": "Vous permet de passer en mode furtif", "PutridScent": "Les ennemis sont moins susceptibles de vous viser\n+5 % de dégâts et de chances de coup critique", - "GolfBallDyedYellow": "{$CommonItemTooltip.GolfBall}", + "QueenSpiderStaff": "Invoque une reine-araignée pour cracher des œufs à vos ennemis", "Radar": "Détecte les ennemis autour de vous", "RainbowCampfire": "Régénération de santé augmentée près d'un feu de camp", - "GolfBallDyedViolet": "{$CommonItemTooltip.GolfBall}", + "RainbowCrystalStaff": "Invoque un cristal rayonnant qui bannit vos ennemis\nLes couleurs, Duc, regardez !", "RazorbladeTyphoon": "Lance des roues acérées rapides", "RedsYoyo": "{$CommonItemTooltip.DevItem}", "REK": "Affiche le nombre de monstres, le compte d'ennemis tués et les créatures rares", @@ -4875,30 +4906,30 @@ "SkiphsHelm": "{$CommonItemTooltip.DevItem}", "SkiphsPants": "{$CommonItemTooltip.DevItem}", "SkiphsShirt": "{$CommonItemTooltip.DevItem}", - "TheBrideBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.TheBride}", - "DTownsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "SkiphsWings": "{$CommonItemTooltip.DevItem}", + "SliceOfCake": "Mangez tout. Donnez tout à quelqu'un. Peu importe.", "SlimeGun": "Asperge un jet inoffensif de gelée", "SlimySaddle": "Invoque une gelée à chevaucher", - "KiteKoi": "{$CommonItemTooltip.Kite}", + "SnowCloudBlock": "Il y fait assez froid là-haut", "SnowFallBlock": "Bien plus cool qu'une boule à neige", "SnowFallWall": "Bien plus cool qu'une boule à neige", "SolarEruption": "Attaquez avec la furie du soleil", - "RedsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", - "Hoverboard": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", - "CenxsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "SolarFlareBreastplate": "+22 % de dégâts au corps à corps\nLes ennemis sont plus susceptibles de vous viser", + "SolarFlareHelmet": "+7 % de chances de coup critique au corps à corps\nLes ennemis sont plus susceptibles de vous viser", + "SolarFlareLeggings": "+15 % de vitesse de mouvement et au corps à corps\nLes ennemis sont plus susceptibles de vous viser", "SolarMonolith": "Exerce une petite quantité de pouvoir de la tour solaire", "SolarTablet": "Invoque l'Éclipse", "SoulDrain": "Aspire la santé des ennemis", "SpelunkerGlowstick": "Expose les trésors à proximité", "SpiderStaff": "Invoque des araignées pour combattre à vos côtés", "SporeSac": "Invoque des spores qui infligeront des dégâts aux ennemis avec le temps", - "GolfClubChlorophyteDriver": "{$CommonItemTooltip.GolfDriver}", + "StardustBreastplate": "Augmente votre nombre maximal de sbires\n+22 % de dégâts de sbires", "StardustCellStaff": "Invoque une cellule astrale pour combattre à vos côtés\nPour cultiver la plus belle des infections cellulaires", "StardustDragonStaff": "Invoque un dragon astral pour combattre à vos côtés\nQui veut une horde de sbires quand on peut avoir un dragon géant ?", - "GolfClubDiamondWedge": "{$CommonItemTooltip.GolfWedge}", - "GolfClubShroomitePutter": "{$CommonItemTooltip.GolfPutter}", + "StardustHelmet": "Augmente votre nombre maximal de sbires\n+22 % de dégâts de sbires", + "StardustLeggings": "Augmente votre nombre maximal de sbires\n+22 % de dégâts de sbires", "StardustMonolith": "Exerce une petite quantité de pouvoir de la tour astrale", - "FloatingIslandFishingCrateHard": "{$ItemTooltip.FloatingIslandFishingCrate}", + "StickyDynamite": "Le lancer peut s'avérer difficile", "StickyGrenade": "Une petite explosion qui ne détruira pas de tuiles\nLe lancer peut s'avérer difficile", "Stopwatch": "Affiche la vitesse de déplacement du joueur", "StrangeBrew": "Ça a l'air horrible et ça pue", @@ -4921,7 +4952,7 @@ "TungstenPickaxe": "Peut extraire des météorites", "UltraBrightCampfire": "Régénération de santé augmentée près d'un feu de camp", "ValkyrieYoyo": "{$CommonItemTooltip.DevItem}", - "BlackCurrant": "{$CommonItemTooltip.MinorStats}", + "ViciousPowder": "Bannit le sacré", "VineRopeCoil": "À lancer pour créer une corde de lianes à escalader", "VortexBeater": "66 % de chances de ne pas utiliser de munitions\nLe mélange catastrophique de fusil et d'explosifs.", "VortexBreastplate": "+12 % de dégâts magiques et de chances de coup critique\n25 % chances de ne pas utiliser de munitions", @@ -4935,10 +4966,10 @@ "WeightedPressurePlateOrange": "S'active quand un joueur marche dessus ou en descend", "WeightedPressurePlatePink": "S'active quand un joueur marche dessus ou en descend", "WeightedPressurePlatePurple": "S'active quand un joueur marche dessus ou en descend", - "Peach": "{$CommonItemTooltip.MinorStats}", + "WingsNebula": "{$CommonItemTooltip.FlightAndSlowfall}", "WingsSolar": "{$CommonItemTooltip.FlightAndSlowfall}", "WingsStardust": "{$CommonItemTooltip.FlightAndSlowfall}", - "GolfClubTitaniumIron": "{$CommonItemTooltip.GolfIron}", + "WingsVortex": "{$CommonItemTooltip.FlightAndSlowfall}", "WireBulb": "Allume des ampoules pour chaque couleur de câbles", "WireKite": "Permet un contrôle ultime des câbles !\n en tenant pour modifier les paramètres de câbles", "WirePipe": "Sépare les chemins de câble\nSensible au marteau !", @@ -4950,7 +4981,7 @@ "Yoraiz0rHead": "{$CommonItemTooltip.DevItem}", "Yoraiz0rPants": "{$CommonItemTooltip.DevItem}", "Yoraiz0rShirt": "{$CommonItemTooltip.DevItem}", - "GolfClubPearlwoodDriver": "{$CommonItemTooltip.GolfDriver}", + "Yoraiz0rWings": "{$CommonItemTooltip.DevItem}\nPeu importe ce que cet accessoire vous fait, ce n'est pas un bug !", "YoyoBag": "Donne des compétences expertes en yoyo si équipé", "YoYoGlove": "Permet d'utiliser deux yoyos en même temps", "BloodMoonRising": "{$PaintingArtist.Garner}", @@ -5148,7 +5179,7 @@ "BlackSlimeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BlackSlime}", "BlueArmoredBonesBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BlueArmoredBones}", "BlueCultistArcherBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CultistArcherBlue}", - "SkiphsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "BlueCultistCasterBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.None}", "BlueCultistFighterBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.None}", "BoneLeeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BoneLee}", "ClingerBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.Clinger}", @@ -5402,22 +5433,22 @@ "ApprenticeScarf": "{$ItemTooltip.HuntressBuckler}", "SquireShield": "{$ItemTooltip.HuntressBuckler}", "MonkBelt": "{$ItemTooltip.HuntressBuckler}", - "GolfClubStoneIron": "{$CommonItemTooltip.GolfIron}", + "ApprenticeAltHead": "Augmente votre nombre maximal de sentinelles\n+10 % de dégâts des sbires et magiques", "ApprenticeAltPants": "+20 % de dégâts des sbires et +25 % de chances de coup critique magique", "ApprenticeAltShirt": "+30 % de dégâts des sbires et +15 % de chances de coup critique magique", - "GolfClubGoldWedge": "{$CommonItemTooltip.GolfWedge}", + "ApprenticeHat": "Augmente votre nombre max de sentinelles et -10 % de coûts de mana", "ApprenticeRobe": "+20 % de dégâts des sbires et +10 % de dégâts magiques", "ApprenticeStaffT3": "Éclabousse du miasme qui affaiblit la défense !", - "GoldenCrateHard": "{$ItemTooltip.GoldenCrate}", + "ApprenticeTrousers": "+10 % de dégâts des sbires et +20 % de vitesse de déplacement", "BookStaff": "C'est à se demander qui a mis un tome de sagesse infinie sur un bâton...\n pour lancer une tornade puissante", - "GolfBallDyedSkyBlue": "{$CommonItemTooltip.GolfBall}", + "DD2BallistraTowerT1Popper": "Une tour lente, mais haute qui tire des flèches perçantes\n{$CommonItemTooltip.EtherianManaCost10}", "DD2BetsyBow": "Tire des flèches qui se dédoublent, infligent plus de dégâts aux ennemis volants", "DD2ElderCrystal": "Placez-le sur le support du cristal Eternia pour invoquer des portails d'Etheria", "DD2ElderCrystalStand": "Supporte le cristal Eternia", "DD2EnergyCrystal": "Souvent utilisée pour manifester une volonté sous une forme physique de défense", - "GolfBallDyedRed": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedTeal": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedPurple": "{$CommonItemTooltip.GolfBall}", + "DD2ExplosiveTrapT1Popper": "Un piège qui explose quand les ennemis s'approchent\n{$CommonItemTooltip.EtherianManaCost10}", + "DD2FlameburstTowerT1Popper": "Une tour à vitesse moyenne qui tire des boules de feu explosives\n{$CommonItemTooltip.EtherianManaCost10}", + "DD2LightningAuraT1Popper": "Une aura qui inflige des dégâts répétés aux ennemis qui la pénètrent\n{$CommonItemTooltip.EtherianManaCost10}", "DD2PetDragon": "Invoque un familier dragon", "DD2PetGato": "Invoque un familier gato", "DD2PetGhost": "Invoque un familier allumèche pour donner de la lumière", @@ -5425,77 +5456,47 @@ "DD2SquireBetsySword": "Libère l'énergie du cœur droit devant", "DD2SquireDemonSword": " pour protéger avec un bouclier", "DefenderMedal": "Devise à échanger avec le tavernier", - "ShuckedOyster": "{$CommonItemTooltip.MinorStats}", + "HuntressAltHead": "Augmente votre nombre maximal de sentinelles\n+10 % de dégât des sbires et de chances de coup critique à distance", "HuntressAltPants": "+25 % de dégâts des sbires et +20 % de vitesse de déplacement", "HuntressAltShirt": "+25 % de dégâts des sbires et à distance", - "GolfClubBronzeWedge": "{$CommonItemTooltip.GolfWedge}", + "HuntressBuckler": "Augmente votre nombre maximal de sentinelles\n+10 % de dégâts des sbires", "HuntressJerkin": "+20 % de dégâts des sbires et à distance", "HuntressPants": "+10 % de dégâts des sbires et +20 % de vitesse de déplacement", - "GolfClubWoodDriver": "{$CommonItemTooltip.GolfDriver}", - "Oyster": "{$CommonItemTooltip.RightClickToOpen}", + "HuntressWig": "Augmente votre nombre maximal de sentinelles et +10 % de chances de coup critique à distance", + "MonkAltHead": "Augmente votre nombre maximal de sentinelles et +20 % de dégâts au corps à corps et des sbires", "MonkAltPants": "+20 % de dégâts des sbires, de vitesse de déplacement et chances de coup critique au corps à corps", "MonkAltShirt": "+20 % de dégâts des sbires et de vitesse au corps à corps", - "GolfClubMythrilIron": "{$CommonItemTooltip.GolfIron}", + "MonkBrows": "Augmente votre nombre maximal de sentinelles et +20 % de vitesse d'attaques au corps à corps", "MonkPants": "+10 % de dégâts des sbires,\n+10 % de chances de coup critique et +20 % de vitesse de déplacement", "MonkShirt": "+20 % de dégâts des sbires et de dégâts au corps à corps", "MonkStaffT1": "Charge de la puissance en se balançant pour écraser les ennemis", "MonkStaffT2": "Invoque des fantômes en touchant les ennemis", "MonkStaffT3": " en tenant l'arme pour une attaque alternative !", - "GolfClubRustyPutter": "{$CommonItemTooltip.GolfPutter}", - "IronCrateHard": "{$ItemTooltip.IronCrate}", + "SquireAltHead": "Augmente votre nombre maximal de sentinelles et +10 % de dégâts des sbires", + "SquireAltPants": "+20 % de dégâts des sbires, de chances de coup critique et +30 % de vitesse de déplacement", "SquireAltShirt": "+30 % de dégâts des sbires et augmente énormément la régénération de santé", - "GolfClubLeadPutter": "{$CommonItemTooltip.GolfPutter}", + "SquireGreatHelm": "Augmente votre nombre maximal de sentinelles et la régénération de santé", "SquireGreaves": "+15 % de dégâts des sbires, +20 % de chances de coup critique au corps à corps et de vitesse de déplacement", "SquirePlating": "+15 % de dégâts des sbires et de dégâts au corps à corps", "ArkhalisShirt": "{$ItemTooltip.ArkhalisHat}", "ArkhalisPants": "{$ItemTooltip.ArkhalisHat}", - "LobsterTail": "{$CommonItemTooltip.MediumStats}", + "ArkhalisWings": "{$ItemTooltip.ArkhalisHat}", "ArkhalisHat": "{$CommonItemTooltip.DevItem}\n'Ça ne vient pas de la grille'", "LeinforsHat": "{$CommonItemTooltip.DevItem}\n'Pour que ces jolies boucles restent magnifiques'", "LeinforsShirt": "{$CommonItemTooltip.DevItem}\n'Pour remettre le sexy à la mode'", "LeinforsPants": "{$CommonItemTooltip.DevItem}\n'Surprise de Shia ! C'est un pantalon incroyable, n'est-ce pas ?'", - "OceanCrateHard": "{$CommonItemTooltip.RightClickToOpen}", - "LeinforsAccessory": "{$CommonItemTooltip.DevItem}\n'Pour de meilleurs résultats, faites un régime à base de pâtes'", - "KiteSpectrum": "{$CommonItemTooltip.Kite}", - "KiteWanderingEye": "{$CommonItemTooltip.Kite}", - "KiteUnicorn": "{$CommonItemTooltip.Kite}", - "FairyQueenBossBag": "{$CommonItemTooltip.RightClickToOpen}", - "LavaCrate": "{$CommonItemTooltip.RightClickToOpen}", - "LavaCrateHard": "{$CommonItemTooltip.RightClickToOpen}", - "HotlineFishingHook": "{$CommonItemTooltip.LavaFishing}", - "LavaFishingHook": "{$CommonItemTooltip.LavaFishing}", - "TeleportationPylonJungle": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonPurity": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonHallow": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonUnderground": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonOcean": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonDesert": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonSnow": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonMushroom": "{$CommonItemTooltip.TeleportationPylon}", - "RockGolemBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.RockGolem}", - "BloodMummyBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodMummy}", - "SporeSkeletonBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.SporeSkeleton}", - "SporeBatBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.SporeBat}", - "LarvaeAntlionBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.LarvaeAntlion}", - "CrimsonBunnyBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CrimsonBunny}", - "CrimsonGoldfishBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CrimsonGoldfish}", - "CrimsonPenguinBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CrimsonPenguin}", - "BigMimicCorruptionBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BigMimicCorruption}", - "BigMimicCrimsonBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BigMimicCrimson}", - "BigMimicHallowBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BigMimicHallow}", - "MossHornetBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.MossHornet}", - "WanderingEyeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.WanderingEye}", - "CreativeWings": "{$CommonItemTooltip.FlightAndSlowfall}", - "RainbowWings": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressUpToBooster}", - "LongRainbowTrailWings": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}\n{$CommonItemTooltip.PressUpToBooster}" + "LeinforsWings": "{$CommonItemTooltip.DevItem}\n'C'est intense ! Qu'est-ce que ça veut dire ?!'", + "LeinforsAccessory": "{$CommonItemTooltip.DevItem}\n'Pour de meilleurs résultats, faites un régime à base de pâtes'" }, "CommonItemTooltip": { "SpecialCrafting": "Utilisée pour l'artisanat spécial", "DevItem": "Super pour se faire passer pour les développeurs !", "FlightAndSlowfall": "Permettent de voler et ralentissent la chute", "RightClickToOpen": " pour ouvrir", + "MinorStats": "Améliore légèrement toutes les stats", "BannerBonus": "Les joueurs à proximité obtiennent un bonus contre : ", "Counterweight": "Lance un contrepoids après avoir touché un ennemi avec un yoyo", + "EtherianManaCost10": "Utilisez 10 points de mana d'Etheria pour invoquer plus d'une", "MinuteDuration": "{0} minutes", "PlaceableOnXmasTree": "Peut se placer sur un sapin de Noël", "RestoresLife": "Restaure {0} points de santé", diff --git a/Localization/Content/fr-FR/Legacy.json b/Localization/Content/fr-FR/Legacy.json index 6c59d2c..1d0b9f2 100644 --- a/Localization/Content/fr-FR/Legacy.json +++ b/Localization/Content/fr-FR/Legacy.json @@ -33,6 +33,7 @@ "37": "Répartition de l'herbe", "38": "Culture de cactus", "39": "Plantation de tournesols", + "3": "Placement de terre sous la terre", "40": "Plantation d'arbres", "41": "Plantation d'herbes", "42": "Plantation de mauvaises herbes", @@ -72,8 +73,10 @@ "73": "Validation de la sauvegarde du monde :", "74": "De la gelée tombe du ciel !", "75": "La gelée a arrêté de tomber du ciel !", + "76": "Génération de structures.", "77": "Ajout d'herbe", "78": "Désertification", + "79": "Assaisonnement des murs", "7": "Création de trous aléatoires", "80": "Sculpture de marbre", "81": "Création de granite", @@ -159,6 +162,7 @@ "167": "Achète toujours du câble en plus !", "168": "As-tu vérifié que tes appareils étaient branchés ?", "169": "Oh, tu sais ce qu'il faut à cette maison ? Plus de lumières clignotantes.", + "17": "Ne perds pas l'objectif de vue, achète des lentilles !", "170": "On sait que c'est une lune de sang quand le ciel devient rouge. Et les monstres pullulent.", "171": "Hé, sais-tu où je peux trouver des herbes de la mort ? Je me demandais, c'est tout.", "172": "Si tu regardais le ciel, tu verrais que la lune est rouge.", @@ -177,8 +181,11 @@ "184": "Maintenant que tu as du minerai, fais-en un lingot à utiliser pour créer des objets. Il te faudra un four !", "185": "Fabrique un four avec des torches, du bois et de la pierre. Tu dois être à côté d'un établi.", "186": "Une enclume te permettra de fabriquer la plupart des objets à partir de lingots de métal.", + "187": "Fabrique les enclumes avec du fer ou achète-les auprès d'un marchand.", "188": "Le souterrain contient des cœurs de cristal qui servent à augmenter ton niveau de santé maximal. Tu peux les briser d'un coup de pioche.", + "189": "Si tu récupères 5 étoiles filantes, elles peuvent créer un objet qui augmentera ta capacité magique.", "19": "{PlayerName}, c'est bien cela ? J'ai entendu de bonnes choses à ton sujet !", + "190": "Les étoiles tombent partout dans le monde la nuit. Elles peuvent servir à beaucoup de choses très utiles. Si tu en vois une, ramasse-la sans hésiter, car elles disparaissent au lever du soleil.", "191": "Il existe différentes façons d'attirer des individus pour qu'ils s'installent dans ton village. Bien entendu, ils auront besoin de vivre dans une maison.", "192": "Pour qu'une pièce soit considérée comme une maison, il lui faut une porte, une chaise, une table et une source de lumière. Il faut également qu'il y ait des murs.", "193": "Deux personnes ne peuvent pas vivre dans la même maison. De surcroît, si leur maison est détruite, ils chercheront un nouvel endroit où vivre.", @@ -197,6 +204,7 @@ "204": "Si tu combines des lentilles à un autel démoniaque, tu pourrais trouver le moyen d'invoquer un monstre puissant. Mais attends que la nuit tombe avant de l'utiliser.", "205": "Crée des appâts à ver avec des morceaux avariés et de la poudre infecte. Va dans une zone corrompue avant de l'utiliser.", "206": "Les autels démoniaques se trouvent généralement dans la corruption. Place-toi à côté de ceux-ci pour fabriquer certains objets.", + "207": "Fabrique un grappin avec un crochet et trois chaînes. Les squelettes trouvés dans le souterrain transportent en général des crochets, et les chaînes se fabriquent à partir de lingots de fer.", "208": "Si tu vois une jarre, brise-la. Elles contiennent toutes sortes d'objets utiles.", "209": "Il y a des trésors cachés partout dans le monde. Tu trouveras des objets incroyables au fond des souterrains !", "21": "Une statue d'ange, dis-tu ? Désolé, je ne vends pas de camelote.", @@ -402,6 +410,7 @@ "400": "Tu mendies déjà ? Ne me regarde pas comme si j'allais changer d'avis du jour au lendemain ! ", "401": "Brise tous les autels carmin sur ta route. Quelque chose de positif devrait se produire !", "402": "Les autels carmin se trouvent généralement dans les zones carmin. Place-toi à côté de ceux-ci pour fabriquer certains objets.", + "403": "Tu peux créer une colonne sanglante avec des vertèbres. Tu dois être dans une zone carmin avant de l'utiliser.", "41": "Arrête de te plaindre ! J'ai vu pire.", "42": "Il va falloir recoudre !", "43": "Encore des soucis avec des brutes ?", @@ -435,6 +444,7 @@ "69": "As-tu essayé la poudre de purification sur la pierre d'ébène de la corruption ?", "7": "La nuit va bientôt tomber. Fais ton choix tant qu'il est encore temps.", "70": "Si seulement {ArmsDealer} arrêtait de me draguer. Ne réalise-t-il pas que j'ai 500 ans ?", + "71": "Pourquoi {Merchant} essaie-t-il constamment de me vendre des statues d'ange ? Tout le monde sait qu'elles ne servent à rien.", "72": "As-tu vu le vieil homme qui marche autour du donjon ? Il n'a pas l'air d'aller bien...", "73": "Je vends ce que je veux ! Si ça ne te plaît pas, tant pis.", "74": "Pourquoi cherches-tu la confrontation dans un moment pareil ?", @@ -595,6 +605,7 @@ "213": "Priorité du curseur intelligent : pioche -> hache", "214": "Priorité du curseur intelligent : hache -> pioche", "215": "Placement intelligent de blocs : sur le curseur", + "216": "Placement intelligent de blocs : remplissage", "217": "Couleur de bordure", "218": "Curseur", "219": "Commandes", @@ -639,7 +650,10 @@ "26": "Facile", "27": "Aléatoire", "28": "Créer", + "29": "Les personnages en mode difficile meurent pour de bon", "2": "Déconnecter", + "30": "Les personnages en difficulté moyenne perdent des objets en mourant", + "31": "Les personnages en difficulté facile perdent de l'argent en mourant", "32": "Sélectionner la difficulté", "33": "Chemise", "34": "Maillot", @@ -790,6 +804,7 @@ "17": "{0} a rejoint l'équipe jaune.", "18": "Bienvenue dans", "19": "{0} s'est connecté-e.", + "1": "Mot de passe incorrect.", "20": "{0} est parti-e.", "21": "/joueurs", "22": "{0} a rejoint l'équipe rose.", @@ -888,6 +903,7 @@ "82": "Retour", "83": "Favoris", "84": "Vous ne pouvez pas changer d'équipe dans les blocs de votre équipe !", + "85": "Insecte", "86": "Canard", "87": "Papillon", "88": "Luciole", @@ -1035,6 +1051,7 @@ "LegacyChestType": { "0": "Coffre", "10": "Coffre de lierre", + "11": "Coffre de glace", "12": "Coffre en bois vivant", "13": "Coffre céleste", "14": "Coffre en bois d'ombre", @@ -1046,10 +1063,12 @@ "1": "Coffre en or", "20": "Coffre carmin", "21": "Coffre sacré", + "22": "Coffre gelé", "23": "Coffre de la jungle verrouillé ", "24": "Coffre de la corruption verrouillé ", "25": "Coffre carmin verrouillé ", "26": "Coffre sacré verrouillé ", + "27": "Coffre gelé verrouillé ", "28": "Coffre en dynastie", "29": "Coffre en miel", "2": "Coffre en or verrouillé", @@ -1115,29 +1134,10 @@ "28": "{$ItemName.CrystalDresser}", "29": "{$ItemName.DynastyDresser}", "30": "{$ItemName.FrozenDresser}", - "31": "{$ItemName.LivingWoodDresser}", - "32": "{$ItemName.SpiderDresser}", - "33": "{$ItemName.LesionDresser}", - "34": "{$ItemName.SolarDresser}", - "35": "{$ItemName.VortexDresser}", - "36": "{$ItemName.NebulaDresser}", - "37": "{$ItemName.StardustDresser}", - "38": "{$ItemName.SandstoneDresser}", - "39": "{$ItemName.BambooDresser}" + "31": "{$ItemName.LivingWoodDresser}" }, "LegacyChestType2": { - "1": "{$ItemName.GoldenChest}", - "0": "{$ItemName.CrystalChest}", - "2": "{$ItemName.SpiderChest}", - "3": "{$ItemName.LesionChest}", - "4": "{$ItemName.GoldChest}", - "5": "{$ItemName.SolarChest}", - "6": "{$ItemName.VortexChest}", - "7": "{$ItemName.NebulaChest}", - "8": "{$ItemName.StardustChest}", - "9": "{$ItemName.GolfChest}", - "10": "{$ItemName.DesertChest}", - "11": "{$ItemName.BambooChest}", - "12": "{$ItemName.DungeonDesertChest}" + "0": "Coffre de cristal", + "1": "Coffre doré" } } \ No newline at end of file diff --git a/Localization/Content/fr-FR/NPCs.json b/Localization/Content/fr-FR/NPCs.json index 0de3737..552008a 100644 --- a/Localization/Content/fr-FR/NPCs.json +++ b/Localization/Content/fr-FR/NPCs.json @@ -68,6 +68,7 @@ "Vampire": "Vampire", "MotherSlime": "Mère Gelée", "Truffle": "Truffe", + "ZombieEskimo": "Eskimo zombie", "Frankenstein": "Frankenstein", "BlackRecluse": "Recluse noire", "WallCreeper": "Grimpeur de murs", @@ -308,7 +309,9 @@ "SleepingAngler": "Pêcheur endormi", "Grasshopper": "Sauterelle", "ChatteringTeethBomb": "Bombe à dents qui claquent", + "CultistArcherBlue": "Archer adepte bleu", "Demolitionist": "Démolisseur", + "CultistArcherWhite": "Archer adepte blanc", "BrainScrambler": "Embrouilleur", "RayGunner": "Tireur laser", "MartianOfficer": "Officier martien", @@ -335,6 +338,7 @@ "Hornet": "Frelon", "ManEater": "Croqueuse d'hommes", "ArmedZombie": "Zombie", + "ArmedZombieEskimo": "Eskimo zombie", "ArmedZombiePincussion": "Zombie", "ArmedZombieSlimed": "Zombie", "ArmedZombieSwamp": "Zombie", @@ -424,9 +428,12 @@ "Crawdad": "Crabisse", "Crawdad2": "Crabisse", "CreatureFromTheDeep": "Créature des profondeurs", + "CrimsonBunny": "Lapin de carmitane", + "CrimsonGoldfish": "Poisson doré de carmitane", "CrimsonPenguin": "Manchot cruel", "CultistBoss": "Adepte lunatique", "CultistBossClone": "Adepte lunatique", + "CultistDevote": "Dévot lunatique", "CultistDragonBody1": "Dragon spectre", "CultistDragonBody2": "Dragon spectre", "CultistDragonBody3": "Dragon spectre", @@ -459,7 +466,7 @@ "DuneSplicerHead": "Colleur des dunes", "DuneSplicerTail": "Colleur des dunes", "EnchantedNightcrawler": "Insecte nocturne envoûté", - "GiantFlyingAntlion": "Fourmilion envahisseur", + "FlyingAntlion": "Fourmilion envahisseur", "Fritz": "Fritz", "GiantShelly": "Mollusque géant", "GiantShelly2": "Mollusque géant", @@ -507,6 +514,7 @@ "SandsharkCrimson": "Ravageur de chair", "SandsharkHallow": "Batteur de cristal", "SandSlime": "Gelée des sables", + "ShadowFlameApparition": "Apparition de flamme d'ombre", "SlimeSpiked": "Gelée à pointes", "Sluggy": "Coriace", "SolarFlare": "Lueur solaire", @@ -534,7 +542,7 @@ "VortexLarva": "Larve extraterrestre", "VortexRifleman": "Plongeur d'orage", "VortexSoldier": "Vortexien", - "GiantWalkingAntlion": "Chargeur fourmilion", + "WalkingAntlion": "Chargeur fourmilion", "DD2GoblinBomberT2": "{$NPCName.DD2GoblinBomberT1}", "DD2WyvernT3": "{$NPCName.DD2WyvernT1}", "DD2WyvernT2": "{$NPCName.DD2WyvernT1}", diff --git a/Localization/Content/fr-FR/Projectiles.json b/Localization/Content/fr-FR/Projectiles.json index cdb3ab1..e47d6d1 100644 --- a/Localization/Content/fr-FR/Projectiles.json +++ b/Localization/Content/fr-FR/Projectiles.json @@ -713,10 +713,6 @@ "MonkStaffT3": "Furie de dragon céleste", "MonkStaffT3_Alt": "Furie de dragon céleste", "MonkStaffT3_AltShot": "Furie de dragon céleste", - "DD2JavelinHostileT3": "{$ProjectileName.DD2JavelinHostile}", - "Celeb2Rocket": "{$ProjectileName.Celeb2Weapon}", - "Celeb2RocketExplosive": "{$ProjectileName.Celeb2Weapon}", - "Celeb2RocketLarge": "{$ProjectileName.Celeb2Weapon}", - "Celeb2RocketLargeExplosive": "{$ProjectileName.Celeb2Weapon}" + "DD2JavelinHostileT3": "{$ProjectileName.DD2JavelinHostile}" } } \ No newline at end of file diff --git a/Localization/Content/fr-FR/Town.json b/Localization/Content/fr-FR/Town.json index c9eab87..e569977 100644 --- a/Localization/Content/fr-FR/Town.json +++ b/Localization/Content/fr-FR/Town.json @@ -49,6 +49,7 @@ "Party": "Tu penses que ça posera problème si je branche des ampoules sur le gâteau au lieu de bougies ?" }, "BartenderSpecialText": { + "Party": "Je veux vraiment un texto d'anniversaire, Yorai !", "AfterDD2Tier1": "Bravo, tu as réussi à vaincre l'armée de l'Ancien ! Mais je suis sûr qu'on les reverra, ils n'ont pas beaucoup résisté cette fois-ci.", "AfterDD2Tier2": "L'armée de l'Ancien ne fait que se renforcer, mais tu continues de les repousser ! Quelque chose me dit qu'ils n'en ont pas encore fini avec nous.", "AfterDD2Tier3": "Tu as vraiment réussi à repousser l'armée de l'Ancien ? Tu devrais visiter Etheria un de ces jours.", @@ -74,9 +75,15 @@ "Party": "Il est évident que mes fêtes sont magiques.", "AfterDD2Tier1": "Tu sais, je crois avoir déjà vu un portail de ce genre, mais il était en or." }, + "SteampunkerSpecialText": { + "Party": "Tout le monde aime les bougies, alors j'ai mis des cheminées sur mon gâteau." + }, "CyborgSpecialText": { "Party": "Cette fête va être géante !" }, + "SantaClausSpecialText": { + "Party": "Allez, tu ne pensais pas vraiment que je ne célébrais que Noël, si ?" + }, "DemolitionistSpecialText": { "Party": "Tu devrais faire attention aujourd'hui. Nous, les nains, avons tendance à organiser des fêtes explosives.", "AfterDD2Start": "Je ne vois pas pourquoi on ne peut pas simplement faire exploser ces portails." @@ -109,6 +116,7 @@ "Quest_Catfish": "J'ai enfin trouvé un chat de la jungle qui aime l'eau ! Je crois que c'est parce qu'il est à moitié poisson. Je ne sais pas le pourquoi du comment, et je ne veux pas le savoir. Je veux simplement l'avoir en mains, et plus vite que ça !\n\n(Se trouve à la surface de la jungle)", "Quest_Cloudfish": "Il existe une rumeur à propos d'île flottant dans le ciel et leurs incroyables trésors ! Enfin peu importe. Ce qui est vraiment cool, c'est que parfois des lacs se forment dans les nuages, et qu'on peut y trouver des poissons-nuages ! Je veux savoir quel goût ils ont, alors tu ferais mieux de m'en attraper un !\n\n(Se trouve dans les lacs célestes)", "Quest_Cursedfish": "Il existe un poisson maudit dans les eaux profondes de la corruption ! Il a été forgé dans les flammes maudites provenant des horreurs déchues qui se tapissent dans les profondeurs. On dit que même l'eau ne peut éteindre ce feu. Qu'il peut brûler pour l'éternité. J'ai quelques idées pour préparer un poisson comme ça ! Tu vas me le chercher ou tu te dégonfles ?\n\n(Se trouve dans la corruption)", + "Quest_Dirtfish": "Le gros venait de mordre à l'hameçon quand un étrange zombie qui parle a émergé du lac de la forêt en répétant qu'il existait un poisson de terre « féroce » ! D'après lui, il peut asphyxier dix personnes comme lui, ou un truc du genre... Je le veux ! MAINTENANT !\n\n(Se trouve à la surface, dans le souterrain et les grottes)", "Quest_DynamiteFish": "Le démolisseur était furieux parce qu'il avait perdu un bâton de dynamite dans le lac à l'orée de la forêt. Il en a tellement, pourquoi en faire tout un plat ? Apparemment, il lui aurait poussé des nageoires et il serait parti en nageant ! Je ne sais pas où il va chercher ses matériaux, mais celui-ci est possédé ! Attrape-le et rapporte-le-moi, j'ai toujours voulu un poisson suicidaire ! Ne me demande pas pourquoi...\n\n(Se trouve à la surface)", "Quest_EaterofPlankton": "Je parie que tu n'as pas le courage de trouver le Mangeur de plancton. Un bout sectionné du Dévoreur des mondes a muté et est devenu un poisson corrompu ! Capture-le et apporte-le-moi ; prouve-moi que tu n'es pas une mauviette !\n\n(Se trouve dans la corruption)", "Quest_FallenStarfish": "J'adore collectionner ces étoiles brillantes qui tombent du ciel ! J'adore encore plus quand elles tombent sur la tête de quelqu'un. Mais... le mieux, c'est une étoile qui tombe dans un lac de la forêt et qui se transforme en poisson ! C'est juste énorme, et tu es assez cool pour l'attraper !\n\n(Se trouve dans les lacs célestes)", @@ -127,7 +135,7 @@ "Quest_GuideVoodooFish": "Ces démons du souterrain aiment vraiment les poupées vaudou, mais je crois qu'une de ces poupées a reçu bien trop de magie ! Elle s'est transformée en poisson et elle fait ce qu'elle veut. Je te demande d'aller m'en chercher une ! Fais attention à la lave en ébullition, parce que ça brûle et ça, ça ne m'aidera pas avec mon poisson !\n\n(Se trouve dans les grottes)", "Quest_Wyverntail": "Je sais quelque chose que tu ne sais pas ! D'accord, je vais tout te dire. Une créature terrifiante vole parmi les étoiles ! Si, c'est vrai ! C'est une « vouivre » ! Mais, tu le savais déjà, n'est-ce pas ? Par contre, tu ne sais sûrement pas que cette créature s'élève comme un têtard ! En fait, c'est... une grenouille ! Saute sur l'occasion pour m'en rapporter une !\n\n(Se trouve dans les lacs célestes)", "Quest_ZombieFish": "Tu ne vas pas me croire ! J'ai attrapé un poisson qui était déjà mort dans la forêt et de nuit ! Et il a essayé de me manger ! Je l'ai jeté et je suis parti en courant ! Mais j'aimerais le mettre dans l'armoire de quelqu'un pour voir sa réaction. Peux-tu aller me le chercher ?\n\n(Se trouve à la surface)", - "Quest_AmanitaFungifin": "J'ai trouvé un endroit spectaculaire couvert de champignons luisants ! Tout était bleu ! Je ramassais des champignons près d'un lac bleu scintillant lorsque l'un d'eux m'a mordu la main avant de s'enfuir en nageant ! Je veux lui redonner la monnaie de sa pièce et le mordre un bon coup ! Ce que je veux dire, c'est que tu dois le retrouver !\n\n(Se trouve dans les champs de champignons luisants)", + "Quest_AmanitiaFungifin": "J'ai trouvé un endroit spectaculaire couvert de champignons luisants ! Tout était bleu ! Je ramassais des champignons près d'un lac bleu scintillant lorsque l'un d'eux m'a mordu la main avant de s'enfuir en nageant ! Je veux lui redonner la monnaie de sa pièce et le mordre un bon coup ! Ce que je veux dire, c'est que tu dois le retrouver !\n\n(Se trouve dans les champs de champignons luisants)", "Quest_Angelfish": "Connais-tu les îles magiques qui flottent dans le ciel ? Je parie que non ! On dit que des anges y vivent et je crois qu'ils ont des nageoires et des branchies et qu'ils nagent ! Tu devrais m'en attraper un !\n\n(Se trouve dans les lacs célestes)", "Quest_BloodyManowar": "Aïe ! Ne t'approche pas ! Je me suis fait piquer par une méduse sanglante ! Au cas où vous ne sauriez pas ce que c'est, c'est la méduse la plus dangereuse du monde {WorldName} ! Va dans cet horrible carmin et essaie de l'attraper ! \n\n(Se trouve dans le carmin)", "Quest_Bonefish": "En général, ça m'est bien égal de voir des arêtes qui flottent dans les eaux souterraines, mais celles-ci nagent ! Eh bien, croyais-tu que seuls les squelettes humains pouvaient s'agiter dans ce monde ? {WorldName} Attrape-le-moi pour que je le mette dans le lit de quelqu'un !\n\n(Se trouve dans le souterrain et les grottes)", @@ -139,6 +147,7 @@ "Quest_Fishron": "Une légende parle d'un être puissant nommé Dracosson ! C'est un mélange de cochon, de dragon et de POISSON ! On dit qu'il vit dans les lacs gelés souterrains des régions les plus froides du monde ! Je ne veux pas y aller ; c'est TOI qui l'attraperas. Et tu as intérêt de la rapporter ! J'ai hâte de le voir !\n\n(Se trouve dans la toundra souterraine)", "Quest_InfectedScabbardfish": "Un poisson très long qui ressemble à un fourreau d'épée nage dans les eaux troubles de la corruption ! On dirait de la pierre d'ébène ; ne te fais pas avoir ! Oui, toi. C'est toi qui va l'attraper, pas moi !\n\n(Se trouve dans la corruption)", "Quest_Mudfish": "Attention où tu patauges dans les eaux de la jungle ! Pourquoi ? Non, je n'ai pas peur que tu te fasses dévorer par les piranhas. C'est juste que je ne veux pas que tu marches sur mon poisson préféré, le Vaseux ! J'aimerais bien que tu m'en rapportes un pour que je l'adopte !\n\n(Se trouve dans la jungle)", + "Quest_Slimefish": "Dans la forêt, les gelées sont vraiment dégoûtantes. Les Geloissons encore plus ! Je ne veux pas nager avec des gelées, alors sors en un de l'eau !\n\n(Se trouve partout)", "Quest_TropicalBarracuda": "Les piranhas et les requins sont moches ! Trop moches ! Sais-tu qu'il existe un très joli poisson ? Enfin, il peut quand même te croquer la tête. Je donnerai deux pièces de platine pour voir ça, d'ailleurs... Bref, j'aimerais que tu m'en attrapes un. Mais avant qu'il te croque la tête !\n\n(Se trouve à la surface de la jungle)", "Quest_TundraTrout": "Te demandes-tu parfois pourquoi la surface des zones enneigées de {WorldName} ne gèlent jamais ? Pas moi. Par contre, les poissons gèlent ! Un poisson de glace serait une belle offrande au puissant et incroyable {Angler} ! Mon loyal sujet, rapporte-moi cette truite de la toundra au plus vite !\n\n\n(Se trouve à la surface de la toundra)" }, diff --git a/Localization/Content/it-IT.json b/Localization/Content/it-IT.json index d0deebf..417f9a8 100644 --- a/Localization/Content/it-IT.json +++ b/Localization/Content/it-IT.json @@ -46,6 +46,7 @@ "48": "Terraria 2: Boogaloo elettrico", "49": "Terraria: Prova anche Minecraft!", "5": "Terraria: Una storia da conigli", + "50": "Terraria: Prova anche Edge of Space!", "51": "Terraria: Voglio soltanto sapere dov'è l'oro!", "52": "Terraria: Ora con più papere!", "53": "Terraria: 9 + 1 = 11", @@ -231,6 +232,7 @@ "TIMBER_Name": "Caaadeee!", "TIN_FOIL_HATTER_Description": "Trionfa sull'invasione dei marziani, durante la quale le creature da un altro mondo vengono a confondere le menti e a esaminarti dove non batte il sole.", "TIN_FOIL_HATTER_Name": "Nemici di latta", + "TOPPED_OFF_Description": "Ottieni più salute e mana possibile senza accessori o bonus.", "TOPPED_OFF_Name": "Pompatissimo", "TROUT_MONKEY_Description": "Completa la 25ª missione per il pescatore.", "TROUT_MONKEY_Name": "Scimmietta cattura-trote", @@ -244,6 +246,7 @@ "WHERES_MY_HONEY_Name": "Dov'è il miele?", "WINTERHEARTED_Description": "Sconfiggi l'ape regina, strega malvagia delle fredde notti.", "WINTERHEARTED_Name": "Cuore invernale", + "WORM_FODDER_Description": "Sconfiggi il mangiatore di mondi, enorme verme che dimora nella Corruzione.", "WORM_FODDER_Name": "Pasto di vermi", "YOU_AND_WHAT_ARMY_Description": "Comanda contemporaneamente nove seguaci evocati.", "YOU_AND_WHAT_ARMY_Name": "Tu e quale esercito?", @@ -330,6 +333,7 @@ "Server": "Server di Terraria {0}", "ServerMessage": " {0}", "ServerStarted": "Server avviato", + "SetInitialMaxPlayers": "Max giocatori (premi Invio per 8):", "SetInitialPort": "Porta server (premi Invio per 7777):", "SetMOTD_Command": "mdg", "SetMOTD_Description": "Cambia messaggio del giorno.", @@ -370,6 +374,7 @@ }, "Error": { "BadHeaderBufferOverflow": "Bad header lead to a read buffer overflow.", + "CaptureError": "Si è verificato un errore durante il salvataggio dell'immagine. Riprova...", "DataSentAfterConnectionLost": "Tentativo di invio dati al clienti dopo aver perso la connessione", "Error": "Errore", "ExceptionNormal": "Eccezione normale: {0}", @@ -428,9 +433,7 @@ "YellowWires": "Cavi gialli", "BirthdayParty_1": "A quanto pare, {0} sta organizzando una festa", "BirthdayParty_2": "A quanto pare, {0} e {1} stanno organizzando una festa", - "BirthdayParty_3": "A quanto pare, {0}, {1} e {2} stanno organizzando una festa", - "RespawnInPrefix": "", - "RespawnInSuffix": "{0}" + "BirthdayParty_3": "A quanto pare, {0}, {1} e {2} stanno organizzando una festa" }, "GameUI": { "ActuationDeviceOff": "Azionatore spento", @@ -447,6 +450,7 @@ "CompassCenter": "Centro", "CompassEast": "{0}' est", "CompassWest": "{0}' ovest", + "CraftingWindow": "Fabbricazione finestra", "Depth": "{0}'", "DepthLevel": "Livello", "Disabled": "Disattivato", @@ -490,11 +494,12 @@ "PartlyCloudy": "Parzialmente nuvoloso", "PlayerDistance": "({0} ft)", "PrecentFishingPower": "{0}% potenza pesca", + "QuickStackToNearby": "Accumula subito nelle casse vicine", "Rain": "Pioggia", "RulerOff": "Righello: no", "RulerOn": "Righello: sì", "SettingsMenu": "Menu impostazioni", - "OpenFileFolder": "{$LegacyInterface.110}", + "SortInventory": "Organizza inventario", "Speed": "{0} mph", "StormEffects": "Effetti tempesta: {0}", "ThirdQuarter": "Terzo quarto", @@ -579,8 +584,8 @@ "MoveToCloud": "Avvicina a nuvola", "New": "Nuovo", "Normal": "Normale", - "LightMode_White": "{$LegacyMenu.56}", - "LightMode_Color": "{$LegacyMenu.55}", + "NormalDescription": "(Esperienza standard Terraria)", + "NormalDescriptionFlavor": "Il tuo viaggio inizia...", "Play": "Gioca", "RestoreButton": "Ripristina", "Save": "Salva", @@ -603,10 +608,7 @@ "SeedCopied": "Seme copiato", "ZoomIn": "{$LegacyMenu.168}", "ZoomOut": "{$LegacyMenu.169}", - "Ellipsis": "...", - "LightMode_Retro": "{$LegacyMenu.57}", - "LightMode_Trippy": "{$LegacyMenu.58}", - "PlayerEmptyName": "{$Net.EmptyName}" + "Ellipsis": "..." }, "DeathSource": { "NPC": "{0} da {1}.", @@ -628,6 +630,7 @@ "Lava_3": "{0} ha provato a nuotare nella lava.", "Lava_4": "{0} ama giocare nel magma.", "Petrified_1": "{0} si è frantumato.", + "Petrified_2": "{0} non si può rimettere in sesto.", "Petrified_3": "{0} dev'essere spazzato via.", "Petrified_4": "{0} è diventato un mucchietto di polvere.", "Poisoned": "{0} non ha trovato l'antidoto.", @@ -690,8 +693,5 @@ "Chinese": "简体中文 (Cinese semplificato)", "Portuguese": "Português brasileiro (Portoghese brasiliano)", "Polish": "Polski (Polacco)" - }, - "RandomWorldName_Composition": { - "6": "{Adjective} {Location}" } } \ No newline at end of file diff --git a/Localization/Content/it-IT/Game.json b/Localization/Content/it-IT/Game.json index 13584a6..419d6f8 100644 --- a/Localization/Content/it-IT/Game.json +++ b/Localization/Content/it-IT/Game.json @@ -15,6 +15,9 @@ "AdamantiteCaster": "Consumo mana ridotto del 19%", "AdamantiteMelee": "Velocità di corpo a corpo e movimento aumentata del 18%", "AdamantiteRanged": "25% di probabilità di non consumare munizioni", + "HallowCaster": "Consumo mana ridotto del 20%", + "HallowMelee": "Velocità di corpo a corpo e movimento aumentata del 19%", + "HallowRanged": "25% di probabilità di non consumare munizioni", "ShadowScale": "Velocità di movimento aumentata del 15%", "Wood": "1 difesa", "Crimson": "Aumenta notevolmente la rigenerazione vita", @@ -25,6 +28,7 @@ "Titanium": "Diventi immune dopo aver colpito un nemico", "Chlorophyte": "Evoca una potente cristallo a foglia da sparare ai nemici vicini", "Wizard": "Aumenta la possibilità di colpo critico magico del 10%", + "Turtle": "Tutti i danni si riversano anche sugli aggressori", "Meteor": "La pistola spaziale costa 0 mana", "SpectreHealing": "Il danno magico inflitto ai nemici cura il giocatore con meno salute", "Shroomite": "Se non ti muovi diventi furtivo,\nla tua abilità a distanza migliora e si riduce la probabilità che i nemici ti prendano di mira", @@ -36,8 +40,13 @@ "BeetleDefense": "Gli scarabei ti proteggono dai danni", "BeetleDamage": "Gli scarabei aumentano i danni in mischia e la velocità", "Bee": "Aumenta il danno dei seguaci del 10%", + "Bone": "20% di probabilità di non consumare munizioni", "Spider": "Aumenta il danno dei seguaci del 12%", + "Ninja": "33% di probabilità di non consumare gli oggetti lanciati", + "Fossil": "50% di probabilità di non consumare gli oggetti lanciati", + "Solar": "Gli scudi solari si generano nel tempo proteggendoti,\nil potere dello scudo si consuma per scattare, infliggendo danni ai nemici", "Vortex": "Tocca due volte {0} per alternare la furtività,\naumentando la tua abilità a distanza e riducendo la probabilità che i nemici ti prendano di mira ma rallentando la velocità di movimento", + "Nebula": "Se ferisci i nemici potresti trovare bonus,\nprendi i potenziamenti accumulando bonus", "Stardust": "Tocca due volte {0} per portare il tuo guardiano in un certo luogo", "Forbidden": "Tocca due volte {0} per evocare una tempesta antica nella posizione del cursore", "Jungle": "Consumo mana ridotto del 16%", @@ -88,7 +97,7 @@ "Builder": "Aumentata la velocità e la portata di posizionamento", "BunnyMount": "Hai una gran voglia di carote", "Burning": "Perdi vita e ti muovi più lentamente", - "DesertMinecartRight": "{$BuffDescription.MinecartRight}", + "Calm": "Ridotta l'aggressività del nemico", "Campfire": "Rigenerazione vita leggermente aumentata", "ChaosState": "Il bastone della discordia sottrae vita", "Chilled": "La tua velocità di movimento si è ridotta", @@ -116,7 +125,7 @@ "FairyGreen": "Una fata ti sta seguendo", "FairyRed": "Una fata ti sta seguendo", "Featherfall": "Premi SU o GIÙ per controllare la velocità di discesa", - "DesertMinecartLeft": "{$BuffDescription.MinecartLeft}", + "Fishing": "Livello di pesca aumentato", "Flipper": "Ti muovi normalmente nell'acqua", "Frostburn": "Troppo caldo o troppo freddo; comunque sia, fa un gran male", "Frozen": "Non puoi muoverti!", @@ -178,7 +187,7 @@ "PetDD2Gato": "Un eligato ti sta seguendo", "PetDD2Ghost": "Un flickerwick ti sta seguendo", "PetLizard": "Spaventoso come un rettile", - "FishMinecartRight": "{$BuffDescription.MinecartRight}", + "PetParrot": "Vuole il suo biscottino", "PetSapling": "Un arboscello ti sta seguendo", "PetSpider": "Un ragno ti sta seguendo", "PetTurtle": "Buona tartaruga a tutti!", @@ -250,7 +259,7 @@ "WeaponImbuePoison": "Gli attacchi in mischia avvelenano i nemici", "WeaponImbueVenom": "Gli attacchi in mischia applicano veleno sui tuoi bersagli", "Webbed": "Sei bloccato", - "FishMinecartLeft": "{$BuffDescription.MinecartLeft}", + "WellFed": "Piccole migliorie a tutti i parametri", "Werewolf": "Abilità fisiche aumentate", "Wet": "Stai gocciolando", "WindPushed": "Il vento ti sposta!", @@ -258,45 +267,7 @@ "WitheredArmor": "La tua difesa si è ridotta!", "WitheredWeapon": "I tuoi attacchi sono più deboli!", "Wrath": "Danno aumentato del 10%", - "ZephyrFish": "Si diverte a nuotare intorno a te", - "BeeMinecartRight": "{$BuffDescription.MinecartRight}", - "BeeMinecartLeft": "{$BuffDescription.MinecartLeft}", - "LadybugMinecartRight": "{$BuffDescription.MinecartRight}", - "LadybugMinecartLeft": "{$BuffDescription.MinecartLeft}", - "PigronMinecartRight": "{$BuffDescription.MinecartRight}", - "PigronMinecartLeft": "{$BuffDescription.MinecartLeft}", - "SunflowerMinecartRight": "{$BuffDescription.MinecartRight}", - "SunflowerMinecartLeft": "{$BuffDescription.MinecartLeft}", - "HellMinecartRight": "{$BuffDescription.MinecartRight}", - "HellMinecartLeft": "{$BuffDescription.MinecartLeft}", - "ShroomMinecartRight": "{$BuffDescription.MinecartRight}", - "ShroomMinecartLeft": "{$BuffDescription.MinecartLeft}", - "AmethystMinecartRight": "{$BuffDescription.MinecartRight}", - "AmethystMinecartLeft": "{$BuffDescription.MinecartLeft}", - "TopazMinecartRight": "{$BuffDescription.MinecartRight}", - "TopazMinecartLeft": "{$BuffDescription.MinecartLeft}", - "SapphireMinecartRight": "{$BuffDescription.MinecartRight}", - "SapphireMinecartLeft": "{$BuffDescription.MinecartLeft}", - "EmeraldMinecartRight": "{$BuffDescription.MinecartRight}", - "EmeraldMinecartLeft": "{$BuffDescription.MinecartLeft}", - "RubyMinecartRight": "{$BuffDescription.MinecartRight}", - "RubyMinecartLeft": "{$BuffDescription.MinecartLeft}", - "DiamondMinecartRight": "{$BuffDescription.MinecartRight}", - "DiamondMinecartLeft": "{$BuffDescription.MinecartLeft}", - "AmberMinecartRight": "{$BuffDescription.MinecartRight}", - "AmberMinecartLeft": "{$BuffDescription.MinecartLeft}", - "BeetleMinecartRight": "{$BuffDescription.MinecartRight}", - "BeetleMinecartLeft": "{$BuffDescription.MinecartLeft}", - "MeowmereMinecartRight": "{$BuffDescription.MinecartRight}", - "MeowmereMinecartLeft": "{$BuffDescription.MinecartLeft}", - "PartyMinecartRight": "{$BuffDescription.MinecartRight}", - "PartyMinecartLeft": "{$BuffDescription.MinecartLeft}", - "PirateMinecartRight": "{$BuffDescription.MinecartRight}", - "PirateMinecartLeft": "{$BuffDescription.MinecartLeft}", - "SteampunkMinecartRight": "{$BuffDescription.MinecartRight}", - "SteampunkMinecartLeft": "{$BuffDescription.MinecartLeft}", - "CoffinMinecartRight": "{$BuffDescription.MinecartRight}", - "CoffinMinecartLeft": "{$BuffDescription.MinecartLeft}" + "ZephyrFish": "Si diverte a nuotare intorno a te" }, "BuffName": { "AmmoBox": "Cassa di munizioni", @@ -439,7 +410,7 @@ "Regeneration": "Rigenerazione", "Rudolph": "Rudolph", "ScutlixMount": "Scutlix cavalcabile", - "DesertMinecartRight": "{$BuffName.MinecartRight}", + "ShadowDodge": "Schivata nell'ombra", "ShadowFlame": "Fiamma d'ombra", "ShadowOrb": "Sfera d'ombra", "SharknadoMinion": "Tornado di squali", @@ -502,48 +473,7 @@ "WitheredArmor": "Armatura indebolita", "WitheredWeapon": "Arma indebolita", "Wrath": "Ira", - "ZephyrFish": "Pesce zefiro", - "DesertMinecartLeft": "{$BuffName.MinecartLeft}", - "FishMinecartRight": "{$BuffName.MinecartRight}", - "FishMinecartLeft": "{$BuffName.MinecartLeft}", - "BeeMinecartRight": "{$BuffName.MinecartRight}", - "BeeMinecartLeft": "{$BuffName.MinecartLeft}", - "LadybugMinecartRight": "{$BuffName.MinecartRight}", - "LadybugMinecartLeft": "{$BuffName.MinecartLeft}", - "PigronMinecartRight": "{$BuffName.MinecartRight}", - "PigronMinecartLeft": "{$BuffName.MinecartLeft}", - "SunflowerMinecartRight": "{$BuffName.MinecartRight}", - "SunflowerMinecartLeft": "{$BuffName.MinecartLeft}", - "HellMinecartRight": "{$BuffName.MinecartRight}", - "HellMinecartLeft": "{$BuffName.MinecartLeft}", - "ShroomMinecartRight": "{$BuffName.MinecartRight}", - "ShroomMinecartLeft": "{$BuffName.MinecartLeft}", - "AmethystMinecartRight": "{$BuffName.MinecartRight}", - "AmethystMinecartLeft": "{$BuffName.MinecartLeft}", - "TopazMinecartRight": "{$BuffName.MinecartRight}", - "TopazMinecartLeft": "{$BuffName.MinecartLeft}", - "SapphireMinecartRight": "{$BuffName.MinecartRight}", - "SapphireMinecartLeft": "{$BuffName.MinecartLeft}", - "EmeraldMinecartRight": "{$BuffName.MinecartRight}", - "EmeraldMinecartLeft": "{$BuffName.MinecartLeft}", - "RubyMinecartRight": "{$BuffName.MinecartRight}", - "RubyMinecartLeft": "{$BuffName.MinecartLeft}", - "DiamondMinecartRight": "{$BuffName.MinecartRight}", - "DiamondMinecartLeft": "{$BuffName.MinecartLeft}", - "AmberMinecartRight": "{$BuffName.MinecartRight}", - "AmberMinecartLeft": "{$BuffName.MinecartLeft}", - "BeetleMinecartRight": "{$BuffName.MinecartRight}", - "BeetleMinecartLeft": "{$BuffName.MinecartLeft}", - "MeowmereMinecartRight": "{$BuffName.MinecartRight}", - "MeowmereMinecartLeft": "{$BuffName.MinecartLeft}", - "PartyMinecartRight": "{$BuffName.MinecartRight}", - "PartyMinecartLeft": "{$BuffName.MinecartLeft}", - "PirateMinecartRight": "{$BuffName.MinecartRight}", - "PirateMinecartLeft": "{$BuffName.MinecartLeft}", - "SteampunkMinecartRight": "{$BuffName.MinecartRight}", - "SteampunkMinecartLeft": "{$BuffName.MinecartLeft}", - "CoffinMinecartRight": "{$BuffName.MinecartRight}", - "CoffinMinecartLeft": "{$BuffName.MinecartLeft}" + "ZephyrFish": "Pesce zefiro" }, "MapObject": { "Adamantite": "Adamantio", @@ -615,166 +545,5 @@ "Roll": "{$LegacyMultiplayer.8}", "Party": "/s", "Emote": "/io" - }, - "Bestiary_ItemDropConditions": { - "NotExpert": "", - "NotMasterMode": "", - "LegacyHack_IsBossAndNotExpert": "", - "IsCrimsonAndNotExpert": "", - "IsCorruptionAndNotExpert": "", - "NotFromStatue": "" - }, - "Bestiary_FlavorText": { - "npc_JungleSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_YellowSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_RedSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_PurpleSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_BlackSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_GreenSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_BlueSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_DemonEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_Zombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_Skeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_AngryBones": "{$CommonBestiaryFlavor.AngryBones}", - "npc_Hornet": "{$CommonBestiaryFlavor.Hornet}", - "npc_Hellbat": "{$CommonBestiaryFlavor.LavaBat}", - "npc_BlueJellyfish": "{$CommonBestiaryFlavor.Jellyfish}", - "npc_PinkJellyfish": "{$CommonBestiaryFlavor.Jellyfish}", - "npc_Mummy": "{$CommonBestiaryFlavor.Mummy}", - "npc_DarkMummy": "{$CommonBestiaryFlavor.Mummy}", - "npc_LightMummy": "{$CommonBestiaryFlavor.Mummy}", - "npc_Mimic": "{$CommonBestiaryFlavor.Mimic}", - "npc_GreenJellyfish": "{$CommonBestiaryFlavor.Jellyfish}", - "npc_BaldZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_WanderingEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_Penguin": "{$CommonBestiaryFlavor.Penguin}", - "npc_PenguinBlack": "{$CommonBestiaryFlavor.Penguin}", - "npc_Lavabat": "{$CommonBestiaryFlavor.LavaBat}", - "npc_PigronCorruption": "{$CommonBestiaryFlavor.Pigron}", - "npc_PigronHallow": "{$CommonBestiaryFlavor.Pigron}", - "npc_PigronCrimson": "{$CommonBestiaryFlavor.Pigron}", - "npc_PincushionZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_SwampZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_TwiggyZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_CataractEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_SleepyEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_DialatedEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_GreenEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_PurpleEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_FemaleZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_HeadacheSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_MisassembledSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_PantlessSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_HornetFatty": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetHoney": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetLeafy": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetSpikey": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetStingy": "{$CommonBestiaryFlavor.Hornet}", - "npc_ZombieMushroom": "{$CommonBestiaryFlavor.MushroomZombie}", - "npc_ZombieMushroomHat": "{$CommonBestiaryFlavor.MushroomZombie}", - "npc_FungiBulb": "{$CommonBestiaryFlavor.FungiBulb}", - "npc_GiantFungiBulb": "{$CommonBestiaryFlavor.FungiBulb}", - "npc_RustyArmoredBonesAxe": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_RustyArmoredBonesFlail": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_RustyArmoredBonesSword": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_RustyArmoredBonesSwordNoArmor": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_BlueArmoredBones": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_BlueArmoredBonesMace": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_BlueArmoredBonesNoPants": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_BlueArmoredBonesSword": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_HellArmoredBones": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_HellArmoredBonesSpikeShield": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_HellArmoredBonesMace": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_HellArmoredBonesSword": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_RaggedCaster": "{$CommonBestiaryFlavor.RaggedCaster}", - "npc_RaggedCasterOpenCoat": "{$CommonBestiaryFlavor.RaggedCaster}", - "npc_Necromancer": "{$CommonBestiaryFlavor.Necromancer}", - "npc_NecromancerArmored": "{$CommonBestiaryFlavor.Necromancer}", - "npc_DiabolistRed": "{$CommonBestiaryFlavor.Diabolist}", - "npc_DiabolistWhite": "{$CommonBestiaryFlavor.Diabolist}", - "npc_AngryBonesBig": "{$CommonBestiaryFlavor.AngryBones}", - "npc_AngryBonesBigMuscle": "{$CommonBestiaryFlavor.AngryBones}", - "npc_AngryBonesBigHelmet": "{$CommonBestiaryFlavor.AngryBones}", - "npc_Scarecrow1": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow2": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow3": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow4": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow5": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow6": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow7": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow8": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow9": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow10": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_DemonEyeOwl": "{$CommonBestiaryFlavor.CostumeDemonEye}", - "npc_DemonEyeSpaceship": "{$CommonBestiaryFlavor.CostumeDemonEye}", - "npc_ZombieDoctor": "{$CommonBestiaryFlavor.CostumeZombie}", - "npc_ZombieSuperman": "{$CommonBestiaryFlavor.CostumeZombie}", - "npc_ZombiePixie": "{$CommonBestiaryFlavor.CostumeZombie}", - "npc_SkeletonTopHat": "{$CommonBestiaryFlavor.CostumeSkeleton}", - "npc_SkeletonAstonaut": "{$CommonBestiaryFlavor.CostumeSkeleton}", - "npc_SkeletonAlien": "{$CommonBestiaryFlavor.CostumeSkeleton}", - "npc_ZombieXmas": "{$CommonBestiaryFlavor.ZombieXmas}", - "npc_ZombieSweater": "{$CommonBestiaryFlavor.ZombieXmas}", - "npc_SlimeRibbonWhite": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_SlimeRibbonYellow": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_SlimeRibbonGreen": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_SlimeRibbonRed": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_ZombieElf": "{$CommonBestiaryFlavor.ZombieElf}", - "npc_ZombieElfBeard": "{$CommonBestiaryFlavor.ZombieElf}", - "npc_ZombieElfGirl": "{$CommonBestiaryFlavor.ZombieElf}", - "npc_ArmedZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombiePincushion": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombieSwamp": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombieTwiggy": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombieCenx": "{$CommonBestiaryFlavor.Zombie}", - "npc_GoldBird": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldBunny": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldButterfly": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldFrog": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldGrasshopper": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldMouse": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldWorm": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_BoneThrowingSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_BoneThrowingSkeleton2": "{$CommonBestiaryFlavor.Skeleton}", - "npc_BoneThrowingSkeleton3": "{$CommonBestiaryFlavor.Skeleton}", - "npc_BoneThrowingSkeleton4": "{$CommonBestiaryFlavor.Skeleton}", - "npc_GiantWalkingAntlion": "{$CommonBestiaryFlavor.AntlionCharger}", - "npc_GiantFlyingAntlion": "{$CommonBestiaryFlavor.AntlionSwarmer}", - "npc_DesertLamiaLight": "{$CommonBestiaryFlavor.Lamia}", - "npc_DesertLamiaDark": "{$CommonBestiaryFlavor.Lamia}", - "npc_SquirrelGold": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_SandShark": "{$CommonBestiaryFlavor.Sandshark}", - "npc_SandsharkCorrupt": "{$CommonBestiaryFlavor.Sandshark}", - "npc_SandsharkCrimson": "{$CommonBestiaryFlavor.Sandshark}", - "npc_SandsharkHallow": "{$CommonBestiaryFlavor.Sandshark}", - "npc_WalkingAntlion": "{$CommonBestiaryFlavor.AntlionCharger}", - "npc_FlyingAntlion": "{$CommonBestiaryFlavor.AntlionSwarmer}", - "npc_GoldGoldfish": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldGoldfishWalker": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_BlackDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_BlueDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_GreenDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_OrangeDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_RedDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_YellowDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_GoldDragonfly": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldLadyBug": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldWaterStrider": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldSeahorse": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_IceMimic": "{$CommonBestiaryFlavor.Mimic}", - "npc_GemSquirrelAmethyst": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelTopaz": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelSapphire": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelEmerald": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelRuby": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelDiamond": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelAmber": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemBunnyAmethyst": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyTopaz": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnySapphire": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyEmerald": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyRuby": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyDiamond": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyAmber": "{$CommonBestiaryFlavor.GemBunny}" } } \ No newline at end of file diff --git a/Localization/Content/it-IT/Items.json b/Localization/Content/it-IT/Items.json index f9ba72c..e22dd81 100644 --- a/Localization/Content/it-IT/Items.json +++ b/Localization/Content/it-IT/Items.json @@ -232,6 +232,7 @@ "RedHusk": "Guscio rosso", "CyanHusk": "Guscio azzurro", "VioletHusk": "Guscio lilla", + "PurpleMucos": "Guscio viola", "BlackInk": "Inchiostro nero", "FlowerofFire": "Fiore di fuoco", "DyeVat": "Vasca per le tinture", @@ -538,6 +539,7 @@ "CarriageLantern": "Lanterna da carro", "AlchemyLantern": "Lanterna alchemica", "DiablostLamp": "Lampada satanica", + "OilRagSconse": "Candeliere a olio", "BlueDungeonChair": "Sedia blu da dungeon", "BlueDungeonTable": "Tavolo blu da dungeon", "BlueDungeonWorkBench": "Banco da lavoro blu da dungeon", @@ -690,6 +692,7 @@ "NecroGreaves": "Schinieri funebri", "CrimsonChest": "Cassa cremisi", "HallowedChest": "Cassa consacrata", + "FrozenChest": "Cassa congelata", "JungleKey": "Chiave della giungla", "CorruptionKey": "Chiave della corruzione", "CrimsonKey": "Chiave cremisi", @@ -760,6 +763,7 @@ "TitanstoneBlockWall": "Muro di blocchi di pietra titanica", "MagicCuffs": "Manette magiche", "MusicBoxSnow": "Carillon (Neve)", + "MusicBoxSpace": "Carillon (Spazio)", "MusicBoxCrimson": "Carillon (Cremisi)", "MusicBoxBoss4": "Carillon (Boss 4)", "SilverWatch": "Orologio d'argento", @@ -768,6 +772,7 @@ "MusicBoxRain": "Carillon (Pioggia)", "MusicBoxIce": "Carillon (Ghiaccio)", "MusicBoxDesert": "Carillon (Deserto)", + "MusicBoxOcean": "Carillon (Oceano)", "MusicBoxDungeon": "Carillon (Dungeon)", "MusicBoxPlantera": "Carillon (Plantera)", "MusicBoxBoss5": "Carillon (Boss 5)", @@ -810,6 +815,7 @@ "DerplingBanner": "Stendardo derpling", "EaterofSoulsBanner": "Stendardo mangiatore di anime", "EnchantedSwordBanner": "Stendardo spada incantata", + "ZombieEskimoBanner": "Stendardo eschimese zombie", "FaceMonsterBanner": "Stendardo faccia mostruosa", "FloatyGrossBanner": "Stendardo grasso galleggiante", "FlyingFishBanner": "Stendardo pesce volante", @@ -1003,6 +1009,7 @@ "SpookyDoor": "Porta spettrale", "SpookyTable": "Tavolo spettrale", "SpookyWorkBench": "Banco da lavoro spettrale", + "SpookyPlatform": "Piattaforma spettrale", "ReaperHood": "Cappuccio da mietitore", "Diamond": "Diamante", "ReaperRobe": "Toga da mietitore", @@ -1558,7 +1565,7 @@ "GuideVoodooFish": "Pesce voodoo", "Wyverntail": "Pesce viverna", "ZombieFish": "Pesce zombie", - "AmanitaFungifin": "Pesce fungo", + "AmanitiaFungifin": "Pesce fungo", "Angelfish": "Pesce angelo", "BloodyManowar": "Medusa sanguinolenta", "Bonefish": "Pesce ossa", @@ -1637,7 +1644,7 @@ "SwiftnessPotion": "Pozione della rapidità", "BlueArmoredBonesBanner": "Stendardo ossa corazzate blu", "BlueCultistArcherBanner": "Stendardo arciere cultista blu", - "ManaCloakStar": "", + "BlueCultistCasterBanner": "Stendardo lanciatore cultista blu", "BlueCultistFighterBanner": "Stendardo lottatore cultista blu", "BoneLeeBanner": "Stendardo ossa marziali", "ClingerBanner": "Stendardo appiccicoso", @@ -2203,6 +2210,7 @@ "TacticalShotgun": "Fucile tattico", "RottenChunk": "Ceppo marcio", "IvyChest": "Cassa di edera", + "IceChest": "Cassa di ghiaccio", "Marrow": "Arco di midollo", "UnholyTrident": "Tridente profano", "FrostHelmet": "Casco del gelo", @@ -2338,6 +2346,9 @@ "TheUndertaker": "Il becchino", "TheMeatball": "Il macellaio", "TheRottedFork": "Il forcone marcio", + "EskimoHood": "Cappuccio eschimese", + "EskimoCoat": "Cappotto eschimese", + "EskimoPants": "Pantaloni eschimesi", "LivingWoodChair": "Sedia di legno vivo", "CactusChair": "Sedia di cactus", "BoneChair": "Sedia di ossa", @@ -2527,7 +2538,10 @@ "ShoeSpikes": "Ramponi", "TigerClimbingGear": "Artigli da scalata", "Tabi": "Calzini tabi", + "PinkEskimoHood": "Cappuccio eschimese rosa", + "PinkEskimoCoat": "Cappotto eschimese rosa", "Minishark": "Minishark", + "PinkEskimoPants": "Pantaloni eschimesi rosa", "PinkThread": "Abito rosa", "ManaRegenerationBand": "Benda rigenerazione mana", "SandstorminaBalloon": "Tempesta di sabbia in un palloncino", @@ -2602,6 +2616,7 @@ "AncientBattleArmorPants": "Abito proibito", "AncientBattleArmorShirt": "Toga proibita", "AncientCloth": "Abito antico", + "AncientCultistTrophy": "Trofeo cultista antico", "AncientHorn": "Corno antico", "AnglerTackleBag": "Borsa del pescatore", "AngryBonesBanner": "Stendardo ossa arrabbiate", @@ -2697,6 +2712,7 @@ "BorealWoodTable": "Tavolo di legno boreale", "BorealWoodWall": "Muro di legno boreale", "BorealWoodWorkBench": "Banco da lavoro di legno boreale", + "BossMaskCultist": "Maschera da cultista antico", "BossMaskMoonlord": "Maschera del Signore della Luna", "BottomlessBucket": "Secchio d'acqua senza fondo", "BouncyBomb": "Bomba a rimbalzo", @@ -2820,6 +2836,7 @@ "DestroyerBossBag": "Borsa del tesoro", "DestroyerMask": "Maschera del distruttore", "Detonator": "Detonatore", + "DevDye": "Sangue di Skiphs", "DiamondGemsparkWall": "Muro di diamante luccicante", "DiamondGemsparkWallOff": "Muro di diamante luccicante inattivo", "DjinnLamp": "Lampada spirito del deserto", @@ -2883,12 +2900,14 @@ "Fake_DynastyChest": "Cassa dinastica intrappolata", "Fake_EbonwoodChest": "Cassa di ebano intrappolata", "Fake_FleshChest": "Cassa di carne intrappolata", + "Fake_FrozenChest": "Cassa congelata intrappolata", "Fake_GlassChest": "Cassa di vetro intrappolata", "Fake_GoldChest": "Cassa d'oro intrappolata", "Fake_GraniteChest": "Cassa di granito intrappolata", "Fake_GreenDungeonChest": "Cassa verde da dungeon intrappolata", "Fake_HallowedChest": "Cassa consacrata intrappolata", "Fake_HoneyChest": "Cassa di miele intrappolata", + "Fake_IceChest": "Cassa di ghiaccio intrappolata", "Fake_IvyChest": "Cassa di edera intrappolata", "Fake_JungleChest": "Cassa della giungla intrappolata", "Fake_LihzahrdChest": "Cassa rettiliana intrappolata", @@ -3558,6 +3577,7 @@ "SailfishBoots": "Stivali pesce-vela", "SalamanderBanner": "Stendardo salamandra", "SandElementalBanner": "Stendardo elementale di sabbia", + "SandFallBlock": "Cascata di sabbia", "SandFallWall": "Muro cascata di sabbia", "SandsharkBanner": "Stendardo squalo di sabbia", "SandsharkCorruptBanner": "Stendardo mordiossa", @@ -3621,6 +3641,10 @@ "SkeletronBossBag": "Borsa del tesoro", "SkeletronPrimeBossBag": "Borsa del tesoro", "SkeletronPrimeMask": "Maschera skeletron primario", + "SkiphsHelm": "Maschera di Skiphs", + "SkiphsPants": "Pantaloni di Skiphs", + "SkiphsShirt": "Pelle di Skiphs", + "SkiphsWings": "Zampe di Skiphs", "SkyBlueString": "Corda celeste", "SkyFracture": "Frattura celeste", "SkywareBathtub": "Vasca da bagno celeste", @@ -3662,6 +3686,7 @@ "SmokeBlock": "Blocco di fumo", "SnailStatue": "Statua della chiocciola", "SnowCloudBlock": "Nuvola di neve", + "SnowFallBlock": "Nevicata", "SnowFallWall": "Muro nevicata", "SolarCoriteBanner": "Stendardo corite", "SolarCrawltipedeBanner": "Stendardo centipede", @@ -3806,6 +3831,7 @@ "TwilightHairDye": "Tintura per capelli crepuscolare", "TwinMask": "Maschera gemella", "TwinsBossBag": "Borsa del tesoro", + "UltraBrightCampfire": "Fuoco di bivacco luminosissimo", "UndeadVikingStatue": "Statua vichingo non-morto", "UnicornStatue": "Statua dell'unicorno", "UnicornWispDye": "Tintura fiammella di unicorno", @@ -3954,6 +3980,7 @@ "DungeonClockPink": "Orologio rosa da dungeon", "DynastyDresser": "Cassettone dinastico", "DynastyPiano": "Pianoforte dinastico", + "DynastyPlatform": "Piattaforma dinastica", "DynastySofa": "Divano dinastico", "Fake_CrystalChest": "Cassa di cristallo intrappolata", "Fake_GoldenChest": "Cassa dorata intrappolata", @@ -3978,6 +4005,10 @@ "SquireAltPants": "Schinieri del cavaliere di Valhalla", "SquireAltShirt": "Corazza del cavaliere di Valhalla", "SkywareClock2": "Orologio solare", + "ArkhalisHat": "Cappuccio di Arkhalis", + "ArkhalisShirt": "Bustino di Arkhalis", + "ArkhalisPants": "Calzamaglia di Arkhalis", + "ArkhalisWings": "Ali di Arkhalis", "LeinforsHat": "Protezione capelli Leinfors", "LeinforsShirt": "Stile eccessivo Leinfors", "LeinforsPants": "Pantaloni stravaganti Leinfors", @@ -4003,7 +4034,7 @@ "Paintbrush": "Si usa con la vernice per colorare i blocchi", "PaintRoller": "Si usa con la vernice per colorare i i muri", "ManaCrystal": "Aumenta in maniera permanente il mana massimo di 20", - "GolfBallDyedPink": "{$CommonItemTooltip.GolfBall}", + "PaintScraper": "Si usa per rimuovere la vernice", "TealMushroom": "Per ricavare la tintura ottanio", "GreenMushroom": "Per ricavare la tintura verde", "SkyBlueFlower": "Per ricavare la tintura celeste", @@ -4027,7 +4058,7 @@ "MagicMissile": "Scaglia un missile guidato", "Beenade": "Esplode in uno sciame di api", "GravityGlobe": "Consente al portatore di invertire la gravità\nPremi SU per cambiare la gravità", - "KiteRed": "{$CommonItemTooltip.Kite}", + "HoneyComb": "Rilascia api quando si danneggia", "Abeemination": "Evoca l'ape regina", "DirtRod": "Muove magicamente la terra", "TempleKey": "Apre la porta del tempio nella giungla", @@ -4036,10 +4067,10 @@ "LihzahrdPressurePlate": "Si attiva quando un giocatore ci passa sopra", "PiranhaGun": "Si attacca ai nemici per infliggere danno continuo", "PygmyStaff": "Evoca un pigmeo che combatte per te", - "KiteBlueAndYellow": "{$CommonItemTooltip.Kite}", - "KiteBlue": "{$CommonItemTooltip.Kite}", - "KiteWyvern": "{$CommonItemTooltip.Kite}", - "GroxTheGreatGreaves": "{$CommonItemTooltip.DevItem}", + "PygmyNecklace": "Aumenta il numero massimo dei tuoi seguaci", + "TikiMask": "Aumenta il numero massimo dei tuoi seguaci\nAumenta il danno dei seguaci del 10%", + "TikiShirt": "Aumenta il numero massimo dei tuoi seguaci\nAumenta il danno dei seguaci del 10%", + "TikiPants": "Aumenta il numero massimo dei tuoi seguaci\nAumenta il danno dei seguaci del 10%", "LeafWings": "{$CommonItemTooltip.FlightAndSlowfall}", "BlizzardinaBalloon": "Per eseguire un salto doppio\nAumenta l'altezza del salto", "BundleofBalloons": "Il portatore può compiere un salto quadruplo\nAumenta l'altezza del salto", @@ -4088,19 +4119,19 @@ "MeteorSuit": "Danno magico aumentato del 7%", "AmberMosquito": "Evoca un dinosauro piccolo", "NimbusRod": "Evoca una nuvola per scatenare la pioggia sui tuoi nemici", - "GroxTheGreatArmor": "{$CommonItemTooltip.DevItem}", + "BeeCloak": "Provoca la caduta di stelle e rilascia api se ferito", "EyeoftheGolem": "Possibilità di colpo critico aumentata del 10%", "HoneyBalloon": "Aumenta l'altezza del salto\nRilascia api quando si danneggia", "MeteorLeggings": "Danno magico aumentato del 7%", "BlueHorseshoeBalloon": "Per eseguire un salto doppio\nAumenta l'altezza del salto e annulla i danni da caduta", "WhiteHorseshoeBalloon": "Per eseguire un salto doppio\nAumenta l'altezza del salto e annulla i danni da caduta", "YellowHorseshoeBalloon": "Per eseguire un salto doppio\nAumenta l'altezza del salto e annulla i danni da caduta", - "OceanCrate": "{$CommonItemTooltip.RightClickToOpen}", + "FrozenTurtleShell": "Crea un guscio attorno al suo proprietario quando ha meno del 50% di vita per ridurre il danno", "SniperRifle": "Spara un proiettile potente ad alta velocità\n per allontanare", "VenusMagnum": "Spara un proiettile potente ad alta velocità", "CrimsonRod": "Evoca una nuvola che fa piovere sangue sui tuoi nemici", - "SteampunkWings": "{$CommonItemTooltip.FlightAndSlowfall}", - "WingsVortex": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", + "Stynger": "Spara un dardo esplosivo", + "FlowerPow": "Spara petali affilatissimi contro i nemici circostanti", "RainbowGun": "Spara un arcobaleno che infligge danno continuo", "StyngerBolt": "Esplode generando frammenti letali", "FlowerofFrost": "Spara una palla di gelo", @@ -4112,11 +4143,11 @@ "EmeraldRobe": "Aumenta il mana massimo di 60\nConsumo mana ridotto dell'11%", "RubyRobe": "Aumenta il mana massimo di 60\nConsumo mana ridotto del 13%", "DiamondRobe": "Aumenta il mana massimo di 80\nConsumo mana ridotto del 15%", - "GroxTheGreatHelm": "{$CommonItemTooltip.DevItem}", + "PanicNecklace": "Aumenta la velocità di movimento dopo aver ricevuto un colpo", "LifeFruit": "Aumenta in maniera permanente la vita massima di 5", "LihzahrdPowerCell": "Si usa presso l'altare rettiliano", "Picksaw": "Consente di estrarre mattoni rettiliani", - "JimsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "HeatRay": "Spara un raggio di calore perforante\nOolaa!!!", "StaffofEarth": "Evoca un masso potente", "GolemFist": "Tira pugni con la forza di un golem", "Binoculars": "Aumenta la portata visiva quando si tiene in mano", @@ -4136,8 +4167,8 @@ "TurtleHelmet": "Danno da mischia aumentato del 6%\nAumenta la probabilità che i nemici ti prendano come bersaglio", "TurtleScaleMail": "Probabilità di colpo critico e danno da mischia aumentati dell'8%\nAumenta la probabilità che i nemici ti prendano come bersaglio", "TurtleLeggings": "Possibilità di colpo critico nel corpo a corpo aumentata del 4%\nAumenta la probabilità che i nemici ti prendano come bersaglio", - "KiteWorldFeeder": "{$CommonItemTooltip.Kite}", - "OasisCrateHard": "{$CommonItemTooltip.RightClickToOpen}", + "MagicQuiver": "Aumenta i danni del 10% e aumenta notevolmente la velocità della freccia\n20% di probabilità di non consumare frecce", + "MagmaStone": "Infligge danno da fuoco attaccando", "ObsidianRose": "Riduce il danno ricevuto toccando la lava", "RodofDiscord": "Ti teletrasporta nella posizione del mouse", "DeathSickle": "Spara un falcetto letale", @@ -4147,7 +4178,7 @@ "IchorArrow": "Riduce le difese del bersaglio", "IchorBullet": "Riduce le difese del bersaglio", "GoldenShower": "Spruzza un getto di icore\nRiduce le difese del bersaglio", - "OasisCrate": "{$CommonItemTooltip.RightClickToOpen}", + "FireGauntlet": "Aumenta lo spintone nella mischia e infligge danno da fuoco attaccando\nDanno in mischia e velocità aumentano del 10%", "ImbuingStation": "Per creare borracce con cui infondere le armi", "EmptyBullet": "Per creare vari tipi di munizioni", "ShadowbeamStaff": "Crea un raggio di ombra che rimbalza sui muri", @@ -4176,17 +4207,17 @@ "CorruptionKey": "Sblocca una cassa della corruzione nel dungeon", "CrimsonKey": "Sblocca una cassa cremisi nel dungeon", "HallowedKey": "Sblocca una cassa consacrata nel dungeon", - "Cherry": "{$CommonItemTooltip.MinorStats}", + "FrozenKey": "Sblocca una cassa congelata nel dungeon", "SpectrePaintbrush": "Si usa con la vernice per colorare i blocchi", "SpectrePaintRoller": "Si usa con la vernice per colorare i i muri", - "GolfBallDyedOrange": "{$CommonItemTooltip.GolfBall}", + "SpectrePaintScraper": "Si usa per rimuovere la vernice", "ShroomiteHeadgear": "Danno da freccia aumentato del 15%\nPossibilità di colpo critico a distanza aumentata del 5%", "ShroomiteMask": "Danno da proiettile aumentato del 15%\nPossibilità di colpo critico a distanza aumentata del 5%", "ShroomiteHelmet": "Danno da razzo aumentato del 15%\nPossibilità di colpo critico a distanza aumentata del 5%", - "KiteBoneSerpent": "{$CommonItemTooltip.Kite}", + "ShroomiteBreastplate": "Possibilità di colpo critico a distanza aumentata del 13%\n20% di probabilità di non consumare munizioni", "ShroomiteLeggings": "Possibilità di colpo critico a distanza aumentata del 7%\nVelocità di movimento aumentata del 12%", "Autohammer": "Trasforma le barre di clorofite in barre di micete", - "Jetpack": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressUpToBooster}", + "SDMG": "50% di probabilità di non consumare munizioni\nVeniva dai confini dello spazio", "CenxsTiara": "{$CommonItemTooltip.DevItem}", "CenxsBreastplate": "{$CommonItemTooltip.DevItem}", "CenxsLeggings": "{$CommonItemTooltip.DevItem}", @@ -4206,17 +4237,17 @@ "VampireKnives": "Lancia rapidamente pugnali di sottrazione vita", "AquaScepter": "Spruzza una cascata d'acqua", "ScourgeoftheCorruptor": "Un potente giavellotto che scatena minuscoli mangiatori", - "Banana": "{$CommonItemTooltip.MinorStats}", + "StaffoftheFrostHydra": "Evoca una potente idra del gelo che sputa ghiaccio contro i nemici", "SweetheartNecklace": "Rilascia api e aumenta la velocità di movimento quando riceve danni", "FlurryBoots": "Colui che li indossa può correre velocissimo", "LuckyHorseshoe": "Annulla i danni da caduta", "DTownsHelmet": "{$CommonItemTooltip.DevItem}", "DTownsBreastplate": "{$CommonItemTooltip.DevItem}", "DTownsLeggings": "{$CommonItemTooltip.DevItem}", - "GroxTheGreatWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", - "StillLife": "{$PaintingArtist.Crowno}", - "BloodyGoblet": "{$PaintingArtist.Crowno}", - "WickedUndead": "{$PaintingArtist.Crowno}", + "DTownsWings": "{$CommonItemTooltip.DevItem}", + "WillsWings": "{$CommonItemTooltip.DevItem}", + "CrownosWings": "{$CommonItemTooltip.DevItem}", + "CenxsWings": "{$CommonItemTooltip.DevItem}", "CenxsDress": "{$CommonItemTooltip.DevItem}", "CenxsDressPants": "{$CommonItemTooltip.DevItem}", "ShinyRedBalloon": "Aumenta l'altezza del salto", @@ -4225,7 +4256,7 @@ "AnkhCharm": "Rende immuni da gran parte dei malus", "AnkhShield": "Rende immuni da spintoni e blocchi di fuoco\nRende immuni da gran parte dei malus", "WaterBolt": "Lancia un dardo di acqua lento", - "GolfBall": "{$CommonItemTooltip.GolfBall}", + "Bomb": "Una piccola esplosione che distruggerà alcune mattonelle", "Dynamite": "Una grande esplosione che distruggerà molte mattonelle", "Grenade": "Una piccola esplosione che non distruggerà mattonelle", "GoldWatch": "Indica il tempo", @@ -4237,7 +4268,7 @@ "GoodieBag": "{$CommonItemTooltip.RightClickToOpen}", "CandyCornRifle": "33% di probabilità di non consumare munizioni", "Sickle": "Per raccogliere fieno nel prato", - "KiteAngryTrapper": "{$CommonItemTooltip.Kite}", + "PumpkinPie": "{$CommonItemTooltip.MinorStats}", "TatteredFairyWings": "{$CommonItemTooltip.FlightAndSlowfall}", "SpiderEgg": "Evoca un ragno", "MagicalPumpkinSeed": "Evoca una piccola zucca", @@ -4253,35 +4284,35 @@ "UnluckyYarn": "Evoca un gattino nero", "TheHorsemansBlade": "Evoca teste di zucca per attaccare i tuoi nemici", "SpookyWings": "{$CommonItemTooltip.FlightAndSlowfall}", - "GhostManifestation": "{$PaintingArtist.Crowno}", - "Graveyard": "{$PaintingArtist.Crowno}", - "Reborn": "{$PaintingArtist.Crowno}", + "SpookyHelmet": "Aumenta il numero massimo dei tuoi seguaci\nAumenta il danno dei seguaci dell'11%", + "SpookyBreastplate": "Aumenta il numero massimo dei tuoi seguaci\nAumenta il danno dei seguaci dell'11%", + "SpookyLeggings": "Aumenta il numero massimo dei tuoi seguaci\nAumenta il danno dei seguaci dell'11%", "CursedSapling": "Evoca uno arboscello maledetto che ti segue", "PumpkinMoonMedallion": "Evoca la luna a zucca", - "Nevermore": "{$PaintingArtist.Crowno}", + "NecromanticScroll": "Aumenta il numero massimo dei tuoi seguaci\nAumenta il danno dei seguaci del 10%", "SniperScope": "Allunga la portata visiva delle pistole ( per allontanare)\nDanno a distanza e probabilità di colpo critico aumentano del 10%", "BreathingReed": "Aumenta la durata del respiro e consente di respirare sott'acqua", "JellyfishDivingGear": "Consente di nuotare e aumenta notevolmente il tempo in apnea\nFa luce sott'acqua", "ArcticDivingGear": "Consente di nuotare e aumenta notevolmente il tempo in apnea\nIllumina sott'acqua e dona maggiore mobilità sul ghiaccio", - "GnomeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.Gnome}", + "FrostsparkBoots": "Consente di volare, correre velocissimo e dona maggiore mobilità sul ghiaccio\nVelocità di movimento aumentata del 7%", "FartInABalloon": "Per eseguire un salto doppio\nAumenta l'altezza del salto", - "DandelionBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.Dandelion}", - "GolfPainting3": "{$PaintingArtist.Crowno}", - "ArkhalisWings": "{$ItemTooltip.ArkhalisHat}\n{$CommonItemTooltip.FlightAndSlowfall}", + "PapyrusScarab": "Aumenta il numero massimo dei tuoi seguaci\nAumenta il danno e lo spintone dei tuoi seguaci", + "CelestialStone": "Incremento minimo a danni, velocità in mischia, probabilità di colpo critico,\nrigenerazione vita, difesa, velocità di raccolta e spintone dei seguaci", + "Hoverboard": "{$CommonItemTooltip.FlightAndSlowfall}\nTieni premuto GIÙ e SALTA per sollevarti", "Present": "{$CommonItemTooltip.RightClickToOpen}", "Flipper": "Abilita al nuoto", "RedRyder": "Non ti sparare in un occhio!", "FestiveWings": "{$CommonItemTooltip.FlightAndSlowfall}", "BladeofGrass": "Può avvelenare i nemici", "EldMelter": "Utilizza la gelatina come munizione", - "KiteGoldfish": "{$CommonItemTooltip.Kite}", + "ChristmasPudding": "{$CommonItemTooltip.MinorStats}", "ReindeerBells": "Evoca una renna cavalcabile", "CnadyCanePickaxe": "Può estrarre meteorite", - "KiteBunnyCrimson": "{$CommonItemTooltip.Kite}", - "KiteBunnyCorrupt": "{$CommonItemTooltip.Kite}", + "SugarCookie": "{$CommonItemTooltip.MinorStats}", + "GingerbreadCookie": "{$CommonItemTooltip.MinorStats}", "HandWarmer": "Offre immunità dal freddo e dagli effetti di congelamento", "Coal": "Quest'anno sei stato birichino", - "GolfPainting2": "{$PaintingArtist.Crowno}", + "Toolbox": "Aumenta la collocazione degli oggetti e la portata degli attrezzi di 1", "DogWhistle": "Evoca un cucciolo", "ChristmasTreeSword": "Spara decorazioni natalizie", "ChainGun": "50% di probabilità di non consumare munizioni", @@ -4297,7 +4328,7 @@ "JungleRose": "Graziosa, oh com'è graziosa", "FeralClaws": "Velocità nel corpo a corpo aumentata del 12%", "AnkletoftheWind": "Velocità di movimento aumentata del 10%", - "GolfClubIron": "{$CommonItemTooltip.GolfIron}", + "StaffofRegrowth": "Crea erba e muschio sulla terra e sulla pietra\nAumenta la raccolta di piante alchemiche quando si usa per raccogliere", "WhoopieCushion": "Può disturbare gli altri", "HeavyWorkBench": "Si usa per la creazione avanzata", "AmmoBox": "Consumo munizioni ridotto del 20%", @@ -4318,7 +4349,7 @@ "SteampunkBoiler": "{$CommonItemTooltip.SpecialCrafting}", "HoneyDispenser": "{$CommonItemTooltip.SpecialCrafting}", "BrickLayer": "Aumenta la velocità di posizionamento delle mattonelle", - "GolfPainting1": "{$PaintingArtist.Crowno}", + "ExtendoGrip": "Aumenta la portata delle mattonelle", "PaintSprayer": "Colora automaticamente gli oggetti piazzati", "PortableCementMixer": "Aumenta la velocità di posizionamento dei muri", "CelestialMagnet": "Aumenta la portata di raccolta delle stelle di mana", @@ -4327,8 +4358,8 @@ "CelestialCuffs": "Aumenta la portata di raccolta delle stelle di mana\nRipristinano il mana quando vengono danneggiate", "PulseBow": "Spara una freccia carica", "NaturesGift": "Consumo mana ridotto del 6%", - "KiteSandShark": "{$CommonItemTooltip.Kite}", - "KiteShark": "{$CommonItemTooltip.Kite}", + "PadThai": "{$CommonItemTooltip.MinorStats}", + "Pho": "{$CommonItemTooltip.MinorStats}", "RestorationPotion": "Ricarica pozione ridotta", "Gatligator": "50% di probabilità di non consumare munizioni\nMolto impreciso", "WaterGun": "Spruzza uno schizzo d'acqua innocuo", @@ -4341,14 +4372,14 @@ "Gel": "Sia gustoso che infiammabile", "JunglePants": "Aumenta il mana massimo di 20\nAumenta la possibilità di colpo critico magico del 4%", "NeonTetra": "Le sue squame colorate potrebbero vendere bene.", - "Grapefruit": "{$CommonItemTooltip.MinorStats}", + "GoldenCarp": "Niente male. Probabilmente si venderà bene.", "MiningPotion": "Aumenta la velocità di estrazione del 25%", "HeartreachPotion": "Aumenta la portata di raccolta dei cuori", - "DungeonFishingCrateHard": "{$ItemTooltip.DungeonFishingCrate}", + "CalmingPotion": "Riduce l'aggressività del nemico", "BuilderPotion": "Aumenta la velocità e la portata di posizionamento", "TitanPotion": "Aumenta lo spintone", "FlipperPotion": "Ti consente di muoverti agilmente nei liquidi", - "DivineEye": "{$PaintingArtist.Darthkitten}", + "SummoningPotion": "Aumenta il numero massimo dei tuoi seguaci", "TrapsightPotion": "Ti consente di vedere le fonti di pericolo nei paraggi", "WoodenCrate": "{$CommonItemTooltip.RightClickToOpen}", "IronCrate": "{$CommonItemTooltip.RightClickToOpen}", @@ -4359,36 +4390,36 @@ "RagePotion": "Aumenta la probabilità critica del 10%", "InfernoPotion": "Incendia i nemici vicini", "WrathPotion": "Aumenta il danno del 10%", - "GolfClubDriver": "{$CommonItemTooltip.GolfDriver}", + "StickyBomb": "Lanciare potrebbe essere difficile.", "RecallPotion": "Ti teletrasporta a casa", "TeleportationPotion": "Ti teletrasporta in un luogo a caso", "LovePotion": "Si lancia contro qualcuno per farlo innamorare", "StinkPotion": "Si lancia contro qualcuno per farlo puzzare", - "BandageBoy": "{$PaintingArtist.Darthkitten}", + "FishingPotion": "Migliora le capacità di pesca", "SonarPotion": "Rileva i pesci presi all'amo", "CratePotion": "Aumenta la probabilità di ottenere una cassa", "WarmthPotion": "Riduce il danno dalle fonti di freddo", - "VisitingThePyramids": "{$PaintingArtist.Leinfors}", - "Uluru": "{$PaintingArtist.darthmorf}", + "BeeHeadgear": "Aumenta il danno dei seguaci del 4%\nAumenta il numero massimo dei tuoi seguaci", + "BeeBreastplate": "Aumenta il danno dei seguaci del 4%\nAumenta il numero massimo dei tuoi seguaci", "BeeGreaves": "Aumenta il danno dei seguaci del 5%", "HornetStaff": "Evoca un calabrone che combatte per te", "ImpStaff": "Evoca un diavoletto che combatte per te", - "Oasis": "{$PaintingArtist.Khaios}", - "LifeAboveTheSand": "{$PaintingArtist.Zoomo}", - "SnakesIHateSnakes": "{$PaintingArtist.Xman101}", + "AnglerHat": "Aumenta il livello di pesca", + "AnglerVest": "Aumenta il livello di pesca", + "AnglerPants": "Aumenta il livello di pesca", "Sunglasses": "Migliora il tuo look!", - "TheSandsOfSlime": "{$PaintingArtist.Criddle}", - "JawsOfDeath": "{$PaintingArtist.Darthkitten}", - "BurningSpirit": "{$PaintingArtist.Zoomo}", + "SpiderMask": "Aumenta il numero massimo dei tuoi seguaci\nAumenta il danno dei seguaci del 6%", + "SpiderBreastplate": "Aumenta il numero massimo dei tuoi seguaci\nAumenta il danno dei seguaci del 6%", + "SpiderGreaves": "Aumenta il numero massimo dei tuoi seguaci\nAumenta il danno dei seguaci del 6%", "HighTestFishingLine": "La lenza non si romperà mai", - "FruitSalad": "{$CommonItemTooltip.MinorStats}", + "AnglerEarring": "Migliora le capacità di pesca", "TackleBox": "Riduce la probabilità di consumo dell'esca", "WizardHat": "Danno magico aumentato del 15%", "ZephyrFish": "Evoca un pesce zefiro", "FrogLeg": "Aumenta la velocità di salto e consente il salto automatico\nAumenta la resistenza alla caduta", - "Dragonfruit": "{$CommonItemTooltip.MediumStats}", - "KiteJellyfishPink": "{$CommonItemTooltip.Kite}", - "KiteJellyfishBlue": "{$CommonItemTooltip.Kite}", + "CookedFish": "{$CommonItemTooltip.MinorStats}", + "CookedShrimp": "{$CommonItemTooltip.MinorStats}", + "Sashimi": "{$CommonItemTooltip.MinorStats}", "FinWings": "{$CommonItemTooltip.FlightAndSlowfall}", "OpticStaff": "Chiama i Gemelli a combattere per te", "RedHat": "Puzza un po'...", @@ -4421,13 +4452,13 @@ "HunterPotion": "Mostra la posizione dei nemici", "GravitationPotion": "Permette il controllo della gravità", "IllegalGunParts": "Proibita in molti luoghi", - "GolfClubWedge": "{$CommonItemTooltip.GolfWedge}", - "BetsyWings": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", + "GoldenKey": "Apre una cassa d'oro o da dungeon", + "ShadowKey": "Apre tutte le casse ombra", "Furnace": "Serve a fondere i minerali", "Loom": "Serve a creare abiti", "IronAnvil": "Serve a creare oggetti dalle barre di metallo", "Keg": "Serve a produrre birra", - "KiteManEater": "{$CommonItemTooltip.Kite}", + "BowlofSoup": "{$CommonItemTooltip.MinorStats}", "WorkBench": "Si usa per la creazione di base", "GoblinBattleStandard": "Evoca un esercito di goblin", "Sawmill": "Serve per la lavorazione del legno avanzata", @@ -4440,7 +4471,7 @@ "MythrilHat": "Danno boomerang aumentato del 12%\nPossibilità di colpo critico a distanza aumentata del 7%", "CobaltDrill": "Per estrarre mitrilio e oricalco", "MythrilDrill": "Per estrarre adamantio e titanio", - "WingsNebula": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", + "DaoofPow": "Può confondere\nTrova i pezzi interni", "Compass": "Mostra posizione orizzontale", "DivingGear": "Abilita al nuoto\nAumenta moltissimo il respiro sott'acqua", "GPS": "Mostra posizione\nIndica il tempo", @@ -4454,14 +4485,14 @@ "AdamantiteBreastplate": "Danno aumentato del 6%", "AdamantiteLeggings": "Possibilità di colpo critico aumentata del 4%\nVelocità di movimento aumentata del 5%", "SpectreBoots": "Consente di volare\nColui che li indossa può correre velocissimo", - "FruitJuice": "{$CommonItemTooltip.MinorStats}", + "Toolbelt": "Aumenta la portata di posizionamento dei blocchi", "HolyWater": "Sparge consacrazione su alcuni blocchi", - "CrimsonFishingCrateHard": "{$ItemTooltip.CrimsonFishingCrate}", + "UnholyWater": "Sparge corruzione su alcuni blocchi", "FairyBell": "Evoca una fata magica", "SuspiciousLookingEye": "Evoca l'Occhio di Cthulhu", "ClockworkAssaultRifle": "Tre raffiche\nSolo il primo colpo consuma munizioni", "MoonCharm": "Di notte trasforma il portatore in un lupo mannaro", - "KiteCrawltipede": "{$CommonItemTooltip.Kite}", + "Ruler": "Crea delle linee sullo schermo per posizionare i blocchi", "SorcererEmblem": "Danno magico aumentato del 15%", "BandofRegeneration": "Rigenera la vita lentamente", "WarriorEmblem": "Danno da mischia aumentato del 15%", @@ -4487,16 +4518,16 @@ "AdamantiteForge": "Per fondere adamantio e titanio", "MythrilAnvil": "Per ricavare oggetti da barre di mitrilio, oricalco, adamantio e titanio", "UnicornHorn": "Appuntito e magico!", - "CrownosWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "DarkShard": "A volte portato dalle creature nei deserti corrotti", "LightShard": "A volte portato dalle creature nei deserti di luce", "RedPressurePlate": "Si attiva quando calpestata", "CloudinaBottle": "Per eseguire un salto doppio", "SpellTome": "Può essere incantato", - "PrismaticPunch": "{$CommonItemTooltip.MediumStats}", + "StarCloak": "Fa cadere le stelle se ferito", "Megashark": "50% di probabilità di non consumare munizioni\nFratello maggiore del Minishark", "Shotgun": "Spara una rosa di proiettili", - "FrozenCrateHard": "{$CommonItemTooltip.RightClickToOpen}", - "Mango": "{$CommonItemTooltip.MinorStats}", + "PhilosophersStone": "Riduce la ricarica della pozione curativa", + "TitanGlove": "Aumenta lo spintone nel corpo a corpo", "HermesBoots": "Colui che li indossa può correre velocissimo", "GreenPressurePlate": "Si attiva quando calpestata", "GrayPressurePlate": "Si attiva quando un giocatore ci passa sopra", @@ -4510,10 +4541,10 @@ "HallowedHelmet": "Danno boomerang aumentato del 15%\nPossibilità di colpo critico a distanza aumentata dell'8%", "CrossNecklace": "Aumenta la durata dell'invincibilità dopo aver subito danni", "ManaFlower": "Consumo mana ridotto dell'8%\nUtilizza le pozioni mana automaticamente in caso di bisogno", - "Elderberry": "{$CommonItemTooltip.MinorStats}", + "MechanicalWorm": "Evoca il Distruttore", "MechanicalSkull": "Evoca lo Skeletron primario", "HallowedHeadgear": "Aumenta il mana massimo di 100\nProbabilità di colpo critico e danno magico aumentate del 12%", - "KiteYellow": "{$CommonItemTooltip.Kite}", + "HallowedMask": "Probabilità di colpo critico e danno da mischia aumentata del 10%\nVelocità in mischia aumentata del 10%", "DemoniteOre": "Pulsa di energia oscura", "SlimeCrown": "Evoca lo Slime re", "LightDisc": "Si accumula (fino a 5)", @@ -4535,12 +4566,12 @@ "Vilethorn": "Evoca una spina vile", "Starfury": "Fa piovere le stelle dal cielo\nForgiato con la furia del cielo", "PurificationPowder": "Elimina il male", - "SmoothieofDarkness": "{$CommonItemTooltip.MinorStats}", + "RedsWings": "{$CommonItemTooltip.DevItem}", "RedsHelmet": "{$CommonItemTooltip.DevItem}", "RedsBreastplate": "{$CommonItemTooltip.DevItem}", "RedsLeggings": "{$CommonItemTooltip.DevItem}", "Fish": "Evoca un pinguino piccolo", - "BloodOrange": "{$CommonItemTooltip.MinorStats}", + "VilePowder": "Scaccia la Consacrazione", "Frostbrand": "Spara un dardo di ghiaccio", "RedPotion": "Solo per chi ne è degno", "RottenChunk": "Gustoso!", @@ -4557,7 +4588,7 @@ "IceBlade": "Spara un dardo di ghiaccio", "IceBow": "Spara frecce di gelo", "FrostStaff": "Spara una corrente di gelo", - "BlueCultistCasterBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CultistDevote}", + "Jetpack": "{$CommonItemTooltip.FlightAndSlowfall}\nPremi SU per decollare velocemente", "ButterflyWings": "{$CommonItemTooltip.FlightAndSlowfall}", "FallenStar": "Sparisce dopo l'alba", "Seaweed": "Evoca una tartaruga", @@ -4588,14 +4619,14 @@ "GreenWrench": "Posiziona cavi verdi", "BluePressurePlate": "Si attiva quando un giocatore ci passa sopra", "YellowPressurePlate": "Si attiva quando qualsiasi creatura (non il giocatore) ci passa sopra", - "FrozenCrate": "{$CommonItemTooltip.RightClickToOpen}", + "DiscountCard": "Fa ottenere sconti nei negozi", "LuckyCoin": "Colpendo i nemici a volte si guadagneranno più monete", "UnicornonaStick": "Un momento magico!", "SandstorminaBottle": "Consente di compiere un salto doppio superiore", - "CanOfWorms": "{$CommonItemTooltip.RightClickToOpen}", + "CharmofMyths": "Rigenera la vita e riduce la ricarica delle pozioni curative", "MoonShell": "Trasforma il portatore in un lupo mannaro di notte e in un tritone quando entra in acqua", "StarVeil": "Causa la caduta delle stelle e aumenta la durata dell'invincibilità dopo aver subito danni", - "BloodyMoscato": "{$CommonItemTooltip.MinorStats}", + "WaterWalkingBoots": "Per camminare sull'acqua", "MiningHelmet": "Fa luce quando si indossa", "AdhesiveBandage": "Immune dal sanguinamento", "ArmorPolish": "Immune da armatura rotta", @@ -4606,28 +4637,28 @@ "Nazar": "Immune dalla maledizione", "Vitamins": "Immune dalla debolezza", "TrifoldMap": "Immune dalla confusione", - "Lemon": "{$CommonItemTooltip.MinorStats}", - "TropicalSmoothie": "{$CommonItemTooltip.MinorStats}", - "PinaColada": "{$CommonItemTooltip.MinorStats}", - "PeachSangria": "{$CommonItemTooltip.MinorStats}", + "PowerGlove": "Aumenta lo spintone nel corpo a corpo\nVelocità nel corpo a corpo aumentata del 12%", + "LightningBoots": "Consente di volare\nChi li indossa può correre incredibilmente veloce", + "SunStone": "Aumenta tutti i parametri se si indossa di giorno", + "MoonStone": "Aumenta tutti i parametri se si indossa di notte", "ArmorBracing": "Immune da debolezza e armatura rotta", "MedicatedBandage": "Immune da veleno e sanguinamento", "ThePlan": "Immune da rallentamento e confusione", "CountercurseMantra": "Immune da silenzio e maledizione", "CoinGun": "Utilizza le monete come munizioni\nLe monete di valore superiore infliggono più danni", "LavaCharm": "Fornisce 7 secondi di immunità dalla lava", - "BananaDaiquiri": "{$CommonItemTooltip.MinorStats}", - "Pineapple": "{$CommonItemTooltip.MinorStats}", + "ObsidianWaterWalkingBoots": "Per camminare sull'acqua\nDona immunità dai blocchi di fuoco", + "LavaWaders": "Per camminare sull'acqua e sulla lava\nRende immuni dai blocchi di fuoco e dona 7 secondi di immunità dalla lava", "BoneWand": "Posiziona osso", "LeafWand": "Posiziona foglie", "FlyingCarpet": "Il portatore può fluttuare per qualche secondo", "AvengerEmblem": "Danno aumentato del 12%", - "Lemonade": "{$CommonItemTooltip.MinorStats}", + "MechanicalGlove": "Aumenta lo spintone nel corpo a corpo\nDanni e velocità in mischia aumentano del 12%", "LandMine": "Esplode quando si calpesta", - "Starfruit": "{$CommonItemTooltip.MediumStats}", + "PaladinsShield": "Assorbe il 25% di danni inflitti ai tuoi compagni di squadra\nSi attiva soltanto con più del 25% di vita", "Umbrella": "Tenendolo in mano scenderai più lentamente", "ChlorophyteOre": "Reagisce alla luce", - "GrapeJuice": "{$CommonItemTooltip.MajorStats}", + "SteampunkWings": "Per volare e scendere lentamente", "IceSkates": "Maggiore mobilità sul ghiaccio\nIl ghiaccio non si rompe se ci cadi sopra", "SnowballLauncher": "Lancia rapidamente palle di neve", "ClimbingClaws": "Per scivolare sui muri\nMigliora l'abilità se si abbina ai ramponi", @@ -4644,7 +4675,7 @@ "Campfire": "La rigenerazione vita aumenta vicino a un fuoco di bivacco", "Marshmallow": "Mettilo su uno spiedino e abbrustoliscilo sulla fiamma", "MarshmallowonaStick": "Da abbrustolire sulla fiamma!", - "Coconut": "{$CommonItemTooltip.MinorStats}", + "CookedMarshmallow": "{$CommonItemTooltip.MinorStats}", "ShoeSpikes": "Per scivolare sui muri\nMigliora l'abilità se si abbina agli artigli da scalata", "TigerClimbingGear": "Per arrampicarsi sui muri", "Tabi": "Per scattare\nPremi due volte in una direzione", @@ -4660,19 +4691,19 @@ "EatersBone": "Evoca un mangiatore di anime piccolo", "BlendOMatic": "Si usa per ricavare oggetti", "MeatGrinder": "Si usa per ricavare oggetti", - "Rambutan": "{$CommonItemTooltip.MinorStats}", + "Extractinator": "Trasforma sabbia/fango/fossili in qualcosa di più utile\nPer usare: colloca sabbia/fango/fossili nell'estrattificatore", "Solidifier": "Si usa per ricavare oggetti", "ActuationAccessory": "Colloca automaticamente gli azionatori su oggetti piazzati", "ActuationRod": "Attiva gli azionatori", "AlchemyTable": "33% di probabilità di non consumare ingredienti per realizzare pozioni", "AncientBattleArmorHat": "Danno seguaci e magico aumentato del 15%", - "AppleJuice": "{$CommonItemTooltip.MinorStats}", - "WoodenCrateHard": "{$ItemTooltip.WoodenCrate}", + "AncientBattleArmorPants": "Aumenta il numero massimo dei tuoi seguaci", + "AncientBattleArmorShirt": "Aumenta il mana massimo di 80", "AncientHorn": "Evoca un basilisco cavalcabile", - "BloodNautilusBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodNautilus}", - "GoblinSharkBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.GoblinShark}", + "AnglerTackleBag": "La lenza non si romperà mai; riduce la probabilità di consumo dell'esca; migliora le capacità di pesca", + "ArchitectGizmoPack": "Aumenta la velocità e la portata di posizionamento di mattonelle e muri\nColora automaticamente gli oggetti piazzati", "AviatorSunglasses": "Esprimi la tua natura da wingman\nFantastico per impersonare gli streamer!", - "KitePigron": "{$CommonItemTooltip.Kite}", + "Bacon": "{$CommonItemTooltip.MinorStats}\nPancetta? Pancetta...", "BalloonHorseshoeFart": "Per eseguire un salto doppio\nAumenta l'altezza del salto e annulla i danni da caduta", "BalloonHorseshoeHoney": "Rilascia api quando si danneggia\nAumenta l'altezza del salto e annulla i danni da caduta", "BalloonHorseshoeSharkron": "Per eseguire un salto doppio\nAumenta l'altezza del salto e annulla i danni da caduta", @@ -4680,26 +4711,26 @@ "BeesKnees": "Le frecce di legno si trasformano in una colonna di api", "BejeweledValkyrieBody": "{$CommonItemTooltip.DevItem}\nAdorno ed elegante per librarsi tra i cieli tempestosi", "BejeweledValkyrieHead": "{$CommonItemTooltip.DevItem}\nDiventa il vento e cavalca il fulmine.", - "BloodEelBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodEelHead}", + "BejeweledValkyrieWing": "{$CommonItemTooltip.DevItem}\nLa piattaforma barriera satellitare della valchiria è sicurissima... il più delle volte.", "BewitchingTable": " per avere più seguaci", "Bladetongue": "Sputa uno spruzzo di icore al contatto", "BlessedApple": "Evoca un unicorno cavalcabile", - "CorruptFishingCrateHard": "{$ItemTooltip.CorruptFishingCrate}", - "JungleFishingCrateHard": "{$ItemTooltip.JungleFishingCrate}", + "BloodWater": "Diffonde il Cremisi su alcuni blocchi", + "BombFish": "Una piccola esplosione che distruggerà alcune mattonelle", "BoneCampfire": "La rigenerazione vita aumenta vicino a un fuoco di bivacco", "BoneRattle": "Evoca un mostro bambino", "BoneTorch": "Emette una luce mortale", "BoosterTrack": "Martella per cambiare direzione", - "GolfClubPutter": "{$CommonItemTooltip.GolfPutter}", - "HallowedFishingCrateHard": "{$ItemTooltip.HallowedFishingCrate}", - "KiteRedAndYellow": "{$CommonItemTooltip.Kite}", + "BottomlessBucket": "Contiene una quantità di acqua infinita", + "BouncyBomb": "Una piccola esplosione che distruggerà alcune mattonelle\nMolto saltellante", + "BouncyDynamite": "Questa idea sarà terribile", "BouncyGlowstick": "Funziona quando si bagna", "BouncyGrenade": "Una piccola esplosione che non distruggerà mattonelle\nMolto saltellante", - "WillsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "BrainOfConfusion": "Potrebbe confondere i nemici vicini dopo averli colpiti", "BrainScrambler": "Evoca uno Scutlix cavalcabile", "BubbleGun": "Spara rapidamente bolle potenti", "ButchersChainsaw": "I nemici colpiti emettono scintille", - "BloodSquidBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodSquid}", + "CelestialShell": "Trasforma il portatore in un lupo mannaro di notte e in un tritone quando entra in acqua\nPiccoli aumenti a tutti i parametri", "CelestialSigil": "Evoca il fato imminente", "CellPhone": "Mostra tutto\nTi consente di tornare a casa quando vuoi", "ClingerStaff": "Evoca un muro di fiamme maledette", @@ -4733,9 +4764,9 @@ "FloatingIslandFishingCrate": "{$CommonItemTooltip.RightClickToOpen}", "FlowerBoots": "I fiori crescono quando passi sull'erba", "FlyingKnife": "Lancia un coltello che può essere controllato in volo", - "GolfBallDyedBrown": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedBlue": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedBlack": "{$CommonItemTooltip.GolfBall}", + "FossilHelm": "Velocità di lancio aumentata del 20%", + "FossilPants": "Possibilità colpo critico da lancio aumentata del 15%", + "FossilShirt": "Danni da lancio aumentati del 20%", "FragmentNebula": "Il potere di una galassia risiede in questo frammento", "FragmentSolar": "La furia dell'universo risiede in questo frammento", "FragmentStardust": "Le particelle estasianti ruotano intorno a questo frammento", @@ -4752,8 +4783,8 @@ "GoblinTech": "Mostra velocità di movimento, danni al secondo e minerale prezioso", "GoldPickaxe": "Può estrarre meteorite", "GoldRing": "Aumenta la portata di raccolta delle monete", - "Plum": "{$CommonItemTooltip.MinorStats}", - "KiteBunny": "{$CommonItemTooltip.Kite}", + "GreedyRing": "Aumenta la portata di raccolta delle monete e i negozi hanno prezzi più bassi\nColpendo i nemici a volte si guadagneranno più monete", + "GrubSoup": "{$CommonItemTooltip.MinorStats}", "HallowedFishingCrate": "{$CommonItemTooltip.RightClickToOpen}", "HardySaddle": "Evoca una tartaruga cavalcabile", "HellwingBow": "Frecce di legno si trasformano in pipistrelli infuocati", @@ -4762,7 +4793,7 @@ "HoneyedGoggles": "Evoca un'ape cavalcabile", "IceMirror": "Guarda nello specchio per tornare a casa", "IchorCampfire": "La rigenerazione vita aumenta vicino a un fuoco di bivacco", - "EyeballFlyingFishBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.EyeballFlyingFish}", + "JimsWings": "{$CommonItemTooltip.DevItem}", "JungleFishingCrate": "{$CommonItemTooltip.RightClickToOpen}", "LargeAmber": "Per la modalità Rubagemma; appare quando muori", "LaserRuler": "Crea delle linee sullo schermo per posizionare i blocchi", @@ -4790,7 +4821,7 @@ "LokisHelm": "{$CommonItemTooltip.DevItem}\nIl disordine deriva dall'ordine, la paura dal coraggio e la debolezza dalla forza", "LokisPants": "{$CommonItemTooltip.DevItem}\nLe ruote della giustizia si muovono piano ma macinano bene.", "LokisShirt": "{$CommonItemTooltip.DevItem}\nConosci te stesso e conosci il nemico. Migliaia di battaglie, migliaia di vittorie...", - "ZombieMermanBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.ZombieMerman}", + "LokisWings": "{$CommonItemTooltip.DevItem}\nRendi i tuoi piani scuri e impenetrabili come la notte e quando ti muovi colpisci come un fulmine a ciel sereno.", "LunarBar": "Vibra di energia celestiale luminosa", "LunarCraftingStation": "Serve a creare oggetti da frammenti lunari e luminite", "LunarFlareBook": "Fai piovere razzi lunari", @@ -4806,7 +4837,7 @@ "MoneyTrough": "Evoca un salvadanaio volante per depositare i tuoi oggetti", "MoonlordArrow": "Spara alla velocità del suono!", "MoonlordBullet": "Allineali e abbattili...", - "Apricot": "{$CommonItemTooltip.MinorStats}", + "MoonlordTurretStaff": "Evoca un portale lunare per sparare laser contro i nemici", "MothronWings": "{$CommonItemTooltip.FlightAndSlowfall}", "MulticolorWrench": " mentre tieni premuto per modificare le impostazioni dei cavi", "NebulaArcanum": "Evoca grandi quantità di energia astrale per inseguire i nemici", @@ -4817,9 +4848,9 @@ "NebulaMonolith": "Usa una piccola quantità di potere dalla torre della nebulosa", "NightKey": "Contiene l'essenza di molte anime", "NightVisionHelmet": "Migliora la visione", - "GolfBallDyedLimeGreen": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedGreen": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedCyan": "{$CommonItemTooltip.GolfBall}", + "NinjaHood": "Velocità di lancio aumentata del 15%", + "NinjaPants": "Possibilità colpo critico da lancio aumentata del 10%", + "NinjaShirt": "Danni da lancio aumentati del 15%", "PartyBundleOfBalloonTile": "Legati per il piacere di tutti", "PartyGirlGrenade": "Una piccola esplosione che non distruggerà mattonelle", "PartyMonolith": "I palloncini scenderanno dal cielo", @@ -4841,10 +4872,10 @@ "ProjectilePressurePad": "Si attiva quando un proiettile lo tocca", "PsychoKnife": "Ti consente di passare in modalità furtiva", "PutridScent": "Riduce la probabilità che i nemici ti prendano come bersaglio\nProbabilità di colpo critico e danno aumentate del 5%", - "GolfBallDyedYellow": "{$CommonItemTooltip.GolfBall}", + "QueenSpiderStaff": "Evoca un ragno regina che sputa uova contro i nemici", "Radar": "Rileva i nemici attorno a te", "RainbowCampfire": "La rigenerazione vita aumenta vicino a un fuoco di bivacco", - "GolfBallDyedViolet": "{$CommonItemTooltip.GolfBall}", + "RainbowCrystalStaff": "Evoca un cristallo radioso che scaccia i nemici\nI colori, Duca, i colori!", "RazorbladeTyphoon": "Lancia ruote taglienti rapidissime", "RedsYoyo": "{$CommonItemTooltip.DevItem}", "REK": "Mostra il numero di mostri, il numero di uccisioni e le creature rare", @@ -4875,30 +4906,30 @@ "SkiphsHelm": "{$CommonItemTooltip.DevItem}", "SkiphsPants": "{$CommonItemTooltip.DevItem}", "SkiphsShirt": "{$CommonItemTooltip.DevItem}", - "TheBrideBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.TheBride}", - "DTownsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "SkiphsWings": "{$CommonItemTooltip.DevItem}", + "SliceOfCake": "Mangiane in quantità enorme con i tuoi amici.", "SlimeGun": "Spruzza uno schizzo di slime innocuo", "SlimySaddle": "Evoca uno slime cavalcabile", - "KiteKoi": "{$CommonItemTooltip.Kite}", + "SnowCloudBlock": "Lassù fa parecchio freddo", "SnowFallBlock": "Molto meglio di una sfera di neve", "SnowFallWall": "Molto meglio di una sfera di neve", "SolarEruption": "Colpisce con la furia del sole", - "RedsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", - "Hoverboard": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", - "CenxsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "SolarFlareBreastplate": "Danno da mischia aumentato del 22%\nAumenta la probabilità che i nemici ti prendano come bersaglio", + "SolarFlareHelmet": "Possibilità di colpo critico nel corpo a corpo aumentata del 17%\nAumenta la probabilità che i nemici ti prendano come bersaglio", + "SolarFlareLeggings": "Movimento e velocità in mischia aumentano del 15%\nAumenta la probabilità che i nemici ti prendano come bersaglio", "SolarMonolith": "Usa una piccola quantità di potere dalla torre solare", "SolarTablet": "Evoca l'eclissi", "SoulDrain": "Sottrae vita ai nemici", "SpelunkerGlowstick": "Rivela il tesoro nei paraggi", "SpiderStaff": "Chiama i ragni a combattere per te", "SporeSac": "Evoca spore nel tempo per infliggere danni ai nemici", - "GolfClubChlorophyteDriver": "{$CommonItemTooltip.GolfDriver}", + "StardustBreastplate": "Aumenta il numero massimo dei tuoi seguaci\nAumenta il danno dei seguaci del 22%", "StardustCellStaff": "Evoca una cellula di polvere di stella che combatte per te\nColtiva la più bella infezione cellulare", "StardustDragonStaff": "Evoca un drago di polvere di stella che combatte per te\nChi ha bisogno di un'orda di seguaci quando ha un drago gigante?", - "GolfClubDiamondWedge": "{$CommonItemTooltip.GolfWedge}", - "GolfClubShroomitePutter": "{$CommonItemTooltip.GolfPutter}", + "StardustHelmet": "Aumenta il numero massimo dei tuoi seguaci\nAumenta il danno dei seguaci del 22%", + "StardustLeggings": "Aumenta il numero massimo dei tuoi seguaci\nAumenta il danno dei seguaci del 22%", "StardustMonolith": "Usa una piccola quantità di potere dalla torre di polvere di stella", - "FloatingIslandFishingCrateHard": "{$ItemTooltip.FloatingIslandFishingCrate}", + "StickyDynamite": "Lanciare potrebbe essere difficile.", "StickyGrenade": "Una piccola esplosione che non distruggerà mattonelle\nLanciare potrebbe essere difficile.", "Stopwatch": "Mostra la velocità di movimento del giocatore", "StrangeBrew": "Brutto e puzzolente", @@ -4921,7 +4952,7 @@ "TungstenPickaxe": "Può estrarre meteorite", "UltraBrightCampfire": "La rigenerazione vita aumenta vicino a un fuoco di bivacco", "ValkyrieYoyo": "{$CommonItemTooltip.DevItem}", - "BlackCurrant": "{$CommonItemTooltip.MinorStats}", + "ViciousPowder": "Scaccia la Consacrazione", "VineRopeCoil": "Si lancia per ottenere una corda di viticcio su cui arrampicarsi", "VortexBeater": "66% di probabilità di non consumare munizioni\nUn misto catastrofico di bang bang e bum bum!", "VortexBreastplate": "Danno a distanza e probabilità di colpo critico aumentano del 12%\n25% di probabilità di non consumare munizioni", @@ -4935,10 +4966,10 @@ "WeightedPressurePlateOrange": "Si attiva quando un giocatore ci passa sopra", "WeightedPressurePlatePink": "Si attiva quando un giocatore ci passa sopra", "WeightedPressurePlatePurple": "Si attiva quando un giocatore ci passa sopra", - "Peach": "{$CommonItemTooltip.MinorStats}", + "WingsNebula": "{$CommonItemTooltip.FlightAndSlowfall}", "WingsSolar": "{$CommonItemTooltip.FlightAndSlowfall}", "WingsStardust": "{$CommonItemTooltip.FlightAndSlowfall}", - "GolfClubTitaniumIron": "{$CommonItemTooltip.GolfIron}", + "WingsVortex": "{$CommonItemTooltip.FlightAndSlowfall}", "WireBulb": "Accende le lampadine per ogni cavo colorato", "WireKite": "Consente il massimo controllo dei cavi\n mentre tieni premuto per modificare le impostazioni dei cavi", "WirePipe": "Separa i percorsi dei cavi\nSi può anche martellare!", @@ -4950,7 +4981,7 @@ "Yoraiz0rHead": "{$CommonItemTooltip.DevItem}", "Yoraiz0rPants": "{$CommonItemTooltip.DevItem}", "Yoraiz0rShirt": "{$CommonItemTooltip.DevItem}", - "GolfClubPearlwoodDriver": "{$CommonItemTooltip.GolfDriver}", + "Yoraiz0rWings": "{$CommonItemTooltip.DevItem}\nQualsiasi cosa faccia il tuo accessorio, non è un errore!", "YoyoBag": "Rende l'utente un esperto di yo-yo", "YoYoGlove": "Consente di usare due yo-yo contemporaneamente", "BloodMoonRising": "{$PaintingArtist.Garner}", @@ -5148,7 +5179,7 @@ "BlackSlimeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BlackSlime}", "BlueArmoredBonesBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BlueArmoredBones}", "BlueCultistArcherBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CultistArcherBlue}", - "SkiphsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "BlueCultistCasterBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.None}", "BlueCultistFighterBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.None}", "BoneLeeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BoneLee}", "ClingerBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.Clinger}", @@ -5402,22 +5433,22 @@ "ApprenticeScarf": "{$ItemTooltip.HuntressBuckler}", "SquireShield": "{$ItemTooltip.HuntressBuckler}", "MonkBelt": "{$ItemTooltip.HuntressBuckler}", - "GolfClubStoneIron": "{$CommonItemTooltip.GolfIron}", + "ApprenticeAltHead": "Aumenta il numero massimo di sentinelle\nDanno dei seguaci e magico aumentato del 10%", "ApprenticeAltPants": "Danno dei seguaci aumentato del 20% e probabilità di colpo critico magico aumentata del 25%", "ApprenticeAltShirt": "Danno dei seguaci aumentato del 30% e danno magico aumentato del 15%", - "GolfClubGoldWedge": "{$CommonItemTooltip.GolfWedge}", + "ApprenticeHat": "Aumenta il numero massimo di sentinelle e riduce il costo di mana del 10%", "ApprenticeRobe": "Danno dei seguaci aumentato del 20% e danno magico aumentato del 10%", "ApprenticeStaffT3": "Spruzza miasma che riduce le difese!", - "GoldenCrateHard": "{$ItemTooltip.GoldenCrate}", + "ApprenticeTrousers": "Danno dei seguaci aumentato del 10% e velocità di movimento aumentata del 20%", "BookStaff": "Chissà chi ha attaccato un tomo della saggezza infinita a un bastone...\n per scatenare un potente tornado", - "GolfBallDyedSkyBlue": "{$CommonItemTooltip.GolfBall}", + "DD2BallistraTowerT1Popper": "Una torre lenta ma a danno elevato che spara dardi perforanti\n{$CommonItemTooltip.EtherianManaCost10}", "DD2BetsyBow": "Tira frecce separanti, infligge più danni ai nemici in aria", "DD2ElderCrystal": "Piazza il piedistallo del cristallo di Eternia per evocare i portali di Etheria", "DD2ElderCrystalStand": "Sostiene il cristallo di Eternia", "DD2EnergyCrystal": "Spesso si usa per manifestare la volontà di qualcuno sotto forma fisica di difesa", - "GolfBallDyedRed": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedTeal": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedPurple": "{$CommonItemTooltip.GolfBall}", + "DD2ExplosiveTrapT1Popper": "Una trappola che esplode quando i nemici si avvicinano\n{$CommonItemTooltip.EtherianManaCost10}", + "DD2FlameburstTowerT1Popper": "Una torre di velocità media che spara meteoriti esplosivi\n{$CommonItemTooltip.EtherianManaCost10}", + "DD2LightningAuraT1Popper": "Un'aura che lancia ripetutamente scariche ai nemici al suo interno\n{$CommonItemTooltip.EtherianManaCost10}", "DD2PetDragon": "Evoca un drago", "DD2PetGato": "Evoca un gato", "DD2PetGhost": "Evoca un flickerwick per illuminare", @@ -5425,77 +5456,47 @@ "DD2SquireBetsySword": "Sprigiona l'energia del cuore", "DD2SquireDemonSword": " per difendere con uno scudo", "DefenderMedal": "Valuta per fare affari con il taverniere", - "ShuckedOyster": "{$CommonItemTooltip.MinorStats}", + "HuntressAltHead": "Aumenta il numero massimo di sentinelle\nDanno dei seguaci aumentato del 10% e possibilità colpo critico a distanza", "HuntressAltPants": "Danno dei seguaci aumentato del 25% e velocità di movimento aumentata del 20%", "HuntressAltShirt": "Danno dei seguaci e a distanza aumentato del 25%", - "GolfClubBronzeWedge": "{$CommonItemTooltip.GolfWedge}", + "HuntressBuckler": "Aumenta il numero massimo di sentinelle\nAumenta il danno dei seguaci del 10%", "HuntressJerkin": "Danno dei seguaci e a distanza aumentato del 20%", "HuntressPants": "Danno dei seguaci aumentato del 10% e velocità di movimento aumentata del 20%", - "GolfClubWoodDriver": "{$CommonItemTooltip.GolfDriver}", - "Oyster": "{$CommonItemTooltip.RightClickToOpen}", + "HuntressWig": "Aumenta il numero massimo di sentinelle e la possibilità di attacco critico a distanza del 10%", + "MonkAltHead": "Aumenta il numero massimo di sentinelle e i danni da mischia e dei seguaci del 20%", "MonkAltPants": "Danno dei seguaci, velocità di movimento e probabilità colpo critico in mischia aumentati del 20%", "MonkAltShirt": "Danni dei seguaci e velocità in mischia aumentati del 20%", - "GolfClubMythrilIron": "{$CommonItemTooltip.GolfIron}", + "MonkBrows": "Aumenta il numero massimo di sentinelle e la velocità di attacco in mischia del 20%", "MonkPants": "Danno dei seguaci aumentato del 10%,\nprobabilità colpi critici aumentata del 10% e velocità di movimento aumentata del 20%", "MonkShirt": "Danno dei seguaci e in mischia aumentato del 20%", "MonkStaffT1": "Si carica di potere quando si usa per schiacciare i nemici", "MonkStaffT2": "Evoca i fantasmi quando colpisce i nemici", "MonkStaffT3": " mentre tieni premuto per lanciare un altro attacco!", - "GolfClubRustyPutter": "{$CommonItemTooltip.GolfPutter}", - "IronCrateHard": "{$ItemTooltip.IronCrate}", + "SquireAltHead": "Aumenta il numero massimo di sentinelle e ti dona 10% di danno dei seguaci", + "SquireAltPants": "Danno dei seguaci aumentato del 20%, probabilità colpi critici e velocità di movimento aumentata del 30%", "SquireAltShirt": "Danno dei seguaci aumentato del 30% e rigenerazione vita enormemente aumentata", - "GolfClubLeadPutter": "{$CommonItemTooltip.GolfPutter}", + "SquireGreatHelm": "Aumenta il numero massimo di sentinelle e la tua rigenerazione vita", "SquireGreaves": "Danno dei seguaci aumentato del 15%,\nprobabilità colpi critici in mischia e velocità di movimento aumentate del 20%", "SquirePlating": "Danno dei seguaci e in mischia aumentato del 15%", "ArkhalisShirt": "{$ItemTooltip.ArkhalisHat}", "ArkhalisPants": "{$ItemTooltip.ArkhalisHat}", - "LobsterTail": "{$CommonItemTooltip.MediumStats}", + "ArkhalisWings": "{$ItemTooltip.ArkhalisHat}", "ArkhalisHat": "{$CommonItemTooltip.DevItem}\n'Non l'ho ottenuto dalla griglia'", "LeinforsHat": "{$CommonItemTooltip.DevItem}\n'Per mantenere quei riccioli sempre bellissimi'", "LeinforsShirt": "{$CommonItemTooltip.DevItem}\n'Il sexy torna in voga'", "LeinforsPants": "{$CommonItemTooltip.DevItem}\n'Sorpresa! Non te l'aspettavi, eh?'", - "OceanCrateHard": "{$CommonItemTooltip.RightClickToOpen}", - "LeinforsAccessory": "{$CommonItemTooltip.DevItem}\n'Per i risultati migliori, usare con dieta a base di pasta'", - "KiteSpectrum": "{$CommonItemTooltip.Kite}", - "KiteWanderingEye": "{$CommonItemTooltip.Kite}", - "KiteUnicorn": "{$CommonItemTooltip.Kite}", - "FairyQueenBossBag": "{$CommonItemTooltip.RightClickToOpen}", - "LavaCrate": "{$CommonItemTooltip.RightClickToOpen}", - "LavaCrateHard": "{$CommonItemTooltip.RightClickToOpen}", - "HotlineFishingHook": "{$CommonItemTooltip.LavaFishing}", - "LavaFishingHook": "{$CommonItemTooltip.LavaFishing}", - "TeleportationPylonJungle": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonPurity": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonHallow": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonUnderground": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonOcean": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonDesert": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonSnow": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonMushroom": "{$CommonItemTooltip.TeleportationPylon}", - "RockGolemBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.RockGolem}", - "BloodMummyBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodMummy}", - "SporeSkeletonBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.SporeSkeleton}", - "SporeBatBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.SporeBat}", - "LarvaeAntlionBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.LarvaeAntlion}", - "CrimsonBunnyBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CrimsonBunny}", - "CrimsonGoldfishBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CrimsonGoldfish}", - "CrimsonPenguinBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CrimsonPenguin}", - "BigMimicCorruptionBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BigMimicCorruption}", - "BigMimicCrimsonBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BigMimicCrimson}", - "BigMimicHallowBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BigMimicHallow}", - "MossHornetBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.MossHornet}", - "WanderingEyeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.WanderingEye}", - "CreativeWings": "{$CommonItemTooltip.FlightAndSlowfall}", - "RainbowWings": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressUpToBooster}", - "LongRainbowTrailWings": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}\n{$CommonItemTooltip.PressUpToBooster}" + "LeinforsWings": "{$CommonItemTooltip.DevItem}\n'Una copertura perfetta!'", + "LeinforsAccessory": "{$CommonItemTooltip.DevItem}\n'Per i risultati migliori, usare con dieta a base di pasta'" }, "CommonItemTooltip": { "SpecialCrafting": "Si usa per la creazione speciale", "DevItem": "Fantastico per impersonare gli sviluppatori!", "FlightAndSlowfall": "Consente il volo e la caduta lenta", "RightClickToOpen": " per aprire", + "MinorStats": "Migliorie minori a tutti i parametri", "BannerBonus": "I giocatori nei dintorni ottengono un bonus contro:", "Counterweight": "Lancia un contrappeso dopo aver colpito un nemico con uno yo-yo", + "EtherianManaCost10": "Usa 10 unità di mana eteriano per evocarne più di una", "MinuteDuration": "{0} minuto/i", "PlaceableOnXmasTree": "Per addobbare un albero di Natale", "RestoresLife": "Ripristina {0} unità di vita", diff --git a/Localization/Content/it-IT/Legacy.json b/Localization/Content/it-IT/Legacy.json index ccc988d..0203753 100644 --- a/Localization/Content/it-IT/Legacy.json +++ b/Localization/Content/it-IT/Legacy.json @@ -33,6 +33,7 @@ "37": "Estensione erba", "38": "Crescita cactus", "39": "Coltivazione girasoli", + "3": "Aggiunta terra su terra", "40": "Coltivazione alberi", "41": "Coltivazione erbe", "42": "Coltivazione erbacce", @@ -72,8 +73,10 @@ "73": "Convalida salvataggio mondo:", "74": "Una pioggia di slime!", "75": "La pioggia di slime è finita.", + "76": "Creazione strutture.", "77": "Aggiunta di altra erba", "78": "Desertificazione", + "79": "Decorazione muri", "7": "Creazione fori casuali", "80": "Cesellamento marmo", "81": "Crescita granito", @@ -159,6 +162,7 @@ "167": "Compra sempre più cavi del necessario!", "168": "Hai controllato che il dispositivo fosse collegato?", "169": "Oh, sai di cosa ha bisogno questa casa? Di più luci intermittenti.", + "17": "Tieni d'occhio il premio, compra una lente!", "170": "C'è Luna di Sangue quando il cielo si fa rosso... e qualcosa fa ridestare i mostri.", "171": "Ehi, amico, sai dove trovare un po' di erbamorte? Oh, me lo stavo solo chiedendo, tutto qua.", "172": "Se dovessi alzare lo sguardo, vedresti che la luna è rossa ora.", @@ -177,8 +181,11 @@ "184": "Ora che hai un po' di minerale, dovrai trasformarlo in una barra per poter realizzare degli oggetti. Per questo ti servirà una fornace!", "185": "Puoi creare una fornace con torce, legna e pietra. Dovrai essere vicino a un banco da lavoro.", "186": "Avrai bisogno di un'incudine per creare la maggior parte degli oggetti dalle barre metalliche.", + "187": "Le incudini possono essere create con del ferro o acquistate da un mercante.", "188": "Sottoterra ci sono cuori di cristallo che possono essere utilizzati per aumentare la tua vita massima. Dovrai spaccarli con il piccone.", + "189": "Se raccoglierai 5 stelle cadenti, potrai unirle per creare un oggetto che aumenterà le tue abilità magiche.", "19": "Sei, {PlayerName}, vero? Ho sentito belle cose su di te!", + "190": "Le stelle cadono sul mondo di notte. Possono essere utilizzate per un sacco di cose utili. Se ne vedi una, cerca di afferrarla, poiché scomparirà dopo l'alba.", "191": "Ci sono diversi modi per convincere le persone a trasferirsi nella nostra città. Ovviamente avranno bisogno di una casa in cui vivere.", "192": "Perché una stanza sia considerata una casa, ha bisogno di una porta, una sedia, un tavolo e una fonte di luce. Assicurati che la casa abbia anche i muri.", "193": "Due persone non possono vivere nella stessa casa. Inoltre, se la loro casa verrà distrutta, cercheranno un nuovo posto in cui vivere.", @@ -197,6 +204,7 @@ "204": "Unendo le lenti su un altare dei demoni, potresti trovare un modo per evocare un potente mostro. Ma aspetta che faccia buio per provarci.", "205": "Puoi creare un'esca di vermi con pezzi marci e polvere disgustosa, ma devi essere in una zona corrotta prima di utilizzarla.", "206": "Gli altari dei demoni si trovano generalmente nella Corruzione. Dovrai trovarti nei pressi degli altari per fabbricare degli oggetti.", + "207": "Puoi creare un rampino con un uncino e tre catene. Gli scheletri sottoterra di solito trasportano gli uncini, mentre le catene possono essere ricavate dalle barre di ferro.", "208": "Se vedi un vaso, demoliscilo per aprirlo. Può contenere delle utili provviste.", "209": "Vi sono tesori nascosti in tutto il mondo. Alcuni oggetti fantastici si possono trovare nelle zone sotterranee più profonde!", "21": "Una statua dell'angelo, dici? Scusa, non tratto cianfrusaglie.", @@ -402,6 +410,7 @@ "400": "Già implori?! Non guardarmi sperando che io cambi idea da un momento all'altro!", "401": "Ricordati di demolire ogni altare cremisi che trovi. Se lo farai, ti succederà qualcosa di bello!", "402": "Gli altari cremisi si trovano generalmente nel Cremisi. Dovrai trovarti nei pressi degli altari per fabbricare oggetti.", + "403": "Puoi creare una spina dorsale insanguinata usando le vertebre. Cerca di trovarti in una zona di crimtano prima di utilizzarla.", "41": "Smettila di piagnucolare! Ho visto di peggio.", "42": "Serviranno dei punti!", "43": "Di nuovo problemi con quei bulli?", @@ -435,6 +444,7 @@ "69": "Hai provato a utilizzare la polvere purificatrice sulla pietra d'ebano della Corruzione?", "7": "Presto si farà notte. Fai le tue scelte finché puoi.", "70": "Vorrei che {ArmsDealer} la smettesse di farmi il filo. Non sa che ho 500 anni?", + "71": "Perché {Merchant} continua a cercare di vendermi statue dell'angelo? Lo sanno tutti che non servono a nulla.", "72": "Hai visto il vecchio che gira intorno al dungeon? Non ha una bella cera...", "73": "Vendo quello che mi pare! Se non ti piace, pazienza.", "74": "Perché devi essere così conflittuale in un momento come questo?", @@ -595,6 +605,7 @@ "213": "Priorità cursore automatico: Piccone -> Ascia", "214": "Priorità cursore automatico: Ascia -> Piccone", "215": "Posizionamento blocco automatico: cursore", + "216": "Posizionamento blocco automatico: riempimento", "217": "Colore bordo", "218": "Cursore", "219": "Comandi", @@ -639,7 +650,10 @@ "26": "Facile", "27": "Casuale", "28": "Crea", + "29": "I personaggi difficili muoiono permanentemente", "2": "Disconnetti", + "30": "I personaggi medi rilasciano oggetti quando muoiono", + "31": "I personaggi facili rilasciano soldi quando muoiono", "32": "Livello di difficoltà", "33": "Camicia", "34": "Maglietta", @@ -790,6 +804,7 @@ "17": "{0} si è unito al gruppo giallo.", "18": "Benvenuto a", "19": "{0} si è unito.", + "1": "Password errata.", "20": "{0} ha abbandonato.", "21": "/giocatori", "22": "{0} si è unito al gruppo rosa.", @@ -888,6 +903,7 @@ "82": "Indietro", "83": "Preferito", "84": "Non puoi cambiare squadre nei blocchi della tua squadra!", + "85": "Cimice", "86": "Anatra", "87": "Farfalla", "88": "Lucciola", @@ -1035,6 +1051,7 @@ "LegacyChestType": { "0": "Cassa", "10": "Cassa di edera", + "11": "Cassa di ghiaccio", "12": "Cassa di legno vivo", "13": "Cassa celeste", "14": "Cassa di grigiolegno", @@ -1046,10 +1063,12 @@ "1": "Cassa d'oro", "20": "Cassa cremisi", "21": "Cassa consacrata", + "22": "Cassa congelata", "23": "Cassa della giungla chiusa", "24": "Cassa della corruzione chiusa", "25": "Cassa cremisi chiusa", "26": "Cassa consacrata chiusa", + "27": "Cassa congelata chiusa", "28": "Cassa dinastica", "29": "Cassa di miele", "2": "Cassa d'oro chiusa", @@ -1115,29 +1134,10 @@ "28": "{$ItemName.CrystalDresser}", "29": "{$ItemName.DynastyDresser}", "30": "{$ItemName.FrozenDresser}", - "31": "{$ItemName.LivingWoodDresser}", - "32": "{$ItemName.SpiderDresser}", - "33": "{$ItemName.LesionDresser}", - "34": "{$ItemName.SolarDresser}", - "35": "{$ItemName.VortexDresser}", - "36": "{$ItemName.NebulaDresser}", - "37": "{$ItemName.StardustDresser}", - "38": "{$ItemName.SandstoneDresser}", - "39": "{$ItemName.BambooDresser}" + "31": "{$ItemName.LivingWoodDresser}" }, "LegacyChestType2": { - "1": "{$ItemName.GoldenChest}", - "0": "{$ItemName.CrystalChest}", - "2": "{$ItemName.SpiderChest}", - "3": "{$ItemName.LesionChest}", - "4": "{$ItemName.GoldChest}", - "5": "{$ItemName.SolarChest}", - "6": "{$ItemName.VortexChest}", - "7": "{$ItemName.NebulaChest}", - "8": "{$ItemName.StardustChest}", - "9": "{$ItemName.GolfChest}", - "10": "{$ItemName.DesertChest}", - "11": "{$ItemName.BambooChest}", - "12": "{$ItemName.DungeonDesertChest}" + "0": "Cassa di cristallo", + "1": "Cassa dorata" } } \ No newline at end of file diff --git a/Localization/Content/it-IT/NPCs.json b/Localization/Content/it-IT/NPCs.json index 9c02655..a6e0a27 100644 --- a/Localization/Content/it-IT/NPCs.json +++ b/Localization/Content/it-IT/NPCs.json @@ -68,6 +68,7 @@ "Vampire": "Vampiro", "MotherSlime": "Slime madre", "Truffle": "Tartufo", + "ZombieEskimo": "Eschimese zombie", "Frankenstein": "Frankenstein", "BlackRecluse": "Vedova eremita", "WallCreeper": "Ragno arrampicatore", @@ -308,7 +309,9 @@ "SleepingAngler": "Pescatore addormentato", "Grasshopper": "Cavalletta", "ChatteringTeethBomb": "Bomba dentiera", + "CultistArcherBlue": "Arciere cultista blu", "Demolitionist": "Esperto in demolizioni", + "CultistArcherWhite": "Arciere cultista bianco", "BrainScrambler": "Confondi cervello", "RayGunner": "Artigliere raggio", "MartianOfficer": "Ufficiale marziano", @@ -335,6 +338,7 @@ "Hornet": "Calabrone", "ManEater": "Mangiauomini", "ArmedZombie": "Zombie", + "ArmedZombieEskimo": "Eschimese zombie", "ArmedZombiePincussion": "Zombie", "ArmedZombieSlimed": "Zombie", "ArmedZombieSwamp": "Zombie", @@ -424,9 +428,12 @@ "Crawdad": "Gambero", "Crawdad2": "Gambero", "CreatureFromTheDeep": "Creatura della profondità", + "CrimsonBunny": "Coniglio di crimtano", + "CrimsonGoldfish": "Pesce rosso di crimtano", "CrimsonPenguin": "Pinguino malvagio", "CultistBoss": "Cultista lunatico", "CultistBossClone": "Cultista lunatico", + "CultistDevote": "Devoto lunatico", "CultistDragonBody1": "Drago fantasma", "CultistDragonBody2": "Drago fantasma", "CultistDragonBody3": "Drago fantasma", @@ -459,7 +466,7 @@ "DuneSplicerHead": "Vermedune", "DuneSplicerTail": "Vermedune", "EnchantedNightcrawler": "Verme notturno incantato", - "GiantFlyingAntlion": "Formicaleone sciamante", + "FlyingAntlion": "Formicaleone sciamante", "Fritz": "Fritz", "GiantShelly": "Guscio gigante", "GiantShelly2": "Guscio gigante", @@ -507,6 +514,7 @@ "SandsharkCrimson": "Predatore di carne", "SandsharkHallow": "Trebbiatrice di cristallo", "SandSlime": "Slime di sabbia", + "ShadowFlameApparition": "Apparizione fiamma d'ombra", "SlimeSpiked": "Slime chiodato", "Sluggy": "Lumaca", "SolarFlare": "Esplosione solare", @@ -534,7 +542,7 @@ "VortexLarva": "Larva aliena", "VortexRifleman": "Tuffatore tempestoso", "VortexSoldier": "Vorticano", - "GiantWalkingAntlion": "Carica formicaleone", + "WalkingAntlion": "Carica formicaleone", "DD2GoblinBomberT2": "{$NPCName.DD2GoblinBomberT1}", "DD2WyvernT3": "{$NPCName.DD2WyvernT1}", "DD2WyvernT2": "{$NPCName.DD2WyvernT1}", diff --git a/Localization/Content/it-IT/Projectiles.json b/Localization/Content/it-IT/Projectiles.json index 5536cf3..9b2b7f9 100644 --- a/Localization/Content/it-IT/Projectiles.json +++ b/Localization/Content/it-IT/Projectiles.json @@ -713,10 +713,6 @@ "MonkStaffT3": "Furia del drago del cielo", "MonkStaffT3_Alt": "Furia del drago del cielo", "MonkStaffT3_AltShot": "Furia del drago del cielo", - "DD2JavelinHostileT3": "{$ProjectileName.DD2JavelinHostile}", - "Celeb2Rocket": "{$ProjectileName.Celeb2Weapon}", - "Celeb2RocketExplosive": "{$ProjectileName.Celeb2Weapon}", - "Celeb2RocketLarge": "{$ProjectileName.Celeb2Weapon}", - "Celeb2RocketLargeExplosive": "{$ProjectileName.Celeb2Weapon}" + "DD2JavelinHostileT3": "{$ProjectileName.DD2JavelinHostile}" } } \ No newline at end of file diff --git a/Localization/Content/it-IT/Town.json b/Localization/Content/it-IT/Town.json index f1142b9..d49c4b4 100644 --- a/Localization/Content/it-IT/Town.json +++ b/Localization/Content/it-IT/Town.json @@ -49,6 +49,7 @@ "Party": "Secondo te importa se al posto delle candele sulla torta metto delle lampadine?" }, "BartenderSpecialText": { + "Party": "I really need some birthday text, Yorai!", "AfterDD2Tier1": "Ottimo lavoro contro l'esercito dell'Antico! Ma scommetto che torneranno. Stavolta non ce l'hanno messa tutta.", "AfterDD2Tier2": "L'esercito dell'Antico diventa sempre più forte, eppure tu continui a respingerlo! Ma qualcosa mi dice che non hanno ancora finito con noi.", "AfterDD2Tier3": "Hai davvero tenuto a bada l'esercito dell'Antico? Forse prima o poi dovresti visitare Etheria.", @@ -74,9 +75,15 @@ "Party": "Io organizzo le feste più magiche e si vede.", "AfterDD2Tier1": "Sai, credo di aver già visto un portale così in passato, ma era d'oro." }, + "SteampunkerSpecialText": { + "Party": "Tutti dicono di amare le torte a più piani, quindi la mia sembra un palazzo." + }, "CyborgSpecialText": { "Party": "Questa sarà una festa da pazzi... e anche da svitati!" }, + "SantaClausSpecialText": { + "Party": "Suvvia! Credevi davvero che festeggio solo a Natale?" + }, "DemolitionistSpecialText": { "Party": "Oggi ti consiglio di fare attenzione. Noi nani organizziamo feste piuttosto esplosive.", "AfterDD2Start": "Non capisco perché non possiamo semplicemente far saltare in aria quei portali." @@ -109,6 +116,7 @@ "Quest_Catfish": "Finalmente ho trovato un gatto della giungla che ama l'acqua! Forse perché in parte è anche un pesce. Non so come sia successo e non mi interessa. Lo voglio e basta... E vedi di fare in fretta!\n\n(Catturato nella giungla, in superficie)", "Quest_Cloudfish": "Pare che esistano delle isole che fluttuano nel cielo e nascondono dei tesori favolosi! Ma che importa. La cosa più bella è che a volte nelle nuvole si formano dei laghi e in questi laghi si trovano i pesci fatti di nuvole! Voglio sapere che sapore hanno, quindi ti conviene andare a catturarmene uno!\n\n(Catturato nei laghi celesti)", "Quest_Cursedfish": "C'è un pesce maledetto che nuota nelle acque più contaminate che esistano! È stato creato con le fiamme maledette degli eroi caduti che si aggirano laggiù. Dicono che nemmeno l'acqua possa spegnere questo fuoco perché brucia eterno. Ho in mente parecchie cose fantastiche che potrei fare con un pesce così! Lo vai a catturare per me o hai troppa paura?!\n\n(Catturato nella Corruzione)", + "Quest_Dirtfish": "Stavo tirando su un pesce bello grande quando dal lago della foresta è apparso uno zombie e ha iniziato a parlare di questo pesce feroce fatto di fango! Ha detto che riuscirebbe a soffocare dieci tizi delle sue dimensioni, o qualcosa del genere... Lo voglio! ADESSO!\n\n(Catturato in superficie, nei sotterranei e nelle caverne)", "Quest_DynamiteFish": "L'esperto in demolizioni era su tutte le furie per aver perso un candelotto di dinamite nel lago della foresta. Eppure ne ha così tanti. Quindi, che importanza ha? Probabilmente perché gli sono cresciute le pinne e se ne è andato via nuotando! Non so dove prenda il materiale per creare quelle cose, ma quello è sicuramente posseduto! Pescalo e portamelo. Ho sempre voluto un pesce kamikaze! Non chiedermi perché...\n\n(Catturato in superficie)", "Quest_EaterofPlankton": "Scommetto che non hai il coraggio necessario per trovare il Mangiaplankton. Un pesce contaminato mutato da un trancio del Mangiatore di mondi! Catturalo e portamelo per dimostrarmi che non sei una mezza calzetta!\n\n(Catturato nella Corruzione)", "Quest_FallenStarfish": "Adoro collezionare quelle stelle luminose che cadono dal cielo! E mi piace ancora di più quando finiscono in testa a qualcuno. Ma... una stella che cade in un lago forestale e si trasforma in un pesce è il massimo! È davvero fenomenale e lo saresti anche tu se me la portassi!\n\n(Catturato nei laghi celesti)", @@ -127,7 +135,7 @@ "Quest_GuideVoodooFish": "Quei demoni negli inferi adorano le bambole vodoo, ma credo che stavolta abbiano un po' esagerato con la magia! Una di loro si è trasformata in un pesce. Ti sfido ad andare a prendermela! Fai attenzione alla lava bollente perché ti brucerà a morte e non potrai portarmi quel pesce!\n\n(Catturato nelle caverne)", "Quest_Wyverntail": "Io so una cosa che tu non sai, pappapero! E va bene, te la dico. C'è una creatura terrificante che vola tra le stelle! Non me lo sono inventato! Si chiama viverna! Ma... ma tu lo sapevi già, eh? Beh, quello che non sai è che alla nascita è un girino! Quindi in pratica sono come... rane, ecco! Datti da fare e vai a prendermene una!\n\n(Catturato nei laghi celesti)", "Quest_ZombieFish": "Non ci crederai mai! Di notte ho catturato un pesce nella foresta che era già morto! Ha cercato di divorarmi! L'ho gettato via e sono scappato! Ora vorrei metterlo nella credenza di qualcuno per vedere che cosa succede, quindi vai a recuperarlo per me, ok?\n\n(Catturato in superficie)", - "Quest_AmanitaFungifin": "Ho scoperto un posto spettacolare pieno di funghi giganti luminosi! Era tutto blu! Stavo raccogliendo alcuni funghi che ho trovato vicino a un lago blu luccicante, quando uno di questi mi ha azzannato ed è scappato via nuotando! Voglio dargli un bel morso e fargliela pagare! In pratica, dovrai catturarlo per me!\n\n(Catturato nei campi di funghi luminosi)", + "Quest_AmanitiaFungifin": "Ho scoperto un posto spettacolare pieno di funghi giganti luminosi! Era tutto blu! Stavo raccogliendo alcuni funghi che ho trovato vicino a un lago blu luccicante, quando uno di questi mi ha azzannato ed è scappato via nuotando! Voglio dargli un bel morso e fargliela pagare! In pratica, dovrai catturarlo per me!\n\n(Catturato nei campi di funghi luminosi)", "Quest_Angelfish": "Sai che esiste un'isola magica che fluttua alta nel cielo? Scommetto di no! Se gli angeli vivono in cielo, secondo me sono dotati di pinne e branchie e sanno nuotare! Direi proprio che devi portarmene uno!\n\n(Catturato nei laghi celesti)", "Quest_BloodyManowar": "Ahi! Non ti avvicinare! Mi ha punto una medusa sanguinolenta! Se non sai che cosa sia, è la medusa più pericolosa di {WorldName}! Vai in quel maledetto Cremisi e catturala se ne hai il coraggio!\n\n(Catturato nel Cremisi)", "Quest_Bonefish": "Di solito non mi interessa se vedo ossa di pesce che galleggiano, ma queste stavano proprio nuotando! Credevi che solo gli scheletri umani si aggirassero ancora in {WorldName}? Cattura quella creatura, così posso nasconderla nel letto di qualcuno!\n\n(Catturato in sotterranei e caverne)", @@ -139,6 +147,7 @@ "Quest_Fishron": "C'è una leggenda che narra di una creatura potente che si chiama pesce drago. È un'unione tra un maiale, un drago e un pesce! Ho sentito dire che si trova nel laghi sotterranei congelati, nella parte più fredda del mondo! Non ho intenzione di andarci, quindi vai a catturarlo e fai in modo che finisca nelle mie mani! Non vedo l'ora!\n\n(Catturato nella tundra sotterranea)", "Quest_InfectedScabbardfish": "Un pesce lunghissimo che assomiglia alla guaina di una spada e nuota nelle acque fangose della Corruzione! Sembra una pietra di ebano, quindi non lasciarti ingannare! Esatto, dico proprio a te. Perché sarai tu ad andare a pescarlo, non io!\n\n(Catturato nella Corruzione)", "Quest_Mudfish": "Fai attenzione mentre attraversi l'acqua della giungla! Perché? Non mi importa se ti mordono i pesci piraña, ma non vorrei che finissi su uno dei miei pesci preferiti: il pesce fango! E poi voglio che lo catturi per me!\n\n(Catturato nella giungla)", + "Quest_Slimefish": "Gli slime nella foresta sono davvero raccapriccianti. I pesci slime sono ancora più schifosi! Non voglio nuotare con gli slime, quindi tirane uno fuori dall'acqua!\n\n(Catturato ovunque)", "Quest_TropicalBarracuda": "I pesci piraña e gli squali sono orribili! Davvero brutti! Sai che c'è un pesce davvero carino, ma capace di staccarti la testa? Pagherei 2 monete di platino per vederglielo fare, quindi... vai a catturarlo per me. Però portamelo prima che ti stacchi la testa!\n\n(Catturato nella giungla, in superficie)", "Quest_TundraTrout": "Ti chiedi mai perché la superficie del lago nelle zone innevate di {WorldName} non si ghiaccia mai? Io no. I pesci però si congelano! Un pesce di ghiaccio sarebbe un grande regalo per il fantastico {Angler}! Vai e portami subito questa trota della tundra!\n\n(Catturato nella tundra in superficie)" }, diff --git a/Localization/Content/pl-PL.json b/Localization/Content/pl-PL.json index 66eb48e..6f0db07 100644 --- a/Localization/Content/pl-PL.json +++ b/Localization/Content/pl-PL.json @@ -46,6 +46,7 @@ "48": "Terraria 2: Electric Boogaloo", "49": "Terraria: zagraj też w Minecrafta!", "5": "Terraria: opowieść króliczka", + "50": "Terraria: zagraj też w Edge of Space!", "51": "Terraria: gdzie ukryłeś złoto, skrzacie?", "52": "Terraria: teraz więcej kaczek!", "53": "Terraria: 9 + 1 = 11", @@ -231,6 +232,7 @@ "TIMBER_Name": "Drzewo!", "TIN_FOIL_HATTER_Description": "Odeprzyj marsjańską inwazję, podczas której kosmici chcą wyprać ci mózg i wetknąć swoje sondy tam, gdzie nie trzeba.", "TIN_FOIL_HATTER_Name": "Ochronne czapki z folii aluminiowej", + "TOPPED_OFF_Description": "Zdobądź maksymalną liczbę punktów życia i many bez akcesoriów czy wzmocnień.", "TOPPED_OFF_Name": "Mocarz", "TROUT_MONKEY_Description": "Ukończ 25. zadanie wędkarza.", "TROUT_MONKEY_Name": "Na ryby", @@ -244,6 +246,7 @@ "WHERES_MY_HONEY_Name": "Gdzie miodek?", "WINTERHEARTED_Description": "Pokonaj Lodową Królową, nikczemną wiedźmę najzimniejszych nocy.", "WINTERHEARTED_Name": "Zimowisko", + "WORM_FODDER_Description": "Pokonaj Pożeracza Światów, ogromnego robaka zamieszkującego Zepsucie.", "WORM_FODDER_Name": "Pies na robaki", "YOU_AND_WHAT_ARMY_Description": "Wydawaj rozkazy 9 przywołanym sługom jednocześnie.", "YOU_AND_WHAT_ARMY_Name": "Ty i jaka armia?", @@ -330,6 +333,7 @@ "Server": "Serwer Terrarii {0}", "ServerMessage": " {0}", "ServerStarted": "Serwer uruchomiony", + "SetInitialMaxPlayers": "Maksymalna liczba graczy (wciśnij Enter dla 8): ", "SetInitialPort": "Port serwera (wciśnij Enter dla 7777): ", "SetMOTD_Command": "motd", "SetMOTD_Description": "Zmień wiadomość dnia.", @@ -370,6 +374,7 @@ }, "Error": { "BadHeaderBufferOverflow": "Bad header lead to a read buffer overflow.", + "CaptureError": "Podczas zapisywania zdjęcia wystąpił błąd. Ponawianie próby...", "DataSentAfterConnectionLost": "Próba wysłania danych do klienta po utracie połączenia", "Error": "Błąd", "ExceptionNormal": " ", @@ -428,9 +433,7 @@ "YellowWires": "Żółte kable", "BirthdayParty_1": "Wygląda na to, że {0} urządza imprezę", "BirthdayParty_2": "Wygląda na to, że {0} i {1} urządzają imprezę", - "BirthdayParty_3": "Wygląda na to, że {0}, {1} i {2} urządzają imprezę", - "RespawnInPrefix": "", - "RespawnInSuffix": "{0}" + "BirthdayParty_3": "Wygląda na to, że {0}, {1} i {2} urządzają imprezę" }, "GameUI": { "ActuationDeviceOff": "Urządzenie siłownikowe wył.", @@ -447,6 +450,7 @@ "CompassCenter": "Środek", "CompassEast": "{0}' na wschód", "CompassWest": "{0}' na zachód", + "CraftingWindow": "Okno tworzenia", "Depth": "{0}'", "DepthLevel": "Poziom", "Disabled": "Wył.", @@ -490,11 +494,12 @@ "PartlyCloudy": "Częściowo pochmurnie", "PlayerDistance": "({0} ft)", "PrecentFishingPower": "{0}% mocy wędkarstwa", + "QuickStackToNearby": "Szybkie łączenie w pobliskich kufrach", "Rain": "Deszcz", "RulerOff": "Linijka wył.", "RulerOn": "Linijka wł.", "SettingsMenu": "Menu ustawień", - "OpenFileFolder": "{$LegacyInterface.110}", + "SortInventory": "Uporządkuj ekwipunek", "Speed": "{0} mph", "StormEffects": "Efekty burzy: {0}", "ThirdQuarter": "Trzecia kwadra", @@ -579,8 +584,8 @@ "MoveToCloud": "Przenieś do chmury", "New": "Nowy", "Normal": "Normalny", - "LightMode_White": "{$LegacyMenu.56}", - "LightMode_Color": "{$LegacyMenu.55}", + "NormalDescription": "(standardowy poziom Terrarii)", + "NormalDescriptionFlavor": "Twoja podróż właśnie się rozpoczyna...", "Play": "Graj", "RestoreButton": "Przywróć", "Save": "Zapisz", @@ -603,10 +608,7 @@ "SeedCopied": "Ziarno skopiowane", "ZoomIn": "{$LegacyMenu.168}", "ZoomOut": "{$LegacyMenu.169}", - "Ellipsis": "...", - "LightMode_Retro": "{$LegacyMenu.57}", - "LightMode_Trippy": "{$LegacyMenu.58}", - "PlayerEmptyName": "{$Net.EmptyName}" + "Ellipsis": "..." }, "DeathSource": { "NPC": "{0} przez: {1}.", @@ -628,6 +630,7 @@ "Lava_3": "{0} próbuje pływać w lawie.", "Lava_4": "{0} lubi bawić się magmą.", "Petrified_1": "{0} roztrzaskuje się na kawałki", + "Petrified_2": "{0} rozbija się i nie ma czego zbierać.", "Petrified_3": "{0} wymaga interwencji ekipy sprzątającej.", "Petrified_4": "{0} zostaje kupą ziemi.", "Poisoned": "{0} nie znajduje antidotum.", @@ -690,8 +693,5 @@ "Chinese": "简体中文 (Chiński uproszczony)", "Portuguese": "Português brasileiro (Brazylijski portugalski)", "Polish": "Polski" - }, - "RandomWorldName_Composition": { - "6": "{Adjective} {Location}" } } \ No newline at end of file diff --git a/Localization/Content/pl-PL/Game.json b/Localization/Content/pl-PL/Game.json index 281efc8..8070a27 100644 --- a/Localization/Content/pl-PL/Game.json +++ b/Localization/Content/pl-PL/Game.json @@ -15,6 +15,9 @@ "AdamantiteCaster": "19% mniejsze zużycie many", "AdamantiteMelee": "18% zwiększona szybkość poruszania się i walki w zwarciu", "AdamantiteRanged": "25% szans niezużycia amunicji", + "HallowCaster": "20% mniejsze zużycie many", + "HallowMelee": "19% zwiększona szybkość poruszania się i walki w zwarciu", + "HallowRanged": "25% szans niezużycia amunicji", "ShadowScale": "15% zwiększona szybkość poruszania się", "Wood": "1 pkt. obrony", "Crimson": "Znacznie zwiększona regeneracja życia", @@ -25,6 +28,7 @@ "Titanium": "Po zadaniu obrażeń przeciwnikowi gracz zyskuje odporność", "Chlorophyte": "Przyzywa potężnego liścia kryształowego, który rani pobliskich wrogów", "Wizard": "10% większa szansa na magiczne trafienie krytyczne", + "Turtle": "Atakujący również otrzymują pełne obrażenia", "Meteor": "Pistolet kosmiczny zużywa 0 many", "SpectreHealing": "Obrażenia magiczne zadane przeciwnikom leczą gracza z najmniejszą liczbą punktów życia", "Shroomite": "Bezruch wprowadza cię w ukrycie,\nzwiększając twoje możliwości dystansowe i utrudniając przeciwnikom namierzanie", @@ -36,8 +40,13 @@ "BeetleDefense": "Żuki chronią cię przed otrzymaniem obrażeń", "BeetleDamage": "Żuki zwiększają twoje obrażenia i szybkość w walce w zwarciu", "Bee": "Zwiększa obrażenia sług o 10%", + "Bone": "20% szans niezużycia amunicji", "Spider": "Zwiększa obrażenia sług o 12%", + "Ninja": "33% szans niezużycia rzucanego przedmiotu", + "Fossil": "50% szans niezużycia rzucanego przedmiotu", + "Solar": "Z czasem tworzą się chroniące cię tarcze słoneczne,\nmożesz zużyć moc tarczy, żeby wykonać zryw, zadając przeciwnikom obrażenia", "Vortex": "Stuknij dwukrotnie {0}, żeby się ukryć\nzwiększając swoje możliwości dystansowe i utrudniając przeciwnikom namierzanie, ale również zmniejszając swoją szybkość poruszania się", + "Nebula": "Zadawanie obrażeń wrogom może spowodować powstanie intensyfikatorów wzmocnień,\nzbieraj je, żeby zyskiwać nakładające się na siebie wzmocnienia", "Stardust": "Stuknij dwukrotnie {0}, żeby skierować swojego strażnika w konkretne miejsce", "Forbidden": "Stuknij dwukrotnie {0}, żeby przyzwać pradawną burzę w miejsce kursora", "Jungle": "16% mniejsze zużycie many", @@ -88,7 +97,7 @@ "Builder": "Zwiększone szybkość i zasięg układania obiektów", "BunnyMount": "Chce ci się marchewki", "Burning": "Utrata życia i spowolnione poruszanie się", - "DesertMinecartRight": "{$BuffDescription.MinecartRight}", + "Calm": "Zmniejszona agresja przeciwników", "Campfire": "Nieznacznie zwiększona regeneracja życia", "ChaosState": "Korzystanie z Kostura niezgody będzie zabierać życie", "Chilled": "Szybkość poruszania się ograniczona", @@ -116,7 +125,7 @@ "FairyGreen": "Chodzi za tobą duszek", "FairyRed": "Chodzi za tobą duszek", "Featherfall": "Wciśnij W GÓRĘ lub W DÓŁ, żeby regulować szybkość spadania", - "DesertMinecartLeft": "{$BuffDescription.MinecartLeft}", + "Fishing": "Zwiększony poziom wędkarstwa", "Flipper": "Poruszaj się bez problemu w wodzie", "Frostburn": "Albo solidnie pali, albo mocno wychładza. Tak czy siak, NAPRAWDĘ boli", "Frozen": "Nie możesz się poruszać!", @@ -178,7 +187,7 @@ "PetDD2Gato": "Chodzi za tobą gato-śmiglarz", "PetDD2Ghost": "Chodzi za tobą nikły płomyk", "PetLizard": "Gad jaki jest, każdy widzi", - "FishMinecartRight": "{$BuffDescription.MinecartRight}", + "PetParrot": "Polly chce krakersa", "PetSapling": "Chodzi za tobą drzewko", "PetSpider": "Chodzi za tobą pająk", "PetTurtle": "Miłego żółwiowania!", @@ -250,7 +259,7 @@ "WeaponImbuePoison": "Ataki w zwarciu zatruwają wrogów", "WeaponImbueVenom": "Ataki w zwarciu wstrzykują twoim celom jad", "Webbed": "Nie możesz się ruszać", - "FishMinecartLeft": "{$BuffDescription.MinecartLeft}", + "WellFed": "Niewielkie ulepszenie wszystkich statystyk", "Werewolf": "Zdolności fizyczne zwiększone", "Wet": "Cieknie z ciebie", "WindPushed": "Wiatr hula wokół ciebie!", @@ -258,45 +267,7 @@ "WitheredArmor": "Masz zmniejszony pancerz!", "WitheredWeapon": "Twoje ataki są słabsze!", "Wrath": "10% zwiększone obrażenia", - "ZephyrFish": "Lubi koło ciebie pływać", - "BeeMinecartRight": "{$BuffDescription.MinecartRight}", - "BeeMinecartLeft": "{$BuffDescription.MinecartLeft}", - "LadybugMinecartRight": "{$BuffDescription.MinecartRight}", - "LadybugMinecartLeft": "{$BuffDescription.MinecartLeft}", - "PigronMinecartRight": "{$BuffDescription.MinecartRight}", - "PigronMinecartLeft": "{$BuffDescription.MinecartLeft}", - "SunflowerMinecartRight": "{$BuffDescription.MinecartRight}", - "SunflowerMinecartLeft": "{$BuffDescription.MinecartLeft}", - "HellMinecartRight": "{$BuffDescription.MinecartRight}", - "HellMinecartLeft": "{$BuffDescription.MinecartLeft}", - "ShroomMinecartRight": "{$BuffDescription.MinecartRight}", - "ShroomMinecartLeft": "{$BuffDescription.MinecartLeft}", - "AmethystMinecartRight": "{$BuffDescription.MinecartRight}", - "AmethystMinecartLeft": "{$BuffDescription.MinecartLeft}", - "TopazMinecartRight": "{$BuffDescription.MinecartRight}", - "TopazMinecartLeft": "{$BuffDescription.MinecartLeft}", - "SapphireMinecartRight": "{$BuffDescription.MinecartRight}", - "SapphireMinecartLeft": "{$BuffDescription.MinecartLeft}", - "EmeraldMinecartRight": "{$BuffDescription.MinecartRight}", - "EmeraldMinecartLeft": "{$BuffDescription.MinecartLeft}", - "RubyMinecartRight": "{$BuffDescription.MinecartRight}", - "RubyMinecartLeft": "{$BuffDescription.MinecartLeft}", - "DiamondMinecartRight": "{$BuffDescription.MinecartRight}", - "DiamondMinecartLeft": "{$BuffDescription.MinecartLeft}", - "AmberMinecartRight": "{$BuffDescription.MinecartRight}", - "AmberMinecartLeft": "{$BuffDescription.MinecartLeft}", - "BeetleMinecartRight": "{$BuffDescription.MinecartRight}", - "BeetleMinecartLeft": "{$BuffDescription.MinecartLeft}", - "MeowmereMinecartRight": "{$BuffDescription.MinecartRight}", - "MeowmereMinecartLeft": "{$BuffDescription.MinecartLeft}", - "PartyMinecartRight": "{$BuffDescription.MinecartRight}", - "PartyMinecartLeft": "{$BuffDescription.MinecartLeft}", - "PirateMinecartRight": "{$BuffDescription.MinecartRight}", - "PirateMinecartLeft": "{$BuffDescription.MinecartLeft}", - "SteampunkMinecartRight": "{$BuffDescription.MinecartRight}", - "SteampunkMinecartLeft": "{$BuffDescription.MinecartLeft}", - "CoffinMinecartRight": "{$BuffDescription.MinecartRight}", - "CoffinMinecartLeft": "{$BuffDescription.MinecartLeft}" + "ZephyrFish": "Lubi koło ciebie pływać" }, "BuffName": { "AmmoBox": "Skrzynka z amunicją", @@ -439,7 +410,7 @@ "Regeneration": "Regeneracja", "Rudolph": "Rudolf", "ScutlixMount": "Scutlix-wierzchowiec", - "DesertMinecartRight": "{$BuffName.MinecartRight}", + "ShadowDodge": "Unik cienia", "ShadowFlame": "Cienisty płomień", "ShadowOrb": "Kula cienia", "SharknadoMinion": "Rekinado", @@ -502,48 +473,7 @@ "WitheredArmor": "Zniszczony pancerz", "WitheredWeapon": "Zniszczona broń", "Wrath": "Gniew", - "ZephyrFish": "Ryba zefiru", - "DesertMinecartLeft": "{$BuffName.MinecartLeft}", - "FishMinecartRight": "{$BuffName.MinecartRight}", - "FishMinecartLeft": "{$BuffName.MinecartLeft}", - "BeeMinecartRight": "{$BuffName.MinecartRight}", - "BeeMinecartLeft": "{$BuffName.MinecartLeft}", - "LadybugMinecartRight": "{$BuffName.MinecartRight}", - "LadybugMinecartLeft": "{$BuffName.MinecartLeft}", - "PigronMinecartRight": "{$BuffName.MinecartRight}", - "PigronMinecartLeft": "{$BuffName.MinecartLeft}", - "SunflowerMinecartRight": "{$BuffName.MinecartRight}", - "SunflowerMinecartLeft": "{$BuffName.MinecartLeft}", - "HellMinecartRight": "{$BuffName.MinecartRight}", - "HellMinecartLeft": "{$BuffName.MinecartLeft}", - "ShroomMinecartRight": "{$BuffName.MinecartRight}", - "ShroomMinecartLeft": "{$BuffName.MinecartLeft}", - "AmethystMinecartRight": "{$BuffName.MinecartRight}", - "AmethystMinecartLeft": "{$BuffName.MinecartLeft}", - "TopazMinecartRight": "{$BuffName.MinecartRight}", - "TopazMinecartLeft": "{$BuffName.MinecartLeft}", - "SapphireMinecartRight": "{$BuffName.MinecartRight}", - "SapphireMinecartLeft": "{$BuffName.MinecartLeft}", - "EmeraldMinecartRight": "{$BuffName.MinecartRight}", - "EmeraldMinecartLeft": "{$BuffName.MinecartLeft}", - "RubyMinecartRight": "{$BuffName.MinecartRight}", - "RubyMinecartLeft": "{$BuffName.MinecartLeft}", - "DiamondMinecartRight": "{$BuffName.MinecartRight}", - "DiamondMinecartLeft": "{$BuffName.MinecartLeft}", - "AmberMinecartRight": "{$BuffName.MinecartRight}", - "AmberMinecartLeft": "{$BuffName.MinecartLeft}", - "BeetleMinecartRight": "{$BuffName.MinecartRight}", - "BeetleMinecartLeft": "{$BuffName.MinecartLeft}", - "MeowmereMinecartRight": "{$BuffName.MinecartRight}", - "MeowmereMinecartLeft": "{$BuffName.MinecartLeft}", - "PartyMinecartRight": "{$BuffName.MinecartRight}", - "PartyMinecartLeft": "{$BuffName.MinecartLeft}", - "PirateMinecartRight": "{$BuffName.MinecartRight}", - "PirateMinecartLeft": "{$BuffName.MinecartLeft}", - "SteampunkMinecartRight": "{$BuffName.MinecartRight}", - "SteampunkMinecartLeft": "{$BuffName.MinecartLeft}", - "CoffinMinecartRight": "{$BuffName.MinecartRight}", - "CoffinMinecartLeft": "{$BuffName.MinecartLeft}" + "ZephyrFish": "Ryba zefiru" }, "MapObject": { "Adamantite": "Adamantyt", @@ -615,166 +545,5 @@ "Roll": "{$LegacyMultiplayer.8}", "Party": "/d", "Emote": "/ja" - }, - "Bestiary_ItemDropConditions": { - "NotExpert": "", - "NotMasterMode": "", - "LegacyHack_IsBossAndNotExpert": "", - "IsCrimsonAndNotExpert": "", - "IsCorruptionAndNotExpert": "", - "NotFromStatue": "" - }, - "Bestiary_FlavorText": { - "npc_JungleSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_YellowSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_RedSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_PurpleSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_BlackSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_GreenSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_BlueSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_DemonEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_Zombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_Skeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_AngryBones": "{$CommonBestiaryFlavor.AngryBones}", - "npc_Hornet": "{$CommonBestiaryFlavor.Hornet}", - "npc_Hellbat": "{$CommonBestiaryFlavor.LavaBat}", - "npc_BlueJellyfish": "{$CommonBestiaryFlavor.Jellyfish}", - "npc_PinkJellyfish": "{$CommonBestiaryFlavor.Jellyfish}", - "npc_Mummy": "{$CommonBestiaryFlavor.Mummy}", - "npc_DarkMummy": "{$CommonBestiaryFlavor.Mummy}", - "npc_LightMummy": "{$CommonBestiaryFlavor.Mummy}", - "npc_Mimic": "{$CommonBestiaryFlavor.Mimic}", - "npc_GreenJellyfish": "{$CommonBestiaryFlavor.Jellyfish}", - "npc_BaldZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_WanderingEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_Penguin": "{$CommonBestiaryFlavor.Penguin}", - "npc_PenguinBlack": "{$CommonBestiaryFlavor.Penguin}", - "npc_Lavabat": "{$CommonBestiaryFlavor.LavaBat}", - "npc_PigronCorruption": "{$CommonBestiaryFlavor.Pigron}", - "npc_PigronHallow": "{$CommonBestiaryFlavor.Pigron}", - "npc_PigronCrimson": "{$CommonBestiaryFlavor.Pigron}", - "npc_PincushionZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_SwampZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_TwiggyZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_CataractEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_SleepyEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_DialatedEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_GreenEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_PurpleEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_FemaleZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_HeadacheSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_MisassembledSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_PantlessSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_HornetFatty": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetHoney": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetLeafy": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetSpikey": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetStingy": "{$CommonBestiaryFlavor.Hornet}", - "npc_ZombieMushroom": "{$CommonBestiaryFlavor.MushroomZombie}", - "npc_ZombieMushroomHat": "{$CommonBestiaryFlavor.MushroomZombie}", - "npc_FungiBulb": "{$CommonBestiaryFlavor.FungiBulb}", - "npc_GiantFungiBulb": "{$CommonBestiaryFlavor.FungiBulb}", - "npc_RustyArmoredBonesAxe": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_RustyArmoredBonesFlail": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_RustyArmoredBonesSword": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_RustyArmoredBonesSwordNoArmor": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_BlueArmoredBones": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_BlueArmoredBonesMace": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_BlueArmoredBonesNoPants": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_BlueArmoredBonesSword": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_HellArmoredBones": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_HellArmoredBonesSpikeShield": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_HellArmoredBonesMace": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_HellArmoredBonesSword": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_RaggedCaster": "{$CommonBestiaryFlavor.RaggedCaster}", - "npc_RaggedCasterOpenCoat": "{$CommonBestiaryFlavor.RaggedCaster}", - "npc_Necromancer": "{$CommonBestiaryFlavor.Necromancer}", - "npc_NecromancerArmored": "{$CommonBestiaryFlavor.Necromancer}", - "npc_DiabolistRed": "{$CommonBestiaryFlavor.Diabolist}", - "npc_DiabolistWhite": "{$CommonBestiaryFlavor.Diabolist}", - "npc_AngryBonesBig": "{$CommonBestiaryFlavor.AngryBones}", - "npc_AngryBonesBigMuscle": "{$CommonBestiaryFlavor.AngryBones}", - "npc_AngryBonesBigHelmet": "{$CommonBestiaryFlavor.AngryBones}", - "npc_Scarecrow1": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow2": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow3": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow4": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow5": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow6": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow7": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow8": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow9": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow10": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_DemonEyeOwl": "{$CommonBestiaryFlavor.CostumeDemonEye}", - "npc_DemonEyeSpaceship": "{$CommonBestiaryFlavor.CostumeDemonEye}", - "npc_ZombieDoctor": "{$CommonBestiaryFlavor.CostumeZombie}", - "npc_ZombieSuperman": "{$CommonBestiaryFlavor.CostumeZombie}", - "npc_ZombiePixie": "{$CommonBestiaryFlavor.CostumeZombie}", - "npc_SkeletonTopHat": "{$CommonBestiaryFlavor.CostumeSkeleton}", - "npc_SkeletonAstonaut": "{$CommonBestiaryFlavor.CostumeSkeleton}", - "npc_SkeletonAlien": "{$CommonBestiaryFlavor.CostumeSkeleton}", - "npc_ZombieXmas": "{$CommonBestiaryFlavor.ZombieXmas}", - "npc_ZombieSweater": "{$CommonBestiaryFlavor.ZombieXmas}", - "npc_SlimeRibbonWhite": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_SlimeRibbonYellow": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_SlimeRibbonGreen": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_SlimeRibbonRed": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_ZombieElf": "{$CommonBestiaryFlavor.ZombieElf}", - "npc_ZombieElfBeard": "{$CommonBestiaryFlavor.ZombieElf}", - "npc_ZombieElfGirl": "{$CommonBestiaryFlavor.ZombieElf}", - "npc_ArmedZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombiePincushion": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombieSwamp": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombieTwiggy": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombieCenx": "{$CommonBestiaryFlavor.Zombie}", - "npc_GoldBird": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldBunny": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldButterfly": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldFrog": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldGrasshopper": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldMouse": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldWorm": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_BoneThrowingSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_BoneThrowingSkeleton2": "{$CommonBestiaryFlavor.Skeleton}", - "npc_BoneThrowingSkeleton3": "{$CommonBestiaryFlavor.Skeleton}", - "npc_BoneThrowingSkeleton4": "{$CommonBestiaryFlavor.Skeleton}", - "npc_GiantWalkingAntlion": "{$CommonBestiaryFlavor.AntlionCharger}", - "npc_GiantFlyingAntlion": "{$CommonBestiaryFlavor.AntlionSwarmer}", - "npc_DesertLamiaLight": "{$CommonBestiaryFlavor.Lamia}", - "npc_DesertLamiaDark": "{$CommonBestiaryFlavor.Lamia}", - "npc_SquirrelGold": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_SandShark": "{$CommonBestiaryFlavor.Sandshark}", - "npc_SandsharkCorrupt": "{$CommonBestiaryFlavor.Sandshark}", - "npc_SandsharkCrimson": "{$CommonBestiaryFlavor.Sandshark}", - "npc_SandsharkHallow": "{$CommonBestiaryFlavor.Sandshark}", - "npc_WalkingAntlion": "{$CommonBestiaryFlavor.AntlionCharger}", - "npc_FlyingAntlion": "{$CommonBestiaryFlavor.AntlionSwarmer}", - "npc_GoldGoldfish": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldGoldfishWalker": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_BlackDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_BlueDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_GreenDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_OrangeDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_RedDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_YellowDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_GoldDragonfly": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldLadyBug": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldWaterStrider": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldSeahorse": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_IceMimic": "{$CommonBestiaryFlavor.Mimic}", - "npc_GemSquirrelAmethyst": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelTopaz": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelSapphire": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelEmerald": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelRuby": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelDiamond": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelAmber": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemBunnyAmethyst": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyTopaz": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnySapphire": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyEmerald": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyRuby": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyDiamond": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyAmber": "{$CommonBestiaryFlavor.GemBunny}" } } \ No newline at end of file diff --git a/Localization/Content/pl-PL/Items.json b/Localization/Content/pl-PL/Items.json index c7342b9..7e05c9d 100644 --- a/Localization/Content/pl-PL/Items.json +++ b/Localization/Content/pl-PL/Items.json @@ -232,6 +232,7 @@ "RedHusk": "Czerwona łupina", "CyanHusk": "Cyjanowa łupina", "VioletHusk": "Fiołkowa łupina", + "PurpleMucos": "Fioletowy śluz", "BlackInk": "Czarny tusz", "FlowerofFire": "Kwiat ognia", "DyeVat": "Kadź do barwników", @@ -538,6 +539,7 @@ "CarriageLantern": "Lampa do powozu", "AlchemyLantern": "Lampa alchemiczna", "DiablostLamp": "Lampa diabolisty", + "OilRagSconse": "Kinkiet naftowy", "BlueDungeonChair": "Niebieskie krzesło z lochu", "BlueDungeonTable": "Niebieski stół z lochu", "BlueDungeonWorkBench": "Niebieski stół warsztatowy z lochu", @@ -690,6 +692,7 @@ "NecroGreaves": "Nekromantyczne nagolenniki", "CrimsonChest": "Kufer szkarłatu", "HallowedChest": "Bajkowy kufer", + "FrozenChest": "Zamarznięty kufer", "JungleKey": "Klucz z dżungli", "CorruptionKey": "Klucz zepsucia", "CrimsonKey": "Szkarłatny klucz", @@ -760,6 +763,7 @@ "TitanstoneBlockWall": "Ściana z bloków kamienia tytanowego", "MagicCuffs": "Magiczne kajdanki", "MusicBoxSnow": "Pozytywka (śnieg)", + "MusicBoxSpace": "Pozytywka (kosmos)", "MusicBoxCrimson": "Pozytywka (Szkarłat)", "MusicBoxBoss4": "Pozytywka (boss 4)", "SilverWatch": "Srebrny zegarek", @@ -768,6 +772,7 @@ "MusicBoxRain": "Pozytywka (deszcz)", "MusicBoxIce": "Pozytywka (lód)", "MusicBoxDesert": "Pozytywka (pustynia)", + "MusicBoxOcean": "Pozytywka (ocean)", "MusicBoxDungeon": "Pozytywka (loch)", "MusicBoxPlantera": "Pozytywka (Plantera)", "MusicBoxBoss5": "Pozytywka (boss 5)", @@ -810,6 +815,7 @@ "DerplingBanner": "Sztandar derplinga", "EaterofSoulsBanner": "Sztandar pożeracza dusz", "EnchantedSwordBanner": "Sztandar Zaklętego Miecza", + "ZombieEskimoBanner": "Sztandar eskimoskiego zombie", "FaceMonsterBanner": "Sztandar pyskostwora", "FloatyGrossBanner": "Sztandar płynącej odrazy", "FlyingFishBanner": "Sztandar latającej ryby", @@ -1003,6 +1009,7 @@ "SpookyDoor": "Straszne drzwi", "SpookyTable": "Straszny stół", "SpookyWorkBench": "Straszny stół warsztatowy", + "SpookyPlatform": "Straszna platforma", "ReaperHood": "Kaptur kostuchy", "Diamond": "Diament", "ReaperRobe": "Szata kostuchy", @@ -1558,7 +1565,7 @@ "GuideVoodooFish": "Ryba-voodoo", "Wyverntail": "Ogon wywerny", "ZombieFish": "Ryba-zombie", - "AmanitaFungifin": "Grzybopław-amanita", + "AmanitiaFungifin": "Grzybopław-amanita", "Angelfish": "Rybanioł", "BloodyManowar": "Wojennica", "Bonefish": "Ościotrup", @@ -1637,7 +1644,7 @@ "SwiftnessPotion": "Mikstura szybkości", "BlueArmoredBonesBanner": "Sztandar niebieskich, zbrojnych kości", "BlueCultistArcherBanner": "Sztandar niebieskich łuczników-kultystów", - "ManaCloakStar": "", + "BlueCultistCasterBanner": "Sztandar niebieskich magów-kultystów", "BlueCultistFighterBanner": "Sztandar niebieskich wojowników-kultystów", "BoneLeeBanner": "Sztandar Obrusa Lee", "ClingerBanner": "Sztandar chwytaka", @@ -2203,6 +2210,7 @@ "TacticalShotgun": "Strzelba taktyczna", "RottenChunk": "Zgniły kawałek", "IvyChest": "Kufer pokryty bluszczem", + "IceChest": "Lodowy kufer", "Marrow": "Szpik kostny", "UnholyTrident": "Nieświęty trójząb", "FrostHelmet": "Mroźny hełm", @@ -2338,6 +2346,9 @@ "TheUndertaker": "Grabarz", "TheMeatball": "Klopsik", "TheRottedFork": "Zbutwiałe widły", + "EskimoHood": "Eskimoski kaptur", + "EskimoCoat": "Eskimoski płaszcz", + "EskimoPants": "Eskimoskie spodnie", "LivingWoodChair": "Krzesło z żyjącego drewna", "CactusChair": "Kaktusowe krzesło", "BoneChair": "Kościane krzesło", @@ -2527,7 +2538,10 @@ "ShoeSpikes": "Kolce do butów", "TigerClimbingGear": "Tygrysi sprzęt wspinaczkowy", "Tabi": "Tabi", + "PinkEskimoHood": "Różowy, eskimoski kaptur", + "PinkEskimoCoat": "Różowy, eskimoski płaszcz", "Minishark": "Minirekin", + "PinkEskimoPants": "Różowe, eskimoskie spodnie", "PinkThread": "Różowa nić", "ManaRegenerationBand": "Opaska regeneracji many", "SandstorminaBalloon": "Burza w balonie", @@ -2602,6 +2616,7 @@ "AncientBattleArmorPants": "Zakazane nici", "AncientBattleArmorShirt": "Zakazane szaty", "AncientCloth": "Starożytne płótno", + "AncientCultistTrophy": "Starożytne trofeum kultystów", "AncientHorn": "Starożytny róg", "AnglerTackleBag": "Torba Wędkarza", "AngryBonesBanner": "Sztandar złościotrupa", @@ -2697,6 +2712,7 @@ "BorealWoodTable": "Stół z drewna borealnego", "BorealWoodWall": "Ściana z drewna borealnego", "BorealWoodWorkBench": "Stół warsztatowy z drewna borealnego", + "BossMaskCultist": "Starożytna maska kultystów", "BossMaskMoonlord": "Maska Księżycowego Władcy", "BottomlessBucket": "Bezdenne wiadro wody", "BouncyBomb": "Skacząca bomba", @@ -2820,6 +2836,7 @@ "DestroyerBossBag": "Torba skarbów", "DestroyerMask": "Maska niszczyciela", "Detonator": "Detonator", + "DevDye": "Krew Skiphsa", "DiamondGemsparkWall": "Ściana z diamentowych bloków świecących", "DiamondGemsparkWallOff": "Nieaktywna ściana z diamentowych bloków świecących", "DjinnLamp": "Lampa ducha pustynnego", @@ -2883,12 +2900,14 @@ "Fake_DynastyChest": "Pułapka: Kufer dynastii", "Fake_EbonwoodChest": "Pułapka: Kufer z drewna ebonowego", "Fake_FleshChest": "Pułapka: Mięsisty kufer", + "Fake_FrozenChest": "Pułapka: Zamarznięty kufer", "Fake_GlassChest": "Pułapka: Szklany kufer", "Fake_GoldChest": "Pułapka: Złoty kufer", "Fake_GraniteChest": "Pułapka: Granitowy kufer", "Fake_GreenDungeonChest": "Pułapka: Zielony kufer z lochu", "Fake_HallowedChest": "Pułapka: Bajkowy kufer", "Fake_HoneyChest": "Pułapka: Miodowy kufer", + "Fake_IceChest": "Pułapka: Lodowy kufer", "Fake_IvyChest": "Pułapka: Kufer pokryty bluszczem", "Fake_JungleChest": "Pułapka: Kufer z dżungli", "Fake_LihzahrdChest": "Pułapka: Jaszczuhrzy kufer", @@ -3558,6 +3577,7 @@ "SailfishBoots": "Buty morskich wiatrów", "SalamanderBanner": "Sztandar salamandry", "SandElementalBanner": "Sztandar żywiołaka piasku", + "SandFallBlock": "Piaskospad", "SandFallWall": "Ściana piaskospadu", "SandsharkBanner": "Sztandar piaskowego rekina", "SandsharkCorruptBanner": "Sztandar kąsacza kości", @@ -3621,6 +3641,10 @@ "SkeletronBossBag": "Torba skarbów", "SkeletronPrimeBossBag": "Torba skarbów", "SkeletronPrimeMask": "Maska Szkieletrona Prime’a", + "SkiphsHelm": "Maska Skiphsa", + "SkiphsPants": "Niedźwiedzie nogawice Skiphsa", + "SkiphsShirt": "Skóra Skiphsa", + "SkiphsWings": "Łapy Skiphsa", "SkyBlueString": "Sznurek koloru błękitnego nieba", "SkyFracture": "Rozdarcie nieba", "SkywareBathtub": "Niebiańska wanna", @@ -3662,6 +3686,7 @@ "SmokeBlock": "Blok dymu", "SnailStatue": "Posąg ślimaka", "SnowCloudBlock": "Śniegowa chmura", + "SnowFallBlock": "Śniegospad", "SnowFallWall": "Ściana śniegospadu", "SolarCoriteBanner": "Sztandar korium", "SolarCrawltipedeBanner": "Szandar pełzowija", @@ -3806,6 +3831,7 @@ "TwilightHairDye": "Farba do włosów „zmierzch”", "TwinMask": "Bliźniacza maska", "TwinsBossBag": "Torba skarbów", + "UltraBrightCampfire": "Ultrajasne ognisko", "UndeadVikingStatue": "Posąg nieumarłego wikinga", "UnicornStatue": "Posąg jednorożca", "UnicornWispDye": "Jednorożcowy barwnik błędnego ognika", @@ -3954,6 +3980,7 @@ "DungeonClockPink": "Różowy zegar z lochu", "DynastyDresser": "Komoda dynastii", "DynastyPiano": "Pianino dynastii", + "DynastyPlatform": "Platforma dynastii", "DynastySofa": "Kanapa dynastii", "Fake_CrystalChest": "Kryształowy kufer-pułapka", "Fake_GoldenChest": "Złoty kufer-pułapka", @@ -3978,6 +4005,10 @@ "SquireAltPants": "Nagolenniki rycerza z Walhalli", "SquireAltShirt": "Napierśnik rycerza z Walhalli", "SkywareClock2": "Zegar z płyt słonecznych", + "ArkhalisHat": "Kaptur Arkhalis", + "ArkhalisShirt": "Gorset Arkhalis", + "ArkhalisPants": "Rajstopy Arkhalis", + "ArkhalisWings": "Skrzydła Arkhalis", "LeinforsHat": "Ochrona włosów Leinforsa", "LeinforsShirt": "Przegięty styl Leinforsa", "LeinforsPants": "Wymyślne pantalony Leinforsa", @@ -4003,7 +4034,7 @@ "Paintbrush": "Używany w połączeniu z farbą do malowania bloków", "PaintRoller": "Używany w połączeniu z farbą do malowania ścian", "ManaCrystal": "Trwale zwiększa maksymalną liczbę punktów many o 20", - "GolfBallDyedPink": "{$CommonItemTooltip.GolfBall}", + "PaintScraper": "Używany do usuwania farby", "TealMushroom": "Używany do tworzenia morskiego barwnika", "GreenMushroom": "Używany do tworzenia zielonego barwnika", "SkyBlueFlower": "Używany do tworzenia barwnika błękitnego nieba", @@ -4027,7 +4058,7 @@ "MagicMissile": "Tworzy kontrolowany pocisk", "Beenade": "Eksploduje i tworzy chmarę pszczół", "GravityGlobe": "Pozwala posiadaczowi odwrócić grawitację\nWciśnij W GÓRĘ, żeby zmienić grawitację", - "KiteRed": "{$CommonItemTooltip.Kite}", + "HoneyComb": "Po otrzymaniu obrażeń uwalnia pszczoły", "Abeemination": "Przyzywa Królową Pszczół", "DirtRod": "Magicznie przesuwa ziemię", "TempleKey": "Otwiera drzwi świątyni w dżungli", @@ -4036,10 +4067,10 @@ "LihzahrdPressurePlate": "Aktywuje się, gdy gracz na nią nadepnie", "PiranhaGun": "Przyczepia się do wrogów, zadając ciągłe obrażenia", "PygmyStaff": "Przywołuje pigmeja, który będzie dla ciebie walczył", - "KiteBlueAndYellow": "{$CommonItemTooltip.Kite}", - "KiteBlue": "{$CommonItemTooltip.Kite}", - "KiteWyvern": "{$CommonItemTooltip.Kite}", - "GroxTheGreatGreaves": "{$CommonItemTooltip.DevItem}", + "PygmyNecklace": "Zwiększa maksymalną liczbę sług gracza", + "TikiMask": "Zwiększa maksymalną liczbę sług gracza\nZwiększa obrażenia sług o 10%", + "TikiShirt": "Zwiększa maksymalną liczbę sług gracza\nZwiększa obrażenia sług o 10%", + "TikiPants": "Zwiększa maksymalną liczbę sług gracza\nZwiększa obrażenia sług o 10%", "LeafWings": "{$CommonItemTooltip.FlightAndSlowfall}", "BlizzardinaBalloon": "Daje posiadaczowi umiejętność podwójnego skoku\nZwiększa wysokość skoku", "BundleofBalloons": "Daje posiadaczowi umiejętność poczwórnego skoku\nZwiększa wysokość skoku", @@ -4088,19 +4119,19 @@ "MeteorSuit": "7% zwiększone obrażenia magiczne", "AmberMosquito": "Przyzywa młodego dinozaura", "NimbusRod": "Przyzywa chmurę zalewającą twoich wrogów strugami deszczu", - "GroxTheGreatArmor": "{$CommonItemTooltip.DevItem}", + "BeeCloak": "Wypuszcza pszczoły i sprawia, że spadają gwiazdy, gdy gracz otrzyma obrażenia", "EyeoftheGolem": "10% większa szansa na trafienie krytyczne", "HoneyBalloon": "Zwiększa wysokość skoku\nPo otrzymaniu obrażeń uwalnia pszczoły", "MeteorLeggings": "7% zwiększone obrażenia magiczne", "BlueHorseshoeBalloon": "Daje posiadaczowi umiejętność podwójnego skoku\nZwiększa wysokość skoku i anuluje obrażenia spowodowane upadkiem", "WhiteHorseshoeBalloon": "Daje posiadaczowi umiejętność podwójnego skoku\nZwiększa wysokość skoku i anuluje obrażenia spowodowane upadkiem", "YellowHorseshoeBalloon": "Daje posiadaczowi umiejętność podwójnego skoku\nZwiększa wysokość skoku i anuluje obrażenia spowodowane upadkiem", - "OceanCrate": "{$CommonItemTooltip.RightClickToOpen}", + "FrozenTurtleShell": "Tworzy wokół posiadacza skorupę, która go chroni, gdy ma on poniżej 50% punktów życia", "SniperRifle": "Strzela potężną, prędką kulą\n, żeby oddalić", "VenusMagnum": "Strzela potężną, prędką kulą", "CrimsonRod": "Przyzywa chmurę zalewającą twoich wrogów strugami krwi", - "SteampunkWings": "{$CommonItemTooltip.FlightAndSlowfall}", - "WingsVortex": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", + "Stynger": "Strzela wybuchowymi pociskami", + "FlowerPow": "Strzela w pobliskich wrogów ostrymi jak brzytwa płatkami kwiatków", "RainbowGun": "Strzela tęczą, która zadaje ciągłe obrażenia", "StyngerBolt": "Eksploduje i tworzy śmiertelny szrapnel", "FlowerofFrost": "Strzela kulą mrozu", @@ -4112,11 +4143,11 @@ "EmeraldRobe": "Zwiększa maksymalną liczbę punktów many o 60\nZmniejsza zużycie many o 11%", "RubyRobe": "Zwiększa maksymalną liczbę punktów many o 60\nZmniejsza zużycie many o 13%", "DiamondRobe": "Zwiększa maksymalną liczbę punktów many o 80\nZmniejsza zużycie many o 15%", - "GroxTheGreatHelm": "{$CommonItemTooltip.DevItem}", + "PanicNecklace": "Po otrzymaniu obrażeń zwiększa szybkość poruszania się", "LifeFruit": "Trwale zwiększa maksymalną liczbę punktów życia o 5", "LihzahrdPowerCell": "Używane na jaszczuhrzym ołtarzu", "Picksaw": "Może kopać jaszczuhrze cegły", - "JimsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "HeatRay": "Strzela przeszywającym promieniem ciepła\n„Oolaa!”", "StaffofEarth": "Przyzywa potężny głaz", "GolemFist": "Uderza z siłą golema", "Binoculars": "Zwiększa zasięg widzenia, gdy jest używana", @@ -4136,8 +4167,8 @@ "TurtleHelmet": "6% zwiększone obrażenia w walce w zwarciu\nWrogowie częściej biorą cię na cel", "TurtleScaleMail": "8% zwiększone obrażenia w walce w zwarciu oraz szansa na trafienie krytyczne\nWrogowie częściej biorą cię na cel", "TurtleLeggings": "4% większa szansa na trafienie krytyczne w walce w zwarciu\nWrogowie częściej biorą cię na cel", - "KiteWorldFeeder": "{$CommonItemTooltip.Kite}", - "OasisCrateHard": "{$CommonItemTooltip.RightClickToOpen}", + "MagicQuiver": "Zwiększa obrażenia o 10%, a także znacznie zwiększa szybkość strzał\n20% szans niezużycia strzał", + "MagmaStone": "Zadaje obrażenia od ognia", "ObsidianRose": "Obniża obrażenia spowodowane dotknięciem lawy", "RodofDiscord": "Teleportuje cię w miejsce kursora", "DeathSickle": "Strzela śmiertelnym sierpem", @@ -4147,7 +4178,7 @@ "IchorArrow": "Obniża obronę celu", "IchorBullet": "Obniża obronę celu", "GoldenShower": "Przywołuje strugę ichoru\nObniża obronę celu", - "OasisCrate": "{$CommonItemTooltip.RightClickToOpen}", + "FireGauntlet": "Zwiększa odrzut od ataków w zwarciu i zadaje obrażenia od ognia\n10% zwiększone obrażenia w walce w zwarciu oraz szybkość", "ImbuingStation": "Używany do tworzenia butelek z substancjami nasycającymi bronie", "EmptyBullet": "Używana do tworzenia różnych rodzajów amunicji", "ShadowbeamStaff": "Tworzy cienisty promień, który odbija się od ścian", @@ -4176,17 +4207,17 @@ "CorruptionKey": "Odblokowuje kufer zepsucia w lochu", "CrimsonKey": "Odblokowuje szkarłatny kufer w lochu", "HallowedKey": "Odblokowuje bajkowy kufer w lochu", - "Cherry": "{$CommonItemTooltip.MinorStats}", + "FrozenKey": "Odblokowuje zamarznięty kufer w lochu", "SpectrePaintbrush": "Używany w połączeniu z farbą do malowania bloków", "SpectrePaintRoller": "Używany w połączeniu z farbą do malowania ścian", - "GolfBallDyedOrange": "{$CommonItemTooltip.GolfBall}", + "SpectrePaintScraper": "Używany do usuwania farby", "ShroomiteHeadgear": "15% zwiększone obrażenia od strzał\n5% większa szansa na dystansowe trafienie krytyczne", "ShroomiteMask": "15% zwiększone obrażenia od kul\n5% większa szansa na dystansowe trafienie krytyczne", "ShroomiteHelmet": "15% zwiększone obrażenia od rakiet\n5% większa szansa na dystansowe trafienie krytyczne", - "KiteBoneSerpent": "{$CommonItemTooltip.Kite}", + "ShroomiteBreastplate": "13% większa szansa na dystansowe trafienie krytyczne\n20% szans niezużycia amunicji", "ShroomiteLeggings": "7% większa szansa na dystansowe trafienie krytyczne\n12% zwiększona szybkość poruszania się", "Autohammer": "Zamienia sztabki zielenicowe w sztabki grzybielenicowe", - "Jetpack": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressUpToBooster}", + "SDMG": "50% szans niezużycia amunicji\n„Pochodzi z Edge of Space”", "CenxsTiara": "{$CommonItemTooltip.DevItem}", "CenxsBreastplate": "{$CommonItemTooltip.DevItem}", "CenxsLeggings": "{$CommonItemTooltip.DevItem}", @@ -4206,17 +4237,17 @@ "VampireKnives": "Szybki rzut wysysającymi życie sztyletami", "AquaScepter": "Przywołuje strugę wody", "ScourgeoftheCorruptor": "Potężny oszczep uwalniający małych pożeraczy", - "Banana": "{$CommonItemTooltip.MinorStats}", + "StaffoftheFrostHydra": "Przyzywa potężną, mroźną hydrę, która zieje lodem w twoich wrogów", "SweetheartNecklace": "Uwalnia pszczoły i zwiększa szybkość poruszania się, kiedy otrzymasz obrażenia", "FlurryBoots": "Posiadacz biega superszybko", "LuckyHorseshoe": "Anuluje obrażenia spowodowane upadkiem", "DTownsHelmet": "{$CommonItemTooltip.DevItem}", "DTownsBreastplate": "{$CommonItemTooltip.DevItem}", "DTownsLeggings": "{$CommonItemTooltip.DevItem}", - "GroxTheGreatWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", - "StillLife": "{$PaintingArtist.Crowno}", - "BloodyGoblet": "{$PaintingArtist.Crowno}", - "WickedUndead": "{$PaintingArtist.Crowno}", + "DTownsWings": "{$CommonItemTooltip.DevItem}", + "WillsWings": "{$CommonItemTooltip.DevItem}", + "CrownosWings": "{$CommonItemTooltip.DevItem}", + "CenxsWings": "{$CommonItemTooltip.DevItem}", "CenxsDress": "{$CommonItemTooltip.DevItem}", "CenxsDressPants": "{$CommonItemTooltip.DevItem}", "ShinyRedBalloon": "Zwiększa wysokość skoku", @@ -4225,7 +4256,7 @@ "AnkhCharm": "Daje odporność na większość osłabień", "AnkhShield": "Zapewnia odporność przed odrzutem i blokami ognia\nDaje odporność na większość osłabień", "WaterBolt": "Rzuca powolnym pociskiem wody", - "GolfBall": "{$CommonItemTooltip.GolfBall}", + "Bomb": "Mały wybuch niszczący niektóre płytki", "Dynamite": "Duży wybuch niszczący większość płytek", "Grenade": "Mały wybuch, który nie niszczy płytek", "GoldWatch": "Pokazuje godzinę", @@ -4237,7 +4268,7 @@ "GoodieBag": "{$CommonItemTooltip.RightClickToOpen}", "CandyCornRifle": "33% szans niezużycia amunicji", "Sickle": "Pozwala pozyskiwać siano z trawy", - "KiteAngryTrapper": "{$CommonItemTooltip.Kite}", + "PumpkinPie": "{$CommonItemTooltip.MinorStats}", "TatteredFairyWings": "{$CommonItemTooltip.FlightAndSlowfall}", "SpiderEgg": "Przyzywa pająka-chowańca", "MagicalPumpkinSeed": "Przyzywa kabaczka-chowańca", @@ -4253,35 +4284,35 @@ "UnluckyYarn": "Przyzywa czarnego kotka", "TheHorsemansBlade": "Przyzywa dynię atakującą twoich wrogów", "SpookyWings": "{$CommonItemTooltip.FlightAndSlowfall}", - "GhostManifestation": "{$PaintingArtist.Crowno}", - "Graveyard": "{$PaintingArtist.Crowno}", - "Reborn": "{$PaintingArtist.Crowno}", + "SpookyHelmet": "Zwiększa maksymalną liczbę sług gracza\nZwiększa obrażenia sług o 11%", + "SpookyBreastplate": "Zwiększa maksymalną liczbę sług gracza\nZwiększa obrażenia sług o 11%", + "SpookyLeggings": "Zwiększa maksymalną liczbę sług gracza\nZwiększa obrażenia sług o 11%", "CursedSapling": "Przyzywa przeklęte drzewko, które za tobą podąża", "PumpkinMoonMedallion": "Przyzywa dyniowy księżyc", - "Nevermore": "{$PaintingArtist.Crowno}", + "NecromanticScroll": "Zwiększa maksymalną liczbę sług gracza\nZwiększa obrażenia sług o 10%", "SniperScope": "Zwiększa zasięg widzenia dla pistoletów (, żeby oddalić)\n10% zwiększone obrażenia dystansowe oraz szansa na trafienie krytyczne", "BreathingReed": "Daje możliwość oddychania pod wodą i zwiększa czas wdechu", "JellyfishDivingGear": "Pozwala pływać i znacznie wydłuża oddychanie pod wodą\nZapewnia światło pod wodą", "ArcticDivingGear": "Pozwala pływać i znacznie wydłuża oddychanie pod wodą\nZapewnia światło pod wodą i dodatkową zwinność na lodzie", - "GnomeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.Gnome}", + "FrostsparkBoots": "Pozwala latać, superszybko biegać i daje dodatkową zwinność na lodzie\n7% zwiększona szybkość poruszania się", "FartInABalloon": "Daje posiadaczowi umiejętność podwójnego skoku\nZwiększa wysokość skoku", - "DandelionBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.Dandelion}", - "GolfPainting3": "{$PaintingArtist.Crowno}", - "ArkhalisWings": "{$ItemTooltip.ArkhalisHat}\n{$CommonItemTooltip.FlightAndSlowfall}", + "PapyrusScarab": "Zwiększa maksymalną liczbę sług gracza\nZwiększa odrzut i obrażenia sług", + "CelestialStone": "Niewielki wzrost obrażeń, szybkości walki w zwarciu, szansy na trafienie krytyczne\nregeneracji życia, obrony, szybkości podnoszenia i odrzutu sług", + "Hoverboard": "{$CommonItemTooltip.FlightAndSlowfall}\nPrzytrzymaj W DÓŁ i SKOK, żeby latać", "Present": "{$CommonItemTooltip.RightClickToOpen}", "Flipper": "Pozwala pływać", "RedRyder": "„Tylko sobie w oko nie strzel!”", "FestiveWings": "{$CommonItemTooltip.FlightAndSlowfall}", "BladeofGrass": "Daje szansę zatrucia wrogów", "EldMelter": "Używa żelu jako amunicji", - "KiteGoldfish": "{$CommonItemTooltip.Kite}", + "ChristmasPudding": "{$CommonItemTooltip.MinorStats}", "ReindeerBells": "Przyzywa renifera, którego można dosiąść", "CnadyCanePickaxe": "Może wydobywać meteoryt", - "KiteBunnyCrimson": "{$CommonItemTooltip.Kite}", - "KiteBunnyCorrupt": "{$CommonItemTooltip.Kite}", + "SugarCookie": "{$CommonItemTooltip.MinorStats}", + "GingerbreadCookie": "{$CommonItemTooltip.MinorStats}", "HandWarmer": "Daje odporność na efekty chłodu i zamrożenia", "Coal": "„Grzeczność nie była w tym roku twoją najmocniejszą stroną”", - "GolfPainting2": "{$PaintingArtist.Crowno}", + "Toolbox": "Zwiększa zasięg narzędzi oraz umieszczania przedmiotów o 1", "DogWhistle": "Przyzywa szczeniaczka", "ChristmasTreeSword": "Strzela ozdobami świątecznymi", "ChainGun": "50% szans niezużycia amunicji", @@ -4297,7 +4328,7 @@ "JungleRose": "„Och, ale piękna”", "FeralClaws": "12% zwiększona szybkość walki w zwarciu", "AnkletoftheWind": "10% zwiększona szybkość poruszania się", - "GolfClubIron": "{$CommonItemTooltip.GolfIron}", + "StaffofRegrowth": "Tworzy trawę i mech na ziemi i kamieniu\nUżywany do zbieractwa zwiększa liczbę zbieranych roślin wykorzystywanych w alchemii", "WhoopieCushion": "„Może irytować innych”", "HeavyWorkBench": "Używany do tworzenia bardziej złożonych przedmiotów", "AmmoBox": "Zmniejsza zużycie amunicji o 20%", @@ -4318,7 +4349,7 @@ "SteampunkBoiler": "{$CommonItemTooltip.SpecialCrafting}", "HoneyDispenser": "{$CommonItemTooltip.SpecialCrafting}", "BrickLayer": "Zwiększa szybkość układania płytek", - "GolfPainting1": "{$PaintingArtist.Crowno}", + "ExtendoGrip": "Zwiększa zasięg płytek", "PaintSprayer": "Automatycznie maluje umieszczone przedmioty", "PortableCementMixer": "Zwiększa szybkość umieszczania ścian", "CelestialMagnet": "Zwiększa zasięg podnoszenia gwiazdek many", @@ -4327,8 +4358,8 @@ "CelestialCuffs": "Zwiększa zasięg podnoszenia gwiazdek many\nPrzy otrzymaniu obrażeń odnawia manę", "PulseBow": "Strzela naładowaną strzałą", "NaturesGift": "6% mniejsze zużycie many", - "KiteSandShark": "{$CommonItemTooltip.Kite}", - "KiteShark": "{$CommonItemTooltip.Kite}", + "PadThai": "{$CommonItemTooltip.MinorStats}", + "Pho": "{$CommonItemTooltip.MinorStats}", "RestorationPotion": "Zmniejszony czas odnowienia mikstur", "Gatligator": "50% szans niezużycia amunicji\nBardzo niecelny", "WaterGun": "Strzela nieszkodliwym strumieniem wody", @@ -4341,14 +4372,14 @@ "Gel": "„I smaczny, i łatwopalny”", "JunglePants": "Zwiększa maksymalną liczbę punktów many o 20\n4% większa szansa na magiczne trafienie krytyczne", "NeonTetra": "„Te kolorowe łuski chyba można drogo sprzedać”.", - "Grapefruit": "{$CommonItemTooltip.MinorStats}", + "GoldenCarp": "Ładnie się świeci. To nie są tanie rzeczy.", "MiningPotion": "Zwiększa szybkość kopania o 25%", "HeartreachPotion": "Zwiększa zasięg podnoszenia serc życia", - "DungeonFishingCrateHard": "{$ItemTooltip.DungeonFishingCrate}", + "CalmingPotion": "Zmniejsza agresję przeciwników", "BuilderPotion": "Zwiększa szybkość i zasięg układania obiektów", "TitanPotion": "Zwiększa odrzut", "FlipperPotion": "Pozwala ci szybko poruszać się w cieczach", - "DivineEye": "{$PaintingArtist.Darthkitten}", + "SummoningPotion": "Zwiększa maksymalną liczbę sług gracza", "TrapsightPotion": "Pozwala dostrzegać pobliskie zagrożenia", "WoodenCrate": "{$CommonItemTooltip.RightClickToOpen}", "IronCrate": "{$CommonItemTooltip.RightClickToOpen}", @@ -4359,36 +4390,36 @@ "RagePotion": "Zwiększa szansę na trafienie krytyczne o 10%", "InfernoPotion": "Podpala pobliskich wrogów", "WrathPotion": "Zwiększa obrażenia o 10%", - "GolfClubDriver": "{$CommonItemTooltip.GolfDriver}", + "StickyBomb": "„Może ciężko się rzucać”.", "RecallPotion": "Teleportuje cię do domu", "TeleportationPotion": "Teleportuje cię w losowe miejsce", "LovePotion": "Rzuć nią, żeby ktoś się w tobie zakochał", "StinkPotion": "Rzuć nią, żeby ktoś paskudnie śmierdział", - "BandageBoy": "{$PaintingArtist.Darthkitten}", + "FishingPotion": "Zwiększa umiejętności wędkarskie", "SonarPotion": "Wykrywa rybę, która połknęła haczyk", "CratePotion": "Zwiększa szansę wyłowienia skrzyni", "WarmthPotion": "Zmniejsza obrażenia od źródeł zimna", - "VisitingThePyramids": "{$PaintingArtist.Leinfors}", - "Uluru": "{$PaintingArtist.darthmorf}", + "BeeHeadgear": "Zwiększa obrażenia sług o 4%\nZwiększa maksymalną liczbę sług gracza", + "BeeBreastplate": "Zwiększa obrażenia sług o 4%\nZwiększa maksymalną liczbę sług gracza", "BeeGreaves": "Zwiększa obrażenia sług o 5%", "HornetStaff": "Przyzywa szerszenia walczącego po twojej stronie", "ImpStaff": "Przyzywa diablika walczącego po twojej stronie", - "Oasis": "{$PaintingArtist.Khaios}", - "LifeAboveTheSand": "{$PaintingArtist.Zoomo}", - "SnakesIHateSnakes": "{$PaintingArtist.Xman101}", + "AnglerHat": "Zwiększa poziom wędkarstwa", + "AnglerVest": "Zwiększa poziom wędkarstwa", + "AnglerPants": "Zwiększa poziom wędkarstwa", "Sunglasses": "„Świetnie w nich wyglądasz!”", - "TheSandsOfSlime": "{$PaintingArtist.Criddle}", - "JawsOfDeath": "{$PaintingArtist.Darthkitten}", - "BurningSpirit": "{$PaintingArtist.Zoomo}", + "SpiderMask": "Zwiększa maksymalną liczbę sług gracza\nZwiększa obrażenia sług o 6%", + "SpiderBreastplate": "Zwiększa maksymalną liczbę sług gracza\nZwiększa obrażenia sług o 6%", + "SpiderGreaves": "Zwiększa maksymalną liczbę sług gracza\nZwiększa obrażenia sług o 6%", "HighTestFishingLine": "Żyłka nigdy nie pęka", - "FruitSalad": "{$CommonItemTooltip.MinorStats}", + "AnglerEarring": "Zwiększa umiejętności wędkarskie", "TackleBox": "Zmniejsza szanse ryby na połknięcie przynęty", "WizardHat": "15% zwiększone obrażenia magiczne", "ZephyrFish": "Przyzywa rybę zefiru", "FrogLeg": "Zwiększa szybkość skoku i pozwala na skok automatyczny\nZwiększa odporność na upadki", - "Dragonfruit": "{$CommonItemTooltip.MediumStats}", - "KiteJellyfishPink": "{$CommonItemTooltip.Kite}", - "KiteJellyfishBlue": "{$CommonItemTooltip.Kite}", + "CookedFish": "{$CommonItemTooltip.MinorStats}", + "CookedShrimp": "{$CommonItemTooltip.MinorStats}", + "Sashimi": "{$CommonItemTooltip.MinorStats}", "FinWings": "{$CommonItemTooltip.FlightAndSlowfall}", "OpticStaff": "Przyzywa bliźnięta walczące po twojej stronie", "RedHat": "Dziwnie pachnie...", @@ -4421,13 +4452,13 @@ "HunterPotion": "Pokazuje położenie przeciwników", "GravitationPotion": "Pozwala kontrolować grawitację", "IllegalGunParts": "„Zakazane prawie wszędzie”", - "GolfClubWedge": "{$CommonItemTooltip.GolfWedge}", - "BetsyWings": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", + "GoldenKey": "Otwiera jeden złoty kufer lub kufer z lochu", + "ShadowKey": "Otwiera wszystkie kufry cienia", "Furnace": "Używany do wytapiania rudy", "Loom": "Używane do tworzenia płótna", "IronAnvil": "Używane do tworzenia przedmiotów z metalowych sztabek", "Keg": "Używany do warzenia piwa", - "KiteManEater": "{$CommonItemTooltip.Kite}", + "BowlofSoup": "{$CommonItemTooltip.MinorStats}", "WorkBench": "Używany do tworzenia podstawowych przedmiotów", "GoblinBattleStandard": "Przyzywa armię goblinów", "Sawmill": "Używany do tworzenia bardziej złożonych przedmiotów z drewna", @@ -4440,7 +4471,7 @@ "MythrilHat": "12% zwiększone obrażenia dystansowe\n7% większa szansa na dystansowe trafienie krytyczne", "CobaltDrill": "Może wydobywać mithril i orichalcum", "MythrilDrill": "Może wydobywać adamantyt i tytan", - "WingsNebula": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", + "DaoofPow": "Może zdezorientować przeciwnika\n„Odnajdź swój pokój”", "Compass": "Pokazuje pozycję horyzontalną", "DivingGear": "Pozwala pływać\nZnacznie wydłuża czas oddychania pod wodą", "GPS": "Pokazuje pozycję\nPokazuje godzinę", @@ -4454,14 +4485,14 @@ "AdamantiteBreastplate": "6% zwiększone obrażenia", "AdamantiteLeggings": "4% większa szansa na trafienie krytyczne\n5% zwiększona szybkość poruszania się", "SpectreBoots": "Pozwala latać\nPosiadacz biega superszybko", - "FruitJuice": "{$CommonItemTooltip.MinorStats}", + "Toolbelt": "Zwiększa zasięg układania bloków", "HolyWater": "Rozprzestrzenia efekt Bajkowa na niektóre bloki", - "CrimsonFishingCrateHard": "{$ItemTooltip.CrimsonFishingCrate}", + "UnholyWater": "Rozprzestrzenia efekt Zepsucia na niektóre bloki", "FairyBell": "Przyzywa magicznego duszka", "SuspiciousLookingEye": "Przyzywa Oko Cthulhu", "ClockworkAssaultRifle": "Potrójna seria\nTylko pierwszy strzał zużywa amunicję", "MoonCharm": "Nocą zamienia posiadacza w wilkołaka", - "KiteCrawltipede": "{$CommonItemTooltip.Kite}", + "Ruler": "Tworzy na ekranie linie pomiarowe ułatwiające ustawianie bloków", "SorcererEmblem": "15% zwiększone obrażenia magiczne", "BandofRegeneration": "Powoli regeneruje życie", "WarriorEmblem": "15% zwiększone obrażenia w walce w zwarciu", @@ -4487,16 +4518,16 @@ "AdamantiteForge": "Używana do wytapiania rudy adamantytu i tytanu", "MythrilAnvil": "Używane do tworzenia przedmiotów ze sztabek mithrilu, orichalcum, adamantytu i tytanu", "UnicornHorn": "„Ostry i magiczny!”", - "CrownosWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "DarkShard": "„Czasami mają go stworzenia ze spaczonych zepsuciem pustyń”", "LightShard": "„Czasami mają go stworzenia z pustyń światła”", "RedPressurePlate": "Aktywuje się, gdy się na nią stanie", "CloudinaBottle": "Daje posiadaczowi umiejętność podwójnego skoku", "SpellTome": "Można ją zaczarować", - "PrismaticPunch": "{$CommonItemTooltip.MediumStats}", + "StarCloak": "Powoduje spadanie gwiazd, gdy gracz otrzyma obrażenia", "Megashark": "50% szans niezużycia amunicji\n„Starszy brat minirekina”", "Shotgun": "Strzela salwą kul", - "FrozenCrateHard": "{$CommonItemTooltip.RightClickToOpen}", - "Mango": "{$CommonItemTooltip.MinorStats}", + "PhilosophersStone": "Zmniejsza czas odnowienia mikstur leczenia", + "TitanGlove": "Zwiększa odrzut od ataków w zwarciu", "HermesBoots": "Posiadacz biega superszybko", "GreenPressurePlate": "Aktywuje się, gdy się na nią stanie", "GrayPressurePlate": "Aktywuje się, gdy gracz na nią nadepnie", @@ -4510,10 +4541,10 @@ "HallowedHelmet": "15% zwiększone obrażenia dystansowe\n8% większa szansa na dystansowe trafienie krytyczne", "CrossNecklace": "Po otrzymaniu obrażeń wydłuża czas trwania niewidzialności", "ManaFlower": "8% mniejsze zużycie many\nAutomatyczne używanie mikstur many", - "Elderberry": "{$CommonItemTooltip.MinorStats}", + "MechanicalWorm": "Przyzywa Niszczyciela", "MechanicalSkull": "Przyzywa Szkieletrona Prime’a", "HallowedHeadgear": "Zwiększa maksymalną liczbę punktów many o 100\n12% zwiększone obrażenia magiczne oraz szansa na trafienie krytyczne", - "KiteYellow": "{$CommonItemTooltip.Kite}", + "HallowedMask": "10% zwiększone obrażenia w walce w zwarciu oraz szansa na trafienie krytyczne\n10% zwiększona szybkość walki w zwarciu", "DemoniteOre": "„Pulsuje mroczną energią”", "SlimeCrown": "Przyzywa Króla Szlam", "LightDisc": "Można połączyć 5", @@ -4535,12 +4566,12 @@ "Vilethorn": "Przyzywa plugawy kolec", "Starfury": "Sprawia, że z nieba spadają gwiazdy\n„Wykuta dzięki furii niebios”", "PurificationPowder": "Usuwa zło", - "SmoothieofDarkness": "{$CommonItemTooltip.MinorStats}", + "RedsWings": "{$CommonItemTooltip.DevItem}", "RedsHelmet": "{$CommonItemTooltip.DevItem}", "RedsBreastplate": "{$CommonItemTooltip.DevItem}", "RedsLeggings": "{$CommonItemTooltip.DevItem}", "Fish": "Przyzywa młodego pingwina", - "BloodOrange": "{$CommonItemTooltip.MinorStats}", + "VilePowder": "Usuwa Bajkowo", "Frostbrand": "Strzela lodowym pociskiem", "RedPotion": "Tylko dla tych, którzy są jej warci", "RottenChunk": "„Wygląda apetycznie!”", @@ -4557,7 +4588,7 @@ "IceBlade": "Strzela lodowym pociskiem", "IceBow": "Strzela mroźnymi strzałami", "FrostStaff": "Strzela strumieniem mrozu", - "BlueCultistCasterBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CultistDevote}", + "Jetpack": "{$CommonItemTooltip.FlightAndSlowfall}\nPrzytrzymaj W GÓRĘ, żeby szybciej lecieć", "ButterflyWings": "{$CommonItemTooltip.FlightAndSlowfall}", "FallenStar": "Znika po wschodzie słońca", "Seaweed": "Przyzywa żółwia-chowańca", @@ -4588,14 +4619,14 @@ "GreenWrench": "Ustawia zielony kabel", "BluePressurePlate": "Aktywuje się, gdy gracz na nią nadepnie", "YellowPressurePlate": "Aktywuje się jeżeli stanie na nią cokolwiek innego niż gracz", - "FrozenCrate": "{$CommonItemTooltip.RightClickToOpen}", + "DiscountCard": "Towary w sklepach są tańsze", "LuckyCoin": "Atakowanie przeciwników czasami daje dodatkowe monety", "UnicornonaStick": "„Bawię się jak nigdy!”", "SandstorminaBottle": "Daje posiadaczowi umiejętność ulepszonego podwójnego skoku", - "CanOfWorms": "{$CommonItemTooltip.RightClickToOpen}", + "CharmofMyths": "Daje regenerację życia i skraca czas odnowienia mikstur leczenia", "MoonShell": "Nocą zamienia posiadacza w wilkołaka, a podczas wchodzenia do wody w ryboludzia", "StarVeil": "Powoduje spadanie gwiazd i wydłuża czas trwania niewidzialności po otrzymaniu obrażeń", - "BloodyMoscato": "{$CommonItemTooltip.MinorStats}", + "WaterWalkingBoots": "Pozwala chodzić po wodzie", "MiningHelmet": "Zapewnia światło podczas noszenia", "AdhesiveBandage": "Odporność na Krwawienie", "ArmorPolish": "Odporność na Zniszczoną zbroję", @@ -4606,28 +4637,28 @@ "Nazar": "Odporność na Klątwę", "Vitamins": "Odporność na Osłabienie", "TrifoldMap": "Odporność na Dezorientację", - "Lemon": "{$CommonItemTooltip.MinorStats}", - "TropicalSmoothie": "{$CommonItemTooltip.MinorStats}", - "PinaColada": "{$CommonItemTooltip.MinorStats}", - "PeachSangria": "{$CommonItemTooltip.MinorStats}", + "PowerGlove": "Zwiększa odrzut od ataków w zwarciu\n12% zwiększona szybkość walki w zwarciu", + "LightningBoots": "Pozwala latać\nPosiadacz może niezwykle szybko biegać", + "SunStone": "Zwiększa wszystkie statystyki, gdy jest używany za dnia", + "MoonStone": "Zwiększa wszystkie statystyki, gdy jest używany nocą", "ArmorBracing": "Odporność na Osłabienie i Zniszczoną zbroję", "MedicatedBandage": "Odporność na Truciznę i Krwawienie", "ThePlan": "Odporność na Spowolnienie i Dezorientację", "CountercurseMantra": "Odporność na Uciszenie i Klątwę", "CoinGun": "Używa monet jako amunicji\nMonety o wyższej wartości zadają większe obrażenia", "LavaCharm": "Daje 7-sekundową odporność na lawę", - "BananaDaiquiri": "{$CommonItemTooltip.MinorStats}", - "Pineapple": "{$CommonItemTooltip.MinorStats}", + "ObsidianWaterWalkingBoots": "Pozwala chodzić po wodzie\nDaje odporność na bloki ognia", + "LavaWaders": "Pozwala chodzić po wodzie i lawie\nDaje odporność na bloki ognia i 7-sekundową odporność na lawę", "BoneWand": "Umieszcza kości", "LeafWand": "Umieszcza liście", "FlyingCarpet": "Pozwala posiadaczowi przez kilka sekund unosić się w powietrzu", "AvengerEmblem": "12% zwiększone obrażenia", - "Lemonade": "{$CommonItemTooltip.MinorStats}", + "MechanicalGlove": "Zwiększa odrzut od ataków w zwarciu\n12% zwiększone obrażenia oraz szybkość ataku w zwarciu", "LandMine": "Wybucha, gdy się na nią stanie", - "Starfruit": "{$CommonItemTooltip.MediumStats}", + "PaladinsShield": "Pochłania 25% obrażeń zadanych graczom z twojej drużyny\nAktywna tylko powyżej 25% punktów życia", "Umbrella": "Trzymając ten przedmiot, będziesz wolniej spadać", "ChlorophyteOre": "„Reaguje na światło”", - "GrapeJuice": "{$CommonItemTooltip.MajorStats}", + "SteampunkWings": "Daje umiejętność latania i powolnego upadku", "IceSkates": "Daje dodatkową zwinność na lodzie\nLód się nie załamie, kiedy na niego spadniesz", "SnowballLauncher": "Szybko strzela śnieżkami", "ClimbingClaws": "Pozwalają zjeżdżać po ścianach\nJeszcze lepsze w połączeniu z kolcami do butów", @@ -4644,7 +4675,7 @@ "Campfire": "Zwiększona regeneracja życia, gdy gracz znajduje się w pobliżu ogniska", "Marshmallow": "Wbij ją na patyk i piecz nad ogniskiem", "MarshmallowonaStick": "Piecz nad ogniskiem!", - "Coconut": "{$CommonItemTooltip.MinorStats}", + "CookedMarshmallow": "{$CommonItemTooltip.MinorStats}", "ShoeSpikes": "Pozwalają zjeżdżać po ścianach\nJeszcze lepsze w połączeniu z pazurami wspinaczkowymi", "TigerClimbingGear": "Pozwala wspinać się po ścianach", "Tabi": "Pozwala wykonać zryw\nStuknij dwukrotnie odpowiedni kierunek", @@ -4660,19 +4691,19 @@ "EatersBone": "Przyzywa młodego pożeracza dusz", "BlendOMatic": "Używana do tworzenia przedmiotów", "MeatGrinder": "Używana do tworzenia przedmiotów", - "Rambutan": "{$CommonItemTooltip.MinorStats}", + "Extractinator": "Zamienia muł/breję/skamieliny w coś bardziej użytecznego\n„Używasz, umieszczając muł/breję/skamieliny w ekstraktorze”", "Solidifier": "Używana do tworzenia przedmiotów", "ActuationAccessory": "Automatycznie umieszcza siłowniki na umieszczonych obiektach", "ActuationRod": "Aktywuje siłowniki", "AlchemyTable": "33% szans na niezużycie składników wykorzystywanych do tworzenia mikstur", "AncientBattleArmorHat": "15% zwiększone obrażenia magiczne i obrażenia sługi", - "AppleJuice": "{$CommonItemTooltip.MinorStats}", - "WoodenCrateHard": "{$ItemTooltip.WoodenCrate}", + "AncientBattleArmorPants": "Zwiększa maksymalną liczbę sług gracza", + "AncientBattleArmorShirt": "Zwiększa maksymalną liczbę punktów many o 80", "AncientHorn": "Przyzywa bazyliszka, którego można dosiąść", - "BloodNautilusBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodNautilus}", - "GoblinSharkBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.GoblinShark}", + "AnglerTackleBag": "Żyłka nigdy nie pęknie, zmniejsza szanse ryby na połknięcie przynęty, zwiększa umiejętności wędkarskie", + "ArchitectGizmoPack": "Zwiększa szybkość i zasięg ustawiania płytek i ścian\nAutomatycznie maluje umieszczone przedmioty", "AviatorSunglasses": "Uwalnia twojego wewnętrznego pilota\n„Przebierz się za streamerów!”", - "KitePigron": "{$CommonItemTooltip.Kite}", + "Bacon": "{$CommonItemTooltip.MinorStats}\n„Bekon? Bekon.”", "BalloonHorseshoeFart": "Daje posiadaczowi umiejętność podwójnego skoku\nZwiększa wysokość skoku i anuluje obrażenia spowodowane upadkiem", "BalloonHorseshoeHoney": "Po otrzymaniu obrażeń uwalnia pszczoły\nZwiększa wysokość skoku i anuluje obrażenia spowodowane upadkiem", "BalloonHorseshoeSharkron": "Daje posiadaczowi umiejętność podwójnego skoku\nZwiększa wysokość skoku i anuluje obrażenia spowodowane upadkiem", @@ -4680,26 +4711,26 @@ "BeesKnees": "Drewniane strzały zamieniają się w rząd pszczół", "BejeweledValkyrieBody": "{$CommonItemTooltip.DevItem}\nElegancja ozdobiona klejnotami, którą szybujesz pośród chmur i burz", "BejeweledValkyrieHead": "{$CommonItemTooltip.DevItem}\nStań się jak wiatr, dosiądź błyskawicę.", - "BloodEelBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodEelHead}", + "BejeweledValkyrieWing": "{$CommonItemTooltip.DevItem}\nLatająca, satelitarna platforma walkirii jest całkowicie bezpieczna. W większości przypadków.", "BewitchingTable": ", jeśli chcesz więcej sług", "Bladetongue": "Przy zderzeniu wypuszcza strumień ichoru", "BlessedApple": "Przyzywa jednorożca, którego można dosiąść", - "CorruptFishingCrateHard": "{$ItemTooltip.CorruptFishingCrate}", - "JungleFishingCrateHard": "{$ItemTooltip.JungleFishingCrate}", + "BloodWater": "Rozprzestrzenia efekt Szkarłatu na niektóre bloki", + "BombFish": "Mały wybuch niszczący niektóre płytki", "BoneCampfire": "Zwiększona regeneracja życia, gdy gracz znajduje się w pobliżu ogniska", "BoneRattle": "Przyzywa młodego pyskostwora", "BoneTorch": "„Emituje śmiertelny blask”", "BoosterTrack": "Stuknij młotem, żeby zmienić kierunek", - "GolfClubPutter": "{$CommonItemTooltip.GolfPutter}", - "HallowedFishingCrateHard": "{$ItemTooltip.HallowedFishingCrate}", - "KiteRedAndYellow": "{$CommonItemTooltip.Kite}", + "BottomlessBucket": "Zawiera nieskończoną ilość wody", + "BouncyBomb": "Mały wybuch niszczący niektóre płytki\nSkacze jak pasikonik", + "BouncyDynamite": "„Ten pomysł okaże się fatalny w skutkach”", "BouncyGlowstick": "Działa, kiedy go zmoczysz", "BouncyGrenade": "Mały wybuch, który nie niszczy płytek\nSkacze jak pasikonik", - "WillsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "BrainOfConfusion": "Może zdezorientować pobliskich wrogów, kiedy gracz otrzyma obrażenia", "BrainScrambler": "Przyzywa scutlixa, którego można dosiąść", "BubbleGun": "Strzela szybko potężnymi bańkami", "ButchersChainsaw": "Z trafionych przeciwników aż iskry idą", - "BloodSquidBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodSquid}", + "CelestialShell": "Nocą zamienia posiadacza w wilkołaka, a podczas wchodzenia do wody w ryboludzia\nNiewielki wzrost wszystkich statystyk", "CelestialSigil": "Przyzywa nieuchronny koniec", "CellPhone": "Wyświetla wszystko\nPozwala w dowolnym momencie wrócić do domu", "ClingerStaff": "Przyzywa ścianę przeklętych płomieni", @@ -4733,9 +4764,9 @@ "FloatingIslandFishingCrate": "{$CommonItemTooltip.RightClickToOpen}", "FlowerBoots": "Na trawie, po której chodzisz, rosną kwiatki", "FlyingKnife": "Rzuca latającym nożem, który można kontrolować", - "GolfBallDyedBrown": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedBlue": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedBlack": "{$CommonItemTooltip.GolfBall}", + "FossilHelm": "20% zwiększona prędkość rzutu", + "FossilPants": "15% większa szansa na trafienie krytyczne rzutu", + "FossilShirt": "20% zwiększone obrażenia rzutu", "FragmentNebula": "„Moc galaktyki jest zawarta w tym fragmencie”", "FragmentSolar": "„W tym fragmencie spoczywa furia wszechświata”", "FragmentStardust": "„Zachwycające cząsteczki krążą wokół tego fragmentu”", @@ -4752,8 +4783,8 @@ "GoblinTech": "Pokazuje szybkość poruszania się, obrażenia na sekundę i wartościowe rudy", "GoldPickaxe": "Może wydobywać meteoryt", "GoldRing": "Zwiększa zasięg podnoszenia monet", - "Plum": "{$CommonItemTooltip.MinorStats}", - "KiteBunny": "{$CommonItemTooltip.Kite}", + "GreedyRing": "Zwiększa zasięg podnoszenia monet i obniża ceny towarów w sklepach\nAtakowanie przeciwników czasami daje dodatkowe monety", + "GrubSoup": "{$CommonItemTooltip.MinorStats}", "HallowedFishingCrate": "{$CommonItemTooltip.RightClickToOpen}", "HardySaddle": "Przyzywa żółwia, którego można dosiąść", "HellwingBow": "Drewniane strzały zamieniają się w płonące nietoperze", @@ -4762,7 +4793,7 @@ "HoneyedGoggles": "Przyzywa pszczołę, którą można latać", "IceMirror": "Spójrz w lustro, żeby wrócić do domu", "IchorCampfire": "Zwiększona regeneracja życia, gdy gracz znajduje się w pobliżu ogniska", - "EyeballFlyingFishBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.EyeballFlyingFish}", + "JimsWings": "{$CommonItemTooltip.DevItem}", "JungleFishingCrate": "{$CommonItemTooltip.RightClickToOpen}", "LargeAmber": "Do „Zdobądź flagę”. Wypada, kiedy giniesz", "LaserRuler": "Tworzy na ekranie linie pomiarowe ułatwiające ustawianie bloków", @@ -4790,7 +4821,7 @@ "LokisHelm": "{$CommonItemTooltip.DevItem}\nNieład pochodzi od ładu, strach od odwagi, słabość od siły", "LokisPants": "{$CommonItemTooltip.DevItem}\nTryby sprawiedliwości mielą wolno, ale za to niezwykle dokładnie.", "LokisShirt": "{$CommonItemTooltip.DevItem}\nZnaj siebie, znaj wroga swego. Tysiąc bitew, tysiąc zwycięstw...", - "ZombieMermanBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.ZombieMerman}", + "LokisWings": "{$CommonItemTooltip.DevItem}\nNiech twoje plany będą ciemne i nieprzeniknione jak noc, a gdy ruszasz, uderzaj jak piorun.", "LunarBar": "„Wibruje świetlistą, niebiańską energią”", "LunarCraftingStation": "Używany do tworzenia przedmiotów z księżycowych fragmentów i luminytu", "LunarFlareBook": "Strzela flarami księżycowymi", @@ -4806,7 +4837,7 @@ "MoneyTrough": "Przyzywa latającą świnkę skarbonkę, która przechowuje twoje przedmioty", "MoonlordArrow": "Leci z prędkością dźwięku", "MoonlordBullet": "„Przeszywa przeciwników, trafiając kilku naraz”", - "Apricot": "{$CommonItemTooltip.MinorStats}", + "MoonlordTurretStaff": "Przyzywa księżycowy portal, który strzela laserem w twoich przeciwników", "MothronWings": "{$CommonItemTooltip.FlightAndSlowfall}", "MulticolorWrench": ", trzymając klucz, żeby edytować ustawienia kabli", "NebulaArcanum": "Tworzy astralną energię ścigającą twoich przeciwników", @@ -4817,9 +4848,9 @@ "NebulaMonolith": "„Posiądź cząstkę mocy z wieży mgławicy”", "NightKey": "„Naładowany esencją wielu dusz”", "NightVisionHelmet": "Poprawia widzenie", - "GolfBallDyedLimeGreen": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedGreen": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedCyan": "{$CommonItemTooltip.GolfBall}", + "NinjaHood": "15% zwiększona prędkość rzutu", + "NinjaPants": "10% większa szansa na trafienie krytyczne rzutu", + "NinjaShirt": "15% zwiększone obrażenia rzutu", "PartyBundleOfBalloonTile": "„Związane tak dla radochy”", "PartyGirlGrenade": "Mały wybuch, który nie niszczy płytek", "PartyMonolith": "„Albowiem niebo zapłacze balonami”", @@ -4841,10 +4872,10 @@ "ProjectilePressurePad": "Aktywuje się przy zetknięciu z pociskiem", "PsychoKnife": "Pozwala ci się ukryć", "PutridScent": "Wrogowie rzadziej biorą cię na cel\n5% zwiększone obrażenia oraz szansa na trafienie krytyczne", - "GolfBallDyedYellow": "{$CommonItemTooltip.GolfBall}", + "QueenSpiderStaff": "Przyzywa królową pająków, która pluje jajami w twoich wrogów", "Radar": "Wykrywa pobliskich wrogów", "RainbowCampfire": "Zwiększona regeneracja życia, gdy gracz znajduje się w pobliżu ogniska", - "GolfBallDyedViolet": "{$CommonItemTooltip.GolfBall}", + "RainbowCrystalStaff": "Przyzywa promienny kryształ, który usuwa twoich wrogów\n„I te kolory!”", "RazorbladeTyphoon": "Rzuca szybkie ostrokoła", "RedsYoyo": "{$CommonItemTooltip.DevItem}", "REK": "Pokazuje liczbę potworów, zabójstw i rzadkich stworzeń", @@ -4875,30 +4906,30 @@ "SkiphsHelm": "{$CommonItemTooltip.DevItem}", "SkiphsPants": "{$CommonItemTooltip.DevItem}", "SkiphsShirt": "{$CommonItemTooltip.DevItem}", - "TheBrideBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.TheBride}", - "DTownsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "SkiphsWings": "{$CommonItemTooltip.DevItem}", + "SliceOfCake": "Napchaj się. Napchaj kogoś innego. Bez różnicy.", "SlimeGun": "Strzela nieszkodliwym strumieniem szlamu", "SlimySaddle": "Przyzywa szlama, którego można dosiąść", - "KiteKoi": "{$CommonItemTooltip.Kite}", + "SnowCloudBlock": "Zimno tutaj", "SnowFallBlock": "Dużo lepszy niż śnieżna kula", "SnowFallWall": "Dużo lepszy niż śnieżna kula", "SolarEruption": "„Uderz furią słońca”", - "RedsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", - "Hoverboard": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", - "CenxsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "SolarFlareBreastplate": "22% zwiększone obrażenia w walce w zwarciu\nWrogowie częściej biorą cię na cel", + "SolarFlareHelmet": "17% większa szansa na trafienie krytyczne w walce w zwarciu\nWrogowie częściej biorą cię na cel", + "SolarFlareLeggings": "15% zwiększona szybkość poruszania się i walki w zwarciu\nWrogowie częściej biorą cię na cel", "SolarMonolith": "„Posiądź cząstkę mocy ze słonecznej wieży”", "SolarTablet": "Przyzywa zaćmienie", "SoulDrain": "Wysysa życie z wrogów", "SpelunkerGlowstick": "Pokazuje pobliski skarb", "SpiderStaff": "Przyzywa pająki walczące po twojej stronie", "SporeSac": "Przyzywa zarodniki atakujące twoich wrogów", - "GolfClubChlorophyteDriver": "{$CommonItemTooltip.GolfDriver}", + "StardustBreastplate": "Zwiększa maksymalną liczbę sług gracza\nZwiększa obrażenia sług o 22%", "StardustCellStaff": "Przyzywa ogniwo pyłu gwiezdnego walczące po twojej stronie\nAleż one się czepiają, jak zaraza", "StardustDragonStaff": "Przyzywa smoka pyłu gwiezdnego walczącego po twojej stronie\n„Po co komu zgraja sług, jak masz wielkiego smoka?”", - "GolfClubDiamondWedge": "{$CommonItemTooltip.GolfWedge}", - "GolfClubShroomitePutter": "{$CommonItemTooltip.GolfPutter}", + "StardustHelmet": "Zwiększa maksymalną liczbę sług gracza\nZwiększa obrażenia sług o 22%", + "StardustLeggings": "Zwiększa maksymalną liczbę sług gracza\nZwiększa obrażenia sług o 22%", "StardustMonolith": "„Posiądź cząstkę mocy z wieży pyłu gwiezdnego”", - "FloatingIslandFishingCrateHard": "{$ItemTooltip.FloatingIslandFishingCrate}", + "StickyDynamite": "„Może ciężko się rzucać”.", "StickyGrenade": "Mały wybuch, który nie niszczy płytek\n„Może ciężko się rzucać”.", "Stopwatch": "Pokazuje szybkość poruszania się gracza", "StrangeBrew": "„Wygląda i pachnie paskudnie”", @@ -4921,7 +4952,7 @@ "TungstenPickaxe": "Może wydobywać meteoryt", "UltraBrightCampfire": "Zwiększona regeneracja życia, gdy gracz znajduje się w pobliżu ogniska", "ValkyrieYoyo": "{$CommonItemTooltip.DevItem}", - "BlackCurrant": "{$CommonItemTooltip.MinorStats}", + "ViciousPowder": "Usuwa Bajkowo", "VineRopeCoil": "Rzuć, a otrzymasz pnącze, po którym można się wspiąć", "VortexBeater": "66% szans niezużycia amunicji\n„Porażająca mieszanka pif, paf i bum, bum”.", "VortexBreastplate": "12% zwiększone obrażenia dystansowe oraz szansa na trafienie krytyczne\n25% szans niezużycia amunicji", @@ -4935,10 +4966,10 @@ "WeightedPressurePlateOrange": "Aktywuje się, gdy gracz na nią wejdzie lub z niej zejdzie", "WeightedPressurePlatePink": "Aktywuje się, gdy gracz na nią wejdzie lub z niej zejdzie", "WeightedPressurePlatePurple": "Aktywuje się, gdy gracz na nią wejdzie lub z niej zejdzie", - "Peach": "{$CommonItemTooltip.MinorStats}", + "WingsNebula": "{$CommonItemTooltip.FlightAndSlowfall}", "WingsSolar": "{$CommonItemTooltip.FlightAndSlowfall}", "WingsStardust": "{$CommonItemTooltip.FlightAndSlowfall}", - "GolfClubTitaniumIron": "{$CommonItemTooltip.GolfIron}", + "WingsVortex": "{$CommonItemTooltip.FlightAndSlowfall}", "WireBulb": "Zapala żarówki dla każdego koloru kabla", "WireKite": "Daje najlepszą kontrolę nad kablami!\n, trzymając schemat, żeby edytować ustawienia kabli", "WirePipe": "Oddziela kable\nMożna też tu użyć młota!", @@ -4950,7 +4981,7 @@ "Yoraiz0rHead": "{$CommonItemTooltip.DevItem}", "Yoraiz0rPants": "{$CommonItemTooltip.DevItem}", "Yoraiz0rShirt": "{$CommonItemTooltip.DevItem}", - "GolfClubPearlwoodDriver": "{$CommonItemTooltip.GolfDriver}", + "Yoraiz0rWings": "{$CommonItemTooltip.DevItem}\nCokolwiek to akcesorium by nie robiło, to nie jest błąd!", "YoyoBag": "Użytkownik staje się mistrzem jojo", "YoYoGlove": "Pozwala używać dwóch jojo jednocześnie", "BloodMoonRising": "{$PaintingArtist.Garner}", @@ -5148,7 +5179,7 @@ "BlackSlimeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BlackSlime}", "BlueArmoredBonesBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BlueArmoredBones}", "BlueCultistArcherBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CultistArcherBlue}", - "SkiphsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "BlueCultistCasterBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.None}", "BlueCultistFighterBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.None}", "BoneLeeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BoneLee}", "ClingerBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.Clinger}", @@ -5402,22 +5433,22 @@ "ApprenticeScarf": "{$ItemTooltip.HuntressBuckler}", "SquireShield": "{$ItemTooltip.HuntressBuckler}", "MonkBelt": "{$ItemTooltip.HuntressBuckler}", - "GolfClubStoneIron": "{$CommonItemTooltip.GolfIron}", + "ApprenticeAltHead": "Zwiększa maksymalną liczbę wartowników\n10% zwiększone obrażenia sług i obrażenia magiczne", "ApprenticeAltPants": "20% zwiększone obrażenia sług oraz 25% zwiększona szansa na magiczne trafienie krytyczne", "ApprenticeAltShirt": "30% zwiększone obrażenia sług oraz 15% zwiększone obrażenia magiczne", - "GolfClubGoldWedge": "{$CommonItemTooltip.GolfWedge}", + "ApprenticeHat": "Zwiększa twoją maksymalną liczbę wartowników i zmniejsza koszt many o 10%", "ApprenticeRobe": "20% zwiększone obrażenia sług oraz 10% zwiększone obrażenia magiczne", "ApprenticeStaffT3": "Chlapie wyziewami zmniejszającymi obronę!", - "GoldenCrateHard": "{$ItemTooltip.GoldenCrate}", + "ApprenticeTrousers": "10% zwiększone obrażenia sług oraz 20% zwiększona szybkość poruszania się", "BookStaff": "Ciekawe, kto wsadził księgę nieskończonej mądrości na kijek...\n, żeby rzucić potężne tornado", - "GolfBallDyedSkyBlue": "{$CommonItemTooltip.GolfBall}", + "DD2BallistraTowerT1Popper": "Wolna, lecz zadająca duże obrażenia wieża, która strzela przeszywającymi pociskami\n{$CommonItemTooltip.EtherianManaCost10}", "DD2BetsyBow": "Strzela rozdzielającymi się strzałami, zadaje więcej obrażeń latającym przeciwnikom", "DD2ElderCrystal": "Umieść w stojaku kryształ eternia, żeby przywołać portale Etherii", "DD2ElderCrystalStand": "Miejsce na kryształ eternia", "DD2EnergyCrystal": "Często wykorzystywana do demonstrowania siły woli użytkownika przejawiającej się w postaci fizycznych struktur obronnych", - "GolfBallDyedRed": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedTeal": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedPurple": "{$CommonItemTooltip.GolfBall}", + "DD2ExplosiveTrapT1Popper": "Pułapka, która wybucha, gdy zbliży się do niej przeciwnik\n{$CommonItemTooltip.EtherianManaCost10}", + "DD2FlameburstTowerT1Popper": "Wieża o przeciętnej szybkości, która strzela wybuchającymi kulami ognia\n{$CommonItemTooltip.EtherianManaCost10}", + "DD2LightningAuraT1Popper": "Aura wielokrotnie uderzająca przeciwnika, który wejdzie w jej pole rażenia\n{$CommonItemTooltip.EtherianManaCost10}", "DD2PetDragon": "Przyzywa smoka-chowańca", "DD2PetGato": "Przyzywa gato-chowańca", "DD2PetGhost": "Przyzywa nikłego płomyka-chowańca, który daje światło", @@ -5425,77 +5456,47 @@ "DD2SquireBetsySword": "Uwalnia potężną, wewnętrzną energię", "DD2SquireDemonSword": ", żeby osłonić się tarczą", "DefenderMedal": "Waluta do handlu z Szynkarzem", - "ShuckedOyster": "{$CommonItemTooltip.MinorStats}", + "HuntressAltHead": "Zwiększa maksymalną liczbę wartowników\n10% zwiększone obrażenia sług oraz dystansowa szansa na trafienie krytyczne", "HuntressAltPants": "25% zwiększone obrażenia sług oraz 20% zwiększona szybkość poruszania się", "HuntressAltShirt": "25% zwiększone obrażenia sług i obrażenia dystansowe", - "GolfClubBronzeWedge": "{$CommonItemTooltip.GolfWedge}", + "HuntressBuckler": "Zwiększ maksymalną liczbę wartowników\nZwiększa obrażenia sług o 10%", "HuntressJerkin": "20% zwiększone obrażenia sług i obrażenia dystansowe", "HuntressPants": "10% zwiększone obrażenia sług oraz 20% zwiększona szybkość poruszania się", - "GolfClubWoodDriver": "{$CommonItemTooltip.GolfDriver}", - "Oyster": "{$CommonItemTooltip.RightClickToOpen}", + "HuntressWig": "Zwiększa maksymalną liczbę wartowników oraz szansę na dystansowe trafienie krytyczne o 10%", + "MonkAltHead": "Zwiększa maksymalną liczbę wartowników, a także zwiększa o 20% obrażenia sług i obrażenia w walce w zwarciu", "MonkAltPants": "20% zwiększone obrażenia sług, szybkość poruszania się i szansa na trafienie krytyczne w walce w zwarciu", "MonkAltShirt": "20% zwiększone obrażenia sług oraz szybkość ataku w zwarciu", - "GolfClubMythrilIron": "{$CommonItemTooltip.GolfIron}", + "MonkBrows": "Zwiększa maksymalną liczbę wartowników, a także zwiększa o 20% szybkość ataku w zwarciu", "MonkPants": "10% zwiększone obrażenia sług,\n10% większa szansa na trafienie krytyczne oraz 20% zwiększona szybkość poruszania się", "MonkShirt": "20% zwiększone obrażenia sług i obrażenia w walce w zwarciu", "MonkStaffT1": "Ładuje moc, atakując przeciwników", "MonkStaffT2": "Przyzywa duchy, gdy trafia przeciwników", "MonkStaffT3": ", dzierżąc broń, żeby wyprowadzić atak alternatywny!", - "GolfClubRustyPutter": "{$CommonItemTooltip.GolfPutter}", - "IronCrateHard": "{$ItemTooltip.IronCrate}", + "SquireAltHead": "Zwiększa maksymalną liczbę wartowników, a także zwiększa o 10% obrażenia sług", + "SquireAltPants": "20% zwiększone obrażenia sług i szansa na trafienie krytyczne, a także 30% zwiększona szybkość poruszania się", "SquireAltShirt": "30% zwiększone obrażenia sług oraz znacznie zwiększona regeneracja życia", - "GolfClubLeadPutter": "{$CommonItemTooltip.GolfPutter}", + "SquireGreatHelm": "Zwiększa maksymalną liczbę wartowników, a także zwiększa regenerację życia", "SquireGreaves": "15% zwiększone obrażenia sług, 20% zwiększona szansa na trafienie krytyczne w walce w zwarciu i szybkość poruszania się", "SquirePlating": "15% zwiększone obrażenia sług i obrażenia w walce w zwarciu", "ArkhalisShirt": "{$ItemTooltip.ArkhalisHat}", "ArkhalisPants": "{$ItemTooltip.ArkhalisHat}", - "LobsterTail": "{$CommonItemTooltip.MediumStats}", + "ArkhalisWings": "{$ItemTooltip.ArkhalisHat}", "ArkhalisHat": "{$CommonItemTooltip.DevItem}\n'Wcale nie jest z siatki'", "LeinforsHat": "{$CommonItemTooltip.DevItem}\n'Coby te ponętne loczki były zawsze takie cudne'", "LeinforsShirt": "{$CommonItemTooltip.DevItem}\n'I to jest sexy'", "LeinforsPants": "{$CommonItemTooltip.DevItem}\n'Niespodzianka! Nie spodziewaliście się tego po spodniach, co?'", - "OceanCrateHard": "{$CommonItemTooltip.RightClickToOpen}", - "LeinforsAccessory": "{$CommonItemTooltip.DevItem}\n'Najlepiej połączyć go z dietą makaronową'", - "KiteSpectrum": "{$CommonItemTooltip.Kite}", - "KiteWanderingEye": "{$CommonItemTooltip.Kite}", - "KiteUnicorn": "{$CommonItemTooltip.Kite}", - "FairyQueenBossBag": "{$CommonItemTooltip.RightClickToOpen}", - "LavaCrate": "{$CommonItemTooltip.RightClickToOpen}", - "LavaCrateHard": "{$CommonItemTooltip.RightClickToOpen}", - "HotlineFishingHook": "{$CommonItemTooltip.LavaFishing}", - "LavaFishingHook": "{$CommonItemTooltip.LavaFishing}", - "TeleportationPylonJungle": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonPurity": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonHallow": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonUnderground": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonOcean": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonDesert": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonSnow": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonMushroom": "{$CommonItemTooltip.TeleportationPylon}", - "RockGolemBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.RockGolem}", - "BloodMummyBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodMummy}", - "SporeSkeletonBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.SporeSkeleton}", - "SporeBatBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.SporeBat}", - "LarvaeAntlionBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.LarvaeAntlion}", - "CrimsonBunnyBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CrimsonBunny}", - "CrimsonGoldfishBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CrimsonGoldfish}", - "CrimsonPenguinBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CrimsonPenguin}", - "BigMimicCorruptionBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BigMimicCorruption}", - "BigMimicCrimsonBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BigMimicCrimson}", - "BigMimicHallowBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BigMimicHallow}", - "MossHornetBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.MossHornet}", - "WanderingEyeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.WanderingEye}", - "CreativeWings": "{$CommonItemTooltip.FlightAndSlowfall}", - "RainbowWings": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressUpToBooster}", - "LongRainbowTrailWings": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}\n{$CommonItemTooltip.PressUpToBooster}" + "LeinforsWings": "{$CommonItemTooltip.DevItem}\n'Pojechana! Co to właściwie znaczy?!'", + "LeinforsAccessory": "{$CommonItemTooltip.DevItem}\n'Najlepiej połączyć go z dietą makaronową'" }, "CommonItemTooltip": { "SpecialCrafting": "Do tworzenia przedmiotów specjalnych", "DevItem": "„Przebierz się za twórców!”", "FlightAndSlowfall": "Daje umiejętność latania i powolnego upadku", "RightClickToOpen": ", żeby otworzyć", + "MinorStats": "Niewielkie ulepszenie wszystkich statystyk", "BannerBonus": "Pobliscy gracze otrzymują premię w walce z następującymi przeciwnikami: ", "Counterweight": "Rzuca przeciwwagę po trafieniu przeciwnika przy pomocy jojo", + "EtherianManaCost10": "Zużyj 10 kryształów etheriańskiej many, żeby przywołać więcej niż 1", "MinuteDuration": "{0} min. czasu trwania", "PlaceableOnXmasTree": "Można umieścić na choince", "RestoresLife": "Przywraca {0} pkt. życia", diff --git a/Localization/Content/pl-PL/Legacy.json b/Localization/Content/pl-PL/Legacy.json index d30b61a..f9faa47 100644 --- a/Localization/Content/pl-PL/Legacy.json +++ b/Localization/Content/pl-PL/Legacy.json @@ -33,6 +33,7 @@ "37": "Sadzenie trawy", "38": "Sadzenie kaktusów", "39": "Sadzenie słoneczników", + "3": "Zamiatanie ziemi pod ziemię", "40": "Sadzenie drzew", "41": "Sadzenie ziół", "42": "Sadzenie chwastów", @@ -72,8 +73,10 @@ "73": "Zatwierdzanie zapisu świata:", "74": "Szlamy spadają z nieba!", "75": "Szlamy przestały spadać z nieba.", + "76": "Generowanie struktur.", "77": "Dodawanie trawy", "78": "Pustynie", + "79": "Upiększanie ścian", "7": "Tworzenie losowych dziur", "80": "Rzeźbienie marmuru", "81": "Tworzenie granitu", @@ -159,6 +162,7 @@ "167": "Zawsze kupuj więcej kabla, niż potrzebujesz!", "168": "Twoje urządzenie jest na pewno podłączone?", "169": "Wiesz, czego brakuje w tym domu? Światełek.", + "17": "Nie spuszczaj celu z oka, kup soczewkę!", "170": "Czerwone niebo zwiastuje krwawy księżyc. Jest w nim coś, co sprawia, że wyłazi pełno potworów.", "171": "Wiesz, gdzie znaleźć chwastozgon? Tak tylko pytam.", "172": "Popatrz w niebo, a zobaczysz, że księżyc jest czerwony.", @@ -177,8 +181,11 @@ "184": "Masz już rudę, teraz musisz przerobić ją na sztabki, z których stworzysz przedmioty. Potrzebny ci będzie piec!", "185": "Zrobisz go z pochodni, drewna i kamienia. Pamiętaj, że musisz stać przy stole warsztatowym.", "186": "Do tworzenia przedmiotów ze sztabek żelaza potrzeba kowadła.", + "187": "Kowadło robi się z żelaza albo kupuje u kupca.", "188": "Pod ziemią znajdziesz kryształowe serca, którymi zwiększasz swoje maksymalne punkty życia. Rozbijesz je za pomocą kilofa.", + "189": "Jeśli zbierzesz 5 spadających gwiazd, możesz je połączyć, tworząc przedmiot zwiększający twoją moc magiczną.", "19": "{PlayerName}, tak? Mam dobre wieści!", + "190": "Gwiazdy spadają w nocy na całym obszarze. Można je wykorzystywać na przeróżne, użyteczne sposoby. Nie przegap żadnej, bo znikają po wschodzie słońca.", "191": "Jest wiele sposobów, żeby przyciągnąć ludzi do twojego miasta. Na pewno będą potrzebować mieszkania.", "192": "Pokój musi mieć drzwi, krzesło, stół i źródło światła, żeby można było go uważać za mieszkanie. Pamiętaj, że dom musi też mieć ściany.", "193": "Dwie osoby nie zamieszkają w tym samym mieszkaniu. A jeśli ich mieszkanie zostanie zniszczone, to poszukają sobie innego.", @@ -197,6 +204,7 @@ "204": "Jeśli połączysz soczewki na demonicznym ołtarzu, może uda ci się przywołać potężnego potwora. Ale lepiej poczekaj, aż się ściemni, zanim tego spróbujesz.", "205": "Przynętę zrobisz ze zgniłych kawałków i plugawego proszku. Musisz znajdować się na obszarze dotkniętym zepsuciem.", "206": "Demoniczne ołtarze znajdziesz zazwyczaj w zepsutych miejscach. Musisz się do nich zbliżyć, żeby tworzyć przedmioty.", + "207": "Używając haka i 3 łańcuchów, wykonasz hak wspinaczkowy. Łańcuchy stworzysz z żelaznych sztabek, a haki znajdziesz przy szkieletach w podziemiach.", "208": "Roztrzaskaj każdy garnek na swojej drodze. Możesz znaleźć przeróżne, użyteczne zapasy.", "209": "Na całym świecie poukrywane są skarby. W podziemiach można znaleźć niesamowite przedmioty!", "21": "Posąg anioła, tak? Przykro mi, ale nie zajmuję się śmieciami.", @@ -402,6 +410,7 @@ "400": "Już żebrzesz?! Nie patrz tak na mnie, nie zmienię zdania w kilka godzin! ", "401": "Roztrzaskaj każdy napotkany szkarłatny ołtarz. Spotka cię za to coś fajnego!", "402": "Szkarłatne ołtarze znajdziesz zazwyczaj w szkarłatnych miejscach. Musisz się do nich zbliżyć, żeby tworzyć przedmioty.", + "403": "Używając kręgów, stworzysz krwawy kręgosłup. Musisz znajdować się na szkarłatnym obszarze.", "41": "Przestań być takim dzieciakiem! Widziałam gorsze przypadki.", "42": "Trzeba będzie założyć kilka szwów!", "43": "Znowu problemy z tymi łobuzami?", @@ -435,6 +444,7 @@ "69": "Wiesz, co proszek oczyszczający robi z kamieniem ebonowym z obszarów dotkniętych zepsuciem?", "7": "Wkrótce zastanie nas noc. Zdecyduj się wreszcie, póki jeszcze możesz.", "70": "{ArmsDealer} mógłby przestać ze mną ciągle flirtować. Nie wie, że mam 500 lat?", + "71": "Czemu {Merchant} ciągle wciska mi posągi aniołów? Każdy wie, że one nic nie robią.", "72": "Widzisz tego starca chodzącego koło lochu? Nie wygląda dobrze...", "73": "Sprzedaję, co chcę! Jak ci się nie podoba, to masz problem.", "74": "Czemu prowokujesz mnie akurat w takiej chwili?", @@ -595,6 +605,7 @@ "213": "Priorytet inteligentnego kursora: Kilof -> topór", "214": "Priorytet inteligentnego kursora: Topór -> kilof", "215": "Inteligentne rozmieszczanie bloków: Do kursora", + "216": "Inteligentne rozmieszczanie bloków: Wypełnianie", "217": "Kolor obramowania", "218": "Kursor", "219": "Sterowanie", @@ -639,7 +650,10 @@ "26": "Łatwy", "27": "Losowo", "28": "Stwórz", + "29": "Postacie na poziomie hardcore giną nieodwracalnie", "2": "Rozłącz się", + "30": "Postacie na średnim poziomie upuszczają przedmioty po śmierci", + "31": "Postacie na łatwym poziomie upuszczają pieniądze po śmierci", "32": "Wybierz poziom", "33": "Koszula", "34": "Podkoszulek", @@ -790,6 +804,7 @@ "17": "{0} dołącza do żółtej drużyny.", "18": "Witaj w", "19": "{0} dołącza.", + "1": "Nieprawidłowe hasło.", "20": "{0} odchodzi.", "21": "/gracze", "22": "{0} dołącza do różowej drużyny.", @@ -888,6 +903,7 @@ "82": "Wróć", "83": "Ulubione", "84": "Nie możesz zmieniać drużyn wewnątrz bloków swojej drużyny!", + "85": "Robak", "86": "Kaczka", "87": "Motyl", "88": "Iluminator", @@ -1035,6 +1051,7 @@ "LegacyChestType": { "0": "Kufer", "10": "Kufer pokryty bluszczem", + "11": "Lodowy kufer", "12": "Kufer z żyjącego drewna", "13": "Niebiański kufer", "14": "Kufer z drewna mroku", @@ -1046,10 +1063,12 @@ "1": "Złoty kufer", "20": "Kufer szkarłatu", "21": "Bajkowy kufer", + "22": "Zamarznięty kufer", "23": "Zamknięty kufer z dżungli", "24": "Zamknięty kufer zepsucia", "25": "Zamknięty, szkarłatny kufer", "26": "Zamknięta, bajkowa skrzynia", + "27": "Zamknięty, zamarznięty kufer", "28": "Kufer dynastii", "29": "Miodowy kufer", "2": "Zamknięty, złoty kufer", @@ -1115,29 +1134,10 @@ "28": "{$ItemName.CrystalDresser}", "29": "{$ItemName.DynastyDresser}", "30": "{$ItemName.FrozenDresser}", - "31": "{$ItemName.LivingWoodDresser}", - "32": "{$ItemName.SpiderDresser}", - "33": "{$ItemName.LesionDresser}", - "34": "{$ItemName.SolarDresser}", - "35": "{$ItemName.VortexDresser}", - "36": "{$ItemName.NebulaDresser}", - "37": "{$ItemName.StardustDresser}", - "38": "{$ItemName.SandstoneDresser}", - "39": "{$ItemName.BambooDresser}" + "31": "{$ItemName.LivingWoodDresser}" }, "LegacyChestType2": { - "1": "{$ItemName.GoldenChest}", - "0": "{$ItemName.CrystalChest}", - "2": "{$ItemName.SpiderChest}", - "3": "{$ItemName.LesionChest}", - "4": "{$ItemName.GoldChest}", - "5": "{$ItemName.SolarChest}", - "6": "{$ItemName.VortexChest}", - "7": "{$ItemName.NebulaChest}", - "8": "{$ItemName.StardustChest}", - "9": "{$ItemName.GolfChest}", - "10": "{$ItemName.DesertChest}", - "11": "{$ItemName.BambooChest}", - "12": "{$ItemName.DungeonDesertChest}" + "0": "Kryształowy kufer", + "1": "Złoty kufer" } } \ No newline at end of file diff --git a/Localization/Content/pl-PL/NPCs.json b/Localization/Content/pl-PL/NPCs.json index cc1b74c..5336b00 100644 --- a/Localization/Content/pl-PL/NPCs.json +++ b/Localization/Content/pl-PL/NPCs.json @@ -68,6 +68,7 @@ "Vampire": "Wampir", "MotherSlime": "Matka szlamów", "Truffle": "Trufla", + "ZombieEskimo": "Eskimoski zombie", "Frankenstein": "Frankenstein", "BlackRecluse": "Czarny pustelnik", "WallCreeper": "Naścienny pełzak", @@ -308,7 +309,9 @@ "SleepingAngler": "Śpiący wędkarz", "Grasshopper": "Konik polny", "ChatteringTeethBomb": "Bombowe, szczękające zęby", + "CultistArcherBlue": "Niebieski łucznik-kultysta", "Demolitionist": "Dewastator", + "CultistArcherWhite": "Biały łucznik-kultysta", "BrainScrambler": "Mąciciel", "RayGunner": "Operator promieni", "MartianOfficer": "Marsjański oficer", @@ -335,6 +338,7 @@ "Hornet": "Szerszeń", "ManEater": "Kanibal", "ArmedZombie": "Zombie", + "ArmedZombieEskimo": "Eskimoski zombie", "ArmedZombiePincussion": "Zombie", "ArmedZombieSlimed": "Zombie", "ArmedZombieSwamp": "Zombie", @@ -424,9 +428,12 @@ "Crawdad": "Rak", "Crawdad2": "Rak", "CreatureFromTheDeep": "Potwór z głębin", + "CrimsonBunny": "Szkarłatny króliczek", + "CrimsonGoldfish": "Szkarłatna złota rybka", "CrimsonPenguin": "Niecny pingwin", "CultistBoss": "Obłąkany kultysta", "CultistBossClone": "Obłąkany kultysta", + "CultistDevote": "Obłąkany zelant", "CultistDragonBody1": "Fantazmatyczny smok", "CultistDragonBody2": "Fantazmatyczny smok", "CultistDragonBody3": "Fantazmatyczny smok", @@ -459,7 +466,7 @@ "DuneSplicerHead": "Penetrator diun", "DuneSplicerTail": "Penetrator diun", "EnchantedNightcrawler": "Zaczarowany, nocny pełzak", - "GiantFlyingAntlion": "Rojnik mrówkolwów", + "FlyingAntlion": "Rojnik mrówkolwów", "Fritz": "Fritz", "GiantShelly": "Wielki Shelly", "GiantShelly2": "Wielki Shelly", @@ -507,6 +514,7 @@ "SandsharkCrimson": "Mięsożerca", "SandsharkHallow": "Kryształowy młocarz", "SandSlime": "Piaskowy szlam", + "ShadowFlameApparition": "Zjawa cienistego płomienia", "SlimeSpiked": "Kolczasty szlam", "Sluggy": "Leniwek", "SolarFlare": "Flara słoneczna", @@ -534,7 +542,7 @@ "VortexLarva": "Kosmiczna larwa", "VortexRifleman": "Sztormowy lotnik", "VortexSoldier": "Wirak", - "GiantWalkingAntlion": "Mrówkolwowy wierzchowiec", + "WalkingAntlion": "Mrówkolwowy wierzchowiec", "DD2GoblinBomberT2": "{$NPCName.DD2GoblinBomberT1}", "DD2WyvernT3": "{$NPCName.DD2WyvernT1}", "DD2WyvernT2": "{$NPCName.DD2WyvernT1}", diff --git a/Localization/Content/pl-PL/Projectiles.json b/Localization/Content/pl-PL/Projectiles.json index 54760e0..962b17f 100644 --- a/Localization/Content/pl-PL/Projectiles.json +++ b/Localization/Content/pl-PL/Projectiles.json @@ -713,10 +713,6 @@ "MonkStaffT3": "Furia niebiańskiego smoka", "MonkStaffT3_Alt": "Furia niebiańskiego smoka", "MonkStaffT3_AltShot": "Furia niebiańskiego smoka", - "DD2JavelinHostileT3": "{$ProjectileName.DD2JavelinHostile}", - "Celeb2Rocket": "{$ProjectileName.Celeb2Weapon}", - "Celeb2RocketExplosive": "{$ProjectileName.Celeb2Weapon}", - "Celeb2RocketLarge": "{$ProjectileName.Celeb2Weapon}", - "Celeb2RocketLargeExplosive": "{$ProjectileName.Celeb2Weapon}" + "DD2JavelinHostileT3": "{$ProjectileName.DD2JavelinHostile}" } } \ No newline at end of file diff --git a/Localization/Content/pl-PL/Town.json b/Localization/Content/pl-PL/Town.json index 52dc818..d626d25 100644 --- a/Localization/Content/pl-PL/Town.json +++ b/Localization/Content/pl-PL/Town.json @@ -49,6 +49,7 @@ "Party": "Myślisz, że komuś będzie przeszkadzać, jak powsadzam do tortu żarówki zamiast świeczek?" }, "BartenderSpecialText": { + "Party": "Yorai, nie mam żadnego tekstu urodzinowego!", "AfterDD2Tier1": "Dobra robota, udało ci się odeprzeć Armię Starszego! Ale pewnie jeszcze tu wrócą, nie postarali się tym razem.", "AfterDD2Tier2": "Armia Starszego jest coraz silniejsza, ale tobie ciągle się udaje ich powstrzymać! Coś mi jednak mówi, że się nie poddadzą.", "AfterDD2Tier3": "Naprawdę udało ci się powstrzymać całą Armię Starszego? Może kiedyś wpadniesz do Ehterii?", @@ -74,9 +75,15 @@ "Party": "Urządzam najlepsze przyjęcia, to jasne jak słońce.", "AfterDD2Tier1": "Wiesz, chyba widziałem już taki portal, ale złoty." }, + "SteampunkerSpecialText": { + "Party": "Wszyscy mówili, że lubią torty kominowe, więc włożyłam do swojego kilka kominów." + }, "CyborgSpecialText": { "Party": "Dokręcimy dziś śrubę!" }, + "SantaClausSpecialText": { + "Party": "Daj spokój, chyba nie myślisz, że bawię się tylko na święta?" + }, "DemolitionistSpecialText": { "Party": "Uważaj dzisiaj. Krasnoludy mają dosyć wybuchowe przyjęcia.", "AfterDD2Start": "Nie rozumiem, czemu po prostu nie wysadzimy tych portali." @@ -109,6 +116,7 @@ "Quest_Catfish": "W sumie to znalazłem fajną rybę! Taką co potrafi świetnie liczyć i sumować. Nie wiem i nie chcę wiedzieć, jak to możliwe. Chcę tylko dostać swoją rybę, biegiem!\n\n(można złapać w Dżungli na Powierzchni)", "Quest_Cloudfish": "Krążą plotki o wyspach unoszących się wysoko na niebie, na których można znaleźć niesamowite skarby! Ale kogo to obchodzi? Znacznie lepsze jest to, że czasami w chmurach tworzą się jeziora, a w nich pływają ryby zrobione z chmur! Muszę takiej spróbować, więc lepiej pędź i ją dla mnie złap!\n\n(można złapać w Gwiezdnych Jeziorach)", "Quest_Cursedfish": "W najgłębszych wodach zepsucia pływa przeklęta ryba! Stworzono ją za pomocą przeklętych płomieni upadłych zmór czających się tam na dnie. Mówią, że nawet woda nie ugasi tego wiecznego ognia. Mam kilka genialnych pomysłów, co zrobić z taką rybę! Przyniesiesz mi ją, czy tchórzysz!?\n\n(można złapać w Zepsuciu)", + "Quest_Dirtfish": "Właśnie wyciągałem dużą sztukę, kiedy ten zabawny, gadający zombie wyskoczył z leśnego jeziora i zaczął bredzić coś o „tych dzikich rybach ulepionych z brudu”! Mówi, że taka ryba da radę udusić 10 takich jak on, albo coś w tym rodzaju... Muszę ją mieć! Już!\n\n(można złapać na Powierzchni, w Podziemiach i Jaskiniach)", "Quest_DynamiteFish": "Dewastator pieklił się, bo zgubił laskę dynamitu w leśnym jeziorze. Ma ich tyle, że co za różnica? Okazało się, że nie do końca zgubił – ten dynamit nagle dostał płetw i odpłynął! Nie wiem, skąd bierze materiały do swoich towarów, ale ten musi być opętany! Złów go dla mnie, zawsze marzyłem o takiej bombowej rybie! Nie pytaj czemu...\n\n(można złapać na Powierzchni)", "Quest_EaterofPlankton": "Na pewno nie masz tyle odwagi, żeby odszukać pożeracza planktonu. Zepsuta ryba stworzona z oderwanej cząstki samego Pożeracza Światów! Przynieś mi ją i pokaż, że się do czegoś nadajesz!\n\n(można złapać w Zepsuciu)", "Quest_FallenStarfish": "Uwielbiam zbierać te jasnożółte gwiazdy spadające z nieba! Jeszcze bardziej uwielbiam, jak spadają komuś na głowę. Ale nie ma nic lepszego niż spadająca gwiazda, która w leśnym jeziorze zmienia się w rybę! To już jest całkowity odjazd, musisz mi taką przynieść!\n\n(można złapać w Gwiezdnych Jeziorach)", @@ -127,7 +135,7 @@ "Quest_GuideVoodooFish": "Te piekielne demony naprawdę lubią lalki voodoo, ale coś mi się wydaje, że jedna z tych lalek została potraktowana zbyt dużą ilością magii! Zamieniła się w rybę i teraz wyczynia cuda. Założę się, że nie dasz rady jej złapać! Uważaj na gorącą lawę, bo spali cię na popiół, a ja nie dostanę mojej rybki!\n\n(można złapać w Jaskiniach)", "Quest_Wyverntail": "Wiem coś, czego ty nie wiesz! Dobra, powiem ci, między gwiazdami lata przerażający stwór! Nie zmyślam! Mówię o wywernie! Już o niej wiesz, tak? Ale nie wiesz, że małe wywerny to kijanki! Więc można powiedzieć, że wywerny to... żaby! Masz dla mnie jedną złapać!\n\n(można złapać w Gwiezdnych Jeziorach)", "Quest_ZombieFish": "Nie uwierzysz! W nocy złapałem w lesie rybę, która już była martwa! A potem próbowała mnie pogryźć! Wyrzuciłem ją i uciekłem! Teraz chcę wsadzić ją komuś do komody i zobaczyć, co się stanie, więc masz ją dla mnie złapać, dobra?\n\n(można złapać na Powierzchni)", - "Quest_AmanitaFungifin": "Odkryłem to niesamowite miejsce pokryte ogromnymi, lśniącymi grzybami! Wszystko było niebieskie! Zbierałem grzyby koło lśniącego, niebieskiego jeziora, kiedy jeden z nich kłapnął na mnie paszczą i odpłynął! Chcę mu odpłacić pięknym za nadobne i go smacznie schrupać! A to znaczy, że musisz mi go przynieść!\n\n(można złapać na Polach Lśniących Grzybów)", + "Quest_AmanitiaFungifin": "Odkryłem to niesamowite miejsce pokryte ogromnymi, lśniącymi grzybami! Wszystko było niebieskie! Zbierałem grzyby koło lśniącego, niebieskiego jeziora, kiedy jeden z nich kłapnął na mnie paszczą i odpłynął! Chcę mu odpłacić pięknym za nadobne i go smacznie schrupać! A to znaczy, że musisz mi go przynieść!\n\n(można złapać na Polach Lśniących Grzybów)", "Quest_Angelfish": "Wiesz, że wysoko na niebie dryfują sobie magiczne wyspy? Pewnie nie! Mówią, że w niebiosach mieszkają anioły, a ja myślę, że te anioły mają płetwy i skrzela, i całkiem nieźle pływają! Musisz jednego dla mnie złapać!\n\n(można złapać w Gwiezdnych Jeziorach)", "Quest_BloodyManowar": "Auć! Nie zbliżaj się! Poparzyła mnie krwawa wojennica! To najpaskudniejsza meduza na całym świecie: {WorldName}! Idź do tego zgniłego szkarłatu i ją złap, jeśli się odważysz! \n\n(można złapać w Szkarłacie)", "Quest_Bonefish": "Zazwyczaj ości dryfujące na wodzie w podziemiach mnie nie obchodzą, ale te ości pływały! Myślisz, że tylko ludzkie szkielety potrafią się ruszać {WorldName}? Zdobądź dla mnie te ości, żebym mógł je wsadzić komuś do łóżka!\n\n(można złapać w Podziemiach i Jaskiniach)", @@ -139,6 +147,7 @@ "Quest_Fishron": "Krąży legenda o potężnym stworzeniu znanym jako rybok! Jest po części świnią, po części smokiem a po części rybą! Ponoć można je spotkać w zamarzniętych, podziemnych jeziorach najmroźniejszych części świata! Ja tam się nie wybieram, lepiej idź ty, złap ryboka i mi go przynieś! Nie mogę się doczekać!\n\n(można złapać w Podziemnej Tundrze)", "Quest_InfectedScabbardfish": "W mętnych wodach zepsucia pływa bardzo długa ryba, która wygląda jak pochwa na miecz! Jest podobna do kamienia ebonowego, nie daj się zwieść! Dokładnie tak. Ty masz ją złapać, nie ja!\n\n(można złapać w Zepsuciu)", "Quest_Mudfish": "Uważaj tylko, jak będziesz brnąć przez wody dżungli! Dlaczego? Nie, nie dlatego, że nie chcę, żeby cię zjadły piranie. Dlatego, że możesz przypadkiem nadepnąć na mój ulubiony rodzaj ryb – błotniaki! Możesz też jednego przynieść do mojej kolekcji!\n\n(można złapać w Dżungli)", + "Quest_Slimefish": "Te leśne szlamy są obrzydliwe. Ryboszlamy są jeszcze gorsze! Nie będę pływać ze szlamami, więc skubnij jedną dla mnie prosto z wody!\n\n(można złapać gdziekolwiek)", "Quest_TropicalBarracuda": "Piranie i rekiny są paskudne! Ogromnie paskudne! Wiesz, że istnieje bardzo ładna ryba, która i tak może odgryźć ci to i owo? Dałbym 2 platynowe monety, żeby to zobaczyć, tak nawiasem mówiąc... Do rzeczy, masz mi taką złapać. Tylko oddaj ją, zanim ci coś odgryzie!\n\n(można złapać w Dżungli na Powierzchni)", "Quest_TundraTrout": "Zastanawiasz się czasami, czemu jeziora na zaśnieżonej powierzchni świata {WorldName} nigdy nie zamarzają? Bo ja nie. Ale ryby już zamarzają! Wspaniały i potężny {Angler} bardzo się ucieszy z lodowej ryby! Pędź, moje pacholę, i przynieś mi tego pstrąga z tundry!\n\n(można złapać w Tundrze na Powierzchni)" }, diff --git a/Localization/Content/pt-BR.json b/Localization/Content/pt-BR.json index 97367c1..d363645 100644 --- a/Localization/Content/pt-BR.json +++ b/Localization/Content/pt-BR.json @@ -46,6 +46,7 @@ "48": "Terraria 2: Bugalu Elétrico", "49": "Terraria: Experimente também o Minecraft!", "5": "Terraria: A Estória de um Coelhinho", + "50": "Terraria: Experimente também o Edge of Space!", "51": "Terraria: Eu só quero saber onde fica o ouro!", "52": "Terraria: Agora com mais patos!", "53": "Terraria: 9 + 1 = 11", @@ -231,6 +232,7 @@ "TIMBER_Name": "Madeiraaaa!!", "TIN_FOIL_HATTER_Description": "Derrote uma invasão de Marte, quando os seres do outro mundo vierem para derreter seu cérebro e para colocar sondas em lugares desconfortáveis.", "TIN_FOIL_HATTER_Name": "Chapéu de Alumínio", + "TOPPED_OFF_Description": "Obtenha o máximo de vida e de mana sem usar acessórios ou bônus.", "TOPPED_OFF_Name": "No Topo", "TROUT_MONKEY_Description": "Complete sua 25a missão para o pescador.", "TROUT_MONKEY_Name": "Macaquinho Treinado", @@ -244,6 +246,7 @@ "WHERES_MY_HONEY_Name": "Onde Está o Meu Mel?", "WINTERHEARTED_Description": "Derrote a Rainha do Gelo, bruxa das noites mais frias.", "WINTERHEARTED_Name": "Coração Invernal", + "WORM_FODDER_Description": "Derrote o Devorador de Mundos, um verme enorme, que vive na corrupção.", "WORM_FODDER_Name": "Munição para Vermes", "YOU_AND_WHAT_ARMY_Description": "Assuma o comando de nove lacaios ao mesmo tempo.", "YOU_AND_WHAT_ARMY_Name": "Você e que Exército?", @@ -330,6 +333,7 @@ "Server": "Servidor do Terraria {0}", "ServerMessage": " {0}", "ServerStarted": "Servidor inicializado.", + "SetInitialMaxPlayers": "Limite de Jogadores (pressione enter para 8): ", "SetInitialPort": "Porta do servidor (pressione enter para 7777): ", "SetMOTD_Command": "motd", "SetMOTD_Description": "Mude a mensagem do dia (MOTD).", @@ -370,6 +374,7 @@ }, "Error": { "BadHeaderBufferOverflow": "Erro na cabeçalho causou sobrecarga no buffer de leitura.", + "CaptureError": "Ocorreu um erro durante a gravação da captura. Tentando outra vez...", "DataSentAfterConnectionLost": "Tentou enviar dados a um cliente depois da conexão ser interrompida", "Error": "Erro", "ExceptionNormal": " Exceção normal: {0}", @@ -428,9 +433,7 @@ "YellowWires": "Fios Amarelos", "BirthdayParty_1": "Parece que {0} está dando uma festa", "BirthdayParty_2": "Parece que {0} e {1} estão dando uma festa", - "BirthdayParty_3": "Parece que {0}, {1}, e {2} estão dando uma festa", - "RespawnInPrefix": "", - "RespawnInSuffix": "{0}" + "BirthdayParty_3": "Parece que {0}, {1}, e {2} estão dando uma festa" }, "GameUI": { "ActuationDeviceOff": "Dispositivo atuador desligado", @@ -447,6 +450,7 @@ "CompassCenter": "Centro", "CompassEast": "{0}' a Leste", "CompassWest": "{0}' Oeste", + "CraftingWindow": "Criando janela", "Depth": "{0}'", "DepthLevel": "Nível", "Disabled": "Desativado", @@ -490,11 +494,12 @@ "PartlyCloudy": "Parcialmente Nublado", "PlayerDistance": "({0} pés)", "PrecentFishingPower": "{0}% de poder de pescaria", + "QuickStackToNearby": "Pilha rápida para baús próximos", "Rain": "Chuva", "RulerOff": "Régua Desligada", "RulerOn": "Régua Ligada", "SettingsMenu": "Menu de Configurações", - "OpenFileFolder": "{$LegacyInterface.110}", + "SortInventory": "Organizar Inventário", "Speed": "{0} mph", "StormEffects": "Efeitos da Tempestade: {0}", "ThirdQuarter": "Quarto Minguante", @@ -579,8 +584,8 @@ "MoveToCloud": "Mover para a nuvem", "New": "Novo", "Normal": "Normal", - "LightMode_White": "{$LegacyMenu.56}", - "LightMode_Color": "{$LegacyMenu.55}", + "NormalDescription": "(A Experiência Padrão do Terraria)", + "NormalDescriptionFlavor": "Sua Jornada Começou...", "Play": "Jogar", "RestoreButton": "Restaurar", "Save": "Salvar", @@ -603,10 +608,7 @@ "SeedCopied": "Seed Copiada", "ZoomIn": "{$LegacyMenu.168}", "ZoomOut": "{$LegacyMenu.169}", - "Ellipsis": "...", - "LightMode_Retro": "{$LegacyMenu.57}", - "LightMode_Trippy": "{$LegacyMenu.58}", - "PlayerEmptyName": "{$Net.EmptyName}" + "Ellipsis": "..." }, "DeathSource": { "NPC": "{0} por {1}.", @@ -628,6 +630,7 @@ "Lava_3": "{0} tentou nadar na lava.", "Lava_4": "{0} gosta de brincar com magma.", "Petrified_1": "Despedaçaram {0}.", + "Petrified_2": "Não vai dar para reconstruir {0}.", "Petrified_3": "Alguém precisa varrer {0}.", "Petrified_4": "{0} acabou de virar um monte de pó.", "Poisoned": "{0} não conseguiu encontrar o antídoto.", @@ -690,8 +693,5 @@ "Chinese": "简体中文 (Chinês Simplificado)", "Portuguese": "Português brasileiro", "Polish": "Polski (Polonês)" - }, - "RandomWorldName_Composition": { - "6": "{Adjective} {Location}" } } \ No newline at end of file diff --git a/Localization/Content/pt-BR/Game.json b/Localization/Content/pt-BR/Game.json index 5629816..b2d7613 100644 --- a/Localization/Content/pt-BR/Game.json +++ b/Localization/Content/pt-BR/Game.json @@ -15,6 +15,9 @@ "AdamantiteCaster": "19% de redução no consumo de mana", "AdamantiteMelee": "18% de aumento na velocidade do ataque físico e do movimento", "AdamantiteRanged": "25% de chance de não consumir munição", + "HallowCaster": "20% de redução no consumo de mana", + "HallowMelee": "19% de aumento na velocidade do ataque físico e do movimento", + "HallowRanged": "25% de chance de não consumir munição", "ShadowScale": "15% de aumento na velocidade dos movimentos", "Wood": "1 de defesa", "Crimson": "Regeneração de vida muito maior", @@ -25,6 +28,7 @@ "Titanium": "Fique imune depois de atacar um inimigo", "Chlorophyte": "Invoca um poderoso cristal de folha para atirar em inimigos próximos", "Wizard": "10% de aumento na chance de acerto crítico mágico", + "Turtle": "Os atacantes também sofrem dano total", "Meteor": "Arma espacial custa 0 de mana", "SpectreHealing": "Os danos por magia causados aos inimigos curam o jogador com menos vida", "Shroomite": "Ficar parado deixa você em modo sorrateiro,\naumentando o alcance de seus ataques e reduzindo a chance dos inimigos usarem você como alvo", @@ -36,8 +40,13 @@ "BeetleDefense": "Os besouros protegem você contra danos", "BeetleDamage": "Os besouros aumentam os seus danos por ataque físico e a sua velocidade", "Bee": "Aumenta os danos causados por lacaios em 10%", + "Bone": "20% de chance de não consumir munição", "Spider": "Aumenta os danos causados por lacaios em 12%", + "Ninja": "33% de chance de não consumir itens arremessados", + "Fossil": "50% de chance de não consumir itens arremessados", + "Solar": "Escudos solares são gerados com o tempo, protegendo você,\nconsuma o escudo para correr, causando danos a inimigos", "Vortex": "Toque duplo {0} para o modo sorrateiro,\naumentando o alcance de seus ataques e reduzindo a chance dos inimigos usarem você como alvo, mas desacelerando seus movimentos", + "Nebula": "Ferir inimigos poderá fazer surgir reforços,\nescolha reforços para receber bônus cumulativos", "Stardust": "Toque duplo {0} para direcionar um guardião até um dado local", "Forbidden": "Toque duplo {0} para chamar uma tempestade antiga até o local do cursor", "Jungle": "16% de redução no consumo de mana", @@ -88,7 +97,7 @@ "Builder": "Maior velocidade e alcance no posicionamento", "BunnyMount": "Você está com desejo por cenouras", "Burning": "Perde uma vida e tem os movimentos desacelerados", - "DesertMinecartRight": "{$BuffDescription.MinecartRight}", + "Calm": "Redução na agressão dos inimigos", "Campfire": "Regeneração de vida levemente maior", "ChaosState": "Usar o Cajado da discórdia vai consumir sua vida", "Chilled": "A velocidade de seus movimentos foi reduzida", @@ -116,7 +125,7 @@ "FairyGreen": "Uma fada vai seguir você", "FairyRed": "Uma fada vai seguir você", "Featherfall": "Pressione PARA CIMA ou PARA BAIXO para controlar a velocidade da descida", - "DesertMinecartLeft": "{$BuffDescription.MinecartLeft}", + "Fishing": "Aumento no nível de pescaria", "Flipper": "Mova-se normalmente embaixo d'água", "Frostburn": "Ou está bem quente ou bem frio. De qualquer maneira, machuca MUITO", "Frozen": "Você não pode mover-se!", @@ -178,7 +187,7 @@ "PetDD2Gato": "Um gato de hélices está seguindo você", "PetDD2Ghost": "Uma velinha está seguindo você", "PetLizard": "Sossegado como uma lagartixa", - "FishMinecartRight": "{$BuffDescription.MinecartRight}", + "PetParrot": "Louro quer bolacha", "PetSapling": "Uma plantinha está seguindo você", "PetSpider": "Uma aranha está seguindo você", "PetTurtle": "Feliz hora da tartaruga!", @@ -250,7 +259,7 @@ "WeaponImbuePoison": "Ataques físicos envenenam seus inimigos", "WeaponImbueVenom": "Ataques físicos aplicam peçonha em seus alvos", "Webbed": "Você está preso", - "FishMinecartLeft": "{$BuffDescription.MinecartLeft}", + "WellFed": "Pequenas melhorias em todas as estatísticas", "Werewolf": "As habilidades físicas são melhoradas", "Wet": "Você está vazando água", "WindPushed": "O vento move-se ao seu redor!", @@ -258,45 +267,7 @@ "WitheredArmor": "Sua armadura caiu!", "WitheredWeapon": "Seus ataques estão mais fracos!", "Wrath": "10% de aumento nos danos", - "ZephyrFish": "Ele gosta de nadar ao seu redor", - "BeeMinecartRight": "{$BuffDescription.MinecartRight}", - "BeeMinecartLeft": "{$BuffDescription.MinecartLeft}", - "LadybugMinecartRight": "{$BuffDescription.MinecartRight}", - "LadybugMinecartLeft": "{$BuffDescription.MinecartLeft}", - "PigronMinecartRight": "{$BuffDescription.MinecartRight}", - "PigronMinecartLeft": "{$BuffDescription.MinecartLeft}", - "SunflowerMinecartRight": "{$BuffDescription.MinecartRight}", - "SunflowerMinecartLeft": "{$BuffDescription.MinecartLeft}", - "HellMinecartRight": "{$BuffDescription.MinecartRight}", - "HellMinecartLeft": "{$BuffDescription.MinecartLeft}", - "ShroomMinecartRight": "{$BuffDescription.MinecartRight}", - "ShroomMinecartLeft": "{$BuffDescription.MinecartLeft}", - "AmethystMinecartRight": "{$BuffDescription.MinecartRight}", - "AmethystMinecartLeft": "{$BuffDescription.MinecartLeft}", - "TopazMinecartRight": "{$BuffDescription.MinecartRight}", - "TopazMinecartLeft": "{$BuffDescription.MinecartLeft}", - "SapphireMinecartRight": "{$BuffDescription.MinecartRight}", - "SapphireMinecartLeft": "{$BuffDescription.MinecartLeft}", - "EmeraldMinecartRight": "{$BuffDescription.MinecartRight}", - "EmeraldMinecartLeft": "{$BuffDescription.MinecartLeft}", - "RubyMinecartRight": "{$BuffDescription.MinecartRight}", - "RubyMinecartLeft": "{$BuffDescription.MinecartLeft}", - "DiamondMinecartRight": "{$BuffDescription.MinecartRight}", - "DiamondMinecartLeft": "{$BuffDescription.MinecartLeft}", - "AmberMinecartRight": "{$BuffDescription.MinecartRight}", - "AmberMinecartLeft": "{$BuffDescription.MinecartLeft}", - "BeetleMinecartRight": "{$BuffDescription.MinecartRight}", - "BeetleMinecartLeft": "{$BuffDescription.MinecartLeft}", - "MeowmereMinecartRight": "{$BuffDescription.MinecartRight}", - "MeowmereMinecartLeft": "{$BuffDescription.MinecartLeft}", - "PartyMinecartRight": "{$BuffDescription.MinecartRight}", - "PartyMinecartLeft": "{$BuffDescription.MinecartLeft}", - "PirateMinecartRight": "{$BuffDescription.MinecartRight}", - "PirateMinecartLeft": "{$BuffDescription.MinecartLeft}", - "SteampunkMinecartRight": "{$BuffDescription.MinecartRight}", - "SteampunkMinecartLeft": "{$BuffDescription.MinecartLeft}", - "CoffinMinecartRight": "{$BuffDescription.MinecartRight}", - "CoffinMinecartLeft": "{$BuffDescription.MinecartLeft}" + "ZephyrFish": "Ele gosta de nadar ao seu redor" }, "BuffName": { "AmmoBox": "Caixa de Munição", @@ -439,7 +410,7 @@ "Regeneration": "Regeneração", "Rudolph": "Rodolfo", "ScutlixMount": "Montaria do Scutlix", - "DesertMinecartRight": "{$BuffName.MinecartRight}", + "ShadowDodge": "Desvio da sombra", "ShadowFlame": "Chamas das Sombras", "ShadowOrb": "Esfera das Sombras", "SharknadoMinion": "Tornado de Tubarões", @@ -502,48 +473,7 @@ "WitheredArmor": "Armadura Ressecada", "WitheredWeapon": "Arma Ressecada", "Wrath": "Ira", - "ZephyrFish": "Peixe do Zéfiro", - "DesertMinecartLeft": "{$BuffName.MinecartLeft}", - "FishMinecartRight": "{$BuffName.MinecartRight}", - "FishMinecartLeft": "{$BuffName.MinecartLeft}", - "BeeMinecartRight": "{$BuffName.MinecartRight}", - "BeeMinecartLeft": "{$BuffName.MinecartLeft}", - "LadybugMinecartRight": "{$BuffName.MinecartRight}", - "LadybugMinecartLeft": "{$BuffName.MinecartLeft}", - "PigronMinecartRight": "{$BuffName.MinecartRight}", - "PigronMinecartLeft": "{$BuffName.MinecartLeft}", - "SunflowerMinecartRight": "{$BuffName.MinecartRight}", - "SunflowerMinecartLeft": "{$BuffName.MinecartLeft}", - "HellMinecartRight": "{$BuffName.MinecartRight}", - "HellMinecartLeft": "{$BuffName.MinecartLeft}", - "ShroomMinecartRight": "{$BuffName.MinecartRight}", - "ShroomMinecartLeft": "{$BuffName.MinecartLeft}", - "AmethystMinecartRight": "{$BuffName.MinecartRight}", - "AmethystMinecartLeft": "{$BuffName.MinecartLeft}", - "TopazMinecartRight": "{$BuffName.MinecartRight}", - "TopazMinecartLeft": "{$BuffName.MinecartLeft}", - "SapphireMinecartRight": "{$BuffName.MinecartRight}", - "SapphireMinecartLeft": "{$BuffName.MinecartLeft}", - "EmeraldMinecartRight": "{$BuffName.MinecartRight}", - "EmeraldMinecartLeft": "{$BuffName.MinecartLeft}", - "RubyMinecartRight": "{$BuffName.MinecartRight}", - "RubyMinecartLeft": "{$BuffName.MinecartLeft}", - "DiamondMinecartRight": "{$BuffName.MinecartRight}", - "DiamondMinecartLeft": "{$BuffName.MinecartLeft}", - "AmberMinecartRight": "{$BuffName.MinecartRight}", - "AmberMinecartLeft": "{$BuffName.MinecartLeft}", - "BeetleMinecartRight": "{$BuffName.MinecartRight}", - "BeetleMinecartLeft": "{$BuffName.MinecartLeft}", - "MeowmereMinecartRight": "{$BuffName.MinecartRight}", - "MeowmereMinecartLeft": "{$BuffName.MinecartLeft}", - "PartyMinecartRight": "{$BuffName.MinecartRight}", - "PartyMinecartLeft": "{$BuffName.MinecartLeft}", - "PirateMinecartRight": "{$BuffName.MinecartRight}", - "PirateMinecartLeft": "{$BuffName.MinecartLeft}", - "SteampunkMinecartRight": "{$BuffName.MinecartRight}", - "SteampunkMinecartLeft": "{$BuffName.MinecartLeft}", - "CoffinMinecartRight": "{$BuffName.MinecartRight}", - "CoffinMinecartLeft": "{$BuffName.MinecartLeft}" + "ZephyrFish": "Peixe do Zéfiro" }, "MapObject": { "Adamantite": "Adamantina", @@ -615,166 +545,5 @@ "Roll": "{$LegacyMultiplayer.8}", "Party": "/g", "Emote": "/eu" - }, - "Bestiary_ItemDropConditions": { - "NotExpert": "", - "NotMasterMode": "", - "LegacyHack_IsBossAndNotExpert": "", - "IsCrimsonAndNotExpert": "", - "IsCorruptionAndNotExpert": "", - "NotFromStatue": "" - }, - "Bestiary_FlavorText": { - "npc_JungleSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_YellowSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_RedSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_PurpleSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_BlackSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_GreenSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_BlueSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_DemonEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_Zombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_Skeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_AngryBones": "{$CommonBestiaryFlavor.AngryBones}", - "npc_Hornet": "{$CommonBestiaryFlavor.Hornet}", - "npc_Hellbat": "{$CommonBestiaryFlavor.LavaBat}", - "npc_BlueJellyfish": "{$CommonBestiaryFlavor.Jellyfish}", - "npc_PinkJellyfish": "{$CommonBestiaryFlavor.Jellyfish}", - "npc_Mummy": "{$CommonBestiaryFlavor.Mummy}", - "npc_DarkMummy": "{$CommonBestiaryFlavor.Mummy}", - "npc_LightMummy": "{$CommonBestiaryFlavor.Mummy}", - "npc_Mimic": "{$CommonBestiaryFlavor.Mimic}", - "npc_GreenJellyfish": "{$CommonBestiaryFlavor.Jellyfish}", - "npc_BaldZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_WanderingEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_Penguin": "{$CommonBestiaryFlavor.Penguin}", - "npc_PenguinBlack": "{$CommonBestiaryFlavor.Penguin}", - "npc_Lavabat": "{$CommonBestiaryFlavor.LavaBat}", - "npc_PigronCorruption": "{$CommonBestiaryFlavor.Pigron}", - "npc_PigronHallow": "{$CommonBestiaryFlavor.Pigron}", - "npc_PigronCrimson": "{$CommonBestiaryFlavor.Pigron}", - "npc_PincushionZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_SwampZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_TwiggyZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_CataractEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_SleepyEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_DialatedEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_GreenEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_PurpleEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_FemaleZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_HeadacheSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_MisassembledSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_PantlessSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_HornetFatty": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetHoney": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetLeafy": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetSpikey": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetStingy": "{$CommonBestiaryFlavor.Hornet}", - "npc_ZombieMushroom": "{$CommonBestiaryFlavor.MushroomZombie}", - "npc_ZombieMushroomHat": "{$CommonBestiaryFlavor.MushroomZombie}", - "npc_FungiBulb": "{$CommonBestiaryFlavor.FungiBulb}", - "npc_GiantFungiBulb": "{$CommonBestiaryFlavor.FungiBulb}", - "npc_RustyArmoredBonesAxe": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_RustyArmoredBonesFlail": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_RustyArmoredBonesSword": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_RustyArmoredBonesSwordNoArmor": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_BlueArmoredBones": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_BlueArmoredBonesMace": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_BlueArmoredBonesNoPants": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_BlueArmoredBonesSword": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_HellArmoredBones": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_HellArmoredBonesSpikeShield": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_HellArmoredBonesMace": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_HellArmoredBonesSword": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_RaggedCaster": "{$CommonBestiaryFlavor.RaggedCaster}", - "npc_RaggedCasterOpenCoat": "{$CommonBestiaryFlavor.RaggedCaster}", - "npc_Necromancer": "{$CommonBestiaryFlavor.Necromancer}", - "npc_NecromancerArmored": "{$CommonBestiaryFlavor.Necromancer}", - "npc_DiabolistRed": "{$CommonBestiaryFlavor.Diabolist}", - "npc_DiabolistWhite": "{$CommonBestiaryFlavor.Diabolist}", - "npc_AngryBonesBig": "{$CommonBestiaryFlavor.AngryBones}", - "npc_AngryBonesBigMuscle": "{$CommonBestiaryFlavor.AngryBones}", - "npc_AngryBonesBigHelmet": "{$CommonBestiaryFlavor.AngryBones}", - "npc_Scarecrow1": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow2": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow3": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow4": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow5": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow6": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow7": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow8": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow9": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow10": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_DemonEyeOwl": "{$CommonBestiaryFlavor.CostumeDemonEye}", - "npc_DemonEyeSpaceship": "{$CommonBestiaryFlavor.CostumeDemonEye}", - "npc_ZombieDoctor": "{$CommonBestiaryFlavor.CostumeZombie}", - "npc_ZombieSuperman": "{$CommonBestiaryFlavor.CostumeZombie}", - "npc_ZombiePixie": "{$CommonBestiaryFlavor.CostumeZombie}", - "npc_SkeletonTopHat": "{$CommonBestiaryFlavor.CostumeSkeleton}", - "npc_SkeletonAstonaut": "{$CommonBestiaryFlavor.CostumeSkeleton}", - "npc_SkeletonAlien": "{$CommonBestiaryFlavor.CostumeSkeleton}", - "npc_ZombieXmas": "{$CommonBestiaryFlavor.ZombieXmas}", - "npc_ZombieSweater": "{$CommonBestiaryFlavor.ZombieXmas}", - "npc_SlimeRibbonWhite": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_SlimeRibbonYellow": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_SlimeRibbonGreen": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_SlimeRibbonRed": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_ZombieElf": "{$CommonBestiaryFlavor.ZombieElf}", - "npc_ZombieElfBeard": "{$CommonBestiaryFlavor.ZombieElf}", - "npc_ZombieElfGirl": "{$CommonBestiaryFlavor.ZombieElf}", - "npc_ArmedZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombiePincushion": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombieSwamp": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombieTwiggy": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombieCenx": "{$CommonBestiaryFlavor.Zombie}", - "npc_GoldBird": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldBunny": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldButterfly": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldFrog": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldGrasshopper": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldMouse": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldWorm": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_BoneThrowingSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_BoneThrowingSkeleton2": "{$CommonBestiaryFlavor.Skeleton}", - "npc_BoneThrowingSkeleton3": "{$CommonBestiaryFlavor.Skeleton}", - "npc_BoneThrowingSkeleton4": "{$CommonBestiaryFlavor.Skeleton}", - "npc_GiantWalkingAntlion": "{$CommonBestiaryFlavor.AntlionCharger}", - "npc_GiantFlyingAntlion": "{$CommonBestiaryFlavor.AntlionSwarmer}", - "npc_DesertLamiaLight": "{$CommonBestiaryFlavor.Lamia}", - "npc_DesertLamiaDark": "{$CommonBestiaryFlavor.Lamia}", - "npc_SquirrelGold": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_SandShark": "{$CommonBestiaryFlavor.Sandshark}", - "npc_SandsharkCorrupt": "{$CommonBestiaryFlavor.Sandshark}", - "npc_SandsharkCrimson": "{$CommonBestiaryFlavor.Sandshark}", - "npc_SandsharkHallow": "{$CommonBestiaryFlavor.Sandshark}", - "npc_WalkingAntlion": "{$CommonBestiaryFlavor.AntlionCharger}", - "npc_FlyingAntlion": "{$CommonBestiaryFlavor.AntlionSwarmer}", - "npc_GoldGoldfish": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldGoldfishWalker": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_BlackDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_BlueDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_GreenDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_OrangeDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_RedDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_YellowDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_GoldDragonfly": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldLadyBug": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldWaterStrider": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldSeahorse": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_IceMimic": "{$CommonBestiaryFlavor.Mimic}", - "npc_GemSquirrelAmethyst": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelTopaz": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelSapphire": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelEmerald": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelRuby": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelDiamond": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelAmber": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemBunnyAmethyst": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyTopaz": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnySapphire": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyEmerald": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyRuby": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyDiamond": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyAmber": "{$CommonBestiaryFlavor.GemBunny}" } } \ No newline at end of file diff --git a/Localization/Content/pt-BR/Items.json b/Localization/Content/pt-BR/Items.json index 508c8db..a57190f 100644 --- a/Localization/Content/pt-BR/Items.json +++ b/Localization/Content/pt-BR/Items.json @@ -232,6 +232,7 @@ "RedHusk": "Casca Vermelha", "CyanHusk": "Casca Ciano", "VioletHusk": "Casca Violeta", + "PurpleMucos": "Muco Roxo", "BlackInk": "Tinta Preta", "FlowerofFire": "Flor de Fogo", "DyeVat": "Máquina de Tinturas", @@ -538,6 +539,7 @@ "CarriageLantern": "Lanterna Pendurada", "AlchemyLantern": "Lanterna de Alquimia", "DiablostLamp": "Lâmpada do Satanista", + "OilRagSconse": "Lanterna de Óleo", "BlueDungeonChair": "Cadeira de Calabouço Azul", "BlueDungeonTable": "Mesa de Calabouço Azul", "BlueDungeonWorkBench": "Bancada de Trabalho de Calabouço Azul", @@ -690,6 +692,7 @@ "NecroGreaves": "Grevas Necrosadas", "CrimsonChest": "Baú de Carmim", "HallowedChest": "Baú Consagrado", + "FrozenChest": "Baú Congelado", "JungleKey": "Chave da Selva", "CorruptionKey": "Chave Corrompida", "CrimsonKey": "Chave de Carmim", @@ -760,6 +763,7 @@ "TitanstoneBlockWall": "Parede de Blocos de Rocha Titã", "MagicCuffs": "Algemas Mágicas", "MusicBoxSnow": "Caixinha de Música (Neve)", + "MusicBoxSpace": "Caixinha de Música (Espaço)", "MusicBoxCrimson": "Caixinha de Música (Carmim)", "MusicBoxBoss4": "Caixinha de Música (Chefe 4)", "SilverWatch": "Relógio de Prata", @@ -768,6 +772,7 @@ "MusicBoxRain": "Caixinha de Música (Chuva)", "MusicBoxIce": "Caixinha de Música (Gelo)", "MusicBoxDesert": "Caixinha de Música (Deserto)", + "MusicBoxOcean": "Caixinha de Música (Oceano)", "MusicBoxDungeon": "Caixinha de Música (Calabouço)", "MusicBoxPlantera": "Caixinha de Música (Plantera)", "MusicBoxBoss5": "Caixinha de Música (Chefe 5)", @@ -810,6 +815,7 @@ "DerplingBanner": "Bandeira do Derpling", "EaterofSoulsBanner": "Bandeira do Devorador de Almas", "EnchantedSwordBanner": "Bandeira da Espada Encantada", + "ZombieEskimoBanner": "Bandeira do Esquimó Zumbi", "FaceMonsterBanner": "Bandeira do Monstro da Face", "FloatyGrossBanner": "Bandeira do Nojento Flutuante", "FlyingFishBanner": "Bandeira do Peixe Voador", @@ -1003,6 +1009,7 @@ "SpookyDoor": "Porta Assustadora", "SpookyTable": "Mesa Assustadora", "SpookyWorkBench": "Bancada de Trabalho Assustadora", + "SpookyPlatform": "Plataforma Assustadora", "ReaperHood": "Capuz do Ceifador", "Diamond": "Diamante", "ReaperRobe": "Roupão do Ceifador", @@ -1558,7 +1565,7 @@ "GuideVoodooFish": "Peixe de Vodu Guia", "Wyverntail": "Cauda de Serpe", "ZombieFish": "Peixe Zumbi", - "AmanitaFungifin": "Peixe-fungo Amanita", + "AmanitiaFungifin": "Peixe-fungo Amanita", "Angelfish": "Peixe-anjo", "BloodyManowar": "Caravela Sangrenta", "Bonefish": "Peixe-osso", @@ -1637,7 +1644,7 @@ "SwiftnessPotion": "Poção de Velocidade", "BlueArmoredBonesBanner": "Bandeira dos Ossos com Armadura Azul", "BlueCultistArcherBanner": "Bandeira do Arqueiro Cultista Azul", - "ManaCloakStar": "", + "BlueCultistCasterBanner": "Bandeira do Feiticeiro Cultista Azul", "BlueCultistFighterBanner": "Bandeira do Guerreiro Cultista Azul", "BoneLeeBanner": "Ossos de Bone Lee", "ClingerBanner": "Bandeira do Agarrador", @@ -2203,6 +2210,7 @@ "TacticalShotgun": "Espingarda Tática", "RottenChunk": "Pedaço Podre", "IvyChest": "Baú de Hera", + "IceChest": "Baú de Gelo", "Marrow": "Abóbora", "UnholyTrident": "Tridente Profano", "FrostHelmet": "Elmo Congelado", @@ -2338,6 +2346,9 @@ "TheUndertaker": "O Coveiro", "TheMeatball": "A Almôndega", "TheRottedFork": "O Garfo Podre", + "EskimoHood": "Capuz Esquimó", + "EskimoCoat": "Capa Esquimó", + "EskimoPants": "Calça Esquimó", "LivingWoodChair": "Cadeira de Madeira Viva", "CactusChair": "Cadeira de Cactos", "BoneChair": "Cadeira de Osso", @@ -2527,7 +2538,10 @@ "ShoeSpikes": "Espetos para Sapatos", "TigerClimbingGear": "Equipamento de Escalada de Tigre", "Tabi": "Tabi", + "PinkEskimoHood": "Capuz de Esquimó Cor-de-rosa", + "PinkEskimoCoat": "Capa de Esquimó Cor-de-rosa", "Minishark": "Mini-tubarão", + "PinkEskimoPants": "Calça de Esquimó Cor-de-rosa", "PinkThread": "Fio Cor-de-rosa", "ManaRegenerationBand": "Pulseira de Regeneração de Mana", "SandstorminaBalloon": "Tempestade de Areia no Balão", @@ -2602,6 +2616,7 @@ "AncientBattleArmorPants": "Botas Proibidas", "AncientBattleArmorShirt": "Roupão Proibido", "AncientCloth": "Tecido Antigo", + "AncientCultistTrophy": "Troféu Antigo do Cultista", "AncientHorn": "Chifre Antigo", "AnglerTackleBag": "Bolsa do Pescador", "AngryBonesBanner": "Bandeira dos Ossos Furiosos", @@ -2697,6 +2712,7 @@ "BorealWoodTable": "Mesa de Madeira Boreal", "BorealWoodWall": "Parede de Madeira Boreal", "BorealWoodWorkBench": "Bancada de Trabalho de Madeira Boreal", + "BossMaskCultist": "Máscara Cultista Antiga", "BossMaskMoonlord": "Máscara do Senhor da Lua", "BottomlessBucket": "Balde Sem Fundo com Água", "BouncyBomb": "Bomba Saltitante", @@ -2820,6 +2836,7 @@ "DestroyerBossBag": "Bolsa do Tesouro", "DestroyerMask": "Máscara do Destruidor", "Detonator": "Detonador", + "DevDye": "Sangue de Skiphs", "DiamondGemsparkWall": "Parede de Pedras de Diamante Brilhantes", "DiamondGemsparkWallOff": "Parede de Pedras de Diamante Brilhantes Offline", "DjinnLamp": "Lâmpada do Espírito do Deserto", @@ -2883,12 +2900,14 @@ "Fake_DynastyChest": "Preso Baú da Dinastia", "Fake_EbonwoodChest": "Preso Baú de Madeira de Ébano", "Fake_FleshChest": "Preso Baú de Carne", + "Fake_FrozenChest": "Preso Baú Congelado", "Fake_GlassChest": "Preso Baú de Vidro", "Fake_GoldChest": "Preso Baú de Ouro", "Fake_GraniteChest": "Preso Baú de Granito", "Fake_GreenDungeonChest": "Preso Baú de Calabouço Verde", "Fake_HallowedChest": "Preso Baú Consagrado", "Fake_HoneyChest": "Preso Baú de Mel", + "Fake_IceChest": "Preso Baú de Gelo", "Fake_IvyChest": "Preso Baú de Hera", "Fake_JungleChest": "Preso Baú da Selva", "Fake_LihzahrdChest": "Preso Baú Lagharto", @@ -3558,6 +3577,7 @@ "SailfishBoots": "Botas de Barbatanas", "SalamanderBanner": "Bandeira da Salamandra", "SandElementalBanner": "Bandeira do Elemental de Areia", + "SandFallBlock": "Cascata de Areia", "SandFallWall": "Parede de Cascata de Areia", "SandsharkBanner": "Bandeira do Tubarão de Areia", "SandsharkCorruptBanner": "Bandeira do Mordedor de Ossos", @@ -3621,6 +3641,10 @@ "SkeletronBossBag": "Bolsa do Tesouro", "SkeletronPrimeBossBag": "Bolsa do Tesouro", "SkeletronPrimeMask": "Máscara do Esqueletron Alfa", + "SkiphsHelm": "Máscara de Skiphs", + "SkiphsPants": "Traseiro de Urso de Skiphs", + "SkiphsShirt": "Pele de Skiphs", + "SkiphsWings": "Patas de Skiphs", "SkyBlueString": "Cordão Azul Celeste", "SkyFracture": "Fratura do Céu", "SkywareBathtub": "Banheira Celeste", @@ -3662,6 +3686,7 @@ "SmokeBlock": "Bloco de Fumaça", "SnailStatue": "Estátua de Lesma", "SnowCloudBlock": "Nuvem de Neve", + "SnowFallBlock": "Nevada", "SnowFallWall": "Parede de Nevada", "SolarCoriteBanner": "Bandeira de Corite", "SolarCrawltipedeBanner": "Bandeira da Centopeia-Lacraia", @@ -3806,6 +3831,7 @@ "TwilightHairDye": "Tintura dos Cabelos do Crepúsculo", "TwinMask": "Máscara dos Gêmeos", "TwinsBossBag": "Bolsa do Tesouro", + "UltraBrightCampfire": "Fogueira Ultra Brilhante", "UndeadVikingStatue": "Estátua Viking Zumbi", "UnicornStatue": "Estátua de Unicórnio", "UnicornWispDye": "Tintura de Luz Fantasma do Unicórnio", @@ -3954,6 +3980,7 @@ "DungeonClockPink": "Relógio de Calabouço Cor-de-rosa", "DynastyDresser": "Cômoda da Dinastia", "DynastyPiano": "Piano da Dinastia", + "DynastyPlatform": "Plataforma da Dinastia", "DynastySofa": "Sofá da Dinastia", "Fake_CrystalChest": "Armadilha do Baú de Cristal", "Fake_GoldenChest": "Armadilha do Baú de Ouro", @@ -3978,6 +4005,10 @@ "SquireAltPants": "Grevas do Cavaleiro de Valhalla", "SquireAltShirt": "Peitoral do Cavaleiro de Valhalla", "SkywareClock2": "Relógio Solar", + "ArkhalisHat": "Capuz de Arkhalis", + "ArkhalisShirt": "Corpete de Arkhalis", + "ArkhalisPants": "Collant de Arkhalis", + "ArkhalisWings": "Asas de Luz de Arkhalis", "LeinforsHat": "Protetor de Cabelos de Leinfors", "LeinforsShirt": "Estilo Exagerado de Leinfors", "LeinforsPants": "Calças Chiques de Leinfors", @@ -4003,7 +4034,7 @@ "Paintbrush": "Utiliza-se com tinta para colorir blocos", "PaintRoller": "Utiliza-se com tinta para colorir paredes", "ManaCrystal": "Aumenta a mana máxima permanentemente em 20", - "GolfBallDyedPink": "{$CommonItemTooltip.GolfBall}", + "PaintScraper": "Utiliza-se para remover tinta", "TealMushroom": "Utiliza-se na criação de Tintura verde azulada", "GreenMushroom": "Utiliza-se na criação de Tintura verde", "SkyBlueFlower": "Utiliza-se na criação de Tintura azul celeste", @@ -4027,7 +4058,7 @@ "MagicMissile": "Lança um míssil controlável", "Beenade": "Explode em um enxame de abelhas", "GravityGlobe": "Permite que o usuário reverta a gravidade\nPressione PARA CIMA para alterar a gravidade", - "KiteRed": "{$CommonItemTooltip.Kite}", + "HoneyComb": "Libera abelhas quando sofrer danos", "Abeemination": "Invoca a Abelha rainha", "DirtRod": "Magicamente move a terra", "TempleKey": "Abre a porta do templo da selva", @@ -4036,10 +4067,10 @@ "LihzahrdPressurePlate": "Ativa quando um jogador passar por cima", "PiranhaGun": "Prende-se aos inimigos para causar dano contínuo", "PygmyStaff": "Invoca um pigmeu para lutar por você", - "KiteBlueAndYellow": "{$CommonItemTooltip.Kite}", - "KiteBlue": "{$CommonItemTooltip.Kite}", - "KiteWyvern": "{$CommonItemTooltip.Kite}", - "GroxTheGreatGreaves": "{$CommonItemTooltip.DevItem}", + "PygmyNecklace": "Aumenta o número máximo de lacaios que você pode ter", + "TikiMask": "Aumenta o número máximo de lacaios que você pode ter\nAumenta os danos causados por lacaios em 10%", + "TikiShirt": "Aumenta o número máximo de lacaios que você pode ter\nAumenta os danos causados por lacaios em 10%", + "TikiPants": "Aumenta o número máximo de lacaios que você pode ter\nAumenta os danos causados por lacaios em 10%", "LeafWings": "{$CommonItemTooltip.FlightAndSlowfall}", "BlizzardinaBalloon": "Permite pulos duplos\nAumenta a altura dos pulos", "BundleofBalloons": "Permite que o usuário execute pulos quádruplos\nAumenta a altura dos pulos", @@ -4088,19 +4119,19 @@ "MeteorSuit": "7% de aumento nos danos por magia", "AmberMosquito": "Invoca um filhote de dinossauro", "NimbusRod": "Invoca uma nuvem para fazer cair chuva em seus inimigos", - "GroxTheGreatArmor": "{$CommonItemTooltip.DevItem}", + "BeeCloak": "Faz com que estrelas caiam e libera abelhas quando ferido", "EyeoftheGolem": "10% de aumento na chance de acerto crítico", "HoneyBalloon": "Aumenta a altura dos pulos\nLibera abelhas quando sofrer danos", "MeteorLeggings": "7% de aumento nos danos por magia", "BlueHorseshoeBalloon": "Permite pulos duplos\nAumenta a altura dos pulos e cancela danos por queda", "WhiteHorseshoeBalloon": "Permite pulos duplos\nAumenta a altura dos pulos e cancela danos por queda", "YellowHorseshoeBalloon": "Permite pulos duplos\nAumenta a altura dos pulos e cancela danos por queda", - "OceanCrate": "{$CommonItemTooltip.RightClickToOpen}", + "FrozenTurtleShell": "Cria uma concha ao redor do usuário quando estiver com menos de 50% de vida, reduzindo os danos", "SniperRifle": "Atira um poderoso projétil a alta velocidade\n para afastar", "VenusMagnum": "Atira um poderoso projétil a alta velocidade", "CrimsonRod": "Invoca uma nuvem para fazer cair uma chuva de sangue em seus inimigos", - "SteampunkWings": "{$CommonItemTooltip.FlightAndSlowfall}", - "WingsVortex": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", + "Stynger": "Atira um raio explosivo", + "FlowerPow": "Atira pétalas de flores afiadíssimas em inimigos próximos", "RainbowGun": "Atira um arco-íris que causa danos contínuos", "StyngerBolt": "Explode em estilhaços mortais", "FlowerofFrost": "Atira uma bola de gelo", @@ -4112,11 +4143,11 @@ "EmeraldRobe": "Aumenta a mana máxima em 60\nReduz o custo de uso de mana em 11%", "RubyRobe": "Aumenta a mana máxima em 60\nReduz o custo de uso de mana em 13%", "DiamondRobe": "Aumenta a mana máxima em 80\nReduz o custo de uso de mana em 15%", - "GroxTheGreatHelm": "{$CommonItemTooltip.DevItem}", + "PanicNecklace": "Aumenta a velocidade de movimentos depois de ser atingido", "LifeFruit": "Aumenta a vida máxima permanentemente em 5", "LihzahrdPowerCell": "Utilizada no Altar lagharto", "Picksaw": "Capaz de minerar tijolos lagharto", - "JimsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "HeatRay": "Atira um raio de calor perfurante\n'Oolaa!!'", "StaffofEarth": "Invoca um poderoso rochedo", "GolemFist": "Dá um soco com a força de um golem", "Binoculars": "Aumenta o alcance de visualização quando equipado", @@ -4136,8 +4167,8 @@ "TurtleHelmet": "6% de aumento nos danos por ataques físicos\nA chance dos inimigos mirarem em você é maior", "TurtleScaleMail": "8% de aumento nos danos por ataque físico e na chance de ataque crítico\nA chance dos inimigos mirarem em você é maior", "TurtleLeggings": "4% de aumento na chance de acerto crítico em ataque físico\nA chance dos inimigos mirarem em você é maior", - "KiteWorldFeeder": "{$CommonItemTooltip.Kite}", - "OasisCrateHard": "{$CommonItemTooltip.RightClickToOpen}", + "MagicQuiver": "Aumenta os danos causados em 10% e aumenta bastante a velocidade de flechas\n20% de chance de não gastar flechas", + "MagmaStone": "Inflige dano por fogo ao atacar", "ObsidianRose": "Reduz danos sofridos ao entrar em contato com lava", "RodofDiscord": "Teleporta até a posição do mouse", "DeathSickle": "Atira uma foice mortal", @@ -4147,7 +4178,7 @@ "IchorArrow": "Diminui a defesa do alvo", "IchorBullet": "Diminui a defesa do alvo", "GoldenShower": "Emite um espirro de ichor\nDiminui a defesa do alvo", - "OasisCrate": "{$CommonItemTooltip.RightClickToOpen}", + "FireGauntlet": "Aumenta o poder de derrubar e inflige dano por fogo em ataques físicos\n10% de aumento nos danos por ataque físico e na velocidade", "ImbuingStation": "Utiliza-se na criação de frascos de efeitos para armas", "EmptyBullet": "Utiliza-se na criação de vários tipos de munição", "ShadowbeamStaff": "Cria um feixe de sombra que rebate nas paredes", @@ -4176,17 +4207,17 @@ "CorruptionKey": "Desbloqueia um baú corrompido no calabouço", "CrimsonKey": "Desbloqueia um baú de carmim no calabouço", "HallowedKey": "Desbloqueia um baú consagrado no calabouço", - "Cherry": "{$CommonItemTooltip.MinorStats}", + "FrozenKey": "Desbloqueia um baú congelado no calabouço", "SpectrePaintbrush": "Utiliza-se com tinta para colorir blocos", "SpectrePaintRoller": "Utiliza-se com tinta para colorir paredes", - "GolfBallDyedOrange": "{$CommonItemTooltip.GolfBall}", + "SpectrePaintScraper": "Utiliza-se para remover tinta", "ShroomiteHeadgear": "15% de aumento nos danos por flechas\n5% de aumento na chance de acerto crítico à distância", "ShroomiteMask": "15% de aumento nos danos por projéteis\n5% de aumento na chance de acerto crítico à distância", "ShroomiteHelmet": "15% de aumento nos danos por foguetes\n5% de aumento na chance de acerto crítico à distância", - "KiteBoneSerpent": "{$CommonItemTooltip.Kite}", + "ShroomiteBreastplate": "13% de aumento na chance de acerto crítico à distância\n20% de chance de não consumir munição", "ShroomiteLeggings": "7% de aumento na chance de acerto crítico à distância\n12% de aumento na velocidade dos movimentos", "Autohammer": "Converte Barras de Clorofita em Barras de Cogumelita", - "Jetpack": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressUpToBooster}", + "SDMG": "50% de chance de não consumir munição\n'Ele veio do espaço sideral'", "CenxsTiara": "{$CommonItemTooltip.DevItem}", "CenxsBreastplate": "{$CommonItemTooltip.DevItem}", "CenxsLeggings": "{$CommonItemTooltip.DevItem}", @@ -4206,17 +4237,17 @@ "VampireKnives": "Arremesse adagas que roubam vida rapidamente", "AquaScepter": "Espirra água", "ScourgeoftheCorruptor": "Uma poderosa lança que atira pequenos devoradores", - "Banana": "{$CommonItemTooltip.MinorStats}", + "StaffoftheFrostHydra": "Invoca uma poderosa hidra congelada que cospe gelo em seus inimigos", "SweetheartNecklace": "Lança abelhas e aumenta a velocidade dos movimentos quando sofrer danos", "FlurryBoots": "Permite correr ultra veloz", "LuckyHorseshoe": "Nega os danos por queda", "DTownsHelmet": "{$CommonItemTooltip.DevItem}", "DTownsBreastplate": "{$CommonItemTooltip.DevItem}", "DTownsLeggings": "{$CommonItemTooltip.DevItem}", - "GroxTheGreatWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", - "StillLife": "{$PaintingArtist.Crowno}", - "BloodyGoblet": "{$PaintingArtist.Crowno}", - "WickedUndead": "{$PaintingArtist.Crowno}", + "DTownsWings": "{$CommonItemTooltip.DevItem}", + "WillsWings": "{$CommonItemTooltip.DevItem}", + "CrownosWings": "{$CommonItemTooltip.DevItem}", + "CenxsWings": "{$CommonItemTooltip.DevItem}", "CenxsDress": "{$CommonItemTooltip.DevItem}", "CenxsDressPants": "{$CommonItemTooltip.DevItem}", "ShinyRedBalloon": "Aumenta a altura dos pulos", @@ -4225,7 +4256,7 @@ "AnkhCharm": "Garante imunidade à maioria dos efeitos negativos", "AnkhShield": "Oferece imunidade a quedas e a blocos de fogo\nGarante imunidade à maioria dos efeitos negativos", "WaterBolt": "Lança um raio d'água lento", - "GolfBall": "{$CommonItemTooltip.GolfBall}", + "Bomb": "Uma pequena explosão que destruirá algumass peças", "Dynamite": "Uma grande explosão que destruirá a maioria das peças", "Grenade": "Uma pequena explosão que não destruirá peças", "GoldWatch": "Diz a hora", @@ -4237,7 +4268,7 @@ "GoodieBag": "{$CommonItemTooltip.RightClickToOpen}", "CandyCornRifle": "33% de chance de não consumir munição", "Sickle": "Permite coletar feno de grama", - "KiteAngryTrapper": "{$CommonItemTooltip.Kite}", + "PumpkinPie": "{$CommonItemTooltip.MinorStats}", "TatteredFairyWings": "{$CommonItemTooltip.FlightAndSlowfall}", "SpiderEgg": "Invoca uma aranha de estimação", "MagicalPumpkinSeed": "Invoca uma abóbora de estimação", @@ -4253,35 +4284,35 @@ "UnluckyYarn": "Invoca um gatinho preto", "TheHorsemansBlade": "Invoca cabeças de abóbora para atacar seus inimigos", "SpookyWings": "{$CommonItemTooltip.FlightAndSlowfall}", - "GhostManifestation": "{$PaintingArtist.Crowno}", - "Graveyard": "{$PaintingArtist.Crowno}", - "Reborn": "{$PaintingArtist.Crowno}", + "SpookyHelmet": "Aumenta o número máximo de lacaios que você pode ter\nAumenta os danos causados por lacaios em 11%", + "SpookyBreastplate": "Aumenta o número máximo de lacaios que você pode ter\nAumenta os danos causados por lacaios em 11%", + "SpookyLeggings": "Aumenta o número máximo de lacaios que você pode ter\nAumenta os danos causados por lacaios em 11%", "CursedSapling": "Invoca uma plantinha amaldiçoada para seguir você", "PumpkinMoonMedallion": "Invoca a Lua de abóbora", - "Nevermore": "{$PaintingArtist.Crowno}", + "NecromanticScroll": "Aumenta o número máximo de lacaios que você pode ter\nAumenta os danos causados por lacaios em 10%", "SniperScope": "Aumenta o alcance de visualização para armas ( para afastar a visão)\n10% de aumento nos danos por ataque à distância e na chance de ataque crítico", "BreathingReed": "Aumenta o fôlego e permite respirar embaixo d'água", "JellyfishDivingGear": "Garante a habilidade de nadar e aumenta consideravelmente o fôlego embaixo d'água\nIlumina embaixo d'água", "ArcticDivingGear": "Garante a habilidade de nadar e aumenta consideravelmente o fôlego embaixo d'água\nIlumina embaixo d'água e aumenta a mobilidade no gelo", - "GnomeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.Gnome}", + "FrostsparkBoots": "Permite voar, correr em altíssima velocidade e garante maior mobilidade no gelo\n7% de aumento na velocidade dos movimentos", "FartInABalloon": "Permite pulos duplos\nAumenta a altura dos pulos", - "DandelionBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.Dandelion}", - "GolfPainting3": "{$PaintingArtist.Crowno}", - "ArkhalisWings": "{$ItemTooltip.ArkhalisHat}\n{$CommonItemTooltip.FlightAndSlowfall}", + "PapyrusScarab": "Aumenta o número máximo de lacaios que você pode ter\nAumenta os danos e as quedas dos seus lacaios", + "CelestialStone": "Pequeno aumento nos danos, na velocidade dos ataques físicos, na chance de acertos críticos,\nregeneração da vida, defesa, velocidade da picareta e recuo de lacaios", + "Hoverboard": "{$CommonItemTooltip.FlightAndSlowfall}\nMantenha pressionado PARA BAIXO e PULO para pairar", "Present": "{$CommonItemTooltip.RightClickToOpen}", "Flipper": "Oferece a capacidade de nadar", "RedRyder": "Não vá arrancar o próprio olho!", "FestiveWings": "{$CommonItemTooltip.FlightAndSlowfall}", "BladeofGrass": "Tem chance de envenenar seus inimigos", "EldMelter": "Utiliza gel como munição", - "KiteGoldfish": "{$CommonItemTooltip.Kite}", + "ChristmasPudding": "{$CommonItemTooltip.MinorStats}", "ReindeerBells": "Invoca uma rena que pode ser montada", "CnadyCanePickaxe": "Pode minerar meteoritos", - "KiteBunnyCrimson": "{$CommonItemTooltip.Kite}", - "KiteBunnyCorrupt": "{$CommonItemTooltip.Kite}", + "SugarCookie": "{$CommonItemTooltip.MinorStats}", + "GingerbreadCookie": "{$CommonItemTooltip.MinorStats}", "HandWarmer": "Garante imunidade contra efeitos de congelamento", "Coal": "'Você foi malcriado este ano'", - "GolfPainting2": "{$PaintingArtist.Crowno}", + "Toolbox": "Aumenta a criação de itens e o alcance das ferramentas em 1", "DogWhistle": "Invoca um Filhote", "ChristmasTreeSword": "Dispara decorações de Natal", "ChainGun": "50% de chance de não consumir munição", @@ -4297,7 +4328,7 @@ "JungleRose": "Que lindo, ah que lindo", "FeralClaws": "12% de aumento na velocidade do ataque físico", "AnkletoftheWind": "10% de aumento na velocidade dos movimentos", - "GolfClubIron": "{$CommonItemTooltip.GolfIron}", + "StaffofRegrowth": "Cria grama e musgo sobre areia e pedras\nAumenta a coleta de plantas para alquimia quando usado na colheita", "WhoopieCushion": "Pode incomodar outras pessoas", "HeavyWorkBench": "Utilizado na criação avançada", "AmmoBox": "Reduz o consumo de munição em 20%", @@ -4318,7 +4349,7 @@ "SteampunkBoiler": "{$CommonItemTooltip.SpecialCrafting}", "HoneyDispenser": "{$CommonItemTooltip.SpecialCrafting}", "BrickLayer": "Aumenta a velocidade do posicionamento de peças", - "GolfPainting1": "{$PaintingArtist.Crowno}", + "ExtendoGrip": "Aumenta o alcance das peças", "PaintSprayer": "Pinta automaticamente os objetos posicionados", "PortableCementMixer": "Aumenta a velocidade de posicionamento das paredes", "CelestialMagnet": "Aumenta o alcance de coleta das estrelas de mana", @@ -4327,8 +4358,8 @@ "CelestialCuffs": "Aumenta o alcance de coleta das estrelas de mana\nRestaura mana quando sofrer danos", "PulseBow": "Atira uma flecha carregada", "NaturesGift": "6% de redução no consumo de mana", - "KiteSandShark": "{$CommonItemTooltip.Kite}", - "KiteShark": "{$CommonItemTooltip.Kite}", + "PadThai": "{$CommonItemTooltip.MinorStats}", + "Pho": "{$CommonItemTooltip.MinorStats}", "RestorationPotion": "Reduz o tempo de recarga das poções", "Gatligator": "50% de chance de não consumir munição\nBaixíssima precisão", "WaterGun": "Espirra um jato d'água inofensivo", @@ -4341,14 +4372,14 @@ "Gel": "Tem um gosto bom e é inflamável", "JunglePants": "Aumenta a mana máxima em 20\n4% de aumento na chance de acerto crítico de magias", "NeonTetra": "'Suas escamas coloridas têm ótimo valor de revenda.'", - "Grapefruit": "{$CommonItemTooltip.MinorStats}", + "GoldenCarp": "Belo brilho. Provavelmente terá um bom preço de revenda.", "MiningPotion": "Aumenta a velocidade de mineração em 25%", "HeartreachPotion": "Aumenta o alcance de coleta de corações", - "DungeonFishingCrateHard": "{$ItemTooltip.DungeonFishingCrate}", + "CalmingPotion": "Reduz a agressão dos inimigos", "BuilderPotion": "Aumenta a velocidade e o alcance do posicionamento", "TitanPotion": "Aumenta o recuo", "FlipperPotion": "Permite que você mova-se rapidamente em líquidos", - "DivineEye": "{$PaintingArtist.Darthkitten}", + "SummoningPotion": "Aumenta o número máximo de lacaios que você pode ter", "TrapsightPotion": "Permite que você veja fontes de perigo próximas", "WoodenCrate": "{$CommonItemTooltip.RightClickToOpen}", "IronCrate": "{$CommonItemTooltip.RightClickToOpen}", @@ -4359,36 +4390,36 @@ "RagePotion": "Aumento de 10% na chance de acerto crítico", "InfernoPotion": "Incendeia os inimigos próximos", "WrathPotion": "Aumenta os danos causados em 10%", - "GolfClubDriver": "{$CommonItemTooltip.GolfDriver}", + "StickyBomb": "Pode ser difícil de arremessar.", "RecallPotion": "Teleporta você para casa", "TeleportationPotion": "Teleporta você para um local aleatório", "LovePotion": "Arremesse isso para fazer alguém apaixonar-se", "StinkPotion": "Arremesse isso para fazer alguém ficar fedendo", - "BandageBoy": "{$PaintingArtist.Darthkitten}", + "FishingPotion": "Aumenta as habilidades de pescaria", "SonarPotion": "Detecta peixes no anzol", "CratePotion": "Aumenta as chances de obter um caixote", "WarmthPotion": "Reduz os danos sofridos por fontes de frio", - "VisitingThePyramids": "{$PaintingArtist.Leinfors}", - "Uluru": "{$PaintingArtist.darthmorf}", + "BeeHeadgear": "Aumenta os danos causados por lacaios em 4%\nAumenta o número máximo de lacaios que você pode ter", + "BeeBreastplate": "Aumenta os danos causados por lacaios em 4%\nAumenta o número máximo de lacaios que você pode ter", "BeeGreaves": "Aumenta os danos causados por lacaios em 5%", "HornetStaff": "Invoca uma vespa para lutar por você", "ImpStaff": "Invoca um demônio para lutar por você", - "Oasis": "{$PaintingArtist.Khaios}", - "LifeAboveTheSand": "{$PaintingArtist.Zoomo}", - "SnakesIHateSnakes": "{$PaintingArtist.Xman101}", + "AnglerHat": "Aumenta o nível de pescaria", + "AnglerVest": "Aumenta o nível de pescaria", + "AnglerPants": "Aumenta o nível de pescaria", "Sunglasses": "Vai te deixar na moda!", - "TheSandsOfSlime": "{$PaintingArtist.Criddle}", - "JawsOfDeath": "{$PaintingArtist.Darthkitten}", - "BurningSpirit": "{$PaintingArtist.Zoomo}", + "SpiderMask": "Aumenta o número máximo de lacaios que você pode ter\nAumenta os danos causados por lacaios em 6%", + "SpiderBreastplate": "Aumenta o número máximo de lacaios que você pode ter\nAumenta os danos causados por lacaios em 6%", + "SpiderGreaves": "Aumenta o número máximo de lacaios que você pode ter\nAumenta os danos causados por lacaios em 6%", "HighTestFishingLine": "Os fios de pesca nunca quebram", - "FruitSalad": "{$CommonItemTooltip.MinorStats}", + "AnglerEarring": "Aumenta as habilidades de pescaria", "TackleBox": "Diminui as chances de consumo de iscas", "WizardHat": "15% de aumento nos danos por magia", "ZephyrFish": "Invoca um Peixe do Zéfiro de estimação", "FrogLeg": "Aumenta a velocidade dos pulos e permite o pulo automático\nAumenta a resistência a quedas", - "Dragonfruit": "{$CommonItemTooltip.MediumStats}", - "KiteJellyfishPink": "{$CommonItemTooltip.Kite}", - "KiteJellyfishBlue": "{$CommonItemTooltip.Kite}", + "CookedFish": "{$CommonItemTooltip.MinorStats}", + "CookedShrimp": "{$CommonItemTooltip.MinorStats}", + "Sashimi": "{$CommonItemTooltip.MinorStats}", "FinWings": "{$CommonItemTooltip.FlightAndSlowfall}", "OpticStaff": "Invoca gêmeos para lutar por você", "RedHat": "Cheirinho esquisito...", @@ -4421,13 +4452,13 @@ "HunterPotion": "Exibe a localização dos inimigos", "GravitationPotion": "Permite o controle da gravidade", "IllegalGunParts": "Proibido na maioria dos lugares", - "GolfClubWedge": "{$CommonItemTooltip.GolfWedge}", - "BetsyWings": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", + "GoldenKey": "Abre um Baú de Ouro ou de Calabouço", + "ShadowKey": "Abre todos os Baús das sombras", "Furnace": "Serve para o derretimento de minério", "Loom": "Utilizado na criação de tecido", "IronAnvil": "Serve para a criação de itens a partir de barras de metal", "Keg": "Utilizado na criação de bebidas", - "KiteManEater": "{$CommonItemTooltip.Kite}", + "BowlofSoup": "{$CommonItemTooltip.MinorStats}", "WorkBench": "Serve para criação básica", "GoblinBattleStandard": "Invoca um exército de goblins", "Sawmill": "Utilizado na criação avançada com madeira", @@ -4440,7 +4471,7 @@ "MythrilHat": "12% de aumento nos danos por ataque à distância\n7% de aumento na chance de acerto crítico à distância", "CobaltDrill": "Pode minerar mithril e oricalco", "MythrilDrill": "Pode minerar adamantino e titânio", - "WingsNebula": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", + "DaoofPow": "Tem chance de causar confusão\nEncontre sua paz interior... em pedacinhos", "Compass": "Exibe a posição horizontal", "DivingGear": "Oferece a capacidade de nadar\nAumento enorme no tempo embaixo d'água", "GPS": "Exibe a posição\nDiz a hora", @@ -4454,14 +4485,14 @@ "AdamantiteBreastplate": "6% de aumento nos danos", "AdamantiteLeggings": "4% de aumento na chance de acerto crítico\n5% de aumento na velocidade dos movimentos", "SpectreBoots": "Permite o voo\nPermite que o usuário corra em alta velocidade", - "FruitJuice": "{$CommonItemTooltip.MinorStats}", + "Toolbelt": "Aumenta o alcance do posicionamento de blocos", "HolyWater": "Espalha a Consagração a alguns blocos", - "CrimsonFishingCrateHard": "{$ItemTooltip.CrimsonFishingCrate}", + "UnholyWater": "Espalha a corrupção a alguns blocos", "FairyBell": "Invoca uma fada mágica", "SuspiciousLookingEye": "Invoca o Olho de Cthulhu", "ClockworkAssaultRifle": "Aceleração por três rodadas\nSó o primeiro disparo consome munição", "MoonCharm": "Transforma quem estiver utilizando em lobisomem à noite", - "KiteCrawltipede": "{$CommonItemTooltip.Kite}", + "Ruler": "Cria linhas com medidas na tela para o posicionamento de blocos", "SorcererEmblem": "15% de aumento nos danos por magia", "BandofRegeneration": "Lentamente regenera a vida", "WarriorEmblem": "15% de aumento nos danos por ataques físicos", @@ -4487,16 +4518,16 @@ "AdamantiteForge": "Serve para derreter minério de adamantino e de titânio", "MythrilAnvil": "Serve para criar itens a partir de barras de mithril, oricalco, adamantino e titânio", "UnicornHorn": "Afiado e mágico!", - "CrownosWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "DarkShard": "Às vezes é encontrado com criaturas em desertos corruptos", "LightShard": "Às vezes é encontrado com criaturas em desertos de luz", "RedPressurePlate": "A ativação acontece quando alguém sobe em cima", "CloudinaBottle": "Permite pulos duplos", "SpellTome": "Pode ter encantamento", - "PrismaticPunch": "{$CommonItemTooltip.MediumStats}", + "StarCloak": "Faz com que estrelas caiam quando sofre ferimento", "Megashark": "50% de chance de não consumir munição\nO irmão mais velho do minitubarão", "Shotgun": "Dispara projéteis em várias direções", - "FrozenCrateHard": "{$CommonItemTooltip.RightClickToOpen}", - "Mango": "{$CommonItemTooltip.MinorStats}", + "PhilosophersStone": "Reduz o tempo de recarga da cura", + "TitanGlove": "Aumenta o recuo por ataque físico", "HermesBoots": "Permite correr ultra veloz", "GreenPressurePlate": "A ativação acontece quando alguém sobe em cima", "GrayPressurePlate": "Ativa quando um jogador passar por cima", @@ -4510,10 +4541,10 @@ "HallowedHelmet": "15% de aumento nos danos por ataque à distância\n8% de aumento na chance de acerto crítico à distância", "CrossNecklace": "Aumenta o tempo de invencibilidade depois de sofrer dano", "ManaFlower": "8% de redução no consumo de mana\nUtiliza poções de mana automaticamente quando necessário", - "Elderberry": "{$CommonItemTooltip.MinorStats}", + "MechanicalWorm": "Invoca o Destruidor", "MechanicalSkull": "Invoca o Esqueletron Alfa", "HallowedHeadgear": "Aumenta a mana máxima em 100\n12% de aumento nos danos por magia e na chance de acerto crítico", - "KiteYellow": "{$CommonItemTooltip.Kite}", + "HallowedMask": "10% de aumento nos danos por ataque físico e na chance de ataque crítico\n10% de aumento na velocidade dos ataques físicos", "DemoniteOre": "Pulsando com energia das trevas", "SlimeCrown": "Invoca a Geleia rei", "LightDisc": "Acumula até 5", @@ -4535,12 +4566,12 @@ "Vilethorn": "Invoca um espinho infame", "Starfury": "Faz com que estrelas caiam do céu\nForjada com a fúria dos céus", "PurificationPowder": "Remove o mal", - "SmoothieofDarkness": "{$CommonItemTooltip.MinorStats}", + "RedsWings": "{$CommonItemTooltip.DevItem}", "RedsHelmet": "{$CommonItemTooltip.DevItem}", "RedsBreastplate": "{$CommonItemTooltip.DevItem}", "RedsLeggings": "{$CommonItemTooltip.DevItem}", "Fish": "Invoca um filhote de pinguim", - "BloodOrange": "{$CommonItemTooltip.MinorStats}", + "VilePowder": "Expulsa a Consagração", "Frostbrand": "Atira um raio de gelo", "RedPotion": "Só para os que são dignos o suficiente", "RottenChunk": "Parece ser gostoso!", @@ -4557,7 +4588,7 @@ "IceBlade": "Atira um raio de gelo", "IceBow": "Atira flechas congeladas", "FrostStaff": "Atira um jato congelado", - "BlueCultistCasterBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CultistDevote}", + "Jetpack": "{$CommonItemTooltip.FlightAndSlowfall}\nMantenha pressionado PARA CIMA para subir mais rápido", "ButterflyWings": "{$CommonItemTooltip.FlightAndSlowfall}", "FallenStar": "Desaparece depois do nascer do Sol", "Seaweed": "Invoca uma tartaruga de estimação", @@ -4588,14 +4619,14 @@ "GreenWrench": "Cria fio verde", "BluePressurePlate": "Ativa quando um jogador passar por cima", "YellowPressurePlate": "Ativa quando qualquer coisa exceto pelo jogador passar por cima", - "FrozenCrate": "{$CommonItemTooltip.RightClickToOpen}", + "DiscountCard": "Os preços nas lojas serão menores", "LuckyCoin": "Acertar inimigos às vezes faz com que deixem cair mais moedas", "UnicornonaStick": "\"É diversão que não acaba!\"", "SandstorminaBottle": "Permite que o usuário execute um pulo duplo aprimorado", - "CanOfWorms": "{$CommonItemTooltip.RightClickToOpen}", + "CharmofMyths": "Oferece regeneração de vida e reduz a recarga de poções de cura", "MoonShell": "Transforma o usuário em um lobisomem à noite e em um tritão quando entrar na água", "StarVeil": "Faz com que estrelas caiam e aumenta a duração da invencibilidade depois de sofrer danos", - "BloodyMoscato": "{$CommonItemTooltip.MinorStats}", + "WaterWalkingBoots": "Permite andar sobre a água", "MiningHelmet": "Fornece luz a quem usar", "AdhesiveBandage": "Imune a sangramentos", "ArmorPolish": "Imune a armaduras quebradas", @@ -4606,28 +4637,28 @@ "Nazar": "Imune a maldições", "Vitamins": "Imune à fraqueza", "TrifoldMap": "Imune à confusão", - "Lemon": "{$CommonItemTooltip.MinorStats}", - "TropicalSmoothie": "{$CommonItemTooltip.MinorStats}", - "PinaColada": "{$CommonItemTooltip.MinorStats}", - "PeachSangria": "{$CommonItemTooltip.MinorStats}", + "PowerGlove": "Aumenta o recuo por ataque físico\n12% de aumento na velocidade do ataque físico", + "LightningBoots": "Permite o voo\nO usuário pode correr em altíssima velocidade", + "SunStone": "Aumenta todas as estatísticas se for usado durante o dia", + "MoonStone": "Aumenta todas as estatísticas se for usado durante a noite", "ArmorBracing": "Imune à fraqueza e a armaduras quebradas", "MedicatedBandage": "Imune a venenos e a sangramentos", "ThePlan": "Imune à lentidão e à confusão", "CountercurseMantra": "Imune ao silêncio e a maldições", "CoinGun": "Utiliza moedas como munição\nMoedas de valor mais alto causam danos maiores", "LavaCharm": "Oferece 7 segundos de imunidade a lava", - "BananaDaiquiri": "{$CommonItemTooltip.MinorStats}", - "Pineapple": "{$CommonItemTooltip.MinorStats}", + "ObsidianWaterWalkingBoots": "Permite andar sobre a água\nOferece imunidade a blocos de fogo", + "LavaWaders": "Permite andar sobre a água e sobre a lava\nOferece imunidade a blocos de fogo e 7 segundos de imunidade a lava", "BoneWand": "Cria um osso", "LeafWand": "Cria folhas", "FlyingCarpet": "Permite que o usuário flutue por alguns segundos", "AvengerEmblem": "12% de aumento nos danos", - "Lemonade": "{$CommonItemTooltip.MinorStats}", + "MechanicalGlove": "Aumenta o recuo por ataque físico\n12% de aumento nos danos e na velocidade dos ataques físicos", "LandMine": "Explode quando alguém sobe em cima", - "Starfruit": "{$CommonItemTooltip.MediumStats}", + "PaladinsShield": "Absorve 25% de danos causados aos jogadores em sua equipe\nSó fica ativo com mais de 25% de vida", "Umbrella": "Você vai cair mais lentamente enquanto estiver segurando isto", "ChlorophyteOre": "'Reage à luz'", - "GrapeJuice": "{$CommonItemTooltip.MajorStats}", + "SteampunkWings": "Permite voar e desacelera a queda", "IceSkates": "Permite maior mobilidade no gelo\nO gelo não vai quebrar quando você cair nele", "SnowballLauncher": "Lança bolas de neve rapidamente", "ClimbingClaws": "Permite deslizar ao descer de paredes\nMaior habilidade se combinar com Espetos para sapatos", @@ -4644,7 +4675,7 @@ "Campfire": "A regeneração de vida aumenta quando estiver próximo a uma fogueira", "Marshmallow": "Ponha em um graveto e toste na fogueira", "MarshmallowonaStick": "Toste em uma fogueira!", - "Coconut": "{$CommonItemTooltip.MinorStats}", + "CookedMarshmallow": "{$CommonItemTooltip.MinorStats}", "ShoeSpikes": "Permite deslizar ao descer de paredes\nMaior habilidade se combinar com Garras para escalada", "TigerClimbingGear": "Permite escalar paredes", "Tabi": "Permite correr\nToque duas vezes em uma direção", @@ -4660,19 +4691,19 @@ "EatersBone": "Invoca um filhote de Devorador de almas", "BlendOMatic": "Utiliza-se na criação de objetos", "MeatGrinder": "Utiliza-se na criação de objetos", - "Rambutan": "{$CommonItemTooltip.MinorStats}", + "Extractinator": "Transforma limo/lama/fósseis em algo mais útil\n'Para usar: Posicione o limo/a lama/os fósseis no extrator'", "Solidifier": "Utiliza-se na criação de objetos", "ActuationAccessory": "Posiciona atuadores automaticamente em objetos posicionados", "ActuationRod": "Ativa os Atuadores", "AlchemyTable": "33% de chance de não consumir poções ao criar ingredientes", "AncientBattleArmorHat": "15% de aumento nos danos por magia e dos lacaios", - "AppleJuice": "{$CommonItemTooltip.MinorStats}", - "WoodenCrateHard": "{$ItemTooltip.WoodenCrate}", + "AncientBattleArmorPants": "Aumenta o número máximo de lacaios que você pode ter", + "AncientBattleArmorShirt": "Aumenta a mana máxima em 80", "AncientHorn": "Invoca um basilisco que pode ser montado", - "BloodNautilusBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodNautilus}", - "GoblinSharkBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.GoblinShark}", + "AnglerTackleBag": "Os fios de pesca nunca quebram, Diminui as chances de consumo de iscas, Aumenta as habilidades de pescaria", + "ArchitectGizmoPack": "Aumenta a velocidade e o alcance de posicionamento de peças\nPinta automaticamente os objetos posicionados", "AviatorSunglasses": "Ativa seu parceiro interior\n'Ótimo para fingir que é um streamer!'", - "KitePigron": "{$CommonItemTooltip.Kite}", + "Bacon": "{$CommonItemTooltip.MinorStats}\n'Bacon? Bacon.'", "BalloonHorseshoeFart": "Permite pulos duplos\nAumenta a altura dos pulos e cancela danos por queda", "BalloonHorseshoeHoney": "Libera abelhas quando sofrer danos\nAumenta a altura dos pulos e cancela danos por queda", "BalloonHorseshoeSharkron": "Permite pulos duplos\nAumenta a altura dos pulos e cancela danos por queda", @@ -4680,26 +4711,26 @@ "BeesKnees": "Flechas de madeira transformam-se em colunas de abelhas", "BejeweledValkyrieBody": "{$CommonItemTooltip.DevItem}\nCheio de joias e elegante, para explorar os céus", "BejeweledValkyrieHead": "{$CommonItemTooltip.DevItem}\nTorne-se o vento, domine os relâmpagos.", - "BloodEelBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodEelHead}", + "BejeweledValkyrieWing": "{$CommonItemTooltip.DevItem}\nA Barreira-Plataforma do Satélite da Valquíria é super seguro. Na maioria das vezes.", "BewitchingTable": " para ter mais lacaios", "Bladetongue": "Dá uma cusparada de fluxo de Ichor ao toque", "BlessedApple": "Invoca um unicórnio que pode ser montado", - "CorruptFishingCrateHard": "{$ItemTooltip.CorruptFishingCrate}", - "JungleFishingCrateHard": "{$ItemTooltip.JungleFishingCrate}", + "BloodWater": "Espalha o carmim a alguns blocos", + "BombFish": "Uma pequena explosão que destruirá algumas peças", "BoneCampfire": "A regeneração de vida aumenta quando estiver próximo a uma fogueira", "BoneRattle": "Invoca um Monstro Cara de Bebê", "BoneTorch": "'Emite um brilho fatal'", "BoosterTrack": "Use o martelo para mudar a direção", - "GolfClubPutter": "{$CommonItemTooltip.GolfPutter}", - "HallowedFishingCrateHard": "{$ItemTooltip.HallowedFishingCrate}", - "KiteRedAndYellow": "{$CommonItemTooltip.Kite}", + "BottomlessBucket": "Contém uma quantidade interminável de água", + "BouncyBomb": "Uma pequena explosão que destruirá algumas peças\nMuito borrachudo", + "BouncyDynamite": "'Essa ideia não vai dar certo'", "BouncyGlowstick": "Funciona com água", "BouncyGrenade": "Uma pequena explosão que não destruirá peças\nMuito borrachudo", - "WillsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "BrainOfConfusion": "Pode confundir inimigos próximos depois de ser atingido", "BrainScrambler": "Invoca um Scutlix que pode ser montado", "BubbleGun": "Dispara fortes bolhas rapidamente", "ButchersChainsaw": "Faíscas são emitidas de inimigos atingidos", - "BloodSquidBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodSquid}", + "CelestialShell": "Transforma o usuário em um lobisomem à noite e em um tritão quando entrar na água\nPequenas melhorias em todas as estatísticas", "CelestialSigil": "Invoca a Desgraça Iminente", "CellPhone": "Exibe tudo\nPermite que você volte para casa em qualquer momento", "ClingerStaff": "Invoca uma parede de chamas amaldiçoadas", @@ -4733,9 +4764,9 @@ "FloatingIslandFishingCrate": "{$CommonItemTooltip.RightClickToOpen}", "FlowerBoots": "Flores crescem no gramado enquanto você caminha", "FlyingKnife": "Arremessa uma faca voadora controlável", - "GolfBallDyedBrown": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedBlue": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedBlack": "{$CommonItemTooltip.GolfBall}", + "FossilHelm": "20% de aumento na velocidade do arremesso", + "FossilPants": "15% de aumento na chance de acerto crítico no arremesso", + "FossilShirt": "20% de aumento nos danos por arremessos", "FragmentNebula": "'O poder da galáxia vive neste fragmento'", "FragmentSolar": "'A fúria do universo vive neste fragmento'", "FragmentStardust": "'Partículas hipnotizantes envolvem este fragmento'", @@ -4752,8 +4783,8 @@ "GoblinTech": "Exibe velocidade de movimento, danos por segundo e minérios valiosos", "GoldPickaxe": "Pode minerar Meteoritos", "GoldRing": "Maior alcance da coleta de moedas", - "Plum": "{$CommonItemTooltip.MinorStats}", - "KiteBunny": "{$CommonItemTooltip.Kite}", + "GreedyRing": "Aumenta a coleta de moedas e diminui os preços nas lojas\nAcertar inimigos às vezes faz com que deixem cair mais moedas", + "GrubSoup": "{$CommonItemTooltip.MinorStats}", "HallowedFishingCrate": "{$CommonItemTooltip.RightClickToOpen}", "HardySaddle": "Invoca uma Tartaruga que pode ser montada", "HellwingBow": "Flechas de madeira transformam-se em morcegos em chamas", @@ -4762,7 +4793,7 @@ "HoneyedGoggles": "Invoca uma Abelha que pode ser montada", "IceMirror": "Olhe para o espelho para voltar para casa", "IchorCampfire": "A regeneração de vida aumenta quando estiver próximo a uma fogueira", - "EyeballFlyingFishBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.EyeballFlyingFish}", + "JimsWings": "{$CommonItemTooltip.DevItem}", "JungleFishingCrate": "{$CommonItemTooltip.RightClickToOpen}", "LargeAmber": "Para Capturar a pedra preciosa. Cai quando você morre", "LaserRuler": "Cria linhas com medidas na tela para o posicionamento de blocos", @@ -4790,7 +4821,7 @@ "LokisHelm": "{$CommonItemTooltip.DevItem}\nO caos veio da ordem, o medo veio da coragem, e a fraqueza veio da força", "LokisPants": "{$CommonItemTooltip.DevItem}\nAs rodas da justiça são lentas, mas esmagadoras.", "LokisShirt": "{$CommonItemTooltip.DevItem}\nConheça a si mesmo, conheça o seu inimigo. Mil batalhas, mil vitórias...", - "ZombieMermanBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.ZombieMerman}", + "LokisWings": "{$CommonItemTooltip.DevItem}\nQue os seus planos sejam sombrios e impenetráveis como a noite, e quando você mover-se, que caia como um trovão.", "LunarBar": "'Vibra com energia luminosa celestial'", "LunarCraftingStation": "Serve para a criação de itens a partir de Fragmentos da Lua e Luminita", "LunarFlareBook": "Faz chover chamas da Lua", @@ -4806,7 +4837,7 @@ "MoneyTrough": "Invoca um porquinho para armazenar seus itens", "MoonlordArrow": "'Atirando neles na velocidade do som!'", "MoonlordBullet": "'Alinhe e derrube eles...'", - "Apricot": "{$CommonItemTooltip.MinorStats}", + "MoonlordTurretStaff": "Invoca um portal da Lua para disparar lasers contra seus inimigos", "MothronWings": "{$CommonItemTooltip.FlightAndSlowfall}", "MulticolorWrench": " enquanto segura para editar as configurações dos cabos", "NebulaArcanum": "'Conjure massas de energia astral para perseguir seus inimigos'", @@ -4817,9 +4848,9 @@ "NebulaMonolith": "'Use uma pequena quantidade da energia da Torre de Nébula'", "NightKey": "'Carregado com a essência de muitas almas'", "NightVisionHelmet": "Visão aprimorada", - "GolfBallDyedLimeGreen": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedGreen": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedCyan": "{$CommonItemTooltip.GolfBall}", + "NinjaHood": "15% de aumento na velocidade do arremesso", + "NinjaPants": "10% de aumento na chance de acerto crítico no arremesso", + "NinjaShirt": "15% de aumento nos danos por arremessos", "PartyBundleOfBalloonTile": "'Amarrado, para a alegria de todos'", "PartyGirlGrenade": "Uma pequena explosão que não destruirá peças", "PartyMonolith": "'Balões cairão do céu'", @@ -4841,10 +4872,10 @@ "ProjectilePressurePad": "Ativado quando um projétil entra em contato", "PsychoKnife": "Permite que você entre no modo sorrateiro", "PutridScent": "Inimigos terão dificuldade em marcar você como alvo\n5% de aumento nos danos e na chance de ataque crítico", - "GolfBallDyedYellow": "{$CommonItemTooltip.GolfBall}", + "QueenSpiderStaff": "Invoca uma aranha rainha que cospe ovos em seus inimigos", "Radar": "Detecta inimigos ao seu redor", "RainbowCampfire": "A regeneração de vida aumenta quando estiver próximo a uma fogueira", - "GolfBallDyedViolet": "{$CommonItemTooltip.GolfBall}", + "RainbowCrystalStaff": "Invoca um cristal radiante que expulsa seus inimigos\n'As cores, Duque, as cores!'", "RazorbladeTyphoon": "Lança rodas laminadas de alta velocidade", "RedsYoyo": "{$CommonItemTooltip.DevItem}", "REK": "Exibe o número de monstros, de mortes, e de criaturas raras", @@ -4875,30 +4906,30 @@ "SkiphsHelm": "{$CommonItemTooltip.DevItem}", "SkiphsPants": "{$CommonItemTooltip.DevItem}", "SkiphsShirt": "{$CommonItemTooltip.DevItem}", - "TheBrideBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.TheBride}", - "DTownsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "SkiphsWings": "{$CommonItemTooltip.DevItem}", + "SliceOfCake": "Pode exagerar. Faça outros exagerarem. Deixa pra lá.", "SlimeGun": "Espirra um jato de geleia inofensivo", "SlimySaddle": "Invoca uma Geleia que pode ser montada", - "KiteKoi": "{$CommonItemTooltip.Kite}", + "SnowCloudBlock": "Lá em cima faz bastante frio", "SnowFallBlock": "Bem mais frio que um globo de neve", "SnowFallWall": "Bem mais frio que um globo de neve", "SolarEruption": "'Ataque com a fúria do Sol'", - "RedsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", - "Hoverboard": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", - "CenxsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "SolarFlareBreastplate": "22% de aumento nos danos por ataques físicos\nA chance dos inimigos mirarem em você é maior", + "SolarFlareHelmet": "17% de aumento na chance de acerto crítico em ataque físico\nA chance dos inimigos mirarem em você é maior", + "SolarFlareLeggings": "15% de aumento na velocidade dos movimentos e dos ataques físicos\nA chance dos inimigos mirarem em você é maior", "SolarMonolith": "'Use uma pequena quantidade da energia da Torre Solar'", "SolarTablet": "Invoca o Eclipse", "SoulDrain": "Extrai vida dos inimigos", "SpelunkerGlowstick": "Expõe tesouros próximos", "SpiderStaff": "Invoca aranhas para lutar por você", "SporeSac": "Invoca esporos que causarão danos aos inimigos", - "GolfClubChlorophyteDriver": "{$CommonItemTooltip.GolfDriver}", + "StardustBreastplate": "Aumenta o número máximo de lacaios que você pode ter\nAumenta os danos causados por lacaios em 22%", "StardustCellStaff": "Invoca uma célula de pó das estrelas para lutar por você\n'Contive a mais linda infecção celular'", "StardustDragonStaff": "Invoca um dragão de pó das estrelas para lutar por você\n'Quem precisa de uma horda de lacaios quando você tem um dragão gigante?'", - "GolfClubDiamondWedge": "{$CommonItemTooltip.GolfWedge}", - "GolfClubShroomitePutter": "{$CommonItemTooltip.GolfPutter}", + "StardustHelmet": "Aumenta o número máximo de lacaios que você pode ter\nAumenta os danos causados por lacaios em 22%", + "StardustLeggings": "Aumenta o número máximo de lacaios que você pode ter\nAumenta os danos causados por lacaios em 22%", "StardustMonolith": "'Use uma pequena quantidade da energia da Torre de Pó das Estrelas'", - "FloatingIslandFishingCrateHard": "{$ItemTooltip.FloatingIslandFishingCrate}", + "StickyDynamite": "Pode ser difícil de arremessar.", "StickyGrenade": "Uma pequena explosão que não destruirá peças\n'Pode ser difícil de arremessar.'", "Stopwatch": "Exibe a velocidade dos movimentos do jogador", "StrangeBrew": "'Tem aparência e cheiro terríveis'", @@ -4921,7 +4952,7 @@ "TungstenPickaxe": "Pode minerar Meteoritos", "UltraBrightCampfire": "A regeneração de vida aumenta quando estiver próximo a uma fogueira", "ValkyrieYoyo": "{$CommonItemTooltip.DevItem}", - "BlackCurrant": "{$CommonItemTooltip.MinorStats}", + "ViciousPowder": "Expulsa a Consagração", "VineRopeCoil": "Arremesse para criar uma corda que pode ser usada em escalada", "VortexBeater": "66% de chance de não consumir munição\n'A mistura catastrófica de pew pew e boom boom.'", "VortexBreastplate": "12% de aumento nos danos por ataque à distância e na chance de ataque crítico\n25% de chance de não consumir munição", @@ -4935,10 +4966,10 @@ "WeightedPressurePlateOrange": "Ativa quando um jogador pisa em cima ou sai de cima", "WeightedPressurePlatePink": "Ativa quando um jogador pisa em cima ou sai de cima", "WeightedPressurePlatePurple": "Ativa quando um jogador pisa em cima ou sai de cima", - "Peach": "{$CommonItemTooltip.MinorStats}", + "WingsNebula": "{$CommonItemTooltip.FlightAndSlowfall}", "WingsSolar": "{$CommonItemTooltip.FlightAndSlowfall}", "WingsStardust": "{$CommonItemTooltip.FlightAndSlowfall}", - "GolfClubTitaniumIron": "{$CommonItemTooltip.GolfIron}", + "WingsVortex": "{$CommonItemTooltip.FlightAndSlowfall}", "WireBulb": "Acende lâmpadas para cada fio de cor diferente", "WireKite": "Permite o controle absoluto sobre os fios\n enquanto segura para editar as configurações dos cabos", "WirePipe": "Separa os caminhos dos fios\nTambém pode ser alterado com o martelo!", @@ -4950,7 +4981,7 @@ "Yoraiz0rHead": "{$CommonItemTooltip.DevItem}", "Yoraiz0rPants": "{$CommonItemTooltip.DevItem}", "Yoraiz0rShirt": "{$CommonItemTooltip.DevItem}", - "GolfClubPearlwoodDriver": "{$CommonItemTooltip.GolfDriver}", + "Yoraiz0rWings": "{$CommonItemTooltip.DevItem}\nSeja lá o que este acessório faça, não é um bug!", "YoyoBag": "Concede ao usuário habilidades de mestre do ioiô", "YoYoGlove": "Permite o uso de dois ioiôs ao mesmo tempo", "BloodMoonRising": "{$PaintingArtist.Garner}", @@ -5148,7 +5179,7 @@ "BlackSlimeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BlackSlime}", "BlueArmoredBonesBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BlueArmoredBones}", "BlueCultistArcherBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CultistArcherBlue}", - "SkiphsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "BlueCultistCasterBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.None}", "BlueCultistFighterBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.None}", "BoneLeeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BoneLee}", "ClingerBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.Clinger}", @@ -5402,22 +5433,22 @@ "ApprenticeScarf": "{$ItemTooltip.HuntressBuckler}", "SquireShield": "{$ItemTooltip.HuntressBuckler}", "MonkBelt": "{$ItemTooltip.HuntressBuckler}", - "GolfClubStoneIron": "{$CommonItemTooltip.GolfIron}", + "ApprenticeAltHead": "Aumenta o número máximo de sentinelas\n10% de aumento nos danos por lacaios e magia", "ApprenticeAltPants": "20% de aumento nos danos por lacaios e 25% de aumento nas chances de ataque mágico crítico", "ApprenticeAltShirt": "30% de aumento nos danos por lacaios e 15% de aumento nos danos mágicos", - "GolfClubGoldWedge": "{$CommonItemTooltip.GolfWedge}", + "ApprenticeHat": "Aumenta o número máximo de sentinelas e reduz em 10% o custo em mana", "ApprenticeRobe": "20% de aumento nos danos por lacaios e 10% de aumento nos danos mágicos", "ApprenticeStaffT3": "Jorra defesa, reduzindo o miasma!", - "GoldenCrateHard": "{$ItemTooltip.GoldenCrate}", + "ApprenticeTrousers": "10% de aumento nos danos por lacaios e 20% de aumento na velocidade dos movimentos", "BookStaff": "Quem será que enfiou um tomo de sabedoria infinita em um pedaço de madeira...\n para lançar um poderoso tornado", - "GolfBallDyedSkyBlue": "{$CommonItemTooltip.GolfBall}", + "DD2BallistraTowerT1Popper": "Uma torre lenta, mas capaz de causar danos graves, que dispara raios perfurantes\n{$CommonItemTooltip.EtherianManaCost10}", "DD2BetsyBow": "Dispara flechas que se dividem, causando danos maiores a inimigos aéreos", "DD2ElderCrystal": "Coloque na Base do Cristal de Etheria para invocar os portais de Éter", "DD2ElderCrystalStand": "Abriga o Cristal de Eternia", "DD2EnergyCrystal": "Costuma ser usado para manifestar a força de vontade como forma física de defesa", - "GolfBallDyedRed": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedTeal": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedPurple": "{$CommonItemTooltip.GolfBall}", + "DD2ExplosiveTrapT1Popper": "Uma armadilha que explode quando inimigos chegam perto\n{$CommonItemTooltip.EtherianManaCost10}", + "DD2FlameburstTowerT1Popper": "Uma torre de velocidade média, que dispara bolas de fogo explosivas\n{$CommonItemTooltip.EtherianManaCost10}", + "DD2LightningAuraT1Popper": "Uma aura que atinge repetidamente os inimigos que a penetram\n{$CommonItemTooltip.EtherianManaCost10}", "DD2PetDragon": "Invoca um dragão de estimação", "DD2PetGato": "Invoca um gato de estimação", "DD2PetGhost": "Invoca uma velinha de estimação, como fonte de luz", @@ -5425,77 +5456,47 @@ "DD2SquireBetsySword": "Libera a energia do coração para frente", "DD2SquireDemonSword": " para defender-se com um escudo", "DefenderMedal": "Dinheiro para ser usado com o Taberneiro", - "ShuckedOyster": "{$CommonItemTooltip.MinorStats}", + "HuntressAltHead": "Aumenta o número máximo de sentinelas\n10% de aumento nos danos por lacaios e chance de ataque à distância crítico", "HuntressAltPants": "25% de aumento nos danos por lacaios e 20% de aumento na velocidade dos movimentos", "HuntressAltShirt": "25% de aumento nos danos por lacaios e ataque à distância", - "GolfClubBronzeWedge": "{$CommonItemTooltip.GolfWedge}", + "HuntressBuckler": "Aumente o número máximo de sentinelas\nAumenta os danos causados por lacaios em 10%", "HuntressJerkin": "20% de aumento nos danos por ataques dos lacaios e à distância", "HuntressPants": "10% de aumento nos danos por lacaios e 20% de aumento na velocidade dos movimentos", - "GolfClubWoodDriver": "{$CommonItemTooltip.GolfDriver}", - "Oyster": "{$CommonItemTooltip.RightClickToOpen}", + "HuntressWig": "Aumenta o número máximo de sentinelas e aumenta a chance de acerto crítico à distância em 10%", + "MonkAltHead": "Aumenta o número máximo de sentinelas e aumenta em 20% os danos físicos e dos lacaios", "MonkAltPants": "20% de aumento nos danos por lacaios, na velocidade dos movimentos e na chance de acerto crítico", "MonkAltShirt": "20% de aumento nos danos por lacaios e na velocidade dos ataques físicos", - "GolfClubMythrilIron": "{$CommonItemTooltip.GolfIron}", + "MonkBrows": "Aumenta o número máximo de sentinelas e aumenta a velocidade de ataque físico em 20%", "MonkPants": "10% de aumento nos danos por lacaios,\n10% de aumento na chance de acerto crítico e 20% de aumento na velocidade dos movimentos", "MonkShirt": "20% de aumento nos danos por lacaios e por ataques físicos", "MonkStaffT1": "Aumenta de poder enquanto você esmaga seus inimigos", "MonkStaffT2": "Invoca fantasmas quando atinge inimigos", "MonkStaffT3": " enquanto segura para um ataque alternativo!", - "GolfClubRustyPutter": "{$CommonItemTooltip.GolfPutter}", - "IronCrateHard": "{$ItemTooltip.IronCrate}", + "SquireAltHead": "Aumenta o número máximo de sentinelas e concede 10% de danos por lacaios", + "SquireAltPants": "20% de aumento nos danos por lacaios, chance de acerto crítico e 30% de aumento na velocidade dos movimentos", "SquireAltShirt": "30% de aumento nos danos por lacaios e aumento enorme na regeneração de vida", - "GolfClubLeadPutter": "{$CommonItemTooltip.GolfPutter}", + "SquireGreatHelm": "Aumenta o número máximo de sentinelas e aumenta a regeneração de vida", "SquireGreaves": "15% de aumento nos danos por lacaios, 20% de aumento na chance de acerto físico crítico e na velocidade dos movimentos", "SquirePlating": "15% de aumento nos danos por lacaios e por ataques físicos", "ArkhalisShirt": "{$ItemTooltip.ArkhalisHat}", "ArkhalisPants": "{$ItemTooltip.ArkhalisHat}", - "LobsterTail": "{$CommonItemTooltip.MediumStats}", + "ArkhalisWings": "{$ItemTooltip.ArkhalisHat}", "ArkhalisHat": "{$CommonItemTooltip.DevItem}\n'Eu não encontrei isso na Rede'", "LeinforsHat": "{$CommonItemTooltip.DevItem}\n'Para manter esses cachinhos exuberantes ainda mais lindos'", "LeinforsShirt": "{$CommonItemTooltip.DevItem}\n'Sexy outra vez'", "LeinforsPants": "{$CommonItemTooltip.DevItem}\n'Shia surpreso! Não esperava isso de um par de calças, né?'", - "OceanCrateHard": "{$CommonItemTooltip.RightClickToOpen}", - "LeinforsAccessory": "{$CommonItemTooltip.DevItem}\n'Para melhores resultados, use com uma dieta das massas'", - "KiteSpectrum": "{$CommonItemTooltip.Kite}", - "KiteWanderingEye": "{$CommonItemTooltip.Kite}", - "KiteUnicorn": "{$CommonItemTooltip.Kite}", - "FairyQueenBossBag": "{$CommonItemTooltip.RightClickToOpen}", - "LavaCrate": "{$CommonItemTooltip.RightClickToOpen}", - "LavaCrateHard": "{$CommonItemTooltip.RightClickToOpen}", - "HotlineFishingHook": "{$CommonItemTooltip.LavaFishing}", - "LavaFishingHook": "{$CommonItemTooltip.LavaFishing}", - "TeleportationPylonJungle": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonPurity": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonHallow": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonUnderground": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonOcean": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonDesert": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonSnow": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonMushroom": "{$CommonItemTooltip.TeleportationPylon}", - "RockGolemBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.RockGolem}", - "BloodMummyBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodMummy}", - "SporeSkeletonBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.SporeSkeleton}", - "SporeBatBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.SporeBat}", - "LarvaeAntlionBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.LarvaeAntlion}", - "CrimsonBunnyBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CrimsonBunny}", - "CrimsonGoldfishBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CrimsonGoldfish}", - "CrimsonPenguinBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CrimsonPenguin}", - "BigMimicCorruptionBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BigMimicCorruption}", - "BigMimicCrimsonBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BigMimicCrimson}", - "BigMimicHallowBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BigMimicHallow}", - "MossHornetBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.MossHornet}", - "WanderingEyeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.WanderingEye}", - "CreativeWings": "{$CommonItemTooltip.FlightAndSlowfall}", - "RainbowWings": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressUpToBooster}", - "LongRainbowTrailWings": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}\n{$CommonItemTooltip.PressUpToBooster}" + "LeinforsWings": "{$CommonItemTooltip.DevItem}\n'Vale tudo! O que isso significa?!'", + "LeinforsAccessory": "{$CommonItemTooltip.DevItem}\n'Para melhores resultados, use com uma dieta das massas'" }, "CommonItemTooltip": { "SpecialCrafting": "Usado em criações especiais", "DevItem": "Ótimo para fingir que é um desenvolvedor!", "FlightAndSlowfall": "Permite o voo e desaceleração da queda", "RightClickToOpen": " para abrir", + "MinorStats": "Pequenas melhorias em todas as estatísticas", "BannerBonus": "Jogadores próximos recebem um bônus contra: ", "Counterweight": "Arremessa um contrapeso depois de atingir um inimigo com um ioiô", + "EtherianManaCost10": "Use 10 Mana de Éter para invocar mais de um", "MinuteDuration": "{0} minuto(s) de duração", "PlaceableOnXmasTree": "Pode ser usado em uma árvore de Natal", "RestoresLife": "Restaura {0} de vida", diff --git a/Localization/Content/pt-BR/Legacy.json b/Localization/Content/pt-BR/Legacy.json index dd42177..4ee12c4 100644 --- a/Localization/Content/pt-BR/Legacy.json +++ b/Localization/Content/pt-BR/Legacy.json @@ -33,6 +33,7 @@ "37": "Espalhando grama", "38": "Cultivando cactos", "39": "Plantando girassóis", + "3": "Jogando terra atrás de terra", "40": "Plantando árvores", "41": "Plantando ervas", "42": "Plantando ervas daninhas", @@ -72,8 +73,10 @@ "73": "Validando o mundo salvo:", "74": "A geleia está caindo do céu!", "75": "A geleia parou de cair do céu.", + "76": "Gerando estruturas.", "77": "Adicionando mais grama", "78": "Criando desertos", + "79": "Decorando paredes", "7": "Criando buracos aleatórios", "80": "Polindo o mármore", "81": "Criando granito", @@ -159,6 +162,7 @@ "167": "Sempre compre mais fio do que precisa!", "168": "Você verificou se o seu dispositivo está conectado à tomada?", "169": "Ah, sabe o que está faltando nesta casa? Mais luzes piscando.", + "17": "Fique de olho no prêmio, compre uma lente!", "170": "Você sabe que a noite é de Lua de Sangue quando o céu fica vermelho. Há algo nela que faz com que monstros apareçam.", "171": "Ei parceiro, você sabe onde encontro ervas da morte? Ah, por nada. Só pra saber mesmo.", "172": "Se você olhar para cima, verá que a Lua está vermelha agora.", @@ -177,8 +181,11 @@ "184": "Agora que tem algum minério, você terá que transformá-lo em uma barra para criar itens. Isto requer uma fornalha!", "185": "Você pode criar uma fornalha com tochas, madeira e pedra. Certifique-se de que está próximo a uma bancada de trabalho.", "186": "Você precisará de uma bigorna para criar a maioria dos objetos com barras de metal.", + "187": "Bigornas podem ser criadas com ferro ou compradas de comerciantes.", "188": "Há corações de cristal no submundo que podem ser utilizados para aumentar o nível máximo de sua vida. Você pode destruí-los com uma picareta.", + "189": "Se você juntar 5 estrelas caídas, elas poderão ser combinadas para se criar um item que aumentará sua capacidade mágica.", "19": "{PlayerName}, não é isso? Ouvi falar bem de você, colega!", + "190": "Estrelas caem no mundo inteiro à noite. Elas podem ser utilizadas de várias maneiras. Se vir uma, não deixe de pegá-la, pois desaparecem depois que o Sol nasce.", "191": "Há muitas maneiras diferentes de se atrair pessoas para morar em nossa cidade. Obviamente elas precisarão de um lar.", "192": "Para uma sala ser considerada um lar, ela precisa de uma porta, de uma cadeira, de uma mesa e de uma fonte de luz. Certifique-se de que a casa também tem paredes.", "193": "Não é possível que duas pessoas morem no mesmo lar. Além disso, se seu lar for destruído, elas procurarão por um novo lugar para morar.", @@ -197,6 +204,7 @@ "204": "Se você combinar lentes em um altar demoníaco, talvez seja possível encontrar uma maneira de invocar um monstro poderoso. Mas é melhor esperar anoitecer antes de fazer isso.", "205": "Você pode criar iscas para vermes com pedaços podres e pó infame. Certifique-se de que está em um local corrompido antes de usar.", "206": "Altares demoníacos normalmente podem ser encontrados na corrupção. Você terá que estar próximo para criar alguns itens.", + "207": "Você pode criar um gancho com corrente utilizando um gancho e 3 correntes. Esqueletos encontrados nas profundezas do subterrâneo normalmente carregam ganchos. Correntes podem ser feitas com barras de ferro.", "208": "Se vir um pote, não deixe de quebrá-lo. Eles contém todo tipo de suprimento.", "209": "Há tesouros escondidos no mundo inteiro. Coisas impressionantes podem ser encontradas nas profundezas do subterrâneo!", "21": "Você falou Estátua do Anjo? Desculpe, mas não negocio com lixo.", @@ -402,6 +410,7 @@ "400": "Já está mendigando?! Não olha para mim como se eu fosse mudar de ideia da noite pro dia! ", "401": "Destrua todo altar de carmim que você encontrar. Algo bom vai acontecer se você fizer isso!", "402": "Altares de Carmim normalmente são encontrados no carmim. Você terá que estar próximo para criar alguns itens.", + "403": "Você pode criar uma espinha sangrenta com vértebras. Certifique-se de que está em uma área carmim antes de usar.", "41": "Deixe de ser um bebezinho! Já vi piores.", "42": "Você vai levar pontos!", "43": "Problema com valentões de novo?", @@ -435,6 +444,7 @@ "69": "Você tentou utilizar o pó de purificação na pedra negra da corrupção?", "7": "Em breve a noite cairá, colega. Faça suas escolhas enquanto ainda pode.", "70": "Eu gostaria que {ArmsDealer} parasse de flertar comigo. Será que ele não percebe que eu tenho 500 anos de idade?", + "71": "Por que {Merchant} continua tentando me vender estátuas de anjos? Todo mundo sabe que elas não fazem nada.", "72": "Você viu o velho caminhando pelo calabouço? Ele não parece estar bem...", "73": "Eu vendo o que eu quiser! Se você não gosta, problema seu.", "74": "Por que você quer tanto brigar numa hora destas?", @@ -595,6 +605,7 @@ "213": "Prioridade do Cursor Inteligente: Picareta -> Machado", "214": "Prioridade do Cursor Inteligente: Machado -> Picareta", "215": "Posicionamento de Blocos Inteligente: Para o Cursor", + "216": "Posicionamento de Blocos Inteligente: Preenchimento", "217": "Cor da Borda", "218": "Cursor", "219": "Controle", @@ -639,7 +650,10 @@ "26": "Softcore", "27": "Aleatório", "28": "Criar", + "29": "Personagens no modo Hardcore têm morte definitiva", "2": "Desconectar", + "30": "Personagens no modo Mediumcore perdem os itens ao morrer", + "31": "Personagens no modo Softcore perdem dinheiro ao morrer", "32": "Selecione a dificuldade", "33": "Camisa", "34": "Camiseta de baixo", @@ -790,6 +804,7 @@ "17": "{0} juntou-se ao grupo amarelo.", "18": "Boas-vindas a", "19": "{0} entrou.", + "1": "Senha incorreta.", "20": "{0} saiu.", "21": "/jogadores", "22": "{0} entrou no grupo cor-de-rosa.", @@ -888,6 +903,7 @@ "82": "Voltar", "83": "Favorito", "84": "Você não pode alterar equipes dentro dos blocos da sua equipe!", + "85": "Inseto", "86": "Pato", "87": "Borboleta", "88": "Vagalume", @@ -1035,6 +1051,7 @@ "LegacyChestType": { "0": "Baú", "10": "Baú de Hera", + "11": "Baú de Gelo", "12": "Baú de Madeira Viva", "13": "Baú Celeste", "14": "Baú de Madeira Escura", @@ -1046,10 +1063,12 @@ "1": "Baú de Ouro", "20": "Baú de Carmim", "21": "Baú Consagrado", + "22": "Baú Congelado", "23": "Baú da Selva Bloqueado", "24": "Baú Corrompido Bloqueado", "25": "Baú de Carmim Bloqueado", "26": "Baú Consagrado Bloqueado", + "27": "Baú Congelado Bloqueado", "28": "Baú da Dinastia", "29": "Baú de Mel", "2": "Baú de Ouro Bloqueado", @@ -1115,29 +1134,10 @@ "28": "{$ItemName.CrystalDresser}", "29": "{$ItemName.DynastyDresser}", "30": "{$ItemName.FrozenDresser}", - "31": "{$ItemName.LivingWoodDresser}", - "32": "{$ItemName.SpiderDresser}", - "33": "{$ItemName.LesionDresser}", - "34": "{$ItemName.SolarDresser}", - "35": "{$ItemName.VortexDresser}", - "36": "{$ItemName.NebulaDresser}", - "37": "{$ItemName.StardustDresser}", - "38": "{$ItemName.SandstoneDresser}", - "39": "{$ItemName.BambooDresser}" + "31": "{$ItemName.LivingWoodDresser}" }, "LegacyChestType2": { - "1": "{$ItemName.GoldenChest}", - "0": "{$ItemName.CrystalChest}", - "2": "{$ItemName.SpiderChest}", - "3": "{$ItemName.LesionChest}", - "4": "{$ItemName.GoldChest}", - "5": "{$ItemName.SolarChest}", - "6": "{$ItemName.VortexChest}", - "7": "{$ItemName.NebulaChest}", - "8": "{$ItemName.StardustChest}", - "9": "{$ItemName.GolfChest}", - "10": "{$ItemName.DesertChest}", - "11": "{$ItemName.BambooChest}", - "12": "{$ItemName.DungeonDesertChest}" + "0": "Baú de Cristal", + "1": "Baú de Ouro" } } \ No newline at end of file diff --git a/Localization/Content/pt-BR/NPCs.json b/Localization/Content/pt-BR/NPCs.json index 7e8f2d2..8af3a18 100644 --- a/Localization/Content/pt-BR/NPCs.json +++ b/Localization/Content/pt-BR/NPCs.json @@ -68,6 +68,7 @@ "Vampire": "Vampiro", "MotherSlime": "Geleia Mãe", "Truffle": "Trufa", + "ZombieEskimo": "Esquimó Zumbi", "Frankenstein": "Frankenstein", "BlackRecluse": "Aranha Reclusa Negra", "WallCreeper": "Aranha Trepadeira", @@ -308,7 +309,9 @@ "SleepingAngler": "Pescador Adormecido", "Grasshopper": "Gafanhoto", "ChatteringTeethBomb": "Bomba de Dentes Falsos", + "CultistArcherBlue": "Arqueiro Cultista Azul", "Demolitionist": "Especialista em Demolição", + "CultistArcherWhite": "Arqueiro Cultista Branco", "BrainScrambler": "Embaralhador de Cérebros", "RayGunner": "Atirador de Raios", "MartianOfficer": "Oficial de Marte", @@ -335,6 +338,7 @@ "Hornet": "Vespa", "ManEater": "Devorador de Homens", "ArmedZombie": "Zumbi", + "ArmedZombieEskimo": "Esquimó Zumbi", "ArmedZombiePincussion": "Zumbi", "ArmedZombieSlimed": "Zumbi", "ArmedZombieSwamp": "Zumbi", @@ -424,9 +428,12 @@ "Crawdad": "Caranguejo-Pai", "Crawdad2": "Caranguejo-Pai", "CreatureFromTheDeep": "Criatura das Profundezas", + "CrimsonBunny": "Coelhinho de Carmim", + "CrimsonGoldfish": "Peixe-dourado de Carmim", "CrimsonPenguin": "Pinguim Terrível", "CultistBoss": "Cultista Lunático", "CultistBossClone": "Cultista Lunático", + "CultistDevote": "Devoto Lunático", "CultistDragonBody1": "Dragão Fantasma", "CultistDragonBody2": "Dragão Fantasma", "CultistDragonBody3": "Dragão Fantasma", @@ -459,7 +466,7 @@ "DuneSplicerHead": "Verme Maldito", "DuneSplicerTail": "Verme Maldito", "EnchantedNightcrawler": "Nightcrawler Encantado", - "GiantFlyingAntlion": "Formiga-leão Voadora", + "FlyingAntlion": "Formiga-leão Voadora", "Fritz": "Fritz", "GiantShelly": "Shelly Gigante", "GiantShelly2": "Shelly Gigante", @@ -507,6 +514,7 @@ "SandsharkCrimson": "Ladrão de Carne", "SandsharkHallow": "Moedor de Cristal", "SandSlime": "Geleia de Areia", + "ShadowFlameApparition": "Aparição das Chamas das Sombras", "SlimeSpiked": "Geleia com Espinhos", "Sluggy": "Lesminha", "SolarFlare": "Chamas do Sol", @@ -534,7 +542,7 @@ "VortexLarva": "Larva Alienígena", "VortexRifleman": "Mergulhador da Tempestade", "VortexSoldier": "Filho do Vórtice", - "GiantWalkingAntlion": "Formiga-leão Corredora", + "WalkingAntlion": "Formiga-leão Corredora", "DD2GoblinBomberT2": "{$NPCName.DD2GoblinBomberT1}", "DD2WyvernT3": "{$NPCName.DD2WyvernT1}", "DD2WyvernT2": "{$NPCName.DD2WyvernT1}", diff --git a/Localization/Content/pt-BR/Projectiles.json b/Localization/Content/pt-BR/Projectiles.json index 14e0e13..5a81dcb 100644 --- a/Localization/Content/pt-BR/Projectiles.json +++ b/Localization/Content/pt-BR/Projectiles.json @@ -713,10 +713,6 @@ "MonkStaffT3": "Fúria do Dragão Celeste", "MonkStaffT3_Alt": "Fúria do Dragão Celeste", "MonkStaffT3_AltShot": "Fúria do Dragão Celeste", - "DD2JavelinHostileT3": "{$ProjectileName.DD2JavelinHostile}", - "Celeb2Rocket": "{$ProjectileName.Celeb2Weapon}", - "Celeb2RocketExplosive": "{$ProjectileName.Celeb2Weapon}", - "Celeb2RocketLarge": "{$ProjectileName.Celeb2Weapon}", - "Celeb2RocketLargeExplosive": "{$ProjectileName.Celeb2Weapon}" + "DD2JavelinHostileT3": "{$ProjectileName.DD2JavelinHostile}" } } \ No newline at end of file diff --git a/Localization/Content/pt-BR/Town.json b/Localization/Content/pt-BR/Town.json index 4428ad1..b7b247f 100644 --- a/Localization/Content/pt-BR/Town.json +++ b/Localization/Content/pt-BR/Town.json @@ -49,6 +49,7 @@ "Party": "Você acha que alguém se importaria se eu usasse lâmpadas ao invés de velas em um bolo?" }, "BartenderSpecialText": { + "Party": "Eu preciso mesmo de um texto de aniversário, Yorai!", "AfterDD2Tier1": "Bom trabalho na batalha contra o Exército do Ancião! Mas eu tenho certeza que esse não foi o seu fim, eles não se esforçaram muito dessa vez.", "AfterDD2Tier2": "O Exército do Ancião não para de ficar mais forte, mas você continua detendo-os! Mas algo me diz que eles ainda não desistiram.", "AfterDD2Tier3": "Você conseguiu mesmo derrotar o Exército do Ancião? Talvez devesse visitar Etheria algum dia.", @@ -74,9 +75,15 @@ "Party": "Minhas festas são, claramente, as mais mágicas.", "AfterDD2Tier1": "Sabe, acho que já vi um portal assim antes, mas era feito de ouro." }, + "SteampunkerSpecialText": { + "Party": "Todo mundo disse que gosta de bolos altos, então eu instalei uma chaminé no meu." + }, "CyborgSpecialText": { "Party": "Esta festa vai ser loucura completa!" }, + "SantaClausSpecialText": { + "Party": "Ora, você não achou que eu só fazia festa no Natal, achou?" + }, "DemolitionistSpecialText": { "Party": "Talvez seja melhor tomar cuidado hoje. Nós, anões, damos umas festas bem explosivas.", "AfterDD2Start": "Por quê nós não simplesmente explodimos esses portais?" @@ -109,6 +116,7 @@ "Quest_Catfish": "Finalmente encontrei um gato selvagem que gosta de água! Acho que deve ser porque ele é parte peixe. Eu não sei por que isso aconteceu, nem quero saber. Eu só quero ele nas minhas mãos, e rápido!\n\n(Capturado na Superfície da Selva)", "Quest_Cloudfish": "Existe um boato de que há ilhas que voam pelo céu, com tesouros incríveis! Mas quem se importa com isso, o mais legal é que às vezes surgem lagos nas nuvens, e nesses lagos há peixes feitos de nuvem! Eu quero saber que sabor eles têm, então é melhor você ir pegar um para mim!\n\n(Capturado em Lagos Celestes)", "Quest_Cursedfish": "Há um peixe amaldiçoado nadando nas profundezas das águas corrompidas! Ele foi criado nas chamas amaldiçoadas que nascem das coisas aterrorizantes que vivem no fundo. Dizem que nem mesmo água é capaz de apagar este fogo, e que ele pode queimar para sempre. Já posso imaginar as coisas incríveis que eu poderia fazer com um peixe assim! Você vai lá buscar para mim ou vai ficar aí tremendo de medo!?\n\n(Capturado na Corrupção)", + "Quest_Dirtfish": "Eu estava puxando o grandão quando apareceu um zumbi falante engraçado do lago na floresta, dizendo algo sobre uma espécie de peixe 'feroz', feito de lama! Ele disse que o peixe era capaz de sufocar dez caras do tamanho dele, ou algo parecido... Eu quero ele! AGORA!\n\n(Capturado na Superfície, no Submundo, e nas Cavernas)", "Quest_DynamiteFish": "O especialista em demolição estava bem nervoso porque havia perdido uma dinamite no lago, na floresta. Ele tem tantas, por que uma faria tanta diferença? Aparentemente porque a dinamite criou barbatanas e começou a nadar! Não sei onde ele encontra materiais para fazer coisas assim mas esse está claramente possuído! Pesque-o e traga-o para mim, eu sempre quis ter um peixe-bomba! Só não pergunte por quê...\n\n(Capturado na Superfície)", "Quest_EaterofPlankton": "Aposto que você não vai ter coragem de encontrar o Devorador de Plâncton. Um peixe corrompido que nasceu de um pedaço do Devorador de Mundos! Capture-o e traga-o para mim, prove que não é um covarde!\n\n(Capturado na Corrupção)", "Quest_FallenStarfish": "Eu adoro colecionar estrelas brilhantes e amarelinhas que caem do céu! Adoro ainda mais quando caem na cabeça de alguém. Mas... mas... nada é melhor que uma estrela que cai em um lago na floresta e se transforma em um peixe! Isso é maneiro demais, e você é maneiro suficiente para ir buscá-lo para mim!\n\n(Capturado em Lagos Celestes)", @@ -127,7 +135,7 @@ "Quest_GuideVoodooFish": "Aqueles demônios no submundo gostam mesmo de bonecas vodu, mas eu acho que há uma boneca por aí que recebeu magia demais! Ela transformou-se em um peixe e começou a agir sozinha. Duvido que você consiga trazer uma para mim! Eu tomaria cuidado com a lava se fosse você, porque ela queima até você morrer e assim você não vai conseguiu pegar meu peixe!\n\n(Capturado nas Cavernas)", "Quest_Wyverntail": "Eu sei de uma coisa que vocêeeeeee não sabe! Tudo bem, eu vou dizer. Há uma criatura aterrorizante que voa entre as estrelas! Eu não estou inventando! É a Serpe! Mas, mas, você já sabia disso, não é? Bem, o que você não sabe é que elas nascem e crescem como girinos! Então, na verdade, elas são... um sapo! Não fique parado, pegue uma para mim!\n\n(Capturado em Lagos Celestes)", "Quest_ZombieFish": "Você não vai acreditar! Peguei um peixe na floresta à noite que já estava morto! Então ele tentou me devorar! Eu o joguei fora e fugi! Agora eu quero colocá-lo no armário de alguém, para ver o que acontece. Vá pescá-lo outra vez para mim, tá bom?!\n\n(Capturado na Superfície)", - "Quest_AmanitaFungifin": "Encontrei este lugar espetacular, repleto de cogumelos brilhantes! Tudo era azul! EU estava pegando alguns cogumelos que encontrei perto de um lago azul brilhante quando um dos cogumelos irritou-se comigo e foi embora! Eu quero que ele prove do próprio veneno, depois vou devorá-lo! O que eu quero dizer é, vá pegar ele para mim!\n\n(Capturado em Campos de Cogumelos Brilhantes)", + "Quest_AmanitiaFungifin": "Encontrei este lugar espetacular, repleto de cogumelos brilhantes! Tudo era azul! EU estava pegando alguns cogumelos que encontrei perto de um lago azul brilhante quando um dos cogumelos irritou-se comigo e foi embora! Eu quero que ele prove do próprio veneno, depois vou devorá-lo! O que eu quero dizer é, vá pegar ele para mim!\n\n(Capturado em Campos de Cogumelos Brilhantes)", "Quest_Angelfish": "Você sabia que há ilhas mágicas que ficam suspensas no céu? Aposto que você não sabia! Dizem que anjos vivem no céu, e eu acredito que esse anjos tenham barbatanas e guelras, e que eles ficam nadando por aí! Eu acredito que você deve pegar um para mim!\n\n(Capturado em Lagos Celestes)", "Quest_BloodyManowar": "Oh! Não venha para perto de mim! Levei uma picada de uma Caravela Sangrenta! Se você não for inteligente o suficiente para saber do que estou falando, é a água-viva mais perigosa de todo o {WorldName}! Vá até o carmim apodrecido e pegue uma, se tiver coragem! \n\n(Capturada no Carmesim)", "Quest_Bonefish": "Eu normalmente não me importo ao ver ossos de peixes flutuando na água, mas estes estavam nadando! O que foi, você achou que só esqueletos humanos podiam continuar perambulando pelo {WorldName}? Capture-o para mim, quero colocá-lo na cama de alguém!\n\n(Capturado no Submundo e nas Cavernas)", @@ -139,6 +147,7 @@ "Quest_Fishron": "Diz a lenda que existe uma poderosa criatura chamada Peixe-Dragão! Ela é parte porco, parte dragão e parte PEIXE! Ouvi dizer que ela vive perto dos lagos congelados do submundo, na parte mais fria do mundo! Eu não vou lá, então VOCÊ vai garantir que ele venha parar nas minhas mãos! Que emocionante!\n\n(Capturado na Tundra Subterrânea)", "Quest_InfectedScabbardfish": "Um peixe muito longo, que parece uma bainha, nada nas corrompidas águas obscuras! Ele parece muito com pedras de ébano, tome cuidado para não ser enganado! É isso mesmo, você. Você que vai pegá-lo, eu não!\n\n(Capturado na Corrupção)", "Quest_Mudfish": "Cuidado por onde anda quando estiver atravessando as águas da selva! Por quê? Não, não é porque eu tenho medo que você seja devorado por piranhas. Eu tenho medo que você pise em um dos meus tipos de peixe favoritos, o Peixe de Lama! Também tenho medo que você esqueça de trazer um para mim!\n\n(Capturado na Selva)", + "Quest_Slimefish": "Na floresta, as melecas são meio nojentas. Os peixes-geleia são ainda mais! Eu não quero nadar com melecas, então arranque um de lá para mim!\n\n(Capturado em Qualquer Lugar)", "Quest_TropicalBarracuda": "Piranhas e tubarões são feios! Tãaaao feio! Você sabia que existe um peixe que, além de ser bonito, é capaz de arrancar o seu rosto? Eu pagaria 2 platinas para ver isso acontecer... Mas voltando ao assunto, você vai pegar um para mim. Só traga ele antes que devore seu rosto!\n\n(Capturado na Superfície da Selva)", "Quest_TundraTrout": "Você sabe por que os lagos na superfície das terras gélidas de {WorldName} nunca congelam? Eu não. Mas os peixes sabem! Um peixe feito de gelo seria uma ótima oferenda ao poderoso e incrível {Angler}! Vá, fiel servo, e traga-me rápido esta Truta da Tundra!\n\n(Capturado na Tundra da Superfície)" }, diff --git a/Localization/Content/ru-RU.json b/Localization/Content/ru-RU.json index 8c4677e..846a2e8 100644 --- a/Localization/Content/ru-RU.json +++ b/Localization/Content/ru-RU.json @@ -46,6 +46,7 @@ "48": "Terraria 2: электрик-бугалу", "49": "Terraria: также сыграйте в Minecraft!", "5": "Terraria: сказка о кроликах", + "50": "Terraria: на грани пространства!", "51": "Terraria: я просто хочу знать, где золото?", "52": "Terraria: теперь еще больше уток!", "53": "Terraria: 9 + 1 = 11", @@ -231,6 +232,7 @@ "TIMBER_Name": "Древесина!!!", "TIN_FOIL_HATTER_Description": "Отразите нашествие марсиан — эти пришельцы с другого мира пришли, чтобы вскрыть ваши мозги и ставить на вас другие неприятные эксперименты.", "TIN_FOIL_HATTER_Name": "Ненавистник жестянок", + "TOPPED_OFF_Description": "Получите максимально возможное количество здоровья и маны с помощью аксессуаров или усилений.", "TOPPED_OFF_Name": "Под завязку", "TROUT_MONKEY_Description": "Выполните 25 заданий для рыбака.", "TROUT_MONKEY_Name": "Любитель порыбачить", @@ -244,6 +246,7 @@ "WHERES_MY_HONEY_Name": "Где мистер Мед?", "WINTERHEARTED_Description": "Победите Ледяную королеву — чокнутую ведьму из самых холодных ночей.", "WINTERHEARTED_Name": "Зима на сердце", + "WORM_FODDER_Description": "Победите пожирателя миров — огромного червя, живущего в Порче.", "WORM_FODDER_Name": "Пища для червей", "YOU_AND_WHAT_ARMY_Description": "Управляйте девятью призванными прислужниками одновременно.", "YOU_AND_WHAT_ARMY_Name": "Ты и армия?", @@ -330,6 +333,7 @@ "Server": "Сервер Terraria {0}", "ServerMessage": " {0}", "ServerStarted": "Сервер запущен", + "SetInitialMaxPlayers": "Максимум игроков (нажмите Enter, чтобы выбрать 8): ", "SetInitialPort": "Порт сервера (нажмите Enter, чтобы выбрать 7777): ", "SetMOTD_Command": "сообщение дня", "SetMOTD_Description": "Изменить сообщение дня.", @@ -370,6 +374,7 @@ }, "Error": { "BadHeaderBufferOverflow": "Bad header lead to a read buffer overflow.", + "CaptureError": "При сохранении снимка произошла ошибка. Повтор попытки...", "DataSentAfterConnectionLost": "Попытка отправки данных клиенту после разрыва соединения", "Error": "Ошибка", "ExceptionNormal": " Exception normal: {0}", @@ -428,9 +433,7 @@ "YellowWires": "Желтые провода", "BirthdayParty_1": "Похоже, {0} устраивает вечеринку", "BirthdayParty_2": "Похоже, {0} и {1} устраивают вечеринку", - "BirthdayParty_3": "Похоже, {0}, {1} и {2} устраивают вечеринку", - "RespawnInPrefix": "", - "RespawnInSuffix": "{0}" + "BirthdayParty_3": "Похоже, {0}, {1} и {2} устраивают вечеринку" }, "GameUI": { "ActuationDeviceOff": "Устройство активации ВЫКЛ.", @@ -447,6 +450,7 @@ "CompassCenter": "Центр", "CompassEast": "{0} на восток", "CompassWest": "{0} на запад", + "CraftingWindow": "Окно изготовления", "Depth": "{0}", "DepthLevel": "Уровень", "Disabled": "Отключено", @@ -490,11 +494,12 @@ "PartlyCloudy": "Местами облачно", "PlayerDistance": "({0} ф.)", "PrecentFishingPower": "Мастерство рыбалки {0} %", + "QuickStackToNearby": "Быстрая стопка в ближайшие сундуки", "Rain": "Дождь", "RulerOff": "Линейка ВЫКЛ.", "RulerOn": "Линейка ВКЛ.", "SettingsMenu": "Меню настроек", - "OpenFileFolder": "{$LegacyInterface.110}", + "SortInventory": "Сортировка инвентаря", "Speed": "{0} миль в час", "StormEffects": "Эффекты шторма: {0}", "ThirdQuarter": "Третья четверть", @@ -579,8 +584,8 @@ "MoveToCloud": "Переместить в облако", "New": "Новое", "Normal": "Обычная", - "LightMode_White": "{$LegacyMenu.56}", - "LightMode_Color": "{$LegacyMenu.55}", + "NormalDescription": "(стандартная игра Terraria)", + "NormalDescriptionFlavor": "Ваши приключения начинаются...", "Play": "Играть", "RestoreButton": "Восстановить", "Save": "Сохранить", @@ -603,10 +608,7 @@ "SeedCopied": "Семечко скопировано", "ZoomIn": "{$LegacyMenu.168}", "ZoomOut": "{$LegacyMenu.169}", - "Ellipsis": "...", - "LightMode_Retro": "{$LegacyMenu.57}", - "LightMode_Trippy": "{$LegacyMenu.58}", - "PlayerEmptyName": "{$Net.EmptyName}" + "Ellipsis": "..." }, "DeathSource": { "NPC": "{0} игроком {1}.", @@ -628,6 +630,7 @@ "Lava_3": "Игрок {0} попытался плавать в лаве.", "Lava_4": "Игрок {0} любит играть в магме.", "Petrified_1": "{0} разлетелся на куски", + "Petrified_2": "Игрока {0} больше нельзя собрать вместе.", "Petrified_3": "Игрока {0} нужно смести в кучу.", "Petrified_4": "Игрок {0} стал еще одной кучкой мусора.", "Poisoned": "Игрок {0} не смог найти противоядие.", @@ -690,8 +693,5 @@ "Chinese": "简体中文 (Китайский упрощенный)", "Portuguese": "Português brasileiro (Португальский (бразильский))", "Polish": "Polski (Польский)" - }, - "RandomWorldName_Composition": { - "6": "{Adjective} {Location}" } } \ No newline at end of file diff --git a/Localization/Content/ru-RU/Game.json b/Localization/Content/ru-RU/Game.json index 968ff78..6ab6bbb 100644 --- a/Localization/Content/ru-RU/Game.json +++ b/Localization/Content/ru-RU/Game.json @@ -15,6 +15,9 @@ "AdamantiteCaster": "Снижает использование маны на 19 %", "AdamantiteMelee": "Увеличивает скорость ближнего боя и передвижения на 18 %", "AdamantiteRanged": "Шанс 25 % не потратить боеприпасы", + "HallowCaster": "Снижает использование маны на 20 %", + "HallowMelee": "Увеличивает скорость ближнего боя и передвижения на 19 %", + "HallowRanged": "Шанс 25 % не потратить боеприпасы", "ShadowScale": "Увеличивает скорость движения на 15 %", "Wood": "1 ед. защиты", "Crimson": "Значительно ускоряет восстановление жизни", @@ -25,6 +28,7 @@ "Titanium": "Получение невосприимчивости после удара по врагу", "Chlorophyte": "Призывает мощный лиственный кристалл, который стреляет в ближайших врагов", "Wizard": "Увеличивает шанс критического магического урона на 10 %", + "Turtle": "Атакующие получают в ответ столько же урона", "Meteor": "Космическая пушка стоит 0 маны", "SpectreHealing": "Игроки с наименьшим количеством здоровья исцеляются на значение магического урона, нанесенного врагам", "Shroomite": "Неподвижность дает невидимость,\nчто увеличивает дистанционные способности и снижает шанс врагов попасть в вас", @@ -36,8 +40,13 @@ "BeetleDefense": "Жуки защищают вас от урона", "BeetleDamage": "Жуки увеличивают вашу скорость и урон в ближнем бою", "Bee": "Увеличивает урон питомца на 10 %", + "Bone": "Шанс 20 % не потратить боеприпасы", "Spider": "Увеличивает урон питомца на 12 %", + "Ninja": "Шанс 33 % не потратить бросаемый предмет", + "Fossil": "Шанс 50 % не потратить бросаемый предмет", + "Solar": "Вырабатываются солнечные щиты, которые защищают вас,\nи вы можете потратить один заряд щита, чтобы атаковать врагов", "Vortex": "Дважды коснитесь {0}, чтобы включить невидимость,\nкоторая увеличивает дистанционные способности и снижает шанс врагов попасть в вас, но уменьшает вашу скорость движения", + "Nebula": "При нанесении врагам урона существует шанс выпадения усилителей.\nУсилители одного типа могут накапливаться, увеличивая усиление.", "Stardust": "Дважды коснитесь {0}, чтобы направить вашего охранника в нужное место", "Forbidden": "Дважды коснитесь {0}, чтобы вызвать старинный шторм в место курсора", "Jungle": "Снижает использование маны на 16 %", @@ -88,7 +97,7 @@ "Builder": "Увеличивает скорость и дистанцию укладки блоков", "BunnyMount": "Вам очень хочется морковки", "Burning": "Потеря жизни и замедленное движение", - "DesertMinecartRight": "{$BuffDescription.MinecartRight}", + "Calm": "Снижает агрессивность врагов", "Campfire": "Восстановление жизни немного ускорено", "ChaosState": "При использовании жезла раздора расходуется жизнь", "Chilled": "Скорость движения снижена", @@ -116,7 +125,7 @@ "FairyGreen": "За вами следует фея", "FairyRed": "За вами следует фея", "Featherfall": "Нажми ВВЕРХ или ВНИЗ, чтобы контролировать скорость спуска", - "DesertMinecartLeft": "{$BuffDescription.MinecartLeft}", + "Fishing": "Увеличивает навык рыбной ловли", "Flipper": "Движение, как в обычной воде", "Frostburn": "Либо очень горячее, либо очень холодное. В любом случае, это ОЧЕНЬ больно", "Frozen": "Вы не можете двигаться!", @@ -178,7 +187,7 @@ "PetDD2Gato": "За вами следует котопропеллер", "PetDD2Ghost": "За вами следует огонек", "PetLizard": "Холодный как рептилия", - "FishMinecartRight": "{$BuffDescription.MinecartRight}", + "PetParrot": "Полли хочет крекер", "PetSapling": "За вами следует растеньице", "PetSpider": "За вами следует паук", "PetTurtle": "Счастливое черепашье время!", @@ -250,7 +259,7 @@ "WeaponImbuePoison": "Ближние атаки отравляют врагов", "WeaponImbueVenom": "Ближние атаки накладывают на ваши цели эффект яда", "Webbed": "Вы застряли", - "FishMinecartLeft": "{$BuffDescription.MinecartLeft}", + "WellFed": "Немного повышает все характеристики", "Werewolf": "Физические способности повышены", "Wet": "С вас капает вода", "WindPushed": "Вас сдвигает ветер!", @@ -258,45 +267,7 @@ "WitheredArmor": "Ваша броня снижена!", "WitheredWeapon": "Ваши атаки ослаблены!", "Wrath": "Увеличивает урон на 10 %", - "ZephyrFish": "Любит плавать вокруг вас", - "BeeMinecartRight": "{$BuffDescription.MinecartRight}", - "BeeMinecartLeft": "{$BuffDescription.MinecartLeft}", - "LadybugMinecartRight": "{$BuffDescription.MinecartRight}", - "LadybugMinecartLeft": "{$BuffDescription.MinecartLeft}", - "PigronMinecartRight": "{$BuffDescription.MinecartRight}", - "PigronMinecartLeft": "{$BuffDescription.MinecartLeft}", - "SunflowerMinecartRight": "{$BuffDescription.MinecartRight}", - "SunflowerMinecartLeft": "{$BuffDescription.MinecartLeft}", - "HellMinecartRight": "{$BuffDescription.MinecartRight}", - "HellMinecartLeft": "{$BuffDescription.MinecartLeft}", - "ShroomMinecartRight": "{$BuffDescription.MinecartRight}", - "ShroomMinecartLeft": "{$BuffDescription.MinecartLeft}", - "AmethystMinecartRight": "{$BuffDescription.MinecartRight}", - "AmethystMinecartLeft": "{$BuffDescription.MinecartLeft}", - "TopazMinecartRight": "{$BuffDescription.MinecartRight}", - "TopazMinecartLeft": "{$BuffDescription.MinecartLeft}", - "SapphireMinecartRight": "{$BuffDescription.MinecartRight}", - "SapphireMinecartLeft": "{$BuffDescription.MinecartLeft}", - "EmeraldMinecartRight": "{$BuffDescription.MinecartRight}", - "EmeraldMinecartLeft": "{$BuffDescription.MinecartLeft}", - "RubyMinecartRight": "{$BuffDescription.MinecartRight}", - "RubyMinecartLeft": "{$BuffDescription.MinecartLeft}", - "DiamondMinecartRight": "{$BuffDescription.MinecartRight}", - "DiamondMinecartLeft": "{$BuffDescription.MinecartLeft}", - "AmberMinecartRight": "{$BuffDescription.MinecartRight}", - "AmberMinecartLeft": "{$BuffDescription.MinecartLeft}", - "BeetleMinecartRight": "{$BuffDescription.MinecartRight}", - "BeetleMinecartLeft": "{$BuffDescription.MinecartLeft}", - "MeowmereMinecartRight": "{$BuffDescription.MinecartRight}", - "MeowmereMinecartLeft": "{$BuffDescription.MinecartLeft}", - "PartyMinecartRight": "{$BuffDescription.MinecartRight}", - "PartyMinecartLeft": "{$BuffDescription.MinecartLeft}", - "PirateMinecartRight": "{$BuffDescription.MinecartRight}", - "PirateMinecartLeft": "{$BuffDescription.MinecartLeft}", - "SteampunkMinecartRight": "{$BuffDescription.MinecartRight}", - "SteampunkMinecartLeft": "{$BuffDescription.MinecartLeft}", - "CoffinMinecartRight": "{$BuffDescription.MinecartRight}", - "CoffinMinecartLeft": "{$BuffDescription.MinecartLeft}" + "ZephyrFish": "Любит плавать вокруг вас" }, "BuffName": { "AmmoBox": "Ящик с боеприпасами", @@ -439,7 +410,7 @@ "Regeneration": "Регенерация", "Rudolph": "Рудольф", "ScutlixMount": "Ездовой скутликс", - "DesertMinecartRight": "{$BuffName.MinecartRight}", + "ShadowDodge": "Теневое уклонение", "ShadowFlame": "Теневое пламя", "ShadowOrb": "Сфера тени", "SharknadoMinion": "Акулонадо", @@ -502,48 +473,7 @@ "WitheredArmor": "Усохшие доспехи", "WitheredWeapon": "Усохшее оружие", "Wrath": "Месть", - "ZephyrFish": "Рыба-зефир", - "DesertMinecartLeft": "{$BuffName.MinecartLeft}", - "FishMinecartRight": "{$BuffName.MinecartRight}", - "FishMinecartLeft": "{$BuffName.MinecartLeft}", - "BeeMinecartRight": "{$BuffName.MinecartRight}", - "BeeMinecartLeft": "{$BuffName.MinecartLeft}", - "LadybugMinecartRight": "{$BuffName.MinecartRight}", - "LadybugMinecartLeft": "{$BuffName.MinecartLeft}", - "PigronMinecartRight": "{$BuffName.MinecartRight}", - "PigronMinecartLeft": "{$BuffName.MinecartLeft}", - "SunflowerMinecartRight": "{$BuffName.MinecartRight}", - "SunflowerMinecartLeft": "{$BuffName.MinecartLeft}", - "HellMinecartRight": "{$BuffName.MinecartRight}", - "HellMinecartLeft": "{$BuffName.MinecartLeft}", - "ShroomMinecartRight": "{$BuffName.MinecartRight}", - "ShroomMinecartLeft": "{$BuffName.MinecartLeft}", - "AmethystMinecartRight": "{$BuffName.MinecartRight}", - "AmethystMinecartLeft": "{$BuffName.MinecartLeft}", - "TopazMinecartRight": "{$BuffName.MinecartRight}", - "TopazMinecartLeft": "{$BuffName.MinecartLeft}", - "SapphireMinecartRight": "{$BuffName.MinecartRight}", - "SapphireMinecartLeft": "{$BuffName.MinecartLeft}", - "EmeraldMinecartRight": "{$BuffName.MinecartRight}", - "EmeraldMinecartLeft": "{$BuffName.MinecartLeft}", - "RubyMinecartRight": "{$BuffName.MinecartRight}", - "RubyMinecartLeft": "{$BuffName.MinecartLeft}", - "DiamondMinecartRight": "{$BuffName.MinecartRight}", - "DiamondMinecartLeft": "{$BuffName.MinecartLeft}", - "AmberMinecartRight": "{$BuffName.MinecartRight}", - "AmberMinecartLeft": "{$BuffName.MinecartLeft}", - "BeetleMinecartRight": "{$BuffName.MinecartRight}", - "BeetleMinecartLeft": "{$BuffName.MinecartLeft}", - "MeowmereMinecartRight": "{$BuffName.MinecartRight}", - "MeowmereMinecartLeft": "{$BuffName.MinecartLeft}", - "PartyMinecartRight": "{$BuffName.MinecartRight}", - "PartyMinecartLeft": "{$BuffName.MinecartLeft}", - "PirateMinecartRight": "{$BuffName.MinecartRight}", - "PirateMinecartLeft": "{$BuffName.MinecartLeft}", - "SteampunkMinecartRight": "{$BuffName.MinecartRight}", - "SteampunkMinecartLeft": "{$BuffName.MinecartLeft}", - "CoffinMinecartRight": "{$BuffName.MinecartRight}", - "CoffinMinecartLeft": "{$BuffName.MinecartLeft}" + "ZephyrFish": "Рыба-зефир" }, "MapObject": { "Adamantite": "Адамантит", @@ -615,166 +545,5 @@ "Roll": "{$LegacyMultiplayer.8}", "Party": "/в", "Emote": "/я" - }, - "Bestiary_ItemDropConditions": { - "NotExpert": "", - "NotMasterMode": "", - "LegacyHack_IsBossAndNotExpert": "", - "IsCrimsonAndNotExpert": "", - "IsCorruptionAndNotExpert": "", - "NotFromStatue": "" - }, - "Bestiary_FlavorText": { - "npc_JungleSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_YellowSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_RedSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_PurpleSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_BlackSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_GreenSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_BlueSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_DemonEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_Zombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_Skeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_AngryBones": "{$CommonBestiaryFlavor.AngryBones}", - "npc_Hornet": "{$CommonBestiaryFlavor.Hornet}", - "npc_Hellbat": "{$CommonBestiaryFlavor.LavaBat}", - "npc_BlueJellyfish": "{$CommonBestiaryFlavor.Jellyfish}", - "npc_PinkJellyfish": "{$CommonBestiaryFlavor.Jellyfish}", - "npc_Mummy": "{$CommonBestiaryFlavor.Mummy}", - "npc_DarkMummy": "{$CommonBestiaryFlavor.Mummy}", - "npc_LightMummy": "{$CommonBestiaryFlavor.Mummy}", - "npc_Mimic": "{$CommonBestiaryFlavor.Mimic}", - "npc_GreenJellyfish": "{$CommonBestiaryFlavor.Jellyfish}", - "npc_BaldZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_WanderingEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_Penguin": "{$CommonBestiaryFlavor.Penguin}", - "npc_PenguinBlack": "{$CommonBestiaryFlavor.Penguin}", - "npc_Lavabat": "{$CommonBestiaryFlavor.LavaBat}", - "npc_PigronCorruption": "{$CommonBestiaryFlavor.Pigron}", - "npc_PigronHallow": "{$CommonBestiaryFlavor.Pigron}", - "npc_PigronCrimson": "{$CommonBestiaryFlavor.Pigron}", - "npc_PincushionZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_SwampZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_TwiggyZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_CataractEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_SleepyEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_DialatedEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_GreenEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_PurpleEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_FemaleZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_HeadacheSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_MisassembledSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_PantlessSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_HornetFatty": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetHoney": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetLeafy": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetSpikey": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetStingy": "{$CommonBestiaryFlavor.Hornet}", - "npc_ZombieMushroom": "{$CommonBestiaryFlavor.MushroomZombie}", - "npc_ZombieMushroomHat": "{$CommonBestiaryFlavor.MushroomZombie}", - "npc_FungiBulb": "{$CommonBestiaryFlavor.FungiBulb}", - "npc_GiantFungiBulb": "{$CommonBestiaryFlavor.FungiBulb}", - "npc_RustyArmoredBonesAxe": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_RustyArmoredBonesFlail": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_RustyArmoredBonesSword": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_RustyArmoredBonesSwordNoArmor": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_BlueArmoredBones": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_BlueArmoredBonesMace": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_BlueArmoredBonesNoPants": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_BlueArmoredBonesSword": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_HellArmoredBones": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_HellArmoredBonesSpikeShield": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_HellArmoredBonesMace": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_HellArmoredBonesSword": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_RaggedCaster": "{$CommonBestiaryFlavor.RaggedCaster}", - "npc_RaggedCasterOpenCoat": "{$CommonBestiaryFlavor.RaggedCaster}", - "npc_Necromancer": "{$CommonBestiaryFlavor.Necromancer}", - "npc_NecromancerArmored": "{$CommonBestiaryFlavor.Necromancer}", - "npc_DiabolistRed": "{$CommonBestiaryFlavor.Diabolist}", - "npc_DiabolistWhite": "{$CommonBestiaryFlavor.Diabolist}", - "npc_AngryBonesBig": "{$CommonBestiaryFlavor.AngryBones}", - "npc_AngryBonesBigMuscle": "{$CommonBestiaryFlavor.AngryBones}", - "npc_AngryBonesBigHelmet": "{$CommonBestiaryFlavor.AngryBones}", - "npc_Scarecrow1": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow2": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow3": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow4": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow5": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow6": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow7": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow8": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow9": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow10": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_DemonEyeOwl": "{$CommonBestiaryFlavor.CostumeDemonEye}", - "npc_DemonEyeSpaceship": "{$CommonBestiaryFlavor.CostumeDemonEye}", - "npc_ZombieDoctor": "{$CommonBestiaryFlavor.CostumeZombie}", - "npc_ZombieSuperman": "{$CommonBestiaryFlavor.CostumeZombie}", - "npc_ZombiePixie": "{$CommonBestiaryFlavor.CostumeZombie}", - "npc_SkeletonTopHat": "{$CommonBestiaryFlavor.CostumeSkeleton}", - "npc_SkeletonAstonaut": "{$CommonBestiaryFlavor.CostumeSkeleton}", - "npc_SkeletonAlien": "{$CommonBestiaryFlavor.CostumeSkeleton}", - "npc_ZombieXmas": "{$CommonBestiaryFlavor.ZombieXmas}", - "npc_ZombieSweater": "{$CommonBestiaryFlavor.ZombieXmas}", - "npc_SlimeRibbonWhite": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_SlimeRibbonYellow": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_SlimeRibbonGreen": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_SlimeRibbonRed": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_ZombieElf": "{$CommonBestiaryFlavor.ZombieElf}", - "npc_ZombieElfBeard": "{$CommonBestiaryFlavor.ZombieElf}", - "npc_ZombieElfGirl": "{$CommonBestiaryFlavor.ZombieElf}", - "npc_ArmedZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombiePincushion": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombieSwamp": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombieTwiggy": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombieCenx": "{$CommonBestiaryFlavor.Zombie}", - "npc_GoldBird": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldBunny": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldButterfly": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldFrog": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldGrasshopper": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldMouse": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldWorm": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_BoneThrowingSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_BoneThrowingSkeleton2": "{$CommonBestiaryFlavor.Skeleton}", - "npc_BoneThrowingSkeleton3": "{$CommonBestiaryFlavor.Skeleton}", - "npc_BoneThrowingSkeleton4": "{$CommonBestiaryFlavor.Skeleton}", - "npc_GiantWalkingAntlion": "{$CommonBestiaryFlavor.AntlionCharger}", - "npc_GiantFlyingAntlion": "{$CommonBestiaryFlavor.AntlionSwarmer}", - "npc_DesertLamiaLight": "{$CommonBestiaryFlavor.Lamia}", - "npc_DesertLamiaDark": "{$CommonBestiaryFlavor.Lamia}", - "npc_SquirrelGold": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_SandShark": "{$CommonBestiaryFlavor.Sandshark}", - "npc_SandsharkCorrupt": "{$CommonBestiaryFlavor.Sandshark}", - "npc_SandsharkCrimson": "{$CommonBestiaryFlavor.Sandshark}", - "npc_SandsharkHallow": "{$CommonBestiaryFlavor.Sandshark}", - "npc_WalkingAntlion": "{$CommonBestiaryFlavor.AntlionCharger}", - "npc_FlyingAntlion": "{$CommonBestiaryFlavor.AntlionSwarmer}", - "npc_GoldGoldfish": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldGoldfishWalker": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_BlackDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_BlueDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_GreenDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_OrangeDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_RedDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_YellowDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_GoldDragonfly": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldLadyBug": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldWaterStrider": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldSeahorse": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_IceMimic": "{$CommonBestiaryFlavor.Mimic}", - "npc_GemSquirrelAmethyst": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelTopaz": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelSapphire": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelEmerald": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelRuby": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelDiamond": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelAmber": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemBunnyAmethyst": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyTopaz": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnySapphire": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyEmerald": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyRuby": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyDiamond": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyAmber": "{$CommonBestiaryFlavor.GemBunny}" } } \ No newline at end of file diff --git a/Localization/Content/ru-RU/Items.json b/Localization/Content/ru-RU/Items.json index 895d9a1..cabf986 100644 --- a/Localization/Content/ru-RU/Items.json +++ b/Localization/Content/ru-RU/Items.json @@ -232,6 +232,7 @@ "RedHusk": "Красный хитин", "CyanHusk": "Синий хитин", "VioletHusk": "Фиолетовый хитин", + "PurpleMucos": "Пурпурная слизь", "BlackInk": "Чернила", "FlowerofFire": "Огненный цветок", "DyeVat": "Красильная барка", @@ -538,6 +539,7 @@ "CarriageLantern": "Переносной светильник", "AlchemyLantern": "Алхимический светильник", "DiablostLamp": "Дьявольская лампа", + "OilRagSconse": "Масляная лампада", "BlueDungeonChair": "Синий стул темницы", "BlueDungeonTable": "Синий стол темницы", "BlueDungeonWorkBench": "Синий верстак темницы", @@ -690,6 +692,7 @@ "NecroGreaves": "Ботинки некроманта", "CrimsonChest": "Багровый сундук", "HallowedChest": "Сундук освящения", + "FrozenChest": "Замороженный сундук", "JungleKey": "Ключ джунглей", "CorruptionKey": "Ключ порчи", "CrimsonKey": "Багровый ключ", @@ -760,6 +763,7 @@ "TitanstoneBlockWall": "Стена из титанового камня", "MagicCuffs": "Магические наручники", "MusicBoxSnow": "Музыкальная шкатулка (снег)", + "MusicBoxSpace": "Музыкальная шкатулка (космос)", "MusicBoxCrimson": "Музыкальная шкатулка (Багрянец)", "MusicBoxBoss4": "Музыкальная шкатулка (Босс 4)", "SilverWatch": "Серебряные часы", @@ -768,6 +772,7 @@ "MusicBoxRain": "Музыкальная шкатулка (дождь)", "MusicBoxIce": "Музыкальная шкатулка (лед)", "MusicBoxDesert": "Музыкальная шкатулка (пустыня)", + "MusicBoxOcean": "Музыкальная шкатулка (океан)", "MusicBoxDungeon": "Музыкальная шкатулка (темница)", "MusicBoxPlantera": "Музыкальная шкатулка (Плантера)", "MusicBoxBoss5": "Музыкальная шкатулка (босс 5)", @@ -810,6 +815,7 @@ "DerplingBanner": "Знамя грибного рака-отшельника", "EaterofSoulsBanner": "Знамя пожирателя душ", "EnchantedSwordBanner": "Знамя зачарованного меча", + "ZombieEskimoBanner": "Знамя зомби-эскимоса", "FaceMonsterBanner": "Знамя лицевого монстра", "FloatyGrossBanner": "Знамя летающей массы", "FlyingFishBanner": "Знамя летающей рыбы", @@ -1003,6 +1009,7 @@ "SpookyDoor": "Жуткая дверь", "SpookyTable": "Жуткий стол", "SpookyWorkBench": "Жуткий верстак", + "SpookyPlatform": "Жуткая платформа", "ReaperHood": "Капюшон жнеца", "Diamond": "Алмаз", "ReaperRobe": "Роба жнеца", @@ -1558,7 +1565,7 @@ "GuideVoodooFish": "Рыба вуду Гида", "Wyverntail": "Вивернохвостка", "ZombieFish": "Рыба-зомби", - "AmanitaFungifin": "Аманитиновая гриборыба", + "AmanitiaFungifin": "Аманитиновая гриборыба", "Angelfish": "Рыба-ангел", "BloodyManowar": "Кровавый мановар", "Bonefish": "Альбула", @@ -1637,7 +1644,7 @@ "SwiftnessPotion": "Зелье скорости", "BlueArmoredBonesBanner": "Знамя синего бронированного скелета", "BlueCultistArcherBanner": "Знамя синего лучника-культиста", - "ManaCloakStar": "", + "BlueCultistCasterBanner": "Знамя синего мага-культиста", "BlueCultistFighterBanner": "Знамя синего бойца-культиста", "BoneLeeBanner": "Знамя Костюса Ли", "ClingerBanner": "Знамя хватателя", @@ -2203,6 +2210,7 @@ "TacticalShotgun": "Тактический дробовик", "RottenChunk": "Гниль", "IvyChest": "Плющевой сундук", + "IceChest": "Ледяной сундук сундук", "Marrow": "Сущность", "UnholyTrident": "Нечестивый трезубец", "FrostHelmet": "Морозный шлем", @@ -2338,6 +2346,9 @@ "TheUndertaker": "Гробовщик", "TheMeatball": "Фрикаделька", "TheRottedFork": "Гнилая вилка", + "EskimoHood": "Капюшон эскимоса", + "EskimoCoat": "Шуба эскимоса", + "EskimoPants": "Штаны эскимоса", "LivingWoodChair": "Стул из живой древесины", "CactusChair": "Кактусовый стул", "BoneChair": "Костяной стул", @@ -2527,7 +2538,10 @@ "ShoeSpikes": "Шипастые ботинки", "TigerClimbingGear": "Альпинистский набор тигра", "Tabi": "Таби", + "PinkEskimoHood": "Розовый капюшон эскимоса", + "PinkEskimoCoat": "Розовая шуба эскимоса", "Minishark": "Мини-акула", + "PinkEskimoPants": "Розовые штаны эскимоса", "PinkThread": "Розовые нитки", "ManaRegenerationBand": "Браслет восстановления маны", "SandstorminaBalloon": "Песчаная буря в шарике", @@ -2602,6 +2616,7 @@ "AncientBattleArmorPants": "Запретные поножи", "AncientBattleArmorShirt": "Запретная мантия", "AncientCloth": "Древняя ткань", + "AncientCultistTrophy": "Трофей древнего культиста", "AncientHorn": "Древний рог", "AnglerTackleBag": "Чемоданчик рыбака", "AngryBonesBanner": "Знамя злого скелета", @@ -2697,6 +2712,7 @@ "BorealWoodTable": "Стол из северной древесины", "BorealWoodWall": "Стена из заснеженной древесины", "BorealWoodWorkBench": "Верстак из северной древесины", + "BossMaskCultist": "Маска древнего культиста", "BossMaskMoonlord": "Маска лунного лорда", "BottomlessBucket": "Бездонное ведро воды", "BouncyBomb": "Прыгучая бомба", @@ -2820,6 +2836,7 @@ "DestroyerBossBag": "Мешок с сокровищами", "DestroyerMask": "Маска Уничтожителя", "Detonator": "Детонатор", + "DevDye": "Кровь Skiphs", "DiamondGemsparkWall": "Стена из алмазных блоков", "DiamondGemsparkWallOff": "Выключенная стена из алмазных блоков", "DjinnLamp": "Лампа духа пустыни", @@ -2883,12 +2900,14 @@ "Fake_DynastyChest": "Фальшивый Родовой сундук", "Fake_EbonwoodChest": "Фальшивый Сундук из черной древесины", "Fake_FleshChest": "Фальшивый Сундук из плоти", + "Fake_FrozenChest": "Фальшивый Замороженный сундук", "Fake_GlassChest": "Фальшивый Стеклянный сундук", "Fake_GoldChest": "Фальшивый Золотой сундук", "Fake_GraniteChest": "Фальшивый Гранитный сундук", "Fake_GreenDungeonChest": "Фальшивый Зеленый сундук темницы", "Fake_HallowedChest": "Фальшивый Сундук освящения", "Fake_HoneyChest": "Фальшивый Медовый сундук", + "Fake_IceChest": "Фальшивый Ледяной сундук сундук", "Fake_IvyChest": "Фальшивый Плющевой сундук", "Fake_JungleChest": "Фальшивый Сундук джунглей", "Fake_LihzahrdChest": "Фальшивый Сундук ящщеров", @@ -3558,6 +3577,7 @@ "SailfishBoots": "Ботинки парусника", "SalamanderBanner": "Знамя саламандры", "SandElementalBanner": "Знамя песчаного элементаля", + "SandFallBlock": "Блок-пескопад", "SandFallWall": "Стена пескопада", "SandsharkBanner": "Знамя песчаной акулы", "SandsharkCorruptBanner": "Знамя костяного кусателя", @@ -3621,6 +3641,10 @@ "SkeletronBossBag": "Мешок с сокровищами", "SkeletronPrimeBossBag": "Мешок с сокровищами", "SkeletronPrimeMask": "Маска Скелетрона Прайма", + "SkiphsHelm": "Маска Skiphs", + "SkiphsPants": "Медвежья попа Skiphs", + "SkiphsShirt": "Шкура Skiphs", + "SkiphsWings": "Лапы Skiphs", "SkyBlueString": "Небесно-синяя нитка", "SkyFracture": "Небесный разлом", "SkywareBathtub": "Небесная ванна", @@ -3662,6 +3686,7 @@ "SmokeBlock": "Дымовой блок", "SnailStatue": "Статуя улитки", "SnowCloudBlock": "Снежное облако", + "SnowFallBlock": "Блок-снегопад", "SnowFallWall": "Стена снегопада", "SolarCoriteBanner": "Знамя корита", "SolarCrawltipedeBanner": "Знамя ползоножки", @@ -3806,6 +3831,7 @@ "TwilightHairDye": "Сумеречная краска для волос", "TwinMask": "Маска Близнецов", "TwinsBossBag": "Мешок с сокровищами", + "UltraBrightCampfire": "Ультраяркий костер", "UndeadVikingStatue": "Статуя скелета-викинга", "UnicornStatue": "Статуя единорога", "UnicornWispDye": "Краситель единорога-духа", @@ -3954,6 +3980,7 @@ "DungeonClockPink": "Розовые часы темницы", "DynastyDresser": "Родовая тумбочка", "DynastyPiano": "Родовое пианино", + "DynastyPlatform": "Родовая платформа", "DynastySofa": "Родовой диван", "Fake_CrystalChest": "Фальшивый хрустальный сундук", "Fake_GoldenChest": "Фальшивый золотой сундук", @@ -3978,6 +4005,10 @@ "SquireAltPants": "Поножи рыцаря из Валгаллы", "SquireAltShirt": "Нагрудник рыцаря из Валгаллы", "SkywareClock2": "Часы солнечного диска", + "ArkhalisHat": "Капюшон Архалиса", + "ArkhalisShirt": "Нагрудник Архалиса", + "ArkhalisPants": "Поножи Архалиса", + "ArkhalisWings": "Крылья легкости Архалиса", "LeinforsHat": "Средство для защиты волос Линфорса", "LeinforsShirt": "Излишний стиль Линфорса", "LeinforsPants": "Модные штаны Линфорса", @@ -4003,7 +4034,7 @@ "Paintbrush": "Используется с краской, чтобы красить блоки", "PaintRoller": "Используется с краской, чтобы красить стены", "ManaCrystal": "Навсегда увеличивает максимум маны на 20", - "GolfBallDyedPink": "{$CommonItemTooltip.GolfBall}", + "PaintScraper": "Используется для снятия краски", "TealMushroom": "Используется для приготовления бирюзового красителя", "GreenMushroom": "Используется для приготовления зеленого красителя", "SkyBlueFlower": "Используется для приготовления небесно-синего красителя", @@ -4027,7 +4058,7 @@ "MagicMissile": "Запускает управляемую ракету", "Beenade": "Взрывается роем пчел", "GravityGlobe": "Позволяет владельцу изменять гравитацию\nНажмите ВВЕРХ, чтобы изменить гравитацию", - "KiteRed": "{$CommonItemTooltip.Kite}", + "HoneyComb": "При уроне выпускает пчел", "Abeemination": "Призывает королеву пчел", "DirtRod": "Волшебным образом перемещает землю", "TempleKey": "Открывает дверь храма джунглей", @@ -4036,10 +4067,10 @@ "LihzahrdPressurePlate": "Активируется при нажатии игроком", "PiranhaGun": "Цепляется за врага и наносит продолжительный урон", "PygmyStaff": "Призывает пигмея, который сражается за вас", - "KiteBlueAndYellow": "{$CommonItemTooltip.Kite}", - "KiteBlue": "{$CommonItemTooltip.Kite}", - "KiteWyvern": "{$CommonItemTooltip.Kite}", - "GroxTheGreatGreaves": "{$CommonItemTooltip.DevItem}", + "PygmyNecklace": "Увеличивает ваше максимальное количество питомцев", + "TikiMask": "Увеличивает ваше максимальное количество питомцев\nУвеличивает урон питомца на 10 %", + "TikiShirt": "Увеличивает ваше максимальное количество питомцев\nУвеличивает урон питомца на 10 %", + "TikiPants": "Увеличивает ваше максимальное количество питомцев\nУвеличивает урон питомца на 10 %", "LeafWings": "{$CommonItemTooltip.FlightAndSlowfall}", "BlizzardinaBalloon": "Позволяет владельцу делать двойной прыжок\nУвеличивает высоту прыжка", "BundleofBalloons": "Позволяет владельцу прыгать четыре раза\nУвеличивает высоту прыжка", @@ -4088,19 +4119,19 @@ "MeteorSuit": "Увеличивает магический урон на 7 %", "AmberMosquito": "Призывает детеныша динозавра", "NimbusRod": "Призывает облако дождя на ваших врагов", - "GroxTheGreatArmor": "{$CommonItemTooltip.DevItem}", + "BeeCloak": "При ранении вызывает падение звезд и высвобождает пчел", "EyeoftheGolem": "Увеличивает шанс критического удара на 10 %", "HoneyBalloon": "Увеличивает высоту прыжка\nПри уроне выпускает пчел", "MeteorLeggings": "Увеличивает магический урон на 7 %", "BlueHorseshoeBalloon": "Позволяет владельцу делать двойной прыжок\nУвеличивает высоту прыжка и защищает от урона при падении", "WhiteHorseshoeBalloon": "Позволяет владельцу делать двойной прыжок\nУвеличивает высоту прыжка и защищает от урона при падении", "YellowHorseshoeBalloon": "Позволяет владельцу делать двойной прыжок\nУвеличивает высоту прыжка и защищает от урона при падении", - "OceanCrate": "{$CommonItemTooltip.RightClickToOpen}", + "FrozenTurtleShell": "Выставляет щит вокруг владельца, когда его уровень жизни падает ниже 50 %", "SniperRifle": "Стреляет убойной высокоскоростной пулей\nНажмите , чтобы уменьшить масштаб", "VenusMagnum": "Стреляет убойной высокоскоростной пулей", "CrimsonRod": "Призывает облако крови на ваших врагов", - "SteampunkWings": "{$CommonItemTooltip.FlightAndSlowfall}", - "WingsVortex": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", + "Stynger": "Стреляет разрывной стрелой", + "FlowerPow": "Стреляет острыми как лезвия листьями в ближайших врагов", "RainbowGun": "Стреляет радугой, которая наносит продолжительный урон", "StyngerBolt": "Взрывается смертоносными осколками", "FlowerofFrost": "Стреляет морозным шаром", @@ -4112,11 +4143,11 @@ "EmeraldRobe": "Увеличивает максимум маны на 60\nУменьшает использование маны на 11 %", "RubyRobe": "Увеличивает максимум маны на 60\nУменьшает использование маны на 13 %", "DiamondRobe": "Увеличивает максимум маны на 80\nУменьшает использование маны на 15 %", - "GroxTheGreatHelm": "{$CommonItemTooltip.DevItem}", + "PanicNecklace": "После удара увеличивает скорость движения", "LifeFruit": "Навсегда увеличивает максимальный уровень жизни на 5", "LihzahrdPowerCell": "Используется на алтаре ящщеров", "Picksaw": "Может добывать кирпичи ящеров", - "JimsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "HeatRay": "Стреляет проникающим тепловым лучом\nУлаа!!!", "StaffofEarth": "Призывает большой валун", "GolemFist": "Бьет с силой голема", "Binoculars": "Увеличивает дальность обзора", @@ -4136,8 +4167,8 @@ "TurtleHelmet": "Увеличивает урон в ближнем бою на 6 %\nВраги с большей вероятностью атакуют вас", "TurtleScaleMail": "Увеличивает на 8 % урон в ближнем бою и шанс критического удара\nВраги с большей вероятностью атакуют вас", "TurtleLeggings": "Увеличивает шанс критического удара в ближнем бою на 4 %\nВраги с большей вероятностью атакуют вас", - "KiteWorldFeeder": "{$CommonItemTooltip.Kite}", - "OasisCrateHard": "{$CommonItemTooltip.RightClickToOpen}", + "MagicQuiver": "Увеличивает урон на 10 % и значительно увеличивает скорость стрельбы стрелами\nШанс 20 % не потратить стрелы", + "MagmaStone": "Накладывает урон от лавы при атаке", "ObsidianRose": "Снижает урон от прикосновения к лаве", "RodofDiscord": "Телепортирует на позицию мыши", "DeathSickle": "Бросает косу смерти", @@ -4147,7 +4178,7 @@ "IchorArrow": "Снижает защиту цели", "IchorBullet": "Снижает защиту цели", "GoldenShower": "Распыляет душ ихора\nСнижает защиту цели", - "OasisCrate": "{$CommonItemTooltip.RightClickToOpen}", + "FireGauntlet": "Увеличивает отбрасывание в ближнем бою и накладывает урон от лавы при атаке\nУвеличивает урон и скорость ближнего боя на 10 %", "ImbuingStation": "Используется для создания флаконов для усиления оружия", "EmptyBullet": "Используется для создания различных боеприпасов", "ShadowbeamStaff": "Создает луч тени, который отражается от стен", @@ -4176,17 +4207,17 @@ "CorruptionKey": "Открывает сундук порчи в Темнице", "CrimsonKey": "Открывает багровый сундук в Темнице", "HallowedKey": "Открывает сундук освящения в Темнице", - "Cherry": "{$CommonItemTooltip.MinorStats}", + "FrozenKey": "Открывает замороженный сундук в Темнице", "SpectrePaintbrush": "Используется с краской, чтобы красить блоки", "SpectrePaintRoller": "Используется с краской, чтобы красить стены", - "GolfBallDyedOrange": "{$CommonItemTooltip.GolfBall}", + "SpectrePaintScraper": "Используется для снятия краски", "ShroomiteHeadgear": "Увеличивает урон от стрел на 15 %\nУвеличивает шанс дистанционного критического удара на 5 %", "ShroomiteMask": "Увеличивает урон от пуль на 15 %\nУвеличивает шанс дистанционного критического удара на 5 %", "ShroomiteHelmet": "Увеличивает урон от ракет на 15 %\nУвеличивает шанс дистанционного критического удара на 5 %", - "KiteBoneSerpent": "{$CommonItemTooltip.Kite}", + "ShroomiteBreastplate": "Увеличивает шанс дистанционного критического удара на 13 %\nШанс 20 % не потратить боеприпасы", "ShroomiteLeggings": "Увеличивает шанс критического дистанционного урона на 7 %\nУвеличивает скорость движения на 12 %", "Autohammer": "Преобразует хлорофитовые слитки в грибные", - "Jetpack": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressUpToBooster}", + "SDMG": "Шанс 50 % не потратить боеприпасы\nОткуда-то из глубин космоса", "CenxsTiara": "{$CommonItemTooltip.DevItem}", "CenxsBreastplate": "{$CommonItemTooltip.DevItem}", "CenxsLeggings": "{$CommonItemTooltip.DevItem}", @@ -4206,17 +4237,17 @@ "VampireKnives": "Быстро метает клинки, похищающие жизнь", "AquaScepter": "Распыляет поток воды", "ScourgeoftheCorruptor": "Мощное копье, которое выпускает маленьких пожирателей", - "Banana": "{$CommonItemTooltip.MinorStats}", + "StaffoftheFrostHydra": "Призывает могущественную морозную гидру, которая плюется льдом в ваших врагов", "SweetheartNecklace": "При уроне выпускает пчел и увеличивает скорость движения", "FlurryBoots": "Носитель может бегать супербыстро", "LuckyHorseshoe": "Нейтрализует урон от падения", "DTownsHelmet": "{$CommonItemTooltip.DevItem}", "DTownsBreastplate": "{$CommonItemTooltip.DevItem}", "DTownsLeggings": "{$CommonItemTooltip.DevItem}", - "GroxTheGreatWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", - "StillLife": "{$PaintingArtist.Crowno}", - "BloodyGoblet": "{$PaintingArtist.Crowno}", - "WickedUndead": "{$PaintingArtist.Crowno}", + "DTownsWings": "{$CommonItemTooltip.DevItem}", + "WillsWings": "{$CommonItemTooltip.DevItem}", + "CrownosWings": "{$CommonItemTooltip.DevItem}", + "CenxsWings": "{$CommonItemTooltip.DevItem}", "CenxsDress": "{$CommonItemTooltip.DevItem}", "CenxsDressPants": "{$CommonItemTooltip.DevItem}", "ShinyRedBalloon": "Увеличивает высоту прыжка", @@ -4225,7 +4256,7 @@ "AnkhCharm": "Дает иммунитет к большинству ослаблений", "AnkhShield": "Дает иммунитет к отбрасыванию и огненным блокам\nДает иммунитет к большинству ослаблений", "WaterBolt": "Создает медленно движущийся водяной выстрел", - "GolfBall": "{$CommonItemTooltip.GolfBall}", + "Bomb": "Небольшой взрыв, уничтожающий несколько плиток", "Dynamite": "Сильный взрыв, уничтожающий большинство плиток", "Grenade": "Небольшой взрыв, не уничтожающий плитки", "GoldWatch": "Сообщает время", @@ -4237,7 +4268,7 @@ "GoodieBag": "{$CommonItemTooltip.RightClickToOpen}", "CandyCornRifle": "Шанс 33 % не потратить боеприпасы", "Sickle": "Позволяет собирать сено из травы", - "KiteAngryTrapper": "{$CommonItemTooltip.Kite}", + "PumpkinPie": "{$CommonItemTooltip.MinorStats}", "TatteredFairyWings": "{$CommonItemTooltip.FlightAndSlowfall}", "SpiderEgg": "Призывает ручного паука", "MagicalPumpkinSeed": "Призывает ручную тыковку", @@ -4253,35 +4284,35 @@ "UnluckyYarn": "Призывает черного котенка", "TheHorsemansBlade": "Призывает тыквы, которые атакуют ваших врагов", "SpookyWings": "{$CommonItemTooltip.FlightAndSlowfall}", - "GhostManifestation": "{$PaintingArtist.Crowno}", - "Graveyard": "{$PaintingArtist.Crowno}", - "Reborn": "{$PaintingArtist.Crowno}", + "SpookyHelmet": "Увеличивает ваше максимальное количество питомцев\nУвеличивает урон питомца на 11 %", + "SpookyBreastplate": "Увеличивает ваше максимальное количество питомцев\nУвеличивает урон питомца на 11 %", + "SpookyLeggings": "Увеличивает ваше максимальное количество питомцев\nУвеличивает урон питомца на 11 %", "CursedSapling": "Вызывает проклятое растеньице, которое следует за вами", "PumpkinMoonMedallion": "Вызывает тыквенную луну", - "Nevermore": "{$PaintingArtist.Crowno}", + "NecromanticScroll": "Увеличивает ваше максимальное количество питомцев\nУвеличивает урон питомца на 10 %", "SniperScope": "Увеличивает обзор для оружия (нажмите , чтобы отдалить)\nУвеличивает на 10 % дистанционный урон и шанс критического удара", "BreathingReed": "Увеличивает время дыхания и позволяет дышать в воде", "JellyfishDivingGear": "Дает способность плавать и значительно увеличивает время дыхания под водой\nДает свет под водой", "ArcticDivingGear": "Дает способность плавать и значительно увеличивает время дыхания под водой\nДает свет под водой и увеличивает подвижность на льду", - "GnomeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.Gnome}", + "FrostsparkBoots": "Позволяет летать, очень быстро бегать и увеличивает подвижность на льду\nУвеличивает скорость движения на 7 %", "FartInABalloon": "Позволяет владельцу делать двойной прыжок\nУвеличивает высоту прыжка", - "DandelionBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.Dandelion}", - "GolfPainting3": "{$PaintingArtist.Crowno}", - "ArkhalisWings": "{$ItemTooltip.ArkhalisHat}\n{$CommonItemTooltip.FlightAndSlowfall}", + "PapyrusScarab": "Увеличивает ваше максимальное количество питомцев\nУвеличивает урон и отбрасывание при атаках ваших питомцев", + "CelestialStone": "Немного увеличивает урон, скорость ближнего боя, шанс критического урона,\nвосстановление жизни, защита, скорость работы киркой, отбрасывание при атаках питомцев", + "Hoverboard": "{$CommonItemTooltip.FlightAndSlowfall}\nУдерживайте ВНИЗ и ПРЫЖОК, чтобы парить", "Present": "{$CommonItemTooltip.RightClickToOpen}", "Flipper": "Дает возможность плавать", "RedRyder": "Не выстрелите себе в глаз!", "FestiveWings": "{$CommonItemTooltip.FlightAndSlowfall}", "BladeofGrass": "Имеет шанс отравить врагов", "EldMelter": "Использует гель в качестве боеприпасов", - "KiteGoldfish": "{$CommonItemTooltip.Kite}", + "ChristmasPudding": "{$CommonItemTooltip.MinorStats}", "ReindeerBells": "Призывает ездового оленя", "CnadyCanePickaxe": "Может добывать метеорит", - "KiteBunnyCrimson": "{$CommonItemTooltip.Kite}", - "KiteBunnyCorrupt": "{$CommonItemTooltip.Kite}", + "SugarCookie": "{$CommonItemTooltip.MinorStats}", + "GingerbreadCookie": "{$CommonItemTooltip.MinorStats}", "HandWarmer": "Дает невосприимчивость к охлаждению и заморозке", "Coal": "В этом году вы вели себя плохо.", - "GolfPainting2": "{$PaintingArtist.Crowno}", + "Toolbox": "Увеличивает дальность помещения предметов и использования инструментов на 1", "DogWhistle": "Призывает щенка", "ChristmasTreeSword": "Стреляет новогодними узорами", "ChainGun": "Шанс 50 % не потратить боеприпасы", @@ -4297,7 +4328,7 @@ "JungleRose": "Это так мило, так мило", "FeralClaws": "Увеличивает скорость ближнего боя на 12 %", "AnkletoftheWind": "Увеличивает скорость движения на 10 %", - "GolfClubIron": "{$CommonItemTooltip.GolfIron}", + "StaffofRegrowth": "Создает траву и мох на земле и камне\nУвеличивает количество собираемых растений", "WhoopieCushion": "Может докучать людям", "HeavyWorkBench": "Используется в продвинутых рецептах", "AmmoBox": "Уменьшает использование боеприпасов на 20 %", @@ -4318,7 +4349,7 @@ "SteampunkBoiler": "{$CommonItemTooltip.SpecialCrafting}", "HoneyDispenser": "{$CommonItemTooltip.SpecialCrafting}", "BrickLayer": "Увеличивает скорость установки плитки", - "GolfPainting1": "{$PaintingArtist.Crowno}", + "ExtendoGrip": "Увеличивает дальность установки плитки", "PaintSprayer": "Автоматически красит установленные предметы", "PortableCementMixer": "Увеличивает скорость установки стен", "CelestialMagnet": "Увеличивает дистанцию взятия звезд маны", @@ -4327,8 +4358,8 @@ "CelestialCuffs": "Увеличивает дистанцию взятия звезд маны\nПри уроне восстанавливает ману", "PulseBow": "Стреляет заряженными стрелами", "NaturesGift": "Снижает использование маны на 6 %", - "KiteSandShark": "{$CommonItemTooltip.Kite}", - "KiteShark": "{$CommonItemTooltip.Kite}", + "PadThai": "{$CommonItemTooltip.MinorStats}", + "Pho": "{$CommonItemTooltip.MinorStats}", "RestorationPotion": "Уменьшает время восстановления после употребления зелья", "Gatligator": "Шанс 50 % не потратить боеприпасы\nКрайне низкая точность", "WaterGun": "Брызгает безобидной струйкой воды", @@ -4341,14 +4372,14 @@ "Gel": "Вкусный и огнеопасный", "JunglePants": "Увеличивает максимум маны на 20\nУвеличивает шанс критического магического урона на 4 %", "NeonTetra": "За эти цветные чешуйки можно неплохо выручить.", - "Grapefruit": "{$CommonItemTooltip.MinorStats}", + "GoldenCarp": "Сильно блестит. Наверное, можно выгодна продать.", "MiningPotion": "Увеличивает скорость добычи руды на 25 %", "HeartreachPotion": "Увеличивает дистанцию взятия сердец жизни", - "DungeonFishingCrateHard": "{$ItemTooltip.DungeonFishingCrate}", + "CalmingPotion": "Снижает агрессивность врагов", "BuilderPotion": "Увеличивает скорость и дистанцию установки", "TitanPotion": "Увеличивает отбрасывание", "FlipperPotion": "Позволяет быстро двигаться в жидкостях", - "DivineEye": "{$PaintingArtist.Darthkitten}", + "SummoningPotion": "Увеличивает ваше максимальное количество питомцев", "TrapsightPotion": "Позволяет видеть ближайшие опасные места", "WoodenCrate": "{$CommonItemTooltip.RightClickToOpen}", "IronCrate": "{$CommonItemTooltip.RightClickToOpen}", @@ -4359,36 +4390,36 @@ "RagePotion": "Увеличивает шанс критического удара на 10 %", "InfernoPotion": "Поджигает ближайших врагов", "WrathPotion": "Увеличивает урон на 10 %", - "GolfClubDriver": "{$CommonItemTooltip.GolfDriver}", + "StickyBomb": "Бросить будет непросто.", "RecallPotion": "Телепортирует вас домой", "TeleportationPotion": "Телепортирует вас в случайное место", "LovePotion": "Бросьте это, чтобы заставить кого-то влюбиться", "StinkPotion": "Бросьте это, чтобы заставить кого-то ужасно пахнуть", - "BandageBoy": "{$PaintingArtist.Darthkitten}", + "FishingPotion": "Увеличивает навык рыбной ловли", "SonarPotion": "Находит рыбу на крючке", "CratePotion": "Увеличивает вероятность получить ящик", "WarmthPotion": "Снижает урон от источников холода", - "VisitingThePyramids": "{$PaintingArtist.Leinfors}", - "Uluru": "{$PaintingArtist.darthmorf}", + "BeeHeadgear": "Увеличивает урон питомца на 4 %\nУвеличивает ваше максимальное количество питомцев", + "BeeBreastplate": "Увеличивает урон питомца на 4 %\nУвеличивает ваше максимальное количество питомцев", "BeeGreaves": "Увеличивает урон питомца на 5 %", "HornetStaff": "Призывает шершня, который сражается за вас", "ImpStaff": "Призывает беса, который сражается за вас", - "Oasis": "{$PaintingArtist.Khaios}", - "LifeAboveTheSand": "{$PaintingArtist.Zoomo}", - "SnakesIHateSnakes": "{$PaintingArtist.Xman101}", + "AnglerHat": "Увеличивает уровень рыбалки", + "AnglerVest": "Увеличивает уровень рыбалки", + "AnglerPants": "Увеличивает уровень рыбалки", "Sunglasses": "Позволяет выглядеть круто!", - "TheSandsOfSlime": "{$PaintingArtist.Criddle}", - "JawsOfDeath": "{$PaintingArtist.Darthkitten}", - "BurningSpirit": "{$PaintingArtist.Zoomo}", + "SpiderMask": "Увеличивает ваше максимальное количество питомцев\nУвеличивает урон питомца на 6 %", + "SpiderBreastplate": "Увеличивает ваше максимальное количество питомцев\nУвеличивает урон питомца на 6 %", + "SpiderGreaves": "Увеличивает ваше максимальное количество питомцев\nУвеличивает урон питомца на 6 %", "HighTestFishingLine": "Леска никогда не порвется", - "FruitSalad": "{$CommonItemTooltip.MinorStats}", + "AnglerEarring": "Увеличивает навык рыбной ловли", "TackleBox": "Уменьшает вероятность использования гнили", "WizardHat": "Увеличивает магический урон на 15 %", "ZephyrFish": "Призывает воздушную рыбу", "FrogLeg": "Увеличивает скорость прыжка и активирует автопрыжок\nУвеличивает стойкость к падению", - "Dragonfruit": "{$CommonItemTooltip.MediumStats}", - "KiteJellyfishPink": "{$CommonItemTooltip.Kite}", - "KiteJellyfishBlue": "{$CommonItemTooltip.Kite}", + "CookedFish": "{$CommonItemTooltip.MinorStats}", + "CookedShrimp": "{$CommonItemTooltip.MinorStats}", + "Sashimi": "{$CommonItemTooltip.MinorStats}", "FinWings": "{$CommonItemTooltip.FlightAndSlowfall}", "OpticStaff": "Призывает близнецов, которые сражаются за вас", "RedHat": "Пахнет прикольно…", @@ -4421,13 +4452,13 @@ "HunterPotion": "Показывает местоположение врагов", "GravitationPotion": "Позволяет управлять гравитацией", "IllegalGunParts": "Под запретом в большинстве мест", - "GolfClubWedge": "{$CommonItemTooltip.GolfWedge}", - "BetsyWings": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", + "GoldenKey": "Открывает золотой сундук или сундук темницы", + "ShadowKey": "Открывает все теневые сундуки", "Furnace": "Используется для переплавки руды", "Loom": "Используется для изготовления ткани", "IronAnvil": "Используется для изготовления предметов из слитков металла", "Keg": "Используется для приготовления эля", - "KiteManEater": "{$CommonItemTooltip.Kite}", + "BowlofSoup": "{$CommonItemTooltip.MinorStats}", "WorkBench": "Используется в базовых рецептах", "GoblinBattleStandard": "Призывает армию гоблинов", "Sawmill": "Используется для создания продвинутых предметов из древесины", @@ -4440,7 +4471,7 @@ "MythrilHat": "Увеличивает дистанционный урон на 12 %\nУвеличивает шанс критического дистанционного урона на 7 %", "CobaltDrill": "Может добывать мифрил и орихалк", "MythrilDrill": "Может добывать адамантит и титан", - "WingsNebula": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", + "DaoofPow": "Имеет шанс сбить с толку\nНайди свои внутренние части", "Compass": "Показывает горизонтальное местоположение", "DivingGear": "Дает возможность плавать\nЗначительно увеличивает возможность дыхания под водой", "GPS": "Показывает местоположение\nСообщает время", @@ -4454,14 +4485,14 @@ "AdamantiteBreastplate": "Увеличивает урон на 6 %", "AdamantiteLeggings": "Увеличивает шанс критического урона на 4 %\nУвеличивает скорость движения на 5 %", "SpectreBoots": "Позволяет летать\nНоситель может бегать супербыстро", - "FruitJuice": "{$CommonItemTooltip.MinorStats}", + "Toolbelt": "Увеличивает радиус укладки блоков", "HolyWater": "Распространяет освящение на некоторые блоки", - "CrimsonFishingCrateHard": "{$ItemTooltip.CrimsonFishingCrate}", + "UnholyWater": "Распространяет порчу на некоторые блоки", "FairyBell": "Призывает фею", "SuspiciousLookingEye": "Призывает глаз Ктулху", "ClockworkAssaultRifle": "Очередь из трех пуль\nБоеприпасы расходуются только на первый выстрел", "MoonCharm": "Ночью превращает владельца в оборотня", - "KiteCrawltipede": "{$CommonItemTooltip.Kite}", + "Ruler": "Создает линии измерения на экране для удобства установки блоков", "SorcererEmblem": "Увеличивает магический урон на 15 %", "BandofRegeneration": "Медленно восстанавливает жизнь", "WarriorEmblem": "Увеличивает урон в ближнем бою на 15 %", @@ -4487,16 +4518,16 @@ "AdamantiteForge": "Используется для плавки адамантитовой и титановой руды", "MythrilAnvil": "Используется для изготовления предметов из мифриловых, орихалковых, адамантитовых и титановых слитков", "UnicornHorn": "Острый и волшебный!", - "CrownosWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "DarkShard": "Иногда бывает у существ в пустынях порчи", "LightShard": "Иногда бывает у существ в пустынях света", "RedPressurePlate": "Активируется при наступании", "CloudinaBottle": "Позволяет владельцу делать двойной прыжок", "SpellTome": "Можно зачаровать", - "PrismaticPunch": "{$CommonItemTooltip.MediumStats}", + "StarCloak": "При ранении вызывает падение звезд", "Megashark": "Шанс 50 % не потратить боеприпасы\nСтарший брат мини-акулы", "Shotgun": "Стреляет веером пуль", - "FrozenCrateHard": "{$CommonItemTooltip.RightClickToOpen}", - "Mango": "{$CommonItemTooltip.MinorStats}", + "PhilosophersStone": "Уменьшает время восстановления лечебных зелий", + "TitanGlove": "Увеличивает отбрасывание в ближнем бою", "HermesBoots": "Носитель может бегать супербыстро", "GreenPressurePlate": "Активируется при наступании", "GrayPressurePlate": "Активируется при нажатии игроком", @@ -4510,10 +4541,10 @@ "HallowedHelmet": "Увеличивает дистанционный урон на 15 %\nУвеличивает шанс критического дистанционного урона на 8 %", "CrossNecklace": "Увеличивает продолжительность неуязвимости после получения урона", "ManaFlower": "Снижает использование маны на 8 %\nПри необходимости автоматически использует зелье маны", - "Elderberry": "{$CommonItemTooltip.MinorStats}", + "MechanicalWorm": "Призывает Уничтожителя", "MechanicalSkull": "Призывает Скелетрона Прайма", "HallowedHeadgear": "Увеличивает максимум маны на 100\nУвеличивает магический урон и шанс критического урона на 12 %", - "KiteYellow": "{$CommonItemTooltip.Kite}", + "HallowedMask": "Увеличивает урон и шанс критического удара в ближнем бою на 10 %\nУвеличивает скорость ближнего боя на 10 %", "DemoniteOre": "Пульсирует темной энергией", "SlimeCrown": "Призывает короля слизней", "LightDisc": "Собирается до 5 шт. в ячейке", @@ -4535,12 +4566,12 @@ "Vilethorn": "Призывает злую колючку", "Starfury": "Вызывает падение звезд с неба\nВыковано с яростью рая", "PurificationPowder": "Уничтожает зло", - "SmoothieofDarkness": "{$CommonItemTooltip.MinorStats}", + "RedsWings": "{$CommonItemTooltip.DevItem}", "RedsHelmet": "{$CommonItemTooltip.DevItem}", "RedsBreastplate": "{$CommonItemTooltip.DevItem}", "RedsLeggings": "{$CommonItemTooltip.DevItem}", "Fish": "Призывает детеныша пингвина", - "BloodOrange": "{$CommonItemTooltip.MinorStats}", + "VilePowder": "Запрещает освящение", "Frostbrand": "Стреляет ледяным снарядом", "RedPotion": "Только для достойных", "RottenChunk": "Выглядит вкусно!", @@ -4557,7 +4588,7 @@ "IceBlade": "Стреляет ледяным снарядом", "IceBow": "Стреляет морозными стрелами", "FrostStaff": "Стреляет потоком холода", - "BlueCultistCasterBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CultistDevote}", + "Jetpack": "{$CommonItemTooltip.FlightAndSlowfall}\nУдерживайте ВВЕРХ, чтобы взлетать быстрее", "ButterflyWings": "{$CommonItemTooltip.FlightAndSlowfall}", "FallenStar": "Исчезает после рассвета", "Seaweed": "Призывает ручную черепаху", @@ -4588,14 +4619,14 @@ "GreenWrench": "Помещает зеленый провод", "BluePressurePlate": "Активируется при нажатии игроком", "YellowPressurePlate": "Активируется при нажатии кем угодно, кроме игрока", - "FrozenCrate": "{$CommonItemTooltip.RightClickToOpen}", + "DiscountCard": "В магазине снижаются цены", "LuckyCoin": "При ударе врагов иногда падают дополнительные монеты", "UnicornonaStick": "Отличное проводим время!", "SandstorminaBottle": "Позволяет владельцу дважды совершать более высокий прыжок", - "CanOfWorms": "{$CommonItemTooltip.RightClickToOpen}", + "CharmofMyths": "Восстанавливает жизнь и уменьшает длительность послезельевой болезни", "MoonShell": "Ночью превращает владельца в оборотня, а в воде — в амфибию", "StarVeil": "Вызывает падение звезд и при уроне увеличивает длительность неуязвимости", - "BloodyMoscato": "{$CommonItemTooltip.MinorStats}", + "WaterWalkingBoots": "Дает возможность ходить по воде", "MiningHelmet": "Дает свет при ношении", "AdhesiveBandage": "Иммунитет к кровотечению", "ArmorPolish": "Иммунитет к сломанной броне", @@ -4606,28 +4637,28 @@ "Nazar": "Иммунитет к проклятию", "Vitamins": "Иммунитет к ослаблению", "TrifoldMap": "Иммунитет к запутанности", - "Lemon": "{$CommonItemTooltip.MinorStats}", - "TropicalSmoothie": "{$CommonItemTooltip.MinorStats}", - "PinaColada": "{$CommonItemTooltip.MinorStats}", - "PeachSangria": "{$CommonItemTooltip.MinorStats}", + "PowerGlove": "Увеличивает отбрасывание в ближнем бою\nУвеличивает скорость ближнего боя на 12 %", + "LightningBoots": "Позволяет летать\nНоситель бегает невероятно быстро", + "SunStone": "Увеличивает все характеристики днем", + "MoonStone": "Увеличивает все характеристики ночью", "ArmorBracing": "Иммунитет к ослаблению и сломанной броне", "MedicatedBandage": "Иммунитет к отравлению и кровотечению", "ThePlan": "Иммунитет к замедленности и запутанности", "CountercurseMantra": "Иммунитет к безмолвию и проклятию", "CoinGun": "Использует монеты в качестве оружия\nБолее ценные монеты наносят больше урона", "LavaCharm": "Дает на 7 секунд иммунитет к лаве", - "BananaDaiquiri": "{$CommonItemTooltip.MinorStats}", - "Pineapple": "{$CommonItemTooltip.MinorStats}", + "ObsidianWaterWalkingBoots": "Дает возможность ходить по воде\nДает невосприимчивость к огненным блокам", + "LavaWaders": "Дает возможность ходить по воде и лаве\nДает иммунитет к огненным блокам и 7 секунд иммунитета к лаве", "BoneWand": "Помещает кость", "LeafWand": "Помещает листья", "FlyingCarpet": "Позволяет владельцу парить в воздухе несколько секунд", "AvengerEmblem": "Увеличивает урон на 12 %", - "Lemonade": "{$CommonItemTooltip.MinorStats}", + "MechanicalGlove": "Увеличивает отбрасывание в ближнем бою\nУвеличивает урон и скорость ближнего боя на 12 %", "LandMine": "Взрывается, если наступить", - "Starfruit": "{$CommonItemTooltip.MediumStats}", + "PaladinsShield": "Поглощает 25 % урона, полученного игроками вашей команды\nРаботает при уровне здоровья более 25 %", "Umbrella": "С этим вы будете падать медленнее", "ChlorophyteOre": "Реагирует на свет", - "GrapeJuice": "{$CommonItemTooltip.MajorStats}", + "SteampunkWings": "Позволяет летать и замедляет падение", "IceSkates": "Увеличивает подвижность на льду\nПри падении на лед он не сломается", "SnowballLauncher": "Быстро стреляет снежками", "ClimbingClaws": "Позволяет скользить по стенам\nРаботают лучше вместе с шипастыми ботинками", @@ -4644,7 +4675,7 @@ "Campfire": "Восстановление жизни увеличено рядом с костром", "Marshmallow": "Наденьте на палку и приготовьте над костром", "MarshmallowonaStick": "Поджарьте над костром!", - "Coconut": "{$CommonItemTooltip.MinorStats}", + "CookedMarshmallow": "{$CommonItemTooltip.MinorStats}", "ShoeSpikes": "Позволяет скользить по стенам\nРаботают лучше вместе с когтями альпиниста", "TigerClimbingGear": "Позволяет цепляться за стены", "Tabi": "Позволяет уклоняться от противников\nДважды коснитесь нужного направления", @@ -4660,19 +4691,19 @@ "EatersBone": "Призывает детеныша пожирателя душ", "BlendOMatic": "Используется для создания предметов", "MeatGrinder": "Используется для создания предметов", - "Rambutan": "{$CommonItemTooltip.MinorStats}", + "Extractinator": "Превращает ил, слякоть или ископаемые во что-то более полезное\nЧтобы использовать: Поместите ил/слякоть/окаменелости в обогатитель", "Solidifier": "Используется для создания предметов", "ActuationAccessory": "Автоматически помещает приводы под установленные предметы", "ActuationRod": "Активирует приводы", "AlchemyTable": "Шанс 33 % не потратить ингредиенты для создания зелий", "AncientBattleArmorHat": "Увеличивает магический урон и урон питомцев на 15 %", - "AppleJuice": "{$CommonItemTooltip.MinorStats}", - "WoodenCrateHard": "{$ItemTooltip.WoodenCrate}", + "AncientBattleArmorPants": "Увеличивает ваше максимальное количество питомцев", + "AncientBattleArmorShirt": "Увеличивает максимум маны на 80", "AncientHorn": "Призывает ездового василиска", - "BloodNautilusBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodNautilus}", - "GoblinSharkBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.GoblinShark}", + "AnglerTackleBag": "Леска никогда не порвется, уменьшает вероятность использования гнили, увеличивает навык рыбной ловли", + "ArchitectGizmoPack": "Увеличивает скорость и дистанцию установки плиток и стен\nАвтоматически красит установленные предметы", "AviatorSunglasses": "Выпустите своего внутреннего wingman\nОтлично подходит для скрытия личности стримеров!", - "KitePigron": "{$CommonItemTooltip.Kite}", + "Bacon": "{$CommonItemTooltip.MinorStats}\nБекон? Бекон.", "BalloonHorseshoeFart": "Позволяет владельцу делать двойной прыжок\nУвеличивает высоту прыжка и защищает от урона при падении", "BalloonHorseshoeHoney": "При уроне выпускает пчел\nУвеличивает высоту прыжка и защищает от урона при падении", "BalloonHorseshoeSharkron": "Позволяет владельцу делать двойной прыжок\nУвеличивает высоту прыжка и защищает от урона при падении", @@ -4680,26 +4711,26 @@ "BeesKnees": "Деревянные стрелы превращаются в столб пчел", "BejeweledValkyrieBody": "{$CommonItemTooltip.DevItem}\nУкрашено самоцветами и элегантно, как раз для полетов под дождевыми облаками", "BejeweledValkyrieHead": "{$CommonItemTooltip.DevItem}\nСтаньте ветром, оседлайте молнию.", - "BloodEelBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodEelHead}", + "BejeweledValkyrieWing": "{$CommonItemTooltip.DevItem}\nПлатформа-барьер спутника Валькирии абсолютно безопасна. Большую часть времени.", "BewitchingTable": "Нажмите , чтобы получить больше прислужников", "Bladetongue": "При касании выплевывает струю ихора", "BlessedApple": "Призывает ездового единорога", - "CorruptFishingCrateHard": "{$ItemTooltip.CorruptFishingCrate}", - "JungleFishingCrateHard": "{$ItemTooltip.JungleFishingCrate}", + "BloodWater": "Распространяет багрянец на некоторые блоки", + "BombFish": "Небольшой взрыв, уничтожающий несколько плиток", "BoneCampfire": "Восстановление жизни увеличено рядом с костром", "BoneRattle": "Призывает детеныша лицевого монстра", "BoneTorch": "Испускает смертельное сияние", "BoosterTrack": "Ударьте молотом, чтобы изменить направление", - "GolfClubPutter": "{$CommonItemTooltip.GolfPutter}", - "HallowedFishingCrateHard": "{$ItemTooltip.HallowedFishingCrate}", - "KiteRedAndYellow": "{$CommonItemTooltip.Kite}", + "BottomlessBucket": "Содержит бесконечное количество воды", + "BouncyBomb": "Небольшой взрыв, уничтожающий несколько плиток\nСильно отскакивает", + "BouncyDynamite": "Это окажется ужасной затеей", "BouncyGlowstick": "Работает при намокании", "BouncyGrenade": "Небольшой взрыв, не уничтожающий плитки\nСильно отскакивает", - "WillsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "BrainOfConfusion": "После удара может сбить с толку ближайших врагов", "BrainScrambler": "Призывает ездового скутликса", "BubbleGun": "Быстро стреляет силовыми шариками", "ButchersChainsaw": "При ударам по врагам создаются искры", - "BloodSquidBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodSquid}", + "CelestialShell": "Ночью превращает владельца в оборотня, а в воде — в амфибию\nНемного повышает все характеристики", "CelestialSigil": "Призывает Неотвратимую судьбу", "CellPhone": "Показывает все\nПозволяет в любой момент вернуться домой", "ClingerStaff": "Призывает стену проклятых огней", @@ -4733,9 +4764,9 @@ "FloatingIslandFishingCrate": "{$CommonItemTooltip.RightClickToOpen}", "FlowerBoots": "Из ваших следов на траве вырастают цветы", "FlyingKnife": "Метает управляемый летающий нож", - "GolfBallDyedBrown": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedBlue": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedBlack": "{$CommonItemTooltip.GolfBall}", + "FossilHelm": "Увеличивает скорость бросания на 20 %", + "FossilPants": "Увеличивает шанс критического урона от бросания на 15 %", + "FossilShirt": "Увеличивает урон от бросания на 20 %", "FragmentNebula": "В этом фрагменте заключена сила галактики", "FragmentSolar": "В этом фрагменте заключена ярость вселенной", "FragmentStardust": "Вокруг этого фрагмента вращаются завораживающие частицы", @@ -4752,8 +4783,8 @@ "GoblinTech": "Показывает скорость движения, урон в секунду и ценную руду", "GoldPickaxe": "Может добывать метеорит", "GoldRing": "Увеличивает дистанцию сбора монет", - "Plum": "{$CommonItemTooltip.MinorStats}", - "KiteBunny": "{$CommonItemTooltip.Kite}", + "GreedyRing": "Увеличивает дистанцию сбора монет и снижает цены в магазинах\nПри ударе врагов иногда падают дополнительные монеты", + "GrubSoup": "{$CommonItemTooltip.MinorStats}", "HallowedFishingCrate": "{$CommonItemTooltip.RightClickToOpen}", "HardySaddle": "Призывает ездовую черепаху", "HellwingBow": "Деревянные стрелы превращаются в огненных летучих мышей", @@ -4762,7 +4793,7 @@ "HoneyedGoggles": "Призывает ездовую пчелу", "IceMirror": "Посмотри в зеркало, чтобы вернуться домой", "IchorCampfire": "Восстановление жизни увеличено рядом с костром", - "EyeballFlyingFishBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.EyeballFlyingFish}", + "JimsWings": "{$CommonItemTooltip.DevItem}", "JungleFishingCrate": "{$CommonItemTooltip.RightClickToOpen}", "LargeAmber": "Для игры «Поймай самоцвет». Падает, когда вы умираете.", "LaserRuler": "Создает на экране линии для удобства установки блоков", @@ -4790,7 +4821,7 @@ "LokisHelm": "{$CommonItemTooltip.DevItem}\nХаос пришел из порядка, страх — из смелости, слабость — из силы", "LokisPants": "{$CommonItemTooltip.DevItem}\nЖернова правосудия мелят медленно, но в пыль.", "LokisShirt": "{$CommonItemTooltip.DevItem}\nПознай себя, познай врага. Тысяча боев, тысяча побед...", - "ZombieMermanBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.ZombieMerman}", + "LokisWings": "{$CommonItemTooltip.DevItem}\nПусть твои планы будут темными и непроницаемыми, как ночь, и когда ты движешься, срывайся вниз как гром.", "LunarBar": "Пульсирует светящейся небесной энергией", "LunarCraftingStation": "Используется для изготовления предметов из лунных фрагментов и люминита", "LunarFlareBook": "Вызывает дождь из лунных вспышек", @@ -4806,7 +4837,7 @@ "MoneyTrough": "Призывает летающую свинку, которая хранит ваши вещи", "MoonlordArrow": "Стреляет со скоростью звука!", "MoonlordBullet": "Выстраивай и сбивай...", - "Apricot": "{$CommonItemTooltip.MinorStats}", + "MoonlordTurretStaff": "Призывает лунный портал, который стреляет лазером во врагов", "MothronWings": "{$CommonItemTooltip.FlightAndSlowfall}", "MulticolorWrench": "Нажмите при удержании, чтобы изменить настройки проводов", "NebulaArcanum": "Вызывает астральную энергию и направляет ее на ваших врагов", @@ -4817,9 +4848,9 @@ "NebulaMonolith": "Использует немного силы от башни туманности", "NightKey": "Заряжено субстанцией многих душ", "NightVisionHelmet": "Улучшает зрение", - "GolfBallDyedLimeGreen": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedGreen": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedCyan": "{$CommonItemTooltip.GolfBall}", + "NinjaHood": "Увеличивает скорость бросания на 15 %", + "NinjaPants": "Увеличивает шанс критического урона от бросания на 10 %", + "NinjaShirt": "Увеличивает урон от бросания на 15 %", "PartyBundleOfBalloonTile": "Связано для всеобщего удовольствия", "PartyGirlGrenade": "Небольшой взрыв, не уничтожающий плитки", "PartyMonolith": "Вызывает падение шариков с неба", @@ -4841,10 +4872,10 @@ "ProjectilePressurePad": "Активируется при попадании стрелкового оружия", "PsychoKnife": "Позволяет передвигаться в режиме скрытности", "PutridScent": "Враги с меньшей вероятностью атакуют вас\nУвеличивает на 5 % урон и шанс критического удара", - "GolfBallDyedYellow": "{$CommonItemTooltip.GolfBall}", + "QueenSpiderStaff": "Призывает королеву пауков, которая бросается яйцами в ваших врагов", "Radar": "Обнаруживает врагов рядом с вами", "RainbowCampfire": "Восстановление жизни увеличено рядом с костром", - "GolfBallDyedViolet": "{$CommonItemTooltip.GolfBall}", + "RainbowCrystalStaff": "Призывает сияющий кристалл, который изгоняет ваших врагов\nЦвета, герцог, света!", "RazorbladeTyphoon": "Призывает быстро двигающиеся лезвия", "RedsYoyo": "{$CommonItemTooltip.DevItem}", "REK": "Показывает количество монстров, убийств и редких существ", @@ -4875,30 +4906,30 @@ "SkiphsHelm": "{$CommonItemTooltip.DevItem}", "SkiphsPants": "{$CommonItemTooltip.DevItem}", "SkiphsShirt": "{$CommonItemTooltip.DevItem}", - "TheBrideBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.TheBride}", - "DTownsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "SkiphsWings": "{$CommonItemTooltip.DevItem}", + "SliceOfCake": "Заставляет вас заткнуться. Заставляет другого заткнуться. Неважно.", "SlimeGun": "Брызгает безобидной струйкой слизи", "SlimySaddle": "Призывает ездового слизня", - "KiteKoi": "{$CommonItemTooltip.Kite}", + "SnowCloudBlock": "Тут становится слишком холодно", "SnowFallBlock": "Намного холоднее, чем снежный шар", "SnowFallWall": "Намного холоднее, чем снежный шар", "SolarEruption": "Выковано с яростью солнца", - "RedsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", - "Hoverboard": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", - "CenxsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "SolarFlareBreastplate": "Увеличивает урон в ближнем бою на 22 %\nВраги с большей вероятностью атакуют вас", + "SolarFlareHelmet": "Увеличивает шанс критического урона в ближнем бою на 17 %\nВраги с большей вероятностью атакуют вас", + "SolarFlareLeggings": "Увеличивает скорость движения и ближнего боя на 15 %\nВраги с большей вероятностью атакуют вас", "SolarMonolith": "Использует немного силы от башни солнца", "SolarTablet": "Вызывает солнечное затмение", "SoulDrain": "Похищает здоровье у врагов", "SpelunkerGlowstick": "Показывает ближайшее сокровище", "SpiderStaff": "Призывает пауков, которые сражаются за вас", "SporeSac": "В течение времени призывает споры, которые наносят врагам урон", - "GolfClubChlorophyteDriver": "{$CommonItemTooltip.GolfDriver}", + "StardustBreastplate": "Увеличивает ваше максимальное количество питомцев\nУвеличивает урон питомца на 22 %", "StardustCellStaff": "Призывает клетку звездной пыли, которая сражается за вас\nВыводит самую красивую клеточную инфекцию", "StardustDragonStaff": "Призывает дракона звездной пыли, который сражается за вас\nКому нужна орда питомцев, если у тебя есть гигантский дракон?", - "GolfClubDiamondWedge": "{$CommonItemTooltip.GolfWedge}", - "GolfClubShroomitePutter": "{$CommonItemTooltip.GolfPutter}", + "StardustHelmet": "Увеличивает ваше максимальное количество питомцев\nУвеличивает урон питомца на 22 %", + "StardustLeggings": "Увеличивает ваше максимальное количество питомцев\nУвеличивает урон питомца на 22 %", "StardustMonolith": "Использует немного силы от башни звездной пыли", - "FloatingIslandFishingCrateHard": "{$ItemTooltip.FloatingIslandFishingCrate}", + "StickyDynamite": "Бросить будет непросто.", "StickyGrenade": "Небольшой взрыв, не уничтожающий плитки\nБросить будет непросто.", "Stopwatch": "Показывает скорость движения игрока", "StrangeBrew": "Выглядит и пахнет ужасно", @@ -4921,7 +4952,7 @@ "TungstenPickaxe": "Может добывать метеорит", "UltraBrightCampfire": "Восстановление жизни увеличено рядом с костром", "ValkyrieYoyo": "{$CommonItemTooltip.DevItem}", - "BlackCurrant": "{$CommonItemTooltip.MinorStats}", + "ViciousPowder": "Запрещает освящение", "VineRopeCoil": "Метните, чтобы создать лозу, по которой можно залезть", "VortexBeater": "Шанс 66 % не потратить боеприпасы\nКатастрофическая смесь бах-бах и бух-бух.", "VortexBreastplate": "Увеличивает на 12 % дистанционный урон и шанс критического удара\nШанс 25 % не потратить боеприпасы", @@ -4935,10 +4966,10 @@ "WeightedPressurePlateOrange": "Активируется, когда игрок наступает", "WeightedPressurePlatePink": "Активируется, когда игрок наступает", "WeightedPressurePlatePurple": "Активируется, когда игрок наступает", - "Peach": "{$CommonItemTooltip.MinorStats}", + "WingsNebula": "{$CommonItemTooltip.FlightAndSlowfall}", "WingsSolar": "{$CommonItemTooltip.FlightAndSlowfall}", "WingsStardust": "{$CommonItemTooltip.FlightAndSlowfall}", - "GolfClubTitaniumIron": "{$CommonItemTooltip.GolfIron}", + "WingsVortex": "{$CommonItemTooltip.FlightAndSlowfall}", "WireBulb": "Включает лампы для каждого цвета проводов", "WireKite": "Дает полный контроль над проводами!\nНажмите при удержании, чтобы изменить настройки проводов", "WirePipe": "Разделяет проложенные провода\nМожно бить молотом!", @@ -4950,7 +4981,7 @@ "Yoraiz0rHead": "{$CommonItemTooltip.DevItem}", "Yoraiz0rPants": "{$CommonItemTooltip.DevItem}", "Yoraiz0rShirt": "{$CommonItemTooltip.DevItem}", - "GolfClubPearlwoodDriver": "{$CommonItemTooltip.GolfDriver}", + "Yoraiz0rWings": "{$CommonItemTooltip.DevItem}\nЧто бы этот аксессуар ни делал вам, это не глюк!", "YoyoBag": "Дает пользователю мастерство в использовании йо-йо", "YoYoGlove": "Позволяет использовать два йо-йо одновременно", "BloodMoonRising": "{$PaintingArtist.Garner}", @@ -5148,7 +5179,7 @@ "BlackSlimeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BlackSlime}", "BlueArmoredBonesBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BlueArmoredBones}", "BlueCultistArcherBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CultistArcherBlue}", - "SkiphsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "BlueCultistCasterBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.None}", "BlueCultistFighterBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.None}", "BoneLeeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BoneLee}", "ClingerBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.Clinger}", @@ -5402,22 +5433,22 @@ "ApprenticeScarf": "{$ItemTooltip.HuntressBuckler}", "SquireShield": "{$ItemTooltip.HuntressBuckler}", "MonkBelt": "{$ItemTooltip.HuntressBuckler}", - "GolfClubStoneIron": "{$CommonItemTooltip.GolfIron}", + "ApprenticeAltHead": "Увеличивает ваше максимальное количество стражников\nУвеличивает урон прислужников и магический урон на 10 %", "ApprenticeAltPants": "Увеличивает урон прислужников на 20 % и шанс критического магического удара на 25 %", "ApprenticeAltShirt": "Увеличивает урон прислужников на 30 % и магический урон на 15 %", - "GolfClubGoldWedge": "{$CommonItemTooltip.GolfWedge}", + "ApprenticeHat": "Увеличивает ваше максимальное количество стражников и снижает стоимость маны на 10 %", "ApprenticeRobe": "Увеличивает урон прислужников на 20 % и магический урон на 10 %", "ApprenticeStaffT3": "Выпускает испарения, снижающие защиту!", - "GoldenCrateHard": "{$ItemTooltip.GoldenCrate}", + "ApprenticeTrousers": "Увеличивает урон прислужников на 10 % и скорость движения на 20 %", "BookStaff": "Интересно, кто умудрился насадить книгу бесконечной мудрости на палку...\n, чтобы призвать мощный торнадо", - "GolfBallDyedSkyBlue": "{$CommonItemTooltip.GolfBall}", + "DD2BallistraTowerT1Popper": "Медленная но мощная башня, которая стреляет пронзающими снарядами\n{$CommonItemTooltip.EtherianManaCost10}", "DD2BetsyBow": "Стреляет разделяющимися стрелами, наносит повышенный урон летающим врагам", "DD2ElderCrystal": "Поместите на стенд из этерианского кристалла, чтобы открыть этерианские порталы", "DD2ElderCrystalStand": "Удерживает этерианский кристалл", "DD2EnergyCrystal": "Часто используется, чтобы показать чью-то волю в качестве физической формы защиты", - "GolfBallDyedRed": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedTeal": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedPurple": "{$CommonItemTooltip.GolfBall}", + "DD2ExplosiveTrapT1Popper": "Ловушка, которая взрывается при приближении врага\n{$CommonItemTooltip.EtherianManaCost10}", + "DD2FlameburstTowerT1Popper": "Башня средней скорости, которая стреляет разрывными файерболами\n{$CommonItemTooltip.EtherianManaCost10}", + "DD2LightningAuraT1Popper": "Аура, которая многократно обездвиживает врагов, входящих внутрь\n{$CommonItemTooltip.EtherianManaCost10}", "DD2PetDragon": "Призывает ручного дракона", "DD2PetGato": "Призывает ручного кота", "DD2PetGhost": "Призывает огонек, который дает свет", @@ -5425,77 +5456,47 @@ "DD2SquireBetsySword": "Выпускает вперед энергию сердца", "DD2SquireDemonSword": ", чтобы закрыться щитом", "DefenderMedal": "Валюта для торговли с трактирщиком", - "ShuckedOyster": "{$CommonItemTooltip.MinorStats}", + "HuntressAltHead": "Увеличивает ваше максимальное количество стражников\nУвеличивает урон прислужников на 10 % и шанс критического дистанционного урона", "HuntressAltPants": "Увеличивает урон прислужников на 25 % и скорость движения на 20 %", "HuntressAltShirt": "Увеличивает урон прислужников и дистанционный урон на 25 %", - "GolfClubBronzeWedge": "{$CommonItemTooltip.GolfWedge}", + "HuntressBuckler": "Увеличивает ваше максимальное количество стражников\nУвеличивает урон питомца на 10 %", "HuntressJerkin": "Увеличивает урон прислужников и дистанционный урон на 20 %", "HuntressPants": "Увеличивает урон прислужников на 10 % и скорость движения на 20 %", - "GolfClubWoodDriver": "{$CommonItemTooltip.GolfDriver}", - "Oyster": "{$CommonItemTooltip.RightClickToOpen}", + "HuntressWig": "Увеличивает ваше максимальное количество стражников и повышает шанс критического дистанционного удара на 10 %", + "MonkAltHead": "Увеличивает ваше максимальное количество стражников, а также повышает урон в ближнем бою и урон прислужников на 20 %", "MonkAltPants": "Увеличивает урон прислужников, скорость движения и шанс критического урона в ближнем бою на 20 %", "MonkAltShirt": "Увеличивает урон прислужников и скорость ближнего боя на 20 %", - "GolfClubMythrilIron": "{$CommonItemTooltip.GolfIron}", + "MonkBrows": "Увеличивает ваше максимальное количество стражников и скорость ближнего боя на 20 %", "MonkPants": "Увеличивает урон прислужников на 10 %\nУвеличивает шанс критического удара на 10 % и скорость движения на 20 %", "MonkShirt": "Увеличивает урон прислужников и урон ближнего боя на 20 %", "MonkStaffT1": "Накапливает энергию при вращении и нанесении врагам урона", "MonkStaffT2": "При попадании во врагов призывает призраков", "MonkStaffT3": ", когда держите в руке, чтобы провести альтернативную атаку!", - "GolfClubRustyPutter": "{$CommonItemTooltip.GolfPutter}", - "IronCrateHard": "{$ItemTooltip.IronCrate}", + "SquireAltHead": "Увеличивает ваше максимальное количество стражников и дает вам 10 % урона прислужников", + "SquireAltPants": "Увеличивает урон прислужников на 20 %, шанс критического удара и скорость движения на 30 %", "SquireAltShirt": "Увеличивает урон прислужников на 30 % и значительно ускоряет восстановление здоровья", - "GolfClubLeadPutter": "{$CommonItemTooltip.GolfPutter}", + "SquireGreatHelm": "Увеличивает ваше максимальное количество стражников и ускоряет восстановление здоровья", "SquireGreaves": "Увеличивает урон прислужников на 15 %, шанс критического удара в ближнем бою и скорость движения на 20 %", "SquirePlating": "Увеличивает урон прислужников и урон в ближнем бою на 15 %", "ArkhalisShirt": "{$ItemTooltip.ArkhalisHat}", "ArkhalisPants": "{$ItemTooltip.ArkhalisHat}", - "LobsterTail": "{$CommonItemTooltip.MediumStats}", + "ArkhalisWings": "{$ItemTooltip.ArkhalisHat}", "ArkhalisHat": "{$CommonItemTooltip.DevItem}\n\"Мне досталось это не от Грида\"", "LeinforsHat": "{$CommonItemTooltip.DevItem}\n\"Чтобы эти прекрасные замки всегда выглядели роскошно\"", "LeinforsShirt": "{$CommonItemTooltip.DevItem}\n\"Делает попку сексуальной\"", "LeinforsPants": "{$CommonItemTooltip.DevItem}\n\"Сюрприз Шии! Не ожидали этого от штанов?\"", - "OceanCrateHard": "{$CommonItemTooltip.RightClickToOpen}", - "LeinforsAccessory": "{$CommonItemTooltip.DevItem}\n\"Для лучшего результата сочетать с макаронной диетой\"", - "KiteSpectrum": "{$CommonItemTooltip.Kite}", - "KiteWanderingEye": "{$CommonItemTooltip.Kite}", - "KiteUnicorn": "{$CommonItemTooltip.Kite}", - "FairyQueenBossBag": "{$CommonItemTooltip.RightClickToOpen}", - "LavaCrate": "{$CommonItemTooltip.RightClickToOpen}", - "LavaCrateHard": "{$CommonItemTooltip.RightClickToOpen}", - "HotlineFishingHook": "{$CommonItemTooltip.LavaFishing}", - "LavaFishingHook": "{$CommonItemTooltip.LavaFishing}", - "TeleportationPylonJungle": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonPurity": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonHallow": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonUnderground": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonOcean": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonDesert": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonSnow": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonMushroom": "{$CommonItemTooltip.TeleportationPylon}", - "RockGolemBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.RockGolem}", - "BloodMummyBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodMummy}", - "SporeSkeletonBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.SporeSkeleton}", - "SporeBatBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.SporeBat}", - "LarvaeAntlionBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.LarvaeAntlion}", - "CrimsonBunnyBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CrimsonBunny}", - "CrimsonGoldfishBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CrimsonGoldfish}", - "CrimsonPenguinBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CrimsonPenguin}", - "BigMimicCorruptionBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BigMimicCorruption}", - "BigMimicCrimsonBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BigMimicCrimson}", - "BigMimicHallowBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BigMimicHallow}", - "MossHornetBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.MossHornet}", - "WanderingEyeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.WanderingEye}", - "CreativeWings": "{$CommonItemTooltip.FlightAndSlowfall}", - "RainbowWings": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressUpToBooster}", - "LongRainbowTrailWings": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}\n{$CommonItemTooltip.PressUpToBooster}" + "LeinforsWings": "{$CommonItemTooltip.DevItem}\n\"Полностью включено! Что это значит?\"", + "LeinforsAccessory": "{$CommonItemTooltip.DevItem}\n\"Для лучшего результата сочетать с макаронной диетой\"" }, "CommonItemTooltip": { "SpecialCrafting": "Использоуется для создания особых предметов", "DevItem": "Отлично подходит, чтобы впечатлить разработчиков!", "FlightAndSlowfall": "Позволяет летать и замедляет падение", "RightClickToOpen": "Нажмите , чтобы открыть", + "MinorStats": "Немного повышает все характеристики", "BannerBonus": "Игроки поблизости получают бонус против: ", "Counterweight": "Бросает противовес после попадания йо-йо по врагу", + "EtherianManaCost10": "Использует 10 единиц этерианской маны, чтобы призвать больше одного", "MinuteDuration": "Длительность {0} мин.", "PlaceableOnXmasTree": "Надевается на новогоднюю ель", "RestoresLife": "Восстанавливает {0} ед. здоровья", diff --git a/Localization/Content/ru-RU/Legacy.json b/Localization/Content/ru-RU/Legacy.json index 0e73ded..e39b404 100644 --- a/Localization/Content/ru-RU/Legacy.json +++ b/Localization/Content/ru-RU/Legacy.json @@ -33,6 +33,7 @@ "37": "Посев травы...", "38": "Выращивание кактусов...", "39": "Высаживание подсолнухов...", + "3": "Наложение земли на землю...", "40": "Высадка деревьев...", "41": "Посев трав...", "42": "Высадка водорослей...", @@ -72,8 +73,10 @@ "73": "Подтверждение сохранения мира...", "74": "Слизни падают с неба!", "75": "Слизни прекратили падать с неба.", + "76": "Создание конструкций...", "77": "Добавление травы...", "78": "Опустынивание...", + "79": "Придание колорита стенам...", "7": "Создание случайных отверстий...", "80": "Долбление мрамора", "81": "Выращивание гранита...", @@ -159,6 +162,7 @@ "167": "Всегда покупай больше проводов, чем нужно!", "168": "Ты убедился, что твой прибор подключен?", "169": "О, ты знаешь, чего не хватает этому дому? Мерцающих огоньков.", + "17": "Следи за призом, купи линзу!", "170": "Когда выходит кровавая луна, небо становится красным. Есть в ней что-то такое, что заставляет вылезать монстров.", "171": "Эй, приятель, не знаешь, ты где-нибудь растет мертвая трава? О нет, мне просто интересно, вот и все.", "172": "Если бы ты выглянул, то увидел бы, что луна стала красной.", @@ -177,8 +181,11 @@ "184": "У тебя появилась руда, и теперь тебе нужно выплавить из нее слитки. Для этого нужна печь!", "185": "Печь можно сделать из факелов, древесины и камня. Убедись, что стоишь у верстака.", "186": "Для изготовления большинства предметов из слитков металла нужна наковальня.", + "187": "Наковальни можно изготовить из железа или купить у торговца.", "188": "В подземелье можно найти хрустальные сердца, которые увеличивают максимальное количество здоровья. Их можно разбить киркой.", + "189": "Собрав 5 звезд, их можно объединить для создания предмета, который увеличивает количество маны.", "19": "{PlayerName}, да? Я слышал кое-что интересное, друг!", + "190": "Звезды падают с неба ночью. Их можно использовать для создания самых разных предметов. Увидев звезду, ее нужно успеть забрать до рассвета, иначе она исчезнет.", "191": "Существует много способов привлечь новых жителей в свой город. Конечно, им нужны дома.", "192": "Чтобы комната считалась домом, в ней должен быть дверь, стул, стол и источник света. Еще у дома должны быть стены.", "193": "Два человека не будут жить в одном доме. Если дом уничтожают, люди будут искать новое место для жилья.", @@ -197,6 +204,7 @@ "204": "Если соединить линзы с алтарем демонов, то можно найти способ вызвать могущественного монстра. Хотя, лучше дождаться ночи, прежде чем использовать это.", "205": "Пищу для червей можно сделать, соединив гниль и ужасный порошок. Перед использованием не забудь убедиться, что ты находишься на земле, пораженной порчей.", "206": "Алтари демонов обычно можно найти на Порче. Для создания предметов нужно быть рядом с ними.", + "207": "Крюк-кошку можно сделать из 3 железных цепей и одного крюка. У скелетов, живущих глубоко под землей, обычно есть крючья, а цепи можно сделать из железных слитков.", "208": "Найдя горшок, обязательно разбей его. В них бывают разные полезные вещи.", "209": "Сокровища спрятаны по всему миру. Глубоко под землей можно найти столько замечательных вещей!", "21": "Статуя ангела, говоришь? Извини, я не торгую барахлом.", @@ -402,6 +410,7 @@ "400": "Умоляешь так быстро?! Не смотри на меня так, словно за ночь я передумаю! ", "401": "Не забудь разбивать все найденные багровые алтари. При этом обязательно будет происходить что-то хорошее!", "402": "Багровые алтари обычно можно найти в Багрянце. Для создания предметов нужно быть рядом с ними.", + "403": "Ты можешь создать кровавый позвоночник из позвонков. Перед использованием не забудь убедиться, что ты находишься на земле, пораженной багрянцем.", "41": "Прекрати быть ребенком! Мне доводилось видеть и хуже.", "42": "Здесь нужны швы!", "43": "Снова проблемы с теми хулиганами?", @@ -435,6 +444,7 @@ "69": "А что если попробовать использовать очищающий порошок на эбоните из Порчи?", "7": "Друг, ночь уже скоро. Делай выбор, пока можешь.", "70": "Мне надоело, что {ArmsDealer} флиртует со мной. Он не понимает, что мне уже 500 лет?", + "71": "Почему {Merchant} настойчиво пытается продать мне статуи ангела? Ведь все знают, что они бесполезны.", "72": "Ты видел старика, который бродит вокруг темницы? Он не очень хорошо выглядит…", "73": "Я продаю, что хочу! Если тебе это не нравится, очень жаль.", "74": "Почему в такие времена у тебя столько агрессии?", @@ -595,6 +605,7 @@ "213": "Приоритет смарт-курсора: кирка -> топор", "214": "Приоритет смарт-курсора: топор -> кирка", "215": "Смарт-укладка блоков: к курсору", + "216": "Смарт-укладка блоков: заполнение", "217": "Цвет границы", "218": "Курсор", "219": "Управление", @@ -639,7 +650,10 @@ "26": "Низкая", "27": "Случайно", "28": "Создать", + "29": "Персонажи не возрождаются", "2": "Отключиться", + "30": "Персонажи при смерти теряют предметы", + "31": "Персонажи при смерти теряют монеты", "32": "Выберите сложность", "33": "Рубашка", "34": "Нательная рубашка", @@ -790,6 +804,7 @@ "17": "Игрок {0} присоединился к команде желтых.", "18": "Добро пожаловать в", "19": "Игрок {0} присоединился.", + "1": "Неправильный пароль", "20": "Игрок {0} вышел.", "21": "/игроки", "22": "Игрок {0} присоединился к команде розовых.", @@ -888,6 +903,7 @@ "82": "Назад", "83": "Избранное", "84": "Нельзя менять команды внутри командных блоков!", + "85": "Жук", "86": "Утка", "87": "Бабочка", "88": "Светлячок", @@ -1035,6 +1051,7 @@ "LegacyChestType": { "0": "Сундук", "10": "Плющевой сундук", + "11": "Ледяной сундук сундук", "12": "Сундук из живой древесины", "13": "Небесный сундук", "14": "Сундук из мрачного дерева", @@ -1046,10 +1063,12 @@ "1": "Золотой сундук", "20": "Багровый сундук", "21": "Сундук освящения", + "22": "Замороженный сундук", "23": "Запертый сундук джунглей", "24": "Запертый сундук порчи", "25": "Запертый сундук багрянца", "26": "Запертый сундук освящения", + "27": "Запертый замороженный сундук", "28": "Родовой сундук", "29": "Медовый сундук", "2": "Запертый золотой сундук", @@ -1115,29 +1134,10 @@ "28": "{$ItemName.CrystalDresser}", "29": "{$ItemName.DynastyDresser}", "30": "{$ItemName.FrozenDresser}", - "31": "{$ItemName.LivingWoodDresser}", - "32": "{$ItemName.SpiderDresser}", - "33": "{$ItemName.LesionDresser}", - "34": "{$ItemName.SolarDresser}", - "35": "{$ItemName.VortexDresser}", - "36": "{$ItemName.NebulaDresser}", - "37": "{$ItemName.StardustDresser}", - "38": "{$ItemName.SandstoneDresser}", - "39": "{$ItemName.BambooDresser}" + "31": "{$ItemName.LivingWoodDresser}" }, "LegacyChestType2": { - "1": "{$ItemName.GoldenChest}", - "0": "{$ItemName.CrystalChest}", - "2": "{$ItemName.SpiderChest}", - "3": "{$ItemName.LesionChest}", - "4": "{$ItemName.GoldChest}", - "5": "{$ItemName.SolarChest}", - "6": "{$ItemName.VortexChest}", - "7": "{$ItemName.NebulaChest}", - "8": "{$ItemName.StardustChest}", - "9": "{$ItemName.GolfChest}", - "10": "{$ItemName.DesertChest}", - "11": "{$ItemName.BambooChest}", - "12": "{$ItemName.DungeonDesertChest}" + "0": "Хрустальный сундук", + "1": "Золотой сундук" } } \ No newline at end of file diff --git a/Localization/Content/ru-RU/NPCs.json b/Localization/Content/ru-RU/NPCs.json index 0af8438..a9902e4 100644 --- a/Localization/Content/ru-RU/NPCs.json +++ b/Localization/Content/ru-RU/NPCs.json @@ -68,6 +68,7 @@ "Vampire": "Вампир", "MotherSlime": "Мать слизней", "Truffle": "Трюфель", + "ZombieEskimo": "Зомби-эскимос", "Frankenstein": "Франкенштейн", "BlackRecluse": "Черный отшельник", "WallCreeper": "Стенной ползун", @@ -308,7 +309,9 @@ "SleepingAngler": "Спящий рыбак", "Grasshopper": "Кузнечик", "ChatteringTeethBomb": "Болтающая зубастая бомба", + "CultistArcherBlue": "Синий лучник-культист", "Demolitionist": "Подрывник", + "CultistArcherWhite": "Белый лучник-культист", "BrainScrambler": "Мозгокрут", "RayGunner": "Лучевой стрелок", "MartianOfficer": "Марсианский офицер", @@ -335,6 +338,7 @@ "Hornet": "Шершень", "ManEater": "Людоед", "ArmedZombie": "Зомби", + "ArmedZombieEskimo": "Зомби-эскимос", "ArmedZombiePincussion": "Зомби", "ArmedZombieSlimed": "Зомби", "ArmedZombieSwamp": "Зомби", @@ -424,9 +428,12 @@ "Crawdad": "Пресноводный рак", "Crawdad2": "Пресноводный рак", "CreatureFromTheDeep": "Существо из глубин", + "CrimsonBunny": "Кримтановый кролик", + "CrimsonGoldfish": "Кримтановая золотая рыбка", "CrimsonPenguin": "Порочный пингвин", "CultistBoss": "Культист-лунатик", "CultistBossClone": "Культист-лунатик", + "CultistDevote": "Священник-лунатик", "CultistDragonBody1": "Иллюзорный дракон", "CultistDragonBody2": "Иллюзорный дракон", "CultistDragonBody3": "Иллюзорный дракон", @@ -459,7 +466,7 @@ "DuneSplicerHead": "Рассеиватель дюн", "DuneSplicerTail": "Рассеиватель дюн", "EnchantedNightcrawler": "Зачарованный ночной ползун", - "GiantFlyingAntlion": "Взрослый муравьиный лев", + "FlyingAntlion": "Взрослый муравьиный лев", "Fritz": "Фриц", "GiantShelly": "Гигантский ракушечник", "GiantShelly2": "Гигантский ракушечник", @@ -507,6 +514,7 @@ "SandsharkCrimson": "Похититель плоти", "SandsharkHallow": "Кристальная акула", "SandSlime": "Песчаный слизень", + "ShadowFlameApparition": "Призрак теневого пламени", "SlimeSpiked": "Шипастый слизень", "Sluggy": "Слизнячок", "SolarFlare": "Солнечная вспышка", @@ -534,7 +542,7 @@ "VortexLarva": "Личинка чужого", "VortexRifleman": "Штормопроходец", "VortexSoldier": "Вихревик", - "GiantWalkingAntlion": "Муравьиный лев-воин", + "WalkingAntlion": "Муравьиный лев-воин", "DD2GoblinBomberT2": "{$NPCName.DD2GoblinBomberT1}", "DD2WyvernT3": "{$NPCName.DD2WyvernT1}", "DD2WyvernT2": "{$NPCName.DD2WyvernT1}", diff --git a/Localization/Content/ru-RU/Projectiles.json b/Localization/Content/ru-RU/Projectiles.json index 907a89d..895be54 100644 --- a/Localization/Content/ru-RU/Projectiles.json +++ b/Localization/Content/ru-RU/Projectiles.json @@ -713,10 +713,6 @@ "MonkStaffT3": "Ярость небесного дракона", "MonkStaffT3_Alt": "Ярость небесного дракона", "MonkStaffT3_AltShot": "Ярость небесного дракона", - "DD2JavelinHostileT3": "{$ProjectileName.DD2JavelinHostile}", - "Celeb2Rocket": "{$ProjectileName.Celeb2Weapon}", - "Celeb2RocketExplosive": "{$ProjectileName.Celeb2Weapon}", - "Celeb2RocketLarge": "{$ProjectileName.Celeb2Weapon}", - "Celeb2RocketLargeExplosive": "{$ProjectileName.Celeb2Weapon}" + "DD2JavelinHostileT3": "{$ProjectileName.DD2JavelinHostile}" } } \ No newline at end of file diff --git a/Localization/Content/ru-RU/Town.json b/Localization/Content/ru-RU/Town.json index 6d51a68..b460ca5 100644 --- a/Localization/Content/ru-RU/Town.json +++ b/Localization/Content/ru-RU/Town.json @@ -49,6 +49,7 @@ "Party": "Думаешь, кто-то будет против, если вместо свечек я обмотаю провод лампочками?" }, "BartenderSpecialText": { + "Party": "Мне бы и правда не помешал поздравительный текст!", "AfterDD2Tier1": "Поздравляю с победой армии Старца! Но я уверен, что это была не вся армия, в этой битве они показали себя не полностью.", "AfterDD2Tier2": "Армия Старца наращивает силы, но пока тебе удается отражать ее нападения! Хотя, что-то мне подсказывает, что на сегодня они с тобой еще не закончили.", "AfterDD2Tier3": "Тебе действительно удалось сдержать все силы армии Старца? Возможно, тебе стоит как-нибудь посетить Этерию.", @@ -74,9 +75,15 @@ "Party": "Я явно закатываю самые волшебные тусовки.", "AfterDD2Tier1": "Знаешь, мне вроде уже встречался похожий портал, но он был из золота." }, + "SteampunkerSpecialText": { + "Party": "Все говорят, что любят многоэтажные торты, поэтому я установила в мой торт дымовые трубы." + }, "CyborgSpecialText": { "Party": "Эта тусовка будет огонь! Или даже пожар!" }, + "SantaClausSpecialText": { + "Party": "Да ладно, у тебя же не было мысли, что я тусуюсь только на Новый год?" + }, "DemolitionistSpecialText": { "Party": "Сегодня тебе нужно быть осторожнее. У нас, гномов, довольно взрывные вечеринки.", "AfterDD2Start": "Не понимаю, почему мы не можем просто взорвать эти порталы." @@ -109,6 +116,7 @@ "Quest_Catfish": "Наконец-то я нашел в джунглях кота, который любит воду! Наверное, потому что он наполовину рыба. Не знаю, как так получилось, да и знать не хочу. Я просто хочу заполучить его, и как можно быстрее!\n\n(Поймано в джунглях на поверхности)", "Quest_Cloudfish": "До меня дошли слухи об островах, парящих высоко в небе. А еще говорят, что там скрываются невероятные сокровища! Хотя кому до этого дело, когда в облаках возникают озера, в которых плавают облачные рыбы! Хочу попробовать одну из таких на вкус, так что поймай мне ее поскорее!\n\n(Поймано в парящих озерах)", "Quest_Cursedfish": "В водах Порчи в глубинах земли плавает проклятая рыба! Она создана из проклятого пламени павших ужасов, которые там скрываются. Говорят, этот огонь не может потушить даже вода, и он может гореть вечно. Я уже придумал несколько крутых применений для этой рыбы! Ты же принесешь ее мне или у тебя кишка тонка?!\n\n(Поймано в Порче)", + "Quest_Dirtfish": "Я как раз подсекал одну крупную рыбину, как из лесного озера выскочил забавный зомби и начал нести чушь о какой-то «свирепой» рыбе, полностью состоящей из грязи! Сказал, что такая рыба может придушить десяток ребят его размера или что-то в этом роде… Мне она нужна! НЕМЕДЛЕННО!\n\n(Поймано на поверхности, в подземелье и пещерах)", "Quest_DynamiteFish": "Подрывник поднял шум из-за того, что уронил динамитную шашку в лесное озеро. И чего он так переживает, у него же их целая куча? Наверное, потому что шашка обзавелась плавниками и уплыла! Не знаю, из чего он делает свою взрывчатку, но эта шашка явно одержима! Поймай ее и принеси мне — всегда хотел рыбу-бомбу в коллекцию! И не спрашивай, зачем...\n\n(Поймано на поверхности)", "Quest_EaterofPlankton": "Уверен, у тебя не хватит смелости найти пожирателя планктона. Это искаженная рыба, мутировавшая из отрубленных частей самого Пожирателя миров! Поймай и принеси мне ее — докажи, что ты не трус!\n\n(Поймано в Порче)", "Quest_FallenStarfish": "Как же я люблю собирать яркие желтые звезды, которые падают с неба! А еще больше мне нравится, когда они приземляются кому-нибудь на голову. Но… но… нет ничего круче звезды, которая падает в лесное озеро и превращается в рыбу! Ты же тоже крутой — сможешь достать ее для меня?\n\n(Поймано в парящих озерах)", @@ -127,7 +135,7 @@ "Quest_GuideVoodooFish": "Демонам в подземном мире очень нравятся куклы вуду, но, кажется, там есть кукла, которую слишком накачали магической силой! Она превратилась в рыбу и действует по своей воле. Принеси мне ее! И остерегайся кипящей лавы, а то она сожжет тебя дотла и я не получу своей рыбы!\n\n(Поймано в пещерах)", "Quest_Wyverntail": "Я знаю кое-что, чего тыыыы не знаешь! Ладно, скажу тебе. Среди звезд летает ужасное создание! И я не выдумываю! Его называю Виверна! Но тебе ведь это уже было известно, правда? А знаешь, что Виверны вырастают из головастиков? Так что они почти как… лягушки! Вперед, вприпрыжку, найди мне такого головастика!\n\n(Поймано в парящих озерах)", "Quest_ZombieFish": "Ты мне не поверишь! Ночью я поймал в лесу уже мертвую рыбу! И она потом попыталась меня съесть! Я выбросил ее и убежал! А теперь хочу спрятать ее кому-нибудь в шкаф и посмотреть, что будет. Так что вылови мне ее обратно, хорошо?\n\n(Поймано на поверхности)", - "Quest_AmanitaFungifin": "Я нашел замечательное место с гигантскими светящимися грибами! Все вокруг светилось голубым! Я начал собирать грибы, которые нашел возле сверкающего голубого озера, но тут один из них цапнул меня и уплыл! Хочу отплатить ему тем же — хорошенько его потрепать! Поэтому найди его и принеси сюда!\n\n(Поймано на полях светящихся грибов)", + "Quest_AmanitiaFungifin": "Я нашел замечательное место с гигантскими светящимися грибами! Все вокруг светилось голубым! Я начал собирать грибы, которые нашел возле сверкающего голубого озера, но тут один из них цапнул меня и уплыл! Хочу отплатить ему тем же — хорошенько его потрепать! Поэтому найди его и принеси сюда!\n\n(Поймано на полях светящихся грибов)", "Quest_Angelfish": "Ты знал, что высоко в небе парят волшебные острова? Уверен, не знал! Говорят, на небесах живут ангелы. А я думаю, что у этих ангелов есть плавники и жабры! Верю, ты сможешь поймать мне одного из них!\n\n(Поймано в парящих озерах)", "Quest_BloodyManowar": "Ой! Не подходи! Меня ужалил Кровавый Мановар! Если ты недостаточно умен, чтобы знать о нем — это самая опасная медуза во всем мире {WorldName}! Отправляйся в этот гадкий багрянец и поймай ее, если тебе хватит мужества! \n\n(Поймано в Багрянце)", "Quest_Bonefish": "Обычно меня совершенно не беспокоят рыбьи кости, плавающие в воде под землей, но эти кости плавали осознанно! Ты думал, только человеческие скелеты болтаются по этому миру {WorldName}? Поймай мне такую рыбу, чтобы я подложил ее кому-нибудь в кровать!\n\n(Поймано в подземелье и пещерах)", @@ -139,6 +147,7 @@ "Quest_Fishron": "Ходит легенда о могучем создании, известном как Рыброн! Это частично свинья, частично дракон, а частично РЫБА! Слышал, это существо обитает в ледяных подземных озерах в самой холодной части мира! Я туда не пойду, так что пойди ТЫ и поймай его! Так не терпится уже заполучить его!\n\n(Поймано в подземной тундре)", "Quest_InfectedScabbardfish": "В мутных водах Порчи плавает очень длинная рыба, похожая на ножны меча! Она сильно напоминает черный камень, так что будь внимателен! Да, это я к тебе обращаюсь. Ты же будешь ее ловить, не я!\n\n(Поймано в Порче)", "Quest_Mudfish": "Ступай осторожно через воды джунглей! Почему? Нет, не потому, что я беспокоюсь, что тебя сожрут пираньи. Просто не хочу, чтобы ты наступил на одну из моих любимых рыб — грязевую рыбу! А еще я очень хочу, чтобы ты поймал мне ее!\n\n(Поймано в джунглях)", + "Quest_Slimefish": "В лесу есть куча отвратительных слизней. А рыбы-слизни еще отвратительней! Не хочу плавать со слизнями, поэтому вылови мне одну из этих рыб!\n\n(Поймано где угодно)", "Quest_TropicalBarracuda": "Пираньи и акулы — это такие уродливые существа! Ну ооочень уродливые! Ты знал, что даже если рыба выглядит очень красиво, она все равно может обглодать тебе лицо? Кстати, за такое зрелище я бы заплатил 2 платиновых монеты… Ладно, перейдем к делу — ты поймаешь мне эту рыбу. Только постарайся это сделать до того, как лишишься своего лица!\n\n(Поймано в джунглях на поверхности)", "Quest_TundraTrout": "А у тебя когда-нибудь были мысли о том, почему озера в заснеженных областях этого мира {WorldName} никогда не замерзают? У меня — нет. А вот рыба замерзает! Рыба из льда будет отличным подношением, которое примет великий и ужасный {Angler}! Отправляйся в путь, мой верный подданный, и поскорее принеси мне тундровую форель!\n\n(Поймано в тундре на поверхности)" }, diff --git a/Localization/Content/zh-Hans.json b/Localization/Content/zh-Hans.json index 2b94a34..7daa447 100644 --- a/Localization/Content/zh-Hans.json +++ b/Localization/Content/zh-Hans.json @@ -433,9 +433,7 @@ "YellowWires": "黄电线", "BirthdayParty_1": "好像{0}正在开派对", "BirthdayParty_2": "好像{0}和{1}正在开派对", - "BirthdayParty_3": "好像{0}、{1}和{2}正在开派对", - "RespawnInPrefix": "", - "RespawnInSuffix": "{0}" + "BirthdayParty_3": "好像{0}、{1}和{2}正在开派对" }, "GameUI": { "ActuationDeviceOff": "制动设备关", @@ -523,8 +521,7 @@ "QualityOff": "关", "UIScale": "UI比例:{0}% ({1}%)", "WaveQuality": "水波质量:{0}", - "ZoomCategory": "缩放", - "OpenFileFolder": "{$LegacyInterface.110}" + "ZoomCategory": "缩放" }, "Misc": { "ForceWaterSettling": "迫使流水停止。", @@ -611,12 +608,7 @@ "SeedCopied": "种子已复制", "ZoomIn": "{$LegacyMenu.168}", "ZoomOut": "{$LegacyMenu.169}", - "Ellipsis": "...", - "LightMode_Color": "{$LegacyMenu.55}", - "LightMode_White": "{$LegacyMenu.56}", - "LightMode_Retro": "{$LegacyMenu.57}", - "LightMode_Trippy": "{$LegacyMenu.58}", - "PlayerEmptyName": "{$Net.EmptyName}" + "Ellipsis": "..." }, "DeathSource": { "NPC": "{0},凶手是{1}。", @@ -701,8 +693,5 @@ "Chinese": "简体中文", "Portuguese": "Português brasileiro (巴西葡萄牙语)", "Polish": "Polski (波兰语)" - }, - "RandomWorldName_Composition": { - "6": "{Adjective} {Location}" } } \ No newline at end of file diff --git a/Localization/Content/zh-Hans/Game.json b/Localization/Content/zh-Hans/Game.json index e0d468a..88a26d0 100644 --- a/Localization/Content/zh-Hans/Game.json +++ b/Localization/Content/zh-Hans/Game.json @@ -15,6 +15,9 @@ "AdamantiteCaster": "魔力消耗减少19%", "AdamantiteMelee": "近战和移动速度各提高18%", "AdamantiteRanged": "25%的几率不消耗弹药", + "HallowCaster": "魔力消耗减少20%", + "HallowMelee": "近战和移动速度各提高19%", + "HallowRanged": "25%的几率不消耗弹药", "ShadowScale": "移动速度提高15%", "Wood": "1点防御力", "Crimson": "大大提高生命再生速度", @@ -264,49 +267,7 @@ "WitheredArmor": "你的盔甲降级了!", "WitheredWeapon": "你的攻击变弱了!", "Wrath": "伤害增加10%", - "ZephyrFish": "它喜欢在你周围游泳", - "DesertMinecartRight": "{$BuffDescription.MinecartRight}", - "DesertMinecartLeft": "{$BuffDescription.MinecartLeft}", - "FishMinecartRight": "{$BuffDescription.MinecartRight}", - "FishMinecartLeft": "{$BuffDescription.MinecartLeft}", - "BeeMinecartRight": "{$BuffDescription.MinecartRight}", - "BeeMinecartLeft": "{$BuffDescription.MinecartLeft}", - "LadybugMinecartRight": "{$BuffDescription.MinecartRight}", - "LadybugMinecartLeft": "{$BuffDescription.MinecartLeft}", - "PigronMinecartRight": "{$BuffDescription.MinecartRight}", - "PigronMinecartLeft": "{$BuffDescription.MinecartLeft}", - "SunflowerMinecartRight": "{$BuffDescription.MinecartRight}", - "SunflowerMinecartLeft": "{$BuffDescription.MinecartLeft}", - "HellMinecartRight": "{$BuffDescription.MinecartRight}", - "HellMinecartLeft": "{$BuffDescription.MinecartLeft}", - "ShroomMinecartRight": "{$BuffDescription.MinecartRight}", - "ShroomMinecartLeft": "{$BuffDescription.MinecartLeft}", - "AmethystMinecartRight": "{$BuffDescription.MinecartRight}", - "AmethystMinecartLeft": "{$BuffDescription.MinecartLeft}", - "TopazMinecartRight": "{$BuffDescription.MinecartRight}", - "TopazMinecartLeft": "{$BuffDescription.MinecartLeft}", - "SapphireMinecartRight": "{$BuffDescription.MinecartRight}", - "SapphireMinecartLeft": "{$BuffDescription.MinecartLeft}", - "EmeraldMinecartRight": "{$BuffDescription.MinecartRight}", - "EmeraldMinecartLeft": "{$BuffDescription.MinecartLeft}", - "RubyMinecartRight": "{$BuffDescription.MinecartRight}", - "RubyMinecartLeft": "{$BuffDescription.MinecartLeft}", - "DiamondMinecartRight": "{$BuffDescription.MinecartRight}", - "DiamondMinecartLeft": "{$BuffDescription.MinecartLeft}", - "AmberMinecartRight": "{$BuffDescription.MinecartRight}", - "AmberMinecartLeft": "{$BuffDescription.MinecartLeft}", - "BeetleMinecartRight": "{$BuffDescription.MinecartRight}", - "BeetleMinecartLeft": "{$BuffDescription.MinecartLeft}", - "MeowmereMinecartRight": "{$BuffDescription.MinecartRight}", - "MeowmereMinecartLeft": "{$BuffDescription.MinecartLeft}", - "PartyMinecartRight": "{$BuffDescription.MinecartRight}", - "PartyMinecartLeft": "{$BuffDescription.MinecartLeft}", - "PirateMinecartRight": "{$BuffDescription.MinecartRight}", - "PirateMinecartLeft": "{$BuffDescription.MinecartLeft}", - "SteampunkMinecartRight": "{$BuffDescription.MinecartRight}", - "SteampunkMinecartLeft": "{$BuffDescription.MinecartLeft}", - "CoffinMinecartRight": "{$BuffDescription.MinecartRight}", - "CoffinMinecartLeft": "{$BuffDescription.MinecartLeft}" + "ZephyrFish": "它喜欢在你周围游泳" }, "BuffName": { "AmmoBox": "弹药箱", @@ -512,49 +473,7 @@ "WitheredArmor": "枯萎盔甲", "WitheredWeapon": "枯萎武器", "Wrath": "怒气", - "ZephyrFish": "和风鱼", - "DesertMinecartRight": "{$BuffName.MinecartRight}", - "DesertMinecartLeft": "{$BuffName.MinecartLeft}", - "FishMinecartRight": "{$BuffName.MinecartRight}", - "FishMinecartLeft": "{$BuffName.MinecartLeft}", - "BeeMinecartRight": "{$BuffName.MinecartRight}", - "BeeMinecartLeft": "{$BuffName.MinecartLeft}", - "LadybugMinecartRight": "{$BuffName.MinecartRight}", - "LadybugMinecartLeft": "{$BuffName.MinecartLeft}", - "PigronMinecartRight": "{$BuffName.MinecartRight}", - "PigronMinecartLeft": "{$BuffName.MinecartLeft}", - "SunflowerMinecartRight": "{$BuffName.MinecartRight}", - "SunflowerMinecartLeft": "{$BuffName.MinecartLeft}", - "HellMinecartRight": "{$BuffName.MinecartRight}", - "HellMinecartLeft": "{$BuffName.MinecartLeft}", - "ShroomMinecartRight": "{$BuffName.MinecartRight}", - "ShroomMinecartLeft": "{$BuffName.MinecartLeft}", - "AmethystMinecartRight": "{$BuffName.MinecartRight}", - "AmethystMinecartLeft": "{$BuffName.MinecartLeft}", - "TopazMinecartRight": "{$BuffName.MinecartRight}", - "TopazMinecartLeft": "{$BuffName.MinecartLeft}", - "SapphireMinecartRight": "{$BuffName.MinecartRight}", - "SapphireMinecartLeft": "{$BuffName.MinecartLeft}", - "EmeraldMinecartRight": "{$BuffName.MinecartRight}", - "EmeraldMinecartLeft": "{$BuffName.MinecartLeft}", - "RubyMinecartRight": "{$BuffName.MinecartRight}", - "RubyMinecartLeft": "{$BuffName.MinecartLeft}", - "DiamondMinecartRight": "{$BuffName.MinecartRight}", - "DiamondMinecartLeft": "{$BuffName.MinecartLeft}", - "AmberMinecartRight": "{$BuffName.MinecartRight}", - "AmberMinecartLeft": "{$BuffName.MinecartLeft}", - "BeetleMinecartRight": "{$BuffName.MinecartRight}", - "BeetleMinecartLeft": "{$BuffName.MinecartLeft}", - "MeowmereMinecartRight": "{$BuffName.MinecartRight}", - "MeowmereMinecartLeft": "{$BuffName.MinecartLeft}", - "PartyMinecartRight": "{$BuffName.MinecartRight}", - "PartyMinecartLeft": "{$BuffName.MinecartLeft}", - "PirateMinecartRight": "{$BuffName.MinecartRight}", - "PirateMinecartLeft": "{$BuffName.MinecartLeft}", - "SteampunkMinecartRight": "{$BuffName.MinecartRight}", - "SteampunkMinecartLeft": "{$BuffName.MinecartLeft}", - "CoffinMinecartRight": "{$BuffName.MinecartRight}", - "CoffinMinecartLeft": "{$BuffName.MinecartLeft}" + "ZephyrFish": "和风鱼" }, "MapObject": { "Adamantite": "精金", @@ -626,166 +545,5 @@ "Roll": "{$LegacyMultiplayer.8}", "Party": "/队", "Emote": "/表情" - }, - "Bestiary_ItemDropConditions": { - "NotExpert": "", - "NotMasterMode": "", - "LegacyHack_IsBossAndNotExpert": "", - "IsCrimsonAndNotExpert": "", - "IsCorruptionAndNotExpert": "", - "NotFromStatue": "" - }, - "Bestiary_FlavorText": { - "npc_JungleSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_YellowSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_RedSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_PurpleSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_BlackSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_GreenSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_BlueSlime": "{$CommonBestiaryFlavor.Slime}", - "npc_DemonEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_Zombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_Skeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_AngryBones": "{$CommonBestiaryFlavor.AngryBones}", - "npc_Hornet": "{$CommonBestiaryFlavor.Hornet}", - "npc_Hellbat": "{$CommonBestiaryFlavor.LavaBat}", - "npc_BlueJellyfish": "{$CommonBestiaryFlavor.Jellyfish}", - "npc_PinkJellyfish": "{$CommonBestiaryFlavor.Jellyfish}", - "npc_Mummy": "{$CommonBestiaryFlavor.Mummy}", - "npc_DarkMummy": "{$CommonBestiaryFlavor.Mummy}", - "npc_LightMummy": "{$CommonBestiaryFlavor.Mummy}", - "npc_Mimic": "{$CommonBestiaryFlavor.Mimic}", - "npc_GreenJellyfish": "{$CommonBestiaryFlavor.Jellyfish}", - "npc_BaldZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_WanderingEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_Penguin": "{$CommonBestiaryFlavor.Penguin}", - "npc_PenguinBlack": "{$CommonBestiaryFlavor.Penguin}", - "npc_Lavabat": "{$CommonBestiaryFlavor.LavaBat}", - "npc_PigronCorruption": "{$CommonBestiaryFlavor.Pigron}", - "npc_PigronHallow": "{$CommonBestiaryFlavor.Pigron}", - "npc_PigronCrimson": "{$CommonBestiaryFlavor.Pigron}", - "npc_PincushionZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_SwampZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_TwiggyZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_CataractEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_SleepyEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_DialatedEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_GreenEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_PurpleEye": "{$CommonBestiaryFlavor.DemonEye}", - "npc_FemaleZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_HeadacheSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_MisassembledSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_PantlessSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_HornetFatty": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetHoney": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetLeafy": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetSpikey": "{$CommonBestiaryFlavor.Hornet}", - "npc_HornetStingy": "{$CommonBestiaryFlavor.Hornet}", - "npc_ZombieMushroom": "{$CommonBestiaryFlavor.MushroomZombie}", - "npc_ZombieMushroomHat": "{$CommonBestiaryFlavor.MushroomZombie}", - "npc_FungiBulb": "{$CommonBestiaryFlavor.FungiBulb}", - "npc_GiantFungiBulb": "{$CommonBestiaryFlavor.FungiBulb}", - "npc_RustyArmoredBonesAxe": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_RustyArmoredBonesFlail": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_RustyArmoredBonesSword": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_RustyArmoredBonesSwordNoArmor": "{$CommonBestiaryFlavor.RustyArmoredBones}", - "npc_BlueArmoredBones": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_BlueArmoredBonesMace": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_BlueArmoredBonesNoPants": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_BlueArmoredBonesSword": "{$CommonBestiaryFlavor.BlueArmoredBones}", - "npc_HellArmoredBones": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_HellArmoredBonesSpikeShield": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_HellArmoredBonesMace": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_HellArmoredBonesSword": "{$CommonBestiaryFlavor.HellArmoredBones}", - "npc_RaggedCaster": "{$CommonBestiaryFlavor.RaggedCaster}", - "npc_RaggedCasterOpenCoat": "{$CommonBestiaryFlavor.RaggedCaster}", - "npc_Necromancer": "{$CommonBestiaryFlavor.Necromancer}", - "npc_NecromancerArmored": "{$CommonBestiaryFlavor.Necromancer}", - "npc_DiabolistRed": "{$CommonBestiaryFlavor.Diabolist}", - "npc_DiabolistWhite": "{$CommonBestiaryFlavor.Diabolist}", - "npc_AngryBonesBig": "{$CommonBestiaryFlavor.AngryBones}", - "npc_AngryBonesBigMuscle": "{$CommonBestiaryFlavor.AngryBones}", - "npc_AngryBonesBigHelmet": "{$CommonBestiaryFlavor.AngryBones}", - "npc_Scarecrow1": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow2": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow3": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow4": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow5": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow6": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow7": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow8": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow9": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_Scarecrow10": "{$CommonBestiaryFlavor.Scarecrow}", - "npc_DemonEyeOwl": "{$CommonBestiaryFlavor.CostumeDemonEye}", - "npc_DemonEyeSpaceship": "{$CommonBestiaryFlavor.CostumeDemonEye}", - "npc_ZombieDoctor": "{$CommonBestiaryFlavor.CostumeZombie}", - "npc_ZombieSuperman": "{$CommonBestiaryFlavor.CostumeZombie}", - "npc_ZombiePixie": "{$CommonBestiaryFlavor.CostumeZombie}", - "npc_SkeletonTopHat": "{$CommonBestiaryFlavor.CostumeSkeleton}", - "npc_SkeletonAstonaut": "{$CommonBestiaryFlavor.CostumeSkeleton}", - "npc_SkeletonAlien": "{$CommonBestiaryFlavor.CostumeSkeleton}", - "npc_ZombieXmas": "{$CommonBestiaryFlavor.ZombieXmas}", - "npc_ZombieSweater": "{$CommonBestiaryFlavor.ZombieXmas}", - "npc_SlimeRibbonWhite": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_SlimeRibbonYellow": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_SlimeRibbonGreen": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_SlimeRibbonRed": "{$CommonBestiaryFlavor.RibbonSlime}", - "npc_ZombieElf": "{$CommonBestiaryFlavor.ZombieElf}", - "npc_ZombieElfBeard": "{$CommonBestiaryFlavor.ZombieElf}", - "npc_ZombieElfGirl": "{$CommonBestiaryFlavor.ZombieElf}", - "npc_ArmedZombie": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombiePincushion": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombieSwamp": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombieTwiggy": "{$CommonBestiaryFlavor.Zombie}", - "npc_ArmedZombieCenx": "{$CommonBestiaryFlavor.Zombie}", - "npc_GoldBird": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldBunny": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldButterfly": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldFrog": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldGrasshopper": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldMouse": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldWorm": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_BoneThrowingSkeleton": "{$CommonBestiaryFlavor.Skeleton}", - "npc_BoneThrowingSkeleton2": "{$CommonBestiaryFlavor.Skeleton}", - "npc_BoneThrowingSkeleton3": "{$CommonBestiaryFlavor.Skeleton}", - "npc_BoneThrowingSkeleton4": "{$CommonBestiaryFlavor.Skeleton}", - "npc_GiantWalkingAntlion": "{$CommonBestiaryFlavor.AntlionCharger}", - "npc_GiantFlyingAntlion": "{$CommonBestiaryFlavor.AntlionSwarmer}", - "npc_DesertLamiaLight": "{$CommonBestiaryFlavor.Lamia}", - "npc_DesertLamiaDark": "{$CommonBestiaryFlavor.Lamia}", - "npc_SquirrelGold": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_SandShark": "{$CommonBestiaryFlavor.Sandshark}", - "npc_SandsharkCorrupt": "{$CommonBestiaryFlavor.Sandshark}", - "npc_SandsharkCrimson": "{$CommonBestiaryFlavor.Sandshark}", - "npc_SandsharkHallow": "{$CommonBestiaryFlavor.Sandshark}", - "npc_WalkingAntlion": "{$CommonBestiaryFlavor.AntlionCharger}", - "npc_FlyingAntlion": "{$CommonBestiaryFlavor.AntlionSwarmer}", - "npc_GoldGoldfish": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_GoldGoldfishWalker": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_BlackDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_BlueDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_GreenDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_OrangeDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_RedDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_YellowDragonfly": "{$CommonBestiaryFlavor.Dragonfly}", - "npc_GoldDragonfly": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldLadyBug": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldWaterStrider": "{$CommonBestiaryFlavor.GoldBaitCritter}", - "npc_GoldSeahorse": "{$CommonBestiaryFlavor.GoldCritter}", - "npc_IceMimic": "{$CommonBestiaryFlavor.Mimic}", - "npc_GemSquirrelAmethyst": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelTopaz": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelSapphire": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelEmerald": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelRuby": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelDiamond": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemSquirrelAmber": "{$CommonBestiaryFlavor.GemSquirrel}", - "npc_GemBunnyAmethyst": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyTopaz": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnySapphire": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyEmerald": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyRuby": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyDiamond": "{$CommonBestiaryFlavor.GemBunny}", - "npc_GemBunnyAmber": "{$CommonBestiaryFlavor.GemBunny}" } } \ No newline at end of file diff --git a/Localization/Content/zh-Hans/Items.json b/Localization/Content/zh-Hans/Items.json index a4f7327..bdc927e 100644 --- a/Localization/Content/zh-Hans/Items.json +++ b/Localization/Content/zh-Hans/Items.json @@ -1565,7 +1565,7 @@ "GuideVoodooFish": "向导巫毒鱼", "Wyverntail": "飞龙尾", "ZombieFish": "僵尸鱼", - "AmanitaFungifin": "毒菌鱼", + "AmanitiaFungifin": "毒菌鱼", "Angelfish": "天使鱼", "BloodyManowar": "血腥战神", "Bonefish": "骷髅鱼", @@ -4017,8 +4017,7 @@ "GraniteGolemBanner": "花岗岩巨人横幅", "RavagerScorpionBanner": "沙贼横幅", "MusicBoxDD2": "音乐盒(撒旦军队)", - "BossBagBetsy": "{$ItemName.SkeletronBossBag}", - "ManaCloakStar": "" + "BossBagBetsy": "{$ItemName.SkeletronBossBag}" }, "ItemTooltip": { "ShadowGreaves": "近战速度提高7%", @@ -4245,10 +4244,10 @@ "DTownsHelmet": "{$CommonItemTooltip.DevItem}", "DTownsBreastplate": "{$CommonItemTooltip.DevItem}", "DTownsLeggings": "{$CommonItemTooltip.DevItem}", - "DTownsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", - "WillsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", - "CrownosWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", - "CenxsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "DTownsWings": "{$CommonItemTooltip.DevItem}", + "WillsWings": "{$CommonItemTooltip.DevItem}", + "CrownosWings": "{$CommonItemTooltip.DevItem}", + "CenxsWings": "{$CommonItemTooltip.DevItem}", "CenxsDress": "{$CommonItemTooltip.DevItem}", "CenxsDressPants": "{$CommonItemTooltip.DevItem}", "ShinyRedBalloon": "增加跳跃高度", @@ -4299,7 +4298,7 @@ "FartInABalloon": "可让持有者二连跳\n增加跳跃高度", "PapyrusScarab": "提高仆从数量上限\n提高仆从的伤害和击退力", "CelestialStone": "小幅增加伤害、近战速度、暴击率、\n生命再生、防御力、拾取速度和仆从击退力", - "Hoverboard": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", + "Hoverboard": "{$CommonItemTooltip.FlightAndSlowfall}\n按住DOWN和JUMP可悬停", "Present": "{$CommonItemTooltip.RightClickToOpen}", "Flipper": "可游泳", "RedRyder": "“别把自己的眼球射出来了!”", @@ -4493,7 +4492,7 @@ "SuspiciousLookingEye": "召唤克苏鲁之眼", "ClockworkAssaultRifle": "三轮爆炸\n只有第一枪消耗弹药", "MoonCharm": "在晚上将持有者变成狼人", - "BetsyWings": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", + "Ruler": "在屏幕上创建用于放置块的测量线", "SorcererEmblem": "魔法伤害增加15%", "BandofRegeneration": "缓慢再生生命", "WarriorEmblem": "近战伤害增加15%", @@ -4567,7 +4566,7 @@ "Vilethorn": "召唤魔刺", "Starfury": "使星星从天而降\n“用天堂怒火锻造而成”", "PurificationPowder": "净化邪恶", - "RedsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "RedsWings": "{$CommonItemTooltip.DevItem}", "RedsHelmet": "{$CommonItemTooltip.DevItem}", "RedsBreastplate": "{$CommonItemTooltip.DevItem}", "RedsLeggings": "{$CommonItemTooltip.DevItem}", @@ -4589,7 +4588,7 @@ "IceBlade": "射出冰雪矢", "IceBow": "射出寒霜箭", "FrostStaff": "射出寒霜流", - "Jetpack": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressUpToBooster}", + "Jetpack": "{$CommonItemTooltip.FlightAndSlowfall}\n按住UP可以飞得更快", "ButterflyWings": "{$CommonItemTooltip.FlightAndSlowfall}", "FallenStar": "日出后消失", "Seaweed": "召唤宠物海龟", @@ -4659,7 +4658,7 @@ "PaladinsShield": "吸收团队中玩家所受伤害的25%\n仅当生命值高于25%时有效", "Umbrella": "持有此物可减缓坠落速度", "ChlorophyteOre": "“对光作出反应”", - "SteampunkWings": "{$CommonItemTooltip.FlightAndSlowfall}", + "SteampunkWings": "可飞行和缓慢坠落", "IceSkates": "提供额外冰面行动力\n跌倒在冰上时冰不会碎", "SnowballLauncher": "迅速发射雪球", "ClimbingClaws": "可沿墙滑下\n结合鞋钉使用时可提升能力", @@ -4794,7 +4793,7 @@ "HoneyedGoggles": "召唤可骑乘的蜜蜂坐骑", "IceMirror": "盯着镜子便可回家", "IchorCampfire": "靠近篝火时生命再生提速", - "JimsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "JimsWings": "{$CommonItemTooltip.DevItem}", "JungleFishingCrate": "{$CommonItemTooltip.RightClickToOpen}", "LargeAmber": "适合夺取宝石。你死后掉落", "LaserRuler": "在屏幕上创建用于放置块的测量线", @@ -4907,7 +4906,7 @@ "SkiphsHelm": "{$CommonItemTooltip.DevItem}", "SkiphsPants": "{$CommonItemTooltip.DevItem}", "SkiphsShirt": "{$CommonItemTooltip.DevItem}", - "SkiphsWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", + "SkiphsWings": "{$CommonItemTooltip.DevItem}", "SliceOfCake": "你大快朵颐。其他人大快朵颐。管它呢。", "SlimeGun": "喷射一群无害的史莱姆", "SlimySaddle": "召唤可骑乘的史莱姆坐骑", @@ -4967,10 +4966,10 @@ "WeightedPressurePlateOrange": "玩家上去或下来时激活", "WeightedPressurePlatePink": "玩家上去或下来时激活", "WeightedPressurePlatePurple": "玩家上去或下来时激活", - "WingsNebula": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", + "WingsNebula": "{$CommonItemTooltip.FlightAndSlowfall}", "WingsSolar": "{$CommonItemTooltip.FlightAndSlowfall}", "WingsStardust": "{$CommonItemTooltip.FlightAndSlowfall}", - "WingsVortex": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}", + "WingsVortex": "{$CommonItemTooltip.FlightAndSlowfall}", "WireBulb": "点亮每种电线颜色对应的灯泡", "WireKite": "允许对电线进行终极控制!\n时按住不放可编辑电线设置", "WirePipe": "分离电线路径\n可锤击!", @@ -5180,7 +5179,7 @@ "BlackSlimeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BlackSlime}", "BlueArmoredBonesBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BlueArmoredBones}", "BlueCultistArcherBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CultistArcherBlue}", - "BlueCultistCasterBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CultistDevote}", + "BlueCultistCasterBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.None}", "BlueCultistFighterBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.None}", "BoneLeeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BoneLee}", "ClingerBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.Clinger}", @@ -5472,7 +5471,7 @@ "MonkShirt": "仆从和近战伤害各增加20%", "MonkStaffT1": "可在挥动以粉碎敌人时补充能量", "MonkStaffT2": "可在击打敌人时召唤鬼魂", - "MonkStaffT3": "握持时则可交替展开攻击!", + "MonkStaffT3": "握持时则可交替展开攻击!", "SquireAltHead": "提高哨兵数量上限,为你带来10%的仆从伤害", "SquireAltPants": "仆从伤害、暴击率各增加20%,移动速度提高30%", "SquireAltShirt": "仆从伤害增加30%,生命再生速度大幅提高", @@ -5481,177 +5480,13 @@ "SquirePlating": "仆从和近战伤害各增加15%", "ArkhalisShirt": "{$ItemTooltip.ArkhalisHat}", "ArkhalisPants": "{$ItemTooltip.ArkhalisHat}", - "ArkhalisWings": "{$ItemTooltip.ArkhalisHat}\n{$CommonItemTooltip.FlightAndSlowfall}", + "ArkhalisWings": "{$ItemTooltip.ArkhalisHat}", "ArkhalisHat": "{$CommonItemTooltip.DevItem}\n'我没有从网格中拿到'", "LeinforsHat": "{$CommonItemTooltip.DevItem}\n'为了保持甜美动人的风格'", "LeinforsShirt": "{$CommonItemTooltip.DevItem}\n'重获性感'", "LeinforsPants": "{$CommonItemTooltip.DevItem}\n'什叶的惊喜!没想到会用在裤子上吧?'", "LeinforsWings": "{$CommonItemTooltip.DevItem}\n'羽翼丰满!神马意思?!'", - "LeinforsAccessory": "{$CommonItemTooltip.DevItem}\n'为了获得最佳结果,请搭配意大利面食'", - "WoodenCrateHard": "{$ItemTooltip.WoodenCrate}", - "IronCrateHard": "{$ItemTooltip.IronCrate}", - "GoldenCrateHard": "{$ItemTooltip.GoldenCrate}", - "CorruptFishingCrateHard": "{$ItemTooltip.CorruptFishingCrate}", - "CrimsonFishingCrateHard": "{$ItemTooltip.CrimsonFishingCrate}", - "DungeonFishingCrateHard": "{$ItemTooltip.DungeonFishingCrate}", - "FloatingIslandFishingCrateHard": "{$ItemTooltip.FloatingIslandFishingCrate}", - "HallowedFishingCrateHard": "{$ItemTooltip.HallowedFishingCrate}", - "JungleFishingCrateHard": "{$ItemTooltip.JungleFishingCrate}", - "GolfBall": "{$CommonItemTooltip.GolfBall}", - "GolfClubIron": "{$CommonItemTooltip.GolfIron}", - "GolfClubPutter": "{$CommonItemTooltip.GolfPutter}", - "GolfClubWedge": "{$CommonItemTooltip.GolfWedge}", - "GolfClubDriver": "{$CommonItemTooltip.GolfDriver}", - "GolfBallDyedBlack": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedBlue": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedBrown": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedCyan": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedGreen": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedLimeGreen": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedOrange": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedPink": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedPurple": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedRed": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedSkyBlue": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedTeal": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedViolet": "{$CommonItemTooltip.GolfBall}", - "GolfBallDyedYellow": "{$CommonItemTooltip.GolfBall}", - "Apricot": "{$CommonItemTooltip.MinorStats}", - "Banana": "{$CommonItemTooltip.MinorStats}", - "BlackCurrant": "{$CommonItemTooltip.MinorStats}", - "BloodOrange": "{$CommonItemTooltip.MinorStats}", - "Cherry": "{$CommonItemTooltip.MinorStats}", - "Coconut": "{$CommonItemTooltip.MinorStats}", - "Dragonfruit": "{$CommonItemTooltip.MediumStats}", - "Elderberry": "{$CommonItemTooltip.MinorStats}", - "Grapefruit": "{$CommonItemTooltip.MinorStats}", - "Lemon": "{$CommonItemTooltip.MinorStats}", - "Mango": "{$CommonItemTooltip.MinorStats}", - "Peach": "{$CommonItemTooltip.MinorStats}", - "Pineapple": "{$CommonItemTooltip.MinorStats}", - "Plum": "{$CommonItemTooltip.MinorStats}", - "Rambutan": "{$CommonItemTooltip.MinorStats}", - "Starfruit": "{$CommonItemTooltip.MediumStats}", - "CanOfWorms": "{$CommonItemTooltip.RightClickToOpen}", - "FrozenCrate": "{$CommonItemTooltip.RightClickToOpen}", - "FrozenCrateHard": "{$CommonItemTooltip.RightClickToOpen}", - "OasisCrate": "{$CommonItemTooltip.RightClickToOpen}", - "OasisCrateHard": "{$CommonItemTooltip.RightClickToOpen}", - "OceanCrate": "{$CommonItemTooltip.RightClickToOpen}", - "OceanCrateHard": "{$CommonItemTooltip.RightClickToOpen}", - "LobsterTail": "{$CommonItemTooltip.MediumStats}", - "Oyster": "{$CommonItemTooltip.RightClickToOpen}", - "ShuckedOyster": "{$CommonItemTooltip.MinorStats}", - "GolfClubStoneIron": "{$CommonItemTooltip.GolfIron}", - "GolfClubRustyPutter": "{$CommonItemTooltip.GolfPutter}", - "GolfClubBronzeWedge": "{$CommonItemTooltip.GolfWedge}", - "GolfClubWoodDriver": "{$CommonItemTooltip.GolfDriver}", - "GolfClubMythrilIron": "{$CommonItemTooltip.GolfIron}", - "GolfClubLeadPutter": "{$CommonItemTooltip.GolfPutter}", - "GolfClubGoldWedge": "{$CommonItemTooltip.GolfWedge}", - "GolfClubPearlwoodDriver": "{$CommonItemTooltip.GolfDriver}", - "GolfClubTitaniumIron": "{$CommonItemTooltip.GolfIron}", - "GolfClubShroomitePutter": "{$CommonItemTooltip.GolfPutter}", - "GolfClubDiamondWedge": "{$CommonItemTooltip.GolfWedge}", - "GolfClubChlorophyteDriver": "{$CommonItemTooltip.GolfDriver}", - "TheBrideBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.TheBride}", - "ZombieMermanBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.ZombieMerman}", - "EyeballFlyingFishBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.EyeballFlyingFish}", - "BloodSquidBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodSquid}", - "BloodEelBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodEelHead}", - "GoblinSharkBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.GoblinShark}", - "BloodNautilusBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodNautilus}", - "AppleJuice": "{$CommonItemTooltip.MinorStats}", - "GrapeJuice": "{$CommonItemTooltip.MajorStats}", - "Lemonade": "{$CommonItemTooltip.MinorStats}", - "BananaDaiquiri": "{$CommonItemTooltip.MinorStats}", - "PeachSangria": "{$CommonItemTooltip.MinorStats}", - "PinaColada": "{$CommonItemTooltip.MinorStats}", - "TropicalSmoothie": "{$CommonItemTooltip.MinorStats}", - "BloodyMoscato": "{$CommonItemTooltip.MinorStats}", - "SmoothieofDarkness": "{$CommonItemTooltip.MinorStats}", - "PrismaticPunch": "{$CommonItemTooltip.MediumStats}", - "FruitJuice": "{$CommonItemTooltip.MinorStats}", - "FruitSalad": "{$CommonItemTooltip.MinorStats}", - "BurningSpirit": "{$PaintingArtist.Zoomo}", - "JawsOfDeath": "{$PaintingArtist.Darthkitten}", - "TheSandsOfSlime": "{$PaintingArtist.Criddle}", - "SnakesIHateSnakes": "{$PaintingArtist.Xman101}", - "LifeAboveTheSand": "{$PaintingArtist.Zoomo}", - "Oasis": "{$PaintingArtist.Khaios}", - "Uluru": "{$PaintingArtist.darthmorf}", - "VisitingThePyramids": "{$PaintingArtist.Leinfors}", - "BandageBoy": "{$PaintingArtist.Darthkitten}", - "DivineEye": "{$PaintingArtist.Darthkitten}", - "GolfPainting1": "{$PaintingArtist.Crowno}", - "GolfPainting2": "{$PaintingArtist.Crowno}", - "GolfPainting3": "{$PaintingArtist.Crowno}", - "DandelionBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.Dandelion}", - "GnomeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.Gnome}", - "Nevermore": "{$PaintingArtist.Crowno}", - "Reborn": "{$PaintingArtist.Crowno}", - "Graveyard": "{$PaintingArtist.Crowno}", - "GhostManifestation": "{$PaintingArtist.Crowno}", - "WickedUndead": "{$PaintingArtist.Crowno}", - "BloodyGoblet": "{$PaintingArtist.Crowno}", - "StillLife": "{$PaintingArtist.Crowno}", - "GroxTheGreatWings": "{$CommonItemTooltip.DevItem}\n{$CommonItemTooltip.FlightAndSlowfall}", - "GroxTheGreatHelm": "{$CommonItemTooltip.DevItem}", - "GroxTheGreatArmor": "{$CommonItemTooltip.DevItem}", - "GroxTheGreatGreaves": "{$CommonItemTooltip.DevItem}", - "KiteWyvern": "{$CommonItemTooltip.Kite}", - "KiteBlue": "{$CommonItemTooltip.Kite}", - "KiteBlueAndYellow": "{$CommonItemTooltip.Kite}", - "KiteRed": "{$CommonItemTooltip.Kite}", - "KiteRedAndYellow": "{$CommonItemTooltip.Kite}", - "KiteYellow": "{$CommonItemTooltip.Kite}", - "KiteBoneSerpent": "{$CommonItemTooltip.Kite}", - "KiteWorldFeeder": "{$CommonItemTooltip.Kite}", - "KiteBunny": "{$CommonItemTooltip.Kite}", - "KitePigron": "{$CommonItemTooltip.Kite}", - "KiteManEater": "{$CommonItemTooltip.Kite}", - "KiteJellyfishBlue": "{$CommonItemTooltip.Kite}", - "KiteJellyfishPink": "{$CommonItemTooltip.Kite}", - "KiteShark": "{$CommonItemTooltip.Kite}", - "KiteSandShark": "{$CommonItemTooltip.Kite}", - "KiteBunnyCorrupt": "{$CommonItemTooltip.Kite}", - "KiteBunnyCrimson": "{$CommonItemTooltip.Kite}", - "KiteGoldfish": "{$CommonItemTooltip.Kite}", - "KiteAngryTrapper": "{$CommonItemTooltip.Kite}", - "KiteKoi": "{$CommonItemTooltip.Kite}", - "KiteCrawltipede": "{$CommonItemTooltip.Kite}", - "KiteSpectrum": "{$CommonItemTooltip.Kite}", - "KiteWanderingEye": "{$CommonItemTooltip.Kite}", - "KiteUnicorn": "{$CommonItemTooltip.Kite}", - "FairyQueenBossBag": "{$CommonItemTooltip.RightClickToOpen}", - "LavaCrate": "{$CommonItemTooltip.RightClickToOpen}", - "LavaCrateHard": "{$CommonItemTooltip.RightClickToOpen}", - "HotlineFishingHook": "{$CommonItemTooltip.LavaFishing}", - "LavaFishingHook": "{$CommonItemTooltip.LavaFishing}", - "TeleportationPylonJungle": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonPurity": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonHallow": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonUnderground": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonOcean": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonDesert": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonSnow": "{$CommonItemTooltip.TeleportationPylon}", - "TeleportationPylonMushroom": "{$CommonItemTooltip.TeleportationPylon}", - "RockGolemBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.RockGolem}", - "BloodMummyBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BloodMummy}", - "SporeSkeletonBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.SporeSkeleton}", - "SporeBatBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.SporeBat}", - "LarvaeAntlionBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.LarvaeAntlion}", - "CrimsonBunnyBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CrimsonBunny}", - "CrimsonGoldfishBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CrimsonGoldfish}", - "CrimsonPenguinBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.CrimsonPenguin}", - "BigMimicCorruptionBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BigMimicCorruption}", - "BigMimicCrimsonBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BigMimicCrimson}", - "BigMimicHallowBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.BigMimicHallow}", - "MossHornetBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.MossHornet}", - "WanderingEyeBanner": "{$CommonItemTooltip.BannerBonus}{$NPCName.WanderingEye}", - "CreativeWings": "{$CommonItemTooltip.FlightAndSlowfall}", - "RainbowWings": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressUpToBooster}", - "LongRainbowTrailWings": "{$CommonItemTooltip.FlightAndSlowfall}\n{$CommonItemTooltip.PressDownToHover}\n{$CommonItemTooltip.PressUpToBooster}" + "LeinforsAccessory": "{$CommonItemTooltip.DevItem}\n'为了获得最佳结果,请搭配意大利面食'" }, "CommonItemTooltip": { "SpecialCrafting": "用于特殊制作", diff --git a/Localization/Content/zh-Hans/Legacy.json b/Localization/Content/zh-Hans/Legacy.json index 9626e58..e334fdf 100644 --- a/Localization/Content/zh-Hans/Legacy.json +++ b/Localization/Content/zh-Hans/Legacy.json @@ -1134,29 +1134,10 @@ "28": "{$ItemName.CrystalDresser}", "29": "{$ItemName.DynastyDresser}", "30": "{$ItemName.FrozenDresser}", - "31": "{$ItemName.LivingWoodDresser}", - "32": "{$ItemName.SpiderDresser}", - "33": "{$ItemName.LesionDresser}", - "34": "{$ItemName.SolarDresser}", - "35": "{$ItemName.VortexDresser}", - "36": "{$ItemName.NebulaDresser}", - "37": "{$ItemName.StardustDresser}", - "38": "{$ItemName.SandstoneDresser}", - "39": "{$ItemName.BambooDresser}" + "31": "{$ItemName.LivingWoodDresser}" }, "LegacyChestType2": { - "0": "{$ItemName.CrystalChest}", - "1": "{$ItemName.GoldenChest}", - "2": "{$ItemName.SpiderChest}", - "3": "{$ItemName.LesionChest}", - "4": "{$ItemName.GoldChest}", - "5": "{$ItemName.SolarChest}", - "6": "{$ItemName.VortexChest}", - "7": "{$ItemName.NebulaChest}", - "8": "{$ItemName.StardustChest}", - "9": "{$ItemName.GolfChest}", - "10": "{$ItemName.DesertChest}", - "11": "{$ItemName.BambooChest}", - "12": "{$ItemName.DungeonDesertChest}" + "0": "水晶宝箱", + "1": "金色宝箱" } } \ No newline at end of file diff --git a/Localization/Content/zh-Hans/NPCs.json b/Localization/Content/zh-Hans/NPCs.json index 7e0f422..db9f61f 100644 --- a/Localization/Content/zh-Hans/NPCs.json +++ b/Localization/Content/zh-Hans/NPCs.json @@ -466,7 +466,7 @@ "DuneSplicerHead": "沙虫", "DuneSplicerTail": "沙虫", "EnchantedNightcrawler": "附魔夜行者", - "GiantFlyingAntlion": "蚁狮蜂", + "FlyingAntlion": "蚁狮蜂", "Fritz": "弗里茨", "GiantShelly": "巨型卷壳怪", "GiantShelly2": "巨型卷壳怪", @@ -542,7 +542,7 @@ "VortexLarva": "异星幼虫", "VortexRifleman": "漩泥怪", "VortexSoldier": "星旋怪", - "GiantWalkingAntlion": "蚁狮马", + "WalkingAntlion": "蚁狮马", "DD2GoblinBomberT2": "{$NPCName.DD2GoblinBomberT1}", "DD2WyvernT3": "{$NPCName.DD2WyvernT1}", "DD2WyvernT2": "{$NPCName.DD2WyvernT1}", diff --git a/Localization/Content/zh-Hans/Projectiles.json b/Localization/Content/zh-Hans/Projectiles.json index d6da34d..62c51fc 100644 --- a/Localization/Content/zh-Hans/Projectiles.json +++ b/Localization/Content/zh-Hans/Projectiles.json @@ -713,10 +713,6 @@ "MonkStaffT3": "天龙之怒", "MonkStaffT3_Alt": "天龙之怒", "MonkStaffT3_AltShot": "天龙之怒", - "DD2JavelinHostileT3": "{$ProjectileName.DD2JavelinHostile}", - "Celeb2Rocket": "{$ProjectileName.Celeb2Weapon}", - "Celeb2RocketExplosive": "{$ProjectileName.Celeb2Weapon}", - "Celeb2RocketLarge": "{$ProjectileName.Celeb2Weapon}", - "Celeb2RocketLargeExplosive": "{$ProjectileName.Celeb2Weapon}" + "DD2JavelinHostileT3": "{$ProjectileName.DD2JavelinHostile}" } } \ No newline at end of file diff --git a/Localization/Content/zh-Hans/Town.json b/Localization/Content/zh-Hans/Town.json index 43a56d1..64af159 100644 --- a/Localization/Content/zh-Hans/Town.json +++ b/Localization/Content/zh-Hans/Town.json @@ -49,6 +49,7 @@ "Party": "你觉得会有人介意我把蛋糕上的蜡烛换成灯泡吗?" }, "BartenderSpecialText": { + "Party": "我真的需要一些生日祝福,尤莱!", "AfterDD2Tier1": "你在击退撒旦军队时做得很棒!但我敢肯定他们还会再来,他们这次并未奋勇作战。", "AfterDD2Tier2": "撒旦军队变得越来越强,但你始终能将他们击退!但我感觉他们不会轻易罢手。", "AfterDD2Tier3": "你真的让撒旦军队的全部力量陷入绝境了吗?或许你应该找个时间去埃特尼亚看看。", @@ -80,6 +81,9 @@ "CyborgSpecialText": { "Party": "这个派对要变成螺母了,甚至可能会变成螺栓!" }, + "SantaClausSpecialText": { + "Party": "说吧,你认为我不只是在圣诞节庆祝,对吧?" + }, "DemolitionistSpecialText": { "Party": "今天你可得小心点。我们矮人族喜欢开火爆的派对。", "AfterDD2Start": "我不明白为什么我们不能干脆炸掉这些传送门。" @@ -131,7 +135,7 @@ "Quest_GuideVoodooFish": "地狱的恶魔真的很喜欢巫毒娃娃,但我觉得有一个娃娃身藏着特别多的魔法! 它变成了一条鱼,还可以对自己施法。我命令你去地狱,给我带一个来! 如果是我的话,我会小心沸腾的熔岩,因为它会把你烧死,这样我就得不到鱼了!\n\n(抓捕位置:洞穴)", "Quest_Wyverntail": "我知道一些你...你不知道的事!好吧,我告诉你,有一只可怕的怪物在星空中飞来飞去!这不是我自己编出来的! 它叫飞龙!可是,可是,你已经知道了,是不是?你不知道的是,他们的出生和成长历程和蝌蚪一样! 所以,他们实际上像...像青蛙!开始行动,给我抓一只!\n\n(抓捕位置:天湖)", "Quest_ZombieFish": "你相信吗?!我晚上在森林里抓到一条已经死了的鱼!然后,它想吃我!我把它扔掉,然后扭头就跑! 现在,我要把它粘在别人的梳妆台上,看看会发生什么,所以你去把那条鱼给我抓回来,好吗?!\n\n(抓捕位置:地表)", - "Quest_AmanitaFungifin": "我在巨大的发光蘑菇中发现了这个惊人的地方!一切都是蓝的!我正在采摘蓝光湖畔的一些蘑菇,其中一只蘑菇突然咬了我一口,然后游走了!我想以其人之道还治其人之身,并狂咬他一顿!我的意思是,你去把它弄回来给我!\n\n(抓捕位置:发光蘑菇地)", + "Quest_AmanitiaFungifin": "我在巨大的发光蘑菇中发现了这个惊人的地方!一切都是蓝的!我正在采摘蓝光湖畔的一些蘑菇,其中一只蘑菇突然咬了我一口,然后游走了!我想以其人之道还治其人之身,并狂咬他一顿!我的意思是,你去把它弄回来给我!\n\n(抓捕位置:发光蘑菇地)", "Quest_Angelfish": "你知道吗,天空中漂浮着许多神奇的岛屿?你肯定不知道!他们说,天使住在天上,我相信这些天使都有鳍和鳃,在那游来游去!我相信你肯定能抓一个给我!\n\n(抓捕位置:天湖)", "Quest_BloodyManowar": "噢!别靠近我!我被一条血水母蜇了!怕你不聪明,不知道血水母是什么,所以我告诉你,它是整个 {WorldName} 中最凶险的水母!如果你敢,接近这个恶臭的猩红之地,把它抓来! \n\n(抓捕位置:猩红之地)", "Quest_Bonefish": "如果看到地下水中漂浮着鱼骨,我通常不怎么好奇,但是这只鱼骨竟然在游泳!什么,你以为在 {WorldName} 中只有人骷髅吗?去抓一只给我,这样我可以把它粘在别人的床上!\n\n(抓捕位置:地下和洞穴)", diff --git a/Localization/GameCulture.cs b/Localization/GameCulture.cs index d0d1849..4aa4de2 100644 --- a/Localization/GameCulture.cs +++ b/Localization/GameCulture.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Localization.GameCulture -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; @@ -13,67 +13,31 @@ namespace Terraria.Localization { public class GameCulture { - private static Dictionary _NamedCultures = new Dictionary() - { - { - GameCulture.CultureName.English, - new GameCulture("en-US", 1) - }, - { - GameCulture.CultureName.German, - new GameCulture("de-DE", 2) - }, - { - GameCulture.CultureName.Italian, - new GameCulture("it-IT", 3) - }, - { - GameCulture.CultureName.French, - new GameCulture("fr-FR", 4) - }, - { - GameCulture.CultureName.Spanish, - new GameCulture("es-ES", 5) - }, - { - GameCulture.CultureName.Russian, - new GameCulture("ru-RU", 6) - }, - { - GameCulture.CultureName.Chinese, - new GameCulture("zh-Hans", 7) - }, - { - GameCulture.CultureName.Portuguese, - new GameCulture("pt-BR", 8) - }, - { - GameCulture.CultureName.Polish, - new GameCulture("pl-PL", 9) - } - }; + public static readonly GameCulture English = new GameCulture("en-US", 1); + public static readonly GameCulture German = new GameCulture("de-DE", 2); + public static readonly GameCulture Italian = new GameCulture("it-IT", 3); + public static readonly GameCulture French = new GameCulture("fr-FR", 4); + public static readonly GameCulture Spanish = new GameCulture("es-ES", 5); + public static readonly GameCulture Russian = new GameCulture("ru-RU", 6); + public static readonly GameCulture Chinese = new GameCulture("zh-Hans", 7); + public static readonly GameCulture Portuguese = new GameCulture("pt-BR", 8); + public static readonly GameCulture Polish = new GameCulture("pl-PL", 9); private static Dictionary _legacyCultures; public readonly CultureInfo CultureInfo; public readonly int LegacyId; - public static GameCulture DefaultCulture { get; set; } - public bool IsActive => Language.ActiveCulture == this; public string Name => this.CultureInfo.Name; - public static GameCulture FromCultureName(GameCulture.CultureName name) => !GameCulture._NamedCultures.ContainsKey(name) ? GameCulture.DefaultCulture : GameCulture._NamedCultures[name]; - public static GameCulture FromLegacyId(int id) { if (id < 1) id = 1; - return !GameCulture._legacyCultures.ContainsKey(id) ? GameCulture.DefaultCulture : GameCulture._legacyCultures[id]; + return GameCulture._legacyCultures[id]; } - public static GameCulture FromName(string name) => GameCulture._legacyCultures.Values.SingleOrDefault((Func) (culture => culture.Name == name)) ?? GameCulture.DefaultCulture; - - static GameCulture() => GameCulture.DefaultCulture = GameCulture._NamedCultures[GameCulture.CultureName.English]; + public static GameCulture FromName(string name) => GameCulture._legacyCultures.Values.SingleOrDefault((Func) (culture => culture.Name == name)) ?? GameCulture.English; public GameCulture(string name, int legacyId) { @@ -88,19 +52,5 @@ namespace Terraria.Localization GameCulture._legacyCultures = new Dictionary(); GameCulture._legacyCultures.Add(legacyId, culture); } - - public enum CultureName - { - English = 1, - German = 2, - Italian = 3, - French = 4, - Spanish = 5, - Russian = 6, - Chinese = 7, - Portuguese = 8, - Polish = 9, - Unknown = 9999, // 0x0000270F - } } } diff --git a/Localization/Language.cs b/Localization/Language.cs index 08418a8..8244585 100644 --- a/Localization/Language.cs +++ b/Localization/Language.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Localization.Language -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System.Text.RegularExpressions; diff --git a/Localization/LanguageChangeCallback.cs b/Localization/LanguageChangeCallback.cs index a885cd4..0c9260e 100644 --- a/Localization/LanguageChangeCallback.cs +++ b/Localization/LanguageChangeCallback.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Localization.LanguageChangeCallback -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Localization diff --git a/Localization/LanguageManager.cs b/Localization/LanguageManager.cs index f78f874..d8bf4c2 100644 --- a/Localization/LanguageManager.cs +++ b/Localization/LanguageManager.cs @@ -1,11 +1,10 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Localization.LanguageManager -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Newtonsoft.Json; -using ReLogic.Content; using ReLogic.Graphics; using System; using System.Collections.Generic; @@ -15,7 +14,6 @@ using System.Linq; using System.Reflection; using System.Text.RegularExpressions; using System.Threading; -using Terraria.GameContent; using Terraria.Utilities; namespace Terraria.Localization @@ -23,9 +21,9 @@ namespace Terraria.Localization public class LanguageManager { public static LanguageManager Instance = new LanguageManager(); - private readonly Dictionary _localizedTexts = new Dictionary(); - private readonly Dictionary> _categoryGroupedKeys = new Dictionary>(); - private GameCulture _fallbackCulture = GameCulture.DefaultCulture; + private Dictionary _localizedTexts = new Dictionary(); + private Dictionary> _categoryGroupedKeys = new Dictionary>(); + private GameCulture _fallbackCulture = GameCulture.English; public event LanguageChangeCallback OnLanguageChanging; @@ -66,9 +64,9 @@ namespace Terraria.Localization this.ActiveCulture = culture; Thread.CurrentThread.CurrentCulture = culture.CultureInfo; Thread.CurrentThread.CurrentUICulture = culture.CultureInfo; - if (this.OnLanguageChanged != null) - this.OnLanguageChanged(this); - Asset deathText = FontAssets.DeathText; + if (this.OnLanguageChanged == null) + return; + this.OnLanguageChanged(this); } private void LoadLanguage(GameCulture culture) @@ -85,7 +83,7 @@ namespace Terraria.Localization { try { - string fileText = Utils.ReadEmbeddedResource(path); + string fileText = LanguageManager.ReadEmbeddedResource(path); if (fileText == null || fileText.Length < 2) throw new FileFormatException(); this.LoadLanguageFromFileText(fileText); @@ -100,6 +98,15 @@ namespace Terraria.Localization } } + private static string ReadEmbeddedResource(string path) + { + using (Stream manifestResourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(path)) + { + using (StreamReader streamReader = new StreamReader(manifestResourceStream)) + return streamReader.ReadToEnd(); + } + } + private void ProcessCopyCommandsInTexts() { Regex regex = new Regex("{\\$(\\w+\\.\\w+)}", RegexOptions.Compiled); diff --git a/Localization/LanguageSearchFilter.cs b/Localization/LanguageSearchFilter.cs index 717567c..bb27581 100644 --- a/Localization/LanguageSearchFilter.cs +++ b/Localization/LanguageSearchFilter.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Localization.LanguageSearchFilter -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Localization diff --git a/Localization/LocalizedText.cs b/Localization/LocalizedText.cs index 982dcbb..f9c27c1 100644 --- a/Localization/LocalizedText.cs +++ b/Localization/LocalizedText.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Localization.LocalizedText -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System.ComponentModel; diff --git a/Localization/NetworkText.cs b/Localization/NetworkText.cs index 0140050..c59767c 100644 --- a/Localization/NetworkText.cs +++ b/Localization/NetworkText.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Localization.NetworkText -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; @@ -127,7 +127,7 @@ namespace Terraria.Localization } catch (Exception ex) { - string str = "NetworkText.ToString() threw an exception.\n" + this.ToDebugInfoString() + "\n" + "Exception: " + (object) ex; + string str = "NetworkText.ToString() threw an exception.\n" + this.ToDebugInfoString() + "\n" + "Exception: " + ex.ToString(); this.SetToEmptyLiteral(); } return this._text; diff --git a/Main.cs b/Main.cs index 6868f42..0a8e27c 100644 --- a/Main.cs +++ b/Main.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Main -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Win32; @@ -10,16 +10,11 @@ using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -using ReLogic.Content; -using ReLogic.Content.Sources; using ReLogic.Graphics; using ReLogic.Localization.IME; using ReLogic.OS; -using ReLogic.Peripherals.RGB; using ReLogic.Utilities; using System; -using System.Collections; -using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics; using System.Drawing; @@ -29,36 +24,25 @@ using System.Reflection; using System.Runtime.InteropServices; using System.Text; using System.Threading; -using System.Threading.Tasks; using System.Windows.Forms; using Terraria.Achievements; using Terraria.Audio; using Terraria.Chat; using Terraria.Cinematics; using Terraria.DataStructures; -using Terraria.Enums; using Terraria.GameContent; using Terraria.GameContent.Achievements; -using Terraria.GameContent.Ambience; -using Terraria.GameContent.Bestiary; -using Terraria.GameContent.Creative; -using Terraria.GameContent.Drawing; using Terraria.GameContent.Events; -using Terraria.GameContent.Golf; -using Terraria.GameContent.ItemDropRules; using Terraria.GameContent.Liquid; -using Terraria.GameContent.NetModules; using Terraria.GameContent.Skies; +using Terraria.GameContent.Tile_Entities; using Terraria.GameContent.UI; -using Terraria.GameContent.UI.BigProgressBar; using Terraria.GameContent.UI.Chat; using Terraria.GameContent.UI.States; using Terraria.GameInput; using Terraria.Graphics; using Terraria.Graphics.Capture; using Terraria.Graphics.Effects; -using Terraria.Graphics.Light; -using Terraria.Graphics.Renderers; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.Initializers; @@ -72,31 +56,17 @@ using Terraria.UI; using Terraria.UI.Chat; using Terraria.UI.Gamepad; using Terraria.Utilities; -using Terraria.WorldBuilding; +using Terraria.World.Generation; namespace Terraria { public class Main : Game { - private const string versionStringBecauseTheyreTheSame = "v1.4.0.5"; - public const int curRelease = 230; - public const string assemblyVersionNumber = "1.4.0.5"; - public const string copyrightText = "Copyright © 2020 Re-Logic"; - public const ulong WorldGeneratorVersion = 987842478081; - public static Dictionary MinimapFrames = new Dictionary(); - public static MinimapFrame ActiveMinimapFrame; - public static Dictionary PlayerResourcesSets = new Dictionary(); - public static IPlayerResourcesDisplaySet ActivePlayerResourcesSet; - public static int mapDelay = 2; - public const string TerrariaSaveFolderPath = "Terraria"; - public static IAssetRepository Assets; - public static AssetSourceController AssetSourceController; - private volatile bool _musicLoaded; - private volatile bool _artLoaded; - private volatile bool _begunMainAsyncLoad; - public static int CurrentDrawnEntityShader; - public static Entity CurrentDrawnEntity; - private static bool _WeGameReqExit = false; + public const int curRelease = 194; + public const ulong WorldGeneratorVersion = 833223655425; + private const string versionStringBecauseTheyreTheSame = "v1.3.5.3"; + public const string assemblyVersionNumber = "1.3.5.3"; + public static bool RunningAchievementEnabled = true; public static float ForcedMinimumZoom = 1f; public static SpriteViewMatrix GameViewMatrix; public static SpriteViewMatrix BackgroundViewMatrix; @@ -106,141 +76,126 @@ namespace Terraria private static float _uiScaleUsed = 1f; public static float GameZoomTarget = 1f; public static bool LightingEveryFrame = true; - public static bool SettingsUnlock_WorldEvil; + public static bool SettingsUnlock_WorldEvil = false; public static bool SettingsEnabled_MinersWobble = true; - public static bool SettingBlockGamepadsEntirely; - public static bool SettingDontScaleMainMenuUp; - public static bool SettingsEnabled_OpaqueBoxBehindTooltips = true; - public static bool SettingMusicReplayDelayEnabled = false; - public static bool HidePassword; - public static bool ReversedUpDownArmorSetBonuses; - public static Microsoft.Xna.Framework.Color MouseBorderColor = new Microsoft.Xna.Framework.Color(64, 64, 64, 64); - public static bool MouseShowBuildingGrid; - public static bool AllowUnfocusedInputOnGamepad; + public static bool HidePassword = false; + public static bool ReversedUpDownArmorSetBonuses = false; + public static Microsoft.Xna.Framework.Color MouseBorderColor = Microsoft.Xna.Framework.Color.Transparent; + public static bool MouseShowBuildingGrid = false; + public static bool AllowUnfocusedInputOnGamepad = false; public static bool InvisibleCursorForGamepad = true; public static bool GamepadDisableCursorItemIconInner = true; - public static bool GamepadDisableInstructionsDisplay; + public static bool GamepadDisableInstructionsDisplay = false; public static bool CrouchingEnabled = false; - private static GameNotificationType _flashNotificationType = GameNotificationType.All; - public static float MouseBuildingGridAlpha; + public static float MouseBuildingGridAlpha = 0.0f; public static bool CaptureModeDisabled = false; public bool unityMouseOver; public static Main instance; - public static ChromaEngine Chroma; - public static ChromaHotkeyPainter ChromaPainter; - public static World ActiveWorld = new World(); - public static Camera Camera = new Camera(); - public static IPlayerRenderer PlayerRenderer = (IPlayerRenderer) new LegacyPlayerRenderer(); - public static IPlayerRenderer PotionOfReturnRenderer = (IPlayerRenderer) new ReturnGatePlayerRenderer(); - public static MapHeadRenderer MapPlayerRenderer = new MapHeadRenderer(); - public static NPCHeadRenderer TownNPCHeadRenderer = (NPCHeadRenderer) null; - public static NPCHeadRenderer BossNPCHeadRenderer = (NPCHeadRenderer) null; - public static string versionNumber = "v1.4.0.5"; - public static string versionNumber2 = "v1.4.0.5"; - public static string SavePath = Program.LaunchParameters.ContainsKey("-savedirectory") ? Program.LaunchParameters["-savedirectory"] : Platform.Get().GetStoragePath("Terraria"); - public static bool AnnouncementBoxDisabled; + public static string versionNumber = "v1.3.5.3"; + public static string versionNumber2 = "v1.3.5.3"; + public static string SavePath = Program.LaunchParameters.ContainsKey("-savedirectory") ? Program.LaunchParameters["-savedirectory"] : ((Platform) Platform.Current).GetStoragePath("Terraria"); + public static bool AnnouncementBoxDisabled = false; public static int AnnouncementBoxRange = -1; public static string AutogenSeedName; - private static GameModeData _currentGameModeInfo = GameModeData.NormalMode; - public static Dictionary RegisterdGameModes = new Dictionary() - { - { - 0, - GameModeData.NormalMode - }, - { - 1, - GameModeData.ExpertMode - }, - { - 2, - GameModeData.MasterMode - }, - { - 3, - GameModeData.CreativeMode - } - }; - private static bool? _overrideForExpertMode = new bool?(); - private static bool? _overrideForMasterMode = new bool?(); - public static bool drunkWorld = false; - public static bool getGoodWorld = false; public static Vector2 destroyerHB = new Vector2(0.0f, 0.0f); public static FavoritesFile LocalFavoriteData = new FavoritesFile(Main.SavePath + "/favorites.json", false); public static FavoritesFile CloudFavoritesData = new FavoritesFile("/favorites.json", true); public static FileMetadata WorldFileMetadata; public static FileMetadata MapFileMetadata; - public static PingMapLayer Pings = new PingMapLayer(); - public static MapIconOverlay MapIcons = new MapIconOverlay().AddLayer((IMapLayer) new SpawnMapLayer()).AddLayer((IMapLayer) new TeleportPylonsMapLayer()).AddLayer((IMapLayer) Main.Pings); - public static CreativeUI CreativeMenu = new CreativeUI(); - private static Vector2 _lastPingMousePosition = Vector2.Zero; - private static double _lastPingMouseDownTime = 0.0; private AchievementManager _achievements; - private AchievementAdvisor _achievementAdvisor; - public static BigProgressBarSystem BigBossProgressBar = new BigProgressBarSystem(); + private static List ActiveSoundInstances = new List(128); public static UserInterface MenuUI = new UserInterface(); public static UserInterface InGameUI = new UserInterface(); private static Main.OnPlayerSelected _pendingCharacterSelect; - public static bool drawBackGore; + public static bool drawBackGore = false; public static ulong LobbyId = 0; + private static object _audioLock = new object(); private static Microsoft.Xna.Framework.Color[] _mapColorCacheArray = new Microsoft.Xna.Framework.Color[30000]; + public static float expertLife = 2f; + public static float expertDamage = 2f; + public static float expertDebuffTime = 2f; + public static float expertKnockBack = 0.9f; + public static float expertNPCDamage = 1.5f; + public static float knockBackMultiplier = 1f; + public static float damageMultiplier = 1f; public WaterfallManager waterfallManager; public static WorldSections sectionManager; - public static bool ServerSideCharacter; + public static bool ServerSideCharacter = false; public static string clientUUID; public static bool ContentLoaded = false; + public static int maxMsg = 121; private static int toolTipDistance = 6; - public static float GlobalTimeWrappedHourly; + public static float GlobalTime = 0.0f; public static bool GlobalTimerPaused = false; - public static GameTime gameTimeCache = new GameTime(); - public static ulong TileFrameSeed = (ulong) Guid.NewGuid().GetHashCode(); - private static ulong _drawCycleCounter; + private static ulong _tileFrameSeed = (ulong) Guid.NewGuid().GetHashCode(); + private static ulong _drawCycleCounter = 0; public static ContentManager ShaderContentManager; public static Ref ScreenShaderRef = new Ref(); public static Ref PixelShaderRef = new Ref(); public static Ref TileShaderRef = new Ref(); - public static Ref VertexPixelShaderRef = new Ref(); public static int WaveQuality = 3; public static bool UseStormEffects = true; public static bool UseHeatDistortion = true; - public static int npcStreamSpeed = 30; - public static int musicError; - public static bool dedServFPS; - public static int dedServCount1; - public static int dedServCount2; + public static int npcStreamSpeed = 60; + public static int musicError = 0; + public static bool dedServFPS = false; + public static int dedServCount1 = 0; + public static int dedServCount2 = 0; public static bool superFast = false; public const int offLimitBorderTiles = 40; - public const int maxItemTypes = 5045; - public const int maxProjectileTypes = 950; - public const int maxNPCTypes = 663; - public const int maxTileSets = 623; - public const int maxWallTypes = 316; - public const int maxBuffTypes = 323; - public const int maxGlowMasks = 301; - public const int maxExtras = 212; - public const int maxGoreTypes = 1269; - public const int maxMusic = 89; - public const int MaxBannerTypes = 289; - public const int numArmorHead = 266; - public const int numArmorBody = 235; - public const int numArmorLegs = 218; - public const int numAccHandsOn = 22; - public const int numAccHandsOff = 14; - public const int numAccNeck = 11; - public const int numAccBack = 30; - public const int numAccFront = 9; - public const int numAccShoes = 25; - public const int numAccWaist = 17; - public const int numAccShield = 10; - public const int numAccFace = 16; + public const int maxItemTypes = 3930; + public const int maxProjectileTypes = 714; + public const int maxNPCTypes = 580; + public const int maxTileSets = 470; + public const int maxWallTypes = 231; + public const int maxBuffTypes = 206; + public const int maxGlowMasks = 252; + public const int maxExtras = 91; + public const int maxGoreTypes = 1087; + public const int maxMusic = 42; + public const int MaxBannerTypes = 267; + public const int numArmorHead = 216; + public const int numArmorBody = 210; + public const int numArmorLegs = 161; + public const int numAccHandsOn = 20; + public const int numAccHandsOff = 12; + public const int numAccNeck = 10; + public const int numAccBack = 14; + public const int numAccFront = 5; + public const int numAccShoes = 18; + public const int numAccWaist = 13; + public const int numAccShield = 7; + public const int numAccFace = 9; public const int numAccBalloon = 18; - public const int maxWings = 47; - public const int maxBackgrounds = 298; - public const int MaxShopIDs = 100; - private static float cameraLerp; - private static int cameraLerpTimer; - private static int cameraLerpTimeToggle; - private static bool cameraGamePadLerp; + public const int maxWings = 40; + public const int maxBackgrounds = 207; + public static int MaxShopIDs = 22; + public static bool[] hairLoaded = new bool[134]; + public static bool[] wingsLoaded = new bool[40]; + public static bool[] goreLoaded = new bool[1087]; + public static bool[] projectileLoaded = new bool[714]; + public static bool[] itemFlameLoaded = new bool[3930]; + public static bool[] backgroundLoaded = new bool[207]; + public static bool[] tileSetsLoaded = new bool[470]; + public static bool[] wallLoaded = new bool[231]; + public static bool[] NPCLoaded = new bool[580]; + public static bool[] armorHeadLoaded = new bool[216]; + public static bool[] armorBodyLoaded = new bool[210]; + public static bool[] armorLegsLoaded = new bool[161]; + public static bool[] accHandsOnLoaded = new bool[20]; + public static bool[] accHandsOffLoaded = new bool[12]; + public static bool[] accBackLoaded = new bool[14]; + public static bool[] accFrontLoaded = new bool[5]; + public static bool[] accShoesLoaded = new bool[18]; + public static bool[] accWaistLoaded = new bool[13]; + public static bool[] accShieldLoaded = new bool[7]; + public static bool[] accNeckLoaded = new bool[10]; + public static bool[] accFaceLoaded = new bool[9]; + public static bool[] accballoonLoaded = new bool[18]; + private static float cameraLerp = 0.0f; + private static int cameraLerpTimer = 0; + private static int cameraLerpTimeToggle = 0; + private static bool cameraGamePadLerp = false; public static Vector2[] OffsetsNPCOffhand = new Vector2[5] { new Vector2(14f, 34f), @@ -318,40 +273,43 @@ namespace Terraria new Vector2(0.0f, 2f), new Vector2(0.0f, 2f) }; - public static Vector2 CurrentPan = Vector2.Zero; + public static float zoomX; + public static float zoomY; public static float sunCircle; - public static int BlackFadeIn; + public static int BlackFadeIn = 0; public static bool noWindowBorder = false; - public static RasterizerState Rasterizer = RasterizerState.CullCounterClockwise; - private string _cachedTitle; - public static int undergroundBackground; - public static int oldUndergroundBackground; + private RasterizerState Rasterizer = RasterizerState.CullCounterClockwise; + private static string _cachedTitle; + public static int ugBack = 0; + public static int oldUgBack = 0; + public static int[] bgFrame = new int[1]; + public static int[] bgFrameCounter = new int[1]; public static bool skipMenu = false; public static bool verboseNetplay = false; public static bool stopTimeOuts = false; public static bool showSpam = false; public static bool showItemOwner = false; - public static bool[] townNPCCanSpawn = new bool[663]; + public static bool[] townNPCCanSpawn = new bool[580]; + public static int musicBox = -1; public static int musicBox2 = -1; public static byte HealthBarDrawSettings = 1; - public static bool runningCollectorsEdition; - public static float wFrCounter; - public static float wFrame; + public static bool cEd = false; + public static float wFrCounter = 0.0f; + public static float wFrame = 0.0f; public static float upTimer; public static float upTimerMax; public static float upTimerMaxDelay; - public static bool drawDiag; - public static bool drawRelease; - public static bool drawBetterDebug; - public static bool betterDebugRelease; - public static bool renderNow; - public static bool drawToScreen; - public static bool targetSet; + public static bool drawDiag = false; + public static bool drawRelease = false; + public static bool drawBetterDebug = false; + public static bool betterDebugRelease = false; + public static bool renderNow = false; + public static bool drawToScreen = false; + public static bool targetSet = false; public static int mouseX; public static int mouseY; public static int lastMouseX; public static int lastMouseY; - private static ConcurrentQueue _mainThreadActions = new ConcurrentQueue(); public static bool mouseLeft; public static bool mouseRight; public static bool isMouseLeftConsumedByUI = false; @@ -361,24 +319,16 @@ namespace Terraria public static float cloudBGAlpha; public static float cloudBGActive; public static int[] cloudBG = new int[2]{ 112, 113 }; - public static int[] treeMntBGSet1 = new int[2]; - public static int[] treeMntBGSet2 = new int[2]; - public static int[] treeMntBGSet3 = new int[2]; - public static int[] treeMntBGSet4 = new int[2]; - public static int[] treeBGSet1 = new int[3]; - public static int[] treeBGSet2 = new int[3]; - public static int[] treeBGSet3 = new int[3]; - public static int[] treeBGSet4 = new int[3]; + public static int[] treeMntBG = new int[2]; + public static int[] treeBG = new int[3]; public static int[] corruptBG = new int[3]; public static int[] jungleBG = new int[3]; public static int[] snowMntBG = new int[2]; public static int[] snowBG = new int[3]; public static int[] hallowBG = new int[3]; public static int[] crimsonBG = new int[3]; - public static int[] desertBG = new int[3]; - public static int[] mushroomBG = new int[3]; + public static int[] desertBG = new int[2]; public static int oceanBG; - public static int[] underworldBG = new int[5]; public static int[] treeX = new int[4]; public static int[] treeStyle = new int[4]; public static int[] caveBackX = new int[4]; @@ -388,81 +338,79 @@ namespace Terraria public static int jungleBackStyle; public static string debugWords = ""; public static bool gamePad = false; - public static bool xMas; - public static bool halloween; - public static bool forceXMasForToday; - public static bool forceHalloweenForToday; - public static bool DisableIntenseVisualEffects = false; + public static bool xMas = false; + public static bool halloween = false; public static int snowDust = 0; - public static bool changeTheTitle; - public static bool hairWindow; - public static bool clothesWindow; + public static bool chTitle = false; + public static bool hairWindow = false; + public static bool clothesWindow = false; public static bool ingameOptionsWindow = false; public static bool inFancyUI = false; - public static int keyCount; + public static int keyCount = 0; public static string[] keyString = new string[10]; public static int[] keyInt = new int[10]; - public static byte gFade; - public static float gFader; + public static byte gFade = 0; + public static float gFader = 0.0f; public static byte gFadeDir = 1; - public static bool shouldDrawNetDiagnosticsUI; - public static INetDiagnosticsUI ActiveNetDiagnosticsUI = (INetDiagnosticsUI) new NetDiagnosticsUI(); - public static IMultiplayerClosePlayersOverlay ActiveClosePlayersTeamOverlay = (IMultiplayerClosePlayersOverlay) new NewMultiplayerClosePlayersOverlay(); - public static double UpdateTimeAccumulator; - public static bool drawSkip; - public static int fpsCount; + public static bool netDiag = false; + public static int txData = 0; + public static int rxData = 0; + public static int txMsg = 0; + public static int rxMsg = 0; + public static int[] rxMsgType = new int[Main.maxMsg]; + public static int[] rxDataType = new int[Main.maxMsg]; + public static int[] txMsgType = new int[Main.maxMsg]; + public static int[] txDataType = new int[Main.maxMsg]; + public static double UpdateTimeAccumulator = 0.0; + public static bool drawSkip = false; + public static int fpsCount = 0; public static Stopwatch fpsTimer = new Stopwatch(); public bool gammaTest; - private const bool USE_ASYNC_LOAD = true; - private static bool _isAsyncLoadComplete; + public static int fountainColor = -1; + public static int monolithType = -1; public static bool showSplash = true; public static bool ignoreErrors = true; public static string defaultIP = ""; public static int dayRate = 1; - public static int desiredWorldTilesUpdateRate = 1; public static int maxScreenW = 1920; public static int maxScreenH = 1200; public static int minScreenW = 800; public static int minScreenH = 600; public static float iS = 1f; - public static bool render; - public static int qaStyle; - public static int buffScanAreaWidth = (Main.maxScreenW + 800) / 16 - 1; - public static int buffScanAreaHeight = (Main.maxScreenH + 800) / 16 - 1; - public static float musicPitch = 0.0f; - public static bool[] projHostile = new bool[950]; - public static bool[] projHook = new bool[950]; - public static bool[] pvpBuff = new bool[323]; - public static bool[] persistentBuff = new bool[323]; - public static bool[] vanityPet = new bool[323]; - public static bool[] lightPet = new bool[323]; - public static bool[] meleeBuff = new bool[323]; - public static bool[] debuff = new bool[323]; - public static bool[] buffNoSave = new bool[323]; - public static bool[] buffNoTimeDisplay = new bool[323]; - public static bool[] buffDoubleApply = new bool[323]; + public static bool render = false; + public static int qaStyle = 0; + public static int zoneX = 99; + public static int zoneY = 87; + public static float harpNote = 0.0f; + public static bool[] projHostile = new bool[714]; + public static bool[] projHook = new bool[714]; + public static bool[] pvpBuff = new bool[206]; + public static bool[] persistentBuff = new bool[206]; + public static bool[] vanityPet = new bool[206]; + public static bool[] lightPet = new bool[206]; + public static bool[] meleeBuff = new bool[206]; + public static bool[] debuff = new bool[206]; + public static bool[] buffNoSave = new bool[206]; + public static bool[] buffNoTimeDisplay = new bool[206]; + public static bool[] buffDoubleApply = new bool[206]; public static int maxMP = 10; public static string[] recentWorld = new string[Main.maxMP]; public static string[] recentIP = new string[Main.maxMP]; public static int[] recentPort = new int[Main.maxMP]; public static bool shortRender = true; public static bool BackgroundEnabled = true; - public static int instantBGTransitionCounter = 2; - public static int bgDelay; - public static int bgStyle; - private const int BG_STYLES_COUNT = 14; - public static float[] bgAlphaFrontLayer = new float[14]; - public static float[] bgAlphaFarBackLayer = new float[14]; - public static int[] bgFrame = new int[14]; - public static int[] bgFrameCounter = new int[14]; - public static int EquipPage; - public static int EquipPageSelected; - public int mouseNPCIndex = -1; - public int mouseNPCType = -1; - public static int wofNPCIndex = -1; - public static int wofDrawAreaTop; - public static int wofDrawAreaBottom; - public static int wofDrawFrameIndex; + public static int quickBG = 2; + public static int bgDelay = 0; + public static int bgStyle = 0; + public static float[] bgAlpha = new float[10]; + public static float[] bgAlpha2 = new float[10]; + public static int EquipPage = 0; + public static int EquipPageSelected = 0; + public int mouseNPC = -1; + public static int wof = -1; + public static int wofT; + public static int wofB; + public static int wofF = 0; public static int offScreenRange = 200; private RenderTarget2D backWaterTarget; public static RenderTarget2D waterTarget; @@ -474,84 +422,116 @@ namespace Terraria public static RenderTarget2D screenTarget; public static RenderTarget2D screenTargetSwap; public static int maxMapUpdates = 250000; - public static bool refreshMap; - public static int loadMapLastX; - public static bool loadMapLock; - public static bool loadMap; - public static bool mapReady; + public static bool refreshMap = false; + public static int loadMapLastX = 0; + public static bool loadMapLock = false; + public static bool loadMap = false; + public static bool mapReady = false; public static int textureMaxWidth = 2000; public static int textureMaxHeight = 1800; - public static bool updateMap; + public static bool updateMap = false; public static int mapMinX = 0; public static int mapMaxX = 0; - public static int mapMinY; - public static int mapMaxY; + public static int mapMinY = 0; + public static int mapMaxY = 0; public static int mapTimeMax = 30; public static int mapTime = Main.mapTimeMax; public static bool clearMap; public static int mapTargetX = 5; public static int mapTargetY = 2; + private static bool flameRingLoaded; + private Texture2D flameRingTexture; + private Texture2D mapDeathTexture; private RenderTarget2D[,] mapTarget = new RenderTarget2D[Main.mapTargetX, Main.mapTargetY]; private RenderTarget2D mapSectionTexture; public static bool[,] initMap = new bool[Main.mapTargetX, Main.mapTargetY]; public static bool[,] mapWasContentLost = new bool[Main.mapTargetX, Main.mapTargetY]; public const int numInfoIcons = 13; + public Texture2D[] infoIconTexture = new Texture2D[14]; + public static Texture2D[] wireUITexture = new Texture2D[12]; + public static Texture2D builderAccTexture; + public static Texture2D quicksIconTexture; + public static Texture2D[] clothesTexture = new Texture2D[4]; + public static Texture2D[] mapIconTexture = new Texture2D[9]; + private static Texture2D[] underworldTexture = new Texture2D[5]; + public static Texture2D mapTexture; + private Texture2D mapBG1Texture; + private Texture2D mapBG2Texture; + private Texture2D mapBG3Texture; + private Texture2D mapBG4Texture; + private Texture2D mapBG5Texture; + private Texture2D mapBG6Texture; + private Texture2D mapBG7Texture; + private Texture2D mapBG8Texture; + private Texture2D mapBG9Texture; + private Texture2D mapBG10Texture; + private Texture2D mapBG11Texture; + private Texture2D mapBG12Texture; + private Texture2D mapBG13Texture; + private Texture2D mapBG14Texture; + private Texture2D mapBG15Texture; + private Texture2D hueTexture; + public static Texture2D colorSliderTexture; + public static Texture2D colorBarTexture; + public static Texture2D colorBlipTexture; + public static Texture2D smartDigTexture; + public static Texture2D colorHighlightTexture; public static Microsoft.Xna.Framework.Color OurFavoriteColor = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, 231, 69); - public static bool mapInit; + public static Texture2D tileCrackTexture; + public static Texture2D LockOnCursorTexture; + private Texture2D iceBarrierTexture; + public static bool mapInit = false; public static bool mapEnabled = true; public static int mapStyle = 1; - public static float grabMapX; - public static float grabMapY; - public static int miniMapX; - public static int miniMapY; - public static int miniMapWidth; - public static int miniMapHeight; - public static float mapMinimapDefaultScale = 1.05f; - public static float mapMinimapScale = Main.mapMinimapDefaultScale; + public static float grabMapX = 0.0f; + public static float grabMapY = 0.0f; + public static int miniMapX = 0; + public static int miniMapY = 0; + public static int miniMapWidth = 0; + public static int miniMapHeight = 0; + public static float mapMinimapScale = 1.25f; public static float mapMinimapAlpha = 1f; public static float mapOverlayScale = 2.5f; public static float mapOverlayAlpha = 0.35f; - public static bool mapFullscreen; - public static bool resetMapFull; + public static bool mapFullscreen = false; + public static bool resetMapFull = false; public static float mapFullscreenScale = 4f; public static Vector2 mapFullscreenPos = new Vector2(-1f, -1f); - private static bool IsEnginePreloaded; - private static bool IsEngineLoaded; - private static uint _gameUpdateCount; - public static bool SkipAssemblyLoad; + private static bool IsEnginePreloaded = false; + private static bool IsEngineLoaded = false; + private static uint _gameUpdateCount = 0; + public static bool SkipAssemblyLoad = false; private int firstTileX; private int lastTileX; private int firstTileY; private int lastTileY; private double bgParallax; - private int bgStartX; + private int bgStart; private int bgLoops; private int bgStartY; private int bgLoopsY; - private int bgTopY; + private int bgTop; public static int renderCount = 99; private const int MF_BYPOSITION = 1024; public static GraphicsDeviceManager graphics; public static SpriteBatch spriteBatch; public static TileBatch tileBatch; - public static BasicDebugDrawer DebugDrawer; - public static SamplerState SamplerStateForCursor = SamplerState.LinearClamp; public static GenerationProgress AutogenProgress = new GenerationProgress(); - private static Process tServer; + private Process tServer = new Process(); private static Stopwatch saveTime = new Stopwatch(); public static KeyboardState keyState; public static KeyboardState oldKeyState; - public static Microsoft.Xna.Framework.Color mcColor = new Microsoft.Xna.Framework.Color(1f, 0.6f, 0.0f); - public static Microsoft.Xna.Framework.Color hcColor = new Microsoft.Xna.Framework.Color(1f, 0.15f, 0.1f); - public static Microsoft.Xna.Framework.Color creativeModeColor = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.HotPink, Microsoft.Xna.Framework.Color.White, 0.1f); + public static Microsoft.Xna.Framework.Color mcColor = new Microsoft.Xna.Framework.Color(125, 125, (int) byte.MaxValue); + public static Microsoft.Xna.Framework.Color hcColor = new Microsoft.Xna.Framework.Color(200, 125, (int) byte.MaxValue); public static Microsoft.Xna.Framework.Color highVersionColor = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, 0); public static Microsoft.Xna.Framework.Color errorColor = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, 0, 0); - public static bool craftingHide; - public static bool armorHide; + public static Microsoft.Xna.Framework.Color bgColor; + public static bool craftingHide = false; + public static bool armorHide = false; public static float craftingAlpha = 1f; public static float armorAlpha = 1f; - public static float[] buffAlpha = new float[323]; - public static bool hardMode; + public static float[] buffAlpha = new float[206]; + public static bool hardMode = false; public float chestLootScale = 1f; public bool chestLootHover; public float chestStackScale = 1f; @@ -572,26 +552,26 @@ namespace Terraria public static float gfxRate = 0.01f; public int DiscoStyle; public static int DiscoR = (int) byte.MaxValue; - public static int DiscoB; - public static int DiscoG; - public static int teamCooldown; + public static int DiscoB = 0; + public static int DiscoG = 0; + public static int teamCooldown = 0; public static int teamCooldownLen = 300; - public static bool gamePaused; - public static bool gameInactive; - public static int updatesCountedForFPS; - public static int drawsCountedForFPS; - public static int uCount; - public static int updateRate; - public static int frameRate; - public static bool RGBRelease; + public static bool gamePaused = false; + public static bool gameInactive = false; + public static int updatesCountedForFPS = 0; + public static int drawsCountedForFPS = 0; + public static int uCount = 0; + public static int updateRate = 0; + public static int frameRate = 0; + public static bool RGBRelease = false; public static bool qRelease = false; - public static bool netRelease; - public static bool frameRelease; + public static bool netRelease = false; + public static bool frameRelease = false; public static bool showFrameRate = false; - public static int magmaBGFrame; - public static int magmaBGFrameCounter; + public static int magmaBGFrame = 0; + public static int magmaBGFrameCounter = 0; public static int saveTimer = 0; - public static bool autoJoin; + public static bool autoJoin = false; public static bool serverStarting = false; public static float leftWorld = 0.0f; public static float rightWorld = 134400f; @@ -608,8 +588,9 @@ namespace Terraria public const int maxCombatText = 100; public const int maxItemText = 20; public const int maxPlayers = 255; + public static int ActivePlayersCount = 0; public static int maxNetPlayers = (int) byte.MaxValue; - public const int maxChests = 8000; + public const int maxChests = 1000; public const int maxItems = 400; public const int maxProjectiles = 1000; public const int maxNPCs = 200; @@ -618,62 +599,58 @@ namespace Terraria public static UIManageControls ManageControlsMenu = new UIManageControls(); public static UIAchievementsMenu AchievementsMenu = new UIAchievementsMenu(); public static int maxRain = 750; - public static int slimeWarningTime; + public static int slimeWarningTime = 0; public static int slimeWarningDelay = 420; public static float slimeRainNPCSlots = 0.65f; - public static bool[] slimeRainNPC = new bool[663]; - public static double slimeRainTime; - public static bool slimeRain; - public static int slimeRainKillCount; + public static bool[] slimeRainNPC = new bool[580]; + public static double slimeRainTime = 0.0; + public static bool slimeRain = false; + public static int slimeRainKillCount = 0; private const double slimeRainMaxTime = 54000.0; private const double slimeRainMinTime = 32400.0; private const double slimeRainMaxDelay = 604800.0; private const double slimeRainMinDelay = 302400.0; private const double slimeRainChance = 1728000.0; - public const int maxGore = 600; - public const int InventoryItemSlotsStart = 0; - public const int InventoryItemSlotsCount = 50; - public const int InventoryCoinSlotsStart = 50; - public const int InventoryCoinSlotsCount = 4; - public const int InventoryAmmoSlotsStart = 54; - public const int InventoryAmmoSlotsCount = 4; - public const int InventorySlotsTotal = 58; + public const int maxGore = 500; + public const int realInventory = 50; + public const int maxInventory = 58; public int invBottom = 210; - public const int maxLiquidTypes = 13; - public static float cameraX; - public static bool drewLava; - public static float[] liquidAlpha = new float[13]; - public static int waterStyle; - public static int WorldRollingBackupsCountToKeep = 2; - private static bool TOWMusicUnlocked = false; - private static bool swapMusic = false; + public const int maxItemSounds = 125; + public const int maxNPCHitSounds = 57; + public const int maxNPCKilledSounds = 62; + public const int maxLiquidTypes = 12; + public static float cameraX = 0.0f; + public static bool drewLava = false; + public static float[] liquidAlpha = new float[12]; + public static int waterStyle = 0; + public static int worldRate = 1; public static float caveParallax = 0.88f; public static int dungeonX; public static int dungeonY; - public static Terraria.Liquid[] liquid = new Terraria.Liquid[Terraria.Liquid.maxLiquid]; - public static LiquidBuffer[] liquidBuffer = new LiquidBuffer[50000]; - public static bool dedServ; + public static Terraria.Liquid[] liquid = new Terraria.Liquid[Terraria.Liquid.resLiquid]; + public static LiquidBuffer[] liquidBuffer = new LiquidBuffer[10000]; + public static bool dedServ = false; public static int spamCount = 0; - public static int curMusic; - public static int dayMusic; - public static int ugMusic; + public static int curMusic = 0; + public static int dayMusic = 0; + public static int ugMusic = 0; public int newMusic; public static bool showItemText = true; public static bool autoSave = true; public static bool validateSaves = true; - public static bool bannerMouseOver; + public static bool bannerMouseOver = false; public static string buffString = ""; public static string libPath = ""; - public static int lo; + public static int lo = 0; public static int LogoA = (int) byte.MaxValue; - public static int LogoB; - public static bool LogoT; + public static int LogoB = 0; + public static bool LogoT = false; public static string statusText = ""; public static string worldName = ""; public static int worldID; - public static int background; + public static int background = 0; public static int caveBackground = 0; - public static float ugBackTransition; + public static float ugBackTransition = 0.0f; public static Microsoft.Xna.Framework.Color tileColor; public static double worldSurface; public static double rockLayer; @@ -682,124 +659,447 @@ namespace Terraria public const double nightLength = 32400.0; public static bool dayTime = true; public static double time = 13500.0; - public static double timeForVisualEffects; - public static int moonPhase; - public static short sunModY; - public static short moonModY; - public static bool alreadyGrabbingSunOrMoon; - public static bool bloodMoon; - public static bool pumpkinMoon; - public static bool snowMoon; - public static float cloudAlpha; - public static float maxRaining; - public static float oldMaxRaining; - public static int rainTime; - public static bool raining; - public static bool eclipse; - public static float eclipseLight; - public static int checkForSpawns; - public static int helpText; + public static int moonPhase = 0; + public static short sunModY = 0; + public static short moonModY = 0; + public static bool grabSky = false; + public static bool bloodMoon = false; + public static bool pumpkinMoon = false; + public static bool snowMoon = false; + public static float cloudAlpha = 0.0f; + public static float maxRaining = 0.0f; + public static float oldMaxRaining = 0.0f; + public static int rainTime = 0; + public static bool raining = false; + public static bool eclipse = false; + public static float eclipseLight = 0.0f; + public static int checkForSpawns = 0; + public static int helpText = 0; public static int BartenderHelpTextIndex = 0; - public static bool autoGen; + public static bool autoGen = false; public static bool autoPause = false; - public static int[] projFrames = new int[950]; - public static bool[] projPet = new bool[950]; + public static int[] projFrames = new int[714]; + public static bool[] projPet = new bool[714]; public static float demonTorch = 1f; public static int demonTorchDir = 1; public static float martianLight = 1f; public static int martianLightDir = 1; - public static float masterColor = 1f; - public static int masterColorDir = 1; public static bool placementPreview = true; - public static SceneMetrics SceneMetrics; - public const int maxStars = 400; + public static int[] screenTileCounts = new int[470]; + public const int maxStars = 130; public static int numStars; - public const int maxStarTypes = 4; + public const int maxStarTypes = 5; public const int maxClouds = 200; - public const int maxCloudTypes = 37; - public static int weatherCounter; - public static int numClouds = 200; + public const int maxCloudTypes = 22; + public static int weatherCounter = 0; + public static int cloudLimit = 200; + public static int numClouds = Main.cloudLimit; public static int numCloudsTemp = Main.numClouds; - public static float windSpeedCurrent; - public static float windSpeedTarget; - public static int windCounter; - public static int extremeWindCounter; - public static bool windPhysics = false; - public static float windPhysicsStrength = 0.1f; - public static bool SettingsEnabled_TilesSwayInWind = true; + public static float windSpeedTemp = 0.0f; + public static float windSpeed = 0.0f; + public static float windSpeedSet = 0.0f; + public static float windSpeedSpeed = 0.0f; public static Cloud[] cloud = new Cloud[200]; public static bool resetClouds = true; - public static float SmoothedMushroomLightInfluence; - public static int fadeCounter; + public static int sandTiles; + public static int evilTiles; + public static int shroomTiles; + public static float shroomLight; + public static int snowTiles; + public static int holyTiles; + public static int waterCandles; + public static int peaceCandles; + public static int partyMonoliths; + public static int meteorTiles; + public static int bloodTiles; + public static int jungleTiles; + public static int dungeonTiles; + public static bool sunflower; + public static bool clock; + public static bool campfire; + public static bool starInBottle; + public static bool heartLantern; + public static int fadeCounter = 0; public static float invAlpha = 1f; public static float invDir = 1f; [ThreadStatic] public static UnifiedRandom rand; - public static bool allChestStackHover; - public static bool inventorySortMouseOver; - public static float GraveyardVisualIntensity; - public const int maxMoons = 9; + public static Texture2D[] chestStackTexture = new Texture2D[2]; + private static bool allChestStackHover = false; + private static bool inventorySortMouseOver = false; + public static Texture2D[] npcHeadTexture = new Texture2D[25]; + public static Texture2D[] npcHeadBossTexture = new Texture2D[37]; + public static Texture2D[] craftToggleTexture = new Texture2D[4]; + public static Texture2D[] inventorySortTexture = new Texture2D[2]; + public static Texture2D[] textGlyphTexture = new Texture2D[1]; + public static Texture2D[] hotbarRadialTexture = new Texture2D[3]; + public static Texture2D craftUpButtonTexture; + public static Texture2D craftDownButtonTexture; + public static Texture2D scrollLeftButtonTexture; + public static Texture2D scrollRightButtonTexture; + public static Texture2D frozenTexture; + public static Texture2D magicPixel; + public static Texture2D settingsPanelTexture; + public static Texture2D settingsPanelTexture2; + public static Texture2D miniMapFrameTexture; + public static Texture2D miniMapFrame2Texture; + public static Texture2D[] miniMapButtonTexture = new Texture2D[3]; + public static Texture2D[] destTexture = new Texture2D[3]; + public static Texture2D[] gemTexture = new Texture2D[7]; + public static Texture2D[] rudolphMountTexture = new Texture2D[3]; + public static Texture2D bunnyMountTexture; + public static Texture2D pigronMountTexture; + public static Texture2D slimeMountTexture; + public static Texture2D minecartMountTexture; + public static Texture2D turtleMountTexture; + public static Texture2D[] beeMountTexture = new Texture2D[2]; + public static Texture2D[] UFOMountTexture = new Texture2D[2]; + public static Texture2D[] drillMountTexture = new Texture2D[6]; + public static Texture2D[] scutlixMountTexture = new Texture2D[3]; + public static Texture2D unicornMountTexture; + public static Texture2D basiliskMountTexture; + public static Texture2D[] minecartMechMountTexture = new Texture2D[2]; + public static Texture2D[] cuteFishronMountTexture = new Texture2D[2]; + public static Texture2D minecartWoodMountTexture; + public static Texture2D[] wingsTexture = new Texture2D[40]; + public static Texture2D[] armorHeadTexture = new Texture2D[216]; + public static Texture2D[] armorBodyTexture = new Texture2D[210]; + public static Texture2D[] femaleBodyTexture = new Texture2D[210]; + public static Texture2D[] armorArmTexture = new Texture2D[210]; + public static Texture2D[] armorLegTexture = new Texture2D[161]; + public static Texture2D[] accHandsOnTexture = new Texture2D[20]; + public static Texture2D[] accHandsOffTexture = new Texture2D[12]; + public static Texture2D[] accBackTexture = new Texture2D[14]; + public static Texture2D[] accFrontTexture = new Texture2D[5]; + public static Texture2D[] accShoesTexture = new Texture2D[18]; + public static Texture2D[] accWaistTexture = new Texture2D[13]; + public static Texture2D[] accShieldTexture = new Texture2D[7]; + public static Texture2D[] accNeckTexture = new Texture2D[10]; + public static Texture2D[] accFaceTexture = new Texture2D[9]; + public static Texture2D[] accBalloonTexture = new Texture2D[18]; + public static Texture2D pulleyTexture; + public static Texture2D[] xmasTree = new Texture2D[5]; + public static Texture2D[] FlameTexture = new Texture2D[17]; + public static Texture2D timerTexture; + public static Texture2D[] reforgeTexture = new Texture2D[2]; + public static Texture2D wallOutlineTexture; + public static Texture2D actuatorTexture; + public static Texture2D wireTexture; + public static Texture2D wire2Texture; + public static Texture2D wire3Texture; + public static Texture2D wire4Texture; + public static Texture2D wireTextureNew; + public static Texture2D[] cameraTexture = new Texture2D[8]; + public static Texture2D flyingCarpetTexture; + public static Texture2D gridTexture; + public static Texture2D lightDiscTexture; + public static Texture2D EyeLaserTexture; + public static Texture2D BoneEyesTexture; + public static Texture2D BoneLaserTexture; + public static Texture2D trashTexture; + public static Texture2D fishingLineTexture; + public static Texture2D beetleTexture; + public static Texture2D probeTexture; + public static Texture2D eyeLaserSmallTexture; + public static Texture2D xmasLightTexture; + public static Texture2D[] golemTexture = new Texture2D[4]; + public static Texture2D confuseTexture; + public static Texture2D sunOrbTexture; + public static Texture2D sunAltarTexture; + public static Texture2D[] chainsTexture = new Texture2D[17]; + public static Texture2D chainTexture; + public static Texture2D[] gemChainTexture = new Texture2D[7]; + public static Texture2D chain2Texture; + public static Texture2D chain3Texture; + public static Texture2D chain4Texture; + public static Texture2D chain5Texture; + public static Texture2D chain6Texture; + public static Texture2D chain7Texture; + public static Texture2D chain8Texture; + public static Texture2D chain9Texture; + public static Texture2D chain10Texture; + public static Texture2D chain11Texture; + public static Texture2D chain12Texture; + public static Texture2D chain13Texture; + public static Texture2D chain14Texture; + public static Texture2D chain15Texture; + public static Texture2D chain16Texture; + public static Texture2D chain17Texture; + public static Texture2D chain18Texture; + public static Texture2D chain19Texture; + public static Texture2D chain20Texture; + public static Texture2D chain21Texture; + public static Texture2D chain22Texture; + public static Texture2D chain23Texture; + public static Texture2D chain24Texture; + public static Texture2D chain25Texture; + public static Texture2D chain26Texture; + public static Texture2D chain27Texture; + public static Texture2D chain28Texture; + public static Texture2D chain29Texture; + public static Texture2D chain30Texture; + public static Texture2D chain31Texture; + public static Texture2D chain32Texture; + public static Texture2D chain33Texture; + public static Texture2D chain34Texture; + public static Texture2D chain35Texture; + public static Texture2D chain36Texture; + public static Texture2D chain37Texture; + public static Texture2D chain38Texture; + public static Texture2D chain39Texture; + public static Texture2D chain40Texture; + public static Texture2D hbTexture1; + public static Texture2D hbTexture2; + public static Texture2D chaosTexture; + public static Texture2D cdTexture; + public static Texture2D wofTexture; + public static Texture2D boneArmTexture; + public static Texture2D boneArm2Texture; + public static Texture2D pumpkingArmTexture; + public static Texture2D pumpkingCloakTexture; + public static Texture2D[] EquipPageTexture = new Texture2D[11]; + public static Texture2D[] HouseBannerTexture = new Texture2D[2]; + public static Texture2D[] PVPTexture = new Texture2D[3]; + public static Texture2D[] npcToggleTexture = new Texture2D[2]; + public static Texture2D[] HBLockTexture = new Texture2D[2]; + public static Texture2D[] buffTexture = new Texture2D[206]; + public static Texture2D[] itemTexture = new Texture2D[3930]; + public static Texture2D[] itemFlameTexture = new Texture2D[3930]; + public static Texture2D[] npcTexture = new Texture2D[580]; + public static Texture2D[][] npcAltTextures; + public static Texture2D[] projectileTexture = new Texture2D[714]; + public static Texture2D[] goreTexture = new Texture2D[1087]; + public static Texture2D[] BackPackTexture = new Texture2D[8]; + public static Texture2D rainTexture; + public static Texture2D[] glowMaskTexture = new Texture2D[252]; + public static Texture2D[] extraTexture = new Texture2D[91]; + public static Texture2D[] highlightMaskTexture = new Texture2D[470]; + public static Texture2D[] coinTexture = new Texture2D[4]; + public static Texture2D[] cursorTextures = new Texture2D[17]; + public static Texture2D cursorRadialTexture; + public static Texture2D dustTexture; + public static Texture2D sunTexture; + public static Texture2D sun2Texture; + public static Texture2D sun3Texture; + public static int maxMoons = 3; public static int moonType = 0; - public const int numTileColors = 32; - public const int numTreeStyles = 31; - public const int numberOfHairstyles = 162; - public const int maxHairStyles = 162; + public static Texture2D[] moonTexture = new Texture2D[Main.maxMoons]; + public static Texture2D pumpkinMoonTexture; + public static Texture2D snowMoonTexture; + public static Texture2D oneDropLogo; + public static int numTileColors = 31; + public static RenderTarget2D[,] tileAltTexture = new RenderTarget2D[470, Main.numTileColors]; + public static bool[,] tileAltTextureInit = new bool[470, Main.numTileColors]; + public static bool[,] tileAltTextureDrawn = new bool[470, Main.numTileColors]; + public static int numTreeStyles = 19; + public static RenderTarget2D[,] treeTopAltTexture = new RenderTarget2D[Main.numTreeStyles, Main.numTileColors]; + public static RenderTarget2D[,] treeBranchAltTexture = new RenderTarget2D[Main.numTreeStyles, Main.numTileColors]; + public static bool[,] treeAltTextureInit = new bool[Main.numTreeStyles, Main.numTileColors]; + public static bool[,] treeAltTextureDrawn = new bool[Main.numTreeStyles, Main.numTileColors]; + public static bool[,] checkTreeAlt = new bool[Main.numTreeStyles, Main.numTileColors]; + public static RenderTarget2D[,] wallAltTexture = new RenderTarget2D[231, Main.numTileColors]; + public static bool[,] wallAltTextureInit = new bool[231, Main.numTileColors]; + public static bool[,] wallAltTextureDrawn = new bool[231, Main.numTileColors]; + public static Texture2D[] tileTexture = new Texture2D[470]; + public static Texture2D blackTileTexture; + public static Texture2D[] wallTexture = new Texture2D[231]; + public static Texture2D[] backgroundTexture = new Texture2D[207]; + public static Texture2D[] cloudTexture = new Texture2D[22]; + public static Texture2D[] starTexture = new Texture2D[5]; + public static Texture2D[] liquidTexture = new Texture2D[12]; + public static Texture2D heartTexture; + public static Texture2D heart2Texture; + public static Texture2D manaTexture; + public static Texture2D bubbleTexture; + public static Texture2D flameTexture; + public static Texture2D[] treeTopTexture = new Texture2D[Main.numTreeStyles]; + public static Texture2D[] treeBranchTexture = new Texture2D[Main.numTreeStyles]; + public static Texture2D[] woodTexture = new Texture2D[7]; + public static RenderTarget2D[,] woodAltTexture = new RenderTarget2D[Main.woodTexture.Length, Main.numTileColors]; + public static Texture2D shroomCapTexture; + public static Texture2D inventoryBackTexture; + public static Texture2D inventoryBack2Texture; + public static Texture2D inventoryBack3Texture; + public static Texture2D inventoryBack4Texture; + public static Texture2D inventoryBack5Texture; + public static Texture2D inventoryBack6Texture; + public static Texture2D inventoryBack7Texture; + public static Texture2D inventoryBack8Texture; + public static Texture2D inventoryBack9Texture; + public static Texture2D inventoryBack10Texture; + public static Texture2D inventoryBack11Texture; + public static Texture2D inventoryBack12Texture; + public static Texture2D inventoryBack13Texture; + public static Texture2D inventoryBack14Texture; + public static Texture2D inventoryBack15Texture; + public static Texture2D inventoryBack16Texture; + public static Texture2D hairStyleBackTexture; + public static Texture2D clothesStyleBackTexture; + public static Texture2D inventoryTickOnTexture; + public static Texture2D inventoryTickOffTexture; + public static Texture2D loTexture; + public static Texture2D logoTexture; + public static Texture2D logo2Texture; + public static Texture2D textBackTexture; + public static Texture2D chatTexture; + public static Texture2D chat2Texture; + public static Texture2D chatBackTexture; + public static Texture2D teamTexture; + public static Texture2D reTexture; + public static Texture2D raTexture; + public static Texture2D splashTexture; + public static Texture2D fadeTexture; + public static Texture2D ninjaTexture; + public static Texture2D antLionTexture; + public static Texture2D spikeBaseTexture; + public static Texture2D ghostTexture; + public static Texture2D evilCactusTexture; + public static Texture2D goodCactusTexture; + public static Texture2D crimsonCactusTexture; + public static Texture2D wraithEyeTexture; + public static Texture2D fireflyTexture; + public static Texture2D fireflyJarTexture; + public static Texture2D lightningbugTexture; + public static Texture2D lightningbugJarTexture; + public static Texture2D[] jellyfishBowlTexture = new Texture2D[3]; + public static Texture2D glowSnailTexture; + public static Texture2D iceQueenTexture; + public static Texture2D santaTankTexture; + public static Texture2D reaperEyeTexture; + public static Texture2D jackHatTexture; + public static Texture2D treeFaceTexture; + public static Texture2D pumpkingFaceTexture; + public static Texture2D dukeFishronTexture; + public static Texture2D miniMinotaurTexture; + public static Texture2D[,] playerTextures; + public const int maxHairTotal = 134; public const int maxCharSelectHair = 51; - public const int maxHairOfStylistDefault = 123; - public static bool UseExperimentalFeatures; + public static bool UseExperimentalFeatures = false; public static string DefaultSeed = ""; + public static Texture2D[] playerHairTexture = new Texture2D[134]; + public static Texture2D[] playerHairAltTexture = new Texture2D[134]; + public static SoundEffect[] soundDrip = new SoundEffect[3]; + public static SoundEffectInstance[] soundInstanceDrip = new SoundEffectInstance[3]; + public static SoundEffect[] soundLiquid = new SoundEffect[2]; + public static SoundEffectInstance[] soundInstanceLiquid = new SoundEffectInstance[2]; + public static SoundEffect[] soundMech = new SoundEffect[1]; + public static SoundEffectInstance[] soundInstanceMech = new SoundEffectInstance[1]; + public static SoundEffect[] soundDig = new SoundEffect[3]; + public static SoundEffectInstance[] soundInstanceDig = new SoundEffectInstance[3]; + public static SoundEffect[] soundTink = new SoundEffect[3]; + public static SoundEffectInstance[] soundInstanceTink = new SoundEffectInstance[3]; + public static SoundEffect[] soundCoin = new SoundEffect[5]; + public static SoundEffectInstance[] soundInstanceCoin = new SoundEffectInstance[5]; + public static SoundEffect[] soundPlayerHit = new SoundEffect[3]; + public static SoundEffectInstance[] soundInstancePlayerHit = new SoundEffectInstance[3]; + public static SoundEffect[] soundFemaleHit = new SoundEffect[3]; + public static SoundEffectInstance[] soundInstanceFemaleHit = new SoundEffectInstance[3]; + public static SoundEffect soundPlayerKilled; + public static SoundEffectInstance soundInstancePlayerKilled; + public static SoundEffect soundGrass; + public static SoundEffectInstance soundInstanceGrass; + public static SoundEffect soundGrab; + public static SoundEffectInstance soundInstanceGrab; + public static SoundEffect soundPixie; + public static SoundEffectInstance soundInstancePixie; + public static SoundEffect[] soundItem = new SoundEffect[126]; + public static SoundEffectInstance[] soundInstanceItem = new SoundEffectInstance[126]; + public static SoundEffect[] soundNPCHit = new SoundEffect[58]; + public static SoundEffectInstance[] soundInstanceNPCHit = new SoundEffectInstance[58]; + public static SoundEffect[] soundNPCKilled = new SoundEffect[63]; + public static SoundEffectInstance[] soundInstanceNPCKilled = new SoundEffectInstance[63]; + public static SoundEffectInstance soundInstanceMoonlordCry; + public static SoundEffect soundDoorOpen; + public static SoundEffectInstance soundInstanceDoorOpen; + public static SoundEffect soundDoorClosed; + public static SoundEffectInstance soundInstanceDoorClosed; + public static SoundEffect soundMenuOpen; + public static SoundEffectInstance soundInstanceMenuOpen; + public static SoundEffect soundMenuClose; + public static SoundEffectInstance soundInstanceMenuClose; + public static SoundEffect soundMenuTick; + public static SoundEffectInstance soundInstanceMenuTick; + public static SoundEffect soundShatter; + public static SoundEffectInstance soundInstanceShatter; + public static SoundEffect soundCamera; + public static SoundEffectInstance soundInstanceCamera; + public static SoundEffect[] soundZombie = new SoundEffect[106]; + public static SoundEffectInstance[] soundInstanceZombie = new SoundEffectInstance[106]; + public static SoundEffect[] soundRoar = new SoundEffect[3]; + public static SoundEffectInstance[] soundInstanceRoar = new SoundEffectInstance[3]; + public static SoundEffect[] soundSplash = new SoundEffect[2]; + public static SoundEffectInstance[] soundInstanceSplash = new SoundEffectInstance[2]; + public static SoundEffect soundDoubleJump; + public static SoundEffectInstance soundInstanceDoubleJump; + public static SoundEffect soundRun; + public static SoundEffectInstance soundInstanceRun; + public static SoundEffect soundCoins; + public static SoundEffectInstance soundInstanceCoins; + public static SoundEffect soundUnlock; + public static SoundEffectInstance soundInstanceUnlock; + public static SoundEffect soundChat; + public static SoundEffectInstance soundInstanceChat; + public static SoundEffect soundMaxMana; + public static SoundEffectInstance soundInstanceMaxMana; + public static SoundEffect soundDrown; + public static SoundEffectInstance soundInstanceDrown; + public static SoundEffect[] trackableSounds; + public static SoundEffectInstance[] trackableSoundInstances; + private static bool _areSoundsPaused = false; public static AudioEngine engine; public static SoundBank soundBank; public static WaveBank waveBank; - public static Cue[] music = new Cue[89]; - public static bool[] musicNoCrossFade = new bool[89]; - public static float[] musicFade = new float[89]; - public static float musicVolume = 1f; - public static float ambientVolume = 1f; + public static Cue[] music = new Cue[42]; + public static float[] musicFade = new float[42]; + public static float musicVolume = 0.75f; + public static float ambientVolume = 0.75f; public static float soundVolume = 1f; + public static DynamicSpriteFont fontItemStack; + public static DynamicSpriteFont fontMouseText; + public static DynamicSpriteFont fontDeathText; + public static DynamicSpriteFont[] fontCombatText = new DynamicSpriteFont[2]; public static ServerMode MenuServerMode = ServerMode.Lobby | ServerMode.FriendsCanJoin; - public static bool[] tileLighted = new bool[623]; - public static bool[] tileMergeDirt = new bool[623]; - public static bool[] tileCut = new bool[623]; - public static bool[] tileAlch = new bool[623]; - public static int[] tileShine = new int[623]; - public static bool[] tileShine2 = new bool[623]; - public static bool[] wallHouse = new bool[316]; - public static bool[] wallDungeon = new bool[316]; - public static bool[] wallLight = new bool[316]; - public static int[] wallBlend = new int[316]; - public static bool[] tileStone = new bool[623]; - public static bool[] tileAxe = new bool[623]; - public static bool[] tileHammer = new bool[623]; - public static bool[] tileWaterDeath = new bool[623]; - public static bool[] tileLavaDeath = new bool[623]; - public static bool[] tileTable = new bool[623]; - public static bool[] tileBlockLight = new bool[623]; - public static bool[] tileNoSunLight = new bool[623]; - public static bool[] tileDungeon = new bool[623]; - public static bool[] tileSpelunker = new bool[623]; - public static bool[] tileSolidTop = new bool[623]; - public static bool[] tileSolid = new bool[623]; - public static bool[] tileBouncy = new bool[623]; - public static short[] tileOreFinderPriority = new short[623]; - public static byte[] tileLargeFrames = new byte[623]; - public static byte[] wallLargeFrames = new byte[316]; - public static bool[] tileRope = new bool[623]; - public static bool[] tileBrick = new bool[623]; - public static bool[] tileMoss = new bool[623]; - public static bool[] tileNoAttach = new bool[623]; - public static bool[] tileNoFail = new bool[623]; - public static bool[] tileCracked = new bool[623]; - public static bool[] tileObsidianKill = new bool[623]; - public static bool[] tileFrameImportant = new bool[623]; - public static bool[] tilePile = new bool[623]; - public static bool[] tileBlendAll = new bool[623]; - public static short[] tileGlowMask = new short[623]; - public static bool[] tileContainer = new bool[623]; - public static bool[] tileSign = new bool[623]; - public static bool[][] tileMerge = new bool[623][]; + public static bool[] tileLighted = new bool[470]; + public static bool[] tileMergeDirt = new bool[470]; + public static bool[] tileCut = new bool[470]; + public static bool[] tileAlch = new bool[470]; + public static int[] tileShine = new int[470]; + public static bool[] tileShine2 = new bool[470]; + public static bool[] wallHouse = new bool[231]; + public static bool[] wallDungeon = new bool[231]; + public static bool[] wallLight = new bool[231]; + public static int[] wallBlend = new int[231]; + public static bool[] tileStone = new bool[470]; + public static bool[] tileAxe = new bool[470]; + public static bool[] tileHammer = new bool[470]; + public static bool[] tileWaterDeath = new bool[470]; + public static bool[] tileLavaDeath = new bool[470]; + public static bool[] tileTable = new bool[470]; + public static bool[] tileBlockLight = new bool[470]; + public static bool[] tileNoSunLight = new bool[470]; + public static bool[] tileDungeon = new bool[470]; + public static bool[] tileSpelunker = new bool[470]; + public static bool[] tileSolidTop = new bool[470]; + public static bool[] tileSolid = new bool[470]; + public static bool[] tileBouncy = new bool[470]; + public static short[] tileValue = new short[470]; + public static byte[] tileLargeFrames = new byte[470]; + public static byte[] wallLargeFrames = new byte[231]; + public static bool[] tileRope = new bool[470]; + public static bool[] tileBrick = new bool[470]; + public static bool[] tileMoss = new bool[470]; + public static bool[] tileNoAttach = new bool[470]; + public static bool[] tileNoFail = new bool[470]; + public static bool[] tileObsidianKill = new bool[470]; + public static bool[] tileFrameImportant = new bool[470]; + public static bool[] tilePile = new bool[470]; + public static bool[] tileBlendAll = new bool[470]; + public static short[] tileGlowMask = new short[470]; + public static bool[] tileContainer = new bool[470]; + public static bool[] tileSign = new bool[470]; + public static bool[][] tileMerge = new bool[470][]; public static int cageFrames = 25; - public static bool critterCage; + public static bool critterCage = false; public static int[] bunnyCageFrame = new int[Main.cageFrames]; public static int[] bunnyCageFrameCounter = new int[Main.cageFrames]; public static int[] squirrelCageFrame = new int[Main.cageFrames]; @@ -810,10 +1110,6 @@ namespace Terraria public static int[] mallardCageFrameCounter = new int[Main.cageFrames]; public static int[] duckCageFrame = new int[Main.cageFrames]; public static int[] duckCageFrameCounter = new int[Main.cageFrames]; - public static int[] grebeCageFrame = new int[Main.cageFrames]; - public static int[] grebeCageFrameCounter = new int[Main.cageFrames]; - public static int[] seagullCageFrame = new int[Main.cageFrames]; - public static int[] seagullCageFrameCounter = new int[Main.cageFrames]; public static int[] birdCageFrame = new int[Main.cageFrames]; public static int[] birdCageFrameCounter = new int[Main.cageFrames]; public static int[] redBirdCageFrame = new int[Main.cageFrames]; @@ -823,8 +1119,6 @@ namespace Terraria public static byte[,] butterflyCageMode = new byte[9, Main.cageFrames]; public static int[,] butterflyCageFrame = new int[9, Main.cageFrames]; public static int[,] butterflyCageFrameCounter = new int[9, Main.cageFrames]; - public static int[,] dragonflyJarFrameCounter = new int[7, Main.cageFrames]; - public static int[,] dragonflyJarFrame = new int[7, Main.cageFrames]; public static int[,] scorpionCageFrame = new int[2, Main.cageFrames]; public static int[,] scorpionCageFrameCounter = new int[2, Main.cageFrames]; public static int[] snailCageFrame = new int[Main.cageFrames]; @@ -834,88 +1128,67 @@ namespace Terraria public static byte[] fishBowlFrameMode = new byte[Main.cageFrames]; public static int[] fishBowlFrame = new int[Main.cageFrames]; public static int[] fishBowlFrameCounter = new int[Main.cageFrames]; - public static int[] lavaFishBowlFrame = new int[Main.cageFrames]; - public static int[] lavaFishBowlFrameCounter = new int[Main.cageFrames]; public static int[] frogCageFrame = new int[Main.cageFrames]; public static int[] frogCageFrameCounter = new int[Main.cageFrames]; public static int[] mouseCageFrame = new int[Main.cageFrames]; public static int[] mouseCageFrameCounter = new int[Main.cageFrames]; - public static int[] turtleCageFrame = new int[Main.cageFrames]; - public static int[] turtleCageFrameCounter = new int[Main.cageFrames]; - public static int[] fairyJarFrame = new int[Main.cageFrames]; - public static int[] fairyJarFrameCounter = new int[Main.cageFrames]; public static byte[,] jellyfishCageMode = new byte[3, Main.cageFrames]; public static int[,] jellyfishCageFrame = new int[3, Main.cageFrames]; public static int[,] jellyfishCageFrameCounter = new int[3, Main.cageFrames]; public static int[] wormCageFrame = new int[Main.cageFrames]; public static int[] wormCageFrameCounter = new int[Main.cageFrames]; - public static int[] maggotCageFrame = new int[Main.cageFrames]; - public static int[] maggotCageFrameCounter = new int[Main.cageFrames]; - public static int[] ratCageFrame = new int[Main.cageFrames]; - public static int[] ratCageFrameCounter = new int[Main.cageFrames]; - public static int[] ladybugCageFrame = new int[Main.cageFrames]; - public static int[] ladybugCageFrameCounter = new int[Main.cageFrames]; public static int[] penguinCageFrame = new int[Main.cageFrames]; public static int[] penguinCageFrameCounter = new int[Main.cageFrames]; - public static int[] waterStriderCageFrame = new int[Main.cageFrames]; - public static int[] waterStriderCageFrameCounter = new int[Main.cageFrames]; - public static int[] seahorseCageFrame = new int[Main.cageFrames]; - public static int[] seahorseCageFrameCounter = new int[Main.cageFrames]; public static int[,] slugCageFrame = new int[3, Main.cageFrames]; public static int[,] slugCageFrameCounter = new int[3, Main.cageFrames]; - public static int[] owlCageFrame = new int[Main.cageFrames]; - public static int[] owlCageFrameCounter = new int[Main.cageFrames]; public static int[] grasshopperCageFrame = new int[Main.cageFrames]; public static int[] grasshopperCageFrameCounter = new int[Main.cageFrames]; - public static bool[] tileSand = new bool[623]; - public static bool[] tileFlame = new bool[623]; - public static bool[] npcCatchable = new bool[663]; - public static int[] tileFrame = new int[623]; - public static int[] tileFrameCounter = new int[623]; - public static byte[] wallFrame = new byte[316]; - public static byte[] wallFrameCounter = new byte[316]; - public static int[] backgroundWidth = new int[298]; - public static int[] backgroundHeight = new int[298]; - public static HairstyleUnlocksHelper Hairstyles = new HairstyleUnlocksHelper(); + public static bool[] tileSand = new bool[470]; + public static bool[] tileFlame = new bool[470]; + public static bool[] npcCatchable = new bool[580]; + public static int[] tileFrame = new int[470]; + public static int[] tileFrameCounter = new int[470]; + public static byte[] wallFrame = new byte[231]; + public static byte[] wallFrameCounter = new byte[231]; + public static int[] backgroundWidth = new int[207]; + public static int[] backgroundHeight = new int[207]; public static bool tilesLoaded = false; public static WorldMap Map = new WorldMap(Main.maxTilesX, Main.maxTilesY); public static Tile[,] tile = new Tile[Main.maxTilesX, Main.maxTilesY]; public static Dust[] dust = new Dust[6001]; - public static Star[] star = new Star[400]; + public static Star[] star = new Star[130]; public static Item[] item = new Item[401]; - public static int[] timeItemSlotCannotBeReusedFor = new int[401]; + public static int[] itemLockoutTime = new int[401]; public static NPC[] npc = new NPC[201]; - public static Gore[] gore = new Gore[601]; + public static Gore[] gore = new Gore[501]; public static Rain[] rain = new Rain[Main.maxRain + 1]; public static Projectile[] projectile = new Projectile[1001]; public static int[,] projectileIdentity = new int[256, 1001]; public static CombatText[] combatText = new CombatText[100]; - public static PopupText[] popupText = new PopupText[20]; - public static Chest[] chest = new Chest[8000]; + public static ItemText[] itemText = new ItemText[20]; + public static Chest[] chest = new Chest[1000]; public static Sign[] sign = new Sign[1000]; public static int[] itemFrame = new int[401]; public static int[] itemFrameCounter = new int[401]; - public static DrawAnimation[] itemAnimations = new DrawAnimation[5045]; - private static DrawAnimation _coinOnWorldAnimation = (DrawAnimation) new DrawAnimationVertical(6, 8); - private static DrawAnimation _monkStaffT3OnWorldAnimation = (DrawAnimation) new DrawAnimationVertical(5, 3); + public static DrawAnimation[] itemAnimations = new DrawAnimation[3930]; public static List itemAnimationsRegistered = new List(); public static Vector2 screenPosition; public static Vector2 screenLastPosition; public static int screenWidth = 1152; public static int screenHeight = 864; - public static bool screenMaximized = true; - public static bool screenBorderless = true; - public static int screenBorderlessPendingResizes; - public static int teamNamePlateDistance = 2000; - public static int multiplayerNPCSmoothingRange = 300; - public static bool Setting_UseReducedMaxLiquids = false; - public static int PlayerOverheadChatMessageDisplayTime = 400; - public static object CurrentInputTextTakerOverride; - public static bool drawingPlayerChat; - public static bool chatRelease; + public static bool screenMaximized = false; + public static bool screenBorderless = false; + public static int screenBorderlessPendingResizes = 0; + public static int chatLength = 600; + public static bool drawingPlayerChat = false; + public static bool chatRelease = false; + public static int showCount = 10; + public static int numChatLines = 500; + public static int startChatLine = 0; public static string chatText = ""; - public static bool inputTextEnter; - public static bool inputTextEscape; + public static ChatLine[] chatLine = new ChatLine[Main.numChatLines]; + public static bool inputTextEnter = false; + public static bool inputTextEscape = false; public static float[] hotbarScale = new float[10] { 1f, @@ -929,56 +1202,53 @@ namespace Terraria 0.75f, 0.75f }; - public static byte mouseTextColor; + public static byte mouseTextColor = 0; public static int mouseTextColorChange = 1; - public static bool mouseLeftRelease; - public static bool mouseRightRelease; - public static bool playerInventory; + public static bool mouseLeftRelease = false; + public static bool mouseRightRelease = false; + public static bool playerInventory = false; public static int stackSplit; - public static bool preventStackSplitReset; - public static int stackCounter; + public static int stackCounter = 0; public static int stackDelay = 7; - public static int superFastStack; + public static int superFastStack = 0; public static Item mouseItem = new Item(); public static Item guideItem = new Item(); public static Item reforgeItem = new Item(); public static float inventoryScale = 0.75f; - public static bool hasFocus; - public static Microsoft.Xna.Framework.Point rulerLineDisplayValues = new Microsoft.Xna.Framework.Point(); - public static bool recFastScroll; - public static bool recBigList; - public static int recStart; + public static bool hasFocus = false; + public static bool recFastScroll = false; + public static bool recBigList = false; + public static int recStart = 0; public static Recipe[] recipe = new Recipe[Recipe.maxRecipes]; public static int[] availableRecipe = new int[Recipe.maxRecipes]; public static float[] availableRecipeY = new float[Recipe.maxRecipes]; public static int numAvailableRecipes; public static int focusRecipe; - public static int myPlayer; + public static int myPlayer = 0; public static Player[] player = new Player[256]; - public static Player[] playerVisualClone = new Player[256]; - public static bool[] countsAsHostForGameplay = new bool[256]; + public static List playerDrawData = new List(); + public static List playerDrawDust = new List(); + public static List playerDrawGore = new List(); public static int spawnTileX; public static int spawnTileY; - public static bool npcChatRelease; - public static bool editSign; - public static bool editChest; + public static bool npcChatRelease = false; + public static bool editSign = false; + public static bool editChest = false; public static bool blockInput = false; public static string blockKey = Microsoft.Xna.Framework.Input.Keys.None.ToString(); public static string defaultChestName = string.Empty; public static string npcChatText = ""; - public static bool npcChatFocus1; - public static bool npcChatFocus2; - public static bool npcChatFocus3; - public static bool npcChatFocus4; - public static int oldNPCShop; - public static int npcChatCornerItem; - public Chest[] shop = new Chest[100]; - public static ItemShopSellbackHelper shopSellbackHelper = new ItemShopSellbackHelper(); + public static bool npcChatFocus1 = false; + public static bool npcChatFocus2 = false; + public static bool npcChatFocus3 = false; + public static int npcShop = 0; + public static int npcChatCornerItem = 0; + public Chest[] shop = new Chest[Main.MaxShopIDs]; public static int[] travelShop = new int[40]; public static List anglerWhoFinishedToday = new List(); public static bool anglerQuestFinished; - public static int anglerQuest; - public static int[] anglerQuestItemNetIDs = new int[41] + public static int anglerQuest = 0; + public static int[] anglerQuestItemNetIDs = new int[39] { 2450, 2451, @@ -1018,44 +1288,26 @@ namespace Terraria 2485, 2486, 2487, - 2488, - 4393, - 4394 + 2488 }; - public static AmbienceServer AmbienceServer; - public static ItemDropDatabase ItemDropsDB; - public static BestiaryDatabase BestiaryDB; - public static ItemDropResolver ItemDropSolver; - public static BestiaryUnlocksTracker BestiaryTracker; - public static UIBestiaryTest BestiaryUI; - public static TeleportPylonsSystem PylonSystem; - public static ShopHelper ShopHelper; - public static GolfState LocalGolfState = new GolfState(); public static bool Support4K = true; - public static float MinimumZoomComparerX = 1920f; - public static float MinimumZoomComparerY = 1200f; private static int _renderTargetMaxSize = 2048; private static GraphicsProfile _selectedGraphicsProfile = GraphicsProfile.Reach; private static GraphicsProfile _currentGraphicsProfile = GraphicsProfile.Reach; public static int LogicCheckScreenWidth = 1920; public static int LogicCheckScreenHeight = 1200; - private static Main.WorldPreparationState _worldPreparationState = Main.WorldPreparationState.AwaitingData; public static float temporaryGUIScaleSlider = -1f; public static bool temporaryGUIScaleSliderUpdate = false; - public static bool InGuideCraftMenu; - public static bool InReforgeMenu; + public static bool InGuideCraftMenu = false; + public static bool InReforgeMenu = false; public static Item HoverItem = new Item(); - private static int backSpaceCount; - private static float backSpaceRate; + private static int backSpaceCount = 0; public static string motd = ""; public static bool toggleFullscreen; - public static int numDisplayModes; + public static int numDisplayModes = 0; public static int[] displayWidth = new int[99]; public static int[] displayHeight = new int[99]; public static bool gameMenu = true; - public static bool menuBGChangedDay = false; - public static bool menuBGChangedNight = false; - public static bool lockMenuBGChange = false; private static int maxLoadPlayer = 1000; private static int maxLoadWorld = 1000; public static List PlayerList = new List(); @@ -1073,24 +1325,23 @@ namespace Terraria public static KeyboardState oldInputText; public static int PendingResolutionWidth = 800; public static int PendingResolutionHeight = 600; - public static bool PendingBorderlessState; - public static int invasionType; - public static double invasionX; - public static int invasionSize; - public static int invasionDelay; - public static int invasionWarn; - public static int invasionSizeStart; - public static bool invasionProgressNearInvasion; + public static bool PendingBorderlessState = false; + public static int invasionType = 0; + public static double invasionX = 0.0; + public static int invasionSize = 0; + public static int invasionDelay = 0; + public static int invasionWarn = 0; + public static int invasionSizeStart = 0; + public static bool invasionProgressNearInvasion = false; public static int invasionProgressMode = 2; - public static int invasionProgressIcon; - public static int invasionProgress; - public static int invasionProgressMax; - public static int invasionProgressWave; - public static int invasionProgressDisplayLeft; - public static float invasionProgressAlpha; - public static bool HasInteractibleObjectThatIsNotATile = false; + public static int invasionProgressIcon = 0; + public static int invasionProgress = 0; + public static int invasionProgressMax = 0; + public static int invasionProgressWave = 0; + public static int invasionProgressDisplayLeft = 0; + public static float invasionProgressAlpha = 0.0f; public int currentNPCShowingChatBubble = -1; - public static int[] npcFrameCount = new int[663] + public static int[] npcFrameCount = new int[580] { 1, 2, @@ -1140,7 +1391,7 @@ namespace Terraria 3, 7, 7, - 6, + 4, 5, 6, 5, @@ -1153,12 +1404,12 @@ namespace Terraria 6, 2, 5, - 6, - 5, + 3, + 2, 7, 7, 4, - 5, + 2, 8, 1, 5, @@ -1170,14 +1421,14 @@ namespace Terraria 4, 4, 15, - 16, - 16, - 16, + 15, + 15, + 15, 2, 4, 6, 6, - 18, + 24, 16, 1, 1, @@ -1247,14 +1498,14 @@ namespace Terraria 4, 8, 8, - 13, + 9, 5, 6, 4, 15, 23, 3, - 15, + 3, 8, 5, 4, @@ -1295,7 +1546,7 @@ namespace Terraria 3, 15, 15, - 16, + 15, 2, 3, 20, @@ -1367,7 +1618,7 @@ namespace Terraria 15, 15, 15, - 16, + 15, 15, 15, 15, @@ -1379,14 +1630,14 @@ namespace Terraria 3, 3, 3, - 16, + 15, 3, 6, 12, - 21, - 21, 20, - 16, + 20, + 20, + 15, 15, 15, 5, @@ -1414,9 +1665,9 @@ namespace Terraria 3, 3, 3, - 16, 15, - 16, + 15, + 15, 10, 14, 12, @@ -1453,7 +1704,7 @@ namespace Terraria 4, 6, 6, - 13, + 10, 15, 15, 15, @@ -1537,14 +1788,14 @@ namespace Terraria 5, 7, 3, - 13, + 10, 2, 6, 2, 19, 19, 19, - 20, + 19, 26, 3, 1, @@ -1671,104 +1922,21 @@ namespace Terraria 10, 10, 4, - 1, - 6, - 9, - 6, - 4, - 4, - 4, - 14, - 4, - 25, - 13, - 3, - 7, - 6, - 6, - 1, - 4, - 4, - 4, - 4, - 4, - 4, - 4, - 15, - 15, - 8, - 8, - 2, - 6, - 15, - 15, - 6, - 13, - 5, - 5, - 7, - 5, - 14, - 14, - 4, - 6, - 21, - 1, - 1, - 1, - 11, - 12, - 6, - 6, - 17, - 6, - 16, - 21, - 16, - 23, - 5, - 16, - 2, - 28, - 28, - 6, - 6, - 6, - 6, - 6, - 6, - 6, - 7, - 7, - 7, - 7, - 7, - 7, - 7, - 3, - 4, - 6, - 27, - 16, - 2, - 2, - 4, - 3, - 4 + 1 }; public static Dictionary npcLifeBytes = new Dictionary(); - public static bool mouseExit; - public static float exitScale = 0.8f; - public static bool mouseReforge; - public static float reforgeScale = 0.8f; + private static bool mouseExit = false; + private static float exitScale = 0.8f; + private static bool mouseReforge = false; + private static float reforgeScale = 0.8f; public static Player clientPlayer = new Player(); public static string getIP = Main.defaultIP; public static string getPort = Convert.ToString(Netplay.ListenPort); - public static bool menuMultiplayer; - public static bool menuServer; - public static int netMode; - private static int _targetNetMode; - private static bool _hasPendingNetmodeChange; + public static bool menuMultiplayer = false; + public static bool menuServer = false; + public static int netMode = 0; + private static int _targetNetMode = 0; + private static bool _hasPendingNetmodeChange = false; public const int MaxTimeout = 120; public static int netPlayCounter; public static int lastNPCUpdate; @@ -1790,18 +1958,17 @@ namespace Terraria public static string cSmart = "LeftControl"; public static string cMount = "R"; public static string cFavoriteKey = "LeftAlt"; - public static bool cSmartCursorModeIsToggleAndNotHold = true; + public static bool cSmartCursorToggle = true; public static bool SmartCursorEnabled = false; public static bool SmartCursorShowing = false; public static int SmartCursorX; public static int SmartCursorY; - public static bool SmartInteractShowingGenuine; - public static bool SmartInteractShowingFake; + public static bool SmartInteractShowingGenuine = false; + public static bool SmartInteractShowingFake = false; public static int SmartInteractX; public static int SmartInteractY; public static int SmartInteractNPC; - public static int SmartInteractProj; - public static bool SmartInteractPotionOfReturn; + public static List SmartInteractNPCsNearby = new List(); public static List SmartInteractTileCoords = new List(); public static List SmartInteractTileCoordsSelected = new List(); public static int TileInteractionLX = -1; @@ -1822,13 +1989,13 @@ namespace Terraria public static Microsoft.Xna.Framework.Color mouseColor = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, 50, 95); public static Microsoft.Xna.Framework.Color cursorColor = Microsoft.Xna.Framework.Color.White; public static int cursorColorDirection = 1; - public static float cursorAlpha; - public static float cursorScale; - public static bool signBubble; + public static float cursorAlpha = 0.0f; + public static float cursorScale = 0.0f; + public static bool signBubble = false; public static int signX = 0; public static int signY = 0; - public static bool hideUI; - public static bool releaseUI; + public static bool hideUI = false; + public static bool releaseUI = false; public static int FrameSkipMode = 2; public static bool terrariasFixedTiming = true; private int splashCounter; @@ -1840,33 +2007,14 @@ namespace Terraria public List DrawCacheProjsBehindNPCs = new List(1000); public List DrawCacheProjsBehindProjectiles = new List(1000); public List DrawCacheProjsOverWiresUI = new List(1000); - public List DrawCacheProjsOverPlayers = new List(1000); - public List DrawCacheFirstFractals = new List(1000); - public static ParticleRenderer ParticleSystem_World_OverPlayers = new ParticleRenderer(); - public static ParticleRenderer ParticleSystem_World_BehindPlayers = new ParticleRenderer(); - private static WindowStateController _windowMover; - public static AnchoredEntitiesCollection sittingManager; - public static AnchoredEntitiesCollection sleepingManager; - private static bool shouldSetDefaultUIScale = true; - private static float newDefaultUIScale = 0.0f; - private static bool startFullscreen = false; public static string oldStatusText = ""; - public static string autoGenFileLocation = (string) null; - public static bool autoShutdown; - private uint previousExecutionState; - public static int sundialCooldown; - public static bool fastForwardTime; - private static Stopwatch splashTimer = new Stopwatch(); - private IEnumerator _gameContentLoadProcess; - private int _musicReplayDelay; - public static bool _shouldUseWindyDayMusic = false; - public static bool _shouldUseStormMusic = false; - private int lastMusicPlayed = -1; - private bool playOldTile; - private static float _minWind = 0.34f; - private static float _maxWind = 0.4f; - private static float _minRain = 0.4f; - private static float _maxRain = 0.5f; + public static bool autoShutdown = false; + public static bool serverGenLock = false; + public static int sundialCooldown = 0; + public static bool fastForwardTime = false; + private System.Type t2d = typeof (Texture2D); + private Stopwatch t2dtest = new Stopwatch(); + public static readonly object globalTextureLocker = new object(); public static float ambientWaterfallX = -1f; public static float ambientWaterfallY = -1f; public static float ambientWaterfallStrength = 0.0f; @@ -1875,19 +2023,13 @@ namespace Terraria public static float ambientLavafallStrength = 0.0f; public static float ambientLavaX = -1f; public static float ambientLavaY = -1f; - public static float ambientLavaStrength; - public static int ambientCounter; - private static bool _isWaterfallMusicPlaying = false; - private static bool _isLavafallMusicPlaying = false; - public static IChatMonitor chatMonitor = (IChatMonitor) new RemadeChatMonitor(); + public static float ambientLavaStrength = 0.0f; + public static int ambientCounter = 0; public static int ProjectileUpdateLoopIndex = -1; - public static GameTipsDisplay gameTips; - private Stopwatch _worldUpdateTimeTester = new Stopwatch(); - public SpelunkerProjectileHelper SpelunkerProjectileHelper = new SpelunkerProjectileHelper(); - public ChumBucketProjectileHelper ChumBucketProjectileHelper = new ChumBucketProjectileHelper(); - public static int weatherVaneBobframe = 0; + private bool _crazyTestedMemoryLimit; + private Player[] _crazyTestArrayMemoryLimit; private float logoRotation; - private float logoRotationDirection = -1f; + private float logoRotationDirection = 1f; private float logoRotationSpeed = 1f; private float logoScale = 1f; private float logoScaleDirection = 1f; @@ -1898,124 +2040,84 @@ namespace Terraria private int selectedMenu = -1; private int selectedMenu2 = -1; public static int selectedPlayer = 0; - public static int selectedWorld; - public static int menuMode; - public static int menuSkip; + public static int selectedWorld = 0; + public static int menuMode = 0; + public static int menuSkip = 0; private static bool _needsLanguageSelect = true; - private static Item tooltipPrefixComparisonItem = new Item(); - private Main.MouseTextCache _mouseTextCache; + private static Item cpItem = new Item(); public int textBlinkerCount; public int textBlinkerState; public static string newWorldName = ""; private static int[] specX = new int[1000]; private static int[] specY = new int[1000]; - public TilePaintSystemV2 TilePaintSystem; - public TileDrawing TilesRenderer; - public WallDrawing WallsRenderer; - private AmbientWindSystem _ambientWindSys = new AmbientWindSystem(); - private List _playersThatDrawBehindNPCs = new List((int) byte.MaxValue); - private List _playersThatDrawAfterProjectiles = new List((int) byte.MaxValue); - private List _voidLensData = new List(); - private List _voidLensDataSillouette = new List(); - private List _voidLensDataSillouette2 = new List(); - private Main.TextDisplayCache _textDisplayCache = new Main.TextDisplayCache(); - private List _occupantsListToDrawNPCHouses = new List(); - private List _npcsWithBannersToDraw = new List(); private bool _imeToggle; - private List _npcTypesThatAlreadyDrewAHead = new List(); - private int[] _npcIndexWhoHoldsHeadIndex = new int[45]; - private static List _requiredObjecsForCraftingText = new List(); - private static bool _preventCraftingBecauseClickWasUsedToChangeFocusedRecipe; - private static int _currentRecipeBeingCrafted = -1; - private static bool hidePVPIcons = false; - public static bool HoveringOverAnNPC; + public static bool HoveringOverAnNPC = false; public static string hoverItemName = ""; public static Microsoft.Xna.Framework.Color inventoryBack = new Microsoft.Xna.Framework.Color(220, 220, 220, 220); - public static bool mouseText; - private static int mH; - private static int rare; - public static int hairStart; + public static bool mouseText = false; + private static int mH = 0; + private static int UI_ScreenAnchorX = Main.screenWidth - 800; + private static int UIDisplay_ManaPerStar = 20; + private static float UIDisplay_LifePerHeart = 20f; + private static int rare = 0; + public static int hairStart = 0; private static int oldHairStyle; private static Microsoft.Xna.Framework.Color oldHairColor; - public static int selClothes; - private static Microsoft.Xna.Framework.Color[] oldClothesColor = new Microsoft.Xna.Framework.Color[6]; - private static int oldClothesStyle; - public static int interactedDresserTopLeftX; - public static int interactedDresserTopLeftY; - public static Player dresserInterfaceDummy; + public static int selClothes = 0; + private static Microsoft.Xna.Framework.Color[] oldClothesColor = new Microsoft.Xna.Framework.Color[4]; + private static int oldClothesStyle = 0; + public static int dresserX; + public static int dresserY; + public static Player dresserDummy; private bool _needToSetupDrawInterfaceLayers = true; private List _gameInterfaceLayers; private static GameTime _drawInterfaceGameTime; - private static bool _settingsButtonIsPushedToSide; - private static bool _MouseOversCanClear; + private static bool _MouseOversCanClear = false; private static Vector2 _itemIconCacheScreenPosition; private static int _itemIconCacheSelectedItemID; - private static int _itemIconCacheTime; - private static bool _cannotDrawAccessoriesHorizontally = false; + private static int _itemIconCacheTime = 0; public static Microsoft.Xna.Framework.Color selColor = Microsoft.Xna.Framework.Color.White; - public static int focusColor; - public static int colorDelay; + public static int focusColor = 0; + public static int colorDelay = 0; public static int setKey = -1; - public static int bgScroll; - public static bool autoPass; + public static int bgScroll = 0; + public static bool autoPass = false; public static int menuFocus = 0; public static float hBar = -1f; public static float sBar = -1f; public static float lBar = 1f; public static float aBar = 1f; private int grabColorSlider; - public static bool blockMouse; - private static bool _blockFancyUIWhileLoading; + public static bool blockMouse = false; + private static bool _blockFancyUIWhileLoading = false; private bool[] menuWide = new bool[100]; public static float GamepadCursorAlpha = 0.0f; - private bool _needsMenuUIRecalculation; - public static float MenuXMovement = 0.0f; - private float _splashFrameCount; - private bool quickSplash; - private float hellBlackBoxBottom; - public static float MapScale = 1f; - private static int _minimapTopRightAnchorOffsetTowardsLeft = 52; - private static int _minimapTopRightAnchorOffsetTowardsBottom = 90; - public static bool cancelWormHole = false; - private static VertexColors _glowPaintColors = new VertexColors(Microsoft.Xna.Framework.Color.White); protected List> DrawWiresSpecialTiles = new List>(); - public static float lightning; - private static float lightningDecay = 1f; - private static float lightningSpeed = 0.0f; - private static int thunderDelay; - public static int thunderDistance; - private static string[] MonolithFilterNames = new string[5] + private static string[] MonolithFilterNames = new string[4] { "MonolithVortex", "MonolithNebula", "MonolithStardust", - "MonolithSolar", - "MonolithMoonLord" + "MonolithSolar" }; - private static string[] MonolithSkyNames = new string[5] + private static string[] MonolithSkyNames = new string[4] { "MonolithVortex", "MonolithNebula", "MonolithStardust", - "MonolithSolar", - "MonolithMoonLord" + "MonolithSolar" }; - private static float backgroundLayerTransitionSpeed = 0.05f; - public static float atmo; + private static float tranSpeed = 0.05f; + private static float atmo = 0.0f; private static float bgScale = 1f; - private static int bgWidthScaled = (int) (1024.0 * (double) Main.bgScale); - public static Microsoft.Xna.Framework.Color ColorOfTheSkies; - private static Microsoft.Xna.Framework.Color ColorOfSurfaceBackgroundsBase = Microsoft.Xna.Framework.Color.White; - private static Microsoft.Xna.Framework.Color ColorOfSurfaceBackgroundsModified = Microsoft.Xna.Framework.Color.White; + private static int bgW = (int) (1024.0 * (double) Main.bgScale); + private static Microsoft.Xna.Framework.Color backColor = Microsoft.Xna.Framework.Color.White; + private static Microsoft.Xna.Framework.Color trueBackColor = Main.backColor; private float screenOff; private float scAdj; private float cTop; private bool _isDrawingOrUpdating; - public static List ContentThatNeedsRenderTargets = new List(); - private static string _oldNetplayStatusText; - private static TextSnippet[] _netplayStatusTextSnippets; - public static int ladyBugRainBoost = 0; - private static bool _canShowMeteorFall; + private static SlotVector _trackedSounds = new SlotVector(4096); public static Vector2 ViewPosition => Main.screenPosition + Main.GameViewMatrix.Translation; @@ -2035,7 +2137,7 @@ namespace Terraria set { Main._uiScaleWanted = value; - float uiScaleMax = Main.instance.UIScaleMax; + float uiScaleMax = Main.instance.UIScaleMAX; if ((double) value > (double) uiScaleMax) value = uiScaleMax; Main._uiScaleUsed = value; @@ -2043,12 +2145,25 @@ namespace Terraria } } - public float UIScaleMax => Math.Max(1f, Math.Min((float) PlayerInput.RealScreenWidth / 800f, (float) PlayerInput.RealScreenHeight / 600f)); + public float UIScaleMAX + { + get + { + int realScreenWidth = PlayerInput.RealScreenWidth; + int realScreenHeight = PlayerInput.RealScreenHeight; + float num = 2f; + if ((double) realScreenWidth / 800.0 < (double) num) + num = (float) realScreenWidth / 800f; + if ((double) realScreenHeight / 600.0 < (double) num) + num = (float) realScreenHeight / 600f; + if ((double) num < 1.0) + num = 1f; + return num; + } + } public static bool RenderTargetsRequired => (double) Main.GameZoomTarget > 1.0 || (double) Main.GameViewMatrix.TransformationMatrix.M11 > 1.0; - public static bool IsItRaining => (double) Main.cloudAlpha > 0.0; - public static bool ThickMouse => Main.MouseBorderColor != Microsoft.Xna.Framework.Color.Transparent; public static bool GamepadDisableCursorItemIcon => PlayerInput.UsingGamepad && Main.GamepadDisableCursorItemIconInner; @@ -2063,53 +2178,23 @@ namespace Terraria Main.AnnouncementBoxRange = result; } - public static GameModeData GameModeInfo => Main._currentGameModeInfo; - - public static int GameMode - { - get => Main.ActiveWorldFileData == null ? 0 : Main.ActiveWorldFileData.GameMode; - set - { - GameModeData gameModeData; - if (Main.ActiveWorldFileData == null || !Main.RegisterdGameModes.TryGetValue(value, out gameModeData)) - return; - Main.ActiveWorldFileData.GameMode = value; - Main._currentGameModeInfo = gameModeData; - } - } - - public static bool masterMode - { - get - { - if (Main.ActiveWorldFileData == null) - return false; - return Main._overrideForMasterMode.HasValue ? Main._overrideForMasterMode.Value : Main._currentGameModeInfo.IsMasterMode; - } - } - public static bool expertMode { - get + get => Main.ActiveWorldFileData != null && Main.ActiveWorldFileData.IsExpertMode; + set { if (Main.ActiveWorldFileData == null) - return false; - return Main._overrideForExpertMode.HasValue ? Main._overrideForExpertMode.Value : Main._currentGameModeInfo.IsExpertMode; + return; + Main.ActiveWorldFileData.IsExpertMode = value; } } public static AchievementManager Achievements => Main.instance._achievements; - public static AchievementAdvisor AchievementAdvisor => Main.instance._achievementAdvisor; - - public static ulong UnpausedUpdateSeed { get; private set; } - public static Effect screenShader => Main.ScreenShaderRef.Value; public static Effect pixelShader => Main.PixelShaderRef.Value; - public static Effect vertexPixelShader => Main.VertexPixelShaderRef.Value; - public static Effect tileShader => Main.TileShaderRef.Value; public static void SetCameraLerp(float lerp, int time) @@ -2165,14 +2250,6 @@ namespace Terraria return box; } - public void SetMouseNPC(int index, int type) - { - this.mouseNPCIndex = index; - this.mouseNPCType = type; - } - - public void SetMouseNPC_ToHousingQuery() => this.SetMouseNPC(-1, 0); - public static event Action OnEnginePreload; public static event Action OnResolutionChanged; @@ -2181,16 +2258,12 @@ namespace Terraria public static uint GameUpdateCount => Main._gameUpdateCount; - public static event Action OnTickForThirdPartySoftwareOnly; - - public static event Action OnTickForInternalCodeOnly; + public static event Action OnTick; public static event Action OnPreDraw; public static event Action OnPostDraw; - public static event Action OnPostFullscreenMapDraw; - public static event Action OnRenderTargetsReleased; public static event ResolutionChangeEvent OnRenderTargetsInitialized; @@ -2209,361 +2282,13 @@ namespace Terraria public static SamplerState DefaultSamplerState => !Main.drawToScreen ? SamplerState.PointClamp : SamplerState.LinearClamp; - public static int UnderworldLayer => Main.maxTilesY - 200; + public static SamplerState MountedSamplerState => !Main.drawToScreen ? SamplerState.AnisotropicClamp : SamplerState.LinearClamp; - public static MoonPhase GetMoonPhase() => (MoonPhase) Main.moonPhase; - - public static float WindForVisuals => Main.windSpeedCurrent; - - public static Vector2 DrawPlayerItemPos(float gravdir, int itemtype) - { - float num = 10f; - Main.instance.LoadItem(itemtype); - Vector2 vector2 = new Vector2((float) (TextureAssets.Item[itemtype].Width() / 2), (float) (TextureAssets.Item[itemtype].Height() / 2)); - if (itemtype == 95) - { - num = 6f; - vector2.Y += 2f * gravdir; - } - else if (itemtype == 1295) - num = 4f; - else if (itemtype == 3611) - num = 2f; - else if (itemtype == 3350) - num = 2f; - else if (itemtype == 2624) - num = 4f; - else if (itemtype == 3018) - num = 2f; - else if (itemtype == 3007) - { - num = 4f; - vector2.Y -= 1f * gravdir; - } - else if (itemtype == 3107) - { - num = 4f; - vector2.Y += 2f * gravdir; - } - else if (itemtype == 3008) - { - num = -7f; - vector2.Y += 2f * gravdir; - } - else if (itemtype == 1255) - { - num = 6f; - vector2.Y += 0.0f * gravdir; - } - else if (itemtype == 2269) - { - num = 2f; - vector2.Y += 2f * gravdir; - } - else if (itemtype == 1265) - { - num = -8f; - vector2.Y += 4f * gravdir; - } - else if (itemtype == 2272) - { - num = 0.0f; - vector2.Y += 4f * gravdir; - } - else if (itemtype == 3029) - num = 4f; - else if (itemtype == 4381) - num = 4f; - else if (itemtype == 2796) - { - num = -28f; - vector2.Y += 2f * gravdir; - } - else if (itemtype == 2797) - num = 0.0f; - else if (itemtype == 2610) - num = 0.0f; - else if (itemtype == 2623) - { - num = -30f; - vector2.Y -= 4f * gravdir; - } - else if (itemtype == 3546) - { - num = -14f; - vector2.Y -= 6f * gravdir; - } - else if (itemtype == 1835) - { - num = -2f; - vector2.Y += 2f * gravdir; - } - else if (itemtype == 2624) - num = -4f; - else if (itemtype == 3859) - num = -2f; - else if (itemtype == 2888) - num = 6f; - else if (itemtype == 2223) - { - num = 2f; - vector2.Y -= 2f * gravdir; - } - else if (itemtype == 1782) - { - num = 0.0f; - vector2.Y += 4f * gravdir; - } - else if (itemtype == 1929) - { - num = 0.0f; - vector2.Y += 2f * gravdir; - } - else if (itemtype == 2270) - num = -4f; - else if (itemtype == 1784) - { - num = 0.0f; - vector2.Y += 4f * gravdir; - } - else if (itemtype == 1000) - { - num = 6f; - vector2.Y += 0.0f * gravdir; - } - else if (itemtype == 1178) - { - num = 4f; - vector2.Y += 0.0f * gravdir; - } - else if (itemtype == 1319) - { - num = 0.0f; - vector2.Y += 0.0f * gravdir; - } - else if (itemtype == 1297) - { - num = -8f; - vector2.Y += 0.0f * gravdir; - } - else if (itemtype == 1121) - { - num = 6f; - vector2.Y -= 2f * gravdir; - } - else if (itemtype == 1314) - num = 2f; - else if (itemtype == 1258) - { - num = 2f; - vector2.Y -= 2f * gravdir; - } - else if (itemtype == 1155) - { - num = -10f; - vector2.Y -= 2f * gravdir; - } - else if (itemtype == 1156) - num = -2f; - else if (itemtype == 4703) - { - num = -3f; - vector2.Y -= 2f * gravdir; - } - else if (itemtype == 96) - { - num = -8f; - vector2.Y += 2f * gravdir; - } - else if (itemtype == 1870) - { - num = -8f; - vector2.Y += 2f * gravdir; - } - else if (itemtype == 1260) - { - num = -8f; - vector2.Y += 2f * gravdir; - } - else if (itemtype == 1254) - { - num = -6f; - vector2.Y += 2f * gravdir; - } - else if (itemtype == 98) - { - num = -5f; - vector2.Y -= 2f * gravdir; - } - else if (itemtype == 534) - { - num = -2f; - vector2.Y += 1f * gravdir; - } - else if (itemtype == 679) - { - num = 0.0f; - vector2.Y += 2f * gravdir; - } - else if (itemtype == 964) - { - num = 0.0f; - vector2.Y += 0.0f * gravdir; - } - else if (itemtype == 533) - { - num = -7f; - vector2.Y -= 2f * gravdir; - } - else if (itemtype == 1553) - { - num = -10f; - vector2.Y -= 2f * gravdir; - } - else if (itemtype == 506) - { - num = 0.0f; - vector2.Y -= 2f * gravdir; - } - else if (itemtype == 1910) - { - num = 0.0f; - vector2.Y -= 2f * gravdir; - } - else if (itemtype == 494 || itemtype == 508) - { - num = -2f; - } - else - { - switch (itemtype) - { - case 434: - num = 0.0f; - vector2.Y -= 2f * gravdir; - break; - case 514: - num = 0.0f; - vector2.Y += 3f * gravdir; - break; - default: - if (itemtype == 435 || itemtype == 436 || itemtype == 481 || itemtype == 578 || itemtype == 1187 || itemtype == 1194 || itemtype == 1201 || itemtype == 1229) - { - num = -2f; - vector2.Y -= 2f * gravdir; - break; - } - switch (itemtype) - { - case 126: - num = 4f; - vector2.Y += 4f * gravdir; - break; - case (int) sbyte.MaxValue: - num = 4f; - vector2.Y += 2f * gravdir; - break; - case 157: - num = 6f; - vector2.Y += 2f * gravdir; - break; - case 160: - num = -8f; - break; - case 197: - num = -5f; - vector2.Y += 4f * gravdir; - break; - case 800: - num = 4f; - vector2.Y += 2f * gravdir; - break; - case 4060: - num = -2f; - vector2.Y += 4f * gravdir; - break; - default: - if (itemtype == 164 || itemtype == 219) - { - num = 0.0f; - vector2.Y += 2f * gravdir; - break; - } - if (itemtype == 165 || itemtype == 272) - { - num = 4f; - vector2.Y += 4f * gravdir; - break; - } - switch (itemtype) - { - case 266: - num = 0.0f; - vector2.Y += 2f * gravdir; - break; - case 281: - num = 6f; - vector2.Y -= 6f * gravdir; - break; - case 682: - num = 4f; - break; - case 758: - num -= 20f; - vector2.Y += 0.0f * gravdir; - break; - case 759: - num -= 18f; - vector2.Y += 2f * gravdir; - break; - case 760: - num -= 12f; - vector2.Y += 2f * gravdir; - break; - case 779: - num = 0.0f; - vector2.Y += 2f * gravdir; - break; - case 905: - num = -5f; - vector2.Y += 0.0f * gravdir; - break; - case 930: - num = 4f; - vector2.Y += 2f * gravdir; - break; - case 986: - num = 6f; - vector2.Y -= 10f * gravdir; - break; - case 1946: - num -= 12f; - vector2.Y += 2f * gravdir; - break; - case 3788: - num = 2f; - vector2.Y += 2f * gravdir; - break; - case 3870: - num = 4f; - vector2.Y += 4f * gravdir; - break; - case 4953: - num = -4f; - break; - } - break; - } - break; - } - } - vector2.X = num; - return vector2; - } + public static bool UseSeedUI => Main.UseExperimentalFeatures; public static void SetupTileMerge() { - int length = 623; + int length = 470; Main.tileMerge = new bool[length][]; for (int index = 0; index < Main.tileMerge.Length; ++index) Main.tileMerge[index] = new bool[length]; @@ -2582,45 +2307,17 @@ namespace Terraria Main.itemAnimations[index] = (DrawAnimation) null; Main.itemAnimationsRegistered.Clear(); Main.RegisterItemAnimation(3581, (DrawAnimation) new DrawAnimationVertical(4, 4)); - Main.RegisterItemAnimation(3580, (DrawAnimation) new DrawAnimationVertical(6, 4)); - Main.RegisterItemAnimation(75, (DrawAnimation) new DrawAnimationVertical(5, 8) - { - PingPong = true - }); - Main.RegisterItemAnimation(575, (DrawAnimation) new DrawAnimationVertical(6, 4)); - Main.RegisterItemAnimation(547, (DrawAnimation) new DrawAnimationVertical(6, 4)); - Main.RegisterItemAnimation(520, (DrawAnimation) new DrawAnimationVertical(6, 4)); - Main.RegisterItemAnimation(548, (DrawAnimation) new DrawAnimationVertical(6, 4)); - Main.RegisterItemAnimation(521, (DrawAnimation) new DrawAnimationVertical(6, 4)); - Main.RegisterItemAnimation(549, (DrawAnimation) new DrawAnimationVertical(6, 4)); - Main.RegisterItemAnimation(3453, (DrawAnimation) new DrawAnimationVertical(6, 4)); - Main.RegisterItemAnimation(3454, (DrawAnimation) new DrawAnimationVertical(6, 4)); - Main.RegisterItemAnimation(3455, (DrawAnimation) new DrawAnimationVertical(6, 4)); - Main.RegisterItemAnimation(4068, (DrawAnimation) new DrawAnimationVertical(6, 4) - { - NotActuallyAnimating = true - }); - Main.RegisterItemAnimation(4069, (DrawAnimation) new DrawAnimationVertical(6, 4) - { - NotActuallyAnimating = true - }); - Main.RegisterItemAnimation(4070, (DrawAnimation) new DrawAnimationVertical(6, 4) - { - NotActuallyAnimating = true - }); - for (int index = 0; index < ItemID.Sets.IsFood.Length; ++index) - { - if (ItemID.Sets.IsFood[index]) - Main.RegisterItemAnimation(index, (DrawAnimation) new DrawAnimationVertical(int.MaxValue, 3)); - } + Main.RegisterItemAnimation(3580, (DrawAnimation) new DrawAnimationVertical(4, 4)); + Main.RegisterItemAnimation(575, (DrawAnimation) new DrawAnimationVertical(5, 4)); + Main.RegisterItemAnimation(547, (DrawAnimation) new DrawAnimationVertical(5, 4)); + Main.RegisterItemAnimation(520, (DrawAnimation) new DrawAnimationVertical(5, 4)); + Main.RegisterItemAnimation(548, (DrawAnimation) new DrawAnimationVertical(5, 4)); + Main.RegisterItemAnimation(521, (DrawAnimation) new DrawAnimationVertical(5, 4)); + Main.RegisterItemAnimation(549, (DrawAnimation) new DrawAnimationVertical(5, 4)); } public static Player LocalPlayer => Main.player[Main.myPlayer]; - public static CreativeUnlocksTracker LocalPlayerCreativeTracker => Main.player[Main.myPlayer].creativeTracker; - - public static int npcShop { get; private set; } - public static void SetGraphicsProfile(GraphicsProfile profile) { if (Main._currentGraphicsProfile == profile) @@ -2726,52 +2423,10 @@ namespace Terraria public static string worldPathName => Main.ActiveWorldFileData.Path; - public static bool HasSmartInteractTarget => Main.SmartInteractNPC != -1 || Main.SmartInteractX != -1 && Main.SmartInteractY != -1 || Main.SmartInteractProj != -1; - - public void UpdateParticleSystems() - { - Main.ParticleSystem_World_OverPlayers.Update(); - Main.ParticleSystem_World_BehindPlayers.Update(); - } - - public static void TrySetPreparationState(Main.WorldPreparationState state) - { - if (state != Main.WorldPreparationState.ProcessingData) - return; - Main._worldPreparationState = state; - } - - public static void UpdateWorldPreparationState() - { - if (Main.netMode != 1) - { - Main._worldPreparationState = Main.WorldPreparationState.Ready; - } - else - { - if (Main.netMode == 1 && Main.gameMenu && Main._worldPreparationState == Main.WorldPreparationState.Ready) - Main._worldPreparationState = Main.WorldPreparationState.AwaitingData; - if (Main.netMode != 1 || Main._worldPreparationState != Main.WorldPreparationState.ProcessingData) - return; - Main._worldPreparationState = Main.WorldPreparationState.Ready; - Main.gameMenu = false; - Main.FixUIScale(); - ChatHelper.ShowCachedMessages(); - ChatHelper.ClearDelayedMessagesCache(); - } - } - - public static bool InSmartCursorHighlightArea(int x, int y, out bool actuallySelected) - { - actuallySelected = Main.SmartInteractTileCoordsSelected.Contains(new Microsoft.Xna.Framework.Point(x, y)); - return !Main.hideUI && Collision.InTileBounds(x, y, Main.TileInteractionLX, Main.TileInteractionLY, Main.TileInteractionHX, Main.TileInteractionHY) && Main.SmartInteractTileCoords.Contains(new Microsoft.Xna.Framework.Point(x, y)); - } - public static void LoadWorlds() { Main.WorldList.Clear(); - if (!Utils.TryCreatingDirectory(Main.WorldPath)) - return; + Directory.CreateDirectory(Main.WorldPath); string[] files = Directory.GetFiles(Main.WorldPath, "*.wld"); int num = Math.Min(files.Length, Main.maxLoadWorld); for (int index = 0; index < num; ++index) @@ -2801,8 +2456,7 @@ namespace Terraria public static void LoadPlayers() { Main.PlayerList.Clear(); - if (!Utils.TryCreatingDirectory(Main.PlayerPath)) - return; + Directory.CreateDirectory(Main.PlayerPath); string[] files = Directory.GetFiles(Main.PlayerPath, "*.plr"); int num = Math.Min(Main.maxLoadPlayer, files.Length); for (int index = 0; index < num; ++index) @@ -2852,7 +2506,7 @@ namespace Terraria public static void SaveRecent() { - Utils.TryCreatingDirectory(Main.SavePath); + Directory.CreateDirectory(Main.SavePath); try { File.SetAttributes(Main.SavePath + Path.DirectorySeparatorChar.ToString() + "servers.dat", FileAttributes.Normal); @@ -2866,7 +2520,7 @@ namespace Terraria { using (BinaryWriter binaryWriter = new BinaryWriter((Stream) fileStream)) { - binaryWriter.Write(230); + binaryWriter.Write(194); for (int index = 0; index < 10; ++index) { binaryWriter.Write(Main.recentWorld[index]); @@ -2884,8 +2538,7 @@ namespace Terraria public static bool SaveSettings() { Main.Configuration.Clear(); - Main.Configuration.Put("ResetDefaultUIScale", (object) false); - Main.Configuration.Put("SmartCursorToggle", (object) Main.cSmartCursorModeIsToggleAndNotHold); + Main.Configuration.Put("SmartCursorToggle", (object) Main.cSmartCursorToggle); Main.Configuration.Put("MapEnabled", (object) Main.mapEnabled); Main.Configuration.Put("InvasionBarMode", (object) Main.invasionProgressMode); Main.Configuration.Put("AutoSave", (object) Main.autoSave); @@ -2893,13 +2546,9 @@ namespace Terraria Main.Configuration.Put("Language", (object) Language.ActiveCulture.Name); Main.Configuration.Put("PlacementPreview", (object) Main.placementPreview); Main.Configuration.Put("GoreVisualsAllowed", (object) ChildSafety.Disabled); - Main.Configuration.Put("WorldRollbacksToKeep", (object) Main.WorldRollingBackupsCountToKeep); - Main.Configuration.Put("TeamNameplateDistance", (object) Main.teamNamePlateDistance); - Main.Configuration.Put("MultiplayerNPCSmoothingRange", (object) Main.multiplayerNPCSmoothingRange); Main.Configuration.Put("VolumeSound", (object) Main.soundVolume); Main.Configuration.Put("VolumeAmbient", (object) Main.ambientVolume); Main.Configuration.Put("VolumeMusic", (object) Main.musicVolume); - Main.Configuration.Put("UnlockMusicSwap", (object) Main.TOWMusicUnlocked); Main.Configuration.Put("UseExperimentalFeatures", (object) Main.UseExperimentalFeatures); Main.Configuration.Put("Fullscreen", (object) Main.graphics.IsFullScreen); Main.Configuration.Put("WindowMaximized", (object) Main.screenMaximized); @@ -2909,13 +2558,15 @@ namespace Terraria Main.Configuration.Put("GraphicsQuality", (object) Main.qaStyle); Main.Configuration.Put("BackgroundEnabled", (object) Main.BackgroundEnabled); Main.Configuration.Put("FrameSkipMode", (object) Main.FrameSkipMode); - Main.Configuration.Put("LightingMode", (object) Lighting.Mode); - Main.Configuration.Put("BackgroundParallax", (object) Main.bgScroll); + Main.Configuration.Put("LightingMode", (object) Lighting.lightMode); + Main.Configuration.Put("LightingThreads", (object) Lighting.LightingThreads); + Main.Configuration.Put("Parallax", (object) Main.caveParallax); Main.Configuration.Put("ShowItemText", (object) Main.showItemText); - Main.Configuration.Put("LastLaunchedVersion", (object) 230); + Main.Configuration.Put("LastLaunchedVersion", (object) 194); Main.Configuration.Put("ClientUUID", (object) Main.clientUUID); Main.Configuration.Put("UseSmartCursorForCommonBlocks", (object) Player.SmartCursorSettings.SmartBlocksEnabled); Main.Configuration.Put("UseSmartAxeAfterSmartPickaxe", (object) Player.SmartCursorSettings.SmartAxeAfterPickaxe); + Main.Configuration.Put("UseSmartWallReplacement", (object) Player.SmartCursorSettings.SmartWallReplacement); Main.Configuration.Put("DisableLeftShiftTrashCan", (object) ItemSlot.Options.DisableLeftShiftTrashCan); Main.Configuration.Put("HighlightNewItems", (object) ItemSlot.Options.HighlightNewItems); Main.Configuration.Put("HidePasswords", (object) Main.HidePassword); @@ -2927,10 +2578,6 @@ namespace Terraria Main.Configuration.Put("GamepadDisableInstructionsDisplay", (object) Main.GamepadDisableInstructionsDisplay); Main.Configuration.Put("SettingsUnlock_WorldEvil", (object) Main.SettingsUnlock_WorldEvil); Main.Configuration.Put("SettingsEnabled_MinersWobble", (object) Main.SettingsEnabled_MinersWobble); - Main.Configuration.Put("SettingBlockGamepadsEntirely", (object) Main.SettingBlockGamepadsEntirely); - Main.Configuration.Put("SettingsEnabled_OpaqueBoxBehindTooltips", (object) Main.SettingsEnabled_OpaqueBoxBehindTooltips); - Main.Configuration.Put("SettingDontScaleMainMenuUp", (object) Main.SettingDontScaleMainMenuUp); - Main.Configuration.Put("SettingsEnabled_TilesSwayInWind", (object) Main.SettingsEnabled_TilesSwayInWind); Main.Configuration.Put("UseStormEffect", (object) Main.UseStormEffects); Main.Configuration.Put("UseHeatDistortion", (object) Main.UseHeatDistortion); Main.Configuration.Put("WaveQuality", (object) Main.WaveQuality); @@ -2972,16 +2619,7 @@ namespace Terraria Main.Configuration.Put("QuickLaunch", (object) Main.SkipAssemblyLoad); Main.Configuration.Put("Zoom", (object) Main.GameZoomTarget); Main.Configuration.Put("UIScale", (object) Main._uiScaleWanted); - Main.Configuration.Put("MapScale", (object) Main.MapScale); - if (Main.AssetSourceController != null) - Main.Configuration.Put("ResourcePacks", (object) Main.AssetSourceController.ActiveResourcePackList.ToJson()); - Main.Configuration.Put("FlashIconForEvents", (object) Enum.GetName(typeof (GameNotificationType), (object) Main._flashNotificationType)); - Main.Configuration.Put("Display", (object) Main._windowMover.ScreenDeviceName); - Main.Configuration.Put("DisplayScreen", (object) Main._windowMover.ScreenDeviceName); - Main.Configuration.Put("ThrottleWhenInactive", (object) (Main.instance.InactiveSleepTime != TimeSpan.Zero)); - Main.Configuration.Put("DoorAutoOpeningMode", (object) DoorOpeningHelper.PreferenceSettings); - Main.Configuration.Put("WaterfallDrawLimit", (object) Main.instance.waterfallManager.maxWaterfallCount); - Main.Configuration.Put("DisableIntenseVisualEffects", (object) Main.DisableIntenseVisualEffects); + Main.Configuration.Put("RunningAchievementEnabled", (object) Main.RunningAchievementEnabled); return Main.Configuration.Save() && PlayerInput.Save(); } @@ -2992,62 +2630,27 @@ namespace Terraria RegistryKey subKey = Registry.CurrentUser.CreateSubKey("Software\\Terraria"); if (subKey == null || subKey.GetValue("Bunny") == null || !(subKey.GetValue("Bunny").ToString() == "1")) return; - Main.runningCollectorsEdition = true; + Main.cEd = true; } catch { - Main.runningCollectorsEdition = false; + Main.cEd = false; } } - private static void TryPickingDefaultUIScale(float displayHeight) - { - if (!Main.shouldSetDefaultUIScale) - return; - Main.newDefaultUIScale = (float) ((double) displayHeight / 1080.0 * 1.10000002384186); - Main.shouldSetDefaultUIScale = false; - Main.Configuration.Put("UIScale", (object) Main.newDefaultUIScale); - Main.Configuration.Save(); - } - - protected void LoadSettings() + protected void OpenSettings() { if (File.Exists(Main.SavePath + Path.DirectorySeparatorChar.ToString() + "config.dat")) { this.OpenLegacySettings(); - if (!Main.SaveSettings()) - return; - File.Delete(Main.SavePath + Path.DirectorySeparatorChar.ToString() + "config.dat"); + if (Main.SaveSettings()) + File.Delete(Main.SavePath + Path.DirectorySeparatorChar.ToString() + "config.dat"); + Lighting.LightingThreads = 0; } else { Main.Configuration.Load(); - int currentValue1 = 0; - Main.Configuration.Get("LastLaunchedVersion", ref currentValue1); - bool flag = false; - if (currentValue1 < 219) - flag = true; - if (!flag) - { - Main.Configuration.Get("ResetDefaultUIScale", ref Main.shouldSetDefaultUIScale); - Main.Configuration.Get("Fullscreen", ref Main.startFullscreen); - Main.Configuration.Get("WindowMaximized", ref Main.screenMaximized); - Main.Configuration.Get("WindowBorderless", ref Main.screenBorderless); - } - Main.PendingBorderlessState = Main.screenBorderless; - Main.screenBorderlessPendingResizes = Main.screenBorderless ? 6 : 0; - if (!Main.startFullscreen) - { - int preferredBackBufferWidth = Main.graphics.PreferredBackBufferWidth; - int backBufferHeight = Main.graphics.PreferredBackBufferHeight; - Main.Configuration.Get("DisplayWidth", ref preferredBackBufferWidth); - Main.Configuration.Get("DisplayHeight", ref backBufferHeight); - if (Main.PendingBorderlessState) - Main.screenBorderlessPendingResizes = 1; - Main.SetDisplayMode(preferredBackBufferWidth, backBufferHeight, false); - Main.TryPickingDefaultUIScale((float) backBufferHeight); - } - Main.Configuration.Get("SmartCursorToggle", ref Main.cSmartCursorModeIsToggleAndNotHold); + Main.Configuration.Get("SmartCursorToggle", ref Main.cSmartCursorToggle); Main.Configuration.Get("MapEnabled", ref Main.mapEnabled); Main.Configuration.Get("InvasionBarMode", ref Main.invasionProgressMode); Main.Configuration.Get("AutoSave", ref Main.autoSave); @@ -3057,37 +2660,34 @@ namespace Terraria int result1 = 0; if (int.TryParse(str, out result1)) { + Main.chTitle = true; LanguageManager.Instance.SetLanguage(result1); - this.SetTitle(); } else { + Main.chTitle = true; LanguageManager.Instance.SetLanguage(str); - this.SetTitle(); } Main.Configuration.Get("PlacementPreview", ref Main.placementPreview); Main.Configuration.Get("GoreVisualsAllowed", ref ChildSafety.Disabled); - Main.Configuration.Get("DisableIntenseVisualEffects", ref Main.DisableIntenseVisualEffects); - if (!flag) - { - Main.Configuration.Get("VolumeSound", ref Main.soundVolume); - Main.Configuration.Get("VolumeAmbient", ref Main.ambientVolume); - Main.Configuration.Get("VolumeMusic", ref Main.musicVolume); - } + Main.Configuration.Get("VolumeSound", ref Main.soundVolume); + Main.Configuration.Get("VolumeAmbient", ref Main.ambientVolume); + Main.Configuration.Get("VolumeMusic", ref Main.musicVolume); Main.Configuration.Get("KeyFavoriteModifier", ref Main.cFavoriteKey); Microsoft.Xna.Framework.Input.Keys result2; if (Enum.TryParse(Main.cFavoriteKey, out result2)) Main.FavoriteKey = result2; - if (!flag) - { - Main.Configuration.Get("GraphicsQuality", ref Main.qaStyle); - Main.Configuration.Get("BackgroundEnabled", ref Main.BackgroundEnabled); - } + Main.Configuration.Get("WindowMaximized", ref Main.screenMaximized); + Main.Configuration.Get("WindowBorderless", ref Main.screenBorderless); + Main.PendingBorderlessState = Main.screenBorderless; + Main.screenBorderlessPendingResizes = Main.screenBorderless ? 6 : 0; + Main.Configuration.Get("GraphicsQuality", ref Main.qaStyle); + Main.Configuration.Get("BackgroundEnabled", ref Main.BackgroundEnabled); if (Main.Configuration.GetAllKeys().Contains("FrameSkip")) { - bool currentValue2 = false; - Main.Configuration.Get("FrameSkip", ref currentValue2); - Main.terrariasFixedTiming = !currentValue2; + bool currentValue = false; + Main.Configuration.Get("FrameSkip", ref currentValue); + Main.terrariasFixedTiming = !currentValue; Main.FrameSkipMode = !Main.terrariasFixedTiming ? 1 : 2; } Main.Configuration.Get("FrameSkipMode", ref Main.FrameSkipMode); @@ -3095,32 +2695,22 @@ namespace Terraria Main.FrameSkipMode = 0; if (Main.FrameSkipMode > 2) Main.FrameSkipMode = 2; - int mode = (int) Lighting.Mode; - if (!flag) - Main.Configuration.Get("LightingMode", ref mode); - Lighting.Mode = (LightMode) mode; - Main.Configuration.Get("UnlockMusicSwap", ref Main.TOWMusicUnlocked); + Main.Configuration.Get("LightingMode", ref Lighting.lightMode); + Main.Configuration.Get("LightingThreads", ref Lighting.LightingThreads); Main.Configuration.Get("Parallax", ref Main.caveParallax); Main.bgScroll = (int) ((1.0 - (double) Main.caveParallax) * 500.0); - Main.Configuration.Get("BackgroundParallax", ref Main.bgScroll); - Main.caveParallax = (float) (1.0 - (double) Main.bgScroll / 500.0); Main.Configuration.Get("ShowItemText", ref Main.showItemText); Main.Configuration.Get("ClientUUID", ref Main.clientUUID); Main.Configuration.Get("UseSmartCursorForCommonBlocks", ref Player.SmartCursorSettings.SmartBlocksEnabled); + Main.Configuration.Get("UseSmartWallReplacement", ref Player.SmartCursorSettings.SmartWallReplacement); Main.Configuration.Get("UseSmartAxeAfterSmartPickaxe", ref Player.SmartCursorSettings.SmartAxeAfterPickaxe); - if (!flag) - Main.Configuration.Get("DisableLeftShiftTrashCan", ref ItemSlot.Options.DisableLeftShiftTrashCan); + Main.Configuration.Get("DisableLeftShiftTrashCan", ref ItemSlot.Options.DisableLeftShiftTrashCan); Main.Configuration.Get("HidePasswords", ref Main.HidePassword); Main.Configuration.Get("HighlightNewItems", ref ItemSlot.Options.HighlightNewItems); Main.Configuration.Get("ReverseUpDownForArmorSetBonuses", ref Main.ReversedUpDownArmorSetBonuses); Main.Configuration.Get("MouseShowBuildingGrid", ref Main.MouseShowBuildingGrid); Main.Configuration.Get("AllowUnfocusedInputOnGamepad", ref Main.AllowUnfocusedInputOnGamepad); Main.Configuration.Get("GamepadDisableInstructionsDisplay", ref Main.GamepadDisableInstructionsDisplay); - Main.Configuration.Get("SettingDontScaleMainMenuUp", ref Main.SettingDontScaleMainMenuUp); - Main.Configuration.Get("WorldRollbacksToKeep", ref Main.WorldRollingBackupsCountToKeep); - Main.Configuration.Get("TeamNameplateDistance", ref Main.teamNamePlateDistance); - if (currentValue1 < 230) - Main.Configuration.Get("MultiplayerNPCSmoothingRange", ref Main.multiplayerNPCSmoothingRange); Main.Configuration.Get("UseStormEffect", ref Main.UseStormEffects); Main.Configuration.Get("UseHeatDistortion", ref Main.UseHeatDistortion); Main.Configuration.Get("WaveQuality", ref Main.WaveQuality); @@ -3128,58 +2718,50 @@ namespace Terraria Main.WaveQuality = 3; if (Main.WaveQuality < 0) Main.WaveQuality = 0; - Dictionary currentValue3 = new Dictionary(); - Main.Configuration.Get>("MouseColor", ref currentValue3); + bool currentValue1 = false; + int preferredBackBufferWidth = Main.graphics.PreferredBackBufferWidth; + int backBufferHeight = Main.graphics.PreferredBackBufferHeight; + Main.Configuration.Get("Fullscreen", ref currentValue1); + Main.Configuration.Get("DisplayWidth", ref preferredBackBufferWidth); + Main.Configuration.Get("DisplayHeight", ref backBufferHeight); + Dictionary currentValue2 = new Dictionary(); + Main.Configuration.Get>("MouseColor", ref currentValue2); byte num; - if (currentValue3.TryGetValue("R", out num)) + if (currentValue2.TryGetValue("R", out num)) Main.mouseColor.R = num; - if (currentValue3.TryGetValue("G", out num)) + if (currentValue2.TryGetValue("G", out num)) Main.mouseColor.G = num; - if (currentValue3.TryGetValue("B", out num)) + if (currentValue2.TryGetValue("B", out num)) Main.mouseColor.B = num; - currentValue3.Clear(); - Main.Configuration.Get>("MouseBorderColor", ref currentValue3); - if (currentValue3.TryGetValue("R", out num)) + currentValue2.Clear(); + Main.Configuration.Get>("MouseBorderColor", ref currentValue2); + if (currentValue2.TryGetValue("R", out num)) Main.MouseBorderColor.R = num; - if (currentValue3.TryGetValue("G", out num)) + if (currentValue2.TryGetValue("G", out num)) Main.MouseBorderColor.G = num; - if (currentValue3.TryGetValue("B", out num)) + if (currentValue2.TryGetValue("B", out num)) Main.MouseBorderColor.B = num; - if (currentValue3.TryGetValue("A", out num)) + if (currentValue2.TryGetValue("A", out num)) Main.MouseBorderColor.A = num; Main.Configuration.Get("QuickLaunch", ref Main.SkipAssemblyLoad); - if (!flag) - Main.GameZoomTarget = Main.Configuration.Get("Zoom", 1f); - if (!flag) - Main.UIScale = Main.Configuration.Get("UIScale", Platform.Get().GetScaling()); - if ((double) Main.newDefaultUIScale > 0.0) - { - Main.UIScale = Main.newDefaultUIScale; - Main.newDefaultUIScale = 0.0f; - } - Main.MapScale = MathHelper.Clamp(Main.Configuration.Get("MapScale", 1f), 0.5f, 1f); - int currentValue4 = -1; - Main.Configuration.Get("LockOnPriority", ref currentValue4); - if (currentValue4 < 0) - currentValue4 = 0; - if (currentValue4 > 2) - currentValue4 = 2; - LockOnHelper.UseMode = (LockOnHelper.LockOnMode) currentValue4; + Main.GameZoomTarget = Main.Configuration.Get("Zoom", 1f); + Main.UIScale = Main.Configuration.Get("UIScale", 1f); + int currentValue3 = -1; + Main.Configuration.Get("LockOnPriority", ref currentValue3); + if (currentValue3 < 0) + currentValue3 = 0; + if (currentValue3 > 2) + currentValue3 = 2; + LockOnHelper.UseMode = (LockOnHelper.LockOnMode) currentValue3; if (LockOnHelper.UseMode == LockOnHelper.LockOnMode.FocusTarget) LockOnHelper.UseMode = LockOnHelper.LockOnMode.ThreeDS; Main.Configuration.Get("InvisibleCursorForGamepad", ref Main.InvisibleCursorForGamepad); - GameNotificationType result3; - if (Enum.TryParse(Main.Configuration.Get("FlashIconForEvents", "All"), out result3)) - Main._flashNotificationType = result3; - if (!flag) - { - string screenDeviceName = Main.Configuration.Get("DisplayScreen", ""); - Main._windowMover.TryMovingToScreen(screenDeviceName); - this.InactiveSleepTime = TimeSpan.FromMilliseconds(Main.Configuration.Get("ThrottleWhenInactive", true) ? 20.0 : 0.0); - } Form form = (Form) Control.FromHandle(Main.instance.Window.Handle); if (Main.screenBorderless) - Main.SetBorderlessFormStyle(form); + { + form.Location = new System.Drawing.Point(0, 0); + form.FormBorderStyle = FormBorderStyle.None; + } else if (Main.screenMaximized) { form.WindowState = FormWindowState.Maximized; @@ -3187,21 +2769,17 @@ namespace Terraria } else form.FormBorderStyle = FormBorderStyle.Sizable; - Control.FromHandle(Main.instance.Window.Handle).BringToFront(); - if (!flag) - Main.Configuration.Get("Support4K", ref Main.Support4K); - Main.Configuration.Get("UseExperimentalFeatures", ref Main.UseExperimentalFeatures); + Main.SetDisplayMode(preferredBackBufferWidth, backBufferHeight, currentValue1); Main.Configuration.Get("SettingsUnlock_WorldEvil", ref Main.SettingsUnlock_WorldEvil); Main.Configuration.Get("SettingsEnabled_MinersWobble", ref Main.SettingsEnabled_MinersWobble); - Main.Configuration.Get("SettingBlockGamepadsEntirely", ref Main.SettingBlockGamepadsEntirely); - Main.Configuration.Get("SettingsEnabled_OpaqueBoxBehindTooltips", ref Main.SettingsEnabled_OpaqueBoxBehindTooltips); - Main.Configuration.Get("SettingsEnabled_TilesSwayInWind", ref Main.SettingsEnabled_TilesSwayInWind); - int preferenceSettings = (int) DoorOpeningHelper.PreferenceSettings; - Main.Configuration.Get("DoorAutoOpeningMode", ref preferenceSettings); - DoorOpeningHelper.PreferenceSettings = (DoorOpeningHelper.DoorAutoOpeningPreference) preferenceSettings; - if (currentValue1 <= 147) + int currentValue4 = 0; + Main.Configuration.Get("LastLaunchedVersion", ref currentValue4); + Main.Configuration.Get("RunningAchievementEnabled", ref Main.RunningAchievementEnabled); + if (currentValue4 <= 146) + Lighting.LightingThreads = 0; + if (currentValue4 <= 147) Main.terrariasFixedTiming = !Main.terrariasFixedTiming; - if (currentValue1 <= 162) + if (currentValue4 <= 162) { bool currentValue5 = false; uint currentValue6 = 0; @@ -3215,7 +2793,7 @@ namespace Terraria Main.mouseColor.B = Main.Configuration.Get("MouseColorB", Main.mouseColor.B); } } - if (currentValue1 <= 162) + if (currentValue4 <= 162) { Main.Configuration.Get("KeyUp", ref Main.cUp); Main.Configuration.Get("KeyDown", ref Main.cDown); @@ -3319,7 +2897,7 @@ namespace Terraria }; } PlayerInput.Load(); - if (currentValue1 < 165) + if (currentValue4 < 165) { try { @@ -3332,7 +2910,7 @@ namespace Terraria Main.mouseColorSlider.SetHSL(Main.mouseColor); Main.mouseBorderColorSlider.SetHSL(Main.MouseBorderColor); Main.mouseBorderColorSlider.Alpha = (float) Main.MouseBorderColor.A / (float) byte.MaxValue; - if (currentValue1 == 230) + if (currentValue4 == 194) return; Main.SaveSettings(); } @@ -3393,7 +2971,7 @@ namespace Terraria if (num1 >= 30) { Main.cTorch = binaryReader.ReadString(); - Lighting.Mode = (LightMode) binaryReader.ReadByte(); + Lighting.lightMode = (int) binaryReader.ReadByte(); Main.qaStyle = (int) binaryReader.ReadByte(); } if (num1 >= 37) @@ -3415,11 +2993,15 @@ namespace Terraria Main.cMapAlphaDown = binaryReader.ReadString(); } if (num1 >= 89) - binaryReader.ReadInt32(); + { + Lighting.LightingThreads = binaryReader.ReadInt32(); + if (Lighting.LightingThreads >= Environment.ProcessorCount) + Lighting.LightingThreads = Environment.ProcessorCount - 1; + } if (num1 >= 100) { Main.cSmart = binaryReader.ReadString(); - Main.cSmartCursorModeIsToggleAndNotHold = binaryReader.ReadBoolean(); + Main.cSmartCursorToggle = binaryReader.ReadBoolean(); } if (num1 >= 107) Main.invasionProgressMode = (int) binaryReader.ReadByte(); @@ -3451,7 +3033,7 @@ namespace Terraria try { string path = Main.PlayerList[i].Path.Substring(0, Main.PlayerList[i].Path.Length - 4); - if (path.Substring(path.Length - 1) != "." && path.Substring(path.Length - 1) != "\\" && Directory.Exists(path)) + if (Directory.Exists(path)) Directory.Delete(path, true); Main.LoadPlayers(); } @@ -3482,8 +3064,6 @@ namespace Terraria { char[] invalidFileNameChars = Path.GetInvalidFileNameChars(); string str1 = ""; - playerName = playerName.Replace(".", "_"); - playerName = playerName.Replace("*", "_"); for (int index = 0; index < playerName.Length; ++index) { char ch1 = playerName[index]; @@ -3540,22 +3120,21 @@ namespace Terraria char ch2 = !((IEnumerable) invalidFileNameChars).Contains(ch1) ? (ch1 != ' ' ? ch1 : '_') : '-'; str2 += ch2.ToString(); } - string str3 = str2.Replace(".", "_").Replace("*", "_"); - string str4 = cloudSave ? Main.CloudWorldPath : Main.WorldPath; - if (FileUtilities.GetFullPath(str4 + Path.DirectorySeparatorChar.ToString() + str3 + ".wld", cloudSave).StartsWith("\\\\.\\", StringComparison.Ordinal)) - str3 += "_"; - string str5 = str4; + string str3 = cloudSave ? Main.CloudWorldPath : Main.WorldPath; + if (FileUtilities.GetFullPath(str3 + Path.DirectorySeparatorChar.ToString() + str2 + ".wld", cloudSave).StartsWith("\\\\.\\", StringComparison.Ordinal)) + str2 += "_"; + string str4 = str3; char directorySeparatorChar = Path.DirectorySeparatorChar; - string str6 = directorySeparatorChar.ToString(); - string str7 = str3; - if (FileUtilities.Exists(str5 + str6 + str7 + ".wld", cloudSave)) + string str5 = directorySeparatorChar.ToString(); + string str6 = str2; + if (FileUtilities.Exists(str4 + str5 + str6 + ".wld", cloudSave)) { int num = 2; while (true) { object[] objArray = new object[5] { - (object) str4, + (object) str3, null, null, null, @@ -3563,7 +3142,7 @@ namespace Terraria }; directorySeparatorChar = Path.DirectorySeparatorChar; objArray[1] = (object) directorySeparatorChar.ToString(); - objArray[2] = (object) str3; + objArray[2] = (object) str2; objArray[3] = (object) num; objArray[4] = (object) ".wld"; if (FileUtilities.Exists(string.Concat(objArray), cloudSave)) @@ -3571,17 +3150,15 @@ namespace Terraria else break; } - str3 += (string) (object) num; + str2 += (string) (object) num; } - string str8 = str4; + string str7 = str3; directorySeparatorChar = Path.DirectorySeparatorChar; - string str9 = directorySeparatorChar.ToString(); - string str10 = str3; - return str8 + str9 + str10 + ".wld"; + string str8 = directorySeparatorChar.ToString(); + string str9 = str2; + return str7 + str8 + str9 + ".wld"; } - public void setServerWorldRollbacks(string rollBacksToKeep) => Main.WorldRollingBackupsCountToKeep = Convert.ToInt32(rollBacksToKeep); - public void autoCreate(string worldSize) { if (worldSize == "0") @@ -3610,66 +3187,47 @@ namespace Terraria public void NewMOTD(string newMOTD) => Main.motd = newMOTD; - public static string ConvertToSafeArgument(string arg) => Uri.EscapeDataString(arg); - - public static string ConvertFromSafeArgument(string arg) => Uri.UnescapeDataString(arg); - public void LoadDedConfig(string configPath) { if (!File.Exists(configPath)) return; using (StreamReader streamReader = new StreamReader(configPath)) { - string line; - while ((line = streamReader.ReadLine()) != null) + string str1; + while ((str1 = streamReader.ReadLine()) != null) { try { - if (line.Length > 6 && line.Substring(0, 6).ToLower() == "world=") + if (str1.Length > 6 && str1.Substring(0, 6).ToLower() == "world=") + Main.ActiveWorldFileData = WorldFile.GetAllMetadata(str1.Substring(6), false); + if (str1.Length > 5 && str1.Substring(0, 5).ToLower() == "port=") { - string str = line.Substring(6); - Main.autoGenFileLocation = str; - Main.ActiveWorldFileData = WorldFile.GetAllMetadata(Platform.Get().ExpandPathVariables(str), false); - } - if (line.Length > 5 && line.Substring(0, 5).ToLower() == "port=") - { - string str = line.Substring(5); + string str2 = str1.Substring(5); try { - Netplay.ListenPort = Convert.ToInt32(str); + Netplay.ListenPort = Convert.ToInt32(str2); } catch { } } - if (line.Length > 11 && line.Substring(0, 21).ToLower() == "worldrollbackstokeep=") + if (str1.Length > 11 && str1.Substring(0, 11).ToLower() == "maxplayers=") { - string str = line.Substring(21); + string str3 = str1.Substring(11); try { - Main.WorldRollingBackupsCountToKeep = Convert.ToInt32(str); + Main.maxNetPlayers = Convert.ToInt32(str3); } catch { } } - if (line.Length > 11 && line.Substring(0, 11).ToLower() == "maxplayers=") + if (str1.Length > 11 && str1.Substring(0, 9).ToLower() == "priority=" && !Program.LaunchParameters.ContainsKey("-forcepriority")) { - string str = line.Substring(11); + string str4 = str1.Substring(9); try { - Main.maxNetPlayers = Convert.ToInt32(str); - } - catch - { - } - } - if (line.Length > 11 && line.Substring(0, 9).ToLower() == "priority=" && !Program.LaunchParameters.ContainsKey("-forcepriority")) - { - string str = line.Substring(9); - try - { - int int32 = Convert.ToInt32(str); + int int32 = Convert.ToInt32(str4); switch (int32) { case 0: @@ -3716,89 +3274,78 @@ namespace Terraria { } } - if (line.Length > 9 && line.Substring(0, 9).ToLower() == "password=") - Netplay.ServerPassword = Main.ConvertFromSafeArgument(line.Substring(9)); - if (line.Length > 5 && line.Substring(0, 5).ToLower() == "motd=") - Main.motd = line.Substring(5); - if (line.Length > 5 && line.Substring(0, 5).ToLower() == "lang=") + if (str1.Length > 9 && str1.Substring(0, 9).ToLower() == "password=") + Netplay.ServerPassword = str1.Substring(9); + if (str1.Length > 5 && str1.Substring(0, 5).ToLower() == "motd=") + Main.motd = str1.Substring(5); + if (str1.Length > 5 && str1.Substring(0, 5).ToLower() == "lang=") { - string str = line.Substring(5); - LanguageManager.Instance.SetLanguage(Convert.ToInt32(str)); + string str5 = str1.Substring(5); + LanguageManager.Instance.SetLanguage(Convert.ToInt32(str5)); } - if (line.Length > 5 && line.Substring(0, 5).ToLower() == "language=") + if (str1.Length > 5 && str1.Substring(0, 5).ToLower() == "language=") { - string cultureName = line.Substring(9); + string cultureName = str1.Substring(9); LanguageManager.Instance.SetLanguage(cultureName); } - if (line.Length >= 10 && line.Substring(0, 10).ToLower() == "worldpath=") + if (str1.Length >= 10 && str1.Substring(0, 10).ToLower() == "worldpath=") + Main.WorldPath = str1.Substring(10); + if (str1.Length >= 10 && str1.Substring(0, 10).ToLower() == "worldname=") + Main.worldName = str1.Substring(10); + if (str1.Length >= 5 && str1.Substring(0, 5).ToLower() == "seed=") + Main.AutogenSeedName = str1.Substring(5); + if (str1.Length > 8 && str1.Substring(0, 8).ToLower() == "banlist=") + Netplay.BanFilePath = str1.Substring(8); + if (str1.Length > 11 && str1.Substring(0, 11).ToLower() == "difficulty=") { - string str = line.Substring(10); - Main.WorldPath = Platform.Get().ExpandPathVariables(str); + string str6 = str1.Substring(11); + if (str6 == "0") + Main.expertMode = false; + else if (str6 == "1") + Main.expertMode = true; } - if (line.Length >= 10 && line.Substring(0, 10).ToLower() == "worldname=") - Main.worldName = line.Substring(10); - if (line.Length >= 5 && line.Substring(0, 5).ToLower() == "seed=") - Main.AutogenSeedName = line.Substring(5); - if (line.Length > 8 && line.Substring(0, 8).ToLower() == "banlist=") + if (str1.Length > 11 && str1.Substring(0, 11).ToLower() == "autocreate=") { - string str = line.Substring(8); - Netplay.BanFilePath = Platform.Get().ExpandPathVariables(str); - } - if (line.Length > 11 && line.Substring(0, 11).ToLower() == "difficulty=") - { - string str = line.Substring(11); - if (str == "0") - Main.GameMode = 0; - else if (str == "1") - Main.GameMode = 1; - else if (str == "2") - Main.GameMode = 2; - else if (str == "3") - Main.GameMode = 3; - } - if (line.Length > 11 && line.Substring(0, 11).ToLower() == "autocreate=") - { - string str = line.Substring(11); - if (str == "0") + string str7 = str1.Substring(11); + if (str7 == "0") Main.autoGen = false; - else if (str == "1") + else if (str7 == "1") { Main.maxTilesX = 4200; Main.maxTilesY = 1200; Main.autoGen = true; } - else if (str == "2") + else if (str7 == "2") { Main.maxTilesX = 6300; Main.maxTilesY = 1800; Main.autoGen = true; } - else if (str == "3") + else if (str7 == "3") { Main.maxTilesX = 8400; Main.maxTilesY = 2400; Main.autoGen = true; } } - if (line.Length > 7 && line.Substring(0, 7).ToLower() == "secure=" && line.Substring(7) == "1") - Netplay.SpamCheck = true; - if (line.Length > 5 && line.Substring(0, 5).ToLower() == "upnp=" && line.Substring(5) != "1") + if (str1.Length > 7 && str1.Substring(0, 7).ToLower() == "secure=" && str1.Substring(7) == "1") + Netplay.spamCheck = true; + if (str1.Length > 5 && str1.Substring(0, 5).ToLower() == "upnp=" && str1.Substring(5) != "1") Netplay.UseUPNP = false; - string str1 = "slowliquids="; - if (line.Length > str1.Length && line.Substring(0, str1.Length).ToLower() == str1 && line.Substring(str1.Length) == "1") - Main.Setting_UseReducedMaxLiquids = true; - if (line.Length > 10 && line.Substring(0, 10).ToLower() == "npcstream=") + if (str1.Length > 10) { - string str2 = line.Substring(10); - try - { - Main.npcStreamSpeed = Convert.ToInt32(str2); - } - catch + if (str1.Substring(0, 10).ToLower() == "npcstream=") { + string str8 = str1.Substring(10); + try + { + Main.npcStreamSpeed = Convert.ToInt32(str8); + } + catch + { + } } } - CreativePowerManager.TryListingPermissionsFrom(line); } catch { @@ -3835,7 +3382,6 @@ namespace Terraria { Main.menuMultiplayer = true; Main.menuServer = true; - Main.ClearPendingPlayerSelectCallbacks(); Main.menuMode = 1; } @@ -3845,18 +3391,8 @@ namespace Terraria Main.LoadLibrary(Main.libPath); } - public void NeverSleep() => this.previousExecutionState = Main.NativeMethods.SetThreadExecutionState(2147483649U); - - public void YouCanSleepNow() - { - if (this.previousExecutionState == 0U) - return; - int num = (int) Main.NativeMethods.SetThreadExecutionState(this.previousExecutionState); - } - public void DedServ() { - this.NeverSleep(); Main.rand = new UnifiedRandom(); if (Main.autoShutdown) { @@ -3871,9 +3407,9 @@ namespace Terraria Main.dedServ = true; Main.showSplash = false; this.Initialize(); -label_126: +label_125: if (Main.worldPathName != null) - goto label_127; + goto label_126; label_5: bool flag1 = true; while (flag1) @@ -3885,7 +3421,7 @@ label_5: Console.WriteLine((index + 1).ToString() + "\t\t" + Main.WorldList[index].Name); string textValue1 = Language.GetTextValue("CLI.NewWorld_Command"); string textValue2 = Language.GetTextValue("CLI.DeleteWorld_Example"); - int num1 = (Math.Max(Main.newWorldName.Length, textValue2.Length) + 1) / 8 + 1; + int num1 = (Math.Max(Main.newWorldName.Length, textValue2.Length) + 1) / 8; string str1 = textValue1 + new string('\t', num1 - textValue1.Length / 8) + Language.GetTextValue("CLI.NewWorld_Description"); string str2 = textValue2 + new string('\t', num1 - textValue2.Length / 8) + Language.GetTextValue("CLI.DeleteWorld_Description"); Console.WriteLine(str1); @@ -3911,7 +3447,7 @@ label_5: Console.WriteLine(Language.GetTextValue("CLI.Server", (object) Main.versionNumber2)); Console.WriteLine(""); Console.WriteLine(Language.GetTextValue("CLI.DeleteConfirmation", (object) Main.WorldList[num2].Name)); - Console.Write("({0}/{1}): ", (object) Language.GetTextValue("CLI.ShortYes"), (object) Language.GetTextValue("CLI.ShortNo")); + Console.Write(string.Format("({0}/{1}): ", (object) Language.GetTextValue("CLI.ShortYes"), (object) Language.GetTextValue("CLI.ShortNo"))); if (Console.ReadLine().ToLower() == Language.GetTextValue("CLI.ShortYes").ToLower()) Main.EraseWorld(num2); } @@ -3950,7 +3486,7 @@ label_5: try { if (str4 == "") - str4 = "16"; + str4 = "8"; int int32 = Convert.ToInt32(str4); if (int32 <= (int) byte.MaxValue && int32 >= 1) { @@ -4018,7 +3554,7 @@ label_5: if (!(str6.ToLower() == Language.GetTextValue("CLI.ShortNo").ToLower())) { if (!(str6.ToLower() == Language.GetTextValue("CLI.No").ToLower())) - goto label_117; + goto label_115; } Netplay.UseUPNP = false; flag4 = false; @@ -4027,7 +3563,7 @@ label_5: catch { } -label_117: +label_115: try { Console.Clear(); @@ -4114,8 +3650,6 @@ label_117: Console.WriteLine(""); Console.WriteLine("1\t" + Language.GetTextValue("UI.Normal")); Console.WriteLine("2\t" + Language.GetTextValue("UI.Expert")); - Console.WriteLine("3\t" + Language.GetTextValue("UI.Master")); - Console.WriteLine("4\t" + Language.GetTextValue("UI.Creative")); Console.WriteLine(""); Console.Write(Language.GetTextValue("CLI.ChooseDifficulty")); string str8 = Console.ReadLine(); @@ -4124,19 +3658,11 @@ label_117: switch (Convert.ToInt32(str8)) { case 1: - Main.GameMode = 0; + Main.expertMode = false; flag6 = false; break; case 2: - Main.GameMode = 1; - flag6 = false; - break; - case 3: - Main.GameMode = 2; - flag6 = false; - break; - case 4: - Main.GameMode = 3; + Main.expertMode = true; flag6 = false; break; } @@ -4213,7 +3739,7 @@ label_117: } } string str10 = ""; - bool flag9 = true; + bool flag9 = Main.UseSeedUI; while (flag9) { Console.WriteLine(Language.GetTextValue("CLI.Server", (object) Main.versionNumber2)); @@ -4233,18 +3759,19 @@ label_117: } } Main.worldName = Main.newWorldName; - Main.ActiveWorldFileData = WorldFile.CreateMetadata(Main.worldName, SocialAPI.Cloud != null && SocialAPI.Cloud.EnabledByDefault, Main.GameMode); + Main.ActiveWorldFileData = WorldFile.CreateMetadata(Main.worldName, SocialAPI.Cloud != null && SocialAPI.Cloud.EnabledByDefault, Main.expertMode); string seedText = str10.Trim(); if (seedText.Length == 0) Main.ActiveWorldFileData.SetSeedToRandom(); else Main.ActiveWorldFileData.SetSeed(seedText); Main.menuMode = 10; + Main.serverGenLock = true; GenerationProgress progress = new GenerationProgress(); - Task newWorld = WorldGen.CreateNewWorld(progress); + WorldGen.CreateNewWorld(progress); while (Main.menuMode == 10) { - if (Main.oldStatusText != Main.statusText && !WorldGen.drunkWorldGen) + if (Main.oldStatusText != Main.statusText) { Main.oldStatusText = Main.statusText; Console.WriteLine(Main.statusText); @@ -4257,7 +3784,7 @@ label_117: catch { } - while (!newWorld.IsCompleted) + while (Main.serverGenLock) { Main.statusText = string.Format("{0:0.0%} - " + progress.Message + " - {1:0.0%}", (object) progress.TotalProgress, (object) progress.Value); if (Main.oldStatusText != Main.statusText) @@ -4268,8 +3795,8 @@ label_117: } } } - goto label_126; -label_127: + goto label_125; +label_126: if (!(Main.worldPathName == "")) { try @@ -4279,116 +3806,87 @@ label_127: catch { } - Task task = WorldGen.serverLoadWorld(); + WorldGen.serverLoadWorld(); Console.WriteLine(Language.GetTextValue("CLI.Server", (object) Main.versionNumber)); Console.WriteLine(""); - while (!task.IsCompleted) + while (!Netplay.IsServerRunning) { - if (WorldFile.LastThrownLoadException == null) + if ((double) Main.AutogenProgress.TotalProgress != 0.0) + Main.statusText = string.Format("{0:0.0%} - " + Main.AutogenProgress.Message + " - {1:0.0%}", (object) Main.AutogenProgress.TotalProgress, (object) Main.AutogenProgress.Value); + if (Main.oldStatusText != Main.statusText) { - if ((double) Main.AutogenProgress.TotalProgress != 0.0) - Main.statusText = string.Format("{0:0.0%} - " + Main.AutogenProgress.Message + " - {1:0.0%}", (object) Main.AutogenProgress.TotalProgress, (object) Main.AutogenProgress.Value); + Main.oldStatusText = Main.statusText; + Console.WriteLine(Main.statusText); + } + } + try + { + Console.Clear(); + } + catch + { + } + Console.WriteLine(Language.GetTextValue("CLI.Server", (object) Main.versionNumber)); + Console.WriteLine(""); + Console.WriteLine(Language.GetTextValue("CLI.ListeningOnPort", (object) Netplay.ListenPort)); + Console.WriteLine(Language.GetTextValue("CLI.HelpHint")); + Console.WriteLine(""); + Console.Title = "Terraria Server: " + Main.worldName; + Stopwatch stopwatch = new Stopwatch(); + if (!Main.autoShutdown) + Main.startDedInput(); + stopwatch.Start(); + double num3 = 50.0 / 3.0; + double num4 = 0.0; + int num5 = 0; + new Stopwatch().Start(); + while (!Netplay.disconnect) + { + TimeSpan elapsed = stopwatch.Elapsed; + double totalMilliseconds = elapsed.TotalMilliseconds; + if (totalMilliseconds + num4 >= num3) + { + ++num5; + num4 += totalMilliseconds - num3; + stopwatch.Reset(); + stopwatch.Start(); if (Main.oldStatusText != Main.statusText) { Main.oldStatusText = Main.statusText; Console.WriteLine(Main.statusText); } - } - } - try - { - if (WorldFile.LastThrownLoadException == null) - Console.Clear(); - } - catch - { - } - if (WorldGen.loadFailed || !WorldGen.loadSuccess) - { - Main.WriteFancyWorldLoadErrorToConsole(); - if (!Main.autoShutdown) - Console.ReadKey(); - this.YouCanSleepNow(); - } - else - { - Console.WriteLine(Language.GetTextValue("CLI.Server", (object) Main.versionNumber)); - Console.WriteLine(""); - Console.WriteLine(Language.GetTextValue("CLI.ListeningOnPort", (object) Netplay.ListenPort)); - Console.WriteLine(Language.GetTextValue("CLI.HelpHint")); - Console.WriteLine(""); - Console.Title = "Terraria Server: " + Main.worldName; - Stopwatch stopwatch = new Stopwatch(); - if (!Main.autoShutdown) - Main.startDedInput(); - stopwatch.Start(); - double num3 = 50.0 / 3.0; - double num4 = 0.0; - int num5 = 0; - new Stopwatch().Start(); - Netplay.StartServer(); - Main.gameMenu = false; - while (!Netplay.Disconnect) - { - TimeSpan elapsed = stopwatch.Elapsed; - double totalMilliseconds = elapsed.TotalMilliseconds; - if (totalMilliseconds + num4 >= num3) + if (Netplay.anyClients) + this.Update(new GameTime()); + if (Main.OnTick != null) + Main.OnTick(); + elapsed = stopwatch.Elapsed; + double num6 = elapsed.TotalMilliseconds + num4; + if (num6 < num3) { - ++num5; - num4 += totalMilliseconds - num3; - stopwatch.Reset(); - stopwatch.Start(); - if (Main.oldStatusText != Main.statusText) + int num7 = (int) (num3 - num6) - 1; + if (num7 > 1) { - Main.oldStatusText = Main.statusText; - Console.WriteLine(Main.statusText); - } - if (Netplay.HasClients) - this.Update(new GameTime()); - else if (Main.saveTime.IsRunning) - Main.saveTime.Stop(); - if (Main.OnTickForThirdPartySoftwareOnly != null) - Main.OnTickForThirdPartySoftwareOnly(); - elapsed = stopwatch.Elapsed; - double num6 = elapsed.TotalMilliseconds + num4; - if (num6 < num3) - { - int num7 = (int) (num3 - num6) - 1; - if (num7 > 1) + Thread.Sleep(num7 - 1); + if (!Netplay.anyClients) { - Thread.Sleep(num7 - 1); - if (!Netplay.HasClients) - { - num4 = 0.0; - Thread.Sleep(10); - } + num4 = 0.0; + Thread.Sleep(10); } } } - Thread.Sleep(0); } - this.YouCanSleepNow(); + Thread.Sleep(0); } } else goto label_5; } - private static void WriteFancyWorldLoadErrorToConsole() - { - Console.WriteLine(); - Console.WriteLine(WorldFile.LastThrownLoadException.ToString()); - } + public static void startDedInput() => ThreadPool.QueueUserWorkItem(new WaitCallback(Main.startDedInputCallBack), (object) 1); - public static void startDedInput() => new Thread(new ThreadStart(Main.startDedInputCallBack)) + public static void startDedInputCallBack(object threadContext) { - IsBackground = true, - Name = "Server Input Thread" - }.Start(); - - public static void startDedInputCallBack() - { - while (!Netplay.Disconnect) + while (!Netplay.disconnect) { Console.Write(": "); string str1 = Console.ReadLine(); @@ -4423,9 +3921,10 @@ label_127: "Noon", "Dusk", "Midnight", - "Settle", - "Seed" + "Settle" }; + if (Main.UseSeedUI) + stringList.Add("Seed"); int num1 = 0; for (int index = 0; index < stringList.Count; ++index) { @@ -4472,11 +3971,11 @@ label_127: NetMessage.SendData(7); } else if (lower1 == Language.GetTextValue("CLI.ExitNoSave_Command")) - Netplay.Disconnect = true; + Netplay.disconnect = true; else if (lower1 == Language.GetTextValue("CLI.Exit_Command")) { - WorldFile.SaveWorld(); - Netplay.Disconnect = true; + WorldFile.saveWorld(); + Netplay.disconnect = true; SocialAPI.Shutdown(); } else if (lower1 == Language.GetTextValue("CLI.FPS_Command")) @@ -4494,10 +3993,10 @@ label_127: } } else if (lower1 == Language.GetTextValue("CLI.Save_Command")) - WorldFile.SaveWorld(); + WorldFile.saveWorld(); else if (lower1 == Language.GetTextValue("CLI.Time_Command")) { - string textValue = Language.GetTextValue("GameUI.TimeAtMorning"); + string str5 = "AM"; double time = Main.time; if (!Main.dayTime) time += 54000.0; @@ -4505,17 +4004,17 @@ label_127: if (num3 < 0.0) num3 += 24.0; if (num3 >= 12.0) - textValue = Language.GetTextValue("GameUI.TimePastMorning"); + str5 = "PM"; int num4 = (int) num3; double num5 = (double) (int) ((num3 - (double) num4) * 60.0); - string str5 = string.Concat((object) num5); + string str6 = string.Concat((object) num5); if (num5 < 10.0) - str5 = "0" + str5; + str6 = "0" + str6; if (num4 > 12) num4 -= 12; if (num4 == 0) num4 = 12; - Console.WriteLine(Language.GetTextValue("CLI.Time", (object) (num4.ToString() + ":" + str5 + " " + textValue))); + Console.WriteLine(Language.GetTextValue("CLI.Time", (object) (num4.ToString() + ":" + str6 + " " + str5))); } else if (lower1 == Language.GetTextValue("CLI.MaxPlayers_Command")) Console.WriteLine(Language.GetTextValue("CLI.PlayerLimit", (object) Main.maxNetPlayers)); @@ -4577,15 +4076,15 @@ label_127: } else if (lower1.StartsWith(Language.GetTextValue("CLI.SetPassword_Command") + " ")) { - string str6 = str2.Substring(Language.GetTextValue("CLI.SetPassword_Command").Length + 1); - if (str6 == "") + string str7 = str2.Substring(Language.GetTextValue("CLI.SetPassword_Command").Length + 1); + if (str7 == "") { Netplay.ServerPassword = ""; Console.WriteLine(Language.GetTextValue("CLI.PasswordDisabled")); } else { - Netplay.ServerPassword = str6; + Netplay.ServerPassword = str7; Console.WriteLine(Language.GetTextValue("CLI.PasswordSet", (object) Netplay.ServerPassword)); } } @@ -4600,9 +4099,9 @@ label_127: } else { - string str7 = str2.Substring(length + 1); - Console.WriteLine(Language.GetTextValue("CLI.ServerMessage", (object) str7)); - ChatHelper.BroadcastChatMessage(NetworkText.FromKey("CLI.ServerMessage", (object) str7), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, 240, 20)); + string str8 = str2.Substring(length + 1); + Console.WriteLine(Language.GetTextValue("CLI.ServerMessage", (object) str8)); + NetMessage.BroadcastChatMessage(NetworkText.FromKey("CLI.ServerMessage", (object) str8), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, 240, 20)); } } else if (lower1 == Language.GetTextValue("CLI.Kick_Command")) @@ -4629,7 +4128,7 @@ label_127: if (Main.ActiveWorldFileData == null || !Main.ActiveWorldFileData.HasValidSeed) Console.WriteLine(Language.GetTextValue("CLI.NoValidSeed")); else - Console.WriteLine(Language.GetTextValue("CLI.DisplaySeed", (object) Main.ActiveWorldFileData.GetFullSeedText())); + Console.WriteLine(Language.GetTextValue("CLI.DisplaySeed", (object) Main.ActiveWorldFileData.SeedText)); } else if (lower1 == Language.GetTextValue("CLI.Ban_Command")) Console.WriteLine(Language.GetTextValue("CLI.Ban_Usage")); @@ -4680,95 +4179,1276 @@ label_127: } } - public static void UpdateTimeRate() + public static void UpdateSundial() { if (Main.fastForwardTime) - { Main.dayRate = 60; - Main.desiredWorldTilesUpdateRate = 1; - } else - { - int num1 = CreativePowerManager.Instance.GetPower().Enabled ? 1 : 0; - int targetTimeRate = CreativePowerManager.Instance.GetPower().TargetTimeRate; - bool flag = Main.CurrentFrameFlags.SleepingPlayersCount == Main.CurrentFrameFlags.ActivePlayersCount && Main.CurrentFrameFlags.SleepingPlayersCount > 0; - int num2 = targetTimeRate; - if (!Main.gameMenu & flag) - num2 *= 5; - if (num1 != 0) - num2 = 0; - Main.dayRate = num2; - Main.desiredWorldTilesUpdateRate = num2; - } + Main.dayRate = 1; } public Main() { Main.instance = this; - Main.UnpausedUpdateSeed = (ulong) Guid.NewGuid().GetHashCode(); - Main.Configuration.Load(); - Main.graphics = new GraphicsDeviceManager(this as Game); + Main.graphics = new GraphicsDeviceManager((Game) this); this.Content.RootDirectory = "Content"; } - private static void SetDisplayMonitor() - { - Main.Configuration.Get("Display", ""); - Main.graphics.PreparingDeviceSettings += new EventHandler(Main.SetMonitorOnce); - } - - private static void SetMonitorOnce(object sender, PreparingDeviceSettingsEventArgs e) - { - string displayName = Main.Configuration.Get("Display", ""); - GraphicsAdapter graphicsAdapter = GraphicsAdapter.Adapters.Where((Func) (adapter => adapter.DeviceName == displayName)).FirstOrDefault(); - if (graphicsAdapter != null) - e.GraphicsDeviceInformation.Adapter = graphicsAdapter; - Main.graphics.PreparingDeviceSettings -= new EventHandler(Main.SetMonitorOnce); - } - protected void SetTitle() { - this._cachedTitle = Lang.GetRandomGameTitle(); - Platform.Get().SetUnicodeTitle(this.Window, this._cachedTitle); + Main._cachedTitle = Lang.GetRandomGameTitle(); + ((Platform) Platform.Current).SetWindowUnicodeTitle(this.Window, Main._cachedTitle); + } + + public static void InitLifeBytes() + { + NPC npc = new NPC(); + for (int index = -65; index < 580; ++index) + { + if (index != 0) + { + npc.SetDefaults(index); + Main.npcLifeBytes[index] = npc.lifeMax > (int) short.MaxValue || npc.boss ? (byte) 4 : (npc.lifeMax <= (int) sbyte.MaxValue ? (byte) 1 : (byte) 2); + } + } } private static void SetTileValue() { - Main.tileOreFinderPriority[28] = (short) 100; - Main.tileOreFinderPriority[407] = (short) 150; - Main.tileOreFinderPriority[404] = (short) 150; - Main.tileOreFinderPriority[7] = (short) 200; - Main.tileOreFinderPriority[166] = (short) 210; - Main.tileOreFinderPriority[6] = (short) 220; - Main.tileOreFinderPriority[167] = (short) 230; - Main.tileOreFinderPriority[9] = (short) 240; - Main.tileOreFinderPriority[168] = (short) 250; - Main.tileOreFinderPriority[8] = (short) 260; - Main.tileOreFinderPriority[169] = (short) 270; - Main.tileOreFinderPriority[22] = (short) 300; - Main.tileOreFinderPriority[204] = (short) 310; - Main.tileOreFinderPriority[37] = (short) 400; - Main.tileOreFinderPriority[21] = (short) 500; - Main.tileOreFinderPriority[467] = (short) 500; - Main.tileOreFinderPriority[441] = (short) 500; - Main.tileOreFinderPriority[468] = (short) 500; - Main.tileOreFinderPriority[107] = (short) 600; - Main.tileOreFinderPriority[221] = (short) 610; - Main.tileOreFinderPriority[108] = (short) 620; - Main.tileOreFinderPriority[222] = (short) 630; - Main.tileOreFinderPriority[111] = (short) 640; - Main.tileOreFinderPriority[223] = (short) 650; - Main.tileOreFinderPriority[211] = (short) 700; - Main.tileOreFinderPriority[227] = (short) 750; - Main.tileOreFinderPriority[12] = (short) 800; - Main.tileOreFinderPriority[236] = (short) 810; + Main.tileValue[28] = (short) 100; + Main.tileValue[7] = (short) 200; + Main.tileValue[166] = (short) 210; + Main.tileValue[6] = (short) 220; + Main.tileValue[167] = (short) 230; + Main.tileValue[9] = (short) 240; + Main.tileValue[168] = (short) 250; + Main.tileValue[37] = (short) 300; + Main.tileValue[22] = (short) 310; + Main.tileValue[204] = (short) 320; + Main.tileValue[407] = (short) 350; + Main.tileValue[8] = (short) 400; + Main.tileValue[169] = (short) 410; + Main.tileValue[21] = (short) 500; + Main.tileValue[467] = (short) 500; + Main.tileValue[441] = (short) 500; + Main.tileValue[468] = (short) 500; + Main.tileValue[107] = (short) 600; + Main.tileValue[221] = (short) 610; + Main.tileValue[108] = (short) 620; + Main.tileValue[222] = (short) 630; + Main.tileValue[111] = (short) 640; + Main.tileValue[223] = (short) 650; + Main.tileValue[211] = (short) 700; + Main.tileValue[12] = (short) 800; + Main.tileValue[236] = (short) 810; } private static void ResetGameCounter() => Main._gameUpdateCount = 0U; protected override void Initialize() { - Main.musicFade[50] = 1f; + Main.LocalFavoriteData.Load(); + Main.CloudFavoritesData.Load(); + Main.FindAnnouncementBoxStatus(); + PlayerInput.Initialize(); + CustomCurrencyManager.Initialize(); + TileObjectData.Initialize(); + Animation.Initialize(); + Chest.Initialize(); + Wiring.Initialize(); + Framing.Initialize(); + ItemRarity.Initialize(); + TileEntity.InitializeAll(); + Projectile.InitializeStaticThings(); + Main.InitializeItemAnimations(); + Lighting.Initialize(); + MapHelper.Initialize(); + TimeLogger.Initialize(); + WorldGen.RandomizeBackgrounds(); + WorldGen.RandomizeCaveBackgrounds(); + WorldGen.RandomizeMoonState(); + WorldGen.Hooks.Initialize(); + WorldGen.Hooks.OnWorldLoad += new Action(Main.ResetGameCounter); + Main.bgAlpha[0] = 1f; + Main.bgAlpha2[0] = 1f; + this.invBottom = 258; + for (int index = 0; index < 714; ++index) + Main.projFrames[index] = 1; + Main.projFrames[706] = 8; + Main.projFrames[712] = 8; + Main.projFrames[663] = 7; + Main.projFrames[665] = 9; + Main.projFrames[667] = 9; + Main.projFrames[677] = 6; + Main.projFrames[678] = 6; + Main.projFrames[679] = 6; + Main.projFrames[688] = 6; + Main.projFrames[689] = 6; + Main.projFrames[690] = 8; + Main.projFrames[691] = 4; + Main.projFrames[692] = 4; + Main.projFrames[693] = 4; + Main.projFrames[694] = 4; + Main.projFrames[695] = 4; + Main.projFrames[696] = 5; + Main.projFrames[700] = 4; + Main.projFrames[643] = 8; + Main.projFrames[566] = 4; + Main.projFrames[565] = 4; + Main.projFrames[525] = 5; + Main.projFrames[519] = 4; + Main.projFrames[509] = 2; + Main.projFrames[485] = 5; + Main.projFrames[492] = 8; + Main.projFrames[500] = 4; + Main.projFrames[499] = 12; + Main.projFrames[518] = 4; + Main.projFrames[585] = 4; + Main.projFrames[593] = 4; + Main.projFrames[595] = 28; + Main.projFrames[596] = 4; + Main.projFrames[612] = 5; + Main.projFrames[613] = 4; + Main.projFrames[614] = 4; + Main.projFrames[615] = 7; + Main.projFrames[623] = 12; + Main.projFrames[633] = 5; + Main.projFrames[645] = 7; + Main.projFrames[650] = 4; + Main.projFrames[652] = 6; + Main.projFrames[659] = 4; + Main.projFrames[384] = 6; + Main.projFrames[385] = 3; + Main.projFrames[386] = 6; + Main.projFrames[390] = 11; + Main.projFrames[391] = 11; + Main.projFrames[392] = 11; + Main.projFrames[393] = 15; + Main.projFrames[394] = 15; + Main.projFrames[395] = 15; + Main.projFrames[398] = 10; + Main.projFrames[407] = 6; + Main.projFrames[408] = 2; + Main.projFrames[409] = 3; + Main.projFrames[387] = 3; + Main.projFrames[388] = 3; + Main.projFrames[334] = 11; + Main.projFrames[324] = 10; + Main.projFrames[351] = 2; + Main.projFrames[349] = 5; + Main.projFrames[423] = 4; + Main.projFrames[435] = 4; + Main.projFrames[682] = 4; + Main.projFrames[436] = 4; + Main.projFrames[439] = 6; + Main.projFrames[443] = 4; + Main.projFrames[447] = 4; + Main.projFrames[448] = 3; + Main.projFrames[450] = 5; + Main.projFrames[454] = 2; + Main.projFrames[456] = 4; + Main.projFrames[459] = 3; + Main.projFrames[462] = 5; + Main.projFrames[465] = 4; + Main.projFrames[467] = 4; + Main.projFrames[468] = 4; + Main.projFrames[533] = 21; + Main.projFrames[535] = 12; + Main.projFrames[539] = 4; + Main.projFrames[575] = 4; + Main.projFrames[574] = 2; + Main.projFrames[634] = 4; + Main.projFrames[635] = 4; + Main.projFrames[709] = 3; + Main.projFrames[353] = 14; + Main.projFrames[346] = 2; + Main.projFrames[347] = 2; + Main.projFrames[335] = 4; + Main.projFrames[344] = 3; + Main.projFrames[337] = 5; + Main.projFrames[317] = 8; + Main.projFrames[321] = 3; + Main.projFrames[308] = 10; + Main.projFrames[316] = 4; + Main.projFrames[275] = 2; + Main.projFrames[276] = 2; + Main.projFrames[254] = 5; + Main.projFrames[307] = 2; + Main.projFrames[72] = 4; + Main.projFrames[86] = 4; + Main.projFrames[87] = 4; + Main.projFrames[102] = 2; + Main.projFrames[111] = 8; + Main.projFrames[112] = 3; + Main.projFrames[(int) sbyte.MaxValue] = 16; + Main.projFrames[175] = 2; + Main.projFrames[181] = 4; + Main.projFrames[189] = 4; + Main.projFrames[191] = 18; + Main.projFrames[192] = 18; + Main.projFrames[193] = 18; + Main.projFrames[194] = 18; + Main.projFrames[190] = 4; + Main.projFrames[198] = 4; + Main.projFrames[199] = 8; + Main.projFrames[200] = 10; + Main.projFrames[206] = 5; + Main.projFrames[208] = 5; + Main.projFrames[209] = 12; + Main.projFrames[210] = 12; + Main.projFrames[211] = 10; + Main.projFrames[221] = 3; + Main.projFrames[237] = 4; + Main.projFrames[238] = 6; + Main.projFrames[221] = 3; + Main.projFrames[228] = 5; + Main.projFrames[229] = 4; + Main.projFrames[236] = 13; + Main.projFrames[243] = 4; + Main.projFrames[244] = 6; + Main.projFrames[249] = 5; + Main.projFrames[252] = 4; + Main.projFrames[266] = 6; + Main.projFrames[268] = 8; + Main.projFrames[269] = 7; + Main.projFrames[270] = 3; + Main.projFrames[313] = 12; + Main.projFrames[314] = 13; + Main.projFrames[319] = 11; + Main.projFrames[373] = 3; + Main.projFrames[375] = 8; + Main.projFrames[377] = 9; + Main.projFrames[379] = 4; + Main.projFrames[380] = 4; + Main.projFrames[601] = 2; + Main.projFrames[602] = 4; + Main.projFrames[703] = 8; + Main.projFrames[701] = 3; + Main.projFrames[702] = 4; + Main.projPet[492] = true; + Main.projPet[499] = true; + Main.projPet[653] = true; + Main.projPet[701] = true; + Main.projPet[703] = true; + Main.projPet[702] = true; + Main.projPet[319] = true; + Main.projPet[334] = true; + Main.projPet[324] = true; + Main.projPet[266] = true; + Main.projPet[313] = true; + Main.projPet[314] = true; + Main.projPet[317] = true; + Main.projPet[175] = true; + Main.projPet[111] = true; + Main.projPet[112] = true; + Main.projPet[(int) sbyte.MaxValue] = true; + Main.projPet[191] = true; + Main.projPet[192] = true; + Main.projPet[193] = true; + Main.projPet[194] = true; + Main.projPet[197] = true; + Main.projPet[198] = true; + Main.projPet[199] = true; + Main.projPet[200] = true; + Main.projPet[208] = true; + Main.projPet[209] = true; + Main.projPet[210] = true; + Main.projPet[211] = true; + Main.projPet[236] = true; + Main.projPet[268] = true; + Main.projPet[269] = true; + Main.projPet[353] = true; + Main.projPet[373] = true; + Main.projPet[375] = true; + Main.projPet[380] = true; + Main.projPet[387] = true; + Main.projPet[388] = true; + Main.projPet[390] = true; + Main.projPet[391] = true; + Main.projPet[392] = true; + Main.projPet[393] = true; + Main.projPet[394] = true; + Main.projPet[395] = true; + Main.projPet[398] = true; + Main.projPet[407] = true; + Main.projPet[423] = true; + Main.projPet[533] = true; + Main.projPet[613] = true; + Main.projPet[623] = true; + Main.projPet[625] = true; + Main.projPet[626] = true; + Main.projPet[627] = true; + Main.projPet[628] = true; + Main.tileLighted[237] = true; + Main.tileLighted[27] = true; + Main.tileLighted[381] = true; + Main.tileLighted[184] = true; + Main.tileLighted[463] = true; + Main.slimeRainNPC[1] = true; + Main.debuff[158] = true; + Main.debuff[160] = true; + Main.debuff[20] = true; + Main.debuff[21] = true; + Main.debuff[22] = true; + Main.debuff[23] = true; + Main.debuff[24] = true; + Main.debuff[25] = true; + Main.debuff[28] = true; + Main.debuff[30] = true; + Main.debuff[31] = true; + Main.debuff[32] = true; + Main.debuff[33] = true; + Main.debuff[34] = true; + Main.debuff[35] = true; + Main.debuff[36] = true; + Main.debuff[37] = true; + Main.debuff[38] = true; + Main.debuff[39] = true; + Main.debuff[44] = true; + Main.debuff[46] = true; + Main.debuff[47] = true; + Main.debuff[67] = true; + Main.debuff[68] = true; + Main.debuff[69] = true; + Main.debuff[70] = true; + Main.debuff[80] = true; + Main.debuff[86] = true; + Main.debuff[87] = true; + Main.debuff[88] = true; + Main.debuff[89] = true; + Main.debuff[94] = true; + Main.debuff[103] = true; + Main.debuff[119] = true; + Main.debuff[120] = true; + Main.debuff[137] = true; + Main.debuff[145] = true; + Main.debuff[146] = true; + Main.debuff[147] = true; + Main.debuff[148] = true; + Main.debuff[149] = true; + Main.debuff[156] = true; + Main.debuff[157] = true; + Main.debuff[163] = true; + Main.debuff[164] = true; + Main.debuff[144] = true; + Main.debuff[194] = true; + Main.debuff[195] = true; + Main.debuff[196] = true; + Main.debuff[197] = true; + Main.debuff[199] = true; + Main.pvpBuff[20] = true; + Main.pvpBuff[24] = true; + Main.pvpBuff[31] = true; + Main.pvpBuff[39] = true; + Main.pvpBuff[44] = true; + Main.pvpBuff[20] = true; + Main.pvpBuff[69] = true; + Main.pvpBuff[103] = true; + Main.pvpBuff[119] = true; + Main.pvpBuff[120] = true; + Main.pvpBuff[137] = true; + Main.meleeBuff[71] = true; + Main.meleeBuff[73] = true; + Main.meleeBuff[74] = true; + Main.meleeBuff[75] = true; + Main.meleeBuff[76] = true; + Main.meleeBuff[77] = true; + Main.meleeBuff[78] = true; + Main.meleeBuff[79] = true; + Main.buffNoSave[20] = true; + Main.buffNoSave[22] = true; + Main.buffNoSave[23] = true; + Main.buffNoSave[24] = true; + Main.buffNoSave[28] = true; + Main.buffNoSave[30] = true; + Main.buffNoSave[31] = true; + Main.buffNoSave[34] = true; + Main.buffNoSave[35] = true; + Main.buffNoSave[37] = true; + Main.buffNoSave[38] = true; + Main.buffNoSave[39] = true; + Main.buffNoSave[43] = true; + Main.buffNoSave[44] = true; + Main.buffNoSave[46] = true; + Main.buffNoSave[47] = true; + Main.buffNoSave[48] = true; + Main.buffNoSave[58] = true; + Main.buffNoSave[59] = true; + Main.buffNoSave[60] = true; + Main.buffNoSave[62] = true; + Main.buffNoSave[63] = true; + Main.buffNoSave[64] = true; + Main.buffNoSave[67] = true; + Main.buffNoSave[68] = true; + Main.buffNoSave[69] = true; + Main.buffNoSave[70] = true; + Main.buffNoSave[72] = true; + Main.buffNoSave[80] = true; + Main.buffNoSave[87] = true; + Main.buffNoSave[158] = true; + Main.buffNoSave[146] = true; + Main.buffNoSave[147] = true; + Main.buffNoSave[88] = true; + Main.buffNoSave[89] = true; + Main.buffNoSave[94] = true; + Main.buffNoSave[95] = true; + Main.buffNoSave[96] = true; + Main.buffNoSave[97] = true; + Main.buffNoSave[98] = true; + Main.buffNoSave[99] = true; + Main.buffNoSave[100] = true; + Main.buffNoSave[103] = true; + Main.buffNoSave[118] = true; + Main.buffNoSave[138] = true; + Main.buffNoSave[167] = true; + Main.buffNoSave[166] = true; + Main.buffNoSave[184] = true; + Main.buffNoSave[185] = true; + Main.buffNoSave[119] = true; + Main.buffNoSave[120] = true; + Main.buffNoSave[90] = true; + Main.buffNoSave[125] = true; + Main.buffNoSave[126] = true; + Main.buffNoSave[128] = true; + Main.buffNoSave[129] = true; + Main.buffNoSave[130] = true; + Main.buffNoSave[131] = true; + Main.buffNoSave[132] = true; + Main.buffNoSave[133] = true; + Main.buffNoSave[134] = true; + Main.buffNoSave[135] = true; + Main.buffNoSave[139] = true; + Main.buffNoSave[140] = true; + Main.buffNoSave[141] = true; + Main.buffNoSave[142] = true; + Main.buffNoSave[143] = true; + Main.buffNoSave[137] = true; + Main.buffNoSave[144] = true; + Main.buffNoSave[161] = true; + Main.buffNoSave[162] = true; + Main.buffNoSave[163] = true; + Main.buffNoSave[164] = true; + Main.buffNoSave[168] = true; + Main.buffNoSave[170] = true; + Main.buffNoSave[171] = true; + Main.buffNoSave[172] = true; + Main.buffNoSave[182] = true; + Main.buffNoSave[187] = true; + Main.buffNoSave[188] = true; + Main.buffNoSave[193] = true; + Main.buffNoSave[194] = true; + Main.buffNoSave[195] = true; + Main.buffNoSave[196] = true; + Main.buffNoSave[197] = true; + Main.buffNoSave[198] = true; + Main.buffNoSave[199] = true; + Main.buffNoSave[205] = true; + for (int index = 173; index <= 181; ++index) + Main.buffNoSave[index] = true; + Main.buffNoTimeDisplay[19] = true; + Main.buffNoTimeDisplay[27] = true; + Main.buffNoTimeDisplay[28] = true; + Main.buffNoTimeDisplay[34] = true; + Main.buffNoTimeDisplay[37] = true; + Main.buffNoTimeDisplay[38] = true; + Main.buffNoTimeDisplay[40] = true; + Main.buffNoTimeDisplay[41] = true; + Main.buffNoTimeDisplay[42] = true; + Main.buffNoTimeDisplay[43] = true; + Main.buffNoTimeDisplay[45] = true; + Main.buffNoTimeDisplay[49] = true; + Main.buffNoTimeDisplay[60] = true; + Main.buffNoTimeDisplay[62] = true; + Main.buffNoTimeDisplay[64] = true; + Main.buffNoTimeDisplay[68] = true; + Main.buffNoTimeDisplay[81] = true; + Main.buffNoTimeDisplay[82] = true; + Main.buffNoTimeDisplay[83] = true; + Main.buffNoTimeDisplay[90] = true; + Main.buffNoTimeDisplay[95] = true; + Main.buffNoTimeDisplay[96] = true; + Main.buffNoTimeDisplay[97] = true; + Main.buffNoTimeDisplay[98] = true; + Main.buffNoTimeDisplay[99] = true; + Main.buffNoTimeDisplay[100] = true; + Main.buffNoTimeDisplay[101] = true; + Main.buffNoTimeDisplay[102] = true; + Main.buffNoTimeDisplay[118] = true; + Main.buffNoTimeDisplay[138] = true; + Main.buffNoTimeDisplay[167] = true; + Main.buffNoTimeDisplay[166] = true; + Main.buffNoTimeDisplay[184] = true; + Main.buffNoTimeDisplay[185] = true; + Main.buffNoTimeDisplay[125] = true; + Main.buffNoTimeDisplay[126] = true; + Main.buffNoTimeDisplay[128] = true; + Main.buffNoTimeDisplay[129] = true; + Main.buffNoTimeDisplay[130] = true; + Main.buffNoTimeDisplay[131] = true; + Main.buffNoTimeDisplay[132] = true; + Main.buffNoTimeDisplay[133] = true; + Main.buffNoTimeDisplay[134] = true; + Main.buffNoTimeDisplay[135] = true; + Main.buffNoTimeDisplay[136] = true; + Main.buffNoTimeDisplay[139] = true; + Main.buffNoTimeDisplay[140] = true; + Main.buffNoTimeDisplay[141] = true; + Main.buffNoTimeDisplay[142] = true; + Main.buffNoTimeDisplay[143] = true; + Main.buffNoTimeDisplay[137] = true; + Main.buffNoTimeDisplay[200] = true; + Main.buffNoTimeDisplay[202] = true; + Main.buffNoTimeDisplay[201] = true; + Main.buffNoTimeDisplay[161] = true; + Main.buffNoTimeDisplay[162] = true; + Main.buffNoTimeDisplay[163] = true; + Main.buffNoTimeDisplay[168] = true; + Main.buffNoTimeDisplay[170] = true; + Main.buffNoTimeDisplay[171] = true; + Main.buffNoTimeDisplay[172] = true; + Main.buffNoTimeDisplay[182] = true; + Main.buffNoTimeDisplay[165] = true; + Main.buffNoTimeDisplay[186] = true; + Main.buffNoTimeDisplay[187] = true; + Main.buffNoTimeDisplay[188] = true; + Main.buffNoTimeDisplay[193] = true; + Main.buffNoTimeDisplay[199] = true; + Main.persistentBuff[71] = true; + Main.persistentBuff[73] = true; + Main.persistentBuff[74] = true; + Main.persistentBuff[75] = true; + Main.persistentBuff[76] = true; + Main.persistentBuff[77] = true; + Main.persistentBuff[78] = true; + Main.persistentBuff[79] = true; + Main.vanityPet[40] = true; + Main.vanityPet[41] = true; + Main.vanityPet[42] = true; + Main.vanityPet[45] = true; + Main.vanityPet[50] = true; + Main.vanityPet[51] = true; + Main.vanityPet[52] = true; + Main.vanityPet[53] = true; + Main.vanityPet[54] = true; + Main.vanityPet[55] = true; + Main.vanityPet[56] = true; + Main.vanityPet[61] = true; + Main.vanityPet[154] = true; + Main.vanityPet[65] = true; + Main.vanityPet[66] = true; + Main.vanityPet[81] = true; + Main.vanityPet[82] = true; + Main.vanityPet[84] = true; + Main.vanityPet[85] = true; + Main.vanityPet[91] = true; + Main.vanityPet[92] = true; + Main.vanityPet[(int) sbyte.MaxValue] = true; + Main.vanityPet[136] = true; + Main.vanityPet[191] = true; + Main.vanityPet[202] = true; + Main.vanityPet[200] = true; + Main.lightPet[19] = true; + Main.lightPet[155] = true; + Main.lightPet[27] = true; + Main.lightPet[101] = true; + Main.lightPet[102] = true; + Main.lightPet[57] = true; + Main.lightPet[190] = true; + Main.lightPet[152] = true; + Main.lightPet[201] = true; + Main.tileFlame[4] = true; + Main.tileFlame[33] = true; + Main.tileFlame[34] = true; + Main.tileFlame[35] = true; + Main.tileFlame[42] = true; + Main.tileFlame[49] = true; + Main.tileFlame[93] = true; + Main.tileFlame[98] = true; + Main.tileFlame[100] = true; + Main.tileFlame[173] = true; + Main.tileFlame[174] = true; + Main.tileFlame[372] = true; + Main.tileRope[213] = true; + Main.tileRope[214] = true; + Main.tileRope[353] = true; + Main.tileRope[365] = true; + Main.tileRope[366] = true; + Main.tileRope[449] = true; + Main.tileRope[450] = true; + Main.tileRope[451] = true; + Main.tilePile[330] = true; + Main.tilePile[331] = true; + Main.tilePile[332] = true; + Main.tilePile[333] = true; + for (int index = 0; index < 580; ++index) + Main.npcCatchable[index] = false; + Main.npcCatchable[46] = true; + Main.npcCatchable[55] = true; + Main.npcCatchable[74] = true; + Main.npcCatchable[148] = true; + Main.npcCatchable[149] = true; + Main.npcCatchable[297] = true; + Main.npcCatchable[298] = true; + Main.npcCatchable[299] = true; + Main.npcCatchable[300] = true; + Main.npcCatchable[355] = true; + Main.npcCatchable[356] = true; + Main.npcCatchable[357] = true; + Main.npcCatchable[358] = true; + Main.npcCatchable[359] = true; + Main.npcCatchable[360] = true; + Main.npcCatchable[361] = true; + Main.npcCatchable[362] = true; + Main.npcCatchable[363] = true; + Main.npcCatchable[364] = true; + Main.npcCatchable[365] = true; + Main.npcCatchable[366] = true; + Main.npcCatchable[367] = true; + Main.npcCatchable[374] = true; + Main.npcCatchable[377] = true; + Main.npcCatchable[539] = true; + Main.npcCatchable[538] = true; + Main.npcCatchable[484] = true; + Main.npcCatchable[485] = true; + Main.npcCatchable[486] = true; + Main.npcCatchable[487] = true; + for (int index = 442; index <= 448; ++index) + Main.npcCatchable[index] = true; + Main.SetTileValue(); + Main.tileSpelunker[6] = true; + Main.tileSpelunker[7] = true; + Main.tileSpelunker[8] = true; + Main.tileSpelunker[9] = true; + Main.tileSpelunker[12] = true; + Main.tileSpelunker[21] = true; + Main.tileSpelunker[467] = true; + Main.tileSpelunker[441] = true; + Main.tileSpelunker[468] = true; + Main.tileSpelunker[28] = true; + Main.tileSpelunker[107] = true; + Main.tileSpelunker[108] = true; + Main.tileSpelunker[111] = true; + Main.tileSpelunker[63] = true; + Main.tileSpelunker[64] = true; + Main.tileSpelunker[65] = true; + Main.tileSpelunker[66] = true; + Main.tileSpelunker[67] = true; + Main.tileSpelunker[68] = true; + Main.tileSpelunker[166] = true; + Main.tileSpelunker[167] = true; + Main.tileSpelunker[168] = true; + Main.tileSpelunker[169] = true; + Main.tileSpelunker[178] = true; + Main.tileSpelunker[211] = true; + Main.tileSpelunker[221] = true; + Main.tileSpelunker[222] = true; + Main.tileSpelunker[223] = true; + Main.tileSpelunker[236] = true; + Main.tileSpelunker[37] = true; + Main.tileSpelunker[407] = true; + Main.tileSpelunker[227] = true; + Main.SetupTileMerge(); + Main.tileSolid[379] = true; + Main.tileSolid[371] = true; + Main.tileMergeDirt[371] = true; + Main.tileBlockLight[371] = true; + Main.tileBouncy[371] = true; + Main.tileBouncy[448] = true; + Main.tileBouncy[446] = true; + Main.tileBouncy[447] = true; + Main.tileFrameImportant[377] = true; + Main.tileFrameImportant[373] = true; + Main.tileFrameImportant[375] = true; + Main.tileFrameImportant[374] = true; + Main.tileFrameImportant[461] = true; + Main.tileLighted[372] = true; + Main.tileFrameImportant[372] = true; + Main.tileWaterDeath[372] = true; + Main.tileLavaDeath[372] = true; + Main.tileSolid[357] = true; + Main.tileBrick[357] = true; + Main.tileSolid[408] = true; + Main.tileMergeDirt[408] = true; + Main.tileBrick[408] = true; + Main.tileSolid[409] = true; + Main.tileBrick[409] = true; + Main.tileSolid[415] = true; + Main.tileBrick[415] = true; + Main.tileLighted[415] = true; + Main.tileSolid[416] = true; + Main.tileBrick[416] = true; + Main.tileLighted[416] = true; + Main.tileSolid[417] = true; + Main.tileBrick[417] = true; + Main.tileLighted[417] = true; + Main.tileSolid[418] = true; + Main.tileBrick[418] = true; + Main.tileLighted[418] = true; + Main.tileBrick[37] = true; + Main.tileBrick[117] = true; + Main.tileBrick[25] = true; + Main.tileBrick[203] = true; + Main.tileSolid[232] = true; + Main.tileSolid[311] = true; + Main.tileSolid[312] = true; + Main.tileSolid[313] = true; + Main.tileMergeDirt[311] = true; + Main.tileSolid[315] = true; + Main.tileMergeDirt[315] = true; + Main.tileSolid[321] = true; + Main.tileSolid[322] = true; + Main.tileBlockLight[321] = true; + Main.tileBlockLight[322] = true; + Main.tileMergeDirt[321] = true; + Main.tileMergeDirt[322] = true; + Main.tileBrick[321] = true; + Main.tileBrick[322] = true; + Main.tileShine[239] = 1100; + Main.tileSolid[239] = true; + Main.tileSolidTop[239] = true; + Main.tileSolid[380] = true; + Main.tileSolidTop[380] = true; + Main.tileFrameImportant[358] = true; + Main.tileFrameImportant[359] = true; + Main.tileFrameImportant[360] = true; + Main.tileFrameImportant[361] = true; + Main.tileFrameImportant[362] = true; + Main.tileFrameImportant[363] = true; + Main.tileFrameImportant[364] = true; + Main.tileFrameImportant[391] = true; + Main.tileLighted[391] = true; + Main.tileFrameImportant[392] = true; + Main.tileFrameImportant[393] = true; + Main.tileFrameImportant[394] = true; + Main.tileFrameImportant[356] = true; + Main.tileFrameImportant[334] = true; + Main.tileFrameImportant[440] = true; + Main.tileFrameImportant[300] = true; + Main.tileFrameImportant[301] = true; + Main.tileFrameImportant[302] = true; + Main.tileFrameImportant[303] = true; + Main.tileFrameImportant[304] = true; + Main.tileFrameImportant[305] = true; + Main.tileFrameImportant[306] = true; + Main.tileFrameImportant[307] = true; + Main.tileFrameImportant[308] = true; + Main.tileFrameImportant[354] = true; + Main.tileFrameImportant[355] = true; + Main.tileFrameImportant[324] = true; + Main.tileObsidianKill[324] = true; + Main.tileLavaDeath[324] = true; + Main.tileFrameImportant[463] = true; + Main.tileFrameImportant[464] = true; + Main.tileFrameImportant[466] = true; + Main.tileFrameImportant[419] = true; + Main.tileFrameImportant[442] = true; + Main.tileFrameImportant[443] = true; + Main.tileFrameImportant[444] = true; + Main.tileFrameImportant[420] = true; + Main.tileFrameImportant[423] = true; + Main.tileFrameImportant[424] = true; + Main.tileFrameImportant[428] = true; + Main.tileFrameImportant[429] = true; + Main.tileFrameImportant[445] = true; + Main.tileFrameImportant[283] = true; + Main.tileFrameImportant[288] = true; + Main.tileFrameImportant[289] = true; + Main.tileFrameImportant[290] = true; + Main.tileFrameImportant[291] = true; + Main.tileFrameImportant[292] = true; + Main.tileFrameImportant[293] = true; + Main.tileFrameImportant[294] = true; + Main.tileFrameImportant[295] = true; + Main.tileFrameImportant[296] = true; + Main.tileFrameImportant[297] = true; + Main.tileFrameImportant[316] = true; + Main.tileFrameImportant[317] = true; + Main.tileFrameImportant[318] = true; + Main.tileLargeFrames[284] = (byte) 1; + Main.wallHouse[224] = true; + Main.wallLargeFrames[224] = (byte) 2; + Main.wallHouse[60] = true; + Main.wallHouse[225] = true; + Main.wallHouse[226] = true; + Main.wallHouse[227] = true; + Main.tileLargeFrames[409] = (byte) 1; + Main.tileFrameImportant[410] = true; + Main.wallHouse[173] = true; + Main.wallHouse[183] = true; + Main.wallHouse[179] = true; + Main.wallLargeFrames[179] = (byte) 1; + Main.tileSolid[367] = true; + Main.tileBlockLight[367] = true; + Main.tileMergeDirt[367] = true; + Main.tileSolid[357] = true; + Main.tileBlockLight[357] = true; + Main.tileLargeFrames[357] = (byte) 1; + Main.tileBlendAll[357] = true; + Main.wallHouse[184] = true; + Main.wallHouse[181] = true; + Main.tileSolid[368] = true; + Main.tileBlockLight[368] = true; + Main.tileMergeDirt[368] = true; + Main.tileSolid[369] = true; + Main.tileBlockLight[369] = true; + Main.tileBrick[369] = true; + Main.tileMergeDirt[369] = true; + Main.wallHouse[186] = true; + Main.tileLargeFrames[325] = (byte) 1; + Main.tileSolid[325] = true; + Main.tileBlockLight[325] = true; + Main.wallLargeFrames[146] = (byte) 1; + Main.wallLargeFrames[147] = (byte) 1; + Main.wallLargeFrames[167] = (byte) 1; + Main.wallLargeFrames[185] = (byte) 2; + Main.tileSolid[460] = true; + Main.tileSolid[326] = true; + Main.tileBlockLight[326] = true; + Main.tileSolid[458] = true; + Main.tileBlockLight[458] = true; + Main.tileSolid[459] = true; + Main.tileSolid[327] = true; + Main.tileBlockLight[327] = true; + Main.tileSolid[345] = true; + Main.tileBlockLight[345] = true; + Main.tileLighted[327] = true; + Main.tileSolid[328] = true; + Main.tileBrick[328] = true; + Main.tileSolid[329] = true; + Main.tileBrick[329] = true; + Main.tileBlockLight[329] = true; + Main.tileLighted[336] = true; + Main.tileLighted[340] = true; + Main.tileLighted[341] = true; + Main.tileLighted[342] = true; + Main.tileLighted[343] = true; + Main.tileLighted[344] = true; + Main.tileLighted[349] = true; + Main.tileSolid[421] = true; + Main.tileBlockLight[421] = true; + Main.tileSolid[422] = true; + Main.tileBlockLight[422] = true; + Main.tileSolid[426] = true; + Main.tileBlockLight[426] = true; + Main.tileSolid[430] = true; + Main.tileBlockLight[430] = true; + Main.tileSolid[431] = true; + Main.tileBlockLight[431] = true; + Main.tileSolid[432] = true; + Main.tileBlockLight[432] = true; + Main.tileSolid[433] = true; + Main.tileBlockLight[433] = true; + Main.tileSolid[434] = true; + Main.tileBlockLight[434] = true; + Main.tileSolid[446] = true; + Main.tileSolid[447] = true; + Main.tileSolid[448] = true; + Main.tileFrameImportant[427] = true; + Main.tileSolidTop[427] = true; + Main.tileSolid[427] = true; + Main.tileNoAttach[427] = true; + Main.tileTable[427] = true; + Main.tileLavaDeath[427] = true; + Main.tileNoSunLight[427] = false; + for (int index = 435; index <= 439; ++index) + { + Main.tileFrameImportant[index] = true; + Main.tileSolidTop[index] = true; + Main.tileSolid[index] = true; + Main.tileNoAttach[index] = true; + Main.tileTable[index] = true; + Main.tileLavaDeath[index] = true; + Main.tileNoSunLight[index] = false; + } + Main.tileSolid[284] = true; + Main.tileBlockLight[284] = true; + Main.tileSolid[346] = true; + Main.tileBlockLight[346] = true; + Main.tileLighted[346] = true; + Main.tileShine[346] = 2000; + Main.tileShine2[346] = true; + Main.tileBrick[346] = true; + Main.tileMergeDirt[346] = true; + Main.tileSolid[347] = true; + Main.tileBlockLight[347] = true; + Main.tileLighted[347] = true; + Main.tileShine[347] = 1900; + Main.tileShine2[347] = true; + Main.tileBrick[347] = true; + Main.tileMergeDirt[347] = true; + Main.tileSolid[348] = true; + Main.tileBlockLight[348] = true; + Main.tileLighted[348] = true; + Main.tileShine[348] = 1800; + Main.tileShine2[348] = true; + Main.tileBrick[348] = true; + Main.tileMergeDirt[348] = true; + Main.tileSolid[350] = true; + Main.tileBlockLight[350] = true; + Main.tileLighted[350] = true; + Main.tileBrick[350] = true; + Main.tileMergeDirt[350] = true; + Main.tileGlowMask[350] = (short) 94; + Main.tileGlowMask[390] = (short) 130; + Main.tileGlowMask[381] = (short) 126; + Main.tileGlowMask[370] = (short) 111; + Main.tileGlowMask[391] = (short) 131; + Main.tileGlowMask[429] = (short) 214; + Main.tileGlowMask[209] = (short) 215; + Main.tileGlowMask[445] = (short) 214; + Main.tileLighted[429] = true; + Main.tileLighted[209] = true; + Main.tileGlowMask[410] = (short) 201; + Main.tileSolid[370] = true; + Main.tileBlockLight[370] = true; + Main.tileLighted[370] = true; + Main.tileShine[370] = 1900; + Main.tileShine2[370] = true; + Main.tileBrick[370] = true; + Main.tileMergeDirt[370] = true; + Main.tileContainer[21] = true; + Main.tileContainer[467] = true; + Main.tileContainer[88] = true; + Main.tileSign[55] = true; + Main.tileSign[85] = true; + Main.tileSign[425] = true; + Main.tileSolid[383] = true; + Main.tileBrick[383] = true; + Main.tileBlockLight[383] = true; + Main.tileSolid[385] = true; + Main.tileBrick[385] = true; + Main.tileBlockLight[385] = true; + Main.tileSolid[396] = true; + Main.tileBlockLight[396] = true; + Main.tileSolid[397] = true; + Main.tileBlockLight[397] = true; + Main.tileSolid[399] = true; + Main.tileBlockLight[399] = true; + Main.tileSolid[401] = true; + Main.tileBlockLight[401] = true; + Main.tileSolid[398] = true; + Main.tileBlockLight[398] = true; + Main.tileSolid[400] = true; + Main.tileBlockLight[400] = true; + Main.tileSolid[402] = true; + Main.tileBlockLight[402] = true; + Main.tileSolid[403] = true; + Main.tileBlockLight[403] = true; + Main.tileSolid[404] = true; + Main.tileBlockLight[404] = true; + Main.tileSolid[407] = true; + Main.tileBlockLight[407] = true; + Main.tileShine2[407] = true; + Main.tileShine[407] = 1000; + Main.tileFrameImportant[36] = true; + Main.tileFrameImportant[275] = true; + Main.tileFrameImportant[276] = true; + Main.tileFrameImportant[277] = true; + Main.tileFrameImportant[278] = true; + Main.tileFrameImportant[279] = true; + Main.tileFrameImportant[280] = true; + Main.tileFrameImportant[281] = true; + Main.tileFrameImportant[282] = true; + Main.tileFrameImportant[285] = true; + Main.tileFrameImportant[286] = true; + Main.tileFrameImportant[414] = true; + Main.tileFrameImportant[413] = true; + Main.tileFrameImportant[309] = true; + Main.tileFrameImportant[310] = true; + Main.tileFrameImportant[339] = true; + Main.tileLighted[286] = true; + Main.tileLighted[302] = true; + Main.tileFrameImportant[298] = true; + Main.tileFrameImportant[299] = true; + Main.tileSolid[170] = true; + Main.tileFrameImportant[171] = true; + Main.tileLighted[171] = true; + Main.tileFrameImportant[247] = true; + Main.tileFrameImportant[245] = true; + Main.tileFrameImportant[246] = true; + Main.tileFrameImportant[239] = true; + Main.tileFrameImportant[240] = true; + Main.tileFrameImportant[241] = true; + Main.tileFrameImportant[242] = true; + Main.tileFrameImportant[243] = true; + Main.tileFrameImportant[244] = true; + Main.tileFrameImportant[254] = true; + Main.tileSolid[221] = true; + Main.tileBlockLight[221] = true; + Main.tileMergeDirt[221] = true; + Main.tileLighted[96] = true; + Main.tileMergeDirt[250] = true; + Main.tileSolid[272] = true; + Main.tileBlockLight[272] = true; + Main.tileSolid[229] = true; + Main.tileBlockLight[229] = true; + Main.tileMergeDirt[229] = true; + Main.tileSolid[230] = true; + Main.tileBlockLight[230] = true; + Main.tileMergeDirt[230] = true; + Main.tileSolid[222] = true; + Main.tileBlockLight[222] = true; + Main.tileMergeDirt[222] = true; + Main.tileSolid[223] = true; + Main.tileBlockLight[223] = true; + Main.tileMergeDirt[223] = true; + Main.tileSolid[224] = true; + Main.tileBlockLight[224] = true; + Main.tileFrameImportant[237] = true; + Main.tileFrameImportant[238] = true; + Main.tileSolid[225] = true; + Main.tileBlockLight[225] = true; + Main.tileBrick[225] = true; + Main.tileSolid[226] = true; + Main.tileBlockLight[226] = true; + Main.tileBrick[226] = true; + Main.tileSolid[235] = true; + Main.tileBlockLight[235] = true; + Main.tileFrameImportant[235] = true; + Main.tileLighted[238] = true; + Main.tileCut[254] = true; + Main.tileFrameImportant[236] = true; + Main.tileCut[236] = true; + Main.tileSolid[191] = true; + Main.tileBrick[191] = true; + Main.tileBlockLight[191] = true; + Main.tileSolid[211] = true; + Main.tileBlockLight[211] = true; + Main.tileSolid[208] = true; + Main.tileBrick[208] = true; + Main.tileBlockLight[208] = true; + Main.tileSolid[192] = true; + Main.tileBrick[192] = true; + Main.tileBlockLight[192] = true; + Main.tileSolid[193] = true; + Main.tileBrick[193] = true; + Main.tileBlockLight[193] = true; + Main.tileMergeDirt[193] = true; + Main.tileSolid[194] = true; + Main.tileBrick[194] = true; + Main.tileBlockLight[194] = true; + Main.tileSolid[195] = true; + Main.tileBrick[195] = true; + Main.tileMergeDirt[195] = true; + Main.tileBlockLight[195] = true; + Main.tileBlockLight[200] = true; + Main.tileSolid[200] = true; + Main.tileBrick[200] = true; + Main.tileBlockLight[203] = true; + Main.tileSolid[203] = true; + Main.tileMergeDirt[203] = true; + Main.tileBlockLight[204] = true; + Main.tileSolid[204] = true; + Main.tileMergeDirt[204] = true; + Main.tileBlockLight[165] = true; + Main.tileShine2[147] = true; + Main.tileShine2[161] = true; + Main.tileShine2[163] = true; + Main.tileShine2[164] = true; + Main.tileSolid[189] = true; + Main.tileBlockLight[51] = true; + Main.tileLighted[204] = true; + Main.tileShine[204] = 1150; + Main.tileShine2[204] = true; + Main.tileSolid[190] = true; + Main.tileBlockLight[190] = true; + Main.tileBrick[190] = true; + Main.tileSolid[198] = true; + Main.tileMergeDirt[198] = true; + Main.tileBrick[198] = true; + Main.tileBlockLight[198] = true; + Main.tileSolid[206] = true; + Main.tileBlockLight[206] = true; + Main.tileMergeDirt[206] = true; + Main.tileBrick[206] = true; + Main.tileBlockLight[234] = true; + Main.tileSolid[248] = true; + Main.tileSolid[249] = true; + Main.tileSolid[250] = true; + Main.tileBrick[248] = true; + Main.tileBrick[249] = true; + Main.tileBrick[250] = true; + Main.tileSolid[251] = true; + Main.tileSolid[252] = true; + Main.tileBrick[252] = true; + Main.tileSolid[253] = true; + Main.tileBrick[253] = true; + Main.tileMergeDirt[251] = true; + Main.tileMergeDirt[252] = true; + Main.tileMergeDirt[253] = true; + Main.tileBlockLight[251] = true; + Main.tileBlockLight[252] = true; + Main.tileBlockLight[253] = true; + Main.tileBlockLight[248] = true; + Main.tileBlockLight[249] = true; + Main.tileBlockLight[250] = true; + Main.tileLargeFrames[273] = (byte) 1; + Main.tileSolid[273] = true; + Main.tileBlockLight[273] = true; + Main.tileLargeFrames[274] = (byte) 1; + Main.tileSolid[274] = true; + Main.tileBlockLight[274] = true; + for (int maxValue = (int) byte.MaxValue; maxValue <= 268; ++maxValue) + { + Main.tileSolid[maxValue] = true; + if (maxValue > 261) + { + Main.tileLighted[maxValue] = true; + Main.tileShine2[maxValue] = true; + } + } + Main.tileFrameImportant[269] = true; + Main.tileFrameImportant[390] = true; + Main.tileNoAttach[390] = true; + Main.tileLavaDeath[390] = true; + Main.tileLighted[390] = true; + Main.wallHouse[168] = true; + Main.wallHouse[169] = true; + Main.wallHouse[142] = true; + Main.wallHouse[143] = true; + Main.wallHouse[144] = true; + Main.wallHouse[149] = true; + Main.wallHouse[151] = true; + Main.wallHouse[150] = true; + Main.wallHouse[152] = true; + Main.wallHouse[175] = true; + Main.wallHouse[176] = true; + Main.wallHouse[182] = true; + for (int index = 153; index < 167; ++index) + Main.wallHouse[index] = true; + Main.wallHouse[146] = true; + Main.wallHouse[147] = true; + Main.wallHouse[149] = true; + Main.wallHouse[167] = true; + Main.wallHouse[168] = true; + Main.wallHouse[133] = true; + Main.wallHouse[134] = true; + Main.wallHouse[135] = true; + Main.wallHouse[136] = true; + Main.wallHouse[137] = true; + Main.wallHouse[75] = true; + Main.wallHouse[76] = true; + Main.wallHouse[78] = true; + Main.wallHouse[82] = true; + Main.wallHouse[77] = true; + Main.wallHouse[1] = true; + Main.wallHouse[4] = true; + Main.wallHouse[5] = true; + Main.wallHouse[6] = true; + Main.wallHouse[10] = true; + Main.wallHouse[11] = true; + Main.wallHouse[12] = true; + Main.wallHouse[16] = true; + Main.wallHouse[17] = true; + Main.wallHouse[18] = true; + Main.wallHouse[19] = true; + Main.wallHouse[20] = true; + Main.wallHouse[21] = true; + Main.wallHouse[22] = true; + Main.wallHouse[23] = true; + Main.wallHouse[24] = true; + Main.wallHouse[25] = true; + Main.wallHouse[26] = true; + Main.wallHouse[27] = true; + Main.wallHouse[29] = true; + Main.wallHouse[30] = true; + Main.wallHouse[31] = true; + Main.wallHouse[32] = true; + Main.wallHouse[33] = true; + Main.wallHouse[34] = true; + Main.wallHouse[35] = true; + Main.wallHouse[36] = true; + Main.wallHouse[37] = true; + Main.wallHouse[38] = true; + Main.wallHouse[39] = true; + Main.wallHouse[41] = true; + Main.wallHouse[42] = true; + Main.wallHouse[43] = true; + Main.wallHouse[44] = true; + Main.wallHouse[45] = true; + Main.wallHouse[46] = true; + Main.wallHouse[47] = true; + Main.wallHouse[66] = true; + Main.wallHouse[67] = true; + Main.wallHouse[68] = true; + Main.wallHouse[72] = true; + Main.wallHouse[73] = true; + Main.wallHouse[107] = true; + Main.wallHouse[106] = true; + Main.wallHouse[109] = true; + Main.wallHouse[110] = true; + Main.wallHouse[111] = true; + Main.wallHouse[112] = true; + Main.wallHouse[113] = true; + Main.wallHouse[114] = true; + Main.wallHouse[115] = true; + Main.wallHouse[116] = true; + Main.wallHouse[117] = true; + Main.wallHouse[118] = true; + Main.wallHouse[119] = true; + Main.wallHouse[120] = true; + Main.wallHouse[121] = true; + Main.wallHouse[122] = true; + Main.wallHouse[123] = true; + Main.wallHouse[124] = true; + Main.wallHouse[125] = true; + Main.wallHouse[108] = true; + Main.wallHouse[100] = true; + Main.wallHouse[101] = true; + Main.wallHouse[102] = true; + Main.wallHouse[103] = true; + Main.wallHouse[104] = true; + Main.wallHouse[105] = true; + Main.wallHouse[84] = true; + Main.wallHouse[74] = true; + Main.wallHouse[85] = true; + Main.wallHouse[88] = true; + Main.wallHouse[89] = true; + Main.wallHouse[90] = true; + Main.wallHouse[91] = true; + Main.wallHouse[92] = true; + Main.wallHouse[93] = true; + Main.wallHouse[126] = true; + Main.wallHouse[(int) sbyte.MaxValue] = true; + Main.wallHouse[128] = true; + Main.wallHouse[129] = true; + Main.wallHouse[130] = true; + Main.wallHouse[131] = true; + Main.wallHouse[132] = true; + Main.wallHouse[138] = true; + Main.wallHouse[139] = true; + Main.wallHouse[140] = true; + Main.wallHouse[141] = true; + Main.wallHouse[177] = true; + Main.wallHouse[172] = true; + Main.wallHouse[174] = true; + Main.wallHouse[223] = true; + Main.wallHouse[230] = true; + Main.wallHouse[228] = true; + Main.wallHouse[229] = true; + Main.wallLight[0] = true; + Main.wallLight[21] = true; + Main.wallLight[106] = true; + Main.wallLight[107] = true; + Main.wallLight[138] = true; + Main.wallLight[140] = true; + Main.wallLight[141] = true; + Main.wallLight[139] = true; + Main.wallLight[145] = true; + Main.wallLight[150] = true; + Main.wallLight[152] = true; + Main.wallLight[168] = true; + for (int index = 0; index < 231; ++index) + Main.wallDungeon[index] = false; + Main.wallDungeon[7] = true; + Main.wallDungeon[8] = true; + Main.wallDungeon[9] = true; + Main.wallDungeon[94] = true; + Main.wallDungeon[95] = true; + Main.wallDungeon[96] = true; + Main.wallDungeon[97] = true; + Main.wallDungeon[98] = true; + Main.wallDungeon[99] = true; for (int index = 0; index < 10; ++index) { Main.recentWorld[index] = ""; @@ -4779,251 +5459,10 @@ label_127: Main.rand = new UnifiedRandom((int) DateTime.Now.Ticks); this.SetTitle(); Main.lo = Main.rand.Next(6); - this.waterfallManager = new WaterfallManager(); - Main._windowMover = new WindowStateController(); - Main.sittingManager = new AnchoredEntitiesCollection(); - Main.sleepingManager = new AnchoredEntitiesCollection(); - Main.gameTips = new GameTipsDisplay(); - if (Main.player[Main.myPlayer] == null) - Main.player[Main.myPlayer] = new Player(); - ContentSamples.Initialize(); - PlayerInput.Initialize(); - Main.player[Main.myPlayer] = new Player(); - WorldGen.Hooks.OnWorldLoad += (Action) (() => - { - Main.AmbienceServer = new AmbienceServer(); - Main.LocalGolfState = new GolfState(); - Lighting.Clear(); - }); - PlayerInput.OnActionableInput += (Action) (() => - { - if (Main.LocalGolfState == null) - return; - Main.LocalGolfState.CancelBallTracking(); - }); - Main.SceneMetrics = new SceneMetrics(Main.ActiveWorld); - TimeLogger.Initialize(); - this.LoadContent_TryEnteringHiDef(); - this.ClientInitialize(); - base.Initialize(); - } - - private void Initialize_AlmostEverything() - { - this.TilePaintSystem = new TilePaintSystemV2(); - this.TilesRenderer = new TileDrawing(this.TilePaintSystem); - this.WallsRenderer = new WallDrawing(this.TilePaintSystem); - CreativePowerManager.Initialize(); - Main.LocalFavoriteData.Load(); - Main.CloudFavoritesData.Load(); - this.Initialize_Entities(); - Main.FindAnnouncementBoxStatus(); - CustomCurrencyManager.Initialize(); - WingStatsInitializer.Load(); - TileObjectData.Initialize(); - Animation.Initialize(); - Chest.Initialize(); - Wiring.Initialize(); - Framing.Initialize(); - ItemRarity.Initialize(); - TileEntity.InitializeAll(); - Projectile.InitializeStaticThings(); - TorchID.Initialize(); - Main.InitializeItemAnimations(); - BestiaryDatabase database1 = new BestiaryDatabase(); - new BestiaryDatabaseNPCsPopulator().Populate(database1); - Main.BestiaryDB = database1; - ContentSamples.RebuildBestiarySortingIDsByBestiaryDatabaseContents(database1); - Main.BestiaryTracker = new BestiaryUnlocksTracker(); - ItemDropDatabase database2 = new ItemDropDatabase(); - database2.Populate(); - Main.ItemDropsDB = database2; - database1.Merge(Main.ItemDropsDB); - Main.PylonSystem = new TeleportPylonsSystem(); - Main.ItemDropSolver = new ItemDropResolver(database2); - Main.ShopHelper = new ShopHelper(); - CreativeItemSacrificesCatalog.Instance.Initialize(); - Main.BestiaryUI = new UIBestiaryTest(Main.BestiaryDB); - Main.ContentThatNeedsRenderTargets.Add((INeedRenderTargetContent) Main.MapPlayerRenderer); - Lighting.Initialize(); - MapHelper.Initialize(); - WorldGen.RandomizeBackgrounds(Main.rand); - if (Main.treeBGSet1[0] == 173) - WorldGen.RandomizeBackgrounds(Main.rand); - if (Main.treeBGSet1[0] == 173) - WorldGen.RandomizeBackgrounds(Main.rand); - WorldGen.RandomizeCaveBackgrounds(); - WorldGen.Hooks.Initialize(); - WorldGen.Hooks.OnWorldLoad += new Action(Main.ResetGameCounter); - Main.bgAlphaFrontLayer[0] = 1f; - Main.bgAlphaFarBackLayer[0] = 1f; - this.invBottom = 258; - Main.Initialize_TileAndNPCData1(); - Main.Initialize_TileAndNPCData2(); - Main.Initialize_Items(); - for (int index = 0; index < Recipe.maxRecipes; ++index) - { - Main.recipe[index] = new Recipe(); - Main.availableRecipeY[index] = (float) (65 * index); - } - Recipe.SetupRecipes(); - ContentSamples.FixItemsAfterRecipesAreAdded(); - for (int index = 0; index < Terraria.Liquid.maxLiquid; ++index) - Main.liquid[index] = new Terraria.Liquid(); - for (int index = 0; index < 50000; ++index) - Main.liquidBuffer[index] = new LiquidBuffer(); - this.shop[0] = new Chest(); - Chest.SetupTravelShop(); - for (int type = 1; type < 100; ++type) - { - this.shop[type] = new Chest(); - this.shop[type].SetupShop(type); - } - Main.teamColor[0] = Microsoft.Xna.Framework.Color.White; - Main.teamColor[1] = new Microsoft.Xna.Framework.Color(218, 59, 59); - Main.teamColor[2] = new Microsoft.Xna.Framework.Color(59, 218, 85); - Main.teamColor[3] = new Microsoft.Xna.Framework.Color(59, 149, 218); - Main.teamColor[4] = new Microsoft.Xna.Framework.Color(242, 221, 100); - Main.teamColor[5] = new Microsoft.Xna.Framework.Color(224, 100, 242); - for (int Type = 1; Type < 950; ++Type) - { - Projectile projectile = new Projectile(); - projectile.SetDefaults(Type); - if (projectile.hostile) - Main.projHostile[Type] = true; - if (projectile.aiStyle == 7) - Main.projHook[Type] = true; - } - Netplay.Initialize(); - NetworkInitializer.Load(); - ChatInitializer.Load(); - if (Main.menuMode == 1) - Main.LoadPlayers(); - if (Main.skipMenu) - { - WorldGen.clearWorld(); - Main.gameMenu = false; - Main.LoadPlayers(); - Main.PlayerList[0].SetAsActive(); - Main.LoadWorlds(); - WorldGen.GenerateWorld(new UnifiedRandom().Next()); - WorldGen.EveryTileFrame(); - Main.player[Main.myPlayer].Spawn(PlayerSpawnContext.SpawningIntoWorld); - Main.ActivePlayerFileData.StartPlayTimer(); - Player.Hooks.EnterWorld(Main.myPlayer); - } - else - { - IntPtr systemMenu = Main.GetSystemMenu(this.Window.Handle, false); - Main.RemoveMenu(systemMenu, Main.GetMenuItemCount(systemMenu) - 1, 1024); - } - SoundID.FillAccessMap(); - Star.SpawnStars(); - ItemSorting.SetupWhiteLists(); - } - - private void Initialize_Entities() - { - for (int index = 0; index < Main.maxMenuItems; ++index) - this.menuItemScale[index] = 0.8f; - for (int index = 0; index < 6001; ++index) - { - Main.dust[index] = new Dust(); - Main.dust[index].dustIndex = index; - } - for (int index = 0; index < 401; ++index) - Main.item[index] = new Item(); - for (int index = 0; index < 201; ++index) - { - Main.npc[index] = new NPC(); - Main.npc[index].whoAmI = index; - } - for (int index = 0; index < 256; ++index) - Main.player[index] = new Player(); - for (int index = 0; index < 1001; ++index) - Main.projectile[index] = new Projectile(); - for (int index = 0; index < 601; ++index) - Main.gore[index] = new Gore(); - for (int index = 0; index < Main.maxRain + 1; ++index) - Main.rain[index] = new Rain(); - for (int index = 0; index < 200; ++index) - Main.cloud[index] = new Cloud(); - for (int index = 0; index < 100; ++index) - Main.combatText[index] = new CombatText(); - for (int index = 0; index < 20; ++index) - Main.popupText[index] = new PopupText(); - } - - private static void Initialize_Items() - { - for (int Type = 0; Type < 5045; ++Type) - { - Item obj = new Item(); - obj.SetDefaults(Type); - if (obj.headSlot > 0) - Item.headType[obj.headSlot] = obj.type; - if (obj.bodySlot > 0) - Item.bodyType[obj.bodySlot] = obj.type; - if (obj.legSlot > 0) - Item.legType[obj.legSlot] = obj.type; - switch (obj.type) - { - case 683: - case 723: - case 726: - case 739: - case 740: - case 741: - case 742: - case 743: - case 744: - case 788: - case 1296: - case 1308: - case 1326: - case 1444: - case 1445: - case 1446: - case 1801: - case 1930: - case 1931: - case 2188: - case 2750: - case 3006: - case 3051: - case 3209: - case 3210: - case 3377: - case 3476: - case 3569: - case 3571: - case 3787: - case 3852: - case 3870: - case 4062: - Item.staff[obj.type] = true; - break; - case 1827: - case 3245: - Item.claw[obj.type] = true; - break; - } - } - } - - private static void Initialize_TileAndNPCData2() - { Main.critterCage = true; for (int index = 0; index < 3600; ++index) - Main.AnimateTiles_CritterCages(); + Main.CritterCages(); Main.critterCage = false; - Main.tileBlockLight[549] = true; - Main.tileBrick[477] = true; - Main.tileSolid[477] = true; - Main.tileBlockLight[477] = true; - Main.tileBrick[492] = true; - Main.tileSolid[492] = true; - Main.tileBlockLight[492] = true; Main.tileBrick[1] = true; Main.tileBrick[54] = true; Main.tileBrick[118] = true; @@ -5042,9 +5481,6 @@ label_127: Main.tileBrick[41] = true; Main.tileBrick[43] = true; Main.tileBrick[44] = true; - Main.tileBrick[481] = true; - Main.tileBrick[482] = true; - Main.tileBrick[483] = true; Main.tileBrick[45] = true; Main.tileBrick[46] = true; Main.tileBrick[47] = true; @@ -5069,13 +5505,10 @@ label_127: Main.tileBrick[157] = true; Main.tileBrick[158] = true; Main.tileBrick[159] = true; - Main.tileBrick[273] = true; - Main.tileBrick[274] = true; Main.tileMergeDirt[202] = true; Main.tileBrick[202] = true; Main.tileSolid[202] = true; Main.tileBlockLight[202] = true; - Main.tileMergeDirt[498] = true; Main.tileBrick[161] = true; Main.tileBlockLight[161] = true; Main.tileBlockLight[163] = true; @@ -5092,18 +5525,6 @@ label_127: Main.tileSolid[381] = true; Main.tileBlockLight[381] = true; Main.tileMoss[381] = true; - Main.tileBrick[534] = true; - Main.tileSolid[534] = true; - Main.tileBlockLight[534] = true; - Main.tileMoss[534] = true; - Main.tileBrick[536] = true; - Main.tileSolid[536] = true; - Main.tileBlockLight[536] = true; - Main.tileMoss[536] = true; - Main.tileBrick[539] = true; - Main.tileSolid[539] = true; - Main.tileBlockLight[539] = true; - Main.tileMoss[539] = true; Main.tileBrick[180] = true; Main.tileSolid[180] = true; Main.tileBlockLight[180] = true; @@ -5120,38 +5541,6 @@ label_127: Main.tileSolid[183] = true; Main.tileBlockLight[183] = true; Main.tileMoss[183] = true; - Main.tileBrick[512] = true; - Main.tileSolid[512] = true; - Main.tileBlockLight[512] = true; - Main.tileBrick[513] = true; - Main.tileSolid[513] = true; - Main.tileBlockLight[513] = true; - Main.tileBrick[514] = true; - Main.tileSolid[514] = true; - Main.tileBlockLight[514] = true; - Main.tileBrick[515] = true; - Main.tileSolid[515] = true; - Main.tileBlockLight[515] = true; - Main.tileBrick[516] = true; - Main.tileSolid[516] = true; - Main.tileBlockLight[516] = true; - Main.tileBrick[517] = true; - Main.tileSolid[517] = true; - Main.tileBlockLight[517] = true; - Main.tileLighted[517] = true; - Main.tileBrick[535] = true; - Main.tileSolid[535] = true; - Main.tileBlockLight[535] = true; - Main.tileLighted[535] = true; - Main.tileBrick[537] = true; - Main.tileSolid[537] = true; - Main.tileBlockLight[537] = true; - Main.tileLighted[537] = true; - Main.tileBrick[540] = true; - Main.tileSolid[540] = true; - Main.tileBlockLight[540] = true; - Main.tileLighted[540] = true; - Main.tileLighted[592] = true; Main.tileMergeDirt[177] = true; Main.tileMergeDirt[190] = true; Main.tileSolid[196] = true; @@ -5211,7 +5600,6 @@ label_127: Main.tileShine2[66] = true; Main.tileShine2[67] = true; Main.tileShine2[68] = true; - Main.tileShine2[566] = true; Main.tileShine2[107] = true; Main.tileShine2[108] = true; Main.tileShine2[111] = true; @@ -5220,19 +5608,11 @@ label_127: Main.tileShine2[117] = true; Main.tileShine2[211] = true; Main.tileShine[129] = 300; - Main.tileNoFail[81] = true; - Main.tileCracked[481] = true; - Main.tileCracked[482] = true; - Main.tileCracked[483] = true; - Main.tileNoFail[481] = true; - Main.tileNoFail[482] = true; - Main.tileNoFail[483] = true; Main.tileNoFail[330] = true; Main.tileNoFail[331] = true; Main.tileNoFail[332] = true; Main.tileNoFail[333] = true; Main.tileNoFail[254] = true; - Main.tileNoFail[324] = true; Main.tileNoFail[129] = true; Main.tileNoFail[192] = true; Main.tileHammer[26] = true; @@ -5240,17 +5620,7 @@ label_127: Main.tileAxe[5] = true; Main.tileAxe[72] = true; Main.tileAxe[80] = true; - Main.tileAxe[488] = true; Main.tileAxe[323] = true; - Main.tileAxe[596] = true; - Main.tileAxe[616] = true; - Main.tileAxe[589] = true; - Main.tileAxe[584] = true; - Main.tileAxe[588] = true; - Main.tileAxe[586] = true; - Main.tileAxe[587] = true; - Main.tileAxe[585] = true; - Main.tileAxe[583] = true; Main.tileBrick[59] = true; Main.tileBrick[234] = true; Main.tileSolid[234] = true; @@ -5259,135 +5629,7 @@ label_127: Main.tileSand[112] = true; Main.tileSand[116] = true; Main.tileSand[234] = true; - Main.tileFrameImportant[571] = true; - Main.tileLavaDeath[571] = true; - Main.tileFrameImportant[579] = true; - Main.tileLavaDeath[579] = true; - Main.tileFrameImportant[591] = true; - Main.tileLavaDeath[591] = true; - Main.tileFrameImportant[592] = true; - Main.tileLavaDeath[592] = false; - Main.tileFrameImportant[538] = true; - Main.tileLavaDeath[538] = true; - Main.tileFrameImportant[544] = true; - Main.tileLavaDeath[544] = true; - Main.tileFrameImportant[550] = true; - Main.tileLavaDeath[550] = true; - Main.tileFrameImportant[551] = true; - Main.tileLavaDeath[551] = true; - Main.tileFrameImportant[533] = true; - Main.tileLavaDeath[533] = true; - Main.tileFrameImportant[553] = true; - Main.tileLavaDeath[553] = true; - Main.tileFrameImportant[554] = true; - Main.tileLavaDeath[554] = true; - Main.tileFrameImportant[555] = true; - Main.tileLavaDeath[555] = true; - Main.tileFrameImportant[556] = true; - Main.tileLavaDeath[556] = true; - Main.tileFrameImportant[558] = true; - Main.tileLavaDeath[558] = true; - Main.tileFrameImportant[559] = true; - Main.tileLavaDeath[559] = true; - Main.tileFrameImportant[599] = true; - Main.tileLavaDeath[599] = true; - Main.tileFrameImportant[600] = true; - Main.tileLavaDeath[600] = true; - Main.tileFrameImportant[601] = true; - Main.tileLavaDeath[601] = true; - Main.tileFrameImportant[602] = true; - Main.tileLavaDeath[602] = true; - Main.tileFrameImportant[603] = true; - Main.tileLavaDeath[603] = true; - Main.tileFrameImportant[604] = true; - Main.tileLavaDeath[604] = true; - Main.tileFrameImportant[605] = true; - Main.tileLavaDeath[605] = true; - Main.tileFrameImportant[606] = true; - Main.tileLavaDeath[606] = true; - Main.tileFrameImportant[607] = true; - Main.tileLavaDeath[607] = true; - Main.tileFrameImportant[608] = true; - Main.tileLavaDeath[608] = true; - Main.tileFrameImportant[609] = true; - Main.tileLavaDeath[609] = true; - Main.tileFrameImportant[610] = true; - Main.tileLavaDeath[610] = true; - Main.tileFrameImportant[611] = true; - Main.tileLavaDeath[611] = true; - Main.tileFrameImportant[612] = true; - Main.tileLavaDeath[612] = true; - Main.tileFrameImportant[568] = true; - Main.tileNoAttach[568] = true; - Main.tileLavaDeath[568] = true; - Main.tileLighted[568] = true; - Main.tileFrameImportant[569] = true; - Main.tileNoAttach[569] = true; - Main.tileLavaDeath[569] = true; - Main.tileLighted[569] = true; - Main.tileFrameImportant[570] = true; - Main.tileNoAttach[570] = true; - Main.tileLavaDeath[570] = true; - Main.tileLighted[570] = true; - Main.tileFrameImportant[580] = true; - Main.tileNoAttach[580] = true; - Main.tileLavaDeath[580] = true; - Main.tileLighted[580] = true; - Main.tileFrameImportant[582] = true; - Main.tileLavaDeath[582] = true; - Main.tileLighted[582] = true; - Main.tileFrameImportant[619] = true; - Main.tileLavaDeath[619] = true; - Main.tileLighted[619] = true; - Main.tileFrameImportant[620] = true; - Main.tileNoAttach[620] = true; - Main.tileLavaDeath[620] = true; - Main.tileLighted[620] = true; - Main.tileFrameImportant[572] = true; - Main.tileNoAttach[572] = true; - Main.tileLavaDeath[572] = true; - Main.tileLighted[572] = true; - Main.tileFrameImportant[560] = true; - Main.tileLavaDeath[560] = true; - Main.tileFrameImportant[564] = true; - Main.tileNoAttach[564] = true; - Main.tileLavaDeath[564] = true; - Main.tileLighted[564] = true; - Main.tileFrameImportant[567] = true; - Main.tileLavaDeath[567] = true; - Main.tileFrameImportant[565] = true; - Main.tileNoAttach[565] = true; - Main.tileLavaDeath[565] = true; - Main.tileFrameImportant[593] = true; - Main.tileNoAttach[593] = true; - Main.tileLavaDeath[593] = false; - Main.tileLighted[593] = true; - Main.tileFrameImportant[594] = true; - Main.tileNoAttach[594] = true; - Main.tileLavaDeath[594] = false; - Main.tileLighted[594] = true; - Main.tileLighted[548] = true; - Main.tileLighted[613] = true; - Main.tileLighted[614] = true; - Main.tileFrameImportant[518] = true; - Main.tileCut[518] = true; - Main.tileNoFail[518] = true; - Main.tileFrameImportant[519] = true; - Main.tileCut[519] = true; - Main.tileNoFail[519] = true; - Main.tileLighted[519] = true; - Main.tileFrameImportant[549] = true; - Main.tileCut[549] = true; - Main.tileNoFail[549] = true; - Main.tileFrameImportant[529] = true; - Main.tileCut[529] = true; - Main.tileNoFail[529] = true; - Main.tileLavaDeath[529] = true; - Main.tileFrameImportant[530] = true; - Main.tileNoFail[530] = true; - Main.tileLavaDeath[530] = true; Main.tileFrameImportant[233] = true; - Main.tileFrameImportant[485] = true; Main.tileLighted[215] = true; Main.tileFrameImportant[227] = true; Main.tileFrameImportant[228] = true; @@ -5427,9 +5669,6 @@ label_127: Main.tileFrameImportant[136] = true; Main.tileFrameImportant[137] = true; Main.tileFrameImportant[138] = true; - Main.tileFrameImportant[484] = true; - Main.tileLavaDeath[484] = true; - Main.tileNoFail[484] = true; Main.tileBlockLight[137] = true; Main.tileSolid[137] = true; Main.tileBlockLight[160] = true; @@ -5449,8 +5688,6 @@ label_127: Main.tileSolid[148] = true; Main.tileMergeDirt[148] = true; Main.tileSolid[138] = true; - Main.tileSolid[484] = true; - Main.tileCut[484] = true; Main.tileBlockLight[140] = true; Main.tileSolid[140] = true; Main.tileBlockLight[151] = true; @@ -5482,7 +5719,6 @@ label_127: Main.tileSolid[159] = true; Main.tileMergeDirt[159] = true; Main.tileFrameImportant[320] = true; - Main.tileFrameImportant[49] = true; Main.tileShine[22] = 1150; Main.tileShine[6] = 1150; Main.tileShine[7] = 1100; @@ -5492,7 +5728,6 @@ label_127: Main.tileShine[167] = 1075; Main.tileShine[168] = 1025; Main.tileShine[169] = 975; - Main.tileShine[617] = 400; Main.tileShine[178] = 500; Main.tileShine2[178] = true; Main.tileShine[12] = 300; @@ -5506,7 +5741,6 @@ label_127: Main.tileShine[66] = 900; Main.tileShine[67] = 900; Main.tileShine[68] = 900; - Main.tileShine[566] = 900; Main.tileShine[45] = 1900; Main.tileShine[46] = 2000; Main.tileShine[47] = 2100; @@ -5521,7 +5755,7 @@ label_127: Main.tileShine[107] = 950; Main.tileShine[108] = 900; Main.tileShine[111] = 850; - Main.tileShine[211] = 500; + Main.tileShine[211] = 800; Main.tileLighted[4] = true; Main.tileLighted[17] = true; Main.tileLighted[133] = true; @@ -5556,8 +5790,6 @@ label_127: Main.tileLighted[140] = true; Main.tileLighted[270] = true; Main.tileLighted[271] = true; - Main.tileLighted[581] = true; - Main.tileLighted[578] = true; Main.tileMergeDirt[1] = true; Main.tileMergeDirt[6] = true; Main.tileMergeDirt[7] = true; @@ -5592,12 +5824,9 @@ label_127: Main.tileMergeDirt[47] = true; Main.tileMergeDirt[46] = true; Main.tileMergeDirt[45] = true; - Main.tileMergeDirt[41] = true; - Main.tileMergeDirt[43] = true; Main.tileMergeDirt[44] = true; - Main.tileMergeDirt[481] = true; - Main.tileMergeDirt[482] = true; - Main.tileMergeDirt[483] = true; + Main.tileMergeDirt[43] = true; + Main.tileMergeDirt[41] = true; Main.tileFrameImportant[380] = true; Main.tileFrameImportant[201] = true; Main.tileFrameImportant[3] = true; @@ -5609,13 +5838,7 @@ label_127: Main.tileFrameImportant[13] = true; Main.tileFrameImportant[14] = true; Main.tileFrameImportant[469] = true; - Main.tileFrameImportant[486] = true; - Main.tileFrameImportant[488] = true; - Main.tileFrameImportant[487] = true; - Main.tileFrameImportant[489] = true; - Main.tileFrameImportant[490] = true; Main.tileFrameImportant[15] = true; - Main.tileFrameImportant[497] = true; Main.tileFrameImportant[16] = true; Main.tileFrameImportant[17] = true; Main.tileFrameImportant[18] = true; @@ -5693,42 +5916,13 @@ label_127: Main.tileFrameImportant[378] = true; Main.tileFrameImportant[425] = true; Main.tileFrameImportant[465] = true; - Main.tileFrameImportant[506] = true; - Main.tileFrameImportant[510] = true; - Main.tileFrameImportant[511] = true; - Main.tileFrameImportant[531] = true; - Main.tileFrameImportant[545] = true; - Main.tileFrameImportant[547] = true; - Main.tileFrameImportant[548] = true; - Main.tileFrameImportant[552] = true; - Main.tileFrameImportant[573] = true; - Main.tileFrameImportant[613] = true; - Main.tileFrameImportant[614] = true; - Main.tileFrameImportant[621] = true; - Main.tileFrameImportant[622] = true; Main.tileFrameImportant[141] = true; Main.tileFrameImportant[270] = true; Main.tileFrameImportant[271] = true; - Main.tileFrameImportant[581] = true; Main.tileFrameImportant[314] = true; Main.tileSolidTop[376] = true; Main.tileTable[376] = true; Main.tileTable[380] = true; - Main.tileFrameImportant[583] = true; - Main.tileFrameImportant[584] = true; - Main.tileFrameImportant[585] = true; - Main.tileFrameImportant[586] = true; - Main.tileFrameImportant[587] = true; - Main.tileFrameImportant[588] = true; - Main.tileFrameImportant[589] = true; - Main.tileFrameImportant[590] = true; - Main.tileNoAttach[590] = true; - Main.tileFrameImportant[595] = true; - Main.tileNoAttach[595] = true; - Main.tileFrameImportant[596] = true; - Main.tileFrameImportant[615] = true; - Main.tileNoAttach[615] = true; - Main.tileFrameImportant[616] = true; Main.tileCut[201] = true; Main.tileCut[3] = true; Main.tileCut[24] = true; @@ -5752,10 +5946,7 @@ label_127: Main.tileCut[205] = true; Main.tileCut[352] = true; Main.tileCut[382] = true; - Main.tileCut[528] = true; - Main.tileLighted[528] = true; Main.tileCut[444] = true; - Main.tileCut[485] = true; Main.tileAlch[82] = true; Main.tileAlch[83] = true; Main.tileAlch[84] = true; @@ -5867,12 +6058,6 @@ label_127: Main.tileBlockLight[43] = true; Main.tileSolid[44] = true; Main.tileBlockLight[44] = true; - Main.tileSolid[481] = true; - Main.tileBlockLight[481] = true; - Main.tileSolid[482] = true; - Main.tileBlockLight[482] = true; - Main.tileSolid[483] = true; - Main.tileBlockLight[483] = true; Main.tileSolid[45] = true; Main.tileBlockLight[45] = true; Main.tileSolid[46] = true; @@ -5880,6 +6065,7 @@ label_127: Main.tileSolid[47] = true; Main.tileBlockLight[47] = true; Main.tileSolid[48] = true; + Main.tileBlockLight[48] = true; Main.tileSolid[53] = true; Main.tileBlockLight[53] = true; Main.tileSolid[54] = true; @@ -5915,9 +6101,6 @@ label_127: Main.tileSolid[68] = true; Main.tileBlockLight[68] = true; Main.tileStone[68] = true; - Main.tileSolid[566] = true; - Main.tileBlockLight[566] = true; - Main.tileStone[566] = true; Main.tileSolid[75] = true; Main.tileBlockLight[75] = true; Main.tileSolid[76] = true; @@ -5945,13 +6128,7 @@ label_127: Main.tileNoAttach[13] = true; Main.tileNoAttach[14] = true; Main.tileNoAttach[469] = true; - Main.tileNoAttach[486] = true; - Main.tileNoAttach[488] = true; - Main.tileNoAttach[487] = true; - Main.tileNoAttach[489] = true; - Main.tileNoAttach[490] = true; Main.tileNoAttach[15] = true; - Main.tileNoAttach[497] = true; Main.tileNoAttach[16] = true; Main.tileNoAttach[134] = true; Main.tileNoAttach[17] = true; @@ -5991,12 +6168,12 @@ label_127: Main.tileNoAttach[93] = true; Main.tileLighted[190] = true; Main.tileBlockLight[192] = true; + Main.tileBrick[192] = false; Main.tileWaterDeath[215] = true; Main.tileWaterDeath[4] = true; Main.tileWaterDeath[51] = true; Main.tileWaterDeath[93] = true; Main.tileWaterDeath[98] = true; - Main.tileWaterDeath[552] = true; Main.tileLavaDeath[3] = true; Main.tileLavaDeath[5] = true; Main.tileLavaDeath[10] = true; @@ -6005,13 +6182,7 @@ label_127: Main.tileLavaDeath[13] = true; Main.tileLavaDeath[14] = true; Main.tileLavaDeath[469] = true; - Main.tileLavaDeath[486] = true; - Main.tileLavaDeath[488] = true; - Main.tileLavaDeath[487] = true; - Main.tileLavaDeath[489] = true; - Main.tileLavaDeath[490] = true; Main.tileLavaDeath[15] = true; - Main.tileLavaDeath[497] = true; Main.tileLavaDeath[16] = true; Main.tileLavaDeath[17] = true; Main.tileLavaDeath[18] = true; @@ -6104,7 +6275,6 @@ label_127: Main.tileLavaDeath[269] = true; Main.tileLavaDeath[270] = true; Main.tileLavaDeath[271] = true; - Main.tileLavaDeath[581] = true; Main.tileLavaDeath[275] = true; Main.tileLavaDeath[413] = true; Main.tileLavaDeath[276] = true; @@ -6141,19 +6311,16 @@ label_127: Main.tileLavaDeath[308] = true; Main.tileLavaDeath[309] = true; Main.tileLavaDeath[310] = true; - Main.tileLavaDeath[532] = true; Main.tileLavaDeath[316] = true; Main.tileLavaDeath[317] = true; Main.tileLavaDeath[318] = true; Main.tileLavaDeath[319] = true; Main.tileLavaDeath[354] = true; Main.tileLavaDeath[355] = true; - Main.tileLavaDeath[499] = true; Main.tileLavaDeath[323] = true; Main.tileLavaDeath[335] = true; Main.tileLavaDeath[338] = true; Main.tileLavaDeath[339] = true; - Main.tileLavaDeath[528] = true; Main.tileLavaDeath[352] = true; Main.tileLavaDeath[382] = true; Main.tileLavaDeath[425] = true; @@ -6162,26 +6329,14 @@ label_127: Main.tileLavaDeath[463] = true; Main.tileLavaDeath[464] = true; Main.tileLavaDeath[465] = true; - Main.tileLavaDeath[485] = true; - Main.tileLavaDeath[511] = true; - Main.tileLavaDeath[510] = true; - Main.tileLavaDeath[547] = true; - Main.tileLavaDeath[548] = true; - Main.tileLavaDeath[552] = true; - Main.tileLavaDeath[573] = true; - Main.tileLavaDeath[621] = true; - Main.tileLavaDeath[622] = true; Main.tileLighted[316] = true; Main.tileLighted[317] = true; Main.tileLighted[318] = true; - Main.tileFrameImportant[493] = true; - Main.tileLavaDeath[493] = true; - for (int index = 0; index < 623; ++index) + for (int index = 0; index < 470; ++index) { if (Main.tileLavaDeath[index]) Main.tileObsidianKill[index] = true; } - Main.tileObsidianKill[546] = true; Main.tileObsidianKill[77] = true; Main.tileObsidianKill[78] = true; Main.tileObsidianKill[82] = true; @@ -6204,16 +6359,11 @@ label_127: Main.tileObsidianKill[231] = true; Main.tileObsidianKill[337] = true; Main.tileObsidianKill[349] = true; - Main.tileObsidianKill[506] = true; - Main.tileObsidianKill[314] = true; Main.tileSolid[384] = true; Main.tileBlockLight[384] = true; Main.tileNoFail[384] = true; Main.tileFrameImportant[395] = true; Main.tileLavaDeath[395] = true; - Main.tileFrameImportant[520] = true; - Main.tileLavaDeath[520] = true; - Main.tileLavaDeath[471] = true; Main.tileFrameImportant[405] = true; Main.tileLavaDeath[405] = true; Main.tileSolidTop[405] = true; @@ -6225,19 +6375,17 @@ label_127: Main.tileFrameImportant[452] = true; Main.tileLavaDeath[452] = true; Main.tileFrameImportant[411] = true; - Main.tileLavaDeath[411] = false; + Main.tileLavaDeath[411] = true; Main.tileFrameImportant[457] = true; Main.tileLavaDeath[457] = true; Main.tileFrameImportant[462] = true; Main.tileFrameImportant[454] = true; Main.tileLavaDeath[454] = true; Main.tileCut[454] = true; - Main.tileFrameImportant[494] = true; - Main.tileLavaDeath[494] = true; Main.tileFrameImportant[455] = true; Main.tileFrameImportant[412] = true; - for (int index = 0; index < 316; ++index) - Main.wallBlend[index] = index != 20 ? (index != 19 ? (index != 18 ? (index != 17 ? (index == 16 || index == 59 || index == 261 ? 2 : (index == 1 || index >= 48 && index <= 53 ? 1 : index)) : 7) : 8) : 9) : 14; + for (int index = 0; index < 231; ++index) + Main.wallBlend[index] = index != 20 ? (index != 19 ? (index != 18 ? (index != 17 ? (index == 16 || index == 59 ? 2 : (index == 1 || index >= 48 && index <= 53 ? 1 : index)) : 7) : 8) : 9) : 14; Main.wallBlend[65] = 63; Main.wallBlend[66] = 63; Main.wallBlend[68] = 63; @@ -6279,8 +6427,6 @@ label_127: Main.tileNoFail[233] = true; Main.tileNoFail[352] = true; Main.tileNoFail[382] = true; - Main.tileNoFail[528] = true; - Main.tileNoFail[485] = true; Main.tileFrameImportant[387] = true; Main.tileSolid[387] = true; Main.tileBlockLight[387] = true; @@ -6297,14 +6443,13 @@ label_127: Main.tileFrameImportant[389] = true; Main.tileLavaDeath[389] = true; Main.tileNoSunLight[389] = true; - for (int index = 0; index < 623; ++index) + for (int index = 0; index < 470; ++index) { if (Main.tileSolid[index]) Main.tileNoSunLight[index] = true; Main.tileFrame[index] = 0; Main.tileFrameCounter[index] = 0; } - Main.tileNoSunLight[546] = false; Main.tileNoSunLight[379] = false; Main.tileNoSunLight[54] = false; Main.tileNoSunLight[328] = false; @@ -6313,1733 +6458,157 @@ label_127: Main.tileNoSunLight[11] = true; Main.tileNoSunLight[189] = false; Main.tileNoSunLight[196] = false; - Main.tileNoSunLight[48] = false; - Main.tileNoSunLight[232] = false; Main.tileNoSunLight[460] = false; - Main.tileNoSunLight[541] = false; - Main.tileNoSunLight[388] = false; - } - - private static void Initialize_TileAndNPCData1() - { - for (int index = 0; index < 623; ++index) - Main.tileGlowMask[index] = (short) -1; - for (int index = 0; index < 950; ++index) - Main.projFrames[index] = 1; - Main.projFrames[736] = 3; - Main.projFrames[737] = 3; - Main.projFrames[738] = 3; - Main.projFrames[779] = 4; - Main.projFrames[783] = 4; - Main.projFrames[862] = 4; - Main.projFrames[863] = 4; - Main.projFrames[820] = 4; - Main.projFrames[916] = 6; - Main.projFrames[34] = 6; - Main.projFrames[706] = 8; - Main.projFrames[712] = 8; - Main.projFrames[663] = 7; - Main.projFrames[665] = 9; - Main.projFrames[667] = 9; - Main.projFrames[677] = 6; - Main.projFrames[678] = 6; - Main.projFrames[679] = 6; - Main.projFrames[688] = 6; - Main.projFrames[689] = 6; - Main.projFrames[690] = 8; - Main.projFrames[691] = 4; - Main.projFrames[692] = 4; - Main.projFrames[693] = 4; - Main.projFrames[694] = 4; - Main.projFrames[695] = 4; - Main.projFrames[696] = 5; - Main.projFrames[700] = 4; - Main.projFrames[643] = 8; - Main.projFrames[566] = 4; - Main.projFrames[565] = 4; - Main.projFrames[525] = 5; - Main.projFrames[519] = 4; - Main.projFrames[509] = 2; - Main.projFrames[485] = 5; - Main.projFrames[492] = 8; - Main.projFrames[500] = 4; - Main.projFrames[499] = 12; - Main.projFrames[518] = 4; - Main.projFrames[585] = 4; - Main.projFrames[593] = 4; - Main.projFrames[595] = 28; - Main.projFrames[735] = 28; - Main.projFrames[596] = 4; - Main.projFrames[612] = 5; - Main.projFrames[613] = 4; - Main.projFrames[614] = 4; - Main.projFrames[615] = 7; - Main.projFrames[623] = 19; - Main.projFrames[633] = 5; - Main.projFrames[645] = 7; - Main.projFrames[650] = 4; - Main.projFrames[652] = 6; - Main.projFrames[659] = 4; - Main.projFrames[714] = 7; - Main.projFrames[734] = 8; - Main.projFrames[755] = 5; - Main.projFrames[759] = 5; - Main.projFrames[765] = 10; - Main.projFrames[384] = 6; - Main.projFrames[385] = 3; - Main.projFrames[386] = 6; - Main.projFrames[390] = 11; - Main.projFrames[391] = 11; - Main.projFrames[392] = 11; - Main.projFrames[393] = 15; - Main.projFrames[394] = 15; - Main.projFrames[395] = 15; - Main.projFrames[398] = 10; - Main.projFrames[407] = 6; - Main.projFrames[408] = 2; - Main.projFrames[409] = 3; - Main.projFrames[387] = 3; - Main.projFrames[388] = 3; - Main.projFrames[334] = 11; - Main.projFrames[324] = 10; - Main.projFrames[351] = 2; - Main.projFrames[349] = 5; - Main.projFrames[423] = 4; - Main.projFrames[435] = 4; - Main.projFrames[682] = 4; - Main.projFrames[436] = 4; - Main.projFrames[439] = 6; - Main.projFrames[443] = 4; - Main.projFrames[447] = 4; - Main.projFrames[448] = 3; - Main.projFrames[450] = 5; - Main.projFrames[454] = 2; - Main.projFrames[456] = 4; - Main.projFrames[459] = 3; - Main.projFrames[462] = 5; - Main.projFrames[465] = 4; - Main.projFrames[467] = 4; - Main.projFrames[468] = 4; - Main.projFrames[533] = 21; - Main.projFrames[535] = 12; - Main.projFrames[539] = 4; - Main.projFrames[575] = 4; - Main.projFrames[574] = 2; - Main.projFrames[634] = 4; - Main.projFrames[635] = 4; - Main.projFrames[709] = 3; - Main.projFrames[353] = 14; - Main.projFrames[346] = 2; - Main.projFrames[347] = 2; - Main.projFrames[335] = 4; - Main.projFrames[344] = 3; - Main.projFrames[337] = 5; - Main.projFrames[317] = 8; - Main.projFrames[321] = 3; - Main.projFrames[308] = 10; - Main.projFrames[316] = 4; - Main.projFrames[275] = 2; - Main.projFrames[276] = 2; - Main.projFrames[254] = 5; - Main.projFrames[307] = 2; - Main.projFrames[72] = 4; - Main.projFrames[86] = 4; - Main.projFrames[87] = 4; - Main.projFrames[102] = 2; - Main.projFrames[111] = 8; - Main.projFrames[112] = 3; - Main.projFrames[(int) sbyte.MaxValue] = 16; - Main.projFrames[175] = 2; - Main.projFrames[181] = 4; - Main.projFrames[189] = 4; - Main.projFrames[191] = 18; - Main.projFrames[192] = 18; - Main.projFrames[193] = 18; - Main.projFrames[194] = 18; - Main.projFrames[190] = 4; - Main.projFrames[198] = 4; - Main.projFrames[199] = 8; - Main.projFrames[200] = 10; - Main.projFrames[206] = 5; - Main.projFrames[208] = 5; - Main.projFrames[209] = 12; - Main.projFrames[210] = 12; - Main.projFrames[211] = 10; - Main.projFrames[221] = 3; - Main.projFrames[237] = 4; - Main.projFrames[238] = 6; - Main.projFrames[221] = 3; - Main.projFrames[228] = 5; - Main.projFrames[229] = 4; - Main.projFrames[236] = 13; - Main.projFrames[243] = 4; - Main.projFrames[244] = 6; - Main.projFrames[249] = 5; - Main.projFrames[252] = 4; - Main.projFrames[266] = 6; - Main.projFrames[268] = 8; - Main.projFrames[269] = 7; - Main.projFrames[270] = 3; - Main.projFrames[313] = 12; - Main.projFrames[314] = 13; - Main.projFrames[319] = 11; - Main.projFrames[373] = 3; - Main.projFrames[375] = 8; - Main.projFrames[377] = 9; - Main.projFrames[379] = 4; - Main.projFrames[380] = 4; - Main.projFrames[601] = 2; - Main.projFrames[602] = 4; - Main.projFrames[703] = 8; - Main.projFrames[701] = 3; - Main.projFrames[702] = 4; - Main.projFrames[732] = 4; - Main.projFrames[731] = 4; - Main.projFrames[758] = 24; - Main.projFrames[766] = 4; - Main.projFrames[767] = 4; - Main.projFrames[768] = 4; - Main.projFrames[769] = 4; - Main.projFrames[770] = 4; - Main.projFrames[774] = 8; - Main.projFrames[773] = 4; - Main.projFrames[815] = 10; - Main.projFrames[816] = 17; - Main.projFrames[817] = 18; - Main.projFrames[821] = 23; - Main.projFrames[824] = 4; - Main.projFrames[825] = 26; - Main.projFrames[826] = 3; - Main.projFrames[828] = 2; - Main.projFrames[829] = 2; - Main.projFrames[831] = 6; - Main.projFrames[833] = 10; - Main.projFrames[834] = 12; - Main.projFrames[835] = 12; - Main.projFrames[836] = 4; - Main.projFrames[837] = 3; - Main.projFrames[839] = 4; - Main.projFrames[840] = 4; - Main.projFrames[851] = 4; - Main.projFrames[853] = 4; - Main.projFrames[854] = 19; - Main.projFrames[855] = 4; - Main.projFrames[858] = 14; - Main.projFrames[859] = 24; - Main.projFrames[860] = 14; - Main.projFrames[861] = 4; - Main.projFrames[864] = 2; - Main.projFrames[866] = 4; - Main.projFrames[870] = 4; - Main.projFrames[875] = 11; - Main.projFrames[881] = 12; - Main.projFrames[882] = 20; - Main.projFrames[883] = 3; - Main.projFrames[884] = 14; - Main.projFrames[885] = 10; - Main.projFrames[886] = 8; - Main.projFrames[887] = 3; - Main.projFrames[888] = 36; - Main.projFrames[889] = 11; - Main.projFrames[890] = 12; - Main.projFrames[891] = 15; - Main.projFrames[892] = 6; - Main.projFrames[893] = 4; - Main.projFrames[894] = 8; - Main.projFrames[895] = 6; - Main.projFrames[896] = 16; - Main.projFrames[897] = 11; - Main.projFrames[898] = 16; - Main.projFrames[899] = 14; - Main.projFrames[900] = 14; - Main.projFrames[901] = 12; - Main.projFrames[908] = 12; - Main.projFrames[909] = 6; - Main.projFrames[920] = 3; - Main.projFrames[934] = 12; - Main.projFrames[880] = 8; - Main.projFrames[929] = 8; - Main.projPet[492] = true; - Main.projPet[499] = true; - Main.projPet[653] = true; - Main.projPet[701] = true; - Main.projPet[703] = true; - Main.projPet[702] = true; - Main.projPet[764] = true; - Main.projPet[765] = true; - Main.projPet[319] = true; - Main.projPet[334] = true; - Main.projPet[324] = true; - Main.projPet[266] = true; - Main.projPet[313] = true; - Main.projPet[314] = true; - Main.projPet[317] = true; - Main.projPet[175] = true; - Main.projPet[111] = true; - Main.projPet[112] = true; - Main.projPet[(int) sbyte.MaxValue] = true; - Main.projPet[191] = true; - Main.projPet[192] = true; - Main.projPet[193] = true; - Main.projPet[194] = true; - Main.projPet[197] = true; - Main.projPet[198] = true; - Main.projPet[199] = true; - Main.projPet[200] = true; - Main.projPet[208] = true; - Main.projPet[209] = true; - Main.projPet[210] = true; - Main.projPet[211] = true; - Main.projPet[236] = true; - Main.projPet[268] = true; - Main.projPet[269] = true; - Main.projPet[353] = true; - Main.projPet[373] = true; - Main.projPet[375] = true; - Main.projPet[380] = true; - Main.projPet[387] = true; - Main.projPet[388] = true; - Main.projPet[390] = true; - Main.projPet[391] = true; - Main.projPet[392] = true; - Main.projPet[393] = true; - Main.projPet[394] = true; - Main.projPet[395] = true; - Main.projPet[398] = true; - Main.projPet[407] = true; - Main.projPet[423] = true; - Main.projPet[533] = true; - Main.projPet[613] = true; - Main.projPet[623] = true; - Main.projPet[625] = true; - Main.projPet[626] = true; - Main.projPet[627] = true; - Main.projPet[628] = true; - Main.projPet[755] = true; - Main.projPet[758] = true; - Main.projPet[759] = true; - Main.projPet[774] = true; - Main.projPet[815] = true; - Main.projPet[816] = true; - Main.projPet[817] = true; - Main.projPet[821] = true; - Main.projPet[825] = true; - Main.projPet[831] = true; - Main.projPet[833] = true; - Main.projPet[834] = true; - Main.projPet[835] = true; - Main.projPet[854] = true; - Main.projPet[858] = true; - Main.projPet[859] = true; - Main.projPet[860] = true; - Main.projPet[864] = true; - Main.projPet[875] = true; - Main.projPet[946] = true; - Main.projPet[881] = true; - Main.projPet[882] = true; - Main.projPet[883] = true; - Main.projPet[884] = true; - Main.projPet[885] = true; - Main.projPet[886] = true; - Main.projPet[887] = true; - Main.projPet[888] = true; - Main.projPet[889] = true; - Main.projPet[890] = true; - Main.projPet[891] = true; - Main.projPet[892] = true; - Main.projPet[893] = true; - Main.projPet[894] = true; - Main.projPet[895] = true; - Main.projPet[896] = true; - Main.projPet[897] = true; - Main.projPet[898] = true; - Main.projPet[899] = true; - Main.projPet[900] = true; - Main.projPet[901] = true; - Main.projPet[934] = true; - Main.tileLighted[237] = true; - Main.tileLighted[27] = true; - Main.tileLighted[381] = true; - Main.tileLighted[534] = true; - Main.tileLighted[536] = true; - Main.tileLighted[539] = true; - Main.tileLighted[184] = true; - Main.tileLighted[463] = true; - Main.tileLighted[491] = true; - Main.slimeRainNPC[1] = true; - Main.debuff[158] = true; - Main.debuff[160] = true; - Main.debuff[20] = true; - Main.debuff[21] = true; - Main.debuff[22] = true; - Main.debuff[23] = true; - Main.debuff[24] = true; - Main.debuff[25] = true; - Main.debuff[28] = true; - Main.debuff[30] = true; - Main.debuff[31] = true; - Main.debuff[32] = true; - Main.debuff[33] = true; - Main.debuff[34] = true; - Main.debuff[35] = true; - Main.debuff[36] = true; - Main.debuff[37] = true; - Main.debuff[38] = true; - Main.debuff[39] = true; - Main.debuff[44] = true; - Main.debuff[46] = true; - Main.debuff[47] = true; - Main.debuff[67] = true; - Main.debuff[68] = true; - Main.debuff[69] = true; - Main.debuff[70] = true; - Main.debuff[80] = true; - Main.debuff[86] = true; - Main.debuff[87] = true; - Main.debuff[88] = true; - Main.debuff[89] = true; - Main.debuff[94] = true; - Main.debuff[103] = true; - Main.debuff[119] = true; - Main.debuff[120] = true; - Main.debuff[137] = true; - Main.debuff[145] = true; - Main.debuff[146] = true; - Main.debuff[147] = true; - Main.debuff[148] = true; - Main.debuff[149] = true; - Main.debuff[156] = true; - Main.debuff[157] = true; - Main.debuff[163] = true; - Main.debuff[164] = true; - Main.debuff[144] = true; - Main.debuff[194] = true; - Main.debuff[195] = true; - Main.debuff[196] = true; - Main.debuff[197] = true; - Main.debuff[199] = true; - Main.debuff[215] = true; - Main.debuff[320] = true; - Main.debuff[321] = true; - Main.pvpBuff[20] = true; - Main.pvpBuff[24] = true; - Main.pvpBuff[31] = true; - Main.pvpBuff[39] = true; - Main.pvpBuff[44] = true; - Main.pvpBuff[20] = true; - Main.pvpBuff[69] = true; - Main.pvpBuff[103] = true; - Main.pvpBuff[119] = true; - Main.pvpBuff[120] = true; - Main.pvpBuff[137] = true; - Main.pvpBuff[320] = true; - Main.meleeBuff[71] = true; - Main.meleeBuff[73] = true; - Main.meleeBuff[74] = true; - Main.meleeBuff[75] = true; - Main.meleeBuff[76] = true; - Main.meleeBuff[77] = true; - Main.meleeBuff[78] = true; - Main.meleeBuff[79] = true; - Main.buffNoSave[20] = true; - Main.buffNoSave[22] = true; - Main.buffNoSave[23] = true; - Main.buffNoSave[24] = true; - Main.buffNoSave[28] = true; - Main.buffNoSave[30] = true; - Main.buffNoSave[31] = true; - Main.buffNoSave[34] = true; - Main.buffNoSave[35] = true; - Main.buffNoSave[37] = true; - Main.buffNoSave[38] = true; - Main.buffNoSave[39] = true; - Main.buffNoSave[43] = true; - Main.buffNoSave[44] = true; - Main.buffNoSave[46] = true; - Main.buffNoSave[47] = true; - Main.buffNoSave[48] = true; - Main.buffNoSave[58] = true; - Main.buffNoSave[59] = true; - Main.buffNoSave[60] = true; - Main.buffNoSave[62] = true; - Main.buffNoSave[63] = true; - Main.buffNoSave[64] = true; - Main.buffNoSave[67] = true; - Main.buffNoSave[68] = true; - Main.buffNoSave[69] = true; - Main.buffNoSave[70] = true; - Main.buffNoSave[72] = true; - Main.buffNoSave[80] = true; - Main.buffNoSave[87] = true; - Main.buffNoSave[158] = true; - Main.buffNoSave[146] = true; - Main.buffNoSave[147] = true; - Main.buffNoSave[215] = true; - Main.buffNoSave[88] = true; - Main.buffNoSave[89] = true; - Main.buffNoSave[94] = true; - Main.buffNoSave[95] = true; - Main.buffNoSave[96] = true; - Main.buffNoSave[97] = true; - Main.buffNoSave[98] = true; - Main.buffNoSave[99] = true; - Main.buffNoSave[100] = true; - Main.buffNoSave[103] = true; - Main.buffNoSave[118] = true; - Main.buffNoSave[138] = true; - Main.buffNoSave[167] = true; - Main.buffNoSave[166] = true; - Main.buffNoSave[184] = true; - Main.buffNoSave[185] = true; - Main.buffNoSave[211] = true; - Main.buffNoSave[210] = true; - Main.buffNoSave[119] = true; - Main.buffNoSave[120] = true; - Main.buffNoSave[90] = true; - Main.buffNoSave[125] = true; - Main.buffNoSave[126] = true; - Main.buffNoSave[128] = true; - Main.buffNoSave[129] = true; - Main.buffNoSave[130] = true; - Main.buffNoSave[131] = true; - Main.buffNoSave[132] = true; - Main.buffNoSave[133] = true; - Main.buffNoSave[134] = true; - Main.buffNoSave[135] = true; - Main.buffNoSave[139] = true; - Main.buffNoSave[140] = true; - Main.buffNoSave[141] = true; - Main.buffNoSave[142] = true; - Main.buffNoSave[143] = true; - Main.buffNoSave[137] = true; - Main.buffNoSave[144] = true; - Main.buffNoSave[161] = true; - Main.buffNoSave[162] = true; - Main.buffNoSave[163] = true; - Main.buffNoSave[164] = true; - Main.buffNoSave[168] = true; - Main.buffNoSave[170] = true; - Main.buffNoSave[171] = true; - Main.buffNoSave[172] = true; - Main.buffNoSave[182] = true; - Main.buffNoSave[187] = true; - Main.buffNoSave[188] = true; - Main.buffNoSave[193] = true; - Main.buffNoSave[194] = true; - Main.buffNoSave[195] = true; - Main.buffNoSave[196] = true; - Main.buffNoSave[197] = true; - Main.buffNoSave[198] = true; - Main.buffNoSave[199] = true; - Main.buffNoSave[205] = true; - Main.buffNoSave[212] = true; - Main.buffNoSave[213] = true; - Main.buffNoSave[214] = true; - Main.buffNoSave[230] = true; - Main.buffNoSave[263] = true; - Main.buffNoSave[265] = true; - Main.buffNoSave[271] = true; - Main.buffNoSave[322] = true; - Main.buffNoSave[275] = true; - Main.buffNoSave[276] = true; - Main.buffNoSave[277] = true; - Main.buffNoSave[278] = true; - Main.buffNoSave[279] = true; - Main.buffNoSave[280] = true; - Main.buffNoSave[281] = true; - Main.buffNoSave[282] = true; - Main.buffNoSave[283] = true; - Main.buffNoSave[305] = true; - Main.buffNoSave[318] = true; - Main.buffNoSave[320] = true; - Main.buffNoSave[321] = true; - for (int index = 173; index <= 181; ++index) - Main.buffNoSave[index] = true; - Main.buffNoTimeDisplay[19] = true; - Main.buffNoTimeDisplay[27] = true; - Main.buffNoTimeDisplay[28] = true; - Main.buffNoTimeDisplay[34] = true; - Main.buffNoTimeDisplay[37] = true; - Main.buffNoTimeDisplay[38] = true; - Main.buffNoTimeDisplay[40] = true; - Main.buffNoTimeDisplay[41] = true; - Main.buffNoTimeDisplay[42] = true; - Main.buffNoTimeDisplay[43] = true; - Main.buffNoTimeDisplay[45] = true; - Main.buffNoTimeDisplay[49] = true; - Main.buffNoTimeDisplay[60] = true; - Main.buffNoTimeDisplay[62] = true; - Main.buffNoTimeDisplay[64] = true; - Main.buffNoTimeDisplay[68] = true; - Main.buffNoTimeDisplay[81] = true; - Main.buffNoTimeDisplay[82] = true; - Main.buffNoTimeDisplay[83] = true; - Main.buffNoTimeDisplay[90] = true; - Main.buffNoTimeDisplay[95] = true; - Main.buffNoTimeDisplay[96] = true; - Main.buffNoTimeDisplay[97] = true; - Main.buffNoTimeDisplay[98] = true; - Main.buffNoTimeDisplay[99] = true; - Main.buffNoTimeDisplay[100] = true; - Main.buffNoTimeDisplay[101] = true; - Main.buffNoTimeDisplay[102] = true; - Main.buffNoTimeDisplay[118] = true; - Main.buffNoTimeDisplay[138] = true; - Main.buffNoTimeDisplay[167] = true; - Main.buffNoTimeDisplay[166] = true; - Main.buffNoTimeDisplay[184] = true; - Main.buffNoTimeDisplay[185] = true; - Main.buffNoTimeDisplay[211] = true; - Main.buffNoTimeDisplay[210] = true; - Main.buffNoTimeDisplay[125] = true; - Main.buffNoTimeDisplay[126] = true; - Main.buffNoTimeDisplay[128] = true; - Main.buffNoTimeDisplay[129] = true; - Main.buffNoTimeDisplay[130] = true; - Main.buffNoTimeDisplay[131] = true; - Main.buffNoTimeDisplay[132] = true; - Main.buffNoTimeDisplay[133] = true; - Main.buffNoTimeDisplay[134] = true; - Main.buffNoTimeDisplay[135] = true; - Main.buffNoTimeDisplay[136] = true; - Main.buffNoTimeDisplay[139] = true; - Main.buffNoTimeDisplay[140] = true; - Main.buffNoTimeDisplay[141] = true; - Main.buffNoTimeDisplay[142] = true; - Main.buffNoTimeDisplay[143] = true; - Main.buffNoTimeDisplay[137] = true; - Main.buffNoTimeDisplay[200] = true; - Main.buffNoTimeDisplay[202] = true; - Main.buffNoTimeDisplay[201] = true; - Main.buffNoTimeDisplay[161] = true; - Main.buffNoTimeDisplay[162] = true; - Main.buffNoTimeDisplay[163] = true; - Main.buffNoTimeDisplay[168] = true; - Main.buffNoTimeDisplay[170] = true; - Main.buffNoTimeDisplay[171] = true; - Main.buffNoTimeDisplay[172] = true; - Main.buffNoTimeDisplay[182] = true; - Main.buffNoTimeDisplay[165] = true; - Main.buffNoTimeDisplay[186] = true; - Main.buffNoTimeDisplay[187] = true; - Main.buffNoTimeDisplay[188] = true; - Main.buffNoTimeDisplay[193] = true; - Main.buffNoTimeDisplay[199] = true; - Main.buffNoTimeDisplay[212] = true; - Main.buffNoTimeDisplay[213] = true; - Main.buffNoTimeDisplay[214] = true; - Main.buffNoTimeDisplay[216] = true; - Main.buffNoTimeDisplay[217] = true; - Main.buffNoTimeDisplay[219] = true; - Main.buffNoTimeDisplay[230] = true; - Main.buffNoTimeDisplay[258] = true; - Main.buffNoTimeDisplay[259] = true; - Main.buffNoTimeDisplay[260] = true; - Main.buffNoTimeDisplay[261] = true; - Main.buffNoTimeDisplay[262] = true; - Main.buffNoTimeDisplay[263] = true; - Main.buffNoTimeDisplay[264] = true; - Main.buffNoTimeDisplay[265] = true; - Main.buffNoTimeDisplay[266] = true; - Main.buffNoTimeDisplay[267] = true; - Main.buffNoTimeDisplay[268] = true; - Main.buffNoTimeDisplay[271] = true; - Main.buffNoTimeDisplay[322] = true; - Main.buffNoTimeDisplay[274] = true; - Main.buffNoTimeDisplay[275] = true; - Main.buffNoTimeDisplay[276] = true; - Main.buffNoTimeDisplay[277] = true; - Main.buffNoTimeDisplay[278] = true; - Main.buffNoTimeDisplay[279] = true; - Main.buffNoTimeDisplay[280] = true; - Main.buffNoTimeDisplay[281] = true; - Main.buffNoTimeDisplay[282] = true; - Main.buffNoTimeDisplay[283] = true; - Main.buffNoTimeDisplay[284] = true; - Main.buffNoTimeDisplay[285] = true; - Main.buffNoTimeDisplay[286] = true; - Main.buffNoTimeDisplay[287] = true; - Main.buffNoTimeDisplay[288] = true; - Main.buffNoTimeDisplay[289] = true; - Main.buffNoTimeDisplay[290] = true; - Main.buffNoTimeDisplay[291] = true; - Main.buffNoTimeDisplay[292] = true; - Main.buffNoTimeDisplay[293] = true; - Main.buffNoTimeDisplay[294] = true; - Main.buffNoTimeDisplay[295] = true; - Main.buffNoTimeDisplay[296] = true; - Main.buffNoTimeDisplay[297] = true; - Main.buffNoTimeDisplay[298] = true; - Main.buffNoTimeDisplay[299] = true; - Main.buffNoTimeDisplay[300] = true; - Main.buffNoTimeDisplay[301] = true; - Main.buffNoTimeDisplay[302] = true; - Main.buffNoTimeDisplay[303] = true; - Main.buffNoTimeDisplay[304] = true; - Main.buffNoTimeDisplay[305] = true; - Main.buffNoTimeDisplay[317] = true; - Main.buffNoTimeDisplay[318] = true; - Main.buffNoTimeDisplay[320] = true; - Main.persistentBuff[71] = true; - Main.persistentBuff[73] = true; - Main.persistentBuff[74] = true; - Main.persistentBuff[75] = true; - Main.persistentBuff[76] = true; - Main.persistentBuff[77] = true; - Main.persistentBuff[78] = true; - Main.persistentBuff[79] = true; - for (int index = 0; index < BuffID.Sets.BasicMountData.Length; ++index) + for (int index = 0; index < Main.maxMenuItems; ++index) + this.menuItemScale[index] = 0.8f; + for (int index = 0; index < 6001; ++index) { - if (BuffID.Sets.BasicMountData[index] != null) + Main.dust[index] = new Dust(); + Main.dust[index].dustIndex = index; + } + for (int index = 0; index < 401; ++index) + Main.item[index] = new Item(); + for (int index = 0; index < 201; ++index) + { + Main.npc[index] = new NPC(); + Main.npc[index].whoAmI = index; + } + for (int index = 0; index < 256; ++index) + Main.player[index] = new Player(); + for (int index = 0; index < 1001; ++index) + Main.projectile[index] = new Projectile(); + for (int index = 0; index < 501; ++index) + Main.gore[index] = new Gore(); + for (int index = 0; index < Main.maxRain + 1; ++index) + Main.rain[index] = new Rain(); + for (int index = 0; index < 200; ++index) + Main.cloud[index] = new Cloud(); + for (int index = 0; index < 100; ++index) + Main.combatText[index] = new CombatText(); + for (int index = 0; index < 20; ++index) + Main.itemText[index] = new ItemText(); + for (int Type = 0; Type < 3930; ++Type) + { + Item obj = new Item(); + obj.SetDefaults(Type); + if (obj.headSlot > 0) + Item.headType[obj.headSlot] = obj.type; + if (obj.bodySlot > 0) + Item.bodyType[obj.bodySlot] = obj.type; + if (obj.legSlot > 0) + Item.legType[obj.legSlot] = obj.type; + switch (obj.type) { - Main.buffNoTimeDisplay[index] = true; - Main.buffNoSave[index] = true; + case 683: + case 723: + case 726: + case 739: + case 740: + case 741: + case 742: + case 743: + case 744: + case 788: + case 1308: + case 1326: + case 1444: + case 1445: + case 1446: + case 1801: + case 1930: + case 1931: + case 2188: + case 2750: + case 3006: + case 3051: + case 3209: + case 3210: + case 3377: + case 3476: + case 3569: + case 3571: + case 3787: + case 3852: + case 3870: + Item.staff[obj.type] = true; + break; + case 1827: + case 3245: + Item.claw[obj.type] = true; + break; } } - Main.vanityPet[40] = true; - Main.vanityPet[41] = true; - Main.vanityPet[42] = true; - Main.vanityPet[45] = true; - Main.vanityPet[50] = true; - Main.vanityPet[51] = true; - Main.vanityPet[52] = true; - Main.vanityPet[53] = true; - Main.vanityPet[54] = true; - Main.vanityPet[55] = true; - Main.vanityPet[56] = true; - Main.vanityPet[61] = true; - Main.vanityPet[154] = true; - Main.vanityPet[65] = true; - Main.vanityPet[66] = true; - Main.vanityPet[81] = true; - Main.vanityPet[82] = true; - Main.vanityPet[84] = true; - Main.vanityPet[85] = true; - Main.vanityPet[91] = true; - Main.vanityPet[92] = true; - Main.vanityPet[(int) sbyte.MaxValue] = true; - Main.vanityPet[136] = true; - Main.vanityPet[191] = true; - Main.vanityPet[202] = true; - Main.vanityPet[200] = true; - Main.vanityPet[218] = true; - Main.vanityPet[219] = true; - Main.vanityPet[217] = true; - Main.vanityPet[258] = true; - Main.vanityPet[259] = true; - Main.vanityPet[260] = true; - Main.vanityPet[261] = true; - Main.vanityPet[262] = true; - Main.vanityPet[264] = true; - Main.vanityPet[266] = true; - Main.vanityPet[267] = true; - Main.vanityPet[268] = true; - Main.vanityPet[274] = true; - Main.vanityPet[284] = true; - Main.vanityPet[285] = true; - Main.vanityPet[286] = true; - Main.vanityPet[287] = true; - Main.vanityPet[288] = true; - Main.vanityPet[289] = true; - Main.vanityPet[290] = true; - Main.vanityPet[291] = true; - Main.vanityPet[292] = true; - Main.vanityPet[293] = true; - Main.vanityPet[295] = true; - Main.vanityPet[296] = true; - Main.vanityPet[297] = true; - Main.vanityPet[300] = true; - Main.vanityPet[301] = true; - Main.vanityPet[302] = true; - Main.vanityPet[303] = true; - Main.vanityPet[304] = true; - Main.vanityPet[317] = true; - Main.lightPet[19] = true; - Main.lightPet[155] = true; - Main.lightPet[27] = true; - Main.lightPet[101] = true; - Main.lightPet[102] = true; - Main.lightPet[57] = true; - Main.lightPet[190] = true; - Main.lightPet[152] = true; - Main.lightPet[201] = true; - Main.lightPet[294] = true; - Main.lightPet[298] = true; - Main.lightPet[299] = true; - Main.tileFlame[4] = true; - Main.tileFlame[33] = true; - Main.tileFlame[34] = true; - Main.tileFlame[35] = true; - Main.tileFlame[42] = true; - Main.tileFlame[49] = true; - Main.tileFlame[93] = true; - Main.tileFlame[98] = true; - Main.tileFlame[100] = true; - Main.tileFlame[173] = true; - Main.tileFlame[174] = true; - Main.tileFlame[372] = true; - Main.tileRope[213] = true; - Main.tileRope[214] = true; - Main.tileRope[353] = true; - Main.tileRope[365] = true; - Main.tileRope[366] = true; - Main.tileRope[504] = true; - Main.tileRope[449] = true; - Main.tileRope[450] = true; - Main.tileRope[451] = true; - Main.tilePile[330] = true; - Main.tilePile[331] = true; - Main.tilePile[332] = true; - Main.tilePile[333] = true; - for (int index = 0; index < 663; ++index) - Main.npcCatchable[index] = false; - Main.npcCatchable[46] = true; - Main.npcCatchable[55] = true; - Main.npcCatchable[74] = true; - Main.npcCatchable[148] = true; - Main.npcCatchable[149] = true; - Main.npcCatchable[297] = true; - Main.npcCatchable[298] = true; - Main.npcCatchable[299] = true; - Main.npcCatchable[300] = true; - Main.npcCatchable[355] = true; - Main.npcCatchable[356] = true; - Main.npcCatchable[357] = true; - Main.npcCatchable[358] = true; - Main.npcCatchable[359] = true; - Main.npcCatchable[360] = true; - Main.npcCatchable[361] = true; - Main.npcCatchable[362] = true; - Main.npcCatchable[363] = true; - Main.npcCatchable[364] = true; - Main.npcCatchable[365] = true; - Main.npcCatchable[366] = true; - Main.npcCatchable[367] = true; - Main.npcCatchable[374] = true; - Main.npcCatchable[377] = true; - Main.npcCatchable[539] = true; - Main.npcCatchable[538] = true; - Main.npcCatchable[484] = true; - Main.npcCatchable[485] = true; - Main.npcCatchable[486] = true; - Main.npcCatchable[487] = true; - Main.npcCatchable[583] = true; - Main.npcCatchable[584] = true; - Main.npcCatchable[585] = true; - Main.npcCatchable[592] = true; - Main.npcCatchable[593] = true; - Main.npcCatchable[595] = true; - Main.npcCatchable[596] = true; - Main.npcCatchable[597] = true; - Main.npcCatchable[598] = true; - Main.npcCatchable[599] = true; - Main.npcCatchable[600] = true; - Main.npcCatchable[601] = true; - Main.npcCatchable[604] = true; - Main.npcCatchable[605] = true; - Main.npcCatchable[602] = true; - Main.npcCatchable[603] = true; - Main.npcCatchable[606] = true; - Main.npcCatchable[607] = true; - Main.npcCatchable[608] = true; - Main.npcCatchable[609] = true; - Main.npcCatchable[610] = true; - Main.npcCatchable[611] = true; - Main.npcCatchable[612] = true; - Main.npcCatchable[613] = true; - Main.npcCatchable[614] = true; - Main.npcCatchable[616] = true; - Main.npcCatchable[617] = true; - Main.npcCatchable[626] = true; - Main.npcCatchable[627] = true; - Main.npcCatchable[639] = true; - Main.npcCatchable[640] = true; - Main.npcCatchable[641] = true; - Main.npcCatchable[642] = true; - Main.npcCatchable[643] = true; - Main.npcCatchable[644] = true; - Main.npcCatchable[645] = true; - Main.npcCatchable[646] = true; - Main.npcCatchable[647] = true; - Main.npcCatchable[648] = true; - Main.npcCatchable[649] = true; - Main.npcCatchable[650] = true; - Main.npcCatchable[651] = true; - Main.npcCatchable[652] = true; - Main.npcCatchable[653] = true; - Main.npcCatchable[654] = true; - Main.npcCatchable[655] = true; - Main.npcCatchable[661] = true; - for (int index = 442; index <= 448; ++index) - Main.npcCatchable[index] = true; - Main.SetTileValue(); - Main.tileSpelunker[6] = true; - Main.tileSpelunker[7] = true; - Main.tileSpelunker[8] = true; - Main.tileSpelunker[9] = true; - Main.tileSpelunker[12] = true; - Main.tileSpelunker[21] = true; - Main.tileSpelunker[467] = true; - Main.tileSpelunker[441] = true; - Main.tileSpelunker[468] = true; - Main.tileSpelunker[28] = true; - Main.tileSpelunker[107] = true; - Main.tileSpelunker[108] = true; - Main.tileSpelunker[111] = true; - Main.tileSpelunker[63] = true; - Main.tileSpelunker[64] = true; - Main.tileSpelunker[65] = true; - Main.tileSpelunker[66] = true; - Main.tileSpelunker[67] = true; - Main.tileSpelunker[68] = true; - Main.tileSpelunker[566] = true; - Main.tileSpelunker[166] = true; - Main.tileSpelunker[167] = true; - Main.tileSpelunker[168] = true; - Main.tileSpelunker[169] = true; - Main.tileSpelunker[178] = true; - Main.tileSpelunker[211] = true; - Main.tileSpelunker[221] = true; - Main.tileSpelunker[222] = true; - Main.tileSpelunker[223] = true; - Main.tileSpelunker[236] = true; - Main.tileSpelunker[37] = true; - Main.tileSpelunker[407] = true; - Main.tileSpelunker[227] = true; - Main.tileSpelunker[84] = true; - Main.tileSpelunker[83] = true; - Main.tileSpelunker[404] = true; - Main.SetupTileMerge(); - Main.tileSolid[379] = true; - Main.tileMergeDirt[249] = true; - Main.tileBrick[268] = true; - Main.tileBrick[262] = true; - Main.tileBrick[267] = true; - Main.tileBrick[265] = true; - Main.tileBrick[266] = true; - Main.tileBrick[264] = true; - Main.tileBrick[263] = true; - Main.tileSolid[371] = true; - Main.tileMergeDirt[371] = true; - Main.tileBlockLight[371] = true; - Main.tileBouncy[371] = true; - Main.tileBouncy[448] = true; - Main.tileBouncy[446] = true; - Main.tileBouncy[447] = true; - Main.tileFrameImportant[377] = true; - Main.tileFrameImportant[373] = true; - Main.tileFrameImportant[375] = true; - Main.tileFrameImportant[374] = true; - Main.tileFrameImportant[461] = true; - Main.tileLighted[372] = true; - Main.tileFrameImportant[372] = true; - Main.tileWaterDeath[372] = true; - Main.tileLavaDeath[372] = true; - Main.tileSolid[357] = true; - Main.tileBrick[357] = true; - Main.tileBrick[311] = true; - Main.tileSolid[408] = true; - Main.tileMergeDirt[408] = true; - Main.tileBrick[408] = true; - Main.tileSolid[409] = true; - Main.tileBrick[409] = true; - Main.tileSolid[415] = true; - Main.tileBrick[415] = true; - Main.tileLighted[415] = true; - Main.tileSolid[416] = true; - Main.tileBrick[416] = true; - Main.tileLighted[416] = true; - Main.tileSolid[417] = true; - Main.tileBrick[417] = true; - Main.tileLighted[417] = true; - Main.tileSolid[418] = true; - Main.tileBrick[418] = true; - Main.tileLighted[418] = true; - Main.tileSolid[498] = true; - Main.tileBrick[498] = true; - Main.tileBlockLight[498] = true; - Main.tileBrick[37] = true; - Main.tileBrick[117] = true; - Main.tileBrick[25] = true; - Main.tileBrick[203] = true; - Main.tileSolid[232] = true; - Main.tileSolid[311] = true; - Main.tileSolid[312] = true; - Main.tileSolid[313] = true; - Main.tileMergeDirt[311] = true; - Main.tileSolid[315] = true; - Main.tileMergeDirt[315] = true; - Main.tileSolid[321] = true; - Main.tileSolid[322] = true; - Main.tileBlockLight[321] = true; - Main.tileBlockLight[322] = true; - Main.tileMergeDirt[321] = true; - Main.tileMergeDirt[322] = true; - Main.tileBrick[321] = true; - Main.tileBrick[322] = true; - Main.tileShine[239] = 1100; - Main.tileSolid[239] = true; - Main.tileSolidTop[239] = true; - Main.tileSolid[380] = true; - Main.tileSolidTop[380] = true; - Main.tileFrameImportant[358] = true; - Main.tileFrameImportant[359] = true; - Main.tileFrameImportant[360] = true; - Main.tileFrameImportant[361] = true; - Main.tileFrameImportant[362] = true; - Main.tileFrameImportant[363] = true; - Main.tileFrameImportant[364] = true; - Main.tileFrameImportant[391] = true; - Main.tileLighted[391] = true; - Main.tileFrameImportant[392] = true; - Main.tileFrameImportant[393] = true; - Main.tileFrameImportant[394] = true; - Main.tileFrameImportant[542] = true; - Main.tileFrameImportant[505] = true; - Main.tileFrameImportant[521] = true; - Main.tileFrameImportant[522] = true; - Main.tileFrameImportant[523] = true; - Main.tileFrameImportant[524] = true; - Main.tileFrameImportant[525] = true; - Main.tileFrameImportant[526] = true; - Main.tileFrameImportant[527] = true; - Main.tileFrameImportant[543] = true; - Main.tileFrameImportant[568] = true; - Main.tileFrameImportant[569] = true; - Main.tileFrameImportant[570] = true; - Main.tileFrameImportant[598] = true; - Main.tileFrameImportant[356] = true; - Main.tileFrameImportant[334] = true; - Main.tileFrameImportant[440] = true; - Main.tileFrameImportant[471] = true; - Main.tileFrameImportant[300] = true; - Main.tileFrameImportant[301] = true; - Main.tileFrameImportant[302] = true; - Main.tileFrameImportant[303] = true; - Main.tileFrameImportant[304] = true; - Main.tileFrameImportant[305] = true; - Main.tileFrameImportant[306] = true; - Main.tileFrameImportant[307] = true; - Main.tileFrameImportant[308] = true; - Main.tileFrameImportant[354] = true; - Main.tileLighted[354] = true; - Main.tileFrameImportant[499] = true; - Main.tileFrameImportant[355] = true; - Main.tileFrameImportant[324] = true; - Main.tileObsidianKill[324] = true; - Main.tileLavaDeath[324] = true; - Main.tileFrameImportant[463] = true; - Main.tileFrameImportant[491] = true; - Main.tileFrameImportant[464] = true; - Main.tileFrameImportant[466] = true; - Main.tileFrameImportant[419] = true; - Main.tileFrameImportant[442] = true; - Main.tileFrameImportant[443] = true; - Main.tileFrameImportant[444] = true; - Main.tileFrameImportant[420] = true; - Main.tileFrameImportant[423] = true; - Main.tileFrameImportant[424] = true; - Main.tileFrameImportant[428] = true; - Main.tileFrameImportant[520] = true; - Main.tileFrameImportant[429] = true; - Main.tileFrameImportant[445] = true; - Main.tileFrameImportant[476] = true; - Main.tileFrameImportant[283] = true; - Main.tileFrameImportant[288] = true; - Main.tileFrameImportant[289] = true; - Main.tileFrameImportant[290] = true; - Main.tileFrameImportant[291] = true; - Main.tileFrameImportant[292] = true; - Main.tileFrameImportant[293] = true; - Main.tileFrameImportant[294] = true; - Main.tileFrameImportant[295] = true; - Main.tileFrameImportant[296] = true; - Main.tileFrameImportant[297] = true; - Main.tileFrameImportant[316] = true; - Main.tileFrameImportant[317] = true; - Main.tileFrameImportant[318] = true; - Main.tileLargeFrames[284] = (byte) 1; - Main.wallHouse[224] = true; - Main.wallLargeFrames[224] = (byte) 2; - Main.wallHouse[60] = true; - Main.wallHouse[225] = true; - Main.wallHouse[226] = true; - Main.wallHouse[227] = true; - Main.wallHouse[231] = true; - Main.wallHouse[232] = true; - Main.wallHouse[233] = true; - Main.wallHouse[235] = true; - Main.wallHouse[234] = true; - Main.wallHouse[312] = true; - Main.wallHouse[313] = true; - Main.wallHouse[237] = true; - Main.wallHouse[238] = true; - Main.wallHouse[239] = true; - Main.wallHouse[240] = true; - Main.tileLargeFrames[409] = (byte) 2; - Main.tileFrameImportant[410] = true; - Main.tileFrameImportant[480] = true; - Main.tileFrameImportant[509] = true; - Main.wallHouse[173] = true; - Main.wallHouse[183] = true; - Main.wallHouse[179] = true; - Main.wallLargeFrames[179] = (byte) 1; - Main.tileSolid[367] = true; - Main.tileBlockLight[367] = true; - Main.tileMergeDirt[367] = true; - Main.tileSolid[357] = true; - Main.tileBlockLight[357] = true; - Main.tileLargeFrames[357] = (byte) 1; - Main.tileBlendAll[357] = true; - Main.wallHouse[184] = true; - Main.wallHouse[181] = true; - Main.tileSolid[368] = true; - Main.tileBlockLight[368] = true; - Main.tileMergeDirt[368] = true; - Main.tileSolid[369] = true; - Main.tileBlockLight[369] = true; - Main.tileBrick[369] = true; - Main.tileMergeDirt[369] = true; - Main.wallHouse[186] = true; - Main.tileLargeFrames[325] = (byte) 1; - Main.tileSolid[325] = true; - Main.tileBlockLight[325] = true; - Main.wallLargeFrames[146] = (byte) 1; - Main.wallLargeFrames[147] = (byte) 1; - Main.wallLargeFrames[167] = (byte) 1; - Main.wallLargeFrames[185] = (byte) 2; - Main.wallLargeFrames[274] = (byte) 2; - Main.tileSolid[460] = true; - Main.tileSolid[326] = true; - Main.tileBlockLight[326] = true; - Main.tileBrick[326] = true; - Main.tileSolid[458] = true; - Main.tileBlockLight[458] = true; - Main.tileBrick[458] = true; - Main.tileSolid[459] = true; - Main.tileBrick[459] = true; - Main.tileSolid[327] = true; - Main.tileBlockLight[327] = true; - Main.tileBrick[327] = true; - Main.tileSolid[345] = true; - Main.tileBlockLight[345] = true; - Main.tileBrick[345] = true; - Main.tileLighted[327] = true; - Main.tileSolid[328] = true; - Main.tileBrick[328] = true; - Main.tileSolid[329] = true; - Main.tileBrick[329] = true; - Main.tileBlockLight[329] = true; - Main.tileSolid[507] = true; - Main.tileBlockLight[507] = true; - Main.tileBrick[507] = true; - Main.tileSolid[508] = true; - Main.tileBlockLight[508] = true; - Main.tileBrick[508] = true; - Main.tileLighted[336] = true; - Main.tileLighted[340] = true; - Main.tileLighted[341] = true; - Main.tileLighted[342] = true; - Main.tileLighted[343] = true; - Main.tileLighted[344] = true; - Main.tileLighted[349] = true; - Main.tileLighted[598] = true; - Main.tileSolid[421] = true; - Main.tileBlockLight[421] = true; - Main.tileSolid[422] = true; - Main.tileBlockLight[422] = true; - Main.tileSolid[426] = true; - Main.tileBlockLight[426] = true; - Main.tileSolid[430] = true; - Main.tileBlockLight[430] = true; - Main.tileSolid[431] = true; - Main.tileBlockLight[431] = true; - Main.tileSolid[432] = true; - Main.tileBlockLight[432] = true; - Main.tileSolid[433] = true; - Main.tileBlockLight[433] = true; - Main.tileSolid[434] = true; - Main.tileBlockLight[434] = true; - Main.tileSolid[446] = true; - Main.tileSolid[447] = true; - Main.tileSolid[448] = true; - Main.tileFrameImportant[427] = true; - Main.tileSolidTop[427] = true; - Main.tileSolid[427] = true; - Main.tileNoAttach[427] = true; - Main.tileTable[427] = true; - Main.tileLavaDeath[427] = true; - Main.tileNoSunLight[427] = false; - Main.tileSolid[476] = true; - for (int index = 435; index <= 439; ++index) + Main.InitLifeBytes(); + for (int index = 0; index < Recipe.maxRecipes; ++index) { - Main.tileFrameImportant[index] = true; - Main.tileSolidTop[index] = true; - Main.tileSolid[index] = true; - Main.tileNoAttach[index] = true; - Main.tileTable[index] = true; - Main.tileLavaDeath[index] = true; - Main.tileNoSunLight[index] = false; + Main.recipe[index] = new Recipe(); + Main.availableRecipeY[index] = (float) (65 * index); } - Main.tileSolid[284] = true; - Main.tileBlockLight[284] = true; - Main.tileSolid[346] = true; - Main.tileBlockLight[346] = true; - Main.tileLighted[346] = true; - Main.tileShine[346] = 2000; - Main.tileShine2[346] = true; - Main.tileBrick[346] = true; - Main.tileMergeDirt[346] = true; - Main.tileSolid[347] = true; - Main.tileBlockLight[347] = true; - Main.tileLighted[347] = true; - Main.tileShine[347] = 1900; - Main.tileShine2[347] = true; - Main.tileBrick[347] = true; - Main.tileMergeDirt[347] = true; - Main.tileSolid[348] = true; - Main.tileBlockLight[348] = true; - Main.tileLighted[348] = true; - Main.tileShine[348] = 1800; - Main.tileShine2[348] = true; - Main.tileBrick[348] = true; - Main.tileMergeDirt[348] = true; - Main.tileSolid[350] = true; - Main.tileBlockLight[350] = true; - Main.tileLighted[350] = true; - Main.tileBrick[350] = true; - Main.tileMergeDirt[350] = true; - Main.tileGlowMask[350] = (short) 94; - Main.tileGlowMask[390] = (short) 130; - Main.tileGlowMask[381] = (short) 126; - Main.tileGlowMask[517] = (short) 258; - Main.tileGlowMask[534] = (short) 259; - Main.tileGlowMask[535] = (short) 260; - Main.tileGlowMask[536] = (short) 261; - Main.tileGlowMask[537] = (short) 262; - Main.tileGlowMask[539] = (short) 263; - Main.tileGlowMask[540] = (short) 264; - Main.tileGlowMask[370] = (short) 111; - Main.tileGlowMask[429] = (short) 214; - Main.tileGlowMask[209] = (short) 215; - Main.tileGlowMask[445] = (short) 214; - Main.tileGlowMask[129] = (short) -2; - Main.tileLighted[429] = true; - Main.tileLighted[209] = true; - Main.tileGlowMask[410] = (short) 201; - Main.tileGlowMask[509] = (short) 265; - Main.tileSolid[370] = true; - Main.tileBlockLight[370] = true; - Main.tileLighted[370] = true; - Main.tileShine[370] = 1900; - Main.tileShine2[370] = true; - Main.tileBrick[370] = true; - Main.tileMergeDirt[370] = true; - Main.tileContainer[21] = true; - Main.tileContainer[467] = true; - Main.tileContainer[88] = true; - Main.tileContainer[470] = true; - Main.tileContainer[475] = true; - Main.tileSign[55] = true; - Main.tileSign[85] = true; - Main.tileSign[425] = true; - Main.tileSign[573] = true; - Main.tileSolid[383] = true; - Main.tileBrick[383] = true; - Main.tileBlockLight[383] = true; - Main.tileSolid[385] = true; - Main.tileBrick[385] = true; - Main.tileBlockLight[385] = true; - Main.tileSolid[472] = true; - Main.tileBrick[472] = true; - Main.tileMergeDirt[472] = true; - Main.tileBlockLight[472] = true; - Main.tileSolid[473] = true; - Main.tileBrick[473] = true; - Main.tileMergeDirt[473] = true; - Main.tileBlockLight[473] = true; - Main.tileSolid[500] = true; - Main.tileBrick[500] = true; - Main.tileLighted[500] = true; - Main.tileMergeDirt[500] = true; - Main.tileBlockLight[500] = true; - Main.tileSolid[501] = true; - Main.tileBrick[501] = true; - Main.tileLighted[501] = true; - Main.tileMergeDirt[501] = true; - Main.tileBlockLight[501] = true; - Main.tileSolid[502] = true; - Main.tileBrick[502] = true; - Main.tileLighted[502] = true; - Main.tileMergeDirt[502] = true; - Main.tileBlockLight[502] = true; - Main.tileSolid[503] = true; - Main.tileBrick[503] = true; - Main.tileLighted[503] = true; - Main.tileMergeDirt[503] = true; - Main.tileBlockLight[503] = true; - Main.tileSolid[541] = true; - Main.tileBlockLight[541] = false; - Main.tileSolid[546] = true; - Main.tileBlockLight[546] = false; - Main.tileSolid[557] = true; - Main.tileBlockLight[557] = true; - Main.tileSolid[474] = true; - Main.tileBrick[474] = true; - Main.tileMergeDirt[474] = true; - Main.tileBlockLight[474] = true; - Main.tileSolid[478] = true; - Main.tileBrick[478] = true; - Main.tileMergeDirt[478] = true; - Main.tileBlockLight[478] = true; - Main.tileSolid[479] = true; - Main.tileBrick[479] = true; - Main.tileMergeDirt[479] = true; - Main.tileBlockLight[479] = true; - Main.tileSolid[562] = true; - Main.tileBrick[562] = true; - Main.tileBlockLight[562] = true; - Main.tileMergeDirt[562] = true; - Main.tileSolid[563] = true; - Main.tileBrick[563] = true; - Main.tileBlockLight[563] = true; - Main.tileMergeDirt[563] = true; - Main.tileSolid[496] = true; - Main.tileBrick[496] = true; - Main.tileMergeDirt[496] = true; - Main.tileBlockLight[496] = true; - Main.tileSolid[495] = true; - Main.tileBrick[495] = true; - Main.tileMergeDirt[495] = true; - Main.tileBlockLight[495] = true; - Main.tileSolid[396] = true; - Main.tileBlockLight[396] = true; - Main.tileSolid[397] = true; - Main.tileBlockLight[397] = true; - Main.tileSolid[399] = true; - Main.tileBlockLight[399] = true; - Main.tileSolid[401] = true; - Main.tileBlockLight[401] = true; - Main.tileSolid[398] = true; - Main.tileBlockLight[398] = true; - Main.tileSolid[400] = true; - Main.tileBlockLight[400] = true; - Main.tileSolid[402] = true; - Main.tileBlockLight[402] = true; - Main.tileSolid[403] = true; - Main.tileBlockLight[403] = true; - Main.tileSolid[404] = true; - Main.tileBlockLight[404] = true; - Main.tileSolid[407] = true; - Main.tileBlockLight[407] = true; - Main.tileShine2[407] = true; - Main.tileShine[407] = 1000; - Main.tileFrameImportant[36] = true; - Main.tileFrameImportant[275] = true; - Main.tileFrameImportant[276] = true; - Main.tileFrameImportant[277] = true; - Main.tileFrameImportant[278] = true; - Main.tileFrameImportant[279] = true; - Main.tileFrameImportant[280] = true; - Main.tileFrameImportant[281] = true; - Main.tileFrameImportant[282] = true; - Main.tileFrameImportant[285] = true; - Main.tileFrameImportant[286] = true; - Main.tileFrameImportant[414] = true; - Main.tileFrameImportant[413] = true; - Main.tileFrameImportant[309] = true; - Main.tileFrameImportant[310] = true; - Main.tileFrameImportant[339] = true; - Main.tileFrameImportant[532] = true; - Main.tileLighted[286] = true; - Main.tileLighted[302] = true; - Main.tileFrameImportant[298] = true; - Main.tileFrameImportant[299] = true; - Main.tileSolid[170] = true; - Main.tileBlockLight[170] = true; - Main.tileFrameImportant[171] = true; - Main.tileLighted[171] = true; - Main.tileFrameImportant[247] = true; - Main.tileFrameImportant[245] = true; - Main.tileFrameImportant[246] = true; - Main.tileFrameImportant[239] = true; - Main.tileFrameImportant[240] = true; - Main.tileFrameImportant[241] = true; - Main.tileFrameImportant[242] = true; - Main.tileFrameImportant[243] = true; - Main.tileFrameImportant[244] = true; - Main.tileFrameImportant[254] = true; - Main.tileSolid[221] = true; - Main.tileBlockLight[221] = true; - Main.tileMergeDirt[221] = true; - Main.tileLighted[96] = true; - Main.tileMergeDirt[250] = true; - Main.tileSolid[272] = true; - Main.tileBlockLight[272] = true; - Main.tileSolid[229] = true; - Main.tileBlockLight[229] = true; - Main.tileMergeDirt[229] = true; - Main.tileSolid[230] = true; - Main.tileBlockLight[230] = true; - Main.tileMergeDirt[230] = true; - Main.tileSolid[222] = true; - Main.tileBlockLight[222] = true; - Main.tileMergeDirt[222] = true; - Main.tileSolid[223] = true; - Main.tileBlockLight[223] = true; - Main.tileMergeDirt[223] = true; - Main.tileSolid[224] = true; - Main.tileBlockLight[224] = true; - Main.tileFrameImportant[237] = true; - Main.tileFrameImportant[238] = true; - Main.tileSolid[225] = true; - Main.tileBlockLight[225] = true; - Main.tileBrick[225] = true; - Main.tileSolid[226] = true; - Main.tileBlockLight[226] = true; - Main.tileBrick[226] = true; - Main.tileSolid[235] = true; - Main.tileBlockLight[235] = true; - Main.tileFrameImportant[235] = true; - Main.tileLighted[238] = true; - Main.tileCut[254] = true; - Main.tileFrameImportant[236] = true; - Main.tileCut[236] = true; - Main.tileSolid[191] = true; - Main.tileBrick[191] = true; - Main.tileBlockLight[191] = true; - Main.tileSolid[211] = true; - Main.tileBlockLight[211] = true; - Main.tileSolid[208] = true; - Main.tileBrick[208] = true; - Main.tileBlockLight[208] = true; - Main.tileSolid[192] = true; - Main.tileBlockLight[192] = true; - Main.tileSolid[193] = true; - Main.tileBrick[193] = true; - Main.tileBlockLight[193] = true; - Main.tileMergeDirt[193] = true; - Main.tileSolid[194] = true; - Main.tileBrick[194] = true; - Main.tileBlockLight[194] = true; - Main.tileSolid[195] = true; - Main.tileBrick[195] = true; - Main.tileMergeDirt[195] = true; - Main.tileBlockLight[195] = true; - Main.tileBlockLight[200] = true; - Main.tileSolid[200] = true; - Main.tileBrick[200] = true; - Main.tileBlockLight[203] = true; - Main.tileSolid[203] = true; - Main.tileMergeDirt[203] = true; - Main.tileBlockLight[204] = true; - Main.tileSolid[204] = true; - Main.tileMergeDirt[204] = true; - Main.tileBlockLight[165] = true; - Main.tileShine2[147] = true; - Main.tileShine2[161] = true; - Main.tileShine2[163] = true; - Main.tileShine2[164] = true; - Main.tileSolid[189] = true; - Main.tileBlockLight[51] = true; - Main.tileLighted[204] = true; - Main.tileShine[204] = 1150; - Main.tileShine2[204] = true; - Main.tileSolid[190] = true; - Main.tileBlockLight[190] = true; - Main.tileBrick[190] = true; - Main.tileSolid[198] = true; - Main.tileMergeDirt[198] = true; - Main.tileBrick[198] = true; - Main.tileBlockLight[198] = true; - Main.tileSolid[206] = true; - Main.tileBlockLight[206] = true; - Main.tileMergeDirt[206] = true; - Main.tileBrick[206] = true; - Main.tileBlockLight[234] = true; - Main.tileSolid[248] = true; - Main.tileSolid[249] = true; - Main.tileSolid[250] = true; - Main.tileBrick[248] = true; - Main.tileBrick[249] = true; - Main.tileBrick[250] = true; - Main.tileSolid[251] = true; - Main.tileSolid[252] = true; - Main.tileBrick[252] = true; - Main.tileSolid[253] = true; - Main.tileBrick[253] = true; - Main.tileMergeDirt[251] = true; - Main.tileMergeDirt[252] = true; - Main.tileMergeDirt[253] = true; - Main.tileBlockLight[251] = true; - Main.tileBlockLight[252] = true; - Main.tileBlockLight[253] = true; - Main.tileBlockLight[248] = true; - Main.tileBlockLight[249] = true; - Main.tileBlockLight[250] = true; - Main.tileLargeFrames[273] = (byte) 1; - Main.tileSolid[273] = true; - Main.tileBlockLight[273] = true; - Main.tileLargeFrames[274] = (byte) 1; - Main.tileSolid[274] = true; - Main.tileBlockLight[274] = true; - Main.tileLargeFrames[618] = (byte) 1; - Main.tileSolid[618] = true; - Main.tileBlockLight[618] = true; - for (int maxValue = (int) byte.MaxValue; maxValue <= 268; ++maxValue) + Recipe.SetupRecipes(); + for (int index = 0; index < Main.numChatLines; ++index) + Main.chatLine[index] = new ChatLine(); + for (int index = 0; index < Terraria.Liquid.resLiquid; ++index) + Main.liquid[index] = new Terraria.Liquid(); + for (int index = 0; index < 10000; ++index) + Main.liquidBuffer[index] = new LiquidBuffer(); + this.waterfallManager = new WaterfallManager(); + Lighting.LightingThreads = 0; + this.shop[0] = new Chest(); + Chest.SetupTravelShop(); + for (int type = 1; type < Main.MaxShopIDs; ++type) { - Main.tileSolid[maxValue] = true; - if (maxValue > 261) - { - Main.tileLighted[maxValue] = true; - Main.tileShine2[maxValue] = true; - } + this.shop[type] = new Chest(); + this.shop[type].SetupShop(type); } - Main.tileFrameImportant[269] = true; - Main.tileFrameImportant[470] = true; - Main.tileFrameImportant[475] = true; - Main.tileFrameImportant[390] = true; - Main.tileFrameImportant[597] = true; - Main.tileLighted[597] = true; - Main.tileNoAttach[390] = true; - Main.tileLavaDeath[390] = true; - Main.tileLighted[390] = true; - Main.tileFrameImportant[617] = true; - Main.wallHouse[168] = true; - Main.wallHouse[169] = true; - Main.wallHouse[142] = true; - Main.wallHouse[143] = true; - Main.wallHouse[144] = true; - Main.wallHouse[149] = true; - Main.wallHouse[151] = true; - Main.wallHouse[150] = true; - Main.wallHouse[152] = true; - Main.wallHouse[145] = true; - Main.wallHouse[148] = true; - Main.wallHouse[175] = true; - Main.wallHouse[176] = true; - Main.wallHouse[182] = true; - for (int index = 153; index < 167; ++index) - Main.wallHouse[index] = true; - Main.wallHouse[146] = true; - Main.wallHouse[147] = true; - Main.wallHouse[149] = true; - Main.wallHouse[167] = true; - Main.wallHouse[168] = true; - Main.wallHouse[133] = true; - Main.wallHouse[134] = true; - Main.wallHouse[135] = true; - Main.wallHouse[136] = true; - Main.wallHouse[137] = true; - Main.wallHouse[75] = true; - Main.wallHouse[76] = true; - Main.wallHouse[78] = true; - Main.wallHouse[82] = true; - Main.wallHouse[77] = true; - Main.wallHouse[1] = true; - Main.wallHouse[4] = true; - Main.wallHouse[5] = true; - Main.wallHouse[6] = true; - Main.wallHouse[10] = true; - Main.wallHouse[11] = true; - Main.wallHouse[12] = true; - Main.wallHouse[16] = true; - Main.wallHouse[17] = true; - Main.wallHouse[18] = true; - Main.wallHouse[19] = true; - Main.wallHouse[20] = true; - Main.wallHouse[21] = true; - Main.wallHouse[22] = true; - Main.wallHouse[23] = true; - Main.wallHouse[24] = true; - Main.wallHouse[25] = true; - Main.wallHouse[26] = true; - Main.wallHouse[27] = true; - Main.wallHouse[29] = true; - Main.wallHouse[30] = true; - Main.wallHouse[31] = true; - Main.wallHouse[32] = true; - Main.wallHouse[33] = true; - Main.wallHouse[34] = true; - Main.wallHouse[35] = true; - Main.wallHouse[36] = true; - Main.wallHouse[37] = true; - Main.wallHouse[38] = true; - Main.wallHouse[39] = true; - Main.wallHouse[41] = true; - Main.wallHouse[42] = true; - Main.wallHouse[43] = true; - Main.wallHouse[44] = true; - Main.wallHouse[45] = true; - Main.wallHouse[46] = true; - Main.wallHouse[47] = true; - Main.wallHouse[66] = true; - Main.wallHouse[67] = true; - Main.wallHouse[68] = true; - Main.wallHouse[72] = true; - Main.wallHouse[73] = true; - Main.wallHouse[107] = true; - Main.wallHouse[106] = true; - Main.wallHouse[245] = true; - Main.wallHouse[315] = true; - Main.wallHouse[109] = true; - Main.wallHouse[110] = true; - Main.wallHouse[111] = true; - Main.wallHouse[112] = true; - Main.wallHouse[113] = true; - Main.wallHouse[114] = true; - Main.wallHouse[115] = true; - Main.wallHouse[116] = true; - Main.wallHouse[117] = true; - Main.wallHouse[118] = true; - Main.wallHouse[119] = true; - Main.wallHouse[120] = true; - Main.wallHouse[121] = true; - Main.wallHouse[122] = true; - Main.wallHouse[123] = true; - Main.wallHouse[124] = true; - Main.wallHouse[125] = true; - Main.wallHouse[108] = true; - Main.wallHouse[100] = true; - Main.wallHouse[101] = true; - Main.wallHouse[102] = true; - Main.wallHouse[103] = true; - Main.wallHouse[104] = true; - Main.wallHouse[105] = true; - Main.wallHouse[84] = true; - Main.wallHouse[74] = true; - Main.wallHouse[241] = true; - Main.wallHouse[85] = true; - Main.wallHouse[88] = true; - Main.wallHouse[89] = true; - Main.wallHouse[90] = true; - Main.wallHouse[91] = true; - Main.wallHouse[92] = true; - Main.wallHouse[93] = true; - Main.wallHouse[126] = true; - Main.wallHouse[(int) sbyte.MaxValue] = true; - Main.wallHouse[128] = true; - Main.wallHouse[129] = true; - Main.wallHouse[130] = true; - Main.wallHouse[131] = true; - Main.wallHouse[132] = true; - Main.wallHouse[138] = true; - Main.wallHouse[139] = true; - Main.wallHouse[140] = true; - Main.wallHouse[141] = true; - Main.wallHouse[177] = true; - Main.wallHouse[172] = true; - Main.wallHouse[242] = true; - Main.wallHouse[243] = true; - Main.wallHouse[174] = true; - Main.wallHouse[223] = true; - Main.wallHouse[230] = true; - Main.wallHouse[228] = true; - Main.wallHouse[229] = true; - Main.wallHouse[236] = true; - Main.wallHouse[246] = true; - Main.wallHouse[247] = true; - Main.wallHouse[248] = true; - Main.wallHouse[249] = true; - Main.wallHouse[250] = true; - Main.wallHouse[251] = true; - Main.wallHouse[252] = true; - Main.wallHouse[253] = true; - Main.wallHouse[254] = true; - Main.wallHouse[(int) byte.MaxValue] = true; - Main.wallHouse[314] = true; - Main.wallHouse[256] = true; - Main.wallHouse[257] = true; - Main.wallHouse[258] = true; - Main.wallHouse[259] = true; - Main.wallHouse[260] = true; - Main.wallHouse[261] = true; - Main.wallHouse[262] = true; - Main.wallHouse[263] = true; - Main.wallHouse[264] = true; - Main.wallHouse[265] = true; - Main.wallHouse[266] = true; - Main.wallHouse[267] = true; - Main.wallHouse[268] = true; - Main.wallHouse[269] = true; - Main.wallHouse[270] = true; - Main.wallHouse[271] = true; - Main.wallHouse[272] = true; - Main.wallHouse[273] = true; - Main.wallHouse[274] = true; - Main.wallHouse[275] = true; - Main.wallHouse[276] = true; - Main.wallHouse[277] = true; - Main.wallHouse[278] = true; - Main.wallHouse[279] = true; - Main.wallHouse[280] = true; - Main.wallHouse[281] = true; - Main.wallHouse[282] = true; - Main.wallHouse[283] = true; - Main.wallHouse[284] = true; - Main.wallHouse[285] = true; - Main.wallHouse[286] = true; - Main.wallHouse[287] = true; - Main.wallHouse[288] = true; - Main.wallHouse[289] = true; - Main.wallHouse[290] = true; - Main.wallHouse[291] = true; - Main.wallHouse[292] = true; - Main.wallHouse[293] = true; - Main.wallHouse[294] = true; - Main.wallHouse[295] = true; - Main.wallHouse[296] = true; - Main.wallHouse[297] = true; - Main.wallHouse[298] = true; - Main.wallHouse[299] = true; - Main.wallHouse[300] = true; - Main.wallHouse[301] = true; - Main.wallHouse[302] = true; - Main.wallHouse[303] = true; - Main.wallHouse[304] = true; - Main.wallHouse[305] = true; - Main.wallHouse[306] = true; - Main.wallHouse[307] = true; - Main.wallHouse[308] = true; - Main.wallHouse[309] = true; - Main.wallHouse[310] = true; - Main.wallHouse[311] = true; - Main.wallLight[0] = true; - Main.wallLight[21] = true; - Main.wallLight[106] = true; - Main.wallLight[107] = true; - Main.wallLight[138] = true; - Main.wallLight[140] = true; - Main.wallLight[141] = true; - Main.wallLight[139] = true; - Main.wallLight[145] = true; - Main.wallLight[150] = true; - Main.wallLight[152] = true; - Main.wallLight[245] = true; - Main.wallLight[315] = true; - Main.wallLight[168] = true; - for (int index = 0; index < 316; ++index) - Main.wallDungeon[index] = false; - Main.wallDungeon[7] = true; - Main.wallDungeon[8] = true; - Main.wallDungeon[9] = true; - Main.wallDungeon[94] = true; - Main.wallDungeon[95] = true; - Main.wallDungeon[96] = true; - Main.wallDungeon[97] = true; - Main.wallDungeon[98] = true; - Main.wallDungeon[99] = true; + Main.teamColor[0] = Microsoft.Xna.Framework.Color.White; + Main.teamColor[1] = new Microsoft.Xna.Framework.Color(218, 59, 59); + Main.teamColor[2] = new Microsoft.Xna.Framework.Color(59, 218, 85); + Main.teamColor[3] = new Microsoft.Xna.Framework.Color(59, 149, 218); + Main.teamColor[4] = new Microsoft.Xna.Framework.Color(242, 221, 100); + Main.teamColor[5] = new Microsoft.Xna.Framework.Color(224, 100, 242); + if (Main.menuMode == 1) + Main.LoadPlayers(); + for (int Type = 1; Type < 714; ++Type) + { + Projectile projectile = new Projectile(); + projectile.SetDefaults(Type); + if (projectile.hostile) + Main.projHostile[Type] = true; + if (projectile.aiStyle == 7) + Main.projHook[Type] = true; + } + Netplay.Initialize(); + NetworkInitializer.Load(); + ChatInitializer.Load(); + if (Main.skipMenu) + { + WorldGen.clearWorld(); + Main.gameMenu = false; + Main.LoadPlayers(); + Main.PlayerList[0].SetAsActive(); + Main.LoadWorlds(); + WorldGen.generateWorld(new UnifiedRandom().Next()); + WorldGen.EveryTileFrame(); + Main.player[Main.myPlayer].Spawn(); + Main.ActivePlayerFileData.StartPlayTimer(); + Player.Hooks.EnterWorld(Main.myPlayer); + } + else + { + IntPtr systemMenu = Main.GetSystemMenu(this.Window.Handle, false); + Main.RemoveMenu(systemMenu, Main.GetMenuItemCount(systemMenu) - 1, 1024); + } + this.ClientInitialize(); } private void ClientInitialize() { MessageBuffer.OnTileChangeReceived += new TileChangeReceivedEvent(this.OnTileChangeEvent); - LanguageManager.Instance.OnLanguageChanged += (LanguageChangeCallback) (languageManager => ItemTooltip.InvalidateTooltips()); - PlayerInput.OnBindingChange += new Action(ItemTooltip.InvalidateTooltips); Main.clientUUID = Guid.NewGuid().ToString(); - FilterManager scene = Terraria.Graphics.Effects.Filters.Scene; - ((Platform) Platform.Current).InitializeClientServices(this.Window.Handle); - Platform.Get().AddKeyListener((Action) (keyStroke => + FilterManager scene = Filters.Scene; + ((Platform) Platform.Current).InitializeIme(this.Window.Handle); + PlatformIme ime = ((Platform) Platform.Current).Ime; + ime.OnKeyPress = (__Null) Delegate.Combine((Delegate) ime.OnKeyPress, (Delegate) (keyStroke => { if (Main.keyCount >= 10) return; @@ -8047,9 +6616,9 @@ label_127: Main.keyString[Main.keyCount] = keyStroke.ToString() ?? ""; ++Main.keyCount; })); + base.Initialize(); this.Window.AllowUserResizing = true; - this.LoadSettings(); - Main.SetDisplayMonitor(); + this.OpenSettings(); if (Main.screenWidth > GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width) Main.screenWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width; if (Main.screenHeight > GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height) @@ -8063,26 +6632,16 @@ label_127: this.GraphicsDevice.DeviceResetting += new EventHandler(this.GraphicsDeviceLost); if (Main._needsLanguageSelect) Main.menuMode = 1212; - this._achievements = new AchievementManager(); - this._achievementAdvisor = new AchievementAdvisor(); this.OpenRecent(); + Star.SpawnStars(); + WorldGen.RandomizeWeather(); + this._achievements = new AchievementManager(); + AchievementInitializer.Load(); + DyeInitializer.Load(); + ScreenEffectInitializer.Load(); + AchievementCompleteUI.Initialize(); UILinksInitializer.Load(); - Main.Chroma = new ChromaEngine(); - Main.ChromaPainter = new ChromaHotkeyPainter(); - Main.ChromaPainter.CollectBoundKeys(); - Main.CacheSupportedDisplaySizes(); - if (Main.autoJoin) - { - Main.LoadPlayers(); - Main.menuMode = 1; - Main.menuMultiplayer = true; - } - Main.fpsTimer.Start(); - } - - private static void CacheSupportedDisplaySizes() - { - Main.numDisplayModes = 0; + ItemSorting.SetupWhiteLists(); foreach (DisplayMode supportedDisplayMode in GraphicsAdapter.DefaultAdapter.SupportedDisplayModes) { if (supportedDisplayMode.Width >= Main.minScreenW && supportedDisplayMode.Height >= Main.minScreenH && supportedDisplayMode.Width <= Main.maxScreenW && supportedDisplayMode.Height <= Main.maxScreenH) @@ -8104,182 +6663,1355 @@ label_127: } } } + if (Main.autoJoin) + { + Main.LoadPlayers(); + Main.menuMode = 1; + Main.menuMultiplayer = true; + } + Main.fpsTimer.Start(); } - public static void LoadTestLog(string logname) + public T OurLoad(string path) { + lock (Main.globalTextureLocker) + { + Texture2D tex; + return TexturePackSupport.Enabled && typeof (T) == this.t2d && TexturePackSupport.FetchTexture(path + ".png", out tex) ? (T) tex : this.Content.Load(path); + } } - private void OnceFailedLoadingAnAsset(string assetPath, Exception e) => FancyErrorPrinter.ShowFailedToLoadAssetError(e, assetPath); - protected override void LoadContent() - { - SoundEngine.Initialize(); - if (XnaExtensions.Get((System.IServiceProvider) this.Services) == null) - AssetInitializer.CreateAssetServices(this.Services); - Main.Assets = XnaExtensions.Get((System.IServiceProvider) this.Services); - // ISSUE: method pointer - Main.Assets.AssetLoadFailHandler = new FailedToLoadAssetCustomAction((object) this, __methodptr(OnceFailedLoadingAnAsset)); - this.mapSectionTexture = new RenderTarget2D(this.GraphicsDevice, 200, 150); - Main.ShaderContentManager = new ContentManager(this.Content.ServiceProvider, this.Content.RootDirectory); - Main.PixelShaderRef.Value = Main.ShaderContentManager.Load("PixelShader"); - Main.VertexPixelShaderRef.Value = Main.ShaderContentManager.Load("PixelShader"); - Main.TileShaderRef.Value = Main.ShaderContentManager.Load("TileShader"); - Main.ScreenShaderRef.Value = Main.ShaderContentManager.Load("ScreenShader"); - Main.spriteBatch = new SpriteBatch(this.GraphicsDevice); - Main.tileBatch = new TileBatch(this.GraphicsDevice); - Main.DebugDrawer = new BasicDebugDrawer(this.GraphicsDevice); - Main.GameViewMatrix = new SpriteViewMatrix(this.GraphicsDevice); - Main.BackgroundViewMatrix = new SpriteViewMatrix(this.GraphicsDevice); - Main.AssetSourceController = new AssetSourceController(Main.Assets, (IEnumerable) new IContentSource[1] - { - (IContentSource) new XnaContentSource(this.Content.RootDirectory) - }); - VanillaContentValidator.Instance = new VanillaContentValidator("Terraria.IO.Data.ResourcePacksDefaultInfo.tsv"); - Main.AssetSourceController.UseResourcePacks(AssetInitializer.CreateResourcePackList((System.IServiceProvider) this.Services)); - AssetInitializer.LoadSplashAssets(true); - ChromaInitializer.Load(); - this._gameContentLoadProcess = this.LoadContent_Deferred(); - } - - private void LoadContent_TryEnteringHiDef() { Main.Configuration.Load(); Main.Configuration.Get("UseExperimentalFeatures", ref Main.UseExperimentalFeatures); + if (Main.UseExperimentalFeatures) + TexturePackSupport.Enabled = true; Main.Configuration.Get("Support4K", ref Main.Support4K); bool flag = Main.Support4K && this.GraphicsDevice.Adapter.IsProfileSupported(GraphicsProfile.HiDef); if (GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width <= 1920 && GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height <= 1200) flag = false; - if (!(Main.Support4K & flag) || this.GraphicsDevice.GraphicsProfile == GraphicsProfile.HiDef) - return; - Main.SetGraphicsProfile(GraphicsProfile.HiDef); - } - - protected IEnumerator LoadContent_Deferred() - { - yield return (object) null; - AssetInitializer.LoadAssetsWhileInInitialBlackScreen(); - yield return (object) null; - bool doneLoadingMusic = false; - IEnumerator musicLoadProcedure = this.LoadMusic_InSteps(); - while (!doneLoadingMusic) - { - try - { - if (!musicLoadProcedure.MoveNext()) - doneLoadingMusic = true; - } - catch - { - doneLoadingMusic = true; - Main.musicVolume = 0.0f; - Main.soundVolume = 0.0f; - } - yield return (object) null; - } - this._musicLoaded = true; - Main.splashTimer.Start(); - yield return (object) null; - this._begunMainAsyncLoad = true; - AssetInitializer.Load(true); - this._artLoaded = true; - Main.TownNPCHeadRenderer = new NPCHeadRenderer(TextureAssets.NpcHead); - Main.ContentThatNeedsRenderTargets.Add((INeedRenderTargetContent) Main.TownNPCHeadRenderer); - Main.BossNPCHeadRenderer = new NPCHeadRenderer(TextureAssets.NpcHeadBoss); - Main.ContentThatNeedsRenderTargets.Add((INeedRenderTargetContent) Main.BossNPCHeadRenderer); - } - - private void TickLoadProcess() => this._gameContentLoadProcess.MoveNext(); - - private void LoadContent_Music() => ((ThreadStart) (() => - { + if (Main.Support4K & flag) + Main.SetGraphicsProfile(GraphicsProfile.HiDef); + TexturePackSupport.FindTexturePack(); + TextureManager.Initialize(); + this.mapSectionTexture = new RenderTarget2D(this.GraphicsDevice, 200, 150); + Main.ShaderContentManager = new ContentManager(this.Content.ServiceProvider, this.Content.RootDirectory); + Main.PixelShaderRef.Value = Main.ShaderContentManager.Load("PixelShader"); + Main.TileShaderRef.Value = Main.ShaderContentManager.Load("TileShader"); + Main.ScreenShaderRef.Value = Main.ShaderContentManager.Load("ScreenShader"); try { - this.LoadMusic(); + Main.LoadMusic(); + this.LoadSounds(); } catch { Main.musicVolume = 0.0f; Main.soundVolume = 0.0f; } - this._musicLoaded = true; - Main.splashTimer.Start(); - }))(); - - private static void PostContentLoadInitialize() - { - LiquidRenderer.LoadContent(); - AchievementInitializer.Load(); - Main.AchievementAdvisor.Initialize(); - DyeInitializer.Load(); - ScreenEffectInitializer.Load(); - InGameNotificationsTracker.Initialize(); - Main.moonType = Main.rand.Next(9); - Main.windSpeedCurrent = (float) Main.rand.Next(-800, 801) * (1f / 1000f); - Main.windSpeedTarget = Main.windSpeedCurrent; - Main.numClouds = Main.rand.Next(200); + this.LoadTextures(); + this.LoadFonts(); Mount.Initialize(); Minecart.Initialize(); - Main.CacheSupportedDisplaySizes(); - ContentSamples.RebuildItemCreativeSortingIDsAfterRecipesAreSetUp(); - ContentSamples.CommonlyUsedContentSamples.PrepareAfterEverythingElseLoaded(); } - private void LoadMusic() + private void LoadFonts() { - if (!SoundEngine.IsAudioSupported) - return; - Main.engine = new AudioEngine("Content\\TerrariaMusic.xgs"); - Main.soundBank = new SoundBank(Main.engine, "Content\\Sound Bank.xsb"); - Main.waveBank = new WaveBank(Main.engine, "Content\\Wave Bank.xwb"); - for (int index = 1; index < 89; ++index) + Main.fontItemStack = this.OurLoad("Fonts" + Path.DirectorySeparatorChar.ToString() + "Item_Stack"); + Main.fontMouseText = this.OurLoad("Fonts" + Path.DirectorySeparatorChar.ToString() + "Mouse_Text"); + Main.fontDeathText = this.OurLoad("Fonts" + Path.DirectorySeparatorChar.ToString() + "Death_Text"); + Main.fontCombatText[0] = this.OurLoad("Fonts" + Path.DirectorySeparatorChar.ToString() + "Combat_Text"); + Main.fontCombatText[1] = this.OurLoad("Fonts" + Path.DirectorySeparatorChar.ToString() + "Combat_Crit"); + } + + private void LoadTextures() + { + Main.tileCrackTexture = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "TileCracks"); + Main.chestStackTexture[0] = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "ChestStack_0"); + Main.chestStackTexture[1] = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "ChestStack_1"); + Main.smartDigTexture = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "SmartDig"); + this.iceBarrierTexture = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "IceBarrier"); + Main.frozenTexture = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "Frozen"); + for (int index = 0; index < Main.PVPTexture.Length; ++index) + Main.PVPTexture[index] = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "UI" + Path.DirectorySeparatorChar.ToString() + "PVP_" + (object) index); + for (int index = 0; index < Main.EquipPageTexture.Length; ++index) + Main.EquipPageTexture[index] = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "UI" + Path.DirectorySeparatorChar.ToString() + "DisplaySlots_" + (object) index); + for (int index = 0; index < Main.HouseBannerTexture.Length; ++index) + Main.HouseBannerTexture[index] = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "UI" + Path.DirectorySeparatorChar.ToString() + "House_Banner_" + (object) index); + for (int index = 0; index < Main.craftToggleTexture.Length; ++index) + Main.craftToggleTexture[index] = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "UI" + Path.DirectorySeparatorChar.ToString() + "Craft_Toggle_" + (object) index); + for (int index = 0; index < Main.inventorySortTexture.Length; ++index) + Main.inventorySortTexture[index] = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "UI" + Path.DirectorySeparatorChar.ToString() + "Sort_" + (object) index); + for (int index = 0; index < Main.textGlyphTexture.Length; ++index) + Main.textGlyphTexture[index] = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "UI" + Path.DirectorySeparatorChar.ToString() + "Glyphs_" + (object) index); + for (int index = 0; index < Main.hotbarRadialTexture.Length; ++index) + Main.hotbarRadialTexture[index] = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "UI" + Path.DirectorySeparatorChar.ToString() + "HotbarRadial_" + (object) index); + for (int index = 0; index < this.infoIconTexture.Length; ++index) + this.infoIconTexture[index] = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "UI" + Path.DirectorySeparatorChar.ToString() + "InfoIcon_" + (object) index); + for (int index = 0; index < Main.reforgeTexture.Length; ++index) + Main.reforgeTexture[index] = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "UI" + Path.DirectorySeparatorChar.ToString() + "Reforge_" + (object) index); + for (int index = 0; index < Main.cameraTexture.Length; ++index) + Main.cameraTexture[index] = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "UI" + Path.DirectorySeparatorChar.ToString() + "Camera_" + (object) index); + for (int index = 0; index < Main.wireUITexture.Length; ++index) + Main.wireUITexture[index] = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "UI" + Path.DirectorySeparatorChar.ToString() + "Wires_" + (object) index); + string[] strArray1 = new string[5] + { + "Images", + null, + null, + null, + null + }; + char directorySeparatorChar1 = Path.DirectorySeparatorChar; + strArray1[1] = directorySeparatorChar1.ToString(); + strArray1[2] = "UI"; + directorySeparatorChar1 = Path.DirectorySeparatorChar; + strArray1[3] = directorySeparatorChar1.ToString(); + strArray1[4] = "BuilderIcons"; + Main.builderAccTexture = this.OurLoad(string.Concat(strArray1)); + string[] strArray2 = new string[5] + { + "Images", + null, + null, + null, + null + }; + char directorySeparatorChar2 = Path.DirectorySeparatorChar; + strArray2[1] = directorySeparatorChar2.ToString(); + strArray2[2] = "UI"; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + strArray2[3] = directorySeparatorChar2.ToString(); + strArray2[4] = "UI_quickicon1"; + Main.quicksIconTexture = this.OurLoad(string.Concat(strArray2)); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.craftUpButtonTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "RecUp"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.craftDownButtonTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "RecDown"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.scrollLeftButtonTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "RecLeft"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.scrollRightButtonTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "RecRight"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.oneDropLogo = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "OneDropLogo"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.pulleyTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "PlayerPulley"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.timerTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Timer"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.wofTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "WallOfFlesh"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.wallOutlineTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Wall_Outline"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.fadeTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "fade-out"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.ghostTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Ghost"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.evilCactusTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Evil_Cactus"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.goodCactusTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Good_Cactus"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.crimsonCactusTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Crimson_Cactus"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.wraithEyeTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Wraith_Eyes"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.fireflyTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Firefly"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.fireflyJarTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "FireflyJar"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.lightningbugTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "LightningBug"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.lightningbugJarTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "LightningBugJar"); + AchievementCompleteUI.LoadContent(); + for (int index1 = 1; index1 <= 3; ++index1) + { + Texture2D[] jellyfishBowlTexture = Main.jellyfishBowlTexture; + int index2 = index1 - 1; + object[] objArray = new object[4] + { + (object) "Images", + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray[1] = (object) directorySeparatorChar2.ToString(); + objArray[2] = (object) "jellyfishBowl"; + objArray[3] = (object) index1; + Texture2D texture2D = this.OurLoad(string.Concat(objArray)); + jellyfishBowlTexture[index2] = texture2D; + } + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.glowSnailTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "GlowSnail"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.iceQueenTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "IceQueen"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.santaTankTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "SantaTank"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.jackHatTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "JackHat"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.treeFaceTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "TreeFace"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.pumpkingFaceTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "PumpkingFace"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.reaperEyeTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Reaper_Eyes"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + this.mapDeathTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "MapDeath"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.dukeFishronTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "DukeFishron"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.miniMinotaurTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "MiniMinotaur"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.mapTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Map"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + this.mapBG1Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "MapBG1"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + this.mapBG2Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "MapBG2"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + this.mapBG3Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "MapBG3"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + this.mapBG4Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "MapBG4"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + this.mapBG5Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "MapBG5"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + this.mapBG6Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "MapBG6"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + this.mapBG7Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "MapBG7"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + this.mapBG8Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "MapBG8"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + this.mapBG9Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "MapBG9"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + this.mapBG10Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "MapBG10"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + this.mapBG11Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "MapBG11"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + this.mapBG12Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "MapBG12"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + this.mapBG13Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "MapBG13"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + this.mapBG14Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "MapBG14"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + this.mapBG15Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "MapBG15"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + this.hueTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Hue"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.colorSliderTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "ColorSlider"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.colorBarTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "ColorBar"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.colorBlipTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "ColorBlip"); + string[] strArray3 = new string[5] + { + "Images", + null, + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + strArray3[1] = directorySeparatorChar2.ToString(); + strArray3[2] = "UI"; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + strArray3[3] = directorySeparatorChar2.ToString(); + strArray3[4] = "Slider_Highlight"; + Main.colorHighlightTexture = this.OurLoad(string.Concat(strArray3)); + string[] strArray4 = new string[5] + { + "Images", + null, + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + strArray4[1] = directorySeparatorChar2.ToString(); + strArray4[2] = "UI"; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + strArray4[3] = directorySeparatorChar2.ToString(); + strArray4[4] = "LockOn_Cursor"; + Main.LockOnCursorTexture = this.OurLoad(string.Concat(strArray4)); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.rainTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Rain"); + for (int index3 = 0; index3 < 252; ++index3) + { + Texture2D[] glowMaskTexture = Main.glowMaskTexture; + int index4 = index3; + object[] objArray = new object[4] + { + (object) "Images", + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray[1] = (object) directorySeparatorChar2.ToString(); + objArray[2] = (object) "Glow_"; + objArray[3] = (object) index3; + Texture2D texture2D = this.OurLoad(string.Concat(objArray)); + glowMaskTexture[index4] = texture2D; + } + for (int index5 = 0; index5 < Main.highlightMaskTexture.Length; ++index5) + { + if (TileID.Sets.HasOutlines[index5]) + { + Texture2D[] highlightMaskTexture = Main.highlightMaskTexture; + int index6 = index5; + object[] objArray = new object[8]; + objArray[0] = (object) "Images"; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray[1] = (object) directorySeparatorChar2.ToString(); + objArray[2] = (object) "Misc"; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray[3] = (object) directorySeparatorChar2.ToString(); + objArray[4] = (object) "TileOutlines"; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray[5] = (object) directorySeparatorChar2.ToString(); + objArray[6] = (object) "Tiles_"; + objArray[7] = (object) index5; + Texture2D texture2D = this.OurLoad(string.Concat(objArray)); + highlightMaskTexture[index6] = texture2D; + } + } + for (int index7 = 0; index7 < 91; ++index7) + { + Texture2D[] extraTexture = Main.extraTexture; + int index8 = index7; + object[] objArray = new object[4] + { + (object) "Images", + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray[1] = (object) directorySeparatorChar2.ToString(); + objArray[2] = (object) "Extra_"; + objArray[3] = (object) index7; + Texture2D texture2D = this.OurLoad(string.Concat(objArray)); + extraTexture[index8] = texture2D; + } + for (int index9 = 0; index9 < 4; ++index9) + { + Texture2D[] coinTexture = Main.coinTexture; + int index10 = index9; + object[] objArray = new object[4] + { + (object) "Images", + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray[1] = (object) directorySeparatorChar2.ToString(); + objArray[2] = (object) "Coin_"; + objArray[3] = (object) index9; + Texture2D texture2D = this.OurLoad(string.Concat(objArray)); + coinTexture[index10] = texture2D; + } + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.magicPixel = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "MagicPixel"); + string[] strArray5 = new string[5] + { + "Images", + null, + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + strArray5[1] = directorySeparatorChar2.ToString(); + strArray5[2] = "UI"; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + strArray5[3] = directorySeparatorChar2.ToString(); + strArray5[4] = "Settings_Panel"; + Main.settingsPanelTexture = this.OurLoad(string.Concat(strArray5)); + string[] strArray6 = new string[5] + { + "Images", + null, + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + strArray6[1] = directorySeparatorChar2.ToString(); + strArray6[2] = "UI"; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + strArray6[3] = directorySeparatorChar2.ToString(); + strArray6[4] = "Settings_Panel_2"; + Main.settingsPanelTexture2 = this.OurLoad(string.Concat(strArray6)); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.miniMapFrameTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "MiniMapFrame"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.miniMapFrame2Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "MiniMapFrame2"); + for (int index11 = 0; index11 < Main.xmasTree.Length; ++index11) + { + Texture2D[] xmasTree = Main.xmasTree; + int index12 = index11; + object[] objArray = new object[4] + { + (object) "Images", + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray[1] = (object) directorySeparatorChar2.ToString(); + objArray[2] = (object) "Xmas_"; + objArray[3] = (object) index11; + Texture2D texture2D = this.OurLoad(string.Concat(objArray)); + xmasTree[index12] = texture2D; + } + for (int index13 = 0; index13 < 4; ++index13) + { + Texture2D[] clothesTexture = Main.clothesTexture; + int index14 = index13; + object[] objArray = new object[4] + { + (object) "Images", + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray[1] = (object) directorySeparatorChar2.ToString(); + objArray[2] = (object) "Clothes_"; + objArray[3] = (object) index13; + Texture2D texture2D = this.OurLoad(string.Concat(objArray)); + clothesTexture[index14] = texture2D; + } + for (int index15 = 0; index15 < Main.FlameTexture.Length; ++index15) + { + Texture2D[] flameTexture = Main.FlameTexture; + int index16 = index15; + object[] objArray = new object[4] + { + (object) "Images", + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray[1] = (object) directorySeparatorChar2.ToString(); + objArray[2] = (object) "Flame_"; + objArray[3] = (object) index15; + Texture2D texture2D = this.OurLoad(string.Concat(objArray)); + flameTexture[index16] = texture2D; + } + for (int index17 = 0; index17 < 3; ++index17) + { + Texture2D[] mapButtonTexture = Main.miniMapButtonTexture; + int index18 = index17; + object[] objArray = new object[4] + { + (object) "Images", + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray[1] = (object) directorySeparatorChar2.ToString(); + objArray[2] = (object) "MiniMapButton_"; + objArray[3] = (object) index17; + Texture2D texture2D = this.OurLoad(string.Concat(objArray)); + mapButtonTexture[index18] = texture2D; + } + for (int index19 = 0; index19 < 8; ++index19) + { + Texture2D[] mapIconTexture = Main.mapIconTexture; + int index20 = index19; + object[] objArray = new object[4] + { + (object) "Images", + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray[1] = (object) directorySeparatorChar2.ToString(); + objArray[2] = (object) "Map_"; + objArray[3] = (object) index19; + Texture2D texture2D = this.OurLoad(string.Concat(objArray)); + mapIconTexture[index20] = texture2D; + } + for (int index = 0; index < Main.underworldTexture.Length; ++index) + Main.underworldTexture[index] = this.OurLoad("Images/Backgrounds/Underworld " + (object) index); + Texture2D[] destTexture1 = Main.destTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D1 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Dest1"); + destTexture1[0] = texture2D1; + Texture2D[] destTexture2 = Main.destTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D2 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Dest2"); + destTexture2[1] = texture2D2; + Texture2D[] destTexture3 = Main.destTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D3 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Dest3"); + destTexture3[2] = texture2D3; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.actuatorTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Actuator"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.wireTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Wires"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.wire2Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Wires2"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.wire3Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Wires3"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.wire4Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Wires4"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.wireTextureNew = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "WiresNew"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.flyingCarpetTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "FlyingCarpet"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.hbTexture1 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "HealthBar1"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.hbTexture2 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "HealthBar2"); + object[] objArray1 = new object[4] + { + (object) "Images", + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray1[1] = (object) directorySeparatorChar2.ToString(); + objArray1[2] = (object) "logo_"; + objArray1[3] = (object) Main.rand.Next(1, 9); + Main.loTexture = this.OurLoad(string.Concat(objArray1)); + Main.spriteBatch = new SpriteBatch(this.GraphicsDevice); + Main.tileBatch = new TileBatch(this.GraphicsDevice); + Main.GameViewMatrix = new SpriteViewMatrix(this.GraphicsDevice); + Main.BackgroundViewMatrix = new SpriteViewMatrix(this.GraphicsDevice); + for (int index21 = 0; index21 < Main.npcHeadTexture.Length; ++index21) + { + Texture2D[] npcHeadTexture = Main.npcHeadTexture; + int index22 = index21; + object[] objArray2 = new object[4] + { + (object) "Images", + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray2[1] = (object) directorySeparatorChar2.ToString(); + objArray2[2] = (object) "NPC_Head_"; + objArray2[3] = (object) index21; + Texture2D texture2D4 = this.OurLoad(string.Concat(objArray2)); + npcHeadTexture[index22] = texture2D4; + } + for (int index23 = 0; index23 < Main.npcHeadBossTexture.Length; ++index23) + { + Texture2D[] npcHeadBossTexture = Main.npcHeadBossTexture; + int index24 = index23; + object[] objArray3 = new object[4] + { + (object) "Images", + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray3[1] = (object) directorySeparatorChar2.ToString(); + objArray3[2] = (object) "NPC_Head_Boss_"; + objArray3[3] = (object) index23; + Texture2D texture2D5 = this.OurLoad(string.Concat(objArray3)); + npcHeadBossTexture[index24] = texture2D5; + } + for (int index25 = 1; index25 < Main.BackPackTexture.Length; ++index25) + { + Texture2D[] backPackTexture = Main.BackPackTexture; + int index26 = index25; + object[] objArray4 = new object[4] + { + (object) "Images", + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray4[1] = (object) directorySeparatorChar2.ToString(); + objArray4[2] = (object) "BackPack_"; + objArray4[3] = (object) index25; + Texture2D texture2D6 = this.OurLoad(string.Concat(objArray4)); + backPackTexture[index26] = texture2D6; + } + for (int index27 = 1; index27 < 206; ++index27) + { + Texture2D[] buffTexture = Main.buffTexture; + int index28 = index27; + object[] objArray5 = new object[4] + { + (object) "Images", + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray5[1] = (object) directorySeparatorChar2.ToString(); + objArray5[2] = (object) "Buff_"; + objArray5[3] = (object) index27; + Texture2D texture2D7 = this.OurLoad(string.Concat(objArray5)); + buffTexture[index28] = texture2D7; + } + this.LoadBackground(0); + this.LoadBackground(49); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.minecartMountTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Mount_Minecart"); + for (int index29 = 0; index29 < Main.rudolphMountTexture.Length; ++index29) + { + Texture2D[] rudolphMountTexture = Main.rudolphMountTexture; + int index30 = index29; + object[] objArray6 = new object[4] + { + (object) "Images", + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray6[1] = (object) directorySeparatorChar2.ToString(); + objArray6[2] = (object) "Rudolph_"; + objArray6[3] = (object) index29; + Texture2D texture2D8 = this.OurLoad(string.Concat(objArray6)); + rudolphMountTexture[index30] = texture2D8; + } + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.bunnyMountTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Mount_Bunny"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.pigronMountTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Mount_Pigron"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.slimeMountTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Mount_Slime"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.turtleMountTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Mount_Turtle"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.unicornMountTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Mount_Unicorn"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.basiliskMountTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Mount_Basilisk"); + Texture2D[] mechMountTexture1 = Main.minecartMechMountTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D9 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Mount_MinecartMech"); + mechMountTexture1[0] = texture2D9; + Texture2D[] mechMountTexture2 = Main.minecartMechMountTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D10 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Mount_MinecartMechGlow"); + mechMountTexture2[1] = texture2D10; + Texture2D[] fishronMountTexture1 = Main.cuteFishronMountTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D11 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Mount_CuteFishron1"); + fishronMountTexture1[0] = texture2D11; + Texture2D[] fishronMountTexture2 = Main.cuteFishronMountTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D12 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Mount_CuteFishron2"); + fishronMountTexture2[1] = texture2D12; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.minecartWoodMountTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Mount_MinecartWood"); + Texture2D[] beeMountTexture1 = Main.beeMountTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D13 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Mount_Bee"); + beeMountTexture1[0] = texture2D13; + Texture2D[] beeMountTexture2 = Main.beeMountTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D14 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Mount_BeeWings"); + beeMountTexture2[1] = texture2D14; + Texture2D[] ufoMountTexture1 = Main.UFOMountTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D15 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Mount_UFO"); + ufoMountTexture1[0] = texture2D15; + Texture2D[] ufoMountTexture2 = Main.UFOMountTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D16 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Mount_UFOGlow"); + ufoMountTexture2[1] = texture2D16; + Texture2D[] drillMountTexture1 = Main.drillMountTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D17 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Mount_DrillRing"); + drillMountTexture1[0] = texture2D17; + Texture2D[] drillMountTexture2 = Main.drillMountTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D18 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Mount_DrillSeat"); + drillMountTexture2[1] = texture2D18; + Texture2D[] drillMountTexture3 = Main.drillMountTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D19 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Mount_DrillDiode"); + drillMountTexture3[2] = texture2D19; + Texture2D[] drillMountTexture4 = Main.drillMountTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D20 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Mount_Glow_DrillRing"); + drillMountTexture4[3] = texture2D20; + Texture2D[] drillMountTexture5 = Main.drillMountTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D21 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Mount_Glow_DrillSeat"); + drillMountTexture5[4] = texture2D21; + Texture2D[] drillMountTexture6 = Main.drillMountTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D22 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Mount_Glow_DrillDiode"); + drillMountTexture6[5] = texture2D22; + Texture2D[] scutlixMountTexture1 = Main.scutlixMountTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D23 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Mount_Scutlix"); + scutlixMountTexture1[0] = texture2D23; + Texture2D[] scutlixMountTexture2 = Main.scutlixMountTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D24 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Mount_ScutlixEyes"); + scutlixMountTexture2[1] = texture2D24; + Texture2D[] scutlixMountTexture3 = Main.scutlixMountTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D25 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Mount_ScutlixEyeGlow"); + scutlixMountTexture3[2] = texture2D25; + for (int index31 = 0; index31 < 3930; ++index31) + { + int index32 = ItemID.Sets.TextureCopyLoad[index31]; + if (index32 != -1) + { + Main.itemTexture[index31] = Main.itemTexture[index32]; + } + else + { + Texture2D[] itemTexture = Main.itemTexture; + int index33 = index31; + object[] objArray7 = new object[4] + { + (object) "Images", + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray7[1] = (object) directorySeparatorChar2.ToString(); + objArray7[2] = (object) "Item_"; + objArray7[3] = (object) index31; + Texture2D texture2D26 = this.OurLoad(string.Concat(objArray7)); + itemTexture[index33] = texture2D26; + } + } + for (int index34 = 0; index34 < Main.gemTexture.Length; ++index34) + { + Texture2D[] gemTexture = Main.gemTexture; + int index35 = index34; + object[] objArray8 = new object[4] + { + (object) "Images", + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray8[1] = (object) directorySeparatorChar2.ToString(); + objArray8[2] = (object) "Gem_"; + objArray8[3] = (object) index34; + Texture2D texture2D27 = this.OurLoad(string.Concat(objArray8)); + gemTexture[index35] = texture2D27; + } + for (int index36 = 0; index36 < 22; ++index36) + { + Texture2D[] cloudTexture = Main.cloudTexture; + int index37 = index36; + object[] objArray9 = new object[4] + { + (object) "Images", + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray9[1] = (object) directorySeparatorChar2.ToString(); + objArray9[2] = (object) "Cloud_"; + objArray9[3] = (object) index36; + Texture2D texture2D28 = this.OurLoad(string.Concat(objArray9)); + cloudTexture[index37] = texture2D28; + } + for (int index38 = 0; index38 < 5; ++index38) + { + Texture2D[] starTexture = Main.starTexture; + int index39 = index38; + object[] objArray10 = new object[4] + { + (object) "Images", + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray10[1] = (object) directorySeparatorChar2.ToString(); + objArray10[2] = (object) "Star_"; + objArray10[3] = (object) index38; + Texture2D texture2D29 = this.OurLoad(string.Concat(objArray10)); + starTexture[index39] = texture2D29; + } + for (int index40 = 0; index40 < 12; ++index40) + { + Texture2D[] liquidTexture = Main.liquidTexture; + int index41 = index40; + object[] objArray11 = new object[4] + { + (object) "Images", + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray11[1] = (object) directorySeparatorChar2.ToString(); + objArray11[2] = (object) "Liquid_"; + objArray11[3] = (object) index40; + Texture2D texture2D30 = this.OurLoad(string.Concat(objArray11)); + liquidTexture[index41] = texture2D30; + } + this.waterfallManager.LoadContent(); + Texture2D[] npcToggleTexture1 = Main.npcToggleTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D31 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "House_1"); + npcToggleTexture1[0] = texture2D31; + Texture2D[] npcToggleTexture2 = Main.npcToggleTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D32 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "House_2"); + npcToggleTexture2[1] = texture2D32; + Texture2D[] hbLockTexture1 = Main.HBLockTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D33 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Lock_0"); + hbLockTexture1[0] = texture2D33; + Texture2D[] hbLockTexture2 = Main.HBLockTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D34 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Lock_1"); + hbLockTexture2[1] = texture2D34; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.gridTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Grid"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.trashTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Trash"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.cdTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "CoolDown"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.logoTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Logo"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.logo2Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Logo2"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.dustTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Dust"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.sunTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Sun"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.sun2Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Sun2"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.sun3Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Sun3"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.blackTileTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Black_Tile"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.heartTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Heart"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.heart2Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Heart2"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.bubbleTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Bubble"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.flameTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Flame"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.manaTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Mana"); + for (int index42 = 0; index42 < Main.cursorTextures.Length; ++index42) + { + Texture2D[] cursorTextures = Main.cursorTextures; + int index43 = index42; + object[] objArray12 = new object[6]; + objArray12[0] = (object) "Images"; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray12[1] = (object) directorySeparatorChar2.ToString(); + objArray12[2] = (object) "UI"; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray12[3] = (object) directorySeparatorChar2.ToString(); + objArray12[4] = (object) "Cursor_"; + objArray12[5] = (object) index42; + Texture2D texture2D35 = this.OurLoad(string.Concat(objArray12)); + cursorTextures[index43] = texture2D35; + } + string[] strArray7 = new string[5] + { + "Images", + null, + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + strArray7[1] = directorySeparatorChar2.ToString(); + strArray7[2] = "UI"; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + strArray7[3] = directorySeparatorChar2.ToString(); + strArray7[4] = "Radial"; + Main.cursorRadialTexture = this.OurLoad(string.Concat(strArray7)); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.ninjaTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Ninja"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.antLionTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "AntlionBody"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.spikeBaseTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Spike_Base"); + Texture2D[] woodTexture1 = Main.woodTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D36 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Tiles_5_0"); + woodTexture1[0] = texture2D36; + Texture2D[] woodTexture2 = Main.woodTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D37 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Tiles_5_1"); + woodTexture2[1] = texture2D37; + Texture2D[] woodTexture3 = Main.woodTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D38 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Tiles_5_2"); + woodTexture3[2] = texture2D38; + Texture2D[] woodTexture4 = Main.woodTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D39 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Tiles_5_3"); + woodTexture4[3] = texture2D39; + Texture2D[] woodTexture5 = Main.woodTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D40 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Tiles_5_4"); + woodTexture5[4] = texture2D40; + Texture2D[] woodTexture6 = Main.woodTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D41 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Tiles_5_5"); + woodTexture6[5] = texture2D41; + Texture2D[] woodTexture7 = Main.woodTexture; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Texture2D texture2D42 = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Tiles_5_6"); + woodTexture7[6] = texture2D42; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.pumpkinMoonTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Moon_Pumpkin"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.snowMoonTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Moon_Snow"); + for (int index44 = 0; index44 < Main.moonTexture.Length; ++index44) + { + Texture2D[] moonTexture = Main.moonTexture; + int index45 = index44; + object[] objArray13 = new object[4] + { + (object) "Images", + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray13[1] = (object) directorySeparatorChar2.ToString(); + objArray13[2] = (object) "Moon_"; + objArray13[3] = (object) index44; + Texture2D texture2D43 = this.OurLoad(string.Concat(objArray13)); + moonTexture[index45] = texture2D43; + } + for (int index46 = 0; index46 < Main.treeTopTexture.Length; ++index46) + { + Texture2D[] treeTopTexture = Main.treeTopTexture; + int index47 = index46; + object[] objArray14 = new object[4] + { + (object) "Images", + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray14[1] = (object) directorySeparatorChar2.ToString(); + objArray14[2] = (object) "Tree_Tops_"; + objArray14[3] = (object) index46; + Texture2D texture2D44 = this.OurLoad(string.Concat(objArray14)); + treeTopTexture[index47] = texture2D44; + } + for (int index48 = 0; index48 < Main.treeBranchTexture.Length; ++index48) + { + Texture2D[] treeBranchTexture = Main.treeBranchTexture; + int index49 = index48; + object[] objArray15 = new object[4] + { + (object) "Images", + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray15[1] = (object) directorySeparatorChar2.ToString(); + objArray15[2] = (object) "Tree_Branches_"; + objArray15[3] = (object) index48; + Texture2D texture2D45 = this.OurLoad(string.Concat(objArray15)); + treeBranchTexture[index49] = texture2D45; + } + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.shroomCapTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Shroom_Tops"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.inventoryBackTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Inventory_Back"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.inventoryBack2Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Inventory_Back2"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.inventoryBack3Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Inventory_Back3"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.inventoryBack4Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Inventory_Back4"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.inventoryBack5Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Inventory_Back5"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.inventoryBack6Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Inventory_Back6"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.inventoryBack7Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Inventory_Back7"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.inventoryBack8Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Inventory_Back8"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.inventoryBack9Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Inventory_Back9"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.inventoryBack10Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Inventory_Back10"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.inventoryBack11Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Inventory_Back11"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.inventoryBack12Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Inventory_Back12"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.inventoryBack13Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Inventory_Back13"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.inventoryBack14Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Inventory_Back14"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.inventoryBack15Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Inventory_Back15"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.inventoryBack16Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Inventory_Back16"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.hairStyleBackTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "HairStyleBack"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.clothesStyleBackTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "ClothesStyleBack"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.inventoryTickOffTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Inventory_Tick_Off"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.inventoryTickOnTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Inventory_Tick_On"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.textBackTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Text_Back"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chatTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chat"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chat2Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chat2"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chatBackTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chat_Back"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.teamTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Team"); + PlayerDataInitializer.Load(); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chaosTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chaos"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.EyeLaserTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Eye_Laser"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.BoneEyesTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Bone_Eyes"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.BoneLaserTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Bone_Laser"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.lightDiscTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Light_Disc"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.confuseTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Confuse"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.probeTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Probe"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.sunOrbTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "SunOrb"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.sunAltarTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "SunAltar"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.xmasLightTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "XmasLight"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.beetleTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "BeetleOrb"); + for (int index50 = 0; index50 < 17; ++index50) + { + Texture2D[] chainsTexture = Main.chainsTexture; + int index51 = index50; + object[] objArray16 = new object[4] + { + (object) "Images", + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray16[1] = (object) directorySeparatorChar2.ToString(); + objArray16[2] = (object) "Chains_"; + objArray16[3] = (object) index50; + Texture2D texture2D46 = this.OurLoad(string.Concat(objArray16)); + chainsTexture[index51] = texture2D46; + } + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain20Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain20"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.fishingLineTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "FishingLine"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chainTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain2Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain2"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain3Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain3"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain4Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain4"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain5Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain5"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain6Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain6"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain7Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain7"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain8Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain8"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain9Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain9"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain10Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain10"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain11Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain11"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain12Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain12"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain13Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain13"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain14Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain14"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain15Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain15"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain16Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain16"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain17Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain17"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain18Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain18"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain19Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain19"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain20Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain20"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain21Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain21"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain22Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain22"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain23Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain23"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain24Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain24"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain25Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain25"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain26Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain26"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain27Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain27"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain28Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain28"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain29Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain29"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain30Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain30"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain31Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain31"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain32Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain32"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain33Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain33"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain34Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain34"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain35Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain35"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain36Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain36"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain37Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain37"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain38Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain38"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain39Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain39"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.chain40Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Chain40"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.eyeLaserSmallTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Eye_Laser_Small"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.boneArmTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Arm_Bone"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.pumpkingArmTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "PumpkingArm"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.pumpkingCloakTexture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "PumpkingCloak"); + directorySeparatorChar2 = Path.DirectorySeparatorChar; + Main.boneArm2Texture = this.OurLoad("Images" + directorySeparatorChar2.ToString() + "Arm_Bone_2"); + for (int index52 = 1; index52 < Main.gemChainTexture.Length; ++index52) + { + Texture2D[] gemChainTexture = Main.gemChainTexture; + int index53 = index52; + object[] objArray17 = new object[4] + { + (object) "Images", + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray17[1] = (object) directorySeparatorChar2.ToString(); + objArray17[2] = (object) "GemChain_"; + objArray17[3] = (object) index52; + Texture2D texture2D47 = this.OurLoad(string.Concat(objArray17)); + gemChainTexture[index53] = texture2D47; + } + for (int index54 = 1; index54 < Main.golemTexture.Length; ++index54) + { + Texture2D[] golemTexture = Main.golemTexture; + int index55 = index54; + object[] objArray18 = new object[4] + { + (object) "Images", + null, + null, + null + }; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray18[1] = (object) directorySeparatorChar2.ToString(); + objArray18[2] = (object) "GolemLights"; + objArray18[3] = (object) index54; + Texture2D texture2D48 = this.OurLoad(string.Concat(objArray18)); + golemTexture[index55] = texture2D48; + } + Main.npcAltTextures = new Texture2D[Main.npcTexture.Length][]; + for (int i = 0; i < NPCID.Sets.ExtraTextureCount.Length; ++i) + { + int num = NPCID.Sets.ExtraTextureCount[i]; + Main.npcAltTextures[i] = new Texture2D[num + 1]; + if (num > 0) + { + this.LoadNPC(i); + Main.npcAltTextures[i][0] = Main.npcTexture[i]; + } + for (int index56 = 1; index56 <= num; ++index56) + { + Texture2D[] npcAltTexture = Main.npcAltTextures[i]; + int index57 = index56; + object[] objArray19 = new object[6]; + objArray19[0] = (object) "Images"; + directorySeparatorChar2 = Path.DirectorySeparatorChar; + objArray19[1] = (object) directorySeparatorChar2.ToString(); + objArray19[2] = (object) "NPC_"; + objArray19[3] = (object) i; + objArray19[4] = (object) "_Alt_"; + objArray19[5] = (object) index56; + Texture2D texture2D49 = this.OurLoad(string.Concat(objArray19)); + npcAltTexture[index57] = texture2D49; + } + } + } + + private static void LoadMusic() + { + Main.engine = new AudioEngine("Content" + Path.DirectorySeparatorChar.ToString() + "TerrariaMusic.xgs"); + Main.soundBank = new SoundBank(Main.engine, "Content" + Path.DirectorySeparatorChar.ToString() + "Sound Bank.xsb"); + Main.waveBank = new WaveBank(Main.engine, "Content" + Path.DirectorySeparatorChar.ToString() + "Wave Bank.xwb"); + for (int index = 1; index < 42; ++index) Main.music[index] = Main.soundBank.GetCue("Music_" + (object) index); } - private IEnumerator LoadMusic_InSteps() + private void LoadSounds() { - Main.engine = new AudioEngine("Content\\TerrariaMusic.xgs"); - Main.soundBank = new SoundBank(Main.engine, "Content\\Sound Bank.xsb"); - Main.waveBank = new WaveBank(Main.engine, "Content\\Wave Bank.xwb"); - yield return (object) null; - for (int i = 1; i < 89; ++i) + Main.soundMech[0] = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Mech_0"); + Main.soundInstanceMech[0] = Main.soundMech[0].CreateInstance(); + Main.soundGrab = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Grab"); + Main.soundInstanceGrab = Main.soundGrab.CreateInstance(); + Main.soundPixie = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Pixie"); + Main.soundInstancePixie = Main.soundGrab.CreateInstance(); + Main.soundDig[0] = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Dig_0"); + Main.soundInstanceDig[0] = Main.soundDig[0].CreateInstance(); + Main.soundDig[1] = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Dig_1"); + Main.soundInstanceDig[1] = Main.soundDig[1].CreateInstance(); + Main.soundDig[2] = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Dig_2"); + Main.soundInstanceDig[2] = Main.soundDig[2].CreateInstance(); + Main.soundTink[0] = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Tink_0"); + Main.soundInstanceTink[0] = Main.soundTink[0].CreateInstance(); + Main.soundTink[1] = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Tink_1"); + Main.soundInstanceTink[1] = Main.soundTink[1].CreateInstance(); + Main.soundTink[2] = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Tink_2"); + Main.soundInstanceTink[2] = Main.soundTink[2].CreateInstance(); + Main.soundPlayerHit[0] = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Player_Hit_0"); + Main.soundInstancePlayerHit[0] = Main.soundPlayerHit[0].CreateInstance(); + Main.soundPlayerHit[1] = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Player_Hit_1"); + Main.soundInstancePlayerHit[1] = Main.soundPlayerHit[1].CreateInstance(); + Main.soundPlayerHit[2] = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Player_Hit_2"); + Main.soundInstancePlayerHit[2] = Main.soundPlayerHit[2].CreateInstance(); + Main.soundFemaleHit[0] = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Female_Hit_0"); + Main.soundInstanceFemaleHit[0] = Main.soundFemaleHit[0].CreateInstance(); + Main.soundFemaleHit[1] = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Female_Hit_1"); + Main.soundInstanceFemaleHit[1] = Main.soundFemaleHit[1].CreateInstance(); + Main.soundFemaleHit[2] = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Female_Hit_2"); + Main.soundInstanceFemaleHit[2] = Main.soundFemaleHit[2].CreateInstance(); + Main.soundPlayerKilled = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Player_Killed"); + Main.soundInstancePlayerKilled = Main.soundPlayerKilled.CreateInstance(); + Main.soundChat = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Chat"); + Main.soundInstanceChat = Main.soundChat.CreateInstance(); + Main.soundGrass = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Grass"); + Main.soundInstanceGrass = Main.soundGrass.CreateInstance(); + Main.soundDoorOpen = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Door_Opened"); + Main.soundInstanceDoorOpen = Main.soundDoorOpen.CreateInstance(); + Main.soundDoorClosed = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Door_Closed"); + Main.soundInstanceDoorClosed = Main.soundDoorClosed.CreateInstance(); + Main.soundMenuTick = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Menu_Tick"); + Main.soundInstanceMenuTick = Main.soundMenuTick.CreateInstance(); + Main.soundMenuOpen = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Menu_Open"); + Main.soundInstanceMenuOpen = Main.soundMenuOpen.CreateInstance(); + Main.soundMenuClose = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Menu_Close"); + Main.soundInstanceMenuClose = Main.soundMenuClose.CreateInstance(); + Main.soundShatter = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Shatter"); + Main.soundInstanceShatter = Main.soundShatter.CreateInstance(); + Main.soundCamera = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Camera"); + Main.soundInstanceCamera = Main.soundShatter.CreateInstance(); + for (int index = 0; index < Main.soundCoin.Length; ++index) { - Main.music[i] = Main.soundBank.GetCue("Music_" + (object) i); - yield return (object) null; + Main.soundCoin[index] = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Coin_" + (object) index); + Main.soundInstanceCoin[index] = Main.soundCoin[index].CreateInstance(); } + for (int index = 0; index < Main.soundDrip.Length; ++index) + { + Main.soundDrip[index] = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Drip_" + (object) index); + Main.soundInstanceDrip[index] = Main.soundDrip[index].CreateInstance(); + } + for (int index = 0; index < Main.soundZombie.Length; ++index) + { + Main.soundZombie[index] = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Zombie_" + (object) index); + Main.soundInstanceZombie[index] = Main.soundZombie[index].CreateInstance(); + } + for (int index = 0; index < Main.soundLiquid.Length; ++index) + { + Main.soundLiquid[index] = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Liquid_" + (object) index); + Main.soundInstanceLiquid[index] = Main.soundLiquid[index].CreateInstance(); + } + for (int index = 0; index < Main.soundRoar.Length; ++index) + { + Main.soundRoar[index] = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Roar_" + (object) index); + Main.soundInstanceRoar[index] = Main.soundRoar[index].CreateInstance(); + } + Main.soundSplash[0] = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Splash_0"); + Main.soundInstanceSplash[0] = Main.soundRoar[0].CreateInstance(); + Main.soundSplash[1] = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Splash_1"); + Main.soundInstanceSplash[1] = Main.soundSplash[1].CreateInstance(); + Main.soundDoubleJump = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Double_Jump"); + Main.soundInstanceDoubleJump = Main.soundRoar[0].CreateInstance(); + Main.soundRun = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Run"); + Main.soundInstanceRun = Main.soundRun.CreateInstance(); + Main.soundCoins = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Coins"); + Main.soundInstanceCoins = Main.soundCoins.CreateInstance(); + Main.soundUnlock = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Unlock"); + Main.soundInstanceUnlock = Main.soundUnlock.CreateInstance(); + Main.soundMaxMana = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "MaxMana"); + Main.soundInstanceMaxMana = Main.soundMaxMana.CreateInstance(); + Main.soundDrown = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Drown"); + Main.soundInstanceDrown = Main.soundDrown.CreateInstance(); + for (int index = 1; index < 126; ++index) + { + Main.soundItem[index] = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Item_" + (object) index); + Main.soundInstanceItem[index] = Main.soundItem[index].CreateInstance(); + } + for (int index = 1; index < 58; ++index) + { + Main.soundNPCHit[index] = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "NPC_Hit_" + (object) index); + Main.soundInstanceNPCHit[index] = Main.soundNPCHit[index].CreateInstance(); + } + for (int index = 1; index < 63; ++index) + { + Main.soundNPCKilled[index] = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "NPC_Killed_" + (object) index); + Main.soundInstanceNPCKilled[index] = Main.soundNPCKilled[index].CreateInstance(); + } + Main.trackableSounds = new SoundEffect[SoundID.TrackableLegacySoundCount]; + Main.trackableSoundInstances = new SoundEffectInstance[Main.trackableSounds.Length]; + for (int id = 0; id < Main.trackableSounds.Length; ++id) + { + Main.trackableSounds[id] = this.OurLoad("Sounds" + Path.DirectorySeparatorChar.ToString() + "Custom" + Path.DirectorySeparatorChar.ToString() + SoundID.GetTrackableLegacySoundPath(id)); + Main.trackableSoundInstances[id] = Main.trackableSounds[id].CreateInstance(); + } + Main.soundInstanceMoonlordCry = Main.soundNPCKilled[10].CreateInstance(); } protected override void UnloadContent() { } - public static void CheckForMoonEventsStartingTemporarySeasons() - { - if (Main.netMode == 1) - return; - int num1 = Main.forceHalloweenForToday ? 1 : 0; - bool forceXmasForToday = Main.forceXMasForToday; - Main.forceXMasForToday = false; - Main.forceHalloweenForToday = false; - int waveNumber = NPC.waveNumber; - double waveKills = (double) NPC.waveKills; - if (Main.pumpkinMoon && waveNumber >= 15) - Main.forceHalloweenForToday = true; - if (Main.snowMoon && waveNumber >= 20) - Main.forceXMasForToday = true; - Microsoft.Xna.Framework.Color color = new Microsoft.Xna.Framework.Color(50, (int) byte.MaxValue, 130); - int num2 = Main.forceHalloweenForToday ? 1 : 0; - if (num1 != num2) - WorldGen.BroadcastText(NetworkText.FromKey(Main.forceHalloweenForToday ? "Misc.StartedVictoryHalloween" : "Misc.EndedVictoryHalloween"), color); - if (forceXmasForToday == Main.forceXMasForToday) - return; - WorldGen.BroadcastText(NetworkText.FromKey(Main.forceXMasForToday ? "Misc.StartedVictoryXmas" : "Misc.EndedVictoryXmas"), color); - } - public static void stopMoonEvent() { - int waveNumber = NPC.waveNumber; - double waveKills = (double) NPC.waveKills; if (Main.pumpkinMoon) { Main.pumpkinMoon = false; @@ -8303,10 +8035,6 @@ label_127: Main.pumpkinMoon = true; Main.snowMoon = false; Main.bloodMoon = false; - Main.invasionProgress = -1; - Main.invasionProgressDisplayLeft = 0; - Main.invasionProgressAlpha = 0.0f; - Main.invasionProgressIcon = 0; if (Main.netMode == 1) return; NPC.waveKills = 0.0f; @@ -8320,7 +8048,7 @@ label_127: { if (Main.netMode != 2) return; - ChatHelper.BroadcastChatMessage(invasionWaveText, new Microsoft.Xna.Framework.Color(175, 75, (int) byte.MaxValue)); + NetMessage.BroadcastChatMessage(invasionWaveText, new Microsoft.Xna.Framework.Color(175, 75, (int) byte.MaxValue)); } } @@ -8329,10 +8057,6 @@ label_127: Main.snowMoon = true; Main.pumpkinMoon = false; Main.bloodMoon = false; - Main.invasionProgress = -1; - Main.invasionProgressDisplayLeft = 0; - Main.invasionProgressAlpha = 0.0f; - Main.invasionProgressIcon = 0; if (Main.netMode == 1) return; NPC.waveKills = 0.0f; @@ -8346,473 +8070,103 @@ label_127: { if (Main.netMode != 2) return; - ChatHelper.BroadcastChatMessage(invasionWaveText, new Microsoft.Xna.Framework.Color(175, 75, (int) byte.MaxValue)); + NetMessage.BroadcastChatMessage(invasionWaveText, new Microsoft.Xna.Framework.Color(175, 75, (int) byte.MaxValue)); } } protected void UpdateAudio() { - if (!SoundEngine.IsAudioSupported || !this._musicLoaded) - return; - if (!Main.showSplash) - SoundEngine.Update(); + if (!Main.dedServ) + { + bool flag = (!Main.hasFocus || Main.gamePaused) && Main.netMode == 0; + if (flag) + { + foreach (SlotVector.ItemPair trackedSound in (IEnumerable.ItemPair>) Main._trackedSounds) + ((ActiveSound) trackedSound.Value).Pause(); + } + else if (Main._areSoundsPaused && !flag) + { + foreach (SlotVector.ItemPair trackedSound in (IEnumerable.ItemPair>) Main._trackedSounds) + ((ActiveSound) trackedSound.Value).Resume(); + } + Main._areSoundsPaused = flag; + if (!Main._areSoundsPaused) + { + foreach (SlotVector.ItemPair trackedSound in (IEnumerable.ItemPair>) Main._trackedSounds) + { + ((ActiveSound) trackedSound.Value).Update(); + if (!((ActiveSound) trackedSound.Value).IsPlaying) + Main._trackedSounds.Remove((SlotId) trackedSound.Id); + } + } + } if ((double) Main.musicVolume == 0.0) Main.curMusic = 0; try { if (Main.dedServ) return; - bool isActive = this.IsActive; - if (!isActive) + if (Main.curMusic > 0) { - for (int index = 0; index < Main.music.Length; ++index) + if (!this.IsActive) { - if (Main.music[index] != null && !Main.music[index].IsPaused && Main.music[index].IsPlaying) + for (int index = 0; index < Main.music.Length; ++index) { - if ((double) Main.musicFade[index] > 0.0) + if (Main.music[index] != null && !Main.music[index].IsPaused && Main.music[index].IsPlaying) { - try - { - Main.music[index].Pause(); - } - catch (Exception ex) + if ((double) Main.musicFade[index] > 0.0) { + try + { + Main.music[index].Pause(); + } + catch (Exception ex) + { + } } } } - } - SoundEngine.StopAmbientSounds(); - } - else - { - for (int index = 0; index < Main.music.Length; ++index) - { - if (Main.music[index] != null && Main.music[index].IsPaused) - { - if ((double) Main.musicFade[index] > 0.0) - { - try - { - Main.music[index].Resume(); - } - catch (Exception ex) - { - } - } - } - } - } - if (Main.drunkWorld) - Main.TOWMusicUnlocked = true; - if (Main.gameMenu) - Main.swapMusic = false; - if (Main.swapMusic) - { - if (Main.drunkWorld) - this.UpdateAudio_DecideOnNewMusic(); - else - this.UpdateAudio_DecideOnTOWMusic(); - } - else if (!Main.gameMenu && Main.drunkWorld) - this.UpdateAudio_DecideOnTOWMusic(); - else - this.UpdateAudio_DecideOnNewMusic(); - if (Main.gameMenu || (double) Main.musicVolume == 0.0) - { - Main.musicBox2 = -1; - Main.SceneMetrics.ActiveMusicBox = -1; - } - if (Main.musicBox2 >= 0) - Main.SceneMetrics.ActiveMusicBox = Main.musicBox2; - if (Main.SceneMetrics.ActiveMusicBox >= 0) - { - if (Main.SceneMetrics.ActiveMusicBox == 0) - this.newMusic = 1; - if (Main.SceneMetrics.ActiveMusicBox == 1) - this.newMusic = 2; - if (Main.SceneMetrics.ActiveMusicBox == 2) - this.newMusic = 3; - if (Main.SceneMetrics.ActiveMusicBox == 4) - this.newMusic = 4; - if (Main.SceneMetrics.ActiveMusicBox == 5) - this.newMusic = 5; - if (Main.SceneMetrics.ActiveMusicBox == 3) - this.newMusic = 6; - if (Main.SceneMetrics.ActiveMusicBox == 6) - this.newMusic = 7; - if (Main.SceneMetrics.ActiveMusicBox == 7) - this.newMusic = 8; - if (Main.SceneMetrics.ActiveMusicBox == 9) - this.newMusic = 9; - if (Main.SceneMetrics.ActiveMusicBox == 8) - this.newMusic = 10; - if (Main.SceneMetrics.ActiveMusicBox == 11) - this.newMusic = 11; - if (Main.SceneMetrics.ActiveMusicBox == 10) - this.newMusic = 12; - if (Main.SceneMetrics.ActiveMusicBox == 12) - this.newMusic = 13; - if (Main.SceneMetrics.ActiveMusicBox == 13) - this.newMusic = 14; - if (Main.SceneMetrics.ActiveMusicBox == 14) - this.newMusic = 15; - if (Main.SceneMetrics.ActiveMusicBox == 15) - this.newMusic = 16; - if (Main.SceneMetrics.ActiveMusicBox == 16) - this.newMusic = 17; - if (Main.SceneMetrics.ActiveMusicBox == 17) - this.newMusic = 18; - if (Main.SceneMetrics.ActiveMusicBox == 18) - this.newMusic = 19; - if (Main.SceneMetrics.ActiveMusicBox == 19) - this.newMusic = 20; - if (Main.SceneMetrics.ActiveMusicBox == 20) - this.newMusic = 21; - if (Main.SceneMetrics.ActiveMusicBox == 21) - this.newMusic = 22; - if (Main.SceneMetrics.ActiveMusicBox == 22) - this.newMusic = 23; - if (Main.SceneMetrics.ActiveMusicBox == 23) - this.newMusic = 24; - if (Main.SceneMetrics.ActiveMusicBox == 24) - this.newMusic = 25; - if (Main.SceneMetrics.ActiveMusicBox == 25) - this.newMusic = 26; - if (Main.SceneMetrics.ActiveMusicBox == 26) - this.newMusic = 27; - if (Main.SceneMetrics.ActiveMusicBox == 27) - this.newMusic = 29; - if (Main.SceneMetrics.ActiveMusicBox == 28) - this.newMusic = 30; - if (Main.SceneMetrics.ActiveMusicBox == 29) - this.newMusic = 31; - if (Main.SceneMetrics.ActiveMusicBox == 30) - this.newMusic = 32; - if (Main.SceneMetrics.ActiveMusicBox == 31) - this.newMusic = 33; - if (Main.SceneMetrics.ActiveMusicBox == 32) - this.newMusic = 38; - if (Main.SceneMetrics.ActiveMusicBox == 33) - this.newMusic = 37; - if (Main.SceneMetrics.ActiveMusicBox == 34) - this.newMusic = 35; - if (Main.SceneMetrics.ActiveMusicBox == 35) - this.newMusic = 36; - if (Main.SceneMetrics.ActiveMusicBox == 36) - this.newMusic = 34; - if (Main.SceneMetrics.ActiveMusicBox == 37) - this.newMusic = 39; - if (Main.SceneMetrics.ActiveMusicBox == 38) - this.newMusic = 40; - if (Main.SceneMetrics.ActiveMusicBox == 39) - this.newMusic = 41; - if (Main.SceneMetrics.ActiveMusicBox == 40) - this.newMusic = 44; - if (Main.SceneMetrics.ActiveMusicBox == 41) - this.newMusic = 48; - if (Main.SceneMetrics.ActiveMusicBox == 42) - this.newMusic = 42; - if (Main.SceneMetrics.ActiveMusicBox == 43) - this.newMusic = 43; - if (Main.SceneMetrics.ActiveMusicBox == 44) - this.newMusic = 46; - if (Main.SceneMetrics.ActiveMusicBox == 45) - this.newMusic = 47; - if (Main.SceneMetrics.ActiveMusicBox == 46) - this.newMusic = 49; - if (Main.SceneMetrics.ActiveMusicBox == 47) - this.newMusic = 51; - if (Main.SceneMetrics.ActiveMusicBox == 48) - this.newMusic = 52; - if (Main.SceneMetrics.ActiveMusicBox == 49) - this.newMusic = 53; - if (Main.SceneMetrics.ActiveMusicBox == 50) - this.newMusic = 54; - if (Main.SceneMetrics.ActiveMusicBox == 51) - this.newMusic = 55; - if (Main.SceneMetrics.ActiveMusicBox == 52) - this.newMusic = 56; - if (Main.SceneMetrics.ActiveMusicBox == 53) - this.newMusic = 57; - if (Main.SceneMetrics.ActiveMusicBox == 54) - this.newMusic = 58; - if (Main.SceneMetrics.ActiveMusicBox == 55) - this.newMusic = 59; - if (Main.SceneMetrics.ActiveMusicBox == 56) - this.newMusic = 60; - if (Main.SceneMetrics.ActiveMusicBox == 57) - this.newMusic = 61; - if (Main.SceneMetrics.ActiveMusicBox == 58) - this.newMusic = 62; - if (Main.SceneMetrics.ActiveMusicBox == 59) - this.newMusic = 63; - if (Main.SceneMetrics.ActiveMusicBox == 60) - this.newMusic = 64; - if (Main.SceneMetrics.ActiveMusicBox == 61) - this.newMusic = 65; - if (Main.SceneMetrics.ActiveMusicBox == 62) - this.newMusic = 66; - if (Main.SceneMetrics.ActiveMusicBox == 63) - this.newMusic = 67; - if (Main.SceneMetrics.ActiveMusicBox == 64) - this.newMusic = 68; - if (Main.SceneMetrics.ActiveMusicBox == 65) - this.newMusic = 69; - if (Main.SceneMetrics.ActiveMusicBox == 66) - this.newMusic = 70; - if (Main.SceneMetrics.ActiveMusicBox == 67) - this.newMusic = 71; - if (Main.SceneMetrics.ActiveMusicBox == 68) - this.newMusic = 72; - if (Main.SceneMetrics.ActiveMusicBox == 69) - this.newMusic = 73; - if (Main.SceneMetrics.ActiveMusicBox == 70) - this.newMusic = 74; - if (Main.SceneMetrics.ActiveMusicBox == 71) - this.newMusic = 75; - if (Main.SceneMetrics.ActiveMusicBox == 72) - this.newMusic = 76; - if (Main.SceneMetrics.ActiveMusicBox == 73) - this.newMusic = 77; - if (Main.SceneMetrics.ActiveMusicBox == 74) - this.newMusic = 78; - if (Main.SceneMetrics.ActiveMusicBox == 75) - this.newMusic = 79; - if (Main.SceneMetrics.ActiveMusicBox == 76) - this.newMusic = 80; - if (Main.SceneMetrics.ActiveMusicBox == 77) - this.newMusic = 81; - if (Main.SceneMetrics.ActiveMusicBox == 78) - this.newMusic = 82; - if (Main.SceneMetrics.ActiveMusicBox == 79) - this.newMusic = 83; - if (Main.SceneMetrics.ActiveMusicBox == 80) - this.newMusic = 84; - if (Main.SceneMetrics.ActiveMusicBox == 81) - this.newMusic = 85; - if (Main.SceneMetrics.ActiveMusicBox == 82) - this.newMusic = 86; - if (Main.SceneMetrics.ActiveMusicBox == 83) - this.newMusic = 87; - if (Main.SceneMetrics.ActiveMusicBox == 84) - this.newMusic = 88; - } - if (Main.curMusic != this.newMusic) - this._musicReplayDelay = 0; - if (this._musicReplayDelay > 0) - --this._musicReplayDelay; - Main.curMusic = this.newMusic; - float num1 = 1f; - if (NPC.MoonLordCountdown > 0) - { - float num2 = (float) NPC.MoonLordCountdown / 3600f; - float amount = num2 * num2; - if (NPC.MoonLordCountdown > 720) - { - num1 = MathHelper.Lerp(0.0f, 1f, amount); + for (int index = 0; index < Main.soundInstanceLiquid.Length; ++index) + Main.soundInstanceLiquid[index].Stop(); } else { - num1 = 0.0f; - Main.curMusic = 0; + for (int index = 0; index < Main.music.Length; ++index) + { + if (Main.music[index] != null && Main.music[index].IsPaused) + { + if ((double) Main.musicFade[index] > 0.0) + { + try + { + Main.music[index].Resume(); + } + catch (Exception ex) + { + } + } + } + } } - if (NPC.MoonLordCountdown == 1 && Main.curMusic >= 1 && Main.curMusic < 89) - Main.musicFade[Main.curMusic] = 0.0f; } - for (int index = 1; index < 89; ++index) - { - float num3 = Main.musicFade[index] * Main.musicVolume * num1; - if (index >= 62 && index <= 88) - num3 *= 0.9f; - else if (index == 52) - { - num3 *= 1.15f; - if ((double) num3 > 1.0) - num3 = 1f; - } - if (index == 28) - { - float num4 = 0.5f; - float num5 = (float) ((double) Main.cloudAlpha / 9.0 * 10.0 * (double) num4 + (1.0 - (double) num4)); - if ((double) num5 > 1.0) - num5 = 1f; - if (Main.gameMenu) - num5 = 0.0f; - float num6 = num5 * (float) Math.Pow((double) Main.atmo, 4.0); - if ((double) Main.cloudAlpha > 0.0 && (double) Main.player[Main.myPlayer].position.Y < Main.worldSurface * 16.0 + (double) (Main.screenHeight / 2) && !Main.player[Main.myPlayer].ZoneSnow) - { - if ((double) Main.ambientVolume == 0.0 || (double) num6 == 0.0) - { - if (Main.music[index].IsPlaying) - Main.music[index].Stop(AudioStopOptions.Immediate); - } - else if (!Main.music[index].IsPlaying) - { - Main.music[index] = Main.soundBank.GetCue("Music_" + (object) index); - Main.music[index].Play(); - Main.music[index].SetVariable("Volume", Main.musicFade[index] * Main.ambientVolume * num6); - } - else if (Main.music[index].IsPaused && this.IsActive) - { - Main.music[index].Resume(); - } - else - { - Main.musicFade[index] += 0.005f; - if ((double) Main.musicFade[index] > 1.0) - Main.musicFade[index] = 1f; - Main.music[index].SetVariable("Volume", Main.musicFade[index] * Main.ambientVolume * num6); - } - } - else if (Main.music[index].IsPlaying) - { - if ((double) Main.musicFade[index] > 0.0) - Main.musicFade[index] -= 0.005f; - if ((double) Main.musicFade[index] <= 0.0) - { - Main.musicFade[index] -= 0.0f; - Main.music[index].Stop(AudioStopOptions.Immediate); - } - else - Main.music[index].SetVariable("Volume", Main.musicFade[index] * Main.ambientVolume * num6); - } - else - Main.musicFade[index] = 0.0f; - } - else if (index == 45) - { - float num7 = 0.7f; - float num8 = (float) ((double) Math.Abs(Main.windSpeedCurrent) * (double) num7 + (1.0 - (double) num7)); - if ((double) num8 > 1.0) - num8 = 1f; - float num9 = num8 * 0.9f; - float num10 = 20f; - float num11 = num9 * (float) Math.Pow((double) Main.atmo, 4.0); - if (!Main.gameMenu && (double) Math.Abs(Main.windSpeedCurrent) >= (double) num10 / 50.0 && (double) Main.player[Main.myPlayer].position.Y < Main.worldSurface * 16.0 + (double) (Main.screenHeight / 2)) - { - if ((double) Main.ambientVolume == 0.0 || (double) num11 == 0.0) - { - if (Main.music[index].IsPlaying) - Main.music[index].Stop(AudioStopOptions.Immediate); - } - else if (!Main.music[index].IsPlaying) - { - Main.music[index] = Main.soundBank.GetCue("Music_" + (object) index); - Main.music[index].Play(); - Main.music[index].SetVariable("Volume", Main.musicFade[index] * Main.ambientVolume * num11); - } - else if (Main.music[index].IsPaused && this.IsActive) - { - Main.music[index].Resume(); - } - else - { - Main.musicFade[index] += 0.005f; - if ((double) Main.musicFade[index] > 1.0) - Main.musicFade[index] = 1f; - Main.music[index].SetVariable("Volume", Main.musicFade[index] * Main.ambientVolume * num11); - } - } - else if (Main.music[index].IsPlaying) - { - if ((double) Main.musicFade[index] > 0.0) - Main.musicFade[index] -= 0.005f; - if ((double) Main.musicFade[index] <= 0.0) - { - Main.musicFade[index] -= 0.0f; - Main.music[index].Stop(AudioStopOptions.Immediate); - } - else - Main.music[index].SetVariable("Volume", Main.musicFade[index] * Main.ambientVolume * num11); - } - else - Main.musicFade[index] = 0.0f; - } - else if (index == Main.curMusic) - { - if (!Main.music[index].IsPlaying & isActive) - { - if (this._musicReplayDelay == 0) - { - if (Main.SettingMusicReplayDelayEnabled) - this._musicReplayDelay = Main.rand.Next(14400, 21601); - Main.music[index].Stop(AudioStopOptions.Immediate); - Main.music[index] = Main.soundBank.GetCue("Music_" + (object) index); - Main.music[index].SetVariable("Volume", num3); - Main.music[index].Play(); - } - } - else - { - Main.musicFade[index] += 0.005f; - if ((double) Main.musicFade[index] > 1.0) - Main.musicFade[index] = 1f; - Main.music[index].SetVariable("Volume", num3); - } - } - else if (Main.music[index].IsPlaying || !Main.music[index].IsStopped) - { - if ((double) Main.musicFade[Main.curMusic] > 0.25) - Main.musicFade[index] -= 0.005f; - else if (Main.curMusic == 0) - Main.musicFade[index] = 0.0f; - if ((double) Main.musicFade[index] <= 0.0) - { - Main.musicFade[index] = 0.0f; - Main.music[index].SetVariable("Volume", 0.0f); - Main.music[index].Stop(AudioStopOptions.Immediate); - } - else - Main.music[index].SetVariable("Volume", num3); - } - else - Main.musicFade[index] = 0.0f; - } - if (Main.musicError <= 0) - return; - --Main.musicError; - } - catch - { - ++Main.musicError; - if (Main.musicError < 100) - return; - Main.musicError = 0; - Main.musicVolume = 0.0f; - } - } - - public static bool IsItAHappyWindyDay => Main._shouldUseWindyDayMusic; - - public static bool IsItStorming => Main._shouldUseStormMusic; - - public static bool WindyEnoughForKiteDrops => (double) Math.Abs(Main.windSpeedTarget) >= (double) Main._maxWind; - - private void UpdateAudio_DecideOnTOWMusic() - { - bool flag1 = false; - bool flag2 = false; - bool flag3 = false; - bool flag4 = false; - bool flag5 = false; - bool flag6 = false; - bool flag7 = false; - bool flag8 = false; - bool flag9 = false; - bool flag10 = false; - bool flag11 = false; - bool flag12 = false; - bool flag13 = false; - bool flag14 = false; - bool flag15 = false; - if (!Main.showSplash) - { + bool flag1 = false; + bool flag2 = false; + bool flag3 = false; + bool flag4 = false; + bool flag5 = false; + bool flag6 = false; + bool flag7 = false; + bool flag8 = false; + bool flag9 = false; + bool flag10 = false; + bool flag11 = false; + bool flag12 = false; Microsoft.Xna.Framework.Rectangle rectangle1 = new Microsoft.Xna.Framework.Rectangle((int) Main.screenPosition.X, (int) Main.screenPosition.Y, Main.screenWidth, Main.screenHeight); + int num1 = 5000; for (int index = 0; index < 200; ++index) { if (Main.npc[index].active) { - int num1 = 5000; int num2 = 0; switch (Main.npc[index].type) { @@ -8826,25 +8180,20 @@ label_127: case 28: case 29: case 111: - case 471: num2 = 11; break; case 113: case 114: - num2 = 3; - break; case 125: case 126: num2 = 2; break; - case (int) sbyte.MaxValue: case 134: - num2 = 2; - break; case 143: case 144: case 145: - num2 = 11; + case 266: + num2 = 3; break; case 212: case 213: @@ -8855,22 +8204,16 @@ label_127: num2 = 8; break; case 222: - num2 = 1; + num2 = 5; break; case 245: - num2 = 2; + num2 = 4; break; case 262: case 263: case 264: num2 = 6; break; - case 266: - num2 = 1; - break; - case 370: - num2 = 15; - break; case 381: case 382: case 383: @@ -8896,19 +8239,12 @@ label_127: case 438: if ((double) Main.npc[index].ai[1] == 1.0) { - num1 = 1600; - num2 = 2; + num2 = 4; break; } break; case 439: - num2 = 2; - break; - case 636: - num2 = 14; - break; - case 657: - num2 = 13; + num2 = 4; break; } if (NPCID.Sets.BelongsToInvasionOldOnesArmy[Main.npc[index].type]) @@ -8924,602 +8260,429 @@ label_127: { case 1: flag1 = true; - goto label_49; + goto label_88; case 2: flag2 = true; - goto label_49; + goto label_88; case 3: flag3 = true; - goto label_49; + goto label_88; case 4: flag4 = true; - goto label_49; + goto label_88; case 5: flag5 = true; - goto label_49; + goto label_88; case 6: flag6 = true; - goto label_49; + goto label_88; case 7: flag7 = true; - goto label_49; + goto label_88; case 8: flag8 = true; - goto label_49; + goto label_88; case 9: flag9 = true; - goto label_49; + goto label_88; case 10: flag10 = true; - goto label_49; + goto label_88; case 11: flag11 = true; - goto label_49; + goto label_88; case 12: flag12 = true; - goto label_49; - case 13: - flag13 = true; - goto label_49; - case 14: - flag14 = true; - goto label_49; - case 15: - flag15 = true; - goto label_49; + goto label_88; default: - goto label_49; + goto label_88; } } } } } - } -label_49: - double num3 = ((double) Main.screenPosition.X + (double) (Main.screenWidth / 2)) / 16.0; - if ((double) Main.musicVolume == 0.0) - { - this.newMusic = 0; - } - else - { - float num4 = (float) (Main.maxTilesX / 4200); - float num5 = num4 * num4; - float num6 = (float) ((((double) Main.screenPosition.Y + (double) (Main.screenHeight / 2)) / 16.0 - (65.0 + 10.0 * (double) num5)) / (Main.worldSurface / 5.0)); - if (flag7) - this.newMusic = 84; - else if (flag9) - this.newMusic = 82; - else if (flag10) - this.newMusic = 83; - else if (flag6) - this.newMusic = 85; - else if (flag14) - this.newMusic = 80; - else if (flag15) - this.newMusic = 80; - else if (flag2) - this.newMusic = 80; - else if (flag1) - this.newMusic = 81; - else if (flag3) - this.newMusic = 87; - else if (flag4) - this.newMusic = 81; - else if (flag5) - this.newMusic = 81; - else if (flag13) - this.newMusic = 80; - else if (flag8) - this.newMusic = 82; - else if (flag11) - this.newMusic = 82; - else if (flag12) - this.newMusic = 82; - else if (Main.eclipse && (double) Main.player[Main.myPlayer].position.Y < Main.worldSurface * 16.0 + (double) (Main.screenHeight / 2)) - this.newMusic = 79; - else if (Main.player[Main.myPlayer].ZoneSandstorm) - this.newMusic = 66; - else if ((double) Main.player[Main.myPlayer].position.Y > (double) (Main.UnderworldLayer * 16)) - this.newMusic = 71; - else if ((double) num6 < 1.0) - this.newMusic = 70; - else if (Main.tile[(int) ((double) Main.player[Main.myPlayer].Center.X / 16.0), (int) ((double) Main.player[Main.myPlayer].Center.Y / 16.0)].wall == (ushort) 87) - this.newMusic = 69; - else if (Main.player[Main.myPlayer].ZoneDungeon) - this.newMusic = 69; - else if (Main.bgStyle == 9 && (double) Main.player[Main.myPlayer].position.Y < Main.worldSurface * 16.0 + (double) (Main.screenHeight / 2) || Main.undergroundBackground == 2) - this.newMusic = 68; - else if (Main.player[Main.myPlayer].ZoneCorrupt) - this.newMusic = !Main.player[Main.myPlayer].ZoneCrimson || Main.SceneMetrics.BloodTileCount <= Main.SceneMetrics.EvilTileCount ? ((double) Main.player[Main.myPlayer].position.Y <= Main.worldSurface * 16.0 + (double) (Main.screenHeight / 2) ? 73 : 74) : ((double) Main.player[Main.myPlayer].position.Y <= Main.worldSurface * 16.0 + (double) (Main.screenHeight / 2) ? 75 : 76); - else if (Main.player[Main.myPlayer].ZoneCrimson) - this.newMusic = (double) Main.player[Main.myPlayer].position.Y <= Main.worldSurface * 16.0 + (double) (Main.screenHeight / 2) ? 75 : 76; - else if (Main.player[Main.myPlayer].ZoneMeteor) - this.newMusic = 79; - else if (Main.player[Main.myPlayer].ZoneGraveyard) - this.newMusic = 79; - else if (Main.player[Main.myPlayer].ZoneJungle) - this.newMusic = 86; - else if (Main.player[Main.myPlayer].ZoneSnow) - this.newMusic = (double) Main.player[Main.myPlayer].position.Y <= Main.worldSurface * 16.0 + (double) (Main.screenHeight / 2) ? 72 : 77; - else if ((double) Main.player[Main.myPlayer].position.Y >= Main.worldSurface * 16.0 + (double) (Main.screenHeight / 2) && !WorldGen.oceanDepths((int) ((double) Main.screenPosition.X + (double) (Main.screenWidth / 2)) / 16, (int) ((double) Main.screenPosition.Y + (double) (Main.screenHeight / 2)) / 16)) - this.newMusic = !Main.player[Main.myPlayer].ZoneHallow ? (!Main.player[Main.myPlayer].ZoneUndergroundDesert ? 65 : 66) : 78; - else if (Main.dayTime && Main.player[Main.myPlayer].ZoneHallow) - this.newMusic = (double) Main.cloudAlpha <= 0.0 || Main.gameMenu ? 88 : 62; - else if (Main._shouldUseStormMusic) - this.newMusic = !Main.bloodMoon ? 62 : 79; - else if (WorldGen.oceanDepths((int) ((double) Main.screenPosition.X + (double) (Main.screenWidth / 2)) / 16, (int) ((double) Main.screenPosition.Y + (double) (Main.screenHeight / 2)) / 16)) - this.newMusic = !Main.bloodMoon ? 67 : 79; - else if (Main.player[Main.myPlayer].ZoneDesert) - this.newMusic = 66; - else if (Main.dayTime) - this.newMusic = (double) Main.cloudAlpha <= 0.0 || Main.gameMenu ? 63 : 62; - else if (!Main.dayTime) - this.newMusic = !Main.bloodMoon ? ((double) Main.cloudAlpha <= 0.0 || Main.gameMenu ? 64 : 64) : 79; - if ((double) Main.screenPosition.Y / 16.0 < Main.worldSurface + 10.0 && Main.pumpkinMoon) - this.newMusic = 82; - if ((double) Main.screenPosition.Y / 16.0 >= Main.worldSurface + 10.0 || !Main.snowMoon) - return; - this.newMusic = 82; - } - } - - private void UpdateAudio_DecideOnNewMusic() - { - bool flag1 = false; - bool flag2 = false; - bool flag3 = false; - bool flag4 = false; - bool flag5 = false; - bool flag6 = false; - bool flag7 = false; - bool flag8 = false; - bool flag9 = false; - bool flag10 = false; - bool flag11 = false; - bool flag12 = false; - bool flag13 = false; - bool flag14 = false; - bool flag15 = false; - bool flag16 = (double) Main.LocalPlayer.townNPCs > 2.0; - bool slimeRain = Main.slimeRain; - float num1 = 0.0f; - for (int index = 0; index < 89; ++index) - { - if ((double) Main.musicFade[index] > (double) num1) - { - num1 = Main.musicFade[index]; - if ((double) num1 == 1.0) - this.lastMusicPlayed = index; - } - } - if (this.lastMusicPlayed == 50) - Main.musicNoCrossFade[51] = true; - if (!Main.showSplash) - { - Microsoft.Xna.Framework.Rectangle rectangle1 = new Microsoft.Xna.Framework.Rectangle((int) Main.screenPosition.X, (int) Main.screenPosition.Y, Main.screenWidth, Main.screenHeight); - for (int index = 0; index < 200; ++index) - { - if (Main.npc[index].active) - { - int num2 = 5000; - int num3 = 0; - switch (Main.npc[index].type) - { - case 13: - case 14: - case 15: - num3 = 1; - break; - case 26: - case 27: - case 28: - case 29: - case 111: - case 471: - num3 = 11; - break; - case 113: - case 114: - case 125: - case 126: - num3 = 2; - break; - case 134: - case 143: - case 144: - case 145: - case 266: - num3 = 3; - break; - case 212: - case 213: - case 214: - case 215: - case 216: - case 491: - num3 = 8; - break; - case 222: - num3 = 5; - break; - case 245: - num3 = 4; - break; - case 262: - case 263: - case 264: - num3 = 6; - break; - case 370: - num3 = 15; - break; - case 381: - case 382: - case 383: - case 385: - case 386: - case 388: - case 389: - case 390: - case 391: - case 395: - case 520: - num3 = 9; - break; - case 398: - num3 = 7; - break; - case 422: - case 493: - case 507: - case 517: - num3 = 10; - break; - case 438: - if ((double) Main.npc[index].ai[1] == 1.0) - { - num2 = 1600; - num3 = 4; - break; - } - break; - case 439: - num3 = 4; - break; - case 636: - num3 = 14; - break; - case 657: - num3 = 13; - break; - } - if (NPCID.Sets.BelongsToInvasionOldOnesArmy[Main.npc[index].type]) - num3 = 12; - if (num3 == 0 && Main.npc[index].boss) - num3 = 1; - if (num3 != 0) - { - Microsoft.Xna.Framework.Rectangle rectangle2 = new Microsoft.Xna.Framework.Rectangle((int) ((double) Main.npc[index].position.X + (double) (Main.npc[index].width / 2)) - num2, (int) ((double) Main.npc[index].position.Y + (double) (Main.npc[index].height / 2)) - num2, num2 * 2, num2 * 2); - if (rectangle1.Intersects(rectangle2)) - { - switch (num3) - { - case 1: - flag1 = true; - goto label_56; - case 2: - flag2 = true; - goto label_56; - case 3: - flag3 = true; - goto label_56; - case 4: - flag4 = true; - goto label_56; - case 5: - flag5 = true; - goto label_56; - case 6: - flag6 = true; - goto label_56; - case 7: - flag7 = true; - goto label_56; - case 8: - flag8 = true; - goto label_56; - case 9: - flag9 = true; - goto label_56; - case 10: - flag10 = true; - goto label_56; - case 11: - flag11 = true; - goto label_56; - case 12: - flag12 = true; - goto label_56; - case 13: - flag13 = true; - goto label_56; - case 14: - flag14 = true; - goto label_56; - case 15: - flag15 = true; - goto label_56; - default: - goto label_56; - } - } - } - } - } - } -label_56: - double num4 = ((double) Main.screenPosition.X + (double) (Main.screenWidth / 2)) / 16.0; - if ((double) Main.musicVolume == 0.0) - this.newMusic = 0; - else if (Main.gameMenu) - { - if (Main.netMode != 2) - { - if (WorldGen.drunkWorldGen) - this.newMusic = 60; - else if (this.playOldTile) - this.newMusic = 6; - else if (!Main._isAsyncLoadComplete) - { - this.newMusic = 50; - } - else - { - if (Main.music[50].IsPlaying) - return; - this.newMusic = 51; - if (!Main.musicNoCrossFade[51]) - return; - Main.musicFade[51] = 1f; - } - } - else +label_88: + int num3 = (int) (((double) Main.screenPosition.X + (double) (Main.screenWidth / 2)) / 16.0); + if ((double) Main.musicVolume == 0.0) this.newMusic = 0; - } - else - { - float num5 = (float) (Main.maxTilesX / 4200); - float num6 = num5 * num5; - float num7 = (float) ((((double) Main.screenPosition.Y + (double) (Main.screenHeight / 2)) / 16.0 - (65.0 + 10.0 * (double) num6)) / (Main.worldSurface / 5.0)); - if (Main.player[Main.myPlayer].happyFunTorchTime) - this.newMusic = 13; - else if (flag7) - this.newMusic = 38; - else if (flag9) - this.newMusic = 37; - else if (flag10) - this.newMusic = 34; - else if (flag6) - this.newMusic = 24; - else if (flag14) - this.newMusic = 57; - else if (flag15) - this.newMusic = 58; - else if (flag2) - this.newMusic = 12; - else if (flag1) - this.newMusic = 5; - else if (flag3) - this.newMusic = 13; - else if (flag4) - this.newMusic = 17; - else if (flag5) - this.newMusic = 25; - else if (flag13) - this.newMusic = 56; - else if (flag8) - this.newMusic = 35; - else if (flag11) - this.newMusic = 39; - else if (flag12) - this.newMusic = 41; - else if (Main.eclipse && (double) Main.player[Main.myPlayer].position.Y < Main.worldSurface * 16.0 + (double) (Main.screenHeight / 2)) - this.newMusic = 27; - else if (slimeRain && !Main.player[Main.myPlayer].ZoneGraveyard && (!Main.bloodMoon || Main.dayTime) && (double) Main.player[Main.myPlayer].position.Y < Main.worldSurface * 16.0 + (double) (Main.screenHeight / 2)) - this.newMusic = 48; - else if (flag16 && Main.dayTime && ((double) Main.cloudAlpha == 0.0 && !Main._shouldUseWindyDayMusic || (double) Main.player[Main.myPlayer].position.Y >= Main.worldSurface * 16.0 + (double) (Main.screenHeight / 2)) && !Main.player[Main.myPlayer].ZoneGraveyard) - this.newMusic = 46; - else if (flag16 && !Main.dayTime && (!Main.bloodMoon && (double) Main.cloudAlpha == 0.0 || (double) Main.player[Main.myPlayer].position.Y >= Main.worldSurface * 16.0 + (double) (Main.screenHeight / 2)) && !Main.player[Main.myPlayer].ZoneGraveyard) - this.newMusic = 47; - else if (Main.player[Main.myPlayer].ZoneSandstorm) - this.newMusic = 40; - else if ((double) Main.player[Main.myPlayer].position.Y > (double) (Main.UnderworldLayer * 16)) - this.newMusic = 36; - else if ((double) num7 < 1.0) - this.newMusic = Main.dayTime ? 42 : 15; - else if (Main.tile[(int) ((double) Main.player[Main.myPlayer].Center.X / 16.0), (int) ((double) Main.player[Main.myPlayer].Center.Y / 16.0)].wall == (ushort) 87) - this.newMusic = 26; - else if (Main.player[Main.myPlayer].ZoneDungeon) - this.newMusic = 23; - else if (Main.bgStyle == 9 && (double) Main.player[Main.myPlayer].position.Y < Main.worldSurface * 16.0 + (double) (Main.screenHeight / 2) || Main.undergroundBackground == 2) - this.newMusic = 29; - else if (Main.player[Main.myPlayer].ZoneCorrupt) - this.newMusic = !Main.player[Main.myPlayer].ZoneCrimson || Main.SceneMetrics.BloodTileCount <= Main.SceneMetrics.EvilTileCount ? ((double) Main.player[Main.myPlayer].position.Y <= Main.worldSurface * 16.0 + (double) (Main.screenHeight / 2) ? 8 : 10) : ((double) Main.player[Main.myPlayer].position.Y <= Main.worldSurface * 16.0 + (double) (Main.screenHeight / 2) ? 16 : 33); - else if (Main.player[Main.myPlayer].ZoneCrimson) - this.newMusic = (double) Main.player[Main.myPlayer].position.Y <= Main.worldSurface * 16.0 + (double) (Main.screenHeight / 2) ? 16 : 33; - else if (Main.player[Main.myPlayer].ZoneMeteor) - this.newMusic = 2; - else if (Main.player[Main.myPlayer].ZoneGraveyard) - this.newMusic = 53; - else if (Main.player[Main.myPlayer].ZoneJungle) - this.newMusic = (double) Main.player[Main.myPlayer].position.Y <= Main.rockLayer * 16.0 + (double) (Main.screenHeight / 2) ? (this.newMusic != 54 || (double) Main.player[Main.myPlayer].position.Y <= (Main.rockLayer - 50.0) * 16.0 + (double) (Main.screenHeight / 2) ? (!Main._shouldUseStormMusic || (double) Main.player[Main.myPlayer].position.Y >= Main.worldSurface * 16.0 + (double) (Main.screenHeight / 2) ? (!Main.dayTime ? 55 : 7) : 52) : 54) : 54; - else if (Main.player[Main.myPlayer].ZoneSnow) - this.newMusic = (double) Main.player[Main.myPlayer].position.Y <= Main.worldSurface * 16.0 + (double) (Main.screenHeight / 2) ? 14 : 20; - else if ((double) Main.player[Main.myPlayer].position.Y >= Main.worldSurface * 16.0 + (double) (Main.screenHeight / 2) && !WorldGen.oceanDepths((int) ((double) Main.screenPosition.X + (double) (Main.screenWidth / 2)) / 16, (int) ((double) Main.screenPosition.Y + (double) (Main.screenHeight / 2)) / 16)) + else if (Main.gameMenu) { - if (Main.player[Main.myPlayer].ZoneHallow) - this.newMusic = 11; - else if (Main.player[Main.myPlayer].ZoneUndergroundDesert) - { - this.newMusic = (double) Main.player[Main.myPlayer].position.Y < Main.worldSurface * 16.0 + (double) (Main.screenHeight / 2) ? 21 : 61; - } - else - { - if (Main.ugMusic == 0) - Main.ugMusic = 4; - if (!Main.music[4].IsPlaying && !Main.music[31].IsPlaying) - { - if ((double) Main.musicFade[4] == 1.0) - Main.musicFade[31] = 1f; - if ((double) Main.musicFade[31] == 1.0) - Main.musicFade[4] = 1f; - switch (Main.rand.Next(2)) - { - case 0: - Main.ugMusic = 4; - Main.musicFade[31] = 0.0f; - break; - case 1: - Main.ugMusic = 31; - Main.musicFade[4] = 0.0f; - break; - } - } - this.newMusic = Main.ugMusic; - } - } - else if (Main.dayTime && Main.player[Main.myPlayer].ZoneHallow) - this.newMusic = !Main._shouldUseStormMusic ? ((double) Main.cloudAlpha <= 0.0 || Main.gameMenu ? (!Main._shouldUseWindyDayMusic ? 9 : 44) : 19) : 52; - else if (Main._shouldUseStormMusic) - this.newMusic = !Main.bloodMoon ? 52 : 2; - else if (WorldGen.oceanDepths((int) ((double) Main.screenPosition.X + (double) (Main.screenWidth / 2)) / 16, (int) ((double) Main.screenPosition.Y + (double) (Main.screenHeight / 2)) / 16)) - this.newMusic = !Main.bloodMoon ? (!flag16 ? (Main.dayTime ? 22 : 43) : (!Main.dayTime ? 47 : 46)) : 2; - else if (Main.player[Main.myPlayer].ZoneDesert) - { - if ((double) Main.player[Main.myPlayer].position.Y >= Main.worldSurface * 16.0) - { - int x = (int) ((double) Main.player[Main.myPlayer].Center.X / 16.0); - int y = (int) ((double) Main.player[Main.myPlayer].Center.Y / 16.0); - this.newMusic = !WorldGen.InWorld(x, y) || !WallID.Sets.Conversion.Sandstone[(int) Main.tile[x, y].wall] && !WallID.Sets.Conversion.HardenedSand[(int) Main.tile[x, y].wall] ? 21 : 61; - } - else - this.newMusic = 21; - } - else if (Main.dayTime) - { - if ((double) Main.cloudAlpha > 0.0 && !Main.gameMenu) - { - this.newMusic = Main.time >= 10800.0 ? 19 : 59; - } - else - { - if (Main.dayMusic == 0) - Main.dayMusic = 1; - if (!Main.music[1].IsPlaying && !Main.music[18].IsPlaying) - Main.dayMusic = Main.rand.Next(2) != 0 ? 18 : 1; - this.newMusic = Main.dayMusic; - if (Main._shouldUseWindyDayMusic) - this.newMusic = 44; - } - } - else if (!Main.dayTime) - this.newMusic = !Main.bloodMoon ? ((double) Main.cloudAlpha <= 0.0 || Main.gameMenu ? 3 : 19) : 2; - if ((double) Main.screenPosition.Y / 16.0 < Main.worldSurface + 10.0 && Main.pumpkinMoon) - this.newMusic = 30; - if ((double) Main.screenPosition.Y / 16.0 >= Main.worldSurface + 10.0 || !Main.snowMoon) - return; - this.newMusic = 32; - } - } - - private void UpdateWindyDayState() - { - if ((double) Main.cloudAlpha == 0.0) - { - Main._shouldUseStormMusic = false; - if (Main.time < 10800.0 || Main.time > 43200.0 || !Main.dayTime) - { - Main._shouldUseWindyDayMusic = false; + this.newMusic = Main.netMode == 2 ? 0 : 6; } else { - if ((double) Math.Abs(Main.windSpeedTarget) < (double) Main._minWind) - Main._shouldUseWindyDayMusic = false; - if ((double) Math.Abs(Main.windSpeedTarget) < (double) Main._maxWind) - return; - Main._shouldUseWindyDayMusic = true; + float num4 = (float) (Main.maxTilesX / 4200); + float num5 = num4 * num4; + float num6 = (float) ((((double) Main.screenPosition.Y + (double) (Main.screenHeight / 2)) / 16.0 - (65.0 + 10.0 * (double) num5)) / (Main.worldSurface / 5.0)); + if (flag7) + this.newMusic = 38; + else if (flag9) + this.newMusic = 37; + else if (flag10) + this.newMusic = 34; + else if (flag6) + this.newMusic = 24; + else if (flag2) + this.newMusic = 12; + else if (flag1) + this.newMusic = 5; + else if (flag3) + this.newMusic = 13; + else if (flag4) + this.newMusic = 17; + else if (flag5) + this.newMusic = 25; + else if (flag8) + this.newMusic = 35; + else if (flag11) + this.newMusic = 39; + else if (flag12) + this.newMusic = 41; + else if (Main.player[Main.myPlayer].ZoneSandstorm) + this.newMusic = 40; + else if ((double) Main.player[Main.myPlayer].position.Y > (double) ((Main.maxTilesY - 200) * 16)) + this.newMusic = 36; + else if (Main.eclipse && (double) Main.player[Main.myPlayer].position.Y < Main.worldSurface * 16.0 + (double) (Main.screenHeight / 2)) + this.newMusic = 27; + else if ((double) num6 < 1.0) + this.newMusic = 15; + else if (Main.tile[(int) ((double) Main.player[Main.myPlayer].Center.X / 16.0), (int) ((double) Main.player[Main.myPlayer].Center.Y / 16.0)].wall == (byte) 87) + this.newMusic = 26; + else if (Main.bgStyle == 9 && (double) Main.player[Main.myPlayer].position.Y < Main.worldSurface * 16.0 + (double) (Main.screenHeight / 2) || Main.ugBack == 2) + this.newMusic = 29; + else if (Main.player[Main.myPlayer].ZoneCorrupt) + this.newMusic = (double) Main.player[Main.myPlayer].position.Y <= Main.worldSurface * 16.0 + (double) (Main.screenHeight / 2) ? 8 : 10; + else if (Main.player[Main.myPlayer].ZoneCrimson) + this.newMusic = (double) Main.player[Main.myPlayer].position.Y <= Main.worldSurface * 16.0 + (double) (Main.screenHeight / 2) ? 16 : 33; + else if (Main.player[Main.myPlayer].ZoneDungeon) + this.newMusic = 23; + else if (Main.player[Main.myPlayer].ZoneMeteor) + this.newMusic = 2; + else if (Main.player[Main.myPlayer].ZoneJungle) + this.newMusic = 7; + else if (Main.player[Main.myPlayer].ZoneSnow) + this.newMusic = (double) Main.player[Main.myPlayer].position.Y <= Main.worldSurface * 16.0 + (double) (Main.screenHeight / 2) ? 14 : 20; + else if ((double) Main.player[Main.myPlayer].position.Y > Main.worldSurface * 16.0 + (double) (Main.screenHeight / 2)) + { + if (Main.player[Main.myPlayer].ZoneHoly) + this.newMusic = 11; + else if (Main.sandTiles > 2200) + { + this.newMusic = 21; + } + else + { + if (Main.ugMusic == 0) + Main.ugMusic = 4; + if (!Main.music[4].IsPlaying && !Main.music[31].IsPlaying) + { + if ((double) Main.musicFade[4] == 1.0) + Main.musicFade[31] = 1f; + if ((double) Main.musicFade[31] == 1.0) + Main.musicFade[4] = 1f; + switch (Main.rand.Next(2)) + { + case 0: + Main.ugMusic = 4; + Main.musicFade[31] = 0.0f; + break; + case 1: + Main.ugMusic = 31; + Main.musicFade[4] = 0.0f; + break; + } + } + this.newMusic = Main.ugMusic; + } + } + else if (Main.dayTime && Main.player[Main.myPlayer].ZoneHoly) + this.newMusic = (double) Main.cloudAlpha <= 0.0 || Main.gameMenu ? 9 : 19; + else if ((double) Main.screenPosition.Y / 16.0 < Main.worldSurface + 10.0 && (num3 < 380 || num3 > Main.maxTilesX - 380)) + this.newMusic = 22; + else if (Main.sandTiles > 1000) + this.newMusic = 21; + else if (Main.dayTime) + { + if ((double) Main.cloudAlpha > 0.0 && !Main.gameMenu) + { + this.newMusic = 19; + } + else + { + if (Main.dayMusic == 0) + Main.dayMusic = 1; + if (!Main.music[1].IsPlaying && !Main.music[18].IsPlaying) + { + switch (Main.rand.Next(2)) + { + case 0: + Main.dayMusic = 1; + break; + case 1: + Main.dayMusic = 18; + break; + } + } + this.newMusic = Main.dayMusic; + } + } + else if (!Main.dayTime) + this.newMusic = !Main.bloodMoon ? ((double) Main.cloudAlpha <= 0.0 || Main.gameMenu ? 3 : 19) : 2; + if ((double) Main.screenPosition.Y / 16.0 < Main.worldSurface + 10.0 && Main.pumpkinMoon) + this.newMusic = 30; + if ((double) Main.screenPosition.Y / 16.0 < Main.worldSurface + 10.0 && Main.snowMoon) + this.newMusic = 32; } + if (Main.gameMenu || (double) Main.musicVolume == 0.0) + { + Main.musicBox2 = -1; + Main.musicBox = -1; + } + if (Main.musicBox2 >= 0) + Main.musicBox = Main.musicBox2; + if (Main.musicBox >= 0) + { + if (Main.musicBox == 0) + this.newMusic = 1; + if (Main.musicBox == 1) + this.newMusic = 2; + if (Main.musicBox == 2) + this.newMusic = 3; + if (Main.musicBox == 4) + this.newMusic = 4; + if (Main.musicBox == 5) + this.newMusic = 5; + if (Main.musicBox == 3) + this.newMusic = 6; + if (Main.musicBox == 6) + this.newMusic = 7; + if (Main.musicBox == 7) + this.newMusic = 8; + if (Main.musicBox == 9) + this.newMusic = 9; + if (Main.musicBox == 8) + this.newMusic = 10; + if (Main.musicBox == 11) + this.newMusic = 11; + if (Main.musicBox == 10) + this.newMusic = 12; + if (Main.musicBox == 12) + this.newMusic = 13; + if (Main.musicBox == 13) + this.newMusic = 14; + if (Main.musicBox == 14) + this.newMusic = 15; + if (Main.musicBox == 15) + this.newMusic = 16; + if (Main.musicBox == 16) + this.newMusic = 17; + if (Main.musicBox == 17) + this.newMusic = 18; + if (Main.musicBox == 18) + this.newMusic = 19; + if (Main.musicBox == 19) + this.newMusic = 20; + if (Main.musicBox == 20) + this.newMusic = 21; + if (Main.musicBox == 21) + this.newMusic = 22; + if (Main.musicBox == 22) + this.newMusic = 23; + if (Main.musicBox == 23) + this.newMusic = 24; + if (Main.musicBox == 24) + this.newMusic = 25; + if (Main.musicBox == 25) + this.newMusic = 26; + if (Main.musicBox == 26) + this.newMusic = 27; + if (Main.musicBox == 27) + this.newMusic = 29; + if (Main.musicBox == 28) + this.newMusic = 30; + if (Main.musicBox == 29) + this.newMusic = 31; + if (Main.musicBox == 30) + this.newMusic = 32; + if (Main.musicBox == 31) + this.newMusic = 33; + if (Main.musicBox == 32) + this.newMusic = 38; + if (Main.musicBox == 33) + this.newMusic = 37; + if (Main.musicBox == 34) + this.newMusic = 35; + if (Main.musicBox == 35) + this.newMusic = 36; + if (Main.musicBox == 36) + this.newMusic = 34; + if (Main.musicBox == 37) + this.newMusic = 39; + if (Main.musicBox == 38) + this.newMusic = 40; + if (Main.musicBox == 39) + this.newMusic = 41; + } + Main.curMusic = this.newMusic; + float num7 = 1f; + if (NPC.MoonLordCountdown > 0) + { + float num8 = (float) NPC.MoonLordCountdown / 3600f; + float amount = num8 * num8; + if (NPC.MoonLordCountdown > 720) + { + num7 = MathHelper.Lerp(0.0f, 1f, amount); + } + else + { + num7 = 0.0f; + Main.curMusic = 0; + } + if (NPC.MoonLordCountdown == 1 && Main.curMusic >= 1 && Main.curMusic < 42) + Main.musicFade[Main.curMusic] = 0.0f; + } + for (int index = 1; index < 42; ++index) + { + if (index == 28) + { + if ((double) Main.cloudAlpha > 0.0 && (double) Main.player[Main.myPlayer].position.Y < Main.worldSurface * 16.0 + (double) (Main.screenHeight / 2) && !Main.player[Main.myPlayer].ZoneSnow) + { + if ((double) Main.ambientVolume == 0.0) + { + if (Main.music[index].IsPlaying) + Main.music[index].Stop(AudioStopOptions.Immediate); + } + else if (!Main.music[index].IsPlaying) + { + Main.music[index] = Main.soundBank.GetCue("Music_" + (object) index); + Main.music[index].Play(); + Main.music[index].SetVariable("Volume", Main.musicFade[index] * Main.ambientVolume); + } + else if (Main.music[index].IsPaused && this.IsActive) + { + Main.music[index].Resume(); + } + else + { + Main.musicFade[index] += 0.005f; + if ((double) Main.musicFade[index] > 1.0) + Main.musicFade[index] = 1f; + Main.music[index].SetVariable("Volume", Main.musicFade[index] * Main.ambientVolume); + } + } + else if (Main.music[index].IsPlaying) + { + if ((double) Main.musicFade[Main.curMusic] > 0.25) + Main.musicFade[index] -= 0.005f; + else if (Main.curMusic == 0) + Main.musicFade[index] = 0.0f; + if ((double) Main.musicFade[index] <= 0.0) + { + Main.musicFade[index] -= 0.0f; + Main.music[index].Stop(AudioStopOptions.Immediate); + } + else + Main.music[index].SetVariable("Volume", Main.musicFade[index] * Main.ambientVolume); + } + else + Main.musicFade[index] = 0.0f; + } + else if (index == Main.curMusic) + { + if (!Main.music[index].IsPlaying) + { + Main.music[index] = Main.soundBank.GetCue("Music_" + (object) index); + Main.music[index].Play(); + Main.music[index].SetVariable("Volume", Main.musicFade[index] * Main.musicVolume * num7); + } + else + { + Main.musicFade[index] += 0.005f; + if ((double) Main.musicFade[index] > 1.0) + Main.musicFade[index] = 1f; + Main.music[index].SetVariable("Volume", Main.musicFade[index] * Main.musicVolume * num7); + } + } + else if (Main.music[index].IsPlaying) + { + if ((double) Main.musicFade[Main.curMusic] > 0.25) + Main.musicFade[index] -= 0.005f; + else if (Main.curMusic == 0) + Main.musicFade[index] = 0.0f; + if ((double) Main.musicFade[index] <= 0.0) + { + Main.musicFade[index] -= 0.0f; + Main.music[index].Stop(AudioStopOptions.Immediate); + } + else + Main.music[index].SetVariable("Volume", Main.musicFade[index] * Main.musicVolume * num7); + } + else + Main.musicFade[index] = 0.0f; + } + if (Main.musicError <= 0) + return; + --Main.musicError; } - else + catch { - if ((double) Main.cloudAlpha < (double) Main._minRain || (double) Math.Abs(Main.windSpeedTarget) < (double) Main._minWind) - Main._shouldUseStormMusic = false; - else if ((double) Main.cloudAlpha >= (double) Main._maxRain && (double) Math.Abs(Main.windSpeedTarget) >= (double) Main._maxWind) - Main._shouldUseStormMusic = true; - Main._shouldUseWindyDayMusic = false; + ++Main.musicError; + if (Main.musicError < 100) + return; + Main.musicError = 0; + Main.musicVolume = 0.0f; } } public static void snowing() { - Vector2 scaledSize = Main.Camera.ScaledSize; - Vector2 scaledPosition = Main.Camera.ScaledPosition; - if (Main.gamePaused || Main.SceneMetrics.SnowTileCount <= 0 || (double) Main.player[Main.myPlayer].position.Y >= Main.worldSurface * 16.0) + if (Main.gamePaused || Main.snowTiles <= 0 || (double) Main.player[Main.myPlayer].position.Y >= Main.worldSurface * 16.0) return; - float num1 = (float) Main.SceneMetrics.SnowTileCount / (float) SceneMetrics.SnowTileMax; - float num2 = num1 * num1; - float num3 = num2 * num2; - int num4 = (int) ((double) (int) (500.0 * (double) (Main.Camera.ScaledSize.X / (float) Main.maxScreenW)) * (1.0 + 2.0 * (double) Main.cloudAlpha)); - float num5 = (float) (1.0 + 50.0 * (double) Main.cloudAlpha); - for (int index1 = 0; (double) index1 < (double) num5; ++index1) + int maxValue = 800 / Main.snowTiles; + int num1 = (int) ((double) (int) (500.0 * (double) ((float) Main.screenWidth / (float) Main.maxScreenW)) * (1.0 + 2.0 * (double) Main.cloudAlpha)); + float num2 = (float) (1.0 + 50.0 * (double) Main.cloudAlpha); + for (int index1 = 0; (double) index1 < (double) num2; ++index1) { try { - if ((double) Main.snowDust >= (double) num4 * ((double) Main.gfxQuality / 2.0 + 0.5) + (double) num4 * 0.100000001490116) + if ((double) Main.snowDust >= (double) num1 * ((double) Main.gfxQuality / 2.0 + 0.5) + (double) num1 * 0.100000001490116) break; - if ((double) Main.rand.NextFloat() < (double) num3) + if (Main.rand.Next(maxValue) == 0) { - int num6 = Main.rand.Next((int) scaledSize.X + 1500) - 750; - int num7 = (int) scaledPosition.Y - Main.rand.Next(50); + int num3 = Main.rand.Next(Main.screenWidth + 1000) - 500; + int num4 = (int) Main.screenPosition.Y - Main.rand.Next(50); if ((double) Main.player[Main.myPlayer].velocity.Y > 0.0) - num7 -= (int) Main.player[Main.myPlayer].velocity.Y; + num4 -= (int) Main.player[Main.myPlayer].velocity.Y; if (Main.rand.Next(5) == 0) - num6 = Main.rand.Next(500) - 500; + num3 = Main.rand.Next(500) - 500; else if (Main.rand.Next(5) == 0) - num6 = Main.rand.Next(500) + (int) scaledSize.X; - if (num6 < 0 || (double) num6 > (double) scaledSize.X) - num7 += Main.rand.Next((int) ((double) scaledSize.Y * 0.8)) + (int) ((double) scaledSize.Y * 0.1); - int num8 = num6 + (int) scaledPosition.X; - int x = num8 / 16; - int y = num7 / 16; - if (WorldGen.InWorld(x, y)) + num3 = Main.rand.Next(500) + Main.screenWidth; + if (num3 < 0 || num3 > Main.screenWidth) + num4 += Main.rand.Next((int) ((double) Main.screenHeight * 0.8)) + (int) ((double) Main.screenHeight * 0.1); + int num5 = num3 + (int) Main.screenPosition.X; + int index2 = num5 / 16; + int index3 = num4 / 16; + if (Main.tile[index2, index3] != null) { - if (Main.tile[x, y] != null) + if (Main.tile[index2, index3].wall == (byte) 0) { - if (!Main.tile[x, y].nactive()) + int index4 = Dust.NewDust(new Vector2((float) num5, (float) num4), 10, 10, 76); + Main.dust[index4].scale += Main.cloudAlpha * 0.2f; + Main.dust[index4].velocity.Y = (float) (3.0 + (double) Main.rand.Next(30) * 0.100000001490116); + Main.dust[index4].velocity.Y *= Main.dust[index4].scale; + if (!Main.raining) { - if (Main.tile[x, y].wall == (ushort) 0) - { - int index2 = Dust.NewDust(new Vector2((float) num8, (float) num7), 10, 10, 76); - Main.dust[index2].scale += Main.cloudAlpha * 0.2f; - Main.dust[index2].velocity.Y = (float) (3.0 + (double) Main.rand.Next(30) * 0.100000001490116); - Main.dust[index2].velocity.Y *= Main.dust[index2].scale; - if (!Main.raining) - { - Main.dust[index2].velocity.X = Main.windSpeedCurrent + (float) Main.rand.Next(-10, 10) * 0.1f; - Main.dust[index2].velocity.X += Main.windSpeedCurrent * 15f; - } - else - { - Main.dust[index2].velocity.X = (float) (Math.Sqrt((double) Math.Abs(Main.windSpeedCurrent)) * (double) Math.Sign(Main.windSpeedCurrent) * ((double) Main.cloudAlpha + 0.5) * 10.0 + (double) Main.rand.NextFloat() * 0.200000002980232 - 0.100000001490116); - Main.dust[index2].velocity.Y *= 0.5f; - } - Main.dust[index2].velocity.Y *= (float) (1.0 + 0.300000011920929 * (double) Main.cloudAlpha); - Main.dust[index2].scale += Main.cloudAlpha * 0.2f; - Main.dust[index2].velocity *= (float) (1.0 + (double) Main.cloudAlpha * 0.5); - } + Main.dust[index4].velocity.X = Main.windSpeed + (float) Main.rand.Next(-10, 10) * 0.1f; + Main.dust[index4].velocity.X += (float) ((double) Main.windSpeed * (double) Main.cloudAlpha * 10.0); } + else + { + Main.dust[index4].velocity.X = (float) (Math.Sqrt((double) Math.Abs(Main.windSpeed)) * (double) Math.Sign(Main.windSpeed) * ((double) Main.cloudAlpha + 0.5) * 25.0 + (double) Main.rand.NextFloat() * 0.200000002980232 - 0.100000001490116); + Main.dust[index4].velocity.Y *= 0.5f; + } + Main.dust[index4].velocity.Y *= (float) (1.0 + 0.300000011920929 * (double) Main.cloudAlpha); + Main.dust[index4].scale += Main.cloudAlpha * 0.2f; + Main.dust[index4].velocity *= (float) (1.0 + (double) Main.cloudAlpha * 0.5); } } } @@ -9535,10 +8698,10 @@ label_56: DateTime now = DateTime.Now; int day = now.Day; int month = now.Month; - Main.xMas = day >= 15 && month == 12; - if (!Main.forceXMasForToday) - return; - Main.xMas = true; + if (day >= 15 && month == 12) + Main.xMas = true; + else + Main.xMas = false; } public static void checkHalloween() @@ -9546,10 +8709,12 @@ label_56: DateTime now = DateTime.Now; int day = now.Day; int month = now.Month; - Main.halloween = day >= 10 && month == 10 || day <= 1 && month == 11; - if (!Main.forceHalloweenForToday) - return; - Main.halloween = true; + if (day >= 20 && month == 10) + Main.halloween = true; + else if (day <= 1 && month == 11) + Main.halloween = true; + else + Main.halloween = false; } public void updateCloudLayer() @@ -9564,17 +8729,17 @@ label_56: return; } int num1 = 86400; - int minValue = num1 / 24; - float num2 = Math.Max(1f, (float) (1.0 + 4.0 * (double) Main.cloudAlpha)); + int num2 = num1 / 24; + float num3 = Math.Max(1f, (float) (1.0 + 4.0 * (double) Main.cloudAlpha)); if ((double) Main.cloudBGActive > 0.0) { if ((double) Main.cloudBGActive > 1.0) - Main.cloudBGActive -= (float) Main.dayRate / num2; + Main.cloudBGActive -= (float) Main.dayRate / num3; if ((double) Main.cloudBGActive < 1.0) Main.cloudBGActive = 1f; - if ((double) Main.cloudBGActive != 1.0 || Main.rand.Next((int) ((double) (minValue * 2 / Math.Max(Main.dayRate, 1)) * (double) num2)) != 0) + if ((double) Main.cloudBGActive != 1.0 || Main.rand.Next((int) ((double) (num2 * 2 / Math.Max(Main.dayRate, 1)) * (double) num3)) != 0) return; - Main.cloudBGActive = (float) -Main.rand.Next(minValue * 4, num1 * 4); + Main.cloudBGActive = (float) -Main.rand.Next(num2 * 4, num1 * 4); if (Main.netMode != 2) return; NetMessage.SendData(7); @@ -9583,28 +8748,18 @@ label_56: { if ((double) Main.cloudBGActive < 0.0) { - Main.cloudBGActive += (float) Main.dayRate * num2; + Main.cloudBGActive += (float) Main.dayRate * num3; if (Main.raining) - Main.cloudBGActive += (float) (2 * Main.dayRate) * num2; + Main.cloudBGActive += (float) (2 * Main.dayRate) * num3; } if ((double) Main.cloudBGActive > 0.0) Main.cloudBGActive = 0.0f; - if ((double) Main.cloudBGActive == 0.0 && Main.rand.Next((int) ((double) (minValue * 12 / (Main.dayRate == 0 ? 1 : Main.dayRate)) / (double) num2)) == 0) - { - Main.cloudBGActive = (float) Main.rand.Next(minValue * 3, num1 * 2); - if (Main.netMode != 2) - return; - NetMessage.SendData(7); - } - else - { - if (!Main.IsItStorming) - return; - Main.cloudBGActive = (float) Main.rand.Next(minValue, minValue * 4); - if (Main.netMode != 2) - return; - NetMessage.SendData(7); - } + if ((double) Main.cloudBGActive != 0.0 || Main.rand.Next((int) ((double) (num2 * 8 / (Main.dayRate == 0 ? 1 : Main.dayRate)) / (double) num3)) != 0) + return; + Main.cloudBGActive = (float) Main.rand.Next(num2 * 3, num1 * 2); + if (Main.netMode != 2) + return; + NetMessage.SendData(7); } } @@ -9612,14 +8767,12 @@ label_56: Microsoft.Xna.Framework.Rectangle effectRect, int Style, int extraInfo = 0, - float dustCountMult = 1f, - TeleportationSide side = TeleportationSide.Entry, - Vector2 otherPosition = default (Vector2)) + float dustCountMult = 1f) { switch (Style) { case 0: - SoundEngine.PlaySound(SoundID.Item6, effectRect.X + effectRect.Width / 2, effectRect.Y + effectRect.Height / 2); + Main.PlaySound(SoundID.Item6, effectRect.X + effectRect.Width / 2, effectRect.Y + effectRect.Height / 2); int num1 = (int) ((double) (effectRect.Width * effectRect.Height / 5) * (double) dustCountMult); for (int index1 = 0; index1 < num1; ++index1) { @@ -9632,8 +8785,8 @@ label_56: } break; case 1: - SoundEngine.PlaySound(SoundID.Item8, effectRect.X + effectRect.Width / 2, effectRect.Y + effectRect.Height / 2); - int num2 = (int) ((double) (effectRect.Width * effectRect.Height / 5) * (double) dustCountMult); + Main.PlaySound(SoundID.Item8, effectRect.X + effectRect.Width / 2, effectRect.Y + effectRect.Height / 2); + int num2 = effectRect.Width * effectRect.Height / 5; for (int index3 = 0; index3 < num2; ++index3) { int index4 = Dust.NewDust(new Vector2((float) effectRect.X, (float) effectRect.Y), effectRect.Width, effectRect.Height, 164); @@ -9645,14 +8798,12 @@ label_56: } break; case 2: - int num3 = (int) (50.0 * (double) dustCountMult); - for (int index = 0; index < num3; ++index) + for (int index = 0; index < 50; ++index) Main.dust[Dust.NewDust(new Vector2((float) effectRect.X, (float) effectRect.Y), effectRect.Width, effectRect.Height, 58, Alpha: 150, newColor: Microsoft.Xna.Framework.Color.GhostWhite, Scale: 1.2f)].velocity *= 0.5f; break; case 3: - SoundEngine.PlaySound(SoundID.Item6, effectRect.X + effectRect.Width / 2, effectRect.Y + effectRect.Height / 2); - int num4 = (int) (50.0 * (double) dustCountMult); - for (int index5 = 0; index5 < num4; ++index5) + Main.PlaySound(SoundID.Item6, effectRect.X + effectRect.Width / 2, effectRect.Y + effectRect.Height / 2); + for (int index5 = 0; index5 < 50; ++index5) { int index6 = Dust.NewDust(new Vector2((float) effectRect.X, (float) effectRect.Y), effectRect.Width, effectRect.Height, 180); Main.dust[index6].noGravity = true; @@ -9680,9 +8831,9 @@ label_56: } break; case 4: - SoundEngine.PlaySound(SoundID.Item8, effectRect.X + effectRect.Width / 2, effectRect.Y + effectRect.Height / 2); - int num5 = (int) ((double) (effectRect.Width * effectRect.Height / 5) * (double) dustCountMult); - for (int index = 0; index < num5; ++index) + Main.PlaySound(SoundID.Item8, effectRect.X + effectRect.Width / 2, effectRect.Y + effectRect.Height / 2); + int num3 = (int) ((double) (effectRect.Width * effectRect.Height / 5) * (double) dustCountMult); + for (int index = 0; index < num3; ++index) { Dust dust = Main.dust[Dust.NewDust(effectRect.TopLeft(), effectRect.Width, effectRect.Height, 263)]; dust.color = PortalHelper.GetPortalColor(extraInfo); @@ -9693,76 +8844,6 @@ label_56: dust.color.A = byte.MaxValue; } break; - case 5: - Vector2 Position1 = effectRect.TopLeft(); - int num6 = (int) (100.0 * (double) dustCountMult); - for (int index = 0; index < num6; ++index) - { - Dust dust = Dust.NewDustDirect(Position1, effectRect.Width, effectRect.Height + 24, Dust.dustWater()); - dust.velocity.Y *= 0.0f; - dust.velocity.Y -= 3.5f; - dust.velocity.X *= 1.5f; - dust.scale = 0.8f; - dust.alpha = 130; - dust.noGravity = true; - dust.fadeIn = 1.2f; - } - SoundEngine.PlaySound(19, effectRect.Center.ToVector2(), 0); - break; - case 7: - Vector2 Position2 = effectRect.TopLeft(); - int num7 = (int) (50.0 * (double) dustCountMult); - for (int index = 0; index < num7; ++index) - { - Dust dust = Dust.NewDustDirect(Position2, effectRect.Width, effectRect.Height + 24, 35); - dust.velocity.Y *= 0.0f; - dust.velocity.Y -= 3.5f; - dust.velocity.X *= 1.5f; - dust.scale = 0.8f; - dust.alpha = 130; - dust.noGravity = true; - dust.fadeIn = 1.2f; - } - SoundEngine.PlaySound(SoundID.Item8, effectRect.Center.ToVector2()); - break; - case 9: - effectRect.Inflate(15, 15); - int num8 = (int) (100.0 * (double) dustCountMult); - for (int index = 0; index < num8; ++index) - TeleportPylonsSystem.SpawnInWorldDust(extraInfo, effectRect); - SoundEngine.PlaySound(SoundID.Item6, effectRect.Center.X, effectRect.Center.Y); - break; - case 10: - effectRect.Inflate(15, 15); - int num9 = (int) (60.0 * (double) dustCountMult); - Vector2 vector2 = otherPosition - effectRect.TopLeft(); - for (int index = 0; index < num9; ++index) - { - float num10 = 0.4f + Main.rand.NextFloat(); - float num11 = 0.4f + Main.rand.NextFloat(); - Microsoft.Xna.Framework.Color rgb = Main.hslToRgb((float) (0.660000026226044 + (double) Main.rand.NextFloat() * 0.239999994635582), 1f, 0.5f); - Dust rf = Dust.NewDustDirect(effectRect.TopLeft(), effectRect.Width, effectRect.Height, 267, Alpha: ((int) sbyte.MaxValue), newColor: rgb); - rf.scale = (float) Main.rand.Next(20, 70) * 0.01f; - if (index < 10) - rf.scale += 0.25f; - if (index < 5) - rf.scale += 0.25f; - if ((double) index < (double) num9 * 0.800000011920929) - rf.velocity += vector2 * 0.1f * Main.rand.NextFloat(); - rf.noGravity = true; - rf.noLight = true; - rf.scale = num11; - rf.fadeIn = num10; - if (rf.dustIndex != 6000) - { - Dust dust = Dust.CloneDust(rf); - dust.scale *= 0.65f; - dust.fadeIn *= 0.65f; - dust.color = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); - } - } - SoundEngine.PlaySound(SoundID.Item8, effectRect.Center.X, effectRect.Center.Y); - break; } } @@ -9772,18 +8853,7 @@ label_56: if (Main.ambientCounter < 15) return; Main.ambientCounter = 0; - Microsoft.Xna.Framework.Point point = Main.LocalPlayer.Center.ToPoint(); - if ((double) Main.ambientWaterfallStrength > 0.0) - { - SoundEngine.PlaySound(34, (int) Main.ambientWaterfallX, (int) Main.ambientWaterfallY, (int) Main.ambientWaterfallStrength); - Main._isWaterfallMusicPlaying = true; - } - else - { - if (Main._isWaterfallMusicPlaying) - SoundEngine.PlaySound(34, point.X, point.Y, 0); - Main._isWaterfallMusicPlaying = false; - } + Main.PlaySound(34, (int) Main.ambientWaterfallX, (int) Main.ambientWaterfallY, (int) Main.ambientWaterfallStrength); float num1 = Math.Abs(Main.ambientLavaX - (Main.screenPosition.X + (float) (Main.screenWidth / 2))) + Math.Abs(Main.ambientLavaY - (Main.screenPosition.Y + (float) (Main.screenHeight / 2))); double num2 = (double) Math.Abs(Main.ambientLavafallX - (Main.screenPosition.X + (float) (Main.screenWidth / 2))) + (double) Math.Abs(Main.ambientLavafallY - (Main.screenPosition.Y + (float) (Main.screenHeight / 2))); float num3 = Main.ambientLavaX; @@ -9795,20 +8865,10 @@ label_56: num4 = Main.ambientLavafallY; } float num6 = Main.ambientLavafallStrength + Main.ambientLavaStrength; - if ((double) Main.ambientLavafallStrength > 0.0) - { - SoundEngine.PlaySound(35, (int) num3, (int) num4, (int) num6); - Main._isLavafallMusicPlaying = true; - } - else - { - if (Main._isLavafallMusicPlaying) - SoundEngine.PlaySound(35, point.X, point.Y, 0); - Main._isLavafallMusicPlaying = false; - } + Main.PlaySound(35, (int) num3, (int) num4, (int) num6); } - public static void AnimateTiles_CritterCages() + public static void CritterCages() { if (!Main.critterCage) return; @@ -10196,87 +9256,6 @@ label_56: } } for (int index = 0; index < Main.cageFrames; ++index) - { - ++Main.grebeCageFrameCounter[index]; - bool flag = Main.grebeCageFrame[index] == 0 || Main.grebeCageFrame[index] == 7; - int num1 = Main.grebeCageFrame[index] == 16 ? 1 : (Main.grebeCageFrame[index] == 20 ? 1 : 0); - int num2 = 5; - if (flag) - num2 = Main.rand.Next(300, 400); - if (num1 != 0) - num2 = Main.rand.Next(480, 600); - if (Main.grebeCageFrameCounter[index] >= num2) - { - Main.grebeCageFrameCounter[index] = 0; - if (Main.grebeCageFrame[index] >= 25 && Main.grebeCageFrame[index] <= 27) - { - ++Main.grebeCageFrame[index]; - if (Main.grebeCageFrame[index] > 27) - Main.grebeCageFrame[index] = Main.rand.Next(5) != 0 ? 25 : 7; - } - else if (Main.grebeCageFrame[index] >= 22 && Main.grebeCageFrame[index] <= 24) - { - ++Main.grebeCageFrame[index]; - if (Main.grebeCageFrame[index] > 24) - Main.grebeCageFrame[index] = Main.rand.Next(5) != 0 ? 22 : 0; - } - else if (Main.grebeCageFrame[index] == 0 && Main.rand.Next(3) == 0) - Main.grebeCageFrame[index] = Main.rand.Next(2) == 0 ? 22 : 14; - else if (Main.grebeCageFrame[index] == 7 && Main.rand.Next(3) == 0) - Main.grebeCageFrame[index] = Main.rand.Next(2) == 0 ? 25 : 18; - else if (Main.grebeCageFrame[index] == 13 || Main.grebeCageFrame[index] == 17) - Main.grebeCageFrame[index] = 0; - else if (Main.grebeCageFrame[index] == 21) - Main.grebeCageFrame[index] = 7; - else - ++Main.grebeCageFrame[index]; - } - } - for (int index = 0; index < Main.cageFrames; ++index) - { - ++Main.seagullCageFrameCounter[index]; - bool flag1 = Main.seagullCageFrame[index] == 0 || Main.seagullCageFrame[index] == 14; - bool flag2 = Main.seagullCageFrame[index] >= 15 && Main.seagullCageFrame[index] <= 18; - int num3 = Main.seagullCageFrame[index] < 9 ? 0 : (Main.seagullCageFrame[index] <= 13 ? 1 : 0); - int num4 = 6; - if (flag1) - num4 = Main.rand.Next(180, 250); - if (flag2) - num4 = 66; - if (num3 != 0) - num4 = 78; - if (Main.seagullCageFrameCounter[index] >= num4) - { - Main.seagullCageFrameCounter[index] = 0; - if (Main.seagullCageFrame[index] == 0 && Main.rand.Next(3) == 0) - Main.seagullCageFrame[index] = 9; - else if (Main.seagullCageFrame[index] == 14) - Main.seagullCageFrame[index] = Main.rand.Next(2) != 0 ? 19 : 15; - else if (Main.seagullCageFrame[index] == 9) - Main.seagullCageFrame[index] = 0; - else if (Main.seagullCageFrame[index] == 8 || Main.seagullCageFrame[index] == 15) - { - Main.seagullCageFrame[index] = 14; - } - else - { - ++Main.seagullCageFrame[index]; - if (Main.seagullCageFrame[index] > 26) - Main.seagullCageFrame[index] = 0; - } - } - else if (Main.seagullCageFrame[index] >= 15 && Main.seagullCageFrame[index] <= 18) - { - int num5 = Main.seagullCageFrameCounter[index] % 66; - Main.seagullCageFrame[index] = num5 <= 60 ? (num5 <= 54 ? (num5 <= 48 ? (num5 <= 42 ? (num5 <= 36 ? (num5 <= 30 ? (num5 <= 24 ? (num5 <= 18 ? (num5 <= 12 ? (num5 <= 6 ? 15 : 16) : 17) : 18) : 17) : 16) : 17) : 18) : 17) : 16) : 15; - } - else if (Main.seagullCageFrame[index] >= 9 && Main.seagullCageFrame[index] <= 13) - { - int num6 = Main.seagullCageFrameCounter[index] % 78; - Main.seagullCageFrame[index] = num6 <= 72 ? (num6 <= 66 ? (num6 <= 60 ? (num6 <= 54 ? (num6 <= 48 ? (num6 <= 42 ? (num6 <= 36 ? (num6 <= 30 ? (num6 <= 24 ? (num6 <= 18 ? (num6 <= 12 ? (num6 <= 6 ? 9 : 10) : 11) : 12) : 13) : 12) : 11) : 12) : 13) : 12) : 11) : 10) : 9; - } - } - for (int index = 0; index < Main.cageFrames; ++index) { if (Main.birdCageFrame[index] == 0) { @@ -10778,61 +9757,6 @@ label_56: } } for (int index = 0; index < Main.cageFrames; ++index) - { - ++Main.turtleCageFrameCounter[index]; - int num7 = Main.turtleCageFrame[index] == 0 || Main.turtleCageFrame[index] == 15 ? 1 : (Main.turtleCageFrame[index] == 31 ? 1 : 0); - int num8 = 8; - if (num7 != 0) - num8 = Main.rand.Next(180, 250); - if (Main.turtleCageFrameCounter[index] >= num8) - { - Main.turtleCageFrameCounter[index] = 0; - if (Main.turtleCageFrame[index] == 29) - Main.turtleCageFrame[index] = 0; - else if (Main.turtleCageFrame[index] == 15 && Main.rand.Next(3) == 0) - { - Main.turtleCageFrame[index] = 30; - } - else - { - ++Main.turtleCageFrame[index]; - if (Main.turtleCageFrame[index] > 32) - Main.turtleCageFrame[index] = 15; - } - } - } - for (int index = 0; index < Main.cageFrames; ++index) - { - ++Main.seahorseCageFrameCounter[index]; - bool flag3 = Main.seahorseCageFrame[index] == 0 || Main.seahorseCageFrame[index] == 13; - int num9 = Main.seahorseCageFrame[index] == 4 || Main.seahorseCageFrame[index] == 9 || Main.seahorseCageFrame[index] == 17 ? 1 : (Main.seahorseCageFrame[index] == 22 ? 1 : 0); - bool flag4 = Main.seahorseCageFrame[index] >= 25; - int num10 = 7; - if (flag3) - num10 = Main.rand.Next(220, 340); - if (num9 != 0) - num10 = 10; - if (flag4) - num10 = 6; - if (Main.seahorseCageFrameCounter[index] >= num10) - { - Main.seahorseCageFrameCounter[index] = 0; - if (Main.seahorseCageFrame[index] == 0 && Main.rand.Next(2) == 0) - Main.seahorseCageFrame[index] = 25; - else if (Main.seahorseCageFrame[index] == 24) - { - Main.seahorseCageFrame[index] = 0; - } - else - { - ++Main.seahorseCageFrame[index]; - if (Main.seahorseCageFrame[index] > 33) - Main.seahorseCageFrame[index] = 0; - } - } - } - Main.UpdateOwlCageFrames(); - for (int index = 0; index < Main.cageFrames; ++index) { if (Main.snailCageFrame[index] >= 0 && Main.snailCageFrame[index] <= 13) { @@ -11087,19 +10011,19 @@ label_56: } } } - int num11 = 0; + int num1 = 0; for (int index3 = 0; index3 < 3; ++index3) { switch (index3) { case 0: - num11 = 24; + num1 = 24; break; case 1: - num11 = 31; + num1 = 31; break; case 2: - num11 = 34; + num1 = 34; break; } for (int index4 = 0; index4 < Main.cageFrames; ++index4) @@ -11107,7 +10031,7 @@ label_56: if (++Main.slugCageFrameCounter[index3, index4] >= Main.rand.Next(5, 15)) { Main.slugCageFrameCounter[index3, index4] = 0; - if (++Main.slugCageFrame[index3, index4] >= num11) + if (++Main.slugCageFrame[index3, index4] >= num1) Main.slugCageFrame[index3, index4] = 0; } } @@ -11165,186 +10089,11 @@ label_56: } for (int index = 0; index < Main.cageFrames; ++index) { - ++Main.maggotCageFrameCounter[index]; - int num12 = Main.maggotCageFrame[index] == 0 || Main.maggotCageFrame[index] == 6 ? 1 : (Main.maggotCageFrame[index] == 18 ? 1 : 0); - int num13 = 8; - if (num12 != 0) - num13 = Main.rand.Next(100, 140); - if (Main.maggotCageFrameCounter[index] >= num13) - { - Main.maggotCageFrameCounter[index] = 0; - if (Main.maggotCageFrame[index] == 0) - Main.maggotCageFrame[index] = Main.rand.Next(3) != 0 ? 1 : 13; - else if (Main.maggotCageFrame[index] == 12) - { - Main.maggotCageFrame[index] = 0; - } - else - { - ++Main.maggotCageFrame[index]; - if (Main.maggotCageFrame[index] > 23) - Main.maggotCageFrame[index] = 6; - } - } - } - for (int index = 0; index < Main.cageFrames; ++index) - { - ++Main.ladybugCageFrameCounter[index]; - bool flag = Main.ladybugCageFrame[index] == 3 || Main.ladybugCageFrame[index] == 7 || Main.ladybugCageFrame[index] >= 17; - int num14 = Main.rand.Next(10, 12); - if (Main.ladybugCageFrame[index] == 18) - num14 = Main.rand.Next(160, 241); - else if (flag) - num14 = Main.rand.Next(198, 206); - else if (Main.ladybugCageFrame[index] >= 8 && Main.ladybugCageFrame[index] <= 16) - num14 = 5; - if (Main.ladybugCageFrameCounter[index] >= num14) - { - Main.ladybugCageFrameCounter[index] = 0; - if (Main.ladybugCageFrame[index] < 18) - { - if ((Main.ladybugCageFrame[index] == 2 || Main.ladybugCageFrame[index] == 5) && Main.rand.Next(3) == 0) - Main.ladybugCageFrame[index] = 17; - else if (Main.ladybugCageFrame[index] == 3 || Main.ladybugCageFrame[index] == 12) - { - switch (Main.rand.Next(3)) - { - case 0: - case 1: - Main.ladybugCageFrame[index] = 4; - continue; - case 2: - Main.ladybugCageFrame[index] = 13; - continue; - default: - continue; - } - } - else if (Main.ladybugCageFrame[index] == 7 || Main.ladybugCageFrame[index] == 16) - { - switch (Main.rand.Next(3)) - { - case 0: - case 1: - Main.ladybugCageFrame[index] = 0; - continue; - case 2: - Main.ladybugCageFrame[index] = 8; - continue; - default: - continue; - } - } - else - ++Main.ladybugCageFrame[index]; - } - else - Main.ladybugCageFrame[index] = Main.rand.Next(2) == 0 ? 13 : 4; - } - } - for (int index = 0; index < Main.cageFrames; ++index) - { - ++Main.ratCageFrameCounter[index]; - bool flag5 = Main.ratCageFrame[index] == 0 || Main.ratCageFrame[index] == 4; - int num15 = Main.ratCageFrame[index] == 8 || Main.ratCageFrame[index] == 9 || Main.ratCageFrame[index] == 10 ? 1 : (Main.ratCageFrame[index] == 11 ? 1 : 0); - bool flag6 = Main.ratCageFrame[index] > 11; - int num16 = 5; - if (flag5) - num16 = Main.rand.Next(40, 70); - if (num15 != 0) - num16 = Main.rand.Next(70, 110); - if (flag6) - num16 = 180; - if (Main.ratCageFrameCounter[index] >= num16) - { - Main.ratCageFrameCounter[index] = 0; - if (Main.ratCageFrame[index] == 0 && Main.rand.Next(2) == 0) - Main.ratCageFrame[index] = Main.rand.Next(3) == 0 ? 8 : 12; - else if (Main.ratCageFrame[index] == 4 && Main.rand.Next(2) == 0) - Main.ratCageFrame[index] = 10; - else if (Main.ratCageFrame[index] == 7 || Main.ratCageFrame[index] == 9 || Main.ratCageFrame[index] == 12) - Main.ratCageFrame[index] = 0; - else if (Main.ratCageFrame[index] == 11) - { - Main.ratCageFrame[index] = 4; - } - else - { - ++Main.ratCageFrame[index]; - if (Main.ratCageFrame[index] > 16) - Main.ratCageFrame[index] = 0; - } - } - else if (Main.ratCageFrame[index] > 11) - { - int num17 = Main.ratCageFrameCounter[index] % 90; - Main.ratCageFrame[index] = num17 <= 80 ? (num17 <= 70 ? (num17 <= 60 ? (num17 <= 50 ? (num17 <= 40 ? (num17 <= 30 ? (num17 <= 20 ? (num17 <= 10 ? 12 : 13) : 14) : 15) : 16) : 15) : 14) : 13) : 12; - } - else if (Main.ratCageFrameCounter[index] % 10 == 0) - { - if (Main.ratCageFrame[index] == 8 || Main.ratCageFrame[index] == 10) - ++Main.ratCageFrame[index]; - else if (Main.ratCageFrame[index] == 9 || Main.ratCageFrame[index] == 11) - --Main.ratCageFrame[index]; - } - } - for (int index = 0; index < Main.cageFrames; ++index) - { - ++Main.waterStriderCageFrameCounter[index]; - bool flag = Main.waterStriderCageFrame[index] == 0 || Main.waterStriderCageFrame[index] == 8; - int num18 = Main.waterStriderCageFrame[index] == 17 ? 1 : (Main.waterStriderCageFrame[index] == 20 ? 1 : 0); - int num19 = 5; - if (flag) - num19 = Main.rand.Next(110, 210); - if (num18 != 0) - num19 = Main.rand.Next(150, 260); - if (Main.waterStriderCageFrameCounter[index] >= num19) - { - Main.waterStriderCageFrameCounter[index] = 0; - if (Main.waterStriderCageFrame[index] == 0 && Main.rand.Next(2) == 0) - Main.waterStriderCageFrame[index] = 16; - else if (Main.waterStriderCageFrame[index] == 8 && Main.rand.Next(2) == 0) - Main.waterStriderCageFrame[index] = 19; - else if (Main.waterStriderCageFrame[index] == 15 || Main.waterStriderCageFrame[index] == 18) - { - Main.waterStriderCageFrame[index] = 0; - } - else - { - ++Main.waterStriderCageFrame[index]; - if (Main.waterStriderCageFrame[index] > 21) - Main.waterStriderCageFrame[index] = 8; - } - } - } - ++Main.fairyJarFrameCounter[0]; - if (Main.fairyJarFrameCounter[0] > 5) - { - Main.fairyJarFrameCounter[0] = 0; - ++Main.fairyJarFrame[0]; - if (Main.fairyJarFrame[0] > 11) - Main.fairyJarFrame[0] = 0; - } - for (int index = 1; index < Main.cageFrames; ++index) - { - int num20 = Main.fairyJarFrame[0] + index % 12; - if (index % 2 == 0) - ++num20; - if (index % 5 == 0) - ++num20; - if (index % 8 == 0) - ++num20; - while (num20 >= 12) - num20 -= 12; - Main.fairyJarFrame[index] = num20; - } - for (int index = 0; index < Main.cageFrames; ++index) - { - byte num21 = 5; + byte num2 = 5; if (Main.fishBowlFrameMode[index] == (byte) 1) { if (Main.rand.Next(900) == 0) - Main.fishBowlFrameMode[index] = (byte) Main.rand.Next((int) num21); + Main.fishBowlFrameMode[index] = (byte) Main.rand.Next((int) num2); ++Main.fishBowlFrameCounter[index]; if (Main.fishBowlFrameCounter[index] >= 5) { @@ -11366,7 +10115,7 @@ label_56: else if (Main.fishBowlFrameMode[index] == (byte) 2) { if (Main.rand.Next(3600) == 0) - Main.fishBowlFrameMode[index] = (byte) Main.rand.Next((int) num21); + Main.fishBowlFrameMode[index] = (byte) Main.rand.Next((int) num2); ++Main.fishBowlFrameCounter[index]; if (Main.fishBowlFrameCounter[index] >= 20) { @@ -11388,7 +10137,7 @@ label_56: else if (Main.fishBowlFrameMode[index] == (byte) 3) { if (Main.rand.Next(3600) == 0) - Main.fishBowlFrameMode[index] = (byte) Main.rand.Next((int) num21); + Main.fishBowlFrameMode[index] = (byte) Main.rand.Next((int) num2); ++Main.fishBowlFrameCounter[index]; if (Main.fishBowlFrameCounter[index] >= Main.rand.Next(5, 3600)) { @@ -11410,7 +10159,7 @@ label_56: else if (Main.fishBowlFrame[index] <= 10) { if (Main.rand.Next(3600) == 0) - Main.fishBowlFrameMode[index] = (byte) Main.rand.Next((int) num21); + Main.fishBowlFrameMode[index] = (byte) Main.rand.Next((int) num2); ++Main.fishBowlFrameCounter[index]; if (Main.fishBowlFrameCounter[index] >= 10) { @@ -11444,17 +10193,6 @@ label_56: } } } - for (int index = 0; index < Main.cageFrames; ++index) - { - ++Main.lavaFishBowlFrameCounter[index]; - if (Main.lavaFishBowlFrameCounter[index] > 4 + Main.rand.Next(3)) - { - Main.lavaFishBowlFrameCounter[index] = 0; - ++Main.lavaFishBowlFrame[index]; - if (Main.lavaFishBowlFrame[index] > 26) - Main.lavaFishBowlFrame[index] = 0; - } - } for (int index5 = 0; index5 < 9; ++index5) { for (int index6 = 0; index6 < Main.cageFrames; ++index6) @@ -11466,20 +10204,20 @@ label_56: if (Main.rand.Next(2) == 0) Main.butterflyCageMode[index5, index6] += (byte) 10; } - int num22 = Main.rand.Next(3, 16); + int num3 = Main.rand.Next(3, 16); if (Main.butterflyCageMode[index5, index6] == (byte) 1 || Main.butterflyCageMode[index5, index6] == (byte) 11) - num22 = 3; + num3 = 3; if (Main.butterflyCageMode[index5, index6] == (byte) 2 || Main.butterflyCageMode[index5, index6] == (byte) 12) - num22 = 5; + num3 = 5; if (Main.butterflyCageMode[index5, index6] == (byte) 3 || Main.butterflyCageMode[index5, index6] == (byte) 13) - num22 = 10; + num3 = 10; if (Main.butterflyCageMode[index5, index6] == (byte) 4 || Main.butterflyCageMode[index5, index6] == (byte) 14) - num22 = 15; + num3 = 15; if (Main.butterflyCageMode[index5, index6] >= (byte) 10) { if (Main.butterflyCageFrame[index5, index6] <= 7) { - if (Main.butterflyCageFrameCounter[index5, index6] >= num22) + if (Main.butterflyCageFrameCounter[index5, index6] >= num3) { Main.butterflyCageFrameCounter[index5, index6] = 0; --Main.butterflyCageFrame[index5, index6]; @@ -11499,7 +10237,7 @@ label_56: } } } - else if (Main.butterflyCageFrameCounter[index5, index6] >= num22) + else if (Main.butterflyCageFrameCounter[index5, index6] >= num3) { Main.butterflyCageFrameCounter[index5, index6] = 0; --Main.butterflyCageFrame[index5, index6]; @@ -11521,7 +10259,7 @@ label_56: } else if (Main.butterflyCageFrame[index5, index6] <= 7) { - if (Main.butterflyCageFrameCounter[index5, index6] >= num22) + if (Main.butterflyCageFrameCounter[index5, index6] >= num3) { Main.butterflyCageFrameCounter[index5, index6] = 0; ++Main.butterflyCageFrame[index5, index6]; @@ -11531,7 +10269,7 @@ label_56: Main.butterflyCageFrame[index5, index6] += 8; } } - else if (Main.butterflyCageFrameCounter[index5, index6] >= num22) + else if (Main.butterflyCageFrameCounter[index5, index6] >= num3) { Main.butterflyCageFrameCounter[index5, index6] = 0; ++Main.butterflyCageFrame[index5, index6]; @@ -11542,7 +10280,6 @@ label_56: } } } - Main.UpdateDragonflyJarFrames(); for (int index7 = 0; index7 < 3; ++index7) { for (int index8 = 0; index8 < Main.cageFrames; ++index8) @@ -11552,37 +10289,37 @@ label_56: Main.jellyfishCageMode[index7, index8] = (byte) 1; if (Main.jellyfishCageMode[index7, index8] == (byte) 2 && Main.rand.Next(60) == 0) Main.jellyfishCageMode[index7, index8] = (byte) 3; - int num23 = 1; + int num4 = 1; if (Main.jellyfishCageMode[index7, index8] == (byte) 0) - num23 = Main.rand.Next(10, 20); + num4 = Main.rand.Next(10, 20); if (Main.jellyfishCageMode[index7, index8] == (byte) 1) - num23 = Main.rand.Next(15, 25); + num4 = Main.rand.Next(15, 25); if (Main.jellyfishCageMode[index7, index8] == (byte) 2) - num23 = Main.rand.Next(4, 9); + num4 = Main.rand.Next(4, 9); if (Main.jellyfishCageMode[index7, index8] == (byte) 3) - num23 = Main.rand.Next(15, 25); - if (Main.jellyfishCageMode[index7, index8] == (byte) 0 && Main.jellyfishCageFrame[index7, index8] <= 3 && Main.jellyfishCageFrameCounter[index7, index8] >= num23) + num4 = Main.rand.Next(15, 25); + if (Main.jellyfishCageMode[index7, index8] == (byte) 0 && Main.jellyfishCageFrame[index7, index8] <= 3 && Main.jellyfishCageFrameCounter[index7, index8] >= num4) { Main.jellyfishCageFrameCounter[index7, index8] = 0; ++Main.jellyfishCageFrame[index7, index8]; if (Main.jellyfishCageFrame[index7, index8] >= 4) Main.jellyfishCageFrame[index7, index8] = 0; } - if (Main.jellyfishCageMode[index7, index8] == (byte) 1 && Main.jellyfishCageFrame[index7, index8] <= 7 && Main.jellyfishCageFrameCounter[index7, index8] >= num23) + if (Main.jellyfishCageMode[index7, index8] == (byte) 1 && Main.jellyfishCageFrame[index7, index8] <= 7 && Main.jellyfishCageFrameCounter[index7, index8] >= num4) { Main.jellyfishCageFrameCounter[index7, index8] = 0; ++Main.jellyfishCageFrame[index7, index8]; if (Main.jellyfishCageFrame[index7, index8] >= 7) Main.jellyfishCageMode[index7, index8] = (byte) 2; } - if (Main.jellyfishCageMode[index7, index8] == (byte) 2 && Main.jellyfishCageFrame[index7, index8] <= 9 && Main.jellyfishCageFrameCounter[index7, index8] >= num23) + if (Main.jellyfishCageMode[index7, index8] == (byte) 2 && Main.jellyfishCageFrame[index7, index8] <= 9 && Main.jellyfishCageFrameCounter[index7, index8] >= num4) { Main.jellyfishCageFrameCounter[index7, index8] = 0; ++Main.jellyfishCageFrame[index7, index8]; if (Main.jellyfishCageFrame[index7, index8] >= 9) Main.jellyfishCageFrame[index7, index8] = 7; } - if (Main.jellyfishCageMode[index7, index8] == (byte) 3 && Main.jellyfishCageFrame[index7, index8] <= 10 && Main.jellyfishCageFrameCounter[index7, index8] >= num23) + if (Main.jellyfishCageMode[index7, index8] == (byte) 3 && Main.jellyfishCageFrame[index7, index8] <= 10 && Main.jellyfishCageFrameCounter[index7, index8] >= num4) { Main.jellyfishCageFrameCounter[index7, index8] = 0; ++Main.jellyfishCageFrame[index7, index8]; @@ -11596,125 +10333,6 @@ label_56: } } - private static void UpdateOwlCageFrames() - { - for (int style = 0; style < Main.cageFrames; ++style) - Main.UpdateOwlCageFrame(Main.owlCageFrame, Main.owlCageFrameCounter, style); - } - - private static void UpdateDragonflyJarFrames() - { - for (int style = 0; style < Main.dragonflyJarFrameCounter.GetLength(0); ++style) - { - for (int variation = 0; variation < Main.cageFrames; ++variation) - Main.UpdateDragonflyJarFrame(Main.dragonflyJarFrame, Main.dragonflyJarFrameCounter, style, variation); - } - } - - private static void UpdateOwlCageFrame(int[] frames, int[] frameCounters, int style) - { - if (frameCounters[style] % 40 != 0 || Main.rand.Next(80) == 0) - ++frameCounters[style]; - if ((frameCounters[style] + 1) % 40 == 39) - frameCounters[style] = 40 * Main.rand.Next(4); - int num1 = frameCounters[style] % 40 / 10; - int num2 = frameCounters[style] / 40; - int num3 = 0; - switch (num2) - { - case 0: - if (num1 == 3) - num1 = 1; - num3 = num1; - break; - case 1: - if (num1 == 3) - num1 = 1; - num3 = 0; - if (num1 != 0) - { - num3 = 8 - num1; - break; - } - break; - case 2: - num3 = 0; - if (num1 != 0) - { - num3 = 7 + num1; - break; - } - break; - case 3: - num3 = 0; - if (num1 != 0) - { - num3 = 11 + num1; - break; - } - break; - } - frames[style] = num3; - } - - private static void UpdateDragonflyJarFrame( - int[,] frames, - int[,] frameCounters, - int style, - int variation) - { - ++frameCounters[style, variation]; - switch (frames[style, variation]) - { - case 0: - if (frameCounters[style, variation] < 300 || Main.rand.Next(60) != 0) - break; - frameCounters[style, variation] = 0; - frames[style, variation] = Main.rand.NextFromList(1, 5, 9); - break; - case 1: - case 5: - case 9: - if (frameCounters[style, variation] >= 100) - { - frameCounters[style, variation] = 0; - if (frames[style, variation] == 1) - { - frames[style, variation] = Main.rand.NextFromList(0, 5, 5, 9, 9); - break; - } - frames[style, variation] = 1; - break; - } - if (frameCounters[style, variation] < 6) - break; - frameCounters[style, variation] = 0; - ++frames[style, variation]; - break; - case 2: - case 3: - case 4: - case 6: - case 7: - case 8: - case 10: - case 11: - case 12: - int num1 = frames[style, variation] - 1; - int num2 = num1 % 4 - 1; - int num3 = frameCounters[style, variation] / 4 % 4; - if (num3 > 2) - num3 = 4 - num3; - int num4 = num1 - num2 + 1 + num3; - frames[style, variation] = num4; - if (frameCounters[style, variation] < 40 || Main.rand.Next(30) != 0) - break; - frameCounters[style, variation] = 100; - frames[style, variation] = num1 - num2 + 1 - 1; - break; - } - } - public static void DoUpdate_AnimateItemIcons() { for (int index1 = 0; index1 < Main.itemAnimationsRegistered.Count; ++index1) @@ -11725,13 +10343,19 @@ label_56: } } - public static void QueueMainThreadAction(Action action) => Main._mainThreadActions.Enqueue(action); + public static int TextMaxLengthForScreen => Main.screenWidth - 320; - private static void ConsumeAllMainThreadActions() + public void CrazyTestMemoryLimit() { - Action result; - while (Main._mainThreadActions.TryDequeue(out result)) - result(); + if (!this._crazyTestedMemoryLimit) + { + this._crazyTestedMemoryLimit = true; + this._crazyTestArrayMemoryLimit = new Player[50000]; + for (int index = 0; index < this._crazyTestArrayMemoryLimit.Length; ++index) + this._crazyTestArrayMemoryLimit[index] = new Player(); + } + int index1 = Main.rand.Next(this._crazyTestArrayMemoryLimit.Length); + Main.NewText("testing " + (object) index1 + " " + this._crazyTestArrayMemoryLimit[index1].name); } protected override void Update(GameTime gameTime) @@ -11742,36 +10366,29 @@ label_56: if (Main.OnEnginePreload != null) Main.OnEnginePreload(); } - if (!this._isDrawingOrUpdating) - { - this._isDrawingOrUpdating = true; - this.DoUpdate(gameTime); - CinematicManager.Instance.Update(gameTime); - switch (Main.netMode) - { - case 1: - Netplay.Connection.Socket.SendQueuedPackets(); - break; - case 2: - for (int index = 0; index < 256; ++index) - { - if (Netplay.Clients[index].Socket != null) - Netplay.Clients[index].Socket.SendQueuedPackets(); - } - break; - } - this._isDrawingOrUpdating = false; - } - Main.ConsumeAllMainThreadActions(); - if (!Main._WeGameReqExit) + if (this._isDrawingOrUpdating) return; - this.QuitGame(); + this._isDrawingOrUpdating = true; + this.DoUpdate(gameTime); + CinematicManager.Instance.Update(gameTime); + switch (Main.netMode) + { + case 1: + Netplay.Connection.Socket.SendQueuedPackets(); + break; + case 2: + for (int index = 0; index < 256; ++index) + { + if (Netplay.Clients[index].Socket != null) + Netplay.Clients[index].Socket.SendQueuedPackets(); + } + break; + } + this._isDrawingOrUpdating = false; } public void UpdateViewZoomKeys() { - if (Main.inFancyUI) - return; float num = 0.01f; if (PlayerInput.Triggers.Current.ViewZoomIn) Main.GameZoomTarget = Utils.Clamp(Main.GameZoomTarget + num, 1f, 2f); @@ -11780,944 +10397,740 @@ label_56: Main.GameZoomTarget = Utils.Clamp(Main.GameZoomTarget - num, 1f, 2f); } - public static void NotifyOfEvent(GameNotificationType type) - { - if (Main.instance.IsActive || !Main._flashNotificationType.HasFlag((Enum) type)) - return; - Main.QueueMainThreadAction((Action) (() => Platform.Get().StartFlashingIcon(Main.instance.Window))); - } - protected void DoUpdate(GameTime gameTime) { - Main.gameTimeCache = gameTime; - if (Main.showSplash) + Main.ignoreErrors = true; + PartySky.MultipleSkyWorkaroundFix = true; + TimeSpan timeSpan; + if (!Main.GlobalTimerPaused) { - this.UpdateAudio(); + timeSpan = gameTime.TotalGameTime; + Main.GlobalTime = (float) (timeSpan.TotalSeconds % 3600.0); } + if (Player.StopMoneyTroughFromWorking > 0 && !Main.mouseRight && Main.mouseRightRelease) + --Player.StopMoneyTroughFromWorking; + PlayerInput.SetZoom_UI(); + if (!Main.gameMenu || Main.menuMode != 888) + Main.MenuUI.SetState((UIState) null); else - { - PartySky.MultipleSkyWorkaroundFix = true; - Main.LocalPlayer.cursorItemIconReversed = false; - TimeSpan timeSpan; - if (!Main.GlobalTimerPaused) - { - timeSpan = gameTime.TotalGameTime; - Main.GlobalTimeWrappedHourly = (float) (timeSpan.TotalSeconds % 3600.0); - } - Main._overrideForExpertMode = new bool?(); - Main._overrideForMasterMode = new bool?(); - if (!Main.gameMenu && Main._currentGameModeInfo.IsJourneyMode) - { - CreativePowers.DifficultySliderPower power = CreativePowerManager.Instance.GetPower(); - if (power.GetIsUnlocked()) - { - if ((double) power.StrengthMultiplierToGiveNPCs >= 2.0) - Main._overrideForExpertMode = new bool?(true); - if ((double) power.StrengthMultiplierToGiveNPCs >= 3.0) - Main._overrideForMasterMode = new bool?(true); - } - } - Main.UpdateWorldPreparationState(); - if (Player.BlockInteractionWithProjectiles > 0 && !Main.mouseRight && Main.mouseRightRelease) - --Player.BlockInteractionWithProjectiles; - PlayerInput.SetZoom_UI(); - if (!Main.gameMenu || Main.menuMode != 888) - Main.MenuUI.SetState((UIState) null); - else - Main.InGameUI.SetState((UIState) null); - Main.CurrentInputTextTakerOverride = (object) null; - Main.AchievementAdvisor.Update(); - PlayerInput.SetZoom_Unscaled(); - Main.MouseOversTryToClear(); - PlayerInput.ResetInputsOnActiveStateChange(); - if (Main.OnTickForThirdPartySoftwareOnly != null) - Main.OnTickForThirdPartySoftwareOnly(); - if (Main._hasPendingNetmodeChange) - { - Main.netMode = Main._targetNetMode; - Main._hasPendingNetmodeChange = false; - } - if (CaptureManager.Instance.IsCapturing) - return; - if (Main.ActivePlayerFileData != null) - Main.ActivePlayerFileData.UpdatePlayTimer(); - Netplay.Update(); - Main.gameInactive = !this.IsActive; - if (Main.changeTheTitle) - { - Main.changeTheTitle = false; - this.SetTitle(); - } - this._worldUpdateTimeTester.Restart(); - if (!WorldGen.gen) - WorldGen.destroyObject = false; - if (Main.gameMenu) - Main.mapFullscreen = false; - Main.UpdateSettingUnlocks(); - if (Main.dedServ) - { - if (Main.dedServFPS) - { - ++Main.updatesCountedForFPS; - if (!Main.fpsTimer.IsRunning) - Main.fpsTimer.Restart(); - if (Main.fpsTimer.ElapsedMilliseconds >= 1000L) - { - Main.dedServCount1 += Main.updatesCountedForFPS; - ++Main.dedServCount2; - float num = (float) Main.dedServCount1 / (float) Main.dedServCount2; - Console.WriteLine(Main.updatesCountedForFPS.ToString() + " (" + (object) num + ")"); - Main.updatesCountedForFPS = 0; - Main.fpsTimer.Restart(); - } - } - else - { - if (Main.fpsTimer.IsRunning) - Main.fpsTimer.Stop(); - Main.updatesCountedForFPS = 0; - } - } - Main.DoUpdate_AutoSave(); - if (!Main.dedServ) - { - Main.Chroma.Update(Main.GlobalTimeWrappedHourly); - if (Main.superFast) - { - this.IsFixedTimeStep = false; - Main.graphics.SynchronizeWithVerticalRetrace = false; - } - else - { - if (Main.FrameSkipMode == 0 || Main.FrameSkipMode == 2) - { - if (this.IsActive) - this.IsFixedTimeStep = false; - else - this.IsFixedTimeStep = true; - } - else - { - this.IsFixedTimeStep = true; - Main.graphics.SynchronizeWithVerticalRetrace = true; - } - Main.graphics.SynchronizeWithVerticalRetrace = true; - } - if (Main.showSplash) - return; - ++Main.updatesCountedForFPS; - if (Main.fpsTimer.ElapsedMilliseconds >= 1000L) - { - if ((double) Main.fpsCount >= 30.0 + 30.0 * (double) Main.gfxQuality) - { - Main.gfxQuality += Main.gfxRate; - Main.gfxRate += 0.005f; - } - else if ((double) Main.fpsCount < 29.0 + 30.0 * (double) Main.gfxQuality) - { - Main.gfxRate = 0.01f; - Main.gfxQuality -= 0.1f; - } - if ((double) Main.gfxQuality < 0.0) - Main.gfxQuality = 0.0f; - if ((double) Main.gfxQuality > 1.0) - Main.gfxQuality = 1f; - if (Main.maxQ && this.IsActive) - { - Main.gfxQuality = 1f; - Main.maxQ = false; - } - Main.updateRate = Main.uCount; - Main.frameRate = Main.fpsCount; - Main.fpsCount = 0; - Main.fpsTimer.Restart(); - Main.updatesCountedForFPS = 0; - Main.drawsCountedForFPS = 0; - Main.uCount = 0; - Main.mapTimeMax = (double) Main.gfxQuality >= 0.800000011920929 ? 0 : (int) ((1.0 - (double) Main.gfxQuality) * 60.0); - } - if (Main.FrameSkipMode == 0 || Main.FrameSkipMode == 2) - { - double updateTimeAccumulator = Main.UpdateTimeAccumulator; - timeSpan = gameTime.ElapsedGameTime; - double totalSeconds = timeSpan.TotalSeconds; - Main.UpdateTimeAccumulator = updateTimeAccumulator + totalSeconds; - if (Main.UpdateTimeAccumulator < 0.0166666675359011 && !Main.superFast) - { - if (Main.FrameSkipMode != 2) - return; - Main.instance.SuppressDraw(); - return; - } - gameTime = new GameTime(gameTime.TotalGameTime, new TimeSpan(166666L)); - Main.UpdateTimeAccumulator -= 0.0166666675359011; - Main.UpdateTimeAccumulator = Math.Min(Main.UpdateTimeAccumulator, 0.0166666675359011); - } - ++Main.uCount; - Main.drawSkip = false; - PlayerInput.SetZoom_UI(); - Main.UpdateUIStates(gameTime); - PlayerInput.SetZoom_Unscaled(); - Terraria.Graphics.Effects.Filters.Scene.Update(gameTime); - Overlays.Scene.Update(gameTime); - LiquidRenderer.Instance.Update(gameTime); - this.UpdateAudio(); - InGameNotificationsTracker.Update(); - ItemSlot.UpdateInterface(); - if (Main.teamCooldown > 0) - --Main.teamCooldown; - Main.DoUpdate_AnimateBackgrounds(); - Animation.UpdateAll(); - switch (Main.qaStyle) - { - case 1: - Main.gfxQuality = 1f; - break; - case 2: - Main.gfxQuality = 0.5f; - break; - case 3: - Main.gfxQuality = 0.0f; - break; - } - Main.maxDustToDraw = (int) (6000.0 * ((double) Main.gfxQuality * 0.699999988079071 + 0.300000011920929)); - if ((double) Main.gfxQuality < 0.9) - Main.maxDustToDraw = (int) ((double) Main.maxDustToDraw * (double) Main.gfxQuality); - if (Main.maxDustToDraw < 1000) - Main.maxDustToDraw = 1000; - Gore.goreTime = (int) (600.0 * (double) Main.gfxQuality); - if (!WorldGen.gen) - { - Terraria.Liquid.cycles = (int) (17.0 - 10.0 * (double) Main.gfxQuality); - Terraria.Liquid.curMaxLiquid = (int) ((double) Terraria.Liquid.maxLiquid * 0.25 + (double) Terraria.Liquid.maxLiquid * 0.75 * (double) Main.gfxQuality); - if (Main.Setting_UseReducedMaxLiquids) - Terraria.Liquid.curMaxLiquid = (int) (2500.0 + 2500.0 * (double) Main.gfxQuality); - } - if (Main.superFast) - { - Main.graphics.SynchronizeWithVerticalRetrace = false; - Main.drawSkip = false; - } - LegacyLighting.RenderPhases = (double) Main.gfxQuality >= 0.2 ? ((double) Main.gfxQuality >= 0.4 ? ((double) Main.gfxQuality >= 0.6 ? ((double) Main.gfxQuality >= 0.8 ? 4 : 5) : 6) : 7) : 8; - if (!WorldGen.gen && Terraria.Liquid.quickSettle) - { - Terraria.Liquid.curMaxLiquid = Terraria.Liquid.maxLiquid; - if (Main.Setting_UseReducedMaxLiquids) - Terraria.Liquid.curMaxLiquid = 5000; - Terraria.Liquid.cycles = 1; - } - if (WorldGen.drunkWorldGen) - { - if (!Main.gameMenu) - { - WorldGen.drunkWorldGen = false; - this.logoRotation = 0.0f; - this.logoRotationSpeed = 0.0f; - this.logoScale = 1f; - } - } - else if (Main.gameMenu && (double) Math.Abs(this.logoRotationSpeed) > 1000.0) - { - this.logoRotation = 0.0f; - this.logoRotationSpeed = 0.0f; - this.logoScale = 1f; - } - Main.UpdateOldNPCShop(); - Main.hasFocus = this.IsActive; - Main.hasFocus |= Form.ActiveForm == Control.FromHandle(this.Window.Handle) as Form; - if (!this.IsActive && Main.netMode == 0) - { - if (!Platform.IsOSX) - this.IsMouseVisible = true; - if (Main.netMode != 2 && Main.myPlayer >= 0) - Main.player[Main.myPlayer].delayUseItem = true; - Main.mouseLeftRelease = false; - Main.mouseRightRelease = false; - if (Main.gameMenu) - Main.UpdateMenu(); - Main.gamePaused = true; - return; - } - if (!Platform.IsOSX) - this.IsMouseVisible = false; - SkyManager.Instance.Update(gameTime); - if (!Main.gamePaused) - EmoteBubble.UpdateAll(); - ScreenObstruction.Update(); - ScreenDarkness.Update(); - MoonlordDeathDrama.Update(); - Main.DoUpdate_AnimateCursorColors(); - Main.DoUpdate_AnimateTileGlows(); - this.DoUpdate_AnimateDiscoRGB(); - Main.DoUpdate_AnimateVisualPlayerAura(); - this.DoUpdate_AnimateWaterfalls(); - Main.DoUpdate_AnimateWalls(); - Main.AnimateTiles(); - Main.DoUpdate_AnimateItemIcons(); - Main.DoUpdate_F10_ToggleFPS(); - Main.DoUpdate_F9_ToggleLighting(); - Main.DoUpdate_F8_ToggleNetDiagnostics(); - Main.DoUpdate_F7_ToggleGraphicsDiagnostics(); - Main.DoUpdate_F11_ToggleUI(); - Main.DoUpdate_AltEnter_ToggleFullscreen(); - this.DoUpdate_HandleInput(); - Main.DoUpdate_HandleChat(); - Main.DoUpdate_Enter_ToggleChat(); - if (Main.gameMenu) - { - Main.UpdateMenu(); - if (Main.netMode != 2) - return; - Main.gamePaused = false; - } - Main.CheckInvasionProgressDisplay(); - } - this.UpdateWindyDayState(); - if (Main.netMode == 2) - Main.cloudAlpha = Main.maxRaining; - bool isActive = this.IsActive; - if (Main.netMode == 1) - Main.TrySyncingMyPlayer(); - if (Main.CanPauseGame()) - { - Main.DoUpdate_WhilePaused(); - Main.gamePaused = true; - } - else - { - Main.gamePaused = false; - if (Main.OnTickForInternalCodeOnly != null) - Main.OnTickForInternalCodeOnly(); - if (Main.netMode != 1 && !Main.gameMenu && !Main.gamePaused && Main.AmbienceServer != null) - Main.AmbienceServer.Update(); - WorldGen.BackgroundsCache.UpdateFlashValues(); - if (Main.LocalGolfState != null) - Main.LocalGolfState.Update(); - if ((isActive || Main.netMode == 1) && (double) Main.cloudAlpha > 0.0) - Rain.MakeRain(); - if (Main.netMode != 1) - this.updateCloudLayer(); - for (int index = 0; index < Main.dayRate; ++index) - this.UpdateWeather(gameTime); - if (++Main.timeForVisualEffects >= 216000.0) - Main.timeForVisualEffects = 0.0; - Main.UnpausedUpdateSeed = Utils.RandomNextSeed(Main.UnpausedUpdateSeed); - Main.Ambience(); - if (Main.netMode != 2) - { - try - { - Main.snowing(); - } - catch - { - if (!Main.ignoreErrors) - throw; - } - Sandstorm.EmitDust(); - } - if (!Main.dedServ && (double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0 && Main.netMode != 2) - { - Star.UpdateStars(); - Cloud.UpdateClouds(); - } - PortalHelper.UpdatePortalPoints(); - if (this.ShouldUpdateEntities()) - this.DoUpdateInWorld(this._worldUpdateTimeTester); - if (Main.netMode != 2) - Main.ChromaPainter.Update(); - base.Update(gameTime); - } - } - } - - private static bool CanPauseGame() - { - bool flag = false; - if (Main.netMode == 0) - flag = ((flag | Main.ingameOptionsWindow ? 1 : 0) | (!Main.autoPause ? 0 : (Main.playerInventory || Main.LocalPlayer.sign >= 0 ? 1 : (Main.InGameUI.IsVisible ? 1 : 0)))) != 0; - return flag; - } - - private static void DoUpdate_WhilePaused() - { - if (!Main.drawingPlayerChat && !Main.editSign && !Main.editChest && !Main.blockInput) - { - Main.player[Main.myPlayer].controlInv = PlayerInput.Triggers.Current.Inventory; - if (Main.player[Main.myPlayer].controlInv) - { - if (Main.player[Main.myPlayer].releaseInventory) - Main.player[Main.myPlayer].ToggleInv(); - Main.player[Main.myPlayer].releaseInventory = false; - } - else - Main.player[Main.myPlayer].releaseInventory = true; - } - if (Main.playerInventory) - { - Recipe.GetThroughDelayedFindRecipes(); - int num1 = PlayerInput.ScrollWheelDelta / 120; - bool flag = true; - if (Main.recBigList) - { - int num2 = 42; - int y = 340; - int x = 310; - PlayerInput.SetZoom_UI(); - int num3 = (Main.screenWidth - x - 280) / num2; - int num4 = (Main.screenHeight - y - 20) / num2; - if (new Microsoft.Xna.Framework.Rectangle(x, y, num3 * num2, num4 * num2).Contains(Main.MouseScreen.ToPoint())) - { - int num5 = Math.Sign(num1); - for (; num1 != 0; num1 -= num5) - { - if (num1 < 0) - { - Main.recStart -= num3; - if (Main.recStart < 0) - Main.recStart = 0; - } - else - { - Main.recStart += num3; - SoundEngine.PlaySound(12); - if (Main.recStart > Main.numAvailableRecipes - num3) - Main.recStart = Main.numAvailableRecipes - num3; - } - } - } - PlayerInput.SetZoom_World(); - } - if (flag) - { - Main.focusRecipe += num1; - if (Main.focusRecipe > Main.numAvailableRecipes - 1) - Main.focusRecipe = Main.numAvailableRecipes - 1; - if (Main.focusRecipe < 0) - Main.focusRecipe = 0; - } - Main.player[Main.myPlayer].dropItemCheck(); - } - Main.player[Main.myPlayer].head = Main.player[Main.myPlayer].armor[0].headSlot; - Main.player[Main.myPlayer].body = Main.player[Main.myPlayer].armor[1].bodySlot; - Main.player[Main.myPlayer].legs = Main.player[Main.myPlayer].armor[2].legSlot; - if (!Main.player[Main.myPlayer].hostile) - { - if (Main.player[Main.myPlayer].armor[10].headSlot >= 0) - Main.player[Main.myPlayer].head = Main.player[Main.myPlayer].armor[10].headSlot; - if (Main.player[Main.myPlayer].armor[11].bodySlot >= 0) - Main.player[Main.myPlayer].body = Main.player[Main.myPlayer].armor[11].bodySlot; - if (Main.player[Main.myPlayer].armor[12].legSlot >= 0) - Main.player[Main.myPlayer].legs = Main.player[Main.myPlayer].armor[12].legSlot; - } - if (Main.editSign) - { - if (Main.player[Main.myPlayer].sign == -1) - Main.editSign = false; - else - Main.InputTextSign(); - } - else if (Main.editChest && Main.player[Main.myPlayer].chest == -1) - Main.editChest = false; - Player.tileTargetX = (int) (((double) Main.mouseX + (double) Main.screenPosition.X) / 16.0); - Player.tileTargetY = (int) (((double) Main.mouseY + (double) Main.screenPosition.Y) / 16.0); - Main.player[Main.myPlayer].LookForTileInteractions(); - Main.player[Main.myPlayer].lastChest = Main.player[Main.myPlayer].chest; - if (!Main.playerInventory) - return; - Main.player[Main.myPlayer].AdjTiles(); - } - - private static void UpdateUIStates(GameTime gameTime) - { + Main.InGameUI.SetState((UIState) null); if (Main.MenuUI != null) Main.MenuUI.Update(gameTime); if (Main.InGameUI != null) Main.InGameUI.Update(gameTime); - Main.CreativeMenu.Update(gameTime); - Main.BigBossProgressBar.Update(); - } - - private void DoDebugFunctions() - { - } - - private void PreUpdateAllProjectiles() - { - this.SpelunkerProjectileHelper.OnPreUpdateAllProjectiles(); - this.ChumBucketProjectileHelper.OnPreUpdateAllProjectiles(); - } - - private void PostUpdateAllProjectiles() - { - } - - private static void TrySyncingMyPlayer() - { - Player clientPlayer = Main.clientPlayer; - bool flag1 = false; - for (int index = 0; index < 59; ++index) + PlayerInput.SetZoom_Unscaled(); + Main.MouseOversTryToClear(); + PlayerInput.ResetInputsOnActiveStateChange(); + if (Main.OnTick != null) + Main.OnTick(); + if (Main._hasPendingNetmodeChange) { - if (Main.player[Main.myPlayer].inventory[index].IsNotTheSameAs(clientPlayer.inventory[index])) + Main.netMode = Main._targetNetMode; + Main._hasPendingNetmodeChange = false; + } + if (CaptureManager.Instance.IsCapturing) + return; + if (Main.ActivePlayerFileData != null) + Main.ActivePlayerFileData.UpdatePlayTimer(); + if (Main.expertMode) + { + Main.damageMultiplier = Main.expertDamage; + Main.knockBackMultiplier = Main.expertKnockBack; + } + else + { + Main.damageMultiplier = 1f; + Main.knockBackMultiplier = 1f; + } + Main.gameInactive = !this.IsActive; + if (Main.chTitle) + { + Main.chTitle = false; + this.SetTitle(); + } + Stopwatch stopwatch = new Stopwatch(); + stopwatch.Start(); + WorldGen.destroyObject = false; + if (Main.gameMenu) + Main.mapFullscreen = false; + Main.UpdateSettingUnlocks(); + if (Main.dedServ) + { + if (Main.dedServFPS) { - flag1 = true; - NetMessage.SendData(5, number: Main.myPlayer, number2: ((float) index), number3: ((float) Main.player[Main.myPlayer].inventory[index].prefix)); + ++Main.updatesCountedForFPS; + if (!Main.fpsTimer.IsRunning) + Main.fpsTimer.Restart(); + if (Main.fpsTimer.ElapsedMilliseconds >= 1000L) + { + Main.dedServCount1 += Main.updatesCountedForFPS; + ++Main.dedServCount2; + float num = (float) Main.dedServCount1 / (float) Main.dedServCount2; + Console.WriteLine(Main.updatesCountedForFPS.ToString() + " (" + (object) num + ")"); + Main.updatesCountedForFPS = 0; + Main.fpsTimer.Restart(); + } + } + else + { + if (Main.fpsTimer.IsRunning) + Main.fpsTimer.Stop(); + Main.updatesCountedForFPS = 0; } } - for (int index = 0; index < Main.player[Main.myPlayer].armor.Length; ++index) + if (!Main.dedServ) { - if (Main.player[Main.myPlayer].armor[index].IsNotTheSameAs(clientPlayer.armor[index])) + if (Main.superFast) { - flag1 = true; - NetMessage.SendData(5, number: Main.myPlayer, number2: ((float) (59 + index)), number3: ((float) Main.player[Main.myPlayer].armor[index].prefix)); + this.IsFixedTimeStep = false; + Main.graphics.SynchronizeWithVerticalRetrace = false; } - } - for (int index = 0; index < Main.player[Main.myPlayer].miscEquips.Length; ++index) - { - if (Main.player[Main.myPlayer].miscEquips[index].IsNotTheSameAs(clientPlayer.miscEquips[index])) + else { - flag1 = true; - NetMessage.SendData(5, number: Main.myPlayer, number2: ((float) (58 + Main.player[Main.myPlayer].armor.Length + Main.player[Main.myPlayer].dye.Length + 1 + index)), number3: ((float) Main.player[Main.myPlayer].miscEquips[index].prefix)); + if (Main.FrameSkipMode == 0 || Main.FrameSkipMode == 2) + { + if (this.IsActive) + this.IsFixedTimeStep = false; + else + this.IsFixedTimeStep = true; + } + else + { + this.IsFixedTimeStep = true; + Main.graphics.SynchronizeWithVerticalRetrace = true; + } + Main.graphics.SynchronizeWithVerticalRetrace = true; } - } - for (int index = 0; index < Main.player[Main.myPlayer].miscDyes.Length; ++index) - { - if (Main.player[Main.myPlayer].miscDyes[index].IsNotTheSameAs(clientPlayer.miscDyes[index])) + if (Main.showSplash) + return; + Main.DoUpdate_AutoSave(); + ++Main.updatesCountedForFPS; + if (Main.fpsTimer.ElapsedMilliseconds >= 1000L) { - flag1 = true; - NetMessage.SendData(5, number: Main.myPlayer, number2: ((float) (58 + Main.player[Main.myPlayer].armor.Length + Main.player[Main.myPlayer].dye.Length + Main.player[Main.myPlayer].miscEquips.Length + 1 + index)), number3: ((float) Main.player[Main.myPlayer].miscDyes[index].prefix)); + if ((double) Main.fpsCount >= 30.0 + 30.0 * (double) Main.gfxQuality) + { + Main.gfxQuality += Main.gfxRate; + Main.gfxRate += 0.005f; + } + else if ((double) Main.fpsCount < 29.0 + 30.0 * (double) Main.gfxQuality) + { + Main.gfxRate = 0.01f; + Main.gfxQuality -= 0.1f; + } + if ((double) Main.gfxQuality < 0.0) + Main.gfxQuality = 0.0f; + if ((double) Main.gfxQuality > 1.0) + Main.gfxQuality = 1f; + if (Main.maxQ && this.IsActive) + { + Main.gfxQuality = 1f; + Main.maxQ = false; + } + Main.updateRate = Main.uCount; + Main.frameRate = Main.fpsCount; + Main.fpsCount = 0; + Main.fpsTimer.Restart(); + Main.updatesCountedForFPS = 0; + Main.drawsCountedForFPS = 0; + Main.uCount = 0; + Main.mapTimeMax = (double) Main.gfxQuality >= 0.800000011920929 ? 0 : (int) ((1.0 - (double) Main.gfxQuality) * 60.0); } - } - for (int index = 0; index < Main.player[Main.myPlayer].bank.item.Length; ++index) - { - if (Main.player[Main.myPlayer].bank.item[index].IsNotTheSameAs(clientPlayer.bank.item[index])) + if (Main.FrameSkipMode == 0 || Main.FrameSkipMode == 2) { - flag1 = true; - NetMessage.SendData(5, number: Main.myPlayer, number2: ((float) (58 + Main.player[Main.myPlayer].armor.Length + Main.player[Main.myPlayer].dye.Length + Main.player[Main.myPlayer].miscEquips.Length + Main.player[Main.myPlayer].miscDyes.Length + 1 + index)), number3: ((float) Main.player[Main.myPlayer].bank.item[index].prefix)); + double updateTimeAccumulator = Main.UpdateTimeAccumulator; + timeSpan = gameTime.ElapsedGameTime; + double totalSeconds = timeSpan.TotalSeconds; + Main.UpdateTimeAccumulator = updateTimeAccumulator + totalSeconds; + if (Main.UpdateTimeAccumulator < 0.0166666675359011 && !Main.superFast) + { + if (Main.FrameSkipMode != 2) + return; + Main.instance.SuppressDraw(); + return; + } + gameTime = new GameTime(gameTime.TotalGameTime, new TimeSpan(166666L)); + Main.UpdateTimeAccumulator -= 0.0166666675359011; + Main.UpdateTimeAccumulator = Math.Min(Main.UpdateTimeAccumulator, 0.0166666675359011); } - } - for (int index = 0; index < Main.player[Main.myPlayer].bank2.item.Length; ++index) - { - if (Main.player[Main.myPlayer].bank2.item[index].IsNotTheSameAs(clientPlayer.bank2.item[index])) + ++Main.uCount; + Main.drawSkip = false; + Filters.Scene.Update(gameTime); + Overlays.Scene.Update(gameTime); + SkyManager.Instance.Update(gameTime); + LiquidRenderer.Instance.Update(gameTime); + this.UpdateAudio(); + AchievementCompleteUI.Update(); + ItemSlot.UpdateInterface(); + if (Main.teamCooldown > 0) + --Main.teamCooldown; + Main.DoUpdate_AnimateBackgrounds(); + Animation.UpdateAll(); + switch (Main.qaStyle) { - flag1 = true; - NetMessage.SendData(5, number: Main.myPlayer, number2: ((float) (58 + Main.player[Main.myPlayer].armor.Length + Main.player[Main.myPlayer].dye.Length + Main.player[Main.myPlayer].miscEquips.Length + Main.player[Main.myPlayer].miscDyes.Length + Main.player[Main.myPlayer].bank.item.Length + 1 + index)), number3: ((float) Main.player[Main.myPlayer].bank2.item[index].prefix)); + case 1: + Main.gfxQuality = 1f; + break; + case 2: + Main.gfxQuality = 0.5f; + break; + case 3: + Main.gfxQuality = 0.0f; + break; } - } - if (Main.player[Main.myPlayer].trashItem.IsNotTheSameAs(clientPlayer.trashItem)) - { - flag1 = true; - NetMessage.SendData(5, number: Main.myPlayer, number2: ((float) (58 + Main.player[Main.myPlayer].armor.Length + Main.player[Main.myPlayer].dye.Length + Main.player[Main.myPlayer].miscEquips.Length + Main.player[Main.myPlayer].miscDyes.Length + Main.player[Main.myPlayer].bank.item.Length + Main.player[Main.myPlayer].bank2.item.Length + 1)), number3: ((float) Main.player[Main.myPlayer].trashItem.prefix)); - } - for (int index = 0; index < Main.player[Main.myPlayer].bank3.item.Length; ++index) - { - if (Main.player[Main.myPlayer].bank3.item[index].IsNotTheSameAs(clientPlayer.bank3.item[index])) + Main.maxDustToDraw = (int) (6000.0 * ((double) Main.gfxQuality * 0.699999988079071 + 0.300000011920929)); + if ((double) Main.gfxQuality < 0.9) + Main.maxDustToDraw = (int) ((double) Main.maxDustToDraw * (double) Main.gfxQuality); + if (Main.maxDustToDraw < 1000) + Main.maxDustToDraw = 1000; + Gore.goreTime = (int) (600.0 * (double) Main.gfxQuality); + if (!WorldGen.gen) { - flag1 = true; - NetMessage.SendData(5, number: Main.myPlayer, number2: ((float) (58 + Main.player[Main.myPlayer].armor.Length + Main.player[Main.myPlayer].dye.Length + Main.player[Main.myPlayer].miscEquips.Length + Main.player[Main.myPlayer].miscDyes.Length + Main.player[Main.myPlayer].bank.item.Length + Main.player[Main.myPlayer].bank2.item.Length + 2 + index)), number3: ((float) Main.player[Main.myPlayer].bank3.item[index].prefix)); + Terraria.Liquid.maxLiquid = (int) (2500.0 + 2500.0 * (double) Main.gfxQuality); + Terraria.Liquid.cycles = (int) (17.0 - 10.0 * (double) Main.gfxQuality); } - } - for (int index = 0; index < Main.player[Main.myPlayer].bank4.item.Length; ++index) - { - if (Main.player[Main.myPlayer].bank4.item[index].IsNotTheSameAs(clientPlayer.bank4.item[index])) + if (Main.superFast) { - flag1 = true; - NetMessage.SendData(5, number: Main.myPlayer, number2: ((float) (58 + Main.player[Main.myPlayer].armor.Length + Main.player[Main.myPlayer].dye.Length + Main.player[Main.myPlayer].miscEquips.Length + Main.player[Main.myPlayer].miscDyes.Length + Main.player[Main.myPlayer].bank.item.Length + Main.player[Main.myPlayer].bank2.item.Length + Main.player[Main.myPlayer].bank3.item.Length + 2 + index)), number3: ((float) Main.player[Main.myPlayer].bank4.item[index].prefix)); + Main.graphics.SynchronizeWithVerticalRetrace = false; + Main.drawSkip = false; } - } - for (int index = 0; index < Main.player[Main.myPlayer].dye.Length; ++index) - { - if (Main.player[Main.myPlayer].dye[index].IsNotTheSameAs(clientPlayer.dye[index])) + Lighting.maxRenderCount = (double) Main.gfxQuality >= 0.2 ? ((double) Main.gfxQuality >= 0.4 ? ((double) Main.gfxQuality >= 0.6 ? ((double) Main.gfxQuality >= 0.8 ? 4 : 5) : 6) : 7) : 8; + if (!WorldGen.gen && Terraria.Liquid.quickSettle) { - flag1 = true; - NetMessage.SendData(5, number: Main.myPlayer, number2: ((float) (58 + Main.player[Main.myPlayer].armor.Length + 1 + index)), number3: ((float) Main.player[Main.myPlayer].dye[index].prefix)); + Terraria.Liquid.maxLiquid = Terraria.Liquid.resLiquid; + Terraria.Liquid.cycles = 1; } - } - if (Main.player[Main.myPlayer].chest != clientPlayer.chest && Main.player[Main.myPlayer].chest < 0 && clientPlayer.chest >= 0) - { - if (Main.player[Main.myPlayer].editedChestName) + Main.hasFocus = this.IsActive; + Main.hasFocus = Form.ActiveForm == Control.FromHandle(this.Window.Handle) as Form; + if (!Main.gameMenu || Main.netMode == 2) { - if (Main.chest[clientPlayer.chest] != null) - NetMessage.SendData(33, text: NetworkText.FromLiteral(Main.chest[clientPlayer.chest].name), number: Main.player[Main.myPlayer].chest, number2: 1f); + WorldFile.tempRaining = Main.raining; + WorldFile.tempRainTime = Main.rainTime; + WorldFile.tempMaxRain = Main.maxRaining; + } + if (!this.IsActive && Main.netMode == 0) + { + if (!Platform.IsOSX) + this.IsMouseVisible = true; + if (Main.netMode != 2 && Main.myPlayer >= 0) + Main.player[Main.myPlayer].delayUseItem = true; + Main.mouseLeftRelease = false; + Main.mouseRightRelease = false; + if (Main.gameMenu) + Main.UpdateMenu(); + Main.gamePaused = true; + return; + } + if (!Platform.IsOSX) + this.IsMouseVisible = false; + EmoteBubble.UpdateAll(); + ScreenObstruction.Update(); + ScreenDarkness.Update(); + MoonlordDeathDrama.Update(); + Main.DoUpdate_AnimateCursorColors(); + Main.DoUpdate_AnimateTileGlows(); + this.DoUpdate_AnimateDiscoRGB(); + Main.DoUpdate_AnimateVisualPlayerAura(); + this.DoUpdate_AnimateWaterfalls(); + Main.DoUpdate_AnimateWalls(); + Main.DoUpdate_AnimateTiles(); + Main.DoUpdate_AnimateItemIcons(); + Main.DoUpdate_F10_ToggleFPS(); + Main.DoUpdate_F9_ToggleLighting(); + Main.DoUpdate_F8_ToggleNetDiagnostics(); + Main.DoUpdate_F7_ToggleGraphicsDiagnostics(); + Main.DoUpdate_F11_ToggleUI(); + Main.DoUpdate_AltEnter_ToggleFullscreen(); + this.DoUpdate_HandleInput(); + Main.DoUpdate_HandleChat(); + Main.DoUpdate_Enter_ToggleChat(); + if (Main.gameMenu) + { + Main.UpdateMenu(); + if (Main.netMode != 2) + return; + Main.gamePaused = false; + } + Main.CheckInvasionProgressDisplay(); + } + if (Main.netMode == 2) + Main.cloudAlpha = Main.maxRaining; + if (this.IsActive && (double) Main.cloudAlpha > 0.0) + Rain.MakeRain(); + if (Main.netMode != 1) + this.updateCloudLayer(); + this.UpdateWeather(gameTime); + Main.Ambience(); + if (Main.netMode != 2) + { + if (Main.ignoreErrors) + { + try + { + Main.snowing(); + } + catch + { + } + } + else + Main.snowing(); + Sandstorm.EmitDust(); + } + if (Main.netMode == 1) + { + for (int index = 0; index < 59; ++index) + { + if (Main.player[Main.myPlayer].inventory[index].IsNotTheSameAs(Main.clientPlayer.inventory[index])) + NetMessage.SendData(5, number: Main.myPlayer, number2: ((float) index), number3: ((float) Main.player[Main.myPlayer].inventory[index].prefix)); + } + for (int index = 0; index < Main.player[Main.myPlayer].armor.Length; ++index) + { + if (Main.player[Main.myPlayer].armor[index].IsNotTheSameAs(Main.clientPlayer.armor[index])) + NetMessage.SendData(5, number: Main.myPlayer, number2: ((float) (59 + index)), number3: ((float) Main.player[Main.myPlayer].armor[index].prefix)); + } + for (int index = 0; index < Main.player[Main.myPlayer].miscEquips.Length; ++index) + { + if (Main.player[Main.myPlayer].miscEquips[index].IsNotTheSameAs(Main.clientPlayer.miscEquips[index])) + NetMessage.SendData(5, number: Main.myPlayer, number2: ((float) (58 + Main.player[Main.myPlayer].armor.Length + Main.player[Main.myPlayer].dye.Length + 1 + index)), number3: ((float) Main.player[Main.myPlayer].miscEquips[index].prefix)); + } + for (int index = 0; index < Main.player[Main.myPlayer].miscDyes.Length; ++index) + { + if (Main.player[Main.myPlayer].miscDyes[index].IsNotTheSameAs(Main.clientPlayer.miscDyes[index])) + NetMessage.SendData(5, number: Main.myPlayer, number2: ((float) (58 + Main.player[Main.myPlayer].armor.Length + Main.player[Main.myPlayer].dye.Length + Main.player[Main.myPlayer].miscEquips.Length + 1 + index)), number3: ((float) Main.player[Main.myPlayer].miscDyes[index].prefix)); + } + for (int index = 0; index < Main.player[Main.myPlayer].bank.item.Length; ++index) + { + if (Main.player[Main.myPlayer].bank.item[index].IsNotTheSameAs(Main.clientPlayer.bank.item[index])) + NetMessage.SendData(5, number: Main.myPlayer, number2: ((float) (58 + Main.player[Main.myPlayer].armor.Length + Main.player[Main.myPlayer].dye.Length + Main.player[Main.myPlayer].miscEquips.Length + Main.player[Main.myPlayer].miscDyes.Length + 1 + index)), number3: ((float) Main.player[Main.myPlayer].bank.item[index].prefix)); + } + for (int index = 0; index < Main.player[Main.myPlayer].bank2.item.Length; ++index) + { + if (Main.player[Main.myPlayer].bank2.item[index].IsNotTheSameAs(Main.clientPlayer.bank2.item[index])) + NetMessage.SendData(5, number: Main.myPlayer, number2: ((float) (58 + Main.player[Main.myPlayer].armor.Length + Main.player[Main.myPlayer].dye.Length + Main.player[Main.myPlayer].miscEquips.Length + Main.player[Main.myPlayer].miscDyes.Length + Main.player[Main.myPlayer].bank.item.Length + 1 + index)), number3: ((float) Main.player[Main.myPlayer].bank2.item[index].prefix)); + } + if (Main.player[Main.myPlayer].trashItem.IsNotTheSameAs(Main.clientPlayer.trashItem)) + NetMessage.SendData(5, number: Main.myPlayer, number2: ((float) (58 + Main.player[Main.myPlayer].armor.Length + Main.player[Main.myPlayer].dye.Length + Main.player[Main.myPlayer].miscEquips.Length + Main.player[Main.myPlayer].miscDyes.Length + Main.player[Main.myPlayer].bank.item.Length + Main.player[Main.myPlayer].bank2.item.Length + 1)), number3: ((float) Main.player[Main.myPlayer].trashItem.prefix)); + for (int index = 0; index < Main.player[Main.myPlayer].bank3.item.Length; ++index) + { + if (Main.player[Main.myPlayer].bank3.item[index].IsNotTheSameAs(Main.clientPlayer.bank3.item[index])) + NetMessage.SendData(5, number: Main.myPlayer, number2: ((float) (58 + Main.player[Main.myPlayer].armor.Length + Main.player[Main.myPlayer].dye.Length + Main.player[Main.myPlayer].miscEquips.Length + Main.player[Main.myPlayer].miscDyes.Length + Main.player[Main.myPlayer].bank.item.Length + Main.player[Main.myPlayer].bank2.item.Length + 2 + index)), number3: ((float) Main.player[Main.myPlayer].bank3.item[index].prefix)); + } + for (int index = 0; index < Main.player[Main.myPlayer].dye.Length; ++index) + { + if (Main.player[Main.myPlayer].dye[index].IsNotTheSameAs(Main.clientPlayer.dye[index])) + NetMessage.SendData(5, number: Main.myPlayer, number2: ((float) (58 + Main.player[Main.myPlayer].armor.Length + 1 + index)), number3: ((float) Main.player[Main.myPlayer].dye[index].prefix)); + } + if (Main.player[Main.myPlayer].chest != Main.clientPlayer.chest && Main.player[Main.myPlayer].chest < 0) + { + if (Main.player[Main.myPlayer].editedChestName) + { + if (Main.chest[Main.clientPlayer.chest] != null) + NetMessage.SendData(33, text: NetworkText.FromLiteral(Main.chest[Main.clientPlayer.chest].name), number: Main.player[Main.myPlayer].chest, number2: 1f); + else + NetMessage.SendData(33, number: Main.player[Main.myPlayer].chest); + Main.player[Main.myPlayer].editedChestName = false; + } else NetMessage.SendData(33, number: Main.player[Main.myPlayer].chest); - Main.player[Main.myPlayer].editedChestName = false; } - else - NetMessage.SendData(33, number: Main.player[Main.myPlayer].chest); - } - if (Main.player[Main.myPlayer].talkNPC != clientPlayer.talkNPC) - NetMessage.SendData(40, number: Main.myPlayer); - if (Main.LocalPlayer.tileEntityAnchor.interactEntityID != clientPlayer.tileEntityAnchor.interactEntityID && Main.LocalPlayer.tileEntityAnchor.interactEntityID < 0) - NetMessage.SendData(122, number: -1, number2: ((float) Main.myPlayer)); - bool flag2 = false; - if ((int) (byte) Main.player[Main.myPlayer].zone1 != (int) (byte) clientPlayer.zone1) - flag2 = true; - if ((int) (byte) Main.player[Main.myPlayer].zone2 != (int) (byte) clientPlayer.zone2) - flag2 = true; - if ((int) (byte) Main.player[Main.myPlayer].zone3 != (int) (byte) clientPlayer.zone3) - flag2 = true; - if ((int) (byte) Main.player[Main.myPlayer].zone4 != (int) (byte) clientPlayer.zone4) - flag2 = true; - if (flag2) - NetMessage.SendData(36, number: Main.myPlayer); - if (Main.player[Main.myPlayer].statLife != clientPlayer.statLife || Main.player[Main.myPlayer].statLifeMax != clientPlayer.statLifeMax) - Main.player[Main.myPlayer].netLife = true; - if (Main.player[Main.myPlayer].netLifeTime > 0) - --Main.player[Main.myPlayer].netLifeTime; - else if (Main.player[Main.myPlayer].netLife) - { - Main.player[Main.myPlayer].netLife = false; - Main.player[Main.myPlayer].netLifeTime = 60; - NetMessage.SendData(16, number: Main.myPlayer); - } - if (Main.player[Main.myPlayer].statMana != clientPlayer.statMana || Main.player[Main.myPlayer].statManaMax != clientPlayer.statManaMax) - Main.player[Main.myPlayer].netMana = true; - if (Main.player[Main.myPlayer].netManaTime > 0) - --Main.player[Main.myPlayer].netManaTime; - else if (Main.player[Main.myPlayer].netMana) - { - Main.player[Main.myPlayer].netMana = false; - Main.player[Main.myPlayer].netManaTime = 60; - NetMessage.SendData(42, number: Main.myPlayer); - } - bool flag3 = false; - for (int index = 0; index < 22; ++index) - { - if (Main.player[Main.myPlayer].buffType[index] != clientPlayer.buffType[index]) + if (Main.player[Main.myPlayer].talkNPC != Main.clientPlayer.talkNPC) + NetMessage.SendData(40, number: Main.myPlayer); + bool flag1 = false; + if ((int) (byte) Main.player[Main.myPlayer].zone1 != (int) (byte) Main.clientPlayer.zone1) + flag1 = true; + if ((int) (byte) Main.player[Main.myPlayer].zone2 != (int) (byte) Main.clientPlayer.zone2) + flag1 = true; + if ((int) (byte) Main.player[Main.myPlayer].zone3 != (int) (byte) Main.clientPlayer.zone3) + flag1 = true; + if ((int) (byte) Main.player[Main.myPlayer].zone4 != (int) (byte) Main.clientPlayer.zone4) + flag1 = true; + if (flag1) + NetMessage.SendData(36, number: Main.myPlayer); + if (Main.player[Main.myPlayer].statLife != Main.clientPlayer.statLife || Main.player[Main.myPlayer].statLifeMax != Main.clientPlayer.statLifeMax) + Main.player[Main.myPlayer].netLife = true; + if (Main.player[Main.myPlayer].netLifeTime > 0) + --Main.player[Main.myPlayer].netLifeTime; + else if (Main.player[Main.myPlayer].netLife) + { + Main.player[Main.myPlayer].netLife = false; + Main.player[Main.myPlayer].netLifeTime = 60; + NetMessage.SendData(16, number: Main.myPlayer); + } + if (Main.player[Main.myPlayer].statMana != Main.clientPlayer.statMana || Main.player[Main.myPlayer].statManaMax != Main.clientPlayer.statManaMax) + Main.player[Main.myPlayer].netMana = true; + if (Main.player[Main.myPlayer].netManaTime > 0) + --Main.player[Main.myPlayer].netManaTime; + else if (Main.player[Main.myPlayer].netMana) + { + Main.player[Main.myPlayer].netMana = false; + Main.player[Main.myPlayer].netManaTime = 60; + NetMessage.SendData(42, number: Main.myPlayer); + } + bool flag2 = false; + for (int index = 0; index < 22; ++index) + { + if (Main.player[Main.myPlayer].buffType[index] != Main.clientPlayer.buffType[index]) + flag2 = true; + } + if (flag2) + { + NetMessage.SendData(50, number: Main.myPlayer); + NetMessage.SendData(13, number: Main.myPlayer); + } + bool flag3 = false; + if (Main.player[Main.myPlayer].MinionRestTargetPoint != Main.clientPlayer.MinionRestTargetPoint) flag3 = true; + if (flag3) + NetMessage.SendData(99, number: Main.myPlayer); + bool flag4 = false; + if (Main.player[Main.myPlayer].MinionAttackTargetNPC != Main.clientPlayer.MinionAttackTargetNPC) + flag4 = true; + if (flag4) + NetMessage.SendData(115, number: Main.myPlayer); } - if (flag3) + if (Main.netMode == 1) + Main.clientPlayer = (Player) Main.player[Main.myPlayer].clientClone(); + if (Main.netMode == 0 && (Main.playerInventory || Main.npcChatText != "" || Main.player[Main.myPlayer].sign >= 0 || Main.ingameOptionsWindow || Main.inFancyUI) && Main.autoPause) { - NetMessage.SendData(50, number: Main.myPlayer); - NetMessage.SendData(13, number: Main.myPlayer); - } - bool flag4 = false; - if (Main.player[Main.myPlayer].MinionRestTargetPoint != clientPlayer.MinionRestTargetPoint) - flag4 = true; - if (flag4) - NetMessage.SendData(99, number: Main.myPlayer); - bool flag5 = false; - if (Main.player[Main.myPlayer].MinionAttackTargetNPC != clientPlayer.MinionAttackTargetNPC) - flag5 = true; - if (flag5) - NetMessage.SendData(115, number: Main.myPlayer); - if (clientPlayer.shieldRaised != Main.player[Main.myPlayer].shieldRaised) - NetMessage.SendData(13, number: Main.myPlayer); - if (flag1) - NetMessage.SendData(138); - Main.clientPlayer = (Player) Main.player[Main.myPlayer].clientClone(); - } - - public bool ShouldUpdateEntities() => Main._worldPreparationState == Main.WorldPreparationState.Ready; - - private void DoUpdateInWorld(Stopwatch sw) - { - this.UpdateParticleSystems(); - Main.tileSolid[379] = false; - int num1 = 0; - int num2 = 0; - Main.sittingManager.ClearPlayerAnchors(); - Main.sleepingManager.ClearPlayerAnchors(); - for (int i = 0; i < (int) byte.MaxValue; ++i) - { - try + if (!Main.drawingPlayerChat && !Main.editSign && !Main.editChest && !Main.blockInput) { - Main.player[i].Update(i); - if (Main.player[i].active) + Main.player[Main.myPlayer].controlInv = PlayerInput.Triggers.Current.Inventory; + if (Main.player[Main.myPlayer].controlInv) { - ++num1; - if (Main.player[i].sleeping.FullyFallenAsleep) - ++num2; + if (Main.player[Main.myPlayer].releaseInventory) + Main.player[Main.myPlayer].ToggleInv(); + Main.player[Main.myPlayer].releaseInventory = false; } + else + Main.player[Main.myPlayer].releaseInventory = true; } - catch + if (Main.playerInventory) { - if (!Main.ignoreErrors) - throw; - } - } - Main.CurrentFrameFlags.ActivePlayersCount = num1; - Main.CurrentFrameFlags.SleepingPlayersCount = num2; - if (Main.netMode != 2) - { - int player = Main.myPlayer; - if (Main.player[player].creativeGodMode) - { - Main.player[player].statLife = Main.player[player].statLifeMax2; - Main.player[player].statMana = Main.player[player].statManaMax2; - Main.player[player].breath = Main.player[player].breathMax; - } - } - ++Main._gameUpdateCount; - NPC.RevengeManager.Update(); - if (Main.netMode != 1) - { - try - { - NPC.SpawnNPC(); - } - catch - { - } - } - if (Main.netMode != 1) - PressurePlateHelper.Update(); - for (int index = 0; index < (int) byte.MaxValue; ++index) - { - Main.player[index].nearbyActiveNPCs = 0.0f; - Main.player[index].townNPCs = 0.0f; - } - Main.CheckBossIndexes(); - Main.sittingManager.ClearNPCAnchors(); - Main.sleepingManager.ClearNPCAnchors(); - NPC.taxCollector = false; - NPC.ClearFoundActiveNPCs(); - NPC.UpdateFoundActiveNPCs(); - FixExploitManEaters.Update(); - if (Main.netMode != 1) - Main.BestiaryTracker.Sights.ScanWorldForFinds(); - bool flag = false; - if (NPC.offSetDelayTime > 0) - --NPC.offSetDelayTime; - for (int i = 0; i < 200; ++i) - { - if (Main.ignoreErrors) - { - try + int num1 = PlayerInput.ScrollWheelDelta / 120; + bool flag = true; + if (Main.recBigList) { - Main.npc[i].UpdateNPC(i); - if (Main.npc[i].active) + int num2 = 42; + int y = 340; + int x = 310; + PlayerInput.SetZoom_UI(); + int num3 = (Main.screenWidth - x - 280) / num2; + int num4 = (Main.screenHeight - y - 20) / num2; + if (new Microsoft.Xna.Framework.Rectangle(x, y, num3 * num2, num4 * num2).Contains(Main.MouseScreen.ToPoint())) { - if (!Main.npc[i].boss) + int num5 = Math.Sign(num1); + for (; num1 != 0; num1 -= num5) { - if (!NPCID.Sets.DangerThatPreventsOtherDangers[Main.npc[i].type]) - continue; + if (num1 < 0) + { + Main.recStart -= num3; + if (Main.recStart < 0) + Main.recStart = 0; + } + else + { + Main.recStart += num3; + Main.PlaySound(12); + if (Main.recStart > Main.numAvailableRecipes - num3) + Main.recStart = Main.numAvailableRecipes - num3; + } } - flag = true; + } + PlayerInput.SetZoom_World(); + } + if (flag) + { + Main.focusRecipe += num1; + if (Main.focusRecipe > Main.numAvailableRecipes - 1) + Main.focusRecipe = Main.numAvailableRecipes - 1; + if (Main.focusRecipe < 0) + Main.focusRecipe = 0; + } + Main.player[Main.myPlayer].dropItemCheck(); + } + Main.player[Main.myPlayer].head = Main.player[Main.myPlayer].armor[0].headSlot; + Main.player[Main.myPlayer].body = Main.player[Main.myPlayer].armor[1].bodySlot; + Main.player[Main.myPlayer].legs = Main.player[Main.myPlayer].armor[2].legSlot; + if (!Main.player[Main.myPlayer].hostile) + { + if (Main.player[Main.myPlayer].armor[10].headSlot >= 0) + Main.player[Main.myPlayer].head = Main.player[Main.myPlayer].armor[10].headSlot; + if (Main.player[Main.myPlayer].armor[11].bodySlot >= 0) + Main.player[Main.myPlayer].body = Main.player[Main.myPlayer].armor[11].bodySlot; + if (Main.player[Main.myPlayer].armor[12].legSlot >= 0) + Main.player[Main.myPlayer].legs = Main.player[Main.myPlayer].armor[12].legSlot; + } + if (Main.editSign) + { + if (Main.player[Main.myPlayer].sign == -1) + Main.editSign = false; + else + Main.InputTextSign(); + } + else if (Main.editChest && Main.player[Main.myPlayer].chest == -1) + Main.editChest = false; + Main.player[Main.myPlayer].lastChest = Main.player[Main.myPlayer].chest; + if (Main.playerInventory) + Main.player[Main.myPlayer].AdjTiles(); + Main.gamePaused = true; + } + else + { + Main.gamePaused = false; + if (!Main.dedServ && (double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0 && Main.netMode != 2) + { + Star.UpdateStars(); + Cloud.UpdateClouds(); + } + PortalHelper.UpdatePortalPoints(); + Main.tileSolid[379] = false; + Main.ActivePlayersCount = 0; + for (int i = 0; i < (int) byte.MaxValue; ++i) + { + if (Main.ignoreErrors) + { + try + { + Main.player[i].Update(i); + } + catch + { } } - catch (Exception ex) - { - Main.npc[i] = new NPC(); - } + else + Main.player[i].Update(i); } - else - Main.npc[i].UpdateNPC(i); - } - Main.CurrentFrameFlags.AnyActiveBossNPC = flag; - for (int index = 0; index < 600; ++index) - { - if (Main.ignoreErrors) + ++Main._gameUpdateCount; + if (Main.netMode != 1) { try { + NPC.SpawnNPC(); + } + catch + { + } + } + if (Main.netMode != 1) + PressurePlateHelper.Update(); + for (int index = 0; index < (int) byte.MaxValue; ++index) + { + Main.player[index].activeNPCs = 0.0f; + Main.player[index].townNPCs = 0.0f; + } + if (Main.wof >= 0 && !Main.npc[Main.wof].active) + Main.wof = -1; + if (NPC.golemBoss >= 0 && !Main.npc[NPC.golemBoss].active) + NPC.golemBoss = -1; + if (NPC.plantBoss >= 0 && !Main.npc[NPC.plantBoss].active) + NPC.plantBoss = -1; + if (NPC.crimsonBoss >= 0 && !Main.npc[NPC.crimsonBoss].active) + NPC.crimsonBoss = -1; + NPC.taxCollector = false; + NPC.ClearFoundActiveNPCs(); + NPC.UpdateFoundActiveNPCs(); + FixExploitManEaters.Update(); + for (int i = 0; i < 200; ++i) + { + if (Main.ignoreErrors) + { + try + { + Main.npc[i].UpdateNPC(i); + } + catch (Exception ex) + { + Main.npc[i] = new NPC(); + } + } + else + Main.npc[i].UpdateNPC(i); + } + for (int index = 0; index < 500; ++index) + { + if (Main.ignoreErrors) + { + try + { + Main.gore[index].Update(); + } + catch + { + Main.gore[index] = new Gore(); + } + } + else Main.gore[index].Update(); - } - catch - { - Main.gore[index] = new Gore(); - } } - else - Main.gore[index].Update(); - } - LockOnHelper.SetUP(); - Main.CurrentFrameFlags.HadAnActiveInteractibleProjectile = false; - this.PreUpdateAllProjectiles(); - for (int i = 0; i < 1000; ++i) - { - Main.ProjectileUpdateLoopIndex = i; - if (Main.ignoreErrors) + LockOnHelper.SetUP(); + for (int i = 0; i < 1000; ++i) { - try + Main.ProjectileUpdateLoopIndex = i; + if (Main.ignoreErrors) { + try + { + Main.projectile[i].Update(i); + } + catch + { + Main.projectile[i] = new Projectile(); + } + } + else Main.projectile[i].Update(i); - } - catch - { - Main.projectile[i] = new Projectile(); - } } - else - Main.projectile[i].Update(i); - } - Main.ProjectileUpdateLoopIndex = -1; - this.PostUpdateAllProjectiles(); - LockOnHelper.SetDOWN(); - Item.numberOfNewItems = 0; - for (int i = 0; i < 400; ++i) - { - if (Main.ignoreErrors) + Main.ProjectileUpdateLoopIndex = -1; + LockOnHelper.SetDOWN(); + for (int i = 0; i < 400; ++i) { - try + if (Main.ignoreErrors) { + try + { + Main.item[i].UpdateItem(i); + } + catch + { + Main.item[i] = new Item(); + } + } + else Main.item[i].UpdateItem(i); - } - catch - { - Main.item[i] = new Item(); - } } - else - Main.item[i].UpdateItem(i); - } - if (Main.ignoreErrors) - { - try - { - Dust.UpdateDust(); - } - catch - { - for (int index = 0; index < 6000; ++index) - { - Main.dust[index] = new Dust(); - Main.dust[index].dustIndex = index; - } - } - } - else - Dust.UpdateDust(); - if (Main.netMode != 2) - { - CombatText.UpdateCombatText(); - PopupText.UpdateItemText(); - } - if (Main.ignoreErrors) - { - try - { - Main.UpdateTime(); - } - catch - { - Main.checkForSpawns = 0; - } - } - else - Main.UpdateTime(); - Main.tileSolid[379] = true; - if (Main.gameMenu && Main.netMode != 2) - return; - if (Main.netMode != 1) - { if (Main.ignoreErrors) { try + { + Dust.UpdateDust(); + } + catch + { + for (int index = 0; index < 6000; ++index) + { + Main.dust[index] = new Dust(); + Main.dust[index].dustIndex = index; + } + } + } + else + Dust.UpdateDust(); + if (Main.netMode != 2) + { + CombatText.UpdateCombatText(); + ItemText.UpdateItemText(); + } + if (Main.ignoreErrors) + { + try + { + Main.UpdateTime(); + } + catch + { + Main.checkForSpawns = 0; + } + } + else + Main.UpdateTime(); + Main.tileSolid[379] = true; + if (Main.netMode != 1) + { + if (Main.ignoreErrors) + { + try + { + WorldGen.UpdateWorld(); + Main.UpdateInvasion(); + } + catch + { + } + } + else { WorldGen.UpdateWorld(); Main.UpdateInvasion(); } + } + if (Main.ignoreErrors) + { + try + { + if (Main.netMode == 2) + Main.UpdateServer(); + if (Main.netMode == 1) + Main.UpdateClient(); + } catch { + int netMode = Main.netMode; } } else - { - WorldGen.UpdateWorld(); - Main.UpdateInvasion(); - } - } - if (Main.ignoreErrors) - { - try { if (Main.netMode == 2) Main.UpdateServer(); if (Main.netMode == 1) Main.UpdateClient(); } - catch + if (Main.ignoreErrors) { - int netMode = Main.netMode; + try + { + for (int index = 0; index < Main.numChatLines; ++index) + { + if (Main.chatLine[index].showTime > 0) + --Main.chatLine[index].showTime; + } + } + catch + { + for (int index = 0; index < Main.numChatLines; ++index) + Main.chatLine[index] = new ChatLine(); + } } + else + { + for (int index = 0; index < Main.numChatLines; ++index) + { + if (Main.chatLine[index].showTime > 0) + --Main.chatLine[index].showTime; + } + } + timeSpan = stopwatch.Elapsed; + Main.upTimer = (float) timeSpan.TotalMilliseconds; + if ((double) Main.upTimerMaxDelay > 0.0) + --Main.upTimerMaxDelay; + else + Main.upTimerMax = 0.0f; + if ((double) Main.upTimer > (double) Main.upTimerMax) + { + Main.upTimerMax = Main.upTimer; + Main.upTimerMaxDelay = 400f; + } + Chest.UpdateChestFrames(); + if ((double) Main.cameraLerp > 0.0) + { + ++Main.cameraLerpTimer; + if (Main.cameraLerpTimer >= Main.cameraLerpTimeToggle) + Main.cameraLerp += (float) ((Main.cameraLerpTimer - Main.cameraLerpTimeToggle) / 3 + 1) * (1f / 1000f); + if ((double) Main.cameraLerp > 1.0) + Main.cameraLerp = 1f; + } + base.Update(gameTime); } - else - { - if (Main.netMode == 2) - Main.UpdateServer(); - if (Main.netMode == 1) - Main.UpdateClient(); - } - Main.chatMonitor.Update(); - Main.upTimer = (float) sw.Elapsed.TotalMilliseconds; - if ((double) Main.upTimerMaxDelay > 0.0) - --Main.upTimerMaxDelay; - else - Main.upTimerMax = 0.0f; - if ((double) Main.upTimer > (double) Main.upTimerMax) - { - Main.upTimerMax = Main.upTimer; - Main.upTimerMaxDelay = 400f; - } - Chest.UpdateChestFrames(); - this._ambientWindSys.Update(); - this.TilesRenderer.Update(); - if ((double) Main.cameraLerp <= 0.0) - return; - ++Main.cameraLerpTimer; - if (Main.cameraLerpTimer >= Main.cameraLerpTimeToggle) - Main.cameraLerp += (float) ((Main.cameraLerpTimer - Main.cameraLerpTimeToggle) / 3 + 1) * (1f / 1000f); - if ((double) Main.cameraLerp <= 1.0) - return; - Main.cameraLerp = 1f; - } - - private static void CheckBossIndexes() - { - if (!Main.IsNPCActiveAndOneOfTypes(Main.wofNPCIndex, 113)) - Main.wofNPCIndex = -1; - if (!Main.IsNPCActiveAndOneOfTypes(NPC.golemBoss, 245)) - NPC.golemBoss = -1; - if (!Main.IsNPCActiveAndOneOfTypes(NPC.plantBoss, 262)) - NPC.plantBoss = -1; - if (Main.IsNPCActiveAndOneOfTypes(NPC.crimsonBoss, 266)) - return; - NPC.crimsonBoss = -1; - } - - private static bool IsNPCActiveAndOneOfTypes(int npcIndex, params int[] types) - { - if (npcIndex < 0) - return false; - NPC npc = Main.npc[npcIndex]; - if (!npc.active) - return false; - for (int index = 0; index < types.Length; ++index) - { - if (npc.type == types[index]) - return true; - } - return false; - } - - private static void UpdateOldNPCShop() - { - if (Main.npcShop == Main.oldNPCShop) - return; - Main.oldNPCShop = Main.npcShop; - Main.shopSellbackHelper.Clear(); } private static void DoUpdate_AnimateCursorColors() { Main.CursorColor(); Main.mouseTextColor += (byte) Main.mouseTextColorChange; - if (Main.mouseTextColor >= byte.MaxValue) - Main.mouseTextColorChange = -1; - if (Main.mouseTextColor <= (byte) 190) - Main.mouseTextColorChange = 1; - Main.masterColor += (float) Main.masterColorDir * 0.05f; - if ((double) Main.masterColor > 1.0) - { - Main.masterColor = 1f; - Main.masterColorDir = -1; - } - if ((double) Main.masterColor >= 0.0) + if (Main.mouseTextColor >= (byte) 250) + Main.mouseTextColorChange = -4; + if (Main.mouseTextColor > (byte) 175) return; - Main.masterColor = 0.0f; - Main.masterColorDir = 1; + Main.mouseTextColorChange = 4; } private static void DoUpdate_AnimateTileGlows() @@ -12747,12 +11160,13 @@ label_56: private static void DoUpdate_Enter_ToggleChat() { - if (((!Main.keyState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Enter) ? 0 : (Main.keyState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.LeftAlt) ? 0 : (!Main.keyState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.RightAlt) ? 1 : 0))) == 0 ? 0 : (Main.hasFocus ? 1 : 0)) != 0) + if (Main.keyState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Enter) && Main.netMode == 1 && !Main.keyState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.LeftAlt) && !Main.keyState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.RightAlt) && Main.hasFocus) { if (Main.chatRelease && !Main.drawingPlayerChat && !Main.editSign && !Main.editChest && !Main.gameMenu && !Main.keyState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Escape)) { - SoundEngine.PlaySound(10); - Main.OpenPlayerChat(); + Main.PlaySound(10); + Main.drawingPlayerChat = true; + Main.clrInput(); Main.chatText = ""; } Main.chatRelease = false; @@ -12761,81 +11175,68 @@ label_56: Main.chatRelease = true; } - public static void OpenPlayerChat() - { - if (Main.CurrentInputTextTakerOverride != null) - return; - Main.drawingPlayerChat = true; - Main.clrInput(); - } - - public static void ClosePlayerChat() - { - Main.drawingPlayerChat = false; - PlayerInput.WritingText = true; - Main.player[Main.myPlayer].releaseHook = false; - Main.player[Main.myPlayer].releaseThrow = false; - } - private static void DoUpdate_HandleChat() { - if (Main.CurrentInputTextTakerOverride != null) - { + if (Main.editSign) Main.drawingPlayerChat = false; + if (!Main.drawingPlayerChat) + { + Main.startChatLine = 0; } else { - if (Main.editSign) - Main.drawingPlayerChat = false; - if (PlayerInput.UsingGamepad) - Main.drawingPlayerChat = false; - if (!Main.drawingPlayerChat) + Main.showCount = (int) ((double) (Main.screenHeight / 3) / (double) Main.fontMouseText.MeasureString("1").Y) - 1; + if (Main.keyState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Up)) { - Main.chatMonitor.ResetOffset(); + ++Main.startChatLine; + if (Main.startChatLine + Main.showCount >= Main.numChatLines - 1) + Main.startChatLine = Main.numChatLines - Main.showCount - 1; + if (Main.chatLine[Main.startChatLine + Main.showCount].text == "") + --Main.startChatLine; } - else + else if (Main.keyState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Down)) { - int linesOffset = 0; - if (Main.keyState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Up)) - linesOffset = 1; - else if (Main.keyState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Down)) - linesOffset = -1; - Main.chatMonitor.Offset(linesOffset); - if (Main.keyState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Escape)) - Main.drawingPlayerChat = false; - string chatText = Main.chatText; - Main.chatText = Main.GetInputText(Main.chatText); - int num1 = (int) ((double) Main.screenWidth * (1.0 / (double) Main.UIScale)) - 330; - if (chatText != Main.chatText) - { - for (float x = ChatManager.GetStringSize(FontAssets.MouseText.Value, Main.chatText, Vector2.One).X; (double) x > (double) num1; x = ChatManager.GetStringSize(FontAssets.MouseText.Value, Main.chatText, Vector2.One).X) - { - int num2 = Math.Max(0, (int) ((double) x - (double) num1) / 100); - Main.chatText = Main.chatText.Substring(0, Main.chatText.Length - 1 - num2); - } - } - if (chatText != Main.chatText) - SoundEngine.PlaySound(12); - if (!Main.inputTextEnter || !Main.chatRelease) - return; - if (Main.chatText != "") - { - ChatMessage outgoingMessage = ChatManager.Commands.CreateOutgoingMessage(Main.chatText); - switch (Main.netMode) - { - case 0: - ChatManager.Commands.ProcessIncomingMessage(outgoingMessage, Main.myPlayer); - break; - case 1: - ChatHelper.SendChatMessageFromClient(outgoingMessage); - break; - } - } - Main.chatText = ""; - Main.ClosePlayerChat(); - Main.chatRelease = false; - SoundEngine.PlaySound(11); + --Main.startChatLine; + if (Main.startChatLine < 0) + Main.startChatLine = 0; } + if (Main.keyState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Escape)) + Main.drawingPlayerChat = false; + string chatText1 = Main.chatText; + Main.chatText = Main.GetInputText(Main.chatText); + int num = (int) ((double) Main.screenWidth * (1.0 / (double) Main.UIScale)) - 330; + if (chatText1 != Main.chatText) + { + while ((double) ChatManager.GetStringSize(Main.fontMouseText, Main.chatText, Vector2.One).X > (double) num) + Main.chatText = Main.chatText.Substring(0, Main.chatText.Length - 1); + } + if (chatText1 != Main.chatText) + Main.PlaySound(12); + if (!Main.inputTextEnter || !Main.chatRelease) + return; + if (Main.chatText != "") + { + ChatMessage chatMessage = new ChatMessage(Main.chatText); + ChatManager.Commands.ProcessOutgoingMessage(chatMessage); + NetMessage.SendChatMessageFromClient(chatMessage); + if (Main.netMode == 0) + { + Microsoft.Xna.Framework.Color color = Main.player[Main.myPlayer].ChatColor(); + string chatText2 = Main.chatText; + string text = NameTagHandler.GenerateTag(Main.player[Main.myPlayer].name) + " " + Main.chatText; + Main.player[Main.myPlayer].chatOverhead.NewMessage(Main.chatText, Main.chatLength / 2); + Microsoft.Xna.Framework.Color c = color; + int maxLengthForScreen = Main.TextMaxLengthForScreen; + Main.NewTextMultiline(text, c: c, WidthLimit: maxLengthForScreen); + } + } + Main.chatText = ""; + Main.drawingPlayerChat = false; + Main.chatRelease = false; + PlayerInput.WritingText = true; + Main.player[Main.myPlayer].releaseHook = false; + Main.player[Main.myPlayer].releaseThrow = false; + Main.PlaySound(11); } } @@ -12871,10 +11272,7 @@ label_56: if (Main.keyState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.F11)) { if (Main.releaseUI) - { Main.hideUI = !Main.hideUI; - SoundEngine.PlaySound(12); - } Main.releaseUI = false; } else @@ -12887,7 +11285,7 @@ label_56: { if (Main.drawRelease) { - SoundEngine.PlaySound(12); + Main.PlaySound(12); if (Main.keyState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.LeftAlt) || Main.keyState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.RightAlt)) TimeLogger.Start(); else @@ -12905,8 +11303,8 @@ label_56: { if (Main.netRelease) { - SoundEngine.PlaySound(12); - Main.shouldDrawNetDiagnosticsUI = !Main.shouldDrawNetDiagnosticsUI; + Main.PlaySound(12); + Main.netDiag = !Main.netDiag; } Main.netRelease = false; } @@ -12916,11 +11314,11 @@ label_56: private static void DoUpdate_F9_ToggleLighting() { - if (Main.keyState.PressingShift() && Main.keyState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.F9) && !Main.drawingPlayerChat && !Main.editSign && !Main.editChest) + if (Main.keyState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.F9) && !Main.drawingPlayerChat && !Main.editSign && !Main.editChest) { if (Main.RGBRelease) { - SoundEngine.PlaySound(12); + Main.PlaySound(12); Lighting.NextLightMode(); } Main.RGBRelease = false; @@ -12935,7 +11333,7 @@ label_56: { if (Main.frameRelease) { - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.showFrameRate = !Main.showFrameRate; } Main.frameRelease = false; @@ -12944,7 +11342,7 @@ label_56: Main.frameRelease = true; } - private static void AnimateTiles() + private static void DoUpdate_AnimateTiles() { ++Main.tileFrameCounter[12]; if (Main.tileFrameCounter[12] > 5) @@ -13008,14 +11406,6 @@ label_56: if (Main.tileFrame[215] >= 8) Main.tileFrame[215] = 0; } - ++Main.tileFrameCounter[592]; - if (Main.tileFrameCounter[592] >= 5) - { - Main.tileFrameCounter[592] = 0; - ++Main.tileFrame[592]; - if (Main.tileFrame[592] >= 8) - Main.tileFrame[592] = 0; - } ++Main.tileFrameCounter[217]; if (Main.tileFrameCounter[217] > 4) { @@ -13122,7 +11512,6 @@ label_56: Main.tileFrame[270] = 0; } Main.tileFrame[271] = Main.tileFrame[270]; - Main.tileFrame[581] = Main.tileFrame[270]; ++Main.tileFrameCounter[272]; if (Main.tileFrameCounter[272] >= 10) { @@ -13267,11 +11656,6 @@ label_56: if (Main.tileFrame[329] > 7) Main.tileFrame[329] = 0; } - int num1 = 20; - if (++Main.tileFrameCounter[507] >= num1 * 8) - Main.tileFrameCounter[507] = 0; - if (++Main.tileFrameCounter[508] >= num1 * 8) - Main.tileFrameCounter[508] = 0; for (int index = 340; index <= 344; ++index) { ++Main.tileFrameCounter[index]; @@ -13352,17 +11736,11 @@ label_56: if (++Main.tileFrame[455] >= 6) Main.tileFrame[455] = 0; } - if (++Main.tileFrameCounter[499] >= 5) + if (++Main.tileFrameCounter[454] >= 10 && (Main.tileFrame[454] != 0 || Main.tileFrameCounter[454] >= 90)) { - Main.tileFrameCounter[499] = 0; - if (++Main.tileFrame[499] >= 8) - Main.tileFrame[499] = 0; - } - if (++Main.tileFrameCounter[129] >= 8) - { - Main.tileFrameCounter[129] = 0; - if (++Main.tileFrame[129] >= 6) - Main.tileFrame[129] = 0; + Main.tileFrameCounter[454] = 0; + if (--Main.tileFrame[454] < 0) + Main.tileFrame[454] = 4; } Main.tileFrameCounter[453] += WorldGen.gen ? 0 : Main.rand.Next(3); if (++Main.tileFrameCounter[453] >= 60) @@ -13380,18 +11758,6 @@ label_56: if (++Main.tileFrame[410] >= 8) Main.tileFrame[410] = 0; } - if (++Main.tileFrameCounter[480] >= 8) - { - Main.tileFrameCounter[480] = 0; - if (++Main.tileFrame[480] >= 8) - Main.tileFrame[480] = 0; - } - if (++Main.tileFrameCounter[509] >= 8) - { - Main.tileFrameCounter[509] = 0; - if (++Main.tileFrame[509] >= 8) - Main.tileFrame[509] = 0; - } if (++Main.tileFrameCounter[421] >= 4) { Main.tileFrameCounter[421] = 0; @@ -13416,89 +11782,7 @@ label_56: if (++Main.tileFrame[464] >= 23) Main.tileFrame[464] = 0; } - if (++Main.tileFrameCounter[485] >= 20) - Main.tileFrameCounter[485] = 0; - if (++Main.tileFrameCounter[491] >= 40) - Main.tileFrameCounter[491] = 0; - if (++Main.tileFrameCounter[564] >= 5) - { - Main.tileFrameCounter[564] = 0; - ++Main.tileFrame[564]; - if (Main.tileFrame[564] >= 36) - Main.tileFrame[564] = 0; - } - if (++Main.tileFrameCounter[593] >= 5) - { - Main.tileFrameCounter[593] = 0; - ++Main.tileFrame[593]; - if (Main.tileFrame[593] >= 9) - Main.tileFrame[593] = 5; - } - if (++Main.tileFrameCounter[594] >= 5) - { - Main.tileFrameCounter[594] = 0; - ++Main.tileFrame[594]; - if (Main.tileFrame[594] >= 9) - Main.tileFrame[594] = 5; - } - if (++Main.tileFrameCounter[614] >= 5) - { - Main.tileFrameCounter[614] = 0; - ++Main.tileFrame[614]; - if (Main.tileFrame[614] >= 6) - Main.tileFrame[614] = 0; - } - if (++Main.tileFrameCounter[565] >= 4) - { - Main.tileFrameCounter[565] = 0; - ++Main.tileFrame[565]; - if (Main.tileFrame[565] >= 5) - Main.tileFrame[565] = 0; - } - if (++Main.tileFrameCounter[572] >= 8) - { - Main.tileFrameCounter[572] = 0; - if (++Main.tileFrame[572] >= 6) - Main.tileFrame[572] = 0; - } - if (++Main.tileFrameCounter[597] >= 64) - Main.tileFrameCounter[597] = 0; - int num2 = (int) MathHelper.Clamp((float) Math.Floor((double) Math.Abs(Main.WindForVisuals) * 10.0) * (float) Math.Sign(Main.WindForVisuals), -5f, 5f); - Main.tileFrameCounter[489] += num2; - Main.tileFrameCounter[489] %= 320; - if (Main.tileFrameCounter[489] < 0) - Main.tileFrameCounter[489] += 320; - Main.AnimateTiles_WeatherVane(); - int num3 = (int) MathHelper.Clamp((float) Math.Floor((double) Math.Abs(Main.WindForVisuals) * 10.0) * (float) Math.Sign(Main.WindForVisuals), -5f, 5f); - Main.tileFrameCounter[493] += num3; - Main.tileFrameCounter[493] %= 120; - if (Main.tileFrameCounter[493] < 0) - Main.tileFrameCounter[493] += 120; - Main.AnimateTiles_CritterCages(); - } - - private static void AnimateTiles_WeatherVane() - { - int num1 = Math.Sign(Main.WindForVisuals); - int num2 = (int) MathHelper.Clamp((float) Math.Floor((double) Math.Abs(Main.WindForVisuals) * 10.0), -5f, 5f); - int num3 = 6; - Main.tileFrameCounter[490] += num2; - if (Main.tileFrameCounter[490] < num3) - return; - Main.tileFrameCounter[490] -= num3 * Main.tileFrameCounter[490]; - if ((Main.tileFrame[490] != 0 || num1 != -1 ? (Main.tileFrame[490] != 6 ? 0 : (num1 == 1 ? 1 : 0)) : 1) == 0) - { - if (++Main.tileFrame[490] < 12) - return; - Main.tileFrame[490] = 0; - Main.weatherVaneBobframe = 0; - } - else - { - if ((double) Main.rand.NextFloat() >= (double) Math.Abs(Main.WindForVisuals) * 0.5 || ++Main.weatherVaneBobframe != 8) - return; - Main.weatherVaneBobframe = 0; - } + Main.CritterCages(); } private static void DoUpdate_AnimateWalls() @@ -13570,52 +11854,47 @@ label_56: if (Main.wallFrame[169] > (byte) 7) Main.wallFrame[169] = (byte) 0; } - int num1 = 20; - if ((int) ++Main.wallFrameCounter[242] >= num1 * 8) - Main.wallFrameCounter[242] = (byte) 0; - if ((int) ++Main.wallFrameCounter[243] >= num1 * 8) - Main.wallFrameCounter[243] = (byte) 0; ++Main.wallFrameCounter[144]; - int num2 = 5; - int num3 = 10; - if ((int) Main.wallFrameCounter[144] < num2) + int num1 = 5; + int num2 = 10; + if ((int) Main.wallFrameCounter[144] < num1) Main.wallFrame[144] = (byte) 0; - else if ((int) Main.wallFrameCounter[144] < num2) + else if ((int) Main.wallFrameCounter[144] < num1) Main.wallFrame[144] = (byte) 1; - else if ((int) Main.wallFrameCounter[144] < num2 * 2) + else if ((int) Main.wallFrameCounter[144] < num1 * 2) Main.wallFrame[144] = (byte) 2; - else if ((int) Main.wallFrameCounter[144] < num2 * 3) + else if ((int) Main.wallFrameCounter[144] < num1 * 3) Main.wallFrame[144] = (byte) 3; - else if ((int) Main.wallFrameCounter[144] < num2 * 4) + else if ((int) Main.wallFrameCounter[144] < num1 * 4) Main.wallFrame[144] = (byte) 4; - else if ((int) Main.wallFrameCounter[144] < num2 * 5) + else if ((int) Main.wallFrameCounter[144] < num1 * 5) Main.wallFrame[144] = (byte) 5; - else if ((int) Main.wallFrameCounter[144] < num2 * 6) + else if ((int) Main.wallFrameCounter[144] < num1 * 6) Main.wallFrame[144] = (byte) 6; - else if ((int) Main.wallFrameCounter[144] < num2 * 7) + else if ((int) Main.wallFrameCounter[144] < num1 * 7) Main.wallFrame[144] = (byte) 7; - else if ((int) Main.wallFrameCounter[144] < num2 * (8 + num3)) + else if ((int) Main.wallFrameCounter[144] < num1 * (8 + num2)) Main.wallFrame[144] = (byte) 8; - else if ((int) Main.wallFrameCounter[144] < num2 * (9 + num3)) + else if ((int) Main.wallFrameCounter[144] < num1 * (9 + num2)) Main.wallFrame[144] = (byte) 7; - else if ((int) Main.wallFrameCounter[144] < num2 * (10 + num3)) + else if ((int) Main.wallFrameCounter[144] < num1 * (10 + num2)) Main.wallFrame[144] = (byte) 6; - else if ((int) Main.wallFrameCounter[144] < num2 * (11 + num3)) + else if ((int) Main.wallFrameCounter[144] < num1 * (11 + num2)) Main.wallFrame[144] = (byte) 5; - else if ((int) Main.wallFrameCounter[144] < num2 * (12 + num3)) + else if ((int) Main.wallFrameCounter[144] < num1 * (12 + num2)) Main.wallFrame[144] = (byte) 4; - else if ((int) Main.wallFrameCounter[144] < num2 * (13 + num3)) + else if ((int) Main.wallFrameCounter[144] < num1 * (13 + num2)) Main.wallFrame[144] = (byte) 3; - else if ((int) Main.wallFrameCounter[144] < num2 * (14 + num3)) + else if ((int) Main.wallFrameCounter[144] < num1 * (14 + num2)) Main.wallFrame[144] = (byte) 2; - else if ((int) Main.wallFrameCounter[144] < num2 * (15 + num3)) + else if ((int) Main.wallFrameCounter[144] < num1 * (15 + num2)) { Main.wallFrame[144] = (byte) 1; } else { Main.wallFrame[144] = (byte) 0; - if ((int) Main.wallFrameCounter[144] <= num2 * (16 + num3 * 2)) + if ((int) Main.wallFrameCounter[144] <= num1 * (16 + num2 * 2)) return; Main.wallFrameCounter[144] = (byte) 0; } @@ -13623,7 +11902,7 @@ label_56: private void DoUpdate_AnimateWaterfalls() { - Main.wFrCounter += Main.windSpeedCurrent * 2f; + Main.wFrCounter += Main.windSpeed * 2f; if ((double) Main.wFrCounter > 4.0) { Main.wFrCounter = 0.0f; @@ -13720,45 +11999,37 @@ label_56: private static void DoUpdate_AnimateBackgrounds() { - Main.DoUpdate_AnimateBackgrounds_UpdateForest(0, Main.treeMntBGSet1); - Main.DoUpdate_AnimateBackgrounds_UpdateForest(10, Main.treeMntBGSet2); - Main.DoUpdate_AnimateBackgrounds_UpdateForest(11, Main.treeMntBGSet3); - Main.DoUpdate_AnimateBackgrounds_UpdateForest(12, Main.treeMntBGSet4); - } - - private static void DoUpdate_AnimateBackgrounds_UpdateForest(int bgIndex, int[] bgSet) - { - if (bgSet[1] == 94 || bgSet[1] >= 114 && bgSet[1] <= 116) + if (Main.treeMntBG[1] == 94 || Main.treeMntBG[1] >= 114 && Main.treeMntBG[1] <= 116) { - ++Main.bgFrameCounter[bgIndex]; - if (Main.bgFrameCounter[bgIndex] >= 6) + ++Main.bgFrameCounter[0]; + if (Main.bgFrameCounter[0] >= 6) { - Main.bgFrameCounter[bgIndex] = 0; - ++Main.bgFrame[bgIndex]; - if (Main.bgFrame[bgIndex] >= 4) - Main.bgFrame[bgIndex] = 0; + Main.bgFrameCounter[0] = 0; + ++Main.bgFrame[0]; + if (Main.bgFrame[0] >= 4) + Main.bgFrame[0] = 0; } - bgSet[1] = Main.bgFrame[bgIndex] != 0 ? (Main.bgFrame[bgIndex] != 1 ? (Main.bgFrame[bgIndex] != 2 ? 116 : 115) : 114) : 94; - bgSet[0] = Main.bgFrame[bgIndex] != 0 ? (Main.bgFrame[bgIndex] != 1 ? (Main.bgFrame[bgIndex] != 2 ? 170 : 169) : 168) : 93; + Main.treeMntBG[1] = Main.bgFrame[0] != 0 ? (Main.bgFrame[0] != 1 ? (Main.bgFrame[0] != 2 ? 116 : 115) : 114) : 94; + Main.treeMntBG[0] = Main.bgFrame[0] != 0 ? (Main.bgFrame[0] != 1 ? (Main.bgFrame[0] != 2 ? 170 : 169) : 168) : 93; } - if (bgSet[1] < 180 || bgSet[1] > 183) + if (Main.treeMntBG[1] < 180 || Main.treeMntBG[1] > 183) return; - ++Main.bgFrameCounter[bgIndex]; - if (Main.bgFrameCounter[bgIndex] >= 6) + ++Main.bgFrameCounter[0]; + if (Main.bgFrameCounter[0] >= 6) { - Main.bgFrameCounter[bgIndex] = 0; - ++Main.bgFrame[bgIndex]; - if (Main.bgFrame[bgIndex] >= 4) - Main.bgFrame[bgIndex] = 0; + Main.bgFrameCounter[0] = 0; + ++Main.bgFrame[0]; + if (Main.bgFrame[0] >= 4) + Main.bgFrame[0] = 0; } - if (Main.bgFrame[bgIndex] == 0) - bgSet[1] = 180; - else if (Main.bgFrame[bgIndex] == 1) - bgSet[1] = 181; - else if (Main.bgFrame[bgIndex] == 2) - bgSet[1] = 182; + if (Main.bgFrame[0] == 0) + Main.treeMntBG[1] = 180; + else if (Main.bgFrame[0] == 1) + Main.treeMntBG[1] = 181; + else if (Main.bgFrame[0] == 2) + Main.treeMntBG[1] = 182; else - bgSet[1] = 183; + Main.treeMntBG[1] = 183; } private static void DoUpdate_AutoSave() @@ -13772,15 +12043,14 @@ label_56: Main.saveTime.Reset(); WorldGen.saveToonWhilePlaying(); } - else if (!Main.gameMenu && (Main.autoSave || Main.netMode == 2)) + else if (!Main.gameMenu && Main.autoSave) { if (!Main.saveTime.IsRunning) Main.saveTime.Start(); if (Main.saveTime.ElapsedMilliseconds <= 600000L) return; Main.saveTime.Reset(); - if (Main.netMode != 2) - WorldGen.saveToonWhilePlaying(); + WorldGen.saveToonWhilePlaying(); WorldGen.saveAndPlay(); } else @@ -13805,7 +12075,7 @@ label_56: return; PlayerInput.WritingText = true; Main.instance.HandleIME(); - Main.npcChatText = Main.GetInputText(Main.npcChatText, true); + Main.npcChatText = Main.GetInputText(Main.npcChatText); if (Main.inputTextEnter) { byte[] bytes = new byte[1]{ (byte) 10 }; @@ -13838,7 +12108,7 @@ label_56: public static void InputTextSignCancel() { - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.editSign = false; Main.blockKey = Microsoft.Xna.Framework.Input.Keys.Escape.ToString(); UIVirtualKeyboard.CacheCancelledInput(1); @@ -13847,92 +12117,17 @@ label_56: private static void UpdateMenu() { - if (WorldGen.drunkWorldGen) - { - Main.screenPosition.X -= 20f; - if (WorldGen.drunkWorldGenText) - { - Main.numClouds = Main.rand.Next(100, 200); - Main.statusText = string.Concat((object) Main.rand.Next(999999999)); - for (int index = 0; index < 3; ++index) - { - if (Main.rand.Next(2) == 0) - Main.statusText += (string) (object) Main.rand.Next(999999999); - } - } - } - Main.gamePaused = false; - Main.thunderDelay = 0; - Main.lightning = 0.0f; - Main.lightningSpeed = 0.0f; - Main.GraveyardVisualIntensity = 0.0f; - InGameNotificationsTracker.Clear(); + AchievementCompleteUI.Clear(); Main.playerInventory = false; Main.exitScale = 0.8f; switch (Main.netMode) { case 0: - if ((!Main.instance.IsActive ? 0 : (Main.hasFocus ? 1 : 0)) != 0 && !Main.dayTime && (Main.rand.Next(12) == 0 || WorldGen.drunkWorldGen)) - { - int index = Main.rand.Next(Main.numStars); - if (Main.star[index] != null && !Main.star[index].hidden && !Main.star[index].falling) - Main.star[index].Fall(); - } - if (Main.gameMenu) - { - if (WorldGen.gen) - Main.lockMenuBGChange = true; - else if (Main.menuMode == 0) - Main.lockMenuBGChange = false; - if (!Main.lockMenuBGChange) - { - if (Main.dayTime) - Main.menuBGChangedDay = false; - else if (!Main.menuBGChangedDay && Main.time >= 16200.0) - { - Main.menuBGChangedDay = true; - int corruptBg = WorldGen.corruptBG; - WorldGen.RandomizeBackgrounds(Main.rand); - if (Main.treeBGSet1[0] == 173) - WorldGen.RandomizeBackgrounds(Main.rand); - if (Main.treeBGSet1[0] == 173) - WorldGen.RandomizeBackgrounds(Main.rand); - WorldGen.setBG(1, corruptBg); - } - if (!Main.dayTime) - Main.menuBGChangedNight = false; - else if (!Main.menuBGChangedNight && Main.time >= 27000.0) - { - Main.moonType = Main.rand.Next(9); - Main.menuBGChangedNight = true; - int treeBg1 = WorldGen.treeBG1; - WorldGen.RandomizeBackgrounds(Main.rand); - WorldGen.setBG(0, treeBg1); - } - } - else - { - Main.menuBGChangedDay = true; - Main.menuBGChangedNight = true; - } - } - if (Main.alreadyGrabbingSunOrMoon) + Main.maxRaining = 0.0f; + Main.raining = false; + if (Main.grabSky) break; - if (WorldGen.drunkWorldGen) - { - Main.time -= 6.0; - if (Main.dayTime) - Main.time -= 1000.0; - if (Main.time < 0.0) - { - Main.time = 32400.0; - Main.dayTime = false; - } - } - else if (Main.dayTime) - Main.time += 576.0 / 17.0; - else - Main.time += 216.0 / 7.0; + Main.time += 86.4; if (!Main.dayTime) { if (Main.time <= 32400.0) @@ -13941,7 +12136,7 @@ label_56: Main.time = 0.0; Main.dayTime = true; ++Main.moonPhase; - if (Main.moonPhase < 7) + if (Main.moonPhase < 8) break; Main.moonPhase = 0; break; @@ -13962,14 +12157,14 @@ label_56: [DllImport("user32.dll", CharSet = CharSet.Auto)] public static extern short GetKeyState(int keyCode); - public static string GetInputText(string oldString, bool allowMultiLine = false) + public static string GetInputText(string oldString) { if (!Main.hasFocus) return oldString; Main.inputTextEnter = false; Main.inputTextEscape = false; string str1 = oldString; - string newKeys = ""; + string str2 = ""; if (str1 == null) str1 = ""; bool flag1 = false; @@ -13979,13 +12174,13 @@ label_56: str1 = ""; else if (Main.inputText.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.X) && !Main.oldInputText.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.X)) { - Platform.Get().Value = oldString; + ((Platform) Platform.Current).Clipboard = oldString; str1 = ""; } else if (Main.inputText.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.C) && !Main.oldInputText.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.C) || Main.inputText.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Insert) && !Main.oldInputText.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Insert)) - Platform.Get().Value = oldString; + ((Platform) Platform.Current).Clipboard = oldString; else if (Main.inputText.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.V) && !Main.oldInputText.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.V)) - newKeys = Main.PasteTextIn(allowMultiLine, newKeys); + str2 += ((Platform) Platform.Current).Clipboard; } else { @@ -13993,16 +12188,24 @@ label_56: { if (Main.inputText.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Delete) && !Main.oldInputText.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Delete)) { - Platform.Get().Value = oldString; + ((Platform) Platform.Current).Clipboard = oldString; str1 = ""; } if (Main.inputText.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Insert) && !Main.oldInputText.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Insert)) - newKeys = Main.PasteTextIn(allowMultiLine, newKeys); + { + string str3 = ((Platform) Platform.Current).Clipboard; + for (int index = 0; index < str3.Length; ++index) + { + if (str3[index] < ' ' || str3[index] == '\u007F') + str3 = str3.Replace(str3[index--].ToString() ?? "", ""); + } + str2 += str3; + } } for (int index = 0; index < Main.keyCount; ++index) { int num = Main.keyInt[index]; - string str2 = Main.keyString[index]; + string str4 = Main.keyString[index]; switch (num) { case 13: @@ -14014,7 +12217,7 @@ label_56: default: if (num >= 32 && num != (int) sbyte.MaxValue) { - newKeys += str2; + str2 += str4; break; } break; @@ -14022,28 +12225,22 @@ label_56: } } Main.keyCount = 0; - string text = str1 + newKeys; + string text = str1 + str2; Main.oldInputText = Main.inputText; Main.inputText = Keyboard.GetState(); Microsoft.Xna.Framework.Input.Keys[] pressedKeys1 = Main.inputText.GetPressedKeys(); Microsoft.Xna.Framework.Input.Keys[] pressedKeys2 = Main.oldInputText.GetPressedKeys(); if (Main.inputText.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Back) && Main.oldInputText.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Back)) { - Main.backSpaceRate -= 0.05f; - if ((double) Main.backSpaceRate < 0.0) - Main.backSpaceRate = 0.0f; - if (Main.backSpaceCount <= 0) + if (Main.backSpaceCount == 0) { - Main.backSpaceCount = (int) Math.Round((double) Main.backSpaceRate); + Main.backSpaceCount = 7; flag1 = true; } --Main.backSpaceCount; } else - { - Main.backSpaceRate = 7f; Main.backSpaceCount = 15; - } for (int index1 = 0; index1 < pressedKeys1.Length; ++index1) { bool flag2 = true; @@ -14061,27 +12258,20 @@ label_56: return text; } - private static string PasteTextIn(bool allowMultiLine, string newKeys) + public void MouseTextHackZoom(string text) => this.MouseTextHackZoom(text, 0); + + public void MouseTextHackZoom(string text, int itemRarity, byte diff = 0) { - newKeys = !allowMultiLine ? newKeys + Platform.Get().Value : newKeys + Platform.Get().MultiLineValue; - return newKeys; - } - - public void MouseTextHackZoom(string text, string buffTooltip = null) => this.MouseTextHackZoom(text, 0, buffTooltip: buffTooltip); - - public void MouseTextHackZoom(string text, int itemRarity, byte diff = 0, string buffTooltip = null) => this.MouseText(text, buffTooltip, itemRarity, diff); - - public void MouseTextNoOverride( - string cursorText, - int rare = 0, - byte diff = 0, - int hackedMouseX = -1, - int hackedMouseY = -1, - int hackedScreenWidth = -1, - int hackedScreenHeight = -1, - int pushWidthX = 0) - { - this.MouseText(cursorText, (string) null, rare, diff, hackedMouseX, hackedMouseY, hackedScreenWidth, hackedScreenHeight, pushWidthX, true); + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, (BlendState) null, (SamplerState) null, (DepthStencilState) null, (RasterizerState) null, (Effect) null, Main._uiScaleMatrix); + PlayerInput.SetZoom_UI(); + int screenWidth = Main.screenWidth; + int screenHeight = Main.screenHeight; + int mouseX = Main.mouseX; + int mouseY = Main.mouseY; + PlayerInput.SetZoom_UI(); + PlayerInput.SetZoom_Test(); + this.MouseText(text, itemRarity, hackedMouseX: mouseX, hackedMouseY: mouseY, hackedScreenWidth: screenWidth, hackedScreenHeight: screenHeight); } public void MouseText( @@ -14091,76 +12281,32 @@ label_56: int hackedMouseX = -1, int hackedMouseY = -1, int hackedScreenWidth = -1, - int hackedScreenHeight = -1, - int pushWidthX = 0) + int hackedScreenHeight = -1) { - this.MouseText(cursorText, (string) null, rare, diff, hackedMouseX, hackedMouseY, hackedScreenWidth, hackedScreenHeight, pushWidthX); - } - - public void MouseText( - string cursorText, - string buffTooltip, - int rare = 0, - byte diff = 0, - int hackedMouseX = -1, - int hackedMouseY = -1, - int hackedScreenWidth = -1, - int hackedScreenHeight = -1, - int pushWidthX = 0, - bool noOverride = false) - { - if (this._mouseTextCache.noOverride) + if (this.mouseNPC > -1 || cursorText == null) return; - this._mouseTextCache = new Main.MouseTextCache() + int X = Main.mouseX + 10; + int Y = Main.mouseY + 10; + if (hackedMouseX != -1 && hackedMouseY != -1) { - noOverride = noOverride, - isValid = true, - cursorText = cursorText, - rare = rare, - diff = diff, - X = hackedMouseX, - Y = hackedMouseY, - hackedScreenWidth = hackedScreenWidth, - hackedScreenHeight = hackedScreenHeight, - buffTooltip = buffTooltip - }; - } - - private void MouseTextInner(Main.MouseTextCache info) - { - string cursorText = info.cursorText; - int rare = info.rare; - byte diff = info.diff; - int x = info.X; - int y = info.Y; - int hackedScreenWidth = info.hackedScreenWidth; - int hackedScreenHeight = info.hackedScreenHeight; - if (this.mouseNPCType > -1 || cursorText == null) - return; - int X = Main.mouseX + 14; - int Y = Main.mouseY + 14; - if (x != -1 && y != -1) - { - X = x + 10; - Y = y + 10; + X = hackedMouseX + 10; + Y = hackedMouseY + 10; } if (Main.ThickMouse) { X += 6; Y += 6; } - if (!Main.mouseItem.IsAir) - X += 34; Microsoft.Xna.Framework.Color color = new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor); if (Main.HoverItem.type > 0) { - this.MouseText_DrawItemTooltip(info, rare, diff, X, Y); + this.MouseText_DrawItemTooltip(rare, diff, X, Y); } else { - if (info.buffTooltip != null && info.buffTooltip != "") - this.MouseText_DrawBuffTooltip(info.buffTooltip, ref X, ref Y); - Vector2 vector2 = FontAssets.MouseText.Value.MeasureString(cursorText); + if (Main.buffString != "" && Main.buffString != null) + this.MouseText_DrawBuffString(ref X, ref Y); + Vector2 vector2 = Main.fontMouseText.MeasureString(cursorText); if (hackedScreenHeight != -1 && hackedScreenWidth != -1) { if ((double) X + (double) vector2.X + 4.0 > (double) hackedScreenWidth) @@ -14177,8 +12323,6 @@ label_56: } float num = (float) Main.mouseTextColor / (float) byte.MaxValue; Microsoft.Xna.Framework.Color baseColor = new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor); - if (rare == -13) - baseColor = new Microsoft.Xna.Framework.Color((int) (byte) ((double) byte.MaxValue * (double) num), (int) (byte) ((double) Main.masterColor * 200.0 * (double) num), 0, (int) Main.mouseTextColor); if (rare == -11) baseColor = new Microsoft.Xna.Framework.Color((int) (byte) ((double) byte.MaxValue * (double) num), (int) (byte) (175.0 * (double) num), (int) (byte) (0.0 * (double) num), (int) Main.mouseTextColor); if (rare == -10) @@ -14213,745 +12357,672 @@ label_56: baseColor = new Microsoft.Xna.Framework.Color((int) (byte) ((double) Main.mcColor.R * (double) num), (int) (byte) ((double) Main.mcColor.G * (double) num), (int) (byte) ((double) Main.mcColor.B * (double) num), (int) Main.mouseTextColor); if (diff == (byte) 2) baseColor = new Microsoft.Xna.Framework.Color((int) (byte) ((double) Main.hcColor.R * (double) num), (int) (byte) ((double) Main.hcColor.G * (double) num), (int) (byte) ((double) Main.hcColor.B * (double) num), (int) Main.mouseTextColor); - ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, FontAssets.MouseText.Value, cursorText, new Vector2((float) X, (float) Y), baseColor, 0.0f, Vector2.Zero, Vector2.One); + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, Main.fontMouseText, cursorText, new Vector2((float) X, (float) Y), baseColor, 0.0f, Vector2.Zero, Vector2.One); } } - private void MouseText_DrawItemTooltip( - Main.MouseTextCache info, - int rare, - byte diff, - int X, - int Y) + private void MouseText_DrawItemTooltip(int rare, byte diff, int X, int Y) { - bool boxBehindTooltips = Main.SettingsEnabled_OpaqueBoxBehindTooltips; Microsoft.Xna.Framework.Color color1 = new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor); - Item hoverItem = Main.HoverItem; - int yoyoLogo = -1; - int researchLine = -1; - rare = hoverItem.rare; - float knockBack = hoverItem.knockBack; - float num1 = 1f; - if (hoverItem.melee && Main.player[Main.myPlayer].kbGlove) - ++num1; + int num1 = -1; + rare = Main.HoverItem.rare; + float knockBack = Main.HoverItem.knockBack; + float num2 = 1f; + if (Main.HoverItem.melee && Main.player[Main.myPlayer].kbGlove) + ++num2; if (Main.player[Main.myPlayer].kbBuff) - num1 += 0.5f; - if ((double) num1 != 1.0) - hoverItem.knockBack *= num1; - if (hoverItem.ranged && Main.player[Main.myPlayer].shroomiteStealth) - hoverItem.knockBack *= (float) (1.0 + (1.0 - (double) Main.player[Main.myPlayer].stealth) * 0.5); - int length = 30; - int index1 = 1; - string[] strArray = new string[length]; - bool[] preFixLine = new bool[length]; - bool[] badPreFixLine = new bool[length]; - for (int index2 = 0; index2 < length; ++index2) + num2 += 0.5f; + if ((double) num2 != 1.0) + Main.HoverItem.knockBack *= num2; + if (Main.HoverItem.ranged && Main.player[Main.myPlayer].shroomiteStealth) + Main.HoverItem.knockBack *= (float) (1.0 + (1.0 - (double) Main.player[Main.myPlayer].stealth) * 0.5); + int length = 20; + int currentLine = 1; + string[] lines = new string[length]; + bool[] flagArray1 = new bool[length]; + bool[] flagArray2 = new bool[length]; + for (int index = 0; index < length; ++index) { - preFixLine[index2] = false; - badPreFixLine[index2] = false; + flagArray1[index] = false; + flagArray2[index] = false; } - Main.MouseText_DrawItemTooltip_GetLinesInfo(Main.HoverItem, ref yoyoLogo, ref researchLine, knockBack, ref index1, strArray, preFixLine, badPreFixLine); - float num2 = (float) Main.mouseTextColor / (float) byte.MaxValue; - int mouseTextColor = (int) Main.mouseTextColor; - if (Main.npcShop > 0 && hoverItem.value >= 0 && (hoverItem.type < 71 || hoverItem.type > 74)) + lines[0] = Main.HoverItem.HoverName; + if (Main.HoverItem.favorited) { - int calcForSelling; - int calcForBuying; - Main.LocalPlayer.GetItemExpectedPrice(hoverItem, out calcForSelling, out calcForBuying); - int price = hoverItem.isAShopItem || hoverItem.buyOnce ? calcForBuying : calcForSelling; - if (hoverItem.shopSpecialCurrency != -1) + string[] strArray1 = lines; + int index1 = currentLine; + int num3 = index1 + 1; + string str1 = Lang.tip[56].Value; + strArray1[index1] = str1; + string[] strArray2 = lines; + int index2 = num3; + currentLine = index2 + 1; + string str2 = Lang.tip[57].Value; + strArray2[index2] = str2; + } + if (Main.HoverItem.social) + { + lines[currentLine] = Lang.tip[0].Value; + int index = currentLine + 1; + lines[index] = Lang.tip[1].Value; + currentLine = index + 1; + } + else + { + if (Main.HoverItem.damage > 0 && (!Main.HoverItem.notAmmo || Main.HoverItem.useStyle > 0) && (Main.HoverItem.type < 71 || Main.HoverItem.type > 74 || Main.player[Main.myPlayer].HasItem(905))) { - CustomCurrencyManager.GetPriceText(hoverItem.shopSpecialCurrency, strArray, ref index1, price); - color1 = new Microsoft.Xna.Framework.Color((int) (byte) ((double) byte.MaxValue * (double) num2), (int) (byte) ((double) byte.MaxValue * (double) num2), (int) (byte) ((double) byte.MaxValue * (double) num2), mouseTextColor); + float num4 = 5E-06f; + int damage = Main.HoverItem.damage; + if (Main.HoverItem.melee) + { + lines[currentLine] = string.Concat((object) (int) ((double) Main.player[Main.myPlayer].meleeDamage * (double) damage + (double) num4)); + // ISSUE: explicit reference operation + ^ref lines[currentLine] += Lang.tip[2].Value; + } + else if (Main.HoverItem.ranged) + { + float num5 = (float) damage * Main.player[Main.myPlayer].rangedDamage; + if (Main.HoverItem.useAmmo == AmmoID.Arrow || Main.HoverItem.useAmmo == AmmoID.Stake) + num5 *= Main.player[Main.myPlayer].arrowDamage; + if (Main.HoverItem.useAmmo == AmmoID.Arrow && Main.player[Main.myPlayer].archery) + num5 *= 1.2f; + if (Main.HoverItem.useAmmo == AmmoID.Bullet || Main.HoverItem.useAmmo == AmmoID.CandyCorn) + num5 *= Main.player[Main.myPlayer].bulletDamage; + if (Main.HoverItem.useAmmo == AmmoID.Rocket || Main.HoverItem.useAmmo == AmmoID.StyngerBolt || Main.HoverItem.useAmmo == AmmoID.JackOLantern || Main.HoverItem.useAmmo == AmmoID.NailFriendly) + num5 *= Main.player[Main.myPlayer].rocketDamage; + lines[currentLine] = string.Concat((object) (int) ((double) num5 + (double) num4)); + // ISSUE: explicit reference operation + ^ref lines[currentLine] += Lang.tip[3].Value; + } + else if (Main.HoverItem.magic) + { + lines[currentLine] = string.Concat((object) (int) ((double) Main.player[Main.myPlayer].magicDamage * (double) damage + (double) num4)); + // ISSUE: explicit reference operation + ^ref lines[currentLine] += Lang.tip[4].Value; + } + else if (Main.HoverItem.thrown) + { + lines[currentLine] = string.Concat((object) (int) ((double) Main.player[Main.myPlayer].thrownDamage * (double) damage + (double) num4)); + // ISSUE: explicit reference operation + ^ref lines[currentLine] += Lang.tip[58].Value; + } + else if (Main.HoverItem.summon) + { + lines[currentLine] = Main.HoverItem.type == 3829 || Main.HoverItem.type == 3830 || Main.HoverItem.type == 3831 ? string.Concat((object) (int) (((double) Main.player[Main.myPlayer].minionDamage * (double) damage + (double) num4) * 3.0)) : string.Concat((object) (int) ((double) Main.player[Main.myPlayer].minionDamage * (double) damage + (double) num4)); + // ISSUE: explicit reference operation + ^ref lines[currentLine] += Lang.tip[53].Value; + } + else + { + lines[currentLine] = string.Concat((object) damage); + // ISSUE: explicit reference operation + ^ref lines[currentLine] += Lang.tip[55].Value; + } + int index = currentLine + 1; + if (Main.HoverItem.melee) + { + int num6 = Main.player[Main.myPlayer].meleeCrit - Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].crit + Main.HoverItem.crit; + lines[index] = num6.ToString() + Lang.tip[5].Value; + ++index; + } + else if (Main.HoverItem.ranged) + { + int num7 = Main.player[Main.myPlayer].rangedCrit - Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].crit + Main.HoverItem.crit; + lines[index] = num7.ToString() + Lang.tip[5].Value; + ++index; + } + else if (Main.HoverItem.magic) + { + int num8 = Main.player[Main.myPlayer].magicCrit - Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].crit + Main.HoverItem.crit; + lines[index] = num8.ToString() + Lang.tip[5].Value; + ++index; + } + else if (Main.HoverItem.thrown) + { + int num9 = Main.player[Main.myPlayer].thrownCrit - Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].crit + Main.HoverItem.crit; + lines[index] = num9.ToString() + Lang.tip[5].Value; + ++index; + } + if (Main.HoverItem.useStyle > 0 && !Main.HoverItem.summon) + { + lines[index] = Main.HoverItem.useAnimation > 8 ? (Main.HoverItem.useAnimation > 20 ? (Main.HoverItem.useAnimation > 25 ? (Main.HoverItem.useAnimation > 30 ? (Main.HoverItem.useAnimation > 35 ? (Main.HoverItem.useAnimation > 45 ? (Main.HoverItem.useAnimation > 55 ? Lang.tip[13].Value : Lang.tip[12].Value) : Lang.tip[11].Value) : Lang.tip[10].Value) : Lang.tip[9].Value) : Lang.tip[8].Value) : Lang.tip[7].Value) : Lang.tip[6].Value; + ++index; + } + float num10 = Main.HoverItem.knockBack; + if (Main.HoverItem.summon) + num10 += Main.player[Main.myPlayer].minionKB; + if (Main.player[Main.myPlayer].magicQuiver && Main.HoverItem.useAmmo == AmmoID.Arrow || Main.HoverItem.useAmmo == AmmoID.Stake) + num10 = (float) (int) ((double) num10 * 1.10000002384186); + if (Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type == 3106 && Main.HoverItem.type == 3106) + num10 += num10 * (1f - Main.player[Main.myPlayer].stealth); + lines[index] = (double) num10 != 0.0 ? ((double) num10 > 1.5 ? ((double) num10 > 3.0 ? ((double) num10 > 4.0 ? ((double) num10 > 6.0 ? ((double) num10 > 7.0 ? ((double) num10 > 9.0 ? ((double) num10 > 11.0 ? Lang.tip[22].Value : Lang.tip[21].Value) : Lang.tip[20].Value) : Lang.tip[19].Value) : Lang.tip[18].Value) : Lang.tip[17].Value) : Lang.tip[16].Value) : Lang.tip[15].Value) : Lang.tip[14].Value; + currentLine = index + 1; } - else if (price > 0) + if (Main.HoverItem.fishingPole > 0) + { + lines[currentLine] = Language.GetTextValue("GameUI.PrecentFishingPower", (object) Main.HoverItem.fishingPole); + int index = currentLine + 1; + lines[index] = Language.GetTextValue("GameUI.BaitRequired"); + currentLine = index + 1; + } + if (Main.HoverItem.bait > 0) + { + lines[currentLine] = Language.GetTextValue("GameUI.BaitPower", (object) Main.HoverItem.bait); + ++currentLine; + } + if (Main.HoverItem.headSlot > 0 || Main.HoverItem.bodySlot > 0 || Main.HoverItem.legSlot > 0 || Main.HoverItem.accessory || Main.projHook[Main.HoverItem.shoot] || Main.HoverItem.mountType != -1 || Main.HoverItem.buffType > 0 && (Main.lightPet[Main.HoverItem.buffType] || Main.vanityPet[Main.HoverItem.buffType])) + { + lines[currentLine] = Lang.tip[23].Value; + ++currentLine; + } + if (Main.HoverItem.tileWand > 0) + { + lines[currentLine] = Lang.tip[52].Value + Lang.GetItemNameValue(Main.HoverItem.tileWand); + ++currentLine; + } + if (Main.HoverItem.questItem) + { + lines[currentLine] = Lang.inter[65].Value; + ++currentLine; + } + if (Main.HoverItem.vanity) + { + lines[currentLine] = Lang.tip[24].Value; + ++currentLine; + } + if (Main.HoverItem.defense > 0) + { + lines[currentLine] = Main.HoverItem.defense.ToString() + Lang.tip[25].Value; + ++currentLine; + } + if (Main.HoverItem.pick > 0) + { + lines[currentLine] = Main.HoverItem.pick.ToString() + Lang.tip[26].Value; + ++currentLine; + } + if (Main.HoverItem.axe > 0) + { + lines[currentLine] = (Main.HoverItem.axe * 5).ToString() + Lang.tip[27].Value; + ++currentLine; + } + if (Main.HoverItem.hammer > 0) + { + lines[currentLine] = Main.HoverItem.hammer.ToString() + Lang.tip[28].Value; + ++currentLine; + } + if (Main.HoverItem.tileBoost != 0) + { + int tileBoost = Main.HoverItem.tileBoost; + lines[currentLine] = tileBoost <= 0 ? tileBoost.ToString() + Lang.tip[54].Value : "+" + (object) tileBoost + Lang.tip[54].Value; + ++currentLine; + } + if (Main.HoverItem.healLife > 0) + { + lines[currentLine] = Language.GetTextValue("CommonItemTooltip.RestoresLife", (object) Main.HoverItem.healLife); + ++currentLine; + } + if (Main.HoverItem.healMana > 0) + { + lines[currentLine] = Language.GetTextValue("CommonItemTooltip.RestoresMana", (object) Main.HoverItem.healMana); + ++currentLine; + } + if (Main.HoverItem.mana > 0 && (Main.HoverItem.type != (int) sbyte.MaxValue || !Main.player[Main.myPlayer].spaceGun)) + { + lines[currentLine] = Language.GetTextValue("CommonItemTooltip.UsesMana", (object) (int) ((double) Main.HoverItem.mana * (double) Main.player[Main.myPlayer].manaCost)); + ++currentLine; + } + if (Main.HoverItem.createWall > 0 || Main.HoverItem.createTile > -1) + { + if (Main.HoverItem.type != 213 && Main.HoverItem.tileWand < 1) + { + lines[currentLine] = Lang.tip[33].Value; + ++currentLine; + } + } + else if (Main.HoverItem.ammo > 0 && !Main.HoverItem.notAmmo) + { + lines[currentLine] = Lang.tip[34].Value; + ++currentLine; + } + else if (Main.HoverItem.consumable) + { + lines[currentLine] = Lang.tip[35].Value; + ++currentLine; + } + if (Main.HoverItem.material) + { + lines[currentLine] = Lang.tip[36].Value; + ++currentLine; + } + if (Main.HoverItem.ToolTip != null) + { + for (int line = 0; line < Main.HoverItem.ToolTip.Lines; ++line) + { + if (line == 0 && Main.HoverItem.type >= 1533 && Main.HoverItem.type <= 1537 && !NPC.downedPlantBoss) + { + lines[currentLine] = Lang.tip[59].Value; + ++currentLine; + } + else + { + lines[currentLine] = Main.HoverItem.ToolTip.GetLine(line); + ++currentLine; + } + } + } + if ((Main.HoverItem.type == 3818 || Main.HoverItem.type == 3819 || Main.HoverItem.type == 3820 || Main.HoverItem.type == 3824 || Main.HoverItem.type == 3825 || Main.HoverItem.type == 3826 || Main.HoverItem.type == 3829 || Main.HoverItem.type == 3830 || Main.HoverItem.type == 3831 || Main.HoverItem.type == 3832 || Main.HoverItem.type == 3833 || Main.HoverItem.type == 3834) && !Main.player[Main.myPlayer].downedDD2EventAnyDifficulty) + { + lines[currentLine] = Lang.misc[104].Value; + ++currentLine; + } + if (Main.HoverItem.buffType == 26 && Main.expertMode) + { + lines[currentLine] = Lang.misc[40].Value; + ++currentLine; + } + if (Main.HoverItem.buffTime > 0) + { + string str = Main.HoverItem.buffTime / 60 < 60 ? Language.GetTextValue("CommonItemTooltip.SecondDuration", (object) Math.Round((double) Main.HoverItem.buffTime / 60.0)) : Language.GetTextValue("CommonItemTooltip.MinuteDuration", (object) Math.Round((double) (Main.HoverItem.buffTime / 60) / 60.0)); + lines[currentLine] = str; + ++currentLine; + } + if (Main.HoverItem.type == 3262 || Main.HoverItem.type == 3282 || Main.HoverItem.type == 3283 || Main.HoverItem.type == 3284 || Main.HoverItem.type == 3285 || Main.HoverItem.type == 3286 || Main.HoverItem.type == 3316 || Main.HoverItem.type == 3315 || Main.HoverItem.type == 3317 || Main.HoverItem.type == 3291 || Main.HoverItem.type == 3389) + { + lines[currentLine] = " "; + num1 = currentLine; + ++currentLine; + } + if (Main.HoverItem.prefix > (byte) 0) + { + if (Main.cpItem == null || Main.cpItem.netID != Main.HoverItem.netID) + { + Main.cpItem = new Item(); + Main.cpItem.netDefaults(Main.HoverItem.netID); + } + if (Main.cpItem.damage != Main.HoverItem.damage) + { + double num11 = Math.Round(((double) Main.HoverItem.damage - (double) Main.cpItem.damage) / (double) Main.cpItem.damage * 100.0); + lines[currentLine] = num11 <= 0.0 ? num11.ToString() + Lang.tip[39].Value : "+" + (object) num11 + Lang.tip[39].Value; + if (num11 < 0.0) + flagArray2[currentLine] = true; + flagArray1[currentLine] = true; + ++currentLine; + } + if (Main.cpItem.useAnimation != Main.HoverItem.useAnimation) + { + double num12 = Math.Round(((double) Main.HoverItem.useAnimation - (double) Main.cpItem.useAnimation) / (double) Main.cpItem.useAnimation * 100.0) * -1.0; + lines[currentLine] = num12 <= 0.0 ? num12.ToString() + Lang.tip[40].Value : "+" + (object) num12 + Lang.tip[40].Value; + if (num12 < 0.0) + flagArray2[currentLine] = true; + flagArray1[currentLine] = true; + ++currentLine; + } + if (Main.cpItem.crit != Main.HoverItem.crit) + { + double num13 = (double) Main.HoverItem.crit - (double) Main.cpItem.crit; + lines[currentLine] = num13 <= 0.0 ? num13.ToString() + Lang.tip[41].Value : "+" + (object) num13 + Lang.tip[41].Value; + if (num13 < 0.0) + flagArray2[currentLine] = true; + flagArray1[currentLine] = true; + ++currentLine; + } + if (Main.cpItem.mana != Main.HoverItem.mana) + { + double num14 = Math.Round(((double) Main.HoverItem.mana - (double) Main.cpItem.mana) / (double) Main.cpItem.mana * 100.0); + lines[currentLine] = num14 <= 0.0 ? num14.ToString() + Lang.tip[42].Value : "+" + (object) num14 + Lang.tip[42].Value; + if (num14 > 0.0) + flagArray2[currentLine] = true; + flagArray1[currentLine] = true; + ++currentLine; + } + if ((double) Main.cpItem.scale != (double) Main.HoverItem.scale) + { + double num15 = Math.Round(((double) Main.HoverItem.scale - (double) Main.cpItem.scale) / (double) Main.cpItem.scale * 100.0); + lines[currentLine] = num15 <= 0.0 ? num15.ToString() + Lang.tip[43].Value : "+" + (object) num15 + Lang.tip[43].Value; + if (num15 < 0.0) + flagArray2[currentLine] = true; + flagArray1[currentLine] = true; + ++currentLine; + } + if ((double) Main.cpItem.shootSpeed != (double) Main.HoverItem.shootSpeed) + { + double num16 = Math.Round(((double) Main.HoverItem.shootSpeed - (double) Main.cpItem.shootSpeed) / (double) Main.cpItem.shootSpeed * 100.0); + lines[currentLine] = num16 <= 0.0 ? num16.ToString() + Lang.tip[44].Value : "+" + (object) num16 + Lang.tip[44].Value; + if (num16 < 0.0) + flagArray2[currentLine] = true; + flagArray1[currentLine] = true; + ++currentLine; + } + if ((double) Main.cpItem.knockBack != (double) knockBack) + { + double num17 = Math.Round(((double) knockBack - (double) Main.cpItem.knockBack) / (double) Main.cpItem.knockBack * 100.0); + lines[currentLine] = num17 <= 0.0 ? num17.ToString() + Lang.tip[45].Value : "+" + (object) num17 + Lang.tip[45].Value; + if (num17 < 0.0) + flagArray2[currentLine] = true; + flagArray1[currentLine] = true; + ++currentLine; + } + if (Main.HoverItem.prefix == (byte) 62) + { + lines[currentLine] = "+1" + Lang.tip[25].Value; + flagArray1[currentLine] = true; + ++currentLine; + } + if (Main.HoverItem.prefix == (byte) 63) + { + lines[currentLine] = "+2" + Lang.tip[25].Value; + flagArray1[currentLine] = true; + ++currentLine; + } + if (Main.HoverItem.prefix == (byte) 64) + { + lines[currentLine] = "+3" + Lang.tip[25].Value; + flagArray1[currentLine] = true; + ++currentLine; + } + if (Main.HoverItem.prefix == (byte) 65) + { + lines[currentLine] = "+4" + Lang.tip[25].Value; + flagArray1[currentLine] = true; + ++currentLine; + } + if (Main.HoverItem.prefix == (byte) 66) + { + lines[currentLine] = "+20 " + Lang.tip[31].Value; + flagArray1[currentLine] = true; + ++currentLine; + } + if (Main.HoverItem.prefix == (byte) 67) + { + lines[currentLine] = "+2" + Lang.tip[5].Value; + flagArray1[currentLine] = true; + ++currentLine; + } + if (Main.HoverItem.prefix == (byte) 68) + { + lines[currentLine] = "+4" + Lang.tip[5].Value; + flagArray1[currentLine] = true; + ++currentLine; + } + if (Main.HoverItem.prefix == (byte) 69) + { + lines[currentLine] = "+1" + Lang.tip[39].Value; + flagArray1[currentLine] = true; + ++currentLine; + } + if (Main.HoverItem.prefix == (byte) 70) + { + lines[currentLine] = "+2" + Lang.tip[39].Value; + flagArray1[currentLine] = true; + ++currentLine; + } + if (Main.HoverItem.prefix == (byte) 71) + { + lines[currentLine] = "+3" + Lang.tip[39].Value; + flagArray1[currentLine] = true; + ++currentLine; + } + if (Main.HoverItem.prefix == (byte) 72) + { + lines[currentLine] = "+4" + Lang.tip[39].Value; + flagArray1[currentLine] = true; + ++currentLine; + } + if (Main.HoverItem.prefix == (byte) 73) + { + lines[currentLine] = "+1" + Lang.tip[46].Value; + flagArray1[currentLine] = true; + ++currentLine; + } + if (Main.HoverItem.prefix == (byte) 74) + { + lines[currentLine] = "+2" + Lang.tip[46].Value; + flagArray1[currentLine] = true; + ++currentLine; + } + if (Main.HoverItem.prefix == (byte) 75) + { + lines[currentLine] = "+3" + Lang.tip[46].Value; + flagArray1[currentLine] = true; + ++currentLine; + } + if (Main.HoverItem.prefix == (byte) 76) + { + lines[currentLine] = "+4" + Lang.tip[46].Value; + flagArray1[currentLine] = true; + ++currentLine; + } + if (Main.HoverItem.prefix == (byte) 77) + { + lines[currentLine] = "+1" + Lang.tip[47].Value; + flagArray1[currentLine] = true; + ++currentLine; + } + if (Main.HoverItem.prefix == (byte) 78) + { + lines[currentLine] = "+2" + Lang.tip[47].Value; + flagArray1[currentLine] = true; + ++currentLine; + } + if (Main.HoverItem.prefix == (byte) 79) + { + lines[currentLine] = "+3" + Lang.tip[47].Value; + flagArray1[currentLine] = true; + ++currentLine; + } + if (Main.HoverItem.prefix == (byte) 80) + { + lines[currentLine] = "+4" + Lang.tip[47].Value; + flagArray1[currentLine] = true; + ++currentLine; + } + } + if (Main.HoverItem.wornArmor && Main.player[Main.myPlayer].setBonus != "") + { + lines[currentLine] = Lang.tip[48].Value + " " + Main.player[Main.myPlayer].setBonus; + ++currentLine; + } + } + if (Main.HoverItem.expert) + { + lines[currentLine] = Language.GetTextValue("GameUI.Expert"); + ++currentLine; + } + float num18 = (float) Main.mouseTextColor / (float) byte.MaxValue; + int mouseTextColor = (int) Main.mouseTextColor; + if (Main.npcShop > 0) + { + int storeValue = Main.HoverItem.GetStoreValue(); + if (Main.HoverItem.shopSpecialCurrency != -1) + { + CustomCurrencyManager.GetPriceText(Main.HoverItem.shopSpecialCurrency, lines, ref currentLine, storeValue); + color1 = new Microsoft.Xna.Framework.Color((int) (byte) ((double) byte.MaxValue * (double) num18), (int) (byte) ((double) byte.MaxValue * (double) num18), (int) (byte) ((double) byte.MaxValue * (double) num18), mouseTextColor); + } + else if (Main.HoverItem.GetStoreValue() > 0) { string str = ""; - int num3 = 0; - int num4 = 0; - int num5 = 0; - int num6 = 0; - int num7 = price * hoverItem.stack; - if (!hoverItem.buy) + int num19 = 0; + int num20 = 0; + int num21 = 0; + int num22 = 0; + int num23 = storeValue * Main.HoverItem.stack; + if (!Main.HoverItem.buy) { - int num8 = price / 5; - if (num8 < 1) - num8 = 1; - int num9 = num8; - num7 = num8 * hoverItem.stack; - int amount = Main.shopSellbackHelper.GetAmount(hoverItem); - if (amount > 0) - num7 += (-num9 + calcForBuying) * Math.Min(amount, hoverItem.stack); + int num24 = storeValue / 5; + if (num24 < 1) + num24 = 1; + num23 = num24 * Main.HoverItem.stack; } - if (num7 < 1) - num7 = 1; - if (num7 >= 1000000) + if (num23 < 1) + num23 = 1; + if (num23 >= 1000000) { - num3 = num7 / 1000000; - num7 -= num3 * 1000000; + num19 = num23 / 1000000; + num23 -= num19 * 1000000; } - if (num7 >= 10000) + if (num23 >= 10000) { - num4 = num7 / 10000; - num7 -= num4 * 10000; + num20 = num23 / 10000; + num23 -= num20 * 10000; } - if (num7 >= 100) + if (num23 >= 100) { - num5 = num7 / 100; - num7 -= num5 * 100; + num21 = num23 / 100; + num23 -= num21 * 100; } - if (num7 >= 1) - num6 = num7; - if (num3 > 0) - str = str + (object) num3 + " " + Lang.inter[15].Value + " "; - if (num4 > 0) - str = str + (object) num4 + " " + Lang.inter[16].Value + " "; - if (num5 > 0) - str = str + (object) num5 + " " + Lang.inter[17].Value + " "; - if (num6 > 0) - str = str + (object) num6 + " " + Lang.inter[18].Value + " "; - strArray[index1] = hoverItem.buy ? Lang.tip[50].Value + " " + str : Lang.tip[49].Value + " " + str; - ++index1; - if (num3 > 0) - color1 = new Microsoft.Xna.Framework.Color((int) (byte) (220.0 * (double) num2), (int) (byte) (220.0 * (double) num2), (int) (byte) (198.0 * (double) num2), mouseTextColor); - else if (num4 > 0) - color1 = new Microsoft.Xna.Framework.Color((int) (byte) (224.0 * (double) num2), (int) (byte) (201.0 * (double) num2), (int) (byte) (92.0 * (double) num2), mouseTextColor); - else if (num5 > 0) - color1 = new Microsoft.Xna.Framework.Color((int) (byte) (181.0 * (double) num2), (int) (byte) (192.0 * (double) num2), (int) (byte) (193.0 * (double) num2), mouseTextColor); - else if (num6 > 0) - color1 = new Microsoft.Xna.Framework.Color((int) (byte) (246.0 * (double) num2), (int) (byte) (138.0 * (double) num2), (int) (byte) (96.0 * (double) num2), mouseTextColor); + if (num23 >= 1) + num22 = num23; + if (num19 > 0) + str = str + (object) num19 + " " + Lang.inter[15].Value + " "; + if (num20 > 0) + str = str + (object) num20 + " " + Lang.inter[16].Value + " "; + if (num21 > 0) + str = str + (object) num21 + " " + Lang.inter[17].Value + " "; + if (num22 > 0) + str = str + (object) num22 + " " + Lang.inter[18].Value + " "; + lines[currentLine] = Main.HoverItem.buy ? Lang.tip[50].Value + " " + str : Lang.tip[49].Value + " " + str; + ++currentLine; + if (num19 > 0) + color1 = new Microsoft.Xna.Framework.Color((int) (byte) (220.0 * (double) num18), (int) (byte) (220.0 * (double) num18), (int) (byte) (198.0 * (double) num18), mouseTextColor); + else if (num20 > 0) + color1 = new Microsoft.Xna.Framework.Color((int) (byte) (224.0 * (double) num18), (int) (byte) (201.0 * (double) num18), (int) (byte) (92.0 * (double) num18), mouseTextColor); + else if (num21 > 0) + color1 = new Microsoft.Xna.Framework.Color((int) (byte) (181.0 * (double) num18), (int) (byte) (192.0 * (double) num18), (int) (byte) (193.0 * (double) num18), mouseTextColor); + else if (num22 > 0) + color1 = new Microsoft.Xna.Framework.Color((int) (byte) (246.0 * (double) num18), (int) (byte) (138.0 * (double) num18), (int) (byte) (96.0 * (double) num18), mouseTextColor); } - else if (hoverItem.type != 3817) + else if (Main.HoverItem.type != 3817) { - strArray[index1] = Lang.tip[51].Value; - ++index1; - color1 = new Microsoft.Xna.Framework.Color((int) (byte) (120.0 * (double) num2), (int) (byte) (120.0 * (double) num2), (int) (byte) (120.0 * (double) num2), mouseTextColor); + lines[currentLine] = Lang.tip[51].Value; + ++currentLine; + color1 = new Microsoft.Xna.Framework.Color((int) (byte) (120.0 * (double) num18), (int) (byte) (120.0 * (double) num18), (int) (byte) (120.0 * (double) num18), mouseTextColor); } } Vector2 zero = Vector2.Zero; - int num10 = 0; - for (int index3 = 0; index3 < index1; ++index3) + int num25 = 0; + for (int index = 0; index < currentLine; ++index) { - Vector2 stringSize = ChatManager.GetStringSize(FontAssets.MouseText.Value, strArray[index3], Vector2.One); - if ((double) stringSize.X > (double) zero.X) - zero.X = stringSize.X; - zero.Y += stringSize.Y + (float) num10; + Vector2 vector2 = Main.fontMouseText.MeasureString(lines[index]); + if ((double) vector2.X > (double) zero.X) + zero.X = vector2.X; + zero.Y += vector2.Y + (float) num25; } - if (yoyoLogo != -1) - zero.Y += 24f; X += Main.toolTipDistance; Y += Main.toolTipDistance; - int num11 = 4; - if (boxBehindTooltips) + if ((double) X + (double) zero.X + 4.0 > (double) Main.screenWidth) + X = (int) ((double) Main.screenWidth - (double) zero.X - 4.0); + if ((double) Y + (double) zero.Y + 4.0 > (double) Main.screenHeight) + Y = (int) ((double) Main.screenHeight - (double) zero.Y - 4.0); + int num26 = 0; + double num27 = (double) Main.mouseTextColor / (double) byte.MaxValue; + for (int index3 = 0; index3 < currentLine; ++index3) { - X += 8; - Y += 2; - num11 = 18; - } - int screenWidth = Main.screenWidth; - int screenHeight = Main.screenHeight; - if ((double) X + (double) zero.X + (double) num11 > (double) screenWidth) - X = (int) ((double) screenWidth - (double) zero.X - (double) num11); - if ((double) Y + (double) zero.Y + (double) num11 > (double) screenHeight) - Y = (int) ((double) screenHeight - (double) zero.Y - (double) num11); - int num12 = 0; - float num13 = (float) Main.mouseTextColor / (float) byte.MaxValue; - if (boxBehindTooltips) - { - MathHelper.Lerp(num13, 1f, 1f); - int num14 = 14; - int num15 = 9; - Utils.DrawInvBG(Main.spriteBatch, new Microsoft.Xna.Framework.Rectangle(X - num14, Y - num15, (int) zero.X + num14 * 2, (int) zero.Y + num15 + num15 / 2), new Microsoft.Xna.Framework.Color(23, 25, 81, (int) byte.MaxValue) * 0.925f); - } - for (int index4 = 0; index4 < index1; ++index4) - { - if (index4 == yoyoLogo) + if (index3 == num1) { - float num16 = 1f; - int num17 = (int) ((double) Main.mouseTextColor * (double) num16); + float num28 = 1f; + int num29 = (int) ((double) Main.mouseTextColor * (double) num28); Microsoft.Xna.Framework.Color color2 = Microsoft.Xna.Framework.Color.Black; - for (int index5 = 0; index5 < 5; ++index5) + for (int index4 = 0; index4 < 5; ++index4) { - int num18 = X; - int num19 = Y + num12; - if (index5 == 4) - color2 = new Microsoft.Xna.Framework.Color(num17, num17, num17, num17); - if (index5 == 0) - --num18; - else if (index5 == 1) - ++num18; - else if (index5 == 2) - --num19; - else if (index5 == 3) - ++num19; - Main.spriteBatch.Draw(TextureAssets.OneDropLogo.Value, new Vector2((float) num18, (float) num19), new Microsoft.Xna.Framework.Rectangle?(), color2, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + int num30 = X; + int num31 = Y + num26; + if (index4 == 4) + color2 = new Microsoft.Xna.Framework.Color(num29, num29, num29, num29); + if (index4 == 0) + --num30; + else if (index4 == 1) + ++num30; + else if (index4 == 2) + --num31; + else if (index4 == 3) + ++num31; + Main.spriteBatch.Draw(Main.oneDropLogo, new Vector2((float) num30, (float) num31), new Microsoft.Xna.Framework.Rectangle?(), color2, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } } else { Microsoft.Xna.Framework.Color baseColor = Microsoft.Xna.Framework.Color.Black; - baseColor = new Microsoft.Xna.Framework.Color(num2, num2, num2, num2); - if (index4 == 0) + baseColor = new Microsoft.Xna.Framework.Color(num18, num18, num18, num18); + if (index3 == 0) { - if (rare == -13) - baseColor = new Microsoft.Xna.Framework.Color((int) (byte) ((double) byte.MaxValue * (double) num2), (int) (byte) ((double) Main.masterColor * 200.0 * (double) num2), 0, mouseTextColor); if (rare == -11) - baseColor = new Microsoft.Xna.Framework.Color((int) (byte) ((double) byte.MaxValue * (double) num2), (int) (byte) (175.0 * (double) num2), (int) (byte) (0.0 * (double) num2), mouseTextColor); + baseColor = new Microsoft.Xna.Framework.Color((int) (byte) ((double) byte.MaxValue * (double) num18), (int) (byte) (175.0 * (double) num18), (int) (byte) (0.0 * (double) num18), mouseTextColor); if (rare == -1) - baseColor = new Microsoft.Xna.Framework.Color((int) (byte) (130.0 * (double) num2), (int) (byte) (130.0 * (double) num2), (int) (byte) (130.0 * (double) num2), mouseTextColor); + baseColor = new Microsoft.Xna.Framework.Color((int) (byte) (130.0 * (double) num18), (int) (byte) (130.0 * (double) num18), (int) (byte) (130.0 * (double) num18), mouseTextColor); if (rare == 1) - baseColor = new Microsoft.Xna.Framework.Color((int) (byte) (150.0 * (double) num2), (int) (byte) (150.0 * (double) num2), (int) (byte) ((double) byte.MaxValue * (double) num2), mouseTextColor); + baseColor = new Microsoft.Xna.Framework.Color((int) (byte) (150.0 * (double) num18), (int) (byte) (150.0 * (double) num18), (int) (byte) ((double) byte.MaxValue * (double) num18), mouseTextColor); if (rare == 2) - baseColor = new Microsoft.Xna.Framework.Color((int) (byte) (150.0 * (double) num2), (int) (byte) ((double) byte.MaxValue * (double) num2), (int) (byte) (150.0 * (double) num2), mouseTextColor); + baseColor = new Microsoft.Xna.Framework.Color((int) (byte) (150.0 * (double) num18), (int) (byte) ((double) byte.MaxValue * (double) num18), (int) (byte) (150.0 * (double) num18), mouseTextColor); if (rare == 3) - baseColor = new Microsoft.Xna.Framework.Color((int) (byte) ((double) byte.MaxValue * (double) num2), (int) (byte) (200.0 * (double) num2), (int) (byte) (150.0 * (double) num2), mouseTextColor); + baseColor = new Microsoft.Xna.Framework.Color((int) (byte) ((double) byte.MaxValue * (double) num18), (int) (byte) (200.0 * (double) num18), (int) (byte) (150.0 * (double) num18), mouseTextColor); if (rare == 4) - baseColor = new Microsoft.Xna.Framework.Color((int) (byte) ((double) byte.MaxValue * (double) num2), (int) (byte) (150.0 * (double) num2), (int) (byte) (150.0 * (double) num2), mouseTextColor); + baseColor = new Microsoft.Xna.Framework.Color((int) (byte) ((double) byte.MaxValue * (double) num18), (int) (byte) (150.0 * (double) num18), (int) (byte) (150.0 * (double) num18), mouseTextColor); if (rare == 5) - baseColor = new Microsoft.Xna.Framework.Color((int) (byte) ((double) byte.MaxValue * (double) num2), (int) (byte) (150.0 * (double) num2), (int) (byte) ((double) byte.MaxValue * (double) num2), mouseTextColor); + baseColor = new Microsoft.Xna.Framework.Color((int) (byte) ((double) byte.MaxValue * (double) num18), (int) (byte) (150.0 * (double) num18), (int) (byte) ((double) byte.MaxValue * (double) num18), mouseTextColor); if (rare == 6) - baseColor = new Microsoft.Xna.Framework.Color((int) (byte) (210.0 * (double) num2), (int) (byte) (160.0 * (double) num2), (int) (byte) ((double) byte.MaxValue * (double) num2), mouseTextColor); + baseColor = new Microsoft.Xna.Framework.Color((int) (byte) (210.0 * (double) num18), (int) (byte) (160.0 * (double) num18), (int) (byte) ((double) byte.MaxValue * (double) num18), mouseTextColor); if (rare == 7) - baseColor = new Microsoft.Xna.Framework.Color((int) (byte) (150.0 * (double) num2), (int) (byte) ((double) byte.MaxValue * (double) num2), (int) (byte) (10.0 * (double) num2), mouseTextColor); + baseColor = new Microsoft.Xna.Framework.Color((int) (byte) (150.0 * (double) num18), (int) (byte) ((double) byte.MaxValue * (double) num18), (int) (byte) (10.0 * (double) num18), mouseTextColor); if (rare == 8) - baseColor = new Microsoft.Xna.Framework.Color((int) (byte) ((double) byte.MaxValue * (double) num2), (int) (byte) ((double) byte.MaxValue * (double) num2), (int) (byte) (10.0 * (double) num2), mouseTextColor); + baseColor = new Microsoft.Xna.Framework.Color((int) (byte) ((double) byte.MaxValue * (double) num18), (int) (byte) ((double) byte.MaxValue * (double) num18), (int) (byte) (10.0 * (double) num18), mouseTextColor); if (rare == 9) - baseColor = new Microsoft.Xna.Framework.Color((int) (byte) (5.0 * (double) num2), (int) (byte) (200.0 * (double) num2), (int) (byte) ((double) byte.MaxValue * (double) num2), mouseTextColor); + baseColor = new Microsoft.Xna.Framework.Color((int) (byte) (5.0 * (double) num18), (int) (byte) (200.0 * (double) num18), (int) (byte) ((double) byte.MaxValue * (double) num18), mouseTextColor); if (rare == 10) - baseColor = new Microsoft.Xna.Framework.Color((int) (byte) ((double) byte.MaxValue * (double) num2), (int) (byte) (40.0 * (double) num2), (int) (byte) (100.0 * (double) num2), mouseTextColor); + baseColor = new Microsoft.Xna.Framework.Color((int) (byte) ((double) byte.MaxValue * (double) num18), (int) (byte) (40.0 * (double) num18), (int) (byte) (100.0 * (double) num18), mouseTextColor); if (rare >= 11) - baseColor = new Microsoft.Xna.Framework.Color((int) (byte) (180.0 * (double) num2), (int) (byte) (40.0 * (double) num2), (int) (byte) ((double) byte.MaxValue * (double) num2), mouseTextColor); + baseColor = new Microsoft.Xna.Framework.Color((int) (byte) (180.0 * (double) num18), (int) (byte) (40.0 * (double) num18), (int) (byte) ((double) byte.MaxValue * (double) num18), mouseTextColor); if (diff == (byte) 1) - baseColor = new Microsoft.Xna.Framework.Color((int) (byte) ((double) Main.mcColor.R * (double) num2), (int) (byte) ((double) Main.mcColor.G * (double) num2), (int) (byte) ((double) Main.mcColor.B * (double) num2), mouseTextColor); + baseColor = new Microsoft.Xna.Framework.Color((int) (byte) ((double) Main.mcColor.R * (double) num18), (int) (byte) ((double) Main.mcColor.G * (double) num18), (int) (byte) ((double) Main.mcColor.B * (double) num18), mouseTextColor); if (diff == (byte) 2) - baseColor = new Microsoft.Xna.Framework.Color((int) (byte) ((double) Main.hcColor.R * (double) num2), (int) (byte) ((double) Main.hcColor.G * (double) num2), (int) (byte) ((double) Main.hcColor.B * (double) num2), mouseTextColor); - if (hoverItem.expert || rare == -12) - baseColor = new Microsoft.Xna.Framework.Color((int) (byte) ((double) Main.DiscoR * (double) num2), (int) (byte) ((double) Main.DiscoG * (double) num2), (int) (byte) ((double) Main.DiscoB * (double) num2), mouseTextColor); + baseColor = new Microsoft.Xna.Framework.Color((int) (byte) ((double) Main.hcColor.R * (double) num18), (int) (byte) ((double) Main.hcColor.G * (double) num18), (int) (byte) ((double) Main.hcColor.B * (double) num18), mouseTextColor); + if (Main.HoverItem.expert || rare == -12) + baseColor = new Microsoft.Xna.Framework.Color((int) (byte) ((double) Main.DiscoR * (double) num18), (int) (byte) ((double) Main.DiscoG * (double) num18), (int) (byte) ((double) Main.DiscoB * (double) num18), mouseTextColor); } - else if (preFixLine[index4]) - baseColor = !badPreFixLine[index4] ? new Microsoft.Xna.Framework.Color((int) (byte) (120.0 * (double) num2), (int) (byte) (190.0 * (double) num2), (int) (byte) (120.0 * (double) num2), mouseTextColor) : new Microsoft.Xna.Framework.Color((int) (byte) (190.0 * (double) num2), (int) (byte) (120.0 * (double) num2), (int) (byte) (120.0 * (double) num2), mouseTextColor); - else if (index4 == index1 - 1) + else if (flagArray1[index3]) + baseColor = !flagArray2[index3] ? new Microsoft.Xna.Framework.Color((int) (byte) (120.0 * (double) num18), (int) (byte) (190.0 * (double) num18), (int) (byte) (120.0 * (double) num18), mouseTextColor) : new Microsoft.Xna.Framework.Color((int) (byte) (190.0 * (double) num18), (int) (byte) (120.0 * (double) num18), (int) (byte) (120.0 * (double) num18), mouseTextColor); + else if (index3 == currentLine - 1) baseColor = color1; - if (index4 == researchLine) - baseColor = Colors.JourneyMode; - ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, FontAssets.MouseText.Value, strArray[index4], new Vector2((float) X, (float) (Y + num12)), baseColor, 0.0f, Vector2.Zero, Vector2.One); + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, Main.fontMouseText, lines[index3], new Vector2((float) X, (float) (Y + num26)), baseColor, 0.0f, Vector2.Zero, Vector2.One); } - num12 += (int) ((double) FontAssets.MouseText.Value.MeasureString(strArray[index4]).Y + (double) num10); + num26 += (int) ((double) Main.fontMouseText.MeasureString(lines[index3]).Y + (double) num25); } } - public static void MouseText_DrawItemTooltip_GetLinesInfo( - Item item, - ref int yoyoLogo, - ref int researchLine, - float oldKB, - ref int numLines, - string[] toolTipLine, - bool[] preFixLine, - bool[] badPreFixLine) - { - Item obj1 = item; - toolTipLine[0] = obj1.HoverName; - if (obj1.favorited) - { - toolTipLine[numLines++] = Lang.tip[56].Value; - toolTipLine[numLines++] = Lang.tip[57].Value; - if (Main.LocalPlayer.chest != -1) - { - Item[] chestinv; - ChestUI.GetContainerUsageInfo(out bool _, out chestinv); - if (ChestUI.IsBlockedFromTransferIntoChest(obj1, chestinv)) - toolTipLine[numLines++] = Language.GetTextValue("UI.ItemCannotBePlacedInsideItself"); - } - } - if (obj1.social) - { - toolTipLine[numLines] = Lang.tip[0].Value; - ++numLines; - toolTipLine[numLines] = Lang.tip[1].Value; - ++numLines; - } - else - { - if (obj1.damage > 0 && (!obj1.notAmmo || obj1.useStyle != 0) && (obj1.type < 71 || obj1.type > 74 || Main.player[Main.myPlayer].HasItem(905))) - { - float num1 = 5E-06f; - int num2 = (int) ((double) obj1.damage * (double) ItemID.Sets.ToolTipDamageMultiplier[obj1.type]); - if (obj1.melee) - { - toolTipLine[numLines] = string.Concat((object) (int) ((double) Main.player[Main.myPlayer].meleeDamage * (double) num2 + (double) num1)); - // ISSUE: explicit reference operation - ^ref toolTipLine[numLines] += Lang.tip[2].Value; - } - else if (obj1.ranged) - { - float num3 = (float) num2 * Main.player[Main.myPlayer].rangedDamage; - if (obj1.useAmmo == AmmoID.Arrow || obj1.useAmmo == AmmoID.Stake) - { - num3 *= Main.player[Main.myPlayer].arrowDamage; - if (Main.player[Main.myPlayer].archery) - num3 *= 1.2f; - } - if (obj1.useAmmo == AmmoID.Bullet || obj1.useAmmo == AmmoID.CandyCorn) - num3 *= Main.player[Main.myPlayer].bulletDamage; - if (obj1.useAmmo == AmmoID.Rocket || obj1.useAmmo == AmmoID.StyngerBolt || obj1.useAmmo == AmmoID.JackOLantern || obj1.useAmmo == AmmoID.NailFriendly) - num3 *= Main.player[Main.myPlayer].rocketDamage; - toolTipLine[numLines] = string.Concat((object) (int) ((double) num3 + (double) num1)); - // ISSUE: explicit reference operation - ^ref toolTipLine[numLines] += Lang.tip[3].Value; - } - else if (obj1.magic) - { - toolTipLine[numLines] = string.Concat((object) (int) ((double) Main.player[Main.myPlayer].magicDamage * (double) num2 + (double) num1)); - // ISSUE: explicit reference operation - ^ref toolTipLine[numLines] += Lang.tip[4].Value; - } - else if (obj1.summon) - { - toolTipLine[numLines] = string.Concat((object) (int) ((double) Main.player[Main.myPlayer].minionDamage * (double) num2 + (double) num1)); - // ISSUE: explicit reference operation - ^ref toolTipLine[numLines] += Lang.tip[53].Value; - } - else - { - toolTipLine[numLines] = string.Concat((object) num2); - // ISSUE: explicit reference operation - ^ref toolTipLine[numLines] += Lang.tip[55].Value; - } - ++numLines; - if (obj1.melee) - { - int num4 = Main.player[Main.myPlayer].meleeCrit - Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].crit + obj1.crit; - toolTipLine[numLines] = num4.ToString() + Lang.tip[5].Value; - ++numLines; - } - else if (obj1.ranged) - { - int num5 = Main.player[Main.myPlayer].rangedCrit - Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].crit + obj1.crit; - toolTipLine[numLines] = num5.ToString() + Lang.tip[5].Value; - ++numLines; - } - else if (obj1.magic) - { - int num6 = Main.player[Main.myPlayer].magicCrit - Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].crit + obj1.crit; - toolTipLine[numLines] = num6.ToString() + Lang.tip[5].Value; - ++numLines; - } - if (obj1.useStyle != 0 && !obj1.summon) - { - toolTipLine[numLines] = obj1.useAnimation > 8 ? (obj1.useAnimation > 20 ? (obj1.useAnimation > 25 ? (obj1.useAnimation > 30 ? (obj1.useAnimation > 35 ? (obj1.useAnimation > 45 ? (obj1.useAnimation > 55 ? Lang.tip[13].Value : Lang.tip[12].Value) : Lang.tip[11].Value) : Lang.tip[10].Value) : Lang.tip[9].Value) : Lang.tip[8].Value) : Lang.tip[7].Value) : Lang.tip[6].Value; - ++numLines; - } - float num7 = obj1.knockBack; - if (obj1.summon) - num7 += Main.player[Main.myPlayer].minionKB; - if (Main.player[Main.myPlayer].magicQuiver && obj1.useAmmo == AmmoID.Arrow || obj1.useAmmo == AmmoID.Stake) - num7 = (float) (int) ((double) num7 * 1.10000002384186); - if (Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type == 3106 && obj1.type == 3106) - num7 += num7 * (1f - Main.player[Main.myPlayer].stealth); - toolTipLine[numLines] = (double) num7 != 0.0 ? ((double) num7 > 1.5 ? ((double) num7 > 3.0 ? ((double) num7 > 4.0 ? ((double) num7 > 6.0 ? ((double) num7 > 7.0 ? ((double) num7 > 9.0 ? ((double) num7 > 11.0 ? Lang.tip[22].Value : Lang.tip[21].Value) : Lang.tip[20].Value) : Lang.tip[19].Value) : Lang.tip[18].Value) : Lang.tip[17].Value) : Lang.tip[16].Value) : Lang.tip[15].Value) : Lang.tip[14].Value; - ++numLines; - } - if (obj1.fishingPole > 0) - { - toolTipLine[numLines] = Language.GetTextValue("GameUI.PrecentFishingPower", (object) obj1.fishingPole); - ++numLines; - toolTipLine[numLines] = Language.GetTextValue("GameUI.BaitRequired"); - ++numLines; - } - if (obj1.bait > 0) - { - toolTipLine[numLines] = Language.GetTextValue("GameUI.BaitPower", (object) obj1.bait); - ++numLines; - } - if (obj1.headSlot > 0 || obj1.bodySlot > 0 || obj1.legSlot > 0 || obj1.accessory || Main.projHook[obj1.shoot] || obj1.mountType != -1 || obj1.buffType > 0 && (Main.lightPet[obj1.buffType] || Main.vanityPet[obj1.buffType])) - { - toolTipLine[numLines] = obj1.type != 854 && obj1.type != 3035 || Main.npcShop <= 0 ? Lang.tip[23].Value : Lang.tip[60].Value; - ++numLines; - } - if (obj1.tileWand > 0) - { - toolTipLine[numLines] = Lang.tip[52].Value + Lang.GetItemNameValue(obj1.tileWand); - ++numLines; - } - if (obj1.questItem) - { - toolTipLine[numLines] = Lang.inter[65].Value; - ++numLines; - } - if (obj1.vanity) - { - toolTipLine[numLines] = Lang.tip[24].Value; - ++numLines; - } - if (!obj1.vanity && obj1.FitsAccessoryVanitySlot) - { - toolTipLine[numLines] = Language.GetText("Misc.CanBePlacedInVanity").Value; - ++numLines; - } - if (obj1.defense > 0) - { - toolTipLine[numLines] = obj1.defense.ToString() + Lang.tip[25].Value; - ++numLines; - } - if (obj1.pick > 0) - { - toolTipLine[numLines] = obj1.pick.ToString() + Lang.tip[26].Value; - ++numLines; - } - if (obj1.axe > 0) - { - toolTipLine[numLines] = (obj1.axe * 5).ToString() + Lang.tip[27].Value; - ++numLines; - } - if (obj1.hammer > 0) - { - toolTipLine[numLines] = obj1.hammer.ToString() + Lang.tip[28].Value; - ++numLines; - } - if (obj1.tileBoost != 0) - { - int tileBoost = obj1.tileBoost; - toolTipLine[numLines] = tileBoost <= 0 ? tileBoost.ToString() + Lang.tip[54].Value : "+" + (object) tileBoost + Lang.tip[54].Value; - ++numLines; - } - if (obj1.healLife > 0) - { - toolTipLine[numLines] = Language.GetTextValue("CommonItemTooltip.RestoresLife", (object) obj1.healLife); - ++numLines; - } - if (obj1.healMana > 0) - { - toolTipLine[numLines] = Language.GetTextValue("CommonItemTooltip.RestoresMana", (object) obj1.healMana); - ++numLines; - } - if (obj1.mana > 0 && (obj1.type != (int) sbyte.MaxValue || !Main.player[Main.myPlayer].spaceGun)) - { - toolTipLine[numLines] = Language.GetTextValue("CommonItemTooltip.UsesMana", (object) (int) ((double) obj1.mana * (double) Main.player[Main.myPlayer].manaCost)); - ++numLines; - } - if (obj1.createWall > 0 || obj1.createTile > -1) - { - if (obj1.type != 213 && obj1.tileWand < 1) - { - toolTipLine[numLines] = Lang.tip[33].Value; - ++numLines; - } - } - else if (obj1.ammo > 0 && !obj1.notAmmo) - { - toolTipLine[numLines] = Lang.tip[34].Value; - ++numLines; - } - else if (obj1.consumable) - { - toolTipLine[numLines] = Lang.tip[35].Value; - ++numLines; - } - if (obj1.material) - { - toolTipLine[numLines] = Lang.tip[36].Value; - ++numLines; - } - if (obj1.ToolTip != null) - { - for (int line = 0; line < obj1.ToolTip.Lines; ++line) - { - if (line == 0 && ItemID.Sets.UsesCursedByPlanteraTooltip[obj1.type] && !NPC.downedPlantBoss) - { - toolTipLine[numLines] = Lang.tip[59].Value; - ++numLines; - } - else - { - toolTipLine[numLines] = obj1.ToolTip.GetLine(line); - ++numLines; - } - } - } - if ((obj1.type == 3818 || obj1.type == 3819 || obj1.type == 3820 || obj1.type == 3824 || obj1.type == 3825 || obj1.type == 3826 || obj1.type == 3829 || obj1.type == 3830 || obj1.type == 3831 || obj1.type == 3832 || obj1.type == 3833 || obj1.type == 3834) && !Main.player[Main.myPlayer].downedDD2EventAnyDifficulty) - { - toolTipLine[numLines] = Lang.misc[104].Value; - ++numLines; - } - if (obj1.buffType > 0 && BuffID.Sets.IsWellFed[obj1.buffType] && Main.expertMode) - { - toolTipLine[numLines] = Lang.misc[40].Value; - ++numLines; - } - if (obj1.buffTime > 0) - { - string str = obj1.buffTime / 60 < 60 ? Language.GetTextValue("CommonItemTooltip.SecondDuration", (object) Math.Round((double) obj1.buffTime / 60.0)) : Language.GetTextValue("CommonItemTooltip.MinuteDuration", (object) Math.Round((double) (obj1.buffTime / 60) / 60.0)); - toolTipLine[numLines] = str; - ++numLines; - } - if (obj1.type == 3262 || obj1.type == 3282 || obj1.type == 3283 || obj1.type == 3284 || obj1.type == 3285 || obj1.type == 3286 || obj1.type == 3316 || obj1.type == 3315 || obj1.type == 3317 || obj1.type == 3291 || obj1.type == 3389) - { - toolTipLine[numLines] = " "; - yoyoLogo = numLines; - ++numLines; - } - if (obj1.prefix > (byte) 0) - { - Item obj2 = Main.tooltipPrefixComparisonItem; - if (obj2 == null || obj2.netID != obj1.netID) - { - obj2 = new Item(); - obj2.netDefaults(obj1.netID); - } - if (obj2.damage != obj1.damage) - { - double num = Math.Round(((double) obj1.damage - (double) obj2.damage) / (double) obj2.damage * 100.0); - toolTipLine[numLines] = num <= 0.0 ? num.ToString() + Lang.tip[39].Value : "+" + (object) num + Lang.tip[39].Value; - if (num < 0.0) - badPreFixLine[numLines] = true; - preFixLine[numLines] = true; - ++numLines; - } - if (obj2.useAnimation != obj1.useAnimation) - { - double num = Math.Round(((double) obj1.useAnimation - (double) obj2.useAnimation) / (double) obj2.useAnimation * 100.0) * -1.0; - toolTipLine[numLines] = num <= 0.0 ? num.ToString() + Lang.tip[40].Value : "+" + (object) num + Lang.tip[40].Value; - if (num < 0.0) - badPreFixLine[numLines] = true; - preFixLine[numLines] = true; - ++numLines; - } - if (obj2.crit != obj1.crit) - { - double num = (double) obj1.crit - (double) obj2.crit; - toolTipLine[numLines] = num <= 0.0 ? num.ToString() + Lang.tip[41].Value : "+" + (object) num + Lang.tip[41].Value; - if (num < 0.0) - badPreFixLine[numLines] = true; - preFixLine[numLines] = true; - ++numLines; - } - if (obj2.mana != obj1.mana) - { - double num = Math.Round(((double) obj1.mana - (double) obj2.mana) / (double) obj2.mana * 100.0); - toolTipLine[numLines] = num <= 0.0 ? num.ToString() + Lang.tip[42].Value : "+" + (object) num + Lang.tip[42].Value; - if (num > 0.0) - badPreFixLine[numLines] = true; - preFixLine[numLines] = true; - ++numLines; - } - if ((double) obj2.scale != (double) obj1.scale) - { - double num = Math.Round(((double) obj1.scale - (double) obj2.scale) / (double) obj2.scale * 100.0); - toolTipLine[numLines] = num <= 0.0 ? num.ToString() + Lang.tip[43].Value : "+" + (object) num + Lang.tip[43].Value; - if (num < 0.0) - badPreFixLine[numLines] = true; - preFixLine[numLines] = true; - ++numLines; - } - if ((double) obj2.shootSpeed != (double) obj1.shootSpeed) - { - double num = Math.Round(((double) obj1.shootSpeed - (double) obj2.shootSpeed) / (double) obj2.shootSpeed * 100.0); - toolTipLine[numLines] = num <= 0.0 ? num.ToString() + Lang.tip[44].Value : "+" + (object) num + Lang.tip[44].Value; - if (num < 0.0) - badPreFixLine[numLines] = true; - preFixLine[numLines] = true; - ++numLines; - } - if ((double) obj2.knockBack != (double) oldKB) - { - double num = Math.Round(((double) oldKB - (double) obj2.knockBack) / (double) obj2.knockBack * 100.0); - toolTipLine[numLines] = num <= 0.0 ? num.ToString() + Lang.tip[45].Value : "+" + (object) num + Lang.tip[45].Value; - if (num < 0.0) - badPreFixLine[numLines] = true; - preFixLine[numLines] = true; - ++numLines; - } - if (obj1.prefix == (byte) 62) - { - toolTipLine[numLines] = "+1" + Lang.tip[25].Value; - preFixLine[numLines] = true; - ++numLines; - } - if (obj1.prefix == (byte) 63) - { - toolTipLine[numLines] = "+2" + Lang.tip[25].Value; - preFixLine[numLines] = true; - ++numLines; - } - if (obj1.prefix == (byte) 64) - { - toolTipLine[numLines] = "+3" + Lang.tip[25].Value; - preFixLine[numLines] = true; - ++numLines; - } - if (obj1.prefix == (byte) 65) - { - toolTipLine[numLines] = "+4" + Lang.tip[25].Value; - preFixLine[numLines] = true; - ++numLines; - } - if (obj1.prefix == (byte) 66) - { - toolTipLine[numLines] = "+20 " + Lang.tip[31].Value; - preFixLine[numLines] = true; - ++numLines; - } - if (obj1.prefix == (byte) 67) - { - toolTipLine[numLines] = "+2" + Lang.tip[5].Value; - preFixLine[numLines] = true; - ++numLines; - } - if (obj1.prefix == (byte) 68) - { - toolTipLine[numLines] = "+4" + Lang.tip[5].Value; - preFixLine[numLines] = true; - ++numLines; - } - if (obj1.prefix == (byte) 69) - { - toolTipLine[numLines] = "+1" + Lang.tip[39].Value; - preFixLine[numLines] = true; - ++numLines; - } - if (obj1.prefix == (byte) 70) - { - toolTipLine[numLines] = "+2" + Lang.tip[39].Value; - preFixLine[numLines] = true; - ++numLines; - } - if (obj1.prefix == (byte) 71) - { - toolTipLine[numLines] = "+3" + Lang.tip[39].Value; - preFixLine[numLines] = true; - ++numLines; - } - if (obj1.prefix == (byte) 72) - { - toolTipLine[numLines] = "+4" + Lang.tip[39].Value; - preFixLine[numLines] = true; - ++numLines; - } - if (obj1.prefix == (byte) 73) - { - toolTipLine[numLines] = "+1" + Lang.tip[46].Value; - preFixLine[numLines] = true; - ++numLines; - } - if (obj1.prefix == (byte) 74) - { - toolTipLine[numLines] = "+2" + Lang.tip[46].Value; - preFixLine[numLines] = true; - ++numLines; - } - if (obj1.prefix == (byte) 75) - { - toolTipLine[numLines] = "+3" + Lang.tip[46].Value; - preFixLine[numLines] = true; - ++numLines; - } - if (obj1.prefix == (byte) 76) - { - toolTipLine[numLines] = "+4" + Lang.tip[46].Value; - preFixLine[numLines] = true; - ++numLines; - } - if (obj1.prefix == (byte) 77) - { - toolTipLine[numLines] = "+1" + Lang.tip[47].Value; - preFixLine[numLines] = true; - ++numLines; - } - if (obj1.prefix == (byte) 78) - { - toolTipLine[numLines] = "+2" + Lang.tip[47].Value; - preFixLine[numLines] = true; - ++numLines; - } - if (obj1.prefix == (byte) 79) - { - toolTipLine[numLines] = "+3" + Lang.tip[47].Value; - preFixLine[numLines] = true; - ++numLines; - } - if (obj1.prefix == (byte) 80) - { - toolTipLine[numLines] = "+4" + Lang.tip[47].Value; - preFixLine[numLines] = true; - ++numLines; - } - } - if (obj1.wornArmor && Main.player[Main.myPlayer].setBonus != "") - { - toolTipLine[numLines] = Lang.tip[48].Value + " " + Main.player[Main.myPlayer].setBonus; - ++numLines; - } - } - if (obj1.expert) - { - toolTipLine[numLines] = Language.GetTextValue("GameUI.Expert"); - ++numLines; - } - if (obj1.rare == -13) - { - toolTipLine[numLines] = Language.GetTextValue("GameUI.Master"); - ++numLines; - } - int amountNeeded; - if ((obj1.tooltipContext == 0 || obj1.tooltipContext == 2 || obj1.tooltipContext == 1 || obj1.tooltipContext == 3 || obj1.tooltipContext == 4 || obj1.tooltipContext == 15 ? 1 : (obj1.tooltipContext == 6 ? 1 : 0)) != 0 && Main.LocalPlayer.difficulty == (byte) 3 && CreativeItemSacrificesCatalog.Instance.TryGetSacrificeCountCapToUnlockInfiniteItems(obj1.type, out amountNeeded)) - { - int sacrificeCount = Main.LocalPlayerCreativeTracker.ItemSacrifices.GetSacrificeCount(obj1.type); - if (amountNeeded - sacrificeCount > 0) - { - toolTipLine[numLines] = Language.GetTextValue("CommonItemTooltip.CreativeSacrificeNeeded", (object) (amountNeeded - sacrificeCount)); - researchLine = numLines; - ++numLines; - } - } - string bestiaryNotes = obj1.BestiaryNotes; - if (string.IsNullOrWhiteSpace(bestiaryNotes)) - return; - string str1 = bestiaryNotes; - char[] chArray = new char[1]{ '\n' }; - foreach (string str2 in str1.Split(chArray)) - toolTipLine[numLines++] = str2; - } - - private void MouseText_DrawBuffTooltip(string buffString, ref int X, ref int Y) + private void MouseText_DrawBuffString(ref int X, ref int Y) { Microsoft.Xna.Framework.Point p = new Microsoft.Xna.Framework.Point(X, Y); int num1 = 220; - int num2 = 72; - int num3 = -1; - float num4 = 1f; + int num2 = -1; + float num3 = 1f / Main.UIScale; List vector2List = new List(); - Vector2 vector2_1 = FontAssets.MouseText.Value.MeasureString(buffString); + Vector2 vector2_1 = Main.fontMouseText.MeasureString(Main.buffString); vector2List.Add(vector2_1); - int num5 = (int) ((double) (Main.screenHeight - Y - 24 - num2) * (double) num4) / 20; - if (num5 < 1) - num5 = 1; + int num4 = (int) ((double) (Main.screenHeight - 250) * (double) num3) / 20; + if (num4 < 1) + num4 = 1; if (Main.bannerMouseOver) { - int num6 = 0; - for (int index1 = 0; index1 < 289; ++index1) + int num5 = 0; + for (int i = 0; i < 267; ++i) { - if (Item.BannerToNPC(index1) != 0 && Main.player[Main.myPlayer].HasNPCBannerBuff(index1)) + if (Item.BannerToNPC(i) != 0 && Main.player[Main.myPlayer].NPCBannerBuff[i]) { - ++num6; - string npcNameValue = Lang.GetNPCNameValue(Item.BannerToNPC(index1)); - Vector2 vector2_2 = FontAssets.MouseText.Value.MeasureString(npcNameValue); - int num7 = X; - int num8 = Y + (int) vector2_2.Y + num6 * 20 + 10; - int num9 = 0; - int num10 = num6 / num5; - for (int index2 = 0; index2 < num10; ++index2) + ++num5; + string npcNameValue = Lang.GetNPCNameValue(Item.BannerToNPC(i)); + Vector2 vector2_2 = Main.fontMouseText.MeasureString(npcNameValue); + int num6 = X; + int num7 = Y + (int) vector2_2.Y + num5 * 20 + 10; + int num8 = 0; + int num9 = (num5 - 1) / num4; + for (int index = 0; index < num9; ++index) { - ++num9; - num7 += num1; - num8 -= num5 * 20; + ++num8; + num6 += num1; + num7 -= num4 * 20; } - if ((double) (num7 - 24 - num1) > (double) Main.screenWidth * (double) num4) - { - num3 = num6; - break; - } - vector2List.Add(new Vector2((float) num7, (float) num8) + vector2_2 - p.ToVector2()); + if ((double) num6 + (double) vector2_2.X > (double) Main.screenWidth * (double) num3 && num2 == -1) + num2 = num5; + vector2List.Add(new Vector2((float) (num6 - num1 * num8), (float) num7) + vector2_2 - p.ToVector2()); } } } @@ -14963,70 +13034,72 @@ label_56: if ((double) zero.Y < (double) vector2_3.Y) zero.Y = vector2_3.Y; } - if ((double) X + (double) zero.X + 24.0 > (double) Main.screenWidth * (double) num4) - X = (int) ((double) Main.screenWidth * (double) num4 - (double) zero.X - 24.0); - if ((double) Y + (double) zero.Y + 4.0 > (double) Main.screenHeight * (double) num4) - Y = (int) ((double) Main.screenHeight * (double) num4 - (double) zero.Y - 4.0); + if ((double) X + (double) zero.X + 24.0 > (double) Main.screenWidth * (double) num3) + X = (int) ((double) Main.screenWidth * (double) num3 - (double) zero.X - 24.0); + if ((double) Y + (double) zero.Y + 4.0 > (double) Main.screenHeight * (double) num3) + Y = (int) ((double) Main.screenHeight * (double) num3 - (double) zero.Y - 4.0); + if (num2 != -1) + --num2; for (int index = 0; index < 5; ++index) { - int num11 = X; - int num12 = Y + (int) FontAssets.MouseText.Value.MeasureString(buffString).Y; + int num10 = X; + int num11 = Y + (int) Main.fontMouseText.MeasureString(Main.buffString).Y; Microsoft.Xna.Framework.Color color = Microsoft.Xna.Framework.Color.Black; if (index == 0) - num11 -= 2; + num10 -= 2; else if (index == 1) - num11 += 2; + num10 += 2; else if (index == 2) - num12 -= 2; + num11 -= 2; else if (index == 3) - num12 += 2; + num11 += 2; else color = new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor); - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, buffString, new Vector2((float) num11, (float) num12), color, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, Main.buffString, new Vector2((float) num10, (float) num11), color, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } if (!Main.bannerMouseOver) return; - int num13 = 0; - for (int index3 = 0; index3 < 289; ++index3) + int num12 = 0; + for (int i = 0; i < 267; ++i) { - if (Item.BannerToNPC(index3) != 0 && Main.player[Main.myPlayer].HasNPCBannerBuff(index3)) + if (Item.BannerToNPC(i) != 0 && Main.player[Main.myPlayer].NPCBannerBuff[i]) { - ++num13; + ++num12; bool flag = false; - for (int index4 = 0; index4 < 5; ++index4) + for (int index = 0; index < 5; ++index) { - int num14 = X; - int num15 = Y + (int) vector2_1.Y + num13 * 20 + 10; - int num16 = (num13 - 1) / num5; - int num17 = num14 + num1 * num16; - int num18 = num15 - num5 * 20 * num16; - string str = Lang.GetNPCNameValue(Item.BannerToNPC(index3)); - if (num3 == num13) + int num13 = X; + int num14 = Y + (int) vector2_1.Y + num12 * 20 + 10; + int num15 = (num12 - 1) / num4; + int num16 = num13 + num1 * num15; + int num17 = num14 - num4 * 20 * num15; + string str = Lang.GetNPCNameValue(Item.BannerToNPC(i)); + if (num2 == num12) { str = Language.GetTextValue("UI.Ellipsis"); flag = true; } Microsoft.Xna.Framework.Color color = Microsoft.Xna.Framework.Color.Black; - switch (index4) + switch (index) { case 0: - num17 -= 2; + num16 -= 2; break; case 1: - num17 += 2; + num16 += 2; break; case 2: - num18 -= 2; + num17 -= 2; break; case 3: - num18 += 2; + num17 += 2; break; default: - float num19 = (float) Main.mouseTextColor / (float) byte.MaxValue; - color = new Microsoft.Xna.Framework.Color((int) (byte) (80.0 * (double) num19), (int) (byte) ((double) byte.MaxValue * (double) num19), (int) (byte) (120.0 * (double) num19), (int) Main.mouseTextColor); + float num18 = (float) Main.mouseTextColor / (float) byte.MaxValue; + color = new Microsoft.Xna.Framework.Color((int) (byte) (80.0 * (double) num18), (int) (byte) ((double) byte.MaxValue * (double) num18), (int) (byte) (120.0 * (double) num18), (int) Main.mouseTextColor); break; } - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, str, new Vector2((float) num17, (float) num18), color, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str, new Vector2((float) num16, (float) num17), color, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } if (flag) break; @@ -15036,6 +13109,7 @@ label_56: protected void DrawFPS() { + Main.DrawGamepadInstructions(); if (!Main.showFrameRate) return; string str = string.Concat((object) Main.frameRate) + " (" + (object) (Terraria.Liquid.numLiquid + LiquidBuffer.numLiquidBuffer) + ")" + " (" + (object) (int) ((double) Main.gfxQuality * 100.0) + "%)" + " " + Main.debugWords; @@ -15044,10 +13118,10 @@ label_56: num = Main.screenHeight - 24; Vector2 vector2_1 = new Vector2(4f, (float) num); Vector2 vector2_2 = new Vector2(0.0f, 0.0f); - Vector2 vector2_3 = FontAssets.MouseText.Value.MeasureString(str); + Vector2 vector2_3 = Main.fontMouseText.MeasureString(str); if (PlayerInput.UsingGamepad && !Main.gameMenu) vector2_1.X = (float) (Main.screenWidth - 4) - vector2_3.X; - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, str, vector2_1, new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor), 0.0f, vector2_2, 1f, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str, vector2_1, new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor), 0.0f, vector2_2, 1f, SpriteEffects.None, 0.0f); } public static void DrawGamepadInstructions() @@ -15062,10 +13136,10 @@ label_56: Vector2 baseScale = new Vector2(num2); if (Main.gameMenu) num1 = 55f; - Vector2 stringSize = ChatManager.GetStringSize(FontAssets.MouseText.Value, text, new Vector2(1f)); + Vector2 stringSize = ChatManager.GetStringSize(Main.fontMouseText, text, new Vector2(1f)); float t2 = num2; Utils.Swap(ref GlyphTagHandler.GlyphsScale, ref t2); - ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, FontAssets.MouseText.Value, text, new Vector2(12f, (float) Main.screenHeight - num1) - stringSize * new Vector2(0.0f, 0.0f), Microsoft.Xna.Framework.Color.White, 0.0f, Vector2.Zero, baseScale, spread: (num2 * 2f)); + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, Main.fontMouseText, text, new Vector2(12f, (float) Main.screenHeight - num1) - stringSize * new Vector2(0.0f, 0.0f), Microsoft.Xna.Framework.Color.White, 0.0f, Vector2.Zero, baseScale, spread: (num2 * 2f)); Utils.Swap(ref GlyphTagHandler.GlyphsScale, ref t2); } @@ -15158,120 +13232,3820 @@ label_56: return new Microsoft.Xna.Framework.Color((int) (byte) num1, (int) (byte) num3, (int) (byte) num4, (int) newColor.A); } - public static void shine(ref Vector3 newColor, int type) + public static bool canDrawColorTree(int i, int j, int treeColor) => Main.tile[i, j] != null && Main.tile[i, j].color() > (byte) 0 && (int) Main.tile[i, j].color() < Main.numTileColors && Main.woodAltTexture[treeColor, (int) Main.tile[i, j].color()] != null && !Main.woodAltTexture[treeColor, (int) Main.tile[i, j].color()].IsContentLost; + + public static bool canDrawColorTile(int i, int j) => Main.tile[i, j] != null && Main.tile[i, j].color() > (byte) 0 && (int) Main.tile[i, j].color() < Main.numTileColors && Main.tileAltTextureDrawn[(int) Main.tile[i, j].type, (int) Main.tile[i, j].color()] && Main.tileAltTextureInit[(int) Main.tile[i, j].type, (int) Main.tile[i, j].color()]; + + public static bool canDrawColorTile(ushort type, int color) => color > 0 && color < Main.numTileColors && Main.tileAltTextureDrawn[(int) type, color] && Main.tileAltTextureInit[(int) type, color]; + + public static bool canDrawColorWall(int i, int j) => Main.tile[i, j] != null && Main.tile[i, j].wallColor() > (byte) 0 && Main.wallAltTextureDrawn[(int) Main.tile[i, j].wall, (int) Main.tile[i, j].wallColor()] && Main.wallAltTextureInit[(int) Main.tile[i, j].wall, (int) Main.tile[i, j].wallColor()]; + + protected void DrawTiles(bool solidOnly = true, int waterStyleOverride = -1) { - float num1 = 0.6f; - switch (type) + if (!solidOnly) + Main.critterCage = false; + Stopwatch stopwatch = new Stopwatch(); + stopwatch.Start(); + int num1 = (int) ((double) byte.MaxValue * (1.0 - (double) Main.gfxQuality) + 30.0 * (double) Main.gfxQuality); + int num2 = (int) (50.0 * (1.0 - (double) Main.gfxQuality) + 2.0 * (double) Main.gfxQuality); + Vector2 vector2_1 = new Vector2((float) Main.offScreenRange, (float) Main.offScreenRange); + if (Main.drawToScreen) + vector2_1 = Vector2.Zero; + int index1 = 0; + int length = Main.specX.Length; + int startX = (int) (((double) Main.screenPosition.X - (double) vector2_1.X) / 16.0 - 1.0); + int endX = (int) (((double) Main.screenPosition.X + (double) Main.screenWidth + (double) vector2_1.X) / 16.0) + 2; + int startY = (int) (((double) Main.screenPosition.Y - (double) vector2_1.Y) / 16.0 - 1.0); + int endY = (int) (((double) Main.screenPosition.Y + (double) Main.screenHeight + (double) vector2_1.Y) / 16.0) + 5; + if (startX < 4) + startX = 4; + if (endX > Main.maxTilesX - 4) + endX = Main.maxTilesX - 4; + if (startY < 4) + startY = 4; + if (endY > Main.maxTilesY - 4) + endY = Main.maxTilesY - 4; + if (Main.sectionManager.FrameSectionsLeft > 0) { - case 25: - newColor.X *= 0.95f; - newColor.Y *= 0.85f; - newColor.Z *= 1.1f; - break; - case 117: - newColor.X *= 1.1f; - newColor.Z *= 1.2f; - break; - case 147: - case 161: - newColor.X *= 1.1f; - newColor.Y *= 1.12f; - newColor.Z *= 1.15f; - break; - case 163: - newColor.X *= 1.05f; - newColor.Y *= 1.1f; - newColor.Z *= 1.15f; - break; - case 164: - newColor.X *= 1.1f; - newColor.Y *= 1.1f; - newColor.Z *= 1.2f; - break; - case 178: - float num2 = 0.5f; - newColor.X *= 1f + num2; - newColor.Y *= 1f + num2; - newColor.Z *= 1f + num2; - break; - case 185: - case 186: - float num3 = 0.3f; - newColor.X *= 1f + num3; - newColor.Y *= 1f + num3; - newColor.Z *= 1f + num3; - break; - case 204: - float num4 = (float) (0.300000011920929 + (double) Main.mouseTextColor / 300.0); - newColor.X *= 1.3f * num4; - break; - case 211: - float num5 = (float) (0.300000011920929 + (double) Main.mouseTextColor / 300.0); - newColor.Y *= 1.5f * num5; - newColor.Z *= 1.1f * num5; - break; - case 262: - case 263: - case 264: - case 265: - case 266: - case 267: - case 268: - newColor.X += 0.39f; - newColor.Y += 0.39f; - newColor.Z += 0.39f; - break; - default: - newColor.X *= 1f + num1; - newColor.Y *= 1f + num1; - newColor.Z *= 1f + num1; - break; + TimeLogger.DetailedDrawReset(); + WorldGen.SectionTileFrameWithCheck(startX, startY, endX, endY); + TimeLogger.DetailedDrawTime(5); } + Dictionary dictionary1 = new Dictionary(); + Dictionary dictionary2 = new Dictionary(); + Dictionary dictionary3 = new Dictionary(); + int team = Main.player[Main.myPlayer].team; + if (Main.player[Main.myPlayer].active) + { + int netMode = Main.netMode; + } + int width1 = 16; + Microsoft.Xna.Framework.Color[] slices = new Microsoft.Xna.Framework.Color[9]; + for (int index2 = startY; index2 < endY + 4; ++index2) + { + for (int index3 = startX - 2; index3 < endX + 2; ++index3) + { + Tile trackTile = Main.tile[index3, index2]; + if (trackTile == null) + { + trackTile = new Tile(); + Main.tile[index3, index2] = trackTile; + Main.mapTime += 60; + } + ushort type = trackTile.type; + short num3 = trackTile.frameX; + short num4 = trackTile.frameY; + bool flag1 = Main.tileSolid[(int) type]; + if (type == (ushort) 11) + flag1 = true; + if (trackTile.active() && flag1 == solidOnly) + { + if (!Main.tileSetsLoaded[(int) type]) + this.LoadTiles((int) type); + SpriteEffects effects = SpriteEffects.None; + switch (type) + { + case 3: + case 13: + case 20: + case 24: + case 49: + case 50: + case 52: + case 61: + case 62: + case 71: + case 73: + case 74: + case 81: + case 82: + case 83: + case 84: + case 91: + case 92: + case 93: + case 110: + case 113: + case 115: + case 135: + case 141: + case 165: + case 174: + case 201: + case 205: + case 227: + case 270: + case 271: + case 372: + case 382: + if (index3 % 2 == 1) + { + effects = SpriteEffects.FlipHorizontally; + break; + } + break; + case 184: + if (num4 < (short) 108) + { + if (index3 % 2 == 1) + { + effects = SpriteEffects.FlipHorizontally; + break; + } + break; + } + if (index2 % 2 == 1) + { + effects = SpriteEffects.FlipVertically; + break; + } + break; + case 185: + if (num4 == (short) 0 && index3 % 2 == 1) + { + effects = SpriteEffects.FlipHorizontally; + break; + } + break; + } + Microsoft.Xna.Framework.Color color1 = Lighting.GetColor(index3, index2); + int num5 = 0; + int height1 = 16; + if (type >= (ushort) 330 && type <= (ushort) 333) + num5 += 2; + if (type == (ushort) 4 && WorldGen.SolidTile(index3, index2 - 1)) + { + num5 = 2; + if (WorldGen.SolidTile(index3 - 1, index2 + 1) || WorldGen.SolidTile(index3 + 1, index2 + 1)) + num5 = 4; + } + if (type == (ushort) 336) + num5 = 2; + if (type == (ushort) 457) + num5 = 2; + if (type == (ushort) 466) + num5 = 2; + if (type >= (ushort) 275 && type <= (ushort) 282 || type == (ushort) 414 || type == (ushort) 413) + num5 = 2; + if (type == (ushort) 285 || type == (ushort) 286 || type == (ushort) 298 || type == (ushort) 299 || type == (ushort) 309 || type == (ushort) 358 || type == (ushort) 359 || type == (ushort) 360 || type == (ushort) 361 || type == (ushort) 362 || type == (ushort) 363 || type == (ushort) 364 || type == (ushort) 391 || type == (ushort) 392 || type == (ushort) 393 || type == (ushort) 394 || type == (ushort) 310) + num5 = 2; + if (type == (ushort) 100 || type == (ushort) 173 || type == (ushort) 283) + num5 = 2; + if (type == (ushort) 78 || type == (ushort) 85 || type == (ushort) 210 || type == (ushort) 133 || type == (ushort) 134 || type == (ushort) 233) + num5 = 2; + if (type == (ushort) 33 || type == (ushort) 49 || type == (ushort) 174 || type == (ushort) 372) + num5 = -4; + if (type == (ushort) 3 || type == (ushort) 4 || type == (ushort) 5 || type == (ushort) 24 || type == (ushort) 33 || type == (ushort) 49 || type == (ushort) 372 || type == (ushort) 61 || type == (ushort) 71 || type == (ushort) 110 || type == (ushort) 174 || type == (ushort) 201 || type == (ushort) 323 || type == (ushort) 324) + height1 = 20; + else if (type == (ushort) 16 || type == (ushort) 17 || type == (ushort) 18 || type == (ushort) 20 || type == (ushort) 26 || type == (ushort) 32 || type == (ushort) 352 || type == (ushort) 69 || type == (ushort) 72 || type == (ushort) 77 || type == (ushort) 79 || type == (ushort) 80) + height1 = 18; + else if (type == (ushort) 14 || type == (ushort) 469 || type == (ushort) 15 || type == (ushort) 21 || type == (ushort) 467 || type == (ushort) 411 || type == (ushort) 441 || type == (ushort) 468) + { + if (num4 == (short) 18) + height1 = 18; + } + else if (type == (ushort) 172 || type == (ushort) 376) + { + if ((int) num4 % 38 == 18) + height1 = 18; + } + else + { + switch (type) + { + case 27: + if ((int) num4 % 74 == 54) + { + height1 = 18; + break; + } + break; + case 132: + num5 = 2; + height1 = 18; + break; + case 135: + num5 = 2; + height1 = 18; + break; + case 137: + height1 = 18; + break; + case 254: + num5 = 2; + break; + case 378: + num5 = 2; + break; + case 405: + height1 = 16; + if (num4 > (short) 0) + { + height1 = 18; + break; + } + break; + case 406: + height1 = 16; + if ((int) num4 % 54 >= 36) + { + height1 = 18; + break; + } + break; + case 462: + height1 = 18; + break; + default: + height1 = 16; + break; + } + } + if (type == (ushort) 52) + num5 -= 2; + if (type == (ushort) 324) + num5 = -2; + if (type == (ushort) 231 || type == (ushort) 238) + num5 += 2; + if (type == (ushort) 207) + num5 = 2; + width1 = type == (ushort) 4 || type == (ushort) 5 || type == (ushort) 323 || type == (ushort) 324 ? 20 : 16; + if (type == (ushort) 73 || type == (ushort) 74 || type == (ushort) 113) + { + num5 -= 12; + height1 = 32; + } + if (type == (ushort) 388 || type == (ushort) 389) + { + int num6 = TileObjectData.GetTileData((int) type, (int) num3 / 18).Height * 18 + 4; + num5 = -2; + if ((int) num4 == num6 - 20 || (int) num4 == num6 * 2 - 20 || num4 == (short) 0 || (int) num4 == num6) + height1 = 18; + } + if (type == (ushort) 410 && num4 == (short) 36) + height1 = 18; + if (type == (ushort) 227) + { + width1 = 32; + height1 = 38; + if (num3 == (short) 238) + num5 -= 6; + else + num5 -= 20; + } + if (type == (ushort) 185 || type == (ushort) 186 || type == (ushort) 187) + { + num5 = 2; + switch (type) + { + case 185: + Main.tileShine2[185] = num4 == (short) 18 && num3 >= (short) 576 && num3 <= (short) 882; + break; + case 186: + Main.tileShine2[186] = num3 >= (short) 864 && num3 <= (short) 1170; + break; + } + } + if (type == (ushort) 178 && num4 <= (short) 36) + num5 = 2; + if (type == (ushort) 184) + { + width1 = 20; + if (num4 <= (short) 36) + num5 = 2; + else if (num4 <= (short) 108) + num5 = -2; + } + if (type == (ushort) 28) + num5 += 2; + if (type == (ushort) 81) + { + num5 -= 8; + height1 = 26; + width1 = 24; + } + if (type == (ushort) 105) + num5 = 2; + if (type == (ushort) 124) + height1 = 18; + if (type == (ushort) 137) + height1 = 18; + if (type == (ushort) 138) + height1 = 18; + if (type == (ushort) 139 || type == (ushort) 142 || type == (ushort) 143) + num5 = 2; + int num7 = 0; + if (trackTile.halfBrick()) + num7 = 8; + int y1 = Main.tileFrame[(int) type] * 38; + int num8 = 0; + if (type == (ushort) 272) + y1 = 0; + if (type == (ushort) 106) + y1 = Main.tileFrame[(int) type] * 54; + if (type >= (ushort) 300 && type <= (ushort) 308) + { + y1 = Main.tileFrame[(int) type] * 54; + num5 = 2; + } + if (type == (ushort) 354) + { + y1 = Main.tileFrame[(int) type] * 54; + num5 = 2; + } + if (type == (ushort) 355) + { + y1 = Main.tileFrame[(int) type] * 54; + num5 = 2; + } + if (type == (ushort) 377) + { + y1 = Main.tileFrame[(int) type] * 38; + num5 = 2; + } + if (type == (ushort) 463) + { + y1 = Main.tileFrame[(int) type] * 72; + num5 = 2; + } + if (type == (ushort) 464) + { + y1 = Main.tileFrame[(int) type] * 72; + num5 = 2; + } + if (type == (ushort) 379) + y1 = Main.tileFrame[(int) type] * 90; + if (type == (ushort) 349) + { + int num9 = (int) num3 % 36; + int num10 = (int) num4 % 54; + int frameData; + if (Animation.GetTemporaryFrame(index3 - num9 / 18, index2 - num10 / 18, out frameData)) + num3 = (short) (36 * frameData + num9); + } + if (type == (ushort) 441 || type == (ushort) 468) + { + int num11 = (int) num3 % 36; + int num12 = (int) num4 % 38; + int frameData; + if (Animation.GetTemporaryFrame(index3 - num11 / 18, index2 - num12 / 18, out frameData)) + num4 = (short) (38 * frameData + num12); + } + if (type == (ushort) 390) + y1 = Main.tileFrame[(int) type] * 36; + if (type == (ushort) 412) + { + y1 = 0; + num5 = 2; + } + if (type == (ushort) 455) + { + y1 = 0; + num5 = 2; + } + if (type == (ushort) 406) + { + int num13 = Main.tileFrame[(int) type]; + if (num4 >= (short) 108) + num13 = 6 - (int) num4 / 54; + else if (num4 >= (short) 54) + num13 = Main.tileFrame[(int) type] - 1; + y1 = num13 * 56 + (int) num4 / 54 * 2; + } + if (type == (ushort) 452) + { + int num14 = Main.tileFrame[(int) type]; + if (num3 >= (short) 54) + num14 = 0; + y1 = num14 * 54; + } + if (type == (ushort) 455) + { + int num15 = 1 + Main.tileFrame[(int) type]; + if (!BirthdayParty.PartyIsUp) + num15 = 0; + y1 = num15 * 54; + } + if (type == (ushort) 454) + y1 = Main.tileFrame[(int) type] * 54; + if (type == (ushort) 453) + y1 = (Main.tileFrameCounter[(int) type] / 20 + (index2 - (int) trackTile.frameY / 18 + index3)) % 3 * 54; + if (type == (ushort) 456) + y1 = (Main.tileFrameCounter[(int) type] / 20 + (index2 - (int) trackTile.frameY / 18 + (index3 - (int) trackTile.frameX / 18))) % 4 * 54; + if (type == (ushort) 405) + { + int num16 = Main.tileFrame[(int) type]; + if (num3 >= (short) 54) + num16 = 0; + y1 = num16 * 38; + } + if (type == (ushort) 12) + y1 = Main.tileFrame[(int) type] * 36; + if (type == (ushort) 96) + y1 = Main.tileFrame[(int) type] * 36; + if (type == (ushort) 238) + y1 = Main.tileFrame[(int) type] * 36; + if (type == (ushort) 31) + y1 = Main.tileFrame[(int) type] * 36; + if (type == (ushort) 215) + { + y1 = num4 >= (short) 36 ? 252 : Main.tileFrame[(int) type] * 36; + num5 = 2; + } + if (type == (ushort) 231) + { + y1 = Main.tileFrame[(int) type] * 54; + num5 = 2; + } + if (type == (ushort) 243) + { + y1 = Main.tileFrame[(int) type] * 54; + num5 = 2; + } + if (type == (ushort) 247) + { + y1 = Main.tileFrame[(int) type] * 54; + num5 = 2; + } + if (type == (ushort) 228) + { + y1 = Main.tileFrame[(int) type] * 54; + num5 = 2; + } + if (type == (ushort) 244) + { + num5 = 2; + y1 = num3 >= (short) 54 ? 0 : Main.tileFrame[(int) type] * 36; + } + if (type == (ushort) 235) + y1 = Main.tileFrame[(int) type] * 18; + if (type == (ushort) 217 || type == (ushort) 218) + { + y1 = Main.tileFrame[(int) type] * 36; + num5 = 2; + } + if (type == (ushort) 219 || type == (ushort) 220) + { + y1 = Main.tileFrame[(int) type] * 54; + num5 = 2; + } + if (type == (ushort) 270 || type == (ushort) 271) + { + int num17 = Main.tileFrame[(int) type] + index3 % 6; + if (index3 % 2 == 0) + num17 += 3; + if (index3 % 3 == 0) + num17 += 3; + if (index3 % 4 == 0) + num17 += 3; + while (num17 > 5) + num17 -= 6; + num8 = num17 * 18; + y1 = 0; + } + switch (type) + { + case 428: + num5 += 4; + if (PressurePlateHelper.PressurePlatesPressed.ContainsKey(new Microsoft.Xna.Framework.Point(index3, index2))) + { + num8 += 18; + break; + } + break; + case 442: + width1 = 20; + height1 = 20; + switch ((int) num3 / 22) + { + case 1: + num5 = -4; + break; + case 2: + num5 = -2; + width1 = 24; + break; + case 3: + num5 = -2; + width1 = 16; + break; + } + break; + } + if (TileID.Sets.TeamTiles[(int) type]) + { + if (TileID.Sets.Platforms[(int) type]) + y1 = y1; + else + y1 += 90; + } + if (type == (ushort) 373 || type == (ushort) 374 || type == (ushort) 375 || type == (ushort) 461) + { + int num18 = 60; + switch (type) + { + case 374: + num18 = 120; + break; + case 375: + num18 = 180; + break; + } + if (Main.rand.Next(num18 * 2) == 0 && trackTile.liquid == (byte) 0) + { + Microsoft.Xna.Framework.Rectangle rectangle1 = new Microsoft.Xna.Framework.Rectangle(index3 * 16, index2 * 16, 16, 16); + rectangle1.X -= 34; + rectangle1.Width += 68; + rectangle1.Y -= 100; + rectangle1.Height = 400; + bool flag2 = true; + for (int index4 = 0; index4 < 500; ++index4) + { + if (Main.gore[index4].active && (Main.gore[index4].type >= 706 && Main.gore[index4].type <= 717 || Main.gore[index4].type == 943)) + { + Microsoft.Xna.Framework.Rectangle rectangle2 = new Microsoft.Xna.Framework.Rectangle((int) Main.gore[index4].position.X, (int) Main.gore[index4].position.Y, 16, 16); + if (rectangle1.Intersects(rectangle2)) + flag2 = false; + } + } + if (flag2) + { + Vector2 Position = new Vector2((float) (index3 * 16), (float) (index2 * 16)); + int Type = 706; + if (Main.waterStyle > 1) + Type = 706 + Main.waterStyle - 1; + if (type == (ushort) 374) + Type = 716; + if (type == (ushort) 375) + Type = 717; + if (type == (ushort) 461) + Type = 943; + if (Type != 943 || Main.rand.Next(3) == 0) + { + int index5 = Gore.NewGore(Position, new Vector2(), Type); + Main.gore[index5].velocity *= 0.0f; + } + } + } + } + else + { + if (type >= (ushort) 275 && type <= (ushort) 281 || type == (ushort) 296 || type == (ushort) 297 || type == (ushort) 309 || type == (ushort) 358 || type == (ushort) 359 || type == (ushort) 414 || type == (ushort) 413) + { + Main.critterCage = true; + int index6 = (index3 - (int) num3 / 18) / 6 * ((index2 - (int) num4 / 18) / 4) % Main.cageFrames; + if (type == (ushort) 275 || type == (ushort) 359) + y1 = Main.bunnyCageFrame[index6] * 54; + if (type == (ushort) 276 || type == (ushort) 414) + y1 = Main.squirrelCageFrame[index6] * 54; + if (type == (ushort) 413) + y1 = Main.squirrelCageFrameOrange[index6] * 54; + if (type == (ushort) 277) + y1 = Main.mallardCageFrame[index6] * 54; + if (type == (ushort) 278) + y1 = Main.duckCageFrame[index6] * 54; + if (type == (ushort) 279 || type == (ushort) 358) + y1 = Main.birdCageFrame[index6] * 54; + if (type == (ushort) 280) + y1 = Main.blueBirdCageFrame[index6] * 54; + if (type == (ushort) 281) + y1 = Main.redBirdCageFrame[index6] * 54; + if (type == (ushort) 296) + y1 = Main.scorpionCageFrame[0, index6] * 54; + if (type == (ushort) 297) + y1 = Main.scorpionCageFrame[0, index6] * 54; + if (type == (ushort) 309) + y1 = Main.penguinCageFrame[index6] * 54; + } + else if (type == (ushort) 285 || type == (ushort) 286 || type == (ushort) 298 || type == (ushort) 299 || type == (ushort) 310 || type == (ushort) 339 || type >= (ushort) 361 && type <= (ushort) 364 || type >= (ushort) 391 && type <= (ushort) 394) + { + Main.critterCage = true; + int index7 = (index3 - (int) num3 / 18) / 3 * ((index2 - (int) num4 / 18) / 3) % Main.cageFrames; + if (type == (ushort) 285) + y1 = Main.snailCageFrame[index7] * 36; + if (type == (ushort) 286) + y1 = Main.snail2CageFrame[index7] * 36; + if (type == (ushort) 298 || type == (ushort) 361) + y1 = Main.frogCageFrame[index7] * 36; + if (type == (ushort) 299 || type == (ushort) 363) + y1 = Main.mouseCageFrame[index7] * 36; + if (type == (ushort) 310 || type == (ushort) 364 || type == (ushort) 391) + y1 = Main.wormCageFrame[index7] * 36; + if (type == (ushort) 339 || type == (ushort) 362) + y1 = Main.grasshopperCageFrame[index7] * 36; + if (type == (ushort) 392 || type == (ushort) 393 || type == (ushort) 394) + y1 = Main.slugCageFrame[(int) type - 392, index7] * 36; + } + else if (type == (ushort) 282 || type >= (ushort) 288 && type <= (ushort) 295 || type >= (ushort) 316 && type <= (ushort) 318 || type == (ushort) 360) + { + Main.critterCage = true; + int index8 = (index3 - (int) num3 / 18) / 2 * ((index2 - (int) num4 / 18) / 3) % Main.cageFrames; + if (type == (ushort) 282) + y1 = Main.fishBowlFrame[index8] * 36; + else if (type >= (ushort) 288 && type <= (ushort) 295 || type == (ushort) 360) + { + int index9 = (int) type - 288; + if (type == (ushort) 360) + index9 = 8; + y1 = Main.butterflyCageFrame[index9, index8] * 36; + } + else if (type >= (ushort) 316 && type <= (ushort) 318) + { + int index10 = (int) type - 316; + y1 = Main.jellyfishCageFrame[index10, index8] * 36; + } + } + else + { + switch (type) + { + case 207: + if (num4 >= (short) 72) + { + int num19 = Main.tileFrame[(int) type]; + int num20 = index3; + if ((int) num3 % 36 != 0) + --num20; + int num21 = num19 + num20 % 6; + if (num21 >= 6) + num21 -= 6; + y1 = num21 * 72; + break; + } + y1 = 0; + break; + case 410: + y1 = num4 < (short) 56 ? 0 : Main.tileFrame[(int) type] * 56; + break; + default: + if (type == (ushort) 326 || type == (ushort) 327 || type == (ushort) 328 || type == (ushort) 329 || type == (ushort) 336 || type == (ushort) 340 || type == (ushort) 341 || type == (ushort) 342 || type == (ushort) 343 || type == (ushort) 344 || type == (ushort) 345 || type == (ushort) 351 || type == (ushort) 421 || type == (ushort) 422 || type == (ushort) 458 || type == (ushort) 459) + { + y1 = Main.tileFrame[(int) type] * 90; + break; + } + break; + } + } + Texture2D texture1 = (Texture2D) null; + Microsoft.Xna.Framework.Rectangle rectangle3 = Microsoft.Xna.Framework.Rectangle.Empty; + Microsoft.Xna.Framework.Color color2 = Microsoft.Xna.Framework.Color.Transparent; + byte num22 = (byte) (100.0 + 150.0 * (double) Main.martianLight); + Microsoft.Xna.Framework.Color color3 = new Microsoft.Xna.Framework.Color((int) num22, (int) num22, (int) num22, 0); + Microsoft.Xna.Framework.Color color4 = new Microsoft.Xna.Framework.Color(100, 100, 100, 0); + Microsoft.Xna.Framework.Color color5 = new Microsoft.Xna.Framework.Color(150, 100, 50, 0); + if (type <= (ushort) 93) + { + if (type <= (ushort) 34) + { + switch ((int) type - 10) + { + case 0: + if ((int) num4 / 54 == 32) + { + texture1 = Main.glowMaskTexture[57]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4 % 54, width1, height1); + color2 = color3; + goto label_397; + } + else + goto label_397; + case 1: + int num23 = (int) num4 / 54; + if (num23 == 32) + { + texture1 = Main.glowMaskTexture[58]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4 % 54, width1, height1); + color2 = color3; + } + if (num23 == 33) + { + texture1 = Main.glowMaskTexture[119]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4 % 54, width1, height1); + color2 = color4; + goto label_397; + } + else + goto label_397; + case 2: + case 3: + case 6: + case 7: + case 10: + goto label_397; + case 4: + int num24 = (int) num3 / 54; + if (num24 == 31) + { + texture1 = Main.glowMaskTexture[67]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3 % 54, (int) num4, width1, height1); + color2 = color3; + } + if (num24 == 32) + { + texture1 = Main.glowMaskTexture[124]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3 % 54, (int) num4, width1, height1); + color2 = color4; + goto label_397; + } + else + goto label_397; + case 5: + int num25 = (int) num4 / 40; + if (num25 == 32) + { + texture1 = Main.glowMaskTexture[54]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4 % 40, width1, height1); + color2 = color3; + } + if (num25 == 33) + { + texture1 = Main.glowMaskTexture[116]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4 % 40, width1, height1); + color2 = color4; + goto label_397; + } + else + goto label_397; + case 8: + int num26 = (int) num3 / 36; + if (num26 == 27) + { + texture1 = Main.glowMaskTexture[69]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3 % 36, (int) num4, width1, height1); + color2 = color3; + } + if (num26 == 28) + { + texture1 = Main.glowMaskTexture[125]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3 % 36, (int) num4, width1, height1); + color2 = color4; + goto label_397; + } + else + goto label_397; + case 9: + int num27 = (int) num4 / 18; + if (num27 == 26) + { + texture1 = Main.glowMaskTexture[65]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4 % 18, width1, height1); + color2 = color3; + } + if (num27 == 27) + { + texture1 = Main.glowMaskTexture[112]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4 % 18, width1, height1); + color2 = color4; + goto label_397; + } + else + goto label_397; + case 11: + break; + default: + if (type != (ushort) 33) + { + if (type == (ushort) 34 && (int) num3 / 54 == 0 && (int) num4 / 54 == 33) + { + texture1 = Main.glowMaskTexture[55]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4 % 54, width1, height1); + color2 = color3; + goto label_397; + } + else + goto label_397; + } + else if ((int) num3 / 18 == 0 && (int) num4 / 22 == 26) + { + texture1 = Main.glowMaskTexture[61]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4 % 22, width1, height1); + color2 = color3; + goto label_397; + } + else + goto label_397; + } + } + else if (type != (ushort) 42) + { + if (type != (ushort) 79) + { + switch ((int) type - 87) + { + case 0: + int num28 = (int) num3 / 54; + if (num28 == 26) + { + texture1 = Main.glowMaskTexture[64]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3 % 54, (int) num4, width1, height1); + color2 = color3; + } + if (num28 == 27) + { + texture1 = Main.glowMaskTexture[121]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3 % 54, (int) num4, width1, height1); + color2 = color4; + goto label_397; + } + else + goto label_397; + case 1: + int num29 = (int) num3 / 54; + if (num29 == 24) + { + texture1 = Main.glowMaskTexture[59]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3 % 54, (int) num4, width1, height1); + color2 = color3; + } + if (num29 == 25) + { + texture1 = Main.glowMaskTexture[120]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3 % 54, (int) num4, width1, height1); + color2 = color4; + goto label_397; + } + else + goto label_397; + case 2: + int num30 = (int) num3 / 54; + if (num30 == 29) + { + texture1 = Main.glowMaskTexture[66]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3 % 54, (int) num4, width1, height1); + color2 = color3; + } + if (num30 == 30) + { + texture1 = Main.glowMaskTexture[123]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3 % 54, (int) num4, width1, height1); + color2 = color4; + goto label_397; + } + else + goto label_397; + case 3: + int num31 = (int) num4 / 36; + if (num31 == 27) + { + texture1 = Main.glowMaskTexture[52]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4 % 36, width1, height1); + color2 = color3; + } + if (num31 == 28) + { + texture1 = Main.glowMaskTexture[113]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4 % 36, width1, height1); + color2 = color4; + goto label_397; + } + else + goto label_397; + case 6: + if ((int) num3 / 54 == 27) + { + texture1 = Main.glowMaskTexture[62]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4 % 54, width1, height1); + color2 = color3; + goto label_397; + } + else + goto label_397; + default: + goto label_397; + } + } + else + { + int num32 = (int) num4 / 36; + if (num32 == 27) + { + texture1 = Main.glowMaskTexture[53]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4 % 36, width1, height1); + color2 = color3; + } + if (num32 == 28) + { + texture1 = Main.glowMaskTexture[114]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4 % 36, width1, height1); + color2 = color4; + goto label_397; + } + else + goto label_397; + } + } + else if ((int) num4 / 36 == 33) + { + texture1 = Main.glowMaskTexture[63]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4 % 36, width1, height1); + color2 = color3; + goto label_397; + } + else + goto label_397; + } + else if (type <= (ushort) 184) + { + switch ((int) type - 100) + { + case 0: + if ((int) num3 / 36 == 0 && (int) num4 / 36 == 27) + { + texture1 = Main.glowMaskTexture[68]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4 % 36, width1, height1); + color2 = color3; + goto label_397; + } + else + goto label_397; + case 1: + int num33 = (int) num3 / 54; + if (num33 == 28) + { + texture1 = Main.glowMaskTexture[60]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3 % 54, (int) num4, width1, height1); + color2 = color3; + } + if (num33 == 29) + { + texture1 = Main.glowMaskTexture[115]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3 % 54, (int) num4, width1, height1); + color2 = color4; + goto label_397; + } + else + goto label_397; + case 2: + case 3: + goto label_397; + case 4: + int num34 = (int) num3 / 36; + if (num34 == 24) + { + texture1 = Main.glowMaskTexture[51]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3 % 36, (int) num4, width1, height1); + color2 = color3; + } + if (num34 == 25) + { + texture1 = Main.glowMaskTexture[118]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3 % 36, (int) num4, width1, height1); + color2 = color4; + goto label_397; + } + else + goto label_397; + default: + if (type != (ushort) 172) + { + if (type == (ushort) 184 && trackTile.frameX == (short) 110) + { + texture1 = Main.glowMaskTexture[(int) sbyte.MaxValue]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1); + color2 = color5; + goto label_397; + } + else + goto label_397; + } + else + { + int num35 = (int) num4 / 38; + if (num35 == 28) + { + texture1 = Main.glowMaskTexture[88]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4 % 38, width1, height1); + color2 = color3; + } + if (num35 == 29) + { + texture1 = Main.glowMaskTexture[122]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4 % 38, width1, height1); + color2 = color4; + goto label_397; + } + else + goto label_397; + } + } + } + else + { + if (type <= (ushort) 463) + { + if (type != (ushort) 441) + { + if (type == (ushort) 463) + { + texture1 = Main.glowMaskTexture[243]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4 + y1, width1, height1); + color2 = new Microsoft.Xna.Framework.Color((int) sbyte.MaxValue, (int) sbyte.MaxValue, (int) sbyte.MaxValue, 0); + goto label_397; + } + else + goto label_397; + } + } + else if (type != (ushort) 467) + { + if (type != (ushort) 468) + goto label_397; + } + else + goto label_351; + int num36 = (int) num3 / 36; + if (num36 == 48) + { + texture1 = Main.glowMaskTexture[56]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3 % 36, (int) num4, width1, height1); + color2 = color3; + } + if (num36 == 49) + { + texture1 = Main.glowMaskTexture[117]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3 % 36, (int) num4, width1, height1); + color2 = color4; + goto label_397; + } + else + goto label_397; + } +label_351: + int num37 = (int) num3 / 36; + if (num37 == 48) + { + texture1 = Main.glowMaskTexture[56]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3 % 36, (int) num4, width1, height1); + color2 = color3; + } + if (num37 == 49) + { + texture1 = Main.glowMaskTexture[117]; + rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) num3 % 36, (int) num4, width1, height1); + color2 = color4; + } +label_397: + Texture2D texture2 = (Texture2D) null; + Microsoft.Xna.Framework.Rectangle rectangle4 = Microsoft.Xna.Framework.Rectangle.Empty; + Microsoft.Xna.Framework.Color color6 = Microsoft.Xna.Framework.Color.Transparent; + if (TileID.Sets.HasOutlines[(int) type] && Collision.InTileBounds(index3, index2, Main.TileInteractionLX, Main.TileInteractionLY, Main.TileInteractionHX, Main.TileInteractionHY) && Main.SmartInteractTileCoords.Contains(new Microsoft.Xna.Framework.Point(index3, index2))) + { + int num38 = ((int) color1.R + (int) color1.G + (int) color1.B) / 3; + bool flag3 = false; + if (Main.SmartInteractTileCoordsSelected.Contains(new Microsoft.Xna.Framework.Point(index3, index2))) + flag3 = true; + if (num38 > 10) + { + texture2 = Main.highlightMaskTexture[(int) type]; + color6 = !flag3 ? new Microsoft.Xna.Framework.Color(num38 / 2, num38 / 2, num38 / 2, num38) : new Microsoft.Xna.Framework.Color(num38, num38, num38 / 3, num38); + } + } + if (Main.player[Main.myPlayer].dangerSense) + { + bool flag4 = type == (ushort) 135 || type == (ushort) 137 || type == (ushort) 138 || type == (ushort) 141 || type == (ushort) 210 || type == (ushort) 442 || type == (ushort) 443 || type == (ushort) 444; + if (trackTile.slope() == (byte) 0 && !trackTile.inActive()) + { + flag4 = flag4 || type == (ushort) 32 || type == (ushort) 69 || type == (ushort) 48 || type == (ushort) 232 || type == (ushort) 352 || type == (ushort) 51 || type == (ushort) 229; + if (!Main.player[Main.myPlayer].fireWalk) + flag4 = flag4 || type == (ushort) 37 || type == (ushort) 58 || type == (ushort) 76; + if (!Main.player[Main.myPlayer].iceSkate) + flag4 = flag4 || type == (ushort) 162; + } + if (flag4) + { + if (color1.R < byte.MaxValue) + color1.R = byte.MaxValue; + if (color1.G < (byte) 50) + color1.G = (byte) 50; + if (color1.B < (byte) 50) + color1.B = (byte) 50; + color1.A = Main.mouseTextColor; + if (!Main.gamePaused && this.IsActive && Main.rand.Next(30) == 0) + { + int index11 = Dust.NewDust(new Vector2((float) (index3 * 16), (float) (index2 * 16)), 16, 16, 60, Alpha: 100, Scale: 0.3f); + Main.dust[index11].fadeIn = 1f; + Main.dust[index11].velocity *= 0.1f; + Main.dust[index11].noLight = true; + Main.dust[index11].noGravity = true; + } + } + } + if (Main.player[Main.myPlayer].findTreasure) + { + bool flag5 = false; + if (type == (ushort) 185 && num4 == (short) 18 && num3 >= (short) 576 && num3 <= (short) 882) + flag5 = true; + if (type == (ushort) 186 && num3 >= (short) 864 && num3 <= (short) 1170) + flag5 = true; + if (flag5 || Main.tileSpelunker[(int) type] || Main.tileAlch[(int) type] && type != (ushort) 82) + { + byte num39 = 200; + byte num40 = 170; + if ((int) color1.R < (int) num39) + color1.R = num39; + if ((int) color1.G < (int) num40) + color1.G = num40; + color1.A = Main.mouseTextColor; + if (!Main.gamePaused && this.IsActive && Main.rand.Next(60) == 0) + { + int index12 = Dust.NewDust(new Vector2((float) (index3 * 16), (float) (index2 * 16)), 16, 16, 204, Alpha: 150, Scale: 0.3f); + Main.dust[index12].fadeIn = 1f; + Main.dust[index12].velocity *= 0.1f; + Main.dust[index12].noLight = true; + } + } + } + if (!Main.gamePaused && this.IsActive && (!Lighting.UpdateEveryFrame || Main.rand.Next(4) == 0)) + { + switch (type) + { + case 238: + if (Main.rand.Next(10) == 0) + { + int index13 = Dust.NewDust(new Vector2((float) (index3 * 16), (float) (index2 * 16)), 16, 16, 168); + Main.dust[index13].noGravity = true; + Main.dust[index13].alpha = 200; + break; + } + break; + case 463: + if (num4 == (short) 54 && num3 == (short) 0) + { + for (int index14 = 0; index14 < 4; ++index14) + { + if (Main.rand.Next(2) != 0) + { + Dust dust = Dust.NewDustDirect(new Vector2((float) (index3 * 16 + 4), (float) (index2 * 16)), 36, 8, 16); + dust.noGravity = true; + dust.alpha = 140; + dust.fadeIn = 1.2f; + dust.velocity = Vector2.Zero; + } + } + } + if (num4 == (short) 18 && (num3 == (short) 0 || num3 == (short) 36)) + { + for (int index15 = 0; index15 < 1; ++index15) + { + if (Main.rand.Next(13) == 0) + { + Dust dust = Dust.NewDustDirect(new Vector2((float) (index3 * 16), (float) (index2 * 16)), 8, 8, 274); + dust.position = new Vector2((float) (index3 * 16 + 8), (float) (index2 * 16 + 8)); + dust.position.X += num3 == (short) 36 ? 4f : -4f; + dust.noGravity = true; + dust.alpha = 128; + dust.fadeIn = 1.2f; + dust.noLight = true; + dust.velocity = new Vector2(0.0f, Main.rand.NextFloatDirection() * 1.2f); + } + } + break; + } + break; + } + if (type == (ushort) 139 && trackTile.frameX == (short) 36 && (int) trackTile.frameY % 36 == 0 && (int) Main.time % 7 == 0 && Main.rand.Next(3) == 0) + { + int Type = Main.rand.Next(570, 573); + Vector2 Position = new Vector2((float) (index3 * 16 + 8), (float) (index2 * 16 - 8)); + Vector2 Velocity = new Vector2(Main.windSpeed * 2f, -0.5f); + Velocity.X *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); + Velocity.Y *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); + if (Type == 572) + Position.X -= 8f; + if (Type == 571) + Position.X -= 4f; + Gore.NewGore(Position, Velocity, Type, 0.8f); + } + if (type == (ushort) 244 && num3 == (short) 18 && num4 == (short) 18 && Main.rand.Next(2) == 0) + { + if (Main.rand.Next(500) == 0) + Gore.NewGore(new Vector2((float) (index3 * 16 + 8), (float) (index2 * 16 + 8)), new Vector2(), 415, (float) Main.rand.Next(51, 101) * 0.01f); + else if (Main.rand.Next(250) == 0) + Gore.NewGore(new Vector2((float) (index3 * 16 + 8), (float) (index2 * 16 + 8)), new Vector2(), 414, (float) Main.rand.Next(51, 101) * 0.01f); + else if (Main.rand.Next(80) == 0) + Gore.NewGore(new Vector2((float) (index3 * 16 + 8), (float) (index2 * 16 + 8)), new Vector2(), 413, (float) Main.rand.Next(51, 101) * 0.01f); + else if (Main.rand.Next(10) == 0) + Gore.NewGore(new Vector2((float) (index3 * 16 + 8), (float) (index2 * 16 + 8)), new Vector2(), 412, (float) Main.rand.Next(51, 101) * 0.01f); + else if (Main.rand.Next(3) == 0) + Gore.NewGore(new Vector2((float) (index3 * 16 + 8), (float) (index2 * 16 + 8)), new Vector2(), 411, (float) Main.rand.Next(51, 101) * 0.01f); + } + if (type == (ushort) 165 && num3 >= (short) 162 && num3 <= (short) 214 && num4 == (short) 72 && Main.rand.Next(60) == 0) + { + int index16 = Dust.NewDust(new Vector2((float) (index3 * 16 + 2), (float) (index2 * 16 + 6)), 8, 4, 153); + Main.dust[index16].scale -= (float) Main.rand.Next(3) * 0.1f; + Main.dust[index16].velocity.Y = 0.0f; + Main.dust[index16].velocity.X *= 0.05f; + Main.dust[index16].alpha = 100; + } + if (type == (ushort) 42 && num3 == (short) 0) + { + int num41 = (int) num4 / 36; + int num42 = (int) num4 / 18 % 2; + if (num41 == 7 && num42 == 1) + { + if (Main.rand.Next(50) == 0) + { + int index17 = Dust.NewDust(new Vector2((float) (index3 * 16 + 4), (float) (index2 * 16 + 4)), 8, 8, 58, Alpha: 150); + Main.dust[index17].velocity *= 0.5f; + } + if (Main.rand.Next(100) == 0) + { + int index18 = Gore.NewGore(new Vector2((float) (index3 * 16 - 2), (float) (index2 * 16 - 4)), new Vector2(), Main.rand.Next(16, 18)); + Main.gore[index18].scale *= 0.7f; + Main.gore[index18].velocity *= 0.25f; + } + } + else if (num41 == 29 && num42 == 1 && Main.rand.Next(40) == 0) + { + int index19 = Dust.NewDust(new Vector2((float) (index3 * 16 + 4), (float) (index2 * 16)), 8, 8, 59, Alpha: 100); + if (Main.rand.Next(3) != 0) + Main.dust[index19].noGravity = true; + Main.dust[index19].velocity *= 0.3f; + Main.dust[index19].velocity.Y -= 1.5f; + } + } + if (type == (ushort) 215 && num4 < (short) 36 && Main.rand.Next(3) == 0 && (Main.drawToScreen && Main.rand.Next(4) == 0 || !Main.drawToScreen) && num4 == (short) 0) + { + int index20 = Dust.NewDust(new Vector2((float) (index3 * 16 + 2), (float) (index2 * 16 - 4)), 4, 8, 31, Alpha: 100); + if (num3 == (short) 0) + Main.dust[index20].position.X += (float) Main.rand.Next(8); + if (num3 == (short) 36) + Main.dust[index20].position.X -= (float) Main.rand.Next(8); + Main.dust[index20].alpha += Main.rand.Next(100); + Main.dust[index20].velocity *= 0.2f; + Main.dust[index20].velocity.Y -= (float) (0.5 + (double) Main.rand.Next(10) * 0.100000001490116); + Main.dust[index20].fadeIn = (float) (0.5 + (double) Main.rand.Next(10) * 0.100000001490116); + } + if (type == (ushort) 4 && Main.rand.Next(40) == 0 && num3 < (short) 66) + { + int num43 = (int) num4 / 22; + int Type; + switch (num43) + { + case 0: + Type = 6; + break; + case 8: + Type = 75; + break; + case 9: + Type = 135; + break; + case 10: + Type = 158; + break; + case 11: + Type = 169; + break; + case 12: + Type = 156; + break; + case 13: + Type = 234; + break; + case 14: + Type = 66; + break; + default: + Type = 58 + num43; + break; + } + int index21; + switch (num3) + { + case 22: + index21 = Dust.NewDust(new Vector2((float) (index3 * 16 + 6), (float) (index2 * 16)), 4, 4, Type, Alpha: 100); + break; + case 44: + index21 = Dust.NewDust(new Vector2((float) (index3 * 16 + 2), (float) (index2 * 16)), 4, 4, Type, Alpha: 100); + break; + default: + index21 = Dust.NewDust(new Vector2((float) (index3 * 16 + 4), (float) (index2 * 16)), 4, 4, Type, Alpha: 100); + break; + } + if (Main.rand.Next(3) != 0) + Main.dust[index21].noGravity = true; + Main.dust[index21].velocity *= 0.3f; + Main.dust[index21].velocity.Y -= 1.5f; + if (Type == 66) + { + Main.dust[index21].color = new Microsoft.Xna.Framework.Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); + Main.dust[index21].noGravity = true; + } + } + if (type == (ushort) 93 && Main.rand.Next(40) == 0 && num3 == (short) 0) + { + int num44 = (int) num4 / 54; + if ((int) num4 / 18 % 3 == 0) + { + int Type; + switch (num44) + { + case 0: + case 6: + case 7: + case 8: + case 10: + case 14: + case 15: + case 16: + Type = 6; + break; + case 20: + Type = 59; + break; + default: + Type = -1; + break; + } + if (Type != -1) + { + int index22 = Dust.NewDust(new Vector2((float) (index3 * 16 + 4), (float) (index2 * 16 + 2)), 4, 4, Type, Alpha: 100); + if (Main.rand.Next(3) != 0) + Main.dust[index22].noGravity = true; + Main.dust[index22].velocity *= 0.3f; + Main.dust[index22].velocity.Y -= 1.5f; + } + } + } + if (type == (ushort) 100 && Main.rand.Next(40) == 0 && num3 < (short) 36) + { + int num45 = (int) num4 / 36; + if ((int) num4 / 18 % 2 == 0) + { + int Type; + switch (num45) + { + case 0: + case 2: + case 5: + case 7: + case 8: + case 10: + case 12: + case 14: + case 15: + case 16: + Type = 6; + break; + case 20: + Type = 59; + break; + default: + Type = -1; + break; + } + if (Type != -1) + { + int index23 = Dust.NewDust(num3 != (short) 0 ? (Main.rand.Next(3) != 0 ? new Vector2((float) (index3 * 16), (float) (index2 * 16 + 2)) : new Vector2((float) (index3 * 16 + 6), (float) (index2 * 16 + 2))) : (Main.rand.Next(3) != 0 ? new Vector2((float) (index3 * 16 + 14), (float) (index2 * 16 + 2)) : new Vector2((float) (index3 * 16 + 4), (float) (index2 * 16 + 2))), 4, 4, Type, Alpha: 100); + if (Main.rand.Next(3) != 0) + Main.dust[index23].noGravity = true; + Main.dust[index23].velocity *= 0.3f; + Main.dust[index23].velocity.Y -= 1.5f; + } + } + } + if (type == (ushort) 98 && Main.rand.Next(40) == 0 && num4 == (short) 0 && num3 == (short) 0) + { + int index24 = Dust.NewDust(new Vector2((float) (index3 * 16 + 12), (float) (index2 * 16 + 2)), 4, 4, 6, Alpha: 100); + if (Main.rand.Next(3) != 0) + Main.dust[index24].noGravity = true; + Main.dust[index24].velocity *= 0.3f; + Main.dust[index24].velocity.Y -= 1.5f; + } + if (type == (ushort) 49 && Main.rand.Next(2) == 0) + { + int index25 = Dust.NewDust(new Vector2((float) (index3 * 16 + 4), (float) (index2 * 16 - 4)), 4, 4, 172, Alpha: 100); + if (Main.rand.Next(3) == 0) + { + Main.dust[index25].scale = 0.5f; + } + else + { + Main.dust[index25].scale = 0.9f; + Main.dust[index25].noGravity = true; + } + Main.dust[index25].velocity *= 0.3f; + Main.dust[index25].velocity.Y -= 1.5f; + } + if (type == (ushort) 372 && Main.rand.Next(2) == 0) + { + int index26 = Dust.NewDust(new Vector2((float) (index3 * 16 + 4), (float) (index2 * 16 - 4)), 4, 4, 242, Alpha: 100); + if (Main.rand.Next(3) == 0) + { + Main.dust[index26].scale = 0.5f; + } + else + { + Main.dust[index26].scale = 0.9f; + Main.dust[index26].noGravity = true; + } + Main.dust[index26].velocity *= 0.3f; + Main.dust[index26].velocity.Y -= 1.5f; + } + if (type == (ushort) 34 && Main.rand.Next(40) == 0 && num3 < (short) 54) + { + int num46 = (int) num4 / 54; + int num47 = (int) num3 / 18 % 3; + if ((int) num4 / 18 % 3 == 1 && num47 != 1) + { + int Type; + switch (num46) + { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 12: + case 13: + case 16: + case 19: + case 21: + Type = 6; + break; + case 25: + Type = 59; + break; + default: + Type = -1; + break; + } + if (Type != -1) + { + int index27 = Dust.NewDust(new Vector2((float) (index3 * 16), (float) (index2 * 16 + 2)), 14, 6, Type, Alpha: 100); + if (Main.rand.Next(3) != 0) + Main.dust[index27].noGravity = true; + Main.dust[index27].velocity *= 0.3f; + Main.dust[index27].velocity.Y -= 1.5f; + } + } + } + if (type == (ushort) 22 && Main.rand.Next(400) == 0) + Dust.NewDust(new Vector2((float) (index3 * 16), (float) (index2 * 16)), 16, 16, 14); + else if ((type == (ushort) 23 || type == (ushort) 24 || type == (ushort) 32) && Main.rand.Next(500) == 0) + Dust.NewDust(new Vector2((float) (index3 * 16), (float) (index2 * 16)), 16, 16, 14); + else if (type == (ushort) 25 && Main.rand.Next(700) == 0) + Dust.NewDust(new Vector2((float) (index3 * 16), (float) (index2 * 16)), 16, 16, 14); + else if (type == (ushort) 112 && Main.rand.Next(700) == 0) + Dust.NewDust(new Vector2((float) (index3 * 16), (float) (index2 * 16)), 16, 16, 14); + else if (type == (ushort) 31 && Main.rand.Next(20) == 0) + { + if (num3 >= (short) 36) + { + int index28 = Dust.NewDust(new Vector2((float) (index3 * 16), (float) (index2 * 16)), 16, 16, 5, Alpha: 100); + Main.dust[index28].velocity.Y = 0.0f; + Main.dust[index28].velocity.X *= 0.3f; + } + else + Dust.NewDust(new Vector2((float) (index3 * 16), (float) (index2 * 16)), 16, 16, 14, Alpha: 100); + } + else if (type == (ushort) 26 && Main.rand.Next(20) == 0) + { + if (num3 >= (short) 54) + { + int index29 = Dust.NewDust(new Vector2((float) (index3 * 16), (float) (index2 * 16)), 16, 16, 5, Alpha: 100); + Main.dust[index29].scale = 1.5f; + Main.dust[index29].noGravity = true; + Main.dust[index29].velocity *= 0.75f; + } + else + Dust.NewDust(new Vector2((float) (index3 * 16), (float) (index2 * 16)), 16, 16, 14, Alpha: 100); + } + else if ((type == (ushort) 71 || type == (ushort) 72) && Main.rand.Next(500) == 0) + Dust.NewDust(new Vector2((float) (index3 * 16), (float) (index2 * 16)), 16, 16, 41, Alpha: 250, Scale: 0.8f); + else if ((type == (ushort) 17 || type == (ushort) 77 || type == (ushort) 133) && Main.rand.Next(40) == 0) + { + if (num3 == (short) 18 & num4 == (short) 18) + { + int index30 = Dust.NewDust(new Vector2((float) (index3 * 16 - 4), (float) (index2 * 16 - 6)), 8, 6, 6, Alpha: 100); + if (Main.rand.Next(3) != 0) + Main.dust[index30].noGravity = true; + } + } + else if (type == (ushort) 405 && Main.rand.Next(20) == 0) + { + if (num3 == (short) 18 & num4 == (short) 18) + { + int index31 = Dust.NewDust(new Vector2((float) (index3 * 16 - 4), (float) (index2 * 16 - 6)), 24, 10, 6, Alpha: 100); + if (Main.rand.Next(5) != 0) + Main.dust[index31].noGravity = true; + } + } + else if (type == (ushort) 452 && num4 == (short) 0 && num3 == (short) 0 && Main.rand.Next(3) == 0) + { + Vector2 Position = new Vector2((float) (index3 * 16 + 16), (float) (index2 * 16 + 8)); + Vector2 Velocity = new Vector2(0.0f, 0.0f); + if ((double) Main.windSpeed < 0.0) + Velocity.X = -Main.windSpeed; + int Type = 907 + Main.tileFrame[(int) type] / 5; + if (Main.rand.Next(2) == 0) + Gore.NewGore(Position, Velocity, Type, (float) ((double) Main.rand.NextFloat() * 0.400000005960464 + 0.400000005960464)); + } + else if (type == (ushort) 406 && num4 == (short) 54 && num3 == (short) 0 && Main.rand.Next(3) == 0) + { + Vector2 Position = new Vector2((float) (index3 * 16 + 16), (float) (index2 * 16 + 8)); + Vector2 Velocity = new Vector2(0.0f, 0.0f); + if ((double) Main.windSpeed < 0.0) + Velocity.X = -Main.windSpeed; + int Type = Main.rand.Next(825, 828); + if (Main.rand.Next(4) == 0) + Gore.NewGore(Position, Velocity, Type, (float) ((double) Main.rand.NextFloat() * 0.200000002980232 + 0.200000002980232)); + else if (Main.rand.Next(2) == 0) + Gore.NewGore(Position, Velocity, Type, (float) ((double) Main.rand.NextFloat() * 0.300000011920929 + 0.300000011920929)); + else + Gore.NewGore(Position, Velocity, Type, (float) ((double) Main.rand.NextFloat() * 0.400000005960464 + 0.400000005960464)); + } + else if (type == (ushort) 37 && Main.rand.Next(250) == 0) + { + int index32 = Dust.NewDust(new Vector2((float) (index3 * 16), (float) (index2 * 16)), 16, 16, 6, Scale: ((float) Main.rand.Next(3))); + if ((double) Main.dust[index32].scale > 1.0) + Main.dust[index32].noGravity = true; + } + else if ((type == (ushort) 58 || type == (ushort) 76) && Main.rand.Next(250) == 0) + { + int index33 = Dust.NewDust(new Vector2((float) (index3 * 16), (float) (index2 * 16)), 16, 16, 6, Scale: ((float) Main.rand.Next(3))); + if ((double) Main.dust[index33].scale > 1.0) + Main.dust[index33].noGravity = true; + Main.dust[index33].noLight = true; + } + else if (type == (ushort) 61) + { + if (num3 == (short) 144) + { + if (Main.rand.Next(60) == 0) + { + int index34 = Dust.NewDust(new Vector2((float) (index3 * 16), (float) (index2 * 16)), 16, 16, 44, Alpha: 250, Scale: 0.4f); + Main.dust[index34].fadeIn = 0.7f; + } + color1.A = (byte) (245.0 - (double) Main.mouseTextColor * 1.5); + color1.R = (byte) (245.0 - (double) Main.mouseTextColor * 1.5); + color1.B = (byte) (245.0 - (double) Main.mouseTextColor * 1.5); + color1.G = (byte) (245.0 - (double) Main.mouseTextColor * 1.5); + } + } + else if (Main.tileShine[(int) type] > 0) + { + Main.tileShine[211] = 500; + if (color1.R > (byte) 20 || color1.B > (byte) 20 || color1.G > (byte) 20) + { + int num48 = (int) color1.R; + if ((int) color1.G > num48) + num48 = (int) color1.G; + if ((int) color1.B > num48) + num48 = (int) color1.B; + int num49 = num48 / 30; + if (Main.rand.Next(Main.tileShine[(int) type]) < num49 && (type != (ushort) 21 || num3 >= (short) 36 && num3 < (short) 180 || num3 >= (short) 396 && num3 <= (short) 409) && type != (ushort) 467) + { + Microsoft.Xna.Framework.Color newColor = Microsoft.Xna.Framework.Color.White; + if (type == (ushort) 178) + { + switch ((int) num3 / 18) + { + case 0: + newColor = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, 0, (int) byte.MaxValue, (int) byte.MaxValue); + break; + case 1: + newColor = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, 0, (int) byte.MaxValue); + break; + case 2: + newColor = new Microsoft.Xna.Framework.Color(0, 0, (int) byte.MaxValue, (int) byte.MaxValue); + break; + case 3: + newColor = new Microsoft.Xna.Framework.Color(0, (int) byte.MaxValue, 0, (int) byte.MaxValue); + break; + case 4: + newColor = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, 0, 0, (int) byte.MaxValue); + break; + case 5: + newColor = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); + break; + case 6: + newColor = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, 0, (int) byte.MaxValue); + break; + } + int index35 = Dust.NewDust(new Vector2((float) (index3 * 16), (float) (index2 * 16)), 16, 16, 43, Alpha: 254, newColor: newColor, Scale: 0.5f); + Main.dust[index35].velocity *= 0.0f; + } + else + { + if (type == (ushort) 63) + newColor = new Microsoft.Xna.Framework.Color(0, 0, (int) byte.MaxValue, (int) byte.MaxValue); + if (type == (ushort) 64) + newColor = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, 0, 0, (int) byte.MaxValue); + if (type == (ushort) 65) + newColor = new Microsoft.Xna.Framework.Color(0, (int) byte.MaxValue, 0, (int) byte.MaxValue); + if (type == (ushort) 66) + newColor = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, 0, (int) byte.MaxValue); + if (type == (ushort) 67) + newColor = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, 0, (int) byte.MaxValue, (int) byte.MaxValue); + if (type == (ushort) 68) + newColor = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); + if (type == (ushort) 12) + newColor = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, 0, 0, (int) byte.MaxValue); + if (type == (ushort) 204) + newColor = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, 0, 0, (int) byte.MaxValue); + if (type == (ushort) 211) + newColor = new Microsoft.Xna.Framework.Color(50, (int) byte.MaxValue, 100, (int) byte.MaxValue); + int index36 = Dust.NewDust(new Vector2((float) (index3 * 16), (float) (index2 * 16)), 16, 16, 43, Alpha: 254, newColor: newColor, Scale: 0.5f); + Main.dust[index36].velocity *= 0.0f; + } + } + } + } + } + if (TileID.Sets.BasicChest[(int) type]) + { + Microsoft.Xna.Framework.Point key = new Microsoft.Xna.Framework.Point(index3, index2); + if ((int) num3 % 36 != 0) + --key.X; + if ((int) num4 % 36 != 0) + --key.Y; + if (!dictionary1.ContainsKey(key)) + dictionary1[key] = Chest.FindChest(key.X, key.Y); + int num50 = (int) num3 / 18; + int num51 = (int) num4 / 18; + int num52 = (int) num3 / 36; + num8 = num50 * 18 - (int) num3; + int num53 = num51 * 18; + if (dictionary1[key] != -1) + { + int frame = Main.chest[dictionary1[key]].frame; + if (frame == 1) + num53 += 38; + if (frame == 2) + num53 += 76; + } + y1 = num53 - (int) num4; + if (num51 != 0) + height1 = 18; + if (type == (ushort) 21 && (num52 == 48 || num52 == 49)) + rectangle3 = new Microsoft.Xna.Framework.Rectangle(16 * (num50 % 2), (int) num4 + y1, width1, height1); + } + if (type == (ushort) 378) + { + Microsoft.Xna.Framework.Point key = new Microsoft.Xna.Framework.Point(index3, index2); + if ((int) num3 % 36 != 0) + --key.X; + if ((int) num4 % 54 != 0) + key.Y -= (int) num4 / 18; + if (!dictionary2.ContainsKey(key)) + dictionary2[key] = TETrainingDummy.Find(key.X, key.Y); + if (dictionary2[key] != -1) + { + int npc = ((TETrainingDummy) TileEntity.ByID[dictionary2[key]]).npc; + if (npc != -1) + y1 = Main.npc[npc].frame.Y / 55 * 54 + (int) num4 - (int) num4; + } + } + if (type == (ushort) 395) + { + Microsoft.Xna.Framework.Point key = new Microsoft.Xna.Framework.Point(index3, index2); + if ((int) num3 % 36 != 0) + --key.X; + if ((int) num4 % 36 != 0) + --key.Y; + if (!dictionary3.ContainsKey(key)) + { + dictionary3[key] = TEItemFrame.Find(key.X, key.Y); + if (dictionary3[key] != -1) + { + Main.specX[index1] = key.X; + Main.specY[index1] = key.Y; + ++index1; + } + } + } + if ((type == (ushort) 269 || type == (ushort) 128) && (int) num4 / 18 == 2) + { + if (num3 >= (short) 100) + { + bool flag6 = false; + int frameX = (int) Main.tile[index3, index2 - 1].frameX; + if (frameX >= 100) + { + int num54 = 0; + for (; frameX >= 100; frameX -= 100) + ++num54; + switch (num54) + { + case 15: + case 36: + case 41: + case 42: + case 58: + case 59: + case 60: + case 61: + case 62: + case 63: + flag6 = true; + break; + } + } + if (!flag6) + { + Main.specX[index1] = index3; + Main.specY[index1] = index2; + ++index1; + } + } + if (Main.tile[index3, index2 - 1].frameX >= (short) 100) + { + Main.specX[index1] = index3; + Main.specY[index1] = index2 - 1; + ++index1; + } + if (Main.tile[index3, index2 - 2].frameX >= (short) 100) + { + Main.specX[index1] = index3; + Main.specY[index1] = index2 - 2; + ++index1; + } + } + if (type == (ushort) 5 && num4 >= (short) 198 && num3 >= (short) 22) + { + Main.specX[index1] = index3; + Main.specY[index1] = index2; + ++index1; + } + if (type == (ushort) 323 && num3 <= (short) 132 && num3 >= (short) 88) + { + Main.specX[index1] = index3; + Main.specY[index1] = index2; + ++index1; + } + if (type == (ushort) 412 && num3 == (short) 0 && num4 == (short) 0) + { + Main.specX[index1] = index3; + Main.specY[index1] = index2; + ++index1; + } + if (type == (ushort) 237 && num3 == (short) 18 && num4 == (short) 0) + { + Main.specX[index1] = index3; + Main.specY[index1] = index2; + ++index1; + } + if (type == (ushort) 334 && (int) num4 / 18 == 1 && num3 >= (short) 5000) + { + int frameX = (int) Main.tile[index3, index2].frameX; + int num55 = 0; + for (; frameX >= 5000; frameX -= 5000) + ++num55; + if (num55 == 1 || num55 == 4) + { + Main.specX[index1] = index3; + Main.specY[index1] = index2; + ++index1; + } + } + if (type == (ushort) 5 && num4 >= (short) 198 && num3 >= (short) 22) + { + Main.specX[index1] = index3; + Main.specY[index1] = index2; + ++index1; + } + if (type == (ushort) 323 && num3 <= (short) 132 && num3 >= (short) 88) + { + Main.specX[index1] = index3; + Main.specY[index1] = index2; + ++index1; + } + if (type == (ushort) 412 && num3 == (short) 0 && num4 == (short) 0) + { + Main.specX[index1] = index3; + Main.specY[index1] = index2; + ++index1; + } + if (type == (ushort) 237 && num3 == (short) 18 && num4 == (short) 0) + { + Main.specX[index1] = index3; + Main.specY[index1] = index2; + ++index1; + } + if (type == (ushort) 72 && num3 >= (short) 36) + { + int num56 = 0; + switch (num4) + { + case 18: + num56 = 1; + break; + case 36: + num56 = 2; + break; + } + Main.spriteBatch.Draw(Main.shroomCapTexture, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X - 22), (float) (index2 * 16 - (int) Main.screenPosition.Y - 26)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(num56 * 62, 0, 60, 42)), Lighting.GetColor(index3, index2), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + if (color1.R >= (byte) 1 || color1.G >= (byte) 1 || color1.B >= (byte) 1) + { + Tile tile1 = Main.tile[index3 + 1, index2]; + Tile tile2 = Main.tile[index3 - 1, index2]; + Tile tile3 = Main.tile[index3, index2 - 1]; + Tile tile4 = Main.tile[index3, index2 + 1]; + if (tile1 == null) + { + tile1 = new Tile(); + Main.tile[index3 + 1, index2] = tile1; + } + if (tile2 == null) + { + tile2 = new Tile(); + Main.tile[index3 - 1, index2] = tile2; + } + if (tile3 == null) + { + tile3 = new Tile(); + Main.tile[index3, index2 - 1] = tile3; + } + if (tile4 == null) + { + tile4 = new Tile(); + Main.tile[index3, index2 + 1] = tile4; + } + if (solidOnly & flag1 && !trackTile.inActive() && !Main.tileSolidTop[(int) type]) + { + bool flag7 = false; + if (trackTile.halfBrick()) + { + int num57 = 160; + if (((int) tile2.liquid > num57 || (int) tile1.liquid > num57) && this.waterfallManager.CheckForWaterfall(index3, index2)) + flag7 = true; + } + if (!flag7) + { + int num58 = 0; + bool flag8 = false; + bool flag9 = false; + bool flag10 = false; + bool flag11 = false; + int index37 = 0; + bool flag12 = false; + int num59 = (int) trackTile.slope(); + if (tile2.liquid > (byte) 0 && num59 != 1 && num59 != 3) + { + flag8 = true; + switch (tile2.liquidType()) + { + case 0: + flag12 = true; + break; + case 1: + index37 = 1; + break; + case 2: + index37 = 11; + break; + } + if ((int) tile2.liquid > num58) + num58 = (int) tile2.liquid; + } + if (tile1.liquid > (byte) 0 && num59 != 2 && num59 != 4) + { + flag9 = true; + switch (tile1.liquidType()) + { + case 0: + flag12 = true; + break; + case 1: + index37 = 1; + break; + case 2: + index37 = 11; + break; + } + if ((int) tile1.liquid > num58) + num58 = (int) tile1.liquid; + } + if (tile3.liquid > (byte) 0 && num59 != 3 && num59 != 4) + { + flag10 = true; + switch (tile3.liquidType()) + { + case 0: + flag12 = true; + break; + case 1: + index37 = 1; + break; + case 2: + index37 = 11; + break; + } + } + if (tile4.liquid > (byte) 0 && num59 != 1 && num59 != 2) + { + if (tile4.liquid > (byte) 240) + flag11 = true; + switch (tile4.liquidType()) + { + case 0: + flag12 = true; + break; + case 1: + index37 = 1; + break; + case 2: + index37 = 11; + break; + } + } + if (waterStyleOverride != -1) + Main.waterStyle = waterStyleOverride; + if (index37 == 0) + index37 = Main.waterStyle; + if (flag10 | flag11 | flag8 | flag9 && (!flag12 || index37 != 1)) + { + Microsoft.Xna.Framework.Color color7 = Lighting.GetColor(index3, index2); + Vector2 vector2_2 = new Vector2((float) (index3 * 16), (float) (index2 * 16)); + Microsoft.Xna.Framework.Rectangle rectangle5 = new Microsoft.Xna.Framework.Rectangle(0, 4, 16, 16); + if (flag11 && flag8 | flag9) + { + flag8 = true; + flag9 = true; + } + if ((!flag10 || !(flag8 | flag9)) && !(flag11 & flag10)) + { + if (flag10) + { + rectangle5 = new Microsoft.Xna.Framework.Rectangle(0, 4, 16, 4); + if (trackTile.halfBrick() || trackTile.slope() != (byte) 0) + rectangle5 = new Microsoft.Xna.Framework.Rectangle(0, 4, 16, 12); + } + else if (flag11 && !flag8 && !flag9) + { + vector2_2 = new Vector2((float) (index3 * 16), (float) (index2 * 16 + 12)); + rectangle5 = new Microsoft.Xna.Framework.Rectangle(0, 4, 16, 4); + } + else + { + float num60 = (float) (256 - num58) / 32f; + int y2 = 4; + if (tile3.liquid == (byte) 0 && !WorldGen.SolidTile(index3, index2 - 1)) + y2 = 0; + if (flag8 & flag9 || trackTile.halfBrick() || trackTile.slope() != (byte) 0) + { + vector2_2 = new Vector2((float) (index3 * 16), (float) (index2 * 16 + (int) num60 * 2)); + rectangle5 = new Microsoft.Xna.Framework.Rectangle(0, y2, 16, 16 - (int) num60 * 2); + } + else if (flag8) + { + vector2_2 = new Vector2((float) (index3 * 16), (float) (index2 * 16 + (int) num60 * 2)); + rectangle5 = new Microsoft.Xna.Framework.Rectangle(0, y2, 4, 16 - (int) num60 * 2); + } + else + { + vector2_2 = new Vector2((float) (index3 * 16 + 12), (float) (index2 * 16 + (int) num60 * 2)); + rectangle5 = new Microsoft.Xna.Framework.Rectangle(0, y2, 4, 16 - (int) num60 * 2); + } + } + } + float num61 = 0.5f; + switch (index37) + { + case 1: + num61 = 1f; + break; + case 11: + num61 *= 1.7f; + if ((double) num61 > 1.0) + { + num61 = 1f; + break; + } + break; + } + if ((double) index2 < Main.worldSurface || (double) num61 > 1.0) + { + num61 = 1f; + if (tile3.wall > (byte) 0 || tile2.wall > (byte) 0 || tile1.wall > (byte) 0 || tile4.wall > (byte) 0) + num61 = 0.65f; + if (trackTile.wall > (byte) 0) + num61 = 0.5f; + } + if (trackTile.halfBrick() && tile3.liquid > (byte) 0 && trackTile.wall > (byte) 0) + num61 = 0.0f; + color7 = new Microsoft.Xna.Framework.Color((int) (byte) ((float) color7.R * num61), (int) (byte) ((float) color7.G * num61), (int) (byte) ((float) color7.B * num61), (int) (byte) ((float) color7.A * num61)); + Main.spriteBatch.Draw(Main.liquidTexture[index37], vector2_2 - Main.screenPosition + vector2_1, new Microsoft.Xna.Framework.Rectangle?(rectangle5), color7, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + } + } + } + switch (type) + { + case 51: + Microsoft.Xna.Framework.Color color8 = Lighting.GetColor(index3, index2); + float num62 = 0.5f; + color8 = new Microsoft.Xna.Framework.Color((int) (byte) ((float) color8.R * num62), (int) (byte) ((float) color8.G * num62), (int) (byte) ((float) color8.B * num62), (int) (byte) ((float) color8.A * num62)); + if (Main.canDrawColorTile(index3, index2)) + { + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), color8, 0.0f, new Vector2(), 1f, effects, 0.0f); + goto label_1285; + } + else + { + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), color8, 0.0f, new Vector2(), 1f, effects, 0.0f); + goto label_1285; + } + case 160: + if (!trackTile.halfBrick()) + { + Microsoft.Xna.Framework.Color color9 = new Microsoft.Xna.Framework.Color(); + color9 = new Microsoft.Xna.Framework.Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, (int) byte.MaxValue); + if (trackTile.inActive()) + color9 = trackTile.actColor(color9); + if (trackTile.slope() == (byte) 0) + { + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), color9, 0.0f, new Vector2(), 1f, effects, 0.0f); + goto label_1285; + } + else if (trackTile.slope() > (byte) 2) + { + if (trackTile.slope() == (byte) 3) + { + for (int index38 = 0; index38 < 8; ++index38) + { + int width2 = 2; + int num63 = index38 * 2; + int num64 = index38 * -2; + int height2 = 16 - index38 * 2; + if (Main.canDrawColorTile(index3, index2)) + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + (float) num63, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + index38 * width2 + num64)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num63, (int) num4 + 16 - height2, width2, height2)), color9, 0.0f, new Vector2(), 1f, effects, 0.0f); + else + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + (float) num63, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + index38 * width2 + num64)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num63, (int) num4 + 16 - height2, width2, height2)), color9, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + } + else + { + for (int index39 = 0; index39 < 8; ++index39) + { + int width3 = 2; + int num65 = 16 - index39 * width3 - width3; + int height3 = 16 - index39 * width3; + int num66 = index39 * -2; + if (Main.canDrawColorTile(index3, index2)) + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + (float) num65, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + index39 * width3 + num66)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num65, (int) num4 + 16 - height3, width3, height3)), color9, 0.0f, new Vector2(), 1f, effects, 0.0f); + else + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + (float) num65, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + index39 * width3 + num66)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num65, (int) num4 + 16 - height3, width3, height3)), color9, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + } + if (Main.canDrawColorTile(index3, index2)) + { + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, 16, 2)), color9, 0.0f, new Vector2(), 1f, effects, 0.0f); + goto label_1285; + } + else + { + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, 16, 2)), color9, 0.0f, new Vector2(), 1f, effects, 0.0f); + goto label_1285; + } + } + else + { + if (trackTile.slope() == (byte) 1) + { + for (int index40 = 0; index40 < 8; ++index40) + { + int width4 = 2; + int num67 = index40 * 2; + int height4 = 14 - index40 * width4; + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + (float) num67, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + index40 * width4)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num67, (int) num4, width4, height4)), color9, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + } + if (trackTile.slope() == (byte) 2) + { + for (int index41 = 0; index41 < 8; ++index41) + { + int width5 = 2; + int num68 = 16 - index41 * width5 - width5; + int height5 = 14 - index41 * width5; + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + (float) num68, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + index41 * width5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num68, (int) num4, width5, height5)), color9, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + } + if (Main.canDrawColorTile(index3, index2)) + { + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + 14)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4 + 14, 16, 2)), color9, 0.0f, new Vector2(), 1f, effects, 0.0f); + goto label_1285; + } + else + { + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + 14)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4 + 14, 16, 2)), color9, 0.0f, new Vector2(), 1f, effects, 0.0f); + goto label_1285; + } + } + } + else + break; + case 171: + if (startY > index2 - (int) num4 && num4 == (short) 7) + { + num5 -= 16 * (int) num4; + num3 = Main.tile[index3, index2 - (int) num4].frameX; + num4 = Main.tile[index3, index2 - (int) num4].frameY; + } + if (num3 >= (short) 10) + { + int num69 = 0; + if (((int) num4 & 1) == 1) + ++num69; + if (((int) num4 & 2) == 2) + num69 += 2; + if (((int) num4 & 4) == 4) + num69 += 4; + int num70 = 0; + if (((int) num4 & 8) == 8) + ++num70; + if (((int) num4 & 16) == 16) + num70 += 2; + if (((int) num4 & 32) == 32) + num70 += 4; + int num71 = 0; + if (((int) num4 & 64) == 64) + ++num71; + if (((int) num4 & 128) == 128) + num71 += 2; + if (((int) num4 & 256) == 256) + num71 += 4; + if (((int) num4 & 512) == 512) + num71 += 8; + int num72 = 0; + if (((int) num4 & 1024) == 1024) + ++num72; + if (((int) num4 & 2048) == 2048) + num72 += 2; + if (((int) num4 & 4096) == 4096) + num72 += 4; + if (((int) num4 & 8192) == 8192) + num72 += 8; + Microsoft.Xna.Framework.Color color10 = Lighting.GetColor(index3 + 1, index2 + 4); + Main.spriteBatch.Draw(Main.xmasTree[0], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 64, 128)), color10, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + if (num69 > 0) + { + int num73 = num69 - 1; + Microsoft.Xna.Framework.Color color11 = color10; + if (num73 != 3) + color11 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); + Main.spriteBatch.Draw(Main.xmasTree[3], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(66 * num73, 0, 64, 128)), color11, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + } + if (num70 > 0) + { + int num74 = num70 - 1; + Main.spriteBatch.Draw(Main.xmasTree[1], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(66 * num74, 0, 64, 128)), color10, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + } + if (num71 > 0) + { + int num75 = num71 - 1; + Main.spriteBatch.Draw(Main.xmasTree[2], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(66 * num75, 0, 64, 128)), color10, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + } + if (num72 > 0) + { + int num76 = num72 - 1; + Main.spriteBatch.Draw(Main.xmasTree[4], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(66 * num76, 130 * Main.tileFrame[171], 64, 128)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + goto label_1285; + } + else + goto label_1285; + } + else + goto label_1285; + case 314: + if (trackTile.inActive()) + color1 = trackTile.actColor(color1); + else if (Main.tileShine2[(int) type]) + color1 = Main.shine(color1, (int) type); + int frontColor; + int backColor; + Minecart.TrackColors(index3, index2, trackTile, out frontColor, out backColor); + Texture2D texture3 = !Main.canDrawColorTile(type, frontColor) ? Main.tileTexture[(int) type] : (Texture2D) Main.tileAltTexture[(int) type, frontColor]; + Texture2D texture4 = !Main.canDrawColorTile(type, backColor) ? Main.tileTexture[(int) type] : (Texture2D) Main.tileAltTexture[(int) type, backColor]; + int num77 = (int) trackTile.frameNumber(); + if (num4 != (short) -1) + Main.spriteBatch.Draw(texture4, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X), (float) (index2 * 16 - (int) Main.screenPosition.Y)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(Minecart.GetSourceRect((int) num4, Main.tileFrame[314])), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + Main.spriteBatch.Draw(texture3, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X), (float) (index2 * 16 - (int) Main.screenPosition.Y)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(Minecart.GetSourceRect((int) num3, Main.tileFrame[314])), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + if (Minecart.DrawLeftDecoration((int) num4)) + Main.spriteBatch.Draw(texture4, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X), (float) ((index2 + 1) * 16 - (int) Main.screenPosition.Y)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(Minecart.GetSourceRect(36)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + if (Minecart.DrawLeftDecoration((int) num3)) + Main.spriteBatch.Draw(texture3, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X), (float) ((index2 + 1) * 16 - (int) Main.screenPosition.Y)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(Minecart.GetSourceRect(36)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + if (Minecart.DrawRightDecoration((int) num4)) + Main.spriteBatch.Draw(texture4, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X), (float) ((index2 + 1) * 16 - (int) Main.screenPosition.Y)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(Minecart.GetSourceRect(37, Main.tileFrame[314])), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + if (Minecart.DrawRightDecoration((int) num3)) + Main.spriteBatch.Draw(texture3, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X), (float) ((index2 + 1) * 16 - (int) Main.screenPosition.Y)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(Minecart.GetSourceRect(37)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + if (Minecart.DrawBumper((int) num3)) + { + Main.spriteBatch.Draw(texture3, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X), (float) ((index2 - 1) * 16 - (int) Main.screenPosition.Y)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(Minecart.GetSourceRect(39)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + goto label_1285; + } + else if (Minecart.DrawBouncyBumper((int) num3)) + { + Main.spriteBatch.Draw(texture3, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X), (float) ((index2 - 1) * 16 - (int) Main.screenPosition.Y)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(Minecart.GetSourceRect(38)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + goto label_1285; + } + else + goto label_1285; + } + if (trackTile.slope() > (byte) 0) + { + if (trackTile.inActive()) + color1 = trackTile.actColor(color1); + else if (Main.tileShine2[(int) type]) + color1 = Main.shine(color1, (int) type); + if (TileID.Sets.Platforms[(int) trackTile.type]) + { + if (Main.canDrawColorTile(index3, index2)) + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, 16, 16)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + else + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, 16, 16)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + if (trackTile.slope() == (byte) 1 && Main.tile[index3 + 1, index2 + 1].active() && Main.tile[index3 + 1, index2 + 1].slope() != (byte) 2 && !Main.tile[index3 + 1, index2 + 1].halfBrick() && !TileID.Sets.BlocksStairs[(int) Main.tile[index3 + 1, index2 + 1].type] && !TileID.Sets.BlocksStairsAbove[(int) Main.tile[index3, index2 + 1].type]) + { + if (TileID.Sets.Platforms[(int) Main.tile[index3 + 1, index2 + 1].type] && Main.tile[index3 + 1, index2 + 1].slope() == (byte) 0) + { + if (Main.canDrawColorTile(index3, index2)) + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + 16)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(324, (int) num4, 16, 16)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + else + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + 16)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(324, (int) num4, 16, 16)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + else if (Main.canDrawColorTile(index3, index2)) + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + 16)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(198, (int) num4, 16, 16)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + else + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + 16)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(198, (int) num4, 16, 16)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + else if (trackTile.slope() == (byte) 2 && Main.tile[index3 - 1, index2 + 1].active() && Main.tile[index3 - 1, index2 + 1].slope() != (byte) 1 && !Main.tile[index3 - 1, index2 + 1].halfBrick() && !TileID.Sets.BlocksStairs[(int) Main.tile[index3 - 1, index2 + 1].type] && !TileID.Sets.BlocksStairsAbove[(int) Main.tile[index3, index2 + 1].type]) + { + if (TileID.Sets.Platforms[(int) Main.tile[index3 - 1, index2 + 1].type] && Main.tile[index3 - 1, index2 + 1].slope() == (byte) 0) + { + if (Main.canDrawColorTile(index3, index2)) + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + 16)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(306, (int) num4, 16, 16)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + else + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + 16)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(306, (int) num4, 16, 16)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + else if (Main.canDrawColorTile(index3, index2)) + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + 16)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(162, (int) num4, 16, 16)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + else + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + 16)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(162, (int) num4, 16, 16)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + } + else if (TileID.Sets.HasSlopeFrames[(int) trackTile.type]) + { + if (Main.canDrawColorTile(index3, index2)) + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num8, (int) num4 + y1, 16, 16)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + else + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num8, (int) num4 + y1, 16, 16)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + else if (trackTile.slope() > (byte) 2) + { + if (trackTile.slope() == (byte) 3) + { + for (int index42 = 0; index42 < 8; ++index42) + { + int width6 = 2; + int num78 = index42 * 2; + int num79 = index42 * -2; + int height6 = 16 - index42 * 2; + if (Main.canDrawColorTile(index3, index2)) + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + (float) num78, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + index42 * width6 + num79)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num78 + num8, (int) num4 + 16 - height6 + y1, width6, height6)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + else + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + (float) num78, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + index42 * width6 + num79)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num78 + num8, (int) num4 + 16 - height6 + y1, width6, height6)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + } + else + { + for (int index43 = 0; index43 < 8; ++index43) + { + int width7 = 2; + int num80 = 16 - index43 * width7 - width7; + int height7 = 16 - index43 * width7; + int num81 = index43 * -2; + if (Main.canDrawColorTile(index3, index2)) + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + (float) num80, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + index43 * width7 + num81)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num80 + num8, (int) num4 + 16 - height7 + y1, width7, height7)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + else + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + (float) num80, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + index43 * width7 + num81)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num80 + num8, (int) num4 + 16 - height7 + y1, width7, height7)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + } + if (Main.canDrawColorTile(index3, index2)) + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num8, (int) num4 + y1, 16, 2)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + else + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num8, (int) num4 + y1, 16, 2)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + else + { + if (trackTile.slope() == (byte) 1) + { + for (int index44 = 0; index44 < 8; ++index44) + { + int width8 = 2; + int num82 = index44 * 2; + int height8 = 14 - index44 * width8; + if (Main.canDrawColorTile(index3, index2)) + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + (float) num82, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + index44 * width8)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num82 + num8, (int) num4 + y1, width8, height8)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + else + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + (float) num82, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + index44 * width8)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num82 + num8, (int) num4 + y1, width8, height8)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + } + if (trackTile.slope() == (byte) 2) + { + for (int index45 = 0; index45 < 8; ++index45) + { + int width9 = 2; + int num83 = 16 - index45 * width9 - width9; + int height9 = 14 - index45 * width9; + if (Main.canDrawColorTile(index3, index2)) + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + (float) num83, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + index45 * width9)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num83 + num8, (int) num4 + y1, width9, height9)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + else + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + (float) num83, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + index45 * width9)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num83 + num8, (int) num4 + y1, width9, height9)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + } + if (Main.canDrawColorTile(index3, index2)) + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + 14)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num8, (int) num4 + 14 + y1, 16, 2)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + else + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + 14)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num8, (int) num4 + 14 + y1, 16, 2)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + } + else if (type == (ushort) 129) + { + Vector2 vector2_3 = new Vector2(0.0f, 0.0f); + if (num4 < (short) 36) + vector2_3.Y += (float) (2 * (num4 == (short) 0).ToDirectionInt()); + else + vector2_3.X += (float) (2 * (num4 == (short) 36).ToDirectionInt()); + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1 + vector2_3, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 100), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + else if (Main.tileAlch[(int) type]) + { + height1 = 20; + num5 = -2; + int i = (int) type; + int num84 = (int) num3 / 18; + if (i > 82) + { + if (num84 == 0 && Main.dayTime) + i = 84; + if (num84 == 1 && !Main.dayTime) + i = 84; + if (num84 == 3 && !Main.dayTime && (Main.bloodMoon || Main.moonPhase == 0)) + i = 84; + if (num84 == 4 && (Main.raining || (double) Main.cloudAlpha > 0.0)) + i = 84; + if (num84 == 5 && !Main.raining && Main.time > 40500.0) + i = 84; + } + if (i == 84) + { + if (num84 == 0 && Main.rand.Next(100) == 0) + { + int index46 = Dust.NewDust(new Vector2((float) (index3 * 16), (float) (index2 * 16 - 4)), 16, 16, 19, Alpha: 160, Scale: 0.1f); + Main.dust[index46].velocity.X /= 2f; + Main.dust[index46].velocity.Y /= 2f; + Main.dust[index46].noGravity = true; + Main.dust[index46].fadeIn = 1f; + } + if (num84 == 1 && Main.rand.Next(100) == 0) + Dust.NewDust(new Vector2((float) (index3 * 16), (float) (index2 * 16)), 16, 16, 41, Alpha: 250, Scale: 0.8f); + if (num84 == 3) + { + if (Main.rand.Next(200) == 0) + { + int index47 = Dust.NewDust(new Vector2((float) (index3 * 16), (float) (index2 * 16)), 16, 16, 14, Alpha: 100, Scale: 0.2f); + Main.dust[index47].fadeIn = 1.2f; + } + if (Main.rand.Next(75) == 0) + { + int index48 = Dust.NewDust(new Vector2((float) (index3 * 16), (float) (index2 * 16)), 16, 16, 27, Alpha: 100); + Main.dust[index48].velocity.X /= 2f; + Main.dust[index48].velocity.Y /= 2f; + } + } + if (num84 == 4 && Main.rand.Next(150) == 0) + { + int index49 = Dust.NewDust(new Vector2((float) (index3 * 16), (float) (index2 * 16)), 16, 8, 16); + Main.dust[index49].velocity.X /= 3f; + Main.dust[index49].velocity.Y /= 3f; + Main.dust[index49].velocity.Y -= 0.7f; + Main.dust[index49].alpha = 50; + Main.dust[index49].scale *= 0.1f; + Main.dust[index49].fadeIn = 0.9f; + Main.dust[index49].noGravity = true; + } + if (num84 == 5) + { + if (Main.rand.Next(40) == 0) + { + int index50 = Dust.NewDust(new Vector2((float) (index3 * 16), (float) (index2 * 16 - 6)), 16, 16, 6, Scale: 1.5f); + Main.dust[index50].velocity.Y -= 2f; + Main.dust[index50].noGravity = true; + } + color1.A = (byte) ((uint) Main.mouseTextColor / 2U); + color1.G = Main.mouseTextColor; + color1.B = Main.mouseTextColor; + } + if (num84 == 6) + { + if (Main.rand.Next(30) == 0) + { + Microsoft.Xna.Framework.Color newColor = new Microsoft.Xna.Framework.Color(50, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); + int index51 = Dust.NewDust(new Vector2((float) (index3 * 16), (float) (index2 * 16)), 16, 16, 43, Alpha: 254, newColor: newColor, Scale: 0.5f); + Main.dust[index51].velocity *= 0.0f; + } + byte num85 = (byte) (((int) Main.mouseTextColor + (int) color1.G * 2) / 3); + byte num86 = (byte) (((int) Main.mouseTextColor + (int) color1.B * 2) / 3); + if ((int) num85 > (int) color1.G) + color1.G = num85; + if ((int) num86 > (int) color1.B) + color1.B = num86; + } + } + if (Main.canDrawColorTile(index3, index2)) + { + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + else + { + this.LoadTiles(i); + Main.spriteBatch.Draw(Main.tileTexture[i], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + } + else if (type == (ushort) 80) + { + bool flag13 = false; + bool flag14 = false; + bool flag15 = false; + if (!Main.canDrawColorTile(index3, index2)) + { + int index52 = index3; + if (num3 == (short) 36) + --index52; + if (num3 == (short) 54) + ++index52; + if (num3 == (short) 108) + { + if (num4 == (short) 18) + --index52; + else + ++index52; + } + int index53 = index2; + bool flag16 = false; + if (Main.tile[index52, index53].type == (ushort) 80 && Main.tile[index52, index53].active()) + flag16 = true; + while (!Main.tile[index52, index53].active() || !Main.tileSolid[(int) Main.tile[index52, index53].type] || !flag16) + { + if (Main.tile[index52, index53].type == (ushort) 80 && Main.tile[index52, index53].active()) + flag16 = true; + ++index53; + if (index53 > index2 + 20) + break; + } + if (Main.tile[index52, index53].type == (ushort) 112) + flag13 = true; + if (Main.tile[index52, index53].type == (ushort) 116) + flag14 = true; + if (Main.tile[index52, index53].type == (ushort) 234) + flag15 = true; + } + if (flag13) + Main.spriteBatch.Draw(Main.evilCactusTexture, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + else if (flag15) + Main.spriteBatch.Draw(Main.crimsonCactusTexture, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + else if (flag14) + Main.spriteBatch.Draw(Main.goodCactusTexture, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + else if (Main.canDrawColorTile(index3, index2)) + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + else + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + else if (type == (ushort) 272 && !trackTile.halfBrick() && !Main.tile[index3 - 1, index2].halfBrick() && !Main.tile[index3 + 1, index2].halfBrick()) + { + int num87 = Main.tileFrame[(int) type] + index3 % 2 + index2 % 2 + index3 % 3 + index2 % 3; + while (num87 > 1) + num87 -= 2; + int num88 = num87 * 90; + if (trackTile.inActive()) + color1 = trackTile.actColor(color1); + else if (Main.tileShine2[(int) type]) + color1 = Main.shine(color1, (int) type); + if (Main.canDrawColorTile(index3, index2)) + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4 + num88, width1, height1)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + else + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4 + num88, width1, height1)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + else + { + if (type == (ushort) 160) + color1 = new Microsoft.Xna.Framework.Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, (int) byte.MaxValue); + if (type != (ushort) 19 && type != (ushort) 380 && Main.tileSolid[(int) type] && !TileID.Sets.NotReallySolid[(int) type] && !trackTile.halfBrick() && (Main.tile[index3 - 1, index2].halfBrick() || Main.tile[index3 + 1, index2].halfBrick())) + { + if (trackTile.inActive()) + color1 = trackTile.actColor(color1); + else if (Main.tileShine2[(int) type]) + color1 = Main.shine(color1, (int) type); + if (Main.tile[index3 - 1, index2].halfBrick() && Main.tile[index3 + 1, index2].halfBrick()) + { + if (Main.canDrawColorTile(index3, index2)) + { + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + 8)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num8, y1 + (int) num4 + 8, width1, 8)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(126 + num8, y1, 16, 8)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + else + { + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + 8)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num8, y1 + (int) num4 + 8, width1, 8)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + if (!Main.tile[index3, index2 - 1].bottomSlope() && (int) Main.tile[index3, index2 - 1].type == (int) type) + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(90 + num8, y1, 16, 8)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + else + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(126 + num8, y1, 16, 8)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + } + else if (Main.tile[index3 - 1, index2].halfBrick()) + { + if (Main.canDrawColorTile(index3, index2)) + { + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + 8)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num8, y1 + (int) num4 + 8, width1, 8)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) ((double) (index3 * 16 - (int) Main.screenPosition.X) - ((double) width1 - 16.0) / 2.0 + 4.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + 4 + num8, y1 + (int) num4, width1 - 4, height1)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(126 + num8, y1, 4, 8)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + else + { + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + 8)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num8, y1 + (int) num4 + 8, width1, 8)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) ((double) (index3 * 16 - (int) Main.screenPosition.X) - ((double) width1 - 16.0) / 2.0 + 4.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + 4 + num8, y1 + (int) num4, width1 - 4, height1)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(126 + num8, y1, 4, 8)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + } + else if (Main.tile[index3 + 1, index2].halfBrick()) + { + if (Main.canDrawColorTile(index3, index2)) + { + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + 8)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num8, y1 + (int) num4 + 8, width1, 8)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num8, y1 + (int) num4, width1 - 4, height1)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) ((double) (index3 * 16 - (int) Main.screenPosition.X) - ((double) width1 - 16.0) / 2.0 + 12.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(138 + num8, y1, 4, 8)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + else + { + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + 8)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num8, y1 + (int) num4 + 8, width1, 8)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num8, y1 + (int) num4, width1 - 4, height1)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) ((double) (index3 * 16 - (int) Main.screenPosition.X) - ((double) width1 - 16.0) / 2.0 + 12.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(138, 0, 4, 8)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + } + else if (Main.canDrawColorTile(index3, index2)) + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num8, y1 + (int) num4, width1, height1)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + else + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num8, y1 + (int) num4, width1, height1)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + else if (Lighting.NotRetro && Main.tileSolid[(int) type] && type != (ushort) 137 && type != (ushort) 235 && type != (ushort) 388 && !trackTile.halfBrick() && !trackTile.inActive()) + { + if ((int) color1.R > num1 || (double) color1.G > (double) num1 * 1.1 || (double) color1.B > (double) num1 * 1.2) + { + Lighting.GetColor9Slice(index3, index2, ref slices); + bool flag17 = trackTile.inActive(); + bool flag18 = Main.tileShine2[(int) type]; + Texture2D texture5 = !Main.canDrawColorTile(index3, index2) ? Main.tileTexture[(int) type] : (Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()]; + for (int index54 = 0; index54 < 9; ++index54) + { + int num89 = 0; + int num90 = 0; + int width10 = 4; + int height10 = 4; + switch (index54) + { + case 1: + width10 = 8; + num89 = 4; + break; + case 2: + num89 = 12; + break; + case 3: + height10 = 8; + num90 = 4; + break; + case 4: + width10 = 8; + height10 = 8; + num89 = 4; + num90 = 4; + break; + case 5: + num89 = 12; + num90 = 4; + height10 = 8; + break; + case 6: + num90 = 12; + break; + case 7: + width10 = 8; + height10 = 4; + num89 = 4; + num90 = 12; + break; + case 8: + num89 = 12; + num90 = 12; + break; + } + Microsoft.Xna.Framework.Color color12 = color1; + Microsoft.Xna.Framework.Color color13 = slices[index54]; + color12.R = (byte) (((int) color1.R + (int) color13.R) / 2); + color12.G = (byte) (((int) color1.G + (int) color13.G) / 2); + color12.B = (byte) (((int) color1.B + (int) color13.B) / 2); + if (flag17) + color12 = trackTile.actColor(color12); + else if (flag18) + color12 = Main.shine(color12, (int) type); + Main.spriteBatch.Draw(texture5, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + (float) num89, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + num90)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num89 + num8, (int) num4 + num90 + y1, width10, height10)), color12, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + } + else if ((int) color1.R > num2 || (double) color1.G > (double) num2 * 1.1 || (double) color1.B > (double) num2 * 1.2) + { + Lighting.GetColor4Slice(index3, index2, ref slices); + bool flag19 = trackTile.inActive(); + bool flag20 = Main.tileShine2[(int) type]; + Texture2D texture6 = !Main.canDrawColorTile(index3, index2) ? Main.tileTexture[(int) type] : (Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()]; + for (int index55 = 0; index55 < 4; ++index55) + { + int num91 = 0; + int num92 = 0; + switch (index55) + { + case 1: + num91 = 8; + break; + case 2: + num92 = 8; + break; + case 3: + num91 = 8; + num92 = 8; + break; + } + Microsoft.Xna.Framework.Color color14 = color1; + Microsoft.Xna.Framework.Color color15 = slices[index55]; + color14.R = (byte) (((int) color1.R + (int) color15.R) / 2); + color14.G = (byte) (((int) color1.G + (int) color15.G) / 2); + color14.B = (byte) (((int) color1.B + (int) color15.B) / 2); + if (flag19) + color14 = trackTile.actColor(color14); + else if (flag20) + color14 = Main.shine(color14, (int) type); + Main.spriteBatch.Draw(texture6, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + (float) num91, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + num92)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num91 + num8, (int) num4 + num92 + y1, 8, 8)), color14, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + } + else + { + if (trackTile.inActive()) + color1 = trackTile.actColor(color1); + else if (Main.tileShine2[(int) type]) + color1 = Main.shine(color1, (int) type); + Texture2D texture7 = !Main.canDrawColorTile(index3, index2) ? Main.tileTexture[(int) type] : (Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()]; + Main.spriteBatch.Draw(texture7, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num8, (int) num4 + y1, width1, height1)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + } + else + { + if (Lighting.NotRetro && Main.tileShine2[(int) type]) + { + if (type == (ushort) 21) + { + if (num3 >= (short) 36 && num3 < (short) 178) + color1 = Main.shine(color1, (int) type); + } + else if (!trackTile.inActive()) + color1 = Main.shine(color1, (int) type); + } + if (trackTile.inActive()) + color1 = trackTile.actColor(color1); + switch (type) + { + case 5: + int x1 = index3; + int y3 = index2; + if (num3 == (short) 66 && num4 <= (short) 45) + ++x1; + if (num3 == (short) 88 && num4 >= (short) 66 && num4 <= (short) 110) + --x1; + if (num3 == (short) 22 && num4 >= (short) 132) + --x1; + if (num3 == (short) 44 && num4 >= (short) 132) + ++x1; + while (Main.tile[x1, y3].active() && Main.tile[x1, y3].type == (ushort) 5) + ++y3; + int treeVariant = Main.GetTreeVariant(x1, y3); + if (treeVariant == -1) + { + if (Main.canDrawColorTile(index3, index2)) + { + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + break; + } + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + break; + } + if (Main.canDrawColorTree(index3, index2, treeVariant)) + { + Main.spriteBatch.Draw((Texture2D) Main.woodAltTexture[treeVariant, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + break; + } + Main.spriteBatch.Draw(Main.woodTexture[treeVariant], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + break; + case 128: + case 269: + int x2 = (int) num3; + while (x2 >= 100) + x2 -= 100; + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(x2, (int) num4, width1, height1)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + break; + case 323: + int num93 = -1; + int index56 = index3; + int index57 = index2; + while (Main.tile[index56, index57].active() && Main.tile[index56, index57].type == (ushort) 323) + ++index57; + if (Main.tile[index56, index57].active() && Main.tile[index56, index57].type == (ushort) 53) + num93 = 0; + if (Main.tile[index56, index57].active() && Main.tile[index56, index57].type == (ushort) 234) + num93 = 1; + if (Main.tile[index56, index57].active() && Main.tile[index56, index57].type == (ushort) 116) + num93 = 2; + if (Main.tile[index56, index57].active() && Main.tile[index56, index57].type == (ushort) 112) + num93 = 3; + int y4 = 22 * num93; + int num94 = (int) num4; + if (Main.canDrawColorTile(index3, index2)) + { + Main.spriteBatch.Draw((Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + (float) num94, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, y4, width1, height1)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + break; + } + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + (float) num94, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, y4, width1, height1)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + break; + case 334: + int x3 = (int) num3; + int num95 = 0; + while (x3 >= 5000) + { + x3 -= 5000; + ++num95; + } + if (num95 != 0) + x3 = (num95 - 1) * 18; + Main.spriteBatch.Draw(Main.tileTexture[(int) type], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(x3, (int) num4, width1, height1)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + break; + default: + if (num7 == 8 && (!Main.tile[index3, index2 + 1].active() || !Main.tileSolid[(int) Main.tile[index3, index2 + 1].type] || Main.tile[index3, index2 + 1].halfBrick())) + { + Texture2D texture8 = !Main.canDrawColorTile(index3, index2) ? Main.tileTexture[(int) type] : (Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()]; + if (TileID.Sets.Platforms[(int) type]) + { + Main.spriteBatch.Draw(texture8, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + num7)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num8, (int) num4 + y1, width1, height1)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + else + { + Main.spriteBatch.Draw(texture8, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + num7)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num8, (int) num4 + y1, width1, height1 - num7 - 4)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + Main.spriteBatch.Draw(texture8, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + 12)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(144 + num8, 66 + y1, width1, 4)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + } + else + { + Texture2D texture9 = !Main.canDrawColorTile(index3, index2) ? Main.tileTexture[(int) type] : (Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()]; + Main.spriteBatch.Draw(texture9, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + num7)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num8, (int) num4 + y1, width1, height1 - num7)), color1, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + if (type == (ushort) 27) + { + int index58 = 14; + Main.spriteBatch.Draw(Main.FlameTexture[index58], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4 + y1, width1, height1)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + if (type == (ushort) 215 && num4 < (short) 36) + { + int index59 = 15; + Microsoft.Xna.Framework.Color color16 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); + if ((int) num3 / 54 == 5) + color16 = new Microsoft.Xna.Framework.Color((float) Main.DiscoR / (float) byte.MaxValue, (float) Main.DiscoG / (float) byte.MaxValue, (float) Main.DiscoB / (float) byte.MaxValue, 0.0f); + Main.spriteBatch.Draw(Main.FlameTexture[index59], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4 + y1, width1, height1)), color16, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + if (type == (ushort) 286) + Main.spriteBatch.Draw(Main.glowSnailTexture, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num8, (int) num4 + y1, width1, height1)), new Microsoft.Xna.Framework.Color(75, 100, (int) byte.MaxValue, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + if (type == (ushort) 270) + Main.spriteBatch.Draw(Main.fireflyJarTexture, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num8, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(200, 200, 200, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + if (type == (ushort) 271) + Main.spriteBatch.Draw(Main.lightningbugJarTexture, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num8, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(200, 200, 200, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + if (type == (ushort) 316 || type == (ushort) 317 || type == (ushort) 318) + { + int index60 = (index3 - (int) num3 / 18) / 2 * ((index2 - (int) num4 / 18) / 3) % Main.cageFrames; + Main.spriteBatch.Draw(Main.jellyfishBowlTexture[(int) type - 316], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num8, (int) num4 + Main.jellyfishCageFrame[(int) type - 316, index60] * 36, width1, height1)), new Microsoft.Xna.Framework.Color(200, 200, 200, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + if (type == (ushort) 149 && num3 < (short) 54) + Main.spriteBatch.Draw(Main.xmasLightTexture, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(200, 200, 200, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + if (type == (ushort) 300 || type == (ushort) 302 || type == (ushort) 303 || type == (ushort) 306) + { + int index61 = 9; + if (type == (ushort) 302) + index61 = 10; + if (type == (ushort) 303) + index61 = 11; + if (type == (ushort) 306) + index61 = 12; + Main.spriteBatch.Draw(Main.FlameTexture[index61], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4 + y1, width1, height1)), new Microsoft.Xna.Framework.Color(200, 200, 200, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + else if (Main.tileFlame[(int) type]) + { + ulong seed = Main._tileFrameSeed ^ ((ulong) index3 << 32 | (ulong) (uint) index2); + int num96 = (int) type; + int index62 = 0; + switch (num96) + { + case 4: + index62 = 0; + break; + case 33: + case 174: + index62 = 1; + break; + case 34: + index62 = 3; + break; + case 35: + index62 = 7; + break; + case 42: + index62 = 13; + break; + case 49: + index62 = 5; + break; + case 93: + index62 = 4; + break; + case 98: + index62 = 6; + break; + case 100: + case 173: + index62 = 2; + break; + case 372: + index62 = 16; + break; + } + switch (index62) + { + case 1: + switch ((int) Main.tile[index3, index2].frameY / 22) + { + case 5: + case 6: + case 7: + case 10: + for (int index63 = 0; index63 < 7; ++index63) + { + float num97 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.075f; + float num98 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.075f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num97, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num98) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(50, 50, 50, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + case 8: + for (int index64 = 0; index64 < 7; ++index64) + { + float num99 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.3f; + float num100 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.3f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num99, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num100) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(50, 50, 50, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + case 12: + for (int index65 = 0; index65 < 7; ++index65) + { + float num101 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.1f; + float num102 = (float) Utils.RandomInt(ref seed, -10, 1) * 0.15f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num101, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num102) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(50, 50, 50, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + case 14: + for (int index66 = 0; index66 < 8; ++index66) + { + float num103 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.1f; + float num104 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.1f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num103, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num104) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(75, 75, 75, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + case 16: + for (int index67 = 0; index67 < 4; ++index67) + { + float num105 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; + float num106 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num105, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num106) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(75, 75, 75, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + case 27: + case 28: + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(75, 75, 75, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + break; + default: + for (int index68 = 0; index68 < 7; ++index68) + { + float num107 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; + float num108 = (float) Utils.RandomInt(ref seed, -10, 1) * 0.35f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num107, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num108) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(100, 100, 100, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + } + break; + case 2: + switch ((int) Main.tile[index3, index2].frameY / 36) + { + case 3: + for (int index69 = 0; index69 < 3; ++index69) + { + float num109 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.05f; + float num110 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num109, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num110) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(50, 50, 50, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + case 6: + for (int index70 = 0; index70 < 5; ++index70) + { + float num111 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; + float num112 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num111, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num112) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(75, 75, 75, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + case 9: + for (int index71 = 0; index71 < 7; ++index71) + { + float num113 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.3f; + float num114 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.3f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num113, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num114) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(100, 100, 100, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + case 11: + for (int index72 = 0; index72 < 7; ++index72) + { + float num115 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.1f; + float num116 = (float) Utils.RandomInt(ref seed, -10, 1) * 0.15f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num115, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num116) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(50, 50, 50, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + case 13: + for (int index73 = 0; index73 < 8; ++index73) + { + float num117 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.1f; + float num118 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.1f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num117, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num118) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(75, 75, 75, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + case 28: + case 29: + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(75, 75, 75, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + break; + default: + for (int index74 = 0; index74 < 7; ++index74) + { + float num119 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; + float num120 = (float) Utils.RandomInt(ref seed, -10, 1) * 0.35f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num119, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num120) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(100, 100, 100, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + } + break; + case 3: + switch ((int) Main.tile[index3, index2].frameY / 54) + { + case 8: + for (int index75 = 0; index75 < 7; ++index75) + { + float num121 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.075f; + float num122 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.075f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num121, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num122) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(50, 50, 50, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + case 9: + for (int index76 = 0; index76 < 3; ++index76) + { + float num123 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.05f; + float num124 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num123, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num124) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(50, 50, 50, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + case 11: + for (int index77 = 0; index77 < 7; ++index77) + { + float num125 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.3f; + float num126 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.3f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num125, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num126) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(50, 50, 50, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + case 15: + for (int index78 = 0; index78 < 7; ++index78) + { + float num127 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.1f; + float num128 = (float) Utils.RandomInt(ref seed, -10, 1) * 0.15f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num127, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num128) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(50, 50, 50, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + case 17: + case 20: + for (int index79 = 0; index79 < 7; ++index79) + { + float num129 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.075f; + float num130 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.075f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num129, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num130) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(50, 50, 50, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + case 18: + for (int index80 = 0; index80 < 8; ++index80) + { + float num131 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.1f; + float num132 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.1f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num131, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num132) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(75, 75, 75, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + case 34: + case 35: + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(75, 75, 75, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + break; + default: + for (int index81 = 0; index81 < 7; ++index81) + { + float num133 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; + float num134 = (float) Utils.RandomInt(ref seed, -10, 1) * 0.35f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num133, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num134) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(100, 100, 100, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + } + break; + case 4: + switch ((int) Main.tile[index3, index2].frameY / 54) + { + case 1: + for (int index82 = 0; index82 < 3; ++index82) + { + float num135 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; + float num136 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num135, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num136) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(50, 50, 50, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + case 2: + case 4: + for (int index83 = 0; index83 < 7; ++index83) + { + float num137 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.075f; + float num138 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.075f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num137, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num138) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(50, 50, 50, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + case 3: + for (int index84 = 0; index84 < 7; ++index84) + { + float num139 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.2f; + float num140 = (float) Utils.RandomInt(ref seed, -20, 1) * 0.35f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num139, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num140) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(100, 100, 100, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + case 5: + for (int index85 = 0; index85 < 7; ++index85) + { + float num141 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.3f; + float num142 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.3f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num141, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num142) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(50, 50, 50, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + case 9: + for (int index86 = 0; index86 < 7; ++index86) + { + float num143 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.1f; + float num144 = (float) Utils.RandomInt(ref seed, -10, 1) * 0.15f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num143, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num144) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(50, 50, 50, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + case 12: + float num145 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.01f; + float num146 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.01f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num145, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num146) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(Utils.RandomInt(ref seed, 90, 111), Utils.RandomInt(ref seed, 90, 111), Utils.RandomInt(ref seed, 90, 111), 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + break; + case 13: + for (int index87 = 0; index87 < 8; ++index87) + { + float num147 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.1f; + float num148 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.1f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num147, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num148) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(75, 75, 75, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + case 28: + case 29: + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(75, 75, 75, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + break; + default: + for (int index88 = 0; index88 < 7; ++index88) + { + float num149 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; + float num150 = (float) Utils.RandomInt(ref seed, -10, 1) * 0.35f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num149, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num150) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(100, 100, 100, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + } + break; + case 7: + for (int index89 = 0; index89 < 4; ++index89) + { + float num151 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; + float num152 = (float) Utils.RandomInt(ref seed, -10, 10) * 0.15f; + float num153 = 0.0f; + float num154 = 0.0f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num153, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num154) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(50, 50, 50, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + case 13: + int num155 = (int) num4 / 36; + if (num155 == 1 || num155 == 3 || num155 == 6 || num155 == 8 || num155 == 19 || num155 == 27 || num155 == 29 || num155 == 30 || num155 == 31 || num155 == 32 || num155 == 36) + { + for (int index90 = 0; index90 < 7; ++index90) + { + float num156 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; + float num157 = (float) Utils.RandomInt(ref seed, -10, 1) * 0.35f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num156, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num157) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(100, 100, 100, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + } + if (num155 == 25 || num155 == 16 || num155 == 2) + { + for (int index91 = 0; index91 < 7; ++index91) + { + float num158 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; + float num159 = (float) Utils.RandomInt(ref seed, -10, 1) * 0.1f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num158, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num159) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(50, 50, 50, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + } + if (num155 == 29) + { + for (int index92 = 0; index92 < 7; ++index92) + { + float num160 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; + float num161 = (float) Utils.RandomInt(ref seed, -10, 1) * 0.15f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num160, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num161) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(25, 25, 25, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + } + if (num155 == 34 || num155 == 35) + { + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(75, 75, 75, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + break; + } + break; + default: + for (int index93 = 0; index93 < 7; ++index93) + { + Microsoft.Xna.Framework.Color color17 = new Microsoft.Xna.Framework.Color(100, 100, 100, 0); + if ((int) num4 / 22 == 14) + color17 = new Microsoft.Xna.Framework.Color((float) Main.DiscoR / (float) byte.MaxValue, (float) Main.DiscoG / (float) byte.MaxValue, (float) Main.DiscoB / (float) byte.MaxValue, 0.0f); + float num162 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; + float num163 = (float) Utils.RandomInt(ref seed, -10, 1) * 0.35f; + Main.spriteBatch.Draw(Main.FlameTexture[index62], new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + num162, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5) + num163) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), color17, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + break; + } + } + if (type == (ushort) 144) + Main.spriteBatch.Draw(Main.timerTexture, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color(200, 200, 200, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + if (type == (ushort) 237) + { + Main.spriteBatch.Draw(Main.sunAltarTexture, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + num5)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3, (int) num4, width1, height1)), new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor / 2, (int) Main.mouseTextColor / 2, (int) Main.mouseTextColor / 2, 0), 0.0f, new Vector2(), 1f, effects, 0.0f); + break; + } + break; + } + } + } + } +label_1285: + if (Main.tileGlowMask[(int) trackTile.type] != (short) 0) + { + Texture2D texture10 = Main.glowMaskTexture[(int) Main.tileGlowMask[(int) trackTile.type]]; + double num164 = Main.time * 0.08; + Microsoft.Xna.Framework.Color color18 = Microsoft.Xna.Framework.Color.White; + if (trackTile.type == (ushort) 350) + color18 = new Microsoft.Xna.Framework.Color(new Vector4((float) (-Math.Cos((int) (num164 / 6.283) % 3 == 1 ? num164 : 0.0) * 0.2 + 0.2))); + if (trackTile.type == (ushort) 381) + color18 = color5; + if (trackTile.type == (ushort) 370) + color18 = color4; + if (trackTile.type == (ushort) 390) + color18 = color4; + if (trackTile.type == (ushort) 391) + color18 = new Microsoft.Xna.Framework.Color(250, 250, 250, 200); + if (trackTile.type == (ushort) 209) + color18 = PortalHelper.GetPortalColor(Main.myPlayer, trackTile.frameX >= (short) 288 ? 1 : 0); + if (trackTile.type == (ushort) 429 || trackTile.type == (ushort) 445) + { + texture10 = !Main.canDrawColorTile(index3, index2) ? Main.tileTexture[(int) type] : (Texture2D) Main.tileAltTexture[(int) type, (int) trackTile.color()]; + y1 = 18; + } + if (trackTile.slope() == (byte) 0 && !trackTile.halfBrick()) + Main.spriteBatch.Draw(texture10, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num8, (int) num4 + y1, width1, height1)), color18, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.halfBrick()) + { + Main.spriteBatch.Draw(texture10, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0), (float) (index2 * 16 - (int) Main.screenPosition.Y + 10)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num3 + num8, (int) num4 + y1 + 10, width1, 6)), color18, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + else + { + byte num165 = trackTile.slope(); + for (int index94 = 0; index94 < 8; ++index94) + { + int width11 = index94 << 1; + Microsoft.Xna.Framework.Rectangle rectangle6 = new Microsoft.Xna.Framework.Rectangle((int) num3 + num8, (int) num4 + y1 + index94 * 2, width11, 2); + int num166 = 0; + switch (num165) + { + case 2: + rectangle6.X = 16 - width11; + num166 = 16 - width11; + break; + case 3: + rectangle6.Width = 16 - width11; + break; + case 4: + rectangle6.Width = 14 - width11; + rectangle6.X = width11 + 2; + num166 = width11 + 2; + break; + } + Main.spriteBatch.Draw(texture10, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + (float) num166, (float) (index2 * 16 - (int) Main.screenPosition.Y + index94 * 2)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(rectangle6), color18, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } + } + if (texture1 != null) + { + int num167 = 0; + int num168 = 0; + Main.spriteBatch.Draw(texture1, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + (float) num167, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + num168)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(rectangle3), color2, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + if (texture2 != null) + { + rectangle4 = new Microsoft.Xna.Framework.Rectangle((int) num3 + num8, (int) num4 + y1, width1, height1); + int num169 = 0; + int num170 = 0; + Main.spriteBatch.Draw(texture2, new Vector2((float) (index3 * 16 - (int) Main.screenPosition.X) - (float) (((double) width1 - 16.0) / 2.0) + (float) num169, (float) (index2 * 16 - (int) Main.screenPosition.Y + num5 + num170)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(rectangle4), color6, 0.0f, new Vector2(), 1f, effects, 0.0f); + } + } + } + } + } + if (solidOnly) + this.DrawTileCracks(1); + for (int index95 = 0; index95 < index1; ++index95) + { + int index96 = Main.specX[index95]; + int index97 = Main.specY[index95]; + Tile tile = Main.tile[index96, index97]; + ushort type1 = tile.type; + short frameX1 = tile.frameX; + short frameY1 = tile.frameY; + if (type1 == (ushort) 237) + Main.spriteBatch.Draw(Main.sunOrbTexture, new Vector2((float) (index96 * 16 - (int) Main.screenPosition.X) + (float) width1 / 2f, (float) (index97 * 16 - (int) Main.screenPosition.Y - 36)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.sunOrbTexture.Width, Main.sunOrbTexture.Height)), new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, 0), Main.sunCircle, new Vector2((float) (Main.sunOrbTexture.Width / 2), (float) (Main.sunOrbTexture.Height / 2)), 1f, SpriteEffects.None, 0.0f); + if ((type1 == (ushort) 128 || type1 == (ushort) 269) && frameX1 >= (short) 100) + { + int num171 = (int) frameY1 / 18; + int num172 = (int) frameX1; + int index98 = 0; + for (; num172 >= 100; num172 -= 100) + ++index98; + int num173 = -4; + SpriteEffects effects = SpriteEffects.FlipHorizontally; + if (num172 >= 36) + { + effects = SpriteEffects.None; + num173 = -4; + } + switch (num171) + { + case 0: + bool somethingSpecial1 = false; + int i1 = Player.SetMatch(0, index98, type1 == (ushort) 128, ref somethingSpecial1); + if (i1 == -1) + i1 = index98; + this.LoadArmorHead(i1); + Main.spriteBatch.Draw(Main.armorHeadTexture[i1], new Vector2((float) (index96 * 16 - (int) Main.screenPosition.X + num173), (float) (index97 * 16 - (int) Main.screenPosition.Y - 12)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 40, 54)), Lighting.GetColor(index96, index97), 0.0f, new Vector2(), 1f, effects, 0.0f); + break; + case 1: + bool somethingSpecial2 = false; + int i2 = Player.SetMatch(1, index98, type1 == (ushort) 128, ref somethingSpecial2); + if (i2 != -1) + { + this.LoadArmorLegs(i2); + Main.spriteBatch.Draw(Main.armorLegTexture[i2], new Vector2((float) (index96 * 16 - (int) Main.screenPosition.X + num173), (float) (index97 * 16 - (int) Main.screenPosition.Y - 28)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 40, 54)), Lighting.GetColor(index96, index97), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + this.LoadArmorBody(index98); + if (type1 == (ushort) 269) + Main.spriteBatch.Draw(Main.femaleBodyTexture[index98], new Vector2((float) (index96 * 16 - (int) Main.screenPosition.X + num173), (float) (index97 * 16 - (int) Main.screenPosition.Y - 28)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 40, 54)), Lighting.GetColor(index96, index97), 0.0f, new Vector2(), 1f, effects, 0.0f); + else + Main.spriteBatch.Draw(Main.armorBodyTexture[index98], new Vector2((float) (index96 * 16 - (int) Main.screenPosition.X + num173), (float) (index97 * 16 - (int) Main.screenPosition.Y - 28)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 40, 54)), Lighting.GetColor(index96, index97), 0.0f, new Vector2(), 1f, effects, 0.0f); + if (index98 >= 0 && index98 < 210 && ArmorIDs.Body.Sets.NeedsToDrawArm[index98]) + { + Main.spriteBatch.Draw(Main.armorArmTexture[index98], new Vector2((float) (index96 * 16 - (int) Main.screenPosition.X + num173), (float) (index97 * 16 - (int) Main.screenPosition.Y - 28)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 40, 54)), Lighting.GetColor(index96, index97), 0.0f, new Vector2(), 1f, effects, 0.0f); + break; + } + break; + case 2: + bool somethingSpecial3 = false; + int i3 = Player.SetMatch(2, index98, type1 == (ushort) 128, ref somethingSpecial3); + if (i3 == -1) + i3 = index98; + this.LoadArmorLegs(i3); + Main.spriteBatch.Draw(Main.armorLegTexture[i3], new Vector2((float) (index96 * 16 - (int) Main.screenPosition.X + num173), (float) (index97 * 16 - (int) Main.screenPosition.Y - 44)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 40, 54)), Lighting.GetColor(index96, index97), 0.0f, new Vector2(), 1f, effects, 0.0f); + break; + } + } + if (type1 == (ushort) 334 && frameX1 >= (short) 5000) + { + int num174 = (int) frameY1 / 18; + int num175 = (int) frameX1; + int num176 = 0; + int type2 = num175 % 5000 - 100; + for (; num175 >= 5000; num175 -= 5000) + ++num176; + int frameX2 = (int) Main.tile[index96 + 1, index97].frameX; + int pre = frameX2 < 25000 ? frameX2 - 10000 : frameX2 - 25000; + Item obj = new Item(); + obj.netDefaults(type2); + obj.Prefix(pre); + Texture2D texture2D = Main.itemTexture[obj.type]; + Microsoft.Xna.Framework.Rectangle rectangle = Main.itemAnimations[obj.type] == null ? texture2D.Frame() : Main.itemAnimations[obj.type].GetFrame(texture2D); + int width12 = rectangle.Width; + int height = rectangle.Height; + float num177 = 1f; + if (width12 > 40 || height > 40) + num177 = width12 <= height ? 40f / (float) height : 40f / (float) width12; + float scale = num177 * obj.scale; + SpriteEffects effects = SpriteEffects.None; + if (num176 >= 3) + effects = SpriteEffects.FlipHorizontally; + Microsoft.Xna.Framework.Color color = Lighting.GetColor(index96, index97); + Main.spriteBatch.Draw(texture2D, new Vector2((float) (index96 * 16 - (int) Main.screenPosition.X + 24), (float) (index97 * 16 - (int) Main.screenPosition.Y + 8)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(rectangle), Lighting.GetColor(index96, index97), 0.0f, new Vector2((float) (width12 / 2), (float) (height / 2)), scale, effects, 0.0f); + if (obj.color != new Microsoft.Xna.Framework.Color()) + Main.spriteBatch.Draw(texture2D, new Vector2((float) (index96 * 16 - (int) Main.screenPosition.X + 24), (float) (index97 * 16 - (int) Main.screenPosition.Y + 8)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(rectangle), obj.GetColor(color), 0.0f, new Vector2((float) (width12 / 2), (float) (height / 2)), scale, effects, 0.0f); + } + if (type1 == (ushort) 395) + { + Item obj = ((TEItemFrame) TileEntity.ByPosition[new Point16(index96, index97)]).item; + Texture2D texture2D = Main.itemTexture[obj.type]; + Microsoft.Xna.Framework.Rectangle rectangle = Main.itemAnimations[obj.type] == null ? texture2D.Frame() : Main.itemAnimations[obj.type].GetFrame(texture2D); + int width13 = rectangle.Width; + int height = rectangle.Height; + float num178 = 1f; + if (width13 > 20 || height > 20) + num178 = width13 <= height ? 20f / (float) height : 20f / (float) width13; + float num179 = num178 * obj.scale; + SpriteEffects effects = SpriteEffects.None; + Microsoft.Xna.Framework.Color color = Lighting.GetColor(index96, index97); + Microsoft.Xna.Framework.Color currentColor = color; + float scale1 = 1f; + ItemSlot.GetItemLight(ref currentColor, ref scale1, obj); + float scale2 = num179 * scale1; + Main.spriteBatch.Draw(texture2D, new Vector2((float) (index96 * 16 - (int) Main.screenPosition.X + 16), (float) (index97 * 16 - (int) Main.screenPosition.Y + 16)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(rectangle), currentColor, 0.0f, new Vector2((float) (width13 / 2), (float) (height / 2)), scale2, effects, 0.0f); + if (obj.color != new Microsoft.Xna.Framework.Color()) + Main.spriteBatch.Draw(texture2D, new Vector2((float) (index96 * 16 - (int) Main.screenPosition.X + 16), (float) (index97 * 16 - (int) Main.screenPosition.Y + 16)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(rectangle), obj.GetColor(color), 0.0f, new Vector2((float) (width13 / 2), (float) (height / 2)), scale2, effects, 0.0f); + } + if (type1 == (ushort) 412) + { + Texture2D texture2D = Main.glowMaskTexture[202]; + int frameY2 = Main.tileFrame[(int) type1] / 60; + int frameY3 = (frameY2 + 1) % 4; + float num180 = (float) (Main.tileFrame[(int) type1] % 60) / 60f; + Microsoft.Xna.Framework.Color color = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); + Main.spriteBatch.Draw(texture2D, new Vector2((float) (index96 * 16 - (int) Main.screenPosition.X), (float) (index97 * 16 - (int) Main.screenPosition.Y + 2)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(texture2D.Frame(verticalFrames: 4, frameY: frameY2)), color * (1f - num180), 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(texture2D, new Vector2((float) (index96 * 16 - (int) Main.screenPosition.X), (float) (index97 * 16 - (int) Main.screenPosition.Y + 2)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(texture2D.Frame(verticalFrames: 4, frameY: frameY3)), color * num180, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + try + { + if (type1 == (ushort) 5 && frameY1 >= (short) 198 && frameX1 >= (short) 22) + { + int num181 = 0; + switch (frameX1) + { + case 22: + switch (frameY1) + { + case 220: + num181 = 1; + break; + case 242: + num181 = 2; + break; + } + int index99 = 0; + int width14 = 80; + int height = 80; + int num182 = 32; + int num183 = 0; + for (int index100 = index97; index100 < index97 + 100; ++index100) + { + if (Main.tile[index96, index100].type == (ushort) 2) + { + index99 = Main.GetTreeStyle(index96); + break; + } + if (Main.tile[index96, index100].type == (ushort) 23) + { + index99 = 1; + break; + } + if (Main.tile[index96, index100].type == (ushort) 70) + { + index99 = 14; + break; + } + if (Main.tile[index96, index100].type == (ushort) 60) + { + index99 = 2; + if (WorldGen.jungleBG == 1) + index99 = 11; + if ((double) index100 > Main.worldSurface) + index99 = 13; + width14 = 114; + height = 96; + num182 = 48; + break; + } + if (Main.tile[index96, index100].type == (ushort) 147) + { + index99 = 4; + if (WorldGen.snowBG == 0) + { + index99 = 12; + if (index96 % 10 == 0) + index99 = 18; + } + if (WorldGen.snowBG == 2 || WorldGen.snowBG == 3 || WorldGen.snowBG == 32 || WorldGen.snowBG == 4 || WorldGen.snowBG == 42) + { + index99 = WorldGen.snowBG % 2 != 0 ? (index96 <= Main.maxTilesX / 2 ? 17 : 16) : (index96 >= Main.maxTilesX / 2 ? 17 : 16); + break; + } + break; + } + if (Main.tile[index96, index100].type == (ushort) 199) + { + index99 = 5; + break; + } + if (Main.tile[index96, index100].type == (ushort) 109) + { + index99 = 3; + height = 140; + if (index96 % 3 == 1) + { + num181 += 3; + break; + } + if (index96 % 3 == 2) + { + num181 += 6; + break; + } + break; + } + } + if (index99 == 14) + { + float num184 = (float) Main.rand.Next(28, 42) * 0.005f + (float) (270 - (int) Main.mouseTextColor) / 1000f; + Lighting.AddLight(index96, index97, 0.1f, (float) (0.200000002980232 + (double) num184 / 2.0), 0.7f + num184); + } + if (tile.color() > (byte) 0) + Main.checkTreeAlt[index99, (int) tile.color()] = true; + if (tile.color() > (byte) 0 && Main.treeAltTextureDrawn[index99, (int) tile.color()]) + { + Main.spriteBatch.Draw((Texture2D) Main.treeTopAltTexture[index99, (int) tile.color()], new Vector2((float) (index96 * 16 - (int) Main.screenPosition.X - num182), (float) (index97 * 16 - (int) Main.screenPosition.Y - height + 16 + num183)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(num181 * (width14 + 2), 0, width14, height)), Lighting.GetColor(index96, index97), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + break; + } + Main.spriteBatch.Draw(Main.treeTopTexture[index99], new Vector2((float) (index96 * 16 - (int) Main.screenPosition.X - num182), (float) (index97 * 16 - (int) Main.screenPosition.Y - height + 16 + num183)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(num181 * (width14 + 2), 0, width14, height)), Lighting.GetColor(index96, index97), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + break; + case 44: + switch (frameY1) + { + case 220: + num181 = 1; + break; + case 242: + num181 = 2; + break; + } + int index101 = 0; + for (int index102 = index97; index102 < index97 + 100; ++index102) + { + if (Main.tile[index96 + 1, index102].type == (ushort) 2) + { + index101 = Main.GetTreeStyle(index96 + 1); + break; + } + if (Main.tile[index96 + 1, index102].type == (ushort) 23) + { + index101 = 1; + break; + } + if (Main.tile[index96 + 1, index102].type == (ushort) 70) + { + index101 = 14; + break; + } + if (Main.tile[index96 + 1, index102].type == (ushort) 60) + { + index101 = 2; + if ((double) index102 > Main.worldSurface) + { + index101 = 13; + break; + } + break; + } + if (Main.tile[index96 + 1, index102].type == (ushort) 147) + { + index101 = 4; + if (WorldGen.snowBG == 0) + { + index101 = 12; + break; + } + break; + } + if (Main.tile[index96 + 1, index102].type == (ushort) 199) + { + index101 = 5; + break; + } + if (Main.tile[index96 + 1, index102].type == (ushort) 109) + { + index101 = 3; + if (index96 % 3 == 1) + { + num181 += 3; + break; + } + if (index96 % 3 == 2) + { + num181 += 6; + break; + } + break; + } + } + if (index101 == 14) + { + float num185 = (float) Main.rand.Next(28, 42) * 0.005f + (float) (270 - (int) Main.mouseTextColor) / 1000f; + Lighting.AddLight(index96, index97, 0.1f, (float) (0.200000002980232 + (double) num185 / 2.0), 0.7f + num185); + } + if (tile.color() > (byte) 0) + Main.checkTreeAlt[index101, (int) tile.color()] = true; + if (tile.color() > (byte) 0 && Main.treeAltTextureDrawn[index101, (int) tile.color()]) + { + Main.spriteBatch.Draw((Texture2D) Main.treeBranchAltTexture[index101, (int) tile.color()], new Vector2((float) (index96 * 16 - (int) Main.screenPosition.X - 24), (float) (index97 * 16 - (int) Main.screenPosition.Y - 12)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, num181 * 42, 40, 40)), Lighting.GetColor(index96, index97), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + break; + } + Main.spriteBatch.Draw(Main.treeBranchTexture[index101], new Vector2((float) (index96 * 16 - (int) Main.screenPosition.X - 24), (float) (index97 * 16 - (int) Main.screenPosition.Y - 12)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, num181 * 42, 40, 40)), Lighting.GetColor(index96, index97), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + break; + case 66: + switch (frameY1) + { + case 220: + num181 = 1; + break; + case 242: + num181 = 2; + break; + } + int index103 = 0; + for (int index104 = index97; index104 < index97 + 100; ++index104) + { + if (Main.tile[index96 - 1, index104].type == (ushort) 2) + { + index103 = Main.GetTreeStyle(index96 - 1); + break; + } + if (Main.tile[index96 - 1, index104].type == (ushort) 23) + { + index103 = 1; + break; + } + if (Main.tile[index96 - 1, index104].type == (ushort) 70) + { + index103 = 14; + break; + } + if (Main.tile[index96 - 1, index104].type == (ushort) 60) + { + index103 = 2; + if ((double) index104 > Main.worldSurface) + { + index103 = 13; + break; + } + break; + } + if (Main.tile[index96 - 1, index104].type == (ushort) 147) + { + index103 = 4; + if (WorldGen.snowBG == 0) + { + index103 = 12; + break; + } + break; + } + if (Main.tile[index96 - 1, index104].type == (ushort) 199) + { + index103 = 5; + break; + } + if (Main.tile[index96 - 1, index104].type == (ushort) 109) + { + index103 = 3; + if (index96 % 3 == 1) + { + num181 += 3; + break; + } + if (index96 % 3 == 2) + { + num181 += 6; + break; + } + break; + } + } + if (index103 == 14) + { + float num186 = (float) Main.rand.Next(28, 42) * 0.005f + (float) (270 - (int) Main.mouseTextColor) / 1000f; + Lighting.AddLight(index96, index97, 0.1f, (float) (0.200000002980232 + (double) num186 / 2.0), 0.7f + num186); + } + if (tile.color() > (byte) 0) + Main.checkTreeAlt[index103, (int) tile.color()] = true; + if (tile.color() > (byte) 0 && Main.treeAltTextureDrawn[index103, (int) tile.color()]) + { + Main.spriteBatch.Draw((Texture2D) Main.treeBranchAltTexture[index103, (int) tile.color()], new Vector2((float) (index96 * 16 - (int) Main.screenPosition.X), (float) (index97 * 16 - (int) Main.screenPosition.Y - 12)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(42, num181 * 42, 40, 40)), Lighting.GetColor(index96, index97), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + break; + } + Main.spriteBatch.Draw(Main.treeBranchTexture[index103], new Vector2((float) (index96 * 16 - (int) Main.screenPosition.X), (float) (index97 * 16 - (int) Main.screenPosition.Y - 12)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(42, num181 * 42, 40, 40)), Lighting.GetColor(index96, index97), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + break; + } + } + if (type1 == (ushort) 323) + { + if (frameX1 >= (short) 88) + { + if (frameX1 <= (short) 132) + { + int num187 = 0; + if (frameX1 == (short) 110) + num187 = 1; + else if (frameX1 == (short) 132) + num187 = 2; + int index105 = 15; + int num188 = 0; + int width15 = 80; + int height = 80; + int num189 = 32; + int num190 = 0; + for (int index106 = index97; index106 < index97 + 100; ++index106) + { + if (Main.tile[index96, index106].type == (ushort) 53) + { + num188 = 0; + break; + } + if (Main.tile[index96, index106].type == (ushort) 234) + { + num188 = 1; + break; + } + if (Main.tile[index96, index106].type == (ushort) 116) + { + num188 = 2; + break; + } + if (Main.tile[index96, index106].type == (ushort) 112) + { + num188 = 3; + break; + } + } + int frameY4 = (int) Main.tile[index96, index97].frameY; + int y = num188 * 82; + if (tile.color() > (byte) 0) + Main.checkTreeAlt[index105, (int) tile.color()] = true; + if (tile.color() > (byte) 0 && Main.treeAltTextureDrawn[index105, (int) tile.color()]) + Main.spriteBatch.Draw((Texture2D) Main.treeTopAltTexture[index105, (int) tile.color()], new Vector2((float) (index96 * 16 - (int) Main.screenPosition.X - num189 + frameY4), (float) (index97 * 16 - (int) Main.screenPosition.Y - height + 16 + num190)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(num187 * (width15 + 2), y, width15, height)), Lighting.GetColor(index96, index97), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + else + Main.spriteBatch.Draw(Main.treeTopTexture[index105], new Vector2((float) (index96 * 16 - (int) Main.screenPosition.X - num189 + frameY4), (float) (index97 * 16 - (int) Main.screenPosition.Y - height + 16 + num190)) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(num187 * (width15 + 2), y, width15, height)), Lighting.GetColor(index96, index97), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + } + } + } + } + catch + { + } + } + if (TileObject.objectPreview.Active && Main.player[Main.myPlayer].showItemIcon && Main.placementPreview && !CaptureManager.Instance.Active) + { + this.LoadTiles((int) TileObject.objectPreview.Type); + TileObject.DrawPreview(Main.spriteBatch, TileObject.objectPreview, Main.screenPosition - vector2_1); + } + if (solidOnly) + TimeLogger.DrawTime(0, stopwatch.Elapsed.TotalMilliseconds); + else + TimeLogger.DrawTime(1, stopwatch.Elapsed.TotalMilliseconds); } - private void DrawTileEntities(bool solidLayer, bool overRenderTargets, bool intoRenderTargets) => this.TilesRenderer.PostDrawTiles(solidLayer, overRenderTargets, intoRenderTargets); - - public void ClearCachedTileDraws() + private void DrawSpecialTilesDeprecated(Vector2 offSet, int specTop) { - this.TilesRenderer.ClearCachedTileDraws(false); - this.TilesRenderer.ClearCachedTileDraws(true); - } - - public static bool IsTileSpelunkable(Tile t) => Main.IsTileSpelunkable(t.type, t.frameX, t.frameY); - - public static bool IsTileSpelunkable(ushort typeCache, short tileFrameX, short tileFrameY) => Main.tileSpelunker[(int) typeCache] || typeCache == (ushort) 185 && tileFrameY == (short) 18 && tileFrameX >= (short) 576 && tileFrameX <= (short) 882 || typeCache == (ushort) 186 && tileFrameX >= (short) 864 && tileFrameX <= (short) 1170; - - protected void DrawTiles( - bool solidLayer, - bool forRenderTargets, - bool intoRenderTargets, - int waterStyleOverride = -1) - { - this.TilesRenderer.Draw(solidLayer, forRenderTargets, intoRenderTargets, waterStyleOverride); + for (int index1 = Main.specX.Length - 1; index1 > specTop; --index1) + { + int x = Main.specX[index1]; + int y = Main.specY[index1]; + Tile tile = Main.tile[x, y]; + ushort type = tile.type; + short frameX = tile.frameX; + short frameY = tile.frameY; + if ((type == (ushort) 128 || type == (ushort) 269) && frameX >= (short) 100) + { + int num1 = (int) frameY / 18; + int num2 = (int) frameX; + int index2 = 0; + for (; num2 >= 100; num2 -= 100) + ++index2; + int num3 = -4; + SpriteEffects effects = SpriteEffects.FlipHorizontally; + if (num2 >= 36) + { + effects = SpriteEffects.None; + num3 = -4; + } + switch (num1) + { + case 0: + this.LoadArmorHead(index2); + Main.spriteBatch.Draw(Main.armorHeadTexture[index2], new Vector2((float) (x * 16 - (int) Main.screenPosition.X + num3), (float) (y * 16 - (int) Main.screenPosition.Y - 12)) + offSet, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 40, 36)), Lighting.GetColor(x, y), 0.0f, new Vector2(), 1f, effects, 0.0f); + continue; + case 1: + bool somethingSpecial = false; + int i1 = Player.SetMatch(1, index2, type != (ushort) 128, ref somethingSpecial); + if (i1 != -1) + { + this.LoadArmorLegs(i1); + Main.spriteBatch.Draw(Main.armorLegTexture[i1], new Vector2((float) (x * 16 - (int) Main.screenPosition.X + num3), (float) (y * 16 - (int) Main.screenPosition.Y - 28)) + offSet, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 40, 54)), Lighting.GetColor(x, y), 0.0f, new Vector2(), 1f, effects, 0.0f); + } + this.LoadArmorBody(index2); + if (type == (ushort) 269) + { + Main.spriteBatch.Draw(Main.femaleBodyTexture[index2], new Vector2((float) (x * 16 - (int) Main.screenPosition.X + num3), (float) (y * 16 - (int) Main.screenPosition.Y - 28)) + offSet, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 40, 54)), Lighting.GetColor(x, y), 0.0f, new Vector2(), 1f, effects, 0.0f); + continue; + } + Main.spriteBatch.Draw(Main.armorBodyTexture[index2], new Vector2((float) (x * 16 - (int) Main.screenPosition.X + num3), (float) (y * 16 - (int) Main.screenPosition.Y - 28)) + offSet, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 40, 54)), Lighting.GetColor(x, y), 0.0f, new Vector2(), 1f, effects, 0.0f); + continue; + case 2: + int i2 = index2; + switch (i2) + { + case 83: + if (type == (ushort) 128) + { + i2 = 117; + break; + } + break; + case 84: + if (type == (ushort) 128) + { + i2 = 120; + break; + } + break; + } + this.LoadArmorLegs(i2); + Main.spriteBatch.Draw(Main.armorLegTexture[i2], new Vector2((float) (x * 16 - (int) Main.screenPosition.X + num3), (float) (y * 16 - (int) Main.screenPosition.Y - 44)) + offSet, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 40, 54)), Lighting.GetColor(x, y), 0.0f, new Vector2(), 1f, effects, 0.0f); + continue; + default: + continue; + } + } + } } protected void DrawGoreBehind() { - for (int index = 0; index < 600; ++index) + for (int index = 0; index < 500; ++index) { if (Main.gore[index].active && Main.gore[index].type > 0) { bool flag = false; - if ((Main.gore[index].type >= 706 && Main.gore[index].type <= 717 || Main.gore[index].type == 943 || Main.gore[index].type == 1147 || Main.gore[index].type >= 1160 && Main.gore[index].type <= 1162) && (Main.gore[index].frame < (byte) 7 || Main.gore[index].frame > (byte) 9)) + if ((Main.gore[index].type >= 706 && Main.gore[index].type <= 717 || Main.gore[index].type == 943) && (Main.gore[index].frame < (byte) 7 || Main.gore[index].frame > (byte) 9)) flag = true; if (flag) { this.LoadGore(Main.gore[index].type); - if (Main.gore[index].Frame.ColumnCount > (byte) 1 || Main.gore[index].Frame.RowCount > (byte) 1) + if (Main.gore[index].numFrames > (byte) 1) { - Microsoft.Xna.Framework.Rectangle sourceRectangle = Main.gore[index].Frame.GetSourceRectangle(TextureAssets.Gore[Main.gore[index].type].Value); - Microsoft.Xna.Framework.Color alpha = Main.gore[index].GetAlpha(Lighting.GetColor((int) ((double) Main.gore[index].position.X + (double) sourceRectangle.Width * 0.5) / 16, (int) (((double) Main.gore[index].position.Y + (double) sourceRectangle.Height * 0.5) / 16.0))); - Main.spriteBatch.Draw(TextureAssets.Gore[Main.gore[index].type].Value, new Vector2(Main.gore[index].position.X - Main.screenPosition.X + (float) (sourceRectangle.Width / 2), (float) ((double) Main.gore[index].position.Y - (double) Main.screenPosition.Y + (double) (sourceRectangle.Height / 2) - 2.0)), new Microsoft.Xna.Framework.Rectangle?(sourceRectangle), alpha, Main.gore[index].rotation, new Vector2((float) (sourceRectangle.Width / 2), (float) (sourceRectangle.Height / 2)), Main.gore[index].scale, SpriteEffects.None, 0.0f); + int height = Main.goreTexture[Main.gore[index].type].Height / (int) Main.gore[index].numFrames; + Microsoft.Xna.Framework.Color alpha = Main.gore[index].GetAlpha(Lighting.GetColor((int) ((double) Main.gore[index].position.X + (double) Main.goreTexture[Main.gore[index].type].Width * 0.5) / 16, (int) (((double) Main.gore[index].position.Y + (double) height * 0.5) / 16.0))); + Main.spriteBatch.Draw(Main.goreTexture[Main.gore[index].type], new Vector2(Main.gore[index].position.X - Main.screenPosition.X + (float) (Main.goreTexture[Main.gore[index].type].Width / 2), (float) ((double) Main.gore[index].position.Y - (double) Main.screenPosition.Y + (double) (height / 2) - 2.0)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, height * (int) Main.gore[index].frame, Main.goreTexture[Main.gore[index].type].Width, height)), alpha, Main.gore[index].rotation, new Vector2((float) (Main.goreTexture[Main.gore[index].type].Width / 2), (float) (height / 2)), Main.gore[index].scale, SpriteEffects.None, 0.0f); } else { - Microsoft.Xna.Framework.Color alpha = Main.gore[index].GetAlpha(Lighting.GetColor((int) ((double) Main.gore[index].position.X + (double) TextureAssets.Gore[Main.gore[index].type].Width() * 0.5) / 16, (int) (((double) Main.gore[index].position.Y + (double) TextureAssets.Gore[Main.gore[index].type].Height() * 0.5) / 16.0))); - Main.spriteBatch.Draw(TextureAssets.Gore[Main.gore[index].type].Value, new Vector2(Main.gore[index].position.X - Main.screenPosition.X + (float) (TextureAssets.Gore[Main.gore[index].type].Width() / 2), Main.gore[index].position.Y - Main.screenPosition.Y + (float) (TextureAssets.Gore[Main.gore[index].type].Height() / 2)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Gore[Main.gore[index].type].Width(), TextureAssets.Gore[Main.gore[index].type].Height())), alpha, Main.gore[index].rotation, new Vector2((float) (TextureAssets.Gore[Main.gore[index].type].Width() / 2), (float) (TextureAssets.Gore[Main.gore[index].type].Height() / 2)), Main.gore[index].scale, SpriteEffects.None, 0.0f); + Microsoft.Xna.Framework.Color alpha = Main.gore[index].GetAlpha(Lighting.GetColor((int) ((double) Main.gore[index].position.X + (double) Main.goreTexture[Main.gore[index].type].Width * 0.5) / 16, (int) (((double) Main.gore[index].position.Y + (double) Main.goreTexture[Main.gore[index].type].Height * 0.5) / 16.0))); + Main.spriteBatch.Draw(Main.goreTexture[Main.gore[index].type], new Vector2(Main.gore[index].position.X - Main.screenPosition.X + (float) (Main.goreTexture[Main.gore[index].type].Width / 2), Main.gore[index].position.Y - Main.screenPosition.Y + (float) (Main.goreTexture[Main.gore[index].type].Height / 2)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.goreTexture[Main.gore[index].type].Width, Main.goreTexture[Main.gore[index].type].Height)), alpha, Main.gore[index].rotation, new Vector2((float) (Main.goreTexture[Main.gore[index].type].Width / 2), (float) (Main.goreTexture[Main.gore[index].type].Height / 2)), Main.gore[index].scale, SpriteEffects.None, 0.0f); } } } @@ -15281,30 +17055,27 @@ label_56: protected void DrawGore() { Main.drawBackGore = false; - for (int index = 0; index < 600; ++index) + for (int index = 0; index < 500; ++index) { if (Main.gore[index].active && Main.gore[index].type > 0) { - if ((Main.gore[index].type >= 706 && Main.gore[index].type <= 717 || Main.gore[index].type == 943 || Main.gore[index].type == 1147 || Main.gore[index].type >= 1160 && Main.gore[index].type <= 1162) && (Main.gore[index].frame < (byte) 7 || Main.gore[index].frame > (byte) 9)) + if ((Main.gore[index].type >= 706 && Main.gore[index].type <= 717 || Main.gore[index].type == 943) && (Main.gore[index].frame < (byte) 7 || Main.gore[index].frame > (byte) 9)) { Main.drawBackGore = true; } else { this.LoadGore(Main.gore[index].type); - if (Main.gore[index].Frame.ColumnCount > (byte) 1 || Main.gore[index].Frame.RowCount > (byte) 1) + if (Main.gore[index].numFrames > (byte) 1) { - Microsoft.Xna.Framework.Rectangle sourceRectangle = Main.gore[index].Frame.GetSourceRectangle(TextureAssets.Gore[Main.gore[index].type].Value); - Vector2 vector2 = new Vector2(0.0f, 0.0f); - if (Main.gore[index].type == 1217) - vector2.Y += 4f; - Microsoft.Xna.Framework.Color alpha = Main.gore[index].GetAlpha(Lighting.GetColor((int) ((double) Main.gore[index].position.X + (double) sourceRectangle.Width * 0.5) / 16, (int) (((double) Main.gore[index].position.Y + (double) sourceRectangle.Height * 0.5) / 16.0))); - Main.spriteBatch.Draw(TextureAssets.Gore[Main.gore[index].type].Value, new Vector2(Main.gore[index].position.X - Main.screenPosition.X + (float) (sourceRectangle.Width / 2), (float) ((double) Main.gore[index].position.Y - (double) Main.screenPosition.Y + (double) (sourceRectangle.Height / 2) - 2.0)) + vector2, new Microsoft.Xna.Framework.Rectangle?(sourceRectangle), alpha, Main.gore[index].rotation, new Vector2((float) (sourceRectangle.Width / 2), (float) (sourceRectangle.Height / 2)), Main.gore[index].scale, SpriteEffects.None, 0.0f); + int height = Main.goreTexture[Main.gore[index].type].Height / (int) Main.gore[index].numFrames; + Microsoft.Xna.Framework.Color alpha = Main.gore[index].GetAlpha(Lighting.GetColor((int) ((double) Main.gore[index].position.X + (double) Main.goreTexture[Main.gore[index].type].Width * 0.5) / 16, (int) (((double) Main.gore[index].position.Y + (double) height * 0.5) / 16.0))); + Main.spriteBatch.Draw(Main.goreTexture[Main.gore[index].type], new Vector2(Main.gore[index].position.X - Main.screenPosition.X + (float) (Main.goreTexture[Main.gore[index].type].Width / 2), (float) ((double) Main.gore[index].position.Y - (double) Main.screenPosition.Y + (double) (height / 2) - 2.0)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, height * (int) Main.gore[index].frame, Main.goreTexture[Main.gore[index].type].Width, height)), alpha, Main.gore[index].rotation, new Vector2((float) (Main.goreTexture[Main.gore[index].type].Width / 2), (float) (height / 2)), Main.gore[index].scale, SpriteEffects.None, 0.0f); } else { - Microsoft.Xna.Framework.Color alpha = Main.gore[index].GetAlpha(Lighting.GetColor((int) ((double) Main.gore[index].position.X + (double) TextureAssets.Gore[Main.gore[index].type].Width() * 0.5) / 16, (int) (((double) Main.gore[index].position.Y + (double) TextureAssets.Gore[Main.gore[index].type].Height() * 0.5) / 16.0))); - Main.spriteBatch.Draw(TextureAssets.Gore[Main.gore[index].type].Value, new Vector2(Main.gore[index].position.X - Main.screenPosition.X + (float) (TextureAssets.Gore[Main.gore[index].type].Width() / 2), Main.gore[index].position.Y - Main.screenPosition.Y + (float) (TextureAssets.Gore[Main.gore[index].type].Height() / 2)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Gore[Main.gore[index].type].Width(), TextureAssets.Gore[Main.gore[index].type].Height())), alpha, Main.gore[index].rotation, new Vector2((float) (TextureAssets.Gore[Main.gore[index].type].Width() / 2), (float) (TextureAssets.Gore[Main.gore[index].type].Height() / 2)), Main.gore[index].scale, SpriteEffects.None, 0.0f); + Microsoft.Xna.Framework.Color alpha = Main.gore[index].GetAlpha(Lighting.GetColor((int) ((double) Main.gore[index].position.X + (double) Main.goreTexture[Main.gore[index].type].Width * 0.5) / 16, (int) (((double) Main.gore[index].position.Y + (double) Main.goreTexture[Main.gore[index].type].Height * 0.5) / 16.0))); + Main.spriteBatch.Draw(Main.goreTexture[Main.gore[index].type], new Vector2(Main.gore[index].position.X - Main.screenPosition.X + (float) (Main.goreTexture[Main.gore[index].type].Width / 2), Main.gore[index].position.Y - Main.screenPosition.Y + (float) (Main.goreTexture[Main.gore[index].type].Height / 2)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.goreTexture[Main.gore[index].type].Width, Main.goreTexture[Main.gore[index].type].Height)), alpha, Main.gore[index].rotation, new Vector2((float) (Main.goreTexture[Main.gore[index].type].Width / 2), (float) (Main.goreTexture[Main.gore[index].type].Height / 2)), Main.gore[index].scale, SpriteEffects.None, 0.0f); } } } @@ -15312,14 +17083,13 @@ label_56: TimeLogger.DetailedDrawTime(24); } - public void DrawHealthBar( + protected void DrawHealthBar( float X, float Y, int Health, int MaxHealth, float alpha, - float scale = 1f, - bool noFlip = false) + float scale = 1f) { if (Health <= 0) return; @@ -15329,7 +17099,7 @@ label_56: int num2 = (int) (36.0 * (double) num1); float num3 = X - 18f * scale; float num4 = Y; - if ((double) Main.player[Main.myPlayer].gravDir == -1.0 && !noFlip) + if ((double) Main.player[Main.myPlayer].gravDir == -1.0) { float num5 = num4 - Main.screenPosition.Y; num4 = Main.screenPosition.Y + (float) Main.screenHeight - num5; @@ -15371,137 +17141,144 @@ label_56: if (num2 < 34) { if (num2 < 36) - Main.spriteBatch.Draw(TextureAssets.Hb2.Value, new Vector2((float) ((double) num3 - (double) Main.screenPosition.X + (double) num2 * (double) scale), num4 - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(2, 0, 2, TextureAssets.Hb2.Height())), color, 0.0f, new Vector2(0.0f, 0.0f), scale, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.hbTexture2, new Vector2((float) ((double) num3 - (double) Main.screenPosition.X + (double) num2 * (double) scale), num4 - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(2, 0, 2, Main.hbTexture2.Height)), color, 0.0f, new Vector2(0.0f, 0.0f), scale, SpriteEffects.None, 0.0f); if (num2 < 34) - Main.spriteBatch.Draw(TextureAssets.Hb2.Value, new Vector2((float) ((double) num3 - (double) Main.screenPosition.X + (double) (num2 + 2) * (double) scale), num4 - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(num2 + 2, 0, 36 - num2 - 2, TextureAssets.Hb2.Height())), color, 0.0f, new Vector2(0.0f, 0.0f), scale, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.hbTexture2, new Vector2((float) ((double) num3 - (double) Main.screenPosition.X + (double) (num2 + 2) * (double) scale), num4 - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(num2 + 2, 0, 36 - num2 - 2, Main.hbTexture2.Height)), color, 0.0f, new Vector2(0.0f, 0.0f), scale, SpriteEffects.None, 0.0f); if (num2 > 2) - Main.spriteBatch.Draw(TextureAssets.Hb1.Value, new Vector2(num3 - Main.screenPosition.X, num4 - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, num2 - 2, TextureAssets.Hb1.Height())), color, 0.0f, new Vector2(0.0f, 0.0f), scale, SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(TextureAssets.Hb1.Value, new Vector2((float) ((double) num3 - (double) Main.screenPosition.X + (double) (num2 - 2) * (double) scale), num4 - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(32, 0, 2, TextureAssets.Hb1.Height())), color, 0.0f, new Vector2(0.0f, 0.0f), scale, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.hbTexture1, new Vector2(num3 - Main.screenPosition.X, num4 - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, num2 - 2, Main.hbTexture1.Height)), color, 0.0f, new Vector2(0.0f, 0.0f), scale, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.hbTexture1, new Vector2((float) ((double) num3 - (double) Main.screenPosition.X + (double) (num2 - 2) * (double) scale), num4 - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(32, 0, 2, Main.hbTexture1.Height)), color, 0.0f, new Vector2(0.0f, 0.0f), scale, SpriteEffects.None, 0.0f); } else { if (num2 < 36) - Main.spriteBatch.Draw(TextureAssets.Hb2.Value, new Vector2((float) ((double) num3 - (double) Main.screenPosition.X + (double) num2 * (double) scale), num4 - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(num2, 0, 36 - num2, TextureAssets.Hb2.Height())), color, 0.0f, new Vector2(0.0f, 0.0f), scale, SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(TextureAssets.Hb1.Value, new Vector2(num3 - Main.screenPosition.X, num4 - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, num2, TextureAssets.Hb1.Height())), color, 0.0f, new Vector2(0.0f, 0.0f), scale, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.hbTexture2, new Vector2((float) ((double) num3 - (double) Main.screenPosition.X + (double) num2 * (double) scale), num4 - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(num2, 0, 36 - num2, Main.hbTexture2.Height)), color, 0.0f, new Vector2(0.0f, 0.0f), scale, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.hbTexture1, new Vector2(num3 - Main.screenPosition.X, num4 - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, num2, Main.hbTexture1.Height)), color, 0.0f, new Vector2(0.0f, 0.0f), scale, SpriteEffects.None, 0.0f); } } - public static float NPCAddHeight(NPC theNPC) + public static float NPCAddHeight(int i) { float num = 0.0f; - if (theNPC.type == 125) + if (Main.npc[i].type == 125) num = 30f; - else if (theNPC.type == 54) + else if (Main.npc[i].type == 54) num = 2f; - else if (theNPC.type == 205) + else if (Main.npc[i].type == 205) num = 8f; - else if (theNPC.type == 182) + else if (Main.npc[i].type == 182) num = 24f; - else if (theNPC.type == 178) + else if (Main.npc[i].type == 178) num = 2f; - else if (theNPC.type == 126) + else if (Main.npc[i].type == 126) num = 30f; - else if (theNPC.type == 6 || theNPC.type == 173) + else if (Main.npc[i].type == 6 || Main.npc[i].type == 173) num = 26f; - else if (theNPC.type == 94) + else if (Main.npc[i].type == 94) num = 14f; - else if (theNPC.type == 7 || theNPC.type == 8 || theNPC.type == 9) + else if (Main.npc[i].type == 7 || Main.npc[i].type == 8 || Main.npc[i].type == 9) num = 13f; - else if (theNPC.type == 98 || theNPC.type == 99 || theNPC.type == 100) + else if (Main.npc[i].type == 98 || Main.npc[i].type == 99 || Main.npc[i].type == 100) num = 13f; - else if (theNPC.type == 95 || theNPC.type == 96 || theNPC.type == 97) + else if (Main.npc[i].type == 95 || Main.npc[i].type == 96 || Main.npc[i].type == 97) num = 13f; - else if (theNPC.type == 10 || theNPC.type == 11 || theNPC.type == 12) + else if (Main.npc[i].type == 10 || Main.npc[i].type == 11 || Main.npc[i].type == 12) num = 8f; - else if (theNPC.type == 13 || theNPC.type == 14 || theNPC.type == 15) + else if (Main.npc[i].type == 13 || Main.npc[i].type == 14 || Main.npc[i].type == 15) num = 26f; - else if (theNPC.type == 175) + else if (Main.npc[i].type == 175) num = 4f; - else if (theNPC.type == 520) + else if (Main.npc[i].type == 520) num = 2f; - else if (theNPC.type >= 412 && theNPC.type <= 414) + else if (Main.npc[i].type >= 412 && Main.npc[i].type <= 414) num = 18f; - else if (theNPC.type == 48) + else if (Main.npc[i].type == 48) num = 32f; - else if (theNPC.type == 49 || theNPC.type == 51) + else if (Main.npc[i].type == 49 || Main.npc[i].type == 51) num = 4f; - else if (theNPC.type == 60) + else if (Main.npc[i].type == 60) num = 10f; - else if (theNPC.type == 62 || theNPC.type == 66 || theNPC.type == 156) + else if (Main.npc[i].type == 62 || Main.npc[i].type == 66 || Main.npc[i].type == 156) num = 14f; - else if (theNPC.type == 63 || theNPC.type == 64 || theNPC.type == 103) + else if (Main.npc[i].type == 63 || Main.npc[i].type == 64 || Main.npc[i].type == 103) num = 4f; - else if (theNPC.type == 65) - num = 5f; - else if (theNPC.type == 69) + else if (Main.npc[i].type == 65) + num = 14f; + else if (Main.npc[i].type == 69) num = 4f; - else if (theNPC.type == 70) + else if (Main.npc[i].type == 70) num = -4f; - else if (theNPC.type == 72) + else if (Main.npc[i].type == 72) num = -2f; - else if (theNPC.type == 83 || theNPC.type == 84) + else if (Main.npc[i].type == 83 || Main.npc[i].type == 84) num = 20f; - else if (theNPC.type == 150 || theNPC.type == 151 || theNPC.type == 158) + else if (Main.npc[i].type == 150 || Main.npc[i].type == 151 || Main.npc[i].type == 158) num = 10f; - else if (theNPC.type == 152) + else if (Main.npc[i].type == 152) num = 6f; - else if (theNPC.type == 153 || theNPC.type == 154) - num = 2f; - else if (theNPC.type == 165 || theNPC.type == 237 || theNPC.type == 238 || theNPC.type == 240 || theNPC.type == 531) + else if (Main.npc[i].type == 153 || Main.npc[i].type == 154) + num = 4f; + else if (Main.npc[i].type == 165 || Main.npc[i].type == 237 || Main.npc[i].type == 238 || Main.npc[i].type == 240 || Main.npc[i].type == 531) num = 10f; - else if (theNPC.type == 39 || theNPC.type == 40 || theNPC.type == 41) + else if (Main.npc[i].type == 39 || Main.npc[i].type == 40 || Main.npc[i].type == 41) num = 26f; - else if (theNPC.type >= 87 && theNPC.type <= 92) + else if (Main.npc[i].type >= 87 && Main.npc[i].type <= 92) num = 56f; - else if (theNPC.type >= 134 && theNPC.type <= 136) + else if (Main.npc[i].type >= 134 && Main.npc[i].type <= 136) num = 30f; - else if (theNPC.type == 169) + else if (Main.npc[i].type == 169) num = 8f; - else if (theNPC.type == 174) + else if (Main.npc[i].type == 174) num = 6f; - else if (theNPC.type == 369) + else if (Main.npc[i].type == 369) num = 2f; - else if (theNPC.type == 376) + else if (Main.npc[i].type == 376) num = 6f; - else if (theNPC.type == 579) + else if (Main.npc[i].type == 579) num = -2f; - else if (theNPC.type == 613 || theNPC.type == 612) - num = 2f; - switch (theNPC.type) - { - case 269: - case 270: - case 271: - case 274: - case 277: - num -= 2f; - break; - } - if (theNPC.townNPC && (double) theNPC.ai[0] == 5.0) - { + if (Main.npc[i].townNPC && (double) Main.npc[i].ai[0] == 5.0) num -= 4f; - if (theNPC.type == 637 || theNPC.type == 656) - num -= 10f; - } - return num * theNPC.scale; + return num * Main.npc[i].scale; } protected void DrawProjectiles() { PlayerInput.SetZoom_MouseInWorld(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.Transform); - int num = 0; - Main.CurrentDrawnEntity = (Entity) null; - Main.CurrentDrawnEntityShader = 0; + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, this.Rasterizer, (Effect) null, Main.Transform); + int num1 = 0; + int num2 = 0; if (Main.ignoreErrors) { for (int i = 0; i < 1000; ++i) { if (Main.projectile[i].active && Main.projectile[i].type > 0 && !Main.projectile[i].hide) { - ++num; + ++num1; try { + int shaderId = 0; + if (Main.projHook[Main.projectile[i].type] && Main.projectile[i].owner != (int) byte.MaxValue) + shaderId = Main.player[Main.projectile[i].owner].cGrapple; + if (Main.projPet[Main.projectile[i].type] && !Main.projectile[i].minion && Main.projectile[i].owner != (int) byte.MaxValue && Main.projectile[i].damage == 0 && !ProjectileID.Sets.LightPet[Main.projectile[i].type]) + shaderId = Main.player[Main.projectile[i].owner].cPet; + if (!Main.projectile[i].minion && Main.projectile[i].owner != (int) byte.MaxValue && Main.projectile[i].damage == 0 && ProjectileID.Sets.LightPet[Main.projectile[i].type]) + shaderId = Main.player[Main.projectile[i].owner].cLight; + if (Main.projectile[i].type == 623 && Main.projectile[i].owner != (int) byte.MaxValue) + shaderId = Main.player[Main.projectile[i].owner].cPet; + if (shaderId != 0) + { + if (num2 == 0) + { + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, this.Rasterizer, (Effect) null, Main.Transform); + } + GameShaders.Armor.ApplySecondary(shaderId, (Entity) Main.player[Main.projectile[i].owner]); + } + else if (num2 != 0) + { + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, this.Rasterizer, (Effect) null, Main.Transform); + } + num2 = shaderId; this.DrawProj(i); } catch (Exception ex) @@ -15517,65 +17294,359 @@ label_56: for (int i = 0; i < 1000; ++i) { if (Main.projectile[i].active && Main.projectile[i].type > 0 && !Main.projectile[i].hide) + { + int shaderId = 0; + if (Main.projHook[Main.projectile[i].type] && Main.projectile[i].owner != (int) byte.MaxValue) + shaderId = Main.player[Main.projectile[i].owner].cGrapple; + if (Main.projPet[Main.projectile[i].type] && !Main.projectile[i].minion && Main.projectile[i].owner != (int) byte.MaxValue && Main.projectile[i].damage == 0 && !ProjectileID.Sets.LightPet[Main.projectile[i].type]) + shaderId = Main.player[Main.projectile[i].owner].cPet; + if (!Main.projectile[i].minion && Main.projectile[i].owner != (int) byte.MaxValue && Main.projectile[i].damage == 0 && ProjectileID.Sets.LightPet[Main.projectile[i].type]) + shaderId = Main.player[Main.projectile[i].owner].cLight; + if (Main.projectile[i].type == 623 && Main.projectile[i].owner != (int) byte.MaxValue) + shaderId = Main.player[Main.projectile[i].owner].cPet; + if (shaderId != 0) + { + if (num2 == 0) + { + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, this.Rasterizer, (Effect) null, Main.Transform); + } + GameShaders.Armor.ApplySecondary(shaderId, (Entity) Main.player[Main.projectile[i].owner]); + } + else if (num2 != 0) + { + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, this.Rasterizer, (Effect) null, Main.Transform); + } + num2 = shaderId; this.DrawProj(i); + } } } - Main.CurrentDrawnEntity = (Entity) null; - Main.CurrentDrawnEntityShader = 0; Main.spriteBatch.End(); TimeLogger.DetailedDrawTime(20); } - public static int GetProjectileDesiredShader(int i) + protected void DrawPlayers() { - int num = 0; - if (Main.projectile[i].minion && Main.projectile[i].owner != (int) byte.MaxValue) - num = Main.player[Main.projectile[i].owner].cMinion; - if (Main.projHook[Main.projectile[i].type] && Main.projectile[i].owner != (int) byte.MaxValue) - num = Main.player[Main.projectile[i].owner].cGrapple; - if (Main.projPet[Main.projectile[i].type] && !Main.projectile[i].minion && Main.projectile[i].owner != (int) byte.MaxValue && Main.projectile[i].damage == 0 && !ProjectileID.Sets.LightPet[Main.projectile[i].type]) - num = Main.player[Main.projectile[i].owner].cPet; - if (!Main.projectile[i].minion && Main.projectile[i].owner != (int) byte.MaxValue && Main.projectile[i].damage == 0 && ProjectileID.Sets.LightPet[Main.projectile[i].type]) - num = Main.player[Main.projectile[i].owner].cLight; - if (Main.projectile[i].type == 623 && Main.projectile[i].owner != (int) byte.MaxValue) - num = Main.player[Main.projectile[i].owner].cPet; - return num; - } - - private void RefreshPlayerDrawOrder() - { - this._playersThatDrawBehindNPCs.Clear(); - this._playersThatDrawAfterProjectiles.Clear(); - if (Main.gameMenu) - return; - for (int index = 0; index < (int) byte.MaxValue; ++index) + for (int index1 = 0; index1 < (int) byte.MaxValue; ++index1) { - Player player = Main.player[index]; - if (index != Main.myPlayer && player.active && !player.outOfRange) + Player drawPlayer = Main.player[index1]; + if (drawPlayer.active && !drawPlayer.outOfRange) { - if (player.isLockedToATile) - this._playersThatDrawBehindNPCs.Add(player); + SamplerState samplerState = Main.DefaultSamplerState; + if (drawPlayer.mount.Active) + samplerState = Main.MountedSamplerState; + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, samplerState, DepthStencilState.None, this.Rasterizer, (Effect) null, Main.Transform); + if (Main.gamePaused) + drawPlayer.PlayerFrame(); + if (drawPlayer.ghost) + { + for (int index2 = 0; index2 < 3; ++index2) + this.DrawGhost(drawPlayer, drawPlayer.shadowPos[index2], (float) (0.5 + 0.200000002980232 * (double) index2)); + this.DrawGhost(drawPlayer, drawPlayer.position); + Main.spriteBatch.End(); + } else - this._playersThatDrawAfterProjectiles.Add(player); + { + if (drawPlayer.inventory[drawPlayer.selectedItem].flame || drawPlayer.head == 137 || drawPlayer.wings == 22) + { + --drawPlayer.itemFlameCount; + if (drawPlayer.itemFlameCount <= 0) + { + drawPlayer.itemFlameCount = 5; + for (int index3 = 0; index3 < 7; ++index3) + { + drawPlayer.itemFlamePos[index3].X = (float) Main.rand.Next(-10, 11) * 0.15f; + drawPlayer.itemFlamePos[index3].Y = (float) Main.rand.Next(-10, 1) * 0.35f; + } + } + } + if (drawPlayer.armorEffectDrawShadowEOCShield) + { + int num = drawPlayer.eocDash / 4; + if (num > 3) + num = 3; + for (int index4 = 0; index4 < num; ++index4) + this.DrawPlayer(drawPlayer, drawPlayer.shadowPos[index4], drawPlayer.shadowRotation[index4], drawPlayer.shadowOrigin[index4], (float) (0.5 + 0.200000002980232 * (double) index4)); + } + Vector2 Position; + if (drawPlayer.invis) + { + drawPlayer.armorEffectDrawOutlines = false; + drawPlayer.armorEffectDrawShadow = false; + drawPlayer.armorEffectDrawShadowSubtle = false; + Position = drawPlayer.position; + if (drawPlayer.aggro <= -750) + { + this.DrawPlayer(drawPlayer, Position, drawPlayer.fullRotation, drawPlayer.fullRotationOrigin, 1f); + } + else + { + drawPlayer.invis = false; + this.DrawPlayer(drawPlayer, Position, drawPlayer.fullRotation, drawPlayer.fullRotationOrigin); + drawPlayer.invis = true; + } + } + if (drawPlayer.armorEffectDrawOutlines) + { + Vector2 position = drawPlayer.position; + if (!Main.gamePaused) + drawPlayer.ghostFade += drawPlayer.ghostDir * 0.075f; + if ((double) drawPlayer.ghostFade < 0.1) + { + drawPlayer.ghostDir = 1f; + drawPlayer.ghostFade = 0.1f; + } + else if ((double) drawPlayer.ghostFade > 0.9) + { + drawPlayer.ghostDir = -1f; + drawPlayer.ghostFade = 0.9f; + } + float num1 = drawPlayer.ghostFade * 5f; + for (int index5 = 0; index5 < 4; ++index5) + { + float num2; + float num3; + switch (index5) + { + case 1: + num2 = -num1; + num3 = 0.0f; + break; + case 2: + num2 = 0.0f; + num3 = num1; + break; + case 3: + num2 = 0.0f; + num3 = -num1; + break; + default: + num2 = num1; + num3 = 0.0f; + break; + } + Position = new Vector2(drawPlayer.position.X + num2, drawPlayer.position.Y + drawPlayer.gfxOffY + num3); + this.DrawPlayer(drawPlayer, Position, drawPlayer.fullRotation, drawPlayer.fullRotationOrigin, drawPlayer.ghostFade); + } + } + if (drawPlayer.armorEffectDrawOutlinesForbidden) + { + Vector2 position = drawPlayer.position; + if (!Main.gamePaused) + drawPlayer.ghostFade += drawPlayer.ghostDir * 0.025f; + if ((double) drawPlayer.ghostFade < 0.1) + { + drawPlayer.ghostDir = 1f; + drawPlayer.ghostFade = 0.1f; + } + else if ((double) drawPlayer.ghostFade > 0.9) + { + drawPlayer.ghostDir = -1f; + drawPlayer.ghostFade = 0.9f; + } + float num4 = drawPlayer.ghostFade * 5f; + for (int index6 = 0; index6 < 4; ++index6) + { + float num5; + float num6; + switch (index6) + { + case 1: + num5 = -num4; + num6 = 0.0f; + break; + case 2: + num5 = 0.0f; + num6 = num4; + break; + case 3: + num5 = 0.0f; + num6 = -num4; + break; + default: + num5 = num4; + num6 = 0.0f; + break; + } + Position = new Vector2(drawPlayer.position.X + num5, drawPlayer.position.Y + drawPlayer.gfxOffY + num6); + this.DrawPlayer(drawPlayer, Position, drawPlayer.fullRotation, drawPlayer.fullRotationOrigin, drawPlayer.ghostFade); + } + } + if (drawPlayer.armorEffectDrawShadowBasilisk) + { + int num = (int) ((double) drawPlayer.basiliskCharge * 3.0); + for (int index7 = 0; index7 < num; ++index7) + this.DrawPlayer(drawPlayer, drawPlayer.shadowPos[index7], drawPlayer.shadowRotation[index7], drawPlayer.shadowOrigin[index7], (float) (0.5 + 0.200000002980232 * (double) index7)); + } + else if (drawPlayer.armorEffectDrawShadow) + { + for (int index8 = 0; index8 < 3; ++index8) + this.DrawPlayer(drawPlayer, drawPlayer.shadowPos[index8], drawPlayer.shadowRotation[index8], drawPlayer.shadowOrigin[index8], (float) (0.5 + 0.200000002980232 * (double) index8)); + } + if (drawPlayer.armorEffectDrawShadowLokis) + { + for (int index9 = 0; index9 < 3; ++index9) + this.DrawPlayer(drawPlayer, Vector2.Lerp(drawPlayer.shadowPos[index9], drawPlayer.position + new Vector2(0.0f, drawPlayer.gfxOffY), 0.5f), drawPlayer.shadowRotation[index9], drawPlayer.shadowOrigin[index9], MathHelper.Lerp(1f, (float) (0.5 + 0.200000002980232 * (double) index9), 0.5f)); + } + if (drawPlayer.armorEffectDrawShadowSubtle) + { + for (int index10 = 0; index10 < 4; ++index10) + { + Position.X = drawPlayer.position.X + (float) Main.rand.Next(-20, 21) * 0.1f; + Position.Y = drawPlayer.position.Y + (float) Main.rand.Next(-20, 21) * 0.1f + drawPlayer.gfxOffY; + this.DrawPlayer(drawPlayer, Position, drawPlayer.fullRotation, drawPlayer.fullRotationOrigin, 0.9f); + } + } + if (drawPlayer.shadowDodge) + { + ++drawPlayer.shadowDodgeCount; + if ((double) drawPlayer.shadowDodgeCount > 30.0) + drawPlayer.shadowDodgeCount = 30f; + } + else + { + --drawPlayer.shadowDodgeCount; + if ((double) drawPlayer.shadowDodgeCount < 0.0) + drawPlayer.shadowDodgeCount = 0.0f; + } + if ((double) drawPlayer.shadowDodgeCount > 0.0) + { + Vector2 position = drawPlayer.position; + Position.X = drawPlayer.position.X + drawPlayer.shadowDodgeCount; + Position.Y = drawPlayer.position.Y + drawPlayer.gfxOffY; + this.DrawPlayer(drawPlayer, Position, drawPlayer.fullRotation, drawPlayer.fullRotationOrigin, (float) (0.5 + (double) Main.rand.Next(-10, 11) * 0.00499999988824129)); + Position.X = drawPlayer.position.X - drawPlayer.shadowDodgeCount; + this.DrawPlayer(drawPlayer, Position, drawPlayer.fullRotation, drawPlayer.fullRotationOrigin, (float) (0.5 + (double) Main.rand.Next(-10, 11) * 0.00499999988824129)); + } + Position = drawPlayer.position; + Position.Y += drawPlayer.gfxOffY; + if (drawPlayer.stoned) + this.DrawPlayerStoned(drawPlayer, Position); + else if (!drawPlayer.invis) + this.DrawPlayer(drawPlayer, Position, drawPlayer.fullRotation, drawPlayer.fullRotationOrigin); + Main.spriteBatch.End(); + } } } - Player localPlayer = Main.LocalPlayer; - if (localPlayer.isLockedToATile) - this._playersThatDrawBehindNPCs.Add(localPlayer); - else - this._playersThatDrawAfterProjectiles.Add(localPlayer); + TimeLogger.DetailedDrawTime(21); } - protected void DrawPlayers_BehindNPCs() + private static void DrawPlayers_SetArmorEffectsOld( + Player drawPlayer, + ref bool armorEffectDrawShadow, + ref bool armorEffectDrawShadowSubtle, + ref bool armorEffectDrawOutlines, + ref bool armorEffectDrawShadowLokis, + ref bool armorEffectDrawShadowBasilisk, + ref bool armorEffectDrawOutlinesForbidden, + ref bool armorEffectEOCShield) { - Main.PotionOfReturnRenderer.DrawPlayers(Main.Camera, this._playersThatDrawBehindNPCs.Where((Func) (p => p.PotionOfReturnOriginalUsePosition.HasValue))); - Main.PlayerRenderer.DrawPlayers(Main.Camera, (IEnumerable) this._playersThatDrawBehindNPCs); - } - - protected void DrawPlayers_AfterProjectiles() - { - Main.PotionOfReturnRenderer.DrawPlayers(Main.Camera, this._playersThatDrawAfterProjectiles.Where((Func) (p => p.PotionOfReturnOriginalUsePosition.HasValue))); - Main.PlayerRenderer.DrawPlayers(Main.Camera, (IEnumerable) this._playersThatDrawAfterProjectiles); + if (drawPlayer.head == 111 && drawPlayer.body == 73 && drawPlayer.legs == 62) + { + armorEffectDrawShadowSubtle = true; + armorEffectDrawOutlines = true; + } + if (drawPlayer.head == 134 && drawPlayer.body == 95 && drawPlayer.legs == 79) + { + armorEffectDrawShadowSubtle = true; + armorEffectDrawOutlines = true; + } + if (drawPlayer.head == 107 && drawPlayer.body == 69 && drawPlayer.legs == 58) + { + armorEffectDrawShadowSubtle = true; + armorEffectDrawShadow = true; + } + if (drawPlayer.head == 108 && drawPlayer.body == 70 && drawPlayer.legs == 59) + { + armorEffectDrawShadowSubtle = true; + armorEffectDrawShadow = true; + } + if (drawPlayer.head == 109 && drawPlayer.body == 71 && drawPlayer.legs == 60) + { + armorEffectDrawShadowSubtle = true; + armorEffectDrawShadow = true; + } + if (drawPlayer.head == 110 && drawPlayer.body == 72 && drawPlayer.legs == 61) + { + armorEffectDrawShadowSubtle = true; + armorEffectDrawShadow = true; + } + if (drawPlayer.head == 193 && drawPlayer.body == 194 && drawPlayer.legs == 134) + { + armorEffectDrawShadowSubtle = true; + armorEffectDrawShadowLokis = true; + armorEffectDrawOutlines = true; + } + if (drawPlayer.mount.Active && drawPlayer.mount.Type == 3 && (double) drawPlayer.velocity.Y != 0.0 && !drawPlayer.SlimeDontHyperJump) + armorEffectDrawShadow = true; + if (drawPlayer.mount.Active && drawPlayer.mount.Type == 10 && (double) Math.Abs(drawPlayer.velocity.X) > (double) drawPlayer.mount.DashSpeed - (double) drawPlayer.mount.RunSpeed / 2.0) + armorEffectDrawShadow = true; + if (drawPlayer.mount.Active && drawPlayer.mount.Type == 14 && (double) Math.Abs(drawPlayer.velocity.X) > (double) drawPlayer.mount.RunSpeed / 2.0) + armorEffectDrawShadowBasilisk = true; + if (drawPlayer.body == 67 && drawPlayer.legs == 56 && drawPlayer.head >= 103 && drawPlayer.head <= 105) + armorEffectDrawShadow = true; + if ((drawPlayer.head == 78 || drawPlayer.head == 79 || drawPlayer.head == 80) && drawPlayer.body == 51 && drawPlayer.legs == 47) + armorEffectDrawShadowSubtle = true; + if (drawPlayer.head == 200 && drawPlayer.body == 198 && drawPlayer.legs == 142) + { + armorEffectDrawShadowLokis = true; + armorEffectDrawOutlinesForbidden = true; + } + if (drawPlayer.head == 171 && drawPlayer.body == 177 && drawPlayer.legs == 112) + { + armorEffectDrawShadow = true; + armorEffectDrawOutlines = true; + } + if (drawPlayer.head == 169 && drawPlayer.body == 175 && drawPlayer.legs == 110) + armorEffectDrawShadow = true; + if (drawPlayer.head == 170 && drawPlayer.body == 176 && drawPlayer.legs == 111) + { + armorEffectDrawShadowLokis = true; + armorEffectDrawOutlines = true; + } + if (drawPlayer.eocDash > 0) + armorEffectEOCShield = true; + else if (drawPlayer.dashDelay < 0) + armorEffectDrawShadow = true; + if (drawPlayer.head == 5 && drawPlayer.body == 5 && drawPlayer.legs == 5) + armorEffectDrawShadow = true; + if (drawPlayer.head == 74 && drawPlayer.body == 48 && drawPlayer.legs == 44) + armorEffectDrawShadow = true; + if (drawPlayer.head == 76 && drawPlayer.body == 49 && drawPlayer.legs == 45) + armorEffectDrawShadow = true; + if (drawPlayer.head == 7 && drawPlayer.body == 7 && drawPlayer.legs == 7) + armorEffectDrawShadow = true; + if (drawPlayer.head == 22 && drawPlayer.body == 14 && drawPlayer.legs == 14) + armorEffectDrawShadow = true; + if (drawPlayer.dye[0].dye == (byte) 30 && drawPlayer.dye[1].dye == (byte) 30 && drawPlayer.dye[2].dye == (byte) 30 && drawPlayer.head == 4 && drawPlayer.body == 27 && drawPlayer.legs == 26) + { + armorEffectDrawShadow = true; + armorEffectDrawOutlines = true; + } + if (drawPlayer.head == 189 && drawPlayer.body == 190 && drawPlayer.legs == 130) + armorEffectDrawOutlines = true; + if (drawPlayer.body == 17 && drawPlayer.legs == 16 && (drawPlayer.head == 29 || drawPlayer.head == 30 || drawPlayer.head == 31)) + armorEffectDrawShadow = true; + if (drawPlayer.body == 19 && drawPlayer.legs == 18 && (drawPlayer.head == 35 || drawPlayer.head == 36 || drawPlayer.head == 37)) + armorEffectDrawOutlines = true; + if (drawPlayer.body == 24 && drawPlayer.legs == 23 && (drawPlayer.head == 41 || drawPlayer.head == 42 || drawPlayer.head == 43)) + { + armorEffectDrawOutlines = true; + armorEffectDrawShadow = true; + } + if (drawPlayer.head == 157 && drawPlayer.legs == 98 && drawPlayer.body != 105) + { + int body = drawPlayer.body; + } + if (drawPlayer.body == 36 && drawPlayer.head == 56) + armorEffectDrawOutlines = true; + if (!drawPlayer.stoned && (double) drawPlayer.stealth == 1.0) + return; + armorEffectDrawOutlines = false; + armorEffectDrawShadow = false; + armorEffectDrawShadowSubtle = false; } protected void DrawElderEye( @@ -15586,7 +17657,7 @@ label_56: int frameNumber, Microsoft.Xna.Framework.Color passedColor) { - Texture2D texture2D = TextureAssets.Extra[78].Value; + Texture2D texture2D = Main.extraTexture[78]; Vector2 origin = new Vector2(68f, 94f); Microsoft.Xna.Framework.Rectangle rectangle = texture2D.Frame(verticalFrames: 8, frameY: frameNumber); Vector2 position = worldPosition - Main.screenPosition; @@ -15606,12 +17677,13 @@ label_56: { if (Main.npc[iNPCIndex].type > 0) { - if (Main.npc[iNPCIndex].type < 663) + if (Main.npc[iNPCIndex].type < 580) { if (!Main.npc[iNPCIndex].hide) { + Main.npc[iNPCIndex].visualOffset *= 0.95f; NPC npc1 = Main.npc[iNPCIndex]; - npc1.position = npc1.position + Main.npc[iNPCIndex].netOffset; + npc1.position = npc1.position + Main.npc[iNPCIndex].visualOffset; if (Main.npc[iNPCIndex].behindTiles == behindTiles) { if (Main.npc[iNPCIndex].type == 125 || Main.npc[iNPCIndex].type == 126) @@ -15641,7 +17713,7 @@ label_56: } else { - float num6 = (float) TextureAssets.Chain12.Height() / num5; + float num6 = (float) Main.chain12Texture.Height / num5; float num7 = num3 * num6; float num8 = num4 * num6; vector2.X += num7; @@ -15649,7 +17721,7 @@ label_56: num3 = num1 - vector2.X; num4 = num2 - vector2.Y; Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - Main.spriteBatch.Draw(TextureAssets.Chain12.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain12.Width(), TextureAssets.Chain12.Height())), color, rotation, new Vector2((float) TextureAssets.Chain12.Width() * 0.5f, (float) TextureAssets.Chain12.Height() * 0.5f), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.chain12Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain12Texture.Width, Main.chain12Texture.Height)), color, rotation, new Vector2((float) Main.chain12Texture.Width * 0.5f, (float) Main.chain12Texture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); } } } @@ -15678,10 +17750,10 @@ label_56: float num15 = num10 * num13; vector2.X += num14; vector2.Y += num15; - num9 = Main.npc[NPC.plantBoss].Center.X - vector2.X + Main.npc[NPC.plantBoss].netOffset.X; - num10 = Main.npc[NPC.plantBoss].Center.Y - vector2.Y + Main.npc[NPC.plantBoss].netOffset.Y; + num9 = Main.npc[NPC.plantBoss].Center.X - vector2.X; + num10 = Main.npc[NPC.plantBoss].Center.Y - vector2.Y; Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - Main.spriteBatch.Draw(TextureAssets.Chain26.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain26.Width(), height)), color, rotation, new Vector2((float) TextureAssets.Chain26.Width() * 0.5f, (float) TextureAssets.Chain26.Height() * 0.5f), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.chain26Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain26Texture.Width, height)), color, rotation, new Vector2((float) Main.chain26Texture.Width * 0.5f, (float) Main.chain26Texture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); } } else if (Main.npc[iNPCIndex].type == 264 && Main.npc[iNPCIndex].aiStyle == 53 && NPC.plantBoss >= 0) @@ -15709,10 +17781,10 @@ label_56: float num22 = num17 * num20; vector2.X += num21; vector2.Y += num22; - num16 = Main.npc[index].Center.X - vector2.X + Main.npc[index].netOffset.X; - num17 = Main.npc[index].Center.Y - vector2.Y + Main.npc[index].netOffset.Y; + num16 = Main.npc[index].Center.X - vector2.X; + num17 = Main.npc[index].Center.Y - vector2.Y; Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - Main.spriteBatch.Draw(TextureAssets.Chain27.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain27.Width(), height)), color, rotation, new Vector2((float) TextureAssets.Chain27.Width() * 0.5f, (float) TextureAssets.Chain27.Height() * 0.5f), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.chain27Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain27Texture.Width, height)), color, rotation, new Vector2((float) Main.chain27Texture.Width * 0.5f, (float) Main.chain27Texture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); } } if (NPCID.Sets.MustAlwaysDraw[Main.npc[iNPCIndex].type] || rectangle.Intersects(new Microsoft.Xna.Framework.Rectangle((int) Main.npc[iNPCIndex].position.X, (int) Main.npc[iNPCIndex].position.Y, Main.npc[iNPCIndex].width, Main.npc[iNPCIndex].height))) @@ -15722,7 +17794,7 @@ label_56: } } NPC npc2 = Main.npc[iNPCIndex]; - npc2.position = npc2.position - Main.npc[iNPCIndex].netOffset; + npc2.position = npc2.position - Main.npc[iNPCIndex].visualOffset; } } } @@ -15737,86 +17809,43 @@ label_56: protected void DrawNPCCheckAlt(NPC n) { - ITownNPCProfile profile; - if (!TownNPCProfiles.Instance.GetProfile(n.type, out profile)) + if (NPCID.Sets.ExtraTextureCount[n.type] == 0 || !Main.NPCLoaded[n.type]) return; - TextureAssets.Npc[n.type] = profile.GetTextureNPCShouldUse(n); + Main.npcTexture[n.type] = Main.npcAltTextures[n.type][n.altTexture]; } protected void DrawNPC(int iNPCIndex, bool behindTiles) { - NPC rCurrentNPC = Main.npc[iNPCIndex]; - Vector2 screenPosition = Main.screenPosition; - this.DrawNPCDirect(Main.spriteBatch, rCurrentNPC, behindTiles, screenPosition); - } - - public void DrawNPCDirect_QueenSlimeWings( - NPC rCurrentNPC, - SpriteBatch mySpriteBatch, - Vector2 screenPos, - Vector2 drawCenter, - Microsoft.Xna.Framework.Color originColor) - { - Texture2D texture2D = TextureAssets.Extra[185].Value; - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: 4, frameY: ((int) rCurrentNPC.localAI[3] / 6)); - float scale = 0.8f; - for (int index = 0; index < 2; ++index) + NPC n = Main.npc[iNPCIndex]; + int type = n.type; + this.LoadNPC(type); + if (n.setFrameSize) { - float x = 1f; - float num1 = 0.0f; - SpriteEffects effects = SpriteEffects.None; - if (index == 1) - { - x = 0.0f; - num1 = (float) (-(double) num1 + 2.0); - effects = SpriteEffects.FlipHorizontally; - } - Vector2 origin = r.Size() * new Vector2(x, 0.5f); - Vector2 vector2 = new Vector2(drawCenter.X + num1, drawCenter.Y); - if ((double) rCurrentNPC.rotation != 0.0) - vector2 = vector2.RotatedBy((double) rCurrentNPC.rotation, rCurrentNPC.Bottom); - vector2 -= screenPos; - float num2 = MathHelper.Clamp(rCurrentNPC.velocity.Y, -6f, 6f) * -0.1f; - if (index == 0) - num2 *= -1f; - mySpriteBatch.Draw(texture2D, vector2, new Microsoft.Xna.Framework.Rectangle?(r), originColor, rCurrentNPC.rotation + num2, origin, scale, effects, 0.0f); + n.frame = new Microsoft.Xna.Framework.Rectangle(0, 0, Main.npcTexture[type].Width, Main.npcTexture[type].Height / Main.npcFrameCount[type]); + n.setFrameSize = false; } - } - - public void DrawNPCDirect( - SpriteBatch mySpriteBatch, - NPC rCurrentNPC, - bool behindTiles, - Vector2 screenPos) - { - int type = rCurrentNPC.type; - rCurrentNPC.SetFrameSize(); - Vector3 vector3; - if (rCurrentNPC.realLife == -1 && rCurrentNPC.life >= rCurrentNPC.lifeMax && !rCurrentNPC.boss) + if (n.realLife == -1 && n.life >= n.lifeMax && !n.boss) { - vector3 = Lighting.GetColor((int) ((double) rCurrentNPC.position.X + (double) rCurrentNPC.width * 0.5) / 16, (int) (((double) rCurrentNPC.position.Y + (double) rCurrentNPC.height * 0.5) / 16.0)).ToVector3(); - bool flag1 = (double) vector3.Length() > 0.432500004768372; + bool flag1 = (double) Lighting.GetColor((int) ((double) n.position.X + (double) n.width * 0.5) / 16, (int) (((double) n.position.Y + (double) n.height * 0.5) / 16.0)).ToVector3().Length() > 0.432500004768372; bool flag2 = false; - if (LockOnHelper.AimedTarget == rCurrentNPC) + if (LockOnHelper.AimedTarget == n) flag2 = true; - else if ((double) rCurrentNPC.Distance(Main.player[Main.myPlayer].Center) < 350.0 & flag1) + else if ((double) n.Distance(Main.player[Main.myPlayer].Center) < 400.0 & flag1) flag2 = true; - if (flag2 && rCurrentNPC.lifeMax < 5) + if (flag2 && n.lifeMax < 5) flag2 = false; - if (flag2 && rCurrentNPC.aiStyle == 25 && (double) rCurrentNPC.ai[0] == 0.0) + if (flag2 && n.aiStyle == 25 && (double) n.ai[0] == 0.0) flag2 = false; - rCurrentNPC.nameOver = !flag2 ? MathHelper.Clamp(rCurrentNPC.nameOver - 0.025f, 0.0f, 1f) : MathHelper.Clamp(rCurrentNPC.nameOver + 0.025f, 0.0f, 1f); + n.nameOver = !flag2 ? MathHelper.Clamp(n.nameOver - 0.025f, 0.0f, 1f) : MathHelper.Clamp(n.nameOver + 0.025f, 0.0f, 1f); } else - rCurrentNPC.nameOver = MathHelper.Clamp(rCurrentNPC.nameOver - 0.025f, 0.0f, 1f); - if (type == 1 && (double) rCurrentNPC.ai[0] == -999.0) - return; + n.nameOver = MathHelper.Clamp(n.nameOver - 0.025f, 0.0f, 1f); if (type == 101) { bool flag3 = true; - Vector2 vector2 = new Vector2(rCurrentNPC.position.X + (float) (rCurrentNPC.width / 2), rCurrentNPC.position.Y + (float) (rCurrentNPC.height / 2)); - float num1 = (float) ((double) rCurrentNPC.ai[0] * 16.0 + 8.0) - vector2.X; - float num2 = (float) ((double) rCurrentNPC.ai[1] * 16.0 + 8.0) - vector2.Y; + Vector2 vector2 = new Vector2(n.position.X + (float) (n.width / 2), n.position.Y + (float) (n.height / 2)); + float num1 = (float) ((double) n.ai[0] * 16.0 + 8.0) - vector2.X; + float num2 = (float) ((double) n.ai[1] * 16.0 + 8.0) - vector2.Y; float rotation = (float) Math.Atan2((double) num2, (double) num1) - 1.57f; bool flag4 = true; while (flag4) @@ -15834,28 +17863,26 @@ label_56: float num6 = num2 * num4; vector2.X += num5; vector2.Y += num6; - num1 = (float) ((double) rCurrentNPC.ai[0] * 16.0 + 8.0) - vector2.X; - num2 = (float) ((double) rCurrentNPC.ai[1] * 16.0 + 8.0) - vector2.Y; + num1 = (float) ((double) n.ai[0] * 16.0 + 8.0) - vector2.X; + num2 = (float) ((double) n.ai[1] * 16.0 + 8.0) - vector2.Y; Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - if (rCurrentNPC.IsABestiaryIconDummy) - color = rCurrentNPC.GetBestiaryEntryColor(); if (!flag3) { flag3 = true; - mySpriteBatch.Draw(TextureAssets.Chain10.Value, new Vector2(vector2.X - screenPos.X, vector2.Y - screenPos.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain10.Width(), height)), color, rotation, new Vector2((float) TextureAssets.Chain10.Width() * 0.5f, (float) TextureAssets.Chain10.Height() * 0.5f), scale, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.chain10Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain10Texture.Width, height)), color, rotation, new Vector2((float) Main.chain10Texture.Width * 0.5f, (float) Main.chain10Texture.Height * 0.5f), scale, SpriteEffects.None, 0.0f); } else { flag3 = false; - mySpriteBatch.Draw(TextureAssets.Chain11.Value, new Vector2(vector2.X - screenPos.X, vector2.Y - screenPos.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain10.Width(), height)), color, rotation, new Vector2((float) TextureAssets.Chain10.Width() * 0.5f, (float) TextureAssets.Chain10.Height() * 0.5f), scale, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.chain11Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain10Texture.Width, height)), color, rotation, new Vector2((float) Main.chain10Texture.Width * 0.5f, (float) Main.chain10Texture.Height * 0.5f), scale, SpriteEffects.None, 0.0f); } } } - else if (rCurrentNPC.aiStyle == 13) + else if (n.aiStyle == 13) { - Vector2 vector2 = new Vector2(rCurrentNPC.position.X + (float) (rCurrentNPC.width / 2), rCurrentNPC.position.Y + (float) (rCurrentNPC.height / 2)); - float num7 = (float) ((double) rCurrentNPC.ai[0] * 16.0 + 8.0) - vector2.X; - float num8 = (float) ((double) rCurrentNPC.ai[1] * 16.0 + 8.0) - vector2.Y; + Vector2 vector2 = new Vector2(n.position.X + (float) (n.width / 2), n.position.Y + (float) (n.height / 2)); + float num7 = (float) ((double) n.ai[0] * 16.0 + 8.0) - vector2.X; + float num8 = (float) ((double) n.ai[1] * 16.0 + 8.0) - vector2.Y; float rotation = (float) Math.Atan2((double) num8, (double) num7) - 1.57f; bool flag = true; while (flag) @@ -15878,11 +17905,9 @@ label_56: float num13 = num8 * num11; vector2.X += num12; vector2.Y += num13; - num7 = (float) ((double) rCurrentNPC.ai[0] * 16.0 + 8.0) - vector2.X; - num8 = (float) ((double) rCurrentNPC.ai[1] * 16.0 + 8.0) - vector2.Y; + num7 = (float) ((double) n.ai[0] * 16.0 + 8.0) - vector2.X; + num8 = (float) ((double) n.ai[1] * 16.0 + 8.0) - vector2.Y; Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - if (rCurrentNPC.IsABestiaryIconDummy) - color = rCurrentNPC.GetBestiaryEntryColor(); if (type == 259 || type == 260) { color.B = byte.MaxValue; @@ -15894,19 +17919,19 @@ label_56: switch (type) { case 56: - mySpriteBatch.Draw(TextureAssets.Chain5.Value, new Vector2(vector2.X - screenPos.X, vector2.Y - screenPos.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain4.Width(), height)), color, rotation, new Vector2((float) TextureAssets.Chain4.Width() * 0.5f, (float) TextureAssets.Chain4.Height() * 0.5f), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.chain5Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain4Texture.Width, height)), color, rotation, new Vector2((float) Main.chain4Texture.Width * 0.5f, (float) Main.chain4Texture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); continue; case 175: - mySpriteBatch.Draw(TextureAssets.Chain14.Value, new Vector2(vector2.X - screenPos.X, vector2.Y - screenPos.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain14.Width(), height)), color, rotation, new Vector2((float) TextureAssets.Chain14.Width() * 0.5f, (float) TextureAssets.Chain14.Height() * 0.5f), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.chain14Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain14Texture.Width, height)), color, rotation, new Vector2((float) Main.chain14Texture.Width * 0.5f, (float) Main.chain14Texture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); continue; case 259: - mySpriteBatch.Draw(TextureAssets.Chain24.Value, new Vector2(vector2.X - screenPos.X, vector2.Y - screenPos.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain24.Width(), height)), color, rotation, new Vector2((float) TextureAssets.Chain24.Width() * 0.5f, (float) TextureAssets.Chain24.Height() * 0.5f), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.chain24Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain24Texture.Width, height)), color, rotation, new Vector2((float) Main.chain24Texture.Width * 0.5f, (float) Main.chain24Texture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); continue; case 260: - mySpriteBatch.Draw(TextureAssets.Chain25.Value, new Vector2(vector2.X - screenPos.X, vector2.Y - screenPos.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain25.Width(), height)), color, rotation, new Vector2((float) TextureAssets.Chain25.Width() * 0.5f, (float) TextureAssets.Chain25.Height() * 0.5f), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.chain25Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain25Texture.Width, height)), color, rotation, new Vector2((float) Main.chain25Texture.Width * 0.5f, (float) Main.chain25Texture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); continue; default: - mySpriteBatch.Draw(TextureAssets.Chain4.Value, new Vector2(vector2.X - screenPos.X, vector2.Y - screenPos.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain4.Width(), height)), color, rotation, new Vector2((float) TextureAssets.Chain4.Width() * 0.5f, (float) TextureAssets.Chain4.Height() * 0.5f), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.chain4Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain4Texture.Width, height)), color, rotation, new Vector2((float) Main.chain4Texture.Width * 0.5f, (float) Main.chain4Texture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); continue; } } @@ -15914,24 +17939,24 @@ label_56: if (type == 327) { float rotation = 0.0f; - Vector2 vector2 = new Vector2(rCurrentNPC.Center.X, rCurrentNPC.Center.Y + 80f); - int num = (int) rCurrentNPC.localAI[1]; + Vector2 vector2 = new Vector2(n.Center.X, n.Center.Y + 80f); + int num = (int) n.localAI[1]; Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - mySpriteBatch.Draw(TextureAssets.PumpkingCloak.Value, new Vector2(vector2.X - screenPos.X, vector2.Y - screenPos.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, TextureAssets.PumpkingCloak.Height() / 5 * num, TextureAssets.PumpkingCloak.Width(), TextureAssets.PumpkingCloak.Height() / 5)), color, rotation, new Vector2((float) TextureAssets.PumpkingCloak.Width() * 0.5f, (float) ((double) TextureAssets.PumpkingCloak.Height() * 0.5 / 5.0)), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.pumpkingCloakTexture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, Main.pumpkingCloakTexture.Height / 5 * num, Main.pumpkingCloakTexture.Width, Main.pumpkingCloakTexture.Height / 5)), color, rotation, new Vector2((float) Main.pumpkingCloakTexture.Width * 0.5f, (float) ((double) Main.pumpkingCloakTexture.Height * 0.5 / 5.0)), 1f, SpriteEffects.None, 0.0f); } if (type == 328) { - Vector2 vector2 = new Vector2((float) ((double) rCurrentNPC.position.X + (double) rCurrentNPC.width * 0.5 - 5.0 * (double) rCurrentNPC.ai[0]), rCurrentNPC.position.Y + 20f); + Vector2 vector2 = new Vector2((float) ((double) n.position.X + (double) n.width * 0.5 - 5.0 * (double) n.ai[0]), n.position.Y + 20f); for (int index = 0; index < 2; ++index) { - float num14 = Main.npc[(int) rCurrentNPC.ai[1]].position.X + (float) (Main.npc[(int) rCurrentNPC.ai[1]].width / 2) - vector2.X; - float num15 = (float) ((double) Main.npc[(int) rCurrentNPC.ai[1]].position.Y + (double) (Main.npc[(int) rCurrentNPC.ai[1]].height / 2) - 30.0) - vector2.Y; + float num14 = Main.npc[(int) n.ai[1]].position.X + (float) (Main.npc[(int) n.ai[1]].width / 2) - vector2.X; + float num15 = (float) ((double) Main.npc[(int) n.ai[1]].position.Y + (double) (Main.npc[(int) n.ai[1]].height / 2) - 30.0) - vector2.Y; float num16; float num17; float num18; if (index == 0) { - num16 = num14 - 200f * rCurrentNPC.ai[0]; + num16 = num14 - 200f * n.ai[0]; num17 = num15 + 130f; num18 = 92f / (float) Math.Sqrt((double) num16 * (double) num16 + (double) num17 * (double) num17); vector2.X += num16 * num18; @@ -15939,7 +17964,7 @@ label_56: } else { - num16 = num14 - 50f * rCurrentNPC.ai[0]; + num16 = num14 - 50f * n.ai[0]; num17 = num15 + 80f; num18 = 60f / (float) Math.Sqrt((double) num16 * (double) num16 + (double) num17 * (double) num17); vector2.X += num16 * num18; @@ -15947,7 +17972,7 @@ label_56: } float rotation = (float) Math.Atan2((double) num17, (double) num16) - 1.57f; Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - mySpriteBatch.Draw(TextureAssets.PumpkingArm.Value, new Vector2(vector2.X - screenPos.X, vector2.Y - screenPos.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.PumpkingArm.Width(), TextureAssets.PumpkingArm.Height())), color, rotation, new Vector2((float) TextureAssets.PumpkingArm.Width() * 0.5f, (float) TextureAssets.PumpkingArm.Height() * 0.5f), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.pumpkingArmTexture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.pumpkingArmTexture.Width, Main.pumpkingArmTexture.Height)), color, rotation, new Vector2((float) Main.pumpkingArmTexture.Width * 0.5f, (float) Main.pumpkingArmTexture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); if (index == 0) { vector2.X += (float) ((double) num16 * (double) num18 / 2.0); @@ -15957,17 +17982,17 @@ label_56: } if (type == 36) { - Vector2 vector2 = new Vector2((float) ((double) rCurrentNPC.position.X + (double) rCurrentNPC.width * 0.5 - 5.0 * (double) rCurrentNPC.ai[0]), rCurrentNPC.position.Y + 20f); + Vector2 vector2 = new Vector2((float) ((double) n.position.X + (double) n.width * 0.5 - 5.0 * (double) n.ai[0]), n.position.Y + 20f); for (int index1 = 0; index1 < 2; ++index1) { - float num19 = Main.npc[(int) rCurrentNPC.ai[1]].position.X + (float) (Main.npc[(int) rCurrentNPC.ai[1]].width / 2) - vector2.X; - float num20 = Main.npc[(int) rCurrentNPC.ai[1]].position.Y + (float) (Main.npc[(int) rCurrentNPC.ai[1]].height / 2) - vector2.Y; + float num19 = Main.npc[(int) n.ai[1]].position.X + (float) (Main.npc[(int) n.ai[1]].width / 2) - vector2.X; + float num20 = Main.npc[(int) n.ai[1]].position.Y + (float) (Main.npc[(int) n.ai[1]].height / 2) - vector2.Y; float num21; float num22; float num23; if (index1 == 0) { - num21 = num19 - 200f * rCurrentNPC.ai[0]; + num21 = num19 - 200f * n.ai[0]; num22 = num20 + 130f; num23 = 92f / (float) Math.Sqrt((double) num21 * (double) num21 + (double) num22 * (double) num22); vector2.X += num21 * num23; @@ -15975,7 +18000,7 @@ label_56: } else { - num21 = num19 - 50f * rCurrentNPC.ai[0]; + num21 = num19 - 50f * n.ai[0]; num22 = num20 + 80f; num23 = 60f / (float) Math.Sqrt((double) num21 * (double) num21 + (double) num22 * (double) num22); vector2.X += num21 * num23; @@ -15983,7 +18008,7 @@ label_56: } float rotation = (float) Math.Atan2((double) num22, (double) num21) - 1.57f; Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - mySpriteBatch.Draw(TextureAssets.BoneArm.Value, new Vector2(vector2.X - screenPos.X, vector2.Y - screenPos.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.BoneArm.Width(), TextureAssets.BoneArm.Height())), color, rotation, new Vector2((float) TextureAssets.BoneArm.Width() * 0.5f, (float) TextureAssets.BoneArm.Height() * 0.5f), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.boneArmTexture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.boneArmTexture.Width, Main.boneArmTexture.Height)), color, rotation, new Vector2((float) Main.boneArmTexture.Width * 0.5f, (float) Main.boneArmTexture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); if (index1 == 0) { vector2.X += (float) ((double) num21 * (double) num23 / 2.0); @@ -15998,24 +18023,12 @@ label_56: } } } - if (rCurrentNPC.aiStyle == 47) + if (n.aiStyle == 47) { - float scale = 1f; - Vector2 vector2 = new Vector2(rCurrentNPC.Center.X, rCurrentNPC.Center.Y); - Vector2 center = rCurrentNPC.Center; - if (NPC.golemBoss != -1) - center = Main.npc[NPC.golemBoss].Center; - float num24 = center.X - vector2.X; - float num25 = center.Y - vector2.Y - 7f; + Vector2 vector2 = new Vector2(n.Center.X, n.Center.Y); + float num24 = Main.npc[NPC.golemBoss].Center.X - vector2.X; + float num25 = Main.npc[NPC.golemBoss].Center.Y - vector2.Y - 7f; float num26 = type != 247 ? num24 + 66f : num24 - 70f; - if (Main.getGoodWorld) - { - if (type == 247) - num26 += 40f; - else - num26 -= 40f; - scale = 0.5f; - } float rotation = (float) Math.Atan2((double) num25, (double) num26) - 1.57f; bool flag = true; while (flag) @@ -16027,41 +18040,32 @@ label_56: } else { - float num28 = 16f * scale / num27; + float num28 = 16f / num27; float num29 = num26 * num28; float num30 = num25 * num28; vector2.X += num29; vector2.Y += num30; - float num31 = center.X - vector2.X; - num25 = center.Y - vector2.Y - 7f; + float num31 = Main.npc[NPC.golemBoss].Center.X - vector2.X; + num25 = Main.npc[NPC.golemBoss].Center.Y - vector2.Y - 7f; num26 = type != 247 ? num31 + 66f : num31 - 70f; - if (Main.getGoodWorld) - { - num25 += 8f; - if (type == 247) - num26 += 40f; - else - num26 -= 40f; - scale = 0.5f; - } Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - mySpriteBatch.Draw(TextureAssets.Chain21.Value, new Vector2(vector2.X - screenPos.X, vector2.Y - screenPos.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain21.Width(), TextureAssets.Chain21.Height())), color, rotation, new Vector2((float) TextureAssets.Chain21.Width() * 0.5f, (float) TextureAssets.Chain21.Height() * 0.5f), scale, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.chain21Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain21Texture.Width, Main.chain21Texture.Height)), color, rotation, new Vector2((float) Main.chain21Texture.Width * 0.5f, (float) Main.chain21Texture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); } } } - if (rCurrentNPC.aiStyle >= 33 && rCurrentNPC.aiStyle <= 36) + if (n.aiStyle >= 33 && n.aiStyle <= 36) { - Vector2 vector2 = new Vector2((float) ((double) rCurrentNPC.position.X + (double) rCurrentNPC.width * 0.5 - 5.0 * (double) rCurrentNPC.ai[0]), rCurrentNPC.position.Y + 20f); + Vector2 vector2 = new Vector2((float) ((double) n.position.X + (double) n.width * 0.5 - 5.0 * (double) n.ai[0]), n.position.Y + 20f); for (int index3 = 0; index3 < 2; ++index3) { - float num32 = Main.npc[(int) rCurrentNPC.ai[1]].position.X + (float) (Main.npc[(int) rCurrentNPC.ai[1]].width / 2) - vector2.X; - float num33 = Main.npc[(int) rCurrentNPC.ai[1]].position.Y + (float) (Main.npc[(int) rCurrentNPC.ai[1]].height / 2) - vector2.Y; + float num32 = Main.npc[(int) n.ai[1]].position.X + (float) (Main.npc[(int) n.ai[1]].width / 2) - vector2.X; + float num33 = Main.npc[(int) n.ai[1]].position.Y + (float) (Main.npc[(int) n.ai[1]].height / 2) - vector2.Y; float num34; float num35; float num36; if (index3 == 0) { - num34 = num32 - 200f * rCurrentNPC.ai[0]; + num34 = num32 - 200f * n.ai[0]; num35 = num33 + 130f; num36 = 92f / (float) Math.Sqrt((double) num34 * (double) num34 + (double) num35 * (double) num35); vector2.X += num34 * num36; @@ -16069,7 +18073,7 @@ label_56: } else { - num34 = num32 - 50f * rCurrentNPC.ai[0]; + num34 = num32 - 50f * n.ai[0]; num35 = num33 + 80f; num36 = 60f / (float) Math.Sqrt((double) num34 * (double) num34 + (double) num35 * (double) num35); vector2.X += num34 * num36; @@ -16077,7 +18081,7 @@ label_56: } float rotation = (float) Math.Atan2((double) num35, (double) num34) - 1.57f; Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - mySpriteBatch.Draw(TextureAssets.BoneArm2.Value, new Vector2(vector2.X - screenPos.X, vector2.Y - screenPos.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.BoneArm.Width(), TextureAssets.BoneArm.Height())), color, rotation, new Vector2((float) TextureAssets.BoneArm.Width() * 0.5f, (float) TextureAssets.BoneArm.Height() * 0.5f), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.boneArm2Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.boneArmTexture.Width, Main.boneArmTexture.Height)), color, rotation, new Vector2((float) Main.boneArmTexture.Width * 0.5f, (float) Main.boneArmTexture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); if (index3 == 0) { vector2.X += (float) ((double) num34 * (double) num36 / 2.0); @@ -16092,13 +18096,13 @@ label_56: } } } - if (rCurrentNPC.aiStyle == 20) + if (n.aiStyle == 20) { - Vector2 vector2 = new Vector2(rCurrentNPC.position.X + (float) (rCurrentNPC.width / 2), rCurrentNPC.position.Y + (float) (rCurrentNPC.height / 2)); - float num37 = rCurrentNPC.ai[1] - vector2.X; - float num38 = rCurrentNPC.ai[2] - vector2.Y; + Vector2 vector2 = new Vector2(n.position.X + (float) (n.width / 2), n.position.Y + (float) (n.height / 2)); + float num37 = n.ai[1] - vector2.X; + float num38 = n.ai[2] - vector2.Y; float rotation = (float) Math.Atan2((double) num38, (double) num37) - 1.57f; - rCurrentNPC.rotation = rotation; + n.rotation = rotation; bool flag = true; while (flag) { @@ -16114,28 +18118,26 @@ label_56: float num42 = num38 * num40; vector2.X += num41; vector2.Y += num42; - num37 = rCurrentNPC.ai[1] - vector2.X; - num38 = rCurrentNPC.ai[2] - vector2.Y; + num37 = n.ai[1] - vector2.X; + num38 = n.ai[2] - vector2.Y; Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - mySpriteBatch.Draw(TextureAssets.Chain.Value, new Vector2(vector2.X - screenPos.X, vector2.Y - screenPos.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain.Width(), height)), color, rotation, new Vector2((float) TextureAssets.Chain.Width() * 0.5f, (float) TextureAssets.Chain.Height() * 0.5f), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.chainTexture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chainTexture.Width, height)), color, rotation, new Vector2((float) Main.chainTexture.Width * 0.5f, (float) Main.chainTexture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); } - mySpriteBatch.Draw(TextureAssets.SpikeBase.Value, new Vector2(rCurrentNPC.ai[1] - screenPos.X, rCurrentNPC.ai[2] - screenPos.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.SpikeBase.Width(), TextureAssets.SpikeBase.Height())), Lighting.GetColor((int) rCurrentNPC.ai[1] / 16, (int) ((double) rCurrentNPC.ai[2] / 16.0)), rotation - 0.75f, new Vector2((float) TextureAssets.SpikeBase.Width() * 0.5f, (float) TextureAssets.SpikeBase.Height() * 0.5f), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.spikeBaseTexture, new Vector2(n.ai[1] - Main.screenPosition.X, n.ai[2] - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.spikeBaseTexture.Width, Main.spikeBaseTexture.Height)), Lighting.GetColor((int) n.ai[1] / 16, (int) ((double) n.ai[2] / 16.0)), rotation - 0.75f, new Vector2((float) Main.spikeBaseTexture.Width * 0.5f, (float) Main.spikeBaseTexture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); } - Microsoft.Xna.Framework.Color npcColor1 = Lighting.GetColor((int) ((double) rCurrentNPC.position.X + (double) rCurrentNPC.width * 0.5) / 16, (int) (((double) rCurrentNPC.position.Y + (double) rCurrentNPC.height * 0.5) / 16.0)); - if (rCurrentNPC.IsABestiaryIconDummy) - npcColor1 = rCurrentNPC.GetBestiaryEntryColor(); + Microsoft.Xna.Framework.Color color1 = Lighting.GetColor((int) ((double) n.position.X + (double) n.width * 0.5) / 16, (int) (((double) n.position.Y + (double) n.height * 0.5) / 16.0)); if (type >= 277 && type <= 280) { - if (npcColor1.R < byte.MaxValue) - npcColor1.R = byte.MaxValue; - if (npcColor1.G < (byte) 175) - npcColor1.G = (byte) 175; + if (color1.R < byte.MaxValue) + color1.R = byte.MaxValue; + if (color1.G < (byte) 175) + color1.G = (byte) 175; } if (type == -4) { - int r1 = (int) npcColor1.R; - int g1 = (int) npcColor1.G; - int b1 = (int) npcColor1.B; + int r1 = (int) color1.R; + int g1 = (int) color1.G; + int b1 = (int) color1.B; int r2 = r1 * 2; if (r2 > (int) byte.MaxValue) r2 = (int) byte.MaxValue; @@ -16145,63 +18147,367 @@ label_56: int b2 = b1 * 2; if (b2 > (int) byte.MaxValue) b2 = (int) byte.MaxValue; - npcColor1 = new Microsoft.Xna.Framework.Color(r2, g2, b2); + color1 = new Microsoft.Xna.Framework.Color(r2, g2, b2); } if (behindTiles && type != 113 && type != 114) { - int num43 = (int) (((double) rCurrentNPC.position.X - 8.0) / 16.0); - int num44 = (int) (((double) rCurrentNPC.position.X + (double) rCurrentNPC.width + 8.0) / 16.0); - int num45 = (int) (((double) rCurrentNPC.position.Y - 8.0) / 16.0); - int num46 = (int) (((double) rCurrentNPC.position.Y + (double) rCurrentNPC.height + 8.0) / 16.0); + int num43 = (int) (((double) n.position.X - 8.0) / 16.0); + int num44 = (int) (((double) n.position.X + (double) n.width + 8.0) / 16.0); + int num45 = (int) (((double) n.position.Y - 8.0) / 16.0); + int num46 = (int) (((double) n.position.Y + (double) n.height + 8.0) / 16.0); for (int x = num43; x <= num44; ++x) { for (int y = num45; y <= num46; ++y) { if ((double) Lighting.Brightness(x, y) == 0.0) - npcColor1 = Microsoft.Xna.Framework.Color.Black; + color1 = Microsoft.Xna.Framework.Color.Black; } } } - Microsoft.Xna.Framework.Color npcColor2 = rCurrentNPC.GetNPCColorTintedByBuffs(npcColor1); + float R1 = 1f; + float G1 = 1f; + float B = 1f; + float A = 1f; + if (n.poisoned) + { + if (Main.rand.Next(30) == 0) + { + int index = Dust.NewDust(n.position, n.width, n.height, 46, Alpha: 120, Scale: 0.2f); + Main.dust[index].noGravity = true; + Main.dust[index].fadeIn = 1.9f; + } + R1 *= 0.65f; + B *= 0.75f; + color1 = Main.buffColor(color1, R1, G1, B, A); + } + if (n.venom) + { + if (Main.rand.Next(10) == 0) + { + int index = Dust.NewDust(n.position, n.width, n.height, 171, Alpha: 100, Scale: 0.5f); + Main.dust[index].noGravity = true; + Main.dust[index].fadeIn = 1.5f; + } + G1 *= 0.45f; + R1 *= 0.75f; + color1 = Main.buffColor(color1, R1, G1, B, A); + } + if (n.midas) + { + B *= 0.3f; + R1 *= 0.85f; + color1 = Main.buffColor(color1, R1, G1, B, A); + } + if (n.shadowFlame && Main.rand.Next(5) < 4) + { + int index = Dust.NewDust(new Vector2(n.position.X - 2f, n.position.Y - 2f), n.width + 4, n.height + 4, 27, n.velocity.X * 0.4f, n.velocity.Y * 0.4f, 180, Scale: 1.95f); + Main.dust[index].noGravity = true; + Main.dust[index].velocity *= 0.75f; + Main.dust[index].velocity.X *= 0.75f; + --Main.dust[index].velocity.Y; + if (Main.rand.Next(4) == 0) + { + Main.dust[index].noGravity = false; + Main.dust[index].scale *= 0.5f; + } + } + if (n.onFire) + { + if (Main.rand.Next(4) < 3) + { + int index = Dust.NewDust(new Vector2(n.position.X - 2f, n.position.Y - 2f), n.width + 4, n.height + 4, 6, n.velocity.X * 0.4f, n.velocity.Y * 0.4f, 100, Scale: 3.5f); + Main.dust[index].noGravity = true; + Main.dust[index].velocity *= 1.8f; + Main.dust[index].velocity.Y -= 0.5f; + if (Main.rand.Next(4) == 0) + { + Main.dust[index].noGravity = false; + Main.dust[index].scale *= 0.5f; + } + } + Lighting.AddLight((int) ((double) n.position.X / 16.0), (int) ((double) n.position.Y / 16.0 + 1.0), 1f, 0.3f, 0.1f); + } + if (n.daybreak) + { + if (Main.rand.Next(4) < 3) + { + int index = Dust.NewDust(new Vector2(n.position.X - 2f, n.position.Y - 2f), n.width + 4, n.height + 4, 158, n.velocity.X * 0.4f, n.velocity.Y * 0.4f, 100, Scale: 3.5f); + Main.dust[index].noGravity = true; + Main.dust[index].velocity *= 2.8f; + Main.dust[index].velocity.Y -= 0.5f; + if (Main.rand.Next(4) == 0) + { + Main.dust[index].noGravity = false; + Main.dust[index].scale *= 0.5f; + } + } + Lighting.AddLight((int) ((double) n.position.X / 16.0), (int) ((double) n.position.Y / 16.0 + 1.0), 1f, 0.3f, 0.1f); + } + if (n.betsysCurse) + { + R1 *= 0.8f; + G1 *= 0.6f; + color1 = Main.buffColor(color1, R1, G1, B, A); + if (Main.rand.Next(4) < 3) + { + int index = Dust.NewDust(new Vector2(n.position.X - 2f, n.position.Y - 2f), n.width + 4, n.height + 4, 55, n.velocity.X * 0.4f, n.velocity.Y * 0.4f, 100, Scale: 3.5f); + Main.dust[index].noGravity = true; + Main.dust[index].velocity *= 2.8f; + Main.dust[index].velocity.Y -= 1.5f; + Main.dust[index].noGravity = false; + Main.dust[index].scale = 0.9f; + Main.dust[index].color = new Microsoft.Xna.Framework.Color(0, 0, 180, (int) byte.MaxValue); + Main.dust[index].velocity *= 0.2f; + } + Lighting.AddLight((int) ((double) n.position.X / 16.0), (int) ((double) n.position.Y / 16.0 + 1.0), 0.6f, 0.1f, 0.9f); + } + if (n.oiled) + { + R1 *= 0.7f; + G1 *= 0.7f; + B *= 0.7f; + color1 = Main.buffColor(color1, R1, G1, B, A); + if (Main.rand.Next(3) != 0) + { + int Alpha = 175; + Microsoft.Xna.Framework.Color newColor = new Microsoft.Xna.Framework.Color(0, 0, 0, 140); + Vector2 position = n.position; + position.X -= 2f; + position.Y -= 2f; + if (Main.rand.Next(2) == 0) + { + int index = Dust.NewDust(position, n.width + 4, n.height + 2, 4, Alpha: Alpha, newColor: newColor, Scale: 1.4f); + if (Main.rand.Next(2) == 0) + Main.dust[index].alpha += 25; + if (Main.rand.Next(2) == 0) + Main.dust[index].alpha += 25; + Main.dust[index].noLight = true; + Main.dust[index].velocity *= 0.2f; + Main.dust[index].velocity.Y += 0.2f; + Main.dust[index].velocity += n.velocity; + } + } + } + if (n.dryadWard && (double) n.velocity.X != 0.0 && Main.rand.Next(4) == 0) + { + int index = Dust.NewDust(new Vector2(n.position.X - 2f, (float) ((double) n.position.Y + (double) n.height - 2.0)), n.width + 4, 4, 163, n.velocity.X * 0.4f, n.velocity.Y * 0.4f, 100, Scale: 1.5f); + Main.dust[index].noGravity = true; + Main.dust[index].noLight = true; + Main.dust[index].velocity *= 0.0f; + } + if (n.dryadBane && Main.rand.Next(4) == 0) + { + int index = Dust.NewDust(new Vector2(n.position.X - 2f, n.position.Y), n.width + 4, n.height, 163, n.velocity.X * 0.4f, n.velocity.Y * 0.4f, 100, Scale: 1.5f); + Main.dust[index].noGravity = true; + Main.dust[index].velocity *= new Vector2((float) ((double) Main.rand.NextFloat() * 4.0 - 2.0), 0.0f); + Main.dust[index].noLight = true; + } + if (n.loveStruck && Main.rand.Next(5) == 0) + { + Vector2 vector2 = new Vector2((float) Main.rand.Next(-10, 11), (float) Main.rand.Next(-10, 11)); + vector2.Normalize(); + vector2.X *= 0.66f; + int index = Gore.NewGore(n.position + new Vector2((float) Main.rand.Next(n.width + 1), (float) Main.rand.Next(n.height + 1)), vector2 * (float) Main.rand.Next(3, 6) * 0.33f, 331, (float) Main.rand.Next(40, 121) * 0.01f); + Main.gore[index].sticky = false; + Main.gore[index].velocity *= 0.4f; + Main.gore[index].velocity.Y -= 0.6f; + } + if (n.stinky) + { + R1 *= 0.7f; + B *= 0.55f; + color1 = Main.buffColor(color1, R1, G1, B, A); + if (Main.rand.Next(5) == 0) + { + Vector2 vector2_1 = new Vector2((float) Main.rand.Next(-10, 11), (float) Main.rand.Next(-10, 11)); + vector2_1.Normalize(); + vector2_1.X *= 0.66f; + vector2_1.Y = Math.Abs(vector2_1.Y); + Vector2 vector2_2 = vector2_1 * (float) Main.rand.Next(3, 5) * 0.25f; + int index = Dust.NewDust(n.position, n.width, n.height, 188, vector2_2.X, vector2_2.Y * 0.5f, 100, Scale: 1.5f); + Main.dust[index].velocity *= 0.1f; + Main.dust[index].velocity.Y -= 0.5f; + } + } + if (n.dripping && Main.rand.Next(4) != 0) + { + Vector2 position = n.position; + position.X -= 2f; + position.Y -= 2f; + if (Main.rand.Next(2) == 0) + { + int index = Dust.NewDust(position, n.width + 4, n.height + 2, 211, Alpha: 50, Scale: 0.8f); + if (Main.rand.Next(2) == 0) + Main.dust[index].alpha += 25; + if (Main.rand.Next(2) == 0) + Main.dust[index].alpha += 25; + Main.dust[index].noLight = true; + Main.dust[index].velocity *= 0.2f; + Main.dust[index].velocity.Y += 0.2f; + Main.dust[index].velocity += n.velocity; + } + else + { + int index = Dust.NewDust(position, n.width + 8, n.height + 8, 211, Alpha: 50, Scale: 1.1f); + if (Main.rand.Next(2) == 0) + Main.dust[index].alpha += 25; + if (Main.rand.Next(2) == 0) + Main.dust[index].alpha += 25; + Main.dust[index].noLight = true; + Main.dust[index].noGravity = true; + Main.dust[index].velocity *= 0.2f; + ++Main.dust[index].velocity.Y; + Main.dust[index].velocity += n.velocity; + } + } + if (n.drippingSlime) + { + if (Main.rand.Next(4) != 0) + { + int Alpha = 175; + Microsoft.Xna.Framework.Color newColor = new Microsoft.Xna.Framework.Color(0, 80, (int) byte.MaxValue, 100); + Vector2 position = n.position; + position.X -= 2f; + position.Y -= 2f; + if (Main.rand.Next(2) == 0) + { + int index = Dust.NewDust(position, n.width + 4, n.height + 2, 4, Alpha: Alpha, newColor: newColor, Scale: 1.4f); + if (Main.rand.Next(2) == 0) + Main.dust[index].alpha += 25; + if (Main.rand.Next(2) == 0) + Main.dust[index].alpha += 25; + Main.dust[index].noLight = true; + Main.dust[index].velocity *= 0.2f; + Main.dust[index].velocity.Y += 0.2f; + Main.dust[index].velocity += n.velocity; + } + } + float R2 = R1 * 0.8f; + float G2 = G1 * 0.8f; + color1 = Main.buffColor(color1, R2, G2, B, A); + } + if (n.ichor) + color1 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, 0, (int) byte.MaxValue); + if (n.onFrostBurn) + { + if (Main.rand.Next(4) < 3) + { + int index = Dust.NewDust(new Vector2(n.position.X - 2f, n.position.Y - 2f), n.width + 4, n.height + 4, 135, n.velocity.X * 0.4f, n.velocity.Y * 0.4f, 100, Scale: 3.5f); + Main.dust[index].noGravity = true; + Main.dust[index].velocity *= 1.8f; + Main.dust[index].velocity.Y -= 0.5f; + if (Main.rand.Next(4) == 0) + { + Main.dust[index].noGravity = false; + Main.dust[index].scale *= 0.5f; + } + } + Lighting.AddLight((int) ((double) n.position.X / 16.0), (int) ((double) n.position.Y / 16.0 + 1.0), 0.1f, 0.6f, 1f); + } + if (n.onFire2) + { + if (Main.rand.Next(4) < 3) + { + int index = Dust.NewDust(new Vector2(n.position.X - 2f, n.position.Y - 2f), n.width + 4, n.height + 4, 75, n.velocity.X * 0.4f, n.velocity.Y * 0.4f, 100, Scale: 3.5f); + Main.dust[index].noGravity = true; + Main.dust[index].velocity *= 1.8f; + Main.dust[index].velocity.Y -= 0.5f; + if (Main.rand.Next(4) == 0) + { + Main.dust[index].noGravity = false; + Main.dust[index].scale *= 0.5f; + } + } + Lighting.AddLight((int) ((double) n.position.X / 16.0), (int) ((double) n.position.Y / 16.0 + 1.0), 1f, 0.3f, 0.1f); + } + if (Main.player[Main.myPlayer].detectCreature && n.lifeMax > 1) + { + byte num47; + byte num48; + byte num49; + if (n.friendly || n.catchItem > (short) 0 || n.damage == 0 && n.lifeMax == 5) + { + num47 = (byte) 50; + num48 = byte.MaxValue; + num49 = (byte) 50; + } + else + { + num47 = byte.MaxValue; + num48 = (byte) 50; + num49 = (byte) 50; + } + if ((int) color1.R < (int) num47) + color1.R = num47; + if ((int) color1.G < (int) num48) + color1.G = num48; + if ((int) color1.B < (int) num49) + color1.B = num49; + } if (type == 50) { Vector2 zero = Vector2.Zero; float num = 0.0f; - zero.Y -= rCurrentNPC.velocity.Y; - zero.X -= rCurrentNPC.velocity.X * 2f; - float rotation = num + rCurrentNPC.velocity.X * 0.05f; - if (rCurrentNPC.frame.Y == 120) + zero.Y -= n.velocity.Y; + zero.X -= n.velocity.X * 2f; + float rotation = num + n.velocity.X * 0.05f; + if (n.frame.Y == 120) zero.Y += 2f; - if (rCurrentNPC.frame.Y == 360) + if (n.frame.Y == 360) zero.Y -= 2f; - if (rCurrentNPC.frame.Y == 480) + if (n.frame.Y == 480) zero.Y -= 6f; - mySpriteBatch.Draw(TextureAssets.Ninja.Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float) (rCurrentNPC.width / 2) + zero.X, rCurrentNPC.position.Y - screenPos.Y + (float) (rCurrentNPC.height / 2) + zero.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Ninja.Width(), TextureAssets.Ninja.Height())), npcColor2, rotation, new Vector2((float) (TextureAssets.Ninja.Width() / 2), (float) (TextureAssets.Ninja.Height() / 2)), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.ninjaTexture, new Vector2(n.position.X - Main.screenPosition.X + (float) (n.width / 2) + zero.X, n.position.Y - Main.screenPosition.Y + (float) (n.height / 2) + zero.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.ninjaTexture.Width, Main.ninjaTexture.Height)), color1, rotation, new Vector2((float) (Main.ninjaTexture.Width / 2), (float) (Main.ninjaTexture.Height / 2)), 1f, SpriteEffects.None, 0.0f); } if (type == 71) { Vector2 zero = Vector2.Zero; float num = 0.0f; - zero.Y -= rCurrentNPC.velocity.Y * 0.3f; - zero.X -= rCurrentNPC.velocity.X * 0.6f; - float rotation = num + rCurrentNPC.velocity.X * 0.09f; - if (rCurrentNPC.frame.Y == 120) + zero.Y -= n.velocity.Y * 0.3f; + zero.X -= n.velocity.X * 0.6f; + float rotation = num + n.velocity.X * 0.09f; + if (n.frame.Y == 120) zero.Y += 2f; - if (rCurrentNPC.frame.Y == 360) + if (n.frame.Y == 360) zero.Y -= 2f; - if (rCurrentNPC.frame.Y == 480) + if (n.frame.Y == 480) zero.Y -= 6f; - Main.instance.LoadItem(327); - mySpriteBatch.Draw(TextureAssets.Item[327].Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float) (rCurrentNPC.width / 2) + zero.X, rCurrentNPC.position.Y - screenPos.Y + (float) (rCurrentNPC.height / 2) + zero.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Item[327].Width(), TextureAssets.Item[327].Height())), npcColor2, rotation, new Vector2((float) (TextureAssets.Item[327].Width() / 2), (float) (TextureAssets.Item[327].Height() / 2)), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.itemTexture[327], new Vector2(n.position.X - Main.screenPosition.X + (float) (n.width / 2) + zero.X, n.position.Y - Main.screenPosition.Y + (float) (n.height / 2) + zero.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[327].Width, Main.itemTexture[327].Height)), color1, rotation, new Vector2((float) (Main.itemTexture[327].Width / 2), (float) (Main.itemTexture[327].Height / 2)), 1f, SpriteEffects.None, 0.0f); } if (type == 69) - mySpriteBatch.Draw(TextureAssets.AntLion.Value, new Vector2(rCurrentNPC.position.X - screenPos.X + (float) (rCurrentNPC.width / 2), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height + 14.0)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.AntLion.Width(), TextureAssets.AntLion.Height())), npcColor2, (float) (-(double) rCurrentNPC.rotation * 0.300000011920929), new Vector2((float) (TextureAssets.AntLion.Width() / 2), (float) (TextureAssets.AntLion.Height() / 2)), 1f, SpriteEffects.None, 0.0f); - if (type == 1 && (double) rCurrentNPC.ai[1] > 0.0) - Main.DrawNPC_SlimeItem(rCurrentNPC, type, npcColor2, 0.0f); + Main.spriteBatch.Draw(Main.antLionTexture, new Vector2(n.position.X - Main.screenPosition.X + (float) (n.width / 2), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height + 14.0)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.antLionTexture.Width, Main.antLionTexture.Height)), color1, (float) (-(double) n.rotation * 0.300000011920929), new Vector2((float) (Main.antLionTexture.Width / 2), (float) (Main.antLionTexture.Height / 2)), 1f, SpriteEffects.None, 0.0f); + if (type == 1 && (double) n.ai[1] > 0.0) + { + int index = (int) n.ai[1]; + float scale = 1f; + float num50 = 22f * n.scale; + float num51 = 18f * n.scale; + float width = (float) Main.itemTexture[index].Width; + float height = (float) Main.itemTexture[index].Height; + if ((double) width > (double) num50) + { + scale *= num50 / width; + width *= scale; + height *= scale; + } + if ((double) height > (double) num51) + { + scale *= num51 / height; + float num52 = width * scale; + float num53 = height * scale; + } + float num54 = -1f; + float num55 = 1f; + int num56 = n.frame.Y / (Main.npcTexture[type].Height / Main.npcFrameCount[type]); + float num57 = num55 - (float) num56; + float num58 = num54 + (float) (num56 * 2); + float rotation = 0.2f - 0.3f * (float) num56; + Main.spriteBatch.Draw(Main.itemTexture[index], new Vector2(n.Center.X - Main.screenPosition.X + num58, n.Center.Y - Main.screenPosition.Y + n.gfxOffY + num57), new Microsoft.Xna.Framework.Rectangle?(), color1, rotation, new Vector2((float) (Main.itemTexture[index].Width / 2), (float) (Main.itemTexture[index].Height / 2)), scale, SpriteEffects.None, 0.0f); + } float addY = 0.0f; - float addHeight = Main.NPCAddHeight(rCurrentNPC); - Vector2 halfSize = new Vector2((float) (TextureAssets.Npc[type].Width() / 2), (float) (TextureAssets.Npc[type].Height() / Main.npcFrameCount[type] / 2)); - if (type == 108 || type == 124 || type == 625) + float addHeight = Main.NPCAddHeight(iNPCIndex); + Vector2 vector2_3 = new Vector2((float) (Main.npcTexture[type].Width / 2), (float) (Main.npcTexture[type].Height / Main.npcFrameCount[type] / 2)); + if (type == 108 || type == 124) { addY = 2f; } @@ -16210,7 +18516,7 @@ label_56: switch (type) { case 357: - addY = rCurrentNPC.localAI[0]; + addY = n.localAI[0]; break; case 467: addY = 7f; @@ -16230,22 +18536,14 @@ label_56: case 490: addY = 4f; break; + case 509: + addY = -6f; + break; case 537: addY = 2f; break; - case 581: - addY = -6f; - break; - case 606: - addY -= 2f; - break; default: - if (type == 612 || type == 613) - { - addY -= 2f; - break; - } - if (type == 469 && (double) rCurrentNPC.ai[2] == 1.0) + if (type == 469 && (double) n.ai[2] == 1.0) { addY = 14f; break; @@ -16253,42 +18551,31 @@ label_56: switch (type) { case 4: - halfSize = new Vector2(55f, 107f); + vector2_3 = new Vector2(55f, 107f); break; case 125: - halfSize = new Vector2(55f, 107f); + vector2_3 = new Vector2(55f, 107f); break; case 126: - halfSize = new Vector2(55f, 107f); + vector2_3 = new Vector2(55f, 107f); break; default: - if (type == 626 || type == 627) - { - if (rCurrentNPC.wet) - { - addY = -2f; - halfSize = rCurrentNPC.frame.Size() * new Vector2(0.5f, 0.5f) + new Vector2(0.0f, -4f); - break; - } - addY = 2f; - break; - } if (type == 63 || type == 64 || type == 103) { - halfSize.Y += 4f; + vector2_3.Y += 4f; break; } switch (type) { case 69: - halfSize.Y += 8f; + vector2_3.Y += 8f; break; case 262: - halfSize.Y = 77f; + vector2_3.Y = 77f; addHeight += 26f; break; case 264: - halfSize.Y = 21f; + vector2_3.Y = 21f; addHeight += 2f; break; case 266: @@ -16306,82 +18593,86 @@ label_56: break; } } - if (rCurrentNPC.aiStyle == 10 || type == 72) - npcColor2 = Microsoft.Xna.Framework.Color.White; + if (n.aiStyle == 10 || type == 72) + color1 = Microsoft.Xna.Framework.Color.White; SpriteEffects spriteEffects = SpriteEffects.None; - if (rCurrentNPC.spriteDirection == 1) + if (n.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - if (type == 124 && (double) rCurrentNPC.localAI[0] == 0.0) + if (type == 124 && (double) n.localAI[0] == 0.0) { int num = 0; - if (rCurrentNPC.frame.Y > 56) + if (n.frame.Y > 56) num += 4; - int index = num + rCurrentNPC.frame.Y / 56; + int index = num + n.frame.Y / 56; if (index >= Main.OffsetsPlayerHeadgear.Length) index = 0; float y = Main.OffsetsPlayerHeadgear[index].Y; this.LoadProjectile(582); - Texture2D texture2D = TextureAssets.Projectile[582].Value; - Vector2 position = rCurrentNPC.Center - screenPos - new Vector2((float) texture2D.Width, (float) (texture2D.Height / Main.npcFrameCount[type])) * rCurrentNPC.scale / 2f + new Vector2(0.0f, addY + addHeight + rCurrentNPC.gfxOffY + y) + new Vector2((float) (-rCurrentNPC.spriteDirection * 2), -2f); - mySpriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(), rCurrentNPC.GetAlpha(npcColor2), rCurrentNPC.rotation, texture2D.Size() * new Vector2(0.0f, 0.5f), rCurrentNPC.scale, spriteEffects, 0.0f); + Texture2D texture2D = Main.projectileTexture[582]; + Vector2 position = n.Center - Main.screenPosition - new Vector2((float) texture2D.Width, (float) (texture2D.Height / Main.npcFrameCount[type])) * n.scale / 2f + new Vector2(0.0f, addY + addHeight + n.gfxOffY + y) + new Vector2((float) (-n.spriteDirection * 2), -2f); + Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(), n.GetAlpha(color1), n.rotation, texture2D.Size() * new Vector2(0.0f, 0.5f), n.scale, spriteEffects, 0.0f); } - if (type == 427 || type == 426 || type == 428 || type == 581 || type == 521 || type == 523 || type == 541 || type >= 542 && type <= 545 || type == 546 || type == 552 || type == 553 || type == 554 || type == 561 || type == 562 || type == 563 || type == 555 || type == 556 || type == 557 || type == 558 || type == 559 || type == 560 || type == 574 || type == 575 || type == 568 || type == 569 || type == 572 || type == 573 || type == 566 || type == 567 || type == 570 || type == 578 || type == 571 || type == 583 || type == 584 || type == 585 || type == 618 || type == 620 || type == 661) + if (type == 427 || type == 426 || type == 428 || type == 509 || type == 521 || type == 523 || type == 541 || type >= 542 && type <= 545 || type == 546 || type == 552 || type == 553 || type == 554 || type == 561 || type == 562 || type == 563 || type == 555 || type == 556 || type == 557 || type == 558 || type == 559 || type == 560 || type == 574 || type == 575 || type == 568 || type == 569 || type == 572 || type == 573 || type == 566 || type == 567 || type == 570 || type == 578 || type == 571) { - Texture2D texture = TextureAssets.Npc[type].Value; + Texture2D texture = Main.npcTexture[type]; Microsoft.Xna.Framework.Color secondColor = Microsoft.Xna.Framework.Color.White; float amount1 = 0.0f; float amount2 = 0.0f; - int num47 = 0; - int num48 = 0; - int num49 = 1; - int num50 = 15; - int num51 = 0; - float scale1 = rCurrentNPC.scale; - float num52 = rCurrentNPC.scale; - int num53 = 0; - float t1 = 0.0f; - float num54 = 0.0f; - float num55 = 0.0f; - Microsoft.Xna.Framework.Color newColor1 = npcColor2; - Vector2 origin1 = halfSize; + int num59 = 0; + int num60 = 0; + int num61 = 1; + int num62 = 15; + int num63 = 0; + float scale1 = n.scale; + float num64 = n.scale; + int num65 = 0; + float num66 = 0.0f; + float num67 = 0.0f; + float num68 = 0.0f; + Microsoft.Xna.Framework.Color newColor1 = color1; switch (type) { case 426: - num53 = 4; - num54 = 4f; - t1 = (float) (Math.Cos((double) Main.GlobalTimeWrappedHourly % 1.20000004768372 / 1.20000004768372 * 6.28318548202515) / 2.0 + 0.5); + num65 = 4; + num67 = 4f; + num66 = (float) (Math.Cos((double) Main.GlobalTime % 1.20000004768372 / 1.20000004768372 * 6.28318548202515) / 2.0 + 0.5); secondColor = Microsoft.Xna.Framework.Color.Turquoise; amount1 = 0.5f; - num47 = 6; - num48 = 2; - num50 = num47; + num59 = 6; + num60 = 2; + num62 = num59; break; case 427: - num47 = 8; - num48 = 2; - num50 = num47 * 3; + num59 = 8; + num60 = 2; + num62 = num59 * 3; + break; + case 509: + num59 = 6; + num60 = 2; + num62 = num59 * 3; break; case 521: - num47 = 10; - num48 = 2; - num50 = num47; - num51 = 1; - num52 = 0.3f; + num59 = 10; + num60 = 2; + num62 = num59; + num63 = 1; + num64 = 0.3f; break; case 523: - num53 = 3; - num54 = 10f * rCurrentNPC.scale; + num65 = 3; + num67 = 10f * n.scale; amount1 = 0.5f; amount2 = 0.8f; secondColor = Microsoft.Xna.Framework.Color.HotPink; secondColor.A = (byte) 128; - num55 = rCurrentNPC.localAI[0]; - t1 = rCurrentNPC.localAI[1]; + num68 = n.localAI[0]; + num66 = n.localAI[1]; break; case 541: - num53 = 4; - num54 = 6f; - t1 = (float) (Math.Cos((double) Main.GlobalTimeWrappedHourly % 2.40000009536743 / 2.40000009536743 * 6.28318548202515) / 2.0 + 0.5); + num65 = 4; + num67 = 6f; + num66 = (float) (Math.Cos((double) Main.GlobalTime % 2.40000009536743 / 2.40000009536743 * 6.28318548202515) / 2.0 + 0.5); secondColor = Microsoft.Xna.Framework.Color.Gold; amount1 = 0.5f; break; @@ -16389,14 +18680,14 @@ label_56: case 543: case 544: case 545: - num47 = 6; - num48 = 3; - num50 = num47 * 2; + num59 = 6; + num60 = 3; + num62 = num59 * 2; break; case 546: - num47 = 8; - num48 = 2; - num50 = num47 * 3; + num59 = 8; + num60 = 2; + num62 = num59 * 3; break; case 552: case 553: @@ -16413,7 +18704,7 @@ label_56: case 571: case 572: case 573: - num47 = 0; + num59 = 0; if (type == 561 || type == 562 || type == 563) addHeight = -8f; if (type == 555 || type == 556 || type == 557) @@ -16429,22 +18720,22 @@ label_56: { spriteEffects ^= SpriteEffects.FlipHorizontally; addHeight = -3f; - num53 = 4; - num54 = 4f; - t1 = (float) (Math.Cos((double) Main.GlobalTimeWrappedHourly % 1.5 / 1.5 * 6.28318548202515) / 6.0 + 0.75); + num65 = 4; + num67 = 4f; + num66 = (float) (Math.Cos((double) Main.GlobalTime % 1.5 / 1.5 * 6.28318548202515) / 6.0 + 0.75); secondColor = Microsoft.Xna.Framework.Color.HotPink; secondColor.A = (byte) 127; amount1 = 0.5f; } - if ((double) rCurrentNPC.localAI[3] < 60.0) + if ((double) n.localAI[3] < 60.0) { - float num56 = rCurrentNPC.localAI[3] / 60f; - num53 = 3; - t1 = (float) (1.0 - (double) num56 * (double) num56); - num54 = 8f; + float num69 = n.localAI[3] / 60f; + num65 = 3; + num66 = (float) (1.0 - (double) num69 * (double) num69); + num67 = 8f; secondColor = new Microsoft.Xna.Framework.Color((int) sbyte.MaxValue, 0, (int) byte.MaxValue, 0); amount2 = 1f; - newColor1 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, newColor1, num56 * num56); + newColor1 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, newColor1, num69 * num69); break; } break; @@ -16453,2651 +18744,1882 @@ label_56: case 560: case 574: case 575: - if ((double) rCurrentNPC.ai[0] != 2.0) + if ((double) n.ai[0] != 2.0) { - num47 = 0; + num59 = 0; break; } - num47 = 6; - num48 = 2; - num50 = num47 * 3; - num51 = 1; + num59 = 6; + num60 = 2; + num62 = num59 * 3; + num63 = 1; break; case 566: case 567: case 578: - num47 = 0; + num59 = 0; addHeight = -2f; break; - case 581: - num47 = 6; - num48 = 2; - num50 = num47 * 3; - break; - case 618: - float num57 = 90f; - float num58 = 180f; - if ((double) rCurrentNPC.ai[0] == 1.0 && (double) rCurrentNPC.ai[1] < (double) num57) - { - int num59 = 3; - float num60 = num57 / (float) num59; - double num61 = (double) rCurrentNPC.ai[1] % (double) num60 / (double) num60; - num53 = 6; - num54 = 15f; - t1 = (float) (num61 * 0.800000011920929 + 0.200000002980232); - } - if ((double) rCurrentNPC.ai[0] == 3.0 && (double) rCurrentNPC.ai[1] < (double) num58) - { - int num62 = 1; - float num63 = num58 / (float) num62; - float num64 = rCurrentNPC.ai[1] % num63 / num63; - num53 = 4; - num54 = 25f; - t1 = num64; - Vector2 vector2 = rCurrentNPC.scale * new Vector2(1f, (float) (0.5 + (double) num64 * 0.75)); - Texture2D texture2D = TextureAssets.Extra[59].Value; - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(); - Vector2 origin2 = r.Size() * new Vector2(0.5f, 0.5f); - for (int index = 0; index < num53; ++index) - { - Microsoft.Xna.Framework.Color color = Microsoft.Xna.Framework.Color.White * (float) ((double) Utils.GetLerpValue(0.0f, 0.5f, t1, false) * (double) Utils.GetLerpValue(1f, 0.5f, t1, false) * 0.25); - color.A = (byte) 0; - color.G = (byte) 0; - color.B = (byte) 0; - float num65 = (float) ((double) index / (double) num53 * 6.28318548202515) + rCurrentNPC.rotation + num55; - Vector2 position = rCurrentNPC.Center + num65.ToRotationVector2() * num54 * t1 - screenPos - new Vector2((float) texture.Width, (float) (texture.Height / Main.npcFrameCount[type])) * rCurrentNPC.scale / 2f + (halfSize * rCurrentNPC.scale + new Vector2(0.0f, addY + addHeight + rCurrentNPC.gfxOffY)); - mySpriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(r), color, num65, origin2, vector2 * 1.8f, spriteEffects, 0.0f); - } - for (int index = 0; index < num53; ++index) - { - Microsoft.Xna.Framework.Color color = Microsoft.Xna.Framework.Color.White * (float) ((double) Utils.GetLerpValue(0.0f, 0.5f, t1, false) * (double) Utils.GetLerpValue(1f, 0.5f, t1, false) * 0.25); - color.A = (byte) 0; - float num66 = (float) ((double) index / (double) num53 * 6.28318548202515) + rCurrentNPC.rotation + num55; - Vector2 position = rCurrentNPC.Center + num66.ToRotationVector2() * num54 * t1 - screenPos - new Vector2((float) texture.Width, (float) (texture.Height / Main.npcFrameCount[type])) * rCurrentNPC.scale / 2f + (halfSize * rCurrentNPC.scale + new Vector2(0.0f, addY + addHeight + rCurrentNPC.gfxOffY)); - mySpriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(r), color, num66, origin2, vector2 * 1.5f, spriteEffects, 0.0f); - } - break; - } - break; - case 620: - addHeight = -9f; - origin1 = rCurrentNPC.frame.Size() * new Vector2(0.5f, 0.5f) + new Vector2((float) (-4 * rCurrentNPC.spriteDirection), 0.0f); - num53 = 4; - num54 = 6f; - t1 = (float) (Math.Cos((double) Main.GlobalTimeWrappedHourly % 2.40000009536743 / 2.40000009536743 * 6.28318548202515) / 2.0 + 0.5); - secondColor = Microsoft.Xna.Framework.Color.Gold; - amount1 = 0.5f; - num47 = 6; - num48 = 2; - num50 = num47 * 3; - num51 = 1; - break; - case 661: - num53 = 6; - num54 = 6f; - t1 = MathHelper.Max((float) (Math.Cos((double) Main.GlobalTimeWrappedHourly % 2.40000009536743 / 2.40000009536743 * 6.28318548202515) / 2.0 + 0.5), Utils.GetLerpValue(0.0f, 60f, rCurrentNPC.ai[2], true)); - amount1 = 0.5f; - break; } - for (int index = num49; index < num47; index += num48) + for (int index = num61; index < num59; index += num60) { - ref Vector2 local = ref rCurrentNPC.oldPos[index]; + ref Vector2 local = ref n.oldPos[index]; Microsoft.Xna.Framework.Color newColor2 = Microsoft.Xna.Framework.Color.Lerp(newColor1, secondColor, amount1); - Microsoft.Xna.Framework.Color color = rCurrentNPC.GetAlpha(newColor2) * ((float) (num47 - index) / (float) num50); - double rotation = (double) rCurrentNPC.rotation; - if (num51 == 1) + Microsoft.Xna.Framework.Color color2 = n.GetAlpha(newColor2) * ((float) (num59 - index) / (float) num62); + double rotation = (double) n.rotation; + if (num63 == 1) { - double num67 = (double) rCurrentNPC.oldRot[index]; + double num70 = (double) n.oldRot[index]; } - float scale2 = MathHelper.Lerp(scale1, num52, (float) (1.0 - (double) (num47 - index) / (double) num50)); - Vector2 position = rCurrentNPC.oldPos[index] + new Vector2((float) rCurrentNPC.width, (float) rCurrentNPC.height) / 2f - screenPos - new Vector2((float) texture.Width, (float) (texture.Height / Main.npcFrameCount[type])) * rCurrentNPC.scale / 2f + (halfSize * rCurrentNPC.scale + new Vector2(0.0f, addY + addHeight + rCurrentNPC.gfxOffY)); - mySpriteBatch.Draw(texture, position, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), color, rCurrentNPC.rotation, halfSize, scale2, spriteEffects, 0.0f); + float scale2 = MathHelper.Lerp(scale1, num64, (float) (1.0 - (double) (num59 - index) / (double) num62)); + Vector2 position = n.oldPos[index] + new Vector2((float) n.width, (float) n.height) / 2f - Main.screenPosition - new Vector2((float) texture.Width, (float) (texture.Height / Main.npcFrameCount[type])) * n.scale / 2f + (vector2_3 * n.scale + new Vector2(0.0f, addY + addHeight + n.gfxOffY)); + Main.spriteBatch.Draw(texture, position, new Microsoft.Xna.Framework.Rectangle?(n.frame), color2, n.rotation, vector2_3, scale2, spriteEffects, 0.0f); } - for (int index = 0; index < num53; ++index) + for (int index = 0; index < num65; ++index) { - Microsoft.Xna.Framework.Color newColor3 = Microsoft.Xna.Framework.Color.Lerp(npcColor2, secondColor, amount1); - Microsoft.Xna.Framework.Color color = Microsoft.Xna.Framework.Color.Lerp(rCurrentNPC.GetAlpha(newColor3), secondColor, amount2) * (1f - t1); - Vector2 position = rCurrentNPC.Center + ((float) ((double) index / (double) num53 * 6.28318548202515) + rCurrentNPC.rotation + num55).ToRotationVector2() * num54 * t1 - screenPos - new Vector2((float) texture.Width, (float) (texture.Height / Main.npcFrameCount[type])) * rCurrentNPC.scale / 2f + (halfSize * rCurrentNPC.scale + new Vector2(0.0f, addY + addHeight + rCurrentNPC.gfxOffY)); - mySpriteBatch.Draw(texture, position, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), color, rCurrentNPC.rotation, origin1, rCurrentNPC.scale, spriteEffects, 0.0f); + Microsoft.Xna.Framework.Color newColor3 = Microsoft.Xna.Framework.Color.Lerp(color1, secondColor, amount1); + Microsoft.Xna.Framework.Color color3 = Microsoft.Xna.Framework.Color.Lerp(n.GetAlpha(newColor3), secondColor, amount2) * (1f - num66); + Vector2 position = n.Center + ((float) ((double) index / (double) num65 * 6.28318548202515) + n.rotation + num68).ToRotationVector2() * num67 * num66 - Main.screenPosition - new Vector2((float) texture.Width, (float) (texture.Height / Main.npcFrameCount[type])) * n.scale / 2f + (vector2_3 * n.scale + new Vector2(0.0f, addY + addHeight + n.gfxOffY)); + Main.spriteBatch.Draw(texture, position, new Microsoft.Xna.Framework.Rectangle?(n.frame), color3, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); } - Vector2 position1 = rCurrentNPC.Center - screenPos - new Vector2((float) texture.Width, (float) (texture.Height / Main.npcFrameCount[type])) * rCurrentNPC.scale / 2f + (halfSize * rCurrentNPC.scale + new Vector2(0.0f, addY + addHeight + rCurrentNPC.gfxOffY)); - mySpriteBatch.Draw(texture, position1, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), rCurrentNPC.GetAlpha(newColor1), rCurrentNPC.rotation, origin1, rCurrentNPC.scale, spriteEffects, 0.0f); + Vector2 position1 = n.Center - Main.screenPosition - new Vector2((float) texture.Width, (float) (texture.Height / Main.npcFrameCount[type])) * n.scale / 2f + (vector2_3 * n.scale + new Vector2(0.0f, addY + addHeight + n.gfxOffY)); + Main.spriteBatch.Draw(texture, position1, new Microsoft.Xna.Framework.Rectangle?(n.frame), n.GetAlpha(newColor1), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); if (type == 427) - mySpriteBatch.Draw(TextureAssets.GlowMask[152].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); + Main.spriteBatch.Draw(Main.glowMaskTexture[152], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); else if (type == 426) - mySpriteBatch.Draw(TextureAssets.GlowMask[153].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); + Main.spriteBatch.Draw(Main.glowMaskTexture[153], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(128 - n.alpha / 2, 128 - n.alpha / 2, 128 - n.alpha / 2, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); if (type == 541) { - Microsoft.Xna.Framework.Color color1 = new Microsoft.Xna.Framework.Color((int) sbyte.MaxValue - rCurrentNPC.alpha, (int) sbyte.MaxValue - rCurrentNPC.alpha, (int) sbyte.MaxValue - rCurrentNPC.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.Gold); - for (int index = 0; index < num53; ++index) + Microsoft.Xna.Framework.Color color4 = new Microsoft.Xna.Framework.Color((int) sbyte.MaxValue - n.alpha, (int) sbyte.MaxValue - n.alpha, (int) sbyte.MaxValue - n.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.Gold); + for (int index = 0; index < num65; ++index) { - Microsoft.Xna.Framework.Color newColor4 = color1; - Microsoft.Xna.Framework.Color color2 = rCurrentNPC.GetAlpha(newColor4) * (1f - t1); - Vector2 position2 = rCurrentNPC.Center + ((float) ((double) index / (double) num53 * 6.28318548202515) + rCurrentNPC.rotation + num55).ToRotationVector2() * (float) (4.0 * (double) t1 + 2.0) - screenPos - new Vector2((float) texture.Width, (float) (texture.Height / Main.npcFrameCount[type])) * rCurrentNPC.scale / 2f + (halfSize * rCurrentNPC.scale + new Vector2(0.0f, addY + addHeight + rCurrentNPC.gfxOffY)); - mySpriteBatch.Draw(TextureAssets.GlowMask[216].Value, position2, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), color2, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); + Microsoft.Xna.Framework.Color newColor4 = color4; + Microsoft.Xna.Framework.Color color5 = n.GetAlpha(newColor4) * (1f - num66); + Vector2 position2 = n.Center + ((float) ((double) index / (double) num65 * 6.28318548202515) + n.rotation + num68).ToRotationVector2() * (float) (4.0 * (double) num66 + 2.0) - Main.screenPosition - new Vector2((float) texture.Width, (float) (texture.Height / Main.npcFrameCount[type])) * n.scale / 2f + (vector2_3 * n.scale + new Vector2(0.0f, addY + addHeight + n.gfxOffY)); + Main.spriteBatch.Draw(Main.glowMaskTexture[216], position2, new Microsoft.Xna.Framework.Rectangle?(n.frame), color5, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); } - mySpriteBatch.Draw(TextureAssets.GlowMask[216].Value, position1, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), color1, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); + Main.spriteBatch.Draw(Main.glowMaskTexture[216], position1, new Microsoft.Xna.Framework.Rectangle?(n.frame), color4, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); } - if (type == 661) + if ((type == 568 || type == 569) && (double) n.localAI[3] >= 60.0) { - num55 = MathHelper.Lerp(0.0f, 3f, Utils.GetLerpValue(0.0f, 60f, rCurrentNPC.ai[2], true)); - for (int index = 0; index < num53; ++index) + Microsoft.Xna.Framework.Color color6 = new Microsoft.Xna.Framework.Color((int) sbyte.MaxValue - n.alpha, (int) sbyte.MaxValue - n.alpha, (int) sbyte.MaxValue - n.alpha, 0).MultiplyRGBA(secondColor); + for (int index = 0; index < num65; ++index) { - Microsoft.Xna.Framework.Color newColor5 = new Microsoft.Xna.Framework.Color((int) sbyte.MaxValue - rCurrentNPC.alpha, (int) sbyte.MaxValue - rCurrentNPC.alpha, (int) sbyte.MaxValue - rCurrentNPC.alpha, 0).MultiplyRGBA(Main.hslToRgb((float) (((double) Main.GlobalTimeWrappedHourly + (double) index / (double) num53) % 1.0), 1f, 0.5f)); - Microsoft.Xna.Framework.Color color = rCurrentNPC.GetAlpha(newColor5) * (float) (1.0 - (double) t1 * 0.5); - color.A = (byte) 0; - float num68 = 2f + rCurrentNPC.ai[2]; - Vector2 position3 = rCurrentNPC.Center + ((float) ((double) index / (double) num53 * 6.28318548202515) + rCurrentNPC.rotation + num55).ToRotationVector2() * (float) ((double) num68 * (double) t1 + 2.0) - screenPos - new Vector2((float) texture.Width, (float) (texture.Height / Main.npcFrameCount[type])) * rCurrentNPC.scale / 2f + (halfSize * rCurrentNPC.scale + new Vector2(0.0f, addY + addHeight + rCurrentNPC.gfxOffY)); - mySpriteBatch.Draw(texture, position3, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), color, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); + Microsoft.Xna.Framework.Color newColor5 = color6; + Microsoft.Xna.Framework.Color color7 = n.GetAlpha(newColor5) * (1f - num66); + Vector2 position3 = n.Center + ((float) ((double) index / (double) num65 * 6.28318548202515) + n.rotation + num68).ToRotationVector2() * (float) (4.0 * (double) num66 + 2.0) - Main.screenPosition - new Vector2((float) texture.Width, (float) (texture.Height / Main.npcFrameCount[type])) * n.scale / 2f + (vector2_3 * n.scale + new Vector2(0.0f, addY + addHeight + n.gfxOffY)); + Main.spriteBatch.Draw(Main.glowMaskTexture[224], position3, new Microsoft.Xna.Framework.Rectangle?(n.frame), color7, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); } - mySpriteBatch.Draw(texture, position1, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * 0.1f, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - } - if ((type == 568 || type == 569) && (double) rCurrentNPC.localAI[3] >= 60.0) - { - Microsoft.Xna.Framework.Color color3 = new Microsoft.Xna.Framework.Color((int) sbyte.MaxValue - rCurrentNPC.alpha, (int) sbyte.MaxValue - rCurrentNPC.alpha, (int) sbyte.MaxValue - rCurrentNPC.alpha, 0).MultiplyRGBA(secondColor); - for (int index = 0; index < num53; ++index) + Main.spriteBatch.Draw(Main.glowMaskTexture[224], position1, new Microsoft.Xna.Framework.Rectangle?(n.frame), color6, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + float t = n.localAI[0]; + if ((double) t > 0.0) { - Microsoft.Xna.Framework.Color newColor6 = color3; - Microsoft.Xna.Framework.Color color4 = rCurrentNPC.GetAlpha(newColor6) * (1f - t1); - Vector2 position4 = rCurrentNPC.Center + ((float) ((double) index / (double) num53 * 6.28318548202515) + rCurrentNPC.rotation + num55).ToRotationVector2() * (float) (4.0 * (double) t1 + 2.0) - screenPos - new Vector2((float) texture.Width, (float) (texture.Height / Main.npcFrameCount[type])) * rCurrentNPC.scale / 2f + (halfSize * rCurrentNPC.scale + new Vector2(0.0f, addY + addHeight + rCurrentNPC.gfxOffY)); - mySpriteBatch.Draw(TextureAssets.GlowMask[224].Value, position4, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), color4, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - } - mySpriteBatch.Draw(TextureAssets.GlowMask[224].Value, position1, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), color3, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - float t2 = rCurrentNPC.localAI[0]; - if ((double) t2 > 0.0) - { - Microsoft.Xna.Framework.Color color5 = new Microsoft.Xna.Framework.Color(180, 90, (int) byte.MaxValue, (int) (byte) ((Math.Cos((double) t2 * 6.28318548202515 / 60.0) * 0.5 + 0.5) * 32.0 + 0.0)) * 0.75f; - float num69 = 1f; - if ((double) t2 < 60.0) + Microsoft.Xna.Framework.Color color8 = new Microsoft.Xna.Framework.Color(180, 90, (int) byte.MaxValue, (int) (byte) ((Math.Cos((double) t * 6.28318548202515 / 60.0) * 0.5 + 0.5) * 32.0 + 0.0)) * 0.75f; + float num71 = 1f; + if ((double) t < 60.0) { - float lerpValue = Utils.GetLerpValue(0.0f, 60f, t2, false); - color5 *= lerpValue; - num69 = MathHelper.Lerp(1f, 0.5f, (float) (1.0 - (double) lerpValue * (double) lerpValue)); + float num72 = Utils.InverseLerp(0.0f, 60f, t); + color8 *= num72; + num71 = MathHelper.Lerp(1f, 0.5f, (float) (1.0 - (double) num72 * (double) num72)); } - Texture2D texture2D = TextureAssets.Extra[89].Value; - Vector2 origin3 = texture2D.Size() / 2f; - Vector2 scale3 = new Vector2(num69); - float num70 = t2 * ((float) Math.PI / 750f); - float num71 = 1.570796f; + Texture2D texture2D = Main.extraTexture[89]; + Vector2 origin = texture2D.Size() / 2f; + Vector2 scale3 = new Vector2(num71); + float num73 = t * ((float) Math.PI / 750f); + float num74 = 1.570796f; scale3.Y *= 1f; scale3.X *= 1f; - for (float num72 = 0.0f; (double) num72 < 16.0; ++num72) + for (float num75 = 0.0f; (double) num75 < 16.0; ++num75) { - float f = num70 + (float) (6.28318548202515 * ((double) num72 / 16.0)); - Vector2 position5 = rCurrentNPC.Center - screenPos + f.ToRotationVector2() * 400f * num69; - mySpriteBatch.Draw(texture2D, position5, new Microsoft.Xna.Framework.Rectangle?(), color5, f + 1.570796f + num71, origin3, scale3, SpriteEffects.None, 0.0f); + float f = num73 + (float) (6.28318548202515 * ((double) num75 / 16.0)); + Vector2 position4 = n.Center - Main.screenPosition + f.ToRotationVector2() * 400f * num71; + Main.spriteBatch.Draw(texture2D, position4, new Microsoft.Xna.Framework.Rectangle?(), color8, f + 1.570796f + num74, origin, scale3, SpriteEffects.None, 0.0f); } } } if (type == 546) - mySpriteBatch.Draw(TextureAssets.Extra[76].Value, position1, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 200), MathHelper.Clamp(rCurrentNPC.velocity.X * 0.1f, -0.3926991f, 0.3926991f), halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - if ((type == 566 || type == 567) && (double) rCurrentNPC.localAI[3] >= 115.0) - { - int frameY = (int) ((double) Main.GlobalTimeWrappedHourly % 0.5 / 0.5 * 4.0); - Texture2D texture2D = TextureAssets.Extra[80].Value; - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: 4, frameY: frameY); - Vector2 vector2 = new Vector2((float) (rCurrentNPC.spriteDirection * 8), -26f) * rCurrentNPC.scale; - int num73 = rCurrentNPC.frame.Y / rCurrentNPC.frame.Height; - int num74 = 0; - switch (num73) - { - case 0: - num74 = 6; - break; - case 1: - num74 = 4; - break; - case 2: - num74 = 2; - break; - case 3: - num74 = 6; - break; - case 4: - num74 = 8; - break; - case 5: - num74 = 6; - break; - case 6: - num74 = 4; - break; - case 7: - num74 = 6; - break; - case 8: - num74 = 2; - break; - } - Microsoft.Xna.Framework.Color color = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 130); - vector2.Y += (float) num74; - mySpriteBatch.Draw(texture2D, position1 + vector2 * rCurrentNPC.scale, new Microsoft.Xna.Framework.Rectangle?(r), color, MathHelper.Clamp(rCurrentNPC.velocity.X * 0.1f, -0.3926991f, 0.3926991f), r.Size() / 2f, rCurrentNPC.scale * 0.7f, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); - } - if (type != 618) + Main.spriteBatch.Draw(Main.extraTexture[76], position1, new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 200), MathHelper.Clamp(n.velocity.X * 0.1f, -0.3926991f, 0.3926991f), vector2_3, n.scale, spriteEffects, 0.0f); + if (type != 566 && type != 567 || (double) n.localAI[3] < 115.0) return; - mySpriteBatch.Draw(TextureAssets.Extra[129].Value, position1, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), rCurrentNPC.GetAlpha(newColor1), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); + int frameY = (int) ((double) Main.GlobalTime % 0.5 / 0.5 * 4.0); + Texture2D texture2D1 = Main.extraTexture[80]; + Microsoft.Xna.Framework.Rectangle r = texture2D1.Frame(verticalFrames: 4, frameY: frameY); + Vector2 vector2_4 = new Vector2((float) (n.spriteDirection * 8), -26f) * n.scale; + int num76 = n.frame.Y / n.frame.Height; + int num77 = 0; + switch (num76) + { + case 0: + num77 = 6; + break; + case 1: + num77 = 4; + break; + case 2: + num77 = 2; + break; + case 3: + num77 = 6; + break; + case 4: + num77 = 8; + break; + case 5: + num77 = 6; + break; + case 6: + num77 = 4; + break; + case 7: + num77 = 6; + break; + case 8: + num77 = 2; + break; + } + Microsoft.Xna.Framework.Color color9 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 130); + vector2_4.Y += (float) num77; + Main.spriteBatch.Draw(texture2D1, position1 + vector2_4 * n.scale, new Microsoft.Xna.Framework.Rectangle?(r), color9, MathHelper.Clamp(n.velocity.X * 0.1f, -0.3926991f, 0.3926991f), r.Size() / 2f, n.scale * 0.7f, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); + } + else if (type == 551) + { + Texture2D texture = Main.npcTexture[type]; + Vector2 position5 = n.Center - Main.screenPosition; + Microsoft.Xna.Framework.Rectangle frame = n.frame; + Vector2 vector2_5 = frame.Size() / 2f; + SpriteEffects effects = spriteEffects ^ SpriteEffects.FlipHorizontally; + float rotation1 = n.rotation; + Microsoft.Xna.Framework.Color color10 = color1; + Microsoft.Xna.Framework.Color color11 = Microsoft.Xna.Framework.Color.Lerp(color10, Microsoft.Xna.Framework.Color.White, 0.6f); + color11.A = (byte) 66; + Vector2 vector2_6 = new Vector2(171f, 44f); + Vector2 vector2_7 = new Vector2(230f, 52f); + Vector2 origin1 = Vector2.Lerp(vector2_6, vector2_7, 0.5f) + new Vector2(-50f, 30f); + int num78 = (int) n.localAI[0] / 4; + Vector2 spinningpoint1 = vector2_6 - origin1; + Vector2 spinningpoint2 = vector2_7 - origin1; + Texture2D texture2D2 = Main.extraTexture[82]; + if (effects.HasFlag((Enum) SpriteEffects.FlipHorizontally)) + spinningpoint2.X *= -1f; + Microsoft.Xna.Framework.Rectangle rectangle1 = texture2D2.Frame(2, 5, num78 / 5, num78 % 5); + Vector2 origin2 = new Vector2(16f, 176f); + if (effects.HasFlag((Enum) SpriteEffects.FlipHorizontally)) + origin2.X = (float) rectangle1.Width - origin2.X; + if (effects.HasFlag((Enum) SpriteEffects.FlipHorizontally)) + origin1.X = (float) frame.Width - origin1.X; + Texture2D texture2D3 = Main.extraTexture[81]; + if (effects.HasFlag((Enum) SpriteEffects.FlipHorizontally)) + spinningpoint1.X *= -1f; + Microsoft.Xna.Framework.Rectangle rectangle2 = texture2D3.Frame(2, 5, num78 / 5, num78 % 5); + Vector2 origin3 = new Vector2(215f, 170f); + if (effects.HasFlag((Enum) SpriteEffects.FlipHorizontally)) + origin3.X = (float) rectangle2.Width - origin3.X; + if ((double) Utils.InverseLerp(0.0f, 30f, n.localAI[1], true) == 1.0) + Utils.InverseLerp(60f, 30f, n.localAI[1], true); + float num79 = 2f; + Vector2 vector2_8 = n.Size / 2f - Main.screenPosition; + int num80 = -3; + int num81 = 0; + byte num82 = 2; + for (int index = 9; index > num81; index += num80) + { + Vector2 position6 = n.oldPos[index] + vector2_8; + float rotation2 = n.oldRot[index]; + Microsoft.Xna.Framework.Color color12 = color10 * (float) (1.0 - (double) index / 10.0) * 0.35f; + color12.A /= num82; + Main.spriteBatch.Draw(texture2D2, position6 + spinningpoint2.RotatedBy((double) rotation2), new Microsoft.Xna.Framework.Rectangle?(rectangle1), color12, rotation2, origin2, 1f, effects, 0.0f); + Main.spriteBatch.Draw(texture, position6, new Microsoft.Xna.Framework.Rectangle?(frame), color12, rotation2, origin1, 1f, effects, 0.0f); + Main.spriteBatch.Draw(texture2D3, position6 + spinningpoint1.RotatedBy((double) rotation2), new Microsoft.Xna.Framework.Rectangle?(rectangle2), color12, rotation2, origin3, 1f, effects, 0.0f); + } + Main.spriteBatch.Draw(texture2D2, position5 + spinningpoint2.RotatedBy((double) rotation1), new Microsoft.Xna.Framework.Rectangle?(rectangle1), color10, rotation1, origin2, 1f, effects, 0.0f); + Main.spriteBatch.Draw(texture, position5, new Microsoft.Xna.Framework.Rectangle?(frame), color10, rotation1, origin1, 1f, effects, 0.0f); + Main.spriteBatch.Draw(Main.glowMaskTexture[226], position5, new Microsoft.Xna.Framework.Rectangle?(frame), color11 * (float) (0.699999988079071 + 0.300000011920929 * (double) num79), rotation1, origin1, 1f, effects, 0.0f); + Main.spriteBatch.Draw(texture2D3, position5 + spinningpoint1.RotatedBy((double) rotation1), new Microsoft.Xna.Framework.Rectangle?(rectangle2), color10, rotation1, origin3, 1f, effects, 0.0f); + } + else if (type == 576 || type == 577) + { + Texture2D texture2D = Main.npcTexture[type]; + Vector2 position7 = n.Bottom - Main.screenPosition; + Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(5, 10, n.frame.Y / 10, n.frame.Y % 10); + Vector2 origin = r.Size() * new Vector2(0.5f, 1f); + origin.Y -= 4f; + int num83 = 94; + origin.X = n.spriteDirection != 1 ? (float) (r.Width - num83) : (float) num83; + Microsoft.Xna.Framework.Color color13 = Microsoft.Xna.Framework.Color.White; + float amount3 = 0.0f; + float amount4 = 0.0f; + int num84 = 0; + float num85 = 0.0f; + Microsoft.Xna.Framework.Color newColor6 = color1; + if ((double) n.localAI[3] < 60.0) + { + float num86 = n.localAI[3] / 60f; + num84 = 3; + num85 = (float) (1.0 - (double) num86 * (double) num86); + color13 = new Microsoft.Xna.Framework.Color((int) sbyte.MaxValue, 0, (int) byte.MaxValue, 0); + amount4 = 1f; + newColor6 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, newColor6, num86 * num86); + } + for (int index = 0; index < num84; ++index) + { + Microsoft.Xna.Framework.Color newColor7 = Microsoft.Xna.Framework.Color.Lerp(color1, color13, amount3); + Microsoft.Xna.Framework.Color color14 = Microsoft.Xna.Framework.Color.Lerp(n.GetAlpha(newColor7), color13, amount4) * (1f - num85); + Vector2 position8 = position7 - new Vector2((float) texture2D.Width, (float) (texture2D.Height / Main.npcFrameCount[type])) * n.scale / 2f + (vector2_3 * n.scale + new Vector2(0.0f, addY + addHeight + n.gfxOffY)); + Main.spriteBatch.Draw(texture2D, position8, new Microsoft.Xna.Framework.Rectangle?(r), color14, n.rotation, origin, n.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); + } + Main.spriteBatch.Draw(texture2D, position7, new Microsoft.Xna.Framework.Rectangle?(r), n.GetAlpha(newColor6), n.rotation, origin, n.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); + } + else if (type == 564 || type == 565) + { + Texture2D texture2D = Main.npcTexture[type]; + Vector2 position9 = n.Bottom - Main.screenPosition; + Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(5, 9, n.frame.Y / 9, n.frame.Y % 9); + Vector2 origin = r.Size() * new Vector2(0.5f, 1f); + origin.Y -= 10f; + int num87 = 52; + origin.X = n.spriteDirection != 1 ? (float) (r.Width - num87) : (float) num87; + Microsoft.Xna.Framework.Color color15 = Microsoft.Xna.Framework.Color.White; + float amount5 = 0.0f; + float amount6 = 0.0f; + int num88 = 0; + float num89 = 0.0f; + float num90 = 0.0f; + Microsoft.Xna.Framework.Color newColor8 = color1; + if ((double) n.localAI[3] < 60.0) + { + float num91 = n.localAI[3] / 60f; + num88 = 3; + num89 = (float) (1.0 - (double) num91 * (double) num91); + num90 = 8f; + color15 = new Microsoft.Xna.Framework.Color((int) sbyte.MaxValue, 0, (int) byte.MaxValue, 0); + amount6 = 1f; + newColor8 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, newColor8, num91 * num91); + } + for (int index = 0; index < num88; ++index) + { + Microsoft.Xna.Framework.Color newColor9 = Microsoft.Xna.Framework.Color.Lerp(color1, color15, amount5); + Microsoft.Xna.Framework.Color color16 = Microsoft.Xna.Framework.Color.Lerp(n.GetAlpha(newColor9), color15, amount6) * (1f - num89); + Vector2 position10 = position9 - new Vector2((float) texture2D.Width, (float) (texture2D.Height / Main.npcFrameCount[type])) * n.scale / 2f + (vector2_3 * n.scale + new Vector2(0.0f, addY + addHeight + n.gfxOffY)) + ((float) ((double) index / (double) num88 * 6.28318548202515)).ToRotationVector2() * num90 * num89; + Main.spriteBatch.Draw(texture2D, position10, new Microsoft.Xna.Framework.Rectangle?(r), color16, n.rotation, origin, n.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); + } + Microsoft.Xna.Framework.Color alpha = n.GetAlpha(newColor8); + int num92 = 4; + float num93 = 4f; + float num94 = (float) (0.625 + Math.Sin((double) Main.GlobalTime * 6.28318548202515 * 0.75 + 3.14159274101257) * 0.125); + for (int index = 0; index < num92; ++index) + { + Microsoft.Xna.Framework.Color color17 = alpha * (1f - num94); + Vector2 position11 = position9 - new Vector2((float) texture2D.Width, (float) (texture2D.Height / Main.npcFrameCount[type])) * n.scale / 2f + (vector2_3 * n.scale + new Vector2(0.0f, addY + addHeight + n.gfxOffY)) + ((float) ((double) index / (double) num92 * 6.28318548202515)).ToRotationVector2() * num93 * num94; + Main.spriteBatch.Draw(texture2D, position11, new Microsoft.Xna.Framework.Rectangle?(r), color17, n.rotation, origin, n.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); + } + Main.spriteBatch.Draw(texture2D, position9, new Microsoft.Xna.Framework.Rectangle?(r), alpha, n.rotation, origin, n.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); + if ((double) n.Opacity <= 0.0) + return; + Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; + white.A /= (byte) 2; + Microsoft.Xna.Framework.Color color18 = white * n.Opacity; + Main.spriteBatch.Draw(Main.glowMaskTexture[225], position9, new Microsoft.Xna.Framework.Rectangle?(r), color18, n.rotation, origin, n.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); + int num95 = 4; + float num96 = 4f; + float num97 = (float) (0.5 + Math.Sin((double) Main.GlobalTime * 6.28318548202515 * 0.75) * 0.5); + for (int index = 0; index < num95; ++index) + { + Microsoft.Xna.Framework.Color color19 = color18 * 0.35f * (1f - num97); + Vector2 position12 = position9 - new Vector2((float) texture2D.Width, (float) (texture2D.Height / Main.npcFrameCount[type])) * n.scale / 2f + (vector2_3 * n.scale + new Vector2(0.0f, addY + addHeight + n.gfxOffY)) + ((float) ((double) index / (double) num95 * 6.28318548202515)).ToRotationVector2() * num96 * num97; + Main.spriteBatch.Draw(Main.glowMaskTexture[225], position12, new Microsoft.Xna.Framework.Rectangle?(r), color19, n.rotation, origin, n.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); + } + } + else if (type == 548) + { + Texture2D texture2D4 = Main.npcTexture[type]; + Vector2 position13 = n.Bottom - Main.screenPosition; + Microsoft.Xna.Framework.Rectangle r3 = texture2D4.Frame(); + Vector2 origin = r3.Size() / 2f; + origin.Y += 30f; + origin.Y += 8f; + --origin.X; + Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; + float amount7 = 0.0f; + float amount8 = 0.0f; + int num98 = 0; + float num99 = 0.0f; + float num100 = 0.0f; + Microsoft.Xna.Framework.Color newColor10 = color1; + for (int index = 0; index < num98; ++index) + { + Microsoft.Xna.Framework.Color newColor11 = Microsoft.Xna.Framework.Color.Lerp(color1, white, amount7); + Microsoft.Xna.Framework.Color color20 = Microsoft.Xna.Framework.Color.Lerp(n.GetAlpha(newColor11), white, amount8) * (1f - num99); + Vector2 position14 = position13 - new Vector2((float) texture2D4.Width, (float) (texture2D4.Height / Main.npcFrameCount[type])) * n.scale / 2f + (vector2_3 * n.scale + new Vector2(0.0f, addY + addHeight + n.gfxOffY)) + ((float) ((double) index / (double) num98 * 6.28318548202515)).ToRotationVector2() * num100 * num99; + Main.spriteBatch.Draw(texture2D4, position14, new Microsoft.Xna.Framework.Rectangle?(r3), color20, n.rotation, origin, n.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); + } + Microsoft.Xna.Framework.Color alpha = n.GetAlpha(newColor10); + int num101 = 4; + float num102 = 4f; + float num103 = (float) (0.625 + Math.Sin((double) Main.GlobalTime * 6.28318548202515 * 0.75 + 3.14159274101257) * 0.125); + for (int index = 0; index < num101; ++index) + { + Microsoft.Xna.Framework.Color color21 = alpha; + color21.A = (byte) 0; + color21 *= 1f - num103; + Vector2 position15 = position13 - new Vector2((float) texture2D4.Width, (float) (texture2D4.Height / Main.npcFrameCount[type])) * n.scale / 2f + (vector2_3 * n.scale + new Vector2(0.0f, addY + addHeight + n.gfxOffY)) + ((float) ((double) index / (double) num101 * 6.28318548202515)).ToRotationVector2() * num102 * num103; + Main.spriteBatch.Draw(texture2D4, position15, new Microsoft.Xna.Framework.Rectangle?(r3), color21, n.rotation, origin, n.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); + } + Main.spriteBatch.Draw(texture2D4, position13, new Microsoft.Xna.Framework.Rectangle?(r3), alpha, n.rotation, origin, n.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); + if ((double) n.ai[1] == 2.0) + { + float num104 = Math.Min(1f, n.ai[0] / 120f); + Main.spriteBatch.Draw(texture2D4, position13, new Microsoft.Xna.Framework.Rectangle?(r3), new Microsoft.Xna.Framework.Color(1f, 1f, 1f, 0.0f) * num104, n.rotation, origin, n.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); + float progress = MathHelper.Clamp(n.ai[0] / 450f, 0.0f, 1f); + if (!Filters.Scene["CrystalWin"].IsActive()) + Filters.Scene.Activate("CrystalWin", n.Center); + else + Filters.Scene["CrystalWin"].GetShader().UseProgress(progress); + Filters.Scene["CrystalWin"].GetShader().UseTargetPosition(n.Center); + } + int num105 = 4; + float num106 = 4f; + float num107 = (float) (0.625 + Math.Sin((double) Main.GlobalTime * 6.28318548202515 * 0.75) * 0.125); + for (int index = 0; index < num105; ++index) + { + Microsoft.Xna.Framework.Color color22 = alpha; + color22.A = (byte) 0; + color22 *= 0.3f; + color22 *= 1f - num107; + Vector2 position16 = position13 - new Vector2((float) texture2D4.Width, (float) (texture2D4.Height / Main.npcFrameCount[type])) * n.scale / 2f + (vector2_3 * n.scale + new Vector2(0.0f, addY + addHeight + n.gfxOffY)) + ((float) ((double) index / (double) num105 * 6.28318548202515)).ToRotationVector2() * num106 * num107; + Main.spriteBatch.Draw(texture2D4, position16, new Microsoft.Xna.Framework.Rectangle?(r3), color22, n.rotation, origin, n.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); + } + if (n.alpha >= (int) byte.MaxValue) + return; + float num108 = (float) ((double) Main.GlobalTime % 3.0 / 3.0); + float num109 = num108; + if ((double) num109 > 0.5) + num109 = 1f - num108; + if ((double) num109 < 0.0) + num109 = 0.0f; + float num110 = (float) (((double) num108 + 0.5) % 1.0); + float num111 = num110; + if ((double) num111 > 0.5) + num111 = 1f - num110; + if ((double) num111 < 0.0) + num111 = 0.0f; + Texture2D texture2D5 = Main.glowMaskTexture[239]; + Microsoft.Xna.Framework.Rectangle r4 = texture2D5.Frame(); + origin = r4.Size() / 2f; + Vector2 position17 = position13 + new Vector2(0.0f, -40f); + Microsoft.Xna.Framework.Color color23 = new Microsoft.Xna.Framework.Color(140, 50, (int) byte.MaxValue, 0) * 0.6f; + Main.spriteBatch.Draw(texture2D5, position17, new Microsoft.Xna.Framework.Rectangle?(r4), color23, n.rotation, origin, n.scale * 0.75f, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); + float num112 = 1f + num108 * 0.75f; + Main.spriteBatch.Draw(texture2D5, position17, new Microsoft.Xna.Framework.Rectangle?(r4), color23 * num109, n.rotation, origin, n.scale * 0.75f * num112, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); + float num113 = 1f + num110 * 0.75f; + Main.spriteBatch.Draw(texture2D5, position17, new Microsoft.Xna.Framework.Rectangle?(r4), color23 * num111, n.rotation, origin, n.scale * 0.75f * num113, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); + Texture2D texture2D6 = Main.extraTexture[89]; + Microsoft.Xna.Framework.Rectangle r5 = texture2D6.Frame(); + origin = r5.Size() / 2f; + Vector2 scale = new Vector2(0.75f, 1f + num113) * 1.5f; + float num114 = 1f + num110 * 0.75f; + if (n.dontTakeDamageFromHostiles) + scale.Y *= 0.6f; + position17.Y -= 6f; + Main.spriteBatch.Draw(texture2D6, position17, new Microsoft.Xna.Framework.Rectangle?(r5), color23 * num111, n.rotation + 1.570796f, origin, scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); + Main.spriteBatch.Draw(texture2D6, position17, new Microsoft.Xna.Framework.Rectangle?(r5), Microsoft.Xna.Framework.Color.Lerp(color23, Microsoft.Xna.Framework.Color.White, 0.5f), n.rotation + 1.570796f, origin, 1.5f, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); + } + else if (type == 371 || type >= 454 && type <= 459) + { + Texture2D texture = Main.npcTexture[type]; + Vector2 position = n.Center - Main.screenPosition - new Vector2((float) texture.Width, (float) (texture.Height / Main.npcFrameCount[type])) * n.scale / 2f + (vector2_3 * n.scale + new Vector2(0.0f, addY + addHeight + n.gfxOffY)); + Main.spriteBatch.Draw(texture, position, new Microsoft.Xna.Framework.Rectangle?(n.frame), n.GetAlpha(color1), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + } + else if (type == 549) + { + Texture2D texture = Main.npcTexture[type]; + Vector2 position = n.Center - Main.screenPosition; + Microsoft.Xna.Framework.Rectangle frame = n.frame; + Vector2 origin = new Vector2(70f, (float) sbyte.MaxValue); + origin.Y += 8f; + Vector2 scale4 = new Vector2(n.scale); + float t1 = n.localAI[0]; + if ((double) t1 < 120.0) + scale4 *= (float) ((double) t1 / 240.0 + 0.5); + Microsoft.Xna.Framework.Color alpha = n.GetAlpha(color1); + float amount9 = Utils.InverseLerp(0.0f, 120f, t1, true); + float num115 = MathHelper.Lerp(32f, 0.0f, amount9); + Microsoft.Xna.Framework.Color color24 = alpha; + color24.A = (byte) MathHelper.Lerp((float) color24.A, 0.0f, amount9); + Microsoft.Xna.Framework.Color color25 = color24 * amount9; + if ((double) t1 >= 120.0) + color25 = alpha; + Main.spriteBatch.Draw(texture, position, new Microsoft.Xna.Framework.Rectangle?(frame), color25, n.rotation, origin, scale4, spriteEffects, 0.0f); + float y = ((float) ((((double) n.ai[0] + 54.0) % 180.0 - 120.0) / 180.0 * 2.0 * 6.28318548202515)).ToRotationVector2().Y; + if ((double) t1 >= 120.0) + { + num115 = y * 0.0f; + color25.A = (byte) ((double) color25.A * 0.5); + color25 *= (float) ((double) y / 2.0 + 0.5); + float num116 = 1f; + for (float num117 = 0.0f; (double) num117 < (double) num116; ++num117) + Main.spriteBatch.Draw(texture, position + (6.283185f / num116 * num117).ToRotationVector2() * num115, new Microsoft.Xna.Framework.Rectangle?(frame), color25, n.rotation, origin, scale4, spriteEffects, 0.0f); + } + float t2 = (float) ((double) n.ai[0] / 180.0 - 0.759999990463257); + if ((double) t2 < 0.0) + ++t2; + float amount10 = 0.0f; + float scale5 = 0.0f; + float from1 = 0.6f; + float to1 = 0.8f; + if ((double) t2 >= (double) from1 && (double) t2 <= (double) to1) + { + amount10 = Utils.InverseLerp(from1, to1, t2); + scale5 = MathHelper.Lerp(0.75f, 0.85f, amount10); + } + float from2 = to1; + float to2 = from2 + 0.13f; + if ((double) t2 >= (double) from2 && (double) t2 <= (double) to2) + { + amount10 = 1f - Utils.InverseLerp(from2, to2, t2); + scale5 = MathHelper.Lerp(1.3f, 0.85f, amount10); + } + Vector2 vector2_9 = new Vector2(0.0f, -150f); + int frameNumber = frame.Y / frame.Height; + float num118 = MathHelper.Clamp((float) (((double) t1 - 100.0) / 40.0), 0.0f, 1f); + this.DrawElderEye(Main.spriteBatch, n.Center + vector2_9, 0.75f * num118, 0.75f, frameNumber, Microsoft.Xna.Framework.Color.White); + this.DrawElderEye(Main.spriteBatch, n.Center + vector2_9, 0.75f * num118, 0.75f, frameNumber, new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue) * (float) ((double) y / 2.0 + 0.5)); + if ((double) amount10 > 0.0 && (double) scale5 > 0.0) + this.DrawElderEye(Main.spriteBatch, n.Center + vector2_9, amount10 * 0.5f, scale5, frameNumber, new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue)); + if ((double) t1 >= 120.0) + return; + float num119 = (float) (6.28318548202515 * (double) amount9 * Math.Pow((double) amount9, 2.0) * 2.0) + amount9; + color25.A = (byte) ((double) alpha.A * Math.Pow((double) amount9, 2.0) * 0.5); + float num120 = 3f; + for (float num121 = 0.0f; (double) num121 < (double) num120; ++num121) + Main.spriteBatch.Draw(texture, position + (num119 + 6.283185f / num120 * num121).ToRotationVector2() * num115, new Microsoft.Xna.Framework.Rectangle?(frame), color25, n.rotation, origin, scale4, spriteEffects, 0.0f); + } + else if (type == 493 || type == 507 || type == 422 || type == 517) + { + Texture2D texture1 = Main.npcTexture[type]; + Vector2 vector2_10 = n.Center - Main.screenPosition; + Vector2 vector2_11 = vector2_10 - new Vector2(300f, 310f); + Vector2 position = vector2_10 - new Vector2((float) texture1.Width, (float) (texture1.Height / Main.npcFrameCount[type])) * n.scale / 2f + (vector2_3 * n.scale + new Vector2(0.0f, addY + addHeight + n.gfxOffY)); + Main.spriteBatch.Draw(texture1, position, new Microsoft.Xna.Framework.Rectangle?(n.frame), n.GetAlpha(color1), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + switch (type) + { + case 422: + Texture2D texture2 = Main.glowMaskTexture[149]; + float num122 = (float) (4.0 + (double) (n.GetAlpha(color1).ToVector3() - new Vector3(0.5f)).Length() * 4.0); + for (int index = 0; index < 4; ++index) + Main.spriteBatch.Draw(texture2, position + n.velocity.RotatedBy((double) index * 1.57079637050629) * num122, new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(64, 64, 64, 0) * n.Opacity, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 493: + Texture2D texture3 = Main.glowMaskTexture[132]; + float num123 = (float) (4.0 + (double) (n.GetAlpha(color1).ToVector3() - new Vector3(0.5f)).Length() * 4.0); + for (int index = 0; index < 4; ++index) + Main.spriteBatch.Draw(texture3, position + n.velocity.RotatedBy((double) index * 1.57079637050629) * num123, new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(64, 64, 64, 0) * n.Opacity, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 507: + Texture2D texture4 = Main.glowMaskTexture[143]; + float num124 = (float) (4.0 + (double) (n.GetAlpha(color1).ToVector3() - new Vector3(0.5f)).Length() * 4.0); + for (int index = 0; index < 4; ++index) + Main.spriteBatch.Draw(texture4, position + n.velocity.RotatedBy((double) index * 1.57079637050629) * num124, new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(64, 64, 64, 0) * n.Opacity, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 517: + Texture2D texture5 = Main.glowMaskTexture[162]; + float num125 = (float) (2.0 + (double) (n.GetAlpha(color1).ToVector3() - new Vector3(0.5f)).Length() * 9.0); + for (int index = 0; index < 4; ++index) + Main.spriteBatch.Draw(texture5, position + n.velocity.RotatedBy((double) index * 1.57079637050629) * num125 + Vector2.UnitX * 2f, new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(64, 64, 64, 0) * n.Opacity, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + } + int num126 = 0; + string key = ""; + if (type <= 493) + { + if (type != 422) + { + if (type == 493) + { + num126 = NPC.ShieldStrengthTowerStardust; + key = "Stardust"; + } + } + else + { + num126 = NPC.ShieldStrengthTowerVortex; + key = "Vortex"; + } + } + else if (type != 507) + { + if (type == 517) + { + num126 = NPC.ShieldStrengthTowerSolar; + key = "Solar"; + } + } + else + { + num126 = NPC.ShieldStrengthTowerNebula; + key = "Nebula"; + } + float num127 = (float) num126 / (float) NPC.ShieldStrengthTowerMax; + if (num126 > 0) + { + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointWrap, DepthStencilState.Default, RasterizerState.CullNone, (Effect) null, Main.GameViewMatrix.ZoomMatrix); + float num128 = 0.0f; + if ((double) n.ai[3] > 0.0 && (double) n.ai[3] <= 30.0) + num128 = (float) (1.0 - (double) n.ai[3] / 30.0); + Filters.Scene[key].GetShader().UseIntensity(1f + num128).UseProgress(0.0f); + DrawData drawData = new DrawData(TextureManager.Load("Images/Misc/Perlin"), vector2_11 + new Vector2(300f, 300f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 600, 600)), Microsoft.Xna.Framework.Color.White * (float) ((double) num127 * 0.800000011920929 + 0.200000002980232), n.rotation, new Vector2(300f, 300f), n.scale * (float) (1.0 + (double) num128 * 0.0500000007450581), spriteEffects, 0); + GameShaders.Misc["ForceField"].UseColor(new Vector3((float) (1.0 + (double) num128 * 0.5))); + GameShaders.Misc["ForceField"].Apply(new DrawData?(drawData)); + drawData.Draw(Main.spriteBatch); + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, this.Rasterizer, (Effect) null, Main.Transform); + } + else if ((double) n.ai[3] > 0.0) + { + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointWrap, DepthStencilState.Default, RasterizerState.CullNone, (Effect) null, Main.GameViewMatrix.ZoomMatrix); + float progress = n.ai[3] / 120f; + float num129 = Math.Min(n.ai[3] / 30f, 1f); + Filters.Scene[key].GetShader().UseIntensity(Math.Min(5f, 15f * progress) + 1f).UseProgress(progress); + DrawData drawData = new DrawData(TextureManager.Load("Images/Misc/Perlin"), vector2_11 + new Vector2(300f, 300f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 600, 600)), new Microsoft.Xna.Framework.Color(new Vector4(1f - (float) Math.Sqrt((double) num129))), n.rotation, new Vector2(300f, 300f), n.scale * (1f + num129), spriteEffects, 0); + GameShaders.Misc["ForceField"].UseColor(new Vector3(2f)); + GameShaders.Misc["ForceField"].Apply(new DrawData?(drawData)); + drawData.Draw(Main.spriteBatch); + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, this.Rasterizer, (Effect) null, Main.Transform); + } + else + Filters.Scene[key].GetShader().UseIntensity(0.0f).UseProgress(0.0f); } else { switch (type) { - case 551: - Texture2D texture1 = TextureAssets.Npc[type].Value; - Vector2 position6 = rCurrentNPC.Center - screenPos; - Microsoft.Xna.Framework.Rectangle frame1 = rCurrentNPC.frame; - Vector2 vector2_1 = frame1.Size() / 2f; - SpriteEffects effects1 = spriteEffects ^ SpriteEffects.FlipHorizontally; - float rotation1 = rCurrentNPC.rotation; - Microsoft.Xna.Framework.Color color6 = npcColor2; - Microsoft.Xna.Framework.Color color7 = Microsoft.Xna.Framework.Color.Lerp(color6, Microsoft.Xna.Framework.Color.White, 0.6f); - color7.A = (byte) 66; - Vector2 vector2_2 = new Vector2(171f, 44f); - Vector2 vector2_3 = new Vector2(230f, 52f); - Vector2 origin4 = Vector2.Lerp(vector2_2, vector2_3, 0.5f) + new Vector2(-50f, 30f); - int num75 = (int) rCurrentNPC.localAI[0] / 4; - Vector2 spinningpoint1 = vector2_2 - origin4; - Vector2 spinningpoint2 = vector2_3 - origin4; - Texture2D texture2D1 = TextureAssets.Extra[82].Value; - if (effects1.HasFlag((Enum) SpriteEffects.FlipHorizontally)) - spinningpoint2.X *= -1f; - Microsoft.Xna.Framework.Rectangle rectangle1 = texture2D1.Frame(2, 5, num75 / 5, num75 % 5); - Vector2 origin5 = new Vector2(16f, 176f); - if (effects1.HasFlag((Enum) SpriteEffects.FlipHorizontally)) - origin5.X = (float) rectangle1.Width - origin5.X; - if (effects1.HasFlag((Enum) SpriteEffects.FlipHorizontally)) - origin4.X = (float) frame1.Width - origin4.X; - Texture2D texture2D2 = TextureAssets.Extra[81].Value; - if (effects1.HasFlag((Enum) SpriteEffects.FlipHorizontally)) - spinningpoint1.X *= -1f; - Microsoft.Xna.Framework.Rectangle rectangle2 = texture2D2.Frame(2, 5, num75 / 5, num75 % 5); - Vector2 origin6 = new Vector2(215f, 170f); - if (effects1.HasFlag((Enum) SpriteEffects.FlipHorizontally)) - origin6.X = (float) rectangle2.Width - origin6.X; - if ((double) Utils.GetLerpValue(0.0f, 30f, rCurrentNPC.localAI[1], true) == 1.0) - Utils.GetLerpValue(60f, 30f, rCurrentNPC.localAI[1], true); - float num76 = 2f; - Vector2 vector2_4 = rCurrentNPC.Size / 2f - screenPos; - int num77 = -3; - int num78 = 0; - byte num79 = 2; - for (int index = 9; index > num78; index += num77) + case 402: + this.LoadNPC(403); + this.LoadNPC(404); + NPC npc1 = n; + Texture2D texture2D7 = Main.npcTexture[npc1.type]; + Vector2 position18 = npc1.Center - Main.screenPosition - new Vector2((float) texture2D7.Width, (float) (texture2D7.Height / Main.npcFrameCount[npc1.type])) * npc1.scale / 2f + (vector2_3 * npc1.scale + new Vector2(0.0f, addY + addHeight + npc1.gfxOffY)); + int num130 = 0; + float num131 = (float) (2.0 / (double) npc1.oldPos.Length * 0.699999988079071); + for (int index = npc1.oldPos.Length - 1; (double) index >= 1.0; index -= 2) { - Vector2 position7 = rCurrentNPC.oldPos[index] + vector2_4; - float rotation2 = rCurrentNPC.oldRot[index]; - Microsoft.Xna.Framework.Color color8 = color6 * (float) (1.0 - (double) index / 10.0) * 0.35f; - color8.A /= num79; - mySpriteBatch.Draw(texture2D1, position7 + spinningpoint2.RotatedBy((double) rotation2), new Microsoft.Xna.Framework.Rectangle?(rectangle1), color8, rotation2, origin5, 1f, effects1, 0.0f); - mySpriteBatch.Draw(texture1, position7, new Microsoft.Xna.Framework.Rectangle?(frame1), color8, rotation2, origin4, 1f, effects1, 0.0f); - mySpriteBatch.Draw(texture2D2, position7 + spinningpoint1.RotatedBy((double) rotation2), new Microsoft.Xna.Framework.Rectangle?(rectangle2), color8, rotation2, origin6, 1f, effects1, 0.0f); + Texture2D texture6 = num130 != 0 ? Main.npcTexture[403] : Main.npcTexture[404]; + Main.spriteBatch.Draw(texture6, position18 + npc1.oldPos[index] - npc1.position, new Microsoft.Xna.Framework.Rectangle?(), npc1.GetAlpha(color1) * (float) (0.800000011920929 - (double) num131 * (double) index / 2.0), npc1.oldRot[index], vector2_3, npc1.scale, spriteEffects, 0.0f); + Texture2D texture7 = num130 != 0 ? Main.glowMaskTexture[133] : Main.glowMaskTexture[134]; + Main.spriteBatch.Draw(texture7, position18 + npc1.oldPos[index] - npc1.position, new Microsoft.Xna.Framework.Rectangle?(), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * (float) (1.0 - (double) num131 * (double) index / 2.0), npc1.oldRot[index], vector2_3, npc1.scale, spriteEffects, 0.0f); + ++num130; } - mySpriteBatch.Draw(texture2D1, position6 + spinningpoint2.RotatedBy((double) rotation1), new Microsoft.Xna.Framework.Rectangle?(rectangle1), color6, rotation1, origin5, 1f, effects1, 0.0f); - mySpriteBatch.Draw(texture1, position6, new Microsoft.Xna.Framework.Rectangle?(frame1), color6, rotation1, origin4, 1f, effects1, 0.0f); - mySpriteBatch.Draw(TextureAssets.GlowMask[226].Value, position6, new Microsoft.Xna.Framework.Rectangle?(frame1), color7 * (float) (0.699999988079071 + 0.300000011920929 * (double) num76), rotation1, origin4, 1f, effects1, 0.0f); - mySpriteBatch.Draw(texture2D2, position6 + spinningpoint1.RotatedBy((double) rotation1), new Microsoft.Xna.Framework.Rectangle?(rectangle2), color6, rotation1, origin6, 1f, effects1, 0.0f); + Texture2D texture8 = Main.npcTexture[npc1.type]; + Main.spriteBatch.Draw(texture8, position18, new Microsoft.Xna.Framework.Rectangle?(n.frame), n.GetAlpha(color1), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + Texture2D texture9 = Main.glowMaskTexture[135]; + Main.spriteBatch.Draw(texture9, position18, new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); break; - case 657: - Texture2D texture2D3 = TextureAssets.Npc[type].Value; - Vector2 vector2_5 = rCurrentNPC.Bottom - screenPos; - vector2_5.Y += 2f; - int num80 = Main.npcFrameCount[rCurrentNPC.type]; - int num81 = rCurrentNPC.frame.Y / rCurrentNPC.frame.Height; - Microsoft.Xna.Framework.Rectangle r3 = texture2D3.Frame(2, 16, num81 / num80, num81 % num80); - r3.Inflate(0, -2); - Vector2 origin7 = r3.Size() * new Vector2(0.5f, 1f); - Microsoft.Xna.Framework.Color color9 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.White, npcColor2, 0.5f); - if (rCurrentNPC.life <= rCurrentNPC.lifeMax / 2) - this.DrawNPCDirect_QueenSlimeWings(rCurrentNPC, mySpriteBatch, screenPos, rCurrentNPC.Center, color9); - Texture2D texture2D4 = TextureAssets.Extra[186].Value; - Microsoft.Xna.Framework.Rectangle r4 = texture2D4.Frame(); - Vector2 origin8 = r4.Size() * new Vector2(0.5f, 0.5f); - Vector2 spinningpoint3 = new Vector2(rCurrentNPC.Center.X, rCurrentNPC.Center.Y); - float num82 = 0.0f; - switch (num81) + case 488: + break; + case 519: + NPC npc2 = n; + Texture2D texture2D8 = Main.npcTexture[npc2.type]; + Vector2 position19 = npc2.Center - Main.screenPosition - new Vector2((float) texture2D8.Width, (float) (texture2D8.Height / Main.npcFrameCount[npc2.type])) * npc2.scale / 2f + (vector2_3 * npc2.scale + new Vector2(0.0f, addY + addHeight + npc2.gfxOffY)); + Texture2D texture10 = Main.npcTexture[npc2.type]; + Main.spriteBatch.Draw(texture10, position19, new Microsoft.Xna.Framework.Rectangle?(n.frame), n.GetAlpha(color1), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + int num132 = 0; + float num133 = (float) (1.0 / (double) npc2.oldPos.Length * 0.699999988079071); + for (int index = npc2.oldPos.Length - 1; (double) index >= 0.0; --index) { - case 1: - case 6: - num82 -= 10f; - break; - case 3: - case 5: - num82 += 10f; - break; - case 4: - case 12: - case 13: - case 14: - case 15: - num82 += 18f; - break; - case 7: - case 8: - num82 -= 14f; - break; - case 9: - num82 -= 16f; - break; - case 10: - num82 -= 18f; - break; - case 11: - num82 += 20f; - break; - case 20: - num82 -= 14f; - break; - case 21: - case 23: - num82 -= 18f; - break; - case 22: - num82 -= 22f; - break; + float amount = (float) (npc2.oldPos.Length - index) / (float) npc2.oldPos.Length; + Microsoft.Xna.Framework.Color color26 = Microsoft.Xna.Framework.Color.Pink * (float) (1.0 - (double) num133 * (double) index / 1.0); + color26.A = (byte) ((double) color26.A * (1.0 - (double) amount)); + Main.spriteBatch.Draw(texture10, position19 + npc2.oldPos[index] - npc2.position, new Microsoft.Xna.Framework.Rectangle?(), color26, npc2.oldRot[index], vector2_3, npc2.scale * MathHelper.Lerp(0.3f, 1.1f, amount), spriteEffects, 0.0f); + ++num132; } - spinningpoint3.Y += num82; - if ((double) rCurrentNPC.rotation != 0.0) - spinningpoint3 = spinningpoint3.RotatedBy((double) rCurrentNPC.rotation, rCurrentNPC.Bottom); - Vector2 position8 = spinningpoint3 - screenPos; - if (!rCurrentNPC.IsABestiaryIconDummy) + break; + case 522: + NPC npc3 = n; + Texture2D texture11 = Main.npcTexture[npc3.type]; + Vector2 position20 = npc3.Center - Main.screenPosition - new Vector2((float) texture11.Width, (float) (texture11.Height / Main.npcFrameCount[npc3.type])) * npc3.scale / 2f + (vector2_3 * npc3.scale + new Vector2(0.0f, addY + addHeight + npc3.gfxOffY)); + int num134 = 0; + float num135 = (float) (1.0 / (double) npc3.oldPos.Length * 1.10000002384186); + for (int index = npc3.oldPos.Length - 1; (double) index >= 0.0; --index) { - mySpriteBatch.End(); - mySpriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.Default, RasterizerState.CullNone, (Effect) null, Main.Transform); + float amount = (float) (npc3.oldPos.Length - index) / (float) npc3.oldPos.Length; + Microsoft.Xna.Framework.Color color27 = Microsoft.Xna.Framework.Color.White * (float) (1.0 - (double) num135 * (double) index / 1.0); + color27.A = (byte) ((double) color27.A * (1.0 - (double) amount)); + Main.spriteBatch.Draw(texture11, position20 + npc3.oldPos[index] - npc3.position, new Microsoft.Xna.Framework.Rectangle?(), color27, npc3.oldRot[index], vector2_3, npc3.scale * MathHelper.Lerp(0.8f, 0.3f, amount), spriteEffects, 0.0f); + ++num134; } - GameShaders.Misc["QueenSlime"].Apply(new DrawData?()); - if ((double) rCurrentNPC.ai[0] == 4.0 && (double) rCurrentNPC.velocity.Y != 0.0) - { - float num83 = 1f; - if ((double) rCurrentNPC.ai[2] == 1.0) - num83 = 6f; - for (int index = 7; index >= 0; --index) - { - float num84 = (float) (1.0 - (double) index / 8.0); - Vector2 vector2_6 = rCurrentNPC.oldPos[index] + new Vector2((float) rCurrentNPC.width * 0.5f, (float) rCurrentNPC.height); - Vector2 position9 = vector2_6 - (rCurrentNPC.Bottom - Vector2.Lerp(vector2_6, rCurrentNPC.Bottom, 0.75f)) * num83 - screenPos; - Microsoft.Xna.Framework.Color color10 = color9 * num84; - mySpriteBatch.Draw(texture2D3, position9, new Microsoft.Xna.Framework.Rectangle?(r3), color10, rCurrentNPC.rotation, origin7, rCurrentNPC.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); - } - } - if (!rCurrentNPC.IsABestiaryIconDummy) - { - mySpriteBatch.End(); - mySpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.Transform); - } - Main.pixelShader.CurrentTechnique.Passes[0].Apply(); - mySpriteBatch.Draw(texture2D4, position8, new Microsoft.Xna.Framework.Rectangle?(r4), color9, rCurrentNPC.rotation, origin8, 1f, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); - GameShaders.Misc["QueenSlime"].Apply(new DrawData?()); - if (!rCurrentNPC.IsABestiaryIconDummy) - { - mySpriteBatch.End(); - mySpriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.Default, RasterizerState.CullNone, (Effect) null, Main.Transform); - } - DrawData drawData1 = new DrawData(texture2D3, vector2_5, new Microsoft.Xna.Framework.Rectangle?(r3), rCurrentNPC.GetAlpha(color9), rCurrentNPC.rotation, origin7, rCurrentNPC.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0); - GameShaders.Misc["QueenSlime"].Apply(new DrawData?(drawData1)); - drawData1.Draw(mySpriteBatch); - Main.pixelShader.CurrentTechnique.Passes[0].Apply(); - if (!rCurrentNPC.IsABestiaryIconDummy) - { - mySpriteBatch.End(); - mySpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.Transform); - } - Texture2D texture2D5 = TextureAssets.Extra[177].Value; - Microsoft.Xna.Framework.Rectangle r5 = texture2D5.Frame(); - Vector2 origin9 = r5.Size() * new Vector2(0.5f, 0.5f); - vector2_5 = new Vector2(rCurrentNPC.Center.X, (float) ((double) rCurrentNPC.Top.Y - (double) r5.Bottom + 44.0)); - float num85 = 0.0f; - switch (num81) - { - case 1: - num85 -= 10f; - break; - case 3: - case 5: - case 6: - num85 += 10f; - break; - case 4: - case 12: - case 13: - case 14: - case 15: - num85 += 18f; - break; - case 7: - case 8: - num85 -= 14f; - break; - case 9: - num85 -= 16f; - break; - case 10: - num85 -= 18f; - break; - case 11: - num85 += 20f; - break; - case 20: - num85 -= 14f; - break; - case 21: - case 23: - num85 -= 18f; - break; - case 22: - num85 -= 22f; - break; - } - vector2_5.Y += num85; - if ((double) rCurrentNPC.rotation != 0.0) - vector2_5 = vector2_5.RotatedBy((double) rCurrentNPC.rotation, rCurrentNPC.Bottom); - Vector2 position10 = vector2_5 - screenPos; - mySpriteBatch.Draw(texture2D5, position10, new Microsoft.Xna.Framework.Rectangle?(r5), color9, rCurrentNPC.rotation, origin9, 1f, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); + Texture2D texture2D9 = Main.extraTexture[57]; + Main.spriteBatch.Draw(texture2D9, position20, new Microsoft.Xna.Framework.Rectangle?(), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), 0.0f, texture2D9.Size() / 2f, n.scale, spriteEffects, 0.0f); break; default: - if (type == 576 || type == 577) + if (type == 370 || type == 372 || type == 373) { - Texture2D texture2D6 = TextureAssets.Npc[type].Value; - Vector2 position11 = rCurrentNPC.Bottom - screenPos; - Microsoft.Xna.Framework.Rectangle r6 = texture2D6.Frame(5, 10, rCurrentNPC.frame.Y / 10, rCurrentNPC.frame.Y % 10); - Vector2 origin10 = r6.Size() * new Vector2(0.5f, 1f); - origin10.Y -= 4f; - int num86 = 94; - origin10.X = rCurrentNPC.spriteDirection != 1 ? (float) (r6.Width - num86) : (float) num86; - Microsoft.Xna.Framework.Color color11 = Microsoft.Xna.Framework.Color.White; - float amount3 = 0.0f; - float amount4 = 0.0f; - int num87 = 0; - float num88 = 0.0f; - Microsoft.Xna.Framework.Color newColor7 = npcColor2; - if ((double) rCurrentNPC.localAI[3] < 60.0) + Texture2D texture12 = Main.npcTexture[type]; + Microsoft.Xna.Framework.Color color28 = Microsoft.Xna.Framework.Color.White; + float amount11 = 0.0f; + bool flag = type == 370 && (double) n.ai[0] > 4.0; + int num136 = type != 370 ? 0 : ((double) n.ai[0] > 9.0 ? 1 : 0); + int num137 = 120; + int num138 = 60; + Microsoft.Xna.Framework.Color color29 = color1; + if (num136 != 0) + color1 = Main.buffColor(color1, 0.4f, 0.8f, 0.4f, 1f); + else if (flag) + color1 = Main.buffColor(color1, 0.5f, 0.7f, 0.5f, 1f); + else if (type == 370 && (double) n.ai[0] == 4.0 && (double) n.ai[2] > (double) num137) { - float num89 = rCurrentNPC.localAI[3] / 60f; - num87 = 3; - num88 = (float) (1.0 - (double) num89 * (double) num89); - color11 = new Microsoft.Xna.Framework.Color((int) sbyte.MaxValue, 0, (int) byte.MaxValue, 0); - amount4 = 1f; - newColor7 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, newColor7, num89 * num89); + float num139 = (n.ai[2] - (float) num137) / (float) num138; + color1 = Main.buffColor(color1, (float) (1.0 - 0.5 * (double) num139), (float) (1.0 - 0.300000011920929 * (double) num139), (float) (1.0 - 0.5 * (double) num139), 1f); } - for (int index = 0; index < num87; ++index) + int num140 = 10; + int num141 = 2; + if (type == 370) { - Microsoft.Xna.Framework.Color newColor8 = Microsoft.Xna.Framework.Color.Lerp(npcColor2, color11, amount3); - Microsoft.Xna.Framework.Color color12 = Microsoft.Xna.Framework.Color.Lerp(rCurrentNPC.GetAlpha(newColor8), color11, amount4) * (1f - num88); - Vector2 position12 = position11 - new Vector2((float) texture2D6.Width, (float) (texture2D6.Height / Main.npcFrameCount[type])) * rCurrentNPC.scale / 2f + (halfSize * rCurrentNPC.scale + new Vector2(0.0f, addY + addHeight + rCurrentNPC.gfxOffY)); - mySpriteBatch.Draw(texture2D6, position12, new Microsoft.Xna.Framework.Rectangle?(r6), color12, rCurrentNPC.rotation, origin10, rCurrentNPC.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); - } - mySpriteBatch.Draw(texture2D6, position11, new Microsoft.Xna.Framework.Rectangle?(r6), rCurrentNPC.GetAlpha(newColor7), rCurrentNPC.rotation, origin10, rCurrentNPC.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); - break; - } - if (type == 594) - { - Texture2D texture2D7 = TextureAssets.Npc[type].Value; - Vector2 position13 = rCurrentNPC.Top - screenPos; - Microsoft.Xna.Framework.Rectangle r7 = texture2D7.Frame(8, frameX: rCurrentNPC.frame.Y); - Microsoft.Xna.Framework.Rectangle rectangle3 = texture2D7.Frame(8); - Vector2 origin11 = r7.Size() * new Vector2(0.5f, 0.0f); - Microsoft.Xna.Framework.Color color13 = npcColor2; - float scale = 1f; - NPC slaveNpc = rCurrentNPC.AI_113_WindyBalloon_GetSlaveNPC(); - if (slaveNpc != null) - { - scale = slaveNpc.scale; - if ((double) slaveNpc.ai[1] > 0.0) - Main.DrawNPC_SlimeItem(slaveNpc, slaveNpc.type, color13, rCurrentNPC.rotation); - mySpriteBatch.Draw(texture2D7, position13, new Microsoft.Xna.Framework.Rectangle?(rectangle3), slaveNpc.GetAlpha(color13), rCurrentNPC.rotation, origin11, scale, spriteEffects, 0.0f); - mySpriteBatch.Draw(texture2D7, position13, new Microsoft.Xna.Framework.Rectangle?(rectangle3), slaveNpc.GetColor(color13), rCurrentNPC.rotation, origin11, scale, spriteEffects, 0.0f); - } - mySpriteBatch.Draw(texture2D7, position13, new Microsoft.Xna.Framework.Rectangle?(r7), rCurrentNPC.GetAlpha(color13), rCurrentNPC.rotation, origin11, scale, spriteEffects, 0.0f); - break; - } - if (type == 564 || type == 565) - { - Texture2D texture2D8 = TextureAssets.Npc[type].Value; - Vector2 position14 = rCurrentNPC.Bottom - screenPos; - Microsoft.Xna.Framework.Rectangle r8 = texture2D8.Frame(5, 9, rCurrentNPC.frame.Y / 9, rCurrentNPC.frame.Y % 9); - Vector2 origin12 = r8.Size() * new Vector2(0.5f, 1f); - origin12.Y -= 10f; - int num90 = 52; - origin12.X = rCurrentNPC.spriteDirection != 1 ? (float) (r8.Width - num90) : (float) num90; - Microsoft.Xna.Framework.Color color14 = Microsoft.Xna.Framework.Color.White; - float amount5 = 0.0f; - float amount6 = 0.0f; - int num91 = 0; - float num92 = 0.0f; - float num93 = 0.0f; - Microsoft.Xna.Framework.Color newColor9 = npcColor2; - if ((double) rCurrentNPC.localAI[3] < 60.0) - { - float num94 = rCurrentNPC.localAI[3] / 60f; - num91 = 3; - num92 = (float) (1.0 - (double) num94 * (double) num94); - num93 = 8f; - color14 = new Microsoft.Xna.Framework.Color((int) sbyte.MaxValue, 0, (int) byte.MaxValue, 0); - amount6 = 1f; - newColor9 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, newColor9, num94 * num94); - } - for (int index = 0; index < num91; ++index) - { - Microsoft.Xna.Framework.Color newColor10 = Microsoft.Xna.Framework.Color.Lerp(npcColor2, color14, amount5); - Microsoft.Xna.Framework.Color color15 = Microsoft.Xna.Framework.Color.Lerp(rCurrentNPC.GetAlpha(newColor10), color14, amount6) * (1f - num92); - Vector2 position15 = position14 - new Vector2((float) texture2D8.Width, (float) (texture2D8.Height / Main.npcFrameCount[type])) * rCurrentNPC.scale / 2f + (halfSize * rCurrentNPC.scale + new Vector2(0.0f, addY + addHeight + rCurrentNPC.gfxOffY)) + ((float) ((double) index / (double) num91 * 6.28318548202515)).ToRotationVector2() * num93 * num92; - mySpriteBatch.Draw(texture2D8, position15, new Microsoft.Xna.Framework.Rectangle?(r8), color15, rCurrentNPC.rotation, origin12, rCurrentNPC.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); - } - Microsoft.Xna.Framework.Color alpha = rCurrentNPC.GetAlpha(newColor9); - int num95 = 4; - float num96 = 4f; - float num97 = (float) (0.625 + Math.Sin((double) Main.GlobalTimeWrappedHourly * 6.28318548202515 * 0.75 + 3.14159274101257) * 0.125); - for (int index = 0; index < num95; ++index) - { - Microsoft.Xna.Framework.Color color16 = alpha * (1f - num97); - Vector2 position16 = position14 - new Vector2((float) texture2D8.Width, (float) (texture2D8.Height / Main.npcFrameCount[type])) * rCurrentNPC.scale / 2f + (halfSize * rCurrentNPC.scale + new Vector2(0.0f, addY + addHeight + rCurrentNPC.gfxOffY)) + ((float) ((double) index / (double) num95 * 6.28318548202515)).ToRotationVector2() * num96 * num97; - mySpriteBatch.Draw(texture2D8, position16, new Microsoft.Xna.Framework.Rectangle?(r8), color16, rCurrentNPC.rotation, origin12, rCurrentNPC.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); - } - mySpriteBatch.Draw(texture2D8, position14, new Microsoft.Xna.Framework.Rectangle?(r8), alpha, rCurrentNPC.rotation, origin12, rCurrentNPC.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); - if ((double) rCurrentNPC.Opacity <= 0.0) - break; - Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; - white.A /= (byte) 2; - white *= rCurrentNPC.Opacity; - mySpriteBatch.Draw(TextureAssets.GlowMask[225].Value, position14, new Microsoft.Xna.Framework.Rectangle?(r8), white, rCurrentNPC.rotation, origin12, rCurrentNPC.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); - int num98 = 4; - float num99 = 4f; - float num100 = (float) (0.5 + Math.Sin((double) Main.GlobalTimeWrappedHourly * 6.28318548202515 * 0.75) * 0.5); - for (int index = 0; index < num98; ++index) - { - Microsoft.Xna.Framework.Color color17 = white * 0.35f * (1f - num100); - Vector2 position17 = position14 - new Vector2((float) texture2D8.Width, (float) (texture2D8.Height / Main.npcFrameCount[type])) * rCurrentNPC.scale / 2f + (halfSize * rCurrentNPC.scale + new Vector2(0.0f, addY + addHeight + rCurrentNPC.gfxOffY)) + ((float) ((double) index / (double) num98 * 6.28318548202515)).ToRotationVector2() * num99 * num100; - mySpriteBatch.Draw(TextureAssets.GlowMask[225].Value, position17, new Microsoft.Xna.Framework.Rectangle?(r8), color17, rCurrentNPC.rotation, origin12, rCurrentNPC.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); - } - break; - } - if (type == 548) - { - Texture2D texture2D9 = TextureAssets.Npc[type].Value; - Vector2 position18 = rCurrentNPC.Bottom - screenPos; - Microsoft.Xna.Framework.Rectangle r9 = texture2D9.Frame(); - Vector2 origin13 = r9.Size() / 2f; - origin13.Y += 30f; - origin13.Y += 8f; - --origin13.X; - Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; - float amount7 = 0.0f; - float amount8 = 0.0f; - int num101 = 0; - float num102 = 0.0f; - float num103 = 0.0f; - Microsoft.Xna.Framework.Color newColor11 = npcColor2; - for (int index = 0; index < num101; ++index) - { - Microsoft.Xna.Framework.Color newColor12 = Microsoft.Xna.Framework.Color.Lerp(npcColor2, white, amount7); - Microsoft.Xna.Framework.Color color18 = Microsoft.Xna.Framework.Color.Lerp(rCurrentNPC.GetAlpha(newColor12), white, amount8) * (1f - num102); - Vector2 position19 = position18 - new Vector2((float) texture2D9.Width, (float) (texture2D9.Height / Main.npcFrameCount[type])) * rCurrentNPC.scale / 2f + (halfSize * rCurrentNPC.scale + new Vector2(0.0f, addY + addHeight + rCurrentNPC.gfxOffY)) + ((float) ((double) index / (double) num101 * 6.28318548202515)).ToRotationVector2() * num103 * num102; - mySpriteBatch.Draw(texture2D9, position19, new Microsoft.Xna.Framework.Rectangle?(r9), color18, rCurrentNPC.rotation, origin13, rCurrentNPC.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); - } - Microsoft.Xna.Framework.Color alpha = rCurrentNPC.GetAlpha(newColor11); - int num104 = 4; - float num105 = 4f; - float num106 = (float) (0.625 + Math.Sin((double) Main.GlobalTimeWrappedHourly * 6.28318548202515 * 0.75 + 3.14159274101257) * 0.125); - for (int index = 0; index < num104; ++index) - { - Microsoft.Xna.Framework.Color color19 = alpha; - color19.A = (byte) 0; - Microsoft.Xna.Framework.Color color20 = color19 * (1f - num106); - Vector2 position20 = position18 - new Vector2((float) texture2D9.Width, (float) (texture2D9.Height / Main.npcFrameCount[type])) * rCurrentNPC.scale / 2f + (halfSize * rCurrentNPC.scale + new Vector2(0.0f, addY + addHeight + rCurrentNPC.gfxOffY)) + ((float) ((double) index / (double) num104 * 6.28318548202515)).ToRotationVector2() * num105 * num106; - mySpriteBatch.Draw(texture2D9, position20, new Microsoft.Xna.Framework.Rectangle?(r9), color20, rCurrentNPC.rotation, origin13, rCurrentNPC.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); - } - mySpriteBatch.Draw(texture2D9, position18, new Microsoft.Xna.Framework.Rectangle?(r9), alpha, rCurrentNPC.rotation, origin13, rCurrentNPC.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); - if ((double) rCurrentNPC.ai[1] == 2.0) - { - float num107 = Math.Min(1f, rCurrentNPC.ai[0] / 120f); - mySpriteBatch.Draw(texture2D9, position18, new Microsoft.Xna.Framework.Rectangle?(r9), new Microsoft.Xna.Framework.Color(1f, 1f, 1f, 0.0f) * num107, rCurrentNPC.rotation, origin13, rCurrentNPC.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); - float progress = MathHelper.Clamp(rCurrentNPC.ai[0] / 450f, 0.0f, 1f); - if (!Terraria.Graphics.Effects.Filters.Scene["CrystalWin"].IsActive()) - Terraria.Graphics.Effects.Filters.Scene.Activate("CrystalWin", rCurrentNPC.Center); + if ((double) n.ai[0] == -1.0) + num140 = 0; + if ((double) n.ai[0] == 0.0 || (double) n.ai[0] == 5.0 || (double) n.ai[0] == 10.0) + num140 = 7; + if ((double) n.ai[0] == 1.0) + { + color28 = Microsoft.Xna.Framework.Color.Blue; + amount11 = 0.5f; + } else - Terraria.Graphics.Effects.Filters.Scene["CrystalWin"].GetShader().UseProgress(progress); - Terraria.Graphics.Effects.Filters.Scene["CrystalWin"].GetShader().UseTargetPosition(rCurrentNPC.Center); + color29 = color1; } - int num108 = 4; - float num109 = 4f; - float num110 = (float) (0.625 + Math.Sin((double) Main.GlobalTimeWrappedHourly * 6.28318548202515 * 0.75) * 0.125); - for (int index = 0; index < num108; ++index) + else if ((type == 372 || type == 373) && (double) n.ai[0] == 1.0) { - Microsoft.Xna.Framework.Color color21 = alpha; - color21.A = (byte) 0; - Microsoft.Xna.Framework.Color color22 = color21 * 0.3f * (1f - num110); - Vector2 position21 = position18 - new Vector2((float) texture2D9.Width, (float) (texture2D9.Height / Main.npcFrameCount[type])) * rCurrentNPC.scale / 2f + (halfSize * rCurrentNPC.scale + new Vector2(0.0f, addY + addHeight + rCurrentNPC.gfxOffY)) + ((float) ((double) index / (double) num108 * 6.28318548202515)).ToRotationVector2() * num109 * num110; - mySpriteBatch.Draw(texture2D9, position21, new Microsoft.Xna.Framework.Rectangle?(r9), color22, rCurrentNPC.rotation, origin13, rCurrentNPC.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); + color28 = Microsoft.Xna.Framework.Color.Blue; + amount11 = 0.5f; } - if (rCurrentNPC.alpha >= (int) byte.MaxValue) + for (int index = 1; index < num140; index += num141) + { + ref Vector2 local = ref n.oldPos[index]; + Microsoft.Xna.Framework.Color newColor = Microsoft.Xna.Framework.Color.Lerp(color29, color28, amount11); + Microsoft.Xna.Framework.Color color30 = n.GetAlpha(newColor) * ((float) (num140 - index) / 15f); + Vector2 position21 = n.oldPos[index] + new Vector2((float) n.width, (float) n.height) / 2f - Main.screenPosition - new Vector2((float) texture12.Width, (float) (texture12.Height / Main.npcFrameCount[type])) * n.scale / 2f + (vector2_3 * n.scale + new Vector2(0.0f, addY + addHeight + n.gfxOffY)); + Main.spriteBatch.Draw(texture12, position21, new Microsoft.Xna.Framework.Rectangle?(n.frame), color30, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + } + int num142 = 0; + float num143 = 0.0f; + float num144 = 0.0f; + if (type == 370) + { + if ((double) n.ai[0] == -1.0) + num142 = 0; + if ((double) n.ai[0] == 3.0 || (double) n.ai[0] == 8.0) + { + int num145 = 60; + int num146 = 30; + if ((double) n.ai[2] > (double) num145) + { + num142 = 6; + num143 = (1f - (float) Math.Cos(((double) n.ai[2] - (double) num145) / (double) num146 * 6.28318548202515)) / 3f; + num144 = 40f; + } + } + if ((double) n.ai[0] == 4.0 && (double) n.ai[2] > (double) num137) + { + num142 = 6; + num143 = (1f - (float) Math.Cos(((double) n.ai[2] - (double) num137) / (double) num138 * 6.28318548202515)) / 3f; + num144 = 60f; + } + if ((double) n.ai[0] == 9.0 && (double) n.ai[2] > (double) num137) + { + num142 = 6; + num143 = (1f - (float) Math.Cos(((double) n.ai[2] - (double) num137) / (double) num138 * 6.28318548202515)) / 3f; + num144 = 60f; + } + if ((double) n.ai[0] == 12.0) + { + num142 = 6; + num143 = (1f - (float) Math.Cos((double) n.ai[2] / 30.0 * 6.28318548202515)) / 3f; + num144 = 20f; + } + } + for (int index = 0; index < num142; ++index) + { + Microsoft.Xna.Framework.Color newColor = Microsoft.Xna.Framework.Color.Lerp(color1, color28, amount11); + Microsoft.Xna.Framework.Color color31 = n.GetAlpha(newColor) * (1f - num143); + Vector2 position22 = n.Center + ((float) ((double) index / (double) num142 * 6.28318548202515) + n.rotation).ToRotationVector2() * num144 * num143 - Main.screenPosition - new Vector2((float) texture12.Width, (float) (texture12.Height / Main.npcFrameCount[type])) * n.scale / 2f + (vector2_3 * n.scale + new Vector2(0.0f, addY + addHeight + n.gfxOffY)); + Main.spriteBatch.Draw(texture12, position22, new Microsoft.Xna.Framework.Rectangle?(n.frame), color31, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + } + Vector2 position23 = n.Center - Main.screenPosition - new Vector2((float) texture12.Width, (float) (texture12.Height / Main.npcFrameCount[type])) * n.scale / 2f + (vector2_3 * n.scale + new Vector2(0.0f, addY + addHeight + n.gfxOffY)); + Main.spriteBatch.Draw(texture12, position23, new Microsoft.Xna.Framework.Rectangle?(n.frame), n.GetAlpha(color1), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + if (type != 370 || (double) n.ai[0] < 4.0) break; - float num111 = (float) ((double) Main.GlobalTimeWrappedHourly % 3.0 / 3.0); - float num112 = num111; - if ((double) num112 > 0.5) - num112 = 1f - num111; - if ((double) num112 < 0.0) - num112 = 0.0f; - float num113 = (float) (((double) num111 + 0.5) % 1.0); - float num114 = num113; - if ((double) num114 > 0.5) - num114 = 1f - num113; - if ((double) num114 < 0.0) - num114 = 0.0f; - Texture2D texture2D10 = TextureAssets.GlowMask[239].Value; - Microsoft.Xna.Framework.Rectangle r10 = texture2D10.Frame(); - origin13 = r10.Size() / 2f; - Vector2 position22 = position18 + new Vector2(0.0f, -40f); - Microsoft.Xna.Framework.Color color23 = new Microsoft.Xna.Framework.Color(140, 50, (int) byte.MaxValue, 0) * 0.6f; - mySpriteBatch.Draw(texture2D10, position22, new Microsoft.Xna.Framework.Rectangle?(r10), color23, rCurrentNPC.rotation, origin13, rCurrentNPC.scale * 0.75f, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); - float num115 = (float) (1.0 + (double) num111 * 0.75); - mySpriteBatch.Draw(texture2D10, position22, new Microsoft.Xna.Framework.Rectangle?(r10), color23 * num112, rCurrentNPC.rotation, origin13, rCurrentNPC.scale * 0.75f * num115, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); - float num116 = (float) (1.0 + (double) num113 * 0.75); - mySpriteBatch.Draw(texture2D10, position22, new Microsoft.Xna.Framework.Rectangle?(r10), color23 * num114, rCurrentNPC.rotation, origin13, rCurrentNPC.scale * 0.75f * num116, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); - Texture2D texture2D11 = TextureAssets.Extra[89].Value; - Microsoft.Xna.Framework.Rectangle r11 = texture2D11.Frame(); - origin13 = r11.Size() / 2f; - Vector2 scale = new Vector2(0.75f, 1f + num116) * 1.5f; - float num117 = (float) (1.0 + (double) num113 * 0.75); - if (rCurrentNPC.dontTakeDamageFromHostiles) - scale.Y *= 0.6f; - position22.Y -= 6f; - mySpriteBatch.Draw(texture2D11, position22, new Microsoft.Xna.Framework.Rectangle?(r11), color23 * num114, rCurrentNPC.rotation + 1.570796f, origin13, scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); - mySpriteBatch.Draw(texture2D11, position22, new Microsoft.Xna.Framework.Rectangle?(r11), Microsoft.Xna.Framework.Color.Lerp(color23, Microsoft.Xna.Framework.Color.White, 0.5f), rCurrentNPC.rotation + 1.570796f, origin13, 1.5f, spriteEffects ^ SpriteEffects.FlipHorizontally, 0.0f); + Texture2D dukeFishronTexture = Main.dukeFishronTexture; + Microsoft.Xna.Framework.Color color32 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.White, Microsoft.Xna.Framework.Color.Yellow, 0.5f); + Microsoft.Xna.Framework.Color yellow = Microsoft.Xna.Framework.Color.Yellow; + float amount12 = 1f; + float num147 = 0.5f; + float num148 = 10f; + int num149 = 1; + if ((double) n.ai[0] == 4.0) + { + float num150 = (n.ai[2] - (float) num137) / (float) num138; + yellow *= num150; + color32 *= num150; + } + if ((double) n.ai[0] == 12.0) + { + float num151 = n.ai[2] / 30f; + if ((double) num151 > 0.5) + num151 = 1f - num151; + float num152 = 1f - num151 * 2f; + yellow *= num152; + color32 *= num152; + } + for (int index = 1; index < num140; index += num149) + { + ref Vector2 local = ref n.oldPos[index]; + Microsoft.Xna.Framework.Color color33 = Microsoft.Xna.Framework.Color.Lerp(color32, yellow, amount12) * ((float) (num140 - index) / 15f); + Vector2 position24 = n.oldPos[index] + new Vector2((float) n.width, (float) n.height) / 2f - Main.screenPosition - new Vector2((float) dukeFishronTexture.Width, (float) (dukeFishronTexture.Height / Main.npcFrameCount[type])) * n.scale / 2f + (vector2_3 * n.scale + new Vector2(0.0f, addY + addHeight + n.gfxOffY)); + Main.spriteBatch.Draw(dukeFishronTexture, position24, new Microsoft.Xna.Framework.Rectangle?(n.frame), color33, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + } + for (int index = 1; index < num142; ++index) + { + Microsoft.Xna.Framework.Color newColor = Microsoft.Xna.Framework.Color.Lerp(color32, yellow, amount12); + Microsoft.Xna.Framework.Color color34 = n.GetAlpha(newColor) * (1f - num147); + Vector2 position25 = n.Center + ((float) ((double) index / (double) num142 * 6.28318548202515) + n.rotation).ToRotationVector2() * num148 * num147 - Main.screenPosition - new Vector2((float) dukeFishronTexture.Width, (float) (dukeFishronTexture.Height / Main.npcFrameCount[type])) * n.scale / 2f + (vector2_3 * n.scale + new Vector2(0.0f, addY + addHeight + n.gfxOffY)); + Main.spriteBatch.Draw(dukeFishronTexture, position25, new Microsoft.Xna.Framework.Rectangle?(n.frame), color34, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + } + Main.spriteBatch.Draw(dukeFishronTexture, position23, new Microsoft.Xna.Framework.Rectangle?(n.frame), color32, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); break; } - if (type == 371 || type >= 454 && type <= 459 || type >= 621 && type <= 623) + if (type == 439 || type == 440) { - Texture2D texture2 = TextureAssets.Npc[type].Value; - Vector2 position23 = rCurrentNPC.Center - screenPos - new Vector2((float) texture2.Width, (float) (texture2.Height / Main.npcFrameCount[type])) * rCurrentNPC.scale / 2f + (halfSize * rCurrentNPC.scale + new Vector2(0.0f, addY + addHeight + rCurrentNPC.gfxOffY)); - mySpriteBatch.Draw(texture2, position23, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), rCurrentNPC.GetAlpha(npcColor2), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); + int num153 = n.frame.Y / (Main.npcTexture[type].Height / Main.npcFrameCount[type]); + Texture2D texture13 = Main.npcTexture[type]; + Texture2D texture2D10 = Main.extraTexture[30]; + Microsoft.Xna.Framework.Rectangle r = texture2D10.Frame(); + r.Height /= 2; + if (num153 >= 4) + r.Y += r.Height; + Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; + float amount = 0.0f; + Microsoft.Xna.Framework.Color color35 = color1; + int num154 = 0; + int num155 = 0; + int num156 = 0; + if ((double) n.ai[0] == -1.0) + { + if ((double) n.ai[1] >= 320.0 && (double) n.ai[1] < 960.0) + { + white = Microsoft.Xna.Framework.Color.White; + amount = 0.5f; + num154 = 6; + num155 = 2; + num156 = 1; + } + } + else if ((double) n.ai[0] == 1.0) + { + white = Microsoft.Xna.Framework.Color.White; + amount = 0.5f; + num154 = 4; + num155 = 2; + num156 = 1; + } + else + color35 = color1; + for (int index = num156; index < num154; index += num155) + { + ref Vector2 local = ref n.oldPos[index]; + Microsoft.Xna.Framework.Color newColor = Microsoft.Xna.Framework.Color.Lerp(color35, white, amount); + Microsoft.Xna.Framework.Color color36 = n.GetAlpha(newColor) * ((float) (num154 - index) / (float) num154); + color36.A = (byte) 100; + Vector2 position26 = n.oldPos[index] + new Vector2((float) n.width, (float) n.height) / 2f - Main.screenPosition - r.Size() * n.scale / 2f + (vector2_3 * n.scale + new Vector2(0.0f, addY + addHeight + n.gfxOffY)); + Main.spriteBatch.Draw(texture2D10, position26, new Microsoft.Xna.Framework.Rectangle?(r), color36, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + } + int num157 = 0; + float num158 = 0.0f; + float num159 = 0.0f; + if ((double) n.ai[0] == 5.0 && (double) n.ai[1] >= 0.0 && (double) n.ai[1] < 30.0) + { + num157 = 4; + num158 = (1f - (float) Math.Cos(((double) n.ai[1] - 0.0) / 30.0 * 3.14159274101257)) / 2f; + num159 = 70f; + } + for (int index = 0; index < num157; ++index) + { + Microsoft.Xna.Framework.Color newColor = Microsoft.Xna.Framework.Color.Lerp(color1, white, amount); + Microsoft.Xna.Framework.Color color37 = n.GetAlpha(newColor) * (1f - num158); + Vector2 position27 = n.Center + ((float) ((double) index / (double) num157 * 6.28318548202515) + n.rotation).ToRotationVector2() * num159 * num158 - Main.screenPosition - new Vector2((float) texture13.Width, (float) (texture13.Height / Main.npcFrameCount[type])) * n.scale / 2f + (vector2_3 * n.scale + new Vector2(0.0f, addY + addHeight + n.gfxOffY)); + Main.spriteBatch.Draw(texture2D10, position27, new Microsoft.Xna.Framework.Rectangle?(r), color37, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + } + Vector2 position28 = n.Center - Main.screenPosition - new Vector2((float) texture13.Width, (float) (texture13.Height / Main.npcFrameCount[type])) * n.scale / 2f + (vector2_3 * n.scale + new Vector2(0.0f, addY + addHeight + n.gfxOffY)); + Main.spriteBatch.Draw(texture13, position28, new Microsoft.Xna.Framework.Rectangle?(n.frame), n.GetAlpha(color1), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + } + if (type == 392 || type == 393 || type == 394 || type == 395) + { + Texture2D texture14 = Main.npcTexture[type]; + Vector2 position29 = (n.Center - Main.screenPosition + Vector2.UnitY * n.gfxOffY).Floor(); + float num160 = 0.0f; + if (type == 393) + num160 = -8f; + Main.spriteBatch.Draw(texture14, position29, new Microsoft.Xna.Framework.Rectangle?(n.frame), n.GetAlpha(color1), n.rotation, vector2_3 + Vector2.UnitY * num160, n.scale, spriteEffects, 0.0f); + if (type == 392) + Main.spriteBatch.Draw(Main.glowMaskTexture[48], position29, new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(200, 200, 200, 0), n.rotation, vector2_3 + Vector2.UnitY * num160, n.scale, spriteEffects, 0.0f); + if (type == 395) + Main.spriteBatch.Draw(Main.glowMaskTexture[49], position29, new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(200, 200, 200, 0), n.rotation, vector2_3 + Vector2.UnitY * num160, n.scale, spriteEffects, 0.0f); + if (type != 394) + break; + Main.spriteBatch.Draw(Main.glowMaskTexture[50], position29, new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(200, 200, 200, 0), n.rotation, vector2_3 + Vector2.UnitY * num160, n.scale, spriteEffects, 0.0f); + break; + } + if (type == 83 || type == 84 || type == 179) + { + Main.spriteBatch.Draw(Main.npcTexture[type], new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY), new Microsoft.Xna.Framework.Rectangle?(n.frame), Microsoft.Xna.Framework.Color.White, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + } + if (type >= 87 && type <= 92) + { + Microsoft.Xna.Framework.Color alpha = n.GetAlpha(color1); + byte num161 = (byte) (((int) Main.tileColor.R + (int) Main.tileColor.G + (int) Main.tileColor.B) / 3); + if ((int) alpha.R < (int) num161) + alpha.R = num161; + if ((int) alpha.G < (int) num161) + alpha.G = num161; + if ((int) alpha.B < (int) num161) + alpha.B = num161; + Main.spriteBatch.Draw(Main.npcTexture[type], new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY), new Microsoft.Xna.Framework.Rectangle?(n.frame), alpha, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); break; } switch (type) { - case 549: - Texture2D texture3 = TextureAssets.Npc[type].Value; - Vector2 position24 = rCurrentNPC.Center - screenPos; - Microsoft.Xna.Framework.Rectangle frame2 = rCurrentNPC.frame; - Vector2 origin14 = new Vector2(70f, (float) sbyte.MaxValue); - origin14.Y += 8f; - Vector2 scale4 = new Vector2(rCurrentNPC.scale); - float t3 = rCurrentNPC.localAI[0]; - if ((double) t3 < 120.0) - scale4 *= (float) ((double) t3 / 240.0 + 0.5); - Microsoft.Xna.Framework.Color alpha1 = rCurrentNPC.GetAlpha(npcColor2); - float lerpValue1 = Utils.GetLerpValue(0.0f, 120f, t3, true); - float num118 = MathHelper.Lerp(32f, 0.0f, lerpValue1); - Microsoft.Xna.Framework.Color color24 = alpha1; - color24.A = (byte) MathHelper.Lerp((float) color24.A, 0.0f, lerpValue1); - Microsoft.Xna.Framework.Color color25 = color24 * lerpValue1; - if ((double) t3 >= 120.0) - color25 = alpha1; - mySpriteBatch.Draw(texture3, position24, new Microsoft.Xna.Framework.Rectangle?(frame2), color25, rCurrentNPC.rotation, origin14, scale4, spriteEffects, 0.0f); - float y1 = ((float) ((((double) rCurrentNPC.ai[0] + 54.0) % 180.0 - 120.0) / 180.0 * 2.0 * 6.28318548202515)).ToRotationVector2().Y; - if ((double) t3 >= 120.0) + case 94: + for (int index = 1; index < 6; index += 2) { - num118 = y1 * 0.0f; - color25.A = (byte) ((double) color25.A * 0.5); - color25 *= (float) ((double) y1 / 2.0 + 0.5); - float num119 = 1f; - for (float num120 = 0.0f; (double) num120 < (double) num119; ++num120) - mySpriteBatch.Draw(texture3, position24 + (6.283185f / num119 * num120).ToRotationVector2() * num118, new Microsoft.Xna.Framework.Rectangle?(frame2), color25, rCurrentNPC.rotation, origin14, scale4, spriteEffects, 0.0f); + ref Vector2 local = ref n.oldPos[index]; + Microsoft.Xna.Framework.Color alpha = n.GetAlpha(color1); + alpha.R = (byte) ((int) alpha.R * (10 - index) / 15); + alpha.G = (byte) ((int) alpha.G * (10 - index) / 15); + alpha.B = (byte) ((int) alpha.B * (10 - index) / 15); + alpha.A = (byte) ((int) alpha.A * (10 - index) / 15); + Main.spriteBatch.Draw(Main.npcTexture[type], new Vector2((float) ((double) n.oldPos[index].X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.oldPos[index].Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(n.frame), alpha, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); } - float t4 = (float) ((double) rCurrentNPC.ai[0] / 180.0 - 0.759999990463257); - if ((double) t4 < 0.0) - ++t4; - float amount9 = 0.0f; - float scale5 = 0.0f; - float from1 = 0.6f; - float to1 = 0.8f; - if ((double) t4 >= (double) from1 && (double) t4 <= (double) to1) + break; + case 384: + return; + case 396: + Texture2D texture15 = Main.npcTexture[type]; + Vector2 origin4 = new Vector2(191f, 130f); + Texture2D texture16 = Main.extraTexture[18]; + Texture2D texture17 = Main.extraTexture[19]; + Vector2 origin5 = new Vector2(19f, 34f); + Vector2 vector2_12 = new Vector2(27f, 59f); + Vector2 vector2_13 = new Vector2(0.0f, 0.0f); + Texture2D texture2D11 = Main.extraTexture[25]; + Vector2 vector2_14 = new Vector2(0.0f, 214f).RotatedBy((double) n.rotation); + Microsoft.Xna.Framework.Rectangle r6 = texture2D11.Frame(); + r6.Height /= 3; + r6.Y += r6.Height * (int) ((double) n.localAI[2] / 7.0); + Texture2D texture2D12 = Main.extraTexture[29]; + Vector2 vector2_15 = new Vector2(0.0f, 4f).RotatedBy((double) n.rotation); + Microsoft.Xna.Framework.Rectangle r7 = texture2D12.Frame(); + r7.Height /= 4; + r7.Y += r7.Height * (int) ((double) n.localAI[3] / 5.0); + Texture2D texture2D13 = Main.extraTexture[26]; + Microsoft.Xna.Framework.Rectangle rectangle3 = texture2D13.Frame(); + rectangle3.Height /= 4; + Vector2 center1 = Main.npc[(int) n.ai[3]].Center; + Microsoft.Xna.Framework.Point tileCoordinates1 = n.Center.ToTileCoordinates(); + Microsoft.Xna.Framework.Color alpha1 = n.GetAlpha(Microsoft.Xna.Framework.Color.Lerp(Lighting.GetColor(tileCoordinates1.X, tileCoordinates1.Y), Microsoft.Xna.Framework.Color.White, 0.3f)); + if ((double) n.ai[0] < 0.0) { - amount9 = Utils.GetLerpValue(from1, to1, t4, false); - scale5 = MathHelper.Lerp(0.75f, 0.85f, amount9); + int num162 = (int) n.ai[1] / 8; + rectangle3.Y += rectangle3.Height * num162; + Main.spriteBatch.Draw(texture2D13, n.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(rectangle3), alpha1, n.rotation, origin5 + new Vector2(4f, 4f), 1f, spriteEffects, 0.0f); } - float from2 = to1; - float to2 = from2 + 0.13f; - if ((double) t4 >= (double) from2 && (double) t4 <= (double) to2) + else { - amount9 = 1f - Utils.GetLerpValue(from2, to2, t4, false); - scale5 = MathHelper.Lerp(1.3f, 0.85f, amount9); + Main.spriteBatch.Draw(texture16, n.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(), alpha1, n.rotation, origin5, 1f, spriteEffects, 0.0f); + Vector2 vector2_16 = Utils.Vector2FromElipse(n.localAI[0].ToRotationVector2(), vector2_12 * n.localAI[1]); + Main.spriteBatch.Draw(texture17, n.Center - Main.screenPosition + vector2_16 + vector2_13, new Microsoft.Xna.Framework.Rectangle?(), alpha1, n.rotation, new Vector2((float) texture17.Width, (float) texture17.Height) / 2f, 1f, SpriteEffects.None, 0.0f); } - Vector2 vector2_7 = new Vector2(0.0f, -150f); - int frameNumber = frame2.Y / frame2.Height; - float num121 = MathHelper.Clamp((float) (((double) t3 - 100.0) / 40.0), 0.0f, 1f); - this.DrawElderEye(mySpriteBatch, rCurrentNPC.Center + vector2_7, 0.75f * num121, 0.75f, frameNumber, Microsoft.Xna.Framework.Color.White); - this.DrawElderEye(mySpriteBatch, rCurrentNPC.Center + vector2_7, 0.75f * num121, 0.75f, frameNumber, new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue) * (float) ((double) y1 / 2.0 + 0.5)); - if ((double) amount9 > 0.0 && (double) scale5 > 0.0) - this.DrawElderEye(mySpriteBatch, rCurrentNPC.Center + vector2_7, amount9 * 0.5f, scale5, frameNumber, new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue)); - if ((double) t3 >= 120.0) + Main.spriteBatch.Draw(texture15, n.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(n.frame), alpha1, n.rotation, origin4, 1f, spriteEffects, 0.0f); + Main.spriteBatch.Draw(texture2D12, (n.Center - Main.screenPosition + vector2_15).Floor(), new Microsoft.Xna.Framework.Rectangle?(r7), alpha1, n.rotation, r7.Size() / 2f, 1f, spriteEffects, 0.0f); + Main.spriteBatch.Draw(texture2D11, (n.Center - Main.screenPosition + vector2_14).Floor(), new Microsoft.Xna.Framework.Rectangle?(r6), alpha1, n.rotation, r6.Size() / 2f, 1f, spriteEffects, 0.0f); + return; + case 397: + Texture2D texture18 = Main.npcTexture[type]; + float num163 = 0.5f; + Vector2 vector2_17 = new Vector2(220f, -60f); + Vector2 vector2_18 = new Vector2(0.0f, 76f); + Texture2D texture19 = Main.extraTexture[15]; + Vector2 vector2_19 = new Vector2(60f, 30f); + float num164 = 340f; + Vector2 center2 = Main.npc[(int) n.ai[3]].Center; + Microsoft.Xna.Framework.Point tileCoordinates2 = n.Center.ToTileCoordinates(); + Microsoft.Xna.Framework.Color alpha2 = n.GetAlpha(Microsoft.Xna.Framework.Color.Lerp(Lighting.GetColor(tileCoordinates2.X, tileCoordinates2.Y), Microsoft.Xna.Framework.Color.White, 0.3f)); + bool flag5 = (double) n.ai[2] == 0.0; + Vector2 vector2_20 = new Vector2(flag5 ? -1f : 1f, 1f); + Vector2 origin6 = new Vector2(120f, 180f); + if (!flag5) + origin6.X = (float) texture18.Width - origin6.X; + Texture2D texture20 = Main.extraTexture[17]; + Texture2D texture21 = Main.extraTexture[19]; + Vector2 origin7 = new Vector2(26f, 42f); + if (!flag5) + origin7.X = (float) texture20.Width - origin7.X; + Vector2 vector2_21 = new Vector2(30f, 66f); + Vector2 vector2_22 = new Vector2((float) (1.0 * -(double) vector2_20.X), 3f); + Texture2D texture2D14 = Main.extraTexture[26]; + Microsoft.Xna.Framework.Rectangle rectangle4 = texture2D14.Frame(); + rectangle4.Height /= 4; + Vector2 vector2_23 = vector2_17 * vector2_20; + Vector2 vector2_24 = center2 + vector2_23; + Vector2 vector2_25 = n.Center + vector2_18; + Vector2 vector2_26 = vector2_25; + Vector2 v1 = (vector2_24 - vector2_26) * (1f - num163); + Vector2 origin8 = vector2_19; + if (!flag5) + origin8.X = (float) texture19.Width - origin8.X; + float num165 = (float) Math.Acos((double) v1.Length() / (double) num164) * -vector2_20.X; + Main.spriteBatch.Draw(texture19, vector2_25 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(), alpha2, (float) ((double) v1.ToRotation() + (double) num165 - 1.57079637050629), origin8, 1f, spriteEffects, 0.0f); + if ((double) n.ai[0] == -2.0) + { + int num166 = (int) n.ai[1] / 8; + rectangle4.Y += rectangle4.Height * num166; + Main.spriteBatch.Draw(texture2D14, n.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(rectangle4), alpha2, 0.0f, origin7 - new Vector2(4f, 4f), 1f, spriteEffects, 0.0f); + } + else + { + Main.spriteBatch.Draw(texture20, n.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(), alpha2, 0.0f, origin7, 1f, spriteEffects, 0.0f); + Vector2 vector2_27 = Utils.Vector2FromElipse(n.localAI[0].ToRotationVector2(), vector2_21 * n.localAI[1]); + Main.spriteBatch.Draw(texture21, n.Center - Main.screenPosition + vector2_27 + vector2_22, new Microsoft.Xna.Framework.Rectangle?(), alpha2, 0.0f, new Vector2((float) texture21.Width, (float) texture21.Height) / 2f, 1f, SpriteEffects.None, 0.0f); + } + Main.spriteBatch.Draw(texture18, n.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(n.frame), alpha2, 0.0f, origin6, 1f, spriteEffects, 0.0f); + return; + case 398: + bool flag6 = false; + Texture2D texture22 = Main.npcTexture[type]; + Texture2D texture23 = Main.extraTexture[16]; + Texture2D texture24 = Main.extraTexture[14]; + float y1 = 340f; + float num167 = 0.5f; + Vector2 vector2_28 = new Vector2(220f, -60f); + Vector2 vector2_29 = new Vector2(76f, 66f); + Texture2D texture25 = Main.extraTexture[13]; + Vector2 origin9 = new Vector2((float) texture25.Width, 278f); + Vector2 origin10 = new Vector2(0.0f, 278f); + Vector2 vector2_30 = new Vector2(0.0f, 76f); + Vector2 center3 = n.Center; + Microsoft.Xna.Framework.Point tileCoordinates3 = (n.Center + new Vector2(0.0f, -150f)).ToTileCoordinates(); + Microsoft.Xna.Framework.Color alpha3 = n.GetAlpha(Microsoft.Xna.Framework.Color.Lerp(Lighting.GetColor(tileCoordinates3.X, tileCoordinates3.Y), Microsoft.Xna.Framework.Color.White, 0.3f)); + for (int index5 = 0; index5 < 2; ++index5) + { + bool flag7 = index5 == 0; + Vector2 vector2_31 = new Vector2(flag7 ? -1f : 1f, 1f); + int index6 = -1; + for (int index7 = 0; index7 < 200; ++index7) + { + if (Main.npc[index7].active && Main.npc[index7].type == 397 && (double) Main.npc[index7].ai[2] == (double) index5 && (double) Main.npc[index7].ai[3] == (double) iNPCIndex) + { + index6 = index7; + break; + } + } + if (index6 != -1) + { + Vector2 Position = center3 + vector2_28 * vector2_31; + Vector2 v2 = (Main.npc[index6].Center + vector2_30 - Position) * num167; + if (flag6) + Main.dust[Dust.NewDust(Position + v2, 0, 0, 6)].noGravity = true; + float num168 = (float) Math.Acos((double) v2.Length() / (double) y1) * -vector2_31.X; + SpriteEffects effects = flag7 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + Vector2 origin11 = vector2_29; + if (!flag7) + origin11.X = (float) texture24.Width - origin11.X; + Main.spriteBatch.Draw(texture24, Position - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(), alpha3, (float) ((double) v2.ToRotation() - (double) num168 - 1.57079637050629), origin11, 1f, effects, 0.0f); + if (flag6) + Main.dust[Dust.NewDust(Position, 0, 0, 6)].noGravity = true; + if (flag6) + Main.dust[Dust.NewDust(center3, 0, 0, 6)].noGravity = true; + if (flag6) + Main.dust[Dust.NewDust(Position + new Vector2(0.0f, y1).RotatedBy((double) v2.ToRotation() - (double) num168 - 1.57079637050629), 0, 0, 6)].noGravity = true; + } + } + Main.spriteBatch.Draw(texture25, center3 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(), alpha3, 0.0f, origin9, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(texture25, center3 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(), alpha3, 0.0f, origin10, 1f, SpriteEffects.FlipHorizontally, 0.0f); + Main.spriteBatch.Draw(texture23, center3 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(), alpha3, 0.0f, new Vector2(112f, 101f), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(texture22, center3 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(n.frame), alpha3, 0.0f, n.frame.Size() / 2f, 1f, SpriteEffects.None, 0.0f); + return; + case 399: + Texture2D texture26 = Main.npcTexture[type]; + (n.position - Main.screenPosition + Vector2.UnitY * n.gfxOffY).Floor(); + float num169 = 5f; + for (int index8 = 0; (double) index8 < (double) num169; ++index8) + { + float num170 = (float) (1.0 - ((double) Main.GlobalTime + (double) index8) % (double) num169 / (double) num169); + Microsoft.Xna.Framework.Color color38 = Microsoft.Xna.Framework.Color.LimeGreen; + if ((double) n.ai[0] == 1.0) + color38 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.LimeGreen, Microsoft.Xna.Framework.Color.Red, MathHelper.Clamp(n.ai[1] / 20f, 0.0f, 1f)); + if ((double) n.ai[0] == 2.0) + color38 = Microsoft.Xna.Framework.Color.Red; + color38 *= 1f - num170; + color38.A = (byte) 0; + for (int index9 = 0; index9 < 2; ++index9) + Main.spriteBatch.Draw(Main.extraTexture[27], n.Center - Main.screenPosition + Vector2.UnitY * (float) ((double) n.gfxOffY - 4.0 + 6.0), new Microsoft.Xna.Framework.Rectangle?(), color38, 1.570796f, new Vector2(10f, 48f), num170 * 4f, SpriteEffects.None, 0.0f); + } + Main.spriteBatch.Draw(texture26, new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), n.GetAlpha(color1), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + Texture2D texture27 = Main.glowMaskTexture[100]; + Main.spriteBatch.Draw(texture27, new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color((int) sbyte.MaxValue - n.alpha / 2, (int) sbyte.MaxValue - n.alpha / 2, (int) sbyte.MaxValue - n.alpha / 2, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + Texture2D texture2D15 = Main.extraTexture[20]; + Microsoft.Xna.Framework.Rectangle rectangle5 = texture2D15.Frame(verticalFrames: 4, frameY: ((int) n.ai[0] + 1)); + Vector2 position30 = new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) texture2D15.Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale + (double) addHeight + (double) addY + (double) n.gfxOffY + 18.0 + 6.0)); + Main.spriteBatch.Draw(texture2D15, position30, new Microsoft.Xna.Framework.Rectangle?(rectangle5), n.GetAlpha(color1), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + Texture2D texture28 = Main.glowMaskTexture[101]; + Main.spriteBatch.Draw(texture28, position30, new Microsoft.Xna.Framework.Rectangle?(rectangle5), new Microsoft.Xna.Framework.Color((int) sbyte.MaxValue - n.alpha / 2, (int) sbyte.MaxValue - n.alpha / 2, (int) sbyte.MaxValue - n.alpha / 2, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + return; + case 400: + Texture2D texture29 = Main.npcTexture[type]; + Texture2D texture2D16 = Main.extraTexture[19]; + Vector2 origin12 = new Vector2(40f, 40f); + Vector2 vector2_32 = new Vector2(30f, 30f); + Vector2 center4 = n.Center; + Microsoft.Xna.Framework.Point tileCoordinates4 = n.Center.ToTileCoordinates(); + Microsoft.Xna.Framework.Color alpha4 = n.GetAlpha(Microsoft.Xna.Framework.Color.Lerp(Lighting.GetColor(tileCoordinates4.X, tileCoordinates4.Y), Microsoft.Xna.Framework.Color.White, 0.3f)); + Main.spriteBatch.Draw(texture29, n.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(n.frame), alpha4, n.rotation, origin12, 1f, spriteEffects, 0.0f); + Vector2 vector2_33 = Utils.Vector2FromElipse(n.localAI[0].ToRotationVector2(), vector2_32 * n.localAI[1]); + Main.spriteBatch.Draw(texture2D16, n.Center - Main.screenPosition + vector2_33, new Microsoft.Xna.Framework.Rectangle?(), alpha4, n.rotation, texture2D16.Size() / 2f, n.localAI[2], SpriteEffects.None, 0.0f); + return; + case 416: + int index10 = -1; + int index11 = (int) n.ai[0]; + Vector2 position31 = n.position; + Vector2 spinningpoint = Vector2.Zero; + if (Main.npc[index11].active && Main.npc[index11].type == 415) + index10 = index11; + if (index10 != -1) + { + Vector2 position32 = n.position; + n.Bottom = Main.npc[index10].Bottom; + position31 = n.position; + n.position = position32; + n.gfxOffY = Main.npc[index10].gfxOffY; + spinningpoint = Main.npc[index10].velocity; + } + Microsoft.Xna.Framework.Rectangle frame1 = n.frame; + Main.spriteBatch.Draw(Main.npcTexture[type], new Vector2((float) ((double) position31.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) position31.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame1), n.GetAlpha(color1), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + if (n.color != new Microsoft.Xna.Framework.Color()) + Main.spriteBatch.Draw(Main.npcTexture[type], new Vector2((float) ((double) position31.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) position31.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame1), n.GetColor(color1), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + Main.spriteBatch.Draw(Main.glowMaskTexture[156], position31 + n.Size * new Vector2(0.5f, 1f) - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + float num171 = (float) (0.5 + (double) (n.GetAlpha(color1).ToVector3() - new Vector3(0.5f)).Length() * 0.5); + for (int index12 = 0; index12 < 4; ++index12) + Main.spriteBatch.Draw(Main.glowMaskTexture[156], position31 + n.Size * new Vector2(0.5f, 1f) - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY) + spinningpoint.RotatedBy((double) index12 * 1.57079637050629) * num171, new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(64, 64, 64, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + return; + case 491: + NPC npc4 = n; + Texture2D texture30 = Main.npcTexture[npc4.type]; + Microsoft.Xna.Framework.Rectangle frame2 = npc4.frame; + Vector2 origin13 = frame2.OriginFlip(new Vector2(208f, 460f), spriteEffects); + Vector2 position33 = npc4.Center - Main.screenPosition; + Vector2 vector2_34 = new Vector2(spriteEffects.HasFlag((Enum) SpriteEffects.FlipHorizontally) ? -1f : 1f, 1f); + Microsoft.Xna.Framework.Color alpha5 = npc4.GetAlpha(color1); + Main.spriteBatch.Draw(texture30, position33, new Microsoft.Xna.Framework.Rectangle?(frame2), alpha5, npc4.rotation, origin13, npc4.scale, spriteEffects, 0.0f); + int num172 = (int) npc4.localAI[3] / 8; + Texture2D texture2D17 = Main.extraTexture[40]; + Microsoft.Xna.Framework.Rectangle r8 = texture2D17.Frame(verticalFrames: 4, frameY: (num172 % 4)); + Vector2 origin14 = r8.Size() * new Vector2(0.5f, 1f); + Main.spriteBatch.Draw(texture2D17, position33 + (new Vector2(102f, -384f) * vector2_34).RotatedBy((double) npc4.rotation), new Microsoft.Xna.Framework.Rectangle?(r8), alpha5, npc4.rotation, origin14, npc4.scale, spriteEffects, 0.0f); + Texture2D texture2D18 = Main.extraTexture[41]; + Microsoft.Xna.Framework.Rectangle r9 = texture2D18.Frame(verticalFrames: 8, frameY: (num172 % 8)); + Vector2 origin15 = r9.Size() * new Vector2(0.5f, 0.0f) + new Vector2(0.0f, 10f); + for (int index13 = 0; index13 < 5; ++index13) + Main.spriteBatch.Draw(texture2D18, position33 + (new Vector2((float) (34 * index13 - 96), 40f) * vector2_34).RotatedBy((double) npc4.rotation), new Microsoft.Xna.Framework.Rectangle?(r9), alpha5, npc4.rotation, origin15, npc4.scale, spriteEffects, 0.0f); + Texture2D texture2D19 = Main.extraTexture[42]; + Microsoft.Xna.Framework.Rectangle r10 = texture2D19.Frame(verticalFrames: 4, frameY: (num172 % 4)); + Vector2 origin16 = r10.Size() * new Vector2(0.5f, 0.0f); + for (int index14 = 0; index14 < 2; ++index14) + Main.spriteBatch.Draw(texture2D19, position33 + (new Vector2((float) (158 - 106 * index14), -302f) * vector2_34).RotatedBy((double) npc4.rotation), new Microsoft.Xna.Framework.Rectangle?(r10), alpha5, npc4.rotation, origin16, npc4.scale, spriteEffects, 0.0f); + Texture2D texture2D20 = Main.extraTexture[43]; + Microsoft.Xna.Framework.Rectangle r11 = texture2D20.Frame(verticalFrames: 4, frameY: (num172 % 4)); + Vector2 origin17 = r11.Size() * new Vector2(0.5f, 0.0f); + for (int index15 = 0; index15 < 2; ++index15) + Main.spriteBatch.Draw(texture2D20, position33 + (new Vector2((float) (42 - 178 * index15), -444f) * vector2_34).RotatedBy((double) npc4.rotation), new Microsoft.Xna.Framework.Rectangle?(r11), alpha5, npc4.rotation, origin17, npc4.scale, spriteEffects, 0.0f); + Texture2D texture2D21 = Main.extraTexture[44]; + Microsoft.Xna.Framework.Rectangle r12 = texture2D21.Frame(verticalFrames: 4, frameY: (num172 % 4)); + Vector2 origin18 = r12.Size() * new Vector2(0.5f, 0.0f); + Main.spriteBatch.Draw(texture2D21, position33 + (new Vector2(-134f, -302f) * vector2_34).RotatedBy((double) npc4.rotation), new Microsoft.Xna.Framework.Rectangle?(r12), alpha5, npc4.rotation, origin18, npc4.scale, spriteEffects, 0.0f); + Texture2D texture2D22 = Main.extraTexture[45]; + Microsoft.Xna.Framework.Rectangle r13 = texture2D22.Frame(verticalFrames: 4, frameY: ((2 + num172) % 4)); + Vector2 origin19 = r13.Size() * new Vector2(0.5f, 0.0f); + Main.spriteBatch.Draw(texture2D22, position33 + (new Vector2(-60f, -330f) * vector2_34).RotatedBy((double) npc4.rotation), new Microsoft.Xna.Framework.Rectangle?(r13), alpha5, npc4.rotation, origin19, npc4.scale, spriteEffects, 0.0f); + this.LoadNPC(492); + if (!Main.NPCLoaded[492]) return; - float num122 = (float) (6.28318548202515 * (double) lerpValue1 * Math.Pow((double) lerpValue1, 2.0) * 2.0) + lerpValue1; - color25.A = (byte) ((double) alpha1.A * Math.Pow((double) lerpValue1, 2.0) * 0.5); - float num123 = 3f; - for (float num124 = 0.0f; (double) num124 < (double) num123; ++num124) - mySpriteBatch.Draw(texture3, position24 + (num122 + 6.283185f / num123 * num124).ToRotationVector2() * num118, new Microsoft.Xna.Framework.Rectangle?(frame2), color25, rCurrentNPC.rotation, origin14, scale4, spriteEffects, 0.0f); - return; - case 636: - Main.DrawNPCDirect_HallowBoss(mySpriteBatch, rCurrentNPC, ref screenPos, type, ref npcColor2, ref halfSize, spriteEffects); - return; - default: - if (type == 493 || type == 507 || type == 422 || type == 517) + Texture2D texture2D23 = Main.npcTexture[492]; + Microsoft.Xna.Framework.Rectangle r14 = texture2D23.Frame(verticalFrames: 9); + Vector2 origin20 = r14.Size() * new Vector2(0.5f, 0.0f) + new Vector2(0.0f, 10f); + for (int index16 = 0; index16 < 4; ++index16) { - Texture2D texture4 = TextureAssets.Npc[type].Value; - Vector2 vector2_8 = rCurrentNPC.Center - screenPos; - Vector2 vector2_9 = vector2_8 - new Vector2(300f, 310f); - Vector2 position25 = vector2_8 - new Vector2((float) texture4.Width, (float) (texture4.Height / Main.npcFrameCount[type])) * rCurrentNPC.scale / 2f + (halfSize * rCurrentNPC.scale + new Vector2(0.0f, addY + addHeight + rCurrentNPC.gfxOffY)); - mySpriteBatch.Draw(texture4, position25, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), rCurrentNPC.GetAlpha(npcColor2), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); + int index17 = (int) npc4.ai[index16]; + if (index17 >= 0) + { + r14.Y = Main.npc[index17].frame.Y; + Main.spriteBatch.Draw(texture2D23, position33 + (new Vector2((float) (68 * index16 - 122), -20f) * vector2_34).RotatedBy((double) npc4.rotation), new Microsoft.Xna.Framework.Rectangle?(r14), alpha5, npc4.rotation, origin20, npc4.scale, spriteEffects, 0.0f); + } + } + return; + } + if (type == 125 || type == 126 || type == (int) sbyte.MaxValue || type == 128 || type == 129 || type == 130 || type == 131 || type == 139 || type == 140) + { + for (int index18 = 9; index18 >= 0; index18 -= 2) + { + ref Vector2 local = ref n.oldPos[index18]; + Microsoft.Xna.Framework.Color alpha6 = n.GetAlpha(color1); + alpha6.R = (byte) ((int) alpha6.R * (10 - index18) / 20); + alpha6.G = (byte) ((int) alpha6.G * (10 - index18) / 20); + alpha6.B = (byte) ((int) alpha6.B * (10 - index18) / 20); + alpha6.A = (byte) ((int) alpha6.A * (10 - index18) / 20); + Main.spriteBatch.Draw(Main.npcTexture[type], new Vector2((float) ((double) n.oldPos[index18].X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.oldPos[index18].Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(n.frame), alpha6, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + } + } + if (type == 417 && (double) n.ai[0] >= 6.0 && (double) n.ai[0] <= 6.0) + { + for (int index19 = 5; index19 >= 0; --index19) + { + ref Vector2 local = ref n.oldPos[index19]; + Microsoft.Xna.Framework.Color alpha7 = n.GetAlpha(color1); + alpha7.R = (byte) ((int) alpha7.R * (10 - index19) / 20); + alpha7.G = (byte) ((int) alpha7.G * (10 - index19) / 20); + alpha7.B = (byte) ((int) alpha7.B * (10 - index19) / 20); + alpha7.A = (byte) ((int) alpha7.A * (10 - index19) / 20); + Main.spriteBatch.Draw(Main.npcTexture[type], new Vector2((float) ((double) n.oldPos[index19].X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.oldPos[index19].Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(n.frame), alpha7, n.oldRot[index19], vector2_3, MathHelper.Lerp(0.5f, 1f, (float) ((5.0 - (double) index19) / 6.0)), spriteEffects, 0.0f); + } + } + if (type == 419 && (double) n.ai[2] <= -9.0) + { + int num173 = Main.glowMaskTexture[154].Height / Main.npcFrameCount[type]; + int num174 = n.frame.Y / num173; + for (int index20 = 6; index20 >= 0; --index20) + { + ref Vector2 local = ref n.oldPos[index20]; + Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; + white.R = (byte) ((int) byte.MaxValue * (10 - index20) / 20); + white.G = (byte) ((int) byte.MaxValue * (10 - index20) / 20); + white.B = (byte) ((int) byte.MaxValue * (10 - index20) / 20); + white.A = (byte) 0; + Microsoft.Xna.Framework.Rectangle frame3 = n.frame; + int num175 = (num174 - 3 - index20) % 3; + if (num175 < 0) + num175 += 3; + int num176 = num175 + 5; + frame3.Y = num173 * num176; + Main.spriteBatch.Draw(Main.glowMaskTexture[154], new Vector2((float) ((double) n.oldPos[index20].X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.oldPos[index20].Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(frame3), white, n.oldRot[index20], vector2_3, MathHelper.Lerp(0.75f, 1.2f, (float) ((10.0 - (double) index20) / 10.0)), spriteEffects, 0.0f); + } + } + if (type == 418 && ((double) n.ai[0] == 2.0 || (double) n.ai[0] == 4.0)) + { + Texture2D texture2D24 = Main.extraTexture[55]; + Vector2 origin21 = new Vector2((float) (texture2D24.Width / 2), (float) (texture2D24.Height / 8 + 14)); + int num177 = (int) n.ai[1] / 2; + float num178 = -1.570796f * (float) n.spriteDirection; + float amount = n.ai[1] / 45f; + if ((double) amount > 1.0) + amount = 1f; + int num179 = num177 % 4; + for (int index21 = 6; index21 >= 0; --index21) + { + ref Vector2 local = ref n.oldPos[index21]; + Microsoft.Xna.Framework.Color color39 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Gold, Microsoft.Xna.Framework.Color.OrangeRed, amount), Microsoft.Xna.Framework.Color.Blue, (float) index21 / 12f); + color39.A = (byte) (64.0 * (double) amount); + color39.R = (byte) ((int) color39.R * (10 - index21) / 20); + color39.G = (byte) ((int) color39.G * (10 - index21) / 20); + color39.B = (byte) ((int) color39.B * (10 - index21) / 20); + color39.A = (byte) ((int) color39.A * (10 - index21) / 20); + Microsoft.Xna.Framework.Color color40 = color39 * amount; + int frameY = (num179 - index21) % 4; + if (frameY < 0) + frameY += 4; + Microsoft.Xna.Framework.Rectangle rectangle6 = texture2D24.Frame(verticalFrames: 4, frameY: frameY); + Main.spriteBatch.Draw(texture2D24, new Vector2((float) ((double) n.oldPos[index21].X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.oldPos[index21].Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(rectangle6), color40, n.oldRot[index21] + num178, origin21, MathHelper.Lerp(0.1f, 1.2f, (float) ((10.0 - (double) index21) / 10.0)), spriteEffects, 0.0f); + } + } + if (type == 516) + { + int num180 = Main.npcTexture[type].Height / Main.npcFrameCount[type]; + int num181 = n.frame.Y / num180; + for (int index22 = 6; index22 >= 0; --index22) + { + ref Vector2 local = ref n.oldPos[index22]; + Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; + white.R = (byte) ((int) byte.MaxValue * (10 - index22) / 20); + white.G = (byte) ((int) byte.MaxValue * (10 - index22) / 20); + white.B = (byte) ((int) byte.MaxValue * (10 - index22) / 20); + white.A = (byte) ((int) byte.MaxValue * (10 - index22) / 20); + Microsoft.Xna.Framework.Color color41 = Microsoft.Xna.Framework.Color.Lerp(white, Microsoft.Xna.Framework.Color.Transparent, (float) index22 / 6f); + Microsoft.Xna.Framework.Rectangle frame4 = n.frame; + int num182 = (num181 - 4 - index22) % 4; + if (num182 < 0) + num182 += 4; + frame4.Y = num180 * num182; + Main.spriteBatch.Draw(Main.npcTexture[type], new Vector2((float) ((double) n.oldPos[index22].X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.oldPos[index22].Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(frame4), color41, n.rotation, vector2_3, MathHelper.Lerp(0.35f, 1.2f, (float) ((10.0 - (double) index22) / 10.0)), spriteEffects, 0.0f); + } + } + Microsoft.Xna.Framework.Rectangle frame5 = n.frame; + if (type == 182 || type == 289) + frame5.Height -= 2; + if (n.aiStyle == 7) + this.DrawNPCExtras(n, true, addHeight, addY, color1, vector2_3, spriteEffects); + if (type == 346 && (double) n.life < (double) n.lifeMax * 0.5) + { + Main.spriteBatch.Draw(Main.santaTankTexture, new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame5), n.GetAlpha(color1), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + } + else + { + switch (type) + { + case 356: + --frame5.Height; + Main.spriteBatch.Draw(Main.npcTexture[type], new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame5), n.GetAlpha(color1), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 360: + float num183 = 0.0f; + if ((double) n.ai[2] == 0.0) + { + if ((double) n.rotation == 3.14000010490417 || (double) n.rotation == -3.14000010490417) + addHeight = 2f; + if (n.direction < 0 && ((double) n.rotation == 1.57000005245209 || (double) n.rotation == 4.71000003814697)) + num183 = 1f; + if (n.direction > 0 && ((double) n.rotation == 1.57000005245209 || (double) n.rotation == 4.71000003814697)) + num183 = -1f; + } + Main.spriteBatch.Draw(Main.npcTexture[type], new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale) + num183, (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame5), n.GetAlpha(color1), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + default: + if (type == 266 && n.life < n.lifeMax && Main.expertMode) + { + Microsoft.Xna.Framework.Color alpha8 = n.GetAlpha(color1); + float num184 = (float) (1.0 - (double) n.life / (double) n.lifeMax); + float num185 = num184 * num184; + alpha8.R = (byte) ((double) alpha8.R * (double) num185); + alpha8.G = (byte) ((double) alpha8.G * (double) num185); + alpha8.B = (byte) ((double) alpha8.B * (double) num185); + alpha8.A = (byte) ((double) alpha8.A * (double) num185); + for (int index23 = 0; index23 < 4; ++index23) + { + Vector2 position34 = n.position; + float num186 = Math.Abs(n.Center.X - Main.player[Main.myPlayer].Center.X); + float num187 = Math.Abs(n.Center.Y - Main.player[Main.myPlayer].Center.Y); + position34.X = index23 == 0 || index23 == 2 ? Main.player[Main.myPlayer].Center.X + num186 : Main.player[Main.myPlayer].Center.X - num186; + position34.X -= (float) (n.width / 2); + position34.Y = index23 == 0 || index23 == 1 ? Main.player[Main.myPlayer].Center.Y + num187 : Main.player[Main.myPlayer].Center.Y - num187; + position34.Y -= (float) (n.height / 2); + Main.spriteBatch.Draw(Main.npcTexture[type], new Vector2((float) ((double) position34.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) position34.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame5), alpha8, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + } + Main.spriteBatch.Draw(Main.npcTexture[type], new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame5), n.GetAlpha(color1), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + } + if (type == 421 && (double) n.ai[0] == 5.0) + { + Player player = Main.player[n.target]; + if ((double) player.gravDir == -1.0) + spriteEffects |= SpriteEffects.FlipVertically; + Main.spriteBatch.Draw(Main.npcTexture[type], new Vector2((float) (player.direction * 4), player.gfxOffY) + ((double) player.gravDir == 1.0 ? player.Top : player.Bottom) - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(frame5), n.GetAlpha(color1), n.rotation, frame5.Size() / 2f, n.scale, spriteEffects, 0.0f); + Main.spriteBatch.Draw(Main.glowMaskTexture[146], new Vector2((float) (player.direction * 4), player.gfxOffY) + ((double) player.gravDir == 1.0 ? player.Top : player.Bottom) - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(frame5), n.GetAlpha(color1), n.rotation, frame5.Size() / 2f, n.scale, spriteEffects, 0.0f); + break; + } + if (type == 518) + { + Vector2 vector2_35 = new Vector2(-10f, 0.0f); + Main.spriteBatch.Draw(Main.npcTexture[type], new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame5), n.GetAlpha(color1), n.rotation, vector2_3 + vector2_35, n.scale, spriteEffects, 0.0f); + if (n.color != new Microsoft.Xna.Framework.Color()) + { + Main.spriteBatch.Draw(Main.npcTexture[type], new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame5), n.GetColor(color1), n.rotation, vector2_3 + vector2_35, n.scale, spriteEffects, 0.0f); + break; + } + break; + } + Main.spriteBatch.Draw(Main.npcTexture[type], new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame5), n.GetAlpha(color1), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + if (n.color != new Microsoft.Xna.Framework.Color()) + { + Main.spriteBatch.Draw(Main.npcTexture[type], new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame5), n.GetColor(color1), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + } + break; + } + } + if (n.confused) + Main.spriteBatch.Draw(Main.confuseTexture, new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale + (double) addHeight + (double) addY - (double) Main.confuseTexture.Height - 20.0)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.confuseTexture.Width, Main.confuseTexture.Height)), new Microsoft.Xna.Framework.Color(250, 250, 250, 70), n.velocity.X * -0.05f, new Vector2((float) (Main.confuseTexture.Width / 2), (float) (Main.confuseTexture.Height / 2)), Main.essScale + 0.2f, SpriteEffects.None, 0.0f); + if (type >= 134 && type <= 136 && color1 != Microsoft.Xna.Framework.Color.Black) + { + Main.spriteBatch.Draw(Main.destTexture[type - 134], new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * (float) (1.0 - (double) n.alpha / (double) byte.MaxValue), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + } + else + { + switch (type) + { + case 120: + for (int index24 = 1; index24 < n.oldPos.Length; ++index24) + { + ref Vector2 local = ref n.oldPos[index24]; + Main.spriteBatch.Draw(Main.chaosTexture, new Vector2((float) ((double) n.oldPos[index24].X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.oldPos[index24].Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color() + { + R = (byte) (150 * (10 - index24) / 15), + G = (byte) (100 * (10 - index24) / 15), + B = (byte) (150 * (10 - index24) / 15), + A = (byte) (50 * (10 - index24) / 15) + }, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + } + break; + case 125: + Main.spriteBatch.Draw(Main.EyeLaserTexture, new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case (int) sbyte.MaxValue: + Main.spriteBatch.Draw(Main.BoneEyesTexture, new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(200, 200, 200, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 131: + Main.spriteBatch.Draw(Main.BoneLaserTexture, new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(200, 200, 200, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 139: + Main.spriteBatch.Draw(Main.probeTexture, new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + default: + if (type == 137 || type == 138) + { + for (int index25 = 1; index25 < n.oldPos.Length; ++index25) + { + ref Vector2 local = ref n.oldPos[index25]; + Main.spriteBatch.Draw(Main.npcTexture[type], new Vector2((float) ((double) n.oldPos[index25].X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.oldPos[index25].Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color() + { + R = (byte) (150 * (10 - index25) / 15), + G = (byte) (100 * (10 - index25) / 15), + B = (byte) (150 * (10 - index25) / 15), + A = (byte) (50 * (10 - index25) / 15) + }, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + } + break; + } switch (type) { - case 422: - Texture2D texture5 = TextureAssets.GlowMask[149].Value; - vector3 = rCurrentNPC.GetAlpha(npcColor2).ToVector3() - new Vector3(0.5f); - float num125 = (float) (4.0 + (double) vector3.Length() * 4.0); - for (int index = 0; index < 4; ++index) - mySpriteBatch.Draw(texture5, position25 + rCurrentNPC.velocity.RotatedBy((double) index * 1.57079637050629) * num125, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(64, 64, 64, 0) * rCurrentNPC.Opacity, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); + case 82: + Main.spriteBatch.Draw(Main.wraithEyeTexture, new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(n.frame), Microsoft.Xna.Framework.Color.White, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + for (int index26 = 1; index26 < 10; ++index26) + { + Microsoft.Xna.Framework.Color color42 = new Microsoft.Xna.Framework.Color(110 - index26 * 10, 110 - index26 * 10, 110 - index26 * 10, 110 - index26 * 10); + Main.spriteBatch.Draw(Main.wraithEyeTexture, new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight) - n.velocity * (float) index26 * 0.5f, new Microsoft.Xna.Framework.Rectangle?(n.frame), color42, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + } break; - case 493: - Texture2D texture6 = TextureAssets.GlowMask[132].Value; - vector3 = rCurrentNPC.GetAlpha(npcColor2).ToVector3() - new Vector3(0.5f); - float num126 = (float) (4.0 + (double) vector3.Length() * 4.0); - for (int index = 0; index < 4; ++index) - mySpriteBatch.Draw(texture6, position25 + rCurrentNPC.velocity.RotatedBy((double) index * 1.57079637050629) * num126, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(64, 64, 64, 0) * rCurrentNPC.Opacity, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); + case 253: + Main.spriteBatch.Draw(Main.reaperEyeTexture, new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 3.0 + (double) vector2_3.Y * (double) n.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(n.frame), Microsoft.Xna.Framework.Color.White, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + for (int index27 = 1; index27 < 20; ++index27) + { + Microsoft.Xna.Framework.Color color43 = new Microsoft.Xna.Framework.Color(210 - index27 * 20, 210 - index27 * 20, 210 - index27 * 20, 210 - index27 * 20); + Main.spriteBatch.Draw(Main.reaperEyeTexture, new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 3.0 + (double) vector2_3.Y * (double) n.scale) + addHeight) - n.velocity * (float) index27 * 0.5f, new Microsoft.Xna.Framework.Rectangle?(n.frame), color43, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + } break; - case 507: - Texture2D texture7 = TextureAssets.GlowMask[143].Value; - vector3 = rCurrentNPC.GetAlpha(npcColor2).ToVector3() - new Vector3(0.5f); - float num127 = (float) (4.0 + (double) vector3.Length() * 4.0); - for (int index = 0; index < 4; ++index) - mySpriteBatch.Draw(texture7, position25 + rCurrentNPC.velocity.RotatedBy((double) index * 1.57079637050629) * num127, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(64, 64, 64, 0) * rCurrentNPC.Opacity, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); + case 325: + Main.spriteBatch.Draw(Main.treeFaceTexture, new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(n.frame), Microsoft.Xna.Framework.Color.White, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + for (int index28 = 1; index28 < 10; ++index28) + { + Microsoft.Xna.Framework.Color color44 = new Microsoft.Xna.Framework.Color(110 - index28 * 10, 110 - index28 * 10, 110 - index28 * 10, 110 - index28 * 10); + Vector2 vector2_36 = new Vector2((float) Main.rand.Next(-10, 11) * 0.2f, (float) Main.rand.Next(-10, 11) * 0.2f); + Main.spriteBatch.Draw(Main.treeFaceTexture, new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight) + vector2_36, new Microsoft.Xna.Framework.Rectangle?(n.frame), color44, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + } break; - case 517: - Texture2D texture8 = TextureAssets.GlowMask[162].Value; - vector3 = rCurrentNPC.GetAlpha(npcColor2).ToVector3() - new Vector3(0.5f); - float num128 = (float) (2.0 + (double) vector3.Length() * 9.0); - for (int index = 0; index < 4; ++index) - mySpriteBatch.Draw(texture8, position25 + rCurrentNPC.velocity.RotatedBy((double) index * 1.57079637050629) * num128 + Vector2.UnitX * 2f, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(64, 64, 64, 0) * rCurrentNPC.Opacity, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); + case 327: + Main.spriteBatch.Draw(Main.pumpkingFaceTexture, new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(n.frame), Microsoft.Xna.Framework.Color.White, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + for (int index29 = 1; index29 < 10; ++index29) + { + Microsoft.Xna.Framework.Color color45 = new Microsoft.Xna.Framework.Color(110 - index29 * 10, 110 - index29 * 10, 110 - index29 * 10, 110 - index29 * 10); + Vector2 vector2_37 = new Vector2((float) Main.rand.Next(-10, 11) * 0.2f, (float) Main.rand.Next(-10, 11) * 0.2f); + Main.spriteBatch.Draw(Main.pumpkingFaceTexture, new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight) + vector2_37, new Microsoft.Xna.Framework.Rectangle?(n.frame), color45, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + } break; - } - int num129 = 0; - string key = ""; - if (type <= 493) - { - if (type != 422) - { - if (type == 493) + case 345: + Main.spriteBatch.Draw(Main.iceQueenTexture, new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(n.frame), Microsoft.Xna.Framework.Color.White, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + for (int index30 = 1; index30 < 5; ++index30) { - num129 = NPC.ShieldStrengthTowerStardust; - key = "Stardust"; + Microsoft.Xna.Framework.Color color46 = new Microsoft.Xna.Framework.Color(100 - index30 * 10, 100 - index30 * 10, 100 - index30 * 10, 100 - index30 * 10); + Main.spriteBatch.Draw(Main.iceQueenTexture, new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight) - n.velocity * (float) index30 * 0.2f, new Microsoft.Xna.Framework.Rectangle?(n.frame), color46, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); } - } - else - { - num129 = NPC.ShieldStrengthTowerVortex; - key = "Vortex"; - } - } - else if (type != 507) - { - if (type == 517) - { - num129 = NPC.ShieldStrengthTowerSolar; - key = "Solar"; - } - } - else - { - num129 = NPC.ShieldStrengthTowerNebula; - key = "Nebula"; - } - float num130 = (float) num129 / (float) NPC.ShieldStrengthTowerMax; - if (rCurrentNPC.IsABestiaryIconDummy) - return; - if (num129 > 0) - { - mySpriteBatch.End(); - mySpriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointWrap, DepthStencilState.Default, RasterizerState.CullNone, (Effect) null, Main.Transform); - float num131 = 0.0f; - if ((double) rCurrentNPC.ai[3] > 0.0 && (double) rCurrentNPC.ai[3] <= 30.0) - num131 = (float) (1.0 - (double) rCurrentNPC.ai[3] / 30.0); - Terraria.Graphics.Effects.Filters.Scene[key].GetShader().UseIntensity(1f + num131).UseProgress(0.0f); - DrawData drawData2 = new DrawData(Main.Assets.Request("Images/Misc/Perlin", (AssetRequestMode) 1).Value, vector2_9 + new Vector2(300f, 300f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 600, 600)), Microsoft.Xna.Framework.Color.White * (float) ((double) num130 * 0.800000011920929 + 0.200000002980232), rCurrentNPC.rotation, new Vector2(300f, 300f), rCurrentNPC.scale * (float) (1.0 + (double) num131 * 0.0500000007450581), spriteEffects, 0); - GameShaders.Misc["ForceField"].UseColor(new Vector3((float) (1.0 + (double) num131 * 0.5))); - GameShaders.Misc["ForceField"].Apply(new DrawData?(drawData2)); - drawData2.Draw(mySpriteBatch); - mySpriteBatch.End(); - mySpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.Transform); - return; - } - if ((double) rCurrentNPC.ai[3] > 0.0) - { - mySpriteBatch.End(); - mySpriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointWrap, DepthStencilState.Default, RasterizerState.CullNone, (Effect) null, Main.Transform); - float progress = rCurrentNPC.ai[3] / 120f; - float num132 = Math.Min(rCurrentNPC.ai[3] / 30f, 1f); - Terraria.Graphics.Effects.Filters.Scene[key].GetShader().UseIntensity(Math.Min(5f, 15f * progress) + 1f).UseProgress(progress); - DrawData drawData3 = new DrawData(Main.Assets.Request("Images/Misc/Perlin", (AssetRequestMode) 1).Value, vector2_9 + new Vector2(300f, 300f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 600, 600)), new Microsoft.Xna.Framework.Color(new Vector4(1f - (float) Math.Sqrt((double) num132))), rCurrentNPC.rotation, new Vector2(300f, 300f), rCurrentNPC.scale * (1f + num132), spriteEffects, 0); - GameShaders.Misc["ForceField"].UseColor(new Vector3(2f)); - GameShaders.Misc["ForceField"].Apply(new DrawData?(drawData3)); - drawData3.Draw(mySpriteBatch); - mySpriteBatch.End(); - mySpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.Transform); - return; - } - Terraria.Graphics.Effects.Filters.Scene[key].GetShader().UseIntensity(0.0f).UseProgress(0.0f); - return; - } - switch (type) - { - case 402: - this.LoadNPC(403); - this.LoadNPC(404); - NPC npc1 = rCurrentNPC; - Texture2D texture2D12 = TextureAssets.Npc[npc1.type].Value; - Vector2 position26 = npc1.Center - screenPos - new Vector2((float) texture2D12.Width, (float) (texture2D12.Height / Main.npcFrameCount[npc1.type])) * npc1.scale / 2f + (halfSize * npc1.scale + new Vector2(0.0f, addY + addHeight + npc1.gfxOffY)); - int num133 = 0; - float num134 = (float) (2.0 / (double) npc1.oldPos.Length * 0.699999988079071); - for (int index = npc1.oldPos.Length - 1; (double) index >= 1.0; index -= 2) - { - Texture2D texture9 = num133 != 0 ? TextureAssets.Npc[403].Value : TextureAssets.Npc[404].Value; - mySpriteBatch.Draw(texture9, position26 + npc1.oldPos[index] - npc1.position, new Microsoft.Xna.Framework.Rectangle?(), npc1.GetAlpha(npcColor2) * (float) (0.800000011920929 - (double) num134 * (double) index / 2.0), npc1.oldRot[index], halfSize, npc1.scale, spriteEffects, 0.0f); - Texture2D texture10 = num133 != 0 ? TextureAssets.GlowMask[133].Value : TextureAssets.GlowMask[134].Value; - mySpriteBatch.Draw(texture10, position26 + npc1.oldPos[index] - npc1.position, new Microsoft.Xna.Framework.Rectangle?(), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * (float) (1.0 - (double) num134 * (double) index / 2.0), npc1.oldRot[index], halfSize, npc1.scale, spriteEffects, 0.0f); - ++num133; - } - Texture2D texture11 = TextureAssets.Npc[npc1.type].Value; - mySpriteBatch.Draw(texture11, position26, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), rCurrentNPC.GetAlpha(npcColor2), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - Texture2D texture12 = TextureAssets.GlowMask[135].Value; - mySpriteBatch.Draw(texture12, position26, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - return; - case 488: - return; - case 519: - NPC npc2 = rCurrentNPC; - Texture2D texture2D13 = TextureAssets.Npc[npc2.type].Value; - Vector2 position27 = npc2.Center - screenPos - new Vector2((float) texture2D13.Width, (float) (texture2D13.Height / Main.npcFrameCount[npc2.type])) * npc2.scale / 2f + (halfSize * npc2.scale + new Vector2(0.0f, addY + addHeight + npc2.gfxOffY)); - Texture2D texture13 = TextureAssets.Npc[npc2.type].Value; - mySpriteBatch.Draw(texture13, position27, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), rCurrentNPC.GetAlpha(npcColor2), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - int num135 = 0; - float num136 = (float) (1.0 / (double) npc2.oldPos.Length * 0.699999988079071); - for (int index = npc2.oldPos.Length - 1; (double) index >= 0.0; --index) - { - float amount10 = (float) (npc2.oldPos.Length - index) / (float) npc2.oldPos.Length; - Microsoft.Xna.Framework.Color color26 = Microsoft.Xna.Framework.Color.Pink * (float) (1.0 - (double) num136 * (double) index / 1.0); - color26.A = (byte) ((double) color26.A * (1.0 - (double) amount10)); - mySpriteBatch.Draw(texture13, position27 + npc2.oldPos[index] - npc2.position, new Microsoft.Xna.Framework.Rectangle?(), color26, npc2.oldRot[index], halfSize, npc2.scale * MathHelper.Lerp(0.3f, 1.1f, amount10), spriteEffects, 0.0f); - ++num135; - } - return; - case 522: - NPC npc3 = rCurrentNPC; - Texture2D texture14 = TextureAssets.Npc[npc3.type].Value; - Vector2 position28 = npc3.Center - screenPos - new Vector2((float) texture14.Width, (float) (texture14.Height / Main.npcFrameCount[npc3.type])) * npc3.scale / 2f + (halfSize * npc3.scale + new Vector2(0.0f, addY + addHeight + npc3.gfxOffY)); - int num137 = 0; - float num138 = (float) (1.0 / (double) npc3.oldPos.Length * 1.10000002384186); - for (int index = npc3.oldPos.Length - 1; (double) index >= 0.0; --index) - { - float amount11 = (float) (npc3.oldPos.Length - index) / (float) npc3.oldPos.Length; - Microsoft.Xna.Framework.Color color27 = Microsoft.Xna.Framework.Color.White * (float) (1.0 - (double) num138 * (double) index / 1.0); - color27.A = (byte) ((double) color27.A * (1.0 - (double) amount11)); - mySpriteBatch.Draw(texture14, position28 + npc3.oldPos[index] - npc3.position, new Microsoft.Xna.Framework.Rectangle?(), color27, npc3.oldRot[index], halfSize, npc3.scale * MathHelper.Lerp(0.8f, 0.3f, amount11), spriteEffects, 0.0f); - ++num137; - } - Texture2D texture2D14 = TextureAssets.Extra[57].Value; - mySpriteBatch.Draw(texture2D14, position28, new Microsoft.Xna.Framework.Rectangle?(), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), 0.0f, texture2D14.Size() / 2f, rCurrentNPC.scale, spriteEffects, 0.0f); - return; - default: - if (type == 370 || type == 372 || type == 373) - { - Texture2D texture15 = TextureAssets.Npc[type].Value; - Microsoft.Xna.Framework.Color color28 = Microsoft.Xna.Framework.Color.White; - float amount12 = 0.0f; - bool flag = type == 370 && (double) rCurrentNPC.ai[0] > 4.0; - int num139 = type != 370 ? 0 : ((double) rCurrentNPC.ai[0] > 9.0 ? 1 : 0); - int num140 = 120; - int num141 = 60; - Microsoft.Xna.Framework.Color color29 = npcColor2; - if (num139 != 0) - npcColor2 = Main.buffColor(npcColor2, 0.4f, 0.8f, 0.4f, 1f); - else if (flag) - npcColor2 = Main.buffColor(npcColor2, 0.5f, 0.7f, 0.5f, 1f); - else if (type == 370 && (double) rCurrentNPC.ai[0] == 4.0 && (double) rCurrentNPC.ai[2] > (double) num140) + break; + case 355: + Main.spriteBatch.Draw(Main.fireflyTexture, new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 358: + Main.spriteBatch.Draw(Main.lightningbugTexture, new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + default: + if (type == 245 && n.alpha == 0) { - float num142 = (rCurrentNPC.ai[2] - (float) num140) / (float) num141; - npcColor2 = Main.buffColor(npcColor2, (float) (1.0 - 0.5 * (double) num142), (float) (1.0 - 0.300000011920929 * (double) num142), (float) (1.0 - 0.5 * (double) num142), 1f); - } - int num143 = 10; - int num144 = 2; - if (type == 370) - { - if ((double) rCurrentNPC.ai[0] == -1.0) - num143 = 0; - if ((double) rCurrentNPC.ai[0] == 0.0 || (double) rCurrentNPC.ai[0] == 5.0 || (double) rCurrentNPC.ai[0] == 10.0) - num143 = 7; - if ((double) rCurrentNPC.ai[0] == 1.0) - { - color28 = Microsoft.Xna.Framework.Color.Blue; - amount12 = 0.5f; - } - else - color29 = npcColor2; - } - else if ((type == 372 || type == 373) && (double) rCurrentNPC.ai[0] == 1.0) - { - color28 = Microsoft.Xna.Framework.Color.Blue; - amount12 = 0.5f; - } - for (int index = 1; index < num143; index += num144) - { - ref Vector2 local = ref rCurrentNPC.oldPos[index]; - Microsoft.Xna.Framework.Color newColor = Microsoft.Xna.Framework.Color.Lerp(color29, color28, amount12); - Microsoft.Xna.Framework.Color color30 = rCurrentNPC.GetAlpha(newColor) * ((float) (num143 - index) / 15f); - Vector2 position29 = rCurrentNPC.oldPos[index] + new Vector2((float) rCurrentNPC.width, (float) rCurrentNPC.height) / 2f - screenPos - new Vector2((float) texture15.Width, (float) (texture15.Height / Main.npcFrameCount[type])) * rCurrentNPC.scale / 2f + (halfSize * rCurrentNPC.scale + new Vector2(0.0f, addY + addHeight + rCurrentNPC.gfxOffY)); - mySpriteBatch.Draw(texture15, position29, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), color30, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - } - int num145 = 0; - float num146 = 0.0f; - float num147 = 0.0f; - if (type == 370) - { - if ((double) rCurrentNPC.ai[0] == -1.0) - num145 = 0; - if ((double) rCurrentNPC.ai[0] == 3.0 || (double) rCurrentNPC.ai[0] == 8.0) - { - int num148 = 60; - int num149 = 30; - if ((double) rCurrentNPC.ai[2] > (double) num148) - { - num145 = 6; - num146 = (1f - (float) Math.Cos(((double) rCurrentNPC.ai[2] - (double) num148) / (double) num149 * 6.28318548202515)) / 3f; - num147 = 40f; - } - } - if ((double) rCurrentNPC.ai[0] == 4.0 && (double) rCurrentNPC.ai[2] > (double) num140) - { - num145 = 6; - num146 = (1f - (float) Math.Cos(((double) rCurrentNPC.ai[2] - (double) num140) / (double) num141 * 6.28318548202515)) / 3f; - num147 = 60f; - } - if ((double) rCurrentNPC.ai[0] == 9.0 && (double) rCurrentNPC.ai[2] > (double) num140) - { - num145 = 6; - num146 = (1f - (float) Math.Cos(((double) rCurrentNPC.ai[2] - (double) num140) / (double) num141 * 6.28318548202515)) / 3f; - num147 = 60f; - } - if ((double) rCurrentNPC.ai[0] == 12.0) - { - num145 = 6; - num146 = (1f - (float) Math.Cos((double) rCurrentNPC.ai[2] / 30.0 * 6.28318548202515)) / 3f; - num147 = 20f; - } - } - for (int index = 0; index < num145; ++index) - { - Microsoft.Xna.Framework.Color newColor = Microsoft.Xna.Framework.Color.Lerp(npcColor2, color28, amount12); - Microsoft.Xna.Framework.Color color31 = rCurrentNPC.GetAlpha(newColor) * (1f - num146); - Vector2 position30 = rCurrentNPC.Center + ((float) ((double) index / (double) num145 * 6.28318548202515) + rCurrentNPC.rotation).ToRotationVector2() * num147 * num146 - screenPos - new Vector2((float) texture15.Width, (float) (texture15.Height / Main.npcFrameCount[type])) * rCurrentNPC.scale / 2f + (halfSize * rCurrentNPC.scale + new Vector2(0.0f, addY + addHeight + rCurrentNPC.gfxOffY)); - mySpriteBatch.Draw(texture15, position30, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), color31, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - } - Vector2 position31 = rCurrentNPC.Center - screenPos - new Vector2((float) texture15.Width, (float) (texture15.Height / Main.npcFrameCount[type])) * rCurrentNPC.scale / 2f + (halfSize * rCurrentNPC.scale + new Vector2(0.0f, addY + addHeight + rCurrentNPC.gfxOffY)); - mySpriteBatch.Draw(texture15, position31, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), rCurrentNPC.GetAlpha(npcColor2), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - if (type != 370 || (double) rCurrentNPC.ai[0] < 4.0) - return; - Texture2D texture16 = TextureAssets.DukeFishron.Value; - Microsoft.Xna.Framework.Color color32 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.White, Microsoft.Xna.Framework.Color.Yellow, 0.5f); - Microsoft.Xna.Framework.Color yellow = Microsoft.Xna.Framework.Color.Yellow; - float amount13 = 1f; - float num150 = 0.5f; - float num151 = 10f; - int num152 = 1; - if ((double) rCurrentNPC.ai[0] == 4.0) - { - float num153 = (rCurrentNPC.ai[2] - (float) num140) / (float) num141; - yellow *= num153; - color32 *= num153; - } - if ((double) rCurrentNPC.ai[0] == 12.0) - { - float num154 = rCurrentNPC.ai[2] / 30f; - if ((double) num154 > 0.5) - num154 = 1f - num154; - float num155 = 1f - num154 * 2f; - yellow *= num155; - color32 *= num155; - } - for (int index = 1; index < num143; index += num152) - { - ref Vector2 local = ref rCurrentNPC.oldPos[index]; - Microsoft.Xna.Framework.Color color33 = Microsoft.Xna.Framework.Color.Lerp(color32, yellow, amount13) * ((float) (num143 - index) / 15f); - Vector2 position32 = rCurrentNPC.oldPos[index] + new Vector2((float) rCurrentNPC.width, (float) rCurrentNPC.height) / 2f - screenPos - new Vector2((float) texture16.Width, (float) (texture16.Height / Main.npcFrameCount[type])) * rCurrentNPC.scale / 2f + (halfSize * rCurrentNPC.scale + new Vector2(0.0f, addY + addHeight + rCurrentNPC.gfxOffY)); - mySpriteBatch.Draw(texture16, position32, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), color33, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - } - for (int index = 1; index < num145; ++index) - { - Microsoft.Xna.Framework.Color newColor = Microsoft.Xna.Framework.Color.Lerp(color32, yellow, amount13); - Microsoft.Xna.Framework.Color color34 = rCurrentNPC.GetAlpha(newColor) * (1f - num150); - Vector2 position33 = rCurrentNPC.Center + ((float) ((double) index / (double) num145 * 6.28318548202515) + rCurrentNPC.rotation).ToRotationVector2() * num151 * num150 - screenPos - new Vector2((float) texture16.Width, (float) (texture16.Height / Main.npcFrameCount[type])) * rCurrentNPC.scale / 2f + (halfSize * rCurrentNPC.scale + new Vector2(0.0f, addY + addHeight + rCurrentNPC.gfxOffY)); - mySpriteBatch.Draw(texture16, position33, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), color34, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - } - mySpriteBatch.Draw(texture16, position31, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), color32, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - return; - } - if (type == 439 || type == 440) - { - int num156 = rCurrentNPC.frame.Y / (TextureAssets.Npc[type].Height() / Main.npcFrameCount[type]); - Texture2D texture17 = TextureAssets.Npc[type].Value; - Texture2D texture2D15 = TextureAssets.Extra[30].Value; - Microsoft.Xna.Framework.Rectangle r12 = texture2D15.Frame(); - r12.Height /= 2; - if (num156 >= 4) - r12.Y += r12.Height; - Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; - float amount14 = 0.0f; - Microsoft.Xna.Framework.Color color35 = npcColor2; - int num157 = 0; - int num158 = 0; - int num159 = 0; - if ((double) rCurrentNPC.ai[0] == -1.0) - { - if ((double) rCurrentNPC.ai[1] >= 320.0 && (double) rCurrentNPC.ai[1] < 960.0) - { - white = Microsoft.Xna.Framework.Color.White; - amount14 = 0.5f; - num157 = 6; - num158 = 2; - num159 = 1; - } - } - else if ((double) rCurrentNPC.ai[0] == 1.0) - { - white = Microsoft.Xna.Framework.Color.White; - amount14 = 0.5f; - num157 = 4; - num158 = 2; - num159 = 1; - } - else - color35 = npcColor2; - for (int index = num159; index < num157; index += num158) - { - ref Vector2 local = ref rCurrentNPC.oldPos[index]; - Microsoft.Xna.Framework.Color color36 = color35; - color36 = Microsoft.Xna.Framework.Color.Lerp(color36, white, amount14); - color36 = rCurrentNPC.GetAlpha(color36); - color36 *= (float) (num157 - index) / (float) num157; - color36.A = (byte) 100; - Vector2 position34 = rCurrentNPC.oldPos[index] + new Vector2((float) rCurrentNPC.width, (float) rCurrentNPC.height) / 2f - screenPos - r12.Size() * rCurrentNPC.scale / 2f + (halfSize * rCurrentNPC.scale + new Vector2(0.0f, addY + addHeight + rCurrentNPC.gfxOffY)); - mySpriteBatch.Draw(texture2D15, position34, new Microsoft.Xna.Framework.Rectangle?(r12), color36, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - } - int num160 = 0; - float num161 = 0.0f; - float num162 = 0.0f; - if ((double) rCurrentNPC.ai[0] == 5.0 && (double) rCurrentNPC.ai[1] >= 0.0 && (double) rCurrentNPC.ai[1] < 30.0) - { - num160 = 4; - num161 = (1f - (float) Math.Cos(((double) rCurrentNPC.ai[1] - 0.0) / 30.0 * 3.14159274101257)) / 2f; - num162 = 70f; - } - for (int index = 0; index < num160; ++index) - { - Microsoft.Xna.Framework.Color newColor = Microsoft.Xna.Framework.Color.Lerp(npcColor2, white, amount14); - Microsoft.Xna.Framework.Color color37 = rCurrentNPC.GetAlpha(newColor) * (1f - num161); - Vector2 position35 = rCurrentNPC.Center + ((float) ((double) index / (double) num160 * 6.28318548202515) + rCurrentNPC.rotation).ToRotationVector2() * num162 * num161 - screenPos - new Vector2((float) texture17.Width, (float) (texture17.Height / Main.npcFrameCount[type])) * rCurrentNPC.scale / 2f + (halfSize * rCurrentNPC.scale + new Vector2(0.0f, addY + addHeight + rCurrentNPC.gfxOffY)); - mySpriteBatch.Draw(texture2D15, position35, new Microsoft.Xna.Framework.Rectangle?(r12), color37, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - } - Vector2 position36 = rCurrentNPC.Center - screenPos - new Vector2((float) texture17.Width, (float) (texture17.Height / Main.npcFrameCount[type])) * rCurrentNPC.scale / 2f + (halfSize * rCurrentNPC.scale + new Vector2(0.0f, addY + addHeight + rCurrentNPC.gfxOffY)); - mySpriteBatch.Draw(texture17, position36, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), rCurrentNPC.GetAlpha(npcColor2), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - return; - } - if (type == 392 || type == 393 || type == 394 || type == 395) - { - Texture2D texture18 = TextureAssets.Npc[type].Value; - Vector2 position37 = (rCurrentNPC.Center - screenPos + Vector2.UnitY * rCurrentNPC.gfxOffY).Floor(); - float num163 = 0.0f; - if (type == 393) - num163 = -8f; - mySpriteBatch.Draw(texture18, position37, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), rCurrentNPC.GetAlpha(npcColor2), rCurrentNPC.rotation, halfSize + Vector2.UnitY * num163, rCurrentNPC.scale, spriteEffects, 0.0f); - if (type == 392) - mySpriteBatch.Draw(TextureAssets.GlowMask[48].Value, position37, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(200, 200, 200, 0), rCurrentNPC.rotation, halfSize + Vector2.UnitY * num163, rCurrentNPC.scale, spriteEffects, 0.0f); - if (type == 395) - mySpriteBatch.Draw(TextureAssets.GlowMask[49].Value, position37, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(200, 200, 200, 0), rCurrentNPC.rotation, halfSize + Vector2.UnitY * num163, rCurrentNPC.scale, spriteEffects, 0.0f); - if (type != 394) - return; - mySpriteBatch.Draw(TextureAssets.GlowMask[50].Value, position37, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(200, 200, 200, 0), rCurrentNPC.rotation, halfSize + Vector2.UnitY * num163, rCurrentNPC.scale, spriteEffects, 0.0f); - return; - } - if (type == 83 || type == 84 || type == 179) - { - mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), Microsoft.Xna.Framework.Color.White, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - return; - } - if (type >= 87 && type <= 92) - { - Microsoft.Xna.Framework.Color alpha2 = rCurrentNPC.GetAlpha(npcColor2); - byte num164 = (byte) (((int) Main.tileColor.R + (int) Main.tileColor.G + (int) Main.tileColor.B) / 3); - if ((int) alpha2.R < (int) num164) - alpha2.R = num164; - if ((int) alpha2.G < (int) num164) - alpha2.G = num164; - if ((int) alpha2.B < (int) num164) - alpha2.B = num164; - mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), alpha2, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - return; - } - switch (type) - { - case 94: - for (int index = 1; index < 6; index += 2) - { - ref Vector2 local = ref rCurrentNPC.oldPos[index]; - Microsoft.Xna.Framework.Color alpha3 = rCurrentNPC.GetAlpha(npcColor2); - alpha3.R = (byte) ((int) alpha3.R * (10 - index) / 15); - alpha3.G = (byte) ((int) alpha3.G * (10 - index) / 15); - alpha3.B = (byte) ((int) alpha3.B * (10 - index) / 15); - alpha3.A = (byte) ((int) alpha3.A * (10 - index) / 15); - mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2((float) ((double) rCurrentNPC.oldPos[index].X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.oldPos[index].Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), alpha3, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - } + Microsoft.Xna.Framework.Color color47 = new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, 0); + Main.spriteBatch.Draw(Main.golemTexture[3], new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame5), color47, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); break; - case 384: - return; - case 396: - Texture2D texture19 = TextureAssets.Npc[type].Value; - Vector2 origin15 = new Vector2(191f, 130f); - Texture2D texture20 = TextureAssets.Extra[18].Value; - Texture2D texture21 = TextureAssets.Extra[19].Value; - Vector2 origin16 = new Vector2(19f, 34f); - Vector2 vector2_10 = new Vector2(27f, 59f); - Vector2 vector2_11 = new Vector2(0.0f, 0.0f); - Texture2D texture2D16 = TextureAssets.Extra[25].Value; - Vector2 vector2_12 = new Vector2(0.0f, 214f).RotatedBy((double) rCurrentNPC.rotation); - Microsoft.Xna.Framework.Rectangle r13 = texture2D16.Frame(); - r13.Height /= 3; - r13.Y += r13.Height * (int) ((double) rCurrentNPC.localAI[2] / 7.0); - Texture2D texture2D17 = TextureAssets.Extra[29].Value; - Vector2 vector2_13 = new Vector2(0.0f, 4f).RotatedBy((double) rCurrentNPC.rotation); - Microsoft.Xna.Framework.Rectangle r14 = texture2D17.Frame(); - r14.Height /= 4; - r14.Y += r14.Height * (int) ((double) rCurrentNPC.localAI[3] / 5.0); - Texture2D texture2D18 = TextureAssets.Extra[26].Value; - Microsoft.Xna.Framework.Rectangle rectangle4 = texture2D18.Frame(); - rectangle4.Height /= 4; - Vector2 center1 = Main.npc[(int) rCurrentNPC.ai[3]].Center; - Microsoft.Xna.Framework.Point tileCoordinates1 = rCurrentNPC.Center.ToTileCoordinates(); - Microsoft.Xna.Framework.Color alpha4 = rCurrentNPC.GetAlpha(Microsoft.Xna.Framework.Color.Lerp(Lighting.GetColor(tileCoordinates1.X, tileCoordinates1.Y), Microsoft.Xna.Framework.Color.White, 0.3f)); - if ((double) rCurrentNPC.ai[0] < 0.0) - { - int num165 = (int) rCurrentNPC.ai[1] / 8; - rectangle4.Y += rectangle4.Height * num165; - mySpriteBatch.Draw(texture2D18, rCurrentNPC.Center - screenPos, new Microsoft.Xna.Framework.Rectangle?(rectangle4), alpha4, rCurrentNPC.rotation, origin16 + new Vector2(4f, 4f), 1f, spriteEffects, 0.0f); - } - else - { - mySpriteBatch.Draw(texture20, rCurrentNPC.Center - screenPos, new Microsoft.Xna.Framework.Rectangle?(), alpha4, rCurrentNPC.rotation, origin16, 1f, spriteEffects, 0.0f); - Vector2 vector2_14 = Utils.Vector2FromElipse(rCurrentNPC.localAI[0].ToRotationVector2(), vector2_10 * rCurrentNPC.localAI[1]); - mySpriteBatch.Draw(texture21, rCurrentNPC.Center - screenPos + vector2_14 + vector2_11, new Microsoft.Xna.Framework.Rectangle?(), alpha4, rCurrentNPC.rotation, new Vector2((float) texture21.Width, (float) texture21.Height) / 2f, 1f, SpriteEffects.None, 0.0f); - } - mySpriteBatch.Draw(texture19, rCurrentNPC.Center - screenPos, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), alpha4, rCurrentNPC.rotation, origin15, 1f, spriteEffects, 0.0f); - mySpriteBatch.Draw(texture2D17, (rCurrentNPC.Center - screenPos + vector2_13).Floor(), new Microsoft.Xna.Framework.Rectangle?(r14), alpha4, rCurrentNPC.rotation, r14.Size() / 2f, 1f, spriteEffects, 0.0f); - mySpriteBatch.Draw(texture2D16, (rCurrentNPC.Center - screenPos + vector2_12).Floor(), new Microsoft.Xna.Framework.Rectangle?(r13), alpha4, rCurrentNPC.rotation, r13.Size() / 2f, 1f, spriteEffects, 0.0f); - return; - case 397: - Texture2D texture22 = TextureAssets.Npc[type].Value; - float num166 = 0.5f; - Vector2 vector2_15 = new Vector2(220f, -60f); - Vector2 vector2_16 = new Vector2(0.0f, 76f); - Texture2D texture23 = TextureAssets.Extra[15].Value; - Vector2 vector2_17 = new Vector2(60f, 30f); - float num167 = 340f; - Vector2 center2 = Main.npc[(int) rCurrentNPC.ai[3]].Center; - Microsoft.Xna.Framework.Point tileCoordinates2 = rCurrentNPC.Center.ToTileCoordinates(); - Microsoft.Xna.Framework.Color alpha5 = rCurrentNPC.GetAlpha(Microsoft.Xna.Framework.Color.Lerp(Lighting.GetColor(tileCoordinates2.X, tileCoordinates2.Y), Microsoft.Xna.Framework.Color.White, 0.3f)); - bool flag5 = (double) rCurrentNPC.ai[2] == 0.0; - Vector2 vector2_18 = new Vector2(flag5 ? -1f : 1f, 1f); - Vector2 origin17 = new Vector2(120f, 180f); - if (!flag5) - origin17.X = (float) texture22.Width - origin17.X; - Texture2D texture24 = TextureAssets.Extra[17].Value; - Texture2D texture25 = TextureAssets.Extra[19].Value; - Vector2 origin18 = new Vector2(26f, 42f); - if (!flag5) - origin18.X = (float) texture24.Width - origin18.X; - Vector2 vector2_19 = new Vector2(30f, 66f); - Vector2 vector2_20 = new Vector2((float) (1.0 * -(double) vector2_18.X), 3f); - Texture2D texture2D19 = TextureAssets.Extra[26].Value; - Microsoft.Xna.Framework.Rectangle rectangle5 = texture2D19.Frame(); - rectangle5.Height /= 4; - Vector2 vector2_21 = vector2_15 * vector2_18; - Vector2 vector2_22 = center2 + vector2_21; - Vector2 vector2_23 = rCurrentNPC.Center + vector2_16; - Vector2 vector2_24 = vector2_23; - Vector2 v1 = (vector2_22 - vector2_24) * (1f - num166); - Vector2 origin19 = vector2_17; - if (!flag5) - origin19.X = (float) texture23.Width - origin19.X; - float num168 = (float) Math.Acos((double) v1.Length() / (double) num167) * -vector2_18.X; - mySpriteBatch.Draw(texture23, vector2_23 - screenPos, new Microsoft.Xna.Framework.Rectangle?(), alpha5, (float) ((double) v1.ToRotation() + (double) num168 - 1.57079637050629), origin19, 1f, spriteEffects, 0.0f); - if ((double) rCurrentNPC.ai[0] == -2.0) - { - int num169 = (int) rCurrentNPC.ai[1] / 8; - rectangle5.Y += rectangle5.Height * num169; - mySpriteBatch.Draw(texture2D19, rCurrentNPC.Center - screenPos, new Microsoft.Xna.Framework.Rectangle?(rectangle5), alpha5, 0.0f, origin18 - new Vector2(4f, 4f), 1f, spriteEffects, 0.0f); - } - else - { - mySpriteBatch.Draw(texture24, rCurrentNPC.Center - screenPos, new Microsoft.Xna.Framework.Rectangle?(), alpha5, 0.0f, origin18, 1f, spriteEffects, 0.0f); - Vector2 vector2_25 = Utils.Vector2FromElipse(rCurrentNPC.localAI[0].ToRotationVector2(), vector2_19 * rCurrentNPC.localAI[1]); - mySpriteBatch.Draw(texture25, rCurrentNPC.Center - screenPos + vector2_25 + vector2_20, new Microsoft.Xna.Framework.Rectangle?(), alpha5, 0.0f, new Vector2((float) texture25.Width, (float) texture25.Height) / 2f, 1f, SpriteEffects.None, 0.0f); - } - mySpriteBatch.Draw(texture22, rCurrentNPC.Center - screenPos, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), alpha5, 0.0f, origin17, 1f, spriteEffects, 0.0f); - return; - case 398: - bool flag6 = false; - Texture2D texture26 = TextureAssets.Npc[type].Value; - Texture2D texture27 = TextureAssets.Extra[16].Value; - Texture2D texture28 = TextureAssets.Extra[14].Value; - float y2 = 340f; - float num170 = 0.5f; - Vector2 vector2_26 = new Vector2(220f, -60f); - Vector2 vector2_27 = new Vector2(76f, 66f); - Texture2D texture29 = TextureAssets.Extra[13].Value; - Vector2 origin20 = new Vector2((float) texture29.Width, 278f); - Vector2 origin21 = new Vector2(0.0f, 278f); - Vector2 vector2_28 = new Vector2(0.0f, 76f); - Vector2 center3 = rCurrentNPC.Center; - Microsoft.Xna.Framework.Point tileCoordinates3 = (rCurrentNPC.Center + new Vector2(0.0f, -150f)).ToTileCoordinates(); - Microsoft.Xna.Framework.Color alpha6 = rCurrentNPC.GetAlpha(Microsoft.Xna.Framework.Color.Lerp(Lighting.GetColor(tileCoordinates3.X, tileCoordinates3.Y), Microsoft.Xna.Framework.Color.White, 0.3f)); - for (int index5 = 0; index5 < 2; ++index5) - { - bool flag7 = index5 == 0; - Vector2 vector2_29 = new Vector2(flag7 ? -1f : 1f, 1f); - int index6 = -1; - for (int index7 = 0; index7 < 200; ++index7) - { - if (Main.npc[index7].active && Main.npc[index7].type == 397 && (double) Main.npc[index7].ai[2] == (double) index5 && (double) Main.npc[index7].ai[3] == (double) rCurrentNPC.whoAmI) - { - index6 = index7; - break; - } - } - if (index6 != -1) - { - Vector2 Position = center3 + vector2_26 * vector2_29; - Vector2 v2 = (Main.npc[index6].Center + vector2_28 - Position) * num170; - if (flag6) - Main.dust[Dust.NewDust(Position + v2, 0, 0, 6)].noGravity = true; - float num171 = (float) Math.Acos((double) v2.Length() / (double) y2) * -vector2_29.X; - SpriteEffects effects2 = flag7 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - Vector2 origin22 = vector2_27; - if (!flag7) - origin22.X = (float) texture28.Width - origin22.X; - mySpriteBatch.Draw(texture28, Position - screenPos, new Microsoft.Xna.Framework.Rectangle?(), alpha6, (float) ((double) v2.ToRotation() - (double) num171 - 1.57079637050629), origin22, 1f, effects2, 0.0f); - if (flag6) - Main.dust[Dust.NewDust(Position, 0, 0, 6)].noGravity = true; - if (flag6) - Main.dust[Dust.NewDust(center3, 0, 0, 6)].noGravity = true; - if (flag6) - Main.dust[Dust.NewDust(Position + new Vector2(0.0f, y2).RotatedBy((double) v2.ToRotation() - (double) num171 - 1.57079637050629), 0, 0, 6)].noGravity = true; - } - } - mySpriteBatch.Draw(texture29, center3 - screenPos, new Microsoft.Xna.Framework.Rectangle?(), alpha6, 0.0f, origin20, 1f, SpriteEffects.None, 0.0f); - mySpriteBatch.Draw(texture29, center3 - screenPos, new Microsoft.Xna.Framework.Rectangle?(), alpha6, 0.0f, origin21, 1f, SpriteEffects.FlipHorizontally, 0.0f); - mySpriteBatch.Draw(texture27, center3 - screenPos, new Microsoft.Xna.Framework.Rectangle?(), alpha6, 0.0f, new Vector2(112f, 101f), 1f, SpriteEffects.None, 0.0f); - mySpriteBatch.Draw(texture26, center3 - screenPos, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), alpha6, 0.0f, rCurrentNPC.frame.Size() / 2f, 1f, SpriteEffects.None, 0.0f); - return; - case 399: - Texture2D texture30 = TextureAssets.Npc[type].Value; - (rCurrentNPC.position - screenPos + Vector2.UnitY * rCurrentNPC.gfxOffY).Floor(); - float num172 = 5f; - for (int index8 = 0; (double) index8 < (double) num172; ++index8) - { - float num173 = (float) (1.0 - ((double) Main.GlobalTimeWrappedHourly + (double) index8) % (double) num172 / (double) num172); - Microsoft.Xna.Framework.Color color38 = Microsoft.Xna.Framework.Color.LimeGreen; - if ((double) rCurrentNPC.ai[0] == 1.0) - color38 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.LimeGreen, Microsoft.Xna.Framework.Color.Red, MathHelper.Clamp(rCurrentNPC.ai[1] / 20f, 0.0f, 1f)); - if ((double) rCurrentNPC.ai[0] == 2.0) - color38 = Microsoft.Xna.Framework.Color.Red; - Microsoft.Xna.Framework.Color color39 = color38 * (1f - num173); - color39.A = (byte) 0; - for (int index9 = 0; index9 < 2; ++index9) - mySpriteBatch.Draw(TextureAssets.Extra[27].Value, rCurrentNPC.Center - screenPos + Vector2.UnitY * (float) ((double) rCurrentNPC.gfxOffY - 4.0 + 6.0), new Microsoft.Xna.Framework.Rectangle?(), color39, 1.570796f, new Vector2(10f, 48f), num173 * 4f, SpriteEffects.None, 0.0f); - } - mySpriteBatch.Draw(texture30, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), rCurrentNPC.GetAlpha(npcColor2), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - Texture2D texture31 = TextureAssets.GlowMask[100].Value; - mySpriteBatch.Draw(texture31, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color((int) sbyte.MaxValue - rCurrentNPC.alpha / 2, (int) sbyte.MaxValue - rCurrentNPC.alpha / 2, (int) sbyte.MaxValue - rCurrentNPC.alpha / 2, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - Texture2D texture2D20 = TextureAssets.Extra[20].Value; - Microsoft.Xna.Framework.Rectangle rectangle6 = texture2D20.Frame(verticalFrames: 4, frameY: ((int) rCurrentNPC.ai[0] + 1)); - Vector2 position38 = new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) texture2D20.Width * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale + (double) addHeight + (double) addY + (double) rCurrentNPC.gfxOffY + 18.0 + 6.0)); - mySpriteBatch.Draw(texture2D20, position38, new Microsoft.Xna.Framework.Rectangle?(rectangle6), rCurrentNPC.GetAlpha(npcColor2), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - Texture2D texture32 = TextureAssets.GlowMask[101].Value; - mySpriteBatch.Draw(texture32, position38, new Microsoft.Xna.Framework.Rectangle?(rectangle6), new Microsoft.Xna.Framework.Color((int) sbyte.MaxValue - rCurrentNPC.alpha / 2, (int) sbyte.MaxValue - rCurrentNPC.alpha / 2, (int) sbyte.MaxValue - rCurrentNPC.alpha / 2, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - return; - case 400: - Texture2D texture33 = TextureAssets.Npc[type].Value; - Texture2D texture2D21 = TextureAssets.Extra[19].Value; - Vector2 origin23 = new Vector2(40f, 40f); - Vector2 vector2_30 = new Vector2(30f, 30f); - Vector2 center4 = rCurrentNPC.Center; - Microsoft.Xna.Framework.Point tileCoordinates4 = rCurrentNPC.Center.ToTileCoordinates(); - Microsoft.Xna.Framework.Color alpha7 = rCurrentNPC.GetAlpha(Microsoft.Xna.Framework.Color.Lerp(Lighting.GetColor(tileCoordinates4.X, tileCoordinates4.Y), Microsoft.Xna.Framework.Color.White, 0.3f)); - mySpriteBatch.Draw(texture33, rCurrentNPC.Center - screenPos, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), alpha7, rCurrentNPC.rotation, origin23, 1f, spriteEffects, 0.0f); - Vector2 vector2_31 = Utils.Vector2FromElipse(rCurrentNPC.localAI[0].ToRotationVector2(), vector2_30 * rCurrentNPC.localAI[1]); - mySpriteBatch.Draw(texture2D21, rCurrentNPC.Center - screenPos + vector2_31, new Microsoft.Xna.Framework.Rectangle?(), alpha7, rCurrentNPC.rotation, texture2D21.Size() / 2f, rCurrentNPC.localAI[2], SpriteEffects.None, 0.0f); - return; - case 416: - int index10 = -1; - int index11 = (int) rCurrentNPC.ai[0]; - Vector2 position39 = rCurrentNPC.position; - Vector2 spinningpoint4 = Vector2.Zero; - if (Main.npc[index11].active && Main.npc[index11].type == 415) - index10 = index11; - if (index10 != -1) - { - Vector2 position40 = rCurrentNPC.position; - rCurrentNPC.Bottom = Main.npc[index10].Bottom; - position39 = rCurrentNPC.position; - rCurrentNPC.position = position40; - rCurrentNPC.gfxOffY = Main.npc[index10].gfxOffY; - spinningpoint4 = Main.npc[index10].velocity; - } - Microsoft.Xna.Framework.Rectangle frame3 = rCurrentNPC.frame; - mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2((float) ((double) position39.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) position39.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame3), rCurrentNPC.GetAlpha(npcColor2), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - if (rCurrentNPC.color != new Microsoft.Xna.Framework.Color()) - mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2((float) ((double) position39.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) position39.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame3), rCurrentNPC.GetColor(npcColor2), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - mySpriteBatch.Draw(TextureAssets.GlowMask[156].Value, position39 + rCurrentNPC.Size * new Vector2(0.5f, 1f) - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - vector3 = rCurrentNPC.GetAlpha(npcColor2).ToVector3() - new Vector3(0.5f); - float num174 = (float) (0.5 + (double) vector3.Length() * 0.5); - for (int index12 = 0; index12 < 4; ++index12) - mySpriteBatch.Draw(TextureAssets.GlowMask[156].Value, position39 + rCurrentNPC.Size * new Vector2(0.5f, 1f) - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY) + spinningpoint4.RotatedBy((double) index12 * 1.57079637050629) * num174, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(64, 64, 64, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - return; - case 491: - NPC npc4 = rCurrentNPC; - Texture2D texture34 = TextureAssets.Npc[npc4.type].Value; - Microsoft.Xna.Framework.Rectangle frame4 = npc4.frame; - Vector2 origin24 = frame4.OriginFlip(new Vector2(208f, 460f), spriteEffects); - Vector2 position41 = npc4.Center - screenPos; - Vector2 vector2_32 = new Vector2(spriteEffects.HasFlag((Enum) SpriteEffects.FlipHorizontally) ? -1f : 1f, 1f); - Microsoft.Xna.Framework.Color alpha8 = npc4.GetAlpha(npcColor2); - mySpriteBatch.Draw(texture34, position41, new Microsoft.Xna.Framework.Rectangle?(frame4), alpha8, npc4.rotation, origin24, npc4.scale, spriteEffects, 0.0f); - int num175 = (int) npc4.localAI[3] / 8; - Texture2D texture2D22 = TextureAssets.Extra[40].Value; - Microsoft.Xna.Framework.Rectangle r15 = texture2D22.Frame(verticalFrames: 4, frameY: (num175 % 4)); - Vector2 origin25 = r15.Size() * new Vector2(0.5f, 1f); - mySpriteBatch.Draw(texture2D22, position41 + (new Vector2(102f, -384f) * vector2_32).RotatedBy((double) npc4.rotation), new Microsoft.Xna.Framework.Rectangle?(r15), alpha8, npc4.rotation, origin25, npc4.scale, spriteEffects, 0.0f); - Texture2D texture2D23 = TextureAssets.Extra[41].Value; - Microsoft.Xna.Framework.Rectangle r16 = texture2D23.Frame(verticalFrames: 8, frameY: (num175 % 8)); - Vector2 origin26 = r16.Size() * new Vector2(0.5f, 0.0f) + new Vector2(0.0f, 10f); - for (int index13 = 0; index13 < 5; ++index13) - mySpriteBatch.Draw(texture2D23, position41 + (new Vector2((float) (34 * index13 - 96), 40f) * vector2_32).RotatedBy((double) npc4.rotation), new Microsoft.Xna.Framework.Rectangle?(r16), alpha8, npc4.rotation, origin26, npc4.scale, spriteEffects, 0.0f); - Texture2D texture2D24 = TextureAssets.Extra[42].Value; - Microsoft.Xna.Framework.Rectangle r17 = texture2D24.Frame(verticalFrames: 4, frameY: (num175 % 4)); - Vector2 origin27 = r17.Size() * new Vector2(0.5f, 0.0f); - for (int index14 = 0; index14 < 2; ++index14) - mySpriteBatch.Draw(texture2D24, position41 + (new Vector2((float) (158 - 106 * index14), -302f) * vector2_32).RotatedBy((double) npc4.rotation), new Microsoft.Xna.Framework.Rectangle?(r17), alpha8, npc4.rotation, origin27, npc4.scale, spriteEffects, 0.0f); - Texture2D texture2D25 = TextureAssets.Extra[43].Value; - Microsoft.Xna.Framework.Rectangle r18 = texture2D25.Frame(verticalFrames: 4, frameY: (num175 % 4)); - Vector2 origin28 = r18.Size() * new Vector2(0.5f, 0.0f); - for (int index15 = 0; index15 < 2; ++index15) - mySpriteBatch.Draw(texture2D25, position41 + (new Vector2((float) (42 - 178 * index15), -444f) * vector2_32).RotatedBy((double) npc4.rotation), new Microsoft.Xna.Framework.Rectangle?(r18), alpha8, npc4.rotation, origin28, npc4.scale, spriteEffects, 0.0f); - Texture2D texture2D26 = TextureAssets.Extra[44].Value; - Microsoft.Xna.Framework.Rectangle r19 = texture2D26.Frame(verticalFrames: 4, frameY: (num175 % 4)); - Vector2 origin29 = r19.Size() * new Vector2(0.5f, 0.0f); - mySpriteBatch.Draw(texture2D26, position41 + (new Vector2(-134f, -302f) * vector2_32).RotatedBy((double) npc4.rotation), new Microsoft.Xna.Framework.Rectangle?(r19), alpha8, npc4.rotation, origin29, npc4.scale, spriteEffects, 0.0f); - Texture2D texture2D27 = TextureAssets.Extra[45].Value; - Microsoft.Xna.Framework.Rectangle r20 = texture2D27.Frame(verticalFrames: 4, frameY: ((2 + num175) % 4)); - Vector2 origin30 = r20.Size() * new Vector2(0.5f, 0.0f); - mySpriteBatch.Draw(texture2D27, position41 + (new Vector2(-60f, -330f) * vector2_32).RotatedBy((double) npc4.rotation), new Microsoft.Xna.Framework.Rectangle?(r20), alpha8, npc4.rotation, origin30, npc4.scale, spriteEffects, 0.0f); - this.LoadNPC(492); - if (!TextureAssets.Npc[492].IsLoaded) - return; - Texture2D texture2D28 = TextureAssets.Npc[492].Value; - Microsoft.Xna.Framework.Rectangle r21 = texture2D28.Frame(verticalFrames: 9); - Vector2 origin31 = r21.Size() * new Vector2(0.5f, 0.0f) + new Vector2(0.0f, 10f); - for (int index16 = 0; index16 < 4; ++index16) - { - int index17 = (int) npc4.ai[index16]; - if (index17 >= 0) - { - r21.Y = Main.npc[index17].frame.Y; - mySpriteBatch.Draw(texture2D28, position41 + (new Vector2((float) (68 * index16 - 122), -20f) * vector2_32).RotatedBy((double) npc4.rotation), new Microsoft.Xna.Framework.Rectangle?(r21), alpha8, npc4.rotation, origin31, npc4.scale, spriteEffects, 0.0f); - } - } - return; - } - if (type == 125 || type == 126 || type == (int) sbyte.MaxValue || type == 128 || type == 129 || type == 130 || type == 131 || type == 139 || type == 140) - { - for (int index18 = 9; index18 >= 0; index18 -= 2) - { - ref Vector2 local = ref rCurrentNPC.oldPos[index18]; - Microsoft.Xna.Framework.Color alpha9 = rCurrentNPC.GetAlpha(npcColor2); - alpha9.R = (byte) ((int) alpha9.R * (10 - index18) / 20); - alpha9.G = (byte) ((int) alpha9.G * (10 - index18) / 20); - alpha9.B = (byte) ((int) alpha9.B * (10 - index18) / 20); - alpha9.A = (byte) ((int) alpha9.A * (10 - index18) / 20); - mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2((float) ((double) rCurrentNPC.oldPos[index18].X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.oldPos[index18].Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), alpha9, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); } - } - if (type == 417 && (double) rCurrentNPC.ai[0] >= 6.0 && (double) rCurrentNPC.ai[0] <= 6.0) - { - for (int index19 = 5; index19 >= 0; --index19) - { - ref Vector2 local = ref rCurrentNPC.oldPos[index19]; - Microsoft.Xna.Framework.Color alpha10 = rCurrentNPC.GetAlpha(npcColor2); - alpha10.R = (byte) ((int) alpha10.R * (10 - index19) / 20); - alpha10.G = (byte) ((int) alpha10.G * (10 - index19) / 20); - alpha10.B = (byte) ((int) alpha10.B * (10 - index19) / 20); - alpha10.A = (byte) ((int) alpha10.A * (10 - index19) / 20); - mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2((float) ((double) rCurrentNPC.oldPos[index19].X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.oldPos[index19].Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), alpha10, rCurrentNPC.oldRot[index19], halfSize, MathHelper.Lerp(0.5f, 1f, (float) ((5.0 - (double) index19) / 6.0)), spriteEffects, 0.0f); - } - } - if (type == 419 && (double) rCurrentNPC.ai[2] <= -9.0) - { - int num176 = TextureAssets.GlowMask[154].Height() / Main.npcFrameCount[type]; - int num177 = rCurrentNPC.frame.Y / num176; - for (int index20 = 6; index20 >= 0; --index20) - { - ref Vector2 local = ref rCurrentNPC.oldPos[index20]; - Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; - white.R = (byte) ((int) byte.MaxValue * (10 - index20) / 20); - white.G = (byte) ((int) byte.MaxValue * (10 - index20) / 20); - white.B = (byte) ((int) byte.MaxValue * (10 - index20) / 20); - white.A = (byte) 0; - Microsoft.Xna.Framework.Rectangle frame5 = rCurrentNPC.frame; - int num178 = (num177 - 3 - index20) % 3; - if (num178 < 0) - num178 += 3; - int num179 = num178 + 5; - frame5.Y = num176 * num179; - mySpriteBatch.Draw(TextureAssets.GlowMask[154].Value, new Vector2((float) ((double) rCurrentNPC.oldPos[index20].X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.oldPos[index20].Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(frame5), white, rCurrentNPC.oldRot[index20], halfSize, MathHelper.Lerp(0.75f, 1.2f, (float) ((10.0 - (double) index20) / 10.0)), spriteEffects, 0.0f); - } - } - if (type == 418 && ((double) rCurrentNPC.ai[0] == 2.0 || (double) rCurrentNPC.ai[0] == 4.0)) - { - Texture2D texture2D29 = TextureAssets.Extra[55].Value; - Vector2 origin32 = new Vector2((float) (texture2D29.Width / 2), (float) (texture2D29.Height / 8 + 14)); - int num180 = (int) rCurrentNPC.ai[1] / 2; - float num181 = -1.570796f * (float) rCurrentNPC.spriteDirection; - float amount15 = rCurrentNPC.ai[1] / 45f; - if ((double) amount15 > 1.0) - amount15 = 1f; - int num182 = num180 % 4; - for (int index21 = 6; index21 >= 0; --index21) - { - ref Vector2 local = ref rCurrentNPC.oldPos[index21]; - Microsoft.Xna.Framework.Color color40 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Gold, Microsoft.Xna.Framework.Color.OrangeRed, amount15); - color40 = Microsoft.Xna.Framework.Color.Lerp(color40, Microsoft.Xna.Framework.Color.Blue, (float) index21 / 12f); - color40.A = (byte) (64.0 * (double) amount15); - color40.R = (byte) ((int) color40.R * (10 - index21) / 20); - color40.G = (byte) ((int) color40.G * (10 - index21) / 20); - color40.B = (byte) ((int) color40.B * (10 - index21) / 20); - color40.A = (byte) ((int) color40.A * (10 - index21) / 20); - color40 *= amount15; - int frameY = (num182 - index21) % 4; - if (frameY < 0) - frameY += 4; - Microsoft.Xna.Framework.Rectangle rectangle7 = texture2D29.Frame(verticalFrames: 4, frameY: frameY); - mySpriteBatch.Draw(texture2D29, new Vector2((float) ((double) rCurrentNPC.oldPos[index21].X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.oldPos[index21].Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(rectangle7), color40, rCurrentNPC.oldRot[index21] + num181, origin32, MathHelper.Lerp(0.1f, 1.2f, (float) ((10.0 - (double) index21) / 10.0)), spriteEffects, 0.0f); - } - } - if (type == 516) - { - int num183 = TextureAssets.Npc[type].Height() / Main.npcFrameCount[type]; - int num184 = rCurrentNPC.frame.Y / num183; - for (int index22 = 6; index22 >= 0; --index22) - { - ref Vector2 local = ref rCurrentNPC.oldPos[index22]; - Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; - white.R = (byte) ((int) byte.MaxValue * (10 - index22) / 20); - white.G = (byte) ((int) byte.MaxValue * (10 - index22) / 20); - white.B = (byte) ((int) byte.MaxValue * (10 - index22) / 20); - white.A = (byte) ((int) byte.MaxValue * (10 - index22) / 20); - Microsoft.Xna.Framework.Color color41 = Microsoft.Xna.Framework.Color.Lerp(white, Microsoft.Xna.Framework.Color.Transparent, (float) index22 / 6f); - Microsoft.Xna.Framework.Rectangle frame6 = rCurrentNPC.frame; - int num185 = (num184 - 4 - index22) % 4; - if (num185 < 0) - num185 += 4; - frame6.Y = num183 * num185; - mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2((float) ((double) rCurrentNPC.oldPos[index22].X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.oldPos[index22].Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(frame6), color41, rCurrentNPC.rotation, halfSize, MathHelper.Lerp(0.35f, 1.2f, (float) ((10.0 - (double) index22) / 10.0)), spriteEffects, 0.0f); - } - } - if (rCurrentNPC.type == 390 && rCurrentNPC.IsABestiaryIconDummy) - { - this.LoadNPC(391); - Texture2D texture2D30 = TextureAssets.Npc[391].Value; - Microsoft.Xna.Framework.Rectangle rectangle8 = texture2D30.Frame(verticalFrames: Main.npcFrameCount[391], frameY: ((int) rCurrentNPC.localAI[3])); - Vector2 vector2_33 = new Vector2((float) (-rCurrentNPC.width - 8), 10f); - mySpriteBatch.Draw(texture2D30, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY) + vector2_33, new Microsoft.Xna.Framework.Rectangle?(rectangle8), rCurrentNPC.GetAlpha(npcColor2), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - } - Microsoft.Xna.Framework.Rectangle frame7 = rCurrentNPC.frame; - if (type == 182 || type == 289) - frame7.Height -= 2; - if ((uint) (type - 420) > 1U && (uint) (type - 423) > 1U) - { - if (type == 662) - { - float num186 = (float) (4.0 + 2.0 * Math.Cos(6.28318548202515 * (double) Main.GlobalTimeWrappedHourly)); - Vector2 spinningpoint5 = Vector2.UnitX * num186; - Microsoft.Xna.Framework.Color color42 = Microsoft.Xna.Framework.Color.Cyan * (num186 / 12f) * 0.4f; - color42.A /= (byte) 4; - for (float num187 = 0.9f; (double) num187 >= 0.0; num187 -= 0.125f) - { - Vector2 vector2_34 = rCurrentNPC.position - rCurrentNPC.velocity * 10f * num187; - mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2((float) ((double) vector2_34.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) vector2_34.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame7), color42 * (1f - num187), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - } - for (float num188 = 0.0f; (double) num188 < 6.28318548202515; num188 += 1.570796f) - { - Vector2 vector2_35 = rCurrentNPC.position + spinningpoint5.RotatedBy((double) num188); - mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2((float) ((double) vector2_35.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) vector2_35.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame7), color42, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - } - } - } - else - { - float num189 = (float) (9.0 + 3.0 * Math.Cos(6.28318548202515 * (double) Main.GlobalTimeWrappedHourly)); - Vector2 spinningpoint6 = Vector2.UnitX * num189; - Microsoft.Xna.Framework.Color color43 = Microsoft.Xna.Framework.Color.Teal * (num189 / 12f) * 0.8f; - color43.A /= (byte) 2; - for (float num190 = 0.0f; (double) num190 < 6.28318548202515; num190 += 1.570796f) - { - Vector2 vector2_36 = rCurrentNPC.position + spinningpoint6.RotatedBy((double) num190); - mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2((float) ((double) vector2_36.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) vector2_36.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame7), color43, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - } - } - if (rCurrentNPC.aiStyle == 7) - this.DrawNPCExtras(rCurrentNPC, true, addHeight, addY, npcColor2, halfSize, spriteEffects, screenPos); - if (type == 346 && (double) rCurrentNPC.life < (double) rCurrentNPC.lifeMax * 0.5) - { - mySpriteBatch.Draw(TextureAssets.SantaTank.Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame7), rCurrentNPC.GetAlpha(npcColor2), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - } - else - { switch (type) { - case 356: - --frame7.Height; - mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame7), rCurrentNPC.GetAlpha(npcColor2), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 360: - float num191 = 0.0f; - if ((double) rCurrentNPC.ai[2] == 0.0) + case 246: + Microsoft.Xna.Framework.Color color48 = new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, 0); + if (n.frame.Y < 222) { - if ((double) rCurrentNPC.rotation == 3.14000010490417 || (double) rCurrentNPC.rotation == -3.14000010490417) - addHeight = 2f; - if (rCurrentNPC.direction < 0 && ((double) rCurrentNPC.rotation == 1.57000005245209 || (double) rCurrentNPC.rotation == 4.71000003814697)) - num191 = 1f; - if (rCurrentNPC.direction > 0 && ((double) rCurrentNPC.rotation == 1.57000005245209 || (double) rCurrentNPC.rotation == 4.71000003814697)) - num191 = -1f; - } - mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale) + num191, (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame7), rCurrentNPC.GetAlpha(npcColor2), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 655: - float num192 = 0.0f; - if ((double) rCurrentNPC.ai[2] == 0.0) - { - if ((double) rCurrentNPC.rotation == 3.14000010490417 || (double) rCurrentNPC.rotation == -3.14000010490417) - addHeight = 2f; - if (rCurrentNPC.direction < 0 && ((double) rCurrentNPC.rotation == 1.57000005245209 || (double) rCurrentNPC.rotation == 4.71000003814697)) - num192 = 1f; - if (rCurrentNPC.direction > 0 && ((double) rCurrentNPC.rotation == 1.57000005245209 || (double) rCurrentNPC.rotation == 4.71000003814697)) - num192 = -1f; - } - mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale) + num192, (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame7), rCurrentNPC.GetAlpha(Microsoft.Xna.Framework.Color.Orange), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - default: - if (type == 266 && rCurrentNPC.life < rCurrentNPC.lifeMax && (Main.expertMode || Main.getGoodWorld)) - { - Microsoft.Xna.Framework.Color alpha11 = rCurrentNPC.GetAlpha(npcColor2); - float num193 = (float) (1.0 - (double) rCurrentNPC.life / (double) rCurrentNPC.lifeMax); - float num194 = num193 * num193; - if (Main.getGoodWorld) - num194 = 1f; - alpha11.R = (byte) ((double) alpha11.R * (double) num194); - alpha11.G = (byte) ((double) alpha11.G * (double) num194); - alpha11.B = (byte) ((double) alpha11.B * (double) num194); - alpha11.A = (byte) ((double) alpha11.A * (double) num194); - for (int index23 = 0; index23 < 4; ++index23) - { - Vector2 position42 = rCurrentNPC.position; - float num195 = Math.Abs(rCurrentNPC.Center.X - Main.player[Main.myPlayer].Center.X); - float num196 = Math.Abs(rCurrentNPC.Center.Y - Main.player[Main.myPlayer].Center.Y); - position42.X = index23 == 0 || index23 == 2 ? Main.player[Main.myPlayer].Center.X + num195 : Main.player[Main.myPlayer].Center.X - num195; - position42.X -= (float) (rCurrentNPC.width / 2); - position42.Y = index23 == 0 || index23 == 1 ? Main.player[Main.myPlayer].Center.Y + num196 : Main.player[Main.myPlayer].Center.Y - num196; - position42.Y -= (float) (rCurrentNPC.height / 2); - mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2((float) ((double) position42.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) position42.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame7), alpha11, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - } - mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame7), rCurrentNPC.GetAlpha(npcColor2), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); + Main.spriteBatch.Draw(Main.golemTexture[1], new Vector2((float) ((double) n.Center.X - (double) Main.screenPosition.X - 20.0), (float) ((double) n.Center.Y - (double) Main.screenPosition.Y - 27.0)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.golemTexture[1].Width, Main.golemTexture[1].Height / 2)), color48, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); break; } - if (type == 421 && (double) rCurrentNPC.ai[0] == 5.0) + if (n.frame.Y < 444) { - Player player = Main.player[rCurrentNPC.target]; - if ((double) player.gravDir == -1.0) - spriteEffects |= SpriteEffects.FlipVertically; - mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2((float) (player.direction * 4), player.gfxOffY) + ((double) player.gravDir == 1.0 ? player.Top : player.Bottom) - screenPos, new Microsoft.Xna.Framework.Rectangle?(frame7), rCurrentNPC.GetAlpha(npcColor2), rCurrentNPC.rotation, frame7.Size() / 2f, rCurrentNPC.scale, spriteEffects, 0.0f); - mySpriteBatch.Draw(TextureAssets.GlowMask[146].Value, new Vector2((float) (player.direction * 4), player.gfxOffY) + ((double) player.gravDir == 1.0 ? player.Top : player.Bottom) - screenPos, new Microsoft.Xna.Framework.Rectangle?(frame7), rCurrentNPC.GetAlpha(npcColor2), rCurrentNPC.rotation, frame7.Size() / 2f, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - } - if (type == 518) - { - Vector2 vector2_37 = new Vector2(-10f, 0.0f); - mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame7), rCurrentNPC.GetAlpha(npcColor2), rCurrentNPC.rotation, halfSize + vector2_37, rCurrentNPC.scale, spriteEffects, 0.0f); - if (rCurrentNPC.color != new Microsoft.Xna.Framework.Color()) - { - mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame7), rCurrentNPC.GetColor(npcColor2), rCurrentNPC.rotation, halfSize + vector2_37, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - } - break; - } - mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame7), rCurrentNPC.GetAlpha(npcColor2), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - if (rCurrentNPC.color != new Microsoft.Xna.Framework.Color()) - { - mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame7), rCurrentNPC.GetColor(npcColor2), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); + Main.spriteBatch.Draw(Main.golemTexture[2], new Vector2((float) ((double) n.Center.X - (double) Main.screenPosition.X + 26.0), (float) ((double) n.Center.Y - (double) Main.screenPosition.Y - 28.0)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.golemTexture[2].Width, Main.golemTexture[2].Height / 4)), color48, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); break; } + Main.spriteBatch.Draw(Main.golemTexture[2], new Vector2((float) ((double) n.Center.X - (double) Main.screenPosition.X - 38.0), (float) ((double) n.Center.Y - (double) Main.screenPosition.Y - 28.0)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, Main.golemTexture[2].Height / 2, Main.golemTexture[2].Width, Main.golemTexture[2].Height / 4)), color48, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); break; - } - } - if (rCurrentNPC.confused) - mySpriteBatch.Draw(TextureAssets.Confuse.Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale + (double) addHeight + (double) addY - (double) TextureAssets.Confuse.Height() - 20.0)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Confuse.Width(), TextureAssets.Confuse.Height())), new Microsoft.Xna.Framework.Color(250, 250, 250, 70), rCurrentNPC.velocity.X * -0.05f, new Vector2((float) (TextureAssets.Confuse.Width() / 2), (float) (TextureAssets.Confuse.Height() / 2)), Main.essScale + 0.2f, SpriteEffects.None, 0.0f); - if (type >= 639 && type <= 645) - mySpriteBatch.Draw(TextureAssets.GlowMask[286].Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame7), rCurrentNPC.GetAlpha(Microsoft.Xna.Framework.Color.White), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - if (type >= 646 && type <= 652) - mySpriteBatch.Draw(TextureAssets.GlowMask[287].Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame7), rCurrentNPC.GetAlpha(Microsoft.Xna.Framework.Color.White), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - if (type >= 134 && type <= 136 && npcColor2 != Microsoft.Xna.Framework.Color.Black) - { - mySpriteBatch.Draw(TextureAssets.Dest[type - 134].Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * (float) (1.0 - (double) rCurrentNPC.alpha / (double) byte.MaxValue), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - } - else - { - switch (type) - { - case 120: - for (int index24 = 1; index24 < rCurrentNPC.oldPos.Length; ++index24) - { - ref Vector2 local = ref rCurrentNPC.oldPos[index24]; - mySpriteBatch.Draw(TextureAssets.Chaos.Value, new Vector2((float) ((double) rCurrentNPC.oldPos[index24].X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.oldPos[index24].Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color() - { - R = (byte) (150 * (10 - index24) / 15), - G = (byte) (100 * (10 - index24) / 15), - B = (byte) (150 * (10 - index24) / 15), - A = (byte) (50 * (10 - index24) / 15) - }, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - } + case 249: + Microsoft.Xna.Framework.Color color49 = new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, 0); + Main.spriteBatch.Draw(Main.golemTexture[1], new Vector2((float) ((double) n.Center.X - (double) Main.screenPosition.X - 20.0), (float) ((double) n.Center.Y - (double) Main.screenPosition.Y - 47.0)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.golemTexture[1].Width, Main.golemTexture[1].Height / 2)), color49, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); break; - case 125: - mySpriteBatch.Draw(TextureAssets.EyeLaser.Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case (int) sbyte.MaxValue: - mySpriteBatch.Draw(TextureAssets.BoneEyes.Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(200, 200, 200, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 131: - mySpriteBatch.Draw(TextureAssets.BoneLaser.Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(200, 200, 200, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 139: - mySpriteBatch.Draw(TextureAssets.Probe.Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - default: - if (type == 137 || type == 138) - { - for (int index25 = 1; index25 < rCurrentNPC.oldPos.Length; ++index25) - { - ref Vector2 local = ref rCurrentNPC.oldPos[index25]; - mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2((float) ((double) rCurrentNPC.oldPos[index25].X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.oldPos[index25].Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color() - { - R = (byte) (150 * (10 - index25) / 15), - G = (byte) (100 * (10 - index25) / 15), - B = (byte) (150 * (10 - index25) / 15), - A = (byte) (50 * (10 - index25) / 15) - }, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - } - break; - } - switch (type) - { - case 82: - mySpriteBatch.Draw(TextureAssets.WraithEye.Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), Microsoft.Xna.Framework.Color.White, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - for (int index26 = 1; index26 < 10; ++index26) - { - Microsoft.Xna.Framework.Color color44 = new Microsoft.Xna.Framework.Color(110 - index26 * 10, 110 - index26 * 10, 110 - index26 * 10, 110 - index26 * 10); - mySpriteBatch.Draw(TextureAssets.WraithEye.Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight) - rCurrentNPC.velocity * (float) index26 * 0.5f, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), color44, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - } - break; - case 253: - mySpriteBatch.Draw(TextureAssets.ReaperEye.Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 3.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), Microsoft.Xna.Framework.Color.White, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - for (int index27 = 1; index27 < 20; ++index27) - { - Microsoft.Xna.Framework.Color color45 = new Microsoft.Xna.Framework.Color(210 - index27 * 20, 210 - index27 * 20, 210 - index27 * 20, 210 - index27 * 20); - mySpriteBatch.Draw(TextureAssets.ReaperEye.Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 3.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight) - rCurrentNPC.velocity * (float) index27 * 0.5f, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), color45, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - } - break; - case 325: - mySpriteBatch.Draw(TextureAssets.TreeFace.Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), Microsoft.Xna.Framework.Color.White, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - for (int index28 = 1; index28 < 10; ++index28) - { - Microsoft.Xna.Framework.Color color46 = new Microsoft.Xna.Framework.Color(110 - index28 * 10, 110 - index28 * 10, 110 - index28 * 10, 110 - index28 * 10); - Vector2 vector2_38 = new Vector2((float) Main.rand.Next(-10, 11) * 0.2f, (float) Main.rand.Next(-10, 11) * 0.2f); - mySpriteBatch.Draw(TextureAssets.TreeFace.Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight) + vector2_38, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), color46, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - } - break; - case 327: - mySpriteBatch.Draw(TextureAssets.PumpkingFace.Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), Microsoft.Xna.Framework.Color.White, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - for (int index29 = 1; index29 < 10; ++index29) - { - Microsoft.Xna.Framework.Color color47 = new Microsoft.Xna.Framework.Color(110 - index29 * 10, 110 - index29 * 10, 110 - index29 * 10, 110 - index29 * 10); - Vector2 vector2_39 = new Vector2((float) Main.rand.Next(-10, 11) * 0.2f, (float) Main.rand.Next(-10, 11) * 0.2f); - mySpriteBatch.Draw(TextureAssets.PumpkingFace.Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight) + vector2_39, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), color47, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - } - break; - case 345: - mySpriteBatch.Draw(TextureAssets.IceQueen.Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), Microsoft.Xna.Framework.Color.White, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - for (int index30 = 1; index30 < 5; ++index30) - { - Microsoft.Xna.Framework.Color color48 = new Microsoft.Xna.Framework.Color(100 - index30 * 10, 100 - index30 * 10, 100 - index30 * 10, 100 - index30 * 10); - mySpriteBatch.Draw(TextureAssets.IceQueen.Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight) - rCurrentNPC.velocity * (float) index30 * 0.2f, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), color48, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - } - break; - case 355: - mySpriteBatch.Draw(TextureAssets.Firefly.Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 358: - mySpriteBatch.Draw(TextureAssets.Lightningbug.Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 653: - mySpriteBatch.Draw(TextureAssets.GlowMask[288].Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 3.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 654: - mySpriteBatch.Draw(TextureAssets.GlowMask[290].Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - default: - if (type == 245 && rCurrentNPC.alpha == 0 && !Main.getGoodWorld) - { - Microsoft.Xna.Framework.Color color49 = new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, 0); - mySpriteBatch.Draw(TextureAssets.Golem[3].Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame7), color49, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - } - if (type == 246 && !Main.getGoodWorld) - { - Microsoft.Xna.Framework.Color color50 = new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, 0); - if (rCurrentNPC.frame.Y < 222) - { - mySpriteBatch.Draw(TextureAssets.Golem[1].Value, new Vector2((float) ((double) rCurrentNPC.Center.X - (double) screenPos.X - 20.0), (float) ((double) rCurrentNPC.Center.Y - (double) screenPos.Y - 27.0)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Golem[1].Width(), TextureAssets.Golem[1].Height() / 2)), color50, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - Microsoft.Xna.Framework.Rectangle rectangle9 = frame7; - rectangle9.Y = 0; - mySpriteBatch.Draw(TextureAssets.Extra[107].Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle9), color50, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - } - if (rCurrentNPC.frame.Y < 444) - { - mySpriteBatch.Draw(TextureAssets.Golem[2].Value, new Vector2((float) ((double) rCurrentNPC.Center.X - (double) screenPos.X + 26.0), (float) ((double) rCurrentNPC.Center.Y - (double) screenPos.Y - 28.0)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Golem[2].Width(), TextureAssets.Golem[2].Height() / 4)), color50, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - break; - } - mySpriteBatch.Draw(TextureAssets.Golem[2].Value, new Vector2((float) ((double) rCurrentNPC.Center.X - (double) screenPos.X - 38.0), (float) ((double) rCurrentNPC.Center.Y - (double) screenPos.Y - 28.0)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, TextureAssets.Golem[2].Height() / 2, TextureAssets.Golem[2].Width(), TextureAssets.Golem[2].Height() / 4)), color50, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - break; - } - if (type == 249 && !Main.getGoodWorld) - { - Microsoft.Xna.Framework.Color color51 = new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, 0); - mySpriteBatch.Draw(TextureAssets.Golem[1].Value, new Vector2((float) ((double) rCurrentNPC.Center.X - (double) screenPos.X - 20.0), (float) ((double) rCurrentNPC.Center.Y - (double) screenPos.Y - 47.0)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Golem[1].Width(), TextureAssets.Golem[1].Height() / 2)), color51, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - int num197 = (int) rCurrentNPC.frameCounter / 4; - Texture2D texture2D31 = TextureAssets.Extra[106].Value; - Microsoft.Xna.Framework.Rectangle rectangle10 = texture2D31.Frame(verticalFrames: 8); - Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; - rectangle10.Y += rectangle10.Height * 2 * num197 + frame7.Y; - mySpriteBatch.Draw(texture2D31, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle10), color51, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - Texture2D texture35 = TextureAssets.Extra[107].Value; - Microsoft.Xna.Framework.Rectangle rectangle11 = frame7; - mySpriteBatch.Draw(texture35, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle11), color51, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - } - switch (type) - { - case 381: - Vector2 zero1 = Vector2.Zero; - Vector2 origin33 = Vector2.Zero; - int num198 = TextureAssets.Npc[type].Height() / Main.npcFrameCount[type]; - int num199 = rCurrentNPC.frame.Y / num198; - Microsoft.Xna.Framework.Rectangle rectangle12 = new Microsoft.Xna.Framework.Rectangle(0, 0, 32, 42); - switch (num199) - { - case 0: - zero1 += new Vector2(8f, 32f); - break; - case 1: - zero1 += new Vector2(6f, 72f); - break; - case 2: - zero1 += new Vector2(8f, 126f); - break; - case 3: - zero1 += new Vector2(6f, 174f); - break; - case 4: - zero1 += new Vector2(6f, 224f); - break; - case 5: - zero1 += new Vector2(8f, 272f); - break; - case 6: - zero1 += new Vector2(10f, 318f); - break; - case 7: - zero1 += new Vector2(14f, 366f); - break; - case 8: - zero1 += new Vector2(10f, 414f); - break; - } - zero1.Y -= (float) (num198 * num199); - Vector2 vector2_40 = zero1 - halfSize; - int num200 = 2; - if ((double) rCurrentNPC.ai[2] > 0.0) - num200 = (int) rCurrentNPC.ai[2] - 1; - if ((double) rCurrentNPC.velocity.Y != 0.0) - num200 = 3; - rectangle12.Y += 44 * num200; - switch (num200) - { - case 0: - origin33 = new Vector2(10f, 18f); - break; - case 1: - origin33 = new Vector2(8f, 20f); - break; - case 2: - origin33 = new Vector2(8f, 20f); - break; - case 3: - origin33 = new Vector2(8f, 20f); - break; - case 4: - origin33 = new Vector2(6f, 18f); - break; - } - if (spriteEffects.HasFlag((Enum) SpriteEffects.FlipHorizontally)) - { - vector2_40.X *= -1f; - origin33.X = (float) rectangle12.Width - origin33.X; - } - Vector2 position43 = vector2_40 + rCurrentNPC.Center - screenPos; - position43.Y += rCurrentNPC.gfxOffY; - mySpriteBatch.Draw(TextureAssets.Extra[0].Value, position43, new Microsoft.Xna.Framework.Rectangle?(rectangle12), npcColor2, rCurrentNPC.rotation, origin33, rCurrentNPC.scale, spriteEffects, 0.0f); - mySpriteBatch.Draw(TextureAssets.GlowMask[24].Value, position43, new Microsoft.Xna.Framework.Rectangle?(rectangle12), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), rCurrentNPC.rotation, origin33, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 382: - Vector2 zero2 = Vector2.Zero; - Vector2 origin34 = Vector2.Zero; - int num201 = TextureAssets.Npc[type].Height() / Main.npcFrameCount[type]; - int num202 = rCurrentNPC.frame.Y / num201; - Microsoft.Xna.Framework.Rectangle rectangle13 = new Microsoft.Xna.Framework.Rectangle(0, 0, 30, 42); - switch (num202) - { - case 0: - zero2 += new Vector2(8f, 30f); - break; - case 1: - zero2 += new Vector2(6f, 68f); - break; - case 2: - zero2 += new Vector2(8f, 120f); - break; - case 3: - zero2 += new Vector2(6f, 166f); - break; - case 4: - zero2 += new Vector2(6f, 214f); - break; - case 5: - zero2 += new Vector2(8f, 260f); - break; - case 6: - zero2 += new Vector2(14f, 304f); - break; - case 7: - zero2 += new Vector2(14f, 350f); - break; - case 8: - zero2 += new Vector2(10f, 396f); - break; - } - zero2.Y -= (float) (num201 * num202); - Vector2 vector2_41 = zero2 - halfSize; - int num203 = 2; - if ((double) rCurrentNPC.ai[2] > 0.0) - num203 = (int) rCurrentNPC.ai[2] - 1; - if ((double) rCurrentNPC.velocity.Y != 0.0) - num203 = 3; - rectangle13.Y += 44 * num203; - switch (num203) - { - case 0: - origin34 = new Vector2(10f, 18f); - break; - case 1: - origin34 = new Vector2(8f, 20f); - break; - case 2: - origin34 = new Vector2(8f, 20f); - break; - case 3: - origin34 = new Vector2(8f, 20f); - break; - case 4: - origin34 = new Vector2(6f, 18f); - break; - } - if (spriteEffects.HasFlag((Enum) SpriteEffects.FlipHorizontally)) - { - vector2_41.X *= -1f; - origin34.X = (float) rectangle13.Width - origin34.X; - } - Vector2 position44 = vector2_41 + rCurrentNPC.Center - screenPos; - position44.Y += rCurrentNPC.gfxOffY; - mySpriteBatch.Draw(TextureAssets.Extra[1].Value, position44, new Microsoft.Xna.Framework.Rectangle?(rectangle13), npcColor2, rCurrentNPC.rotation, origin34, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 383: - mySpriteBatch.Draw(TextureAssets.GlowMask[11].Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame7), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - if ((double) rCurrentNPC.ai[2] != 0.0 && Main.npc[(int) rCurrentNPC.ai[2] - 1].active && Main.npc[(int) rCurrentNPC.ai[2] - 1].type == 384) - { - double num204 = (double) rCurrentNPC.ai[2]; - mySpriteBatch.Draw(TextureAssets.Npc[384].Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(), new Microsoft.Xna.Framework.Color(100, 100, 100, 0), rCurrentNPC.rotation, new Vector2((float) TextureAssets.Npc[384].Width(), (float) TextureAssets.Npc[384].Height()) / 2f, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - } - break; - case 386: - mySpriteBatch.Draw(TextureAssets.GlowMask[31].Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame7), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 387: - Microsoft.Xna.Framework.Color color52 = new Microsoft.Xna.Framework.Color(1f, 1f, 1f, 1f) * 0.75f; - if ((double) rCurrentNPC.ai[0] > 0.0) - { - float amount16 = (float) (((double) rCurrentNPC.ai[0] + 1.0) / 60.0); - color52 = Microsoft.Xna.Framework.Color.Lerp(color52, Microsoft.Xna.Framework.Color.White, amount16); - color52.A = (byte) MathHelper.Lerp((float) color52.A, 0.0f, amount16); - } - Microsoft.Xna.Framework.Color color53 = color52 * (float) (((double) byte.MaxValue - (double) rCurrentNPC.alpha) / (double) byte.MaxValue); - mySpriteBatch.Draw(TextureAssets.GlowMask[32].Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame7), color53, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 388: - mySpriteBatch.Draw(TextureAssets.GlowMask[33].Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame7), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 389: - mySpriteBatch.Draw(TextureAssets.GlowMask[34].Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame7), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 520: - mySpriteBatch.Draw(TextureAssets.GlowMask[164].Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame7), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - Vector2 zero3 = Vector2.Zero; - Vector2 origin35 = new Vector2(4f, 4f); - int num205 = TextureAssets.Npc[type].Height() / Main.npcFrameCount[type]; - int num206 = rCurrentNPC.frame.Y / num205; - if (spriteEffects.HasFlag((Enum) SpriteEffects.FlipHorizontally)) - { - zero3.X *= -1f; - origin35.X = (float) TextureAssets.Extra[56].Width() - origin35.X; - } - Vector2 position45 = zero3 + (rCurrentNPC.Top + new Vector2(0.0f, 20f)) - screenPos; - position45.Y += rCurrentNPC.gfxOffY; - float rotation3 = rCurrentNPC.localAI[3]; - if (spriteEffects.HasFlag((Enum) SpriteEffects.FlipHorizontally)) - rotation3 += 3.141593f; - mySpriteBatch.Draw(TextureAssets.Extra[56].Value, position45, new Microsoft.Xna.Framework.Rectangle?(), npcColor2, rotation3, origin35, rCurrentNPC.scale, spriteEffects, 0.0f); - mySpriteBatch.Draw(TextureAssets.GlowMask[165].Value, position45, new Microsoft.Xna.Framework.Rectangle?(), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), rotation3, origin35, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - default: - if (type == 4 && (double) rCurrentNPC.ai[1] >= 4.0 && (double) rCurrentNPC.ai[0] == 3.0) - { - for (int index31 = 1; index31 < rCurrentNPC.oldPos.Length; ++index31) - { - ref Vector2 local = ref rCurrentNPC.oldPos[index31]; - Microsoft.Xna.Framework.Color color54 = npcColor2; - color54.R = (byte) (0.5 * (double) color54.R * (double) (10 - index31) / 20.0); - color54.G = (byte) (0.5 * (double) color54.G * (double) (10 - index31) / 20.0); - color54.B = (byte) (0.5 * (double) color54.B * (double) (10 - index31) / 20.0); - color54.A = (byte) (0.5 * (double) color54.A * (double) (10 - index31) / 20.0); - mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2((float) ((double) rCurrentNPC.oldPos[index31].X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.oldPos[index31].Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), color54, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - } - break; - } - if (type == 437) - { - Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; - white.A = (byte) 200; - mySpriteBatch.Draw(TextureAssets.GlowMask[109].Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame7), white, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - mySpriteBatch.Draw(TextureAssets.GlowMask[108].Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + addY + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(), white, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - } - if (type == 471 && (double) rCurrentNPC.ai[3] < 0.0) - { - for (int index32 = 1; index32 < rCurrentNPC.oldPos.Length; ++index32) - { - ref Vector2 local = ref rCurrentNPC.oldPos[index32]; - Microsoft.Xna.Framework.Color color55 = npcColor2; - color55.R = (byte) (0.5 * (double) color55.R * (double) (10 - index32) / 20.0); - color55.G = (byte) (0.5 * (double) color55.G * (double) (10 - index32) / 20.0); - color55.B = (byte) (0.5 * (double) color55.B * (double) (10 - index32) / 20.0); - color55.A = (byte) (0.5 * (double) color55.A * (double) (10 - index32) / 20.0); - mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2((float) ((double) rCurrentNPC.oldPos[index32].X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.oldPos[index32].Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), color55, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - } - break; - } - if (type == 477 && (double) rCurrentNPC.velocity.Length() > 9.0) - { - for (int index33 = 1; index33 < rCurrentNPC.oldPos.Length; ++index33) - { - ref Vector2 local = ref rCurrentNPC.oldPos[index33]; - Microsoft.Xna.Framework.Color color56 = npcColor2; - color56.R = (byte) (0.5 * (double) color56.R * (double) (10 - index33) / 20.0); - color56.G = (byte) (0.5 * (double) color56.G * (double) (10 - index33) / 20.0); - color56.B = (byte) (0.5 * (double) color56.B * (double) (10 - index33) / 20.0); - color56.A = (byte) (0.5 * (double) color56.A * (double) (10 - index33) / 20.0); - Microsoft.Xna.Framework.Rectangle frame8 = rCurrentNPC.frame; - int num207 = TextureAssets.Npc[type].Height() / Main.npcFrameCount[type]; - frame8.Y -= num207 * index33; - while (frame8.Y < 0) - frame8.Y += num207 * Main.npcFrameCount[type]; - mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2((float) ((double) rCurrentNPC.oldPos[index33].X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.oldPos[index33].Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(frame8), color56, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - } - break; - } - break; - } - break; - } - break; - } - } - if (type == 479 && (double) rCurrentNPC.velocity.Length() > 6.5) - { - for (int index34 = 1; index34 < rCurrentNPC.oldPos.Length; ++index34) - { - ref Vector2 local = ref rCurrentNPC.oldPos[index34]; - Microsoft.Xna.Framework.Color color57 = npcColor2; - color57.R = (byte) (0.5 * (double) color57.R * (double) (10 - index34) / 20.0); - color57.G = (byte) (0.5 * (double) color57.G * (double) (10 - index34) / 20.0); - color57.B = (byte) (0.5 * (double) color57.B * (double) (10 - index34) / 20.0); - color57.A = (byte) (0.5 * (double) color57.A * (double) (10 - index34) / 20.0); - Microsoft.Xna.Framework.Rectangle frame9 = rCurrentNPC.frame; - int num208 = TextureAssets.Npc[type].Height() / Main.npcFrameCount[type]; - frame9.Y -= num208 * index34; - while (frame9.Y < 0) - frame9.Y += num208 * Main.npcFrameCount[type]; - mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2((float) ((double) rCurrentNPC.oldPos[index34].X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.oldPos[index34].Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(frame9), color57, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - } - } - else if (type == 472) - mySpriteBatch.Draw(TextureAssets.GlowMask[110].Value, new Vector2((float) ((double) rCurrentNPC.position.X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.position.Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - else if (rCurrentNPC.aiStyle == 87) - { - if ((int) rCurrentNPC.ai[0] == 4 || (double) rCurrentNPC.ai[0] == 5.0 || (double) rCurrentNPC.ai[0] == 6.0) - { - for (int index35 = 1; index35 < rCurrentNPC.oldPos.Length; ++index35) - { - ref Vector2 local = ref rCurrentNPC.oldPos[index35]; - Microsoft.Xna.Framework.Color color58 = npcColor2; - color58.R = (byte) (0.5 * (double) color58.R * (double) (10 - index35) / 20.0); - color58.G = (byte) (0.5 * (double) color58.G * (double) (10 - index35) / 20.0); - color58.B = (byte) (0.5 * (double) color58.B * (double) (10 - index35) / 20.0); - color58.A = (byte) (0.5 * (double) color58.A * (double) (10 - index35) / 20.0); - mySpriteBatch.Draw(TextureAssets.Npc[type].Value, new Vector2((float) ((double) rCurrentNPC.oldPos[index35].X - (double) screenPos.X + (double) (rCurrentNPC.width / 2) - (double) TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) rCurrentNPC.oldPos[index35].Y - (double) screenPos.Y + (double) rCurrentNPC.height - (double) TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), color58, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - } - } - } - else - { - switch (type) - { - case 50: - Texture2D texture2D32 = TextureAssets.Extra[39].Value; - Vector2 center5 = rCurrentNPC.Center; - float num209 = 0.0f; - switch (rCurrentNPC.frame.Y / (TextureAssets.Npc[type].Height() / Main.npcFrameCount[type])) + case 381: + Vector2 zero1 = Vector2.Zero; + Vector2 origin22 = Vector2.Zero; + int num188 = Main.npcTexture[type].Height / Main.npcFrameCount[type]; + int num189 = n.frame.Y / num188; + Microsoft.Xna.Framework.Rectangle rectangle7 = new Microsoft.Xna.Framework.Rectangle(0, 0, 32, 42); + switch (num189) { case 0: - num209 = 2f; + zero1 += new Vector2(8f, 32f); break; case 1: - num209 = -6f; + zero1 += new Vector2(6f, 72f); break; case 2: - num209 = 2f; + zero1 += new Vector2(8f, 126f); break; case 3: - num209 = 10f; + zero1 += new Vector2(6f, 174f); break; case 4: - num209 = 2f; + zero1 += new Vector2(6f, 224f); break; case 5: - num209 = 0.0f; + zero1 += new Vector2(8f, 272f); + break; + case 6: + zero1 += new Vector2(10f, 318f); + break; + case 7: + zero1 += new Vector2(14f, 366f); + break; + case 8: + zero1 += new Vector2(10f, 414f); break; } - center5.Y += rCurrentNPC.gfxOffY - (70f - num209) * rCurrentNPC.scale; - mySpriteBatch.Draw(texture2D32, center5 - screenPos, new Microsoft.Xna.Framework.Rectangle?(), npcColor2, 0.0f, texture2D32.Size() / 2f, 1f, spriteEffects, 0.0f); - break; - case 405: - mySpriteBatch.Draw(TextureAssets.GlowMask[141].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 406: - mySpriteBatch.Draw(TextureAssets.GlowMask[142].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 407: - mySpriteBatch.Draw(TextureAssets.GlowMask[139].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 409: - mySpriteBatch.Draw(TextureAssets.GlowMask[138].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 410: - mySpriteBatch.Draw(TextureAssets.GlowMask[137].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 411: - mySpriteBatch.Draw(TextureAssets.GlowMask[136].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 418: - mySpriteBatch.Draw(TextureAssets.GlowMask[161].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - vector3 = rCurrentNPC.GetAlpha(npcColor2).ToVector3() - new Vector3(0.5f); - float num210 = (float) (0.25 + (double) vector3.Length() * 0.25); - for (int index36 = 0; index36 < 4; ++index36) - mySpriteBatch.Draw(TextureAssets.GlowMask[161].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY) + rCurrentNPC.velocity.RotatedBy((double) index36 * 1.57079637050629) * num210, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(64, 64, 64, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 420: - mySpriteBatch.Draw(TextureAssets.GlowMask[147].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 421: - mySpriteBatch.Draw(TextureAssets.GlowMask[146].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 423: - mySpriteBatch.Draw(TextureAssets.GlowMask[145].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 424: - mySpriteBatch.Draw(TextureAssets.GlowMask[144].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 425: - mySpriteBatch.Draw(TextureAssets.GlowMask[150].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 429: - mySpriteBatch.Draw(TextureAssets.GlowMask[151].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - default: - if (type >= 412 && type <= 414) + zero1.Y -= (float) (num188 * num189); + Vector2 vector2_38 = zero1 - vector2_3; + int num190 = 2; + if ((double) n.ai[2] > 0.0) + num190 = (int) n.ai[2] - 1; + if ((double) n.velocity.Y != 0.0) + num190 = 3; + rectangle7.Y += 44 * num190; + switch (num190) { - Microsoft.Xna.Framework.Color color59 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha, 0); - int index37 = 157 + type - 412; - if (type == 414 && (double) rCurrentNPC.localAI[2] != 0.0) - { - int num211 = (int) rCurrentNPC.localAI[2]; - if ((double) rCurrentNPC.localAI[2] < 0.0) - num211 = 128 + (int) rCurrentNPC.localAI[2]; - int num212 = (int) byte.MaxValue - num211; - color59 = new Microsoft.Xna.Framework.Color(num212, num211, num211, num212); - } - mySpriteBatch.Draw(TextureAssets.GlowMask[index37].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), color59, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); + case 0: + origin22 = new Vector2(10f, 18f); + break; + case 1: + origin22 = new Vector2(8f, 20f); + break; + case 2: + origin22 = new Vector2(8f, 20f); + break; + case 3: + origin22 = new Vector2(8f, 20f); + break; + case 4: + origin22 = new Vector2(6f, 18f); + break; + } + if (spriteEffects.HasFlag((Enum) SpriteEffects.FlipHorizontally)) + { + vector2_38.X *= -1f; + origin22.X = (float) rectangle7.Width - origin22.X; + } + Vector2 position35 = vector2_38 + n.Center - Main.screenPosition; + position35.Y += n.gfxOffY; + Main.spriteBatch.Draw(Main.extraTexture[0], position35, new Microsoft.Xna.Framework.Rectangle?(rectangle7), color1, n.rotation, origin22, n.scale, spriteEffects, 0.0f); + Main.spriteBatch.Draw(Main.glowMaskTexture[24], position35, new Microsoft.Xna.Framework.Rectangle?(rectangle7), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), n.rotation, origin22, n.scale, spriteEffects, 0.0f); + break; + case 382: + Vector2 zero2 = Vector2.Zero; + Vector2 origin23 = Vector2.Zero; + int num191 = Main.npcTexture[type].Height / Main.npcFrameCount[type]; + int num192 = n.frame.Y / num191; + Microsoft.Xna.Framework.Rectangle rectangle8 = new Microsoft.Xna.Framework.Rectangle(0, 0, 30, 42); + switch (num192) + { + case 0: + zero2 += new Vector2(8f, 30f); + break; + case 1: + zero2 += new Vector2(6f, 68f); + break; + case 2: + zero2 += new Vector2(8f, 120f); + break; + case 3: + zero2 += new Vector2(6f, 166f); + break; + case 4: + zero2 += new Vector2(6f, 214f); + break; + case 5: + zero2 += new Vector2(8f, 260f); + break; + case 6: + zero2 += new Vector2(14f, 304f); + break; + case 7: + zero2 += new Vector2(14f, 350f); + break; + case 8: + zero2 += new Vector2(10f, 396f); + break; + } + zero2.Y -= (float) (num191 * num192); + Vector2 vector2_39 = zero2 - vector2_3; + int num193 = 2; + if ((double) n.ai[2] > 0.0) + num193 = (int) n.ai[2] - 1; + if ((double) n.velocity.Y != 0.0) + num193 = 3; + rectangle8.Y += 44 * num193; + switch (num193) + { + case 0: + origin23 = new Vector2(10f, 18f); + break; + case 1: + origin23 = new Vector2(8f, 20f); + break; + case 2: + origin23 = new Vector2(8f, 20f); + break; + case 3: + origin23 = new Vector2(8f, 20f); + break; + case 4: + origin23 = new Vector2(6f, 18f); + break; + } + if (spriteEffects.HasFlag((Enum) SpriteEffects.FlipHorizontally)) + { + vector2_39.X *= -1f; + origin23.X = (float) rectangle8.Width - origin23.X; + } + Vector2 position36 = vector2_39 + n.Center - Main.screenPosition; + position36.Y += n.gfxOffY; + Main.spriteBatch.Draw(Main.extraTexture[1], position36, new Microsoft.Xna.Framework.Rectangle?(rectangle8), color1, n.rotation, origin23, n.scale, spriteEffects, 0.0f); + break; + case 383: + Main.spriteBatch.Draw(Main.glowMaskTexture[11], new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame5), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + if ((double) n.ai[2] != 0.0 && Main.npc[(int) n.ai[2] - 1].active && Main.npc[(int) n.ai[2] - 1].type == 384) + { + double num194 = (double) n.ai[2]; + Main.spriteBatch.Draw(Main.npcTexture[384], new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(), new Microsoft.Xna.Framework.Color(100, 100, 100, 0), n.rotation, new Vector2((float) Main.npcTexture[384].Width, (float) Main.npcTexture[384].Height) / 2f, n.scale, spriteEffects, 0.0f); break; } - switch (type) + break; + case 386: + Main.spriteBatch.Draw(Main.glowMaskTexture[31], new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame5), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 387: + Microsoft.Xna.Framework.Color color50 = new Microsoft.Xna.Framework.Color(1f, 1f, 1f, 1f) * 0.75f; + if ((double) n.ai[0] > 0.0) { - case 160: - mySpriteBatch.Draw(TextureAssets.GlowMask[166].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 209: - mySpriteBatch.Draw(TextureAssets.GlowMask[167].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 128 - rCurrentNPC.alpha / 2, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 315: - float num213 = 2f; - for (int index38 = 0; index38 < 4; ++index38) - mySpriteBatch.Draw(TextureAssets.GlowMask[(int) byte.MaxValue].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY) + Vector2.UnitX.RotatedBy((double) index38 * 1.57079637050629) * num213, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(64, 64, 64, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - mySpriteBatch.Draw(TextureAssets.GlowMask[(int) byte.MaxValue].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(200, 200, 200, 200), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 344: - mySpriteBatch.Draw(TextureAssets.GlowMask[253].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(200, 200, 200, 100) * 0.5f, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 346: - float num214 = 4f; - for (int index39 = 0; index39 < 4; ++index39) - mySpriteBatch.Draw(TextureAssets.GlowMask[254].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY) + Vector2.UnitX.RotatedBy((double) index39 * 1.57079637050629) * num214, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(64, 64, 64, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - mySpriteBatch.Draw(TextureAssets.GlowMask[254].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(200, 200, 200, 100), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 415: - mySpriteBatch.Draw(TextureAssets.GlowMask[155].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - vector3 = rCurrentNPC.GetAlpha(npcColor2).ToVector3() - new Vector3(0.5f); - float num215 = (float) (0.5 + (double) vector3.Length() * 0.5); - for (int index40 = 0; index40 < 4; ++index40) - mySpriteBatch.Draw(TextureAssets.GlowMask[155].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY) + rCurrentNPC.velocity.RotatedBy((double) index40 * 1.57079637050629) * num215, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(64, 64, 64, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 417: - mySpriteBatch.Draw(TextureAssets.GlowMask[160].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - vector3 = rCurrentNPC.GetAlpha(npcColor2).ToVector3() - new Vector3(0.5f); - float num216 = (float) (0.25 + (double) vector3.Length() * 0.25); - for (int index41 = 0; index41 < 4; ++index41) - mySpriteBatch.Draw(TextureAssets.GlowMask[160].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY) + rCurrentNPC.velocity.RotatedBy((double) index41 * 1.57079637050629) * num216, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(64, 64, 64, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 419: - mySpriteBatch.Draw(TextureAssets.GlowMask[154].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - if ((double) rCurrentNPC.ai[2] >= -6.0) - { - vector3 = rCurrentNPC.GetAlpha(npcColor2).ToVector3() - new Vector3(0.5f); - float num217 = (float) (0.5 + (double) vector3.Length() * 0.5); - for (int index42 = 0; index42 < 4; ++index42) - mySpriteBatch.Draw(TextureAssets.GlowMask[154].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY) + rCurrentNPC.velocity.RotatedBy((double) index42 * 1.57079637050629) * num217, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(64, 64, 64, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - } - float num218 = 4f; - for (int index43 = 0; index43 < 4; ++index43) - mySpriteBatch.Draw(TextureAssets.GlowMask[154].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY) + Vector2.UnitX.RotatedBy((double) index43 * 1.57079637050629) * num218, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(64, 64, 64, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 516: - mySpriteBatch.Draw(TextureAssets.Npc[type].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - vector3 = rCurrentNPC.GetAlpha(npcColor2).ToVector3() - new Vector3(0.5f); - float num219 = (float) (0.5 + (double) vector3.Length() * 0.5); - for (int index44 = 0; index44 < 4; ++index44) - mySpriteBatch.Draw(TextureAssets.Npc[type].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY) + rCurrentNPC.velocity.RotatedBy((double) index44 * 1.57079637050629) * num219, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(64, 64, 64, 0), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 518: - Vector2 vector2_42 = new Vector2(-10f, 0.0f); - mySpriteBatch.Draw(TextureAssets.GlowMask[163].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha, (int) byte.MaxValue - rCurrentNPC.alpha), rCurrentNPC.rotation, halfSize + vector2_42, rCurrentNPC.scale, spriteEffects, 0.0f); - vector3 = rCurrentNPC.GetAlpha(npcColor2).ToVector3() - new Vector3(0.5f); - float num220 = (float) (0.5 + (double) vector3.Length() * 0.5); - for (int index45 = 0; index45 < 4; ++index45) - mySpriteBatch.Draw(TextureAssets.GlowMask[163].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY) + rCurrentNPC.velocity.RotatedBy((double) index45 * 1.57079637050629) * num220, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(64, 64, 64, 0), rCurrentNPC.rotation, halfSize + vector2_42, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 525: - mySpriteBatch.Draw(TextureAssets.GlowMask[169].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(200, 200, 200, 100), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 526: - mySpriteBatch.Draw(TextureAssets.GlowMask[170].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(200, 200, 200, 100), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 527: - mySpriteBatch.Draw(TextureAssets.GlowMask[171].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color(200, 200, 200, 100), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; - case 533: - mySpriteBatch.Draw(TextureAssets.GlowMask[172].Value, rCurrentNPC.Bottom - screenPos + new Vector2((float) ((double) -TextureAssets.Npc[type].Width() * (double) rCurrentNPC.scale / 2.0 + (double) halfSize.X * (double) rCurrentNPC.scale), (float) ((double) -TextureAssets.Npc[type].Height() * (double) rCurrentNPC.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) halfSize.Y * (double) rCurrentNPC.scale) + addHeight + rCurrentNPC.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 100), rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, spriteEffects, 0.0f); - break; + float amount = (float) (((double) n.ai[0] + 1.0) / 60.0); + color50 = Microsoft.Xna.Framework.Color.Lerp(color50, Microsoft.Xna.Framework.Color.White, amount); + color50.A = (byte) MathHelper.Lerp((float) color50.A, 0.0f, amount); + } + Microsoft.Xna.Framework.Color color51 = color50 * (float) (((double) byte.MaxValue - (double) n.alpha) / (double) byte.MaxValue); + Main.spriteBatch.Draw(Main.glowMaskTexture[32], new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame5), color51, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 388: + Main.spriteBatch.Draw(Main.glowMaskTexture[33], new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame5), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 389: + Main.spriteBatch.Draw(Main.glowMaskTexture[34], new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame5), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 520: + Main.spriteBatch.Draw(Main.glowMaskTexture[164], new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame5), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + Vector2 zero3 = Vector2.Zero; + Vector2 origin24 = new Vector2(4f, 4f); + int num195 = Main.npcTexture[type].Height / Main.npcFrameCount[type]; + int num196 = n.frame.Y / num195; + if (spriteEffects.HasFlag((Enum) SpriteEffects.FlipHorizontally)) + { + zero3.X *= -1f; + origin24.X = (float) Main.extraTexture[56].Width - origin24.X; + } + Vector2 position37 = zero3 + (n.Top + new Vector2(0.0f, 20f)) - Main.screenPosition; + position37.Y += n.gfxOffY; + float rotation3 = n.localAI[3]; + if (spriteEffects.HasFlag((Enum) SpriteEffects.FlipHorizontally)) + rotation3 += 3.141593f; + Main.spriteBatch.Draw(Main.extraTexture[56], position37, new Microsoft.Xna.Framework.Rectangle?(), color1, rotation3, origin24, n.scale, spriteEffects, 0.0f); + Main.spriteBatch.Draw(Main.glowMaskTexture[165], position37, new Microsoft.Xna.Framework.Rectangle?(), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), rotation3, origin24, n.scale, spriteEffects, 0.0f); + break; + default: + if (type == 4 && (double) n.ai[1] >= 4.0 && (double) n.ai[0] == 3.0) + { + for (int index31 = 1; index31 < n.oldPos.Length; ++index31) + { + ref Vector2 local = ref n.oldPos[index31]; + Microsoft.Xna.Framework.Color color52 = color1; + color52.R = (byte) (0.5 * (double) color52.R * (double) (10 - index31) / 20.0); + color52.G = (byte) (0.5 * (double) color52.G * (double) (10 - index31) / 20.0); + color52.B = (byte) (0.5 * (double) color52.B * (double) (10 - index31) / 20.0); + color52.A = (byte) (0.5 * (double) color52.A * (double) (10 - index31) / 20.0); + Main.spriteBatch.Draw(Main.npcTexture[type], new Vector2((float) ((double) n.oldPos[index31].X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.oldPos[index31].Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(n.frame), color52, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + } + break; + } + if (type == 437) + { + Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; + white.A = (byte) 200; + Main.spriteBatch.Draw(Main.glowMaskTexture[109], new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(frame5), white, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + Main.spriteBatch.Draw(Main.glowMaskTexture[108], new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + addY + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(), white, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + } + if (type == 471 && (double) n.ai[3] < 0.0) + { + for (int index32 = 1; index32 < n.oldPos.Length; ++index32) + { + ref Vector2 local = ref n.oldPos[index32]; + Microsoft.Xna.Framework.Color color53 = color1; + color53.R = (byte) (0.5 * (double) color53.R * (double) (10 - index32) / 20.0); + color53.G = (byte) (0.5 * (double) color53.G * (double) (10 - index32) / 20.0); + color53.B = (byte) (0.5 * (double) color53.B * (double) (10 - index32) / 20.0); + color53.A = (byte) (0.5 * (double) color53.A * (double) (10 - index32) / 20.0); + Main.spriteBatch.Draw(Main.npcTexture[type], new Vector2((float) ((double) n.oldPos[index32].X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.oldPos[index32].Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(n.frame), color53, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + } + break; + } + if (type == 477 && (double) n.velocity.Length() > 9.0) + { + for (int index33 = 1; index33 < n.oldPos.Length; ++index33) + { + ref Vector2 local = ref n.oldPos[index33]; + Microsoft.Xna.Framework.Color color54 = color1; + color54.R = (byte) (0.5 * (double) color54.R * (double) (10 - index33) / 20.0); + color54.G = (byte) (0.5 * (double) color54.G * (double) (10 - index33) / 20.0); + color54.B = (byte) (0.5 * (double) color54.B * (double) (10 - index33) / 20.0); + color54.A = (byte) (0.5 * (double) color54.A * (double) (10 - index33) / 20.0); + Microsoft.Xna.Framework.Rectangle frame6 = n.frame; + int num197 = Main.npcTexture[type].Height / Main.npcFrameCount[type]; + frame6.Y -= num197 * index33; + while (frame6.Y < 0) + frame6.Y += num197 * Main.npcFrameCount[type]; + Main.spriteBatch.Draw(Main.npcTexture[type], new Vector2((float) ((double) n.oldPos[index33].X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.oldPos[index33].Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(frame6), color54, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + } + break; } break; } - } - if (rCurrentNPC.aiStyle != 7) - return; - this.DrawNPCExtras(rCurrentNPC, false, addHeight, addY, npcColor2, halfSize, spriteEffects, screenPos); - return; + break; + } + break; + } + } + if (type == 479 && (double) n.velocity.Length() > 6.5) + { + for (int index34 = 1; index34 < n.oldPos.Length; ++index34) + { + ref Vector2 local = ref n.oldPos[index34]; + Microsoft.Xna.Framework.Color color55 = color1; + color55.R = (byte) (0.5 * (double) color55.R * (double) (10 - index34) / 20.0); + color55.G = (byte) (0.5 * (double) color55.G * (double) (10 - index34) / 20.0); + color55.B = (byte) (0.5 * (double) color55.B * (double) (10 - index34) / 20.0); + color55.A = (byte) (0.5 * (double) color55.A * (double) (10 - index34) / 20.0); + Microsoft.Xna.Framework.Rectangle frame7 = n.frame; + int num198 = Main.npcTexture[type].Height / Main.npcFrameCount[type]; + frame7.Y -= num198 * index34; + while (frame7.Y < 0) + frame7.Y += num198 * Main.npcFrameCount[type]; + Main.spriteBatch.Draw(Main.npcTexture[type], new Vector2((float) ((double) n.oldPos[index34].X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.oldPos[index34].Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(frame7), color55, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + } + } + else if (type == 472) + Main.spriteBatch.Draw(Main.glowMaskTexture[110], new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + else if (n.aiStyle == 87) + { + if ((int) n.ai[0] == 4 || (double) n.ai[0] == 5.0 || (double) n.ai[0] == 6.0) + { + for (int index35 = 1; index35 < n.oldPos.Length; ++index35) + { + ref Vector2 local = ref n.oldPos[index35]; + Microsoft.Xna.Framework.Color color56 = color1; + color56.R = (byte) (0.5 * (double) color56.R * (double) (10 - index35) / 20.0); + color56.G = (byte) (0.5 * (double) color56.G * (double) (10 - index35) / 20.0); + color56.B = (byte) (0.5 * (double) color56.B * (double) (10 - index35) / 20.0); + color56.A = (byte) (0.5 * (double) color56.A * (double) (10 - index35) / 20.0); + Main.spriteBatch.Draw(Main.npcTexture[type], new Vector2((float) ((double) n.oldPos[index35].X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) n.oldPos[index35].Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight), new Microsoft.Xna.Framework.Rectangle?(n.frame), color56, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); } - } - } - } - } - - private static void DrawNPCDirect_HallowBoss( - SpriteBatch mySpriteBatch, - NPC rCurrentNPC, - ref Vector2 screenPos, - int typeCache, - ref Microsoft.Xna.Framework.Color npcColor, - ref Vector2 halfSize, - SpriteEffects npcSpriteEffect) - { - Texture2D texture1 = TextureAssets.Npc[typeCache].Value; - Vector2 position1 = rCurrentNPC.Center - screenPos; - bool flag = rCurrentNPC.AI_120_HallowBoss_IsInPhase2(); - int num1 = (int) rCurrentNPC.ai[0]; - Texture2D texture2D1 = TextureAssets.Extra[159].Value; - Microsoft.Xna.Framework.Rectangle r1 = texture2D1.Frame(verticalFrames: 11, frameY: ((int) ((double) rCurrentNPC.localAI[0] / 4.0) % 11)); - Microsoft.Xna.Framework.Color color1 = rCurrentNPC.GetAlpha(npcColor); - Texture2D texture2D2 = TextureAssets.Extra[158].Value; - Texture2D texture2D3 = TextureAssets.Extra[160].Value; - Texture2D texture2 = TextureAssets.Extra[157].Value; - int armFrame_Count; - int armFrameToUseLeft; - int armFrameToUseRight; - Main.DrawNPCDirect_GetHallowBossArmFrame(rCurrentNPC, out armFrame_Count, out armFrameToUseLeft, out armFrameToUseRight); - Microsoft.Xna.Framework.Rectangle r2 = texture2D2.Frame(verticalFrames: armFrame_Count, frameY: armFrameToUseLeft); - Microsoft.Xna.Framework.Rectangle r3 = texture2D3.Frame(verticalFrames: armFrame_Count, frameY: armFrameToUseRight); - Vector2 origin1 = r2.Size() / 2f; - Vector2 origin2 = r3.Size() / 2f; - int num2 = 0; - int num3 = 0; - if (armFrameToUseLeft == 5) - num2 = 1; - if (armFrameToUseRight == 5) - num3 = 1; - float num4 = 1f; - int num5 = 0; - int num6 = 0; - float amount1 = 0.0f; - float num7 = 0.0f; - float num8 = 0.0f; - if (num1 == 8 || num1 == 9) - { - amount1 = Utils.GetLerpValue(0.0f, 30f, rCurrentNPC.ai[1], true) * Utils.GetLerpValue(90f, 30f, rCurrentNPC.ai[1], true); - num7 = Utils.GetLerpValue(0.0f, 30f, rCurrentNPC.ai[1], true) * Utils.GetLerpValue(90f, 70f, rCurrentNPC.ai[1], true); - num8 = Utils.GetLerpValue(0.0f, 15f, rCurrentNPC.ai[1], true) * Utils.GetLerpValue(45f, 30f, rCurrentNPC.ai[1], true); - color1 = Microsoft.Xna.Framework.Color.Lerp(color1, Microsoft.Xna.Framework.Color.White, amount1); - num4 *= 1f - num8; - num5 = 4; - num6 = 3; - } - if (num1 == 10) - { - amount1 = Utils.GetLerpValue(30f, 90f, rCurrentNPC.ai[1], true) * Utils.GetLerpValue(165f, 90f, rCurrentNPC.ai[1], true); - num7 = Utils.GetLerpValue(0.0f, 60f, rCurrentNPC.ai[1], true) * Utils.GetLerpValue(180f, 120f, rCurrentNPC.ai[1], true); - num8 = Utils.GetLerpValue(0.0f, 60f, rCurrentNPC.ai[1], true) * Utils.GetLerpValue(180f, 120f, rCurrentNPC.ai[1], true); - color1 = Microsoft.Xna.Framework.Color.Lerp(color1, Microsoft.Xna.Framework.Color.White, amount1); - num4 *= 1f - num8; - num6 = 4; - } - if (num6 + num5 > 0) - { - for (int index1 = -num6; index1 <= num6 + num5; ++index1) - { - if (index1 != 0) - { - Microsoft.Xna.Framework.Color color2 = Microsoft.Xna.Framework.Color.White; - Vector2 position2 = position1; - if (num1 == 8 || num1 == 9) - { - double num9 = (double) ((float) index1 + 5f) / 10.0; - float num10 = 200f; - float num11 = (float) Main.timeForVisualEffects / 60f; - Vector3 vector3 = Vector3.Transform(Vector3.Forward, Matrix.CreateRotationX((float) (((double) num11 - 0.300000011920929 + (double) index1 * 0.100000001490116) * 0.699999988079071 * 6.28318548202515)) * Matrix.CreateRotationY((float) (((double) num11 - 0.800000011920929 + (double) index1 * 0.300000011920929) * 0.699999988079071 * 6.28318548202515)) * Matrix.CreateRotationZ((float) (((double) num11 + (double) index1 * 0.5) * 0.100000001490116 * 6.28318548202515))); - float num12 = num10 + Utils.GetLerpValue(-1f, 1f, vector3.Z, true) * 150f; - Vector2 spinningpoint = new Vector2(vector3.X, vector3.Y) * num12 * amount1; - double num13 = (double) MathHelper.Lerp(0.5f, 1f, Utils.GetLerpValue(90f, 0.0f, rCurrentNPC.ai[1], true)); - color2 = Main.hslToRgb((float) num9, 1f, (float) num13) * 0.8f * num7; - color2.A /= (byte) 3; - position2 += spinningpoint.RotatedBy((double) rCurrentNPC.ai[1] / 180.0 * 6.28318548202515); - } - if (num1 == 10) - { - if ((double) rCurrentNPC.ai[1] >= 90.0) - { - float num14 = (float) Main.timeForVisualEffects / 90f; - int num15 = index1; - if (num15 < 0) - ++num15; - Vector2 rotationVector2 = ((float) (((double) num15 + 0.5) * 0.785398185253143 + 6.28318548202515 * (double) num14)).ToRotationVector2(); - position2 += rotationVector2 * new Vector2(600f * amount1, 150f * amount1); } - else - position2 += 200f * new Vector2((float) index1, 0.0f) * amount1; - color2 = Microsoft.Xna.Framework.Color.White * 0.8f * num7 * num4; - color2.A /= (byte) 3; } - if (index1 > num6) + else { - float lerpValue = Utils.GetLerpValue(30f, 70f, rCurrentNPC.ai[1], true); - if ((double) lerpValue != 0.0) + switch (type) { - position2 = position1 + rCurrentNPC.velocity * -3f * ((float) index1 - 4f) * lerpValue; - color2 *= 1f - num8; + case 50: + Texture2D texture2D25 = Main.extraTexture[39]; + Vector2 center5 = n.Center; + float num199 = 0.0f; + switch (n.frame.Y / (Main.npcTexture[type].Height / Main.npcFrameCount[type])) + { + case 0: + num199 = 2f; + break; + case 1: + num199 = -6f; + break; + case 2: + num199 = 2f; + break; + case 3: + num199 = 10f; + break; + case 4: + num199 = 2f; + break; + case 5: + num199 = 0.0f; + break; + } + center5.Y += n.gfxOffY - (70f - num199) * n.scale; + Main.spriteBatch.Draw(texture2D25, center5 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(), color1, 0.0f, texture2D25.Size() / 2f, 1f, spriteEffects, 0.0f); + break; + case 405: + Main.spriteBatch.Draw(Main.glowMaskTexture[141], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(128 - n.alpha / 2, 128 - n.alpha / 2, 128 - n.alpha / 2, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 406: + Main.spriteBatch.Draw(Main.glowMaskTexture[142], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(128 - n.alpha / 2, 128 - n.alpha / 2, 128 - n.alpha / 2, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 407: + Main.spriteBatch.Draw(Main.glowMaskTexture[139], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 409: + Main.spriteBatch.Draw(Main.glowMaskTexture[138], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 410: + Main.spriteBatch.Draw(Main.glowMaskTexture[137], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 411: + Main.spriteBatch.Draw(Main.glowMaskTexture[136], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(128 - n.alpha / 2, 128 - n.alpha / 2, 128 - n.alpha / 2, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 418: + Main.spriteBatch.Draw(Main.glowMaskTexture[161], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + float num200 = (float) (0.25 + (double) (n.GetAlpha(color1).ToVector3() - new Vector3(0.5f)).Length() * 0.25); + for (int index36 = 0; index36 < 4; ++index36) + Main.spriteBatch.Draw(Main.glowMaskTexture[161], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY) + n.velocity.RotatedBy((double) index36 * 1.57079637050629) * num200, new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(64, 64, 64, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 420: + Main.spriteBatch.Draw(Main.glowMaskTexture[147], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(128 - n.alpha / 2, 128 - n.alpha / 2, 128 - n.alpha / 2, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 421: + Main.spriteBatch.Draw(Main.glowMaskTexture[146], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(128 - n.alpha / 2, 128 - n.alpha / 2, 128 - n.alpha / 2, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 423: + Main.spriteBatch.Draw(Main.glowMaskTexture[145], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(128 - n.alpha / 2, 128 - n.alpha / 2, 128 - n.alpha / 2, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 424: + Main.spriteBatch.Draw(Main.glowMaskTexture[144], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(128 - n.alpha / 2, 128 - n.alpha / 2, 128 - n.alpha / 2, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 425: + Main.spriteBatch.Draw(Main.glowMaskTexture[150], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(128 - n.alpha / 2, 128 - n.alpha / 2, 128 - n.alpha / 2, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 429: + Main.spriteBatch.Draw(Main.glowMaskTexture[151], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(128 - n.alpha / 2, 128 - n.alpha / 2, 128 - n.alpha / 2, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + default: + if (type >= 412 && type <= 414) + { + Microsoft.Xna.Framework.Color color57 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha, 0); + int index37 = 157 + type - 412; + if (type == 414 && (double) n.localAI[2] != 0.0) + { + int num201 = (int) n.localAI[2]; + if ((double) n.localAI[2] < 0.0) + num201 = 128 + (int) n.localAI[2]; + int num202 = (int) byte.MaxValue - num201; + color57 = new Microsoft.Xna.Framework.Color(num202, num201, num201, num202); + } + Main.spriteBatch.Draw(Main.glowMaskTexture[index37], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), color57, n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + } + switch (type) + { + case 160: + Main.spriteBatch.Draw(Main.glowMaskTexture[166], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(128 - n.alpha / 2, 128 - n.alpha / 2, 128 - n.alpha / 2, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 209: + Main.spriteBatch.Draw(Main.glowMaskTexture[167], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(128 - n.alpha / 2, 128 - n.alpha / 2, 128 - n.alpha / 2, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 415: + Main.spriteBatch.Draw(Main.glowMaskTexture[155], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + float num203 = (float) (0.5 + (double) (n.GetAlpha(color1).ToVector3() - new Vector3(0.5f)).Length() * 0.5); + for (int index38 = 0; index38 < 4; ++index38) + Main.spriteBatch.Draw(Main.glowMaskTexture[155], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY) + n.velocity.RotatedBy((double) index38 * 1.57079637050629) * num203, new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(64, 64, 64, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 417: + Main.spriteBatch.Draw(Main.glowMaskTexture[160], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + float num204 = (float) (0.25 + (double) (n.GetAlpha(color1).ToVector3() - new Vector3(0.5f)).Length() * 0.25); + for (int index39 = 0; index39 < 4; ++index39) + Main.spriteBatch.Draw(Main.glowMaskTexture[160], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY) + n.velocity.RotatedBy((double) index39 * 1.57079637050629) * num204, new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(64, 64, 64, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 419: + Main.spriteBatch.Draw(Main.glowMaskTexture[154], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + if ((double) n.ai[2] >= -6.0) + { + float num205 = (float) (0.5 + (double) (n.GetAlpha(color1).ToVector3() - new Vector3(0.5f)).Length() * 0.5); + for (int index40 = 0; index40 < 4; ++index40) + Main.spriteBatch.Draw(Main.glowMaskTexture[154], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY) + n.velocity.RotatedBy((double) index40 * 1.57079637050629) * num205, new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(64, 64, 64, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + } + float num206 = 4f; + for (int index41 = 0; index41 < 4; ++index41) + Main.spriteBatch.Draw(Main.glowMaskTexture[154], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY) + Vector2.UnitX.RotatedBy((double) index41 * 1.57079637050629) * num206, new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(64, 64, 64, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 516: + Main.spriteBatch.Draw(Main.npcTexture[type], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + float num207 = (float) (0.5 + (double) (n.GetAlpha(color1).ToVector3() - new Vector3(0.5f)).Length() * 0.5); + for (int index42 = 0; index42 < 4; ++index42) + Main.spriteBatch.Draw(Main.npcTexture[type], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY) + n.velocity.RotatedBy((double) index42 * 1.57079637050629) * num207, new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(64, 64, 64, 0), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 518: + Vector2 vector2_40 = new Vector2(-10f, 0.0f); + Main.spriteBatch.Draw(Main.glowMaskTexture[163], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha, (int) byte.MaxValue - n.alpha), n.rotation, vector2_3 + vector2_40, n.scale, spriteEffects, 0.0f); + float num208 = (float) (0.5 + (double) (n.GetAlpha(color1).ToVector3() - new Vector3(0.5f)).Length() * 0.5); + for (int index43 = 0; index43 < 4; ++index43) + Main.spriteBatch.Draw(Main.glowMaskTexture[163], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY) + n.velocity.RotatedBy((double) index43 * 1.57079637050629) * num208, new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(64, 64, 64, 0), n.rotation, vector2_3 + vector2_40, n.scale, spriteEffects, 0.0f); + break; + case 525: + Main.spriteBatch.Draw(Main.glowMaskTexture[169], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(200, 200, 200, 100), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 526: + Main.spriteBatch.Draw(Main.glowMaskTexture[170], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(200, 200, 200, 100), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 527: + Main.spriteBatch.Draw(Main.glowMaskTexture[171], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color(200, 200, 200, 100), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + case 533: + Main.spriteBatch.Draw(Main.glowMaskTexture[172], n.Bottom - Main.screenPosition + new Vector2((float) ((double) -Main.npcTexture[type].Width * (double) n.scale / 2.0 + (double) vector2_3.X * (double) n.scale), (float) ((double) -Main.npcTexture[type].Height * (double) n.scale / (double) Main.npcFrameCount[type] + 4.0 + (double) vector2_3.Y * (double) n.scale) + addHeight + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(n.frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 100), n.rotation, vector2_3, n.scale, spriteEffects, 0.0f); + break; + } + break; } - else - continue; } - mySpriteBatch.Draw(texture2D1, position2, new Microsoft.Xna.Framework.Rectangle?(r1), color2, rCurrentNPC.rotation, r1.Size() / 2f, rCurrentNPC.scale * 2f, npcSpriteEffect, 0.0f); - mySpriteBatch.Draw(texture2, position2, new Microsoft.Xna.Framework.Rectangle?(r1), color2, rCurrentNPC.rotation, r1.Size() / 2f, rCurrentNPC.scale * 2f, npcSpriteEffect, 0.0f); - if (flag) - { - Texture2D texture2D4 = TextureAssets.Extra[187].Value; - Microsoft.Xna.Framework.Rectangle rectangle = texture2D4.Frame(verticalFrames: 8, frameY: ((int) ((double) rCurrentNPC.localAI[0] / 4.0) % 8)); - mySpriteBatch.Draw(texture2D4, position2, new Microsoft.Xna.Framework.Rectangle?(rectangle), color2, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, npcSpriteEffect, 0.0f); - } - mySpriteBatch.Draw(texture1, position2, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), color2, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, npcSpriteEffect, 0.0f); - for (int index2 = 0; index2 < 2; ++index2) - { - if (index2 == num2) - mySpriteBatch.Draw(texture2D2, position2, new Microsoft.Xna.Framework.Rectangle?(r2), color2, rCurrentNPC.rotation, origin1, rCurrentNPC.scale, npcSpriteEffect, 0.0f); - if (index2 == num3) - mySpriteBatch.Draw(texture2D3, position2, new Microsoft.Xna.Framework.Rectangle?(r3), color2, rCurrentNPC.rotation, origin2, rCurrentNPC.scale, npcSpriteEffect, 0.0f); - } - } + if (n.aiStyle != 7) + break; + this.DrawNPCExtras(n, false, addHeight, addY, color1, vector2_3, spriteEffects); + break; } } - Microsoft.Xna.Framework.Color color3 = color1 * num4; - mySpriteBatch.Draw(texture2D1, position1, new Microsoft.Xna.Framework.Rectangle?(r1), color3, rCurrentNPC.rotation, r1.Size() / 2f, rCurrentNPC.scale * 2f, npcSpriteEffect, 0.0f); - if (!rCurrentNPC.IsABestiaryIconDummy) - { - mySpriteBatch.End(); - mySpriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.Default, RasterizerState.CullNone, (Effect) null, Main.Transform); - } - DrawData drawData = new DrawData(texture2, position1, new Microsoft.Xna.Framework.Rectangle?(r1), color3, rCurrentNPC.rotation, r1.Size() / 2f, rCurrentNPC.scale * 2f, npcSpriteEffect, 0); - GameShaders.Misc["HallowBoss"].Apply(new DrawData?(drawData)); - drawData.Draw(mySpriteBatch); - Main.pixelShader.CurrentTechnique.Passes[0].Apply(); - if (!rCurrentNPC.IsABestiaryIconDummy) - { - mySpriteBatch.End(); - mySpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.Transform); - } - float amount2 = (float) (Math.Sin((double) Main.GlobalTimeWrappedHourly * 6.28318548202515 * 0.5) * 0.5 + 0.5); - Microsoft.Xna.Framework.Color color4 = Main.hslToRgb((float) (((double) amount2 * 0.0799999982118607 + 0.600000023841858) % 1.0), 1f, 0.5f); - color4.A = (byte) 0; - color4 *= 0.6f; - if (NPC.ShouldEmpressBeEnraged()) - { - color4 = Main.OurFavoriteColor; - color4.A = (byte) 0; - color4 *= 0.3f; - } - color4 *= num4 * rCurrentNPC.Opacity; - if (flag) - { - Texture2D texture2D5 = TextureAssets.Extra[187].Value; - Microsoft.Xna.Framework.Rectangle rectangle = texture2D5.Frame(verticalFrames: 8, frameY: ((int) ((double) rCurrentNPC.localAI[0] / 4.0) % 8)); - mySpriteBatch.Draw(texture2D5, position1, new Microsoft.Xna.Framework.Rectangle?(rectangle), color3, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, npcSpriteEffect, 0.0f); - for (float num16 = 0.0f; (double) num16 < 1.0; num16 += 0.25f) - { - Vector2 vector2 = rCurrentNPC.rotation.ToRotationVector2().RotatedBy((double) num16 * 6.28318548202515 + 0.785398185253143) * MathHelper.Lerp(2f, 8f, amount2); - mySpriteBatch.Draw(texture2D5, position1 + vector2, new Microsoft.Xna.Framework.Rectangle?(rectangle), color4, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, npcSpriteEffect, 0.0f); - } - } - mySpriteBatch.Draw(texture1, position1, new Microsoft.Xna.Framework.Rectangle?(rCurrentNPC.frame), color3, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, npcSpriteEffect, 0.0f); - if (flag) - { - Texture2D texture3 = TextureAssets.Extra[188].Value; - for (float num17 = 0.0f; (double) num17 < 1.0; num17 += 0.25f) - { - Vector2 vector2 = rCurrentNPC.rotation.ToRotationVector2().RotatedBy((double) num17 * 6.28318548202515 + 0.785398185253143) * MathHelper.Lerp(2f, 8f, amount2); - mySpriteBatch.Draw(texture3, position1 + vector2, new Microsoft.Xna.Framework.Rectangle?(), color4, rCurrentNPC.rotation, halfSize, rCurrentNPC.scale, npcSpriteEffect, 0.0f); - } - } - for (int index = 0; index < 2; ++index) - { - if (index == num2) - mySpriteBatch.Draw(texture2D2, position1, new Microsoft.Xna.Framework.Rectangle?(r2), color3, rCurrentNPC.rotation, origin1, rCurrentNPC.scale, npcSpriteEffect, 0.0f); - if (index == num3) - mySpriteBatch.Draw(texture2D3, position1, new Microsoft.Xna.Framework.Rectangle?(r3), color3, rCurrentNPC.rotation, origin2, rCurrentNPC.scale, npcSpriteEffect, 0.0f); - } - } - - private static void DrawNPCDirect_GetHallowBossArmFrame( - NPC rCurrentNPC, - out int armFrame_Count, - out int armFrameToUseLeft, - out int armFrameToUseRight) - { - int num1 = 0; - int num2 = 1; - int num3 = 2; - int num4 = 3; - int num5 = 4; - int num6 = 5; - int num7 = 6; - armFrame_Count = 7; - armFrameToUseLeft = num1; - armFrameToUseRight = num1; - float num8 = rCurrentNPC.ai[1]; - switch ((int) rCurrentNPC.ai[0]) - { - case 0: - int num9 = (double) num8 >= 106.0 ? ((double) num8 >= 110.0 ? num1 : num3) : num2; - armFrameToUseLeft = num9; - armFrameToUseRight = num9; - break; - case 2: - case 11: - int num10 = (double) num8 >= 5.0 ? ((double) num8 >= 65.0 ? num3 : num4) : num3; - armFrameToUseLeft = num10; - break; - case 4: - case 10: - int num11 = (double) num8 >= 6.0 ? ((double) num8 >= 54.0 ? num3 : num4) : num3; - armFrameToUseLeft = num11; - armFrameToUseRight = num11; - break; - case 5: - int num12 = (double) num8 >= 6.0 ? ((double) num8 >= 54.0 ? num3 : num4) : num3; - armFrameToUseRight = num12; - break; - case 6: - int num13 = (double) num8 >= 6.0 ? ((double) num8 >= 174.0 ? ((double) num8 >= 180.0 ? num1 : num3) : num4) : num3; - armFrameToUseLeft = num13; - armFrameToUseRight = num13; - break; - case 7: - bool isExpertMode = Main.GameModeInfo.IsExpertMode; - int num14 = isExpertMode ? 40 : 60; - int num15 = 0; - int num16 = 5; - if ((double) num8 < (double) (num15 + num16)) - { - armFrameToUseLeft = num3; - break; - } - int num17 = num15 + num16; - if ((double) num8 < (double) (num17 + num14 - num16)) - { - armFrameToUseLeft = num4; - break; - } - int num18 = num17 + (num14 - num16); - if ((double) num8 < (double) (num18 + num16)) - { - armFrameToUseLeft = num4; - armFrameToUseRight = num3; - break; - } - int num19 = num18 + num16; - if ((double) num8 < (double) (num19 + num14 - num16)) - { - armFrameToUseLeft = num4; - armFrameToUseRight = num4; - break; - } - int num20 = num19 + (num14 - num16); - if ((double) num8 < (double) (num20 + num14)) - { - armFrameToUseLeft = num5; - armFrameToUseRight = num4; - break; - } - int num21 = num20 + num14; - if ((double) num8 < (double) (num21 + num14)) - { - armFrameToUseLeft = num5; - armFrameToUseRight = num5; - break; - } - int num22 = num21 + num14; - if (isExpertMode) - { - if ((double) num8 < (double) (num22 + num16)) - { - armFrameToUseLeft = num4; - armFrameToUseRight = num5; - break; - } - int num23 = num22 + num16; - if ((double) num8 < (double) (num23 + num14 - num16)) - { - armFrameToUseLeft = num2; - armFrameToUseRight = num5; - break; - } - int num24 = num23 + (num14 - num16); - if ((double) num8 < (double) (num24 + num16)) - { - armFrameToUseLeft = num2; - armFrameToUseRight = num4; - break; - } - int num25 = num24 + num16; - if ((double) num8 < (double) (num25 + num14 - num16)) - { - armFrameToUseLeft = num2; - armFrameToUseRight = num2; - break; - } - num22 = num25 + (num14 - num16); - } - if ((double) num8 < (double) num22) - break; - armFrameToUseLeft = num3; - armFrameToUseRight = num3; - break; - case 8: - case 9: - int num26 = (double) num8 >= 10.0 ? ((double) num8 >= 20.0 ? ((double) num8 >= 30.0 ? num6 : num3) : num4) : num3; - int num27 = num26; - int num28 = num26; - int num29 = (int) rCurrentNPC.ai[3]; - int num30 = -1; - if ((double) num8 < 30.0) - { - if (num29 == -1 * num30) - num28 = num2; - if (num29 == num30) - num27 = num2; - } - int num31 = num6; - int num32 = num7; - if (num29 == num30 && num28 == num31) - num28 = num32; - if (num29 == -1 * num30 && num27 == num31) - num27 = num32; - armFrameToUseLeft = num28; - armFrameToUseRight = num27; - break; - } - } - - private static void DrawNPC_SlimeItem( - NPC rCurrentNPC, - int typeCache, - Microsoft.Xna.Framework.Color npcColor, - float addedRotation) - { - int i = (int) rCurrentNPC.ai[1]; - float scale = 1f; - float num1 = 22f * rCurrentNPC.scale; - float num2 = 18f * rCurrentNPC.scale; - Main.instance.LoadItem(i); - float num3 = (float) TextureAssets.Item[i].Width(); - float num4 = (float) TextureAssets.Item[i].Height(); - int num5 = (int) rCurrentNPC.ai[0] == -999 ? 1 : 0; - if (num5 != 0) - { - num1 = 14f * rCurrentNPC.scale; - num2 = 14f * rCurrentNPC.scale; - } - if ((double) num3 > (double) num1) - { - scale *= num1 / num3; - num3 *= scale; - num4 *= scale; - } - if ((double) num4 > (double) num2) - { - scale *= num2 / num4; - num3 *= scale; - float num6 = num4 * scale; - } - float num7 = -1f; - float num8 = 1f; - int num9 = rCurrentNPC.frame.Y / (TextureAssets.Npc[typeCache].Height() / Main.npcFrameCount[typeCache]); - float num10 = num8 - (float) num9; - float num11 = num7 + (float) (num9 * 2); - float rotation = 0.2f - 0.3f * (float) num9; - if (num5 != 0) - { - rotation = 0.0f; - num10 -= 6f; - num11 -= num3 * addedRotation; - } - Main.spriteBatch.Draw(TextureAssets.Item[i].Value, new Vector2(rCurrentNPC.Center.X - Main.screenPosition.X + num11, rCurrentNPC.Center.Y - Main.screenPosition.Y + rCurrentNPC.gfxOffY + num10), new Microsoft.Xna.Framework.Rectangle?(), npcColor, rotation, new Vector2((float) (TextureAssets.Item[i].Width() / 2), (float) (TextureAssets.Item[i].Height() / 2)), scale, SpriteEffects.None, 0.0f); } protected void DrawNPCExtras( @@ -19107,8 +20629,7 @@ label_56: float addY, Microsoft.Xna.Framework.Color npcColor, Vector2 halfSize, - SpriteEffects npcSpriteEffect, - Vector2 screenPosition) + SpriteEffects npcSpriteEffect) { if (!beforeDraw && n.UsesPartyHat()) { @@ -19116,7 +20637,7 @@ label_56: int[] npCsFramingGroup = NPCID.Sets.TownNPCsFramingGroups[NPCID.Sets.NPCFramingGroup[n.type]]; if (index >= npCsFramingGroup.Length) index = 0; - Texture2D texture2D = TextureAssets.Extra[72].Value; + Texture2D texture2D = Main.extraTexture[72]; int num1 = 0; switch (n.GetPartyHatColor()) { @@ -19136,85 +20657,29 @@ label_56: Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(20, frameX: (num1 % 20)); r.Width -= 2; r.Height -= 2; - int num2 = 0; - if (n.type == 637) - { - num2 = 6; - switch (index) - { - case 11: - case 12: - case 13: - case 14: - case 15: - num2 += 2; - break; - case 19: - case 22: - case 23: - case 24: - case 25: - case 26: - case 27: - num2 -= 2; - break; - } - } - if (n.type == 638) - num2 = 12; - if (n.type == 656) - { - num2 = 6; - switch (index) - { - case 1: - case 2: - case 3: - num2 -= 2; - break; - case 8: - num2 -= 2; - break; - case 18: - case 19: - case 20: - case 21: - case 22: - case 23: - case 24: - case 25: - num2 -= 4; - break; - } - } Vector2 vector2 = n.Top + new Vector2((float) (-2 * n.spriteDirection), n.gfxOffY); - vector2.X += (float) (num2 * n.spriteDirection); vector2.Y += (float) npCsFramingGroup[index]; vector2.Y += (float) NPCID.Sets.HatOffsetY[n.type]; - int num3 = 0; + int num2 = 0; if ((double) n.ai[0] == 5.0) { - num3 = -4; + num2 = -4; if (n.type == 38) - num3 = -8; + num2 = -8; if (n.type == 124) - num3 = -2; + num2 = -2; if (n.type == 550) - num3 = -4; - if (n.type == 588) - num3 = -4; + num2 = -4; if (n.type == 108 || n.type == 178) - num3 = -6; - if (n.type == 637) - num3 = -12; + num2 = -6; } - vector2.Y += (float) num3; + vector2.Y += (float) num2; if (n.type == 229 && (double) n.ai[0] == 12.0) vector2.X -= (float) (n.spriteDirection * 4); if (n.type == 550 && (double) n.ai[0] == 5.0) vector2.X += (float) (n.spriteDirection * 7); Vector2 origin = r.Size() - new Vector2((float) (r.Width / 2), 12f); - int num4 = 0; + int num3 = 0; switch (n.type) { case 17: @@ -19225,11 +20690,7 @@ label_56: case 124: case 229: case 353: - case 633: - case 637: - case 638: - case 656: - num4 = -1; + num3 = -1; break; case 37: case 38: @@ -19239,35 +20700,32 @@ label_56: case 160: case 207: case 209: - num4 = -3; + num3 = -3; break; case 178: case 208: case 369: - num4 = 1; + num3 = 1; break; case 227: - num4 = -4; + num3 = -4; break; case 228: - num4 = -2; + num3 = -2; break; case 550: - num4 = -4; - break; - case 588: - num4 = 0; + num3 = -4; break; } - vector2.X += (float) (num4 * n.spriteDirection); + vector2.X += (float) (num3 * n.spriteDirection); vector2.X += (float) (4 * n.spriteDirection); - Main.spriteBatch.Draw(texture2D, new Vector2(vector2.X - screenPosition.X, vector2.Y - screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(r), npcColor * n.Opacity, 0.0f, origin, n.scale, npcSpriteEffect, 0.0f); + Main.spriteBatch.Draw(texture2D, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(r), npcColor, 0.0f, origin, n.scale, npcSpriteEffect, 0.0f); } if (NPCID.Sets.AttackType[n.type] == 1 && (double) n.ai[0] == 12.0 && !beforeDraw) { if (n.type == 228 || n.type == 229 || n.type == 209) return; - double num5 = (double) n.ai[2]; + double num4 = (double) n.ai[2]; Vector2 vector2_1 = Main.OffsetsNPCOffhand[2]; if (n.spriteDirection == 1) vector2_1.X *= -1f; @@ -19278,13 +20736,13 @@ label_56: vector2_2.Y += 4f; if (n.type == 368 && !Main.hardMode && (double) n.ai[2] < -0.100000001490116) vector2_2.Y -= 8f; - float rotation = (float) (num5 * 1.57079637050629) * (float) n.spriteDirection; - float num6 = 1f; - int index = 0; - int num7 = 4; + float rotation = (float) (num4 * 1.57079637050629) * (float) n.spriteDirection; + float num5 = 1f; + int itemtype = 0; + int num6 = 4; if (n.type == 19) { - index = Main.hardMode ? 98 : 95; + itemtype = Main.hardMode ? 98 : 95; if (Main.hardMode) { vector2_2.X -= (float) (10 * n.direction); @@ -19293,71 +20751,68 @@ label_56: } else if (n.type == 22) { - index = 39; - num7 = 18; + itemtype = 39; + num6 = 18; } else if (n.type == 178) - index = 434; + itemtype = 434; else if (n.type == 227) { - index = 3350; - num7 = 16; - num6 = 0.85f; + itemtype = 3350; + num6 = 16; + num5 = 0.85f; } else if (n.type == 368) { - index = Main.hardMode ? 2223 : 2269; + itemtype = Main.hardMode ? 2223 : 2269; if (Main.hardMode) { - num7 = 18; + num6 = 18; } else { if ((double) n.ai[2] < -0.100000001490116) - num7 = 28; - num6 = 0.75f; + num6 = 28; + num5 = 0.75f; } } - Main.instance.LoadItem(index); - Texture2D texture = TextureAssets.Item[index].Value; - int num8 = (int) Main.DrawPlayerItemPos(1f, index).X - num7; - Vector2 origin = new Vector2((float) -num8, (float) (texture.Height / 2)); + Texture2D texture = Main.itemTexture[itemtype]; + int num7 = (int) this.DrawPlayerItemPos(1f, itemtype).X - num6; + Vector2 origin = new Vector2((float) -num7, (float) (texture.Height / 2)); if (n.spriteDirection == -1) - origin = new Vector2((float) (texture.Width + num8), (float) (texture.Height / 2)); - Main.spriteBatch.Draw(texture, new Vector2((float) (int) ((double) vector2_2.X - (double) screenPosition.X), (float) (int) ((double) vector2_2.Y - (double) screenPosition.Y)), new Microsoft.Xna.Framework.Rectangle?(), npcColor, rotation, origin, n.scale * num6, npcSpriteEffect ^ SpriteEffects.FlipHorizontally, 0.0f); - if (n.type == 22 && n.frame.Y / (TextureAssets.Npc[n.type].Height() / Main.npcFrameCount[n.type]) >= 21) + origin = new Vector2((float) (texture.Width + num7), (float) (texture.Height / 2)); + Main.spriteBatch.Draw(texture, new Vector2((float) (int) ((double) vector2_2.X - (double) Main.screenPosition.X), (float) (int) ((double) vector2_2.Y - (double) Main.screenPosition.Y)), new Microsoft.Xna.Framework.Rectangle?(), npcColor, rotation, origin, n.scale * num5, npcSpriteEffect ^ SpriteEffects.FlipHorizontally, 0.0f); + if (n.type == 22 && n.frame.Y / (Main.npcTexture[n.type].Height / Main.npcFrameCount[n.type]) >= 21) { - Texture2D texture2D = TextureAssets.Extra[52].Value; - Microsoft.Xna.Framework.Rectangle rectangle = texture2D.Frame(verticalFrames: 5, frameY: (n.frame.Y / (TextureAssets.Npc[n.type].Height() / Main.npcFrameCount[n.type]) - 21)); - Main.spriteBatch.Draw(texture2D, new Vector2((float) ((double) n.position.X - (double) screenPosition.X + (double) (n.width / 2) - (double) TextureAssets.Npc[n.type].Width() * (double) n.scale / 2.0 + (double) halfSize.X * (double) n.scale), (float) ((double) n.position.Y - (double) screenPosition.Y + (double) n.height - (double) TextureAssets.Npc[n.type].Height() * (double) n.scale / (double) Main.npcFrameCount[n.type] + 4.0 + (double) halfSize.Y * (double) n.scale) + addHeight + addY + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), n.GetAlpha(npcColor), n.rotation, halfSize, n.scale, npcSpriteEffect, 0.0f); + Texture2D texture2D = Main.extraTexture[52]; + Microsoft.Xna.Framework.Rectangle rectangle = texture2D.Frame(verticalFrames: 5, frameY: (n.frame.Y / (Main.npcTexture[n.type].Height / Main.npcFrameCount[n.type]) - 21)); + Main.spriteBatch.Draw(texture2D, new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[n.type].Width * (double) n.scale / 2.0 + (double) halfSize.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[n.type].Height * (double) n.scale / (double) Main.npcFrameCount[n.type] + 4.0 + (double) halfSize.Y * (double) n.scale) + addHeight + addY + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), n.GetAlpha(npcColor), n.rotation, halfSize, n.scale, npcSpriteEffect, 0.0f); } - else if (n.type == 368 && n.frame.Y / (TextureAssets.Npc[n.type].Height() / Main.npcFrameCount[n.type]) >= 21) + else if (n.type == 368 && n.frame.Y / (Main.npcTexture[n.type].Height / Main.npcFrameCount[n.type]) >= 21) { - Texture2D texture2D = TextureAssets.Extra[53].Value; - Microsoft.Xna.Framework.Rectangle rectangle = texture2D.Frame(verticalFrames: 5, frameY: (n.frame.Y / (TextureAssets.Npc[n.type].Height() / Main.npcFrameCount[n.type]) - 21)); - Main.spriteBatch.Draw(texture2D, new Vector2((float) ((double) n.position.X - (double) screenPosition.X + (double) (n.width / 2) - (double) TextureAssets.Npc[n.type].Width() * (double) n.scale / 2.0 + (double) halfSize.X * (double) n.scale), (float) ((double) n.position.Y - (double) screenPosition.Y + (double) n.height - (double) TextureAssets.Npc[n.type].Height() * (double) n.scale / (double) Main.npcFrameCount[n.type] + 4.0 + (double) halfSize.Y * (double) n.scale) + addHeight + addY + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), n.GetAlpha(npcColor), n.rotation, halfSize, n.scale, npcSpriteEffect, 0.0f); + Texture2D texture2D = Main.extraTexture[53]; + Microsoft.Xna.Framework.Rectangle rectangle = texture2D.Frame(verticalFrames: 5, frameY: (n.frame.Y / (Main.npcTexture[n.type].Height / Main.npcFrameCount[n.type]) - 21)); + Main.spriteBatch.Draw(texture2D, new Vector2((float) ((double) n.position.X - (double) Main.screenPosition.X + (double) (n.width / 2) - (double) Main.npcTexture[n.type].Width * (double) n.scale / 2.0 + (double) halfSize.X * (double) n.scale), (float) ((double) n.position.Y - (double) Main.screenPosition.Y + (double) n.height - (double) Main.npcTexture[n.type].Height * (double) n.scale / (double) Main.npcFrameCount[n.type] + 4.0 + (double) halfSize.Y * (double) n.scale) + addHeight + addY + n.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), n.GetAlpha(npcColor), n.rotation, halfSize, n.scale, npcSpriteEffect, 0.0f); } } if (NPCID.Sets.AttackType[n.type] == 2 && (double) n.ai[0] == 14.0 && !beforeDraw) { - Texture2D texture2D = TextureAssets.Extra[51].Value; + Texture2D texture2D = Main.extraTexture[51]; Vector2 vector2 = n.Bottom + new Vector2(0.0f, n.gfxOffY + 4f); Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: 4, frameY: ((int) n.frameCounter % 48 / 12)); Vector2 origin = r.Size() * new Vector2(0.5f, 1f); - Main.spriteBatch.Draw(texture2D, new Vector2((float) (int) ((double) vector2.X - (double) screenPosition.X), (float) (int) ((double) vector2.Y - (double) screenPosition.Y)), new Microsoft.Xna.Framework.Rectangle?(r), NPCID.Sets.MagicAuraColor[n.type], 0.0f, origin, n.scale, npcSpriteEffect ^ SpriteEffects.FlipHorizontally, 0.0f); + Main.spriteBatch.Draw(texture2D, new Vector2((float) (int) ((double) vector2.X - (double) Main.screenPosition.X), (float) (int) ((double) vector2.Y - (double) Main.screenPosition.Y)), new Microsoft.Xna.Framework.Rectangle?(r), NPCID.Sets.MagicAuraColor[n.type], 0.0f, origin, n.scale, npcSpriteEffect ^ SpriteEffects.FlipHorizontally, 0.0f); } if (NPCID.Sets.AttackType[n.type] == 3 && (double) n.ai[0] == 15.0) { - Main.instance.LoadItem(4); - Texture2D texture2D = TextureAssets.Item[4].Value; - int num9 = 32; - float num10 = 0.0f; + Texture2D texture2D = Main.itemTexture[4]; + int num8 = 32; + float num9 = 0.0f; Vector2 zero = Vector2.Zero; if (n.type == 207) { - Main.instance.LoadItem(3349); - texture2D = TextureAssets.Item[3349].Value; - num10 = 0.15f; + texture2D = Main.itemTexture[3349]; + num9 = 0.15f; if (beforeDraw) return; if ((double) n.ai[1] > (double) NPCID.Sets.AttackTime[n.type] * 0.660000026226044) @@ -19365,9 +20820,8 @@ label_56: } else if (n.type == 353) { - Main.instance.LoadItem(3352); - texture2D = TextureAssets.Item[3352].Value; - num10 = 0.15f; + texture2D = Main.itemTexture[3352]; + num9 = 0.15f; if (!beforeDraw) return; if ((double) n.ai[1] > (double) NPCID.Sets.AttackTime[n.type] * 0.660000026226044) @@ -19375,39 +20829,43 @@ label_56: } else if (n.type == 441) { - Main.instance.LoadItem(3351); - texture2D = TextureAssets.Item[3351].Value; - num9 = 28; - num10 = 0.1f; + texture2D = Main.itemTexture[3351]; + num8 = 28; + num9 = 0.1f; if (!beforeDraw) return; if ((double) n.ai[1] > (double) NPCID.Sets.AttackTime[n.type] * 0.660000026226044) zero.Y = 12f; } - Tuple swingStats = n.GetSwingStats(NPCID.Sets.AttackTime[n.type] * 2, (int) n.ai[1], n.spriteDirection, num9, num9); - Vector2 vector2 = swingStats.Item1 + (swingStats.Item1 - n.Center) * num10 + zero; + Tuple swingStats = n.GetSwingStats(NPCID.Sets.AttackTime[n.type] * 2, (int) n.ai[1], n.spriteDirection, num8, num8); + Vector2 vector2 = swingStats.Item1 + (swingStats.Item1 - n.Center) * num9 + zero; Vector2 origin = texture2D.Size() * new Vector2(n.spriteDirection == 1 ? 0.0f : 1f, 1f); - Main.spriteBatch.Draw(texture2D, new Vector2((float) (int) ((double) vector2.X - (double) screenPosition.X), (float) (int) ((double) vector2.Y - (double) screenPosition.Y)), new Microsoft.Xna.Framework.Rectangle?(), n.GetAlpha(npcColor), swingStats.Item2, origin, n.scale, npcSpriteEffect ^ SpriteEffects.FlipHorizontally, 0.0f); + Main.spriteBatch.Draw(texture2D, new Vector2((float) (int) ((double) vector2.X - (double) Main.screenPosition.X), (float) (int) ((double) vector2.Y - (double) Main.screenPosition.Y)), new Microsoft.Xna.Framework.Rectangle?(), n.GetAlpha(npcColor), swingStats.Item2, origin, n.scale, npcSpriteEffect ^ SpriteEffects.FlipHorizontally, 0.0f); } - if (n.type != 550 || (double) n.ai[0] != 18.0 || beforeDraw) + if (n.type != 550 || (double) n.ai[0] != 18.0) return; - Main.instance.LoadItem(353); - Texture2D texture2D1 = TextureAssets.Item[353].Value; - int num11 = 32; - float num12 = 0.15f; + Texture2D texture2D1 = Main.itemTexture[353]; + int num10 = 32; + float num11 = 0.0f; Vector2 zero1 = Vector2.Zero; - Microsoft.Xna.Framework.Rectangle r1 = texture2D1.Frame(verticalFrames: 3, frameY: 1); + if (n.type == 550) + { + texture2D1 = Main.itemTexture[353]; + num11 = 0.15f; + if (beforeDraw) + return; + } int index1 = (int) n.ai[2]; if (index1 >= 0 && index1 < (int) byte.MaxValue) { Player player = Main.player[index1]; bool flag = player.HeldItem.type == 353 && player.direction == Math.Sign(n.Center.X - player.Center.X); - double num13 = (double) player.Hitbox.Distance(n.Center); - float num14 = n.localAI[3]; - if (num13 < 46.0 & flag) + double num12 = (double) player.Hitbox.Distance(n.Center); + float num13 = n.localAI[3]; + if (num12 < 46.0 & flag) { n.localAI[3] = 1f; - if ((double) n.localAI[3] != (double) num14) + if ((double) n.localAI[3] != (double) num13) { Vector2 vector2_3 = n.Center + new Vector2((float) (n.spriteDirection * 30), -6f); Vector2 vector2_4 = new Vector2(10f, 10f); @@ -19423,6834 +20881,3716 @@ label_56: else if ((double) n.localAI[3] == 1.0) n.localAI[3] = 2f; } - Tuple swingStats1 = n.GetSwingStats(40, 12, n.spriteDirection, num11, num11); - Vector2 vector2_5 = swingStats1.Item1 + (swingStats1.Item1 - n.Center) * num12 + zero1; - Vector2 origin1 = r1.Size() * new Vector2(n.spriteDirection == 1 ? 0.0f : 1f, 1f); - Main.spriteBatch.Draw(texture2D1, new Vector2((float) (int) ((double) vector2_5.X - (double) screenPosition.X), (float) (int) ((double) vector2_5.Y - (double) screenPosition.Y)), new Microsoft.Xna.Framework.Rectangle?(r1), n.GetAlpha(npcColor), swingStats1.Item2, origin1, n.scale, npcSpriteEffect ^ SpriteEffects.FlipHorizontally, 0.0f); + Tuple swingStats1 = n.GetSwingStats(40, 12, n.spriteDirection, num10, num10); + Vector2 vector2_5 = swingStats1.Item1 + (swingStats1.Item1 - n.Center) * num11 + zero1; + Vector2 origin1 = texture2D1.Size() * new Vector2(n.spriteDirection == 1 ? 0.0f : 1f, 1f); + Main.spriteBatch.Draw(texture2D1, new Vector2((float) (int) ((double) vector2_5.X - (double) Main.screenPosition.X), (float) (int) ((double) vector2_5.Y - (double) Main.screenPosition.Y)), new Microsoft.Xna.Framework.Rectangle?(), n.GetAlpha(npcColor), swingStats1.Item2, origin1, n.scale, npcSpriteEffect ^ SpriteEffects.FlipHorizontally, 0.0f); } public void DrawProj(int i) { - this.PrepareDrawnEntityDrawing((Entity) Main.projectile[i], Main.GetProjectileDesiredShader(i)); - int num1 = ProjectileID.Sets.DrawScreenCheckFluff[Main.projectile[i].type]; - if (!new Microsoft.Xna.Framework.Rectangle((int) Main.Camera.ScaledPosition.X - num1, (int) Main.Camera.ScaledPosition.Y - num1, (int) Main.Camera.ScaledSize.X + num1 * 2, (int) Main.Camera.ScaledSize.Y + num1 * 2).Intersects(Main.projectile[i].Hitbox)) - return; - Projectile projectile1 = Main.projectile[i]; - if (projectile1.type == 734) + float x1 = 0.0f; + float y1 = 0.0f; + Projectile projectile = Main.projectile[i]; + this.LoadProjectile(projectile.type); + Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; + if (projectile.aiStyle == 99) { - VoidLensHelper voidLensHelper = new VoidLensHelper(projectile1); - this._voidLensData.Clear(); - int selectionMode = Main.TryInteractingWithVoidLens(projectile1); - voidLensHelper.DrawToDrawData(this._voidLensData, selectionMode); - foreach (DrawData data in this._voidLensData) - Main.EntitySpriteDraw(data); - } - else - { - float polePosX = 0.0f; - float polePosY = 0.0f; - this.LoadProjectile(projectile1.type); - Vector2 mountedCenter = Main.player[projectile1.owner].MountedCenter; - if (projectile1.aiStyle == 99) + Vector2 vector2 = mountedCenter; + vector2.Y += Main.player[projectile.owner].gfxOffY; + float num1 = projectile.Center.X - vector2.X; + float num2 = projectile.Center.Y - vector2.Y; + Math.Sqrt((double) num1 * (double) num1 + (double) num2 * (double) num2); + float num3 = (float) Math.Atan2((double) num2, (double) num1) - 1.57f; + if (!projectile.counterweight) { - Vector2 vector2 = mountedCenter; - vector2.Y += Main.player[projectile1.owner].gfxOffY; - float num2 = projectile1.Center.X - vector2.X; - float num3 = projectile1.Center.Y - vector2.Y; - Math.Sqrt((double) num2 * (double) num2 + (double) num3 * (double) num3); - float num4 = (float) Math.Atan2((double) num3, (double) num2) - 1.57f; - if (!projectile1.counterweight) - { - int num5 = -1; - if ((double) projectile1.position.X + (double) (projectile1.width / 2) < (double) Main.player[projectile1.owner].position.X + (double) (Main.player[projectile1.owner].width / 2)) - num5 = 1; - int num6 = num5 * -1; - Main.player[projectile1.owner].itemRotation = (float) Math.Atan2((double) num3 * (double) num6, (double) num2 * (double) num6); - } - bool flag = true; - if ((double) num2 == 0.0 && (double) num3 == 0.0) - { - flag = false; - } - else - { - float num7 = 12f / (float) Math.Sqrt((double) num2 * (double) num2 + (double) num3 * (double) num3); - float num8 = num2 * num7; - float num9 = num3 * num7; - vector2.X -= num8 * 0.1f; - vector2.Y -= num9 * 0.1f; - num2 = projectile1.position.X + (float) projectile1.width * 0.5f - vector2.X; - num3 = projectile1.position.Y + (float) projectile1.height * 0.5f - vector2.Y; - } - while (flag) - { - float num10 = 12f; - float f1 = (float) Math.Sqrt((double) num2 * (double) num2 + (double) num3 * (double) num3); - float f2 = f1; - if (float.IsNaN(f1) || float.IsNaN(f2)) - { - flag = false; - } - else - { - if ((double) f1 < 20.0) - { - num10 = f1 - 8f; - flag = false; - } - float num11 = 12f / f1; - float num12 = num2 * num11; - float num13 = num3 * num11; - vector2.X += num12; - vector2.Y += num13; - num2 = projectile1.position.X + (float) projectile1.width * 0.5f - vector2.X; - num3 = projectile1.position.Y + (float) projectile1.height * 0.1f - vector2.Y; - if ((double) f2 > 12.0) - { - float num14 = 0.3f; - float num15 = Math.Abs(projectile1.velocity.X) + Math.Abs(projectile1.velocity.Y); - if ((double) num15 > 16.0) - num15 = 16f; - float num16 = (float) (1.0 - (double) num15 / 16.0); - float num17 = num14 * num16; - float num18 = f2 / 80f; - if ((double) num18 > 1.0) - num18 = 1f; - float num19 = num17 * num18; - if ((double) num19 < 0.0) - num19 = 0.0f; - float num20 = num19 * num18 * 0.5f; - if ((double) num3 > 0.0) - { - num3 *= 1f + num20; - num2 *= 1f - num20; - } - else - { - float num21 = Math.Abs(projectile1.velocity.X) / 3f; - if ((double) num21 > 1.0) - num21 = 1f; - float num22 = num21 - 0.5f; - float num23 = num20 * num22; - if ((double) num23 > 0.0) - num23 *= 2f; - num3 *= 1f + num23; - num2 *= 1f - num23; - } - } - float rotation = (float) Math.Atan2((double) num3, (double) num2) - 1.57f; - Microsoft.Xna.Framework.Color color = Microsoft.Xna.Framework.Color.White; - color.A = (byte) ((double) color.A * 0.400000005960464); - color = Main.TryApplyingPlayerStringColor(Main.player[projectile1.owner].stringColor, color); - float num24 = 0.5f; - color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0), color); - color = new Microsoft.Xna.Framework.Color((int) (byte) ((double) color.R * (double) num24), (int) (byte) ((double) color.G * (double) num24), (int) (byte) ((double) color.B * (double) num24), (int) (byte) ((double) color.A * (double) num24)); - Main.EntitySpriteDraw(TextureAssets.FishingLine.Value, new Vector2((float) ((double) vector2.X - (double) Main.screenPosition.X + (double) TextureAssets.FishingLine.Width() * 0.5), (float) ((double) vector2.Y - (double) Main.screenPosition.Y + (double) TextureAssets.FishingLine.Height() * 0.5)) - new Vector2(6f, 0.0f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.FishingLine.Width(), (int) num10)), color, rotation, new Vector2((float) TextureAssets.FishingLine.Width() * 0.5f, 0.0f), 1f, SpriteEffects.None, 0); - } - } + int num4 = -1; + if ((double) projectile.position.X + (double) (projectile.width / 2) < (double) Main.player[projectile.owner].position.X + (double) (Main.player[projectile.owner].width / 2)) + num4 = 1; + int num5 = num4 * -1; + Main.player[projectile.owner].itemRotation = (float) Math.Atan2((double) num2 * (double) num5, (double) num1 * (double) num5); } - else - { - if (projectile1.aiStyle == 160) - { - this.DrawKite(projectile1); - return; - } - if (projectile1.aiStyle == 165) - { - this.DrawWhip(projectile1); - return; - } - } - if (projectile1.type == 879 || projectile1.type == 877 || projectile1.type == 878) - projectile1.position.Y -= Main.player[projectile1.owner].gfxOffY; - if (projectile1.aiStyle == 174) - { - this.DrawMultisegmentPet(projectile1); - } - else - { - if (projectile1.type == 34) - new FlameLashDrawer().Draw(projectile1); - if (projectile1.type == 16) - new MagicMissileDrawer().Draw(projectile1); - if (projectile1.type == 933) - new FinalFractalHelper().Draw(projectile1); - if (projectile1.type == 79) - new RainbowRodDrawer().Draw(projectile1); - if (projectile1.type == 919) - this.DrawProj_FairyQueenLance(projectile1); - else if (projectile1.type == 932) - this.DrawProj_FairyQueenRangedItemShot(projectile1); - else if (projectile1.type == 946) - { - EmpressBladeDrawer empressBladeDrawer = new EmpressBladeDrawer(); - float num25 = (float) ((double) Main.GlobalTimeWrappedHourly % 3.0 / 3.0); - float num26 = MathHelper.Max(1f, (float) Main.player[projectile1.owner].maxMinions); - float hueOverride = (float) projectile1.identity % num26 / num26 + num25; - Microsoft.Xna.Framework.Color queenWeaponsColor1 = projectile1.GetFairyQueenWeaponsColor(0.0f, rawHueOverride: new float?(hueOverride % 1f)); - Microsoft.Xna.Framework.Color queenWeaponsColor2 = projectile1.GetFairyQueenWeaponsColor(0.0f, rawHueOverride: new float?((float) (((double) hueOverride + 0.5) % 1.0))); - empressBladeDrawer.ColorStart = queenWeaponsColor1; - empressBladeDrawer.ColorEnd = queenWeaponsColor2; - empressBladeDrawer.Draw(projectile1); - this.DrawProj_EmpressBlade(projectile1, hueOverride); - } - else if (projectile1.type == 927) - this.DrawProj_PiercingStarlight(projectile1); - else if (projectile1.type == 917) - this.DrawProj_CoolWhipMinion(projectile1); - else if (projectile1.type == 923) - { - Vector2 position = projectile1.Center - Main.screenPosition; - Texture2D texture2D = TextureAssets.Projectile[projectile1.type].Value; - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: 2); - Microsoft.Xna.Framework.Rectangle rectangle = texture2D.Frame(verticalFrames: 2, frameY: 1); - Vector2 origin = r.Size() * new Vector2(0.03f, 0.5f); - float from = 180f; - double num27 = (double) projectile1.ai[0] / 6.28318548202515 + (double) projectile1.localAI[0] / (double) from; - float num28 = Utils.GetLerpValue(0.0f, 30f, projectile1.localAI[0], true) * Utils.GetLerpValue(from, from - 30f, projectile1.localAI[0], true); - Microsoft.Xna.Framework.Color color1 = Main.hslToRgb((float) (num27 % 1.0), 1f, 1f) * num28; - float lerpValue = Utils.GetLerpValue(40f, 60f, projectile1.localAI[0], true); - Vector2 scale = new Vector2(1f, MathHelper.Lerp(0.25f, 0.7f, lerpValue)) * projectile1.scale; - Microsoft.Xna.Framework.Color color2 = Main.hslToRgb((float) ((num27 + 0.300000011920929) % 1.0), 1f, MathHelper.Lerp(0.3f, 0.66f, lerpValue)) * num28; - if (NPC.ShouldEmpressBeEnraged()) - color2 = Main.OurFavoriteColor * num28; - Microsoft.Xna.Framework.Color color3 = Microsoft.Xna.Framework.Color.Lerp(color2, Microsoft.Xna.Framework.Color.White, 0.1f); - color3.A /= (byte) 2; - Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(rectangle), color3, projectile1.rotation, origin, scale * 1.2f, SpriteEffects.None, 0.0f); - Microsoft.Xna.Framework.Color color4 = Main.hslToRgb((float) ((num27 + 0.150000005960464) % 1.0), 1f, MathHelper.Lerp(0.3f, 0.5f, lerpValue)) * num28; - if (NPC.ShouldEmpressBeEnraged()) - color4 = Main.OurFavoriteColor * num28; - Microsoft.Xna.Framework.Color color5 = Microsoft.Xna.Framework.Color.Lerp(color4, Microsoft.Xna.Framework.Color.White, 0.1f); - color5.A /= (byte) 2; - Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(rectangle), color5, projectile1.rotation, origin, scale * 1.1f, SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(r), color1 * 0.5f, projectile1.rotation, origin, scale, SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(rectangle), color1 * lerpValue, projectile1.rotation, origin, scale, SpriteEffects.None, 0.0f); - } - else if (projectile1.type == 888) - this.DrawTwinsPet(projectile1); - else if (projectile1.type == 874) - this.DrawMurderAurora(projectile1); - else if (projectile1.type == 871) - { - Texture2D texture2D = TextureAssets.Projectile[projectile1.type].Value; - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: 4); - Vector2 origin = r.Size() / 2f; - Microsoft.Xna.Framework.Color color6 = Microsoft.Xna.Framework.Color.White * projectile1.Opacity; - SpriteEffects effects = SpriteEffects.None; - color6.A /= (byte) 2; - Microsoft.Xna.Framework.Color color7 = projectile1.AI_171_GetColor(); - color7.A /= (byte) 2; - float scale = projectile1.scale * 1.3f; - float num29 = 1f; - int pelletStormsCount = projectile1.AI_172_GetPelletStormsCount(); - bool flag = false; - float num30 = float.PositiveInfinity; - for (int stormIndex = 0; stormIndex < pelletStormsCount; ++stormIndex) - { - Projectile.HallowBossPelletStormInfo pelletStormInfo = projectile1.AI_172_GetPelletStormInfo(stormIndex); - for (int bulletIndex = 0; bulletIndex < pelletStormInfo.BulletsInStorm; ++bulletIndex) - { - float bulletProgress = pelletStormInfo.GetBulletProgress(bulletIndex); - if ((double) bulletProgress < (double) num30) - num30 = bulletProgress; - if (pelletStormInfo.IsValid(bulletIndex)) - { - if (stormIndex == pelletStormsCount - 1 && (double) bulletProgress > 0.0) - flag = true; - r = texture2D.Frame(verticalFrames: 4, frameY: ((int) ((double) (bulletIndex + stormIndex * 6) + Main.timeForVisualEffects / 4.0) % 4)); - float num31 = Utils.GetLerpValue(0.0f, 0.1f, bulletProgress, true) * Utils.GetLerpValue(1f, 0.8f, bulletProgress, true); - Vector2 bulletPosition = pelletStormInfo.GetBulletPosition(bulletIndex, projectile1.Center); - Main.EntitySpriteDraw(texture2D, bulletPosition - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(r), color7 * num31, projectile1.rotation, origin, scale * num29, effects, 0); - Main.EntitySpriteDraw(texture2D, bulletPosition - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(r), color6 * num31, projectile1.rotation, origin, projectile1.scale * num29, effects, 0); - } - } - } - if (flag || (double) num30 > 1.0) - return; - Main.EntitySpriteDraw(texture2D, projectile1.Center - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(r), color7, projectile1.rotation, origin, scale, effects, 0); - Main.EntitySpriteDraw(texture2D, projectile1.Center - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(r), color6, projectile1.rotation, origin, projectile1.scale, effects, 0); - } - else - { - if (projectile1.bobber && Main.player[projectile1.owner].inventory[Main.player[projectile1.owner].selectedItem].holdStyle != 0) - Main.DrawProj_FishingLine(projectile1, ref polePosX, ref polePosY, mountedCenter); - else if (projectile1.type == 32) - { - Vector2 vector2 = new Vector2(projectile1.position.X + (float) projectile1.width * 0.5f, projectile1.position.Y + (float) projectile1.height * 0.5f); - float num32 = mountedCenter.X - vector2.X; - float num33 = mountedCenter.Y - vector2.Y; - float rotation = (float) Math.Atan2((double) num33, (double) num32) - 1.57f; - bool flag = true; - if ((double) num32 == 0.0 && (double) num33 == 0.0) - { - flag = false; - } - else - { - float num34 = 8f / (float) Math.Sqrt((double) num32 * (double) num32 + (double) num33 * (double) num33); - float num35 = num32 * num34; - float num36 = num33 * num34; - vector2.X -= num35; - vector2.Y -= num36; - num32 = mountedCenter.X - vector2.X; - num33 = mountedCenter.Y - vector2.Y; - } - while (flag) - { - float f = (float) Math.Sqrt((double) num32 * (double) num32 + (double) num33 * (double) num33); - if ((double) f < 28.0) - flag = false; - else if (float.IsNaN(f)) - { - flag = false; - } - else - { - float num37 = 28f / f; - float num38 = num32 * num37; - float num39 = num33 * num37; - vector2.X += num38; - vector2.Y += num39; - num32 = mountedCenter.X - vector2.X; - num33 = mountedCenter.Y - vector2.Y; - Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - Main.EntitySpriteDraw(TextureAssets.Chain5.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain5.Width(), TextureAssets.Chain5.Height())), color, rotation, new Vector2((float) TextureAssets.Chain5.Width() * 0.5f, (float) TextureAssets.Chain5.Height() * 0.5f), 1f, SpriteEffects.None, 0); - } - } - } - else if (projectile1.type == 73) - { - Vector2 vector2 = new Vector2(projectile1.position.X + (float) projectile1.width * 0.5f, projectile1.position.Y + (float) projectile1.height * 0.5f); - float num40 = mountedCenter.X - vector2.X; - float num41 = mountedCenter.Y - vector2.Y; - float rotation = (float) Math.Atan2((double) num41, (double) num40) - 1.57f; - bool flag = true; - while (flag) - { - float f = (float) Math.Sqrt((double) num40 * (double) num40 + (double) num41 * (double) num41); - if ((double) f < 25.0) - flag = false; - else if (float.IsNaN(f)) - { - flag = false; - } - else - { - float num42 = 12f / f; - float num43 = num40 * num42; - float num44 = num41 * num42; - vector2.X += num43; - vector2.Y += num44; - num40 = mountedCenter.X - vector2.X; - num41 = mountedCenter.Y - vector2.Y; - Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - Main.EntitySpriteDraw(TextureAssets.Chain8.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain8.Width(), TextureAssets.Chain8.Height())), color, rotation, new Vector2((float) TextureAssets.Chain8.Width() * 0.5f, (float) TextureAssets.Chain8.Height() * 0.5f), 1f, SpriteEffects.None, 0); - } - } - } - else if (projectile1.type == 186) - { - Vector2 vector2 = new Vector2(projectile1.localAI[0], projectile1.localAI[1]); - float num45 = Vector2.Distance(projectile1.Center, vector2) - projectile1.velocity.Length(); - float num46 = (float) TextureAssets.Chain17.Height() - num45; - if ((double) num45 > 0.0 && (double) projectile1.ai[1] > 0.0) - { - Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) projectile1.position.X / 16, (int) projectile1.position.Y / 16); - Main.EntitySpriteDraw(TextureAssets.Chain17.Value, vector2 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, (int) num46, TextureAssets.Chain17.Width(), (int) num45)), color, projectile1.rotation, new Vector2((float) (TextureAssets.Chain17.Width() / 2), 0.0f), 1f, SpriteEffects.None, 0); - } - } - else if (projectile1.type == 74) - { - Vector2 vector2 = new Vector2(projectile1.position.X + (float) projectile1.width * 0.5f, projectile1.position.Y + (float) projectile1.height * 0.5f); - float num47 = mountedCenter.X - vector2.X; - float num48 = mountedCenter.Y - vector2.Y; - float rotation = (float) Math.Atan2((double) num48, (double) num47) - 1.57f; - bool flag = true; - while (flag) - { - float f = (float) Math.Sqrt((double) num47 * (double) num47 + (double) num48 * (double) num48); - if ((double) f < 25.0) - flag = false; - else if (float.IsNaN(f)) - { - flag = false; - } - else - { - float num49 = 12f / f; - float num50 = num47 * num49; - float num51 = num48 * num49; - vector2.X += num50; - vector2.Y += num51; - num47 = mountedCenter.X - vector2.X; - num48 = mountedCenter.Y - vector2.Y; - Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - Main.EntitySpriteDraw(TextureAssets.Chain9.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain8.Width(), TextureAssets.Chain8.Height())), color, rotation, new Vector2((float) TextureAssets.Chain8.Width() * 0.5f, (float) TextureAssets.Chain8.Height() * 0.5f), 1f, SpriteEffects.None, 0); - } - } - } - else if (projectile1.type == 171) - { - Vector2 vector2 = new Vector2(projectile1.position.X + (float) projectile1.width * 0.5f, projectile1.position.Y + (float) projectile1.height * 0.5f); - float num52 = -projectile1.velocity.X; - float num53 = -projectile1.velocity.Y; - float num54 = 1f; - if ((double) projectile1.ai[0] <= 17.0) - num54 = projectile1.ai[0] / 17f; - int length = (int) (30.0 * (double) num54); - float num55 = 1f; - if ((double) projectile1.ai[0] <= 30.0) - num55 = projectile1.ai[0] / 30f; - float num56 = 0.4f * num55; - float num57 = num56; - float num58 = num53 + num57; - Vector2[] vector2Array = new Vector2[length]; - float[] numArray = new float[length]; - for (int index = 0; index < length; ++index) - { - float num59 = (float) Math.Sqrt((double) num52 * (double) num52 + (double) num58 * (double) num58); - float num60 = 5.6f; - if ((double) Math.Abs(num52) + (double) Math.Abs(num58) < 1.0) - num60 *= Math.Abs(num52) + Math.Abs(num58) / 1f; - float num61 = num60 / num59; - float num62 = num52 * num61; - float num63 = num58 * num61; - float num64 = (float) Math.Atan2((double) num63, (double) num62) - 1.57f; - vector2Array[index].X = vector2.X; - vector2Array[index].Y = vector2.Y; - numArray[index] = num64; - vector2.X += num62; - vector2.Y += num63; - num52 = -projectile1.velocity.X; - float num65 = -projectile1.velocity.Y; - num57 += num56; - num58 = num65 + num57; - } - int num66; - for (int index = num66 = length - 1; index >= 0; --index) - { - vector2.X = vector2Array[index].X; - vector2.Y = vector2Array[index].Y; - float rotation = numArray[index]; - Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - Main.EntitySpriteDraw(TextureAssets.Chain16.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain16.Width(), TextureAssets.Chain16.Height())), color, rotation, new Vector2((float) TextureAssets.Chain16.Width() * 0.5f, (float) TextureAssets.Chain16.Height() * 0.5f), 0.8f, SpriteEffects.None, 0); - } - } - else if (projectile1.type == 475) - { - Vector2 vector2 = new Vector2(projectile1.position.X + (float) projectile1.width * 0.5f, projectile1.position.Y + (float) projectile1.height * 0.5f); - float num67 = -projectile1.velocity.X; - float num68 = -projectile1.velocity.Y; - float num69 = 1f; - if ((double) projectile1.ai[0] <= 17.0) - num69 = projectile1.ai[0] / 17f; - int length = (int) (30.0 * (double) num69); - float num70 = 1f; - if ((double) projectile1.ai[0] <= 30.0) - num70 = projectile1.ai[0] / 30f; - float num71 = 0.4f * num70; - float num72 = num71; - float num73 = num68 + num72; - Vector2[] vector2Array = new Vector2[length]; - float[] numArray = new float[length]; - for (int index = 0; index < length; ++index) - { - float num74 = (float) Math.Sqrt((double) num67 * (double) num67 + (double) num73 * (double) num73); - float num75 = 5.6f; - if ((double) Math.Abs(num67) + (double) Math.Abs(num73) < 1.0) - num75 *= Math.Abs(num67) + Math.Abs(num73) / 1f; - float num76 = num75 / num74; - float num77 = num67 * num76; - float num78 = num73 * num76; - float num79 = (float) Math.Atan2((double) num78, (double) num77) - 1.57f; - vector2Array[index].X = vector2.X; - vector2Array[index].Y = vector2.Y; - numArray[index] = num79; - vector2.X += num77; - vector2.Y += num78; - num67 = -projectile1.velocity.X; - float num80 = -projectile1.velocity.Y; - num72 += num71; - num73 = num80 + num72; - } - int num81 = 0; - int num82; - for (int index = num82 = length - 1; index >= 0; --index) - { - vector2.X = vector2Array[index].X; - vector2.Y = vector2Array[index].Y; - float rotation = numArray[index]; - Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - if (num81 % 2 == 0) - Main.EntitySpriteDraw(TextureAssets.Chain38.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain38.Width(), TextureAssets.Chain38.Height())), color, rotation, new Vector2((float) TextureAssets.Chain38.Width() * 0.5f, (float) TextureAssets.Chain38.Height() * 0.5f), 0.8f, SpriteEffects.None, 0); - else - Main.EntitySpriteDraw(TextureAssets.Chain39.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain39.Width(), TextureAssets.Chain39.Height())), color, rotation, new Vector2((float) TextureAssets.Chain39.Width() * 0.5f, (float) TextureAssets.Chain39.Height() * 0.5f), 0.8f, SpriteEffects.None, 0); - ++num81; - } - } - else if (projectile1.type == 505 || projectile1.type == 506) - { - Vector2 vector2 = new Vector2(projectile1.position.X + (float) projectile1.width * 0.5f, projectile1.position.Y + (float) projectile1.height * 0.5f); - float num83 = -projectile1.velocity.X; - float num84 = -projectile1.velocity.Y; - float num85 = 1f; - if ((double) projectile1.ai[0] <= 17.0) - num85 = projectile1.ai[0] / 17f; - int length = (int) (30.0 * (double) num85); - float num86 = 1f; - if ((double) projectile1.ai[0] <= 30.0) - num86 = projectile1.ai[0] / 30f; - float num87 = 0.4f * num86; - float num88 = num87; - float num89 = num84 + num88; - Vector2[] vector2Array = new Vector2[length]; - float[] numArray = new float[length]; - for (int index = 0; index < length; ++index) - { - float num90 = (float) Math.Sqrt((double) num83 * (double) num83 + (double) num89 * (double) num89); - float num91 = 5.6f; - if ((double) Math.Abs(num83) + (double) Math.Abs(num89) < 1.0) - num91 *= Math.Abs(num83) + Math.Abs(num89) / 1f; - float num92 = num91 / num90; - float num93 = num83 * num92; - float num94 = num89 * num92; - float num95 = (float) Math.Atan2((double) num94, (double) num93) - 1.57f; - vector2Array[index].X = vector2.X; - vector2Array[index].Y = vector2.Y; - numArray[index] = num95; - vector2.X += num93; - vector2.Y += num94; - num83 = -projectile1.velocity.X; - float num96 = -projectile1.velocity.Y; - num88 += num87; - num89 = num96 + num88; - } - int num97 = 0; - int num98; - for (int index1 = num98 = length - 1; index1 >= 0; --index1) - { - vector2.X = vector2Array[index1].X; - vector2.Y = vector2Array[index1].Y; - float rotation = numArray[index1]; - Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - int num99 = 4; - if (projectile1.type == 506) - num99 = 6; - int index2 = num99 + num97 % 2; - Main.EntitySpriteDraw(TextureAssets.Chains[index2].Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chains[index2].Width(), TextureAssets.Chains[index2].Height())), color, rotation, new Vector2((float) TextureAssets.Chains[index2].Width() * 0.5f, (float) TextureAssets.Chains[index2].Height() * 0.5f), 0.8f, SpriteEffects.None, 0); - ++num97; - } - } - else if (projectile1.type == 165) - { - Vector2 vector2 = new Vector2(projectile1.position.X + (float) projectile1.width * 0.5f, projectile1.position.Y + (float) projectile1.height * 0.5f); - float num100 = mountedCenter.X - vector2.X; - float num101 = mountedCenter.Y - vector2.Y; - float rotation = (float) Math.Atan2((double) num101, (double) num100) - 1.57f; - bool flag = true; - while (flag) - { - float f = (float) Math.Sqrt((double) num100 * (double) num100 + (double) num101 * (double) num101); - if ((double) f < 25.0) - flag = false; - else if (float.IsNaN(f)) - { - flag = false; - } - else - { - float num102 = 24f / f; - float num103 = num100 * num102; - float num104 = num101 * num102; - vector2.X += num103; - vector2.Y += num104; - num100 = mountedCenter.X - vector2.X; - num101 = mountedCenter.Y - vector2.Y; - Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - Main.EntitySpriteDraw(TextureAssets.Chain15.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain15.Width(), TextureAssets.Chain15.Height())), color, rotation, new Vector2((float) TextureAssets.Chain15.Width() * 0.5f, (float) TextureAssets.Chain15.Height() * 0.5f), 1f, SpriteEffects.None, 0); - } - } - } - else if (projectile1.type >= 230 && projectile1.type <= 235) - { - int index = projectile1.type - 229; - Vector2 vector2 = new Vector2(projectile1.position.X + (float) projectile1.width * 0.5f, projectile1.position.Y + (float) projectile1.height * 0.5f); - float num105 = mountedCenter.X - vector2.X; - float num106 = mountedCenter.Y - vector2.Y; - float rotation = (float) Math.Atan2((double) num106, (double) num105) - 1.57f; - bool flag = true; - while (flag) - { - float f = (float) Math.Sqrt((double) num105 * (double) num105 + (double) num106 * (double) num106); - if ((double) f < 25.0) - flag = false; - else if (float.IsNaN(f)) - { - flag = false; - } - else - { - float num107 = (float) TextureAssets.GemChain[index].Height() / f; - float num108 = num105 * num107; - float num109 = num106 * num107; - vector2.X += num108; - vector2.Y += num109; - num105 = mountedCenter.X - vector2.X; - num106 = mountedCenter.Y - vector2.Y; - Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - Main.EntitySpriteDraw(TextureAssets.GemChain[index].Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.GemChain[index].Width(), TextureAssets.GemChain[index].Height())), color, rotation, new Vector2((float) TextureAssets.GemChain[index].Width() * 0.5f, (float) TextureAssets.GemChain[index].Height() * 0.5f), 1f, SpriteEffects.None, 0); - } - } - } - else if (projectile1.type == 753) - { - Vector2 vector2 = new Vector2(projectile1.position.X + (float) projectile1.width * 0.5f, projectile1.position.Y + (float) projectile1.height * 0.5f); - float num110 = mountedCenter.X - vector2.X; - float num111 = mountedCenter.Y - vector2.Y; - float rotation = (float) Math.Atan2((double) num111, (double) num110) - 1.57f; - bool flag = true; - Texture2D texture2D = TextureAssets.Extra[95].Value; - while (flag) - { - float f = (float) Math.Sqrt((double) num110 * (double) num110 + (double) num111 * (double) num111); - if ((double) f < 25.0) - flag = false; - else if (float.IsNaN(f)) - { - flag = false; - } - else - { - float num112 = (float) texture2D.Height / f; - float num113 = num110 * num112; - float num114 = num111 * num112; - vector2.X += num113; - vector2.Y += num114; - num110 = mountedCenter.X - vector2.X; - num111 = mountedCenter.Y - vector2.Y; - Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - Main.EntitySpriteDraw(texture2D, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(), color, rotation, texture2D.Size() / 2f, 1f, SpriteEffects.None, 0); - } - } - } - else if (projectile1.type == 865) - { - Vector2 vector2 = new Vector2(projectile1.position.X + (float) projectile1.width * 0.5f, projectile1.position.Y + (float) projectile1.height * 0.5f); - float num115 = mountedCenter.X - vector2.X; - float num116 = mountedCenter.Y - vector2.Y; - float rotation = (float) Math.Atan2((double) num116, (double) num115) - 1.57f; - bool flag1 = true; - bool flag2 = true; - Texture2D texture2D = TextureAssets.Extra[154].Value; - while (flag1) - { - float f = (float) Math.Sqrt((double) num115 * (double) num115 + (double) num116 * (double) num116); - if ((double) f < 25.0) - flag1 = false; - else if (float.IsNaN(f)) - { - flag1 = false; - } - else - { - float num117 = (float) texture2D.Height / f; - float num118 = num115 * num117; - float num119 = num116 * num117; - vector2.X += num118; - vector2.Y += num119; - num115 = mountedCenter.X - vector2.X; - num116 = mountedCenter.Y - vector2.Y; - if (!flag2) - { - Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - Main.EntitySpriteDraw(texture2D, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(), color, rotation, texture2D.Size() / 2f, 1f, SpriteEffects.None, 0); - } - flag2 = false; - } - } - } - else if (projectile1.type == 935) - { - Vector2 vector2 = new Vector2(projectile1.position.X + (float) projectile1.width * 0.5f, projectile1.position.Y + (float) projectile1.height * 0.5f); - float num120 = mountedCenter.X - vector2.X; - float num121 = mountedCenter.Y - vector2.Y; - float rotation = (float) Math.Atan2((double) num121, (double) num120) - 1.57f; - bool flag3 = true; - bool flag4 = true; - Texture2D texture2D = TextureAssets.Extra[208].Value; - while (flag3) - { - float f = (float) Math.Sqrt((double) num120 * (double) num120 + (double) num121 * (double) num121); - if ((double) f < 8.0) - flag3 = false; - else if (float.IsNaN(f)) - { - flag3 = false; - } - else - { - float num122 = (float) texture2D.Height / f; - float num123 = num120 * num122; - float num124 = num121 * num122; - vector2.X += num123; - vector2.Y += num124; - num120 = mountedCenter.X - vector2.X; - num121 = mountedCenter.Y - vector2.Y; - if (!flag4) - { - Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - Main.EntitySpriteDraw(texture2D, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(), color, rotation, texture2D.Size() / 2f, 1f, SpriteEffects.None, 0); - } - flag4 = false; - } - } - } - else if (projectile1.type == 256) - { - Vector2 vector2 = new Vector2(projectile1.position.X + (float) projectile1.width * 0.5f, projectile1.position.Y + (float) projectile1.height * 0.5f); - float num125 = mountedCenter.X - vector2.X; - float num126 = mountedCenter.Y - vector2.Y; - float num127 = (float) Math.Atan2((double) num126, (double) num125) - 1.57f; - bool flag = true; - while (flag) - { - float f = (float) Math.Sqrt((double) num125 * (double) num125 + (double) num126 * (double) num126); - if ((double) f < 26.0) - flag = false; - else if (float.IsNaN(f)) - { - flag = false; - } - else - { - float num128 = 26f / f; - float num129 = num125 * num128; - float num130 = num126 * num128; - vector2.X += num129; - vector2.Y += num130; - num125 = Main.player[projectile1.owner].position.X + (float) (Main.player[projectile1.owner].width / 2) - vector2.X; - num126 = Main.player[projectile1.owner].position.Y + (float) (Main.player[projectile1.owner].height / 2) - vector2.Y; - Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - Main.EntitySpriteDraw(TextureAssets.Chain20.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain20.Width(), TextureAssets.Chain20.Height())), color, num127 - 0.785f, new Vector2((float) TextureAssets.Chain20.Width() * 0.5f, (float) TextureAssets.Chain20.Height() * 0.5f), 1f, SpriteEffects.None, 0); - } - } - } - else if (projectile1.type == 322) - { - Vector2 vector2 = new Vector2(projectile1.position.X + (float) projectile1.width * 0.5f, projectile1.position.Y + (float) projectile1.height * 0.5f); - float num131 = mountedCenter.X - vector2.X; - float num132 = mountedCenter.Y - vector2.Y; - float rotation = (float) Math.Atan2((double) num132, (double) num131) - 1.57f; - bool flag = true; - while (flag) - { - float f = (float) Math.Sqrt((double) num131 * (double) num131 + (double) num132 * (double) num132); - if ((double) f < 22.0) - flag = false; - else if (float.IsNaN(f)) - { - flag = false; - } - else - { - float num133 = 22f / f; - float num134 = num131 * num133; - float num135 = num132 * num133; - vector2.X += num134; - vector2.Y += num135; - num131 = mountedCenter.X - vector2.X; - num132 = mountedCenter.Y - vector2.Y; - Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - Main.EntitySpriteDraw(TextureAssets.Chain29.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain29.Width(), TextureAssets.Chain29.Height())), color, rotation, new Vector2((float) TextureAssets.Chain29.Width() * 0.5f, (float) TextureAssets.Chain29.Height() * 0.5f), 1f, SpriteEffects.None, 0); - } - } - } - else if (projectile1.type == 315) - { - Vector2 vector2 = new Vector2(projectile1.position.X + (float) projectile1.width * 0.5f, projectile1.position.Y + (float) projectile1.height * 0.5f); - float num136 = mountedCenter.X - vector2.X; - float num137 = mountedCenter.Y - vector2.Y; - float rotation = (float) Math.Atan2((double) num137, (double) num136) - 1.57f; - bool flag = true; - while (flag) - { - float f = (float) Math.Sqrt((double) num136 * (double) num136 + (double) num137 * (double) num137); - if ((double) f < 50.0) - flag = false; - else if (float.IsNaN(f)) - { - flag = false; - } - else - { - float num138 = 40f / f; - float num139 = num136 * num138; - float num140 = num137 * num138; - vector2.X += num139; - vector2.Y += num140; - num136 = mountedCenter.X - vector2.X; - num137 = mountedCenter.Y - vector2.Y; - Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - Main.EntitySpriteDraw(TextureAssets.Chain28.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain28.Width(), TextureAssets.Chain28.Height())), color, rotation, new Vector2((float) TextureAssets.Chain28.Width() * 0.5f, (float) TextureAssets.Chain28.Height() * 0.5f), 1f, SpriteEffects.None, 0); - } - } - } - else if (projectile1.type == 331) - { - Vector2 vector2 = new Vector2(projectile1.position.X + (float) projectile1.width * 0.5f, projectile1.position.Y + (float) projectile1.height * 0.5f); - float num141 = mountedCenter.X - vector2.X; - float num142 = mountedCenter.Y - vector2.Y; - float rotation = (float) Math.Atan2((double) num142, (double) num141) - 1.57f; - bool flag = true; - while (flag) - { - float f = (float) Math.Sqrt((double) num141 * (double) num141 + (double) num142 * (double) num142); - if ((double) f < 30.0) - flag = false; - else if (float.IsNaN(f)) - { - flag = false; - } - else - { - float num143 = 24f / f; - float num144 = num141 * num143; - float num145 = num142 * num143; - vector2.X += num144; - vector2.Y += num145; - num141 = mountedCenter.X - vector2.X; - num142 = mountedCenter.Y - vector2.Y; - Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - Main.EntitySpriteDraw(TextureAssets.Chain30.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain30.Width(), TextureAssets.Chain30.Height())), color, rotation, new Vector2((float) TextureAssets.Chain30.Width() * 0.5f, (float) TextureAssets.Chain30.Height() * 0.5f), 1f, SpriteEffects.None, 0); - } - } - } - else if (projectile1.type == 332) - { - int num146 = 0; - Vector2 vector2 = new Vector2(projectile1.position.X + (float) projectile1.width * 0.5f, projectile1.position.Y + (float) projectile1.height * 0.5f); - float num147 = mountedCenter.X - vector2.X; - float num148 = mountedCenter.Y - vector2.Y; - float rotation = (float) Math.Atan2((double) num148, (double) num147) - 1.57f; - bool flag = true; - while (flag) - { - float f = (float) Math.Sqrt((double) num147 * (double) num147 + (double) num148 * (double) num148); - if ((double) f < 30.0) - flag = false; - else if (float.IsNaN(f)) - { - flag = false; - } - else - { - int i1 = (int) vector2.X / 16; - int j = (int) vector2.Y / 16; - if (num146 == 0) - Lighting.AddLight(i1, j, 0.0f, 0.2f, 0.2f); - if (num146 == 1) - Lighting.AddLight(i1, j, 0.1f, 0.2f, 0.0f); - if (num146 == 2) - Lighting.AddLight(i1, j, 0.2f, 0.1f, 0.0f); - if (num146 == 3) - Lighting.AddLight(i1, j, 0.2f, 0.0f, 0.2f); - float num149 = 16f / f; - float num150 = num147 * num149; - float num151 = num148 * num149; - vector2.X += num150; - vector2.Y += num151; - num147 = mountedCenter.X - vector2.X; - num148 = mountedCenter.Y - vector2.Y; - Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - Main.EntitySpriteDraw(TextureAssets.Chain31.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, TextureAssets.Chain31.Height() / 4 * num146, TextureAssets.Chain31.Width(), TextureAssets.Chain31.Height() / 4)), color, rotation, new Vector2((float) TextureAssets.Chain30.Width() * 0.5f, (float) (TextureAssets.Chain30.Height() / 8)), 1f, SpriteEffects.None, 0); - Main.EntitySpriteDraw(TextureAssets.Chain32.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, TextureAssets.Chain31.Height() / 4 * num146, TextureAssets.Chain31.Width(), TextureAssets.Chain31.Height() / 4)), new Microsoft.Xna.Framework.Color(200, 200, 200, 0), rotation, new Vector2((float) TextureAssets.Chain30.Width() * 0.5f, (float) (TextureAssets.Chain30.Height() / 8)), 1f, SpriteEffects.None, 0); - ++num146; - if (num146 > 3) - num146 = 0; - } - } - } - else if (projectile1.type == 372 || projectile1.type == 383 || projectile1.type == 396 || projectile1.type == 403 || projectile1.type == 404 || projectile1.type == 446 || projectile1.type >= 486 && projectile1.type <= 489 || projectile1.type >= 646 && projectile1.type <= 649 || projectile1.type == 652) - { - Texture2D texture1 = (Texture2D) null; - Microsoft.Xna.Framework.Color color8 = Microsoft.Xna.Framework.Color.Transparent; - Texture2D texture2 = TextureAssets.Chain33.Value; - if (projectile1.type == 383) - texture2 = TextureAssets.Chain34.Value; - if (projectile1.type == 396) - texture2 = TextureAssets.Chain35.Value; - if (projectile1.type == 403) - texture2 = TextureAssets.Chain36.Value; - if (projectile1.type == 404) - texture2 = TextureAssets.Chain37.Value; - if (projectile1.type == 446) - texture2 = TextureAssets.Extra[3].Value; - if (projectile1.type >= 486 && projectile1.type <= 489) - texture2 = TextureAssets.Chains[projectile1.type - 486].Value; - if (projectile1.type >= 646 && projectile1.type <= 649) - { - texture2 = TextureAssets.Chains[projectile1.type - 646 + 8].Value; - texture1 = TextureAssets.Chains[projectile1.type - 646 + 12].Value; - color8 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue); - } - if (projectile1.type == 652) - texture2 = TextureAssets.Chains[16].Value; - Vector2 position = projectile1.Center; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); - Vector2 origin = new Vector2((float) texture2.Width * 0.5f, (float) texture2.Height * 0.5f); - float height = (float) texture2.Height; - float num152 = 0.0f; - if (projectile1.type == 446) - { - int num153 = 7; - int num154 = (int) projectile1.localAI[0] / num153; - sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, texture2.Height / 4 * num154, texture2.Width, texture2.Height / 4)); - origin.Y /= 4f; - height /= 4f; - } - switch (projectile1.type) - { - case 383: - num152 = 14f; - break; - case 446: - num152 = 20f; - break; - case 487: - num152 = 8f; - break; - case 489: - num152 = 10f; - break; - } - if ((double) num152 != 0.0) - { - float num155 = -1.57f; - Vector2 vector2_1 = new Vector2((float) Math.Cos((double) projectile1.rotation + (double) num155), (float) Math.Sin((double) projectile1.rotation + (double) num155)); - Vector2 vector2_2 = position - vector2_1 * num152; - Vector2 vector2_3 = mountedCenter - vector2_2; - vector2_3.Normalize(); - position = vector2_2 - vector2_3 * height / 2f; - } - Vector2 vector2_4 = mountedCenter - position; - float rotation = (float) Math.Atan2((double) vector2_4.Y, (double) vector2_4.X) - 1.57f; - bool flag = true; - if (float.IsNaN(position.X) && float.IsNaN(position.Y)) - flag = false; - if (float.IsNaN(vector2_4.X) && float.IsNaN(vector2_4.Y)) - flag = false; - while (flag) - { - if ((double) vector2_4.Length() < (double) height + 1.0) - { - flag = false; - } - else - { - Vector2 vector2_5 = vector2_4; - vector2_5.Normalize(); - position += vector2_5 * height; - vector2_4 = mountedCenter - position; - Microsoft.Xna.Framework.Color color9 = Lighting.GetColor((int) position.X / 16, (int) ((double) position.Y / 16.0)); - if (projectile1.type == 396) - color9 *= (float) ((int) byte.MaxValue - projectile1.alpha) / (float) byte.MaxValue; - if (projectile1.type == 446) - color9 = projectile1.GetAlpha(color9); - if (projectile1.type == 488) - { - Lighting.AddLight(position, 0.2f, 0.0f, 0.175f); - color9 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); - } - if (projectile1.type >= 646 && projectile1.type <= 649) - color9 = projectile1.GetAlpha(color9); - Main.EntitySpriteDraw(texture2, position - Main.screenPosition, sourceRectangle, color9, rotation, origin, 1f, SpriteEffects.None, 0); - if (texture1 != null) - Main.EntitySpriteDraw(texture1, position - Main.screenPosition, sourceRectangle, color8, rotation, origin, 1f, SpriteEffects.None, 0); - } - } - } - else if (projectile1.aiStyle == 7) - { - Vector2 vector2 = new Vector2(projectile1.position.X + (float) projectile1.width * 0.5f, projectile1.position.Y + (float) projectile1.height * 0.5f); - float num156 = mountedCenter.X - vector2.X; - float num157 = mountedCenter.Y - vector2.Y; - float rotation = (float) Math.Atan2((double) num157, (double) num156) - 1.57f; - bool flag = true; - while (flag) - { - float f = (float) Math.Sqrt((double) num156 * (double) num156 + (double) num157 * (double) num157); - if ((double) f < 25.0) - flag = false; - else if (float.IsNaN(f)) - { - flag = false; - } - else - { - float num158 = 12f / f; - float num159 = num156 * num158; - float num160 = num157 * num158; - vector2.X += num159; - vector2.Y += num160; - num156 = mountedCenter.X - vector2.X; - num157 = mountedCenter.Y - vector2.Y; - Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - Main.EntitySpriteDraw(TextureAssets.Chain.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain.Width(), TextureAssets.Chain.Height())), color, rotation, new Vector2((float) TextureAssets.Chain.Width() * 0.5f, (float) TextureAssets.Chain.Height() * 0.5f), 1f, SpriteEffects.None, 0); - } - } - } - else if (projectile1.type == 262) - { - float x1 = projectile1.Center.X; - float y1 = projectile1.Center.Y; - float x2 = projectile1.velocity.X; - float y2 = projectile1.velocity.Y; - float num161 = 4f / (float) Math.Sqrt((double) x2 * (double) x2 + (double) y2 * (double) y2); - float x3; - float y3; - if ((double) projectile1.ai[0] == 0.0) - { - x3 = x1 - projectile1.velocity.X * num161; - y3 = y1 - projectile1.velocity.Y * num161; - } - else - { - x3 = x1 + projectile1.velocity.X * num161; - y3 = y1 + projectile1.velocity.Y * num161; - } - Vector2 vector2 = new Vector2(x3, y3); - float num162 = mountedCenter.X - vector2.X; - float num163 = mountedCenter.Y - vector2.Y; - float rotation = (float) Math.Atan2((double) num163, (double) num162) - 1.57f; - if (projectile1.alpha == 0) - { - int num164 = -1; - if ((double) projectile1.position.X + (double) (projectile1.width / 2) < (double) mountedCenter.X) - num164 = 1; - Main.player[projectile1.owner].itemRotation = Main.player[projectile1.owner].direction != 1 ? (float) Math.Atan2((double) num163 * (double) num164, (double) num162 * (double) num164) : (float) Math.Atan2((double) num163 * (double) num164, (double) num162 * (double) num164); - } - bool flag = true; - while (flag) - { - float f = (float) Math.Sqrt((double) num162 * (double) num162 + (double) num163 * (double) num163); - if ((double) f < 25.0) - flag = false; - else if (float.IsNaN(f)) - { - flag = false; - } - else - { - float num165 = 12f / f; - float num166 = num162 * num165; - float num167 = num163 * num165; - vector2.X += num166; - vector2.Y += num167; - num162 = mountedCenter.X - vector2.X; - num163 = mountedCenter.Y - vector2.Y; - Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - Main.EntitySpriteDraw(TextureAssets.Chain22.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain22.Width(), TextureAssets.Chain22.Height())), color, rotation, new Vector2((float) TextureAssets.Chain22.Width() * 0.5f, (float) TextureAssets.Chain22.Height() * 0.5f), 1f, SpriteEffects.None, 0); - } - } - } - else if (projectile1.type == 273) - { - float x4 = projectile1.Center.X; - float y4 = projectile1.Center.Y; - float x5 = projectile1.velocity.X; - float y5 = projectile1.velocity.Y; - float num168 = 4f / (float) Math.Sqrt((double) x5 * (double) x5 + (double) y5 * (double) y5); - float x6; - float y6; - if ((double) projectile1.ai[0] == 0.0) - { - x6 = x4 - projectile1.velocity.X * num168; - y6 = y4 - projectile1.velocity.Y * num168; - } - else - { - x6 = x4 + projectile1.velocity.X * num168; - y6 = y4 + projectile1.velocity.Y * num168; - } - Vector2 vector2 = new Vector2(x6, y6); - float num169 = mountedCenter.X - vector2.X; - float num170 = mountedCenter.Y - vector2.Y; - float rotation = (float) Math.Atan2((double) num170, (double) num169) - 1.57f; - if (projectile1.alpha == 0) - { - int num171 = -1; - if ((double) projectile1.position.X + (double) (projectile1.width / 2) < (double) mountedCenter.X) - num171 = 1; - Main.player[projectile1.owner].itemRotation = Main.player[projectile1.owner].direction != 1 ? (float) Math.Atan2((double) num170 * (double) num171, (double) num169 * (double) num171) : (float) Math.Atan2((double) num170 * (double) num171, (double) num169 * (double) num171); - } - bool flag = true; - while (flag) - { - float f = (float) Math.Sqrt((double) num169 * (double) num169 + (double) num170 * (double) num170); - if ((double) f < 25.0) - flag = false; - else if (float.IsNaN(f)) - { - flag = false; - } - else - { - float num172 = 12f / f; - float num173 = num169 * num172; - float num174 = num170 * num172; - vector2.X += num173; - vector2.Y += num174; - num169 = mountedCenter.X - vector2.X; - num170 = mountedCenter.Y - vector2.Y; - Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - Main.EntitySpriteDraw(TextureAssets.Chain23.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain23.Width(), TextureAssets.Chain23.Height())), color, rotation, new Vector2((float) TextureAssets.Chain23.Width() * 0.5f, (float) TextureAssets.Chain23.Height() * 0.5f), 1f, SpriteEffects.None, 0); - } - } - } - else if (projectile1.type == 481) - { - float x7 = projectile1.Center.X; - float y7 = projectile1.Center.Y; - float x8 = projectile1.velocity.X; - float y8 = projectile1.velocity.Y; - float num175 = 4f / (float) Math.Sqrt((double) x8 * (double) x8 + (double) y8 * (double) y8); - float x9; - float y9; - if ((double) projectile1.ai[0] == 0.0) - { - x9 = x7 - projectile1.velocity.X * num175; - y9 = y7 - projectile1.velocity.Y * num175; - } - else - { - x9 = x7 + projectile1.velocity.X * num175; - y9 = y7 + projectile1.velocity.Y * num175; - } - Vector2 vector2 = new Vector2(x9, y9); - float num176 = mountedCenter.X - vector2.X; - float num177 = mountedCenter.Y - vector2.Y; - float rotation = (float) Math.Atan2((double) num177, (double) num176) - 1.57f; - if (projectile1.alpha == 0) - { - int num178 = -1; - if ((double) projectile1.position.X + (double) (projectile1.width / 2) < (double) mountedCenter.X) - num178 = 1; - Main.player[projectile1.owner].itemRotation = Main.player[projectile1.owner].direction != 1 ? (float) Math.Atan2((double) num177 * (double) num178, (double) num176 * (double) num178) : (float) Math.Atan2((double) num177 * (double) num178, (double) num176 * (double) num178); - } - bool flag = true; - while (flag) - { - float scale = 0.85f; - float f3 = (float) Math.Sqrt((double) num176 * (double) num176 + (double) num177 * (double) num177); - float num179 = f3; - if ((double) f3 < (double) TextureAssets.Chain40.Height() * 1.5) - flag = false; - else if (float.IsNaN(f3)) - { - flag = false; - } - else - { - float num180 = (float) TextureAssets.Chain40.Height() * scale / f3; - float num181 = num176 * num180; - float num182 = num177 * num180; - vector2.X += num181; - vector2.Y += num182; - num176 = mountedCenter.X - vector2.X; - num177 = mountedCenter.Y - vector2.Y; - if ((double) num179 > (double) (TextureAssets.Chain40.Height() * 2)) - { - for (int index = 0; index < 2; ++index) - { - float num183 = 0.75f; - float num184 = index != 0 ? Math.Abs(Main.player[projectile1.owner].velocity.Y) : Math.Abs(Main.player[projectile1.owner].velocity.X); - if ((double) num184 > 10.0) - num184 = 10f; - float num185 = num184 / 10f; - float num186 = num183 * num185; - float num187 = num179 / 80f; - if ((double) num187 > 1.0) - num187 = 1f; - float f4 = num186 * num187; - if ((double) f4 < 0.0) - f4 = 0.0f; - if (!float.IsNaN(f4)) - { - if (index == 0) - { - if ((double) Main.player[projectile1.owner].velocity.X < 0.0 && (double) projectile1.Center.X < (double) mountedCenter.X) - num177 *= 1f - f4; - if ((double) Main.player[projectile1.owner].velocity.X > 0.0 && (double) projectile1.Center.X > (double) mountedCenter.X) - num177 *= 1f - f4; - } - else - { - if ((double) Main.player[projectile1.owner].velocity.Y < 0.0 && (double) projectile1.Center.Y < (double) mountedCenter.Y) - num176 *= 1f - f4; - if ((double) Main.player[projectile1.owner].velocity.Y > 0.0 && (double) projectile1.Center.Y > (double) mountedCenter.Y) - num176 *= 1f - f4; - } - } - } - } - Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - Main.EntitySpriteDraw(TextureAssets.Chain40.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain40.Width(), TextureAssets.Chain40.Height())), color, rotation, new Vector2((float) TextureAssets.Chain40.Width() * 0.5f, (float) TextureAssets.Chain40.Height() * 0.5f), scale, SpriteEffects.None, 0); - } - } - } - else if (projectile1.type == 271) - { - float x10 = projectile1.Center.X; - float y10 = projectile1.Center.Y; - float x11 = projectile1.velocity.X; - float y11 = projectile1.velocity.Y; - float num188 = 4f / (float) Math.Sqrt((double) x11 * (double) x11 + (double) y11 * (double) y11); - float x12; - float y12; - if ((double) projectile1.ai[0] == 0.0) - { - x12 = x10 - projectile1.velocity.X * num188; - y12 = y10 - projectile1.velocity.Y * num188; - } - else - { - x12 = x10 + projectile1.velocity.X * num188; - y12 = y10 + projectile1.velocity.Y * num188; - } - Vector2 vector2 = new Vector2(x12, y12); - float num189 = mountedCenter.X - vector2.X; - float num190 = mountedCenter.Y - vector2.Y; - float rotation = (float) Math.Atan2((double) num190, (double) num189) - 1.57f; - if (projectile1.alpha == 0) - { - int num191 = -1; - if ((double) projectile1.position.X + (double) (projectile1.width / 2) < (double) mountedCenter.X) - num191 = 1; - Main.player[projectile1.owner].itemRotation = Main.player[projectile1.owner].direction != 1 ? (float) Math.Atan2((double) num190 * (double) num191, (double) num189 * (double) num191) : (float) Math.Atan2((double) num190 * (double) num191, (double) num189 * (double) num191); - } - bool flag = true; - while (flag) - { - float f = (float) Math.Sqrt((double) num189 * (double) num189 + (double) num190 * (double) num190); - if ((double) f < 25.0) - flag = false; - else if (float.IsNaN(f)) - { - flag = false; - } - else - { - float num192 = 12f / f; - float num193 = num189 * num192; - float num194 = num190 * num192; - vector2.X += num193; - vector2.Y += num194; - num189 = mountedCenter.X - vector2.X; - num190 = mountedCenter.Y - vector2.Y; - Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - Main.EntitySpriteDraw(TextureAssets.Chain18.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain18.Width(), TextureAssets.Chain18.Height())), color, rotation, new Vector2((float) TextureAssets.Chain18.Width() * 0.5f, (float) TextureAssets.Chain18.Height() * 0.5f), 1f, SpriteEffects.None, 0); - } - } - } - else if (projectile1.aiStyle == 13) - { - float num195 = projectile1.position.X + 8f; - float num196 = projectile1.position.Y + 2f; - float x13 = projectile1.velocity.X; - float num197 = projectile1.velocity.Y; - if ((double) x13 == 0.0 && (double) num197 == 0.0) - num197 = 0.0001f; - float num198 = 20f / (float) Math.Sqrt((double) x13 * (double) x13 + (double) num197 * (double) num197); - float x14; - float y; - if ((double) projectile1.ai[0] == 0.0) - { - x14 = num195 - projectile1.velocity.X * num198; - y = num196 - projectile1.velocity.Y * num198; - } - else - { - x14 = num195 + projectile1.velocity.X * num198; - y = num196 + projectile1.velocity.Y * num198; - } - Vector2 vector2 = new Vector2(x14, y); - float num199 = mountedCenter.X - vector2.X; - float num200 = mountedCenter.Y - vector2.Y; - float rotation = (float) Math.Atan2((double) num200, (double) num199) - 1.57f; - if (projectile1.alpha == 0) - { - int num201 = -1; - if ((double) projectile1.position.X + (double) (projectile1.width / 2) < (double) mountedCenter.X) - num201 = 1; - Main.player[projectile1.owner].itemRotation = Main.player[projectile1.owner].direction != 1 ? (float) Math.Atan2((double) num200 * (double) num201, (double) num199 * (double) num201) : (float) Math.Atan2((double) num200 * (double) num201, (double) num199 * (double) num201); - } - bool flag = true; - while (flag) - { - float f = (float) Math.Sqrt((double) num199 * (double) num199 + (double) num200 * (double) num200); - if ((double) f < 25.0) - flag = false; - else if (float.IsNaN(f)) - { - flag = false; - } - else - { - float num202 = 12f / f; - float num203 = num199 * num202; - float num204 = num200 * num202; - vector2.X += num203; - vector2.Y += num204; - num199 = mountedCenter.X - vector2.X; - num200 = mountedCenter.Y - vector2.Y; - Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - Main.EntitySpriteDraw(TextureAssets.Chain.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain.Width(), TextureAssets.Chain.Height())), color, rotation, new Vector2((float) TextureAssets.Chain.Width() * 0.5f, (float) TextureAssets.Chain.Height() * 0.5f), 1f, SpriteEffects.None, 0); - } - } - } - else if (projectile1.type == 190) - { - float x15 = projectile1.position.X + (float) (projectile1.width / 2); - float y13 = projectile1.position.Y + (float) (projectile1.height / 2); - float x16 = projectile1.velocity.X; - float y14 = projectile1.velocity.Y; - Math.Sqrt((double) x16 * (double) x16 + (double) y14 * (double) y14); - Vector2 vector2 = new Vector2(x15, y13); - float num205 = mountedCenter.X - vector2.X; - float num206 = mountedCenter.Y + Main.player[projectile1.owner].gfxOffY - vector2.Y; - Math.Atan2((double) num206, (double) num205); - if (projectile1.alpha == 0) - { - int num207 = -1; - if ((double) projectile1.position.X + (double) (projectile1.width / 2) < (double) mountedCenter.X) - num207 = 1; - Main.player[projectile1.owner].itemRotation = Main.player[projectile1.owner].direction != 1 ? (float) Math.Atan2((double) num206 * (double) num207, (double) num205 * (double) num207) : (float) Math.Atan2((double) num206 * (double) num207, (double) num205 * (double) num207); - } - } - else if (projectile1.aiStyle == 15) - Main.DrawProj_FlailChains(projectile1, mountedCenter); - Microsoft.Xna.Framework.Color color10 = Lighting.GetColor((int) ((double) projectile1.position.X + (double) projectile1.width * 0.5) / 16, (int) (((double) projectile1.position.Y + (double) projectile1.height * 0.5) / 16.0)); - if (projectile1.hide && !ProjectileID.Sets.DontAttachHideToAlpha[projectile1.type]) - color10 = Lighting.GetColor((int) mountedCenter.X / 16, (int) ((double) mountedCenter.Y / 16.0)); - if (projectile1.type == 14) - color10 = Microsoft.Xna.Framework.Color.White; - int num208 = 0; - int num209 = 0; - if (projectile1.type == 175) - num208 = 10; - if (projectile1.type == 392) - num208 = -2; - if (projectile1.type == 499) - num208 = 12; - if (projectile1.type == 765) - { - num208 = 22; - num209 = -16; - } - if (projectile1.bobber) - num208 = 8; - if (projectile1.type == 519) - { - num208 = 6; - num209 -= 6; - } - if (projectile1.type == 520) - num208 = 12; - if (projectile1.type == 492) - { - num209 -= 4; - num208 += 5; - } - if (projectile1.type == 498) - num208 = 6; - if (projectile1.type == 489) - num208 = -2; - if (projectile1.type == 486) - num208 = -6; - if (projectile1.type == 525) - num208 = 5; - if (projectile1.type == 488) - num209 -= 8; - if (projectile1.type == 373) - { - num209 = -10; - num208 = 6; - } - if (projectile1.type == 375) - { - num209 = -11; - num208 = 12; - } - if (projectile1.type == 423) - num209 = -5; - if (projectile1.type == 346) - num208 = 4; - if (projectile1.type == 331) - num209 = -4; - if (projectile1.type == 254) - num208 = 3; - if (projectile1.type == 273) - num209 = 2; - if (projectile1.type == 335) - num208 = 6; - if (projectile1.type == 162) - { - num208 = 1; - num209 = 1; - } - if (projectile1.type == 377) - num208 = -6; - if (projectile1.type == 353) - { - num208 = 36; - num209 = -12; - } - if (projectile1.type == 324) - { - num208 = 22; - num209 = -6; - } - if (projectile1.type == 266) - { - num208 = 10; - num209 = -10; - } - if (projectile1.type == 319) - { - num208 = 10; - num209 = -12; - } - if (projectile1.type == 315) - { - num208 = -13; - num209 = -6; - } - if (projectile1.type == 313 && projectile1.height != 54) - { - num209 = -12; - num208 = 20; - } - if (projectile1.type == 314) - { - num209 = -8; - num208 = 0; - } - if (projectile1.type == 269) - { - num208 = 18; - num209 = -14; - } - if (projectile1.type == 268) - { - num208 = 22; - num209 = -2; - } - if (projectile1.type == 18) - { - num208 = 3; - num209 = 3; - } - if (projectile1.type == 16) - num208 = 6; - if (projectile1.type == 17 || projectile1.type == 31) - num208 = 2; - if (projectile1.type == 25 || projectile1.type == 26 || projectile1.type == 35 || projectile1.type == 63 || projectile1.type == 154) - { - num208 = 6; - num209 -= 6; - } - if (projectile1.type == 947 || projectile1.type == 948) - { - num208 = 4; - num209 -= 4; - } - if (projectile1.type == 28 || projectile1.type == 37 || projectile1.type == 75) - num208 = 8; - if (projectile1.type == 29 || projectile1.type == 470 || projectile1.type == 637) - num208 = 11; - if (projectile1.type == 43) - num208 = 4; - if (projectile1.type == 208) - { - num208 = 2; - num209 -= 12; - } - if (projectile1.type == 209) - { - num208 = 4; - num209 -= 8; - } - if (projectile1.type == 210) - { - num208 = 2; - num209 -= 22; - } - if (projectile1.type == 251) - { - num208 = 18; - num209 -= 10; - } - if (projectile1.type == 163 || projectile1.type == 310) - num208 = 10; - if (projectile1.type == 69 || projectile1.type == 70) - { - num208 = 4; - num209 = 4; - } - float x17 = (float) ((double) (TextureAssets.Projectile[projectile1.type].Width() - projectile1.width) * 0.5 + (double) projectile1.width * 0.5); - if (projectile1.type == 50 || projectile1.type == 53 || projectile1.type == 515 || projectile1.type == 870) - num209 = -8; - if (projectile1.type == 473) - { - num209 = -6; - num208 = 2; - } - if (projectile1.type == 72 || projectile1.type == 86 || projectile1.type == 87) - { - num209 = -16; - num208 = 8; - } - if (projectile1.type == 74) - num209 = -6; - if (projectile1.type == 138 || projectile1.type == 484) - num208 = 1; - if (projectile1.type == 655) - num208 = 1; - if (projectile1.type == 111) - { - num208 = 18; - num209 = -16; - } - if (projectile1.type == 875) - { - num208 = 16; - num209 = -16; - } - if (projectile1.type == 881) - { - num208 = 14; - num209 = -8; - } - if (projectile1.type == 934) - { - num208 = 14; - num209 = -20; - } - if (projectile1.type == 884) - { - num208 = 16; - num209 = -12; - } - if (projectile1.type == 890) - { - num208 = 26; - num209 = -9; - } - if (projectile1.type == 891) - { - num208 = 30; - num209 = -12; - } - if (projectile1.type == 897) - { - num208 = 38; - num209 = -13; - } - if (projectile1.type == 899) - { - num208 = 28; - num209 = -12; - } - if (projectile1.type == 900) - { - num208 = 54; - num209 = -30; - } - if (projectile1.type == 334) - { - num209 = -18; - num208 = 8; - } - if (projectile1.type == 816) - { - num209 = -19; - num208 = 6; - } - if (projectile1.type == 821) - { - num209 = -10; - num208 = 6; - } - if (projectile1.type == 825) - { - num209 = -19; - num208 = 14; - } - if (projectile1.type == 854) - { - num209 = -14; - num208 = -4; - } - if (projectile1.type == 858) - { - num209 = -8; - num208 = 16; - } - if (projectile1.type == 859) - { - num209 = -8; - num208 = 8; - } - if (projectile1.type == 860) - { - num209 = -8; - num208 = 34; - } - if (projectile1.type == 200) - { - num208 = 12; - num209 = -12; - } - if (projectile1.type == 211) - { - num208 = 14; - num209 = 0; - } - if (projectile1.type == 236) - { - num208 = 30; - num209 = -14; - } - if (projectile1.type >= 191 && projectile1.type <= 194) - { - num208 = 26; - num209 = projectile1.direction != 1 ? -22 : -10; - } - if (projectile1.type >= 390 && projectile1.type <= 392) - num209 = 4 * projectile1.direction; - if (projectile1.type == 112) - num208 = 12; - int type1 = projectile1.type; - if (projectile1.type == 517 || projectile1.type == 681) - num208 = 6; - if (projectile1.type == 516) - num208 = 6; - if (projectile1.type == (int) sbyte.MaxValue) - num208 = 8; - if (projectile1.type == 155) - { - num208 = 3; - num209 = 3; - } - if (projectile1.type == 397) - { - --x17; - num208 = -2; - num209 = -2; - } - if (projectile1.type == 398) - num208 = 8; - SpriteEffects spriteEffects = SpriteEffects.None; - if (projectile1.spriteDirection == -1) - spriteEffects = SpriteEffects.FlipHorizontally; - if (projectile1.type == 681 && (double) projectile1.velocity.X > 0.0) - spriteEffects ^= SpriteEffects.FlipHorizontally; - if (projectile1.type == 221) - { - for (int index = 1; index < 10; ++index) - { - float num210 = (float) ((double) projectile1.velocity.X * (double) index * 0.5); - float num211 = (float) ((double) projectile1.velocity.Y * (double) index * 0.5); - Microsoft.Xna.Framework.Color alpha = projectile1.GetAlpha(color10); - float num212 = 0.0f; - if (index == 1) - num212 = 0.9f; - if (index == 2) - num212 = 0.8f; - if (index == 3) - num212 = 0.7f; - if (index == 4) - num212 = 0.6f; - if (index == 5) - num212 = 0.5f; - if (index == 6) - num212 = 0.4f; - if (index == 7) - num212 = 0.3f; - if (index == 8) - num212 = 0.2f; - if (index == 9) - num212 = 0.1f; - alpha.R = (byte) ((double) alpha.R * (double) num212); - alpha.G = (byte) ((double) alpha.G * (double) num212); - alpha.B = (byte) ((double) alpha.B * (double) num212); - alpha.A = (byte) ((double) alpha.A * (double) num212); - int height = TextureAssets.Projectile[projectile1.type].Height() / Main.projFrames[projectile1.type]; - int y = height * projectile1.frame; - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, new Vector2(projectile1.position.X - Main.screenPosition.X + x17 + (float) num209 - num210, projectile1.position.Y - Main.screenPosition.Y + (float) (projectile1.height / 2) + projectile1.gfxOffY - num211), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y, TextureAssets.Projectile[projectile1.type].Width(), height)), alpha, projectile1.rotation, new Vector2(x17, (float) (projectile1.height / 2 + num208)), projectile1.scale, spriteEffects, 0); - } - } - if (projectile1.type == 408 || projectile1.type == 435 || projectile1.type == 436 || projectile1.type == 438 || projectile1.type == 452 || projectile1.type == 454 || projectile1.type == 459 || projectile1.type == 462 || projectile1.type == 503 || projectile1.type == 532 || projectile1.type == 533 || projectile1.type == 573 || projectile1.type == 582 || projectile1.type == 585 || projectile1.type == 592 || projectile1.type == 601 || projectile1.type == 636 || projectile1.type == 638 || projectile1.type == 640 || projectile1.type == 639 || projectile1.type == 424 || projectile1.type == 425 || projectile1.type == 426 || projectile1.type == 660 || projectile1.type == 661 || projectile1.type == 671 || projectile1.type == 664 || projectile1.type == 666 || projectile1.type == 668 || projectile1.type == 675 || projectile1.type == 680 || projectile1.type == 682 || projectile1.type == 684 || projectile1.type == 686 || projectile1.type == 700 || projectile1.type == 706 || projectile1.type == 709 || projectile1.type == 710 || projectile1.type == 711 || projectile1.type == 261 || ProjectileID.Sets.IsAGolfBall[projectile1.type] || projectile1.type == 729 || projectile1.type == 732 || projectile1.type == 731 || projectile1.type == 755 || projectile1.type == 811 || projectile1.type == 814 || projectile1.type == 819 || projectile1.type == 864 || projectile1.type == 873 || projectile1.type == 872 || projectile1.type == 833 || projectile1.type == 834 || projectile1.type == 835 || projectile1.type == 818 || projectile1.type == 902 || projectile1.type == 894 || projectile1.type == 901 || projectile1.type == 909 || projectile1.type == 916 || projectile1.type == 931 || projectile1.type == 933) - { - Texture2D texture2D1 = TextureAssets.Projectile[projectile1.type].Value; - int height = TextureAssets.Projectile[projectile1.type].Height() / Main.projFrames[projectile1.type]; - Microsoft.Xna.Framework.Rectangle r1 = new Microsoft.Xna.Framework.Rectangle(0, height * projectile1.frame, texture2D1.Width, height); - Vector2 origin1 = r1.Size() / 2f; - Vector2 zero = Vector2.Zero; - float num213 = 0.0f; - if (projectile1.type == 503) - origin1.Y = 70f; - if (projectile1.type == 686 || projectile1.type == 711) - origin1.Y = (float) (r1.Height - 70); - if (projectile1.type == 438) - r1.Y = 0; - if (projectile1.type == 452) - r1.Y = 0; - if (projectile1.type == 408) - r1.Y = height; - if (projectile1.type == 636) - origin1.Y = 10f; - if (projectile1.type == 638) - origin1.Y = 2f; - if (projectile1.type == 640 || projectile1.type == 639 || projectile1.type == 710) - origin1.Y = 5f; - if (projectile1.type == 700) - origin1.X = projectile1.spriteDirection == 1 ? (float) (r1.Width - 20) : 20f; - if (projectile1.type == 872) - { - r1.Width /= 2; - origin1.X /= 2f; - } - if (projectile1.type == 933) - { - int index = (int) projectile1.ai[1]; - if (TextureAssets.Item.IndexInRange>(index)) - { - Main.instance.LoadItem(index); - texture2D1 = TextureAssets.Item[index].Value; - r1 = texture2D1.Frame(); - origin1 = r1.Size() / 2f; - num213 = -0.7853982f * (float) projectile1.spriteDirection; - } - } - if (projectile1.type == 833 && projectile1.frame != 8) - { - zero.Y += (float) (projectile1.height / 2); - origin1 = r1.Size() * new Vector2(0.5f, 1f); - origin1.Y -= 4f; - origin1.X -= (float) (7 * spriteEffects.HasFlag((Enum) SpriteEffects.FlipHorizontally).ToDirectionInt()); - } - if ((projectile1.type == 834 || projectile1.type == 835) && projectile1.frame != 10) - { - zero.Y += (float) (projectile1.height / 2); - origin1 = r1.Size() * new Vector2(0.5f, 1f); - origin1.Y -= 4f; - origin1.X -= (float) (2 * spriteEffects.HasFlag((Enum) SpriteEffects.FlipHorizontally).ToDirectionInt()); - } - int num214 = 8; - int num215 = 2; - int num216 = 1; - float num217 = 1f; - float num218 = 15f; - float num219 = 0.0f; - Microsoft.Xna.Framework.Rectangle rectangle1 = r1; - UnifiedRandom r2 = (UnifiedRandom) null; - if (projectile1.type == 503) - { - num214 = 9; - num215 = 3; - num217 = 0.5f; - } - else if (projectile1.type == 261) - { - num216 = 18; - num214 = 0; - num215 = -2; - num217 = 1.3f; - } - else if (projectile1.type == 833 || projectile1.type == 834 || projectile1.type == 835) - { - num216 = 6; - num214 = 0; - num215 = -1; - num217 = 1.5f; - } - else if (projectile1.type == 818) - { - num216 = 18; - num214 = 0; - num215 = -2; - num217 = 1f; - } - else if (projectile1.type == 729) - { - num216 = 18; - num214 = 0; - num215 = -2; - num217 = 1.3f; - } - else if (projectile1.type == 686 || projectile1.type == 711) - { - num216 = 19; - num214 = 0; - num215 = -3; - num217 = 0.5f; - } - else if (ProjectileID.Sets.IsAGolfBall[projectile1.type]) - { - num216 = 0; - num214 = 0; - num215 = -1; - num217 = 2f; - } - else if (projectile1.type == 671) - { - num216 = 5; - num214 = 0; - num215 = -1; - num217 = 2.6f; - } - else if (projectile1.type == 811) - { - num216 = 5; - num214 = 0; - num215 = -1; - num217 = 2.6f; - } - else if (projectile1.type == 814) - { - num216 = 18; - num214 = 0; - num215 = -1; - num217 = 1f; - } - else if (projectile1.type == 755) - { - num216 = 5; - num214 = 0; - num215 = -1; - num217 = 2.6f; - } - else if (projectile1.type == 700) - { - num214 = 5; - num215 = 1; - num217 = 2.6f; - } - else if (projectile1.type == 731) - { - num216 = 19; - num214 = 0; - num215 = -1; - num217 = 0.5f; - } - else if (projectile1.type == 864) - { - num216 = 12; - num214 = 0; - num215 = -1; - num217 = 1.4f; - rectangle1.Y += rectangle1.Height; - } - else if (projectile1.type == 916) - { - num216 = 19; - num214 = 0; - num215 = -1; - num217 = 1.4f; - rectangle1.Y += rectangle1.Height; - r2 = new UnifiedRandom(projectile1.timeLeft); - } - else if (projectile1.type == 873) - { - num216 = 39; - num218 = 40f; - num214 = 0; - num215 = -1; - num217 = 1.4f; - } - else if (projectile1.type == 931) - { - num216 = 19; - num218 = 20f; - num214 = 0; - num215 = -1; - num217 = 0.7f; - } - else if (projectile1.type == 933) - { - num216 = 60; - num218 = 60f; - num214 = 0; - num215 = -15; - num217 = 1f; - } - else if (projectile1.type == 872) - { - num216 = 79; - num218 = 10f; - num214 = 0; - num215 = -1; - num217 = 1f; - rectangle1.X += rectangle1.Width; - } - else if (projectile1.type == 664 || projectile1.type == 666 || projectile1.type == 668) - { - num214 = 8; - num215 = 2; - num217 = 0.4f; - } - else if (projectile1.type == 582 || projectile1.type == 902) - { - num214 = 10; - num215 = 2; - num217 = 0.7f; - num219 = 0.2f; - } - else if (projectile1.type == 675) - { - num214 = 5; - num215 = 1; - num217 = 0.4f; - } - else if (projectile1.type == 638) - { - num214 = 5; - num215 = 1; - num217 = 1f; - } - else if (projectile1.type == 660) - { - num214 = 3; - num215 = 1; - num217 = 8f; - r1 = new Microsoft.Xna.Framework.Rectangle(38 * projectile1.frame, 0, 38, 38); - rectangle1 = r1; - origin1 = r1.Size() / 2f; - } - else if (projectile1.type == 684) - { - num214 = 8; - num215 = 1; - num217 = 0.75f; - } - else if (projectile1.type == 639) - { - num214 = 10; - num215 = 1; - num217 = 1f; - } - else if (projectile1.type == 710) - { - num216 = 9; - num214 = 0; - num215 = -2; - num217 = 0.5f; - } - else if (projectile1.type == 640) - { - num214 = 20; - num215 = 1; - num217 = 1f; - } - else if (projectile1.type == 436) - { - num215 = 2; - num217 = 0.5f; - } - else if (projectile1.type == 424 || projectile1.type == 425 || projectile1.type == 426) - { - num214 = 10; - num215 = 2; - num217 = 0.6f; - } - else if (projectile1.type == 438) - { - num214 = 10; - num215 = 2; - num217 = 1f; - } - else if (projectile1.type == 452) - { - num214 = 10; - num215 = 3; - num217 = 0.5f; - } - else if (projectile1.type == 454) - { - num214 = 5; - num215 = 1; - num217 = 0.2f; - } - else if (projectile1.type == 462) - { - num214 = 7; - num215 = 1; - num217 = 0.2f; - } - else if (projectile1.type == 661) - { - num214 = 0; - num215 = 1; - num217 = 0.5f; - } - else if (projectile1.type == 706) - { - num216 = 9; - num214 = 0; - num215 = -2; - num217 = 0.5f; - } - else if (projectile1.type == 585) - { - num214 = 7; - num215 = 1; - num217 = 0.2f; - } - else if (projectile1.type == 459) - { - num214 = (int) ((double) projectile1.scale * 8.0); - num215 = num214 / 4; - if (num215 < 1) - num215 = 1; - num217 = 0.3f; - } - else if (projectile1.type == 709) - { - num214 = 8; - num215 = num214 / 4; - if (num215 < 1) - num215 = 1; - num217 = 0.5f; - } - else if (projectile1.type == 532) - { - num214 = 10; - num215 = 1; - num217 = 0.7f; - num219 = 0.2f; - } - else if (projectile1.type == 592) - { - num214 = 10; - num215 = 2; - num217 = 1f; - } - else if (projectile1.type == 601) - { - num214 = 8; - num215 = 1; - num217 = 0.3f; - } - else if (projectile1.type == 636) - { - num214 = 20; - num215 = 3; - num217 = 0.5f; - } - else if (projectile1.type == 680) - { - num214 = 9; - num215 = 3; - num217 = 0.5f; - } - else if (projectile1.type == 533) - { - if ((double) projectile1.ai[0] >= 6.0 && (double) projectile1.ai[0] <= 8.0) - { - num214 = (double) projectile1.ai[0] == 6.0 ? 8 : 4; - num215 = 1; - if ((double) projectile1.ai[0] != 7.0) - num219 = 0.2f; - } - else - num214 = num215 = 0; - } - for (int index = num216; num215 > 0 && index < num214 || num215 < 0 && index > num214; index += num215) - { - if (index < projectile1.oldPos.Length) - { - Microsoft.Xna.Framework.Color color11 = color10; - if (projectile1.type == 408 || projectile1.type == 435 || projectile1.type == 682 || projectile1.type == 732 || projectile1.type == 731) - color11 = Microsoft.Xna.Framework.Color.Lerp(color11, Microsoft.Xna.Framework.Color.Blue, 0.5f); - else if (projectile1.type == 436) - color11 = Microsoft.Xna.Framework.Color.Lerp(color11, Microsoft.Xna.Framework.Color.LimeGreen, 0.5f); - else if (projectile1.type >= 424 && projectile1.type <= 426) - color11 = Microsoft.Xna.Framework.Color.Lerp(color11, Microsoft.Xna.Framework.Color.Red, 0.5f); - else if (projectile1.type == 640 || projectile1.type == 639) - color11.A = (byte) 127; - else if (projectile1.type == 671) - color11 = Microsoft.Xna.Framework.Color.Lerp(color11, Microsoft.Xna.Framework.Color.Purple, (float) index / (float) num214); - else if (projectile1.type == 811) - color11 = Microsoft.Xna.Framework.Color.Lerp(color11, Microsoft.Xna.Framework.Color.Crimson * 0.5f, (float) index / (float) num214); - else if (projectile1.type == 814) - color11 = Microsoft.Xna.Framework.Color.Lerp(color11, color11 * 0.5f, (float) index / (float) num214); - else if (projectile1.type == 261) - color11 = Microsoft.Xna.Framework.Color.Lerp(color11, new Microsoft.Xna.Framework.Color(60, 60, 60, 60), (float) index / (float) num214); - else if (ProjectileID.Sets.IsAGolfBall[projectile1.type]) - color11 = Microsoft.Xna.Framework.Color.Lerp(color11, new Microsoft.Xna.Framework.Color((int) byte.MaxValue, 230, 40, 20), (float) index / (float) num214); - color11 = projectile1.GetAlpha(color11); - if (projectile1.type == 438) - { - color11.G /= (byte) index; - color11.B /= (byte) index; - } - else if (projectile1.type == 755) - color11 = projectile1.AI_156_GetColor(); - else if (projectile1.type == 873) - { - color11 = projectile1.AI_171_GetColor(); - color11.A /= (byte) 2; - color11 *= Utils.GetLerpValue(0.0f, 20f, (float) projectile1.timeLeft, true); - } - else if (projectile1.type == 931) - { - color11 = projectile1.GetFairyQueenWeaponsColor(0.5f); - color11 *= Utils.GetLerpValue(0.0f, 20f, (float) projectile1.timeLeft, true); - } - else if (projectile1.type == 872) - { - color11 = projectile1.AI_173_GetColor(); - color11 *= 0.4f; - color11.A = (byte) ((double) color11.A * 0.600000023841858); - if (index > 80) - color11 *= 0.15f * Utils.GetLerpValue(120f, 80f, (float) index, true); - } - else if (projectile1.type == 864) - { - color11 = projectile1.GetFloatingDaggerMinionGlowColor(); - color11.A /= (byte) 4; - } - else if (projectile1.type == 682) - color11.G /= (byte) index; - else if (projectile1.type == 686) - { - if (!(projectile1.oldPos[index] == Vector2.Zero)) - { - float t = (float) index / (float) num216; - color11 = (double) t >= 0.5 ? Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Purple, Microsoft.Xna.Framework.Color.Black, Utils.GetLerpValue(0.5f, 1f, t, false)) : Microsoft.Xna.Framework.Color.Lerp(color11, Microsoft.Xna.Framework.Color.Purple, Utils.GetLerpValue(0.0f, 0.5f, t, false)); - } - else - continue; - } - else if (projectile1.type == 711) - { - if (!(projectile1.oldPos[index] == Vector2.Zero)) - { - float t = (float) index / (float) num216; - color11 = (double) t >= 0.5 ? Microsoft.Xna.Framework.Color.Lerp(new Microsoft.Xna.Framework.Color(128, 0, (int) byte.MaxValue, 180), Microsoft.Xna.Framework.Color.Black, Utils.GetLerpValue(0.5f, 1f, t, false)) : Microsoft.Xna.Framework.Color.Lerp(color11, new Microsoft.Xna.Framework.Color(128, 0, (int) byte.MaxValue, 180), Utils.GetLerpValue(0.0f, 0.5f, t, false)); - } - else - continue; - } - else if (projectile1.type == 684) - { - if (index == 1) - { - color11.B /= (byte) 2; - color11.G /= (byte) 2; - color11.A /= (byte) 2; - } - color11.B /= (byte) index; - color11.G /= (byte) index; - color11.A /= (byte) index; - } - else if (projectile1.type == 706 || projectile1.type == 710) - { - color11.B /= (byte) index; - color11.G /= (byte) index; - color11.A /= (byte) index; - } - else if (projectile1.type == 818) - { - float to = 0.3f; - float amount = Utils.GetLerpValue(0.0f, to, projectile1.ai[0], true) * Utils.GetLerpValue(1f, 1f - to, projectile1.ai[0], true); - double lerpValue1 = (double) Utils.GetLerpValue(0.0f, (float) (num215 * -3), (float) index, true); - double lerpValue2 = (double) Utils.GetLerpValue((float) num216, (float) (num216 + num215 * 3), (float) index, true); - Microsoft.Xna.Framework.Color color12 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); - Microsoft.Xna.Framework.Color favoriteColor = Main.OurFavoriteColor; - favoriteColor.A = (byte) 0; - favoriteColor *= amount; - color11 = Microsoft.Xna.Framework.Color.Lerp(favoriteColor, color12, amount); - } - else if (projectile1.type == 833 || projectile1.type == 834 || projectile1.type == 835) - { - float lerpValue = Utils.GetLerpValue(0.0f, 6f, projectile1.velocity.Length(), true); - color11 = Microsoft.Xna.Framework.Color.Lerp(color11, Microsoft.Xna.Framework.Color.White, lerpValue * 0.5f); - color11.A = (byte) 0; - color11 *= lerpValue; - } - else if (projectile1.type == 592) - { - color11.R /= (byte) index; - color11.G /= (byte) index; - } - else if (projectile1.type == 640) - { - color11.R /= (byte) index; - color11.A /= (byte) index; - } - else if (projectile1.type >= 424 && projectile1.type <= 426) - { - color11.B /= (byte) index; - color11.G /= (byte) index; - color11.A /= (byte) index; - } - float t1 = (float) (num214 - index); - if (num215 < 0) - t1 = (float) (num216 - index); - color11 *= t1 / ((float) ProjectileID.Sets.TrailCacheLength[projectile1.type] * 1.5f); - Vector2 oldPo = projectile1.oldPos[index]; - float rotation = projectile1.rotation; - SpriteEffects effects = spriteEffects; - if (ProjectileID.Sets.TrailingMode[projectile1.type] == 2 || ProjectileID.Sets.TrailingMode[projectile1.type] == 3 || ProjectileID.Sets.TrailingMode[projectile1.type] == 4) - { - rotation = projectile1.oldRot[index]; - effects = projectile1.oldSpriteDirection[index] == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - } - if (!(oldPo == Vector2.Zero)) - { - if (projectile1.type == 916) - { - rectangle1.Y += rectangle1.Height; - rectangle1.Y %= rectangle1.Height * Main.projFrames[projectile1.type]; - double num220 = (double) t1 / ((double) ProjectileID.Sets.TrailCacheLength[projectile1.type] * 1.5); - Microsoft.Xna.Framework.Color color13 = new Microsoft.Xna.Framework.Color(0, 0, 0, (int) byte.MaxValue); - switch (r2.Next(3)) - { - case 1: - case 2: - color13 = Microsoft.Xna.Framework.Color.Lerp(new Microsoft.Xna.Framework.Color(106, 90, 205, (int) sbyte.MaxValue), Microsoft.Xna.Framework.Color.Black, (float) (0.200000002980232 + 0.800000011920929 * (double) r2.NextFloat())); - break; - } - color11 = color13; - float num221 = t1 / (float) ProjectileID.Sets.TrailCacheLength[projectile1.type]; - float lerpValue = Utils.GetLerpValue(0.0f, (float) ProjectileID.Sets.TrailCacheLength[projectile1.type] * 0.75f, t1, true); - color11 *= lerpValue; - oldPo += r2.NextVector2Circular(8f, 8f); - } - if (projectile1.type == 933) - { - float t2 = projectile1.localAI[0] - (float) index; - float num222 = Utils.GetLerpValue(0.0f, 20f, t2, true) * Utils.GetLerpValue(68f, 60f, t2, true); - color11 = Microsoft.Xna.Framework.Color.White * Utils.GetLerpValue(0.0f, (float) ProjectileID.Sets.TrailCacheLength[projectile1.type], t1, true) * projectile1.Opacity * num222; - } - Vector2 position = oldPo + zero + projectile1.Size / 2f - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY); - Main.EntitySpriteDraw(texture2D1, position, new Microsoft.Xna.Framework.Rectangle?(rectangle1), color11, (float) ((double) rotation + (double) num213 + (double) projectile1.rotation * (double) num219 * (double) (index - 1) * (double) -spriteEffects.HasFlag((Enum) SpriteEffects.FlipHorizontally).ToDirectionInt()), origin1, MathHelper.Lerp(projectile1.scale, num217, (float) index / num218), effects, 0); - } - } - } - if (projectile1.type == 661) - { - Microsoft.Xna.Framework.Color color14 = new Microsoft.Xna.Framework.Color(120, 40, 222, 120); - for (int index = 0; index < 4; ++index) - Main.EntitySpriteDraw(TextureAssets.Extra[75].Value, projectile1.Center - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY) + projectile1.rotation.ToRotationVector2().RotatedBy(1.57079637050629 * (double) index) * 4f, new Microsoft.Xna.Framework.Rectangle?(r1), color14, projectile1.rotation, origin1, projectile1.scale, spriteEffects, 0); - } - if (projectile1.type == 864) - { - Microsoft.Xna.Framework.Color daggerMinionGlowColor = projectile1.GetFloatingDaggerMinionGlowColor(); - daggerMinionGlowColor.A /= (byte) 4; - Microsoft.Xna.Framework.Rectangle rectangle2 = r1; - rectangle2.Y += rectangle2.Height; - for (int index = 0; index < 4; ++index) - Main.EntitySpriteDraw(texture2D1, projectile1.Center - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY) + projectile1.rotation.ToRotationVector2().RotatedBy(1.57079637050629 * (double) index) * 2f, new Microsoft.Xna.Framework.Rectangle?(rectangle2), daggerMinionGlowColor, projectile1.rotation, origin1, projectile1.scale, spriteEffects, 0); - } - if (projectile1.type == 873 || projectile1.type == 931) - { - Microsoft.Xna.Framework.Color color15 = projectile1.AI_171_GetColor() * 0.5f; - color15.A = (byte) 0; - if (projectile1.type == 931) - color15 = projectile1.GetFairyQueenWeaponsColor(0.0f); - Vector2 position1 = projectile1.Center - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY); - Main.EntitySpriteDraw(texture2D1, position1, new Microsoft.Xna.Framework.Rectangle?(r1), color15, projectile1.rotation, origin1, projectile1.scale * 0.9f, spriteEffects, 0); - Texture2D texture2D2 = TextureAssets.Extra[98].Value; - Microsoft.Xna.Framework.Color color16 = color15; - Vector2 origin2 = texture2D2.Size() / 2f; - Microsoft.Xna.Framework.Color color17 = color15 * 0.5f; - float num223 = (float) ((double) Utils.GetLerpValue(15f, 30f, (float) projectile1.timeLeft, true) * (double) Utils.GetLerpValue(240f, 200f, (float) projectile1.timeLeft, true) * (1.0 + 0.200000002980232 * Math.Cos((double) Main.GlobalTimeWrappedHourly % 30.0 / 0.5 * 6.28318548202515 * 3.0)) * 0.800000011920929); - Vector2 scale1 = new Vector2(0.5f, 5f) * num223; - Vector2 scale2 = new Vector2(0.5f, 2f) * num223; - Microsoft.Xna.Framework.Color color18 = color16 * num223; - Microsoft.Xna.Framework.Color color19 = color17 * num223; - int num224 = 0; - Vector2 position2 = position1 + projectile1.velocity.SafeNormalize(Vector2.Zero) * MathHelper.Lerp(0.5f, 1f, projectile1.localAI[0] / 60f) * (float) num224; - if (projectile1.type == 931) - { - scale1 *= 0.4f; - scale2 *= 0.4f; - } - Main.EntitySpriteDraw(texture2D2, position2, new Microsoft.Xna.Framework.Rectangle?(), color18, 1.570796f, origin2, scale1, spriteEffects, 0); - Main.EntitySpriteDraw(texture2D2, position2, new Microsoft.Xna.Framework.Rectangle?(), color18, 0.0f, origin2, scale2, spriteEffects, 0); - Main.EntitySpriteDraw(texture2D2, position2, new Microsoft.Xna.Framework.Rectangle?(), color19, 1.570796f, origin2, scale1 * 0.6f, spriteEffects, 0); - Main.EntitySpriteDraw(texture2D2, position2, new Microsoft.Xna.Framework.Rectangle?(), color19, 0.0f, origin2, scale2 * 0.6f, spriteEffects, 0); - } - if (projectile1.type == 755) - { - Microsoft.Xna.Framework.Color color20 = projectile1.AI_156_GetColor(); - color20.A = (byte) 120; - for (int index = 0; index < 4; ++index) - Main.EntitySpriteDraw(texture2D1, projectile1.Center - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY) + projectile1.rotation.ToRotationVector2().RotatedBy(1.57079637050629 * (double) index) * 2f, new Microsoft.Xna.Framework.Rectangle?(r1), color20, projectile1.rotation, origin1, projectile1.scale, spriteEffects, 0); - } - else if (projectile1.type == 684) - { - float x18 = ((float) ((double) projectile1.localAI[0] * 6.28318548202515 / 30.0)).ToRotationVector2().X; - Microsoft.Xna.Framework.Color color21 = new Microsoft.Xna.Framework.Color(220, 40, 30, 40); - color21 *= (float) (0.75 + 0.25 * (double) x18); - for (int index = 0; index < 8; ++index) - Main.EntitySpriteDraw(texture2D1, projectile1.Center - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY) + projectile1.rotation.ToRotationVector2().RotatedBy(0.785398185253143 * (double) index) * (float) (4.0 + 1.0 * (double) x18), new Microsoft.Xna.Framework.Rectangle?(r1), color21, projectile1.rotation, origin1, projectile1.scale, spriteEffects, 0); - } - else if (ProjectileID.Sets.IsAGolfBall[projectile1.type]) - { - Player player = Main.player[projectile1.owner]; - bool flag5 = GolfHelper.IsPlayerHoldingClub(player); - bool flag6 = false; - if (flag5) - flag6 = (((flag6 ? 1 : 0) | (player.ownedProjectileCounts[722] <= 0 ? 0 : (player.itemAnimation >= player.itemAnimationMax ? 1 : 0))) != 0 | player.itemAnimation == 0) & (double) player.velocity.Y == 0.0; - Vector2 shotVector = Main.MouseWorld - projectile1.Center; - if (projectile1.owner == Main.myPlayer & flag5 & flag6 && GolfHelper.IsGolfBallResting(projectile1) && GolfHelper.ValidateShot((Entity) projectile1, player, ref shotVector)) - { - color10 = Microsoft.Xna.Framework.Color.White; - Projectile golfHelper = (Projectile) null; - for (int index = 0; index < 1000; ++index) - { - Projectile projectile2 = Main.projectile[index]; - if (projectile2.active && projectile2.owner == player.whoAmI && projectile2.type == 722) - { - golfHelper = projectile2; - break; - } - } - if (golfHelper != null) - { - GolfHelper.ShotStrength shotStrength = GolfHelper.CalculateShotStrength(golfHelper, (Entity) projectile1); - Vector2 impactVelocity = Vector2.Normalize(shotVector) * shotStrength.AbsoluteStrength; - if ((double) impactVelocity.Length() > 0.0500000007450581) - GolfHelper.DrawPredictionLine((Entity) projectile1, impactVelocity, shotStrength.RelativeStrength, shotStrength.RoughLandResistance); - } - } - if (!GolfHelper.IsGolfBallResting(projectile1)) - { - Microsoft.Xna.Framework.Color golfTrailColor = Projectile.GetGolfTrailColor(projectile1); - float num225 = projectile1.velocity.Length() / 16f; - if ((double) num225 > 1.0) - num225 = 1f; - Microsoft.Xna.Framework.Color color22 = golfTrailColor * num225; - if (projectile1.oldPos[4] != Vector2.Zero) - { - color10 = Microsoft.Xna.Framework.Color.White; - for (float amount = 0.0f; (double) amount <= 1.0; amount += 0.04f) - Main.EntitySpriteDraw(texture2D1, Vector2.Lerp(projectile1.oldPos[4], projectile1.position, amount) + projectile1.Size / 2f - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(r1), color22 * amount, projectile1.rotation, origin1, projectile1.scale * MathHelper.Lerp(0.7f, 1.5f, amount), spriteEffects, 0); - } - Main.EntitySpriteDraw(texture2D1, projectile1.position + projectile1.Size / 2f - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(r1), color22, projectile1.rotation, origin1, projectile1.scale * 1.5f, spriteEffects, 0); - } - } - Microsoft.Xna.Framework.Color color23 = projectile1.GetAlpha(color10); - float scale = projectile1.scale; - float rotation1 = projectile1.rotation + num213; - if (projectile1.type == 640) - color23 = Microsoft.Xna.Framework.Color.Transparent; - if (projectile1.type == 684) - color23.A = (byte) 127; - if (projectile1.type == 873) - color23.A /= (byte) 2; - if (projectile1.type == 931) - color23.A /= (byte) 2; - if (projectile1.type == 872) - { - color23 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * projectile1.Opacity; - scale *= 0.9f; - } - if (projectile1.type == 818) - color23 = Microsoft.Xna.Framework.Color.Transparent; - if (projectile1.type == 916) - color23 = Microsoft.Xna.Framework.Color.Black; - if (projectile1.type == 933) - { - float t = projectile1.localAI[0]; - float num226 = Utils.GetLerpValue(0.0f, 20f, t, true) * Utils.GetLerpValue(68f, 60f, t, true); - color23 *= num226; - } - Main.EntitySpriteDraw(texture2D1, projectile1.Center + zero - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(r1), color23, rotation1, origin1, scale, spriteEffects, 0); - if (projectile1.type == 894) - { - float num227 = Utils.WrappedLerp(0.6f, 1f, (float) ((int) Main.timeForVisualEffects % 70) / 70f); - Microsoft.Xna.Framework.Color color24 = new Microsoft.Xna.Framework.Color(num227, num227, num227, 150f); - Main.EntitySpriteDraw(TextureAssets.GlowMask[282].Value, projectile1.Center + zero - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(r1), color24, projectile1.rotation, origin1, projectile1.scale, spriteEffects, 0); - } - if (projectile1.type == 503) - Main.EntitySpriteDraw(TextureAssets.Extra[36].Value, projectile1.Center - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(r1), Microsoft.Xna.Framework.Color.White, projectile1.localAI[0], origin1, projectile1.scale, spriteEffects, 0); - else if (projectile1.type == 533) - Main.EntitySpriteDraw(TextureAssets.GlowMask[128].Value, projectile1.Center - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(r1), Microsoft.Xna.Framework.Color.White * 0.3f, projectile1.rotation, origin1, projectile1.scale, spriteEffects, 0); - else if (projectile1.type == 261) - { - float num228 = 0.7f; - float t = projectile1.velocity.Length(); - if ((double) t < 0.300000011920929 && (double) projectile1.velocity.Y == 0.0) - num228 = Utils.GetLerpValue(0.02f, 0.3f, t, true) * 0.7f; - Main.EntitySpriteDraw(TextureAssets.GlowMask[252].Value, projectile1.Center - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(r1), Microsoft.Xna.Framework.Color.White * num228, projectile1.rotation, origin1, projectile1.scale, spriteEffects, 0); - } - else if (projectile1.type == 601) - { - Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; - white.A = (byte) 0; - Main.EntitySpriteDraw(texture2D1, projectile1.Center - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(r1), white, projectile1.rotation, origin1, projectile1.scale * 0.7f, spriteEffects, 0); - } - else if (ProjectileID.Sets.IsAGolfBall[projectile1.type] && GolfHelper.IsGolfBallResting(projectile1) && GolfHelper.IsPlayerHoldingClub(Main.LocalPlayer) && GolfHelper.IsGolfShotValid((Entity) projectile1, Main.LocalPlayer) && projectile1.owner == Main.myPlayer) - Main.EntitySpriteDraw(TextureAssets.GolfBallOutline.Value, projectile1.Center - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(r1), Microsoft.Xna.Framework.Color.White, projectile1.rotation, origin1, projectile1.scale, spriteEffects, 0); - if (projectile1.type != 933) - return; - float t3 = projectile1.localAI[0]; - float num229 = Utils.GetLerpValue(0.0f, 20f, t3, true) * Utils.GetLerpValue(68f, 60f, t3, true); - Main.EntitySpriteDraw(texture2D1, projectile1.Center + zero - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(r1), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue) * projectile1.Opacity * num229, rotation1, origin1, scale * 1.25f, spriteEffects, 0); - FinalFractalHelper.FinalFractalProfile finalFractalProfile = FinalFractalHelper.GetFinalFractalProfile((int) projectile1.ai[1]); - Microsoft.Xna.Framework.Color trailColor = finalFractalProfile.trailColor; - trailColor.A /= (byte) 2; - Main.DrawPrettyStarSparkle(projectile1, spriteEffects, projectile1.Center + zero - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY) + (projectile1.rotation - 1.570796f).ToRotationVector2() * finalFractalProfile.trailWidth, Microsoft.Xna.Framework.Color.White * num229, trailColor * num229); - } - else if (projectile1.type == 672) - { - Vector2 position = projectile1.Center - Main.screenPosition; - if ((double) projectile1.localAI[1] == 0.0) - { - position.Y += 60f; - float num230 = projectile1.localAI[0] / 120f; - for (int index = 0; index < 4; ++index) - { - float num231 = MathHelper.Clamp((float) ((double) num230 * 2.0 - (double) index / 3.0), 0.0f, 1f); - float num232 = 1f - MathHelper.Clamp((float) (((double) num230 - 0.800000011920929) / 0.200000002980232), 0.0f, 1f); - Main.EntitySpriteDraw(TextureAssets.MagicPixel.Value, position, new Microsoft.Xna.Framework.Rectangle?(), new Microsoft.Xna.Framework.Color(0.4f, 0.17f, 0.4f, 0.0f) * (num231 * num232) * 1.3f, 0.0f, new Vector2((float) TextureAssets.MagicPixel.Width() / 2f, (float) TextureAssets.MagicPixel.Height()), new Vector2((float) Math.Sqrt((double) num231) * 100f, num231 * 2f), SpriteEffects.None, 0); - } - } - else if ((double) projectile1.localAI[1] == 1.0) - { - double num233 = (double) projectile1.localAI[0] / 300.0; - float num234 = Math.Min(1f, projectile1.localAI[0] / 30f); - int frameNumber = (int) ((double) Main.GlobalTimeWrappedHourly * 10.0) % 8; - this.DrawElderEye(Main.spriteBatch, projectile1.Center, 1f, 1f, frameNumber, Microsoft.Xna.Framework.Color.White * num234); - this.DrawElderEye(Main.spriteBatch, projectile1.Center, 1f, 1f, (frameNumber + 1) % 8, new Microsoft.Xna.Framework.Color(0.2f, 0.2f, 0.2f, 0.0f) * num234); - } - else - { - if ((double) projectile1.localAI[1] != 2.0) - return; - int frameNumber = (int) ((double) Main.GlobalTimeWrappedHourly * 10.0) % 8; - this.DrawElderEye(Main.spriteBatch, projectile1.Center, 1f, 1f, frameNumber, Microsoft.Xna.Framework.Color.White); - this.DrawElderEye(Main.spriteBatch, projectile1.Center, 1f, 1f, (frameNumber + 1) % 8, new Microsoft.Xna.Framework.Color(0.2f, 0.2f, 0.2f, 0.0f)); - } - } - else - { - if (projectile1.type == 713) - return; - if (projectile1.type == 754) - { - Texture2D texture2D = TextureAssets.Projectile[projectile1.type].Value; - Microsoft.Xna.Framework.Rectangle rectangle3 = texture2D.Frame(5, 2, projectile1.frame); - rectangle3.Width -= 2; - rectangle3.Height -= 2; - Vector2 origin = new Vector2((float) (rectangle3.Width / 2), 0.0f); - float y = projectile1.position.Y; - float num235 = (float) ((double) projectile1.ai[0] + 8.0 + 2.0 - (double) rectangle3.Height + 2.0); - projectile1.GetAlpha(color10); - Vector2 top = projectile1.Top; - if ((double) projectile1.ai[1] == 2.0) - { - Microsoft.Xna.Framework.Rectangle rectangle4 = texture2D.Frame(5, 2, 4); - rectangle4.Width -= 2; - rectangle4.Height -= 2; - origin = new Vector2((float) (rectangle4.Width / 2), 0.0f); - Microsoft.Xna.Framework.Color alpha = projectile1.GetAlpha(Lighting.GetColor((int) ((double) top.X + (double) (rectangle4.Width / 2)) / 16, (int) (((double) num235 - 2.0 + (double) (rectangle4.Height / 2)) / 16.0))); - Main.EntitySpriteDraw(texture2D, new Vector2(top.X, num235 - 2f) - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle4), alpha, projectile1.rotation, origin, projectile1.scale, spriteEffects, 0); - } - else - { - for (float num236 = y; (double) num236 < (double) num235; num236 += (float) rectangle3.Height) - { - Vector2 vector2 = top; - vector2.Y = num236; - Microsoft.Xna.Framework.Rectangle rectangle5 = rectangle3; - float num237 = num235 - num236; - if ((double) num237 < (double) rectangle5.Height) - rectangle5.Height = (int) num237; - Microsoft.Xna.Framework.Color alpha = projectile1.GetAlpha(Lighting.GetColor((int) ((double) vector2.X + (double) (rectangle5.Width / 2)) / 16, (int) (((double) vector2.Y + (double) (rectangle5.Height / 2)) / 16.0))); - Main.EntitySpriteDraw(texture2D, vector2 - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle5), alpha, projectile1.rotation, origin, projectile1.scale, spriteEffects, 0); - if (rectangle3.Y == 0) - rectangle3.Y += rectangle3.Height + 2; - } - Microsoft.Xna.Framework.Rectangle rectangle6 = texture2D.Frame(5, 2, 4); - rectangle6.Width -= 2; - rectangle6.Height -= 2; - origin = new Vector2((float) (rectangle6.Width / 2), 0.0f); - Microsoft.Xna.Framework.Color alpha1 = projectile1.GetAlpha(Lighting.GetColor((int) ((double) top.X + (double) (rectangle6.Width / 2)) / 16, (int) (((double) num235 - 2.0 + (double) (rectangle6.Height / 2)) / 16.0))); - Main.EntitySpriteDraw(texture2D, new Vector2(top.X, num235 - 2f) - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle6), alpha1, projectile1.rotation, origin, projectile1.scale, spriteEffects, 0); - } - } - else if (projectile1.type == 12 || projectile1.type == 728) - { - Texture2D texture = TextureAssets.Projectile[projectile1.type].Value; - Microsoft.Xna.Framework.Rectangle r = new Microsoft.Xna.Framework.Rectangle(0, 0, texture.Width, texture.Height); - Vector2 origin3 = r.Size() / 2f; - Microsoft.Xna.Framework.Color alpha = projectile1.GetAlpha(color10); - Texture2D texture2D = TextureAssets.Extra[91].Value; - Microsoft.Xna.Framework.Rectangle rectangle = texture2D.Frame(); - Vector2 origin4 = new Vector2((float) rectangle.Width / 2f, 10f); - Microsoft.Xna.Framework.Color color25 = Microsoft.Xna.Framework.Color.Cyan * 0.5f; - Vector2 vector2_6 = new Vector2(0.0f, projectile1.gfxOffY); - Vector2 spinningpoint = new Vector2(0.0f, -10f); - float num238 = (float) Main.timeForVisualEffects / 60f; - Vector2 vector2_7 = projectile1.Center + projectile1.velocity; - Microsoft.Xna.Framework.Color color26 = Microsoft.Xna.Framework.Color.Blue * 0.2f; - Microsoft.Xna.Framework.Color color27 = Microsoft.Xna.Framework.Color.White * 0.5f; - color27.A = (byte) 0; - float num239 = 0.0f; - if (projectile1.type == 728) - { - color26 = Microsoft.Xna.Framework.Color.Orange * 0.2f; - color27 = Microsoft.Xna.Framework.Color.Gold * 0.5f; - color27.A = (byte) 50; - num239 = -0.2f; - } - Microsoft.Xna.Framework.Color color28 = color26; - color28.A = (byte) 0; - Microsoft.Xna.Framework.Color color29 = color26; - color29.A = (byte) 0; - Microsoft.Xna.Framework.Color color30 = color26; - color30.A = (byte) 0; - Main.EntitySpriteDraw(texture2D, vector2_7 - Main.screenPosition + vector2_6 + spinningpoint.RotatedBy(6.28318548202515 * (double) num238), new Microsoft.Xna.Framework.Rectangle?(rectangle), color28, projectile1.velocity.ToRotation() + 1.570796f, origin4, 1.5f + num239, SpriteEffects.None, 0); - Main.EntitySpriteDraw(texture2D, vector2_7 - Main.screenPosition + vector2_6 + spinningpoint.RotatedBy(6.28318548202515 * (double) num238 + 2.09439516067505), new Microsoft.Xna.Framework.Rectangle?(rectangle), color29, projectile1.velocity.ToRotation() + 1.570796f, origin4, 1.1f + num239, SpriteEffects.None, 0); - Main.EntitySpriteDraw(texture2D, vector2_7 - Main.screenPosition + vector2_6 + spinningpoint.RotatedBy(6.28318548202515 * (double) num238 + 4.1887903213501), new Microsoft.Xna.Framework.Rectangle?(rectangle), color30, projectile1.velocity.ToRotation() + 1.570796f, origin4, 1.3f + num239, SpriteEffects.None, 0); - Vector2 vector2_8 = projectile1.Center - projectile1.velocity * 0.5f; - for (float num240 = 0.0f; (double) num240 < 1.0; num240 += 0.5f) - { - float num241 = (float) (((double) num238 % 0.5 / 0.5 + (double) num240) % 1.0); - float num242 = num241 * 2f; - if ((double) num242 > 1.0) - num242 = 2f - num242; - Main.EntitySpriteDraw(texture2D, vector2_8 - Main.screenPosition + vector2_6, new Microsoft.Xna.Framework.Rectangle?(rectangle), color27 * num242, projectile1.velocity.ToRotation() + 1.570796f, origin4, (float) (0.300000011920929 + (double) num241 * 0.5), SpriteEffects.None, 0); - } - Main.EntitySpriteDraw(texture, projectile1.Center - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(r), alpha, projectile1.rotation, origin3, projectile1.scale + 0.1f, spriteEffects, 0); - } - else if (projectile1.type == 756) - { - Texture2D texture2D = TextureAssets.Projectile[projectile1.type].Value; - Microsoft.Xna.Framework.Rectangle rectangle = texture2D.Frame(verticalFrames: 6, frameY: projectile1.frame); - Vector2 origin = new Vector2(16f, (float) (rectangle.Height / 2)); - Microsoft.Xna.Framework.Color alpha = projectile1.GetAlpha(color10); - Vector2 scale = new Vector2(projectile1.scale); - float lerpValue = Utils.GetLerpValue(30f, 25f, projectile1.ai[0], true); - scale.Y *= lerpValue; - Vector4 vector4_1 = color10.ToVector4(); - Vector4 vector4_2 = new Microsoft.Xna.Framework.Color(67, 17, 17).ToVector4() * vector4_1; - Main.EntitySpriteDraw(TextureAssets.Extra[98].Value, projectile1.Center - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY) - projectile1.velocity * projectile1.scale * 0.5f, new Microsoft.Xna.Framework.Rectangle?(), projectile1.GetAlpha(new Microsoft.Xna.Framework.Color(vector4_2.X, vector4_2.Y, vector4_2.Z, vector4_2.W)) * 1f, projectile1.rotation + 1.570796f, TextureAssets.Extra[98].Value.Size() / 2f, projectile1.scale * 0.9f, spriteEffects, 0); - Main.EntitySpriteDraw(texture2D, projectile1.Center - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(rectangle), alpha, projectile1.rotation, origin, scale, spriteEffects, 0); - } - else if (projectile1.type == 723 || projectile1.type == 726 || projectile1.type == 725 || projectile1.type == 724) - { - Texture2D texture = TextureAssets.Projectile[projectile1.type].Value; - Microsoft.Xna.Framework.Rectangle r = new Microsoft.Xna.Framework.Rectangle(0, 0, texture.Width, texture.Height); - Vector2 origin5 = r.Size() / 2f; - Microsoft.Xna.Framework.Color alpha = projectile1.GetAlpha(color10); - Texture2D texture2D = TextureAssets.Extra[91].Value; - Microsoft.Xna.Framework.Rectangle rectangle = texture2D.Frame(); - Vector2 origin6 = new Vector2((float) rectangle.Width / 2f, 10f); - Microsoft.Xna.Framework.Color color31 = Microsoft.Xna.Framework.Color.White * 0.2f; - Vector2 vector2_9 = new Vector2(0.0f, projectile1.gfxOffY); - Vector2 spinningpoint = new Vector2(0.0f, -5f); - float num243 = (float) Main.timeForVisualEffects / 60f; - Vector2 vector2_10 = projectile1.Center + projectile1.velocity; - float scale3 = 1.5f; - float scale4 = 1.1f; - float scale5 = 1.3f; - Microsoft.Xna.Framework.Color color32 = Microsoft.Xna.Framework.Color.Blue * 0.1f; - Microsoft.Xna.Framework.Color color33 = Microsoft.Xna.Framework.Color.White * 0.3f; - color33.A = (byte) 0; - byte num244 = 0; - if (projectile1.type == 726) - { - Microsoft.Xna.Framework.Color color34 = new Microsoft.Xna.Framework.Color(180, 20, (int) byte.MaxValue); - color32 = color34 * 0.3f; - color33 = color34 * 0.3f; - num244 = (byte) 60; - float num245 = 0.6f; - scale3 -= num245; - scale4 -= num245; - scale5 -= num245; - } - if (projectile1.type == 725) - { - Microsoft.Xna.Framework.Color color35 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, 80, (int) byte.MaxValue); - Microsoft.Xna.Framework.Color color36 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, 0); - color32 = Microsoft.Xna.Framework.Color.Lerp(color35, color36, 0.2f) * 0.3f; - color33 = Microsoft.Xna.Framework.Color.Lerp(color35, color36, 0.8f) * 0.4f; - num244 = (byte) 50; - float num246 = 0.5f; - scale3 -= num246; - scale4 -= num246; - scale5 -= num246; - } - if (projectile1.type == 724) - { - Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Black, Microsoft.Xna.Framework.Color.Orange, 0.75f); - Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Black, Microsoft.Xna.Framework.Color.Yellow, 0.5f); - Microsoft.Xna.Framework.Color color37 = Microsoft.Xna.Framework.Color.Orange * 0.75f; - Microsoft.Xna.Framework.Color color38 = Microsoft.Xna.Framework.Color.Yellow * 0.5f; - color32 = Microsoft.Xna.Framework.Color.Lerp(color37, color38, 0.2f) * 0.3f; - color33 = Microsoft.Xna.Framework.Color.Lerp(color37, color38, 0.8f) * 0.4f; - num244 = (byte) 0; - float num247 = 0.5f; - scale3 -= num247; - scale4 -= num247; - scale5 -= num247; - } - Microsoft.Xna.Framework.Color color39 = color32; - color39.A = num244; - Microsoft.Xna.Framework.Color color40 = color32; - color40.A = num244; - Microsoft.Xna.Framework.Color color41 = color32; - color41.A = num244; - Main.EntitySpriteDraw(texture2D, vector2_10 - Main.screenPosition + vector2_9 + spinningpoint.RotatedBy(6.28318548202515 * (double) num243), new Microsoft.Xna.Framework.Rectangle?(rectangle), color39, projectile1.velocity.ToRotation() + 1.570796f, origin6, scale3, SpriteEffects.None, 0); - Main.EntitySpriteDraw(texture2D, vector2_10 - Main.screenPosition + vector2_9 + spinningpoint.RotatedBy(6.28318548202515 * (double) num243 + 2.09439516067505), new Microsoft.Xna.Framework.Rectangle?(rectangle), color40, projectile1.velocity.ToRotation() + 1.570796f, origin6, scale4, SpriteEffects.None, 0); - Main.EntitySpriteDraw(texture2D, vector2_10 - Main.screenPosition + vector2_9 + spinningpoint.RotatedBy(6.28318548202515 * (double) num243 + 4.1887903213501), new Microsoft.Xna.Framework.Rectangle?(rectangle), color41, projectile1.velocity.ToRotation() + 1.570796f, origin6, scale5, SpriteEffects.None, 0); - Vector2 vector2_11 = projectile1.Center - projectile1.velocity * 0.5f; - for (float num248 = 0.0f; (double) num248 < 1.0; num248 += 0.5f) - { - float num249 = (float) (((double) num243 % 0.5 / 0.5 + (double) num248) % 1.0); - float num250 = num249 * 2f; - if ((double) num250 > 1.0) - num250 = 2f - num250; - Main.EntitySpriteDraw(texture2D, vector2_11 - Main.screenPosition + vector2_9, new Microsoft.Xna.Framework.Rectangle?(rectangle), color33 * num250, projectile1.velocity.ToRotation() + 1.570796f, origin6, (float) (0.5 + (double) num249 * 0.5), SpriteEffects.None, 0); - } - Main.EntitySpriteDraw(texture, projectile1.Center - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(r), alpha, projectile1.rotation, origin5, projectile1.scale + 0.1f, spriteEffects, 0); - } - else if (projectile1.type == 674) - { - Texture2D texture = TextureAssets.Extra[60].Value; - Vector2 origin = new Vector2(66f, 86f); - Vector2 position = projectile1.Center - Main.screenPosition; - Vector2 one = Vector2.One; - Vector2 vector2_12 = new Vector2(4f, 1f) * 1.4f; - Microsoft.Xna.Framework.Color color42 = new Microsoft.Xna.Framework.Color(115, 0, 155, 0); - Microsoft.Xna.Framework.Color color43 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, 180, (int) byte.MaxValue, 0); - float t = 0.0f; - if ((double) projectile1.ai[0] < 30.0) - t = Utils.GetLerpValue(0.0f, 30f, projectile1.ai[0], true); - else if ((double) projectile1.ai[0] < 40.0) - t = 1f + Utils.GetLerpValue(30f, 40f, projectile1.ai[0], true); - Vector2 vector2_13 = new Vector2(1f, 1f); - Vector2 vector2_14 = new Vector2(0.8f, 2f); - if ((double) t < 1.0) - vector2_13.X *= t; - Vector2 vector2_15 = vector2_12 * t; - if ((double) t < 1.0) - { - color42 *= t; - color43 *= t; - } - if ((double) t > 1.5) - { - float lerpValue = Utils.GetLerpValue(2f, 1.5f, t, true); - color42 *= lerpValue; - color43 *= lerpValue; - } - float num251 = 0.42f; - Microsoft.Xna.Framework.Color color44 = color42 * num251; - Microsoft.Xna.Framework.Color color45 = color43 * num251; - Main.EntitySpriteDraw(texture, position, new Microsoft.Xna.Framework.Rectangle?(), color44, 0.0f, origin, vector2_15 * vector2_13, SpriteEffects.None, 0); - Main.EntitySpriteDraw(texture, position, new Microsoft.Xna.Framework.Rectangle?(), color45, 0.0f, origin, vector2_15 * vector2_14, SpriteEffects.None, 0); - Main.EntitySpriteDraw(TextureAssets.Extra[59].Value, position, new Microsoft.Xna.Framework.Rectangle?(), color44, 0.0f, origin, vector2_15 * vector2_13 * new Vector2(1f, 0.3f), SpriteEffects.None, 0); - } - else if (projectile1.type == 440 || projectile1.type == 449 || projectile1.type == 606) - { - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle((int) Main.screenPosition.X - 500, (int) Main.screenPosition.Y - 500, Main.screenWidth + 1000, Main.screenHeight + 1000); - if (!projectile1.getRect().Intersects(rectangle)) - return; - Vector2 vector2_16 = new Vector2(projectile1.position.X - Main.screenPosition.X + x17 + (float) num209, projectile1.position.Y - Main.screenPosition.Y + (float) (projectile1.height / 2) + projectile1.gfxOffY); - float num252 = 100f; - float num253 = 3f; - if (projectile1.type == 606) - { - num252 = 150f; - num253 = 3f; - } - if ((double) projectile1.ai[1] == 1.0) - num252 = (float) (int) projectile1.localAI[0]; - for (int index = 1; index <= (int) projectile1.localAI[0]; ++index) - { - Vector2 vector2_17 = Vector2.Normalize(projectile1.velocity) * (float) index * num253; - Microsoft.Xna.Framework.Color color46 = projectile1.GetAlpha(color10) * ((num252 - (float) index) / num252); - color46.A = (byte) 0; - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, vector2_16 - vector2_17, new Microsoft.Xna.Framework.Rectangle?(), color46, projectile1.rotation, new Vector2(x17, (float) (projectile1.height / 2 + num208)), projectile1.scale, spriteEffects, 0); - } - } - else if (projectile1.type == 687) - { - Vector2 vector2_18 = projectile1.Center - Main.screenPosition; - float num254 = 40f; - float num255 = num254 * 2f; - float num256 = (float) projectile1.frameCounter / num254; - Texture2D texture2D = TextureAssets.Projectile[projectile1.type].Value; - Microsoft.Xna.Framework.Color transparent = Microsoft.Xna.Framework.Color.Transparent; - Microsoft.Xna.Framework.Color color47 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); - Microsoft.Xna.Framework.Color color48 = new Microsoft.Xna.Framework.Color(180, 30, 30, 200); - Microsoft.Xna.Framework.Color color49 = new Microsoft.Xna.Framework.Color(0, 0, 0, 30); - ulong seed = 1; - for (float num257 = 0.0f; (double) num257 < 15.0; ++num257) - { - float num258 = (float) ((double) Utils.RandomFloat(ref seed) * 0.25 - 0.125); - Vector2 rotationVector2 = (projectile1.rotation + num258).ToRotationVector2(); - Vector2 vector2_19 = vector2_18 + rotationVector2 * 400f; - float num259 = num256 + num257 * 0.06666667f; - int num260 = (int) ((double) num259 / 0.0666666701436043); - float num261 = num259 % 1f; - if (((double) num261 <= (double) num256 % 1.0 || (double) projectile1.frameCounter >= (double) num254) && ((double) num261 >= (double) num256 % 1.0 || (double) projectile1.frameCounter < (double) num255 - (double) num254)) - { - Microsoft.Xna.Framework.Color color50 = (double) num261 >= 0.100000001490116 ? ((double) num261 >= 0.349999994039536 ? ((double) num261 >= 0.699999988079071 ? ((double) num261 >= 0.899999976158142 ? ((double) num261 >= 1.0 ? Microsoft.Xna.Framework.Color.Transparent : Microsoft.Xna.Framework.Color.Lerp(color49, Microsoft.Xna.Framework.Color.Transparent, Utils.GetLerpValue(0.9f, 1f, num261, true))) : Microsoft.Xna.Framework.Color.Lerp(color48, color49, Utils.GetLerpValue(0.7f, 0.9f, num261, true))) : Microsoft.Xna.Framework.Color.Lerp(color47, color48, Utils.GetLerpValue(0.35f, 0.7f, num261, true))) : color47) : Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, color47, Utils.GetLerpValue(0.0f, 0.1f, num261, true)); - float num262 = (float) (0.899999976158142 + (double) num261 * 0.800000011920929); - float scale = num262 * num262 * 0.8f; - Vector2 position = Vector2.SmoothStep(vector2_18, vector2_19, num261); - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: 7, frameY: ((int) ((double) num261 * 7.0))); - Main.EntitySpriteDraw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(r), color50, (float) ((double) projectile1.rotation + 6.28318548202515 * ((double) num261 + (double) Main.GlobalTimeWrappedHourly * 1.20000004768372) * 0.200000002980232 + (double) num260 * 1.25663709640503), r.Size() / 2f, scale, SpriteEffects.None, 0); - } - } - } - else if (projectile1.type == 651) - { - if (projectile1.owner != Main.myPlayer) - return; - Player player = Main.player[projectile1.owner]; - Microsoft.Xna.Framework.Point point = new Vector2(projectile1.ai[0], projectile1.ai[1]).ToPoint(); - Microsoft.Xna.Framework.Point tileCoordinates = projectile1.Center.ToTileCoordinates(); - Microsoft.Xna.Framework.Color color51 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); - Microsoft.Xna.Framework.Color color52 = new Microsoft.Xna.Framework.Color((int) sbyte.MaxValue, (int) sbyte.MaxValue, (int) sbyte.MaxValue, 0); - int num263 = 1; - float num264 = 0.0f; - WiresUI.Settings.MultiToolMode toolMode = WiresUI.Settings.ToolMode; - bool flag7 = toolMode.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Actuator); - if (toolMode.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Red)) - { - ++num264; - color52 = Microsoft.Xna.Framework.Color.Lerp(color52, Microsoft.Xna.Framework.Color.Red, 1f / num264); - } - if (toolMode.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Blue)) - { - ++num264; - color52 = Microsoft.Xna.Framework.Color.Lerp(color52, Microsoft.Xna.Framework.Color.Blue, 1f / num264); - } - if (toolMode.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Green)) - { - ++num264; - color52 = Microsoft.Xna.Framework.Color.Lerp(color52, new Microsoft.Xna.Framework.Color(0, (int) byte.MaxValue, 0), 1f / num264); - } - if (toolMode.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Yellow)) - { - float num265 = num264 + 1f; - color52 = Microsoft.Xna.Framework.Color.Lerp(color52, new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, 0), 1f / num265); - } - if (toolMode.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Cutter)) - color51 = new Microsoft.Xna.Framework.Color(50, 50, 50, (int) byte.MaxValue); - color52.A = (byte) 0; - if (point == tileCoordinates) - { - Vector2 position = tileCoordinates.ToVector2() * 16f - Main.screenPosition; - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, 0, 16, 16); - if (flag7) - Main.EntitySpriteDraw(TextureAssets.WireUi[11].Value, position, new Microsoft.Xna.Framework.Rectangle?(), color51, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, position, new Microsoft.Xna.Framework.Rectangle?(rectangle), color52, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - rectangle.Y = 18; - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, position, new Microsoft.Xna.Framework.Rectangle?(rectangle), color51, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - else if (point.X == tileCoordinates.X) - { - int num266 = tileCoordinates.Y - point.Y; - int num267 = Math.Sign(num266); - Vector2 position3 = point.ToVector2() * 16f - Main.screenPosition; - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(num266 * num263 > 0 ? 72 : 18, 0, 16, 16); - if (flag7) - Main.EntitySpriteDraw(TextureAssets.WireUi[11].Value, position3, new Microsoft.Xna.Framework.Rectangle?(), color51, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, position3, new Microsoft.Xna.Framework.Rectangle?(rectangle), color52, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - rectangle.Y = 18; - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, position3, new Microsoft.Xna.Framework.Rectangle?(rectangle), color51, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - for (int index = point.Y + num267; index != tileCoordinates.Y; index += num267) - { - Vector2 position4 = new Vector2((float) (point.X * 16), (float) (index * 16)) - Main.screenPosition; - rectangle.Y = 0; - rectangle.X = 90; - if (flag7) - Main.EntitySpriteDraw(TextureAssets.WireUi[11].Value, position4, new Microsoft.Xna.Framework.Rectangle?(), color51, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, position4, new Microsoft.Xna.Framework.Rectangle?(rectangle), color52, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - rectangle.Y = 18; - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, position4, new Microsoft.Xna.Framework.Rectangle?(rectangle), color51, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - Vector2 position5 = tileCoordinates.ToVector2() * 16f - Main.screenPosition; - rectangle = new Microsoft.Xna.Framework.Rectangle(num266 * num263 > 0 ? 18 : 72, 0, 16, 16); - if (flag7) - Main.EntitySpriteDraw(TextureAssets.WireUi[11].Value, position5, new Microsoft.Xna.Framework.Rectangle?(), color51, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, position5, new Microsoft.Xna.Framework.Rectangle?(rectangle), color52, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - rectangle.Y = 18; - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, position5, new Microsoft.Xna.Framework.Rectangle?(rectangle), color51, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - else if (point.Y == tileCoordinates.Y) - { - int num268 = tileCoordinates.X - point.X; - int num269 = Math.Sign(num268); - Vector2 position6 = point.ToVector2() * 16f - Main.screenPosition; - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(num268 > 0 ? 36 : 144, 0, 16, 16); - if (flag7) - Main.EntitySpriteDraw(TextureAssets.WireUi[11].Value, position6, new Microsoft.Xna.Framework.Rectangle?(), color51, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, position6, new Microsoft.Xna.Framework.Rectangle?(rectangle), color52, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - rectangle.Y = 18; - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, position6, new Microsoft.Xna.Framework.Rectangle?(rectangle), color51, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - for (int index = point.X + num269; index != tileCoordinates.X; index += num269) - { - Vector2 position7 = new Vector2((float) (index * 16), (float) (point.Y * 16)) - Main.screenPosition; - rectangle.Y = 0; - rectangle.X = 180; - if (flag7) - Main.EntitySpriteDraw(TextureAssets.WireUi[11].Value, position7, new Microsoft.Xna.Framework.Rectangle?(), color51, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, position7, new Microsoft.Xna.Framework.Rectangle?(rectangle), color52, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - rectangle.Y = 18; - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, position7, new Microsoft.Xna.Framework.Rectangle?(rectangle), color51, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - Vector2 position8 = tileCoordinates.ToVector2() * 16f - Main.screenPosition; - rectangle = new Microsoft.Xna.Framework.Rectangle(num268 > 0 ? 144 : 36, 0, 16, 16); - if (flag7) - Main.EntitySpriteDraw(TextureAssets.WireUi[11].Value, position8, new Microsoft.Xna.Framework.Rectangle?(), color51, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, position8, new Microsoft.Xna.Framework.Rectangle?(rectangle), color52, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - rectangle.Y = 18; - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, position8, new Microsoft.Xna.Framework.Rectangle?(rectangle), color51, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - else - { - Math.Abs(point.X - tileCoordinates.X); - Math.Abs(point.Y - tileCoordinates.Y); - int num270 = Math.Sign(tileCoordinates.X - point.X); - int num271 = Math.Sign(tileCoordinates.Y - point.Y); - Microsoft.Xna.Framework.Point p = new Microsoft.Xna.Framework.Point(); - bool flag8 = false; - bool flag9 = player.direction == 1; - int num272; - int num273; - int num274; - if (flag9) - { - p.X = point.X; - num272 = point.Y; - num273 = tileCoordinates.Y; - num274 = num271; - } - else - { - p.Y = point.Y; - num272 = point.X; - num273 = tileCoordinates.X; - num274 = num270; - } - Vector2 position9 = point.ToVector2() * 16f - Main.screenPosition; - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, 0, 16, 16); - rectangle.X = flag9 ? (num274 > 0 ? 72 : 18) : (num274 > 0 ? 36 : 144); - if (flag7) - Main.EntitySpriteDraw(TextureAssets.WireUi[11].Value, position9, new Microsoft.Xna.Framework.Rectangle?(), color51, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, position9, new Microsoft.Xna.Framework.Rectangle?(rectangle), color52, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - rectangle.Y = 18; - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, position9, new Microsoft.Xna.Framework.Rectangle?(rectangle), color51, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - for (int index = num272 + num274; index != num273 && !flag8; index += num274) - { - if (flag9) - p.Y = index; - else - p.X = index; - if (WorldGen.InWorld(p.X, p.Y, 1) && Main.tile[p.X, p.Y] != null) - { - Vector2 position10 = p.ToVector2() * 16f - Main.screenPosition; - rectangle.Y = 0; - rectangle.X = flag9 ? 90 : 180; - if (flag7) - Main.EntitySpriteDraw(TextureAssets.WireUi[11].Value, position10, new Microsoft.Xna.Framework.Rectangle?(), color51, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, position10, new Microsoft.Xna.Framework.Rectangle?(rectangle), color52, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - rectangle.Y = 18; - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, position10, new Microsoft.Xna.Framework.Rectangle?(rectangle), color51, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - } - int num275; - int num276; - int num277; - if (flag9) - { - p.Y = tileCoordinates.Y; - num275 = point.X; - num276 = tileCoordinates.X; - num277 = num270; - } - else - { - p.X = tileCoordinates.X; - num275 = point.Y; - num276 = tileCoordinates.Y; - num277 = num271; - } - Vector2 position11 = p.ToVector2() * 16f - Main.screenPosition; - rectangle = new Microsoft.Xna.Framework.Rectangle(0, 0, 16, 16); - if (!flag9) - { - rectangle.X += num270 > 0 ? 144 : 36; - rectangle.X += num271 * num263 > 0 ? 72 : 18; - } - else - { - rectangle.X += num270 > 0 ? 36 : 144; - rectangle.X += num271 * num263 > 0 ? 18 : 72; - } - if (flag7) - Main.EntitySpriteDraw(TextureAssets.WireUi[11].Value, position11, new Microsoft.Xna.Framework.Rectangle?(), color51, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, position11, new Microsoft.Xna.Framework.Rectangle?(rectangle), color52, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - rectangle.Y = 18; - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, position11, new Microsoft.Xna.Framework.Rectangle?(rectangle), color51, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - for (int index = num275 + num277; index != num276 && !flag8; index += num277) - { - if (!flag9) - p.Y = index; - else - p.X = index; - if (WorldGen.InWorld(p.X, p.Y, 1) && Main.tile[p.X, p.Y] != null) - { - Vector2 position12 = p.ToVector2() * 16f - Main.screenPosition; - rectangle.Y = 0; - rectangle.X = flag9 ? 180 : 90; - if (flag7) - Main.EntitySpriteDraw(TextureAssets.WireUi[11].Value, position12, new Microsoft.Xna.Framework.Rectangle?(), color51, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, position12, new Microsoft.Xna.Framework.Rectangle?(rectangle), color52, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - rectangle.Y = 18; - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, position12, new Microsoft.Xna.Framework.Rectangle?(rectangle), color51, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - } - Vector2 position13 = tileCoordinates.ToVector2() * 16f - Main.screenPosition; - rectangle = new Microsoft.Xna.Framework.Rectangle(0, 0, 16, 16); - if (!flag9) - rectangle.X += num271 * num263 > 0 ? 18 : 72; - else - rectangle.X += num270 > 0 ? 144 : 36; - if (flag7) - Main.EntitySpriteDraw(TextureAssets.WireUi[11].Value, position13, new Microsoft.Xna.Framework.Rectangle?(), color51, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, position13, new Microsoft.Xna.Framework.Rectangle?(rectangle), color52, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - rectangle.Y = 18; - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, position13, new Microsoft.Xna.Framework.Rectangle?(rectangle), color51, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - } - else if (projectile1.type == 586) - { - float num278 = 300f; - if ((double) projectile1.ai[0] >= 100.0) - num278 = MathHelper.Lerp(300f, 600f, (float) (((double) projectile1.ai[0] - 100.0) / 200.0)); - if ((double) num278 > 600.0) - num278 = 600f; - if ((double) projectile1.ai[0] >= 500.0) - num278 = MathHelper.Lerp(600f, 1200f, (float) (((double) projectile1.ai[0] - 500.0) / 100.0)); - float rotation2 = projectile1.rotation; - Texture2D texture2D = TextureAssets.Projectile[projectile1.type].Value; - int num279 = (int) ((double) projectile1.ai[0] / 6.0); - Vector2 spinningpoint = new Vector2(0.0f, -num278); - for (int index = 0; (double) index < 10.0; ++index) - { - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: 5, frameY: ((num279 + index) % 5)); - float rotation3 = rotation2 + 0.6283185f * (float) index; - Vector2 vec = spinningpoint.RotatedBy((double) rotation3) / 3f + projectile1.Center; - Microsoft.Xna.Framework.Color alpha = projectile1.GetAlpha(Lighting.GetColor(vec.ToTileCoordinates())); - alpha.A /= (byte) 2; - Main.EntitySpriteDraw(texture2D, vec - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(r), alpha, rotation3, r.Size() / 2f, projectile1.scale, SpriteEffects.None, 0); - } - for (int index = 0; (double) index < 20.0; ++index) - { - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: 5, frameY: ((num279 + index) % 5)); - float rotation4 = (float) (-(double) rotation2 + 0.314159274101257 * (double) index) * 2f; - Vector2 vec = spinningpoint.RotatedBy((double) rotation4) + projectile1.Center; - Microsoft.Xna.Framework.Color alpha = projectile1.GetAlpha(Lighting.GetColor(vec.ToTileCoordinates())); - alpha.A /= (byte) 2; - Main.EntitySpriteDraw(texture2D, vec - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(r), alpha, rotation4, r.Size() / 2f, projectile1.scale, SpriteEffects.None, 0); - } - } - else if (projectile1.type == 536 || projectile1.type == 591 || projectile1.type == 607) - { - Texture2D texture2D = TextureAssets.Projectile[projectile1.type].Value; - Vector2 position = projectile1.position + new Vector2((float) projectile1.width, (float) projectile1.height) / 2f + Vector2.UnitY * projectile1.gfxOffY - Main.screenPosition; - Vector2 scale = new Vector2(1f, projectile1.velocity.Length() / (float) texture2D.Height); - Main.EntitySpriteDraw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(), projectile1.GetAlpha(color10), projectile1.rotation, texture2D.Frame().Bottom(), scale, spriteEffects, 0); - } - else if (projectile1.type == 688 || projectile1.type == 689 || projectile1.type == 690) - { - Texture2D texture2D3 = TextureAssets.Projectile[projectile1.type].Value; - Vector2 position14 = projectile1.Top + Vector2.UnitY * projectile1.gfxOffY - Main.screenPosition; - Microsoft.Xna.Framework.Rectangle r3 = texture2D3.Frame(verticalFrames: Main.projFrames[projectile1.type], frameY: projectile1.frame); - Vector2 origin7 = r3.Size() * new Vector2(0.5f, 0.0f); - Microsoft.Xna.Framework.Color color53 = Microsoft.Xna.Framework.Color.Lerp(projectile1.GetAlpha(color10), Microsoft.Xna.Framework.Color.White, 0.5f); - Microsoft.Xna.Framework.Color color54 = color53; - color54.A = (byte) 127; - Texture2D texture = (Texture2D) null; - Texture2D texture2D4 = (Texture2D) null; - switch (projectile1.type) - { - case 688: - texture = TextureAssets.GlowMask[228].Value; - texture2D4 = TextureAssets.Extra[86].Value; - break; - case 689: - texture = TextureAssets.GlowMask[229].Value; - texture2D4 = TextureAssets.Extra[87].Value; - break; - case 690: - texture = TextureAssets.GlowMask[230].Value; - texture2D4 = TextureAssets.Extra[88].Value; - break; - } - Main.EntitySpriteDraw(texture2D3, position14, new Microsoft.Xna.Framework.Rectangle?(r3), color53, projectile1.rotation, origin7, projectile1.scale, spriteEffects, 0); - if (texture != null) - Main.EntitySpriteDraw(texture, position14, new Microsoft.Xna.Framework.Rectangle?(r3), color54, projectile1.rotation, origin7, projectile1.scale, spriteEffects, 0); - if (texture2D4 == null) - return; - Vector2 position15 = projectile1.Center + Vector2.UnitY * projectile1.gfxOffY - Main.screenPosition; - Microsoft.Xna.Framework.Rectangle r4 = texture2D4.Frame(); - Vector2 origin8 = r4.Size() * new Vector2(0.5f, 1f); - origin8.Y -= 2f; - Main.EntitySpriteDraw(texture2D4, position15, new Microsoft.Xna.Framework.Rectangle?(r4), color53, projectile1.rotation, origin8, projectile1.scale, spriteEffects, 0); - } - else if (projectile1.type == 694 || projectile1.type == 695 || projectile1.type == 696) - { - Texture2D texture2D = TextureAssets.Projectile[projectile1.type].Value; - Vector2 position = projectile1.Bottom + Vector2.UnitY * projectile1.gfxOffY - Main.screenPosition; - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: Main.projFrames[projectile1.type], frameY: projectile1.frame); - Vector2 origin = r.Size() * new Vector2(0.5f, 1f); - origin.Y -= 8f; - switch (projectile1.type) - { - case 694: - case 695: - origin.X += 3f; - break; - } - Microsoft.Xna.Framework.Color color55 = Microsoft.Xna.Framework.Color.Lerp(projectile1.GetAlpha(color10), Microsoft.Xna.Framework.Color.White, 0.0f); - Main.EntitySpriteDraw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(r), color55, projectile1.rotation, origin, projectile1.scale, spriteEffects, 0); - Main.EntitySpriteDraw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(r), color55 * 0.3f, projectile1.rotation, origin, projectile1.scale * 1.1f, spriteEffects, 0); - } - else if (projectile1.type == 409) - { - Texture2D texture = TextureAssets.Projectile[projectile1.type].Value; - int height = TextureAssets.Projectile[projectile1.type].Height() / Main.projFrames[projectile1.type]; - int y = height * projectile1.frame; - int num280 = 10; - int num281 = 2; - float num282 = 0.5f; - for (int index = 1; index < num280; index += num281) - { - ref Vector2 local = ref projectile1.oldPos[index]; - Microsoft.Xna.Framework.Color newColor = color10; - Microsoft.Xna.Framework.Color color56 = projectile1.GetAlpha(newColor) * ((float) (num280 - index) / 15f); - Vector2 vector2 = projectile1.oldPos[index] - Main.screenPosition + new Vector2(x17 + (float) num209, (float) (projectile1.height / 2) + projectile1.gfxOffY); - Main.EntitySpriteDraw(texture, projectile1.oldPos[index] + new Vector2((float) projectile1.width, (float) projectile1.height) / 2f - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y, texture.Width, height)), color56, projectile1.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), MathHelper.Lerp(projectile1.scale, num282, (float) index / 15f), spriteEffects, 0); - } - Main.EntitySpriteDraw(texture, projectile1.Center - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y, texture.Width, height)), projectile1.GetAlpha(color10), projectile1.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), projectile1.scale, spriteEffects, 0); - } - else if (projectile1.type == 437) - { - Texture2D texture = TextureAssets.Projectile[projectile1.type].Value; - int height = TextureAssets.Projectile[projectile1.type].Height() / Main.projFrames[projectile1.type]; - int y = height * projectile1.frame; - int num283 = 10; - int num284 = 2; - float num285 = 0.2f; - for (int index = 1; index < num283; index += num284) - { - ref Vector2 local = ref projectile1.oldPos[index]; - Microsoft.Xna.Framework.Color newColor = color10; - Microsoft.Xna.Framework.Color color57 = projectile1.GetAlpha(newColor) * ((float) (num283 - index) / 15f); - Vector2 vector2 = projectile1.oldPos[index] - Main.screenPosition + new Vector2(x17 + (float) num209, (float) (projectile1.height / 2) + projectile1.gfxOffY); - Main.EntitySpriteDraw(texture, projectile1.oldPos[index] + new Vector2((float) projectile1.width, (float) projectile1.height) / 2f - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y, texture.Width, height)), color57, projectile1.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), MathHelper.Lerp(projectile1.scale, num285, (float) index / 15f), spriteEffects, 0); - } - Main.EntitySpriteDraw(texture, projectile1.Center - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y, texture.Width, height)), Microsoft.Xna.Framework.Color.White, projectile1.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), projectile1.scale + 0.2f, spriteEffects, 0); - Main.EntitySpriteDraw(texture, projectile1.Center - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y, texture.Width, height)), projectile1.GetAlpha(Microsoft.Xna.Framework.Color.White), projectile1.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), projectile1.scale + 0.2f, spriteEffects, 0); - } - else if (projectile1.type == 384 || projectile1.type == 386) - { - Texture2D texture = TextureAssets.Projectile[projectile1.type].Value; - int height = TextureAssets.Projectile[projectile1.type].Height() / Main.projFrames[projectile1.type]; - int y = height * projectile1.frame; - Main.EntitySpriteDraw(texture, projectile1.Center - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y, texture.Width, height)), projectile1.GetAlpha(color10), projectile1.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), projectile1.scale, spriteEffects, 0); - } - else if (projectile1.type == 439 || projectile1.type == 460 || projectile1.type == 600 || projectile1.type == 615 || projectile1.type == 630 || projectile1.type == 633 || projectile1.type == 705 || projectile1.type == 714) - { - Texture2D texture = TextureAssets.Projectile[projectile1.type].Value; - if ((double) Main.player[projectile1.owner].gravDir == -1.0) - { - if (projectile1.type == 705) - spriteEffects |= SpriteEffects.FlipVertically; - if (projectile1.type == 615 || projectile1.type == 714) - { - if (Main.player[projectile1.owner].direction == 1) - spriteEffects = SpriteEffects.FlipVertically; - else if (Main.player[projectile1.owner].direction == -1) - spriteEffects = SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically; - } - else if (projectile1.type == 600 || projectile1.type == 439) - { - if (Main.player[projectile1.owner].direction == 1) - spriteEffects = SpriteEffects.FlipHorizontally; - else if (Main.player[projectile1.owner].direction == -1) - spriteEffects = SpriteEffects.None; - } - } - int height = TextureAssets.Projectile[projectile1.type].Height() / Main.projFrames[projectile1.type]; - int y15 = height * projectile1.frame; - Vector2 position = (projectile1.position + new Vector2((float) projectile1.width, (float) projectile1.height) / 2f + Vector2.UnitY * projectile1.gfxOffY - Main.screenPosition).Floor(); - float num286 = 1f; - if (Main.player[projectile1.owner].shroomiteStealth && Main.player[projectile1.owner].inventory[Main.player[projectile1.owner].selectedItem].ranged) - { - float num287 = Main.player[projectile1.owner].stealth; - if ((double) num287 < 0.03) - num287 = 0.03f; - double num288 = (1.0 + (double) num287 * 10.0) / 11.0; - color10 *= num287; - num286 = num287; - } - if (Main.player[projectile1.owner].setVortex && Main.player[projectile1.owner].inventory[Main.player[projectile1.owner].selectedItem].ranged) - { - float num289 = Main.player[projectile1.owner].stealth; - if ((double) num289 < 0.03) - num289 = 0.03f; - double num290 = (1.0 + (double) num289 * 10.0) / 11.0; - color10 = color10.MultiplyRGBA(new Microsoft.Xna.Framework.Color(Vector4.Lerp(Vector4.One, new Vector4(0.0f, 0.12f, 0.16f, 0.0f), 1f - num289))); - num286 = num289; - } - if (projectile1.type == 714) - { - y15 = 0; - Main.instance.LoadItem(3930); - texture = TextureAssets.Item[3930].Value; - } - Main.EntitySpriteDraw(texture, position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y15, texture.Width, height)), projectile1.GetAlpha(color10), projectile1.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), projectile1.scale, spriteEffects, 0); - if (projectile1.type == 439) - Main.EntitySpriteDraw(TextureAssets.GlowMask[35].Value, position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y15, texture.Width, height)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * num286, projectile1.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), projectile1.scale, spriteEffects, 0); - else if (projectile1.type == 714) - { - int y16 = height * projectile1.frame; - Microsoft.Xna.Framework.Color rgb = Main.hslToRgb((float) ((double) projectile1.ai[0] / 90.0 % 1.0), 1f, 0.5f); - rgb.A = (byte) 120; - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y16, texture.Width, height)), rgb * num286, projectile1.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), projectile1.scale, spriteEffects, 0); - } - else if (projectile1.type == 615) - Main.EntitySpriteDraw(TextureAssets.GlowMask[192].Value, position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y15, texture.Width, height)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue) * num286, projectile1.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), projectile1.scale, spriteEffects, 0); - else if (projectile1.type == 630) - { - Main.EntitySpriteDraw(TextureAssets.GlowMask[200].Value, position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y15, texture.Width, height)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue) * num286, projectile1.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), projectile1.scale, spriteEffects, 0); - if ((double) projectile1.localAI[0] <= 0.0) - return; - int frameY = 6 - (int) ((double) projectile1.localAI[0] / 1.0); - Texture2D texture2D = TextureAssets.Extra[65].Value; - Main.EntitySpriteDraw(texture2D, position + Vector2.Normalize(projectile1.velocity) * 2f, new Microsoft.Xna.Framework.Rectangle?(texture2D.Frame(verticalFrames: 6, frameY: frameY)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue) * num286, projectile1.rotation, new Vector2(spriteEffects.HasFlag((Enum) SpriteEffects.FlipHorizontally) ? (float) texture2D.Width : 0.0f, (float) ((double) height / 2.0 - 2.0)), projectile1.scale, spriteEffects, 0); - } - else if (projectile1.type == 600) - { - Microsoft.Xna.Framework.Color portalColor = PortalHelper.GetPortalColor(projectile1.owner, (int) projectile1.ai[1]); - portalColor.A = (byte) 70; - Main.EntitySpriteDraw(TextureAssets.GlowMask[173].Value, position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y15, texture.Width, height)), portalColor, projectile1.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), projectile1.scale, spriteEffects, 0); - } - else if (projectile1.type == 460) - { - if ((double) Math.Abs(projectile1.rotation - 1.570796f) > 1.57079637050629) - spriteEffects |= SpriteEffects.FlipVertically; - Main.EntitySpriteDraw(TextureAssets.GlowMask[102].Value, position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y15, texture.Width, height)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), projectile1.rotation - 1.570796f, new Vector2((float) texture.Width / 2f, (float) height / 2f), projectile1.scale, spriteEffects, 0); - if ((double) projectile1.ai[0] <= 180.0 || Main.projectile[(int) projectile1.ai[1]].type != 461) - return; - this.DrawProj((int) projectile1.ai[1]); - } - else - { - if (projectile1.type != 633) - return; - float num291 = (float) (Math.Cos(6.28318548202515 * ((double) projectile1.ai[0] / 30.0)) * 2.0 + 2.0); - if ((double) projectile1.ai[0] > 120.0) - num291 = 4f; - for (float num292 = 0.0f; (double) num292 < 4.0; ++num292) - Main.EntitySpriteDraw(texture, position + Vector2.UnitY.RotatedBy((double) num292 * 6.28318548202515 / 4.0) * num291, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y15, texture.Width, height)), projectile1.GetAlpha(color10).MultiplyRGBA(new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0)) * 0.03f, projectile1.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), projectile1.scale, spriteEffects, 0); - } - } - else if (projectile1.type == 442) - { - Texture2D texture = TextureAssets.Projectile[projectile1.type].Value; - int height = TextureAssets.Projectile[projectile1.type].Height() / Main.projFrames[projectile1.type]; - int y = height * projectile1.frame; - Vector2 position = projectile1.position + new Vector2((float) projectile1.width, (float) projectile1.height) / 2f + Vector2.UnitY * projectile1.gfxOffY - Main.screenPosition; - Main.EntitySpriteDraw(texture, position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y, texture.Width, height)), projectile1.GetAlpha(color10), projectile1.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), projectile1.scale, spriteEffects, 0); - Main.EntitySpriteDraw(TextureAssets.GlowMask[37].Value, position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y, texture.Width, height)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * (float) (1.0 - (double) projectile1.alpha / (double) byte.MaxValue), projectile1.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), projectile1.scale, spriteEffects, 0); - } - else if (projectile1.type == 447) - { - Texture2D texture = TextureAssets.Projectile[projectile1.type].Value; - Texture2D texture2D = TextureAssets.Extra[4].Value; - int num293 = texture.Height / Main.projFrames[projectile1.type]; - int num294 = num293 * projectile1.frame; - int height = texture2D.Height / Main.projFrames[projectile1.type]; - int y = height * projectile1.frame; - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, y, texture2D.Width, height); - Vector2 position = projectile1.position + new Vector2((float) projectile1.width, 0.0f) / 2f + Vector2.UnitY * projectile1.gfxOffY - Main.screenPosition; - Main.EntitySpriteDraw(TextureAssets.Extra[4].Value, position, new Microsoft.Xna.Framework.Rectangle?(rectangle), projectile1.GetAlpha(color10), projectile1.rotation, new Vector2((float) (texture2D.Width / 2), 0.0f), projectile1.scale, spriteEffects, 0); - int num295 = projectile1.height - num293 - 14; - if (num295 < 0) - num295 = 0; - if (num295 > 0) - { - if (y == height * 3) - y = height * 2; - Main.EntitySpriteDraw(TextureAssets.Extra[4].Value, position + Vector2.UnitY * (float) (height - 1), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y + height - 1, texture2D.Width, 1)), projectile1.GetAlpha(color10), projectile1.rotation, new Vector2((float) (texture2D.Width / 2), 0.0f), new Vector2(1f, (float) num295), spriteEffects, 0); - } - rectangle.Width = texture.Width; - rectangle.Y = num294; - Main.EntitySpriteDraw(texture, position + Vector2.UnitY * (float) (height - 1 + num295), new Microsoft.Xna.Framework.Rectangle?(rectangle), projectile1.GetAlpha(color10), projectile1.rotation, new Vector2((float) texture.Width / 2f, 0.0f), projectile1.scale, spriteEffects, 0); - } - else if (projectile1.type == 455) - { - if (projectile1.velocity == Vector2.Zero) - return; - Texture2D texture2D5 = TextureAssets.Projectile[projectile1.type].Value; - Texture2D texture = TextureAssets.Extra[21].Value; - Texture2D texture2D6 = TextureAssets.Extra[22].Value; - float num296 = projectile1.localAI[1]; - Microsoft.Xna.Framework.Color color58 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * 0.9f; - Main.EntitySpriteDraw(texture2D5, projectile1.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(), color58, projectile1.rotation, texture2D5.Size() / 2f, projectile1.scale, SpriteEffects.None, 0); - float num297 = num296 - (float) (texture2D5.Height / 2 + texture2D6.Height) * projectile1.scale; - Vector2 vector2 = projectile1.Center + projectile1.velocity * projectile1.scale * (float) texture2D5.Height / 2f; - if ((double) num297 > 0.0) - { - float num298 = 0.0f; - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, 16 * (projectile1.timeLeft / 3 % 5), texture.Width, 16); - while ((double) num298 + 1.0 < (double) num297) - { - if ((double) num297 - (double) num298 < (double) rectangle.Height) - rectangle.Height = (int) ((double) num297 - (double) num298); - Main.EntitySpriteDraw(texture, vector2 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(rectangle), color58, projectile1.rotation, new Vector2((float) (rectangle.Width / 2), 0.0f), projectile1.scale, SpriteEffects.None, 0); - num298 += (float) rectangle.Height * projectile1.scale; - vector2 += projectile1.velocity * (float) rectangle.Height * projectile1.scale; - rectangle.Y += 16; - if (rectangle.Y + rectangle.Height > texture.Height) - rectangle.Y = 0; - } - } - Main.EntitySpriteDraw(texture2D6, vector2 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(), color58, projectile1.rotation, texture2D6.Frame().Top(), projectile1.scale, SpriteEffects.None, 0); - } - else if (projectile1.type == 461) - { - if (projectile1.velocity == Vector2.Zero) - return; - Texture2D texture2D = TextureAssets.Projectile[projectile1.type].Value; - float num299 = projectile1.localAI[1]; - Microsoft.Xna.Framework.Color color59 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * 0.9f; - Microsoft.Xna.Framework.Rectangle r = new Microsoft.Xna.Framework.Rectangle(0, 0, texture2D.Width, 22); - Vector2 vector2_20 = new Vector2(0.0f, Main.player[projectile1.owner].gfxOffY); - Main.EntitySpriteDraw(texture2D, projectile1.Center.Floor() - Main.screenPosition + vector2_20, new Microsoft.Xna.Framework.Rectangle?(r), color59, projectile1.rotation, r.Size() / 2f, projectile1.scale, SpriteEffects.None, 0); - float num300 = num299 - 33f * projectile1.scale; - Vector2 vector2_21 = projectile1.Center.Floor() + projectile1.velocity * projectile1.scale * 10.5f; - r = new Microsoft.Xna.Framework.Rectangle(0, 25, texture2D.Width, 28); - if ((double) num300 > 0.0) - { - float num301 = 0.0f; - while ((double) num301 + 1.0 < (double) num300) - { - if ((double) num300 - (double) num301 < (double) r.Height) - r.Height = (int) ((double) num300 - (double) num301); - Main.EntitySpriteDraw(texture2D, vector2_21 - Main.screenPosition + vector2_20, new Microsoft.Xna.Framework.Rectangle?(r), color59, projectile1.rotation, new Vector2((float) (r.Width / 2), 0.0f), projectile1.scale, SpriteEffects.None, 0); - num301 += (float) r.Height * projectile1.scale; - vector2_21 += projectile1.velocity * (float) r.Height * projectile1.scale; - } - } - r = new Microsoft.Xna.Framework.Rectangle(0, 56, texture2D.Width, 22); - Main.EntitySpriteDraw(texture2D, vector2_21 - Main.screenPosition + vector2_20, new Microsoft.Xna.Framework.Rectangle?(r), color59, projectile1.rotation, texture2D.Frame().Top(), projectile1.scale, SpriteEffects.None, 0); - } - else if (projectile1.type == 632) - { - if (projectile1.velocity == Vector2.Zero) - return; - Texture2D tex = TextureAssets.Projectile[projectile1.type].Value; - float num302 = projectile1.localAI[1]; - float laserLuminance = 0.5f; - float laserAlphaMultiplier = 0.0f; - Microsoft.Xna.Framework.Color rgb = Main.hslToRgb(projectile1.GetLastPrismHue(projectile1.ai[0], ref laserLuminance, ref laserAlphaMultiplier), 1f, laserLuminance); - rgb.A = (byte) ((double) rgb.A * (double) laserAlphaMultiplier); - Vector2 vector2_22 = projectile1.Center.Floor() + projectile1.velocity * projectile1.scale * 10.5f; - float num303 = num302 - projectile1.scale * 14.5f * projectile1.scale; - Vector2 scale = new Vector2(projectile1.scale); - DelegateMethods.f_1 = 1f; - DelegateMethods.c_1 = rgb * 0.75f * projectile1.Opacity; - Vector2 vector2_23 = projectile1.oldPos[0] + new Vector2((float) projectile1.width, (float) projectile1.height) / 2f + Vector2.UnitY * projectile1.gfxOffY - Main.screenPosition; - Utils.DrawLaser(Main.spriteBatch, tex, vector2_22 - Main.screenPosition, vector2_22 + projectile1.velocity * num303 - Main.screenPosition, scale, new Utils.LaserLineFraming(DelegateMethods.RainbowLaserDraw)); - DelegateMethods.c_1 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue) * 0.75f * projectile1.Opacity; - Utils.DrawLaser(Main.spriteBatch, tex, vector2_22 - Main.screenPosition, vector2_22 + projectile1.velocity * num303 - Main.screenPosition, scale / 2f, new Utils.LaserLineFraming(DelegateMethods.RainbowLaserDraw)); - } - else if (projectile1.type == 642) - { - if (projectile1.velocity == Vector2.Zero) - return; - Texture2D tex = TextureAssets.Projectile[projectile1.type].Value; - float num304 = projectile1.localAI[1]; - Microsoft.Xna.Framework.Color color60 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue); - Vector2 vector2_24 = projectile1.Center.Floor(); - float num305 = num304 - projectile1.scale * 10.5f; - Vector2 scale = new Vector2(projectile1.scale); - DelegateMethods.f_1 = 1f; - DelegateMethods.c_1 = color60; - DelegateMethods.i_1 = 54000 - (int) Main.time / 2; - Vector2 vector2_25 = projectile1.oldPos[0] + new Vector2((float) projectile1.width, (float) projectile1.height) / 2f + Vector2.UnitY * projectile1.gfxOffY - Main.screenPosition; - Utils.DrawLaser(Main.spriteBatch, tex, vector2_24 - Main.screenPosition, vector2_24 + projectile1.velocity * num305 - Main.screenPosition, scale, new Utils.LaserLineFraming(DelegateMethods.TurretLaserDraw)); - DelegateMethods.c_1 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue) * 0.75f * projectile1.Opacity; - Utils.DrawLaser(Main.spriteBatch, tex, vector2_24 - Main.screenPosition, vector2_24 + projectile1.velocity * num305 - Main.screenPosition, scale / 2f, new Utils.LaserLineFraming(DelegateMethods.TurretLaserDraw)); - } - else if (projectile1.type == 611) - { - Vector2 vector2_26 = projectile1.position + new Vector2((float) projectile1.width, (float) projectile1.height) / 2f + Vector2.UnitY * projectile1.gfxOffY - Main.screenPosition; - Texture2D texture2D = TextureAssets.Projectile[projectile1.type].Value; - Microsoft.Xna.Framework.Color alpha = projectile1.GetAlpha(color10); - if (projectile1.velocity == Vector2.Zero) - return; - float num306 = projectile1.velocity.Length() + 16f; - bool flag = (double) num306 < 100.0; - Vector2 vector2_27 = Vector2.Normalize(projectile1.velocity); - Microsoft.Xna.Framework.Rectangle r = new Microsoft.Xna.Framework.Rectangle(0, 2, texture2D.Width, 40); - Vector2 vector2_28 = new Vector2(0.0f, Main.player[projectile1.owner].gfxOffY); - float rotation = projectile1.rotation + 3.141593f; - Main.EntitySpriteDraw(texture2D, projectile1.Center.Floor() - Main.screenPosition + vector2_28, new Microsoft.Xna.Framework.Rectangle?(r), alpha, rotation, r.Size() / 2f - Vector2.UnitY * 4f, projectile1.scale, SpriteEffects.None, 0); - float num307 = num306 - 40f * projectile1.scale; - Vector2 vector2_29 = projectile1.Center.Floor() + vector2_27 * projectile1.scale * 24f; - r = new Microsoft.Xna.Framework.Rectangle(0, 68, texture2D.Width, 18); - if ((double) num307 > 0.0) - { - float num308 = 0.0f; - while ((double) num308 + 1.0 < (double) num307) - { - if ((double) num307 - (double) num308 < (double) r.Height) - r.Height = (int) ((double) num307 - (double) num308); - Main.EntitySpriteDraw(texture2D, vector2_29 - Main.screenPosition + vector2_28, new Microsoft.Xna.Framework.Rectangle?(r), alpha, rotation, new Vector2((float) (r.Width / 2), 0.0f), projectile1.scale, SpriteEffects.None, 0); - num308 += (float) r.Height * projectile1.scale; - vector2_29 += vector2_27 * (float) r.Height * projectile1.scale; - } - } - Vector2 vector2_30 = vector2_29; - Vector2 vector2_31 = projectile1.Center.Floor() + vector2_27 * projectile1.scale * 24f; - r = new Microsoft.Xna.Framework.Rectangle(0, 46, texture2D.Width, 18); - int num309 = 18; - if (flag) - num309 = 9; - float num310 = num307; - if ((double) num307 > 0.0) - { - float num311 = 0.0f; - float num312 = num310 / (float) num309; - float num313 = num311 + num312 * 0.25f; - Vector2 vector2_32 = vector2_31 + vector2_27 * num312 * 0.25f; - for (int index = 0; index < num309; ++index) - { - float num314 = num312; - if (index == 0) - num314 *= 0.75f; - Main.EntitySpriteDraw(texture2D, vector2_32 - Main.screenPosition + vector2_28, new Microsoft.Xna.Framework.Rectangle?(r), alpha, rotation, new Vector2((float) (r.Width / 2), 0.0f), projectile1.scale, SpriteEffects.None, 0); - num313 += num314; - vector2_32 += vector2_27 * num314; - } - } - r = new Microsoft.Xna.Framework.Rectangle(0, 90, texture2D.Width, 48); - Main.EntitySpriteDraw(texture2D, vector2_30 - Main.screenPosition + vector2_28, new Microsoft.Xna.Framework.Rectangle?(r), alpha, rotation, texture2D.Frame().Top(), projectile1.scale, SpriteEffects.None, 0); - } - else if (projectile1.type == 537) - { - if (projectile1.velocity == Vector2.Zero) - return; - Texture2D texture2D = TextureAssets.Projectile[projectile1.type].Value; - float num315 = projectile1.localAI[1]; - Microsoft.Xna.Framework.Color color61 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * 0.9f; - Microsoft.Xna.Framework.Rectangle r = new Microsoft.Xna.Framework.Rectangle(0, 0, texture2D.Width, 22); - Vector2 vector2_33 = new Vector2(0.0f, Main.npc[(int) projectile1.ai[1]].gfxOffY); - Main.EntitySpriteDraw(texture2D, projectile1.Center.Floor() - Main.screenPosition + vector2_33, new Microsoft.Xna.Framework.Rectangle?(r), color61, projectile1.rotation, r.Size() / 2f, projectile1.scale, SpriteEffects.None, 0); - float num316 = num315 - 33f * projectile1.scale; - Vector2 vector2_34 = projectile1.Center.Floor() + projectile1.velocity * projectile1.scale * 10.5f; - r = new Microsoft.Xna.Framework.Rectangle(0, 25, texture2D.Width, 28); - if ((double) num316 > 0.0) - { - float num317 = 0.0f; - while ((double) num317 + 1.0 < (double) num316) - { - if ((double) num316 - (double) num317 < (double) r.Height) - r.Height = (int) ((double) num316 - (double) num317); - Main.EntitySpriteDraw(texture2D, vector2_34 - Main.screenPosition + vector2_33, new Microsoft.Xna.Framework.Rectangle?(r), color61, projectile1.rotation, new Vector2((float) (r.Width / 2), 0.0f), projectile1.scale, SpriteEffects.None, 0); - num317 += (float) r.Height * projectile1.scale; - vector2_34 += projectile1.velocity * (float) r.Height * projectile1.scale; - } - } - r = new Microsoft.Xna.Framework.Rectangle(0, 56, texture2D.Width, 22); - Main.EntitySpriteDraw(texture2D, vector2_34 - Main.screenPosition + vector2_33, new Microsoft.Xna.Framework.Rectangle?(r), color61, projectile1.rotation, texture2D.Frame().Top(), projectile1.scale, SpriteEffects.None, 0); - } - else if (projectile1.type == 456) - { - Texture2D texture2D7 = TextureAssets.Projectile[projectile1.type].Value; - Texture2D texture = TextureAssets.Extra[23].Value; - Texture2D texture2D8 = TextureAssets.Extra[24].Value; - Vector2 vector2_35 = new Vector2(0.0f, 216f); - Vector2 vector2_36 = Main.npc[(int) Math.Abs(projectile1.ai[0]) - 1].Center - projectile1.Center + vector2_35; - float num318 = vector2_36.Length(); - Vector2 vector2_37 = Vector2.Normalize(vector2_36); - Microsoft.Xna.Framework.Rectangle r5 = texture2D7.Frame(); - r5.Height /= 4; - r5.Y += projectile1.frame * r5.Height; - Microsoft.Xna.Framework.Color newColor1 = Microsoft.Xna.Framework.Color.Lerp(color10, Microsoft.Xna.Framework.Color.White, 0.3f); - Main.EntitySpriteDraw(texture2D7, projectile1.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(r5), projectile1.GetAlpha(newColor1), projectile1.rotation, r5.Size() / 2f, projectile1.scale, SpriteEffects.None, 0); - float num319 = num318 - (float) (r5.Height / 2 + texture2D8.Height) * projectile1.scale; - Vector2 vec = projectile1.Center + vector2_37 * projectile1.scale * (float) r5.Height / 2f; - if ((double) num319 > 0.0) - { - float num320 = 0.0f; - Microsoft.Xna.Framework.Rectangle r6 = new Microsoft.Xna.Framework.Rectangle(0, 0, texture.Width, texture.Height); - while ((double) num320 + 1.0 < (double) num319) - { - if ((double) num319 - (double) num320 < (double) r6.Height) - r6.Height = (int) ((double) num319 - (double) num320); - Microsoft.Xna.Framework.Point tileCoordinates = vec.ToTileCoordinates(); - Microsoft.Xna.Framework.Color newColor2 = Microsoft.Xna.Framework.Color.Lerp(Lighting.GetColor(tileCoordinates.X, tileCoordinates.Y), Microsoft.Xna.Framework.Color.White, 0.3f); - Main.EntitySpriteDraw(texture, vec - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(r6), projectile1.GetAlpha(newColor2), projectile1.rotation, r6.Bottom(), projectile1.scale, SpriteEffects.None, 0); - num320 += (float) r6.Height * projectile1.scale; - vec += vector2_37 * (float) r6.Height * projectile1.scale; - } - } - Microsoft.Xna.Framework.Point tileCoordinates1 = vec.ToTileCoordinates(); - Microsoft.Xna.Framework.Color color62 = Microsoft.Xna.Framework.Color.Lerp(Lighting.GetColor(tileCoordinates1.X, tileCoordinates1.Y), Microsoft.Xna.Framework.Color.White, 0.3f); - Microsoft.Xna.Framework.Rectangle rectangle = texture2D8.Frame(); - if ((double) num319 < 0.0) - rectangle.Height += (int) num319; - Main.EntitySpriteDraw(texture2D8, vec - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(rectangle), color62, projectile1.rotation, new Vector2((float) rectangle.Width / 2f, (float) rectangle.Height), projectile1.scale, SpriteEffects.None, 0); - } - else if (projectile1.type == 443) - { - Texture2D texture = TextureAssets.Projectile[projectile1.type].Value; - float num321 = 30f; - float num322 = num321 * 4f; - float num323 = 6.283185f * projectile1.ai[0] / num321; - float num324 = 6.283185f * projectile1.ai[0] / num322; - Vector2 vector2 = -Vector2.UnitY.RotatedBy((double) num323); - float scale6 = (float) (0.75 + (double) vector2.Y * 0.25); - float scale7 = (float) (0.800000011920929 - (double) vector2.Y * 0.200000002980232); - int height = TextureAssets.Projectile[projectile1.type].Height() / Main.projFrames[projectile1.type]; - int y = height * projectile1.frame; - Vector2 position = projectile1.position + new Vector2((float) projectile1.width, (float) projectile1.height) / 2f + Vector2.UnitY * projectile1.gfxOffY - Main.screenPosition; - Main.EntitySpriteDraw(texture, position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y, texture.Width, height)), projectile1.GetAlpha(color10), projectile1.rotation + num324, new Vector2((float) texture.Width / 2f, (float) height / 2f), scale6, spriteEffects, 0); - Main.EntitySpriteDraw(texture, position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y, texture.Width, height)), projectile1.GetAlpha(color10), projectile1.rotation + (6.283185f - num324), new Vector2((float) texture.Width / 2f, (float) height / 2f), scale7, spriteEffects, 0); - } - else if (projectile1.type == 656 || projectile1.type == 657) - { - float num325 = 900f; - if (projectile1.type == 657) - num325 = 300f; - float num326 = 15f; - float num327 = 15f; - float num328 = projectile1.ai[0]; - float num329 = MathHelper.Clamp(num328 / 30f, 0.0f, 1f); - if ((double) num328 > (double) num325 - 60.0) - num329 = MathHelper.Lerp(1f, 0.0f, (float) (((double) num328 - ((double) num325 - 60.0)) / 60.0)); - Microsoft.Xna.Framework.Point tileCoordinates = projectile1.Center.ToTileCoordinates(); - int topY; - int bottomY; - Collision.ExpandVertically(tileCoordinates.X, tileCoordinates.Y, out topY, out bottomY, (int) num326, (int) num327); - ++topY; - --bottomY; - float num330 = 0.2f; - Vector2 vector2_38 = new Vector2((float) tileCoordinates.X, (float) topY) * 16f + new Vector2(8f); - Vector2 vector2_39 = new Vector2((float) tileCoordinates.X, (float) bottomY) * 16f + new Vector2(8f); - Vector2.Lerp(vector2_38, vector2_39, 0.5f); - Vector2 vector2_40 = new Vector2(0.0f, vector2_39.Y - vector2_38.Y); - vector2_40.X = vector2_40.Y * num330; - Vector2 vector2_41 = new Vector2(vector2_38.X - vector2_40.X / 2f, vector2_38.Y); - Texture2D texture2D = TextureAssets.Projectile[projectile1.type].Value; - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(); - Vector2 origin = r.Size() / 2f; - float num331 = -0.06283186f * num328; - Vector2 spinningpoint = Vector2.UnitY.RotatedBy((double) num328 * 0.100000001490116); - float num332 = 0.0f; - float num333 = 5.1f; - Microsoft.Xna.Framework.Color color63 = new Microsoft.Xna.Framework.Color(212, 192, 100); - for (float y = (float) (int) vector2_39.Y; (double) y > (double) (int) vector2_38.Y; y -= num333) - { - num332 += num333; - float num334 = num332 / vector2_40.Y; - float num335 = (float) ((double) num332 * 6.28318548202515 / -20.0); - float num336 = num334 - 0.15f; - Vector2 vector2_42 = spinningpoint.RotatedBy((double) num335); - Vector2 vector2_43 = new Vector2(0.0f, num334 + 1f); - vector2_43.X = vector2_43.Y * num330; - Microsoft.Xna.Framework.Color color64 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, color63, num334 * 2f); - if ((double) num334 > 0.5) - color64 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, color63, (float) (2.0 - (double) num334 * 2.0)); - color64.A = (byte) ((double) color64.A * 0.5); - Microsoft.Xna.Framework.Color color65 = color64 * num329; - Vector2 vector2_44 = vector2_42 * (vector2_43 * 100f); - vector2_44.Y = 0.0f; - vector2_44.X = 0.0f; - Vector2 position = vector2_44 + (new Vector2(vector2_39.X, y) - Main.screenPosition); - Main.EntitySpriteDraw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(r), color65, num331 + num335, origin, 1f + num336, SpriteEffects.None, 0); - } - } - else if (projectile1.type == 704) - { - float num337 = 300f; - float num338 = projectile1.ai[0]; - float num339 = MathHelper.Clamp(num338 / 30f, 0.0f, 1f); - if ((double) num338 > (double) num337 - 60.0) - num339 = MathHelper.Lerp(1f, 0.0f, (float) (((double) num338 - ((double) num337 - 60.0)) / 60.0)); - float num340 = 0.2f; - Vector2 top = projectile1.Top; - Vector2 bottom = projectile1.Bottom; - Vector2.Lerp(top, bottom, 0.5f); - Vector2 vector2_45 = new Vector2(0.0f, bottom.Y - top.Y); - vector2_45.X = vector2_45.Y * num340; - Vector2 vector2_46 = new Vector2(top.X - vector2_45.X / 2f, top.Y); - Texture2D texture2D = TextureAssets.Projectile[projectile1.type].Value; - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(); - Vector2 origin = r.Size() / 2f; - float num341 = (float) (-0.157079637050629 * (double) num338 * ((double) projectile1.velocity.X > 0.0 ? -1.0 : 1.0)); - SpriteEffects effects = (double) projectile1.velocity.X > 0.0 ? SpriteEffects.FlipVertically : SpriteEffects.None; - bool flag10 = (double) projectile1.velocity.X > 0.0; - Vector2 spinningpoint = Vector2.UnitY.RotatedBy((double) num338 * 0.140000000596046); - float num342 = 0.0f; - float num343 = (float) (5.01000022888184 + (double) num338 / 150.0 * -0.899999976158142); - if ((double) num343 < 4.1100001335144) - num343 = 4.11f; - Microsoft.Xna.Framework.Color color66 = new Microsoft.Xna.Framework.Color(160, 140, 100, (int) sbyte.MaxValue); - Microsoft.Xna.Framework.Color color67 = new Microsoft.Xna.Framework.Color(140, 160, (int) byte.MaxValue, (int) sbyte.MaxValue); - float t = num338 % 60f; - Microsoft.Xna.Framework.Color color68 = (double) t >= 30.0 ? color67 * Utils.GetLerpValue(38f, 30f, t, true) : color67 * Utils.GetLerpValue(22f, 30f, t, true); - bool flag11 = color68 != Microsoft.Xna.Framework.Color.Transparent; - for (float y = (float) (int) bottom.Y; (double) y > (double) (int) top.Y; y -= num343) - { - num342 += num343; - float num344 = num342 / vector2_45.Y; - float num345 = (float) ((double) num342 * 6.28318548202515 / -20.0); - if (flag10) - num345 *= -1f; - float num346 = num344 - 0.35f; - Vector2 vector2_47 = spinningpoint.RotatedBy((double) num345); - Vector2 vector2_48 = new Vector2(0.0f, num344 + 1f); - vector2_48.X = vector2_48.Y * num340; - Microsoft.Xna.Framework.Color color69 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, color66, num344 * 2f); - if ((double) num344 > 0.5) - color69 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, color66, (float) (2.0 - (double) num344 * 2.0)); - color69.A = (byte) ((double) color69.A * 0.5); - Microsoft.Xna.Framework.Color color70 = color69 * num339; - Vector2 vector2_49 = vector2_47 * (vector2_48 * 100f); - vector2_49.Y = 0.0f; - vector2_49.X = 0.0f; - Vector2 position = vector2_49 + (new Vector2(bottom.X, y) - Main.screenPosition); - if (flag11) - { - Microsoft.Xna.Framework.Color color71 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, color68, num344 * 2f); - if ((double) num344 > 0.5) - color71 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, color68, (float) (2.0 - (double) num344 * 2.0)); - color71.A = (byte) ((double) color71.A * 0.5); - Microsoft.Xna.Framework.Color color72 = color71 * num339; - Main.EntitySpriteDraw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(r), color72, num341 + num345, origin, (float) ((1.0 + (double) num346) * 0.800000011920929), effects, 0); - } - Main.EntitySpriteDraw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(r), color70, num341 + num345, origin, 1f + num346, effects, 0); - } - } - else if (projectile1.type == 444 || projectile1.type == 446 || projectile1.type == 490 || projectile1.type == 464 || projectile1.type == 502 || projectile1.type == 538 || projectile1.type == 540 || projectile1.type == 579 || projectile1.type == 578 || projectile1.type == 813 || projectile1.type == 583 || projectile1.type == 584 || projectile1.type == 616 || projectile1.type == 617 || projectile1.type == 618 || projectile1.type == 641 || projectile1.type >= 646 && projectile1.type <= 649 || projectile1.type == 653 || projectile1.type == 186 || projectile1.type == 662 || projectile1.type == 685 || projectile1.type == 673 || projectile1.type == 676 || projectile1.type == 697 || projectile1.type == 699 || projectile1.type == 707 || projectile1.type == 708 || projectile1.type == 719 || projectile1.type == 761 || projectile1.type == 762 || projectile1.type == 763 || projectile1.type == 772 || projectile1.type == 802 || projectile1.type == 842 || projectile1.type == 865 || projectile1.type == 921 || projectile1.type == 926 || projectile1.type == 757 || projectile1.type == 25 || projectile1.type == 35 || projectile1.type == 63 || projectile1.type == 154 || projectile1.type == 247 || projectile1.type == 26 || projectile1.type == 928 || projectile1.type == 16 || projectile1.type == 34 || projectile1.type == 79 || projectile1.type == 936 || projectile1.type == 937 || projectile1.type == 938 || projectile1.type == 939 || projectile1.type == 940 || projectile1.type == 941 || projectile1.type == 942 || projectile1.type == 943 || projectile1.type == 944 || projectile1.type == 945 || (projectile1.type >= 776 && projectile1.type <= 801 || projectile1.type >= 803 && projectile1.type <= 810) && projectile1.type != 779 && projectile1.type != 783 && projectile1.type != 862 && projectile1.type != 863) - { - Vector2 position16 = projectile1.position + new Vector2((float) projectile1.width, (float) projectile1.height) / 2f + Vector2.UnitY * projectile1.gfxOffY - Main.screenPosition; - Texture2D texture2D9 = TextureAssets.Projectile[projectile1.type].Value; - Microsoft.Xna.Framework.Color color73 = projectile1.GetAlpha(color10); - Vector2 origin9 = new Vector2((float) texture2D9.Width, (float) texture2D9.Height) / 2f; - float rotation5 = projectile1.rotation; - Vector2 scale8 = Vector2.One * projectile1.scale; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); - if (projectile1.type == 446) - origin9.Y = 4f; - if (projectile1.type == 865) - { - position16 += new Vector2(1f, -1f); - spriteEffects = (double) projectile1.DirectionFrom(Main.player[projectile1.owner].Center).SafeNormalize(Vector2.Zero).X > 0.0 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - } - if (projectile1.type == 16) - { - float lerpValue = Utils.GetLerpValue(0.0f, 8f, projectile1.velocity.Length(), true); - rotation5 *= lerpValue; - scale8 *= 0.6f; - scale8.Y *= MathHelper.Lerp(1f, 0.8f, lerpValue); - scale8.X *= MathHelper.Lerp(1f, 1.5f, lerpValue); - } - if (projectile1.type == 34) - { - float lerpValue = Utils.GetLerpValue(0.0f, 8f, projectile1.velocity.Length(), true); - float num347 = rotation5 * lerpValue; - scale8.X *= MathHelper.Lerp(1f, 0.8f, lerpValue); - rotation5 = num347 + -1.570796f * lerpValue; - sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(texture2D9.Frame(verticalFrames: Main.projFrames[projectile1.type], frameY: projectile1.frame)); - origin9 = sourceRectangle.Value.Size() / 2f; - Vector2 vector2 = position16 - projectile1.velocity * 1f; - position16 = projectile1.oldPos[0] + projectile1.Size / 2f - Main.screenPosition - projectile1.velocity / 2f; - } - if (projectile1.type == 79) - { - rotation5 = 0.0f; - scale8 *= Utils.GetLerpValue(32f, 0.0f, projectile1.position.Distance(projectile1.oldPos[12]), true); - color73 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); - } - if (projectile1.type == 761 || projectile1.type == 762) - spriteEffects = projectile1.spriteDirection > 0 ? SpriteEffects.None : SpriteEffects.FlipVertically; - if (projectile1.type == 662 || projectile1.type == 685) - origin9 = new Vector2(6f, 6f); - if (projectile1.type == 699 || projectile1.type == 708) - { - Player player = Main.player[projectile1.owner]; - origin9 = new Vector2(projectile1.spriteDirection == 1 ? (float) texture2D9.Width - -8f : -8f, (double) player.gravDir == 1.0 ? -8f : (float) texture2D9.Height - -8f); - if ((double) player.gravDir == -1.0) - { - spriteEffects |= SpriteEffects.FlipVertically; - rotation5 += 1.570796f * (float) -projectile1.spriteDirection; - } - } - if (projectile1.type == 938 || projectile1.type == 939 || projectile1.type == 940 || projectile1.type == 941 || projectile1.type == 942 || projectile1.type == 943 || projectile1.type == 944 || projectile1.type == 945) - rotation5 -= 0.7853982f * (float) projectile1.spriteDirection; - if (projectile1.type == 502) - { - this.LoadProjectile(250); - Texture2D texture = TextureAssets.Projectile[250].Value; - Vector2 origin10 = new Vector2((float) (texture.Width / 2), 0.0f); - Vector2 vector2_50 = new Vector2((float) projectile1.width, (float) projectile1.height) / 2f; - Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; - white.A = (byte) 127; - for (int index = projectile1.oldPos.Length - 1; index > 0; --index) - { - Vector2 vector2_51 = projectile1.oldPos[index] + vector2_50; - if (!(vector2_51 == vector2_50)) - { - Vector2 vector2_52 = projectile1.oldPos[index - 1] + vector2_50; - float rotation6 = (vector2_52 - vector2_51).ToRotation() - 1.570796f; - Vector2 scale9 = new Vector2(1f, Vector2.Distance(vector2_51, vector2_52) / (float) texture.Height); - Microsoft.Xna.Framework.Color color74 = white * (float) (1.0 - (double) index / (double) projectile1.oldPos.Length); - Main.EntitySpriteDraw(texture, vector2_51 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(), color74, rotation6, origin10, scale9, spriteEffects, 0); - } - } - } - else if (projectile1.type == 540 && projectile1.velocity != Vector2.Zero) - { - float num348 = 0.0f; - if ((double) projectile1.ai[0] >= 10.0) - num348 = (float) (((double) projectile1.ai[0] - 10.0) / 10.0); - if ((double) projectile1.ai[0] >= 20.0) - num348 = (float) ((20.0 - (double) projectile1.ai[0]) / 10.0); - if ((double) num348 > 1.0) - num348 = 1f; - if ((double) num348 < 0.0) - num348 = 0.0f; - if ((double) num348 != 0.0) - { - Texture2D texture = TextureAssets.Extra[47].Value; - Vector2 origin11 = new Vector2((float) (texture.Width / 2), 0.0f); - Microsoft.Xna.Framework.Color color75 = color73 * num348 * 0.7f; - Vector2 vector2_53 = projectile1.Center - Main.screenPosition; - Vector2 vector2_54 = projectile1.velocity.ToRotation().ToRotationVector2() * (float) texture2D9.Width / 3f; - Vector2 zero = Vector2.Zero; - Vector2 position17 = vector2_53 + zero; - float rotation7 = projectile1.velocity.ToRotation() - 1.570796f; - Vector2 scale10 = new Vector2(1f, (projectile1.velocity.Length() - zero.Length() * 2f) / (float) texture.Height); - Main.EntitySpriteDraw(texture, position17, new Microsoft.Xna.Framework.Rectangle?(), color75, rotation7, origin11, scale10, SpriteEffects.None, 0); - } - } - if (projectile1.type == 578 || projectile1.type == 579 || projectile1.type == 641 || projectile1.type == 813) - { - Microsoft.Xna.Framework.Color color76 = color73 * 0.8f; - color76.A /= (byte) 2; - Microsoft.Xna.Framework.Color color77 = Microsoft.Xna.Framework.Color.Lerp(color73, Microsoft.Xna.Framework.Color.Black, 0.5f); - color77.A = color73.A; - float num349 = (float) (0.949999988079071 + (double) (projectile1.rotation * 0.75f).ToRotationVector2().Y * 0.100000001490116); - Microsoft.Xna.Framework.Color color78 = color77 * num349; - float scale11 = (float) (0.600000023841858 + (double) projectile1.scale * 0.600000023841858 * (double) num349); - Texture2D texture2D10 = TextureAssets.Extra[50].Value; - bool flag = true; - if (projectile1.type == 813) - { - flag = false; - texture2D10 = TextureAssets.Extra[131].Value; - } - Vector2 origin12 = texture2D10.Size() / 2f; - Main.EntitySpriteDraw(texture2D10, position16, new Microsoft.Xna.Framework.Rectangle?(), color78, (float) (-(double) rotation5 + 0.349999994039536), origin12, scale11, spriteEffects ^ SpriteEffects.FlipHorizontally, 0); - Main.EntitySpriteDraw(texture2D10, position16, new Microsoft.Xna.Framework.Rectangle?(), color73, -rotation5, origin12, projectile1.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0); - if (flag) - Main.EntitySpriteDraw(texture2D9, position16, new Microsoft.Xna.Framework.Rectangle?(), color76, (float) (-(double) rotation5 * 0.699999988079071), origin9, projectile1.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0); - Main.EntitySpriteDraw(texture2D10, position16, new Microsoft.Xna.Framework.Rectangle?(), color73 * 0.8f, rotation5 * 0.5f, origin12, projectile1.scale * 0.9f, spriteEffects, 0); - color73.A = (byte) 0; - if (projectile1.type == 813) - rotation5 = 0.0f; - } - if (projectile1.type == 617) - { - Microsoft.Xna.Framework.Color color79 = color73 * 0.8f; - color79.A /= (byte) 2; - Microsoft.Xna.Framework.Color color80 = Microsoft.Xna.Framework.Color.Lerp(color73, Microsoft.Xna.Framework.Color.Black, 0.5f); - color80.A = color73.A; - float num350 = (float) (0.949999988079071 + (double) (projectile1.rotation * 0.75f).ToRotationVector2().Y * 0.100000001490116); - Microsoft.Xna.Framework.Color color81 = color80 * num350; - float scale12 = (float) (0.600000023841858 + (double) projectile1.scale * 0.600000023841858 * (double) num350); - Main.EntitySpriteDraw(TextureAssets.Extra[50].Value, position16, new Microsoft.Xna.Framework.Rectangle?(), color81, (float) (-(double) projectile1.rotation + 0.349999994039536), origin9, scale12, spriteEffects ^ SpriteEffects.FlipHorizontally, 0); - Main.EntitySpriteDraw(TextureAssets.Extra[50].Value, position16, new Microsoft.Xna.Framework.Rectangle?(), color73, -projectile1.rotation, origin9, projectile1.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0); - Main.EntitySpriteDraw(texture2D9, position16, new Microsoft.Xna.Framework.Rectangle?(), color79, (float) (-(double) projectile1.rotation * 0.699999988079071), origin9, projectile1.scale, spriteEffects ^ SpriteEffects.FlipHorizontally, 0); - Main.EntitySpriteDraw(TextureAssets.Extra[50].Value, position16, new Microsoft.Xna.Framework.Rectangle?(), color73 * 0.8f, projectile1.rotation * 0.5f, origin9, projectile1.scale * 0.9f, spriteEffects, 0); - color73.A = (byte) 0; - } - if (projectile1.type == 757 || projectile1.type == 25 || projectile1.type == 35 || projectile1.type == 63 || projectile1.type == 154 || projectile1.type == 247 || projectile1.type == 26) - { - if ((double) projectile1.ai[0] == 1.0) - { - Microsoft.Xna.Framework.Color color82 = color73; - color82.A = (byte) 127; - color82 *= 0.5f; - int num351 = (int) projectile1.ai[1]; - if (num351 > 5) - num351 = 5; - for (float num352 = 1f; (double) num352 >= 0.0; num352 -= 0.125f) - { - float amount = 1f - num352; - Vector2 vector2 = projectile1.velocity * (float) -num351 * num352; - Main.EntitySpriteDraw(texture2D9, position16 + vector2, new Microsoft.Xna.Framework.Rectangle?(), color82 * amount, rotation5, origin9, projectile1.scale * 1.15f * MathHelper.Lerp(0.5f, 1f, amount), spriteEffects, 0); - } - } - } - else if (projectile1.type == 79) - { - Vector2 scale13 = scale8 * 1.4f; - Vector2 spinningpoint = new Vector2((float) (2.0 * (double) scale13.X + Math.Cos((double) Main.GlobalTimeWrappedHourly * 6.28318548202515) * 0.400000005960464), 0.0f).RotatedBy((double) rotation5 + (double) Main.GlobalTimeWrappedHourly * 6.28318548202515); - for (float Hue = 0.0f; (double) Hue < 1.0; Hue += 0.1666667f) - { - Microsoft.Xna.Framework.Color color83 = Main.hslToRgb(Hue, 1f, 0.5f) * 0.3f; - color83.A = (byte) 0; - Main.EntitySpriteDraw(texture2D9, position16 + spinningpoint.RotatedBy((double) Hue * 6.28318548202515), new Microsoft.Xna.Framework.Rectangle?(), color83, rotation5, origin9, scale13, spriteEffects, 0); - } - Main.EntitySpriteDraw(texture2D9, position16, new Microsoft.Xna.Framework.Rectangle?(), color73, rotation5, origin9, scale8, spriteEffects, 0); - } - if ((0 | (projectile1.type != 464 ? 0 : ((double) projectile1.ai[1] != 1.0 ? 1 : 0))) == 0) - Main.EntitySpriteDraw(texture2D9, position16, sourceRectangle, color73, rotation5, origin9, scale8, spriteEffects, 0); - if (projectile1.type == 464 && (double) projectile1.ai[1] != 1.0) - { - Texture2D texture2D11 = TextureAssets.Extra[35].Value; - Microsoft.Xna.Framework.Rectangle r = texture2D11.Frame(verticalFrames: 3); - origin9 = r.Size() / 2f; - Vector2 spinningpoint = new Vector2(0.0f, -720f).RotatedBy((double) projectile1.velocity.ToRotation()) * (float) ((double) projectile1.ai[0] % 45.0 / 45.0); - for (int index = 0; index < 6; ++index) - { - float num353 = (float) ((double) index * 6.28318548202515 / 6.0); - Vector2 vector2 = projectile1.Center + spinningpoint.RotatedBy((double) num353); - Main.EntitySpriteDraw(texture2D11, vector2 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(r), color73, (float) ((double) num353 + (double) projectile1.velocity.ToRotation() + 3.14159274101257), origin9, projectile1.scale, spriteEffects, 0); - r.Y += r.Height; - if (r.Y >= texture2D11.Height) - r.Y = 0; - } - } - else if (projectile1.type == 490) - { - Main.EntitySpriteDraw(TextureAssets.Extra[34].Value, position16, new Microsoft.Xna.Framework.Rectangle?(), color73, -projectile1.rotation, TextureAssets.Extra[34].Value.Size() / 2f, projectile1.scale, spriteEffects, 0); - Main.EntitySpriteDraw(texture2D9, position16, new Microsoft.Xna.Framework.Rectangle?(), color73, projectile1.rotation, origin9, projectile1.scale * 0.42f, spriteEffects, 0); - Main.EntitySpriteDraw(TextureAssets.Extra[34].Value, position16, new Microsoft.Xna.Framework.Rectangle?(), color73, -projectile1.rotation, TextureAssets.Extra[34].Value.Size() / 2f, projectile1.scale * 0.42f, spriteEffects, 0); - } - else if (projectile1.type == 616) - Main.EntitySpriteDraw(TextureAssets.GlowMask[193].Value, position16, new Microsoft.Xna.Framework.Rectangle?(), new Microsoft.Xna.Framework.Color((int) sbyte.MaxValue, (int) sbyte.MaxValue, (int) sbyte.MaxValue, 0), projectile1.rotation, origin9, projectile1.scale, spriteEffects, 0); - else if (projectile1.type >= 646 && projectile1.type <= 649) - Main.EntitySpriteDraw(TextureAssets.GlowMask[203 + projectile1.type - 646].Value, position16, new Microsoft.Xna.Framework.Rectangle?(), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue), projectile1.rotation, origin9, projectile1.scale, spriteEffects, 0); - else if (projectile1.type == 699) - Main.EntitySpriteDraw(TextureAssets.GlowMask[231].Value, position16, new Microsoft.Xna.Framework.Rectangle?(), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue), rotation5, origin9, projectile1.scale, spriteEffects, 0); - else if (projectile1.type == 707 || projectile1.type == 708) - { - float num354 = 0.5f; - Texture2D texture2D12 = TextureAssets.GlowMask[232].Value; - Microsoft.Xna.Framework.Rectangle rectangle = texture2D12.Frame(verticalFrames: 3, frameY: ((int) ((double) projectile1.ai[0] % 9.0) / 3)); - if (projectile1.type == 708) - { - rectangle = texture2D12.Frame(verticalFrames: 3, frameY: (Main.player[projectile1.owner].itemAnimation % 9 / 3)); - num354 = 0.75f; - } - Microsoft.Xna.Framework.Color color84 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue) * num354; - Vector2 spinningpoint = new Vector2(2f, 0.0f).RotatedBy((double) projectile1.rotation); - for (float num355 = 0.0f; (double) num355 < 4.0; ++num355) - Main.EntitySpriteDraw(texture2D12, position16 + spinningpoint.RotatedBy((double) num355 * 1.57079637050629), new Microsoft.Xna.Framework.Rectangle?(rectangle), color84 * 0.5f, projectile1.rotation, origin9, projectile1.scale, spriteEffects, 0); - Main.EntitySpriteDraw(texture2D12, position16, new Microsoft.Xna.Framework.Rectangle?(rectangle), color84, projectile1.rotation, origin9, projectile1.scale, spriteEffects, 0); - } - else if (projectile1.type == 719) - { - Microsoft.Xna.Framework.Color color85 = new Microsoft.Xna.Framework.Color(80, 80, 80, (int) byte.MaxValue) * 0.3f; - float scale14 = projectile1.scale * 1.5f; - Vector2 spinningpoint = new Vector2(2f * scale14, 0.0f).RotatedBy((double) projectile1.rotation); - for (float num356 = 0.0f; (double) num356 < 4.0; ++num356) - Main.EntitySpriteDraw(texture2D9, position16 + -projectile1.velocity * num356 * 1.25f, new Microsoft.Xna.Framework.Rectangle?(), color85 * 0.7f, projectile1.rotation, origin9, scale14, spriteEffects, 0); - for (float num357 = 0.0f; (double) num357 < 3.0; ++num357) - Main.EntitySpriteDraw(texture2D9, position16 + spinningpoint.RotatedBy((double) num357 * 1.57079637050629), new Microsoft.Xna.Framework.Rectangle?(), color85 * 0.9f, projectile1.rotation, origin9, scale14, spriteEffects, 0); - Main.EntitySpriteDraw(texture2D9, position16, new Microsoft.Xna.Framework.Rectangle?(), color73, projectile1.rotation, origin9, projectile1.scale, spriteEffects, 0); - } - else if (projectile1.type == 16) - { - Microsoft.Xna.Framework.Color color86 = new Microsoft.Xna.Framework.Color(80, 80, 80, 0); - Vector2 scale15 = scale8 + scale8 * (float) Math.Cos((double) Main.GlobalTimeWrappedHourly * 6.28318548202515) * 0.4f; - Vector2 spinningpoint = new Vector2(2f * scale15.X, 0.0f).RotatedBy((double) rotation5); - for (float num358 = 0.0f; (double) num358 < 1.0; num358 += 0.25f) - Main.EntitySpriteDraw(texture2D9, position16 + spinningpoint.RotatedBy((double) num358 * 6.28318548202515), new Microsoft.Xna.Framework.Rectangle?(), color86, rotation5, origin9, scale15, spriteEffects, 0); - Main.EntitySpriteDraw(texture2D9, position16, new Microsoft.Xna.Framework.Rectangle?(), color73, rotation5, origin9, scale8, spriteEffects, 0); - } - else - { - if (projectile1.type != 34) - return; - float lerpValue = Utils.GetLerpValue(0.0f, 6f, projectile1.localAI[0], true); - Microsoft.Xna.Framework.Color color87 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue) * 0.75f; - Vector2 scale16 = new Vector2(lerpValue); - Vector2 spinningpoint = new Vector2(4f * scale16.X, 0.0f).RotatedBy((double) rotation5); - for (float num359 = 0.0f; (double) num359 < 1.0; num359 += 0.25f) - Main.EntitySpriteDraw(texture2D9, position16 + spinningpoint.RotatedBy((double) num359 * 6.28318548202515), sourceRectangle, color87, rotation5, origin9, scale16, spriteEffects, 0); - } - } - else if (projectile1.type == 465 || projectile1.type == 467 || projectile1.type == 468 || projectile1.type == 500 || projectile1.type == 518 || projectile1.type == 535 || projectile1.type == 539 || projectile1.type == 575 || projectile1.type == 574 || projectile1.type == 589 || projectile1.type == 590 || projectile1.type == 593 || projectile1.type == 602 || projectile1.type == 596 || projectile1.type == 612 || projectile1.type == 613 || projectile1.type == 614 || projectile1.type == 623 || projectile1.type == 625 || projectile1.type == 626 || projectile1.type == 627 || projectile1.type == 628 || projectile1.type == 634 || projectile1.type == 635 || projectile1.type == 643 || projectile1.type == 644 || projectile1.type == 645 || projectile1.type == 650 || projectile1.type == 652 || projectile1.type == 658 || projectile1.type == 659 || projectile1.type == 663 || projectile1.type == 665 || projectile1.type == 667 || projectile1.type == 677 || projectile1.type == 678 || projectile1.type == 679 || projectile1.type == 691 || projectile1.type == 692 || projectile1.type == 693 || projectile1.type == 702 || projectile1.type == 703 || projectile1.type == 701 || projectile1.type == 712 || projectile1.type == 715 || projectile1.type == 716 || projectile1.type == 717 || projectile1.type == 718 || projectile1.type == 758 || projectile1.type == 759 || projectile1.type == 764 || projectile1.type == 779 || projectile1.type == 783 || projectile1.type == 773 || projectile1.type == 820 || projectile1.type == 831 || projectile1.type == 836 || projectile1.type == 851 || projectile1.type == 855 || projectile1.type == 856 || projectile1.type == 857 || projectile1.type == 861 || projectile1.type == 862 || projectile1.type == 863 || projectile1.type == 866 || projectile1.type == 870 || projectile1.type == 882 || projectile1.type == 885 || projectile1.type == 889 || projectile1.type == 895 || projectile1.type == 896 || projectile1.type == 898 || projectile1.type == 903 || projectile1.type == 904 || projectile1.type == 905 || projectile1.type == 906 || projectile1.type == 908 || projectile1.type == 910 || projectile1.type == 911) - { - Vector2 vector2_55 = projectile1.position + new Vector2((float) projectile1.width, (float) projectile1.height) / 2f + Vector2.UnitY * projectile1.gfxOffY - Main.screenPosition; - Texture2D target = TextureAssets.Projectile[projectile1.type].Value; - Microsoft.Xna.Framework.Rectangle r = target.Frame(verticalFrames: Main.projFrames[projectile1.type], frameY: projectile1.frame); - Microsoft.Xna.Framework.Color color88 = projectile1.GetAlpha(color10); - Vector2 origin13 = r.Size() / 2f; - if (projectile1.type == 703) - r.Height -= 2; - if (projectile1.type == 895 || projectile1.type == 896 || projectile1.type == 898) - vector2_55.Y += (float) (Math.Cos((double) Main.mouseTextColor / (double) byte.MaxValue * 6.28318548202515 * 2.0) * 4.0) - 2f; - if (projectile1.type == 855) - { - float y17 = ((float) ((double) Main.GlobalTimeWrappedHourly % 6.0 / 6.0 * 6.28318548202515)).ToRotationVector2().Y; - float num360 = (float) ((double) y17 * 0.300000011920929 + 0.699999988079071); - Microsoft.Xna.Framework.Color color89 = color88 * num360 * 0.3f; - for (int index = 0; index < 4; ++index) - { - float x19 = 0.0f; - float y18 = 0.0f; - switch (index) - { - case 0: - x19 = 4f; - break; - case 1: - x19 = -4f; - break; - case 2: - y18 = 4f; - break; - case 3: - y18 = -4f; - break; - } - Vector2 vector2_56 = new Vector2(x19, y18).RotatedBy(6.28318548202515 * (double) i + (double) projectile1.rotation) * y17; - Main.spriteBatch.Draw(target, vector2_55 + vector2_56, new Microsoft.Xna.Framework.Rectangle?(r), color89, projectile1.rotation, r.Size() / 2f, 1f, SpriteEffects.None, 0.0f); - } - } - else if (projectile1.type == 908) - { - PlayerTitaniumStormBuffTextureContent titaniumStormBuff = TextureAssets.RenderTargets.PlayerTitaniumStormBuff; - vector2_55 += (Main.GlobalTimeWrappedHourly * 8f + (float) projectile1.whoAmI).ToRotationVector2() * 4f; - titaniumStormBuff.Request(); - if (titaniumStormBuff.IsReady) - target = (Texture2D) titaniumStormBuff.GetTarget(); - r = target.Frame(Main.projFrames[projectile1.type], frameX: projectile1.frame); - origin13 = r.Size() / 2f; - } - else if (projectile1.type == 764) - this.DrawProjWithStarryTrail(projectile1, color10, spriteEffects); - else if (projectile1.type == 856) - this.DrawProjWithStarryTrail(projectile1, color10, spriteEffects); - else if (projectile1.type == 857) - { - this.DrawProjWithStarryTrail(projectile1, color10, spriteEffects); - color88 = Microsoft.Xna.Framework.Color.White * projectile1.Opacity * 0.9f; - color88.A /= (byte) 2; - r = target.Frame(15, frameX: projectile1.frame); - origin13 = r.Size() / 2f; - Main.DrawPrettyStarSparkle(projectile1, spriteEffects, vector2_55, color88, projectile1.GetFirstFractalColor()); - } - else if (projectile1.type == 539) - { - if ((double) projectile1.ai[0] >= 210.0) - { - float num361 = (projectile1.ai[0] - 210f) / 20f; - if ((double) num361 > 1.0) - num361 = 1f; - Main.EntitySpriteDraw(TextureAssets.Extra[46].Value, vector2_55, new Microsoft.Xna.Framework.Rectangle?(), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 128) * num361, projectile1.rotation, new Vector2(17f, 22f), projectile1.scale, spriteEffects, 0); - } - } - else if (projectile1.type == 773) - origin13.Y = (float) (r.Height - 12); - else if (projectile1.type == 866) - origin13.X += 14f; - else if (projectile1.type == 759) - { - origin13.Y = (float) (r.Height - 2); - origin13.X += spriteEffects.HasFlag((Enum) SpriteEffects.FlipHorizontally) ? 1f : -1f; - } - else if (projectile1.type == 758) - { - vector2_55.Y += (float) (projectile1.height / 2); - origin13 = r.Size() * new Vector2(0.5f, 1f); - origin13.Y -= 4f; - } - else if (projectile1.type == 833) - { - if (projectile1.frame != 8) - { - vector2_55.Y += (float) (projectile1.height / 2); - origin13 = r.Size() * new Vector2(0.5f, 1f); - origin13.Y -= 4f; - origin13.X -= (float) (7 * spriteEffects.HasFlag((Enum) SpriteEffects.FlipHorizontally).ToDirectionInt()); - } - } - else if (projectile1.type == 834 || projectile1.type == 835) - { - if (projectile1.frame != 10) - { - vector2_55.Y += (float) (projectile1.height / 2); - origin13 = r.Size() * new Vector2(0.5f, 1f); - origin13.Y -= 4f; - origin13.X -= (float) (2 * spriteEffects.HasFlag((Enum) SpriteEffects.FlipHorizontally).ToDirectionInt()); - } - } - else if (projectile1.type == 715 || projectile1.type == 716 || projectile1.type == 717 || projectile1.type == 718) - { - r = target.Frame(3); - origin13 = r.Size() / 2f; - int num362 = (int) projectile1.ai[0]; - Vector2 origin14 = new Vector2((float) (r.Width / 2), 0.0f); - Vector2 vector2_57 = projectile1.Size / 2f; - Microsoft.Xna.Framework.Color celeb2Color = projectile1.GetCeleb2Color(); - celeb2Color.A = (byte) 127; - Microsoft.Xna.Framework.Color color90 = celeb2Color * 0.8f; - Microsoft.Xna.Framework.Rectangle rectangle = r; - rectangle.X += rectangle.Width * 2; - for (int index = projectile1.oldPos.Length - 1; index > 0; --index) - { - Vector2 vector2_58 = projectile1.oldPos[index] + vector2_57; - if (!(vector2_58 == vector2_57)) - { - Vector2 vector2_59 = projectile1.oldPos[index - 1] + vector2_57; - float num363 = projectile1.oldRot[index]; - Vector2 scale = new Vector2(Vector2.Distance(vector2_58, vector2_59) / (float) r.Width, 1f); - Microsoft.Xna.Framework.Color color91 = color90 * (float) (1.0 - (double) index / (double) projectile1.oldPos.Length); - switch (num362) - { - case 2: - Vector2 rotationVector2 = num363.ToRotationVector2(); - int num364 = index + projectile1.timeLeft; - if (num364 < 0) - num364 += 20 * (num364 / -20) + 20; - int num365 = num364 % 20; - float num366 = 0.0f; - scale *= 0.6f; - switch (num365) - { - case 1: - num366 = 1f; - break; - case 2: - num366 = 2f; - break; - case 3: - num366 = 3f; - break; - case 4: - num366 = 2f; - break; - case 5: - num366 = 1f; - break; - case 7: - num366 = -1f; - break; - case 8: - num366 = -2f; - break; - case 9: - num366 = -3f; - break; - case 10: - num366 = -2f; - break; - case 11: - num366 = -1f; - break; - } - vector2_58 += rotationVector2 * num366 * 4f; - break; - case 5: - scale *= 0.5f; - break; - } - Main.EntitySpriteDraw(target, vector2_58 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(rectangle), color91, num363, origin14, scale, spriteEffects, 0); - } - } - } - else if (projectile1.type == 663 || projectile1.type == 665 || projectile1.type == 667) - { - vector2_55 = projectile1.Bottom + Vector2.UnitY * projectile1.gfxOffY - Main.screenPosition; - origin13 = r.Size() * new Vector2(0.5f, 1f); - origin13.Y -= 2f; - origin13.Y -= 2f; - } - else if (projectile1.type == 691 || projectile1.type == 692 || projectile1.type == 693) - { - vector2_55 = projectile1.Bottom + Vector2.UnitY * projectile1.gfxOffY - Main.screenPosition; - origin13 = r.Size() * new Vector2(0.5f, 1f); - origin13.Y -= 2f; - origin13.Y -= 2f; - } - else if (projectile1.type == 677 || projectile1.type == 678 || projectile1.type == 679) - { - if (projectile1.spriteDirection == -1) - spriteEffects ^= SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically; - Texture2D texture2D = TextureAssets.Extra[83].Value; - if (projectile1.type == 678) - texture2D = TextureAssets.Extra[84].Value; - if (projectile1.type == 679) - texture2D = TextureAssets.Extra[85].Value; - Vector2 position = projectile1.Bottom + Vector2.UnitY * projectile1.gfxOffY - Main.screenPosition; - Vector2 origin15 = texture2D.Size() * new Vector2(0.5f, 1f); - origin15.Y -= 2f; - Main.EntitySpriteDraw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(), color88, 0.0f, origin15, 1f, spriteEffects & SpriteEffects.FlipHorizontally, 0); - origin13.X += (float) spriteEffects.HasFlag((Enum) SpriteEffects.FlipHorizontally).ToDirectionInt(); - ++vector2_55.Y; - vector2_55.Y += 2f; - if (projectile1.type == 678) - vector2_55.Y += -4f; - if (projectile1.type == 679) - { - vector2_55.Y -= 2f; - if (!spriteEffects.HasFlag((Enum) SpriteEffects.FlipVertically)) - origin13.Y += 4f; - else - origin13.Y -= 4f; - origin13.X += (float) (spriteEffects.HasFlag((Enum) SpriteEffects.FlipHorizontally).ToDirectionInt() * 4); - } - } - else if (projectile1.type == 602) - { - origin13.X = (float) (r.Width - 6); - --origin13.Y; - r.Height -= 2; - } - else if (projectile1.type == 589) - { - r = target.Frame(5, frameX: ((int) projectile1.ai[1])); - origin13 = r.Size() / 2f; - } - else if (projectile1.type == 590) - { - r = target.Frame(3, frameX: projectile1.frame); - origin13 = r.Size() / 2f; - } - else if (projectile1.type == 836) - { - r = target.Frame(4, frameX: projectile1.frame); - origin13 = r.Size() / 2f; - } - else if (projectile1.type == 650 || projectile1.type == 882 || projectile1.type == 888 || projectile1.type == 894 || projectile1.type == 895 || projectile1.type == 896 || projectile1.type == 898 || projectile1.type == 901) - origin13.Y -= 4f; - else if (projectile1.type == 623) - { - if ((double) projectile1.ai[0] == 2.0) - vector2_55 += Main.rand.NextVector2Circular(2f, 2f); - if (Main.CurrentDrawnEntityShader == 0) - color88.A /= (byte) 2; - } - else if (projectile1.type >= 625 && projectile1.type <= 628) - color88.A /= (byte) 2; - else if (projectile1.type == 644) - { - Microsoft.Xna.Framework.Color color92 = Main.hslToRgb(projectile1.ai[0], 1f, 0.5f).MultiplyRGBA(new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0)); - Main.EntitySpriteDraw(target, vector2_55, new Microsoft.Xna.Framework.Rectangle?(r), color92, projectile1.rotation, origin13, projectile1.scale * 2f, spriteEffects, 0); - Main.EntitySpriteDraw(target, vector2_55, new Microsoft.Xna.Framework.Rectangle?(r), color92, 0.0f, origin13, projectile1.scale * 2f, spriteEffects, 0); - if ((double) projectile1.ai[1] != -1.0 && (double) projectile1.Opacity > 0.300000011920929) - { - Vector2 v = Main.projectile[(int) projectile1.ai[1]].Center - projectile1.Center; - Vector2 scale = new Vector2(1f, v.Length() / (float) target.Height); - float rotation = v.ToRotation() + 1.570796f; - float num367 = MathHelper.Clamp(MathHelper.Distance(30f, projectile1.localAI[1]) / 20f, 0.0f, 1f); - if ((double) num367 > 0.0) - { - Main.EntitySpriteDraw(target, vector2_55 + v / 2f, new Microsoft.Xna.Framework.Rectangle?(r), color92 * num367, rotation, origin13, scale, spriteEffects, 0); - Main.EntitySpriteDraw(target, vector2_55 + v / 2f, new Microsoft.Xna.Framework.Rectangle?(r), color88 * num367, rotation, origin13, scale / 2f, spriteEffects, 0); - } - } - } - else if (projectile1.type == 658) - { - Microsoft.Xna.Framework.Color color93 = Main.hslToRgb(0.136f, 1f, 0.5f).MultiplyRGBA(new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0)); - Main.EntitySpriteDraw(target, vector2_55, new Microsoft.Xna.Framework.Rectangle?(r), color93, 0.0f, origin13, new Vector2(1f, 5f) * projectile1.scale * 2f, spriteEffects, 0); - } - Main.EntitySpriteDraw(target, vector2_55, new Microsoft.Xna.Framework.Rectangle?(r), color88, projectile1.rotation, origin13, projectile1.scale, spriteEffects, 0); - if (projectile1.type == 896) - { - Texture2D texture = TextureAssets.GlowMask[278].Value; - Microsoft.Xna.Framework.Color color94 = new Microsoft.Xna.Framework.Color(150, 150, 150, 100); - for (int index = 0; index < 2; ++index) - { - Vector2 position = vector2_55 + new Vector2((float) Main.rand.Next(-10, 11) * 0.1f, (float) Main.rand.Next(-10, 11) * 0.1f); - Main.EntitySpriteDraw(texture, position, new Microsoft.Xna.Framework.Rectangle?(r), color94, projectile1.rotation, origin13, projectile1.scale, spriteEffects, 0); - } - Main.EntitySpriteDraw(texture, vector2_55, new Microsoft.Xna.Framework.Rectangle?(r), Microsoft.Xna.Framework.Color.White, projectile1.rotation, origin13, projectile1.scale, spriteEffects, 0); - } - if (projectile1.type == 889) - { - Texture2D texture = TextureAssets.GlowMask[276].Value; - Microsoft.Xna.Framework.Color color95 = Microsoft.Xna.Framework.Color.White * (float) Main.mouseTextColor; - Main.EntitySpriteDraw(texture, vector2_55, new Microsoft.Xna.Framework.Rectangle?(r), color95, projectile1.rotation, origin13, projectile1.scale, spriteEffects, 0); - for (int index = 0; index < 4; ++index) - { - int num368 = 28; - int frameY = 7 + index; - float num369 = 100f; - bool flag = frameY == 8; - Microsoft.Xna.Framework.Rectangle rectangle = target.Frame(verticalFrames: Main.projFrames[projectile1.type], frameY: frameY); - Vector2 vector2_60 = vector2_55; - Vector2 vector2_61 = vector2_55; - SpriteEffects effects = SpriteEffects.None; - float num370 = Main.GlobalTimeWrappedHourly * 2f; - switch (index - 1) - { - case 0: - num370 += 1.570796f; - break; - case 1: - num370 += 3.141593f; - break; - case 2: - num370 += 4.712389f; - break; - } - float f = num370 * 3f; - float rotation8 = f; - Vector2 position18 = vector2_61 + f.ToRotationVector2() * (float) num368; - if ((double) projectile1.localAI[0] == (double) num369) - { - Main.EntitySpriteDraw(target, position18, new Microsoft.Xna.Framework.Rectangle?(rectangle), color88, rotation8, origin13, projectile1.scale, effects, 0); - if (flag) - Main.EntitySpriteDraw(texture, position18, new Microsoft.Xna.Framework.Rectangle?(rectangle), color95, rotation8, origin13, projectile1.scale, effects, 0); - } - else - { - Vector2 vector2_62 = new Vector2((float) num368, -16f) + projectile1.velocity * 1.5f; - float num371 = 4f; - float num372 = -0.35f; - switch (index) - { - case 1: - vector2_62.X *= -1f; - effects = SpriteEffects.FlipHorizontally; - num372 = 0.35f; - num371 = -3f; - break; - case 2: - vector2_62.Y = 16f; - num372 = 0.35f; - num371 = 2f; - break; - case 3: - vector2_62.X *= -1f; - vector2_62.Y = 16f; - effects = SpriteEffects.FlipHorizontally; - num372 = -0.35f; - num371 = -1f; - break; - } - Vector2 vector2_63 = vector2_62 + (Main.GlobalTimeWrappedHourly * num371).ToRotationVector2() * 4f; - Vector2 vector2_64 = vector2_60 + vector2_63; - float amount = projectile1.localAI[0] / num369; - Vector2 position19 = Vector2.Lerp(vector2_64, position18, amount); - float rotation9 = (double) amount > 0.5 ? f : num372; - Main.EntitySpriteDraw(target, position19, new Microsoft.Xna.Framework.Rectangle?(rectangle), color88, rotation9, origin13, projectile1.scale, effects, 0); - if (flag) - Main.EntitySpriteDraw(texture, position19, new Microsoft.Xna.Framework.Rectangle?(rectangle), color95, rotation9, origin13, projectile1.scale, effects, 0); - } - } - } - if (projectile1.type == 885) - { - for (int index = 0; index < 2; ++index) - { - SpriteEffects effects = SpriteEffects.None; - int num373 = -30; - if (index == 1) - { - num373 = 30; - effects = SpriteEffects.FlipHorizontally; - } - int num374 = (int) projectile1.localAI[0]; - if (projectile1.frame == 6) - num374 = 0; - else if (index == 1) - num374 = 2 - num374; - int frameY = num374 + 7; - Microsoft.Xna.Framework.Rectangle rectangle = target.Frame(verticalFrames: Main.projFrames[projectile1.type], frameY: frameY); - Vector2 vector2_65 = vector2_55 + new Vector2((float) num373, 0.0f); - Vector2 vector2_66 = (Main.GlobalTimeWrappedHourly * 2f).ToRotationVector2() * 4f + projectile1.velocity * -1.5f; - Vector2 vector2_67 = (Main.GlobalTimeWrappedHourly * 1f).ToRotationVector2() * 3f; - Vector2 position = index != 1 ? vector2_65 - vector2_66 : vector2_65 + (vector2_66 + vector2_67); - Main.EntitySpriteDraw(target, position, new Microsoft.Xna.Framework.Rectangle?(rectangle), color88, 0.0f, origin13, projectile1.scale, effects, 0); - } - } - if (projectile1.type == 535) - { - for (int i2 = 0; i2 < 1000; ++i2) - { - if (Main.projectile[i2].active && Main.projectile[i2].owner == projectile1.owner && Main.projectile[i2].type == 536) - this.DrawProj(i2); - } - } - else if (projectile1.type == 715 || projectile1.type == 716 || projectile1.type == 717 || projectile1.type == 718) - { - r.X += r.Width; - Microsoft.Xna.Framework.Color celeb2Color = projectile1.GetCeleb2Color(); - celeb2Color.A = (byte) 80; - Main.EntitySpriteDraw(target, vector2_55, new Microsoft.Xna.Framework.Rectangle?(r), celeb2Color, projectile1.rotation, origin13, projectile1.scale, spriteEffects, 0); - } - else if (projectile1.type == 702) - { - Texture2D texture2D = TextureAssets.Flames[5].Value; - Vector2 origin16 = texture2D.Size() / 2f; - Vector2 vector2_68 = new Vector2((float) (5 * projectile1.spriteDirection), -10f).RotatedBy((double) projectile1.rotation); - ulong seed = (ulong) ((double) projectile1.localAI[0] / 4.0); - for (int index = 0; index < 5; ++index) - { - Microsoft.Xna.Framework.Color color96 = new Microsoft.Xna.Framework.Color(100, 100, 100, 0); - float x20 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; - float y = (float) Utils.RandomInt(ref seed, -10, 1) * 0.35f; - Main.EntitySpriteDraw(texture2D, vector2_55 + vector2_68 + new Vector2(x20, y), new Microsoft.Xna.Framework.Rectangle?(), color96, projectile1.rotation, origin16, 1f, spriteEffects, 0); - } - } - else if (projectile1.type == 663 || projectile1.type == 665 || projectile1.type == 667) - { - Texture2D texture = TextureAssets.GlowMask[221].Value; - switch (projectile1.type) - { - case 665: - texture = TextureAssets.GlowMask[222].Value; - break; - case 667: - texture = TextureAssets.GlowMask[223].Value; - break; - } - float num375 = (float) ((double) ((float) ((double) projectile1.localAI[0] / 100.0 * 6.28318548202515)).ToRotationVector2().X * 1.0 + 1.0); - Microsoft.Xna.Framework.Color color97 = new Microsoft.Xna.Framework.Color(140, 100, 40, 0) * (float) ((double) num375 / 4.0 + 0.5) * 1f; - for (float num376 = 0.0f; (double) num376 < 4.0; ++num376) - Main.EntitySpriteDraw(texture, vector2_55 + (num376 * 1.570796f).ToRotationVector2() * num375, new Microsoft.Xna.Framework.Rectangle?(r), color97, projectile1.rotation, origin13, projectile1.scale, spriteEffects, 0); - } - else if (projectile1.type == 644) - Main.EntitySpriteDraw(target, vector2_55, new Microsoft.Xna.Framework.Rectangle?(r), color88, 0.0f, origin13, projectile1.scale, spriteEffects, 0); - else if (projectile1.type == 773 && (double) projectile1.velocity.Length() == 0.0) - { - Texture2D texture = TextureAssets.GlowMask[266].Value; - Microsoft.Xna.Framework.Color color98 = Microsoft.Xna.Framework.Color.White * (float) Main.mouseTextColor; - Vector2 position = vector2_55; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(r); - Microsoft.Xna.Framework.Color color99 = color98; - double rotation = (double) projectile1.rotation; - Vector2 origin17 = origin13; - double scale = (double) projectile1.scale; - int num377 = (int) spriteEffects; - Main.EntitySpriteDraw(texture, position, sourceRectangle, color99, (float) rotation, origin17, (float) scale, (SpriteEffects) num377, 0); - } - else if (projectile1.type == 658) - Main.EntitySpriteDraw(target, vector2_55, new Microsoft.Xna.Framework.Rectangle?(r), color88, 0.0f, origin13, new Vector2(1f, 8f) * projectile1.scale, spriteEffects, 0); - else if (projectile1.type == 602) - { - Texture2D texture2D13 = TextureAssets.Extra[60].Value; - Microsoft.Xna.Framework.Color color100 = color88; - color100.A = (byte) 0; - color100 *= 0.3f; - origin13 = texture2D13.Size() / 2f; - Main.EntitySpriteDraw(texture2D13, vector2_55, new Microsoft.Xna.Framework.Rectangle?(), color100, projectile1.rotation - 1.570796f, origin13, projectile1.scale, spriteEffects, 0); - Texture2D texture2D14 = TextureAssets.Extra[59].Value; - color100 = color88; - color100.A = (byte) 0; - color100 *= 0.13f; - origin13 = texture2D14.Size() / 2f; - Main.EntitySpriteDraw(texture2D14, vector2_55, new Microsoft.Xna.Framework.Rectangle?(), color100, projectile1.rotation - 1.570796f, origin13, projectile1.scale * 0.9f, spriteEffects, 0); - } - else if (projectile1.type == 539) - Main.EntitySpriteDraw(TextureAssets.GlowMask[140].Value, vector2_55, new Microsoft.Xna.Framework.Rectangle?(r), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), projectile1.rotation, origin13, projectile1.scale, spriteEffects, 0); - else if (projectile1.type == 613) - Main.EntitySpriteDraw(TextureAssets.GlowMask[189].Value, vector2_55, new Microsoft.Xna.Framework.Rectangle?(r), new Microsoft.Xna.Framework.Color(128 - projectile1.alpha / 2, 128 - projectile1.alpha / 2, 128 - projectile1.alpha / 2, 0), projectile1.rotation, origin13, projectile1.scale, spriteEffects, 0); - else if (projectile1.type == 614) - Main.EntitySpriteDraw(TextureAssets.GlowMask[190].Value, vector2_55, new Microsoft.Xna.Framework.Rectangle?(r), new Microsoft.Xna.Framework.Color(128 - projectile1.alpha / 2, 128 - projectile1.alpha / 2, 128 - projectile1.alpha / 2, 0), projectile1.rotation, origin13, projectile1.scale, spriteEffects, 0); - else if (projectile1.type == 574) - Main.EntitySpriteDraw(TextureAssets.GlowMask[148].Value, vector2_55, new Microsoft.Xna.Framework.Rectangle?(r), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), projectile1.rotation, origin13, projectile1.scale, spriteEffects, 0); - else if (projectile1.type == 691 || projectile1.type == 692 || projectile1.type == 693) - { - Texture2D texture = TextureAssets.GlowMask[235].Value; - switch (projectile1.type) - { - case 692: - texture = TextureAssets.GlowMask[236].Value; - break; - case 693: - texture = TextureAssets.GlowMask[237].Value; - break; - } - Main.EntitySpriteDraw(texture, vector2_55, new Microsoft.Xna.Framework.Rectangle?(r), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue), projectile1.rotation, origin13, projectile1.scale, spriteEffects, 0); - } - else if (projectile1.type == 590) - Main.EntitySpriteDraw(TextureAssets.GlowMask[168].Value, vector2_55, new Microsoft.Xna.Framework.Rectangle?(r), new Microsoft.Xna.Framework.Color((int) sbyte.MaxValue - projectile1.alpha / 2, (int) sbyte.MaxValue - projectile1.alpha / 2, (int) sbyte.MaxValue - projectile1.alpha / 2, 0), projectile1.rotation, origin13, projectile1.scale, spriteEffects, 0); - else if (projectile1.type == 623 || projectile1.type >= 625 && projectile1.type <= 628) - { - if ((double) Main.player[projectile1.owner].ghostFade != 0.0) - { - float num378 = Main.player[projectile1.owner].ghostFade * 5f; - for (float num379 = 0.0f; (double) num379 < 4.0; ++num379) - Main.EntitySpriteDraw(target, vector2_55 + Vector2.UnitY.RotatedBy((double) num379 * 6.28318548202515 / 4.0) * num378, new Microsoft.Xna.Framework.Rectangle?(r), color88 * 0.1f, projectile1.rotation, origin13, projectile1.scale, spriteEffects, 0); - } - if (projectile1.type != 623 || (double) projectile1.ai[0] != 2.0 || projectile1.frame < 14) - return; - this.DrawProj_StardustGuardianPunching(projectile1); - } - else if (projectile1.type == 643) - { - float num380 = (float) (Math.Cos(6.28318548202515 * ((double) projectile1.localAI[0] / 60.0)) + 3.0 + 3.0); - for (float num381 = 0.0f; (double) num381 < 4.0; ++num381) - Main.EntitySpriteDraw(target, vector2_55 + Vector2.UnitY.RotatedBy((double) num381 * 1.57079637050629) * num380, new Microsoft.Xna.Framework.Rectangle?(r), color88 * 0.2f, projectile1.rotation, origin13, projectile1.scale, spriteEffects, 0); - } - else - { - if (projectile1.type != 650) - return; - int num382 = (int) ((double) projectile1.localAI[0] / 6.28318548202515); - float f = (float) ((double) projectile1.localAI[0] % 6.28318548202515 - 3.14159274101257); - float num383 = (float) Math.IEEERemainder((double) projectile1.localAI[1], 1.0); - if ((double) num383 < 0.0) - ++num383; - int num384 = (int) Math.Floor((double) projectile1.localAI[1]); - float num385 = 5f; - float scale = (float) (1.0 + (double) num384 * 0.0199999995529652); - if ((double) num382 == 1.0) - num385 = 7f; - Vector2 vector2_69 = f.ToRotationVector2() * num383 * num385 * projectile1.scale; - Texture2D texture2D = TextureAssets.Extra[66].Value; - Main.EntitySpriteDraw(texture2D, vector2_55 + vector2_69, new Microsoft.Xna.Framework.Rectangle?(), color88, projectile1.rotation, texture2D.Size() / 2f, scale, SpriteEffects.None, 0); - } - } - else if (projectile1.type == 466) - { - Vector2 end1 = projectile1.position + new Vector2((float) projectile1.width, (float) projectile1.height) / 2f + Vector2.UnitY * projectile1.gfxOffY - Main.screenPosition; - Texture2D tex = TextureAssets.Extra[33].Value; - projectile1.GetAlpha(color10); - Vector2 vector2 = new Vector2(projectile1.scale) / 2f; - for (int index3 = 0; index3 < 3; ++index3) - { - Vector2 scale; - if (index3 == 0) - { - scale = new Vector2(projectile1.scale) * 0.6f; - DelegateMethods.c_1 = new Microsoft.Xna.Framework.Color(115, 204, 219, 0) * 0.5f; - } - else if (index3 == 1) - { - scale = new Vector2(projectile1.scale) * 0.4f; - DelegateMethods.c_1 = new Microsoft.Xna.Framework.Color(113, 251, (int) byte.MaxValue, 0) * 0.5f; - } - else - { - scale = new Vector2(projectile1.scale) * 0.2f; - DelegateMethods.c_1 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * 0.5f; - } - DelegateMethods.f_1 = 1f; - for (int index4 = projectile1.oldPos.Length - 1; index4 > 0; --index4) - { - if (!(projectile1.oldPos[index4] == Vector2.Zero)) - { - Vector2 start = projectile1.oldPos[index4] + new Vector2((float) projectile1.width, (float) projectile1.height) / 2f + Vector2.UnitY * projectile1.gfxOffY - Main.screenPosition; - Vector2 end2 = projectile1.oldPos[index4 - 1] + new Vector2((float) projectile1.width, (float) projectile1.height) / 2f + Vector2.UnitY * projectile1.gfxOffY - Main.screenPosition; - Utils.DrawLaser(Main.spriteBatch, tex, start, end2, scale, new Utils.LaserLineFraming(DelegateMethods.LightningLaserDraw)); - } - } - if (projectile1.oldPos[0] != Vector2.Zero) - { - DelegateMethods.f_1 = 1f; - Vector2 start = projectile1.oldPos[0] + new Vector2((float) projectile1.width, (float) projectile1.height) / 2f + Vector2.UnitY * projectile1.gfxOffY - Main.screenPosition; - Utils.DrawLaser(Main.spriteBatch, tex, start, end1, scale, new Utils.LaserLineFraming(DelegateMethods.LightningLaserDraw)); - } - } - } - else if (projectile1.type == 580) - { - Vector2 end3 = projectile1.position + new Vector2((float) projectile1.width, (float) projectile1.height) / 2f + Vector2.UnitY * projectile1.gfxOffY - Main.screenPosition; - Texture2D tex = TextureAssets.Extra[33].Value; - projectile1.GetAlpha(color10); - Vector2 vector2 = new Vector2(projectile1.scale) / 2f; - for (int index5 = 0; index5 < 2; ++index5) - { - float num386 = (double) projectile1.localAI[1] == -1.0 || (double) projectile1.localAI[1] == 1.0 ? -0.2f : 0.0f; - Vector2 scale; - if (index5 == 0) - { - scale = new Vector2(projectile1.scale) * (0.5f + num386); - DelegateMethods.c_1 = new Microsoft.Xna.Framework.Color(115, 244, 219, 0) * 0.5f; - } - else - { - scale = new Vector2(projectile1.scale) * (0.3f + num386); - DelegateMethods.c_1 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * 0.5f; - } - DelegateMethods.f_1 = 1f; - for (int index6 = projectile1.oldPos.Length - 1; index6 > 0; --index6) - { - if (!(projectile1.oldPos[index6] == Vector2.Zero)) - { - Vector2 start = projectile1.oldPos[index6] + new Vector2((float) projectile1.width, (float) projectile1.height) / 2f + Vector2.UnitY * projectile1.gfxOffY - Main.screenPosition; - Vector2 end4 = projectile1.oldPos[index6 - 1] + new Vector2((float) projectile1.width, (float) projectile1.height) / 2f + Vector2.UnitY * projectile1.gfxOffY - Main.screenPosition; - Utils.DrawLaser(Main.spriteBatch, tex, start, end4, scale, new Utils.LaserLineFraming(DelegateMethods.LightningLaserDraw)); - } - } - if (projectile1.oldPos[0] != Vector2.Zero) - { - DelegateMethods.f_1 = 1f; - Vector2 start = projectile1.oldPos[0] + new Vector2((float) projectile1.width, (float) projectile1.height) / 2f + Vector2.UnitY * projectile1.gfxOffY - Main.screenPosition; - Utils.DrawLaser(Main.spriteBatch, tex, start, end3, scale, new Utils.LaserLineFraming(DelegateMethods.LightningLaserDraw)); - } - } - } - else if (projectile1.type == 445) - { - if ((double) Main.player[Main.projectile[i].owner].gravDir == -1.0) - spriteEffects |= SpriteEffects.FlipVertically; - Vector2 position = projectile1.position + new Vector2((float) projectile1.width, (float) projectile1.height) / 2f + Vector2.UnitY * projectile1.gfxOffY - Main.screenPosition; - Texture2D texture3 = TextureAssets.Projectile[projectile1.type].Value; - Microsoft.Xna.Framework.Color alpha = projectile1.GetAlpha(color10); - Vector2 vector2_70 = Main.player[projectile1.owner].RotatedRelativePoint(mountedCenter) + Vector2.UnitY * Main.player[projectile1.owner].gfxOffY; - Vector2 v = position + Main.screenPosition - vector2_70; - Vector2 vector2_71 = Vector2.Normalize(v); - float num387 = v.Length(); - float rotation = v.ToRotation() + 1.570796f; - float num388 = -5f; - float num389 = num388 + 30f; - Vector2 vector2_72 = new Vector2(2f, num387 - num389); - Vector2 vector2_73 = Vector2.Lerp(position + Main.screenPosition, vector2_70 + vector2_71 * num389, 0.5f); - Vector2 spinningpoint = -Vector2.UnitY.RotatedBy((double) projectile1.localAI[0] / 60.0 * 3.14159274101257); - Vector2[] vector2Array = new Vector2[4] - { - spinningpoint, - spinningpoint.RotatedBy(1.57079637050629), - spinningpoint.RotatedBy(3.14159274101257), - spinningpoint.RotatedBy(4.71238899230957) - }; - if ((double) num387 > (double) num389) - { - for (int index = 0; index < 2; ++index) - { - Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; - Microsoft.Xna.Framework.Color color101; - if (index % 2 == 0) - { - Microsoft.Xna.Framework.Color limeGreen = Microsoft.Xna.Framework.Color.LimeGreen; - limeGreen.A = (byte) 128; - color101 = limeGreen * 0.5f; - } - else - { - Microsoft.Xna.Framework.Color cornflowerBlue = Microsoft.Xna.Framework.Color.CornflowerBlue; - cornflowerBlue.A = (byte) 128; - color101 = cornflowerBlue * 0.5f; - } - Vector2 vector2_74 = new Vector2(vector2Array[index].X, 0.0f).RotatedBy((double) rotation) * 4f; - Main.EntitySpriteDraw(TextureAssets.MagicPixel.Value, vector2_73 - Main.screenPosition + vector2_74, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 1, 1)), color101, rotation, Vector2.One / 2f, new Vector2(2f, num387 - num389), spriteEffects, 0); - } - } - int type2 = Main.player[projectile1.owner].inventory[Main.player[projectile1.owner].selectedItem].type; - Main.instance.LoadItem(type2); - Texture2D texture4 = TextureAssets.Item[type2].Value; - Microsoft.Xna.Framework.Color color102 = Lighting.GetColor((int) vector2_70.X / 16, (int) vector2_70.Y / 16); - Main.EntitySpriteDraw(texture4, vector2_70 - Main.screenPosition + vector2_71 * num388, new Microsoft.Xna.Framework.Rectangle?(), color102, (float) ((double) projectile1.rotation + 1.57079637050629 + (spriteEffects == SpriteEffects.None || spriteEffects == SpriteEffects.FlipVertically ? 3.14159274101257 : 0.0)), new Vector2(spriteEffects == SpriteEffects.None || spriteEffects == SpriteEffects.FlipVertically ? 0.0f : (float) texture4.Width, (float) texture4.Height / 2f) + Vector2.UnitY * 1f, Main.player[projectile1.owner].inventory[Main.player[projectile1.owner].selectedItem].scale, spriteEffects, 0); - Main.EntitySpriteDraw(TextureAssets.GlowMask[39].Value, vector2_70 - Main.screenPosition + vector2_71 * num388, new Microsoft.Xna.Framework.Rectangle?(), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), (float) ((double) projectile1.rotation + 1.57079637050629 + (spriteEffects == SpriteEffects.None || spriteEffects == SpriteEffects.FlipVertically ? 3.14159274101257 : 0.0)), new Vector2(spriteEffects == SpriteEffects.None || spriteEffects == SpriteEffects.FlipVertically ? 0.0f : (float) texture4.Width, (float) texture4.Height / 2f) + Vector2.UnitY * 1f, Main.player[projectile1.owner].inventory[Main.player[projectile1.owner].selectedItem].scale, spriteEffects, 0); - if ((double) num387 > (double) num389) - { - for (int index = 2; index < 4; ++index) - { - Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; - Microsoft.Xna.Framework.Color color103; - if (index % 2 == 0) - { - Microsoft.Xna.Framework.Color limeGreen = Microsoft.Xna.Framework.Color.LimeGreen; - limeGreen.A = (byte) 128; - color103 = limeGreen * 0.5f; - } - else - { - Microsoft.Xna.Framework.Color cornflowerBlue = Microsoft.Xna.Framework.Color.CornflowerBlue; - cornflowerBlue.A = (byte) 128; - color103 = cornflowerBlue * 0.5f; - } - Vector2 vector2_75 = new Vector2(vector2Array[index].X, 0.0f).RotatedBy((double) rotation) * 4f; - Main.EntitySpriteDraw(TextureAssets.MagicPixel.Value, vector2_73 - Main.screenPosition + vector2_75, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 1, 1)), color103, rotation, Vector2.One / 2f, new Vector2(2f, num387 - num389), spriteEffects, 0); - } - } - float num390 = projectile1.localAI[0] / 60f; - if ((double) num390 > 0.5) - num390 = 1f - num390; - Main.EntitySpriteDraw(texture3, position, new Microsoft.Xna.Framework.Rectangle?(), alpha * num390 * 2f, projectile1.rotation, new Vector2((float) texture3.Width, (float) texture3.Height) / 2f, projectile1.scale, spriteEffects, 0); - Main.EntitySpriteDraw(TextureAssets.GlowMask[40].Value, position, new Microsoft.Xna.Framework.Rectangle?(), alpha * (0.5f - num390) * 2f, projectile1.rotation, new Vector2((float) texture3.Width, (float) texture3.Height) / 2f, projectile1.scale, spriteEffects, 0); - } - else if (projectile1.type >= 393 && projectile1.type <= 395 || projectile1.type == 398 || projectile1.type == 423 || projectile1.type == 450) - { - Texture2D texture5 = TextureAssets.Projectile[projectile1.type].Value; - int height = TextureAssets.Projectile[projectile1.type].Height() / Main.projFrames[projectile1.type]; - int y = height * projectile1.frame; - Main.EntitySpriteDraw(texture5, projectile1.Center - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY - 2f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y, texture5.Width, height)), projectile1.GetAlpha(color10), projectile1.rotation, new Vector2((float) texture5.Width / 2f, (float) height / 2f), projectile1.scale, spriteEffects, 0); - if (projectile1.type == 398) - { - Texture2D texture6 = TextureAssets.MiniMinotaur.Value; - Main.EntitySpriteDraw(texture6, projectile1.Center - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY - 2f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y, texture6.Width, height)), new Microsoft.Xna.Framework.Color(250, 250, 250, projectile1.alpha), projectile1.rotation, new Vector2((float) texture6.Width / 2f, (float) height / 2f), projectile1.scale, spriteEffects, 0); - } - if (projectile1.type != 423) - return; - Texture2D texture7 = TextureAssets.GlowMask[0].Value; - Main.EntitySpriteDraw(texture7, projectile1.Center - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY - 2f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y, texture7.Width, height)), new Microsoft.Xna.Framework.Color(250, 250, 250, projectile1.alpha), projectile1.rotation, new Vector2((float) texture7.Width / 2f, (float) height / 2f), projectile1.scale, spriteEffects, 0); - } - else if (projectile1.type == 385) - { - Texture2D texture = TextureAssets.Projectile[projectile1.type].Value; - int height = texture.Height / Main.projFrames[projectile1.type]; - int y = height * projectile1.frame; - int num391 = 8; - int num392 = 2; - float num393 = 0.4f; - for (int index = 1; index < num391; index += num392) - { - ref Vector2 local = ref projectile1.oldPos[index]; - Microsoft.Xna.Framework.Color newColor = color10; - Microsoft.Xna.Framework.Color color104 = projectile1.GetAlpha(newColor) * ((float) (num391 - index) / 15f); - Microsoft.Xna.Framework.Color alpha = projectile1.GetAlpha(color10); - Vector2 vector2 = projectile1.oldPos[index] - Main.screenPosition + new Vector2(x17 + (float) num209, (float) (projectile1.height / 2) + projectile1.gfxOffY); - Main.EntitySpriteDraw(texture, projectile1.oldPos[index] + new Vector2((float) projectile1.width, (float) projectile1.height) / 2f - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y, texture.Width, height)), Microsoft.Xna.Framework.Color.Lerp(alpha, color104, 0.3f), projectile1.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), MathHelper.Lerp(projectile1.scale, num393, (float) index / 15f), spriteEffects, 0); - } - Main.EntitySpriteDraw(texture, projectile1.Center - Main.screenPosition + new Vector2(0.0f, projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y, texture.Width, height)), projectile1.GetAlpha(color10), projectile1.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), projectile1.scale, spriteEffects, 0); - } - else if (projectile1.type == 388) - { - Texture2D texture = TextureAssets.Projectile[projectile1.type].Value; - int height = texture.Height / Main.projFrames[projectile1.type]; - int y = height * projectile1.frame; - int num394; - int num395; - if ((double) projectile1.ai[0] == 2.0) - { - num394 = 10; - num395 = 1; - } - else - { - num395 = 2; - num394 = 5; - } - for (int index = 1; index < num394; index += num395) - { - ref Vector2 local = ref projectile1.oldPos[index]; - Microsoft.Xna.Framework.Color newColor = color10; - Microsoft.Xna.Framework.Color color105 = projectile1.GetAlpha(newColor) * ((float) (num394 - index) / 15f); - Vector2 position = projectile1.oldPos[index] - Main.screenPosition + new Vector2(x17 + (float) num209, (float) (projectile1.height / 2) + projectile1.gfxOffY); - Main.EntitySpriteDraw(texture, position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y, texture.Width, height)), color105, projectile1.rotation, new Vector2(x17, (float) (projectile1.height / 2 + num208)), projectile1.scale, spriteEffects, 0); - } - Main.EntitySpriteDraw(texture, projectile1.position - Main.screenPosition + new Vector2(x17 + (float) num209, (float) (projectile1.height / 2) + projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y, texture.Width, height)), projectile1.GetAlpha(color10), projectile1.rotation, new Vector2(x17, (float) (projectile1.height / 2 + num208)), projectile1.scale, spriteEffects, 0); - } - else if (Main.projFrames[projectile1.type] > 1) - { - int height = TextureAssets.Projectile[projectile1.type].Height() / Main.projFrames[projectile1.type]; - int y = height * projectile1.frame; - if (projectile1.type == 111) - { - Microsoft.Xna.Framework.Color oldColor = new Microsoft.Xna.Framework.Color((int) Main.player[projectile1.owner].shirtColor.R, (int) Main.player[projectile1.owner].shirtColor.G, (int) Main.player[projectile1.owner].shirtColor.B); - Microsoft.Xna.Framework.Color color106 = Lighting.GetColor((int) ((double) projectile1.position.X + (double) projectile1.width * 0.5) / 16, (int) (((double) projectile1.position.Y + (double) projectile1.height * 0.5) / 16.0), oldColor); - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, new Vector2(projectile1.position.X - Main.screenPosition.X + x17 + (float) num209, projectile1.position.Y - Main.screenPosition.Y + (float) (projectile1.height / 2) + projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y, TextureAssets.Projectile[projectile1.type].Width(), height)), projectile1.GetAlpha(color106), projectile1.rotation, new Vector2(x17, (float) (projectile1.height / 2 + num208)), projectile1.scale, spriteEffects, 0); - } - else - { - Microsoft.Xna.Framework.Color alpha = projectile1.GetAlpha(color10); - if (projectile1.type == 211 && Main.CurrentDrawnEntityShader != 0) - alpha.A = (byte) 127; - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, new Vector2(projectile1.position.X - Main.screenPosition.X + x17 + (float) num209, projectile1.position.Y - Main.screenPosition.Y + (float) (projectile1.height / 2) + projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y, TextureAssets.Projectile[projectile1.type].Width(), height - 1)), alpha, projectile1.rotation, new Vector2(x17, (float) (projectile1.height / 2 + num208)), projectile1.scale, spriteEffects, 0); - if (projectile1.type == 335) - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, new Vector2(projectile1.position.X - Main.screenPosition.X + x17 + (float) num209, projectile1.position.Y - Main.screenPosition.Y + (float) (projectile1.height / 2) + projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y, TextureAssets.Projectile[projectile1.type].Width(), height - 1)), new Microsoft.Xna.Framework.Color(100, 100, 100, 0), projectile1.rotation, new Vector2(x17, (float) (projectile1.height / 2 + num208)), projectile1.scale, spriteEffects, 0); - if (projectile1.type == 897 || projectile1.type == 899) - { - int index = 279; - if (projectile1.type == 899) - index = 281; - Main.EntitySpriteDraw(TextureAssets.GlowMask[index].Value, new Vector2(projectile1.position.X - Main.screenPosition.X + x17 + (float) num209, projectile1.position.Y - Main.screenPosition.Y + (float) (projectile1.height / 2) + projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y, TextureAssets.Projectile[projectile1.type].Width(), height - 1)), Microsoft.Xna.Framework.Color.White, projectile1.rotation, new Vector2(x17, (float) (projectile1.height / 2 + num208)), projectile1.scale, spriteEffects, 0); - } - if (projectile1.type == 891) - { - float num396 = Utils.WrappedLerp(0.6f, 1f, (float) ((int) Main.timeForVisualEffects % 100) / 100f); - Microsoft.Xna.Framework.Color color107 = new Microsoft.Xna.Framework.Color(num396, num396, num396, 150f); - Main.EntitySpriteDraw(TextureAssets.GlowMask[277].Value, new Vector2(projectile1.position.X - Main.screenPosition.X + x17 + (float) num209, projectile1.position.Y - Main.screenPosition.Y + (float) (projectile1.height / 2) + projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y, TextureAssets.Projectile[projectile1.type].Width(), height - 1)), color107, projectile1.rotation, new Vector2(x17, (float) (projectile1.height / 2 + num208)), projectile1.scale, spriteEffects, 0); - } - if (projectile1.type == 595) - { - Player player = Main.player[projectile1.owner]; - if (player.active && player.body == 208) - { - for (float amount = 0.0f; (double) amount <= 1.0; amount += 0.2f) - { - Microsoft.Xna.Framework.Color underShirtColor = player.underShirtColor; - underShirtColor.A = (byte) (120.0 * (1.0 - (double) amount * 0.5)); - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, new Vector2(projectile1.position.X - Main.screenPosition.X + x17 + (float) num209, projectile1.position.Y - Main.screenPosition.Y + (float) (projectile1.height / 2) + projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y, TextureAssets.Projectile[projectile1.type].Width(), height - 1)), underShirtColor, projectile1.rotation, new Vector2(x17, (float) (projectile1.height / 2 + num208)), projectile1.scale * MathHelper.Lerp(0.8f, 1.3f, amount), spriteEffects, 0); - } - } - } - if (projectile1.type == 387) - Main.EntitySpriteDraw(TextureAssets.EyeLaserSmall.Value, new Vector2(projectile1.position.X - Main.screenPosition.X + x17 + (float) num209, projectile1.position.Y - Main.screenPosition.Y + (float) (projectile1.height / 2) + projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y, TextureAssets.Projectile[projectile1.type].Width(), height)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), projectile1.rotation, new Vector2(x17, (float) (projectile1.height / 2 + num208)), projectile1.scale, spriteEffects, 0); - if (projectile1.type != 525) - return; - int num397 = Main.TryInteractingWithMoneyTrough(projectile1); - if (num397 == 0) - return; - int averageTileLighting = ((int) color10.R + (int) color10.G + (int) color10.B) / 3; - if (averageTileLighting <= 10) - return; - Microsoft.Xna.Framework.Color selectionGlowColor = Colors.GetSelectionGlowColor(num397 == 2, averageTileLighting); - Main.EntitySpriteDraw(TextureAssets.Extra[94].Value, new Vector2(projectile1.position.X - Main.screenPosition.X + x17 + (float) num209, projectile1.position.Y - Main.screenPosition.Y + (float) (projectile1.height / 2) + projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y, TextureAssets.Projectile[projectile1.type].Width(), height - 1)), selectionGlowColor, 0.0f, new Vector2(x17, (float) (projectile1.height / 2 + num208)), 1f, spriteEffects, 0); - } - } - else if (projectile1.type == 383 || projectile1.type == 399) - { - Texture2D texture = TextureAssets.Projectile[projectile1.type].Value; - Main.EntitySpriteDraw(texture, projectile1.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(), projectile1.GetAlpha(color10), projectile1.rotation, new Vector2((float) texture.Width, (float) texture.Height) / 2f, projectile1.scale, spriteEffects, 0); - } - else if (projectile1.type == 157 || projectile1.type == 378) - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, new Vector2(projectile1.position.X - Main.screenPosition.X + (float) (projectile1.width / 2), projectile1.position.Y - Main.screenPosition.Y + (float) (projectile1.height / 2)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Projectile[projectile1.type].Width(), TextureAssets.Projectile[projectile1.type].Height())), projectile1.GetAlpha(color10), projectile1.rotation, new Vector2((float) (TextureAssets.Projectile[projectile1.type].Width() / 2), (float) (TextureAssets.Projectile[projectile1.type].Height() / 2)), projectile1.scale, spriteEffects, 0); - else if (projectile1.type == 306) - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, new Vector2(projectile1.position.X - Main.screenPosition.X + (float) (projectile1.width / 2), projectile1.position.Y - Main.screenPosition.Y + (float) (projectile1.height / 2)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Projectile[projectile1.type].Width(), TextureAssets.Projectile[projectile1.type].Height())), projectile1.GetAlpha(color10), projectile1.rotation, new Vector2((float) (TextureAssets.Projectile[projectile1.type].Width() / 2), (float) (TextureAssets.Projectile[projectile1.type].Height() / 2)), projectile1.scale, spriteEffects, 0); - else if (projectile1.type == 256) - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, new Vector2(projectile1.position.X - Main.screenPosition.X + (float) (projectile1.width / 2), projectile1.position.Y - Main.screenPosition.Y + (float) (projectile1.height / 2)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Projectile[projectile1.type].Width(), TextureAssets.Projectile[projectile1.type].Height())), projectile1.GetAlpha(color10), projectile1.rotation, new Vector2((float) (TextureAssets.Projectile[projectile1.type].Width() / 2), (float) (TextureAssets.Projectile[projectile1.type].Height() / 2)), projectile1.scale, spriteEffects, 0); - else if (projectile1.aiStyle == 27) - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, new Vector2(projectile1.position.X - Main.screenPosition.X + (float) (projectile1.width / 2), projectile1.position.Y - Main.screenPosition.Y + (float) (projectile1.height / 2)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Projectile[projectile1.type].Width(), TextureAssets.Projectile[projectile1.type].Height())), projectile1.GetAlpha(color10), projectile1.rotation, new Vector2((float) TextureAssets.Projectile[projectile1.type].Width(), 0.0f), projectile1.scale, spriteEffects, 0); - else if (projectile1.aiStyle == 19) - { - SpriteEffects effects = SpriteEffects.None; - float rotation = (float) Math.Atan2((double) projectile1.velocity.Y, (double) projectile1.velocity.X) + 2.355f; - Vector2 origin = Vector2.Zero; - if (Main.player[projectile1.owner].direction > 0) - { - effects = SpriteEffects.FlipHorizontally; - origin.X = (float) TextureAssets.Projectile[projectile1.type].Width(); - rotation -= 1.570796f; - } - if ((double) Main.player[projectile1.owner].gravDir == -1.0) - { - if (projectile1.direction == 1) - { - effects = SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically; - origin = new Vector2((float) TextureAssets.Projectile[projectile1.type].Width(), (float) TextureAssets.Projectile[projectile1.type].Height()); - rotation -= 1.570796f; - } - else if (projectile1.direction == -1) - { - effects = SpriteEffects.FlipVertically; - origin = new Vector2(0.0f, (float) TextureAssets.Projectile[projectile1.type].Height()); - rotation += 1.570796f; - } - } - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, new Vector2(projectile1.position.X - Main.screenPosition.X + (float) (projectile1.width / 2), projectile1.position.Y - Main.screenPosition.Y + (float) (projectile1.height / 2) + projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Projectile[projectile1.type].Width(), TextureAssets.Projectile[projectile1.type].Height())), projectile1.GetAlpha(color10), rotation, origin, projectile1.scale, effects, 0); - } - else if (projectile1.type == 451) - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, projectile1.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(), projectile1.GetAlpha(color10), projectile1.rotation, new Vector2((float) TextureAssets.Projectile[projectile1.type].Width(), 0.0f), projectile1.scale, spriteEffects, 0); - else if (projectile1.type == 434) - { - Vector2 vector2_76 = new Vector2(projectile1.ai[0], projectile1.ai[1]); - Vector2 v = projectile1.position - vector2_76; - float y = (float) Math.Sqrt((double) v.X * (double) v.X + (double) v.Y * (double) v.Y); - Vector2 vector2_77 = new Vector2(4f, y); - float rotation = v.ToRotation() + 1.570796f; - Vector2 vector2_78 = Vector2.Lerp(projectile1.position, vector2_76, 0.5f); - Microsoft.Xna.Framework.Color red = Microsoft.Xna.Framework.Color.Red; - red.A = (byte) 0; - Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; - Microsoft.Xna.Framework.Color color108 = red * projectile1.localAI[0]; - Microsoft.Xna.Framework.Color color109 = white * projectile1.localAI[0]; - float num398 = (float) Math.Sqrt((double) (projectile1.damage / 50)); - Main.EntitySpriteDraw(TextureAssets.MagicPixel.Value, vector2_78 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 1, 1)), color108, rotation, Vector2.One / 2f, new Vector2(2f * num398, y + 8f), spriteEffects, 0); - Main.EntitySpriteDraw(TextureAssets.MagicPixel.Value, vector2_78 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 1, 1)), color108, rotation, Vector2.One / 2f, new Vector2(4f * num398, y), spriteEffects, 0); - Main.EntitySpriteDraw(TextureAssets.MagicPixel.Value, vector2_78 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 1, 1)), color109, rotation, Vector2.One / 2f, new Vector2(2f * num398, y), spriteEffects, 0); - } - else - { - if (projectile1.type == 94 && (double) projectile1.ai[1] > 6.0) - { - for (int index = 0; index < 10; ++index) - { - Microsoft.Xna.Framework.Color alpha = projectile1.GetAlpha(color10); - float num399 = (float) (9 - index) / 9f; - alpha.R = (byte) ((double) alpha.R * (double) num399); - alpha.G = (byte) ((double) alpha.G * (double) num399); - alpha.B = (byte) ((double) alpha.B * (double) num399); - alpha.A = (byte) ((double) alpha.A * (double) num399); - float num400 = (float) (9 - index) / 9f; - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, new Vector2(projectile1.oldPos[index].X - Main.screenPosition.X + x17 + (float) num209, projectile1.oldPos[index].Y - Main.screenPosition.Y + (float) (projectile1.height / 2) + projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Projectile[projectile1.type].Width(), TextureAssets.Projectile[projectile1.type].Height())), alpha, projectile1.rotation, new Vector2(x17, (float) (projectile1.height / 2 + num208)), num400 * projectile1.scale, spriteEffects, 0); - } - } - if (projectile1.type == 301) - { - for (int index = 0; index < 10; ++index) - { - Microsoft.Xna.Framework.Color alpha = projectile1.GetAlpha(color10); - float num401 = (float) (9 - index) / 9f; - alpha.R = (byte) ((double) alpha.R * (double) num401); - alpha.G = (byte) ((double) alpha.G * (double) num401); - alpha.B = (byte) ((double) alpha.B * (double) num401); - alpha.A = (byte) ((double) alpha.A * (double) num401); - float num402 = (float) (9 - index) / 9f; - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, new Vector2(projectile1.oldPos[index].X - Main.screenPosition.X + x17 + (float) num209, projectile1.oldPos[index].Y - Main.screenPosition.Y + (float) (projectile1.height / 2) + projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Projectile[projectile1.type].Width(), TextureAssets.Projectile[projectile1.type].Height())), alpha, projectile1.rotation, new Vector2(x17, (float) (projectile1.height / 2 + num208)), num402 * projectile1.scale, spriteEffects, 0); - } - } - if (projectile1.type == 323 && projectile1.alpha == 0) - { - for (int index = 1; index < 8; ++index) - { - float num403 = projectile1.velocity.X * (float) index; - float num404 = projectile1.velocity.Y * (float) index; - Microsoft.Xna.Framework.Color alpha = projectile1.GetAlpha(color10); - float num405 = 0.0f; - if (index == 1) - num405 = 0.7f; - if (index == 2) - num405 = 0.6f; - if (index == 3) - num405 = 0.5f; - if (index == 4) - num405 = 0.4f; - if (index == 5) - num405 = 0.3f; - if (index == 6) - num405 = 0.2f; - if (index == 7) - num405 = 0.1f; - alpha.R = (byte) ((double) alpha.R * (double) num405); - alpha.G = (byte) ((double) alpha.G * (double) num405); - alpha.B = (byte) ((double) alpha.B * (double) num405); - alpha.A = (byte) ((double) alpha.A * (double) num405); - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, new Vector2(projectile1.position.X - Main.screenPosition.X + x17 + (float) num209 - num403, projectile1.position.Y - Main.screenPosition.Y + (float) (projectile1.height / 2) + projectile1.gfxOffY - num404), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Projectile[projectile1.type].Width(), TextureAssets.Projectile[projectile1.type].Height())), alpha, projectile1.rotation, new Vector2(x17, (float) (projectile1.height / 2 + num208)), num405 + 0.2f, spriteEffects, 0); - } - } - if (projectile1.type == 117 && (double) projectile1.ai[0] > 3.0) - { - for (int index = 1; index < 5; ++index) - { - float num406 = projectile1.velocity.X * (float) index; - float num407 = projectile1.velocity.Y * (float) index; - Microsoft.Xna.Framework.Color alpha = projectile1.GetAlpha(color10); - float num408 = 0.0f; - if (index == 1) - num408 = 0.4f; - if (index == 2) - num408 = 0.3f; - if (index == 3) - num408 = 0.2f; - if (index == 4) - num408 = 0.1f; - alpha.R = (byte) ((double) alpha.R * (double) num408); - alpha.G = (byte) ((double) alpha.G * (double) num408); - alpha.B = (byte) ((double) alpha.B * (double) num408); - alpha.A = (byte) ((double) alpha.A * (double) num408); - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, new Vector2(projectile1.position.X - Main.screenPosition.X + x17 + (float) num209 - num406, projectile1.position.Y - Main.screenPosition.Y + (float) (projectile1.height / 2) + projectile1.gfxOffY - num407), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Projectile[projectile1.type].Width(), TextureAssets.Projectile[projectile1.type].Height())), alpha, projectile1.rotation, new Vector2(x17, (float) (projectile1.height / 2 + num208)), projectile1.scale, spriteEffects, 0); - } - } - if (projectile1.bobber) - { - if ((double) projectile1.ai[1] > 0.0 && (double) projectile1.ai[1] < 5045.0 && (double) projectile1.ai[0] == 1.0) - { - int i3 = (int) projectile1.ai[1]; - Vector2 center = projectile1.Center; - float num409 = projectile1.rotation; - Vector2 vector2 = center; - float num410 = polePosX - vector2.X; - float num411 = polePosY - vector2.Y; - num409 = (float) Math.Atan2((double) num411, (double) num410); - float rotation; - if ((double) projectile1.velocity.X > 0.0) - { - spriteEffects = SpriteEffects.None; - rotation = (float) Math.Atan2((double) num411, (double) num410) + 0.785f; - if ((double) projectile1.ai[1] == 2342.0) - rotation -= 0.785f; - } - else - { - spriteEffects = SpriteEffects.FlipHorizontally; - rotation = (float) Math.Atan2(-(double) num411, -(double) num410) - 0.785f; - if ((double) projectile1.ai[1] == 2342.0) - rotation += 0.785f; - } - Main.instance.LoadItem(i3); - Main.EntitySpriteDraw(TextureAssets.Item[i3].Value, new Vector2(center.X - Main.screenPosition.X, center.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Item[i3].Width(), TextureAssets.Item[i3].Height())), color10, rotation, new Vector2((float) (TextureAssets.Item[i3].Width() / 2), (float) (TextureAssets.Item[i3].Height() / 2)), projectile1.scale, spriteEffects, 0); - } - else if ((double) projectile1.ai[0] <= 1.0) - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, new Vector2(projectile1.position.X - Main.screenPosition.X + x17 + (float) num209, projectile1.position.Y - Main.screenPosition.Y + (float) (projectile1.height / 2) + projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Projectile[projectile1.type].Width(), TextureAssets.Projectile[projectile1.type].Height())), projectile1.GetAlpha(color10), projectile1.rotation, new Vector2(x17, (float) (projectile1.height / 2 + num208)), projectile1.scale, spriteEffects, 0); - } - else - { - if (projectile1.ownerHitCheck && (double) Main.player[projectile1.owner].gravDir == -1.0) - { - if (Main.player[projectile1.owner].direction == 1) - spriteEffects = SpriteEffects.FlipHorizontally; - else if (Main.player[projectile1.owner].direction == -1) - spriteEffects = SpriteEffects.None; - } - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, new Vector2(projectile1.position.X - Main.screenPosition.X + x17 + (float) num209, projectile1.position.Y - Main.screenPosition.Y + (float) (projectile1.height / 2) + projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Projectile[projectile1.type].Width(), TextureAssets.Projectile[projectile1.type].Height())), projectile1.GetAlpha(color10), projectile1.rotation, new Vector2(x17, (float) (projectile1.height / 2 + num208)), projectile1.scale, spriteEffects, 0); - if (projectile1.glowMask != (short) -1) - Main.EntitySpriteDraw(TextureAssets.GlowMask[(int) projectile1.glowMask].Value, new Vector2(projectile1.position.X - Main.screenPosition.X + x17 + (float) num209, projectile1.position.Y - Main.screenPosition.Y + (float) (projectile1.height / 2) + projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Projectile[projectile1.type].Width(), TextureAssets.Projectile[projectile1.type].Height())), new Microsoft.Xna.Framework.Color(250, 250, 250, projectile1.alpha), projectile1.rotation, new Vector2(x17, (float) (projectile1.height / 2 + num208)), projectile1.scale, spriteEffects, 0); - if (projectile1.type == 473) - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, new Vector2(projectile1.position.X - Main.screenPosition.X + x17 + (float) num209, projectile1.position.Y - Main.screenPosition.Y + (float) (projectile1.height / 2) + projectile1.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Projectile[projectile1.type].Width(), TextureAssets.Projectile[projectile1.type].Height())), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, 0, 0), projectile1.rotation, new Vector2(x17, (float) (projectile1.height / 2 + num208)), projectile1.scale, spriteEffects, 0); - if (projectile1.type == 312) - { - ulong tileFrameSeed = Main.TileFrameSeed; - for (int index = 0; index < 4; ++index) - { - Vector2 vector2 = new Vector2((float) Utils.RandomInt(ref tileFrameSeed, -2, 3), (float) Utils.RandomInt(ref tileFrameSeed, -2, 3)); - Main.EntitySpriteDraw(TextureAssets.GlowMask[(int) projectile1.glowMask].Value, new Vector2(projectile1.position.X - Main.screenPosition.X + x17 + (float) num209, projectile1.position.Y - Main.screenPosition.Y + (float) (projectile1.height / 2) + projectile1.gfxOffY) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Projectile[projectile1.type].Width(), TextureAssets.Projectile[projectile1.type].Height())), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue) * 0.2f, projectile1.rotation, new Vector2(x17, (float) (projectile1.height / 2 + num208)), projectile1.scale, spriteEffects, 0); - } - } - } - if (projectile1.type == 106) - Main.EntitySpriteDraw(TextureAssets.LightDisc.Value, new Vector2(projectile1.position.X - Main.screenPosition.X + x17 + (float) num209, projectile1.position.Y - Main.screenPosition.Y + (float) (projectile1.height / 2)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Projectile[projectile1.type].Width(), TextureAssets.Projectile[projectile1.type].Height())), new Microsoft.Xna.Framework.Color(200, 200, 200, 0), projectile1.rotation, new Vector2(x17, (float) (projectile1.height / 2 + num208)), projectile1.scale, spriteEffects, 0); - if (projectile1.type >= 326 && projectile1.type <= 328) - { - ulong tileFrameSeed = Main.TileFrameSeed; - for (int index = 0; index < 4; ++index) - { - Vector2 vector2 = new Vector2((float) Utils.RandomInt(ref tileFrameSeed, -2, 3), (float) Utils.RandomInt(ref tileFrameSeed, -2, 3)); - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, new Vector2(projectile1.position.X - Main.screenPosition.X + x17 + (float) num209, projectile1.position.Y - Main.screenPosition.Y + (float) (projectile1.height / 2)) + vector2 - projectile1.velocity * 0.25f * (float) index, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Projectile[projectile1.type].Width(), TextureAssets.Projectile[projectile1.type].Height())), new Microsoft.Xna.Framework.Color(120, 120, 120, 60) * 1f, projectile1.rotation, new Vector2(x17, (float) (projectile1.height / 2 + num208)), projectile1.scale - (float) index * 0.2f, spriteEffects, 0); - } - } - if (projectile1.type == 554 || projectile1.type == 603) - { - for (int index = 1; index < 5; ++index) - { - float num412 = (float) ((double) projectile1.velocity.X * (double) index * 0.5); - float num413 = (float) ((double) projectile1.velocity.Y * (double) index * 0.5); - Microsoft.Xna.Framework.Color alpha = projectile1.GetAlpha(color10); - float num414 = 0.0f; - if (index == 1) - num414 = 0.4f; - if (index == 2) - num414 = 0.3f; - if (index == 3) - num414 = 0.2f; - if (index == 4) - num414 = 0.1f; - alpha.R = (byte) ((double) alpha.R * (double) num414); - alpha.G = (byte) ((double) alpha.G * (double) num414); - alpha.B = (byte) ((double) alpha.B * (double) num414); - alpha.A = (byte) ((double) alpha.A * (double) num414); - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, new Vector2(projectile1.position.X - Main.screenPosition.X + x17 + (float) num209 - num412, projectile1.position.Y - Main.screenPosition.Y + (float) (projectile1.height / 2) + projectile1.gfxOffY - num413), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Projectile[projectile1.type].Width(), TextureAssets.Projectile[projectile1.type].Height())), alpha, projectile1.rotation, new Vector2(x17, (float) (projectile1.height / 2 + num208)), projectile1.scale, spriteEffects, 0); - } - } - else if (projectile1.type == 604) - { - int num415 = (int) projectile1.ai[1] + 1; - if (num415 > 7) - num415 = 7; - for (int index = 1; index < num415; ++index) - { - float num416 = (float) ((double) projectile1.velocity.X * (double) index * 1.5); - float num417 = (float) ((double) projectile1.velocity.Y * (double) index * 1.5); - Microsoft.Xna.Framework.Color alpha = projectile1.GetAlpha(color10); - float num418 = 0.0f; - if (index == 1) - num418 = 0.4f; - if (index == 2) - num418 = 0.3f; - if (index == 3) - num418 = 0.2f; - if (index == 4) - num418 = 0.1f; - float num419 = (float) (0.400000005960464 - (double) index * 0.0599999986588955) * (float) (1.0 - (double) projectile1.alpha / (double) byte.MaxValue); - alpha.R = (byte) ((double) alpha.R * (double) num419); - alpha.G = (byte) ((double) alpha.G * (double) num419); - alpha.B = (byte) ((double) alpha.B * (double) num419); - alpha.A = (byte) ((double) alpha.A * (double) num419 / 2.0); - float scale = projectile1.scale - (float) index * 0.1f; - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, new Vector2(projectile1.position.X - Main.screenPosition.X + x17 + (float) num209 - num416, projectile1.position.Y - Main.screenPosition.Y + (float) (projectile1.height / 2) + projectile1.gfxOffY - num417), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Projectile[projectile1.type].Width(), TextureAssets.Projectile[projectile1.type].Height())), alpha, projectile1.rotation, new Vector2(x17, (float) (projectile1.height / 2 + num208)), scale, spriteEffects, 0); - } - } - else - { - if (projectile1.type != 553) - return; - for (int index = 1; index < 5; ++index) - { - float num420 = (float) ((double) projectile1.velocity.X * (double) index * 0.400000005960464); - float num421 = (float) ((double) projectile1.velocity.Y * (double) index * 0.400000005960464); - Microsoft.Xna.Framework.Color alpha = projectile1.GetAlpha(color10); - float num422 = 0.0f; - if (index == 1) - num422 = 0.4f; - if (index == 2) - num422 = 0.3f; - if (index == 3) - num422 = 0.2f; - if (index == 4) - num422 = 0.1f; - alpha.R = (byte) ((double) alpha.R * (double) num422); - alpha.G = (byte) ((double) alpha.G * (double) num422); - alpha.B = (byte) ((double) alpha.B * (double) num422); - alpha.A = (byte) ((double) alpha.A * (double) num422); - Main.EntitySpriteDraw(TextureAssets.Projectile[projectile1.type].Value, new Vector2(projectile1.position.X - Main.screenPosition.X + x17 + (float) num209 - num420, projectile1.position.Y - Main.screenPosition.Y + (float) (projectile1.height / 2) + projectile1.gfxOffY - num421), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Projectile[projectile1.type].Width(), TextureAssets.Projectile[projectile1.type].Height())), alpha, projectile1.rotation, new Vector2(x17, (float) (projectile1.height / 2 + num208)), projectile1.scale, spriteEffects, 0); - } - } - } - } - } - } - } - } - - private static void DrawPrettyStarSparkle( - Projectile proj, - SpriteEffects dir, - Vector2 drawpos, - Microsoft.Xna.Framework.Color drawColor, - Microsoft.Xna.Framework.Color shineColor) - { - Texture2D texture2D = TextureAssets.Extra[98].Value; - Microsoft.Xna.Framework.Color color1 = shineColor * proj.Opacity * 0.5f; - color1.A = (byte) 0; - Vector2 origin = texture2D.Size() / 2f; - Microsoft.Xna.Framework.Color color2 = drawColor * 0.5f; - float num = Utils.GetLerpValue(15f, 30f, proj.localAI[0], true) * Utils.GetLerpValue(45f, 30f, proj.localAI[0], true); - Vector2 scale1 = new Vector2(0.5f, 5f) * num; - Vector2 scale2 = new Vector2(0.5f, 2f) * num; - Microsoft.Xna.Framework.Color color3 = color1 * num; - Microsoft.Xna.Framework.Color color4 = color2 * num; - Vector2 position = drawpos; - Main.EntitySpriteDraw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(), color3, 1.570796f, origin, scale1, dir, 0); - Main.EntitySpriteDraw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(), color3, 0.0f, origin, scale2, dir, 0); - Main.EntitySpriteDraw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(), color4, 1.570796f, origin, scale1 * 0.6f, dir, 0); - Main.EntitySpriteDraw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(), color4, 0.0f, origin, scale2 * 0.6f, dir, 0); - } - - private static void DrawProj_FlailChains(Projectile proj, Vector2 mountedCenter) - { - Player player = Main.player[proj.owner]; - Vector2 playerArmPosition = Main.GetPlayerArmPosition(proj); - Asset asset1 = (Asset) null; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); - float num1 = 0.0f; - Asset asset2; - switch (proj.type) - { - case 25: - asset2 = TextureAssets.Chain2; - break; - case 35: - asset2 = TextureAssets.Chain6; - break; - case 63: - asset2 = TextureAssets.Chain7; - break; - case 154: - asset2 = TextureAssets.Chain13; - break; - case 247: - asset2 = TextureAssets.Chain19; - break; - case 757: - asset2 = TextureAssets.Extra[99]; - sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(asset2.Frame(verticalFrames: 6)); - num1 = -2f; - break; - case 947: - asset2 = TextureAssets.Chain41; - break; - case 948: - asset2 = TextureAssets.Chain43; - break; - default: - asset2 = TextureAssets.Chain3; - break; - } - Vector2 origin = sourceRectangle.HasValue ? sourceRectangle.Value.Size() / 2f : asset2.Size() / 2f; - Vector2 center = proj.Center; - Vector2 v1 = playerArmPosition.MoveTowards(center, 4f) - center; - Vector2 v2 = v1.SafeNormalize(Vector2.Zero); - float num2 = (sourceRectangle.HasValue ? (float) sourceRectangle.Value.Height : (float) asset2.Height()) + num1; - float rotation = v2.ToRotation() + 1.570796f; - int num3 = 0; - float num4 = v1.Length() + num2 / 2f; - int num5 = 0; - for (; (double) num4 > 0.0; num4 -= num2) - { - Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) center.X / 16, (int) ((double) center.Y / 16.0)); - switch (proj.type) - { - case 757: - sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(asset2.Frame(verticalFrames: 6, frameY: (num3 % 6))); - break; - case 948: - if (num5 >= 6) - asset2 = asset1 = TextureAssets.Chain41; - else if (num5 >= 4) - { - asset2 = asset1 = TextureAssets.Chain42; - byte num6 = 140; - if ((int) color.R < (int) num6) - color.R = num6; - if ((int) color.G < (int) num6) - color.G = num6; - if ((int) color.B < (int) num6) - color.B = num6; - } - else - color = Microsoft.Xna.Framework.Color.White; - ++num5; - break; - } - Main.spriteBatch.Draw(asset2.Value, center - Main.screenPosition, sourceRectangle, color, rotation, origin, 1f, SpriteEffects.None, 0.0f); - center += v2 * num2; - ++num3; - } - } - - private static void DrawProj_FlailChains_Old(Projectile proj, Vector2 mountedCenter) - { - Vector2 vector2 = new Vector2(proj.position.X + (float) proj.width * 0.5f, proj.position.Y + (float) proj.height * 0.5f); - float num1 = mountedCenter.X - vector2.X; - float num2 = mountedCenter.Y - vector2.Y; - float rotation = (float) Math.Atan2((double) num2, (double) num1) - 1.57f; - if (proj.alpha == 0) - { - int num3 = -1; - if ((double) proj.position.X + (double) (proj.width / 2) < (double) mountedCenter.X) - num3 = 1; - Main.player[proj.owner].itemRotation = Main.player[proj.owner].direction != 1 ? (float) Math.Atan2((double) num2 * (double) num3, (double) num1 * (double) num3) : (float) Math.Atan2((double) num2 * (double) num3, (double) num1 * (double) num3); - } - bool flag = true; - int num4 = 0; - int num5 = 25; - if (proj.type == 757) - num5 = 12; - while (flag) - { - float f = (float) Math.Sqrt((double) num1 * (double) num1 + (double) num2 * (double) num2); - if ((double) f < (double) num5) - flag = false; - else if (float.IsNaN(f)) + bool flag = true; + if ((double) num1 == 0.0 && (double) num2 == 0.0) { flag = false; } else { - float num6 = proj.type == 154 || proj.type == 247 ? 18f / f : (proj.type != 757 ? 12f / f : 16f / f); + float num6 = 12f / (float) Math.Sqrt((double) num1 * (double) num1 + (double) num2 * (double) num2); float num7 = num1 * num6; float num8 = num2 * num6; - vector2.X += num7; - vector2.Y += num8; - num1 = mountedCenter.X - vector2.X; - num2 = mountedCenter.Y - vector2.Y; + vector2.X -= num7 * 0.1f; + vector2.Y -= num8 * 0.1f; + num1 = projectile.position.X + (float) projectile.width * 0.5f - vector2.X; + num2 = projectile.position.Y + (float) projectile.height * 0.5f - vector2.Y; + } + while (flag) + { + float num9 = 12f; + float f1 = (float) Math.Sqrt((double) num1 * (double) num1 + (double) num2 * (double) num2); + float f2 = f1; + if (float.IsNaN(f1) || float.IsNaN(f2)) + { + flag = false; + } + else + { + if ((double) f1 < 20.0) + { + num9 = f1 - 8f; + flag = false; + } + float num10 = 12f / f1; + float num11 = num1 * num10; + float num12 = num2 * num10; + vector2.X += num11; + vector2.Y += num12; + num1 = projectile.position.X + (float) projectile.width * 0.5f - vector2.X; + num2 = projectile.position.Y + (float) projectile.height * 0.1f - vector2.Y; + if ((double) f2 > 12.0) + { + float num13 = 0.3f; + float num14 = Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y); + if ((double) num14 > 16.0) + num14 = 16f; + float num15 = (float) (1.0 - (double) num14 / 16.0); + float num16 = num13 * num15; + float num17 = f2 / 80f; + if ((double) num17 > 1.0) + num17 = 1f; + float num18 = num16 * num17; + if ((double) num18 < 0.0) + num18 = 0.0f; + float num19 = num18 * num17 * 0.5f; + if ((double) num2 > 0.0) + { + num2 *= 1f + num19; + num1 *= 1f - num19; + } + else + { + float num20 = Math.Abs(projectile.velocity.X) / 3f; + if ((double) num20 > 1.0) + num20 = 1f; + float num21 = num20 - 0.5f; + float num22 = num19 * num21; + if ((double) num22 > 0.0) + num22 *= 2f; + num2 *= 1f + num22; + num1 *= 1f - num22; + } + } + float rotation = (float) Math.Atan2((double) num2, (double) num1) - 1.57f; + int stringColor = Main.player[projectile.owner].stringColor; + Microsoft.Xna.Framework.Color color = WorldGen.paintColor(stringColor); + if (color.R < (byte) 75) + color.R = (byte) 75; + if (color.G < (byte) 75) + color.G = (byte) 75; + if (color.B < (byte) 75) + color.B = (byte) 75; + switch (stringColor) + { + case 0: + case 14: + color = new Microsoft.Xna.Framework.Color(200, 200, 200); + break; + case 13: + color = new Microsoft.Xna.Framework.Color(20, 20, 20); + break; + case 27: + color = new Microsoft.Xna.Framework.Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); + break; + case 28: + color = new Microsoft.Xna.Framework.Color(163, 116, 91); + break; + } + color.A = (byte) ((double) color.A * 0.400000005960464); + float num23 = 0.5f; + color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0), color); + color = new Microsoft.Xna.Framework.Color((int) (byte) ((double) color.R * (double) num23), (int) (byte) ((double) color.G * (double) num23), (int) (byte) ((double) color.B * (double) num23), (int) (byte) ((double) color.A * (double) num23)); + Main.spriteBatch.Draw(Main.fishingLineTexture, new Vector2((float) ((double) vector2.X - (double) Main.screenPosition.X + (double) Main.fishingLineTexture.Width * 0.5), (float) ((double) vector2.Y - (double) Main.screenPosition.Y + (double) Main.fishingLineTexture.Height * 0.5)) - new Vector2(6f, 0.0f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.fishingLineTexture.Width, (int) num9)), color, rotation, new Vector2((float) Main.fishingLineTexture.Width * 0.5f, 0.0f), 1f, SpriteEffects.None, 0.0f); + } + } + } + if (projectile.bobber && Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].holdStyle > 0) + { + x1 = mountedCenter.X; + y1 = mountedCenter.Y + Main.player[projectile.owner].gfxOffY; + int type = Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type; + float gravDir = Main.player[projectile.owner].gravDir; + switch (type) + { + case 2289: + x1 += (float) (43 * Main.player[projectile.owner].direction); + if (Main.player[projectile.owner].direction < 0) + x1 -= 13f; + y1 -= 36f * gravDir; + break; + case 2291: + x1 += (float) (43 * Main.player[projectile.owner].direction); + if (Main.player[projectile.owner].direction < 0) + x1 -= 13f; + y1 -= 34f * gravDir; + break; + case 2292: + x1 += (float) (46 * Main.player[projectile.owner].direction); + if (Main.player[projectile.owner].direction < 0) + x1 -= 13f; + y1 -= 34f * gravDir; + break; + case 2293: + x1 += (float) (43 * Main.player[projectile.owner].direction); + if (Main.player[projectile.owner].direction < 0) + x1 -= 13f; + y1 -= 34f * gravDir; + break; + case 2294: + x1 += (float) (43 * Main.player[projectile.owner].direction); + if (Main.player[projectile.owner].direction < 0) + x1 -= 13f; + y1 -= 30f * gravDir; + break; + case 2295: + x1 += (float) (43 * Main.player[projectile.owner].direction); + if (Main.player[projectile.owner].direction < 0) + x1 -= 13f; + y1 -= 30f * gravDir; + break; + case 2296: + x1 += (float) (43 * Main.player[projectile.owner].direction); + if (Main.player[projectile.owner].direction < 0) + x1 -= 13f; + y1 -= 30f * gravDir; + break; + case 2421: + x1 += (float) (47 * Main.player[projectile.owner].direction); + if (Main.player[projectile.owner].direction < 0) + x1 -= 13f; + y1 -= 36f * gravDir; + break; + case 2422: + x1 += (float) (47 * Main.player[projectile.owner].direction); + if (Main.player[projectile.owner].direction < 0) + x1 -= 13f; + y1 -= 32f * gravDir; + break; + } + if ((double) gravDir == -1.0) + y1 -= 12f; + Vector2 vector2_1 = new Vector2(x1, y1); + Vector2 vector2_2 = Main.player[projectile.owner].RotatedRelativePoint(vector2_1 + new Vector2(8f)) - new Vector2(8f); + float num24 = projectile.position.X + (float) projectile.width * 0.5f - vector2_2.X; + float num25 = projectile.position.Y + (float) projectile.height * 0.5f - vector2_2.Y; + Math.Sqrt((double) num24 * (double) num24 + (double) num25 * (double) num25); + float num26 = (float) Math.Atan2((double) num25, (double) num24) - 1.57f; + bool flag = true; + if ((double) num24 == 0.0 && (double) num25 == 0.0) + { + flag = false; + } + else + { + float num27 = 12f / (float) Math.Sqrt((double) num24 * (double) num24 + (double) num25 * (double) num25); + float num28 = num24 * num27; + float num29 = num25 * num27; + vector2_2.X -= num28; + vector2_2.Y -= num29; + num24 = projectile.position.X + (float) projectile.width * 0.5f - vector2_2.X; + num25 = projectile.position.Y + (float) projectile.height * 0.5f - vector2_2.Y; + } + while (flag) + { + float num30 = 12f; + float f3 = (float) Math.Sqrt((double) num24 * (double) num24 + (double) num25 * (double) num25); + float f4 = f3; + if (float.IsNaN(f3) || float.IsNaN(f4)) + { + flag = false; + } + else + { + if ((double) f3 < 20.0) + { + num30 = f3 - 8f; + flag = false; + } + float num31 = 12f / f3; + float num32 = num24 * num31; + float num33 = num25 * num31; + vector2_2.X += num32; + vector2_2.Y += num33; + num24 = projectile.position.X + (float) projectile.width * 0.5f - vector2_2.X; + num25 = projectile.position.Y + (float) projectile.height * 0.1f - vector2_2.Y; + if ((double) f4 > 12.0) + { + float num34 = 0.3f; + float num35 = Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y); + if ((double) num35 > 16.0) + num35 = 16f; + float num36 = (float) (1.0 - (double) num35 / 16.0); + float num37 = num34 * num36; + float num38 = f4 / 80f; + if ((double) num38 > 1.0) + num38 = 1f; + float num39 = num37 * num38; + if ((double) num39 < 0.0) + num39 = 0.0f; + float num40 = (float) (1.0 - (double) projectile.localAI[0] / 100.0); + float num41 = num39 * num40; + if ((double) num25 > 0.0) + { + num25 *= 1f + num41; + num24 *= 1f - num41; + } + else + { + float num42 = Math.Abs(projectile.velocity.X) / 3f; + if ((double) num42 > 1.0) + num42 = 1f; + float num43 = num42 - 0.5f; + float num44 = num41 * num43; + if ((double) num44 > 0.0) + num44 *= 2f; + num25 *= 1f + num44; + num24 *= 1f - num44; + } + } + float rotation = (float) Math.Atan2((double) num25, (double) num24) - 1.57f; + Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2_2.X / 16, (int) ((double) vector2_2.Y / 16.0), new Microsoft.Xna.Framework.Color(200, 200, 200, 100)); + if (type == 2294) + color = Lighting.GetColor((int) vector2_2.X / 16, (int) ((double) vector2_2.Y / 16.0), new Microsoft.Xna.Framework.Color(100, 180, 230, 100)); + if (type == 2295) + color = Lighting.GetColor((int) vector2_2.X / 16, (int) ((double) vector2_2.Y / 16.0), new Microsoft.Xna.Framework.Color(250, 90, 70, 100)); + if (type == 2293) + color = Lighting.GetColor((int) vector2_2.X / 16, (int) ((double) vector2_2.Y / 16.0), new Microsoft.Xna.Framework.Color(203, 190, 210, 100)); + if (type == 2421) + color = Lighting.GetColor((int) vector2_2.X / 16, (int) ((double) vector2_2.Y / 16.0), new Microsoft.Xna.Framework.Color(183, 77, 112, 100)); + if (type == 2422) + color = Lighting.GetColor((int) vector2_2.X / 16, (int) ((double) vector2_2.Y / 16.0), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, 226, 116, 100)); + Main.spriteBatch.Draw(Main.fishingLineTexture, new Vector2((float) ((double) vector2_2.X - (double) Main.screenPosition.X + (double) Main.fishingLineTexture.Width * 0.5), (float) ((double) vector2_2.Y - (double) Main.screenPosition.Y + (double) Main.fishingLineTexture.Height * 0.5)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.fishingLineTexture.Width, (int) num30)), color, rotation, new Vector2((float) Main.fishingLineTexture.Width * 0.5f, 0.0f), 1f, SpriteEffects.None, 0.0f); + } + } + } + else if (projectile.type == 32) + { + Vector2 vector2 = new Vector2(projectile.position.X + (float) projectile.width * 0.5f, projectile.position.Y + (float) projectile.height * 0.5f); + float num45 = mountedCenter.X - vector2.X; + float num46 = mountedCenter.Y - vector2.Y; + float rotation = (float) Math.Atan2((double) num46, (double) num45) - 1.57f; + bool flag = true; + if ((double) num45 == 0.0 && (double) num46 == 0.0) + { + flag = false; + } + else + { + float num47 = 8f / (float) Math.Sqrt((double) num45 * (double) num45 + (double) num46 * (double) num46); + float num48 = num45 * num47; + float num49 = num46 * num47; + vector2.X -= num48; + vector2.Y -= num49; + num45 = mountedCenter.X - vector2.X; + num46 = mountedCenter.Y - vector2.Y; + } + while (flag) + { + float f = (float) Math.Sqrt((double) num45 * (double) num45 + (double) num46 * (double) num46); + if ((double) f < 28.0) + flag = false; + else if (float.IsNaN(f)) + { + flag = false; + } + else + { + float num50 = 28f / f; + float num51 = num45 * num50; + float num52 = num46 * num50; + vector2.X += num51; + vector2.Y += num52; + num45 = mountedCenter.X - vector2.X; + num46 = mountedCenter.Y - vector2.Y; + Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); + Main.spriteBatch.Draw(Main.chain5Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain5Texture.Width, Main.chain5Texture.Height)), color, rotation, new Vector2((float) Main.chain5Texture.Width * 0.5f, (float) Main.chain5Texture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); + } + } + } + else if (projectile.type == 73) + { + Vector2 vector2 = new Vector2(projectile.position.X + (float) projectile.width * 0.5f, projectile.position.Y + (float) projectile.height * 0.5f); + float num53 = mountedCenter.X - vector2.X; + float num54 = mountedCenter.Y - vector2.Y; + float rotation = (float) Math.Atan2((double) num54, (double) num53) - 1.57f; + bool flag = true; + while (flag) + { + float f = (float) Math.Sqrt((double) num53 * (double) num53 + (double) num54 * (double) num54); + if ((double) f < 25.0) + flag = false; + else if (float.IsNaN(f)) + { + flag = false; + } + else + { + float num55 = 12f / f; + float num56 = num53 * num55; + float num57 = num54 * num55; + vector2.X += num56; + vector2.Y += num57; + num53 = mountedCenter.X - vector2.X; + num54 = mountedCenter.Y - vector2.Y; + Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); + Main.spriteBatch.Draw(Main.chain8Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain8Texture.Width, Main.chain8Texture.Height)), color, rotation, new Vector2((float) Main.chain8Texture.Width * 0.5f, (float) Main.chain8Texture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); + } + } + } + else if (projectile.type == 186) + { + Vector2 vector2 = new Vector2(projectile.localAI[0], projectile.localAI[1]); + float num58 = Vector2.Distance(projectile.Center, vector2) - projectile.velocity.Length(); + float num59 = (float) Main.chain17Texture.Height - num58; + if ((double) num58 > 0.0 && (double) projectile.ai[1] > 0.0) + { + Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) projectile.position.X / 16, (int) projectile.position.Y / 16); + Main.spriteBatch.Draw(Main.chain17Texture, vector2 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, (int) num59, Main.chain17Texture.Width, (int) num58)), color, projectile.rotation, new Vector2((float) (Main.chain17Texture.Width / 2), 0.0f), 1f, SpriteEffects.None, 0.0f); + } + } + else if (projectile.type == 74) + { + Vector2 vector2 = new Vector2(projectile.position.X + (float) projectile.width * 0.5f, projectile.position.Y + (float) projectile.height * 0.5f); + float num60 = mountedCenter.X - vector2.X; + float num61 = mountedCenter.Y - vector2.Y; + float rotation = (float) Math.Atan2((double) num61, (double) num60) - 1.57f; + bool flag = true; + while (flag) + { + float f = (float) Math.Sqrt((double) num60 * (double) num60 + (double) num61 * (double) num61); + if ((double) f < 25.0) + flag = false; + else if (float.IsNaN(f)) + { + flag = false; + } + else + { + float num62 = 12f / f; + float num63 = num60 * num62; + float num64 = num61 * num62; + vector2.X += num63; + vector2.Y += num64; + num60 = mountedCenter.X - vector2.X; + num61 = mountedCenter.Y - vector2.Y; + Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); + Main.spriteBatch.Draw(Main.chain9Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain8Texture.Width, Main.chain8Texture.Height)), color, rotation, new Vector2((float) Main.chain8Texture.Width * 0.5f, (float) Main.chain8Texture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); + } + } + } + else if (projectile.type == 171) + { + Vector2 vector2 = new Vector2(projectile.position.X + (float) projectile.width * 0.5f, projectile.position.Y + (float) projectile.height * 0.5f); + float num65 = -projectile.velocity.X; + float num66 = -projectile.velocity.Y; + float num67 = 1f; + if ((double) projectile.ai[0] <= 17.0) + num67 = projectile.ai[0] / 17f; + int length = (int) (30.0 * (double) num67); + float num68 = 1f; + if ((double) projectile.ai[0] <= 30.0) + num68 = projectile.ai[0] / 30f; + float num69 = 0.4f * num68; + float num70 = num69; + float num71 = num66 + num70; + Vector2[] vector2Array = new Vector2[length]; + float[] numArray = new float[length]; + for (int index = 0; index < length; ++index) + { + float num72 = (float) Math.Sqrt((double) num65 * (double) num65 + (double) num71 * (double) num71); + float num73 = 5.6f; + if ((double) Math.Abs(num65) + (double) Math.Abs(num71) < 1.0) + num73 *= Math.Abs(num65) + Math.Abs(num71) / 1f; + float num74 = num73 / num72; + float num75 = num65 * num74; + float num76 = num71 * num74; + float num77 = (float) Math.Atan2((double) num76, (double) num75) - 1.57f; + vector2Array[index].X = vector2.X; + vector2Array[index].Y = vector2.Y; + numArray[index] = num77; + vector2.X += num75; + vector2.Y += num76; + num65 = -projectile.velocity.X; + float num78 = -projectile.velocity.Y; + num70 += num69; + num71 = num78 + num70; + } + int num79; + for (int index = num79 = length - 1; index >= 0; --index) + { + vector2.X = vector2Array[index].X; + vector2.Y = vector2Array[index].Y; + float rotation = numArray[index]; Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - if (proj.type == 25) - Main.EntitySpriteDraw(TextureAssets.Chain2.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain2.Width(), TextureAssets.Chain2.Height())), color, rotation, new Vector2((float) TextureAssets.Chain2.Width() * 0.5f, (float) TextureAssets.Chain2.Height() * 0.5f), 1f, SpriteEffects.None, 0); - else if (proj.type == 35) - Main.EntitySpriteDraw(TextureAssets.Chain6.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain6.Width(), TextureAssets.Chain6.Height())), color, rotation, new Vector2((float) TextureAssets.Chain6.Width() * 0.5f, (float) TextureAssets.Chain6.Height() * 0.5f), 1f, SpriteEffects.None, 0); - else if (proj.type == 757) - { - Texture2D texture2D = TextureAssets.Extra[99].Value; - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: 6, frameY: (num4 % 6)); - Main.EntitySpriteDraw(texture2D, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(texture2D.Frame(verticalFrames: 6, frameY: (num4 % 6))), color, rotation, r.Size() / 2f, 1f, SpriteEffects.None, 0); - } - else if (proj.type == 247) - Main.EntitySpriteDraw(TextureAssets.Chain19.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain19.Width(), TextureAssets.Chain19.Height())), color, rotation, new Vector2((float) TextureAssets.Chain19.Width() * 0.5f, (float) TextureAssets.Chain19.Height() * 0.5f), 1f, SpriteEffects.None, 0); - else if (proj.type == 63) - Main.EntitySpriteDraw(TextureAssets.Chain7.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain7.Width(), TextureAssets.Chain7.Height())), color, rotation, new Vector2((float) TextureAssets.Chain7.Width() * 0.5f, (float) TextureAssets.Chain7.Height() * 0.5f), 1f, SpriteEffects.None, 0); - else if (proj.type == 154) - Main.EntitySpriteDraw(TextureAssets.Chain13.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain13.Width(), TextureAssets.Chain13.Height())), color, rotation, new Vector2((float) TextureAssets.Chain13.Width() * 0.5f, (float) TextureAssets.Chain13.Height() * 0.5f), 1f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(Main.chain16Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain16Texture.Width, Main.chain16Texture.Height)), color, rotation, new Vector2((float) Main.chain16Texture.Width * 0.5f, (float) Main.chain16Texture.Height * 0.5f), 0.8f, SpriteEffects.None, 0.0f); + } + } + else if (projectile.type == 475) + { + Vector2 vector2 = new Vector2(projectile.position.X + (float) projectile.width * 0.5f, projectile.position.Y + (float) projectile.height * 0.5f); + float num80 = -projectile.velocity.X; + float num81 = -projectile.velocity.Y; + float num82 = 1f; + if ((double) projectile.ai[0] <= 17.0) + num82 = projectile.ai[0] / 17f; + int length = (int) (30.0 * (double) num82); + float num83 = 1f; + if ((double) projectile.ai[0] <= 30.0) + num83 = projectile.ai[0] / 30f; + float num84 = 0.4f * num83; + float num85 = num84; + float num86 = num81 + num85; + Vector2[] vector2Array = new Vector2[length]; + float[] numArray = new float[length]; + for (int index = 0; index < length; ++index) + { + float num87 = (float) Math.Sqrt((double) num80 * (double) num80 + (double) num86 * (double) num86); + float num88 = 5.6f; + if ((double) Math.Abs(num80) + (double) Math.Abs(num86) < 1.0) + num88 *= Math.Abs(num80) + Math.Abs(num86) / 1f; + float num89 = num88 / num87; + float num90 = num80 * num89; + float num91 = num86 * num89; + float num92 = (float) Math.Atan2((double) num91, (double) num90) - 1.57f; + vector2Array[index].X = vector2.X; + vector2Array[index].Y = vector2.Y; + numArray[index] = num92; + vector2.X += num90; + vector2.Y += num91; + num80 = -projectile.velocity.X; + float num93 = -projectile.velocity.Y; + num85 += num84; + num86 = num93 + num85; + } + int num94 = 0; + int num95; + for (int index = num95 = length - 1; index >= 0; --index) + { + vector2.X = vector2Array[index].X; + vector2.Y = vector2Array[index].Y; + float rotation = numArray[index]; + Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); + if (num94 % 2 == 0) + Main.spriteBatch.Draw(Main.chain38Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain38Texture.Width, Main.chain38Texture.Height)), color, rotation, new Vector2((float) Main.chain38Texture.Width * 0.5f, (float) Main.chain38Texture.Height * 0.5f), 0.8f, SpriteEffects.None, 0.0f); else - Main.EntitySpriteDraw(TextureAssets.Chain3.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain3.Width(), TextureAssets.Chain3.Height())), color, rotation, new Vector2((float) TextureAssets.Chain3.Width() * 0.5f, (float) TextureAssets.Chain3.Height() * 0.5f), 1f, SpriteEffects.None, 0); + Main.spriteBatch.Draw(Main.chain39Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain39Texture.Width, Main.chain39Texture.Height)), color, rotation, new Vector2((float) Main.chain39Texture.Width * 0.5f, (float) Main.chain39Texture.Height * 0.5f), 0.8f, SpriteEffects.None, 0.0f); + ++num94; } - ++num4; } - } - - private static Microsoft.Xna.Framework.Color TryApplyingPlayerStringColor( - int playerStringColor, - Microsoft.Xna.Framework.Color stringColor) - { - if (playerStringColor > 0) + else if (projectile.type == 505 || projectile.type == 506) { - stringColor = WorldGen.paintColor(playerStringColor); - if (stringColor.R < (byte) 75) - stringColor.R = (byte) 75; - if (stringColor.G < (byte) 75) - stringColor.G = (byte) 75; - if (stringColor.B < (byte) 75) - stringColor.B = (byte) 75; - switch (playerStringColor) + Vector2 vector2 = new Vector2(projectile.position.X + (float) projectile.width * 0.5f, projectile.position.Y + (float) projectile.height * 0.5f); + float num96 = -projectile.velocity.X; + float num97 = -projectile.velocity.Y; + float num98 = 1f; + if ((double) projectile.ai[0] <= 17.0) + num98 = projectile.ai[0] / 17f; + int length = (int) (30.0 * (double) num98); + float num99 = 1f; + if ((double) projectile.ai[0] <= 30.0) + num99 = projectile.ai[0] / 30f; + float num100 = 0.4f * num99; + float num101 = num100; + float num102 = num97 + num101; + Vector2[] vector2Array = new Vector2[length]; + float[] numArray = new float[length]; + for (int index = 0; index < length; ++index) { - case 0: - case 14: - stringColor = new Microsoft.Xna.Framework.Color(200, 200, 200); - break; - case 13: - stringColor = new Microsoft.Xna.Framework.Color(20, 20, 20); - break; - case 27: - stringColor = new Microsoft.Xna.Framework.Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); - break; - case 28: - stringColor = new Microsoft.Xna.Framework.Color(163, 116, 91); - break; + float num103 = (float) Math.Sqrt((double) num96 * (double) num96 + (double) num102 * (double) num102); + float num104 = 5.6f; + if ((double) Math.Abs(num96) + (double) Math.Abs(num102) < 1.0) + num104 *= Math.Abs(num96) + Math.Abs(num102) / 1f; + float num105 = num104 / num103; + float num106 = num96 * num105; + float num107 = num102 * num105; + float num108 = (float) Math.Atan2((double) num107, (double) num106) - 1.57f; + vector2Array[index].X = vector2.X; + vector2Array[index].Y = vector2.Y; + numArray[index] = num108; + vector2.X += num106; + vector2.Y += num107; + num96 = -projectile.velocity.X; + float num109 = -projectile.velocity.Y; + num101 += num100; + num102 = num109 + num101; } - stringColor.A = (byte) ((double) stringColor.A * 0.400000005960464); - } - return stringColor; - } - - private static void DrawProj_FishingLine( - Projectile proj, - ref float polePosX, - ref float polePosY, - Vector2 mountedCenter) - { - polePosX = mountedCenter.X; - polePosY = mountedCenter.Y; - polePosY += Main.player[proj.owner].gfxOffY; - int type = Main.player[proj.owner].inventory[Main.player[proj.owner].selectedItem].type; - Microsoft.Xna.Framework.Color stringColor = new Microsoft.Xna.Framework.Color(200, 200, 200, 100); - if (type == 2294) - stringColor = new Microsoft.Xna.Framework.Color(100, 180, 230, 100); - if (type == 2295) - stringColor = new Microsoft.Xna.Framework.Color(250, 90, 70, 100); - if (type == 2293) - stringColor = new Microsoft.Xna.Framework.Color(203, 190, 210, 100); - if (type == 2421) - stringColor = new Microsoft.Xna.Framework.Color(183, 77, 112, 100); - if (type == 2422) - stringColor = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, 226, 116, 100); - if (type == 4325) - stringColor = new Microsoft.Xna.Framework.Color(200, 100, 100, 100); - if (type == 4442) - stringColor = new Microsoft.Xna.Framework.Color(100, 100, 200, 100); - Microsoft.Xna.Framework.Color oldColor = Main.TryApplyingPlayerStringColor(Main.player[proj.owner].stringColor, stringColor); - float gravDir = Main.player[proj.owner].gravDir; - if (type == 2289) - { - polePosX += (float) (43 * Main.player[proj.owner].direction); - if (Main.player[proj.owner].direction < 0) - polePosX -= 13f; - polePosY -= 36f * gravDir; - } - else if (type == 2291) - { - polePosX += (float) (43 * Main.player[proj.owner].direction); - if (Main.player[proj.owner].direction < 0) - polePosX -= 13f; - polePosY -= 34f * gravDir; - } - else if (type == 2292) - { - polePosX += (float) (46 * Main.player[proj.owner].direction); - if (Main.player[proj.owner].direction < 0) - polePosX -= 13f; - polePosY -= 34f * gravDir; - } - else if (type == 2293) - { - polePosX += (float) (43 * Main.player[proj.owner].direction); - if (Main.player[proj.owner].direction < 0) - polePosX -= 13f; - polePosY -= 34f * gravDir; - } - else if (type == 2294) - { - polePosX += (float) (43 * Main.player[proj.owner].direction); - if (Main.player[proj.owner].direction < 0) - polePosX -= 13f; - polePosY -= 30f * gravDir; - } - else if (type == 2295) - { - polePosX += (float) (43 * Main.player[proj.owner].direction); - if (Main.player[proj.owner].direction < 0) - polePosX -= 13f; - polePosY -= 30f * gravDir; - } - else if (type == 2296) - { - polePosX += (float) (43 * Main.player[proj.owner].direction); - if (Main.player[proj.owner].direction < 0) - polePosX -= 13f; - polePosY -= 30f * gravDir; - } - else if (type == 2421) - { - polePosX += (float) (47 * Main.player[proj.owner].direction); - if (Main.player[proj.owner].direction < 0) - polePosX -= 13f; - polePosY -= 36f * gravDir; - } - else if (type == 2422) - { - polePosX += (float) (47 * Main.player[proj.owner].direction); - if (Main.player[proj.owner].direction < 0) - polePosX -= 13f; - polePosY -= 32f * gravDir; - } - else if (type == 4325) - { - polePosX += (float) (44 * Main.player[proj.owner].direction); - if (Main.player[proj.owner].direction < 0) - polePosX -= 13f; - polePosY -= 32f * gravDir; - } - else if (type == 4442) - { - polePosX += (float) (44 * Main.player[proj.owner].direction); - if (Main.player[proj.owner].direction < 0) - polePosX -= 13f; - polePosY -= 32f * gravDir; - } - if ((double) gravDir == -1.0) - polePosY -= 12f; - Vector2 vector2_1 = new Vector2(polePosX, polePosY); - Vector2 vector2_2 = Main.player[proj.owner].RotatedRelativePoint(vector2_1 + new Vector2(8f)) - new Vector2(8f); - float num1 = proj.position.X + (float) proj.width * 0.5f - vector2_2.X; - float num2 = proj.position.Y + (float) proj.height * 0.5f - vector2_2.Y; - Math.Sqrt((double) num1 * (double) num1 + (double) num2 * (double) num2); - float num3 = (float) Math.Atan2((double) num2, (double) num1) - 1.57f; - bool flag = true; - if ((double) num1 == 0.0 && (double) num2 == 0.0) - { - flag = false; - } - else - { - float num4 = 12f / (float) Math.Sqrt((double) num1 * (double) num1 + (double) num2 * (double) num2); - float num5 = num1 * num4; - float num6 = num2 * num4; - vector2_2.X -= num5; - vector2_2.Y -= num6; - num1 = proj.position.X + (float) proj.width * 0.5f - vector2_2.X; - num2 = proj.position.Y + (float) proj.height * 0.5f - vector2_2.Y; - } - while (flag) - { - float num7 = 12f; - float f1 = (float) Math.Sqrt((double) num1 * (double) num1 + (double) num2 * (double) num2); - float f2 = f1; - if (float.IsNaN(f1) || float.IsNaN(f2)) + int num110 = 0; + int num111; + for (int index1 = num111 = length - 1; index1 >= 0; --index1) { - flag = false; + vector2.X = vector2Array[index1].X; + vector2.Y = vector2Array[index1].Y; + float rotation = numArray[index1]; + Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); + int num112 = 4; + if (projectile.type == 506) + num112 = 6; + int index2 = num112 + num110 % 2; + Main.spriteBatch.Draw(Main.chainsTexture[index2], new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chainsTexture[index2].Width, Main.chainsTexture[index2].Height)), color, rotation, new Vector2((float) Main.chainsTexture[index2].Width * 0.5f, (float) Main.chainsTexture[index2].Height * 0.5f), 0.8f, SpriteEffects.None, 0.0f); + ++num110; } - else + } + else if (projectile.type == 165) + { + Vector2 vector2 = new Vector2(projectile.position.X + (float) projectile.width * 0.5f, projectile.position.Y + (float) projectile.height * 0.5f); + float num113 = mountedCenter.X - vector2.X; + float num114 = mountedCenter.Y - vector2.Y; + float rotation = (float) Math.Atan2((double) num114, (double) num113) - 1.57f; + bool flag = true; + while (flag) { - if ((double) f1 < 20.0) - { - num7 = f1 - 8f; + float f = (float) Math.Sqrt((double) num113 * (double) num113 + (double) num114 * (double) num114); + if ((double) f < 25.0) flag = false; - } - float num8 = 12f / f1; - float num9 = num1 * num8; - float num10 = num2 * num8; - vector2_2.X += num9; - vector2_2.Y += num10; - num1 = proj.position.X + (float) proj.width * 0.5f - vector2_2.X; - num2 = proj.position.Y + (float) proj.height * 0.1f - vector2_2.Y; - if ((double) f2 > 12.0) + else if (float.IsNaN(f)) { - float num11 = 0.3f; - float num12 = Math.Abs(proj.velocity.X) + Math.Abs(proj.velocity.Y); - if ((double) num12 > 16.0) - num12 = 16f; - float num13 = (float) (1.0 - (double) num12 / 16.0); - float num14 = num11 * num13; - float num15 = f2 / 80f; - if ((double) num15 > 1.0) - num15 = 1f; - float num16 = num14 * num15; - if ((double) num16 < 0.0) - num16 = 0.0f; - float num17 = (float) (1.0 - (double) proj.localAI[0] / 100.0); - float num18 = num16 * num17; - if ((double) num2 > 0.0) - { - num2 *= 1f + num18; - num1 *= 1f - num18; - } - else - { - float num19 = Math.Abs(proj.velocity.X) / 3f; - if ((double) num19 > 1.0) - num19 = 1f; - float num20 = num19 - 0.5f; - float num21 = num18 * num20; - if ((double) num21 > 0.0) - num21 *= 2f; - num2 *= 1f + num21; - num1 *= 1f - num21; - } - } - float rotation = (float) Math.Atan2((double) num2, (double) num1) - 1.57f; - Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2_2.X / 16, (int) ((double) vector2_2.Y / 16.0), oldColor); - Main.EntitySpriteDraw(TextureAssets.FishingLine.Value, new Vector2((float) ((double) vector2_2.X - (double) Main.screenPosition.X + (double) TextureAssets.FishingLine.Width() * 0.5), (float) ((double) vector2_2.Y - (double) Main.screenPosition.Y + (double) TextureAssets.FishingLine.Height() * 0.5)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.FishingLine.Width(), (int) num7)), color, rotation, new Vector2((float) TextureAssets.FishingLine.Width() * 0.5f, 0.0f), 1f, SpriteEffects.None, 0); - } - } - } - - private void DrawProj_StardustGuardianPunching(Projectile proj) - { - int num1 = 6; - Texture2D texture2D = TextureAssets.Extra[46].Value; - int num2 = 20; - Vector2 vector2 = proj.Center - proj.rotation.ToRotationVector2() * (float) num2 * (float) proj.spriteDirection; - for (int index = 0; index < num1; ++index) - { - float num3 = Main.rand.NextFloat(); - float num4 = Utils.GetLerpValue(0.0f, 0.3f, num3, true) * Utils.GetLerpValue(1f, 0.5f, num3, true); - float num5 = MathHelper.Lerp(0.6f, 1f, Utils.GetLerpValue(0.0f, 0.3f, num3, true) * Utils.GetLerpValue(1f, 0.5f, num3, true)); - Microsoft.Xna.Framework.Color color1 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue) * (num4 * 0.5f); - Vector2 origin = texture2D.Size() / 2f; - Microsoft.Xna.Framework.Color color2 = Microsoft.Xna.Framework.Color.White * num4; - color2.A /= (byte) 2; - Microsoft.Xna.Framework.Color color3 = color2 * 0.5f; - float num6 = 1f; - float num7 = (float) (1.0 + (double) Main.rand.NextFloat() * 0.5); - float num8 = Main.rand.NextFloatDirection(); - Vector2 scale = new Vector2(0.8f) * num7 * num6 * num5; - float num9 = (float) (20.0 + (double) MathHelper.Lerp(0.0f, 20f, num3) + (double) num7 * 16.0); - float f = (float) ((double) proj.rotation + (proj.direction == 1 ? 0.0 : 3.14159274101257) + (double) num8 * 6.28318548202515 * 0.0399999991059303); - float rotation = f + 1.570796f; - Vector2 position = vector2 + f.ToRotationVector2() * num9 + Main.rand.NextVector2Circular(20f, 20f) - Main.screenPosition; - Microsoft.Xna.Framework.Color color4 = color1 * num6; - Microsoft.Xna.Framework.Color color5 = color3 * num6; - SpriteEffects effects = SpriteEffects.None; - Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(), color4, rotation, origin, scale, effects, 0.0f); - Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(), color5, rotation, origin, scale * 0.8f, effects, 0.0f); - } - } - - private void DrawProj_PiercingStarlight(Projectile proj) - { - int num1 = 3; - this.LoadProjectile(proj.type); - this.LoadItem(4923); - int num2 = 2; - Vector2 vector2_1 = proj.Center - proj.rotation.ToRotationVector2() * (float) num2; - for (int index = 0; index < 1; ++index) - { - float num3 = Main.rand.NextFloat(); - float num4 = Utils.GetLerpValue(0.0f, 0.3f, num3, true) * Utils.GetLerpValue(1f, 0.5f, num3, true); - Microsoft.Xna.Framework.Color color = proj.GetAlpha(Lighting.GetColor(proj.Center.ToTileCoordinates())) * num4; - Texture2D texture2D = TextureAssets.Item[4923].Value; - Vector2 origin = texture2D.Size() / 2f; - float num5 = Main.rand.NextFloatDirection(); - float num6 = (float) (8.0 + (double) MathHelper.Lerp(0.0f, 20f, num3) + (double) Main.rand.NextFloat() * 6.0); - float f = proj.rotation + (float) ((double) num5 * 6.28318548202515 * 0.0399999991059303); - float rotation = f + 0.7853982f; - Vector2 position = vector2_1 + f.ToRotationVector2() * num6 + Main.rand.NextVector2Circular(8f, 8f) - Main.screenPosition; - SpriteEffects effects = SpriteEffects.None; - if ((double) proj.rotation < -1.57079637050629 || (double) proj.rotation > 1.57079637050629) - { - rotation += 1.570796f; - effects |= SpriteEffects.FlipHorizontally; - } - Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(), color, rotation, origin, 1f, effects, 0.0f); - } - for (int index = 0; index < num1; ++index) - { - float num7 = Main.rand.NextFloat(); - float num8 = Utils.GetLerpValue(0.0f, 0.3f, num7, true) * Utils.GetLerpValue(1f, 0.5f, num7, true); - float num9 = MathHelper.Lerp(0.6f, 1f, Utils.GetLerpValue(0.0f, 0.3f, num7, true) * Utils.GetLerpValue(1f, 0.5f, num7, true)); - Microsoft.Xna.Framework.Color queenWeaponsColor = proj.GetFairyQueenWeaponsColor(0.25f, rawHueOverride: new float?((float) (((double) Main.rand.NextFloat() * 0.330000013113022 + (double) Main.GlobalTimeWrappedHourly) % 1.0))); - Texture2D texture2D = TextureAssets.Projectile[proj.type].Value; - Microsoft.Xna.Framework.Color color1 = queenWeaponsColor * (num8 * 0.5f); - Vector2 origin = texture2D.Size() / 2f; - Microsoft.Xna.Framework.Color color2 = Microsoft.Xna.Framework.Color.White * num8; - color2.A /= (byte) 2; - Microsoft.Xna.Framework.Color color3 = color2 * 0.5f; - float num10 = 1f; - float num11 = Main.rand.NextFloat() * 2f; - float num12 = Main.rand.NextFloatDirection(); - Vector2 scale = new Vector2(2.8f + num11, 1f) * num10 * num9; - Vector2 vector2_2 = new Vector2((float) (1.5 + (double) num11 * 0.5), 1f) * num10 * num9; - int num13 = 50; - Vector2 vector2_3 = proj.rotation.ToRotationVector2() * (index >= 1 ? 56f : 0.0f); - float num14 = (float) (0.0299999993294477 - (double) index * 0.0120000001043081); - float num15 = (float) (30.0 + (double) MathHelper.Lerp(0.0f, (float) num13, num7) + (double) num11 * 16.0); - float f = proj.rotation + num12 * 6.283185f * num14; - float rotation = f; - Vector2 position = vector2_1 + f.ToRotationVector2() * num15 + Main.rand.NextVector2Circular(20f, 20f) + vector2_3 - Main.screenPosition; - Microsoft.Xna.Framework.Color color4 = color1 * num10; - Microsoft.Xna.Framework.Color color5 = color3 * num10; - SpriteEffects effects = SpriteEffects.None; - Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(), color4, rotation, origin, scale, effects, 0.0f); - Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(), color5, rotation, origin, scale * 0.6f, effects, 0.0f); - } - } - - private void DrawProj_FairyQueenLance(Projectile proj) - { - Vector2 position = proj.Center - Main.screenPosition; - int num1 = 180 * 40 / 2; - Microsoft.Xna.Framework.Color color1 = proj.AI_171_GetColor(); - Microsoft.Xna.Framework.Color color2 = color1; - color1.A = (byte) 0; - color2.A /= (byte) 2; - Texture2D texture2D1 = TextureAssets.Extra[178].Value; - Vector2 origin1 = texture2D1.Frame().Size() * new Vector2(0.0f, 0.5f); - Vector2 scale1 = new Vector2((float) (num1 / texture2D1.Width), 2f); - Vector2 scale2 = new Vector2((float) (num1 / texture2D1.Width) * 0.5f, 2f); - Microsoft.Xna.Framework.Color color3 = color1 * Utils.GetLerpValue(60f, 55f, proj.localAI[0], true) * Utils.GetLerpValue(0.0f, 10f, proj.localAI[0], true); - Main.spriteBatch.Draw(texture2D1, position, new Microsoft.Xna.Framework.Rectangle?(), color3, proj.rotation, origin1, scale2, SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(texture2D1, position, new Microsoft.Xna.Framework.Rectangle?(), color3 * 0.3f, proj.rotation, origin1, scale1, SpriteEffects.None, 0.0f); - Texture2D texture2D2 = TextureAssets.Projectile[proj.type].Value; - Vector2 origin2 = texture2D2.Frame().Size() / 2f; - Microsoft.Xna.Framework.Color color4 = Microsoft.Xna.Framework.Color.White * Utils.GetLerpValue(0.0f, 20f, proj.localAI[0], true); - color4.A /= (byte) 2; - float scale3 = MathHelper.Lerp(0.7f, 1f, Utils.GetLerpValue(55f, 60f, proj.localAI[0], true)); - float lerpValue1 = Utils.GetLerpValue(10f, 60f, proj.localAI[0], false); - if ((double) lerpValue1 > 0.0) - { - float lerpValue2 = Utils.GetLerpValue(0.0f, 1f, proj.velocity.Length(), true); - for (float num2 = 1f; (double) num2 > 0.0; num2 -= 0.1666667f) - { - Vector2 vector2 = proj.rotation.ToRotationVector2() * -120f * num2 * lerpValue2; - Main.spriteBatch.Draw(texture2D2, position + vector2, new Microsoft.Xna.Framework.Rectangle?(), color1 * lerpValue1 * (1f - num2), proj.rotation, origin2, scale3, SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(texture2D2, position + vector2, new Microsoft.Xna.Framework.Rectangle?(), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * 0.15f * lerpValue1 * (1f - num2), proj.rotation, origin2, scale3 * 0.85f, SpriteEffects.None, 0.0f); - } - for (float num3 = 0.0f; (double) num3 < 1.0; num3 += 0.25f) - { - Vector2 vector2 = (num3 * 6.283185f + proj.rotation).ToRotationVector2() * 2f * scale3; - Main.spriteBatch.Draw(texture2D2, position + vector2, new Microsoft.Xna.Framework.Rectangle?(), color2 * lerpValue1, proj.rotation, origin2, scale3, SpriteEffects.None, 0.0f); - } - Main.spriteBatch.Draw(texture2D2, position, new Microsoft.Xna.Framework.Rectangle?(), color2 * lerpValue1, proj.rotation, origin2, scale3 * 1.1f, SpriteEffects.None, 0.0f); - } - Main.spriteBatch.Draw(texture2D2, position, new Microsoft.Xna.Framework.Rectangle?(), color4, proj.rotation, origin2, scale3, SpriteEffects.None, 0.0f); - } - - private void DrawProj_FairyQueenRangedItemShot(Projectile proj) - { - Vector2 position = proj.Center - Main.screenPosition; - Microsoft.Xna.Framework.Color queenWeaponsColor1 = proj.GetFairyQueenWeaponsColor(0.0f); - Microsoft.Xna.Framework.Color queenWeaponsColor2 = proj.GetFairyQueenWeaponsColor(0.5f); - Texture2D texture2D = TextureAssets.Projectile[proj.type].Value; - Vector2 origin = texture2D.Frame().Size() / 2f; - Microsoft.Xna.Framework.Color color = Microsoft.Xna.Framework.Color.White * proj.Opacity; - color.A /= (byte) 2; - float scale = MathHelper.Lerp(0.7f, 1f, Utils.GetLerpValue(0.0f, 5f, proj.ai[0], true)); - float opacity = proj.Opacity; - if ((double) opacity > 0.0) - { - float lerpValue = Utils.GetLerpValue(0.0f, 1f, proj.velocity.Length(), true); - for (float num = 0.0f; (double) num < 1.0; num += 0.1666667f) - { - Vector2 vector2 = proj.rotation.ToRotationVector2() * -120f * num * lerpValue; - Main.spriteBatch.Draw(texture2D, position + vector2, new Microsoft.Xna.Framework.Rectangle?(), queenWeaponsColor1 * opacity * (1f - num), proj.rotation, origin, scale, SpriteEffects.None, 0.0f); - } - for (float num = 0.0f; (double) num < 1.0; num += 0.25f) - { - Vector2 vector2 = (num * 6.283185f + proj.rotation).ToRotationVector2() * 4f * scale; - Main.spriteBatch.Draw(texture2D, position + vector2, new Microsoft.Xna.Framework.Rectangle?(), queenWeaponsColor2 * opacity, proj.rotation, origin, scale, SpriteEffects.None, 0.0f); - } - } - Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(), color, proj.rotation, origin, scale, SpriteEffects.None, 0.0f); - } - - private void DrawProj_EmpressBlade(Projectile proj, float hueOverride) - { - Main.CurrentDrawnEntityShader = -1; - this.PrepareDrawnEntityDrawing((Entity) proj, Main.GetProjectileDesiredShader(proj.whoAmI)); - Vector2 position = proj.Center - Main.screenPosition; - proj.GetFairyQueenWeaponsColor(0.0f, rawHueOverride: new float?(hueOverride)); - Microsoft.Xna.Framework.Color queenWeaponsColor = proj.GetFairyQueenWeaponsColor(0.5f, rawHueOverride: new float?(hueOverride)); - Texture2D texture2D = TextureAssets.Projectile[proj.type].Value; - Vector2 origin = texture2D.Frame().Size() / 2f; - Microsoft.Xna.Framework.Color color = Microsoft.Xna.Framework.Color.White * proj.Opacity; - color.A = (byte) ((double) color.A * 0.699999988079071); - queenWeaponsColor.A /= (byte) 2; - float scale = proj.scale; - float num1 = proj.rotation - 1.570796f; - float num2 = proj.Opacity * 0.3f; - if ((double) num2 > 0.0) - { - float lerpValue = Utils.GetLerpValue(60f, 50f, proj.ai[0], true); - float num3 = Utils.GetLerpValue(70f, 50f, proj.ai[0], true) * Utils.GetLerpValue(40f, 45f, proj.ai[0], true); - for (float num4 = 0.0f; (double) num4 < 1.0; num4 += 0.1666667f) - { - Vector2 vector2 = num1.ToRotationVector2() * -120f * num4 * lerpValue; - Main.EntitySpriteDraw(texture2D, position + vector2, new Microsoft.Xna.Framework.Rectangle?(), queenWeaponsColor * num2 * (1f - num4) * num3, num1, origin, scale * 1.5f, SpriteEffects.None, 0); - } - for (float num5 = 0.0f; (double) num5 < 1.0; num5 += 0.25f) - { - Vector2 vector2 = (num5 * 6.283185f + num1).ToRotationVector2() * 4f * scale; - Main.EntitySpriteDraw(texture2D, position + vector2, new Microsoft.Xna.Framework.Rectangle?(), queenWeaponsColor * num2, num1, origin, scale, SpriteEffects.None, 0); - } - } - Main.EntitySpriteDraw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(), color, num1, origin, scale, SpriteEffects.None, 0); - Main.EntitySpriteDraw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(), queenWeaponsColor * num2 * 0.5f, num1, origin, scale, SpriteEffects.None, 0); - } - - private void DrawProj_CoolWhipMinion(Projectile proj) - { - Vector2 position = proj.Center - Main.screenPosition; - Microsoft.Xna.Framework.Color color1 = Microsoft.Xna.Framework.Color.White * 0.5f; - color1.A = (byte) 0; - Microsoft.Xna.Framework.Color color2 = color1; - color2.A = (byte) 127; - Texture2D texture2D = TextureAssets.Projectile[proj.type].Value; - Vector2 origin = texture2D.Frame().Size() / 2f; - Microsoft.Xna.Framework.Color color3 = Microsoft.Xna.Framework.Color.White * proj.Opacity; - color3.A /= (byte) 2; - int num1 = 1; - float opacity = proj.Opacity; - if ((double) opacity > 0.0) - { - for (float num2 = 0.0f; (double) num2 < 4.0; ++num2) - { - Vector2 vector2 = proj.velocity * -num2; - Main.spriteBatch.Draw(texture2D, position + vector2, new Microsoft.Xna.Framework.Rectangle?(), color1 * opacity * (float) ((4.0 - (double) num2) / 4.0), proj.rotation, origin, (float) num1, SpriteEffects.None, 0.0f); - } - for (float num3 = 0.0f; (double) num3 < 1.0; num3 += 0.25f) - { - Vector2 vector2 = (num3 * 6.283185f + proj.rotation).ToRotationVector2() * 4f * (float) num1; - Main.spriteBatch.Draw(texture2D, position + vector2, new Microsoft.Xna.Framework.Rectangle?(), color2 * opacity, proj.rotation, origin, (float) num1, SpriteEffects.None, 0.0f); - } - } - Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(), color3, proj.rotation, origin, (float) num1, SpriteEffects.None, 0.0f); - } - - private void DrawMurderAurora(Projectile proj) - { - Texture2D texture2D = TextureAssets.Projectile[proj.type].Value; - Vector2 origin = texture2D.Size() / 2f; - float num1 = (float) ((double) Main.GlobalTimeWrappedHourly % 10.0 / 10.0); - Vector2 vector2_1 = proj.Center - Main.screenPosition; - float[] numArray1 = new float[15]; - float[] numArray2 = new float[15]; - float[] numArray3 = new float[15]; - float[] numArray4 = new float[15]; - float[] numArray5 = new float[15]; - int num2 = 210; - float num3 = Utils.GetLerpValue(0.0f, 60f, (float) proj.timeLeft, true) * Utils.GetLerpValue((float) num2, (float) (num2 - 60), (float) proj.timeLeft, true); - float num4 = MathHelper.Lerp(0.2f, 0.5f, Utils.GetLerpValue(0.0f, 60f, (float) proj.timeLeft, true) * Utils.GetLerpValue((float) num2, 90f, (float) proj.timeLeft, true)); - double num5 = 800.0 / (double) texture2D.Width; - float num6 = (float) (num5 * 0.800000011920929); - float num7 = (float) ((num5 - (double) num6) / 15.0); - float num8 = 30f; - float num9 = 300f; - Vector2 vector2_2 = new Vector2(3f, 6f); - for (int index = 0; index < 15; ++index) - { - double num10 = (double) (index + 1) / 50.0; - float num11 = (float) Math.Sin((double) num1 * 6.28318548202515 + 1.57079637050629 + (double) index / 2.0); - numArray1[index] = num11 * (num9 - (float) index * 3f); - numArray2[index] = (float) Math.Sin((double) num1 * 6.28318548202515 * 2.0 + 1.04719758033752 + (double) index) * num8; - numArray2[index] -= (float) index * 3f; - numArray3[index] = (float) ((double) index / 15.0 * 2.0) + num1; - numArray3[index] = (float) (((double) num11 * 0.5 + 0.5) * 0.600000023841858) + num1; - numArray4[index] = (float) (1.0 - Math.Pow(1.0 * (double) index / 15.0, 2.0)); - numArray5[index] = num6 + (float) (index + 1) * num7; - numArray5[index] *= 0.3f; - Microsoft.Xna.Framework.Color color = Main.hslToRgb(numArray3[index] % 1f, 1f, 0.5f) * num3 * num4; - color.A /= (byte) 4; - float rotation = (float) (1.57079637050629 + (double) num11 * 0.785398185253143 * -0.300000011920929 + 3.14159274101257 * (double) index); - Main.EntitySpriteDraw(texture2D, vector2_1 + new Vector2(numArray1[index], numArray2[index]), new Microsoft.Xna.Framework.Rectangle?(), color, rotation, origin, new Vector2(numArray5[index], numArray5[index]) * vector2_2, SpriteEffects.None, 0); - } - } - - private void DrawWhip(Projectile proj) - { - List controlPoints = new List(); - Projectile.FillWhipControlPoints(proj, controlPoints); - Texture2D texture2D = TextureAssets.FishingLine.Value; - Microsoft.Xna.Framework.Rectangle rectangle = texture2D.Frame(); - Vector2 origin = new Vector2((float) (rectangle.Width / 2), 2f); - Microsoft.Xna.Framework.Color originalColor = Microsoft.Xna.Framework.Color.White; - switch (proj.type) - { - case 847: - originalColor = Microsoft.Xna.Framework.Color.OrangeRed; - break; - case 848: - originalColor = Microsoft.Xna.Framework.Color.DarkBlue; - break; - case 849: - Microsoft.Xna.Framework.Color slateBlue = Microsoft.Xna.Framework.Color.SlateBlue; - originalColor = Microsoft.Xna.Framework.Color.Black; - break; - case 912: - originalColor = Microsoft.Xna.Framework.Color.LightBlue; - break; - case 913: - originalColor = Microsoft.Xna.Framework.Color.Firebrick; - break; - case 914: - originalColor = Microsoft.Xna.Framework.Color.ForestGreen; - break; - case 915: - originalColor = Microsoft.Xna.Framework.Color.White; - break; - } - Vector2 vector2_1 = controlPoints[0]; - for (int index = 0; index < controlPoints.Count - 1; ++index) - { - Vector2 vec = controlPoints[index]; - Vector2 v = controlPoints[index + 1] - vec; - float rotation = v.ToRotation() - 1.570796f; - Microsoft.Xna.Framework.Color color = Lighting.GetColor(vec.ToTileCoordinates(), originalColor); - Vector2 scale = new Vector2(1f, (v.Length() + 2f) / (float) rectangle.Height); - Main.spriteBatch.Draw(texture2D, vector2_1 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(rectangle), color, rotation, origin, scale, SpriteEffects.None, 0.0f); - vector2_1 += v; - } - Vector2 vector2_2; - switch (proj.type) - { - case 841: - vector2_2 = Main.DrawWhip_WhipBland(proj, controlPoints); - break; - case 847: - vector2_2 = Main.DrawWhip_WhipSword(proj, controlPoints); - break; - case 848: - vector2_2 = Main.DrawWhip_WhipMace(proj, controlPoints); - break; - case 849: - vector2_2 = Main.DrawWhip_WhipScythe(proj, controlPoints); - break; - case 912: - vector2_2 = Main.DrawWhip_CoolWhip(proj, controlPoints); - break; - case 913: - vector2_2 = Main.DrawWhip_FireWhip(proj, controlPoints); - break; - case 914: - vector2_2 = Main.DrawWhip_ThornWhip(proj, controlPoints); - break; - case 915: - vector2_2 = Main.DrawWhip_RainbowWhip(proj, controlPoints); - break; - } - } - - private static Vector2 DrawWhip_CoolWhip(Projectile proj, List controlPoints) - { - Texture2D texture2D = TextureAssets.Projectile[proj.type].Value; - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: 5); - int height = r.Height; - r.Height -= 2; - Vector2 vector2 = r.Size() / 2f; - Vector2 controlPoint1 = controlPoints[0]; - for (int index = 0; index < controlPoints.Count - 1; ++index) - { - bool flag = true; - Vector2 origin = vector2; - switch (index) - { - case 0: - origin.Y -= 4f; - break; - case 3: - case 5: - case 7: - r.Y = height; - break; - case 9: - case 11: - case 13: - r.Y = height * 2; - break; - case 15: - case 17: - r.Y = height * 3; - break; - case 19: - r.Y = height * 4; - break; - default: flag = false; - break; - } - Vector2 controlPoint2 = controlPoints[index]; - Vector2 v = controlPoints[index + 1] - controlPoint2; - if (flag) - { - float rotation = v.ToRotation() - 1.570796f; - Microsoft.Xna.Framework.Color alpha = proj.GetAlpha(Lighting.GetColor(controlPoint2.ToTileCoordinates())); - Main.spriteBatch.Draw(texture2D, controlPoint1 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(r), alpha, rotation, origin, 1f, SpriteEffects.None, 0.0f); - } - controlPoint1 += v; - } - return controlPoint1; - } - - private static Vector2 DrawWhip_FireWhip(Projectile proj, List controlPoints) - { - Texture2D texture2D = TextureAssets.Projectile[proj.type].Value; - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: 5); - int height = r.Height; - r.Height -= 2; - Vector2 vector2 = r.Size() / 2f; - Vector2 controlPoint1 = controlPoints[0]; - for (int index = 0; index < controlPoints.Count - 1; ++index) - { - bool flag = true; - Vector2 origin = vector2; - switch (index) - { - case 0: - origin.Y -= 4f; - break; - case 3: - case 5: - case 7: - r.Y = height; - break; - case 9: - case 11: - case 13: - r.Y = height * 2; - break; - case 15: - case 17: - r.Y = height * 3; - break; - case 19: - r.Y = height * 4; - break; - default: - flag = false; - break; - } - Vector2 controlPoint2 = controlPoints[index]; - Vector2 v = controlPoints[index + 1] - controlPoint2; - if (flag) - { - float rotation = v.ToRotation() - 1.570796f; - Microsoft.Xna.Framework.Color alpha = proj.GetAlpha(Lighting.GetColor(controlPoint2.ToTileCoordinates())); - Main.spriteBatch.Draw(texture2D, controlPoint1 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(r), alpha, rotation, origin, 1f, SpriteEffects.None, 0.0f); - } - controlPoint1 += v; - } - return controlPoint1; - } - - private static Vector2 DrawWhip_RainbowWhip(Projectile proj, List controlPoints) - { - Texture2D texture2D = TextureAssets.Projectile[proj.type].Value; - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: 5); - int height = r.Height; - r.Height -= 2; - Vector2 vector2 = r.Size() / 2f; - Vector2 controlPoint1 = controlPoints[0]; - float counterNormalized = Main.player[proj.owner].miscCounterNormalized; - for (int index = 0; index < controlPoints.Count - 1; ++index) - { - bool flag = true; - Vector2 origin = vector2; - switch (index) - { - case 0: - origin.Y -= 4f; - break; - case 39: - r.Y = height * 4; - break; - default: - flag = index % 2 == 0; - r.Y = height * (1 + index % 3); - break; - } - Vector2 controlPoint2 = controlPoints[index]; - Vector2 v = controlPoints[index + 1] - controlPoint2; - if (flag) - { - Microsoft.Xna.Framework.Color rgb = Main.hslToRgb((float) (((double) counterNormalized * 5.0 + (double) index * 0.0500000007450581) % 1.0), 1f, 0.5f); - Microsoft.Xna.Framework.Color color1 = rgb; - float lerpValue = Utils.GetLerpValue((float) (controlPoints.Count - 10), (float) (controlPoints.Count - 2), (float) index, true); - float scale = MathHelper.Lerp(1f, 1f, lerpValue); - color1.A /= (byte) 2; - color1.A = (byte) ((double) color1.A * (double) lerpValue); - float rotation = v.ToRotation() - 1.570796f; - Microsoft.Xna.Framework.Color color2 = Lighting.GetColor(controlPoint2.ToTileCoordinates()); - Main.spriteBatch.Draw(texture2D, controlPoint1 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(r), Microsoft.Xna.Framework.Color.Lerp(color2, color1, 0.5f), rotation, origin, scale, SpriteEffects.None, 0.0f); - color1.A = (byte) 0; - Main.spriteBatch.Draw(texture2D, controlPoint1 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(r), color1 * 0.1f, rotation, origin, scale * 1.2f, SpriteEffects.None, 0.0f); - if (index == 39) - { - color1 = rgb; - color1.A = (byte) 127; - Main.spriteBatch.Draw(texture2D, controlPoint1 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(r), color1 * 0.3f, rotation, origin, scale * 1.4f, SpriteEffects.None, 0.0f); - } - } - controlPoint1 += v; - } - return controlPoint1; - } - - private static Vector2 DrawWhip_ThornWhip(Projectile proj, List controlPoints) - { - Texture2D texture2D = TextureAssets.Projectile[proj.type].Value; - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: 5); - int height = r.Height; - r.Height -= 2; - Vector2 vector2 = r.Size() / 2f; - Vector2 controlPoint1 = controlPoints[0]; - for (int index = 0; index < controlPoints.Count - 1; ++index) - { - bool flag = true; - Vector2 origin = vector2; - float scale = 1f; - switch (index) - { - case 0: - origin.Y -= 4f; - break; - case 19: - r.Y = height * 4; - scale = 1.1f; - break; - default: - r.Y = height * (1 + index % 3); - scale = 0.8f; - break; - } - Vector2 controlPoint2 = controlPoints[index]; - Vector2 v = controlPoints[index + 1] - controlPoint2; - if (flag) - { - float rotation = v.ToRotation() - 1.570796f; - Microsoft.Xna.Framework.Color color = Lighting.GetColor(controlPoint2.ToTileCoordinates()); - Main.spriteBatch.Draw(texture2D, controlPoint1 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(r), color, rotation, origin, scale, SpriteEffects.None, 0.0f); - } - controlPoint1 += v; - } - return controlPoint1; - } - - private static Vector2 DrawWhip_WhipSword(Projectile proj, List controlPoints) - { - Texture2D texture2D = TextureAssets.Projectile[proj.type].Value; - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: 5); - int height = r.Height; - r.Height -= 2; - Vector2 vector2 = r.Size() / 2f; - Vector2 controlPoint1 = controlPoints[0]; - for (int index = 0; index < controlPoints.Count - 1; ++index) - { - bool flag = true; - Vector2 origin = vector2; - switch (index) - { - case 0: - origin.Y -= 4f; - break; - case 3: - case 5: - case 7: - r.Y = height; - break; - case 9: - case 11: - case 13: - r.Y = height * 2; - break; - case 15: - case 17: - r.Y = height * 3; - break; - case 19: - r.Y = height * 4; - break; - default: - flag = false; - break; - } - Vector2 controlPoint2 = controlPoints[index]; - Vector2 v = controlPoints[index + 1] - controlPoint2; - if (flag) - { - float rotation = v.ToRotation() - 1.570796f; - Microsoft.Xna.Framework.Color color = Lighting.GetColor(controlPoint2.ToTileCoordinates()); - Main.spriteBatch.Draw(texture2D, controlPoint1 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(r), color, rotation, origin, 1f, SpriteEffects.None, 0.0f); - } - controlPoint1 += v; - } - return controlPoint1; - } - - private static Vector2 DrawWhip_WhipMace(Projectile proj, List controlPoints) - { - SpriteEffects effects = SpriteEffects.None; - if (proj.spriteDirection == 1) - effects ^= SpriteEffects.FlipHorizontally; - Texture2D texture2D = TextureAssets.Projectile[proj.type].Value; - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: 5); - int height = r.Height; - r.Height -= 2; - Vector2 vector2 = r.Size() / 2f; - Vector2 controlPoint1 = controlPoints[0]; - for (int index = 0; index < controlPoints.Count - 1; ++index) - { - bool flag = false; - Vector2 origin = vector2; - float scale = 1f; - if (index == 0) - { - origin.Y -= 4f; - flag = true; - } - else if (index % 2 == 0) - { - flag = true; - int num = 1; - if (index > 10) - num = 2; - if (index > 20) - num = 3; - r.Y = height * num; - } - if (index == controlPoints.Count - 2) - { - flag = true; - r.Y = height * 4; - float timeToFlyOut; - Projectile.GetWhipSettings(proj, out timeToFlyOut, out int _, out float _); - float t = proj.ai[0] / timeToFlyOut; - scale = MathHelper.Lerp(0.5f, 2f, Utils.GetLerpValue(0.1f, 0.7f, t, true) * Utils.GetLerpValue(0.9f, 0.7f, t, true)); - } - Vector2 controlPoint2 = controlPoints[index]; - Vector2 v = controlPoints[index + 1] - controlPoint2; - if (flag) - { - float rotation = v.ToRotation() - 1.570796f; - Microsoft.Xna.Framework.Color color = Lighting.GetColor(controlPoint2.ToTileCoordinates()); - Main.spriteBatch.Draw(texture2D, controlPoint1 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(r), color, rotation, origin, scale, effects, 0.0f); - } - controlPoint1 += v; - } - return controlPoint1; - } - - private static Vector2 DrawWhip_WhipScythe(Projectile proj, List controlPoints) - { - SpriteEffects effects = SpriteEffects.None; - if (proj.spriteDirection == 1) - effects ^= SpriteEffects.FlipHorizontally; - Texture2D texture2D = TextureAssets.Projectile[proj.type].Value; - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: 5); - int height = r.Height; - r.Height -= 2; - Vector2 vector2 = r.Size() / 2f; - Vector2 controlPoint1 = controlPoints[0]; - for (int index = 0; index < controlPoints.Count - 1; ++index) - { - bool flag = false; - Vector2 origin = vector2; - float scale = 1f; - if (index == 0) - { - origin.Y -= 4f; - flag = true; - } - else if (index % 2 == 0) - { - flag = true; - int num = 1; - if (index > 10) - num = 2; - if (index > 20) - num = 3; - r.Y = height * num; - } - if (index == controlPoints.Count - 2) - { - flag = true; - r.Y = height * 4; - float timeToFlyOut; - Projectile.GetWhipSettings(proj, out timeToFlyOut, out int _, out float _); - float t = proj.ai[0] / timeToFlyOut; - scale = MathHelper.Lerp(0.5f, 1.5f, Utils.GetLerpValue(0.1f, 0.7f, t, true) * Utils.GetLerpValue(0.9f, 0.7f, t, true)); - } - Vector2 controlPoint2 = controlPoints[index]; - Vector2 v = controlPoints[index + 1] - controlPoint2; - if (flag) - { - float rotation = v.ToRotation() - 1.570796f; - Microsoft.Xna.Framework.Color color = Lighting.GetColor(controlPoint2.ToTileCoordinates()); - Main.spriteBatch.Draw(texture2D, controlPoint1 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(r), color, rotation, origin, scale, effects, 0.0f); - } - controlPoint1 += v; - } - return controlPoint1; - } - - private static Vector2 DrawWhip_WhipBland(Projectile proj, List controlPoints) - { - SpriteEffects effects = SpriteEffects.None; - if (proj.spriteDirection == 1) - effects ^= SpriteEffects.FlipHorizontally; - Texture2D texture2D = TextureAssets.Projectile[proj.type].Value; - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: 5); - int height = r.Height; - r.Height -= 2; - Vector2 vector2 = r.Size() / 2f; - Vector2 controlPoint1 = controlPoints[0]; - for (int index = 0; index < controlPoints.Count - 1; ++index) - { - Vector2 origin = vector2; - float scale = 1f; - bool flag; - if (index == 0) - { - origin.Y -= 4f; - flag = true; - } - else - { - flag = true; - int num = 1; - if (index > 10) - num = 2; - if (index > 20) - num = 3; - r.Y = height * num; - } - if (index == controlPoints.Count - 2) - { - flag = true; - r.Y = height * 4; - float timeToFlyOut; - Projectile.GetWhipSettings(proj, out timeToFlyOut, out int _, out float _); - float t = proj.ai[0] / timeToFlyOut; - scale = MathHelper.Lerp(0.5f, 1.5f, Utils.GetLerpValue(0.1f, 0.7f, t, true) * Utils.GetLerpValue(0.9f, 0.7f, t, true)); - } - Vector2 controlPoint2 = controlPoints[index]; - Vector2 v = controlPoints[index + 1] - controlPoint2; - if (flag) - { - float rotation = v.ToRotation() - 1.570796f; - Microsoft.Xna.Framework.Color color = Lighting.GetColor(controlPoint2.ToTileCoordinates()); - Main.spriteBatch.Draw(texture2D, controlPoint1 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(r), color, rotation, origin, scale, effects, 0.0f); - } - controlPoint1 += v; - } - return controlPoint1; - } - - private void DrawWhipOld(Projectile proj) - { - List vector2List = new List(); - float num1 = 100f; - float num2 = proj.ai[0] / num1; - if ((double) num2 <= 1.0) - { - float num3 = (float) (12.5663709640503 * (1.0 - (double) num2) * (double) -proj.spriteDirection / 20.0); - float num4 = (float) ((double) proj.velocity.Length() * ((double) proj.ai[0] - 1.0) / 20.0); - float num5 = num2; - Vector2 vector2_1 = Main.player[proj.owner].Center; - Vector2 vector2_2 = vector2_1; - float f1 = proj.rotation - 1.570796f; - float f2 = (float) ((double) proj.rotation - 1.57079637050629 + 1.57079637050629 * (double) proj.spriteDirection); - for (int index = 0; index < 20; ++index) - { - float num6 = (float) index / 20f; - Vector2 vector2_3 = vector2_1 + f1.ToRotationVector2() * num4; - Vector2 vector2_4 = vector2_2 + f2.ToRotationVector2() * (num4 * 2f); - float num7 = num3 * num6 * num5; - f1 += num7; - f2 += num7; - vector2List.Add(Vector2.Lerp(vector2_4, vector2_3, (float) ((double) num2 * 0.5 + 0.5))); - vector2_1 = vector2_3; - vector2_2 = vector2_4; - } - } - Texture2D texture2D = TextureAssets.FishingLine.Value; - Microsoft.Xna.Framework.Rectangle rectangle = texture2D.Frame(); - Vector2 origin = new Vector2((float) (rectangle.Width / 2), 2f); - for (int index = 0; index < vector2List.Count - 1; ++index) - { - Vector2 vector2 = vector2List[index]; - Vector2 Target = vector2List[index + 1]; - float rotation = vector2.DirectionTo(Target).ToRotation() - 1.570796f; - Microsoft.Xna.Framework.Color color = Lighting.GetColor(vector2.ToTileCoordinates()); - Vector2 scale = new Vector2(1f, ((Target - vector2).Length() + 2f) / (float) rectangle.Height); - Main.spriteBatch.Draw(texture2D, vector2 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(rectangle), color, rotation, origin, scale, SpriteEffects.None, 0.0f); - } - } - - private void DrawTwinsPet(Projectile proj) - { - Texture2D texture2D = TextureAssets.Projectile[proj.type].Value; - SpriteEffects effects = proj.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: Main.projFrames[proj.type], frameY: proj.frame); - Vector2 origin = r.Size() / 2f; - Vector2 vector2 = proj.Center - Main.screenPosition; - Microsoft.Xna.Framework.Color alpha = proj.GetAlpha(Lighting.GetColor(proj.Center.ToTileCoordinates())); - Vector2 position1 = vector2 + (Main.GlobalTimeWrappedHourly * 2f).ToRotationVector2() * 18f; - Main.EntitySpriteDraw(texture2D, position1, new Microsoft.Xna.Framework.Rectangle?(r), alpha, proj.rotation, origin, proj.scale, effects, 0); - Vector2 position2 = vector2 - (Main.GlobalTimeWrappedHourly * 2f).ToRotationVector2() * 18f; - Microsoft.Xna.Framework.Rectangle rectangle = texture2D.Frame(verticalFrames: Main.projFrames[proj.type], frameY: (proj.frame + 18)); - Main.EntitySpriteDraw(texture2D, position2, new Microsoft.Xna.Framework.Rectangle?(rectangle), alpha, proj.rotation, origin, proj.scale, effects, 0); - } - - private void DrawMultisegmentPet(Projectile proj) - { - Texture2D texture2D = TextureAssets.Projectile[proj.type].Value; - Texture2D texture = (Texture2D) null; - if (proj.type == 887) - texture = TextureAssets.GlowMask[275].Value; - int num1 = 5; - int num2 = 16; - switch (proj.type) - { - case 883: - num1 = 5; - num2 = 16; - break; - case 887: - num1 = 6; - num2 = 16; - break; - case 893: - num1 = 8; - num2 = 20; - break; - } - SpriteEffects effects1 = proj.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: Main.projFrames[proj.type]); - Vector2 origin = r.Size() / 2f; - Vector2 position1 = proj.Center - Main.screenPosition; - Microsoft.Xna.Framework.Color alpha = proj.GetAlpha(Lighting.GetColor(proj.Center.ToTileCoordinates())); - Microsoft.Xna.Framework.Color color = Microsoft.Xna.Framework.Color.White * ((float) Main.mouseTextColor / (float) byte.MaxValue); - Vector2 vector2_1 = proj.Center; - int num3 = 1; - int num4 = Main.projFrames[proj.type] - 1; - for (int index = 1; index < num1; ++index) - { - int frameY = num3; - if (index == num1 - 1) - frameY = num4; - else if (proj.type == 893 && index != 2 && index != 5) - frameY = 2; - Microsoft.Xna.Framework.Rectangle rectangle = texture2D.Frame(verticalFrames: Main.projFrames[proj.type], frameY: frameY); - Vector2 vector2_2 = proj.oldPos[index * 10] + proj.Size / 2f; - float rotation1 = (vector2_1 - vector2_2).ToRotation(); - Vector2 vec = vector2_1 - new Vector2((float) num2, 0.0f).RotatedBy((double) rotation1, Vector2.Zero); - float rotation2 = (vector2_1 - vec).ToRotation() + 1.570796f; - Vector2 position2 = vec - Main.screenPosition; - SpriteEffects effects2 = (double) vec.X < (double) vector2_1.X ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - vector2_1 = vec; - Main.EntitySpriteDraw(texture2D, position2, new Microsoft.Xna.Framework.Rectangle?(rectangle), proj.GetAlpha(Lighting.GetColor(vec.ToTileCoordinates())), rotation2, origin, proj.scale, effects2, 0); - if (texture != null) - Main.EntitySpriteDraw(texture, position2, new Microsoft.Xna.Framework.Rectangle?(rectangle), proj.GetAlpha(color), rotation2, origin, proj.scale, effects2, 0); - } - Main.EntitySpriteDraw(texture2D, position1, new Microsoft.Xna.Framework.Rectangle?(r), alpha, proj.rotation, origin, proj.scale, effects1, 0); - if (texture == null) - return; - Main.EntitySpriteDraw(texture, position1, new Microsoft.Xna.Framework.Rectangle?(r), color, proj.rotation, origin, proj.scale, effects1, 0); - } - - private void DrawKite(Projectile proj) - { - Texture2D texture2D1 = TextureAssets.Projectile[proj.type].Value; - Texture2D texture2D2 = TextureAssets.Extra[103].Value; - int horizontalFrames = 15; - float num1 = 0.0f; - int num2 = 10; - int num3 = 5; - float num4 = 10f; - float num5 = 0.0f; - int num6 = -14; - int num7 = -2; - int num8 = -1; - int num9 = -1; - int num10 = 8; - int num11 = 0; - int num12 = 1; - int num13 = 0; - int num14 = 0; - bool flag1 = true; - bool flag2 = false; - switch (proj.type) - { - case 766: - case 767: - case 768: - case 769: - case 770: - num11 = (proj.type - 766) * 3 + 3; - break; - case 771: - texture2D2 = TextureAssets.Extra[104].Value; - horizontalFrames = 12; - num11 = 12; - num1 = proj.spriteDirection == 1 ? 1.570796f : -1.570796f; - num2 = 12; - num4 = 22f; - num5 += 0.3926991f * (float) proj.spriteDirection; - num6 = -8; - num7 = -6; - num8 = 10; - num9 = 8; - num10 = 12; - break; - case 822: - texture2D2 = TextureAssets.Extra[132].Value; - horizontalFrames = 7; - num11 = 7; - num1 = proj.spriteDirection == 1 ? 1.570796f : -1.570796f; - num2 = 7; - num4 = 22f; - num5 += 0.2617994f * (float) proj.spriteDirection; - num6 = -20; - num7 = -6; - num10 = 12; - break; - case 823: - case 846: - texture2D2 = TextureAssets.Extra[133].Value; - if (proj.type == 846) - texture2D2 = TextureAssets.Extra[146].Value; - horizontalFrames = 6; - num11 = 6; - num1 = proj.spriteDirection == 1 ? 1.570796f : -1.570796f; - num2 = 6; - num4 = 40f; - num5 += 0.2617994f * (float) proj.spriteDirection; - num6 = -16; - num7 = -10; - num10 = 30; - break; - case 824: - case 826: - case 839: - case 840: - case 853: - num12 = 0; - break; - case 827: - case 844: - texture2D2 = TextureAssets.Extra[135].Value; - if (proj.type == 844) - texture2D2 = TextureAssets.Extra[144].Value; - horizontalFrames = 4; - num11 = 3; - num1 = proj.spriteDirection == 1 ? 1.570796f : -1.570796f; - num2 = 16; - num4 = 10f; - num5 += 0.2617994f * (float) proj.spriteDirection; - num7 = -4; - num3 = 4; - flag2 = true; - break; - case 828: - case 829: - texture2D2 = TextureAssets.Extra[136].Value; - if (proj.type == 829) - texture2D2 = TextureAssets.Extra[137].Value; - horizontalFrames = 2; - num11 = 1; - num1 = proj.spriteDirection == 1 ? 1.570796f : -1.570796f; - num2 = 6; - num4 = 10f; - num5 += 0.2617994f * (float) proj.spriteDirection; - num10 = 10; - num7 = -4; - num12 = 3; - flag1 = false; - flag2 = true; - break; - case 830: - case 838: - texture2D2 = TextureAssets.Extra[138].Value; - if (proj.type == 838) - texture2D2 = TextureAssets.Extra[139].Value; - horizontalFrames = 3; - num11 = 3; - num1 = proj.spriteDirection == 1 ? 1.570796f : -1.570796f; - num2 = 3; - num4 = 60f; - num9 = 40; - num8 = 3; - num5 += 0.2617994f * (float) proj.spriteDirection; - num10 = 50; - num7 = -20; - num13 = -10; - break; - case 843: - texture2D2 = TextureAssets.Extra[140].Value; - horizontalFrames = 2; - num11 = 2; - num1 = proj.spriteDirection == 1 ? 1.570796f : -1.570796f; - num2 = 2; - num4 = 30f; - num5 += 0.2617994f * (float) proj.spriteDirection; - num10 = 20; - num7 = -16; - num13 = -10; - break; - case 845: - texture2D2 = TextureAssets.Extra[145].Value; - horizontalFrames = 3; - num11 = 3; - num1 = proj.spriteDirection == 1 ? 1.570796f : -1.570796f; - num2 = 3; - num4 = 42f; - num9 = 50; - num8 = 2; - num5 += 0.2617994f * (float) proj.spriteDirection; - num10 = 30; - num7 = -8; - num13 = -10; - break; - case 850: - texture2D2 = TextureAssets.Extra[147].Value; - horizontalFrames = 8; - num11 = 8; - num1 = proj.spriteDirection == 1 ? 1.570796f : -1.570796f; - num2 = 8; - num4 = 22f; - num5 += 0.2617994f * (float) proj.spriteDirection; - num6 = -20; - num7 = -38; - num10 = 12; - num13 = 6; - num14 = 2; - flag1 = false; - break; - case 852: - texture2D2 = TextureAssets.Extra[148].Value; - horizontalFrames = 2; - num11 = 1; - num1 = proj.spriteDirection == 1 ? 1.570796f : -1.570796f; - num2 = 6; - num4 = 10f; - num5 += 0.2617994f * (float) proj.spriteDirection; - num10 = 10; - num7 = -4; - num12 = 4; - flag1 = false; - flag2 = true; - break; - } - SpriteEffects effects = proj.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - Microsoft.Xna.Framework.Rectangle r1 = texture2D1.Frame(Main.projFrames[proj.type], frameX: proj.frame); - Vector2 origin1 = r1.Size() / 2f; - Vector2 position = proj.Center - Main.screenPosition; - Microsoft.Xna.Framework.Color color1 = Lighting.GetColor(proj.Center.ToTileCoordinates()); - Microsoft.Xna.Framework.Color alpha = proj.GetAlpha(color1); - Texture2D texture2D3 = TextureAssets.FishingLine.Value; - Microsoft.Xna.Framework.Rectangle rectangle1 = texture2D3.Frame(); - Vector2 origin2 = new Vector2((float) (rectangle1.Width / 2), 2f); - Microsoft.Xna.Framework.Rectangle r2 = texture2D2.Frame(horizontalFrames); - int width = r2.Width; - r2.Width -= 2; - Vector2 origin3 = r2.Size() / 2f; - r2.X = width * (horizontalFrames - 1); - Vector2 playerArmPosition = Main.GetPlayerArmPosition(proj); - Vector2 center = proj.Center; - double num15 = (double) Vector2.Distance(center, playerArmPosition); - float num16 = 12f; - Vector2 vector2_1 = (playerArmPosition - center).SafeNormalize(Vector2.Zero) * num16; - Vector2 vector2_2 = playerArmPosition; - Vector2 v1 = center - vector2_2; - Vector2 velocity = proj.velocity; - if ((double) Math.Abs(velocity.X) > (double) Math.Abs(velocity.Y)) - Utils.Swap(ref velocity.X, ref velocity.Y); - float num17 = v1.Length(); - float num18 = 16f; - float num19 = 80f; - bool flag3 = true; - if ((double) num17 == 0.0) - { - flag3 = false; - } - else - { - Vector2 vector2_3 = v1 * (12f / num17); - vector2_2 -= vector2_3; - v1 = center - vector2_2; - } - while (flag3) - { - float num20 = 12f; - float f = v1.Length(); - float num21 = f; - if (float.IsNaN(f) || (double) f == 0.0) - { - flag3 = false; - } - else - { - if ((double) f < 20.0) - { - num20 = f - 8f; - flag3 = false; - } - float num22 = 12f / f; - Vector2 vector2_4 = v1 * num22; - vector2_2 += vector2_4; - v1 = center - vector2_2; - if ((double) num21 > 12.0) - { - float num23 = 0.3f; - float num24 = Math.Abs(velocity.X) + Math.Abs(velocity.Y); - if ((double) num24 > (double) num18) - num24 = num18; - float num25 = (float) (1.0 - (double) num24 / (double) num18); - float num26 = num23 * num25; - float num27 = num21 / num19; - if ((double) num27 > 1.0) - num27 = 1f; - float num28 = num26 * num27; - if ((double) num28 < 0.0) - num28 = 0.0f; - float num29 = 1f; - float num30 = num28 * num29; - if ((double) v1.Y > 0.0) - { - v1.Y *= 1f + num30; - v1.X *= 1f - num30; - } - else - { - float num31 = Math.Abs(velocity.X) / 3f; - if ((double) num31 > 1.0) - num31 = 1f; - float num32 = num31 - 0.5f; - float num33 = num30 * num32; - if ((double) num33 > 0.0) - num33 *= 2f; - v1.Y *= 1f + num33; - v1.X *= 1f - num33; - } - } - float rotation = v1.ToRotation() - 1.570796f; - if (!flag3) - rectangle1.Height = (int) num20; - Microsoft.Xna.Framework.Color color2 = Lighting.GetColor(center.ToTileCoordinates()); - Main.EntitySpriteDraw(texture2D3, vector2_2 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(rectangle1), color2, rotation, origin2, 1f, SpriteEffects.None, 0); - } - } - Vector2 vector2_5 = proj.Size / 2f; - float num34 = Math.Abs(Main.WindForVisuals); - float num35 = MathHelper.Lerp(0.5f, 1f, num34); - float num36 = num34; - if ((double) v1.Y >= -0.0199999995529652 && (double) v1.Y < 1.0) - num36 = Utils.GetLerpValue(0.2f, 0.5f, num34, true); - int num37 = num3; - int num38 = num2 + 1; - for (int index1 = 0; index1 < num12; ++index1) - { - r2.X = width * (horizontalFrames - 1); - List vector2List = new List(); - Vector2 vector2_6 = new Vector2(num35 * (float) num10 * (float) proj.spriteDirection, (float) Math.Sin(Main.timeForVisualEffects / 300.0 * 6.28318548202515) * num36) * 2f; - float num39 = (float) (num6 + num13); - float y = (float) (num7 + num14); - switch (index1) - { - case 1: - vector2_6 = new Vector2(num35 * (float) num10 * (float) proj.spriteDirection, (float) (Math.Sin(Main.timeForVisualEffects / 300.0 * 6.28318548202515) * (double) num36 + 0.5)) * 2f; - num39 -= 8f; - y -= 8f; - break; - case 2: - vector2_6 = new Vector2(num35 * (float) num10 * (float) proj.spriteDirection, (float) (Math.Sin(Main.timeForVisualEffects / 300.0 * 6.28318548202515) * (double) num36 + 1.0)) * 2f; - num39 -= 4f; - y -= 4f; - break; - case 3: - vector2_6 = new Vector2(num35 * (float) num10 * (float) proj.spriteDirection, (float) (Math.Sin(Main.timeForVisualEffects / 300.0 * 6.28318548202515) * (double) num36 + 1.5)) * 2f; - num39 -= 12f; - y -= 12f; - break; - } - Vector2 vector2_7 = proj.Center + new Vector2(((float) r1.Width * 0.5f + num39) * (float) proj.spriteDirection, y).RotatedBy((double) proj.rotation + (double) num5); - vector2List.Add(vector2_7); - int index2 = num37; - int num40 = 1; - while (index2 < num38 * num37) - { - if (num8 != -1 && num8 == num40) - num4 = (float) num9; - Vector2 oldPo = proj.oldPos[index2]; - if ((double) oldPo.X == 0.0 && (double) oldPo.Y == 0.0) - { - vector2List.Add(vector2_7); } else { - Vector2 vector2_8 = oldPo + (vector2_5 + new Vector2(((float) r1.Width * 0.5f + num39) * (float) proj.oldSpriteDirection[index2], y).RotatedBy((double) proj.oldRot[index2] + (double) num5)) + vector2_6 * (float) (num40 + 1); - Vector2 vector2_9 = vector2_7 - vector2_8; - float num41 = vector2_9.Length(); - if ((double) num41 > (double) num4) - vector2_9 *= num4 / num41; - Vector2 vector2_10 = vector2_7 - vector2_9; - vector2List.Add(vector2_10); - vector2_7 = vector2_10; + float num115 = 24f / f; + float num116 = num113 * num115; + float num117 = num114 * num115; + vector2.X += num116; + vector2.Y += num117; + num113 = mountedCenter.X - vector2.X; + num114 = mountedCenter.Y - vector2.Y; + Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); + Main.spriteBatch.Draw(Main.chain15Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain15Texture.Width, Main.chain15Texture.Height)), color, rotation, new Vector2((float) Main.chain15Texture.Width * 0.5f, (float) Main.chain15Texture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); } - index2 += num37; - ++num40; } - if (flag1) + } + else if (projectile.type >= 230 && projectile.type <= 235) + { + int index = projectile.type - 229; + Vector2 vector2 = new Vector2(projectile.position.X + (float) projectile.width * 0.5f, projectile.position.Y + (float) projectile.height * 0.5f); + float num118 = mountedCenter.X - vector2.X; + float num119 = mountedCenter.Y - vector2.Y; + float rotation = (float) Math.Atan2((double) num119, (double) num118) - 1.57f; + bool flag = true; + while (flag) { - Microsoft.Xna.Framework.Rectangle rectangle2 = texture2D3.Frame(); - for (int index3 = vector2List.Count - 2; index3 >= 0; --index3) + float f = (float) Math.Sqrt((double) num118 * (double) num118 + (double) num119 * (double) num119); + if ((double) f < 25.0) + flag = false; + else if (float.IsNaN(f)) { - Vector2 vector2_11 = vector2List[index3]; - Vector2 v2 = vector2List[index3 + 1] - vector2_11; - float num42 = v2.Length(); - if ((double) num42 >= 2.0) + flag = false; + } + else + { + float num120 = (float) Main.gemChainTexture[index].Height / f; + float num121 = num118 * num120; + float num122 = num119 * num120; + vector2.X += num121; + vector2.Y += num122; + num118 = mountedCenter.X - vector2.X; + num119 = mountedCenter.Y - vector2.Y; + Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); + Main.spriteBatch.Draw(Main.gemChainTexture[index], new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.gemChainTexture[index].Width, Main.gemChainTexture[index].Height)), color, rotation, new Vector2((float) Main.gemChainTexture[index].Width * 0.5f, (float) Main.gemChainTexture[index].Height * 0.5f), 1f, SpriteEffects.None, 0.0f); + } + } + } + else if (projectile.type == 256) + { + Vector2 vector2 = new Vector2(projectile.position.X + (float) projectile.width * 0.5f, projectile.position.Y + (float) projectile.height * 0.5f); + float num123 = mountedCenter.X - vector2.X; + float num124 = mountedCenter.Y - vector2.Y; + float num125 = (float) Math.Atan2((double) num124, (double) num123) - 1.57f; + bool flag = true; + while (flag) + { + float f = (float) Math.Sqrt((double) num123 * (double) num123 + (double) num124 * (double) num124); + if ((double) f < 26.0) + flag = false; + else if (float.IsNaN(f)) + { + flag = false; + } + else + { + float num126 = 26f / f; + float num127 = num123 * num126; + float num128 = num124 * num126; + vector2.X += num127; + vector2.Y += num128; + num123 = Main.player[projectile.owner].position.X + (float) (Main.player[projectile.owner].width / 2) - vector2.X; + num124 = Main.player[projectile.owner].position.Y + (float) (Main.player[projectile.owner].height / 2) - vector2.Y; + Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); + Main.spriteBatch.Draw(Main.chain20Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain20Texture.Width, Main.chain20Texture.Height)), color, num125 - 0.785f, new Vector2((float) Main.chain20Texture.Width * 0.5f, (float) Main.chain20Texture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); + } + } + } + else if (projectile.type == 322) + { + Vector2 vector2 = new Vector2(projectile.position.X + (float) projectile.width * 0.5f, projectile.position.Y + (float) projectile.height * 0.5f); + float num129 = mountedCenter.X - vector2.X; + float num130 = mountedCenter.Y - vector2.Y; + float rotation = (float) Math.Atan2((double) num130, (double) num129) - 1.57f; + bool flag = true; + while (flag) + { + float f = (float) Math.Sqrt((double) num129 * (double) num129 + (double) num130 * (double) num130); + if ((double) f < 22.0) + flag = false; + else if (float.IsNaN(f)) + { + flag = false; + } + else + { + float num131 = 22f / f; + float num132 = num129 * num131; + float num133 = num130 * num131; + vector2.X += num132; + vector2.Y += num133; + num129 = mountedCenter.X - vector2.X; + num130 = mountedCenter.Y - vector2.Y; + Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); + Main.spriteBatch.Draw(Main.chain29Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain29Texture.Width, Main.chain29Texture.Height)), color, rotation, new Vector2((float) Main.chain29Texture.Width * 0.5f, (float) Main.chain29Texture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); + } + } + } + else if (projectile.type == 315) + { + Vector2 vector2 = new Vector2(projectile.position.X + (float) projectile.width * 0.5f, projectile.position.Y + (float) projectile.height * 0.5f); + float num134 = mountedCenter.X - vector2.X; + float num135 = mountedCenter.Y - vector2.Y; + float rotation = (float) Math.Atan2((double) num135, (double) num134) - 1.57f; + bool flag = true; + while (flag) + { + float f = (float) Math.Sqrt((double) num134 * (double) num134 + (double) num135 * (double) num135); + if ((double) f < 50.0) + flag = false; + else if (float.IsNaN(f)) + { + flag = false; + } + else + { + float num136 = 40f / f; + float num137 = num134 * num136; + float num138 = num135 * num136; + vector2.X += num137; + vector2.Y += num138; + num134 = mountedCenter.X - vector2.X; + num135 = mountedCenter.Y - vector2.Y; + Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); + Main.spriteBatch.Draw(Main.chain28Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain28Texture.Width, Main.chain28Texture.Height)), color, rotation, new Vector2((float) Main.chain28Texture.Width * 0.5f, (float) Main.chain28Texture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); + } + } + } + else if (projectile.type == 331) + { + Vector2 vector2 = new Vector2(projectile.position.X + (float) projectile.width * 0.5f, projectile.position.Y + (float) projectile.height * 0.5f); + float num139 = mountedCenter.X - vector2.X; + float num140 = mountedCenter.Y - vector2.Y; + float rotation = (float) Math.Atan2((double) num140, (double) num139) - 1.57f; + bool flag = true; + while (flag) + { + float f = (float) Math.Sqrt((double) num139 * (double) num139 + (double) num140 * (double) num140); + if ((double) f < 30.0) + flag = false; + else if (float.IsNaN(f)) + { + flag = false; + } + else + { + float num141 = 24f / f; + float num142 = num139 * num141; + float num143 = num140 * num141; + vector2.X += num142; + vector2.Y += num143; + num139 = mountedCenter.X - vector2.X; + num140 = mountedCenter.Y - vector2.Y; + Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); + Main.spriteBatch.Draw(Main.chain30Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain30Texture.Width, Main.chain30Texture.Height)), color, rotation, new Vector2((float) Main.chain30Texture.Width * 0.5f, (float) Main.chain30Texture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); + } + } + } + else if (projectile.type == 332) + { + int num144 = 0; + Vector2 vector2 = new Vector2(projectile.position.X + (float) projectile.width * 0.5f, projectile.position.Y + (float) projectile.height * 0.5f); + float num145 = mountedCenter.X - vector2.X; + float num146 = mountedCenter.Y - vector2.Y; + float rotation = (float) Math.Atan2((double) num146, (double) num145) - 1.57f; + bool flag = true; + while (flag) + { + float f = (float) Math.Sqrt((double) num145 * (double) num145 + (double) num146 * (double) num146); + if ((double) f < 30.0) + flag = false; + else if (float.IsNaN(f)) + { + flag = false; + } + else + { + int i1 = (int) vector2.X / 16; + int j = (int) vector2.Y / 16; + if (num144 == 0) + Lighting.AddLight(i1, j, 0.0f, 0.2f, 0.2f); + if (num144 == 1) + Lighting.AddLight(i1, j, 0.1f, 0.2f, 0.0f); + if (num144 == 2) + Lighting.AddLight(i1, j, 0.2f, 0.1f, 0.0f); + if (num144 == 3) + Lighting.AddLight(i1, j, 0.2f, 0.0f, 0.2f); + float num147 = 16f / f; + float num148 = num145 * num147; + float num149 = num146 * num147; + vector2.X += num148; + vector2.Y += num149; + num145 = mountedCenter.X - vector2.X; + num146 = mountedCenter.Y - vector2.Y; + Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); + Main.spriteBatch.Draw(Main.chain31Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, Main.chain31Texture.Height / 4 * num144, Main.chain31Texture.Width, Main.chain31Texture.Height / 4)), color, rotation, new Vector2((float) Main.chain30Texture.Width * 0.5f, (float) (Main.chain30Texture.Height / 8)), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.chain32Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, Main.chain31Texture.Height / 4 * num144, Main.chain31Texture.Width, Main.chain31Texture.Height / 4)), new Microsoft.Xna.Framework.Color(200, 200, 200, 0), rotation, new Vector2((float) Main.chain30Texture.Width * 0.5f, (float) (Main.chain30Texture.Height / 8)), 1f, SpriteEffects.None, 0.0f); + ++num144; + if (num144 > 3) + num144 = 0; + } + } + } + else if (projectile.type == 372 || projectile.type == 383 || projectile.type == 396 || projectile.type == 403 || projectile.type == 404 || projectile.type == 446 || projectile.type >= 486 && projectile.type <= 489 || projectile.type >= 646 && projectile.type <= 649 || projectile.type == 652) + { + Texture2D texture1 = (Texture2D) null; + Microsoft.Xna.Framework.Color color1 = Microsoft.Xna.Framework.Color.Transparent; + Texture2D texture2 = Main.chain33Texture; + if (projectile.type == 383) + texture2 = Main.chain34Texture; + if (projectile.type == 396) + texture2 = Main.chain35Texture; + if (projectile.type == 403) + texture2 = Main.chain36Texture; + if (projectile.type == 404) + texture2 = Main.chain37Texture; + if (projectile.type == 446) + texture2 = Main.extraTexture[3]; + if (projectile.type >= 486 && projectile.type <= 489) + texture2 = Main.chainsTexture[projectile.type - 486]; + if (projectile.type >= 646 && projectile.type <= 649) + { + texture2 = Main.chainsTexture[projectile.type - 646 + 8]; + texture1 = Main.chainsTexture[projectile.type - 646 + 12]; + color1 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue); + } + if (projectile.type == 652) + texture2 = Main.chainsTexture[16]; + Vector2 position = projectile.Center; + Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); + Vector2 origin = new Vector2((float) texture2.Width * 0.5f, (float) texture2.Height * 0.5f); + float height = (float) texture2.Height; + float num150 = 0.0f; + if (projectile.type == 446) + { + int num151 = 7; + int num152 = (int) projectile.localAI[0] / num151; + sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, texture2.Height / 4 * num152, texture2.Width, texture2.Height / 4)); + origin.Y /= 4f; + height /= 4f; + } + switch (projectile.type) + { + case 383: + num150 = 14f; + break; + case 446: + num150 = 20f; + break; + case 487: + num150 = 8f; + break; + case 489: + num150 = 10f; + break; + } + if ((double) num150 != 0.0) + { + float num153 = -1.57f; + Vector2 vector2_3 = new Vector2((float) Math.Cos((double) projectile.rotation + (double) num153), (float) Math.Sin((double) projectile.rotation + (double) num153)); + Vector2 vector2_4 = position - vector2_3 * num150; + Vector2 vector2_5 = mountedCenter - vector2_4; + vector2_5.Normalize(); + position = vector2_4 - vector2_5 * height / 2f; + } + Vector2 vector2_6 = mountedCenter - position; + float rotation = (float) Math.Atan2((double) vector2_6.Y, (double) vector2_6.X) - 1.57f; + bool flag = true; + if (float.IsNaN(position.X) && float.IsNaN(position.Y)) + flag = false; + if (float.IsNaN(vector2_6.X) && float.IsNaN(vector2_6.Y)) + flag = false; + while (flag) + { + if ((double) vector2_6.Length() < (double) height + 1.0) + { + flag = false; + } + else + { + Vector2 vector2_7 = vector2_6; + vector2_7.Normalize(); + position += vector2_7 * height; + vector2_6 = mountedCenter - position; + Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int) position.X / 16, (int) ((double) position.Y / 16.0)); + if (projectile.type == 396) + color2 *= (float) ((int) byte.MaxValue - projectile.alpha) / (float) byte.MaxValue; + if (projectile.type == 446) + color2 = projectile.GetAlpha(color2); + if (projectile.type == 488) { - float rotation = v2.ToRotation() - 1.570796f; - Main.EntitySpriteDraw(texture2D3, vector2_11 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(rectangle2), alpha, rotation, origin2, new Vector2(1f, num42 / (float) rectangle2.Height), SpriteEffects.None, 0); + Lighting.AddLight(position, 0.2f, 0.0f, 0.175f); + color2 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); + } + if (projectile.type >= 646 && projectile.type <= 649) + color2 = projectile.GetAlpha(color2); + Main.spriteBatch.Draw(texture2, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); + if (texture1 != null) + Main.spriteBatch.Draw(texture1, position - Main.screenPosition, sourceRectangle, color1, rotation, origin, 1f, SpriteEffects.None, 0.0f); + } + } + } + else if (projectile.aiStyle == 7) + { + Vector2 vector2 = new Vector2(projectile.position.X + (float) projectile.width * 0.5f, projectile.position.Y + (float) projectile.height * 0.5f); + float num154 = mountedCenter.X - vector2.X; + float num155 = mountedCenter.Y - vector2.Y; + float rotation = (float) Math.Atan2((double) num155, (double) num154) - 1.57f; + bool flag = true; + while (flag) + { + float f = (float) Math.Sqrt((double) num154 * (double) num154 + (double) num155 * (double) num155); + if ((double) f < 25.0) + flag = false; + else if (float.IsNaN(f)) + { + flag = false; + } + else + { + float num156 = 12f / f; + float num157 = num154 * num156; + float num158 = num155 * num156; + vector2.X += num157; + vector2.Y += num158; + num154 = mountedCenter.X - vector2.X; + num155 = mountedCenter.Y - vector2.Y; + Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); + Main.spriteBatch.Draw(Main.chainTexture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chainTexture.Width, Main.chainTexture.Height)), color, rotation, new Vector2((float) Main.chainTexture.Width * 0.5f, (float) Main.chainTexture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); + } + } + } + else if (projectile.type == 262) + { + float x2 = projectile.Center.X; + float y2 = projectile.Center.Y; + float x3 = projectile.velocity.X; + float y3 = projectile.velocity.Y; + float num159 = 4f / (float) Math.Sqrt((double) x3 * (double) x3 + (double) y3 * (double) y3); + float x4; + float y4; + if ((double) projectile.ai[0] == 0.0) + { + x4 = x2 - projectile.velocity.X * num159; + y4 = y2 - projectile.velocity.Y * num159; + } + else + { + x4 = x2 + projectile.velocity.X * num159; + y4 = y2 + projectile.velocity.Y * num159; + } + Vector2 vector2 = new Vector2(x4, y4); + float num160 = mountedCenter.X - vector2.X; + float num161 = mountedCenter.Y - vector2.Y; + float rotation = (float) Math.Atan2((double) num161, (double) num160) - 1.57f; + if (projectile.alpha == 0) + { + int num162 = -1; + if ((double) projectile.position.X + (double) (projectile.width / 2) < (double) mountedCenter.X) + num162 = 1; + Main.player[projectile.owner].itemRotation = Main.player[projectile.owner].direction != 1 ? (float) Math.Atan2((double) num161 * (double) num162, (double) num160 * (double) num162) : (float) Math.Atan2((double) num161 * (double) num162, (double) num160 * (double) num162); + } + bool flag = true; + while (flag) + { + float f = (float) Math.Sqrt((double) num160 * (double) num160 + (double) num161 * (double) num161); + if ((double) f < 25.0) + flag = false; + else if (float.IsNaN(f)) + { + flag = false; + } + else + { + float num163 = 12f / f; + float num164 = num160 * num163; + float num165 = num161 * num163; + vector2.X += num164; + vector2.Y += num165; + num160 = mountedCenter.X - vector2.X; + num161 = mountedCenter.Y - vector2.Y; + Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); + Main.spriteBatch.Draw(Main.chain22Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain22Texture.Width, Main.chain22Texture.Height)), color, rotation, new Vector2((float) Main.chain22Texture.Width * 0.5f, (float) Main.chain22Texture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); + } + } + } + else if (projectile.type == 273) + { + float x5 = projectile.Center.X; + float y5 = projectile.Center.Y; + float x6 = projectile.velocity.X; + float y6 = projectile.velocity.Y; + float num166 = 4f / (float) Math.Sqrt((double) x6 * (double) x6 + (double) y6 * (double) y6); + float x7; + float y7; + if ((double) projectile.ai[0] == 0.0) + { + x7 = x5 - projectile.velocity.X * num166; + y7 = y5 - projectile.velocity.Y * num166; + } + else + { + x7 = x5 + projectile.velocity.X * num166; + y7 = y5 + projectile.velocity.Y * num166; + } + Vector2 vector2 = new Vector2(x7, y7); + float num167 = mountedCenter.X - vector2.X; + float num168 = mountedCenter.Y - vector2.Y; + float rotation = (float) Math.Atan2((double) num168, (double) num167) - 1.57f; + if (projectile.alpha == 0) + { + int num169 = -1; + if ((double) projectile.position.X + (double) (projectile.width / 2) < (double) mountedCenter.X) + num169 = 1; + Main.player[projectile.owner].itemRotation = Main.player[projectile.owner].direction != 1 ? (float) Math.Atan2((double) num168 * (double) num169, (double) num167 * (double) num169) : (float) Math.Atan2((double) num168 * (double) num169, (double) num167 * (double) num169); + } + bool flag = true; + while (flag) + { + float f = (float) Math.Sqrt((double) num167 * (double) num167 + (double) num168 * (double) num168); + if ((double) f < 25.0) + flag = false; + else if (float.IsNaN(f)) + { + flag = false; + } + else + { + float num170 = 12f / f; + float num171 = num167 * num170; + float num172 = num168 * num170; + vector2.X += num171; + vector2.Y += num172; + num167 = mountedCenter.X - vector2.X; + num168 = mountedCenter.Y - vector2.Y; + Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); + Main.spriteBatch.Draw(Main.chain23Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain23Texture.Width, Main.chain23Texture.Height)), color, rotation, new Vector2((float) Main.chain23Texture.Width * 0.5f, (float) Main.chain23Texture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); + } + } + } + else if (projectile.type == 481) + { + float x8 = projectile.Center.X; + float y8 = projectile.Center.Y; + float x9 = projectile.velocity.X; + float y9 = projectile.velocity.Y; + float num173 = 4f / (float) Math.Sqrt((double) x9 * (double) x9 + (double) y9 * (double) y9); + float x10; + float y10; + if ((double) projectile.ai[0] == 0.0) + { + x10 = x8 - projectile.velocity.X * num173; + y10 = y8 - projectile.velocity.Y * num173; + } + else + { + x10 = x8 + projectile.velocity.X * num173; + y10 = y8 + projectile.velocity.Y * num173; + } + Vector2 vector2 = new Vector2(x10, y10); + float num174 = mountedCenter.X - vector2.X; + float num175 = mountedCenter.Y - vector2.Y; + float rotation = (float) Math.Atan2((double) num175, (double) num174) - 1.57f; + if (projectile.alpha == 0) + { + int num176 = -1; + if ((double) projectile.position.X + (double) (projectile.width / 2) < (double) mountedCenter.X) + num176 = 1; + Main.player[projectile.owner].itemRotation = Main.player[projectile.owner].direction != 1 ? (float) Math.Atan2((double) num175 * (double) num176, (double) num174 * (double) num176) : (float) Math.Atan2((double) num175 * (double) num176, (double) num174 * (double) num176); + } + bool flag = true; + while (flag) + { + float scale = 0.85f; + float f5 = (float) Math.Sqrt((double) num174 * (double) num174 + (double) num175 * (double) num175); + float num177 = f5; + if ((double) f5 < (double) Main.chain40Texture.Height * 1.5) + flag = false; + else if (float.IsNaN(f5)) + { + flag = false; + } + else + { + float num178 = (float) Main.chain40Texture.Height * scale / f5; + float num179 = num174 * num178; + float num180 = num175 * num178; + vector2.X += num179; + vector2.Y += num180; + num174 = mountedCenter.X - vector2.X; + num175 = mountedCenter.Y - vector2.Y; + if ((double) num177 > (double) (Main.chain40Texture.Height * 2)) + { + for (int index = 0; index < 2; ++index) + { + float num181 = 0.75f; + float num182 = index != 0 ? Math.Abs(Main.player[projectile.owner].velocity.Y) : Math.Abs(Main.player[projectile.owner].velocity.X); + if ((double) num182 > 10.0) + num182 = 10f; + float num183 = num182 / 10f; + float num184 = num181 * num183; + float num185 = num177 / 80f; + if ((double) num185 > 1.0) + num185 = 1f; + float f6 = num184 * num185; + if ((double) f6 < 0.0) + f6 = 0.0f; + if (!float.IsNaN(f6)) + { + if (index == 0) + { + if ((double) Main.player[projectile.owner].velocity.X < 0.0 && (double) projectile.Center.X < (double) mountedCenter.X) + num175 *= 1f - f6; + if ((double) Main.player[projectile.owner].velocity.X > 0.0 && (double) projectile.Center.X > (double) mountedCenter.X) + num175 *= 1f - f6; + } + else + { + if ((double) Main.player[projectile.owner].velocity.Y < 0.0 && (double) projectile.Center.Y < (double) mountedCenter.Y) + num174 *= 1f - f6; + if ((double) Main.player[projectile.owner].velocity.Y > 0.0 && (double) projectile.Center.Y > (double) mountedCenter.Y) + num174 *= 1f - f6; + } + } + } + } + Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); + Main.spriteBatch.Draw(Main.chain40Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain40Texture.Width, Main.chain40Texture.Height)), color, rotation, new Vector2((float) Main.chain40Texture.Width * 0.5f, (float) Main.chain40Texture.Height * 0.5f), scale, SpriteEffects.None, 0.0f); + } + } + } + else if (projectile.type == 271) + { + float x11 = projectile.Center.X; + float y11 = projectile.Center.Y; + float x12 = projectile.velocity.X; + float y12 = projectile.velocity.Y; + float num186 = 4f / (float) Math.Sqrt((double) x12 * (double) x12 + (double) y12 * (double) y12); + float x13; + float y13; + if ((double) projectile.ai[0] == 0.0) + { + x13 = x11 - projectile.velocity.X * num186; + y13 = y11 - projectile.velocity.Y * num186; + } + else + { + x13 = x11 + projectile.velocity.X * num186; + y13 = y11 + projectile.velocity.Y * num186; + } + Vector2 vector2 = new Vector2(x13, y13); + float num187 = mountedCenter.X - vector2.X; + float num188 = mountedCenter.Y - vector2.Y; + float rotation = (float) Math.Atan2((double) num188, (double) num187) - 1.57f; + if (projectile.alpha == 0) + { + int num189 = -1; + if ((double) projectile.position.X + (double) (projectile.width / 2) < (double) mountedCenter.X) + num189 = 1; + Main.player[projectile.owner].itemRotation = Main.player[projectile.owner].direction != 1 ? (float) Math.Atan2((double) num188 * (double) num189, (double) num187 * (double) num189) : (float) Math.Atan2((double) num188 * (double) num189, (double) num187 * (double) num189); + } + bool flag = true; + while (flag) + { + float f = (float) Math.Sqrt((double) num187 * (double) num187 + (double) num188 * (double) num188); + if ((double) f < 25.0) + flag = false; + else if (float.IsNaN(f)) + { + flag = false; + } + else + { + float num190 = 12f / f; + float num191 = num187 * num190; + float num192 = num188 * num190; + vector2.X += num191; + vector2.Y += num192; + num187 = mountedCenter.X - vector2.X; + num188 = mountedCenter.Y - vector2.Y; + Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); + Main.spriteBatch.Draw(Main.chain18Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain18Texture.Width, Main.chain18Texture.Height)), color, rotation, new Vector2((float) Main.chain18Texture.Width * 0.5f, (float) Main.chain18Texture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); + } + } + } + else if (projectile.aiStyle == 13) + { + float num193 = projectile.position.X + 8f; + float num194 = projectile.position.Y + 2f; + float x14 = projectile.velocity.X; + float num195 = projectile.velocity.Y; + if ((double) x14 == 0.0 && (double) num195 == 0.0) + num195 = 0.0001f; + float num196 = 20f / (float) Math.Sqrt((double) x14 * (double) x14 + (double) num195 * (double) num195); + float x15; + float y14; + if ((double) projectile.ai[0] == 0.0) + { + x15 = num193 - projectile.velocity.X * num196; + y14 = num194 - projectile.velocity.Y * num196; + } + else + { + x15 = num193 + projectile.velocity.X * num196; + y14 = num194 + projectile.velocity.Y * num196; + } + Vector2 vector2 = new Vector2(x15, y14); + float num197 = mountedCenter.X - vector2.X; + float num198 = mountedCenter.Y - vector2.Y; + float rotation = (float) Math.Atan2((double) num198, (double) num197) - 1.57f; + if (projectile.alpha == 0) + { + int num199 = -1; + if ((double) projectile.position.X + (double) (projectile.width / 2) < (double) mountedCenter.X) + num199 = 1; + Main.player[projectile.owner].itemRotation = Main.player[projectile.owner].direction != 1 ? (float) Math.Atan2((double) num198 * (double) num199, (double) num197 * (double) num199) : (float) Math.Atan2((double) num198 * (double) num199, (double) num197 * (double) num199); + } + bool flag = true; + while (flag) + { + float f = (float) Math.Sqrt((double) num197 * (double) num197 + (double) num198 * (double) num198); + if ((double) f < 25.0) + flag = false; + else if (float.IsNaN(f)) + { + flag = false; + } + else + { + float num200 = 12f / f; + float num201 = num197 * num200; + float num202 = num198 * num200; + vector2.X += num201; + vector2.Y += num202; + num197 = mountedCenter.X - vector2.X; + num198 = mountedCenter.Y - vector2.Y; + Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); + Main.spriteBatch.Draw(Main.chainTexture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chainTexture.Width, Main.chainTexture.Height)), color, rotation, new Vector2((float) Main.chainTexture.Width * 0.5f, (float) Main.chainTexture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); + } + } + } + else if (projectile.type == 190) + { + float x16 = projectile.position.X + (float) (projectile.width / 2); + float y15 = projectile.position.Y + (float) (projectile.height / 2); + float x17 = projectile.velocity.X; + float y16 = projectile.velocity.Y; + Math.Sqrt((double) x17 * (double) x17 + (double) y16 * (double) y16); + Vector2 vector2 = new Vector2(x16, y15); + float num203 = mountedCenter.X - vector2.X; + float num204 = mountedCenter.Y + Main.player[projectile.owner].gfxOffY - vector2.Y; + Math.Atan2((double) num204, (double) num203); + if (projectile.alpha == 0) + { + int num205 = -1; + if ((double) projectile.position.X + (double) (projectile.width / 2) < (double) mountedCenter.X) + num205 = 1; + Main.player[projectile.owner].itemRotation = Main.player[projectile.owner].direction != 1 ? (float) Math.Atan2((double) num204 * (double) num205, (double) num203 * (double) num205) : (float) Math.Atan2((double) num204 * (double) num205, (double) num203 * (double) num205); + } + } + else if (projectile.aiStyle == 15) + { + Vector2 vector2 = new Vector2(projectile.position.X + (float) projectile.width * 0.5f, projectile.position.Y + (float) projectile.height * 0.5f); + float num206 = mountedCenter.X - vector2.X; + float num207 = mountedCenter.Y - vector2.Y; + float rotation = (float) Math.Atan2((double) num207, (double) num206) - 1.57f; + if (projectile.alpha == 0) + { + int num208 = -1; + if ((double) projectile.position.X + (double) (projectile.width / 2) < (double) mountedCenter.X) + num208 = 1; + Main.player[projectile.owner].itemRotation = Main.player[projectile.owner].direction != 1 ? (float) Math.Atan2((double) num207 * (double) num208, (double) num206 * (double) num208) : (float) Math.Atan2((double) num207 * (double) num208, (double) num206 * (double) num208); + } + bool flag = true; + while (flag) + { + float f = (float) Math.Sqrt((double) num206 * (double) num206 + (double) num207 * (double) num207); + if ((double) f < 25.0) + flag = false; + else if (float.IsNaN(f)) + { + flag = false; + } + else + { + float num209 = projectile.type == 154 || projectile.type == 247 ? 18f / f : 12f / f; + float num210 = num206 * num209; + float num211 = num207 * num209; + vector2.X += num210; + vector2.Y += num211; + num206 = mountedCenter.X - vector2.X; + num207 = mountedCenter.Y - vector2.Y; + Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); + if (projectile.type == 25) + Main.spriteBatch.Draw(Main.chain2Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain2Texture.Width, Main.chain2Texture.Height)), color, rotation, new Vector2((float) Main.chain2Texture.Width * 0.5f, (float) Main.chain2Texture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); + else if (projectile.type == 35) + Main.spriteBatch.Draw(Main.chain6Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain6Texture.Width, Main.chain6Texture.Height)), color, rotation, new Vector2((float) Main.chain6Texture.Width * 0.5f, (float) Main.chain6Texture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); + else if (projectile.type == 247) + Main.spriteBatch.Draw(Main.chain19Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain19Texture.Width, Main.chain19Texture.Height)), color, rotation, new Vector2((float) Main.chain19Texture.Width * 0.5f, (float) Main.chain19Texture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); + else if (projectile.type == 63) + Main.spriteBatch.Draw(Main.chain7Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain7Texture.Width, Main.chain7Texture.Height)), color, rotation, new Vector2((float) Main.chain7Texture.Width * 0.5f, (float) Main.chain7Texture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); + else if (projectile.type == 154) + Main.spriteBatch.Draw(Main.chain13Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain13Texture.Width, Main.chain13Texture.Height)), color, rotation, new Vector2((float) Main.chain13Texture.Width * 0.5f, (float) Main.chain13Texture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); + else + Main.spriteBatch.Draw(Main.chain3Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain3Texture.Width, Main.chain3Texture.Height)), color, rotation, new Vector2((float) Main.chain3Texture.Width * 0.5f, (float) Main.chain3Texture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); + } + } + } + Microsoft.Xna.Framework.Color color3 = Lighting.GetColor((int) ((double) projectile.position.X + (double) projectile.width * 0.5) / 16, (int) (((double) projectile.position.Y + (double) projectile.height * 0.5) / 16.0)); + if (projectile.hide && !ProjectileID.Sets.DontAttachHideToAlpha[projectile.type]) + color3 = Lighting.GetColor((int) mountedCenter.X / 16, (int) ((double) mountedCenter.Y / 16.0)); + if (projectile.type == 14) + color3 = Microsoft.Xna.Framework.Color.White; + int num212 = 0; + int num213 = 0; + if (projectile.type == 175) + num212 = 10; + if (projectile.type == 392) + num212 = -2; + if (projectile.type == 499) + num212 = 12; + if (projectile.bobber) + num212 = 8; + if (projectile.type == 519) + { + num212 = 6; + num213 -= 6; + } + if (projectile.type == 520) + num212 = 12; + if (projectile.type == 492) + { + num213 -= 4; + num212 += 5; + } + if (projectile.type == 498) + num212 = 6; + if (projectile.type == 489) + num212 = -2; + if (projectile.type == 486) + num212 = -6; + if (projectile.type == 525) + num212 = 5; + if (projectile.type == 488) + num213 -= 8; + if (projectile.type == 373) + { + num213 = -10; + num212 = 6; + } + if (projectile.type == 375) + { + num213 = -11; + num212 = 12; + } + if (projectile.type == 423) + num213 = -5; + if (projectile.type == 346) + num212 = 4; + if (projectile.type == 331) + num213 = -4; + if (projectile.type == 254) + num212 = 3; + if (projectile.type == 273) + num213 = 2; + if (projectile.type == 335) + num212 = 6; + if (projectile.type == 162) + { + num212 = 1; + num213 = 1; + } + if (projectile.type == 377) + num212 = -6; + if (projectile.type == 353) + { + num212 = 36; + num213 = -12; + } + if (projectile.type == 324) + { + num212 = 22; + num213 = -6; + } + if (projectile.type == 266) + { + num212 = 10; + num213 = -10; + } + if (projectile.type == 319) + { + num212 = 10; + num213 = -12; + } + if (projectile.type == 315) + { + num212 = -13; + num213 = -6; + } + if (projectile.type == 313 && projectile.height != 54) + { + num213 = -12; + num212 = 20; + } + if (projectile.type == 314) + { + num213 = -8; + num212 = 0; + } + if (projectile.type == 269) + { + num212 = 18; + num213 = -14; + } + if (projectile.type == 268) + { + num212 = 22; + num213 = -2; + } + if (projectile.type == 18) + { + num212 = 3; + num213 = 3; + } + if (projectile.type == 16) + num212 = 6; + if (projectile.type == 17 || projectile.type == 31) + num212 = 2; + if (projectile.type == 25 || projectile.type == 26 || projectile.type == 35 || projectile.type == 63 || projectile.type == 154) + { + num212 = 6; + num213 -= 6; + } + if (projectile.type == 28 || projectile.type == 37 || projectile.type == 75) + num212 = 8; + if (projectile.type == 29 || projectile.type == 470 || projectile.type == 637) + num212 = 11; + if (projectile.type == 43) + num212 = 4; + if (projectile.type == 208) + { + num212 = 2; + num213 -= 12; + } + if (projectile.type == 209) + { + num212 = 4; + num213 -= 8; + } + if (projectile.type == 210) + { + num212 = 2; + num213 -= 22; + } + if (projectile.type == 251) + { + num212 = 18; + num213 -= 10; + } + if (projectile.type == 163 || projectile.type == 310) + num212 = 10; + if (projectile.type == 69 || projectile.type == 70) + { + num212 = 4; + num213 = 4; + } + float x18 = (float) ((double) (Main.projectileTexture[projectile.type].Width - projectile.width) * 0.5 + (double) projectile.width * 0.5); + if (projectile.type == 50 || projectile.type == 53 || projectile.type == 515) + num213 = -8; + if (projectile.type == 473) + { + num213 = -6; + num212 = 2; + } + if (projectile.type == 72 || projectile.type == 86 || projectile.type == 87) + { + num213 = -16; + num212 = 8; + } + if (projectile.type == 74) + num213 = -6; + if (projectile.type == 99) + num212 = 1; + if (projectile.type == 655) + num212 = 1; + if (projectile.type == 111) + { + num212 = 18; + num213 = -16; + } + if (projectile.type == 334) + { + num213 = -18; + num212 = 8; + } + if (projectile.type == 200) + { + num212 = 12; + num213 = -12; + } + if (projectile.type == 211) + { + num212 = 14; + num213 = 0; + } + if (projectile.type == 236) + { + num212 = 30; + num213 = -14; + } + if (projectile.type >= 191 && projectile.type <= 194) + { + num212 = 26; + num213 = projectile.direction != 1 ? -22 : -10; + } + if (projectile.type >= 390 && projectile.type <= 392) + num213 = 4 * projectile.direction; + if (projectile.type == 112) + num212 = 12; + int type1 = projectile.type; + if (projectile.type == 517 || projectile.type == 681) + num212 = 6; + if (projectile.type == 516) + num212 = 6; + if (projectile.type == (int) sbyte.MaxValue) + num212 = 8; + if (projectile.type == 155) + { + num212 = 3; + num213 = 3; + } + if (projectile.type == 397) + { + --x18; + num212 = -2; + num213 = -2; + } + if (projectile.type == 398) + num212 = 8; + SpriteEffects effects1 = SpriteEffects.None; + if (projectile.spriteDirection == -1) + effects1 = SpriteEffects.FlipHorizontally; + if (projectile.type == 681 && (double) projectile.velocity.X > 0.0) + effects1 ^= SpriteEffects.FlipHorizontally; + if (projectile.type == 221) + { + for (int index = 1; index < 10; ++index) + { + float num214 = (float) ((double) projectile.velocity.X * (double) index * 0.5); + float num215 = (float) ((double) projectile.velocity.Y * (double) index * 0.5); + Microsoft.Xna.Framework.Color alpha = projectile.GetAlpha(color3); + float num216 = 0.0f; + if (index == 1) + num216 = 0.9f; + if (index == 2) + num216 = 0.8f; + if (index == 3) + num216 = 0.7f; + if (index == 4) + num216 = 0.6f; + if (index == 5) + num216 = 0.5f; + if (index == 6) + num216 = 0.4f; + if (index == 7) + num216 = 0.3f; + if (index == 8) + num216 = 0.2f; + if (index == 9) + num216 = 0.1f; + alpha.R = (byte) ((double) alpha.R * (double) num216); + alpha.G = (byte) ((double) alpha.G * (double) num216); + alpha.B = (byte) ((double) alpha.B * (double) num216); + alpha.A = (byte) ((double) alpha.A * (double) num216); + int height = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; + int y17 = height * projectile.frame; + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], new Vector2(projectile.position.X - Main.screenPosition.X + x18 + (float) num213 - num214, projectile.position.Y - Main.screenPosition.Y + (float) (projectile.height / 2) + projectile.gfxOffY - num215), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y17, Main.projectileTexture[projectile.type].Width, height)), alpha, projectile.rotation, new Vector2(x18, (float) (projectile.height / 2 + num212)), projectile.scale, effects1, 0.0f); + } + } + if (projectile.type == 408 || projectile.type == 435 || projectile.type == 436 || projectile.type == 438 || projectile.type == 452 || projectile.type == 454 || projectile.type == 459 || projectile.type == 462 || projectile.type == 503 || projectile.type == 532 || projectile.type == 533 || projectile.type == 573 || projectile.type == 582 || projectile.type == 585 || projectile.type == 592 || projectile.type == 601 || projectile.type == 636 || projectile.type == 638 || projectile.type == 640 || projectile.type == 639 || projectile.type == 424 || projectile.type == 425 || projectile.type == 426 || projectile.type == 660 || projectile.type == 661 || projectile.type == 671 || projectile.type == 664 || projectile.type == 666 || projectile.type == 668 || projectile.type == 675 || projectile.type == 680 || projectile.type == 682 || projectile.type == 684 || projectile.type == 686 || projectile.type == 700 || projectile.type == 706 || projectile.type == 709 || projectile.type == 710 || projectile.type == 711) + { + Texture2D texture = Main.projectileTexture[projectile.type]; + int height = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; + Microsoft.Xna.Framework.Rectangle r = new Microsoft.Xna.Framework.Rectangle(0, height * projectile.frame, texture.Width, height); + Vector2 origin = r.Size() / 2f; + if (projectile.type == 503) + origin.Y = 70f; + if (projectile.type == 686 || projectile.type == 711) + origin.Y = (float) (r.Height - 70); + int num217; + if (projectile.type == 438) + num217 = 0; + if (projectile.type == 452) + num217 = 0; + if (projectile.type == 408) + num217 = height; + if (projectile.type == 636) + origin.Y = 10f; + if (projectile.type == 638) + origin.Y = 2f; + if (projectile.type == 640 || projectile.type == 639 || projectile.type == 710) + origin.Y = 5f; + if (projectile.type == 700) + origin.X = projectile.spriteDirection == 1 ? (float) (r.Width - 20) : 20f; + int num218 = 8; + int num219 = 2; + int num220 = 1; + float num221 = 1f; + float num222 = 0.0f; + if (projectile.type == 503) + { + num218 = 9; + num219 = 3; + num221 = 0.5f; + } + else if (projectile.type == 686 || projectile.type == 711) + { + num220 = 19; + num218 = 0; + num219 = -3; + num221 = 0.5f; + } + else if (projectile.type == 671) + { + num220 = 5; + num218 = 0; + num219 = -1; + num221 = 2.6f; + } + else if (projectile.type == 700) + { + num218 = 5; + num219 = 1; + num221 = 2.6f; + } + else if (projectile.type == 664 || projectile.type == 666 || projectile.type == 668) + { + num218 = 8; + num219 = 2; + num221 = 0.4f; + } + else if (projectile.type == 582) + { + num218 = 10; + num219 = 2; + num221 = 0.7f; + num222 = 0.2f; + } + else if (projectile.type == 675) + { + num218 = 5; + num219 = 1; + num221 = 0.4f; + } + else if (projectile.type == 638) + { + num218 = 5; + num219 = 1; + num221 = 1f; + } + else if (projectile.type == 660) + { + num218 = 3; + num219 = 1; + num221 = 8f; + r = new Microsoft.Xna.Framework.Rectangle(38 * projectile.frame, 0, 38, 38); + origin = r.Size() / 2f; + } + else if (projectile.type == 684) + { + num218 = 8; + num219 = 1; + num221 = 0.75f; + } + else if (projectile.type == 639) + { + num218 = 10; + num219 = 1; + num221 = 1f; + } + else if (projectile.type == 710) + { + num220 = 9; + num218 = 0; + num219 = -2; + num221 = 0.5f; + } + else if (projectile.type == 640) + { + num218 = 20; + num219 = 1; + num221 = 1f; + } + else if (projectile.type == 436) + { + num219 = 2; + num221 = 0.5f; + } + else if (projectile.type == 424 || projectile.type == 425 || projectile.type == 426) + { + num218 = 10; + num219 = 2; + num221 = 0.6f; + } + else if (projectile.type == 438) + { + num218 = 10; + num219 = 2; + num221 = 1f; + } + else if (projectile.type == 452) + { + num218 = 10; + num219 = 3; + num221 = 0.5f; + } + else if (projectile.type == 454) + { + num218 = 5; + num219 = 1; + num221 = 0.2f; + } + else if (projectile.type == 462) + { + num218 = 7; + num219 = 1; + num221 = 0.2f; + } + else if (projectile.type == 661) + { + num218 = 0; + num219 = 1; + num221 = 0.5f; + } + else if (projectile.type == 706) + { + num220 = 9; + num218 = 0; + num219 = -2; + num221 = 0.5f; + } + else if (projectile.type == 585) + { + num218 = 7; + num219 = 1; + num221 = 0.2f; + } + else if (projectile.type == 459) + { + num218 = (int) ((double) projectile.scale * 8.0); + num219 = num218 / 4; + if (num219 < 1) + num219 = 1; + num221 = 0.3f; + } + else if (projectile.type == 709) + { + num218 = 8; + num219 = num218 / 4; + if (num219 < 1) + num219 = 1; + num221 = 0.5f; + } + else if (projectile.type == 532) + { + num218 = 10; + num219 = 1; + num221 = 0.7f; + num222 = 0.2f; + } + else if (projectile.type == 592) + { + num218 = 10; + num219 = 2; + num221 = 1f; + } + else if (projectile.type == 601) + { + num218 = 8; + num219 = 1; + num221 = 0.3f; + } + else if (projectile.type == 636) + { + num218 = 20; + num219 = 3; + num221 = 0.5f; + } + else if (projectile.type == 680) + { + num218 = 9; + num219 = 3; + num221 = 0.5f; + } + else if (projectile.type == 533) + { + if ((double) projectile.ai[0] >= 6.0 && (double) projectile.ai[0] <= 8.0) + { + num218 = (double) projectile.ai[0] == 6.0 ? 8 : 4; + num219 = 1; + if ((double) projectile.ai[0] != 7.0) + num222 = 0.2f; + } + else + num218 = num219 = 0; + } + for (int index = num220; num219 > 0 && index < num218 || num219 < 0 && index > num218; index += num219) + { + Microsoft.Xna.Framework.Color newColor = color3; + if (projectile.type == 408 || projectile.type == 435 || projectile.type == 682) + newColor = Microsoft.Xna.Framework.Color.Lerp(newColor, Microsoft.Xna.Framework.Color.Blue, 0.5f); + else if (projectile.type == 436) + newColor = Microsoft.Xna.Framework.Color.Lerp(newColor, Microsoft.Xna.Framework.Color.LimeGreen, 0.5f); + else if (projectile.type >= 424 && projectile.type <= 426) + newColor = Microsoft.Xna.Framework.Color.Lerp(newColor, Microsoft.Xna.Framework.Color.Red, 0.5f); + else if (projectile.type == 640 || projectile.type == 639) + newColor.A = (byte) 127; + else if (projectile.type == 671) + newColor = Microsoft.Xna.Framework.Color.Lerp(newColor, Microsoft.Xna.Framework.Color.Purple, (float) index / (float) num218); + Microsoft.Xna.Framework.Color color4 = projectile.GetAlpha(newColor); + if (projectile.type == 438) + { + color4.G /= (byte) index; + color4.B /= (byte) index; + } + else if (projectile.type == 682) + color4.G /= (byte) index; + else if (projectile.type == 686) + { + if (!(projectile.oldPos[index] == Vector2.Zero)) + { + float t = (float) index / (float) num220; + color4 = (double) t >= 0.5 ? Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Purple, Microsoft.Xna.Framework.Color.Black, Utils.InverseLerp(0.5f, 1f, t)) : Microsoft.Xna.Framework.Color.Lerp(color4, Microsoft.Xna.Framework.Color.Purple, Utils.InverseLerp(0.0f, 0.5f, t)); + } + else + continue; + } + else if (projectile.type == 711) + { + if (!(projectile.oldPos[index] == Vector2.Zero)) + { + float t = (float) index / (float) num220; + color4 = (double) t >= 0.5 ? Microsoft.Xna.Framework.Color.Lerp(new Microsoft.Xna.Framework.Color(128, 0, (int) byte.MaxValue, 180), Microsoft.Xna.Framework.Color.Black, Utils.InverseLerp(0.5f, 1f, t)) : Microsoft.Xna.Framework.Color.Lerp(color4, new Microsoft.Xna.Framework.Color(128, 0, (int) byte.MaxValue, 180), Utils.InverseLerp(0.0f, 0.5f, t)); + } + else + continue; + } + else if (projectile.type == 684) + { + if (index == 1) + { + color4.B /= (byte) 2; + color4.G /= (byte) 2; + color4.A /= (byte) 2; + } + color4.B /= (byte) index; + color4.G /= (byte) index; + color4.A /= (byte) index; + } + else if (projectile.type == 706 || projectile.type == 710) + { + color4.B /= (byte) index; + color4.G /= (byte) index; + color4.A /= (byte) index; + } + else if (projectile.type == 592) + { + color4.R /= (byte) index; + color4.G /= (byte) index; + } + else if (projectile.type == 640) + { + color4.R /= (byte) index; + color4.A /= (byte) index; + } + else if (projectile.type >= 424 && projectile.type <= 426) + { + color4.B /= (byte) index; + color4.G /= (byte) index; + color4.A /= (byte) index; + } + float num223 = (float) (num218 - index); + if (num219 < 0) + num223 = (float) (num220 - index); + Microsoft.Xna.Framework.Color color5 = color4 * (num223 / ((float) ProjectileID.Sets.TrailCacheLength[projectile.type] * 1.5f)); + Vector2 oldPo = projectile.oldPos[index]; + float rotation = projectile.rotation; + SpriteEffects effects2 = effects1; + if (ProjectileID.Sets.TrailingMode[projectile.type] == 2) + { + rotation = projectile.oldRot[index]; + effects2 = projectile.oldSpriteDirection[index] == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + } + Main.spriteBatch.Draw(texture, oldPo + projectile.Size / 2f - Main.screenPosition + new Vector2(0.0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(r), color5, rotation + projectile.rotation * num222 * (float) (index - 1) * (float) -effects1.HasFlag((Enum) SpriteEffects.FlipHorizontally).ToDirectionInt(), origin, MathHelper.Lerp(projectile.scale, num221, (float) index / 15f), effects2, 0.0f); + } + if (projectile.type == 661) + { + Microsoft.Xna.Framework.Color color6 = new Microsoft.Xna.Framework.Color(120, 40, 222, 120); + for (int index = 0; index < 4; ++index) + Main.spriteBatch.Draw(Main.extraTexture[75], projectile.Center - Main.screenPosition + new Vector2(0.0f, projectile.gfxOffY) + projectile.rotation.ToRotationVector2().RotatedBy(1.57079637050629 * (double) index) * 4f, new Microsoft.Xna.Framework.Rectangle?(r), color6, projectile.rotation, origin, projectile.scale, effects1, 0.0f); + } + else if (projectile.type == 684) + { + float x19 = ((float) ((double) projectile.localAI[0] * 6.28318548202515 / 30.0)).ToRotationVector2().X; + Microsoft.Xna.Framework.Color color7 = new Microsoft.Xna.Framework.Color(220, 40, 30, 40) * (float) (0.75 + 0.25 * (double) x19); + for (int index = 0; index < 8; ++index) + Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition + new Vector2(0.0f, projectile.gfxOffY) + projectile.rotation.ToRotationVector2().RotatedBy(0.785398185253143 * (double) index) * (float) (4.0 + 1.0 * (double) x19), new Microsoft.Xna.Framework.Rectangle?(r), color7, projectile.rotation, origin, projectile.scale, effects1, 0.0f); + } + Microsoft.Xna.Framework.Color color8 = projectile.GetAlpha(color3); + if (projectile.type == 640) + color8 = Microsoft.Xna.Framework.Color.Transparent; + if (projectile.type == 684) + color8.A = (byte) 127; + Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition + new Vector2(0.0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(r), color8, projectile.rotation, origin, projectile.scale, effects1, 0.0f); + if (projectile.type == 503) + Main.spriteBatch.Draw(Main.extraTexture[36], projectile.Center - Main.screenPosition + new Vector2(0.0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(r), Microsoft.Xna.Framework.Color.White, projectile.localAI[0], origin, projectile.scale, effects1, 0.0f); + else if (projectile.type == 533) + Main.spriteBatch.Draw(Main.glowMaskTexture[128], projectile.Center - Main.screenPosition + new Vector2(0.0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(r), Microsoft.Xna.Framework.Color.White * 0.3f, projectile.rotation, origin, projectile.scale, effects1, 0.0f); + else if (projectile.type == 601) + { + Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; + white.A = (byte) 0; + Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition + new Vector2(0.0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(r), white, projectile.rotation, origin, projectile.scale * 0.7f, effects1, 0.0f); + } + } + else if (projectile.type == 672) + { + Vector2 position = projectile.Center - Main.screenPosition; + if ((double) projectile.localAI[1] == 0.0) + { + position.Y += 60f; + float num224 = projectile.localAI[0] / 120f; + for (int index = 0; index < 4; ++index) + { + float num225 = MathHelper.Clamp((float) ((double) num224 * 2.0 - (double) index / 3.0), 0.0f, 1f); + float num226 = 1f - MathHelper.Clamp((float) (((double) num224 - 0.800000011920929) / 0.200000002980232), 0.0f, 1f); + Main.spriteBatch.Draw(Main.magicPixel, position, new Microsoft.Xna.Framework.Rectangle?(), new Microsoft.Xna.Framework.Color(0.4f, 0.17f, 0.4f, 0.0f) * (num225 * num226) * 1.3f, 0.0f, new Vector2((float) Main.magicPixel.Width / 2f, (float) Main.magicPixel.Height), new Vector2((float) Math.Sqrt((double) num225) * 100f, num225 * 2f), SpriteEffects.None, 0.0f); + } + } + else if ((double) projectile.localAI[1] == 1.0) + { + double num227 = (double) projectile.localAI[0] / 300.0; + float num228 = Math.Min(1f, projectile.localAI[0] / 30f); + int frameNumber = (int) ((double) Main.GlobalTime * 10.0) % 8; + this.DrawElderEye(Main.spriteBatch, projectile.Center, 1f, 1f, frameNumber, Microsoft.Xna.Framework.Color.White * num228); + this.DrawElderEye(Main.spriteBatch, projectile.Center, 1f, 1f, (frameNumber + 1) % 8, new Microsoft.Xna.Framework.Color(0.2f, 0.2f, 0.2f, 0.0f) * num228); + } + else if ((double) projectile.localAI[1] == 2.0) + { + int frameNumber = (int) ((double) Main.GlobalTime * 10.0) % 8; + this.DrawElderEye(Main.spriteBatch, projectile.Center, 1f, 1f, frameNumber, Microsoft.Xna.Framework.Color.White); + this.DrawElderEye(Main.spriteBatch, projectile.Center, 1f, 1f, (frameNumber + 1) % 8, new Microsoft.Xna.Framework.Color(0.2f, 0.2f, 0.2f, 0.0f)); + } + } + else if (projectile.type != 713) + { + if (projectile.type == 674) + { + Texture2D texture = Main.extraTexture[60]; + Vector2 origin = new Vector2(66f, 86f); + Vector2 position = projectile.Center - Main.screenPosition; + Vector2 one = Vector2.One; + Vector2 vector2_8 = new Vector2(4f, 1f) * 1.4f; + Microsoft.Xna.Framework.Color color9 = new Microsoft.Xna.Framework.Color(115, 0, 155, 0); + Microsoft.Xna.Framework.Color color10 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, 180, (int) byte.MaxValue, 0); + float t = 0.0f; + if ((double) projectile.ai[0] < 30.0) + t = Utils.InverseLerp(0.0f, 30f, projectile.ai[0], true); + else if ((double) projectile.ai[0] < 40.0) + t = 1f + Utils.InverseLerp(30f, 40f, projectile.ai[0], true); + Vector2 vector2_9 = new Vector2(1f, 1f); + Vector2 vector2_10 = new Vector2(0.8f, 2f); + if ((double) t < 1.0) + vector2_9.X *= t; + Vector2 vector2_11 = vector2_8 * t; + if ((double) t < 1.0) + { + color9 *= t; + color10 *= t; + } + if ((double) t > 1.5) + { + float num229 = Utils.InverseLerp(2f, 1.5f, t, true); + color9 *= num229; + color10 *= num229; + } + float num230 = 0.42f; + Microsoft.Xna.Framework.Color color11 = color9 * num230; + Microsoft.Xna.Framework.Color color12 = color10 * num230; + Main.spriteBatch.Draw(texture, position, new Microsoft.Xna.Framework.Rectangle?(), color11, 0.0f, origin, vector2_11 * vector2_9, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(texture, position, new Microsoft.Xna.Framework.Rectangle?(), color12, 0.0f, origin, vector2_11 * vector2_10, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.extraTexture[59], position, new Microsoft.Xna.Framework.Rectangle?(), color11, 0.0f, origin, vector2_11 * vector2_9 * new Vector2(1f, 0.3f), SpriteEffects.None, 0.0f); + } + else if (projectile.type == 440 || projectile.type == 449 || projectile.type == 606) + { + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle((int) Main.screenPosition.X - 500, (int) Main.screenPosition.Y - 500, Main.screenWidth + 1000, Main.screenHeight + 1000); + if (projectile.getRect().Intersects(rectangle)) + { + Vector2 vector2_12 = new Vector2(projectile.position.X - Main.screenPosition.X + x18 + (float) num213, projectile.position.Y - Main.screenPosition.Y + (float) (projectile.height / 2) + projectile.gfxOffY); + float num231 = 100f; + float num232 = 3f; + if (projectile.type == 606) + { + num231 = 150f; + num232 = 3f; + } + if ((double) projectile.ai[1] == 1.0) + num231 = (float) (int) projectile.localAI[0]; + for (int index = 1; index <= (int) projectile.localAI[0]; ++index) + { + Vector2 vector2_13 = Vector2.Normalize(projectile.velocity) * (float) index * num232; + Microsoft.Xna.Framework.Color color13 = projectile.GetAlpha(color3) * ((num231 - (float) index) / num231); + color13.A = (byte) 0; + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], vector2_12 - vector2_13, new Microsoft.Xna.Framework.Rectangle?(), color13, projectile.rotation, new Vector2(x18, (float) (projectile.height / 2 + num212)), projectile.scale, effects1, 0.0f); } } } - for (int index4 = vector2List.Count - 2; index4 >= 0; --index4) + else if (projectile.type == 687) { - Vector2 vector2_12 = vector2List[index4]; - Vector2 vector2_13 = vector2List[index4 + 1]; - Vector2 v3 = vector2_13 - vector2_12; - double num43 = (double) v3.Length(); - float rotation = v3.ToRotation() - 1.570796f + num1; - Main.EntitySpriteDraw(texture2D2, vector2_13 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(r2), alpha, rotation, origin3, proj.scale, effects, 0); - r2.X -= width; - if (r2.X < 0) + Vector2 vector2_14 = projectile.Center - Main.screenPosition; + float num233 = 40f; + float num234 = num233 * 2f; + float num235 = (float) projectile.frameCounter / num233; + Texture2D texture2D = Main.projectileTexture[projectile.type]; + Microsoft.Xna.Framework.Color transparent = Microsoft.Xna.Framework.Color.Transparent; + Microsoft.Xna.Framework.Color color14 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); + Microsoft.Xna.Framework.Color color15 = new Microsoft.Xna.Framework.Color(180, 30, 30, 200); + Microsoft.Xna.Framework.Color color16 = new Microsoft.Xna.Framework.Color(0, 0, 0, 30); + ulong seed = 1; + for (float num236 = 0.0f; (double) num236 < 15.0; ++num236) { - int num44 = num11; - if (flag2) - --num44; - r2.X = num44 * width; + float num237 = (float) ((double) Utils.RandomFloat(ref seed) * 0.25 - 0.125); + Vector2 rotationVector2 = (projectile.rotation + num237).ToRotationVector2(); + Vector2 vector2_15 = vector2_14 + rotationVector2 * 400f; + float num238 = num235 + num236 * 0.06666667f; + int num239 = (int) ((double) num238 / 0.0666666701436043); + float num240 = num238 % 1f; + if (((double) num240 <= (double) num235 % 1.0 || (double) projectile.frameCounter >= (double) num233) && ((double) num240 >= (double) num235 % 1.0 || (double) projectile.frameCounter < (double) num234 - (double) num233)) + { + Microsoft.Xna.Framework.Color color17 = (double) num240 >= 0.100000001490116 ? ((double) num240 >= 0.349999994039536 ? ((double) num240 >= 0.699999988079071 ? ((double) num240 >= 0.899999976158142 ? ((double) num240 >= 1.0 ? Microsoft.Xna.Framework.Color.Transparent : Microsoft.Xna.Framework.Color.Lerp(color16, Microsoft.Xna.Framework.Color.Transparent, Utils.InverseLerp(0.9f, 1f, num240, true))) : Microsoft.Xna.Framework.Color.Lerp(color15, color16, Utils.InverseLerp(0.7f, 0.9f, num240, true))) : Microsoft.Xna.Framework.Color.Lerp(color14, color15, Utils.InverseLerp(0.35f, 0.7f, num240, true))) : color14) : Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, color14, Utils.InverseLerp(0.0f, 0.1f, num240, true)); + float num241 = (float) (0.899999976158142 + (double) num240 * 0.800000011920929); + float scale = num241 * num241 * 0.8f; + Vector2 position = Vector2.SmoothStep(vector2_14, vector2_15, num240); + Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: 7, frameY: ((int) ((double) num240 * 7.0))); + Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(r), color17, (float) ((double) projectile.rotation + 6.28318548202515 * ((double) num240 + (double) Main.GlobalTime * 1.20000004768372) * 0.200000002980232 + (double) num239 * 1.25663709640503), r.Size() / 2f, scale, SpriteEffects.None, 0.0f); + } + } + } + else if (projectile.type == 651) + { + Player player = Main.player[projectile.owner]; + Microsoft.Xna.Framework.Point point = new Vector2(projectile.ai[0], projectile.ai[1]).ToPoint(); + Microsoft.Xna.Framework.Point tileCoordinates = projectile.Center.ToTileCoordinates(); + Microsoft.Xna.Framework.Color color18 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); + Microsoft.Xna.Framework.Color color19 = new Microsoft.Xna.Framework.Color((int) sbyte.MaxValue, (int) sbyte.MaxValue, (int) sbyte.MaxValue, 0); + int num242 = 1; + float num243 = 0.0f; + WiresUI.Settings.MultiToolMode toolMode = WiresUI.Settings.ToolMode; + bool flag1 = toolMode.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Actuator); + if (toolMode.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Red)) + { + ++num243; + color19 = Microsoft.Xna.Framework.Color.Lerp(color19, Microsoft.Xna.Framework.Color.Red, 1f / num243); + } + if (toolMode.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Blue)) + { + ++num243; + color19 = Microsoft.Xna.Framework.Color.Lerp(color19, Microsoft.Xna.Framework.Color.Blue, 1f / num243); + } + if (toolMode.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Green)) + { + ++num243; + color19 = Microsoft.Xna.Framework.Color.Lerp(color19, new Microsoft.Xna.Framework.Color(0, (int) byte.MaxValue, 0), 1f / num243); + } + if (toolMode.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Yellow)) + { + float num244 = num243 + 1f; + color19 = Microsoft.Xna.Framework.Color.Lerp(color19, new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, 0), 1f / num244); + } + if (toolMode.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Cutter)) + color18 = new Microsoft.Xna.Framework.Color(50, 50, 50, (int) byte.MaxValue); + color19.A = (byte) 0; + if (point == tileCoordinates) + { + Vector2 position = tileCoordinates.ToVector2() * 16f - Main.screenPosition; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, 0, 16, 16); + if (flag1) + Main.spriteBatch.Draw(Main.wireUITexture[11], position, new Microsoft.Xna.Framework.Rectangle?(), color18, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], position, new Microsoft.Xna.Framework.Rectangle?(rectangle), color19, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + rectangle.Y = 18; + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], position, new Microsoft.Xna.Framework.Rectangle?(rectangle), color18, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + else if (point.X == tileCoordinates.X) + { + int num245 = tileCoordinates.Y - point.Y; + int num246 = Math.Sign(num245); + Vector2 position1 = point.ToVector2() * 16f - Main.screenPosition; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(num245 * num242 > 0 ? 72 : 18, 0, 16, 16); + if (flag1) + Main.spriteBatch.Draw(Main.wireUITexture[11], position1, new Microsoft.Xna.Framework.Rectangle?(), color18, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], position1, new Microsoft.Xna.Framework.Rectangle?(rectangle), color19, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + rectangle.Y = 18; + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], position1, new Microsoft.Xna.Framework.Rectangle?(rectangle), color18, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + for (int index = point.Y + num246; index != tileCoordinates.Y; index += num246) + { + Vector2 position2 = new Vector2((float) (point.X * 16), (float) (index * 16)) - Main.screenPosition; + rectangle.Y = 0; + rectangle.X = 90; + if (flag1) + Main.spriteBatch.Draw(Main.wireUITexture[11], position2, new Microsoft.Xna.Framework.Rectangle?(), color18, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], position2, new Microsoft.Xna.Framework.Rectangle?(rectangle), color19, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + rectangle.Y = 18; + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], position2, new Microsoft.Xna.Framework.Rectangle?(rectangle), color18, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + Vector2 position3 = tileCoordinates.ToVector2() * 16f - Main.screenPosition; + rectangle = new Microsoft.Xna.Framework.Rectangle(num245 * num242 > 0 ? 18 : 72, 0, 16, 16); + if (flag1) + Main.spriteBatch.Draw(Main.wireUITexture[11], position3, new Microsoft.Xna.Framework.Rectangle?(), color18, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], position3, new Microsoft.Xna.Framework.Rectangle?(rectangle), color19, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + rectangle.Y = 18; + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], position3, new Microsoft.Xna.Framework.Rectangle?(rectangle), color18, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + else if (point.Y == tileCoordinates.Y) + { + int num247 = tileCoordinates.X - point.X; + int num248 = Math.Sign(num247); + Vector2 position4 = point.ToVector2() * 16f - Main.screenPosition; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(num247 > 0 ? 36 : 144, 0, 16, 16); + if (flag1) + Main.spriteBatch.Draw(Main.wireUITexture[11], position4, new Microsoft.Xna.Framework.Rectangle?(), color18, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], position4, new Microsoft.Xna.Framework.Rectangle?(rectangle), color19, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + rectangle.Y = 18; + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], position4, new Microsoft.Xna.Framework.Rectangle?(rectangle), color18, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + for (int index = point.X + num248; index != tileCoordinates.X; index += num248) + { + Vector2 position5 = new Vector2((float) (index * 16), (float) (point.Y * 16)) - Main.screenPosition; + rectangle.Y = 0; + rectangle.X = 180; + if (flag1) + Main.spriteBatch.Draw(Main.wireUITexture[11], position5, new Microsoft.Xna.Framework.Rectangle?(), color18, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], position5, new Microsoft.Xna.Framework.Rectangle?(rectangle), color19, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + rectangle.Y = 18; + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], position5, new Microsoft.Xna.Framework.Rectangle?(rectangle), color18, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + Vector2 position6 = tileCoordinates.ToVector2() * 16f - Main.screenPosition; + rectangle = new Microsoft.Xna.Framework.Rectangle(num247 > 0 ? 144 : 36, 0, 16, 16); + if (flag1) + Main.spriteBatch.Draw(Main.wireUITexture[11], position6, new Microsoft.Xna.Framework.Rectangle?(), color18, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], position6, new Microsoft.Xna.Framework.Rectangle?(rectangle), color19, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + rectangle.Y = 18; + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], position6, new Microsoft.Xna.Framework.Rectangle?(rectangle), color18, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + else + { + Math.Abs(point.X - tileCoordinates.X); + Math.Abs(point.Y - tileCoordinates.Y); + int num249 = Math.Sign(tileCoordinates.X - point.X); + int num250 = Math.Sign(tileCoordinates.Y - point.Y); + Microsoft.Xna.Framework.Point p = new Microsoft.Xna.Framework.Point(); + bool flag2 = false; + bool flag3 = player.direction == 1; + int num251; + int num252; + int num253; + if (flag3) + { + p.X = point.X; + num251 = point.Y; + num252 = tileCoordinates.Y; + num253 = num250; + } + else + { + p.Y = point.Y; + num251 = point.X; + num252 = tileCoordinates.X; + num253 = num249; + } + Vector2 position7 = point.ToVector2() * 16f - Main.screenPosition; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, 0, 16, 16); + rectangle.X = flag3 ? (num253 > 0 ? 72 : 18) : (num253 > 0 ? 36 : 144); + if (flag1) + Main.spriteBatch.Draw(Main.wireUITexture[11], position7, new Microsoft.Xna.Framework.Rectangle?(), color18, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], position7, new Microsoft.Xna.Framework.Rectangle?(rectangle), color19, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + rectangle.Y = 18; + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], position7, new Microsoft.Xna.Framework.Rectangle?(rectangle), color18, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + for (int index = num251 + num253; index != num252 && !flag2; index += num253) + { + if (flag3) + p.Y = index; + else + p.X = index; + if (WorldGen.InWorld(p.X, p.Y, 1) && Main.tile[p.X, p.Y] != null) + { + Vector2 position8 = p.ToVector2() * 16f - Main.screenPosition; + rectangle.Y = 0; + rectangle.X = flag3 ? 90 : 180; + if (flag1) + Main.spriteBatch.Draw(Main.wireUITexture[11], position8, new Microsoft.Xna.Framework.Rectangle?(), color18, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], position8, new Microsoft.Xna.Framework.Rectangle?(rectangle), color19, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + rectangle.Y = 18; + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], position8, new Microsoft.Xna.Framework.Rectangle?(rectangle), color18, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } + int num254; + int num255; + int num256; + if (flag3) + { + p.Y = tileCoordinates.Y; + num254 = point.X; + num255 = tileCoordinates.X; + num256 = num249; + } + else + { + p.X = tileCoordinates.X; + num254 = point.Y; + num255 = tileCoordinates.Y; + num256 = num250; + } + Vector2 position9 = p.ToVector2() * 16f - Main.screenPosition; + rectangle = new Microsoft.Xna.Framework.Rectangle(0, 0, 16, 16); + if (!flag3) + { + rectangle.X += num249 > 0 ? 144 : 36; + rectangle.X += num250 * num242 > 0 ? 72 : 18; + } + else + { + rectangle.X += num249 > 0 ? 36 : 144; + rectangle.X += num250 * num242 > 0 ? 18 : 72; + } + if (flag1) + Main.spriteBatch.Draw(Main.wireUITexture[11], position9, new Microsoft.Xna.Framework.Rectangle?(), color18, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], position9, new Microsoft.Xna.Framework.Rectangle?(rectangle), color19, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + rectangle.Y = 18; + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], position9, new Microsoft.Xna.Framework.Rectangle?(rectangle), color18, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + for (int index = num254 + num256; index != num255 && !flag2; index += num256) + { + if (!flag3) + p.Y = index; + else + p.X = index; + if (WorldGen.InWorld(p.X, p.Y, 1) && Main.tile[p.X, p.Y] != null) + { + Vector2 position10 = p.ToVector2() * 16f - Main.screenPosition; + rectangle.Y = 0; + rectangle.X = flag3 ? 180 : 90; + if (flag1) + Main.spriteBatch.Draw(Main.wireUITexture[11], position10, new Microsoft.Xna.Framework.Rectangle?(), color18, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], position10, new Microsoft.Xna.Framework.Rectangle?(rectangle), color19, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + rectangle.Y = 18; + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], position10, new Microsoft.Xna.Framework.Rectangle?(rectangle), color18, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } + Vector2 position11 = tileCoordinates.ToVector2() * 16f - Main.screenPosition; + rectangle = new Microsoft.Xna.Framework.Rectangle(0, 0, 16, 16); + if (!flag3) + rectangle.X += num250 * num242 > 0 ? 18 : 72; + else + rectangle.X += num249 > 0 ? 144 : 36; + if (flag1) + Main.spriteBatch.Draw(Main.wireUITexture[11], position11, new Microsoft.Xna.Framework.Rectangle?(), color18, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], position11, new Microsoft.Xna.Framework.Rectangle?(rectangle), color19, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + rectangle.Y = 18; + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], position11, new Microsoft.Xna.Framework.Rectangle?(rectangle), color18, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } + else if (projectile.type == 586) + { + float num257 = 300f; + if ((double) projectile.ai[0] >= 100.0) + num257 = MathHelper.Lerp(300f, 600f, (float) (((double) projectile.ai[0] - 100.0) / 200.0)); + if ((double) num257 > 600.0) + num257 = 600f; + if ((double) projectile.ai[0] >= 500.0) + num257 = MathHelper.Lerp(600f, 1200f, (float) (((double) projectile.ai[0] - 500.0) / 100.0)); + float rotation1 = projectile.rotation; + Texture2D texture2D = Main.projectileTexture[projectile.type]; + Microsoft.Xna.Framework.Color alpha = projectile.GetAlpha(color3); + alpha.A /= (byte) 2; + int num258 = (int) ((double) projectile.ai[0] / 6.0); + Vector2 spinningpoint = new Vector2(0.0f, -num257); + for (int index = 0; (double) index < 10.0; ++index) + { + Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: 5, frameY: ((num258 + index) % 5)); + float rotation2 = rotation1 + 0.6283185f * (float) index; + Vector2 position = spinningpoint.RotatedBy((double) rotation2) / 3f + projectile.Center - Main.screenPosition; + Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(r), alpha, rotation2, r.Size() / 2f, projectile.scale, SpriteEffects.None, 0.0f); + } + for (int index = 0; (double) index < 20.0; ++index) + { + Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: 5, frameY: ((num258 + index) % 5)); + float rotation3 = (float) (-(double) rotation1 + 0.314159274101257 * (double) index) * 2f; + Vector2 position = spinningpoint.RotatedBy((double) rotation3) + projectile.Center - Main.screenPosition; + Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(r), alpha, rotation3, r.Size() / 2f, projectile.scale, SpriteEffects.None, 0.0f); + } + } + else if (projectile.type == 536 || projectile.type == 591 || projectile.type == 607) + { + Texture2D texture2D = Main.projectileTexture[projectile.type]; + Vector2 position = projectile.position + new Vector2((float) projectile.width, (float) projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Vector2 scale = new Vector2(1f, projectile.velocity.Length() / (float) texture2D.Height); + Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(), projectile.GetAlpha(color3), projectile.rotation, texture2D.Frame().Bottom(), scale, effects1, 0.0f); + } + else if (projectile.type == 688 || projectile.type == 689 || projectile.type == 690) + { + Texture2D texture2D1 = Main.projectileTexture[projectile.type]; + Vector2 position12 = projectile.Top + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Microsoft.Xna.Framework.Rectangle r1 = texture2D1.Frame(verticalFrames: Main.projFrames[projectile.type], frameY: projectile.frame); + Vector2 origin1 = r1.Size() * new Vector2(0.5f, 0.0f); + Microsoft.Xna.Framework.Color color20 = Microsoft.Xna.Framework.Color.Lerp(projectile.GetAlpha(color3), Microsoft.Xna.Framework.Color.White, 0.5f); + Microsoft.Xna.Framework.Color color21 = color20; + color21.A = (byte) 127; + Texture2D texture = (Texture2D) null; + Texture2D texture2D2 = (Texture2D) null; + switch (projectile.type) + { + case 688: + texture = Main.glowMaskTexture[228]; + texture2D2 = Main.extraTexture[86]; + break; + case 689: + texture = Main.glowMaskTexture[229]; + texture2D2 = Main.extraTexture[87]; + break; + case 690: + texture = Main.glowMaskTexture[230]; + texture2D2 = Main.extraTexture[88]; + break; + } + Main.spriteBatch.Draw(texture2D1, position12, new Microsoft.Xna.Framework.Rectangle?(r1), color20, projectile.rotation, origin1, projectile.scale, effects1, 0.0f); + if (texture != null) + Main.spriteBatch.Draw(texture, position12, new Microsoft.Xna.Framework.Rectangle?(r1), color21, projectile.rotation, origin1, projectile.scale, effects1, 0.0f); + if (texture2D2 != null) + { + Vector2 position13 = projectile.Center + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Microsoft.Xna.Framework.Rectangle r2 = texture2D2.Frame(); + Vector2 origin2 = r2.Size() * new Vector2(0.5f, 1f); + origin2.Y -= 2f; + Main.spriteBatch.Draw(texture2D2, position13, new Microsoft.Xna.Framework.Rectangle?(r2), color20, projectile.rotation, origin2, projectile.scale, effects1, 0.0f); + } + } + else if (projectile.type == 694 || projectile.type == 695 || projectile.type == 696) + { + Texture2D texture2D = Main.projectileTexture[projectile.type]; + Vector2 position = projectile.Bottom + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: Main.projFrames[projectile.type], frameY: projectile.frame); + Vector2 origin = r.Size() * new Vector2(0.5f, 1f); + origin.Y -= 8f; + switch (projectile.type) + { + case 694: + case 695: + origin.X += 3f; + break; + } + Microsoft.Xna.Framework.Color color22 = Microsoft.Xna.Framework.Color.Lerp(projectile.GetAlpha(color3), Microsoft.Xna.Framework.Color.White, 0.0f); + Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(r), color22, projectile.rotation, origin, projectile.scale, effects1, 0.0f); + Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(r), color22 * 0.3f, projectile.rotation, origin, projectile.scale * 1.1f, effects1, 0.0f); + } + else if (projectile.type == 409) + { + Texture2D texture = Main.projectileTexture[projectile.type]; + int height = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; + int y18 = height * projectile.frame; + int num259 = 10; + int num260 = 2; + float num261 = 0.5f; + for (int index = 1; index < num259; index += num260) + { + ref Vector2 local = ref projectile.oldPos[index]; + Microsoft.Xna.Framework.Color newColor = color3; + Microsoft.Xna.Framework.Color color23 = projectile.GetAlpha(newColor) * ((float) (num259 - index) / 15f); + Vector2 vector2 = projectile.oldPos[index] - Main.screenPosition + new Vector2(x18 + (float) num213, (float) (projectile.height / 2) + projectile.gfxOffY); + Main.spriteBatch.Draw(texture, projectile.oldPos[index] + new Vector2((float) projectile.width, (float) projectile.height) / 2f - Main.screenPosition + new Vector2(0.0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y18, texture.Width, height)), color23, projectile.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), MathHelper.Lerp(projectile.scale, num261, (float) index / 15f), effects1, 0.0f); + } + Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition + new Vector2(0.0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y18, texture.Width, height)), projectile.GetAlpha(color3), projectile.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), projectile.scale, effects1, 0.0f); + } + else if (projectile.type == 437) + { + Texture2D texture = Main.projectileTexture[projectile.type]; + int height = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; + int y19 = height * projectile.frame; + int num262 = 10; + int num263 = 2; + float num264 = 0.2f; + for (int index = 1; index < num262; index += num263) + { + ref Vector2 local = ref Main.npc[i].oldPos[index]; + Microsoft.Xna.Framework.Color newColor = color3; + Microsoft.Xna.Framework.Color color24 = projectile.GetAlpha(newColor) * ((float) (num262 - index) / 15f); + Vector2 vector2 = projectile.oldPos[index] - Main.screenPosition + new Vector2(x18 + (float) num213, (float) (projectile.height / 2) + projectile.gfxOffY); + Main.spriteBatch.Draw(texture, projectile.oldPos[index] + new Vector2((float) projectile.width, (float) projectile.height) / 2f - Main.screenPosition + new Vector2(0.0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y19, texture.Width, height)), color24, projectile.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), MathHelper.Lerp(projectile.scale, num264, (float) index / 15f), effects1, 0.0f); + } + Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition + new Vector2(0.0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y19, texture.Width, height)), Microsoft.Xna.Framework.Color.White, projectile.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), projectile.scale + 0.2f, effects1, 0.0f); + Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition + new Vector2(0.0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y19, texture.Width, height)), projectile.GetAlpha(Microsoft.Xna.Framework.Color.White), projectile.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), projectile.scale + 0.2f, effects1, 0.0f); + } + else if (projectile.type == 384 || projectile.type == 386) + { + Texture2D texture = Main.projectileTexture[projectile.type]; + int height = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; + int y20 = height * projectile.frame; + Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition + new Vector2(0.0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y20, texture.Width, height)), projectile.GetAlpha(color3), projectile.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), projectile.scale, effects1, 0.0f); + } + else if (projectile.type == 439 || projectile.type == 460 || projectile.type == 600 || projectile.type == 615 || projectile.type == 630 || projectile.type == 633 || projectile.type == 705) + { + Texture2D texture = Main.projectileTexture[projectile.type]; + int height = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; + int y21 = height * projectile.frame; + Vector2 position = (projectile.position + new Vector2((float) projectile.width, (float) projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition).Floor(); + float num265 = 1f; + if (Main.player[projectile.owner].shroomiteStealth && Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].ranged) + { + float num266 = Main.player[projectile.owner].stealth; + if ((double) num266 < 0.03) + num266 = 0.03f; + double num267 = (1.0 + (double) num266 * 10.0) / 11.0; + color3 *= num266; + num265 = num266; + } + if (Main.player[projectile.owner].setVortex && Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].ranged) + { + float num268 = Main.player[projectile.owner].stealth; + if ((double) num268 < 0.03) + num268 = 0.03f; + double num269 = (1.0 + (double) num268 * 10.0) / 11.0; + color3 = color3.MultiplyRGBA(new Microsoft.Xna.Framework.Color(Vector4.Lerp(Vector4.One, new Vector4(0.0f, 0.12f, 0.16f, 0.0f), 1f - num268))); + num265 = num268; + } + Main.spriteBatch.Draw(texture, position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y21, texture.Width, height)), projectile.GetAlpha(color3), projectile.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), projectile.scale, effects1, 0.0f); + if (projectile.type == 439) + Main.spriteBatch.Draw(Main.glowMaskTexture[35], position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y21, texture.Width, height)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * num265, projectile.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), projectile.scale, effects1, 0.0f); + else if (projectile.type == 615) + Main.spriteBatch.Draw(Main.glowMaskTexture[192], position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y21, texture.Width, height)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue) * num265, projectile.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), projectile.scale, effects1, 0.0f); + else if (projectile.type == 630) + { + Main.spriteBatch.Draw(Main.glowMaskTexture[200], position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y21, texture.Width, height)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue) * num265, projectile.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), projectile.scale, effects1, 0.0f); + if ((double) projectile.localAI[0] > 0.0) + { + int frameY = 6 - (int) ((double) projectile.localAI[0] / 1.0); + Texture2D texture2D = Main.extraTexture[65]; + Main.spriteBatch.Draw(texture2D, position + Vector2.Normalize(projectile.velocity) * 2f, new Microsoft.Xna.Framework.Rectangle?(texture2D.Frame(verticalFrames: 6, frameY: frameY)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue) * num265, projectile.rotation, new Vector2(effects1.HasFlag((Enum) SpriteEffects.FlipHorizontally) ? (float) texture2D.Width : 0.0f, (float) ((double) height / 2.0 - 2.0)), projectile.scale, effects1, 0.0f); + } + } + else if (projectile.type == 600) + { + Microsoft.Xna.Framework.Color portalColor = PortalHelper.GetPortalColor(projectile.owner, (int) projectile.ai[1]); + portalColor.A = (byte) 70; + Main.spriteBatch.Draw(Main.glowMaskTexture[173], position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y21, texture.Width, height)), portalColor, projectile.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), projectile.scale, effects1, 0.0f); + } + else if (projectile.type == 460) + { + if ((double) Math.Abs(projectile.rotation - 1.570796f) > 1.57079637050629) + effects1 |= SpriteEffects.FlipVertically; + Main.spriteBatch.Draw(Main.glowMaskTexture[102], position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y21, texture.Width, height)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), projectile.rotation - 1.570796f, new Vector2((float) texture.Width / 2f, (float) height / 2f), projectile.scale, effects1, 0.0f); + if ((double) projectile.ai[0] > 180.0 && Main.projectile[(int) projectile.ai[1]].type == 461) + this.DrawProj((int) projectile.ai[1]); + } + else if (projectile.type == 633) + { + float num270 = (float) (Math.Cos(6.28318548202515 * ((double) projectile.ai[0] / 30.0)) * 2.0 + 2.0); + if ((double) projectile.ai[0] > 120.0) + num270 = 4f; + for (float num271 = 0.0f; (double) num271 < 4.0; ++num271) + Main.spriteBatch.Draw(texture, position + Vector2.UnitY.RotatedBy((double) num271 * 6.28318548202515 / 4.0) * num270, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y21, texture.Width, height)), projectile.GetAlpha(color3).MultiplyRGBA(new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0)) * 0.03f, projectile.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), projectile.scale, effects1, 0.0f); + } + } + else if (projectile.type == 442) + { + Texture2D texture = Main.projectileTexture[projectile.type]; + int height = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; + int y22 = height * projectile.frame; + Vector2 position = projectile.position + new Vector2((float) projectile.width, (float) projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Main.spriteBatch.Draw(texture, position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y22, texture.Width, height)), projectile.GetAlpha(color3), projectile.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), projectile.scale, effects1, 0.0f); + Main.spriteBatch.Draw(Main.glowMaskTexture[37], position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y22, texture.Width, height)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * (float) (1.0 - (double) projectile.alpha / (double) byte.MaxValue), projectile.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), projectile.scale, effects1, 0.0f); + } + else if (projectile.type == 447) + { + Texture2D texture = Main.projectileTexture[projectile.type]; + Texture2D texture2D = Main.extraTexture[4]; + int num272 = texture.Height / Main.projFrames[projectile.type]; + int num273 = num272 * projectile.frame; + int height = texture2D.Height / Main.projFrames[projectile.type]; + int y23 = height * projectile.frame; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, y23, texture2D.Width, height); + Vector2 position = projectile.position + new Vector2((float) projectile.width, 0.0f) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Main.spriteBatch.Draw(Main.extraTexture[4], position, new Microsoft.Xna.Framework.Rectangle?(rectangle), projectile.GetAlpha(color3), projectile.rotation, new Vector2((float) (texture2D.Width / 2), 0.0f), projectile.scale, effects1, 0.0f); + int num274 = projectile.height - num272 - 14; + if (num274 < 0) + num274 = 0; + if (num274 > 0) + { + if (y23 == height * 3) + y23 = height * 2; + Main.spriteBatch.Draw(Main.extraTexture[4], position + Vector2.UnitY * (float) (height - 1), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y23 + height - 1, texture2D.Width, 1)), projectile.GetAlpha(color3), projectile.rotation, new Vector2((float) (texture2D.Width / 2), 0.0f), new Vector2(1f, (float) num274), effects1, 0.0f); + } + rectangle.Width = texture.Width; + rectangle.Y = num273; + Main.spriteBatch.Draw(texture, position + Vector2.UnitY * (float) (height - 1 + num274), new Microsoft.Xna.Framework.Rectangle?(rectangle), projectile.GetAlpha(color3), projectile.rotation, new Vector2((float) texture.Width / 2f, 0.0f), projectile.scale, effects1, 0.0f); + } + else if (projectile.type == 455) + { + if (projectile.velocity == Vector2.Zero) + return; + Texture2D texture2D3 = Main.projectileTexture[projectile.type]; + Texture2D texture = Main.extraTexture[21]; + Texture2D texture2D4 = Main.extraTexture[22]; + float num275 = projectile.localAI[1]; + Microsoft.Xna.Framework.Color color25 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * 0.9f; + Main.spriteBatch.Draw(texture2D3, projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(), color25, projectile.rotation, texture2D3.Size() / 2f, projectile.scale, SpriteEffects.None, 0.0f); + float num276 = num275 - (float) (texture2D3.Height / 2 + texture2D4.Height) * projectile.scale; + Vector2 vector2 = projectile.Center + projectile.velocity * projectile.scale * (float) texture2D3.Height / 2f; + if ((double) num276 > 0.0) + { + float num277 = 0.0f; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, 16 * (projectile.timeLeft / 3 % 5), texture.Width, 16); + while ((double) num277 + 1.0 < (double) num276) + { + if ((double) num276 - (double) num277 < (double) rectangle.Height) + rectangle.Height = (int) ((double) num276 - (double) num277); + Main.spriteBatch.Draw(texture, vector2 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(rectangle), color25, projectile.rotation, new Vector2((float) (rectangle.Width / 2), 0.0f), projectile.scale, SpriteEffects.None, 0.0f); + num277 += (float) rectangle.Height * projectile.scale; + vector2 += projectile.velocity * (float) rectangle.Height * projectile.scale; + rectangle.Y += 16; + if (rectangle.Y + rectangle.Height > texture.Height) + rectangle.Y = 0; + } + } + Main.spriteBatch.Draw(texture2D4, vector2 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(), color25, projectile.rotation, texture2D4.Frame().Top(), projectile.scale, SpriteEffects.None, 0.0f); + } + else if (projectile.type == 461) + { + if (projectile.velocity == Vector2.Zero) + return; + Texture2D texture2D = Main.projectileTexture[projectile.type]; + float num278 = projectile.localAI[1]; + Microsoft.Xna.Framework.Color color26 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * 0.9f; + Microsoft.Xna.Framework.Rectangle r = new Microsoft.Xna.Framework.Rectangle(0, 0, texture2D.Width, 22); + Vector2 vector2_16 = new Vector2(0.0f, Main.player[projectile.owner].gfxOffY); + Main.spriteBatch.Draw(texture2D, projectile.Center.Floor() - Main.screenPosition + vector2_16, new Microsoft.Xna.Framework.Rectangle?(r), color26, projectile.rotation, r.Size() / 2f, projectile.scale, SpriteEffects.None, 0.0f); + float num279 = num278 - 33f * projectile.scale; + Vector2 vector2_17 = projectile.Center.Floor() + projectile.velocity * projectile.scale * 10.5f; + r = new Microsoft.Xna.Framework.Rectangle(0, 25, texture2D.Width, 28); + if ((double) num279 > 0.0) + { + float num280 = 0.0f; + while ((double) num280 + 1.0 < (double) num279) + { + if ((double) num279 - (double) num280 < (double) r.Height) + r.Height = (int) ((double) num279 - (double) num280); + Main.spriteBatch.Draw(texture2D, vector2_17 - Main.screenPosition + vector2_16, new Microsoft.Xna.Framework.Rectangle?(r), color26, projectile.rotation, new Vector2((float) (r.Width / 2), 0.0f), projectile.scale, SpriteEffects.None, 0.0f); + num280 += (float) r.Height * projectile.scale; + vector2_17 += projectile.velocity * (float) r.Height * projectile.scale; + } + } + r = new Microsoft.Xna.Framework.Rectangle(0, 56, texture2D.Width, 22); + Main.spriteBatch.Draw(texture2D, vector2_17 - Main.screenPosition + vector2_16, new Microsoft.Xna.Framework.Rectangle?(r), color26, projectile.rotation, texture2D.Frame().Top(), projectile.scale, SpriteEffects.None, 0.0f); + } + else if (projectile.type == 632) + { + if (projectile.velocity == Vector2.Zero) + return; + Texture2D tex = Main.projectileTexture[projectile.type]; + float num281 = projectile.localAI[1]; + Microsoft.Xna.Framework.Color rgb = Main.hslToRgb(projectile.GetPrismHue(projectile.ai[0]), 1f, 0.5f); + rgb.A = (byte) 0; + Vector2 vector2_18 = projectile.Center.Floor() + projectile.velocity * projectile.scale * 10.5f; + float num282 = num281 - projectile.scale * 14.5f * projectile.scale; + Vector2 scale = new Vector2(projectile.scale); + DelegateMethods.f_1 = 1f; + DelegateMethods.c_1 = rgb * 0.75f * projectile.Opacity; + Vector2 vector2_19 = projectile.oldPos[0] + new Vector2((float) projectile.width, (float) projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Utils.DrawLaser(Main.spriteBatch, tex, vector2_18 - Main.screenPosition, vector2_18 + projectile.velocity * num282 - Main.screenPosition, scale, new Utils.LaserLineFraming(DelegateMethods.RainbowLaserDraw)); + DelegateMethods.c_1 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue) * 0.75f * projectile.Opacity; + Utils.DrawLaser(Main.spriteBatch, tex, vector2_18 - Main.screenPosition, vector2_18 + projectile.velocity * num282 - Main.screenPosition, scale / 2f, new Utils.LaserLineFraming(DelegateMethods.RainbowLaserDraw)); + } + else if (projectile.type == 642) + { + if (projectile.velocity == Vector2.Zero) + return; + Texture2D tex = Main.projectileTexture[projectile.type]; + float num283 = projectile.localAI[1]; + Microsoft.Xna.Framework.Color color27 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue); + Vector2 vector2_20 = projectile.Center.Floor(); + float num284 = num283 - projectile.scale * 10.5f; + Vector2 scale = new Vector2(projectile.scale); + DelegateMethods.f_1 = 1f; + DelegateMethods.c_1 = color27; + DelegateMethods.i_1 = 54000 - (int) Main.time / 2; + Vector2 vector2_21 = projectile.oldPos[0] + new Vector2((float) projectile.width, (float) projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Utils.DrawLaser(Main.spriteBatch, tex, vector2_20 - Main.screenPosition, vector2_20 + projectile.velocity * num284 - Main.screenPosition, scale, new Utils.LaserLineFraming(DelegateMethods.TurretLaserDraw)); + DelegateMethods.c_1 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue) * 0.75f * projectile.Opacity; + Utils.DrawLaser(Main.spriteBatch, tex, vector2_20 - Main.screenPosition, vector2_20 + projectile.velocity * num284 - Main.screenPosition, scale / 2f, new Utils.LaserLineFraming(DelegateMethods.TurretLaserDraw)); + } + else if (projectile.type == 611) + { + Vector2 vector2_22 = projectile.position + new Vector2((float) projectile.width, (float) projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Texture2D texture2D = Main.projectileTexture[projectile.type]; + Microsoft.Xna.Framework.Color alpha = projectile.GetAlpha(color3); + if (projectile.velocity == Vector2.Zero) + return; + float num285 = projectile.velocity.Length() + 16f; + bool flag = (double) num285 < 100.0; + Vector2 vector2_23 = Vector2.Normalize(projectile.velocity); + Microsoft.Xna.Framework.Rectangle r = new Microsoft.Xna.Framework.Rectangle(0, 2, texture2D.Width, 40); + Vector2 vector2_24 = new Vector2(0.0f, Main.player[projectile.owner].gfxOffY); + float rotation = projectile.rotation + 3.141593f; + Main.spriteBatch.Draw(texture2D, projectile.Center.Floor() - Main.screenPosition + vector2_24, new Microsoft.Xna.Framework.Rectangle?(r), alpha, rotation, r.Size() / 2f - Vector2.UnitY * 4f, projectile.scale, SpriteEffects.None, 0.0f); + float num286 = num285 - 40f * projectile.scale; + Vector2 vector2_25 = projectile.Center.Floor() + vector2_23 * projectile.scale * 24f; + r = new Microsoft.Xna.Framework.Rectangle(0, 68, texture2D.Width, 18); + if ((double) num286 > 0.0) + { + float num287 = 0.0f; + while ((double) num287 + 1.0 < (double) num286) + { + if ((double) num286 - (double) num287 < (double) r.Height) + r.Height = (int) ((double) num286 - (double) num287); + Main.spriteBatch.Draw(texture2D, vector2_25 - Main.screenPosition + vector2_24, new Microsoft.Xna.Framework.Rectangle?(r), alpha, rotation, new Vector2((float) (r.Width / 2), 0.0f), projectile.scale, SpriteEffects.None, 0.0f); + num287 += (float) r.Height * projectile.scale; + vector2_25 += vector2_23 * (float) r.Height * projectile.scale; + } + } + Vector2 vector2_26 = vector2_25; + Vector2 vector2_27 = projectile.Center.Floor() + vector2_23 * projectile.scale * 24f; + r = new Microsoft.Xna.Framework.Rectangle(0, 46, texture2D.Width, 18); + int num288 = 18; + if (flag) + num288 = 9; + float num289 = num286; + if ((double) num286 > 0.0) + { + float num290 = 0.0f; + float num291 = num289 / (float) num288; + float num292 = num290 + num291 * 0.25f; + Vector2 vector2_28 = vector2_27 + vector2_23 * num291 * 0.25f; + for (int index = 0; index < num288; ++index) + { + float num293 = num291; + if (index == 0) + num293 *= 0.75f; + Main.spriteBatch.Draw(texture2D, vector2_28 - Main.screenPosition + vector2_24, new Microsoft.Xna.Framework.Rectangle?(r), alpha, rotation, new Vector2((float) (r.Width / 2), 0.0f), projectile.scale, SpriteEffects.None, 0.0f); + num292 += num293; + vector2_28 += vector2_23 * num293; + } + } + r = new Microsoft.Xna.Framework.Rectangle(0, 90, texture2D.Width, 48); + Main.spriteBatch.Draw(texture2D, vector2_26 - Main.screenPosition + vector2_24, new Microsoft.Xna.Framework.Rectangle?(r), alpha, rotation, texture2D.Frame().Top(), projectile.scale, SpriteEffects.None, 0.0f); + } + else if (projectile.type == 537) + { + if (projectile.velocity == Vector2.Zero) + return; + Texture2D texture2D = Main.projectileTexture[projectile.type]; + float num294 = projectile.localAI[1]; + Microsoft.Xna.Framework.Color color28 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * 0.9f; + Microsoft.Xna.Framework.Rectangle r = new Microsoft.Xna.Framework.Rectangle(0, 0, texture2D.Width, 22); + Vector2 vector2_29 = new Vector2(0.0f, Main.npc[(int) projectile.ai[1]].gfxOffY); + Main.spriteBatch.Draw(texture2D, projectile.Center.Floor() - Main.screenPosition + vector2_29, new Microsoft.Xna.Framework.Rectangle?(r), color28, projectile.rotation, r.Size() / 2f, projectile.scale, SpriteEffects.None, 0.0f); + float num295 = num294 - 33f * projectile.scale; + Vector2 vector2_30 = projectile.Center.Floor() + projectile.velocity * projectile.scale * 10.5f; + r = new Microsoft.Xna.Framework.Rectangle(0, 25, texture2D.Width, 28); + if ((double) num295 > 0.0) + { + float num296 = 0.0f; + while ((double) num296 + 1.0 < (double) num295) + { + if ((double) num295 - (double) num296 < (double) r.Height) + r.Height = (int) ((double) num295 - (double) num296); + Main.spriteBatch.Draw(texture2D, vector2_30 - Main.screenPosition + vector2_29, new Microsoft.Xna.Framework.Rectangle?(r), color28, projectile.rotation, new Vector2((float) (r.Width / 2), 0.0f), projectile.scale, SpriteEffects.None, 0.0f); + num296 += (float) r.Height * projectile.scale; + vector2_30 += projectile.velocity * (float) r.Height * projectile.scale; + } + } + r = new Microsoft.Xna.Framework.Rectangle(0, 56, texture2D.Width, 22); + Main.spriteBatch.Draw(texture2D, vector2_30 - Main.screenPosition + vector2_29, new Microsoft.Xna.Framework.Rectangle?(r), color28, projectile.rotation, texture2D.Frame().Top(), projectile.scale, SpriteEffects.None, 0.0f); + } + else if (projectile.type == 456) + { + Texture2D texture2D5 = Main.projectileTexture[projectile.type]; + Texture2D texture = Main.extraTexture[23]; + Texture2D texture2D6 = Main.extraTexture[24]; + Vector2 vector2_31 = new Vector2(0.0f, 216f); + Vector2 vector2_32 = Main.npc[(int) Math.Abs(projectile.ai[0]) - 1].Center - projectile.Center + vector2_31; + float num297 = vector2_32.Length(); + Vector2 vector2_33 = Vector2.Normalize(vector2_32); + Microsoft.Xna.Framework.Rectangle r3 = texture2D5.Frame(); + r3.Height /= 4; + r3.Y += projectile.frame * r3.Height; + Microsoft.Xna.Framework.Color newColor1 = Microsoft.Xna.Framework.Color.Lerp(color3, Microsoft.Xna.Framework.Color.White, 0.3f); + Main.spriteBatch.Draw(texture2D5, projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(r3), projectile.GetAlpha(newColor1), projectile.rotation, r3.Size() / 2f, projectile.scale, SpriteEffects.None, 0.0f); + float num298 = num297 - (float) (r3.Height / 2 + texture2D6.Height) * projectile.scale; + Vector2 vec = projectile.Center + vector2_33 * projectile.scale * (float) r3.Height / 2f; + if ((double) num298 > 0.0) + { + float num299 = 0.0f; + Microsoft.Xna.Framework.Rectangle r4 = new Microsoft.Xna.Framework.Rectangle(0, 0, texture.Width, texture.Height); + while ((double) num299 + 1.0 < (double) num298) + { + if ((double) num298 - (double) num299 < (double) r4.Height) + r4.Height = (int) ((double) num298 - (double) num299); + Microsoft.Xna.Framework.Point tileCoordinates = vec.ToTileCoordinates(); + Microsoft.Xna.Framework.Color newColor2 = Microsoft.Xna.Framework.Color.Lerp(Lighting.GetColor(tileCoordinates.X, tileCoordinates.Y), Microsoft.Xna.Framework.Color.White, 0.3f); + Main.spriteBatch.Draw(texture, vec - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(r4), projectile.GetAlpha(newColor2), projectile.rotation, r4.Bottom(), projectile.scale, SpriteEffects.None, 0.0f); + num299 += (float) r4.Height * projectile.scale; + vec += vector2_33 * (float) r4.Height * projectile.scale; + } + } + Microsoft.Xna.Framework.Point tileCoordinates1 = vec.ToTileCoordinates(); + Microsoft.Xna.Framework.Color color29 = Microsoft.Xna.Framework.Color.Lerp(Lighting.GetColor(tileCoordinates1.X, tileCoordinates1.Y), Microsoft.Xna.Framework.Color.White, 0.3f); + Microsoft.Xna.Framework.Rectangle rectangle = texture2D6.Frame(); + if ((double) num298 < 0.0) + rectangle.Height += (int) num298; + Main.spriteBatch.Draw(texture2D6, vec - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(rectangle), color29, projectile.rotation, new Vector2((float) rectangle.Width / 2f, (float) rectangle.Height), projectile.scale, SpriteEffects.None, 0.0f); + } + else if (projectile.type == 443) + { + Texture2D texture = Main.projectileTexture[projectile.type]; + float num300 = 30f; + float num301 = num300 * 4f; + float num302 = 6.283185f * projectile.ai[0] / num300; + float num303 = 6.283185f * projectile.ai[0] / num301; + Vector2 vector2 = -Vector2.UnitY.RotatedBy((double) num302); + float scale1 = (float) (0.75 + (double) vector2.Y * 0.25); + float scale2 = (float) (0.800000011920929 - (double) vector2.Y * 0.200000002980232); + int height = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; + int y24 = height * projectile.frame; + Vector2 position = projectile.position + new Vector2((float) projectile.width, (float) projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Main.spriteBatch.Draw(texture, position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y24, texture.Width, height)), projectile.GetAlpha(color3), projectile.rotation + num303, new Vector2((float) texture.Width / 2f, (float) height / 2f), scale1, effects1, 0.0f); + Main.spriteBatch.Draw(texture, position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y24, texture.Width, height)), projectile.GetAlpha(color3), projectile.rotation + (6.283185f - num303), new Vector2((float) texture.Width / 2f, (float) height / 2f), scale2, effects1, 0.0f); + } + else if (projectile.type == 656 || projectile.type == 657) + { + float num304 = 900f; + if (projectile.type == 657) + num304 = 300f; + float num305 = 15f; + float num306 = 15f; + float num307 = projectile.ai[0]; + float num308 = MathHelper.Clamp(num307 / 30f, 0.0f, 1f); + if ((double) num307 > (double) num304 - 60.0) + num308 = MathHelper.Lerp(1f, 0.0f, (float) (((double) num307 - ((double) num304 - 60.0)) / 60.0)); + Microsoft.Xna.Framework.Point tileCoordinates = projectile.Center.ToTileCoordinates(); + int topY; + int bottomY; + Collision.ExpandVertically(tileCoordinates.X, tileCoordinates.Y, out topY, out bottomY, (int) num305, (int) num306); + int num309 = topY + 1; + --bottomY; + float num310 = 0.2f; + Vector2 vector2_34 = new Vector2((float) tileCoordinates.X, (float) num309) * 16f + new Vector2(8f); + Vector2 vector2_35 = new Vector2((float) tileCoordinates.X, (float) bottomY) * 16f + new Vector2(8f); + Vector2.Lerp(vector2_34, vector2_35, 0.5f); + Vector2 vector2_36 = new Vector2(0.0f, vector2_35.Y - vector2_34.Y); + vector2_36.X = vector2_36.Y * num310; + Vector2 vector2_37 = new Vector2(vector2_34.X - vector2_36.X / 2f, vector2_34.Y); + Texture2D texture2D = Main.projectileTexture[projectile.type]; + Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(); + Vector2 origin = r.Size() / 2f; + float num311 = -0.06283186f * num307; + Vector2 spinningpoint = Vector2.UnitY.RotatedBy((double) num307 * 0.100000001490116); + float num312 = 0.0f; + float num313 = 5.1f; + Microsoft.Xna.Framework.Color color30 = new Microsoft.Xna.Framework.Color(212, 192, 100); + for (float y25 = (float) (int) vector2_35.Y; (double) y25 > (double) (int) vector2_34.Y; y25 -= num313) + { + num312 += num313; + float num314 = num312 / vector2_36.Y; + float num315 = (float) ((double) num312 * 6.28318548202515 / -20.0); + float num316 = num314 - 0.15f; + Vector2 position = spinningpoint.RotatedBy((double) num315); + Vector2 vector2_38 = new Vector2(0.0f, num314 + 1f); + vector2_38.X = vector2_38.Y * num310; + Microsoft.Xna.Framework.Color color31 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, color30, num314 * 2f); + if ((double) num314 > 0.5) + color31 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, color30, (float) (2.0 - (double) num314 * 2.0)); + color31.A = (byte) ((double) color31.A * 0.5); + color31 *= num308; + position *= vector2_38 * 100f; + position.Y = 0.0f; + position.X = 0.0f; + position += new Vector2(vector2_35.X, y25) - Main.screenPosition; + Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(r), color31, num311 + num315, origin, 1f + num316, SpriteEffects.None, 0.0f); + } + } + else if (projectile.type == 704) + { + float num317 = 300f; + float num318 = projectile.ai[0]; + float num319 = MathHelper.Clamp(num318 / 30f, 0.0f, 1f); + if ((double) num318 > (double) num317 - 60.0) + num319 = MathHelper.Lerp(1f, 0.0f, (float) (((double) num318 - ((double) num317 - 60.0)) / 60.0)); + float num320 = 0.2f; + Vector2 top = projectile.Top; + Vector2 bottom = projectile.Bottom; + Vector2.Lerp(top, bottom, 0.5f); + Vector2 vector2_39 = new Vector2(0.0f, bottom.Y - top.Y); + vector2_39.X = vector2_39.Y * num320; + Vector2 vector2_40 = new Vector2(top.X - vector2_39.X / 2f, top.Y); + Texture2D texture2D = Main.projectileTexture[projectile.type]; + Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(); + Vector2 origin = r.Size() / 2f; + float num321 = (float) (-0.157079637050629 * (double) num318 * ((double) projectile.velocity.X > 0.0 ? -1.0 : 1.0)); + SpriteEffects effects3 = (double) projectile.velocity.X > 0.0 ? SpriteEffects.FlipVertically : SpriteEffects.None; + bool flag4 = (double) projectile.velocity.X > 0.0; + Vector2 spinningpoint = Vector2.UnitY.RotatedBy((double) num318 * 0.140000000596046); + float num322 = 0.0f; + float num323 = (float) (5.01000022888184 + (double) num318 / 150.0 * -0.899999976158142); + if ((double) num323 < 4.1100001335144) + num323 = 4.11f; + Microsoft.Xna.Framework.Color color32 = new Microsoft.Xna.Framework.Color(160, 140, 100, (int) sbyte.MaxValue); + Microsoft.Xna.Framework.Color color33 = new Microsoft.Xna.Framework.Color(140, 160, (int) byte.MaxValue, (int) sbyte.MaxValue); + float t = num318 % 60f; + Microsoft.Xna.Framework.Color color34 = (double) t >= 30.0 ? color33 * Utils.InverseLerp(38f, 30f, t, true) : color33 * Utils.InverseLerp(22f, 30f, t, true); + bool flag5 = color34 != Microsoft.Xna.Framework.Color.Transparent; + for (float y26 = (float) (int) bottom.Y; (double) y26 > (double) (int) top.Y; y26 -= num323) + { + num322 += num323; + float num324 = num322 / vector2_39.Y; + float num325 = (float) ((double) num322 * 6.28318548202515 / -20.0); + if (flag4) + num325 *= -1f; + float num326 = num324 - 0.35f; + Vector2 position = spinningpoint.RotatedBy((double) num325); + Vector2 vector2_41 = new Vector2(0.0f, num324 + 1f); + vector2_41.X = vector2_41.Y * num320; + Microsoft.Xna.Framework.Color color35 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, color32, num324 * 2f); + if ((double) num324 > 0.5) + color35 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, color32, (float) (2.0 - (double) num324 * 2.0)); + color35.A = (byte) ((double) color35.A * 0.5); + color35 *= num319; + position *= vector2_41 * 100f; + position.Y = 0.0f; + position.X = 0.0f; + position += new Vector2(bottom.X, y26) - Main.screenPosition; + if (flag5) + { + Microsoft.Xna.Framework.Color color36 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, color34, num324 * 2f); + if ((double) num324 > 0.5) + color36 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, color34, (float) (2.0 - (double) num324 * 2.0)); + color36.A = (byte) ((double) color36.A * 0.5); + color36 *= num319; + Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(r), color36, num321 + num325, origin, (float) ((1.0 + (double) num326) * 0.800000011920929), effects3, 0.0f); + } + Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(r), color35, num321 + num325, origin, 1f + num326, effects3, 0.0f); + } + } + else if (projectile.type == 444 || projectile.type == 446 || projectile.type == 490 || projectile.type == 464 || projectile.type == 502 || projectile.type == 538 || projectile.type == 540 || projectile.type == 579 || projectile.type == 578 || projectile.type == 583 || projectile.type == 584 || projectile.type == 616 || projectile.type == 617 || projectile.type == 618 || projectile.type == 641 || projectile.type >= 646 && projectile.type <= 649 || projectile.type == 653 || projectile.type == 186 || projectile.type == 662 || projectile.type == 685 || projectile.type == 673 || projectile.type == 676 || projectile.type == 697 || projectile.type == 699 || projectile.type == 707 || projectile.type == 708) + { + Vector2 position14 = projectile.position + new Vector2((float) projectile.width, (float) projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Texture2D texture3 = Main.projectileTexture[projectile.type]; + Microsoft.Xna.Framework.Color alpha = projectile.GetAlpha(color3); + Vector2 origin3 = new Vector2((float) texture3.Width, (float) texture3.Height) / 2f; + if (projectile.type == 446) + origin3.Y = 4f; + if (projectile.type == 662 || projectile.type == 685) + origin3 = new Vector2(6f, 6f); + if (projectile.type == 699 || projectile.type == 708) + origin3 = new Vector2(projectile.spriteDirection == 1 ? (float) texture3.Width - -8f : -8f, -8f); + if (projectile.type == 502) + { + this.LoadProjectile(250); + Texture2D texture4 = Main.projectileTexture[250]; + Vector2 origin4 = new Vector2((float) (texture4.Width / 2), 0.0f); + Vector2 vector2_42 = new Vector2((float) projectile.width, (float) projectile.height) / 2f; + Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; + white.A = (byte) 127; + for (int index = projectile.oldPos.Length - 1; index > 0; --index) + { + Vector2 vector2_43 = projectile.oldPos[index] + vector2_42; + if (!(vector2_43 == vector2_42)) + { + Vector2 vector2_44 = projectile.oldPos[index - 1] + vector2_42; + float rotation = (vector2_44 - vector2_43).ToRotation() - 1.570796f; + Vector2 scale = new Vector2(1f, Vector2.Distance(vector2_43, vector2_44) / (float) texture4.Height); + Microsoft.Xna.Framework.Color color37 = white * (float) (1.0 - (double) index / (double) projectile.oldPos.Length); + Main.spriteBatch.Draw(texture4, vector2_43 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(), color37, rotation, origin4, scale, effects1, 0.0f); + } + } + } + else if (projectile.type == 540 && projectile.velocity != Vector2.Zero) + { + float num327 = 0.0f; + if ((double) projectile.ai[0] >= 10.0) + num327 = (float) (((double) projectile.ai[0] - 10.0) / 10.0); + if ((double) projectile.ai[0] >= 20.0) + num327 = (float) ((20.0 - (double) projectile.ai[0]) / 10.0); + if ((double) num327 > 1.0) + num327 = 1f; + if ((double) num327 < 0.0) + num327 = 0.0f; + if ((double) num327 != 0.0) + { + Texture2D texture5 = Main.extraTexture[47]; + Vector2 origin5 = new Vector2((float) (texture5.Width / 2), 0.0f); + Microsoft.Xna.Framework.Color color38 = alpha * num327 * 0.7f; + Vector2 vector2_45 = projectile.Center - Main.screenPosition; + Vector2 vector2_46 = projectile.velocity.ToRotation().ToRotationVector2() * (float) texture3.Width / 3f; + Vector2 zero = Vector2.Zero; + Vector2 position15 = vector2_45 + zero; + float rotation = projectile.velocity.ToRotation() - 1.570796f; + Vector2 scale = new Vector2(1f, (projectile.velocity.Length() - zero.Length() * 2f) / (float) texture5.Height); + Main.spriteBatch.Draw(texture5, position15, new Microsoft.Xna.Framework.Rectangle?(), color38, rotation, origin5, scale, SpriteEffects.None, 0.0f); + } + } + if (projectile.type == 578 || projectile.type == 579 || projectile.type == 641) + { + Microsoft.Xna.Framework.Color color39 = alpha * 0.8f; + color39.A /= (byte) 2; + Microsoft.Xna.Framework.Color color40 = Microsoft.Xna.Framework.Color.Lerp(alpha, Microsoft.Xna.Framework.Color.Black, 0.5f); + color40.A = alpha.A; + float num328 = (float) (0.949999988079071 + (double) (projectile.rotation * 0.75f).ToRotationVector2().Y * 0.100000001490116); + Microsoft.Xna.Framework.Color color41 = color40 * num328; + float scale = (float) (0.600000023841858 + (double) projectile.scale * 0.600000023841858 * (double) num328); + Main.spriteBatch.Draw(Main.extraTexture[50], position14, new Microsoft.Xna.Framework.Rectangle?(), color41, (float) (-(double) projectile.rotation + 0.349999994039536), origin3, scale, effects1 ^ SpriteEffects.FlipHorizontally, 0.0f); + Main.spriteBatch.Draw(Main.extraTexture[50], position14, new Microsoft.Xna.Framework.Rectangle?(), alpha, -projectile.rotation, origin3, projectile.scale, effects1 ^ SpriteEffects.FlipHorizontally, 0.0f); + Main.spriteBatch.Draw(texture3, position14, new Microsoft.Xna.Framework.Rectangle?(), color39, (float) (-(double) projectile.rotation * 0.699999988079071), origin3, projectile.scale, effects1 ^ SpriteEffects.FlipHorizontally, 0.0f); + Main.spriteBatch.Draw(Main.extraTexture[50], position14, new Microsoft.Xna.Framework.Rectangle?(), alpha * 0.8f, projectile.rotation * 0.5f, origin3, projectile.scale * 0.9f, effects1, 0.0f); + alpha.A = (byte) 0; + } + if (projectile.type == 617) + { + Microsoft.Xna.Framework.Color color42 = alpha * 0.8f; + color42.A /= (byte) 2; + Microsoft.Xna.Framework.Color color43 = Microsoft.Xna.Framework.Color.Lerp(alpha, Microsoft.Xna.Framework.Color.Black, 0.5f); + color43.A = alpha.A; + float num329 = (float) (0.949999988079071 + (double) (projectile.rotation * 0.75f).ToRotationVector2().Y * 0.100000001490116); + Microsoft.Xna.Framework.Color color44 = color43 * num329; + float scale = (float) (0.600000023841858 + (double) projectile.scale * 0.600000023841858 * (double) num329); + Main.spriteBatch.Draw(Main.extraTexture[50], position14, new Microsoft.Xna.Framework.Rectangle?(), color44, (float) (-(double) projectile.rotation + 0.349999994039536), origin3, scale, effects1 ^ SpriteEffects.FlipHorizontally, 0.0f); + Main.spriteBatch.Draw(Main.extraTexture[50], position14, new Microsoft.Xna.Framework.Rectangle?(), alpha, -projectile.rotation, origin3, projectile.scale, effects1 ^ SpriteEffects.FlipHorizontally, 0.0f); + Main.spriteBatch.Draw(texture3, position14, new Microsoft.Xna.Framework.Rectangle?(), color42, (float) (-(double) projectile.rotation * 0.699999988079071), origin3, projectile.scale, effects1 ^ SpriteEffects.FlipHorizontally, 0.0f); + Main.spriteBatch.Draw(Main.extraTexture[50], position14, new Microsoft.Xna.Framework.Rectangle?(), alpha * 0.8f, projectile.rotation * 0.5f, origin3, projectile.scale * 0.9f, effects1, 0.0f); + alpha.A = (byte) 0; + } + if ((0 | (projectile.type != 464 ? 0 : ((double) projectile.ai[1] != 1.0 ? 1 : 0))) == 0) + Main.spriteBatch.Draw(texture3, position14, new Microsoft.Xna.Framework.Rectangle?(), alpha, projectile.rotation, origin3, projectile.scale, effects1, 0.0f); + if (projectile.type == 464 && (double) projectile.ai[1] != 1.0) + { + Texture2D texture2D = Main.extraTexture[35]; + Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: 3); + Vector2 origin6 = r.Size() / 2f; + Vector2 spinningpoint = new Vector2(0.0f, -720f).RotatedBy((double) projectile.velocity.ToRotation()) * (float) ((double) projectile.ai[0] % 45.0 / 45.0); + for (int index = 0; index < 6; ++index) + { + float num330 = (float) ((double) index * 6.28318548202515 / 6.0); + Vector2 vector2 = projectile.Center + spinningpoint.RotatedBy((double) num330); + Main.spriteBatch.Draw(texture2D, vector2 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(r), alpha, (float) ((double) num330 + (double) projectile.velocity.ToRotation() + 3.14159274101257), origin6, projectile.scale, effects1, 0.0f); + r.Y += r.Height; + if (r.Y >= texture2D.Height) + r.Y = 0; + } + } + else if (projectile.type == 490) + { + Main.spriteBatch.Draw(Main.extraTexture[34], position14, new Microsoft.Xna.Framework.Rectangle?(), alpha, -projectile.rotation, Main.extraTexture[34].Size() / 2f, projectile.scale, effects1, 0.0f); + Main.spriteBatch.Draw(texture3, position14, new Microsoft.Xna.Framework.Rectangle?(), alpha, projectile.rotation, origin3, projectile.scale * 0.42f, effects1, 0.0f); + Main.spriteBatch.Draw(Main.extraTexture[34], position14, new Microsoft.Xna.Framework.Rectangle?(), alpha, -projectile.rotation, Main.extraTexture[34].Size() / 2f, projectile.scale * 0.42f, effects1, 0.0f); + } + else if (projectile.type == 616) + { + Texture2D texture6 = Main.glowMaskTexture[193]; + Main.spriteBatch.Draw(texture6, position14, new Microsoft.Xna.Framework.Rectangle?(), new Microsoft.Xna.Framework.Color((int) sbyte.MaxValue, (int) sbyte.MaxValue, (int) sbyte.MaxValue, 0), projectile.rotation, origin3, projectile.scale, effects1, 0.0f); + } + else if (projectile.type >= 646 && projectile.type <= 649) + { + Texture2D texture7 = Main.glowMaskTexture[203 + projectile.type - 646]; + Main.spriteBatch.Draw(texture7, position14, new Microsoft.Xna.Framework.Rectangle?(), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue), projectile.rotation, origin3, projectile.scale, effects1, 0.0f); + } + else if (projectile.type == 699) + { + Texture2D texture8 = Main.glowMaskTexture[231]; + Main.spriteBatch.Draw(texture8, position14, new Microsoft.Xna.Framework.Rectangle?(), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue), projectile.rotation, origin3, projectile.scale, effects1, 0.0f); + } + else if (projectile.type == 707 || projectile.type == 708) + { + float num331 = 0.5f; + Texture2D texture2D = Main.glowMaskTexture[232]; + Microsoft.Xna.Framework.Rectangle rectangle = texture2D.Frame(verticalFrames: 3, frameY: ((int) ((double) projectile.ai[0] % 9.0) / 3)); + if (projectile.type == 708) + { + rectangle = texture2D.Frame(verticalFrames: 3, frameY: (Main.player[projectile.owner].itemAnimation % 9 / 3)); + num331 = 0.75f; + } + Microsoft.Xna.Framework.Color color45 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue) * num331; + Vector2 spinningpoint = new Vector2(2f, 0.0f).RotatedBy((double) projectile.rotation); + for (float num332 = 0.0f; (double) num332 < 4.0; ++num332) + Main.spriteBatch.Draw(texture2D, position14 + spinningpoint.RotatedBy((double) num332 * 1.57079637050629), new Microsoft.Xna.Framework.Rectangle?(rectangle), color45 * 0.5f, projectile.rotation, origin3, projectile.scale, effects1, 0.0f); + Main.spriteBatch.Draw(texture2D, position14, new Microsoft.Xna.Framework.Rectangle?(rectangle), color45, projectile.rotation, origin3, projectile.scale, effects1, 0.0f); + } + } + else if (projectile.type == 465 || projectile.type == 467 || projectile.type == 468 || projectile.type == 500 || projectile.type == 518 || projectile.type == 535 || projectile.type == 539 || projectile.type == 575 || projectile.type == 574 || projectile.type == 589 || projectile.type == 590 || projectile.type == 593 || projectile.type == 602 || projectile.type == 596 || projectile.type == 612 || projectile.type == 613 || projectile.type == 614 || projectile.type == 623 || projectile.type == 625 || projectile.type == 626 || projectile.type == 627 || projectile.type == 628 || projectile.type == 634 || projectile.type == 635 || projectile.type == 643 || projectile.type == 644 || projectile.type == 645 || projectile.type == 650 || projectile.type == 652 || projectile.type == 658 || projectile.type == 659 || projectile.type == 663 || projectile.type == 665 || projectile.type == 667 || projectile.type == 677 || projectile.type == 678 || projectile.type == 679 || projectile.type == 691 || projectile.type == 692 || projectile.type == 693 || projectile.type == 702 || projectile.type == 703 || projectile.type == 701 || projectile.type == 712) + { + Vector2 position16 = projectile.position + new Vector2((float) projectile.width, (float) projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Texture2D texture2D7 = Main.projectileTexture[projectile.type]; + Microsoft.Xna.Framework.Rectangle r = texture2D7.Frame(verticalFrames: Main.projFrames[projectile.type], frameY: projectile.frame); + Microsoft.Xna.Framework.Color alpha = projectile.GetAlpha(color3); + Vector2 origin7 = r.Size() / 2f; + if (projectile.type == 539) + { + if ((double) projectile.ai[0] >= 210.0) + { + float num333 = (projectile.ai[0] - 210f) / 20f; + if ((double) num333 > 1.0) + num333 = 1f; + Main.spriteBatch.Draw(Main.extraTexture[46], position16, new Microsoft.Xna.Framework.Rectangle?(), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 128) * num333, projectile.rotation, new Vector2(17f, 22f), projectile.scale, effects1, 0.0f); + } + } + else if (projectile.type == 663 || projectile.type == 665 || projectile.type == 667) + { + position16 = projectile.Bottom + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + origin7 = r.Size() * new Vector2(0.5f, 1f); + origin7.Y -= 2f; + origin7.Y -= 2f; + } + else if (projectile.type == 691 || projectile.type == 692 || projectile.type == 693) + { + position16 = projectile.Bottom + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + origin7 = r.Size() * new Vector2(0.5f, 1f); + origin7.Y -= 2f; + origin7.Y -= 2f; + } + else if (projectile.type == 677 || projectile.type == 678 || projectile.type == 679) + { + if (projectile.spriteDirection == -1) + effects1 ^= SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically; + Texture2D texture2D8 = Main.extraTexture[83]; + if (projectile.type == 678) + texture2D8 = Main.extraTexture[84]; + if (projectile.type == 679) + texture2D8 = Main.extraTexture[85]; + Vector2 position17 = projectile.Bottom + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Vector2 origin8 = texture2D8.Size() * new Vector2(0.5f, 1f); + origin8.Y -= 2f; + Main.spriteBatch.Draw(texture2D8, position17, new Microsoft.Xna.Framework.Rectangle?(), alpha, 0.0f, origin8, 1f, effects1 & SpriteEffects.FlipHorizontally, 0.0f); + origin7.X += (float) effects1.HasFlag((Enum) SpriteEffects.FlipHorizontally).ToDirectionInt(); + ++position16.Y; + position16.Y += 2f; + if (projectile.type == 678) + position16.Y += -4f; + if (projectile.type == 679) + { + position16.Y -= 2f; + if (!effects1.HasFlag((Enum) SpriteEffects.FlipVertically)) + origin7.Y += 4f; + else + origin7.Y -= 4f; + origin7.X += (float) (effects1.HasFlag((Enum) SpriteEffects.FlipHorizontally).ToDirectionInt() * 4); + } + } + else if (projectile.type == 602) + { + origin7.X = (float) (r.Width - 6); + --origin7.Y; + r.Height -= 2; + } + else if (projectile.type == 589) + { + r = texture2D7.Frame(5, frameX: ((int) projectile.ai[1])); + origin7 = r.Size() / 2f; + } + else if (projectile.type == 590) + { + r = texture2D7.Frame(3, frameX: projectile.frame); + origin7 = r.Size() / 2f; + } + else if (projectile.type == 650) + origin7.Y -= 4f; + else if (projectile.type == 623) + alpha.A /= (byte) 2; + else if (projectile.type >= 625 && projectile.type <= 628) + alpha.A /= (byte) 2; + else if (projectile.type == 644) + { + Microsoft.Xna.Framework.Color color46 = Main.hslToRgb(projectile.ai[0], 1f, 0.5f).MultiplyRGBA(new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0)); + Main.spriteBatch.Draw(texture2D7, position16, new Microsoft.Xna.Framework.Rectangle?(r), color46, projectile.rotation, origin7, projectile.scale * 2f, effects1, 0.0f); + Main.spriteBatch.Draw(texture2D7, position16, new Microsoft.Xna.Framework.Rectangle?(r), color46, 0.0f, origin7, projectile.scale * 2f, effects1, 0.0f); + if ((double) projectile.ai[1] != -1.0 && (double) projectile.Opacity > 0.300000011920929) + { + Vector2 v = Main.projectile[(int) projectile.ai[1]].Center - projectile.Center; + Vector2 scale = new Vector2(1f, v.Length() / (float) texture2D7.Height); + float rotation = v.ToRotation() + 1.570796f; + float num334 = MathHelper.Clamp(MathHelper.Distance(30f, projectile.localAI[1]) / 20f, 0.0f, 1f); + if ((double) num334 > 0.0) + { + Main.spriteBatch.Draw(texture2D7, position16 + v / 2f, new Microsoft.Xna.Framework.Rectangle?(r), color46 * num334, rotation, origin7, scale, effects1, 0.0f); + Main.spriteBatch.Draw(texture2D7, position16 + v / 2f, new Microsoft.Xna.Framework.Rectangle?(r), alpha * num334, rotation, origin7, scale / 2f, effects1, 0.0f); + } + } + } + else if (projectile.type == 658) + { + Microsoft.Xna.Framework.Color color47 = Main.hslToRgb(0.136f, 1f, 0.5f).MultiplyRGBA(new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0)); + Main.spriteBatch.Draw(texture2D7, position16, new Microsoft.Xna.Framework.Rectangle?(r), color47, 0.0f, origin7, new Vector2(1f, 5f) * projectile.scale * 2f, effects1, 0.0f); + } + Main.spriteBatch.Draw(texture2D7, position16, new Microsoft.Xna.Framework.Rectangle?(r), alpha, projectile.rotation, origin7, projectile.scale, effects1, 0.0f); + if (projectile.type == 535) + { + for (int i2 = 0; i2 < 1000; ++i2) + { + if (Main.projectile[i2].active && Main.projectile[i2].owner == projectile.owner && Main.projectile[i2].type == 536) + this.DrawProj(i2); + } + } + else if (projectile.type == 702) + { + Texture2D texture2D9 = Main.FlameTexture[5]; + Vector2 origin9 = texture2D9.Size() / 2f; + Vector2 vector2 = new Vector2((float) (5 * projectile.spriteDirection), -10f).RotatedBy((double) projectile.rotation); + ulong seed = (ulong) ((double) projectile.localAI[0] / 4.0); + for (int index = 0; index < 5; ++index) + { + Microsoft.Xna.Framework.Color color48 = new Microsoft.Xna.Framework.Color(100, 100, 100, 0); + float x20 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.15f; + float y27 = (float) Utils.RandomInt(ref seed, -10, 1) * 0.35f; + Main.spriteBatch.Draw(texture2D9, position16 + vector2 + new Vector2(x20, y27), new Microsoft.Xna.Framework.Rectangle?(), color48, projectile.rotation, origin9, 1f, effects1, 0.0f); + } + } + else if (projectile.type == 663 || projectile.type == 665 || projectile.type == 667) + { + Texture2D texture = Main.glowMaskTexture[221]; + switch (projectile.type) + { + case 665: + texture = Main.glowMaskTexture[222]; + break; + case 667: + texture = Main.glowMaskTexture[223]; + break; + } + float num335 = (float) ((double) ((float) ((double) projectile.localAI[0] / 100.0 * 6.28318548202515)).ToRotationVector2().X * 1.0 + 1.0); + Microsoft.Xna.Framework.Color color49 = new Microsoft.Xna.Framework.Color(140, 100, 40, 0) * (float) ((double) num335 / 4.0 + 0.5) * 1f; + for (float num336 = 0.0f; (double) num336 < 4.0; ++num336) + Main.spriteBatch.Draw(texture, position16 + (num336 * 1.570796f).ToRotationVector2() * num335, new Microsoft.Xna.Framework.Rectangle?(r), color49, projectile.rotation, origin7, projectile.scale, effects1, 0.0f); + } + else if (projectile.type == 644) + Main.spriteBatch.Draw(texture2D7, position16, new Microsoft.Xna.Framework.Rectangle?(r), alpha, 0.0f, origin7, projectile.scale, effects1, 0.0f); + else if (projectile.type == 658) + Main.spriteBatch.Draw(texture2D7, position16, new Microsoft.Xna.Framework.Rectangle?(r), alpha, 0.0f, origin7, new Vector2(1f, 8f) * projectile.scale, effects1, 0.0f); + else if (projectile.type == 602) + { + Texture2D texture2D10 = Main.extraTexture[60]; + Microsoft.Xna.Framework.Color color50 = alpha; + color50.A = (byte) 0; + Microsoft.Xna.Framework.Color color51 = color50 * 0.3f; + origin7 = texture2D10.Size() / 2f; + Main.spriteBatch.Draw(texture2D10, position16, new Microsoft.Xna.Framework.Rectangle?(), color51, projectile.rotation - 1.570796f, origin7, projectile.scale, effects1, 0.0f); + Texture2D texture2D11 = Main.extraTexture[59]; + Microsoft.Xna.Framework.Color color52 = alpha; + color52.A = (byte) 0; + color52 *= 0.13f; + origin7 = texture2D11.Size() / 2f; + Main.spriteBatch.Draw(texture2D11, position16, new Microsoft.Xna.Framework.Rectangle?(), color52, projectile.rotation - 1.570796f, origin7, projectile.scale * 0.9f, effects1, 0.0f); + } + else if (projectile.type == 539) + Main.spriteBatch.Draw(Main.glowMaskTexture[140], position16, new Microsoft.Xna.Framework.Rectangle?(r), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), projectile.rotation, origin7, projectile.scale, effects1, 0.0f); + else if (projectile.type == 613) + Main.spriteBatch.Draw(Main.glowMaskTexture[189], position16, new Microsoft.Xna.Framework.Rectangle?(r), new Microsoft.Xna.Framework.Color(128 - projectile.alpha / 2, 128 - projectile.alpha / 2, 128 - projectile.alpha / 2, 0), projectile.rotation, origin7, projectile.scale, effects1, 0.0f); + else if (projectile.type == 614) + Main.spriteBatch.Draw(Main.glowMaskTexture[190], position16, new Microsoft.Xna.Framework.Rectangle?(r), new Microsoft.Xna.Framework.Color(128 - projectile.alpha / 2, 128 - projectile.alpha / 2, 128 - projectile.alpha / 2, 0), projectile.rotation, origin7, projectile.scale, effects1, 0.0f); + else if (projectile.type == 574) + Main.spriteBatch.Draw(Main.glowMaskTexture[148], position16, new Microsoft.Xna.Framework.Rectangle?(r), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), projectile.rotation, origin7, projectile.scale, effects1, 0.0f); + else if (projectile.type == 691 || projectile.type == 692 || projectile.type == 693) + { + Texture2D texture = Main.glowMaskTexture[235]; + switch (projectile.type) + { + case 692: + texture = Main.glowMaskTexture[236]; + break; + case 693: + texture = Main.glowMaskTexture[237]; + break; + } + Main.spriteBatch.Draw(texture, position16, new Microsoft.Xna.Framework.Rectangle?(r), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue), projectile.rotation, origin7, projectile.scale, effects1, 0.0f); + } + else if (projectile.type == 590) + Main.spriteBatch.Draw(Main.glowMaskTexture[168], position16, new Microsoft.Xna.Framework.Rectangle?(r), new Microsoft.Xna.Framework.Color((int) sbyte.MaxValue - projectile.alpha / 2, (int) sbyte.MaxValue - projectile.alpha / 2, (int) sbyte.MaxValue - projectile.alpha / 2, 0), projectile.rotation, origin7, projectile.scale, effects1, 0.0f); + else if (projectile.type == 623 || projectile.type >= 625 && projectile.type <= 628) + { + if ((double) Main.player[projectile.owner].ghostFade != 0.0) + { + float num337 = Main.player[projectile.owner].ghostFade * 5f; + for (float num338 = 0.0f; (double) num338 < 4.0; ++num338) + Main.spriteBatch.Draw(texture2D7, position16 + Vector2.UnitY.RotatedBy((double) num338 * 6.28318548202515 / 4.0) * num337, new Microsoft.Xna.Framework.Rectangle?(r), alpha * 0.1f, projectile.rotation, origin7, projectile.scale, effects1, 0.0f); + } + } + else if (projectile.type == 643) + { + float num339 = (float) (Math.Cos(6.28318548202515 * ((double) projectile.localAI[0] / 60.0)) + 3.0 + 3.0); + for (float num340 = 0.0f; (double) num340 < 4.0; ++num340) + Main.spriteBatch.Draw(texture2D7, position16 + Vector2.UnitY.RotatedBy((double) num340 * 1.57079637050629) * num339, new Microsoft.Xna.Framework.Rectangle?(r), alpha * 0.2f, projectile.rotation, origin7, projectile.scale, effects1, 0.0f); + } + else if (projectile.type == 650) + { + int num341 = (int) ((double) projectile.localAI[0] / 6.28318548202515); + float f = (float) ((double) projectile.localAI[0] % 6.28318548202515 - 3.14159274101257); + float num342 = (float) Math.IEEERemainder((double) projectile.localAI[1], 1.0); + if ((double) num342 < 0.0) + ++num342; + int num343 = (int) Math.Floor((double) projectile.localAI[1]); + float num344 = 5f; + float scale = (float) (1.0 + (double) num343 * 0.0199999995529652); + if ((double) num341 == 1.0) + num344 = 7f; + Vector2 vector2 = f.ToRotationVector2() * num342 * num344 * projectile.scale; + Texture2D texture2D12 = Main.extraTexture[66]; + Main.spriteBatch.Draw(texture2D12, position16 + vector2, new Microsoft.Xna.Framework.Rectangle?(), alpha, projectile.rotation, texture2D12.Size() / 2f, scale, SpriteEffects.None, 0.0f); + } + } + else if (projectile.type == 466) + { + Vector2 end1 = projectile.position + new Vector2((float) projectile.width, (float) projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Texture2D tex = Main.extraTexture[33]; + projectile.GetAlpha(color3); + Vector2 vector2 = new Vector2(projectile.scale) / 2f; + for (int index3 = 0; index3 < 3; ++index3) + { + Vector2 scale; + if (index3 == 0) + { + scale = new Vector2(projectile.scale) * 0.6f; + DelegateMethods.c_1 = new Microsoft.Xna.Framework.Color(115, 204, 219, 0) * 0.5f; + } + else if (index3 == 1) + { + scale = new Vector2(projectile.scale) * 0.4f; + DelegateMethods.c_1 = new Microsoft.Xna.Framework.Color(113, 251, (int) byte.MaxValue, 0) * 0.5f; + } + else + { + scale = new Vector2(projectile.scale) * 0.2f; + DelegateMethods.c_1 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * 0.5f; + } + DelegateMethods.f_1 = 1f; + for (int index4 = projectile.oldPos.Length - 1; index4 > 0; --index4) + { + if (!(projectile.oldPos[index4] == Vector2.Zero)) + { + Vector2 start = projectile.oldPos[index4] + new Vector2((float) projectile.width, (float) projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Vector2 end2 = projectile.oldPos[index4 - 1] + new Vector2((float) projectile.width, (float) projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Utils.DrawLaser(Main.spriteBatch, tex, start, end2, scale, new Utils.LaserLineFraming(DelegateMethods.LightningLaserDraw)); + } + } + if (projectile.oldPos[0] != Vector2.Zero) + { + DelegateMethods.f_1 = 1f; + Vector2 start = projectile.oldPos[0] + new Vector2((float) projectile.width, (float) projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Utils.DrawLaser(Main.spriteBatch, tex, start, end1, scale, new Utils.LaserLineFraming(DelegateMethods.LightningLaserDraw)); + } + } + } + else if (projectile.type == 580) + { + Vector2 end3 = projectile.position + new Vector2((float) projectile.width, (float) projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Texture2D tex = Main.extraTexture[33]; + projectile.GetAlpha(color3); + Vector2 vector2 = new Vector2(projectile.scale) / 2f; + for (int index5 = 0; index5 < 2; ++index5) + { + float num345 = (double) projectile.localAI[1] == -1.0 || (double) projectile.localAI[1] == 1.0 ? -0.2f : 0.0f; + Vector2 scale; + if (index5 == 0) + { + scale = new Vector2(projectile.scale) * (0.5f + num345); + DelegateMethods.c_1 = new Microsoft.Xna.Framework.Color(115, 244, 219, 0) * 0.5f; + } + else + { + scale = new Vector2(projectile.scale) * (0.3f + num345); + DelegateMethods.c_1 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * 0.5f; + } + DelegateMethods.f_1 = 1f; + for (int index6 = projectile.oldPos.Length - 1; index6 > 0; --index6) + { + if (!(projectile.oldPos[index6] == Vector2.Zero)) + { + Vector2 start = projectile.oldPos[index6] + new Vector2((float) projectile.width, (float) projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Vector2 end4 = projectile.oldPos[index6 - 1] + new Vector2((float) projectile.width, (float) projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Utils.DrawLaser(Main.spriteBatch, tex, start, end4, scale, new Utils.LaserLineFraming(DelegateMethods.LightningLaserDraw)); + } + } + if (projectile.oldPos[0] != Vector2.Zero) + { + DelegateMethods.f_1 = 1f; + Vector2 start = projectile.oldPos[0] + new Vector2((float) projectile.width, (float) projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Utils.DrawLaser(Main.spriteBatch, tex, start, end3, scale, new Utils.LaserLineFraming(DelegateMethods.LightningLaserDraw)); + } + } + } + else if (projectile.type == 445) + { + Vector2 position = projectile.position + new Vector2((float) projectile.width, (float) projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Texture2D texture9 = Main.projectileTexture[projectile.type]; + Microsoft.Xna.Framework.Color alpha = projectile.GetAlpha(color3); + Vector2 vector2_47 = Main.player[projectile.owner].RotatedRelativePoint(mountedCenter) + Vector2.UnitY * Main.player[projectile.owner].gfxOffY; + Vector2 v = position + Main.screenPosition - vector2_47; + Vector2 vector2_48 = Vector2.Normalize(v); + float num346 = v.Length(); + float rotation = v.ToRotation() + 1.570796f; + float num347 = -5f; + float num348 = num347 + 30f; + Vector2 vector2_49 = new Vector2(2f, num346 - num348); + Vector2 vector2_50 = Vector2.Lerp(position + Main.screenPosition, vector2_47 + vector2_48 * num348, 0.5f); + Vector2 spinningpoint = -Vector2.UnitY.RotatedBy((double) projectile.localAI[0] / 60.0 * 3.14159274101257); + Vector2[] vector2Array = new Vector2[4] + { + spinningpoint, + spinningpoint.RotatedBy(1.57079637050629), + spinningpoint.RotatedBy(3.14159274101257), + spinningpoint.RotatedBy(4.71238899230957) + }; + if ((double) num346 > (double) num348) + { + for (int index = 0; index < 2; ++index) + { + Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; + Microsoft.Xna.Framework.Color color53; + if (index % 2 == 0) + { + Microsoft.Xna.Framework.Color limeGreen = Microsoft.Xna.Framework.Color.LimeGreen; + limeGreen.A = (byte) 128; + color53 = limeGreen * 0.5f; + } + else + { + Microsoft.Xna.Framework.Color cornflowerBlue = Microsoft.Xna.Framework.Color.CornflowerBlue; + cornflowerBlue.A = (byte) 128; + color53 = cornflowerBlue * 0.5f; + } + Vector2 vector2_51 = new Vector2(vector2Array[index].X, 0.0f).RotatedBy((double) rotation) * 4f; + Main.spriteBatch.Draw(Main.magicPixel, vector2_50 - Main.screenPosition + vector2_51, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 1, 1)), color53, rotation, Vector2.One / 2f, new Vector2(2f, num346 - num348), effects1, 0.0f); + } + } + Texture2D texture10 = Main.itemTexture[Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type]; + Microsoft.Xna.Framework.Color color54 = Lighting.GetColor((int) vector2_47.X / 16, (int) vector2_47.Y / 16); + Main.spriteBatch.Draw(texture10, vector2_47 - Main.screenPosition + vector2_48 * num347, new Microsoft.Xna.Framework.Rectangle?(), color54, (float) ((double) projectile.rotation + 1.57079637050629 + (effects1 == SpriteEffects.None ? 3.14159274101257 : 0.0)), new Vector2(effects1 == SpriteEffects.None ? 0.0f : (float) texture10.Width, (float) texture10.Height / 2f) + Vector2.UnitY * 1f, Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].scale, effects1, 0.0f); + Main.spriteBatch.Draw(Main.glowMaskTexture[39], vector2_47 - Main.screenPosition + vector2_48 * num347, new Microsoft.Xna.Framework.Rectangle?(), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), (float) ((double) projectile.rotation + 1.57079637050629 + (effects1 == SpriteEffects.None ? 3.14159274101257 : 0.0)), new Vector2(effects1 == SpriteEffects.None ? 0.0f : (float) texture10.Width, (float) texture10.Height / 2f) + Vector2.UnitY * 1f, Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].scale, effects1, 0.0f); + if ((double) num346 > (double) num348) + { + for (int index = 2; index < 4; ++index) + { + Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; + Microsoft.Xna.Framework.Color color55; + if (index % 2 == 0) + { + Microsoft.Xna.Framework.Color limeGreen = Microsoft.Xna.Framework.Color.LimeGreen; + limeGreen.A = (byte) 128; + color55 = limeGreen * 0.5f; + } + else + { + Microsoft.Xna.Framework.Color cornflowerBlue = Microsoft.Xna.Framework.Color.CornflowerBlue; + cornflowerBlue.A = (byte) 128; + color55 = cornflowerBlue * 0.5f; + } + Vector2 vector2_52 = new Vector2(vector2Array[index].X, 0.0f).RotatedBy((double) rotation) * 4f; + Main.spriteBatch.Draw(Main.magicPixel, vector2_50 - Main.screenPosition + vector2_52, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 1, 1)), color55, rotation, Vector2.One / 2f, new Vector2(2f, num346 - num348), effects1, 0.0f); + } + } + float num349 = projectile.localAI[0] / 60f; + if ((double) num349 > 0.5) + num349 = 1f - num349; + Main.spriteBatch.Draw(texture9, position, new Microsoft.Xna.Framework.Rectangle?(), alpha * num349 * 2f, projectile.rotation, new Vector2((float) texture9.Width, (float) texture9.Height) / 2f, projectile.scale, effects1, 0.0f); + Main.spriteBatch.Draw(Main.glowMaskTexture[40], position, new Microsoft.Xna.Framework.Rectangle?(), alpha * (0.5f - num349) * 2f, projectile.rotation, new Vector2((float) texture9.Width, (float) texture9.Height) / 2f, projectile.scale, effects1, 0.0f); + } + else if (projectile.type >= 393 && projectile.type <= 395 || projectile.type == 398 || projectile.type == 423 || projectile.type == 450) + { + Texture2D texture11 = Main.projectileTexture[projectile.type]; + int height = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; + int y28 = height * projectile.frame; + Main.spriteBatch.Draw(texture11, projectile.Center - Main.screenPosition + new Vector2(0.0f, projectile.gfxOffY - 2f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y28, texture11.Width, height)), projectile.GetAlpha(color3), projectile.rotation, new Vector2((float) texture11.Width / 2f, (float) height / 2f), projectile.scale, effects1, 0.0f); + if (projectile.type == 398) + { + Texture2D miniMinotaurTexture = Main.miniMinotaurTexture; + Main.spriteBatch.Draw(miniMinotaurTexture, projectile.Center - Main.screenPosition + new Vector2(0.0f, projectile.gfxOffY - 2f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y28, miniMinotaurTexture.Width, height)), new Microsoft.Xna.Framework.Color(250, 250, 250, projectile.alpha), projectile.rotation, new Vector2((float) miniMinotaurTexture.Width / 2f, (float) height / 2f), projectile.scale, effects1, 0.0f); + } + if (projectile.type == 423) + { + Texture2D texture12 = Main.glowMaskTexture[0]; + Main.spriteBatch.Draw(texture12, projectile.Center - Main.screenPosition + new Vector2(0.0f, projectile.gfxOffY - 2f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y28, texture12.Width, height)), new Microsoft.Xna.Framework.Color(250, 250, 250, projectile.alpha), projectile.rotation, new Vector2((float) texture12.Width / 2f, (float) height / 2f), projectile.scale, effects1, 0.0f); + } + } + else if (projectile.type == 385) + { + Texture2D texture = Main.projectileTexture[projectile.type]; + int height = texture.Height / Main.projFrames[projectile.type]; + int y29 = height * projectile.frame; + int num350 = 8; + int num351 = 2; + float num352 = 0.4f; + for (int index = 1; index < num350; index += num351) + { + ref Vector2 local = ref projectile.oldPos[index]; + Microsoft.Xna.Framework.Color newColor = color3; + Microsoft.Xna.Framework.Color color56 = projectile.GetAlpha(newColor) * ((float) (num350 - index) / 15f); + Microsoft.Xna.Framework.Color alpha = projectile.GetAlpha(color3); + Vector2 vector2 = projectile.oldPos[index] - Main.screenPosition + new Vector2(x18 + (float) num213, (float) (projectile.height / 2) + projectile.gfxOffY); + Main.spriteBatch.Draw(texture, projectile.oldPos[index] + new Vector2((float) projectile.width, (float) projectile.height) / 2f - Main.screenPosition + new Vector2(0.0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y29, texture.Width, height)), Microsoft.Xna.Framework.Color.Lerp(alpha, color56, 0.3f), projectile.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), MathHelper.Lerp(projectile.scale, num352, (float) index / 15f), effects1, 0.0f); + } + Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition + new Vector2(0.0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y29, texture.Width, height)), projectile.GetAlpha(color3), projectile.rotation, new Vector2((float) texture.Width / 2f, (float) height / 2f), projectile.scale, effects1, 0.0f); + } + else if (projectile.type == 388) + { + Texture2D texture = Main.projectileTexture[projectile.type]; + int height = texture.Height / Main.projFrames[projectile.type]; + int y30 = height * projectile.frame; + int num353; + int num354; + if ((double) projectile.ai[0] == 2.0) + { + num353 = 10; + num354 = 1; + } + else + { + num354 = 2; + num353 = 5; + } + for (int index = 1; index < num353; index += num354) + { + ref Vector2 local = ref Main.npc[i].oldPos[index]; + Microsoft.Xna.Framework.Color newColor = color3; + Microsoft.Xna.Framework.Color color57 = projectile.GetAlpha(newColor) * ((float) (num353 - index) / 15f); + Vector2 position = projectile.oldPos[index] - Main.screenPosition + new Vector2(x18 + (float) num213, (float) (projectile.height / 2) + projectile.gfxOffY); + Main.spriteBatch.Draw(texture, position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y30, texture.Width, height)), color57, projectile.rotation, new Vector2(x18, (float) (projectile.height / 2 + num212)), projectile.scale, effects1, 0.0f); + } + Main.spriteBatch.Draw(texture, projectile.position - Main.screenPosition + new Vector2(x18 + (float) num213, (float) (projectile.height / 2) + projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y30, texture.Width, height)), projectile.GetAlpha(color3), projectile.rotation, new Vector2(x18, (float) (projectile.height / 2 + num212)), projectile.scale, effects1, 0.0f); + } + else if (Main.projFrames[projectile.type] > 1) + { + int height = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; + int y31 = height * projectile.frame; + if (projectile.type == 111) + { + Microsoft.Xna.Framework.Color oldColor = new Microsoft.Xna.Framework.Color((int) Main.player[projectile.owner].shirtColor.R, (int) Main.player[projectile.owner].shirtColor.G, (int) Main.player[projectile.owner].shirtColor.B); + Microsoft.Xna.Framework.Color color58 = Lighting.GetColor((int) ((double) projectile.position.X + (double) projectile.width * 0.5) / 16, (int) (((double) projectile.position.Y + (double) projectile.height * 0.5) / 16.0), oldColor); + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], new Vector2(projectile.position.X - Main.screenPosition.X + x18 + (float) num213, projectile.position.Y - Main.screenPosition.Y + (float) (projectile.height / 2) + projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y31, Main.projectileTexture[projectile.type].Width, height)), projectile.GetAlpha(color58), projectile.rotation, new Vector2(x18, (float) (projectile.height / 2 + num212)), projectile.scale, effects1, 0.0f); + } + else + { + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], new Vector2(projectile.position.X - Main.screenPosition.X + x18 + (float) num213, projectile.position.Y - Main.screenPosition.Y + (float) (projectile.height / 2) + projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y31, Main.projectileTexture[projectile.type].Width, height - 1)), projectile.GetAlpha(color3), projectile.rotation, new Vector2(x18, (float) (projectile.height / 2 + num212)), projectile.scale, effects1, 0.0f); + if (projectile.type == 387) + Main.spriteBatch.Draw(Main.eyeLaserSmallTexture, new Vector2(projectile.position.X - Main.screenPosition.X + x18 + (float) num213, projectile.position.Y - Main.screenPosition.Y + (float) (projectile.height / 2) + projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, y31, Main.projectileTexture[projectile.type].Width, height)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), projectile.rotation, new Vector2(x18, (float) (projectile.height / 2 + num212)), projectile.scale, effects1, 0.0f); + } + } + else if (projectile.type == 383 || projectile.type == 399) + { + Texture2D texture = Main.projectileTexture[projectile.type]; + Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(), projectile.GetAlpha(color3), projectile.rotation, new Vector2((float) texture.Width, (float) texture.Height) / 2f, projectile.scale, effects1, 0.0f); + } + else if (projectile.type == 157 || projectile.type == 378) + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], new Vector2(projectile.position.X - Main.screenPosition.X + (float) (projectile.width / 2), projectile.position.Y - Main.screenPosition.Y + (float) (projectile.height / 2)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.projectileTexture[projectile.type].Width, Main.projectileTexture[projectile.type].Height)), projectile.GetAlpha(color3), projectile.rotation, new Vector2((float) (Main.projectileTexture[projectile.type].Width / 2), (float) (Main.projectileTexture[projectile.type].Height / 2)), projectile.scale, effects1, 0.0f); + else if (projectile.type == 306) + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], new Vector2(projectile.position.X - Main.screenPosition.X + (float) (projectile.width / 2), projectile.position.Y - Main.screenPosition.Y + (float) (projectile.height / 2)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.projectileTexture[projectile.type].Width, Main.projectileTexture[projectile.type].Height)), projectile.GetAlpha(color3), projectile.rotation, new Vector2((float) (Main.projectileTexture[projectile.type].Width / 2), (float) (Main.projectileTexture[projectile.type].Height / 2)), projectile.scale, effects1, 0.0f); + else if (projectile.type == 256) + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], new Vector2(projectile.position.X - Main.screenPosition.X + (float) (projectile.width / 2), projectile.position.Y - Main.screenPosition.Y + (float) (projectile.height / 2)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.projectileTexture[projectile.type].Width, Main.projectileTexture[projectile.type].Height)), projectile.GetAlpha(color3), projectile.rotation, new Vector2((float) (Main.projectileTexture[projectile.type].Width / 2), (float) (Main.projectileTexture[projectile.type].Height / 2)), projectile.scale, effects1, 0.0f); + else if (projectile.aiStyle == 27) + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], new Vector2(projectile.position.X - Main.screenPosition.X + (float) (projectile.width / 2), projectile.position.Y - Main.screenPosition.Y + (float) (projectile.height / 2)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.projectileTexture[projectile.type].Width, Main.projectileTexture[projectile.type].Height)), projectile.GetAlpha(color3), projectile.rotation, new Vector2((float) Main.projectileTexture[projectile.type].Width, 0.0f), projectile.scale, effects1, 0.0f); + else if (projectile.aiStyle == 19) + { + Vector2 zero = Vector2.Zero; + if (projectile.spriteDirection == -1) + zero.X = (float) Main.projectileTexture[projectile.type].Width; + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], new Vector2(projectile.position.X - Main.screenPosition.X + (float) (projectile.width / 2), projectile.position.Y - Main.screenPosition.Y + (float) (projectile.height / 2) + projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.projectileTexture[projectile.type].Width, Main.projectileTexture[projectile.type].Height)), projectile.GetAlpha(color3), projectile.rotation, zero, projectile.scale, effects1, 0.0f); + } + else if (projectile.type == 451) + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(), projectile.GetAlpha(color3), projectile.rotation, new Vector2((float) Main.projectileTexture[projectile.type].Width, 0.0f), projectile.scale, effects1, 0.0f); + else if (projectile.type == 434) + { + Vector2 vector2_53 = new Vector2(projectile.ai[0], projectile.ai[1]); + Vector2 v = projectile.position - vector2_53; + float y32 = (float) Math.Sqrt((double) v.X * (double) v.X + (double) v.Y * (double) v.Y); + Vector2 vector2_54 = new Vector2(4f, y32); + float rotation = v.ToRotation() + 1.570796f; + Vector2 vector2_55 = Vector2.Lerp(projectile.position, vector2_53, 0.5f); + Microsoft.Xna.Framework.Color red = Microsoft.Xna.Framework.Color.Red; + red.A = (byte) 0; + Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; + red *= projectile.localAI[0]; + Microsoft.Xna.Framework.Color color59 = white * projectile.localAI[0]; + float num355 = (float) Math.Sqrt((double) (projectile.damage / 50)); + Main.spriteBatch.Draw(Main.magicPixel, vector2_55 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 1, 1)), red, rotation, Vector2.One / 2f, new Vector2(2f * num355, y32 + 8f), effects1, 0.0f); + Main.spriteBatch.Draw(Main.magicPixel, vector2_55 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 1, 1)), red, rotation, Vector2.One / 2f, new Vector2(4f * num355, y32), effects1, 0.0f); + Main.spriteBatch.Draw(Main.magicPixel, vector2_55 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 1, 1)), color59, rotation, Vector2.One / 2f, new Vector2(2f * num355, y32), effects1, 0.0f); + } + else + { + if (projectile.type == 94 && (double) projectile.ai[1] > 6.0) + { + for (int index = 0; index < 10; ++index) + { + Microsoft.Xna.Framework.Color alpha = projectile.GetAlpha(color3); + float num356 = (float) (9 - index) / 9f; + alpha.R = (byte) ((double) alpha.R * (double) num356); + alpha.G = (byte) ((double) alpha.G * (double) num356); + alpha.B = (byte) ((double) alpha.B * (double) num356); + alpha.A = (byte) ((double) alpha.A * (double) num356); + float num357 = (float) (9 - index) / 9f; + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], new Vector2(projectile.oldPos[index].X - Main.screenPosition.X + x18 + (float) num213, projectile.oldPos[index].Y - Main.screenPosition.Y + (float) (projectile.height / 2) + projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.projectileTexture[projectile.type].Width, Main.projectileTexture[projectile.type].Height)), alpha, projectile.rotation, new Vector2(x18, (float) (projectile.height / 2 + num212)), num357 * projectile.scale, effects1, 0.0f); + } + } + if (projectile.type == 301) + { + for (int index = 0; index < 10; ++index) + { + Microsoft.Xna.Framework.Color alpha = projectile.GetAlpha(color3); + float num358 = (float) (9 - index) / 9f; + alpha.R = (byte) ((double) alpha.R * (double) num358); + alpha.G = (byte) ((double) alpha.G * (double) num358); + alpha.B = (byte) ((double) alpha.B * (double) num358); + alpha.A = (byte) ((double) alpha.A * (double) num358); + float num359 = (float) (9 - index) / 9f; + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], new Vector2(projectile.oldPos[index].X - Main.screenPosition.X + x18 + (float) num213, projectile.oldPos[index].Y - Main.screenPosition.Y + (float) (projectile.height / 2) + projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.projectileTexture[projectile.type].Width, Main.projectileTexture[projectile.type].Height)), alpha, projectile.rotation, new Vector2(x18, (float) (projectile.height / 2 + num212)), num359 * projectile.scale, effects1, 0.0f); + } + } + if (projectile.type == 323 && projectile.alpha == 0) + { + for (int index = 1; index < 8; ++index) + { + float num360 = projectile.velocity.X * (float) index; + float num361 = projectile.velocity.Y * (float) index; + Microsoft.Xna.Framework.Color alpha = projectile.GetAlpha(color3); + float num362 = 0.0f; + if (index == 1) + num362 = 0.7f; + if (index == 2) + num362 = 0.6f; + if (index == 3) + num362 = 0.5f; + if (index == 4) + num362 = 0.4f; + if (index == 5) + num362 = 0.3f; + if (index == 6) + num362 = 0.2f; + if (index == 7) + num362 = 0.1f; + alpha.R = (byte) ((double) alpha.R * (double) num362); + alpha.G = (byte) ((double) alpha.G * (double) num362); + alpha.B = (byte) ((double) alpha.B * (double) num362); + alpha.A = (byte) ((double) alpha.A * (double) num362); + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], new Vector2(projectile.position.X - Main.screenPosition.X + x18 + (float) num213 - num360, projectile.position.Y - Main.screenPosition.Y + (float) (projectile.height / 2) + projectile.gfxOffY - num361), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.projectileTexture[projectile.type].Width, Main.projectileTexture[projectile.type].Height)), alpha, projectile.rotation, new Vector2(x18, (float) (projectile.height / 2 + num212)), num362 + 0.2f, effects1, 0.0f); + } + } + if (projectile.type == 117 && (double) projectile.ai[0] > 3.0) + { + for (int index = 1; index < 5; ++index) + { + float num363 = projectile.velocity.X * (float) index; + float num364 = projectile.velocity.Y * (float) index; + Microsoft.Xna.Framework.Color alpha = projectile.GetAlpha(color3); + float num365 = 0.0f; + if (index == 1) + num365 = 0.4f; + if (index == 2) + num365 = 0.3f; + if (index == 3) + num365 = 0.2f; + if (index == 4) + num365 = 0.1f; + alpha.R = (byte) ((double) alpha.R * (double) num365); + alpha.G = (byte) ((double) alpha.G * (double) num365); + alpha.B = (byte) ((double) alpha.B * (double) num365); + alpha.A = (byte) ((double) alpha.A * (double) num365); + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], new Vector2(projectile.position.X - Main.screenPosition.X + x18 + (float) num213 - num363, projectile.position.Y - Main.screenPosition.Y + (float) (projectile.height / 2) + projectile.gfxOffY - num364), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.projectileTexture[projectile.type].Width, Main.projectileTexture[projectile.type].Height)), alpha, projectile.rotation, new Vector2(x18, (float) (projectile.height / 2 + num212)), projectile.scale, effects1, 0.0f); + } + } + if (projectile.bobber) + { + if ((double) projectile.ai[1] > 0.0 && (double) projectile.ai[1] < 3930.0 && (double) projectile.ai[0] == 1.0) + { + int index = (int) projectile.ai[1]; + Vector2 center = projectile.Center; + float num366 = projectile.rotation; + Vector2 vector2 = center; + float num367 = x1 - vector2.X; + float num368 = y1 - vector2.Y; + num366 = (float) Math.Atan2((double) num368, (double) num367); + float rotation; + if ((double) projectile.velocity.X > 0.0) + { + effects1 = SpriteEffects.None; + rotation = (float) Math.Atan2((double) num368, (double) num367) + 0.785f; + if ((double) projectile.ai[1] == 2342.0) + rotation -= 0.785f; + } + else + { + effects1 = SpriteEffects.FlipHorizontally; + rotation = (float) Math.Atan2(-(double) num368, -(double) num367) - 0.785f; + if ((double) projectile.ai[1] == 2342.0) + rotation += 0.785f; + } + Main.spriteBatch.Draw(Main.itemTexture[index], new Vector2(center.X - Main.screenPosition.X, center.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[index].Width, Main.itemTexture[index].Height)), color3, rotation, new Vector2((float) (Main.itemTexture[index].Width / 2), (float) (Main.itemTexture[index].Height / 2)), projectile.scale, effects1, 0.0f); + } + else if ((double) projectile.ai[0] <= 1.0) + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], new Vector2(projectile.position.X - Main.screenPosition.X + x18 + (float) num213, projectile.position.Y - Main.screenPosition.Y + (float) (projectile.height / 2) + projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.projectileTexture[projectile.type].Width, Main.projectileTexture[projectile.type].Height)), projectile.GetAlpha(color3), projectile.rotation, new Vector2(x18, (float) (projectile.height / 2 + num212)), projectile.scale, effects1, 0.0f); + } + else + { + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], new Vector2(projectile.position.X - Main.screenPosition.X + x18 + (float) num213, projectile.position.Y - Main.screenPosition.Y + (float) (projectile.height / 2) + projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.projectileTexture[projectile.type].Width, Main.projectileTexture[projectile.type].Height)), projectile.GetAlpha(color3), projectile.rotation, new Vector2(x18, (float) (projectile.height / 2 + num212)), projectile.scale, effects1, 0.0f); + if (projectile.glowMask != (short) -1) + Main.spriteBatch.Draw(Main.glowMaskTexture[(int) projectile.glowMask], new Vector2(projectile.position.X - Main.screenPosition.X + x18 + (float) num213, projectile.position.Y - Main.screenPosition.Y + (float) (projectile.height / 2) + projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.projectileTexture[projectile.type].Width, Main.projectileTexture[projectile.type].Height)), new Microsoft.Xna.Framework.Color(250, 250, 250, projectile.alpha), projectile.rotation, new Vector2(x18, (float) (projectile.height / 2 + num212)), projectile.scale, effects1, 0.0f); + if (projectile.type == 473) + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], new Vector2(projectile.position.X - Main.screenPosition.X + x18 + (float) num213, projectile.position.Y - Main.screenPosition.Y + (float) (projectile.height / 2) + projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.projectileTexture[projectile.type].Width, Main.projectileTexture[projectile.type].Height)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, 0, 0), projectile.rotation, new Vector2(x18, (float) (projectile.height / 2 + num212)), projectile.scale, effects1, 0.0f); + } + if (projectile.type == 106) + Main.spriteBatch.Draw(Main.lightDiscTexture, new Vector2(projectile.position.X - Main.screenPosition.X + x18 + (float) num213, projectile.position.Y - Main.screenPosition.Y + (float) (projectile.height / 2)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.projectileTexture[projectile.type].Width, Main.projectileTexture[projectile.type].Height)), new Microsoft.Xna.Framework.Color(200, 200, 200, 0), projectile.rotation, new Vector2(x18, (float) (projectile.height / 2 + num212)), projectile.scale, effects1, 0.0f); + if (projectile.type == 554 || projectile.type == 603) + { + for (int index = 1; index < 5; ++index) + { + float num369 = (float) ((double) projectile.velocity.X * (double) index * 0.5); + float num370 = (float) ((double) projectile.velocity.Y * (double) index * 0.5); + Microsoft.Xna.Framework.Color alpha = projectile.GetAlpha(color3); + float num371 = 0.0f; + if (index == 1) + num371 = 0.4f; + if (index == 2) + num371 = 0.3f; + if (index == 3) + num371 = 0.2f; + if (index == 4) + num371 = 0.1f; + alpha.R = (byte) ((double) alpha.R * (double) num371); + alpha.G = (byte) ((double) alpha.G * (double) num371); + alpha.B = (byte) ((double) alpha.B * (double) num371); + alpha.A = (byte) ((double) alpha.A * (double) num371); + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], new Vector2(projectile.position.X - Main.screenPosition.X + x18 + (float) num213 - num369, projectile.position.Y - Main.screenPosition.Y + (float) (projectile.height / 2) + projectile.gfxOffY - num370), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.projectileTexture[projectile.type].Width, Main.projectileTexture[projectile.type].Height)), alpha, projectile.rotation, new Vector2(x18, (float) (projectile.height / 2 + num212)), projectile.scale, effects1, 0.0f); + } + } + else if (projectile.type == 604) + { + int num372 = (int) projectile.ai[1] + 1; + if (num372 > 7) + num372 = 7; + for (int index = 1; index < num372; ++index) + { + float num373 = (float) ((double) projectile.velocity.X * (double) index * 1.5); + float num374 = (float) ((double) projectile.velocity.Y * (double) index * 1.5); + Microsoft.Xna.Framework.Color alpha = projectile.GetAlpha(color3); + float num375 = 0.0f; + if (index == 1) + num375 = 0.4f; + if (index == 2) + num375 = 0.3f; + if (index == 3) + num375 = 0.2f; + if (index == 4) + num375 = 0.1f; + float num376 = (float) (0.400000005960464 - (double) index * 0.0599999986588955) * (float) (1.0 - (double) projectile.alpha / (double) byte.MaxValue); + alpha.R = (byte) ((double) alpha.R * (double) num376); + alpha.G = (byte) ((double) alpha.G * (double) num376); + alpha.B = (byte) ((double) alpha.B * (double) num376); + alpha.A = (byte) ((double) alpha.A * (double) num376 / 2.0); + float scale = projectile.scale - (float) index * 0.1f; + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], new Vector2(projectile.position.X - Main.screenPosition.X + x18 + (float) num213 - num373, projectile.position.Y - Main.screenPosition.Y + (float) (projectile.height / 2) + projectile.gfxOffY - num374), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.projectileTexture[projectile.type].Width, Main.projectileTexture[projectile.type].Height)), alpha, projectile.rotation, new Vector2(x18, (float) (projectile.height / 2 + num212)), scale, effects1, 0.0f); + } + } + else if (projectile.type == 553) + { + for (int index = 1; index < 5; ++index) + { + float num377 = (float) ((double) projectile.velocity.X * (double) index * 0.400000005960464); + float num378 = (float) ((double) projectile.velocity.Y * (double) index * 0.400000005960464); + Microsoft.Xna.Framework.Color alpha = projectile.GetAlpha(color3); + float num379 = 0.0f; + if (index == 1) + num379 = 0.4f; + if (index == 2) + num379 = 0.3f; + if (index == 3) + num379 = 0.2f; + if (index == 4) + num379 = 0.1f; + alpha.R = (byte) ((double) alpha.R * (double) num379); + alpha.G = (byte) ((double) alpha.G * (double) num379); + alpha.B = (byte) ((double) alpha.B * (double) num379); + alpha.A = (byte) ((double) alpha.A * (double) num379); + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], new Vector2(projectile.position.X - Main.screenPosition.X + x18 + (float) num213 - num377, projectile.position.Y - Main.screenPosition.Y + (float) (projectile.height / 2) + projectile.gfxOffY - num378), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.projectileTexture[projectile.type].Width, Main.projectileTexture[projectile.type].Height)), alpha, projectile.rotation, new Vector2(x18, (float) (projectile.height / 2 + num212)), projectile.scale, effects1, 0.0f); + } } } } - Main.EntitySpriteDraw(texture2D1, position, new Microsoft.Xna.Framework.Rectangle?(r1), alpha, proj.rotation + num5, origin1, proj.scale, effects, 0); - } - - public static Vector2 GetPlayerArmPosition(Projectile proj) - { - Player player = Main.player[proj.owner]; - Vector2 vector2_1 = Main.OffsetsPlayerOnhand[player.bodyFrame.Y / 56] * 2f; - if (player.direction != 1) - vector2_1.X = (float) player.bodyFrame.Width - vector2_1.X; - if ((double) player.gravDir != 1.0) - vector2_1.Y = (float) player.bodyFrame.Height - vector2_1.Y; - Vector2 vector2_2 = vector2_1 - new Vector2((float) (player.bodyFrame.Width - player.width), (float) (player.bodyFrame.Height - 42)) / 2f; - return player.RotatedRelativePoint(player.MountedCenter - new Vector2(20f, 42f) / 2f + vector2_2 + Vector2.UnitY * player.gfxOffY); - } - - private void DrawProjWithStarryTrail(Projectile proj, Microsoft.Xna.Framework.Color projectileColor, SpriteEffects dir) - { - Microsoft.Xna.Framework.Color color1 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) projectileColor.A - proj.alpha); - Vector2 v = proj.velocity; - Microsoft.Xna.Framework.Color color2 = Microsoft.Xna.Framework.Color.Blue * 0.1f; - Vector2 spinningpoint = new Vector2(0.0f, -4f); - float num1 = 0.0f; - float num2 = Utils.GetLerpValue(3f, 5f, v.Length(), true); - bool flag = true; - if (proj.type == 856 || proj.type == 857) - { - Vector2 vector2 = proj.position - proj.oldPos[1]; - float num3 = vector2.Length(); - v = (double) num3 != 0.0 ? vector2 * (5f / num3) : Vector2.UnitY; - Vector2 Origin = new Vector2(proj.ai[0], proj.ai[1]); - Vector2 center = Main.player[proj.owner].Center; - float lerpValue1 = Utils.GetLerpValue(0.0f, 120f, Origin.Distance(center), true); - float from = 90f; - if (proj.type == 857) - { - from = 60f; - flag = false; - } - float lerpValue2 = Utils.GetLerpValue(from, from * 0.8333333f, proj.localAI[0], true); - float lerpValue3 = Utils.GetLerpValue(0.0f, 120f, proj.Center.Distance(center), true); - float num4 = lerpValue1 * lerpValue3; - float num5 = lerpValue2 * Utils.GetLerpValue(0.0f, 15f, proj.localAI[0], true); - color2 = Microsoft.Xna.Framework.Color.HotPink * 0.15f * (num5 * num4); - if (proj.type == 857) - color2 = proj.GetFirstFractalColor() * 0.15f * (num5 * num4); - spinningpoint = new Vector2(0.0f, -2f); - num1 = ((float) (-0.300000011920929 * (1.0 - (double) (Utils.GetLerpValue(from, from * 0.6666667f, proj.localAI[0], true) * Utils.GetLerpValue(0.0f, 20f, proj.localAI[0], true)))) + -1f * Utils.GetLerpValue(15f, 0.0f, proj.localAI[0], true)) * num4; - num2 = num5 * num4; - } - Vector2 vector2_1 = proj.Center + v; - Texture2D texture2D1 = TextureAssets.Projectile[proj.type].Value; - Vector2 vector2_2 = new Microsoft.Xna.Framework.Rectangle(0, 0, texture2D1.Width, texture2D1.Height).Size() / 2f; - Texture2D texture2D2 = TextureAssets.Extra[91].Value; - Microsoft.Xna.Framework.Rectangle rectangle = texture2D2.Frame(); - Vector2 origin1 = new Vector2((float) rectangle.Width / 2f, 10f); - Microsoft.Xna.Framework.Color color3 = Microsoft.Xna.Framework.Color.Cyan * 0.5f * num2; - Vector2 vector2_3 = new Vector2(0.0f, proj.gfxOffY); - float num6 = (float) Main.timeForVisualEffects / 60f; - Vector2 vector2_4 = vector2_1 + v * 0.5f; - Microsoft.Xna.Framework.Color color4 = Microsoft.Xna.Framework.Color.White * 0.5f * num2; - color4.A = (byte) 0; - Microsoft.Xna.Framework.Color color5 = color2 * num2; - color5.A = (byte) 0; - Microsoft.Xna.Framework.Color color6 = color2 * num2; - color6.A = (byte) 0; - Microsoft.Xna.Framework.Color color7 = color2 * num2; - color7.A = (byte) 0; - float rotation1 = v.ToRotation(); - Main.EntitySpriteDraw(texture2D2, vector2_4 - Main.screenPosition + vector2_3 + spinningpoint.RotatedBy(6.28318548202515 * (double) num6), new Microsoft.Xna.Framework.Rectangle?(rectangle), color5, rotation1 + 1.570796f, origin1, 1.5f + num1, SpriteEffects.None, 0); - Main.EntitySpriteDraw(texture2D2, vector2_4 - Main.screenPosition + vector2_3 + spinningpoint.RotatedBy(6.28318548202515 * (double) num6 + 2.09439516067505), new Microsoft.Xna.Framework.Rectangle?(rectangle), color6, rotation1 + 1.570796f, origin1, 1.1f + num1, SpriteEffects.None, 0); - Main.EntitySpriteDraw(texture2D2, vector2_4 - Main.screenPosition + vector2_3 + spinningpoint.RotatedBy(6.28318548202515 * (double) num6 + 4.1887903213501), new Microsoft.Xna.Framework.Rectangle?(rectangle), color7, rotation1 + 1.570796f, origin1, 1.3f + num1, SpriteEffects.None, 0); - Vector2 vector2_5 = vector2_1 - v * 0.5f; - for (float num7 = 0.0f; (double) num7 < 1.0; num7 += 0.5f) - { - float num8 = (float) (((double) num6 % 0.5 / 0.5 + (double) num7) % 1.0); - float num9 = num8 * 2f; - if ((double) num9 > 1.0) - num9 = 2f - num9; - Main.EntitySpriteDraw(texture2D2, vector2_5 - Main.screenPosition + vector2_3, new Microsoft.Xna.Framework.Rectangle?(rectangle), color4 * num9, rotation1 + 1.570796f, origin1, (float) (0.300000011920929 + (double) num8 * 0.5), SpriteEffects.None, 0); - } - if (!flag) + if (projectile.type != 525 || Main.gamePaused && !Main.gameMenu) return; - float rotation2 = proj.rotation + proj.localAI[1]; - double num10 = Main.timeForVisualEffects / 240.0; - double timeWrappedHourly = (double) Main.GlobalTimeWrappedHourly; - float num11 = Main.GlobalTimeWrappedHourly % 5f / 2.5f; - if ((double) num11 >= 1.0) - num11 = 2f - num11; - float num12 = (float) ((double) num11 * 0.5 + 0.5); - Vector2 position = proj.Center - Main.screenPosition; - Main.instance.LoadItem(75); - Texture2D texture2D3 = TextureAssets.Item[75].Value; - Microsoft.Xna.Framework.Rectangle r = texture2D3.Frame(verticalFrames: 8); - Vector2 origin2 = r.Size() / 2f; - Main.EntitySpriteDraw(texture2D3, position, new Microsoft.Xna.Framework.Rectangle?(r), color1, rotation2, origin2, proj.scale, SpriteEffects.None, 0); - } - - private static int TryInteractingWithVoidLens(Projectile proj) - { - if (Main.gamePaused || Main.gameMenu) - return 0; - bool flag1 = !Main.SmartCursorEnabled && !PlayerInput.UsingGamepad; - Player localPlayer = Main.LocalPlayer; - Microsoft.Xna.Framework.Point tileCoordinates = proj.Center.ToTileCoordinates(); - Vector2 center = localPlayer.Center; - if (!localPlayer.IsProjectileInteractibleAndInInteractionRange(proj, ref center)) - return 0; - Matrix matrix1 = Matrix.Invert(Main.GameViewMatrix.ZoomMatrix); - Vector2 position = Main.ReverseGravitySupport(Main.MouseScreen); - Vector2.Transform(Main.screenPosition, matrix1); - Matrix matrix2 = matrix1; - Vector2 v = Vector2.Transform(position, matrix2) + Main.screenPosition; - bool flag2 = proj.Hitbox.Contains(v.ToPoint()); - if (((flag2 ? 1 : (Main.SmartInteractProj == proj.whoAmI ? 1 : 0)) & (!localPlayer.lastMouseInterface ? 1 : 0)) == 0) - return !flag1 ? 1 : 0; - Main.HasInteractibleObjectThatIsNotATile = true; - if (flag2) - { - localPlayer.noThrow = 2; - localPlayer.cursorItemIconEnabled = true; - localPlayer.cursorItemIconID = 4131; - } - if (PlayerInput.UsingGamepad) - localPlayer.GamepadEnableGrappleCooldown(); - if (Main.mouseRight && Main.mouseRightRelease && Player.BlockInteractionWithProjectiles == 0) - { - Main.mouseRightRelease = false; - localPlayer.tileInteractAttempted = true; - localPlayer.tileInteractionHappened = true; - localPlayer.releaseUseTile = false; - if (localPlayer.chest == -5) - { - localPlayer.chest = -1; - SoundEngine.PlaySound(SoundID.Item130); - Recipe.FindRecipes(); - } - else - { - localPlayer.chest = -5; - for (int index = 0; index < 40; ++index) - ItemSlot.SetGlow(index, -1f, true); - localPlayer.voidLensChest = proj.whoAmI; - localPlayer.chestX = tileCoordinates.X; - localPlayer.chestY = tileCoordinates.Y; - localPlayer.SetTalkNPC(-1); - Main.SetNPCShopIndex(0); - Main.playerInventory = true; - SoundEngine.PlaySound(SoundID.Item130); - Recipe.FindRecipes(); - } - } - return !Main.SmartCursorEnabled && !PlayerInput.UsingGamepad || flag1 ? 0 : 2; - } - - private static int TryInteractingWithMoneyTrough(Projectile proj) - { - if (Main.gamePaused || Main.gameMenu) - return 0; - bool flag1 = !Main.SmartCursorEnabled && !PlayerInput.UsingGamepad; - Player localPlayer = Main.LocalPlayer; - Microsoft.Xna.Framework.Point tileCoordinates = proj.Center.ToTileCoordinates(); - Vector2 center = localPlayer.Center; - if (!localPlayer.IsProjectileInteractibleAndInInteractionRange(proj, ref center)) - return 0; - Matrix matrix1 = Matrix.Invert(Main.GameViewMatrix.ZoomMatrix); - Vector2 position = Main.ReverseGravitySupport(Main.MouseScreen); - Vector2.Transform(Main.screenPosition, matrix1); - Matrix matrix2 = matrix1; - Vector2 v = Vector2.Transform(position, matrix2) + Main.screenPosition; - bool flag2 = proj.Hitbox.Contains(v.ToPoint()); - if (((flag2 ? 1 : (Main.SmartInteractProj == proj.whoAmI ? 1 : 0)) & (!localPlayer.lastMouseInterface ? 1 : 0)) == 0) - return !flag1 ? 1 : 0; - Main.HasInteractibleObjectThatIsNotATile = true; - if (flag2) - { - localPlayer.noThrow = 2; - localPlayer.cursorItemIconEnabled = true; - localPlayer.cursorItemIconID = 3213; - } - if (PlayerInput.UsingGamepad) - localPlayer.GamepadEnableGrappleCooldown(); - if (Main.mouseRight && Main.mouseRightRelease && Player.BlockInteractionWithProjectiles == 0) - { - Main.mouseRightRelease = false; - localPlayer.tileInteractAttempted = true; - localPlayer.tileInteractionHappened = true; - localPlayer.releaseUseTile = false; - if (localPlayer.chest == -2) - { - localPlayer.chest = -1; - SoundEngine.PlaySound(SoundID.Item59); - Recipe.FindRecipes(); - } - else - { - localPlayer.chest = -2; - for (int index = 0; index < 40; ++index) - ItemSlot.SetGlow(index, -1f, true); - localPlayer.flyingPigChest = proj.whoAmI; - localPlayer.chestX = tileCoordinates.X; - localPlayer.chestY = tileCoordinates.Y; - localPlayer.SetTalkNPC(-1); - Main.SetNPCShopIndex(0); - Main.playerInventory = true; - SoundEngine.PlaySound(SoundID.Item59); - Recipe.FindRecipes(); - } - } - return !Main.SmartCursorEnabled && !PlayerInput.UsingGamepad || flag1 ? 0 : 2; - } - - public static void PrintTimedMessage(string message, params object[] arguments) => Console.WriteLine(string.Format("{0} {1}", (object) (int) Main.time, (object) string.Format(message, arguments))); - - private static void TryInteractingWithMoneyTrough2(Projectile proj) - { - if (Main.gamePaused && !Main.gameMenu) + Vector2 vector2_56 = projectile.position - Main.screenPosition; + if ((double) Main.mouseX <= (double) vector2_56.X || (double) Main.mouseX >= (double) vector2_56.X + (double) projectile.width || (double) Main.mouseY <= (double) vector2_56.Y || (double) Main.mouseY >= (double) vector2_56.Y + (double) projectile.height) return; - Vector2 vector2 = proj.position - Main.screenPosition; - if ((double) Main.mouseX <= (double) vector2.X || (double) Main.mouseX >= (double) vector2.X + (double) proj.width || (double) Main.mouseY <= (double) vector2.Y || (double) Main.mouseY >= (double) vector2.Y + (double) proj.height) - return; - int num1 = (int) ((double) Main.player[Main.myPlayer].Center.X / 16.0); - int num2 = (int) ((double) Main.player[Main.myPlayer].Center.Y / 16.0); - int num3 = (int) proj.Center.X / 16; - int num4 = (int) proj.Center.Y / 16; + int num380 = (int) ((double) Main.player[Main.myPlayer].Center.X / 16.0); + int num381 = (int) ((double) Main.player[Main.myPlayer].Center.Y / 16.0); + int num382 = (int) projectile.Center.X / 16; + int num383 = (int) projectile.Center.Y / 16; int lastTileRangeX = Main.player[Main.myPlayer].lastTileRangeX; int lastTileRangeY = Main.player[Main.myPlayer].lastTileRangeY; - if (num1 < num3 - lastTileRangeX || num1 > num3 + lastTileRangeX + 1 || num2 < num4 - lastTileRangeY || num2 > num4 + lastTileRangeY + 1) + if (num380 < num382 - lastTileRangeX || num380 > num382 + lastTileRangeX + 1 || num381 < num383 - lastTileRangeY || num381 > num383 + lastTileRangeY + 1) return; - Player localPlayer = Main.LocalPlayer; Main.player[Main.myPlayer].noThrow = 2; - Main.player[Main.myPlayer].cursorItemIconEnabled = true; - Main.player[Main.myPlayer].cursorItemIconID = 3213; + Main.player[Main.myPlayer].showItemIcon = true; + Main.player[Main.myPlayer].showItemIcon2 = 3213; if (PlayerInput.UsingGamepad) Main.player[Main.myPlayer].GamepadEnableGrappleCooldown(); - if (!Main.mouseRight || !Main.mouseRightRelease || Player.BlockInteractionWithProjectiles != 0) + if (!Main.mouseRight || !Main.mouseRightRelease || Player.StopMoneyTroughFromWorking != 0) return; Main.mouseRightRelease = false; - localPlayer.tileInteractAttempted = true; - localPlayer.tileInteractionHappened = true; - localPlayer.releaseUseTile = false; if (Main.player[Main.myPlayer].chest == -2) { - SoundEngine.PlaySound(SoundID.Item59); + Main.PlaySound(SoundID.Item59); Main.player[Main.myPlayer].chest = -1; Recipe.FindRecipes(); } else { - Main.player[Main.myPlayer].flyingPigChest = proj.whoAmI; + Main.player[Main.myPlayer].flyingPigChest = i; Main.player[Main.myPlayer].chest = -2; - Main.player[Main.myPlayer].chestX = (int) ((double) proj.Center.X / 16.0); - Main.player[Main.myPlayer].chestY = (int) ((double) proj.Center.Y / 16.0); - Main.player[Main.myPlayer].SetTalkNPC(-1); - Main.SetNPCShopIndex(0); + Main.player[Main.myPlayer].chestX = (int) ((double) projectile.Center.X / 16.0); + Main.player[Main.myPlayer].chestY = (int) ((double) projectile.Center.Y / 16.0); + Main.player[Main.myPlayer].talkNPC = -1; + Main.npcShop = 0; Main.playerInventory = true; - SoundEngine.PlaySound(SoundID.Item59); + Main.PlaySound(SoundID.Item59); Recipe.FindRecipes(); } } - public void PrepareDrawnEntityDrawing(Entity entity, int intendedShader) - { - Main.CurrentDrawnEntity = entity; - if (intendedShader != 0) - { - if (Main.CurrentDrawnEntityShader == 0 || Main.CurrentDrawnEntityShader == -1) - { - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.Transform); - } - } - else if (Main.CurrentDrawnEntityShader != 0 && Main.CurrentDrawnEntityShader != -1) - { - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.Transform); - } - Main.CurrentDrawnEntityShader = intendedShader; - } - - public static void EntitySpriteDraw( - Texture2D texture, - Vector2 position, - Microsoft.Xna.Framework.Rectangle? sourceRectangle, - Microsoft.Xna.Framework.Color color, - float rotation, - Vector2 origin, - float scale, - SpriteEffects effects, - int worthless) - { - Main.EntitySpriteDraw(texture, position, sourceRectangle, color, rotation, origin, new Vector2(scale), effects, worthless); - } - - public static void EntitySpriteDraw( - Texture2D texture, - Vector2 position, - Microsoft.Xna.Framework.Rectangle? sourceRectangle, - Microsoft.Xna.Framework.Color color, - float rotation, - Vector2 origin, - Vector2 scale, - SpriteEffects effects, - int worthless) - { - if (Main.CurrentDrawnEntityShader > 0) - { - DrawData drawData = new DrawData(texture, position, sourceRectangle, color, rotation, origin, scale, effects, worthless); - GameShaders.Armor.Apply(Main.CurrentDrawnEntityShader, Main.CurrentDrawnEntity, new DrawData?(drawData)); - drawData.Draw(Main.spriteBatch); - } - else - Main.spriteBatch.Draw(texture, position, sourceRectangle, color, rotation, origin, scale, effects, (float) worthless); - } - - public static void EntitySpriteDraw(DrawData data) - { - if (Main.CurrentDrawnEntityShader > 0) - { - GameShaders.Armor.Apply(Main.CurrentDrawnEntityShader, Main.CurrentDrawnEntity, new DrawData?(data)); - data.Draw(Main.spriteBatch); - } - else - data.Draw(Main.spriteBatch); - } - - public static Microsoft.Xna.Framework.Color buffColor( + private static Microsoft.Xna.Framework.Color buffColor( Microsoft.Xna.Framework.Color newColor, float R, float G, @@ -26321,23 +24661,17 @@ label_56: this.DrawCacheProjsBehindNPCs.Clear(); this.DrawCacheProjsBehindProjectiles.Clear(); this.DrawCacheProjsOverWiresUI.Clear(); - this.DrawCacheProjsOverPlayers.Clear(); - this.DrawCacheFirstFractals.Clear(); for (int index1 = 0; index1 < 1000; ++index1) { if (Main.projectile[index1].active) { - if (Main.projectile[index1].type == 857) - this.DrawCacheFirstFractals.Add(index1); - if (Main.projectile[index1].type == 578 || Main.projectile[index1].type == 579 || Main.projectile[index1].type == 641 || Main.projectile[index1].type == 617 || Main.projectile[index1].type == 813) + if (Main.projectile[index1].type == 578 || Main.projectile[index1].type == 579 || Main.projectile[index1].type == 641 || Main.projectile[index1].type == 617) this.DrawCacheProjsBehindNPCsAndTiles.Add(index1); - if (Main.projectile[index1].type == 625 || Main.projectile[index1].type == 626 || Main.projectile[index1].type == 627 || Main.projectile[index1].type == 628 || Main.projectile[index1].type == 525 || Main.projectile[index1].type == 734 || Main.projectile[index1].type == 946 || Main.projectile[index1].type == 908 && (double) Main.projectile[index1].localAI[0] <= 0.0) + if (Main.projectile[index1].type == 625 || Main.projectile[index1].type == 626 || Main.projectile[index1].type == 627 || Main.projectile[index1].type == 628) this.DrawCacheProjsBehindProjectiles.Add(index1); - if (Main.projectile[index1].type == 759 || Main.projectile[index1].type == 908 && (double) Main.projectile[index1].localAI[0] > 0.0) - this.DrawCacheProjsOverPlayers.Add(index1); if (Main.projectile[index1].type == 651) this.DrawCacheProjsOverWiresUI.Add(index1); - if (Main.projectile[index1].type == 673 || Main.projectile[index1].type == 674 || Main.projectile[index1].type == 691 || Main.projectile[index1].type == 692 || Main.projectile[index1].type == 693 || Main.projectile[index1].type == 923) + if (Main.projectile[index1].type == 673 || Main.projectile[index1].type == 674 || Main.projectile[index1].type == 691 || Main.projectile[index1].type == 692 || Main.projectile[index1].type == 693) this.DrawCacheProjsBehindNPCs.Add(index1); if (Main.projectile[index1].type == 636 || Main.projectile[index1].type == 598) { @@ -26345,7 +24679,7 @@ label_56: if ((double) Main.projectile[index1].ai[0] == 1.0) { int index2 = (int) Main.projectile[index1].ai[1]; - if (index2 >= 0 && index2 < 200 && Main.npc[index2].active && Main.npc[index2].type != 492) + if (index2 >= 0 && index2 < 200 && Main.npc[index2].active) { if (Main.npc[index2].behindTiles) this.DrawCacheProjsBehindNPCsAndTiles.Add(index1); @@ -26379,7 +24713,7 @@ label_56: protected void DrawCachedProjs(List projCache, bool startSpriteBatch = true) { if (startSpriteBatch) - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.Transform); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, this.Rasterizer, (Effect) null, Main.Transform); for (int index = 0; index < projCache.Count; ++index) { try @@ -26397,118 +24731,40 @@ label_56: Main.spriteBatch.End(); } - protected void DrawSuperSpecialProjectiles(List projCache, bool startSpriteBatch = true) - { - if (startSpriteBatch) - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.Transform); - for (int index1 = 0; index1 < projCache.Count; ++index1) - { - try - { - int index2 = projCache[index1]; - Projectile projectile = Main.projectile[index2]; - int owner = projectile.owner; - Player other = Main.player[owner]; - if (Main.playerVisualClone[owner] == null) - Main.playerVisualClone[owner] = new Player(); - Player drawPlayer = Main.playerVisualClone[owner]; - drawPlayer.CopyVisuals(other); - drawPlayer.isFirstFractalAfterImage = true; - drawPlayer.firstFractalAfterImageOpacity = projectile.Opacity * 1f; - drawPlayer.ResetEffects(); - drawPlayer.ResetVisibleAccessories(); - drawPlayer.UpdateDyes(); - drawPlayer.DisplayDollUpdate(); - drawPlayer.UpdateSocialShadow(); - drawPlayer.itemAnimationMax = 60; - drawPlayer.itemAnimation = (int) projectile.localAI[0]; - drawPlayer.itemRotation = projectile.velocity.ToRotation(); - drawPlayer.heldProj = index2; - drawPlayer.Center = projectile.Center - projectile.velocity.SafeNormalize(Vector2.Zero) * 42f; - drawPlayer.direction = (double) projectile.velocity.X > 0.0 ? 1 : -1; - drawPlayer.itemRotation = (float) Math.Atan2((double) projectile.velocity.Y * (double) drawPlayer.direction, (double) projectile.velocity.X * (double) drawPlayer.direction); - drawPlayer.velocity.Y = 0.01f; - drawPlayer.wingFrame = 2; - drawPlayer.PlayerFrame(); - drawPlayer.socialIgnoreLight = true; - Main.PlayerRenderer.DrawPlayer(Main.Camera, drawPlayer, drawPlayer.position, 0.0f, drawPlayer.fullRotationOrigin); - } - catch (Exception ex) - { - TimeLogger.DrawException(ex); - Main.projectile[projCache[index1]].active = false; - } - } - if (!startSpriteBatch) - return; - Main.spriteBatch.End(); - } - protected void SortDrawCacheWorms() { - this.SortBabyBirdProjectiles(this.DrawCacheProjsOverPlayers); - this.SortStardustDragonProjectiles(this.DrawCacheProjsBehindProjectiles); - } - - private void SortBabyBirdProjectiles(List list) - { - List intList = new List(); - for (int index1 = list.Count - 1; index1 >= 0; --index1) - { - int index2 = list[index1]; - if (Main.projectile[index2].type == 759) - { - intList.Add(index2); - list.RemoveAt(index1); - Projectile projectile = Main.projectile[index2]; - Player master = Main.player[projectile.owner]; - int stackedIndex = (int) projectile.localAI[0]; - if (projectile.frame == Main.projFrames[projectile.type] - 1) - { - projectile.Center = Projectile.AI_158_GetHomeLocation(master, stackedIndex); - projectile.velocity = Vector2.Zero; - } - } - } - list.AddRange((IEnumerable) intList); - intList.Clear(); - } - - private void SortStardustDragonProjectiles(List list) - { + List behindProjectiles = this.DrawCacheProjsBehindProjectiles; + if (behindProjectiles.Count == 0) + return; List> intListList = new List>(); - for (int index1 = 0; index1 < list.Count; ++index1) + for (int index1 = 0; index1 < behindProjectiles.Count; ++index1) { - int index2 = list[index1]; + int index2 = behindProjectiles[index1]; if (Main.projectile[index2].type == 628) { - list.Remove(index2); - List intList1 = new List(); - intList1.Insert(0, index2); - for (int byUuid = Projectile.GetByUUID(Main.projectile[index2].owner, Main.projectile[index2].ai[0]); byUuid >= 0 && !intList1.Contains(byUuid) && Main.projectile[byUuid].active && Main.projectile[byUuid].type >= 625 && Main.projectile[byUuid].type <= 627; byUuid = Projectile.GetByUUID(Main.projectile[byUuid].owner, Main.projectile[byUuid].ai[0])) + behindProjectiles.Remove(index2); + List intList = new List(); + intList.Insert(0, index2); + for (int byUuid = Projectile.GetByUUID(Main.projectile[index2].owner, Main.projectile[index2].ai[0]); byUuid >= 0 && !intList.Contains(byUuid) && Main.projectile[byUuid].active && Main.projectile[byUuid].type >= 625 && Main.projectile[byUuid].type <= 627; byUuid = Projectile.GetByUUID(Main.projectile[byUuid].owner, Main.projectile[byUuid].ai[0])) { - intList1.Add(byUuid); - list.Remove(byUuid); + intList.Insert(0, byUuid); + behindProjectiles.Remove(byUuid); } - List intList2 = new List(); - for (int index3 = intList1.Count - 2; index3 >= 0; --index3) - intList2.Add(intList1[index3]); - intList2.Add(intList1[intList1.Count - 1]); - intListList.Add(intList2); + intListList.Add(intList); index1 = -1; } } - List intList = new List((IEnumerable) list); - intListList.Add(intList); - list.Clear(); - for (int index4 = 0; index4 < intListList.Count; ++index4) + List intList1 = new List((IEnumerable) this.DrawCacheProjsBehindProjectiles); + intListList.Add(intList1); + this.DrawCacheProjsBehindProjectiles.Clear(); + for (int index3 = 0; index3 < intListList.Count; ++index3) { - for (int index5 = 0; index5 < intListList[index4].Count; ++index5) - list.Add(intListList[index4][index5]); + for (int index4 = 0; index4 < intListList[index3].Count; ++index4) + this.DrawCacheProjsBehindProjectiles.Add(intListList[index3][index4]); } - for (int index = 0; index < list.Count; ++index) + for (int index = 0; index < this.DrawCacheProjsBehindProjectiles.Count; ++index) { - Projectile projectile1 = Main.projectile[list[index]]; + Projectile projectile1 = Main.projectile[this.DrawCacheProjsBehindProjectiles[index]]; int byUuid = Projectile.GetByUUID(projectile1.owner, projectile1.ai[0]); if (projectile1.type >= 626 && projectile1.type <= 628 && byUuid >= 0 && ProjectileID.Sets.StardustDragon[Main.projectile[byUuid].type]) { @@ -26528,132 +24784,476 @@ label_56: protected void DrawWoF() { - if ((Main.wofNPCIndex < 0 || !Main.npc[Main.wofNPCIndex].active ? 0 : (Main.npc[Main.wofNPCIndex].life > 0 ? 1 : 0)) == 0) + if (Main.wof < 0 || !Main.player[Main.myPlayer].gross) return; - for (int i = 0; i < (int) byte.MaxValue; ++i) + for (int index = 0; index < (int) byte.MaxValue; ++index) { - if (Main.player[i].active && Main.player[i].tongued && !Main.player[i].dead) - Main.DrawWOFTongueToPlayer(i); + if (Main.player[index].active && Main.player[index].tongued && !Main.player[index].dead) + { + float num1 = Main.npc[Main.wof].position.X + (float) (Main.npc[Main.wof].width / 2); + float num2 = Main.npc[Main.wof].position.Y + (float) (Main.npc[Main.wof].height / 2); + Vector2 vector2 = new Vector2(Main.player[index].position.X + (float) Main.player[index].width * 0.5f, Main.player[index].position.Y + (float) Main.player[index].height * 0.5f); + float num3 = num1 - vector2.X; + float num4 = num2 - vector2.Y; + float rotation = (float) Math.Atan2((double) num4, (double) num3) - 1.57f; + bool flag = true; + while (flag) + { + float num5 = (float) Math.Sqrt((double) num3 * (double) num3 + (double) num4 * (double) num4); + if ((double) num5 < 40.0) + { + flag = false; + } + else + { + float num6 = (float) Main.chain12Texture.Height / num5; + float num7 = num3 * num6; + float num8 = num4 * num6; + vector2.X += num7; + vector2.Y += num8; + num3 = num1 - vector2.X; + num4 = num2 - vector2.Y; + Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); + Main.spriteBatch.Draw(Main.chain12Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain12Texture.Width, Main.chain12Texture.Height)), color, rotation, new Vector2((float) Main.chain12Texture.Width * 0.5f, (float) Main.chain12Texture.Height * 0.5f), 1f, SpriteEffects.None, 0.0f); + } + } + } } - for (int i = 0; i < 200; ++i) + for (int index = 0; index < 200; ++index) { - if (Main.npc[i].active && Main.npc[i].aiStyle == 29) - Main.DrawWOFRopeToTheHungry(i); + if (Main.npc[index].active && Main.npc[index].aiStyle == 29) + { + float num9 = Main.npc[Main.wof].position.X + (float) (Main.npc[Main.wof].width / 2); + float y = Main.npc[Main.wof].position.Y; + float num10 = (float) (Main.wofB - Main.wofT); + bool flag1 = false; + if (Main.npc[index].frameCounter > 7.0) + flag1 = true; + float num11 = (float) Main.wofT + num10 * Main.npc[index].ai[0]; + Vector2 vector2 = new Vector2(Main.npc[index].position.X + (float) (Main.npc[index].width / 2), Main.npc[index].position.Y + (float) (Main.npc[index].height / 2)); + float num12 = num9 - vector2.X; + float num13 = num11 - vector2.Y; + float rotation = (float) Math.Atan2((double) num13, (double) num12) - 1.57f; + bool flag2 = true; + while (flag2) + { + SpriteEffects effects = SpriteEffects.None; + if (flag1) + { + effects = SpriteEffects.FlipHorizontally; + flag1 = false; + } + else + flag1 = true; + int height = 28; + float num14 = (float) Math.Sqrt((double) num12 * (double) num12 + (double) num13 * (double) num13); + if ((double) num14 < 40.0) + { + height = (int) num14 - 40 + 28; + flag2 = false; + } + float num15 = 28f / num14; + float num16 = num12 * num15; + float num17 = num13 * num15; + vector2.X += num16; + vector2.Y += num17; + num12 = num9 - vector2.X; + num13 = num11 - vector2.Y; + Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); + Main.spriteBatch.Draw(Main.chain12Texture, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chain4Texture.Width, height)), color, rotation, new Vector2((float) Main.chain4Texture.Width * 0.5f, (float) Main.chain4Texture.Height * 0.5f), 1f, effects, 0.0f); + } + } } - Main.DrawWOFBody(); - } - - private static void DrawWOFBody() - { - int num1 = TextureAssets.Wof.Height() / 3; - float wofDrawAreaTop = (float) Main.wofDrawAreaTop; - float wofDrawAreaBottom = (float) Main.wofDrawAreaBottom; - float num2 = Main.screenPosition.Y + (float) Main.screenHeight; - float num3 = (float) ((int) (((double) wofDrawAreaTop - (double) Main.screenPosition.Y) / (double) num1) + 1); - if ((double) num3 > 12.0) - return; - float num4 = num3 * (float) num1; - if ((double) num4 > 0.0) - wofDrawAreaTop -= num4; - float x1 = Main.npc[Main.wofNPCIndex].position.X; - if (Main.npc[Main.wofNPCIndex].direction > 0) + int num18 = 140; + float wofT = (float) Main.wofT; + float wofB = (float) Main.wofB; + float num19 = Main.screenPosition.Y + (float) Main.screenHeight; + float num20 = (float) ((int) (((double) wofT - (double) Main.screenPosition.Y) / (double) num18) + 1) * (float) num18; + if ((double) num20 > 0.0) + wofT -= num20; + float num21 = wofT; + float x1 = Main.npc[Main.wof].position.X; + float num22 = num19 - wofT; + bool flag3 = true; + SpriteEffects effects1 = SpriteEffects.None; + if (Main.npc[Main.wof].spriteDirection == 1) + effects1 = SpriteEffects.FlipHorizontally; + if (Main.npc[Main.wof].direction > 0) x1 -= 80f; - SpriteEffects effects = SpriteEffects.None; - if (Main.npc[Main.wofNPCIndex].spriteDirection == 1) - effects = SpriteEffects.FlipHorizontally; - int num5 = Main.wofDrawFrameIndex / 6 * num1; - if (!Main.gamePaused && ++Main.wofDrawFrameIndex >= 18) - Main.wofDrawFrameIndex = 0; - float num6 = num2 - wofDrawAreaTop; - for (int index1 = (int) wofDrawAreaTop; (double) index1 < (double) num2; index1 += num1) + int num23 = 0; + if (!Main.gamePaused) + ++Main.wofF; + if (Main.wofF > 12) { - float num7 = num2 - (float) index1; - if ((double) num7 > (double) num1) - num7 = (float) num1; - for (int index2 = 0; (double) index2 < (double) num7; index2 += 16) + num23 = 280; + if (Main.wofF > 17) + Main.wofF = 0; + } + else if (Main.wofF > 6) + num23 = 140; + while (flag3) + { + float num24 = num19 - num21; + if ((double) num24 > (double) num18) + num24 = (float) num18; + bool flag4 = true; + int num25 = 0; + while (flag4) { - int x2 = (int) ((double) x1 + (double) (TextureAssets.Wof.Width() / 2)) / 16; - int y = (index1 + index2) / 16; - Main.spriteBatch.Draw(TextureAssets.Wof.Value, new Vector2(x1 - Main.screenPosition.X, (float) (index1 + index2) - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, num5 + index2, TextureAssets.Wof.Width(), 16)), Lighting.GetColor(x2, y), 0.0f, new Vector2(), 1f, effects, 0.0f); + int x2 = (int) ((double) x1 + (double) (Main.wofTexture.Width / 2)) / 16; + int y = (int) ((double) num21 + (double) num25) / 16; + Main.spriteBatch.Draw(Main.wofTexture, new Vector2(x1 - Main.screenPosition.X, num21 + (float) num25 - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, num23 + num25, Main.wofTexture.Width, 16)), Lighting.GetColor(x2, y), 0.0f, new Vector2(), 1f, effects1, 0.0f); + num25 += 16; + if ((double) num25 >= (double) num24) + flag4 = false; } + num21 += (float) num18; + if ((double) num21 >= (double) num19) + flag3 = false; } } - private static void DrawWOFRopeToTheHungry(int i) + protected void DrawGhost(Player drawPlayer, Vector2 Position, float shadow = 0.0f) { - float num1 = Main.npc[Main.wofNPCIndex].position.X + (float) (Main.npc[Main.wofNPCIndex].width / 2); - float y = Main.npc[Main.wofNPCIndex].position.Y; - float num2 = (float) (Main.wofDrawAreaBottom - Main.wofDrawAreaTop); - bool flag1 = false; - if (Main.npc[i].frameCounter > 7.0) - flag1 = true; - float num3 = (float) Main.wofDrawAreaTop + num2 * Main.npc[i].ai[0]; - Vector2 vector2 = new Vector2(Main.npc[i].position.X + (float) (Main.npc[i].width / 2), Main.npc[i].position.Y + (float) (Main.npc[i].height / 2)); - float num4 = num1 - vector2.X; - float num5 = num3 - vector2.Y; - float rotation = (float) Math.Atan2((double) num5, (double) num4) - 1.57f; - bool flag2 = true; - while (flag2) - { - SpriteEffects effects = SpriteEffects.None; - if (flag1) - { - effects = SpriteEffects.FlipHorizontally; - flag1 = false; - } - else - flag1 = true; - int height = 28; - float num6 = (float) Math.Sqrt((double) num4 * (double) num4 + (double) num5 * (double) num5); - if ((double) num6 < 40.0) - { - height = (int) num6 - 40 + 28; - flag2 = false; - } - float num7 = 28f / num6; - float num8 = num4 * num7; - float num9 = num5 * num7; - vector2.X += num8; - vector2.Y += num9; - num4 = num1 - vector2.X; - num5 = num3 - vector2.Y; - Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - Main.spriteBatch.Draw(TextureAssets.Chain12.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain4.Width(), height)), color, rotation, new Vector2((float) TextureAssets.Chain4.Width() * 0.5f, (float) TextureAssets.Chain4.Height() * 0.5f), 1f, effects, 0.0f); - } + SpriteEffects effects = drawPlayer.direction != 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Microsoft.Xna.Framework.Color immuneAlpha = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int) ((double) drawPlayer.position.X + (double) drawPlayer.width * 0.5) / 16, (int) ((double) drawPlayer.position.Y + (double) drawPlayer.height * 0.5) / 16, new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor / 2 + 100, (int) Main.mouseTextColor / 2 + 100, (int) Main.mouseTextColor / 2 + 100, (int) Main.mouseTextColor / 2 + 100)), shadow); + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, Main.ghostTexture.Height / 4 * drawPlayer.ghostFrame, Main.ghostTexture.Width, Main.ghostTexture.Height / 4); + Vector2 origin = new Vector2((float) rectangle.Width * 0.5f, (float) rectangle.Height * 0.5f); + Main.spriteBatch.Draw(Main.ghostTexture, new Vector2((float) (int) ((double) drawPlayer.position.X - (double) Main.screenPosition.X + (double) (rectangle.Width / 2)), (float) (int) ((double) drawPlayer.position.Y - (double) Main.screenPosition.Y + (double) (rectangle.Height / 2))), new Microsoft.Xna.Framework.Rectangle?(rectangle), immuneAlpha, 0.0f, origin, 1f, effects, 0.0f); } - private static void DrawWOFTongueToPlayer(int i) + protected Vector2 DrawPlayerItemPos(float gravdir, int itemtype) { - float num1 = Main.npc[Main.wofNPCIndex].position.X + (float) (Main.npc[Main.wofNPCIndex].width / 2); - float num2 = Main.npc[Main.wofNPCIndex].position.Y + (float) (Main.npc[Main.wofNPCIndex].height / 2); - Vector2 vector2 = new Vector2(Main.player[i].position.X + (float) Main.player[i].width * 0.5f, Main.player[i].position.Y + (float) Main.player[i].height * 0.5f); - float num3 = num1 - vector2.X; - float num4 = num2 - vector2.Y; - float rotation = (float) Math.Atan2((double) num4, (double) num3) - 1.57f; - bool flag = true; - while (flag) + float num = 10f; + Vector2 vector2 = new Vector2((float) (Main.itemTexture[itemtype].Width / 2), (float) (Main.itemTexture[itemtype].Height / 2)); + if (itemtype == 95) { - float num5 = (float) Math.Sqrt((double) num3 * (double) num3 + (double) num4 * (double) num4); - if ((double) num5 < 40.0) + num = 6f; + vector2.Y += 2f * gravdir; + } + else if (itemtype == 1295) + num = 4f; + else if (itemtype == 3611) + num = 2f; + else if (itemtype == 3350) + num = 2f; + else if (itemtype == 2624) + num = 4f; + else if (itemtype == 3018) + num = 2f; + else if (itemtype == 3007) + { + num = 4f; + vector2.Y += 4f * gravdir; + } + else if (itemtype == 3107) + { + num = 4f; + vector2.Y += 2f * gravdir; + } + else if (itemtype == 3008) + { + num = -12f; + vector2.Y += 2f * gravdir; + } + else if (itemtype == 1255) + { + num = 6f; + vector2.Y += 0.0f * gravdir; + } + else if (itemtype == 2269) + { + num = 2f; + vector2.Y += 2f * gravdir; + } + else if (itemtype == 1265) + { + num = -8f; + vector2.Y += 4f * gravdir; + } + else if (itemtype == 2272) + { + num = 0.0f; + vector2.Y += 4f * gravdir; + } + else if (itemtype == 3029) + num = 4f; + else if (itemtype == 2796) + { + num = -28f; + vector2.Y += 2f * gravdir; + } + else if (itemtype == 2797) + num = 0.0f; + else if (itemtype == 2610) + num = 0.0f; + else if (itemtype == 2623) + { + num = -30f; + vector2.Y -= 4f * gravdir; + } + else if (itemtype == 3546) + { + num = -14f; + vector2.Y -= 6f * gravdir; + } + else if (itemtype == 1835) + { + num = -2f; + vector2.Y += 2f * gravdir; + } + else if (itemtype == 2624) + num = -4f; + else if (itemtype == 3859) + num = -2f; + else if (itemtype == 2888) + num = 6f; + else if (itemtype == 2223) + { + num = 2f; + vector2.Y -= 2f * gravdir; + } + else if (itemtype == 1782) + { + num = 0.0f; + vector2.Y += 4f * gravdir; + } + else if (itemtype == 1929) + { + num = 0.0f; + vector2.Y += 2f * gravdir; + } + else if (itemtype == 2270) + num = -4f; + else if (itemtype == 1784) + { + num = 0.0f; + vector2.Y += 4f * gravdir; + } + else if (itemtype == 1000) + { + num = 6f; + vector2.Y += 0.0f * gravdir; + } + else if (itemtype == 1178) + { + num = 4f; + vector2.Y += 0.0f * gravdir; + } + else if (itemtype == 1319) + { + num = 0.0f; + vector2.Y += 0.0f * gravdir; + } + else if (itemtype == 1297) + { + num = -8f; + vector2.Y += 0.0f * gravdir; + } + else if (itemtype == 1121) + { + num = 6f; + vector2.Y -= 2f * gravdir; + } + else if (itemtype == 1314) + num = 2f; + else if (itemtype == 1258) + { + num = 2f; + vector2.Y -= 2f * gravdir; + } + else if (itemtype == 1155) + { + num = -10f; + vector2.Y -= 2f * gravdir; + } + else if (itemtype == 1156) + num = -2f; + else if (itemtype == 96) + { + num = -8f; + vector2.Y += 2f * gravdir; + } + else if (itemtype == 1870) + { + num = -8f; + vector2.Y += 2f * gravdir; + } + else if (itemtype == 1260) + { + num = -8f; + vector2.Y += 2f * gravdir; + } + else if (itemtype == 1254) + { + num = -6f; + vector2.Y += 2f * gravdir; + } + else if (itemtype == 98) + { + num = -5f; + vector2.Y -= 2f * gravdir; + } + else if (itemtype == 534) + { + num = -2f; + vector2.Y += 1f * gravdir; + } + else if (itemtype == 679) + { + num = 0.0f; + vector2.Y += 2f * gravdir; + } + else if (itemtype == 964) + { + num = 0.0f; + vector2.Y += 0.0f * gravdir; + } + else if (itemtype == 533) + { + num = -7f; + vector2.Y -= 2f * gravdir; + } + else if (itemtype == 1553) + { + num = -10f; + vector2.Y -= 2f * gravdir; + } + else if (itemtype == 506) + { + num = 0.0f; + vector2.Y -= 2f * gravdir; + } + else if (itemtype == 1910) + { + num = 0.0f; + vector2.Y -= 2f * gravdir; + } + else if (itemtype == 494 || itemtype == 508) + { + num = -2f; + } + else + { + switch (itemtype) { - flag = false; - } - else - { - float num6 = (float) TextureAssets.Chain12.Height() / num5; - float num7 = num3 * num6; - float num8 = num4 * num6; - vector2.X += num7; - vector2.Y += num8; - num3 = num1 - vector2.X; - num4 = num2 - vector2.Y; - Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) vector2.X / 16, (int) ((double) vector2.Y / 16.0)); - Main.spriteBatch.Draw(TextureAssets.Chain12.Value, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chain12.Width(), TextureAssets.Chain12.Height())), color, rotation, new Vector2((float) TextureAssets.Chain12.Width() * 0.5f, (float) TextureAssets.Chain12.Height() * 0.5f), 1f, SpriteEffects.None, 0.0f); + case 434: + num = 0.0f; + vector2.Y -= 2f * gravdir; + break; + case 514: + num = 0.0f; + vector2.Y += 3f * gravdir; + break; + default: + if (itemtype == 435 || itemtype == 436 || itemtype == 481 || itemtype == 578 || itemtype == 1187 || itemtype == 1194 || itemtype == 1201 || itemtype == 1229) + { + num = -2f; + vector2.Y -= 2f * gravdir; + break; + } + switch (itemtype) + { + case 126: + num = 4f; + vector2.Y += 4f * gravdir; + break; + case (int) sbyte.MaxValue: + num = 4f; + vector2.Y += 2f * gravdir; + break; + case 157: + num = 6f; + vector2.Y += 2f * gravdir; + break; + case 160: + num = -8f; + break; + case 197: + num = -5f; + vector2.Y += 4f * gravdir; + break; + case 800: + num = 4f; + vector2.Y += 2f * gravdir; + break; + default: + if (itemtype == 164 || itemtype == 219) + { + num = 0.0f; + vector2.Y += 2f * gravdir; + break; + } + if (itemtype == 165 || itemtype == 272) + { + num = 4f; + vector2.Y += 4f * gravdir; + break; + } + switch (itemtype) + { + case 266: + num = 0.0f; + vector2.Y += 2f * gravdir; + break; + case 281: + num = 6f; + vector2.Y -= 6f * gravdir; + break; + case 682: + num = 4f; + break; + case 758: + num -= 20f; + vector2.Y += 0.0f * gravdir; + break; + case 759: + num -= 18f; + vector2.Y += 2f * gravdir; + break; + case 760: + num -= 12f; + vector2.Y += 2f * gravdir; + break; + case 779: + num = 0.0f; + vector2.Y += 2f * gravdir; + break; + case 905: + num = -5f; + vector2.Y += 0.0f * gravdir; + break; + case 930: + num = 4f; + vector2.Y += 2f * gravdir; + break; + case 986: + num = 6f; + vector2.Y -= 10f * gravdir; + break; + case 1946: + num -= 12f; + vector2.Y += 2f * gravdir; + break; + case 3788: + num = 2f; + vector2.Y += 2f * gravdir; + break; + case 3870: + num = 4f; + vector2.Y += 4f * gravdir; + break; + } + break; + } + break; } } + vector2.X = num; + return vector2; } - public static Microsoft.Xna.Framework.Color quickAlpha(Microsoft.Xna.Framework.Color oldColor, float Alpha) + protected Microsoft.Xna.Framework.Color quickAlpha(Microsoft.Xna.Framework.Color oldColor, float Alpha) { Microsoft.Xna.Framework.Color color = oldColor; color.R = (byte) ((double) color.R * (double) Alpha); @@ -26663,162 +25263,2597 @@ label_56: return color; } - private void DrawItem_GetBasics( - Item item, - int slot, - out Texture2D texture, - out Microsoft.Xna.Framework.Rectangle frame) + protected void DrawPlayerHead(Player drawPlayer, float X, float Y, float Alpha = 1f, float Scale = 1f) { - this.LoadItem(item.type); - if (ItemID.Sets.AnimatesAsSoul[item.type] || ItemID.Sets.NebulaPickup[item.type]) + int shaderId1 = 0; + int skinVariant = drawPlayer.skinVariant; + short shaderId2 = (short) drawPlayer.hairDye; + if (drawPlayer.head == 0 && shaderId2 == (short) 0) + shaderId2 = (short) 1; + for (int index1 = 0; index1 < 16 + drawPlayer.extraAccessorySlots * 2; ++index1) { - this.DrawItem_AnimateSlot(slot, Main.itemAnimations[item.type].TicksPerFrame, Main.itemAnimations[item.type].FrameCount); - texture = TextureAssets.Item[item.type].Value; + int index2 = index1 % 10; + if (drawPlayer.dye[index2] != null && drawPlayer.armor[index1].type > 0 && drawPlayer.armor[index1].stack > 0 && drawPlayer.armor[index1].faceSlot > (sbyte) 0 && drawPlayer.armor[index1].faceSlot < (sbyte) 9) + { + int dye = (int) drawPlayer.dye[index2].dye; + } } - else if (ItemID.Sets.IsFood[item.type]) + if (drawPlayer.face > (sbyte) 0 && drawPlayer.face < (sbyte) 9) + this.LoadAccFace((int) drawPlayer.face); + if (drawPlayer.dye[0] != null) + shaderId1 = (int) drawPlayer.dye[0].dye; + this.LoadHair(drawPlayer.hair); + float scale = Scale; + Microsoft.Xna.Framework.Color color1 = this.quickAlpha(Microsoft.Xna.Framework.Color.White, Alpha); + Microsoft.Xna.Framework.Color color2 = this.quickAlpha(drawPlayer.eyeColor, Alpha); + Microsoft.Xna.Framework.Color color3 = this.quickAlpha(drawPlayer.GetHairColor(false), Alpha); + Microsoft.Xna.Framework.Color color4 = this.quickAlpha(drawPlayer.skinColor, Alpha); + Microsoft.Xna.Framework.Color color5 = this.quickAlpha(Microsoft.Xna.Framework.Color.White, Alpha); + SpriteEffects spriteEffects = SpriteEffects.None; + if (drawPlayer.direction < 0) + spriteEffects = SpriteEffects.FlipHorizontally; + Vector2 origin = new Vector2((float) drawPlayer.legFrame.Width * 0.5f, (float) drawPlayer.legFrame.Height * 0.4f); + Vector2 position = drawPlayer.position; + Microsoft.Xna.Framework.Rectangle bodyFrame1 = drawPlayer.bodyFrame; + drawPlayer.bodyFrame.Y = 0; + drawPlayer.position = Main.screenPosition; + drawPlayer.position.X += X; + drawPlayer.position.Y += Y; + drawPlayer.position.X -= 6f; + drawPlayer.position.Y -= 4f; + float playerHeadOffset = (float) drawPlayer.mount.PlayerHeadOffset; + drawPlayer.position.Y -= playerHeadOffset; + if (drawPlayer.head > 0 && drawPlayer.head < 216) + this.LoadArmorHead(drawPlayer.head); + if (drawPlayer.face > (sbyte) 0 && drawPlayer.face < (sbyte) 9) + this.LoadAccFace((int) drawPlayer.face); + bool flag1 = false; + if (drawPlayer.head == 10 || drawPlayer.head == 12 || drawPlayer.head == 28 || drawPlayer.head == 62 || drawPlayer.head == 97 || drawPlayer.head == 106 || drawPlayer.head == 113 || drawPlayer.head == 116 || drawPlayer.head == 119 || drawPlayer.head == 133 || drawPlayer.head == 138 || drawPlayer.head == 139 || drawPlayer.head == 163 || drawPlayer.head == 178 || drawPlayer.head == 181 || drawPlayer.head == 191 || drawPlayer.head == 198) + flag1 = true; + bool flag2 = false; + if (drawPlayer.head == 161 || drawPlayer.head == 14 || drawPlayer.head == 15 || drawPlayer.head == 16 || drawPlayer.head == 18 || drawPlayer.head == 21 || drawPlayer.head == 24 || drawPlayer.head == 25 || drawPlayer.head == 26 || drawPlayer.head == 40 || drawPlayer.head == 44 || drawPlayer.head == 51 || drawPlayer.head == 56 || drawPlayer.head == 59 || drawPlayer.head == 60 || drawPlayer.head == 67 || drawPlayer.head == 68 || drawPlayer.head == 69 || drawPlayer.head == 114 || drawPlayer.head == 121 || drawPlayer.head == 126 || drawPlayer.head == 130 || drawPlayer.head == 136 || drawPlayer.head == 140 || drawPlayer.head == 145 || drawPlayer.head == 158 || drawPlayer.head == 159 || drawPlayer.head == 184 || drawPlayer.head == 190 || (double) drawPlayer.head == 92.0 || drawPlayer.head == 195) + flag2 = true; + if (drawPlayer.head != 38 && drawPlayer.head != 135) { - texture = TextureAssets.Item[item.type].Value; + Main.spriteBatch.Draw(Main.playerTextures[skinVariant, 0], new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float) (drawPlayer.bodyFrame.Width / 2) + (float) (drawPlayer.width / 2), (float) ((double) drawPlayer.position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color4, drawPlayer.headRotation, origin, scale, spriteEffects, 0.0f); + Main.spriteBatch.Draw(Main.playerTextures[skinVariant, 1], new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float) (drawPlayer.bodyFrame.Width / 2) + (float) (drawPlayer.width / 2), (float) ((double) drawPlayer.position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color1, drawPlayer.headRotation, origin, scale, spriteEffects, 0.0f); + Main.spriteBatch.Draw(Main.playerTextures[skinVariant, 2], new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float) (drawPlayer.bodyFrame.Width / 2) + (float) (drawPlayer.width / 2), (float) ((double) drawPlayer.position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color2, drawPlayer.headRotation, origin, scale, spriteEffects, 0.0f); + } + if (flag1) + { + DrawData drawData = new DrawData(Main.armorHeadTexture[drawPlayer.head], new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float) (drawPlayer.bodyFrame.Width / 2) + (float) (drawPlayer.width / 2), (float) ((double) drawPlayer.position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.headRotation, origin, scale, spriteEffects, 0); + GameShaders.Armor.Apply(shaderId1, (Entity) drawPlayer, new DrawData?(drawData)); + drawData.Draw(Main.spriteBatch); + Main.pixelShader.CurrentTechnique.Passes[0].Apply(); + if (!drawPlayer.invis) + { + Microsoft.Xna.Framework.Rectangle bodyFrame2 = drawPlayer.bodyFrame; + bodyFrame2.Y -= 336; + if (bodyFrame2.Y < 0) + bodyFrame2.Y = 0; + drawData = new DrawData(Main.playerHairTexture[drawPlayer.hair], new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float) (drawPlayer.bodyFrame.Width / 2) + (float) (drawPlayer.width / 2), (float) ((double) drawPlayer.position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin, new Microsoft.Xna.Framework.Rectangle?(bodyFrame2), color3, drawPlayer.headRotation, origin, scale, spriteEffects, 0); + GameShaders.Hair.Apply(shaderId2, drawPlayer, new DrawData?(drawData)); + drawData.Draw(Main.spriteBatch); + Main.pixelShader.CurrentTechnique.Passes[0].Apply(); + } + } + if (flag2) + { + Microsoft.Xna.Framework.Rectangle bodyFrame3 = drawPlayer.bodyFrame; + bodyFrame3.Y -= 336; + if (bodyFrame3.Y < 0) + bodyFrame3.Y = 0; + if (!drawPlayer.invis) + { + DrawData drawData = new DrawData(Main.playerHairAltTexture[drawPlayer.hair], new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float) (drawPlayer.bodyFrame.Width / 2) + (float) (drawPlayer.width / 2), (float) ((double) drawPlayer.position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin, new Microsoft.Xna.Framework.Rectangle?(bodyFrame3), color3, drawPlayer.headRotation, origin, scale, spriteEffects, 0); + GameShaders.Hair.Apply(shaderId2, drawPlayer, new DrawData?(drawData)); + drawData.Draw(Main.spriteBatch); + Main.pixelShader.CurrentTechnique.Passes[0].Apply(); + } + } + if (drawPlayer.head == 23) + { + Microsoft.Xna.Framework.Rectangle bodyFrame4 = drawPlayer.bodyFrame; + bodyFrame4.Y -= 336; + if (bodyFrame4.Y < 0) + bodyFrame4.Y = 0; + DrawData drawData; + if (!drawPlayer.invis) + { + drawData = new DrawData(Main.playerHairTexture[drawPlayer.hair], new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float) (drawPlayer.bodyFrame.Width / 2) + (float) (drawPlayer.width / 2), (float) ((double) drawPlayer.position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin, new Microsoft.Xna.Framework.Rectangle?(bodyFrame4), color3, drawPlayer.headRotation, origin, scale, spriteEffects, 0); + GameShaders.Hair.Apply(shaderId2, drawPlayer, new DrawData?(drawData)); + drawData.Draw(Main.spriteBatch); + Main.pixelShader.CurrentTechnique.Passes[0].Apply(); + } + drawData = new DrawData(Main.armorHeadTexture[drawPlayer.head], new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float) (drawPlayer.bodyFrame.Width / 2) + (float) (drawPlayer.width / 2), (float) ((double) drawPlayer.position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.headRotation, origin, scale, spriteEffects, 0); + GameShaders.Armor.Apply(shaderId1, (Entity) drawPlayer, new DrawData?(drawData)); + drawData.Draw(Main.spriteBatch); + Main.pixelShader.CurrentTechnique.Passes[0].Apply(); + } + else if (drawPlayer.head == 14 || drawPlayer.head == 56 || drawPlayer.head == 158) + { + Microsoft.Xna.Framework.Rectangle bodyFrame5 = drawPlayer.bodyFrame; + if (drawPlayer.head == 158) + bodyFrame5.Height -= 2; + int num = 0; + if (bodyFrame5.Y == bodyFrame5.Height * 6) + bodyFrame5.Height -= 2; + else if (bodyFrame5.Y == bodyFrame5.Height * 7) + num = -2; + else if (bodyFrame5.Y == bodyFrame5.Height * 8) + num = -2; + else if (bodyFrame5.Y == bodyFrame5.Height * 9) + num = -2; + else if (bodyFrame5.Y == bodyFrame5.Height * 10) + num = -2; + else if (bodyFrame5.Y == bodyFrame5.Height * 13) + bodyFrame5.Height -= 2; + else if (bodyFrame5.Y == bodyFrame5.Height * 14) + num = -2; + else if (bodyFrame5.Y == bodyFrame5.Height * 15) + num = -2; + else if (bodyFrame5.Y == bodyFrame5.Height * 16) + num = -2; + bodyFrame5.Y += num; + DrawData drawData = new DrawData(Main.armorHeadTexture[drawPlayer.head], new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float) (drawPlayer.bodyFrame.Width / 2) + (float) (drawPlayer.width / 2), (float) ((double) drawPlayer.position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0) + (float) num) + drawPlayer.headPosition + origin, new Microsoft.Xna.Framework.Rectangle?(bodyFrame5), color5, drawPlayer.headRotation, origin, scale, spriteEffects, 0); + GameShaders.Armor.Apply(shaderId1, (Entity) drawPlayer, new DrawData?(drawData)); + drawData.Draw(Main.spriteBatch); + Main.pixelShader.CurrentTechnique.Passes[0].Apply(); + } + else if (drawPlayer.head > 0 && drawPlayer.head < 216 && drawPlayer.head != 28) + { + DrawData drawData = new DrawData(Main.armorHeadTexture[drawPlayer.head], new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float) (drawPlayer.bodyFrame.Width / 2) + (float) (drawPlayer.width / 2), (float) ((double) drawPlayer.position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.headRotation, origin, scale, spriteEffects, 0); + GameShaders.Armor.Apply(shaderId1, (Entity) drawPlayer, new DrawData?(drawData)); + drawData.Draw(Main.spriteBatch); + Main.pixelShader.CurrentTechnique.Passes[0].Apply(); } else { - switch (item.type) + Microsoft.Xna.Framework.Rectangle bodyFrame6 = drawPlayer.bodyFrame; + bodyFrame6.Y -= 336; + if (bodyFrame6.Y < 0) + bodyFrame6.Y = 0; + DrawData drawData = new DrawData(Main.playerHairTexture[drawPlayer.hair], new Vector2(drawPlayer.position.X - Main.screenPosition.X - (float) (drawPlayer.bodyFrame.Width / 2) + (float) (drawPlayer.width / 2), (float) ((double) drawPlayer.position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin, new Microsoft.Xna.Framework.Rectangle?(bodyFrame6), color3, drawPlayer.headRotation, origin, scale, spriteEffects, 0); + GameShaders.Hair.Apply(shaderId2, drawPlayer, new DrawData?(drawData)); + drawData.Draw(Main.spriteBatch); + Main.pixelShader.CurrentTechnique.Passes[0].Apply(); + } + if (drawPlayer.face > (sbyte) 0 && drawPlayer.face < (sbyte) 9) + { + DrawData drawData = drawPlayer.face != (sbyte) 7 ? new DrawData(Main.accFaceTexture[(int) drawPlayer.face], new Vector2((float) (int) ((double) drawPlayer.position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) drawPlayer.position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.headRotation, origin, scale, spriteEffects, 0) : new DrawData(Main.accFaceTexture[(int) drawPlayer.face], new Vector2((float) (int) ((double) drawPlayer.position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) drawPlayer.position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), new Microsoft.Xna.Framework.Color(200, 200, 200, 150), drawPlayer.headRotation, origin, scale, spriteEffects, 0); + GameShaders.Armor.Apply(shaderId1, (Entity) drawPlayer, new DrawData?(drawData)); + drawData.Draw(Main.spriteBatch); + Main.pixelShader.CurrentTechnique.Passes[0].Apply(); + } + drawPlayer.position = position; + drawPlayer.bodyFrame.Y = bodyFrame1.Y; + } + + protected void DrawPlayerStoned(Player drawPlayer, Vector2 Position) + { + if (drawPlayer.dead) + return; + SpriteEffects effects = drawPlayer.direction != 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Main.spriteBatch.Draw(Main.extraTexture[37], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 8.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(), Lighting.GetColor((int) ((double) Position.X + (double) drawPlayer.width * 0.5) / 16, (int) ((double) Position.Y + (double) drawPlayer.height * 0.5) / 16, Microsoft.Xna.Framework.Color.White), 0.0f, new Vector2((float) (Main.extraTexture[37].Width / 2), (float) (Main.extraTexture[37].Height / 2)), 1f, effects, 0.0f); + } + + public void DrawPlayer( + Player drawPlayer, + Vector2 Position, + float rotation, + Vector2 rotationOrigin, + float shadow = 0.0f) + { + int num1 = drawPlayer.controlDown ? 1 : 0; + float num2 = 0.0f; + DrawData drawData = new DrawData(); + int projectileDrawPosition = -1; + Main.playerDrawData.Clear(); + Main.playerDrawDust.Clear(); + Main.playerDrawGore.Clear(); + Vector2 vector2_1 = Position + (drawPlayer.itemLocation - drawPlayer.position); + int num3 = 0; + bool flag1 = false; + bool flag2 = false; + bool flag3 = false; + int skinVariant = drawPlayer.skinVariant; + if (drawPlayer.body == 77 || drawPlayer.body == 103 || drawPlayer.body == 41 || drawPlayer.body == 100 || drawPlayer.body == 10 || drawPlayer.body == 11 || drawPlayer.body == 12 || drawPlayer.body == 13 || drawPlayer.body == 14 || drawPlayer.body == 43 || drawPlayer.body == 15 || drawPlayer.body == 16 || drawPlayer.body == 20 || drawPlayer.body == 39 || drawPlayer.body == 50 || drawPlayer.body == 38 || drawPlayer.body == 40 || drawPlayer.body == 57 || drawPlayer.body == 44 || drawPlayer.body == 52 || drawPlayer.body == 53 || drawPlayer.body == 68 || drawPlayer.body == 81 || drawPlayer.body == 85 || drawPlayer.body == 88 || drawPlayer.body == 98 || drawPlayer.body == 86 || drawPlayer.body == 87 || drawPlayer.body == 99 || drawPlayer.body == 165 || drawPlayer.body == 166 || drawPlayer.body == 167 || drawPlayer.body == 171 || drawPlayer.body == 45 || drawPlayer.body == 168 || drawPlayer.body == 169 || drawPlayer.body == 42 || drawPlayer.body == 180 || drawPlayer.body == 181 || drawPlayer.body == 183 || drawPlayer.body == 186 || drawPlayer.body == 187 || drawPlayer.body == 188 || drawPlayer.body == 64 || drawPlayer.body == 189 || drawPlayer.body == 191 || drawPlayer.body == 192 || drawPlayer.body == 198 || drawPlayer.body == 199 || drawPlayer.body == 202 || drawPlayer.body == 203 || drawPlayer.body == 58 || drawPlayer.body == 59 || drawPlayer.body == 60 || drawPlayer.body == 61 || drawPlayer.body == 62 || drawPlayer.body == 63 || drawPlayer.body == 36 || drawPlayer.body == 104 || drawPlayer.body == 184 || drawPlayer.body == 74 || drawPlayer.body == 78 || drawPlayer.body == 185 || drawPlayer.body == 196 || drawPlayer.body == 197 || drawPlayer.body == 182 || drawPlayer.body == 87 || drawPlayer.body == 76 || drawPlayer.body == 209) + flag1 = true; + if (drawPlayer.body == 99 || drawPlayer.body == 98 || drawPlayer.body == 100 || drawPlayer.body == 167 || drawPlayer.body == 171 || drawPlayer.body == 183 || drawPlayer.body == 191 || drawPlayer.body == 192 || drawPlayer.body == 198 || drawPlayer.body == 199 || drawPlayer.body == 202 || drawPlayer.body == 201 || drawPlayer.body == 203 || drawPlayer.body == 197 || drawPlayer.body == 182 || drawPlayer.body == 87) + flag2 = true; + if (drawPlayer.heldProj >= 0 && (double) shadow == 0.0) + { + switch (Main.projectile[drawPlayer.heldProj].type) { - case 71: - case 72: - case 73: - case 74: - int index = item.type - 71; - texture = TextureAssets.Coin[index].Value; - this.DrawItem_AnimateSlot(slot, 6, 8); - frame = Main._coinOnWorldAnimation.GetFrame(texture, Main.itemFrameCounter[slot]); - return; - case 75: - texture = TextureAssets.Item[item.type].Value; - this.DrawItem_AnimateSlot(slot, Main.itemAnimations[item.type].TicksPerFrame, Main.itemAnimations[item.type].FrameCount * 2 - 1); - break; - case 3858: - texture = TextureAssets.Item[item.type].Value; - this.DrawItem_AnimateSlot(slot, 5, 3); - break; - default: - texture = TextureAssets.Item[item.type].Value; + case 460: + case 535: + case 600: + flag3 = true; break; } } - if (Main.itemAnimations[item.type] != null) - frame = Main.itemAnimations[item.type].GetFrame(texture, Main.itemFrameCounter[slot]); + bool flag4 = false; + if (drawPlayer.head == 10 || drawPlayer.head == 12 || drawPlayer.head == 28 || drawPlayer.head == 62 || drawPlayer.head == 97 || drawPlayer.head == 106 || drawPlayer.head == 113 || drawPlayer.head == 116 || drawPlayer.head == 119 || drawPlayer.head == 133 || drawPlayer.head == 138 || drawPlayer.head == 139 || drawPlayer.head == 163 || drawPlayer.head == 178 || drawPlayer.head == 181 || drawPlayer.head == 191 || drawPlayer.head == 198) + flag4 = true; + bool flag5 = false; + if (drawPlayer.head == 161 || drawPlayer.head == 14 || drawPlayer.head == 15 || drawPlayer.head == 16 || drawPlayer.head == 18 || drawPlayer.head == 21 || drawPlayer.head == 24 || drawPlayer.head == 25 || drawPlayer.head == 26 || drawPlayer.head == 40 || drawPlayer.head == 44 || drawPlayer.head == 51 || drawPlayer.head == 56 || drawPlayer.head == 59 || drawPlayer.head == 60 || drawPlayer.head == 67 || drawPlayer.head == 68 || drawPlayer.head == 69 || drawPlayer.head == 114 || drawPlayer.head == 121 || drawPlayer.head == 126 || drawPlayer.head == 130 || drawPlayer.head == 136 || drawPlayer.head == 140 || drawPlayer.head == 145 || drawPlayer.head == 158 || drawPlayer.head == 159 || drawPlayer.head == 184 || drawPlayer.head == 190 || drawPlayer.head == 92 || drawPlayer.head == 195 || drawPlayer.head == 215) + flag5 = true; + bool flag6 = false; + if (drawPlayer.face == (sbyte) 4 || drawPlayer.face == (sbyte) 3 || drawPlayer.face == (sbyte) 2) + flag6 = true; + int num4 = (int) drawPlayer.hairDye; + if (drawPlayer.head == 0 && num4 == 0) + num4 = 1; + float playerOffset = (float) drawPlayer.mount.PlayerOffset; + Position.Y -= playerOffset; + int cHead = 0; + if (drawPlayer.dye[0] != null) + cHead = (int) drawPlayer.dye[0].dye; + int num5 = 0; + if (drawPlayer.dye[1] != null) + num5 = (int) drawPlayer.dye[1].dye; + int num6 = 0; + if (drawPlayer.dye[2] != null) + num6 = (int) drawPlayer.dye[2].dye; + if (drawPlayer.wearsRobe) + num6 = num5; + int num7 = 0; + int num8 = 0; + int num9 = 0; + int num10 = 0; + int num11 = 0; + int num12 = 0; + int num13 = 0; + int num14 = 0; + int num15 = 0; + int num16 = 0; + int num17 = 0; + int num18 = 0; + for (int index1 = 0; index1 < 20; ++index1) + { + int index2 = index1 % 10; + if (drawPlayer.dye[index2] != null && drawPlayer.armor[index1].type > 0 && drawPlayer.armor[index1].stack > 0 && (index1 / 10 >= 1 || !drawPlayer.hideVisual[index2] || drawPlayer.armor[index1].wingSlot > (sbyte) 0 || drawPlayer.armor[index1].type == 934)) + { + if (drawPlayer.armor[index1].handOnSlot > (sbyte) 0 && drawPlayer.armor[index1].handOnSlot < (sbyte) 20) + num7 = (int) drawPlayer.dye[index2].dye; + if (drawPlayer.armor[index1].handOffSlot > (sbyte) 0 && drawPlayer.armor[index1].handOffSlot < (sbyte) 12) + num8 = (int) drawPlayer.dye[index2].dye; + if (drawPlayer.armor[index1].backSlot > (sbyte) 0 && drawPlayer.armor[index1].backSlot < (sbyte) 14) + num9 = (int) drawPlayer.dye[index2].dye; + if (drawPlayer.armor[index1].frontSlot > (sbyte) 0 && drawPlayer.armor[index1].frontSlot < (sbyte) 5) + num10 = (int) drawPlayer.dye[index2].dye; + if (drawPlayer.armor[index1].shoeSlot > (sbyte) 0 && drawPlayer.armor[index1].shoeSlot < (sbyte) 18) + num11 = (int) drawPlayer.dye[index2].dye; + if (drawPlayer.armor[index1].waistSlot > (sbyte) 0 && drawPlayer.armor[index1].waistSlot < (sbyte) 13) + num12 = (int) drawPlayer.dye[index2].dye; + if (drawPlayer.armor[index1].shieldSlot > (sbyte) 0 && drawPlayer.armor[index1].shieldSlot < (sbyte) 7) + num13 = (int) drawPlayer.dye[index2].dye; + if (drawPlayer.armor[index1].neckSlot > (sbyte) 0 && drawPlayer.armor[index1].neckSlot < (sbyte) 10) + num14 = (int) drawPlayer.dye[index2].dye; + if (drawPlayer.armor[index1].faceSlot > (sbyte) 0 && drawPlayer.armor[index1].faceSlot < (sbyte) 9) + num15 = (int) drawPlayer.dye[index2].dye; + if (drawPlayer.armor[index1].balloonSlot > (sbyte) 0 && drawPlayer.armor[index1].balloonSlot < (sbyte) 18) + num16 = (int) drawPlayer.dye[index2].dye; + if (drawPlayer.armor[index1].wingSlot > (sbyte) 0 && drawPlayer.armor[index1].wingSlot < (sbyte) 40) + num17 = (int) drawPlayer.dye[index2].dye; + if (drawPlayer.armor[index1].type == 934) + num18 = (int) drawPlayer.dye[index2].dye; + } + } + Mount.currentShader = !drawPlayer.mount.Active ? 0 : (drawPlayer.mount.Cart ? drawPlayer.cMinecart : drawPlayer.cMount); + Microsoft.Xna.Framework.Color color1 = drawPlayer.GetImmuneAlpha(drawPlayer.GetHairColor(), shadow); + Microsoft.Xna.Framework.Color color2 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int) ((double) Position.X + (double) drawPlayer.width * 0.5) / 16, (int) (((double) Position.Y + (double) drawPlayer.height * 0.25) / 16.0), Microsoft.Xna.Framework.Color.White), shadow); + Microsoft.Xna.Framework.Color color3 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int) ((double) Position.X + (double) drawPlayer.width * 0.5) / 16, (int) (((double) Position.Y + (double) drawPlayer.height * 0.25) / 16.0), drawPlayer.eyeColor), shadow); + Microsoft.Xna.Framework.Color color4 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int) ((double) Position.X + (double) drawPlayer.width * 0.5) / 16, (int) (((double) Position.Y + (double) drawPlayer.height * 0.25) / 16.0), drawPlayer.skinColor), shadow); + Microsoft.Xna.Framework.Color color5 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int) ((double) Position.X + (double) drawPlayer.width * 0.5) / 16, (int) (((double) Position.Y + (double) drawPlayer.height * 0.5) / 16.0), drawPlayer.skinColor), shadow); + Microsoft.Xna.Framework.Color color6 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int) ((double) Position.X + (double) drawPlayer.width * 0.5) / 16, (int) (((double) Position.Y + (double) drawPlayer.height * 0.75) / 16.0), drawPlayer.skinColor), shadow); + Microsoft.Xna.Framework.Color color7 = drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int) ((double) Position.X + (double) drawPlayer.width * 0.5) / 16, (int) (((double) Position.Y + (double) drawPlayer.height * 0.5) / 16.0), drawPlayer.shirtColor), shadow); + Microsoft.Xna.Framework.Color color8 = drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int) ((double) Position.X + (double) drawPlayer.width * 0.5) / 16, (int) (((double) Position.Y + (double) drawPlayer.height * 0.5) / 16.0), drawPlayer.underShirtColor), shadow); + Microsoft.Xna.Framework.Color color9 = drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int) ((double) Position.X + (double) drawPlayer.width * 0.5) / 16, (int) (((double) Position.Y + (double) drawPlayer.height * 0.75) / 16.0), drawPlayer.pantsColor), shadow); + Microsoft.Xna.Framework.Color color10 = drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int) ((double) Position.X + (double) drawPlayer.width * 0.5) / 16, (int) (((double) Position.Y + (double) drawPlayer.height * 0.75) / 16.0), drawPlayer.shoeColor), shadow); + Microsoft.Xna.Framework.Color color11 = drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int) ((double) Position.X + (double) drawPlayer.width * 0.5) / 16, (int) ((double) Position.Y + (double) drawPlayer.height * 0.25) / 16, Microsoft.Xna.Framework.Color.White), shadow); + Microsoft.Xna.Framework.Color color12 = drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int) ((double) Position.X + (double) drawPlayer.width * 0.5) / 16, (int) ((double) Position.Y + (double) drawPlayer.height * 0.5) / 16, Microsoft.Xna.Framework.Color.White), shadow); + Microsoft.Xna.Framework.Color drawColor = color12; + Microsoft.Xna.Framework.Color color13 = drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int) ((double) Position.X + (double) drawPlayer.width * 0.5) / 16, (int) ((double) Position.Y + (double) drawPlayer.height * 0.75) / 16, Microsoft.Xna.Framework.Color.White), shadow); + Microsoft.Xna.Framework.Color color14 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 100); + int num19 = 0; + int num20 = 0; + int num21 = 0; + int num22 = 0; + int index3 = -1; + int index4 = -1; + int index5 = -1; + int index6 = -1; + Microsoft.Xna.Framework.Color color15 = Microsoft.Xna.Framework.Color.Transparent; + Microsoft.Xna.Framework.Color color16 = Microsoft.Xna.Framework.Color.Transparent; + Microsoft.Xna.Framework.Color color17 = Microsoft.Xna.Framework.Color.Transparent; + Microsoft.Xna.Framework.Color color18 = Microsoft.Xna.Framework.Color.Transparent; + switch (drawPlayer.head) + { + case 169: + ++num19; + break; + case 170: + ++num20; + break; + case 171: + ++num21; + break; + case 189: + ++num22; + break; + } + switch (drawPlayer.body) + { + case 175: + ++num19; + break; + case 176: + ++num20; + break; + case 177: + ++num21; + break; + case 190: + ++num22; + break; + } + switch (drawPlayer.legs) + { + case 110: + ++num19; + break; + case 111: + ++num20; + break; + case 112: + ++num21; + break; + case 130: + ++num22; + break; + } + Microsoft.Xna.Framework.Color underShirtColor = drawPlayer.underShirtColor; + underShirtColor.A = (byte) 180; + if (drawPlayer.head == 169) + { + index3 = 15; + byte num23 = (byte) (62.5 * (double) (1 + num19)); + color15 = new Microsoft.Xna.Framework.Color((int) num23, (int) num23, (int) num23, 0); + } + else if (drawPlayer.head == 210) + { + index3 = 242; + byte num24 = 127; + color15 = new Microsoft.Xna.Framework.Color((int) num24, (int) num24, (int) num24, 0); + } + else if (drawPlayer.head == 214) + { + index3 = 245; + color15 = underShirtColor; + } + else if (drawPlayer.head == 170) + { + index3 = 16; + byte num25 = (byte) (62.5 * (double) (1 + num20)); + color15 = new Microsoft.Xna.Framework.Color((int) num25, (int) num25, (int) num25, 0); + } + else if (drawPlayer.head == 189) + { + index3 = 184; + byte num26 = (byte) (62.5 * (double) (1 + num22)); + color15 = new Microsoft.Xna.Framework.Color((int) num26, (int) num26, (int) num26, 0); + color11 = drawPlayer.GetImmuneAlphaPure(new Microsoft.Xna.Framework.Color((int) num26, (int) num26, (int) num26, (int) byte.MaxValue), shadow); + } + else if (drawPlayer.head == 171) + { + byte num27 = (byte) (62.5 * (double) (1 + num21)); + color11 = drawPlayer.GetImmuneAlphaPure(new Microsoft.Xna.Framework.Color((int) num27, (int) num27, (int) num27, (int) byte.MaxValue), shadow); + } + else if (drawPlayer.head == 175) + { + index3 = 41; + color15 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); + } + else if (drawPlayer.head == 193) + { + index3 = 209; + color15 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue); + } + else if (drawPlayer.head == 109) + { + index3 = 208; + color15 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); + } + else if (drawPlayer.head == 178) + { + index3 = 96; + color15 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); + } + if (drawPlayer.body == 175) + { + index4 = !drawPlayer.Male ? 18 : 13; + byte num28 = (byte) (62.5 * (double) (1 + num19)); + color16 = new Microsoft.Xna.Framework.Color((int) num28, (int) num28, (int) num28, 0); + } + else if (drawPlayer.body == 208) + { + index4 = !drawPlayer.Male ? 247 : 246; + index5 = 248; + color16 = underShirtColor; + color17 = underShirtColor; + } + else if (drawPlayer.body == 190) + { + index4 = !drawPlayer.Male ? 186 : 185; + index5 = 188; + byte num29 = (byte) (62.5 * (double) (1 + num22)); + color16 = new Microsoft.Xna.Framework.Color((int) num29, (int) num29, (int) num29, 0); + color17 = new Microsoft.Xna.Framework.Color((int) num29, (int) num29, (int) num29, 0); + color12 = drawPlayer.GetImmuneAlphaPure(new Microsoft.Xna.Framework.Color((int) num29, (int) num29, (int) num29, (int) byte.MaxValue), shadow); + } + else if (drawPlayer.body == 176) + { + index4 = !drawPlayer.Male ? 19 : 14; + index5 = 12; + byte num30 = (byte) (62.5 * (double) (1 + num20)); + color16 = new Microsoft.Xna.Framework.Color((int) num30, (int) num30, (int) num30, 0); + color17 = new Microsoft.Xna.Framework.Color((int) num30, (int) num30, (int) num30, 0); + } + else if (drawPlayer.body == 194) + { + index4 = 210; + index5 = 211; + color16 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue); + color17 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue); + } + else if (drawPlayer.body == 177) + { + byte num31 = (byte) (62.5 * (double) (1 + num21)); + color12 = drawPlayer.GetImmuneAlphaPure(new Microsoft.Xna.Framework.Color((int) num31, (int) num31, (int) num31, (int) byte.MaxValue), shadow); + } + else if (drawPlayer.body == 179) + { + index4 = !drawPlayer.Male ? 43 : 42; + index5 = 44; + color16 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); + color17 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); + } + if (drawPlayer.legs == 111) + { + index6 = 17; + byte num32 = (byte) (62.5 * (double) (1 + num20)); + color18 = new Microsoft.Xna.Framework.Color((int) num32, (int) num32, (int) num32, 0); + } + else if (drawPlayer.legs == 157) + { + index6 = 249; + color18 = underShirtColor; + } + else if (drawPlayer.legs == 158) + { + index6 = 250; + color18 = underShirtColor; + } + else if (drawPlayer.legs == 110) + { + index6 = 199; + byte num33 = (byte) (62.5 * (double) (1 + num19)); + color18 = new Microsoft.Xna.Framework.Color((int) num33, (int) num33, (int) num33, 0); + } + else if (drawPlayer.legs == 112) + { + byte num34 = (byte) (62.5 * (double) (1 + num21)); + color13 = drawPlayer.GetImmuneAlphaPure(new Microsoft.Xna.Framework.Color((int) num34, (int) num34, (int) num34, (int) byte.MaxValue), shadow); + } + else if (drawPlayer.legs == 134) + { + index6 = 212; + color18 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue); + } + else if (drawPlayer.legs == 130) + { + byte num35 = (byte) ((int) sbyte.MaxValue * (1 + num22)); + index6 = 187; + color18 = new Microsoft.Xna.Framework.Color((int) num35, (int) num35, (int) num35, 0); + color13 = drawPlayer.GetImmuneAlphaPure(new Microsoft.Xna.Framework.Color((int) num35, (int) num35, (int) num35, (int) byte.MaxValue), shadow); + } + float alphaReduction = shadow; + color15 = drawPlayer.GetImmuneAlphaPure(color15, alphaReduction); + color16 = drawPlayer.GetImmuneAlphaPure(color16, alphaReduction); + color17 = drawPlayer.GetImmuneAlphaPure(color17, alphaReduction); + color18 = drawPlayer.GetImmuneAlphaPure(color18, alphaReduction); + if (drawPlayer.head > 0 && drawPlayer.head < 216) + this.LoadArmorHead(drawPlayer.head); + if (drawPlayer.body > 0 && drawPlayer.body < 210) + this.LoadArmorBody(drawPlayer.body); + if (drawPlayer.legs > 0 && drawPlayer.legs < 161) + this.LoadArmorLegs(drawPlayer.legs); + if (drawPlayer.handon > (sbyte) 0 && drawPlayer.handon < (sbyte) 20) + this.LoadAccHandsOn((int) drawPlayer.handon); + if (drawPlayer.handoff > (sbyte) 0 && drawPlayer.handoff < (sbyte) 12) + this.LoadAccHandsOff((int) drawPlayer.handoff); + if (drawPlayer.back > (sbyte) 0 && drawPlayer.back < (sbyte) 14) + this.LoadAccBack((int) drawPlayer.back); + if (drawPlayer.front > (sbyte) 0 && drawPlayer.front < (sbyte) 5) + this.LoadAccFront((int) drawPlayer.front); + if (drawPlayer.shoe > (sbyte) 0 && drawPlayer.shoe < (sbyte) 18) + this.LoadAccShoes((int) drawPlayer.shoe); + if (drawPlayer.waist > (sbyte) 0 && drawPlayer.waist < (sbyte) 13) + this.LoadAccWaist((int) drawPlayer.waist); + if (drawPlayer.shield > (sbyte) 0 && drawPlayer.shield < (sbyte) 7) + this.LoadAccShield((int) drawPlayer.shield); + if (drawPlayer.neck > (sbyte) 0 && drawPlayer.neck < (sbyte) 10) + this.LoadAccNeck((int) drawPlayer.neck); + if (drawPlayer.face > (sbyte) 0 && drawPlayer.face < (sbyte) 9) + this.LoadAccFace((int) drawPlayer.face); + if (drawPlayer.balloon > (sbyte) 0 && drawPlayer.balloon < (sbyte) 18) + this.LoadAccBalloon((int) drawPlayer.balloon); + this.LoadHair(drawPlayer.hair); + if ((drawPlayer.head == 78 || drawPlayer.head == 79 || drawPlayer.head == 80) && drawPlayer.body == 51 && drawPlayer.legs == 47) + { + float num36 = (float) ((double) Main.mouseTextColor / 200.0 - 0.300000011920929); + if ((double) shadow != 0.0) + num36 = 0.0f; + color11.R = (byte) ((double) color11.R * (double) num36); + color11.G = (byte) ((double) color11.G * (double) num36); + color11.B = (byte) ((double) color11.B * (double) num36); + color12.R = (byte) ((double) color12.R * (double) num36); + color12.G = (byte) ((double) color12.G * (double) num36); + color12.B = (byte) ((double) color12.B * (double) num36); + color13.R = (byte) ((double) color13.R * (double) num36); + color13.G = (byte) ((double) color13.G * (double) num36); + color13.B = (byte) ((double) color13.B * (double) num36); + } + if (drawPlayer.head == 193 && drawPlayer.body == 194 && drawPlayer.legs == 134) + { + float num37 = (float) (0.600000023841858 - (double) drawPlayer.ghostFade * 0.300000011920929); + if ((double) shadow != 0.0) + num37 = 0.0f; + color11.R = (byte) ((double) color11.R * (double) num37); + color11.G = (byte) ((double) color11.G * (double) num37); + color11.B = (byte) ((double) color11.B * (double) num37); + color12.R = (byte) ((double) color12.R * (double) num37); + color12.G = (byte) ((double) color12.G * (double) num37); + color12.B = (byte) ((double) color12.B * (double) num37); + color13.R = (byte) ((double) color13.R * (double) num37); + color13.G = (byte) ((double) color13.G * (double) num37); + color13.B = (byte) ((double) color13.B * (double) num37); + } + if ((double) shadow > 0.0) + { + color6 = Microsoft.Xna.Framework.Color.Transparent; + color5 = Microsoft.Xna.Framework.Color.Transparent; + color4 = Microsoft.Xna.Framework.Color.Transparent; + color1 = Microsoft.Xna.Framework.Color.Transparent; + color3 = Microsoft.Xna.Framework.Color.Transparent; + color2 = Microsoft.Xna.Framework.Color.Transparent; + } + float R = 1f; + float G = 1f; + float B = 1f; + float A = 1f; + if (drawPlayer.honey && Main.rand.Next(30) == 0 && (double) shadow == 0.0) + { + int index7 = Dust.NewDust(Position, drawPlayer.width, drawPlayer.height, 152, Alpha: 150); + Main.dust[index7].velocity.Y = 0.3f; + Main.dust[index7].velocity.X *= 0.1f; + Main.dust[index7].scale += (float) Main.rand.Next(3, 4) * 0.1f; + Main.dust[index7].alpha = 100; + Main.dust[index7].noGravity = true; + Main.dust[index7].velocity += drawPlayer.velocity * 0.1f; + Main.playerDrawDust.Add(index7); + } + if (drawPlayer.dryadWard && (double) drawPlayer.velocity.X != 0.0 && Main.rand.Next(4) == 0) + { + int index8 = Dust.NewDust(new Vector2(drawPlayer.position.X - 2f, (float) ((double) drawPlayer.position.Y + (double) drawPlayer.height - 2.0)), drawPlayer.width + 4, 4, 163, Alpha: 100, Scale: 1.5f); + Main.dust[index8].noGravity = true; + Main.dust[index8].noLight = true; + Main.dust[index8].velocity *= 0.0f; + } + if (drawPlayer.poisoned) + { + if (Main.rand.Next(50) == 0 && (double) shadow == 0.0) + { + int index9 = Dust.NewDust(Position, drawPlayer.width, drawPlayer.height, 46, Alpha: 150, Scale: 0.2f); + Main.dust[index9].noGravity = true; + Main.dust[index9].fadeIn = 1.9f; + Main.playerDrawDust.Add(index9); + } + R *= 0.65f; + B *= 0.75f; + } + if (drawPlayer.venom) + { + if (Main.rand.Next(10) == 0 && (double) shadow == 0.0) + { + int index10 = Dust.NewDust(Position, drawPlayer.width, drawPlayer.height, 171, Alpha: 100, Scale: 0.5f); + Main.dust[index10].noGravity = true; + Main.dust[index10].fadeIn = 1.5f; + Main.playerDrawDust.Add(index10); + } + G *= 0.45f; + R *= 0.75f; + } + if (drawPlayer.onFire) + { + if (Main.rand.Next(4) == 0 && (double) shadow == 0.0) + { + int index11 = Dust.NewDust(new Vector2(Position.X - 2f, Position.Y - 2f), drawPlayer.width + 4, drawPlayer.height + 4, 6, drawPlayer.velocity.X * 0.4f, drawPlayer.velocity.Y * 0.4f, 100, Scale: 3f); + Main.dust[index11].noGravity = true; + Main.dust[index11].velocity *= 1.8f; + Main.dust[index11].velocity.Y -= 0.5f; + Main.playerDrawDust.Add(index11); + } + B *= 0.6f; + G *= 0.7f; + } + if (drawPlayer.dripping && (double) shadow == 0.0 && Main.rand.Next(4) != 0) + { + Vector2 Position1 = Position; + Position1.X -= 2f; + Position1.Y -= 2f; + if (Main.rand.Next(2) == 0) + { + int index12 = Dust.NewDust(Position1, drawPlayer.width + 4, drawPlayer.height + 2, 211, Alpha: 50, Scale: 0.8f); + if (Main.rand.Next(2) == 0) + Main.dust[index12].alpha += 25; + if (Main.rand.Next(2) == 0) + Main.dust[index12].alpha += 25; + Main.dust[index12].noLight = true; + Main.dust[index12].velocity *= 0.2f; + Main.dust[index12].velocity.Y += 0.2f; + Main.dust[index12].velocity += drawPlayer.velocity; + Main.playerDrawDust.Add(index12); + } + else + { + int index13 = Dust.NewDust(Position1, drawPlayer.width + 8, drawPlayer.height + 8, 211, Alpha: 50, Scale: 1.1f); + if (Main.rand.Next(2) == 0) + Main.dust[index13].alpha += 25; + if (Main.rand.Next(2) == 0) + Main.dust[index13].alpha += 25; + Main.dust[index13].noLight = true; + Main.dust[index13].noGravity = true; + Main.dust[index13].velocity *= 0.2f; + ++Main.dust[index13].velocity.Y; + Main.dust[index13].velocity += drawPlayer.velocity; + Main.playerDrawDust.Add(index13); + } + } + if (drawPlayer.drippingSlime) + { + int Alpha = 175; + Microsoft.Xna.Framework.Color newColor = new Microsoft.Xna.Framework.Color(0, 80, (int) byte.MaxValue, 100); + if (Main.rand.Next(4) != 0 && (double) shadow == 0.0) + { + Vector2 Position2 = Position; + Position2.X -= 2f; + Position2.Y -= 2f; + if (Main.rand.Next(2) == 0) + { + int index14 = Dust.NewDust(Position2, drawPlayer.width + 4, drawPlayer.height + 2, 4, Alpha: Alpha, newColor: newColor, Scale: 1.4f); + if (Main.rand.Next(2) == 0) + Main.dust[index14].alpha += 25; + if (Main.rand.Next(2) == 0) + Main.dust[index14].alpha += 25; + Main.dust[index14].noLight = true; + Main.dust[index14].velocity *= 0.2f; + Main.dust[index14].velocity.Y += 0.2f; + Main.dust[index14].velocity += drawPlayer.velocity; + Main.playerDrawDust.Add(index14); + } + } + R *= 0.8f; + G *= 0.8f; + } + if (drawPlayer.ichor) + B = 0.0f; + if (drawPlayer.electrified && (double) shadow == 0.0 && Main.rand.Next(3) == 0) + { + int index15 = Dust.NewDust(new Vector2(Position.X - 2f, Position.Y - 2f), drawPlayer.width + 4, drawPlayer.height + 4, 226, Alpha: 100, Scale: 0.5f); + Main.dust[index15].velocity *= 1.6f; + --Main.dust[index15].velocity.Y; + Main.dust[index15].position = Vector2.Lerp(Main.dust[index15].position, drawPlayer.Center, 0.5f); + Main.playerDrawDust.Add(index15); + } + if (drawPlayer.burned) + { + if ((double) shadow == 0.0) + { + int index16 = Dust.NewDust(new Vector2(Position.X - 2f, Position.Y - 2f), drawPlayer.width + 4, drawPlayer.height + 4, 6, drawPlayer.velocity.X * 0.4f, drawPlayer.velocity.Y * 0.4f, 100, Scale: 2f); + Main.dust[index16].noGravity = true; + Main.dust[index16].velocity *= 1.8f; + Main.dust[index16].velocity.Y -= 0.75f; + Main.playerDrawDust.Add(index16); + } + R = 1f; + B *= 0.6f; + G *= 0.7f; + } + if (drawPlayer.onFrostBurn) + { + if (Main.rand.Next(4) == 0 && (double) shadow == 0.0) + { + int index17 = Dust.NewDust(new Vector2(Position.X - 2f, Position.Y - 2f), drawPlayer.width + 4, drawPlayer.height + 4, 135, drawPlayer.velocity.X * 0.4f, drawPlayer.velocity.Y * 0.4f, 100, Scale: 3f); + Main.dust[index17].noGravity = true; + Main.dust[index17].velocity *= 1.8f; + Main.dust[index17].velocity.Y -= 0.5f; + Main.playerDrawDust.Add(index17); + } + R *= 0.5f; + G *= 0.7f; + } + if (drawPlayer.onFire2) + { + if (Main.rand.Next(4) == 0 && (double) shadow == 0.0) + { + int index18 = Dust.NewDust(new Vector2(Position.X - 2f, Position.Y - 2f), drawPlayer.width + 4, drawPlayer.height + 4, 75, drawPlayer.velocity.X * 0.4f, drawPlayer.velocity.Y * 0.4f, 100, Scale: 3f); + Main.dust[index18].noGravity = true; + Main.dust[index18].velocity *= 1.8f; + Main.dust[index18].velocity.Y -= 0.5f; + Main.playerDrawDust.Add(index18); + } + B *= 0.6f; + G *= 0.7f; + } + if (drawPlayer.noItems) + { + G *= 0.8f; + R *= 0.65f; + } + if (drawPlayer.blind) + { + G *= 0.65f; + R *= 0.7f; + } + if (drawPlayer.bleed) + { + G *= 0.9f; + B *= 0.9f; + if (!drawPlayer.dead && Main.rand.Next(30) == 0 && (double) shadow == 0.0) + { + int index19 = Dust.NewDust(Position, drawPlayer.width, drawPlayer.height, 5); + Main.dust[index19].velocity.Y += 0.5f; + Main.dust[index19].velocity *= 0.25f; + Main.playerDrawDust.Add(index19); + } + } + if ((double) shadow == 0.0 && drawPlayer.palladiumRegen && drawPlayer.statLife < drawPlayer.statLifeMax2 && this.IsActive && !Main.gamePaused && drawPlayer.miscCounter % 10 == 0 && (double) shadow == 0.0) + { + Vector2 Position3; + Position3.X = Position.X + (float) Main.rand.Next(drawPlayer.width); + Position3.Y = Position.Y + (float) Main.rand.Next(drawPlayer.height); + Position3.X = (float) ((double) Position.X + (double) (drawPlayer.width / 2) - 6.0); + Position3.Y = (float) ((double) Position.Y + (double) (drawPlayer.height / 2) - 6.0); + Position3.X -= (float) Main.rand.Next(-10, 11); + Position3.Y -= (float) Main.rand.Next(-20, 21); + int num38 = Gore.NewGore(Position3, new Vector2((float) Main.rand.Next(-10, 11) * 0.1f, (float) Main.rand.Next(-20, -10) * 0.1f), 331, (float) Main.rand.Next(80, 120) * 0.01f); + Main.playerDrawGore.Add(num38); + } + if ((double) shadow == 0.0 && drawPlayer.loveStruck && this.IsActive && !Main.gamePaused && Main.rand.Next(5) == 0) + { + Vector2 vector2_2 = new Vector2((float) Main.rand.Next(-10, 11), (float) Main.rand.Next(-10, 11)); + vector2_2.Normalize(); + vector2_2.X *= 0.66f; + int index20 = Gore.NewGore(Position + new Vector2((float) Main.rand.Next(drawPlayer.width + 1), (float) Main.rand.Next(drawPlayer.height + 1)), vector2_2 * (float) Main.rand.Next(3, 6) * 0.33f, 331, (float) Main.rand.Next(40, 121) * 0.01f); + Main.gore[index20].sticky = false; + Main.gore[index20].velocity *= 0.4f; + Main.gore[index20].velocity.Y -= 0.6f; + Main.playerDrawGore.Add(index20); + } + if (drawPlayer.stinky && this.IsActive && !Main.gamePaused) + { + R *= 0.7f; + B *= 0.55f; + if (Main.rand.Next(5) == 0 && (double) shadow == 0.0) + { + Vector2 vector2_3 = new Vector2((float) Main.rand.Next(-10, 11), (float) Main.rand.Next(-10, 11)); + vector2_3.Normalize(); + vector2_3.X *= 0.66f; + vector2_3.Y = Math.Abs(vector2_3.Y); + Vector2 vector2_4 = vector2_3 * (float) Main.rand.Next(3, 5) * 0.25f; + int index21 = Dust.NewDust(Position, drawPlayer.width, drawPlayer.height, 188, vector2_4.X, vector2_4.Y * 0.5f, 100, Scale: 1.5f); + Main.dust[index21].velocity *= 0.1f; + Main.dust[index21].velocity.Y -= 0.5f; + Main.playerDrawDust.Add(index21); + } + } + if (drawPlayer.slowOgreSpit && this.IsActive && !Main.gamePaused) + { + R *= 0.6f; + B *= 0.45f; + if (Main.rand.Next(5) == 0 && (double) shadow == 0.0) + { + int Type = Utils.SelectRandom(Main.rand, 4, 256); + Dust dust = Main.dust[Dust.NewDust(Position, drawPlayer.width, drawPlayer.height, Type, Alpha: 100)]; + dust.scale = (float) (0.800000011920929 + (double) Main.rand.NextFloat() * 0.600000023841858); + dust.fadeIn = 0.5f; + dust.velocity *= 0.05f; + dust.noLight = true; + if (dust.type == 4) + dust.color = new Microsoft.Xna.Framework.Color(80, 170, 40, 120); + Main.playerDrawDust.Add(dust.dustIndex); + } + if (Main.rand.Next(5) == 0 && (double) shadow == 0.0) + { + int index22 = Gore.NewGore(Position + new Vector2(Main.rand.NextFloat(), Main.rand.NextFloat()) * drawPlayer.Size, Vector2.Zero, Utils.SelectRandom(Main.rand, 1024, 1025, 1026), 0.65f); + Main.gore[index22].velocity *= 0.05f; + Main.playerDrawGore.Add(index22); + } + } + if (this.IsActive && !Main.gamePaused && (double) shadow == 0.0) + { + float num39 = (float) drawPlayer.miscCounter / 180f; + float num40 = 0.0f; + float num41 = 10f; + int Type = 90; + int num42 = 0; + for (int index23 = 0; index23 < 3; ++index23) + { + switch (index23) + { + case 0: + if (drawPlayer.nebulaLevelLife >= 1) + { + num40 = 6.283185f / (float) drawPlayer.nebulaLevelLife; + num42 = drawPlayer.nebulaLevelLife; + goto default; + } + else + break; + case 1: + if (drawPlayer.nebulaLevelMana >= 1) + { + num40 = -6.283185f / (float) drawPlayer.nebulaLevelMana; + num42 = drawPlayer.nebulaLevelMana; + num39 = (float) -drawPlayer.miscCounter / 180f; + num41 = 20f; + Type = 88; + goto default; + } + else + break; + case 2: + if (drawPlayer.nebulaLevelDamage >= 1) + { + num40 = 6.283185f / (float) drawPlayer.nebulaLevelDamage; + num42 = drawPlayer.nebulaLevelDamage; + num39 = (float) drawPlayer.miscCounter / 180f; + num41 = 30f; + Type = 86; + goto default; + } + else + break; + default: + for (int index24 = 0; index24 < num42; ++index24) + { + int index25 = Dust.NewDust(Position, drawPlayer.width, drawPlayer.height, Type, Alpha: 100, Scale: 1.5f); + Main.dust[index25].noGravity = true; + Main.dust[index25].velocity = Vector2.Zero; + Main.dust[index25].position = drawPlayer.Center + Vector2.UnitY * drawPlayer.gfxOffY + ((float) ((double) num39 * 6.28318548202515 + (double) num40 * (double) index24)).ToRotationVector2() * num41; + Main.dust[index25].customData = (object) drawPlayer; + Main.playerDrawDust.Add(index25); + } + break; + } + } + } + if (drawPlayer.witheredArmor && this.IsActive && !Main.gamePaused) + { + G *= 0.5f; + R *= 0.75f; + } + if (drawPlayer.witheredWeapon && drawPlayer.itemAnimation > 0 && drawPlayer.inventory[drawPlayer.selectedItem].damage > 0 && this.IsActive && !Main.gamePaused && Main.rand.Next(3) == 0) + { + int index26 = Dust.NewDust(new Vector2(Position.X - 2f, Position.Y - 2f), drawPlayer.width + 4, drawPlayer.height + 4, 272, Alpha: 50, Scale: 0.5f); + Main.dust[index26].velocity *= 1.6f; + --Main.dust[index26].velocity.Y; + Main.dust[index26].position = Vector2.Lerp(Main.dust[index26].position, drawPlayer.Center, 0.5f); + Main.playerDrawDust.Add(index26); + } + if ((double) R != 1.0 || (double) G != 1.0 || (double) B != 1.0 || (double) A != 1.0) + { + if (drawPlayer.onFire || drawPlayer.onFire2 || drawPlayer.onFrostBurn) + { + color2 = drawPlayer.GetImmuneAlpha(Microsoft.Xna.Framework.Color.White, shadow); + color3 = drawPlayer.GetImmuneAlpha(drawPlayer.eyeColor, shadow); + color1 = drawPlayer.GetImmuneAlpha(drawPlayer.GetHairColor(), shadow); + color4 = drawPlayer.GetImmuneAlpha(drawPlayer.skinColor, shadow); + color5 = drawPlayer.GetImmuneAlpha(drawPlayer.skinColor, shadow); + color7 = drawPlayer.GetImmuneAlpha(drawPlayer.shirtColor, shadow); + color8 = drawPlayer.GetImmuneAlpha(drawPlayer.underShirtColor, shadow); + color9 = drawPlayer.GetImmuneAlpha(drawPlayer.pantsColor, shadow); + color6 = drawPlayer.GetImmuneAlpha(drawPlayer.skinColor, shadow); + color10 = drawPlayer.GetImmuneAlpha(drawPlayer.shoeColor, shadow); + color11 = drawPlayer.GetImmuneAlpha(Microsoft.Xna.Framework.Color.White, shadow); + color12 = drawPlayer.GetImmuneAlpha(Microsoft.Xna.Framework.Color.White, shadow); + color13 = drawPlayer.GetImmuneAlpha(Microsoft.Xna.Framework.Color.White, shadow); + } + else + { + color2 = Main.buffColor(color2, R, G, B, A); + color3 = Main.buffColor(color3, R, G, B, A); + color1 = Main.buffColor(color1, R, G, B, A); + color4 = Main.buffColor(color4, R, G, B, A); + color5 = Main.buffColor(color5, R, G, B, A); + color7 = Main.buffColor(color7, R, G, B, A); + color8 = Main.buffColor(color8, R, G, B, A); + color9 = Main.buffColor(color9, R, G, B, A); + color6 = Main.buffColor(color6, R, G, B, A); + color10 = Main.buffColor(color10, R, G, B, A); + color11 = Main.buffColor(color11, R, G, B, A); + color12 = Main.buffColor(color12, R, G, B, A); + color13 = Main.buffColor(color13, R, G, B, A); + } + } + if (drawPlayer.socialGhost) + { + color2 = Microsoft.Xna.Framework.Color.Transparent; + color3 = Microsoft.Xna.Framework.Color.Transparent; + color1 = Microsoft.Xna.Framework.Color.Transparent; + color4 = Microsoft.Xna.Framework.Color.Transparent; + color5 = Microsoft.Xna.Framework.Color.Transparent; + color7 = Microsoft.Xna.Framework.Color.Transparent; + color8 = Microsoft.Xna.Framework.Color.Transparent; + color9 = Microsoft.Xna.Framework.Color.Transparent; + color10 = Microsoft.Xna.Framework.Color.Transparent; + color6 = Microsoft.Xna.Framework.Color.Transparent; + if ((int) color11.A > (int) Main.gFade) + color11.A = Main.gFade; + if ((int) color12.A > (int) Main.gFade) + color12.A = Main.gFade; + if ((int) color13.A > (int) Main.gFade) + color13.A = Main.gFade; + } + if (drawPlayer.socialIgnoreLight) + { + float num43 = 1.2f; + color2 = Microsoft.Xna.Framework.Color.White * num43; + color3 = drawPlayer.eyeColor * num43; + color1 = GameShaders.Hair.GetColor((short) drawPlayer.hairDye, drawPlayer, Microsoft.Xna.Framework.Color.White); + color4 = drawPlayer.skinColor * num43; + color5 = drawPlayer.skinColor * num43; + color7 = drawPlayer.shirtColor * num43; + color8 = drawPlayer.underShirtColor * num43; + color9 = drawPlayer.pantsColor * num43; + color10 = drawPlayer.shoeColor * num43; + color6 = drawPlayer.skinColor * num43; + } + float num44 = 1f; + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 3106) + { + float num45 = drawPlayer.stealth; + if ((double) num45 < 0.03) + num45 = 0.03f; + float num46 = (float) ((1.0 + (double) num45 * 10.0) / 11.0); + if ((double) num45 < 0.0) + num45 = 0.0f; + if ((double) num45 >= 1.0 - (double) shadow && (double) shadow > 0.0) + num45 = shadow * 0.5f; + num44 = num46; + color11 = new Microsoft.Xna.Framework.Color((int) (byte) ((double) color11.R * (double) num45), (int) (byte) ((double) color11.G * (double) num45), (int) (byte) ((double) color11.B * (double) num46), (int) (byte) ((double) color11.A * (double) num45)); + color12 = new Microsoft.Xna.Framework.Color((int) (byte) ((double) color12.R * (double) num45), (int) (byte) ((double) color12.G * (double) num45), (int) (byte) ((double) color12.B * (double) num46), (int) (byte) ((double) color12.A * (double) num45)); + color13 = new Microsoft.Xna.Framework.Color((int) (byte) ((double) color13.R * (double) num45), (int) (byte) ((double) color13.G * (double) num45), (int) (byte) ((double) color13.B * (double) num46), (int) (byte) ((double) color13.A * (double) num45)); + float scale = num45 * num45; + color2 = Microsoft.Xna.Framework.Color.Multiply(color2, scale); + color3 = Microsoft.Xna.Framework.Color.Multiply(color3, scale); + color1 = Microsoft.Xna.Framework.Color.Multiply(color1, scale); + color4 = Microsoft.Xna.Framework.Color.Multiply(color4, scale); + color5 = Microsoft.Xna.Framework.Color.Multiply(color5, scale); + color7 = Microsoft.Xna.Framework.Color.Multiply(color7, scale); + color8 = Microsoft.Xna.Framework.Color.Multiply(color8, scale); + color9 = Microsoft.Xna.Framework.Color.Multiply(color9, scale); + color10 = Microsoft.Xna.Framework.Color.Multiply(color10, scale); + color6 = Microsoft.Xna.Framework.Color.Multiply(color6, scale); + drawColor = Microsoft.Xna.Framework.Color.Multiply(drawColor, scale); + color15 = Microsoft.Xna.Framework.Color.Multiply(color15, scale); + color16 = Microsoft.Xna.Framework.Color.Multiply(color16, scale); + color17 = Microsoft.Xna.Framework.Color.Multiply(color17, scale); + color18 = Microsoft.Xna.Framework.Color.Multiply(color18, scale); + } + else if (drawPlayer.shroomiteStealth) + { + float num47 = drawPlayer.stealth; + if ((double) num47 < 0.03) + num47 = 0.03f; + float num48 = (float) ((1.0 + (double) num47 * 10.0) / 11.0); + if ((double) num47 < 0.0) + num47 = 0.0f; + if ((double) num47 >= 1.0 - (double) shadow && (double) shadow > 0.0) + num47 = shadow * 0.5f; + num44 = num48; + color11 = new Microsoft.Xna.Framework.Color((int) (byte) ((double) color11.R * (double) num47), (int) (byte) ((double) color11.G * (double) num47), (int) (byte) ((double) color11.B * (double) num48), (int) (byte) ((double) color11.A * (double) num47)); + color12 = new Microsoft.Xna.Framework.Color((int) (byte) ((double) color12.R * (double) num47), (int) (byte) ((double) color12.G * (double) num47), (int) (byte) ((double) color12.B * (double) num48), (int) (byte) ((double) color12.A * (double) num47)); + color13 = new Microsoft.Xna.Framework.Color((int) (byte) ((double) color13.R * (double) num47), (int) (byte) ((double) color13.G * (double) num47), (int) (byte) ((double) color13.B * (double) num48), (int) (byte) ((double) color13.A * (double) num47)); + float scale = num47 * num47; + color2 = Microsoft.Xna.Framework.Color.Multiply(color2, scale); + color3 = Microsoft.Xna.Framework.Color.Multiply(color3, scale); + color1 = Microsoft.Xna.Framework.Color.Multiply(color1, scale); + color4 = Microsoft.Xna.Framework.Color.Multiply(color4, scale); + color5 = Microsoft.Xna.Framework.Color.Multiply(color5, scale); + color7 = Microsoft.Xna.Framework.Color.Multiply(color7, scale); + color8 = Microsoft.Xna.Framework.Color.Multiply(color8, scale); + color9 = Microsoft.Xna.Framework.Color.Multiply(color9, scale); + color10 = Microsoft.Xna.Framework.Color.Multiply(color10, scale); + color6 = Microsoft.Xna.Framework.Color.Multiply(color6, scale); + drawColor = Microsoft.Xna.Framework.Color.Multiply(drawColor, scale); + color15 = Microsoft.Xna.Framework.Color.Multiply(color15, scale); + color16 = Microsoft.Xna.Framework.Color.Multiply(color16, scale); + color17 = Microsoft.Xna.Framework.Color.Multiply(color17, scale); + color18 = Microsoft.Xna.Framework.Color.Multiply(color18, scale); + } + else if (drawPlayer.setVortex) + { + float num49 = drawPlayer.stealth; + if ((double) num49 < 0.03) + num49 = 0.03f; + if ((double) num49 < 0.0) + num49 = 0.0f; + if ((double) num49 >= 1.0 - (double) shadow && (double) shadow > 0.0) + num49 = shadow * 0.5f; + num44 = num49; + Microsoft.Xna.Framework.Color secondColor = new Microsoft.Xna.Framework.Color(Vector4.Lerp(Vector4.One, new Vector4(0.0f, 0.12f, 0.16f, 0.0f), 1f - num49)); + color11 = color11.MultiplyRGBA(secondColor); + color12 = color12.MultiplyRGBA(secondColor); + color13 = color13.MultiplyRGBA(secondColor); + float scale = num49 * num49; + color2 = Microsoft.Xna.Framework.Color.Multiply(color2, scale); + color3 = Microsoft.Xna.Framework.Color.Multiply(color3, scale); + color1 = Microsoft.Xna.Framework.Color.Multiply(color1, scale); + color4 = Microsoft.Xna.Framework.Color.Multiply(color4, scale); + color5 = Microsoft.Xna.Framework.Color.Multiply(color5, scale); + color7 = Microsoft.Xna.Framework.Color.Multiply(color7, scale); + color8 = Microsoft.Xna.Framework.Color.Multiply(color8, scale); + color9 = Microsoft.Xna.Framework.Color.Multiply(color9, scale); + color10 = Microsoft.Xna.Framework.Color.Multiply(color10, scale); + color6 = Microsoft.Xna.Framework.Color.Multiply(color6, scale); + drawColor = Microsoft.Xna.Framework.Color.Multiply(drawColor, scale); + color15 = Microsoft.Xna.Framework.Color.Multiply(color15, scale); + color16 = Microsoft.Xna.Framework.Color.Multiply(color16, scale); + color17 = Microsoft.Xna.Framework.Color.Multiply(color17, scale); + color18 = Microsoft.Xna.Framework.Color.Multiply(color18, scale); + } + SpriteEffects spriteEffects; + SpriteEffects effect; + if ((double) drawPlayer.gravDir == 1.0) + { + if (drawPlayer.direction == 1) + { + spriteEffects = SpriteEffects.None; + effect = SpriteEffects.None; + } + else + { + spriteEffects = SpriteEffects.FlipHorizontally; + effect = SpriteEffects.FlipHorizontally; + } + if (!drawPlayer.dead) + { + drawPlayer.legPosition.Y = 0.0f; + drawPlayer.headPosition.Y = 0.0f; + drawPlayer.bodyPosition.Y = 0.0f; + } + } else - frame = texture.Frame(); + { + if (drawPlayer.direction == 1) + { + spriteEffects = SpriteEffects.FlipVertically; + effect = SpriteEffects.FlipVertically; + } + else + { + spriteEffects = SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically; + effect = SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically; + } + if (!drawPlayer.dead) + { + drawPlayer.legPosition.Y = 6f; + drawPlayer.headPosition.Y = 6f; + drawPlayer.bodyPosition.Y = 6f; + } + } + Vector2 origin1 = new Vector2((float) drawPlayer.legFrame.Width * 0.5f, (float) drawPlayer.legFrame.Height * 0.75f); + Vector2 origin2 = new Vector2((float) drawPlayer.legFrame.Width * 0.5f, (float) drawPlayer.legFrame.Height * 0.5f); + Vector2 origin3 = new Vector2((float) drawPlayer.legFrame.Width * 0.5f, (float) drawPlayer.legFrame.Height * 0.4f); + if ((drawPlayer.merman || drawPlayer.forceMerman) && !drawPlayer.hideMerman) + { + drawPlayer.headRotation = (float) ((double) drawPlayer.velocity.Y * (double) drawPlayer.direction * 0.100000001490116); + if ((double) drawPlayer.headRotation < -0.3) + drawPlayer.headRotation = -0.3f; + if ((double) drawPlayer.headRotation > 0.3) + drawPlayer.headRotation = 0.3f; + } + else if (!drawPlayer.dead) + drawPlayer.headRotation = 0.0f; + Microsoft.Xna.Framework.Rectangle bodyFrame1 = drawPlayer.bodyFrame; + bodyFrame1.Y -= 336; + if (bodyFrame1.Y < 0) + bodyFrame1.Y = 0; + int num50 = 26; + int hair = drawPlayer.hair; + bool flag7 = hair > 50 && (hair < 56 || hair > 63) && (hair < 74 || hair > 77) && (hair < 88 || hair > 89) && hair != 94 && hair != 100 && hair != 104 && hair != 112 && hair < 116; + if (hair == 133) + flag7 = true; + if (flag6) + bodyFrame1.Height = 0; + else if (flag7) + { + if (drawPlayer.head == -1 | flag4 || drawPlayer.head == 23 || drawPlayer.head == 0) + { + drawData = new DrawData(Main.playerHairTexture[drawPlayer.hair], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3, new Microsoft.Xna.Framework.Rectangle?(bodyFrame1), color1, drawPlayer.headRotation, origin3, 1f, spriteEffects, 0); + drawData.shader = -num4; + Main.playerDrawData.Add(drawData); + } + else if (flag5) + { + drawData = new DrawData(Main.playerHairAltTexture[drawPlayer.hair], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3, new Microsoft.Xna.Framework.Rectangle?(bodyFrame1), color1, drawPlayer.headRotation, origin3, 1f, spriteEffects, 0); + drawData.shader = -num4; + Main.playerDrawData.Add(drawData); + } + if ((double) drawPlayer.gravDir == 1.0) + bodyFrame1.Height = num50; + } + if (drawPlayer.mount.Active) + { + drawPlayer.mount.Draw(Main.playerDrawData, 0, drawPlayer, Position, drawColor, spriteEffects, shadow); + drawPlayer.mount.Draw(Main.playerDrawData, 1, drawPlayer, Position, drawColor, spriteEffects, shadow); + } + if (drawPlayer.carpetFrame >= 0) + { + Microsoft.Xna.Framework.Color color19 = color13; + float num51 = 0.0f; + if ((double) drawPlayer.gravDir == -1.0) + num51 = 10f; + drawData = new DrawData(Main.flyingCarpetTexture, new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) (drawPlayer.height / 2) + 28.0 * (double) drawPlayer.gravDir + (double) num51)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, Main.flyingCarpetTexture.Height / 6 * drawPlayer.carpetFrame, Main.flyingCarpetTexture.Width, Main.flyingCarpetTexture.Height / 6)), color19, drawPlayer.bodyRotation, new Vector2((float) (Main.flyingCarpetTexture.Width / 2), (float) (Main.flyingCarpetTexture.Height / 8)), 1f, spriteEffects, 0); + drawData.shader = num18; + Main.playerDrawData.Add(drawData); + } + Position.Y += num2; + if (drawPlayer.electrified && (double) shadow == 0.0) + { + Texture2D texture = Main.glowMaskTexture[25]; + int num52 = drawPlayer.miscCounter / 5; + for (int index27 = 0; index27 < 2; ++index27) + { + int num53 = num52 % 7; + if (num53 <= 1 || num53 >= 5) + { + drawData = new DrawData(texture, new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, num53 * texture.Height / 7, texture.Width, texture.Height / 7)), color14, drawPlayer.bodyRotation, new Vector2((float) (texture.Width / 2), (float) (texture.Height / 14)), 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + } + num52 = num53 + 3; + } + } + if (drawPlayer.setForbidden && (double) shadow == 0.0) + { + Microsoft.Xna.Framework.Color color20 = Microsoft.Xna.Framework.Color.Lerp(color12, Microsoft.Xna.Framework.Color.White, 0.7f); + Texture2D texture2D = Main.extraTexture[74]; + Texture2D texture = Main.glowMaskTexture[217]; + int num54 = !drawPlayer.setForbiddenCooldownLocked ? 1 : 0; + int num55 = (int) ((double) ((float) ((double) drawPlayer.miscCounter / 300.0 * 6.28318548202515)).ToRotationVector2().Y * 6.0); + float num56 = ((float) ((double) drawPlayer.miscCounter / 75.0 * 6.28318548202515)).ToRotationVector2().X * 4f; + Microsoft.Xna.Framework.Color color21 = new Microsoft.Xna.Framework.Color(80, 70, 40, 0) * (float) ((double) num56 / 8.0 + 0.5) * 0.8f; + if (num54 == 0) + { + num55 = 0; + num56 = 2f; + color21 = new Microsoft.Xna.Framework.Color(80, 70, 40, 0) * 0.3f; + color20 = color20.MultiplyRGB(new Microsoft.Xna.Framework.Color(0.5f, 0.5f, 1f)); + } + Vector2 position = new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)) + new Vector2((float) (-drawPlayer.direction * 10), (float) (num55 - 20)); + drawData = new DrawData(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(), color20, drawPlayer.bodyRotation, texture2D.Size() / 2f, 1f, spriteEffects, 0); + drawData.shader = num5; + Main.playerDrawData.Add(drawData); + for (float num57 = 0.0f; (double) num57 < 4.0; ++num57) + { + drawData = new DrawData(texture, position + (num57 * 1.570796f).ToRotationVector2() * num56, new Microsoft.Xna.Framework.Rectangle?(), color21, drawPlayer.bodyRotation, texture2D.Size() / 2f, 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + } + } + else if (drawPlayer.webbed && (double) shadow == 0.0 && (double) drawPlayer.velocity.Y != 0.0) + { + Microsoft.Xna.Framework.Color color22 = color12 * 0.75f; + Texture2D texture2D = Main.extraTexture[32]; + drawData = new DrawData(texture2D, new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(), color22, drawPlayer.bodyRotation, texture2D.Size() / 2f, 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + } + if (drawPlayer.leinforsHair && (flag4 | flag5 || drawPlayer.head == -1 || drawPlayer.head == 0) && drawPlayer.hair != 12 && (double) shadow == 0.0 && (double) Main.rgbToHsl(color4).Z > 0.200000002980232) + { + if (Main.rand.Next(20) == 0 && !flag5) + { + Microsoft.Xna.Framework.Rectangle r = Utils.CenteredRectangle(Position + drawPlayer.Size / 2f + new Vector2(0.0f, drawPlayer.gravDir * -20f), new Vector2(20f, 14f)); + int index28 = Dust.NewDust(r.TopLeft(), r.Width, r.Height, 204, Alpha: 150, Scale: 0.3f); + Main.dust[index28].fadeIn = 1f; + Main.dust[index28].velocity *= 0.1f; + Main.dust[index28].noLight = true; + Main.playerDrawDust.Add(index28); + } + if (Main.rand.Next(40) == 0 & flag5) + { + Microsoft.Xna.Framework.Rectangle r = Utils.CenteredRectangle(Position + drawPlayer.Size / 2f + new Vector2((float) (drawPlayer.direction * -10), drawPlayer.gravDir * -10f), new Vector2(5f, 5f)); + int index29 = Dust.NewDust(r.TopLeft(), r.Width, r.Height, 204, Alpha: 150, Scale: 0.3f); + Main.dust[index29].fadeIn = 1f; + Main.dust[index29].velocity *= 0.1f; + Main.dust[index29].noLight = true; + Main.playerDrawDust.Add(index29); + } + if ((double) drawPlayer.velocity.X != 0.0 & flag7 && Main.rand.Next(15) == 0) + { + Microsoft.Xna.Framework.Rectangle r = Utils.CenteredRectangle(Position + drawPlayer.Size / 2f + new Vector2((float) (drawPlayer.direction * -14), 0.0f), new Vector2(4f, 30f)); + int index30 = Dust.NewDust(r.TopLeft(), r.Width, r.Height, 204, Alpha: 150, Scale: 0.3f); + Main.dust[index30].fadeIn = 1f; + Main.dust[index30].velocity *= 0.1f; + Main.dust[index30].noLight = true; + Main.playerDrawDust.Add(index30); + } + } + Position.Y -= num2; + bool flag8 = false; + if ((drawPlayer.wings == 0 || (double) drawPlayer.velocity.Y == 0.0) && (drawPlayer.inventory[drawPlayer.selectedItem].type == 1178 || drawPlayer.inventory[drawPlayer.selectedItem].type == 779 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1295 || drawPlayer.inventory[drawPlayer.selectedItem].type == 1910 || drawPlayer.turtleArmor || drawPlayer.body == 106 || drawPlayer.body == 170)) + { + flag8 = true; + int type = drawPlayer.inventory[drawPlayer.selectedItem].type; + int index31 = 1; + float num58 = -4f; + float num59 = -8f; + int num60 = 0; + if (drawPlayer.turtleArmor) + { + index31 = 4; + num60 = num5; + } + else if (drawPlayer.body == 106) + { + index31 = 6; + num60 = num5; + } + else if (drawPlayer.body == 170) + { + index31 = 7; + num60 = num5; + } + else + { + switch (type) + { + case 779: + index31 = 2; + break; + case 1178: + index31 = 1; + break; + case 1295: + index31 = 3; + break; + case 1910: + index31 = 5; + break; + } + } + switch (index31) + { + case 4: + case 6: + drawData = new DrawData(Main.BackPackTexture[index31], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color12, drawPlayer.bodyRotation, origin2, 1f, spriteEffects, 0); + drawData.shader = num60; + Main.playerDrawData.Add(drawData); + break; + case 7: + drawData = new DrawData(Main.BackPackTexture[index31], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, drawPlayer.bodyFrame.Y, Main.BackPackTexture[index31].Width, drawPlayer.bodyFrame.Height)), color12, drawPlayer.bodyRotation, new Vector2((float) Main.BackPackTexture[index31].Width * 0.5f, origin2.Y), 1f, spriteEffects, 0); + drawData.shader = num60; + Main.playerDrawData.Add(drawData); + break; + default: + drawData = new DrawData(Main.BackPackTexture[index31], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X + (double) (drawPlayer.width / 2) - (double) (9 * drawPlayer.direction)) + num58 * (float) drawPlayer.direction, (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) (drawPlayer.height / 2) + 2.0 * (double) drawPlayer.gravDir + (double) num59 * (double) drawPlayer.gravDir)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.BackPackTexture[index31].Width, Main.BackPackTexture[index31].Height)), color12, drawPlayer.bodyRotation, new Vector2((float) (Main.BackPackTexture[index31].Width / 2), (float) (Main.BackPackTexture[index31].Height / 2)), 1f, spriteEffects, 0); + drawData.shader = num60; + Main.playerDrawData.Add(drawData); + break; + } + } + if (!flag8 && drawPlayer.back > (sbyte) 0 && drawPlayer.back < (sbyte) 14 && !drawPlayer.mount.Active) + { + if (drawPlayer.front >= (sbyte) 1 && drawPlayer.front <= (sbyte) 4) + { + int num61 = drawPlayer.bodyFrame.Y / 56; + if (num61 < 1 || num61 > 5) + { + num3 = 10; + } + else + { + if (drawPlayer.front == (sbyte) 1) + num3 = 0; + if (drawPlayer.front == (sbyte) 2) + num3 = 8; + if (drawPlayer.front == (sbyte) 3) + num3 = 0; + if (drawPlayer.front == (sbyte) 4) + num3 = 8; + } + } + drawData = new DrawData(Main.accBackTexture[(int) drawPlayer.back], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color12, drawPlayer.bodyRotation, origin2, 1f, spriteEffects, 0); + drawData.shader = num9; + Main.playerDrawData.Add(drawData); + } + Position.Y += (float) ((int) playerOffset / 2); + if (!flag8 && drawPlayer.wings > 0) + { + this.LoadWings(drawPlayer.wings); + if (drawPlayer.wings == 22) + { + if (((double) drawPlayer.velocity.Y != 0.0 || drawPlayer.grappling[0] != -1) && !drawPlayer.mount.Active) + { + this.LoadItemFlames(1866); + Microsoft.Xna.Framework.Color color23 = color12; + int num62 = 24; + int num63 = 0; + if ((double) shadow == 0.0 && drawPlayer.grappling[0] == -1) + { + for (int index32 = 0; index32 < 7; ++index32) + { + Microsoft.Xna.Framework.Color color24 = new Microsoft.Xna.Framework.Color(250 - index32 * 10, 250 - index32 * 10, 250 - index32 * 10, 150 - index32 * 10); + Vector2 vector2_5 = new Vector2((float) Main.rand.Next(-10, 11) * 0.2f, (float) Main.rand.Next(-10, 11) * 0.2f); + num44 = num44 * num44 * (1f - shadow); + color24 = new Microsoft.Xna.Framework.Color((int) ((double) color24.R * (double) num44), (int) ((double) color24.G * (double) num44), (int) ((double) color24.B * (double) num44), (int) ((double) color24.A * (double) num44)); + vector2_5.X = drawPlayer.itemFlamePos[index32].X; + vector2_5.Y = -drawPlayer.itemFlamePos[index32].Y; + vector2_5 *= 0.5f; + drawData = new DrawData(Main.itemFlameTexture[1866], new Vector2((float) ((int) ((double) Position.X - (double) Main.screenPosition.X + (double) (drawPlayer.width / 2) - (double) (9 * drawPlayer.direction)) + num63 * drawPlayer.direction), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) (drawPlayer.height / 2) + 2.0 * (double) drawPlayer.gravDir + (double) num62 * (double) drawPlayer.gravDir)) + vector2_5, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, Main.wingsTexture[drawPlayer.wings].Height / 7 * drawPlayer.wingFrame, Main.wingsTexture[drawPlayer.wings].Width, Main.wingsTexture[drawPlayer.wings].Height / 7 - 2)), color24, drawPlayer.bodyRotation, new Vector2((float) (Main.wingsTexture[drawPlayer.wings].Width / 2), (float) (Main.wingsTexture[drawPlayer.wings].Height / 14)), 1f, spriteEffects, 0); + drawData.shader = num17; + Main.playerDrawData.Add(drawData); + } + } + drawData = new DrawData(Main.wingsTexture[drawPlayer.wings], new Vector2((float) ((int) ((double) Position.X - (double) Main.screenPosition.X + (double) (drawPlayer.width / 2) - (double) (9 * drawPlayer.direction)) + num63 * drawPlayer.direction), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) (drawPlayer.height / 2) + 2.0 * (double) drawPlayer.gravDir + (double) num62 * (double) drawPlayer.gravDir)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, Main.wingsTexture[drawPlayer.wings].Height / 7 * drawPlayer.wingFrame, Main.wingsTexture[drawPlayer.wings].Width, Main.wingsTexture[drawPlayer.wings].Height / 7)), color23, drawPlayer.bodyRotation, new Vector2((float) (Main.wingsTexture[drawPlayer.wings].Width / 2), (float) (Main.wingsTexture[drawPlayer.wings].Height / 14)), 1f, spriteEffects, 0); + drawData.shader = num17; + Main.playerDrawData.Add(drawData); + } + } + else if (drawPlayer.wings == 28) + { + if (((double) drawPlayer.velocity.Y != 0.0 || drawPlayer.grappling[0] != -1) && !drawPlayer.mount.Active) + { + Microsoft.Xna.Framework.Color color25 = color12; + Vector2 vector2_6 = new Vector2(0.0f, 0.0f); + Texture2D texture2D = Main.wingsTexture[drawPlayer.wings]; + Vector2 vec = Position + drawPlayer.Size * new Vector2(0.5f, 1f) - Main.screenPosition + vector2_6 * drawPlayer.Directions; + Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: 4, frameY: (drawPlayer.miscCounter / 5 % 4)); + r.Width -= 2; + r.Height -= 2; + drawData = new DrawData(texture2D, vec.Floor(), new Microsoft.Xna.Framework.Rectangle?(r), Microsoft.Xna.Framework.Color.Lerp(color25, Microsoft.Xna.Framework.Color.White, 1f), drawPlayer.bodyRotation, r.Size() / 2f, 1f, spriteEffects, 0); + drawData.shader = num17; + Main.playerDrawData.Add(drawData); + drawData = new DrawData(Main.extraTexture[38], vec.Floor(), new Microsoft.Xna.Framework.Rectangle?(r), Microsoft.Xna.Framework.Color.Lerp(color25, Microsoft.Xna.Framework.Color.White, 0.5f), drawPlayer.bodyRotation, r.Size() / 2f, 1f, spriteEffects, 0); + drawData.shader = num17; + Main.playerDrawData.Add(drawData); + } + } + else if (drawPlayer.wings == 34) + { + if (((double) drawPlayer.velocity.Y != 0.0 || drawPlayer.grappling[0] != -1) && !drawPlayer.mount.Active) + { + num44 = num44 * num44 * (1f - shadow); + Microsoft.Xna.Framework.Color color26 = new Microsoft.Xna.Framework.Color((int) (250.0 * (double) num44), (int) (250.0 * (double) num44), (int) (250.0 * (double) num44), (int) (100.0 * (double) num44)); + Vector2 vector2_7 = new Vector2(0.0f, 0.0f); + Texture2D texture2D = Main.wingsTexture[drawPlayer.wings]; + Vector2 vec = Position + drawPlayer.Size / 2f - Main.screenPosition + vector2_7 * drawPlayer.Directions - Vector2.UnitX * (float) drawPlayer.direction * 4f; + Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: 6, frameY: drawPlayer.wingFrame); + r.Width -= 2; + r.Height -= 2; + drawData = new DrawData(texture2D, vec.Floor(), new Microsoft.Xna.Framework.Rectangle?(r), color26, drawPlayer.bodyRotation, r.Size() / 2f, 1f, spriteEffects, 0); + drawData.shader = num17; + Main.playerDrawData.Add(drawData); + } + } + else if (drawPlayer.wings == 39) + { + if (((double) drawPlayer.velocity.Y != 0.0 || drawPlayer.grappling[0] != -1) && !drawPlayer.mount.Active) + { + num44 = num44 * num44 * (1f - shadow); + Microsoft.Xna.Framework.Color color27 = color12; + Vector2 vector2_8 = new Vector2(0.0f, 0.0f); + Texture2D texture2D = Main.wingsTexture[drawPlayer.wings]; + Vector2 vec = Position + drawPlayer.Size / 2f - Main.screenPosition + vector2_8 * drawPlayer.Directions - Vector2.UnitX * (float) drawPlayer.direction * 6f - Vector2.UnitY * 7f * drawPlayer.gravDir; + Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: 6, frameY: drawPlayer.wingFrame); + r.Width -= 2; + r.Height -= 2; + drawData = new DrawData(texture2D, vec.Floor(), new Microsoft.Xna.Framework.Rectangle?(r), color27, drawPlayer.bodyRotation, r.Size() / 2f, 1f, spriteEffects, 0); + drawData.shader = num17; + Main.playerDrawData.Add(drawData); + } + } + else + { + int num64 = 0; + int num65 = 0; + if (drawPlayer.wings == 5) + { + num65 = 4; + num64 -= 4; + } + else if (drawPlayer.wings == 27) + num65 = 4; + Microsoft.Xna.Framework.Color color28 = color12; + if (drawPlayer.wings == 9 || drawPlayer.wings == 29) + { + num44 = num44 * num44 * (1f - shadow); + color28 = new Microsoft.Xna.Framework.Color((int) (250.0 * (double) num44), (int) (250.0 * (double) num44), (int) (250.0 * (double) num44), (int) (100.0 * (double) num44)); + } + if (drawPlayer.wings == 10) + { + num44 = num44 * num44 * (1f - shadow); + color28 = new Microsoft.Xna.Framework.Color((int) (250.0 * (double) num44), (int) (250.0 * (double) num44), (int) (250.0 * (double) num44), (int) (175.0 * (double) num44)); + } + if (drawPlayer.wings == 11 && (int) color28.A > (int) Main.gFade) + color28.A = Main.gFade; + if (drawPlayer.wings == 31) + color28.A = (byte) (220.0 * (double) num44); + if (drawPlayer.wings == 32) + color28.A = (byte) ((double) sbyte.MaxValue * (double) num44); + drawData = new DrawData(Main.wingsTexture[drawPlayer.wings], new Vector2((float) ((int) ((double) Position.X - (double) Main.screenPosition.X + (double) (drawPlayer.width / 2) - (double) (9 * drawPlayer.direction)) + num65 * drawPlayer.direction), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) (drawPlayer.height / 2) + 2.0 * (double) drawPlayer.gravDir + (double) num64 * (double) drawPlayer.gravDir)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, Main.wingsTexture[drawPlayer.wings].Height / 4 * drawPlayer.wingFrame, Main.wingsTexture[drawPlayer.wings].Width, Main.wingsTexture[drawPlayer.wings].Height / 4)), color28, drawPlayer.bodyRotation, new Vector2((float) (Main.wingsTexture[drawPlayer.wings].Width / 2), (float) (Main.wingsTexture[drawPlayer.wings].Height / 8)), 1f, spriteEffects, 0); + drawData.shader = num17; + Main.playerDrawData.Add(drawData); + if (drawPlayer.wings == 23) + { + num44 = num44 * num44 * (1f - shadow); + color28 = new Microsoft.Xna.Framework.Color((int) (200.0 * (double) num44), (int) (200.0 * (double) num44), (int) (200.0 * (double) num44), (int) (200.0 * (double) num44)); + drawData = new DrawData(Main.FlameTexture[8], new Vector2((float) ((int) ((double) Position.X - (double) Main.screenPosition.X + (double) (drawPlayer.width / 2) - (double) (9 * drawPlayer.direction)) + num65 * drawPlayer.direction), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) (drawPlayer.height / 2) + 2.0 * (double) drawPlayer.gravDir + (double) num64 * (double) drawPlayer.gravDir)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, Main.wingsTexture[drawPlayer.wings].Height / 4 * drawPlayer.wingFrame, Main.wingsTexture[drawPlayer.wings].Width, Main.wingsTexture[drawPlayer.wings].Height / 4)), color28, drawPlayer.bodyRotation, new Vector2((float) (Main.wingsTexture[drawPlayer.wings].Width / 2), (float) (Main.wingsTexture[drawPlayer.wings].Height / 8)), 1f, spriteEffects, 0); + drawData.shader = num17; + Main.playerDrawData.Add(drawData); + } + else if (drawPlayer.wings == 27) + { + drawData = new DrawData(Main.glowMaskTexture[92], new Vector2((float) ((int) ((double) Position.X - (double) Main.screenPosition.X + (double) (drawPlayer.width / 2) - (double) (9 * drawPlayer.direction)) + num65 * drawPlayer.direction), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) (drawPlayer.height / 2) + 2.0 * (double) drawPlayer.gravDir + (double) num64 * (double) drawPlayer.gravDir)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, Main.wingsTexture[drawPlayer.wings].Height / 4 * drawPlayer.wingFrame, Main.wingsTexture[drawPlayer.wings].Width, Main.wingsTexture[drawPlayer.wings].Height / 4)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue) * num44 * (1f - shadow), drawPlayer.bodyRotation, new Vector2((float) (Main.wingsTexture[drawPlayer.wings].Width / 2), (float) (Main.wingsTexture[drawPlayer.wings].Height / 8)), 1f, spriteEffects, 0); + drawData.shader = num17; + Main.playerDrawData.Add(drawData); + } + else if (drawPlayer.wings == 30) + { + drawData = new DrawData(Main.glowMaskTexture[181], new Vector2((float) ((int) ((double) Position.X - (double) Main.screenPosition.X + (double) (drawPlayer.width / 2) - (double) (9 * drawPlayer.direction)) + num65 * drawPlayer.direction), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) (drawPlayer.height / 2) + 2.0 * (double) drawPlayer.gravDir + (double) num64 * (double) drawPlayer.gravDir)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, Main.wingsTexture[drawPlayer.wings].Height / 4 * drawPlayer.wingFrame, Main.wingsTexture[drawPlayer.wings].Width, Main.wingsTexture[drawPlayer.wings].Height / 4)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue) * num44 * (1f - shadow), drawPlayer.bodyRotation, new Vector2((float) (Main.wingsTexture[drawPlayer.wings].Width / 2), (float) (Main.wingsTexture[drawPlayer.wings].Height / 8)), 1f, spriteEffects, 0); + drawData.shader = num17; + Main.playerDrawData.Add(drawData); + } + else if (drawPlayer.wings == 38) + { + Microsoft.Xna.Framework.Color color29 = underShirtColor * num44 * (1f - shadow); + drawData = new DrawData(Main.glowMaskTexture[251], new Vector2((float) ((int) ((double) Position.X - (double) Main.screenPosition.X + (double) (drawPlayer.width / 2) - (double) (9 * drawPlayer.direction)) + num65 * drawPlayer.direction), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) (drawPlayer.height / 2) + 2.0 * (double) drawPlayer.gravDir + (double) num64 * (double) drawPlayer.gravDir)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, Main.wingsTexture[drawPlayer.wings].Height / 4 * drawPlayer.wingFrame, Main.wingsTexture[drawPlayer.wings].Width, Main.wingsTexture[drawPlayer.wings].Height / 4)), color29, drawPlayer.bodyRotation, new Vector2((float) (Main.wingsTexture[drawPlayer.wings].Width / 2), (float) (Main.wingsTexture[drawPlayer.wings].Height / 8)), 1f, spriteEffects, 0); + drawData.shader = num17; + Main.playerDrawData.Add(drawData); + for (int index33 = drawPlayer.shadowPos.Length - 2; index33 >= 0; --index33) + { + Microsoft.Xna.Framework.Color color30 = color29; + color30.A = (byte) 0; + color30 *= MathHelper.Lerp(1f, 0.0f, (float) index33 / 3f); + color30 *= 0.1f; + Vector2 vector2_9 = drawPlayer.shadowPos[index33] - drawPlayer.position; + for (float num66 = 0.0f; (double) num66 < 1.0; num66 += 0.01f) + { + Vector2 vector2_10 = new Vector2(2f, 0.0f).RotatedBy((double) num66 / 0.0399999991059303 * 6.28318548202515); + drawData = new DrawData(Main.glowMaskTexture[251], vector2_10 + vector2_9 * num66 + new Vector2((float) ((int) ((double) Position.X - (double) Main.screenPosition.X + (double) (drawPlayer.width / 2) - (double) (9 * drawPlayer.direction)) + num65 * drawPlayer.direction), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) (drawPlayer.height / 2) + 2.0 * (double) drawPlayer.gravDir + (double) num64 * (double) drawPlayer.gravDir)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, Main.wingsTexture[drawPlayer.wings].Height / 4 * drawPlayer.wingFrame, Main.wingsTexture[drawPlayer.wings].Width, Main.wingsTexture[drawPlayer.wings].Height / 4)), color30 * (1f - num66), drawPlayer.bodyRotation, new Vector2((float) (Main.wingsTexture[drawPlayer.wings].Width / 2), (float) (Main.wingsTexture[drawPlayer.wings].Height / 8)), 1f, spriteEffects, 0); + drawData.shader = num17; + Main.playerDrawData.Add(drawData); + } + } + } + else if (drawPlayer.wings == 29) + { + drawData = new DrawData(Main.wingsTexture[drawPlayer.wings], new Vector2((float) ((int) ((double) Position.X - (double) Main.screenPosition.X + (double) (drawPlayer.width / 2) - (double) (9 * drawPlayer.direction)) + num65 * drawPlayer.direction), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) (drawPlayer.height / 2) + 2.0 * (double) drawPlayer.gravDir + (double) num64 * (double) drawPlayer.gravDir)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, Main.wingsTexture[drawPlayer.wings].Height / 4 * drawPlayer.wingFrame, Main.wingsTexture[drawPlayer.wings].Width, Main.wingsTexture[drawPlayer.wings].Height / 4)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * num44 * (1f - shadow) * 0.5f, drawPlayer.bodyRotation, new Vector2((float) (Main.wingsTexture[drawPlayer.wings].Width / 2), (float) (Main.wingsTexture[drawPlayer.wings].Height / 8)), 1.06f, spriteEffects, 0); + drawData.shader = num17; + Main.playerDrawData.Add(drawData); + } + else if (drawPlayer.wings == 36) + { + drawData = new DrawData(Main.glowMaskTexture[213], new Vector2((float) ((int) ((double) Position.X - (double) Main.screenPosition.X + (double) (drawPlayer.width / 2) - (double) (9 * drawPlayer.direction)) + num65 * drawPlayer.direction), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) (drawPlayer.height / 2) + 2.0 * (double) drawPlayer.gravDir + (double) num64 * (double) drawPlayer.gravDir)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, Main.wingsTexture[drawPlayer.wings].Height / 4 * drawPlayer.wingFrame, Main.wingsTexture[drawPlayer.wings].Width, Main.wingsTexture[drawPlayer.wings].Height / 4)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * num44 * (1f - shadow), drawPlayer.bodyRotation, new Vector2((float) (Main.wingsTexture[drawPlayer.wings].Width / 2), (float) (Main.wingsTexture[drawPlayer.wings].Height / 8)), 1.06f, spriteEffects, 0); + drawData.shader = num17; + Main.playerDrawData.Add(drawData); + Vector2 spinningpoint = new Vector2(0.0f, (float) (2.0 - (double) shadow * 2.0)); + for (int index34 = 0; index34 < 4; ++index34) + { + drawData = new DrawData(Main.glowMaskTexture[213], spinningpoint.RotatedBy(1.57079637050629 * (double) index34) + new Vector2((float) ((int) ((double) Position.X - (double) Main.screenPosition.X + (double) (drawPlayer.width / 2) - (double) (9 * drawPlayer.direction)) + num65 * drawPlayer.direction), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) (drawPlayer.height / 2) + 2.0 * (double) drawPlayer.gravDir + (double) num64 * (double) drawPlayer.gravDir)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, Main.wingsTexture[drawPlayer.wings].Height / 4 * drawPlayer.wingFrame, Main.wingsTexture[drawPlayer.wings].Width, Main.wingsTexture[drawPlayer.wings].Height / 4)), new Microsoft.Xna.Framework.Color((int) sbyte.MaxValue, (int) sbyte.MaxValue, (int) sbyte.MaxValue, (int) sbyte.MaxValue) * num44 * (1f - shadow), drawPlayer.bodyRotation, new Vector2((float) (Main.wingsTexture[drawPlayer.wings].Width / 2), (float) (Main.wingsTexture[drawPlayer.wings].Height / 8)), 1f, spriteEffects, 0); + drawData.shader = num17; + Main.playerDrawData.Add(drawData); + } + } + else if (drawPlayer.wings == 31) + { + Microsoft.Xna.Framework.Color color31 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); + Microsoft.Xna.Framework.Color color32 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.HotPink, Microsoft.Xna.Framework.Color.Crimson, (float) (Math.Cos(6.28318548202515 * ((double) drawPlayer.miscCounter / 100.0)) * 0.400000005960464 + 0.5)); + color32.A = (byte) 0; + for (int index35 = 0; index35 < 4; ++index35) + { + Vector2 vector2_11 = new Vector2((float) (Math.Cos(6.28318548202515 * ((double) drawPlayer.miscCounter / 60.0)) * 0.5 + 0.5), 0.0f).RotatedBy((double) index35 * 1.57079637050629) * 1f; + drawData = new DrawData(Main.wingsTexture[drawPlayer.wings], new Vector2((float) ((int) ((double) Position.X - (double) Main.screenPosition.X + (double) (drawPlayer.width / 2) - (double) (9 * drawPlayer.direction)) + num65 * drawPlayer.direction), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) (drawPlayer.height / 2) + 2.0 * (double) drawPlayer.gravDir + (double) num64 * (double) drawPlayer.gravDir)) + vector2_11, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, Main.wingsTexture[drawPlayer.wings].Height / 4 * drawPlayer.wingFrame, Main.wingsTexture[drawPlayer.wings].Width, Main.wingsTexture[drawPlayer.wings].Height / 4)), color32 * num44 * (1f - shadow) * 0.5f, drawPlayer.bodyRotation, new Vector2((float) (Main.wingsTexture[drawPlayer.wings].Width / 2), (float) (Main.wingsTexture[drawPlayer.wings].Height / 8)), 1f, spriteEffects, 0); + drawData.shader = num17; + Main.playerDrawData.Add(drawData); + } + drawData = new DrawData(Main.wingsTexture[drawPlayer.wings], new Vector2((float) ((int) ((double) Position.X - (double) Main.screenPosition.X + (double) (drawPlayer.width / 2) - (double) (9 * drawPlayer.direction)) + num65 * drawPlayer.direction), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) (drawPlayer.height / 2) + 2.0 * (double) drawPlayer.gravDir + (double) num64 * (double) drawPlayer.gravDir)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, Main.wingsTexture[drawPlayer.wings].Height / 4 * drawPlayer.wingFrame, Main.wingsTexture[drawPlayer.wings].Width, Main.wingsTexture[drawPlayer.wings].Height / 4)), color32 * num44 * (1f - shadow) * 1f, drawPlayer.bodyRotation, new Vector2((float) (Main.wingsTexture[drawPlayer.wings].Width / 2), (float) (Main.wingsTexture[drawPlayer.wings].Height / 8)), 1f, spriteEffects, 0); + drawData.shader = num17; + Main.playerDrawData.Add(drawData); + } + else if (drawPlayer.wings == 32) + { + drawData = new DrawData(Main.glowMaskTexture[183], new Vector2((float) ((int) ((double) Position.X - (double) Main.screenPosition.X + (double) (drawPlayer.width / 2) - (double) (9 * drawPlayer.direction)) + num65 * drawPlayer.direction), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) (drawPlayer.height / 2) + 2.0 * (double) drawPlayer.gravDir + (double) num64 * (double) drawPlayer.gravDir)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, Main.wingsTexture[drawPlayer.wings].Height / 4 * drawPlayer.wingFrame, Main.wingsTexture[drawPlayer.wings].Width, Main.wingsTexture[drawPlayer.wings].Height / 4)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * num44 * (1f - shadow), drawPlayer.bodyRotation, new Vector2((float) (Main.wingsTexture[drawPlayer.wings].Width / 2), (float) (Main.wingsTexture[drawPlayer.wings].Height / 8)), 1.06f, spriteEffects, 0); + drawData.shader = num17; + Main.playerDrawData.Add(drawData); + } + } + } + if (drawPlayer.balloon > (sbyte) 0) + { + int num67 = DateTime.Now.Millisecond % 800 / 200; + Vector2 vector2_12 = Main.OffsetsPlayerOffhand[drawPlayer.bodyFrame.Y / 56]; + if (drawPlayer.direction != 1) + vector2_12.X = (float) drawPlayer.width - vector2_12.X; + if ((double) drawPlayer.gravDir != 1.0) + vector2_12.Y -= (float) drawPlayer.height; + drawData = new DrawData(Main.accBalloonTexture[(int) drawPlayer.balloon], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X + (double) vector2_12.X), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) vector2_12.Y * (double) drawPlayer.gravDir)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, Main.accBalloonTexture[(int) drawPlayer.balloon].Height / 4 * num67, Main.accBalloonTexture[(int) drawPlayer.balloon].Width, Main.accBalloonTexture[(int) drawPlayer.balloon].Height / 4)), color12, drawPlayer.bodyRotation, new Vector2((float) (26 + drawPlayer.direction * 4), (float) (28.0 + (double) drawPlayer.gravDir * 6.0)), 1f, spriteEffects, 0); + drawData.shader = num16; + Main.playerDrawData.Add(drawData); + } + Position.Y -= (float) ((int) playerOffset / 2); + int num68 = drawPlayer.body == 82 || drawPlayer.body == 83 || drawPlayer.body == 93 || drawPlayer.body == 21 ? 1 : (drawPlayer.body == 22 ? 1 : 0); + bool flag9 = drawPlayer.body == 93 || drawPlayer.legs == 20 || drawPlayer.legs == 21; + if (num68 == 0) + { + Position.Y += num2; + drawData = new DrawData(Main.playerTextures[skinVariant, 3], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.bodyRotation, origin2, 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + Position.Y -= num2; + } + if (!flag9 && drawPlayer.legs != 67 && drawPlayer.legs != 106 && drawPlayer.legs != 140 && drawPlayer.legs != 138 && drawPlayer.shoe != (sbyte) 15 && drawPlayer.legs != 143) + { + drawData = new DrawData(Main.playerTextures[skinVariant, 10], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(drawPlayer.legFrame), color6, drawPlayer.legRotation, origin2, 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + } + if (drawPlayer.wearsRobe) + goto label_448; +label_434: + if (drawPlayer.legs == 140) + { + if (!drawPlayer.invis && !drawPlayer.mount.Active) + { + Texture2D texture = Main.extraTexture[73]; + bool flag10 = drawPlayer.legFrame.Y == 0; + int num69 = drawPlayer.miscCounter / 3 % 8; + if (flag10) + num69 = drawPlayer.miscCounter / 4 % 8; + Microsoft.Xna.Framework.Rectangle r = new Microsoft.Xna.Framework.Rectangle(18 * flag10.ToInt(), num69 * 26, 16, 24); + float num70 = 12f; + if (drawPlayer.bodyFrame.Height != 0) + num70 = 12f - Main.OffsetsPlayerHeadgear[drawPlayer.bodyFrame.Y / drawPlayer.bodyFrame.Height].Y; + Vector2 scale = new Vector2(1f, 1f); + Vector2 vector2_13 = Position + drawPlayer.Size * new Vector2(0.5f, (float) (0.5 + 0.5 * (double) drawPlayer.gravDir)); + int direction = drawPlayer.direction; + Vector2 vector2_14 = new Vector2(0.0f, -num70 * drawPlayer.gravDir); + Vector2 position = (vector2_13 + vector2_14 - Main.screenPosition + drawPlayer.legPosition).Floor(); + drawData = new DrawData(texture, position, new Microsoft.Xna.Framework.Rectangle?(r), color13, drawPlayer.legRotation, r.Size() * new Vector2(0.5f, (float) (0.5 - (double) drawPlayer.gravDir * 0.5)), scale, spriteEffects, 0); + drawData.shader = num6; + Main.playerDrawData.Add(drawData); + } + } + else if (drawPlayer.legs > 0 && drawPlayer.legs < 161 && (drawPlayer.shoe != (sbyte) 15 || drawPlayer.wearsRobe)) + { + if (!drawPlayer.invis) + { + drawData = new DrawData(Main.armorLegTexture[drawPlayer.legs], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.legFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.legFrame.Height + 4.0)) + drawPlayer.legPosition + origin1, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.legFrame), color13, drawPlayer.legRotation, origin1, 1f, spriteEffects, 0); + drawData.shader = num6; + Main.playerDrawData.Add(drawData); + if (index6 != -1) + { + drawData = new DrawData(Main.glowMaskTexture[index6], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.legFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.legFrame.Height + 4.0)) + drawPlayer.legPosition + origin1, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.legFrame), color18, drawPlayer.legRotation, origin1, 1f, spriteEffects, 0); + drawData.shader = num6; + Main.playerDrawData.Add(drawData); + } + } + } + else if (!drawPlayer.invis && drawPlayer.shoe != (sbyte) 15) + { + drawData = new DrawData(Main.playerTextures[skinVariant, 11], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.legFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.legFrame.Height + 4.0)) + drawPlayer.legPosition + origin1, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.legFrame), color9, drawPlayer.legRotation, origin1, 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + drawData = new DrawData(Main.playerTextures[skinVariant, 12], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.legFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.legFrame.Height + 4.0)) + drawPlayer.legPosition + origin1, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.legFrame), color10, drawPlayer.legRotation, origin1, 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + } + if (drawPlayer.wearsRobe) + goto label_451; +label_448: + if (drawPlayer.shoe > (sbyte) 0 && drawPlayer.shoe < (sbyte) 18) + { + drawData = new DrawData(Main.accShoesTexture[(int) drawPlayer.shoe], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.legFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.legFrame.Height + 4.0)) + drawPlayer.legPosition + origin1, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.legFrame), color13, drawPlayer.legRotation, origin1, 1f, spriteEffects, 0); + drawData.shader = num11; + Main.playerDrawData.Add(drawData); + } + if (drawPlayer.wearsRobe) + goto label_434; +label_451: + Position.Y += num2; + if ((skinVariant == 3 || skinVariant == 8 ? 1 : (skinVariant == 7 ? 1 : 0)) != 0 && (drawPlayer.body <= 0 || drawPlayer.body >= 210) && !drawPlayer.invis) + { + drawData = new DrawData(Main.playerTextures[skinVariant, 14], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.legFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.legFrame.Height + 4.0)) + drawPlayer.legPosition + origin1, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.legFrame), color7, drawPlayer.legRotation, origin1, 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + } + int i1 = -1; + switch (drawPlayer.body) + { + case 200: + i1 = 149; + break; + case 201: + i1 = 150; + break; + case 202: + i1 = 151; + break; + case 209: + i1 = 160; + break; + } + if (i1 != -1) + { + this.LoadArmorLegs(i1); + drawData = new DrawData(Main.armorLegTexture[i1], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.legFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.legFrame.Height + 4.0)) + drawPlayer.legPosition + origin1, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.legFrame), color12, drawPlayer.legRotation, origin1, 1f, spriteEffects, 0); + drawData.shader = num5; + Main.playerDrawData.Add(drawData); + } + if (drawPlayer.body > 0 && drawPlayer.body < 210) + { + Microsoft.Xna.Framework.Rectangle bodyFrame2 = drawPlayer.bodyFrame; + int num71 = num3; + bodyFrame2.X += num71; + bodyFrame2.Width -= num71; + if (drawPlayer.direction == -1) + num71 = 0; + if (!drawPlayer.invis || drawPlayer.body != 21 && drawPlayer.body != 22) + { + drawData = new DrawData(drawPlayer.Male ? Main.armorBodyTexture[drawPlayer.body] : Main.femaleBodyTexture[drawPlayer.body], new Vector2((float) ((int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)) + num71), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(bodyFrame2), color12, drawPlayer.bodyRotation, origin2, 1f, spriteEffects, 0); + drawData.shader = num5; + Main.playerDrawData.Add(drawData); + if (index4 != -1) + { + drawData = new DrawData(Main.glowMaskTexture[index4], new Vector2((float) ((int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)) + num71), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(bodyFrame2), color16, drawPlayer.bodyRotation, origin2, 1f, spriteEffects, 0); + drawData.shader = num5; + Main.playerDrawData.Add(drawData); + } + } + if (flag1 && !drawPlayer.invis) + { + drawData = new DrawData(Main.playerTextures[skinVariant, 5], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.bodyRotation, origin2, 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + } + } + else if (!drawPlayer.invis) + { + if (!drawPlayer.Male) + { + drawData = new DrawData(Main.playerTextures[skinVariant, 4], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color8, drawPlayer.bodyRotation, origin2, 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + drawData = new DrawData(Main.playerTextures[skinVariant, 6], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color7, drawPlayer.bodyRotation, origin2, 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + } + else + { + drawData = new DrawData(Main.playerTextures[skinVariant, 4], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color8, drawPlayer.bodyRotation, origin2, 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + drawData = new DrawData(Main.playerTextures[skinVariant, 6], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color7, drawPlayer.bodyRotation, origin2, 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + } + drawData = new DrawData(Main.playerTextures[skinVariant, 5], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.bodyRotation, origin2, 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + } + if (drawPlayer.handoff > (sbyte) 0 && drawPlayer.handoff < (sbyte) 12) + { + drawData = new DrawData(Main.accHandsOffTexture[(int) drawPlayer.handoff], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color12, drawPlayer.bodyRotation, origin2, 1f, spriteEffects, 0); + drawData.shader = num8; + Main.playerDrawData.Add(drawData); + } + if (drawPlayer.waist > (sbyte) 0 && drawPlayer.waist < (sbyte) 13) + { + Microsoft.Xna.Framework.Rectangle legFrame = drawPlayer.legFrame; + if (legFrame.Y >= 1064) + legFrame.Y = 0; + drawData = new DrawData(Main.accWaistTexture[(int) drawPlayer.waist], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.legFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.legFrame.Height + 4.0)) + drawPlayer.legPosition + origin1, new Microsoft.Xna.Framework.Rectangle?(legFrame), color13, drawPlayer.legRotation, origin1, 1f, spriteEffects, 0); + drawData.shader = num12; + Main.playerDrawData.Add(drawData); + } + if (drawPlayer.neck > (sbyte) 0 && drawPlayer.neck < (sbyte) 10) + { + drawData = new DrawData(Main.accNeckTexture[(int) drawPlayer.neck], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color12, drawPlayer.bodyRotation, origin2, 1f, spriteEffects, 0); + drawData.shader = num14; + Main.playerDrawData.Add(drawData); + } + if (!drawPlayer.invis && drawPlayer.head != 38 && drawPlayer.head != 135) + { + drawData = new DrawData(Main.playerTextures[skinVariant, 0], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color4, drawPlayer.headRotation, origin3, 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + drawData = new DrawData(Main.playerTextures[skinVariant, 1], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color2, drawPlayer.headRotation, origin3, 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + drawData = new DrawData(Main.playerTextures[skinVariant, 2], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color3, drawPlayer.headRotation, origin3, 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + if (drawPlayer.yoraiz0rDarkness) + { + drawData = new DrawData(Main.extraTexture[67], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color4, drawPlayer.headRotation, origin3, 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + } + } + if (flag4) + { + drawData = new DrawData(Main.armorHeadTexture[drawPlayer.head], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color11, drawPlayer.headRotation, origin3, 1f, spriteEffects, 0); + drawData.shader = cHead; + Main.playerDrawData.Add(drawData); + if (!drawPlayer.invis) + { + drawData = new DrawData(Main.playerHairTexture[drawPlayer.hair], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3, new Microsoft.Xna.Framework.Rectangle?(bodyFrame1), color1, drawPlayer.headRotation, origin3, 1f, spriteEffects, 0); + drawData.shader = -num4; + Main.playerDrawData.Add(drawData); + } + } + if (flag5 && !drawPlayer.invis) + { + drawData = new DrawData(Main.playerHairAltTexture[drawPlayer.hair], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3, new Microsoft.Xna.Framework.Rectangle?(bodyFrame1), color1, drawPlayer.headRotation, origin3, 1f, spriteEffects, 0); + drawData.shader = -num4; + Main.playerDrawData.Add(drawData); + } + if (drawPlayer.head == 23) + { + if (!drawPlayer.invis) + { + drawData = new DrawData(Main.playerHairTexture[drawPlayer.hair], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3, new Microsoft.Xna.Framework.Rectangle?(bodyFrame1), color1, drawPlayer.headRotation, origin3, 1f, spriteEffects, 0); + drawData.shader = -num4; + Main.playerDrawData.Add(drawData); + } + drawData = new DrawData(Main.armorHeadTexture[drawPlayer.head], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color11, drawPlayer.headRotation, origin3, 1f, spriteEffects, 0); + drawData.shader = cHead; + Main.playerDrawData.Add(drawData); + } + else if (drawPlayer.head == 14 || drawPlayer.head == 56 || drawPlayer.head == 114 || drawPlayer.head == 158 || drawPlayer.head == 69 || drawPlayer.head == 180) + { + Microsoft.Xna.Framework.Rectangle bodyFrame3 = drawPlayer.bodyFrame; + Vector2 origin4 = origin3; + if ((double) drawPlayer.gravDir == 1.0) + { + if (bodyFrame3.Y != 0) + { + bodyFrame3.Y -= 2; + bodyFrame3.Height -= 8; + origin4.Y += 2f; + } + } + else if (bodyFrame3.Y != 0) + { + bodyFrame3.Y -= 2; + origin4.Y -= 10f; + bodyFrame3.Height -= 8; + } + drawData = new DrawData(Main.armorHeadTexture[drawPlayer.head], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3, new Microsoft.Xna.Framework.Rectangle?(bodyFrame3), color11, drawPlayer.headRotation, origin4, 1f, spriteEffects, 0); + drawData.shader = cHead; + Main.playerDrawData.Add(drawData); + } + else if (drawPlayer.head > 0 && drawPlayer.head < 216 && drawPlayer.head != 28) + { + if (!drawPlayer.invis || drawPlayer.head != 39 && drawPlayer.head != 38) + { + if (drawPlayer.head == 13) + { + int num72 = 0; + int index36 = 0; + if (drawPlayer.armor[index36] != null && drawPlayer.armor[index36].type == 205 && drawPlayer.armor[index36].stack > 0) + num72 += drawPlayer.armor[index36].stack; + int index37 = 10; + if (drawPlayer.armor[index37] != null && drawPlayer.armor[index37].type == 205 && drawPlayer.armor[index37].stack > 0) + num72 += drawPlayer.armor[index37].stack; + float num73 = (float) Math.PI / 60f; + float num74 = (float) ((double) num73 * (double) drawPlayer.position.X % 6.28318548202515); + for (int index38 = 0; index38 < num72; ++index38) + { + float num75 = (float) ((double) Vector2.UnitY.RotatedBy((double) num74 + (double) num73 * (double) index38).X * ((double) index38 / 30.0) * 2.0); + drawData = new DrawData(Main.armorHeadTexture[drawPlayer.head], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)) + num75, (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0 - (double) (4 * index38))) + drawPlayer.headPosition + origin3, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color11, drawPlayer.headRotation, origin3, 1f, spriteEffects, 0); + drawData.shader = cHead; + Main.playerDrawData.Add(drawData); + } + } + else + { + drawData = new DrawData(Main.armorHeadTexture[drawPlayer.head], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color11, drawPlayer.headRotation, origin3, 1f, spriteEffects, 0); + drawData.shader = cHead; + Main.playerDrawData.Add(drawData); + if (index3 != -1) + { + drawData = new DrawData(Main.glowMaskTexture[index3], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color15, drawPlayer.headRotation, origin3, 1f, spriteEffects, 0); + drawData.shader = cHead; + Main.playerDrawData.Add(drawData); + } + if (drawPlayer.head == 211) + { + Microsoft.Xna.Framework.Color color33 = new Microsoft.Xna.Framework.Color(100, 100, 100, 0); + ulong seed = (ulong) (drawPlayer.miscCounter / 4 + 100); + int num76 = 4; + for (int index39 = 0; index39 < num76; ++index39) + { + float x = (float) Utils.RandomInt(ref seed, -10, 11) * 0.2f; + float y = (float) Utils.RandomInt(ref seed, -14, 1) * 0.15f; + drawData = new DrawData(Main.glowMaskTexture[241], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3 + new Vector2(x, y), new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color33, drawPlayer.headRotation, origin3, 1f, spriteEffects, 0); + drawData.shader = cHead; + Main.playerDrawData.Add(drawData); + } + } + } + } + } + else if (!drawPlayer.invis && drawPlayer.face != (sbyte) 3 && drawPlayer.face != (sbyte) 2 && drawPlayer.face != (sbyte) 4) + { + drawData = new DrawData(Main.playerHairTexture[drawPlayer.hair], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3, new Microsoft.Xna.Framework.Rectangle?(bodyFrame1), color1, drawPlayer.headRotation, origin3, 1f, spriteEffects, 0); + drawData.shader = -num4; + Main.playerDrawData.Add(drawData); + } + if (drawPlayer.head == 205) + { + drawData = new DrawData(Main.extraTexture[77], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color4, drawPlayer.headRotation, origin3, 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + } + if (drawPlayer.head == 214 && !drawPlayer.invis) + { + Microsoft.Xna.Framework.Rectangle bodyFrame4 = drawPlayer.bodyFrame; + bodyFrame4.Y = 0; + float t = (float) drawPlayer.miscCounter / 300f; + Microsoft.Xna.Framework.Color color34 = new Microsoft.Xna.Framework.Color(0, 0, 0, 0); + float from = 0.8f; + float to = 0.9f; + if ((double) t >= (double) from) + color34 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, new Microsoft.Xna.Framework.Color(200, 200, 200, 0), Utils.InverseLerp(from, to, t, true)); + if ((double) t >= (double) to) + color34 = Microsoft.Xna.Framework.Color.Lerp(Microsoft.Xna.Framework.Color.Transparent, new Microsoft.Xna.Framework.Color(200, 200, 200, 0), Utils.InverseLerp(1f, to, t, true)); + color34 *= num44 * (1f - shadow); + drawData = new DrawData(Main.extraTexture[90], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3 - Main.OffsetsPlayerHeadgear[drawPlayer.bodyFrame.Y / drawPlayer.bodyFrame.Height], new Microsoft.Xna.Framework.Rectangle?(bodyFrame4), color34, drawPlayer.headRotation, origin3, 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + } + if (drawPlayer.head == 137) + { + drawData = new DrawData(Main.jackHatTexture, new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue), drawPlayer.headRotation, origin3, 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + for (int index40 = 0; index40 < 7; ++index40) + { + Microsoft.Xna.Framework.Color color35 = new Microsoft.Xna.Framework.Color(110 - index40 * 10, 110 - index40 * 10, 110 - index40 * 10, 110 - index40 * 10); + Vector2 vector2_15 = new Vector2((float) Main.rand.Next(-10, 11) * 0.2f, (float) Main.rand.Next(-10, 11) * 0.2f); + vector2_15.X = drawPlayer.itemFlamePos[index40].X; + vector2_15.Y = drawPlayer.itemFlamePos[index40].Y; + vector2_15 *= 0.5f; + drawData = new DrawData(Main.jackHatTexture, new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3 + vector2_15, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color35, drawPlayer.headRotation, origin3, 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + } + } + if (drawPlayer.face > (sbyte) 0 && drawPlayer.face < (sbyte) 9) + { + if (drawPlayer.face == (sbyte) 7) + { + drawData = new DrawData(Main.accFaceTexture[(int) drawPlayer.face], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), new Microsoft.Xna.Framework.Color(200, 200, 200, 150), drawPlayer.headRotation, origin3, 1f, spriteEffects, 0); + drawData.shader = num15; + Main.playerDrawData.Add(drawData); + } + else + { + drawData = new DrawData(Main.accFaceTexture[(int) drawPlayer.face], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color11, drawPlayer.headRotation, origin3, 1f, spriteEffects, 0); + drawData.shader = num15; + Main.playerDrawData.Add(drawData); + } + } + if (drawPlayer.mount.Active) + { + drawPlayer.mount.Draw(Main.playerDrawData, 2, drawPlayer, Position, drawColor, spriteEffects, shadow); + drawPlayer.mount.Draw(Main.playerDrawData, 3, drawPlayer, Position, drawColor, spriteEffects, shadow); + } + if (drawPlayer.pulley && drawPlayer.itemAnimation == 0) + { + if (drawPlayer.pulleyDir == (byte) 2) + { + int num77 = -25; + int num78 = 0; + float rotation1 = 0.0f; + drawData = new DrawData(Main.pulleyTexture, new Vector2((float) ((int) ((double) Position.X - (double) Main.screenPosition.X + (double) (drawPlayer.width / 2) - (double) (9 * drawPlayer.direction)) + num78 * drawPlayer.direction), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) (drawPlayer.height / 2) + 2.0 * (double) drawPlayer.gravDir + (double) num77 * (double) drawPlayer.gravDir)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, Main.pulleyTexture.Height / 2 * drawPlayer.pulleyFrame, Main.pulleyTexture.Width, Main.pulleyTexture.Height / 2)), color11, rotation1, new Vector2((float) (Main.pulleyTexture.Width / 2), (float) (Main.pulleyTexture.Height / 4)), 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + } + else + { + int num79 = -26; + int num80 = 10; + float rotation2 = 0.35f * (float) -drawPlayer.direction; + drawData = new DrawData(Main.pulleyTexture, new Vector2((float) ((int) ((double) Position.X - (double) Main.screenPosition.X + (double) (drawPlayer.width / 2) - (double) (9 * drawPlayer.direction)) + num80 * drawPlayer.direction), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) (drawPlayer.height / 2) + 2.0 * (double) drawPlayer.gravDir + (double) num79 * (double) drawPlayer.gravDir)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, Main.pulleyTexture.Height / 2 * drawPlayer.pulleyFrame, Main.pulleyTexture.Width, Main.pulleyTexture.Height / 2)), color11, rotation2, new Vector2((float) (Main.pulleyTexture.Width / 2), (float) (Main.pulleyTexture.Height / 4)), 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + } + } + if (drawPlayer.shield > (sbyte) 0 && drawPlayer.shield < (sbyte) 7) + { + Vector2 zero = Vector2.Zero; + if (drawPlayer.shieldRaised) + zero.Y -= 4f; + if (drawPlayer.shieldRaised) + { + float num81 = (float) Math.Sin((double) Main.GlobalTime * 6.28318548202515); + float x = (float) (2.5 + 1.5 * (double) num81); + Microsoft.Xna.Framework.Color color36 = color12; + color36.A = (byte) 0; + Microsoft.Xna.Framework.Color color37 = color36 * (float) (0.449999988079071 - (double) num81 * 0.150000005960464); + for (float num82 = 0.0f; (double) num82 < 4.0; ++num82) + { + drawData = new DrawData(Main.accShieldTexture[(int) drawPlayer.shield], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)) + zero + new Vector2(x, 0.0f).RotatedBy((double) num82 / 4.0 * 6.28318548202515), new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color37, drawPlayer.bodyRotation, origin2, 1f, spriteEffects, 0); + drawData.shader = num13; + Main.playerDrawData.Add(drawData); + } + } + drawData = new DrawData(Main.accShieldTexture[(int) drawPlayer.shield], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)) + zero, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color12, drawPlayer.bodyRotation, origin2, 1f, spriteEffects, 0); + drawData.shader = num13; + Main.playerDrawData.Add(drawData); + if (drawPlayer.shieldRaised) + { + Microsoft.Xna.Framework.Color color38 = color12; + float num83 = (float) Math.Sin((double) Main.GlobalTime * 3.14159274101257); + color38.A = (byte) ((double) color38.A * (0.5 + 0.5 * (double) num83)); + color38 *= (float) (0.5 + 0.5 * (double) num83); + drawData = new DrawData(Main.accShieldTexture[(int) drawPlayer.shield], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)) + zero, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color38, drawPlayer.bodyRotation, origin2, 1f, spriteEffects, 0); + drawData.shader = num13; + } + if (drawPlayer.shieldRaised && drawPlayer.shieldParryTimeLeft > 0) + { + float num84 = (float) drawPlayer.shieldParryTimeLeft / 20f; + float num85 = 1.5f * num84; + Vector2 vector2_16 = new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)) + zero; + Microsoft.Xna.Framework.Color color39 = color12; + float num86 = 1f; + Vector2 vector2_17 = Position + drawPlayer.Size / 2f - Main.screenPosition; + Vector2 vector2_18 = vector2_16 - vector2_17; + Vector2 position = vector2_16 + vector2_18 * num85; + float scale = num86 + num85; + color39.A = (byte) ((double) color39.A * (1.0 - (double) num84)); + Microsoft.Xna.Framework.Color color40 = color39 * (1f - num84); + drawData = new DrawData(Main.accShieldTexture[(int) drawPlayer.shield], position, new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color40, drawPlayer.bodyRotation, origin2, scale, spriteEffects, 0); + drawData.shader = num13; + Main.playerDrawData.Add(drawData); + } + if (drawPlayer.mount.Cart) + Main.playerDrawData.Reverse(Main.playerDrawData.Count - 2, 2); + } + Position.Y += (float) ((int) playerOffset / 2); + if (drawPlayer.solarShields > 0 && (double) shadow == 0.0 && !drawPlayer.dead) + { + Texture2D texture2D = Main.extraTexture[61 + drawPlayer.solarShields - 1]; + Microsoft.Xna.Framework.Color color41 = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue); + float rotation3 = (drawPlayer.solarShieldPos[0] * new Vector2(1f, 0.5f)).ToRotation(); + if (drawPlayer.direction == -1) + rotation3 += 3.141593f; + float rotation4 = rotation3 + 0.06283186f * (float) drawPlayer.direction; + drawData = new DrawData(texture2D, new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) (drawPlayer.height / 2))) + drawPlayer.solarShieldPos[0], new Microsoft.Xna.Framework.Rectangle?(), color41, rotation4, texture2D.Size() / 2f, 1f, spriteEffects, 0); + drawData.shader = num5; + Main.playerDrawData.Add(drawData); + } + Position.Y -= (float) ((int) playerOffset / 2); + if (drawPlayer.heldProj >= 0 && (double) shadow == 0.0 && !flag3) + projectileDrawPosition = Main.playerDrawData.Count; + Microsoft.Xna.Framework.Color currentColor = Lighting.GetColor((int) ((double) Position.X + (double) drawPlayer.width * 0.5) / 16, (int) (((double) Position.Y + (double) drawPlayer.height * 0.5) / 16.0)); + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 678) + currentColor = Microsoft.Xna.Framework.Color.White; + if (drawPlayer.shroomiteStealth && drawPlayer.inventory[drawPlayer.selectedItem].ranged) + { + float num87 = drawPlayer.stealth; + if ((double) num87 < 0.03) + num87 = 0.03f; + float num88 = (float) ((1.0 + (double) num87 * 10.0) / 11.0); + currentColor = new Microsoft.Xna.Framework.Color((int) (byte) ((double) currentColor.R * (double) num87), (int) (byte) ((double) currentColor.G * (double) num87), (int) (byte) ((double) currentColor.B * (double) num88), (int) (byte) ((double) currentColor.A * (double) num87)); + } + if (drawPlayer.setVortex && drawPlayer.inventory[drawPlayer.selectedItem].ranged) + { + float num89 = drawPlayer.stealth; + if ((double) num89 < 0.03) + num89 = 0.03f; + double num90 = (1.0 + (double) num89 * 10.0) / 11.0; + currentColor = currentColor.MultiplyRGBA(new Microsoft.Xna.Framework.Color(Vector4.Lerp(Vector4.One, new Vector4(0.0f, 0.12f, 0.16f, 0.0f), 1f - num89))); + } + if ((double) shadow == 0.0 && !drawPlayer.frozen && (drawPlayer.itemAnimation > 0 && drawPlayer.inventory[drawPlayer.selectedItem].useStyle != 0 || drawPlayer.inventory[drawPlayer.selectedItem].holdStyle > 0 && !drawPlayer.pulley) && drawPlayer.inventory[drawPlayer.selectedItem].type > 0 && !drawPlayer.dead && !drawPlayer.inventory[drawPlayer.selectedItem].noUseGraphic && (!drawPlayer.wet || !drawPlayer.inventory[drawPlayer.selectedItem].noWet)) + { + string name = drawPlayer.name; + Microsoft.Xna.Framework.Color color42 = new Microsoft.Xna.Framework.Color(250, 250, 250, drawPlayer.inventory[drawPlayer.selectedItem].alpha); + Vector2 vector2_19 = Vector2.Zero; + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 3823) + vector2_19 = new Vector2((float) (7 * drawPlayer.direction), -7f * drawPlayer.gravDir); + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 3827) + { + vector2_19 = new Vector2((float) (13 * drawPlayer.direction), -13f * drawPlayer.gravDir); + color42 = Microsoft.Xna.Framework.Color.Lerp(drawPlayer.inventory[drawPlayer.selectedItem].GetAlpha(currentColor), Microsoft.Xna.Framework.Color.White, 0.6f); + color42.A = (byte) 66; + } + ItemSlot.GetItemLight(ref currentColor, drawPlayer.inventory[drawPlayer.selectedItem]); + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 3476) + { + Texture2D texture2D = Main.extraTexture[64]; + Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: 9, frameY: (drawPlayer.miscCounter % 54 / 6)); + Vector2 vector2_20 = new Vector2((float) (r.Width / 2 * drawPlayer.direction), 0.0f); + Vector2 origin5 = r.Size() / 2f; + drawData = new DrawData(texture2D, (vector2_1 - Main.screenPosition + vector2_20).Floor(), new Microsoft.Xna.Framework.Rectangle?(r), drawPlayer.inventory[drawPlayer.selectedItem].GetAlpha(currentColor).MultiplyRGBA(new Microsoft.Xna.Framework.Color(new Vector4(0.5f, 0.5f, 0.5f, 0.8f))), drawPlayer.itemRotation, origin5, drawPlayer.inventory[drawPlayer.selectedItem].scale, effect, 0); + Main.playerDrawData.Add(drawData); + drawData = new DrawData(Main.glowMaskTexture[195], (vector2_1 - Main.screenPosition + vector2_20).Floor(), new Microsoft.Xna.Framework.Rectangle?(r), new Microsoft.Xna.Framework.Color(250, 250, 250, drawPlayer.inventory[drawPlayer.selectedItem].alpha) * 0.5f, drawPlayer.itemRotation, origin5, drawPlayer.inventory[drawPlayer.selectedItem].scale, effect, 0); + Main.playerDrawData.Add(drawData); + } + else if (drawPlayer.inventory[drawPlayer.selectedItem].type == 3779) + { + Texture2D texture2D = Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type]; + Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(); + Vector2 vector2_21 = new Vector2((float) (r.Width / 2 * drawPlayer.direction), 0.0f); + Vector2 origin6 = r.Size() / 2f; + Microsoft.Xna.Framework.Color color43 = new Microsoft.Xna.Framework.Color(120, 40, 222, 0) * (float) (((double) ((float) ((double) drawPlayer.miscCounter / 75.0 * 6.28318548202515)).ToRotationVector2().X * 1.0 + 0.0) / 2.0 * 0.300000011920929 + 0.850000023841858) * 0.5f; + float num91 = 2f; + for (float num92 = 0.0f; (double) num92 < 4.0; ++num92) + { + drawData = new DrawData(Main.glowMaskTexture[218], (vector2_1 - Main.screenPosition + vector2_21).Floor() + (num92 * 1.570796f).ToRotationVector2() * num91, new Microsoft.Xna.Framework.Rectangle?(r), color43, drawPlayer.itemRotation, origin6, drawPlayer.inventory[drawPlayer.selectedItem].scale, effect, 0); + Main.playerDrawData.Add(drawData); + } + drawData = new DrawData(texture2D, (vector2_1 - Main.screenPosition + vector2_21).Floor(), new Microsoft.Xna.Framework.Rectangle?(r), drawPlayer.inventory[drawPlayer.selectedItem].GetAlpha(currentColor).MultiplyRGBA(new Microsoft.Xna.Framework.Color(new Vector4(0.5f, 0.5f, 0.5f, 0.8f))), drawPlayer.itemRotation, origin6, drawPlayer.inventory[drawPlayer.selectedItem].scale, effect, 0); + Main.playerDrawData.Add(drawData); + } + else if (drawPlayer.inventory[drawPlayer.selectedItem].useStyle == 5) + { + if (Item.staff[drawPlayer.inventory[drawPlayer.selectedItem].type]) + { + float rotation5 = drawPlayer.itemRotation + 0.785f * (float) drawPlayer.direction; + int num93 = 0; + int num94 = 0; + Vector2 origin7 = new Vector2(0.0f, (float) Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height); + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 3210) + { + num93 = 8 * -drawPlayer.direction; + num94 = 2 * (int) drawPlayer.gravDir; + } + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 3870) + { + num93 = 12 * -drawPlayer.direction; + num94 = 12 * (int) drawPlayer.gravDir; + } + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 3787) + num94 = (int) ((double) (8 * (int) drawPlayer.gravDir) * Math.Cos((double) rotation5)); + if ((double) drawPlayer.gravDir == -1.0) + { + if (drawPlayer.direction == -1) + { + rotation5 += 1.57f; + origin7 = new Vector2((float) Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, 0.0f); + num93 -= Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width; + } + else + { + rotation5 -= 1.57f; + origin7 = Vector2.Zero; + } + } + else if (drawPlayer.direction == -1) + { + origin7 = new Vector2((float) Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, (float) Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height); + num93 -= Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width; + } + drawData = new DrawData(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type], new Vector2((float) (int) ((double) vector2_1.X - (double) Main.screenPosition.X + (double) origin7.X + (double) num93), (float) (int) ((double) vector2_1.Y - (double) Main.screenPosition.Y + (double) num94)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetAlpha(currentColor), rotation5, origin7, drawPlayer.inventory[drawPlayer.selectedItem].scale, effect, 0); + Main.playerDrawData.Add(drawData); + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 3870) + { + drawData = new DrawData(Main.glowMaskTexture[238], new Vector2((float) (int) ((double) vector2_1.X - (double) Main.screenPosition.X + (double) origin7.X + (double) num93), (float) (int) ((double) vector2_1.Y - (double) Main.screenPosition.Y + (double) num94)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) sbyte.MaxValue), rotation5, origin7, drawPlayer.inventory[drawPlayer.selectedItem].scale, effect, 0); + Main.playerDrawData.Add(drawData); + } + } + else + { + Vector2 vector2_22 = new Vector2((float) (Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width / 2), (float) (Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height / 2)); + Vector2 vector2_23 = this.DrawPlayerItemPos(drawPlayer.gravDir, drawPlayer.inventory[drawPlayer.selectedItem].type); + int x = (int) vector2_23.X; + vector2_22.Y = vector2_23.Y; + Vector2 origin8 = new Vector2((float) -x, (float) (Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height / 2)); + if (drawPlayer.direction == -1) + origin8 = new Vector2((float) (Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width + x), (float) (Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height / 2)); + drawData = new DrawData(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type], new Vector2((float) (int) ((double) vector2_1.X - (double) Main.screenPosition.X + (double) vector2_22.X), (float) (int) ((double) vector2_1.Y - (double) Main.screenPosition.Y + (double) vector2_22.Y)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetAlpha(currentColor), drawPlayer.itemRotation, origin8, drawPlayer.inventory[drawPlayer.selectedItem].scale, effect, 0); + Main.playerDrawData.Add(drawData); + if (drawPlayer.inventory[drawPlayer.selectedItem].color != new Microsoft.Xna.Framework.Color()) + { + drawData = new DrawData(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type], new Vector2((float) (int) ((double) vector2_1.X - (double) Main.screenPosition.X + (double) vector2_22.X), (float) (int) ((double) vector2_1.Y - (double) Main.screenPosition.Y + (double) vector2_22.Y)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetColor(currentColor), drawPlayer.itemRotation, origin8, drawPlayer.inventory[drawPlayer.selectedItem].scale, effect, 0); + Main.playerDrawData.Add(drawData); + } + if (drawPlayer.inventory[drawPlayer.selectedItem].glowMask != (short) -1) + { + drawData = new DrawData(Main.glowMaskTexture[(int) drawPlayer.inventory[drawPlayer.selectedItem].glowMask], new Vector2((float) (int) ((double) vector2_1.X - (double) Main.screenPosition.X + (double) vector2_22.X), (float) (int) ((double) vector2_1.Y - (double) Main.screenPosition.Y + (double) vector2_22.Y)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height)), new Microsoft.Xna.Framework.Color(250, 250, 250, drawPlayer.inventory[drawPlayer.selectedItem].alpha), drawPlayer.itemRotation, origin8, drawPlayer.inventory[drawPlayer.selectedItem].scale, effect, 0); + Main.playerDrawData.Add(drawData); + } + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 3788) + { + float num95 = (float) ((double) ((float) ((double) drawPlayer.miscCounter / 75.0 * 6.28318548202515)).ToRotationVector2().X * 1.0 + 0.0); + Microsoft.Xna.Framework.Color color44 = new Microsoft.Xna.Framework.Color(80, 40, 252, 0) * (float) ((double) num95 / 2.0 * 0.300000011920929 + 0.850000023841858) * 0.5f; + for (float num96 = 0.0f; (double) num96 < 4.0; ++num96) + { + drawData = new DrawData(Main.glowMaskTexture[220], new Vector2((float) (int) ((double) vector2_1.X - (double) Main.screenPosition.X + (double) vector2_22.X), (float) (int) ((double) vector2_1.Y - (double) Main.screenPosition.Y + (double) vector2_22.Y)) + (num96 * 1.570796f + drawPlayer.itemRotation).ToRotationVector2() * num95, new Microsoft.Xna.Framework.Rectangle?(), color44, drawPlayer.itemRotation, origin8, drawPlayer.inventory[drawPlayer.selectedItem].scale, effect, 0); + Main.playerDrawData.Add(drawData); + } + } + } + } + else if ((double) drawPlayer.gravDir == -1.0) + { + drawData = new DrawData(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type], new Vector2((float) (int) ((double) vector2_1.X - (double) Main.screenPosition.X), (float) (int) ((double) vector2_1.Y - (double) Main.screenPosition.Y)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetAlpha(currentColor), drawPlayer.itemRotation, new Vector2((float) ((double) Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width * 0.5 - (double) Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width * 0.5 * (double) drawPlayer.direction), 0.0f) + vector2_19, drawPlayer.inventory[drawPlayer.selectedItem].scale, effect, 0); + Main.playerDrawData.Add(drawData); + if (drawPlayer.inventory[drawPlayer.selectedItem].color != new Microsoft.Xna.Framework.Color()) + { + drawData = new DrawData(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type], new Vector2((float) (int) ((double) vector2_1.X - (double) Main.screenPosition.X), (float) (int) ((double) vector2_1.Y - (double) Main.screenPosition.Y)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetColor(currentColor), drawPlayer.itemRotation, new Vector2((float) ((double) Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width * 0.5 - (double) Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width * 0.5 * (double) drawPlayer.direction), 0.0f) + vector2_19, drawPlayer.inventory[drawPlayer.selectedItem].scale, effect, 0); + Main.playerDrawData.Add(drawData); + } + if (drawPlayer.inventory[drawPlayer.selectedItem].glowMask != (short) -1) + { + drawData = new DrawData(Main.glowMaskTexture[(int) drawPlayer.inventory[drawPlayer.selectedItem].glowMask], new Vector2((float) (int) ((double) vector2_1.X - (double) Main.screenPosition.X), (float) (int) ((double) vector2_1.Y - (double) Main.screenPosition.Y)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height)), new Microsoft.Xna.Framework.Color(250, 250, 250, drawPlayer.inventory[drawPlayer.selectedItem].alpha), drawPlayer.itemRotation, new Vector2((float) ((double) Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width * 0.5 - (double) Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width * 0.5 * (double) drawPlayer.direction), 0.0f) + vector2_19, drawPlayer.inventory[drawPlayer.selectedItem].scale, effect, 0); + Main.playerDrawData.Add(drawData); + } + } + else + { + if (drawPlayer.inventory[drawPlayer.selectedItem].type == 425 || drawPlayer.inventory[drawPlayer.selectedItem].type == 507) + effect = (double) drawPlayer.gravDir != 1.0 ? (drawPlayer.direction != 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None) : (drawPlayer.direction != 1 ? SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically : SpriteEffects.FlipVertically); + int type = drawPlayer.inventory[drawPlayer.selectedItem].type; + drawData = new DrawData(Main.itemTexture[type], new Vector2((float) (int) ((double) vector2_1.X - (double) Main.screenPosition.X), (float) (int) ((double) vector2_1.Y - (double) Main.screenPosition.Y)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[type].Width, Main.itemTexture[type].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetAlpha(currentColor), drawPlayer.itemRotation, new Vector2((float) ((double) Main.itemTexture[type].Width * 0.5 - (double) Main.itemTexture[type].Width * 0.5 * (double) drawPlayer.direction), (float) Main.itemTexture[type].Height) + vector2_19, drawPlayer.inventory[drawPlayer.selectedItem].scale, effect, 0); + Main.playerDrawData.Add(drawData); + if (drawPlayer.inventory[drawPlayer.selectedItem].color != new Microsoft.Xna.Framework.Color()) + { + drawData = new DrawData(Main.itemTexture[type], new Vector2((float) (int) ((double) vector2_1.X - (double) Main.screenPosition.X), (float) (int) ((double) vector2_1.Y - (double) Main.screenPosition.Y)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[type].Width, Main.itemTexture[type].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetColor(currentColor), drawPlayer.itemRotation, new Vector2((float) ((double) Main.itemTexture[type].Width * 0.5 - (double) Main.itemTexture[type].Width * 0.5 * (double) drawPlayer.direction), (float) Main.itemTexture[type].Height) + vector2_19, drawPlayer.inventory[drawPlayer.selectedItem].scale, effect, 0); + Main.playerDrawData.Add(drawData); + } + if (drawPlayer.inventory[drawPlayer.selectedItem].glowMask != (short) -1) + { + drawData = new DrawData(Main.glowMaskTexture[(int) drawPlayer.inventory[drawPlayer.selectedItem].glowMask], new Vector2((float) (int) ((double) vector2_1.X - (double) Main.screenPosition.X), (float) (int) ((double) vector2_1.Y - (double) Main.screenPosition.Y)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[type].Width, Main.itemTexture[type].Height)), color42, drawPlayer.itemRotation, new Vector2((float) ((double) Main.itemTexture[type].Width * 0.5 - (double) Main.itemTexture[type].Width * 0.5 * (double) drawPlayer.direction), (float) Main.itemTexture[type].Height) + vector2_19, drawPlayer.inventory[drawPlayer.selectedItem].scale, effect, 0); + Main.playerDrawData.Add(drawData); + } + if (drawPlayer.inventory[drawPlayer.selectedItem].flame) + { + if ((double) shadow == 0.0) + { + try + { + this.LoadItemFlames(type); + if (Main.itemFlameTexture[type] != null) + { + for (int index41 = 0; index41 < 7; ++index41) + { + Microsoft.Xna.Framework.Color color45 = new Microsoft.Xna.Framework.Color(100, 100, 100, 0); + if (type == 3045) + color45 = new Microsoft.Xna.Framework.Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, 0); + float x = drawPlayer.itemFlamePos[index41].X; + float y = drawPlayer.itemFlamePos[index41].Y; + drawData = new DrawData(Main.itemFlameTexture[type], new Vector2((float) (int) ((double) vector2_1.X - (double) Main.screenPosition.X) + x, (float) (int) ((double) vector2_1.Y - (double) Main.screenPosition.Y) + y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[type].Width, Main.itemTexture[type].Height)), color45, drawPlayer.itemRotation, new Vector2((float) ((double) Main.itemTexture[type].Width * 0.5 - (double) Main.itemTexture[type].Width * 0.5 * (double) drawPlayer.direction), (float) Main.itemTexture[type].Height) + vector2_19, drawPlayer.inventory[drawPlayer.selectedItem].scale, effect, 0); + Main.playerDrawData.Add(drawData); + } + } + } + catch + { + } + } + } + } + } + if (drawPlayer.body > 0 && drawPlayer.body < 210) + { + Microsoft.Xna.Framework.Rectangle bodyFrame5 = drawPlayer.bodyFrame; + int num97 = num3; + bodyFrame5.X += num97; + bodyFrame5.Width -= num97; + if (drawPlayer.direction == -1) + num97 = 0; + if (!drawPlayer.invis || drawPlayer.body != 21 && drawPlayer.body != 22) + { + if (flag1 && !drawPlayer.invis) + { + int body = drawPlayer.body; + if (flag2) + { + drawData = new DrawData(Main.playerTextures[skinVariant, 7], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.bodyRotation, origin2, 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + } + drawData = new DrawData(Main.playerTextures[skinVariant, 9], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.bodyRotation, origin2, 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + } + drawData = new DrawData(Main.armorArmTexture[drawPlayer.body], new Vector2((float) ((int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)) + num97), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(bodyFrame5), color12, drawPlayer.bodyRotation, origin2, 1f, spriteEffects, 0); + drawData.shader = num5; + Main.playerDrawData.Add(drawData); + if (index5 != -1) + { + drawData = new DrawData(Main.glowMaskTexture[index5], new Vector2((float) ((int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)) + num97), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(bodyFrame5), color17, drawPlayer.bodyRotation, origin2, 1f, spriteEffects, 0); + drawData.shader = num5; + Main.playerDrawData.Add(drawData); + } + if (drawPlayer.body == 205) + { + Microsoft.Xna.Framework.Color color46 = new Microsoft.Xna.Framework.Color(100, 100, 100, 0); + ulong seed = (ulong) (drawPlayer.miscCounter / 4); + int num98 = 4; + for (int index42 = 0; index42 < num98; ++index42) + { + float num99 = (float) Utils.RandomInt(ref seed, -10, 11) * 0.2f; + float num100 = (float) Utils.RandomInt(ref seed, -10, 1) * 0.15f; + drawData = new DrawData(Main.glowMaskTexture[240], new Vector2((float) ((int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)) + num97), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2) + num99, (float) (drawPlayer.bodyFrame.Height / 2) + num100), new Microsoft.Xna.Framework.Rectangle?(bodyFrame5), color46, drawPlayer.bodyRotation, origin2, 1f, spriteEffects, 0); + drawData.shader = num5; + Main.playerDrawData.Add(drawData); + } + } + } + } + else if (!drawPlayer.invis) + { + drawData = new DrawData(Main.playerTextures[skinVariant, 7], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.bodyRotation, origin2, 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + drawData = new DrawData(Main.playerTextures[skinVariant, 8], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color8, drawPlayer.bodyRotation, origin2, 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + drawData = new DrawData(Main.playerTextures[skinVariant, 13], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color7, drawPlayer.bodyRotation, origin2, 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + } + if (drawPlayer.handon > (sbyte) 0 && drawPlayer.handon < (sbyte) 20) + { + drawData = new DrawData(Main.accHandsOnTexture[(int) drawPlayer.handon], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color12, drawPlayer.bodyRotation, origin2, 1f, spriteEffects, 0); + drawData.shader = num7; + Main.playerDrawData.Add(drawData); + } + if (drawPlayer.inventory[drawPlayer.selectedItem].type > -1 && Item.claw[drawPlayer.inventory[drawPlayer.selectedItem].type] && (double) shadow == 0.0 && !drawPlayer.frozen && (drawPlayer.itemAnimation > 0 || drawPlayer.inventory[drawPlayer.selectedItem].holdStyle > 0 && !drawPlayer.pulley) && drawPlayer.inventory[drawPlayer.selectedItem].type > 0 && !drawPlayer.dead && !drawPlayer.inventory[drawPlayer.selectedItem].noUseGraphic && (!drawPlayer.wet || !drawPlayer.inventory[drawPlayer.selectedItem].noWet)) + { + if ((double) drawPlayer.gravDir == -1.0) + { + drawData = new DrawData(Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type], new Vector2((float) (int) ((double) vector2_1.X - (double) Main.screenPosition.X), (float) (int) ((double) vector2_1.Y - (double) Main.screenPosition.Y)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width, Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetAlpha(currentColor), drawPlayer.itemRotation, new Vector2((float) ((double) Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width * 0.5 - (double) Main.itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width * 0.5 * (double) drawPlayer.direction), 0.0f), drawPlayer.inventory[drawPlayer.selectedItem].scale, effect, 0); + Main.playerDrawData.Add(drawData); + } + else + { + int type = drawPlayer.inventory[drawPlayer.selectedItem].type; + drawData = new DrawData(Main.itemTexture[type], new Vector2((float) (int) ((double) vector2_1.X - (double) Main.screenPosition.X), (float) (int) ((double) vector2_1.Y - (double) Main.screenPosition.Y)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[type].Width, Main.itemTexture[type].Height)), drawPlayer.inventory[drawPlayer.selectedItem].GetAlpha(currentColor), drawPlayer.itemRotation, new Vector2((float) ((double) Main.itemTexture[type].Width * 0.5 - (double) Main.itemTexture[type].Width * 0.5 * (double) drawPlayer.direction), (float) Main.itemTexture[type].Height), drawPlayer.inventory[drawPlayer.selectedItem].scale, effect, 0); + Main.playerDrawData.Add(drawData); + } + } + if (((drawPlayer.heldProj < 0 ? 0 : ((double) shadow == 0.0 ? 1 : 0)) & (flag3 ? 1 : 0)) != 0) + projectileDrawPosition = Main.playerDrawData.Count; + Position.Y -= num2; + if (!flag8 && drawPlayer.front > (sbyte) 0 && drawPlayer.front < (sbyte) 5 && !drawPlayer.mount.Active) + { + drawData = new DrawData(Main.accFrontTexture[(int) drawPlayer.front], new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(drawPlayer.bodyFrame), color12, drawPlayer.bodyRotation, origin2, 1f, spriteEffects, 0); + drawData.shader = num10; + Main.playerDrawData.Add(drawData); + } + if (drawPlayer.frozen && (double) shadow == 0.0) + { + Microsoft.Xna.Framework.Color color47 = color12; + color47.R = (byte) ((double) color47.R * 0.55); + color47.G = (byte) ((double) color47.G * 0.55); + color47.B = (byte) ((double) color47.B * 0.55); + color47.A = (byte) ((double) color47.A * 0.55); + drawData = new DrawData(Main.frozenTexture, new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.frozenTexture.Width, Main.frozenTexture.Height)), color47, drawPlayer.bodyRotation, new Vector2((float) (Main.frozenTexture.Width / 2), (float) (Main.frozenTexture.Height / 2)), 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + } + else if (drawPlayer.webbed && (double) shadow == 0.0 && (double) drawPlayer.velocity.Y == 0.0) + { + Microsoft.Xna.Framework.Color color48 = color12 * 0.75f; + Texture2D texture2D = Main.extraTexture[31]; + int num101 = drawPlayer.height / 2; + drawData = new DrawData(texture2D, new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0 + (double) num101)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(), color48, drawPlayer.bodyRotation, texture2D.Size() / 2f, 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + } + if (drawPlayer.electrified && (double) shadow == 0.0) + { + Texture2D texture = Main.glowMaskTexture[25]; + int num102 = drawPlayer.miscCounter / 5; + for (int index43 = 0; index43 < 2; ++index43) + { + int num103 = num102 % 7; + if (num103 > 1 && num103 < 5) + { + drawData = new DrawData(texture, new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, num103 * texture.Height / 7, texture.Width, texture.Height / 7)), color14, drawPlayer.bodyRotation, new Vector2((float) (texture.Width / 2), (float) (texture.Height / 14)), 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + } + num102 = num103 + 3; + } + } + if (drawPlayer.iceBarrier && (double) shadow == 0.0) + { + int height = this.iceBarrierTexture.Height / 12; + Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; + drawData = new DrawData(this.iceBarrierTexture, new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X - (double) (drawPlayer.bodyFrame.Width / 2) + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - (double) drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, height * (int) drawPlayer.iceBarrierFrame, this.iceBarrierTexture.Width, height)), white, 0.0f, new Vector2((float) (Main.frozenTexture.Width / 2), (float) (Main.frozenTexture.Height / 2)), 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + } + if ((double) shadow == 0.0 && (byte) drawPlayer.ownedLargeGems > (byte) 0) + { + bool flag11 = false; + BitsByte ownedLargeGems = drawPlayer.ownedLargeGems; + float num104 = 0.0f; + for (int key = 0; key < 7; ++key) + { + if (ownedLargeGems[key]) + ++num104; + } + float num105 = (float) (1.0 - (double) num104 * 0.0599999986588955); + float num106 = (float) (((double) num104 - 1.0) * 4.0); + switch (num104) + { + case 2f: + num106 += 10f; + break; + case 3f: + num106 += 8f; + break; + case 4f: + num106 += 6f; + break; + case 5f: + num106 += 6f; + break; + case 6f: + num106 += 2f; + break; + case 7f: + num106 += 0.0f; + break; + } + float num107 = (float) ((double) drawPlayer.miscCounter / 300.0 * 6.28318548202515); + if ((double) num104 > 0.0) + { + float num108 = 6.283185f / num104; + float num109 = 0.0f; + Vector2 vector2_24 = new Vector2(1.3f, 0.65f); + if (!flag11) + vector2_24 = Vector2.One; + List drawDataList = new List(); + for (int key = 0; key < 7; ++key) + { + if (!ownedLargeGems[key]) + { + ++num109; + } + else + { + Vector2 rotationVector2 = (num107 + num108 * ((float) key - num109)).ToRotationVector2(); + float num110 = num105; + if (flag11) + num110 = MathHelper.Lerp(num105 * 0.7f, 1f, (float) ((double) rotationVector2.Y / 2.0 + 0.5)); + Texture2D texture2D = Main.gemTexture[key]; + drawData = new DrawData(texture2D, new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) drawPlayer.height - 80.0)) + rotationVector2 * vector2_24 * num106, new Microsoft.Xna.Framework.Rectangle?(), new Microsoft.Xna.Framework.Color(250, 250, 250, (int) Main.mouseTextColor / 2), 0.0f, texture2D.Size() / 2f, (float) ((double) Main.mouseTextColor / 1000.0 + 0.800000011920929) * num110, SpriteEffects.None, 0); + drawDataList.Add(drawData); + } + } + if (flag11) + drawDataList.Sort(new Comparison(DelegateMethods.CompareDrawSorterByYScale)); + Main.playerDrawData.AddRange((IEnumerable) drawDataList); + } + } + if ((drawPlayer.beetleOffense || drawPlayer.beetleDefense) && (double) shadow == 0.0) + { + for (int index44 = 0; index44 < drawPlayer.beetleOrbs; ++index44) + { + for (int index45 = 0; index45 < 5; ++index45) + { + Microsoft.Xna.Framework.Color color49 = color12; + float num111 = 0.5f - (float) index45 * 0.1f; + color49.R = (byte) ((double) color49.R * (double) num111); + color49.G = (byte) ((double) color49.G * (double) num111); + color49.B = (byte) ((double) color49.B * (double) num111); + color49.A = (byte) ((double) color49.A * (double) num111); + Vector2 vector2_25 = -drawPlayer.beetleVel[index44] * (float) index45; + drawData = new DrawData(Main.beetleTexture, new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) (drawPlayer.height / 2))) + drawPlayer.beetlePos[index44] + vector2_25, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, Main.beetleTexture.Height / 3 * drawPlayer.beetleFrame + 1, Main.beetleTexture.Width, Main.beetleTexture.Height / 3 - 2)), color49, 0.0f, new Vector2((float) (Main.beetleTexture.Width / 2), (float) (Main.beetleTexture.Height / 6)), 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + } + drawData = new DrawData(Main.beetleTexture, new Vector2((float) (int) ((double) Position.X - (double) Main.screenPosition.X + (double) (drawPlayer.width / 2)), (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) (drawPlayer.height / 2))) + drawPlayer.beetlePos[index44], new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, Main.beetleTexture.Height / 3 * drawPlayer.beetleFrame + 1, Main.beetleTexture.Width, Main.beetleTexture.Height / 3 - 2)), color12, 0.0f, new Vector2((float) (Main.beetleTexture.Width / 2), (float) (Main.beetleTexture.Height / 6)), 1f, spriteEffects, 0); + Main.playerDrawData.Add(drawData); + } + } + if ((double) rotation != 0.0) + { + Vector2 vector2_26 = Position - Main.screenPosition + rotationOrigin; + Vector2 vector2_27 = drawPlayer.position + rotationOrigin; + Matrix rotationZ = Matrix.CreateRotationZ(rotation); + for (int index46 = 0; index46 < Main.playerDrawDust.Count; ++index46) + { + Vector2 vector2_28 = Vector2.Transform(Main.dust[Main.playerDrawDust[index46]].position - vector2_27, rotationZ); + Main.dust[Main.playerDrawDust[index46]].position = vector2_28 + vector2_27; + } + for (int index47 = 0; index47 < Main.playerDrawGore.Count; ++index47) + { + Vector2 vector2_29 = Vector2.Transform(Main.gore[Main.playerDrawGore[index47]].position - vector2_27, rotationZ); + Main.gore[Main.playerDrawGore[index47]].position = vector2_29 + vector2_27; + } + for (int index48 = 0; index48 < Main.playerDrawData.Count; ++index48) + { + drawData = Main.playerDrawData[index48]; + if (!drawData.ignorePlayerRotation) + { + Vector2 vector2_30 = Vector2.Transform(drawData.position - vector2_26, rotationZ); + drawData.position = vector2_30 + vector2_26; + drawData.rotation += rotation; + Main.playerDrawData[index48] = drawData; + } + } + } + this.DrawPlayer_DrawAllLayers(drawPlayer, projectileDrawPosition, cHead); + Main.pixelShader.CurrentTechnique.Passes[0].Apply(); + if (!drawPlayer.mount.Active || drawPlayer.mount.Type != 11) + return; + for (int i2 = 0; i2 < 1000; ++i2) + { + if (Main.projectile[i2].active && Main.projectile[i2].owner == drawPlayer.whoAmI && Main.projectile[i2].type == 591) + Main.instance.DrawProj(i2); + } } - private void DrawItem_AnimateSlot( - int slot, - int gameFramesPerSpriteFrame, - int spriteFramesAmount) + private void DrawPlayer_DrawAllLayers(Player drawPlayer, int projectileDrawPosition, int cHead) { - if (++Main.itemFrameCounter[slot] < gameFramesPerSpriteFrame * spriteFramesAmount) - return; - Main.itemFrameCounter[slot] = 0; + int num = -1; + for (int index = 0; index <= Main.playerDrawData.Count; ++index) + { + if (projectileDrawPosition == index) + { + if (num != 0) + { + Main.pixelShader.CurrentTechnique.Passes[0].Apply(); + num = 0; + } + Main.projectile[drawPlayer.heldProj].gfxOffY = drawPlayer.gfxOffY; + try + { + this.DrawProj(drawPlayer.heldProj); + } + catch + { + Main.projectile[drawPlayer.heldProj].active = false; + } + } + if (index != Main.playerDrawData.Count) + { + DrawData drawData = Main.playerDrawData[index]; + if (!drawData.sourceRect.HasValue) + drawData.sourceRect = new Microsoft.Xna.Framework.Rectangle?(drawData.texture.Frame()); + if (drawData.shader >= 0) + { + GameShaders.Hair.Apply((short) 0, drawPlayer, new DrawData?(drawData)); + GameShaders.Armor.Apply(drawData.shader, (Entity) drawPlayer, new DrawData?(drawData)); + } + else if (drawPlayer.head == 0) + { + GameShaders.Hair.Apply((short) 0, drawPlayer, new DrawData?(drawData)); + GameShaders.Armor.Apply(cHead, (Entity) drawPlayer, new DrawData?(drawData)); + } + else + { + GameShaders.Armor.Apply(0, (Entity) drawPlayer, new DrawData?(drawData)); + GameShaders.Hair.Apply((short) -drawData.shader, drawPlayer, new DrawData?(drawData)); + } + num = drawData.shader; + if (drawData.texture != null) + drawData.Draw(Main.spriteBatch); + } + } } protected void DrawItem(Item item, int whoami) { - if (!item.active || item.IsAir) - return; - Main.instance.LoadItem(item.type); - Texture2D texture; - Microsoft.Xna.Framework.Rectangle frame; - this.DrawItem_GetBasics(item, whoami, out texture, out frame); - Vector2 origin = frame.Size() / 2f; - Vector2 vector2 = new Vector2((float) (item.width / 2) - origin.X, (float) (item.height - frame.Height)); - Vector2 position = item.position - Main.screenPosition + origin + vector2; + int num1 = (int) ((double) item.position.X + (double) item.width * 0.5) / 16; + int firstTileX = this.firstTileX; + int offScreenTiles1 = Lighting.offScreenTiles; + int num2 = (int) ((double) item.position.Y + (double) item.height * 0.5) / 16; + int firstTileY = this.firstTileY; + int offScreenTiles2 = Lighting.offScreenTiles; + Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) ((double) item.position.X + (double) item.width * 0.5) / 16, (int) ((double) item.position.Y + (double) item.height * 0.5) / 16); + if (!Main.gamePaused && this.IsActive && item.type >= 71 && item.type <= 74 && (double) Math.Abs(item.velocity.X) + (double) Math.Abs(item.velocity.Y) > 0.2) + { + float num3 = (float) Main.rand.Next(500) - (float) (((double) Math.Abs(item.velocity.X) + (double) Math.Abs(item.velocity.Y)) * 20.0) - (float) ((item.type - 72) * 20); + int Type = 244 + item.type - 71; + if (item.isBeingGrabbed) + num3 /= 100f; + if ((double) num3 < (double) ((int) color.R / 70 + 1)) + { + int index = Dust.NewDust(item.position - new Vector2(1f, 2f), item.width, item.height, Type, Alpha: 254, Scale: 0.25f); + Main.dust[index].velocity *= 0.0f; + } + } float rotation = item.velocity.X * 0.2f; float scale = 1f; - Microsoft.Xna.Framework.Color color = Lighting.GetColor(item.Center.ToTileCoordinates()); - Microsoft.Xna.Framework.Color currentColor = item.GetAlpha(color); - ItemSlot.GetItemLight(ref currentColor, ref scale, item); - int index1 = (int) item.glowMask; - if (!Main.gamePaused && this.IsActive && (item.type >= 71 && item.type <= 74 || item.type == 58 || item.type == 109) && color.R > (byte) 60 && (double) Main.rand.Next(500) - ((double) Math.Abs(item.velocity.X) + (double) Math.Abs(item.velocity.Y)) * 10.0 < (double) ((int) color.R / 50)) + Microsoft.Xna.Framework.Color alpha = item.GetAlpha(color); + ItemSlot.GetItemLight(ref alpha, ref scale, item); + float num4 = (float) (item.height - Main.itemTexture[item.type].Height); + float num5 = (float) (item.width / 2 - Main.itemTexture[item.type].Width / 2); + if (item.type >= 71 && item.type <= 74) { - int index2 = Dust.NewDust(item.position, item.width, item.height, 43, Alpha: 254, newColor: Microsoft.Xna.Framework.Color.White, Scale: 0.5f); - Main.dust[index2].velocity *= 0.0f; + int index = item.type - 71; + ++Main.itemFrameCounter[whoami]; + if (Main.itemFrameCounter[whoami] > 5) + { + Main.itemFrameCounter[whoami] = 0; + ++Main.itemFrame[whoami]; + } + if (Main.itemFrame[whoami] > 7) + Main.itemFrame[whoami] = 0; + int width = Main.coinTexture[index].Width; + int height = Main.coinTexture[index].Height / 8; + float num6 = (float) (item.width / 2 - Main.coinTexture[index].Width / 2); + Main.spriteBatch.Draw(Main.coinTexture[index], new Vector2(item.position.X - Main.screenPosition.X + (float) (width / 2) + num6, item.position.Y - Main.screenPosition.Y + (float) (height / 2) + num4), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, Main.itemFrame[whoami] * height + 1, Main.itemTexture[item.type].Width, height)), alpha, rotation, new Vector2((float) (width / 2), (float) (height / 2)), scale, SpriteEffects.None, 0.0f); } - if (item.type >= 3318 && item.type <= 3332 || item.type == 3860 || item.type == 3862 || item.type == 3861 || item.type == 4782 || item.type == 4957) + else if (ItemID.Sets.NebulaPickup[item.type]) { - float num1 = (float) ((double) item.timeSinceItemSpawned / 240.0 + (double) Main.GlobalTimeWrappedHourly * 0.0399999991059303); - float num2 = Main.GlobalTimeWrappedHourly % 4f / 2f; - if ((double) num2 >= 1.0) - num2 = 2f - num2; - float num3 = (float) ((double) num2 * 0.5 + 0.5); - for (float num4 = 0.0f; (double) num4 < 1.0; num4 += 0.25f) - Main.spriteBatch.Draw(texture, position + new Vector2(0.0f, 8f).RotatedBy(((double) num4 + (double) num1) * 6.28318548202515) * num3, new Microsoft.Xna.Framework.Rectangle?(frame), new Microsoft.Xna.Framework.Color(90, 70, (int) byte.MaxValue, 50), rotation, origin, scale, SpriteEffects.None, 0.0f); - for (float num5 = 0.0f; (double) num5 < 1.0; num5 += 0.34f) - Main.spriteBatch.Draw(texture, position + new Vector2(0.0f, 4f).RotatedBy(((double) num5 + (double) num1) * 6.28318548202515) * num3, new Microsoft.Xna.Framework.Rectangle?(frame), new Microsoft.Xna.Framework.Color(140, 120, (int) byte.MaxValue, 77), rotation, origin, scale, SpriteEffects.None, 0.0f); + ++Main.itemFrameCounter[whoami]; + if (Main.itemFrameCounter[whoami] > 5) + { + Main.itemFrameCounter[whoami] = 0; + ++Main.itemFrame[whoami]; + } + if (Main.itemFrame[whoami] >= 4) + Main.itemFrame[whoami] = 0; + Microsoft.Xna.Framework.Rectangle r = Main.itemTexture[item.type].Frame(verticalFrames: 4, frameY: Main.itemFrame[whoami]); + float num7 = (float) (item.width / 2 - r.Width / 2); + float num8 = (float) (item.height - r.Height); + Main.spriteBatch.Draw(Main.itemTexture[item.type], new Vector2(item.position.X - Main.screenPosition.X + (float) (r.Width / 2) + num7, item.position.Y - Main.screenPosition.Y + (float) (r.Height / 2) + num8), new Microsoft.Xna.Framework.Rectangle?(r), alpha, rotation, r.Size() / 2f, scale, SpriteEffects.None, 0.0f); } - else if (item.type == 75) + else if (ItemID.Sets.AnimatesAsSoul[item.type]) { - float num6 = (float) ((double) item.timeSinceItemSpawned / 240.0 + (double) Main.GlobalTimeWrappedHourly * 0.0399999991059303); - float num7 = Main.GlobalTimeWrappedHourly % 5f / 2.5f; - if ((double) num7 >= 1.0) - num7 = 2f - num7; - float num8 = (float) ((double) num7 * 0.5 + 0.5); - for (float num9 = 0.0f; (double) num9 < 1.0; num9 += 0.25f) - Main.spriteBatch.Draw(TextureAssets.Item[item.type].Value, position + new Vector2(0.0f, 8f).RotatedBy(((double) num9 + (double) num6) * 6.28318548202515) * num8, new Microsoft.Xna.Framework.Rectangle?(frame), new Microsoft.Xna.Framework.Color(50, 50, (int) byte.MaxValue, 50), rotation, origin, scale, SpriteEffects.None, 0.0f); - for (float num10 = 0.0f; (double) num10 < 1.0; num10 += 0.34f) - Main.spriteBatch.Draw(TextureAssets.Item[item.type].Value, position + new Vector2(0.0f, 4f).RotatedBy(((double) num10 + (double) num6) * 6.28318548202515) * num8, new Microsoft.Xna.Framework.Rectangle?(frame), new Microsoft.Xna.Framework.Color(120, 120, (int) byte.MaxValue, (int) sbyte.MaxValue), rotation, origin, scale, SpriteEffects.None, 0.0f); + ++Main.itemFrameCounter[whoami]; + if (Main.itemFrameCounter[whoami] > 5) + { + Main.itemFrameCounter[whoami] = 0; + ++Main.itemFrame[whoami]; + } + if (Main.itemFrame[whoami] >= 4) + Main.itemFrame[whoami] = 0; + Microsoft.Xna.Framework.Rectangle r = Main.itemTexture[item.type].Frame(verticalFrames: 4, frameY: Main.itemFrame[whoami]); + float num9 = (float) (item.width / 2 - r.Width / 2); + float num10 = (float) (item.height - r.Height); + Main.spriteBatch.Draw(Main.itemTexture[item.type], new Vector2(item.position.X - Main.screenPosition.X + (float) (r.Width / 2) + num9, item.position.Y - Main.screenPosition.Y + (float) (r.Height / 2) + num10), new Microsoft.Xna.Framework.Rectangle?(r), alpha, rotation, r.Size() / 2f, scale, SpriteEffects.None, 0.0f); } - else if (item.type == 4143) + else if (item.type == 3858) { - float num11 = (float) ((double) item.timeSinceItemSpawned / 240.0 + (double) Main.GlobalTimeWrappedHourly * 0.0399999991059303); - float num12 = Main.GlobalTimeWrappedHourly % 5f / 2.5f; - if ((double) num12 >= 1.0) - num12 = 2f - num12; - float num13 = (float) ((double) num12 * 0.5 + 0.5); - for (float num14 = 0.0f; (double) num14 < 1.0; num14 += 0.34f) - Main.spriteBatch.Draw(TextureAssets.Item[item.type].Value, position + new Vector2(0.0f, 8f).RotatedBy(((double) num14 + (double) num11) * 6.28318548202515) * num13, new Microsoft.Xna.Framework.Rectangle?(frame), new Microsoft.Xna.Framework.Color(30, 30, 155, 60), rotation, origin, scale, SpriteEffects.None, 0.0f); - for (float num15 = 0.0f; (double) num15 < 1.0; num15 += 0.34f) - Main.spriteBatch.Draw(TextureAssets.Item[item.type].Value, position + new Vector2(0.0f, 4f).RotatedBy(((double) num15 + (double) num11) * 6.28318548202515) * num13, new Microsoft.Xna.Framework.Rectangle?(frame), new Microsoft.Xna.Framework.Color(60, 60, (int) sbyte.MaxValue, 57), rotation, origin, scale, SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(texture, position, new Microsoft.Xna.Framework.Rectangle?(frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 128), rotation, origin, scale, SpriteEffects.None, 0.0f); + ++Main.itemFrameCounter[whoami]; + if (Main.itemFrameCounter[whoami] >= 5) + { + Main.itemFrameCounter[whoami] = 0; + ++Main.itemFrame[whoami]; + } + if (Main.itemFrame[whoami] >= 3) + Main.itemFrame[whoami] = 0; + Texture2D texture2D = Main.glowMaskTexture[233]; + Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: 3, frameY: Main.itemFrame[whoami]); + float num11 = (float) (item.width / 2 - r.Width / 2); + float num12 = (float) (item.height - r.Height); + Main.spriteBatch.Draw(Main.itemTexture[item.type], new Vector2(item.position.X - Main.screenPosition.X + (float) (r.Width / 2) + num11, item.position.Y - Main.screenPosition.Y + (float) (r.Height / 2) + num12), new Microsoft.Xna.Framework.Rectangle?(), alpha, rotation, r.Size() / 2f, scale, SpriteEffects.None, 0.0f); + float num13 = num11 - 2f; + float num14 = num12 - 2f; + Main.spriteBatch.Draw(texture2D, new Vector2(item.position.X - Main.screenPosition.X + (float) (r.Width / 2) + num13, item.position.Y - Main.screenPosition.Y + (float) (r.Height / 2) + num14), new Microsoft.Xna.Framework.Rectangle?(r), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 63) * 0.75f, rotation, r.Size() / 2f, scale, SpriteEffects.None, 0.0f); } - if (item.type >= 1522 && item.type <= 1527 || item.type == 3643) + else if (ItemID.Sets.TrapSigned[item.type]) { - currentColor = new Microsoft.Xna.Framework.Color(250, 250, 250, (int) Main.mouseTextColor / 2); - scale = (float) ((double) Main.mouseTextColor / 1000.0 + 0.800000011920929); + Main.spriteBatch.Draw(Main.itemTexture[item.type], new Vector2(item.position.X - Main.screenPosition.X + (float) (Main.itemTexture[item.type].Width / 2) + num5, (float) ((double) item.position.Y - (double) Main.screenPosition.Y + (double) (Main.itemTexture[item.type].Height / 2) + (double) num4 + 2.0)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[item.type].Width, Main.itemTexture[item.type].Height)), alpha, rotation, new Vector2((float) (Main.itemTexture[item.type].Width / 2), (float) (Main.itemTexture[item.type].Height / 2)), scale, SpriteEffects.None, 0.0f); + if (item.color != new Microsoft.Xna.Framework.Color()) + Main.spriteBatch.Draw(Main.itemTexture[item.type], new Vector2(item.position.X - Main.screenPosition.X + (float) (Main.itemTexture[item.type].Width / 2) + num5, (float) ((double) item.position.Y - (double) Main.screenPosition.Y + (double) (Main.itemTexture[item.type].Height / 2) + (double) num4 + 2.0)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[item.type].Width, Main.itemTexture[item.type].Height)), item.GetColor(color), rotation, new Vector2((float) (Main.itemTexture[item.type].Width / 2), (float) (Main.itemTexture[item.type].Height / 2)), scale, SpriteEffects.None, 0.0f); + if (item.glowMask != (short) -1) + Main.spriteBatch.Draw(Main.glowMaskTexture[(int) item.glowMask], new Vector2(item.position.X - Main.screenPosition.X + (float) (Main.itemTexture[item.type].Width / 2) + num5, (float) ((double) item.position.Y - (double) Main.screenPosition.Y + (double) (Main.itemTexture[item.type].Height / 2) + (double) num4 + 2.0)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[item.type].Width, Main.itemTexture[item.type].Height)), new Microsoft.Xna.Framework.Color(250, 250, 250, item.alpha), rotation, new Vector2((float) (Main.itemTexture[item.type].Width / 2), (float) (Main.itemTexture[item.type].Height / 2)), scale, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.wireTexture, new Vector2(item.position.X - Main.screenPosition.X + (float) (Main.itemTexture[item.type].Width / 2) + num5, (float) ((double) item.position.Y - (double) Main.screenPosition.Y + (double) (Main.itemTexture[item.type].Height / 2) + (double) num4 + 2.0)) + Main.itemTexture[item.type].Size().RotatedBy((double) rotation) * 0.45f * item.scale, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(4, 58, 8, 8)), alpha, 0.0f, new Vector2(4f), 1f, SpriteEffects.None, 0.0f); + } + else if (item.type >= 1522 && item.type <= 1527 || item.type == 3643) + Main.spriteBatch.Draw(Main.itemTexture[item.type], new Vector2(item.position.X - Main.screenPosition.X + (float) (Main.itemTexture[item.type].Width / 2) + num5, (float) ((double) item.position.Y - (double) Main.screenPosition.Y + (double) (Main.itemTexture[item.type].Height / 2) + (double) num4 + 2.0)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[item.type].Width, Main.itemTexture[item.type].Height)), new Microsoft.Xna.Framework.Color(250, 250, 250, (int) Main.mouseTextColor / 2), rotation, new Vector2((float) (Main.itemTexture[item.type].Width / 2), (float) (Main.itemTexture[item.type].Height / 2)), (float) ((double) Main.mouseTextColor / 1000.0 + 0.800000011920929), SpriteEffects.None, 0.0f); + else if (item.type == 3779) + { + Main.spriteBatch.Draw(Main.itemTexture[item.type], new Vector2(item.position.X - Main.screenPosition.X + (float) (Main.itemTexture[item.type].Width / 2) + num5, (float) ((double) item.position.Y - (double) Main.screenPosition.Y + (double) (Main.itemTexture[item.type].Height / 2) + (double) num4 + 2.0)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[item.type].Width, Main.itemTexture[item.type].Height)), alpha, rotation, new Vector2((float) (Main.itemTexture[item.type].Width / 2), (float) (Main.itemTexture[item.type].Height / 2)), scale, SpriteEffects.None, 0.0f); + } + else + { + Main.spriteBatch.Draw(Main.itemTexture[item.type], new Vector2(item.position.X - Main.screenPosition.X + (float) (Main.itemTexture[item.type].Width / 2) + num5, (float) ((double) item.position.Y - (double) Main.screenPosition.Y + (double) (Main.itemTexture[item.type].Height / 2) + (double) num4 + 2.0)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[item.type].Width, Main.itemTexture[item.type].Height)), alpha, rotation, new Vector2((float) (Main.itemTexture[item.type].Width / 2), (float) (Main.itemTexture[item.type].Height / 2)), scale, SpriteEffects.None, 0.0f); + if (item.color != new Microsoft.Xna.Framework.Color()) + Main.spriteBatch.Draw(Main.itemTexture[item.type], new Vector2(item.position.X - Main.screenPosition.X + (float) (Main.itemTexture[item.type].Width / 2) + num5, (float) ((double) item.position.Y - (double) Main.screenPosition.Y + (double) (Main.itemTexture[item.type].Height / 2) + (double) num4 + 2.0)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[item.type].Width, Main.itemTexture[item.type].Height)), item.GetColor(color), rotation, new Vector2((float) (Main.itemTexture[item.type].Width / 2), (float) (Main.itemTexture[item.type].Height / 2)), scale, SpriteEffects.None, 0.0f); + if (item.glowMask == (short) -1) + return; + Main.spriteBatch.Draw(Main.glowMaskTexture[(int) item.glowMask], new Vector2(item.position.X - Main.screenPosition.X + (float) (Main.itemTexture[item.type].Width / 2) + num5, (float) ((double) item.position.Y - (double) Main.screenPosition.Y + (double) (Main.itemTexture[item.type].Height / 2) + (double) num4 + 2.0)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[item.type].Width, Main.itemTexture[item.type].Height)), new Microsoft.Xna.Framework.Color(250, 250, 250, item.alpha), rotation, new Vector2((float) (Main.itemTexture[item.type].Width / 2), (float) (Main.itemTexture[item.type].Height / 2)), scale, SpriteEffects.None, 0.0f); } - if (item.type == 3779) - index1 = -1; - Main.spriteBatch.Draw(texture, position, new Microsoft.Xna.Framework.Rectangle?(frame), currentColor, rotation, origin, scale, SpriteEffects.None, 0.0f); - if (item.color != Microsoft.Xna.Framework.Color.Transparent) - Main.spriteBatch.Draw(texture, position, new Microsoft.Xna.Framework.Rectangle?(frame), item.GetColor(color), rotation, origin, scale, SpriteEffects.None, 0.0f); - if (index1 != -1) - Main.spriteBatch.Draw(TextureAssets.GlowMask[index1].Value, position, new Microsoft.Xna.Framework.Rectangle?(frame), new Microsoft.Xna.Framework.Color(250, 250, 250, item.alpha), rotation, origin, scale, SpriteEffects.None, 0.0f); - if (ItemID.Sets.TrapSigned[item.type]) - Main.spriteBatch.Draw(TextureAssets.Wire.Value, position + frame.Size().RotatedBy((double) rotation) * 0.45f * item.scale, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(4, 58, 8, 8)), currentColor, 0.0f, new Vector2(4f), 1f, SpriteEffects.None, 0.0f); - if (item.type != 3858) - return; - Main.spriteBatch.Draw(TextureAssets.GlowMask[233].Value, position, new Microsoft.Xna.Framework.Rectangle?(frame), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 63) * 0.75f, rotation, frame.Size() / 2f, scale, SpriteEffects.None, 0.0f); - } - - public void DrawItems() - { - for (int whoami = 0; whoami < 400; ++whoami) - this.DrawItem(Main.item[whoami], whoami); } protected void DrawRain() { - bool flag = this.IsActive || Main.netMode == 1; - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, 0, 2, 40); - Texture2D texture = TextureAssets.Rain.Value; - Vector2 zero = Vector2.Zero; + bool isActive = this.IsActive; + Microsoft.Xna.Framework.Rectangle[] rectangleArray = new Microsoft.Xna.Framework.Rectangle[6]; + for (int index = 0; index < rectangleArray.Length; ++index) + rectangleArray[index] = new Microsoft.Xna.Framework.Rectangle(index * 4, 0, 2, 40); for (int index = 0; index < Main.maxRain; ++index) { - Rain rain = Main.rain[index]; - if (rain.active) + if (Main.rain[index].active) { - rectangle.X = (int) rain.type * 4; - Main.spriteBatch.Draw(texture, rain.position - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(rectangle), Lighting.GetColor((int) ((double) rain.position.X + 4.0) >> 4, (int) ((double) rain.position.Y + 4.0) >> 4) * 0.85f, rain.rotation, zero, rain.scale, SpriteEffects.None, 0.0f); - if (flag) + Rain rain = Main.rain[index]; + Main.spriteBatch.Draw(Main.rainTexture, rain.position - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(rectangleArray[(int) rain.type]), Lighting.GetColor((int) ((double) rain.position.X + 4.0) >> 4, (int) ((double) rain.position.Y + 4.0) >> 4) * 0.85f, rain.rotation, Vector2.Zero, rain.scale, SpriteEffects.None, 0.0f); + if (isActive) rain.Update(); } } @@ -26837,7 +27872,7 @@ label_56: Dust dust = Main.dust[index1]; if (dust.active) { - if (dust.type >= 130 && dust.type <= 134 || dust.type >= 219 && dust.type <= 223 || dust.type == 226 || dust.type == 278) + if (dust.type >= 130 && dust.type <= 134 || dust.type >= 219 && dust.type <= 223 || dust.type == 226) rectangle1 = rectangle2; if (new Microsoft.Xna.Framework.Rectangle((int) dust.position.X, (int) dust.position.Y, 4, 4).Intersects(rectangle1)) { @@ -26868,23 +27903,7 @@ label_56: float scale2 = dust.scale * (float) (1.0 - (double) index2 / 10.0); Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) ((double) dust.position.X + 4.0) / 16, (int) ((double) dust.position.Y + 4.0) / 16); Microsoft.Xna.Framework.Color alpha = dust.GetAlpha(color); - Main.spriteBatch.Draw(TextureAssets.Dust.Value, vector2 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(dust.frame), alpha, dust.rotation, new Vector2(4f, 4f), scale2, SpriteEffects.None, 0.0f); - } - } - else if (dust.type == 278) - { - float num = (Math.Abs(dust.velocity.X) + Math.Abs(dust.velocity.Y)) * 0.3f * 10f; - if ((double) num > 10.0) - num = 10f; - Vector2 origin = new Vector2(4f, 4f); - for (int index3 = 0; (double) index3 < (double) num; ++index3) - { - Vector2 velocity = dust.velocity; - Vector2 vector2 = dust.position - velocity * (float) index3; - float scale3 = dust.scale * (float) (1.0 - (double) index3 / 10.0); - Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) ((double) dust.position.X + 4.0) / 16, (int) ((double) dust.position.Y + 4.0) / 16); - Microsoft.Xna.Framework.Color alpha = dust.GetAlpha(color); - Main.spriteBatch.Draw(TextureAssets.Dust.Value, vector2 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(dust.frame), alpha, dust.rotation, origin, scale3, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.dustTexture, vector2 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(dust.frame), alpha, dust.rotation, new Vector2(4f, 4f), scale2, SpriteEffects.None, 0.0f); } } else if (dust.type >= 219 && dust.type <= 223 && (double) dust.fadeIn == 0.0) @@ -26892,14 +27911,14 @@ label_56: float num = (Math.Abs(dust.velocity.X) + Math.Abs(dust.velocity.Y)) * 0.3f * 10f; if ((double) num > 10.0) num = 10f; - for (int index4 = 0; (double) index4 < (double) num; ++index4) + for (int index3 = 0; (double) index3 < (double) num; ++index3) { Vector2 velocity = dust.velocity; - Vector2 vector2 = dust.position - velocity * (float) index4; - float scale4 = dust.scale * (float) (1.0 - (double) index4 / 10.0); + Vector2 vector2 = dust.position - velocity * (float) index3; + float scale3 = dust.scale * (float) (1.0 - (double) index3 / 10.0); Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) ((double) dust.position.X + 4.0) / 16, (int) ((double) dust.position.Y + 4.0) / 16); Microsoft.Xna.Framework.Color alpha = dust.GetAlpha(color); - Main.spriteBatch.Draw(TextureAssets.Dust.Value, vector2 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(dust.frame), alpha, dust.rotation, new Vector2(4f, 4f), scale4, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.dustTexture, vector2 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(dust.frame), alpha, dust.rotation, new Vector2(4f, 4f), scale3, SpriteEffects.None, 0.0f); } } else if (dust.type == 264 && (double) dust.fadeIn == 0.0) @@ -26907,16 +27926,16 @@ label_56: float num = (Math.Abs(dust.velocity.X) + Math.Abs(dust.velocity.Y)) * 10f; if ((double) num > 10.0) num = 10f; - for (int index5 = 0; (double) index5 < (double) num; ++index5) + for (int index4 = 0; (double) index4 < (double) num; ++index4) { Vector2 velocity = dust.velocity; - Vector2 vector2 = dust.position - velocity * (float) index5; - float scale5 = dust.scale * (float) (1.0 - (double) index5 / 10.0); + Vector2 vector2 = dust.position - velocity * (float) index4; + float scale4 = dust.scale * (float) (1.0 - (double) index4 / 10.0); Microsoft.Xna.Framework.Color color1 = Lighting.GetColor((int) ((double) dust.position.X + 4.0) / 16, (int) ((double) dust.position.Y + 4.0) / 16); Microsoft.Xna.Framework.Color color2 = dust.GetAlpha(color1) * 0.3f; - Main.spriteBatch.Draw(TextureAssets.Dust.Value, vector2 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(dust.frame), color2, dust.rotation, new Vector2(5f), scale5, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.dustTexture, vector2 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(dust.frame), color2, dust.rotation, new Vector2(5f), scale4, SpriteEffects.None, 0.0f); Microsoft.Xna.Framework.Color color3 = dust.GetColor(color2); - Main.spriteBatch.Draw(TextureAssets.Dust.Value, vector2 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(dust.frame), color3, dust.rotation, new Vector2(5f), scale5, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.dustTexture, vector2 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(dust.frame), color3, dust.rotation, new Vector2(5f), scale4, SpriteEffects.None, 0.0f); } } else if ((dust.type == 226 || dust.type == 272) && (double) dust.fadeIn == 0.0) @@ -26924,29 +27943,25 @@ label_56: float num = (Math.Abs(dust.velocity.X) + Math.Abs(dust.velocity.Y)) * 0.3f * 10f; if ((double) num > 10.0) num = 10f; - for (int index6 = 0; (double) index6 < (double) num; ++index6) + for (int index5 = 0; (double) index5 < (double) num; ++index5) { Vector2 velocity = dust.velocity; - Vector2 vector2 = dust.position - velocity * (float) index6; - float scale6 = dust.scale * (float) (1.0 - (double) index6 / 10.0); + Vector2 vector2 = dust.position - velocity * (float) index5; + float scale5 = dust.scale * (float) (1.0 - (double) index5 / 10.0); Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) ((double) dust.position.X + 4.0) / 16, (int) ((double) dust.position.Y + 4.0) / 16); Microsoft.Xna.Framework.Color alpha = dust.GetAlpha(color); - Main.spriteBatch.Draw(TextureAssets.Dust.Value, vector2 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(dust.frame), alpha, dust.rotation, new Vector2(4f, 4f), scale6, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.dustTexture, vector2 - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(dust.frame), alpha, dust.rotation, new Vector2(4f, 4f), scale5, SpriteEffects.None, 0.0f); } } Microsoft.Xna.Framework.Color newColor = Lighting.GetColor((int) ((double) dust.position.X + 4.0) / 16, (int) ((double) dust.position.Y + 4.0) / 16); - if (dust.type == 6 || dust.type == 15 || dust.type >= 59 && dust.type <= 64) + if (dust.type == 6 || dust.type == 15 || dust.noLight && dust.type < 86 && dust.type > 91 || dust.type >= 59 && dust.type <= 64) newColor = Microsoft.Xna.Framework.Color.White; Microsoft.Xna.Framework.Color alpha1 = dust.GetAlpha(newColor); if (dust.type == 213) scale1 = 1f; - Main.spriteBatch.Draw(TextureAssets.Dust.Value, dust.position - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(dust.frame), alpha1, dust.rotation, new Vector2(4f, 4f), scale1, SpriteEffects.None, 0.0f); - if (dust.color.PackedValue != 0U) - { - Microsoft.Xna.Framework.Color color = dust.GetColor(alpha1); - if (color.PackedValue != 0U) - Main.spriteBatch.Draw(TextureAssets.Dust.Value, dust.position - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(dust.frame), color, dust.rotation, new Vector2(4f, 4f), scale1, SpriteEffects.None, 0.0f); - } + Main.spriteBatch.Draw(Main.dustTexture, dust.position - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(dust.frame), alpha1, dust.rotation, new Vector2(4f, 4f), scale1, SpriteEffects.None, 0.0f); + if (dust.color != new Microsoft.Xna.Framework.Color()) + Main.spriteBatch.Draw(Main.dustTexture, dust.position - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(dust.frame), dust.GetColor(alpha1), dust.rotation, new Vector2(4f, 4f), scale1, SpriteEffects.None, 0.0f); if (alpha1 == Microsoft.Xna.Framework.Color.Black) dust.active = false; } @@ -26965,7 +27980,7 @@ label_56: if (Main.player[Main.myPlayer].statLifeMax > 100) flag1 = true; bool flag2 = false; - if (Main.player[Main.myPlayer].statManaMax > 20) + if (Main.player[Main.myPlayer].statManaMax > 0) flag2 = true; bool flag3 = true; bool flag4 = false; @@ -26974,10 +27989,6 @@ label_56: bool flag7 = false; bool flag8 = false; bool flag9 = false; - bool flag10 = false; - bool flag11 = false; - bool flag12 = false; - bool flag13 = false; for (int index = 0; index < 58; ++index) { if (Main.player[Main.myPlayer].inventory[index].pick > 0 && Main.player[Main.myPlayer].inventory[index].Name != "Copper Pickaxe") @@ -26986,109 +27997,50 @@ label_56: flag3 = false; if (Main.player[Main.myPlayer].inventory[index].hammer > 0) flag3 = false; - if (Main.player[Main.myPlayer].inventory[index].type == 11 || Main.player[Main.myPlayer].inventory[index].type == 12 || Main.player[Main.myPlayer].inventory[index].type == 13 || Main.player[Main.myPlayer].inventory[index].type == 14 || Main.player[Main.myPlayer].inventory[index].type == 699 || Main.player[Main.myPlayer].inventory[index].type == 700 || Main.player[Main.myPlayer].inventory[index].type == 701 || Main.player[Main.myPlayer].inventory[index].type == 702) + if (Main.player[Main.myPlayer].inventory[index].type == 11 || Main.player[Main.myPlayer].inventory[index].type == 12 || Main.player[Main.myPlayer].inventory[index].type == 13 || Main.player[Main.myPlayer].inventory[index].type == 14) flag4 = true; - if (Main.player[Main.myPlayer].inventory[index].type == 19 || Main.player[Main.myPlayer].inventory[index].type == 20 || Main.player[Main.myPlayer].inventory[index].type == 21 || Main.player[Main.myPlayer].inventory[index].type == 22 || Main.player[Main.myPlayer].inventory[index].type == 703 || Main.player[Main.myPlayer].inventory[index].type == 704 || Main.player[Main.myPlayer].inventory[index].type == 705 || Main.player[Main.myPlayer].inventory[index].type == 706) + if (Main.player[Main.myPlayer].inventory[index].type == 19 || Main.player[Main.myPlayer].inventory[index].type == 20 || Main.player[Main.myPlayer].inventory[index].type == 21 || Main.player[Main.myPlayer].inventory[index].type == 22) flag5 = true; if (Main.player[Main.myPlayer].inventory[index].type == 75) flag6 = true; if (Main.player[Main.myPlayer].inventory[index].type == 38) flag7 = true; - if (Main.player[Main.myPlayer].inventory[index].type == 68 || Main.player[Main.myPlayer].inventory[index].type == 70 || Main.player[Main.myPlayer].inventory[index].type == 1330 || Main.player[Main.myPlayer].inventory[index].type == 1331 || Main.player[Main.myPlayer].inventory[index].type == 67 || Main.player[Main.myPlayer].inventory[index].type == 2886) + if (Main.player[Main.myPlayer].inventory[index].type == 68 || Main.player[Main.myPlayer].inventory[index].type == 70 || Main.player[Main.myPlayer].inventory[index].type == 1330) flag8 = true; - if (Main.player[Main.myPlayer].inventory[index].type == 84 || Main.player[Main.myPlayer].inventory[index].type == 1236 || Main.player[Main.myPlayer].inventory[index].type == 1237 || Main.player[Main.myPlayer].inventory[index].type == 1238 || Main.player[Main.myPlayer].inventory[index].type == 1239 || Main.player[Main.myPlayer].inventory[index].type == 1240 || Main.player[Main.myPlayer].inventory[index].type == 1241 || Main.player[Main.myPlayer].inventory[index].type == 939 || Main.player[Main.myPlayer].inventory[index].type == 1273 || Main.player[Main.myPlayer].inventory[index].type == 2585 || Main.player[Main.myPlayer].inventory[index].type == 2360 || Main.player[Main.myPlayer].inventory[index].type == 185 || Main.player[Main.myPlayer].inventory[index].type == 1800 || Main.player[Main.myPlayer].inventory[index].type == 1915) + if (Main.player[Main.myPlayer].inventory[index].type == 84) flag9 = true; - if (Main.player[Main.myPlayer].inventory[index].type == 3347) - flag10 = true; - if (Main.player[Main.myPlayer].inventory[index].type == 174) - flag11 = true; - if (Main.player[Main.myPlayer].inventory[index].type == 1141) - flag12 = true; - if (Main.player[Main.myPlayer].inventory[index].type == 1533 || Main.player[Main.myPlayer].inventory[index].type == 1534 || Main.player[Main.myPlayer].inventory[index].type == 1535 || Main.player[Main.myPlayer].inventory[index].type == 1536 || Main.player[Main.myPlayer].inventory[index].type == 1537 || Main.player[Main.myPlayer].inventory[index].type == 4714) - flag13 = true; } + bool flag10 = false; + bool flag11 = false; + bool flag12 = false; + bool flag13 = false; bool flag14 = false; bool flag15 = false; bool flag16 = false; bool flag17 = false; bool flag18 = false; - bool flag19 = false; - bool flag20 = false; - bool flag21 = false; - bool flag22 = false; - bool flag23 = false; - bool flag24 = false; - bool flag25 = false; - bool flag26 = false; - bool flag27 = false; - bool flag28 = false; - bool flag29 = false; - bool flag30 = false; - bool flag31 = false; - bool flag32 = false; - bool flag33 = false; - bool flag34 = false; - bool flag35 = false; - bool flag36 = false; - bool flag37 = false; - bool flag38 = false; - int num = 0; for (int index = 0; index < 200; ++index) { if (Main.npc[index].active) { - if (Main.npc[index].townNPC && Main.npc[index].type != 37) - ++num; if (Main.npc[index].type == 17) - flag14 = true; + flag10 = true; if (Main.npc[index].type == 18) - flag15 = true; + flag11 = true; if (Main.npc[index].type == 19) - flag17 = true; + flag13 = true; if (Main.npc[index].type == 20) - flag16 = true; + flag12 = true; if (Main.npc[index].type == 54) - flag22 = true; - if (Main.npc[index].type == 124) - flag19 = true; - if (Main.npc[index].type == 38) flag18 = true; + if (Main.npc[index].type == 124) + flag15 = true; + if (Main.npc[index].type == 38) + flag14 = true; if (Main.npc[index].type == 108) - flag20 = true; + flag16 = true; if (Main.npc[index].type == 107) - flag21 = true; - if (Main.npc[index].type == 228) - flag23 = true; - if (Main.npc[index].type == 178) - flag24 = true; - if (Main.npc[index].type == 209) - flag25 = true; - if (Main.npc[index].type == 353) - flag26 = true; - if (Main.npc[index].type == 633) - flag38 = true; - if (Main.npc[index].type == 369) - flag27 = true; - if (Main.npc[index].type == 441) - flag28 = true; - if (Main.npc[index].type == 229) - flag29 = true; - if (Main.npc[index].type == 207) - flag30 = true; - if (Main.npc[index].type == 160) - flag31 = true; - if (Main.npc[index].type == 588) - flag32 = true; - if (Main.npc[index].type == 227) - flag33 = true; - if (Main.npc[index].type == 208) - flag34 = true; - if (Main.npc[index].type == 550) - flag35 = true; - if (Main.npc[index].type == 368) - flag36 = true; - if (Main.npc[index].type == 453) - flag37 = true; + flag17 = true; } } object substitutionObject = Lang.CreateDialogSubstitutionObject(); @@ -27176,7 +28128,7 @@ label_56: Main.npcChatText = Lang.dialog(190); return; } - if (!flag14 && !flag15) + if (!flag10 && !flag11) { switch (Main.helpText) { @@ -27194,231 +28146,71 @@ label_56: return; } } - if (!flag14 && Main.helpText == 61) + if (!flag10 && Main.helpText == 61) { Main.npcChatText = Lang.dialog(195); return; } - if (!flag15 && Main.helpText == 62) + if (!flag11 && Main.helpText == 62) { Main.npcChatText = Lang.dialog(196); return; } - if (!flag17 && Main.helpText == 63) + if (!flag13 && Main.helpText == 63) { Main.npcChatText = Lang.dialog(197); return; } - if (!flag16 && Main.helpText == 64) + if (!flag12 && Main.helpText == 64) { Main.npcChatText = Lang.dialog(198); return; } - if (!flag19 && Main.helpText == 65 && NPC.downedBoss3) + if (!flag15 && Main.helpText == 65 && NPC.downedBoss3) { Main.npcChatText = Lang.dialog(199); return; } - if (!flag22 && Main.helpText == 66 && NPC.downedBoss3) + if (!flag18 && Main.helpText == 66 && NPC.downedBoss3) { Main.npcChatText = Lang.dialog(200); return; } - if (!flag18 && Main.helpText == 67) + if (!flag14 && Main.helpText == 67) { Main.npcChatText = Lang.dialog(201); return; } - if (!flag21 && NPC.downedBoss2 && Main.helpText == 68) + if (!flag17 && NPC.downedBoss2 && Main.helpText == 68) { Main.npcChatText = Lang.dialog(202); return; } - if (!flag20 && Main.hardMode && Main.helpText == 69) + if (!flag16 && Main.hardMode && Main.helpText == 69) { Main.npcChatText = Lang.dialog(203); return; } - if (!flag23 && Main.helpText == 70 && NPC.downedBoss2) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1100"); - return; - } - if (!flag24 && Main.helpText == 71 && Main.hardMode) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1101"); - return; - } - if (!flag25 && Main.helpText == 72 && NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1102"); - return; - } - if (!flag26 && Main.helpText == 73) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1103"); - return; - } - if (!flag27 && Main.helpText == 74) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1104"); - return; - } - if (!flag28 && Main.helpText == 75 && Main.hardMode) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1105"); - return; - } - if (!flag29 && Main.helpText == 76 && Main.hardMode) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1106"); - return; - } - if (!flag30 && Main.helpText == 77) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1107"); - return; - } - if (!flag31 && Main.helpText == 78 && Main.hardMode) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1108"); - return; - } - if (!flag32 && Main.helpText == 79) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1109"); - return; - } - if (!flag33 && Main.helpText == 80 && num >= 5) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1110"); - return; - } - if (!flag34 && Main.helpText == 81 && num >= 11) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1111"); - return; - } - if (!flag35 && NPC.downedBoss2 && Main.helpText == 82) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1112"); - return; - } - if (((flag36 ? 0 : (Main.helpText == 83 ? 1 : 0)) & (flag14 ? 1 : 0)) != 0) - { - Main.npcChatText = Language.GetTextValueWith("GuideHelpTextSpecific.Help_1113", substitutionObject); - return; - } - if (!flag37 && Main.helpText == 84 && !Main.hardMode) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1114"); - return; - } - if (!flag38 && Main.helpText == 85 && !Main.hardMode) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1115"); - return; - } - if (flag7 && !WorldGen.crimson && Main.helpText == 100) + if (flag7 && Main.helpText == 71) { Main.npcChatText = Lang.dialog(204); return; } - if (flag8 && Main.helpText == 101) + if (flag8 && Main.helpText == 72) { Main.npcChatText = Lang.dialog(WorldGen.crimson ? 403 : 205); return; } - if (flag7 | flag8 && Main.helpText == 102) + if (flag7 | flag8 && Main.helpText == 80) { Main.npcChatText = Lang.dialog(WorldGen.crimson ? 402 : 206); return; } - if (flag7 && WorldGen.crimson && Main.helpText == 103) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1159"); - return; - } - if (!flag9 && Main.LocalPlayer.miscEquips[4].IsAir && Main.helpText == 201 && !Main.hardMode && !NPC.downedBoss3 && !NPC.downedBoss2) + if (!flag9 && Main.helpText == 201 && !Main.hardMode && !NPC.downedBoss3 && !NPC.downedBoss2) { Main.npcChatText = Lang.dialog(207); return; } - if (Main.helpText == 202 && !Main.hardMode && Main.player[Main.myPlayer].statLifeMax >= 140) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1120"); - return; - } - if (Main.helpText == 203 && Main.hardMode && NPC.downedMechBossAny) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1121"); - return; - } - if (Main.helpText == 204 && !NPC.downedGoblins && Main.player[Main.myPlayer].statLifeMax >= 200 && WorldGen.shadowOrbSmashed) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1122"); - return; - } - if (Main.helpText == 205 && Main.hardMode && !NPC.downedPirates && Main.player[Main.myPlayer].statLifeMax >= 200) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1123"); - return; - } - if (Main.helpText == 206 && Main.hardMode && NPC.downedGolemBoss && !NPC.downedMartians) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1124"); - return; - } - if (Main.helpText == 207 && (NPC.downedBoss1 || NPC.downedBoss2 || NPC.downedBoss3)) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1125"); - return; - } - if (Main.helpText == 208 && !Main.hardMode) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1130"); - return; - } - if (Main.helpText == 209 && !Main.hardMode) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1131"); - return; - } - if (Main.helpText == 210 && !Main.hardMode) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1132"); - return; - } - if (Main.helpText == 211 && !Main.hardMode) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1133"); - return; - } - if (Main.helpText == 212 && !Main.hardMode) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1134"); - return; - } - if (Main.helpText == 213 && !Main.hardMode) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1135"); - return; - } - if (Main.helpText == 214 && !Main.hardMode && flag4 | flag5) - { - Main.npcChatText = Language.GetTextValueWith("GuideHelpTextSpecific.Help_1136", substitutionObject); - return; - } - if (Main.helpText == 215 && Main.LocalPlayer.anglerQuestsFinished < 1) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1137"); - return; - } - if (Main.helpText == 216 && !Main.hardMode) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1138"); - return; - } if (Main.helpText == 1000 && !NPC.downedBoss1 && !NPC.downedBoss2) { Main.npcChatText = Lang.dialog(208); @@ -27451,7 +28243,7 @@ label_56: } if (Main.helpText == 1052 && !NPC.downedBoss1 && Main.player[Main.myPlayer].statLifeMax >= 200 && Main.player[Main.myPlayer].statDefense > 10) { - Main.npcChatText = Lang.dialog(WorldGen.crimson ? 404 : 213); + Main.npcChatText = Lang.dialog(213); return; } if (Main.helpText == 1053 && NPC.downedBoss1 && !NPC.downedBoss2 && Main.player[Main.myPlayer].statLifeMax < 300) @@ -27459,12 +28251,12 @@ label_56: Main.npcChatText = Lang.dialog(214); return; } - if (Main.helpText == 1054 && NPC.downedBoss1 && !NPC.downedBoss2 && !WorldGen.crimson && Main.player[Main.myPlayer].statLifeMax >= 300) + if (Main.helpText == 1054 && NPC.downedBoss1 && !NPC.downedBoss2 && Main.player[Main.myPlayer].statLifeMax >= 300) { Main.npcChatText = Lang.dialog(215); return; } - if (Main.helpText == 1055 && NPC.downedBoss1 && !NPC.downedBoss2 && !WorldGen.crimson && Main.player[Main.myPlayer].statLifeMax >= 300) + if (Main.helpText == 1055 && NPC.downedBoss1 && !NPC.downedBoss2 && Main.player[Main.myPlayer].statLifeMax >= 300) { Main.npcChatText = Lang.dialog(216); return; @@ -27494,113 +28286,18 @@ label_56: Main.npcChatText = Lang.dialog(221); return; } - if (Main.helpText == 1061 && Main.hardMode && !NPC.downedPlantBoss) + if (Main.helpText == 1061 && Main.hardMode) { Main.npcChatText = Lang.dialog(WorldGen.crimson ? 401 : 222); return; } - if (Main.helpText == 1062 && Main.hardMode && !NPC.downedPlantBoss) + if (Main.helpText == 1062 && Main.hardMode) { Main.npcChatText = Lang.dialog(223); return; } - if (Main.helpText == 1140 && NPC.downedBoss1 && !NPC.downedBoss2 && WorldGen.crimson && Main.player[Main.myPlayer].statLifeMax >= 300) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1140"); - return; - } - if (Main.helpText == 1141 && NPC.downedBoss1 && !NPC.downedBoss2 && WorldGen.crimson && Main.player[Main.myPlayer].statLifeMax >= 300) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1141"); - return; - } - if (Main.helpText == 1142 && NPC.downedBoss2 && !Main.hardMode) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1142"); - return; - } - if (Main.helpText == 1143 && NPC.downedBoss2 && !NPC.downedQueenBee && Main.player[Main.myPlayer].statLifeMax >= 300) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1143"); - return; - } - if (Main.helpText == 1144 & flag10) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1144"); - return; - } - if (Main.helpText == 1145 & flag11 && !Main.hardMode) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1145"); - return; - } - if (Main.helpText == 1146 && Main.hardMode && Main.player[Main.myPlayer].wingsLogic == 0 && !Main.LocalPlayer.mount.Active && !NPC.downedPlantBoss) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1146"); - return; - } - if (Main.helpText == 1147 && Main.hardMode && WorldGen.SavedOreTiers.Adamantite == 111 && !NPC.downedMechBossAny) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1147"); - return; - } - if (Main.helpText == 1148 && Main.hardMode && WorldGen.SavedOreTiers.Adamantite == 223 && !NPC.downedMechBossAny) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1148"); - return; - } - if (Main.helpText == 1149 && Main.hardMode && NPC.downedMechBossAny && Main.player[Main.myPlayer].statLifeMax < 500) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1149"); - return; - } - if (Main.helpText == 1150 && Main.hardMode && NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3 && !NPC.downedPlantBoss) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1150"); - return; - } - if (((Main.helpText != 1151 || !Main.hardMode || !NPC.downedPlantBoss ? 0 : (!NPC.downedGolemBoss ? 1 : 0)) & (flag12 ? 1 : 0)) != 0) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1151"); - return; - } - if (Main.helpText == 1152 && Main.hardMode && NPC.downedPlantBoss && !NPC.downedGolemBoss && !flag12) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1152"); - return; - } - if (((Main.helpText != 1153 ? 0 : (Main.hardMode ? 1 : 0)) & (flag13 ? 1 : 0)) != 0) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1153"); - return; - } - if (Main.helpText == 1154 && Main.hardMode && !NPC.downedFishron) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1154"); - return; - } - if (Main.helpText == 1155 && Main.hardMode && NPC.downedGolemBoss && !NPC.downedHalloweenTree && !NPC.downedHalloweenKing) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1155"); - return; - } - if (Main.helpText == 1156 && Main.hardMode && NPC.downedGolemBoss && !NPC.downedChristmasIceQueen && !NPC.downedChristmasTree && !NPC.downedChristmasSantank) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1156"); - return; - } - if (Main.helpText == 1157 && Main.hardMode && NPC.downedGolemBoss && NPC.AnyNPCs(437) && !NPC.downedMoonlord) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1157"); - return; - } - if (Main.helpText == 1158 && Main.hardMode && NPC.LunarApocalypseIsUp && !NPC.downedMoonlord) - { - Main.npcChatText = Language.GetTextValue("GuideHelpTextSpecific.Help_1158"); - return; - } } - while (Main.helpText <= 1200); + while (Main.helpText <= 1100); Main.helpText = 0; } } @@ -27613,14 +28310,27 @@ label_56: } else { + if (Main.netMode == 0 && Main.autoPause && Main.player[Main.myPlayer].talkNPC >= 0) + { + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 105) + Main.npc[Main.player[Main.myPlayer].talkNPC].Transform(107); + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 106) + Main.npc[Main.player[Main.myPlayer].talkNPC].Transform(108); + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 123) + Main.npc[Main.player[Main.myPlayer].talkNPC].Transform(124); + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 354) + Main.npc[Main.player[Main.myPlayer].talkNPC].Transform(353); + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 376) + Main.npc[Main.player[Main.myPlayer].talkNPC].Transform(369); + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 579) + Main.npc[Main.player[Main.myPlayer].talkNPC].Transform(550); + } Microsoft.Xna.Framework.Color color1 = new Microsoft.Xna.Framework.Color(200, 200, 200, 200); int num1 = ((int) Main.mouseTextColor * 2 + (int) byte.MaxValue) / 3; Microsoft.Xna.Framework.Color color2 = new Microsoft.Xna.Framework.Color(num1, num1, num1, num1); - bool flag1 = Main.InGameUI.CurrentState is UIVirtualKeyboard && PlayerInput.UsingGamepad; - this._textDisplayCache.PrepareCache(Main.npcChatText); - string[] textLines = this._textDisplayCache.TextLines; - int amountOfLines = this._textDisplayCache.AmountOfLines; - bool flag2 = false; + bool flag = Main.InGameUI.CurrentState is UIVirtualKeyboard && PlayerInput.UsingGamepad; + int lineAmount; + string[] strArray = Utils.WordwrapString(Main.npcChatText, Main.fontMouseText, 460, 10, out lineAmount); if (Main.editSign) { ++this.textBlinkerCount; @@ -27630,36 +28340,32 @@ label_56: this.textBlinkerCount = 0; } if (this.textBlinkerState == 1) - flag2 = true; + { + // ISSUE: explicit reference operation + ^ref strArray[lineAmount] += "|"; + } Main.instance.DrawWindowsIMEPanel(new Vector2((float) (Main.screenWidth / 2), 90f), 0.5f); } - int numLines = amountOfLines + 1; - Main.spriteBatch.Draw(TextureAssets.ChatBack.Value, new Vector2((float) (Main.screenWidth / 2 - TextureAssets.ChatBack.Width() / 2), 100f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.ChatBack.Width(), (numLines + 1) * 30)), color1, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(TextureAssets.ChatBack.Value, new Vector2((float) (Main.screenWidth / 2 - TextureAssets.ChatBack.Width() / 2), (float) (100 + (numLines + 1) * 30)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, TextureAssets.ChatBack.Height() - 30, TextureAssets.ChatBack.Width(), 30)), color1, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - for (int index = 0; index < numLines; ++index) + ++lineAmount; + Main.spriteBatch.Draw(Main.chatBackTexture, new Vector2((float) (Main.screenWidth / 2 - Main.chatBackTexture.Width / 2), 100f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chatBackTexture.Width, (lineAmount + 1) * 30)), color1, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.chatBackTexture, new Vector2((float) (Main.screenWidth / 2 - Main.chatBackTexture.Width / 2), (float) (100 + (lineAmount + 1) * 30)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, Main.chatBackTexture.Height - 30, Main.chatBackTexture.Width, 30)), color1, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + for (int index = 0; index < lineAmount; ++index) { - string text = textLines[index]; - if (text != null) - { - if (index == numLines - 1 & flag2) - text += "|"; - Utils.DrawBorderStringFourWay(Main.spriteBatch, FontAssets.MouseText.Value, text, (float) (170 + (Main.screenWidth - 800) / 2), (float) (120 + index * 30), color2, Microsoft.Xna.Framework.Color.Black, Vector2.Zero); - } + if (strArray[index] != null) + Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, strArray[index], (float) (170 + (Main.screenWidth - 800) / 2), (float) (120 + index * 30), color2, Microsoft.Xna.Framework.Color.Black, Vector2.Zero); } - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(Main.screenWidth / 2 - TextureAssets.ChatBack.Width() / 2, 100, TextureAssets.ChatBack.Width(), (numLines + 2) * 30); - int num2 = 120 + numLines * 30 + 30 - 235; - UIVirtualKeyboard.ShouldHideText = !PlayerInput.UsingGamepad; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(Main.screenWidth / 2 - Main.chatBackTexture.Width / 2, 100, Main.chatBackTexture.Width, (lineAmount + 2) * 30); + int num2 = 120 + lineAmount * 30 + 30 - 235; if (!PlayerInput.UsingGamepad) num2 = 9999; UIVirtualKeyboard.OffsetDown = num2; if (Main.npcChatCornerItem != 0) { - Vector2 position = new Vector2((float) (Main.screenWidth / 2 + TextureAssets.ChatBack.Width() / 2), (float) (100 + (numLines + 1) * 30 + 30)) - Vector2.One * 8f; + Vector2 position = new Vector2((float) (Main.screenWidth / 2 + Main.chatBackTexture.Width / 2), (float) (100 + (lineAmount + 1) * 30 + 30)) - Vector2.One * 8f; Item obj = new Item(); obj.netDefaults(Main.npcChatCornerItem); float scale = 1f; - this.LoadItem(obj.type); - Texture2D texture = TextureAssets.Item[obj.type].Value; + Texture2D texture = Main.itemTexture[obj.type]; if (texture.Width > 32 || texture.Height > 32) scale = texture.Width <= texture.Height ? 32f / (float) texture.Height : 32f / (float) texture.Width; Main.spriteBatch.Draw(texture, position, new Microsoft.Xna.Framework.Rectangle?(), obj.GetAlpha(Microsoft.Xna.Framework.Color.White), 0.0f, new Vector2((float) texture.Width, (float) texture.Height), scale, SpriteEffects.None, 0.0f); @@ -27676,28 +28382,9 @@ label_56: for (int index1 = 0; index1 < 22; ++index1) { int index2 = Main.player[Main.myPlayer].buffType[index1]; - if (Main.debuff[index2] && Main.player[Main.myPlayer].buffTime[index1] > 60 && index2 != 28 && index2 != 34 && index2 != 87 && index2 != 89 && index2 != 21 && index2 != 86 && index2 != 199) - num3 += 100; + if (Main.debuff[index2] && Main.player[Main.myPlayer].buffTime[index1] > 5 && index2 != 28 && index2 != 34 && index2 != 87 && index2 != 89 && index2 != 21 && index2 != 86 && index2 != 199) + num3 += 1000; } - if (NPC.downedGolemBoss) - num3 *= 200; - else if (NPC.downedPlantBoss) - num3 *= 150; - else if (NPC.downedMechBossAny) - num3 *= 100; - else if (Main.hardMode) - num3 *= 60; - else if (NPC.downedBoss3 || NPC.downedQueenBee) - num3 *= 25; - else if (NPC.downedBoss2) - num3 *= 10; - else if (NPC.downedBoss1) - num3 *= 3; - if (Main.expertMode) - num3 *= 2; - int num4 = (int) ((double) num3 * Main.player[Main.myPlayer].currentShoppingSettings.PriceAdjustment); - string str1 = (string) null; - string text1 = (string) null; if (Main.player[Main.myPlayer].sign > -1) focusText = !Main.editSign ? Lang.inter[48].Value : Lang.inter[47].Value; else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 20) @@ -27705,13 +28392,10 @@ label_56: focusText = Lang.inter[28].Value; focusText3 = Lang.inter[49].Value; } - else if (NPCID.Sets.IsTownPet[Main.npc[Main.player[Main.myPlayer].talkNPC].type]) - focusText = Language.GetTextValue("UI.PetTheAnimal"); else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 207) { focusText = Lang.inter[28].Value; - if (Main.hardMode) - focusText3 = Lang.inter[107].Value; + focusText3 = Lang.inter[107].Value; } else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 453) focusText = Lang.inter[28].Value; @@ -27720,10 +28404,6 @@ label_56: focusText = Lang.inter[28].Value; focusText3 = Language.GetTextValue("UI.BartenderHelp"); } - else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 588) - focusText = Lang.inter[28].Value; - else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 633) - focusText = Lang.inter[28].Value; else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 353) { focusText = Lang.inter[28].Value; @@ -27733,13 +28413,7 @@ label_56: focusText = Lang.inter[28].Value; else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 369) focusText = Lang.inter[64].Value; - else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 208) - { - focusText = Lang.inter[28].Value; - if (Main.TOWMusicUnlocked) - focusText3 = Language.GetTextValue("GameUI.Music"); - } - else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 17 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 19 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 38 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 54 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 107 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 108 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 124 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 142 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 160 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 178 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 207 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 209 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 227 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 228 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 229) + else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 17 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 19 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 38 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 54 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 107 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 108 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 124 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 142 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 160 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 178 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 207 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 208 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 209 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 227 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 228 || Main.npc[Main.player[Main.myPlayer].talkNPC].type == 229) { focusText = Lang.inter[28].Value; if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 107) @@ -27763,135 +28437,123 @@ label_56: } else { - string str2 = ""; + string str1 = ""; + int num4 = 0; int num5 = 0; int num6 = 0; int num7 = 0; - int num8 = 0; - int num9 = (int) ((double) Main.player[Main.myPlayer].taxMoney / Main.player[Main.myPlayer].currentShoppingSettings.PriceAdjustment); - if (num9 < 0) - num9 = 0; - num4 = num9; - if (num9 >= 1000000) + int num8 = Main.player[Main.myPlayer].taxMoney; + if (num8 < 0) + num8 = 0; + num3 = num8; + if (num8 >= 1000000) { - num5 = num9 / 1000000; - num9 -= num5 * 1000000; + num4 = num8 / 1000000; + num8 -= num4 * 1000000; } - if (num9 >= 10000) + if (num8 >= 10000) { - num6 = num9 / 10000; - num9 -= num6 * 10000; + num5 = num8 / 10000; + num8 -= num5 * 10000; } - if (num9 >= 100) + if (num8 >= 100) { - num7 = num9 / 100; - num9 -= num7 * 100; + num6 = num8 / 100; + num8 -= num6 * 100; } - if (num9 >= 1) - num8 = num9; + if (num8 >= 1) + num7 = num8; + if (num4 > 0) + str1 = str1 + (object) num4 + " " + Lang.inter[15].Value + " "; if (num5 > 0) - str2 = str2 + (object) num5 + " " + Lang.inter[15].Value + " "; + str1 = str1 + (object) num5 + " " + Lang.inter[16].Value + " "; if (num6 > 0) - str2 = str2 + (object) num6 + " " + Lang.inter[16].Value + " "; + str1 = str1 + (object) num6 + " " + Lang.inter[17].Value + " "; if (num7 > 0) - str2 = str2 + (object) num7 + " " + Lang.inter[17].Value + " "; - if (num8 > 0) - str2 = str2 + (object) num8 + " " + Lang.inter[18].Value + " "; - float num10 = (float) Main.mouseTextColor / (float) byte.MaxValue; - if (num5 > 0) - color2 = new Microsoft.Xna.Framework.Color((int) (byte) (220.0 * (double) num10), (int) (byte) (220.0 * (double) num10), (int) (byte) (198.0 * (double) num10), (int) Main.mouseTextColor); + str1 = str1 + (object) num7 + " " + Lang.inter[18].Value + " "; + float num9 = (float) Main.mouseTextColor / (float) byte.MaxValue; + if (num4 > 0) + color2 = new Microsoft.Xna.Framework.Color((int) (byte) (220.0 * (double) num9), (int) (byte) (220.0 * (double) num9), (int) (byte) (198.0 * (double) num9), (int) Main.mouseTextColor); + else if (num5 > 0) + color2 = new Microsoft.Xna.Framework.Color((int) (byte) (224.0 * (double) num9), (int) (byte) (201.0 * (double) num9), (int) (byte) (92.0 * (double) num9), (int) Main.mouseTextColor); else if (num6 > 0) - color2 = new Microsoft.Xna.Framework.Color((int) (byte) (224.0 * (double) num10), (int) (byte) (201.0 * (double) num10), (int) (byte) (92.0 * (double) num10), (int) Main.mouseTextColor); + color2 = new Microsoft.Xna.Framework.Color((int) (byte) (181.0 * (double) num9), (int) (byte) (192.0 * (double) num9), (int) (byte) (193.0 * (double) num9), (int) Main.mouseTextColor); else if (num7 > 0) - color2 = new Microsoft.Xna.Framework.Color((int) (byte) (181.0 * (double) num10), (int) (byte) (192.0 * (double) num10), (int) (byte) (193.0 * (double) num10), (int) Main.mouseTextColor); - else if (num8 > 0) - color2 = new Microsoft.Xna.Framework.Color((int) (byte) (246.0 * (double) num10), (int) (byte) (138.0 * (double) num10), (int) (byte) (96.0 * (double) num10), (int) Main.mouseTextColor); - string str3; - if (str2 == "") + color2 = new Microsoft.Xna.Framework.Color((int) (byte) (246.0 * (double) num9), (int) (byte) (138.0 * (double) num9), (int) (byte) (96.0 * (double) num9), (int) Main.mouseTextColor); + if (str1 == "") { - str3 = Lang.inter[89].Value; + focusText = Lang.inter[89].Value; } else { - string str4 = str2.Substring(0, str2.Length - 1); - str3 = Lang.inter[89].Value + " (" + str4 + ")"; + string str2 = str1.Substring(0, str1.Length - 1); + focusText = Lang.inter[89].Value + " (" + str2 + ")"; } - string str5 = Lang.inter[89].Value; - text1 = str5; - str1 = ""; - for (int index = 0; index < str5.Length; ++index) - str1 += " "; - focusText = str5 + str1 + " "; } } else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 18) { - string str6 = ""; + string str3 = ""; + int num10 = 0; int num11 = 0; int num12 = 0; int num13 = 0; - int num14 = 0; - int num15 = num4; - if (num15 > 0 && num15 < 1) - num15 = 1; - if (num15 < 0) - num15 = 0; - num4 = num15; - if (num15 >= 1000000) - { - num11 = num15 / 1000000; - num15 -= num11 * 1000000; - } - if (num15 >= 10000) - { - num12 = num15 / 10000; - num15 -= num12 * 10000; - } - if (num15 >= 100) - { - num13 = num15 / 100; - num15 -= num13 * 100; - } - if (num15 >= 1) - num14 = num15; - if (num11 > 0) - str6 = str6 + (object) num11 + " " + Lang.inter[15].Value + " "; - if (num12 > 0) - str6 = str6 + (object) num12 + " " + Lang.inter[16].Value + " "; - if (num13 > 0) - str6 = str6 + (object) num13 + " " + Lang.inter[17].Value + " "; + int num14 = num3; if (num14 > 0) - str6 = str6 + (object) num14 + " " + Lang.inter[18].Value + " "; - float num16 = (float) Main.mouseTextColor / (float) byte.MaxValue; + { + num14 = (int) ((double) num14 * 0.75); + if (num14 < 1) + num14 = 1; + } + if (num14 < 0) + num14 = 0; + num3 = num14; + if (num14 >= 1000000) + { + num10 = num14 / 1000000; + num14 -= num10 * 1000000; + } + if (num14 >= 10000) + { + num11 = num14 / 10000; + num14 -= num11 * 10000; + } + if (num14 >= 100) + { + num12 = num14 / 100; + num14 -= num12 * 100; + } + if (num14 >= 1) + num13 = num14; + if (num10 > 0) + str3 = str3 + (object) num10 + " " + Lang.inter[15].Value + " "; if (num11 > 0) - color2 = new Microsoft.Xna.Framework.Color((int) (byte) (220.0 * (double) num16), (int) (byte) (220.0 * (double) num16), (int) (byte) (198.0 * (double) num16), (int) Main.mouseTextColor); + str3 = str3 + (object) num11 + " " + Lang.inter[16].Value + " "; + if (num12 > 0) + str3 = str3 + (object) num12 + " " + Lang.inter[17].Value + " "; + if (num13 > 0) + str3 = str3 + (object) num13 + " " + Lang.inter[18].Value + " "; + float num15 = (float) Main.mouseTextColor / (float) byte.MaxValue; + if (num10 > 0) + color2 = new Microsoft.Xna.Framework.Color((int) (byte) (220.0 * (double) num15), (int) (byte) (220.0 * (double) num15), (int) (byte) (198.0 * (double) num15), (int) Main.mouseTextColor); + else if (num11 > 0) + color2 = new Microsoft.Xna.Framework.Color((int) (byte) (224.0 * (double) num15), (int) (byte) (201.0 * (double) num15), (int) (byte) (92.0 * (double) num15), (int) Main.mouseTextColor); else if (num12 > 0) - color2 = new Microsoft.Xna.Framework.Color((int) (byte) (224.0 * (double) num16), (int) (byte) (201.0 * (double) num16), (int) (byte) (92.0 * (double) num16), (int) Main.mouseTextColor); + color2 = new Microsoft.Xna.Framework.Color((int) (byte) (181.0 * (double) num15), (int) (byte) (192.0 * (double) num15), (int) (byte) (193.0 * (double) num15), (int) Main.mouseTextColor); else if (num13 > 0) - color2 = new Microsoft.Xna.Framework.Color((int) (byte) (181.0 * (double) num16), (int) (byte) (192.0 * (double) num16), (int) (byte) (193.0 * (double) num16), (int) Main.mouseTextColor); - else if (num14 > 0) - color2 = new Microsoft.Xna.Framework.Color((int) (byte) (246.0 * (double) num16), (int) (byte) (138.0 * (double) num16), (int) (byte) (96.0 * (double) num16), (int) Main.mouseTextColor); - if (str6 == "") + color2 = new Microsoft.Xna.Framework.Color((int) (byte) (246.0 * (double) num15), (int) (byte) (138.0 * (double) num15), (int) (byte) (96.0 * (double) num15), (int) Main.mouseTextColor); + if (str3 == "") { focusText = Lang.inter[54].Value; } else { - string str7 = str6.Substring(0, str6.Length - 1); - focusText = Lang.inter[54].Value + " (" + str7 + ")"; - } - } - if (!flag1) - { - Main.DrawNPCChatButtons(mouseTextColor, color2, numLines, focusText, focusText3); - if (str1 != null) - { - float num17 = (float) (130 + numLines * 30); - float shopx = (float) (180 + (Main.screenWidth - 800) / 2) + (ChatManager.GetStringSize(FontAssets.MouseText.Value, text1, new Vector2(0.9f)).X - 20f); - int num18 = (int) ((double) Main.player[Main.myPlayer].taxMoney / Main.player[Main.myPlayer].currentShoppingSettings.PriceAdjustment); - ItemSlot.DrawMoney(Main.spriteBatch, "", shopx, num17 - 40f, Utils.CoinsSplit((long) num18), true); + string str4 = str3.Substring(0, str3.Length - 1); + focusText = Lang.inter[54].Value + " (" + str4 + ")"; } } + if (!flag) + Main.DrawNPCChatButtons(mouseTextColor, color2, lineAmount, focusText, focusText3); if (PlayerInput.IgnoreMouseInterface) return; if (rectangle.Contains(new Microsoft.Xna.Framework.Point(Main.mouseX, Main.mouseY))) @@ -27912,12 +28574,10 @@ label_56: else IngameFancyUI.OpenVirtualKeyboard(1); } - else if (NPCID.Sets.IsTownPet[Main.npc[Main.player[Main.myPlayer].talkNPC].type]) - Main.player[Main.myPlayer].PetAnimal(Main.player[Main.myPlayer].talkNPC); else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 369) { Main.npcChatCornerItem = 0; - SoundEngine.PlaySound(12); + Main.PlaySound(12); bool turnIn = false; if (!Main.anglerQuestFinished && !Main.anglerWhoFinishedToday.Contains(Main.player[Main.myPlayer].name)) { @@ -27928,7 +28588,7 @@ label_56: if (Main.player[Main.myPlayer].inventory[index].stack <= 0) Main.player[Main.myPlayer].inventory[index] = new Item(); turnIn = true; - SoundEngine.PlaySound(24); + Main.PlaySound(24); ++Main.player[Main.myPlayer].anglerQuestsFinished; Main.player[Main.myPlayer].GetAnglerReward(); } @@ -27944,13 +28604,61 @@ label_56: AchievementsHelper.HandleAnglerService(); } else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 17) - this.OpenShop(1); + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 1; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12); + } else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 19) - this.OpenShop(2); + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 2; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12); + } else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 124) - this.OpenShop(8); + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 8; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12); + } else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 142) - this.OpenShop(9); + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 9; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12); + } + else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 353) + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 18; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12); + } + else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 368) + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 19; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12); + } + else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 453) + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 20; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12); + } else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 37) { if (Main.netMode == 0) @@ -27960,85 +28668,151 @@ label_56: Main.npcChatText = ""; } else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 20) - this.OpenShop(3); + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 3; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12); + } else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 38) - this.OpenShop(4); + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 4; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12); + } else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 54) - this.OpenShop(5); + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 5; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12); + } else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 107) - this.OpenShop(6); + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 6; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12); + } else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 108) - this.OpenShop(7); + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 7; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12); + } else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 160) - this.OpenShop(10); + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 10; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12); + } else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 178) - this.OpenShop(11); + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 11; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12); + } else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 207) - this.OpenShop(12); + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 12; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12); + } else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 208) - this.OpenShop(13); + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 13; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12); + } else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 209) - this.OpenShop(14); + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 14; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12); + } else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 227) - this.OpenShop(15); + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 15; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12); + } else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 228) - this.OpenShop(16); + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 16; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12); + } else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 229) - this.OpenShop(17); - else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 353) - this.OpenShop(18); - else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 368) - this.OpenShop(19); - else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 453) - this.OpenShop(20); - else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 550) - this.OpenShop(21); - else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 588) - this.OpenShop(22); - else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 633) - this.OpenShop(23); + { + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 17; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12); + } else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 22) { - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.HelpText(); } else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 441) { if (Main.player[Main.myPlayer].taxMoney > 0) { - int num19 = (int) ((double) Main.player[Main.myPlayer].taxMoney / Main.player[Main.myPlayer].currentShoppingSettings.PriceAdjustment); - while (num19 > 0) + int taxMoney = Main.player[Main.myPlayer].taxMoney; + while (taxMoney > 0) { - if (num19 > 1000000) + if (taxMoney > 1000000) { - int Stack = num19 / 1000000; - num19 -= 1000000 * Stack; + int Stack = taxMoney / 1000000; + taxMoney -= 1000000 * Stack; int number = Item.NewItem((int) Main.player[Main.myPlayer].position.X, (int) Main.player[Main.myPlayer].position.Y, Main.player[Main.myPlayer].width, Main.player[Main.myPlayer].height, 74, Stack); if (Main.netMode == 1) NetMessage.SendData(21, number: number, number2: 1f); } - else if (num19 > 10000) + else if (taxMoney > 10000) { - int Stack = num19 / 10000; - num19 -= 10000 * Stack; + int Stack = taxMoney / 10000; + taxMoney -= 10000 * Stack; int number = Item.NewItem((int) Main.player[Main.myPlayer].position.X, (int) Main.player[Main.myPlayer].position.Y, Main.player[Main.myPlayer].width, Main.player[Main.myPlayer].height, 73, Stack); if (Main.netMode == 1) NetMessage.SendData(21, number: number, number2: 1f); } - else if (num19 > 100) + else if (taxMoney > 100) { - int Stack = num19 / 100; - num19 -= 100 * Stack; + int Stack = taxMoney / 100; + taxMoney -= 100 * Stack; int number = Item.NewItem((int) Main.player[Main.myPlayer].position.X, (int) Main.player[Main.myPlayer].position.Y, Main.player[Main.myPlayer].width, Main.player[Main.myPlayer].height, 72, Stack); if (Main.netMode == 1) NetMessage.SendData(21, number: number, number2: 1f); } else { - int Stack = num19; + int Stack = taxMoney; if (Stack < 1) Stack = 1; - num19 -= Stack; + taxMoney -= Stack; int number = Item.NewItem((int) Main.player[Main.myPlayer].position.X, (int) Main.player[Main.myPlayer].position.Y, Main.player[Main.myPlayer].width, Main.player[Main.myPlayer].height, 71, Stack); if (Main.netMode == 1) NetMessage.SendData(21, number: number, number2: 1f); @@ -28050,17 +28824,15 @@ label_56: else Main.npcChatText = Lang.dialog(Main.rand.Next(390, 401)); } - else + else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 18) { - if (Main.npc[Main.player[Main.myPlayer].talkNPC].type != 18) - return; - SoundEngine.PlaySound(12); - if (num4 > 0) + Main.PlaySound(12); + if (num3 > 0) { - if (Main.player[Main.myPlayer].BuyItem(num4)) + if (Main.player[Main.myPlayer].BuyItem(num3)) { - AchievementsHelper.HandleNurseService(num4); - SoundEngine.PlaySound(SoundID.Item4); + AchievementsHelper.HandleNurseService(num3); + Main.PlaySound(SoundID.Item4); Main.player[Main.myPlayer].HealEffect(Main.player[Main.myPlayer].statLifeMax2 - Main.player[Main.myPlayer].statLife); Main.npcChatText = (double) Main.player[Main.myPlayer].statLife >= (double) Main.player[Main.myPlayer].statLifeMax2 * 0.25 ? ((double) Main.player[Main.myPlayer].statLife >= (double) Main.player[Main.myPlayer].statLifeMax2 * 0.5 ? ((double) Main.player[Main.myPlayer].statLife >= (double) Main.player[Main.myPlayer].statLifeMax2 * 0.75 ? Lang.dialog(230) : Lang.dialog(229)) : Lang.dialog(228)) : Lang.dialog(227); Main.player[Main.myPlayer].statLife = Main.player[Main.myPlayer].statLifeMax2; @@ -28076,22 +28848,22 @@ label_56: } else { - int num20 = Main.rand.Next(3); - if (num20 == 0) + int num16 = Main.rand.Next(3); + if (num16 == 0) Main.npcChatText = Lang.dialog(52); - if (num20 == 1) + if (num16 == 1) Main.npcChatText = Lang.dialog(53); - if (num20 != 2) + if (num16 != 2) return; Main.npcChatText = Lang.dialog(54); } } else { - int num21 = Main.rand.Next(3); + int num17 = Main.rand.Next(3); if (!ChildSafety.Disabled) - num21 = Main.rand.Next(1, 3); - switch (num21) + num17 = Main.rand.Next(1, 3); + switch (num17) { case 0: Main.npcChatText = Lang.dialog(55); @@ -28105,12 +28877,16 @@ label_56: } } } - } - else if (Main.npcChatFocus4) - { - Main.npcChatCornerItem = 0; - SoundEngine.PlaySound(12); - Main.npcChatText = Main.player[Main.myPlayer].currentShoppingSettings.HappinessReport; + else + { + if (Main.npc[Main.player[Main.myPlayer].talkNPC].type != 550) + return; + Main.playerInventory = true; + Main.npcChatText = ""; + Main.npcShop = 21; + this.shop[Main.npcShop].SetupShop(Main.npcShop); + Main.PlaySound(12); + } } else { @@ -28118,20 +28894,14 @@ label_56: return; if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 20) { - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.npcChatText = Lang.GetDryadWorldStatusDialog(); } - if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 208) - { - SoundEngine.PlaySound(12); - Main.npcChatText = Language.GetTextValue("PartyGirlSpecialText.Music" + (object) Main.rand.Next(1, 4)); - Main.swapMusic = !Main.swapMusic; - } else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 22) { Main.playerInventory = true; Main.npcChatText = ""; - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.InGuideCraftMenu = true; UILinkPointNavigator.GoToDefaultPage(); } @@ -28139,7 +28909,7 @@ label_56: { Main.playerInventory = true; Main.npcChatText = ""; - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.InReforgeMenu = true; UILinkPointNavigator.GoToDefaultPage(); } @@ -28148,7 +28918,7 @@ label_56: else if (Main.npc[Main.player[Main.myPlayer].talkNPC].type == 207) { Main.npcChatCornerItem = 0; - SoundEngine.PlaySound(12); + Main.PlaySound(12); bool gotDye = false; int index = Main.player[Main.myPlayer].FindItem(ItemID.Sets.ExoticPlantsForDyeTrade); if (index != -1) @@ -28157,7 +28927,7 @@ label_56: if (Main.player[Main.myPlayer].inventory[index].stack <= 0) Main.player[Main.myPlayer].inventory[index] = new Item(); gotDye = true; - SoundEngine.PlaySound(24); + Main.PlaySound(24); Main.player[Main.myPlayer].GetDyeTraderReward(); } Main.npcChatText = Lang.DyeTraderQuestChat(gotDye); @@ -28166,7 +28936,7 @@ label_56: { if (Main.npc[Main.player[Main.myPlayer].talkNPC].type != 550) return; - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.HelpText(); Main.npcChatText = Lang.BartenderHelpText(Main.npc[Main.player[Main.myPlayer].talkNPC]); } @@ -28174,18 +28944,6 @@ label_56: } } - private void OpenShop(int shopIndex) - { - Main.playerInventory = true; - Main.stackSplit = 9999; - Main.npcChatText = ""; - Main.SetNPCShopIndex(shopIndex); - this.shop[Main.npcShop].SetupShop(Main.npcShop); - SoundEngine.PlaySound(12); - } - - public static void SetNPCShopIndex(int index) => Main.npcShop = index; - private static void DrawNPCChatButtons( int superColor, Microsoft.Xna.Framework.Color chatColor, @@ -28194,166 +28952,213 @@ label_56: string focusText3) { float y = (float) (130 + numLines * 30); - int num1 = 180 + (Main.screenWidth - 800) / 2; + int num = 180 + (Main.screenWidth - 800) / 2; Vector2 vec = new Vector2((float) Main.mouseX, (float) Main.mouseY); Player player = Main.player[Main.myPlayer]; - Vector2 vector2_1 = new Vector2((float) num1, y); + Vector2 vector2_1 = new Vector2((float) num, y); string text1 = focusText; - DynamicSpriteFont font1 = FontAssets.MouseText.Value; + DynamicSpriteFont fontMouseText1 = Main.fontMouseText; Vector2 minimum1 = vector2_1; Vector2 baseScale = new Vector2(0.9f); - Vector2 stringSize1 = ChatManager.GetStringSize(font1, text1, baseScale); + Vector2 stringSize1 = ChatManager.GetStringSize(fontMouseText1, text1, baseScale); Microsoft.Xna.Framework.Color baseColor1 = chatColor; - Microsoft.Xna.Framework.Color black = Microsoft.Xna.Framework.Color.Black; Vector2 vector2_2 = new Vector2(1f); - Microsoft.Xna.Framework.Color brown = Microsoft.Xna.Framework.Color.Brown; - float num2 = 1.2f; if ((double) stringSize1.X > 260.0) vector2_2.X *= 260f / stringSize1.X; if (vec.Between(minimum1, minimum1 + stringSize1 * baseScale * vector2_2.X) && !PlayerInput.IgnoreMouseInterface) { player.mouseInterface = true; player.releaseUseItem = false; - baseScale *= num2; + baseScale *= 1.1f; if (!Main.npcChatFocus2) - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.npcChatFocus2 = true; } else { if (Main.npcChatFocus2) - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.npcChatFocus2 = false; } - Microsoft.Xna.Framework.Color baseColor2 = !Main.npcChatFocus2 ? Microsoft.Xna.Framework.Color.Black : brown; - ChatManager.DrawColorCodedStringShadow(Main.spriteBatch, font1, text1, minimum1 + stringSize1 * vector2_2 * 0.5f, baseColor2, 0.0f, stringSize1 * 0.5f, baseScale * vector2_2); - ChatManager.DrawColorCodedString(Main.spriteBatch, font1, text1, minimum1 + stringSize1 * vector2_2 * 0.5f, baseColor1, 0.0f, stringSize1 * 0.5f, baseScale * vector2_2); + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, fontMouseText1, text1, minimum1 + stringSize1 * vector2_2 * 0.5f, baseColor1, 0.0f, stringSize1 * 0.5f, baseScale * vector2_2); if (text1.Length > 0) { UILinkPointNavigator.SetPosition(2500, minimum1 + stringSize1 * 0.5f); UILinkPointNavigator.Shortcuts.NPCCHAT_ButtonsLeft = true; } - Vector2 vector2_3 = new Vector2((float) ((double) num1 + (double) stringSize1.X * (double) vector2_2.X + 30.0), y); + Vector2 vector2_3 = new Vector2((float) ((double) num + (double) stringSize1.X * (double) vector2_2.X + 30.0), y); string text2 = Lang.inter[52].Value; - DynamicSpriteFont font2 = FontAssets.MouseText.Value; + DynamicSpriteFont fontMouseText2 = Main.fontMouseText; Vector2 minimum2 = vector2_3; baseScale = new Vector2(0.9f); - Vector2 stringSize2 = ChatManager.GetStringSize(font2, text2, baseScale); + Vector2 stringSize2 = ChatManager.GetStringSize(fontMouseText2, text2, baseScale); baseColor1 = new Microsoft.Xna.Framework.Color(superColor, (int) ((double) superColor / 1.1), superColor / 2, superColor); vector2_2 = new Vector2(1f); if (vec.Between(minimum2, minimum2 + stringSize2 * baseScale * vector2_2.X) && !PlayerInput.IgnoreMouseInterface) { player.mouseInterface = true; player.releaseUseItem = false; - baseScale *= num2; + baseScale *= 1.1f; if (!Main.npcChatFocus1) - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.npcChatFocus1 = true; } else { if (Main.npcChatFocus1) - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.npcChatFocus1 = false; } - Microsoft.Xna.Framework.Color baseColor3 = !Main.npcChatFocus1 ? Microsoft.Xna.Framework.Color.Black : brown; - ChatManager.DrawColorCodedStringShadow(Main.spriteBatch, font2, text2, minimum2 + stringSize2 * vector2_2 * 0.5f, baseColor3, 0.0f, stringSize2 * 0.5f, baseScale * vector2_2); - ChatManager.DrawColorCodedString(Main.spriteBatch, font2, text2, minimum2 + stringSize2 * vector2_2 * 0.5f, baseColor1, 0.0f, stringSize2 * 0.5f, baseScale * vector2_2); + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, fontMouseText2, text2, minimum2 + stringSize2 * vector2_2 * 0.5f, baseColor1, 0.0f, stringSize2 * 0.5f, baseScale * vector2_2); if (text2.Length > 0) { UILinkPointNavigator.SetPosition(2501, minimum2 + stringSize2 * 0.5f); UILinkPointNavigator.Shortcuts.NPCCHAT_ButtonsMiddle = true; } if (string.IsNullOrWhiteSpace(focusText3)) + return; + Vector2 vector2_4 = new Vector2((float) ((double) vector2_3.X + (double) stringSize2.X * (double) vector2_2.X + 30.0), y); + string text3 = focusText3; + DynamicSpriteFont fontMouseText3 = Main.fontMouseText; + Vector2 minimum3 = vector2_4; + baseScale = new Vector2(0.9f); + Vector2 stringSize3 = ChatManager.GetStringSize(fontMouseText3, text3, baseScale); + Microsoft.Xna.Framework.Color baseColor2 = chatColor; + vector2_2 = new Vector2(1f); + if (vec.Between(minimum3, minimum3 + stringSize3 * baseScale * vector2_2.X) && !PlayerInput.IgnoreMouseInterface) { + player.mouseInterface = true; + player.releaseUseItem = false; + baseScale *= 1.1f; + if (!Main.npcChatFocus3) + Main.PlaySound(12); + Main.npcChatFocus3 = true; + } + else + { + if (Main.npcChatFocus3) + Main.PlaySound(12); Main.npcChatFocus3 = false; - UILinkPointNavigator.Shortcuts.NPCCHAT_ButtonsRight = false; + } + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, fontMouseText3, text3, minimum3 + stringSize3 * vector2_2 * 0.5f, baseColor2, 0.0f, stringSize3 * 0.5f, baseScale * vector2_2); + UILinkPointNavigator.SetPosition(2502, minimum3 + stringSize3 * 0.5f); + UILinkPointNavigator.Shortcuts.NPCCHAT_ButtonsRight = true; + } + + private static void DrawNPCChatButtonsOld( + int superColor, + Microsoft.Xna.Framework.Color chatColor, + int numLines, + string focusText, + string focusText3) + { + int num1 = 180 + (Main.screenWidth - 800) / 2; + int num2 = 130 + numLines * 30; + float num3 = 0.9f; + Vector2 vector2_1 = new Vector2(0.9f); + Vector2 vector2_2 = new Vector2((float) num1, (float) num2); + Vector2 vector2_3 = Main.fontMouseText.MeasureString(focusText); + if (Main.mouseX > num1 && (double) Main.mouseX < (double) num1 + (double) vector2_3.X && Main.mouseY > num2 && (double) Main.mouseY < (double) num2 + (double) vector2_3.Y && !PlayerInput.IgnoreMouseInterface) + { + Main.player[Main.myPlayer].mouseInterface = true; + num3 = 1.2f; + Vector2 vector2_4 = new Vector2(num3); + if (!Main.npcChatFocus2) + Main.PlaySound(12); + Main.npcChatFocus2 = true; + Main.player[Main.myPlayer].releaseUseItem = false; } else { - Vector2 vector2_4 = new Vector2((float) ((double) vector2_3.X + (double) stringSize2.X * (double) vector2_2.X + 30.0), y); - string text3 = focusText3; - DynamicSpriteFont font3 = FontAssets.MouseText.Value; - Vector2 minimum3 = vector2_4; - baseScale = new Vector2(0.9f); - stringSize2 = ChatManager.GetStringSize(font3, text3, baseScale); - baseColor1 = chatColor; - vector2_2 = new Vector2(1f); - vector2_3.X = vector2_4.X; - if (vec.Between(minimum3, minimum3 + stringSize2 * baseScale * vector2_2.X) && !PlayerInput.IgnoreMouseInterface) - { - player.mouseInterface = true; - player.releaseUseItem = false; - baseScale *= num2; - if (!Main.npcChatFocus3) - SoundEngine.PlaySound(12); - Main.npcChatFocus3 = true; - } - else - { - if (Main.npcChatFocus3) - SoundEngine.PlaySound(12); - Main.npcChatFocus3 = false; - } - Microsoft.Xna.Framework.Color baseColor4 = !Main.npcChatFocus3 ? Microsoft.Xna.Framework.Color.Black : brown; - ChatManager.DrawColorCodedStringShadow(Main.spriteBatch, font3, text3, minimum3 + stringSize2 * vector2_2 * 0.5f, baseColor4, 0.0f, stringSize2 * 0.5f, baseScale * vector2_2); - ChatManager.DrawColorCodedString(Main.spriteBatch, font3, text3, minimum3 + stringSize2 * vector2_2 * 0.5f, baseColor1, 0.0f, stringSize2 * 0.5f, baseScale * vector2_2); - UILinkPointNavigator.SetPosition(2502, minimum3 + stringSize2 * 0.5f); - UILinkPointNavigator.Shortcuts.NPCCHAT_ButtonsRight = true; + if (Main.npcChatFocus2) + Main.PlaySound(12); + Main.npcChatFocus2 = false; } - if (Main.player[Main.myPlayer].currentShoppingSettings.HappinessReport == "") + Vector2 vector2_5 = vector2_3 * 0.5f; + float num4 = 1f; + if ((double) vector2_3.X > 300.0) + num4 *= 300f / vector2_3.X; + Vector2 origin1 = vector2_5 * num4; + origin1.X *= 0.5f; + Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, focusText, (float) num1 + origin1.X, (float) num2 + origin1.Y, chatColor, Microsoft.Xna.Framework.Color.Black, origin1, num3 * num4); + if (focusText.Length > 0) { - Main.npcChatFocus4 = false; - UILinkPointNavigator.Shortcuts.NPCCHAT_ButtonsRight2 = false; + UILinkPointNavigator.SetPosition(2500, vector2_2 + origin1); + UILinkPointNavigator.Shortcuts.NPCCHAT_ButtonsLeft = true; + } + string text = Lang.inter[52].Value; + chatColor = new Microsoft.Xna.Framework.Color(superColor, (int) ((double) superColor / 1.1), superColor / 2, superColor); + int num5 = num1 + (int) ((double) Main.fontMouseText.MeasureString(focusText).X * (double) num4) + 20; + int num6 = num5 + (int) Main.fontMouseText.MeasureString(text).X; + int num7 = 130 + numLines * 30; + float scale1 = 0.9f; + vector2_2 = new Vector2((float) num5, (float) num7); + Vector2 vector2_6 = Main.fontMouseText.MeasureString(text); + if (Main.mouseX > num5 && (double) Main.mouseX < (double) num5 + (double) vector2_6.X && Main.mouseY > num7 && (double) Main.mouseY < (double) num7 + (double) vector2_6.Y) + { + scale1 = 1.1f; + if (!Main.npcChatFocus1) + Main.PlaySound(12); + Main.npcChatFocus1 = true; + Main.player[Main.myPlayer].releaseUseItem = false; + Main.player[Main.myPlayer].controlUseItem = false; } else { - string textValue = Language.GetTextValue("UI.NPCCheckHappiness"); - Vector2 vector2_5 = new Vector2((float) ((double) vector2_3.X + (double) stringSize2.X * (double) vector2_2.X + 30.0), y); - string text4 = textValue; - DynamicSpriteFont font4 = FontAssets.MouseText.Value; - Vector2 minimum4 = vector2_5; - baseScale = new Vector2(0.9f); - Vector2 stringSize3 = ChatManager.GetStringSize(font4, text4, baseScale); - baseColor1 = new Microsoft.Xna.Framework.Color(superColor, (int) ((double) superColor / 1.1), superColor / 2, superColor); - vector2_2 = new Vector2(1f); - if (vec.Between(minimum4, minimum4 + stringSize3 * baseScale * vector2_2.X) && !PlayerInput.IgnoreMouseInterface) - { - player.mouseInterface = true; - player.releaseUseItem = false; - baseScale *= num2; - if (!Main.npcChatFocus4) - SoundEngine.PlaySound(12); - Main.npcChatFocus4 = true; - } - else - { - if (Main.npcChatFocus4) - SoundEngine.PlaySound(12); - Main.npcChatFocus4 = false; - } - Microsoft.Xna.Framework.Color baseColor5 = !Main.npcChatFocus4 ? Microsoft.Xna.Framework.Color.Black : brown; - ChatManager.DrawColorCodedStringShadow(Main.spriteBatch, font4, text4, minimum4 + stringSize3 * vector2_2 * 0.5f, baseColor5, 0.0f, stringSize3 * 0.5f, baseScale * vector2_2); - ChatManager.DrawColorCodedString(Main.spriteBatch, font4, text4, minimum4 + stringSize3 * vector2_2 * 0.5f, baseColor1, 0.0f, stringSize3 * 0.5f, baseScale * vector2_2); - UILinkPointNavigator.SetPosition(2503, minimum4 + stringSize3 * 0.5f); - UILinkPointNavigator.Shortcuts.NPCCHAT_ButtonsRight2 = true; + if (Main.npcChatFocus1) + Main.PlaySound(12); + Main.npcChatFocus1 = false; } + Vector2 origin2 = vector2_6 * 0.5f; + Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, text, (float) num5 + origin2.X, (float) num7 + origin2.Y, chatColor, Microsoft.Xna.Framework.Color.Black, origin2, scale1); + if (text.Length > 0) + { + UILinkPointNavigator.SetPosition(2501, vector2_2 + origin2); + UILinkPointNavigator.Shortcuts.NPCCHAT_ButtonsMiddle = true; + } + if (!(focusText3 != "")) + return; + Main.fontMouseText.MeasureString(focusText3); + int num8 = num6 + 20; + int num9 = 130 + numLines * 30; + float scale2 = 0.9f; + vector2_2 = new Vector2((float) num8, (float) num9); + Vector2 vector2_7 = Main.fontMouseText.MeasureString(focusText3); + if (Main.mouseX > num8 && (double) Main.mouseX < (double) num8 + (double) vector2_7.X && Main.mouseY > num9 && (double) Main.mouseY < (double) num9 + (double) vector2_7.Y && !PlayerInput.IgnoreMouseInterface) + { + Main.player[Main.myPlayer].mouseInterface = true; + scale2 = 1.1f; + if (!Main.npcChatFocus3) + Main.PlaySound(12); + Main.npcChatFocus3 = true; + Main.player[Main.myPlayer].releaseUseItem = false; + } + else + { + if (Main.npcChatFocus3) + Main.PlaySound(12); + Main.npcChatFocus3 = false; + } + Vector2 origin3 = vector2_7 * 0.5f; + Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, focusText3, (float) num8 + origin3.X, (float) num9 + origin3.Y, chatColor, Microsoft.Xna.Framework.Color.Black, origin3, scale2); + UILinkPointNavigator.SetPosition(2502, vector2_2 + origin3); + UILinkPointNavigator.Shortcuts.NPCCHAT_ButtonsRight = true; } public static void CloseNPCChatOrSign() { + Main.player[Main.myPlayer].talkNPC = -1; Main.player[Main.myPlayer].sign = -1; - Main.editSign = false; - Main.player[Main.myPlayer].SetTalkNPC(-1); Main.npcChatCornerItem = 0; + Main.editSign = false; Main.npcChatText = ""; - SoundEngine.PlaySound(11); + Main.PlaySound(11); Main.player[Main.myPlayer].releaseMount = false; } public static void SubmitSignText() { - SoundEngine.PlaySound(12); + Main.PlaySound(12); int sign = Main.player[Main.myPlayer].sign; Sign.TextSign(sign, Main.npcChatText); Main.editSign = false; @@ -28362,38 +29167,165 @@ label_56: NetMessage.SendData(47, number: sign); } - private int NPCBannerSorter(int npcIndex1, int npcIndex2) => -Main.npc[npcIndex1].housingCategory.CompareTo(Main.npc[npcIndex2].housingCategory); - - protected void DrawNPCHousesInWorld() + public static void MoveCoins(Item[] pInv, Item[] cInv) { - this._npcsWithBannersToDraw.Clear(); - for (int index = 0; index < 200; ++index) + int[] numArray1 = new int[4]; + List intList1 = new List(); + List intList2 = new List(); + bool flag = false; + int[] numArray2 = new int[40]; + for (int index = 0; index < cInv.Length; ++index) { - if (Main.npc[index].active && Main.npc[index].townNPC && !Main.npc[index].homeless && Main.npc[index].homeTileX > 0 && Main.npc[index].homeTileY > 0 && Main.npc[index].type != 37) - this._npcsWithBannersToDraw.Add(index); - } - this._npcsWithBannersToDraw.Sort(new Comparison(this.NPCBannerSorter)); - for (int index1 = 0; index1 < this._npcsWithBannersToDraw.Count; ++index1) - { - int n = this._npcsWithBannersToDraw[index1]; - NPC npc = Main.npc[n]; - if (npc.active && npc.townNPC && !npc.homeless && npc.homeTileX > 0 && npc.homeTileY > 0 && npc.type != 37) + numArray2[index] = -1; + if (cInv[index].stack < 1 || cInv[index].type < 1) { - int bannerStyle = 0; - int housingCategory = npc.housingCategory; - int homeTileX = npc.homeTileX; - int index2 = npc.homeTileY - 1; - WorldGen.TownManager.AddOccupantsToList(homeTileX, index2 + 1, this._occupantsListToDrawNPCHouses); - if (this._occupantsListToDrawNPCHouses.Contains(npc.type)) - bannerStyle = 1; - int num1 = 0; - for (int index3 = this._npcsWithBannersToDraw.Count - 1; index3 > index1; --index3) + intList2.Add(index); + cInv[index] = new Item(); + } + if (cInv[index] != null && cInv[index].stack > 0) + { + int num = 0; + if (cInv[index].type == 71) + num = 1; + if (cInv[index].type == 72) + num = 2; + if (cInv[index].type == 73) + num = 3; + if (cInv[index].type == 74) + num = 4; + numArray2[index] = num - 1; + if (num > 0) { - int index4 = this._npcsWithBannersToDraw[index3]; - if (Main.npc[index4].homeTileX == homeTileX && Main.npc[index4].homeTileY == index2 + 1) - ++num1; + numArray1[num - 1] += cInv[index].stack; + intList2.Add(index); + cInv[index] = new Item(); + flag = true; } - int num2 = num1 * 26; + } + } + if (!flag) + return; + Main.PlaySound(7); + for (int index = 0; index < pInv.Length; ++index) + { + if (index != 58 && pInv[index] != null && pInv[index].stack > 0) + { + int num = 0; + if (pInv[index].type == 71) + num = 1; + if (pInv[index].type == 72) + num = 2; + if (pInv[index].type == 73) + num = 3; + if (pInv[index].type == 74) + num = 4; + if (num > 0) + { + numArray1[num - 1] += pInv[index].stack; + intList1.Add(index); + pInv[index] = new Item(); + } + } + } + for (int index = 0; index < 3; ++index) + { + while (numArray1[index] >= 100) + { + numArray1[index] -= 100; + ++numArray1[index + 1]; + } + } + for (int index1 = 0; index1 < 40; ++index1) + { + if (numArray2[index1] >= 0 && cInv[index1].type == 0) + { + int index2 = index1; + int index3 = numArray2[index1]; + if (numArray1[index3] > 0) + { + cInv[index2].SetDefaults(71 + index3); + cInv[index2].stack = numArray1[index3]; + if (cInv[index2].stack > cInv[index2].maxStack) + cInv[index2].stack = cInv[index2].maxStack; + numArray1[index3] -= cInv[index2].stack; + numArray2[index1] = -1; + } + if (Main.netMode == 1 && Main.player[Main.myPlayer].chest > -1) + NetMessage.SendData(32, number: Main.player[Main.myPlayer].chest, number2: ((float) index2)); + intList2.Remove(index2); + } + } + for (int index4 = 0; index4 < 40; ++index4) + { + if (numArray2[index4] >= 0 && cInv[index4].type == 0) + { + int index5 = index4; + for (int index6 = 3; index6 >= 0; --index6) + { + if (numArray1[index6] > 0) + { + cInv[index5].SetDefaults(71 + index6); + cInv[index5].stack = numArray1[index6]; + if (cInv[index5].stack > cInv[index5].maxStack) + cInv[index5].stack = cInv[index5].maxStack; + numArray1[index6] -= cInv[index5].stack; + numArray2[index4] = -1; + break; + } + } + if (Main.netMode == 1 && Main.player[Main.myPlayer].chest > -1) + NetMessage.SendData(32, number: Main.player[Main.myPlayer].chest, number2: ((float) index5)); + intList2.Remove(index5); + } + } + while (intList2.Count > 0) + { + int index7 = intList2[0]; + for (int index8 = 3; index8 >= 0; --index8) + { + if (numArray1[index8] > 0) + { + cInv[index7].SetDefaults(71 + index8); + cInv[index7].stack = numArray1[index8]; + if (cInv[index7].stack > cInv[index7].maxStack) + cInv[index7].stack = cInv[index7].maxStack; + numArray1[index8] -= cInv[index7].stack; + break; + } + } + if (Main.netMode == 1 && Main.player[Main.myPlayer].chest > -1) + NetMessage.SendData(32, number: Main.player[Main.myPlayer].chest, number2: ((float) intList2[0])); + intList2.RemoveAt(0); + } + while (intList1.Count > 0) + { + int index9 = intList1[0]; + for (int index10 = 3; index10 >= 0; --index10) + { + if (numArray1[index10] > 0) + { + pInv[index9].SetDefaults(71 + index10); + pInv[index9].stack = numArray1[index10]; + if (pInv[index9].stack > pInv[index9].maxStack) + pInv[index9].stack = pInv[index9].maxStack; + numArray1[index10] -= pInv[index9].stack; + } + } + intList1.RemoveAt(0); + } + } + + protected void DrawNPCHouse() + { + for (int n = 0; n < 200; ++n) + { + if (Main.npc[n].active && Main.npc[n].townNPC && !Main.npc[n].homeless && Main.npc[n].homeTileX > 0 && Main.npc[n].homeTileY > 0 && Main.npc[n].type != 37) + { + int index1 = 0; + int homeTileX = Main.npc[n].homeTileX; + int index2 = Main.npc[n].homeTileY - 1; + if (WorldGen.TownManager.FindOccupation(homeTileX, index2 + 1) == Main.npc[n].type) + index1 = 1; if (Main.tile[homeTileX, index2] != null) { bool flag = false; @@ -28413,46 +29345,39 @@ label_56: } if (!flag) { - int num3 = 8; - int num4 = 18; + int num1 = 8; + int num2 = 18; if (Main.tile[homeTileX, index2].type == (ushort) 19) - num4 -= 8; + num2 -= 8; int y = index2 + 1; - int num5 = 0; - float num6 = (float) (y * 16) + (float) num2; + int num3 = 0; + float num4 = (float) (y * 16); SpriteEffects effects = SpriteEffects.None; - Texture2D texture2D = TextureAssets.HouseBanner.Value; - Microsoft.Xna.Framework.Rectangle rectangle = texture2D.Frame(2, 2); - if (bannerStyle > 0) - rectangle.X += rectangle.Width * bannerStyle; - if (housingCategory > 0) - rectangle.Y += rectangle.Height * housingCategory; + Texture2D texture = Main.HouseBannerTexture[index1]; if ((double) Main.player[Main.myPlayer].gravDir == -1.0) { - float num7 = num6 - Main.screenPosition.Y; - num6 = Main.screenPosition.Y + (float) Main.screenHeight - num7 - (float) rectangle.Height; + float num5 = num4 - Main.screenPosition.Y; + num4 = Main.screenPosition.Y + (float) Main.screenHeight - num5 - (float) texture.Height; effects = SpriteEffects.FlipVertically; - num5 = 4; + num3 = 4; } - Main.spriteBatch.Draw(texture2D, new Vector2((float) (homeTileX * 16 - (int) Main.screenPosition.X + num3), num6 - (float) (int) Main.screenPosition.Y + (float) num4 + (float) num5), new Microsoft.Xna.Framework.Rectangle?(rectangle), Lighting.GetColor(homeTileX, y), 0.0f, new Vector2((float) (rectangle.Width / 2), (float) (rectangle.Height / 2)), 1f, effects, 0.0f); - ITownNPCProfile profile; - int index5 = !TownNPCProfiles.Instance.GetProfile(npc.type, out profile) ? NPC.TypeToDefaultHeadIndex(npc.type) : profile.GetHeadTextureIndex(npc); + Main.spriteBatch.Draw(texture, new Vector2((float) (homeTileX * 16 - (int) Main.screenPosition.X + num1), num4 - (float) (int) Main.screenPosition.Y + (float) num2 + (float) num3), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, texture.Width, texture.Height)), Lighting.GetColor(homeTileX, y), 0.0f, new Vector2((float) (texture.Width / 2), (float) (texture.Height / 2)), 1f, effects, 0.0f); + int headIndex = NPC.TypeToHeadIndex(Main.npc[n].type); float scale = 1f; - float num8 = TextureAssets.NpcHead[index5].Width() <= TextureAssets.NpcHead[index5].Height() ? (float) TextureAssets.NpcHead[index5].Height() : (float) TextureAssets.NpcHead[index5].Width(); - if ((double) num8 > 24.0) - scale = 24f / num8; - Main.spriteBatch.Draw(TextureAssets.NpcHead[index5].Value, new Vector2((float) (homeTileX * 16 - (int) Main.screenPosition.X + num3), (float) ((double) num6 - (double) (int) Main.screenPosition.Y + (double) num4 + 2.0)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.NpcHead[index5].Width(), TextureAssets.NpcHead[index5].Height())), Lighting.GetColor(homeTileX, y), 0.0f, new Vector2((float) (TextureAssets.NpcHead[index5].Width() / 2), (float) (TextureAssets.NpcHead[index5].Height() / 2)), scale, effects, 0.0f); - int num9 = homeTileX * 16 - (int) Main.screenPosition.X + num3 - rectangle.Width / 2; - int num10 = (int) num6 - (int) Main.screenPosition.Y + 4; - int num11 = -8; - if (Main.mouseX >= num9 && Main.mouseX <= num9 + rectangle.Width && Main.mouseY >= num10 && Main.mouseY <= num10 + rectangle.Height + num11) + float num6 = Main.npcHeadTexture[headIndex].Width <= Main.npcHeadTexture[headIndex].Height ? (float) Main.npcHeadTexture[headIndex].Height : (float) Main.npcHeadTexture[headIndex].Width; + if ((double) num6 > 24.0) + scale = 24f / num6; + Main.spriteBatch.Draw(Main.npcHeadTexture[headIndex], new Vector2((float) (homeTileX * 16 - (int) Main.screenPosition.X + num1), (float) ((double) num4 - (double) (int) Main.screenPosition.Y + (double) num2 + 2.0)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.npcHeadTexture[headIndex].Width, Main.npcHeadTexture[headIndex].Height)), Lighting.GetColor(homeTileX, y), 0.0f, new Vector2((float) (Main.npcHeadTexture[headIndex].Width / 2), (float) (Main.npcHeadTexture[headIndex].Height / 2)), scale, effects, 0.0f); + int num7 = homeTileX * 16 - (int) Main.screenPosition.X + num1 - texture.Width / 2; + int num8 = y * 16 - (int) Main.screenPosition.Y + num2 - texture.Height / 2; + if (Main.mouseX >= num7 && Main.mouseX <= num7 + texture.Width && Main.mouseY >= num8 && Main.mouseY <= num8 + texture.Height) { - this.MouseText(Lang.GetNPCHouseBannerText(npc, bannerStyle)); + this.MouseText(Main.npc[n].FullName); if (Main.mouseRightRelease && Main.mouseRight) { Main.mouseRightRelease = false; WorldGen.kickOut(n); - SoundEngine.PlaySound(12); + Main.PlaySound(12); } } } @@ -28463,18 +29388,18 @@ label_56: public void DrawWindowsIMEPanel(Vector2 position, float xAnchor = 0.0f) { - if (!Platform.Get().IsCandidateListVisible) + if (!((Platform) Platform.Current).Ime.IsCandidateListVisible) return; List stringList = new List(); - for (uint index = 0; index < Platform.Get().CandidateCount; ++index) + for (uint index = 0; index < ((Platform) Platform.Current).Ime.CandidateCount; ++index) { - string candidate = Platform.Get().GetCandidate(index); + string candidate = ((Platform) Platform.Current).Ime.GetCandidate(index); stringList.Add(candidate); } if (stringList.Count == 0) return; - uint selectedCandidate = Platform.Get().SelectedCandidate; - DynamicSpriteFont dynamicSpriteFont = FontAssets.MouseText.Value; + uint selectedCandidate = ((Platform) Platform.Current).Ime.SelectedCandidate; + DynamicSpriteFont fontMouseText = Main.fontMouseText; float scale = 0.85f; float num1 = 14f; float num2 = 0.0f; @@ -28488,7 +29413,7 @@ label_56: string format = str1; if (index < stringList.Count - 1) format += str2; - width = width + dynamicSpriteFont.MeasureString(string.Format(format, (object) num4, (object) stringList[index])).X * scale + num1; + width = width + fontMouseText.MeasureString(string.Format(format, (object) num4, (object) stringList[index])).X * scale + num1; } Vector2 vector2_1 = new Vector2(width * -xAnchor, 0.0f); Utils.DrawSettings2Panel(Main.spriteBatch, position + vector2_1 + new Vector2(0.0f, (float) -num3), width, new Microsoft.Xna.Framework.Color(63, 65, 151, (int) byte.MaxValue) * 0.785f); @@ -28503,7 +29428,7 @@ label_56: if ((long) index < (long) (stringList.Count - 1)) format += str2; string text = string.Format(format, (object) num5, (object) stringList[(int) index]); - Vector2 vector2_2 = dynamicSpriteFont.MeasureString(text) * scale; + Vector2 vector2_2 = fontMouseText.MeasureString(text) * scale; Utils.DrawBorderString(Main.spriteBatch, text, pos, color, scale, anchory: 0.4f); pos.X += vector2_2.X + num1; } @@ -28515,9 +29440,9 @@ label_56: return; this._imeToggle = PlayerInput.WritingText; if (this._imeToggle) - Platform.Get().Enable(); + ((Platform) Platform.Current).Ime.Enable(); else - Platform.Get().Disable(); + ((Platform) Platform.Current).Ime.Disable(); } protected void DrawPlayerChat() @@ -28539,35 +29464,35 @@ label_56: { int num1 = Main.screenWidth - 300; int num2 = 78; - Main.spriteBatch.Draw(TextureAssets.TextBack.Value, new Vector2((float) num2, (float) (Main.screenHeight - 36)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.TextBack.Width() - 100, TextureAssets.TextBack.Height())), new Microsoft.Xna.Framework.Color(100, 100, 100, 100), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.textBackTexture, new Vector2((float) num2, (float) (Main.screenHeight - 36)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.textBackTexture.Width - 100, Main.textBackTexture.Height)), new Microsoft.Xna.Framework.Color(100, 100, 100, 100), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); int num3 = num1 - 400; int num4 = num2 + 400; while (num3 > 0) { if (num3 > 300) { - Main.spriteBatch.Draw(TextureAssets.TextBack.Value, new Vector2((float) num4, (float) (Main.screenHeight - 36)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(100, 0, TextureAssets.TextBack.Width() - 200, TextureAssets.TextBack.Height())), new Microsoft.Xna.Framework.Color(100, 100, 100, 100), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.textBackTexture, new Vector2((float) num4, (float) (Main.screenHeight - 36)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(100, 0, Main.textBackTexture.Width - 200, Main.textBackTexture.Height)), new Microsoft.Xna.Framework.Color(100, 100, 100, 100), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); num3 -= 300; num4 += 300; } else { - Main.spriteBatch.Draw(TextureAssets.TextBack.Value, new Vector2((float) num4, (float) (Main.screenHeight - 36)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(TextureAssets.TextBack.Width() - num3, 0, TextureAssets.TextBack.Width() - (TextureAssets.TextBack.Width() - num3), TextureAssets.TextBack.Height())), new Microsoft.Xna.Framework.Color(100, 100, 100, 100), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.textBackTexture, new Vector2((float) num4, (float) (Main.screenHeight - 36)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(Main.textBackTexture.Width - num3, 0, Main.textBackTexture.Width - (Main.textBackTexture.Width - num3), Main.textBackTexture.Height)), new Microsoft.Xna.Framework.Color(100, 100, 100, 100), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); num3 = 0; } } } else - Main.spriteBatch.Draw(TextureAssets.TextBack.Value, new Vector2(78f, (float) (Main.screenHeight - 36)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.TextBack.Width(), TextureAssets.TextBack.Height())), new Microsoft.Xna.Framework.Color(100, 100, 100, 100), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.textBackTexture, new Vector2(78f, (float) (Main.screenHeight - 36)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.textBackTexture.Width, Main.textBackTexture.Height)), new Microsoft.Xna.Framework.Color(100, 100, 100, 100), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); int hoveredSnippet = -1; List message = ChatManager.ParseMessage(chatText, Microsoft.Xna.Framework.Color.White); - string compositionString = Platform.Get().CompositionString; + string compositionString = ((Platform) Platform.Current).Ime.CompositionString; if (compositionString != null && compositionString.Length > 0) message.Add(new TextSnippet(compositionString, new Microsoft.Xna.Framework.Color((int) byte.MaxValue, 240, 20))); if (this.textBlinkerState == 1) message.Add(new TextSnippet("|", Microsoft.Xna.Framework.Color.White)); snippets = message.ToArray(); - ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, FontAssets.MouseText.Value, snippets, new Vector2(88f, (float) (Main.screenHeight - 30)), 0.0f, Vector2.Zero, Vector2.One, out hoveredSnippet); + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, Main.fontMouseText, snippets, new Vector2(88f, (float) (Main.screenHeight - 30)), 0.0f, Vector2.Zero, Vector2.One, out hoveredSnippet); if (hoveredSnippet > -1) { snippets[hoveredSnippet].OnHover(); @@ -28575,10 +29500,39 @@ label_56: snippets[hoveredSnippet].OnClick(); } } - Main.chatMonitor.DrawChat(Main.drawingPlayerChat); + int num5 = Main.startChatLine; + int num6 = Main.startChatLine + Main.showCount; + if (num6 >= Main.numChatLines) + { + num6 = --Main.numChatLines; + num5 = num6 - Main.showCount; + } + int num7 = 0; + int index1 = -1; + int index2 = -1; + for (int index3 = num5; index3 < num6; ++index3) + { + if (Main.drawingPlayerChat || Main.chatLine[index3].showTime > 0 && Main.chatLine[index3].text.Length > 0) + { + int hoveredSnippet = -1; + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, Main.fontMouseText, Main.chatLine[index3].parsedText, new Vector2(88f, (float) (Main.screenHeight - 30 - 28 - num7 * 21)), 0.0f, Vector2.Zero, Vector2.One, out hoveredSnippet); + if (hoveredSnippet >= 0 && Main.chatLine[index3].parsedText[hoveredSnippet].CheckForHover) + { + index1 = index3; + index2 = hoveredSnippet; + } + } + ++num7; + } + if (index1 > -1) + { + Main.chatLine[index1].parsedText[index2].OnHover(); + if (Main.mouseLeft && Main.mouseLeftRelease) + Main.chatLine[index1].parsedText[index2].OnClick(); + } if (Main.drawingPlayerChat && snippets != null) { - Vector2 stringSize = ChatManager.GetStringSize(FontAssets.MouseText.Value, snippets, Vector2.Zero); + Vector2 stringSize = ChatManager.GetStringSize(Main.fontMouseText, snippets, Vector2.Zero); this.DrawWindowsIMEPanel(new Vector2(88f, (float) (Main.screenHeight - 30)) + new Vector2(stringSize.X + 10f, -6f)); } TimeLogger.DetailedDrawTime(10); @@ -28588,22 +29542,30 @@ label_56: protected void DrawInventory() { - Recipe.GetThroughDelayedFindRecipes(); if (Main.ShouldPVPDraw) Main.DrawPVPIcons(); - int pivotTopLeftX = 0; - int pivotTopLeftY = 0; - int screenWidth1 = Main.screenWidth; - int num1 = 0; - int screenWidth2 = Main.screenWidth; - int num2 = 0; - Vector2 vector2_1 = new Vector2((float) pivotTopLeftX, (float) pivotTopLeftY); - Vector2 vector2_2 = new Vector2((float) screenWidth1, (float) num1); - Vector2 vector2_3 = new Vector2((float) screenWidth2, (float) num2); - Main.DrawBestiaryIcon(pivotTopLeftX, pivotTopLeftY); - Main.DrawEmoteBubblesButton(pivotTopLeftX, pivotTopLeftY); - Main.DrawTrashItemSlot(pivotTopLeftX, pivotTopLeftY); - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, Lang.inter[4].Value, new Vector2(40f, 0.0f) + vector2_1, new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.inventoryScale = 0.85f; + int num1 = 448; + int num2 = 258; + if ((Main.player[Main.myPlayer].chest != -1 || Main.npcShop > 0) && !Main.recBigList) + { + num2 += 168; + Main.inventoryScale = 0.755f; + num1 += 5; + } + Microsoft.Xna.Framework.Color color1 = new Microsoft.Xna.Framework.Color(150, 150, 150, 150); + if (Main.mouseX >= num1 && (double) Main.mouseX <= (double) num1 + (double) Main.inventoryBackTexture.Width * (double) Main.inventoryScale && Main.mouseY >= num2 && (double) Main.mouseY <= (double) num2 + (double) Main.inventoryBackTexture.Height * (double) Main.inventoryScale && !PlayerInput.IgnoreMouseInterface) + { + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.mouseLeftRelease && Main.mouseLeft) + { + ItemSlot.LeftClick(ref Main.player[Main.myPlayer].trashItem, 6); + Recipe.FindRecipes(); + } + ItemSlot.MouseHover(ref Main.player[Main.myPlayer].trashItem, 6); + } + ItemSlot.Draw(Main.spriteBatch, ref Main.player[Main.myPlayer].trashItem, 6, new Vector2((float) num1, (float) num2)); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, Lang.inter[4].Value, new Vector2(40f, 0.0f), new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); Main.inventoryScale = 0.85f; if (Main.mouseX > 20 && Main.mouseX < (int) (20.0 + 560.0 * (double) Main.inventoryScale) && Main.mouseY > 20 && Main.mouseY < (int) (20.0 + 280.0 * (double) Main.inventoryScale) && !PlayerInput.IgnoreMouseInterface) Main.player[Main.myPlayer].mouseInterface = true; @@ -28611,11 +29573,11 @@ label_56: { for (int index2 = 0; index2 < 5; ++index2) { - int num3 = (int) (20.0 + (double) (index1 * 56) * (double) Main.inventoryScale) + pivotTopLeftX; - int num4 = (int) (20.0 + (double) (index2 * 56) * (double) Main.inventoryScale) + pivotTopLeftY; + int num3 = (int) (20.0 + (double) (index1 * 56) * (double) Main.inventoryScale); + int num4 = (int) (20.0 + (double) (index2 * 56) * (double) Main.inventoryScale); int slot = index1 + index2 * 10; - Microsoft.Xna.Framework.Color color = new Microsoft.Xna.Framework.Color(100, 100, 100, 100); - if (Main.mouseX >= num3 && (double) Main.mouseX <= (double) num3 + (double) TextureAssets.InventoryBack.Width() * (double) Main.inventoryScale && Main.mouseY >= num4 && (double) Main.mouseY <= (double) num4 + (double) TextureAssets.InventoryBack.Height() * (double) Main.inventoryScale && !PlayerInput.IgnoreMouseInterface) + Microsoft.Xna.Framework.Color color2 = new Microsoft.Xna.Framework.Color(100, 100, 100, 100); + if (Main.mouseX >= num3 && (double) Main.mouseX <= (double) num3 + (double) Main.inventoryBackTexture.Width * (double) Main.inventoryScale && Main.mouseY >= num4 && (double) Main.mouseY <= (double) num4 + (double) Main.inventoryBackTexture.Height * (double) Main.inventoryScale && !PlayerInput.IgnoreMouseInterface) { Main.player[Main.myPlayer].mouseInterface = true; ItemSlot.OverrideHover(Main.player[Main.myPlayer].inventory, slot: slot); @@ -28623,57 +29585,79 @@ label_56: Main.player[Main.myPlayer].inventoryChestStack[slot] = false; if (!Main.player[Main.myPlayer].inventoryChestStack[slot]) { - ItemSlot.LeftClick(Main.player[Main.myPlayer].inventory, slot: slot); - ItemSlot.RightClick(Main.player[Main.myPlayer].inventory, slot: slot); if (Main.mouseLeftRelease && Main.mouseLeft) + { + ItemSlot.LeftClick(Main.player[Main.myPlayer].inventory, slot: slot); Recipe.FindRecipes(); + } + else + ItemSlot.RightClick(Main.player[Main.myPlayer].inventory, slot: slot); } ItemSlot.MouseHover(Main.player[Main.myPlayer].inventory, slot: slot); } ItemSlot.Draw(Main.spriteBatch, Main.player[Main.myPlayer].inventory, 0, slot, new Vector2((float) num3, (float) num4)); } } - int totalDrawnIcons; - Main.GetBuilderAccsCountToShow(Main.LocalPlayer, out int _, out int _, out totalDrawnIcons); - bool pushSideToolsUp = totalDrawnIcons >= 10; if (!PlayerInput.UsingGamepad) - this.DrawHotbarLockIcon(pivotTopLeftX, pivotTopLeftY, pushSideToolsUp); - ItemSlot.DrawRadialDpad(Main.spriteBatch, new Vector2(20f) + new Vector2((float) (56.0 * (double) Main.inventoryScale * 10.0), (float) (56.0 * (double) Main.inventoryScale * 5.0)) + new Vector2(26f, 70f) + vector2_1); - if (this._achievementAdvisor.CanDrawAboveCoins) { - int num5 = (int) (20.0 + 560.0 * (double) Main.inventoryScale) + pivotTopLeftX; - int num6 = (int) (20.0 + 0.0 * (double) Main.inventoryScale) + pivotTopLeftY; - this._achievementAdvisor.DrawOneAchievement(Main.spriteBatch, new Vector2((float) num5, (float) num6) + new Vector2(5f), true); + int index = 0; + int num5 = 2; + int num6 = 32; + Player player = Main.player[Main.myPlayer]; + if (player.InfoAccMechShowWires.ToInt() * 6 + player.rulerLine.ToInt() + player.rulerGrid.ToInt() + player.autoActuator.ToInt() + player.autoPaint.ToInt() >= 8) + num6 = 2; + if (!Main.player[Main.myPlayer].hbLocked) + index = 1; + Main.spriteBatch.Draw(Main.HBLockTexture[index], new Vector2((float) num5, (float) num6), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.HBLockTexture[index].Width, Main.HBLockTexture[index].Height)), Main.inventoryBack, 0.0f, new Vector2(), 0.9f, SpriteEffects.None, 0.0f); + if (Main.mouseX > num5 && (double) Main.mouseX < (double) num5 + (double) Main.HBLockTexture[index].Width * 0.899999976158142 && Main.mouseY > num6 && (double) Main.mouseY < (double) num6 + (double) Main.HBLockTexture[index].Height * 0.899999976158142) + { + Main.player[Main.myPlayer].mouseInterface = true; + if (!Main.player[Main.myPlayer].hbLocked) + { + this.MouseText(Lang.inter[5].Value); + Main.mouseText = true; + } + else + { + this.MouseText(Lang.inter[6].Value); + Main.mouseText = true; + } + if (Main.mouseLeft && Main.mouseLeftRelease) + { + Main.PlaySound(22); + Main.player[Main.myPlayer].hbLocked = !Main.player[Main.myPlayer].hbLocked; + } + } } + ItemSlot.DrawRadialDpad(Main.spriteBatch, new Vector2(20f) + new Vector2((float) (56.0 * (double) Main.inventoryScale * 10.0), (float) (56.0 * (double) Main.inventoryScale * 5.0)) + new Vector2(26f, 70f)); if (Main.mapEnabled) { bool flag = false; - int num7 = screenWidth1 - 440; - int num8 = 40 + num1; + int num7 = Main.screenWidth - 440; + int num8 = 40; if (Main.screenWidth < 940) flag = true; if (flag) { - num7 = screenWidth2 - 40; - num8 = num2 - 200; + num7 = Main.screenWidth - 40; + num8 = Main.screenHeight - 200; } - int num9 = 0; for (int index3 = 0; index3 < 4; ++index3) { - int num10 = num7 + index3 * 32 - num9; - int num11 = num8; + int num9 = num7 + index3 * 32; + int num10 = num8; if (flag) { - num10 = num7; - num11 = num8 + index3 * 32 - num9; + num9 = num7; + num10 = num8 + index3 * 32; } int index4 = index3; - int num12 = 120; + int num11 = 120; if (index3 > 0 && Main.mapStyle == index3 - 1) - num12 = 200; - if (Main.mouseX >= num10 && Main.mouseX <= num10 + 32 && Main.mouseY >= num11 && Main.mouseY <= num11 + 30 && !PlayerInput.IgnoreMouseInterface) + num11 = 200; + if (Main.mouseX >= num9 && Main.mouseX <= num9 + 32 && Main.mouseY >= num10 && Main.mouseY <= num10 + 30 && !PlayerInput.IgnoreMouseInterface) { - num12 = (int) byte.MaxValue; + num11 = (int) byte.MaxValue; index4 += 4; Main.player[Main.myPlayer].mouseInterface = true; if (Main.mouseLeft && Main.mouseLeftRelease) @@ -28681,9 +29665,9 @@ label_56: if (index3 == 0) { Main.playerInventory = false; - Main.player[Main.myPlayer].SetTalkNPC(-1); + Main.player[Main.myPlayer].talkNPC = -1; Main.npcChatCornerItem = 0; - SoundEngine.PlaySound(10); + Main.PlaySound(10); Main.mapFullscreenScale = 2.5f; Main.mapFullscreen = true; Main.resetMapFull = true; @@ -28691,21 +29675,21 @@ label_56: if (index3 == 1) { Main.mapStyle = 0; - SoundEngine.PlaySound(12); + Main.PlaySound(12); } if (index3 == 2) { Main.mapStyle = 1; - SoundEngine.PlaySound(12); + Main.PlaySound(12); } if (index3 == 3) { Main.mapStyle = 2; - SoundEngine.PlaySound(12); + Main.PlaySound(12); } } } - Main.spriteBatch.Draw(TextureAssets.MapIcon[index4].Value, new Vector2((float) num10, (float) num11), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.MapIcon[index4].Width(), TextureAssets.MapIcon[index4].Height())), new Microsoft.Xna.Framework.Color(num12, num12, num12, num12), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.mapIconTexture[index4], new Vector2((float) num9, (float) num10), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.mapIconTexture[index4].Width, Main.mapIconTexture[index4].Height)), new Microsoft.Xna.Framework.Color(num11, num11, num11, num11), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } } if (Main.armorHide) @@ -28720,22 +29704,13 @@ label_56: if ((double) Main.armorAlpha > 1.0) Main.armorAlpha = 1f; } - Microsoft.Xna.Framework.Color color1 = new Microsoft.Xna.Framework.Color((int) (byte) ((double) Main.mouseTextColor * (double) Main.armorAlpha), (int) (byte) ((double) Main.mouseTextColor * (double) Main.armorAlpha), (int) (byte) ((double) Main.mouseTextColor * (double) Main.armorAlpha), (int) (byte) ((double) Main.mouseTextColor * (double) Main.armorAlpha)); + Microsoft.Xna.Framework.Color color3 = new Microsoft.Xna.Framework.Color((int) (byte) ((double) Main.mouseTextColor * (double) Main.armorAlpha), (int) (byte) ((double) Main.mouseTextColor * (double) Main.armorAlpha), (int) (byte) ((double) Main.mouseTextColor * (double) Main.armorAlpha), (int) (byte) ((double) Main.mouseTextColor * (double) Main.armorAlpha)); Main.armorHide = false; - int num13 = 8 + Main.player[Main.myPlayer].GetAmountOfExtraAccessorySlotsToShow(); - int num14 = 174 + Main.mH; - int num15 = 950; - Main._cannotDrawAccessoriesHorizontally = false; - if (Main.screenHeight < num15 && num13 >= 10) - { - num14 -= (int) (56.0 * (double) Main.inventoryScale * (double) (num13 - 9)); - Main._cannotDrawAccessoriesHorizontally = true; - } - int num16 = Main.DrawPageIcons(num14 - 32); - if (num16 > -1) + int num12 = Main.DrawPageIcons(); + if (num12 > -1) { Main.HoverItem = new Item(); - switch (num16) + switch (num12) { case 1: Main.hoverItemName = Lang.inter[80].Value; @@ -28751,21 +29726,106 @@ label_56: switch (Main.EquipPage) { case 1: - this.DrawNPCHousesInUI(); + UILinkPointNavigator.Shortcuts.NPCS_LastHovered = -1; + if (Main.mouseX > Main.screenWidth - 64 - 28 && Main.mouseX < (int) ((double) (Main.screenWidth - 64 - 28) + 56.0 * (double) Main.inventoryScale) && Main.mouseY > 174 + Main.mH && Main.mouseY < (int) ((double) (174 + Main.mH) + 448.0 * (double) Main.inventoryScale) && !PlayerInput.IgnoreMouseInterface) + Main.player[Main.myPlayer].mouseInterface = true; + int num13 = 0; + string cursorText = ""; + int num14 = 0; + int num15 = 0; + for (int index5 = 0; index5 < Main.npcHeadTexture.Length; ++index5) + { + bool flag = false; + int index6 = 0; + switch (index5) + { + case 0: + flag = true; + break; + case 21: + flag = false; + break; + default: + for (int index7 = 0; index7 < 200; ++index7) + { + if (Main.npc[index7].active && NPC.TypeToHeadIndex(Main.npc[index7].type) == index5) + { + flag = true; + index6 = index7; + break; + } + } + break; + } + if (flag) + { + int num16 = Main.screenWidth - 64 - 28 + num15; + int num17 = (int) ((double) (174 + Main.mH) + (double) (num13 * 56) * (double) Main.inventoryScale) + num14; + Microsoft.Xna.Framework.Color color4 = new Microsoft.Xna.Framework.Color(100, 100, 100, 100); + if (num17 > Main.screenHeight - 80) + { + num15 -= 48; + num14 -= num17 - (174 + Main.mH); + num16 = Main.screenWidth - 64 - 28 + num15; + num17 = (int) ((double) (174 + Main.mH) + (double) (num13 * 56) * (double) Main.inventoryScale) + num14; + if (UILinkPointNavigator.Shortcuts.NPCS_IconsPerColumn == 100) + UILinkPointNavigator.Shortcuts.NPCS_IconsPerColumn = num13; + } + if (Main.mouseX >= num16 && (double) Main.mouseX <= (double) num16 + (double) Main.inventoryBackTexture.Width * (double) Main.inventoryScale && Main.mouseY >= num17 && (double) Main.mouseY <= (double) num17 + (double) Main.inventoryBackTexture.Height * (double) Main.inventoryScale) + { + UILinkPointNavigator.Shortcuts.NPCS_LastHovered = index6; + Main.mouseText = true; + cursorText = index5 != 0 ? Main.npc[index6].FullName : Lang.inter[8].Value; + if (!PlayerInput.IgnoreMouseInterface) + { + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.mouseLeftRelease && Main.mouseLeft && !PlayerInput.UsingGamepadUI && Main.mouseItem.type == 0) + { + Main.PlaySound(12); + this.mouseNPC = index5; + Main.mouseLeftRelease = false; + } + } + } + UILinkPointNavigator.SetPosition(600 + num13, new Vector2((float) num16, (float) num17) + Main.inventoryBackTexture.Size() * 0.75f); + Texture2D texture = Main.inventoryBack11Texture; + Microsoft.Xna.Framework.Color color5 = Main.inventoryBack; + if (UILinkPointNavigator.CurrentPoint - 600 == num13) + { + texture = Main.inventoryBack14Texture; + color5 = Microsoft.Xna.Framework.Color.White; + } + Main.spriteBatch.Draw(texture, new Vector2((float) num16, (float) num17), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.inventoryBackTexture.Width, Main.inventoryBackTexture.Height)), color5, 0.0f, new Vector2(), Main.inventoryScale, SpriteEffects.None, 0.0f); + color4 = Microsoft.Xna.Framework.Color.White; + int index8 = index5; + float scale = 1f; + float num18 = Main.npcHeadTexture[index8].Width <= Main.npcHeadTexture[index8].Height ? (float) Main.npcHeadTexture[index8].Height : (float) Main.npcHeadTexture[index8].Width; + if ((double) num18 > 36.0) + scale = 36f / num18; + Main.spriteBatch.Draw(Main.npcHeadTexture[index8], new Vector2((float) num16 + 26f * Main.inventoryScale, (float) num17 + 26f * Main.inventoryScale), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.npcHeadTexture[index8].Width, Main.npcHeadTexture[index8].Height)), color4, 0.0f, new Vector2((float) (Main.npcHeadTexture[index8].Width / 2), (float) (Main.npcHeadTexture[index8].Height / 2)), scale, SpriteEffects.None, 0.0f); + ++num13; + } + UILinkPointNavigator.Shortcuts.NPCS_IconsTotal = num13; + } + if (cursorText != "" && Main.mouseItem.type == 0) + { + this.MouseText(cursorText); + break; + } break; case 2: Microsoft.Xna.Framework.Point point1 = new Microsoft.Xna.Framework.Point(Main.mouseX, Main.mouseY); - Microsoft.Xna.Framework.Rectangle r1 = new Microsoft.Xna.Framework.Rectangle(0, 0, (int) ((double) TextureAssets.InventoryBack.Width() * (double) Main.inventoryScale), (int) ((double) TextureAssets.InventoryBack.Height() * (double) Main.inventoryScale)); + Microsoft.Xna.Framework.Rectangle r1 = new Microsoft.Xna.Framework.Rectangle(0, 0, (int) ((double) Main.inventoryBackTexture.Width * (double) Main.inventoryScale), (int) ((double) Main.inventoryBackTexture.Height * (double) Main.inventoryScale)); Item[] inv = Main.player[Main.myPlayer].miscEquips; - int num17 = Main.screenWidth - 92; - int num18 = Main.mH + 174; + int num19 = Main.screenWidth - 92; + int num20 = Main.mH + 174; for (int index = 0; index < 2; ++index) { if (index == 0) inv = Main.player[Main.myPlayer].miscEquips; else if (index == 1) inv = Main.player[Main.myPlayer].miscDyes; - r1.X = num17 + index * -47; + r1.X = num19 + index * -47; for (int slot = 0; slot < 5; ++slot) { int context = 0; @@ -28795,12 +29855,12 @@ label_56: context = 12; key = -1; } - r1.Y = num18 + slot * 47; - Texture2D texture = TextureAssets.InventoryTickOn.Value; + r1.Y = num20 + slot * 47; + Texture2D texture = Main.inventoryTickOnTexture; if (Main.player[Main.myPlayer].hideMisc[key]) - texture = TextureAssets.InventoryTickOff.Value; + texture = Main.inventoryTickOffTexture; Microsoft.Xna.Framework.Rectangle r2 = new Microsoft.Xna.Framework.Rectangle(r1.Left + 34, r1.Top - 2, texture.Width, texture.Height); - int num19 = 0; + int num21 = 0; bool flag = false; if (r2.Contains(point1) && !PlayerInput.IgnoreMouseInterface) { @@ -28813,11 +29873,11 @@ label_56: if (key == 1) Main.player[Main.myPlayer].ToggleLight(); Main.mouseLeftRelease = false; - SoundEngine.PlaySound(12); + Main.PlaySound(12); if (Main.netMode == 1) NetMessage.SendData(4, number: Main.myPlayer); } - num19 = !Main.player[Main.myPlayer].hideMisc[key] ? 1 : 2; + num21 = !Main.player[Main.myPlayer].hideMisc[key] ? 1 : 2; } if (r1.Contains(point1) && !flag && !PlayerInput.IgnoreMouseInterface) { @@ -28829,230 +29889,237 @@ label_56: if (key != -1) { Main.spriteBatch.Draw(texture, r2.TopLeft(), Microsoft.Xna.Framework.Color.White * 0.7f); - if (num19 > 0) + if (num21 > 0) { Main.HoverItem = new Item(); - Main.hoverItemName = Lang.inter[58 + num19].Value; + Main.hoverItemName = Lang.inter[58 + num21].Value; } } } } - int num20 = num18 + 247; - int num21 = num17 + 8; + int num22 = num20 + 247; + int num23 = num19 + 8; int drawBuffText = -1; - int num22 = 0; - int num23 = 3; - int num24 = 260; - if (Main.screenHeight > 630 + num24 * (Main.mapStyle == 1).ToInt()) - ++num23; - if (Main.screenHeight > 680 + num24 * (Main.mapStyle == 1).ToInt()) - ++num23; - if (Main.screenHeight > 730 + num24 * (Main.mapStyle == 1).ToInt()) - ++num23; - int num25 = 46; - for (int buffSlotOnPlayer = 0; buffSlotOnPlayer < 22; ++buffSlotOnPlayer) + int num24 = 0; + int num25 = 3; + int num26 = 260; + if (Main.screenHeight > 630 + num26 * (Main.mapStyle == 1).ToInt()) + ++num25; + if (Main.screenHeight > 680 + num26 * (Main.mapStyle == 1).ToInt()) + ++num25; + if (Main.screenHeight > 730 + num26 * (Main.mapStyle == 1).ToInt()) + ++num25; + int num27 = 46; + for (int i = 0; i < 22; ++i) { - if (Main.player[Main.myPlayer].buffType[buffSlotOnPlayer] != 0) + int b = Main.player[Main.myPlayer].buffType[i]; + if (b != 0) { - int num26 = num22 / num23; - int num27 = num22 % num23; - Microsoft.Xna.Framework.Point point2 = new Microsoft.Xna.Framework.Point(num21 + num26 * -num25, num20 + num27 * num25); - drawBuffText = Main.DrawBuffIcon(drawBuffText, buffSlotOnPlayer, point2.X, point2.Y); - UILinkPointNavigator.SetPosition(9000 + num22, new Vector2((float) (point2.X + 30), (float) (point2.Y + 30))); - ++num22; - if ((double) Main.buffAlpha[buffSlotOnPlayer] < 0.649999976158142) - Main.buffAlpha[buffSlotOnPlayer] = 0.65f; + int num28 = num24 / num25; + int num29 = num24 % num25; + Microsoft.Xna.Framework.Point point2 = new Microsoft.Xna.Framework.Point(num23 + num28 * -num27, num22 + num29 * num27); + drawBuffText = Main.DrawBuffIcon(drawBuffText, i, b, point2.X, point2.Y); + UILinkPointNavigator.SetPosition(9000 + num24, new Vector2((float) (point2.X + 30), (float) (point2.Y + 30))); + ++num24; + if ((double) Main.buffAlpha[i] < 0.649999976158142) + Main.buffAlpha[i] = 0.65f; } } - UILinkPointNavigator.Shortcuts.BUFFS_DRAWN = num22; - UILinkPointNavigator.Shortcuts.BUFFS_PER_COLUMN = num23; + UILinkPointNavigator.Shortcuts.BUFFS_DRAWN = num24; + UILinkPointNavigator.Shortcuts.BUFFS_PER_COLUMN = num25; if (drawBuffText >= 0) { - int index = Main.player[Main.myPlayer].buffType[drawBuffText]; - if (index > 0) + int id = Main.player[Main.myPlayer].buffType[drawBuffText]; + if (id > 0) { - string buffName = Lang.GetBuffName(index); - string buffTooltip = Main.GetBuffTooltip(Main.player[Main.myPlayer], index); - if (index == 147) + Main.buffString = Lang.GetBuffDescription(id); + if (id == 26 && Main.expertMode) + Main.buffString = Language.GetTextValue("BuffDescription.WellFed_Expert"); + if (id == 147) Main.bannerMouseOver = true; - if (Main.meleeBuff[index]) + if (id == 94) { - this.MouseTextHackZoom(buffName, -10, buffTooltip: buffTooltip); + int num30 = (int) ((double) Main.player[Main.myPlayer].manaSickReduction * 100.0) + 1; + Main.buffString = Main.buffString + (object) num30 + "%"; + } + if (Main.meleeBuff[id]) + { + this.MouseTextHackZoom(Lang.GetBuffName(id), -10); break; } - this.MouseTextHackZoom(buffName, buffTooltip); + this.MouseTextHackZoom(Lang.GetBuffName(id)); break; } break; } break; default: - int num28 = 4; - if (Main.mouseX > Main.screenWidth - 64 - 28 && Main.mouseX < (int) ((double) (Main.screenWidth - 64 - 28) + 56.0 * (double) Main.inventoryScale) && Main.mouseY > num14 && Main.mouseY < (int) ((double) num14 + 448.0 * (double) Main.inventoryScale) && !PlayerInput.IgnoreMouseInterface) + int num31 = 4; + if (Main.mouseX > Main.screenWidth - 64 - 28 && Main.mouseX < (int) ((double) (Main.screenWidth - 64 - 28) + 56.0 * (double) Main.inventoryScale) && Main.mouseY > 174 + Main.mH && Main.mouseY < (int) ((double) (174 + Main.mH) + 448.0 * (double) Main.inventoryScale) && !PlayerInput.IgnoreMouseInterface) Main.player[Main.myPlayer].mouseInterface = true; float inventoryScale = Main.inventoryScale; + int num32 = 8 + Main.player[Main.myPlayer].extraAccessorySlots; bool flag1 = false; - int num29 = num13 - 1; - bool flag2 = Main.LocalPlayer.CanDemonHeartAccessoryBeShown(); - bool flag3 = Main.LocalPlayer.CanMasterModeAccessoryBeShown(); - if (Main._settingsButtonIsPushedToSide) - --num29; - int num30 = num29 - 1; + int num33 = num32 - 1; + if (num32 == 8 && (Main.player[Main.myPlayer].armor[8].type > 0 || Main.player[Main.myPlayer].armor[18].type > 0 || Main.player[Main.myPlayer].dye[8].type > 0)) + { + num32 = 9; + flag1 = true; + num33 = 7; + } + if (Main.screenHeight < 900 && num33 == 8) + --num33; Microsoft.Xna.Framework.Color inventoryBack1 = Main.inventoryBack; - Microsoft.Xna.Framework.Color color2 = new Microsoft.Xna.Framework.Color(80, 80, 80, 80); - int num31 = -1; - for (int slot = 0; slot < 10; ++slot) + Microsoft.Xna.Framework.Color color6 = new Microsoft.Xna.Framework.Color(80, 80, 80, 80); + for (int slot = 0; slot < num32; ++slot) { - if ((slot != 8 || flag2) && (slot != 9 || flag3)) + bool flag2 = false; + if (flag1 && slot == num32 - 1 && Main.mouseItem.type > 0) + flag2 = true; + int num34 = Main.screenWidth - 64 - 28; + int num35 = (int) ((double) (174 + Main.mH) + (double) (slot * 56) * (double) Main.inventoryScale); + Microsoft.Xna.Framework.Color color7 = new Microsoft.Xna.Framework.Color(100, 100, 100, 100); + if (slot > 2) + num35 += num31; + if (slot == num33) { - ++num31; - bool flag4 = Main.LocalPlayer.IsAValidEquipmentSlotForIteration(slot); - if (!flag4) - flag1 = true; - int inventoryX = Main.screenWidth - 64 - 28; - int inventoryY = (int) ((double) num14 + (double) (num31 * 56) * (double) Main.inventoryScale); - Microsoft.Xna.Framework.Color color3 = new Microsoft.Xna.Framework.Color(100, 100, 100, 100); - int x = Main.screenWidth - 58; - int y = (int) ((double) (num14 - 2) + (double) (num31 * 56) * (double) Main.inventoryScale); - int context = 8; - if (slot > 2) - { - inventoryY += num28; - y += num28; - context = 10; - } - if (num31 == num30 && !this._achievementAdvisor.CanDrawAboveCoins) - { - this._achievementAdvisor.DrawOneAchievement(Main.spriteBatch, new Vector2((float) (inventoryX - 10 - 47 - 47 - 14 - 14), (float) (inventoryY + 8)), false); - UILinkPointNavigator.SetPosition(1570, new Vector2((float) (inventoryX - 10 - 47 - 47 - 14 - 14), (float) (inventoryY + 8)) + new Vector2(20f) * Main.inventoryScale); - } - if (num31 == num29) - Main.DrawDefenseCounter(inventoryX, inventoryY); - Texture2D texture = TextureAssets.InventoryTickOn.Value; - if (Main.player[Main.myPlayer].hideVisibleAccessory[slot]) - texture = TextureAssets.InventoryTickOff.Value; - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(x, y, texture.Width, texture.Height); - int num32 = 0; - if (slot > 2 && rectangle.Contains(new Microsoft.Xna.Framework.Point(Main.mouseX, Main.mouseY)) && !PlayerInput.IgnoreMouseInterface) + Vector2 vector2_1 = new Vector2((float) (num34 - 10 - 47 - 47 - 14), (float) num35 + (float) Main.inventoryBackTexture.Height * 0.5f); + Main.spriteBatch.Draw(Main.extraTexture[58], vector2_1, new Microsoft.Xna.Framework.Rectangle?(), Microsoft.Xna.Framework.Color.White, 0.0f, Main.extraTexture[58].Size() / 2f, Main.inventoryScale, SpriteEffects.None, 0.0f); + Vector2 vector2_2 = Main.fontMouseText.MeasureString(Main.player[Main.myPlayer].statDefense.ToString()); + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, Main.fontMouseText, Main.player[Main.myPlayer].statDefense.ToString(), vector2_1 - vector2_2 * 0.5f * Main.inventoryScale, Microsoft.Xna.Framework.Color.White, 0.0f, Vector2.Zero, new Vector2(Main.inventoryScale)); + if (Utils.CenteredRectangle(vector2_1, Main.extraTexture[58].Size()).Contains(new Microsoft.Xna.Framework.Point(Main.mouseX, Main.mouseY)) && !PlayerInput.IgnoreMouseInterface) { Main.player[Main.myPlayer].mouseInterface = true; - if (Main.mouseLeft && Main.mouseLeftRelease) - { - Main.player[Main.myPlayer].hideVisibleAccessory[slot] = !Main.player[Main.myPlayer].hideVisibleAccessory[slot]; - SoundEngine.PlaySound(12); - if (Main.netMode == 1) - NetMessage.SendData(4, number: Main.myPlayer); - } - num32 = !Main.player[Main.myPlayer].hideVisibleAccessory[slot] ? 1 : 2; + string str = Main.player[Main.myPlayer].statDefense.ToString() + " " + Lang.inter[10].Value; + if (!string.IsNullOrEmpty(str)) + Main.hoverItemName = str; } - else if (Main.mouseX >= inventoryX && (double) Main.mouseX <= (double) inventoryX + (double) TextureAssets.InventoryBack.Width() * (double) Main.inventoryScale && Main.mouseY >= inventoryY && (double) Main.mouseY <= (double) inventoryY + (double) TextureAssets.InventoryBack.Height() * (double) Main.inventoryScale && !PlayerInput.IgnoreMouseInterface) + UILinkPointNavigator.SetPosition(1557, vector2_1 + Main.extraTexture[58].Size() * Main.inventoryScale / 4f); + } + int context = 8; + if (slot > 2) + context = 10; + Texture2D texture = Main.inventoryTickOnTexture; + if (Main.player[Main.myPlayer].hideVisual[slot]) + texture = Main.inventoryTickOffTexture; + int x = Main.screenWidth - 58; + int y = (int) ((double) (172 + Main.mH) + (double) (slot * 56) * (double) Main.inventoryScale); + if (slot > 2) + y += num31; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(x, y, texture.Width, texture.Height); + int num36 = 0; + if (slot >= 3 && slot < num32 && rectangle.Contains(new Microsoft.Xna.Framework.Point(Main.mouseX, Main.mouseY)) && !PlayerInput.IgnoreMouseInterface) + { + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.mouseLeft && Main.mouseLeftRelease) { - Main.armorHide = true; - Main.player[Main.myPlayer].mouseInterface = true; - ItemSlot.OverrideHover(Main.player[Main.myPlayer].armor, context, slot); - if ((flag4 ? 0 : (!Main.mouseItem.IsAir ? 1 : 0)) == 0) - ItemSlot.LeftClick(Main.player[Main.myPlayer].armor, context, slot); - ItemSlot.MouseHover(Main.player[Main.myPlayer].armor, context, slot); + Main.player[Main.myPlayer].hideVisual[slot] = !Main.player[Main.myPlayer].hideVisual[slot]; + Main.PlaySound(12); + if (Main.netMode == 1) + NetMessage.SendData(4, number: Main.myPlayer); } - if (flag1) - Main.inventoryBack = color2; - ItemSlot.Draw(Main.spriteBatch, Main.player[Main.myPlayer].armor, context, slot, new Vector2((float) inventoryX, (float) inventoryY)); - if (slot > 2) + num36 = !Main.player[Main.myPlayer].hideVisual[slot] ? 1 : 2; + } + else if (Main.mouseX >= num34 && (double) Main.mouseX <= (double) num34 + (double) Main.inventoryBackTexture.Width * (double) Main.inventoryScale && Main.mouseY >= num35 && (double) Main.mouseY <= (double) num35 + (double) Main.inventoryBackTexture.Height * (double) Main.inventoryScale && !PlayerInput.IgnoreMouseInterface) + { + Main.armorHide = true; + Main.player[Main.myPlayer].mouseInterface = true; + ItemSlot.OverrideHover(Main.player[Main.myPlayer].armor, context, slot); + if (!flag2 && Main.mouseLeftRelease && Main.mouseLeft) + ItemSlot.LeftClick(Main.player[Main.myPlayer].armor, context, slot); + ItemSlot.MouseHover(Main.player[Main.myPlayer].armor, context, slot); + } + if (flag1 && slot == num32 - 1) + Main.inventoryBack = color6; + ItemSlot.Draw(Main.spriteBatch, Main.player[Main.myPlayer].armor, context, slot, new Vector2((float) num34, (float) num35)); + if (slot > 2 && slot < num32) + { + Main.spriteBatch.Draw(texture, new Vector2((float) x, (float) y), Microsoft.Xna.Framework.Color.White * 0.7f); + if (num36 > 0) { - Main.spriteBatch.Draw(texture, new Vector2((float) x, (float) y), Microsoft.Xna.Framework.Color.White * 0.7f); - if (num32 > 0) - { - Main.HoverItem = new Item(); - Main.hoverItemName = Lang.inter[58 + num32].Value; - } + Main.HoverItem = new Item(); + Main.hoverItemName = Lang.inter[58 + num36].Value; } } } Main.inventoryBack = inventoryBack1; - if (Main.mouseX > Main.screenWidth - 64 - 28 - 47 && Main.mouseX < (int) ((double) (Main.screenWidth - 64 - 20 - 47) + 56.0 * (double) Main.inventoryScale) && Main.mouseY > num14 && Main.mouseY < (int) ((double) num14 + 168.0 * (double) Main.inventoryScale) && !PlayerInput.IgnoreMouseInterface) + if (Main.mouseX > Main.screenWidth - 64 - 28 - 47 && Main.mouseX < (int) ((double) (Main.screenWidth - 64 - 20 - 47) + 56.0 * (double) Main.inventoryScale) && Main.mouseY > 174 + Main.mH && Main.mouseY < (int) ((double) (174 + Main.mH) + 168.0 * (double) Main.inventoryScale) && !PlayerInput.IgnoreMouseInterface) Main.player[Main.myPlayer].mouseInterface = true; - int num33 = -1; - for (int slot = 10; slot < 20; ++slot) + for (int slot = 10; slot < 10 + num32; ++slot) { - if ((slot != 18 || flag2) && (slot != 19 || flag3)) + bool flag3 = false; + if (flag1 && slot == 10 + num32 - 1 && Main.mouseItem.type > 0) + flag3 = true; + int num37 = Main.screenWidth - 64 - 28 - 47; + int num38 = (int) ((double) (174 + Main.mH) + (double) ((slot - 10) * 56) * (double) Main.inventoryScale); + Microsoft.Xna.Framework.Color color8 = new Microsoft.Xna.Framework.Color(100, 100, 100, 100); + if (slot > 12) + num38 += num31; + int context = 9; + if (slot > 12) + context = 11; + if (Main.mouseX >= num37 && (double) Main.mouseX <= (double) num37 + (double) Main.inventoryBackTexture.Width * (double) Main.inventoryScale && Main.mouseY >= num38 && (double) Main.mouseY <= (double) num38 + (double) Main.inventoryBackTexture.Height * (double) Main.inventoryScale && !PlayerInput.IgnoreMouseInterface) { - ++num33; - int num34 = Main.LocalPlayer.IsAValidEquipmentSlotForIteration(slot) ? 1 : 0; - bool flag5 = num34 == 0; - bool flag6 = num34 == 0 && !Main.mouseItem.IsAir; - int num35 = Main.screenWidth - 64 - 28 - 47; - int num36 = (int) ((double) num14 + (double) (num33 * 56) * (double) Main.inventoryScale); - Microsoft.Xna.Framework.Color color4 = new Microsoft.Xna.Framework.Color(100, 100, 100, 100); - if (slot > 12) - num36 += num28; - int context = 9; - if (slot > 12) - context = 11; - if (Main.mouseX >= num35 && (double) Main.mouseX <= (double) num35 + (double) TextureAssets.InventoryBack.Width() * (double) Main.inventoryScale && Main.mouseY >= num36 && (double) Main.mouseY <= (double) num36 + (double) TextureAssets.InventoryBack.Height() * (double) Main.inventoryScale && !PlayerInput.IgnoreMouseInterface) + Main.player[Main.myPlayer].mouseInterface = true; + Main.armorHide = true; + ItemSlot.OverrideHover(Main.player[Main.myPlayer].armor, context, slot); + if (!flag3) { - Main.player[Main.myPlayer].mouseInterface = true; - Main.armorHide = true; - ItemSlot.OverrideHover(Main.player[Main.myPlayer].armor, context, slot); - if (!flag6) - { + if (Main.mouseLeftRelease && Main.mouseLeft) ItemSlot.LeftClick(Main.player[Main.myPlayer].armor, context, slot); + else ItemSlot.RightClick(Main.player[Main.myPlayer].armor, context, slot); - } - ItemSlot.MouseHover(Main.player[Main.myPlayer].armor, context, slot); } - if (flag5) - Main.inventoryBack = color2; - ItemSlot.Draw(Main.spriteBatch, Main.player[Main.myPlayer].armor, context, slot, new Vector2((float) num35, (float) num36)); + ItemSlot.MouseHover(Main.player[Main.myPlayer].armor, context, slot); } + if (flag1 && slot == num32 + 10 - 1) + Main.inventoryBack = color6; + ItemSlot.Draw(Main.spriteBatch, Main.player[Main.myPlayer].armor, context, slot, new Vector2((float) num37, (float) num38)); } Main.inventoryBack = inventoryBack1; - if (Main.mouseX > Main.screenWidth - 64 - 28 - 47 && Main.mouseX < (int) ((double) (Main.screenWidth - 64 - 20 - 47) + 56.0 * (double) Main.inventoryScale) && Main.mouseY > num14 && Main.mouseY < (int) ((double) num14 + 168.0 * (double) Main.inventoryScale) && !PlayerInput.IgnoreMouseInterface) + if (Main.mouseX > Main.screenWidth - 64 - 28 - 47 && Main.mouseX < (int) ((double) (Main.screenWidth - 64 - 20 - 47) + 56.0 * (double) Main.inventoryScale) && Main.mouseY > 174 + Main.mH && Main.mouseY < (int) ((double) (174 + Main.mH) + 168.0 * (double) Main.inventoryScale) && !PlayerInput.IgnoreMouseInterface) Main.player[Main.myPlayer].mouseInterface = true; - int num37 = -1; - for (int slot = 0; slot < 10; ++slot) + for (int slot = 0; slot < num32; ++slot) { - if ((slot != 8 || flag2) && (slot != 9 || flag3)) + bool flag4 = false; + if (flag1 && slot == num32 - 1 && Main.mouseItem.type > 0) + flag4 = true; + int num39 = Main.screenWidth - 64 - 28 - 47 - 47; + int num40 = (int) ((double) (174 + Main.mH) + (double) (slot * 56) * (double) Main.inventoryScale); + Microsoft.Xna.Framework.Color color9 = new Microsoft.Xna.Framework.Color(100, 100, 100, 100); + if (slot > 2) + num40 += num31; + if (Main.mouseX >= num39 && (double) Main.mouseX <= (double) num39 + (double) Main.inventoryBackTexture.Width * (double) Main.inventoryScale && Main.mouseY >= num40 && (double) Main.mouseY <= (double) num40 + (double) Main.inventoryBackTexture.Height * (double) Main.inventoryScale && !PlayerInput.IgnoreMouseInterface) { - ++num37; - int num38 = Main.LocalPlayer.IsAValidEquipmentSlotForIteration(slot) ? 1 : 0; - bool flag7 = num38 == 0; - bool flag8 = num38 == 0 && !Main.mouseItem.IsAir; - int num39 = Main.screenWidth - 64 - 28 - 47 - 47; - int num40 = (int) ((double) num14 + (double) (num37 * 56) * (double) Main.inventoryScale); - Microsoft.Xna.Framework.Color color5 = new Microsoft.Xna.Framework.Color(100, 100, 100, 100); - if (slot > 2) - num40 += num28; - if (Main.mouseX >= num39 && (double) Main.mouseX <= (double) num39 + (double) TextureAssets.InventoryBack.Width() * (double) Main.inventoryScale && Main.mouseY >= num40 && (double) Main.mouseY <= (double) num40 + (double) TextureAssets.InventoryBack.Height() * (double) Main.inventoryScale && !PlayerInput.IgnoreMouseInterface) + Main.player[Main.myPlayer].mouseInterface = true; + Main.armorHide = true; + ItemSlot.OverrideHover(Main.player[Main.myPlayer].dye, 12, slot); + if (!flag4) { - Main.player[Main.myPlayer].mouseInterface = true; - Main.armorHide = true; - ItemSlot.OverrideHover(Main.player[Main.myPlayer].dye, 12, slot); - if (!flag8) - { - if (Main.mouseRightRelease && Main.mouseRight) - ItemSlot.RightClick(Main.player[Main.myPlayer].dye, 12, slot); + if (Main.mouseRightRelease && Main.mouseRight) + ItemSlot.RightClick(Main.player[Main.myPlayer].dye, 12, slot); + else if (Main.mouseLeftRelease && Main.mouseLeft) ItemSlot.LeftClick(Main.player[Main.myPlayer].dye, 12, slot); - } - ItemSlot.MouseHover(Main.player[Main.myPlayer].dye, 12, slot); } - if (flag7) - Main.inventoryBack = color2; - ItemSlot.Draw(Main.spriteBatch, Main.player[Main.myPlayer].dye, 12, slot, new Vector2((float) num39, (float) num40)); + ItemSlot.MouseHover(Main.player[Main.myPlayer].dye, 12, slot); } + if (flag1 && slot == num32 - 1) + Main.inventoryBack = color6; + ItemSlot.Draw(Main.spriteBatch, Main.player[Main.myPlayer].dye, 12, slot, new Vector2((float) num39, (float) num40)); } Main.inventoryBack = inventoryBack1; Main.inventoryScale = inventoryScale; break; } - int adjY = (Main.screenHeight - 600) / 2; - int num41 = (int) ((double) Main.screenHeight / 600.0 * 250.0); + int num41 = (Main.screenHeight - 600) / 2; + int num42 = (int) ((double) Main.screenHeight / 600.0 * 250.0); if (Main.screenHeight < 700) { - adjY = (Main.screenHeight - 508) / 2; - num41 = (int) ((double) Main.screenHeight / 600.0 * 200.0); + num41 = (Main.screenHeight - 508) / 2; + num42 = (int) ((double) Main.screenHeight / 600.0 * 200.0); } else if (Main.screenHeight < 850) - num41 = (int) ((double) Main.screenHeight / 600.0 * 225.0); + num42 = (int) ((double) Main.screenHeight / 600.0 * 225.0); if (Main.craftingHide) { Main.craftingAlpha -= 0.1f; @@ -29065,7 +30132,7 @@ label_56: if ((double) Main.craftingAlpha > 1.0) Main.craftingAlpha = 1f; } - Microsoft.Xna.Framework.Color craftingTipColor = new Microsoft.Xna.Framework.Color((int) (byte) ((double) Main.mouseTextColor * (double) Main.craftingAlpha), (int) (byte) ((double) Main.mouseTextColor * (double) Main.craftingAlpha), (int) (byte) ((double) Main.mouseTextColor * (double) Main.craftingAlpha), (int) (byte) ((double) Main.mouseTextColor * (double) Main.craftingAlpha)); + Microsoft.Xna.Framework.Color color10 = new Microsoft.Xna.Framework.Color((int) (byte) ((double) Main.mouseTextColor * (double) Main.craftingAlpha), (int) (byte) ((double) Main.mouseTextColor * (double) Main.craftingAlpha), (int) (byte) ((double) Main.mouseTextColor * (double) Main.craftingAlpha), (int) (byte) ((double) Main.mouseTextColor * (double) Main.craftingAlpha)); Main.craftingHide = false; if (Main.InReforgeMenu) { @@ -29084,63 +30151,63 @@ label_56: } else { - int num42 = 50; - int num43 = 270; + int num43 = 50; + int num44 = 270; string text1 = Lang.inter[46].Value + ": "; if (Main.reforgeItem.type > 0) { - int num44 = Main.reforgeItem.value; + int num45 = Main.reforgeItem.value; if (Main.player[Main.myPlayer].discount) - num44 = (int) ((double) num44 * 0.8); - int price = (int) ((double) num44 * Main.player[Main.myPlayer].currentShoppingSettings.PriceAdjustment) / 3; + num45 = (int) ((double) num45 * 0.8); + int price = num45 / 3; string text2 = ""; - int num45 = 0; int num46 = 0; int num47 = 0; int num48 = 0; - int num49 = price; - if (num49 < 1) - num49 = 1; - if (num49 >= 1000000) + int num49 = 0; + int num50 = price; + if (num50 < 1) + num50 = 1; + if (num50 >= 1000000) { - num45 = num49 / 1000000; - num49 -= num45 * 1000000; + num46 = num50 / 1000000; + num50 -= num46 * 1000000; } - if (num49 >= 10000) + if (num50 >= 10000) { - num46 = num49 / 10000; - num49 -= num46 * 10000; + num47 = num50 / 10000; + num50 -= num47 * 10000; } - if (num49 >= 100) + if (num50 >= 100) { - num47 = num49 / 100; - num49 -= num47 * 100; + num48 = num50 / 100; + num50 -= num48 * 100; } - if (num49 >= 1) - num48 = num49; - if (num45 > 0) - text2 = text2 + "[c/" + Colors.AlphaDarken(Colors.CoinPlatinum).Hex3() + ":" + (object) num45 + " " + Lang.inter[15].Value + "] "; + if (num50 >= 1) + num49 = num50; if (num46 > 0) - text2 = text2 + "[c/" + Colors.AlphaDarken(Colors.CoinGold).Hex3() + ":" + (object) num46 + " " + Lang.inter[16].Value + "] "; + text2 = text2 + "[c/" + Colors.AlphaDarken(Colors.CoinPlatinum).Hex3() + ":" + (object) num46 + " " + Lang.inter[15].Value + "] "; if (num47 > 0) - text2 = text2 + "[c/" + Colors.AlphaDarken(Colors.CoinSilver).Hex3() + ":" + (object) num47 + " " + Lang.inter[17].Value + "] "; + text2 = text2 + "[c/" + Colors.AlphaDarken(Colors.CoinGold).Hex3() + ":" + (object) num47 + " " + Lang.inter[16].Value + "] "; if (num48 > 0) - text2 = text2 + "[c/" + Colors.AlphaDarken(Colors.CoinCopper).Hex3() + ":" + (object) num48 + " " + Lang.inter[18].Value + "] "; - ItemSlot.DrawSavings(Main.spriteBatch, (float) (num42 + 130), (float) this.invBottom, true); - ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, FontAssets.MouseText.Value, text2, new Vector2((float) (num42 + 50) + FontAssets.MouseText.Value.MeasureString(text1).X, (float) num43), Microsoft.Xna.Framework.Color.White, 0.0f, Vector2.Zero, Vector2.One); - int num50 = num42 + 70; - int num51 = num43 + 40; - int num52 = Main.mouseX <= num50 - 15 || Main.mouseX >= num50 + 15 || Main.mouseY <= num51 - 15 || Main.mouseY >= num51 + 15 ? 0 : (!PlayerInput.IgnoreMouseInterface ? 1 : 0); - Texture2D texture2D = TextureAssets.Reforge[0].Value; - if (num52 != 0) - texture2D = TextureAssets.Reforge[1].Value; - Main.spriteBatch.Draw(texture2D, new Vector2((float) num50, (float) num51), new Microsoft.Xna.Framework.Rectangle?(), Microsoft.Xna.Framework.Color.White, 0.0f, texture2D.Size() / 2f, Main.reforgeScale, SpriteEffects.None, 0.0f); - UILinkPointNavigator.SetPosition(304, new Vector2((float) num50, (float) num51) + texture2D.Size() / 4f); - if (num52 != 0) + text2 = text2 + "[c/" + Colors.AlphaDarken(Colors.CoinSilver).Hex3() + ":" + (object) num48 + " " + Lang.inter[17].Value + "] "; + if (num49 > 0) + text2 = text2 + "[c/" + Colors.AlphaDarken(Colors.CoinCopper).Hex3() + ":" + (object) num49 + " " + Lang.inter[18].Value + "] "; + ItemSlot.DrawSavings(Main.spriteBatch, (float) (num43 + 130), (float) this.invBottom, true); + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, Main.fontMouseText, text2, new Vector2((float) (num43 + 50) + Main.fontMouseText.MeasureString(text1).X, (float) num44), Microsoft.Xna.Framework.Color.White, 0.0f, Vector2.Zero, Vector2.One); + int num51 = num43 + 70; + int num52 = num44 + 40; + int num53 = Main.mouseX <= num51 - 15 || Main.mouseX >= num51 + 15 || Main.mouseY <= num52 - 15 || Main.mouseY >= num52 + 15 ? 0 : (!PlayerInput.IgnoreMouseInterface ? 1 : 0); + Texture2D texture2D = Main.reforgeTexture[0]; + if (num53 != 0) + texture2D = Main.reforgeTexture[1]; + Main.spriteBatch.Draw(texture2D, new Vector2((float) num51, (float) num52), new Microsoft.Xna.Framework.Rectangle?(), Microsoft.Xna.Framework.Color.White, 0.0f, texture2D.Size() / 2f, Main.reforgeScale, SpriteEffects.None, 0.0f); + UILinkPointNavigator.SetPosition(304, new Vector2((float) num51, (float) num52) + texture2D.Size() / 4f); + if (num53 != 0) { Main.hoverItemName = Lang.inter[19].Value; if (!Main.mouseReforge) - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.mouseReforge = true; Main.player[Main.myPlayer].mouseInterface = true; if (Main.mouseLeftRelease && Main.mouseLeft && Main.player[Main.myPlayer].BuyItem(price)) @@ -29151,8 +30218,8 @@ label_56: Main.reforgeItem.position.X = Main.player[Main.myPlayer].position.X + (float) (Main.player[Main.myPlayer].width / 2) - (float) (Main.reforgeItem.width / 2); Main.reforgeItem.position.Y = Main.player[Main.myPlayer].position.Y + (float) (Main.player[Main.myPlayer].height / 2) - (float) (Main.reforgeItem.height / 2); Main.reforgeItem.favorited = favorited; - PopupText.NewText(PopupTextContext.ItemReforge, Main.reforgeItem, Main.reforgeItem.stack, true); - SoundEngine.PlaySound(SoundID.Item37); + ItemText.NewText(Main.reforgeItem, Main.reforgeItem.stack, true); + Main.PlaySound(SoundID.Item37); } } else @@ -29160,18 +30227,21 @@ label_56: } else text1 = Lang.inter[20].Value; - ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, FontAssets.MouseText.Value, text1, new Vector2((float) (num42 + 50), (float) num43), new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor), 0.0f, Vector2.Zero, Vector2.One); - if (Main.mouseX >= num42 && (double) Main.mouseX <= (double) num42 + (double) TextureAssets.InventoryBack.Width() * (double) Main.inventoryScale && Main.mouseY >= num43 && (double) Main.mouseY <= (double) num43 + (double) TextureAssets.InventoryBack.Height() * (double) Main.inventoryScale && !PlayerInput.IgnoreMouseInterface) + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, Main.fontMouseText, text1, new Vector2((float) (num43 + 50), (float) num44), new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor), 0.0f, Vector2.Zero, Vector2.One); + if (Main.mouseX >= num43 && (double) Main.mouseX <= (double) num43 + (double) Main.inventoryBackTexture.Width * (double) Main.inventoryScale && Main.mouseY >= num44 && (double) Main.mouseY <= (double) num44 + (double) Main.inventoryBackTexture.Height * (double) Main.inventoryScale && !PlayerInput.IgnoreMouseInterface) { Main.player[Main.myPlayer].mouseInterface = true; Main.craftingHide = true; - ItemSlot.LeftClick(ref Main.reforgeItem, 5); if (Main.mouseLeftRelease && Main.mouseLeft) + { + ItemSlot.LeftClick(ref Main.reforgeItem, 5); Recipe.FindRecipes(); - ItemSlot.RightClick(ref Main.reforgeItem, 5); + } + else + ItemSlot.RightClick(ref Main.reforgeItem, 5); ItemSlot.MouseHover(ref Main.reforgeItem, 5); } - ItemSlot.Draw(Main.spriteBatch, ref Main.reforgeItem, 5, new Vector2((float) num42, (float) num43)); + ItemSlot.Draw(Main.spriteBatch, ref Main.reforgeItem, 5, new Vector2((float) num43, (float) num44)); } } else if (Main.InGuideCraftMenu) @@ -29184,92 +30254,152 @@ label_56: } else { - int inventoryX; - int inventoryY; - Main.DrawGuideCraftText(adjY, craftingTipColor, out inventoryX, out inventoryY); - Microsoft.Xna.Framework.Color color6 = new Microsoft.Xna.Framework.Color(100, 100, 100, 100); - if (Main.mouseX >= inventoryX && (double) Main.mouseX <= (double) inventoryX + (double) TextureAssets.InventoryBack.Width() * (double) Main.inventoryScale && Main.mouseY >= inventoryY && (double) Main.mouseY <= (double) inventoryY + (double) TextureAssets.InventoryBack.Height() * (double) Main.inventoryScale && !PlayerInput.IgnoreMouseInterface) + int num54 = 73; + int num55 = 331 + num41; + string str; + if (Main.guideItem.type > 0) + { + str = Lang.inter[21].Value + " " + Main.guideItem.Name; + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, Lang.inter[22].Value, new Vector2((float) num54, (float) (num55 + 118)), color10, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + int focusRecipe = Main.focusRecipe; + int num56 = 0; + for (int index = 0; index < Recipe.maxRequirements; ++index) + { + int num57 = (index + 1) * 26; + if (Main.recipe[Main.availableRecipe[focusRecipe]].requiredTile[index] == -1) + { + if (index == 0 && !Main.recipe[Main.availableRecipe[focusRecipe]].needWater && !Main.recipe[Main.availableRecipe[focusRecipe]].needHoney && !Main.recipe[Main.availableRecipe[focusRecipe]].needLava && !Main.recipe[Main.availableRecipe[focusRecipe]].needSnowBiome) + { + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, Lang.inter[23].Value, new Vector2((float) num54, (float) (num55 + 118 + num57)), color10, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + break; + } + break; + } + ++num56; + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, Lang.GetMapObjectName(MapHelper.TileToLookup(Main.recipe[Main.availableRecipe[focusRecipe]].requiredTile[index], 0)), new Vector2((float) num54, (float) (num55 + 118 + num57)), color10, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + } + if (Main.recipe[Main.availableRecipe[focusRecipe]].needWater) + { + int num58 = (num56 + 1) * 26; + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, Lang.inter[53].Value, new Vector2((float) num54, (float) (num55 + 118 + num58)), color10, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + } + if (Main.recipe[Main.availableRecipe[focusRecipe]].needHoney) + { + int num59 = (num56 + 1) * 26; + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, Lang.inter[58].Value, new Vector2((float) num54, (float) (num55 + 118 + num59)), color10, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + } + if (Main.recipe[Main.availableRecipe[focusRecipe]].needLava) + { + int num60 = (num56 + 1) * 26; + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, Lang.inter[56].Value, new Vector2((float) num54, (float) (num55 + 118 + num60)), color10, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + } + if (Main.recipe[Main.availableRecipe[focusRecipe]].needSnowBiome) + { + int num61 = (num56 + 1) * 26; + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, Lang.inter[123].Value, new Vector2((float) num54, (float) (num55 + 118 + num61)), color10, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + } + } + else + str = Lang.inter[24].Value; + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str, new Vector2((float) (num54 + 50), (float) (num55 + 12)), new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Microsoft.Xna.Framework.Color color11 = new Microsoft.Xna.Framework.Color(100, 100, 100, 100); + if (Main.mouseX >= num54 && (double) Main.mouseX <= (double) num54 + (double) Main.inventoryBackTexture.Width * (double) Main.inventoryScale && Main.mouseY >= num55 && (double) Main.mouseY <= (double) num55 + (double) Main.inventoryBackTexture.Height * (double) Main.inventoryScale && !PlayerInput.IgnoreMouseInterface) { Main.player[Main.myPlayer].mouseInterface = true; Main.craftingHide = true; - ItemSlot.OverrideHover(ref Main.guideItem, 7); - ItemSlot.LeftClick(ref Main.guideItem, 7); if (Main.mouseLeftRelease && Main.mouseLeft) + { + ItemSlot.LeftClick(ref Main.guideItem, 7); Recipe.FindRecipes(); - ItemSlot.RightClick(ref Main.guideItem, 7); + } + else + ItemSlot.RightClick(ref Main.guideItem, 7); ItemSlot.MouseHover(ref Main.guideItem, 7); } - ItemSlot.Draw(Main.spriteBatch, ref Main.guideItem, 7, new Vector2((float) inventoryX, (float) inventoryY)); + ItemSlot.Draw(Main.spriteBatch, ref Main.guideItem, 7, new Vector2((float) num54, (float) num55)); } } - Main.CreativeMenu.Draw(Main.spriteBatch); - bool flag9 = Main.CreativeMenu.Enabled && !Main.CreativeMenu.Blocked; - if (!Main.InReforgeMenu && !Main.LocalPlayer.tileEntityAnchor.InUse && !flag9) + if (!Main.InReforgeMenu) { UILinkPointNavigator.Shortcuts.CRAFT_CurrentRecipeBig = -1; UILinkPointNavigator.Shortcuts.CRAFT_CurrentRecipeSmall = -1; if (Main.numAvailableRecipes > 0) - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, Lang.inter[25].Value, new Vector2(76f, (float) (414 + adjY)), craftingTipColor, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - for (int recipeIndex = 0; recipeIndex < Recipe.maxRecipes; ++recipeIndex) + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, Lang.inter[25].Value, new Vector2(76f, (float) (414 + num41)), color10, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + for (int index = 0; index < Recipe.maxRecipes; ++index) { - Main.inventoryScale = (float) (100.0 / ((double) Math.Abs(Main.availableRecipeY[recipeIndex]) + 100.0)); + Main.inventoryScale = (float) (100.0 / ((double) Math.Abs(Main.availableRecipeY[index]) + 100.0)); if ((double) Main.inventoryScale < 0.75) Main.inventoryScale = 0.75f; if (Main.recFastScroll) Main.inventoryScale = 0.75f; - if ((double) Main.availableRecipeY[recipeIndex] < (double) ((recipeIndex - Main.focusRecipe) * 65)) + if ((double) Main.availableRecipeY[index] < (double) ((index - Main.focusRecipe) * 65)) { - if ((double) Main.availableRecipeY[recipeIndex] == 0.0 && !Main.recFastScroll) - SoundEngine.PlaySound(12); - Main.availableRecipeY[recipeIndex] += 6.5f; + if ((double) Main.availableRecipeY[index] == 0.0 && !Main.recFastScroll) + Main.PlaySound(12); + Main.availableRecipeY[index] += 6.5f; if (Main.recFastScroll) - Main.availableRecipeY[recipeIndex] += 130000f; - if ((double) Main.availableRecipeY[recipeIndex] > (double) ((recipeIndex - Main.focusRecipe) * 65)) - Main.availableRecipeY[recipeIndex] = (float) ((recipeIndex - Main.focusRecipe) * 65); + Main.availableRecipeY[index] += 130000f; + if ((double) Main.availableRecipeY[index] > (double) ((index - Main.focusRecipe) * 65)) + Main.availableRecipeY[index] = (float) ((index - Main.focusRecipe) * 65); } - else if ((double) Main.availableRecipeY[recipeIndex] > (double) ((recipeIndex - Main.focusRecipe) * 65)) + else if ((double) Main.availableRecipeY[index] > (double) ((index - Main.focusRecipe) * 65)) { - if ((double) Main.availableRecipeY[recipeIndex] == 0.0 && !Main.recFastScroll) - SoundEngine.PlaySound(12); - Main.availableRecipeY[recipeIndex] -= 6.5f; + if ((double) Main.availableRecipeY[index] == 0.0 && !Main.recFastScroll) + Main.PlaySound(12); + Main.availableRecipeY[index] -= 6.5f; if (Main.recFastScroll) - Main.availableRecipeY[recipeIndex] -= 130000f; - if ((double) Main.availableRecipeY[recipeIndex] < (double) ((recipeIndex - Main.focusRecipe) * 65)) - Main.availableRecipeY[recipeIndex] = (float) ((recipeIndex - Main.focusRecipe) * 65); + Main.availableRecipeY[index] -= 130000f; + if ((double) Main.availableRecipeY[index] < (double) ((index - Main.focusRecipe) * 65)) + Main.availableRecipeY[index] = (float) ((index - Main.focusRecipe) * 65); } else Main.recFastScroll = false; - if (recipeIndex < Main.numAvailableRecipes && (double) Math.Abs(Main.availableRecipeY[recipeIndex]) <= (double) num41) + if (index < Main.numAvailableRecipes && (double) Math.Abs(Main.availableRecipeY[index]) <= (double) num42) { - int num53 = (int) (46.0 - 26.0 * (double) Main.inventoryScale); - int num54 = (int) (410.0 + (double) Main.availableRecipeY[recipeIndex] * (double) Main.inventoryScale - 30.0 * (double) Main.inventoryScale + (double) adjY); - double num55 = (double) ((int) Main.inventoryBack.A + 50); - double num56 = (double) byte.MaxValue; - if ((double) Math.Abs(Main.availableRecipeY[recipeIndex]) > (double) num41 - 100.0) + int num62 = (int) (46.0 - 26.0 * (double) Main.inventoryScale); + int num63 = (int) (410.0 + (double) Main.availableRecipeY[index] * (double) Main.inventoryScale - 30.0 * (double) Main.inventoryScale + (double) num41); + double num64 = (double) ((int) Main.inventoryBack.A + 50); + double num65 = (double) byte.MaxValue; + if ((double) Math.Abs(Main.availableRecipeY[index]) > (double) num42 - 100.0) { - num55 = 150.0 * (100.0 - ((double) Math.Abs(Main.availableRecipeY[recipeIndex]) - ((double) num41 - 100.0))) * 0.01; - num56 = (double) byte.MaxValue * (100.0 - ((double) Math.Abs(Main.availableRecipeY[recipeIndex]) - ((double) num41 - 100.0))) * 0.01; + num64 = 150.0 * (100.0 - ((double) Math.Abs(Main.availableRecipeY[index]) - ((double) num42 - 100.0))) * 0.01; + num65 = (double) byte.MaxValue * (100.0 - ((double) Math.Abs(Main.availableRecipeY[index]) - ((double) num42 - 100.0))) * 0.01; + } + Microsoft.Xna.Framework.Color color12 = new Microsoft.Xna.Framework.Color((int) (byte) num64, (int) (byte) num64, (int) (byte) num64, (int) (byte) num64); + Microsoft.Xna.Framework.Color lightColor = new Microsoft.Xna.Framework.Color((int) (byte) num65, (int) (byte) num65, (int) (byte) num65, (int) (byte) num65); + if (Main.mouseX >= num62 && (double) Main.mouseX <= (double) num62 + (double) Main.inventoryBackTexture.Width * (double) Main.inventoryScale && Main.mouseY >= num63 && (double) Main.mouseY <= (double) num63 + (double) Main.inventoryBackTexture.Height * (double) Main.inventoryScale && !PlayerInput.IgnoreMouseInterface) + { + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.focusRecipe == index && Main.guideItem.type == 0 && Main.LocalPlayer.itemTime == 0 && Main.LocalPlayer.itemAnimation == 0) + { + if ((Main.mouseItem.type == 0 || Main.mouseItem.IsTheSameAs(Main.recipe[Main.availableRecipe[index]].createItem) && Main.mouseItem.stack + Main.recipe[Main.availableRecipe[index]].createItem.stack <= Main.mouseItem.maxStack) && !Main.player[Main.myPlayer].IsStackingItems()) + { + if (Main.mouseLeftRelease && Main.mouseLeft) + Main.CraftItem(Main.recipe[Main.availableRecipe[index]]); + else if (Main.stackSplit <= 1 && Main.mouseRight && (Main.mouseItem.stack < Main.mouseItem.maxStack || Main.mouseItem.type == 0)) + { + Main.stackSplit = Main.stackSplit != 0 ? Main.stackDelay : 15; + Main.CraftItem(Main.recipe[Main.availableRecipe[index]]); + } + } + } + else if (Main.mouseLeftRelease && Main.mouseLeft) + Main.focusRecipe = index; + Main.craftingHide = true; + Main.hoverItemName = Main.recipe[Main.availableRecipe[index]].createItem.Name; + Main.HoverItem = Main.recipe[Main.availableRecipe[index]].createItem.Clone(); + if (Main.recipe[Main.availableRecipe[index]].createItem.stack > 1) + Main.hoverItemName = Main.hoverItemName + " (" + (object) Main.recipe[Main.availableRecipe[index]].createItem.stack + ")"; } - Microsoft.Xna.Framework.Color color7 = new Microsoft.Xna.Framework.Color((int) (byte) num55, (int) (byte) num55, (int) (byte) num55, (int) (byte) num55); - Microsoft.Xna.Framework.Color lightColor = new Microsoft.Xna.Framework.Color((int) (byte) num56, (int) (byte) num56, (int) (byte) num56, (int) (byte) num56); - if (!Main.LocalPlayer.creativeInterface && Main.mouseX >= num53 && (double) Main.mouseX <= (double) num53 + (double) TextureAssets.InventoryBack.Width() * (double) Main.inventoryScale && Main.mouseY >= num54 && (double) Main.mouseY <= (double) num54 + (double) TextureAssets.InventoryBack.Height() * (double) Main.inventoryScale && !PlayerInput.IgnoreMouseInterface) - Main.HoverOverCraftingItemButton(recipeIndex); if (Main.numAvailableRecipes > 0) { - double num57 = num55 - 50.0; - if (num57 < 0.0) - num57 = 0.0; - if (recipeIndex == Main.focusRecipe) - { - UILinkPointNavigator.Shortcuts.CRAFT_CurrentRecipeSmall = 0; - if (!PlayerInput.UsingGamepad) - ItemSlot.DrawGoldBGForCraftingMaterial = true; - } - else - UILinkPointNavigator.Shortcuts.CRAFT_CurrentRecipeSmall = -1; + double num66 = num64 - 50.0; + if (num66 < 0.0) + num66 = 0.0; + UILinkPointNavigator.Shortcuts.CRAFT_CurrentRecipeSmall = index != Main.focusRecipe ? -1 : 0; Microsoft.Xna.Framework.Color inventoryBack2 = Main.inventoryBack; - Main.inventoryBack = new Microsoft.Xna.Framework.Color((int) (byte) num57, (int) (byte) num57, (int) (byte) num57, (int) (byte) num57); - ItemSlot.Draw(Main.spriteBatch, ref Main.recipe[Main.availableRecipe[recipeIndex]].createItem, 22, new Vector2((float) num53, (float) num54), lightColor); + Main.inventoryBack = new Microsoft.Xna.Framework.Color((int) (byte) num66, (int) (byte) num66, (int) (byte) num66, (int) (byte) num66); + ItemSlot.Draw(Main.spriteBatch, ref Main.recipe[Main.availableRecipe[index]].createItem, 22, new Vector2((float) num62, (float) num63), lightColor); Main.inventoryBack = inventoryBack2; } } @@ -29278,48 +30408,64 @@ label_56: { UILinkPointNavigator.Shortcuts.CRAFT_CurrentRecipeBig = -1; UILinkPointNavigator.Shortcuts.CRAFT_CurrentRecipeSmall = -1; - for (int i = 0; i < Recipe.maxRequirements; ++i) + for (int index = 0; index < Recipe.maxRequirements; ++index) { - if (Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[i].type == 0) + if (Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[index].type == 0) { - UILinkPointNavigator.Shortcuts.CRAFT_CurrentIngridientsCount = i + 1; + UILinkPointNavigator.Shortcuts.CRAFT_CurrentIngridientsCount = index + 1; break; } - int num58 = 80 + i * 40; - int num59 = 380 + adjY; - double num60 = (double) ((int) Main.inventoryBack.A + 50); + int num67 = 80 + index * 40; + int num68 = 380 + num41; + double num69 = (double) ((int) Main.inventoryBack.A + 50); Microsoft.Xna.Framework.Color white1 = Microsoft.Xna.Framework.Color.White; Microsoft.Xna.Framework.Color white2 = Microsoft.Xna.Framework.Color.White; - double num61 = (double) ((int) Main.inventoryBack.A + 50) - (double) Math.Abs(Main.availableRecipeY[Main.focusRecipe]) * 2.0; - double num62 = (double) byte.MaxValue - (double) Math.Abs(Main.availableRecipeY[Main.focusRecipe]) * 2.0; - if (num61 < 0.0) - num61 = 0.0; - if (num62 < 0.0) - num62 = 0.0; - white1.R = (byte) num61; - white1.G = (byte) num61; - white1.B = (byte) num61; - white1.A = (byte) num61; - white2.R = (byte) num62; - white2.G = (byte) num62; - white2.B = (byte) num62; - white2.A = (byte) num62; + double num70 = (double) ((int) Main.inventoryBack.A + 50) - (double) Math.Abs(Main.availableRecipeY[Main.focusRecipe]) * 2.0; + double num71 = (double) byte.MaxValue - (double) Math.Abs(Main.availableRecipeY[Main.focusRecipe]) * 2.0; + if (num70 < 0.0) + num70 = 0.0; + if (num71 < 0.0) + num71 = 0.0; + white1.R = (byte) num70; + white1.G = (byte) num70; + white1.B = (byte) num70; + white1.A = (byte) num70; + white2.R = (byte) num71; + white2.G = (byte) num71; + white2.B = (byte) num71; + white2.A = (byte) num71; Main.inventoryScale = 0.6f; - if (num61 != 0.0) + if (num70 != 0.0) { - if (Main.mouseX >= num58 && (double) Main.mouseX <= (double) num58 + (double) TextureAssets.InventoryBack.Width() * (double) Main.inventoryScale && Main.mouseY >= num59 && (double) Main.mouseY <= (double) num59 + (double) TextureAssets.InventoryBack.Height() * (double) Main.inventoryScale && !PlayerInput.IgnoreMouseInterface) + if (Main.mouseX >= num67 && (double) Main.mouseX <= (double) num67 + (double) Main.inventoryBackTexture.Width * (double) Main.inventoryScale && Main.mouseY >= num68 && (double) Main.mouseY <= (double) num68 + (double) Main.inventoryBackTexture.Height * (double) Main.inventoryScale && !PlayerInput.IgnoreMouseInterface) { Main.craftingHide = true; Main.player[Main.myPlayer].mouseInterface = true; - Main.SetRecipeMaterialDisplayName(i); + Main.hoverItemName = Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[index].Name; + Main.HoverItem = Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[index].Clone(); + string theText; + if (Main.recipe[Main.availableRecipe[Main.focusRecipe]].ProcessGroupsForText(Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[index].type, out theText)) + Main.HoverItem.SetNameOverride(theText); + if (Main.recipe[Main.availableRecipe[Main.focusRecipe]].anyIronBar && Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[index].type == 22) + Main.HoverItem.SetNameOverride(Lang.misc[37].Value + " " + Lang.GetItemNameValue(22)); + else if (Main.recipe[Main.availableRecipe[Main.focusRecipe]].anyWood && Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[index].type == 9) + Main.HoverItem.SetNameOverride(Lang.misc[37].Value + " " + Lang.GetItemNameValue(9)); + else if (Main.recipe[Main.availableRecipe[Main.focusRecipe]].anySand && Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[index].type == 169) + Main.HoverItem.SetNameOverride(Lang.misc[37].Value + " " + Lang.GetItemNameValue(169)); + else if (Main.recipe[Main.availableRecipe[Main.focusRecipe]].anyFragment && Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[index].type == 3458) + Main.HoverItem.SetNameOverride(Lang.misc[37].Value + " " + Lang.misc[51].Value); + else if (Main.recipe[Main.availableRecipe[Main.focusRecipe]].anyPressurePlate && Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[index].type == 542) + Main.HoverItem.SetNameOverride(Lang.misc[37].Value + " " + Lang.misc[38].Value); + if (Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[index].stack > 1) + Main.hoverItemName = Main.hoverItemName + " (" + (object) Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[index].stack + ")"; } - double num63 = num61 - 50.0; - if (num63 < 0.0) - num63 = 0.0; - UILinkPointNavigator.Shortcuts.CRAFT_CurrentRecipeSmall = 1 + i; + double num72 = num70 - 50.0; + if (num72 < 0.0) + num72 = 0.0; + UILinkPointNavigator.Shortcuts.CRAFT_CurrentRecipeSmall = 1 + index; Microsoft.Xna.Framework.Color inventoryBack3 = Main.inventoryBack; - Main.inventoryBack = new Microsoft.Xna.Framework.Color((int) (byte) num63, (int) (byte) num63, (int) (byte) num63, (int) (byte) num63); - ItemSlot.Draw(Main.spriteBatch, ref Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[i], 22, new Vector2((float) num58, (float) num59)); + Main.inventoryBack = new Microsoft.Xna.Framework.Color((int) (byte) num72, (int) (byte) num72, (int) (byte) num72, (int) (byte) num72); + ItemSlot.Draw(Main.spriteBatch, ref Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[index], 22, new Vector2((float) num67, (float) num68)); Main.inventoryBack = inventoryBack3; } else @@ -29332,14 +30478,14 @@ label_56: } else { - int num64 = 94; - int num65 = 450 + adjY; + int num73 = 94; + int num74 = 450 + num41; if (Main.InGuideCraftMenu) - num65 -= 150; - bool flag10 = Main.mouseX > num64 - 15 && Main.mouseX < num64 + 15 && Main.mouseY > num65 - 15 && Main.mouseY < num65 + 15 && !PlayerInput.IgnoreMouseInterface; - int index = Main.recBigList.ToInt() * 2 + flag10.ToInt(); - Main.spriteBatch.Draw(TextureAssets.CraftToggle[index].Value, new Vector2((float) num64, (float) num65), new Microsoft.Xna.Framework.Rectangle?(), Microsoft.Xna.Framework.Color.White, 0.0f, TextureAssets.CraftToggle[index].Value.Size() / 2f, 1f, SpriteEffects.None, 0.0f); - if (flag10) + num74 -= 150; + bool flag5 = Main.mouseX > num73 - 15 && Main.mouseX < num73 + 15 && Main.mouseY > num74 - 15 && Main.mouseY < num74 + 15 && !PlayerInput.IgnoreMouseInterface; + int index = Main.recBigList.ToInt() * 2 + flag5.ToInt(); + Main.spriteBatch.Draw(Main.craftToggleTexture[index], new Vector2((float) num73, (float) num74), new Microsoft.Xna.Framework.Rectangle?(), Microsoft.Xna.Framework.Color.White, 0.0f, Main.craftToggleTexture[index].Size() / 2f, 1f, SpriteEffects.None, 0.0f); + if (flag5) { this.MouseText(Language.GetTextValue("GameUI.CraftingWindow")); Main.player[Main.myPlayer].mouseInterface = true; @@ -29348,84 +30494,84 @@ label_56: if (!Main.recBigList) { Main.recBigList = true; - SoundEngine.PlaySound(12); + Main.PlaySound(12); } else { Main.recBigList = false; - SoundEngine.PlaySound(12); + Main.PlaySound(12); } } } } } - if (Main.recBigList && !flag9) + if (Main.recBigList) { UILinkPointNavigator.Shortcuts.CRAFT_CurrentRecipeBig = -1; UILinkPointNavigator.Shortcuts.CRAFT_CurrentRecipeSmall = -1; - int num66 = 42; + int num75 = 42; if ((double) Main.inventoryScale < 0.75) Main.inventoryScale = 0.75f; - int num67 = 340; - int num68 = 310; - int num69 = (Main.screenWidth - num68 - 280) / num66; - int num70 = (Main.screenHeight - num67 - 20) / num66; - UILinkPointNavigator.Shortcuts.CRAFT_IconsPerRow = num69; - UILinkPointNavigator.Shortcuts.CRAFT_IconsPerColumn = num70; - int num71 = 0; - int num72 = 0; - int num73 = num68; - int num74 = num67; - int num75 = num68 - 20; - int num76 = num67 + 2; - if (Main.recStart > Main.numAvailableRecipes - num69 * num70) + int num76 = 340; + int num77 = 310; + int num78 = (Main.screenWidth - num77 - 280) / num75; + int num79 = (Main.screenHeight - num76 - 20) / num75; + UILinkPointNavigator.Shortcuts.CRAFT_IconsPerRow = num78; + UILinkPointNavigator.Shortcuts.CRAFT_IconsPerColumn = num79; + int num80 = 0; + int num81 = 0; + int num82 = num77; + int num83 = num76; + int num84 = num77 - 20; + int num85 = num76 + 2; + if (Main.recStart > Main.numAvailableRecipes - num78 * num79) { - Main.recStart = Main.numAvailableRecipes - num69 * num70; + Main.recStart = Main.numAvailableRecipes - num78 * num79; if (Main.recStart < 0) Main.recStart = 0; } if (Main.recStart > 0) { - if (Main.mouseX >= num75 && Main.mouseX <= num75 + TextureAssets.CraftUpButton.Width() && Main.mouseY >= num76 && Main.mouseY <= num76 + TextureAssets.CraftUpButton.Height() && !PlayerInput.IgnoreMouseInterface) + if (Main.mouseX >= num84 && Main.mouseX <= num84 + Main.craftUpButtonTexture.Width && Main.mouseY >= num85 && Main.mouseY <= num85 + Main.craftUpButtonTexture.Height && !PlayerInput.IgnoreMouseInterface) { Main.player[Main.myPlayer].mouseInterface = true; if (Main.mouseLeftRelease && Main.mouseLeft) { - Main.recStart -= num69; + Main.recStart -= num78; if (Main.recStart < 0) Main.recStart = 0; - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.mouseLeftRelease = false; } } - Main.spriteBatch.Draw(TextureAssets.CraftUpButton.Value, new Vector2((float) num75, (float) num76), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.CraftUpButton.Width(), TextureAssets.CraftUpButton.Height())), new Microsoft.Xna.Framework.Color(200, 200, 200, 200), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.craftUpButtonTexture, new Vector2((float) num84, (float) num85), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.craftUpButtonTexture.Width, Main.craftUpButtonTexture.Height)), new Microsoft.Xna.Framework.Color(200, 200, 200, 200), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } - if (Main.recStart < Main.numAvailableRecipes - num69 * num70) + if (Main.recStart < Main.numAvailableRecipes - num78 * num79) { - int num77 = num76 + 20; - if (Main.mouseX >= num75 && Main.mouseX <= num75 + TextureAssets.CraftUpButton.Width() && Main.mouseY >= num77 && Main.mouseY <= num77 + TextureAssets.CraftUpButton.Height() && !PlayerInput.IgnoreMouseInterface) + int num86 = num85 + 20; + if (Main.mouseX >= num84 && Main.mouseX <= num84 + Main.craftUpButtonTexture.Width && Main.mouseY >= num86 && Main.mouseY <= num86 + Main.craftUpButtonTexture.Height && !PlayerInput.IgnoreMouseInterface) { Main.player[Main.myPlayer].mouseInterface = true; if (Main.mouseLeftRelease && Main.mouseLeft) { - Main.recStart += num69; - SoundEngine.PlaySound(12); - if (Main.recStart > Main.numAvailableRecipes - num69) - Main.recStart = Main.numAvailableRecipes - num69; + Main.recStart += num78; + Main.PlaySound(12); + if (Main.recStart > Main.numAvailableRecipes - num78) + Main.recStart = Main.numAvailableRecipes - num78; Main.mouseLeftRelease = false; } } - Main.spriteBatch.Draw(TextureAssets.CraftDownButton.Value, new Vector2((float) num75, (float) num77), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.CraftUpButton.Width(), TextureAssets.CraftUpButton.Height())), new Microsoft.Xna.Framework.Color(200, 200, 200, 200), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.craftDownButtonTexture, new Vector2((float) num84, (float) num86), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.craftUpButtonTexture.Width, Main.craftUpButtonTexture.Height)), new Microsoft.Xna.Framework.Color(200, 200, 200, 200), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } for (int recStart = Main.recStart; recStart < Recipe.maxRecipes && recStart < Main.numAvailableRecipes; ++recStart) { - int num78 = num73; - int num79 = num74; - double num80 = (double) ((int) Main.inventoryBack.A + 50); + int num87 = num82; + int num88 = num83; + double num89 = (double) ((int) Main.inventoryBack.A + 50); double maxValue = (double) byte.MaxValue; - Microsoft.Xna.Framework.Color color8 = new Microsoft.Xna.Framework.Color((int) (byte) num80, (int) (byte) num80, (int) (byte) num80, (int) (byte) num80); - Microsoft.Xna.Framework.Color color9 = new Microsoft.Xna.Framework.Color((int) (byte) maxValue, (int) (byte) maxValue, (int) (byte) maxValue, (int) (byte) maxValue); - if (Main.mouseX >= num78 && (double) Main.mouseX <= (double) num78 + (double) TextureAssets.InventoryBack.Width() * (double) Main.inventoryScale && Main.mouseY >= num79 && (double) Main.mouseY <= (double) num79 + (double) TextureAssets.InventoryBack.Height() * (double) Main.inventoryScale && !PlayerInput.IgnoreMouseInterface) + Microsoft.Xna.Framework.Color color13 = new Microsoft.Xna.Framework.Color((int) (byte) num89, (int) (byte) num89, (int) (byte) num89, (int) (byte) num89); + Microsoft.Xna.Framework.Color color14 = new Microsoft.Xna.Framework.Color((int) (byte) maxValue, (int) (byte) maxValue, (int) (byte) maxValue, (int) (byte) maxValue); + if (Main.mouseX >= num87 && (double) Main.mouseX <= (double) num87 + (double) Main.inventoryBackTexture.Width * (double) Main.inventoryScale && Main.mouseY >= num88 && (double) Main.mouseY <= (double) num88 + (double) Main.inventoryBackTexture.Height * (double) Main.inventoryScale && !PlayerInput.IgnoreMouseInterface) { Main.player[Main.myPlayer].mouseInterface = true; if (Main.mouseLeftRelease && Main.mouseLeft) @@ -29433,13 +30579,10 @@ label_56: Main.focusRecipe = recStart; Main.recFastScroll = true; Main.recBigList = false; - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.mouseLeftRelease = false; if (PlayerInput.UsingGamepadUI) - { UILinkPointNavigator.ChangePage(9); - Main.LockCraftingForThisCraftClickDuration(); - } } Main.craftingHide = true; Main.hoverItemName = Main.recipe[Main.availableRecipe[recStart]].createItem.Name; @@ -29449,100 +30592,107 @@ label_56: } if (Main.numAvailableRecipes > 0) { - double num81 = num80 - 50.0; - if (num81 < 0.0) - num81 = 0.0; + double num90 = num89 - 50.0; + if (num90 < 0.0) + num90 = 0.0; UILinkPointNavigator.Shortcuts.CRAFT_CurrentRecipeBig = recStart - Main.recStart; Microsoft.Xna.Framework.Color inventoryBack4 = Main.inventoryBack; - Main.inventoryBack = new Microsoft.Xna.Framework.Color((int) (byte) num81, (int) (byte) num81, (int) (byte) num81, (int) (byte) num81); - ItemSlot.Draw(Main.spriteBatch, ref Main.recipe[Main.availableRecipe[recStart]].createItem, 22, new Vector2((float) num78, (float) num79)); + Main.inventoryBack = new Microsoft.Xna.Framework.Color((int) (byte) num90, (int) (byte) num90, (int) (byte) num90, (int) (byte) num90); + ItemSlot.Draw(Main.spriteBatch, ref Main.recipe[Main.availableRecipe[recStart]].createItem, 22, new Vector2((float) num87, (float) num88)); Main.inventoryBack = inventoryBack4; } - num73 += num66; - ++num71; - if (num71 >= num69) + num82 += num75; + ++num80; + if (num80 >= num78) { - num73 = num68; - num74 += num66; - num71 = 0; - ++num72; - if (num72 >= num70) + num82 = num77; + num83 += num75; + num80 = 0; + ++num81; + if (num81 >= num79) break; } } } - Vector2 vector2_4 = FontAssets.MouseText.Value.MeasureString("Coins"); - Vector2 vector2_5 = FontAssets.MouseText.Value.MeasureString(Lang.inter[26].Value); - float num82 = vector2_4.X / vector2_5.X; - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, Lang.inter[26].Value, new Vector2(496f, (float) (84.0 + ((double) vector2_4.Y - (double) vector2_4.Y * (double) num82) / 2.0)), new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor), 0.0f, new Vector2(), 0.75f * num82, SpriteEffects.None, 0.0f); + Vector2 vector2_3 = Main.fontMouseText.MeasureString("Coins"); + Vector2 vector2_4 = Main.fontMouseText.MeasureString(Lang.inter[26].Value); + float num91 = vector2_3.X / vector2_4.X; + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, Lang.inter[26].Value, new Vector2(496f, (float) (84.0 + ((double) vector2_3.Y - (double) vector2_3.Y * (double) num91) / 2.0)), new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor), 0.0f, new Vector2(), 0.75f * num91, SpriteEffects.None, 0.0f); Main.inventoryScale = 0.6f; for (int index = 0; index < 4; ++index) { - int num83 = 497; - int num84 = (int) (85.0 + (double) (index * 56) * (double) Main.inventoryScale + 20.0); + int num92 = 497; + int num93 = (int) (85.0 + (double) (index * 56) * (double) Main.inventoryScale + 20.0); int slot = index + 50; - Microsoft.Xna.Framework.Color color10 = new Microsoft.Xna.Framework.Color(100, 100, 100, 100); - if (Main.mouseX >= num83 && (double) Main.mouseX <= (double) num83 + (double) TextureAssets.InventoryBack.Width() * (double) Main.inventoryScale && Main.mouseY >= num84 && (double) Main.mouseY <= (double) num84 + (double) TextureAssets.InventoryBack.Height() * (double) Main.inventoryScale && !PlayerInput.IgnoreMouseInterface) + Microsoft.Xna.Framework.Color color15 = new Microsoft.Xna.Framework.Color(100, 100, 100, 100); + if (Main.mouseX >= num92 && (double) Main.mouseX <= (double) num92 + (double) Main.inventoryBackTexture.Width * (double) Main.inventoryScale && Main.mouseY >= num93 && (double) Main.mouseY <= (double) num93 + (double) Main.inventoryBackTexture.Height * (double) Main.inventoryScale && !PlayerInput.IgnoreMouseInterface) { Main.player[Main.myPlayer].mouseInterface = true; ItemSlot.OverrideHover(Main.player[Main.myPlayer].inventory, 1, slot); - ItemSlot.LeftClick(Main.player[Main.myPlayer].inventory, 1, slot); - ItemSlot.RightClick(Main.player[Main.myPlayer].inventory, 1, slot); if (Main.mouseLeftRelease && Main.mouseLeft) + { + ItemSlot.LeftClick(Main.player[Main.myPlayer].inventory, 1, slot); Recipe.FindRecipes(); + } + else + ItemSlot.RightClick(Main.player[Main.myPlayer].inventory, 1, slot); ItemSlot.MouseHover(Main.player[Main.myPlayer].inventory, 1, slot); } - ItemSlot.Draw(Main.spriteBatch, Main.player[Main.myPlayer].inventory, 1, slot, new Vector2((float) num83, (float) num84)); + ItemSlot.Draw(Main.spriteBatch, Main.player[Main.myPlayer].inventory, 1, slot, new Vector2((float) num92, (float) num93)); } - Vector2 vector2_6 = FontAssets.MouseText.Value.MeasureString("Ammo"); - Vector2 vector2_7 = FontAssets.MouseText.Value.MeasureString(Lang.inter[27].Value); - float num85 = vector2_6.X / vector2_7.X; - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, Lang.inter[27].Value, new Vector2(532f, (float) (84.0 + ((double) vector2_6.Y - (double) vector2_6.Y * (double) num85) / 2.0)), new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor), 0.0f, new Vector2(), 0.75f * num85, SpriteEffects.None, 0.0f); + Vector2 vector2_5 = Main.fontMouseText.MeasureString("Ammo"); + Vector2 vector2_6 = Main.fontMouseText.MeasureString(Lang.inter[27].Value); + float num94 = vector2_5.X / vector2_6.X; + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, Lang.inter[27].Value, new Vector2(532f, (float) (84.0 + ((double) vector2_5.Y - (double) vector2_5.Y * (double) num94) / 2.0)), new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor), 0.0f, new Vector2(), 0.75f * num94, SpriteEffects.None, 0.0f); Main.inventoryScale = 0.6f; for (int index = 0; index < 4; ++index) { - int num86 = 534; - int num87 = (int) (85.0 + (double) (index * 56) * (double) Main.inventoryScale + 20.0); + int num95 = 534; + int num96 = (int) (85.0 + (double) (index * 56) * (double) Main.inventoryScale + 20.0); int slot = 54 + index; - Microsoft.Xna.Framework.Color color11 = new Microsoft.Xna.Framework.Color(100, 100, 100, 100); - if (Main.mouseX >= num86 && (double) Main.mouseX <= (double) num86 + (double) TextureAssets.InventoryBack.Width() * (double) Main.inventoryScale && Main.mouseY >= num87 && (double) Main.mouseY <= (double) num87 + (double) TextureAssets.InventoryBack.Height() * (double) Main.inventoryScale && !PlayerInput.IgnoreMouseInterface) + Microsoft.Xna.Framework.Color color16 = new Microsoft.Xna.Framework.Color(100, 100, 100, 100); + if (Main.mouseX >= num95 && (double) Main.mouseX <= (double) num95 + (double) Main.inventoryBackTexture.Width * (double) Main.inventoryScale && Main.mouseY >= num96 && (double) Main.mouseY <= (double) num96 + (double) Main.inventoryBackTexture.Height * (double) Main.inventoryScale && !PlayerInput.IgnoreMouseInterface) { Main.player[Main.myPlayer].mouseInterface = true; ItemSlot.OverrideHover(Main.player[Main.myPlayer].inventory, 2, slot); - ItemSlot.LeftClick(Main.player[Main.myPlayer].inventory, 2, slot); - ItemSlot.RightClick(Main.player[Main.myPlayer].inventory, 2, slot); if (Main.mouseLeftRelease && Main.mouseLeft) + { + ItemSlot.LeftClick(Main.player[Main.myPlayer].inventory, 2, slot); Recipe.FindRecipes(); + } + else + ItemSlot.RightClick(Main.player[Main.myPlayer].inventory, 2, slot); ItemSlot.MouseHover(Main.player[Main.myPlayer].inventory, 2, slot); } - ItemSlot.Draw(Main.spriteBatch, Main.player[Main.myPlayer].inventory, 2, slot, new Vector2((float) num86, (float) num87)); + ItemSlot.Draw(Main.spriteBatch, Main.player[Main.myPlayer].inventory, 2, slot, new Vector2((float) num95, (float) num96)); } if (Main.npcShop > 0 && (!Main.playerInventory || Main.player[Main.myPlayer].talkNPC == -1)) - Main.SetNPCShopIndex(0); + Main.npcShop = 0; if (Main.npcShop > 0 && !Main.recBigList) { - Utils.DrawBorderStringFourWay(Main.spriteBatch, FontAssets.MouseText.Value, Lang.inter[28].Value, 504f, (float) this.invBottom, Microsoft.Xna.Framework.Color.White * ((float) Main.mouseTextColor / (float) byte.MaxValue), Microsoft.Xna.Framework.Color.Black, Vector2.Zero); + Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, Lang.inter[28].Value, 504f, (float) this.invBottom, Microsoft.Xna.Framework.Color.White * ((float) Main.mouseTextColor / (float) byte.MaxValue), Microsoft.Xna.Framework.Color.Black, Vector2.Zero); ItemSlot.DrawSavings(Main.spriteBatch, 504f, (float) this.invBottom); Main.inventoryScale = 0.755f; if (Main.mouseX > 73 && Main.mouseX < (int) (73.0 + 560.0 * (double) Main.inventoryScale) && Main.mouseY > this.invBottom && Main.mouseY < (int) ((double) this.invBottom + 224.0 * (double) Main.inventoryScale) && !PlayerInput.IgnoreMouseInterface) Main.player[Main.myPlayer].mouseInterface = true; - for (int index5 = 0; index5 < 10; ++index5) + for (int index9 = 0; index9 < 10; ++index9) { - for (int index6 = 0; index6 < 4; ++index6) + for (int index10 = 0; index10 < 4; ++index10) { - int num88 = (int) (73.0 + (double) (index5 * 56) * (double) Main.inventoryScale); - int num89 = (int) ((double) this.invBottom + (double) (index6 * 56) * (double) Main.inventoryScale); - int slot = index5 + index6 * 10; - Microsoft.Xna.Framework.Color color12 = new Microsoft.Xna.Framework.Color(100, 100, 100, 100); - if (Main.mouseX >= num88 && (double) Main.mouseX <= (double) num88 + (double) TextureAssets.InventoryBack.Width() * (double) Main.inventoryScale && Main.mouseY >= num89 && (double) Main.mouseY <= (double) num89 + (double) TextureAssets.InventoryBack.Height() * (double) Main.inventoryScale && !PlayerInput.IgnoreMouseInterface) + int num97 = (int) (73.0 + (double) (index9 * 56) * (double) Main.inventoryScale); + int num98 = (int) ((double) this.invBottom + (double) (index10 * 56) * (double) Main.inventoryScale); + int slot = index9 + index10 * 10; + Microsoft.Xna.Framework.Color color17 = new Microsoft.Xna.Framework.Color(100, 100, 100, 100); + if (Main.mouseX >= num97 && (double) Main.mouseX <= (double) num97 + (double) Main.inventoryBackTexture.Width * (double) Main.inventoryScale && Main.mouseY >= num98 && (double) Main.mouseY <= (double) num98 + (double) Main.inventoryBackTexture.Height * (double) Main.inventoryScale && !PlayerInput.IgnoreMouseInterface) { - ItemSlot.OverrideHover(this.shop[Main.npcShop].item, 15, slot); Main.player[Main.myPlayer].mouseInterface = true; - ItemSlot.LeftClick(this.shop[Main.npcShop].item, 15, slot); - ItemSlot.RightClick(this.shop[Main.npcShop].item, 15, slot); + if (Main.mouseLeftRelease && Main.mouseLeft) + ItemSlot.LeftClick(this.shop[Main.npcShop].item, 15, slot); + else + ItemSlot.RightClick(this.shop[Main.npcShop].item, 15, slot); ItemSlot.MouseHover(this.shop[Main.npcShop].item, 15, slot); } - ItemSlot.Draw(Main.spriteBatch, this.shop[Main.npcShop].item, 15, slot, new Vector2((float) num88, (float) num89)); + ItemSlot.Draw(Main.spriteBatch, this.shop[Main.npcShop].item, 15, slot, new Vector2((float) num97, (float) num98)); } } } @@ -29551,27 +30701,25 @@ label_56: Main.player[Main.myPlayer].chest = -1; Recipe.FindRecipes(); } - int num90 = 0; - UIVirtualKeyboard.ShouldHideText = !PlayerInput.UsingGamepad; + int num99 = 0; if (!PlayerInput.UsingGamepad) - num90 = 9999; - UIVirtualKeyboard.OffsetDown = num90; + num99 = 9999; + UIVirtualKeyboard.OffsetDown = num99; ChestUI.Draw(Main.spriteBatch); - Main.LocalPlayer.tileEntityAnchor.GetTileEntity()?.OnInventoryDraw(Main.LocalPlayer, Main.spriteBatch); if (Main.player[Main.myPlayer].chest == -1 && Main.npcShop == 0) { int index = 0; - int num91 = 498; - int num92 = 244; - int num93 = TextureAssets.ChestStack[index].Width(); - int num94 = TextureAssets.ChestStack[index].Height(); - UILinkPointNavigator.SetPosition(301, new Vector2((float) num91 + (float) num93 * 0.75f, (float) num92 + (float) num94 * 0.75f)); - if (Main.mouseX >= num91 && Main.mouseX <= num91 + num93 && Main.mouseY >= num92 && Main.mouseY <= num92 + num94 && !PlayerInput.IgnoreMouseInterface) + int num100 = 498; + int num101 = 244; + int width = Main.chestStackTexture[index].Width; + int height = Main.chestStackTexture[index].Height; + UILinkPointNavigator.SetPosition(301, new Vector2((float) num100 + (float) width * 0.75f, (float) num101 + (float) height * 0.75f)); + if (Main.mouseX >= num100 && Main.mouseX <= num100 + width && Main.mouseY >= num101 && Main.mouseY <= num101 + height && !PlayerInput.IgnoreMouseInterface) { index = 1; if (!Main.allChestStackHover) { - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.allChestStackHover = true; } if (Main.mouseLeft && Main.mouseLeftRelease) @@ -29584,26 +30732,26 @@ label_56: } else if (Main.allChestStackHover) { - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.allChestStackHover = false; } - Main.spriteBatch.Draw(TextureAssets.ChestStack[index].Value, new Vector2((float) num91, (float) num92), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.ChestStack[index].Width(), TextureAssets.ChestStack[index].Height())), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.chestStackTexture[index], new Vector2((float) num100, (float) num101), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chestStackTexture[index].Width, Main.chestStackTexture[index].Height)), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); if (!Main.mouseText && index == 1) this.MouseText(Language.GetTextValue("GameUI.QuickStackToNearby")); } if (Main.player[Main.myPlayer].chest != -1 || Main.npcShop != 0) return; - int num95 = 0; - int num96 = 534; - int num97 = 244; - int num98 = 30; - int num99 = 30; - UILinkPointNavigator.SetPosition(302, new Vector2((float) num96 + (float) num98 * 0.75f, (float) num97 + (float) num99 * 0.75f)); - bool flag11 = false; - if (Main.mouseX >= num96 && Main.mouseX <= num96 + num98 && Main.mouseY >= num97 && Main.mouseY <= num97 + num99 && !PlayerInput.IgnoreMouseInterface) + int num102 = 0; + int num103 = 534; + int num104 = 244; + int num105 = 30; + int num106 = 30; + UILinkPointNavigator.SetPosition(302, new Vector2((float) num103 + (float) num105 * 0.75f, (float) num104 + (float) num106 * 0.75f)); + bool flag6 = false; + if (Main.mouseX >= num103 && Main.mouseX <= num103 + num105 && Main.mouseY >= num104 && Main.mouseY <= num104 + num106 && !PlayerInput.IgnoreMouseInterface) { - num95 = 1; - flag11 = true; + num102 = 1; + flag6 = true; Main.player[Main.myPlayer].mouseInterface = true; if (Main.mouseLeft && Main.mouseLeftRelease) { @@ -29612,573 +30760,18 @@ label_56: Recipe.FindRecipes(); } } - if (flag11 != Main.inventorySortMouseOver) + if (flag6 != Main.inventorySortMouseOver) { - SoundEngine.PlaySound(12); - Main.inventorySortMouseOver = flag11; + Main.PlaySound(12); + Main.inventorySortMouseOver = flag6; } - Texture2D texture1 = TextureAssets.InventorySort[Main.inventorySortMouseOver ? 1 : 0].Value; - Main.spriteBatch.Draw(texture1, new Vector2((float) num96, (float) num97), new Microsoft.Xna.Framework.Rectangle?(), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - if (Main.mouseText || num95 != 1) + Texture2D texture1 = Main.inventorySortTexture[Main.inventorySortMouseOver ? 1 : 0]; + Main.spriteBatch.Draw(texture1, new Vector2((float) num103, (float) num104), new Microsoft.Xna.Framework.Rectangle?(), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + if (Main.mouseText || num102 != 1) return; this.MouseText(Language.GetTextValue("GameUI.SortInventory")); } - private void DrawNPCHousesInUI() - { - UILinkPointNavigator.Shortcuts.NPCS_LastHovered = -2; - if (Main.mouseX > Main.screenWidth - 64 - 28 && Main.mouseX < (int) ((double) (Main.screenWidth - 64 - 28) + 56.0 * (double) Main.inventoryScale) && Main.mouseY > 174 + Main.mH && Main.mouseY < (int) ((double) (174 + Main.mH) + 448.0 * (double) Main.inventoryScale) && !PlayerInput.IgnoreMouseInterface) - Main.player[Main.myPlayer].mouseInterface = true; - int num1 = 0; - string cursorText = ""; - int num2 = 0; - int num3 = 0; - this._npcTypesThatAlreadyDrewAHead.Clear(); - for (int index = 0; index < this._npcIndexWhoHoldsHeadIndex.Length; ++index) - this._npcIndexWhoHoldsHeadIndex[index] = -1; - for (int index1 = 0; index1 < 200; ++index1) - { - if (Main.npc[index1].active && !this._npcTypesThatAlreadyDrewAHead.Contains(Main.npc[index1].type)) - { - ITownNPCProfile profile; - int index2 = !TownNPCProfiles.Instance.GetProfile(Main.npc[index1].type, out profile) ? NPC.TypeToDefaultHeadIndex(Main.npc[index1].type) : profile.GetHeadTextureIndex(Main.npc[index1]); - if (index2 > 0 && index2 <= 45 && !NPCHeadID.Sets.CannotBeDrawnInHousingUI[index2] && this._npcIndexWhoHoldsHeadIndex[index2] == -1) - { - this._npcIndexWhoHoldsHeadIndex[index2] = index1; - this._npcTypesThatAlreadyDrewAHead.Add(Main.npc[index1].type); - } - } - } - Main.hidePVPIcons = false; - for (int index3 = 0; index3 < TextureAssets.NpcHead.Length; ++index3) - { - if (index3 == 0 || this._npcIndexWhoHoldsHeadIndex[index3] != -1) - { - int index4 = this._npcIndexWhoHoldsHeadIndex[index3]; - int num4 = Main.screenWidth - 64 - 28 + num3; - int num5 = (int) ((double) (174 + Main.mH) + (double) (num1 * 56) * (double) Main.inventoryScale) + num2; - Microsoft.Xna.Framework.Color color1 = new Microsoft.Xna.Framework.Color(100, 100, 100, 100); - if (num5 > Main.screenHeight - 80) - { - num3 -= 48; - num2 -= num5 - (174 + Main.mH); - num4 = Main.screenWidth - 64 - 28 + num3; - num5 = (int) ((double) (174 + Main.mH) + (double) (num1 * 56) * (double) Main.inventoryScale) + num2; - UILinkPointNavigator.Shortcuts.NPCS_IconsPerColumn = num1; - if (num3 <= -144) - Main.hidePVPIcons = true; - } - if (Main.mouseX >= num4 && (double) Main.mouseX <= (double) num4 + (double) TextureAssets.InventoryBack.Width() * (double) Main.inventoryScale && Main.mouseY >= num5 && (double) Main.mouseY <= (double) num5 + (double) TextureAssets.InventoryBack.Height() * (double) Main.inventoryScale) - { - UILinkPointNavigator.Shortcuts.NPCS_LastHovered = index4; - Main.mouseText = true; - cursorText = index3 != 0 ? Main.npc[index4].FullName : Lang.inter[8].Value; - if (!PlayerInput.IgnoreMouseInterface) - { - Main.player[Main.myPlayer].mouseInterface = true; - if (Main.mouseLeftRelease && Main.mouseLeft && !PlayerInput.UsingGamepadUI && Main.mouseItem.type == 0) - { - SoundEngine.PlaySound(12); - if (index3 == 0) - this.SetMouseNPC_ToHousingQuery(); - else - this.SetMouseNPC(index4, Main.npc[index4].type); - Main.mouseLeftRelease = false; - } - } - } - UILinkPointNavigator.SetPosition(600 + num1, new Vector2((float) num4, (float) num5) + TextureAssets.InventoryBack.Value.Size() * 0.75f); - Texture2D texture = TextureAssets.InventoryBack11.Value; - Microsoft.Xna.Framework.Color color2 = Main.inventoryBack; - if (UILinkPointNavigator.CurrentPoint - 600 == num1) - { - texture = TextureAssets.InventoryBack14.Value; - color2 = Microsoft.Xna.Framework.Color.White; - } - Main.spriteBatch.Draw(texture, new Vector2((float) num4, (float) num5), new Microsoft.Xna.Framework.Rectangle?(), color2, 0.0f, new Vector2(), Main.inventoryScale, SpriteEffects.None, 0.0f); - color1 = Microsoft.Xna.Framework.Color.White; - int index5 = index3; - float scale = 1f; - float num6 = TextureAssets.NpcHead[index5].Width() <= TextureAssets.NpcHead[index5].Height() ? (float) TextureAssets.NpcHead[index5].Height() : (float) TextureAssets.NpcHead[index5].Width(); - if ((double) num6 > 36.0) - scale = 36f / num6; - Main.spriteBatch.Draw(TextureAssets.NpcHead[index5].Value, new Vector2((float) num4 + 26f * Main.inventoryScale, (float) num5 + 26f * Main.inventoryScale), new Microsoft.Xna.Framework.Rectangle?(), color1, 0.0f, new Vector2((float) (TextureAssets.NpcHead[index5].Width() / 2), (float) (TextureAssets.NpcHead[index5].Height() / 2)), scale, SpriteEffects.None, 0.0f); - ++num1; - } - } - UILinkPointNavigator.Shortcuts.NPCS_IconsTotal = num1; - if (!(cursorText != "") || Main.mouseItem.type != 0) - return; - this.MouseText(cursorText); - } - - private static void DrawDefenseCounter(int inventoryX, int inventoryY) - { - Vector2 vector2_1 = new Vector2((float) (inventoryX - 10 - 47 - 47 - 14), (float) inventoryY + (float) TextureAssets.InventoryBack.Height() * 0.5f); - Main.spriteBatch.Draw(TextureAssets.Extra[58].Value, vector2_1, new Microsoft.Xna.Framework.Rectangle?(), Microsoft.Xna.Framework.Color.White, 0.0f, TextureAssets.Extra[58].Value.Size() / 2f, Main.inventoryScale, SpriteEffects.None, 0.0f); - Vector2 vector2_2 = FontAssets.MouseText.Value.MeasureString(Main.player[Main.myPlayer].statDefense.ToString()); - ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, FontAssets.MouseText.Value, Main.player[Main.myPlayer].statDefense.ToString(), vector2_1 - vector2_2 * 0.5f * Main.inventoryScale, Microsoft.Xna.Framework.Color.White, 0.0f, Vector2.Zero, new Vector2(Main.inventoryScale)); - if (Utils.CenteredRectangle(vector2_1, TextureAssets.Extra[58].Value.Size()).Contains(new Microsoft.Xna.Framework.Point(Main.mouseX, Main.mouseY)) && !PlayerInput.IgnoreMouseInterface) - { - Main.player[Main.myPlayer].mouseInterface = true; - string str = Main.player[Main.myPlayer].statDefense.ToString() + " " + Lang.inter[10].Value; - if (!string.IsNullOrEmpty(str)) - Main.hoverItemName = str; - } - UILinkPointNavigator.SetPosition(1557, vector2_1 + TextureAssets.Extra[58].Value.Size() * Main.inventoryScale / 4f); - } - - private static void DrawGuideCraftText( - int adjY, - Microsoft.Xna.Framework.Color craftingTipColor, - out int inventoryX, - out int inventoryY) - { - inventoryX = 73; - inventoryY = 331; - inventoryY += adjY; - Main._requiredObjecsForCraftingText.Clear(); - string str1; - if (Main.guideItem.IsAir) - { - str1 = Lang.inter[24].Value; - } - else - { - str1 = Lang.inter[21].Value + " " + Main.guideItem.Name; - Recipe recipe = Main.recipe[Main.availableRecipe[Main.focusRecipe]]; - for (int index = 0; index < Recipe.maxRequirements; ++index) - { - int num = recipe.requiredTile[index]; - if (num != -1) - { - int requiredTileStyle = Recipe.GetRequiredTileStyle(num); - string mapObjectName = Lang.GetMapObjectName(MapHelper.TileToLookup(num, requiredTileStyle)); - Main._requiredObjecsForCraftingText.Add(mapObjectName); - } - else - break; - } - if (recipe.needWater) - Main._requiredObjecsForCraftingText.Add(Lang.inter[53].Value); - if (recipe.needHoney) - Main._requiredObjecsForCraftingText.Add(Lang.inter[58].Value); - if (recipe.needLava) - Main._requiredObjecsForCraftingText.Add(Lang.inter[56].Value); - if (recipe.needSnowBiome) - Main._requiredObjecsForCraftingText.Add(Lang.inter[123].Value); - if (recipe.needGraveyardBiome) - Main._requiredObjecsForCraftingText.Add(Lang.inter[124].Value); - if (Main._requiredObjecsForCraftingText.Count == 0) - { - string str2 = Lang.inter[23].Value; - Main._requiredObjecsForCraftingText.Add(str2); - } - } - Microsoft.Xna.Framework.Color color1 = new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor); - Vector2 vector2_1 = new Vector2((float) (inventoryX + 50), (float) (inventoryY + 12)); - DynamicSpriteFont dynamicSpriteFont = FontAssets.MouseText.Value; - if (Main._requiredObjecsForCraftingText.Count > 0) - { - vector2_1.Y -= 14f; - Vector2 vector2_2 = vector2_1 + new Vector2(0.0f, 26f); - Microsoft.Xna.Framework.Color color2 = color1; - string str3 = Lang.inter[22].Value + " " + string.Join(", ", (IEnumerable) Main._requiredObjecsForCraftingText); - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, dynamicSpriteFont, str3, vector2_2, color2, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - } - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, dynamicSpriteFont, str1, vector2_1, color1, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - } - - private static void DrawGuideCraftText_Old( - int adjY, - Microsoft.Xna.Framework.Color craftingTipColor, - out int inventoryX, - out int inventoryY) - { - inventoryX = 73; - inventoryY = 331; - inventoryY += adjY; - int num1 = 0; - int num2 = 0; - inventoryX += num1; - inventoryY += num2; - string str; - if (Main.guideItem.type > 0) - { - str = Lang.inter[21].Value + " " + Main.guideItem.Name; - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, Lang.inter[22].Value, new Vector2((float) inventoryX, (float) (inventoryY + 118)), craftingTipColor, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - int focusRecipe = Main.focusRecipe; - int num3 = 0; - for (int index = 0; index < Recipe.maxRequirements; ++index) - { - int num4 = (index + 1) * 26; - if (Main.recipe[Main.availableRecipe[focusRecipe]].requiredTile[index] == -1) - { - if (index == 0 && !Main.recipe[Main.availableRecipe[focusRecipe]].needWater && !Main.recipe[Main.availableRecipe[focusRecipe]].needHoney && !Main.recipe[Main.availableRecipe[focusRecipe]].needLava && !Main.recipe[Main.availableRecipe[focusRecipe]].needSnowBiome && !Main.recipe[Main.availableRecipe[focusRecipe]].needGraveyardBiome) - { - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, Lang.inter[23].Value, new Vector2((float) inventoryX, (float) (inventoryY + 118 + num4)), craftingTipColor, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - break; - } - break; - } - ++num3; - int num5 = Main.recipe[Main.availableRecipe[focusRecipe]].requiredTile[index]; - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, Lang.GetMapObjectName(MapHelper.TileToLookup(num5, Recipe.GetRequiredTileStyle(num5))), new Vector2((float) inventoryX, (float) (inventoryY + 118 + num4)), craftingTipColor, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - } - if (Main.recipe[Main.availableRecipe[focusRecipe]].needWater) - { - int num6 = (num3 + 1) * 26; - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, Lang.inter[53].Value, new Vector2((float) inventoryX, (float) (inventoryY + 118 + num6)), craftingTipColor, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - } - if (Main.recipe[Main.availableRecipe[focusRecipe]].needHoney) - { - int num7 = (num3 + 1) * 26; - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, Lang.inter[58].Value, new Vector2((float) inventoryX, (float) (inventoryY + 118 + num7)), craftingTipColor, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - } - if (Main.recipe[Main.availableRecipe[focusRecipe]].needLava) - { - int num8 = (num3 + 1) * 26; - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, Lang.inter[56].Value, new Vector2((float) inventoryX, (float) (inventoryY + 118 + num8)), craftingTipColor, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - } - if (Main.recipe[Main.availableRecipe[focusRecipe]].needSnowBiome) - { - int num9 = (num3 + 1) * 26; - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, Lang.inter[123].Value, new Vector2((float) inventoryX, (float) (inventoryY + 118 + num9)), craftingTipColor, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - } - if (Main.recipe[Main.availableRecipe[focusRecipe]].needGraveyardBiome) - { - int num10 = (num3 + 1) * 26; - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, Lang.inter[124].Value, new Vector2((float) inventoryX, (float) (inventoryY + 118 + num10)), craftingTipColor, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - } - } - else - str = Lang.inter[24].Value; - inventoryX -= num1; - inventoryY -= num2; - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, str, new Vector2((float) (inventoryX + 50), (float) (inventoryY + 12)), new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - } - - public static void LockCraftingForThisCraftClickDuration() => Main._preventCraftingBecauseClickWasUsedToChangeFocusedRecipe = true; - - private static void HoverOverCraftingItemButton(int recipeIndex) - { - Recipe recipe = Main.recipe[Main.availableRecipe[recipeIndex]]; - Main.player[Main.myPlayer].mouseInterface = true; - bool flag1 = Main.mouseLeftRelease && Main.mouseLeft || Main.mouseRightRelease && Main.mouseRight; - bool flag2 = Main.mouseLeft || Main.mouseRight; - if (Main.focusRecipe == recipeIndex && Main.guideItem.IsAir) - { - bool flag3 = Main.LocalPlayer.ItemTimeIsZero && Main.LocalPlayer.itemAnimation == 0 && !Main.player[Main.myPlayer].HasLockedInventory() && !Main._preventCraftingBecauseClickWasUsedToChangeFocusedRecipe; - bool flag4 = ((Main._currentRecipeBeingCrafted == -1 ? 0 : (Main._currentRecipeBeingCrafted != Main.availableRecipe[recipeIndex] ? 1 : 0)) | (Main._currentRecipeBeingCrafted == -1 ? (false ? 1 : 0) : (Main.recipe[Main._currentRecipeBeingCrafted].createItem.maxStack == 1 ? 1 : 0))) != 0; - if (((!flag2 ? 0 : (!flag4 ? 1 : 0)) & (flag3 ? 1 : 0)) != 0 && Main.stackSplit <= 1) - { - bool usingGamepad = PlayerInput.UsingGamepad; - bool movedAnItemToAllowCrafting; - int num = Main.TryAllowingToCraftRecipe(recipe, usingGamepad, out movedAnItemToAllowCrafting) ? 1 : 0; - if (movedAnItemToAllowCrafting) - Main._preventCraftingBecauseClickWasUsedToChangeFocusedRecipe = true; - if (num != 0 && !movedAnItemToAllowCrafting) - { - if (Main._currentRecipeBeingCrafted == -1) - Main._currentRecipeBeingCrafted = Main.availableRecipe[recipeIndex]; - ItemSlot.RefreshStackSplitCooldown(); - Main.CraftItem(recipe); - } - } - } - else if (flag1) - { - Main.focusRecipe = recipeIndex; - Main.stackSplit = 15; - Main._preventCraftingBecauseClickWasUsedToChangeFocusedRecipe = true; - } - Main.craftingHide = true; - Main.hoverItemName = recipe.createItem.Name; - Main.HoverItem = recipe.createItem.Clone(); - if (recipe.createItem.stack > 1) - Main.hoverItemName = Main.hoverItemName + " (" + (object) recipe.createItem.stack + ")"; - if (flag2) - return; - Main._preventCraftingBecauseClickWasUsedToChangeFocusedRecipe = false; - Main._currentRecipeBeingCrafted = -1; - } - - private static bool TryAllowingToCraftRecipe( - Recipe currentRecipe, - bool tryFittingItemInInventoryToAllowCrafting, - out bool movedAnItemToAllowCrafting) - { - movedAnItemToAllowCrafting = false; - if (Main.mouseItem.IsAir || Main.mouseItem.IsTheSameAs(currentRecipe.createItem) && Main.mouseItem.stack + currentRecipe.createItem.stack <= Main.mouseItem.maxStack) - return true; - if (tryFittingItemInInventoryToAllowCrafting && Main.LocalPlayer.ItemSpace(Main.mouseItem).CanTakeItemToPersonalInventory) - { - Main.mouseItem = Main.LocalPlayer.GetItem(Main.myPlayer, Main.mouseItem, GetItemSettings.InventoryUIToInventorySettingsShowAsNew); - if (Main.mouseItem.IsAir) - { - movedAnItemToAllowCrafting = true; - return true; - } - if (Main.mouseItem.IsTheSameAs(currentRecipe.createItem) && Main.mouseItem.stack + currentRecipe.createItem.stack <= Main.mouseItem.maxStack) - { - movedAnItemToAllowCrafting = true; - return true; - } - } - return false; - } - - private static void DrawTrashItemSlot(int pivotTopLeftX, int pivotTopLeftY) - { - Main.inventoryScale = 0.85f; - int num1 = 448 + pivotTopLeftX; - int num2 = 258 + pivotTopLeftY; - if ((Main.player[Main.myPlayer].chest != -1 || Main.npcShop > 0) && !Main.recBigList) - { - num2 += 168; - Main.inventoryScale = 0.755f; - num1 += 5; - } - Microsoft.Xna.Framework.Color color = new Microsoft.Xna.Framework.Color(150, 150, 150, 150); - if (Main.mouseX >= num1 && (double) Main.mouseX <= (double) num1 + (double) TextureAssets.InventoryBack.Width() * (double) Main.inventoryScale && Main.mouseY >= num2 && (double) Main.mouseY <= (double) num2 + (double) TextureAssets.InventoryBack.Height() * (double) Main.inventoryScale && !PlayerInput.IgnoreMouseInterface) - { - Main.player[Main.myPlayer].mouseInterface = true; - ItemSlot.LeftClick(ref Main.player[Main.myPlayer].trashItem, 6); - if (Main.mouseLeftRelease && Main.mouseLeft) - Recipe.FindRecipes(); - ItemSlot.MouseHover(ref Main.player[Main.myPlayer].trashItem, 6); - } - ItemSlot.Draw(Main.spriteBatch, ref Main.player[Main.myPlayer].trashItem, 6, new Vector2((float) num1, (float) num2)); - } - - private static void DrawEmoteBubblesButton(int pivotTopLeftX, int pivotTopLeftY) - { - Main.inventoryScale = 0.85f; - int num1 = (int) ((double) (450 + pivotTopLeftX) - 56.0 * (double) Main.inventoryScale); - int num2 = 258 + pivotTopLeftY; - int num3 = 244; - int width = 30; - int height = 30; - int x = 534; - int y = num3 + height + 4; - if ((Main.player[Main.myPlayer].chest != -1 || Main.npcShop > 0) && !Main.recBigList) - { - y += 168; - Main.inventoryScale = 0.755f; - x += 5; - int num4 = num3 + 24; - } - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(x, y, (int) ((double) TextureAssets.InventoryBack.Width() * (double) Main.inventoryScale), (int) ((double) TextureAssets.InventoryBack.Height() * (double) Main.inventoryScale)); - rectangle = new Microsoft.Xna.Framework.Rectangle(x, y, width, height); - bool flag = false; - if (rectangle.Contains(new Microsoft.Xna.Framework.Point(Main.mouseX, Main.mouseY)) && !PlayerInput.IgnoreMouseInterface) - { - Main.player[Main.myPlayer].mouseInterface = true; - flag = true; - if (Main.mouseLeft && Main.mouseLeftRelease) - { - Main.player[Main.myPlayer].SetTalkNPC(-1); - Main.npcChatCornerItem = 0; - Main.npcChatText = ""; - Main.mouseLeftRelease = false; - SoundEngine.PlaySound(12); - IngameFancyUI.OpenUIState((UIState) new UIEmotesMenu()); - } - } - Texture2D texture2D = TextureAssets.EmoteMenuButton.Value; - Vector2 vector2 = rectangle.Center.ToVector2(); - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(2, frameX: (flag ? 1 : 0)); - r.Width -= 2; - r.Height -= 2; - Vector2 origin = r.Size() / 2f; - Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; - Main.spriteBatch.Draw(texture2D, vector2, new Microsoft.Xna.Framework.Rectangle?(r), white, 0.0f, origin, 1f, SpriteEffects.None, 0.0f); - UILinkPointNavigator.SetPosition(309, vector2); - if (!(!Main.mouseText & flag)) - return; - Main.instance.MouseText(Language.GetTextValue("GameUI.Emote")); - } - - private static void DrawBestiaryIcon(int pivotTopLeftX, int pivotTopLeftY) - { - Main.inventoryScale = 0.85f; - int num1 = (int) ((double) (450 + pivotTopLeftX) - 56.0 * (double) Main.inventoryScale * 2.0); - int num2 = 258 + pivotTopLeftY; - int num3 = 244; - int width = 30; - int height = 30; - int num4 = 244; - int x = 498; - int y = num4 + height + 4; - if ((Main.player[Main.myPlayer].chest != -1 || Main.npcShop > 0) && !Main.recBigList) - { - y += 168; - Main.inventoryScale = 0.755f; - x += 5; - num3 = num4 + 24; - } - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(x, y, (int) ((double) TextureAssets.InventoryBack.Width() * (double) Main.inventoryScale), (int) ((double) TextureAssets.InventoryBack.Height() * (double) Main.inventoryScale)); - rectangle = new Microsoft.Xna.Framework.Rectangle(x, y, width, height); - bool flag = false; - if (rectangle.Contains(new Microsoft.Xna.Framework.Point(Main.mouseX, Main.mouseY)) && !PlayerInput.IgnoreMouseInterface) - { - Main.player[Main.myPlayer].mouseInterface = true; - flag = true; - if (Main.mouseLeft && Main.mouseLeftRelease) - { - Main.player[Main.myPlayer].SetTalkNPC(-1); - Main.npcChatCornerItem = 0; - Main.npcChatText = ""; - Main.mouseLeftRelease = false; - SoundEngine.PlaySound(12); - IngameFancyUI.OpenUIState((UIState) Main.BestiaryUI); - Main.BestiaryUI.OnOpenPage(); - } - } - Texture2D texture2D = TextureAssets.BestiaryMenuButton.Value; - Vector2 vector2 = rectangle.Center.ToVector2(); - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(2, frameX: (flag ? 1 : 0)); - r.Width -= 2; - r.Height -= 2; - Vector2 origin = r.Size() / 2f; - Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; - Main.spriteBatch.Draw(texture2D, vector2, new Microsoft.Xna.Framework.Rectangle?(r), white, 0.0f, origin, 1f, SpriteEffects.None, 0.0f); - UILinkPointNavigator.SetPosition(310, vector2); - if (!(!Main.mouseText & flag)) - return; - Main.instance.MouseText(Language.GetTextValue("GameUI.Bestiary")); - } - - private static void SetRecipeMaterialDisplayName(int i) - { - Main.hoverItemName = Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[i].Name; - Main.HoverItem = Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[i].Clone(); - string theText; - if (Main.recipe[Main.availableRecipe[Main.focusRecipe]].ProcessGroupsForText(Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[i].type, out theText)) - Main.HoverItem.SetNameOverride(theText); - if (Main.recipe[Main.availableRecipe[Main.focusRecipe]].anyIronBar && Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[i].type == 22) - Main.HoverItem.SetNameOverride(Lang.misc[37].Value + " " + Lang.GetItemNameValue(22)); - else if (Main.recipe[Main.availableRecipe[Main.focusRecipe]].anyWood && Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[i].type == 9) - Main.HoverItem.SetNameOverride(Lang.misc[37].Value + " " + Lang.GetItemNameValue(9)); - else if (Main.recipe[Main.availableRecipe[Main.focusRecipe]].anySand && Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[i].type == 169) - Main.HoverItem.SetNameOverride(Lang.misc[37].Value + " " + Lang.GetItemNameValue(169)); - else if (Main.recipe[Main.availableRecipe[Main.focusRecipe]].anyFragment && Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[i].type == 3458) - Main.HoverItem.SetNameOverride(Lang.misc[37].Value + " " + Lang.misc[51].Value); - else if (Main.recipe[Main.availableRecipe[Main.focusRecipe]].anyPressurePlate && Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[i].type == 542) - Main.HoverItem.SetNameOverride(Lang.misc[37].Value + " " + Lang.misc[38].Value); - if (Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[i].stack <= 1) - return; - Main.hoverItemName = Main.hoverItemName + " (" + (object) Main.recipe[Main.availableRecipe[Main.focusRecipe]].requiredItem[i].stack + ")"; - } - - private void DrawHotbarLockIcon(int pivotTopLeftX, int pivotTopLeftY, bool pushSideToolsUp) - { - int num1 = pivotTopLeftX; - int num2 = 21 + pivotTopLeftY; - Player player = Main.player[Main.myPlayer]; - if (pushSideToolsUp) - num2 = pivotTopLeftY; - float scale = 0.9f; - Texture2D texture2D = TextureAssets.HbLock[Main.player[Main.myPlayer].hbLocked ? 0 : 1].Value; - Microsoft.Xna.Framework.Rectangle rectangle = texture2D.Frame(2); - bool flag = false; - if (Main.mouseX > num1 && (double) Main.mouseX < (double) num1 + (double) rectangle.Width * (double) scale && Main.mouseY > num2 && (double) Main.mouseY < (double) num2 + (double) rectangle.Height * (double) scale) - { - flag = true; - Main.player[Main.myPlayer].mouseInterface = true; - if (!Main.player[Main.myPlayer].hbLocked) - this.MouseText(Lang.inter[5].Value); - else - this.MouseText(Lang.inter[6].Value); - Main.mouseText = true; - if (Main.mouseLeft && Main.mouseLeftRelease) - { - SoundEngine.PlaySound(22); - Main.player[Main.myPlayer].hbLocked = !Main.player[Main.myPlayer].hbLocked; - } - } - Main.spriteBatch.Draw(texture2D, new Vector2((float) num1, (float) num2), new Microsoft.Xna.Framework.Rectangle?(rectangle), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), scale, SpriteEffects.None, 0.0f); - if (!flag) - return; - Main.spriteBatch.Draw(texture2D, new Vector2((float) num1, (float) num2), new Microsoft.Xna.Framework.Rectangle?(texture2D.Frame(2, frameX: 1)), Main.OurFavoriteColor, 0.0f, new Vector2(), scale, SpriteEffects.None, 0.0f); - } - - private void DrawBlockReplacementIcon( - int pivotTopLeftX, - int pivotTopLeftY, - bool pushSideToolsUp, - int gamepadPointOffset) - { - if (!Main.playerInventory) - return; - int num1 = pivotTopLeftX; - int num2 = 44 + pivotTopLeftY; - Player player = Main.player[Main.myPlayer]; - if (pushSideToolsUp) - num2 = 23 + pivotTopLeftY; - float scale = 0.9f; - int index = 10; - bool flag1 = Main.player[Main.myPlayer].builderAccStatus[index] == 0; - Texture2D texture2D = TextureAssets.blockReplaceIcon[0].Value; - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(3, frameX: (flag1 ? 0 : 1)); - bool flag2 = false; - if (Main.mouseX > num1 && (double) Main.mouseX < (double) num1 + (double) r.Width * (double) scale && Main.mouseY > num2 && (double) Main.mouseY < (double) num2 + (double) r.Height * (double) scale) - { - flag2 = true; - Main.player[Main.myPlayer].mouseInterface = true; - this.MouseText(flag1 ? Language.GetTextValue("GameUI.BlockReplacerOn") : Language.GetTextValue("GameUI.BlockReplacerOff")); - Main.mouseText = true; - if (Main.mouseLeft && Main.mouseLeftRelease) - { - SoundEngine.PlaySound(22); - Main.player[Main.myPlayer].builderAccStatus[index] = flag1 ? 1 : 0; - } - } - Vector2 position = new Vector2((float) num1, (float) num2); - Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(r), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), scale, SpriteEffects.None, 0.0f); - if (flag2) - Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(texture2D.Frame(3, frameX: 2)), Main.OurFavoriteColor, 0.0f, new Vector2(), scale, SpriteEffects.None, 0.0f); - UILinkPointNavigator.SetPosition(6000 + gamepadPointOffset, position + r.Size() * 0.65f); - } - - private void DrawTorchBiomeSwapIcon( - int pivotTopLeftX, - int pivotTopLeftY, - bool pushSideToolsUp, - int gamepadPointOffset) - { - if (!Main.playerInventory) - return; - int num1 = pivotTopLeftX; - int num2 = 68 + pivotTopLeftY; - Player player = Main.player[Main.myPlayer]; - if (pushSideToolsUp) - num2 = 47 + pivotTopLeftY; - float scale = 0.9f; - int index = 11; - bool flag1 = Main.player[Main.myPlayer].builderAccStatus[index] == 0; - Texture2D texture2D = TextureAssets.Extra[211].Value; - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(4, frameX: (flag1 ? 1 : 0)); - bool flag2 = false; - if (Main.mouseX > num1 && (double) Main.mouseX < (double) num1 + (double) r.Width * (double) scale && Main.mouseY > num2 && (double) Main.mouseY < (double) num2 + (double) r.Height * (double) scale) - { - flag2 = true; - Main.player[Main.myPlayer].mouseInterface = true; - this.MouseText(flag1 ? Language.GetTextValue("GameUI.TorchTypeSwapperOn") : Language.GetTextValue("GameUI.TorchTypeSwapperOff")); - Main.mouseText = true; - if (Main.mouseLeft && Main.mouseLeftRelease) - { - SoundEngine.PlaySound(22); - Main.player[Main.myPlayer].builderAccStatus[index] = flag1 ? 1 : 0; - } - } - Vector2 position = new Vector2((float) num1, (float) num2); - Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(r), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), scale, SpriteEffects.None, 0.0f); - if (flag2) - Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(texture2D.Frame(4, frameX: (flag1 ? 3 : 2))), Main.OurFavoriteColor, 0.0f, new Vector2(), scale, SpriteEffects.None, 0.0f); - UILinkPointNavigator.SetPosition(6000 + gamepadPointOffset, position + r.Size() * 0.65f); - } - public static void CraftItem(Recipe r) { int stack = Main.mouseItem.stack; @@ -30188,22 +30781,15 @@ label_56: Main.mouseItem.Prefix(-1); Main.mouseItem.position.X = Main.player[Main.myPlayer].position.X + (float) (Main.player[Main.myPlayer].width / 2) - (float) (Main.mouseItem.width / 2); Main.mouseItem.position.Y = Main.player[Main.myPlayer].position.Y + (float) (Main.player[Main.myPlayer].height / 2) - (float) (Main.mouseItem.height / 2); - PopupText.NewText(PopupTextContext.ItemCraft, Main.mouseItem, r.createItem.stack); + ItemText.NewText(Main.mouseItem, r.createItem.stack); r.Create(); if (Main.mouseItem.type <= 0 && r.createItem.type <= 0) return; - SoundEngine.PlaySound(7); + Main.PlaySound(7); } private static void DrawPVPIcons() { - if (Main.EquipPage == 1) - { - if (Main.hidePVPIcons) - return; - } - else - Main.hidePVPIcons = false; Main.inventoryScale = 0.6f; int num1 = (int) (52.0 * (double) Main.inventoryScale); int num2 = 707 - num1 * 4 + Main.screenWidth - 800; @@ -30211,7 +30797,7 @@ label_56: if (Main.EquipPage == 2) num2 += num1 + num1 / 2; int num4 = Main.player[Main.myPlayer].hostile ? 2 : 0; - if (Main.mouseX > num2 - 7 && Main.mouseX < num2 + 25 && Main.mouseY > num3 - 2 && Main.mouseY < num3 + 37 && !PlayerInput.IgnoreMouseInterface) + if (Main.mouseX > num2 && Main.mouseX < num2 + 34 && Main.mouseY > num3 - 2 && Main.mouseY < num3 + 34 && !PlayerInput.IgnoreMouseInterface) { Main.player[Main.myPlayer].mouseInterface = true; if (Main.teamCooldown == 0) @@ -30219,20 +30805,19 @@ label_56: if (Main.mouseLeft && Main.mouseLeftRelease && Main.teamCooldown == 0) { Main.teamCooldown = Main.teamCooldownLen; - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.player[Main.myPlayer].hostile = !Main.player[Main.myPlayer].hostile; NetMessage.SendData(30, number: Main.myPlayer); } } - Microsoft.Xna.Framework.Rectangle r1 = TextureAssets.Pvp[0].Frame(4, 6); + Microsoft.Xna.Framework.Rectangle r1 = Main.PVPTexture[0].Frame(4, 6); r1.Location = new Microsoft.Xna.Framework.Point(r1.Width * num4, r1.Height * Main.player[Main.myPlayer].team); r1.Width -= 2; - --r1.Height; - Main.spriteBatch.Draw(TextureAssets.Pvp[0].Value, new Vector2((float) (num2 - 10), (float) num3), new Microsoft.Xna.Framework.Rectangle?(r1), Microsoft.Xna.Framework.Color.White, 0.0f, Vector2.Zero, Vector2.One, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.PVPTexture[0], new Vector2((float) (num2 - 10), (float) num3), new Microsoft.Xna.Framework.Rectangle?(r1), Microsoft.Xna.Framework.Color.White, 0.0f, Vector2.Zero, Vector2.One, SpriteEffects.None, 0.0f); UILinkPointNavigator.SetPosition(1550, new Vector2((float) (num2 - 10), (float) num3) + r1.Size() * 0.75f); int num5 = num3 + 60; int num6 = num2 - 10; - Microsoft.Xna.Framework.Rectangle rectangle1 = TextureAssets.Pvp[1].Frame(6); + Microsoft.Xna.Framework.Rectangle rectangle1 = Main.PVPTexture[1].Frame(6); Microsoft.Xna.Framework.Rectangle r2 = rectangle1; for (int index = 0; index < 6; ++index) { @@ -30253,7 +30838,7 @@ label_56: else { Main.teamCooldown = Main.teamCooldownLen; - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.player[Main.myPlayer].team = index; NetMessage.SendData(45, number: Main.myPlayer); } @@ -30261,40 +30846,40 @@ label_56: } r2.Width = rectangle1.Width - 2; if (flag) - Main.spriteBatch.Draw(TextureAssets.Pvp[2].Value, r2.Location.ToVector2() + new Vector2(-2f), Microsoft.Xna.Framework.Color.White); + Main.spriteBatch.Draw(Main.PVPTexture[2], r2.Location.ToVector2() + new Vector2(-2f), Microsoft.Xna.Framework.Color.White); Microsoft.Xna.Framework.Rectangle rectangle2 = rectangle1; rectangle2.Width -= 2; - Main.spriteBatch.Draw(TextureAssets.Pvp[1].Value, r2.Location.ToVector2(), new Microsoft.Xna.Framework.Rectangle?(rectangle2), Microsoft.Xna.Framework.Color.White); + Main.spriteBatch.Draw(Main.PVPTexture[1], r2.Location.ToVector2(), new Microsoft.Xna.Framework.Rectangle?(rectangle2), Microsoft.Xna.Framework.Color.White); UILinkPointNavigator.SetPosition(1550 + index + 1, r2.Location.ToVector2() + r2.Size() * 0.75f); } } - private static int DrawPageIcons(int yPos) + private static int DrawPageIcons() { int num = -1; - Vector2 vector2 = new Vector2((float) (Main.screenWidth - 162), (float) yPos); + Vector2 vector2 = new Vector2((float) (Main.screenWidth - 162), (float) (142 + Main.mH)); vector2.X += 82f; - Texture2D texture2D1 = TextureAssets.EquipPage[Main.EquipPage == 2 ? 3 : 2].Value; + Texture2D texture2D1 = Main.EquipPageTexture[Main.EquipPage == 2 ? 3 : 2]; if (Collision.CheckAABBvAABBCollision(vector2, texture2D1.Size(), new Vector2((float) Main.mouseX, (float) Main.mouseY), Vector2.One) && (Main.mouseItem.stack < 1 || Main.mouseItem.dye > (byte) 0)) num = 2; if (num == 2) - Main.spriteBatch.Draw(TextureAssets.EquipPage[6].Value, vector2, new Microsoft.Xna.Framework.Rectangle?(), Main.OurFavoriteColor, 0.0f, new Vector2(2f), 0.9f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.EquipPageTexture[6], vector2, new Microsoft.Xna.Framework.Rectangle?(), Main.OurFavoriteColor, 0.0f, new Vector2(2f), 0.9f, SpriteEffects.None, 0.0f); Main.spriteBatch.Draw(texture2D1, vector2, new Microsoft.Xna.Framework.Rectangle?(), Microsoft.Xna.Framework.Color.White, 0.0f, Vector2.Zero, 0.9f, SpriteEffects.None, 0.0f); UILinkPointNavigator.SetPosition(305, vector2 + texture2D1.Size() * 0.75f); vector2.X -= 48f; - Texture2D texture2D2 = TextureAssets.EquipPage[Main.EquipPage == 1 ? 5 : 4].Value; + Texture2D texture2D2 = Main.EquipPageTexture[Main.EquipPage == 1 ? 5 : 4]; if (Collision.CheckAABBvAABBCollision(vector2, texture2D2.Size(), new Vector2((float) Main.mouseX, (float) Main.mouseY), Vector2.One) && Main.mouseItem.stack < 1) num = 1; if (num == 1) - Main.spriteBatch.Draw(TextureAssets.EquipPage[7].Value, vector2, new Microsoft.Xna.Framework.Rectangle?(), Main.OurFavoriteColor, 0.0f, new Vector2(2f), 0.9f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.EquipPageTexture[7], vector2, new Microsoft.Xna.Framework.Rectangle?(), Main.OurFavoriteColor, 0.0f, new Vector2(2f), 0.9f, SpriteEffects.None, 0.0f); Main.spriteBatch.Draw(texture2D2, vector2, new Microsoft.Xna.Framework.Rectangle?(), Microsoft.Xna.Framework.Color.White, 0.0f, Vector2.Zero, 0.9f, SpriteEffects.None, 0.0f); UILinkPointNavigator.SetPosition(306, vector2 + texture2D2.Size() * 0.75f); vector2.X -= 48f; - Texture2D texture2D3 = TextureAssets.EquipPage[Main.EquipPage == 3 ? 10 : 8].Value; + Texture2D texture2D3 = Main.EquipPageTexture[Main.EquipPage == 3 ? 10 : 8]; if (Collision.CheckAABBvAABBCollision(vector2, texture2D3.Size(), new Vector2((float) Main.mouseX, (float) Main.mouseY), Vector2.One) && Main.mouseItem.stack < 1) num = 3; if (num == 3 && !Main.CaptureModeDisabled) - Main.spriteBatch.Draw(TextureAssets.EquipPage[9].Value, vector2, new Microsoft.Xna.Framework.Rectangle?(), Main.OurFavoriteColor, 0.0f, Vector2.Zero, 0.9f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.EquipPageTexture[9], vector2, new Microsoft.Xna.Framework.Rectangle?(), Main.OurFavoriteColor, 0.0f, Vector2.Zero, 0.9f, SpriteEffects.None, 0.0f); Main.spriteBatch.Draw(texture2D3, vector2, new Microsoft.Xna.Framework.Rectangle?(), Main.CaptureModeDisabled ? Microsoft.Xna.Framework.Color.Red : Microsoft.Xna.Framework.Color.White, 0.0f, Vector2.Zero, 0.9f, SpriteEffects.None, 0.0f); UILinkPointNavigator.SetPosition(307, vector2 + texture2D3.Size() * 0.75f); if (num != -1) @@ -30320,10 +30905,10 @@ label_56: else Main.EquipPageSelected = Main.EquipPageSelected == num ? 0 : num; if (flag) - SoundEngine.PlaySound(10); + Main.PlaySound(12); } } - ItemSlot.SelectEquipPage(Main.mouseItem); + ItemSlot.EquipPage(Main.mouseItem); if (Main.EquipPage == -1) Main.EquipPage = Main.EquipPageSelected; return num; @@ -30338,8 +30923,10 @@ label_56: rectangle1.Y = (int) Main.screenPosition.Y + Main.screenHeight - Main.mouseY; PlayerInput.SetZoom_UI(); if (!Main.LocalPlayer.ghost) - Main.ActivePlayerResourcesSet.TryToHover(); - Main.AchievementAdvisor.DrawMouseHover(); + { + this.GUIBarsMouseOverLife(); + this.GUIBarsMouseOverMana(); + } IngameOptions.MouseOver(); IngameFancyUI.MouseOver(); if (!Main.mouseText) @@ -30348,17 +30935,15 @@ label_56: { if (Main.item[index].active) { - Microsoft.Xna.Framework.Rectangle drawHitbox = Item.GetDrawHitbox(Main.item[index].type, (Player) null); - Vector2 bottom = Main.item[index].Bottom; - Microsoft.Xna.Framework.Rectangle rectangle2 = new Microsoft.Xna.Framework.Rectangle((int) ((double) bottom.X - (double) drawHitbox.Width * 0.5), (int) ((double) bottom.Y - (double) drawHitbox.Height), drawHitbox.Width, drawHitbox.Height); + Microsoft.Xna.Framework.Rectangle rectangle2 = new Microsoft.Xna.Framework.Rectangle((int) ((double) Main.item[index].position.X + (double) Main.item[index].width * 0.5 - (double) Main.itemTexture[Main.item[index].type].Width * 0.5), (int) ((double) Main.item[index].position.Y + (double) Main.item[index].height - (double) Main.itemTexture[Main.item[index].type].Height), Main.itemTexture[Main.item[index].type].Width, Main.itemTexture[Main.item[index].type].Height); if (rectangle1.Intersects(rectangle2)) { - Main.player[Main.myPlayer].cursorItemIconEnabled = false; + Main.player[Main.myPlayer].showItemIcon = false; string text = Main.item[index].AffixName(); if (Main.item[index].stack > 1) text = text + " (" + (object) Main.item[index].stack + ")"; - if (Main.item[index].playerIndexTheItemIsReservedFor < (int) byte.MaxValue && Main.showItemOwner) - text = text + " <" + Main.player[Main.item[index].playerIndexTheItemIsReservedFor].name + ">"; + if (Main.item[index].owner < (int) byte.MaxValue && Main.showItemOwner) + text = text + " <" + Main.player[Main.item[index].owner].name + ">"; Main.rare = Main.item[index].rare; if (Main.item[index].expert) Main.rare = -12; @@ -30371,12 +30956,12 @@ label_56: } for (int index = 0; index < (int) byte.MaxValue; ++index) { - if (Main.player[index].active && Main.myPlayer != index && !Main.player[index].dead && !Main.player[index].ShouldNotDraw && (double) Main.player[index].stealth > 0.5) + if (Main.player[index].active && Main.myPlayer != index && !Main.player[index].dead) { Microsoft.Xna.Framework.Rectangle rectangle3 = new Microsoft.Xna.Framework.Rectangle((int) ((double) Main.player[index].position.X + (double) Main.player[index].width * 0.5 - 16.0), (int) ((double) Main.player[index].position.Y + (double) Main.player[index].height - 48.0), 32, 48); if (!Main.mouseText && rectangle1.Intersects(rectangle3)) { - Main.player[Main.myPlayer].cursorItemIconEnabled = false; + Main.player[Main.myPlayer].showItemIcon = false; int num = Main.player[index].statLife; if (num < 0) num = 0; @@ -30391,22 +30976,20 @@ label_56: Main.HoveringOverAnNPC = false; if (!Main.mouseText) { - for (int npcIndex = 0; npcIndex < 200; ++npcIndex) + for (int index1 = 0; index1 < 200; ++index1) { - if (Main.npc[npcIndex].active) + if (Main.npc[index1].active) { - this.LoadNPC(Main.npc[npcIndex].type); - NPC npc1 = Main.npc[npcIndex]; - npc1.position = npc1.position + Main.npc[npcIndex].netOffset; - Microsoft.Xna.Framework.Rectangle rectangle4 = new Microsoft.Xna.Framework.Rectangle((int) Main.npc[npcIndex].Bottom.X - Main.npc[npcIndex].frame.Width / 2, (int) Main.npc[npcIndex].Bottom.Y - Main.npc[npcIndex].frame.Height, Main.npc[npcIndex].frame.Width, Main.npc[npcIndex].frame.Height); - if (Main.npc[npcIndex].type >= 87 && Main.npc[npcIndex].type <= 92) - rectangle4 = new Microsoft.Xna.Framework.Rectangle((int) ((double) Main.npc[npcIndex].position.X + (double) Main.npc[npcIndex].width * 0.5 - 32.0), (int) ((double) Main.npc[npcIndex].position.Y + (double) Main.npc[npcIndex].height * 0.5 - 32.0), 64, 64); + this.LoadNPC(Main.npc[index1].type); + Microsoft.Xna.Framework.Rectangle rectangle4 = new Microsoft.Xna.Framework.Rectangle((int) Main.npc[index1].Bottom.X - Main.npc[index1].frame.Width / 2, (int) Main.npc[index1].Bottom.Y - Main.npc[index1].frame.Height, Main.npc[index1].frame.Width, Main.npc[index1].frame.Height); + if (Main.npc[index1].type >= 87 && Main.npc[index1].type <= 92) + rectangle4 = new Microsoft.Xna.Framework.Rectangle((int) ((double) Main.npc[index1].position.X + (double) Main.npc[index1].width * 0.5 - 32.0), (int) ((double) Main.npc[index1].position.Y + (double) Main.npc[index1].height * 0.5 - 32.0), 64, 64); bool flag1 = rectangle1.Intersects(rectangle4); - bool flag2 = flag1 || Main.SmartInteractShowingGenuine && Main.SmartInteractNPC == npcIndex; - if (flag2 && (Main.npc[npcIndex].type != 85 && Main.npc[npcIndex].type != 341 && Main.npc[npcIndex].type != 629 && Main.npc[npcIndex].aiStyle != 87 || (double) Main.npc[npcIndex].ai[0] != 0.0) && Main.npc[npcIndex].type != 488) + bool flag2 = flag1 || Main.SmartInteractShowingGenuine && Main.SmartInteractNPC == index1; + if (flag2 && (Main.npc[index1].type != 85 && Main.npc[index1].type != 341 && Main.npc[index1].aiStyle != 87 || (double) Main.npc[index1].ai[0] != 0.0) && Main.npc[index1].type != 488) { - bool flag3 = Main.SmartInteractShowingGenuine && Main.SmartInteractNPC == npcIndex; - if ((Main.npc[npcIndex].townNPC || Main.npc[npcIndex].type == 105 || Main.npc[npcIndex].type == 106 || Main.npc[npcIndex].type == 123 || Main.npc[npcIndex].type == 354 || Main.npc[npcIndex].type == 376 || Main.npc[npcIndex].type == 579 || Main.npc[npcIndex].type == 453 || Main.npc[npcIndex].type == 589) && new Microsoft.Xna.Framework.Rectangle((int) ((double) Main.player[Main.myPlayer].position.X + (double) (Main.player[Main.myPlayer].width / 2) - (double) (Player.tileRangeX * 16)), (int) ((double) Main.player[Main.myPlayer].position.Y + (double) (Main.player[Main.myPlayer].height / 2) - (double) (Player.tileRangeY * 16)), Player.tileRangeX * 16 * 2, Player.tileRangeY * 16 * 2).Intersects(new Microsoft.Xna.Framework.Rectangle((int) Main.npc[npcIndex].position.X, (int) Main.npc[npcIndex].position.Y, Main.npc[npcIndex].width, Main.npc[npcIndex].height))) + bool flag3 = Main.SmartInteractShowingGenuine && Main.SmartInteractNPC == index1; + if ((Main.npc[index1].townNPC || Main.npc[index1].type == 105 || Main.npc[index1].type == 106 || Main.npc[index1].type == 123 || Main.npc[index1].type == 354 || Main.npc[index1].type == 376 || Main.npc[index1].type == 579 || Main.npc[index1].type == 453) && new Microsoft.Xna.Framework.Rectangle((int) ((double) Main.player[Main.myPlayer].position.X + (double) (Main.player[Main.myPlayer].width / 2) - (double) (Player.tileRangeX * 16)), (int) ((double) Main.player[Main.myPlayer].position.Y + (double) (Main.player[Main.myPlayer].height / 2) - (double) (Player.tileRangeY * 16)), Player.tileRangeX * 16 * 2, Player.tileRangeY * 16 * 2).Intersects(new Microsoft.Xna.Framework.Rectangle((int) Main.npc[index1].position.X, (int) Main.npc[index1].position.Y, Main.npc[index1].width, Main.npc[index1].height))) flag3 = true; if (Main.player[Main.myPlayer].ownedProjectileCounts[651] > 0) flag3 = false; @@ -30414,61 +30997,53 @@ label_56: { PlayerInput.SetZoom_MouseInWorld(); Main.HoveringOverAnNPC = true; - this.currentNPCShowingChatBubble = npcIndex; + this.currentNPCShowingChatBubble = index1; if (Main.mouseRight && Main.npcChatRelease) { Main.npcChatRelease = false; if (PlayerInput.UsingGamepad) Main.player[Main.myPlayer].releaseInventory = false; - if (Main.player[Main.myPlayer].talkNPC != npcIndex && !Main.player[Main.myPlayer].tileInteractionHappened) + if (Main.player[Main.myPlayer].talkNPC != index1) { Main.CancelHairWindow(); - Main.SetNPCShopIndex(0); + Main.npcShop = 0; Main.InGuideCraftMenu = false; Main.player[Main.myPlayer].dropItemCheck(); Main.npcChatCornerItem = 0; Main.player[Main.myPlayer].sign = -1; Main.editSign = false; - Main.player[Main.myPlayer].SetTalkNPC(npcIndex); + Main.player[Main.myPlayer].talkNPC = index1; Main.playerInventory = false; Main.player[Main.myPlayer].chest = -1; Recipe.FindRecipes(); - Main.npcChatText = Main.npc[npcIndex].GetChat(); - SoundEngine.PlaySound(24); + Main.npcChatText = Main.npc[index1].GetChat(); + Main.PlaySound(24); } } } - if (flag1 && !Main.player[Main.myPlayer].mouseInterface) + if (flag1) { - Main.player[Main.myPlayer].cursorItemIconEnabled = false; - string text = Main.npc[npcIndex].GivenOrTypeName; - int index = npcIndex; - if (Main.npc[npcIndex].realLife >= 0) - index = Main.npc[npcIndex].realLife; - if (Main.npc[index].lifeMax > 1 && !Main.npc[index].dontTakeDamage) - text = text + ": " + (object) Main.npc[index].life + "/" + (object) Main.npc[index].lifeMax; + Main.player[Main.myPlayer].showItemIcon = false; + string text = Main.npc[index1].GivenOrTypeName; + int index2 = index1; + if (Main.npc[index1].realLife >= 0) + index2 = Main.npc[index1].realLife; + if (Main.npc[index2].lifeMax > 1 && !Main.npc[index2].dontTakeDamage) + text = text + ": " + (object) Main.npc[index2].life + "/" + (object) Main.npc[index2].lifeMax; this.MouseTextHackZoom(text); Main.mouseText = true; - NPC npc2 = Main.npc[npcIndex]; - npc2.position = npc2.position - Main.npc[npcIndex].netOffset; break; } if (flag2) - { - NPC npc3 = Main.npc[npcIndex]; - npc3.position = npc3.position - Main.npc[npcIndex].netOffset; break; - } } - NPC npc4 = Main.npc[npcIndex]; - npc4.position = npc4.position - Main.npc[npcIndex].netOffset; } } } - if (!Main.mouseText && Main.signHover != -1 && Main.sign[Main.signHover] != null && !Main.player[Main.myPlayer].mouseInterface && !string.IsNullOrWhiteSpace(Main.sign[Main.signHover].text)) + if (!Main.mouseText && Main.signHover != -1 && Main.sign[Main.signHover] != null && !Main.player[Main.myPlayer].mouseInterface) { int lineAmount; - string[] strArray = Utils.WordwrapString(Main.sign[Main.signHover].text, FontAssets.MouseText.Value, 460, 10, out lineAmount); + string[] strArray = Utils.WordwrapString(Main.sign[Main.signHover].text, Main.fontMouseText, 460, 10, out lineAmount); ++lineAmount; Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Deferred, (BlendState) null, (SamplerState) null, (DepthStencilState) null, (RasterizerState) null, (Effect) null, Main._uiScaleMatrix); @@ -30479,33 +31054,22 @@ label_56: int mouseY = Main.mouseY; PlayerInput.SetZoom_UI(); PlayerInput.SetZoom_Test(); - float num1 = 0.0f; + float num = 0.0f; for (int index = 0; index < lineAmount; ++index) { - float x = FontAssets.MouseText.Value.MeasureString(strArray[index]).X; - if ((double) num1 < (double) x) - num1 = x; + float x = Main.fontMouseText.MeasureString(strArray[index]).X; + if ((double) num < (double) x) + num = x; } - if ((double) num1 > 460.0) - num1 = 460f; - int num2 = Main.SettingsEnabled_OpaqueBoxBehindTooltips ? 1 : 0; + if ((double) num > 460.0) + num = 460f; Vector2 vector2 = new Vector2((float) mouseX, (float) mouseY) + new Vector2(16f); - if (num2 != 0) - vector2 += new Vector2(8f, 2f); if ((double) vector2.Y > (double) (screenHeight - 30 * lineAmount)) vector2.Y = (float) (screenHeight - 30 * lineAmount); - if ((double) vector2.X > (double) screenWidth - (double) num1) - vector2.X = (float) screenWidth - num1; - Microsoft.Xna.Framework.Color textColor = new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor); - if (num2 != 0) - { - textColor = Microsoft.Xna.Framework.Color.Lerp(textColor, Microsoft.Xna.Framework.Color.White, 1f); - int num3 = 10; - int num4 = 5; - Utils.DrawInvBG(Main.spriteBatch, new Microsoft.Xna.Framework.Rectangle((int) vector2.X - num3, (int) vector2.Y - num4, (int) num1 + num3 * 2, 30 * lineAmount + num4 + num4 / 2), new Microsoft.Xna.Framework.Color(23, 25, 81, (int) byte.MaxValue) * 0.925f * 0.85f); - } + if ((double) vector2.X > (double) screenWidth - (double) num) + vector2.X = (float) screenWidth - num; for (int index = 0; index < lineAmount; ++index) - Utils.DrawBorderStringFourWay(Main.spriteBatch, FontAssets.MouseText.Value, strArray[index], vector2.X, vector2.Y + (float) (index * 30), textColor, Microsoft.Xna.Framework.Color.Black, Vector2.Zero); + Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, strArray[index], vector2.X, vector2.Y + (float) (index * 30), new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor), Microsoft.Xna.Framework.Color.Black, Vector2.Zero); Main.mouseText = true; } PlayerInput.SetZoom_UI(); @@ -30514,9 +31078,7 @@ label_56: private static void DrawNPCChatBubble(int i) { int num = -(Main.npc[i].width / 2 + 8); - float y = Main.npc[i].position.Y - (float) TextureAssets.Chat.Height() - (float) (int) Main.screenPosition.Y; - if (Main.npc[i].type == 637 && (double) Main.npc[i].ai[0] == 5.0) - y -= 18f; + float y = Main.npc[i].position.Y - (float) Main.chatTexture.Height - (float) (int) Main.screenPosition.Y; SpriteEffects effects = SpriteEffects.None; if (Main.npc[i].spriteDirection == -1) { @@ -30526,17 +31088,48 @@ label_56: if ((double) Main.player[Main.myPlayer].gravDir != 1.0) { effects |= SpriteEffects.FlipVertically; - y = (float) Main.screenHeight - y - (float) TextureAssets.Chat.Height(); + y = (float) Main.screenHeight - y - (float) Main.chatTexture.Height; } - Vector2 position = new Vector2(Main.npc[i].position.X + (float) (Main.npc[i].width / 2) - Main.screenPosition.X - (float) (TextureAssets.Chat.Width() / 2) - (float) num, y); + Vector2 position = new Vector2(Main.npc[i].position.X + (float) (Main.npc[i].width / 2) - Main.screenPosition.X - (float) (Main.chatTexture.Width / 2) - (float) num, y); Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Deferred, (BlendState) null, SamplerState.PointClamp, (DepthStencilState) null, (RasterizerState) null, (Effect) null, Main.GameViewMatrix.ZoomMatrix); PlayerInput.SetZoom_UI(); - Main.spriteBatch.Draw(TextureAssets.Chat.Value, position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chat.Width(), TextureAssets.Chat.Height())), new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor), 0.0f, new Vector2(), 1f, effects, 0.0f); + Main.spriteBatch.Draw(Main.chatTexture, position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chatTexture.Width, Main.chatTexture.Height)), new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor), 0.0f, new Vector2(), 1f, effects, 0.0f); Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Deferred, (BlendState) null, (SamplerState) null, (DepthStencilState) null, (RasterizerState) null, (Effect) null, Main._uiScaleMatrix); } + private void GUIBarsMouseOverLife() + { + if (Main.mouseText) + return; + int num1 = 26 * Main.player[Main.myPlayer].statLifeMax2 / (int) Main.UIDisplay_LifePerHeart; + int num2 = 0; + if (Main.player[Main.myPlayer].statLifeMax2 > 200) + { + num1 = 260; + num2 += 26; + } + if (Main.mouseX <= 500 + Main.UI_ScreenAnchorX || Main.mouseX >= 500 + num1 + Main.UI_ScreenAnchorX || Main.mouseY <= 32 || Main.mouseY >= 32 + Main.heartTexture.Height + num2) + return; + Main.player[Main.myPlayer].showItemIcon = false; + this.MouseTextHackZoom(Main.player[Main.myPlayer].statLife.ToString() + "/" + (object) Main.player[Main.myPlayer].statLifeMax2); + Main.mouseText = true; + } + + private void GUIBarsMouseOverMana() + { + if (Main.mouseText) + return; + int num1 = 24; + int num2 = 28 * Main.player[Main.myPlayer].statManaMax2 / Main.UIDisplay_ManaPerStar; + if (Main.mouseX <= 762 + Main.UI_ScreenAnchorX || Main.mouseX >= 762 + num1 + Main.UI_ScreenAnchorX || Main.mouseY <= 30 || Main.mouseY >= 30 + num2) + return; + Main.player[Main.myPlayer].showItemIcon = false; + this.MouseTextHackZoom(Main.player[Main.myPlayer].statMana.ToString() + "/" + (object) Main.player[Main.myPlayer].statManaMax2); + Main.mouseText = true; + } + public void GUIBarsDraw() { if (Main.ignoreErrors) @@ -30556,10 +31149,14 @@ label_56: protected void GUIBarsDrawInner() { - Main.ActivePlayerResourcesSet.Draw(); + Main.UI_ScreenAnchorX = Main.screenWidth - 800; + Main.DrawInterface_Resources_Life(); + Main.DrawInterface_Resources_Mana(); Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, Main.UIScaleMatrix); Main.DrawInterface_Resources_Breath(); + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, Main.UIScaleMatrix); Main.DrawInterface_Resources_ClearBuffs(); if (Main.ingameOptionsWindow || Main.playerInventory || Main.inFancyUI) return; @@ -30575,104 +31172,177 @@ label_56: Main.recStart = 0; } + private static void DrawInterface_Resources_Life() + { + Main.UIDisplay_LifePerHeart = 20f; + if (Main.LocalPlayer.ghost) + return; + int num1 = Main.player[Main.myPlayer].statLifeMax / 20; + int num2 = (Main.player[Main.myPlayer].statLifeMax - 400) / 5; + if (num2 < 0) + num2 = 0; + if (num2 > 0) + { + num1 = Main.player[Main.myPlayer].statLifeMax / (20 + num2 / 4); + Main.UIDisplay_LifePerHeart = (float) Main.player[Main.myPlayer].statLifeMax / 20f; + } + int num3 = Main.player[Main.myPlayer].statLifeMax2 - Main.player[Main.myPlayer].statLifeMax; + Main.UIDisplay_LifePerHeart += (float) (num3 / num1); + int num4 = (int) ((double) Main.player[Main.myPlayer].statLifeMax2 / (double) Main.UIDisplay_LifePerHeart); + if (num4 >= 10) + num4 = 10; + string str = Lang.inter[0].Value + " " + (object) Main.player[Main.myPlayer].statLifeMax2 + "/" + (object) Main.player[Main.myPlayer].statLifeMax2; + Vector2 vector2 = Main.fontMouseText.MeasureString(str); + if (!Main.player[Main.myPlayer].ghost) + { + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, Lang.inter[0].Value, new Vector2((float) (500 + 13 * num4) - vector2.X * 0.5f + (float) Main.UI_ScreenAnchorX, 6f), new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, Main.player[Main.myPlayer].statLife.ToString() + "/" + (object) Main.player[Main.myPlayer].statLifeMax2, new Vector2((float) (500 + 13 * num4) + vector2.X * 0.5f + (float) Main.UI_ScreenAnchorX, 6f), new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor), 0.0f, new Vector2(Main.fontMouseText.MeasureString(Main.player[Main.myPlayer].statLife.ToString() + "/" + (object) Main.player[Main.myPlayer].statLifeMax2).X, 0.0f), 1f, SpriteEffects.None, 0.0f); + } + for (int index = 1; index < (int) ((double) Main.player[Main.myPlayer].statLifeMax2 / (double) Main.UIDisplay_LifePerHeart) + 1; ++index) + { + float scale = 1f; + bool flag = false; + int num5; + if ((double) Main.player[Main.myPlayer].statLife >= (double) index * (double) Main.UIDisplay_LifePerHeart) + { + num5 = (int) byte.MaxValue; + if ((double) Main.player[Main.myPlayer].statLife == (double) index * (double) Main.UIDisplay_LifePerHeart) + flag = true; + } + else + { + float num6 = ((float) Main.player[Main.myPlayer].statLife - (float) (index - 1) * Main.UIDisplay_LifePerHeart) / Main.UIDisplay_LifePerHeart; + num5 = (int) (30.0 + 225.0 * (double) num6); + if (num5 < 30) + num5 = 30; + scale = (float) ((double) num6 / 4.0 + 0.75); + if ((double) scale < 0.75) + scale = 0.75f; + if ((double) num6 > 0.0) + flag = true; + } + if (flag) + scale += Main.cursorScale - 1f; + int num7 = 0; + int num8 = 0; + if (index > 10) + { + num7 -= 260; + num8 += 26; + } + int a = (int) ((double) num5 * 0.9); + if (!Main.player[Main.myPlayer].ghost) + { + if (num2 > 0) + { + --num2; + Main.spriteBatch.Draw(Main.heart2Texture, new Vector2((float) (500 + 26 * (index - 1) + num7 + Main.UI_ScreenAnchorX + Main.heartTexture.Width / 2), (float) (32.0 + ((double) Main.heartTexture.Height - (double) Main.heartTexture.Height * (double) scale) / 2.0) + (float) num8 + (float) (Main.heartTexture.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.heartTexture.Width, Main.heartTexture.Height)), new Microsoft.Xna.Framework.Color(num5, num5, num5, a), 0.0f, new Vector2((float) (Main.heartTexture.Width / 2), (float) (Main.heartTexture.Height / 2)), scale, SpriteEffects.None, 0.0f); + } + else + Main.spriteBatch.Draw(Main.heartTexture, new Vector2((float) (500 + 26 * (index - 1) + num7 + Main.UI_ScreenAnchorX + Main.heartTexture.Width / 2), (float) (32.0 + ((double) Main.heartTexture.Height - (double) Main.heartTexture.Height * (double) scale) / 2.0) + (float) num8 + (float) (Main.heartTexture.Height / 2)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.heartTexture.Width, Main.heartTexture.Height)), new Microsoft.Xna.Framework.Color(num5, num5, num5, a), 0.0f, new Vector2((float) (Main.heartTexture.Width / 2), (float) (Main.heartTexture.Height / 2)), scale, SpriteEffects.None, 0.0f); + } + } + } + + private static void DrawInterface_Resources_Mana() + { + Main.UIDisplay_ManaPerStar = 20; + if (Main.LocalPlayer.ghost || Main.player[Main.myPlayer].statManaMax2 <= 0) + return; + int num1 = Main.player[Main.myPlayer].statManaMax2 / 20; + Vector2 vector2 = Main.fontMouseText.MeasureString(Lang.inter[2].Value); + int num2 = 50; + if ((double) vector2.X >= 45.0) + num2 = (int) vector2.X + 5; + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, Lang.inter[2].Value, new Vector2((float) (800 - num2 + Main.UI_ScreenAnchorX), 6f), new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + for (int index = 1; index < Main.player[Main.myPlayer].statManaMax2 / Main.UIDisplay_ManaPerStar + 1; ++index) + { + bool flag = false; + float scale = 1f; + int num3; + if (Main.player[Main.myPlayer].statMana >= index * Main.UIDisplay_ManaPerStar) + { + num3 = (int) byte.MaxValue; + if (Main.player[Main.myPlayer].statMana == index * Main.UIDisplay_ManaPerStar) + flag = true; + } + else + { + float num4 = (float) (Main.player[Main.myPlayer].statMana - (index - 1) * Main.UIDisplay_ManaPerStar) / (float) Main.UIDisplay_ManaPerStar; + num3 = (int) (30.0 + 225.0 * (double) num4); + if (num3 < 30) + num3 = 30; + scale = (float) ((double) num4 / 4.0 + 0.75); + if ((double) scale < 0.75) + scale = 0.75f; + if ((double) num4 > 0.0) + flag = true; + } + if (flag) + scale += Main.cursorScale - 1f; + int a = (int) ((double) num3 * 0.9); + Main.spriteBatch.Draw(Main.manaTexture, new Vector2((float) (775 + Main.UI_ScreenAnchorX), (float) (30 + Main.manaTexture.Height / 2) + (float) (((double) Main.manaTexture.Height - (double) Main.manaTexture.Height * (double) scale) / 2.0) + (float) (28 * (index - 1))), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.manaTexture.Width, Main.manaTexture.Height)), new Microsoft.Xna.Framework.Color(num3, num3, num3, a), 0.0f, new Vector2((float) (Main.manaTexture.Width / 2), (float) (Main.manaTexture.Height / 2)), scale, SpriteEffects.None, 0.0f); + } + } + private void DrawInterface_Resources_Buffs() { Main.recBigList = false; int drawBuffText = -1; int num1 = 11; - for (int buffSlotOnPlayer = 0; buffSlotOnPlayer < 22; ++buffSlotOnPlayer) + for (int i = 0; i < 22; ++i) { - if (Main.player[Main.myPlayer].buffType[buffSlotOnPlayer] > 0) + if (Main.player[Main.myPlayer].buffType[i] > 0) { - int num2 = Main.player[Main.myPlayer].buffType[buffSlotOnPlayer]; - int x = 32 + buffSlotOnPlayer * 38; + int b = Main.player[Main.myPlayer].buffType[i]; + int x = 32 + i * 38; int y = 76; - if (buffSlotOnPlayer >= num1) + if (i >= num1) { - x = 32 + (buffSlotOnPlayer - num1) * 38; + x = 32 + (i - num1) * 38; y += 50; } - drawBuffText = Main.DrawBuffIcon(drawBuffText, buffSlotOnPlayer, x, y); + drawBuffText = Main.DrawBuffIcon(drawBuffText, i, b, x, y); } else - Main.buffAlpha[buffSlotOnPlayer] = 0.4f; + Main.buffAlpha[i] = 0.4f; } if (drawBuffText < 0) return; - int index = Main.player[Main.myPlayer].buffType[drawBuffText]; - if (index <= 0) + int id = Main.player[Main.myPlayer].buffType[drawBuffText]; + if (id <= 0) return; - string buffName = Lang.GetBuffName(index); - string buffTooltip = Main.GetBuffTooltip(Main.player[Main.myPlayer], index); - if (index == 147) + Main.buffString = Lang.GetBuffDescription(id); + if (id == 26 && Main.expertMode) + Main.buffString = Language.GetTextValue("BuffDescription.WellFed_Expert"); + if (id == 147) Main.bannerMouseOver = true; - if (Main.meleeBuff[index]) - this.MouseTextHackZoom(buffName, -10, buffTooltip: buffTooltip); - else - this.MouseTextHackZoom(buffName, buffTooltip); - } - - private static string GetBuffTooltip(Player player, int buffType) - { - string str = Lang.GetBuffDescription(buffType); - switch (buffType) + if (id == 94) { - case 26: - if (Main.expertMode) - { - str = Language.GetTextValue("BuffDescription.WellFed_Expert"); - break; - } - break; - case 94: - int num = (int) ((double) player.manaSickReduction * 100.0) + 1; - str = str + (object) num + "%"; - break; - case 206: - if (Main.expertMode) - { - str = Language.GetTextValue("BuffDescription.WellFed2_Expert"); - break; - } - break; - case 207: - if (Main.expertMode) - { - str = Language.GetTextValue("BuffDescription.WellFed3_Expert"); - break; - } - break; + int num2 = (int) ((double) Main.player[Main.myPlayer].manaSickReduction * 100.0) + 1; + Main.buffString = Main.buffString + (object) num2 + "%"; } - return str; + if (Main.meleeBuff[id]) + this.MouseTextHackZoom(Lang.GetBuffName(id), -10); + else + this.MouseTextHackZoom(Lang.GetBuffName(id)); } - private static bool TryGetBuffTime(int buffSlotOnPlayer, out int buffTimeValue) + private static int DrawBuffIcon(int drawBuffText, int i, int b, int x, int y) { - int index = Main.player[Main.myPlayer].buffType[buffSlotOnPlayer]; - buffTimeValue = 0; - if (Main.vanityPet[index] || Main.lightPet[index] || Main.buffNoTimeDisplay[index] || Main.player[Main.myPlayer].honeyWet && index == 48 || Main.player[Main.myPlayer].wet && Main.expertMode && index == 46) - return false; - buffTimeValue = Main.player[Main.myPlayer].buffTime[buffSlotOnPlayer]; - return true; - } - - private static int DrawBuffIcon(int drawBuffText, int buffSlotOnPlayer, int x, int y) - { - int b = Main.player[Main.myPlayer].buffType[buffSlotOnPlayer]; if (b == 0) return drawBuffText; - Microsoft.Xna.Framework.Color color = new Microsoft.Xna.Framework.Color(Main.buffAlpha[buffSlotOnPlayer], Main.buffAlpha[buffSlotOnPlayer], Main.buffAlpha[buffSlotOnPlayer], Main.buffAlpha[buffSlotOnPlayer]); - Main.spriteBatch.Draw(TextureAssets.Buff[b].Value, new Vector2((float) x, (float) y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Buff[b].Width(), TextureAssets.Buff[b].Height())), color, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - int buffTimeValue; - if (Main.TryGetBuffTime(buffSlotOnPlayer, out buffTimeValue) && buffTimeValue > 2) + Microsoft.Xna.Framework.Color color = new Microsoft.Xna.Framework.Color(Main.buffAlpha[i], Main.buffAlpha[i], Main.buffAlpha[i], Main.buffAlpha[i]); + Main.spriteBatch.Draw(Main.buffTexture[b], new Vector2((float) x, (float) y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.buffTexture[b].Width, Main.buffTexture[b].Height)), color, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + if (!Main.vanityPet[b] && !Main.lightPet[b] && !Main.buffNoTimeDisplay[b] && (!Main.player[Main.myPlayer].honeyWet || b != 48) && (!Main.player[Main.myPlayer].wet || !Main.expertMode || b != 46) && Main.player[Main.myPlayer].buffTime[i] > 2) { - string str = Lang.LocalizedDuration(new TimeSpan(0, 0, buffTimeValue / 60), true, false); - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.ItemStack.Value, str, new Vector2((float) x, (float) (y + TextureAssets.Buff[b].Height())), color, 0.0f, new Vector2(), 0.8f, SpriteEffects.None, 0.0f); + string str = Lang.LocalizedDuration(new TimeSpan(0, 0, Main.player[Main.myPlayer].buffTime[i] / 60), true, false); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontItemStack, str, new Vector2((float) x, (float) (y + Main.buffTexture[b].Height)), color, 0.0f, new Vector2(), 0.8f, SpriteEffects.None, 0.0f); } - if (Main.mouseX < x + TextureAssets.Buff[b].Width() && Main.mouseY < y + TextureAssets.Buff[b].Height() && Main.mouseX > x && Main.mouseY > y) + if (Main.mouseX < x + Main.buffTexture[b].Width && Main.mouseY < y + Main.buffTexture[b].Height && Main.mouseX > x && Main.mouseY > y) { - drawBuffText = buffSlotOnPlayer; - Main.buffAlpha[buffSlotOnPlayer] += 0.1f; + drawBuffText = i; + Main.buffAlpha[i] += 0.1f; bool flag = Main.mouseRight && Main.mouseRightRelease; if (PlayerInput.UsingGamepad) { @@ -30683,14 +31353,14 @@ label_56: else Main.player[Main.myPlayer].mouseInterface = true; if (flag) - Main.TryRemovingBuff(buffSlotOnPlayer, b); + Main.TryRemovingBuff(i, b); } else - Main.buffAlpha[buffSlotOnPlayer] -= 0.05f; - if ((double) Main.buffAlpha[buffSlotOnPlayer] > 1.0) - Main.buffAlpha[buffSlotOnPlayer] = 1f; - else if ((double) Main.buffAlpha[buffSlotOnPlayer] < 0.4) - Main.buffAlpha[buffSlotOnPlayer] = 0.4f; + Main.buffAlpha[i] -= 0.05f; + if ((double) Main.buffAlpha[i] > 1.0) + Main.buffAlpha[i] = 1f; + else if ((double) Main.buffAlpha[i] < 0.4) + Main.buffAlpha[i] = 0.4f; if (PlayerInput.UsingGamepad && !Main.playerInventory) drawBuffText = -1; return drawBuffText; @@ -30706,26 +31376,16 @@ label_56: Main.player[Main.myPlayer].mount.Dismount(Main.player[Main.myPlayer]); flag = true; } - Main.TryRemovingBuff_CheckBuffHideMisc(0, b); - Main.TryRemovingBuff_CheckBuffHideMisc(1, b); - SoundEngine.PlaySound(12); + if (Main.player[Main.myPlayer].miscEquips[0].buffType == b && !Main.player[Main.myPlayer].hideMisc[0]) + Main.player[Main.myPlayer].hideMisc[0] = true; + if (Main.player[Main.myPlayer].miscEquips[1].buffType == b && !Main.player[Main.myPlayer].hideMisc[1]) + Main.player[Main.myPlayer].hideMisc[1] = true; + Main.PlaySound(12); if (flag) return; Main.player[Main.myPlayer].DelBuff(i); } - private static void TryRemovingBuff_CheckBuffHideMisc(int slot, int buffID) - { - if (Main.player[Main.myPlayer].hideMisc[slot]) - return; - bool flag = Main.player[Main.myPlayer].miscEquips[slot].buffType == buffID; - if (!flag && (buffID == 102 || buffID == 101)) - flag = Main.player[Main.myPlayer].miscEquips[slot].buffType == 27; - if (!flag) - return; - Main.player[Main.myPlayer].hideMisc[slot] = true; - } - private static void DrawInterface_Resources_Breath() { bool flag = false; @@ -30777,7 +31437,7 @@ label_56: num5 -= 260; num6 += 26; } - Main.spriteBatch.Draw(TextureAssets.Bubble.Value, vector2_3 + new Vector2((float) (26 * (index - 1) + num5) - 125f, (float) (32.0 + ((double) TextureAssets.Bubble.Height() - (double) TextureAssets.Bubble.Height() * (double) scale) / 2.0) + (float) num6), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Bubble.Width(), TextureAssets.Bubble.Height())), new Microsoft.Xna.Framework.Color(num3, num3, num3, num3), 0.0f, new Vector2(), scale, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.bubbleTexture, vector2_3 + new Vector2((float) (26 * (index - 1) + num5) - 125f, (float) (32.0 + ((double) Main.bubbleTexture.Height - (double) Main.bubbleTexture.Height * (double) scale) / 2.0) + (float) num6), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.bubbleTexture.Width, Main.bubbleTexture.Height)), new Microsoft.Xna.Framework.Color(num3, num3, num3, num3), 0.0f, new Vector2(), scale, SpriteEffects.None, 0.0f); } } if (((Main.player[Main.myPlayer].lavaTime >= Main.player[Main.myPlayer].lavaMax ? 0 : (!Main.player[Main.myPlayer].ghost ? 1 : 0)) & (flag ? 1 : 0)) == 0) @@ -30809,64 +31469,10 @@ label_56: num11 -= 260; num12 += 26; } - Main.spriteBatch.Draw(TextureAssets.Flame.Value, vector2_3 + new Vector2((float) (26 * (index - 1) + num11) - 125f, (float) (32.0 + ((double) TextureAssets.Flame.Height() - (double) TextureAssets.Flame.Height() * (double) scale) / 2.0) + (float) num12), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Bubble.Width(), TextureAssets.Bubble.Height())), new Microsoft.Xna.Framework.Color(num9, num9, num9, num9), 0.0f, new Vector2(), scale, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.flameTexture, vector2_3 + new Vector2((float) (26 * (index - 1) + num11) - 125f, (float) (32.0 + ((double) Main.flameTexture.Height - (double) Main.flameTexture.Height * (double) scale) / 2.0) + (float) num12), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.bubbleTexture.Width, Main.bubbleTexture.Height)), new Microsoft.Xna.Framework.Color(num9, num9, num9, num9), 0.0f, new Vector2(), scale, SpriteEffects.None, 0.0f); } } - private static void DrawInterface_Resources_GolfPower() - { - Projectile golfHelper = (Projectile) null; - for (int index = 0; index < 1000; ++index) - { - Projectile projectile = Main.projectile[index]; - if (projectile.active && projectile.owner == Main.myPlayer && projectile.type == 722) - { - golfHelper = projectile; - break; - } - } - if (golfHelper == null) - return; - Projectile golfBallForHelper = GolfHelper.FindGolfBallForHelper(golfHelper); - if (golfBallForHelper == null) - return; - float relativeStrength = GolfHelper.CalculateShotStrength(golfHelper, (Entity) golfBallForHelper).RelativeStrength; - if ((double) relativeStrength < 1.0 / 1000.0) - return; - Vector2 position = (Main.LocalPlayer.Bottom - Main.Camera.ScaledPosition) * Main.GameViewMatrix.Zoom / Main.UIScale; - position.X -= 27f; - position.Y += 14f; - Main.spriteBatch.Draw(TextureAssets.GolfSwingBarPanel.Value, position, new Microsoft.Xna.Framework.Rectangle?(), Microsoft.Xna.Framework.Color.White); - Main.spriteBatch.Draw(TextureAssets.GolfSwingBarFill.Value, position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, (int) (54.0 * (double) relativeStrength), 14)), Microsoft.Xna.Framework.Color.White); - } - - private static void DrawInterface_GolfBallIndicator() - { - if (!Item.IsAGolfingItem(Main.LocalPlayer.HeldItem)) - return; - Projectile lastHitBall = Main.LocalGolfState.GetLastHitBall(); - if (lastHitBall == null || !GolfHelper.IsGolfBallResting(lastHitBall)) - return; - Vector2 vector2_1 = (lastHitBall.Top - Main.Camera.ScaledPosition) * Main.GameViewMatrix.Zoom / Main.UIScale; - float num1 = MathHelper.Clamp((float) (((double) (Main.LocalPlayer.position - lastHitBall.position).Length() - 150.0) / 50.0), 0.0f, 1f); - Vector2 vector2_2 = Vector2.Clamp(vector2_1, new Vector2(20f), Main.Camera.UnscaledSize - new Vector2(20f)); - float rotation = 0.0f; - if (vector2_2 != vector2_1) - rotation = (vector2_2 - vector2_1).ToRotation() + 1.570796f; - Vector2 position = vector2_2 - (rotation + 1.570796f).ToRotationVector2() * (float) ((Math.Sin((double) Main.GlobalTimeWrappedHourly * 4.0) * 0.5 + 0.5) * 5.0 + 14.0); - Texture2D texture2D = TextureAssets.GolfBallArrow.Value; - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(2); - Vector2 origin = r.Size() * new Vector2(0.5f, 1f); - Microsoft.Xna.Framework.Rectangle rectangle = texture2D.Frame(2, frameX: 1); - Main.spriteBatch.Draw(TextureAssets.GolfBallArrowShadow.Value, position + new Vector2(-4f, 4f) * 1.5f, new Microsoft.Xna.Framework.Rectangle?(r), Microsoft.Xna.Framework.Color.White * num1, rotation, origin, 1.5f, SpriteEffects.None, 0.0f); - float amount = (float) (Math.Sin((double) Main.GlobalTimeWrappedHourly * 4.0) * 0.5 + 0.5); - for (float num2 = 0.0f; (double) num2 < 1.0; num2 += 0.25f) - Main.spriteBatch.Draw(texture2D, position + (6.283185f * num2 + rotation).ToRotationVector2() * MathHelper.Lerp(2f, 2f, amount), new Microsoft.Xna.Framework.Rectangle?(rectangle), Microsoft.Xna.Framework.Color.Black * num1 * MathHelper.Lerp(1f, 1f, amount), rotation, origin, 1.5f, SpriteEffects.None, 0.0f); - for (float num3 = 0.0f; (double) num3 < 1.0; num3 += 0.25f) - Main.spriteBatch.Draw(texture2D, position + (6.283185f * num3 + rotation).ToRotationVector2() * MathHelper.Lerp(0.0f, 0.0f, amount), new Microsoft.Xna.Framework.Rectangle?(rectangle), Microsoft.Xna.Framework.Color.White * num1 * MathHelper.Lerp(0.8f, 0.8f, amount), rotation, origin, 1.5f, SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(r), Main.mouseColor * num1, rotation, origin, 1.5f, SpriteEffects.None, 0.0f); - } - protected void GUIHotbarDrawInner() { if (Main.playerInventory || Main.player[Main.myPlayer].ghost) @@ -30874,8 +31480,8 @@ label_56: string str = Lang.inter[37].Value; if (Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].Name != null && Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].Name != "") str = Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].AffixName(); - Vector2 vector2 = FontAssets.MouseText.Value.MeasureString(str) / 2f; - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, str, new Vector2(236f - vector2.X, 0.0f), new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Vector2 vector2 = Main.fontMouseText.MeasureString(str) / 2f; + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str, new Vector2(236f - vector2.X, 0.0f), new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); int num1 = 20; for (int slot = 0; slot < 10; ++slot) { @@ -30889,10 +31495,10 @@ label_56: float num2 = Main.hotbarScale[slot]; int num3 = (int) (20.0 + 22.0 * (1.0 - (double) num2)); Microsoft.Xna.Framework.Color lightColor = new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) (75.0 + 150.0 * (double) num2)); - if (!Main.player[Main.myPlayer].hbLocked && !PlayerInput.IgnoreMouseInterface && Main.mouseX >= num1 && (double) Main.mouseX <= (double) num1 + (double) TextureAssets.InventoryBack.Width() * (double) Main.hotbarScale[slot] && Main.mouseY >= num3 && (double) Main.mouseY <= (double) num3 + (double) TextureAssets.InventoryBack.Height() * (double) Main.hotbarScale[slot] && !Main.player[Main.myPlayer].channel) + if (!Main.player[Main.myPlayer].hbLocked && !PlayerInput.IgnoreMouseInterface && Main.mouseX >= num1 && (double) Main.mouseX <= (double) num1 + (double) Main.inventoryBackTexture.Width * (double) Main.hotbarScale[slot] && Main.mouseY >= num3 && (double) Main.mouseY <= (double) num3 + (double) Main.inventoryBackTexture.Height * (double) Main.hotbarScale[slot] && !Main.player[Main.myPlayer].channel) { Main.player[Main.myPlayer].mouseInterface = true; - Main.player[Main.myPlayer].cursorItemIconEnabled = false; + Main.player[Main.myPlayer].showItemIcon = false; if (Main.mouseLeft && !Main.player[Main.myPlayer].hbLocked && !Main.blockMouse) Main.player[Main.myPlayer].changeItem = slot; Main.hoverItemName = Main.player[Main.myPlayer].inventory[slot].AffixName(); @@ -30904,7 +31510,7 @@ label_56: Main.inventoryScale = num2; ItemSlot.Draw(Main.spriteBatch, Main.player[Main.myPlayer].inventory, 13, slot, new Vector2((float) num1, (float) num3), lightColor); Main.inventoryScale = (float) inventoryScale; - num1 += (int) ((double) TextureAssets.InventoryBack.Width() * (double) Main.hotbarScale[slot]) + 4; + num1 += (int) ((double) Main.inventoryBackTexture.Width * (double) Main.hotbarScale[slot]) + 4; } int selectedItem = Main.player[Main.myPlayer].selectedItem; if (selectedItem < 10 || selectedItem == 58 && Main.mouseItem.type <= 0) @@ -30928,7 +31534,7 @@ label_56: Main.oldHairStyle = Main.player[Main.myPlayer].hair; Main.oldHairColor = Main.player[Main.myPlayer].hairColor; Main.hairWindow = true; - SoundEngine.PlaySound(10); + Main.PlaySound(10); } public static void CancelHairWindow() @@ -30939,22 +31545,22 @@ label_56: Main.player[Main.myPlayer].hairColor = Main.oldHairColor; Main.hairWindow = false; if (Main.player[Main.myPlayer].talkNPC > -1 && Main.npc[Main.player[Main.myPlayer].talkNPC].type == 353) - Main.player[Main.myPlayer].SetTalkNPC(-1); - SoundEngine.PlaySound(11); + Main.player[Main.myPlayer].talkNPC = -1; + Main.PlaySound(11); } public static void BuyHairWindow() { - SoundEngine.PlaySound(18); + Main.PlaySound(18); Main.hairWindow = false; - Main.player[Main.myPlayer].SetTalkNPC(-1); + Main.player[Main.myPlayer].talkNPC = -1; Main.npcChatCornerItem = 0; NetMessage.SendData(4, number: Main.myPlayer); } public static int UnlockedMaxHair() { - int num = 151; + int num = 123; if (NPC.downedMartians) num += 10; if (NPC.downedMartians && NPC.downedMoonlord) @@ -30970,80 +31576,78 @@ label_56: } else { - Main.Hairstyles.UpdateUnlocks(); - int count = Main.Hairstyles.AvailableHairstyles.Count; + int num1 = Main.UnlockedMaxHair(); int y1 = Main.screenHeight / 2 + 60; - int x1 = Main.screenWidth / 2 - TextureAssets.HairStyleBack.Width() / 2; - int num1 = y1 + 42; - int num2 = x1 + 22; - int num3 = x1 + 234; - int num4 = y1 + 18; + int x1 = Main.screenWidth / 2 - Main.hairStyleBackTexture.Width / 2; + int num2 = y1 + 42; + int num3 = x1 + 22; + int num4 = x1 + 234; + int num5 = y1 + 18; Main.selColor = Main.player[Main.myPlayer].hairColor; - Main.spriteBatch.Draw(TextureAssets.HairStyleBack.Value, new Vector2((float) x1, (float) y1), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.HairStyleBack.Width(), TextureAssets.HairStyleBack.Height())), new Microsoft.Xna.Framework.Color(200, 200, 200, 200), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - if (new Microsoft.Xna.Framework.Rectangle(x1, y1, TextureAssets.HairStyleBack.Width(), TextureAssets.HairStyleBack.Height()).Contains(Main.MouseScreen.ToPoint())) + Main.spriteBatch.Draw(Main.hairStyleBackTexture, new Vector2((float) x1, (float) y1), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.hairStyleBackTexture.Width, Main.hairStyleBackTexture.Height)), new Microsoft.Xna.Framework.Color(200, 200, 200, 200), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + if (new Microsoft.Xna.Framework.Rectangle(x1, y1, Main.hairStyleBackTexture.Width, Main.hairStyleBackTexture.Height).Contains(Main.MouseScreen.ToPoint())) { - int num5 = -(PlayerInput.ScrollWheelDelta / 120); - int num6 = Math.Sign(num5); - for (; num5 != 0; num5 -= num6) + int num6 = -(PlayerInput.ScrollWheelDelta / 120); + int num7 = Math.Sign(num6); + for (; num6 != 0; num6 -= num7) { - if (num5 < 0) + if (num6 < 0) { Main.hairStart -= 5; - SoundEngine.PlaySound(12); + Main.PlaySound(12); } else { Main.hairStart += 5; - SoundEngine.PlaySound(12); + Main.PlaySound(12); } } } - if (Main.mouseX > x1 && Main.mouseX < x1 + TextureAssets.HairStyleBack.Width() && Main.mouseY > y1 && Main.mouseY < y1 + TextureAssets.HairStyleBack.Height()) + if (Main.mouseX > x1 && Main.mouseX < x1 + Main.hairStyleBackTexture.Width && Main.mouseY > y1 && Main.mouseY < y1 + Main.hairStyleBackTexture.Height) Main.player[Main.myPlayer].mouseInterface = true; - int num7 = num3 - 18; - int num8 = num4 + 74; + int num8 = num4 - 18; + int num9 = num5 + 74; if (Main.hairStart > 1) { - if (Main.mouseX >= num7 && Main.mouseX <= num7 + TextureAssets.CraftUpButton.Width() && Main.mouseY >= num8 && Main.mouseY <= num8 + TextureAssets.CraftUpButton.Height()) + if (Main.mouseX >= num8 && Main.mouseX <= num8 + Main.craftUpButtonTexture.Width && Main.mouseY >= num9 && Main.mouseY <= num9 + Main.craftUpButtonTexture.Height) { Main.player[Main.myPlayer].mouseInterface = true; if (Main.mouseLeftRelease && Main.mouseLeft) { Main.hairStart -= 15; - SoundEngine.PlaySound(12); + Main.PlaySound(12); } } - Main.spriteBatch.Draw(TextureAssets.ScrollLeftButton.Value, new Vector2((float) num7, (float) num8), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.CraftUpButton.Width(), TextureAssets.CraftUpButton.Height())), new Microsoft.Xna.Framework.Color(200, 200, 200, 200), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.scrollLeftButtonTexture, new Vector2((float) num8, (float) num9), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.craftUpButtonTexture.Width, Main.craftUpButtonTexture.Height)), new Microsoft.Xna.Framework.Color(200, 200, 200, 200), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } - if (Main.hairStart + 15 < count) + if (Main.hairStart + 15 < num1) { - int num9 = num7 + 296; - if (Main.mouseX >= num9 && Main.mouseX <= num9 + TextureAssets.CraftUpButton.Width() && Main.mouseY >= num8 && Main.mouseY <= num8 + TextureAssets.CraftUpButton.Height()) + int num10 = num8 + 296; + if (Main.mouseX >= num10 && Main.mouseX <= num10 + Main.craftUpButtonTexture.Width && Main.mouseY >= num9 && Main.mouseY <= num9 + Main.craftUpButtonTexture.Height) { Main.player[Main.myPlayer].mouseInterface = true; if (Main.mouseLeftRelease && Main.mouseLeft) { Main.hairStart += 15; - SoundEngine.PlaySound(12); + Main.PlaySound(12); } } - Main.spriteBatch.Draw(TextureAssets.ScrollRightButton.Value, new Vector2((float) num9, (float) num8), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.CraftUpButton.Width(), TextureAssets.CraftUpButton.Height())), new Microsoft.Xna.Framework.Color(200, 200, 200, 200), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.scrollRightButtonTexture, new Vector2((float) num10, (float) num9), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.craftUpButtonTexture.Width, Main.craftUpButtonTexture.Height)), new Microsoft.Xna.Framework.Color(200, 200, 200, 200), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } - if (Main.hairStart + 15 >= count) - Main.hairStart = count - 15; + if (Main.hairStart + 15 >= num1) + Main.hairStart = num1 - 15; if (Main.hairStart < 0) Main.hairStart = 0; - int num10 = 0; + int num11 = 0; if (Main.oldHairStyle != Main.player[Main.myPlayer].hair) { if (Main.player[Main.myPlayer].hair > 51) - num10 += 200000; + num11 += 50000; else - num10 += 20000; + num11 += 10000; } if (Main.oldHairColor != Main.player[Main.myPlayer].hairColor) - num10 += 20000; - int num11 = (int) Math.Round((double) (int) ((double) num10 * Main.player[Main.myPlayer].currentShoppingSettings.PriceAdjustment) / 10000.0) * 10000; + num11 += 10000; string str1 = ""; int num12 = 0; int num13 = 0; @@ -31087,33 +31691,29 @@ label_56: string str2 = textValue1; int num19 = x1 + 18; int num20 = y1 + 156; - bool flag1 = false; if (price > 0) ItemSlot.DrawSavings(Main.spriteBatch, (float) num19, (float) (num20 - 70), true); - if (price > 0 && Main.mouseX > num19 && (double) Main.mouseX < (double) num19 + (double) FontAssets.MouseText.Value.MeasureString(str2).X && Main.mouseY > num20 && (double) Main.mouseY < (double) num20 + (double) FontAssets.MouseText.Value.MeasureString(str2).Y) + if (price > 0 && Main.mouseX > num19 && (double) Main.mouseX < (double) num19 + (double) Main.fontMouseText.MeasureString(str2).X && Main.mouseY > num20 && (double) Main.mouseY < (double) num20 + (double) Main.fontMouseText.MeasureString(str2).Y) { - flag1 = true; num18 = 1.1f; if (!Main.npcChatFocus1) - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.npcChatFocus1 = true; Main.player[Main.myPlayer].releaseUseItem = false; } else { if (Main.npcChatFocus1) - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.npcChatFocus1 = false; } - Vector2 vector2_1 = FontAssets.MouseText.Value.MeasureString(str2) * 0.5f; + Vector2 vector2_1 = Main.fontMouseText.MeasureString(str2) * 0.5f; UILinkPointNavigator.SetPosition(2603, new Vector2((float) num19, (float) num20) + vector2_1); for (int index = 0; index < 5; ++index) { int num21 = num19; int num22 = num20; Microsoft.Xna.Framework.Color color2 = Microsoft.Xna.Framework.Color.Black; - if (flag1) - color2 = Microsoft.Xna.Framework.Color.Brown; if (index == 0) num21 -= 2; if (index == 1) @@ -31124,36 +31724,32 @@ label_56: num22 += 2; if (index == 4) color2 = price != 0 ? color1 : new Microsoft.Xna.Framework.Color(100, 100, 100); - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, str2, new Vector2((float) num21 + vector2_1.X, (float) num22 + vector2_1.Y), color2, 0.0f, vector2_1, num18, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str2, new Vector2((float) num21 + vector2_1.X, (float) num22 + vector2_1.Y), color2, 0.0f, vector2_1, num18, SpriteEffects.None, 0.0f); } float num23 = 0.9f; string textValue2 = Language.GetTextValue("GameUI.Cancel"); int num24 = num19 + 130; - bool flag2 = false; - if (Main.mouseX > num24 && (double) Main.mouseX < (double) num24 + (double) FontAssets.MouseText.Value.MeasureString(textValue2).X && Main.mouseY > num20 && (double) Main.mouseY < (double) num20 + (double) FontAssets.MouseText.Value.MeasureString(textValue2).Y) + if (Main.mouseX > num24 && (double) Main.mouseX < (double) num24 + (double) Main.fontMouseText.MeasureString(textValue2).X && Main.mouseY > num20 && (double) Main.mouseY < (double) num20 + (double) Main.fontMouseText.MeasureString(textValue2).Y) { - flag2 = true; num23 = 1.1f; if (!Main.npcChatFocus2) - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.npcChatFocus2 = true; Main.player[Main.myPlayer].releaseUseItem = false; } else { if (Main.npcChatFocus2) - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.npcChatFocus2 = false; } - Vector2 vector2_2 = FontAssets.MouseText.Value.MeasureString(textValue2) * 0.5f; + Vector2 vector2_2 = Main.fontMouseText.MeasureString(textValue2) * 0.5f; UILinkPointNavigator.SetPosition(2604, new Vector2((float) num24, (float) num20) + vector2_2); for (int index = 0; index < 5; ++index) { int num25 = num24; int num26 = num20; Microsoft.Xna.Framework.Color color3 = Microsoft.Xna.Framework.Color.Black; - if (flag2) - color3 = Microsoft.Xna.Framework.Color.Brown; if (index == 0) num25 -= 2; if (index == 1) @@ -31164,7 +31760,7 @@ label_56: num26 += 2; if (index == 4) color3 = color1; - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, textValue2, new Vector2((float) num25 + vector2_2.X, (float) num26 + vector2_2.Y), color3, 0.0f, vector2_2, num23, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, textValue2, new Vector2((float) num25 + vector2_2.X, (float) num26 + vector2_2.Y), color3, 0.0f, vector2_2, num23, SpriteEffects.None, 0.0f); } if (Main.mouseLeft && Main.mouseLeftRelease) { @@ -31207,37 +31803,37 @@ label_56: Luminosity1 = Main.lBar; Main.aBar = num28; } - UILinkPointNavigator.SetPosition(2600, new Vector2((float) num2, (float) num1) + TextureAssets.Hue.Value.Size() / 2f); - Main.spriteBatch.Draw(TextureAssets.Hue.Value, new Vector2((float) num2, (float) num1), Microsoft.Xna.Framework.Color.White); - if (Main.mouseX > num2 - 4 && Main.mouseX < num2 + TextureAssets.Hue.Width() + 4 && Main.mouseY > num1 - 4 && Main.mouseY < num1 + TextureAssets.Hue.Height() + 4 || this.grabColorSlider == 1) - Main.spriteBatch.Draw(TextureAssets.ColorHighlight.Value, new Vector2((float) num2, (float) num1), Main.OurFavoriteColor); - Main.spriteBatch.Draw(TextureAssets.ColorSlider.Value, new Vector2((float) num2 + (float) (TextureAssets.Hue.Width() - 2) * Main.hBar - (float) (TextureAssets.ColorSlider.Width() / 2), (float) (num1 - TextureAssets.ColorSlider.Height() / 2 + TextureAssets.Hue.Height() / 2)), Microsoft.Xna.Framework.Color.White); - if ((Main.mouseX > num2 - 4 && Main.mouseX < num2 + TextureAssets.Hue.Width() + 4 && Main.mouseY > num1 - 4 && Main.mouseY < num1 + TextureAssets.Hue.Height() + 4 || this.grabColorSlider == 1) && Main.mouseLeft && !Main.blockMouse) + UILinkPointNavigator.SetPosition(2600, new Vector2((float) num3, (float) num2) + this.hueTexture.Size() / 2f); + Main.spriteBatch.Draw(this.hueTexture, new Vector2((float) num3, (float) num2), Microsoft.Xna.Framework.Color.White); + if (Main.mouseX > num3 - 4 && Main.mouseX < num3 + this.hueTexture.Width + 4 && Main.mouseY > num2 - 4 && Main.mouseY < num2 + this.hueTexture.Height + 4 || this.grabColorSlider == 1) + Main.spriteBatch.Draw(Main.colorHighlightTexture, new Vector2((float) num3, (float) num2), Main.OurFavoriteColor); + Main.spriteBatch.Draw(Main.colorSliderTexture, new Vector2((float) num3 + (float) (this.hueTexture.Width - 2) * Main.hBar - (float) (Main.colorSliderTexture.Width / 2), (float) (num2 - Main.colorSliderTexture.Height / 2 + this.hueTexture.Height / 2)), Microsoft.Xna.Framework.Color.White); + if ((Main.mouseX > num3 - 4 && Main.mouseX < num3 + this.hueTexture.Width + 4 && Main.mouseY > num2 - 4 && Main.mouseY < num2 + this.hueTexture.Height + 4 || this.grabColorSlider == 1) && Main.mouseLeft && !Main.blockMouse) { this.grabColorSlider = 1; - Hue = (float) (Main.mouseX - num2) / (float) TextureAssets.Hue.Width(); + Hue = (float) (Main.mouseX - num3) / (float) this.hueTexture.Width; if ((double) Hue < 0.0) Hue = 0.0f; if ((double) Hue > 1.0) Hue = 1f; Main.hBar = Hue; } - int num29 = num1 + 26; - UILinkPointNavigator.SetPosition(2601, new Vector2((float) num2, (float) num29) + TextureAssets.ColorBar.Value.Size() / 2f); - Main.spriteBatch.Draw(TextureAssets.ColorBar.Value, new Vector2((float) num2, (float) num29), Microsoft.Xna.Framework.Color.White); + int num29 = num2 + 26; + UILinkPointNavigator.SetPosition(2601, new Vector2((float) num3, (float) num29) + Main.colorBarTexture.Size() / 2f); + Main.spriteBatch.Draw(Main.colorBarTexture, new Vector2((float) num3, (float) num29), Microsoft.Xna.Framework.Color.White); for (int index = 0; index <= num27; ++index) { float Saturation2 = (float) index / (float) num27; Microsoft.Xna.Framework.Color rgb = Main.hslToRgb(Hue, Saturation2, Luminosity1); - Main.spriteBatch.Draw(TextureAssets.ColorBlip.Value, new Vector2((float) (num2 + index + 5), (float) (num29 + 4)), rgb); + Main.spriteBatch.Draw(Main.colorBlipTexture, new Vector2((float) (num3 + index + 5), (float) (num29 + 4)), rgb); } - if (Main.mouseX > num2 - 4 && Main.mouseX < num2 + TextureAssets.Hue.Width() + 4 && Main.mouseY > num29 - 4 && Main.mouseY < num29 + TextureAssets.Hue.Height() + 4 || this.grabColorSlider == 2) - Main.spriteBatch.Draw(TextureAssets.ColorHighlight.Value, new Vector2((float) num2, (float) num29), Main.OurFavoriteColor); - Main.spriteBatch.Draw(TextureAssets.ColorSlider.Value, new Vector2((float) num2 + (float) (TextureAssets.Hue.Width() - 2) * Main.sBar - (float) (TextureAssets.ColorSlider.Width() / 2), (float) (num29 - TextureAssets.ColorSlider.Height() / 2 + TextureAssets.Hue.Height() / 2)), Microsoft.Xna.Framework.Color.White); - if ((Main.mouseX > num2 - 4 && Main.mouseX < num2 + TextureAssets.Hue.Width() + 4 && Main.mouseY > num29 - 4 && Main.mouseY < num29 + TextureAssets.Hue.Height() + 4 || this.grabColorSlider == 2) && Main.mouseLeft && !Main.blockMouse) + if (Main.mouseX > num3 - 4 && Main.mouseX < num3 + this.hueTexture.Width + 4 && Main.mouseY > num29 - 4 && Main.mouseY < num29 + this.hueTexture.Height + 4 || this.grabColorSlider == 2) + Main.spriteBatch.Draw(Main.colorHighlightTexture, new Vector2((float) num3, (float) num29), Main.OurFavoriteColor); + Main.spriteBatch.Draw(Main.colorSliderTexture, new Vector2((float) num3 + (float) (this.hueTexture.Width - 2) * Main.sBar - (float) (Main.colorSliderTexture.Width / 2), (float) (num29 - Main.colorSliderTexture.Height / 2 + this.hueTexture.Height / 2)), Microsoft.Xna.Framework.Color.White); + if ((Main.mouseX > num3 - 4 && Main.mouseX < num3 + this.hueTexture.Width + 4 && Main.mouseY > num29 - 4 && Main.mouseY < num29 + this.hueTexture.Height + 4 || this.grabColorSlider == 2) && Main.mouseLeft && !Main.blockMouse) { this.grabColorSlider = 2; - Saturation1 = (float) (Main.mouseX - num2) / (float) TextureAssets.Hue.Width(); + Saturation1 = (float) (Main.mouseX - num3) / (float) this.hueTexture.Width; if ((double) Saturation1 < 0.0) Saturation1 = 0.0f; if ((double) Saturation1 > 1.0) @@ -31245,22 +31841,22 @@ label_56: Main.sBar = Saturation1; } int num30 = num29 + 26; - UILinkPointNavigator.SetPosition(2602, new Vector2((float) num2, (float) num30) + TextureAssets.ColorBar.Value.Size() / 2f); - Main.spriteBatch.Draw(TextureAssets.ColorBar.Value, new Vector2((float) num2, (float) num30), Microsoft.Xna.Framework.Color.White); + UILinkPointNavigator.SetPosition(2602, new Vector2((float) num3, (float) num30) + Main.colorBarTexture.Size() / 2f); + Main.spriteBatch.Draw(Main.colorBarTexture, new Vector2((float) num3, (float) num30), Microsoft.Xna.Framework.Color.White); float num31 = 0.15f; for (int index = 0; index <= num27; ++index) { float Luminosity2 = (float) index / (float) num27; Microsoft.Xna.Framework.Color rgb = Main.hslToRgb(Hue, Saturation1, Luminosity2); - Main.spriteBatch.Draw(TextureAssets.ColorBlip.Value, new Vector2((float) (num2 + index + 5), (float) (num30 + 4)), rgb); + Main.spriteBatch.Draw(Main.colorBlipTexture, new Vector2((float) (num3 + index + 5), (float) (num30 + 4)), rgb); } - if (Main.mouseX > num2 - 4 && Main.mouseX < num2 + TextureAssets.Hue.Width() + 4 && Main.mouseY > num30 - 4 && Main.mouseY < num30 + TextureAssets.Hue.Height() + 4 || this.grabColorSlider == 3) - Main.spriteBatch.Draw(TextureAssets.ColorHighlight.Value, new Vector2((float) num2, (float) num30), Main.OurFavoriteColor); - Main.spriteBatch.Draw(TextureAssets.ColorSlider.Value, new Vector2((float) num2 + (float) (TextureAssets.Hue.Width() - 2) * (float) (((double) Main.lBar - (double) num31) / (1.0 - (double) num31)) - (float) (TextureAssets.ColorSlider.Width() / 2), (float) (num30 - TextureAssets.ColorSlider.Height() / 2 + TextureAssets.Hue.Height() / 2)), Microsoft.Xna.Framework.Color.White); - if ((Main.mouseX > num2 - 4 && Main.mouseX < num2 + TextureAssets.Hue.Width() + 4 && Main.mouseY > num30 - 4 && Main.mouseY < num30 + TextureAssets.Hue.Height() + 4 || this.grabColorSlider == 3) && Main.mouseLeft && !Main.blockMouse) + if (Main.mouseX > num3 - 4 && Main.mouseX < num3 + this.hueTexture.Width + 4 && Main.mouseY > num30 - 4 && Main.mouseY < num30 + this.hueTexture.Height + 4 || this.grabColorSlider == 3) + Main.spriteBatch.Draw(Main.colorHighlightTexture, new Vector2((float) num3, (float) num30), Main.OurFavoriteColor); + Main.spriteBatch.Draw(Main.colorSliderTexture, new Vector2((float) num3 + (float) (this.hueTexture.Width - 2) * (float) (((double) Main.lBar - (double) num31) / (1.0 - (double) num31)) - (float) (Main.colorSliderTexture.Width / 2), (float) (num30 - Main.colorSliderTexture.Height / 2 + this.hueTexture.Height / 2)), Microsoft.Xna.Framework.Color.White); + if ((Main.mouseX > num3 - 4 && Main.mouseX < num3 + this.hueTexture.Width + 4 && Main.mouseY > num30 - 4 && Main.mouseY < num30 + this.hueTexture.Height + 4 || this.grabColorSlider == 3) && Main.mouseLeft && !Main.blockMouse) { this.grabColorSlider = 3; - float num32 = (float) (Main.mouseX - num2) / (float) TextureAssets.Hue.Width(); + float num32 = (float) (Main.mouseX - num3) / (float) this.hueTexture.Width; if ((double) num32 < 0.0) num32 = 0.0f; if ((double) num32 > 1.0) @@ -31269,44 +31865,39 @@ label_56: } Main.selColor = Main.hslToRgb(Main.hBar, Main.sBar, Main.lBar); Main.player[Main.myPlayer].hairColor = Main.selColor; - int x2 = num3; - int y2 = num4; + int num33 = num4; + int num34 = num5; int hairStart = Main.hairStart; int index1 = 0; - int num33 = 0; + int num35 = 0; for (int index2 = 0; index2 < 15; ++index2) { - int availableHairstyle = Main.Hairstyles.AvailableHairstyles[Main.hairStart + index2]; - UILinkPointNavigator.SetPosition(2605 + index2, new Vector2((float) x2, (float) y2) + TextureAssets.InventoryBack.Value.Size() * 0.75f); - if (Main.player[Main.myPlayer].hair == availableHairstyle) - Main.spriteBatch.Draw(TextureAssets.InventoryBack14.Value, new Vector2((float) x2, (float) y2), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.InventoryBack.Width(), TextureAssets.InventoryBack.Height())), new Microsoft.Xna.Framework.Color(200, 200, 200, 200), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + int i = Main.hairStart + index2; + UILinkPointNavigator.SetPosition(2605 + index2, new Vector2((float) num33, (float) num34) + Main.inventoryBackTexture.Size() * 0.75f); + if (Main.player[Main.myPlayer].hair == i) + Main.spriteBatch.Draw(Main.inventoryBack14Texture, new Vector2((float) num33, (float) num34), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.inventoryBackTexture.Width, Main.inventoryBackTexture.Height)), new Microsoft.Xna.Framework.Color(200, 200, 200, 200), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); else - Main.spriteBatch.Draw(TextureAssets.InventoryBack8.Value, new Vector2((float) x2, (float) y2), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.InventoryBack.Width(), TextureAssets.InventoryBack.Height())), new Microsoft.Xna.Framework.Color(200, 200, 200, 200), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - if ((Main.mouseX <= x2 || Main.mouseX >= x2 + TextureAssets.InventoryBack.Width() || Main.mouseY <= y2 ? 0 : (Main.mouseY < y2 + TextureAssets.InventoryBack.Height() ? 1 : 0)) != 0) + Main.spriteBatch.Draw(Main.inventoryBack8Texture, new Vector2((float) num33, (float) num34), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.inventoryBackTexture.Width, Main.inventoryBackTexture.Height)), new Microsoft.Xna.Framework.Color(200, 200, 200, 200), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + if (Main.mouseX > num33 && Main.mouseX < num33 + Main.inventoryBackTexture.Width && Main.mouseY > num34 && Main.mouseY < num34 + Main.inventoryBackTexture.Height && Main.mouseLeft && Main.mouseLeftRelease) { - Asset asset = Main.Assets.Request("Images/UI/PanelBorder", (AssetRequestMode) 1); - Utils.DrawSplicedPanel(Main.spriteBatch, asset.Value, x2, y2, TextureAssets.InventoryBack.Width(), TextureAssets.InventoryBack.Height(), asset.Width() / 2 - 1, asset.Width() / 2 - 1, asset.Height() / 2 - 1, asset.Height() / 2 - 1, Main.OurFavoriteColor); - if (Main.mouseLeft && Main.mouseLeftRelease) - { - Main.mouseLeftRelease = false; - Main.player[Main.myPlayer].hair = availableHairstyle; - SoundEngine.PlaySound(12); - } + Main.mouseLeftRelease = false; + Main.player[Main.myPlayer].hair = i; + Main.PlaySound(12); } - this.LoadHair(availableHairstyle); - float x3 = (float) (x2 + TextureAssets.InventoryBack.Width() / 2 - TextureAssets.PlayerHair[availableHairstyle].Width() / 2); - float y3 = (float) (y2 + 4); - Main.spriteBatch.Draw(TextureAssets.Players[index1, 0].Value, new Vector2(x3, y3), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.PlayerHair[availableHairstyle].Width(), 56)), Main.player[Main.myPlayer].skinColor, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(TextureAssets.Players[index1, 1].Value, new Vector2(x3, y3), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.PlayerHair[availableHairstyle].Width(), 56)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(TextureAssets.Players[index1, 2].Value, new Vector2(x3, y3), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.PlayerHair[availableHairstyle].Width(), 56)), Main.player[Main.myPlayer].eyeColor, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(TextureAssets.PlayerHair[availableHairstyle].Value, new Vector2(x3, y3), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.PlayerHair[availableHairstyle].Width(), 56)), Main.selColor, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - ++num33; - x2 += 56; - if (num33 >= 5) + this.LoadHair(i); + float x2 = (float) (num33 + Main.inventoryBackTexture.Width / 2 - Main.playerHairTexture[i].Width / 2); + float y2 = (float) (num34 + 4); + Main.spriteBatch.Draw(Main.playerTextures[index1, 0], new Vector2(x2, y2), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.playerHairTexture[i].Width, 56)), Main.player[Main.myPlayer].skinColor, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.playerTextures[index1, 1], new Vector2(x2, y2), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.playerHairTexture[i].Width, 56)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.playerTextures[index1, 2], new Vector2(x2, y2), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.playerHairTexture[i].Width, 56)), Main.player[Main.myPlayer].eyeColor, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.playerHairTexture[i], new Vector2(x2, y2), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.playerHairTexture[i].Width, 56)), Main.selColor, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + ++num35; + num33 += 56; + if (num35 >= 5) { - num33 = 0; - x2 = num3; - y2 += 56; + num35 = 0; + num33 = num4; + num34 += 56; } } } @@ -31314,30 +31905,21 @@ label_56: public static void OpenClothesWindow() { - if (Main.clothesWindow) - { - Main.CancelClothesWindow(); - } - else - { - Main.hBar = -1f; - Main.lBar = -1f; - Main.sBar = -1f; - Main.playerInventory = false; - Main.npcChatText = ""; - Main.clothesWindow = true; - SoundEngine.PlaySound(10); - Main.selClothes = 0; - Main.oldClothesColor[0] = Main.player[Main.myPlayer].shirtColor; - Main.oldClothesColor[1] = Main.player[Main.myPlayer].underShirtColor; - Main.oldClothesColor[2] = Main.player[Main.myPlayer].pantsColor; - Main.oldClothesColor[3] = Main.player[Main.myPlayer].shoeColor; - Main.oldClothesColor[4] = Main.player[Main.myPlayer].eyeColor; - Main.oldClothesColor[5] = Main.player[Main.myPlayer].skinColor; - if (Main.dresserInterfaceDummy == null) - Main.dresserInterfaceDummy = new Player(); - Main.oldClothesStyle = Main.player[Main.myPlayer].skinVariant; - } + Main.hBar = -1f; + Main.lBar = -1f; + Main.sBar = -1f; + Main.playerInventory = false; + Main.npcChatText = ""; + Main.clothesWindow = true; + Main.PlaySound(10); + Main.selClothes = 0; + Main.oldClothesColor[0] = Main.player[Main.myPlayer].shirtColor; + Main.oldClothesColor[1] = Main.player[Main.myPlayer].underShirtColor; + Main.oldClothesColor[2] = Main.player[Main.myPlayer].pantsColor; + Main.oldClothesColor[3] = Main.player[Main.myPlayer].shoeColor; + if (Main.dresserDummy == null) + Main.dresserDummy = new Player(); + Main.oldClothesStyle = Main.player[Main.myPlayer].skinVariant; } public static void CancelClothesWindow(bool quiet = false) @@ -31346,21 +31928,19 @@ label_56: return; Main.clothesWindow = false; if (!quiet) - SoundEngine.PlaySound(11); + Main.PlaySound(11); Main.player[Main.myPlayer].shirtColor = Main.oldClothesColor[0]; Main.player[Main.myPlayer].underShirtColor = Main.oldClothesColor[1]; Main.player[Main.myPlayer].pantsColor = Main.oldClothesColor[2]; Main.player[Main.myPlayer].shoeColor = Main.oldClothesColor[3]; - Main.player[Main.myPlayer].eyeColor = Main.oldClothesColor[4]; - Main.player[Main.myPlayer].skinColor = Main.oldClothesColor[5]; - Main.dresserInterfaceDummy.skinVariant = Main.oldClothesStyle; - Main.dresserInterfaceDummy.Male = Main.player[Main.myPlayer].Male; - Main.player[Main.myPlayer].skinVariant = Main.dresserInterfaceDummy.skinVariant; + Main.dresserDummy.skinVariant = Main.oldClothesStyle; + Main.dresserDummy.Male = Main.player[Main.myPlayer].Male; + Main.player[Main.myPlayer].skinVariant = Main.dresserDummy.skinVariant; } public static void SaveClothesWindow() { - SoundEngine.PlaySound(7); + Main.PlaySound(7); Main.clothesWindow = false; NetMessage.SendData(4, number: Main.myPlayer); } @@ -31368,323 +31948,297 @@ label_56: protected void DrawClothesWindow() { if (Main.npcChatText != "" || Main.playerInventory || Main.player[Main.myPlayer].chest != -1 || Main.npcShop != 0 || Main.player[Main.myPlayer].talkNPC != -1 || Main.InGuideCraftMenu) - Main.CancelClothesWindow(); - else if (!Main.LocalPlayer.IsInInteractionRangeToMultiTileHitbox(Main.interactedDresserTopLeftX, Main.interactedDresserTopLeftY) || !Main.tile[Main.interactedDresserTopLeftX, Main.interactedDresserTopLeftY].active()) { Main.CancelClothesWindow(); } else { - int num1 = 477 / 2; - int num2 = 180; - int num3 = 511; - int width = num3 - (num3 / 2 - num2 - 26); - int y1 = Main.screenHeight / 2 + 60; - int x1 = Main.screenWidth / 2 - width / 2; - int num4 = y1 + 32; - int num5 = x1 + 22; - int num6 = num4 - 16; - int num7 = x1 + width - num2; - int num8 = y1 + 18; - if (Main.selClothes == 0) - Main.selColor = Main.player[Main.myPlayer].shirtColor; - if (Main.selClothes == 1) - Main.selColor = Main.player[Main.myPlayer].underShirtColor; - if (Main.selClothes == 2) - Main.selColor = Main.player[Main.myPlayer].pantsColor; - if (Main.selClothes == 3) - Main.selColor = Main.player[Main.myPlayer].shoeColor; - if (Main.selClothes == 4) - Main.selColor = Main.player[Main.myPlayer].eyeColor; - if (Main.selClothes == 5) - Main.selColor = Main.player[Main.myPlayer].skinColor; - Utils.DrawInvBG(Main.spriteBatch, new Microsoft.Xna.Framework.Rectangle(x1, y1, width, 133)); - if (!PlayerInput.IgnoreMouseInterface && Main.mouseX > x1 && Main.mouseX < x1 + TextureAssets.ClothesStyleBack.Width() && Main.mouseY > y1 && Main.mouseY < y1 + TextureAssets.ClothesStyleBack.Height()) - Main.player[Main.myPlayer].mouseInterface = true; - Vector2 vector2_1 = new Vector2((float) (x1 + width / 2 - 16 - 28), (float) (y1 + 66 + Main.dresserInterfaceDummy.height / 2 - 20)); - vector2_1.Y += 18f; - vector2_1.X += 58f; - Microsoft.Xna.Framework.Rectangle R = new Microsoft.Xna.Framework.Rectangle((int) vector2_1.X - Main.dresserInterfaceDummy.width / 2 - 15, (int) vector2_1.Y - Main.dresserInterfaceDummy.height - 33, Main.dresserInterfaceDummy.width + 30, Main.dresserInterfaceDummy.height + 66); - bool flag1 = R.Contains(Main.MouseScreen.ToPoint()); - int selClothes = Main.selClothes; - int num9 = ((int) Main.mouseTextColor * 2 + (int) byte.MaxValue) / 3; - Microsoft.Xna.Framework.Color color1 = new Microsoft.Xna.Framework.Color(num9, (int) ((double) num9 / 1.1), num9 / 2, num9); - float num10 = 0.9f; - string textValue1 = Language.GetTextValue("GameUI.Change"); - int num11 = x1 + width - num2 + 22; - int num12 = x1 + 22; - int num13 = y1 + 94; - bool flag2 = false; - if (Main.oldClothesColor[0] != Main.player[Main.myPlayer].shirtColor || Main.oldClothesColor[1] != Main.player[Main.myPlayer].underShirtColor || Main.oldClothesColor[2] != Main.player[Main.myPlayer].pantsColor || Main.oldClothesColor[3] != Main.player[Main.myPlayer].shoeColor || Main.oldClothesColor[4] != Main.player[Main.myPlayer].eyeColor || Main.oldClothesColor[5] != Main.player[Main.myPlayer].skinColor || Main.oldClothesStyle != Main.player[Main.myPlayer].skinVariant) - flag2 = true; - Vector2 vector2_2 = FontAssets.MouseText.Value.MeasureString(textValue1); - bool flag3 = false; - UILinkPointNavigator.SetPosition(2803, new Vector2((float) num12, (float) num13) + vector2_2 * num10 * 0.5f); - if (flag2 && Main.mouseX > num12 && (double) Main.mouseX < (double) num12 + (double) vector2_2.X && Main.mouseY > num13 && (double) Main.mouseY < (double) num13 + (double) vector2_2.Y) + int num1 = (int) (((double) Main.player[Main.myPlayer].position.X + (double) Main.player[Main.myPlayer].width * 0.5) / 16.0); + int num2 = (int) (((double) Main.player[Main.myPlayer].position.Y + (double) Main.player[Main.myPlayer].height * 0.5) / 16.0); + if (num1 < Main.dresserX - 5 || num1 > Main.dresserX + 6 || num2 < Main.dresserY - 4 || num2 > Main.dresserY + 5 || !Main.tile[Main.dresserX, Main.dresserY].active()) { - flag3 = true; - num10 = 1.1f; - if (!Main.npcChatFocus1) - SoundEngine.PlaySound(12); - Main.npcChatFocus1 = true; - Main.player[Main.myPlayer].releaseUseItem = false; + Main.CancelClothesWindow(); } else { - if (Main.npcChatFocus1) - SoundEngine.PlaySound(12); - Main.npcChatFocus1 = false; - } - for (int index = 0; index < 5; ++index) - { - int num14 = num12; - int num15 = num13; - Microsoft.Xna.Framework.Color color2 = Microsoft.Xna.Framework.Color.Black; - if (flag3) - color2 = Microsoft.Xna.Framework.Color.Brown; - if (index == 0) - num14 -= 2; - if (index == 1) - num14 += 2; - if (index == 2) - num15 -= 2; - if (index == 3) - num15 += 2; - if (index == 4) - color2 = flag2 ? color1 : new Microsoft.Xna.Framework.Color(100, 100, 100); - Vector2 vector2_3 = FontAssets.MouseText.Value.MeasureString(textValue1) * 0.5f; - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, textValue1, new Vector2((float) num14 + vector2_3.X, (float) num15 + vector2_3.Y), color2, 0.0f, vector2_3, num10, SpriteEffects.None, 0.0f); - } - float num16 = 0.9f; - string textValue2 = Language.GetTextValue("GameUI.Cancel"); - int num17 = num12 + 130; - bool flag4 = false; - Vector2 vector2_4 = FontAssets.MouseText.Value.MeasureString(textValue2); - UILinkPointNavigator.SetPosition(2804, new Vector2((float) num17, (float) num13) + vector2_4 * num16 * 0.5f); - if (Main.mouseX > num17 && (double) Main.mouseX < (double) num17 + (double) vector2_4.X && Main.mouseY > num13 && (double) Main.mouseY < (double) num13 + (double) vector2_4.Y) - { - flag4 = true; - num16 = 1.1f; - if (!Main.npcChatFocus2) - SoundEngine.PlaySound(12); - Main.npcChatFocus2 = true; - Main.player[Main.myPlayer].releaseUseItem = false; - } - else - { - if (Main.npcChatFocus2) - SoundEngine.PlaySound(12); - Main.npcChatFocus2 = false; - } - for (int index = 0; index < 5; ++index) - { - int num18 = num17; - int num19 = num13; - Microsoft.Xna.Framework.Color color3 = Microsoft.Xna.Framework.Color.Black; - if (flag4) - color3 = Microsoft.Xna.Framework.Color.Brown; - if (index == 0) - num18 -= 2; - if (index == 1) - num18 += 2; - if (index == 2) - num19 -= 2; - if (index == 3) - num19 += 2; - if (index == 4) - color3 = color1; - Vector2 vector2_5 = FontAssets.MouseText.Value.MeasureString(textValue2) * 0.5f; - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, textValue2, new Vector2((float) num18 + vector2_5.X, (float) num19 + vector2_5.Y), color3, 0.0f, vector2_5, num16, SpriteEffects.None, 0.0f); - } - if (Main.mouseLeft && Main.mouseLeftRelease) - { - if (Main.npcChatFocus1) + int num3 = 477 / 2; + int num4 = 124; + int num5 = 511; + int width = num5 - (num5 / 2 - num4 - 26); + int y1 = Main.screenHeight / 2 + 60; + int x1 = Main.screenWidth / 2 - width / 2; + int num6 = y1 + 32; + int num7 = x1 + 22; + int num8 = num6 - 16; + int num9 = x1 + width - num4; + int num10 = y1 + 18; + if (Main.selClothes == 0) + Main.selColor = Main.player[Main.myPlayer].shirtColor; + if (Main.selClothes == 1) + Main.selColor = Main.player[Main.myPlayer].underShirtColor; + if (Main.selClothes == 2) + Main.selColor = Main.player[Main.myPlayer].pantsColor; + if (Main.selClothes == 3) + Main.selColor = Main.player[Main.myPlayer].shoeColor; + Utils.DrawInvBG(Main.spriteBatch, new Microsoft.Xna.Framework.Rectangle(x1, y1, width, 133)); + if (!PlayerInput.IgnoreMouseInterface && Main.mouseX > x1 && Main.mouseX < x1 + Main.clothesStyleBackTexture.Width && Main.mouseY > y1 && Main.mouseY < y1 + Main.clothesStyleBackTexture.Height) + Main.player[Main.myPlayer].mouseInterface = true; + Vector2 vector2_1 = new Vector2((float) (x1 + width / 2 - 16), (float) (y1 + 66 + Main.dresserDummy.height / 2 - 20)); + vector2_1.Y += 18f; + vector2_1.X += 58f; + Microsoft.Xna.Framework.Rectangle R = new Microsoft.Xna.Framework.Rectangle((int) vector2_1.X - Main.dresserDummy.width / 2 - 15, (int) vector2_1.Y - Main.dresserDummy.height - 33, Main.dresserDummy.width + 30, Main.dresserDummy.height + 66); + bool flag1 = R.Contains(Main.MouseScreen.ToPoint()); + int selClothes = Main.selClothes; + int num11 = ((int) Main.mouseTextColor * 2 + (int) byte.MaxValue) / 3; + Microsoft.Xna.Framework.Color color1 = new Microsoft.Xna.Framework.Color(num11, (int) ((double) num11 / 1.1), num11 / 2, num11); + float num12 = 0.9f; + string textValue1 = Language.GetTextValue("GameUI.Change"); + int num13 = x1 + width - num4 + 22; + int num14 = x1 + 22; + int num15 = y1 + 94; + bool flag2 = false; + if (Main.oldClothesColor[0] != Main.player[Main.myPlayer].shirtColor || Main.oldClothesColor[1] != Main.player[Main.myPlayer].underShirtColor || Main.oldClothesColor[2] != Main.player[Main.myPlayer].pantsColor || Main.oldClothesColor[3] != Main.player[Main.myPlayer].shoeColor || Main.oldClothesStyle != Main.player[Main.myPlayer].skinVariant) + flag2 = true; + Vector2 vector2_2 = Main.fontMouseText.MeasureString(textValue1); + UILinkPointNavigator.SetPosition(2803, new Vector2((float) num14, (float) num15) + vector2_2 * num12 * 0.5f); + if (flag2 && Main.mouseX > num14 && (double) Main.mouseX < (double) num14 + (double) vector2_2.X && Main.mouseY > num15 && (double) Main.mouseY < (double) num15 + (double) vector2_2.Y) { - Main.SaveClothesWindow(); - return; + num12 = 1.1f; + if (!Main.npcChatFocus1) + Main.PlaySound(12); + Main.npcChatFocus1 = true; + Main.player[Main.myPlayer].releaseUseItem = false; } - if (Main.npcChatFocus2) - { - Main.CancelClothesWindow(); - return; - } - } - if (!Main.mouseLeft) - { - this.grabColorSlider = 0; - Main.blockMouse = false; - } - int num20 = 167; - Vector3 hsl = Main.rgbToHsl(Main.selColor); - float Hue = hsl.X; - float Saturation1 = hsl.Y; - float Luminosity1 = hsl.Z; - if ((double) Main.hBar == -1.0 || (double) Main.sBar == -1.0 || (double) Main.lBar == -1.0) - { - Main.hBar = Hue; - Main.sBar = Saturation1; - Main.lBar = Luminosity1; - } - else - { - Hue = Main.hBar; - Saturation1 = Main.sBar; - Luminosity1 = Main.lBar; - } - Main.spriteBatch.Draw(TextureAssets.Hue.Value, new Vector2((float) num5, (float) num6), Microsoft.Xna.Framework.Color.White); - if (Main.mouseX > num5 - 4 && Main.mouseX < num5 + TextureAssets.Hue.Width() + 4 && Main.mouseY > num6 - 4 && Main.mouseY < num6 + TextureAssets.Hue.Height() + 4 || this.grabColorSlider == 1) - Main.spriteBatch.Draw(TextureAssets.ColorHighlight.Value, new Vector2((float) num5, (float) num6), Main.OurFavoriteColor); - Main.spriteBatch.Draw(TextureAssets.ColorSlider.Value, new Vector2((float) num5 + (float) (TextureAssets.Hue.Width() - 2) * Main.hBar - (float) (TextureAssets.ColorSlider.Width() / 2), (float) (num6 - TextureAssets.ColorSlider.Height() / 2 + TextureAssets.Hue.Height() / 2)), Microsoft.Xna.Framework.Color.White); - if ((Main.mouseX > num5 - 4 && Main.mouseX < num5 + TextureAssets.Hue.Width() + 4 && Main.mouseY > num6 - 4 && Main.mouseY < num6 + TextureAssets.Hue.Height() + 4 || this.grabColorSlider == 1) && Main.mouseLeft && !Main.blockMouse) - { - this.grabColorSlider = 1; - Hue = (float) (Main.mouseX - num5) / (float) TextureAssets.Hue.Width(); - if ((double) Hue < 0.0) - Hue = 0.0f; - if ((double) Hue > 1.0) - Hue = 1f; - Main.hBar = Hue; - } - UILinkPointNavigator.SetPosition(2800, new Vector2((float) num5, (float) num6) + TextureAssets.Hue.Value.Size() / 2f); - int num21 = num6 + 26; - Main.spriteBatch.Draw(TextureAssets.ColorBar.Value, new Vector2((float) num5, (float) num21), Microsoft.Xna.Framework.Color.White); - for (int index = 0; index <= num20; ++index) - { - float Saturation2 = (float) index / (float) num20; - Microsoft.Xna.Framework.Color rgb = Main.hslToRgb(Hue, Saturation2, Luminosity1); - Main.spriteBatch.Draw(TextureAssets.ColorBlip.Value, new Vector2((float) (num5 + index + 5), (float) (num21 + 4)), rgb); - } - if (Main.mouseX > num5 - 4 && Main.mouseX < num5 + TextureAssets.Hue.Width() + 4 && Main.mouseY > num21 - 4 && Main.mouseY < num21 + TextureAssets.Hue.Height() + 4 || this.grabColorSlider == 2) - Main.spriteBatch.Draw(TextureAssets.ColorHighlight.Value, new Vector2((float) num5, (float) num21), Main.OurFavoriteColor); - Main.spriteBatch.Draw(TextureAssets.ColorSlider.Value, new Vector2((float) num5 + (float) (TextureAssets.Hue.Width() - 2) * Main.sBar - (float) (TextureAssets.ColorSlider.Width() / 2), (float) (num21 - TextureAssets.ColorSlider.Height() / 2 + TextureAssets.Hue.Height() / 2)), Microsoft.Xna.Framework.Color.White); - if ((Main.mouseX > num5 - 4 && Main.mouseX < num5 + TextureAssets.Hue.Width() + 4 && Main.mouseY > num21 - 4 && Main.mouseY < num21 + TextureAssets.Hue.Height() + 4 || this.grabColorSlider == 2) && Main.mouseLeft && !Main.blockMouse) - { - this.grabColorSlider = 2; - Saturation1 = (float) (Main.mouseX - num5) / (float) TextureAssets.Hue.Width(); - if ((double) Saturation1 < 0.0) - Saturation1 = 0.0f; - if ((double) Saturation1 > 1.0) - Saturation1 = 1f; - Main.sBar = Saturation1; - } - UILinkPointNavigator.SetPosition(2801, new Vector2((float) num5, (float) num21) + TextureAssets.Hue.Value.Size() / 2f); - int num22 = num21 + 26; - Main.spriteBatch.Draw(TextureAssets.ColorBar.Value, new Vector2((float) num5, (float) num22), Microsoft.Xna.Framework.Color.White); - float num23 = 0.15f; - for (int index = 0; index <= num20; ++index) - { - float Luminosity2 = (float) index / (float) num20; - Microsoft.Xna.Framework.Color rgb = Main.hslToRgb(Hue, Saturation1, Luminosity2); - Main.spriteBatch.Draw(TextureAssets.ColorBlip.Value, new Vector2((float) (num5 + index + 5), (float) (num22 + 4)), rgb); - } - if (Main.mouseX > num5 - 4 && Main.mouseX < num5 + TextureAssets.Hue.Width() + 4 && Main.mouseY > num22 - 4 && Main.mouseY < num22 + TextureAssets.Hue.Height() + 4 || this.grabColorSlider == 3) - Main.spriteBatch.Draw(TextureAssets.ColorHighlight.Value, new Vector2((float) num5, (float) num22), Main.OurFavoriteColor); - Main.spriteBatch.Draw(TextureAssets.ColorSlider.Value, new Vector2((float) num5 + (float) (TextureAssets.Hue.Width() - 2) * (float) (((double) Main.lBar - (double) num23) / (1.0 - (double) num23)) - (float) (TextureAssets.ColorSlider.Width() / 2), (float) (num22 - TextureAssets.ColorSlider.Height() / 2 + TextureAssets.Hue.Height() / 2)), Microsoft.Xna.Framework.Color.White); - if ((Main.mouseX > num5 - 4 && Main.mouseX < num5 + TextureAssets.Hue.Width() + 4 && Main.mouseY > num22 - 4 && Main.mouseY < num22 + TextureAssets.Hue.Height() + 4 || this.grabColorSlider == 3) && Main.mouseLeft && !Main.blockMouse) - { - this.grabColorSlider = 3; - float num24 = (float) (Main.mouseX - num5) / (float) TextureAssets.Hue.Width(); - if ((double) num24 < 0.0) - num24 = 0.0f; - if ((double) num24 > 1.0) - num24 = 1f; - Main.lBar = num24 * (1f - num23) + num23; - } - UILinkPointNavigator.SetPosition(2802, new Vector2((float) num5, (float) num22) + TextureAssets.Hue.Value.Size() / 2f); - Main.selColor = Main.hslToRgb(Main.hBar, Main.sBar, Main.lBar); - if (Main.selClothes == 0) - Main.player[Main.myPlayer].shirtColor = Main.selColor; - if (Main.selClothes == 1) - Main.player[Main.myPlayer].underShirtColor = Main.selColor; - if (Main.selClothes == 2) - Main.player[Main.myPlayer].pantsColor = Main.selColor; - if (Main.selClothes == 3) - Main.player[Main.myPlayer].shoeColor = Main.selColor; - if (Main.selClothes == 4) - Main.player[Main.myPlayer].eyeColor = Main.selColor; - if (Main.selClothes == 5) - Main.player[Main.myPlayer].skinColor = Main.selColor; - int num25 = num7; - int num26 = num8 - 8; - for (int index = 0; index < 6; ++index) - { - if (selClothes == index) - Main.spriteBatch.Draw(TextureAssets.InventoryBack14.Value, new Vector2((float) num25, (float) num26), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.InventoryBack.Width(), TextureAssets.InventoryBack.Height())), new Microsoft.Xna.Framework.Color(200, 200, 200, 200), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); else - Main.spriteBatch.Draw(TextureAssets.InventoryBack8.Value, new Vector2((float) num25, (float) num26), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.InventoryBack.Width(), TextureAssets.InventoryBack.Height())), new Microsoft.Xna.Framework.Color(200, 200, 200, 200), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - if (Main.mouseX > num25 && Main.mouseX < num25 + TextureAssets.InventoryBack.Width() && Main.mouseY > num26 && Main.mouseY < num26 + TextureAssets.InventoryBack.Height() && Main.mouseLeft && Main.mouseLeftRelease) { - Main.mouseLeftRelease = false; - Main.selClothes = index; - SoundEngine.PlaySound(12); - Main.hBar = -1f; - Main.lBar = -1f; - Main.sBar = -1f; + if (Main.npcChatFocus1) + Main.PlaySound(12); + Main.npcChatFocus1 = false; } - float x2 = (float) (num25 + TextureAssets.InventoryBack.Width() / 2 - TextureAssets.Clothes[index].Width() / 2); - float y2 = (float) (num26 + TextureAssets.InventoryBack.Height() / 2 - TextureAssets.Clothes[index].Height() / 2); - Microsoft.Xna.Framework.Color color4 = Microsoft.Xna.Framework.Color.White; - if (index == 0) - color4 = Main.player[Main.myPlayer].shirtColor; - if (index == 1) - color4 = Main.player[Main.myPlayer].underShirtColor; - if (index == 2) - color4 = Main.player[Main.myPlayer].pantsColor; - if (index == 3) - color4 = Main.player[Main.myPlayer].shoeColor; - if (index == 4) - color4 = Main.player[Main.myPlayer].eyeColor; - if (index == 5) - color4 = Main.player[Main.myPlayer].skinColor; - Main.spriteBatch.Draw(TextureAssets.Clothes[index].Value, new Vector2(x2, y2), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Clothes[index].Width(), TextureAssets.Clothes[index].Height())), color4, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - if (index == 4) + for (int index = 0; index < 5; ++index) { - Texture2D texture2D = Main.Assets.Request("Images/UI/CharCreation/ColorEyeBack", (AssetRequestMode) 1).Value; - Main.spriteBatch.Draw(texture2D, new Vector2(x2, y2), new Microsoft.Xna.Framework.Rectangle?(texture2D.Frame()), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + int num16 = num14; + int num17 = num15; + Microsoft.Xna.Framework.Color color2 = Microsoft.Xna.Framework.Color.Black; + if (index == 0) + num16 -= 2; + if (index == 1) + num16 += 2; + if (index == 2) + num17 -= 2; + if (index == 3) + num17 += 2; + if (index == 4) + color2 = flag2 ? color1 : new Microsoft.Xna.Framework.Color(100, 100, 100); + Vector2 vector2_3 = Main.fontMouseText.MeasureString(textValue1) * 0.5f; + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, textValue1, new Vector2((float) num16 + vector2_3.X, (float) num17 + vector2_3.Y), color2, 0.0f, vector2_3, num12, SpriteEffects.None, 0.0f); } - UILinkPointNavigator.SetPosition(2806 + index, new Vector2(x2, y2) + TextureAssets.Clothes[index].Value.Size() * 0.75f); - num25 += 56; - if (index == 1) + float num18 = 0.9f; + string textValue2 = Language.GetTextValue("GameUI.Cancel"); + int num19 = num14 + 130; + Vector2 vector2_4 = Main.fontMouseText.MeasureString(textValue2); + UILinkPointNavigator.SetPosition(2804, new Vector2((float) num19, (float) num15) + vector2_4 * num18 * 0.5f); + if (Main.mouseX > num19 && (double) Main.mouseX < (double) num19 + (double) vector2_4.X && Main.mouseY > num15 && (double) Main.mouseY < (double) num15 + (double) vector2_4.Y) { - num25 -= 112; - num26 += 56; + num18 = 1.1f; + if (!Main.npcChatFocus2) + Main.PlaySound(12); + Main.npcChatFocus2 = true; + Main.player[Main.myPlayer].releaseUseItem = false; } - if (index == 3) - num26 -= 56; - if (index == 4) + else { - num26 += 56; - num25 -= 56; + if (Main.npcChatFocus2) + Main.PlaySound(12); + Main.npcChatFocus2 = false; + } + for (int index = 0; index < 5; ++index) + { + int num20 = num19; + int num21 = num15; + Microsoft.Xna.Framework.Color color3 = Microsoft.Xna.Framework.Color.Black; + if (index == 0) + num20 -= 2; + if (index == 1) + num20 += 2; + if (index == 2) + num21 -= 2; + if (index == 3) + num21 += 2; + if (index == 4) + color3 = color1; + Vector2 vector2_5 = Main.fontMouseText.MeasureString(textValue2) * 0.5f; + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, textValue2, new Vector2((float) num20 + vector2_5.X, (float) num21 + vector2_5.Y), color3, 0.0f, vector2_5, num18, SpriteEffects.None, 0.0f); } - } - Main.dresserInterfaceDummy.skinVariant = Main.player[Main.myPlayer].skinVariant; - Main.dresserInterfaceDummy.eyeColor = Main.player[Main.myPlayer].eyeColor; - Main.dresserInterfaceDummy.hairColor = Main.player[Main.myPlayer].hairColor; - Main.dresserInterfaceDummy.hair = Main.player[Main.myPlayer].hair; - Main.dresserInterfaceDummy.skinColor = Main.player[Main.myPlayer].skinColor; - Main.dresserInterfaceDummy.shirtColor = Main.player[Main.myPlayer].shirtColor; - Main.dresserInterfaceDummy.underShirtColor = Main.player[Main.myPlayer].underShirtColor; - Main.dresserInterfaceDummy.shoeColor = Main.player[Main.myPlayer].shoeColor; - Main.dresserInterfaceDummy.pantsColor = Main.player[Main.myPlayer].pantsColor; - Main.dresserInterfaceDummy.Bottom = Main.screenPosition + vector2_1; - Main.dresserInterfaceDummy.direction = -1; - Main.dresserInterfaceDummy.gravDir = 1f; - Main.dresserInterfaceDummy.PlayerFrame(); - Main.dresserInterfaceDummy.socialIgnoreLight = true; - Microsoft.Xna.Framework.Color c = new Microsoft.Xna.Framework.Color(46, 106, 98) * 0.6f; - if (flag1) - { - c = new Microsoft.Xna.Framework.Color(46, 106, 98) * 2f * 0.6f; if (Main.mouseLeft && Main.mouseLeftRelease) { - Main.mouseLeftRelease = false; - SoundEngine.PlaySound(12); - Main.CycleClothingStyle(Main.player[Main.myPlayer]); + if (Main.npcChatFocus1) + { + Main.SaveClothesWindow(); + return; + } + if (Main.npcChatFocus2) + { + Main.CancelClothesWindow(); + return; + } } + if (!Main.mouseLeft) + { + this.grabColorSlider = 0; + Main.blockMouse = false; + } + int num22 = 167; + Vector3 hsl = Main.rgbToHsl(Main.selColor); + float Hue = hsl.X; + float Saturation1 = hsl.Y; + float Luminosity1 = hsl.Z; + if ((double) Main.hBar == -1.0 || (double) Main.sBar == -1.0 || (double) Main.lBar == -1.0) + { + Main.hBar = Hue; + Main.sBar = Saturation1; + Main.lBar = Luminosity1; + } + else + { + Hue = Main.hBar; + Saturation1 = Main.sBar; + Luminosity1 = Main.lBar; + } + Main.spriteBatch.Draw(this.hueTexture, new Vector2((float) num7, (float) num8), Microsoft.Xna.Framework.Color.White); + if (Main.mouseX > num7 - 4 && Main.mouseX < num7 + this.hueTexture.Width + 4 && Main.mouseY > num8 - 4 && Main.mouseY < num8 + this.hueTexture.Height + 4 || this.grabColorSlider == 1) + Main.spriteBatch.Draw(Main.colorHighlightTexture, new Vector2((float) num7, (float) num8), Main.OurFavoriteColor); + Main.spriteBatch.Draw(Main.colorSliderTexture, new Vector2((float) num7 + (float) (this.hueTexture.Width - 2) * Main.hBar - (float) (Main.colorSliderTexture.Width / 2), (float) (num8 - Main.colorSliderTexture.Height / 2 + this.hueTexture.Height / 2)), Microsoft.Xna.Framework.Color.White); + if ((Main.mouseX > num7 - 4 && Main.mouseX < num7 + this.hueTexture.Width + 4 && Main.mouseY > num8 - 4 && Main.mouseY < num8 + this.hueTexture.Height + 4 || this.grabColorSlider == 1) && Main.mouseLeft && !Main.blockMouse) + { + this.grabColorSlider = 1; + Hue = (float) (Main.mouseX - num7) / (float) this.hueTexture.Width; + if ((double) Hue < 0.0) + Hue = 0.0f; + if ((double) Hue > 1.0) + Hue = 1f; + Main.hBar = Hue; + } + UILinkPointNavigator.SetPosition(2800, new Vector2((float) num7, (float) num8) + this.hueTexture.Size() / 2f); + int num23 = num8 + 26; + Main.spriteBatch.Draw(Main.colorBarTexture, new Vector2((float) num7, (float) num23), Microsoft.Xna.Framework.Color.White); + for (int index = 0; index <= num22; ++index) + { + float Saturation2 = (float) index / (float) num22; + Microsoft.Xna.Framework.Color rgb = Main.hslToRgb(Hue, Saturation2, Luminosity1); + Main.spriteBatch.Draw(Main.colorBlipTexture, new Vector2((float) (num7 + index + 5), (float) (num23 + 4)), rgb); + } + if (Main.mouseX > num7 - 4 && Main.mouseX < num7 + this.hueTexture.Width + 4 && Main.mouseY > num23 - 4 && Main.mouseY < num23 + this.hueTexture.Height + 4 || this.grabColorSlider == 2) + Main.spriteBatch.Draw(Main.colorHighlightTexture, new Vector2((float) num7, (float) num23), Main.OurFavoriteColor); + Main.spriteBatch.Draw(Main.colorSliderTexture, new Vector2((float) num7 + (float) (this.hueTexture.Width - 2) * Main.sBar - (float) (Main.colorSliderTexture.Width / 2), (float) (num23 - Main.colorSliderTexture.Height / 2 + this.hueTexture.Height / 2)), Microsoft.Xna.Framework.Color.White); + if ((Main.mouseX > num7 - 4 && Main.mouseX < num7 + this.hueTexture.Width + 4 && Main.mouseY > num23 - 4 && Main.mouseY < num23 + this.hueTexture.Height + 4 || this.grabColorSlider == 2) && Main.mouseLeft && !Main.blockMouse) + { + this.grabColorSlider = 2; + Saturation1 = (float) (Main.mouseX - num7) / (float) this.hueTexture.Width; + if ((double) Saturation1 < 0.0) + Saturation1 = 0.0f; + if ((double) Saturation1 > 1.0) + Saturation1 = 1f; + Main.sBar = Saturation1; + } + UILinkPointNavigator.SetPosition(2801, new Vector2((float) num7, (float) num23) + this.hueTexture.Size() / 2f); + int num24 = num23 + 26; + Main.spriteBatch.Draw(Main.colorBarTexture, new Vector2((float) num7, (float) num24), Microsoft.Xna.Framework.Color.White); + float num25 = 0.15f; + for (int index = 0; index <= num22; ++index) + { + float Luminosity2 = (float) index / (float) num22; + Microsoft.Xna.Framework.Color rgb = Main.hslToRgb(Hue, Saturation1, Luminosity2); + Main.spriteBatch.Draw(Main.colorBlipTexture, new Vector2((float) (num7 + index + 5), (float) (num24 + 4)), rgb); + } + if (Main.mouseX > num7 - 4 && Main.mouseX < num7 + this.hueTexture.Width + 4 && Main.mouseY > num24 - 4 && Main.mouseY < num24 + this.hueTexture.Height + 4 || this.grabColorSlider == 3) + Main.spriteBatch.Draw(Main.colorHighlightTexture, new Vector2((float) num7, (float) num24), Main.OurFavoriteColor); + Main.spriteBatch.Draw(Main.colorSliderTexture, new Vector2((float) num7 + (float) (this.hueTexture.Width - 2) * (float) (((double) Main.lBar - (double) num25) / (1.0 - (double) num25)) - (float) (Main.colorSliderTexture.Width / 2), (float) (num24 - Main.colorSliderTexture.Height / 2 + this.hueTexture.Height / 2)), Microsoft.Xna.Framework.Color.White); + if ((Main.mouseX > num7 - 4 && Main.mouseX < num7 + this.hueTexture.Width + 4 && Main.mouseY > num24 - 4 && Main.mouseY < num24 + this.hueTexture.Height + 4 || this.grabColorSlider == 3) && Main.mouseLeft && !Main.blockMouse) + { + this.grabColorSlider = 3; + float num26 = (float) (Main.mouseX - num7) / (float) this.hueTexture.Width; + if ((double) num26 < 0.0) + num26 = 0.0f; + if ((double) num26 > 1.0) + num26 = 1f; + Main.lBar = num26 * (1f - num25) + num25; + } + UILinkPointNavigator.SetPosition(2802, new Vector2((float) num7, (float) num24) + this.hueTexture.Size() / 2f); + Main.selColor = Main.hslToRgb(Main.hBar, Main.sBar, Main.lBar); + if (Main.selClothes == 0) + Main.player[Main.myPlayer].shirtColor = Main.selColor; + if (Main.selClothes == 1) + Main.player[Main.myPlayer].underShirtColor = Main.selColor; + if (Main.selClothes == 2) + Main.player[Main.myPlayer].pantsColor = Main.selColor; + if (Main.selClothes == 3) + Main.player[Main.myPlayer].shoeColor = Main.selColor; + int num27 = num9; + int num28 = num10 - 8; + for (int index = 0; index < 4; ++index) + { + if (selClothes == index) + Main.spriteBatch.Draw(Main.inventoryBack14Texture, new Vector2((float) num27, (float) num28), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.inventoryBackTexture.Width, Main.inventoryBackTexture.Height)), new Microsoft.Xna.Framework.Color(200, 200, 200, 200), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + else + Main.spriteBatch.Draw(Main.inventoryBack8Texture, new Vector2((float) num27, (float) num28), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.inventoryBackTexture.Width, Main.inventoryBackTexture.Height)), new Microsoft.Xna.Framework.Color(200, 200, 200, 200), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + if (Main.mouseX > num27 && Main.mouseX < num27 + Main.inventoryBackTexture.Width && Main.mouseY > num28 && Main.mouseY < num28 + Main.inventoryBackTexture.Height && Main.mouseLeft && Main.mouseLeftRelease) + { + Main.mouseLeftRelease = false; + Main.selClothes = index; + Main.PlaySound(12); + Main.hBar = -1f; + Main.lBar = -1f; + Main.sBar = -1f; + } + float x2 = (float) (num27 + Main.inventoryBackTexture.Width / 2 - Main.clothesTexture[index].Width / 2); + float y2 = (float) (num28 + Main.inventoryBackTexture.Height / 2 - Main.clothesTexture[index].Height / 2); + Microsoft.Xna.Framework.Color color4 = Microsoft.Xna.Framework.Color.White; + if (index == 0) + color4 = Main.player[Main.myPlayer].shirtColor; + if (index == 1) + color4 = Main.player[Main.myPlayer].underShirtColor; + if (index == 2) + color4 = Main.player[Main.myPlayer].pantsColor; + if (index == 3) + color4 = Main.player[Main.myPlayer].shoeColor; + Main.spriteBatch.Draw(Main.clothesTexture[index], new Vector2(x2, y2), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.clothesTexture[index].Width, Main.clothesTexture[index].Height)), color4, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + UILinkPointNavigator.SetPosition(2806 + index, new Vector2(x2, y2) + Main.clothesTexture[index].Size() * 0.75f); + num27 += 56; + if (index == 1) + { + num27 -= 112; + num28 += 56; + } + } + Main.dresserDummy.skinVariant = Main.player[Main.myPlayer].skinVariant; + Main.dresserDummy.eyeColor = Main.player[Main.myPlayer].eyeColor; + Main.dresserDummy.hairColor = Main.player[Main.myPlayer].hairColor; + Main.dresserDummy.skinColor = Main.player[Main.myPlayer].skinColor; + Main.dresserDummy.shirtColor = Main.player[Main.myPlayer].shirtColor; + Main.dresserDummy.underShirtColor = Main.player[Main.myPlayer].underShirtColor; + Main.dresserDummy.shoeColor = Main.player[Main.myPlayer].shoeColor; + Main.dresserDummy.pantsColor = Main.player[Main.myPlayer].pantsColor; + Main.dresserDummy.Bottom = Main.screenPosition + vector2_1; + Main.dresserDummy.direction = -1; + Main.dresserDummy.gravDir = 1f; + Main.dresserDummy.PlayerFrame(); + Main.dresserDummy.socialIgnoreLight = true; + Microsoft.Xna.Framework.Color c = new Microsoft.Xna.Framework.Color(46, 106, 98) * 0.6f; + if (flag1) + { + c = new Microsoft.Xna.Framework.Color(46, 106, 98) * 2f * 0.6f; + if (Main.mouseLeft && Main.mouseLeftRelease) + { + Main.mouseLeftRelease = false; + Main.PlaySound(12); + Main.CycleClothingStyle(Main.player[Main.myPlayer]); + } + } + UILinkPointNavigator.SetPosition(2805, R.Center.ToVector2()); + Utils.DrawInvBG(Main.spriteBatch, R, c); + this.DrawPlayer(Main.dresserDummy, Main.dresserDummy.position, Main.dresserDummy.fullRotation, Main.dresserDummy.fullRotationOrigin); } - UILinkPointNavigator.SetPosition(2805, R.Center.ToVector2()); - Utils.DrawInvBG(Main.spriteBatch, R, c); - Main.PlayerRenderer.DrawPlayer(Main.Camera, Main.dresserInterfaceDummy, Main.dresserInterfaceDummy.position, Main.dresserInterfaceDummy.fullRotation, Main.dresserInterfaceDummy.fullRotationOrigin); } } @@ -31698,26 +32252,16 @@ label_56: return; this._needToSetupDrawInterfaceLayers = false; this._gameInterfaceLayers = new List(); - this._gameInterfaceLayers.AddRange((IEnumerable) new GameInterfaceLayer[43] + this._gameInterfaceLayers.AddRange((IEnumerable) new GameInterfaceLayer[42] { (GameInterfaceLayer) new LegacyGameInterfaceLayer("Vanilla: Interface Logic 1", (GameInterfaceDrawMethod) (() => { Main.DrawInterface_0_InterfaceLogic1(); return true; })), - (GameInterfaceLayer) new LegacyGameInterfaceLayer("Vanilla: MP Player Names", (GameInterfaceDrawMethod) (() => - { - Main.DrawInterface_20_MultiplayerPlayerNames(); - return true; - })), (GameInterfaceLayer) new LegacyGameInterfaceLayer("Vanilla: Emote Bubbles", (GameInterfaceDrawMethod) (() => { - Main.DrawInterface_1_1_DrawEmoteBubblesInWorld(); - return true; - })), - (GameInterfaceLayer) new LegacyGameInterfaceLayer("Vanilla: Entity Markers", (GameInterfaceDrawMethod) (() => - { - Main.DrawInterface_1_2_DrawEntityMarkersInWorld(); + Main.DrawInterface_1_EmoteBubbles(); return true; })), (GameInterfaceLayer) new LegacyGameInterfaceLayer("Vanilla: Smart Cursor Targets", (GameInterfaceDrawMethod) (() => @@ -31750,7 +32294,7 @@ label_56: this.DrawInterface_7_TownNPCHouseBanners(); return true; })), - (GameInterfaceLayer) new LegacyGameInterfaceLayer("Vanilla: Hide UI Toggle", new GameInterfaceDrawMethod(Main.DrawInterface_8_CheckF11UIHideToggle), InterfaceScaleType.UI), + (GameInterfaceLayer) new LegacyGameInterfaceLayer("Vanilla: Hide UI Toggle", new GameInterfaceDrawMethod(Main.DrawInterface_8_CheckF11UIHideToggle)), (GameInterfaceLayer) new LegacyGameInterfaceLayer("Vanilla: Wire Selection", (GameInterfaceDrawMethod) (() => { Main.DrawInterface_9_WireSelection(); @@ -31794,6 +32338,11 @@ label_56: Main.DrawInterface_19_SignTileBubble(); return true; })), + (GameInterfaceLayer) new LegacyGameInterfaceLayer("Vanilla: MP Player Names", (GameInterfaceDrawMethod) (() => + { + Main.DrawInterface_20_MultiplayerPlayerNames(); + return true; + }), InterfaceScaleType.UI), (GameInterfaceLayer) new LegacyGameInterfaceLayer("Vanilla: Hair Window", (GameInterfaceDrawMethod) (() => { this.DrawInterface_21_HairWindow(); @@ -31803,7 +32352,7 @@ label_56: { this.DrawInterface_22_DresserWindow(); return true; - }), InterfaceScaleType.UI), + })), (GameInterfaceLayer) new LegacyGameInterfaceLayer("Vanilla: NPC / Sign Dialog", (GameInterfaceDrawMethod) (() => { this.DrawInterface_23_NPCSignsDialog(); @@ -31898,7 +32447,7 @@ label_56: { Main.DrawInterface_41_InterfaceLogic4(); return true; - }), InterfaceScaleType.UI) + })) }); } @@ -31916,117 +32465,49 @@ label_56: PlayerInput.SetZoom_World(); } - private static void DrawWallOfCopperShortswords() - { - UnifiedRandom r = new UnifiedRandom(5000); - Texture2D texture = TextureAssets.Cloud[28].Value; - Vector2 vector2_1 = Main.ScreenSize.ToVector2(); - Main.spriteBatch.Begin(); - for (int index = 0; index < 20000; ++index) - { - Vector2 vector2_2 = r.NextVector2Square(-0.1f, 1.1f); - vector2_2.X -= 0.1f; - vector2_2.X += (float) ((double) Main.GlobalTimeWrappedHourly % 10.0 / 10.0 * 1.20000004768372); - vector2_2.Y -= (float) ((double) Main.GlobalTimeWrappedHourly % 10.0 / 10.0); - if ((double) vector2_2.Y < -0.200000002980232) - vector2_2.Y += 1.4f; - if ((double) vector2_2.X > 1.10000002384186) - vector2_2.X -= 1.2f; - Vector2 position = vector2_2 * vector2_1; - Main.spriteBatch.Draw(texture, position, Microsoft.Xna.Framework.Color.White); - } - Main.spriteBatch.End(); - } - - private static void DrawWallOfBoulders() - { - UnifiedRandom r = new UnifiedRandom(5000); - Main.instance.LoadProjectile(99); - Texture2D texture = TextureAssets.Projectile[99].Value; - Vector2 vector2_1 = Main.ScreenSize.ToVector2(); - Main.spriteBatch.Begin(); - for (int index = 0; index < 20000; ++index) - { - Vector2 vector2_2 = r.NextVector2Square(-0.1f, 1.1f); - vector2_2.X *= 0.1f; - vector2_2.X -= 0.1f; - vector2_2.X += (float) ((double) Main.GlobalTimeWrappedHourly % 10.0 / 10.0 * 1.20000004768372); - vector2_2.Y -= (float) ((double) Main.GlobalTimeWrappedHourly % 10.0 / 10.0); - if ((double) vector2_2.Y < -0.200000002980232) - vector2_2.Y += 1.4f; - if ((double) vector2_2.X > 1.10000002384186) - vector2_2.X -= 1.2f; - Vector2 position = vector2_2 * vector2_1; - Main.spriteBatch.Draw(texture, position, Microsoft.Xna.Framework.Color.White); - } - Main.spriteBatch.End(); - } - private static void DrawInterface_41_InterfaceLogic4() { Main.npcChatRelease = !Main.mouseRight; - Main._MouseOversCanClear = true; - Main.DrawPendingMouseText(); Main.cursorOverride = -1; - } - - private static void DrawPendingMouseText() - { - Main.DrawGamepadInstructions(); - if (!Main.instance._mouseTextCache.isValid) - return; - Main.instance.MouseTextInner(Main.instance._mouseTextCache); - Main.DrawInterface_36_Cursor(); - Main.instance._mouseTextCache.isValid = false; - Main.instance._mouseTextCache.noOverride = false; + Main._MouseOversCanClear = true; } private void DrawInterface_40_InteractItemIcon() { - if (Main.HoveringOverAnNPC || Main.LocalPlayer.mouseInterface) - return; - int index = Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type; - if (index == 8 && Main.player[Main.myPlayer].UsingBiomeTorches) - index = Main.player[Main.myPlayer].BiomeTorchHoldStyle(index); - if (Main.player[Main.myPlayer].cursorItemIconID != 0) - index = Main.player[Main.myPlayer].cursorItemIconID; - bool flag1 = Main.player[Main.myPlayer].cursorItemIconEnabled && (Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type > 0 || (uint) Main.player[Main.myPlayer].cursorItemIconID > 0U); + int type = Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type; + if (Main.player[Main.myPlayer].showItemIcon2 != 0) + type = Main.player[Main.myPlayer].showItemIcon2; + bool flag1 = Main.player[Main.myPlayer].showItemIcon && (Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type > 0 || (uint) Main.player[Main.myPlayer].showItemIcon2 > 0U); Main.ItemIconCacheVerification(); bool flag2 = Main._itemIconCacheTime > 0 && Main.mouseItem.type < 1; if (!(flag1 | flag2)) return; int cacheSelectedItemId = Main._itemIconCacheSelectedItemID; if (!flag1) - Utils.Swap(ref cacheSelectedItemId, ref Main.player[Main.myPlayer].cursorItemIconID); + Utils.Swap(ref cacheSelectedItemId, ref Main.player[Main.myPlayer].showItemIcon2); Microsoft.Xna.Framework.Color currentColor = Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].GetAlpha(Microsoft.Xna.Framework.Color.White); Microsoft.Xna.Framework.Color color = Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].GetColor(Microsoft.Xna.Framework.Color.White); - if (Main.player[Main.myPlayer].cursorItemIconID != 0) + if (Main.player[Main.myPlayer].showItemIcon2 != 0) { currentColor = Microsoft.Xna.Framework.Color.White; color = new Microsoft.Xna.Framework.Color(); } - if (Main.player[Main.myPlayer].cursorItemIconID == 269) + if (Main.player[Main.myPlayer].showItemIcon2 == 269) currentColor = Main.player[Main.myPlayer].shirtColor; float cursorScale = Main.cursorScale; - ItemSlot.GetItemLight(ref currentColor, index); + ItemSlot.GetItemLight(ref currentColor, type); SpriteEffects effects = SpriteEffects.None; - if (Main.player[Main.myPlayer].cursorItemIconReversed) + if ((Main.player[Main.myPlayer].showItemIcon2 == 928 || Main.player[Main.myPlayer].showItemIcon2 == 1337 || Main.player[Main.myPlayer].showItemIcon2 == 3369) && Main.player[Main.myPlayer].showItemIconR) effects = SpriteEffects.FlipHorizontally; - if (index > 0) - { - Main.instance.LoadItem(index); - Main.spriteBatch.Draw(TextureAssets.Item[index].Value, new Vector2((float) (Main.mouseX + 10), (float) (Main.mouseY + 10)), new Microsoft.Xna.Framework.Rectangle?(Item.GetDrawHitbox(index, (Player) null)), currentColor, 0.0f, new Vector2(), cursorScale, effects, 0.0f); - } - if (Main.player[Main.myPlayer].cursorItemIconText != "") - this.MouseText(Main.player[Main.myPlayer].cursorItemIconText); - if (Main.player[Main.myPlayer].cursorItemIconID == 0 && Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].color != new Microsoft.Xna.Framework.Color()) - { - Main.instance.LoadItem(Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type); - Main.spriteBatch.Draw(TextureAssets.Item[Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type].Value, new Vector2((float) (Main.mouseX + 10), (float) (Main.mouseY + 10)), new Microsoft.Xna.Framework.Rectangle?(Item.GetDrawHitbox(Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type, (Player) null)), color, 0.0f, new Vector2(), cursorScale, SpriteEffects.None, 0.0f); - } + if (type > 0) + Main.spriteBatch.Draw(Main.itemTexture[type], new Vector2((float) (Main.mouseX + 10), (float) (Main.mouseY + 10)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[type].Width, Main.itemTexture[type].Height)), currentColor, 0.0f, new Vector2(), cursorScale, effects, 0.0f); + if (Main.player[Main.myPlayer].showItemIconText != "") + this.MouseText(Main.player[Main.myPlayer].showItemIconText); + if (Main.player[Main.myPlayer].showItemIcon2 == 0 && Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].color != new Microsoft.Xna.Framework.Color()) + Main.spriteBatch.Draw(Main.itemTexture[Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type], new Vector2((float) (Main.mouseX + 10), (float) (Main.mouseY + 10)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.itemTexture[Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type].Width, Main.itemTexture[Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type].Height)), color, 0.0f, new Vector2(), cursorScale, SpriteEffects.None, 0.0f); if (flag1) return; - Utils.Swap(ref cacheSelectedItemId, ref Main.player[Main.myPlayer].cursorItemIconID); + Utils.Swap(ref cacheSelectedItemId, ref Main.player[Main.myPlayer].showItemIcon2); } private void DrawInterface_39_MouseOver() @@ -32050,9 +32531,9 @@ label_56: { if (Main.mouseItem.type > 0 && Main.mouseItem.stack > 0) { - this.SetMouseNPC(-1, -1); - Main.player[Main.myPlayer].cursorItemIconEnabled = false; - Main.player[Main.myPlayer].cursorItemIconID = 0; + this.mouseNPC = -1; + Main.player[Main.myPlayer].showItemIcon = false; + Main.player[Main.myPlayer].showItemIcon2 = 0; Main.mouseText = true; double inventoryScale = (double) Main.inventoryScale; Main.inventoryScale = Main.cursorScale; @@ -32061,32 +32542,22 @@ label_56: } else { - if (this.mouseNPCType <= -1) + if (this.mouseNPC <= -1) return; float scale = 1f * Main.cursorScale; - if (this.mouseNPCIndex >= 0) - { - NPC npc = Main.npc[this.mouseNPCIndex]; - if (!npc.active || npc.type != this.mouseNPCType) - this.SetMouseNPC_ToHousingQuery(); - } - int mouseNpcType = this.mouseNPCType; - ITownNPCProfile profile; - int index = this.mouseNPCIndex < 0 || !TownNPCProfiles.Instance.GetProfile(mouseNpcType, out profile) ? NPC.TypeToDefaultHeadIndex(mouseNpcType) : profile.GetHeadTextureIndex(Main.npc[this.mouseNPCIndex]); - Texture2D texture = TextureAssets.NpcHead[index].Value; - Main.spriteBatch.Draw(texture, new Vector2((float) ((double) Main.mouseX + 26.0 * (double) scale - (double) texture.Width * 0.5 * (double) scale), (float) ((double) Main.mouseY + 26.0 * (double) scale - (double) texture.Height * 0.5 * (double) scale)), new Microsoft.Xna.Framework.Rectangle?(), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), scale, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.npcHeadTexture[this.mouseNPC], new Vector2((float) ((double) Main.mouseX + 26.0 * (double) scale - (double) Main.npcHeadTexture[this.mouseNPC].Width * 0.5 * (double) scale), (float) ((double) Main.mouseY + 26.0 * (double) scale - (double) Main.npcHeadTexture[this.mouseNPC].Height * 0.5 * (double) scale)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.npcHeadTexture[this.mouseNPC].Width, Main.npcHeadTexture[this.mouseNPC].Height)), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), scale, SpriteEffects.None, 0.0f); if (PlayerInput.IgnoreMouseInterface) return; Main.player[Main.myPlayer].mouseInterface = true; Main.mouseText = false; if (Main.mouseRight && Main.mouseRightRelease) { - SoundEngine.PlaySound(12); - this.SetMouseNPC(-1, -1); + Main.PlaySound(12); + this.mouseNPC = -1; } if (!Main.mouseLeft || !Main.mouseLeftRelease) return; - if (this.mouseNPCType == 0) + if (this.mouseNPC == 0) { PlayerInput.SetZoom_Unscaled(); PlayerInput.SetZoom_MouseInWorld(); @@ -32104,19 +32575,30 @@ label_56: } else { - int mouseNpcIndex = this.mouseNPCIndex; - if (mouseNpcIndex < 0) - return; - PlayerInput.SetZoom_Unscaled(); - PlayerInput.SetZoom_MouseInWorld(); - int x = (int) (((double) Main.mouseX + (double) Main.screenPosition.X) / 16.0); - int y = (int) (((double) Main.mouseY + (double) Main.screenPosition.Y) / 16.0); - PlayerInput.SetZoom_Unscaled(); - if (!WorldGen.MoveTownNPC(x, y, mouseNpcIndex)) - return; - this.SetMouseNPC(-1, -1); - WorldGen.moveRoom(x, y, mouseNpcIndex); - SoundEngine.PlaySound(12); + int n = 0; + for (int index = 0; index < 200; ++index) + { + if (Main.npc[index].active && Main.npc[index].type == NPC.HeadIndexToType(this.mouseNPC)) + { + n = index; + break; + } + } + if (n >= 0) + { + PlayerInput.SetZoom_Unscaled(); + PlayerInput.SetZoom_MouseInWorld(); + int x = (int) (((double) Main.mouseX + (double) Main.screenPosition.X) / 16.0); + int y = (int) (((double) Main.mouseY + (double) Main.screenPosition.Y) / 16.0); + PlayerInput.SetZoom_Unscaled(); + if (!WorldGen.MoveTownNPC(x, y, n)) + return; + this.mouseNPC = -1; + WorldGen.moveRoom(x, y, n); + Main.PlaySound(12); + } + else + this.mouseNPC = 0; } } } @@ -32127,8 +32609,6 @@ label_56: private static void DrawInterface_36_Cursor() { - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.SamplerStateForCursor, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, Main.UIScaleMatrix); if (Main.cursorOverride != -1) { Microsoft.Xna.Framework.Color color1 = new Microsoft.Xna.Framework.Color((int) ((double) Main.cursorColor.R * 0.200000002980232), (int) ((double) Main.cursorColor.G * 0.200000002980232), (int) ((double) Main.cursorColor.B * 0.200000002980232), (int) ((double) Main.cursorColor.A * 0.5)); @@ -32164,10 +32644,10 @@ label_56: break; } if (flag1) - Main.spriteBatch.Draw(TextureAssets.Cursors[Main.cursorOverride].Value, new Vector2((float) (Main.mouseX + 1), (float) (Main.mouseY + 1)), new Microsoft.Xna.Framework.Rectangle?(), color1, rotation, vector2 * TextureAssets.Cursors[Main.cursorOverride].Value.Size(), Main.cursorScale * 1.1f * num, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.cursorTextures[Main.cursorOverride], new Vector2((float) (Main.mouseX + 1), (float) (Main.mouseY + 1)), new Microsoft.Xna.Framework.Rectangle?(), color1, rotation, vector2 * Main.cursorTextures[Main.cursorOverride].Size(), Main.cursorScale * 1.1f * num, SpriteEffects.None, 0.0f); if (!flag2) return; - Main.spriteBatch.Draw(TextureAssets.Cursors[Main.cursorOverride].Value, new Vector2((float) Main.mouseX, (float) Main.mouseY), new Microsoft.Xna.Framework.Rectangle?(), color2, rotation, vector2 * TextureAssets.Cursors[Main.cursorOverride].Value.Size(), Main.cursorScale * num, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.cursorTextures[Main.cursorOverride], new Vector2((float) Main.mouseX, (float) Main.mouseY), new Microsoft.Xna.Framework.Rectangle?(), color2, rotation, vector2 * Main.cursorTextures[Main.cursorOverride].Size(), Main.cursorScale * num, SpriteEffects.None, 0.0f); } else if (Main.SmartCursorEnabled) Main.DrawCursor(Main.DrawThickCursor(true), true); @@ -32179,19 +32659,12 @@ label_56: { if (!Main.player[Main.myPlayer].dead) return; - float num1 = -60f; string str = Lang.inter[38].Value; - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.DeathText.Value, str, new Vector2((float) (Main.screenWidth / 2) - FontAssets.DeathText.Value.MeasureString(str).X / 2f, (float) (Main.screenHeight / 2) + num1), Main.player[Main.myPlayer].GetDeathAlpha(Microsoft.Xna.Framework.Color.Transparent), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - if (Main.player[Main.myPlayer].lostCoins > 0) - { - num1 += 50f; - string textValue = Language.GetTextValue("Game.DroppedCoins", (object) Main.player[Main.myPlayer].lostCoinString); - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, textValue, new Vector2((float) (Main.screenWidth / 2) - FontAssets.MouseText.Value.MeasureString(textValue).X / 2f, (float) (Main.screenHeight / 2) + num1), Main.player[Main.myPlayer].GetDeathAlpha(Microsoft.Xna.Framework.Color.Transparent), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - } - float num2 = num1 + (Main.player[Main.myPlayer].lostCoins > 0 ? 24f : 50f) + 20f; - float num3 = 0.7f; - string textValue1 = Language.GetTextValue("Game.RespawnInSuffix", (object) ((float) (int) (1.0 + (double) Main.player[Main.myPlayer].respawnTimer / 60.0)).ToString()); - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.DeathText.Value, textValue1, new Vector2((float) (Main.screenWidth / 2) - (float) ((double) FontAssets.MouseText.Value.MeasureString(textValue1).X * (double) num3 / 2.0), (float) (Main.screenHeight / 2) + num2), Main.player[Main.myPlayer].GetDeathAlpha(Microsoft.Xna.Framework.Color.Transparent), 0.0f, new Vector2(), num3, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontDeathText, str, new Vector2((float) (Main.screenWidth / 2) - Main.fontDeathText.MeasureString(str).X / 2f, (float) (Main.screenHeight / 2 - 20)), Main.player[Main.myPlayer].GetDeathAlpha(Microsoft.Xna.Framework.Color.Transparent), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + if (Main.player[Main.myPlayer].lostCoins <= 0) + return; + string textValue = Language.GetTextValue("Game.DroppedCoins", (object) Main.player[Main.myPlayer].lostCoinString); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, textValue, new Vector2((float) (Main.screenWidth / 2) - Main.fontMouseText.MeasureString(textValue).X / 2f, (float) (Main.screenHeight / 2 + 30)), Main.player[Main.myPlayer].GetDeathAlpha(Microsoft.Xna.Framework.Color.Transparent), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } private void DrawInterface_34_PlayerChat() @@ -32215,22 +32688,11 @@ label_56: { if (Main.mouseItem.stack <= 0) Main.mouseItem.type = 0; - if (Main.hoverItemName != null && Main.hoverItemName != "" && Main.mouseItem.type == 0) - { - Main.player[Main.myPlayer].cursorItemIconEnabled = false; - if (Main.SettingsEnabled_OpaqueBoxBehindTooltips) - this.MouseText(Main.hoverItemName, Main.rare, hackedMouseX: (Main.mouseX + 6), hackedMouseY: (Main.mouseY + 6)); - else - this.MouseText(Main.hoverItemName, Main.rare); - Main.mouseText = true; - } - if (!Main.LocalPlayer.rulerLine || Main.LocalPlayer.builderAccStatus[0] != 0 || (double) Main.LocalPlayer.velocity.Length() > 6.0) + if (Main.hoverItemName == null || !(Main.hoverItemName != "") || Main.mouseItem.type != 0) return; - int num1 = Math.Abs(Main.rulerLineDisplayValues.X) + 1; - int num2 = Math.Abs(Main.rulerLineDisplayValues.Y) + 1; - if (num1 <= 1 && num2 <= 1) - return; - Utils.DrawBorderString(Main.spriteBatch, num1.ToString() + "x" + (object) num2, Main.MouseScreen + new Vector2(16f, 0.0f), new Microsoft.Xna.Framework.Color(0.24f, 0.8f, 0.9f, 1f), Main.GameZoomTarget, anchory: 0.8f); + Main.player[Main.myPlayer].showItemIcon = false; + this.MouseText(Main.hoverItemName, Main.rare); + Main.mouseText = true; } private static void DrawInterface_32_GamepadRadialHotbars() @@ -32241,106 +32703,71 @@ label_56: private void DrawInterface_31_BuilderAccToggles() => this.DrawBuilderAccToggles(new Vector2(10f, 77f)); - public static void DrawInterface_29_SettingsButton() + private static void DrawInterface_29_SettingsButton() { - Main._settingsButtonIsPushedToSide = false; - if (!Main.playerInventory && !Main.ingameOptionsWindow && !Main.player[Main.myPlayer].ghost && !Main.player[Main.myPlayer].dead) + if (!Main.playerInventory && !Main.player[Main.myPlayer].ghost) return; - string text = Lang.inter[62].Value; - string textSizeMatcher = "Settings"; - int posX = Main.screenWidth - 110; - int posY = Main.screenHeight - 20; - int num1 = 620; - int num2 = 870; - int accessorySlotsToShow = Main.player[Main.myPlayer].GetAmountOfExtraAccessorySlotsToShow(); - if (accessorySlotsToShow > 1) + string str = Lang.inter[62].Value; + Vector2 vector2_1 = Main.fontMouseText.MeasureString("Settings"); + Vector2 vector2_2 = Main.fontMouseText.MeasureString(Lang.inter[62].Value); + Vector2 vector2_3 = Main.fontDeathText.MeasureString(str); + int num1 = Main.screenWidth - 110; + int num2 = Main.screenHeight - 20; + if (Main.player[Main.myPlayer].ExtraAccessorySlotsShouldShow && (Main.screenHeight < 650 || Main.screenHeight < 900 && Main.mapStyle == 1)) { - int num3 = (int) (56.0 * (double) Main.inventoryScale * (double) (accessorySlotsToShow - 1)); - num1 += num3; - num2 += num3; + num1 -= 140; + num2 -= PlayerInput.UsingGamepad.ToInt() * 30; } - if (accessorySlotsToShow >= 1 && (Main.screenHeight < num1 || Main.screenHeight < num2 && Main.mapStyle == 1)) + float num3 = vector2_1.X / vector2_2.X; + if (Main.mouseExit) { - posX -= 140; - posY -= PlayerInput.UsingGamepad.ToInt() * 30; - Main._settingsButtonIsPushedToSide = true; + if ((double) Main.exitScale < 0.96) + Main.exitScale += 0.02f; } - Action clickAction = new Action(IngameOptions.Open); - if (Main.ingameOptionsWindow) - clickAction = new Action(IngameOptions.Close); - Main.DrawSettingButton(ref Main.mouseExit, ref Main.exitScale, posX, posY, text, textSizeMatcher, clickAction); - } - - public static void DrawSettingButton( - ref bool mouseOver, - ref float scale, - int posX, - int posY, - string text, - string textSizeMatcher, - Action clickAction) - { - Vector2 vector2_1 = FontAssets.MouseText.Value.MeasureString(textSizeMatcher); - Vector2 vector2_2 = FontAssets.MouseText.Value.MeasureString(text); - Vector2 vector2_3 = FontAssets.DeathText.Value.MeasureString(text); - float num1 = vector2_1.X / vector2_2.X; - if (mouseOver) - { - if ((double) scale < 0.96) - scale += 0.02f; - } - else if ((double) scale > 0.8) - scale -= 0.02f; - UILinkPointNavigator.SetPosition(308, new Vector2((float) posX, (float) posY)); + else if ((double) Main.exitScale > 0.8) + Main.exitScale -= 0.02f; + UILinkPointNavigator.SetPosition(308, new Vector2((float) num1, (float) num2)); for (int index = 0; index < 5; ++index) { - int num2 = 0; - int num3 = 0; + int num4 = 0; + int num5 = 0; Microsoft.Xna.Framework.Color color = Microsoft.Xna.Framework.Color.Black; if (index == 0) - num2 = -2; + num4 = -2; if (index == 1) - num2 = 2; + num4 = 2; if (index == 2) - num3 = -2; + num5 = -2; if (index == 3) - num3 = 2; + num5 = 2; if (index == 4) color = Microsoft.Xna.Framework.Color.White; - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.DeathText.Value, text, new Vector2((float) (posX + num2), (float) (posY + num3)), color, 0.0f, new Vector2(vector2_3.X / 2f, vector2_3.Y / 2f), (scale - 0.2f) * num1, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontDeathText, str, new Vector2((float) (num1 + num4), (float) (num2 + num5)), color, 0.0f, new Vector2(vector2_3.X / 2f, vector2_3.Y / 2f), (Main.exitScale - 0.2f) * num3, SpriteEffects.None, 0.0f); } - if ((double) Main.mouseX > (double) posX - (double) vector2_3.X / 2.0 && (double) Main.mouseX < (double) posX + (double) vector2_3.X / 2.0 && (double) Main.mouseY > (double) posY - (double) vector2_3.Y / 2.0 && (double) Main.mouseY < (double) posY + (double) vector2_3.Y / 2.0 - 10.0 && !Main.LocalPlayer.mouseInterface) + if ((double) Main.mouseX > (double) num1 - (double) vector2_3.X / 2.0 && (double) Main.mouseX < (double) num1 + (double) vector2_3.X / 2.0 && (double) Main.mouseY > (double) num2 - (double) vector2_3.Y / 2.0 && (double) Main.mouseY < (double) num2 + (double) vector2_3.Y / 2.0 - 10.0 && !Main.LocalPlayer.mouseInterface) { if (PlayerInput.IgnoreMouseInterface) return; - if (!mouseOver) - SoundEngine.PlaySound(12); - mouseOver = true; + if (!Main.mouseExit) + Main.PlaySound(12); + Main.mouseExit = true; Main.player[Main.myPlayer].mouseInterface = true; if (!Main.mouseLeftRelease || !Main.mouseLeft) return; - mouseOver = false; - scale = 0.8f; - clickAction(); + Main.mouseExit = false; + Main.exitScale = 0.8f; + IngameOptions.Open(); } else - mouseOver = false; + Main.mouseExit = false; } - private void DrawInterface_28_InfoAccs() - { - double inventoryScale = (double) Main.inventoryScale; - Main.inventoryScale = 0.6f; - this.DrawInfoAccs(); - Main.inventoryScale = (float) inventoryScale; - } + private void DrawInterface_28_InfoAccs() => this.DrawInfoAccs(); private void DrawInterface_27_Inventory() { if (Main.playerInventory) { - if (Main.player[Main.myPlayer].chest != -1) - Main.CreativeMenu.CloseMenu(); if (Main.ignoreErrors) { try @@ -32357,25 +32784,23 @@ label_56: } else { - Main.CreativeMenu.CloseMenu(); Main.recFastScroll = true; - this.SetMouseNPC(-1, -1); + this.mouseNPC = -1; Main.EquipPage = 0; } } private static void DrawInterface_26_InterfaceLogic3() { - bool playerInventory = Main.playerInventory; if (Main.player[Main.myPlayer].dead) Main.playerInventory = false; if (!Main.playerInventory) { Main.player[Main.myPlayer].chest = -1; - Main.InGuideCraftMenu = false; + if (Main.InGuideCraftMenu) + Main.InGuideCraftMenu = false; + Recipe.FindRecipes(); Main.InReforgeMenu = false; - if (playerInventory) - Recipe.FindRecipes(); } Main.hoverItemName = ""; } @@ -32416,7 +32841,77 @@ label_56: this.DrawHairWindow(); } - private static void DrawInterface_20_MultiplayerPlayerNames() => Main.ActiveClosePlayersTeamOverlay.Draw(); + private static void DrawInterface_20_MultiplayerPlayerNames() + { + PlayerInput.SetZoom_World(); + int screenWidth = Main.screenWidth; + int screenHeight = Main.screenHeight; + Vector2 screenPosition = Main.screenPosition; + PlayerInput.SetZoom_UI(); + float uiScale = Main.UIScale; + for (int index = 0; index < (int) byte.MaxValue; ++index) + { + if (Main.player[index].active && Main.myPlayer != index && !Main.player[index].dead && Main.player[Main.myPlayer].team > 0 && Main.player[Main.myPlayer].team == Main.player[index].team) + { + string str = Main.player[index].name; + if (Main.player[index].statLife < Main.player[index].statLifeMax2) + str = str + ": " + (object) Main.player[index].statLife + "/" + (object) Main.player[index].statLifeMax2; + Vector2 vector2_1 = Main.fontMouseText.MeasureString(str); + float num1 = 0.0f; + if (Main.player[index].chatOverhead.timeLeft > 0) + num1 = -vector2_1.Y; + Vector2 vector2_2 = new Vector2((float) (screenWidth / 2) + screenPosition.X, (float) (screenHeight / 2) + screenPosition.Y); + Vector2 position = Main.player[index].position; + Vector2 vector2_3 = position + (position - vector2_2) * (Main.GameViewMatrix.Zoom - Vector2.One); + float num2 = 0.0f; + float num3 = (float) Main.mouseTextColor / (float) byte.MaxValue; + Microsoft.Xna.Framework.Color color = new Microsoft.Xna.Framework.Color((int) (byte) ((double) Main.teamColor[Main.player[index].team].R * (double) num3), (int) (byte) ((double) Main.teamColor[Main.player[index].team].G * (double) num3), (int) (byte) ((double) Main.teamColor[Main.player[index].team].B * (double) num3), (int) Main.mouseTextColor); + float num4 = vector2_3.X + (float) (Main.player[index].width / 2) - vector2_2.X; + float num5 = (float) ((double) vector2_3.Y - (double) vector2_1.Y - 2.0) + num1 - vector2_2.Y; + float num6 = (float) Math.Sqrt((double) num4 * (double) num4 + (double) num5 * (double) num5); + int num7 = screenHeight; + if (screenHeight > screenWidth) + num7 = screenWidth; + int num8 = num7 / 2 - 30; + if (num8 < 100) + num8 = 100; + if ((double) num6 < (double) num8) + { + vector2_1.X = (float) ((double) vector2_3.X + (double) (Main.player[index].width / 2) - (double) vector2_1.X / 2.0) - screenPosition.X; + vector2_1.Y = (float) ((double) vector2_3.Y - (double) vector2_1.Y - 2.0) + num1 - screenPosition.Y; + } + else + { + num2 = num6; + float num9 = (float) num8 / num6; + vector2_1.X = (float) ((double) (screenWidth / 2) + (double) num4 * (double) num9 - (double) vector2_1.X / 2.0); + vector2_1.Y = (float) (screenHeight / 2) + num5 * num9; + } + if ((double) Main.player[Main.myPlayer].gravDir == -1.0) + vector2_1.Y = (float) screenHeight - vector2_1.Y; + vector2_1 *= 1f / uiScale; + Vector2 vector2_4 = Main.fontMouseText.MeasureString(str); + vector2_1 += vector2_4 * (1f - uiScale) / 4f; + if ((double) num2 > 0.0) + { + string textValue = Language.GetTextValue("GameUI.PlayerDistance", (object) (int) ((double) num2 / 16.0 * 2.0)); + Vector2 vector2_5 = Main.fontMouseText.MeasureString(textValue); + vector2_5.X = (float) ((double) vector2_1.X + (double) vector2_4.X / 2.0 - (double) vector2_5.X / 2.0); + vector2_5.Y = (float) ((double) vector2_1.Y + (double) vector2_4.Y / 2.0 - (double) vector2_5.Y / 2.0 - 20.0); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, textValue, new Vector2(vector2_5.X - 2f, vector2_5.Y), Microsoft.Xna.Framework.Color.Black, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, textValue, new Vector2(vector2_5.X + 2f, vector2_5.Y), Microsoft.Xna.Framework.Color.Black, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, textValue, new Vector2(vector2_5.X, vector2_5.Y - 2f), Microsoft.Xna.Framework.Color.Black, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, textValue, new Vector2(vector2_5.X, vector2_5.Y + 2f), Microsoft.Xna.Framework.Color.Black, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, textValue, vector2_5, color, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + } + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str, new Vector2(vector2_1.X - 2f, vector2_1.Y), Microsoft.Xna.Framework.Color.Black, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str, new Vector2(vector2_1.X + 2f, vector2_1.Y), Microsoft.Xna.Framework.Color.Black, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str, new Vector2(vector2_1.X, vector2_1.Y - 2f), Microsoft.Xna.Framework.Color.Black, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str, new Vector2(vector2_1.X, vector2_1.Y + 2f), Microsoft.Xna.Framework.Color.Black, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str, vector2_1, color, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + } + } + } private static void DrawInterface_19_SignTileBubble() { @@ -32431,12 +32926,12 @@ label_56: if ((double) Main.signX > (double) Main.player[Main.myPlayer].position.X + (double) Main.player[Main.myPlayer].width) { effects = SpriteEffects.FlipHorizontally; - num3 = num1 + (-8 - TextureAssets.Chat2.Width()); + num3 = num1 + (-8 - Main.chat2Texture.Width); } else num3 = num1 + 8; int num4 = num2 - 22; - Main.spriteBatch.Draw(TextureAssets.Chat2.Value, new Vector2((float) num3, (float) num4), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Chat2.Width(), TextureAssets.Chat2.Height())), new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor), 0.0f, new Vector2(), 1f, effects, 0.0f); + Main.spriteBatch.Draw(Main.chat2Texture, new Vector2((float) num3, (float) num4), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.chat2Texture.Width, Main.chat2Texture.Height)), new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor), 0.0f, new Vector2(), 1f, effects, 0.0f); Main.signBubble = false; } @@ -32455,7 +32950,7 @@ label_56: str = "Gamepad Left Thumbstick : " + string.Format("{0,-10} , {1,-10}", (object) PlayerInput.GamepadThumbstickLeft.X.ToString("P2"), (object) PlayerInput.GamepadThumbstickLeft.Y.ToString("P2")); if (index == 1) str = "Gamepad Right Thumbstick: " + string.Format("{0,-10} , {1,-10}", (object) PlayerInput.GamepadThumbstickRight.X.ToString("P2"), (object) PlayerInput.GamepadThumbstickRight.Y.ToString("P2")); - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, str, new Vector2((float) num1, (float) num2), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str, new Vector2((float) num1, (float) num2), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } } for (int index = 0; index < 7; ++index) @@ -32477,14 +32972,14 @@ label_56: str = "Black Tiles:"; if (index == 6) str = "Total Render:"; - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, str, new Vector2((float) num3, (float) num4), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str, new Vector2((float) num3, (float) num4), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } for (int drawType = 0; drawType < 7; ++drawType) { int num5 = 180; int num6 = 220 + drawType * 16; string str = string.Format("{0:F2}ms", (object) (float) (drawType != 6 ? (double) TimeLogger.GetDrawTime(drawType) : (double) TimeLogger.GetDrawTotal())); - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, str, new Vector2((float) num5, (float) num6), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str, new Vector2((float) num5, (float) num6), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } for (int index = 0; index < 6; ++index) { @@ -32503,14 +32998,14 @@ label_56: str = "Lighting Phase #4"; if (index == 5) str = "Total Lighting:"; - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, str, new Vector2((float) num7, (float) num8), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str, new Vector2((float) num7, (float) num8), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } for (int lightingType = 0; lightingType < 6; ++lightingType) { int num9 = 180; int num10 = 346 + lightingType * 16; string str = string.Format("{0:F2}ms", (object) (float) (lightingType != 5 ? (double) TimeLogger.GetLightingTime(lightingType) : (double) TimeLogger.GetLightingTotal())); - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, str, new Vector2((float) num9, (float) num10), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str, new Vector2((float) num9, (float) num10), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } int num11 = 5; for (int index = 0; index < num11; ++index) @@ -32518,14 +33013,14 @@ label_56: int num12 = 20; int num13 = 456 + index * 16; string str = "Render #" + (object) index + ":"; - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, str, new Vector2((float) num12, (float) num13), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str, new Vector2((float) num12, (float) num13), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } for (int renderType = 0; renderType < num11; ++renderType) { int num14 = 180; int num15 = 456 + renderType * 16; string str = string.Format("{0:F2}ms", (object) TimeLogger.GetRenderTime(renderType)); - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, str, new Vector2((float) num14, (float) num15), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str, new Vector2((float) num14, (float) num15), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } for (int renderType = 0; renderType < num11; ++renderType) { @@ -32533,28 +33028,80 @@ label_56: int num17 = 456 + renderType * 16; int num18 = num16 + 10; string str = string.Format("{0:F2}ms", (object) TimeLogger.GetRenderMax(renderType)); - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, str, new Vector2((float) num18, (float) num17), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str, new Vector2((float) num18, (float) num17), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } string str1 = ""; int num19 = 20; int num20 = 456 + 16 * num11 + 16; string str2 = "Update:"; - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, str2, new Vector2((float) num19, (float) num20), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str2, new Vector2((float) num19, (float) num20), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); str1 = ""; int num21 = 180; string str3 = string.Format("{0:F2}ms", (object) Main.upTimer); - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, str3, new Vector2((float) num21, (float) num20), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str3, new Vector2((float) num21, (float) num20), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); str1 = ""; int num22 = 240; string str4 = string.Format("{0:F2}ms", (object) Main.upTimerMax); - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, str4, new Vector2((float) num22, (float) num20), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str4, new Vector2((float) num22, (float) num20), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } private static void DrawInterface_17_DiagnoseNet() { - if (!Main.shouldDrawNetDiagnosticsUI) + if (!Main.netDiag) return; - Main.ActiveNetDiagnosticsUI.Draw(Main.spriteBatch); + for (int index = 0; index < 4; ++index) + { + string str = ""; + int num1 = 20; + int num2 = 220; + if (index == 0) + { + str = "RX Msgs: " + string.Format("{0:0,0}", (object) Main.rxMsg); + num2 += index * 20; + } + else if (index == 1) + { + str = "RX Bytes: " + string.Format("{0:0,0}", (object) Main.rxData); + num2 += index * 20; + } + else if (index == 2) + { + str = "TX Msgs: " + string.Format("{0:0,0}", (object) Main.txMsg); + num2 += index * 20; + } + else if (index == 3) + { + str = "TX Bytes: " + string.Format("{0:0,0}", (object) Main.txData); + num2 += index * 20; + } + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str, new Vector2((float) num1, (float) num2), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + } + for (int index = 0; index < Main.maxMsg; ++index) + { + float num3 = 0.7f; + int num4 = 200; + int num5 = 120; + int num6 = index / 50; + int num7 = num4 + num6 * 400; + int num8 = num5 + (index - num6 * 50) * 13; + string str1 = index.ToString() + ": "; + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str1, new Vector2((float) num7, (float) num8), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), num3, SpriteEffects.None, 0.0f); + int num9 = num7 + 30; + string str2 = "rx:" + string.Format("{0:0,0}", (object) Main.rxMsgType[index]); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str2, new Vector2((float) num9, (float) num8), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), num3, SpriteEffects.None, 0.0f); + int num10 = num9 + 70; + string str3 = string.Format("{0:0,0}", (object) Main.rxDataType[index]); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str3, new Vector2((float) num10, (float) num8), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), num3, SpriteEffects.None, 0.0f); + int num11 = num10 + 70; + string str4 = index.ToString() + ": "; + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str4, new Vector2((float) num11, (float) num8), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), num3, SpriteEffects.None, 0.0f); + int num12 = num11 + 30; + string str5 = "tx:" + string.Format("{0:0,0}", (object) Main.txMsgType[index]); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str5, new Vector2((float) num12, (float) num8), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), num3, SpriteEffects.None, 0.0f); + int num13 = num12 + 70; + string str6 = string.Format("{0:0,0}", (object) Main.txDataType[index]); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str6, new Vector2((float) num13, (float) num8), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), num3, SpriteEffects.None, 0.0f); + } } private void DrawInterface_16_MapOrMinimap() @@ -32565,17 +33112,19 @@ label_56: if (!Main.mapFullscreen && Main.mapStyle == 1) { Main.mH = 256; - try + if (Main.ignoreErrors) { - this.DrawMap(new GameTime()); - } - catch (Exception ex) - { - if (Main.ignoreErrors) + try + { + this.DrawMap(); + } + catch (Exception ex) + { TimeLogger.DrawException(ex); - else - throw; + } } + else + this.DrawMap(); } PlayerInput.SetZoom_UI(); if (Main.mH + this.RecommendedEquipmentAreaPushUp <= Main.screenHeight) @@ -32583,38 +33132,21 @@ label_56: Main.mH = Main.screenHeight - this.RecommendedEquipmentAreaPushUp; } - public int RecommendedEquipmentAreaPushUp => Main.player[Main.myPlayer].CanDemonHeartAccessoryBeShown() ? 610 + PlayerInput.UsingGamepad.ToInt() * 30 : 600; + public int RecommendedEquipmentAreaPushUp => Main.player[Main.myPlayer].ExtraAccessorySlotsShouldShow ? 610 + PlayerInput.UsingGamepad.ToInt() * 30 : 600; - private static void DrawInterface_15_InvasionProgressBars() - { - Main.DrawInvasionProgress(); - if (Main.HealthBarDrawSettings == (byte) 0) - return; - Main.BigBossProgressBar.Draw(Main.spriteBatch); - } + private static void DrawInterface_15_InvasionProgressBars() => Main.DrawInvasionProgress(); private void DrawInterface_14_EntityHealthBars() { if (Main.HealthBarDrawSettings == (byte) 0) return; - int index1 = -1; - if (PlayerInput.UsingGamepad) - { - Player localPlayer = Main.LocalPlayer; - for (int index2 = 0; index2 < 200; ++index2) - { - NPC npc = Main.npc[index2]; - if ((npc.life == npc.lifeMax || npc.dontTakeDamage) && !npc.dontTakeDamage && (double) npc.nameOver > 0.0 && (index1 == -1 || (double) npc.Distance(localPlayer.Center) < (double) Main.npc[index1].Distance(localPlayer.Center))) - index1 = index2; - } - } bool flag = false; for (int i = 199; i >= 0; --i) { if (Main.npc[i].active && Main.npc[i].type > 0) { NPC npc1 = Main.npc[i]; - npc1.position = npc1.position + Main.npc[i].netOffset; + npc1.position = npc1.position + Main.npc[i].visualOffset; if (Main.npc[i].life != Main.npc[i].lifeMax && !Main.npc[i].dontTakeDamage) { float scale1 = 1f; @@ -32657,7 +33189,7 @@ label_56: scale1 = 1.5f; if (type == 87) scale1 = 1.5f; - if (type == 510 || type == 454 || type == 621) + if (type == 510 || type == 454) scale1 = 1.5f; if (type == 439 || type == 370) scale1 = 1.5f; @@ -32671,15 +33203,15 @@ label_56: flag = true; Vector2 vector2_1 = new Vector2(); float num = 999999f; - for (int index3 = 0; index3 < 200; ++index3) + for (int index = 0; index < 200; ++index) { - if (Main.npc[index3].active && Main.npc[index3].type >= 134 && Main.npc[index3].type <= 136) + if (Main.npc[index].active && Main.npc[index].type >= 134 && Main.npc[index].type <= 136) { - Vector2 vector2_2 = Main.player[Main.myPlayer].Center - Main.npc[index3].Center; - if ((double) vector2_2.Length() < (double) num && Collision.CanHit(Main.player[Main.myPlayer].Center, 1, 1, Main.npc[index3].Center, 1, 1)) + Vector2 vector2_2 = Main.player[Main.myPlayer].Center - Main.npc[index].Center; + if ((double) vector2_2.Length() < (double) num && Collision.CanHit(Main.player[Main.myPlayer].Center, 1, 1, Main.npc[index].Center, 1, 1)) { num = vector2_2.Length(); - vector2_1 = Main.npc[index3].position; + vector2_1 = Main.npc[index].position; } } } @@ -32687,92 +33219,255 @@ label_56: { Main.destroyerHB = (double) Main.destroyerHB.X >= 100.0 || (double) Main.destroyerHB.Y >= 100.0 ? (Main.destroyerHB * 49f + vector2_1) / 50f : vector2_1; Vector2 destroyerHb = Main.destroyerHB; - int index4 = i; + int index = i; if (type != 134 && Main.npc[i].realLife != -1) - index4 = Main.npc[i].realLife; + index = Main.npc[i].realLife; float alpha = (float) (((double) Lighting.Brightness((int) (((double) Main.npc[i].position.X + (double) (Main.npc[i].width / 2)) / 16.0), (int) (((double) Main.npc[i].position.Y + (double) (Main.npc[i].height / 2) + (double) Main.npc[i].gfxOffY) / 16.0)) + 1.0) / 2.0); - this.DrawHealthBar(destroyerHb.X + (float) (Main.npc[i].width / 2), destroyerHb.Y + (float) (Main.npc[i].height / 2), Main.npc[index4].life, Main.npc[index4].lifeMax, alpha, scale2); + this.DrawHealthBar(destroyerHb.X + (float) (Main.npc[i].width / 2), destroyerHb.Y + (float) (Main.npc[i].height / 2), Main.npc[index].life, Main.npc[index].lifeMax, alpha, scale2); } else Main.destroyerHB = new Vector2(0.0f, 0.0f); } } else if (type == 7) - this.DrawInterface_Healthbar_Worm(Main.npc[i], 9, scale1); + { + Vector2 position = Main.npc[i].position; + int index1 = -1; + for (int index2 = 0; index2 < 200; ++index2) + { + if (Main.npc[index2].active && Main.npc[index2].type == 9) + index1 = index2; + } + if (index1 >= 0) + { + Vector2 vector2 = (position + Main.npc[index1].position) / 2f; + this.DrawHealthBar(vector2.X + (float) (Main.npc[i].width / 2), vector2.Y + (float) (Main.npc[i].height / 2), Main.npc[i].life, Main.npc[i].lifeMax, Lighting.Brightness((int) (((double) Main.npc[i].position.X + (double) (Main.npc[i].width / 2)) / 16.0), (int) (((double) Main.npc[i].position.Y + (double) (Main.npc[i].height / 2) + (double) Main.npc[i].gfxOffY) / 16.0)), scale1); + } + } else if (type != 8 && type != 9) { if (type == 95) - this.DrawInterface_Healthbar_Worm(Main.npc[i], 97, scale1); + { + Vector2 position = Main.npc[i].position; + int index3 = -1; + for (int index4 = 0; index4 < 200; ++index4) + { + if (Main.npc[index4].active && Main.npc[index4].type == 97) + index3 = index4; + } + if (index3 >= 0) + { + Vector2 vector2 = (position + Main.npc[index3].position) / 2f; + this.DrawHealthBar(vector2.X + (float) (Main.npc[i].width / 2), vector2.Y + (float) (Main.npc[i].height / 2), Main.npc[i].life, Main.npc[i].lifeMax, Lighting.Brightness((int) (((double) Main.npc[i].position.X + (double) (Main.npc[i].width / 2)) / 16.0), (int) (((double) Main.npc[i].position.Y + (double) (Main.npc[i].height / 2) + (double) Main.npc[i].gfxOffY) / 16.0)), scale1); + } + } else if (type != 96 && type != 97) { if (type == 10) - this.DrawInterface_Healthbar_Worm(Main.npc[i], 12, scale1); + { + Vector2 position = Main.npc[i].position; + int index5 = -1; + for (int index6 = 0; index6 < 200; ++index6) + { + if (Main.npc[index6].active && Main.npc[index6].type == 12) + index5 = index6; + } + if (index5 >= 0) + { + Vector2 vector2 = (position + Main.npc[index5].position) / 2f; + this.DrawHealthBar(vector2.X + (float) (Main.npc[i].width / 2), vector2.Y + (float) (Main.npc[i].height / 2), Main.npc[i].life, Main.npc[i].lifeMax, Lighting.Brightness((int) (((double) Main.npc[i].position.X + (double) (Main.npc[i].width / 2)) / 16.0), (int) (((double) Main.npc[i].position.Y + (double) (Main.npc[i].height / 2) + (double) Main.npc[i].gfxOffY) / 16.0)), scale1); + } + } else if (type != 11 && type != 12) { - if (type == 87) - this.DrawInterface_Healthbar_Worm(Main.npc[i], 92, scale1); - else if (type < 88 || type > 92) + switch (type) { - if (type == 412) - this.DrawInterface_Healthbar_Worm(Main.npc[i], 414, scale1); - else if (type != 414 && type != 413) - { - if (type == 39) - this.DrawInterface_Healthbar_Worm(Main.npc[i], 41, scale1); - else if (type != 40 && type != 41) + case 87: + Vector2 position1 = Main.npc[i].position; + int index7 = -1; + for (int index8 = 0; index8 < 200; ++index8) { - if (type == 98) - this.DrawInterface_Healthbar_Worm(Main.npc[i], 100, scale1); - else if (type != 99 && type != 100) + if (Main.npc[index8].active && Main.npc[index8].type == 92) + index7 = index8; + } + if (index7 >= 0) + { + Vector2 vector2 = (position1 + Main.npc[index7].position) / 2f; + this.DrawHealthBar(vector2.X + (float) (Main.npc[i].width / 2), vector2.Y + (float) (Main.npc[i].height / 2), Main.npc[i].life, Main.npc[i].lifeMax, Lighting.Brightness((int) (((double) Main.npc[i].position.X + (double) (Main.npc[i].width / 2)) / 16.0), (int) (((double) Main.npc[i].position.Y + (double) (Main.npc[i].height / 2) + (double) Main.npc[i].gfxOffY) / 16.0)), scale1); + break; + } + break; + case 412: + Vector2 position2 = Main.npc[i].position; + int index9 = i; + while (index9 > 0 && index9 < 200 && (double) Main.npc[index9].ai[0] > 0.0) + index9 = (int) Main.npc[index9].ai[0]; + if (index9 >= 0) + { + Vector2 vector2 = (position2 + Main.npc[index9].position) / 2f; + this.DrawHealthBar(vector2.X + (float) (Main.npc[i].width / 2), vector2.Y + (float) (Main.npc[i].height / 2), Main.npc[i].life, Main.npc[i].lifeMax, Lighting.Brightness((int) (((double) Main.npc[i].position.X + (double) (Main.npc[i].width / 2)) / 16.0), (int) (((double) Main.npc[i].position.Y + (double) (Main.npc[i].height / 2) + (double) Main.npc[i].gfxOffY) / 16.0)), scale1); + break; + } + break; + default: + if (type != 414 && type != 413 && (type < 88 || type > 92)) + { + if (type == 39) { - if (type == 454) - this.DrawInterface_Healthbar_Worm(Main.npc[i], 459, scale1); - else if (type < 455 || type > 459) + Vector2 position3 = Main.npc[i].position; + int index10 = -1; + for (int index11 = 0; index11 < 200; ++index11) { - if (type == 510) - this.DrawInterface_Healthbar_Worm(Main.npc[i], 512, scale1); - else if (type != 511 && type != 512) + if (Main.npc[index11].active && Main.npc[index11].type == 41) + index10 = index11; + } + if (index10 >= 0) + { + Vector2 vector2 = (position3 + Main.npc[index10].position) / 2f; + this.DrawHealthBar(vector2.X + (float) (Main.npc[i].width / 2), vector2.Y + (float) (Main.npc[i].height / 2), Main.npc[i].life, Main.npc[i].lifeMax, Lighting.Brightness((int) (((double) Main.npc[i].position.X + (double) (Main.npc[i].width / 2)) / 16.0), (int) (((double) Main.npc[i].position.Y + (double) (Main.npc[i].height / 2) + (double) Main.npc[i].gfxOffY) / 16.0)), scale1); + break; + } + break; + } + if (type != 40 && type != 41) + { + if (type == 98) + { + Vector2 position4 = Main.npc[i].position; + int index12 = -1; + for (int index13 = 0; index13 < 200; ++index13) { - if (type == 621) - this.DrawInterface_Healthbar_Worm(Main.npc[i], 623, scale1); - else if (type != 622 && type != 623) + if (Main.npc[index13].active && Main.npc[index13].type == 100) + index12 = index13; + } + if (index12 >= 0) + { + Vector2 vector2 = (position4 + Main.npc[index12].position) / 2f; + this.DrawHealthBar(vector2.X + (float) (Main.npc[i].width / 2), vector2.Y + (float) (Main.npc[i].height / 2), Main.npc[i].life, Main.npc[i].lifeMax, Lighting.Brightness((int) (((double) Main.npc[i].position.X + (double) (Main.npc[i].width / 2)) / 16.0), (int) (((double) Main.npc[i].position.Y + (double) (Main.npc[i].height / 2) + (double) Main.npc[i].gfxOffY) / 16.0)), scale1); + break; + } + break; + } + if (type != 99 && type != 100) + { + if (type == 454) + { + Vector2 position5 = Main.npc[i].position; + int index14 = -1; + for (int index15 = 0; index15 < 200; ++index15) + { + if (Main.npc[index15].active && Main.npc[index15].type == 459) + index14 = index15; + } + if (index14 >= 0) + { + Vector2 vector2 = (position5 + Main.npc[index14].position) / 2f; + this.DrawHealthBar(vector2.X + (float) (Main.npc[i].width / 2), vector2.Y + (float) (Main.npc[i].height / 2), Main.npc[i].life, Main.npc[i].lifeMax, Lighting.Brightness((int) (((double) Main.npc[i].position.X + (double) (Main.npc[i].width / 2)) / 16.0), (int) (((double) Main.npc[i].position.Y + (double) (Main.npc[i].height / 2) + (double) Main.npc[i].gfxOffY) / 16.0)), scale1); + break; + } + break; + } + if (type < 455 || type > 459) + { + if (type == 510) + { + Vector2 position6 = Main.npc[i].position; + int index16 = -1; + for (int index17 = 0; index17 < 200; ++index17) + { + if (Main.npc[index17].active && Main.npc[index17].type == 512) + index16 = index17; + } + if (index16 >= 0) + { + Vector2 vector2 = (position6 + Main.npc[index16].position) / 2f; + this.DrawHealthBar(vector2.X + (float) (Main.npc[i].width / 2), vector2.Y + (float) (Main.npc[i].height / 2), Main.npc[i].life, Main.npc[i].lifeMax, Lighting.Brightness((int) (((double) Main.npc[i].position.X + (double) (Main.npc[i].width / 2)) / 16.0), (int) (((double) Main.npc[i].position.Y + (double) (Main.npc[i].height / 2) + (double) Main.npc[i].gfxOffY) / 16.0)), scale1); + break; + } + break; + } + if (type != 511 && type != 512) { if (type == 513) - this.DrawInterface_Healthbar_Worm(Main.npc[i], 515, scale1); - else if (type != 514 && type != 515) + { + Vector2 position7 = Main.npc[i].position; + int index18 = -1; + for (int index19 = 0; index19 < 200; ++index19) + { + if (Main.npc[index19].active && Main.npc[index19].type == 515) + index18 = index19; + } + if (index18 >= 0) + { + Vector2 vector2 = (position7 + Main.npc[index18].position) / 2f; + this.DrawHealthBar(vector2.X + (float) (Main.npc[i].width / 2), vector2.Y + (float) (Main.npc[i].height / 2), Main.npc[i].life, Main.npc[i].lifeMax, Lighting.Brightness((int) (((double) Main.npc[i].position.X + (double) (Main.npc[i].width / 2)) / 16.0), (int) (((double) Main.npc[i].position.Y + (double) (Main.npc[i].height / 2) + (double) Main.npc[i].gfxOffY) / 16.0)), scale1); + break; + } + break; + } + if (type != 514 && type != 515) { if (type == 117) - this.DrawInterface_Healthbar_Worm(Main.npc[i], 119, scale1); - else if (type != 118 && type != 119) + { + Vector2 position8 = Main.npc[i].position; + int index20 = -1; + for (int index21 = 0; index21 < 200; ++index21) + { + if (Main.npc[index21].active && Main.npc[index21].type == 119) + index20 = index21; + } + if (index20 >= 0) + { + Vector2 vector2 = (position8 + Main.npc[index20].position) / 2f; + this.DrawHealthBar(vector2.X + (float) (Main.npc[i].width / 2), vector2.Y + (float) (Main.npc[i].height / 2), Main.npc[i].life, Main.npc[i].lifeMax, Lighting.Brightness((int) (((double) Main.npc[i].position.X + (double) (Main.npc[i].width / 2)) / 16.0), (int) (((double) Main.npc[i].position.Y + (double) (Main.npc[i].height / 2) + (double) Main.npc[i].gfxOffY) / 16.0)), scale1); + break; + } + break; + } + if (type != 118 && type != 119) { switch (Main.HealthBarDrawSettings) { case 1: - float num1 = 10f + Main.NPCAddHeight(Main.npc[i]); + float num1 = 10f + Main.NPCAddHeight(i); this.DrawHealthBar(Main.npc[i].position.X + (float) (Main.npc[i].width / 2), Main.npc[i].position.Y + (float) Main.npc[i].height + num1 + Main.npc[i].gfxOffY, Main.npc[i].life, Main.npc[i].lifeMax, Lighting.Brightness((int) (((double) Main.npc[i].position.X + (double) (Main.npc[i].width / 2)) / 16.0), (int) (((double) Main.npc[i].position.Y + (double) (Main.npc[i].height / 2) + (double) Main.npc[i].gfxOffY) / 16.0)), scale1); break; case 2: - float num2 = -24f - Main.NPCAddHeight(Main.npc[i]) / 2f; + float num2 = -24f - Main.NPCAddHeight(i) / 2f; this.DrawHealthBar(Main.npc[i].position.X + (float) (Main.npc[i].width / 2), Main.npc[i].position.Y + num2 + Main.npc[i].gfxOffY, Main.npc[i].life, Main.npc[i].lifeMax, Lighting.Brightness((int) (((double) Main.npc[i].position.X + (double) (Main.npc[i].width / 2)) / 16.0), (int) (((double) Main.npc[i].position.Y + (double) (Main.npc[i].height / 2) + (double) Main.npc[i].gfxOffY) / 16.0)), scale1); break; } } + else + break; } + else + break; } + else + break; } + else + break; } + else + break; } + else + break; } - } + else + break; + break; } } } } } } - else if (!Main.npc[i].dontTakeDamage && (double) Main.npc[i].nameOver > 0.0 && PlayerInput.UsingGamepad && i == index1) + else if (!Main.npc[i].dontTakeDamage && (double) Main.npc[i].nameOver > 0.0 && PlayerInput.UsingGamepad) { - Vector2 stringSize = ChatManager.GetStringSize(FontAssets.MouseText.Value, Main.npc[i].GivenOrTypeName, Vector2.One); + Vector2 stringSize = ChatManager.GetStringSize(Main.fontMouseText, Main.npc[i].GivenOrTypeName, Vector2.One); Vector2 vector2_3 = Main.npc[i].Bottom - Main.screenPosition + new Vector2(0.0f, 10f); Vector2 pos; if (NPC.GetNPCLocation(i, true, true, out int _, out pos)) @@ -32781,36 +33476,36 @@ label_56: if ((double) Main.player[Main.myPlayer].gravDir == -1.0) vector2_4 = Main.ReverseGravitySupport(vector2_4, (float) (-Main.npc[i].height - 20)); Vector2 origin = stringSize * new Vector2(0.5f, 0.0f); - ChatManager.DrawColorCodedStringShadow(Main.spriteBatch, FontAssets.MouseText.Value, Main.npc[i].GivenOrTypeName, vector2_4, Microsoft.Xna.Framework.Color.Black * Main.npc[i].nameOver * 0.5f, 0.0f, origin, Vector2.One); - ChatManager.DrawColorCodedString(Main.spriteBatch, FontAssets.MouseText.Value, Main.npc[i].GivenOrTypeName, vector2_4, Microsoft.Xna.Framework.Color.White * Main.npc[i].nameOver, 0.0f, origin, Vector2.One); + ChatManager.DrawColorCodedStringShadow(Main.spriteBatch, Main.fontMouseText, Main.npc[i].GivenOrTypeName, vector2_4, Microsoft.Xna.Framework.Color.Black * Main.npc[i].nameOver * 0.5f, 0.0f, origin, Vector2.One); + ChatManager.DrawColorCodedString(Main.spriteBatch, Main.fontMouseText, Main.npc[i].GivenOrTypeName, vector2_4, Microsoft.Xna.Framework.Color.White * Main.npc[i].nameOver, 0.0f, origin, Vector2.One); } } if (Main.npc[i].type == 548 && !Main.npc[i].dontTakeDamageFromHostiles && DD2Event.TimeLeftBetweenWaves > 0 && !Main.hideUI) { Vector2 position = Main.npc[i].Bottom - Main.screenPosition + new Vector2(0.0f, -100f); string text = string.Format("{0}", (object) (DD2Event.TimeLeftBetweenWaves / 60)); - DynamicSpriteFont font = FontAssets.MouseText.Value; + DynamicSpriteFont fontMouseText = Main.fontMouseText; float num = 1f; - Vector2 origin = font.MeasureString(text) * num * new Vector2(0.5f, 0.5f); - ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, font, text, position, Microsoft.Xna.Framework.Color.White, 0.0f, origin, Vector2.One * num); + Vector2 origin = fontMouseText.MeasureString(text) * num * new Vector2(0.5f, 0.5f); + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, fontMouseText, text, position, Microsoft.Xna.Framework.Color.White, 0.0f, origin, Vector2.One * num); } NPC npc2 = Main.npc[i]; - npc2.position = npc2.position - Main.npc[i].netOffset; + npc2.position = npc2.position - Main.npc[i].visualOffset; } } - for (int index5 = 0; index5 < (int) byte.MaxValue; ++index5) + for (int index = 0; index < (int) byte.MaxValue; ++index) { - if (index5 != Main.myPlayer && Main.player[index5].active && !Main.player[index5].ghost && !Main.player[index5].dead && !Main.player[index5].invis && Main.player[index5].statLife != Main.player[index5].statLifeMax2) + if (index != Main.myPlayer && Main.player[index].active && !Main.player[index].ghost && !Main.player[index].dead && Main.player[index].statLife != Main.player[index].statLifeMax2) { switch (Main.HealthBarDrawSettings) { case 1: int num3 = 10; - this.DrawHealthBar(Main.player[index5].position.X + (float) (Main.player[index5].width / 2), Main.player[index5].position.Y + (float) Main.player[index5].height + (float) num3 + Main.player[index5].gfxOffY, Main.player[index5].statLife, Main.player[index5].statLifeMax2, Main.player[index5].stealth * Lighting.Brightness((int) (((double) Main.player[index5].position.X + (double) (Main.player[index5].width / 2)) / 16.0), (int) (((double) Main.player[index5].position.Y + (double) (Main.player[index5].height / 2) + (double) Main.player[index5].gfxOffY) / 16.0))); + this.DrawHealthBar(Main.player[index].position.X + (float) (Main.player[index].width / 2), Main.player[index].position.Y + (float) Main.player[index].height + (float) num3 + Main.player[index].gfxOffY, Main.player[index].statLife, Main.player[index].statLifeMax2, Lighting.Brightness((int) (((double) Main.player[index].position.X + (double) (Main.player[index].width / 2)) / 16.0), (int) (((double) Main.player[index].position.Y + (double) (Main.player[index].height / 2) + (double) Main.player[index].gfxOffY) / 16.0))); continue; case 2: int num4 = -20; - this.DrawHealthBar(Main.player[index5].position.X + (float) (Main.player[index5].width / 2), Main.player[index5].position.Y + (float) num4 + Main.player[index5].gfxOffY, Main.player[index5].statLife, Main.player[index5].statLifeMax2, Main.player[index5].stealth * Lighting.Brightness((int) (((double) Main.player[index5].position.X + (double) (Main.player[index5].width / 2)) / 16.0), (int) (((double) Main.player[index5].position.Y + (double) (Main.player[index5].height / 2) + (double) Main.player[index5].gfxOffY) / 16.0))); + this.DrawHealthBar(Main.player[index].position.X + (float) (Main.player[index].width / 2), Main.player[index].position.Y + (float) num4 + Main.player[index].gfxOffY, Main.player[index].statLife, Main.player[index].statLifeMax2, Lighting.Brightness((int) (((double) Main.player[index].position.X + (double) (Main.player[index].width / 2)) / 16.0), (int) (((double) Main.player[index].position.Y + (double) (Main.player[index].height / 2) + (double) Main.player[index].gfxOffY) / 16.0))); continue; default: continue; @@ -32819,34 +33514,14 @@ label_56: } } - private void DrawInterface_Healthbar_Worm(NPC head, int tailID, float scale) - { - NPC npc = head; - for (int index = head.whoAmI + 1; index < 200; ++index) - { - if (Main.npc[index].active && Main.npc[index].type == tailID) - { - npc = Main.npc[index]; - break; - } - } - Vector2 vector2 = (head.position + npc.position) / 2f; - this.DrawHealthBar(vector2.X + (float) (head.width / 2), vector2.Y + (float) (head.height / 2), head.life, head.lifeMax, Lighting.Brightness((int) (((double) head.position.X + (double) (head.width / 2)) / 16.0), (int) (((double) head.position.Y + (double) (head.height / 2) + (double) head.gfxOffY) / 16.0)), scale); - } - - private static void DrawInterface_13_AchievementCompletePopups() => InGameNotificationsTracker.DrawInGame(Main.spriteBatch); + private static void DrawInterface_13_AchievementCompletePopups() => AchievementCompleteUI.Draw(Main.spriteBatch); private static bool DrawInterface_12_IngameFancyUI() { - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.SamplerStateForCursor, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, Main.UIScaleMatrix); Main.InGameUI.Draw(Main.spriteBatch, Main._drawInterfaceGameTime); bool flag = true; if (Main.inFancyUI && !IngameFancyUI.Draw(Main.spriteBatch, Main._drawInterfaceGameTime)) - { flag = false; - Main.DrawPendingMouseText(); - } return flag; } @@ -32855,14 +33530,7 @@ label_56: bool flag = true; if (Main.ingameOptionsWindow) { - this.DrawInterface_16_MapOrMinimap(); - PlayerInput.SetZoom_UI(); - Matrix uiScaleMatrix = Main.UIScaleMatrix; - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, (BlendState) null, (SamplerState) null, (DepthStencilState) null, (RasterizerState) null, (Effect) null, uiScaleMatrix); IngameOptions.Draw(this, Main.spriteBatch); - this.DrawInterface_40_InteractItemIcon(); - Main.DrawPendingMouseText(); flag = false; Main._MouseOversCanClear = true; } @@ -32877,7 +33545,6 @@ label_56: Main.maxQ = true; flag = false; Main._MouseOversCanClear = true; - Main.DrawPendingMouseText(); } return flag; } @@ -32892,24 +33559,11 @@ label_56: CaptureManager.Instance.Draw(Main.spriteBatch); flag = false; Main._MouseOversCanClear = true; - PlayerInput.SetZoom_UI(); - Matrix uiScaleMatrix = Main.UIScaleMatrix; - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, (BlendState) null, (SamplerState) null, (DepthStencilState) null, (RasterizerState) null, (Effect) null, uiScaleMatrix); - Main.DrawPendingMouseText(); } return flag; } - private static void DrawInterface_9_WireSelection() - { - if (!Main.hideUI) - { - Main.DrawInterface_Resources_GolfPower(); - Main.DrawInterface_GolfBallIndicator(); - } - WiresUI.HandleWiresUI(Main.spriteBatch); - } + private static void DrawInterface_9_WireSelection() => WiresUI.HandleWiresUI(Main.spriteBatch); private static void DrawInterface_0_InterfaceLogic1() { @@ -32920,13 +33574,13 @@ label_56: private void DrawInterface_7_TownNPCHouseBanners() { - if (Main.EquipPage != 1 && (!UILinkPointNavigator.Shortcuts.NPCS_IconsDisplay || !PlayerInput.UsingGamepad)) + if (Main.EquipPage != 1 && !UILinkPointNavigator.Shortcuts.NPCS_IconsDisplay) return; if (Main.ignoreErrors) { try { - this.DrawNPCHousesInWorld(); + this.DrawNPCHouse(); } catch (Exception ex) { @@ -32934,28 +33588,26 @@ label_56: } } else - this.DrawNPCHousesInWorld(); + this.DrawNPCHouse(); } private static void DrawInterface_6_TileGridOption() { - bool flag = Main.MouseShowBuildingGrid && !Main.SmartCursorEnabled; - int num1 = !PlayerInput.UsingGamepad || Main.SmartCursorEnabled ? 0 : (!PlayerInput.UsingGamepadUI ? 1 : 0); - if (flag && !Main.player[Main.myPlayer].dead && !PlayerInput.CursorIsBusy) + if ((PlayerInput.UsingGamepad && !Main.SmartCursorEnabled && !PlayerInput.UsingGamepadUI || Main.MouseShowBuildingGrid && !Main.SmartCursorEnabled) && !Main.player[Main.myPlayer].dead && !PlayerInput.CursorIsBusy) { - float num2 = MathHelper.Lerp(0.0f, 0.7f, MathHelper.Clamp((float) (1.0 - (double) Main.player[Main.myPlayer].velocity.Length() / 6.0), 0.0f, 1f)); - Main.MouseBuildingGridAlpha = MathHelper.Lerp(Main.MouseBuildingGridAlpha, num2, 0.2f); + float num1 = MathHelper.Lerp(0.0f, 0.7f, MathHelper.Clamp((float) (1.0 - (double) Main.player[Main.myPlayer].velocity.Length() / 6.0), 0.0f, 1f)); + Main.MouseBuildingGridAlpha = MathHelper.Lerp(Main.MouseBuildingGridAlpha, num1, 0.2f); float buildingGridAlpha = Main.MouseBuildingGridAlpha; if ((double) buildingGridAlpha <= 0.0) return; Vector2 vector2_1 = Main.MouseWorld.ToTileCoordinates().ToVector2() * 16f; Vector2 vector2_2 = new Vector2((float) Main.offScreenRange, (float) Main.offScreenRange); - int num3 = Main.drawToScreen ? 1 : 0; + int num2 = Main.drawToScreen ? 1 : 0; Vector2 position = vector2_1 - Main.screenPosition + new Vector2(8f); if ((double) Main.player[Main.myPlayer].gravDir == -1.0) position.Y = (float) Main.screenHeight - position.Y; - Texture2D texture2D = TextureAssets.CursorRadial.Value; - Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(), Microsoft.Xna.Framework.Color.White * 0.5f * buildingGridAlpha, 0.0f, texture2D.Size() / 2f, 1f, SpriteEffects.None, 0.0f); + Texture2D cursorRadialTexture = Main.cursorRadialTexture; + Main.spriteBatch.Draw(cursorRadialTexture, position, new Microsoft.Xna.Framework.Rectangle?(), Microsoft.Xna.Framework.Color.White * 0.5f * buildingGridAlpha, 0.0f, cursorRadialTexture.Size() / 2f, 1f, SpriteEffects.None, 0.0f); } else Main.MouseBuildingGridAlpha = MathHelper.Clamp(Main.MouseBuildingGridAlpha - 0.05f, 0.0f, 1f); @@ -32978,65 +33630,64 @@ label_56: int num5 = 1; if ((double) Main.mouseX + (double) Main.screenPosition.X < (double) Main.player[Main.myPlayer].Center.X) num5 = -1; - int num6 = (int) ((double) Main.player[Main.myPlayer].position.X + (double) (Main.player[Main.myPlayer].width / 2)) / 16; + int num6 = (int) ((double) Main.player[Main.myPlayer].position.X + (double) (Main.player[Main.myPlayer].width / 2) + (double) (num5 * 4)) / 16; int num7 = (int) ((double) Main.player[Main.myPlayer].position.Y + (double) Main.player[Main.myPlayer].height - 2.0) / 16; if ((double) Main.player[Main.myPlayer].gravDir == -1.0) --num7; + int num8 = num6 + num5; Vector2 mouseWorld = Main.MouseWorld; - if (Math.Abs(num6 - (int) ((double) Main.MouseWorld.X / 16.0)) > 0) - num6 += num5; if ((double) Main.player[Main.myPlayer].gravDir == -1.0) mouseWorld.Y += 16f; Vector2 vector2_1 = mouseWorld / 16f; - Vector2 vector2_2 = new Vector2((float) num6, (float) num7); - int num8 = (int) vector2_1.X - num6; - int num9 = (int) vector2_1.Y - num7; - Math.Abs(num8); - Math.Abs(num9); - Main.rulerLineDisplayValues.X = num8; - Main.rulerLineDisplayValues.Y = num9; - if (num8 == 0 && num9 == 0) + Vector2 vector2_2 = new Vector2((float) num8, (float) num7); + int num9 = (int) vector2_1.X - num8; + int num10 = (int) vector2_1.Y - num7; + int num11 = Math.Abs(num9) + 1; + int num12 = Math.Abs(num10) + 1; + if (num9 == 0 && num10 == 0) return; - Texture2D texture = TextureAssets.Extra[2].Value; + Texture2D texture = Main.extraTexture[2]; Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, 0, 16, 16); - int num10 = num6; - int num11 = num7; + int num13 = num8; + int num14 = num7; if ((double) Main.player[Main.myPlayer].gravDir == -1.0) - --num11; + --num14; float r = 0.24f; float g = 0.8f; float b = 0.9f; float a = 1f; - float num12 = 0.8f; - Microsoft.Xna.Framework.Color color1 = new Microsoft.Xna.Framework.Color(r, g, b, a) * num12 * num4; - Main.spriteBatch.Draw(texture, Main.ReverseGravitySupport(new Vector2((float) num10, (float) num11) * 16f - Main.screenPosition, 16f), new Microsoft.Xna.Framework.Rectangle?(rectangle), color1, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - if (num8 != 0) + float num15 = 0.8f; + Microsoft.Xna.Framework.Color color1 = new Microsoft.Xna.Framework.Color(r, g, b, a) * num15 * num4; + Main.spriteBatch.Draw(texture, Main.ReverseGravitySupport(new Vector2((float) num13, (float) num14) * 16f - Main.screenPosition, 16f), new Microsoft.Xna.Framework.Rectangle?(rectangle), color1, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + if (num9 != 0) { - int num13 = Math.Sign(num8); - rectangle.Y = num13 == 1 ? 16 : 32; - while (num8 != 0) + int num16 = Math.Sign(num9); + rectangle.Y = num16 == 1 ? 16 : 32; + while (num9 != 0) { - num8 -= num13; - num10 += num13; - if (num8 == 0) + num9 -= num16; + num13 += num16; + if (num9 == 0) rectangle.Y = 0; - Microsoft.Xna.Framework.Color color2 = new Microsoft.Xna.Framework.Color(r, g, b, a) * num12 * num4; - Main.spriteBatch.Draw(texture, Main.ReverseGravitySupport(new Vector2((float) num10, (float) num11) * 16f - Main.screenPosition, 16f), new Microsoft.Xna.Framework.Rectangle?(rectangle), color2, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + Microsoft.Xna.Framework.Color color2 = new Microsoft.Xna.Framework.Color(r, g, b, a) * num15 * num4; + Main.spriteBatch.Draw(texture, Main.ReverseGravitySupport(new Vector2((float) num13, (float) num14) * 16f - Main.screenPosition, 16f), new Microsoft.Xna.Framework.Rectangle?(rectangle), color2, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } } - if (num9 == 0) - return; - int num14 = Math.Sign(num9); - rectangle.Y = num14 == 1 ? 48 : 64; - while (num9 != 0) + if (num10 != 0) { - num9 -= num14; - num11 += num14; - if (num9 == 0) - rectangle.Y = 0; - Microsoft.Xna.Framework.Color color3 = new Microsoft.Xna.Framework.Color(r, g, b, a) * num12 * num4; - Main.spriteBatch.Draw(texture, Main.ReverseGravitySupport(new Vector2((float) num10, (float) num11) * 16f - Main.screenPosition, 16f), new Microsoft.Xna.Framework.Rectangle?(rectangle), color3, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + int num17 = Math.Sign(num10); + rectangle.Y = num17 == 1 ? 48 : 64; + while (num10 != 0) + { + num10 -= num17; + num14 += num17; + if (num10 == 0) + rectangle.Y = 0; + Microsoft.Xna.Framework.Color color3 = new Microsoft.Xna.Framework.Color(r, g, b, a) * num15 * num4; + Main.spriteBatch.Draw(texture, Main.ReverseGravitySupport(new Vector2((float) num13, (float) num14) * 16f - Main.screenPosition, 16f), new Microsoft.Xna.Framework.Rectangle?(rectangle), color3, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } } + Utils.DrawBorderString(Main.spriteBatch, num11.ToString() + "x" + num12.ToString(), new Vector2((float) (Main.mouseX + 16), (float) Main.mouseY), new Microsoft.Xna.Framework.Color(r, g, b, a), anchory: 0.8f); } private static void DrawInterface_3_LaserRuler() @@ -33046,7 +33697,7 @@ label_56: Main.player[Main.myPlayer].velocity.Length(); float num1 = Vector2.Distance(Main.player[Main.myPlayer].position, Main.player[Main.myPlayer].shadowPos[2]); float num2 = 6f; - Texture2D texture = TextureAssets.Extra[68].Value; + Texture2D texture = Main.extraTexture[68]; float num3 = MathHelper.Lerp(0.2f, 0.7f, MathHelper.Clamp((float) (1.0 - (double) num1 / (double) num2), 0.0f, 1f)); Vector2 vector2_1 = (Main.screenPosition + new Vector2(-50f)).ToTileCoordinates().ToVector2() * 16f; int num4 = (Main.screenWidth + 100) / 16; @@ -33110,7 +33761,7 @@ label_56: private static void DrawInterface_2_SmartCursorTargets() => Main.DrawSmartCursor(); - private static void DrawInterface_1_1_DrawEmoteBubblesInWorld() + private static void DrawInterface_1_EmoteBubbles() { Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Deferred, (BlendState) null, SamplerState.PointClamp, (DepthStencilState) null, (RasterizerState) null, (Effect) null, Main.GameViewMatrix.ZoomMatrix); @@ -33120,39 +33771,6 @@ label_56: Main.instance.currentNPCShowingChatBubble = -1; } - private static void DrawInterface_1_2_DrawEntityMarkersInWorld() - { - Player localPlayer = Main.LocalPlayer; - if ((localPlayer.dead ? 0 : (localPlayer.HeldItem.summon ? 1 : 0)) == 0) - return; - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, (BlendState) null, SamplerState.PointClamp, (DepthStencilState) null, (RasterizerState) null, (Effect) null, Main.GameViewMatrix.ZoomMatrix); - Texture2D texture2D = TextureAssets.Extra[199].Value; - Vector2 zero = Vector2.Zero; - int minionAttackTargetNpc = localPlayer.MinionAttackTargetNPC; - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle((int) Main.screenPosition.X, (int) Main.screenPosition.Y, Main.screenWidth, Main.screenHeight); - for (int index = 0; index < 200; ++index) - { - NPC npc = Main.npc[index]; - if (npc.active && npc.Hitbox.Intersects(rectangle)) - { - Vector2 vector2 = npc.Center - Main.screenPosition; - if ((double) Main.player[Main.myPlayer].gravDir == -1.0) - vector2.Y = (float) Main.screenHeight - vector2.Y; - Vector2 position = vector2 + zero; - if (index == minionAttackTargetNpc) - { - int frameY = (int) ((double) Main.GlobalTimeWrappedHourly * 10.0) % 4; - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: 4, frameY: frameY, sizeOffsetY: -2); - Vector2 origin = r.Size() / 2f; - Microsoft.Xna.Framework.Color color = Microsoft.Xna.Framework.Color.White * 0.7f; - color.A /= (byte) 2; - Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(r), color, 0.0f, origin, 1f, SpriteEffects.None, 0.0f); - } - } - } - } - private static void MouseOversTryToClear() { if (!Main._MouseOversCanClear) @@ -33163,9 +33781,9 @@ label_56: private static void MouseOversClear() { - Main.player[Main.myPlayer].cursorItemIconEnabled = false; - Main.player[Main.myPlayer].cursorItemIconID = 0; - Main.player[Main.myPlayer].cursorItemIconText = string.Empty; + Main.player[Main.myPlayer].showItemIcon = false; + Main.player[Main.myPlayer].showItemIcon2 = 0; + Main.player[Main.myPlayer].showItemIconText = string.Empty; Main.signHover = -1; } @@ -33200,7 +33818,7 @@ label_56: for (int index1 = 0; index1 < 5; ++index1) { float num = 10f; - Vector2 position = new Vector2((float) ((double) Main.screenWidth / (double) num * ((double) Main.GlobalTimeWrappedHourly % (double) num)), -100f); + Vector2 position = new Vector2((float) ((double) Main.screenWidth / (double) num * ((double) Main.GlobalTime % (double) num)), -100f); position.X += (float) (14 * index1); position.Y += (float) (index1 % 2 * 14); int index2 = 30 * index1; @@ -33209,45 +33827,13 @@ label_56: if (++index2 >= intList.Count) index2 = 0; position.Y += 26f; - Main.instance.LoadItem(intList[index2]); - Texture2D texture2D = TextureAssets.Item[intList[index2]].Value; + Texture2D texture2D = Main.itemTexture[intList[index2]]; Microsoft.Xna.Framework.Point tileCoordinates = (position + Main.screenPosition).ToTileCoordinates(); Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(), Lighting.GetColor(tileCoordinates.X, tileCoordinates.Y), 0.7853982f, texture2D.Size() / 2f, 1f, SpriteEffects.None, 0.0f); } } } - public static void DrawWallOfStars() - { - bool flag = true; - if (flag) - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.Transform); - int i = Projectile.NewProjectile(Vector2.Zero, Vector2.UnitX, 12, 0, 0.0f, Main.myPlayer); - Projectile projectile = Main.projectile[i]; - for (int index = 0; index < 5; ++index) - { - float num = 10f; - Vector2 vector2 = new Vector2((float) ((double) Main.screenWidth / (double) num * ((double) Main.GlobalTimeWrappedHourly % (double) num)), -100f); - vector2.X += (float) (14 * index); - vector2.Y += (float) (index % 2 * 14); - while ((double) vector2.Y < (double) (Main.screenHeight + 100)) - { - vector2.Y += 26f; - projectile.position = Vector2.One * 10f; - projectile.velocity = Vector2.UnitX * 10f; - projectile.rotation = Main.GlobalTimeWrappedHourly * 6.283185f; - projectile.Update(i); - projectile.position = vector2 + Main.screenPosition; - Main.instance.DrawProj(i); - } - } - projectile.position = Vector2.One * 10f; - projectile.Kill(); - if (!flag) - return; - Main.spriteBatch.End(); - } - private static void DrawSmartCursor() { if (!Main.SmartCursorShowing || Main.player[Main.myPlayer].dead) @@ -33265,23 +33851,23 @@ label_56: float B1 = 0.1f; float A1 = 1f; float num2 = 0.6f; - Main.spriteBatch.Draw(TextureAssets.MagicPixel.Value, position, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R, G1, B1, A1) * num2, 0.0f, Vector2.Zero, 8f, SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(TextureAssets.MagicPixel.Value, position + Vector2.UnitX * 8f, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R, G1, B1, A1) * num2, 0.0f, Vector2.Zero, 8f, SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(TextureAssets.MagicPixel.Value, position + Vector2.UnitY * 8f, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R, G1, B1, A1) * num2, 0.0f, Vector2.Zero, 8f, SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(TextureAssets.MagicPixel.Value, position + Vector2.One * 8f, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R, G1, B1, A1) * num2, 0.0f, Vector2.Zero, 8f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.magicPixel, position, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R, G1, B1, A1) * num2, 0.0f, Vector2.Zero, 8f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.magicPixel, position + Vector2.UnitX * 8f, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R, G1, B1, A1) * num2, 0.0f, Vector2.Zero, 8f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.magicPixel, position + Vector2.UnitY * 8f, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R, G1, B1, A1) * num2, 0.0f, Vector2.Zero, 8f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.magicPixel, position + Vector2.One * 8f, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R, G1, B1, A1) * num2, 0.0f, Vector2.Zero, 8f, SpriteEffects.None, 0.0f); float B2 = 0.3f; float G2 = 0.95f; float num3; float A2 = num3 = 1f; - Main.spriteBatch.Draw(TextureAssets.MagicPixel.Value, position + Vector2.UnitX * -2f, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R, G2, B2, A2) * num3, 0.0f, Vector2.Zero, new Vector2(2f, 16f), SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(TextureAssets.MagicPixel.Value, position + Vector2.UnitX * 16f, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R, G2, B2, A2) * num3, 0.0f, Vector2.Zero, new Vector2(2f, 16f), SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(TextureAssets.MagicPixel.Value, position + Vector2.UnitY * -2f, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R, G2, B2, A2) * num3, 0.0f, Vector2.Zero, new Vector2(16f, 2f), SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(TextureAssets.MagicPixel.Value, position + Vector2.UnitY * 16f, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R, G2, B2, A2) * num3, 0.0f, Vector2.Zero, new Vector2(16f, 2f), SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.magicPixel, position + Vector2.UnitX * -2f, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R, G2, B2, A2) * num3, 0.0f, Vector2.Zero, new Vector2(2f, 16f), SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.magicPixel, position + Vector2.UnitX * 16f, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R, G2, B2, A2) * num3, 0.0f, Vector2.Zero, new Vector2(2f, 16f), SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.magicPixel, position + Vector2.UnitY * -2f, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R, G2, B2, A2) * num3, 0.0f, Vector2.Zero, new Vector2(16f, 2f), SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.magicPixel, position + Vector2.UnitY * 16f, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R, G2, B2, A2) * num3, 0.0f, Vector2.Zero, new Vector2(16f, 2f), SpriteEffects.None, 0.0f); } private static void DrawSmartInteract() { - if (!Main.SmartInteractShowingGenuine || Main.SmartInteractNPC != -1 || Main.SmartInteractProj != -1 || Main.player[Main.myPlayer].dead) + if (!Main.SmartInteractShowingGenuine || Main.SmartInteractNPC != -1 || Main.player[Main.myPlayer].dead) return; Vector2 vector2_1 = new Vector2((float) Main.SmartInteractX, (float) Main.SmartInteractY) * 16f; Vector2 vector2_2 = new Vector2((float) Main.offScreenRange, (float) Main.offScreenRange); @@ -33296,33 +33882,35 @@ label_56: float B = 1f; float A1 = 1f; float num2 = 0.6f; - Main.spriteBatch.Draw(TextureAssets.MagicPixel.Value, position, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R1, G1, B, A1) * num2, 0.0f, Vector2.Zero, 8f, SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(TextureAssets.MagicPixel.Value, position + Vector2.UnitX * 8f, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R1, G1, B, A1) * num2, 0.0f, Vector2.Zero, 8f, SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(TextureAssets.MagicPixel.Value, position + Vector2.UnitY * 8f, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R1, G1, B, A1) * num2, 0.0f, Vector2.Zero, 8f, SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(TextureAssets.MagicPixel.Value, position + Vector2.One * 8f, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R1, G1, B, A1) * num2, 0.0f, Vector2.Zero, 8f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.magicPixel, position, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R1, G1, B, A1) * num2, 0.0f, Vector2.Zero, 8f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.magicPixel, position + Vector2.UnitX * 8f, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R1, G1, B, A1) * num2, 0.0f, Vector2.Zero, 8f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.magicPixel, position + Vector2.UnitY * 8f, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R1, G1, B, A1) * num2, 0.0f, Vector2.Zero, 8f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.magicPixel, position + Vector2.One * 8f, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R1, G1, B, A1) * num2, 0.0f, Vector2.Zero, 8f, SpriteEffects.None, 0.0f); float R2 = 0.3f; float G2 = 0.95f; float num3; float A2 = num3 = 1f; - Main.spriteBatch.Draw(TextureAssets.MagicPixel.Value, position + Vector2.UnitX * -2f, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R2, G2, B, A2) * num3, 0.0f, Vector2.Zero, new Vector2(2f, 16f), SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(TextureAssets.MagicPixel.Value, position + Vector2.UnitX * 16f, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R2, G2, B, A2) * num3, 0.0f, Vector2.Zero, new Vector2(2f, 16f), SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(TextureAssets.MagicPixel.Value, position + Vector2.UnitY * -2f, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R2, G2, B, A2) * num3, 0.0f, Vector2.Zero, new Vector2(16f, 2f), SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(TextureAssets.MagicPixel.Value, position + Vector2.UnitY * 16f, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R2, G2, B, A2) * num3, 0.0f, Vector2.Zero, new Vector2(16f, 2f), SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.magicPixel, position + Vector2.UnitX * -2f, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R2, G2, B, A2) * num3, 0.0f, Vector2.Zero, new Vector2(2f, 16f), SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.magicPixel, position + Vector2.UnitX * 16f, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R2, G2, B, A2) * num3, 0.0f, Vector2.Zero, new Vector2(2f, 16f), SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.magicPixel, position + Vector2.UnitY * -2f, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R2, G2, B, A2) * num3, 0.0f, Vector2.Zero, new Vector2(16f, 2f), SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.magicPixel, position + Vector2.UnitY * 16f, new Microsoft.Xna.Framework.Rectangle?(rectangle), Main.buffColor(newColor, R2, G2, B, A2) * num3, 0.0f, Vector2.Zero, new Vector2(16f, 2f), SpriteEffects.None, 0.0f); } private void DrawInterface_30_Hotbar() { - try + if (Main.ignoreErrors) { - this.GUIHotbarDrawInner(); - } - catch (Exception ex) - { - if (Main.ignoreErrors) + try + { + this.GUIHotbarDrawInner(); + } + catch (Exception ex) + { TimeLogger.DrawException(ex); - else - throw; + } } + else + this.GUIHotbarDrawInner(); } public void GUIChatDraw() @@ -33348,40 +33936,11 @@ label_56: } } - public static bool ShouldDrawInfoIconsHorizontally => !Main._cannotDrawAccessoriesHorizontally && (Main.mapStyle != 1 || !Main.mapEnabled || Main.screenHeight >= 820) && (Main.mapStyle == 1 || Main.screenWidth >= 855) && !PlayerInput.UsingGamepad; - - public static bool CanShowInfoAccs => (Main.npcChatText == null || Main.npcChatText == "" || Main.player[Main.myPlayer].chest > -1) && Main.player[Main.myPlayer].sign < 0; - - public static void DrawItemIcon( - SpriteBatch spriteBatch, - Item theItem, - Vector2 screenPositionForItemCenter, - Microsoft.Xna.Framework.Color itemLightColor, - float sizeLimit) - { - Main.instance.LoadItem(theItem.type); - Texture2D texture2D = TextureAssets.Item[theItem.type].Value; - Microsoft.Xna.Framework.Rectangle rectangle = Main.itemAnimations[theItem.type] == null ? texture2D.Frame() : Main.itemAnimations[theItem.type].GetFrame(texture2D); - int width = rectangle.Width; - int height = rectangle.Height; - float num1 = 1f; - if ((double) width > (double) sizeLimit || (double) height > (double) sizeLimit) - num1 = width <= height ? sizeLimit / (float) height : sizeLimit / (float) width; - float num2 = num1 * theItem.scale; - SpriteEffects effects = SpriteEffects.None; - Microsoft.Xna.Framework.Color currentColor = itemLightColor; - float scale1 = 1f; - ItemSlot.GetItemLight(ref currentColor, ref scale1, theItem); - float scale2 = num2 * scale1; - spriteBatch.Draw(texture2D, screenPositionForItemCenter, new Microsoft.Xna.Framework.Rectangle?(rectangle), currentColor, 0.0f, new Vector2((float) (width / 2), (float) (height / 2)), scale2, effects, 0.0f); - if (!(theItem.color != new Microsoft.Xna.Framework.Color())) - return; - spriteBatch.Draw(texture2D, screenPositionForItemCenter, new Microsoft.Xna.Framework.Rectangle?(rectangle), theItem.GetColor(itemLightColor), 0.0f, new Vector2((float) (width / 2), (float) (height / 2)), scale2, effects, 0.0f); - } + public static bool ShouldDrawInfoIconsHorizontally => (Main.mapStyle != 1 || !Main.mapEnabled || Main.screenHeight >= 820) && (Main.mapStyle == 1 || Main.screenWidth >= 855) && !PlayerInput.UsingGamepad; private void DrawInfoAccs() { - if (!Main.CanShowInfoAccs) + if (Main.npcChatText != null && !(Main.npcChatText == "") || Main.player[Main.myPlayer].sign >= 0) return; bool flag1 = false; bool flag2 = false; @@ -33397,14 +33956,14 @@ label_56: bool flag12 = false; int index1 = -1; int num1 = -10; - int drawnCount = 0; + int num2 = 0; string cursorText = ""; - float num2 = 215f; - int StartX = 0; - if (GameCulture.FromCultureName(GameCulture.CultureName.Russian).IsActive) + float num3 = 215f; + int num4 = 0; + if (GameCulture.Russian.IsActive) { - StartX = -50; - num2 += 50f; + num4 = -50; + num3 += 50f; } for (int index2 = 0; index2 < 12; ++index2) { @@ -33414,41 +33973,41 @@ label_56: { index1 = 0; str2 = Lang.inter[95].Value; - string textValue = Language.GetTextValue("GameUI.TimeAtMorning"); + string str3 = "AM"; double time = Main.time; if (!Main.dayTime) time += 54000.0; - double num3 = time / 86400.0 * 24.0 - 7.5 - 12.0; - if (num3 < 0.0) - num3 += 24.0; - if (num3 >= 12.0) - textValue = Language.GetTextValue("GameUI.TimePastMorning"); - int num4 = (int) num3; - double num5 = (double) (int) ((num3 - (double) num4) * 60.0); - string str3 = string.Concat((object) num5); - if (num5 < 10.0) - str3 = "0" + str3; - if (num4 > 12) - num4 -= 12; - if (num4 == 0) - num4 = 12; + double num5 = time / 86400.0 * 24.0 - 7.5 - 12.0; + if (num5 < 0.0) + num5 += 24.0; + if (num5 >= 12.0) + str3 = "PM"; + int num6 = (int) num5; + double num7 = (double) (int) ((num5 - (double) num6) * 60.0); + string str4 = string.Concat((object) num7); + if (num7 < 10.0) + str4 = "0" + str4; + if (num6 > 12) + num6 -= 12; + if (num6 == 0) + num6 = 12; if (Main.player[Main.myPlayer].accWatch == 1) - str3 = "00"; + str4 = "00"; else if (Main.player[Main.myPlayer].accWatch == 2) - str3 = num5 >= 30.0 ? "30" : "00"; - str1 = num4.ToString() + ":" + str3 + " " + textValue; + str4 = num7 >= 30.0 ? "30" : "00"; + str1 = num6.ToString() + ":" + str4 + " " + str3; flag1 = true; } else if (Main.player[Main.myPlayer].accWeatherRadio && !flag5 && (!Main.player[Main.myPlayer].hideInfo[1] || Main.playerInventory)) { index1 = 1; str2 = Lang.inter[96].Value; - str1 = !Main.IsItStorming ? ((double) Main.maxRaining <= 0.6 ? ((double) Main.maxRaining < 0.2 ? ((double) Main.maxRaining <= 0.0 ? ((double) Main.cloudBGActive <= 0.0 ? (Main.numClouds <= 90 ? (Main.numClouds <= 55 ? (Main.numClouds <= 15 ? Language.GetTextValue("GameUI.Clear") : Language.GetTextValue("GameUI.PartlyCloudy")) : Language.GetTextValue("GameUI.Cloudy")) : Language.GetTextValue("GameUI.MostlyCloudy")) : Language.GetTextValue("GameUI.Overcast")) : Language.GetTextValue("GameUI.LightRain")) : Language.GetTextValue("GameUI.Rain")) : Language.GetTextValue("GameUI.HeavyRain")) : Language.GetTextValue("GameUI.Storm"); - int num6 = (int) ((double) Main.windSpeedCurrent * 50.0); - if (num6 < 0) - str1 += Language.GetTextValue("GameUI.EastWind", (object) Math.Abs(num6)); - else if (num6 > 0) - str1 += Language.GetTextValue("GameUI.WestWind", (object) num6); + str1 = (double) Main.maxRaining <= 0.6 ? ((double) Main.maxRaining < 0.2 ? ((double) Main.maxRaining <= 0.0 ? ((double) Main.cloudBGActive <= 0.0 ? (Main.numClouds <= 120 ? (Main.numClouds <= 80 ? (Main.numClouds <= 20 ? Language.GetTextValue("GameUI.Clear") : Language.GetTextValue("GameUI.PartlyCloudy")) : Language.GetTextValue("GameUI.Cloudy")) : Language.GetTextValue("GameUI.MostlyCloudy")) : Language.GetTextValue("GameUI.Overcast")) : Language.GetTextValue("GameUI.LightRain")) : Language.GetTextValue("GameUI.Rain")) : Language.GetTextValue("GameUI.HeavyRain"); + int num8 = (int) ((double) Main.windSpeed * 100.0); + if (num8 < 0) + str1 += Language.GetTextValue("GameUI.WestWind", (object) Math.Abs(num8)); + else if (num8 > 0) + str1 += Language.GetTextValue("GameUI.EastWind", (object) num8); flag5 = true; } else if (Main.player[Main.myPlayer].accCalendar && !flag8 && (!Main.player[Main.myPlayer].hideInfo[7] || Main.playerInventory)) @@ -33503,8 +34062,8 @@ label_56: } else { - PlayerFishingConditions fishingConditions = Main.player[Main.myPlayer].GetFishingConditions(); - str1 = fishingConditions.BaitItemType != 2673 ? (Main.player[Main.myPlayer].displayedFishingInfo = Language.GetTextValue("GameUI.FishingPower", (object) fishingConditions.FinalFishingLevel)) : Language.GetTextValue("GameUI.FishingWarning"); + int num9 = Main.player[Main.myPlayer].FishingLevel(); + str1 = num9 != -1 ? (Main.player[Main.myPlayer].displayedFishingInfo = Language.GetTextValue("GameUI.FishingPower", (object) num9)) : Language.GetTextValue("GameUI.FishingWarning"); } flag4 = true; } @@ -33512,30 +34071,7 @@ label_56: { index1 = 10; str2 = Lang.inter[104].Value; - if (Main.SceneMetrics.bestOre <= 0) - { - str1 = Language.GetTextValue("GameUI.NoTreasureNearby"); - } - else - { - int baseOption = 0; - int tileType = Main.SceneMetrics.bestOre; - Microsoft.Xna.Framework.Point? closestOrePosition = Main.SceneMetrics.ClosestOrePosition; - if (closestOrePosition.HasValue) - { - closestOrePosition = Main.SceneMetrics.ClosestOrePosition; - Microsoft.Xna.Framework.Point pt = closestOrePosition.Value; - Tile tileSafely = Framing.GetTileSafely(pt); - if (tileSafely.active()) - { - MapHelper.GetTileBaseOption(pt.Y, tileSafely, ref baseOption); - tileType = (int) tileSafely.type; - if (TileID.Sets.BasicChest[tileType] || TileID.Sets.BasicChestFake[tileType]) - baseOption = 0; - } - } - str1 = Language.GetTextValue("GameUI.OreDetected", (object) Lang.GetMapObjectName(MapHelper.TileToLookup(tileType, baseOption))); - } + str1 = Main.player[Main.myPlayer].bestOre > 0 ? Language.GetTextValue("GameUI.OreDetected", (object) Lang.GetMapObjectName(MapHelper.TileToLookup(Main.player[Main.myPlayer].bestOre, 0))) : Language.GetTextValue("GameUI.NoTreasureNearby"); flag10 = true; } else if (Main.player[Main.myPlayer].accCritterGuide && !flag11 && (!Main.player[Main.myPlayer].hideInfo[11] || Main.playerInventory)) @@ -33543,18 +34079,19 @@ label_56: flag11 = true; index1 = 11; str2 = Lang.inter[105].Value; - int num7 = 1300; - int num8 = 0; + int num10 = 1300; + int num11 = 0; int index4 = -1; if (Main.player[Main.myPlayer].accCritterGuideCounter <= (byte) 0) { Main.player[Main.myPlayer].accCritterGuideCounter = (byte) 15; for (int index5 = 0; index5 < 200; ++index5) { - if (Main.npc[index5].active && Main.npc[index5].rarity > num8 && (double) (Main.npc[index5].Center - Main.player[Main.myPlayer].Center).Length() < (double) num7) + if (Main.npc[index5].active && Main.npc[index5].rarity > num11) { - index4 = index5; - num8 = Main.npc[index5].rarity; + num11 = Main.npc[index5].rarity; + if ((double) (Main.npc[index5].Center - Main.player[Main.myPlayer].Center).Length() < (double) num10) + index4 = index5; } } Main.player[Main.myPlayer].accCritterGuideNumber = (byte) index4; @@ -33571,15 +34108,19 @@ label_56: flag6 = true; index1 = 5; str2 = Lang.inter[100].Value; - int num9 = 2000; + int num12 = 2000; if (Main.player[Main.myPlayer].accThirdEyeCounter == (byte) 0) { Main.player[Main.myPlayer].accThirdEyeNumber = (byte) 0; Main.player[Main.myPlayer].accThirdEyeCounter = (byte) 15; for (int index6 = 0; index6 < 200; ++index6) { - if (Main.npc[index6].active && !Main.npc[index6].friendly && Main.npc[index6].damage > 0 && Main.npc[index6].lifeMax > 5 && !Main.npc[index6].dontCountMe && (double) (Main.npc[index6].Center - Main.player[Main.myPlayer].Center).Length() < (double) num9) - ++Main.player[Main.myPlayer].accThirdEyeNumber; + if (Main.npc[index6].active && !Main.npc[index6].friendly && Main.npc[index6].damage > 0 && Main.npc[index6].lifeMax > 5 && !Main.npc[index6].dontCountMe) + { + int type = Main.npc[index6].type; + if ((double) (Main.npc[index6].Center - Main.player[Main.myPlayer].Center).Length() < (double) num12) + ++Main.player[Main.myPlayer].accThirdEyeNumber; + } } } else @@ -33607,71 +34148,93 @@ label_56: { index1 = 9; str2 = Lang.inter[103].Value; - Vector2 vector2 = Main.player[Main.myPlayer].velocity + Main.player[Main.myPlayer].instantMovementAccumulatedThisFrame; - if (Main.player[Main.myPlayer].mount.Active && Main.player[Main.myPlayer].mount.IsConsideredASlimeMount && (double) Main.player[Main.myPlayer].velocity.Y != 0.0 && !Main.player[Main.myPlayer].SlimeDontHyperJump) - vector2.Y += Main.player[Main.myPlayer].velocity.Y; - int num10 = (int) (1.0 + (double) vector2.Length() * 6.0); - if (num10 > Main.player[Main.myPlayer].speedSlice.Length) - num10 = Main.player[Main.myPlayer].speedSlice.Length; - float num11 = 0.0f; - for (int index7 = num10 - 1; index7 > 0; --index7) + int num13 = (int) (1.0 + (double) Main.player[Main.myPlayer].velocity.Length() * 6.0); + if (num13 > Main.player[Main.myPlayer].speedSlice.Length) + num13 = Main.player[Main.myPlayer].speedSlice.Length; + float num14 = 0.0f; + for (int index7 = num13 - 1; index7 > 0; --index7) Main.player[Main.myPlayer].speedSlice[index7] = Main.player[Main.myPlayer].speedSlice[index7 - 1]; - Main.player[Main.myPlayer].speedSlice[0] = vector2.Length(); + Main.player[Main.myPlayer].speedSlice[0] = Main.player[Main.myPlayer].velocity.Length(); for (int index8 = 0; index8 < Main.player[Main.myPlayer].speedSlice.Length; ++index8) { - if (index8 < num10) - num11 += Main.player[Main.myPlayer].speedSlice[index8]; + if (index8 < num13) + num14 += Main.player[Main.myPlayer].speedSlice[index8]; else - Main.player[Main.myPlayer].speedSlice[index8] = num11 / (float) num10; + Main.player[Main.myPlayer].speedSlice[index8] = num14 / (float) num13; } - float num12 = num11 / (float) num10; - int num13 = 42240; - int num14 = 216000; - float num15 = num12 * (float) num14 / (float) num13; + float num15 = num14 / (float) num13; + int num16 = 42240; + int num17 = 216000; + float num18 = num15 * (float) num17 / (float) num16; if (!Main.player[Main.myPlayer].merman && !Main.player[Main.myPlayer].ignoreWater) { if (Main.player[Main.myPlayer].honeyWet) - num15 /= 4f; + num18 /= 4f; else if (Main.player[Main.myPlayer].wet) - num15 /= 2f; + num18 /= 2f; } - str1 = Language.GetTextValue("GameUI.Speed", (object) Math.Round((double) num15)); + str1 = Language.GetTextValue("GameUI.Speed", (object) Math.Round((double) num18)); flag9 = true; } else if (Main.player[Main.myPlayer].accCompass > 0 && !flag3 && (!Main.player[Main.myPlayer].hideInfo[3] || Main.playerInventory)) { index1 = 3; str2 = Lang.inter[98].Value; - int num16 = (int) (((double) Main.player[Main.myPlayer].position.X + (double) (Main.player[Main.myPlayer].width / 2)) * 2.0 / 16.0 - (double) Main.maxTilesX); - str1 = num16 <= 0 ? (num16 >= 0 ? Language.GetTextValue("GameUI.CompassCenter") : Language.GetTextValue("GameUI.CompassWest", (object) -num16)) : Language.GetTextValue("GameUI.CompassEast", (object) num16); + int num19 = (int) (((double) Main.player[Main.myPlayer].position.X + (double) (Main.player[Main.myPlayer].width / 2)) * 2.0 / 16.0 - (double) Main.maxTilesX); + str1 = num19 <= 0 ? (num19 >= 0 ? Language.GetTextValue("GameUI.CompassCenter") : Language.GetTextValue("GameUI.CompassWest", (object) -num19)) : Language.GetTextValue("GameUI.CompassEast", (object) num19); flag3 = true; } else if (Main.player[Main.myPlayer].accDepthMeter > 0 && !flag2 && (!Main.player[Main.myPlayer].hideInfo[4] || Main.playerInventory)) { index1 = 4; str2 = Lang.inter[99].Value; - int num17 = (int) (((double) Main.player[Main.myPlayer].position.Y + (double) Main.player[Main.myPlayer].height) * 2.0 / 16.0 - Main.worldSurface * 2.0); - float num18 = (float) (Main.maxTilesX / 4200); - float num19 = num18 * num18; - int num20 = 1200; - float num21 = (float) (((double) Main.player[Main.myPlayer].Center.Y / 16.0 - (65.0 + 10.0 * (double) num19)) / (Main.worldSurface / 5.0)); - string str4 = (double) Main.player[Main.myPlayer].position.Y <= (double) ((Main.maxTilesY - 204) * 16) ? ((double) Main.player[Main.myPlayer].position.Y <= Main.rockLayer * 16.0 + (double) (num20 / 2) + 16.0 ? (num17 <= 0 ? ((double) num21 < 1.0 ? Language.GetTextValue("GameUI.LayerSpace") : Language.GetTextValue("GameUI.LayerSurface")) : Language.GetTextValue("GameUI.LayerUnderground")) : Language.GetTextValue("GameUI.LayerCaverns")) : Language.GetTextValue("GameUI.LayerUnderworld"); - int num22 = Math.Abs(num17); - str1 = (num22 != 0 ? Language.GetTextValue("GameUI.Depth", (object) num22) : Language.GetTextValue("GameUI.DepthLevel")) + " " + str4; + int num20 = (int) (((double) Main.player[Main.myPlayer].position.Y + (double) Main.player[Main.myPlayer].height) * 2.0 / 16.0 - Main.worldSurface * 2.0); + float num21 = (float) (Main.maxTilesX / 4200); + float num22 = num21 * num21; + int num23 = 1200; + float num24 = (float) ((((double) Main.screenPosition.Y + (double) (Main.screenHeight / 2)) / 16.0 - (65.0 + 10.0 * (double) num22)) / (Main.worldSurface / 5.0)); + string str5 = (double) Main.player[Main.myPlayer].position.Y <= (double) ((Main.maxTilesY - 204) * 16) ? ((double) Main.player[Main.myPlayer].position.Y <= Main.rockLayer * 16.0 + (double) (num23 / 2) + 16.0 ? (num20 <= 0 ? ((double) num24 < 1.0 ? Language.GetTextValue("GameUI.LayerSpace") : Language.GetTextValue("GameUI.LayerSurface")) : Language.GetTextValue("GameUI.LayerUnderground")) : Language.GetTextValue("GameUI.LayerCaverns")) : Language.GetTextValue("GameUI.LayerUnderworld"); + int num25 = Math.Abs(num20); + str1 = (num25 != 0 ? Language.GetTextValue("GameUI.Depth", (object) num25) : Language.GetTextValue("GameUI.DepthLevel")) + " " + str5; flag2 = true; } if (str1 != "") { - int X; - int Y; - Main.GetInfoAccIconPosition(drawnCount, StartX, out X, out Y); + int num26; + int num27; + if (!Main.playerInventory) + { + num26 = Main.screenWidth - 280; + num27 = -32; + if (Main.mapStyle == 1 && Main.mapEnabled) + num27 += 254; + } + else if (Main.ShouldDrawInfoIconsHorizontally) + { + num26 = Main.screenWidth - 280 + 20 * num2 - 10; + num27 = 94; + if (Main.mapStyle == 1 && Main.mapEnabled) + num27 += 254; + } + else + { + int num28 = (int) (52.0 * (double) Main.inventoryScale); + num26 = 697 - num28 * 4 + Main.screenWidth - 800 + 20 * (num2 % 2); + num27 = 114 + Main.mH + num28 * 7 + num28 / 2 + 20 * (num2 / 2) + 8 * (num2 / 4) - 20; + if (Main.EquipPage == 2) + { + num26 += num28 + num28 / 2; + num27 -= num28; + } + } + int num29 = num26 + num4; if (index1 >= 0) { - ++drawnCount; - int num23 = 22; + ++num2; + int num30 = 22; if (Main.screenHeight < 650) - num23 = 20; - Vector2 position = new Vector2((float) X, (float) (Y + 74 + num23 * index2 + 52)); + num30 = 20; + Vector2 position = new Vector2((float) num29, (float) (num27 + 74 + num30 * index2 + 52)); int index9 = index1; if (index9 == 8) index9 = 7; @@ -33679,14 +34242,14 @@ label_56: bool flag14 = false; if (Main.playerInventory) { - position = new Vector2((float) X, (float) Y); - if ((double) Main.mouseX >= (double) position.X && (double) Main.mouseY >= (double) position.Y && (double) Main.mouseX <= (double) position.X + (double) TextureAssets.InfoIcon[index1].Width() && (double) Main.mouseY <= (double) position.Y + (double) TextureAssets.InfoIcon[index1].Height() && !PlayerInput.IgnoreMouseInterface) + position = new Vector2((float) num29, (float) num27); + if ((double) Main.mouseX >= (double) position.X && (double) Main.mouseY >= (double) position.Y && (double) Main.mouseX <= (double) position.X + (double) this.infoIconTexture[index1].Width && (double) Main.mouseY <= (double) position.Y + (double) this.infoIconTexture[index1].Height && !PlayerInput.IgnoreMouseInterface) { flag14 = true; Main.player[Main.myPlayer].mouseInterface = true; if (Main.mouseLeft && Main.mouseLeftRelease) { - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.mouseLeftRelease = false; Main.player[Main.myPlayer].hideInfo[index9] = !Main.player[Main.myPlayer].hideInfo[index9]; } @@ -33699,48 +34262,48 @@ label_56: if (Main.player[Main.myPlayer].hideInfo[index9]) color = new Microsoft.Xna.Framework.Color(80, 80, 80, 70); } - else if ((double) Main.mouseX >= (double) position.X && (double) Main.mouseY >= (double) position.Y && (double) Main.mouseX <= (double) position.X + (double) TextureAssets.InfoIcon[index1].Width() && (double) Main.mouseY <= (double) position.Y + (double) TextureAssets.InfoIcon[index1].Height() && !Main.mouseText) + else if ((double) Main.mouseX >= (double) position.X && (double) Main.mouseY >= (double) position.Y && (double) Main.mouseX <= (double) position.X + (double) this.infoIconTexture[index1].Width && (double) Main.mouseY <= (double) position.Y + (double) this.infoIconTexture[index1].Height && !Main.mouseText) { num1 = index2; cursorText = str2; Main.mouseText = true; } - UILinkPointNavigator.SetPosition(1558 + drawnCount - 1, position + TextureAssets.InfoIcon[index1].Value.Size() * 0.75f); - Main.spriteBatch.Draw(TextureAssets.InfoIcon[index1].Value, position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.InfoIcon[index1].Width(), TextureAssets.InfoIcon[index1].Height())), color, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + UILinkPointNavigator.SetPosition(1558 + num2 - 1, position + this.infoIconTexture[index1].Size() * 0.75f); + Main.spriteBatch.Draw(this.infoIconTexture[index1], position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, this.infoIconTexture[index1].Width, this.infoIconTexture[index1].Height)), color, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); if (flag14) - Main.spriteBatch.Draw(TextureAssets.InfoIcon[13].Value, position - Vector2.One * 2f, new Microsoft.Xna.Framework.Rectangle?(), Main.OurFavoriteColor, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - X += 20; + Main.spriteBatch.Draw(this.infoIconTexture[13], position - Vector2.One * 2f, new Microsoft.Xna.Framework.Rectangle?(), Main.OurFavoriteColor, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + num29 += 20; } - UILinkPointNavigator.Shortcuts.INFOACCCOUNT = drawnCount; + UILinkPointNavigator.Shortcuts.INFOACCCOUNT = num2; if (!Main.playerInventory) { Vector2 vector2_1 = new Vector2(1f); - Vector2 vector2_2 = FontAssets.MouseText.Value.MeasureString(str1); - if ((double) vector2_2.X > (double) num2) - vector2_1.X = num2 / vector2_2.X; + Vector2 vector2_2 = Main.fontMouseText.MeasureString(str1); + if ((double) vector2_2.X > (double) num3) + vector2_1.X = num3 / vector2_2.X; if ((double) vector2_1.X < 0.579999983310699) vector2_1.Y = (float) (1.0 - (double) vector2_1.X / 3.0); for (int index10 = 0; index10 < 5; ++index10) { - int num24 = 0; - int num25 = 0; + int num31 = 0; + int num32 = 0; Microsoft.Xna.Framework.Color color = Microsoft.Xna.Framework.Color.Black; if (index10 == 0) - num24 = -2; + num31 = -2; if (index10 == 1) - num24 = 2; + num31 = 2; if (index10 == 2) - num25 = -2; + num32 = -2; if (index10 == 3) - num25 = 2; + num32 = 2; if (index10 == 4) color = new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor); if (index2 > num1 && index2 < num1 + 2) color = new Microsoft.Xna.Framework.Color((int) color.R / 3, (int) color.G / 3, (int) color.B / 3, (int) color.A / 3); - int num26 = 22; + int num33 = 22; if (Main.screenHeight < 650) - num26 = 20; - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, str1, new Vector2((float) (X + num24), (float) (Y + 74 + num26 * index2 + num25 + 48)), color, 0.0f, new Vector2(), vector2_1, SpriteEffects.None, 0.0f); + num33 = 20; + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str1, new Vector2((float) (num29 + num31), (float) (num27 + 74 + num33 * index2 + num32 + 48)), color, 0.0f, new Vector2(), vector2_1, SpriteEffects.None, 0.0f); } } } @@ -33752,54 +34315,15 @@ label_56: this.MouseText(cursorText); } - private static void GetInfoAccIconPosition(int drawnCount, int StartX, out int X, out int Y) - { - if (!Main.playerInventory) - { - X = Main.screenWidth - 280; - Y = -32; - if (Main.mapStyle == 1 && Main.mapEnabled) - Y += 261; - } - else if (Main.ShouldDrawInfoIconsHorizontally) - { - X = Main.screenWidth - 280 + 20 * drawnCount - 10; - Y = 94; - if (Main.mapStyle == 1 && Main.mapEnabled) - Y += 261; - } - else - { - int num = (int) (52.0 * (double) Main.inventoryScale); - X = 697 - num * 4 + Main.screenWidth - 800 + 20 * (drawnCount % 2); - Y = 114 + Main.mH + num * 7 + num / 2 + 20 * (drawnCount / 2) + 8 * (drawnCount / 4) - 20; - if (Main.EquipPage == 2) - { - X += num + num / 2; - Y -= num; - } - } - X += StartX; - } - private void DrawBuilderAccToggles(Vector2 start) { - if (!Main.playerInventory) - return; - string.IsNullOrEmpty(Main.npcChatText); - if (Main.player[Main.myPlayer].sign >= 0) + if (!Main.playerInventory && !string.IsNullOrEmpty(Main.npcChatText) || Main.player[Main.myPlayer].sign >= 0) return; int num1 = 0; - Player plr = Main.player[Main.myPlayer]; + Player player = Main.player[Main.myPlayer]; int[] builderAccStatus = Main.player[Main.myPlayer].builderAccStatus; - int blockReplaceIcons; - int torchGodIcons; - int totalDrawnIcons; - Main.GetBuilderAccsCountToShow(plr, out blockReplaceIcons, out torchGodIcons, out totalDrawnIcons); - start.Y += (float) (24 * torchGodIcons); - bool pushSideToolsUp = totalDrawnIcons >= 10; - int num2 = 10; - for (int index1 = 0; index1 < num2; ++index1) + int num2 = player.InfoAccMechShowWires.ToInt() * 6 + player.rulerLine.ToInt() + player.rulerGrid.ToInt() + player.autoActuator.ToInt() + player.autoPaint.ToInt(); + for (int index1 = 0; index1 < builderAccStatus.Length; ++index1) { int index2 = index1 - 2; switch (index1) @@ -33811,32 +34335,32 @@ label_56: index2 = 9; break; } - Texture2D texture = TextureAssets.BuilderAcc.Value; + Texture2D builderAccTexture = Main.builderAccTexture; Microsoft.Xna.Framework.Rectangle r = new Microsoft.Xna.Framework.Rectangle(0, 16, 14, 14); Microsoft.Xna.Framework.Color color = Microsoft.Xna.Framework.Color.White; Microsoft.Xna.Framework.Color firstColor = new Microsoft.Xna.Framework.Color((int) sbyte.MaxValue, (int) sbyte.MaxValue, (int) sbyte.MaxValue); Vector2 vector2 = start + new Vector2(0.0f, (float) (num1 * 24)); - if (pushSideToolsUp) - vector2.Y -= 24f; + if (num2 > 8) + vector2.Y -= 44f; bool flag1 = Utils.CenteredRectangle(vector2, new Vector2(14f)).Contains(Main.MouseScreen.ToPoint()) && !PlayerInput.IgnoreMouseInterface; bool flag2 = flag1 && Main.mouseLeft && Main.mouseLeftRelease; switch (index2) { case 0: - if (plr.rulerLine) + if (player.rulerLine) { r.X = index2 * 16; color = builderAccStatus[index2] == 0 ? color : firstColor; if (flag1) { - plr.mouseInterface = true; + player.mouseInterface = true; this.MouseText(builderAccStatus[index2] == 0 ? Language.GetTextValue("GameUI.RulerOn") : Language.GetTextValue("GameUI.RulerOff")); Main.mouseText = true; } if (flag2) { builderAccStatus[index2] = builderAccStatus[index2] == 0 ? 1 : 0; - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.mouseLeftRelease = false; break; } @@ -33844,20 +34368,20 @@ label_56: } continue; case 1: - if (plr.rulerGrid) + if (player.rulerGrid) { r.X = index2 * 16; color = builderAccStatus[index2] == 0 ? color : firstColor; if (flag1) { - plr.mouseInterface = true; + player.mouseInterface = true; this.MouseText(builderAccStatus[index2] == 0 ? Language.GetTextValue("GameUI.MechanicalRulerOn") : Language.GetTextValue("GameUI.MechanicalRulerOff")); Main.mouseText = true; } if (flag2) { builderAccStatus[index2] = builderAccStatus[index2] == 0 ? 1 : 0; - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.mouseLeftRelease = false; break; } @@ -33865,20 +34389,20 @@ label_56: } continue; case 2: - if (plr.autoActuator) + if (player.autoActuator) { r.X = index2 * 16; color = builderAccStatus[index2] == 0 ? color : firstColor; if (flag1) { - plr.mouseInterface = true; + player.mouseInterface = true; this.MouseText(builderAccStatus[index2] == 0 ? Language.GetTextValue("GameUI.ActuationDeviceOn") : Language.GetTextValue("GameUI.ActuationDeviceOff")); Main.mouseText = true; } if (flag2) { builderAccStatus[index2] = builderAccStatus[index2] == 0 ? 1 : 0; - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.mouseLeftRelease = false; break; } @@ -33886,20 +34410,20 @@ label_56: } continue; case 3: - if (plr.autoPaint) + if (player.autoPaint) { r.X = index2 * 16; color = builderAccStatus[index2] == 0 ? color : firstColor; if (flag1) { - plr.mouseInterface = true; + player.mouseInterface = true; this.MouseText(builderAccStatus[index2] == 0 ? Language.GetTextValue("GameUI.PaintSprayerOn") : Language.GetTextValue("GameUI.PaintSprayerOff")); Main.mouseText = true; } if (flag2) { builderAccStatus[index2] = builderAccStatus[index2] == 0 ? 1 : 0; - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.mouseLeftRelease = false; break; } @@ -33911,13 +34435,13 @@ label_56: case 6: case 7: case 9: - if (plr.InfoAccMechShowWires) + if (player.InfoAccMechShowWires) { r.X = index2 * 16; color = builderAccStatus[index2] == 0 ? color : (builderAccStatus[index2] == 1 ? firstColor : (builderAccStatus[index2] == 2 ? firstColor.MultiplyRGBA(new Microsoft.Xna.Framework.Color(0.66f, 0.66f, 0.66f, 0.66f)) : firstColor.MultiplyRGBA(new Microsoft.Xna.Framework.Color(0.33f, 0.33f, 0.33f, 0.33f)))); if (flag1) { - plr.mouseInterface = true; + player.mouseInterface = true; string str1 = ""; switch (index2) { @@ -33961,7 +34485,7 @@ label_56: builderAccStatus[index2] = builderAccStatus[index2] + 1; if (builderAccStatus[index2] >= 3) builderAccStatus[index2] = 0; - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.mouseLeftRelease = false; break; } @@ -33969,20 +34493,20 @@ label_56: } continue; case 8: - if (plr.InfoAccMechShowWires) + if (player.InfoAccMechShowWires) { r.X = index2 * 16; color = builderAccStatus[index2] == 0 ? color : firstColor; if (flag1) { - plr.mouseInterface = true; + player.mouseInterface = true; this.MouseText(builderAccStatus[index2] == 0 ? Language.GetTextValue("GameUI.WireModeForced") : Language.GetTextValue("GameUI.WireModeNormal")); Main.mouseText = true; } if (flag2) { builderAccStatus[index2] = builderAccStatus[index2] == 0 ? 1 : 0; - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.mouseLeftRelease = false; break; } @@ -33992,31 +34516,13 @@ label_56: case 11: continue; } - Main.spriteBatch.Draw(texture, vector2, new Microsoft.Xna.Framework.Rectangle?(r), color, 0.0f, r.Size() / 2f, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(builderAccTexture, vector2, new Microsoft.Xna.Framework.Rectangle?(r), color, 0.0f, r.Size() / 2f, 1f, SpriteEffects.None, 0.0f); if (flag1) - Main.spriteBatch.Draw(TextureAssets.InfoIcon[13].Value, vector2, new Microsoft.Xna.Framework.Rectangle?(), Main.OurFavoriteColor, 0.0f, TextureAssets.InfoIcon[13].Value.Size() / 2f, 1f, SpriteEffects.None, 0.0f); - UILinkPointNavigator.SetPosition(6000 + num1 + blockReplaceIcons + torchGodIcons, vector2 + r.Size() * 0.15f); + Main.spriteBatch.Draw(this.infoIconTexture[13], vector2, new Microsoft.Xna.Framework.Rectangle?(), Main.OurFavoriteColor, 0.0f, this.infoIconTexture[13].Size() / 2f, 1f, SpriteEffects.None, 0.0f); + UILinkPointNavigator.SetPosition(4000 + num1, vector2 + r.Size() * 0.3f); ++num1; } - this.DrawBlockReplacementIcon(0, 0, pushSideToolsUp, 0); - int num3 = num1 + 1; - if (plr.unlockedBiomeTorches) - { - this.DrawTorchBiomeSwapIcon(0, 0, pushSideToolsUp, 0); - ++num3; - } - UILinkPointNavigator.Shortcuts.BUILDERACCCOUNT = num3; - } - - private static void GetBuilderAccsCountToShow( - Player plr, - out int blockReplaceIcons, - out int torchGodIcons, - out int totalDrawnIcons) - { - blockReplaceIcons = 1; - torchGodIcons = plr.unlockedBiomeTorches ? 1 : 0; - totalDrawnIcons = plr.InfoAccMechShowWires.ToInt() * 6 + plr.rulerLine.ToInt() + plr.rulerGrid.ToInt() + plr.autoActuator.ToInt() + plr.autoPaint.ToInt() + blockReplaceIcons + torchGodIcons; + UILinkPointNavigator.Shortcuts.BUILDERACCCOUNT = num1; } public static void CheckInvasionProgressDisplay() @@ -34309,11 +34815,6 @@ label_56: Main.invasionProgressAlpha += 0.05f; else Main.invasionProgressAlpha -= 0.05f; - if (Main.invasionProgressMode == 0) - { - Main.invasionProgressDisplayLeft = 0; - Main.invasionProgressAlpha = 0.0f; - } if ((double) Main.invasionProgressAlpha < 0.0) Main.invasionProgressAlpha = 0.0f; if ((double) Main.invasionProgressAlpha > 1.0) @@ -34321,43 +34822,43 @@ label_56: if ((double) Main.invasionProgressAlpha <= 0.0) return; float scale1 = (float) (0.5 + (double) Main.invasionProgressAlpha * 0.5); - Texture2D texture1 = TextureAssets.Extra[9].Value; + Texture2D texture = Main.extraTexture[9]; string text = ""; Microsoft.Xna.Framework.Color c = Microsoft.Xna.Framework.Color.White; switch (Main.invasionProgressIcon) { case 1: - texture1 = TextureAssets.Extra[8].Value; + texture = Main.extraTexture[8]; text = Lang.inter[83].Value; c = new Microsoft.Xna.Framework.Color(64, 109, 164) * 0.5f; break; case 2: - texture1 = TextureAssets.Extra[12].Value; + texture = Main.extraTexture[12]; text = Lang.inter[84].Value; c = new Microsoft.Xna.Framework.Color(112, 86, 114) * 0.5f; break; case 3: - texture1 = TextureAssets.Extra[79].Value; + texture = Main.extraTexture[79]; text = Language.GetTextValue("DungeonDefenders2.InvasionProgressTitle"); c = new Microsoft.Xna.Framework.Color(88, 0, 160) * 0.5f; break; case 4: - texture1 = TextureAssets.Extra[9].Value; + texture = Main.extraTexture[9]; text = Lang.inter[88].Value; c = new Microsoft.Xna.Framework.Color(94, 72, 131) * 0.5f; break; case 5: - texture1 = TextureAssets.Extra[7].Value; + texture = Main.extraTexture[7]; text = Lang.inter[87].Value; c = new Microsoft.Xna.Framework.Color(173, 135, 140) * 0.5f; break; case 6: - texture1 = TextureAssets.Extra[11].Value; + texture = Main.extraTexture[11]; text = Lang.inter[86].Value; c = new Microsoft.Xna.Framework.Color(148, 122, 72) * 0.5f; break; case 7: - texture1 = TextureAssets.Extra[10].Value; + texture = Main.extraTexture[10]; text = Lang.inter[85].Value; c = new Microsoft.Xna.Framework.Color(165, 160, 155) * 0.5f; break; @@ -34371,8 +34872,8 @@ label_56: Utils.DrawInvBG(Main.spriteBatch, R, new Microsoft.Xna.Framework.Color(63, 65, 151, (int) byte.MaxValue) * 0.785f); string str = Main.invasionProgressMax != 0 ? ((int) ((double) Main.invasionProgress * 100.0 / (double) Main.invasionProgressMax)).ToString() + "%" : Language.GetTextValue("Game.InvasionPoints", (object) Main.invasionProgress); string textValue = Language.GetTextValue("Game.WaveMessage", (object) Main.invasionProgressWave, (object) str); - Texture2D texture2 = TextureAssets.ColorBar.Value; - Texture2D texture2D = TextureAssets.ColorBlip.Value; + Texture2D colorBarTexture = Main.colorBarTexture; + Texture2D colorBlipTexture = Main.colorBlipTexture; float num1 = MathHelper.Clamp((float) Main.invasionProgress / (float) Main.invasionProgressMax, 0.0f, 1f); if (Main.invasionProgressMax == 0) num1 = 1f; @@ -34380,11 +34881,11 @@ label_56: float y = 8f * scale1; Vector2 pos = position1 + Vector2.UnitY * y + Vector2.UnitX * 1f; Utils.DrawBorderString(Main.spriteBatch, textValue, pos, Microsoft.Xna.Framework.Color.White * Main.invasionProgressAlpha, scale1, 0.5f, 1f); - Main.spriteBatch.Draw(texture2, position1, new Microsoft.Xna.Framework.Rectangle?(), Microsoft.Xna.Framework.Color.White * Main.invasionProgressAlpha, 0.0f, new Vector2((float) (texture2.Width / 2), 0.0f), scale1, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(colorBarTexture, position1, new Microsoft.Xna.Framework.Rectangle?(), Microsoft.Xna.Framework.Color.White * Main.invasionProgressAlpha, 0.0f, new Vector2((float) (colorBarTexture.Width / 2), 0.0f), scale1, SpriteEffects.None, 0.0f); Vector2 position2 = pos + Vector2.UnitX * (num1 - 0.5f) * num2; - Main.spriteBatch.Draw(TextureAssets.MagicPixel.Value, position2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 1, 1)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, 241, 51) * Main.invasionProgressAlpha, 0.0f, new Vector2(1f, 0.5f), new Vector2(num2 * num1, y), SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(TextureAssets.MagicPixel.Value, position2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 1, 1)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, 165, 0, (int) sbyte.MaxValue) * Main.invasionProgressAlpha, 0.0f, new Vector2(1f, 0.5f), new Vector2(2f, y), SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(TextureAssets.MagicPixel.Value, position2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 1, 1)), Microsoft.Xna.Framework.Color.Black * Main.invasionProgressAlpha, 0.0f, new Vector2(0.0f, 0.5f), new Vector2(num2 * (1f - num1), y), SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.magicPixel, position2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 1, 1)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, 241, 51) * Main.invasionProgressAlpha, 0.0f, new Vector2(1f, 0.5f), new Vector2(num2 * num1, y), SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.magicPixel, position2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 1, 1)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, 165, 0, (int) sbyte.MaxValue) * Main.invasionProgressAlpha, 0.0f, new Vector2(1f, 0.5f), new Vector2(2f, y), SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.magicPixel, position2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 1, 1)), Microsoft.Xna.Framework.Color.Black * Main.invasionProgressAlpha, 0.0f, new Vector2(0.0f, 0.5f), new Vector2(num2 * (1f - num1), y), SpriteEffects.None, 0.0f); } else { @@ -34394,13 +34895,13 @@ label_56: Microsoft.Xna.Framework.Rectangle R = new Microsoft.Xna.Framework.Rectangle((int) position3.X - width / 2, (int) position3.Y - height / 2, width, height); Utils.DrawInvBG(Main.spriteBatch, R, new Microsoft.Xna.Framework.Color(63, 65, 151, (int) byte.MaxValue) * 0.785f); string textValue = Language.GetTextValue("Game.WaveCleared", Main.invasionProgressMax != 0 ? (object) (((int) ((double) Main.invasionProgress * 100.0 / (double) Main.invasionProgressMax)).ToString() + "%") : (object) Main.invasionProgress.ToString()); - Texture2D texture3 = TextureAssets.ColorBar.Value; - Texture2D texture2D = TextureAssets.ColorBlip.Value; + Texture2D colorBarTexture = Main.colorBarTexture; + Texture2D colorBlipTexture = Main.colorBlipTexture; if (Main.invasionProgressMax != 0) { - Main.spriteBatch.Draw(texture3, position3, new Microsoft.Xna.Framework.Rectangle?(), Microsoft.Xna.Framework.Color.White * Main.invasionProgressAlpha, 0.0f, new Vector2((float) (texture3.Width / 2), 0.0f), scale1, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(colorBarTexture, position3, new Microsoft.Xna.Framework.Rectangle?(), Microsoft.Xna.Framework.Color.White * Main.invasionProgressAlpha, 0.0f, new Vector2((float) (colorBarTexture.Width / 2), 0.0f), scale1, SpriteEffects.None, 0.0f); float num3 = MathHelper.Clamp((float) Main.invasionProgress / (float) Main.invasionProgressMax, 0.0f, 1f); - Vector2 vector2_1 = FontAssets.MouseText.Value.MeasureString(textValue); + Vector2 vector2_1 = Main.fontMouseText.MeasureString(textValue); float scale2 = scale1; if ((double) vector2_1.Y > 22.0) scale2 *= 22f / vector2_1.Y; @@ -34409,18 +34910,18 @@ label_56: Vector2 vector2_2 = position3 + Vector2.UnitY * y + Vector2.UnitX * 1f; Utils.DrawBorderString(Main.spriteBatch, textValue, vector2_2 + new Vector2(0.0f, -4f), Microsoft.Xna.Framework.Color.White * Main.invasionProgressAlpha, scale2, 0.5f, 1f); Vector2 position4 = vector2_2 + Vector2.UnitX * (num3 - 0.5f) * num4; - Main.spriteBatch.Draw(TextureAssets.MagicPixel.Value, position4, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 1, 1)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, 241, 51) * Main.invasionProgressAlpha, 0.0f, new Vector2(1f, 0.5f), new Vector2(num4 * num3, y), SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(TextureAssets.MagicPixel.Value, position4, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 1, 1)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, 165, 0, (int) sbyte.MaxValue) * Main.invasionProgressAlpha, 0.0f, new Vector2(1f, 0.5f), new Vector2(2f, y), SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(TextureAssets.MagicPixel.Value, position4, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 1, 1)), Microsoft.Xna.Framework.Color.Black * Main.invasionProgressAlpha, 0.0f, new Vector2(0.0f, 0.5f), new Vector2(num4 * (1f - num3), y), SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.magicPixel, position4, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 1, 1)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, 241, 51) * Main.invasionProgressAlpha, 0.0f, new Vector2(1f, 0.5f), new Vector2(num4 * num3, y), SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.magicPixel, position4, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 1, 1)), new Microsoft.Xna.Framework.Color((int) byte.MaxValue, 165, 0, (int) sbyte.MaxValue) * Main.invasionProgressAlpha, 0.0f, new Vector2(1f, 0.5f), new Vector2(2f, y), SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.magicPixel, position4, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 1, 1)), Microsoft.Xna.Framework.Color.Black * Main.invasionProgressAlpha, 0.0f, new Vector2(0.0f, 0.5f), new Vector2(num4 * (1f - num3), y), SpriteEffects.None, 0.0f); } } - Vector2 vector2 = FontAssets.MouseText.Value.MeasureString(text); + Vector2 vector2 = Main.fontMouseText.MeasureString(text); float num = 120f; if ((double) vector2.X > 200.0) num += vector2.X - 200f; - Microsoft.Xna.Framework.Rectangle rectangle = Utils.CenteredRectangle(new Vector2((float) Main.screenWidth - num, (float) (Main.screenHeight - 80)), (vector2 + new Vector2((float) (texture1.Width + 12), 6f)) * scale1); + Microsoft.Xna.Framework.Rectangle rectangle = Utils.CenteredRectangle(new Vector2((float) Main.screenWidth - num, (float) (Main.screenHeight - 80)), (vector2 + new Vector2((float) (texture.Width + 12), 6f)) * scale1); Utils.DrawInvBG(Main.spriteBatch, rectangle, c); - Main.spriteBatch.Draw(texture1, rectangle.Left() + Vector2.UnitX * scale1 * 8f, new Microsoft.Xna.Framework.Rectangle?(), Microsoft.Xna.Framework.Color.White * Main.invasionProgressAlpha, 0.0f, new Vector2(0.0f, (float) (texture1.Height / 2)), scale1 * 0.8f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(texture, rectangle.Left() + Vector2.UnitX * scale1 * 8f, new Microsoft.Xna.Framework.Rectangle?(), Microsoft.Xna.Framework.Color.White * Main.invasionProgressAlpha, 0.0f, new Vector2(0.0f, (float) (texture.Height / 2)), scale1 * 0.8f, SpriteEffects.None, 0.0f); Utils.DrawBorderString(Main.spriteBatch, text, rectangle.Right() + Vector2.UnitX * scale1 * -22f, Microsoft.Xna.Framework.Color.White * Main.invasionProgressAlpha, scale1 * 0.9f, 1f, 0.4f); } @@ -34444,8 +34945,6 @@ label_56: return new Microsoft.Xna.Framework.Color(r, g, b, (int) byte.MaxValue); } - public static Microsoft.Xna.Framework.Color hslToRgb(Vector3 hslVector) => Main.hslToRgb(hslVector.X, hslVector.Y, hslVector.Z); - public static Microsoft.Xna.Framework.Color hslToRgb( float Hue, float Saturation, @@ -34528,79 +35027,51 @@ label_56: public static void DrawCursor(Vector2 bonus, bool smart = false) { - if (Main.gameMenu && Main.alreadyGrabbingSunOrMoon) - return; - if (Main.player[Main.myPlayer].dead || Main.player[Main.myPlayer].mouseInterface) + if (Main.player[Main.myPlayer].dead) { - Main.ClearSmartInteract(); + Main.SmartInteractShowingGenuine = false; + Main.SmartInteractShowingFake = false; + Main.SmartInteractNPC = -1; + Main.SmartInteractNPCsNearby.Clear(); + Main.SmartInteractTileCoords.Clear(); + Main.SmartInteractTileCoordsSelected.Clear(); int num; Main.TileInteractionHY = num = -1; Main.TileInteractionLY = num; Main.TileInteractionHX = num; Main.TileInteractionLX = num; } - bool flag1 = UILinkPointNavigator.Available && !PlayerInput.InBuildingMode; + bool flag = UILinkPointNavigator.Available && !PlayerInput.InBuildingMode; Microsoft.Xna.Framework.Color cursorColor = Main.cursorColor; if (PlayerInput.UsingGamepad) { if (Main.player[Main.myPlayer].dead && !Main.player[Main.myPlayer].ghost && !Main.gameMenu || PlayerInput.InvisibleGamepadInMenus) return; - Vector2 t1 = new Vector2((float) Main.mouseX, (float) Main.mouseY); - Vector2 t2 = Vector2.Zero; - bool flag2 = Main.SmartCursorEnabled; - if (flag2) + if (smart && !flag) { - PlayerInput.smartSelectPointer.UpdateCenter(Main.ScreenSize.ToVector2() / 2f); - t2 = PlayerInput.smartSelectPointer.GetPointerPosition(); - if ((double) Vector2.Distance(t2, t1) < 1.0) - flag2 = false; - else - Utils.Swap(ref t1, ref t2); - } - float num = 1f; - if (flag2) - { - num = 0.3f; Microsoft.Xna.Framework.Color color = Microsoft.Xna.Framework.Color.White * Main.GamepadCursorAlpha; - int index = 17; - int frameX = 0; - Main.spriteBatch.Draw(TextureAssets.Cursors[index].Value, t2 + bonus, new Microsoft.Xna.Framework.Rectangle?(TextureAssets.Cursors[index].Frame(frameX: frameX)), color, 1.570796f * Main.GlobalTimeWrappedHourly, TextureAssets.Cursors[index].Frame(frameX: frameX).Size() / 2f, Main.cursorScale, SpriteEffects.None, 0.0f); - } - if (smart && !flag1) - { - Microsoft.Xna.Framework.Color color = Microsoft.Xna.Framework.Color.White * Main.GamepadCursorAlpha * num; int index = 13; int frameX = 0; - Main.spriteBatch.Draw(TextureAssets.Cursors[index].Value, t1 + bonus, new Microsoft.Xna.Framework.Rectangle?(TextureAssets.Cursors[index].Frame(2, frameX: frameX)), color, 0.0f, TextureAssets.Cursors[index].Frame(2, frameX: frameX).Size() / 2f, Main.cursorScale, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.cursorTextures[index], new Vector2((float) Main.mouseX, (float) Main.mouseY) + bonus, new Microsoft.Xna.Framework.Rectangle?(Main.cursorTextures[index].Frame(2, frameX: frameX)), color, 0.0f, Main.cursorTextures[index].Frame(2, frameX: frameX).Size() / 2f, Main.cursorScale, SpriteEffects.None, 0.0f); } else { Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; int index = 15; - Main.spriteBatch.Draw(TextureAssets.Cursors[index].Value, new Vector2((float) Main.mouseX, (float) Main.mouseY) + bonus, new Microsoft.Xna.Framework.Rectangle?(), white, 0.0f, TextureAssets.Cursors[index].Value.Size() / 2f, Main.cursorScale, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.cursorTextures[index], new Vector2((float) Main.mouseX, (float) Main.mouseY) + bonus, new Microsoft.Xna.Framework.Rectangle?(), white, 0.0f, Main.cursorTextures[index].Size() / 2f, Main.cursorScale, SpriteEffects.None, 0.0f); } } else { int index = smart.ToInt(); - Main.spriteBatch.Draw(TextureAssets.Cursors[index].Value, new Vector2((float) Main.mouseX, (float) Main.mouseY) + bonus + Vector2.One, new Microsoft.Xna.Framework.Rectangle?(), new Microsoft.Xna.Framework.Color((int) ((double) cursorColor.R * 0.200000002980232), (int) ((double) cursorColor.G * 0.200000002980232), (int) ((double) cursorColor.B * 0.200000002980232), (int) ((double) cursorColor.A * 0.5)), 0.0f, new Vector2(), Main.cursorScale * 1.1f, SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(TextureAssets.Cursors[index].Value, new Vector2((float) Main.mouseX, (float) Main.mouseY) + bonus, new Microsoft.Xna.Framework.Rectangle?(), cursorColor, 0.0f, new Vector2(), Main.cursorScale, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.cursorTextures[index], new Vector2((float) Main.mouseX, (float) Main.mouseY) + bonus + Vector2.One, new Microsoft.Xna.Framework.Rectangle?(), new Microsoft.Xna.Framework.Color((int) ((double) cursorColor.R * 0.200000002980232), (int) ((double) cursorColor.G * 0.200000002980232), (int) ((double) cursorColor.B * 0.200000002980232), (int) ((double) cursorColor.A * 0.5)), 0.0f, new Vector2(), Main.cursorScale * 1.1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.cursorTextures[index], new Vector2((float) Main.mouseX, (float) Main.mouseY) + bonus, new Microsoft.Xna.Framework.Rectangle?(), cursorColor, 0.0f, new Vector2(), Main.cursorScale, SpriteEffects.None, 0.0f); } } - public static void ClearSmartInteract() - { - Main.SmartInteractShowingGenuine = false; - Main.SmartInteractShowingFake = false; - Main.SmartInteractNPC = -1; - Main.SmartInteractProj = -1; - Main.SmartInteractTileCoords.Clear(); - Main.SmartInteractTileCoordsSelected.Clear(); - } - public static Vector2 DrawThickCursor(bool smart = false) { - if (!Main.ThickMouse || Main.gameMenu && Main.alreadyGrabbingSunOrMoon || PlayerInput.UsingGamepad && PlayerInput.InvisibleGamepadInMenus || PlayerInput.UsingGamepad && Main.player[Main.myPlayer].dead && !Main.player[Main.myPlayer].ghost && !Main.gameMenu) + if (!Main.ThickMouse || PlayerInput.UsingGamepad && PlayerInput.InvisibleGamepadInMenus || PlayerInput.UsingGamepad && Main.player[Main.myPlayer].dead && !Main.player[Main.myPlayer].ghost && !Main.gameMenu) return Vector2.Zero; bool flag = UILinkPointNavigator.Available && !PlayerInput.InBuildingMode; Microsoft.Xna.Framework.Color mouseBorderColor = Main.MouseBorderColor; @@ -34634,18 +35105,18 @@ label_56: index1 = 13; int frameX = 0; vector2_2 = Vector2.One; - sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(TextureAssets.Cursors[index1].Frame(2, frameX: frameX)); - origin = TextureAssets.Cursors[index1].Frame(2, frameX: frameX).Size() / 2f; + sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(Main.cursorTextures[index1].Frame(2, frameX: frameX)); + origin = Main.cursorTextures[index1].Frame(2, frameX: frameX).Size() / 2f; mouseBorderColor *= Main.GamepadCursorAlpha; } else { index1 = 15; vector2_2 = Vector2.One; - origin = TextureAssets.Cursors[index1].Value.Size() / 2f; + origin = Main.cursorTextures[index1].Size() / 2f; } } - Main.spriteBatch.Draw(TextureAssets.Cursors[index1].Value, new Vector2((float) Main.mouseX, (float) Main.mouseY) + vector2_2, sourceRectangle, mouseBorderColor, 0.0f, origin, scale, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.cursorTextures[index1], new Vector2((float) Main.mouseX, (float) Main.mouseY) + vector2_2, sourceRectangle, mouseBorderColor, 0.0f, origin, scale, SpriteEffects.None, 0.0f); } return new Vector2(2f); } @@ -34673,8 +35144,11 @@ label_56: { Main.menuMode = 10; Main.worldName = text.Trim(); - Main.ActiveWorldFileData = WorldFile.CreateMetadata(Main.worldName, SocialAPI.Cloud != null && SocialAPI.Cloud.EnabledByDefault, Main.GameMode); - Main.menuMode = 5000; + Main.ActiveWorldFileData = WorldFile.CreateMetadata(Main.worldName, SocialAPI.Cloud != null && SocialAPI.Cloud.EnabledByDefault, Main.expertMode); + if (Main.UseSeedUI) + Main.menuMode = 5000; + else + WorldGen.CreateNewWorld(); } private static Action CreateGoToMenuEvent(int menu) => (Action) (() => @@ -34683,29 +35157,11 @@ label_56: UILinkPointNavigator.Shortcuts.FANCYUI_SPECIAL_INSTRUCTIONS = 0; }); - public static Microsoft.Xna.Framework.Point ScreenSize => new Microsoft.Xna.Framework.Point(Main.screenWidth, Main.screenHeight); - - public static void GoToWorldSelect() - { - Main.MenuUI.SetState((UIState) Main._worldSelectMenu); - Main.menuMode = 888; - } - - public static void StartClientGameplay() - { - Main.menuMode = 10; - Netplay.StartTcpClient(); - } - - public static void ReleaseHostAndPlayProcess() - { - if (Main.tServer == null) - return; - Main.tServer = (Process) null; - } - protected void DrawMenu(GameTime gameTime) { + double uiScaleWanted = (double) Main._uiScaleWanted; + Main.UIScale = 1f; + Main._uiScaleWanted = (float) uiScaleWanted; if (!Main.IsEngineLoaded) { Main.IsEngineLoaded = true; @@ -34718,69 +35174,53 @@ label_56: if (Main.menuMode <= 1 && Main.slimeRain) Main.StopSlimeRain(); Main.render = false; - Main.SceneMetrics.Reset(); + Star.UpdateStars(); + Cloud.UpdateClouds(); + Main.holyTiles = 0; + Main.evilTiles = 0; + Main.shroomTiles = 0; + Main.bloodTiles = 0; + Main.bloodTiles = 0; + Main.jungleTiles = 0; Main.drawingPlayerChat = false; - Main.chatMonitor.Clear(); + for (int index = 0; index < Main.numChatLines; ++index) + Main.chatLine[index] = new ChatLine(); + this.DrawFPS(); Main.screenLastPosition = Main.screenPosition; Main.screenPosition.Y = (float) (Main.worldSurface * 16.0) - (float) Main.screenHeight; - Main.MenuXMovement = 4f; - if (Main.alreadyGrabbingSunOrMoon) - this.playOldTile = true; - Main.screenPosition.X += Main.MenuXMovement; + if (Main.grabSky) + Main.screenPosition.X += (float) (Main.mouseX - Main.screenWidth / 2) * 0.02f; + else + Main.screenPosition.X += 2f; if ((double) Main.screenPosition.X > 2147483520.0) Main.screenPosition.X = 0.0f; if ((double) Main.screenPosition.X < -2147483520.0) Main.screenPosition.X = 0.0f; - Star.UpdateStars(); - Cloud.UpdateClouds(); - this.DrawFPS(); Main.background = 0; byte num1 = (byte) (((int) byte.MaxValue + (int) Main.tileColor.R * 2) / 3); Microsoft.Xna.Framework.Color color1 = new Microsoft.Xna.Framework.Color((int) num1, (int) num1, (int) num1, (int) byte.MaxValue); - if (WorldGen.drunkWorldGen) - { - this.logoRotation += this.logoRotationSpeed * 4E-06f; - if ((double) this.logoRotationSpeed > 0.0) - this.logoRotationSpeed += 1500f; - else - this.logoRotationSpeed -= 1500f; - this.logoScale -= 0.05f; - if ((double) this.logoScale < 0.0) - this.logoScale = 0.0f; - } - else - { - this.logoRotation += this.logoRotationSpeed * 4E-06f; - if ((double) this.logoRotation > 0.08) - this.logoRotationDirection = -1f; - else if ((double) this.logoRotation < -0.08) - this.logoRotationDirection = 1f; - if ((double) this.logoRotationSpeed < 20.0 && (double) this.logoRotationDirection == 1.0) - ++this.logoRotationSpeed; - else if ((double) this.logoRotationSpeed > -20.0 && (double) this.logoRotationDirection == -1.0) - --this.logoRotationSpeed; - this.logoScale += this.logoScaleSpeed * 9E-06f; - if ((double) this.logoScale > 1.35) - this.logoScaleDirection = -1f; - else if ((double) this.logoScale < 1.0) - this.logoScaleDirection = 1f; - if ((double) this.logoScaleSpeed < 50.0 && (double) this.logoScaleDirection == 1.0) - ++this.logoScaleSpeed; - else if ((double) this.logoScaleSpeed > -50.0 && (double) this.logoScaleDirection == -1.0) - --this.logoScaleSpeed; - } + this.logoRotation += this.logoRotationSpeed * 3E-05f; + if ((double) this.logoRotation > 0.1) + this.logoRotationDirection = -1f; + else if ((double) this.logoRotation < -0.1) + this.logoRotationDirection = 1f; + if ((double) this.logoRotationSpeed < 20.0 & (double) this.logoRotationDirection == 1.0) + ++this.logoRotationSpeed; + else if ((double) this.logoRotationSpeed > -20.0 & (double) this.logoRotationDirection == -1.0) + --this.logoRotationSpeed; + this.logoScale += this.logoScaleSpeed * 1E-05f; + if ((double) this.logoScale > 1.1) + this.logoScaleDirection = -1f; + else if ((double) this.logoScale < 0.9) + this.logoScaleDirection = 1f; + if ((double) this.logoScaleSpeed < 50.0 & (double) this.logoScaleDirection == 1.0) + ++this.logoScaleSpeed; + else if ((double) this.logoScaleSpeed > -50.0 & (double) this.logoScaleDirection == -1.0) + --this.logoScaleSpeed; Microsoft.Xna.Framework.Color color2 = new Microsoft.Xna.Framework.Color((int) (byte) ((double) color1.R * ((double) Main.LogoA / (double) byte.MaxValue)), (int) (byte) ((double) color1.G * ((double) Main.LogoA / (double) byte.MaxValue)), (int) (byte) ((double) color1.B * ((double) Main.LogoA / (double) byte.MaxValue)), (int) (byte) ((double) color1.A * ((double) Main.LogoA / (double) byte.MaxValue))); Microsoft.Xna.Framework.Color color3 = new Microsoft.Xna.Framework.Color((int) (byte) ((double) color1.R * ((double) Main.LogoB / (double) byte.MaxValue)), (int) (byte) ((double) color1.G * ((double) Main.LogoB / (double) byte.MaxValue)), (int) (byte) ((double) color1.B * ((double) Main.LogoB / (double) byte.MaxValue)), (int) (byte) ((double) color1.A * ((double) Main.LogoB / (double) byte.MaxValue))); - if (this.playOldTile) - { - Main.spriteBatch.Draw(TextureAssets.Logo3.Value, new Vector2((float) (Main.screenWidth / 2), 100f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Logo.Width(), TextureAssets.Logo.Height())), color2, this.logoRotation, new Vector2((float) (TextureAssets.Logo.Width() / 2), (float) (TextureAssets.Logo.Height() / 2)), this.logoScale, SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(TextureAssets.Logo4.Value, new Vector2((float) (Main.screenWidth / 2), 100f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Logo.Width(), TextureAssets.Logo.Height())), color3, this.logoRotation, new Vector2((float) (TextureAssets.Logo.Width() / 2), (float) (TextureAssets.Logo.Height() / 2)), this.logoScale, SpriteEffects.None, 0.0f); - } - else - { - Main.spriteBatch.Draw(TextureAssets.Logo.Value, new Vector2((float) (Main.screenWidth / 2), 100f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Logo.Width(), TextureAssets.Logo.Height())), color2, this.logoRotation, new Vector2((float) (TextureAssets.Logo.Width() / 2), (float) (TextureAssets.Logo.Height() / 2)), this.logoScale, SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(TextureAssets.Logo2.Value, new Vector2((float) (Main.screenWidth / 2), 100f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Logo.Width(), TextureAssets.Logo.Height())), color3, this.logoRotation, new Vector2((float) (TextureAssets.Logo.Width() / 2), (float) (TextureAssets.Logo.Height() / 2)), this.logoScale, SpriteEffects.None, 0.0f); - } + Main.spriteBatch.Draw(Main.logoTexture, new Vector2((float) (Main.screenWidth / 2), 100f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.logoTexture.Width, Main.logoTexture.Height)), color2, this.logoRotation, new Vector2((float) (Main.logoTexture.Width / 2), (float) (Main.logoTexture.Height / 2)), this.logoScale, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.logo2Texture, new Vector2((float) (Main.screenWidth / 2), 100f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.logoTexture.Width, Main.logoTexture.Height)), color3, this.logoRotation, new Vector2((float) (Main.logoTexture.Width / 2), (float) (Main.logoTexture.Height / 2)), this.logoScale, SpriteEffects.None, 0.0f); if (Main.dayTime) { Main.LogoA += 2; @@ -34834,2285 +35274,2288 @@ label_56: string[] strArray1 = new string[Main.maxMenuItems]; if (Main.menuMode == -1) Main.menuMode = 0; - if (Program.LoadedEverything) + int num9 = Program.LoadedEverything ? 1 : 0; + if (num9 != 0) GamepadMainMenuHandler.CanRun = true; - switch (Main.menuMode) + if (num9 == 0) { - case 1212: - strArray1[0] = Lang.menu[102].Value; - num4 = 33; - num2 = 200; - numArray1[0] = -20; - numArray1[1] = 25; - numArray1[2] = 25; - numArray1[3] = 25; - numArray1[4] = 25; - numArray1[5] = 25; - numArray1[6] = 25; - numArray1[7] = 25; - numArray1[8] = 25; - numArray1[9] = 25; - flagArray1[0] = true; - strArray1[1] = Language.GetTextValue("Language.English"); - strArray1[2] = Language.GetTextValue("Language.German"); - strArray1[3] = Language.GetTextValue("Language.Italian"); - strArray1[4] = Language.GetTextValue("Language.French"); - strArray1[5] = Language.GetTextValue("Language.Spanish"); - strArray1[6] = Language.GetTextValue("Language.Russian"); - strArray1[7] = Language.GetTextValue("Language.Chinese"); - strArray1[8] = Language.GetTextValue("Language.Portuguese"); - strArray1[9] = Language.GetTextValue("Language.Polish"); - num5 = 10; - for (int index = 0; index < num5; ++index) - numArray4[index] = 0.75f; - numArray4[0] = 1f; - if (this.selectedMenu >= 1) - { - Main.changeTheTitle = true; - LanguageManager.Instance.SetLanguage(this.selectedMenu); - Main.menuMode = 0; - SoundEngine.PlaySound(10); - Main.SaveSettings(); + flagArray1[0] = true; + strArray1[0] = string.Format(" {0} {1,-10}", (object) Language.GetTextValue("UI.LoadingCode"), (object) Program.LoadedPercentage.ToString("P0")); + num5 = 1; + } + else + { + switch (Main.menuMode) + { + case 1212: + strArray1[0] = Lang.menu[102].Value; + num4 = 33; + num2 = 200; + numArray1[0] = -20; + numArray1[1] = 25; + numArray1[2] = 25; + numArray1[3] = 25; + numArray1[4] = 25; + numArray1[5] = 25; + numArray1[6] = 25; + numArray1[7] = 25; + numArray1[8] = 25; + numArray1[9] = 25; + flagArray1[0] = true; + strArray1[1] = Language.GetTextValue("Language.English"); + strArray1[2] = Language.GetTextValue("Language.German"); + strArray1[3] = Language.GetTextValue("Language.Italian"); + strArray1[4] = Language.GetTextValue("Language.French"); + strArray1[5] = Language.GetTextValue("Language.Spanish"); + strArray1[6] = Language.GetTextValue("Language.Russian"); + strArray1[7] = Language.GetTextValue("Language.Chinese"); + strArray1[8] = Language.GetTextValue("Language.Portuguese"); + strArray1[9] = Language.GetTextValue("Language.Polish"); + num5 = 10; + for (int index = 0; index < num5; ++index) + numArray4[index] = 0.75f; + numArray4[0] = 1f; + if (this.selectedMenu >= 1) + { + Main.chTitle = true; + LanguageManager.Instance.SetLanguage(this.selectedMenu); + Main.menuMode = 0; + Main.PlaySound(10); + Main.SaveSettings(); + break; + } break; - } - break; - case 1213: - strArray1[0] = Lang.menu[102].Value; - flagArray1[0] = true; - strArray1[1] = Language.GetTextValue("Language.English"); - strArray1[2] = Language.GetTextValue("Language.German"); - strArray1[3] = Language.GetTextValue("Language.Italian"); - strArray1[4] = Language.GetTextValue("Language.French"); - strArray1[5] = Language.GetTextValue("Language.Spanish"); - strArray1[6] = Language.GetTextValue("Language.Russian"); - strArray1[7] = Language.GetTextValue("Language.Chinese"); - strArray1[8] = Language.GetTextValue("Language.Portuguese"); - strArray1[9] = Language.GetTextValue("Language.Polish"); - strArray1[10] = Lang.menu[5].Value; - num5 = 11; - if (this.selectedMenu == 10 | flag5) - { - flag5 = false; - Main.menuMode = 11; - SoundEngine.PlaySound(11); - } - else if (this.selectedMenu >= 1) - { - Main.changeTheTitle = true; - LanguageManager.Instance.SetLanguage(this.selectedMenu); - SoundEngine.PlaySound(12); - Main.SaveSettings(); - } - num4 = 33; - num2 = 200; - numArray1[0] = -20; - numArray1[10] = 10; - for (int index = 0; index < num5; ++index) - numArray4[index] = 0.75f; - numArray4[0] = 0.85f; - numArray4[10] = 0.95f; - break; - default: - if (Main.netMode == 2) - { - bool flag6 = true; - for (int index = 0; index < 8; ++index) - { - if (index < (int) byte.MaxValue) - { - try - { - strArray1[index] = Netplay.Clients[index].StatusText; - if (Netplay.Clients[index].IsActive) - { - if (Main.showSpam) - { - ref string local = ref strArray1[index]; - local = local + " (" + (object) NetMessage.buffer[index].spamCount + ")"; - } - } - } - catch - { - strArray1[index] = ""; - } - flagArray1[index] = true; - if (strArray1[index] != "" && strArray1[index] != null) - flag6 = false; - } - } - if (flag6) - { - strArray1[0] = Lang.menu[0].Value; - strArray1[1] = Lang.menu[1].Value + (object) Netplay.ListenPort + "."; - } + case 1213: + strArray1[0] = Lang.menu[102].Value; + flagArray1[0] = true; + strArray1[1] = Language.GetTextValue("Language.English"); + strArray1[2] = Language.GetTextValue("Language.German"); + strArray1[3] = Language.GetTextValue("Language.Italian"); + strArray1[4] = Language.GetTextValue("Language.French"); + strArray1[5] = Language.GetTextValue("Language.Spanish"); + strArray1[6] = Language.GetTextValue("Language.Russian"); + strArray1[7] = Language.GetTextValue("Language.Chinese"); + strArray1[8] = Language.GetTextValue("Language.Portuguese"); + strArray1[9] = Language.GetTextValue("Language.Polish"); + strArray1[10] = Lang.menu[5].Value; num5 = 11; - strArray1[9] = Main.statusText; - flagArray1[9] = true; - num2 = 170; - num4 = 30; - numArray1[10] = 20; - numArray1[10] = 40; - strArray1[10] = Lang.menu[2].Value; if (this.selectedMenu == 10 | flag5) { flag5 = false; - Netplay.Disconnect = true; - SoundEngine.PlaySound(11); - break; + Main.menuMode = 11; + Main.PlaySound(11); } + else if (this.selectedMenu >= 1) + { + Main.chTitle = true; + LanguageManager.Instance.SetLanguage(this.selectedMenu); + Main.PlaySound(12); + Main.SaveSettings(); + } + num4 = 33; + num2 = 200; + numArray1[0] = -20; + numArray1[10] = 10; + for (int index = 0; index < num5; ++index) + numArray4[index] = 0.75f; + numArray4[0] = 0.85f; + numArray4[10] = 0.95f; break; - } - if (Main.menuMode == 31) - { - string serverPassword1 = Netplay.ServerPassword; - PlayerInput.WritingText = true; - flag5 = false; - Main.instance.HandleIME(); - Netplay.ServerPassword = Main.GetInputText(Netplay.ServerPassword); - string serverPassword2 = Netplay.ServerPassword; - if (serverPassword1 != serverPassword2) - SoundEngine.PlaySound(12); - strArray1[0] = Lang.menu[3].Value; - ++this.textBlinkerCount; - if (this.textBlinkerCount >= 20) + default: + if (Main.netMode == 2) { - this.textBlinkerState = this.textBlinkerState != 0 ? 0 : 1; - this.textBlinkerCount = 0; - } - strArray1[1] = Netplay.ServerPassword; - if (Main.HidePassword) - { - strArray1[1] = ""; - for (int index = 0; index < Netplay.ServerPassword.Length; ++index) + bool flag6 = true; + for (int index = 0; index < 8; ++index) { - // ISSUE: explicit reference operation - ^ref strArray1[1] += "*"; - } - } - if (this.textBlinkerState == 1) - { - // ISSUE: explicit reference operation - ^ref strArray1[1] += "|"; - numArray2[1] = 1; - } - else - { - // ISSUE: explicit reference operation - ^ref strArray1[1] += " "; - } - flagArray1[0] = true; - flagArray1[1] = true; - numArray1[1] = -20; - numArray1[2] = 20; - strArray1[2] = Lang.menu[4].Value; - strArray1[3] = Lang.menu[5].Value; - num5 = 4; - if (this.selectedMenu == 3 | flag5) - { - flag5 = false; - SoundEngine.PlaySound(11); - Main.menuMode = 0; - Netplay.Disconnect = true; - Netplay.ServerPassword = ""; - break; - } - if (this.selectedMenu == 2 || Main.inputTextEnter) - { - NetMessage.SendData(38); - Main.menuMode = 14; - break; - } - break; - } - if (Main.netMode != 1) - { - switch (Main.menuMode) - { - case -71: - num2 = 200; - num4 = 60; - numArray1[1] = 30; - numArray1[2] = 30; - numArray1[3] = 30; - numArray1[4] = 70; - num5 = 5; - int index1 = 0; - strArray1[index1] = Lang.misc[100].Value; - flagArray1[index1] = true; - int index2 = index1 + 1; - strArray1[index2] = Lang.misc[101].Value; - if (this.selectedMenu == index2) + if (index < (int) byte.MaxValue) { - WorldGen.WorldGenParam_Evil = 0; - SoundEngine.PlaySound(10); - Main.menuMode = 7; - } - int index3 = index2 + 1; - strArray1[index3] = Lang.misc[102].Value; - if (this.selectedMenu == index3) - { - WorldGen.WorldGenParam_Evil = 1; - SoundEngine.PlaySound(10); - Main.menuMode = 7; - } - int index4 = index3 + 1; - strArray1[index4] = Lang.misc[103].Value; - if (this.selectedMenu == index4) - { - WorldGen.WorldGenParam_Evil = -1; - SoundEngine.PlaySound(10); - Main.menuMode = 7; - } - int index5 = index4 + 1; - strArray1[index5] = Language.GetTextValue("UI.Back"); - if (this.selectedMenu == index5 | flag5) - { - flag5 = false; - SoundEngine.PlaySound(11); - Main.menuMode = -7; - } - int num9 = index5 + 1; - Main.clrInput(); - goto label_623; - case -7: - num2 = 200; - num4 = 60; - numArray1[2] = 30; - numArray1[3] = 30; - numArray1[4] = 30; - numArray3[3] = (byte) 1; - numArray3[4] = (byte) 2; - numArray1[5] = 70; - if (this.focusMenu == 2) - strArray1[1] = Language.GetTextValue("UI.WorldDescriptionNormal"); - else if (this.focusMenu == 3) - strArray1[1] = Language.GetTextValue("UI.WorldDescriptionExpert"); - else if (this.focusMenu == 4) - strArray1[1] = Language.GetTextValue("UI.WorldDescriptionMaster"); - strArray1[0] = Lang.menu[32].Value; - flagArray1[0] = true; - flagArray1[1] = true; - strArray1[2] = Language.GetTextValue("UI.Normal"); - strArray1[3] = Language.GetTextValue("UI.Expert"); - strArray1[4] = Language.GetTextValue("UI.Master"); - strArray1[5] = Language.GetTextValue("UI.Back"); - num5 = 6; - if (this.selectedMenu == 2) - { - Main.GameMode = 0; - SoundEngine.PlaySound(10); - Main.menuMode = 7; - if (Main.SettingsUnlock_WorldEvil) - Main.menuMode = -71; - } - else if (this.selectedMenu == 3) - { - Main.GameMode = 1; - SoundEngine.PlaySound(10); - Main.menuMode = 7; - if (Main.SettingsUnlock_WorldEvil) - Main.menuMode = -71; - } - else if (this.selectedMenu == 4) - { - Main.GameMode = 2; - SoundEngine.PlaySound(10); - Main.menuMode = 7; - if (Main.SettingsUnlock_WorldEvil) - Main.menuMode = -71; - } - else if (this.selectedMenu == 5 | flag5) - { - flag5 = false; - SoundEngine.PlaySound(11); - Main.menuMode = 16; - } - Main.clrInput(); - goto label_623; - case 0: - Main._blockFancyUIWhileLoading = false; - Main._pendingCharacterSelect = (Main.OnPlayerSelected) null; - DD2Event.Ongoing = false; - Main.eclipse = false; - Main.pumpkinMoon = false; - Main.snowMoon = false; - Main.ServerSideCharacter = false; - Main.menuMultiplayer = false; - Main.menuServer = false; - Main.netMode = 0; - Main.ClearVisualPostProcessEffects(); - int index6 = 0; - num5 = 6; - num4 = 60; - strArray1[index6] = Lang.menu[12].Value; - if (this.selectedMenu == index6) - { - SoundEngine.PlaySound(10); - Main.ClearPendingPlayerSelectCallbacks(); - Main.menuMode = 1; - } - int index7 = index6 + 1; - strArray1[index7] = Lang.menu[13].Value; - if (this.selectedMenu == index7) - { - SoundEngine.PlaySound(10); - Main.menuMode = 12; - } - int index8 = index7 + 1; - strArray1[index8] = Lang.menu[131].Value; - if (this.selectedMenu == index8) - { - SoundEngine.PlaySound(10); - Main.MenuUI.SetState((UIState) Main.AchievementsMenu); - Main.menuMode = 888; - } - int index9 = index8 + 1; - strArray1[index9] = Language.GetText("UI.ResourcePacks").Value; - if (this.selectedMenu == index9) - { - SoundEngine.PlaySound(10); - Main.MenuUI.SetState((UIState) new UIResourcePackSelectionMenu(Main.AssetSourceController, AssetInitializer.CreateResourcePackList((System.IServiceProvider) this.Services))); - Main.menuMode = 888; - } - int index10 = index9 + 1; - strArray1[index10] = Lang.menu[14].Value; - if (this.selectedMenu == index10) - { - SoundEngine.PlaySound(10); - Main.menuMode = 11; - } - int index11 = index10 + 1; - strArray1[index11] = Lang.menu[15].Value; - if (this.selectedMenu == index11) - this.QuitGame(); - int num10 = index11 + 1; - goto label_623; - case 1: - Main.OpenCharacterSelectUI(); - goto label_623; - case 2: - flag4 = true; - if (this.selectedMenu == 0) - { - Main.menuMode = 17; - SoundEngine.PlaySound(10); - Main.selColor = Main.PendingPlayer.hairColor; - } - if (this.selectedMenu == 1) - { - Main.menuMode = 18; - SoundEngine.PlaySound(10); - Main.selColor = Main.PendingPlayer.eyeColor; - } - if (this.selectedMenu == 2) - { - Main.menuMode = 19; - SoundEngine.PlaySound(10); - Main.selColor = Main.PendingPlayer.skinColor; - } - if (this.selectedMenu == 3) - { - Main.menuMode = 20; - SoundEngine.PlaySound(10); - } - strArray1[0] = Lang.menu[18].Value; - strArray1[1] = Lang.menu[19].Value; - strArray1[2] = Lang.menu[20].Value; - strArray1[3] = Lang.menu[21].Value; - num2 = 220; - for (int index12 = 0; index12 < 9; ++index12) - numArray4[index12] = index12 >= 6 ? 0.9f : 0.75f; - num4 = 38; - numArray1[6] = 6; - numArray1[7] = 12; - numArray1[8] = 18; - num6 = Main.screenWidth / 2 - 16; - num7 = 176; - strArray1[4] = !Main.PendingPlayer.Male ? Lang.menu[23].Value : Lang.menu[22].Value; - if (this.selectedMenu == 4) - { - if (Main.PendingPlayer.Male) - { - SoundEngine.PlaySound(20); - Main.PendingPlayer.Male = false; - } - else - { - SoundEngine.PlaySound(1); - Main.PendingPlayer.Male = true; - } - } - if (Main.PendingPlayer.difficulty == (byte) 2) - { - strArray1[5] = Lang.menu[24].Value; - numArray3[5] = Main.PendingPlayer.difficulty; - } - else if (Main.PendingPlayer.difficulty == (byte) 1) - { - strArray1[5] = Lang.menu[25].Value; - numArray3[5] = Main.PendingPlayer.difficulty; - } - else - strArray1[5] = Lang.menu[26].Value; - if (this.selectedMenu == 5) - { - SoundEngine.PlaySound(10); - Main.menuMode = 222; - } - if (this.selectedMenu == 7) - { - SoundEngine.PlaySound(12); - Main.PendingPlayer.hair = Main.rand.Next(51); - Main.PendingPlayer.eyeColor = this.randColor(); - while ((int) Main.PendingPlayer.eyeColor.R + (int) Main.PendingPlayer.eyeColor.G + (int) Main.PendingPlayer.eyeColor.B > 300) - Main.PendingPlayer.eyeColor = this.randColor(); - Main.PendingPlayer.hairColor = this.randColor(); - Main.PendingPlayer.pantsColor = this.randColor(); - Main.PendingPlayer.shirtColor = this.randColor(); - Main.PendingPlayer.shoeColor = this.randColor(); - Main.PendingPlayer.skinColor = this.randColor(); - float num11 = (float) Main.rand.Next(60, 120) * 0.01f; - if ((double) num11 > 1.0) - num11 = 1f; - Main.PendingPlayer.skinColor.R = (byte) ((double) Main.rand.Next(240, (int) byte.MaxValue) * (double) num11); - Main.PendingPlayer.skinColor.G = (byte) ((double) Main.rand.Next(110, 140) * (double) num11); - Main.PendingPlayer.skinColor.B = (byte) ((double) Main.rand.Next(75, 110) * (double) num11); - Main.PendingPlayer.underShirtColor = this.randColor(); - switch (Main.PendingPlayer.hair + 1) - { - case 5: - case 6: - case 7: - case 10: - case 12: - case 19: - case 22: - case 23: - case 26: - case 27: - case 30: - case 33: - Main.PendingPlayer.Male = false; - break; - default: - Main.PendingPlayer.Male = true; - break; - } - Main.PendingPlayer.skinVariant = Main.rand.Next(12); - } - strArray1[7] = Lang.menu[27].Value; - strArray1[6] = Lang.menu[28].Value; - strArray1[8] = Lang.menu[5].Value; - num5 = 9; - if (this.selectedMenu == 8 | flag5) - { - flag5 = false; - SoundEngine.PlaySound(11); - Main.menuMode = 1; - goto label_623; - } - else if (this.selectedMenu == 6) - { - SoundEngine.PlaySound(10); - Main.PendingPlayer.name = ""; - Main.menuMode = 3; - Main.clrInput(); - goto label_623; - } - else - goto label_623; - case 3: - UIVirtualKeyboard uiVirtualKeyboard = new UIVirtualKeyboard(Lang.menu[45].Value, "", new UIVirtualKeyboard.KeyboardSubmitEvent(this.OnCharacterNamed), Main.CreateGoToMenuEvent(2)); - uiVirtualKeyboard.SetMaxInputLength(20); - Main.MenuUI.SetState((UIState) uiVirtualKeyboard); - Main.menuMode = 888; - goto label_623; - case 5: - strArray1[0] = Lang.menu[46].Value + " " + Main.PlayerList[Main.selectedPlayer].Player.name + "?"; - flagArray1[0] = true; - strArray1[1] = Lang.menu[104].Value; - strArray1[2] = Lang.menu[105].Value; - num5 = 3; - if (this.selectedMenu == 1) - { - Main.ErasePlayer(Main.selectedPlayer); - SoundEngine.PlaySound(10); - Main.menuMode = 1; - goto label_623; - } - else if (this.selectedMenu == 2 | flag5) - { - flag5 = false; - SoundEngine.PlaySound(11); - Main.menuMode = 1; - goto label_623; - } - else - goto label_623; - case 6: - Main.MenuUI.SetState((UIState) Main._worldSelectMenu); - Main.menuMode = 888; - goto label_623; - case 7: - Main.MenuUI.SetState((UIState) new UIVirtualKeyboard(Lang.menu[48].Value, "", new UIVirtualKeyboard.KeyboardSubmitEvent(this.OnWorldNamed), Main.CreateGoToMenuEvent(-7))); - Main.menuMode = 888; - goto label_623; - case 8: - num2 = 180; - num4 = 40; - num5 = 8; - numArray1[7] += 30; - for (int index13 = 0; index13 < num5; ++index13) - numArray4[index13] = 0.8f; - strArray1[7] = Lang.menu[5].Value; - for (int index14 = 0; index14 < 7; ++index14) - { - if (index14 < Main.WorldList.Count) - { - strArray1[index14] = Main.WorldList[index14 + Main.menuSkip].Name; - if (Main.WorldList[index14 + Main.menuSkip].GameMode == 1) - numArray3[index14] = (byte) 1; - else if (Main.WorldList[index14 + Main.menuSkip].GameMode == 2) - numArray3[index14] = (byte) 2; - } - else - strArray1[index14] = (string) null; - } - if (Main.WorldList.Count > 7 + Main.menuSkip) - { - strArray1[6] = Language.GetTextValue("UI.More"); - strArray1[6] = "▼"; - numArray4[6] = 0.6f; - numArray1[6] += 8; - this.menuWide[6] = true; - } - if (Main.menuSkip > 0) - { - strArray1[0] = "▲"; - numArray4[0] = 0.6f; - numArray1[0] += 8; - this.menuWide[0] = true; - } - if (this.selectedMenu == 0 && Main.menuSkip > 0) - { - SoundEngine.PlaySound(12); - Main.menuSkip -= 5; - if (Main.menuSkip < 0) - { - Main.menuSkip = 0; - goto label_623; - } - else - goto label_623; - } - else if (this.selectedMenu == 6 && Main.menuSkip < Main.WorldList.Count - 7) - { - SoundEngine.PlaySound(12); - Main.menuSkip += 5; - if (Main.menuSkip >= Main.PlayerList.Count - 7) - { - Main.menuSkip = Main.WorldList.Count - 7; - goto label_623; - } - else - goto label_623; - } - else if (this.selectedMenu == 7 | flag5) - { - flag5 = false; - SoundEngine.PlaySound(11); - Main.menuMode = 6; - goto label_623; - } - else if (this.selectedMenu >= 0) - { - Main.selectedWorld = this.selectedMenu + Main.menuSkip; - SoundEngine.PlaySound(10); - Main.menuMode = 9; - goto label_623; - } - else - goto label_623; - case 9: - strArray1[0] = Lang.menu[46].Value + " " + Main.WorldList[Main.selectedWorld].Name + "?"; - flagArray1[0] = true; - strArray1[1] = Lang.menu[104].Value; - strArray1[2] = Lang.menu[105].Value; - num5 = 3; - if (this.selectedMenu == 1) - { - Main.EraseWorld(Main.selectedWorld); - SoundEngine.PlaySound(10); - Main.menuMode = 6; - goto label_623; - } - else if (this.selectedMenu == 2 | flag5) - { - SoundEngine.PlaySound(11); - Main.menuMode = 6; - goto label_623; - } - else - goto label_623; - case 10: - num5 = 1; - strArray1[0] = Main.statusText; - flagArray1[0] = true; - num2 = 300; - Main.gameTips.Update(); - Main.gameTips.Draw(); - goto label_623; - case 11: - num2 = 210; - num4 = 37; - num5 = 8; - numArray1[num5 - 1] = 8; - for (int index15 = 0; index15 < num5; ++index15) - numArray4[index15] = 0.75f; - int index16 = 0; - strArray1[index16] = Lang.menu[114].Value; - if (this.selectedMenu == index16) - { - SoundEngine.PlaySound(10); - Main.menuMode = 112; - } - int index17 = index16 + 1; - strArray1[index17] = Lang.menu[210].Value; - if (this.selectedMenu == index17) - { - SoundEngine.PlaySound(10); - Main.menuMode = 1112; - } - int index18 = index17 + 1; - strArray1[index18] = Lang.menu[63].Value; - if (this.selectedMenu == index18) - { - SoundEngine.PlaySound(10); - Main.menuMode = 1111; - } - int index19 = index18 + 1; - strArray1[index19] = Lang.menu[65].Value; - if (this.selectedMenu == index19) - { - SoundEngine.PlaySound(11); - Main.menuMode = 26; - } - int index20 = index19 + 1; - strArray1[index20] = Lang.menu[218].Value; - if (this.selectedMenu == index20) - { - SoundEngine.PlaySound(10); - Main.menuMode = 1125; - } - int index21 = index20 + 1; - strArray1[index21] = Lang.menu[219].Value; - if (this.selectedMenu == index21) - { - SoundEngine.PlaySound(10); - Main.menuMode = 1127; - } - int index22 = index21 + 1; - strArray1[index22] = Lang.menu[103].Value; - if (this.selectedMenu == index22) - { - SoundEngine.PlaySound(10); - Main.menuMode = 1213; - } - int index23 = index22 + 1; - strArray1[index23] = Lang.menu[5].Value; - if (this.selectedMenu == index23 | flag5) - { - flag5 = false; - SoundEngine.PlaySound(11); - Main.menuMode = 0; - Main.SaveSettings(); - goto label_623; - } - else - goto label_623; - case 12: - int num12 = SocialAPI.Network != null ? 1 : 0; - Main.menuServer = false; - strArray1[0] = Lang.menu[SocialAPI.Network != null ? 146 : 87].Value; - strArray1[1] = Lang.menu[145].Value; - strArray1[1 + num12] = Lang.menu[88].Value; - strArray1[2 + num12] = Lang.menu[5].Value; - if (this.selectedMenu == 0) - { - Main.LoadPlayers(); - Main.menuMultiplayer = true; - SoundEngine.PlaySound(10); - Main.ClearPendingPlayerSelectCallbacks(); - Main.menuMode = 1; - } - else if (this.selectedMenu == 1 + num12) - { - Main.LoadPlayers(); - SoundEngine.PlaySound(10); - Main.ClearPendingPlayerSelectCallbacks(); - Main.menuMode = 1; - Main.menuMultiplayer = true; - Main.menuServer = true; - } - else if (this.selectedMenu == 1) - { - SoundEngine.PlaySound(10); - SocialAPI.Friends.OpenJoinInterface(); - } - else if (this.selectedMenu == 2 + num12 | flag5) - { - flag5 = false; - SoundEngine.PlaySound(11); - Main.menuMode = 0; - } - num5 = 3 + num12; - goto label_623; - case 13: - string getIp1 = Main.getIP; - PlayerInput.WritingText = true; - flag5 = false; - Main.instance.HandleIME(); - Main.getIP = Main.GetInputText(Main.getIP); - string getIp2 = Main.getIP; - if (getIp1 != getIp2) - SoundEngine.PlaySound(12); - strArray1[0] = Lang.menu[89].Value; - flagArray2[9] = true; - if (Main.getIP != "") - { - if (Main.getIP.Substring(0, 1) == " ") - Main.getIP = ""; - for (int index24 = 0; index24 < Main.getIP.Length; ++index24) - { - if (Main.getIP != " ") - flagArray2[9] = false; - } - } - ++this.textBlinkerCount; - if (this.textBlinkerCount >= 20) - { - this.textBlinkerState = this.textBlinkerState != 0 ? 0 : 1; - this.textBlinkerCount = 0; - } - strArray1[1] = Main.getIP; - if (this.textBlinkerState == 1) - { - // ISSUE: explicit reference operation - ^ref strArray1[1] += "|"; - numArray2[1] = 1; - } - else - { - // ISSUE: explicit reference operation - ^ref strArray1[1] += " "; - } - flagArray1[0] = true; - flagArray1[1] = true; - numArray1[9] = 44; - numArray1[10] = 64; - strArray1[9] = Lang.menu[4].Value; - strArray1[10] = Lang.menu[5].Value; - num5 = 11; - num2 = 180; - num4 = 30; - numArray1[1] = 19; - for (int index25 = 2; index25 < 9; ++index25) - { - int index26 = index25 - 2; - if (Main.recentWorld[index26] != null && Main.recentWorld[index26] != "") - { - strArray1[index25] = Main.recentWorld[index26] + " (" + Main.recentIP[index26] + ":" + (object) Main.recentPort[index26] + ")"; - } - else - { - strArray1[index25] = ""; - flagArray1[index25] = true; - } - numArray4[index25] = 0.6f; - numArray1[index25] = 40; - } - if (this.selectedMenu >= 2 && this.selectedMenu < 9) - { - Main.autoPass = false; - int index27 = this.selectedMenu - 2; - Netplay.ListenPort = Main.recentPort[index27]; - Main.getIP = Main.recentIP[index27]; - Netplay.SetRemoteIPAsync(Main.getIP, new Action(Main.StartClientGameplay)); - Main.menuMode = 14; - Main.statusText = Language.GetTextValue("Net.ConnectingTo", (object) Main.getIP); - } - if (this.selectedMenu == 10 | flag5) - { - flag5 = false; - SoundEngine.PlaySound(11); - Main.menuMode = 1; - } - if (this.selectedMenu == 9 || !flagArray2[2] && Main.inputTextEnter) - { - SoundEngine.PlaySound(12); - Main.menuMode = 131; - Main.clrInput(); - goto label_623; - } - else - goto label_623; - case 14: - break; - case 15: - num5 = 2; - strArray1[0] = Main.statusText; - flagArray1[0] = true; - num2 = 80; - num4 = 400; - strArray1[1] = Lang.menu[5].Value; - if (this.selectedMenu == 1 | flag5) - { - flag5 = false; - Netplay.Disconnect = true; - SoundEngine.PlaySound(11); - Main.menuMode = 0; - Main.netMode = 0; - goto label_623; - } - else - goto label_623; - case 16: - num2 = 200; - num4 = 60; - numArray1[1] = 30; - numArray1[2] = 30; - numArray1[3] = 30; - numArray1[4] = 70; - strArray1[0] = Lang.menu[91].Value; - flagArray1[0] = true; - strArray1[1] = Lang.menu[92].Value; - strArray1[2] = Lang.menu[93].Value; - strArray1[3] = Lang.menu[94].Value; - strArray1[4] = Lang.menu[5].Value; - num5 = 5; - if (this.selectedMenu == 4 | flag5) - { - flag5 = false; - Main.menuMode = 6; - SoundEngine.PlaySound(11); - goto label_623; - } - else if (this.selectedMenu > 0) - { - if (this.selectedMenu == 1) - { - Main.maxTilesX = 4200; - Main.maxTilesY = 1200; - } - else if (this.selectedMenu == 2) - { - Main.maxTilesX = 6400; - Main.maxTilesY = 1800; - } - else - { - Main.maxTilesX = 8400; - Main.maxTilesY = 2400; - } - Main.clrInput(); - Main.menuMode = -7; - SoundEngine.PlaySound(10); - WorldGen.setWorldSize(); - goto label_623; - } - else - goto label_623; - case 17: - flag4 = true; - num6 = Main.screenWidth / 2 - 16; - num7 = 210; - flag1 = true; - num8 = 390; - num2 = 260; - num4 = 60; - Main.PendingPlayer.hairColor = Main.selColor; - num5 = 3; - strArray1[0] = Lang.menu[37].Value + " " + (object) (Main.PendingPlayer.hair + 1); - strArray1[1] = Lang.menu[38].Value; - flagArray1[1] = true; - numArray1[2] = 150; - numArray1[1] = 10; - strArray1[2] = Lang.menu[5].Value; - int num13 = 51; - if (this.focusMenu == 0) - UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 9; - if (this.selectedMenu == 0) - { - SoundEngine.PlaySound(12); - ++Main.PendingPlayer.hair; - if (Main.PendingPlayer.hair >= num13) - Main.PendingPlayer.hair = 0; - } - else if (this.selectedMenu2 == 0) - { - SoundEngine.PlaySound(12); - --Main.PendingPlayer.hair; - if (Main.PendingPlayer.hair < 0) - Main.PendingPlayer.hair = num13 - 1; - } - if (this.selectedMenu == 2 | flag5) - { - flag5 = false; - Main.menuMode = 2; - SoundEngine.PlaySound(11); - goto label_623; - } - else - goto label_623; - case 18: - flag4 = true; - num6 = Main.screenWidth / 2 - 16; - num7 = 210; - flag1 = true; - num8 = 370; - num2 = 240; - num4 = 60; - Main.PendingPlayer.eyeColor = Main.selColor; - num5 = 3; - strArray1[0] = ""; - strArray1[1] = Lang.menu[39].Value; - flagArray1[1] = true; - numArray1[2] = 170; - numArray1[1] = 10; - strArray1[2] = Lang.menu[5].Value; - if (this.selectedMenu == 2 | flag5) - { - flag5 = false; - Main.menuMode = 2; - SoundEngine.PlaySound(11); - goto label_623; - } - else - goto label_623; - case 19: - flag4 = true; - num6 = Main.screenWidth / 2 - 16; - num7 = 210; - flag1 = true; - num8 = 370; - num2 = 240; - num4 = 60; - Main.PendingPlayer.skinColor = Main.selColor; - num5 = 3; - strArray1[0] = ""; - strArray1[1] = Lang.menu[40].Value; - flagArray1[1] = true; - numArray1[2] = 170; - numArray1[1] = 10; - strArray1[2] = Lang.menu[5].Value; - if (this.selectedMenu == 2 | flag5) - { - flag5 = false; - Main.menuMode = 2; - SoundEngine.PlaySound(11); - goto label_623; - } - else - goto label_623; - case 20: - flag4 = true; - if (this.selectedMenu == 0) - { - Main.menuMode = 21; - SoundEngine.PlaySound(10); - Main.selColor = Main.PendingPlayer.shirtColor; - } - if (this.selectedMenu == 1) - { - Main.menuMode = 22; - SoundEngine.PlaySound(10); - Main.selColor = Main.PendingPlayer.underShirtColor; - } - if (this.selectedMenu == 2) - { - Main.menuMode = 23; - SoundEngine.PlaySound(10); - Main.selColor = Main.PendingPlayer.pantsColor; - } - if (this.selectedMenu == 3) - { - Main.selColor = Main.PendingPlayer.shoeColor; - Main.menuMode = 24; - SoundEngine.PlaySound(10); - } - if (this.selectedMenu == 5 | flag5) - { - flag5 = false; - SoundEngine.PlaySound(11); - Main.menuMode = 2; - } - if (this.selectedMenu == 4) - { - SoundEngine.PlaySound(12); - Main.CycleClothingStyle(Main.PendingPlayer); - } - num6 = Main.screenWidth / 2 - 16; - num7 = 210; - num2 = 260; - num4 = 50; - num5 = 6; - strArray1[0] = Lang.menu[33].Value; - strArray1[1] = Lang.menu[34].Value; - strArray1[2] = Lang.menu[35].Value; - strArray1[3] = Lang.menu[36].Value; - strArray1[4] = Lang.menu[(int) sbyte.MaxValue].Value; - strArray1[5] = Lang.menu[5].Value; - numArray1[5] = 20; - goto label_623; - case 21: - flag4 = true; - num6 = Main.screenWidth / 2 - 16; - num7 = 210; - flag1 = true; - num8 = 370; - num2 = 240; - num4 = 60; - Main.PendingPlayer.shirtColor = Main.selColor; - num5 = 3; - strArray1[0] = ""; - strArray1[1] = Lang.menu[41].Value; - flagArray1[1] = true; - numArray1[2] = 170; - numArray1[1] = 10; - strArray1[2] = Lang.menu[5].Value; - if (this.selectedMenu == 2 | flag5) - { - flag5 = false; - Main.menuMode = 20; - SoundEngine.PlaySound(11); - goto label_623; - } - else - goto label_623; - case 22: - flag4 = true; - num6 = Main.screenWidth / 2 - 16; - num7 = 210; - flag1 = true; - num8 = 370; - num2 = 240; - num4 = 60; - Main.PendingPlayer.underShirtColor = Main.selColor; - num5 = 3; - strArray1[0] = ""; - strArray1[1] = Lang.menu[42].Value; - flagArray1[1] = true; - numArray1[2] = 170; - numArray1[1] = 10; - strArray1[2] = Lang.menu[5].Value; - if (this.selectedMenu == 2 | flag5) - { - flag5 = false; - Main.menuMode = 20; - SoundEngine.PlaySound(11); - goto label_623; - } - else - goto label_623; - case 23: - flag4 = true; - num6 = Main.screenWidth / 2 - 16; - num7 = 210; - flag1 = true; - num8 = 370; - num2 = 240; - num4 = 60; - Main.PendingPlayer.pantsColor = Main.selColor; - num5 = 3; - strArray1[0] = ""; - strArray1[1] = Lang.menu[43].Value; - flagArray1[1] = true; - numArray1[2] = 170; - numArray1[1] = 10; - strArray1[2] = Lang.menu[5].Value; - if (this.selectedMenu == 2 | flag5) - { - flag5 = false; - Main.menuMode = 20; - SoundEngine.PlaySound(11); - goto label_623; - } - else - goto label_623; - case 24: - flag4 = true; - num6 = Main.screenWidth / 2 - 16; - num7 = 210; - flag1 = true; - num8 = 370; - num2 = 240; - num4 = 60; - Main.PendingPlayer.shoeColor = Main.selColor; - num5 = 3; - strArray1[0] = ""; - strArray1[1] = Lang.menu[44].Value; - flagArray1[1] = true; - numArray1[2] = 170; - numArray1[1] = 10; - strArray1[2] = Lang.menu[5].Value; - if (this.selectedMenu == 2 | flag5) - { - flag5 = false; - Main.menuMode = 20; - SoundEngine.PlaySound(11); - goto label_623; - } - else - goto label_623; - case 25: - flag1 = true; - num8 = 320; - num2 = 200; - num4 = 10; - Main.mouseColor = Main.selColor; - Main.mouseColorSlider.SetHSL(Main.mouseColor); - num5 = 3; - strArray1[0] = ""; - strArray1[1] = Lang.menu[64].Value; - flagArray1[1] = true; - numArray1[2] = 250; - numArray1[1] = 10; - strArray1[2] = Lang.menu[5].Value; - if (this.selectedMenu == 2 | flag5) - { - flag5 = false; - Main.menuMode = 1125; - SoundEngine.PlaySound(11); - goto label_623; - } - else - goto label_623; - case 26: - flag2 = true; - num2 = 200; - num4 = 10; - num5 = 3; - strArray1[0] = ""; - strArray1[1] = Lang.menu[65].Value; - flagArray1[1] = true; - numArray1[2] = 250; - numArray1[1] = 10; - strArray1[2] = Lang.menu[5].Value; - if (this.selectedMenu == 2 | flag5) - { - flag5 = false; - Main.menuMode = 11; - SoundEngine.PlaySound(11); - goto label_623; - } - else - goto label_623; - case 27: - num2 = 176; - num4 = 22; - num5 = 16; - string[] strArray2 = new string[14] - { - Main.cUp, - Main.cDown, - Main.cLeft, - Main.cRight, - Main.cJump, - Main.cThrowItem, - Main.cInv, - Main.cHeal, - Main.cMana, - Main.cBuff, - Main.cHook, - Main.cTorch, - Main.cSmart, - Main.cMount - }; - if (Main.setKey >= 0) - strArray2[Main.setKey] = "_"; - strArray1[0] = Lang.menu[74].Value + strArray2[0]; - strArray1[1] = Lang.menu[75].Value + strArray2[1]; - strArray1[2] = Lang.menu[76].Value + strArray2[2]; - strArray1[3] = Lang.menu[77].Value + strArray2[3]; - strArray1[4] = Lang.menu[78].Value + strArray2[4]; - strArray1[5] = Lang.menu[79].Value + strArray2[5]; - strArray1[6] = Lang.menu[80].Value + strArray2[6]; - strArray1[7] = Lang.menu[81].Value + strArray2[7]; - strArray1[8] = Lang.menu[82].Value + strArray2[8]; - strArray1[9] = Lang.menu[83].Value + strArray2[9]; - strArray1[10] = Lang.menu[84].Value + strArray2[10]; - strArray1[11] = Lang.menu[85].Value + strArray2[11]; - strArray1[12] = Lang.menu[120].Value + strArray2[12]; - strArray1[13] = Lang.menu[130].Value + strArray2[13]; - for (int index28 = 0; index28 < 14; ++index28) - { - flagArray4[index28] = true; - numArray4[index28] = 0.45f; - numArray2[index28] = -80; - } - numArray4[14] = 0.8f; - numArray1[14] = 6; - strArray1[14] = Lang.menu[86].Value; - numArray4[15] = 0.8f; - numArray1[15] = 16; - strArray1[15] = Lang.menu[5].Value; - if (this.selectedMenu == 15 | flag5) - { - flag5 = false; - Main.menuMode = 11; - SoundEngine.PlaySound(11); - } - else if (this.selectedMenu == 14) - { - Main.ResetKeyBindings(); - Main.setKey = -1; - SoundEngine.PlaySound(11); - } - else if (this.selectedMenu >= 0) - Main.setKey = this.selectedMenu; - if (Main.setKey >= 0) - { - List pressedKeys = PlayerInput.GetPressedKeys(); - if (pressedKeys.Count > 0) - { - string str = string.Concat((object) pressedKeys[0]); - if (str != "None") - { - if (Main.setKey == 0) - Main.cUp = str; - if (Main.setKey == 1) - Main.cDown = str; - if (Main.setKey == 2) - Main.cLeft = str; - if (Main.setKey == 3) - Main.cRight = str; - if (Main.setKey == 4) - Main.cJump = str; - if (Main.setKey == 5) - Main.cThrowItem = str; - if (Main.setKey == 6) - Main.cInv = str; - if (Main.setKey == 7) - Main.cHeal = str; - if (Main.setKey == 8) - Main.cMana = str; - if (Main.setKey == 9) - Main.cBuff = str; - if (Main.setKey == 10) - Main.cHook = str; - if (Main.setKey == 11) - Main.cTorch = str; - if (Main.setKey == 12) - Main.cSmart = str; - if (Main.setKey == 13) - Main.cMount = str; - Main.setKey = -1; - goto label_623; - } - else - goto label_623; - } - else - goto label_623; - } - else - goto label_623; - case 28: - Main.caveParallax = (float) (1.0 - (double) Main.bgScroll / 500.0); - flag3 = true; - num2 = 240; - num4 = 60; - num5 = 3; - strArray1[0] = ""; - strArray1[1] = Lang.menu[52].Value; - flagArray1[1] = true; - numArray1[2] = 170; - numArray1[1] = 10; - strArray1[2] = Lang.menu[5].Value; - if (this.selectedMenu == 2 | flag5) - { - flag5 = false; - Main.menuMode = 1111; - SoundEngine.PlaySound(11); - goto label_623; - } - else - goto label_623; - case 30: - string serverPassword3 = Netplay.ServerPassword; - PlayerInput.WritingText = true; - flag5 = false; - Main.instance.HandleIME(); - Netplay.ServerPassword = Main.GetInputText(Netplay.ServerPassword); - string serverPassword4 = Netplay.ServerPassword; - if (serverPassword3 != serverPassword4) - SoundEngine.PlaySound(12); - strArray1[0] = Lang.menu[7].Value; - ++this.textBlinkerCount; - if (this.textBlinkerCount >= 20) - { - this.textBlinkerState = this.textBlinkerState != 0 ? 0 : 1; - this.textBlinkerCount = 0; - } - strArray1[1] = Netplay.ServerPassword; - if (Main.HidePassword) - { - strArray1[1] = ""; - for (int index29 = 0; index29 < Netplay.ServerPassword.Length; ++index29) - { - // ISSUE: explicit reference operation - ^ref strArray1[1] += "*"; - } - } - if (this.textBlinkerState == 1) - { - // ISSUE: explicit reference operation - ^ref strArray1[1] += "|"; - numArray2[1] = 1; - } - else - { - // ISSUE: explicit reference operation - ^ref strArray1[1] += " "; - } - flagArray1[0] = true; - flagArray1[1] = true; - numArray1[1] = -20; - numArray1[2] = 20; - strArray1[2] = Lang.menu[4].Value; - strArray1[3] = Lang.menu[5].Value; - num5 = 4; - if (this.selectedMenu == 3 | flag5) - { - flag5 = false; - Main.menuMode = SocialAPI.Network == null ? 6 : 889; - Netplay.ServerPassword = ""; - goto label_623; - } - else if (this.selectedMenu == 2 || Main.inputTextEnter || Main.autoPass) - { - string str1 = "-autoshutdown -password \"" + Main.ConvertToSafeArgument(Netplay.ServerPassword) + "\" -lang " + (object) Language.ActiveCulture.LegacyId; - string str2 = (!Main.ActiveWorldFileData.IsCloudSave ? (object) (str1 + " -world \"" + Main.worldPathName + "\"") : (object) (str1 + " -cloudworld \"" + Main.worldPathName + "\"")).ToString() + " -worldrollbackstokeep " + (object) Main.WorldRollingBackupsCountToKeep; - Main.tServer = new Process(); - Main.tServer.StartInfo.FileName = "TerrariaServer.exe"; - Main.tServer.StartInfo.Arguments = str2; - if (Main.libPath != "") - { - ProcessStartInfo startInfo = Main.tServer.StartInfo; - startInfo.Arguments = startInfo.Arguments + " -loadlib " + Main.libPath; - } - Main.tServer.StartInfo.UseShellExecute = false; - Main.tServer.StartInfo.CreateNoWindow = true; - if (SocialAPI.Network != null) - SocialAPI.Network.LaunchLocalServer(Main.tServer, Main.MenuServerMode); - else - Main.tServer.Start(); - Netplay.SetRemoteIP("127.0.0.1"); - Main.autoPass = true; - Main.statusText = Lang.menu[8].Value; - Netplay.StartTcpClient(); - Main.menuMode = 10; - goto label_623; - } - else - goto label_623; - case 100: - num5 = 1; - strArray1[0] = Main.statusText; - flagArray1[0] = true; - num2 = 300; - goto label_623; - case 111: - for (int index30 = 0; index30 < 9; ++index30) - numArray4[index30] = 0.85f; - num2 = 210; - num4 = 55; - int index31 = 0; - strArray1[index31] = Lang.menu[73].Value + ": " + (object) Main.PendingResolutionWidth + "x" + (object) Main.PendingResolutionHeight; - if (this.selectedMenu == index31) - { - SoundEngine.PlaySound(12); - int num14 = 0; - for (int index32 = 0; index32 < Main.numDisplayModes; ++index32) - { - if (Main.displayWidth[index32] == Main.PendingResolutionWidth && Main.displayHeight[index32] == Main.PendingResolutionHeight) - { - num14 = index32; - break; - } - } - int index33 = (num14 + 1) % Main.numDisplayModes; - Main.PendingResolutionWidth = Main.displayWidth[index33]; - Main.PendingResolutionHeight = Main.displayHeight[index33]; - } - int index34 = index31 + 1; - if (Main.IsBorderlessDisplayAvailable()) - { - strArray1[index34] = Lang.menu[Main.PendingBorderlessState ? 245 : 246].Value; - if (this.selectedMenu == index34) - { - SoundEngine.PlaySound(12); - Main.PendingBorderlessState = !Main.PendingBorderlessState; - } - ++index34; - } - numArray1[index34] = 100; - strArray1[index34] = Lang.menu[134].Value; - if (this.selectedMenu == index34) - { - if (Main.graphics.IsFullScreen || Main.PendingBorderlessState != Main.screenBorderless || Main.PendingResolutionWidth != Main.screenWidth || Main.PendingResolutionHeight != Main.screenHeight) - { - Main.screenBorderless = Main.PendingBorderlessState; - Main.screenBorderlessPendingResizes = Main.screenBorderless ? 6 : 0; - Main.SetResolution(Main.PendingResolutionWidth, Main.PendingResolutionHeight); - } - SoundEngine.PlaySound(11); - Main.menuMode = 1111; - } - int index35 = index34 + 1; - strArray1[index35] = Lang.menu[5].Value; - numArray1[index35] = 100; - if (this.selectedMenu == index35 | flag5) - { - flag5 = false; - Main.PendingResolutionWidth = Main.graphics.PreferredBackBufferWidth; - Main.PendingResolutionHeight = Main.graphics.PreferredBackBufferHeight; - Main.PendingBorderlessState = Main.screenBorderless; - Main.menuMode = 1111; - SoundEngine.PlaySound(11); - } - num5 = index35 + 1; - goto label_623; - case 112: - num2 = 250; - num4 = 52; - num5 = 5; - numArray1[num5 - 1] = 18; - for (int index36 = 0; index36 < num5; ++index36) - numArray4[index36] = 0.78f; - int index37 = 0; - strArray1[index37] = !Main.autoSave ? Lang.menu[68].Value : Lang.menu[67].Value; - if (this.selectedMenu == index37) - { - SoundEngine.PlaySound(12); - Main.autoSave = !Main.autoSave; - } - int index38 = index37 + 1; - strArray1[index38] = !Main.autoPause ? Lang.menu[70].Value : Lang.menu[69].Value; - if (this.selectedMenu == index38) - { - SoundEngine.PlaySound(12); - Main.autoPause = !Main.autoPause; - } - int index39 = index38 + 1; - strArray1[index39] = !Main.mapEnabled ? Lang.menu[113].Value : Lang.menu[112].Value; - if (this.selectedMenu == index39) - { - SoundEngine.PlaySound(12); - Main.mapEnabled = !Main.mapEnabled; - } - int index40 = index39 + 1; - strArray1[index40] = Main.HidePassword ? Lang.menu[212].Value : Lang.menu[211].Value; - if (this.selectedMenu == index40) - { - SoundEngine.PlaySound(12); - Main.HidePassword = !Main.HidePassword; - } - int index41 = index40 + 1; - strArray1[index41] = Lang.menu[5].Value; - if (this.selectedMenu == index41 | flag5) - { - flag5 = false; - Main.menuMode = 11; - SoundEngine.PlaySound(11); - goto label_623; - } - else - goto label_623; - case 131: - int num15 = 7777; - PlayerInput.WritingText = true; - flag5 = false; - Main.instance.HandleIME(); - string getPort1 = Main.getPort; - Main.getPort = Main.GetInputText(Main.getPort); - string getPort2 = Main.getPort; - if (getPort1 != getPort2) - SoundEngine.PlaySound(12); - strArray1[0] = Lang.menu[90].Value; - flagArray2[2] = true; - if (Main.getPort != "") - { - bool flag7 = false; try { - num15 = Convert.ToInt32(Main.getPort); - if (num15 > 0) + strArray1[index] = Netplay.Clients[index].StatusText; + if (Netplay.Clients[index].IsActive) { - if (num15 <= (int) ushort.MaxValue) - flag7 = true; + if (Main.showSpam) + { + ref string local = ref strArray1[index]; + local = local + " (" + (object) NetMessage.buffer[index].spamCount + ")"; + } } } catch { + strArray1[index] = ""; } - if (flag7) - flagArray2[2] = false; + flagArray1[index] = true; + if (strArray1[index] != "" && strArray1[index] != null) + flag6 = false; } - ++this.textBlinkerCount; - if (this.textBlinkerCount >= 20) - { - this.textBlinkerState = this.textBlinkerState != 0 ? 0 : 1; - this.textBlinkerCount = 0; - } - strArray1[1] = Main.getPort; - if (this.textBlinkerState == 1) + } + if (flag6) + { + strArray1[0] = Lang.menu[0].Value; + strArray1[1] = Lang.menu[1].Value + (object) Netplay.ListenPort + "."; + } + num5 = 11; + strArray1[9] = Main.statusText; + flagArray1[9] = true; + num2 = 170; + num4 = 30; + numArray1[10] = 20; + numArray1[10] = 40; + strArray1[10] = Lang.menu[2].Value; + if (this.selectedMenu == 10 | flag5) + { + flag5 = false; + Netplay.disconnect = true; + Main.PlaySound(11); + break; + } + break; + } + if (Main.menuMode == 31) + { + string serverPassword1 = Netplay.ServerPassword; + PlayerInput.WritingText = true; + flag5 = false; + Main.instance.HandleIME(); + Netplay.ServerPassword = Main.GetInputText(Netplay.ServerPassword); + string serverPassword2 = Netplay.ServerPassword; + if (serverPassword1 != serverPassword2) + Main.PlaySound(12); + strArray1[0] = Lang.menu[3].Value; + ++this.textBlinkerCount; + if (this.textBlinkerCount >= 20) + { + this.textBlinkerState = this.textBlinkerState != 0 ? 0 : 1; + this.textBlinkerCount = 0; + } + strArray1[1] = Netplay.ServerPassword; + if (Main.HidePassword) + { + strArray1[1] = ""; + for (int index = 0; index < Netplay.ServerPassword.Length; ++index) { // ISSUE: explicit reference operation - ^ref strArray1[1] += "|"; - numArray2[1] = 1; + ^ref strArray1[1] += "*"; } - else - { - // ISSUE: explicit reference operation - ^ref strArray1[1] += " "; - } - flagArray1[0] = true; - flagArray1[1] = true; - numArray1[1] = -20; - numArray1[2] = 20; - strArray1[2] = Lang.menu[4].Value; - strArray1[3] = Lang.menu[5].Value; - num5 = 4; - if (this.selectedMenu == 3 | flag5) - { - flag5 = false; - SoundEngine.PlaySound(11); - Main.menuMode = 1; - } - if (this.selectedMenu == 2 || !flagArray2[2] && Main.inputTextEnter) - { - Netplay.ListenPort = num15; - Main.autoPass = false; - Netplay.SetRemoteIPAsync(Main.getIP, new Action(Main.StartClientGameplay)); - Main.menuMode = 14; - Main.statusText = Language.GetTextValue("Net.ConnectingTo", (object) Main.getIP); - goto label_623; - } - else - goto label_623; - case 200: - num5 = 3; - strArray1[0] = Lang.menu[9].Value; - flagArray1[0] = true; - num2 -= 30; - numArray1[1] = 70; - numArray1[2] = 50; - strArray1[1] = Lang.menu[10].Value; - strArray1[2] = Lang.menu[6].Value; - if (this.selectedMenu == 1) - { - if (FileUtilities.Exists(Main.worldPathName + ".bak", Main.ActiveWorldFileData.IsCloudSave)) + } + if (this.textBlinkerState == 1) + { + // ISSUE: explicit reference operation + ^ref strArray1[1] += "|"; + numArray2[1] = 1; + } + else + { + // ISSUE: explicit reference operation + ^ref strArray1[1] += " "; + } + flagArray1[0] = true; + flagArray1[1] = true; + numArray1[1] = -20; + numArray1[2] = 20; + strArray1[2] = Lang.menu[4].Value; + strArray1[3] = Lang.menu[5].Value; + num5 = 4; + if (this.selectedMenu == 3 | flag5) + { + flag5 = false; + Main.PlaySound(11); + Main.menuMode = 0; + Netplay.disconnect = true; + Netplay.ServerPassword = ""; + break; + } + if (this.selectedMenu == 2 || Main.inputTextEnter) + { + NetMessage.SendData(38); + Main.menuMode = 14; + break; + } + break; + } + if (Main.netMode != 1) + { + switch (Main.menuMode) + { + case -71: + num2 = 200; + num4 = 60; + numArray1[1] = 30; + numArray1[2] = 30; + numArray1[3] = 30; + numArray1[4] = 70; + num5 = 5; + int index1 = 0; + strArray1[index1] = Lang.misc[100].Value; + flagArray1[index1] = true; + int index2 = index1 + 1; + strArray1[index2] = Lang.misc[101].Value; + if (this.selectedMenu == index2) { - FileUtilities.Move(Main.worldPathName, Main.worldPathName + ".bad", Main.ActiveWorldFileData.IsCloudSave); - FileUtilities.Move(Main.worldPathName + ".bak", Main.worldPathName, Main.ActiveWorldFileData.IsCloudSave); - SoundEngine.PlaySound(10); - WorldGen.playWorld(); - Main.menuMode = 10; + WorldGen.WorldGenParam_Evil = 0; + Main.PlaySound(10); + Main.menuMode = 7; + } + int index3 = index2 + 1; + strArray1[index3] = Lang.misc[102].Value; + if (this.selectedMenu == index3) + { + WorldGen.WorldGenParam_Evil = 1; + Main.PlaySound(10); + Main.menuMode = 7; + } + int index4 = index3 + 1; + strArray1[index4] = Lang.misc[103].Value; + if (this.selectedMenu == index4) + { + WorldGen.WorldGenParam_Evil = -1; + Main.PlaySound(10); + Main.menuMode = 7; + } + int index5 = index4 + 1; + strArray1[index5] = Language.GetTextValue("UI.Back"); + if (this.selectedMenu == index5 | flag5) + { + flag5 = false; + Main.PlaySound(11); + Main.menuMode = -7; + } + int num10 = index5 + 1; + Main.clrInput(); + goto label_627; + case -7: + num2 = 200; + num4 = 60; + numArray1[2] = 30; + numArray1[3] = 30; + numArray3[3] = (byte) 2; + numArray1[4] = 70; + if (this.focusMenu == 2) + { + strArray1[0] = Language.GetTextValue("UI.NormalDescriptionFlavor"); + strArray1[1] = Language.GetTextValue("UI.NormalDescription"); + } + else if (this.focusMenu == 3) + { + strArray1[0] = Language.GetTextValue("UI.ExpertDescriptionFlavor"); + strArray1[1] = Language.GetTextValue("UI.ExpertDescription"); } else + strArray1[0] = Lang.menu[32].Value; + flagArray1[0] = true; + flagArray1[1] = true; + strArray1[2] = Language.GetTextValue("UI.Normal"); + strArray1[3] = Language.GetTextValue("UI.Expert"); + strArray1[4] = Language.GetTextValue("UI.Back"); + num5 = 5; + if (this.selectedMenu == 2) { - SoundEngine.PlaySound(11); - Main.menuMode = 0; - Main.netMode = 0; + Main.expertMode = false; + Main.PlaySound(10); + Main.menuMode = 7; + if (Main.SettingsUnlock_WorldEvil) + Main.menuMode = -71; } - } - if (this.selectedMenu == 2 | flag5) - { - flag5 = false; - SoundEngine.PlaySound(11); - Main.menuMode = 0; + else if (this.selectedMenu == 3) + { + Main.expertMode = true; + Main.PlaySound(10); + Main.menuMode = 7; + if (Main.SettingsUnlock_WorldEvil) + Main.menuMode = -71; + } + else if (this.selectedMenu == 4 | flag5) + { + flag5 = false; + Main.PlaySound(11); + Main.menuMode = 16; + } + Main.clrInput(); + goto label_627; + case 0: + Main._blockFancyUIWhileLoading = false; + Main._pendingCharacterSelect = (Main.OnPlayerSelected) null; + DD2Event.Ongoing = false; + Main.eclipse = false; + Main.pumpkinMoon = false; + Main.snowMoon = false; + Main.ServerSideCharacter = false; + Main.menuMultiplayer = false; + Main.menuServer = false; Main.netMode = 0; - goto label_623; - } - else - goto label_623; - case 201: - num5 = 3; - strArray1[0] = Lang.menu[9].Value; - flagArray1[0] = true; - flagArray1[1] = true; - num2 -= 30; - numArray1[1] = -30; - numArray1[2] = 50; - strArray1[1] = Lang.menu[11].Value; - strArray1[2] = Lang.menu[5].Value; - if (this.selectedMenu == 2 | flag5) - { - flag5 = false; - SoundEngine.PlaySound(11); - Main.menuMode = 0; - Main.netMode = 0; - goto label_623; - } - else - goto label_623; - case 222: - strArray1[0] = this.focusMenu != 3 ? (this.focusMenu != 2 ? (this.focusMenu != 1 ? Lang.menu[32].Value : Lang.menu[31].Value) : Lang.menu[30].Value) : Lang.menu[29].Value; - num4 = 50; - numArray1[1] = 25; - numArray1[2] = 25; - numArray1[3] = 25; - flagArray1[0] = true; - strArray1[1] = Lang.menu[26].Value; - strArray1[2] = Lang.menu[25].Value; - numArray3[2] = (byte) 1; - strArray1[3] = Lang.menu[24].Value; - numArray3[3] = (byte) 2; - num5 = 4; - if (this.selectedMenu == 1) - { - Main.PendingPlayer.difficulty = (byte) 0; - Main.menuMode = 2; - goto label_623; - } - else if (this.selectedMenu == 2) - { - Main.menuMode = 2; - Main.PendingPlayer.difficulty = (byte) 1; - goto label_623; - } - else if (this.selectedMenu == 3) - { - Main.PendingPlayer.difficulty = (byte) 2; - Main.menuMode = 2; - goto label_623; - } - else - goto label_623; - case 252: - flag1 = true; - num8 = 320; - num2 = 200; - num4 = 10; - Main.MouseBorderColor = Main.selColor; - Main.mouseBorderColorSlider.SetHSL(Main.mouseColor); - num5 = 3; - strArray1[0] = ""; - strArray1[1] = Lang.menu[217].Value; - flagArray1[1] = true; - numArray1[2] = 250; - numArray1[1] = 10; - strArray1[2] = Lang.menu[5].Value; - if (this.selectedMenu == 2 | flag5) - { - flag5 = false; - Main.menuMode = 1125; - SoundEngine.PlaySound(11); - goto label_623; - } - else - goto label_623; - case 882: - num5 = 2; - flagArray1[0] = true; - num2 = 300; - strArray1[0] = Main.statusText; - strArray1[1] = Lang.menu[6].Value; - if (this.selectedMenu == 1 | flag5) - { - flag5 = false; - SoundEngine.PlaySound(11); - Main.menuMode = 0; - Main.netMode = 0; - if (SocialAPI.Network != null) + for (int index6 = 0; index6 < 12; ++index6) { - SocialAPI.Network.CancelJoin(); - goto label_623; - } - else - goto label_623; - } - else - goto label_623; - case 889: - num2 = 200; - num4 = 60; - numArray1[1] = 30; - numArray1[2] = 30; - numArray1[3] = 30; - numArray1[4] = 70; - numArray1[5] = 70; - num5 = 6; - strArray1[0] = Lang.menu[135].Value; - strArray1[4] = Lang.menu[144].Value; - strArray1[5] = Lang.menu[5].Value; - flagArray1[0] = true; - if (!Main.MenuServerMode.HasFlag((Enum) ServerMode.Lobby)) - { - Main.MenuServerMode = ServerMode.None; - flagArray1[2] = true; - flagArray1[3] = true; - strArray1[1] = Lang.menu[136].Value; - strArray1[2] = ""; - strArray1[3] = ""; - } - else - { - strArray1[1] = Lang.menu[137].Value; - if (Main.MenuServerMode.HasFlag((Enum) ServerMode.FriendsCanJoin)) - { - strArray1[2] = Lang.menu[139].Value; - strArray1[3] = !Main.MenuServerMode.HasFlag((Enum) ServerMode.FriendsOfFriends) ? Lang.menu[142].Value : Lang.menu[143].Value; - } - else - { - strArray1[2] = Lang.menu[138].Value; - strArray1[3] = !Main.MenuServerMode.HasFlag((Enum) ServerMode.FriendsOfFriends) ? Lang.menu[140].Value : Lang.menu[141].Value; - } - } - if (flag5) - { - flag5 = false; - this.selectedMenu = 5; - } - switch (this.selectedMenu) - { - case 1: - Main.MenuServerMode ^= ServerMode.Lobby; - SoundEngine.PlaySound(12); - goto label_623; - case 2: - Main.MenuServerMode ^= ServerMode.FriendsCanJoin; - SoundEngine.PlaySound(12); - goto label_623; - case 3: - Main.MenuServerMode ^= ServerMode.FriendsOfFriends; - SoundEngine.PlaySound(12); - goto label_623; - case 4: - Main.clrInput(); - Netplay.ServerPassword = ""; - Main.GetInputText(""); - Main.autoPass = false; - Main.menuMode = 30; - SoundEngine.PlaySound(10); - goto label_623; - case 5: - Main.menuMode = 6; - SoundEngine.PlaySound(11); - goto label_623; - default: - goto label_623; - } - case 1111: - Main.bgScroll = (int) Math.Round((1.0 - (double) Main.caveParallax) * 500.0); - int index42 = 0; - strArray1[index42] = Main.graphics.IsFullScreen ? Lang.menu[49].Value : Lang.menu[50].Value; - if (this.selectedMenu == index42) - Main.ToggleFullScreen(); - int index43 = index42 + 1; - strArray1[index43] = Lang.menu[51].Value; - if (this.selectedMenu == index43) - { - SoundEngine.PlaySound(10); - Main.menuMode = 111; - } - int index44 = index43 + 1; - strArray1[index44] = Lang.menu[52].Value; - if (this.selectedMenu == index44) - { - SoundEngine.PlaySound(11); - Main.menuMode = 28; - } - int index45 = index44 + 1; - strArray1[index45] = Lang.menu[247 + Main.FrameSkipMode].Value; - if (this.selectedMenu == index45) - { - SoundEngine.PlaySound(12); - ++Main.FrameSkipMode; - if (Main.FrameSkipMode < 0 || Main.FrameSkipMode > 2) - Main.FrameSkipMode = 0; - } - int index46 = index45 + 1; - strArray1[index46] = Language.GetTextValue("UI.LightMode_" + (object) Lighting.Mode); - if (this.selectedMenu == index46) - { - SoundEngine.PlaySound(12); - Lighting.NextLightMode(); - } - int index47 = index46 + 1; - switch (Main.qaStyle) - { - case 0: - strArray1[index47] = Lang.menu[59].Value; - break; - case 1: - strArray1[index47] = Lang.menu[60].Value; - break; - case 2: - strArray1[index47] = Lang.menu[61].Value; - break; - default: - strArray1[index47] = Lang.menu[62].Value; - break; - } - if (this.selectedMenu == index47) - { - SoundEngine.PlaySound(12); - if (++Main.qaStyle > 3) - Main.qaStyle = 0; - } - int index48 = index47 + 1; - strArray1[index48] = Main.BackgroundEnabled ? Lang.menu[100].Value : Lang.menu[101].Value; - if (this.selectedMenu == index48) - { - SoundEngine.PlaySound(12); - Main.BackgroundEnabled = !Main.BackgroundEnabled; - } - int index49 = index48 + 1; - strArray1[index49] = ChildSafety.Disabled ? Lang.menu[132].Value : Lang.menu[133].Value; - if (this.selectedMenu == index49) - { - SoundEngine.PlaySound(12); - ChildSafety.Disabled = !ChildSafety.Disabled; - } - int index50 = index49 + 1; - strArray1[index50] = Main.SettingsEnabled_MinersWobble ? Lang.menu[250].Value : Lang.menu[251].Value; - if (this.selectedMenu == index50) - { - SoundEngine.PlaySound(12); - Main.SettingsEnabled_MinersWobble = !Main.SettingsEnabled_MinersWobble; - } - int index51 = index50 + 1; - strArray1[index51] = Main.SettingsEnabled_TilesSwayInWind ? Language.GetTextValue("UI.TilesSwayInWindOn") : Language.GetTextValue("UI.TilesSwayInWindOff"); - if (this.selectedMenu == index51) - { - SoundEngine.PlaySound(12); - Main.SettingsEnabled_TilesSwayInWind = !Main.SettingsEnabled_TilesSwayInWind; - } - int index52 = index51 + 1; - strArray1[index52] = Language.GetTextValue("UI.Effects"); - if (this.selectedMenu == index52) - { - SoundEngine.PlaySound(11); - Main.menuMode = 2008; - } - int num16 = index52; - int index53 = num16; - strArray1[index53] = Lang.menu[5].Value; - numArray1[index53] = 8; - if (this.selectedMenu == index53 | flag5) - { - flag5 = false; - SoundEngine.PlaySound(11); - Main.SaveSettings(); - Main.menuMode = 11; - } - num2 = 186; - num4 = 30; - num5 = index53 + 1; - for (int index54 = 0; index54 < num16; ++index54) - numArray4[index54] = 0.6f; - goto label_623; - case 1112: - num2 = 210; - num4 = 36; - num5 = 9; - numArray1[num5 - 1] = 18; - for (int index55 = 0; index55 < num5; ++index55) - numArray4[index55] = 0.75f; - int index56 = 0; - strArray1[index56] = !Main.showItemText ? Lang.menu[72].Value : Lang.menu[71].Value; - if (this.selectedMenu == index56) - { - SoundEngine.PlaySound(12); - Main.showItemText = !Main.showItemText; - } - int index57 = index56 + 1; - strArray1[index57] = Lang.menu[123].Value + " " + Lang.menu[124 + Main.invasionProgressMode].Value; - if (this.selectedMenu == index57) - { - SoundEngine.PlaySound(12); - ++Main.invasionProgressMode; - if (Main.invasionProgressMode >= 3) - Main.invasionProgressMode = 0; - } - int index58 = index57 + 1; - strArray1[index58] = Main.placementPreview ? Lang.menu[128].Value : Lang.menu[129].Value; - if (this.selectedMenu == index58) - { - SoundEngine.PlaySound(12); - Main.placementPreview = !Main.placementPreview; - } - int index59 = index58 + 1; - strArray1[index59] = ItemSlot.Options.HighlightNewItems ? Lang.inter[117].Value : Lang.inter[116].Value; - if (this.selectedMenu == index59) - { - SoundEngine.PlaySound(12); - ItemSlot.Options.HighlightNewItems = !ItemSlot.Options.HighlightNewItems; - } - int index60 = index59 + 1; - strArray1[index60] = Main.MouseShowBuildingGrid ? Lang.menu[229].Value : Lang.menu[230].Value; - if (this.selectedMenu == index60) - { - SoundEngine.PlaySound(12); - Main.MouseShowBuildingGrid = !Main.MouseShowBuildingGrid; - } - int index61 = index60 + 1; - strArray1[index61] = Main.GamepadDisableInstructionsDisplay ? Lang.menu[241].Value : Lang.menu[242].Value; - if (this.selectedMenu == index61) - { - SoundEngine.PlaySound(12); - Main.GamepadDisableInstructionsDisplay = !Main.GamepadDisableInstructionsDisplay; - } - int index62 = index61 + 1; - string str3 = ""; - MinimapFrame minimapFrame1 = (MinimapFrame) null; - foreach (KeyValuePair minimapFrame2 in Main.MinimapFrames) - { - MinimapFrame minimapFrame3 = minimapFrame2.Value; - if (minimapFrame3 == Main.ActiveMinimapFrame) - { - str3 = Language.GetTextValue("UI.MinimapFrame_" + minimapFrame2.Key); - break; - } - minimapFrame1 = minimapFrame3; - } - if (minimapFrame1 == null) - minimapFrame1 = Main.MinimapFrames.Values.Last(); - strArray1[index62] = Language.GetTextValue("UI.SelectMapBorder", (object) str3); - if (this.selectedMenu == index62) - Main.ActiveMinimapFrame = minimapFrame1; - int index63 = index62 + 1; - string str4 = ""; - IPlayerResourcesDisplaySet resourcesDisplaySet1 = (IPlayerResourcesDisplaySet) null; - foreach (KeyValuePair playerResourcesSet in Main.PlayerResourcesSets) - { - IPlayerResourcesDisplaySet resourcesDisplaySet2 = playerResourcesSet.Value; - if (resourcesDisplaySet2 == Main.ActivePlayerResourcesSet) - { - str4 = Language.GetTextValue("UI.HealthManaStyle_" + playerResourcesSet.Key); - break; - } - resourcesDisplaySet1 = resourcesDisplaySet2; - } - if (resourcesDisplaySet1 == null) - resourcesDisplaySet1 = Main.PlayerResourcesSets.Values.Last(); - strArray1[index63] = Language.GetTextValue("UI.SelectHealthStyle", (object) str4); - if (this.selectedMenu == index63) - Main.ActivePlayerResourcesSet = resourcesDisplaySet1; - int index64 = index63 + 1; - strArray1[index64] = Lang.menu[5].Value; - if (this.selectedMenu == index64 | flag5) - { - flag5 = false; - Main.menuMode = 11; - SoundEngine.PlaySound(11); - goto label_623; - } - else - goto label_623; - case 1125: - num2 = 232; - num4 = 38; - num5 = 7; - numArray1[num5 - 1] = 18; - for (int index65 = 0; index65 < num5; ++index65) - numArray4[index65] = 0.73f; - int index66 = 0; - strArray1[index66] = Lang.menu[64].Value; - if (this.selectedMenu == index66) - { - SoundEngine.PlaySound(10); - Main.selColor = Main.mouseColor; - Main.mouseColorSlider.SetHSL(Main.mouseColor); - Main.menuMode = 25; - } - int index67 = index66 + 1; - strArray1[index67] = Lang.menu[217].Value; - if (this.selectedMenu == index67) - { - SoundEngine.PlaySound(10); - Main.selColor = Main.MouseBorderColor; - Main.mouseBorderColorSlider.SetHSL(Main.mouseColor); - Main.menuMode = 252; - } - int index68 = index67 + 1; - strArray1[index68] = Main.cSmartCursorModeIsToggleAndNotHold ? Lang.menu[121].Value : Lang.menu[122].Value; - if (this.selectedMenu == index68) - { - SoundEngine.PlaySound(12); - Main.cSmartCursorModeIsToggleAndNotHold = !Main.cSmartCursorModeIsToggleAndNotHold; - } - int index69 = index68 + 1; - strArray1[index69] = Player.SmartCursorSettings.SmartAxeAfterPickaxe ? Lang.menu[214].Value : Lang.menu[213].Value; - if (this.selectedMenu == index69) - { - SoundEngine.PlaySound(12); - Player.SmartCursorSettings.SmartAxeAfterPickaxe = !Player.SmartCursorSettings.SmartAxeAfterPickaxe; - } - int index70 = index69 + 1; - strArray1[index70] = Player.SmartCursorSettings.SmartBlocksEnabled ? Lang.menu[215].Value : Lang.menu[216].Value; - if (this.selectedMenu == index70) - { - SoundEngine.PlaySound(12); - Player.SmartCursorSettings.SmartBlocksEnabled = !Player.SmartCursorSettings.SmartBlocksEnabled; - } - int index71 = index70 + 1; - switch (LockOnHelper.UseMode) - { - case LockOnHelper.LockOnMode.FocusTarget: - strArray1[index71] = Lang.menu[232].Value; - break; - case LockOnHelper.LockOnMode.TargetClosest: - strArray1[index71] = Lang.menu[233].Value; - break; - case LockOnHelper.LockOnMode.ThreeDS: - strArray1[index71] = Lang.menu[234].Value; - break; - } - if (this.selectedMenu == index71) - { - SoundEngine.PlaySound(12); - LockOnHelper.CycleUseModes(); - } - int index72 = index71 + 1; - strArray1[index72] = Lang.menu[5].Value; - if (this.selectedMenu == index72 | flag5) - { - flag5 = false; - Main.menuMode = 11; - SoundEngine.PlaySound(11); - goto label_623; - } - else - goto label_623; - case 1127: - num2 = 250; - num4 = 52; - num5 = 4; - numArray1[num5 - 1] = 18; - for (int index73 = 0; index73 < num5; ++index73) - numArray4[index73] = 0.78f; - int index74 = 0; - strArray1[index74] = Main.ReversedUpDownArmorSetBonuses ? Lang.menu[220].Value : Lang.menu[221].Value; - if (this.selectedMenu == index74) - { - SoundEngine.PlaySound(12); - Main.ReversedUpDownArmorSetBonuses = !Main.ReversedUpDownArmorSetBonuses; - } - int index75 = index74 + 1; - strArray1[index75] = ItemSlot.Options.DisableLeftShiftTrashCan ? Lang.menu[224].Value : Lang.menu[223].Value; - if (this.selectedMenu == index75) - { - SoundEngine.PlaySound(12); - ItemSlot.Options.DisableLeftShiftTrashCan = !ItemSlot.Options.DisableLeftShiftTrashCan; - } - int index76 = index75 + 1; - strArray1[index76] = Lang.menu[222].Value; - if (this.selectedMenu == index76) - { - SoundEngine.PlaySound(10); - Main.MenuUI.SetState((UIState) Main.ManageControlsMenu); - Main.menuMode = 888; - } - int index77 = index76 + 1; - strArray1[index77] = Lang.menu[5].Value; - if (this.selectedMenu == index77 | flag5) - { - flag5 = false; - Main.menuMode = 11; - SoundEngine.PlaySound(11); - goto label_623; - } - else - goto label_623; - case 2008: - num2 = 240; - num4 = 60; - num5 = 6; - strArray1[0] = ""; - strArray1[1] = Language.GetTextValue("UI.Effects"); - flagArray1[1] = true; - numArray1[1] = 10; - strArray1[2] = Language.GetTextValue("GameUI.StormEffects", Main.UseStormEffects ? (object) Language.GetTextValue("GameUI.Enabled") : (object) Language.GetTextValue("GameUI.Disabled")); - numArray4[2] = 0.8f; - strArray1[3] = Language.GetTextValue("GameUI.HeatDistortion", Main.UseHeatDistortion ? (object) Language.GetTextValue("GameUI.Enabled") : (object) Language.GetTextValue("GameUI.Disabled")); - numArray4[3] = 0.8f; - string textValue; - switch (Main.WaveQuality) - { - case 1: - textValue = Language.GetTextValue("GameUI.QualityLow"); - break; - case 2: - textValue = Language.GetTextValue("GameUI.QualityMedium"); - break; - case 3: - textValue = Language.GetTextValue("GameUI.QualityHigh"); - break; - default: - textValue = Language.GetTextValue("GameUI.QualityOff"); - break; - } - strArray1[4] = Language.GetTextValue("GameUI.WaveQuality", (object) textValue); - numArray4[4] = 0.8f; - strArray1[5] = Lang.menu[5].Value; - if (this.selectedMenu == 2) - Main.UseStormEffects = !Main.UseStormEffects; - if (this.selectedMenu == 3) - Main.UseHeatDistortion = !Main.UseHeatDistortion; - if (this.selectedMenu == 4) - Main.WaveQuality = (Main.WaveQuality + 1) % 4; - if (this.selectedMenu == 5 | flag5) - { - flag5 = false; - Main.menuMode = 1111; - SoundEngine.PlaySound(11); - goto label_623; - } - else - goto label_623; - case 5000: - Main.MenuUI.SetState((UIState) new UIVirtualKeyboard(Language.GetTextValue("UI.EnterSeed"), "", new UIVirtualKeyboard.KeyboardSubmitEvent(this.OnSeedSelected), Main.CreateGoToMenuEvent(7), allowEmpty: true)); - Main.menuMode = 888; - goto label_623; - case 272727: - num2 = 200; - num4 = 30; - num5 = 14; - string[] strArray3 = new string[12] - { - Main.cMapStyle, - Main.cMapFull, - Main.cMapZoomIn, - Main.cMapZoomOut, - Main.cMapAlphaUp, - Main.cMapAlphaDown, - null, - null, - null, - null, - null, - null - }; - if (Main.setKey >= 0) - strArray3[Main.setKey] = "_"; - strArray1[0] = Lang.menu[106].Value + strArray3[0]; - strArray1[1] = Lang.menu[107].Value + strArray3[1]; - strArray1[2] = Lang.menu[108].Value + strArray3[2]; - strArray1[3] = Lang.menu[109].Value + strArray3[3]; - strArray1[4] = Lang.menu[110].Value + strArray3[4]; - strArray1[5] = Lang.menu[111].Value + strArray3[5]; - for (int index78 = 0; index78 < 6; ++index78) - { - flagArray4[index78] = true; - numArray4[index78] = 0.55f; - numArray2[index78] = -140; - } - numArray4[6] = 0.8f; - numArray4[6] = 0.8f; - numArray1[6] = 6; - strArray1[6] = Lang.menu[86].Value; - numArray1[7] = 16; - strArray1[7] = Lang.menu[5].Value; - if (this.selectedMenu == 7 | flag5) - { - flag5 = false; - Main.menuMode = 11; - SoundEngine.PlaySound(11); - } - else if (this.selectedMenu == 6) - { - Main.cMapStyle = "Tab"; - Main.cMapFull = "M"; - Main.cMapZoomIn = "Add"; - Main.cMapZoomOut = "Subtract"; - Main.cMapAlphaUp = "PageUp"; - Main.cMapAlphaDown = "PageDown"; - Main.setKey = -1; - SoundEngine.PlaySound(11); - } - else if (this.selectedMenu >= 0) - Main.setKey = this.selectedMenu; - if (Main.setKey >= 0) - { - List pressedKeys = PlayerInput.GetPressedKeys(); - if (pressedKeys.Count > 0) - { - string str5 = string.Concat((object) pressedKeys[0]); - if (str5 != "None") + string str = ""; + switch (index6) { - if (Main.setKey == 0) - Main.cMapStyle = str5; - if (Main.setKey == 1) - Main.cMapFull = str5; - if (Main.setKey == 2) - Main.cMapZoomIn = str5; - if (Main.setKey == 3) - Main.cMapZoomOut = str5; - if (Main.setKey == 4) - Main.cMapAlphaUp = str5; - if (Main.setKey == 5) - Main.cMapAlphaDown = str5; - Main.setKey = -1; - goto label_623; + case 0: + str = "Solar"; + break; + case 1: + str = "Vortex"; + break; + case 2: + str = "Nebula"; + break; + case 3: + str = "Stardust"; + break; + case 4: + str = "MoonLord"; + break; + case 5: + str = "MonolithSolar"; + break; + case 6: + str = "MonolithVortex"; + break; + case 7: + str = "MonolithNebula"; + break; + case 8: + str = "MonolithStardust"; + break; + case 9: + str = "Blizzard"; + break; + case 10: + str = "HeatDistortion"; + break; + case 11: + str = "Sandstorm"; + break; + } + if (SkyManager.Instance[str] != null && SkyManager.Instance[str].IsActive()) + SkyManager.Instance.Deactivate(str); + if (Filters.Scene[str].IsActive()) + Filters.Scene[str].Deactivate(); + } + if (Filters.Scene["BloodMoon"].IsActive()) + Filters.Scene["BloodMoon"].Deactivate(); + if (SkyManager.Instance["Martian"].IsActive()) + SkyManager.Instance["Martian"].Deactivate(); + if (SkyManager.Instance["Slime"].IsActive()) + SkyManager.Instance["Slime"].Deactivate(); + int index7 = 0; + num5 = 5; + num4 = 60; + strArray1[index7] = Lang.menu[12].Value; + if (this.selectedMenu == index7) + { + Main.PlaySound(10); + Main.menuMode = 1; + } + int index8 = index7 + 1; + strArray1[index8] = Lang.menu[13].Value; + if (this.selectedMenu == index8) + { + Main.PlaySound(10); + Main.menuMode = 12; + } + int index9 = index8 + 1; + strArray1[index9] = Lang.menu[131].Value; + if (this.selectedMenu == index9) + { + Main.PlaySound(10); + Main.MenuUI.SetState((UIState) Main.AchievementsMenu); + Main.menuMode = 888; + } + int index10 = index9 + 1; + strArray1[index10] = Lang.menu[14].Value; + if (this.selectedMenu == index10) + { + Main.PlaySound(10); + Main.menuMode = 11; + } + int index11 = index10 + 1; + strArray1[index11] = Lang.menu[15].Value; + if (this.selectedMenu == index11) + this.QuitGame(); + int num11 = index11 + 1; + goto label_627; + case 1: + Main.MenuUI.SetState((UIState) Main._characterSelectMenu); + Main.menuMode = 888; + goto label_627; + case 2: + flag4 = true; + if (this.selectedMenu == 0) + { + Main.menuMode = 17; + Main.PlaySound(10); + Main.selColor = Main.PendingPlayer.hairColor; + } + if (this.selectedMenu == 1) + { + Main.menuMode = 18; + Main.PlaySound(10); + Main.selColor = Main.PendingPlayer.eyeColor; + } + if (this.selectedMenu == 2) + { + Main.menuMode = 19; + Main.PlaySound(10); + Main.selColor = Main.PendingPlayer.skinColor; + } + if (this.selectedMenu == 3) + { + Main.menuMode = 20; + Main.PlaySound(10); + } + strArray1[0] = Lang.menu[18].Value; + strArray1[1] = Lang.menu[19].Value; + strArray1[2] = Lang.menu[20].Value; + strArray1[3] = Lang.menu[21].Value; + num2 = 220; + for (int index12 = 0; index12 < 9; ++index12) + numArray4[index12] = index12 >= 6 ? 0.9f : 0.75f; + num4 = 38; + numArray1[6] = 6; + numArray1[7] = 12; + numArray1[8] = 18; + num6 = Main.screenWidth / 2 - 16; + num7 = 176; + strArray1[4] = !Main.PendingPlayer.Male ? Lang.menu[23].Value : Lang.menu[22].Value; + if (this.selectedMenu == 4) + { + if (Main.PendingPlayer.Male) + { + Main.PlaySound(20); + Main.PendingPlayer.Male = false; } else - goto label_623; + { + Main.PlaySound(1); + Main.PendingPlayer.Male = true; + } + } + if (Main.PendingPlayer.difficulty == (byte) 2) + { + strArray1[5] = Lang.menu[24].Value; + numArray3[5] = Main.PendingPlayer.difficulty; + } + else if (Main.PendingPlayer.difficulty == (byte) 1) + { + strArray1[5] = Lang.menu[25].Value; + numArray3[5] = Main.PendingPlayer.difficulty; } else - goto label_623; - } - else - goto label_623; - case 1000000: - num5 = 2; - strArray1[0] = Main.statusText; - flagArray1[0] = true; - num2 = 220; - num4 = 250; - strArray1[1] = Lang.menu[5].Value; - if (this.selectedMenu == 1 | flag5) - { + strArray1[5] = Lang.menu[26].Value; + if (this.selectedMenu == 5) + { + Main.PlaySound(10); + Main.menuMode = 222; + } + if (this.selectedMenu == 7) + { + Main.PlaySound(12); + Main.PendingPlayer.hair = Main.rand.Next(51); + Main.PendingPlayer.eyeColor = this.randColor(); + while ((int) Main.PendingPlayer.eyeColor.R + (int) Main.PendingPlayer.eyeColor.G + (int) Main.PendingPlayer.eyeColor.B > 300) + Main.PendingPlayer.eyeColor = this.randColor(); + Main.PendingPlayer.hairColor = this.randColor(); + Main.PendingPlayer.pantsColor = this.randColor(); + Main.PendingPlayer.shirtColor = this.randColor(); + Main.PendingPlayer.shoeColor = this.randColor(); + Main.PendingPlayer.skinColor = this.randColor(); + float num12 = (float) Main.rand.Next(60, 120) * 0.01f; + if ((double) num12 > 1.0) + num12 = 1f; + Main.PendingPlayer.skinColor.R = (byte) ((double) Main.rand.Next(240, (int) byte.MaxValue) * (double) num12); + Main.PendingPlayer.skinColor.G = (byte) ((double) Main.rand.Next(110, 140) * (double) num12); + Main.PendingPlayer.skinColor.B = (byte) ((double) Main.rand.Next(75, 110) * (double) num12); + Main.PendingPlayer.underShirtColor = this.randColor(); + switch (Main.PendingPlayer.hair + 1) + { + case 5: + case 6: + case 7: + case 10: + case 12: + case 19: + case 22: + case 23: + case 26: + case 27: + case 30: + case 33: + Main.PendingPlayer.Male = false; + break; + default: + Main.PendingPlayer.Male = true; + break; + } + Main.PendingPlayer.skinVariant = Main.rand.Next(10); + } + strArray1[7] = Lang.menu[27].Value; + strArray1[6] = Lang.menu[28].Value; + strArray1[8] = Lang.menu[5].Value; + num5 = 9; + if (this.selectedMenu == 8 | flag5) + { + flag5 = false; + Main.PlaySound(11); + Main.menuMode = 1; + goto label_627; + } + else if (this.selectedMenu == 6) + { + Main.PlaySound(10); + Main.PendingPlayer.name = ""; + Main.menuMode = 3; + Main.clrInput(); + goto label_627; + } + else + goto label_627; + case 3: + Main.MenuUI.SetState((UIState) new UIVirtualKeyboard(Lang.menu[45].Value, "", new UIVirtualKeyboard.KeyboardSubmitEvent(this.OnCharacterNamed), Main.CreateGoToMenuEvent(2))); + Main.menuMode = 888; + goto label_627; + case 5: + strArray1[0] = Lang.menu[46].Value + " " + Main.PlayerList[Main.selectedPlayer].Player.name + "?"; + flagArray1[0] = true; + strArray1[1] = Lang.menu[104].Value; + strArray1[2] = Lang.menu[105].Value; + num5 = 3; + if (this.selectedMenu == 1) + { + Main.ErasePlayer(Main.selectedPlayer); + Main.PlaySound(10); + Main.menuMode = 1; + goto label_627; + } + else if (this.selectedMenu == 2 | flag5) + { + flag5 = false; + Main.PlaySound(11); + Main.menuMode = 1; + goto label_627; + } + else + goto label_627; + case 6: + Main.MenuUI.SetState((UIState) Main._worldSelectMenu); + Main.menuMode = 888; + goto label_627; + case 7: + Main.MenuUI.SetState((UIState) new UIVirtualKeyboard(Lang.menu[48].Value, "", new UIVirtualKeyboard.KeyboardSubmitEvent(this.OnWorldNamed), Main.CreateGoToMenuEvent(-7))); + Main.menuMode = 888; + goto label_627; + case 8: + num2 = 180; + num4 = 40; + num5 = 8; + numArray1[7] += 30; + for (int index13 = 0; index13 < num5; ++index13) + numArray4[index13] = 0.8f; + strArray1[7] = Lang.menu[5].Value; + for (int index14 = 0; index14 < 7; ++index14) + { + if (index14 < Main.WorldList.Count) + { + strArray1[index14] = Main.WorldList[index14 + Main.menuSkip].Name; + if (Main.WorldList[index14 + Main.menuSkip].IsExpertMode) + numArray3[index14] = (byte) 2; + } + else + strArray1[index14] = (string) null; + } + if (Main.WorldList.Count > 7 + Main.menuSkip) + { + strArray1[6] = Language.GetTextValue("UI.More"); + strArray1[6] = "▼"; + numArray4[6] = 0.6f; + numArray1[6] += 8; + this.menuWide[6] = true; + } + if (Main.menuSkip > 0) + { + strArray1[0] = "▲"; + numArray4[0] = 0.6f; + numArray1[0] += 8; + this.menuWide[0] = true; + } + if (this.selectedMenu == 0 && Main.menuSkip > 0) + { + Main.PlaySound(12); + Main.menuSkip -= 5; + if (Main.menuSkip < 0) + { + Main.menuSkip = 0; + goto label_627; + } + else + goto label_627; + } + else if (this.selectedMenu == 6 && Main.menuSkip < Main.WorldList.Count - 7) + { + Main.PlaySound(12); + Main.menuSkip += 5; + if (Main.menuSkip >= Main.PlayerList.Count - 7) + { + Main.menuSkip = Main.WorldList.Count - 7; + goto label_627; + } + else + goto label_627; + } + else if (this.selectedMenu == 7 | flag5) + { + flag5 = false; + Main.PlaySound(11); + Main.menuMode = 6; + goto label_627; + } + else if (this.selectedMenu >= 0) + { + Main.selectedWorld = this.selectedMenu + Main.menuSkip; + Main.PlaySound(10); + Main.menuMode = 9; + goto label_627; + } + else + goto label_627; + case 9: + strArray1[0] = Lang.menu[46].Value + " " + Main.WorldList[Main.selectedWorld].Name + "?"; + flagArray1[0] = true; + strArray1[1] = Lang.menu[104].Value; + strArray1[2] = Lang.menu[105].Value; + num5 = 3; + if (this.selectedMenu == 1) + { + Main.EraseWorld(Main.selectedWorld); + Main.PlaySound(10); + Main.menuMode = 6; + goto label_627; + } + else if (this.selectedMenu == 2 | flag5) + { + Main.PlaySound(11); + Main.menuMode = 6; + goto label_627; + } + else + goto label_627; + case 10: + num5 = 1; + strArray1[0] = Main.statusText; + flagArray1[0] = true; + num2 = 300; + goto label_627; + case 11: + num2 = 210; + num4 = 37; + num5 = 8; + numArray1[num5 - 1] = 8; + for (int index15 = 0; index15 < num5; ++index15) + numArray4[index15] = 0.75f; + int index16 = 0; + strArray1[index16] = Lang.menu[114].Value; + if (this.selectedMenu == index16) + { + Main.PlaySound(10); + Main.menuMode = 112; + } + int index17 = index16 + 1; + strArray1[index17] = Lang.menu[210].Value; + if (this.selectedMenu == index17) + { + Main.PlaySound(10); + Main.menuMode = 1112; + } + int index18 = index17 + 1; + strArray1[index18] = Lang.menu[63].Value; + if (this.selectedMenu == index18) + { + Main.PlaySound(10); + Main.menuMode = 1111; + } + int index19 = index18 + 1; + strArray1[index19] = Lang.menu[65].Value; + if (this.selectedMenu == index19) + { + Main.PlaySound(11); + Main.menuMode = 26; + } + int index20 = index19 + 1; + strArray1[index20] = Lang.menu[218].Value; + if (this.selectedMenu == index20) + { + Main.PlaySound(10); + Main.menuMode = 1125; + } + int index21 = index20 + 1; + strArray1[index21] = Lang.menu[219].Value; + if (this.selectedMenu == index21) + { + Main.PlaySound(10); + Main.menuMode = 1127; + } + int index22 = index21 + 1; + strArray1[index22] = Lang.menu[103].Value; + if (this.selectedMenu == index22) + { + Main.PlaySound(10); + Main.menuMode = 1213; + } + int index23 = index22 + 1; + strArray1[index23] = Lang.menu[5].Value; + if (this.selectedMenu == index23 | flag5) + { + flag5 = false; + Main.PlaySound(11); + Main.menuMode = 0; + Main.SaveSettings(); + goto label_627; + } + else + goto label_627; + case 12: + int num13 = SocialAPI.Network != null ? 1 : 0; + Main.menuServer = false; + strArray1[0] = Lang.menu[SocialAPI.Network != null ? 146 : 87].Value; + strArray1[1] = Lang.menu[145].Value; + strArray1[1 + num13] = Lang.menu[88].Value; + strArray1[2 + num13] = Lang.menu[5].Value; + if (this.selectedMenu == 0) + { + Main.LoadPlayers(); + Main.menuMultiplayer = true; + Main.PlaySound(10); + Main.menuMode = 1; + } + else if (this.selectedMenu == 1 + num13) + { + Main.LoadPlayers(); + Main.PlaySound(10); + Main.menuMode = 1; + Main.menuMultiplayer = true; + Main.menuServer = true; + } + else if (this.selectedMenu == 1) + { + Main.PlaySound(10); + SocialAPI.Friends.OpenJoinInterface(); + } + else if (this.selectedMenu == 2 + num13 | flag5) + { + flag5 = false; + Main.PlaySound(11); + Main.menuMode = 0; + } + num5 = 3 + num13; + goto label_627; + case 13: + string getIp1 = Main.getIP; + PlayerInput.WritingText = true; flag5 = false; - SoundEngine.PlaySound(11); - Main.menuMode = 6; - Main.netMode = 0; - goto label_623; - } - else - goto label_623; - default: - goto label_623; + Main.instance.HandleIME(); + Main.getIP = Main.GetInputText(Main.getIP); + string getIp2 = Main.getIP; + if (getIp1 != getIp2) + Main.PlaySound(12); + strArray1[0] = Lang.menu[89].Value; + flagArray2[9] = true; + if (Main.getIP != "") + { + if (Main.getIP.Substring(0, 1) == " ") + Main.getIP = ""; + for (int index24 = 0; index24 < Main.getIP.Length; ++index24) + { + if (Main.getIP != " ") + flagArray2[9] = false; + } + } + ++this.textBlinkerCount; + if (this.textBlinkerCount >= 20) + { + this.textBlinkerState = this.textBlinkerState != 0 ? 0 : 1; + this.textBlinkerCount = 0; + } + strArray1[1] = Main.getIP; + if (this.textBlinkerState == 1) + { + // ISSUE: explicit reference operation + ^ref strArray1[1] += "|"; + numArray2[1] = 1; + } + else + { + // ISSUE: explicit reference operation + ^ref strArray1[1] += " "; + } + flagArray1[0] = true; + flagArray1[1] = true; + numArray1[9] = 44; + numArray1[10] = 64; + strArray1[9] = Lang.menu[4].Value; + strArray1[10] = Lang.menu[5].Value; + num5 = 11; + num2 = 180; + num4 = 30; + numArray1[1] = 19; + for (int index25 = 2; index25 < 9; ++index25) + { + int index26 = index25 - 2; + if (Main.recentWorld[index26] != null && Main.recentWorld[index26] != "") + { + strArray1[index25] = Main.recentWorld[index26] + " (" + Main.recentIP[index26] + ":" + (object) Main.recentPort[index26] + ")"; + } + else + { + strArray1[index25] = ""; + flagArray1[index25] = true; + } + numArray4[index25] = 0.6f; + numArray1[index25] = 40; + } + if (this.selectedMenu >= 2 && this.selectedMenu < 9) + { + Main.autoPass = false; + int index27 = this.selectedMenu - 2; + Netplay.ListenPort = Main.recentPort[index27]; + Main.getIP = Main.recentIP[index27]; + if (Netplay.SetRemoteIP(Main.getIP)) + { + Main.menuMode = 10; + Netplay.StartTcpClient(); + } + } + if (this.selectedMenu == 10 | flag5) + { + flag5 = false; + Main.PlaySound(11); + Main.menuMode = 1; + } + if (this.selectedMenu == 9 || !flagArray2[2] && Main.inputTextEnter) + { + Main.PlaySound(12); + Main.menuMode = 131; + Main.clrInput(); + goto label_627; + } + else + goto label_627; + case 14: + break; + case 15: + num5 = 2; + strArray1[0] = Main.statusText; + flagArray1[0] = true; + num2 = 80; + num4 = 400; + strArray1[1] = Lang.menu[5].Value; + if (this.selectedMenu == 1 | flag5) + { + flag5 = false; + Netplay.disconnect = true; + Main.PlaySound(11); + Main.menuMode = 0; + Main.netMode = 0; + goto label_627; + } + else + goto label_627; + case 16: + num2 = 200; + num4 = 60; + numArray1[1] = 30; + numArray1[2] = 30; + numArray1[3] = 30; + numArray1[4] = 70; + strArray1[0] = Lang.menu[91].Value; + flagArray1[0] = true; + strArray1[1] = Lang.menu[92].Value; + strArray1[2] = Lang.menu[93].Value; + strArray1[3] = Lang.menu[94].Value; + strArray1[4] = Lang.menu[5].Value; + num5 = 5; + if (this.selectedMenu == 4 | flag5) + { + flag5 = false; + Main.menuMode = 6; + Main.PlaySound(11); + goto label_627; + } + else if (this.selectedMenu > 0) + { + if (this.selectedMenu == 1) + { + Main.maxTilesX = 4200; + Main.maxTilesY = 1200; + } + else if (this.selectedMenu == 2) + { + Main.maxTilesX = 6400; + Main.maxTilesY = 1800; + } + else + { + Main.maxTilesX = 8400; + Main.maxTilesY = 2400; + } + Main.clrInput(); + Main.menuMode = -7; + Main.PlaySound(10); + WorldGen.setWorldSize(); + goto label_627; + } + else + goto label_627; + case 17: + flag4 = true; + num6 = Main.screenWidth / 2 - 16; + num7 = 210; + flag1 = true; + num8 = 390; + num2 = 260; + num4 = 60; + Main.PendingPlayer.hairColor = Main.selColor; + num5 = 3; + strArray1[0] = Lang.menu[37].Value + " " + (object) (Main.PendingPlayer.hair + 1); + strArray1[1] = Lang.menu[38].Value; + flagArray1[1] = true; + numArray1[2] = 150; + numArray1[1] = 10; + strArray1[2] = Lang.menu[5].Value; + int num14 = 51; + if (this.focusMenu == 0) + UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 9; + if (this.selectedMenu == 0) + { + Main.PlaySound(12); + ++Main.PendingPlayer.hair; + if (Main.PendingPlayer.hair >= num14) + Main.PendingPlayer.hair = 0; + } + else if (this.selectedMenu2 == 0) + { + Main.PlaySound(12); + --Main.PendingPlayer.hair; + if (Main.PendingPlayer.hair < 0) + Main.PendingPlayer.hair = num14 - 1; + } + if (this.selectedMenu == 2 | flag5) + { + flag5 = false; + Main.menuMode = 2; + Main.PlaySound(11); + goto label_627; + } + else + goto label_627; + case 18: + flag4 = true; + num6 = Main.screenWidth / 2 - 16; + num7 = 210; + flag1 = true; + num8 = 370; + num2 = 240; + num4 = 60; + Main.PendingPlayer.eyeColor = Main.selColor; + num5 = 3; + strArray1[0] = ""; + strArray1[1] = Lang.menu[39].Value; + flagArray1[1] = true; + numArray1[2] = 170; + numArray1[1] = 10; + strArray1[2] = Lang.menu[5].Value; + if (this.selectedMenu == 2 | flag5) + { + flag5 = false; + Main.menuMode = 2; + Main.PlaySound(11); + goto label_627; + } + else + goto label_627; + case 19: + flag4 = true; + num6 = Main.screenWidth / 2 - 16; + num7 = 210; + flag1 = true; + num8 = 370; + num2 = 240; + num4 = 60; + Main.PendingPlayer.skinColor = Main.selColor; + num5 = 3; + strArray1[0] = ""; + strArray1[1] = Lang.menu[40].Value; + flagArray1[1] = true; + numArray1[2] = 170; + numArray1[1] = 10; + strArray1[2] = Lang.menu[5].Value; + if (this.selectedMenu == 2 | flag5) + { + flag5 = false; + Main.menuMode = 2; + Main.PlaySound(11); + goto label_627; + } + else + goto label_627; + case 20: + flag4 = true; + if (this.selectedMenu == 0) + { + Main.menuMode = 21; + Main.PlaySound(10); + Main.selColor = Main.PendingPlayer.shirtColor; + } + if (this.selectedMenu == 1) + { + Main.menuMode = 22; + Main.PlaySound(10); + Main.selColor = Main.PendingPlayer.underShirtColor; + } + if (this.selectedMenu == 2) + { + Main.menuMode = 23; + Main.PlaySound(10); + Main.selColor = Main.PendingPlayer.pantsColor; + } + if (this.selectedMenu == 3) + { + Main.selColor = Main.PendingPlayer.shoeColor; + Main.menuMode = 24; + Main.PlaySound(10); + } + if (this.selectedMenu == 5 | flag5) + { + flag5 = false; + Main.PlaySound(11); + Main.menuMode = 2; + } + if (this.selectedMenu == 4) + { + Main.PlaySound(12); + Main.CycleClothingStyle(Main.PendingPlayer); + } + num6 = Main.screenWidth / 2 - 16; + num7 = 210; + num2 = 260; + num4 = 50; + num5 = 6; + strArray1[0] = Lang.menu[33].Value; + strArray1[1] = Lang.menu[34].Value; + strArray1[2] = Lang.menu[35].Value; + strArray1[3] = Lang.menu[36].Value; + strArray1[4] = Lang.menu[(int) sbyte.MaxValue].Value; + strArray1[5] = Lang.menu[5].Value; + numArray1[5] = 20; + goto label_627; + case 21: + flag4 = true; + num6 = Main.screenWidth / 2 - 16; + num7 = 210; + flag1 = true; + num8 = 370; + num2 = 240; + num4 = 60; + Main.PendingPlayer.shirtColor = Main.selColor; + num5 = 3; + strArray1[0] = ""; + strArray1[1] = Lang.menu[41].Value; + flagArray1[1] = true; + numArray1[2] = 170; + numArray1[1] = 10; + strArray1[2] = Lang.menu[5].Value; + if (this.selectedMenu == 2 | flag5) + { + flag5 = false; + Main.menuMode = 20; + Main.PlaySound(11); + goto label_627; + } + else + goto label_627; + case 22: + flag4 = true; + num6 = Main.screenWidth / 2 - 16; + num7 = 210; + flag1 = true; + num8 = 370; + num2 = 240; + num4 = 60; + Main.PendingPlayer.underShirtColor = Main.selColor; + num5 = 3; + strArray1[0] = ""; + strArray1[1] = Lang.menu[42].Value; + flagArray1[1] = true; + numArray1[2] = 170; + numArray1[1] = 10; + strArray1[2] = Lang.menu[5].Value; + if (this.selectedMenu == 2 | flag5) + { + flag5 = false; + Main.menuMode = 20; + Main.PlaySound(11); + goto label_627; + } + else + goto label_627; + case 23: + flag4 = true; + num6 = Main.screenWidth / 2 - 16; + num7 = 210; + flag1 = true; + num8 = 370; + num2 = 240; + num4 = 60; + Main.PendingPlayer.pantsColor = Main.selColor; + num5 = 3; + strArray1[0] = ""; + strArray1[1] = Lang.menu[43].Value; + flagArray1[1] = true; + numArray1[2] = 170; + numArray1[1] = 10; + strArray1[2] = Lang.menu[5].Value; + if (this.selectedMenu == 2 | flag5) + { + flag5 = false; + Main.menuMode = 20; + Main.PlaySound(11); + goto label_627; + } + else + goto label_627; + case 24: + flag4 = true; + num6 = Main.screenWidth / 2 - 16; + num7 = 210; + flag1 = true; + num8 = 370; + num2 = 240; + num4 = 60; + Main.PendingPlayer.shoeColor = Main.selColor; + num5 = 3; + strArray1[0] = ""; + strArray1[1] = Lang.menu[44].Value; + flagArray1[1] = true; + numArray1[2] = 170; + numArray1[1] = 10; + strArray1[2] = Lang.menu[5].Value; + if (this.selectedMenu == 2 | flag5) + { + flag5 = false; + Main.menuMode = 20; + Main.PlaySound(11); + goto label_627; + } + else + goto label_627; + case 25: + flag1 = true; + num8 = 320; + num2 = 200; + num4 = 10; + Main.mouseColor = Main.selColor; + Main.mouseColorSlider.SetHSL(Main.mouseColor); + num5 = 3; + strArray1[0] = ""; + strArray1[1] = Lang.menu[64].Value; + flagArray1[1] = true; + numArray1[2] = 250; + numArray1[1] = 10; + strArray1[2] = Lang.menu[5].Value; + if (this.selectedMenu == 2 | flag5) + { + flag5 = false; + Main.menuMode = 1125; + Main.PlaySound(11); + goto label_627; + } + else + goto label_627; + case 26: + flag2 = true; + num2 = 200; + num4 = 10; + num5 = 3; + strArray1[0] = ""; + strArray1[1] = Lang.menu[65].Value; + flagArray1[1] = true; + numArray1[2] = 250; + numArray1[1] = 10; + strArray1[2] = Lang.menu[5].Value; + if (this.selectedMenu == 2 | flag5) + { + flag5 = false; + Main.menuMode = 11; + Main.PlaySound(11); + goto label_627; + } + else + goto label_627; + case 27: + num2 = 176; + num4 = 22; + num5 = 16; + string[] strArray2 = new string[14] + { + Main.cUp, + Main.cDown, + Main.cLeft, + Main.cRight, + Main.cJump, + Main.cThrowItem, + Main.cInv, + Main.cHeal, + Main.cMana, + Main.cBuff, + Main.cHook, + Main.cTorch, + Main.cSmart, + Main.cMount + }; + if (Main.setKey >= 0) + strArray2[Main.setKey] = "_"; + strArray1[0] = Lang.menu[74].Value + strArray2[0]; + strArray1[1] = Lang.menu[75].Value + strArray2[1]; + strArray1[2] = Lang.menu[76].Value + strArray2[2]; + strArray1[3] = Lang.menu[77].Value + strArray2[3]; + strArray1[4] = Lang.menu[78].Value + strArray2[4]; + strArray1[5] = Lang.menu[79].Value + strArray2[5]; + strArray1[6] = Lang.menu[80].Value + strArray2[6]; + strArray1[7] = Lang.menu[81].Value + strArray2[7]; + strArray1[8] = Lang.menu[82].Value + strArray2[8]; + strArray1[9] = Lang.menu[83].Value + strArray2[9]; + strArray1[10] = Lang.menu[84].Value + strArray2[10]; + strArray1[11] = Lang.menu[85].Value + strArray2[11]; + strArray1[12] = Lang.menu[120].Value + strArray2[12]; + strArray1[13] = Lang.menu[130].Value + strArray2[13]; + for (int index28 = 0; index28 < 14; ++index28) + { + flagArray4[index28] = true; + numArray4[index28] = 0.45f; + numArray2[index28] = -80; + } + numArray4[14] = 0.8f; + numArray1[14] = 6; + strArray1[14] = Lang.menu[86].Value; + numArray4[15] = 0.8f; + numArray1[15] = 16; + strArray1[15] = Lang.menu[5].Value; + if (this.selectedMenu == 15 | flag5) + { + flag5 = false; + Main.menuMode = 11; + Main.PlaySound(11); + } + else if (this.selectedMenu == 14) + { + Main.ResetKeyBindings(); + Main.setKey = -1; + Main.PlaySound(11); + } + else if (this.selectedMenu >= 0) + Main.setKey = this.selectedMenu; + if (Main.setKey >= 0) + { + Microsoft.Xna.Framework.Input.Keys[] pressedKeys = Main.keyState.GetPressedKeys(); + if (pressedKeys.Length != 0) + { + string str = string.Concat((object) pressedKeys[0]); + if (str != "None") + { + if (Main.setKey == 0) + Main.cUp = str; + if (Main.setKey == 1) + Main.cDown = str; + if (Main.setKey == 2) + Main.cLeft = str; + if (Main.setKey == 3) + Main.cRight = str; + if (Main.setKey == 4) + Main.cJump = str; + if (Main.setKey == 5) + Main.cThrowItem = str; + if (Main.setKey == 6) + Main.cInv = str; + if (Main.setKey == 7) + Main.cHeal = str; + if (Main.setKey == 8) + Main.cMana = str; + if (Main.setKey == 9) + Main.cBuff = str; + if (Main.setKey == 10) + Main.cHook = str; + if (Main.setKey == 11) + Main.cTorch = str; + if (Main.setKey == 12) + Main.cSmart = str; + if (Main.setKey == 13) + Main.cMount = str; + Main.setKey = -1; + goto label_627; + } + else + goto label_627; + } + else + goto label_627; + } + else + goto label_627; + case 28: + Main.caveParallax = (float) (1.0 - (double) Main.bgScroll / 500.0); + flag3 = true; + num2 = 240; + num4 = 60; + num5 = 3; + strArray1[0] = ""; + strArray1[1] = Lang.menu[52].Value; + flagArray1[1] = true; + numArray1[2] = 170; + numArray1[1] = 10; + strArray1[2] = Lang.menu[5].Value; + if (this.selectedMenu == 2 | flag5) + { + flag5 = false; + Main.menuMode = 1111; + Main.PlaySound(11); + goto label_627; + } + else + goto label_627; + case 30: + string serverPassword3 = Netplay.ServerPassword; + PlayerInput.WritingText = true; + flag5 = false; + Main.instance.HandleIME(); + Netplay.ServerPassword = Main.GetInputText(Netplay.ServerPassword); + string serverPassword4 = Netplay.ServerPassword; + if (serverPassword3 != serverPassword4) + Main.PlaySound(12); + strArray1[0] = Lang.menu[7].Value; + ++this.textBlinkerCount; + if (this.textBlinkerCount >= 20) + { + this.textBlinkerState = this.textBlinkerState != 0 ? 0 : 1; + this.textBlinkerCount = 0; + } + strArray1[1] = Netplay.ServerPassword; + if (Main.HidePassword) + { + strArray1[1] = ""; + for (int index29 = 0; index29 < Netplay.ServerPassword.Length; ++index29) + { + // ISSUE: explicit reference operation + ^ref strArray1[1] += "*"; + } + } + if (this.textBlinkerState == 1) + { + // ISSUE: explicit reference operation + ^ref strArray1[1] += "|"; + numArray2[1] = 1; + } + else + { + // ISSUE: explicit reference operation + ^ref strArray1[1] += " "; + } + flagArray1[0] = true; + flagArray1[1] = true; + numArray1[1] = -20; + numArray1[2] = 20; + strArray1[2] = Lang.menu[4].Value; + strArray1[3] = Lang.menu[5].Value; + num5 = 4; + if (this.selectedMenu == 3 | flag5) + { + flag5 = false; + Main.menuMode = SocialAPI.Network == null ? 6 : 889; + Netplay.ServerPassword = ""; + goto label_627; + } + else if (this.selectedMenu == 2 || Main.inputTextEnter || Main.autoPass) + { + string str1 = "-autoshutdown -password \"" + Netplay.ServerPassword + "\" -lang " + (object) Language.ActiveCulture.LegacyId; + string str2 = !Main.ActiveWorldFileData.IsCloudSave ? str1 + " -world \"" + Main.worldPathName + "\"" : str1 + " -cloudworld \"" + Main.worldPathName + "\""; + this.tServer.StartInfo.FileName = "TerrariaServer.exe"; + this.tServer.StartInfo.Arguments = str2; + if (Main.libPath != "") + { + ProcessStartInfo startInfo = this.tServer.StartInfo; + startInfo.Arguments = startInfo.Arguments + " -loadlib " + Main.libPath; + } + this.tServer.StartInfo.UseShellExecute = false; + this.tServer.StartInfo.CreateNoWindow = true; + if (SocialAPI.Network != null) + SocialAPI.Network.LaunchLocalServer(this.tServer, Main.MenuServerMode); + else + this.tServer.Start(); + Netplay.SetRemoteIP("127.0.0.1"); + Main.autoPass = true; + Main.statusText = Lang.menu[8].Value; + Netplay.StartTcpClient(); + Main.menuMode = 10; + goto label_627; + } + else + goto label_627; + case 100: + num5 = 1; + strArray1[0] = Main.statusText; + flagArray1[0] = true; + num2 = 300; + goto label_627; + case 111: + for (int index30 = 0; index30 < 9; ++index30) + numArray4[index30] = 0.85f; + bool flag7 = true; + System.Drawing.Rectangle bounds = Screen.FromPoint(((Form) Control.FromHandle(Main.instance.Window.Handle)).Location).Bounds; + if (bounds.Width > Main.maxScreenW || bounds.Height > Main.maxScreenH) + flag7 = false; + num2 = 210; + num4 = 55; + int index31 = 0; + strArray1[index31] = Lang.menu[73].Value + ": " + (object) Main.PendingResolutionWidth + "x" + (object) Main.PendingResolutionHeight; + if (this.selectedMenu == index31) + { + Main.PlaySound(12); + int num15 = 0; + for (int index32 = 0; index32 < Main.numDisplayModes; ++index32) + { + if (Main.displayWidth[index32] == Main.PendingResolutionWidth && Main.displayHeight[index32] == Main.PendingResolutionHeight) + { + num15 = index32; + break; + } + } + int index33 = (num15 + 1) % Main.numDisplayModes; + Main.PendingResolutionWidth = Main.displayWidth[index33]; + Main.PendingResolutionHeight = Main.displayHeight[index33]; + } + int index34 = index31 + 1; + if (flag7) + { + strArray1[index34] = Lang.menu[Main.PendingBorderlessState ? 245 : 246].Value; + if (this.selectedMenu == index34) + { + Main.PlaySound(12); + Main.PendingBorderlessState = !Main.PendingBorderlessState; + } + ++index34; + } + numArray1[index34] = 100; + strArray1[index34] = Lang.menu[134].Value; + if (this.selectedMenu == index34) + { + if (Main.graphics.IsFullScreen || Main.PendingBorderlessState != Main.screenBorderless) + { + Main.screenBorderless = Main.PendingBorderlessState; + Main.screenBorderlessPendingResizes = Main.screenBorderless ? 6 : 0; + Main.SetResolution(Main.PendingResolutionWidth, Main.PendingResolutionHeight); + } + Main.PlaySound(11); + Main.menuMode = 1111; + } + int index35 = index34 + 1; + strArray1[index35] = Lang.menu[5].Value; + numArray1[index35] = 100; + if (this.selectedMenu == index35 | flag5) + { + flag5 = false; + Main.PendingResolutionWidth = Main.graphics.PreferredBackBufferWidth; + Main.PendingResolutionHeight = Main.graphics.PreferredBackBufferHeight; + Main.PendingBorderlessState = Main.screenBorderless; + Main.menuMode = 1111; + Main.PlaySound(11); + } + num5 = index35 + 1; + goto label_627; + case 112: + num2 = 250; + num4 = 52; + num5 = 5; + numArray1[num5 - 1] = 18; + for (int index36 = 0; index36 < num5; ++index36) + numArray4[index36] = 0.78f; + int index37 = 0; + strArray1[index37] = !Main.autoSave ? Lang.menu[68].Value : Lang.menu[67].Value; + if (this.selectedMenu == index37) + { + Main.PlaySound(12); + Main.autoSave = !Main.autoSave; + } + int index38 = index37 + 1; + strArray1[index38] = !Main.autoPause ? Lang.menu[70].Value : Lang.menu[69].Value; + if (this.selectedMenu == index38) + { + Main.PlaySound(12); + Main.autoPause = !Main.autoPause; + } + int index39 = index38 + 1; + strArray1[index39] = !Main.mapEnabled ? Lang.menu[113].Value : Lang.menu[112].Value; + if (this.selectedMenu == index39) + { + Main.PlaySound(12); + Main.mapEnabled = !Main.mapEnabled; + } + int index40 = index39 + 1; + strArray1[index40] = Main.HidePassword ? Lang.menu[212].Value : Lang.menu[211].Value; + if (this.selectedMenu == index40) + { + Main.PlaySound(12); + Main.HidePassword = !Main.HidePassword; + } + int index41 = index40 + 1; + strArray1[index41] = Lang.menu[5].Value; + if (this.selectedMenu == index41 | flag5) + { + flag5 = false; + Main.menuMode = 11; + Main.PlaySound(11); + goto label_627; + } + else + goto label_627; + case 131: + int num16 = 7777; + PlayerInput.WritingText = true; + flag5 = false; + Main.instance.HandleIME(); + string getPort1 = Main.getPort; + Main.getPort = Main.GetInputText(Main.getPort); + string getPort2 = Main.getPort; + if (getPort1 != getPort2) + Main.PlaySound(12); + strArray1[0] = Lang.menu[90].Value; + flagArray2[2] = true; + if (Main.getPort != "") + { + bool flag8 = false; + try + { + num16 = Convert.ToInt32(Main.getPort); + if (num16 > 0) + { + if (num16 <= (int) ushort.MaxValue) + flag8 = true; + } + } + catch + { + } + if (flag8) + flagArray2[2] = false; + } + ++this.textBlinkerCount; + if (this.textBlinkerCount >= 20) + { + this.textBlinkerState = this.textBlinkerState != 0 ? 0 : 1; + this.textBlinkerCount = 0; + } + strArray1[1] = Main.getPort; + if (this.textBlinkerState == 1) + { + // ISSUE: explicit reference operation + ^ref strArray1[1] += "|"; + numArray2[1] = 1; + } + else + { + // ISSUE: explicit reference operation + ^ref strArray1[1] += " "; + } + flagArray1[0] = true; + flagArray1[1] = true; + numArray1[1] = -20; + numArray1[2] = 20; + strArray1[2] = Lang.menu[4].Value; + strArray1[3] = Lang.menu[5].Value; + num5 = 4; + if (this.selectedMenu == 3 | flag5) + { + flag5 = false; + Main.PlaySound(11); + Main.menuMode = 1; + } + if (this.selectedMenu == 2 || !flagArray2[2] && Main.inputTextEnter) + { + Netplay.ListenPort = num16; + Main.autoPass = false; + if (Netplay.SetRemoteIP(Main.getIP)) + { + Main.menuMode = 10; + Netplay.StartTcpClient(); + goto label_627; + } + else + goto label_627; + } + else + goto label_627; + case 200: + num5 = 3; + strArray1[0] = Lang.menu[9].Value; + flagArray1[0] = true; + num2 -= 30; + numArray1[1] = 70; + numArray1[2] = 50; + strArray1[1] = Lang.menu[10].Value; + strArray1[2] = Lang.menu[6].Value; + if (this.selectedMenu == 1) + { + if (FileUtilities.Exists(Main.worldPathName + ".bak", Main.ActiveWorldFileData.IsCloudSave)) + { + FileUtilities.Move(Main.worldPathName + ".bak", Main.worldPathName, Main.ActiveWorldFileData.IsCloudSave); + Main.PlaySound(10); + WorldGen.playWorld(); + Main.menuMode = 10; + } + else + { + Main.PlaySound(11); + Main.menuMode = 0; + Main.netMode = 0; + } + } + if (this.selectedMenu == 2 | flag5) + { + flag5 = false; + Main.PlaySound(11); + Main.menuMode = 0; + Main.netMode = 0; + goto label_627; + } + else + goto label_627; + case 201: + num5 = 3; + strArray1[0] = Lang.menu[9].Value; + flagArray1[0] = true; + flagArray1[1] = true; + num2 -= 30; + numArray1[1] = -30; + numArray1[2] = 50; + strArray1[1] = Lang.menu[11].Value; + strArray1[2] = Lang.menu[5].Value; + if (this.selectedMenu == 2 | flag5) + { + flag5 = false; + Main.PlaySound(11); + Main.menuMode = 0; + Main.netMode = 0; + goto label_627; + } + else + goto label_627; + case 222: + strArray1[0] = this.focusMenu != 3 ? (this.focusMenu != 2 ? (this.focusMenu != 1 ? Lang.menu[32].Value : Lang.menu[31].Value) : Lang.menu[30].Value) : Lang.menu[29].Value; + num4 = 50; + numArray1[1] = 25; + numArray1[2] = 25; + numArray1[3] = 25; + flagArray1[0] = true; + strArray1[1] = Lang.menu[26].Value; + strArray1[2] = Lang.menu[25].Value; + numArray3[2] = (byte) 1; + strArray1[3] = Lang.menu[24].Value; + numArray3[3] = (byte) 2; + num5 = 4; + if (this.selectedMenu == 1) + { + Main.PendingPlayer.difficulty = (byte) 0; + Main.menuMode = 2; + goto label_627; + } + else if (this.selectedMenu == 2) + { + Main.menuMode = 2; + Main.PendingPlayer.difficulty = (byte) 1; + goto label_627; + } + else if (this.selectedMenu == 3) + { + Main.PendingPlayer.difficulty = (byte) 2; + Main.menuMode = 2; + goto label_627; + } + else + goto label_627; + case 252: + flag1 = true; + num8 = 320; + num2 = 200; + num4 = 10; + Main.MouseBorderColor = Main.selColor; + Main.mouseBorderColorSlider.SetHSL(Main.mouseColor); + num5 = 3; + strArray1[0] = ""; + strArray1[1] = Lang.menu[217].Value; + flagArray1[1] = true; + numArray1[2] = 250; + numArray1[1] = 10; + strArray1[2] = Lang.menu[5].Value; + if (this.selectedMenu == 2 | flag5) + { + flag5 = false; + Main.menuMode = 1125; + Main.PlaySound(11); + goto label_627; + } + else + goto label_627; + case 882: + num5 = 2; + flagArray1[0] = true; + num2 = 300; + strArray1[0] = Main.statusText; + strArray1[1] = Lang.menu[6].Value; + if (this.selectedMenu == 1 | flag5) + { + flag5 = false; + Main.PlaySound(11); + Main.menuMode = 0; + Main.netMode = 0; + if (SocialAPI.Network != null) + { + SocialAPI.Network.CancelJoin(); + goto label_627; + } + else + goto label_627; + } + else + goto label_627; + case 889: + num2 = 200; + num4 = 60; + numArray1[1] = 30; + numArray1[2] = 30; + numArray1[3] = 30; + numArray1[4] = 70; + numArray1[5] = 70; + num5 = 6; + strArray1[0] = Lang.menu[135].Value; + strArray1[4] = Lang.menu[144].Value; + strArray1[5] = Lang.menu[5].Value; + flagArray1[0] = true; + if (!Main.MenuServerMode.HasFlag((Enum) ServerMode.Lobby)) + { + Main.MenuServerMode = ServerMode.None; + flagArray1[2] = true; + flagArray1[3] = true; + strArray1[1] = Lang.menu[136].Value; + strArray1[2] = ""; + strArray1[3] = ""; + } + else + { + strArray1[1] = Lang.menu[137].Value; + if (Main.MenuServerMode.HasFlag((Enum) ServerMode.FriendsCanJoin)) + { + strArray1[2] = Lang.menu[139].Value; + strArray1[3] = !Main.MenuServerMode.HasFlag((Enum) ServerMode.FriendsOfFriends) ? Lang.menu[142].Value : Lang.menu[143].Value; + } + else + { + strArray1[2] = Lang.menu[138].Value; + strArray1[3] = !Main.MenuServerMode.HasFlag((Enum) ServerMode.FriendsOfFriends) ? Lang.menu[140].Value : Lang.menu[141].Value; + } + } + if (flag5) + { + flag5 = false; + this.selectedMenu = 5; + } + switch (this.selectedMenu) + { + case 1: + Main.MenuServerMode ^= ServerMode.Lobby; + Main.PlaySound(12); + goto label_627; + case 2: + Main.MenuServerMode ^= ServerMode.FriendsCanJoin; + Main.PlaySound(12); + goto label_627; + case 3: + Main.MenuServerMode ^= ServerMode.FriendsOfFriends; + Main.PlaySound(12); + goto label_627; + case 4: + Main.clrInput(); + Netplay.ServerPassword = ""; + Main.GetInputText(""); + Main.autoPass = false; + Main.menuMode = 30; + Main.PlaySound(10); + goto label_627; + case 5: + Main.menuMode = 6; + Main.PlaySound(11); + goto label_627; + default: + goto label_627; + } + case 1111: + num2 = 186; + num4 = 32; + for (int index42 = 0; index42 < 11; ++index42) + numArray4[index42] = 0.6f; + numArray1[11] = 8; + num5 = 12; + strArray1[0] = !Main.graphics.IsFullScreen ? Lang.menu[50].Value : Lang.menu[49].Value; + Main.bgScroll = (int) Math.Round((1.0 - (double) Main.caveParallax) * 500.0); + strArray1[1] = Lang.menu[51].Value; + strArray1[2] = Lang.menu[52].Value; + strArray1[3] = Lang.menu[247 + Main.FrameSkipMode].Value; + switch (Lighting.lightMode) + { + case 0: + strArray1[4] = Lang.menu[55].Value; + break; + case 1: + strArray1[4] = Lang.menu[56].Value; + break; + case 2: + strArray1[4] = Lang.menu[57].Value; + break; + case 3: + strArray1[4] = Lang.menu[58].Value; + break; + } + strArray1[5] = Lighting.LightingThreads != 0 ? Lang.menu[116].Value + " " + (object) (Lighting.LightingThreads + 1) : Lang.menu[116].Value + " " + Lang.menu[117].Value; + switch (Main.qaStyle) + { + case 0: + strArray1[6] = Lang.menu[59].Value; + break; + case 1: + strArray1[6] = Lang.menu[60].Value; + break; + case 2: + strArray1[6] = Lang.menu[61].Value; + break; + default: + strArray1[6] = Lang.menu[62].Value; + break; + } + strArray1[7] = !Main.BackgroundEnabled ? Lang.menu[101].Value : Lang.menu[100].Value; + strArray1[10] = Language.GetTextValue("UI.Effects"); + strArray1[11] = Lang.menu[5].Value; + if (this.selectedMenu == 7) + { + Main.PlaySound(12); + Main.BackgroundEnabled = !Main.BackgroundEnabled; + } + if (this.selectedMenu == 11 | flag5) + { + flag5 = false; + Main.PlaySound(11); + Main.SaveSettings(); + Main.menuMode = 11; + } + strArray1[9] = Main.SettingsEnabled_MinersWobble ? Lang.menu[250].Value : Lang.menu[251].Value; + if (this.selectedMenu == 9) + { + Main.PlaySound(12); + Main.SettingsEnabled_MinersWobble = !Main.SettingsEnabled_MinersWobble; + } + strArray1[8] = ChildSafety.Disabled ? Lang.menu[132].Value : Lang.menu[133].Value; + if (this.selectedMenu == 8) + { + Main.PlaySound(12); + ChildSafety.Disabled = !ChildSafety.Disabled; + } + if (this.selectedMenu == 6) + { + Main.PlaySound(12); + ++Main.qaStyle; + if (Main.qaStyle > 3) + Main.qaStyle = 0; + } + if (this.selectedMenu == 5) + { + Main.PlaySound(12); + ++Lighting.LightingThreads; + if (Lighting.LightingThreads > Environment.ProcessorCount - 1) + Lighting.LightingThreads = 0; + } + if (this.selectedMenu == 4) + { + Main.PlaySound(12); + ++Lighting.lightMode; + if (Lighting.lightMode >= 4) + Lighting.lightMode = 0; + } + if (this.selectedMenu == 3) + { + Main.PlaySound(12); + ++Main.FrameSkipMode; + if (Main.FrameSkipMode < 0 || Main.FrameSkipMode > 2) + Main.FrameSkipMode = 0; + } + if (this.selectedMenu == 2) + { + Main.PlaySound(11); + Main.menuMode = 28; + } + if (this.selectedMenu == 10) + { + Main.PlaySound(11); + Main.menuMode = 2008; + } + if (this.selectedMenu == 1) + { + Main.PlaySound(10); + Main.menuMode = 111; + } + if (this.selectedMenu == 0) + { + Main.ToggleFullScreen(); + goto label_627; + } + else + goto label_627; + case 1112: + num2 = 210; + num4 = 42; + num5 = 7; + numArray1[num5 - 1] = 18; + for (int index43 = 0; index43 < num5; ++index43) + numArray4[index43] = 0.75f; + int index44 = 0; + strArray1[index44] = !Main.showItemText ? Lang.menu[72].Value : Lang.menu[71].Value; + if (this.selectedMenu == index44) + { + Main.PlaySound(12); + Main.showItemText = !Main.showItemText; + } + int index45 = index44 + 1; + strArray1[index45] = Lang.menu[123].Value + " " + Lang.menu[124 + Main.invasionProgressMode].Value; + if (this.selectedMenu == index45) + { + Main.PlaySound(12); + ++Main.invasionProgressMode; + if (Main.invasionProgressMode >= 3) + Main.invasionProgressMode = 0; + } + int index46 = index45 + 1; + strArray1[index46] = Main.placementPreview ? Lang.menu[128].Value : Lang.menu[129].Value; + if (this.selectedMenu == index46) + { + Main.PlaySound(12); + Main.placementPreview = !Main.placementPreview; + } + int index47 = index46 + 1; + strArray1[index47] = ItemSlot.Options.HighlightNewItems ? Lang.inter[117].Value : Lang.inter[116].Value; + if (this.selectedMenu == index47) + { + Main.PlaySound(12); + ItemSlot.Options.HighlightNewItems = !ItemSlot.Options.HighlightNewItems; + } + int index48 = index47 + 1; + strArray1[index48] = Main.MouseShowBuildingGrid ? Lang.menu[229].Value : Lang.menu[230].Value; + if (this.selectedMenu == index48) + { + Main.PlaySound(12); + Main.MouseShowBuildingGrid = !Main.MouseShowBuildingGrid; + } + int index49 = index48 + 1; + strArray1[index49] = Main.GamepadDisableInstructionsDisplay ? Lang.menu[241].Value : Lang.menu[242].Value; + if (this.selectedMenu == index49) + { + Main.PlaySound(12); + Main.GamepadDisableInstructionsDisplay = !Main.GamepadDisableInstructionsDisplay; + } + int index50 = index49 + 1; + strArray1[index50] = Lang.menu[5].Value; + if (this.selectedMenu == index50 | flag5) + { + flag5 = false; + Main.menuMode = 11; + Main.PlaySound(11); + goto label_627; + } + else + goto label_627; + case 1125: + num2 = 232; + num4 = 38; + num5 = 7; + numArray1[num5 - 1] = 18; + for (int index51 = 0; index51 < num5; ++index51) + numArray4[index51] = 0.73f; + int index52 = 0; + strArray1[index52] = Lang.menu[64].Value; + if (this.selectedMenu == index52) + { + Main.PlaySound(10); + Main.selColor = Main.mouseColor; + Main.mouseColorSlider.SetHSL(Main.mouseColor); + Main.menuMode = 25; + } + int index53 = index52 + 1; + strArray1[index53] = Lang.menu[217].Value; + if (this.selectedMenu == index53) + { + Main.PlaySound(10); + Main.selColor = Main.MouseBorderColor; + Main.mouseBorderColorSlider.SetHSL(Main.mouseColor); + Main.menuMode = 252; + } + int index54 = index53 + 1; + strArray1[index54] = Main.cSmartCursorToggle ? Lang.menu[121].Value : Lang.menu[122].Value; + if (this.selectedMenu == index54) + { + Main.PlaySound(12); + Main.cSmartCursorToggle = !Main.cSmartCursorToggle; + } + int index55 = index54 + 1; + strArray1[index55] = Player.SmartCursorSettings.SmartAxeAfterPickaxe ? Lang.menu[214].Value : Lang.menu[213].Value; + if (this.selectedMenu == index55) + { + Main.PlaySound(12); + Player.SmartCursorSettings.SmartAxeAfterPickaxe = !Player.SmartCursorSettings.SmartAxeAfterPickaxe; + } + int index56 = index55 + 1; + strArray1[index56] = Player.SmartCursorSettings.SmartBlocksEnabled ? Lang.menu[215].Value : Lang.menu[216].Value; + if (this.selectedMenu == index56) + { + Main.PlaySound(12); + Player.SmartCursorSettings.SmartBlocksEnabled = !Player.SmartCursorSettings.SmartBlocksEnabled; + } + int index57 = index56 + 1; + switch (LockOnHelper.UseMode) + { + case LockOnHelper.LockOnMode.FocusTarget: + strArray1[index57] = Lang.menu[232].Value; + break; + case LockOnHelper.LockOnMode.TargetClosest: + strArray1[index57] = Lang.menu[233].Value; + break; + case LockOnHelper.LockOnMode.ThreeDS: + strArray1[index57] = Lang.menu[234].Value; + break; + } + if (this.selectedMenu == index57) + { + Main.PlaySound(12); + LockOnHelper.CycleUseModes(); + } + int index58 = index57 + 1; + strArray1[index58] = Lang.menu[5].Value; + if (this.selectedMenu == index58 | flag5) + { + flag5 = false; + Main.menuMode = 11; + Main.PlaySound(11); + goto label_627; + } + else + goto label_627; + case 1127: + num2 = 250; + num4 = 52; + num5 = 5; + numArray1[num5 - 1] = 18; + for (int index59 = 0; index59 < num5; ++index59) + numArray4[index59] = 0.78f; + int index60 = 0; + strArray1[index60] = Main.ReversedUpDownArmorSetBonuses ? Lang.menu[220].Value : Lang.menu[221].Value; + if (this.selectedMenu == index60) + { + Main.PlaySound(12); + Main.ReversedUpDownArmorSetBonuses = !Main.ReversedUpDownArmorSetBonuses; + } + int index61 = index60 + 1; + strArray1[index61] = Player.SmartCursorSettings.SmartWallReplacement ? Lang.menu[226].Value : Lang.menu[225].Value; + if (this.selectedMenu == index61) + { + Main.PlaySound(12); + Player.SmartCursorSettings.SmartWallReplacement = !Player.SmartCursorSettings.SmartWallReplacement; + } + int index62 = index61 + 1; + strArray1[index62] = ItemSlot.Options.DisableLeftShiftTrashCan ? Lang.menu[224].Value : Lang.menu[223].Value; + if (this.selectedMenu == index62) + { + Main.PlaySound(12); + ItemSlot.Options.DisableLeftShiftTrashCan = !ItemSlot.Options.DisableLeftShiftTrashCan; + } + int index63 = index62 + 1; + strArray1[index63] = Lang.menu[222].Value; + if (this.selectedMenu == index63) + { + Main.PlaySound(10); + Main.MenuUI.SetState((UIState) Main.ManageControlsMenu); + Main.menuMode = 888; + } + int index64 = index63 + 1; + strArray1[index64] = Lang.menu[5].Value; + if (this.selectedMenu == index64 | flag5) + { + flag5 = false; + Main.menuMode = 11; + Main.PlaySound(11); + goto label_627; + } + else + goto label_627; + case 2008: + num2 = 240; + num4 = 60; + num5 = 6; + strArray1[0] = ""; + strArray1[1] = Language.GetTextValue("UI.Effects"); + flagArray1[1] = true; + numArray1[1] = 10; + strArray1[2] = Language.GetTextValue("GameUI.StormEffects", Main.UseStormEffects ? (object) Language.GetTextValue("GameUI.Enabled") : (object) Language.GetTextValue("GameUI.Disabled")); + numArray4[2] = 0.8f; + strArray1[3] = Language.GetTextValue("GameUI.HeatDistortion", Main.UseHeatDistortion ? (object) Language.GetTextValue("GameUI.Enabled") : (object) Language.GetTextValue("GameUI.Disabled")); + numArray4[3] = 0.8f; + string textValue; + switch (Main.WaveQuality) + { + case 1: + textValue = Language.GetTextValue("GameUI.QualityLow"); + break; + case 2: + textValue = Language.GetTextValue("GameUI.QualityMedium"); + break; + case 3: + textValue = Language.GetTextValue("GameUI.QualityHigh"); + break; + default: + textValue = Language.GetTextValue("GameUI.QualityOff"); + break; + } + strArray1[4] = Language.GetTextValue("GameUI.WaveQuality", (object) textValue); + numArray4[4] = 0.8f; + strArray1[5] = Lang.menu[5].Value; + if (this.selectedMenu == 2) + Main.UseStormEffects = !Main.UseStormEffects; + if (this.selectedMenu == 3) + Main.UseHeatDistortion = !Main.UseHeatDistortion; + if (this.selectedMenu == 4) + Main.WaveQuality = (Main.WaveQuality + 1) % 4; + if (this.selectedMenu == 5 | flag5) + { + flag5 = false; + Main.menuMode = 1111; + Main.PlaySound(11); + goto label_627; + } + else + goto label_627; + case 5000: + Main.MenuUI.SetState((UIState) new UIVirtualKeyboard(Language.GetTextValue("UI.EnterSeed"), "", new UIVirtualKeyboard.KeyboardSubmitEvent(this.OnSeedSelected), Main.CreateGoToMenuEvent(7), allowEmpty: true)); + Main.menuMode = 888; + goto label_627; + case 272727: + num2 = 200; + num4 = 30; + num5 = 14; + string[] strArray3 = new string[12] + { + Main.cMapStyle, + Main.cMapFull, + Main.cMapZoomIn, + Main.cMapZoomOut, + Main.cMapAlphaUp, + Main.cMapAlphaDown, + null, + null, + null, + null, + null, + null + }; + if (Main.setKey >= 0) + strArray3[Main.setKey] = "_"; + strArray1[0] = Lang.menu[106].Value + strArray3[0]; + strArray1[1] = Lang.menu[107].Value + strArray3[1]; + strArray1[2] = Lang.menu[108].Value + strArray3[2]; + strArray1[3] = Lang.menu[109].Value + strArray3[3]; + strArray1[4] = Lang.menu[110].Value + strArray3[4]; + strArray1[5] = Lang.menu[111].Value + strArray3[5]; + for (int index65 = 0; index65 < 6; ++index65) + { + flagArray4[index65] = true; + numArray4[index65] = 0.55f; + numArray2[index65] = -140; + } + numArray4[6] = 0.8f; + numArray4[6] = 0.8f; + numArray1[6] = 6; + strArray1[6] = Lang.menu[86].Value; + numArray1[7] = 16; + strArray1[7] = Lang.menu[5].Value; + if (this.selectedMenu == 7 | flag5) + { + flag5 = false; + Main.menuMode = 11; + Main.PlaySound(11); + } + else if (this.selectedMenu == 6) + { + Main.cMapStyle = "Tab"; + Main.cMapFull = "M"; + Main.cMapZoomIn = "Add"; + Main.cMapZoomOut = "Subtract"; + Main.cMapAlphaUp = "PageUp"; + Main.cMapAlphaDown = "PageDown"; + Main.setKey = -1; + Main.PlaySound(11); + } + else if (this.selectedMenu >= 0) + Main.setKey = this.selectedMenu; + if (Main.setKey >= 0) + { + Microsoft.Xna.Framework.Input.Keys[] pressedKeys = Main.keyState.GetPressedKeys(); + if (pressedKeys.Length != 0) + { + string str = string.Concat((object) pressedKeys[0]); + if (str != "None") + { + if (Main.setKey == 0) + Main.cMapStyle = str; + if (Main.setKey == 1) + Main.cMapFull = str; + if (Main.setKey == 2) + Main.cMapZoomIn = str; + if (Main.setKey == 3) + Main.cMapZoomOut = str; + if (Main.setKey == 4) + Main.cMapAlphaUp = str; + if (Main.setKey == 5) + Main.cMapAlphaDown = str; + Main.setKey = -1; + goto label_627; + } + else + goto label_627; + } + else + goto label_627; + } + else + goto label_627; + default: + goto label_627; + } } - } - num5 = 2; - strArray1[0] = Main.statusText; - flagArray1[0] = true; - num2 = 300; - int num17 = Main.statusText.Split('\n').Length - 1; - numArray4[0] = (float) (1.0 - (double) num17 * 0.0399999991059303); - numArray1[0] = num17 * -18; - numArray1[1] = num17 * 28; - strArray1[1] = Lang.menu[6].Value; - if (this.selectedMenu == 1 | flag5) - { - flag5 = false; - Netplay.InvalidateAllOngoingIPSetAttempts(); - Netplay.Disconnect = true; - Netplay.Connection.Socket.Close(); - SoundEngine.PlaySound(11); - Main.menuMode = 0; - Main.netMode = 0; - if (Main.tServer != null) + num5 = 2; + strArray1[0] = Main.statusText; + flagArray1[0] = true; + num2 = 300; + strArray1[1] = Lang.menu[6].Value; + if (this.selectedMenu == 1 | flag5) { + flag5 = false; + Netplay.disconnect = true; + Netplay.Connection.Socket.Close(); + Main.PlaySound(11); + Main.menuMode = 0; + Main.netMode = 0; try { - Main.tServer.Kill(); - Main.tServer = (Process) null; + this.tServer.Kill(); break; } catch @@ -37122,11 +37565,9 @@ label_56: } else break; - } - else - break; + } } -label_623: +label_627: if (Main.menuMode == 888) { if (!Main._blockFancyUIWhileLoading) @@ -37136,32 +37577,29 @@ label_623: Main.MenuUI.SetState((UIState) null); if (UILinkPointNavigator.Shortcuts.BackButtonInUse && !flag5) UILinkPointNavigator.Shortcuts.BackButtonLock = true; - int num18 = this.focusMenu; + int num17 = this.focusMenu; if (Main.menuMode != menuMode2) { - if (Main.menuMode == 10) - Main.gameTips.ClearTips(); Main.blockMouse = true; Main.menuSkip = 0; num5 = 0; if (PlayerInput.UsingGamepad && Main.InvisibleCursorForGamepad) { - this.focusMenu = num18 = -1; - int num19; - PlayerInput.MouseY = num19 = 0; - PlayerInput.MouseX = num19; - Main.mouseY = num19; - Main.mouseX = num19; + this.focusMenu = num17 = -1; + int num18; + PlayerInput.MouseY = num18 = 0; + PlayerInput.MouseX = num18; + Main.mouseY = num18; + Main.mouseX = num18; } - for (int index79 = 0; index79 < Main.maxMenuItems; ++index79) - this.menuItemScale[index79] = 0.8f; + for (int index66 = 0; index66 < Main.maxMenuItems; ++index66) + this.menuItemScale[index66] = 0.8f; } if (!Main.mouseLeft) Main.blockMouse = true; this.selectedMenu = -1; this.selectedMenu2 = -1; this.focusMenu = -1; - bool flag8 = Main.mouseLeft && !PlayerInput.UsingGamepad; if (!flag1) { this.grabColorSlider = 0; @@ -37179,20 +37617,20 @@ label_623: } int focusColor = Main.focusColor; Main.focusColor = 0; - int num20 = num8; - int num21 = Main.screenWidth / 2 - TextureAssets.Hue.Width() / 2; - int num22 = 167; + int num19 = num8; + int num20 = Main.screenWidth / 2 - this.hueTexture.Width / 2; + int num21 = 167; Vector3 hsl = Main.rgbToHsl(Main.selColor); float Hue = hsl.X; float Saturation1 = hsl.Y; float Luminosity1 = hsl.Z; - float num23 = (float) Main.selColor.A / (float) byte.MaxValue; + float num22 = (float) Main.selColor.A / (float) byte.MaxValue; if ((double) Main.hBar == -1.0 || (double) Main.sBar == -1.0 || (double) Main.lBar == -1.0 || (double) Main.aBar == -1.0) { Main.hBar = Hue; Main.sBar = Saturation1; Main.lBar = Luminosity1; - Main.aBar = num23; + Main.aBar = num22; } else { @@ -37201,18 +37639,18 @@ label_623: Luminosity1 = Main.lBar; float aBar = Main.aBar; } - Main.spriteBatch.Draw(TextureAssets.Hue.Value, new Vector2((float) num21, (float) num20), Microsoft.Xna.Framework.Color.White); - if (Main.mouseX > num21 - 4 && Main.mouseX < num21 + TextureAssets.Hue.Width() + 4 && Main.mouseY > num20 - 4 && Main.mouseY < num20 + TextureAssets.Hue.Height() + 4 && this.grabColorSlider == 0 || this.grabColorSlider == 1) - Main.spriteBatch.Draw(TextureAssets.ColorHighlight.Value, new Vector2((float) num21, (float) num20), Main.OurFavoriteColor); - Main.spriteBatch.Draw(TextureAssets.ColorSlider.Value, new Vector2((float) num21 + (float) (TextureAssets.Hue.Width() - 2) * Main.hBar - (float) (TextureAssets.ColorSlider.Width() / 2), (float) (num20 - TextureAssets.ColorSlider.Height() / 2 + TextureAssets.Hue.Height() / 2)), Microsoft.Xna.Framework.Color.White); - if (Main.mouseX > num21 - 4 && Main.mouseX < num21 + TextureAssets.Hue.Width() + 4 && Main.mouseY > num20 - 4 && Main.mouseY < num20 + TextureAssets.Hue.Height() + 4 && this.grabColorSlider == 0 || this.grabColorSlider == 1) + Main.spriteBatch.Draw(this.hueTexture, new Vector2((float) num20, (float) num19), Microsoft.Xna.Framework.Color.White); + if (Main.mouseX > num20 - 4 && Main.mouseX < num20 + this.hueTexture.Width + 4 && Main.mouseY > num19 - 4 && Main.mouseY < num19 + this.hueTexture.Height + 4 && this.grabColorSlider == 0 || this.grabColorSlider == 1) + Main.spriteBatch.Draw(Main.colorHighlightTexture, new Vector2((float) num20, (float) num19), Main.OurFavoriteColor); + Main.spriteBatch.Draw(Main.colorSliderTexture, new Vector2((float) num20 + (float) (this.hueTexture.Width - 2) * Main.hBar - (float) (Main.colorSliderTexture.Width / 2), (float) (num19 - Main.colorSliderTexture.Height / 2 + this.hueTexture.Height / 2)), Microsoft.Xna.Framework.Color.White); + if (Main.mouseX > num20 - 4 && Main.mouseX < num20 + this.hueTexture.Width + 4 && Main.mouseY > num19 - 4 && Main.mouseY < num19 + this.hueTexture.Height + 4 && this.grabColorSlider == 0 || this.grabColorSlider == 1) { Main.focusColor = 1; UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 5; - if (flag8 && !Main.blockMouse) + if (Main.mouseLeft && !Main.blockMouse) { this.grabColorSlider = 1; - Hue = (float) (Main.mouseX - num21) / (float) TextureAssets.Hue.Width(); + Hue = (float) (Main.mouseX - num20) / (float) this.hueTexture.Width; if ((double) Hue < 0.0) Hue = 0.0f; if ((double) Hue > 1.0) @@ -37220,26 +37658,26 @@ label_623: Main.hBar = Hue; } } - GamepadMainMenuHandler.MenuItemPositions.Add(new Vector2((float) num21, (float) num20) + TextureAssets.ColorBar.Value.Size() / 2f); - int num24 = num20 + 26; - Main.spriteBatch.Draw(TextureAssets.ColorBar.Value, new Vector2((float) num21, (float) num24), Microsoft.Xna.Framework.Color.White); - for (int index80 = 0; index80 <= num22; ++index80) + GamepadMainMenuHandler.MenuItemPositions.Add(new Vector2((float) num20, (float) num19) + Main.colorBarTexture.Size() / 2f); + int num23 = num19 + 26; + Main.spriteBatch.Draw(Main.colorBarTexture, new Vector2((float) num20, (float) num23), Microsoft.Xna.Framework.Color.White); + for (int index67 = 0; index67 <= num21; ++index67) { - float Saturation2 = (float) index80 / (float) num22; + float Saturation2 = (float) index67 / (float) num21; Microsoft.Xna.Framework.Color rgb = Main.hslToRgb(Hue, Saturation2, Luminosity1); - Main.spriteBatch.Draw(TextureAssets.ColorBlip.Value, new Vector2((float) (num21 + index80 + 5), (float) (num24 + 4)), rgb); + Main.spriteBatch.Draw(Main.colorBlipTexture, new Vector2((float) (num20 + index67 + 5), (float) (num23 + 4)), rgb); } - if (Main.mouseX > num21 - 4 && Main.mouseX < num21 + TextureAssets.Hue.Width() + 4 && Main.mouseY > num24 - 4 && Main.mouseY < num24 + TextureAssets.Hue.Height() + 4 && this.grabColorSlider == 0 || this.grabColorSlider == 2) - Main.spriteBatch.Draw(TextureAssets.ColorHighlight.Value, new Vector2((float) num21, (float) num24), Main.OurFavoriteColor); - Main.spriteBatch.Draw(TextureAssets.ColorSlider.Value, new Vector2((float) num21 + (float) (TextureAssets.Hue.Width() - 2) * Main.sBar - (float) (TextureAssets.ColorSlider.Width() / 2), (float) (num24 - TextureAssets.ColorSlider.Height() / 2 + TextureAssets.Hue.Height() / 2)), Microsoft.Xna.Framework.Color.White); - if (Main.mouseX > num21 - 4 && Main.mouseX < num21 + TextureAssets.Hue.Width() + 4 && Main.mouseY > num24 - 4 && Main.mouseY < num24 + TextureAssets.Hue.Height() + 4 && this.grabColorSlider == 0 || this.grabColorSlider == 2) + if (Main.mouseX > num20 - 4 && Main.mouseX < num20 + this.hueTexture.Width + 4 && Main.mouseY > num23 - 4 && Main.mouseY < num23 + this.hueTexture.Height + 4 && this.grabColorSlider == 0 || this.grabColorSlider == 2) + Main.spriteBatch.Draw(Main.colorHighlightTexture, new Vector2((float) num20, (float) num23), Main.OurFavoriteColor); + Main.spriteBatch.Draw(Main.colorSliderTexture, new Vector2((float) num20 + (float) (this.hueTexture.Width - 2) * Main.sBar - (float) (Main.colorSliderTexture.Width / 2), (float) (num23 - Main.colorSliderTexture.Height / 2 + this.hueTexture.Height / 2)), Microsoft.Xna.Framework.Color.White); + if (Main.mouseX > num20 - 4 && Main.mouseX < num20 + this.hueTexture.Width + 4 && Main.mouseY > num23 - 4 && Main.mouseY < num23 + this.hueTexture.Height + 4 && this.grabColorSlider == 0 || this.grabColorSlider == 2) { Main.focusColor = 2; UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 6; - if (flag8 && !Main.blockMouse) + if (Main.mouseLeft && !Main.blockMouse) { this.grabColorSlider = 2; - Saturation1 = (float) (Main.mouseX - num21) / (float) TextureAssets.Hue.Width(); + Saturation1 = (float) (Main.mouseX - num20) / (float) this.hueTexture.Width; if ((double) Saturation1 < 0.0) Saturation1 = 0.0f; if ((double) Saturation1 > 1.0) @@ -37247,117 +37685,117 @@ label_623: Main.sBar = Saturation1; } } - GamepadMainMenuHandler.MenuItemPositions.Add(new Vector2((float) num21, (float) num24) + TextureAssets.ColorBar.Value.Size() / 2f); - int num25 = num24 + 26; - Main.spriteBatch.Draw(TextureAssets.ColorBar.Value, new Vector2((float) num21, (float) num25), Microsoft.Xna.Framework.Color.White); - float num26 = 0.15f; + GamepadMainMenuHandler.MenuItemPositions.Add(new Vector2((float) num20, (float) num23) + Main.colorBarTexture.Size() / 2f); + int num24 = num23 + 26; + Main.spriteBatch.Draw(Main.colorBarTexture, new Vector2((float) num20, (float) num24), Microsoft.Xna.Framework.Color.White); + float num25 = 0.15f; if (Main.menuMode == 252) - num26 = 0.0f; - for (int index81 = 0; index81 <= num22; ++index81) + num25 = 0.0f; + for (int index68 = 0; index68 <= num21; ++index68) { - float Luminosity2 = (float) index81 / (float) num22; + float Luminosity2 = (float) index68 / (float) num21; Microsoft.Xna.Framework.Color rgb = Main.hslToRgb(Hue, Saturation1, Luminosity2); - Main.spriteBatch.Draw(TextureAssets.ColorBlip.Value, new Vector2((float) (num21 + index81 + 5), (float) (num25 + 4)), rgb); + Main.spriteBatch.Draw(Main.colorBlipTexture, new Vector2((float) (num20 + index68 + 5), (float) (num24 + 4)), rgb); } - if (Main.mouseX > num21 - 4 && Main.mouseX < num21 + TextureAssets.Hue.Width() + 4 && Main.mouseY > num25 - 4 && Main.mouseY < num25 + TextureAssets.Hue.Height() + 4 && this.grabColorSlider == 0 || this.grabColorSlider == 3) - Main.spriteBatch.Draw(TextureAssets.ColorHighlight.Value, new Vector2((float) num21, (float) num25), Main.OurFavoriteColor); - Main.spriteBatch.Draw(TextureAssets.ColorSlider.Value, new Vector2((float) num21 + (float) (TextureAssets.Hue.Width() - 2) * (float) (((double) Main.lBar - (double) num26) / (1.0 - (double) num26)) - (float) (TextureAssets.ColorSlider.Width() / 2), (float) (num25 - TextureAssets.ColorSlider.Height() / 2 + TextureAssets.Hue.Height() / 2)), Microsoft.Xna.Framework.Color.White); - if (Main.mouseX > num21 - 4 && Main.mouseX < num21 + TextureAssets.Hue.Width() + 4 && Main.mouseY > num25 - 4 && Main.mouseY < num25 + TextureAssets.Hue.Height() + 4 && this.grabColorSlider == 0 || this.grabColorSlider == 3) + if (Main.mouseX > num20 - 4 && Main.mouseX < num20 + this.hueTexture.Width + 4 && Main.mouseY > num24 - 4 && Main.mouseY < num24 + this.hueTexture.Height + 4 && this.grabColorSlider == 0 || this.grabColorSlider == 3) + Main.spriteBatch.Draw(Main.colorHighlightTexture, new Vector2((float) num20, (float) num24), Main.OurFavoriteColor); + Main.spriteBatch.Draw(Main.colorSliderTexture, new Vector2((float) num20 + (float) (this.hueTexture.Width - 2) * (float) (((double) Main.lBar - (double) num25) / (1.0 - (double) num25)) - (float) (Main.colorSliderTexture.Width / 2), (float) (num24 - Main.colorSliderTexture.Height / 2 + this.hueTexture.Height / 2)), Microsoft.Xna.Framework.Color.White); + if (Main.mouseX > num20 - 4 && Main.mouseX < num20 + this.hueTexture.Width + 4 && Main.mouseY > num24 - 4 && Main.mouseY < num24 + this.hueTexture.Height + 4 && this.grabColorSlider == 0 || this.grabColorSlider == 3) { Main.focusColor = 3; UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 7; - if (flag8 && !Main.blockMouse) + if (Main.mouseLeft && !Main.blockMouse) { this.grabColorSlider = 3; - float num27 = (float) (Main.mouseX - num21) / (float) TextureAssets.Hue.Width(); - if ((double) num27 < 0.0) - num27 = 0.0f; - if ((double) num27 > 1.0) - num27 = 1f; - Luminosity1 = num27 * (1f - num26) + num26; + float num26 = (float) (Main.mouseX - num20) / (float) this.hueTexture.Width; + if ((double) num26 < 0.0) + num26 = 0.0f; + if ((double) num26 > 1.0) + num26 = 1f; + Luminosity1 = num26 * (1f - num25) + num25; Main.lBar = Luminosity1; } } - GamepadMainMenuHandler.MenuItemPositions.Add(new Vector2((float) num21, (float) num25) + TextureAssets.ColorBar.Value.Size() / 2f); + GamepadMainMenuHandler.MenuItemPositions.Add(new Vector2((float) num20, (float) num24) + Main.colorBarTexture.Size() / 2f); bool flag9 = false; if (Main.menuMode == 252) { - int num28 = num25 + 26; + int num27 = num24 + 26; flag9 = true; - Main.spriteBatch.Draw(TextureAssets.ColorBar.Value, new Vector2((float) num21, (float) num28), Microsoft.Xna.Framework.Color.White); + Main.spriteBatch.Draw(Main.colorBarTexture, new Vector2((float) num20, (float) num27), Microsoft.Xna.Framework.Color.White); Microsoft.Xna.Framework.Color rgb = Main.hslToRgb(Hue, Saturation1, Luminosity1); - for (int index82 = 0; index82 <= num22; ++index82) + for (int index69 = 0; index69 <= num21; ++index69) { - float num29 = (float) index82 / (float) num22; - Microsoft.Xna.Framework.Color color4 = rgb * num29; - Main.spriteBatch.Draw(TextureAssets.ColorBlip.Value, new Vector2((float) (num21 + index82 + 5), (float) (num28 + 4)), color4); + float num28 = (float) index69 / (float) num21; + Microsoft.Xna.Framework.Color color4 = rgb * num28; + Main.spriteBatch.Draw(Main.colorBlipTexture, new Vector2((float) (num20 + index69 + 5), (float) (num27 + 4)), color4); } - if (Main.mouseX > num21 - 4 && Main.mouseX < num21 + TextureAssets.Hue.Width() + 4 && Main.mouseY > num28 - 4 && Main.mouseY < num28 + TextureAssets.Hue.Height() + 4 && this.grabColorSlider == 0 || this.grabColorSlider == 4) - Main.spriteBatch.Draw(TextureAssets.ColorHighlight.Value, new Vector2((float) num21, (float) num28), Main.OurFavoriteColor); - Main.spriteBatch.Draw(TextureAssets.ColorSlider.Value, new Vector2((float) num21 + (float) (TextureAssets.Hue.Width() - 2) * Main.aBar - (float) (TextureAssets.ColorSlider.Width() / 2), (float) (num28 - TextureAssets.ColorSlider.Height() / 2 + TextureAssets.Hue.Height() / 2)), Microsoft.Xna.Framework.Color.White); - if (Main.mouseX > num21 - 4 && Main.mouseX < num21 + TextureAssets.Hue.Width() + 4 && Main.mouseY > num28 - 4 && Main.mouseY < num28 + TextureAssets.Hue.Height() + 4 && this.grabColorSlider == 0 || this.grabColorSlider == 4) + if (Main.mouseX > num20 - 4 && Main.mouseX < num20 + this.hueTexture.Width + 4 && Main.mouseY > num27 - 4 && Main.mouseY < num27 + this.hueTexture.Height + 4 && this.grabColorSlider == 0 || this.grabColorSlider == 4) + Main.spriteBatch.Draw(Main.colorHighlightTexture, new Vector2((float) num20, (float) num27), Main.OurFavoriteColor); + Main.spriteBatch.Draw(Main.colorSliderTexture, new Vector2((float) num20 + (float) (this.hueTexture.Width - 2) * Main.aBar - (float) (Main.colorSliderTexture.Width / 2), (float) (num27 - Main.colorSliderTexture.Height / 2 + this.hueTexture.Height / 2)), Microsoft.Xna.Framework.Color.White); + if (Main.mouseX > num20 - 4 && Main.mouseX < num20 + this.hueTexture.Width + 4 && Main.mouseY > num27 - 4 && Main.mouseY < num27 + this.hueTexture.Height + 4 && this.grabColorSlider == 0 || this.grabColorSlider == 4) { Main.focusColor = 4; UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 8; if (Main.mouseLeft && !Main.blockMouse) { this.grabColorSlider = 4; - float num30 = (float) (Main.mouseX - num21) / (float) TextureAssets.Hue.Width(); - if ((double) num30 < 0.0) - num30 = 0.0f; - if ((double) num30 > 1.0) - num30 = 1f; - Main.aBar = num30; + float num29 = (float) (Main.mouseX - num20) / (float) this.hueTexture.Width; + if ((double) num29 < 0.0) + num29 = 0.0f; + if ((double) num29 > 1.0) + num29 = 1f; + Main.aBar = num29; } } - GamepadMainMenuHandler.MenuItemPositions.Add(new Vector2((float) num21, (float) num28) + TextureAssets.ColorBar.Value.Size() / 2f); + GamepadMainMenuHandler.MenuItemPositions.Add(new Vector2((float) num20, (float) num27) + Main.colorBarTexture.Size() / 2f); } if (focusColor != Main.focusColor) - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.selColor = Main.hslToRgb(Main.hBar, Main.sBar, Main.lBar); if (flag9) Main.selColor.A = (byte) ((double) Main.aBar * (double) byte.MaxValue); } else if (flag1) { - string str6 = ""; - for (int index83 = 0; index83 < 6; ++index83) + string str3 = ""; + for (int index70 = 0; index70 < 6; ++index70) { - int num31 = num8; - int num32 = 370 + Main.screenWidth / 2 - 400; - if (index83 == 0) - str6 = Lang.menu[95].Value; - if (index83 == 1) + int num30 = num8; + int num31 = 370 + Main.screenWidth / 2 - 400; + if (index70 == 0) + str3 = Lang.menu[95].Value; + if (index70 == 1) { - str6 = Lang.menu[96].Value; - num31 += 30; + str3 = Lang.menu[96].Value; + num30 += 30; } - if (index83 == 2) + if (index70 == 2) { - str6 = Lang.menu[97].Value; - num31 += 60; + str3 = Lang.menu[97].Value; + num30 += 60; } - if (index83 == 3) + if (index70 == 3) { - str6 = string.Concat((object) Main.selColor.R); - num32 += 90; + str3 = string.Concat((object) Main.selColor.R); + num31 += 90; } - if (index83 == 4) + if (index70 == 4) { - str6 = string.Concat((object) Main.selColor.G); - num32 += 90; - num31 += 30; + str3 = string.Concat((object) Main.selColor.G); + num31 += 90; + num30 += 30; } - if (index83 == 5) + if (index70 == 5) { - str6 = string.Concat((object) Main.selColor.B); - num32 += 90; - num31 += 60; + str3 = string.Concat((object) Main.selColor.B); + num31 += 90; + num30 += 60; } - for (int index84 = 0; index84 < 5; ++index84) + for (int index71 = 0; index71 < 5; ++index71) { Microsoft.Xna.Framework.Color color5 = Microsoft.Xna.Framework.Color.Black; - if (index84 == 4) + if (index71 == 4) { color5 = color1; color5.R = (byte) (((int) byte.MaxValue + (int) color5.R) / 2); @@ -37365,100 +37803,100 @@ label_623: color5.B = (byte) (((int) byte.MaxValue + (int) color5.R) / 2); } int maxValue = (int) byte.MaxValue; - int num33 = (int) color5.R - ((int) byte.MaxValue - maxValue); - if (num33 < 0) - num33 = 0; - color5 = new Microsoft.Xna.Framework.Color((int) (byte) num33, (int) (byte) num33, (int) (byte) num33, (int) (byte) maxValue); + int num32 = (int) color5.R - ((int) byte.MaxValue - maxValue); + if (num32 < 0) + num32 = 0; + color5 = new Microsoft.Xna.Framework.Color((int) (byte) num32, (int) (byte) num32, (int) (byte) num32, (int) (byte) maxValue); + int num33 = 0; int num34 = 0; - int num35 = 0; - if (index84 == 0) + if (index71 == 0) + num33 = -2; + if (index71 == 1) + num33 = 2; + if (index71 == 2) num34 = -2; - if (index84 == 1) + if (index71 == 3) num34 = 2; - if (index84 == 2) - num35 = -2; - if (index84 == 3) - num35 = 2; - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.DeathText.Value, str6, new Vector2((float) (num32 + num34), (float) (num31 + num35)), color5, 0.0f, new Vector2(), 0.5f, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontDeathText, str3, new Vector2((float) (num31 + num33), (float) (num30 + num34)), color5, 0.0f, new Vector2(), 0.5f, SpriteEffects.None, 0.0f); } } bool flag10 = false; - for (int index85 = 0; index85 < 2; ++index85) + for (int index72 = 0; index72 < 2; ++index72) { - for (int index86 = 0; index86 < 3; ++index86) + for (int index73 = 0; index73 < 3; ++index73) { - int num36 = num8 + index86 * 30 - 12; - int num37 = 360 + Main.screenWidth / 2 - 400; - float num38 = 0.9f; - int num39; - if (index85 == 0) + int num35 = num8 + index73 * 30 - 12; + int num36 = 360 + Main.screenWidth / 2 - 400; + float num37 = 0.9f; + int num38; + if (index72 == 0) { - num39 = num37 - 70; - num36 += 2; + num38 = num36 - 70; + num35 += 2; } else - num39 = num37 - 40; - string str7 = "-"; - if (index85 == 1) - str7 = "+"; + num38 = num36 - 40; + string str4 = "-"; + if (index72 == 1) + str4 = "+"; Vector2 vector2 = new Vector2(24f, 24f); - int num40 = 142; - if (Main.mouseX > num39 && (double) Main.mouseX < (double) num39 + (double) vector2.X && Main.mouseY > num36 + 13 && (double) Main.mouseY < (double) (num36 + 13) + (double) vector2.Y) + int num39 = 142; + if (Main.mouseX > num38 && (double) Main.mouseX < (double) num38 + (double) vector2.X && Main.mouseY > num35 + 13 && (double) Main.mouseY < (double) (num35 + 13) + (double) vector2.Y) { - if (Main.focusColor != (index85 + 1) * (index86 + 10)) - SoundEngine.PlaySound(12); - Main.focusColor = (index85 + 1) * (index86 + 10); + if (Main.focusColor != (index72 + 1) * (index73 + 10)) + Main.PlaySound(12); + Main.focusColor = (index72 + 1) * (index73 + 10); flag10 = true; - num40 = (int) byte.MaxValue; + num39 = (int) byte.MaxValue; if (Main.mouseLeft) { if (Main.colorDelay <= 1) { Main.colorDelay = Main.colorDelay != 0 ? 3 : 40; - int num41 = index85; - if (index85 == 0) + int num40 = index72; + if (index72 == 0) { - num41 = -1; + num40 = -1; if ((int) Main.selColor.R + (int) Main.selColor.G + (int) Main.selColor.B <= 150) - num41 = 0; + num40 = 0; } - if (index86 == 0 && (int) Main.selColor.R + num41 >= 0 && (int) Main.selColor.R + num41 <= (int) byte.MaxValue) - Main.selColor.R += (byte) num41; - if (index86 == 1 && (int) Main.selColor.G + num41 >= 0 && (int) Main.selColor.G + num41 <= (int) byte.MaxValue) - Main.selColor.G += (byte) num41; - if (index86 == 2 && (int) Main.selColor.B + num41 >= 0 && (int) Main.selColor.B + num41 <= (int) byte.MaxValue) - Main.selColor.B += (byte) num41; + if (index73 == 0 && (int) Main.selColor.R + num40 >= 0 && (int) Main.selColor.R + num40 <= (int) byte.MaxValue) + Main.selColor.R += (byte) num40; + if (index73 == 1 && (int) Main.selColor.G + num40 >= 0 && (int) Main.selColor.G + num40 <= (int) byte.MaxValue) + Main.selColor.G += (byte) num40; + if (index73 == 2 && (int) Main.selColor.B + num40 >= 0 && (int) Main.selColor.B + num40 <= (int) byte.MaxValue) + Main.selColor.B += (byte) num40; } --Main.colorDelay; } else Main.colorDelay = 0; } - for (int index87 = 0; index87 < 5; ++index87) + for (int index74 = 0; index74 < 5; ++index74) { Microsoft.Xna.Framework.Color color6 = Microsoft.Xna.Framework.Color.Black; - if (index87 == 4) + if (index74 == 4) { color6 = color1; color6.R = (byte) (((int) byte.MaxValue + (int) color6.R) / 2); color6.G = (byte) (((int) byte.MaxValue + (int) color6.R) / 2); color6.B = (byte) (((int) byte.MaxValue + (int) color6.R) / 2); } - int num42 = (int) color6.R - ((int) byte.MaxValue - num40); - if (num42 < 0) - num42 = 0; - color6 = new Microsoft.Xna.Framework.Color((int) (byte) num42, (int) (byte) num42, (int) (byte) num42, (int) (byte) num40); + int num41 = (int) color6.R - ((int) byte.MaxValue - num39); + if (num41 < 0) + num41 = 0; + color6 = new Microsoft.Xna.Framework.Color((int) (byte) num41, (int) (byte) num41, (int) (byte) num41, (int) (byte) num39); + int num42 = 0; int num43 = 0; - int num44 = 0; - if (index87 == 0) + if (index74 == 0) + num42 = -2; + if (index74 == 1) + num42 = 2; + if (index74 == 2) num43 = -2; - if (index87 == 1) + if (index74 == 3) num43 = 2; - if (index87 == 2) - num44 = -2; - if (index87 == 3) - num44 = 2; - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.DeathText.Value, str7, new Vector2((float) (num39 + num43), (float) (num36 + num44)), color6, 0.0f, new Vector2(), num38, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontDeathText, str4, new Vector2((float) (num38 + num42), (float) (num35 + num43)), color6, 0.0f, new Vector2(), num37, SpriteEffects.None, 0.0f); } } } @@ -37470,39 +37908,38 @@ label_623: } if (flag2) { - float x = (float) (Main.screenWidth / 2 - 40 + 37); - int num45 = 320; + int num44 = 320; string text = ""; - for (int index88 = 0; index88 < 6; ++index88) + for (int index75 = 0; index75 < 6; ++index75) { - int num46 = num45; - int num47 = 370 + Main.screenWidth / 2 - 400 + 37; - switch (index88) + int num45 = num44; + int num46 = 370 + Main.screenWidth / 2 - 400; + switch (index75) { case 0: text = Lang.menu[98].Value; - num46 += 30; + num45 += 30; break; case 1: text = Lang.menu[99].Value; break; case 2: text = Lang.menu[119].Value; - num46 += 60; + num45 += 60; break; case 3: text = Math.Round((double) Main.musicVolume * 100.0).ToString() + "%"; - num47 += 90; + num46 += 90; break; case 4: text = Math.Round((double) Main.soundVolume * 100.0).ToString() + "%"; - num47 += 90; - num46 += 30; + num46 += 90; + num45 += 30; break; case 5: text = Math.Round((double) Main.ambientVolume * 100.0).ToString() + "%"; - num47 += 90; - num46 += 60; + num46 += 90; + num45 += 60; break; } Microsoft.Xna.Framework.Color textColor = color1; @@ -37510,65 +37947,65 @@ label_623: textColor.G = (byte) (((int) byte.MaxValue + (int) textColor.R) / 2); textColor.B = (byte) (((int) byte.MaxValue + (int) textColor.R) / 2); int maxValue = (int) byte.MaxValue; - int num48 = (int) textColor.R - ((int) byte.MaxValue - maxValue); - if (num48 < 0) - num48 = 0; - textColor = new Microsoft.Xna.Framework.Color((int) (byte) num48, (int) (byte) num48, (int) (byte) num48, (int) (byte) maxValue); - Utils.DrawBorderStringFourWay(Main.spriteBatch, FontAssets.DeathText.Value, text, (float) num47, (float) num46, textColor, Microsoft.Xna.Framework.Color.Black, Vector2.Zero, 0.5f); + int num47 = (int) textColor.R - ((int) byte.MaxValue - maxValue); + if (num47 < 0) + num47 = 0; + textColor = new Microsoft.Xna.Framework.Color((int) (byte) num47, (int) (byte) num47, (int) (byte) num47, (int) (byte) maxValue); + Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontDeathText, text, (float) num46, (float) num45, textColor, Microsoft.Xna.Framework.Color.Black, Vector2.Zero, 0.5f); } int rightHover = IngameOptions.rightHover; IngameOptions.rightHover = -1; if (!Main.mouseLeft) IngameOptions.rightLock = -1; - IngameOptions.valuePosition = new Vector2(x, (float) (num45 - 18 + 30)); - GamepadMainMenuHandler.MenuItemPositions.Add(IngameOptions.valuePosition - TextureAssets.ColorBar.Value.Size() * new Vector2(0.5f, 0.0f)); - float num49 = IngameOptions.DrawValueBar(Main.spriteBatch, 1f, Main.musicVolume); + IngameOptions.valuePosition = new Vector2((float) (Main.screenWidth / 2 - 40), (float) (num44 - 18 + 30)); + GamepadMainMenuHandler.MenuItemPositions.Add(IngameOptions.valuePosition - Main.colorBarTexture.Size() * new Vector2(0.5f, 0.0f)); + float num48 = IngameOptions.DrawValueBar(Main.spriteBatch, 1f, Main.musicVolume); if (IngameOptions.inBar || IngameOptions.rightLock == 3) { UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 2; IngameOptions.rightHover = 3; - if (flag8 && IngameOptions.rightLock == 3) - Main.musicVolume = num49; + if (Main.mouseLeft && IngameOptions.rightLock == 3) + Main.musicVolume = num48; } - IngameOptions.valuePosition = new Vector2(x, (float) (num45 - 18 + 60)); - GamepadMainMenuHandler.MenuItemPositions.Add(IngameOptions.valuePosition - TextureAssets.ColorBar.Value.Size() * new Vector2(0.5f, 0.0f)); - float num50 = IngameOptions.DrawValueBar(Main.spriteBatch, 1f, Main.soundVolume); + IngameOptions.valuePosition = new Vector2((float) (Main.screenWidth / 2 - 40), (float) (num44 - 18 + 60)); + GamepadMainMenuHandler.MenuItemPositions.Add(IngameOptions.valuePosition - Main.colorBarTexture.Size() * new Vector2(0.5f, 0.0f)); + float num49 = IngameOptions.DrawValueBar(Main.spriteBatch, 1f, Main.soundVolume); if (IngameOptions.inBar || IngameOptions.rightLock == 2) { UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 3; IngameOptions.rightHover = 2; - if (flag8 && IngameOptions.rightLock == 2) - Main.soundVolume = num50; + if (Main.mouseLeft && IngameOptions.rightLock == 2) + Main.soundVolume = num49; } - IngameOptions.valuePosition = new Vector2(x, (float) (num45 - 18 + 90)); - GamepadMainMenuHandler.MenuItemPositions.Add(IngameOptions.valuePosition - TextureAssets.ColorBar.Value.Size() * new Vector2(0.5f, 0.0f)); - float num51 = IngameOptions.DrawValueBar(Main.spriteBatch, 1f, Main.ambientVolume); + IngameOptions.valuePosition = new Vector2((float) (Main.screenWidth / 2 - 40), (float) (num44 - 18 + 90)); + GamepadMainMenuHandler.MenuItemPositions.Add(IngameOptions.valuePosition - Main.colorBarTexture.Size() * new Vector2(0.5f, 0.0f)); + float num50 = IngameOptions.DrawValueBar(Main.spriteBatch, 1f, Main.ambientVolume); if (IngameOptions.inBar || IngameOptions.rightLock == 4) { UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 4; IngameOptions.rightHover = 4; - if (flag8 && IngameOptions.rightLock == 4) - Main.ambientVolume = num51; + if (Main.mouseLeft && IngameOptions.rightLock == 4) + Main.ambientVolume = num50; } if (IngameOptions.rightHover != -1) IngameOptions.rightLock = IngameOptions.rightHover; if (IngameOptions.rightHover != rightHover) - SoundEngine.PlaySound(12); + Main.PlaySound(12); } if (flag3) { - int num52 = 400; - string str8 = ""; - for (int index89 = 0; index89 < 4; ++index89) + int num51 = 400; + string str = ""; + for (int index76 = 0; index76 < 4; ++index76) { - int num53 = num52; - int num54 = 370 + Main.screenWidth / 2 - 400; - if (index89 == 0) - str8 = Lang.menu[52].Value + ": " + (object) Main.bgScroll; - for (int index90 = 0; index90 < 5; ++index90) + int num52 = num51; + int num53 = 370 + Main.screenWidth / 2 - 400; + if (index76 == 0) + str = Lang.menu[52].Value + ": " + (object) Main.bgScroll; + for (int index77 = 0; index77 < 5; ++index77) { Microsoft.Xna.Framework.Color color7 = Microsoft.Xna.Framework.Color.Black; - if (index90 == 4) + if (index77 == 4) { color7 = color1; color7.R = (byte) (((int) byte.MaxValue + (int) color7.R) / 2); @@ -37576,36 +38013,36 @@ label_623: color7.B = (byte) (((int) byte.MaxValue + (int) color7.R) / 2); } int maxValue = (int) byte.MaxValue; - int num55 = (int) color7.R - ((int) byte.MaxValue - maxValue); - if (num55 < 0) - num55 = 0; - color7 = new Microsoft.Xna.Framework.Color((int) (byte) num55, (int) (byte) num55, (int) (byte) num55, (int) (byte) maxValue); + int num54 = (int) color7.R - ((int) byte.MaxValue - maxValue); + if (num54 < 0) + num54 = 0; + color7 = new Microsoft.Xna.Framework.Color((int) (byte) num54, (int) (byte) num54, (int) (byte) num54, (int) (byte) maxValue); + int num55 = 0; int num56 = 0; - int num57 = 0; - if (index90 == 0) + if (index77 == 0) + num55 = -2; + if (index77 == 1) + num55 = 2; + if (index77 == 2) num56 = -2; - if (index90 == 1) + if (index77 == 3) num56 = 2; - if (index90 == 2) - num57 = -2; - if (index90 == 3) - num57 = 2; - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.DeathText.Value, str8, new Vector2((float) (num54 + num56), (float) (num53 + num57)), color7, 0.0f, new Vector2(), 0.5f, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontDeathText, str, new Vector2((float) (num53 + num55), (float) (num52 + num56)), color7, 0.0f, new Vector2(), 0.5f, SpriteEffects.None, 0.0f); } } IngameOptions.rightHover = -1; if (!Main.mouseLeft) IngameOptions.rightLock = -1; - IngameOptions.valuePosition = new Vector2((float) (Main.screenWidth / 2 - 40), (float) (num52 + 12)); - GamepadMainMenuHandler.MenuItemPositions.Add(IngameOptions.valuePosition - TextureAssets.ColorBar.Value.Size() * new Vector2(0.5f, 0.0f)); - float num58 = IngameOptions.DrawValueBar(Main.spriteBatch, 1f, (float) Main.bgScroll / 100f); + IngameOptions.valuePosition = new Vector2((float) (Main.screenWidth / 2 - 40), (float) (num51 + 12)); + GamepadMainMenuHandler.MenuItemPositions.Add(IngameOptions.valuePosition - Main.colorBarTexture.Size() * new Vector2(0.5f, 0.0f)); + float num57 = IngameOptions.DrawValueBar(Main.spriteBatch, 1f, (float) Main.bgScroll / 100f); if (IngameOptions.inBar || IngameOptions.rightLock == 2) { UILinkPointNavigator.Shortcuts.OPTIONS_BUTTON_SPECIALFEATURE = 1; IngameOptions.rightHover = 2; - if (flag8 && IngameOptions.rightLock == 2) + if (Main.mouseLeft && IngameOptions.rightLock == 2) { - Main.bgScroll = (int) ((double) num58 * 100.0); + Main.bgScroll = (int) ((double) num57 * 100.0); Main.caveParallax = (float) (1.0 - (double) Main.bgScroll / 500.0); } } @@ -37613,19 +38050,19 @@ label_623: IngameOptions.rightLock = IngameOptions.rightHover; } bool flag11 = false; - for (int index91 = 0; index91 < num5; ++index91) + for (int index78 = 0; index78 < num5; ++index78) { - if (strArray1[index91] != null) + if (strArray1[index78] != null) { - Vector2 vector2_1 = FontAssets.DeathText.Value.MeasureString(strArray1[index91]); + Vector2 vector2_1 = Main.fontDeathText.MeasureString(strArray1[index78]); vector2_1.X *= 0.5f; vector2_1.Y *= 0.5f; - for (int index92 = 0; index92 < 5; ++index92) + for (int index79 = 0; index79 < 5; ++index79) { Microsoft.Xna.Framework.Color color8 = Microsoft.Xna.Framework.Color.Black; - if (index92 == 4) + if (index79 == 4) { - switch (numArray3[index91]) + switch (numArray3[index78]) { case 0: color8 = color1; @@ -37652,29 +38089,29 @@ label_623: color8.G = (byte) (((int) byte.MaxValue + (int) color8.G) / 2); color8.B = (byte) (((int) byte.MaxValue + (int) color8.B) / 2); } - int num59 = (int) ((double) byte.MaxValue * ((double) this.menuItemScale[index91] * 2.0 - 1.0)); - if (flagArray1[index91]) - num59 = (int) byte.MaxValue; - int num60 = (int) color8.R - ((int) byte.MaxValue - num59); + int num58 = (int) ((double) byte.MaxValue * ((double) this.menuItemScale[index78] * 2.0 - 1.0)); + if (flagArray1[index78]) + num58 = (int) byte.MaxValue; + int num59 = (int) color8.R - ((int) byte.MaxValue - num58); + if (num59 < 0) + num59 = 0; + int num60 = (int) color8.G - ((int) byte.MaxValue - num58); if (num60 < 0) num60 = 0; - int num61 = (int) color8.G - ((int) byte.MaxValue - num59); + int num61 = (int) color8.B - ((int) byte.MaxValue - num58); if (num61 < 0) num61 = 0; - int num62 = (int) color8.B - ((int) byte.MaxValue - num59); - if (num62 < 0) - num62 = 0; - if (num18 == index91 && index92 == 4) + if (num17 == index78 && index79 == 4) { - float num63 = (float) num59 / (float) byte.MaxValue; - num60 = (int) ((double) num60 * (1.0 - (double) num63) + (double) byte.MaxValue * (double) num63); - num61 = (int) ((double) num61 * (1.0 - (double) num63) + 215.0 * (double) num63); - num62 = (int) ((double) num62 * (1.0 - (double) num63) + 0.0 * (double) num63); + float num62 = (float) num58 / (float) byte.MaxValue; + num59 = (int) ((double) num59 * (1.0 - (double) num62) + (double) byte.MaxValue * (double) num62); + num60 = (int) ((double) num60 * (1.0 - (double) num62) + 215.0 * (double) num62); + num61 = (int) ((double) num61 * (1.0 - (double) num62) + 0.0 * (double) num62); } - color8 = new Microsoft.Xna.Framework.Color((int) (byte) num60, (int) (byte) num61, (int) (byte) num62, (int) (byte) num59); - if (flagArray3[index91]) + color8 = new Microsoft.Xna.Framework.Color((int) (byte) num59, (int) (byte) num60, (int) (byte) num61, (int) (byte) num58); + if (flagArray3[index78]) { - if (index92 == 4) + if (index79 == 4) { color8.R = (byte) ((int) color8.R * (int) Main.mouseTextColor / 300); color8.G = (byte) ((int) color8.G * (int) Main.mouseTextColor / 300); @@ -37684,151 +38121,167 @@ label_623: else color8.A -= (byte) ((uint) Main.mouseTextColor / 5U); } + int num63 = 0; int num64 = 0; - int num65 = 0; - if (index92 == 0) + if (index79 == 0) + num63 = -2; + if (index79 == 1) + num63 = 2; + if (index79 == 2) num64 = -2; - if (index92 == 1) + if (index79 == 3) num64 = 2; - if (index92 == 2) - num65 = -2; - if (index92 == 3) - num65 = 2; - float num66 = this.menuItemScale[index91]; - if (Main.menuMode == 15 && index91 == 0) - num66 *= 0.35f; - else if (Main.menuMode == 1000000 && index91 == 0) - num66 *= 0.75f; + float num65 = this.menuItemScale[index78]; + if (Main.menuMode == 15 && index78 == 0) + num65 *= 0.35f; else if (Main.netMode == 2) - num66 *= 0.5f; - float num67 = num66 * numArray4[index91]; - if (!flagArray4[index91]) - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.DeathText.Value, strArray1[index91], new Vector2((float) (num3 + num64 + numArray2[index91]), (float) (num2 + num4 * index91 + num65) + vector2_1.Y * numArray4[index91] + (float) numArray1[index91]), color8, 0.0f, vector2_1, num67, SpriteEffects.None, 0.0f); + num65 *= 0.5f; + float num66 = num65 * numArray4[index78]; + if (!flagArray4[index78]) + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontDeathText, strArray1[index78], new Vector2((float) (num3 + num63 + numArray2[index78]), (float) (num2 + num4 * index78 + num64) + vector2_1.Y * numArray4[index78] + (float) numArray1[index78]), color8, 0.0f, vector2_1, num66, SpriteEffects.None, 0.0f); else - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.DeathText.Value, strArray1[index91], new Vector2((float) (num3 + num64 + numArray2[index91]), (float) (num2 + num4 * index91 + num65) + vector2_1.Y * numArray4[index91] + (float) numArray1[index91]), color8, 0.0f, new Vector2(0.0f, vector2_1.Y), num67, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontDeathText, strArray1[index78], new Vector2((float) (num3 + num63 + numArray2[index78]), (float) (num2 + num4 * index78 + num64) + vector2_1.Y * numArray4[index78] + (float) numArray1[index78]), color8, 0.0f, new Vector2(0.0f, vector2_1.Y), num66, SpriteEffects.None, 0.0f); } - if (!flagArray1[index91] && !flagArray2[index91]) - GamepadMainMenuHandler.MenuItemPositions.Add(new Vector2((float) (num3 + numArray2[index91]), (float) (num2 + num4 * index91) + vector2_1.Y * numArray4[index91] + (float) numArray1[index91])); - if (!flagArray4[index91]) + if (!flagArray1[index78] && !flagArray2[index78]) + GamepadMainMenuHandler.MenuItemPositions.Add(new Vector2((float) (num3 + numArray2[index78]), (float) (num2 + num4 * index78) + vector2_1.Y * numArray4[index78] + (float) numArray1[index78])); + if (!flagArray4[index78]) { - int num68 = 0; - this.menuWide[index91] = false; - Vector2 vector2_2 = FontAssets.DeathText.Value.MeasureString(strArray1[index91]) * numArray4[index91]; - if ((double) Main.mouseX > (double) num3 - (double) vector2_2.X * 0.5 + (double) numArray2[index91] - (double) num68 && (double) Main.mouseX < (double) num3 + (double) vector2_2.X * 0.5 * (double) numArray4[index91] + (double) numArray2[index91] + (double) num68 && Main.mouseY > num2 + num4 * index91 + numArray1[index91] && (double) Main.mouseY < (double) (num2 + num4 * index91 + numArray1[index91]) + 50.0 * (double) numArray4[index91] && Main.hasFocus) + int num67 = 0; + this.menuWide[index78] = false; + Vector2 vector2_2 = Main.fontDeathText.MeasureString(strArray1[index78]) * numArray4[index78]; + if ((double) Main.mouseX > (double) num3 - (double) vector2_2.X * 0.5 + (double) numArray2[index78] - (double) num67 && (double) Main.mouseX < (double) num3 + (double) vector2_2.X * 0.5 * (double) numArray4[index78] + (double) numArray2[index78] + (double) num67 && Main.mouseY > num2 + num4 * index78 + numArray1[index78] && (double) Main.mouseY < (double) (num2 + num4 * index78 + numArray1[index78]) + 50.0 * (double) numArray4[index78] && Main.hasFocus) { - this.focusMenu = index91; - if (flagArray1[index91] || flagArray2[index91]) + this.focusMenu = index78; + if (flagArray1[index78] || flagArray2[index78]) { this.focusMenu = -1; } else { - if (num18 != this.focusMenu) + if (num17 != this.focusMenu) flag11 = true; if (Main.mouseLeftRelease && Main.mouseLeft) - this.selectedMenu = index91; + this.selectedMenu = index78; if (Main.mouseRightRelease && Main.mouseRight) - this.selectedMenu2 = index91; + this.selectedMenu2 = index78; } } } else { - Vector2 vector2_3 = FontAssets.DeathText.Value.MeasureString(strArray1[index91]) * numArray4[index91]; - if (Main.mouseX > num3 + numArray2[index91] && (double) Main.mouseX < (double) num3 + (double) vector2_3.X + (double) numArray2[index91] && Main.mouseY > num2 + num4 * index91 + numArray1[index91] && (double) Main.mouseY < (double) (num2 + num4 * index91 + numArray1[index91]) + 50.0 * (double) numArray4[index91] && Main.hasFocus) + Vector2 vector2_3 = Main.fontDeathText.MeasureString(strArray1[index78]) * numArray4[index78]; + if (Main.mouseX > num3 + numArray2[index78] && (double) Main.mouseX < (double) num3 + (double) vector2_3.X + (double) numArray2[index78] && Main.mouseY > num2 + num4 * index78 + numArray1[index78] && (double) Main.mouseY < (double) (num2 + num4 * index78 + numArray1[index78]) + 50.0 * (double) numArray4[index78] && Main.hasFocus) { - this.focusMenu = index91; - if (flagArray1[index91] || flagArray2[index91]) + this.focusMenu = index78; + if (flagArray1[index78] || flagArray2[index78]) { this.focusMenu = -1; } else { - if (num18 != this.focusMenu) + if (num17 != this.focusMenu) flag11 = true; if (Main.mouseLeftRelease && Main.mouseLeft) - this.selectedMenu = index91; + this.selectedMenu = index78; if (Main.mouseRightRelease && Main.mouseRight) - this.selectedMenu2 = index91; + this.selectedMenu2 = index78; } } } } } - if (flag11 && num18 != this.focusMenu) - SoundEngine.PlaySound(12); + if (flag11 && num17 != this.focusMenu) + Main.PlaySound(12); if (GamepadMainMenuHandler.MenuItemPositions.Count == 0) { - Vector2 vector2 = new Vector2((float) Math.Cos((double) Main.GlobalTimeWrappedHourly * 6.28318548202515), (float) Math.Sin((double) Main.GlobalTimeWrappedHourly * 6.28318548202515 * 2.0)) * new Vector2(30f, 15f) + Vector2.UnitY * 20f; + Vector2 vector2 = new Vector2((float) Math.Cos((double) Main.GlobalTime * 6.28318548202515), (float) Math.Sin((double) Main.GlobalTime * 6.28318548202515 * 2.0)) * new Vector2(30f, 15f) + Vector2.UnitY * 20f; UILinkPointNavigator.SetPosition(2000, new Vector2((float) Main.screenWidth, (float) Main.screenHeight) / 2f + vector2); } - for (int index93 = 0; index93 < Main.maxMenuItems; ++index93) + for (int index80 = 0; index80 < Main.maxMenuItems; ++index80) { - if (index93 == this.focusMenu) + if (index80 == this.focusMenu) { - if ((double) this.menuItemScale[index93] < 1.0) - this.menuItemScale[index93] += 0.02f; - if ((double) this.menuItemScale[index93] > 1.0) - this.menuItemScale[index93] = 1f; + if ((double) this.menuItemScale[index80] < 1.0) + this.menuItemScale[index80] += 0.02f; + if ((double) this.menuItemScale[index80] > 1.0) + this.menuItemScale[index80] = 1f; } - else if ((double) this.menuItemScale[index93] > 0.8) - this.menuItemScale[index93] -= 0.02f; + else if ((double) this.menuItemScale[index80] > 0.8) + this.menuItemScale[index80] -= 0.02f; } if (flag4) { Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, Main.UIScaleMatrix); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise); Player pendingPlayer = Main.PendingPlayer; pendingPlayer.PlayerFrame(); pendingPlayer.position.X = (float) num6 + Main.screenPosition.X; pendingPlayer.position.Y = (float) num7 + Main.screenPosition.Y; - Main.PlayerRenderer.DrawPlayer(Main.Camera, pendingPlayer, pendingPlayer.position, 0.0f, Vector2.Zero); + this.DrawPlayer(pendingPlayer, pendingPlayer.position, 0.0f, Vector2.Zero); Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, Main.UIScaleMatrix); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise); } - if (!WorldGen.drunkWorldGen) + for (int index81 = 0; index81 < 5; ++index81) { - for (int index94 = 0; index94 < 5; ++index94) + Microsoft.Xna.Framework.Color color9 = Microsoft.Xna.Framework.Color.Black; + if (index81 == 4) { - Microsoft.Xna.Framework.Color color9 = Microsoft.Xna.Framework.Color.Black; - if (index94 == 4) - { - color9 = color1; - color9.R = (byte) (((int) byte.MaxValue + (int) color9.R) / 2); - color9.G = (byte) (((int) byte.MaxValue + (int) color9.R) / 2); - color9.B = (byte) (((int) byte.MaxValue + (int) color9.R) / 2); - } - color9.A = (byte) ((double) color9.A * 0.300000011920929); - int num69 = 0; - int num70 = 0; - if (index94 == 0) - num69 = -2; - if (index94 == 1) - num69 = 2; - if (index94 == 2) - num70 = -2; - if (index94 == 3) - num70 = 2; - Vector2 vector2 = FontAssets.MouseText.Value.MeasureString(Main.versionNumber); - vector2.X *= 0.5f; - vector2.Y *= 0.5f; - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, Main.versionNumber, new Vector2((float) ((double) vector2.X + (double) num69 + 10.0), (float) ((double) Main.screenHeight - (double) vector2.Y + (double) num70 - 2.0)), color9, 0.0f, vector2, 1f, SpriteEffects.None, 0.0f); + color9 = color1; + color9.R = (byte) (((int) byte.MaxValue + (int) color9.R) / 2); + color9.G = (byte) (((int) byte.MaxValue + (int) color9.R) / 2); + color9.B = (byte) (((int) byte.MaxValue + (int) color9.R) / 2); } + color9.A = (byte) ((double) color9.A * 0.300000011920929); + int num68 = 0; + int num69 = 0; + if (index81 == 0) + num68 = -2; + if (index81 == 1) + num68 = 2; + if (index81 == 2) + num69 = -2; + if (index81 == 3) + num69 = 2; + string str = "Copyright © 2017 Re-Logic"; + Vector2 vector2 = Main.fontMouseText.MeasureString(str); + vector2.X *= 0.5f; + vector2.Y *= 0.5f; + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str, new Vector2((float) ((double) Main.screenWidth - (double) vector2.X + (double) num68 - 10.0), (float) ((double) Main.screenHeight - (double) vector2.Y + (double) num69 - 2.0)), color9, 0.0f, vector2, 1f, SpriteEffects.None, 0.0f); + } + for (int index82 = 0; index82 < 5; ++index82) + { + Microsoft.Xna.Framework.Color color10 = Microsoft.Xna.Framework.Color.Black; + if (index82 == 4) + { + color10 = color1; + color10.R = (byte) (((int) byte.MaxValue + (int) color10.R) / 2); + color10.G = (byte) (((int) byte.MaxValue + (int) color10.R) / 2); + color10.B = (byte) (((int) byte.MaxValue + (int) color10.R) / 2); + } + color10.A = (byte) ((double) color10.A * 0.300000011920929); + int num70 = 0; + int num71 = 0; + if (index82 == 0) + num70 = -2; + if (index82 == 1) + num70 = 2; + if (index82 == 2) + num71 = -2; + if (index82 == 3) + num71 = 2; + Vector2 vector2 = Main.fontMouseText.MeasureString(Main.versionNumber); + vector2.X *= 0.5f; + vector2.Y *= 0.5f; + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, Main.versionNumber, new Vector2((float) ((double) vector2.X + (double) num70 + 10.0), (float) ((double) Main.screenHeight - (double) vector2.Y + (double) num71 - 2.0)), color10, 0.0f, vector2, 1f, SpriteEffects.None, 0.0f); } - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.SamplerStateForCursor, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, Main.UIScaleMatrix); Main.DrawCursor(Main.DrawThickCursor()); - Main.DrawPendingMouseText(); if (Main.fadeCounter > 0) { - Microsoft.Xna.Framework.Color color10 = Microsoft.Xna.Framework.Color.White; + Microsoft.Xna.Framework.Color color11 = Microsoft.Xna.Framework.Color.White; --Main.fadeCounter; - float num71 = (float) ((double) Main.fadeCounter / 120.0 * (double) byte.MaxValue); - if (this.quickSplash) - num71 = (float) ((double) Main.fadeCounter / 75.0 * (double) byte.MaxValue); - byte num72 = (byte) num71; - color10 = new Microsoft.Xna.Framework.Color((int) num72, (int) num72, (int) num72, (int) num72); - Main.spriteBatch.Draw(TextureAssets.Fade.Value, new Microsoft.Xna.Framework.Rectangle(-5, -5, Main.screenWidth + 10, Main.screenHeight + 10), color10); + byte num72 = (byte) ((double) Main.fadeCounter / 75.0 * (double) byte.MaxValue); + color11 = new Microsoft.Xna.Framework.Color((int) num72, (int) num72, (int) num72, (int) num72); + Main.spriteBatch.Draw(Main.fadeTexture, new Microsoft.Xna.Framework.Rectangle(0, 0, Main.screenWidth, Main.screenHeight), color11); } Main.spriteBatch.End(); Main.mouseLeftRelease = !Main.mouseLeft; @@ -37838,178 +38291,7 @@ label_623: GamepadMainMenuHandler.LastDrew = menuMode1; } - private static void ClearVisualPostProcessEffects() - { - for (int index = 0; index < 13; ++index) - { - string key = ""; - switch (index) - { - case 0: - key = "Solar"; - break; - case 1: - key = "Vortex"; - break; - case 2: - key = "Nebula"; - break; - case 3: - key = "Stardust"; - break; - case 4: - key = "MoonLord"; - break; - case 5: - key = "MonolithSolar"; - break; - case 6: - key = "MonolithVortex"; - break; - case 7: - key = "MonolithNebula"; - break; - case 8: - key = "MonolithStardust"; - break; - case 9: - key = "Blizzard"; - break; - case 10: - key = "HeatDistortion"; - break; - case 11: - key = "Sandstorm"; - break; - case 12: - key = "MonolithMoonLord"; - break; - } - if (SkyManager.Instance[key] != null && SkyManager.Instance[key].IsActive()) - SkyManager.Instance[key].Deactivate(); - if (Overlays.Scene[key] != null && Overlays.Scene[key].IsVisible()) - Overlays.Scene[key].Deactivate(); - if (Terraria.Graphics.Effects.Filters.Scene[key] != null && Terraria.Graphics.Effects.Filters.Scene[key].IsActive()) - Terraria.Graphics.Effects.Filters.Scene[key].Deactivate(); - } - if (Terraria.Graphics.Effects.Filters.Scene["BloodMoon"].IsActive()) - Terraria.Graphics.Effects.Filters.Scene["BloodMoon"].Deactivate(); - if (Terraria.Graphics.Effects.Filters.Scene["Graveyard"].IsActive()) - Terraria.Graphics.Effects.Filters.Scene["Graveyard"].Deactivate(); - if (Terraria.Graphics.Effects.Filters.Scene["BloodMoon"].IsActive()) - Terraria.Graphics.Effects.Filters.Scene["BloodMoon"].Deactivate(); - if (Terraria.Graphics.Effects.Filters.Scene["MoonLordShake"].IsActive()) - Terraria.Graphics.Effects.Filters.Scene["MoonLordShake"].Deactivate(); - if (Terraria.Graphics.Effects.Filters.Scene["WaterDistortion"].IsActive()) - Terraria.Graphics.Effects.Filters.Scene["WaterDistortion"].Deactivate(); - if (SkyManager.Instance["Martian"].IsActive()) - SkyManager.Instance["Martian"].Deactivate(); - if (SkyManager.Instance["Party"].IsActive()) - SkyManager.Instance["Party"].Deactivate(); - if (SkyManager.Instance["Slime"].IsActive()) - SkyManager.Instance["Slime"].Deactivate(); - if (SkyManager.Instance["Ambience"].IsActive()) - SkyManager.Instance["Ambience"].Deactivate(); - Main.slimeRain = false; - Main.slimeRainTime = 0.0; - Main.slimeWarningTime = 0; - BirthdayParty.WorldClear(); - LanternNight.WorldClear(); - Sandstorm.WorldClear(); - Main.maxRaining = 0.0f; - Main.raining = false; - } - - private static void PostDrawMenu(Microsoft.Xna.Framework.Point screenSizeCache, Microsoft.Xna.Framework.Point screenSizeCacheAfterScaling) - { - if (!(Main.ScreenSize == screenSizeCacheAfterScaling)) - return; - Main.screenPosition.Y -= (float) (screenSizeCache.Y - Main.screenHeight); - } - - private void PreDrawMenu(out Microsoft.Xna.Framework.Point screenSizeCache, out Microsoft.Xna.Framework.Point screenSizeCacheAfterScaling) - { - double uiScaleWanted = (double) Main._uiScaleWanted; - float num = (float) Main.screenHeight / 900f; - if ((double) num < 1.0) - num = 1f; - if (Main.SettingDontScaleMainMenuUp) - num = 1f; - screenSizeCache = Main.ScreenSize; - Main.UIScale = num; - PlayerInput.SetZoom_UI(); - screenSizeCacheAfterScaling = Main.ScreenSize; - if (this._needsMenuUIRecalculation) - { - this._needsMenuUIRecalculation = false; - Main.MenuUI.Recalculate(); - } - Main._uiScaleWanted = (float) uiScaleWanted; - } - - private static bool IsBorderlessDisplayAvailable() => true; - - private static void SetDisplayModeAsBorderless(ref int width, ref int height, Form form) - { - if (!Main.screenBorderless || Main.graphics.IsFullScreen || Main.screenBorderlessPendingResizes <= 0) - return; - --Main.screenBorderlessPendingResizes; - System.Drawing.Rectangle bounds = Screen.FromPoint(form.Location).Bounds; - width = bounds.Width; - height = bounds.Height; - Main.TryPickingDefaultUIScale((float) height); - } - - private static void ApplyBorderlessResolution(Form form) - { - if (Main.screenBorderlessPendingResizes <= 0) - return; - --Main.screenBorderlessPendingResizes; - System.Drawing.Rectangle bounds = Screen.FromPoint(form.Location).Bounds; - form.Location = new System.Drawing.Point(bounds.X, bounds.Y); - form.FormBorderStyle = FormBorderStyle.None; - form.Width = bounds.Width; - form.Height = bounds.Height; - } - - private static void SetBorderlessFormStyle(Form form) - { - form.Location = new System.Drawing.Point(0, 0); - form.FormBorderStyle = FormBorderStyle.None; - } - - public static void OpenCharacterSelectUI() - { - Main.MenuUI.SetState((UIState) Main._characterSelectMenu); - Main.menuMode = 888; - } - - public static void OpenWorldSelectUI() - { - Main.MenuUI.SetState((UIState) Main._worldSelectMenu); - Main.menuMode = 888; - } - private static void CycleClothingStyle(Player plr) - { - Main.CycleClothingStyle_Inner(plr); - while (!Main.IsValidPlayerStyle(plr)) - Main.CycleClothingStyle_Inner(plr); - } - - private static bool IsValidPlayerStyle(Player plr) - { - switch (plr.skinVariant) - { - case 10: - case 11: - return false; - default: - return true; - } - } - - private static void CycleClothingStyle_Inner(Player plr) { if (plr.Male) { @@ -38085,264 +38367,81 @@ label_623: protected void DrawSplash(GameTime gameTime) { - int num1 = 10000; this.GraphicsDevice.Clear(Microsoft.Xna.Framework.Color.Black); base.Draw(gameTime); - this.TickLoadProcess(); - long num2 = Main.splashTimer.ElapsedMilliseconds; - if ((double) Main.musicVolume == 0.0) - { - this.quickSplash = true; - num2 = 999999L; - num1 = 0; - } - if (Main.Assets.PendingAssets == 0 && this._musicLoaded && this._artLoaded && Program.LoadedEverything) - Main._isAsyncLoadComplete = true; Main.spriteBatch.Begin(); ++this.splashCounter; Microsoft.Xna.Framework.Color color = Microsoft.Xna.Framework.Color.White; - byte num3 = 0; - if (this.quickSplash) + byte num = 0; + if (this.splashCounter <= 75) + num = (byte) ((double) this.splashCounter / 75.0 * (double) byte.MaxValue); + else if (this.splashCounter <= 125) + num = byte.MaxValue; + else if (this.splashCounter <= 200) { - if (this.splashCounter <= 75) - num3 = (byte) ((double) this.splashCounter / 75.0 * (double) byte.MaxValue); - else if (this.splashCounter <= 125) - num3 = byte.MaxValue; - else if (this.splashCounter <= 200) - { - if (!Main._isAsyncLoadComplete) - this.splashCounter = 125; - num3 = (byte) ((double) (75 - (this.splashCounter - 125)) / 75.0 * (double) byte.MaxValue); - } - else - { - this.Initialize_AlmostEverything(); - Main.PostContentLoadInitialize(); - Main.showSplash = false; - Main.fadeCounter = 75; - Main.splashTimer.Stop(); - } + num = (byte) ((double) (125 - this.splashCounter) / 75.0 * (double) byte.MaxValue); } else { - int num4 = 90; - int num5 = 410; - int num6 = 620; - int num7 = 60; - if (this.splashCounter >= num4) - { - if (this.splashCounter <= num5) - { - float num8 = (float) (this.splashCounter - num4) / (float) (num5 - num4); - num3 = (byte) (num8 * (num8 * num8 * num8) * (float) byte.MaxValue); - } - else if (this.splashCounter <= num6) - { - num3 = byte.MaxValue; - if (this.splashCounter >= num6 - num7) - num3 = (byte) ((double) (num7 - (this.splashCounter - (num6 - num7))) / (double) num7 * (double) byte.MaxValue); - } - else if (!Main._isAsyncLoadComplete) - { - num3 = (byte) 0; - num1 = 1; - } - else - { - this.Initialize_AlmostEverything(); - Main.PostContentLoadInitialize(); - Main.showSplash = false; - Main.fadeCounter = 120; - Main.splashTimer.Stop(); - } - } + Main.showSplash = false; + Main.fadeCounter = 75; } - color = new Microsoft.Xna.Framework.Color((int) num3, (int) num3, (int) num3, (int) num3); - Asset splashTextureLegoBack = TextureAssets.SplashTextureLegoBack; - if (splashTextureLegoBack.Width() > 0 && splashTextureLegoBack.Height() > 0) - { - Vector2 vector2_1 = new Vector2((float) Main.screenWidth / (float) splashTextureLegoBack.Width(), (float) Main.screenHeight / (float) splashTextureLegoBack.Height()); - Vector2 vector2_2 = splashTextureLegoBack.Size() / 2f; - Vector2 position = new Vector2((float) Main.screenWidth, (float) Main.screenHeight) / 2f; - Vector2 scale1 = vector2_1; - if ((double) scale1.X > (double) scale1.Y) - scale1.X = scale1.Y; - else - scale1.Y = scale1.X; - Vector2 scale2 = vector2_1; - if ((double) scale2.X < (double) scale2.Y) - scale2.X = scale2.Y; - else - scale2.Y = scale2.X; - Main.spriteBatch.Draw(splashTextureLegoBack.Value, position, new Microsoft.Xna.Framework.Rectangle?(), color, 0.0f, splashTextureLegoBack.Size() / 2f, scale2, SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(TextureAssets.SplashTextureLegoTree.Value, Main.ScreenSize.ToVector2(), new Microsoft.Xna.Framework.Rectangle?(), color, 0.0f, TextureAssets.SplashTextureLegoTree.Size(), scale1, SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(TextureAssets.SplashTextureLegoFront.Value, position, new Microsoft.Xna.Framework.Rectangle?(), color, 0.0f, TextureAssets.SplashTextureLegoFront.Size() / 2f, scale1, SpriteEffects.None, 0.0f); - } - int num9 = 70; - if (num1 == 1) - this.DrawSplash_LoadingFlower(Microsoft.Xna.Framework.Color.White); - else if (num2 > (long) num1) - this.DrawSplash_LoadingFlower(color); - ++this._splashFrameCount; - if ((double) this._splashFrameCount >= (double) num9) - this._splashFrameCount = 0.0f; + color = new Microsoft.Xna.Framework.Color((int) num, (int) num, (int) num, (int) num); + Main.spriteBatch.Draw(Main.loTexture, new Microsoft.Xna.Framework.Rectangle(0, 0, Main.screenWidth, Main.screenHeight), color); Main.spriteBatch.End(); } - private void DrawSplash_LoadingFlower(Microsoft.Xna.Framework.Color splashColor) - { - float val2_1 = (float) Main.screenWidth / Main.MinimumZoomComparerX; - float val2_2 = (float) Main.screenHeight / Main.MinimumZoomComparerY; - float scale = Math.Max(Math.Max(1f, val2_1), val2_2); - Texture2D texture2D = TextureAssets.LoadingSunflower.Value; - int num1 = 3; - int verticalFrames = 19; - Vector2 position = new Vector2((float) (Main.screenWidth / 2), (float) Main.screenHeight) - new Vector2(0.0f, 50f) * scale; - int num2 = (int) this._splashFrameCount / num1; - if (num2 >= verticalFrames) - num2 = 0; - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(verticalFrames: verticalFrames, frameY: ((num2 + 10) % verticalFrames)); - float rotation = 0.0f; - Vector2 origin = r.Size() / 2f; - Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(r), splashColor, rotation, origin, scale, SpriteEffects.None, 0.0f); - } - - private void DrawSplash_LoadingStar(Microsoft.Xna.Framework.Color splashColor) - { - int num = 4; - Vector2 position = new Vector2((float) Main.screenWidth, (float) Main.screenHeight) - new Vector2(30f); - int frameY = (int) this._splashFrameCount / num; - if (frameY >= 15) - frameY = 0; - if (frameY >= 8) - frameY = 14 - frameY; - Microsoft.Xna.Framework.Rectangle r = TextureAssets.Item[75].Frame(verticalFrames: 8, frameY: frameY); - r.Height -= 2; - float rotation = 0.0f; - Vector2 origin = r.Size() / 2f; - origin.Y += 2f; - Main.spriteBatch.Draw(TextureAssets.Item[75].Value, position, new Microsoft.Xna.Framework.Rectangle?(r), splashColor, rotation, origin, 1f, SpriteEffects.None, 0.0f); - } - protected void DrawUnderworldBackground(bool flat) { if ((double) Main.screenPosition.Y + (double) Main.screenHeight < (double) (Main.maxTilesY - 220) * 16.0) return; - Vector2 screenOffset = Main.screenPosition + new Vector2((float) (Main.screenWidth >> 1), (float) (Main.screenHeight >> 1)); - float pushUp = (float) (((double) Main.GameViewMatrix.Zoom.Y - 1.0) * 0.5 * 200.0); - SkyManager.Instance.ResetDepthTracker(); - for (int layerTextureIndex = 4; layerTextureIndex >= 0; --layerTextureIndex) - Main.DrawUnderworldBackgroudLayer(flat, screenOffset, pushUp, layerTextureIndex); - if (!Main.mapFullscreen) - SkyManager.Instance.DrawRemainingDepth(Main.spriteBatch); - this.DrawSurfaceBG_DrawChangeOverlay(12); - } - - private static void DrawUnderworldBackgroudLayer( - bool flat, - Vector2 screenOffset, - float pushUp, - int layerTextureIndex) - { - int index1 = Main.underworldBG[layerTextureIndex]; - Asset asset = TextureAssets.Underworld[index1]; - if (!asset.IsLoaded) - Main.Assets.Request(asset.Name, (AssetRequestMode) 1); - Texture2D texture = asset.Value; - Vector2 vector2_1 = new Vector2((float) texture.Width, (float) texture.Height) * 0.5f; - float num1 = flat ? 1f : (float) (layerTextureIndex * 2) + 3f; - Vector2 vector2_2 = new Vector2(1f / num1); - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, 0, texture.Width, texture.Height); - float scale = 1.3f; - Vector2 zero = Vector2.Zero; - int num2 = 0; - switch (index1) + Vector2 vector2_1 = Main.screenPosition + new Vector2((float) (Main.screenWidth >> 1), (float) (Main.screenHeight >> 1)); + float num1 = (float) (((double) Main.GameViewMatrix.Zoom.Y - 1.0) * 0.5 * 200.0); + for (int index1 = 4; index1 >= 0; --index1) { - case 1: - int num3 = (int) ((double) Main.GlobalTimeWrappedHourly * 8.0) % 4; - rectangle = new Microsoft.Xna.Framework.Rectangle((num3 >> 1) * (texture.Width >> 1), num3 % 2 * (texture.Height >> 1), texture.Width >> 1, texture.Height >> 1); - vector2_1 *= 0.5f; - zero.Y += 175f; - break; - case 2: - zero.Y += 100f; - break; - case 3: - zero.Y += 75f; - break; - case 4: - scale = 0.5f; - zero.Y -= 0.0f; - break; - case 5: - zero.Y += (float) num2; - break; - case 6: - int num4 = (int) ((double) Main.GlobalTimeWrappedHourly * 8.0) % 4; - rectangle = new Microsoft.Xna.Framework.Rectangle(num4 % 2 * (texture.Width >> 1), (num4 >> 1) * (texture.Height >> 1), texture.Width >> 1, texture.Height >> 1); - vector2_1 *= 0.5f; - zero.Y += (float) num2; - zero.Y += -60f; - break; - case 7: - int num5 = (int) ((double) Main.GlobalTimeWrappedHourly * 8.0) % 4; - rectangle = new Microsoft.Xna.Framework.Rectangle(num5 % 2 * (texture.Width >> 1), (num5 >> 1) * (texture.Height >> 1), texture.Width >> 1, texture.Height >> 1); - vector2_1 *= 0.5f; - zero.Y += (float) num2; - zero.X -= 400f; - zero.Y += 90f; - break; - case 8: - int num6 = (int) ((double) Main.GlobalTimeWrappedHourly * 8.0) % 4; - rectangle = new Microsoft.Xna.Framework.Rectangle(num6 % 2 * (texture.Width >> 1), (num6 >> 1) * (texture.Height >> 1), texture.Width >> 1, texture.Height >> 1); - vector2_1 *= 0.5f; - zero.Y += (float) num2; - zero.Y += 90f; - break; - case 9: - zero.Y += (float) num2; - zero.Y -= 30f; - break; - case 10: - zero.Y += 250f * num1; - break; - case 11: - zero.Y += 100f * num1; - break; - case 12: - zero.Y += 20f * num1; - break; - case 13: - zero.Y += 20f * num1; - int num7 = (int) ((double) Main.GlobalTimeWrappedHourly * 8.0) % 4; - rectangle = new Microsoft.Xna.Framework.Rectangle(num7 % 2 * (texture.Width >> 1), (num7 >> 1) * (texture.Height >> 1), texture.Width >> 1, texture.Height >> 1); - vector2_1 *= 0.5f; - break; - } - if (flat) - scale *= 1.5f; - Vector2 vec = vector2_1 * scale; - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / vector2_2.X); - if (flat) - zero.Y += (float) (TextureAssets.Underworld[0].Height() >> 1) * 1.3f - vec.Y; - zero.Y -= pushUp; - float num8 = scale * (float) rectangle.Width; - int num9 = (int) ((double) (int) ((double) screenOffset.X * (double) vector2_2.X - (double) vec.X + (double) zero.X - (double) (Main.screenWidth >> 1)) / (double) num8); - Vector2 vector2_3 = vec.Floor(); - int num10 = (int) Math.Ceiling((double) Main.screenWidth / (double) num8); - int num11 = (int) ((double) scale * ((double) (rectangle.Width - 1) / (double) vector2_2.X)); - Vector2 position; - for (position = ((new Vector2((float) ((num9 - 2) * num11), (float) Main.UnderworldLayer * 16f) + vector2_3 - screenOffset) * vector2_2 + screenOffset - Main.screenPosition - vector2_3 + zero).Floor(); (double) position.X + (double) num8 < 0.0; position.X += num8) - ++num9; - for (int index2 = num9 - 2; index2 <= num9 + 4 + num10; ++index2) - { - Main.spriteBatch.Draw(texture, position, new Microsoft.Xna.Framework.Rectangle?(rectangle), Microsoft.Xna.Framework.Color.White, 0.0f, Vector2.Zero, scale, SpriteEffects.None, 0.0f); - if (layerTextureIndex == 0) + Texture2D texture = Main.underworldTexture[index1]; + Vector2 vector2_2 = new Vector2((float) texture.Width, (float) texture.Height) * 0.5f; + Vector2 vector2_3 = new Vector2(1f / (flat ? 1f : (float) (index1 * 2) + 3f)); + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, 0, texture.Width, texture.Height); + float scale = 1.3f; + Vector2 zero = Vector2.Zero; + switch (index1) { - int y = (int) ((double) position.Y + (double) rectangle.Height * (double) scale); - Main.spriteBatch.Draw(TextureAssets.BlackTile.Value, new Microsoft.Xna.Framework.Rectangle((int) position.X, y, (int) ((double) rectangle.Width * (double) scale), Math.Max(0, Main.screenHeight - y)), new Microsoft.Xna.Framework.Color(11, 3, 7)); + case 1: + int num2 = (int) ((double) Main.GlobalTime * 8.0) % 4; + rectangle = new Microsoft.Xna.Framework.Rectangle((num2 >> 1) * (texture.Width >> 1), num2 % 2 * (texture.Height >> 1), texture.Width >> 1, texture.Height >> 1); + vector2_2 *= 0.5f; + zero.Y += 75f; + break; + case 2: + zero.Y += 75f; + break; + case 3: + zero.Y += 75f; + break; + case 4: + scale = 0.5f; + zero.Y -= 25f; + break; + } + if (flat) + scale *= 1.5f; + Vector2 vector2_4 = vector2_2 * scale; + if (flat) + zero.Y += (float) (Main.underworldTexture[0].Height >> 1) * 1.3f - vector2_4.Y; + zero.Y -= num1; + float num3 = scale * (float) rectangle.Width; + int num4 = (int) (((double) vector2_1.X * (double) vector2_3.X - (double) vector2_4.X + (double) zero.X - (double) (Main.screenWidth >> 1)) / (double) num3); + for (int index2 = num4 - 2; index2 < num4 + 4 + (int) ((double) Main.screenWidth / (double) num3); ++index2) + { + Vector2 position = (new Vector2((float) ((double) index2 * (double) scale * ((double) rectangle.Width / (double) vector2_3.X)), (float) (Main.maxTilesY - 200) * 16f) + vector2_4 - vector2_1) * vector2_3 + vector2_1 - Main.screenPosition - vector2_4 + zero; + Main.spriteBatch.Draw(texture, position, new Microsoft.Xna.Framework.Rectangle?(rectangle), Microsoft.Xna.Framework.Color.White, 0.0f, Vector2.Zero, scale, SpriteEffects.None, 0.0f); + if (index1 == 0) + { + int y = (int) ((double) position.Y + (double) rectangle.Height * (double) scale); + Main.spriteBatch.Draw(Main.blackTileTexture, new Microsoft.Xna.Framework.Rectangle((int) position.X, y, (int) ((double) rectangle.Width * (double) scale), Math.Max(0, Main.screenHeight - y)), new Microsoft.Xna.Framework.Color(11, 3, 7)); + } } - position.X += num8; } } @@ -38361,51 +38460,50 @@ label_623: double num2 = Main.worldSurface + num1 - 5.0; int num3 = (int) ((double) byte.MaxValue * (1.0 - (double) Main.gfxQuality) + 140.0 * (double) Main.gfxQuality); int num4 = (int) (200.0 * (1.0 - (double) Main.gfxQuality) + 40.0 * (double) Main.gfxQuality); + int num5 = 128; Vector2 vector2 = Main.drawToScreen ? Vector2.Zero : new Vector2((float) Main.offScreenRange, (float) Main.offScreenRange); Vector3 vector3 = new Vector3(0.9f); - float num5 = MathHelper.Clamp((float) (((double) Main.screenPosition.Y - Main.worldSurface * 16.0) / 300.0), 0.0f, 1f); - Lighting.GlobalBrightness = (float) ((double) Lighting.GlobalBrightness * (1.0 - (double) num5) + 1.0 * (double) num5); - float num6 = MathHelper.Clamp((float) ((double) Main.screenPosition.Y - (double) (Main.screenHeight / 2) + 200.0 - Main.rockLayer * 16.0) / 300f, 0.0f, 1f); - int num7 = (int) (((double) Main.screenPosition.X + (double) (Main.screenWidth / 2)) / 16.0); - int num8 = (num7 > Main.caveBackX[0] ? (num7 > Main.caveBackX[1] ? (num7 > Main.caveBackX[2] ? Main.caveBackStyle[3] : Main.caveBackStyle[2]) : Main.caveBackStyle[1]) : Main.caveBackStyle[0]) + 3; - if (Main.SceneMetrics.SnowTileCount > SceneMetrics.SnowTileThreshold && ((double) Main.screenPosition.Y + (double) Main.screenHeight + 1200.0) / 16.0 < (double) (Main.maxTilesY - 250)) - num8 = 1; - if (Main.SceneMetrics.JungleTileCount > SceneMetrics.JungleTileThreshold) + float num6 = MathHelper.Clamp((float) (((double) Main.screenPosition.Y - Main.worldSurface * 16.0) / 300.0), 0.0f, 1f); + Lighting.brightness = (float) ((double) Lighting.defBrightness * (1.0 - (double) num6) + 1.0 * (double) num6); + float num7 = MathHelper.Clamp((float) ((double) Main.screenPosition.Y - (double) (Main.screenHeight / 2) + 200.0 - Main.rockLayer * 16.0) / 300f, 0.0f, 1f); + int num8 = (int) (((double) Main.screenPosition.X + (double) (Main.screenWidth / 2)) / 16.0); + int num9 = (num8 > Main.caveBackX[0] ? (num8 > Main.treeX[1] ? (num8 > Main.treeX[2] ? Main.caveBackStyle[3] : Main.caveBackStyle[2]) : Main.caveBackStyle[1]) : Main.caveBackStyle[0]) + 3; + if (Main.snowTiles > 300 && ((double) Main.screenPosition.Y + (double) Main.screenHeight) / 16.0 < (double) (Main.maxTilesY - 250)) + num9 = 1; + if (Main.jungleTiles > 80) { - if (num8 == 1) + if (num9 == 1) { - if (Main.SceneMetrics.JungleTileCount > Main.SceneMetrics.SnowTileCount) - num8 = 11; + if (Main.jungleTiles > Main.snowTiles) + num9 = 11; } else - num8 = 11; + num9 = 11; } - if (WorldGen.oceanDepths((int) ((double) Main.screenPosition.X + (double) (Main.screenHeight / 2)) / 16, (int) ((double) Main.screenPosition.Y + (double) (Main.screenHeight / 2)) / 16)) - num8 = !Main.player[Main.myPlayer].ZoneCorrupt ? (!Main.player[Main.myPlayer].ZoneCrimson ? (!Main.player[Main.myPlayer].ZoneHallow ? 18 : 20) : 21) : 19; - else if ((double) Main.screenPosition.Y / 16.0 > Main.rockLayer + 60.0 && (double) Main.screenPosition.Y / 16.0 < num2 - 60.0) + if ((double) Main.screenPosition.Y / 16.0 > Main.rockLayer + 60.0 && (double) Main.screenPosition.Y / 16.0 < num2 - 60.0) { if (Main.player[Main.myPlayer].ZoneSnow) { if (Main.player[Main.myPlayer].ZoneCorrupt) - num8 = 15; + num9 = 15; else if (Main.player[Main.myPlayer].ZoneCrimson) - num8 = 16; - else if (Main.player[Main.myPlayer].ZoneHallow) - num8 = 17; + num9 = 16; + else if (Main.player[Main.myPlayer].ZoneHoly) + num9 = 17; } else if (Main.player[Main.myPlayer].ZoneCorrupt) - num8 = 12; + num9 = 12; else if (Main.player[Main.myPlayer].ZoneCrimson) - num8 = 13; - else if (Main.player[Main.myPlayer].ZoneHallow) - num8 = 14; + num9 = 13; + else if (Main.player[Main.myPlayer].ZoneHoly) + num9 = 14; } - if (Main.SceneMetrics.MushroomTileCount > SceneMetrics.MushroomTileMax) - num8 = 2; - if (num8 != Main.undergroundBackground) + if (Main.shroomTiles > 200) + num9 = 2; + if (num9 != Main.ugBack) { - Main.oldUndergroundBackground = Main.undergroundBackground; - Main.undergroundBackground = num8; + Main.oldUgBack = Main.ugBack; + Main.ugBack = num9; Main.ugBackTransition = 1f; } if ((double) Main.ugBackTransition > 0.0) @@ -38416,11 +38514,11 @@ label_623: int[] numArray2 = new int[7]; for (int index1 = 0; index1 < 2; ++index1) { - int undergroundBackground = Main.undergroundBackground; + int num10 = Main.ugBack; if (index1 == 1) - undergroundBackground = Main.oldUndergroundBackground; + num10 = Main.oldUgBack; int[] numArray3 = new int[7]; - switch (undergroundBackground) + switch (num10) { case 0: numArray3[0] = 1; @@ -38458,7 +38556,7 @@ label_623: numArray3[2] = 163; break; } - numArray3[4] = 128 + Main.hellBackStyle; + numArray3[4] = numArray3[3]; break; case 2: numArray3[0] = 62; @@ -38540,13 +38638,13 @@ label_623: numArray3[4] = 157 + Main.hellBackStyle; break; default: - if (undergroundBackground >= 12 && undergroundBackground <= 14) + if (num10 >= 12 && num10 <= 14) { numArray3[0] = 66; numArray3[1] = 67; numArray3[2] = 68; numArray3[4] = 128 + Main.hellBackStyle; - switch (undergroundBackground) + switch (num10) { case 12: numArray3[3] = 193 + Main.worldID % 4; @@ -38559,13 +38657,13 @@ label_623: break; } } - else if (undergroundBackground >= 15 && undergroundBackground <= 17) + else if (num10 >= 15 && num10 <= 17) { numArray3[0] = 40; numArray3[1] = 33; numArray3[2] = 34; numArray3[4] = 128 + Main.hellBackStyle; - switch (undergroundBackground) + switch (num10) { case 15: numArray3[3] = 200; @@ -38579,27 +38677,7 @@ label_623: } } else - { - switch (undergroundBackground) - { - case 18: - numArray3[0] = 290; - numArray3[1] = 291; - break; - case 19: - numArray3[0] = 292; - numArray3[1] = 293; - break; - case 20: - numArray3[0] = 294; - numArray3[1] = 295; - break; - case 21: - numArray3[0] = 296; - numArray3[1] = 297; - break; - } - } + break; break; } if (Main.hellBackStyle == 0) @@ -38627,203 +38705,180 @@ label_623: numArray2[index3] = numArray3[index3]; } } - float num9 = (float) (1.20000004768372 - 0.200000002980232 * (double) num6); + Lighting.defBrightness = (float) (1.20000004768372 - 0.200000002980232 * (double) num7); float x1 = vector3.X; float y1 = vector3.Y; float z = vector3.Z; - int num10 = TextureAssets.Background[numArray1[0]].Width() - 32; this.bgParallax = (double) Main.caveParallax; - this.bgStartX = (int) (-Math.IEEERemainder((double) num10 + (double) Main.screenPosition.X * this.bgParallax, (double) num10) - (double) (num10 / 2)) - (int) vector2.X; - this.bgLoops = (Main.screenWidth + (int) vector2.X * 2) / num10 + 2; - this.bgTopY = (int) ((double) ((int) Main.worldSurface * 16 - 16) - (double) Main.screenPosition.Y + 16.0); + this.bgStart = (int) (-Math.IEEERemainder((double) num5 + (double) Main.screenPosition.X * this.bgParallax, (double) num5) - (double) (num5 / 2)) - (int) vector2.X; + this.bgLoops = Main.screenWidth / num5 + 2; + this.bgTop = (int) ((double) ((int) Main.worldSurface * 16 - 16) - (double) Main.screenPosition.Y + 16.0); for (int index4 = 0; index4 < this.bgLoops; ++index4) { - for (int index5 = 0; index5 < num10 / 16; ++index5) + for (int index5 = 0; index5 < num5 / 16; ++index5) { - int num11 = (int) (float) Math.Round(-Math.IEEERemainder((double) this.bgStartX + (double) Main.screenPosition.X, 16.0)); + int num11 = (int) (float) Math.Round(-Math.IEEERemainder((double) this.bgStart + (double) Main.screenPosition.X, 16.0)); if (num11 == -8) num11 = 8; - double num12 = (double) (this.bgStartX + num10 * index4 + index5 * 16 + 8); - float bgTopY = (float) this.bgTopY; + double num12 = (double) (this.bgStart + num5 * index4 + index5 * 16 + 8); + float bgTop = (float) this.bgTop; double x2 = (double) Main.screenPosition.X; - Microsoft.Xna.Framework.Color color = Lighting.GetColor((int) ((num12 + x2) / 16.0), (int) (((double) Main.screenPosition.Y + (double) bgTopY) / 16.0)); - color.R = (byte) ((double) color.R * (double) x1); - color.G = (byte) ((double) color.G * (double) y1); - color.B = (byte) ((double) color.B * (double) z); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[0]].Value, new Vector2((float) (this.bgStartX + num10 * index4 + 16 * index5 + num11), (float) this.bgTopY) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index5 + num11 + 16, 0, 16, 16)), color); - } - } - if ((double) Main.ugBackTransition > 0.0) - { - num10 = TextureAssets.Background[numArray2[0]].Width() - 32; - this.bgStartX = (int) (-Math.IEEERemainder((double) num10 + (double) Main.screenPosition.X * this.bgParallax, (double) num10) - (double) (num10 / 2)) - (int) vector2.X; - this.bgLoops = (Main.screenWidth + (int) vector2.X * 2) / num10 + 2; - for (int index6 = 0; index6 < this.bgLoops; ++index6) - { - for (int index7 = 0; index7 < num10 / 16; ++index7) + Microsoft.Xna.Framework.Color color1 = Lighting.GetColor((int) ((num12 + x2) / 16.0), (int) (((double) Main.screenPosition.Y + (double) bgTop) / 16.0)); + color1.R = (byte) ((double) color1.R * (double) x1); + color1.G = (byte) ((double) color1.G * (double) y1); + color1.B = (byte) ((double) color1.B * (double) z); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[0]], new Vector2((float) (this.bgStart + num5 * index4 + 16 * index5 + num11), (float) this.bgTop) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index5 + num11 + 16, 0, 16, 16)), color1); + if ((double) Main.ugBackTransition > 0.0) { - int num13 = (int) (float) Math.Round(-Math.IEEERemainder((double) this.bgStartX + (double) Main.screenPosition.X, 16.0)); - if (num13 == -8) - num13 = 8; - double num14 = (double) (this.bgStartX + num10 * index6 + index7 * 16 + 8); - float bgTopY = (float) this.bgTopY; - double x3 = (double) Main.screenPosition.X; - Microsoft.Xna.Framework.Color color1 = Lighting.GetColor((int) ((num14 + x3) / 16.0), (int) (((double) Main.screenPosition.Y + (double) bgTopY) / 16.0)); - color1.R = (byte) ((double) color1.R * (double) x1); - color1.G = (byte) ((double) color1.G * (double) y1); - color1.B = (byte) ((double) color1.B * (double) z); Microsoft.Xna.Framework.Color color2 = color1; color2.R = (byte) ((double) color2.R * (double) Main.ugBackTransition); color2.G = (byte) ((double) color2.G * (double) Main.ugBackTransition); color2.B = (byte) ((double) color2.B * (double) Main.ugBackTransition); color2.A = (byte) ((double) color2.A * (double) Main.ugBackTransition); - Main.spriteBatch.Draw(TextureAssets.Background[numArray2[0]].Value, new Vector2((float) (this.bgStartX + num10 * index6 + 16 * index7 + num13), (float) this.bgTopY) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index7 + num13 + 16, 0, 16, 16)), color2); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray2[0]], new Vector2((float) (this.bgStart + num5 * index4 + 16 * index5 + num11), (float) this.bgTop) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index5 + num11 + 16, 0, 16, 16)), color2); } } } bool flag1 = false; bool flag2 = false; - this.bgTopY = (int) ((double) ((int) Main.worldSurface * 16) - (double) Main.screenPosition.Y + 16.0); + this.bgTop = (int) ((double) ((int) Main.worldSurface * 16) - (double) Main.screenPosition.Y + 16.0); if (Main.worldSurface * 16.0 <= (double) Main.screenPosition.Y + (double) Main.screenHeight + (double) Main.offScreenRange) { this.bgParallax = (double) Main.caveParallax; - int num15 = TextureAssets.Background[numArray1[1]].Width() - 32; - this.bgStartX = (int) (-Math.IEEERemainder((double) num15 + (double) Main.screenPosition.X * this.bgParallax, (double) num15) - (double) (num15 / 2)) - (int) vector2.X; - this.bgLoops = (Main.screenWidth + (int) vector2.X * 2) / num15 + 2; + this.bgStart = (int) (-Math.IEEERemainder((double) num5 + (double) Main.screenPosition.X * this.bgParallax, (double) num5) - (double) (num5 / 2)) - (int) vector2.X; + this.bgLoops = (Main.screenWidth + (int) vector2.X * 2) / num5 + 2; if (Main.worldSurface * 16.0 < (double) Main.screenPosition.Y - 16.0) { - this.bgStartY = (int) (Math.IEEERemainder((double) this.bgTopY, (double) Main.backgroundHeight[2]) - (double) Main.backgroundHeight[2]); + this.bgStartY = (int) (Math.IEEERemainder((double) this.bgTop, (double) Main.backgroundHeight[2]) - (double) Main.backgroundHeight[2]); this.bgLoopsY = (Main.screenHeight - this.bgStartY + (int) vector2.Y * 2) / Main.backgroundHeight[2] + 1; } else { - this.bgStartY = this.bgTopY; - this.bgLoopsY = (Main.screenHeight - this.bgTopY + (int) vector2.Y * 2) / Main.backgroundHeight[2] + 1; + this.bgStartY = this.bgTop; + this.bgLoopsY = (Main.screenHeight - this.bgTop + (int) vector2.Y * 2) / Main.backgroundHeight[2] + 1; } - if (Main.rockLayer * 16.0 < (double) Main.Camera.ScaledPosition.Y + 600.0) + if (Main.rockLayer * 16.0 < (double) Main.screenPosition.Y + 600.0) { this.bgLoopsY = (int) (Main.rockLayer * 16.0 - (double) Main.screenPosition.Y + 600.0 - (double) this.bgStartY) / Main.backgroundHeight[2]; flag2 = true; } - int num16 = (int) (float) Math.Round(-Math.IEEERemainder((double) this.bgStartX + (double) Main.screenPosition.X, 16.0)); - if (num16 == -8) - num16 = 8; - for (int index8 = 0; index8 < this.bgLoops; ++index8) + int num13 = (int) (float) Math.Round(-Math.IEEERemainder((double) this.bgStart + (double) Main.screenPosition.X, 16.0)); + if (num13 == -8) + num13 = 8; + for (int index6 = 0; index6 < this.bgLoops; ++index6) { - for (int index9 = 0; index9 < this.bgLoopsY; ++index9) + for (int index7 = 0; index7 < this.bgLoopsY; ++index7) { - for (int index10 = 0; index10 < num15 / 16; ++index10) + for (int index8 = 0; index8 < num5 / 16; ++index8) { - for (int index11 = 0; index11 < 6; ++index11) + for (int index9 = 0; index9 < 6; ++index9) { - double num17 = (double) (this.bgStartY + index9 * 96 + index11 * 16 + 8); - int index12 = (int) (((double) (this.bgStartX + num15 * index8 + index10 * 16 + 8) + (double) Main.screenPosition.X) / 16.0); + double num14 = (double) (this.bgStartY + index7 * 96 + index9 * 16 + 8); + int index10 = (int) (((double) (this.bgStart + num5 * index6 + index8 * 16 + 8) + (double) Main.screenPosition.X) / 16.0); double y2 = (double) Main.screenPosition.Y; - int index13 = (int) ((num17 + y2) / 16.0); - Microsoft.Xna.Framework.Color color3 = Lighting.GetColor(index12, index13); - if (WorldGen.InWorld(index12, index13)) + int index11 = (int) ((num14 + y2) / 16.0); + Microsoft.Xna.Framework.Color color3 = Lighting.GetColor(index10, index11); + if (WorldGen.InWorld(index10, index11)) { - if (Main.tile[index12, index13] == null) - Main.tile[index12, index13] = new Tile(); + if (Main.tile[index10, index11] == null) + Main.tile[index10, index11] = new Tile(); if (color3.R > (byte) 0 || color3.G > (byte) 0 || color3.B > (byte) 0) { if (!Main.drawToScreen) { VertexColors vertices; - Lighting.GetCornerColors(index12, index13, out vertices); - vertices.BottomLeftColor = new Microsoft.Xna.Framework.Color(vertices.BottomLeftColor.ToVector3() * vector3); - vertices.BottomRightColor = new Microsoft.Xna.Framework.Color(vertices.BottomRightColor.ToVector3() * vector3); - Main.tileBatch.Draw(TextureAssets.Background[numArray1[1]].Value, new Vector2((float) (this.bgStartX + num15 * index8 + 16 * index10 + num16), (float) (this.bgStartY + Main.backgroundHeight[numArray2[1]] * index9 + 16 * index11)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index10 + num16 + 16, 16 * index11, 16, 16)), vertices, Vector2.Zero, 1f, SpriteEffects.None); + Lighting.GetColor4Slice_New(index10, index11, out vertices); + Main.tileBatch.Draw(Main.backgroundTexture[numArray1[1]], new Vector2((float) (this.bgStart + num5 * index6 + 16 * index8 + num13), (float) (this.bgStartY + Main.backgroundHeight[numArray2[1]] * index7 + 16 * index9)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index8 + num13 + 16, 16 * index9, 16, 16)), vertices, Vector2.Zero, 1f, SpriteEffects.None); } - else if (((int) color3.R > num3 || (double) color3.G > (double) num3 * 1.1 || (double) color3.B > (double) num3 * 1.2) && !Main.tile[index12, index13].active() && Main.wallLight[(int) Main.tile[index12, index13].wall] && (double) Main.ugBackTransition == 0.0) + else if (((int) color3.R > num3 || (double) color3.G > (double) num3 * 1.1 || (double) color3.B > (double) num3 * 1.2) && !Main.tile[index10, index11].active() && Main.wallLight[(int) Main.tile[index10, index11].wall] && (double) Main.ugBackTransition == 0.0) { - Lighting.GetColor9Slice(index12, index13, ref slices); + Lighting.GetColor9Slice(index10, index11, ref slices); try { - for (int index14 = 0; index14 < 9; ++index14) + for (int index12 = 0; index12 < 9; ++index12) { - int num18 = 0; - int num19 = 0; + int num15 = 0; + int num16 = 0; int width = 4; int height = 4; Microsoft.Xna.Framework.Color color4 = color3; Microsoft.Xna.Framework.Color color5 = color3; - switch (index14) + switch (index12) { case 0: - if (!Main.tile[index12 - 1, index13 - 1].active()) + if (!Main.tile[index10 - 1, index11 - 1].active()) { - color5 = slices[index14]; + color5 = slices[index12]; break; } break; case 1: width = 8; - num18 = 4; - if (!Main.tile[index12, index13 - 1].active()) + num15 = 4; + if (!Main.tile[index10, index11 - 1].active()) { - color5 = slices[index14]; + color5 = slices[index12]; break; } break; case 2: - num18 = 12; - if (!Main.tile[index12 + 1, index13 - 1].active()) + num15 = 12; + if (!Main.tile[index10 + 1, index11 - 1].active()) { - color5 = slices[index14]; + color5 = slices[index12]; break; } break; case 3: height = 8; - num19 = 4; - if (!Main.tile[index12 - 1, index13].active()) + num16 = 4; + if (!Main.tile[index10 - 1, index11].active()) { - color5 = slices[index14]; + color5 = slices[index12]; break; } break; case 4: width = 8; height = 8; - num18 = 4; - num19 = 4; + num15 = 4; + num16 = 4; break; case 5: - num18 = 12; - num19 = 4; + num15 = 12; + num16 = 4; height = 8; - if (!Main.tile[index12 + 1, index13].active()) + if (!Main.tile[index10 + 1, index11].active()) { - color5 = slices[index14]; + color5 = slices[index12]; break; } break; case 6: - num19 = 12; - if (!Main.tile[index12 - 1, index13 + 1].active()) + num16 = 12; + if (!Main.tile[index10 - 1, index11 + 1].active()) { - color5 = slices[index14]; + color5 = slices[index12]; break; } break; case 7: width = 8; height = 4; - num18 = 4; - num19 = 12; - if (!Main.tile[index12, index13 + 1].active()) + num15 = 4; + num16 = 12; + if (!Main.tile[index10, index11 + 1].active()) { - color5 = slices[index14]; + color5 = slices[index12]; break; } break; case 8: - num18 = 12; - num19 = 12; - if (!Main.tile[index12 + 1, index13 + 1].active()) + num15 = 12; + num16 = 12; + if (!Main.tile[index10 + 1, index11 + 1].active()) { - color5 = slices[index14]; + color5 = slices[index12]; break; } break; @@ -38834,7 +38889,7 @@ label_623: color4.R = (byte) ((double) color4.R * (double) x1); color4.G = (byte) ((double) color4.G * (double) y1); color4.B = (byte) ((double) color4.B * (double) z); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[1]].Value, new Vector2((float) (this.bgStartX + num15 * index8 + 16 * index10 + num18 + num16), (float) (this.bgStartY + Main.backgroundHeight[numArray1[1]] * index9 + 16 * index11 + num19)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index10 + num18 + num16 + 16, 16 * index11 + num19, width, height)), color4); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[1]], new Vector2((float) (this.bgStart + num5 * index6 + 16 * index8 + num15 + num13), (float) (this.bgStartY + Main.backgroundHeight[numArray1[1]] * index7 + 16 * index9 + num16)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index8 + num15 + num13 + 16, 16 * index9 + num16, width, height)), color4); if ((double) Main.ugBackTransition > 0.0) { Microsoft.Xna.Framework.Color color6 = color4; @@ -38842,7 +38897,7 @@ label_623: color6.G = (byte) ((double) color6.G * (double) Main.ugBackTransition); color6.B = (byte) ((double) color6.B * (double) Main.ugBackTransition); color6.A = (byte) ((double) color6.A * (double) Main.ugBackTransition); - Main.spriteBatch.Draw(TextureAssets.Background[numArray2[1]].Value, new Vector2((float) (this.bgStartX + num15 * index8 + 16 * index10 + num18 + num16), (float) (this.bgStartY + Main.backgroundHeight[numArray2[1]] * index9 + 16 * index11 + num19)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index10 + num18 + num16 + 16, 16 * index11 + num19, width, height)), color6); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray2[1]], new Vector2((float) (this.bgStart + num5 * index6 + 16 * index8 + num15 + num13), (float) (this.bgStartY + Main.backgroundHeight[numArray2[1]] * index7 + 16 * index9 + num16)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index8 + num15 + num13 + 16, 16 * index9 + num16, width, height)), color6); } } } @@ -38851,29 +38906,29 @@ label_623: color3.R = (byte) ((double) color3.R * (double) x1); color3.G = (byte) ((double) color3.G * (double) y1); color3.B = (byte) ((double) color3.B * (double) z); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[1]].Value, new Vector2((float) (this.bgStartX + num15 * index8 + 16 * index10 + num16), (float) (this.bgStartY + Main.backgroundHeight[numArray1[1]] * index9 + 16 * index11)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index10 + num16 + 16, 16 * index11, 16, 16)), color3); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[1]], new Vector2((float) (this.bgStart + num5 * index6 + 16 * index8 + num13), (float) (this.bgStartY + Main.backgroundHeight[numArray1[1]] * index7 + 16 * index9)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index8 + num13 + 16, 16 * index9, 16, 16)), color3); } } else if (((int) color3.R > num4 || (double) color3.G > (double) num4 * 1.1 || (double) color3.B > (double) num4 * 1.2) && (double) Main.ugBackTransition == 0.0) { - Lighting.GetColor4Slice(index12, index13, ref slices); - for (int index15 = 0; index15 < 4; ++index15) + Lighting.GetColor4Slice(index10, index11, ref slices); + for (int index13 = 0; index13 < 4; ++index13) { - int num20 = 0; - int num21 = 0; + int num17 = 0; + int num18 = 0; Microsoft.Xna.Framework.Color color7 = color3; - Microsoft.Xna.Framework.Color color8 = slices[index15]; - switch (index15 - 1) + Microsoft.Xna.Framework.Color color8 = slices[index13]; + switch (index13 - 1) { case 0: - num20 = 8; + num17 = 8; break; case 1: - num21 = 8; + num18 = 8; break; case 2: - num20 = 8; - num21 = 8; + num17 = 8; + num18 = 8; break; } color7.R = (byte) (((int) color3.R + (int) color8.R) / 2); @@ -38882,7 +38937,7 @@ label_623: color7.R = (byte) ((double) color7.R * (double) x1); color7.G = (byte) ((double) color7.G * (double) y1); color7.B = (byte) ((double) color7.B * (double) z); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[1]].Value, new Vector2((float) (this.bgStartX + num15 * index8 + 16 * index10 + num20 + num16), (float) (this.bgStartY + Main.backgroundHeight[numArray1[1]] * index9 + 16 * index11 + num21)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index10 + num20 + num16 + 16, 16 * index11 + num21, 8, 8)), color7); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[1]], new Vector2((float) (this.bgStart + num5 * index6 + 16 * index8 + num17 + num13), (float) (this.bgStartY + Main.backgroundHeight[numArray1[1]] * index7 + 16 * index9 + num18)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index8 + num17 + num13 + 16, 16 * index9 + num18, 8, 8)), color7); if ((double) Main.ugBackTransition > 0.0) { Microsoft.Xna.Framework.Color color9 = color7; @@ -38890,7 +38945,7 @@ label_623: color9.G = (byte) ((double) color9.G * (double) Main.ugBackTransition); color9.B = (byte) ((double) color9.B * (double) Main.ugBackTransition); color9.A = (byte) ((double) color9.A * (double) Main.ugBackTransition); - Main.spriteBatch.Draw(TextureAssets.Background[numArray2[1]].Value, new Vector2((float) (this.bgStartX + num15 * index8 + 16 * index10 + num20 + num16), (float) (this.bgStartY + Main.backgroundHeight[numArray2[1]] * index9 + 16 * index11 + num21)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index10 + num20 + num16 + 16, 16 * index11 + num21, 8, 8)), color9); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray2[1]], new Vector2((float) (this.bgStart + num5 * index6 + 16 * index8 + num17 + num13), (float) (this.bgStartY + Main.backgroundHeight[numArray2[1]] * index7 + 16 * index9 + num18)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index8 + num17 + num13 + 16, 16 * index9 + num18, 8, 8)), color9); } } } @@ -38899,7 +38954,7 @@ label_623: color3.R = (byte) ((double) color3.R * (double) x1); color3.G = (byte) ((double) color3.G * (double) y1); color3.B = (byte) ((double) color3.B * (double) z); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[1]].Value, new Vector2((float) (this.bgStartX + num15 * index8 + 16 * index10 + num16), (float) (this.bgStartY + Main.backgroundHeight[numArray1[1]] * index9 + 16 * index11)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index10 + num16 + 16, 16 * index11, 16, 16)), color3); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[1]], new Vector2((float) (this.bgStart + num5 * index6 + 16 * index8 + num13), (float) (this.bgStartY + Main.backgroundHeight[numArray1[1]] * index7 + 16 * index9)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index8 + num13 + 16, 16 * index9, 16, 16)), color3); if ((double) Main.ugBackTransition > 0.0) { Microsoft.Xna.Framework.Color color10 = color3; @@ -38907,7 +38962,7 @@ label_623: color10.G = (byte) ((double) color10.G * (double) Main.ugBackTransition); color10.B = (byte) ((double) color10.B * (double) Main.ugBackTransition); color10.A = (byte) ((double) color10.A * (double) Main.ugBackTransition); - Main.spriteBatch.Draw(TextureAssets.Background[numArray2[1]].Value, new Vector2((float) (this.bgStartX + num15 * index8 + 16 * index10 + num16), (float) (this.bgStartY + Main.backgroundHeight[numArray2[1]] * index9 + 16 * index11)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index10 + num16 + 16, 16 * index11, 16, 16)), color10); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray2[1]], new Vector2((float) (this.bgStart + num5 * index6 + 16 * index8 + num13), (float) (this.bgStartY + Main.backgroundHeight[numArray2[1]] * index7 + 16 * index9)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index8 + num13 + 16, 16 * index9, 16, 16)), color10); } } } @@ -38916,7 +38971,7 @@ label_623: color3.R = (byte) ((double) color3.R * (double) x1); color3.G = (byte) ((double) color3.G * (double) y1); color3.B = (byte) ((double) color3.B * (double) z); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[1]].Value, new Vector2((float) (this.bgStartX + num15 * index8 + 16 * index10 + num16), (float) (this.bgStartY + Main.backgroundHeight[numArray1[1]] * index9 + 16 * index11)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index10 + num16 + 16, 16 * index11, 16, 16)), color3); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[1]], new Vector2((float) (this.bgStart + num5 * index6 + 16 * index8 + num13), (float) (this.bgStartY + Main.backgroundHeight[numArray1[1]] * index7 + 16 * index9)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index8 + num13 + 16, 16 * index9, 16, 16)), color3); } } } @@ -38925,39 +38980,33 @@ label_623: } if ((double) Main.ugBackTransition > 0.0) { - int num22 = TextureAssets.Background[numArray2[1]].Width() - 32; - this.bgStartX = (int) (-Math.IEEERemainder((double) num22 + (double) Main.screenPosition.X * this.bgParallax, (double) num22) - (double) (num22 / 2)) - (int) vector2.X; - this.bgLoops = (Main.screenWidth + (int) vector2.X * 2) / num22 + 2; - num16 = (int) (float) Math.Round(-Math.IEEERemainder((double) this.bgStartX + (double) Main.screenPosition.X, 16.0)); - if (num16 == -8) - num16 = 8; - for (int index16 = 0; index16 < this.bgLoops; ++index16) + for (int index14 = 0; index14 < this.bgLoops; ++index14) { - for (int index17 = 0; index17 < this.bgLoopsY; ++index17) + for (int index15 = 0; index15 < this.bgLoopsY; ++index15) { - for (int index18 = 0; index18 < num22 / 16; ++index18) + for (int index16 = 0; index16 < num5 / 16; ++index16) { - for (int index19 = 0; index19 < 6; ++index19) + for (int index17 = 0; index17 < 6; ++index17) { - double num23 = (double) (this.bgStartY + index17 * 96 + index19 * 16 + 8); - int index20 = (int) (((double) (this.bgStartX + num22 * index16 + index18 * 16 + 8) + (double) Main.screenPosition.X) / 16.0); + double num19 = (double) (this.bgStartY + index15 * 96 + index17 * 16 + 8); + int index18 = (int) (((double) (this.bgStart + num5 * index14 + index16 * 16 + 8) + (double) Main.screenPosition.X) / 16.0); double y3 = (double) Main.screenPosition.Y; - int index21 = (int) ((num23 + y3) / 16.0); - if (WorldGen.InWorld(index20, index21)) + int index19 = (int) ((num19 + y3) / 16.0); + if (WorldGen.InWorld(index18, index19)) { - Microsoft.Xna.Framework.Color color = Lighting.GetColor(index20, index21); - if (Main.tile[index20, index21] == null) - Main.tile[index20, index21] = new Tile(); + Microsoft.Xna.Framework.Color color = Lighting.GetColor(index18, index19); + if (Main.tile[index18, index19] == null) + Main.tile[index18, index19] = new Tile(); if (color.R > (byte) 0 || color.G > (byte) 0 || color.B > (byte) 0) { VertexColors vertices; - Lighting.GetCornerColors(index20, index21, out vertices, Main.ugBackTransition); - byte num24 = (byte) ((double) byte.MaxValue * (double) Main.ugBackTransition); - vertices.BottomLeftColor.A = num24; - vertices.BottomRightColor.A = num24; - vertices.TopLeftColor.A = num24; - vertices.TopRightColor.A = num24; - Main.tileBatch.Draw(TextureAssets.Background[numArray2[1]].Value, new Vector2((float) (this.bgStartX + num22 * index16 + 16 * index18 + num16), (float) (this.bgStartY + Main.backgroundHeight[numArray2[1]] * index17 + 16 * index19)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index18 + num16 + 16, 16 * index19, 16, 16)), vertices, Vector2.Zero, 1f, SpriteEffects.None); + Lighting.GetColor4Slice_New(index18, index19, out vertices, Main.ugBackTransition); + byte num20 = (byte) ((double) byte.MaxValue * (double) Main.ugBackTransition); + vertices.BottomLeftColor.A = num20; + vertices.BottomRightColor.A = num20; + vertices.TopLeftColor.A = num20; + vertices.TopRightColor.A = num20; + Main.tileBatch.Draw(Main.backgroundTexture[numArray2[1]], new Vector2((float) (this.bgStart + num5 * index14 + 16 * index16 + num13), (float) (this.bgStartY + Main.backgroundHeight[numArray2[1]] * index15 + 16 * index17)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index16 + num13 + 16, 16 * index17, 16, 16)), vertices, Vector2.Zero, 1f, SpriteEffects.None); } } } @@ -38965,27 +39014,26 @@ label_623: } } } - num10 = 128; if (flag2) { this.bgParallax = (double) Main.caveParallax; - this.bgStartX = (int) (-Math.IEEERemainder((double) num10 + (double) Main.screenPosition.X * this.bgParallax, (double) num10) - (double) (num10 / 2)) - (int) vector2.X; - this.bgLoops = (Main.screenWidth + (int) vector2.X * 2) / num10 + 2; - this.bgTopY = this.bgStartY + this.bgLoopsY * Main.backgroundHeight[2]; - if (this.bgTopY > -32) + this.bgStart = (int) (-Math.IEEERemainder((double) num5 + (double) Main.screenPosition.X * this.bgParallax, (double) num5) - (double) (num5 / 2)) - (int) vector2.X; + this.bgLoops = (Main.screenWidth + (int) vector2.X * 2) / num5 + 2; + this.bgTop = this.bgStartY + this.bgLoopsY * Main.backgroundHeight[2]; + if (this.bgTop > -32) { - for (int index22 = 0; index22 < this.bgLoops; ++index22) + for (int index20 = 0; index20 < this.bgLoops; ++index20) { - for (int index23 = 0; index23 < num10 / 16; ++index23) + for (int index21 = 0; index21 < num5 / 16; ++index21) { - double num25 = (double) (this.bgStartX + num10 * index22 + index23 * 16 + 8); - float bgTopY = (float) this.bgTopY; - double x4 = (double) Main.screenPosition.X; - Microsoft.Xna.Framework.Color color11 = Lighting.GetColor((int) ((num25 + x4) / 16.0), (int) (((double) Main.screenPosition.Y + (double) bgTopY) / 16.0)); + double num21 = (double) (this.bgStart + num5 * index20 + index21 * 16 + 8); + float bgTop = (float) this.bgTop; + double x3 = (double) Main.screenPosition.X; + Microsoft.Xna.Framework.Color color11 = Lighting.GetColor((int) ((num21 + x3) / 16.0), (int) (((double) Main.screenPosition.Y + (double) bgTop) / 16.0)); color11.R = (byte) ((double) color11.R * (double) x1); color11.G = (byte) ((double) color11.G * (double) y1); color11.B = (byte) ((double) color11.B * (double) z); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[2]].Value, new Vector2((float) (this.bgStartX + num10 * index22 + 16 * index23 + num16), (float) this.bgTopY) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index23 + num16 + 16, 0, 16, 16)), color11); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[2]], new Vector2((float) (this.bgStart + num5 * index20 + 16 * index21 + num13), (float) this.bgTop) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index21 + num13 + 16, 0, 16, 16)), color11); if ((double) Main.ugBackTransition > 0.0) { Microsoft.Xna.Framework.Color color12 = color11; @@ -38993,172 +39041,157 @@ label_623: color12.G = (byte) ((double) color12.G * (double) Main.ugBackTransition); color12.B = (byte) ((double) color12.B * (double) Main.ugBackTransition); color12.A = (byte) ((double) color12.A * (double) Main.ugBackTransition); - Main.spriteBatch.Draw(TextureAssets.Background[numArray2[2]].Value, new Vector2((float) (this.bgStartX + num10 * index22 + 16 * index23 + num16), (float) this.bgTopY) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index23 + num16 + 16, 0, 16, 16)), color12); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray2[2]], new Vector2((float) (this.bgStart + num5 * index20 + 16 * index21 + num13), (float) this.bgTop) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index21 + num13 + 16, 0, 16, 16)), color12); } } } } } } - if (num2 * 16.0 <= (double) Main.screenPosition.Y + (double) Main.screenHeight) - { - int y4 = 0; - int x5 = 0; - int height = Main.screenHeight + 200; - int width = Main.screenWidth + 100; - if ((double) Main.UnderworldLayer * 16.0 < (double) Main.screenPosition.Y + (double) Main.screenHeight) - { - int num26 = (int) ((double) this.hellBlackBoxBottom - (double) Main.screenPosition.Y + (double) vector2.Y); - if (height > num26) - height = num26; - } - Main.spriteBatch.Draw(TextureAssets.BlackTile.Value, new Microsoft.Xna.Framework.Rectangle(x5, y4, width, height), new Microsoft.Xna.Framework.Color(0, 0, 0)); - } - this.hellBlackBoxBottom = (float) ((double) Main.screenPosition.Y + (double) Main.screenHeight + 100.0); - this.bgTopY = (int) ((double) ((int) Main.rockLayer * 16) - (double) Main.screenPosition.Y + 16.0 + 600.0 - 8.0); - if (Main.rockLayer * 16.0 <= (double) Main.screenPosition.Y + (double) Main.screenHeight) + this.bgTop = (int) ((double) ((int) Main.rockLayer * 16) - (double) Main.screenPosition.Y + 16.0 + 600.0 - 8.0); + if (Main.rockLayer * 16.0 <= (double) Main.screenPosition.Y + 600.0) { this.bgParallax = (double) Main.caveParallax; - this.bgStartX = (int) (-Math.IEEERemainder((double) num10 + (double) Main.screenPosition.X * this.bgParallax, (double) num10) - (double) (num10 / 2)) - (int) vector2.X; - this.bgLoops = (Main.screenWidth + (int) vector2.X * 2) / num10 + 2; + this.bgStart = (int) (-Math.IEEERemainder((double) num5 + (double) Main.screenPosition.X * this.bgParallax, (double) num5) - (double) (num5 / 2)) - (int) vector2.X; + this.bgLoops = (Main.screenWidth + (int) vector2.X * 2) / num5 + 2; if (Main.rockLayer * 16.0 + (double) Main.screenHeight < (double) Main.screenPosition.Y - 16.0) { - this.bgStartY = (int) (Math.IEEERemainder((double) this.bgTopY, (double) Main.backgroundHeight[3]) - (double) Main.backgroundHeight[3]); + this.bgStartY = (int) (Math.IEEERemainder((double) this.bgTop, (double) Main.backgroundHeight[3]) - (double) Main.backgroundHeight[3]); this.bgLoopsY = (Main.screenHeight - this.bgStartY + (int) vector2.Y * 2) / Main.backgroundHeight[2] + 1; } else { - this.bgStartY = this.bgTopY; - this.bgLoopsY = (Main.screenHeight - this.bgTopY + (int) vector2.Y * 2) / Main.backgroundHeight[2] + 1; + this.bgStartY = this.bgTop; + this.bgLoopsY = (Main.screenHeight - this.bgTop + (int) vector2.Y * 2) / Main.backgroundHeight[2] + 1; } - if (num2 * 16.0 < (double) Main.screenPosition.Y + (double) Main.screenHeight) + if (num2 * 16.0 < (double) Main.screenPosition.Y + 600.0) { this.bgLoopsY = (int) (num2 * 16.0 - (double) Main.screenPosition.Y + 600.0 - (double) this.bgStartY) / Main.backgroundHeight[2]; flag1 = true; } - int num27 = (int) (float) Math.Round(-Math.IEEERemainder((double) this.bgStartX + (double) Main.screenPosition.X, 16.0)); - if (num27 == -8) - num27 = 8; - for (int index24 = 0; index24 < this.bgLoops; ++index24) + int num22 = (int) (float) Math.Round(-Math.IEEERemainder((double) this.bgStart + (double) Main.screenPosition.X, 16.0)); + if (num22 == -8) + num22 = 8; + for (int index22 = 0; index22 < this.bgLoops; ++index22) { - for (int index25 = 0; index25 < this.bgLoopsY; ++index25) + for (int index23 = 0; index23 < this.bgLoopsY; ++index23) { - for (int index26 = 0; index26 < num10 / 16; ++index26) + for (int index24 = 0; index24 < num5 / 16; ++index24) { - for (int index27 = 0; index27 < 6; ++index27) + for (int index25 = 0; index25 < 6; ++index25) { - double num28 = (double) (this.bgStartY + index25 * 96 + index27 * 16 + 8); - int index28 = (int) (((double) (this.bgStartX + num10 * index24 + index26 * 16 + 8) + (double) Main.screenPosition.X) / 16.0); - double y5 = (double) Main.screenPosition.Y; - int index29 = (int) ((num28 + y5) / 16.0); - if (WorldGen.InWorld(index28, index29, 1)) + double num23 = (double) (this.bgStartY + index23 * 96 + index25 * 16 + 8); + int index26 = (int) (((double) (this.bgStart + num5 * index22 + index24 * 16 + 8) + (double) Main.screenPosition.X) / 16.0); + double y4 = (double) Main.screenPosition.Y; + int index27 = (int) ((num23 + y4) / 16.0); + if (WorldGen.InWorld(index26, index27, 1)) { - Microsoft.Xna.Framework.Color color13 = Lighting.GetColor(index28, index29); - if (Main.tile[index28, index29] == null) - Main.tile[index28, index29] = new Tile(); + Microsoft.Xna.Framework.Color color13 = Lighting.GetColor(index26, index27); + if (Main.tile[index26, index27] == null) + Main.tile[index26, index27] = new Tile(); bool flag3 = false; if ((double) Main.caveParallax != 0.0) { - if (Main.tile[index28 - 1, index29] == null) - Main.tile[index28 - 1, index29] = new Tile(); - if (Main.tile[index28 + 1, index29] == null) - Main.tile[index28 + 1, index29] = new Tile(); - if (Main.wallLight[(int) Main.tile[index28, index29].wall] || Main.wallLight[(int) Main.tile[index28 - 1, index29].wall] || Main.wallLight[(int) Main.tile[index28 + 1, index29].wall]) + if (Main.tile[index26 - 1, index27] == null) + Main.tile[index26 - 1, index27] = new Tile(); + if (Main.tile[index26 + 1, index27] == null) + Main.tile[index26 + 1, index27] = new Tile(); + if (Main.wallLight[(int) Main.tile[index26, index27].wall] || Main.wallLight[(int) Main.tile[index26 - 1, index27].wall] || Main.wallLight[(int) Main.tile[index26 + 1, index27].wall]) flag3 = true; } - else if (Main.wallLight[(int) Main.tile[index28, index29].wall]) + else if (Main.wallLight[(int) Main.tile[index26, index27].wall]) flag3 = true; - if ((flag3 || color13.R == (byte) 0 || color13.G == (byte) 0 || color13.B == (byte) 0) && (color13.R > (byte) 0 || color13.G > (byte) 0 || color13.B > (byte) 0) && (Main.wallLight[(int) Main.tile[index28, index29].wall] || (double) Main.caveParallax != 0.0)) + if ((flag3 || color13.R == (byte) 0 || color13.G == (byte) 0 || color13.B == (byte) 0) && (color13.R > (byte) 0 || color13.G > (byte) 0 || color13.B > (byte) 0) && (Main.wallLight[(int) Main.tile[index26, index27].wall] || (double) Main.caveParallax != 0.0)) { if (Lighting.NotRetro && color13.R < (byte) 230 && color13.G < (byte) 230 && color13.B < (byte) 230 && (double) Main.ugBackTransition == 0.0) { - if (((int) color13.R > num3 || (double) color13.G > (double) num3 * 1.1 || (double) color13.B > (double) num3 * 1.2) && !Main.tile[index28, index29].active()) + if (((int) color13.R > num3 || (double) color13.G > (double) num3 * 1.1 || (double) color13.B > (double) num3 * 1.2) && !Main.tile[index26, index27].active()) { - Lighting.GetColor9Slice(index28, index29, ref slices); - for (int index30 = 0; index30 < 9; ++index30) + Lighting.GetColor9Slice(index26, index27, ref slices); + for (int index28 = 0; index28 < 9; ++index28) { - int num29 = 0; - int num30 = 0; + int num24 = 0; + int num25 = 0; int width = 4; int height = 4; Microsoft.Xna.Framework.Color color14 = color13; Microsoft.Xna.Framework.Color color15 = color13; - switch (index30) + switch (index28) { case 0: - if (!Main.tile[index28 - 1, index29 - 1].active()) + if (!Main.tile[index26 - 1, index27 - 1].active()) { - color15 = slices[index30]; + color15 = slices[index28]; break; } break; case 1: width = 8; - num29 = 4; - if (!Main.tile[index28, index29 - 1].active()) + num24 = 4; + if (!Main.tile[index26, index27 - 1].active()) { - color15 = slices[index30]; + color15 = slices[index28]; break; } break; case 2: - num29 = 12; - if (!Main.tile[index28 + 1, index29 - 1].active()) + num24 = 12; + if (!Main.tile[index26 + 1, index27 - 1].active()) { - color15 = slices[index30]; + color15 = slices[index28]; break; } break; case 3: height = 8; - num30 = 4; - if (!Main.tile[index28 - 1, index29].active()) + num25 = 4; + if (!Main.tile[index26 - 1, index27].active()) { - color15 = slices[index30]; + color15 = slices[index28]; break; } break; case 4: width = 8; height = 8; - num29 = 4; - num30 = 4; + num24 = 4; + num25 = 4; break; case 5: - num29 = 12; - num30 = 4; + num24 = 12; + num25 = 4; height = 8; - if (!Main.tile[index28 + 1, index29].active()) + if (!Main.tile[index26 + 1, index27].active()) { - color15 = slices[index30]; + color15 = slices[index28]; break; } break; case 6: - num30 = 12; - if (!Main.tile[index28 - 1, index29 + 1].active()) + num25 = 12; + if (!Main.tile[index26 - 1, index27 + 1].active()) { - color15 = slices[index30]; + color15 = slices[index28]; break; } break; case 7: width = 8; height = 4; - num29 = 4; - num30 = 12; - if (!Main.tile[index28, index29 + 1].active()) + num24 = 4; + num25 = 12; + if (!Main.tile[index26, index27 + 1].active()) { - color15 = slices[index30]; + color15 = slices[index28]; break; } break; case 8: - num29 = 12; - num30 = 12; - if (!Main.tile[index28 + 1, index29 + 1].active()) + num24 = 12; + num25 = 12; + if (!Main.tile[index26 + 1, index27 + 1].active()) { - color15 = slices[index30]; + color15 = slices[index28]; break; } break; @@ -39169,7 +39202,7 @@ label_623: color14.R = (byte) ((double) color14.R * (double) x1); color14.G = (byte) ((double) color14.G * (double) y1); color14.B = (byte) ((double) color14.B * (double) z); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[3]].Value, new Vector2((float) (this.bgStartX + num10 * index24 + 16 * index26 + num29 + num27), (float) (this.bgStartY + Main.backgroundHeight[numArray1[3]] * index25 + 16 * index27 + num30)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index26 + num29 + num27 + 16, 16 * index27 + num30, width, height)), color14); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[3]], new Vector2((float) (this.bgStart + num5 * index22 + 16 * index24 + num24 + num22), (float) (this.bgStartY + Main.backgroundHeight[numArray1[3]] * index23 + 16 * index25 + num25)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index24 + num24 + num22 + 16, 16 * index25 + num25, width, height)), color14); if ((double) Main.ugBackTransition > 0.0) { Microsoft.Xna.Framework.Color color16 = color14; @@ -39177,30 +39210,30 @@ label_623: color16.G = (byte) ((double) color16.G * (double) Main.ugBackTransition); color16.B = (byte) ((double) color16.B * (double) Main.ugBackTransition); color16.A = (byte) ((double) color16.A * (double) Main.ugBackTransition); - Main.spriteBatch.Draw(TextureAssets.Background[numArray2[3]].Value, new Vector2((float) (this.bgStartX + num10 * index24 + 16 * index26 + num29 + num27), (float) (this.bgStartY + Main.backgroundHeight[numArray2[3]] * index25 + 16 * index27 + num30)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index26 + num29 + num27 + 16, 16 * index27 + num30, width, height)), color16); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray2[3]], new Vector2((float) (this.bgStart + num5 * index22 + 16 * index24 + num24 + num22), (float) (this.bgStartY + Main.backgroundHeight[numArray2[3]] * index23 + 16 * index25 + num25)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index24 + num24 + num22 + 16, 16 * index25 + num25, width, height)), color16); } } } else if ((int) color13.R > num4 || (double) color13.G > (double) num4 * 1.1 || (double) color13.B > (double) num4 * 1.2) { - Lighting.GetColor4Slice(index28, index29, ref slices); - for (int index31 = 0; index31 < 4; ++index31) + Lighting.GetColor4Slice(index26, index27, ref slices); + for (int index29 = 0; index29 < 4; ++index29) { - int num31 = 0; - int num32 = 0; + int num26 = 0; + int num27 = 0; Microsoft.Xna.Framework.Color color17 = color13; - Microsoft.Xna.Framework.Color color18 = slices[index31]; - switch (index31 - 1) + Microsoft.Xna.Framework.Color color18 = slices[index29]; + switch (index29 - 1) { case 0: - num31 = 8; + num26 = 8; break; case 1: - num32 = 8; + num27 = 8; break; case 2: - num31 = 8; - num32 = 8; + num26 = 8; + num27 = 8; break; } color17.R = (byte) (((int) color13.R + (int) color18.R) / 2); @@ -39209,7 +39242,7 @@ label_623: color17.R = (byte) ((double) color17.R * (double) x1); color17.G = (byte) ((double) color17.G * (double) y1); color17.B = (byte) ((double) color17.B * (double) z); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[3]].Value, new Vector2((float) (this.bgStartX + num10 * index24 + 16 * index26 + num31 + num27), (float) (this.bgStartY + Main.backgroundHeight[numArray1[3]] * index25 + 16 * index27 + num32)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index26 + num31 + num27 + 16, 16 * index27 + num32, 8, 8)), color17); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[3]], new Vector2((float) (this.bgStart + num5 * index22 + 16 * index24 + num26 + num22), (float) (this.bgStartY + Main.backgroundHeight[numArray1[3]] * index23 + 16 * index25 + num27)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index24 + num26 + num22 + 16, 16 * index25 + num27, 8, 8)), color17); if ((double) Main.ugBackTransition > 0.0) { Microsoft.Xna.Framework.Color color19 = color17; @@ -39217,7 +39250,7 @@ label_623: color19.G = (byte) ((double) color19.G * (double) Main.ugBackTransition); color19.B = (byte) ((double) color19.B * (double) Main.ugBackTransition); color19.A = (byte) ((double) color19.A * (double) Main.ugBackTransition); - Main.spriteBatch.Draw(TextureAssets.Background[numArray2[3]].Value, new Vector2((float) (this.bgStartX + num10 * index24 + 16 * index26 + num31 + num27), (float) (this.bgStartY + Main.backgroundHeight[numArray2[3]] * index25 + 16 * index27 + num32)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index26 + num31 + num27 + 16, 16 * index27 + num32, 8, 8)), color19); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray2[3]], new Vector2((float) (this.bgStart + num5 * index22 + 16 * index24 + num26 + num22), (float) (this.bgStartY + Main.backgroundHeight[numArray2[3]] * index23 + 16 * index25 + num27)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index24 + num26 + num22 + 16, 16 * index25 + num27, 8, 8)), color19); } } } @@ -39226,7 +39259,7 @@ label_623: color13.R = (byte) ((double) color13.R * (double) x1); color13.G = (byte) ((double) color13.G * (double) y1); color13.B = (byte) ((double) color13.B * (double) z); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[3]].Value, new Vector2((float) (this.bgStartX + num10 * index24 + 16 * index26 + num27), (float) (this.bgStartY + Main.backgroundHeight[numArray1[3]] * index25 + 16 * index27)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index26 + num27 + 16, 16 * index27, 16, 16)), color13); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[3]], new Vector2((float) (this.bgStart + num5 * index22 + 16 * index24 + num22), (float) (this.bgStartY + Main.backgroundHeight[numArray1[3]] * index23 + 16 * index25)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index24 + num22 + 16, 16 * index25, 16, 16)), color13); if ((double) Main.ugBackTransition > 0.0) { Microsoft.Xna.Framework.Color color20 = color13; @@ -39234,7 +39267,7 @@ label_623: color20.G = (byte) ((double) color20.G * (double) Main.ugBackTransition); color20.B = (byte) ((double) color20.B * (double) Main.ugBackTransition); color20.A = (byte) ((double) color20.A * (double) Main.ugBackTransition); - Main.spriteBatch.Draw(TextureAssets.Background[numArray2[3]].Value, new Vector2((float) (this.bgStartX + num10 * index24 + 16 * index26 + num27), (float) (this.bgStartY + Main.backgroundHeight[numArray2[3]] * index25 + 16 * index27)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index26 + num27 + 16, 16 * index27, 16, 16)), color20); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray2[3]], new Vector2((float) (this.bgStart + num5 * index22 + 16 * index24 + num22), (float) (this.bgStartY + Main.backgroundHeight[numArray2[3]] * index23 + 16 * index25)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index24 + num22 + 16, 16 * index25, 16, 16)), color20); } } } @@ -39243,7 +39276,7 @@ label_623: color13.R = (byte) ((double) color13.R * (double) x1); color13.G = (byte) ((double) color13.G * (double) y1); color13.B = (byte) ((double) color13.B * (double) z); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[3]].Value, new Vector2((float) (this.bgStartX + num10 * index24 + 16 * index26 + num27), (float) (this.bgStartY + Main.backgroundHeight[numArray1[3]] * index25 + 16 * index27)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index26 + num27 + 16, 16 * index27, 16, 16)), color13); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[3]], new Vector2((float) (this.bgStart + num5 * index22 + 16 * index24 + num22), (float) (this.bgStartY + Main.backgroundHeight[numArray1[3]] * index23 + 16 * index25)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index24 + num22 + 16, 16 * index25, 16, 16)), color13); if ((double) Main.ugBackTransition > 0.0) { Microsoft.Xna.Framework.Color color21 = color13; @@ -39251,7 +39284,7 @@ label_623: color21.G = (byte) ((double) color21.G * (double) Main.ugBackTransition); color21.B = (byte) ((double) color21.B * (double) Main.ugBackTransition); color21.A = (byte) ((double) color21.A * (double) Main.ugBackTransition); - Main.spriteBatch.Draw(TextureAssets.Background[numArray2[3]].Value, new Vector2((float) (this.bgStartX + num10 * index24 + 16 * index26 + num27), (float) (this.bgStartY + Main.backgroundHeight[numArray2[3]] * index25 + 16 * index27)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index26 + num27 + 16, 16 * index27, 16, 16)), color21); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray2[3]], new Vector2((float) (this.bgStart + num5 * index22 + 16 * index24 + num22), (float) (this.bgStartY + Main.backgroundHeight[numArray2[3]] * index23 + 16 * index25)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index24 + num22 + 16, 16 * index25, 16, 16)), color21); } } } @@ -39260,25 +39293,25 @@ label_623: } } } - num10 = 128; + num5 = 128; if (flag1) { this.bgParallax = (double) Main.caveParallax; - this.bgStartX = (int) (-Math.IEEERemainder((double) num10 + (double) Main.screenPosition.X * this.bgParallax, (double) num10) - (double) (num10 / 2)) - (int) vector2.X; - this.bgLoops = (Main.screenWidth + (int) vector2.X * 2) / num10 + 2; - this.bgTopY = this.bgStartY + this.bgLoopsY * Main.backgroundHeight[2]; - for (int index32 = 0; index32 < this.bgLoops; ++index32) + this.bgStart = (int) (-Math.IEEERemainder((double) num5 + (double) Main.screenPosition.X * this.bgParallax, (double) num5) - (double) (num5 / 2)) - (int) vector2.X; + this.bgLoops = (Main.screenWidth + (int) vector2.X * 2) / num5 + 2; + this.bgTop = this.bgStartY + this.bgLoopsY * Main.backgroundHeight[2]; + for (int index30 = 0; index30 < this.bgLoops; ++index30) { - for (int index33 = 0; index33 < num10 / 16; ++index33) + for (int index31 = 0; index31 < num5 / 16; ++index31) { - double num33 = (double) (this.bgStartX + num10 * index32 + index33 * 16 + 8); - float bgTopY = (float) this.bgTopY; - double x6 = (double) Main.screenPosition.X; - Microsoft.Xna.Framework.Color color22 = Lighting.GetColor((int) ((num33 + x6) / 16.0), (int) (((double) Main.screenPosition.Y + (double) bgTopY) / 16.0)); + double num28 = (double) (this.bgStart + num5 * index30 + index31 * 16 + 8); + float bgTop = (float) this.bgTop; + double x4 = (double) Main.screenPosition.X; + Microsoft.Xna.Framework.Color color22 = Lighting.GetColor((int) ((num28 + x4) / 16.0), (int) (((double) Main.screenPosition.Y + (double) bgTop) / 16.0)); color22.R = (byte) ((double) color22.R * (double) x1); color22.G = (byte) ((double) color22.G * (double) y1); color22.B = (byte) ((double) color22.B * (double) z); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[4]].Value, new Vector2((float) (this.bgStartX + num10 * index32 + 16 * index33 + num27), (float) this.bgTopY) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index33 + num27 + 16, Main.magmaBGFrame * 16, 16, 16)), color22); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[4]], new Vector2((float) (this.bgStart + num5 * index30 + 16 * index31 + num22), (float) this.bgTop) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index31 + num22 + 16, Main.magmaBGFrame * 16, 16, 16)), color22); if ((double) Main.ugBackTransition > 0.0) { Microsoft.Xna.Framework.Color color23 = color22; @@ -39286,158 +39319,158 @@ label_623: color23.G = (byte) ((double) color23.G * (double) Main.ugBackTransition); color23.B = (byte) ((double) color23.B * (double) Main.ugBackTransition); color23.A = (byte) ((double) color23.A * (double) Main.ugBackTransition); - Main.spriteBatch.Draw(TextureAssets.Background[numArray2[4]].Value, new Vector2((float) (this.bgStartX + num10 * index32 + 16 * index33 + num27), (float) this.bgTopY) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index33 + num27 + 16, Main.magmaBGFrame * 16, 16, 16)), color23); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray2[4]], new Vector2((float) (this.bgStart + num5 * index30 + 16 * index31 + num22), (float) this.bgTop) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index31 + num22 + 16, Main.magmaBGFrame * 16, 16, 16)), color23); } } } } } - this.bgTopY = (int) ((double) ((int) num2 * 16) - (double) Main.screenPosition.Y + 16.0 + 600.0) - 8; + this.bgTop = (int) ((double) ((int) num2 * 16) - (double) Main.screenPosition.Y + 16.0 + 600.0) - 8; bool flag4 = false; - if (num2 * 16.0 <= (double) Main.screenPosition.Y + (double) Main.screenHeight) + if (num2 * 16.0 <= (double) Main.screenPosition.Y + 600.0) { - this.bgStartX = (int) (-Math.IEEERemainder((double) num10 + (double) Main.screenPosition.X * this.bgParallax, (double) num10) - (double) (num10 / 2)) - (int) vector2.X; - this.bgLoops = (Main.screenWidth + (int) vector2.X * 2) / num10 + 2; + this.bgStart = (int) (-Math.IEEERemainder((double) num5 + (double) Main.screenPosition.X * this.bgParallax, (double) num5) - (double) (num5 / 2)) - (int) vector2.X; + this.bgLoops = (Main.screenWidth + (int) vector2.X * 2) / num5 + 2; if (num2 * 16.0 + (double) Main.screenHeight < (double) Main.screenPosition.Y - 16.0) { - this.bgStartY = (int) (Math.IEEERemainder((double) this.bgTopY, (double) Main.backgroundHeight[2]) - (double) Main.backgroundHeight[2]); + this.bgStartY = (int) (Math.IEEERemainder((double) this.bgTop, (double) Main.backgroundHeight[2]) - (double) Main.backgroundHeight[2]); this.bgLoopsY = (Main.screenHeight - this.bgStartY + (int) vector2.Y * 2) / Main.backgroundHeight[2] + 1; } else { - this.bgStartY = this.bgTopY; - this.bgLoopsY = (Main.screenHeight - this.bgTopY + (int) vector2.Y * 2) / Main.backgroundHeight[2] + 1; + this.bgStartY = this.bgTop; + this.bgLoopsY = (Main.screenHeight - this.bgTop + (int) vector2.Y * 2) / Main.backgroundHeight[2] + 1; } - if ((double) Main.UnderworldLayer * 16.0 < (double) Main.screenPosition.Y + (double) Main.screenHeight) + if ((double) (Main.maxTilesY - 200) * 16.0 < (double) Main.screenPosition.Y + (double) Main.screenHeight) { - this.bgLoopsY = (int) Math.Ceiling(((double) Main.UnderworldLayer * 16.0 - (double) Main.screenPosition.Y - (double) this.bgStartY) / (double) Main.backgroundHeight[2]); + this.bgLoopsY = (int) Math.Ceiling(((double) (Main.maxTilesY - 200) * 16.0 - (double) Main.screenPosition.Y - (double) this.bgStartY) / (double) Main.backgroundHeight[2]); flag4 = true; } - int num34 = (int) ((double) num3 * 1.5); - int num35 = (int) ((double) num4 * 1.5); - int num36 = (int) (float) Math.Round(-Math.IEEERemainder((double) this.bgStartX + (double) Main.screenPosition.X, 16.0)); - if (num36 == -8) - num36 = 8; - for (int index34 = 0; index34 < this.bgLoops; ++index34) + int num29 = (int) ((double) num3 * 1.5); + int num30 = (int) ((double) num4 * 1.5); + int num31 = (int) (float) Math.Round(-Math.IEEERemainder((double) this.bgStart + (double) Main.screenPosition.X, 16.0)); + if (num31 == -8) + num31 = 8; + for (int index32 = 0; index32 < this.bgLoops; ++index32) { - for (int index35 = 0; index35 < this.bgLoopsY; ++index35) + for (int index33 = 0; index33 < this.bgLoopsY; ++index33) { - for (int index36 = 0; index36 < num10 / 16; ++index36) + for (int index34 = 0; index34 < num5 / 16; ++index34) { - for (int index37 = 0; index37 < 6; ++index37) + for (int index35 = 0; index35 < 6; ++index35) { - double num37 = (double) (this.bgStartY + index35 * 96 + index37 * 16 + 8); - int index38 = (int) (((double) (this.bgStartX + num10 * index34 + index36 * 16 + 8) + (double) Main.screenPosition.X) / 16.0); - double y6 = (double) Main.screenPosition.Y; - int index39 = (int) ((num37 + y6) / 16.0); - if (WorldGen.InWorld(index38, index39, 1)) + double num32 = (double) (this.bgStartY + index33 * 96 + index35 * 16 + 8); + int index36 = (int) (((double) (this.bgStart + num5 * index32 + index34 * 16 + 8) + (double) Main.screenPosition.X) / 16.0); + double y5 = (double) Main.screenPosition.Y; + int index37 = (int) ((num32 + y5) / 16.0); + if (WorldGen.InWorld(index36, index37, 1)) { - Microsoft.Xna.Framework.Color color24 = Lighting.GetColor(index38, index39); - if (Main.tile[index38, index39] == null) - Main.tile[index38, index39] = new Tile(); + Microsoft.Xna.Framework.Color color24 = Lighting.GetColor(index36, index37); + if (Main.tile[index36, index37] == null) + Main.tile[index36, index37] = new Tile(); bool flag5 = false; if ((double) Main.caveParallax != 0.0) { - if (Main.tile[index38 - 1, index39] == null) - Main.tile[index38 - 1, index39] = new Tile(); - if (Main.tile[index38 + 1, index39] == null) - Main.tile[index38 + 1, index39] = new Tile(); - if (Main.wallLight[(int) Main.tile[index38, index39].wall] || Main.wallLight[(int) Main.tile[index38 - 1, index39].wall] || Main.wallLight[(int) Main.tile[index38 + 1, index39].wall]) + if (Main.tile[index36 - 1, index37] == null) + Main.tile[index36 - 1, index37] = new Tile(); + if (Main.tile[index36 + 1, index37] == null) + Main.tile[index36 + 1, index37] = new Tile(); + if (Main.wallLight[(int) Main.tile[index36, index37].wall] || Main.wallLight[(int) Main.tile[index36 - 1, index37].wall] || Main.wallLight[(int) Main.tile[index36 + 1, index37].wall]) flag5 = true; } - else if (Main.wallLight[(int) Main.tile[index38, index39].wall]) + else if (Main.wallLight[(int) Main.tile[index36, index37].wall]) flag5 = true; - if ((flag5 || color24.R == (byte) 0 || color24.G == (byte) 0 || color24.B == (byte) 0) && (color24.R > (byte) 0 || color24.G > (byte) 0 || color24.B > (byte) 0 || index39 > Main.maxTilesY - 300) && (Main.wallLight[(int) Main.tile[index38, index39].wall] || (double) Main.caveParallax != 0.0)) + if ((flag5 || color24.R == (byte) 0 || color24.G == (byte) 0 || color24.B == (byte) 0) && (color24.R > (byte) 0 || color24.G > (byte) 0 || color24.B > (byte) 0 || index37 > Main.maxTilesY - 300) && (Main.wallLight[(int) Main.tile[index36, index37].wall] || (double) Main.caveParallax != 0.0)) { if (Lighting.NotRetro && color24.R < (byte) 230 && color24.G < (byte) 230 && color24.B < (byte) 230) { - if (((int) color24.R > num34 || (double) color24.G > (double) num34 * 1.1 || (double) color24.B > (double) num34 * 1.2) && !Main.tile[index38, index39].active()) + if (((int) color24.R > num29 || (double) color24.G > (double) num29 * 1.1 || (double) color24.B > (double) num29 * 1.2) && !Main.tile[index36, index37].active()) { - Lighting.GetColor9Slice(index38, index39, ref slices); - for (int index40 = 0; index40 < 9; ++index40) + Lighting.GetColor9Slice(index36, index37, ref slices); + for (int index38 = 0; index38 < 9; ++index38) { - int num38 = 0; - int num39 = 0; + int num33 = 0; + int num34 = 0; int width = 4; int height = 4; Microsoft.Xna.Framework.Color color25 = color24; Microsoft.Xna.Framework.Color color26 = color24; - switch (index40) + switch (index38) { case 0: - if (!Main.tile[index38 - 1, index39 - 1].active()) + if (!Main.tile[index36 - 1, index37 - 1].active()) { - color26 = slices[index40]; + color26 = slices[index38]; break; } break; case 1: width = 8; - num38 = 4; - if (!Main.tile[index38, index39 - 1].active()) + num33 = 4; + if (!Main.tile[index36, index37 - 1].active()) { - color26 = slices[index40]; + color26 = slices[index38]; break; } break; case 2: - num38 = 12; - if (!Main.tile[index38 + 1, index39 - 1].active()) + num33 = 12; + if (!Main.tile[index36 + 1, index37 - 1].active()) { - color26 = slices[index40]; + color26 = slices[index38]; break; } break; case 3: height = 8; - num39 = 4; - if (!Main.tile[index38 - 1, index39].active()) + num34 = 4; + if (!Main.tile[index36 - 1, index37].active()) { - color26 = slices[index40]; + color26 = slices[index38]; break; } break; case 4: width = 8; height = 8; - num38 = 4; - num39 = 4; + num33 = 4; + num34 = 4; break; case 5: - num38 = 12; - num39 = 4; + num33 = 12; + num34 = 4; height = 8; - if (!Main.tile[index38 + 1, index39].active()) + if (!Main.tile[index36 + 1, index37].active()) { - color26 = slices[index40]; + color26 = slices[index38]; break; } break; case 6: - num39 = 12; - if (!Main.tile[index38 - 1, index39 + 1].active()) + num34 = 12; + if (!Main.tile[index36 - 1, index37 + 1].active()) { - color26 = slices[index40]; + color26 = slices[index38]; break; } break; case 7: width = 8; height = 4; - num38 = 4; - num39 = 12; - if (!Main.tile[index38, index39 + 1].active()) + num33 = 4; + num34 = 12; + if (!Main.tile[index36, index37 + 1].active()) { - color26 = slices[index40]; + color26 = slices[index38]; break; } break; case 8: - num38 = 12; - num39 = 12; - if (!Main.tile[index38 + 1, index39 + 1].active()) + num33 = 12; + num34 = 12; + if (!Main.tile[index36 + 1, index37 + 1].active()) { - color26 = slices[index40]; + color26 = slices[index38]; break; } break; @@ -39448,29 +39481,29 @@ label_623: color25.R = (byte) ((double) color25.R * (double) x1); color25.G = (byte) ((double) color25.G * (double) y1); color25.B = (byte) ((double) color25.B * (double) z); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[5]].Value, new Vector2((float) (this.bgStartX + num10 * index34 + 16 * index36 + num38 + num36), (float) (this.bgStartY + Main.backgroundHeight[2] * index35 + 16 * index37 + num39)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index36 + num38 + num36 + 16, 16 * index37 + Main.backgroundHeight[2] * Main.magmaBGFrame + num39, width, height)), color25, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[5]], new Vector2((float) (this.bgStart + num5 * index32 + 16 * index34 + num33 + num31), (float) (this.bgStartY + Main.backgroundHeight[2] * index33 + 16 * index35 + num34)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index34 + num33 + num31 + 16, 16 * index35 + Main.backgroundHeight[2] * Main.magmaBGFrame + num34, width, height)), color25, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } } - else if ((int) color24.R > num35 || (double) color24.G > (double) num35 * 1.1 || (double) color24.B > (double) num35 * 1.2) + else if ((int) color24.R > num30 || (double) color24.G > (double) num30 * 1.1 || (double) color24.B > (double) num30 * 1.2) { - Lighting.GetColor4Slice(index38, index39, ref slices); - for (int index41 = 0; index41 < 4; ++index41) + Lighting.GetColor4Slice(index36, index37, ref slices); + for (int index39 = 0; index39 < 4; ++index39) { - int num40 = 0; - int num41 = 0; + int num35 = 0; + int num36 = 0; Microsoft.Xna.Framework.Color color27 = color24; - Microsoft.Xna.Framework.Color color28 = slices[index41]; - switch (index41 - 1) + Microsoft.Xna.Framework.Color color28 = slices[index39]; + switch (index39 - 1) { case 0: - num40 = 8; + num35 = 8; break; case 1: - num41 = 8; + num36 = 8; break; case 2: - num40 = 8; - num41 = 8; + num35 = 8; + num36 = 8; break; } color27.R = (byte) (((int) color24.R + (int) color28.R) / 2); @@ -39479,7 +39512,7 @@ label_623: color27.R = (byte) ((double) color27.R * (double) x1); color27.G = (byte) ((double) color27.G * (double) y1); color27.B = (byte) ((double) color27.B * (double) z); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[5]].Value, new Vector2((float) (this.bgStartX + num10 * index34 + 16 * index36 + num40 + num36), (float) (this.bgStartY + Main.backgroundHeight[2] * index35 + 16 * index37 + num41)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index36 + num40 + num36 + 16, 16 * index37 + Main.backgroundHeight[2] * Main.magmaBGFrame + num41, 8, 8)), color27, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[5]], new Vector2((float) (this.bgStart + num5 * index32 + 16 * index34 + num35 + num31), (float) (this.bgStartY + Main.backgroundHeight[2] * index33 + 16 * index35 + num36)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index34 + num35 + num31 + 16, 16 * index35 + Main.backgroundHeight[2] * Main.magmaBGFrame + num36, 8, 8)), color27, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } } else @@ -39487,7 +39520,7 @@ label_623: color24.R = (byte) ((double) color24.R * (double) x1); color24.G = (byte) ((double) color24.G * (double) y1); color24.B = (byte) ((double) color24.B * (double) z); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[5]].Value, new Vector2((float) (this.bgStartX + num10 * index34 + 16 * index36 + num36), (float) (this.bgStartY + Main.backgroundHeight[2] * index35 + 16 * index37)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index36 + num36 + 16, 16 * index37 + Main.backgroundHeight[2] * Main.magmaBGFrame, 16, 16)), color24, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[5]], new Vector2((float) (this.bgStart + num5 * index32 + 16 * index34 + num31), (float) (this.bgStartY + Main.backgroundHeight[2] * index33 + 16 * index35)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index34 + num31 + 16, 16 * index35 + Main.backgroundHeight[2] * Main.magmaBGFrame, 16, 16)), color24, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } } else @@ -39495,7 +39528,7 @@ label_623: color24.R = (byte) ((double) color24.R * (double) x1); color24.G = (byte) ((double) color24.G * (double) y1); color24.B = (byte) ((double) color24.B * (double) z); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[5]].Value, new Vector2((float) (this.bgStartX + num10 * index34 + 16 * index36 + num36), (float) (this.bgStartY + Main.backgroundHeight[2] * index35 + 16 * index37)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index36 + num36 + 16, 16 * index37 + Main.backgroundHeight[2] * Main.magmaBGFrame, 16, 16)), color24, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[5]], new Vector2((float) (this.bgStart + num5 * index32 + 16 * index34 + num31), (float) (this.bgStartY + Main.backgroundHeight[2] * index33 + 16 * index35)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index34 + num31 + 16, 16 * index35 + Main.backgroundHeight[2] * Main.magmaBGFrame, 16, 16)), color24, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } } } @@ -39506,22 +39539,21 @@ label_623: if (flag4) { this.bgParallax = (double) Main.caveParallax; - this.bgStartX = (int) (-Math.IEEERemainder((double) num10 + (double) Main.screenPosition.X * this.bgParallax, (double) num10) - (double) (num10 / 2)) - (int) vector2.X; - this.bgLoops = (Main.screenWidth + (int) vector2.X * 2) / num10 + 2; - this.bgTopY = this.bgStartY + this.bgLoopsY * Main.backgroundHeight[2]; - this.hellBlackBoxBottom = (float) this.bgTopY + Main.screenPosition.Y; - for (int index42 = 0; index42 < this.bgLoops; ++index42) + this.bgStart = (int) (-Math.IEEERemainder((double) num5 + (double) Main.screenPosition.X * this.bgParallax, (double) num5) - (double) (num5 / 2)) - (int) vector2.X; + this.bgLoops = (Main.screenWidth + (int) vector2.X * 2) / num5 + 2; + this.bgTop = this.bgStartY + this.bgLoopsY * Main.backgroundHeight[2]; + for (int index40 = 0; index40 < this.bgLoops; ++index40) { - for (int index43 = 0; index43 < num10 / 16; ++index43) + for (int index41 = 0; index41 < num5 / 16; ++index41) { - double num42 = (double) (this.bgStartX + num10 * index42 + index43 * 16 + 8); - float bgTopY = (float) this.bgTopY; - double x7 = (double) Main.screenPosition.X; - Microsoft.Xna.Framework.Color color29 = Lighting.GetColor((int) ((num42 + x7) / 16.0), (int) (((double) Main.screenPosition.Y + (double) bgTopY) / 16.0)); + double num37 = (double) (this.bgStart + num5 * index40 + index41 * 16 + 8); + float bgTop = (float) this.bgTop; + double x5 = (double) Main.screenPosition.X; + Microsoft.Xna.Framework.Color color29 = Lighting.GetColor((int) ((num37 + x5) / 16.0), (int) (((double) Main.screenPosition.Y + (double) bgTop) / 16.0)); color29.R = (byte) ((double) color29.R * (double) x1); color29.G = (byte) ((double) color29.G * (double) y1); color29.B = (byte) ((double) color29.B * (double) z); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[6]].Value, new Vector2((float) (this.bgStartX + num10 * index42 + 16 * index43 + num36), (float) this.bgTopY) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index43 + num36 + 16, Main.magmaBGFrame * 16, 16, 16)), color29); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[6]], new Vector2((float) (this.bgStart + num5 * index40 + 16 * index41 + num31), (float) this.bgTop) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index41 + num31 + 16, Main.magmaBGFrame * 16, 16, 16)), color29); if ((double) Main.ugBackTransition > 0.0) { Microsoft.Xna.Framework.Color color30 = color29; @@ -39529,19 +39561,17 @@ label_623: color30.G = (byte) ((double) color30.G * (double) Main.ugBackTransition); color30.B = (byte) ((double) color30.B * (double) Main.ugBackTransition); color30.A = (byte) ((double) color30.A * (double) Main.ugBackTransition); - Main.spriteBatch.Draw(TextureAssets.Background[numArray2[6]].Value, new Vector2((float) (this.bgStartX + num10 * index42 + 16 * index43 + num36), (float) this.bgTopY) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index43 + num36 + 16, Main.magmaBGFrame * 16, 16, 16)), color30); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray2[6]], new Vector2((float) (this.bgStart + num5 * index40 + 16 * index41 + num31), (float) this.bgTop) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index41 + num31 + 16, Main.magmaBGFrame * 16, 16, 16)), color30); } } } } } - Lighting.GlobalBrightness = num9; + Lighting.brightness = Lighting.defBrightness; TimeLogger.DrawTime(3, stopwatch.Elapsed.TotalMilliseconds); } } - public static Microsoft.Xna.Framework.Point GetScreenOverdrawOffset() => (Main.Camera.ScaledPosition - Main.Camera.UnscaledPosition).ToTileCoordinates(); - protected void OldDrawBackground() { Microsoft.Xna.Framework.Color[] slices = new Microsoft.Xna.Framework.Color[9]; @@ -39558,12 +39588,12 @@ label_623: float num6 = (float) num4; float num7 = (float) num4; float num8 = 0.0f; - if (Main.SceneMetrics.BloodTileCount > Main.SceneMetrics.EvilTileCount && Main.SceneMetrics.BloodTileCount > Main.SceneMetrics.HolyTileCount) - num8 = (float) Main.SceneMetrics.BloodTileCount; - else if (Main.SceneMetrics.HolyTileCount > Main.SceneMetrics.EvilTileCount) - num8 = (float) Main.SceneMetrics.HolyTileCount; - else if (Main.SceneMetrics.EvilTileCount > Main.SceneMetrics.HolyTileCount) - num8 = (float) Main.SceneMetrics.EvilTileCount; + if (Main.bloodTiles > Main.evilTiles && Main.bloodTiles > Main.holyTiles) + num8 = (float) Main.bloodTiles; + else if (Main.holyTiles > Main.evilTiles) + num8 = (float) Main.holyTiles; + else if (Main.evilTiles > Main.holyTiles) + num8 = (float) Main.evilTiles; float num9 = MathHelper.Clamp(num8 / 800f, 0.0f, 1f); float num10 = (Main.screenPosition.Y - (float) (Main.worldSurface * 16.0)) / 300f; if ((double) num10 < 0.0) @@ -39571,21 +39601,21 @@ label_623: else if ((double) num10 > 1.0) num10 = 1f; float num11 = (float) (1.0 * (1.0 - (double) num10) + (double) num5 * (double) num10); - Lighting.GlobalBrightness = (float) ((double) Lighting.GlobalBrightness * (1.0 - (double) num10) + 1.0 * (double) num10); + Lighting.brightness = (float) ((double) Lighting.defBrightness * (1.0 - (double) num10) + 1.0 * (double) num10); float num12 = MathHelper.Clamp((float) ((double) Main.screenPosition.Y - (double) (Main.screenHeight / 2) + 200.0 - Main.rockLayer * 16.0) / 300f, 0.0f, 1f); - if (Main.SceneMetrics.BloodTileCount > Main.SceneMetrics.EvilTileCount && Main.SceneMetrics.BloodTileCount > Main.SceneMetrics.HolyTileCount) + if (Main.bloodTiles > Main.evilTiles && Main.bloodTiles > Main.holyTiles) { num5 = (float) (1.0 * (double) num9 + (double) num5 * (1.0 - (double) num9)); num6 = (float) (0.550000011920929 * (double) num9 + (double) num6 * (1.0 - (double) num9)); num7 = (float) (0.5 * (double) num9 + (double) num7 * (1.0 - (double) num9)); } - else if (Main.SceneMetrics.EvilTileCount > 0) + else if (Main.evilTiles > 0) { num5 = (float) (0.800000011920929 * (double) num9 + (double) num5 * (1.0 - (double) num9)); num6 = (float) (0.75 * (double) num9 + (double) num6 * (1.0 - (double) num9)); num7 = (float) (1.10000002384186 * (double) num9 + (double) num7 * (1.0 - (double) num9)); } - else if (Main.SceneMetrics.HolyTileCount > 0) + else if (Main.holyTiles > 0) { num5 = (float) (1.0 * (double) num9 + (double) num5 * (1.0 - (double) num9)); num6 = (float) (0.699999988079071 * (double) num9 + (double) num6 * (1.0 - (double) num9)); @@ -39595,25 +39625,25 @@ label_623: float num14 = (float) (1.0 * ((double) num11 - (double) num12) + (double) num6 * (double) num12); float num15 = (float) (1.0 * ((double) num11 - (double) num12) + (double) num7 * (double) num12); int num16 = (int) (((double) Main.screenPosition.X + (double) (Main.screenWidth / 2)) / 16.0); - int num17 = (num16 > Main.caveBackX[0] ? (num16 > Main.caveBackX[1] ? (num16 > Main.caveBackX[2] ? Main.caveBackStyle[3] : Main.caveBackStyle[2]) : Main.caveBackStyle[1]) : Main.caveBackStyle[0]) + 3; - if (Main.SceneMetrics.SnowTileCount > SceneMetrics.SnowTileThreshold && ((double) Main.screenPosition.Y + (double) Main.screenHeight) / 16.0 < (double) (Main.maxTilesY - 250)) + int num17 = (num16 > Main.caveBackX[0] ? (num16 > Main.treeX[1] ? (num16 > Main.treeX[2] ? Main.caveBackStyle[3] : Main.caveBackStyle[2]) : Main.caveBackStyle[1]) : Main.caveBackStyle[0]) + 3; + if (Main.snowTiles > 300 && ((double) Main.screenPosition.Y + (double) Main.screenHeight) / 16.0 < (double) (Main.maxTilesY - 250)) num17 = 1; - if (Main.SceneMetrics.JungleTileCount > SceneMetrics.JungleTileThreshold) + if (Main.jungleTiles > 80) { if (num17 == 1) { - if (Main.SceneMetrics.JungleTileCount > Main.SceneMetrics.SnowTileCount) + if (Main.jungleTiles > Main.snowTiles) num17 = 11; } else num17 = 11; } - if (Main.SceneMetrics.MushroomTileCount > SceneMetrics.MushroomTileMax) + if (Main.shroomTiles > 200) num17 = 2; - if (num17 != Main.undergroundBackground) + if (num17 != Main.ugBack) { - Main.oldUndergroundBackground = Main.undergroundBackground; - Main.undergroundBackground = num17; + Main.oldUgBack = Main.ugBack; + Main.ugBack = num17; Main.ugBackTransition = 1f; } if ((double) Main.ugBackTransition > 0.0) @@ -39624,11 +39654,11 @@ label_623: int[] numArray2 = new int[6]; for (int index1 = 0; index1 < 2; ++index1) { - int undergroundBackground = Main.undergroundBackground; + int num18 = Main.ugBack; if (index1 == 1) - undergroundBackground = Main.oldUndergroundBackground; + num18 = Main.oldUgBack; int[] numArray3 = new int[6]; - switch (undergroundBackground) + switch (num18) { case 0: numArray3[0] = 1; @@ -39771,26 +39801,26 @@ label_623: numArray2[index3] = numArray3[index3]; } } - float num18 = (float) (1.20000004768372 * (1.0 - (double) num12) + 1.0 * (double) num12); + Lighting.defBrightness = (float) (1.20000004768372 * (1.0 - (double) num12) + 1.0 * (double) num12); this.bgParallax = (double) Main.caveParallax; - this.bgStartX = (int) (-Math.IEEERemainder((double) num3 + (double) Main.screenPosition.X * this.bgParallax, (double) num3) - (double) (num3 / 2)) - (int) vector2.X; - this.bgLoops = (Main.screenWidth + (int) vector2.X * 2) / num3 + 2; - this.bgTopY = (int) ((double) ((int) Main.worldSurface * 16 - 16) - (double) Main.screenPosition.Y + 16.0); + this.bgStart = (int) (-Math.IEEERemainder((double) num3 + (double) Main.screenPosition.X * this.bgParallax, (double) num3) - (double) (num3 / 2)) - (int) vector2.X; + this.bgLoops = Main.screenWidth / num3 + 2; + this.bgTop = (int) ((double) ((int) Main.worldSurface * 16 - 16) - (double) Main.screenPosition.Y + 16.0); for (int index4 = 0; index4 < this.bgLoops; ++index4) { for (int index5 = 0; index5 < num3 / 16; ++index5) { - int num19 = (int) (float) Math.Round(-Math.IEEERemainder((double) this.bgStartX + (double) Main.screenPosition.X, 16.0)); + int num19 = (int) (float) Math.Round(-Math.IEEERemainder((double) this.bgStart + (double) Main.screenPosition.X, 16.0)); if (num19 == -8) num19 = 8; - double num20 = (double) (this.bgStartX + num3 * index4 + index5 * 16 + 8); - float bgTopY = (float) this.bgTopY; + double num20 = (double) (this.bgStart + num3 * index4 + index5 * 16 + 8); + float bgTop = (float) this.bgTop; double x = (double) Main.screenPosition.X; - Microsoft.Xna.Framework.Color color1 = Lighting.GetColor((int) ((num20 + x) / 16.0), (int) (((double) Main.screenPosition.Y + (double) bgTopY) / 16.0)); + Microsoft.Xna.Framework.Color color1 = Lighting.GetColor((int) ((num20 + x) / 16.0), (int) (((double) Main.screenPosition.Y + (double) bgTop) / 16.0)); color1.R = (byte) ((double) color1.R * (double) num13); color1.G = (byte) ((double) color1.G * (double) num14); color1.B = (byte) ((double) color1.B * (double) num15); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[0]].Value, new Vector2((float) (this.bgStartX + num3 * index4 + 16 * index5 + num19), (float) this.bgTopY) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index5 + num19 + 16, 0, 16, 16)), color1); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[0]], new Vector2((float) (this.bgStart + num3 * index4 + 16 * index5 + num19), (float) this.bgTop) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index5 + num19 + 16, 0, 16, 16)), color1); if ((double) Main.ugBackTransition > 0.0) { Microsoft.Xna.Framework.Color color2 = color1; @@ -39798,7 +39828,7 @@ label_623: color2.G = (byte) ((double) color2.G * (double) Main.ugBackTransition); color2.B = (byte) ((double) color2.B * (double) Main.ugBackTransition); color2.A = (byte) ((double) color2.A * (double) Main.ugBackTransition); - Main.spriteBatch.Draw(TextureAssets.Background[numArray2[0]].Value, new Vector2((float) (this.bgStartX + num3 * index4 + 16 * index5 + num19), (float) this.bgTopY) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index5 + num19 + 16, 0, 16, 16)), color2); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray2[0]], new Vector2((float) (this.bgStart + num3 * index4 + 16 * index5 + num19), (float) this.bgTop) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index5 + num19 + 16, 0, 16, 16)), color2); } } } @@ -39806,28 +39836,28 @@ label_623: double num22 = Main.worldSurface + num21 - 5.0; bool flag1 = false; bool flag2 = false; - this.bgTopY = (int) ((double) ((int) Main.worldSurface * 16) - (double) Main.screenPosition.Y + 16.0); + this.bgTop = (int) ((double) ((int) Main.worldSurface * 16) - (double) Main.screenPosition.Y + 16.0); if (Main.worldSurface * 16.0 <= (double) Main.screenPosition.Y + (double) Main.screenHeight + (double) Main.offScreenRange) { this.bgParallax = (double) Main.caveParallax; - this.bgStartX = (int) (-Math.IEEERemainder((double) num3 + (double) Main.screenPosition.X * this.bgParallax, (double) num3) - (double) (num3 / 2)) - (int) vector2.X; + this.bgStart = (int) (-Math.IEEERemainder((double) num3 + (double) Main.screenPosition.X * this.bgParallax, (double) num3) - (double) (num3 / 2)) - (int) vector2.X; this.bgLoops = (Main.screenWidth + (int) vector2.X * 2) / num3 + 2; if (Main.worldSurface * 16.0 < (double) Main.screenPosition.Y - 16.0) { - this.bgStartY = (int) (Math.IEEERemainder((double) this.bgTopY, (double) Main.backgroundHeight[2]) - (double) Main.backgroundHeight[2]); + this.bgStartY = (int) (Math.IEEERemainder((double) this.bgTop, (double) Main.backgroundHeight[2]) - (double) Main.backgroundHeight[2]); this.bgLoopsY = (Main.screenHeight - this.bgStartY + (int) vector2.Y * 2) / Main.backgroundHeight[2] + 1; } else { - this.bgStartY = this.bgTopY; - this.bgLoopsY = (Main.screenHeight - this.bgTopY + (int) vector2.Y * 2) / Main.backgroundHeight[2] + 1; + this.bgStartY = this.bgTop; + this.bgLoopsY = (Main.screenHeight - this.bgTop + (int) vector2.Y * 2) / Main.backgroundHeight[2] + 1; } - if (Main.rockLayer * 16.0 < (double) Main.Camera.ScaledPosition.Y + 600.0) + if (Main.rockLayer * 16.0 < (double) Main.screenPosition.Y + 600.0) { this.bgLoopsY = (int) (Main.rockLayer * 16.0 - (double) Main.screenPosition.Y + 600.0 - (double) this.bgStartY) / Main.backgroundHeight[2]; flag2 = true; } - int num23 = (int) (float) Math.Round(-Math.IEEERemainder((double) this.bgStartX + (double) Main.screenPosition.X, 16.0)); + int num23 = (int) (float) Math.Round(-Math.IEEERemainder((double) this.bgStart + (double) Main.screenPosition.X, 16.0)); if (num23 == -8) num23 = 8; for (int index6 = 0; index6 < this.bgLoops; ++index6) @@ -39839,7 +39869,7 @@ label_623: for (int index9 = 0; index9 < 6; ++index9) { double num24 = (double) (this.bgStartY + index7 * 96 + index9 * 16 + 8); - int index10 = (int) (((double) (this.bgStartX + num3 * index6 + index8 * 16 + 8) + (double) Main.screenPosition.X) / 16.0); + int index10 = (int) (((double) (this.bgStart + num3 * index6 + index8 * 16 + 8) + (double) Main.screenPosition.X) / 16.0); double y = (double) Main.screenPosition.Y; int index11 = (int) ((num24 + y) / 16.0); Microsoft.Xna.Framework.Color color3 = Lighting.GetColor(index10, index11); @@ -39850,8 +39880,8 @@ label_623: if (!Main.drawToScreen) { VertexColors vertices; - Lighting.GetCornerColors(index10, index11, out vertices); - Main.tileBatch.Draw(TextureAssets.Background[numArray1[1]].Value, new Vector2((float) (this.bgStartX + num3 * index6 + 16 * index8 + num23), (float) (this.bgStartY + Main.backgroundHeight[numArray2[1]] * index7 + 16 * index9)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index8 + num23 + 16, 16 * index9, 16, 16)), vertices, Vector2.Zero, 1f, SpriteEffects.None); + Lighting.GetColor4Slice_New(index10, index11, out vertices); + Main.tileBatch.Draw(Main.backgroundTexture[numArray1[1]], new Vector2((float) (this.bgStart + num3 * index6 + 16 * index8 + num23), (float) (this.bgStartY + Main.backgroundHeight[numArray2[1]] * index7 + 16 * index9)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index8 + num23 + 16, 16 * index9, 16, 16)), vertices, Vector2.Zero, 1f, SpriteEffects.None); } else if (((int) color3.R > num1 || (double) color3.G > (double) num1 * 1.1 || (double) color3.B > (double) num1 * 1.2) && !Main.tile[index10, index11].active() && Main.wallLight[(int) Main.tile[index10, index11].wall] && (double) Main.ugBackTransition == 0.0) { @@ -39952,7 +39982,7 @@ label_623: color4.R = (byte) ((double) color4.R * (double) num13); color4.G = (byte) ((double) color4.G * (double) num14); color4.B = (byte) ((double) color4.B * (double) num15); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[1]].Value, new Vector2((float) (this.bgStartX + num3 * index6 + 16 * index8 + num25 + num23), (float) (this.bgStartY + Main.backgroundHeight[numArray1[1]] * index7 + 16 * index9 + num26)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index8 + num25 + num23 + 16, 16 * index9 + num26, width, height)), color4); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[1]], new Vector2((float) (this.bgStart + num3 * index6 + 16 * index8 + num25 + num23), (float) (this.bgStartY + Main.backgroundHeight[numArray1[1]] * index7 + 16 * index9 + num26)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index8 + num25 + num23 + 16, 16 * index9 + num26, width, height)), color4); if ((double) Main.ugBackTransition > 0.0) { Microsoft.Xna.Framework.Color color6 = color4; @@ -39960,7 +39990,7 @@ label_623: color6.G = (byte) ((double) color6.G * (double) Main.ugBackTransition); color6.B = (byte) ((double) color6.B * (double) Main.ugBackTransition); color6.A = (byte) ((double) color6.A * (double) Main.ugBackTransition); - Main.spriteBatch.Draw(TextureAssets.Background[numArray2[1]].Value, new Vector2((float) (this.bgStartX + num3 * index6 + 16 * index8 + num25 + num23), (float) (this.bgStartY + Main.backgroundHeight[numArray2[1]] * index7 + 16 * index9 + num26)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index8 + num25 + num23 + 16, 16 * index9 + num26, width, height)), color6); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray2[1]], new Vector2((float) (this.bgStart + num3 * index6 + 16 * index8 + num25 + num23), (float) (this.bgStartY + Main.backgroundHeight[numArray2[1]] * index7 + 16 * index9 + num26)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index8 + num25 + num23 + 16, 16 * index9 + num26, width, height)), color6); } } } @@ -39969,7 +39999,7 @@ label_623: color3.R = (byte) ((double) color3.R * (double) num13); color3.G = (byte) ((double) color3.G * (double) num14); color3.B = (byte) ((double) color3.B * (double) num15); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[1]].Value, new Vector2((float) (this.bgStartX + num3 * index6 + 16 * index8 + num23), (float) (this.bgStartY + Main.backgroundHeight[numArray1[1]] * index7 + 16 * index9)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index8 + num23 + 16, 16 * index9, 16, 16)), color3); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[1]], new Vector2((float) (this.bgStart + num3 * index6 + 16 * index8 + num23), (float) (this.bgStartY + Main.backgroundHeight[numArray1[1]] * index7 + 16 * index9)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index8 + num23 + 16, 16 * index9, 16, 16)), color3); } } else if (((int) color3.R > num2 || (double) color3.G > (double) num2 * 1.1 || (double) color3.B > (double) num2 * 1.2) && (double) Main.ugBackTransition == 0.0) @@ -40000,7 +40030,7 @@ label_623: color7.R = (byte) ((double) color7.R * (double) num13); color7.G = (byte) ((double) color7.G * (double) num14); color7.B = (byte) ((double) color7.B * (double) num15); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[1]].Value, new Vector2((float) (this.bgStartX + num3 * index6 + 16 * index8 + num27 + num23), (float) (this.bgStartY + Main.backgroundHeight[numArray1[1]] * index7 + 16 * index9 + num28)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index8 + num27 + num23 + 16, 16 * index9 + num28, 8, 8)), color7); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[1]], new Vector2((float) (this.bgStart + num3 * index6 + 16 * index8 + num27 + num23), (float) (this.bgStartY + Main.backgroundHeight[numArray1[1]] * index7 + 16 * index9 + num28)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index8 + num27 + num23 + 16, 16 * index9 + num28, 8, 8)), color7); if ((double) Main.ugBackTransition > 0.0) { Microsoft.Xna.Framework.Color color9 = color7; @@ -40008,7 +40038,7 @@ label_623: color9.G = (byte) ((double) color9.G * (double) Main.ugBackTransition); color9.B = (byte) ((double) color9.B * (double) Main.ugBackTransition); color9.A = (byte) ((double) color9.A * (double) Main.ugBackTransition); - Main.spriteBatch.Draw(TextureAssets.Background[numArray2[1]].Value, new Vector2((float) (this.bgStartX + num3 * index6 + 16 * index8 + num27 + num23), (float) (this.bgStartY + Main.backgroundHeight[numArray2[1]] * index7 + 16 * index9 + num28)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index8 + num27 + num23 + 16, 16 * index9 + num28, 8, 8)), color9); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray2[1]], new Vector2((float) (this.bgStart + num3 * index6 + 16 * index8 + num27 + num23), (float) (this.bgStartY + Main.backgroundHeight[numArray2[1]] * index7 + 16 * index9 + num28)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index8 + num27 + num23 + 16, 16 * index9 + num28, 8, 8)), color9); } } } @@ -40017,7 +40047,7 @@ label_623: color3.R = (byte) ((double) color3.R * (double) num13); color3.G = (byte) ((double) color3.G * (double) num14); color3.B = (byte) ((double) color3.B * (double) num15); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[1]].Value, new Vector2((float) (this.bgStartX + num3 * index6 + 16 * index8 + num23), (float) (this.bgStartY + Main.backgroundHeight[numArray1[1]] * index7 + 16 * index9)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index8 + num23 + 16, 16 * index9, 16, 16)), color3); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[1]], new Vector2((float) (this.bgStart + num3 * index6 + 16 * index8 + num23), (float) (this.bgStartY + Main.backgroundHeight[numArray1[1]] * index7 + 16 * index9)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index8 + num23 + 16, 16 * index9, 16, 16)), color3); if ((double) Main.ugBackTransition > 0.0) { Microsoft.Xna.Framework.Color color10 = color3; @@ -40025,7 +40055,7 @@ label_623: color10.G = (byte) ((double) color10.G * (double) Main.ugBackTransition); color10.B = (byte) ((double) color10.B * (double) Main.ugBackTransition); color10.A = (byte) ((double) color10.A * (double) Main.ugBackTransition); - Main.spriteBatch.Draw(TextureAssets.Background[numArray2[1]].Value, new Vector2((float) (this.bgStartX + num3 * index6 + 16 * index8 + num23), (float) (this.bgStartY + Main.backgroundHeight[numArray2[1]] * index7 + 16 * index9)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index8 + num23 + 16, 16 * index9, 16, 16)), color10); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray2[1]], new Vector2((float) (this.bgStart + num3 * index6 + 16 * index8 + num23), (float) (this.bgStartY + Main.backgroundHeight[numArray2[1]] * index7 + 16 * index9)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index8 + num23 + 16, 16 * index9, 16, 16)), color10); } } } @@ -40034,7 +40064,7 @@ label_623: color3.R = (byte) ((double) color3.R * (double) num13); color3.G = (byte) ((double) color3.G * (double) num14); color3.B = (byte) ((double) color3.B * (double) num15); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[1]].Value, new Vector2((float) (this.bgStartX + num3 * index6 + 16 * index8 + num23), (float) (this.bgStartY + Main.backgroundHeight[numArray1[1]] * index7 + 16 * index9)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index8 + num23 + 16, 16 * index9, 16, 16)), color3); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[1]], new Vector2((float) (this.bgStart + num3 * index6 + 16 * index8 + num23), (float) (this.bgStartY + Main.backgroundHeight[numArray1[1]] * index7 + 16 * index9)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index8 + num23 + 16, 16 * index9, 16, 16)), color3); } } } @@ -40051,7 +40081,7 @@ label_623: for (int index17 = 0; index17 < 6; ++index17) { double num29 = (double) (this.bgStartY + index15 * 96 + index17 * 16 + 8); - int index18 = (int) (((double) (this.bgStartX + num3 * index14 + index16 * 16 + 8) + (double) Main.screenPosition.X) / 16.0); + int index18 = (int) (((double) (this.bgStart + num3 * index14 + index16 * 16 + 8) + (double) Main.screenPosition.X) / 16.0); double y = (double) Main.screenPosition.Y; int index19 = (int) ((num29 + y) / 16.0); Microsoft.Xna.Framework.Color color = Lighting.GetColor(index18, index19); @@ -40060,13 +40090,13 @@ label_623: if (color.R > (byte) 0 || color.G > (byte) 0 || color.B > (byte) 0) { VertexColors vertices; - Lighting.GetCornerColors(index18, index19, out vertices, Main.ugBackTransition); + Lighting.GetColor4Slice_New(index18, index19, out vertices, Main.ugBackTransition); byte num30 = (byte) ((double) byte.MaxValue * (double) Main.ugBackTransition); vertices.BottomLeftColor.A = num30; vertices.BottomRightColor.A = num30; vertices.TopLeftColor.A = num30; vertices.TopRightColor.A = num30; - Main.tileBatch.Draw(TextureAssets.Background[numArray2[1]].Value, new Vector2((float) (this.bgStartX + num3 * index14 + 16 * index16 + num23), (float) (this.bgStartY + Main.backgroundHeight[numArray2[1]] * index15 + 16 * index17)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index16 + num23 + 16, 16 * index17, 16, 16)), vertices, Vector2.Zero, 1f, SpriteEffects.None); + Main.tileBatch.Draw(Main.backgroundTexture[numArray2[1]], new Vector2((float) (this.bgStart + num3 * index14 + 16 * index16 + num23), (float) (this.bgStartY + Main.backgroundHeight[numArray2[1]] * index15 + 16 * index17)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index16 + num23 + 16, 16 * index17, 16, 16)), vertices, Vector2.Zero, 1f, SpriteEffects.None); } } } @@ -40076,23 +40106,23 @@ label_623: if (flag2) { this.bgParallax = (double) Main.caveParallax; - this.bgStartX = (int) (-Math.IEEERemainder((double) num3 + (double) Main.screenPosition.X * this.bgParallax, (double) num3) - (double) (num3 / 2)) - (int) vector2.X; + this.bgStart = (int) (-Math.IEEERemainder((double) num3 + (double) Main.screenPosition.X * this.bgParallax, (double) num3) - (double) (num3 / 2)) - (int) vector2.X; this.bgLoops = (Main.screenWidth + (int) vector2.X * 2) / num3 + 2; - this.bgTopY = this.bgStartY + this.bgLoopsY * Main.backgroundHeight[2]; - if (this.bgTopY > -32) + this.bgTop = this.bgStartY + this.bgLoopsY * Main.backgroundHeight[2]; + if (this.bgTop > -32) { for (int index20 = 0; index20 < this.bgLoops; ++index20) { for (int index21 = 0; index21 < num3 / 16; ++index21) { - double num31 = (double) (this.bgStartX + num3 * index20 + index21 * 16 + 8); - float bgTopY = (float) this.bgTopY; + double num31 = (double) (this.bgStart + num3 * index20 + index21 * 16 + 8); + float bgTop = (float) this.bgTop; double x = (double) Main.screenPosition.X; - Microsoft.Xna.Framework.Color color11 = Lighting.GetColor((int) ((num31 + x) / 16.0), (int) (((double) Main.screenPosition.Y + (double) bgTopY) / 16.0)); + Microsoft.Xna.Framework.Color color11 = Lighting.GetColor((int) ((num31 + x) / 16.0), (int) (((double) Main.screenPosition.Y + (double) bgTop) / 16.0)); color11.R = (byte) ((double) color11.R * (double) num13); color11.G = (byte) ((double) color11.G * (double) num14); color11.B = (byte) ((double) color11.B * (double) num15); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[2]].Value, new Vector2((float) (this.bgStartX + num3 * index20 + 16 * index21 + num23), (float) this.bgTopY) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index21 + num23 + 16, 0, 16, 16)), color11); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[2]], new Vector2((float) (this.bgStart + num3 * index20 + 16 * index21 + num23), (float) this.bgTop) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index21 + num23 + 16, 0, 16, 16)), color11); if ((double) Main.ugBackTransition > 0.0) { Microsoft.Xna.Framework.Color color12 = color11; @@ -40100,35 +40130,35 @@ label_623: color12.G = (byte) ((double) color12.G * (double) Main.ugBackTransition); color12.B = (byte) ((double) color12.B * (double) Main.ugBackTransition); color12.A = (byte) ((double) color12.A * (double) Main.ugBackTransition); - Main.spriteBatch.Draw(TextureAssets.Background[numArray2[2]].Value, new Vector2((float) (this.bgStartX + num3 * index20 + 16 * index21 + num23), (float) this.bgTopY) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index21 + num23 + 16, 0, 16, 16)), color12); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray2[2]], new Vector2((float) (this.bgStart + num3 * index20 + 16 * index21 + num23), (float) this.bgTop) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index21 + num23 + 16, 0, 16, 16)), color12); } } } } } } - this.bgTopY = (int) ((double) ((int) Main.rockLayer * 16) - (double) Main.screenPosition.Y + 16.0 + 600.0 - 8.0); + this.bgTop = (int) ((double) ((int) Main.rockLayer * 16) - (double) Main.screenPosition.Y + 16.0 + 600.0 - 8.0); if (Main.rockLayer * 16.0 <= (double) Main.screenPosition.Y + 600.0) { this.bgParallax = (double) Main.caveParallax; - this.bgStartX = (int) (-Math.IEEERemainder((double) num3 + (double) Main.screenPosition.X * this.bgParallax, (double) num3) - (double) (num3 / 2)) - (int) vector2.X; + this.bgStart = (int) (-Math.IEEERemainder((double) num3 + (double) Main.screenPosition.X * this.bgParallax, (double) num3) - (double) (num3 / 2)) - (int) vector2.X; this.bgLoops = (Main.screenWidth + (int) vector2.X * 2) / num3 + 2; if (Main.rockLayer * 16.0 + (double) Main.screenHeight < (double) Main.screenPosition.Y - 16.0) { - this.bgStartY = (int) (Math.IEEERemainder((double) this.bgTopY, (double) Main.backgroundHeight[3]) - (double) Main.backgroundHeight[3]); + this.bgStartY = (int) (Math.IEEERemainder((double) this.bgTop, (double) Main.backgroundHeight[3]) - (double) Main.backgroundHeight[3]); this.bgLoopsY = (Main.screenHeight - this.bgStartY + (int) vector2.Y * 2) / Main.backgroundHeight[2] + 1; } else { - this.bgStartY = this.bgTopY; - this.bgLoopsY = (Main.screenHeight - this.bgTopY + (int) vector2.Y * 2) / Main.backgroundHeight[2] + 1; + this.bgStartY = this.bgTop; + this.bgLoopsY = (Main.screenHeight - this.bgTop + (int) vector2.Y * 2) / Main.backgroundHeight[2] + 1; } if (num22 * 16.0 < (double) Main.screenPosition.Y + 600.0) { this.bgLoopsY = (int) (num22 * 16.0 - (double) Main.screenPosition.Y + 600.0 - (double) this.bgStartY) / Main.backgroundHeight[2]; flag1 = true; } - int num32 = (int) (float) Math.Round(-Math.IEEERemainder((double) this.bgStartX + (double) Main.screenPosition.X, 16.0)); + int num32 = (int) (float) Math.Round(-Math.IEEERemainder((double) this.bgStart + (double) Main.screenPosition.X, 16.0)); if (num32 == -8) num32 = 8; for (int index22 = 0; index22 < this.bgLoops; ++index22) @@ -40140,7 +40170,7 @@ label_623: for (int index25 = 0; index25 < 6; ++index25) { double num33 = (double) (this.bgStartY + index23 * 96 + index25 * 16 + 8); - int index26 = (int) (((double) (this.bgStartX + num3 * index22 + index24 * 16 + 8) + (double) Main.screenPosition.X) / 16.0); + int index26 = (int) (((double) (this.bgStart + num3 * index22 + index24 * 16 + 8) + (double) Main.screenPosition.X) / 16.0); double y = (double) Main.screenPosition.Y; int index27 = (int) ((num33 + y) / 16.0); Microsoft.Xna.Framework.Color color13 = Lighting.GetColor(index26, index27); @@ -40259,7 +40289,7 @@ label_623: color14.R = (byte) ((double) color14.R * (double) num13); color14.G = (byte) ((double) color14.G * (double) num14); color14.B = (byte) ((double) color14.B * (double) num15); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[3]].Value, new Vector2((float) (this.bgStartX + num3 * index22 + 16 * index24 + num34 + num32), (float) (this.bgStartY + Main.backgroundHeight[numArray1[3]] * index23 + 16 * index25 + num35)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index24 + num34 + num32 + 16, 16 * index25 + num35, width, height)), color14); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[3]], new Vector2((float) (this.bgStart + num3 * index22 + 16 * index24 + num34 + num32), (float) (this.bgStartY + Main.backgroundHeight[numArray1[3]] * index23 + 16 * index25 + num35)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index24 + num34 + num32 + 16, 16 * index25 + num35, width, height)), color14); if ((double) Main.ugBackTransition > 0.0) { Microsoft.Xna.Framework.Color color16 = color14; @@ -40267,7 +40297,7 @@ label_623: color16.G = (byte) ((double) color16.G * (double) Main.ugBackTransition); color16.B = (byte) ((double) color16.B * (double) Main.ugBackTransition); color16.A = (byte) ((double) color16.A * (double) Main.ugBackTransition); - Main.spriteBatch.Draw(TextureAssets.Background[numArray2[3]].Value, new Vector2((float) (this.bgStartX + num3 * index22 + 16 * index24 + num34 + num32), (float) (this.bgStartY + Main.backgroundHeight[numArray2[3]] * index23 + 16 * index25 + num35)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index24 + num34 + num32 + 16, 16 * index25 + num35, width, height)), color16); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray2[3]], new Vector2((float) (this.bgStart + num3 * index22 + 16 * index24 + num34 + num32), (float) (this.bgStartY + Main.backgroundHeight[numArray2[3]] * index23 + 16 * index25 + num35)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index24 + num34 + num32 + 16, 16 * index25 + num35, width, height)), color16); } } } @@ -40299,7 +40329,7 @@ label_623: color17.R = (byte) ((double) color17.R * (double) num13); color17.G = (byte) ((double) color17.G * (double) num14); color17.B = (byte) ((double) color17.B * (double) num15); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[3]].Value, new Vector2((float) (this.bgStartX + num3 * index22 + 16 * index24 + num36 + num32), (float) (this.bgStartY + Main.backgroundHeight[numArray1[3]] * index23 + 16 * index25 + num37)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index24 + num36 + num32 + 16, 16 * index25 + num37, 8, 8)), color17); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[3]], new Vector2((float) (this.bgStart + num3 * index22 + 16 * index24 + num36 + num32), (float) (this.bgStartY + Main.backgroundHeight[numArray1[3]] * index23 + 16 * index25 + num37)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index24 + num36 + num32 + 16, 16 * index25 + num37, 8, 8)), color17); if ((double) Main.ugBackTransition > 0.0) { Microsoft.Xna.Framework.Color color19 = color17; @@ -40307,7 +40337,7 @@ label_623: color19.G = (byte) ((double) color19.G * (double) Main.ugBackTransition); color19.B = (byte) ((double) color19.B * (double) Main.ugBackTransition); color19.A = (byte) ((double) color19.A * (double) Main.ugBackTransition); - Main.spriteBatch.Draw(TextureAssets.Background[numArray2[3]].Value, new Vector2((float) (this.bgStartX + num3 * index22 + 16 * index24 + num36 + num32), (float) (this.bgStartY + Main.backgroundHeight[numArray2[3]] * index23 + 16 * index25 + num37)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index24 + num36 + num32 + 16, 16 * index25 + num37, 8, 8)), color19); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray2[3]], new Vector2((float) (this.bgStart + num3 * index22 + 16 * index24 + num36 + num32), (float) (this.bgStartY + Main.backgroundHeight[numArray2[3]] * index23 + 16 * index25 + num37)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index24 + num36 + num32 + 16, 16 * index25 + num37, 8, 8)), color19); } } } @@ -40316,7 +40346,7 @@ label_623: color13.R = (byte) ((double) color13.R * (double) num13); color13.G = (byte) ((double) color13.G * (double) num14); color13.B = (byte) ((double) color13.B * (double) num15); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[3]].Value, new Vector2((float) (this.bgStartX + num3 * index22 + 16 * index24 + num32), (float) (this.bgStartY + Main.backgroundHeight[numArray1[3]] * index23 + 16 * index25)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index24 + num32 + 16, 16 * index25, 16, 16)), color13); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[3]], new Vector2((float) (this.bgStart + num3 * index22 + 16 * index24 + num32), (float) (this.bgStartY + Main.backgroundHeight[numArray1[3]] * index23 + 16 * index25)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index24 + num32 + 16, 16 * index25, 16, 16)), color13); if ((double) Main.ugBackTransition > 0.0) { Microsoft.Xna.Framework.Color color20 = color13; @@ -40324,7 +40354,7 @@ label_623: color20.G = (byte) ((double) color20.G * (double) Main.ugBackTransition); color20.B = (byte) ((double) color20.B * (double) Main.ugBackTransition); color20.A = (byte) ((double) color20.A * (double) Main.ugBackTransition); - Main.spriteBatch.Draw(TextureAssets.Background[numArray2[3]].Value, new Vector2((float) (this.bgStartX + num3 * index22 + 16 * index24 + num32), (float) (this.bgStartY + Main.backgroundHeight[numArray2[3]] * index23 + 16 * index25)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index24 + num32 + 16, 16 * index25, 16, 16)), color20); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray2[3]], new Vector2((float) (this.bgStart + num3 * index22 + 16 * index24 + num32), (float) (this.bgStartY + Main.backgroundHeight[numArray2[3]] * index23 + 16 * index25)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index24 + num32 + 16, 16 * index25, 16, 16)), color20); } } } @@ -40333,7 +40363,7 @@ label_623: color13.R = (byte) ((double) color13.R * (double) num13); color13.G = (byte) ((double) color13.G * (double) num14); color13.B = (byte) ((double) color13.B * (double) num15); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[3]].Value, new Vector2((float) (this.bgStartX + num3 * index22 + 16 * index24 + num32), (float) (this.bgStartY + Main.backgroundHeight[numArray1[3]] * index23 + 16 * index25)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index24 + num32 + 16, 16 * index25, 16, 16)), color13); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[3]], new Vector2((float) (this.bgStart + num3 * index22 + 16 * index24 + num32), (float) (this.bgStartY + Main.backgroundHeight[numArray1[3]] * index23 + 16 * index25)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index24 + num32 + 16, 16 * index25, 16, 16)), color13); if ((double) Main.ugBackTransition > 0.0) { Microsoft.Xna.Framework.Color color21 = color13; @@ -40341,7 +40371,7 @@ label_623: color21.G = (byte) ((double) color21.G * (double) Main.ugBackTransition); color21.B = (byte) ((double) color21.B * (double) Main.ugBackTransition); color21.A = (byte) ((double) color21.A * (double) Main.ugBackTransition); - Main.spriteBatch.Draw(TextureAssets.Background[numArray2[3]].Value, new Vector2((float) (this.bgStartX + num3 * index22 + 16 * index24 + num32), (float) (this.bgStartY + Main.backgroundHeight[numArray2[3]] * index23 + 16 * index25)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index24 + num32 + 16, 16 * index25, 16, 16)), color21); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray2[3]], new Vector2((float) (this.bgStart + num3 * index22 + 16 * index24 + num32), (float) (this.bgStartY + Main.backgroundHeight[numArray2[3]] * index23 + 16 * index25)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index24 + num32 + 16, 16 * index25, 16, 16)), color21); } } } @@ -40353,21 +40383,21 @@ label_623: if (flag1) { this.bgParallax = (double) Main.caveParallax; - this.bgStartX = (int) (-Math.IEEERemainder((double) num3 + (double) Main.screenPosition.X * this.bgParallax, (double) num3) - (double) (num3 / 2)) - (int) vector2.X; + this.bgStart = (int) (-Math.IEEERemainder((double) num3 + (double) Main.screenPosition.X * this.bgParallax, (double) num3) - (double) (num3 / 2)) - (int) vector2.X; this.bgLoops = (Main.screenWidth + (int) vector2.X * 2) / num3 + 2; - this.bgTopY = this.bgStartY + this.bgLoopsY * Main.backgroundHeight[2]; + this.bgTop = this.bgStartY + this.bgLoopsY * Main.backgroundHeight[2]; for (int index30 = 0; index30 < this.bgLoops; ++index30) { for (int index31 = 0; index31 < num3 / 16; ++index31) { - double num38 = (double) (this.bgStartX + num3 * index30 + index31 * 16 + 8); - float bgTopY = (float) this.bgTopY; + double num38 = (double) (this.bgStart + num3 * index30 + index31 * 16 + 8); + float bgTop = (float) this.bgTop; double x = (double) Main.screenPosition.X; - Microsoft.Xna.Framework.Color color22 = Lighting.GetColor((int) ((num38 + x) / 16.0), (int) (((double) Main.screenPosition.Y + (double) bgTopY) / 16.0)); + Microsoft.Xna.Framework.Color color22 = Lighting.GetColor((int) ((num38 + x) / 16.0), (int) (((double) Main.screenPosition.Y + (double) bgTop) / 16.0)); color22.R = (byte) ((double) color22.R * (double) num13); color22.G = (byte) ((double) color22.G * (double) num14); color22.B = (byte) ((double) color22.B * (double) num15); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[4]].Value, new Vector2((float) (this.bgStartX + num3 * index30 + 16 * index31 + num32), (float) this.bgTopY) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index31 + num32 + 16, Main.magmaBGFrame * 16, 16, 16)), color22); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[4]], new Vector2((float) (this.bgStart + num3 * index30 + 16 * index31 + num32), (float) this.bgTop) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index31 + num32 + 16, Main.magmaBGFrame * 16, 16, 16)), color22); if ((double) Main.ugBackTransition > 0.0) { Microsoft.Xna.Framework.Color color23 = color22; @@ -40375,30 +40405,30 @@ label_623: color23.G = (byte) ((double) color23.G * (double) Main.ugBackTransition); color23.B = (byte) ((double) color23.B * (double) Main.ugBackTransition); color23.A = (byte) ((double) color23.A * (double) Main.ugBackTransition); - Main.spriteBatch.Draw(TextureAssets.Background[numArray2[4]].Value, new Vector2((float) (this.bgStartX + num3 * index30 + 16 * index31 + num32), (float) this.bgTopY) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index31 + num32 + 16, Main.magmaBGFrame * 16, 16, 16)), color23); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray2[4]], new Vector2((float) (this.bgStart + num3 * index30 + 16 * index31 + num32), (float) this.bgTop) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index31 + num32 + 16, Main.magmaBGFrame * 16, 16, 16)), color23); } } } } } - this.bgTopY = (int) ((double) ((int) num22 * 16) - (double) Main.screenPosition.Y + 16.0 + 600.0) - 8; + this.bgTop = (int) ((double) ((int) num22 * 16) - (double) Main.screenPosition.Y + 16.0 + 600.0) - 8; if (num22 * 16.0 <= (double) Main.screenPosition.Y + 600.0) { - this.bgStartX = (int) (-Math.IEEERemainder((double) num3 + (double) Main.screenPosition.X * this.bgParallax, (double) num3) - (double) (num3 / 2)) - (int) vector2.X; + this.bgStart = (int) (-Math.IEEERemainder((double) num3 + (double) Main.screenPosition.X * this.bgParallax, (double) num3) - (double) (num3 / 2)) - (int) vector2.X; this.bgLoops = (Main.screenWidth + (int) vector2.X * 2) / num3 + 2; if (num22 * 16.0 + (double) Main.screenHeight < (double) Main.screenPosition.Y - 16.0) { - this.bgStartY = (int) (Math.IEEERemainder((double) this.bgTopY, (double) Main.backgroundHeight[2]) - (double) Main.backgroundHeight[2]); + this.bgStartY = (int) (Math.IEEERemainder((double) this.bgTop, (double) Main.backgroundHeight[2]) - (double) Main.backgroundHeight[2]); this.bgLoopsY = (Main.screenHeight - this.bgStartY + (int) vector2.Y * 2) / Main.backgroundHeight[2] + 1; } else { - this.bgStartY = this.bgTopY; - this.bgLoopsY = (Main.screenHeight - this.bgTopY + (int) vector2.Y * 2) / Main.backgroundHeight[2] + 1; + this.bgStartY = this.bgTop; + this.bgLoopsY = (Main.screenHeight - this.bgTop + (int) vector2.Y * 2) / Main.backgroundHeight[2] + 1; } int num39 = (int) ((double) num1 * 1.5); int num40 = (int) ((double) num2 * 1.5); - int num41 = (int) (float) Math.Round(-Math.IEEERemainder((double) this.bgStartX + (double) Main.screenPosition.X, 16.0)); + int num41 = (int) (float) Math.Round(-Math.IEEERemainder((double) this.bgStart + (double) Main.screenPosition.X, 16.0)); if (num41 == -8) num41 = 8; for (int index32 = 0; index32 < this.bgLoops; ++index32) @@ -40410,7 +40440,7 @@ label_623: for (int index35 = 0; index35 < 6; ++index35) { double num42 = (double) (this.bgStartY + index33 * 96 + index35 * 16 + 8); - int index36 = (int) (((double) (this.bgStartX + num3 * index32 + index34 * 16 + 8) + (double) Main.screenPosition.X) / 16.0); + int index36 = (int) (((double) (this.bgStart + num3 * index32 + index34 * 16 + 8) + (double) Main.screenPosition.X) / 16.0); double y = (double) Main.screenPosition.Y; int index37 = (int) ((num42 + y) / 16.0); Microsoft.Xna.Framework.Color color24 = Lighting.GetColor(index36, index37); @@ -40529,7 +40559,7 @@ label_623: color25.R = (byte) ((double) color25.R * (double) num13); color25.G = (byte) ((double) color25.G * (double) num14); color25.B = (byte) ((double) color25.B * (double) num15); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[5]].Value, new Vector2((float) (this.bgStartX + num3 * index32 + 16 * index34 + num43 + num41), (float) (this.bgStartY + Main.backgroundHeight[2] * index33 + 16 * index35 + num44)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index34 + num43 + num41 + 16, 16 * index35 + Main.backgroundHeight[2] * Main.magmaBGFrame + num44, width, height)), color25, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[5]], new Vector2((float) (this.bgStart + num3 * index32 + 16 * index34 + num43 + num41), (float) (this.bgStartY + Main.backgroundHeight[2] * index33 + 16 * index35 + num44)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index34 + num43 + num41 + 16, 16 * index35 + Main.backgroundHeight[2] * Main.magmaBGFrame + num44, width, height)), color25, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } } else if ((int) color24.R > num40 || (double) color24.G > (double) num40 * 1.1 || (double) color24.B > (double) num40 * 1.2) @@ -40560,7 +40590,7 @@ label_623: color27.R = (byte) ((double) color27.R * (double) num13); color27.G = (byte) ((double) color27.G * (double) num14); color27.B = (byte) ((double) color27.B * (double) num15); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[5]].Value, new Vector2((float) (this.bgStartX + num3 * index32 + 16 * index34 + num45 + num41), (float) (this.bgStartY + Main.backgroundHeight[2] * index33 + 16 * index35 + num46)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index34 + num45 + num41 + 16, 16 * index35 + Main.backgroundHeight[2] * Main.magmaBGFrame + num46, 8, 8)), color27, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[5]], new Vector2((float) (this.bgStart + num3 * index32 + 16 * index34 + num45 + num41), (float) (this.bgStartY + Main.backgroundHeight[2] * index33 + 16 * index35 + num46)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index34 + num45 + num41 + 16, 16 * index35 + Main.backgroundHeight[2] * Main.magmaBGFrame + num46, 8, 8)), color27, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } } else @@ -40568,7 +40598,7 @@ label_623: color24.R = (byte) ((double) color24.R * (double) num13); color24.G = (byte) ((double) color24.G * (double) num14); color24.B = (byte) ((double) color24.B * (double) num15); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[5]].Value, new Vector2((float) (this.bgStartX + num3 * index32 + 16 * index34 + num41), (float) (this.bgStartY + Main.backgroundHeight[2] * index33 + 16 * index35)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index34 + num41 + 16, 16 * index35 + Main.backgroundHeight[2] * Main.magmaBGFrame, 16, 16)), color24, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[5]], new Vector2((float) (this.bgStart + num3 * index32 + 16 * index34 + num41), (float) (this.bgStartY + Main.backgroundHeight[2] * index33 + 16 * index35)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index34 + num41 + 16, 16 * index35 + Main.backgroundHeight[2] * Main.magmaBGFrame, 16, 16)), color24, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } } else @@ -40576,7 +40606,7 @@ label_623: color24.R = (byte) ((double) color24.R * (double) num13); color24.G = (byte) ((double) color24.G * (double) num14); color24.B = (byte) ((double) color24.B * (double) num15); - Main.spriteBatch.Draw(TextureAssets.Background[numArray1[5]].Value, new Vector2((float) (this.bgStartX + num3 * index32 + 16 * index34 + num41), (float) (this.bgStartY + Main.backgroundHeight[2] * index33 + 16 * index35)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index34 + num41 + 16, 16 * index35 + Main.backgroundHeight[2] * Main.magmaBGFrame, 16, 16)), color24, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.backgroundTexture[numArray1[5]], new Vector2((float) (this.bgStart + num3 * index32 + 16 * index34 + num41), (float) (this.bgStartY + Main.backgroundHeight[2] * index33 + 16 * index35)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(16 * index34 + num41 + 16, 16 * index35 + Main.backgroundHeight[2] * Main.magmaBGFrame, 16, 16)), color24, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } } } @@ -40584,7 +40614,7 @@ label_623: } } } - Lighting.GlobalBrightness = num18; + Lighting.brightness = Lighting.defBrightness; TimeLogger.DrawTime(3, stopwatch.Elapsed.TotalMilliseconds); } @@ -40598,7 +40628,7 @@ label_623: Main.tileBatch.Begin(); try { - this.DrawWaters(true); + this.drawWaters(true); } catch { @@ -40685,14 +40715,6 @@ label_623: Main.mapMaxY = mapMaxY; break; } - if (Main.mapMinX < 0) - Main.mapMinX = 0; - if (Main.mapMinX >= Main.maxTilesX) - Main.mapMinX = Main.maxTilesX - 1; - if (Main.mapMinY < 0) - Main.mapMinY = 0; - if (Main.mapMinY >= Main.maxTilesY) - Main.mapMinY = Main.maxTilesY - 1; for (int mapMinX = Main.mapMinX; mapMinX < Main.mapMaxX; ++mapMinX) { for (int mapMinY2 = Main.mapMinY; mapMinY2 < Main.mapMaxY; ++mapMinY2) @@ -40756,7 +40778,7 @@ label_623: break; } } - Main.spriteBatch.Draw(TextureAssets.MagicPixel.Value, new Vector2((float) num9, (float) num10), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, width, height)), mapTileXnaColor, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.magicPixel, new Vector2((float) num9, (float) num10), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, width, height)), mapTileXnaColor, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } } } @@ -40788,7 +40810,7 @@ label_623: int num11 = x - index7 * Main.textureMaxWidth; int num12 = y - index8 * Main.textureMaxHeight; Microsoft.Xna.Framework.Color mapTileXnaColor = MapHelper.GetMapTileXnaColor(ref tile); - Main.spriteBatch.Draw(TextureAssets.MagicPixel.Value, new Vector2((float) num11, (float) num12), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 1, 1)), mapTileXnaColor, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.magicPixel, new Vector2((float) num11, (float) num12), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 1, 1)), mapTileXnaColor, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } } MapHelper.numUpdateTile = 0; @@ -40889,19 +40911,7 @@ label_623: return str; } - private static void UpdateMinimapAnchors() - { - int num1 = 240; - int num2 = 240; - Main._minimapTopRightAnchorOffsetTowardsLeft = 292; - Main._minimapTopRightAnchorOffsetTowardsBottom = 90; - Main._minimapTopRightAnchorOffsetTowardsLeft = (int) ((double) (52 + num1 / 2) + (double) Main.MapScale * (double) num1 / 2.0); - Main._minimapTopRightAnchorOffsetTowardsBottom = (int) ((double) (90 + num2 / 2) - (double) Main.MapScale * (double) num2 / 2.0); - Main._minimapTopRightAnchorOffsetTowardsLeft = 52 + (int) (240.0 * (double) Main.MapScale); - Main._minimapTopRightAnchorOffsetTowardsBottom = 90; - } - - protected void DrawMap(GameTime gameTime) + protected void DrawMap() { string cursorText = ""; if (!Main.mapEnabled || !Main.mapReady) @@ -40910,19 +40920,19 @@ label_623: float num2 = 0.0f; float num3 = num1; float num4 = num2; - byte alpha = byte.MaxValue; - int num5 = Main.maxTilesX / Main.textureMaxWidth; - int num6 = Main.maxTilesY / Main.textureMaxHeight; - float offScreenTiles1 = (float) Lighting.OffScreenTiles; - float offScreenTiles2 = (float) Lighting.OffScreenTiles; - float num7 = (float) (Main.maxTilesX - Lighting.OffScreenTiles - 1); - float num8 = (float) (Main.maxTilesY - Lighting.OffScreenTiles - 42); - float num9 = 0.0f; + byte num5 = byte.MaxValue; + int num6 = Main.maxTilesX / Main.textureMaxWidth; + int num7 = Main.maxTilesY / Main.textureMaxHeight; + float offScreenTiles1 = (float) Lighting.offScreenTiles; + float offScreenTiles2 = (float) Lighting.offScreenTiles; + float num8 = (float) (Main.maxTilesX - Lighting.offScreenTiles - 1); + float num9 = (float) (Main.maxTilesY - Lighting.offScreenTiles - 42); float num10 = 0.0f; - float num11 = 10f; + float num11 = 0.0f; float num12 = 10f; - float num13 = (float) (Main.maxTilesX - 10); - float num14 = (float) (Main.maxTilesY - 10); + float num13 = 10f; + float num14 = (float) (Main.maxTilesX - 10); + float num15 = (float) (Main.maxTilesY - 10); for (int index1 = 0; index1 < this.mapTarget.GetLength(0); ++index1) { for (int index2 = 0; index2 < this.mapTarget.GetLength(1); ++index2) @@ -40940,38 +40950,24 @@ label_623: } } } - float num15 = 200f; - float num16 = 300f; - float num17 = 0.0f; + float num16 = 200f; + float num17 = 300f; float num18 = 0.0f; - float num19 = num13 - 1f; + float num19 = 0.0f; float num20 = num14 - 1f; - float num21 = !Main.mapFullscreen ? (Main.mapStyle != 1 ? Main.mapOverlayScale : Main.mapMinimapScale) : Main.mapFullscreenScale; + float num21 = num15 - 1f; + float scale = !Main.mapFullscreen ? (Main.mapStyle != 1 ? Main.mapOverlayScale : Main.mapMinimapScale) : Main.mapFullscreenScale; bool flag1 = false; - float mapScale = Main.MapScale; - float num22 = 1f / mapScale; - int mouseX = Main.mouseX; - int mouseY = Main.mouseY; - Matrix uiScaleMatrix = Main.UIScaleMatrix; - Matrix transformMatrix1 = uiScaleMatrix; - Matrix transformMatrix2 = uiScaleMatrix; - Matrix scale = Matrix.CreateScale(mapScale); - int index3 = -1; + Matrix transformMatrix = Main.UIScaleMatrix; if (Main.mapStyle != 1) - transformMatrix1 = Matrix.Identity; + transformMatrix = Matrix.Identity; if (Main.mapFullscreen) - transformMatrix1 = Matrix.Identity; - if (!Main.mapFullscreen && Main.mapStyle == 1) - { - transformMatrix1 *= scale; - transformMatrix2 *= scale; - } - if (!Main.mapFullscreen) + transformMatrix = Matrix.Identity; + if (!Main.mapFullscreen && (double) scale > 1.0) { Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, transformMatrix1); - if ((double) num21 > 1.0) - flag1 = true; + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, transformMatrix); + flag1 = true; } if (Main.mapFullscreen) { @@ -40984,95 +40980,95 @@ label_623: } else { - float num23 = (float) Main.mouseX - Main.grabMapX; - float num24 = (float) Main.mouseY - Main.grabMapY; + float num22 = (float) Main.mouseX - Main.grabMapX; + float num23 = (float) Main.mouseY - Main.grabMapY; Main.grabMapX = (float) Main.mouseX; Main.grabMapY = (float) Main.mouseY; + float num24 = num22 * 0.06255f; float num25 = num23 * 0.06255f; - float num26 = num24 * 0.06255f; - Main.mapFullscreenPos.X -= num25 * (16f / Main.mapFullscreenScale); - Main.mapFullscreenPos.Y -= num26 * (16f / Main.mapFullscreenScale); + Main.mapFullscreenPos.X -= num24 * (16f / Main.mapFullscreenScale); + Main.mapFullscreenPos.Y -= num25 * (16f / Main.mapFullscreenScale); } } Main.player[Main.myPlayer].mouseInterface = true; - float num27 = (float) ((double) Main.screenWidth / (double) Main.maxTilesX * 0.598999977111816); - if ((double) Main.mapFullscreenScale < (double) num27) - Main.mapFullscreenScale = num27; - if ((double) Main.mapFullscreenScale > 31.2000007629395) - Main.mapFullscreenScale = 31.18f; - num21 = Main.mapFullscreenScale; - alpha = byte.MaxValue; - if ((double) Main.mapFullscreenPos.X < (double) num11) - Main.mapFullscreenPos.X = num11; - if ((double) Main.mapFullscreenPos.X > (double) num13) - Main.mapFullscreenPos.X = num13; - if ((double) Main.mapFullscreenPos.Y < (double) num12) - Main.mapFullscreenPos.Y = num12; - if ((double) Main.mapFullscreenPos.Y > (double) num14) - Main.mapFullscreenPos.Y = num14; - float num28 = Main.mapFullscreenPos.X; - float num29 = Main.mapFullscreenPos.Y; + float num26 = (float) ((double) Main.screenWidth / (double) Main.maxTilesX * 0.800000011920929); + if ((double) Main.mapFullscreenScale < (double) num26) + Main.mapFullscreenScale = num26; + if ((double) Main.mapFullscreenScale > 16.0) + Main.mapFullscreenScale = 16f; + scale = Main.mapFullscreenScale; + num5 = byte.MaxValue; + if ((double) Main.mapFullscreenPos.X < (double) num12) + Main.mapFullscreenPos.X = num12; + if ((double) Main.mapFullscreenPos.X > (double) num14) + Main.mapFullscreenPos.X = num14; + if ((double) Main.mapFullscreenPos.Y < (double) num13) + Main.mapFullscreenPos.Y = num13; + if ((double) Main.mapFullscreenPos.Y > (double) num15) + Main.mapFullscreenPos.Y = num15; + float num27 = Main.mapFullscreenPos.X; + float num28 = Main.mapFullscreenPos.Y; if (Main.resetMapFull) { Main.resetMapFull = false; - num28 = (float) (((double) Main.screenPosition.X + (double) (Main.screenWidth / 2)) / 16.0); - num29 = (float) (((double) Main.screenPosition.Y + (double) (Main.screenHeight / 2)) / 16.0); - Main.mapFullscreenPos.X = num28; - Main.mapFullscreenPos.Y = num29; + num27 = (float) (((double) Main.screenPosition.X + (double) (Main.screenWidth / 2)) / 16.0); + num28 = (float) (((double) Main.screenPosition.Y + (double) (Main.screenHeight / 2)) / 16.0); + Main.mapFullscreenPos.X = num27; + Main.mapFullscreenPos.Y = num28; } - float num30 = num28 * num21; - float num31 = num29 * num21; - float num32 = -num30 + (float) (Main.screenWidth / 2); - float num33 = -num31 + (float) (Main.screenHeight / 2); - num15 = num32 + num11 * num21; - num16 = num33 + num12 * num21; - float num34 = (float) (Main.maxTilesX / 840) * Main.mapFullscreenScale; - float num35 = num15; - float num36 = num16; - float num37 = (float) TextureAssets.Map.Width(); - float num38 = (float) TextureAssets.Map.Height(); + float num29 = num27 * scale; + float num30 = num28 * scale; + float num31 = -num29 + (float) (Main.screenWidth / 2); + float num32 = -num30 + (float) (Main.screenHeight / 2); + num16 = num31 + num12 * scale; + num17 = num32 + num13 * scale; + float num33 = (float) (Main.maxTilesX / 840) * Main.mapFullscreenScale; + float num34 = num16; + float num35 = num17; + float num36 = (float) Main.mapTexture.Width; + float num37 = (float) Main.mapTexture.Height; switch (Main.maxTilesX) { case 4200: - float num39 = num34 * 0.998f; - num35 -= 37.3f * num39; - num36 -= 1.7f * num39; - num37 = (num37 - 16f) * num39; - num38 = (num38 - 8.31f) * num39; + float num38 = num33 * 0.998f; + num34 -= 37.3f * num38; + num35 -= 1.7f * num38; + num36 = (num36 - 16f) * num38; + num37 = (num37 - 8.31f) * num38; break; case 6300: - float num40 = num34 * 1.09f; - num35 -= 39.8f * num40; - num36 = num16 - 4.08f * num40; - num37 = (num37 - 26.69f) * num40; - num38 = (num38 - 6.92f) * num40; - if ((double) num40 < 1.2) + float num39 = num33 * 1.09f; + num34 -= 39.8f * num39; + num35 = num17 - 4.08f * num39; + num36 = (num36 - 26.69f) * num39; + num37 = (num37 - 6.92f) * num39; + if ((double) num39 < 1.2) { - num38 += 2f; + num37 += 2f; break; } break; case 6400: - float num41 = num34 * 1.09f; - num35 -= 38.8f * num41; - num36 = num16 - 3.85f * num41; - num37 = (num37 - 13.6f) * num41; - num38 = (num38 - 6.92f) * num41; - if ((double) num41 < 1.2) + float num40 = num33 * 1.09f; + num34 -= 38.8f * num40; + num35 = num17 - 3.85f * num40; + num36 = (num36 - 13.6f) * num40; + num37 = (num37 - 6.92f) * num40; + if ((double) num40 < 1.2) { - num38 += 2f; + num37 += 2f; break; } break; case 8400: - float num42 = num34 * 0.999f; - num35 -= 40.6f * num42; - num36 = num16 - 5f * num42; - num37 = (num37 - 8.045f) * num42; - num38 = (num38 + 0.12f) * num42; - if ((double) num42 < 1.2) + float num41 = num33 * 0.999f; + num34 -= 40.6f * num41; + num35 = num17 - 5f * num41; + num36 = (num36 - 8.045f) * num41; + num37 = (num37 + 0.12f) * num41; + if ((double) num41 < 1.2) { - ++num38; + ++num37; break; } break; @@ -41080,18 +41076,46 @@ label_623: Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise); flag1 = true; - Main.DrawMapFullscreenBackground(Main.screenPosition, Main.screenWidth, Main.screenHeight); - Microsoft.Xna.Framework.Rectangle destinationRectangle = new Microsoft.Xna.Framework.Rectangle((int) num35, (int) num36, (int) num37, (int) num38); - Main.spriteBatch.Draw(TextureAssets.Map.Value, destinationRectangle, Microsoft.Xna.Framework.Color.White); - if (Main.mouseLeft && Main.mouseLeftRelease) + if ((double) Main.screenPosition.Y > (double) ((Main.maxTilesY - 232) * 16)) + Main.spriteBatch.Draw(this.mapBG3Texture, new Microsoft.Xna.Framework.Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Microsoft.Xna.Framework.Color.White); + else if (Main.player[Main.myPlayer].ZoneDungeon) + Main.spriteBatch.Draw(this.mapBG5Texture, new Microsoft.Xna.Framework.Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Microsoft.Xna.Framework.Color.White); + else if (Main.tile[(int) ((double) Main.player[Main.myPlayer].Center.X / 16.0), (int) ((double) Main.player[Main.myPlayer].Center.Y / 16.0)].wall == (byte) 87) + Main.spriteBatch.Draw(this.mapBG14Texture, new Microsoft.Xna.Framework.Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Microsoft.Xna.Framework.Color.White); + else if ((double) Main.screenPosition.Y > Main.worldSurface * 16.0) { - double totalSeconds = gameTime.TotalGameTime.TotalSeconds; - if (totalSeconds - Main._lastPingMouseDownTime < 0.5 && (double) Vector2.Distance(Main.MouseScreen, Main._lastPingMousePosition) < 2.0) - Main.TriggerPing((Main.MouseScreen - new Vector2(num15 - 10f * num21, num16 - 10f * num21)) / num21); - Main._lastPingMouseDownTime = totalSeconds; - Main._lastPingMousePosition = Main.MouseScreen; + if (Main.player[Main.myPlayer].ZoneSnow) + Main.spriteBatch.Draw(this.mapBG4Texture, new Microsoft.Xna.Framework.Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Microsoft.Xna.Framework.Color.White); + else if (Main.player[Main.myPlayer].ZoneJungle) + Main.spriteBatch.Draw(this.mapBG13Texture, new Microsoft.Xna.Framework.Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Main.bgColor); + else if (Main.sandTiles > 1000) + Main.spriteBatch.Draw(this.mapBG15Texture, new Microsoft.Xna.Framework.Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Main.bgColor); + else + Main.spriteBatch.Draw(this.mapBG2Texture, new Microsoft.Xna.Framework.Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Microsoft.Xna.Framework.Color.White); } - if ((double) num21 < 1.0) + else + { + int num42 = (int) (((double) Main.screenPosition.X + (double) (Main.screenWidth / 2)) / 16.0); + if (Main.player[Main.myPlayer].ZoneCorrupt) + Main.spriteBatch.Draw(this.mapBG6Texture, new Microsoft.Xna.Framework.Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Main.bgColor); + else if (Main.player[Main.myPlayer].ZoneCrimson) + Main.spriteBatch.Draw(this.mapBG7Texture, new Microsoft.Xna.Framework.Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Main.bgColor); + else if (Main.player[Main.myPlayer].ZoneHoly) + Main.spriteBatch.Draw(this.mapBG8Texture, new Microsoft.Xna.Framework.Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Main.bgColor); + else if ((double) Main.screenPosition.Y / 16.0 < Main.worldSurface + 10.0 && (num42 < 380 || num42 > Main.maxTilesX - 380)) + Main.spriteBatch.Draw(this.mapBG11Texture, new Microsoft.Xna.Framework.Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Main.bgColor); + else if (Main.player[Main.myPlayer].ZoneSnow) + Main.spriteBatch.Draw(this.mapBG12Texture, new Microsoft.Xna.Framework.Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Main.bgColor); + else if (Main.player[Main.myPlayer].ZoneJungle) + Main.spriteBatch.Draw(this.mapBG9Texture, new Microsoft.Xna.Framework.Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Main.bgColor); + else if (Main.sandTiles > 1000) + Main.spriteBatch.Draw(this.mapBG10Texture, new Microsoft.Xna.Framework.Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Main.bgColor); + else + Main.spriteBatch.Draw(this.mapBG1Texture, new Microsoft.Xna.Framework.Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Main.bgColor); + } + Microsoft.Xna.Framework.Rectangle destinationRectangle = new Microsoft.Xna.Framework.Rectangle((int) num34, (int) num35, (int) num36, (int) num37); + Main.spriteBatch.Draw(Main.mapTexture, destinationRectangle, Microsoft.Xna.Framework.Color.White); + if ((double) scale < 1.0) { Main.spriteBatch.End(); Main.spriteBatch.Begin(); @@ -41103,15 +41127,10 @@ label_623: switch (Main.mapStyle) { case 1: - Main.UpdateMinimapAnchors(); Main.miniMapWidth = 240; Main.miniMapHeight = 240; - Main.miniMapX = Main.screenWidth - Main._minimapTopRightAnchorOffsetTowardsLeft; - Main.miniMapY = Main._minimapTopRightAnchorOffsetTowardsBottom; - Main.miniMapX = (int) ((double) Main.miniMapX * (double) num22); - Main.miniMapY = (int) ((double) Main.miniMapY * (double) num22); - Main.mouseX = (int) ((double) Main.mouseX * (double) num22); - Main.mouseY = (int) ((double) Main.mouseY * (double) num22); + Main.miniMapX = Main.screenWidth - Main.miniMapWidth - 52; + Main.miniMapY = 90; double num43 = (double) Main.miniMapHeight / (double) Main.maxTilesY; if ((double) Main.mapMinimapScale < 0.2) Main.mapMinimapScale = 0.2f; @@ -41121,227 +41140,195 @@ label_623: Main.mapMinimapAlpha = 0.01f; if ((double) Main.mapMinimapAlpha > 1.0) Main.mapMinimapAlpha = 1f; - num21 = Main.mapMinimapScale; - alpha = (byte) ((double) byte.MaxValue * (double) Main.mapMinimapAlpha); - num15 = (float) Main.miniMapX; - num16 = (float) Main.miniMapY; - num3 = num15; - num4 = num16; + scale = Main.mapMinimapScale; + num5 = (byte) ((double) byte.MaxValue * (double) Main.mapMinimapAlpha); + num16 = (float) Main.miniMapX; + num17 = (float) Main.miniMapY; + num3 = num16; + num4 = num17; double num44 = ((double) Main.screenPosition.X + (double) (PlayerInput.RealScreenWidth / 2)) / 16.0; float num45 = (float) (((double) Main.screenPosition.Y + (double) (PlayerInput.RealScreenHeight / 2)) / 16.0); - num9 = (float) -(num44 - (double) (int) (((double) Main.screenPosition.X + (double) (PlayerInput.RealScreenWidth / 2)) / 16.0)) * num21; - num10 = (float) -((double) num45 - (double) (int) (((double) Main.screenPosition.Y + (double) (PlayerInput.RealScreenHeight / 2)) / 16.0)) * num21; - num19 = (float) Main.miniMapWidth / num21; - num20 = (float) Main.miniMapHeight / num21; - num17 = (float) (int) num44 - num19 / 2f; - num18 = (float) (int) num45 - num20 / 2f; - double num46 = (double) Main.maxTilesY + (double) num18; - float num47 = num3 - 6f; - float num48 = num4 - 6f; - Main.ActiveMinimapFrame.MinimapPosition = new Vector2(num47 + 10f, num48 + 10f); - Main.ActiveMinimapFrame.Update(); - Main.ActiveMinimapFrame.DrawBackground(Main.spriteBatch); + num10 = (float) -(num44 - (double) (int) (((double) Main.screenPosition.X + (double) (PlayerInput.RealScreenWidth / 2)) / 16.0)) * scale; + num11 = (float) -((double) num45 - (double) (int) (((double) Main.screenPosition.Y + (double) (PlayerInput.RealScreenHeight / 2)) / 16.0)) * scale; + num20 = (float) Main.miniMapWidth / scale; + num21 = (float) Main.miniMapHeight / scale; + num18 = (float) (int) num44 - num20 / 2f; + num19 = (float) (int) num45 - num21 / 2f; + double num46 = (double) Main.maxTilesY + (double) num19; + float x1 = num3 - 6f; + float y1 = num4 - 6f; + Main.spriteBatch.Draw(Main.miniMapFrame2Texture, new Vector2(x1, y1), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.miniMapFrame2Texture.Width, Main.miniMapFrame2Texture.Height)), new Microsoft.Xna.Framework.Color((int) num5, (int) num5, (int) num5, (int) num5), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); break; case 2: - float num49 = (float) Main.screenWidth / (float) Main.maxTilesX; - if ((double) Main.mapOverlayScale < (double) num49) - Main.mapOverlayScale = num49; - if ((double) Main.mapOverlayScale > 16.0 * (double) Main.GameViewMatrix.Zoom.X) - Main.mapOverlayScale = 16f * Main.GameViewMatrix.Zoom.X; + float num47 = (float) Main.screenWidth / (float) Main.maxTilesX; + if ((double) Main.mapOverlayScale < (double) num47) + Main.mapOverlayScale = num47; + if ((double) Main.mapOverlayScale > 16.0) + Main.mapOverlayScale = 16f; if ((double) Main.mapOverlayAlpha < 0.01) Main.mapOverlayAlpha = 0.01f; if ((double) Main.mapOverlayAlpha > 1.0) Main.mapOverlayAlpha = 1f; - num21 = Main.mapOverlayScale; - alpha = (byte) ((double) byte.MaxValue * (double) Main.mapOverlayAlpha); + scale = Main.mapOverlayScale; + num5 = (byte) ((double) byte.MaxValue * (double) Main.mapOverlayAlpha); int maxTilesX = Main.maxTilesX; int maxTilesY = Main.maxTilesY; - float num50 = (float) (((double) Main.screenPosition.X + (double) (Main.screenWidth / 2)) / 16.0); - double num51 = ((double) Main.screenPosition.Y + (double) (Main.screenHeight / 2)) / 16.0; - float num52 = num50 * num21; - double num53 = (double) num21; - double num54 = num51 * num53; - float num55 = -num52 + (float) (Main.screenWidth / 2); - float num56 = (float) -num54 + (float) (Main.screenHeight / 2); - num15 = num55 + num11 * num21; - num16 = num56 + num12 * num21; + float num48 = (float) (((double) Main.screenPosition.X + (double) (Main.screenWidth / 2)) / 16.0); + double num49 = ((double) Main.screenPosition.Y + (double) (Main.screenHeight / 2)) / 16.0; + float num50 = num48 * scale; + double num51 = (double) scale; + double num52 = num49 * num51; + float num53 = -num50 + (float) (Main.screenWidth / 2); + float num54 = (float) -num52 + (float) (Main.screenHeight / 2); + num16 = num53 + num12 * scale; + num17 = num54 + num13 * scale; break; } } if (Main.mapStyle == 1 && !Main.mapFullscreen) { - if ((double) num17 < (double) num11) - num15 -= (num17 - num11) * num21; if ((double) num18 < (double) num12) - num16 -= (num18 - num12) * num21; + num16 -= (num18 - num12) * scale; + if ((double) num19 < (double) num13) + num17 -= (num19 - num13) * scale; } - float num57 = num17 + num19; - float num58 = num18 + num20; - if ((double) num17 > (double) num11) - num11 = num17; + float num55 = num18 + num20; + float num56 = num19 + num21; if ((double) num18 > (double) num12) num12 = num18; - if ((double) num57 < (double) num13) - num13 = num57; - if ((double) num58 < (double) num14) - num14 = num58; - float num59 = (float) Main.textureMaxWidth * num21; - float num60 = (float) Main.textureMaxHeight * num21; - float num61 = num15; - float num62 = 0.0f; - for (int index4 = 0; index4 <= 4; ++index4) + if ((double) num19 > (double) num13) + num13 = num19; + if ((double) num55 < (double) num14) + num14 = num55; + if ((double) num56 < (double) num15) + num15 = num56; + float num57 = (float) Main.textureMaxWidth * scale; + float num58 = (float) Main.textureMaxHeight * scale; + float num59 = num16; + float num60 = 0.0f; + for (int index3 = 0; index3 <= 4; ++index3) { - if ((double) ((index4 + 1) * Main.textureMaxWidth) > (double) num11 && (double) (index4 * Main.textureMaxWidth) < (double) num11 + (double) num13) + if ((double) ((index3 + 1) * Main.textureMaxWidth) > (double) num12 && (double) (index3 * Main.textureMaxWidth) < (double) num12 + (double) num14) { - for (int index5 = 0; index5 <= num6; ++index5) + for (int index4 = 0; index4 <= num7; ++index4) { - if ((double) ((index5 + 1) * Main.textureMaxHeight) > (double) num12 && (double) (index5 * Main.textureMaxHeight) < (double) num12 + (double) num14) + if ((double) ((index4 + 1) * Main.textureMaxHeight) > (double) num13 && (double) (index4 * Main.textureMaxHeight) < (double) num13 + (double) num15) { - float num63 = num15 + (float) (int) ((double) index4 * (double) num59); - float num64 = num16 + (float) (int) ((double) index5 * (double) num60); - float num65 = (float) (index4 * Main.textureMaxWidth); - float num66 = (float) (index5 * Main.textureMaxHeight); - float num67 = 0.0f; - float num68 = 0.0f; - float num69; - if ((double) num65 < (double) num11) + float num61 = num16 + (float) (int) ((double) index3 * (double) num57); + float num62 = num17 + (float) (int) ((double) index4 * (double) num58); + float num63 = (float) (index3 * Main.textureMaxWidth); + float num64 = (float) (index4 * Main.textureMaxHeight); + float num65 = 0.0f; + float num66 = 0.0f; + float num67; + if ((double) num63 < (double) num12) { - num67 = num11 - num65; - num69 = num15; + num65 = num12 - num63; + num67 = num16; } else - num69 = num63 - num11 * num21; - float num70; - if ((double) num66 < (double) num12) + num67 = num61 - num12 * scale; + float num68; + if ((double) num64 < (double) num13) { - num68 = num12 - num66; - num70 = num16; + num66 = num13 - num64; + num68 = num17; } else - num70 = num64 - num12 * num21; - float num71 = num61; + num68 = num62 - num13 * scale; + float num69 = num59; float textureMaxWidth = (float) Main.textureMaxWidth; float textureMaxHeight = (float) Main.textureMaxHeight; - float num72 = (float) ((index4 + 1) * Main.textureMaxWidth); - float num73 = (float) ((index5 + 1) * Main.textureMaxHeight); - if ((double) num72 >= (double) num13) - textureMaxWidth -= num72 - num13; - if ((double) num73 >= (double) num14) - textureMaxHeight -= num73 - num14; - float x = num71 + num9; - float y = num70 + num10; - if ((double) textureMaxWidth > (double) num67) - { - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle((int) num67, (int) num68, (int) textureMaxWidth - (int) num67, (int) textureMaxHeight - (int) num68); - Main.spriteBatch.Draw((Texture2D) this.mapTarget[index4, index5], new Vector2(x, y), new Microsoft.Xna.Framework.Rectangle?(rectangle), new Microsoft.Xna.Framework.Color((int) alpha, (int) alpha, (int) alpha, (int) alpha), 0.0f, new Vector2(), num21, SpriteEffects.None, 0.0f); - } - num62 = (float) ((int) textureMaxWidth - (int) num67) * num21; + float num70 = (float) ((index3 + 1) * Main.textureMaxWidth); + float num71 = (float) ((index4 + 1) * Main.textureMaxHeight); + if ((double) num70 >= (double) num14) + textureMaxWidth -= num70 - num14; + if ((double) num71 >= (double) num15) + textureMaxHeight -= num71 - num15; + float x2 = num69 + num10; + float y2 = num68 + num11; + if ((double) textureMaxWidth > (double) num65) + Main.spriteBatch.Draw((Texture2D) this.mapTarget[index3, index4], new Vector2(x2, y2), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle((int) num65, (int) num66, (int) textureMaxWidth - (int) num65, (int) textureMaxHeight - (int) num66)), new Microsoft.Xna.Framework.Color((int) num5, (int) num5, (int) num5, (int) num5), 0.0f, new Vector2(), scale, SpriteEffects.None, 0.0f); + num60 = (float) ((int) textureMaxWidth - (int) num65) * scale; } - if (index5 == num6) - num61 += num62; + if (index4 == num7) + num59 += num60; } } } if (flag1) { Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, transformMatrix1); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, transformMatrix); } if (!Main.mapFullscreen) { if (Main.mapStyle == 2) { - float num74 = (float) (((double) num21 * 0.200000002980232 * 2.0 + 1.0) / 3.0); - if ((double) num74 > 1.0) - num74 = 1f; - float num75 = num74 * Main.UIScale; - Main.MapIcons.Draw(Vector2.Zero, new Vector2(num15 - 10f * num21, num16 - 10f * num21), new Microsoft.Xna.Framework.Rectangle?(), num21, num75, ref cursorText); - CoinLossRevengeSystem.RevengeMarker revengeMarker = NPC.RevengeManager.DrawMapIcons(Main.spriteBatch, Vector2.Zero, new Vector2(num15 - 10f * num21, num16 - 10f * num21), new Microsoft.Xna.Framework.Rectangle?(), num21, num75, ref cursorText); - this.DrawMiscMapIcons(Main.spriteBatch, Vector2.Zero, new Vector2(num15 - 10f * num21, num16 - 10f * num21), new Microsoft.Xna.Framework.Rectangle?(), num21, num75, ref cursorText); - Main.spriteBatch.End(); - if (revengeMarker != null) + float num72 = (float) (((double) scale * 0.200000002980232 * 2.0 + 1.0) / 3.0); + if ((double) num72 > 1.0) + num72 = 1f; + float num73 = num72 * Main.UIScale; + for (int index5 = 0; index5 < 200; ++index5) { - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, uiScaleMatrix); - try + if (Main.npc[index5].active && Main.npc[index5].townNPC) { - revengeMarker.UseMouseOver(Main.spriteBatch, ref cursorText, num75); - } - catch (Exception ex) - { - TimeLogger.DrawException(ex); - } - Main.spriteBatch.End(); - } - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, transformMatrix1); - try - { - for (int index6 = 0; index6 < 200; ++index6) - { - if (Main.npc[index6].active && Main.npc[index6].townNPC) + int headIndex = NPC.TypeToHeadIndex(Main.npc[index5].type); + if (headIndex > 0) { - ITownNPCProfile profile; - int npcID = !TownNPCProfiles.Instance.GetProfile(Main.npc[index6].type, out profile) ? NPC.TypeToDefaultHeadIndex(Main.npc[index6].type) : profile.GetHeadTextureIndex(Main.npc[index6]); - if (npcID > 0) - { - SpriteEffects dir = SpriteEffects.None; - if (Main.npc[index6].direction > 0) - dir = SpriteEffects.FlipHorizontally; - float num76 = (float) (((double) Main.npc[index6].position.X + (double) (Main.npc[index6].width / 2)) / 16.0) * num21; - float num77 = (float) (((double) Main.npc[index6].position.Y + (double) (Main.npc[index6].height / 2)) / 16.0) * num21; - float num78 = num76 + num15; - float num79 = num77 + num16; - float x = num78 - 10f * num21; - float y = num79 - 10f * num21; - Main.DrawNPCHeadFriendly((Entity) Main.npc[index6], alpha, num75, dir, npcID, x, y); - } - } - if (Main.npc[index6].active && Main.npc[index6].GetBossHeadTextureIndex() != -1) - { - float bossHeadRotation = Main.npc[index6].GetBossHeadRotation(); - SpriteEffects headSpriteEffects = Main.npc[index6].GetBossHeadSpriteEffects(); - Vector2 vector2 = Main.npc[index6].Center + new Vector2(0.0f, Main.npc[index6].gfxOffY); - if (Main.npc[index6].type == 134) - { - Vector2 center = Main.npc[index6].Center; - int num80 = 1; - for (int index7 = (int) Main.npc[index6].ai[0]; num80 < 15 && Main.npc[index7].active && Main.npc[index7].type >= 134 && Main.npc[index7].type <= 136; index7 = (int) Main.npc[index7].ai[0]) - { - ++num80; - center += Main.npc[index7].Center; - } - vector2 = center / (float) num80; - } - int headTextureIndex = Main.npc[index6].GetBossHeadTextureIndex(); - float num81 = vector2.X / 16f * num21; - float num82 = vector2.Y / 16f * num21; - float num83 = num81 + num15; - float num84 = num82 + num16; - float x = num83 - 10f * num21; - float y = num84 - 10f * num21; - Main.DrawNPCHeadBoss((Entity) Main.npc[index6], alpha, num75, bossHeadRotation, headSpriteEffects, headTextureIndex, x, y); + SpriteEffects effects = SpriteEffects.None; + if (Main.npc[index5].direction > 0) + effects = SpriteEffects.FlipHorizontally; + float num74 = (float) (((double) Main.npc[index5].position.X + (double) (Main.npc[index5].width / 2)) / 16.0) * scale; + float num75 = (float) (((double) Main.npc[index5].position.Y + (double) (Main.npc[index5].height / 2)) / 16.0) * scale; + float num76 = num74 + num16; + float num77 = num75 + num17; + float x3 = num76 - 10f * scale; + float y3 = num77 - 10f * scale; + Main.spriteBatch.Draw(Main.npcHeadTexture[headIndex], new Vector2(x3, y3), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.npcHeadTexture[headIndex].Width, Main.npcHeadTexture[headIndex].Height)), new Microsoft.Xna.Framework.Color((int) num5, (int) num5, (int) num5, (int) num5), 0.0f, new Vector2((float) (Main.npcHeadTexture[headIndex].Width / 2), (float) (Main.npcHeadTexture[headIndex].Height / 2)), num73, effects, 0.0f); } } - } - catch (Exception ex) - { - TimeLogger.DrawException(ex); + if (Main.npc[index5].active && Main.npc[index5].GetBossHeadTextureIndex() != -1) + { + float bossHeadRotation = Main.npc[index5].GetBossHeadRotation(); + SpriteEffects headSpriteEffects = Main.npc[index5].GetBossHeadSpriteEffects(); + Vector2 vector2 = Main.npc[index5].Center + new Vector2(0.0f, Main.npc[index5].gfxOffY); + if (Main.npc[index5].type == 134) + { + Vector2 center = Main.npc[index5].Center; + int num78 = 1; + for (int index6 = (int) Main.npc[index5].ai[0]; num78 < 15 && Main.npc[index6].active && Main.npc[index6].type >= 134 && Main.npc[index6].type <= 136; index6 = (int) Main.npc[index6].ai[0]) + { + ++num78; + center += Main.npc[index6].Center; + } + vector2 = center / (float) num78; + } + int headTextureIndex = Main.npc[index5].GetBossHeadTextureIndex(); + float num79 = vector2.X / 16f * scale; + float num80 = vector2.Y / 16f * scale; + float num81 = num79 + num16; + float num82 = num80 + num17; + float x4 = num81 - 10f * scale; + float y4 = num82 - 10f * scale; + Main.spriteBatch.Draw(Main.npcHeadBossTexture[headTextureIndex], new Vector2(x4, y4), new Microsoft.Xna.Framework.Rectangle?(), new Microsoft.Xna.Framework.Color((int) num5, (int) num5, (int) num5, (int) num5), bossHeadRotation, Main.npcHeadBossTexture[headTextureIndex].Size() / 2f, num73, headSpriteEffects, 0.0f); + } } Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, transformMatrix1); - for (int index8 = 0; index8 < (int) byte.MaxValue; ++index8) + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, transformMatrix); + for (int index = 0; index < (int) byte.MaxValue; ++index) { - if (Main.player[index8].active && !Main.player[index8].dead && index8 != Main.myPlayer && (!Main.player[Main.myPlayer].hostile && !Main.player[index8].hostile || Main.player[Main.myPlayer].team == Main.player[index8].team && Main.player[index8].team != 0 || index8 == Main.myPlayer)) + if (Main.player[index].active && !Main.player[index].dead && index != Main.myPlayer && (!Main.player[Main.myPlayer].hostile && !Main.player[index].hostile || Main.player[Main.myPlayer].team == Main.player[index].team && Main.player[index].team != 0 || index == Main.myPlayer)) { - float num85 = (float) (((double) Main.player[index8].position.X + (double) (Main.player[index8].width / 2)) / 16.0) * num21; - float num86 = Main.player[index8].position.Y / 16f * num21; - float num87 = num85 + num15; - float num88 = num86 + num16; - float num89 = num87 - 6f; - float num90 = num88 - 2f - (float) (2.0 - (double) num21 / 5.0 * 2.0); - float x = num89 - 10f * num21; - float y = num90 - 10f * num21; - Microsoft.Xna.Framework.Color headBordersColor = Main.GetPlayerHeadBordersColor(Main.player[index8]); - Main.MapPlayerRenderer.DrawPlayerHead(Main.Camera, Main.player[index8], new Vector2(x, y), (float) alpha / (float) byte.MaxValue, num75, headBordersColor); + float num83 = (float) (((double) Main.player[index].position.X + (double) (Main.player[index].width / 2)) / 16.0) * scale; + float num84 = Main.player[index].position.Y / 16f * scale; + float num85 = num83 + num16; + float num86 = num84 + num17; + float num87 = num85 - 6f; + float num88 = num86 - 2f - (float) (2.0 - (double) scale / 5.0 * 2.0); + float X = num87 - 10f * scale; + float Y = num88 - 10f * scale; + this.DrawPlayerHead(Main.player[index], X, Y, (float) num5 / (float) byte.MaxValue, num73); } } Main.spriteBatch.End(); @@ -41349,245 +41336,268 @@ label_623: } if (Main.mapStyle == 1) { - float num91 = (float) (((double) num21 * 0.25 * 2.0 + 1.0) / 3.0); - if ((double) num91 > 1.0) - num91 = 1f; - Main.MapIcons.Draw(new Vector2(num17, num18), new Vector2(num3 + num9, num4 + num10), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(Main.miniMapX, Main.miniMapY, Main.miniMapWidth, Main.miniMapHeight)), num21, num91, ref cursorText); - CoinLossRevengeSystem.RevengeMarker revengeMarker = NPC.RevengeManager.DrawMapIcons(Main.spriteBatch, new Vector2(num17, num18), new Vector2(num3 + num9, num4 + num10), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(Main.miniMapX, Main.miniMapY, Main.miniMapWidth, Main.miniMapHeight)), num21, num91, ref cursorText); - this.DrawMiscMapIcons(Main.spriteBatch, new Vector2(num17, num18), new Vector2(num3 + num9, num4 + num10), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(Main.miniMapX, Main.miniMapY, Main.miniMapWidth, Main.miniMapHeight)), num21, num91, ref cursorText); - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, transformMatrix2); - for (int index9 = 0; index9 < 200; ++index9) + float x5 = num3 - 6f; + float y5 = num4 - 6f; + float num89 = (float) (((double) scale * 0.25 * 2.0 + 1.0) / 3.0); + if ((double) num89 > 1.0) + num89 = 1f; + for (int index7 = 0; index7 < 200; ++index7) { - if (Main.npc[index9].active && Main.npc[index9].townNPC) + if (Main.npc[index7].active && Main.npc[index7].townNPC) { - ITownNPCProfile profile; - int npcID = !TownNPCProfiles.Instance.GetProfile(Main.npc[index9].type, out profile) ? NPC.TypeToDefaultHeadIndex(Main.npc[index9].type) : profile.GetHeadTextureIndex(Main.npc[index9]); - if (npcID > 0) + int headIndex = NPC.TypeToHeadIndex(Main.npc[index7].type); + if (headIndex > 0) { - SpriteEffects dir = SpriteEffects.None; - if (Main.npc[index9].direction > 0) - dir = SpriteEffects.FlipHorizontally; - float num92 = ((float) (((double) Main.npc[index9].position.X + (double) Main.npc[index9].width / 2.0) / 16.0) - num17) * num21; - float num93 = ((float) (((double) Main.npc[index9].position.Y + (double) Main.npc[index9].gfxOffY + (double) Main.npc[index9].height / 2.0) / 16.0) - num18) * num21; - float num94 = num92 + num3; - float num95 = num93 + num4 - (float) (2.0 * (double) num21 / 5.0); - float x = num94 + num9; - float y = num95 + num10; - if ((double) x > (double) (Main.miniMapX + 12) && (double) x < (double) (Main.miniMapX + Main.miniMapWidth - 16) && (double) y > (double) (Main.miniMapY + 10) && (double) y < (double) (Main.miniMapY + Main.miniMapHeight - 14)) + SpriteEffects effects = SpriteEffects.None; + if (Main.npc[index7].direction > 0) + effects = SpriteEffects.FlipHorizontally; + float num90 = ((float) (((double) Main.npc[index7].position.X + (double) (Main.npc[index7].width / 2)) / 16.0) - num18) * scale; + float num91 = ((float) (((double) Main.npc[index7].position.Y + (double) Main.npc[index7].gfxOffY + (double) (Main.npc[index7].height / 2)) / 16.0) - num19) * scale; + float num92 = num90 + num3; + float num93 = num91 + num4 - (float) (2.0 * (double) scale / 5.0); + if ((double) num92 > (double) (Main.miniMapX + 12) && (double) num92 < (double) (Main.miniMapX + Main.miniMapWidth - 16) && (double) num93 > (double) (Main.miniMapY + 10) && (double) num93 < (double) (Main.miniMapY + Main.miniMapHeight - 14)) { - float num96 = x - (float) (TextureAssets.NpcHead[npcID].Width() / 2) * num91; - float num97 = y - (float) (TextureAssets.NpcHead[npcID].Height() / 2) * num91; - float num98 = num96 + (float) TextureAssets.NpcHead[npcID].Width() * num91; - float num99 = num97 + (float) TextureAssets.NpcHead[npcID].Height() * num91; - if ((double) Main.mouseX >= (double) num96 && (double) Main.mouseX <= (double) num98 && (double) Main.mouseY >= (double) num97 && (double) Main.mouseY <= (double) num99) - cursorText = Main.npc[index9].FullName; - Main.DrawNPCHeadFriendly((Entity) Main.npc[index9], alpha, num91, dir, npcID, x, y); + Main.spriteBatch.Draw(Main.npcHeadTexture[headIndex], new Vector2(num92 + num10, num93 + num11), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.npcHeadTexture[headIndex].Width, Main.npcHeadTexture[headIndex].Height)), new Microsoft.Xna.Framework.Color((int) num5, (int) num5, (int) num5, (int) num5), 0.0f, new Vector2((float) (Main.npcHeadTexture[headIndex].Width / 2), (float) (Main.npcHeadTexture[headIndex].Height / 2)), num89, effects, 0.0f); + float num94 = num92 - (float) (Main.npcHeadTexture[headIndex].Width / 2) * num89; + float num95 = num93 - (float) (Main.npcHeadTexture[headIndex].Height / 2) * num89; + float num96 = num94 + (float) Main.npcHeadTexture[headIndex].Width * num89; + float num97 = num95 + (float) Main.npcHeadTexture[headIndex].Height * num89; + if ((double) Main.mouseX >= (double) num94 && (double) Main.mouseX <= (double) num96 && (double) Main.mouseY >= (double) num95 && (double) Main.mouseY <= (double) num97) + cursorText = Main.npc[index7].FullName; } } } - if (Main.npc[index9].active && Main.npc[index9].GetBossHeadTextureIndex() != -1) + if (Main.npc[index7].active && Main.npc[index7].GetBossHeadTextureIndex() != -1) { - float bossHeadRotation = Main.npc[index9].GetBossHeadRotation(); - SpriteEffects headSpriteEffects = Main.npc[index9].GetBossHeadSpriteEffects(); - Vector2 vector2 = Main.npc[index9].Center + new Vector2(0.0f, Main.npc[index9].gfxOffY); - if (Main.npc[index9].type == 134) + float bossHeadRotation = Main.npc[index7].GetBossHeadRotation(); + SpriteEffects headSpriteEffects = Main.npc[index7].GetBossHeadSpriteEffects(); + Vector2 vector2 = Main.npc[index7].Center + new Vector2(0.0f, Main.npc[index7].gfxOffY); + if (Main.npc[index7].type == 134) { - Vector2 center = Main.npc[index9].Center; - int num100 = 1; - for (int index10 = (int) Main.npc[index9].ai[0]; num100 < 15 && Main.npc[index10].active && Main.npc[index10].type >= 134 && Main.npc[index10].type <= 136; index10 = (int) Main.npc[index10].ai[0]) + Vector2 center = Main.npc[index7].Center; + int num98 = 1; + for (int index8 = (int) Main.npc[index7].ai[0]; num98 < 15 && Main.npc[index8].active && Main.npc[index8].type >= 134 && Main.npc[index8].type <= 136; index8 = (int) Main.npc[index8].ai[0]) { - ++num100; - center += Main.npc[index10].Center; + ++num98; + center += Main.npc[index8].Center; } - vector2 = center / (float) num100; + vector2 = center / (float) num98; } - int headTextureIndex = Main.npc[index9].GetBossHeadTextureIndex(); - float num101 = (vector2.X / 16f - num17) * num21; - float num102 = (vector2.Y / 16f - num18) * num21; - float num103 = num101 + num3; - float num104 = num102 + num4 - (float) (2.0 * (double) num21 / 5.0); - float x = num103 + num9; - float y = num104 + num10; - if ((double) x > (double) (Main.miniMapX + 12) && (double) x < (double) (Main.miniMapX + Main.miniMapWidth - 16) && (double) y > (double) (Main.miniMapY + 10) && (double) y < (double) (Main.miniMapY + Main.miniMapHeight - 14)) + int headTextureIndex = Main.npc[index7].GetBossHeadTextureIndex(); + float num99 = (vector2.X / 16f - num18) * scale; + float num100 = (vector2.Y / 16f - num19) * scale; + float num101 = num99 + num3; + float num102 = num100 + num4 - (float) (2.0 * (double) scale / 5.0); + if ((double) num101 > (double) (Main.miniMapX + 12) && (double) num101 < (double) (Main.miniMapX + Main.miniMapWidth - 16) && (double) num102 > (double) (Main.miniMapY + 10) && (double) num102 < (double) (Main.miniMapY + Main.miniMapHeight - 14)) { - float num105 = x - (float) (TextureAssets.NpcHeadBoss[headTextureIndex].Width() / 2) * num91; - float num106 = y - (float) (TextureAssets.NpcHeadBoss[headTextureIndex].Height() / 2) * num91; - float num107 = num105 + (float) TextureAssets.NpcHeadBoss[headTextureIndex].Width() * num91; - float num108 = num106 + (float) TextureAssets.NpcHeadBoss[headTextureIndex].Height() * num91; - if ((double) Main.mouseX >= (double) num105 && (double) Main.mouseX <= (double) num107 && (double) Main.mouseY >= (double) num106 && (double) Main.mouseY <= (double) num108) - cursorText = Main.npc[index9].GivenOrTypeName; - Main.DrawNPCHeadBoss((Entity) Main.npc[index9], alpha, num91, bossHeadRotation, headSpriteEffects, headTextureIndex, x, y); + Main.spriteBatch.Draw(Main.npcHeadBossTexture[headTextureIndex], new Vector2(num101 + num10, num102 + num11), new Microsoft.Xna.Framework.Rectangle?(), new Microsoft.Xna.Framework.Color((int) num5, (int) num5, (int) num5, (int) num5), bossHeadRotation, Main.npcHeadBossTexture[headTextureIndex].Size() / 2f, num89, headSpriteEffects, 0.0f); + float num103 = num101 - (float) (Main.npcHeadBossTexture[headTextureIndex].Width / 2) * num89; + float num104 = num102 - (float) (Main.npcHeadBossTexture[headTextureIndex].Height / 2) * num89; + float num105 = num103 + (float) Main.npcHeadBossTexture[headTextureIndex].Width * num89; + float num106 = num104 + (float) Main.npcHeadBossTexture[headTextureIndex].Height * num89; + if ((double) Main.mouseX >= (double) num103 && (double) Main.mouseX <= (double) num105 && (double) Main.mouseY >= (double) num104 && (double) Main.mouseY <= (double) num106) + cursorText = Main.npc[index7].GivenOrTypeName; } } } Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, transformMatrix2); - for (int index11 = 0; index11 < (int) byte.MaxValue; ++index11) + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, Main.UIScaleMatrix); + for (int index = 0; index < (int) byte.MaxValue; ++index) { - if (Main.player[index11].active && (!Main.player[Main.myPlayer].hostile && !Main.player[index11].hostile || Main.player[Main.myPlayer].team == Main.player[index11].team && Main.player[index11].team != 0 || index11 == Main.myPlayer)) + if (Main.player[index].active && (!Main.player[Main.myPlayer].hostile && !Main.player[index].hostile || Main.player[Main.myPlayer].team == Main.player[index].team && Main.player[index].team != 0 || index == Main.myPlayer)) { - float num109 = ((float) (((double) Main.player[index11].position.X + (double) (Main.player[index11].width / 2)) / 16.0) - num17) * num21; - float num110 = ((float) (((double) Main.player[index11].position.Y + (double) Main.player[index11].gfxOffY + (double) (Main.player[index11].height / 2)) / 16.0) - num18) * num21; - float num111 = num109 + num3; - float num112 = num110 + num4; - float num113 = num111 - 6f; - float num114 = num112 - 6f - (float) (2.0 - (double) num21 / 5.0 * 2.0); - float x1 = num113 + num9; - float y1 = num114 + num10; - if (!Main.player[index11].dead && (double) x1 > (double) (Main.miniMapX + 6) && (double) x1 < (double) (Main.miniMapX + Main.miniMapWidth - 16) && (double) y1 > (double) (Main.miniMapY + 6) && (double) y1 < (double) (Main.miniMapY + Main.miniMapHeight - 14)) + float num107 = ((float) (((double) Main.player[index].position.X + (double) (Main.player[index].width / 2)) / 16.0) - num18) * scale; + float num108 = ((float) (((double) Main.player[index].position.Y + (double) Main.player[index].gfxOffY + (double) (Main.player[index].height / 2)) / 16.0) - num19) * scale; + float num109 = num107 + num3; + float num110 = num108 + num4; + float num111 = num109 - 6f; + float num112 = num110 - 6f - (float) (2.0 - (double) scale / 5.0 * 2.0); + float X = num111 + num10; + float Y = num112 + num11; + if ((double) Main.screenPosition.X != (double) Main.leftWorld + 640.0 + 16.0 && (double) Main.screenPosition.X + (double) Main.screenWidth != (double) Main.rightWorld - 640.0 - 32.0 && (double) Main.screenPosition.Y != (double) Main.topWorld + 640.0 + 16.0 && (double) Main.screenPosition.Y + (double) Main.screenHeight <= (double) Main.bottomWorld - 640.0 - 32.0 && index == Main.myPlayer && (double) Main.zoomX == 0.0 && (double) Main.zoomY == 0.0) { - Microsoft.Xna.Framework.Color headBordersColor = Main.GetPlayerHeadBordersColor(Main.player[index11]); - Main.MapPlayerRenderer.DrawPlayerHead(Main.Camera, Main.player[index11], new Vector2(x1, y1), (float) alpha / (float) byte.MaxValue, num91, headBordersColor); - if (index11 != Main.myPlayer) + float num113 = num3 + (float) (Main.miniMapWidth / 2); + Y = num4 + (float) (Main.miniMapHeight / 2) - 3f; + X = num113 - 4f; + } + if (!Main.player[index].dead && (double) X > (double) (Main.miniMapX + 6) && (double) X < (double) (Main.miniMapX + Main.miniMapWidth - 16) && (double) Y > (double) (Main.miniMapY + 6) && (double) Y < (double) (Main.miniMapY + Main.miniMapHeight - 14)) + { + this.DrawPlayerHead(Main.player[index], X, Y, (float) num5 / (float) byte.MaxValue, num89); + if (index != Main.myPlayer) { - float num115 = (float) ((double) x1 + 4.0 - 14.0 * (double) num91); - float num116 = (float) ((double) y1 + 2.0 - 14.0 * (double) num91); - float num117 = num115 + 28f * num91; - float num118 = num116 + 28f * num91; - if ((double) Main.mouseX >= (double) num115 && (double) Main.mouseX <= (double) num117 && (double) Main.mouseY >= (double) num116 && (double) Main.mouseY <= (double) num118) - cursorText = Main.player[index11].name; + float num114 = (float) ((double) X + 4.0 - 14.0 * (double) num89); + float num115 = (float) ((double) Y + 2.0 - 14.0 * (double) num89); + float num116 = num114 + 28f * num89; + float num117 = num115 + 28f * num89; + if ((double) Main.mouseX >= (double) num114 && (double) Main.mouseX <= (double) num116 && (double) Main.mouseY >= (double) num115 && (double) Main.mouseY <= (double) num117) + cursorText = Main.player[index].name; } } - if (Main.player[index11].showLastDeath) + if (Main.player[index].showLastDeath) { - float num119 = (Main.player[index11].lastDeathPostion.X / 16f - num17) * num21; - float num120 = (Main.player[index11].lastDeathPostion.Y / 16f - num18) * num21; - float num121 = num119 + num3; - float num122 = num120 + num4 - (float) (2.0 - (double) num21 / 5.0 * 2.0); - float x2 = num121 + num9; - float y2 = num122 + num10; - if ((double) x2 > (double) (Main.miniMapX + 8) && (double) x2 < (double) (Main.miniMapX + Main.miniMapWidth - 18) && (double) y2 > (double) (Main.miniMapY + 8) && (double) y2 < (double) (Main.miniMapY + Main.miniMapHeight - 16)) + float num118 = (Main.player[index].lastDeathPostion.X / 16f - num18) * scale; + float num119 = (Main.player[index].lastDeathPostion.Y / 16f - num19) * scale; + float num120 = num118 + num3; + float num121 = num119 + num4 - (float) (2.0 - (double) scale / 5.0 * 2.0); + float x6 = num120 + num10; + float y6 = num121 + num11; + if ((double) x6 > (double) (Main.miniMapX + 8) && (double) x6 < (double) (Main.miniMapX + Main.miniMapWidth - 18) && (double) y6 > (double) (Main.miniMapY + 8) && (double) y6 < (double) (Main.miniMapY + Main.miniMapHeight - 16)) { - Main.spriteBatch.Draw(TextureAssets.MapDeath.Value, new Vector2(x2, y2), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.MapDeath.Width(), TextureAssets.MapDeath.Height())), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2((float) TextureAssets.MapDeath.Width() * 0.5f, (float) TextureAssets.MapDeath.Height() * 0.5f), num91, SpriteEffects.None, 0.0f); - float num123 = (float) ((double) x2 + 4.0 - 14.0 * (double) num91); - float num124 = (float) ((double) y2 + 2.0 - 14.0 * (double) num91); + Main.spriteBatch.Draw(this.mapDeathTexture, new Vector2(x6, y6), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, this.mapDeathTexture.Width, this.mapDeathTexture.Height)), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2((float) this.mapDeathTexture.Width * 0.5f, (float) this.mapDeathTexture.Height * 0.5f), num89, SpriteEffects.None, 0.0f); + float num122 = (float) ((double) x6 + 4.0 - 14.0 * (double) num89); + float num123 = (float) ((double) y6 + 2.0 - 14.0 * (double) num89); + float num124 = num122 - 4f; float num125 = num123 - 4f; - float num126 = num124 - 4f; - float num127 = num125 + 28f * num91; - float num128 = num126 + 28f * num91; - if ((double) Main.mouseX >= (double) num125 && (double) Main.mouseX <= (double) num127 && (double) Main.mouseY >= (double) num126 && (double) Main.mouseY <= (double) num128) - index3 = index11; + float num126 = num124 + 28f * num89; + float num127 = num125 + 28f * num89; + if ((double) Main.mouseX >= (double) num124 && (double) Main.mouseX <= (double) num126 && (double) Main.mouseY >= (double) num125 && (double) Main.mouseY <= (double) num127) + { + TimeSpan time = DateTime.Now - Main.player[index].lastDeathTime; + cursorText = Language.GetTextValue("Game.PlayerDeathTime", (object) Main.player[index].name, (object) Lang.LocalizedDuration(time, false, false)); + } } } } } Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, transformMatrix2); - Main.ActiveMinimapFrame.DrawForeground(Main.spriteBatch); - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, uiScaleMatrix); - if (index3 != -1) + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, Main.UIScaleMatrix); + Main.spriteBatch.Draw(Main.miniMapFrameTexture, new Vector2(x5, y5), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.miniMapFrameTexture.Width, Main.miniMapFrameTexture.Height)), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + for (int index = 0; index < 3; ++index) { - TimeSpan time = DateTime.Now - Main.player[index3].lastDeathTime; - cursorText = Language.GetTextValue("Game.PlayerDeathTime", (object) Main.player[index3].name, (object) Lang.LocalizedDuration(time, false, false)); + float x7 = x5 + 148f + (float) (index * 26); + float y7 = y5 + 234f; + if ((double) Main.mouseX > (double) x7 && (double) Main.mouseX < (double) x7 + 22.0 && (double) Main.mouseY > (double) y7 && (double) Main.mouseY < (double) y7 + 22.0) + { + Main.spriteBatch.Draw(Main.miniMapButtonTexture[index], new Vector2(x7, y7), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.miniMapButtonTexture[index].Width, Main.miniMapButtonTexture[index].Height)), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + if (!PlayerInput.IgnoreMouseInterface) + { + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.mouseLeft) + { + if (Main.mouseLeftRelease) + Main.PlaySound(12); + switch (index) + { + case 0: + Main.mapMinimapScale = 1.25f; + continue; + case 1: + Main.mapMinimapScale *= 0.975f; + continue; + case 2: + Main.mapMinimapScale *= 1.025f; + continue; + default: + continue; + } + } + } + } } - else - revengeMarker?.UseMouseOver(Main.spriteBatch, ref cursorText); } } if (Main.mapFullscreen) { - int x3 = (int) ((-(double) num15 + (double) Main.mouseX) / (double) num21 + (double) num11); - int y3 = (int) ((-(double) num16 + (double) Main.mouseY) / (double) num21 + (double) num12); + int x8 = (int) ((-(double) num16 + (double) Main.mouseX) / (double) scale + (double) num12); + int y8 = (int) ((-(double) num17 + (double) Main.mouseY) / (double) scale + (double) num13); bool flag2 = false; - if ((double) x3 < (double) num11) + if ((double) x8 < (double) num12) flag2 = true; - if ((double) x3 >= (double) num13) + if ((double) x8 >= (double) num14) flag2 = true; - if ((double) y3 < (double) num12) + if ((double) y8 < (double) num13) flag2 = true; - if ((double) y3 >= (double) num14) + if ((double) y8 >= (double) num15) flag2 = true; - if (!flag2 && Main.Map[x3, y3].Light > (byte) 40) + if (!flag2 && Main.Map[x8, y8].Light > (byte) 40) { - int type = (int) Main.Map[x3, y3].Type; - int num129 = (int) MapHelper.tileLookup[21]; - int num130 = (int) MapHelper.tileLookup[441]; + int type = (int) Main.Map[x8, y8].Type; + int num128 = (int) MapHelper.tileLookup[21]; + int num129 = (int) MapHelper.tileLookup[441]; int tileOptionCount1 = MapHelper.tileOptionCounts[21]; - int num131 = (int) MapHelper.tileLookup[467]; - int num132 = (int) MapHelper.tileLookup[468]; + int num130 = (int) MapHelper.tileLookup[467]; + int num131 = (int) MapHelper.tileLookup[468]; int tileOptionCount2 = MapHelper.tileOptionCounts[467]; - int num133 = (int) MapHelper.tileLookup[88]; + int num132 = (int) MapHelper.tileLookup[88]; int tileOptionCount3 = MapHelper.tileOptionCounts[88]; LocalizedText[] chestType = Lang.chestType; LocalizedText[] chestType2 = Lang.chestType2; - if (type >= num129 && type < num129 + tileOptionCount1) + if (type >= num128 && type < num128 + tileOptionCount1) { - Tile chestTile = Main.tile[x3, y3]; + Tile chestTile = Main.tile[x8, y8]; if (chestTile != null) { - int x4 = x3; - int y4 = y3; + int x9 = x8; + int y9 = y8; if ((int) chestTile.frameX % 36 != 0) - --x4; + --x9; if ((int) chestTile.frameY % 36 != 0) - --y4; - cursorText = Main.DrawMap_FindChestName(chestType, chestTile, x4, y4); + --y9; + cursorText = Main.DrawMap_FindChestName(chestType, chestTile, x9, y9); } } - else if (type >= num131 && type < num131 + tileOptionCount2) + else if (type >= num130 && type < num130 + tileOptionCount2) { - Tile chestTile = Main.tile[x3, y3]; + Tile chestTile = Main.tile[x8, y8]; if (chestTile != null) { - int x5 = x3; - int y5 = y3; + int x10 = x8; + int y10 = y8; if ((int) chestTile.frameX % 36 != 0) - --x5; + --x10; if ((int) chestTile.frameY % 36 != 0) - --y5; - cursorText = Main.DrawMap_FindChestName(chestType2, chestTile, x5, y5); + --y10; + cursorText = Main.DrawMap_FindChestName(chestType2, chestTile, x10, y10); } } - else if (type >= num130 && type < num130 + tileOptionCount1) + else if (type >= num129 && type < num129 + tileOptionCount1) { - Tile tile = Main.tile[x3, y3]; + Tile tile = Main.tile[x8, y8]; if (tile != null) { - int num134 = x3; - int num135 = y3; + int num133 = x8; + int num134 = y8; if ((int) tile.frameX % 36 != 0) { - int num136 = num134 - 1; + int num135 = num133 - 1; } if ((int) tile.frameY % 36 != 0) { - int num137 = num135 - 1; + int num136 = num134 - 1; } cursorText = chestType[(int) tile.frameX / 36].Value; } } - else if (type >= num132 && type < num132 + tileOptionCount2) + else if (type >= num131 && type < num131 + tileOptionCount2) { - Tile tile = Main.tile[x3, y3]; + Tile tile = Main.tile[x8, y8]; if (tile != null) { - int num138 = x3; - int num139 = y3; + int num137 = x8; + int num138 = y8; if ((int) tile.frameX % 36 != 0) { - int num140 = num138 - 1; + int num139 = num137 - 1; } if ((int) tile.frameY % 36 != 0) { - int num141 = num139 - 1; + int num140 = num138 - 1; } cursorText = chestType2[(int) tile.frameX / 36].Value; } } - else if (type >= num133 && type < num133 + tileOptionCount3) + else if (type >= num132 && type < num132 + tileOptionCount3) { - Tile tile = Main.tile[x3, y3]; + Tile tile = Main.tile[x8, y8]; if (tile != null) { - int num142 = x3; - int num143 = y3; - int num144 = (int) tile.frameX % 54 / 18; - int X = num142 - num144; + int num141 = x8; + int num142 = y8; + int num143 = (int) tile.frameX % 54 / 18; + int X = num141 - num143; if ((int) tile.frameY % 36 != 0) - --num143; - int Y = num143; + --num142; + int Y = num142; int chest = Chest.FindChest(X, Y); cursorText = chest >= 0 ? (!(Main.chest[chest].name != "") ? Lang.dresserType[(int) tile.frameX / 54].Value : Lang.dresserType[(int) tile.frameX / 54].Value + ": " + Main.chest[chest].name) : Lang.dresserType[0].Value; } @@ -41595,131 +41605,128 @@ label_623: else cursorText = Lang.GetMapObjectName(type); } - float num145; - if (((double) num21 * 0.25 * 2.0 + 1.0) / 3.0 > 1.0) - num145 = 1f; - num145 = 1f; + float num144; + if (((double) scale * 0.25 * 2.0 + 1.0) / 3.0 > 1.0) + num144 = 1f; + num144 = 1f; float uiScale = Main.UIScale; - CoinLossRevengeSystem.RevengeMarker revengeMarker = NPC.RevengeManager.DrawMapIcons(Main.spriteBatch, Vector2.Zero, new Vector2(num15 - 10f * num21, num16 - 10f * num21), new Microsoft.Xna.Framework.Rectangle?(), num21, uiScale, ref cursorText); - this.DrawMiscMapIcons(Main.spriteBatch, Vector2.Zero, new Vector2(num15 - 10f * num21, num16 - 10f * num21), new Microsoft.Xna.Framework.Rectangle?(), num21, uiScale, ref cursorText); - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); - for (int index12 = 0; index12 < 200; ++index12) + for (int index9 = 0; index9 < 200; ++index9) { - if (Main.npc[index12].active && Main.npc[index12].townNPC) + if (Main.npc[index9].active && Main.npc[index9].townNPC) { - ITownNPCProfile profile; - int npcID = !TownNPCProfiles.Instance.GetProfile(Main.npc[index12].type, out profile) ? NPC.TypeToDefaultHeadIndex(Main.npc[index12].type) : profile.GetHeadTextureIndex(Main.npc[index12]); - if (npcID > 0) + int headIndex = NPC.TypeToHeadIndex(Main.npc[index9].type); + if (headIndex > 0) { - SpriteEffects dir = SpriteEffects.None; - if (Main.npc[index12].direction > 0) - dir = SpriteEffects.FlipHorizontally; - float num146 = (float) (((double) Main.npc[index12].position.X + (double) (Main.npc[index12].width / 2)) / 16.0) * num21; - float num147 = (float) (((double) Main.npc[index12].position.Y + (double) Main.npc[index12].gfxOffY + (double) (Main.npc[index12].height / 2)) / 16.0) * num21; - float num148 = num146 + num15; - float num149 = num147 + num16; - float x6 = num148 - 10f * num21; - float y6 = num149 - 10f * num21; - float num150 = x6 - (float) (TextureAssets.NpcHead[npcID].Width() / 2) * uiScale; - float num151 = y6 - (float) (TextureAssets.NpcHead[npcID].Height() / 2) * uiScale; - float num152 = num150 + (float) TextureAssets.NpcHead[npcID].Width() * uiScale; - float num153 = num151 + (float) TextureAssets.NpcHead[npcID].Height() * uiScale; - if ((double) Main.mouseX >= (double) num150 && (double) Main.mouseX <= (double) num152 && (double) Main.mouseY >= (double) num151 && (double) Main.mouseY <= (double) num153) - cursorText = Main.npc[index12].FullName; - Main.DrawNPCHeadFriendly((Entity) Main.npc[index12], alpha, uiScale, dir, npcID, x6, y6); + SpriteEffects effects = SpriteEffects.None; + if (Main.npc[index9].direction > 0) + effects = SpriteEffects.FlipHorizontally; + float num145 = (float) (((double) Main.npc[index9].position.X + (double) (Main.npc[index9].width / 2)) / 16.0) * scale; + float num146 = (float) (((double) Main.npc[index9].position.Y + (double) Main.npc[index9].gfxOffY + (double) (Main.npc[index9].height / 2)) / 16.0) * scale; + float num147 = num145 + num16; + float num148 = num146 + num17; + float x11 = num147 - 10f * scale; + float y11 = num148 - 10f * scale; + Main.spriteBatch.Draw(Main.npcHeadTexture[headIndex], new Vector2(x11, y11), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.npcHeadTexture[headIndex].Width, Main.npcHeadTexture[headIndex].Height)), new Microsoft.Xna.Framework.Color((int) num5, (int) num5, (int) num5, (int) num5), 0.0f, new Vector2((float) (Main.npcHeadTexture[headIndex].Width / 2), (float) (Main.npcHeadTexture[headIndex].Height / 2)), uiScale, effects, 0.0f); + float num149 = x11 - (float) (Main.npcHeadTexture[headIndex].Width / 2) * uiScale; + float num150 = y11 - (float) (Main.npcHeadTexture[headIndex].Height / 2) * uiScale; + float num151 = num149 + (float) Main.npcHeadTexture[headIndex].Width * uiScale; + float num152 = num150 + (float) Main.npcHeadTexture[headIndex].Height * uiScale; + if ((double) Main.mouseX >= (double) num149 && (double) Main.mouseX <= (double) num151 && (double) Main.mouseY >= (double) num150 && (double) Main.mouseY <= (double) num152) + cursorText = Main.npc[index9].FullName; } } - if (Main.npc[index12].active && Main.npc[index12].GetBossHeadTextureIndex() != -1) + if (Main.npc[index9].active && Main.npc[index9].GetBossHeadTextureIndex() != -1) { - float bossHeadRotation = Main.npc[index12].GetBossHeadRotation(); - SpriteEffects headSpriteEffects = Main.npc[index12].GetBossHeadSpriteEffects(); - Vector2 vector2 = Main.npc[index12].Center + new Vector2(0.0f, Main.npc[index12].gfxOffY); - if (Main.npc[index12].type == 134) + float bossHeadRotation = Main.npc[index9].GetBossHeadRotation(); + SpriteEffects headSpriteEffects = Main.npc[index9].GetBossHeadSpriteEffects(); + Vector2 vector2 = Main.npc[index9].Center + new Vector2(0.0f, Main.npc[index9].gfxOffY); + if (Main.npc[index9].type == 134) { - Vector2 center = Main.npc[index12].Center; - int num154 = 1; - for (int index13 = (int) Main.npc[index12].ai[0]; num154 < 15 && Main.npc[index13].active && Main.npc[index13].type >= 134 && Main.npc[index13].type <= 136; index13 = (int) Main.npc[index13].ai[0]) + Vector2 center = Main.npc[index9].Center; + int num153 = 1; + for (int index10 = (int) Main.npc[index9].ai[0]; num153 < 15 && Main.npc[index10].active && Main.npc[index10].type >= 134 && Main.npc[index10].type <= 136; index10 = (int) Main.npc[index10].ai[0]) { - ++num154; - center += Main.npc[index13].Center; + ++num153; + center += Main.npc[index10].Center; } - vector2 = center / (float) num154; + vector2 = center / (float) num153; } - int headTextureIndex = Main.npc[index12].GetBossHeadTextureIndex(); - float num155 = vector2.X / 16f * num21; - float num156 = vector2.Y / 16f * num21; - float num157 = num155 + num15; - float num158 = num156 + num16; - float x7 = num157 - 10f * num21; - float y7 = num158 - 10f * num21; - Main.DrawNPCHeadBoss((Entity) Main.npc[index12], alpha, uiScale, bossHeadRotation, headSpriteEffects, headTextureIndex, x7, y7); - float num159 = x7 - (float) (TextureAssets.NpcHeadBoss[headTextureIndex].Width() / 2) * uiScale; - float num160 = y7 - (float) (TextureAssets.NpcHeadBoss[headTextureIndex].Height() / 2) * uiScale; - float num161 = num159 + (float) TextureAssets.NpcHeadBoss[headTextureIndex].Width() * uiScale; - float num162 = num160 + (float) TextureAssets.NpcHeadBoss[headTextureIndex].Height() * uiScale; - if ((double) Main.mouseX >= (double) num159 && (double) Main.mouseX <= (double) num161 && (double) Main.mouseY >= (double) num160 && (double) Main.mouseY <= (double) num162) - cursorText = Main.npc[index12].GivenOrTypeName; + int headTextureIndex = Main.npc[index9].GetBossHeadTextureIndex(); + float num154 = vector2.X / 16f * scale; + float num155 = vector2.Y / 16f * scale; + float num156 = num154 + num16; + float num157 = num155 + num17; + float x12 = num156 - 10f * scale; + float y12 = num157 - 10f * scale; + Main.spriteBatch.Draw(Main.npcHeadBossTexture[headTextureIndex], new Vector2(x12, y12), new Microsoft.Xna.Framework.Rectangle?(), new Microsoft.Xna.Framework.Color((int) num5, (int) num5, (int) num5, (int) num5), bossHeadRotation, Main.npcHeadBossTexture[headTextureIndex].Size() / 2f, uiScale, headSpriteEffects, 0.0f); + float num158 = x12 - (float) (Main.npcHeadBossTexture[headTextureIndex].Width / 2) * uiScale; + float num159 = y12 - (float) (Main.npcHeadBossTexture[headTextureIndex].Height / 2) * uiScale; + float num160 = num158 + (float) Main.npcHeadBossTexture[headTextureIndex].Width * uiScale; + float num161 = num159 + (float) Main.npcHeadBossTexture[headTextureIndex].Height * uiScale; + if ((double) Main.mouseX >= (double) num158 && (double) Main.mouseX <= (double) num160 && (double) Main.mouseY >= (double) num159 && (double) Main.mouseY <= (double) num161) + cursorText = Main.npc[index9].GivenOrTypeName; } } bool flag3 = false; Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); - for (int i = 0; i < (int) byte.MaxValue; ++i) + for (int index = 0; index < (int) byte.MaxValue; ++index) { - if (Main.player[i].active && (!Main.player[Main.myPlayer].hostile && !Main.player[i].hostile || Main.player[Main.myPlayer].team == Main.player[i].team && Main.player[i].team != 0 || i == Main.myPlayer) && Main.player[i].showLastDeath && Main.DrawPlayerDeathMarker(num15, num16, num21, num17, num18, uiScale, i)) - index3 = i; - } - if (index3 != -1) - { - TimeSpan time = DateTime.Now - Main.player[index3].lastDeathTime; - cursorText = Language.GetTextValue("Game.PlayerDeathTime", (object) Main.player[index3].name, (object) Lang.LocalizedDuration(time, false, false)); - } - else if (revengeMarker != null) - { - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, uiScaleMatrix); - revengeMarker.UseMouseOver(Main.spriteBatch, ref cursorText, uiScale); - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); - } - for (int index14 = 0; index14 < (int) byte.MaxValue; ++index14) - { - if (Main.player[index14].active && (!Main.player[Main.myPlayer].hostile && !Main.player[index14].hostile || Main.player[Main.myPlayer].team == Main.player[index14].team && Main.player[index14].team != 0 || index14 == Main.myPlayer)) + if (Main.player[index].active && (!Main.player[Main.myPlayer].hostile && !Main.player[index].hostile || Main.player[Main.myPlayer].team == Main.player[index].team && Main.player[index].team != 0 || index == Main.myPlayer) && Main.player[index].showLastDeath) { - float num163 = ((float) (((double) Main.player[index14].position.X + (double) (Main.player[index14].width / 2)) / 16.0) - num17) * num21; - float num164 = ((float) (((double) Main.player[index14].position.Y + (double) Main.player[index14].gfxOffY + (double) (Main.player[index14].height / 2)) / 16.0) - num18) * num21; - float num165 = num163 + num15; - float num166 = num164 + num16; - float num167 = num165 - 6f; - float num168 = num166 - 2f - (float) (2.0 - (double) num21 / 5.0 * 2.0); - float x8 = num167 - 10f * num21; - float y8 = num168 - 10f * num21; - float num169 = (float) ((double) x8 + 4.0 - 14.0 * (double) uiScale); - float num170 = (float) ((double) y8 + 2.0 - 14.0 * (double) uiScale); - float num171 = num169 + 28f * uiScale; - float num172 = num170 + 28f * uiScale; - if (!Main.player[index14].dead) + float num162 = (Main.player[index].lastDeathPostion.X / 16f - num18) * scale; + float num163 = (Main.player[index].lastDeathPostion.Y / 16f - num19) * scale; + float num164 = num162 + num16; + float num165 = num163 + num17 - (float) (2.0 - (double) scale / 5.0 * 2.0); + float x13 = num164 - 10f * scale; + float y13 = num165 - 10f * scale; + Main.spriteBatch.Draw(this.mapDeathTexture, new Vector2(x13, y13), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, this.mapDeathTexture.Width, this.mapDeathTexture.Height)), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2((float) this.mapDeathTexture.Width * 0.5f, (float) this.mapDeathTexture.Height * 0.5f), uiScale, SpriteEffects.None, 0.0f); + float num166 = (float) ((double) x13 + 4.0 - 14.0 * (double) uiScale); + float num167 = (float) ((double) y13 + 2.0 - 14.0 * (double) uiScale); + float num168 = num166 + 28f * uiScale; + float num169 = num167 + 28f * uiScale; + if ((double) Main.mouseX >= (double) num166 && (double) Main.mouseX <= (double) num168 && (double) Main.mouseY >= (double) num167 && (double) Main.mouseY <= (double) num169) { - Microsoft.Xna.Framework.Color headBordersColor = Main.GetPlayerHeadBordersColor(Main.player[index14]); - Main.MapPlayerRenderer.DrawPlayerHead(Main.Camera, Main.player[index14], new Vector2(x8, y8), (float) alpha / (float) byte.MaxValue, uiScale, headBordersColor); - if ((double) Main.mouseX >= (double) num169 && (double) Main.mouseX <= (double) num171 && (double) Main.mouseY >= (double) num170 && (double) Main.mouseY <= (double) num172) + TimeSpan time = DateTime.Now - Main.player[index].lastDeathTime; + cursorText = Language.GetTextValue("Game.PlayerDeathTime", (object) Main.player[index].name, (object) Lang.LocalizedDuration(time, false, false)); + } + } + } + for (int index = 0; index < (int) byte.MaxValue; ++index) + { + if (Main.player[index].active && (!Main.player[Main.myPlayer].hostile && !Main.player[index].hostile || Main.player[Main.myPlayer].team == Main.player[index].team && Main.player[index].team != 0 || index == Main.myPlayer)) + { + float num170 = ((float) (((double) Main.player[index].position.X + (double) (Main.player[index].width / 2)) / 16.0) - num18) * scale; + float num171 = ((float) (((double) Main.player[index].position.Y + (double) Main.player[index].gfxOffY + (double) (Main.player[index].height / 2)) / 16.0) - num19) * scale; + float num172 = num170 + num16; + float num173 = num171 + num17; + float num174 = num172 - 6f; + float num175 = num173 - 2f - (float) (2.0 - (double) scale / 5.0 * 2.0); + float X = num174 - 10f * scale; + float Y = num175 - 10f * scale; + float num176 = (float) ((double) X + 4.0 - 14.0 * (double) uiScale); + float num177 = (float) ((double) Y + 2.0 - 14.0 * (double) uiScale); + float num178 = num176 + 28f * uiScale; + float num179 = num177 + 28f * uiScale; + if (!Main.player[index].dead) + { + this.DrawPlayerHead(Main.player[index], X, Y, (float) num5 / (float) byte.MaxValue, uiScale); + if ((double) Main.mouseX >= (double) num176 && (double) Main.mouseX <= (double) num178 && (double) Main.mouseY >= (double) num177 && (double) Main.mouseY <= (double) num179) { - cursorText = Main.player[index14].name; - if (index14 != Main.myPlayer && Main.player[Main.myPlayer].team > 0 && Main.player[Main.myPlayer].team == Main.player[index14].team && Main.netMode == 1 && Main.player[Main.myPlayer].HasUnityPotion() && !flag3 && !Main.cancelWormHole) + cursorText = Main.player[index].name; + if (index != Main.myPlayer && Main.player[Main.myPlayer].team > 0 && Main.player[Main.myPlayer].team == Main.player[index].team && Main.netMode == 1 && Main.player[Main.myPlayer].HasUnityPotion()) { flag3 = true; if (!this.unityMouseOver) - SoundEngine.PlaySound(12); + Main.PlaySound(12); this.unityMouseOver = true; - Microsoft.Xna.Framework.Color favoriteColor = Main.OurFavoriteColor; - Main.MapPlayerRenderer.DrawPlayerHead(Main.Camera, Main.player[index14], new Vector2(x8, y8), scale: (uiScale + 0.5f), borderColor: favoriteColor); - cursorText = Language.GetTextValue("Game.TeleportTo", (object) Main.player[index14].name); + this.DrawPlayerHead(Main.player[index], X, Y, 2f, uiScale + 0.5f); + cursorText = Language.GetTextValue("Game.TeleportTo", (object) Main.player[index].name); if (Main.mouseLeft && Main.mouseLeftRelease) { Main.mouseLeftRelease = false; Main.mapFullscreen = false; - Main.player[Main.myPlayer].UnityTeleport(Main.player[index14].position); + Main.player[Main.myPlayer].UnityTeleport(Main.player[index].position); Main.player[Main.myPlayer].TakeUnityPotion(); } } @@ -41727,339 +41734,39 @@ label_623: } } } - Main.cancelWormHole = false; - Main.MapIcons.Draw(Vector2.Zero, new Vector2(num15 - 10f * num21, num16 - 10f * num21), new Microsoft.Xna.Framework.Rectangle?(), num21, uiScale, ref cursorText); if (!flag3 && this.unityMouseOver) this.unityMouseOver = false; Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.SamplerStateForCursor, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, Main.UIScaleMatrix); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, (Effect) null, Main.UIScaleMatrix); PlayerInput.SetZoom_UI(); - int num173 = 10; - int num174 = Main.screenHeight - 40; + int num180 = 10; + int num181 = Main.screenHeight - 40; if (Main.showFrameRate) - num174 -= 15; - int index15 = 0; - int num175 = 130; - if (Main.mouseX >= num173 && Main.mouseX <= num173 + 32 && Main.mouseY >= num174 && Main.mouseY <= num174 + 30) + num181 -= 15; + int index11 = 0; + int num182 = 130; + if (Main.mouseX >= num180 && Main.mouseX <= num180 + 32 && Main.mouseY >= num181 && Main.mouseY <= num181 + 30) { - num175 = (int) byte.MaxValue; - index15 += 4; + num182 = (int) byte.MaxValue; + index11 += 4; Main.player[Main.myPlayer].mouseInterface = true; if (Main.mouseLeft && Main.mouseLeftRelease) { - SoundEngine.PlaySound(10); + Main.PlaySound(10); Main.mapFullscreen = false; } } - Main.spriteBatch.Draw(TextureAssets.MapIcon[index15].Value, new Vector2((float) num173, (float) num174), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.MapIcon[index15].Width(), TextureAssets.MapIcon[index15].Height())), new Microsoft.Xna.Framework.Color(num175, num175, num175, num175), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.mapIconTexture[index11], new Vector2((float) num180, (float) num181), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.mapIconTexture[index11].Width, Main.mapIconTexture[index11].Height)), new Microsoft.Xna.Framework.Color(num182, num182, num182, num182), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); Main.DrawCursor(Main.DrawThickCursor()); } - Main.mouseX = mouseX; - Main.mouseY = mouseY; - float t1 = 3f; - Utils.Swap(ref t1, ref Main.inventoryScale); if (cursorText != "") this.MouseText(cursorText); - Utils.Swap(ref t1, ref Main.inventoryScale); Main.spriteBatch.End(); - try - { - if ((double) num17 < (double) num11) - num15 += (num17 - num11) * num21; - if ((double) num18 < (double) num12) - num16 += (num18 - num12) * num21; - if (Main.mapFullscreen) - { - if (Main.OnPostFullscreenMapDraw != null) - Main.OnPostFullscreenMapDraw(new Vector2(num15, num16), num21); - } - } - catch (Exception ex) - { - TimeLogger.DrawException(ex); - } Main.spriteBatch.Begin(); PlayerInput.SetZoom_Unscaled(); TimeLogger.DetailedDrawTime(9); } - private static void DrawMapFullscreenBackground( - Vector2 screenPosition, - int screenWidth, - int screenHeight) - { - Asset mapBg = TextureAssets.MapBGs[0]; - int index = -1; - Microsoft.Xna.Framework.Color color = Microsoft.Xna.Framework.Color.White; - int wall = (int) Main.tile[(int) ((double) Main.player[Main.myPlayer].Center.X / 16.0), (int) ((double) Main.player[Main.myPlayer].Center.Y / 16.0)].wall; - if ((double) screenPosition.Y > (double) ((Main.maxTilesY - 232) * 16)) - index = 2; - else if (Main.player[Main.myPlayer].ZoneDungeon) - index = 4; - else if (wall == 87) - index = 13; - else if ((double) screenPosition.Y > Main.worldSurface * 16.0) - { - switch (wall) - { - case 62: - case 263: - index = 18; - break; - case 86: - case 108: - index = 15; - break; - case 178: - case 183: - index = 17; - break; - case 180: - case 184: - index = 16; - break; - default: - index = !Main.player[Main.myPlayer].ZoneGlowshroom ? (!Main.player[Main.myPlayer].ZoneCorrupt ? (!Main.player[Main.myPlayer].ZoneCrimson ? (!Main.player[Main.myPlayer].ZoneHallow ? (!Main.player[Main.myPlayer].ZoneSnow ? (!Main.player[Main.myPlayer].ZoneJungle ? (!Main.player[Main.myPlayer].ZoneDesert ? (!Main.player[Main.myPlayer].ZoneRockLayerHeight ? 1 : 31) : 14) : 12) : 3) : (!Main.player[Main.myPlayer].ZoneDesert ? (!Main.player[Main.myPlayer].ZoneSnow ? 21 : 35) : 41)) : (!Main.player[Main.myPlayer].ZoneDesert ? (!Main.player[Main.myPlayer].ZoneSnow ? 23 : 34) : 40)) : (!Main.player[Main.myPlayer].ZoneDesert ? (!Main.player[Main.myPlayer].ZoneSnow ? 22 : 33) : 39)) : 20; - break; - } - } - else if (Main.player[Main.myPlayer].ZoneGlowshroom) - { - index = 19; - } - else - { - color = Main.ColorOfTheSkies; - int num = (int) (((double) screenPosition.X + (double) (screenWidth / 2)) / 16.0); - if (Main.player[Main.myPlayer].ZoneSkyHeight) - index = 32; - else if (Main.player[Main.myPlayer].ZoneCorrupt) - index = !Main.player[Main.myPlayer].ZoneDesert ? 5 : 36; - else if (Main.player[Main.myPlayer].ZoneCrimson) - index = !Main.player[Main.myPlayer].ZoneDesert ? 6 : 37; - else if (Main.player[Main.myPlayer].ZoneHallow) - index = !Main.player[Main.myPlayer].ZoneDesert ? 7 : 38; - else if ((double) screenPosition.Y / 16.0 < Main.worldSurface + 10.0 && (num < 380 || num > Main.maxTilesX - 380)) - index = 10; - else if (Main.player[Main.myPlayer].ZoneSnow) - index = 11; - else if (Main.player[Main.myPlayer].ZoneJungle) - index = 8; - else if (Main.player[Main.myPlayer].ZoneDesert) - index = 9; - else if (Main.bloodMoon) - { - color *= 2f; - index = 25; - } - else if (Main.player[Main.myPlayer].ZoneGraveyard) - index = 26; - } - if (index > -1) - mapBg = TextureAssets.MapBGs[index]; - Main.spriteBatch.Draw(mapBg.Value, new Microsoft.Xna.Framework.Rectangle(0, 0, screenWidth, screenHeight), color); - } - - private static bool DrawPlayerDeathMarker( - float X, - float Y, - float scale, - float left, - float top, - float headScale, - int i) - { - float num1 = (Main.player[i].lastDeathPostion.X / 16f - left) * scale; - float num2 = (Main.player[i].lastDeathPostion.Y / 16f - top) * scale; - float num3 = num1 + X; - float num4 = num2 + Y - (float) (2.0 - (double) scale / 5.0 * 2.0); - float x = num3 - 10f * scale; - float y = num4 - 10f * scale; - Main.spriteBatch.Draw(TextureAssets.MapDeath.Value, new Vector2(x, y), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.MapDeath.Width(), TextureAssets.MapDeath.Height())), Microsoft.Xna.Framework.Color.White, 0.0f, new Vector2((float) TextureAssets.MapDeath.Width() * 0.5f, (float) TextureAssets.MapDeath.Height() * 0.5f), headScale, SpriteEffects.None, 0.0f); - float num5 = (float) ((double) x + 4.0 - 14.0 * (double) headScale); - float num6 = (float) ((double) y + 2.0 - 14.0 * (double) headScale); - float num7 = num5 + 28f * headScale; - float num8 = num6 + 28f * headScale; - return (double) Main.mouseX >= (double) num5 && (double) Main.mouseX <= (double) num7 && (double) Main.mouseY >= (double) num6 && (double) Main.mouseY <= (double) num8; - } - - private void DrawMiscMapIcons( - SpriteBatch spriteBatch, - Vector2 mapTopLeft, - Vector2 mapX2Y2AndOff, - Microsoft.Xna.Framework.Rectangle? mapRect, - float mapScale, - float drawScale, - ref string mouseTextString) - { - this.DrawMapIcons_PotionOfReturnHomePosition(spriteBatch, mapTopLeft, mapX2Y2AndOff, mapRect, mapScale, drawScale, ref mouseTextString); - this.DrawMapIcons_PotionOfReturnAppearAfterUsePosition(spriteBatch, mapTopLeft, mapX2Y2AndOff, mapRect, mapScale, drawScale, ref mouseTextString); - this.DrawMapIcons_LastGolfballHit(spriteBatch, mapTopLeft, mapX2Y2AndOff, mapRect, mapScale, drawScale, ref mouseTextString); - } - - private void DrawMapIcons_PotionOfReturnAppearAfterUsePosition( - SpriteBatch spriteBatch, - Vector2 mapTopLeft, - Vector2 mapX2Y2AndOff, - Microsoft.Xna.Framework.Rectangle? mapRect, - float mapScale, - float drawScale, - ref string mouseTextString) - { - Vector2? originalUsePosition = Main.LocalPlayer.PotionOfReturnOriginalUsePosition; - if (!originalUsePosition.HasValue) - return; - Vector2? nullable = originalUsePosition; - Vector2 vector2_1 = new Vector2(0.0f, (float) (-Main.LocalPlayer.height / 2)); - Vector2 vector2_2 = (((nullable.HasValue ? new Vector2?(nullable.GetValueOrDefault() + vector2_1) : new Vector2?()).Value / 16f - mapTopLeft) * mapScale + mapX2Y2AndOff).Floor(); - if (mapRect.HasValue && !mapRect.Value.Contains(vector2_2.ToPoint())) - return; - Texture2D texture2D = TextureAssets.Extra[173].Value; - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(); - spriteBatch.Draw(texture2D, vector2_2, new Microsoft.Xna.Framework.Rectangle?(r), Microsoft.Xna.Framework.Color.White, 0.0f, r.Size() / 2f, drawScale, SpriteEffects.None, 0.0f); - if (!Utils.CenteredRectangle(vector2_2, r.Size() * drawScale).Contains(Main.MouseScreen.ToPoint())) - return; - mouseTextString = Language.GetTextValue("GameUI.PotionOfReturnExitPortal"); - Vector2 vector2_3 = Main.MouseScreen + new Vector2(-28f) + new Vector2(4f, 0.0f); - } - - private void DrawMapIcons_PotionOfReturnHomePosition( - SpriteBatch spriteBatch, - Vector2 mapTopLeft, - Vector2 mapX2Y2AndOff, - Microsoft.Xna.Framework.Rectangle? mapRect, - float mapScale, - float drawScale, - ref string mouseTextString) - { - Vector2? returnHomePosition = Main.LocalPlayer.PotionOfReturnHomePosition; - if (!returnHomePosition.HasValue) - return; - Vector2? nullable = returnHomePosition; - Vector2 vector2_1 = new Vector2(0.0f, (float) (-Main.LocalPlayer.height / 2)); - Vector2 vector2_2 = (((nullable.HasValue ? new Vector2?(nullable.GetValueOrDefault() + vector2_1) : new Vector2?()).Value / 16f - mapTopLeft) * mapScale + mapX2Y2AndOff).Floor(); - if (mapRect.HasValue && !mapRect.Value.Contains(vector2_2.ToPoint())) - return; - Texture2D texture2D = TextureAssets.Extra[175].Value; - Microsoft.Xna.Framework.Rectangle r = texture2D.Frame(); - spriteBatch.Draw(texture2D, vector2_2, new Microsoft.Xna.Framework.Rectangle?(r), Microsoft.Xna.Framework.Color.White, 0.0f, r.Size() / 2f, drawScale, SpriteEffects.None, 0.0f); - if (!Utils.CenteredRectangle(vector2_2, r.Size() * drawScale).Contains(Main.MouseScreen.ToPoint())) - return; - mouseTextString = Language.GetTextValue("GameUI.PotionOfReturnHomePortal"); - Vector2 vector2_3 = Main.MouseScreen + new Vector2(-28f) + new Vector2(4f, 0.0f); - } - - private void DrawMapIcons_LastGolfballHit( - SpriteBatch spriteBatch, - Vector2 mapTopLeft, - Vector2 mapX2Y2AndOff, - Microsoft.Xna.Framework.Rectangle? mapRect, - float mapScale, - float drawScale, - ref string mouseTextString) - { - Projectile lastHitBall = Main.LocalGolfState.GetLastHitBall(); - if (lastHitBall == null) - return; - Vector2 vector2_1 = ((lastHitBall.Center / 16f - mapTopLeft) * mapScale + mapX2Y2AndOff).Floor(); - if (mapRect.HasValue && !mapRect.Value.Contains(vector2_1.ToPoint())) - return; - Texture2D texture2D1 = TextureAssets.Extra[176].Value; - Microsoft.Xna.Framework.Rectangle r1 = texture2D1.Frame(); - spriteBatch.Draw(texture2D1, vector2_1, new Microsoft.Xna.Framework.Rectangle?(r1), Microsoft.Xna.Framework.Color.White, 0.0f, r1.Size() / 2f, drawScale, SpriteEffects.None, 0.0f); - Microsoft.Xna.Framework.Rectangle rectangle = Utils.CenteredRectangle(vector2_1, r1.Size() * drawScale); - this.LoadProjectile(lastHitBall.type); - Texture2D texture2D2 = TextureAssets.Projectile[lastHitBall.type].Value; - Microsoft.Xna.Framework.Rectangle r2 = texture2D2.Frame(); - spriteBatch.Draw(texture2D2, vector2_1, new Microsoft.Xna.Framework.Rectangle?(r2), Microsoft.Xna.Framework.Color.White, 0.0f, r2.Size() / 2f, drawScale, SpriteEffects.None, 0.0f); - if (!rectangle.Contains(Main.MouseScreen.ToPoint())) - return; - mouseTextString = lastHitBall.Name; - Vector2 vector2_2 = Main.MouseScreen + new Vector2(-28f) + new Vector2(4f, 0.0f); - } - - public static void TriggerPing(Vector2 position) - { - Main.Pings.Add(position); - if (Main.netMode != 1) - return; - NetManager.Instance.SendToServer(NetPingModule.Serialize(position)); - } - - private static void DrawNPCHeadFriendly( - Entity theNPC, - byte alpha, - float headScale, - SpriteEffects dir, - int npcID, - float x, - float y) - { - Main.TownNPCHeadRenderer.DrawWithOutlines(theNPC, npcID, new Vector2(x, y), new Microsoft.Xna.Framework.Color((int) alpha, (int) alpha, (int) alpha, (int) alpha), 0.0f, headScale, dir); - } - - private static void DrawNPCHeadBoss( - Entity theNPC, - byte alpha, - float headScale, - float rotation, - SpriteEffects effects, - int npcID, - float x, - float y) - { - Main.BossNPCHeadRenderer.DrawWithOutlines(theNPC, npcID, new Vector2(x, y), new Microsoft.Xna.Framework.Color((int) alpha, (int) alpha, (int) alpha, (int) alpha), 0.0f, headScale, effects); - } - - private static void DrawWithOutlines( - Entity entity, - Texture2D tex, - Vector2 position, - Microsoft.Xna.Framework.Rectangle? rect, - Microsoft.Xna.Framework.Color color, - float rotation, - Vector2 origin, - float scale, - SpriteEffects effects) - { - float num1 = 2f * scale; - Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; - int colorOnlyShaderIndex = ContentSamples.CommonlyUsedContentSamples.ColorOnlyShaderIndex; - DrawData drawData = new DrawData(tex, position, rect, color, rotation, origin, scale, effects, 0); - GameShaders.Armor.Apply(colorOnlyShaderIndex, entity, new DrawData?(drawData)); - Microsoft.Xna.Framework.Color color1 = Microsoft.Xna.Framework.Color.Black * ((float) color.A / (float) byte.MaxValue) * ((float) color.A / (float) byte.MaxValue); - Microsoft.Xna.Framework.Color color2 = white * ((float) color.A / (float) byte.MaxValue) * ((float) color.A / (float) byte.MaxValue); - int num2 = 2; - for (int index1 = -num2; index1 <= num2; ++index1) - { - for (int index2 = -num2; index2 <= num2; ++index2) - { - if (Math.Abs(index1) + Math.Abs(index2) == num2) - { - Vector2 vector2 = new Vector2((float) index1 * num1, (float) index2 * num1).RotatedBy((double) rotation); - Main.spriteBatch.Draw(tex, position + vector2, rect, color1, rotation, origin, scale, effects, 0.0f); - } - } - } - int num3 = 1; - Vector2 zero = Vector2.Zero; - for (int index3 = -num3; index3 <= num3; ++index3) - { - for (int index4 = -num3; index4 <= num3; ++index4) - { - if (Math.Abs(index3) + Math.Abs(index4) == num3) - { - Vector2 vector2 = new Vector2((float) index3 * num1, (float) index4 * num1).RotatedBy((double) rotation); - Main.spriteBatch.Draw(tex, position + vector2, rect, color2, rotation, origin, scale, effects, 0.0f); - } - } - } - Main.pixelShader.CurrentTechnique.Passes[0].Apply(); - Main.spriteBatch.Draw(tex, position, rect, color, rotation, origin, scale, effects, 0.0f); - } - - public static Microsoft.Xna.Framework.Color GetPlayerHeadBordersColor(Player plr) => plr.ghost || plr.dead || plr.whoAmI != Main.myPlayer && plr.hostile && (plr.team != Main.LocalPlayer.team || plr.team == 0) ? Microsoft.Xna.Framework.Color.Transparent : Main.teamColor[plr.team]; - private static string DrawMap_FindChestName( LocalizedText[] chestNames, Tile chestTile, @@ -42071,13 +41778,22 @@ label_623: return chestByGuessing >= 0 ? (!(Main.chest[chestByGuessing].name != "") ? chestNames[(int) chestTile.frameX / fullTileWidth].Value : chestNames[(int) chestTile.frameX / fullTileWidth].ToString() + ": " + Main.chest[chestByGuessing].name) : chestNames[0].Value; } - public void DrawSimpleSurfaceBackground(Vector2 areaPosition, int areaWidth, int areaHeight) + public void DrawItems() { - float val2 = (float) (Main.worldSurface + 1.0) * 16f; - float num1 = Math.Min(areaPosition.Y + (float) areaHeight, val2) - areaPosition.Y; - float y = areaPosition.Y; - float num2 = areaPosition.Y + num1; - Vector4 vector4_1 = Main.ColorOfTheSkies.ToVector4(); + for (int whoami = 0; whoami < 400; ++whoami) + { + if (Main.item[whoami].active && Main.item[whoami].type > 0) + this.DrawItem(Main.item[whoami], whoami); + } + } + + public void DrawSimpleSurfaceBackground() + { + float val2 = (float) Main.worldSurface * 16f; + float num1 = Math.Min(Main.screenPosition.Y + (float) Main.screenHeight, val2) - Main.screenPosition.Y; + float y = Main.screenPosition.Y; + float num2 = Main.screenPosition.Y + num1; + Vector4 vector4_1 = Main.bgColor.ToVector4(); Vector4 vector4_2 = new Microsoft.Xna.Framework.Color(53, 43, 243).ToVector4() * vector4_1; Vector4 vector4_3 = new Microsoft.Xna.Framework.Color(132, 170, 248).ToVector4() * vector4_1; Microsoft.Xna.Framework.Color color1 = new Microsoft.Xna.Framework.Color(Vector4.Lerp(vector4_2, vector4_3, y / val2)); @@ -42087,33 +41803,38 @@ label_623: colors.TopRightColor = color1; colors.BottomLeftColor = color2; colors.BottomRightColor = color2; - Main.tileBatch.Draw(TextureAssets.BlackTile.Value, new Vector4(0.0f, 0.0f, (float) areaWidth, num1), colors); - float w = (float) areaHeight - num1; + Main.tileBatch.Draw(Main.blackTileTexture, new Vector4(0.0f, 0.0f, (float) Main.screenWidth, num1), colors); + float w = (float) Main.screenHeight - num1; if ((double) w <= 0.0) return; colors.TopLeftColor = Microsoft.Xna.Framework.Color.Black; colors.TopRightColor = Microsoft.Xna.Framework.Color.Black; colors.BottomLeftColor = Microsoft.Xna.Framework.Color.Black; colors.BottomRightColor = Microsoft.Xna.Framework.Color.Black; - Main.tileBatch.Draw(TextureAssets.BlackTile.Value, new Vector4(0.0f, num1, (float) areaWidth, w), colors); + Main.tileBatch.Draw(Main.blackTileTexture, new Vector4(0.0f, num1, (float) Main.screenWidth, w), colors); } public void DrawCapture(Microsoft.Xna.Framework.Rectangle area, CaptureSettings settings) { - float[] bgAlphaFrontLayer = Main.bgAlphaFrontLayer; - Main.bgAlphaFrontLayer = new float[bgAlphaFrontLayer.Length]; - float[] alphaFarBackLayer = Main.bgAlphaFarBackLayer; - Main.bgAlphaFarBackLayer = new float[alphaFarBackLayer.Length]; - this.UpdateBGVisibility_BackLayer(new int?(settings.Biome.BackgroundIndex), new float?(1f)); - this.UpdateBGVisibility_FrontLayer(new int?(settings.Biome.BackgroundIndex), new float?(1f)); - float[] array = ((IEnumerable) Main.liquidAlpha).ToArray(); - int holyTileCount = Main.SceneMetrics.HolyTileCount; - Main.SceneMetrics.HolyTileCount = settings.Biome.BackgroundIndex == 6 ? SceneMetrics.HallowTileMax : 0; + float[] bgAlpha = Main.bgAlpha; + Main.bgAlpha = new float[bgAlpha.Length]; + for (int index = 0; index < Main.bgAlpha.Length; ++index) + Main.bgAlpha[index] = 0.0f; + Main.bgAlpha[settings.Biome.BackgroundIndex] = 1f; + float[] bgAlpha2 = Main.bgAlpha2; + Main.bgAlpha2 = new float[bgAlpha2.Length]; + for (int index = 0; index < Main.bgAlpha2.Length; ++index) + Main.bgAlpha2[index] = 0.0f; + Main.bgAlpha2[settings.Biome.BackgroundIndex2] = 1f; + if (settings.Biome.BackgroundIndex2 == 6) + Main.bgAlpha2[0] = 1f; + int holyTiles = Main.holyTiles; + Main.holyTiles = settings.Biome.BackgroundIndex == 6 ? 400 : 0; int offScreenRange = Main.offScreenRange; Main.offScreenRange = 0; SpriteViewMatrix gameViewMatrix = Main.GameViewMatrix; Main.GameViewMatrix = new SpriteViewMatrix(this.GraphicsDevice); - Main.Rasterizer = RasterizerState.CullCounterClockwise; + this.Rasterizer = RasterizerState.CullCounterClockwise; bool captureEntities = settings.CaptureEntities; bool captureBackground = settings.CaptureBackground; CaptureBiome biome = settings.Biome; @@ -42126,38 +41847,357 @@ label_623: Main.screenHeight = area.Height << 4; Main.screenPosition = new Vector2((float) (area.X * 16), (float) (area.Y * 16)); Main.cloudAlpha = 0.0f; - for (int index = 0; index <= 10; ++index) - { - if (index != 1) - Main.liquidAlpha[index] = index == biome.WaterStyle ? 1f : 0.0f; - } int x1 = area.X; int y1 = area.Y; int num1 = area.X + Main.screenWidth / 16; int num2 = area.Y + Main.screenHeight / 16; - float tempMushroomInfluence = (float) (biome.TileColor == CaptureBiome.TileColorStyle.Mushroom).ToInt(); - Microsoft.Xna.Framework.Color sunColor; - Microsoft.Xna.Framework.Color moonColor; - Main.SetBackColor(new Main.InfoToSetBackColor() + Main.bgColor = Microsoft.Xna.Framework.Color.White; + double num3 = Main.time / 54000.0; + int screenWidth2 = Main.screenWidth; + int width1 = Main.sunTexture.Width; + int width2 = Main.sunTexture.Width; + Microsoft.Xna.Framework.Color white1 = Microsoft.Xna.Framework.Color.White; + double num4 = Main.time / 54000.0; + double num5 = Main.time / 32400.0; + int screenWidth3 = Main.screenWidth; + int width3 = Main.moonTexture[Main.moonType].Width; + int width4 = Main.moonTexture[Main.moonType].Width; + Microsoft.Xna.Framework.Color white2 = Microsoft.Xna.Framework.Color.White; + double num6 = Main.time / 32400.0; + double num7; + double num8; + if (Main.dayTime) { - isInGameMenuOrIsServer = Main.gameMenu || Main.netMode == 2, - CorruptionBiomeInfluence = (float) (biome.TileColor == CaptureBiome.TileColorStyle.Corrupt).ToInt(), - CrimsonBiomeInfluence = (float) (biome.TileColor == CaptureBiome.TileColorStyle.Crimson).ToInt(), - JungleBiomeInfluence = (float) (biome.TileColor == CaptureBiome.TileColorStyle.Jungle).ToInt(), - MushroomBiomeInfluence = tempMushroomInfluence, - GraveyardInfluence = Main.GraveyardVisualIntensity, - BloodMoonActive = biome.WaterStyle == 9, - LanternNightActive = LanternNight.LanternsUp - }, out sunColor, out moonColor); - Main.ApplyColorOfTheSkiesToTiles(); - Main.ColorOfSurfaceBackgroundsBase = Main.ColorOfSurfaceBackgroundsModified = Main.ColorOfTheSkies; - bool mapEnabled = Main.mapEnabled; - Main.mapEnabled = false; - Lighting.Initialize(); + if (Main.time < 27000.0) + { + num7 = Math.Pow(1.0 - Main.time / 54000.0 * 2.0, 2.0); + int bgTop = this.bgTop; + } + else + { + num7 = Math.Pow((Main.time / 54000.0 - 0.5) * 2.0, 2.0); + int bgTop = this.bgTop; + } + } + else if (Main.time < 16200.0) + { + num8 = Math.Pow(1.0 - Main.time / 32400.0 * 2.0, 2.0); + int bgTop = this.bgTop; + } + else + { + num8 = Math.Pow((Main.time / 32400.0 - 0.5) * 2.0, 2.0); + int bgTop = this.bgTop; + } + if (Main.dayTime) + { + if (Main.time < 13500.0) + { + float num9 = (float) (Main.time / 13500.0); + white1.R = (byte) ((double) num9 * 200.0 + 55.0); + white1.G = (byte) ((double) num9 * 180.0 + 75.0); + white1.B = (byte) ((double) num9 * 250.0 + 5.0); + Main.bgColor.R = (byte) ((double) num9 * 230.0 + 25.0); + Main.bgColor.G = (byte) ((double) num9 * 220.0 + 35.0); + Main.bgColor.B = (byte) ((double) num9 * 220.0 + 35.0); + } + if (Main.time > 45900.0) + { + float num10 = (float) (1.0 - (Main.time / 54000.0 - 0.85) * (20.0 / 3.0)); + white1.R = (byte) ((double) num10 * 120.0 + 55.0); + white1.G = (byte) ((double) num10 * 100.0 + 25.0); + white1.B = (byte) ((double) num10 * 120.0 + 55.0); + Main.bgColor.R = (byte) ((double) num10 * 200.0 + 35.0); + Main.bgColor.G = (byte) ((double) num10 * 85.0 + 35.0); + Main.bgColor.B = (byte) ((double) num10 * 135.0 + 35.0); + } + else if (Main.time > 37800.0) + { + float num11 = (float) (1.0 - (Main.time / 54000.0 - 0.7) * (20.0 / 3.0)); + white1.R = (byte) ((double) num11 * 80.0 + 175.0); + white1.G = (byte) ((double) num11 * 130.0 + 125.0); + white1.B = (byte) ((double) num11 * 100.0 + 155.0); + Main.bgColor.R = (byte) ((double) num11 * 20.0 + 235.0); + Main.bgColor.G = (byte) ((double) num11 * 135.0 + 120.0); + Main.bgColor.B = (byte) ((double) num11 * 85.0 + 170.0); + } + } + if (!Main.dayTime) + { + if (Main.bloodMoon) + { + if (Main.time < 16200.0) + { + float num12 = (float) (1.0 - Main.time / 16200.0); + white2.R = (byte) ((double) num12 * 10.0 + 205.0); + white2.G = (byte) ((double) num12 * 170.0 + 55.0); + white2.B = (byte) ((double) num12 * 200.0 + 55.0); + Main.bgColor.R = (byte) (40.0 - (double) num12 * 40.0 + 35.0); + Main.bgColor.G = (byte) ((double) num12 * 20.0 + 15.0); + Main.bgColor.B = (byte) ((double) num12 * 20.0 + 15.0); + } + else if (Main.time >= 16200.0) + { + float num13 = (float) ((Main.time / 32400.0 - 0.5) * 2.0); + white2.R = (byte) ((double) num13 * 50.0 + 205.0); + white2.G = (byte) ((double) num13 * 100.0 + 155.0); + white2.B = (byte) ((double) num13 * 100.0 + 155.0); + white2.R = (byte) ((double) num13 * 10.0 + 205.0); + white2.G = (byte) ((double) num13 * 170.0 + 55.0); + white2.B = (byte) ((double) num13 * 200.0 + 55.0); + Main.bgColor.R = (byte) (40.0 - (double) num13 * 40.0 + 35.0); + Main.bgColor.G = (byte) ((double) num13 * 20.0 + 15.0); + Main.bgColor.B = (byte) ((double) num13 * 20.0 + 15.0); + } + } + else if (Main.time < 16200.0) + { + float num14 = (float) (1.0 - Main.time / 16200.0); + white2.R = (byte) ((double) num14 * 10.0 + 205.0); + white2.G = (byte) ((double) num14 * 70.0 + 155.0); + white2.B = (byte) ((double) num14 * 100.0 + 155.0); + Main.bgColor.R = (byte) ((double) num14 * 30.0 + 5.0); + Main.bgColor.G = (byte) ((double) num14 * 30.0 + 5.0); + Main.bgColor.B = (byte) ((double) num14 * 30.0 + 5.0); + } + else if (Main.time >= 16200.0) + { + float num15 = (float) ((Main.time / 32400.0 - 0.5) * 2.0); + white2.R = (byte) ((double) num15 * 50.0 + 205.0); + white2.G = (byte) ((double) num15 * 100.0 + 155.0); + white2.B = (byte) ((double) num15 * 100.0 + 155.0); + Main.bgColor.R = (byte) ((double) num15 * 20.0 + 5.0); + Main.bgColor.G = (byte) ((double) num15 * 30.0 + 5.0); + Main.bgColor.B = (byte) ((double) num15 * 30.0 + 5.0); + } + } + if (Main.gameMenu) + Main.bgDelay = 1000; + if (biome.TileColor == CaptureBiome.TileColorStyle.Corrupt) + { + float num16 = 1f; + int r1 = (int) Main.bgColor.R; + int g1 = (int) Main.bgColor.G; + int b1 = (int) Main.bgColor.B; + int num17 = r1 - (int) (100.0 * (double) num16 * ((double) Main.bgColor.R / (double) byte.MaxValue)); + int num18 = g1 - (int) (140.0 * (double) num16 * ((double) Main.bgColor.G / (double) byte.MaxValue)); + int num19 = b1 - (int) (80.0 * (double) num16 * ((double) Main.bgColor.B / (double) byte.MaxValue)); + if (num17 < 15) + num17 = 15; + if (num18 < 15) + num18 = 15; + if (num19 < 15) + num19 = 15; + Main.bgColor.R = (byte) num17; + Main.bgColor.G = (byte) num18; + Main.bgColor.B = (byte) num19; + int r2 = (int) white1.R; + int g2 = (int) white1.G; + int b2 = (int) white1.B; + int num20 = r2 - (int) (100.0 * (double) num16 * ((double) white1.R / (double) byte.MaxValue)); + int num21 = g2 - (int) (100.0 * (double) num16 * ((double) white1.G / (double) byte.MaxValue)); + int num22 = b2 - (int) (0.0 * (double) num16 * ((double) white1.B / (double) byte.MaxValue)); + if (num20 < 15) + num20 = 15; + if (num21 < 15) + num21 = 15; + if (num22 < 15) + num22 = 15; + white1.R = (byte) num20; + white1.G = (byte) num21; + white1.B = (byte) num22; + int r3 = (int) white2.R; + int g3 = (int) white2.G; + int b3 = (int) white2.B; + int num23 = r3 - (int) (140.0 * (double) num16 * ((double) white2.R / (double) byte.MaxValue)); + int num24 = g3 - (int) (190.0 * (double) num16 * ((double) white2.G / (double) byte.MaxValue)); + int num25 = b3 - (int) (170.0 * (double) num16 * ((double) white2.B / (double) byte.MaxValue)); + if (num23 < 15) + num23 = 15; + if (num24 < 15) + num24 = 15; + if (num25 < 15) + num25 = 15; + white2.R = (byte) num23; + white2.G = (byte) num24; + white2.B = (byte) num25; + } + if (biome.TileColor == CaptureBiome.TileColorStyle.Crimson) + { + float num26 = 1f; + int r4 = (int) Main.bgColor.R; + int g4 = (int) Main.bgColor.G; + int b4 = (int) Main.bgColor.B; + int num27 = r4 - (int) (70.0 * (double) num26 * ((double) Main.bgColor.G / (double) byte.MaxValue)); + int num28 = g4 - (int) (110.0 * (double) num26 * ((double) Main.bgColor.G / (double) byte.MaxValue)); + int num29 = b4 - (int) (150.0 * (double) num26 * ((double) Main.bgColor.B / (double) byte.MaxValue)); + if (num27 < 15) + num27 = 15; + if (num28 < 15) + num28 = 15; + if (num29 < 15) + num29 = 15; + Main.bgColor.R = (byte) num27; + Main.bgColor.G = (byte) num28; + Main.bgColor.B = (byte) num29; + int num30 = (int) white1.R; + int g5 = (int) white1.G; + int b5 = (int) white1.B; + int num31 = g5 - (int) (90.0 * (double) num26 * ((double) white1.G / (double) byte.MaxValue)); + int num32 = b5 - (int) (110.0 * (double) num26 * ((double) white1.B / (double) byte.MaxValue)); + if (num30 < 15) + num30 = 15; + if (num31 < 15) + num31 = 15; + if (num32 < 15) + num32 = 15; + white1.R = (byte) num30; + white1.G = (byte) num31; + white1.B = (byte) num32; + int r5 = (int) white2.R; + int g6 = (int) white2.G; + int b6 = (int) white2.B; + int num33 = r5 - (int) (100.0 * (double) num26 * ((double) white2.R / (double) byte.MaxValue)); + int num34 = g6 - (int) (120.0 * (double) num26 * ((double) white2.G / (double) byte.MaxValue)); + int num35 = b6 - (int) (180.0 * (double) num26 * ((double) white2.B / (double) byte.MaxValue)); + if (num33 < 15) + num33 = 15; + if (num34 < 15) + num34 = 15; + if (num35 < 15) + num35 = 15; + white2.R = (byte) num33; + white2.G = (byte) num34; + white2.B = (byte) num35; + } + if (biome.TileColor == CaptureBiome.TileColorStyle.Jungle) + { + float num36 = 1f; + int r6 = (int) Main.bgColor.R; + int num37 = (int) Main.bgColor.G; + int b7 = (int) Main.bgColor.B; + int num38 = r6 - (int) (40.0 * (double) num36 * ((double) Main.bgColor.R / (double) byte.MaxValue)); + int num39 = b7 - (int) (70.0 * (double) num36 * ((double) Main.bgColor.B / (double) byte.MaxValue)); + if (num37 > (int) byte.MaxValue) + num37 = (int) byte.MaxValue; + if (num37 < 15) + num37 = 15; + if (num38 > (int) byte.MaxValue) + num38 = (int) byte.MaxValue; + if (num38 < 15) + num38 = 15; + if (num39 < 15) + num39 = 15; + Main.bgColor.R = (byte) num38; + Main.bgColor.G = (byte) num37; + Main.bgColor.B = (byte) num39; + int r7 = (int) white1.R; + int num40 = (int) white1.G; + int b8 = (int) white1.B; + int num41 = r7 - (int) (30.0 * (double) num36 * ((double) white1.R / (double) byte.MaxValue)); + int num42 = b8 - (int) (10.0 * (double) num36 * ((double) white1.B / (double) byte.MaxValue)); + if (num41 < 15) + num41 = 15; + if (num40 < 15) + num40 = 15; + if (num42 < 15) + num42 = 15; + white1.R = (byte) num41; + white1.G = (byte) num40; + white1.B = (byte) num42; + int r8 = (int) white2.R; + int g = (int) white2.G; + int b9 = (int) white2.B; + int num43 = g - (int) (140.0 * (double) num36 * ((double) white2.R / (double) byte.MaxValue)); + int num44 = r8 - (int) (170.0 * (double) num36 * ((double) white2.G / (double) byte.MaxValue)); + int num45 = b9 - (int) (190.0 * (double) num36 * ((double) white2.B / (double) byte.MaxValue)); + if (num44 < 15) + num44 = 15; + if (num43 < 15) + num43 = 15; + if (num45 < 15) + num45 = 15; + white2.R = (byte) num44; + white2.G = (byte) num43; + white2.B = (byte) num45; + } + if (biome.TileColor == CaptureBiome.TileColorStyle.Mushroom) + { + float num46 = 1f; + int r9 = (int) Main.bgColor.R; + int g7 = (int) Main.bgColor.G; + int b10 = (int) Main.bgColor.B; + int num47 = g7 - (int) (250.0 * (double) num46 * ((double) Main.bgColor.G / (double) byte.MaxValue)); + int num48 = r9 - (int) (250.0 * (double) num46 * ((double) Main.bgColor.R / (double) byte.MaxValue)); + int num49 = b10 - (int) (250.0 * (double) num46 * ((double) Main.bgColor.B / (double) byte.MaxValue)); + if (num47 < 15) + num47 = 15; + if (num48 < 15) + num48 = 15; + if (num49 < 15) + num49 = 15; + Main.bgColor.R = (byte) num48; + Main.bgColor.G = (byte) num47; + Main.bgColor.B = (byte) num49; + int r10 = (int) white1.R; + int g8 = (int) white1.G; + int b11 = (int) white1.B; + int num50 = g8 - (int) (10.0 * (double) num46 * ((double) white1.G / (double) byte.MaxValue)); + int num51 = r10 - (int) (30.0 * (double) num46 * ((double) white1.R / (double) byte.MaxValue)); + int num52 = b11 - (int) (10.0 * (double) num46 * ((double) white1.B / (double) byte.MaxValue)); + if (num51 < 15) + num51 = 15; + if (num50 < 15) + num50 = 15; + if (num52 < 15) + num52 = 15; + white1.R = (byte) num51; + white1.G = (byte) num50; + white1.B = (byte) num52; + int r11 = (int) white2.R; + int g9 = (int) white2.G; + int b12 = (int) white2.B; + int num53 = g9 - (int) (140.0 * (double) num46 * ((double) white2.R / (double) byte.MaxValue)); + int num54 = r11 - (int) (170.0 * (double) num46 * ((double) white2.G / (double) byte.MaxValue)); + int num55 = b12 - (int) (190.0 * (double) num46 * ((double) white2.B / (double) byte.MaxValue)); + if (num54 < 15) + num54 = 15; + if (num53 < 15) + num53 = 15; + if (num55 < 15) + num55 = 15; + white2.R = (byte) num54; + white2.G = (byte) num53; + white2.B = (byte) num55; + } + if (Lighting.NotRetro) + { + if (Main.bgColor.R < (byte) 10) + Main.bgColor.R = (byte) 10; + if (Main.bgColor.G < (byte) 10) + Main.bgColor.G = (byte) 10; + if (Main.bgColor.B < (byte) 10) + Main.bgColor.B = (byte) 10; + } + else + { + if (Main.bgColor.R < (byte) 15) + Main.bgColor.R = (byte) 15; + if (Main.bgColor.G < (byte) 15) + Main.bgColor.G = (byte) 15; + if (Main.bgColor.B < (byte) 15) + Main.bgColor.B = (byte) 15; + } + Main.tileColor.A = byte.MaxValue; + Main.tileColor.R = (byte) (((int) Main.bgColor.R + (int) Main.bgColor.G + (int) Main.bgColor.B + (int) Main.bgColor.R * 7) / 10); + Main.tileColor.G = (byte) (((int) Main.bgColor.R + (int) Main.bgColor.G + (int) Main.bgColor.B + (int) Main.bgColor.G * 7) / 10); + Main.tileColor.B = (byte) (((int) Main.bgColor.R + (int) Main.bgColor.G + (int) Main.bgColor.B + (int) Main.bgColor.B * 7) / 10); + Main.backColor = Main.bgColor; + Main.trueBackColor = Main.backColor; + Lighting.Initialize(true); Main.renderCount = 99; - for (int index = 0; index < 4; ++index) + for (int index = 0; index < 3; ++index) Lighting.LightTiles(x1, num1, y1, num2); - Main.mapEnabled = mapEnabled; if ((double) (settings.Area.X * 16) <= (double) screenPosition1.X - 16.0 || (double) (settings.Area.Y * 16) <= (double) screenPosition1.Y - 16.0 || (double) ((settings.Area.X + settings.Area.Width) * 16) >= (double) screenPosition1.X + (double) screenWidth1 + 16.0 || (double) ((settings.Area.Y + settings.Area.Height) * 16) >= (double) screenPosition1.Y + (double) screenHeight1 + 16.0) { for (int index = 0; index < Main.dust.Length; ++index) @@ -42174,16 +42214,16 @@ label_623: Vector2 vector2_2 = vector2_1 - Main.screenPosition; int x2 = Math.Max(val1_1, 5) - 2; int y2 = Math.Max(val1_3, 5); - int num3 = Math.Min(val1_2, Main.maxTilesX - 5) + 2; - int num4 = Math.Min(val1_4, Main.maxTilesY - 5) + 4; - Microsoft.Xna.Framework.Rectangle drawArea = new Microsoft.Xna.Framework.Rectangle(x2, y2, num3 - x2, num4 - y2); + int num56 = Math.Min(val1_2, Main.maxTilesX - 5) + 2; + int num57 = Math.Min(val1_4, Main.maxTilesY - 5) + 4; + Microsoft.Xna.Framework.Rectangle drawArea = new Microsoft.Xna.Framework.Rectangle(x2, y2, num56 - x2, num57 - y2); LiquidRenderer.Instance.PrepareDraw(drawArea); WorldGen.SectionTileFrameWithCheck(x1, y1, num1, num2); if (captureBackground) { Matrix transform = Main.Transform; int screenHeight2 = Main.screenHeight; - int screenWidth2 = Main.screenWidth; + int screenWidth4 = Main.screenWidth; Vector2 screenPosition2 = Main.screenPosition; bool mapFullscreen = Main.mapFullscreen; Main.mapFullscreen = false; @@ -42201,16 +42241,16 @@ label_623: if ((double) (settings.Area.Height * 16) >= 2000.0 || (double) (settings.Area.Width * 16) >= 2000.0) { this.scAdj = 0.0f; - float num5 = 2048f; - float scale = MathHelper.Clamp((float) settings.Area.Height * 16f / num5, 1f, 3f); + float num58 = 2500f; + float scale = MathHelper.Clamp((float) settings.Area.Height * 16f / num58, 1f, 2f); Main.screenWidth = settings.Area.Width * 16; Main.screenHeight = Math.Min(2048, settings.Area.Height * 16); Main.screenPosition.X = (float) (settings.Area.X * 16); Main.screenPosition.Y = (float) (settings.Area.Y * 16); - Main.screenPosition.Y += Math.Max(0.0f, (float) ((double) Math.Min((float) settings.Area.Height, (float) Main.worldSurface) * 16.0 - (double) num5 * (double) scale)); + Main.screenPosition.Y += Math.Max(0.0f, (float) ((double) Math.Min((float) settings.Area.Height, (float) Main.worldSurface) * 16.0 - (double) num58 * (double) scale)); transform *= Matrix.CreateScale(scale); transform.Translation += new Vector3((float) ((settings.Area.X - area.X) * 16), (float) ((settings.Area.Y - area.Y) * 16), 0.0f); - transform.Translation += new Vector3(0.0f, Math.Max(0.0f, (float) ((double) Math.Min((float) settings.Area.Height, (float) Main.worldSurface) * 16.0 - (double) num5 * (double) scale)) / scale, 0.0f); + transform.Translation += new Vector3(0.0f, Math.Max(0.0f, (float) ((double) Math.Min((float) settings.Area.Height, (float) Main.worldSurface) * 16.0 - (double) num58 * (double) scale)) / scale, 0.0f); } else if ((double) (settings.Area.X * 16) > (double) screenPosition1.X - 16.0 && (double) (settings.Area.Y * 16) > (double) screenPosition1.Y - 16.0 && (double) ((settings.Area.X + settings.Area.Width) * 16) < (double) screenPosition1.X + (double) screenWidth1 + 16.0 && (double) ((settings.Area.Y + settings.Area.Height) * 16) < (double) screenPosition1.Y + (double) screenHeight1 + 16.0) { @@ -42219,45 +42259,17 @@ label_623: Main.screenHeight = screenHeight1; transform.Translation += new Vector3(screenPosition1.X - (float) area.X * 16f, screenPosition1.Y - (float) area.Y * 16f, 0.0f); } - Vector2 areaPosition = new Vector2((float) (area.X * 16), (float) (area.Y * 16)); - int areaWidth = area.Width * 16; - int areaHeight = area.Height * 16; Main.tileBatch.Begin(); - this.DrawSimpleSurfaceBackground(areaPosition, areaWidth, areaHeight); + this.DrawSimpleSurfaceBackground(); Main.tileBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.AnisotropicClamp, DepthStencilState.Default, RasterizerState.CullNone, (Effect) null, transform); - int num6 = Main.screenWidth; - int num7 = Main.screenHeight; - Vector2 zero = Vector2.Zero; - if (num6 < 800) - { - int num8 = 800 - num6; - zero.X -= (float) num8 * 0.5f; - num6 = 800; - } - if (num7 < 600) - { - int num9 = 600 - num7; - zero.Y -= (float) num9 * 0.5f; - num7 = 600; - } - Main.SceneArea sceneArea = new Main.SceneArea() - { - bgTopY = 0, - totalWidth = (float) num6, - totalHeight = (float) num7, - SceneLocalScreenPositionOffset = zero - }; - this.DrawStarsInBackground(sceneArea); - if ((double) Main.screenPosition.Y / 16.0 < Main.worldSurface + 2.0) - this.DrawSunAndMoon(sceneArea, moonColor, sunColor, tempMushroomInfluence); this.DrawSurfaceBG(); Main.spriteBatch.End(); for (int index = 0; index < Main.numClouds; ++index) Main.cloud[index].position = vector2Array[index]; this.scAdj = scAdj; Main.mapFullscreen = mapFullscreen; - Main.screenWidth = screenWidth2; + Main.screenWidth = screenWidth4; Main.screenHeight = screenHeight2; Main.screenPosition = screenPosition2; } @@ -42283,9 +42295,9 @@ label_623: Main.tileBatch.Begin(); Main.spriteBatch.Begin(); if (biome == null) - this.DrawWater(true, Main.waterStyle); + this.drawWaters(true); else - this.DrawWater(true, Main.bloodMoon ? 9 : biome.WaterStyle); + this.drawWaters(true, Main.bloodMoon ? 9 : biome.WaterStyle, false); Main.tileBatch.End(); Main.spriteBatch.End(); if (captureBackground) @@ -42307,6 +42319,12 @@ label_623: this.DrawWoF(); Main.spriteBatch.End(); } + if (captureEntities) + { + Main.spriteBatch.Begin(); + this.DrawRain(); + Main.spriteBatch.End(); + } if (Main.drawBackGore & captureEntities) { Main.spriteBatch.Begin(); @@ -42321,48 +42339,34 @@ label_623: MoonlordDeathDrama.DrawExplosions(Main.spriteBatch); Main.spriteBatch.End(); } - bool flag = false; - bool intoRenderTargets1 = false; - bool intoRenderTargets2 = true; - this.TilesRenderer.PreDrawTiles(false, flag, intoRenderTargets2); + Main.tileBatch.Begin(); + Main.spriteBatch.Begin(); + if (biome == null) + this.DrawTiles(); + else + this.DrawTiles(waterStyleOverride: biome.WaterStyle); + Main.tileBatch.End(); + Main.spriteBatch.End(); Main.tileBatch.Begin(); Main.spriteBatch.Begin(); this.DrawCachedNPCs(this.DrawCacheNPCsBehindNonSolidTiles, true); - int waterStyleOverride = Main.bloodMoon ? 9 : biome.WaterStyle; if (biome == null) - this.DrawTiles(false, flag, intoRenderTargets1); + this.DrawTiles(false); else - this.DrawTiles(false, flag, intoRenderTargets1, waterStyleOverride); + this.DrawTiles(false, Main.bloodMoon ? 9 : biome.WaterStyle); Main.tileBatch.End(); Main.spriteBatch.End(); - this.DrawTileEntities(false, flag, intoRenderTargets1); if (captureEntities) { Main.spriteBatch.Begin(); - this.waterfallManager.FindWaterfalls(true); + this.waterfallManager.FindWaterfalls(); this.waterfallManager.Draw(Main.spriteBatch); Main.spriteBatch.End(); - } - if (captureEntities) - { + this.DrawPlayers(); this.DrawCachedProjs(this.DrawCacheProjsBehindNPCsAndTiles); Main.spriteBatch.Begin(); this.DrawNPCs(true); Main.spriteBatch.End(); - } - this.TilesRenderer.PreDrawTiles(true, flag, intoRenderTargets2); - Main.tileBatch.Begin(); - Main.spriteBatch.Begin(); - if (biome == null) - this.DrawTiles(true, flag, intoRenderTargets1); - else - this.DrawTiles(true, flag, intoRenderTargets1, waterStyleOverride); - Main.tileBatch.End(); - Main.spriteBatch.End(); - this.DrawTileEntities(true, flag, intoRenderTargets1); - if (captureEntities) - { - this.DrawPlayers_BehindNPCs(); this.DrawCachedProjs(this.DrawCacheProjsBehindNPCs); Main.spriteBatch.Begin(); this.DrawNPCs(); @@ -42370,31 +42374,21 @@ label_623: Main.spriteBatch.Begin(); this.DrawCachedNPCs(this.DrawCacheNPCProjectiles, false); Main.spriteBatch.End(); - this.DrawSuperSpecialProjectiles(this.DrawCacheFirstFractals); - this.DrawCachedProjs(this.DrawCacheProjsBehindProjectiles); - this.DrawProjectiles(); - this.DrawPlayers_AfterProjectiles(); - this.DrawCachedProjs(this.DrawCacheProjsOverPlayers); - Main.spriteBatch.Begin(); - this.DrawCachedNPCs(this.DrawCacheNPCsOverPlayers, false); - Main.spriteBatch.End(); Main.spriteBatch.Begin(); this.DrawItems(); Main.spriteBatch.End(); - Main.spriteBatch.Begin(); - this.DrawRain(); - Main.spriteBatch.End(); + this.DrawProjectiles(); + this.DrawDust(); Main.spriteBatch.Begin(); this.DrawGore(); Main.spriteBatch.End(); - this.DrawDust(); } Main.tileBatch.Begin(); Main.spriteBatch.Begin(); if (biome == null) - this.DrawWater(Style: Main.waterStyle); + this.drawWaters(); else - this.DrawWater(Style: biome.WaterStyle); + this.drawWaters(styleOverride: biome.WaterStyle, allowUpdate: false); if (captureMech) this.DrawWires(); Main.tileBatch.End(); @@ -42408,7 +42402,7 @@ label_623: for (int y3 = area.Y; y3 < area.Y + area.Height; ++y3) { if (!Main.Map.IsRevealed(x3, y3)) - Main.spriteBatch.Draw(TextureAssets.BlackTile.Value, new Vector2((float) x3 * 16f, (float) y3 * 16f) - Main.screenPosition, Microsoft.Xna.Framework.Color.Black); + Main.spriteBatch.Draw(Main.blackTileTexture, new Vector2((float) x3 * 16f, (float) y3 * 16f) - Main.screenPosition, Microsoft.Xna.Framework.Color.Black); } } Main.spriteBatch.End(); @@ -42417,13 +42411,12 @@ label_623: Main.screenWidth = screenWidth1; Main.screenHeight = screenHeight1; Main.screenPosition = screenPosition1; - Main.liquidAlpha = array; + Lighting.Initialize(true); Main.offScreenRange = offScreenRange; Main.cloudAlpha = cloudAlpha; - Main.bgAlphaFrontLayer = bgAlphaFrontLayer; - Main.bgAlphaFarBackLayer = alphaFarBackLayer; - Main.SceneMetrics.HolyTileCount = holyTileCount; - Lighting.Initialize(); + Main.bgAlpha = bgAlpha; + Main.bgAlpha2 = bgAlpha2; + Main.holyTiles = holyTiles; Main.GameViewMatrix = gameViewMatrix; } @@ -42435,21 +42428,21 @@ label_623: this.GraphicsDevice.SetRenderTarget(this.tileTarget); this.GraphicsDevice.Clear(Microsoft.Xna.Framework.Color.Transparent); Main.spriteBatch.Begin(); - try + if (Main.ignoreErrors) { - this.TilesRenderer.PreDrawTiles(true, false, true); - this.DrawTiles(true, false, true); - } - catch (Exception ex) - { - if (Main.ignoreErrors) + try + { + this.DrawTiles(); + } + catch (Exception ex) + { TimeLogger.DrawException(ex); - else - throw; + } } + else + this.DrawTiles(); TimeLogger.DetailedDrawReset(); Main.spriteBatch.End(); - this.DrawTileEntities(true, false, true); TimeLogger.DetailedDrawTime(28); this.GraphicsDevice.SetRenderTarget((RenderTarget2D) null); } @@ -42461,21 +42454,21 @@ label_623: this.GraphicsDevice.SetRenderTarget(this.tile2Target); this.GraphicsDevice.Clear(Microsoft.Xna.Framework.Color.Transparent); Main.spriteBatch.Begin(); - try + if (Main.ignoreErrors) { - this.TilesRenderer.PreDrawTiles(false, false, true); - this.DrawTiles(false, false, true); - } - catch (Exception ex) - { - if (Main.ignoreErrors) + try + { + this.DrawTiles(false); + } + catch (Exception ex) + { TimeLogger.DrawException(ex); - else - throw; + } } + else + this.DrawTiles(false); TimeLogger.DetailedDrawReset(); Main.spriteBatch.End(); - this.DrawTileEntities(false, false, true); TimeLogger.DetailedDrawTime(29); this.GraphicsDevice.SetRenderTarget((RenderTarget2D) null); } @@ -42489,7 +42482,7 @@ label_623: Main.spriteBatch.Begin(); try { - this.DrawWaters(); + this.drawWaters(); } catch { @@ -42500,73 +42493,498 @@ label_623: this.GraphicsDevice.SetRenderTarget((RenderTarget2D) null); } - public static int CalculateWaterStyle(bool ignoreFountains = false) + protected void drawWaters(bool bg = false, int styleOverride = -1, bool allowUpdate = true) { - if (Main.SceneMetrics.ActiveFountainColor >= 0 && !ignoreFountains) - return Main.SceneMetrics.ActiveFountainColor; - if (Main.bgStyle != 4 && Main.bloodMoon && !Main.dayTime) - return 9; - switch (Main.bgStyle) + if (!bg) { - case 1: - return 2; - case 2: - return (double) Main.player[Main.myPlayer].position.Y / 16.0 > Main.worldSurface ? 12 : 6; - case 3: - return 3; - case 5: - if (Main.SceneMetrics.EvilTileCount > Main.SceneMetrics.HolyTileCount && Main.SceneMetrics.EvilTileCount > Main.SceneMetrics.BloodTileCount) - return 2; - return Main.SceneMetrics.HolyTileCount > Main.SceneMetrics.BloodTileCount ? 4 : 10; - case 6: - return 4; - case 7: - return 5; - case 8: - return 10; - default: - return (double) Main.screenPosition.Y / 16.0 > Main.rockLayer + 40.0 ? (Main.player[Main.myPlayer].ZoneGlowshroom ? 7 : 8) : ((double) Main.screenPosition.Y / 16.0 > Main.worldSurface ? 7 : 0); + Main.waterStyle = Main.bgStyle != 1 ? (Main.bgStyle != 5 ? (Main.bgStyle != 5 || Main.bloodTiles <= Main.holyTiles ? (Main.bgStyle != 3 ? (Main.bgStyle != 8 ? (Main.bgStyle != 6 ? (Main.bgStyle != 7 ? (Main.bgStyle != 2 ? ((double) Main.screenPosition.Y / 16.0 <= Main.rockLayer + 40.0 ? ((double) Main.screenPosition.Y / 16.0 <= Main.worldSurface ? 0 : 7) : (Main.shroomTiles <= 300 ? 8 : 7)) : 6) : 5) : 4) : 10) : 3) : 10) : (Main.evilTiles <= Main.holyTiles ? (Main.bloodTiles <= Main.holyTiles ? 4 : 10) : (Main.bloodTiles <= Main.evilTiles ? 2 : 10))) : 2; + if (Main.bgStyle != 4 && Main.bloodMoon && !Main.dayTime) + Main.waterStyle = 9; + if (Main.fountainColor >= 0) + Main.waterStyle = Main.fountainColor; + if (Main.waterStyle == 0) + { + Main.liquidAlpha[2] -= 0.2f; + if ((double) Main.liquidAlpha[2] < 0.0) + Main.liquidAlpha[2] = 0.0f; + Main.liquidAlpha[3] -= 0.2f; + if ((double) Main.liquidAlpha[3] < 0.0) + Main.liquidAlpha[3] = 0.0f; + Main.liquidAlpha[4] -= 0.2f; + if ((double) Main.liquidAlpha[4] < 0.0) + Main.liquidAlpha[4] = 0.0f; + Main.liquidAlpha[5] -= 0.2f; + if ((double) Main.liquidAlpha[5] < 0.0) + Main.liquidAlpha[5] = 0.0f; + Main.liquidAlpha[6] -= 0.2f; + if ((double) Main.liquidAlpha[6] < 0.0) + Main.liquidAlpha[6] = 0.0f; + Main.liquidAlpha[7] -= 0.2f; + if ((double) Main.liquidAlpha[7] < 0.0) + Main.liquidAlpha[7] = 0.0f; + Main.liquidAlpha[8] -= 0.2f; + if ((double) Main.liquidAlpha[8] < 0.0) + Main.liquidAlpha[8] = 0.0f; + Main.liquidAlpha[9] -= 0.2f; + if ((double) Main.liquidAlpha[9] < 0.0) + Main.liquidAlpha[9] = 0.0f; + Main.liquidAlpha[10] -= 0.2f; + if ((double) Main.liquidAlpha[10] < 0.0) + Main.liquidAlpha[10] = 0.0f; + Main.liquidAlpha[0] += 0.2f; + if ((double) Main.liquidAlpha[0] > 1.0) + Main.liquidAlpha[0] = 1f; + } + if (Main.waterStyle == 2) + { + Main.liquidAlpha[0] -= 0.2f; + if ((double) Main.liquidAlpha[0] < 0.0) + Main.liquidAlpha[0] = 0.0f; + Main.liquidAlpha[3] -= 0.2f; + if ((double) Main.liquidAlpha[3] < 0.0) + Main.liquidAlpha[3] = 0.0f; + Main.liquidAlpha[4] -= 0.2f; + if ((double) Main.liquidAlpha[4] < 0.0) + Main.liquidAlpha[4] = 0.0f; + Main.liquidAlpha[5] -= 0.2f; + if ((double) Main.liquidAlpha[5] < 0.0) + Main.liquidAlpha[5] = 0.0f; + Main.liquidAlpha[6] -= 0.2f; + if ((double) Main.liquidAlpha[6] < 0.0) + Main.liquidAlpha[6] = 0.0f; + Main.liquidAlpha[7] -= 0.2f; + if ((double) Main.liquidAlpha[7] < 0.0) + Main.liquidAlpha[7] = 0.0f; + Main.liquidAlpha[8] -= 0.2f; + if ((double) Main.liquidAlpha[8] < 0.0) + Main.liquidAlpha[8] = 0.0f; + Main.liquidAlpha[9] -= 0.2f; + if ((double) Main.liquidAlpha[9] < 0.0) + Main.liquidAlpha[9] = 0.0f; + Main.liquidAlpha[10] -= 0.2f; + if ((double) Main.liquidAlpha[10] < 0.0) + Main.liquidAlpha[10] = 0.0f; + Main.liquidAlpha[2] += 0.2f; + if ((double) Main.liquidAlpha[2] > 1.0) + Main.liquidAlpha[2] = 1f; + } + if (Main.waterStyle == 3) + { + Main.liquidAlpha[0] -= 0.2f; + if ((double) Main.liquidAlpha[0] < 0.0) + Main.liquidAlpha[0] = 0.0f; + Main.liquidAlpha[2] -= 0.2f; + if ((double) Main.liquidAlpha[2] < 0.0) + Main.liquidAlpha[2] = 0.0f; + Main.liquidAlpha[4] -= 0.2f; + if ((double) Main.liquidAlpha[4] < 0.0) + Main.liquidAlpha[4] = 0.0f; + Main.liquidAlpha[5] -= 0.2f; + if ((double) Main.liquidAlpha[5] < 0.0) + Main.liquidAlpha[5] = 0.0f; + Main.liquidAlpha[6] -= 0.2f; + if ((double) Main.liquidAlpha[6] < 0.0) + Main.liquidAlpha[6] = 0.0f; + Main.liquidAlpha[7] -= 0.2f; + if ((double) Main.liquidAlpha[7] < 0.0) + Main.liquidAlpha[7] = 0.0f; + Main.liquidAlpha[8] -= 0.2f; + if ((double) Main.liquidAlpha[8] < 0.0) + Main.liquidAlpha[8] = 0.0f; + Main.liquidAlpha[9] -= 0.2f; + if ((double) Main.liquidAlpha[9] < 0.0) + Main.liquidAlpha[9] = 0.0f; + Main.liquidAlpha[10] -= 0.2f; + if ((double) Main.liquidAlpha[10] < 0.0) + Main.liquidAlpha[10] = 0.0f; + Main.liquidAlpha[3] += 0.2f; + if ((double) Main.liquidAlpha[3] > 1.0) + Main.liquidAlpha[3] = 1f; + } + if (Main.waterStyle == 4) + { + Main.liquidAlpha[0] -= 0.2f; + if ((double) Main.liquidAlpha[0] < 0.0) + Main.liquidAlpha[0] = 0.0f; + Main.liquidAlpha[2] -= 0.2f; + if ((double) Main.liquidAlpha[2] < 0.0) + Main.liquidAlpha[2] = 0.0f; + Main.liquidAlpha[3] -= 0.2f; + if ((double) Main.liquidAlpha[3] < 0.0) + Main.liquidAlpha[3] = 0.0f; + Main.liquidAlpha[5] -= 0.2f; + if ((double) Main.liquidAlpha[5] < 0.0) + Main.liquidAlpha[5] = 0.0f; + Main.liquidAlpha[6] -= 0.2f; + if ((double) Main.liquidAlpha[6] < 0.0) + Main.liquidAlpha[6] = 0.0f; + Main.liquidAlpha[7] -= 0.2f; + if ((double) Main.liquidAlpha[7] < 0.0) + Main.liquidAlpha[7] = 0.0f; + Main.liquidAlpha[8] -= 0.2f; + if ((double) Main.liquidAlpha[8] < 0.0) + Main.liquidAlpha[8] = 0.0f; + Main.liquidAlpha[9] -= 0.2f; + if ((double) Main.liquidAlpha[9] < 0.0) + Main.liquidAlpha[9] = 0.0f; + Main.liquidAlpha[10] -= 0.2f; + if ((double) Main.liquidAlpha[10] < 0.0) + Main.liquidAlpha[10] = 0.0f; + Main.liquidAlpha[4] += 0.2f; + if ((double) Main.liquidAlpha[4] > 1.0) + Main.liquidAlpha[4] = 1f; + } + if (Main.waterStyle == 5) + { + Main.liquidAlpha[0] -= 0.2f; + if ((double) Main.liquidAlpha[0] < 0.0) + Main.liquidAlpha[0] = 0.0f; + Main.liquidAlpha[2] -= 0.2f; + if ((double) Main.liquidAlpha[2] < 0.0) + Main.liquidAlpha[2] = 0.0f; + Main.liquidAlpha[3] -= 0.2f; + if ((double) Main.liquidAlpha[3] < 0.0) + Main.liquidAlpha[3] = 0.0f; + Main.liquidAlpha[4] -= 0.2f; + if ((double) Main.liquidAlpha[4] < 0.0) + Main.liquidAlpha[4] = 0.0f; + Main.liquidAlpha[6] -= 0.2f; + if ((double) Main.liquidAlpha[6] < 0.0) + Main.liquidAlpha[6] = 0.0f; + Main.liquidAlpha[7] -= 0.2f; + if ((double) Main.liquidAlpha[7] < 0.0) + Main.liquidAlpha[7] = 0.0f; + Main.liquidAlpha[8] -= 0.2f; + if ((double) Main.liquidAlpha[8] < 0.0) + Main.liquidAlpha[8] = 0.0f; + Main.liquidAlpha[9] -= 0.2f; + if ((double) Main.liquidAlpha[9] < 0.0) + Main.liquidAlpha[9] = 0.0f; + Main.liquidAlpha[10] -= 0.2f; + if ((double) Main.liquidAlpha[10] < 0.0) + Main.liquidAlpha[10] = 0.0f; + Main.liquidAlpha[5] += 0.2f; + if ((double) Main.liquidAlpha[5] > 1.0) + Main.liquidAlpha[5] = 1f; + } + if (Main.waterStyle == 6) + { + Main.liquidAlpha[0] -= 0.2f; + if ((double) Main.liquidAlpha[0] < 0.0) + Main.liquidAlpha[0] = 0.0f; + Main.liquidAlpha[2] -= 0.2f; + if ((double) Main.liquidAlpha[2] < 0.0) + Main.liquidAlpha[2] = 0.0f; + Main.liquidAlpha[3] -= 0.2f; + if ((double) Main.liquidAlpha[3] < 0.0) + Main.liquidAlpha[3] = 0.0f; + Main.liquidAlpha[4] -= 0.2f; + if ((double) Main.liquidAlpha[4] < 0.0) + Main.liquidAlpha[4] = 0.0f; + Main.liquidAlpha[5] -= 0.2f; + if ((double) Main.liquidAlpha[5] < 0.0) + Main.liquidAlpha[5] = 0.0f; + Main.liquidAlpha[7] -= 0.2f; + if ((double) Main.liquidAlpha[7] < 0.0) + Main.liquidAlpha[7] = 0.0f; + Main.liquidAlpha[8] -= 0.2f; + if ((double) Main.liquidAlpha[8] < 0.0) + Main.liquidAlpha[8] = 0.0f; + Main.liquidAlpha[9] -= 0.2f; + if ((double) Main.liquidAlpha[9] < 0.0) + Main.liquidAlpha[9] = 0.0f; + Main.liquidAlpha[10] -= 0.2f; + if ((double) Main.liquidAlpha[10] < 0.0) + Main.liquidAlpha[10] = 0.0f; + Main.liquidAlpha[6] += 0.2f; + if ((double) Main.liquidAlpha[6] > 1.0) + Main.liquidAlpha[6] = 1f; + } + if (Main.waterStyle == 7) + { + Main.liquidAlpha[0] -= 0.2f; + if ((double) Main.liquidAlpha[0] < 0.0) + Main.liquidAlpha[0] = 0.0f; + Main.liquidAlpha[2] -= 0.2f; + if ((double) Main.liquidAlpha[2] < 0.0) + Main.liquidAlpha[2] = 0.0f; + Main.liquidAlpha[3] -= 0.2f; + if ((double) Main.liquidAlpha[3] < 0.0) + Main.liquidAlpha[3] = 0.0f; + Main.liquidAlpha[4] -= 0.2f; + if ((double) Main.liquidAlpha[4] < 0.0) + Main.liquidAlpha[4] = 0.0f; + Main.liquidAlpha[5] -= 0.2f; + if ((double) Main.liquidAlpha[5] < 0.0) + Main.liquidAlpha[5] = 0.0f; + Main.liquidAlpha[6] -= 0.2f; + if ((double) Main.liquidAlpha[6] < 0.0) + Main.liquidAlpha[6] = 0.0f; + Main.liquidAlpha[8] -= 0.2f; + if ((double) Main.liquidAlpha[8] < 0.0) + Main.liquidAlpha[8] = 0.0f; + Main.liquidAlpha[9] -= 0.2f; + if ((double) Main.liquidAlpha[9] < 0.0) + Main.liquidAlpha[9] = 0.0f; + Main.liquidAlpha[10] -= 0.2f; + if ((double) Main.liquidAlpha[10] < 0.0) + Main.liquidAlpha[10] = 0.0f; + Main.liquidAlpha[7] += 0.2f; + if ((double) Main.liquidAlpha[7] > 1.0) + Main.liquidAlpha[7] = 1f; + } + if (Main.waterStyle == 8) + { + Main.liquidAlpha[0] -= 0.2f; + if ((double) Main.liquidAlpha[0] < 0.0) + Main.liquidAlpha[0] = 0.0f; + Main.liquidAlpha[2] -= 0.2f; + if ((double) Main.liquidAlpha[2] < 0.0) + Main.liquidAlpha[2] = 0.0f; + Main.liquidAlpha[3] -= 0.2f; + if ((double) Main.liquidAlpha[3] < 0.0) + Main.liquidAlpha[3] = 0.0f; + Main.liquidAlpha[4] -= 0.2f; + if ((double) Main.liquidAlpha[4] < 0.0) + Main.liquidAlpha[4] = 0.0f; + Main.liquidAlpha[5] -= 0.2f; + if ((double) Main.liquidAlpha[5] < 0.0) + Main.liquidAlpha[5] = 0.0f; + Main.liquidAlpha[6] -= 0.2f; + if ((double) Main.liquidAlpha[6] < 0.0) + Main.liquidAlpha[6] = 0.0f; + Main.liquidAlpha[7] -= 0.2f; + if ((double) Main.liquidAlpha[7] < 0.0) + Main.liquidAlpha[7] = 0.0f; + Main.liquidAlpha[9] -= 0.2f; + if ((double) Main.liquidAlpha[9] < 0.0) + Main.liquidAlpha[9] = 0.0f; + Main.liquidAlpha[10] -= 0.2f; + if ((double) Main.liquidAlpha[10] < 0.0) + Main.liquidAlpha[10] = 0.0f; + Main.liquidAlpha[8] += 0.2f; + if ((double) Main.liquidAlpha[8] > 1.0) + Main.liquidAlpha[8] = 1f; + } + if (Main.waterStyle == 9) + { + Main.liquidAlpha[0] -= 0.2f; + if ((double) Main.liquidAlpha[0] < 0.0) + Main.liquidAlpha[0] = 0.0f; + Main.liquidAlpha[2] -= 0.2f; + if ((double) Main.liquidAlpha[2] < 0.0) + Main.liquidAlpha[2] = 0.0f; + Main.liquidAlpha[3] -= 0.2f; + if ((double) Main.liquidAlpha[3] < 0.0) + Main.liquidAlpha[3] = 0.0f; + Main.liquidAlpha[4] -= 0.2f; + if ((double) Main.liquidAlpha[4] < 0.0) + Main.liquidAlpha[4] = 0.0f; + Main.liquidAlpha[5] -= 0.2f; + if ((double) Main.liquidAlpha[5] < 0.0) + Main.liquidAlpha[5] = 0.0f; + Main.liquidAlpha[6] -= 0.2f; + if ((double) Main.liquidAlpha[6] < 0.0) + Main.liquidAlpha[6] = 0.0f; + Main.liquidAlpha[7] -= 0.2f; + if ((double) Main.liquidAlpha[7] < 0.0) + Main.liquidAlpha[7] = 0.0f; + Main.liquidAlpha[8] -= 0.2f; + if ((double) Main.liquidAlpha[8] < 0.0) + Main.liquidAlpha[8] = 0.0f; + Main.liquidAlpha[10] -= 0.2f; + if ((double) Main.liquidAlpha[10] < 0.0) + Main.liquidAlpha[10] = 0.0f; + Main.liquidAlpha[9] += 0.2f; + if ((double) Main.liquidAlpha[9] > 1.0) + Main.liquidAlpha[9] = 1f; + } + if (Main.waterStyle == 10) + { + Main.liquidAlpha[0] -= 0.2f; + if ((double) Main.liquidAlpha[0] < 0.0) + Main.liquidAlpha[0] = 0.0f; + Main.liquidAlpha[2] -= 0.2f; + if ((double) Main.liquidAlpha[2] < 0.0) + Main.liquidAlpha[2] = 0.0f; + Main.liquidAlpha[3] -= 0.2f; + if ((double) Main.liquidAlpha[3] < 0.0) + Main.liquidAlpha[3] = 0.0f; + Main.liquidAlpha[4] -= 0.2f; + if ((double) Main.liquidAlpha[4] < 0.0) + Main.liquidAlpha[4] = 0.0f; + Main.liquidAlpha[5] -= 0.2f; + if ((double) Main.liquidAlpha[5] < 0.0) + Main.liquidAlpha[5] = 0.0f; + Main.liquidAlpha[6] -= 0.2f; + if ((double) Main.liquidAlpha[6] < 0.0) + Main.liquidAlpha[6] = 0.0f; + Main.liquidAlpha[7] -= 0.2f; + if ((double) Main.liquidAlpha[7] < 0.0) + Main.liquidAlpha[7] = 0.0f; + Main.liquidAlpha[8] -= 0.2f; + if ((double) Main.liquidAlpha[8] < 0.0) + Main.liquidAlpha[8] = 0.0f; + Main.liquidAlpha[9] -= 0.2f; + if ((double) Main.liquidAlpha[9] < 0.0) + Main.liquidAlpha[9] = 0.0f; + Main.liquidAlpha[10] += 0.2f; + if ((double) Main.liquidAlpha[10] > 1.0) + Main.liquidAlpha[10] = 1f; + } } - } - - public static bool IsLiquidStyleWater(int liquidStyle) => liquidStyle != 1 && liquidStyle != 11; - - private void DrawWaters(bool isBackground = false) - { Main.drewLava = false; - if (!isBackground) + if (!Main.drawToScreen) { - Main.waterStyle = Main.CalculateWaterStyle(); - for (int index = 0; index < 13; ++index) + if ((!bg ^ styleOverride != -1) & allowUpdate) { - if (Main.IsLiquidStyleWater(Main.waterStyle)) - Main.liquidAlpha[index] = Main.waterStyle == index ? Math.Min(Main.liquidAlpha[index] + 0.2f, 1f) : Math.Max(Main.liquidAlpha[index] - 0.2f, 0.0f); + Vector2 vector2_1 = Main.drawToScreen ? Vector2.Zero : new Vector2((float) Main.offScreenRange, (float) Main.offScreenRange); + int val1_1 = (int) (((double) Main.screenPosition.X - (double) vector2_1.X) / 16.0 - 1.0); + int val1_2 = (int) (((double) Main.screenPosition.X + (double) Main.screenWidth + (double) vector2_1.X) / 16.0) + 2; + int val1_3 = (int) (((double) Main.screenPosition.Y - (double) vector2_1.Y) / 16.0 - 1.0); + int val1_4 = (int) (((double) Main.screenPosition.Y + (double) Main.screenHeight + (double) vector2_1.Y) / 16.0) + 5; + Vector2 vector2_2 = vector2_1 - Main.screenPosition; + int x = Math.Max(val1_1, 5) - 2; + int y = Math.Max(val1_3, 5); + int num1 = Math.Min(val1_2, Main.maxTilesX - 5) + 2; + int num2 = Math.Min(val1_4, Main.maxTilesY - 5) + 4; + Microsoft.Xna.Framework.Rectangle drawArea = new Microsoft.Xna.Framework.Rectangle(x, y, num1 - x, num2 - y); + LiquidRenderer.Instance.PrepareDraw(drawArea); + } + if (styleOverride != -1) + { + this.DrawWater(bg, styleOverride); + } + else + { + for (int Style = 0; Style < 11; ++Style) + { + if (Style != 1 && (double) Main.liquidAlpha[Style] > 0.0) + this.DrawWater(bg, Style, Main.liquidAlpha[Style]); + } } } - if (!Main.drawToScreen && !isBackground) + else if (styleOverride != -1) { - Vector2 vector2 = Main.drawToScreen ? Vector2.Zero : new Vector2((float) Main.offScreenRange, (float) Main.offScreenRange); - int val1_1 = (int) (((double) Main.Camera.ScaledPosition.X - (double) vector2.X) / 16.0 - 1.0); - int val1_2 = (int) (((double) Main.Camera.ScaledPosition.X + (double) Main.Camera.ScaledSize.X + (double) vector2.X) / 16.0) + 2; - int val1_3 = (int) (((double) Main.Camera.ScaledPosition.Y - (double) vector2.Y) / 16.0 - 1.0); - int val1_4 = (int) (((double) Main.Camera.ScaledPosition.Y + (double) Main.Camera.ScaledSize.Y + (double) vector2.Y) / 16.0) + 5; - int x = Math.Max(val1_1, 5) - 2; - int y = Math.Max(val1_3, 5); - int num1 = Math.Min(val1_2, Main.maxTilesX - 5) + 2; - int num2 = Math.Min(val1_4, Main.maxTilesY - 5) + 4; - Microsoft.Xna.Framework.Rectangle drawArea = new Microsoft.Xna.Framework.Rectangle(x, y, num1 - x, num2 - y); - LiquidRenderer.Instance.PrepareDraw(drawArea); + this.DrawWater(bg, styleOverride); } - bool flag = false; - for (int index = 0; index < 13; ++index) + else { - if (Main.IsLiquidStyleWater(index) && (double) Main.liquidAlpha[index] > 0.0 && index != Main.waterStyle) + if ((double) Main.liquidAlpha[0] > 0.0) { - this.DrawWater(isBackground, index, isBackground ? 1f : Main.liquidAlpha[index]); - flag = true; + if (bg) + this.DrawWater(bg); + else + this.DrawWater(bg, Alpha: Main.liquidAlpha[0]); } + if ((double) Main.liquidAlpha[2] > 0.0) + { + if (bg) + { + if (Main.waterStyle < 2) + this.DrawWater(bg, 2, Main.liquidAlpha[2]); + else + this.DrawWater(bg, 2); + } + else + this.DrawWater(bg, 2, Main.liquidAlpha[2]); + } + if ((double) Main.liquidAlpha[3] > 0.0) + { + if (bg) + { + if (Main.waterStyle < 3) + this.DrawWater(bg, 3, Main.liquidAlpha[3]); + else + this.DrawWater(bg, 3); + } + else + this.DrawWater(bg, 3, Main.liquidAlpha[3]); + } + if ((double) Main.liquidAlpha[4] > 0.0) + { + if (bg) + { + if (Main.waterStyle < 4) + this.DrawWater(bg, 4, Main.liquidAlpha[4]); + else + this.DrawWater(bg, 4); + } + else + this.DrawWater(bg, 4, Main.liquidAlpha[4]); + } + if ((double) Main.liquidAlpha[5] > 0.0) + { + if (bg) + { + if (Main.waterStyle < 5) + this.DrawWater(bg, 5, Main.liquidAlpha[5]); + else + this.DrawWater(bg, 5); + } + else + this.DrawWater(bg, 5, Main.liquidAlpha[5]); + } + if ((double) Main.liquidAlpha[6] > 0.0) + { + if (bg) + { + if (Main.waterStyle < 6) + this.DrawWater(bg, 6, Main.liquidAlpha[6]); + else + this.DrawWater(bg, 6); + } + else + this.DrawWater(bg, 6, Main.liquidAlpha[6]); + } + if ((double) Main.liquidAlpha[7] > 0.0) + { + if (bg) + { + if (Main.waterStyle < 7) + this.DrawWater(bg, 7, Main.liquidAlpha[7]); + else + this.DrawWater(bg, 7); + } + else + this.DrawWater(bg, 7, Main.liquidAlpha[7]); + } + if ((double) Main.liquidAlpha[8] > 0.0) + { + if (bg) + { + if (Main.waterStyle < 8) + this.DrawWater(bg, 8, Main.liquidAlpha[8]); + else + this.DrawWater(bg, 8); + } + else + this.DrawWater(bg, 8, Main.liquidAlpha[8]); + } + if ((double) Main.liquidAlpha[9] > 0.0) + { + if (bg) + { + if (Main.waterStyle < 9) + this.DrawWater(bg, 9, Main.liquidAlpha[9]); + else + this.DrawWater(bg, 9); + } + else + this.DrawWater(bg, 9, Main.liquidAlpha[9]); + } + if ((double) Main.liquidAlpha[10] <= 0.0) + return; + if (bg) + { + if (Main.waterStyle < 10) + this.DrawWater(bg, 10, Main.liquidAlpha[10]); + else + this.DrawWater(bg, 10); + } + else + this.DrawWater(bg, 10, Main.liquidAlpha[10]); } - this.DrawWater(isBackground, Main.waterStyle, flag ? Main.liquidAlpha[Main.waterStyle] : 1f); } protected void DrawWater(bool bg = false, int Style = 0, float Alpha = 1f) @@ -42587,19 +43005,6 @@ label_623: } } - public static void DrawTileInWater(Vector2 drawOffset, int x, int y) - { - if (Main.tile[x, y] == null || !Main.tile[x, y].active() || Main.tile[x, y].type != (ushort) 518) - return; - Main.instance.LoadTiles((int) Main.tile[x, y].type); - Tile tile = Main.tile[x, y]; - int num = (int) tile.liquid / 16 - 3; - if (WorldGen.SolidTile(x, y - 1) && num > 8) - num = 8; - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle((int) tile.frameX, (int) tile.frameY, 16, 16); - Main.spriteBatch.Draw(TextureAssets.Tile[(int) tile.type].Value, new Vector2((float) (x * 16), (float) (y * 16 - num)) + drawOffset, new Microsoft.Xna.Framework.Rectangle?(rectangle), Lighting.GetColor(x, y), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - } - public void oldDrawWater(bool bg = false, int Style = 0, float Alpha = 1f) { float num1 = 0.0f; @@ -42675,7 +43080,6 @@ label_623: num15 = 1f; if (index1 != 1 && index1 != 11) num15 *= Alpha; - Main.DrawTileInWater(-Main.screenPosition + vector2_1, x, y); Vector2 vector2_2 = new Vector2((float) (x * 16), (float) (y * 16 + (int) num11 * 2)); Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, 0, 16, 16 - (int) num11 * 2); if (Main.tile[x, y + 1].liquid < (byte) 245 && (!Main.tile[x, y + 1].nactive() || !Main.tileSolid[(int) Main.tile[x, y + 1].type] || Main.tileSolidTop[(int) Main.tile[x, y + 1].type])) @@ -42837,24 +43241,24 @@ label_623: color3.G = (byte) (((int) color2.G * 3 + (int) color4.G * 2) / 5); color3.B = (byte) (((int) color2.B * 3 + (int) color4.B * 2) / 5); color3.A = (byte) (((int) color2.A * 3 + (int) color4.A * 2) / 5); - Main.spriteBatch.Draw(TextureAssets.Liquid[index1].Value, vector2_2 - Main.screenPosition + new Vector2((float) num20, (float) num21) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(rectangle.X + num20, rectangle.Y + num21, width, height)), color3, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.liquidTexture[index1], vector2_2 - Main.screenPosition + new Vector2((float) num20, (float) num21) + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(rectangle.X + num20, rectangle.Y + num21, width, height)), color3, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } } else - Main.spriteBatch.Draw(TextureAssets.Liquid[index1].Value, vector2_2 - Main.screenPosition + vector2_1, new Microsoft.Xna.Framework.Rectangle?(rectangle), color1, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.liquidTexture[index1], vector2_2 - Main.screenPosition + vector2_1, new Microsoft.Xna.Framework.Rectangle?(rectangle), color1, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } else { if (rectangle.Y < 4) rectangle.X += (int) ((double) Main.wFrame * 18.0); - Main.spriteBatch.Draw(TextureAssets.Liquid[index1].Value, vector2_2 - Main.screenPosition + vector2_1, new Microsoft.Xna.Framework.Rectangle?(rectangle), color1, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.liquidTexture[index1], vector2_2 - Main.screenPosition + vector2_1, new Microsoft.Xna.Framework.Rectangle?(rectangle), color1, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } if (Main.tile[x, y + 1].halfBrick()) { color1 = Lighting.GetColor(x, y + 1); color1 = new Microsoft.Xna.Framework.Color((int) (byte) ((float) color1.R * num15), (int) (byte) ((float) color1.G * num15), (int) (byte) ((float) color1.B * num15), (int) (byte) ((float) color1.A * num15)); vector2_2 = new Vector2((float) (x * 16), (float) (y * 16 + 16)); - Main.spriteBatch.Draw(TextureAssets.Liquid[index1].Value, vector2_2 - Main.screenPosition + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 4, 16, 8)), color1, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.liquidTexture[index1], vector2_2 - Main.screenPosition + vector2_1, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 4, 16, 8)), color1, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } } } @@ -42878,7 +43282,7 @@ label_623: return false; int frameX = (int) tile.frameX; int frameY = (int) tile.frameY; - if (Main.tileLargeFrames[(int) tile.type] > (byte) 0) + if (Main.tileLargeFrames[(int) tile.type] == (byte) 1) { if ((frameY == 18 || frameY == 108) && (frameX >= 18 && frameX <= 54 || frameX >= 108 && frameX <= 144)) return true; @@ -42900,9 +43304,9 @@ label_623: Vector2 vector2 = Main.drawToScreen ? Vector2.Zero : new Vector2((float) Main.offScreenRange, (float) Main.offScreenRange); int num1 = ((int) Main.tileColor.R + (int) Main.tileColor.G + (int) Main.tileColor.B) / 3; float num2 = (float) num1 * 0.4f / (float) byte.MaxValue; - switch (Lighting.Mode) + switch (Lighting.lightMode) { - case LightMode.Retro: + case 2: num2 = (float) ((int) Main.tileColor.R - 55) / (float) byte.MaxValue; if ((double) num2 < 0.0) { @@ -42910,7 +43314,7 @@ label_623: break; } break; - case LightMode.Trippy: + case 3: num2 = (float) (num1 - 55) / (float) byte.MaxValue; if ((double) num2 < 0.0) { @@ -42919,20 +43323,19 @@ label_623: } break; } - Microsoft.Xna.Framework.Point screenOverdrawOffset = Main.GetScreenOverdrawOffset(); - Microsoft.Xna.Framework.Point point = new Microsoft.Xna.Framework.Point(-Main.offScreenRange / 16 + screenOverdrawOffset.X, -Main.offScreenRange / 16 + screenOverdrawOffset.Y); - int num3 = (int) (((double) Main.screenPosition.X - (double) vector2.X) / 16.0 - 1.0) + point.X; - int num4 = (int) (((double) Main.screenPosition.X + (double) Main.screenWidth + (double) vector2.X) / 16.0) + 2 - point.X; - int val1_1 = (int) (((double) Main.screenPosition.Y - (double) vector2.Y) / 16.0 - 1.0) + point.Y; - int val1_2 = (int) (((double) Main.screenPosition.Y + (double) Main.screenHeight + (double) vector2.Y) / 16.0) + 5 - point.Y; - if (num3 < 0) - num3 = point.X; - if (num4 > Main.maxTilesX) - num4 = Main.maxTilesX - point.X; + int num3 = Main.offScreenRange / 16; + int num4 = (int) (((double) Main.screenPosition.X - (double) vector2.X) / 16.0 - 1.0) - num3; + int num5 = (int) (((double) Main.screenPosition.X + (double) Main.screenWidth + (double) vector2.X) / 16.0) + 2 + num3; + int val1_1 = (int) (((double) Main.screenPosition.Y - (double) vector2.Y) / 16.0 - 1.0) - num3; + int val1_2 = (int) (((double) Main.screenPosition.Y + (double) Main.screenHeight + (double) vector2.Y) / 16.0) + 5 + num3; + if (num4 < 0) + num4 = num3; + if (num5 > Main.maxTilesX) + num5 = Main.maxTilesX - num3; if (val1_1 < 0) - val1_1 = point.Y; + val1_1 = num3; if (val1_2 > Main.maxTilesY) - val1_2 = Main.maxTilesY - point.Y; + val1_2 = Main.maxTilesY - num3; if (!force) { if (val1_1 < Main.maxTilesY / 2) @@ -42942,32 +43345,30 @@ label_623: } else { - val1_2 = Math.Max(val1_2, Main.UnderworldLayer); - val1_1 = Math.Max(val1_1, Main.UnderworldLayer); + val1_2 = Math.Max(val1_2, Main.maxTilesY - 200); + val1_1 = Math.Max(val1_1, Main.maxTilesY - 200); } } for (int y = val1_1; y < val1_2; ++y) { - bool flag = y >= Main.UnderworldLayer; + bool flag = y >= Main.maxTilesY - 200; if (flag) num2 = 0.2f; - for (int x = num3; x < num4; ++x) + for (int x = num4; x < num5; ++x) { - int num5 = x; - for (; x < num4; ++x) + int num6 = x; + for (; x < num5; ++x) { - if (!WorldGen.InWorld(x, y)) - return; if (Main.tile[x, y] == null) Main.tile[x, y] = new Tile(); Tile testTile = Main.tile[x, y]; - float num6 = (float) Math.Floor((double) Lighting.Brightness(x, y) * (double) byte.MaxValue) / (float) byte.MaxValue; + float num7 = (float) Math.Floor((double) Lighting.Brightness(x, y) * (double) byte.MaxValue) / (float) byte.MaxValue; byte liquid = testTile.liquid; - if (((((double) num6 > (double) num2 ? 0 : (!flag && liquid < (byte) 250 || WorldGen.SolidTile(testTile) ? 1 : (liquid < (byte) 200 ? 0 : ((double) num6 == 0.0 ? 1 : 0)))) == 0 ? 0 : (!WallID.Sets.Transparent[(int) testTile.wall] ? 1 : (!Main.tile[x, y].active() ? 0 : (Main.tileBlockLight[(int) testTile.type] ? 1 : 0)))) == 0 ? 0 : (Main.drawToScreen || !LiquidRenderer.Instance.HasFullWater(x, y) || testTile.wall != (ushort) 0 || testTile.halfBrick() ? 1 : ((double) y <= Main.worldSurface ? 1 : 0))) == 0) + if (((((double) num7 > (double) num2 ? 0 : (!flag && liquid < (byte) 250 || WorldGen.SolidTile(testTile) ? 1 : (liquid < (byte) 200 ? 0 : ((double) num7 == 0.0 ? 1 : 0)))) == 0 ? 0 : (!WallID.Sets.Transparent[(int) testTile.wall] ? 1 : (!Main.tile[x, y].active() ? 0 : (Main.tileBlockLight[(int) testTile.type] ? 1 : 0)))) == 0 ? 0 : (Lighting.LightingDrawToScreen || !LiquidRenderer.Instance.HasFullWater(x, y) || testTile.wall != (byte) 0 || testTile.halfBrick() ? 1 : ((double) y <= Main.worldSurface ? 1 : 0))) == 0) break; } - if (x - num5 > 0) - Main.spriteBatch.Draw(TextureAssets.BlackTile.Value, new Vector2((float) (num5 << 4), (float) (y << 4)) - Main.screenPosition + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, x - num5 << 4, 16)), Microsoft.Xna.Framework.Color.Black); + if (x - num6 > 0) + Main.spriteBatch.Draw(Main.blackTileTexture, new Vector2((float) (num6 << 4), (float) (y << 4)) - Main.screenPosition + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, x - num6 << 4, 16)), Microsoft.Xna.Framework.Color.Black); } } TimeLogger.DrawTime(5, stopwatch.Elapsed.TotalMilliseconds); @@ -42991,7 +43392,104 @@ label_623: this.GraphicsDevice.SetRenderTarget((RenderTarget2D) null); } - protected void DrawWalls() => this.WallsRenderer.DrawWalls(); + protected void DrawWalls() + { + Stopwatch stopwatch = new Stopwatch(); + stopwatch.Start(); + int num1 = (int) (120.0 * (1.0 - (double) Main.gfxQuality) + 40.0 * (double) Main.gfxQuality); + Vector2 vector2 = new Vector2((float) Main.offScreenRange, (float) Main.offScreenRange); + if (Main.drawToScreen) + vector2 = Vector2.Zero; + int num2 = (int) (((double) Main.screenPosition.X - (double) vector2.X) / 16.0 - 1.0); + int num3 = (int) (((double) Main.screenPosition.X + (double) Main.screenWidth + (double) vector2.X) / 16.0) + 2; + int num4 = (int) (((double) Main.screenPosition.Y - (double) vector2.Y) / 16.0 - 1.0); + int num5 = (int) (((double) Main.screenPosition.Y + (double) Main.screenHeight + (double) vector2.Y) / 16.0) + 5; + int num6 = Main.offScreenRange / 16; + int num7 = Main.offScreenRange / 16; + if (num2 - num6 < 4) + num2 = num6 + 4; + if (num3 + num6 > Main.maxTilesX - 4) + num3 = Main.maxTilesX - num6 - 4; + if (num4 - num7 < 4) + num4 = num7 + 4; + if (num5 + num7 > Main.maxTilesY - 4) + num5 = Main.maxTilesY - num7 - 4; + int num8 = Main.maxTilesY - 200; + for (int index1 = num4 - num7; index1 < num5 + num7; ++index1) + { + for (int index2 = num2 - num6; index2 < num3 + num6; ++index2) + { + Tile testTile = Main.tile[index2, index1]; + if (testTile == null) + { + testTile = new Tile(); + Main.tile[index2, index1] = testTile; + } + byte wall = testTile.wall; + if (wall > (byte) 0 && !this.FullTile(index2, index1)) + { + Microsoft.Xna.Framework.Color color1 = Lighting.GetColor(index2, index1); + if (color1.R != (byte) 0 || color1.G != (byte) 0 || color1.B != (byte) 0 || index1 >= num8) + { + this.LoadWall((int) wall); + int num9 = (int) Main.wallFrame[(int) wall] * 180; + Microsoft.Xna.Framework.Rectangle rectangle; + if (Lighting.NotRetro && !Main.wallLight[(int) wall] && (testTile.wall < (byte) 88 || testTile.wall > (byte) 93) && !WorldGen.SolidTile(testTile)) + { + Texture2D texture = !Main.canDrawColorWall(index2, index1) ? Main.wallTexture[(int) testTile.wall] : (Texture2D) Main.wallAltTexture[(int) testTile.wall, (int) testTile.wallColor()]; + VertexColors vertices; + if (testTile.wall == (byte) 44) + { + Microsoft.Xna.Framework.Color color2 = new Microsoft.Xna.Framework.Color((int) (byte) Main.DiscoR, (int) (byte) Main.DiscoG, (int) (byte) Main.DiscoB); + vertices.BottomLeftColor = color2; + vertices.BottomRightColor = color2; + vertices.TopLeftColor = color2; + vertices.TopRightColor = color2; + } + else + Lighting.GetColor4Slice_New(index2, index1, out vertices); + Main.tileBatch.Draw(texture, new Vector2((float) (index2 * 16 - (int) Main.screenPosition.X - 8), (float) (index1 * 16 - (int) Main.screenPosition.Y - 8)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(testTile.wallFrameX(), testTile.wallFrameY() + num9, 32, 32)), vertices, Vector2.Zero, 1f, SpriteEffects.None); + } + else if (testTile.wall == (byte) 44) + { + Microsoft.Xna.Framework.Color color3 = new Microsoft.Xna.Framework.Color(); + color3.R = (byte) Main.DiscoR; + color3.G = (byte) Main.DiscoG; + color3.B = (byte) Main.DiscoB; + color3.A = byte.MaxValue; + rectangle = new Microsoft.Xna.Framework.Rectangle(testTile.wallFrameX(), testTile.wallFrameY() + num9, 32, 32); + Main.spriteBatch.Draw(Main.wallTexture[(int) testTile.wall], new Vector2((float) (index2 * 16 - (int) Main.screenPosition.X - 8), (float) (index1 * 16 - (int) Main.screenPosition.Y - 8)) + vector2, new Microsoft.Xna.Framework.Rectangle?(rectangle), color3, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + else + { + rectangle = new Microsoft.Xna.Framework.Rectangle(testTile.wallFrameX(), testTile.wallFrameY() + num9, 32, 32); + if (Main.canDrawColorWall(index2, index1)) + Main.spriteBatch.Draw((Texture2D) Main.wallAltTexture[(int) testTile.wall, (int) testTile.wallColor()], new Vector2((float) (index2 * 16 - (int) Main.screenPosition.X - 8), (float) (index1 * 16 - (int) Main.screenPosition.Y - 8)) + vector2, new Microsoft.Xna.Framework.Rectangle?(rectangle), color1, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else + Main.spriteBatch.Draw(Main.wallTexture[(int) testTile.wall], new Vector2((float) (index2 * 16 - (int) Main.screenPosition.X - 8), (float) (index1 * 16 - (int) Main.screenPosition.Y - 8)) + vector2, new Microsoft.Xna.Framework.Rectangle?(rectangle), color1, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + if ((double) color1.R > (double) num1 * 0.4 || (double) color1.G > (double) num1 * 0.35 || (double) color1.B > (double) num1 * 0.3) + { + int num10 = Main.tile[index2 - 1, index1].wall <= (byte) 0 ? 0 : (Main.wallBlend[(int) Main.tile[index2 - 1, index1].wall] != Main.wallBlend[(int) testTile.wall] ? 1 : 0); + bool flag1 = Main.tile[index2 + 1, index1].wall > (byte) 0 && Main.wallBlend[(int) Main.tile[index2 + 1, index1].wall] != Main.wallBlend[(int) testTile.wall]; + bool flag2 = Main.tile[index2, index1 - 1].wall > (byte) 0 && Main.wallBlend[(int) Main.tile[index2, index1 - 1].wall] != Main.wallBlend[(int) testTile.wall]; + bool flag3 = Main.tile[index2, index1 + 1].wall > (byte) 0 && Main.wallBlend[(int) Main.tile[index2, index1 + 1].wall] != Main.wallBlend[(int) testTile.wall]; + if (num10 != 0) + Main.spriteBatch.Draw(Main.wallOutlineTexture, new Vector2((float) (index2 * 16 - (int) Main.screenPosition.X), (float) (index1 * 16 - (int) Main.screenPosition.Y)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 2, 16)), color1, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + if (flag1) + Main.spriteBatch.Draw(Main.wallOutlineTexture, new Vector2((float) (index2 * 16 - (int) Main.screenPosition.X + 14), (float) (index1 * 16 - (int) Main.screenPosition.Y)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(14, 0, 2, 16)), color1, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + if (flag2) + Main.spriteBatch.Draw(Main.wallOutlineTexture, new Vector2((float) (index2 * 16 - (int) Main.screenPosition.X), (float) (index1 * 16 - (int) Main.screenPosition.Y)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 16, 2)), color1, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + if (flag3) + Main.spriteBatch.Draw(Main.wallOutlineTexture, new Vector2((float) (index2 * 16 - (int) Main.screenPosition.X), (float) (index1 * 16 - (int) Main.screenPosition.Y + 14)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 14, 16, 2)), color1, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } + } + } + } + this.DrawTileCracks(2); + TimeLogger.DrawTime(2, stopwatch.Elapsed.TotalMilliseconds); + } protected void RenderWalls() { @@ -43074,7 +43572,7 @@ label_623: width = 400; if (j == Main.mapTargetY - 1) height = 600; - this.mapTarget[i, j] = new RenderTarget2D(this.GraphicsDevice, width, height, false, this.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.None, 0, RenderTargetUsage.PreserveContents); + this.mapTarget[i, j] = new RenderTarget2D(this.GraphicsDevice, width, height, false, this.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth16, 0, RenderTargetUsage.PreserveContents); } catch { @@ -43111,7 +43609,7 @@ label_623: for (int index1 = 0; index1 < mapTargetX; ++index1) { for (int index2 = 0; index2 < mapTargetY; ++index2) - this.mapTarget[index1, index2] = new RenderTarget2D(this.GraphicsDevice, Main.textureMaxWidth, Main.textureMaxHeight, false, this.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.None, 0, RenderTargetUsage.PreserveContents); + this.mapTarget[index1, index2] = new RenderTarget2D(this.GraphicsDevice, Main.textureMaxWidth, Main.textureMaxHeight, false, this.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24, 0, RenderTargetUsage.PreserveContents); } Main.mapInit = true; } @@ -43161,22 +43659,22 @@ label_623: if (Main.dedServ) return; Main.targetSet = true; - Main.waterTarget = new RenderTarget2D(this.GraphicsDevice, width, height, false, this.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.None); - this.backWaterTarget = new RenderTarget2D(this.GraphicsDevice, width, height, false, this.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.None); - this.blackTarget = new RenderTarget2D(this.GraphicsDevice, width, height, false, this.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.None); - this.tileTarget = new RenderTarget2D(this.GraphicsDevice, width, height, false, this.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.None); - this.tile2Target = new RenderTarget2D(this.GraphicsDevice, width, height, false, this.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.None); - this.wallTarget = new RenderTarget2D(this.GraphicsDevice, width, height, false, this.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.None); - this.backgroundTarget = new RenderTarget2D(this.GraphicsDevice, width, height, false, this.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.None); - Main.screenTarget = new RenderTarget2D(this.GraphicsDevice, this.GraphicsDevice.PresentationParameters.BackBufferWidth, this.GraphicsDevice.PresentationParameters.BackBufferHeight, false, this.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.None); - Main.screenTargetSwap = new RenderTarget2D(this.GraphicsDevice, this.GraphicsDevice.PresentationParameters.BackBufferWidth, this.GraphicsDevice.PresentationParameters.BackBufferHeight, false, this.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.None); + Main.waterTarget = new RenderTarget2D(this.GraphicsDevice, width, height, false, this.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24); + this.backWaterTarget = new RenderTarget2D(this.GraphicsDevice, width, height, false, this.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24); + this.blackTarget = new RenderTarget2D(this.GraphicsDevice, width, height, false, this.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24); + this.tileTarget = new RenderTarget2D(this.GraphicsDevice, width, height, false, this.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24); + this.tile2Target = new RenderTarget2D(this.GraphicsDevice, width, height, false, this.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24); + this.wallTarget = new RenderTarget2D(this.GraphicsDevice, width, height, false, this.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24); + this.backgroundTarget = new RenderTarget2D(this.GraphicsDevice, width, height, false, this.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24); + Main.screenTarget = new RenderTarget2D(this.GraphicsDevice, this.GraphicsDevice.PresentationParameters.BackBufferWidth, this.GraphicsDevice.PresentationParameters.BackBufferHeight, false, this.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24); + Main.screenTargetSwap = new RenderTarget2D(this.GraphicsDevice, this.GraphicsDevice.PresentationParameters.BackBufferWidth, this.GraphicsDevice.PresentationParameters.BackBufferHeight, false, this.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24); if (Main.OnRenderTargetsInitialized == null) return; Main.OnRenderTargetsInitialized(this.GraphicsDevice.PresentationParameters.BackBufferWidth, this.GraphicsDevice.PresentationParameters.BackBufferHeight); } catch { - Lighting.Mode = LightMode.Retro; + Lighting.lightMode = 2; Main.mapEnabled = false; Main.SaveSettings(); try @@ -43229,10 +43727,9 @@ label_623: num9 = 0; if (num10 > Main.maxTilesY) num10 = Main.maxTilesY; - Microsoft.Xna.Framework.Point screenOverdrawOffset = Main.GetScreenOverdrawOffset(); - for (int y = num9 + screenOverdrawOffset.Y; y < num10 - screenOverdrawOffset.Y; ++y) + for (int y = num9; y < num10; ++y) { - for (int x = num7 + screenOverdrawOffset.X; x < num8 - screenOverdrawOffset.X; ++x) + for (int x = num7; x < num8; ++x) { bool flag2 = false; bool flag3 = false; @@ -43305,7 +43802,7 @@ label_623: if (color == Microsoft.Xna.Framework.Color.Transparent) --num11; else - Main.spriteBatch.Draw(TextureAssets.WireNew.Value, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2, new Microsoft.Xna.Framework.Rectangle?(rectangle), color, 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.wireTextureNew, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2, new Microsoft.Xna.Framework.Rectangle?(rectangle), color, 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); } if (tile.wire2()) { @@ -43368,29 +43865,29 @@ label_623: } else { - Main.spriteBatch.Draw(TextureAssets.WireNew.Value, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2, new Microsoft.Xna.Framework.Rectangle?(rectangle), color * (1f / num11), 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.wireTextureNew, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2, new Microsoft.Xna.Framework.Rectangle?(rectangle), color * (1f / num11), 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); if (flag8) { if (flag6 && !flag4) - Main.spriteBatch.Draw(TextureAssets.WireNew.Value, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(18, rectangle.Y, 16, 6)), color, 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.wireTextureNew, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(18, rectangle.Y, 16, 6)), color, 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); flag4 = true; } if (flag7) { if (flag6 && !flag5) - Main.spriteBatch.Draw(TextureAssets.WireNew.Value, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2 + new Vector2(0.0f, 10f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(72, rectangle.Y + 10, 16, 6)), color, 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.wireTextureNew, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2 + new Vector2(0.0f, 10f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(72, rectangle.Y + 10, 16, 6)), color, 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); flag5 = true; } if (flag9) { if (flag6 && !flag3) - Main.spriteBatch.Draw(TextureAssets.WireNew.Value, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2 + new Vector2(10f, 0.0f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(46, rectangle.Y, 6, 16)), color, 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.wireTextureNew, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2 + new Vector2(10f, 0.0f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(46, rectangle.Y, 6, 16)), color, 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); flag3 = true; } if (flag10) { if (flag6 && !flag2) - Main.spriteBatch.Draw(TextureAssets.WireNew.Value, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(144, rectangle.Y, 6, 16)), color, 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.wireTextureNew, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(144, rectangle.Y, 6, 16)), color, 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); flag2 = true; } } @@ -43456,29 +43953,29 @@ label_623: } else { - Main.spriteBatch.Draw(TextureAssets.WireNew.Value, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2, new Microsoft.Xna.Framework.Rectangle?(rectangle), color * (1f / num11), 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.wireTextureNew, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2, new Microsoft.Xna.Framework.Rectangle?(rectangle), color * (1f / num11), 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); if (flag13) { if (flag11 && !flag4) - Main.spriteBatch.Draw(TextureAssets.WireNew.Value, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(18, rectangle.Y, 16, 6)), color, 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.wireTextureNew, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(18, rectangle.Y, 16, 6)), color, 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); flag4 = true; } if (flag12) { if (flag11 && !flag5) - Main.spriteBatch.Draw(TextureAssets.WireNew.Value, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2 + new Vector2(0.0f, 10f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(72, rectangle.Y + 10, 16, 6)), color, 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.wireTextureNew, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2 + new Vector2(0.0f, 10f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(72, rectangle.Y + 10, 16, 6)), color, 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); flag5 = true; } if (flag14) { if (flag11 && !flag3) - Main.spriteBatch.Draw(TextureAssets.WireNew.Value, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2 + new Vector2(10f, 0.0f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(46, rectangle.Y, 6, 16)), color, 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.wireTextureNew, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2 + new Vector2(10f, 0.0f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(46, rectangle.Y, 6, 16)), color, 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); flag3 = true; } if (flag15) { if (flag11 && !flag2) - Main.spriteBatch.Draw(TextureAssets.WireNew.Value, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(144, rectangle.Y, 6, 16)), color, 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.wireTextureNew, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(144, rectangle.Y, 6, 16)), color, 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); flag2 = true; } } @@ -43544,26 +44041,26 @@ label_623: } else { - Main.spriteBatch.Draw(TextureAssets.WireNew.Value, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2, new Microsoft.Xna.Framework.Rectangle?(rectangle), color * (1f / num19), 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.wireTextureNew, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2, new Microsoft.Xna.Framework.Rectangle?(rectangle), color * (1f / num19), 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); if (flag18) { if (flag16 && !flag4) - Main.spriteBatch.Draw(TextureAssets.WireNew.Value, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(18, rectangle.Y, 16, 6)), color, 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.wireTextureNew, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(18, rectangle.Y, 16, 6)), color, 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); } if (flag17) { if (flag16 && !flag5) - Main.spriteBatch.Draw(TextureAssets.WireNew.Value, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2 + new Vector2(0.0f, 10f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(72, rectangle.Y + 10, 16, 6)), color, 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.wireTextureNew, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2 + new Vector2(0.0f, 10f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(72, rectangle.Y + 10, 16, 6)), color, 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); } if (flag19) { if (flag16 && !flag3) - Main.spriteBatch.Draw(TextureAssets.WireNew.Value, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2 + new Vector2(10f, 0.0f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(46, rectangle.Y, 6, 16)), color, 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.wireTextureNew, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2 + new Vector2(10f, 0.0f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(46, rectangle.Y, 6, 16)), color, 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); } if (flag20) { if (flag16 && !flag2) - Main.spriteBatch.Draw(TextureAssets.WireNew.Value, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(144, rectangle.Y, 6, 16)), color, 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.wireTextureNew, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(144, rectangle.Y, 6, 16)), color, 0.0f, zero1, 1f, SpriteEffects.None, 0.0f); } } } @@ -43583,7 +44080,7 @@ label_623: color = Microsoft.Xna.Framework.Color.Transparent; break; } - Main.spriteBatch.Draw(TextureAssets.Actuator.Value, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Actuator.Width(), TextureAssets.Actuator.Height())), color * num1, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.actuatorTexture, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + zero2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.actuatorTexture.Width, Main.actuatorTexture.Height)), color * num1, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } if (tile.active() && tile.type == (ushort) 423 && tile.frameY == (short) 36) this.DrawWiresSpecialTiles.Add(Tuple.Create(x, y, tile.type)); @@ -43602,242 +44099,372 @@ label_623: TimeLogger.DetailedDrawTime(34); } - public static int ConvertPaintIdToTileShaderIndex( - int paintIndexOnTile, - bool isUsedForPaintingGrass, - bool useWallShaderHacks) + protected void DrawWiresOld() { - if (paintIndexOnTile == 31) - return 0; - if (paintIndexOnTile == 30 & useWallShaderHacks) - return 43; - if (paintIndexOnTile >= 28) - return paintIndexOnTile + 12; - return isUsedForPaintingGrass && paintIndexOnTile >= 1 && paintIndexOnTile <= 12 ? paintIndexOnTile + 27 : paintIndexOnTile; + double gfxQuality1 = (double) Main.gfxQuality; + double gfxQuality2 = (double) Main.gfxQuality; + Vector2 vector2 = new Vector2((float) Main.offScreenRange, (float) Main.offScreenRange); + if (Main.drawToScreen) + vector2 = Vector2.Zero; + int num1 = (int) (((double) Main.screenPosition.X - (double) vector2.X) / 16.0 - 1.0); + int num2 = (int) (((double) Main.screenPosition.X + (double) Main.screenWidth + (double) vector2.X) / 16.0) + 2; + int num3 = (int) (((double) Main.screenPosition.Y - (double) vector2.Y) / 16.0 - 1.0); + int num4 = (int) (((double) Main.screenPosition.Y + (double) Main.screenHeight + (double) vector2.Y) / 16.0) + 5; + if (num1 < 0) + num1 = 0; + if (num2 > Main.maxTilesX) + num2 = Main.maxTilesX; + if (num3 < 0) + num3 = 0; + if (num4 > Main.maxTilesY) + num4 = Main.maxTilesY; + for (int y = num3; y < num4; ++y) + { + for (int x = num1; x < num2; ++x) + { + if (Main.tile[x, y].wire() && (double) Lighting.Brightness(x, y) > 0.0) + { + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, 0, 16, 16); + int num5 = Main.tile[x, y - 1].wire() ? 1 : 0; + bool flag1 = Main.tile[x, y + 1].wire(); + bool flag2 = Main.tile[x - 1, y].wire(); + bool flag3 = Main.tile[x + 1, y].wire(); + rectangle = num5 == 0 ? (!flag1 ? (!flag2 ? (!flag3 ? new Microsoft.Xna.Framework.Rectangle(0, 54, 16, 16) : new Microsoft.Xna.Framework.Rectangle(72, 36, 16, 16)) : (!flag3 ? new Microsoft.Xna.Framework.Rectangle(54, 36, 16, 16) : new Microsoft.Xna.Framework.Rectangle(18, 0, 16, 16))) : (!flag2 ? (!flag3 ? new Microsoft.Xna.Framework.Rectangle(18, 36, 16, 16) : new Microsoft.Xna.Framework.Rectangle(0, 36, 16, 16)) : (!flag3 ? new Microsoft.Xna.Framework.Rectangle(72, 18, 16, 16) : new Microsoft.Xna.Framework.Rectangle(72, 0, 16, 16)))) : (!flag1 ? (!flag2 ? (!flag3 ? new Microsoft.Xna.Framework.Rectangle(36, 36, 16, 16) : new Microsoft.Xna.Framework.Rectangle(36, 18, 16, 16)) : (!flag3 ? new Microsoft.Xna.Framework.Rectangle(54, 18, 16, 16) : new Microsoft.Xna.Framework.Rectangle(0, 18, 16, 16))) : (!flag2 ? (!flag3 ? new Microsoft.Xna.Framework.Rectangle(0, 0, 16, 16) : new Microsoft.Xna.Framework.Rectangle(36, 0, 16, 16)) : (!flag3 ? new Microsoft.Xna.Framework.Rectangle(54, 0, 16, 16) : new Microsoft.Xna.Framework.Rectangle(18, 18, 16, 16)))); + Microsoft.Xna.Framework.Color color = Lighting.GetColor(x, y); + Main.spriteBatch.Draw(Main.wireTexture, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + vector2, new Microsoft.Xna.Framework.Rectangle?(rectangle), color, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + } + if (Main.tile[x, y].wire2() && (double) Lighting.Brightness(x, y) > 0.0) + { + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, 0, 16, 16); + int num6 = Main.tile[x, y - 1].wire2() ? 1 : 0; + bool flag4 = Main.tile[x, y + 1].wire2(); + bool flag5 = Main.tile[x - 1, y].wire2(); + bool flag6 = Main.tile[x + 1, y].wire2(); + rectangle = num6 == 0 ? (!flag4 ? (!flag5 ? (!flag6 ? new Microsoft.Xna.Framework.Rectangle(0, 54, 16, 16) : new Microsoft.Xna.Framework.Rectangle(72, 36, 16, 16)) : (!flag6 ? new Microsoft.Xna.Framework.Rectangle(54, 36, 16, 16) : new Microsoft.Xna.Framework.Rectangle(18, 0, 16, 16))) : (!flag5 ? (!flag6 ? new Microsoft.Xna.Framework.Rectangle(18, 36, 16, 16) : new Microsoft.Xna.Framework.Rectangle(0, 36, 16, 16)) : (!flag6 ? new Microsoft.Xna.Framework.Rectangle(72, 18, 16, 16) : new Microsoft.Xna.Framework.Rectangle(72, 0, 16, 16)))) : (!flag4 ? (!flag5 ? (!flag6 ? new Microsoft.Xna.Framework.Rectangle(36, 36, 16, 16) : new Microsoft.Xna.Framework.Rectangle(36, 18, 16, 16)) : (!flag6 ? new Microsoft.Xna.Framework.Rectangle(54, 18, 16, 16) : new Microsoft.Xna.Framework.Rectangle(0, 18, 16, 16))) : (!flag5 ? (!flag6 ? new Microsoft.Xna.Framework.Rectangle(0, 0, 16, 16) : new Microsoft.Xna.Framework.Rectangle(36, 0, 16, 16)) : (!flag6 ? new Microsoft.Xna.Framework.Rectangle(54, 0, 16, 16) : new Microsoft.Xna.Framework.Rectangle(18, 18, 16, 16)))); + Microsoft.Xna.Framework.Color color = Lighting.GetColor(x, y); + int num7 = 1; + if (Main.tile[x, y].wire()) + ++num7; + float num8 = 1f / (float) num7; + color = new Microsoft.Xna.Framework.Color((int) (byte) ((double) color.R * (double) num8), (int) (byte) ((double) color.G * (double) num8), (int) (byte) ((double) color.B * (double) num8), (int) (byte) ((double) color.A * (double) num8)); + Main.spriteBatch.Draw(Main.wire2Texture, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + vector2, new Microsoft.Xna.Framework.Rectangle?(rectangle), color, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + } + if (Main.tile[x, y].wire3() && (double) Lighting.Brightness(x, y) > 0.0) + { + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, 0, 16, 16); + int num9 = Main.tile[x, y - 1].wire3() ? 1 : 0; + bool flag7 = Main.tile[x, y + 1].wire3(); + bool flag8 = Main.tile[x - 1, y].wire3(); + bool flag9 = Main.tile[x + 1, y].wire3(); + rectangle = num9 == 0 ? (!flag7 ? (!flag8 ? (!flag9 ? new Microsoft.Xna.Framework.Rectangle(0, 54, 16, 16) : new Microsoft.Xna.Framework.Rectangle(72, 36, 16, 16)) : (!flag9 ? new Microsoft.Xna.Framework.Rectangle(54, 36, 16, 16) : new Microsoft.Xna.Framework.Rectangle(18, 0, 16, 16))) : (!flag8 ? (!flag9 ? new Microsoft.Xna.Framework.Rectangle(18, 36, 16, 16) : new Microsoft.Xna.Framework.Rectangle(0, 36, 16, 16)) : (!flag9 ? new Microsoft.Xna.Framework.Rectangle(72, 18, 16, 16) : new Microsoft.Xna.Framework.Rectangle(72, 0, 16, 16)))) : (!flag7 ? (!flag8 ? (!flag9 ? new Microsoft.Xna.Framework.Rectangle(36, 36, 16, 16) : new Microsoft.Xna.Framework.Rectangle(36, 18, 16, 16)) : (!flag9 ? new Microsoft.Xna.Framework.Rectangle(54, 18, 16, 16) : new Microsoft.Xna.Framework.Rectangle(0, 18, 16, 16))) : (!flag8 ? (!flag9 ? new Microsoft.Xna.Framework.Rectangle(0, 0, 16, 16) : new Microsoft.Xna.Framework.Rectangle(36, 0, 16, 16)) : (!flag9 ? new Microsoft.Xna.Framework.Rectangle(54, 0, 16, 16) : new Microsoft.Xna.Framework.Rectangle(18, 18, 16, 16)))); + Microsoft.Xna.Framework.Color color = Lighting.GetColor(x, y); + int num10 = 1; + if (Main.tile[x, y].wire()) + ++num10; + if (Main.tile[x, y].wire2()) + ++num10; + float num11 = 1f / (float) num10; + color = new Microsoft.Xna.Framework.Color((int) (byte) ((double) color.R * (double) num11), (int) (byte) ((double) color.G * (double) num11), (int) (byte) ((double) color.B * (double) num11), (int) (byte) ((double) color.A * (double) num11)); + Main.spriteBatch.Draw(Main.wire3Texture, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + vector2, new Microsoft.Xna.Framework.Rectangle?(rectangle), color, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + } + if (Main.tile[x, y].wire4() && (double) Lighting.Brightness(x, y) > 0.0) + { + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(0, 0, 16, 16); + int num12 = Main.tile[x, y - 1].wire4() ? 1 : 0; + bool flag10 = Main.tile[x, y + 1].wire4(); + bool flag11 = Main.tile[x - 1, y].wire4(); + bool flag12 = Main.tile[x + 1, y].wire4(); + rectangle = num12 == 0 ? (!flag10 ? (!flag11 ? (!flag12 ? new Microsoft.Xna.Framework.Rectangle(0, 54, 16, 16) : new Microsoft.Xna.Framework.Rectangle(72, 36, 16, 16)) : (!flag12 ? new Microsoft.Xna.Framework.Rectangle(54, 36, 16, 16) : new Microsoft.Xna.Framework.Rectangle(18, 0, 16, 16))) : (!flag11 ? (!flag12 ? new Microsoft.Xna.Framework.Rectangle(18, 36, 16, 16) : new Microsoft.Xna.Framework.Rectangle(0, 36, 16, 16)) : (!flag12 ? new Microsoft.Xna.Framework.Rectangle(72, 18, 16, 16) : new Microsoft.Xna.Framework.Rectangle(72, 0, 16, 16)))) : (!flag10 ? (!flag11 ? (!flag12 ? new Microsoft.Xna.Framework.Rectangle(36, 36, 16, 16) : new Microsoft.Xna.Framework.Rectangle(36, 18, 16, 16)) : (!flag12 ? new Microsoft.Xna.Framework.Rectangle(54, 18, 16, 16) : new Microsoft.Xna.Framework.Rectangle(0, 18, 16, 16))) : (!flag11 ? (!flag12 ? new Microsoft.Xna.Framework.Rectangle(0, 0, 16, 16) : new Microsoft.Xna.Framework.Rectangle(36, 0, 16, 16)) : (!flag12 ? new Microsoft.Xna.Framework.Rectangle(54, 0, 16, 16) : new Microsoft.Xna.Framework.Rectangle(18, 18, 16, 16)))); + Microsoft.Xna.Framework.Color color = Lighting.GetColor(x, y); + int num13 = 1; + if (Main.tile[x, y].wire()) + ++num13; + if (Main.tile[x, y].wire2()) + ++num13; + if (Main.tile[x, y].wire3()) + ++num13; + float num14 = 1f / (float) num13; + color = new Microsoft.Xna.Framework.Color((int) (byte) ((double) color.R * (double) num14), (int) (byte) ((double) color.G * (double) num14), (int) (byte) ((double) color.B * (double) num14), (int) (byte) ((double) color.A * (double) num14)); + Main.spriteBatch.Draw(Main.wire4Texture, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + vector2, new Microsoft.Xna.Framework.Rectangle?(rectangle), color, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + } + if (Main.tile[x, y].actuator() && (double) Lighting.Brightness(x, y) > 0.0) + { + Microsoft.Xna.Framework.Color color = Lighting.GetColor(x, y); + Main.spriteBatch.Draw(Main.actuatorTexture, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + vector2, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.actuatorTexture.Width, Main.actuatorTexture.Height)), color, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + } + } + } + TimeLogger.DetailedDrawTime(34); } - public static void ResetWindCounter(bool resetExtreme = false) + public static int GetTreeStyle(int X) { - FastRandom withRandomSeed = FastRandom.CreateWithRandomSeed(); - Main.windCounter = withRandomSeed.Next(900, 2701); - if (!resetExtreme) - return; - Main.extremeWindCounter = withRandomSeed.Next(10, 31); + int num = X > Main.treeX[0] ? (X > Main.treeX[1] ? (X > Main.treeX[2] ? Main.treeStyle[3] : Main.treeStyle[2]) : Main.treeStyle[1]) : Main.treeStyle[0]; + switch (num) + { + case 0: + return 0; + case 5: + return 10; + default: + return 5 + num; + } } - public static void NewLightning() + protected void lookForColorTiles() { - if (Main.DisableIntenseVisualEffects) + int num1 = (int) ((double) Main.screenPosition.X / 16.0 - 2.0); + int num2 = (int) (((double) Main.screenPosition.X + (double) Main.screenWidth) / 16.0) + 3; + int num3 = (int) ((double) Main.screenPosition.Y / 16.0 - 2.0); + int num4 = (int) (((double) Main.screenPosition.Y + (double) Main.screenHeight) / 16.0) + 3; + if (num1 < 1) + num1 = 1; + if (num2 > Main.maxTilesX - 2) + num2 = Main.maxTilesX - 2; + if (num3 < 1) + num3 = 1; + if (num4 > Main.maxTilesY - 2) + num4 = Main.maxTilesY - 2; + for (int x = num1; x < num2; ++x) + { + if (x > 0) + { + for (int y = num3; y < num4; ++y) + { + if (Main.tile[x, y] != null) + { + int treeVariant = Main.GetTreeVariant(x, y); + if (treeVariant != -1) + this.woodColorCheck(treeVariant, (int) Main.tile[x, y].color()); + if (Main.tile[x, y].active() && Main.tile[x, y].color() > (byte) 0) + this.tileColorCheck((int) Main.tile[x, y].type, (int) Main.tile[x, y].color()); + if (Main.tile[x, y].wall > (byte) 0 && Main.tile[x, y].wallColor() > (byte) 0) + this.wallColorCheck((int) Main.tile[x, y].wall, (int) Main.tile[x, y].wallColor()); + } + } + } + } + for (int t = 0; t < Main.numTreeStyles; ++t) + { + for (int c = 0; c < Main.numTileColors; ++c) + { + if (Main.checkTreeAlt[t, c]) + { + this.treeColorCheck(t, c); + Main.checkTreeAlt[t, c] = false; + } + } + } + } + + protected static int GetTreeVariant(int x, int y) + { + if (Main.tile[x, y] == null || !Main.tile[x, y].active()) + return -1; + switch (Main.tile[x, y].type) + { + case 23: + return 0; + case 60: + return (double) y <= Main.worldSurface ? 1 : 5; + case 70: + return 6; + case 109: + return 2; + case 147: + return 3; + case 199: + return 4; + default: + return -1; + } + } + + protected void woodColorCheck(int t, int c) + { + this.LoadTiles(5); + if (c >= Main.numTileColors) return; - Main.thunderDelay = Main.rand.Next(3) != 0 ? (Main.rand.Next(2) != 0 ? Main.rand.Next(11, 61) : Main.rand.Next(31, 121)) : Main.rand.Next(1, 31); - Main.thunderDistance = Main.thunderDelay; - Main.lightningDecay = (float) ((double) Main.rand.NextFloat() * 0.0500000007450581 + 0.00800000037997961); - Main.lightningSpeed = (float) ((double) Main.rand.NextFloat() * 0.0500000007450581 + 0.0500000007450581); + bool flag = false; + if (Main.woodAltTexture[t, c] == null) + { + Main.woodAltTexture[t, c] = new RenderTarget2D(this.GraphicsDevice, Main.woodTexture[t].Width, Main.woodTexture[t].Height, false, this.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24, 0, RenderTargetUsage.PreserveContents); + flag = true; + } + if (Main.woodAltTexture[t, c].IsContentLost) + flag = true; + if (!flag) + return; + this.GraphicsDevice.SetRenderTarget(Main.woodAltTexture[t, c]); + this.GraphicsDevice.Clear(Microsoft.Xna.Framework.Color.Transparent); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); + if (c >= 28) + Main.tileShader.CurrentTechnique.Passes[40 + c - 28].Apply(); + else if (c > 0 && c < 13) + Main.tileShader.CurrentTechnique.Passes[c + 27].Apply(); + else + Main.tileShader.CurrentTechnique.Passes[c].Apply(); + Main.spriteBatch.Draw(Main.woodTexture[t], new Microsoft.Xna.Framework.Rectangle(0, 0, Main.woodTexture[t].Width, Main.woodTexture[t].Height), Microsoft.Xna.Framework.Color.White); + Main.spriteBatch.End(); + this.GraphicsDevice.SetRenderTarget((RenderTarget2D) null); + } + + protected void tileColorCheck(int t, int c) + { + this.LoadTiles(t); + if (c >= Main.numTileColors) + return; + if (!Main.tileAltTextureInit[t, c]) + { + Main.tileAltTexture[t, c] = new RenderTarget2D(this.GraphicsDevice, Main.tileTexture[t].Width, Main.tileTexture[t].Height, false, this.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24, 0, RenderTargetUsage.PreserveContents); + Main.tileAltTextureInit[t, c] = true; + } + if (Main.tileAltTexture[t, c].IsContentLost) + Main.tileAltTextureDrawn[t, c] = false; + if (Main.tileAltTextureDrawn[t, c]) + return; + this.GraphicsDevice.SetRenderTarget(Main.tileAltTexture[t, c]); + this.GraphicsDevice.Clear(Microsoft.Xna.Framework.Color.Transparent); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); + if (c >= 28) + Main.tileShader.CurrentTechnique.Passes[40 + c - 28].Apply(); + else if (c > 0 && c < 13 && (t == 0 || t == 2 || t == 5 || t == 23 || t == 59 || t == 60 || t == 70 || t == 109 || t == 199)) + Main.tileShader.CurrentTechnique.Passes[c + 27].Apply(); + else + Main.tileShader.CurrentTechnique.Passes[c].Apply(); + Main.spriteBatch.Draw(Main.tileTexture[t], new Microsoft.Xna.Framework.Rectangle(0, 0, Main.tileTexture[t].Width, Main.tileTexture[t].Height), Microsoft.Xna.Framework.Color.White); + Main.spriteBatch.End(); + this.GraphicsDevice.SetRenderTarget((RenderTarget2D) null); + Main.tileAltTextureDrawn[t, c] = true; + } + + protected void treeColorCheck(int t, int c) + { + if (!Main.treeAltTextureInit[t, c]) + { + Main.treeTopAltTexture[t, c] = new RenderTarget2D(this.GraphicsDevice, Main.treeTopTexture[t].Width, Main.treeTopTexture[t].Height, false, this.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24, 0, RenderTargetUsage.PreserveContents); + Main.treeBranchAltTexture[t, c] = new RenderTarget2D(this.GraphicsDevice, Main.treeBranchTexture[t].Width, Main.treeBranchTexture[t].Height, false, this.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24, 0, RenderTargetUsage.PreserveContents); + Main.treeAltTextureInit[t, c] = true; + } + if (Main.treeTopAltTexture[t, c].IsContentLost || Main.treeBranchAltTexture[t, c].IsContentLost) + Main.treeAltTextureDrawn[t, c] = false; + if (Main.treeAltTextureDrawn[t, c]) + return; + this.GraphicsDevice.SetRenderTarget(Main.treeTopAltTexture[t, c]); + this.GraphicsDevice.Clear(Microsoft.Xna.Framework.Color.Transparent); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); + if (c >= 28) + Main.tileShader.CurrentTechnique.Passes[40 + c - 28].Apply(); + else if (c > 0 && c < 13) + Main.tileShader.CurrentTechnique.Passes[c + 27].Apply(); + else + Main.tileShader.CurrentTechnique.Passes[c].Apply(); + Main.spriteBatch.Draw(Main.treeTopTexture[t], new Microsoft.Xna.Framework.Rectangle(0, 0, Main.treeTopTexture[t].Width, Main.treeTopTexture[t].Height), Microsoft.Xna.Framework.Color.White); + Main.spriteBatch.End(); + this.GraphicsDevice.SetRenderTarget((RenderTarget2D) null); + this.GraphicsDevice.SetRenderTarget(Main.treeBranchAltTexture[t, c]); + this.GraphicsDevice.Clear(Microsoft.Xna.Framework.Color.Transparent); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); + if (c >= 28) + Main.tileShader.CurrentTechnique.Passes[40 + c - 28].Apply(); + else if (c > 0 && c < 13) + Main.tileShader.CurrentTechnique.Passes[c + 27].Apply(); + else + Main.tileShader.CurrentTechnique.Passes[c].Apply(); + Main.spriteBatch.Draw(Main.treeBranchTexture[t], new Microsoft.Xna.Framework.Rectangle(0, 0, Main.treeBranchTexture[t].Width, Main.treeBranchTexture[t].Height), Microsoft.Xna.Framework.Color.White); + Main.spriteBatch.End(); + this.GraphicsDevice.SetRenderTarget((RenderTarget2D) null); + Main.treeAltTextureDrawn[t, c] = true; + } + + protected void wallColorCheck(int t, int c) + { + this.LoadWall(t); + if (!Main.wallAltTextureInit[t, c]) + { + Main.wallAltTexture[t, c] = new RenderTarget2D(this.GraphicsDevice, Main.wallTexture[t].Width, Main.wallTexture[t].Height, false, this.GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24, 0, RenderTargetUsage.PreserveContents); + Main.wallAltTextureInit[t, c] = true; + } + if (Main.wallAltTexture[t, c].IsContentLost) + Main.wallAltTextureDrawn[t, c] = false; + if (Main.wallAltTextureDrawn[t, c]) + return; + this.GraphicsDevice.SetRenderTarget(Main.wallAltTexture[t, c]); + this.GraphicsDevice.Clear(Microsoft.Xna.Framework.Color.Transparent); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); + if (c == 30) + Main.tileShader.CurrentTechnique.Passes[43].Apply(); + else if (c >= 28) + Main.tileShader.CurrentTechnique.Passes[40 + c - 28].Apply(); + else + Main.tileShader.CurrentTechnique.Passes[c].Apply(); + Main.spriteBatch.Draw(Main.wallTexture[t], new Microsoft.Xna.Framework.Rectangle(0, 0, Main.wallTexture[t].Width, Main.wallTexture[t].Height), Microsoft.Xna.Framework.Color.White); + Main.spriteBatch.End(); + this.GraphicsDevice.SetRenderTarget((RenderTarget2D) null); + Main.wallAltTextureDrawn[t, c] = true; } public void UpdateWeather(GameTime gameTime) { - if (Main.netMode != 2) + Main.cloudLimit = 200; + if ((double) Main.windSpeed < (double) Main.windSpeedSet) { - bool isActive = this.IsActive; - if (Main.thunderDelay > 0) - { - --Main.thunderDelay; - if (Main.thunderDelay == 0) - { - Vector2 center = Main.player[Main.myPlayer].Center; - float num1 = (float) (Main.thunderDistance * 15); - if (Main.rand.Next(2) == 0) - num1 *= -1f; - center.X += num1; - int num2 = (int) (Main.worldSurface * 16.0) - 500; - if ((double) center.Y > (double) num2) - center.Y = (float) num2; - if (isActive) - SoundEngine.PlaySound(43, center); - } - } - if ((double) Main.lightningSpeed > 0.0) - { - Main.lightning += Main.lightningSpeed; - if ((double) Main.lightning >= 1.0) - { - Main.lightning = 1f; - Main.lightningSpeed = 0.0f; - } - Lighting.LightTiles(this.firstTileX, this.lastTileX, this.firstTileY, this.lastTileY); - Lighting.LightTiles(this.firstTileX, this.lastTileX, this.firstTileY, this.lastTileY); - } - else if ((double) Main.lightning > 0.0) - { - Main.lightning -= Main.lightningDecay; - Lighting.LightTiles(this.firstTileX, this.lastTileX, this.firstTileY, this.lastTileY); - Lighting.LightTiles(this.firstTileX, this.lastTileX, this.firstTileY, this.lastTileY); - } - else if (Main.thunderDelay <= 0 && (double) Main.player[Main.myPlayer].position.Y < Main.rockLayer * 16.0 && (double) Main.atmo == 1.0) - { - if (Main.IsItStorming) - { - float num3 = 600f; - float num4 = 1600f; - if ((double) Main.maxRaining > 0.8) - { - num3 *= 0.6f; - num4 *= 0.8f; - } - if ((double) Main.maxRaining > 0.7) - { - num3 *= 0.7f; - num4 *= 0.9f; - } - if ((double) Main.maxRaining > 0.6) - { - num3 *= 0.8f; - num4 *= 0.95f; - } - if ((double) Math.Abs(Main.windSpeedTarget) > 0.7) - { - num3 *= 0.6f; - num4 *= 0.8f; - } - if ((double) Math.Abs(Main.windSpeedTarget) > 0.6) - { - num3 *= 0.7f; - num4 *= 0.9f; - } - if ((double) Math.Abs(Main.windSpeedTarget) > 0.5) - { - num3 *= 0.8f; - num4 *= 0.95f; - } - float num5 = (float) Main.rand.Next((int) num3, (int) num4) * (float) ((1.0 - (double) Main.maxRaining + 1.0) / 2.0) * (float) ((1.0 - (double) Main.windSpeedTarget + 1.0) / 2.0) * (float) Main.dayRate; - if (Main.rand.Next((int) num5) == 0) - Main.NewLightning(); - } - else if ((double) Main.GraveyardVisualIntensity >= 0.9 && Main.rand.Next(7200) == 0) - Main.NewLightning(); - } + Main.windSpeed += 1f / 1000f * (float) Main.dayRate; + if ((double) Main.windSpeed > (double) Main.windSpeedSet) + Main.windSpeed = Main.windSpeedSet; } - float num6 = 0.8f; - float num7 = 0.0003f; - float num8 = Main.windSpeedTarget * (float) (1.0 + 0.555555582046509 * (double) Main.maxRaining); - bool enabled = CreativePowerManager.Instance.GetPower().Enabled; - if (!enabled && LanternNight.LanternsUp) - Main.windSpeedTarget = 0.0f; - float num9 = num7 + Math.Abs(num8 - Main.windSpeedCurrent) * 0.0015f; - if ((double) Main.windSpeedCurrent < (double) num8) + else if ((double) Main.windSpeed > (double) Main.windSpeedSet) { - Main.windSpeedCurrent += num9; - if ((double) Main.windSpeedCurrent > (double) num8) - Main.windSpeedCurrent = num8; - } - else if ((double) Main.windSpeedCurrent > (double) num8) - { - Main.windSpeedCurrent -= num9; - if ((double) Main.windSpeedCurrent < (double) num8) - Main.windSpeedCurrent = num8; + Main.windSpeed -= 1f / 1000f * (float) Main.dayRate; + if ((double) Main.windSpeed < (double) Main.windSpeedSet) + Main.windSpeed = Main.windSpeedSet; } switch (Main.netMode) { case 1: break; case 2: - if (!enabled && LanternNight.LanternsUp) - break; - if (!enabled) - { - --Main.windCounter; - if (Main.windCounter <= 0) - { - float num10 = 1f; - if ((double) Main.windSpeedTarget < 0.0) - num10 = -1f; - if (Main.rand.Next(4) == 0) - Main.windSpeedTarget += (float) Main.rand.Next(-25, 26) * (1f / 1000f); - else if (Main.rand.Next(2) == 0) - Main.windSpeedTarget += (float) Main.rand.Next(-50, 51) * (1f / 1000f); - else - Main.windSpeedTarget += (float) Main.rand.Next(-100, 101) * (1f / 1000f); - --Main.extremeWindCounter; - if (Main.extremeWindCounter <= 0) - { - Main.ResetWindCounter(true); - if (Main.rand.Next(30) < 13) - { - if (Main.rand.Next(2) == 0) - { - Main.windSpeedTarget = 0.0f; - Main.windCounter = Main.rand.Next(7200, 28801); - } - else - Main.windSpeedTarget = (float) Main.rand.Next(-200, 201) * (1f / 1000f); - } - else - Main.windSpeedTarget = Main.rand.Next(20) >= 13 ? (float) Main.rand.Next(-850, 851) * (1f / 1000f) : (float) Main.rand.Next(-400, 401) * (1f / 1000f); - if ((double) Math.Abs(Main.windSpeedTarget) > 0.3) - Main.extremeWindCounter += Main.rand.Next(5, 11); - if ((double) Math.Abs(Main.windSpeedTarget) > 0.5) - Main.extremeWindCounter += Main.rand.Next(10, 21); - if ((double) Math.Abs(Main.windSpeedTarget) > 0.7) - Main.extremeWindCounter += Main.rand.Next(15, 31); - } - else - Main.ResetWindCounter(); - if (Main.rand.Next(3) != 0 && ((double) num10 < 0.0 && (double) Main.windSpeedTarget > 0.0 || (double) num10 > 0.0 && (double) Main.windSpeedTarget < 0.0)) - Main.windSpeedTarget *= -1f; - } - if ((double) Main.windSpeedTarget > (double) num6) - Main.windSpeedTarget = num6; - if ((double) Main.windSpeedTarget < -(double) num6) - Main.windSpeedTarget = -num6; - } + Main.windSpeedSpeed += (float) Main.rand.Next(-10, 11) * 0.0001f; + if (!Main.dayTime) + Main.windSpeedSpeed += (float) Main.rand.Next(-10, 11) * 0.0002f; + if ((double) Main.windSpeedSpeed < -0.002) + Main.windSpeedSpeed = -1f / 500f; + if ((double) Main.windSpeedSpeed > 0.002) + Main.windSpeedSpeed = 1f / 500f; + Main.windSpeedTemp += Main.windSpeedSpeed; + if (Main.raining) + Main.windSpeedTemp += Main.windSpeedSpeed * 2f; + float num = (float) (0.300000011920929 + 0.5 * (double) Main.cloudAlpha); + if ((double) Main.windSpeedTemp < -(double) num) + Main.windSpeedTemp = -num; + if ((double) Main.windSpeedTemp > (double) num) + Main.windSpeedTemp = num; if (Main.rand.Next(60) == 0) Main.numCloudsTemp += Main.rand.Next(-1, 2); if ((double) Main.rand.Next(1000) < 50.0 * (double) Main.cloudBGAlpha) ++Main.numCloudsTemp; - if ((double) Main.rand.Next(1300) < 25.0 * (1.0 - (double) Main.cloudBGAlpha)) + if ((double) Main.rand.Next(1000) < 25.0 * (1.0 - (double) Main.cloudBGAlpha)) --Main.numCloudsTemp; - if ((double) Main.rand.Next(1000) < 200.0 * (double) Main.cloudAlpha && Main.numCloudsTemp < 100) + if ((double) Main.rand.Next(1000) < 200.0 * (double) Main.cloudAlpha && Main.numCloudsTemp < Main.cloudLimit / 2) ++Main.numCloudsTemp; if ((double) Main.rand.Next(1000) < 50.0 * (double) Main.cloudAlpha) ++Main.numCloudsTemp; - if (Main.numCloudsTemp > 66 && Main.rand.Next(100) == 0) + if (Main.numCloudsTemp > Main.cloudLimit / 4 && Main.rand.Next(100) == 0) Main.numCloudsTemp -= Main.rand.Next(1, 3); - if (Main.numCloudsTemp < 50 && Main.rand.Next(100) == 0) + if (Main.numCloudsTemp < Main.cloudLimit / 4 && Main.rand.Next(100) == 0) Main.numCloudsTemp += Main.rand.Next(1, 3); - if ((double) Main.cloudBGActive <= 0.0 && Main.numCloudsTemp > 100 && (double) Main.cloudAlpha == 0.0) - Main.numCloudsTemp = 100; - if (Main.numCloudsTemp < -20) - Main.numCloudsTemp = -20; - if ((double) Main.cloudAlpha > 0.0 && (double) Main.numClouds < 200.0 * (double) Main.cloudAlpha) - { - while ((double) Main.numClouds < 200.0 * (double) Main.cloudAlpha) - { - Main.numClouds += Main.rand.Next(30); - if (Main.numClouds > 200) - Main.numClouds = 200; - if (Main.numCloudsTemp < Main.numClouds) - Main.numCloudsTemp = Main.numClouds; - } - if (Main.netMode == 2) - NetMessage.SendData(7); - } - --Main.weatherCounter; - if (Main.weatherCounter > 0) - break; - if (Main.rand.Next(2) == 0) - { - if (Main.rand.Next(2) == 0) - Main.numCloudsTemp += Main.rand.Next(250); - else - Main.numCloudsTemp += Main.rand.Next(100); - } + if ((double) Main.cloudBGActive <= 0.0 && Main.numCloudsTemp > Main.cloudLimit / 2 && (double) Main.cloudAlpha == 0.0) + Main.numCloudsTemp = Main.cloudLimit / 2; if (Main.numCloudsTemp < 0) Main.numCloudsTemp = 0; - if (Main.numCloudsTemp > 200) - Main.numCloudsTemp = 200; + if (Main.numCloudsTemp > Main.cloudLimit) + Main.numCloudsTemp = Main.cloudLimit; + Main.weatherCounter -= Main.dayRate; + if (Main.weatherCounter > 0) + break; Main.numClouds = Main.numCloudsTemp; - Main.weatherCounter = Main.rand.Next(3600, 10800); + Main.windSpeedSet = Main.windSpeedTemp; + Main.weatherCounter = Main.rand.Next(3600, 18000); if (Main.netMode != 2) break; NetMessage.SendData(7); @@ -43851,242 +44478,217 @@ label_623: public void LoadBackground(int i) { - if (i < 0 || TextureAssets.Background[i].State != null) + if (i < 0 || Main.backgroundLoaded[i]) return; - Main.Assets.Request(TextureAssets.Background[i].Name, (AssetRequestMode) 1); - Main.backgroundWidth[i] = TextureAssets.Background[i].Width(); - Main.backgroundHeight[i] = TextureAssets.Background[i].Height(); - switch (i) - { - case 219: - case 220: - case 221: - case 235: - case 271: - case 272: - case 273: - case 281: - Main.backgroundWidth[i] /= 2; - Main.backgroundHeight[i] /= 2; - break; - } + Main.backgroundTexture[i] = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "Background_" + (object) i); + Main.backgroundWidth[i] = Main.backgroundTexture[i].Width; + Main.backgroundHeight[i] = Main.backgroundTexture[i].Height; + Main.backgroundLoaded[i] = true; } - public void LoadItem(int i) + protected void LoadNPC(int i) { - if (TextureAssets.Item[i].State != null) + if (Main.NPCLoaded[i] && Main.npcTexture[i] != null) return; - Main.Assets.Request(TextureAssets.Item[i].Name, (AssetRequestMode) 1); + Main.npcTexture[i] = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "NPC_" + (object) i); + Main.NPCLoaded[i] = true; } - public void LoadNPC(int i) + protected void LoadProjectile(int i) { - if (TextureAssets.Npc[i].State != null) + if (Main.projectileLoaded[i]) return; - Main.Assets.Request(TextureAssets.Npc[i].Name, (AssetRequestMode) 1); + Main.projectileTexture[i] = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "Projectile_" + (object) i); + Main.projectileLoaded[i] = true; } - public void LoadProjectile(int i) + protected void LoadGore(int i) { - if (TextureAssets.Projectile[i].State != null) + if (Main.goreLoaded[i]) return; - Main.Assets.Request(TextureAssets.Projectile[i].Name, (AssetRequestMode) 1); + Main.goreTexture[i] = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "Gore_" + (object) i); + Main.goreLoaded[i] = true; } - public void LoadGore(int i) + protected void LoadWall(int i) { - if (TextureAssets.Gore[i].State != null) + if (Main.wallLoaded[i]) return; - Main.Assets.Request(TextureAssets.Gore[i].Name, (AssetRequestMode) 1); + Main.wallTexture[i] = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "Wall_" + (object) i); + Main.wallLoaded[i] = true; } - public void LoadWall(int i) + protected void LoadTiles(int i) { - if (TextureAssets.Wall[i].State != null) + if (Main.tileSetsLoaded[i]) return; - Main.Assets.Request(TextureAssets.Wall[i].Name, (AssetRequestMode) 1); + Main.tileTexture[i] = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "Tiles_" + (object) i); + Main.tileSetsLoaded[i] = true; } - public void LoadTiles(int i) + protected void LoadItemFlames(int i) { - if (TextureAssets.Tile[i].State != null) - return; - Main.Assets.Request(TextureAssets.Tile[i].Name, (AssetRequestMode) 1); - } - - public void LoadItemFlames(int i) - { - if (TextureAssets.ItemFlame[i].State != null) + if (Main.itemFlameLoaded[i]) return; try { - Main.Assets.Request(TextureAssets.ItemFlame[i].Name, (AssetRequestMode) 1); + Main.itemFlameTexture[i] = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "ItemFlame_" + (object) i); } catch { } + Main.itemFlameLoaded[i] = true; } - public void LoadWings(int i) + protected void LoadWings(int i) { - if (TextureAssets.Wings[i].State != null) + if (Main.wingsLoaded[i]) return; - Main.Assets.Request(TextureAssets.Wings[i].Name, (AssetRequestMode) 1); + Main.wingsTexture[i] = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "Wings_" + (object) i); + Main.wingsLoaded[i] = true; } - public void LoadHair(int i) + protected void LoadHair(int i) { - if (TextureAssets.PlayerHair[i].State != null) + if (Main.hairLoaded[i]) return; - Main.Assets.Request(TextureAssets.PlayerHair[i].Name, (AssetRequestMode) 1); - Main.Assets.Request(TextureAssets.PlayerHairAlt[i].Name, (AssetRequestMode) 1); + Main.playerHairTexture[i] = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "Player_Hair_" + (object) (i + 1)); + Main.playerHairAltTexture[i] = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "Player_HairAlt_" + (object) (i + 1)); + Main.hairLoaded[i] = true; } - public void LoadArmorHead(int i) + protected void LoadArmorHead(int i) { - if (TextureAssets.ArmorHead[i].State != null) + if (Main.armorHeadLoaded[i]) return; - Main.Assets.Request(TextureAssets.ArmorHead[i].Name, (AssetRequestMode) 1); + Main.armorHeadTexture[i] = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "Armor_Head_" + (object) i); + Main.armorHeadLoaded[i] = true; } - public void LoadArmorBody(int i) + protected void LoadArmorBody(int i) { - if (ArmorIDs.Body.Sets.UsesNewFramingCode[i]) - { - if (TextureAssets.ArmorBodyComposite[i].State != null) - return; - Main.Assets.Request(TextureAssets.ArmorBodyComposite[i].Name, (AssetRequestMode) 1); - } - else - { - if (TextureAssets.ArmorBody[i].State != null) - return; - Main.Assets.Request(TextureAssets.FemaleBody[i].Name, (AssetRequestMode) 1); - Main.Assets.Request(TextureAssets.ArmorBody[i].Name, (AssetRequestMode) 1); - Main.Assets.Request(TextureAssets.ArmorArm[i].Name, (AssetRequestMode) 1); - } - } - - public void LoadArmorLegs(int i) - { - if (TextureAssets.ArmorLeg[i].State != null) + if (Main.armorBodyLoaded[i]) return; - Main.Assets.Request(TextureAssets.ArmorLeg[i].Name, (AssetRequestMode) 1); + Main.femaleBodyTexture[i] = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "Female_Body_" + (object) i); + Main.armorBodyTexture[i] = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "Armor_Body_" + (object) i); + Main.armorArmTexture[i] = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "Armor_Arm_" + (object) i); + Main.armorBodyLoaded[i] = true; } - public void LoadAccHandsOn(int i) + protected void LoadArmorLegs(int i) { - if (TextureAssets.AccHandsOn[i].State == null) - Main.Assets.Request(TextureAssets.AccHandsOn[i].Name, (AssetRequestMode) 1); - if (!ArmorIDs.HandOn.Sets.UsesNewFramingCode[i] || TextureAssets.AccHandsOnComposite[i].State != null) + if (Main.armorLegsLoaded[i]) return; - Main.Assets.Request(TextureAssets.AccHandsOnComposite[i].Name, (AssetRequestMode) 1); + Main.armorLegTexture[i] = this.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "Armor_Legs_" + (object) i); + Main.armorLegsLoaded[i] = true; } - public void LoadAccHandsOff(int i) + protected void LoadAccHandsOn(int i) { - if (TextureAssets.AccHandsOff[i].State == null) - Main.Assets.Request(TextureAssets.AccHandsOff[i].Name, (AssetRequestMode) 1); - if (!ArmorIDs.HandOff.Sets.UsesNewFramingCode[i] || TextureAssets.AccHandsOffComposite[i].State != null) + if (Main.accHandsOnLoaded[i]) return; - Main.Assets.Request(TextureAssets.AccHandsOffComposite[i].Name, (AssetRequestMode) 1); + Main.accHandsOnTexture[i] = this.OurLoad("Images/Acc_HandsOn_" + (object) i); + Main.accHandsOnLoaded[i] = true; } - public void LoadAccBack(int i) + protected void LoadAccHandsOff(int i) { - if (TextureAssets.AccBack[i].State != null) + if (Main.accHandsOffLoaded[i]) return; - Main.Assets.Request(TextureAssets.AccBack[i].Name, (AssetRequestMode) 1); + Main.accHandsOffTexture[i] = this.OurLoad("Images/Acc_HandsOff_" + (object) i); + Main.accHandsOffLoaded[i] = true; } - public void LoadAccFront(int i) + protected void LoadAccBack(int i) { - if (TextureAssets.AccFront[i].State != null) + if (Main.accBackLoaded[i]) return; - Main.Assets.Request(TextureAssets.AccFront[i].Name, (AssetRequestMode) 1); + Main.accBackTexture[i] = this.OurLoad("Images/Acc_Back_" + (object) i); + Main.accBackLoaded[i] = true; } - public void LoadAccShoes(int i) + protected void LoadAccFront(int i) { - if (TextureAssets.AccShoes[i].State != null) + if (Main.accFrontLoaded[i]) return; - Main.Assets.Request(TextureAssets.AccShoes[i].Name, (AssetRequestMode) 1); + Main.accFrontTexture[i] = this.OurLoad("Images/Acc_Front_" + (object) i); + Main.accFrontLoaded[i] = true; } - public void LoadAccWaist(int i) + protected void LoadAccShoes(int i) { - if (TextureAssets.AccWaist[i].State != null) + if (Main.accShoesLoaded[i]) return; - Main.Assets.Request(TextureAssets.AccWaist[i].Name, (AssetRequestMode) 1); + Main.accShoesTexture[i] = this.OurLoad("Images/Acc_Shoes_" + (object) i); + Main.accShoesLoaded[i] = true; } - public void LoadAccShield(int i) + protected void LoadAccWaist(int i) { - if (TextureAssets.AccShield[i].State != null) + if (Main.accWaistLoaded[i]) return; - Main.Assets.Request(TextureAssets.AccShield[i].Name, (AssetRequestMode) 1); + Main.accWaistTexture[i] = this.OurLoad("Images/Acc_Waist_" + (object) i); + Main.accWaistLoaded[i] = true; } - public void LoadAccNeck(int i) + protected void LoadAccShield(int i) { - if (TextureAssets.AccNeck[i].State != null) + if (Main.accShieldLoaded[i]) return; - Main.Assets.Request(TextureAssets.AccNeck[i].Name, (AssetRequestMode) 1); + Main.accShieldTexture[i] = this.OurLoad("Images/Acc_Shield_" + (object) i); + Main.accShieldLoaded[i] = true; } - public void LoadAccFace(int i) + protected void LoadAccNeck(int i) { - if (TextureAssets.AccFace[i].State != null) + if (Main.accNeckLoaded[i]) return; - Main.Assets.Request(TextureAssets.AccFace[i].Name, (AssetRequestMode) 1); + Main.accNeckTexture[i] = this.OurLoad("Images/Acc_Neck_" + (object) i); + Main.accNeckLoaded[i] = true; } - public void LoadAccBalloon(int i) + protected void LoadAccFace(int i) { - if (TextureAssets.AccBalloon[i].State != null) + if (Main.accFaceLoaded[i]) return; - Main.Assets.Request(TextureAssets.AccBalloon[i].Name, (AssetRequestMode) 1); + Main.accFaceTexture[i] = this.OurLoad("Images/Acc_Face_" + (object) i); + Main.accFaceLoaded[i] = true; } - public void LoadFlameRing() + protected void LoadAccBalloon(int i) { - if (TextureAssets.FlameRing.State != null) + if (Main.accballoonLoaded[i]) return; - Main.Assets.Request(TextureAssets.FlameRing.Name, (AssetRequestMode) 1); + Main.accBalloonTexture[i] = this.OurLoad("Images/Acc_Balloon_" + (object) i); + Main.accballoonLoaded[i] = true; + } + + protected void LoadFlameRing() + { + if (Main.flameRingLoaded) + return; + this.flameRingTexture = this.OurLoad("Images/FlameRing"); + Main.flameRingLoaded = true; } protected void DrawSurfaceBG() { - Microsoft.Xna.Framework.Color surfaceBackgroundsBase = Main.ColorOfSurfaceBackgroundsBase; - int num1 = 30; - if (Main.gameMenu) - num1 = 0; - if (WorldGen.drunkWorldGen) - num1 = -180; - float num2 = (float) Main.worldSurface; - if ((double) num2 == 0.0) - num2 = 1f; - Vector2 screenPosition = Main.screenPosition; - double num3 = (double) Main.screenPosition.Y + (double) (Main.screenHeight / 2) - 600.0; - double num4 = -(double) MathHelper.Lerp((float) ((num3 - (double) this.screenOff / 2.0) / ((double) num2 * 16.0)), 1f, 0.0f); - double backgroundTopMagicNumber = (-num3 + (double) this.screenOff / 2.0) / ((double) num2 * 16.0); - float bgGlobalScaleMultiplier = 2f; - int num5 = 0; - float num6 = SkyManager.Instance.ProcessCloudAlpha() * Main.atmo; + float num1 = SkyManager.Instance.ProcessCloudAlpha(); if (!Main.mapFullscreen && (double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) { for (int index = 0; index < 200; ++index) { if (Main.cloud[index].active && (double) Main.cloud[index].scale < 1.0) { - Microsoft.Xna.Framework.Color color = Main.cloud[index].cloudColor(Main.ColorOfTheSkies); - float num7 = Main.cloud[index].scale * 0.8f; - float num8 = (float) (((double) Main.cloud[index].scale + 1.0) / 2.0 * 0.899999976158142); - color.R = (byte) ((double) color.R * (double) num7); - color.G = (byte) ((double) color.G * (double) num8); - float num9 = Main.cloud[index].position.Y * ((float) Main.screenHeight / 600f); - float num10 = Main.cloud[index].position.Y + (float) (int) (backgroundTopMagicNumber * 750.0 + 830.0) + (float) (int) this.scAdj + (float) num5; - Main.spriteBatch.Draw(TextureAssets.Cloud[Main.cloud[index].type].Value, new Vector2(Main.cloud[index].position.X + (float) TextureAssets.Cloud[Main.cloud[index].type].Width() * 0.5f, num10 + (float) TextureAssets.Cloud[Main.cloud[index].type].Height() * 0.5f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Cloud[Main.cloud[index].type].Width(), TextureAssets.Cloud[Main.cloud[index].type].Height())), color * num6, Main.cloud[index].rotation, new Vector2((float) TextureAssets.Cloud[Main.cloud[index].type].Width() * 0.5f, (float) TextureAssets.Cloud[Main.cloud[index].type].Height() * 0.5f), Main.cloud[index].scale, Main.cloud[index].spriteDir, 0.0f); + Microsoft.Xna.Framework.Color color = Main.cloud[index].cloudColor(Main.bgColor); + float num2 = Main.cloud[index].scale * 0.8f; + float num3 = (float) (((double) Main.cloud[index].scale + 1.0) / 2.0 * 0.899999976158142); + color.R = (byte) ((double) color.R * (double) num2); + color.G = (byte) ((double) color.G * (double) num3); + Main.atmo = 1f; + float num4 = Main.cloud[index].position.Y * ((float) Main.screenHeight / 600f); + float num5 = Main.cloud[index].position.Y + (float) (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 750.0 + 830.0) + (float) (int) this.scAdj; + Main.spriteBatch.Draw(Main.cloudTexture[Main.cloud[index].type], new Vector2(Main.cloud[index].position.X + (float) Main.cloudTexture[Main.cloud[index].type].Width * 0.5f, num5 + (float) Main.cloudTexture[Main.cloud[index].type].Height * 0.5f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.cloudTexture[Main.cloud[index].type].Width, Main.cloudTexture[Main.cloud[index].type].Height)), color * num1, Main.cloud[index].rotation, new Vector2((float) Main.cloudTexture[Main.cloud[index].type].Width * 0.5f, (float) Main.cloudTexture[Main.cloud[index].type].Height * 0.5f), Main.cloud[index].scale, Main.cloud[index].spriteDir, 0.0f); } } } @@ -44095,14 +44697,17 @@ label_623: else if (Main.invasionType != 4 && SkyManager.Instance["Martian"].IsActive()) SkyManager.Instance.Deactivate("Martian"); SkyManager.Instance.ResetDepthTracker(); + Main.atmo = 1f; + Main.bgScale *= 2f; this.bgParallax = 0.15; - int num11 = -180; - bool flag = true; - int num12 = 0; - if (Main.gameMenu) - num12 -= num11; - int pushBGTopHack = num12 + num1; - if (!WorldGen.drunkWorldGen && !Main.mapFullscreen && (double) Main.screenPosition.Y / 16.0 <= Main.worldSurface + 10.0) + if ((double) Main.atmo < 1.0) + { + Main.backColor.R = (byte) ((double) Main.backColor.R * (double) Main.atmo); + Main.backColor.G = (byte) ((double) Main.backColor.G * (double) Main.atmo); + Main.backColor.B = (byte) ((double) Main.backColor.B * (double) Main.atmo); + Main.backColor.A = (byte) ((double) Main.backColor.A * (double) Main.atmo); + } + if (!Main.mapFullscreen && (double) Main.screenPosition.Y / 16.0 <= Main.worldSurface + 10.0) { if (Main.BackgroundEnabled) { @@ -44122,256 +44727,1040 @@ label_623: { this.LoadBackground(Main.cloudBG[0]); this.LoadBackground(Main.cloudBG[1]); - float num13 = Main.cloudBGAlpha; - if ((double) num13 > 1.0) - num13 = 1f; + Main.bgScale *= 2f; + this.bgParallax = 0.15; + float num6 = Main.cloudBGAlpha; + if ((double) num6 > 1.0) + num6 = 1f; Main.bgScale = 1.65f; this.bgParallax = 0.0900000035762787; - if (this.IsActive && !Main.gamePaused) - Main.cloudBGX[0] += (float) ((double) Main.windSpeedCurrent * this.bgParallax * 9.0) * (float) Main.dayRate; + if (this.IsActive) + Main.cloudBGX[0] += (float) ((double) Main.windSpeed * this.bgParallax * 5.0) * (float) Main.dayRate; if ((double) Main.cloudBGX[0] > (double) Main.backgroundWidth[Main.cloudBG[0]] * (double) Main.bgScale) Main.cloudBGX[0] -= (float) Main.backgroundWidth[Main.cloudBG[0]] * Main.bgScale; if ((double) Main.cloudBGX[0] < (double) -Main.backgroundWidth[Main.cloudBG[0]] * (double) Main.bgScale) Main.cloudBGX[0] += (float) Main.backgroundWidth[Main.cloudBG[0]] * Main.bgScale; - float num14 = (float) Main.backgroundWidth[Main.cloudBG[0]] * Main.bgScale; - this.bgTopY = (int) (backgroundTopMagicNumber * 900.0 + 600.0) + (int) this.scAdj + pushBGTopHack; + Main.bgW = (int) ((double) Main.backgroundWidth[Main.cloudBG[0]] * (double) Main.bgScale); + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 900.0 + 600.0) + (int) this.scAdj; if (Main.gameMenu) - this.bgTopY = pushBGTopHack - 150; - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) num14) - (double) num14 / 2.0 - (double) num14); - this.bgStartX += (int) Main.cloudBGX[0]; - this.bgLoops = Main.screenWidth / (int) num14 + 2 + 2; - Main.ColorOfSurfaceBackgroundsModified = surfaceBackgroundsBase * num13; + this.bgTop = -150; + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2) - (double) Main.bgW); + this.bgStart += (int) Main.cloudBGX[0]; + this.bgLoops = Main.screenWidth / Main.bgW + 2 + 2; + Main.backColor = Main.trueBackColor; + Main.backColor.R = (byte) ((double) Main.backColor.R * (double) num6); + Main.backColor.G = (byte) ((double) Main.backColor.G * (double) num6); + Main.backColor.B = (byte) ((double) Main.backColor.B * (double) num6); + Main.backColor.A = (byte) ((double) Main.backColor.A * (double) num6); SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); for (int index = 0; index < this.bgLoops; ++index) - Main.spriteBatch.Draw(TextureAssets.Background[Main.cloudBG[0]].Value, new Vector2((float) this.bgStartX + num14 * (float) index, (float) this.bgTopY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[Main.cloudBG[0]], Main.backgroundHeight[Main.cloudBG[0]])), Main.ColorOfSurfaceBackgroundsModified * num6, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); - float num15 = Main.cloudBGAlpha * 1.5f; - if ((double) num15 > 1.0) - num15 = 1f; - Main.ColorOfSurfaceBackgroundsModified = surfaceBackgroundsBase * num15; + Main.spriteBatch.Draw(Main.backgroundTexture[Main.cloudBG[0]], new Vector2((float) (this.bgStart + Main.bgW * index), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[Main.cloudBG[0]], Main.backgroundHeight[Main.cloudBG[0]])), Main.backColor * num1, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + float num7 = Main.cloudBGAlpha * 1.5f; + if ((double) num7 > 1.0) + num7 = 1f; + Main.backColor = Main.trueBackColor; + Main.backColor.R = (byte) ((double) Main.backColor.R * (double) num7); + Main.backColor.G = (byte) ((double) Main.backColor.G * (double) num7); + Main.backColor.B = (byte) ((double) Main.backColor.B * (double) num7); + Main.backColor.A = (byte) ((double) Main.backColor.A * (double) num7); Main.bgScale = 1.85f; this.bgParallax = 0.12; - if (this.IsActive && !Main.gamePaused) - Main.cloudBGX[1] += (float) ((double) Main.windSpeedCurrent * this.bgParallax * 9.0) * (float) Main.dayRate; + if (this.IsActive) + Main.cloudBGX[1] += (float) ((double) Main.windSpeed * this.bgParallax * 5.0) * (float) Main.dayRate; if ((double) Main.cloudBGX[1] > (double) Main.backgroundWidth[Main.cloudBG[1]] * (double) Main.bgScale) Main.cloudBGX[1] -= (float) Main.backgroundWidth[Main.cloudBG[1]] * Main.bgScale; if ((double) Main.cloudBGX[1] < (double) -Main.backgroundWidth[Main.cloudBG[1]] * (double) Main.bgScale) Main.cloudBGX[1] += (float) Main.backgroundWidth[Main.cloudBG[1]] * Main.bgScale; - float num16 = (float) Main.backgroundWidth[Main.cloudBG[1]] * Main.bgScale; - this.bgTopY = (int) (backgroundTopMagicNumber * 1100.0 + 750.0) + (int) this.scAdj + pushBGTopHack; + Main.bgW = (int) ((double) Main.backgroundWidth[Main.cloudBG[1]] * (double) Main.bgScale); + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 1100.0 + 750.0) + (int) this.scAdj; if (Main.gameMenu) - this.bgTopY = pushBGTopHack - 50; - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) num16) - (double) num16 / 2.0 - (double) num16); - this.bgStartX += (int) Main.cloudBGX[1]; - this.bgLoops = Main.screenWidth / (int) num16 + 2 + 2; + this.bgTop = -50; + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2) - (double) Main.bgW); + this.bgStart += (int) Main.cloudBGX[1]; + this.bgLoops = Main.screenWidth / Main.bgW + 2 + 2; SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); for (int index = 0; index < this.bgLoops; ++index) - Main.spriteBatch.Draw(TextureAssets.Background[Main.cloudBG[1]].Value, new Vector2((float) this.bgStartX + num16 * (float) index, (float) this.bgTopY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[Main.cloudBG[1]], Main.backgroundHeight[Main.cloudBG[1]])), Main.ColorOfSurfaceBackgroundsModified * num6, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.backgroundTexture[Main.cloudBG[1]], new Vector2((float) (this.bgStart + Main.bgW * index), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[Main.cloudBG[1]], Main.backgroundHeight[Main.cloudBG[1]])), Main.backColor * num1, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } + this.LoadBackground(Main.treeMntBG[0]); + this.LoadBackground(Main.treeMntBG[1]); + Main.bgScale = 1f; + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 1300.0 + 1090.0) + (int) this.scAdj; + Main.bgScale *= 2f; + this.bgParallax = 0.15; + Main.bgW = (int) ((double) Main.backgroundWidth[Main.treeMntBG[0]] * (double) Main.bgScale); + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2)); + if (Main.bgW == 0) + Main.bgW = 1024; + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if (Main.gameMenu) + this.bgTop = 100; + if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + Main.backColor = Main.trueBackColor; + Main.backColor.R = (byte) ((double) Main.backColor.R * (double) Main.bgAlpha2[0]); + Main.backColor.G = (byte) ((double) Main.backColor.G * (double) Main.bgAlpha2[0]); + Main.backColor.B = (byte) ((double) Main.backColor.B * (double) Main.bgAlpha2[0]); + Main.backColor.A = (byte) ((double) Main.backColor.A * (double) Main.bgAlpha2[0]); + if ((double) Main.bgAlpha2[0] > 0.0) + { + if (Main.treeMntBG[0] == 93 || Main.treeMntBG[0] >= 168 && Main.treeMntBG[0] <= 170) + this.bgTop -= 50; + if (Main.treeMntBG[0] == 171) + this.bgTop -= 100; + if (Main.treeMntBG[0] == 176) + this.bgTop += 250; + if (Main.treeMntBG[0] == 179) + this.bgTop -= 100; + for (int index = 0; index < this.bgLoops; ++index) + Main.spriteBatch.Draw(Main.backgroundTexture[Main.treeMntBG[0]], new Vector2((float) (this.bgStart + Main.bgW * index), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[Main.treeMntBG[0]], Main.backgroundHeight[Main.treeMntBG[0]])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + if (Main.treeMntBG[0] == 93 || Main.treeMntBG[0] >= 168 && Main.treeMntBG[0] <= 170) + this.bgTop += 50; + if (Main.treeMntBG[0] == 171) + this.bgTop += 100; + if (Main.treeMntBG[0] == 176) + this.bgTop -= 250; + if (Main.treeMntBG[0] == 179) + this.bgTop += 100; + } + Main.backColor = Main.trueBackColor; + Main.backColor.R = (byte) ((double) Main.backColor.R * (double) Main.bgAlpha2[1]); + Main.backColor.G = (byte) ((double) Main.backColor.G * (double) Main.bgAlpha2[1]); + Main.backColor.B = (byte) ((double) Main.backColor.B * (double) Main.bgAlpha2[1]); + Main.backColor.A = (byte) ((double) Main.backColor.A * (double) Main.bgAlpha2[1]); + if ((double) Main.bgAlpha2[1] > 0.0) + { + this.LoadBackground(23); + for (int index = 0; index < this.bgLoops; ++index) + Main.spriteBatch.Draw(Main.backgroundTexture[23], new Vector2((float) (this.bgStart + Main.bgW * index), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[23], Main.backgroundHeight[23])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } + Main.backColor = Main.trueBackColor; + Main.backColor.R = (byte) ((double) Main.backColor.R * (double) Main.bgAlpha2[2]); + Main.backColor.G = (byte) ((double) Main.backColor.G * (double) Main.bgAlpha2[2]); + Main.backColor.B = (byte) ((double) Main.backColor.B * (double) Main.bgAlpha2[2]); + Main.backColor.A = (byte) ((double) Main.backColor.A * (double) Main.bgAlpha2[2]); + if ((double) Main.bgAlpha2[2] > 0.0) + { + this.LoadBackground(24); + for (int index = 0; index < this.bgLoops; ++index) + Main.spriteBatch.Draw(Main.backgroundTexture[24], new Vector2((float) (this.bgStart + Main.bgW * index), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[24], Main.backgroundHeight[24])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } + Main.backColor = Main.trueBackColor; + Main.backColor.R = (byte) ((double) Main.backColor.R * (double) Main.bgAlpha2[4]); + Main.backColor.G = (byte) ((double) Main.backColor.G * (double) Main.bgAlpha2[4]); + Main.backColor.B = (byte) ((double) Main.backColor.B * (double) Main.bgAlpha2[4]); + Main.backColor.A = (byte) ((double) Main.backColor.A * (double) Main.bgAlpha2[4]); + if ((double) Main.bgAlpha2[4] > 0.0) + { + this.LoadBackground(Main.snowMntBG[0]); + for (int index = 0; index < this.bgLoops; ++index) + Main.spriteBatch.Draw(Main.backgroundTexture[Main.snowMntBG[0]], new Vector2((float) (this.bgStart + Main.bgW * index), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[Main.snowMntBG[0]], Main.backgroundHeight[Main.snowMntBG[0]])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } + Main.backColor = Main.trueBackColor; + Main.backColor.R = (byte) ((double) Main.backColor.R * (double) Main.bgAlpha2[5]); + Main.backColor.G = (byte) ((double) Main.backColor.G * (double) Main.bgAlpha2[5]); + Main.backColor.B = (byte) ((double) Main.backColor.B * (double) Main.bgAlpha2[5]); + Main.backColor.A = (byte) ((double) Main.backColor.A * (double) Main.bgAlpha2[5]); + if ((double) Main.bgAlpha2[5] > 0.0) + { + this.LoadBackground(24); + for (int index = 0; index < this.bgLoops; ++index) + Main.spriteBatch.Draw(Main.backgroundTexture[24], new Vector2((float) (this.bgStart + Main.bgW * index), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[24], Main.backgroundHeight[24])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 5f); } - this.DrawSurfaceBG_BackMountainsStep1(backgroundTopMagicNumber, bgGlobalScaleMultiplier, pushBGTopHack); } - this.cTop = (float) (this.bgTopY - 50); + this.cTop = (float) (this.bgTop - 50); if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) { for (int index = 0; index < 200; ++index) { if (Main.cloud[index].active && (double) Main.cloud[index].scale < 1.15 && (double) Main.cloud[index].scale >= 1.0) { - Microsoft.Xna.Framework.Color color = Main.cloud[index].cloudColor(Main.ColorOfTheSkies); + Microsoft.Xna.Framework.Color color = Main.cloud[index].cloudColor(Main.bgColor); if ((double) Main.atmo < 1.0) - color *= Main.atmo; - float num17 = Main.cloud[index].position.Y * ((float) Main.screenHeight / 600f); - float num18 = (float) (((double) Main.screenPosition.Y / 16.0 - 24.0) / Main.worldSurface); - if ((double) num18 < 0.0) - num18 = 0.0f; - float num19; - if ((double) num18 > 1.0) - num19 = 1f; + { + color.R = (byte) ((double) color.R * (double) Main.atmo); + color.G = (byte) ((double) color.G * (double) Main.atmo); + color.B = (byte) ((double) color.B * (double) Main.atmo); + color.A = (byte) ((double) color.A * (double) Main.atmo); + } + float num8 = Main.cloud[index].position.Y * ((float) Main.screenHeight / 600f); + float num9 = (float) (((double) Main.screenPosition.Y / 16.0 - 24.0) / Main.worldSurface); + if ((double) num9 < 0.0) + num9 = 0.0f; + float num10; + if ((double) num9 > 1.0) + num10 = 1f; if (Main.gameMenu) - num19 = 1f; - Main.spriteBatch.Draw(TextureAssets.Cloud[Main.cloud[index].type].Value, new Vector2(Main.cloud[index].position.X + (float) TextureAssets.Cloud[Main.cloud[index].type].Width() * 0.5f, (float) ((double) num17 + (double) TextureAssets.Cloud[Main.cloud[index].type].Height() * 0.5 + (double) this.cTop + 200.0)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Cloud[Main.cloud[index].type].Width(), TextureAssets.Cloud[Main.cloud[index].type].Height())), color * num6, Main.cloud[index].rotation, new Vector2((float) TextureAssets.Cloud[Main.cloud[index].type].Width() * 0.5f, (float) TextureAssets.Cloud[Main.cloud[index].type].Height() * 0.5f), Main.cloud[index].scale, Main.cloud[index].spriteDir, 0.0f); + num10 = 1f; + Main.spriteBatch.Draw(Main.cloudTexture[Main.cloud[index].type], new Vector2(Main.cloud[index].position.X + (float) Main.cloudTexture[Main.cloud[index].type].Width * 0.5f, (float) ((double) num8 + (double) Main.cloudTexture[Main.cloud[index].type].Height * 0.5 + (double) this.cTop + 200.0)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.cloudTexture[Main.cloud[index].type].Width, Main.cloudTexture[Main.cloud[index].type].Height)), color * num1, Main.cloud[index].rotation, new Vector2((float) Main.cloudTexture[Main.cloud[index].type].Width * 0.5f, (float) Main.cloudTexture[Main.cloud[index].type].Height * 0.5f), Main.cloud[index].scale, Main.cloud[index].spriteDir, 0.0f); } } } - if (Main.SceneMetrics.HolyTileCount > 0 && Main.BackgroundEnabled) + if (Main.holyTiles > 0 && Main.BackgroundEnabled) { this.bgParallax = 0.17; Main.bgScale = 1.1f; - this.bgTopY = (int) (backgroundTopMagicNumber * 1400.0 + 900.0) + (int) this.scAdj + pushBGTopHack; - this.SetBackgroundOffsets(18, backgroundTopMagicNumber, pushBGTopHack); - Main.bgScale *= bgGlobalScaleMultiplier; - Main.bgWidthScaled = (int) (2100.0 * (double) Main.bgScale * 1.05); - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgWidthScaled) - (double) (Main.bgWidthScaled / 2)); - this.bgLoops = Main.screenWidth / Main.bgWidthScaled + 2; + Main.bgScale *= 2f; + Main.bgW = (int) (3500.0 * (double) Main.bgScale * 1.05); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2)); + this.bgLoops = Main.screenWidth / Main.bgW + 2; + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 1400.0 + 900.0) + (int) this.scAdj; if (Main.gameMenu) { - this.bgTopY = 230 + pushBGTopHack; - this.bgStartX -= 500; + this.bgTop = 230; + this.bgStart -= 500; } SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); - Microsoft.Xna.Framework.Color color = surfaceBackgroundsBase; - float num20 = (float) (Main.SceneMetrics.HolyTileCount - SceneMetrics.HallowTileThreshold) / (float) (SceneMetrics.HallowTileMax - SceneMetrics.HallowTileThreshold); - if ((double) num20 > 0.5) - num20 = 0.5f; - else if ((double) num20 < 0.0) - num20 = 0.0f; - color.R = (byte) ((double) color.R * (double) num20); - color.G = (byte) ((double) color.G * (double) num20); - color.B = (byte) ((double) color.B * (double) num20); - color.A = (byte) ((double) color.A * (double) num20 * 0.800000011920929); + Microsoft.Xna.Framework.Color trueBackColor = Main.trueBackColor; + float num11 = (float) Main.holyTiles / 400f; + if ((double) num11 > 0.5) + num11 = 0.5f; + trueBackColor.R = (byte) ((double) trueBackColor.R * (double) num11); + trueBackColor.G = (byte) ((double) trueBackColor.G * (double) num11); + trueBackColor.B = (byte) ((double) trueBackColor.B * (double) num11); + trueBackColor.A = (byte) ((double) trueBackColor.A * (double) num11 * 0.800000011920929); if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) { this.LoadBackground(18); this.LoadBackground(19); for (int index = 0; index < this.bgLoops; ++index) { - Main.spriteBatch.Draw(TextureAssets.Background[18].Value, new Vector2((float) (this.bgStartX + Main.bgWidthScaled * index), (float) this.bgTopY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[18], Main.backgroundHeight[18])), color, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(TextureAssets.Background[19].Value, new Vector2((float) (this.bgStartX + Main.bgWidthScaled * index + 1900), (float) (this.bgTopY + 100)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[19], Main.backgroundHeight[19])), color, 0.0f, new Vector2(), Main.bgScale * 0.9f, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.backgroundTexture[18], new Vector2((float) (this.bgStart + Main.bgW * index), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[18], Main.backgroundHeight[18])), trueBackColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.backgroundTexture[19], new Vector2((float) (this.bgStart + Main.bgW * index + 1700), (float) (this.bgTop + 100)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[19], Main.backgroundHeight[19])), trueBackColor, 0.0f, new Vector2(), Main.bgScale * 0.9f, SpriteEffects.None, 0.0f); } } } - if (Main.treeMntBGSet1[1] > -1) + if (Main.treeMntBG[1] > -1) { - this.LoadBackground(Main.treeMntBGSet1[1]); + this.LoadBackground(Main.treeMntBG[1]); this.bgParallax = 0.2; Main.bgScale = 1.15f; - Main.bgScale *= bgGlobalScaleMultiplier; - int num21 = Main.backgroundWidth[Main.treeMntBGSet1[1]]; - if (num21 == 0) - num21 = 1; - Main.bgWidthScaled = (int) ((double) num21 * (double) Main.bgScale); - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgWidthScaled) - (double) (Main.bgWidthScaled / 2)); - this.bgLoops = Main.screenWidth / Main.bgWidthScaled + 2; - if (Main.treeMntBGSet1[1] == 172) - ++this.bgLoops; - this.bgTopY = (int) (backgroundTopMagicNumber * 1400.0 + 1260.0) + (int) this.scAdj + pushBGTopHack; + Main.bgScale *= 2f; + Main.bgW = (int) ((double) Main.backgroundWidth[Main.treeMntBG[1]] * (double) Main.bgScale); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2)); + this.bgLoops = Main.screenWidth / Main.bgW + 2; + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 1400.0 + 1260.0) + (int) this.scAdj; } if (Main.BackgroundEnabled) - this.DrawSurfaceBG_BackMountainsStep2(pushBGTopHack); - this.cTop = (float) ((double) this.bgTopY * 1.00999999046326 - 150.0); + { + if (Main.gameMenu) + { + this.bgTop = 230; + this.bgStart -= 500; + } + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); + if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + Main.backColor = Main.trueBackColor; + Main.backColor.R = (byte) ((double) Main.backColor.R * (double) Main.bgAlpha2[0]); + Main.backColor.G = (byte) ((double) Main.backColor.G * (double) Main.bgAlpha2[0]); + Main.backColor.B = (byte) ((double) Main.backColor.B * (double) Main.bgAlpha2[0]); + Main.backColor.A = (byte) ((double) Main.backColor.A * (double) Main.bgAlpha2[0]); + if ((double) Main.bgAlpha2[0] > 0.0 && Main.treeMntBG[1] > -1) + { + if (Main.treeMntBG[1] == 172) + this.bgTop += 130; + if (Main.treeMntBG[1] == 177) + this.bgTop += 200; + if (Main.treeMntBG[1] >= 180 && Main.treeMntBG[1] <= 183) + this.bgTop -= 350; + for (int index = 0; index < this.bgLoops; ++index) + Main.spriteBatch.Draw(Main.backgroundTexture[Main.treeMntBG[1]], new Vector2((float) (this.bgStart + Main.bgW * index), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[Main.treeMntBG[1]], Main.backgroundHeight[Main.treeMntBG[1]])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + if (Main.treeMntBG[1] == 172) + this.bgTop -= 130; + if (Main.treeMntBG[1] == 177) + this.bgTop -= 200; + if (Main.treeMntBG[1] >= 180 && Main.treeMntBG[1] <= 183) + this.bgTop += 350; + } + Main.backColor = Main.trueBackColor; + Main.backColor.R = (byte) ((double) Main.backColor.R * (double) Main.bgAlpha2[1]); + Main.backColor.G = (byte) ((double) Main.backColor.G * (double) Main.bgAlpha2[1]); + Main.backColor.B = (byte) ((double) Main.backColor.B * (double) Main.bgAlpha2[1]); + Main.backColor.A = (byte) ((double) Main.backColor.A * (double) Main.bgAlpha2[1]); + if ((double) Main.bgAlpha2[1] > 0.0) + { + this.LoadBackground(22); + for (int index = 0; index < this.bgLoops; ++index) + Main.spriteBatch.Draw(Main.backgroundTexture[22], new Vector2((float) (this.bgStart + Main.bgW * index), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[22], Main.backgroundHeight[22])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } + Main.backColor = Main.trueBackColor; + Main.backColor.R = (byte) ((double) Main.backColor.R * (double) Main.bgAlpha2[2]); + Main.backColor.G = (byte) ((double) Main.backColor.G * (double) Main.bgAlpha2[2]); + Main.backColor.B = (byte) ((double) Main.backColor.B * (double) Main.bgAlpha2[2]); + Main.backColor.A = (byte) ((double) Main.backColor.A * (double) Main.bgAlpha2[2]); + if ((double) Main.bgAlpha2[2] > 0.0) + { + this.LoadBackground(25); + for (int index = 0; index < this.bgLoops; ++index) + Main.spriteBatch.Draw(Main.backgroundTexture[25], new Vector2((float) (this.bgStart + Main.bgW * index), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[25], Main.backgroundHeight[25])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } + Main.backColor = Main.trueBackColor; + Main.backColor.R = (byte) ((double) Main.backColor.R * (double) Main.bgAlpha2[3]); + Main.backColor.G = (byte) ((double) Main.backColor.G * (double) Main.bgAlpha2[3]); + Main.backColor.B = (byte) ((double) Main.backColor.B * (double) Main.bgAlpha2[3]); + Main.backColor.A = (byte) ((double) Main.backColor.A * (double) Main.bgAlpha2[3]); + if ((double) Main.bgAlpha2[3] > 0.0) + { + this.LoadBackground(Main.oceanBG); + for (int index = 0; index < this.bgLoops; ++index) + Main.spriteBatch.Draw(Main.backgroundTexture[Main.oceanBG], new Vector2((float) (this.bgStart + Main.bgW * index), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[Main.oceanBG], Main.backgroundHeight[Main.oceanBG])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } + Main.backColor = Main.trueBackColor; + Main.backColor.R = (byte) ((double) Main.backColor.R * (double) Main.bgAlpha2[4]); + Main.backColor.G = (byte) ((double) Main.backColor.G * (double) Main.bgAlpha2[4]); + Main.backColor.B = (byte) ((double) Main.backColor.B * (double) Main.bgAlpha2[4]); + Main.backColor.A = (byte) ((double) Main.backColor.A * (double) Main.bgAlpha2[4]); + if ((double) Main.bgAlpha2[4] > 0.0) + { + this.LoadBackground(Main.snowMntBG[1]); + for (int index = 0; index < this.bgLoops; ++index) + Main.spriteBatch.Draw(Main.backgroundTexture[Main.snowMntBG[1]], new Vector2((float) (this.bgStart + Main.bgW * index), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[Main.snowMntBG[1]], Main.backgroundHeight[Main.snowMntBG[1]])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } + Main.backColor = Main.trueBackColor; + Main.backColor.R = (byte) ((double) Main.backColor.R * (double) Main.bgAlpha2[5]); + Main.backColor.G = (byte) ((double) Main.backColor.G * (double) Main.bgAlpha2[5]); + Main.backColor.B = (byte) ((double) Main.backColor.B * (double) Main.bgAlpha2[5]); + Main.backColor.A = (byte) ((double) Main.backColor.A * (double) Main.bgAlpha2[5]); + if ((double) Main.bgAlpha2[5] > 0.0) + { + this.LoadBackground(42); + for (int index = 0; index < this.bgLoops; ++index) + Main.spriteBatch.Draw(Main.backgroundTexture[42], new Vector2((float) (this.bgStart + Main.bgW * index), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[42], Main.backgroundHeight[42])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } + } + } + this.cTop = (float) ((double) this.bgTop * 1.00999999046326 - 150.0); if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) { for (int index = 0; index < 200; ++index) { if (Main.cloud[index].active && (double) Main.cloud[index].scale >= 1.14999997615814) { - Microsoft.Xna.Framework.Color color = Main.cloud[index].cloudColor(Main.ColorOfTheSkies); + Microsoft.Xna.Framework.Color color = Main.cloud[index].cloudColor(Main.bgColor); if ((double) Main.atmo < 1.0) - color *= Main.atmo; - float num22 = (float) ((double) Main.cloud[index].position.Y * ((double) Main.screenHeight / 600.0) - 100.0); - float num23 = (float) (((double) Main.screenPosition.Y / 16.0 - 24.0) / Main.worldSurface); - if ((double) num23 < 0.0) - num23 = 0.0f; - float num24; - if ((double) num23 > 1.0) - num24 = 1f; + { + color.R = (byte) ((double) color.R * (double) Main.atmo); + color.G = (byte) ((double) color.G * (double) Main.atmo); + color.B = (byte) ((double) color.B * (double) Main.atmo); + color.A = (byte) ((double) color.A * (double) Main.atmo); + } + float num12 = (float) ((double) Main.cloud[index].position.Y * ((double) Main.screenHeight / 600.0) - 100.0); + float num13 = (float) (((double) Main.screenPosition.Y / 16.0 - 24.0) / Main.worldSurface); + if ((double) num13 < 0.0) + num13 = 0.0f; + float num14; + if ((double) num13 > 1.0) + num14 = 1f; if (Main.gameMenu) - num24 = 1f; - Main.spriteBatch.Draw(TextureAssets.Cloud[Main.cloud[index].type].Value, new Vector2(Main.cloud[index].position.X + (float) TextureAssets.Cloud[Main.cloud[index].type].Width() * 0.5f, num22 + (float) TextureAssets.Cloud[Main.cloud[index].type].Height() * 0.5f + this.cTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Cloud[Main.cloud[index].type].Width(), TextureAssets.Cloud[Main.cloud[index].type].Height())), color * num6, Main.cloud[index].rotation, new Vector2((float) TextureAssets.Cloud[Main.cloud[index].type].Width() * 0.5f, (float) TextureAssets.Cloud[Main.cloud[index].type].Height() * 0.5f), Main.cloud[index].scale, Main.cloud[index].spriteDir, 0.0f); + num14 = 1f; + Main.spriteBatch.Draw(Main.cloudTexture[Main.cloud[index].type], new Vector2(Main.cloud[index].position.X + (float) Main.cloudTexture[Main.cloud[index].type].Width * 0.5f, num12 + (float) Main.cloudTexture[Main.cloud[index].type].Height * 0.5f + this.cTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.cloudTexture[Main.cloud[index].type].Width, Main.cloudTexture[Main.cloud[index].type].Height)), color * num1, Main.cloud[index].rotation, new Vector2((float) Main.cloudTexture[Main.cloud[index].type].Width * 0.5f, (float) Main.cloudTexture[Main.cloud[index].type].Height * 0.5f), Main.cloud[index].scale, Main.cloud[index].spriteDir, 0.0f); } } } } - if (flag) - pushBGTopHack += num11; if (!Main.mapFullscreen) { - for (int index = 0; index < Main.bgAlphaFrontLayer.Length; ++index) + for (int index1 = 0; index1 < 10; ++index1) { + if (Main.bgStyle == index1) + { + Main.bgAlpha[index1] += Main.tranSpeed; + if ((double) Main.bgAlpha[index1] > 1.0) + Main.bgAlpha[index1] = 1f; + } + else + { + Main.bgAlpha[index1] -= Main.tranSpeed; + if ((double) Main.bgAlpha[index1] < 0.0) + Main.bgAlpha[index1] = 0.0f; + } if (Main.BackgroundEnabled) { - Main.ColorOfSurfaceBackgroundsModified = surfaceBackgroundsBase * Main.bgAlphaFrontLayer[index]; - if ((double) Main.bgAlphaFrontLayer[index] > 0.0 && index == 0) + Main.backColor = Main.trueBackColor; + Main.backColor.R = (byte) ((double) Main.backColor.R * (double) Main.bgAlpha[index1]); + Main.backColor.G = (byte) ((double) Main.backColor.G * (double) Main.bgAlpha[index1]); + Main.backColor.B = (byte) ((double) Main.backColor.B * (double) Main.bgAlpha[index1]); + Main.backColor.A = (byte) ((double) Main.backColor.A * (double) Main.bgAlpha[index1]); + if ((double) Main.bgAlpha[index1] > 0.0 && index1 == 3) { - this.DrawSurfaceBG_Forest(backgroundTopMagicNumber, bgGlobalScaleMultiplier, pushBGTopHack, Main.treeBGSet1); - this.DrawSurfaceBG_DrawChangeOverlay(0); + this.LoadBackground(Main.jungleBG[0]); + Main.bgScale = 1.25f; + Main.bgScale *= 2f; + Main.bgW = (int) ((double) Main.backgroundWidth[Main.jungleBG[0]] * (double) Main.bgScale); + this.bgParallax = 0.4; + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2)); + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 1800.0 + 1660.0) + (int) this.scAdj; + if (Main.gameMenu) + this.bgTop = 320; + if (Main.jungleBG[0] == 59) + this.bgTop -= 200; + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int index2 = 0; index2 < this.bgLoops; ++index2) + Main.spriteBatch.Draw(Main.backgroundTexture[Main.jungleBG[0]], new Vector2((float) (this.bgStart + Main.bgW * index2), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[Main.jungleBG[0]], Main.backgroundHeight[Main.jungleBG[0]])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } + this.LoadBackground(Main.jungleBG[1]); + Main.bgScale = 1.31f; + Main.bgScale *= 2f; + Main.bgW = (int) ((double) Main.backgroundWidth[Main.jungleBG[1]] * (double) Main.bgScale); + this.bgParallax = 0.43; + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2)); + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 1950.0 + 1840.0) + (int) this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 400; + this.bgStart -= 80; + } + if (Main.jungleBG[1] == 60) + this.bgTop -= 175; + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int index3 = 0; index3 < this.bgLoops; ++index3) + Main.spriteBatch.Draw(Main.backgroundTexture[Main.jungleBG[1]], new Vector2((float) (this.bgStart + Main.bgW * index3), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[Main.jungleBG[1]], Main.backgroundHeight[Main.jungleBG[1]])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.FlipHorizontally, 0.0f); + } + Main.bgScale = 1.34f; + Main.bgScale *= 2f; + this.LoadBackground(Main.jungleBG[2]); + Main.bgW = (int) ((double) Main.backgroundWidth[Main.jungleBG[2]] * (double) Main.bgScale); + this.bgParallax = 0.49; + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2)); + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 2100.0 + 2060.0) + (int) this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 480; + this.bgStart -= 120; + } + if (Main.jungleBG[2] == 61) + this.bgTop -= 150; + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int index4 = 0; index4 < this.bgLoops; ++index4) + Main.spriteBatch.Draw(Main.backgroundTexture[Main.jungleBG[2]], new Vector2((float) (this.bgStart + Main.bgW * index4), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[Main.jungleBG[2]], Main.backgroundHeight[Main.jungleBG[2]])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } } - if ((double) Main.bgAlphaFrontLayer[index] > 0.0 && index == 10) + if ((double) Main.bgAlpha[index1] > 0.0 && index1 == 2) { - this.DrawSurfaceBG_Forest(backgroundTopMagicNumber, bgGlobalScaleMultiplier, pushBGTopHack, Main.treeBGSet2); - this.DrawSurfaceBG_DrawChangeOverlay(1); + this.LoadBackground(Main.desertBG[0]); + Main.bgScale = 1.25f; + Main.bgScale *= 2f; + Main.bgW = (int) ((double) Main.backgroundWidth[Main.desertBG[0]] * (double) Main.bgScale); + this.bgParallax = 0.37; + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2)); + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 1800.0 + 1750.0) + (int) this.scAdj; + if (Main.gameMenu) + this.bgTop = 320; + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int index5 = 0; index5 < this.bgLoops; ++index5) + Main.spriteBatch.Draw(Main.backgroundTexture[Main.desertBG[0]], new Vector2((float) (this.bgStart + Main.bgW * index5), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[Main.desertBG[0]], Main.backgroundHeight[Main.desertBG[0]])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } + Main.bgScale = 1.34f; + Main.bgScale *= 2f; + this.LoadBackground(Main.desertBG[1]); + Main.bgW = (int) ((double) Main.backgroundWidth[Main.desertBG[1]] * (double) Main.bgScale); + this.bgParallax = 0.49; + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2)); + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 2100.0 + 2150.0) + (int) this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 480; + this.bgStart -= 120; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int index6 = 0; index6 < this.bgLoops; ++index6) + Main.spriteBatch.Draw(Main.backgroundTexture[Main.desertBG[1]], new Vector2((float) (this.bgStart + Main.bgW * index6), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[Main.desertBG[1]], Main.backgroundHeight[Main.desertBG[1]])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } } - if ((double) Main.bgAlphaFrontLayer[index] > 0.0 && index == 11) + if ((double) Main.bgAlpha[index1] > 0.0 && index1 == 5) { - this.DrawSurfaceBG_Forest(backgroundTopMagicNumber, bgGlobalScaleMultiplier, pushBGTopHack, Main.treeBGSet3); - this.DrawSurfaceBG_DrawChangeOverlay(2); + this.LoadBackground(26); + Main.bgScale = 1.25f; + Main.bgScale *= 2f; + Main.bgW = (int) ((double) Main.backgroundWidth[26] * (double) Main.bgScale); + this.bgParallax = 0.37; + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2)); + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 1800.0 + 1750.0) + (int) this.scAdj; + if (Main.gameMenu) + this.bgTop = 320; + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int index7 = 0; index7 < this.bgLoops; ++index7) + Main.spriteBatch.Draw(Main.backgroundTexture[26], new Vector2((float) (this.bgStart + Main.bgW * index7), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[26], Main.backgroundHeight[26])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } + Main.bgScale = 1.34f; + Main.bgScale *= 2f; + this.LoadBackground(27); + Main.bgW = (int) ((double) Main.backgroundWidth[27] * (double) Main.bgScale); + this.bgParallax = 0.49; + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2)); + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 2100.0 + 2150.0) + (int) this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 480; + this.bgStart -= 120; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int index8 = 0; index8 < this.bgLoops; ++index8) + Main.spriteBatch.Draw(Main.backgroundTexture[27], new Vector2((float) (this.bgStart + Main.bgW * index8), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[27], Main.backgroundHeight[27])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } } - if ((double) Main.bgAlphaFrontLayer[index] > 0.0 && index == 12) + if ((double) Main.bgAlpha[index1] > 0.0 && index1 == 1) { - this.DrawSurfaceBG_Forest(backgroundTopMagicNumber, bgGlobalScaleMultiplier, pushBGTopHack, Main.treeBGSet4); - this.DrawSurfaceBG_DrawChangeOverlay(3); + Main.bgScale = 1.25f; + Main.bgScale *= 2f; + this.LoadBackground(Main.corruptBG[0]); + Main.bgW = (int) ((double) Main.backgroundWidth[Main.corruptBG[0]] * (double) Main.bgScale); + this.bgParallax = 0.4; + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2)); + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 1800.0 + 1500.0) + (int) this.scAdj; + if (Main.gameMenu) + this.bgTop = 320; + if (Main.corruptBG[0] == 56) + this.bgTop -= 100; + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int index9 = 0; index9 < this.bgLoops; ++index9) + Main.spriteBatch.Draw(Main.backgroundTexture[Main.corruptBG[0]], new Vector2((float) (this.bgStart + Main.bgW * index9), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[Main.corruptBG[0]], Main.backgroundHeight[Main.corruptBG[0]])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } + Main.bgScale = 1.31f; + Main.bgScale *= 2f; + this.LoadBackground(Main.corruptBG[1]); + Main.bgW = (int) ((double) Main.backgroundWidth[Main.corruptBG[1]] * (double) Main.bgScale); + this.bgParallax = 0.43; + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2)); + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 1950.0 + 1750.0) + (int) this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 400; + this.bgStart -= 80; + } + if (Main.corruptBG[0] == 56) + this.bgTop -= 100; + if (Main.bgW == 0) + Main.bgW = 1; + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + try + { + for (int index10 = 0; index10 < this.bgLoops; ++index10) + Main.spriteBatch.Draw(Main.backgroundTexture[Main.corruptBG[1]], new Vector2((float) (this.bgStart + Main.bgW * index10), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[Main.corruptBG[1]], Main.backgroundHeight[Main.corruptBG[1]])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.FlipHorizontally, 0.0f); + } + catch + { + this.LoadBackground(Main.corruptBG[1]); + } + } + Main.bgScale = 1.34f; + Main.bgScale *= 2f; + this.LoadBackground(Main.corruptBG[2]); + Main.bgW = (int) ((double) Main.backgroundWidth[Main.corruptBG[2]] * (double) Main.bgScale); + if (Main.bgW == 0) + Main.bgW = 150; + this.bgParallax = 0.49; + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2)); + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 2100.0 + 2000.0) + (int) this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 480; + this.bgStart -= 120; + } + if (Main.corruptBG[0] == 56) + this.bgTop -= 100; + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int index11 = 0; index11 < this.bgLoops; ++index11) + Main.spriteBatch.Draw(Main.backgroundTexture[Main.corruptBG[2]], new Vector2((float) (this.bgStart + Main.bgW * index11), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[Main.corruptBG[2]], Main.backgroundHeight[Main.corruptBG[2]])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } } - if ((double) Main.bgAlphaFrontLayer[index] > 0.0 && index == 1) + if ((double) Main.bgAlpha[index1] > 0.0 && index1 == 6) { - int[] corruptBg = Main.corruptBG; - this.DrawSurfaceBG_Corrupt(backgroundTopMagicNumber, bgGlobalScaleMultiplier, pushBGTopHack, corruptBg); - this.DrawSurfaceBG_DrawChangeOverlay(4); + Main.bgScale = 1.25f; + Main.bgScale *= 2f; + this.LoadBackground(Main.hallowBG[0]); + Main.bgW = (int) ((double) Main.backgroundWidth[Main.hallowBG[0]] * (double) Main.bgScale); + this.bgParallax = 0.4; + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1.2f / (float) this.bgParallax); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2)); + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 1800.0 + 1500.0) + (int) this.scAdj; + if (Main.gameMenu) + this.bgTop = 320; + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int index12 = 0; index12 < this.bgLoops; ++index12) + Main.spriteBatch.Draw(Main.backgroundTexture[Main.hallowBG[0]], new Vector2((float) (this.bgStart + Main.bgW * index12), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[Main.hallowBG[0]], Main.backgroundHeight[Main.hallowBG[0]])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } + Main.bgScale = 1.31f; + Main.bgScale *= 2f; + this.LoadBackground(Main.hallowBG[1]); + Main.bgW = (int) ((double) Main.backgroundWidth[Main.hallowBG[1]] * (double) Main.bgScale); + this.bgParallax = 0.43; + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2)); + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 1950.0 + 1750.0) + (int) this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 400; + this.bgStart -= 80; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int index13 = 0; index13 < this.bgLoops; ++index13) + Main.spriteBatch.Draw(Main.backgroundTexture[Main.hallowBG[1]], new Vector2((float) (this.bgStart + Main.bgW * index13), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[Main.hallowBG[1]], Main.backgroundHeight[Main.hallowBG[1]])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } + Main.bgScale = 1.34f; + Main.bgScale *= 2f; + this.LoadBackground(Main.hallowBG[2]); + Main.bgW = (int) ((double) Main.backgroundWidth[Main.hallowBG[2]] * (double) Main.bgScale); + this.bgParallax = 0.49; + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2)); + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 2100.0 + 2000.0) + (int) this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 480; + this.bgStart -= 120; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int index14 = 0; index14 < this.bgLoops; ++index14) + Main.spriteBatch.Draw(Main.backgroundTexture[Main.hallowBG[2]], new Vector2((float) (this.bgStart + Main.bgW * index14), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[Main.hallowBG[2]], Main.backgroundHeight[Main.hallowBG[2]])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } } - if ((double) Main.bgAlphaFrontLayer[index] > 0.0 && index == 2) + if ((double) Main.bgAlpha[index1] > 0.0 && index1 == 0) { - int[] desertBg = Main.desertBG; - this.DrawSurfaceBG_Desert(backgroundTopMagicNumber, bgGlobalScaleMultiplier, pushBGTopHack, desertBg); - this.DrawSurfaceBG_DrawChangeOverlay(9); + Main.bgScale = 1.25f; + Main.bgScale *= 2f; + this.bgParallax = 0.4; + if (Main.treeBG[0] == 91) + { + this.bgParallax = 0.270000010728836; + Main.bgScale = 1.2f; + Main.bgScale *= 2f; + } + if (Main.treeBG[0] == 173) + { + this.bgParallax = 0.25; + Main.bgScale = 1.3f; + Main.bgScale *= 2f; + } + if (Main.treeBG[0] == 178) + { + this.bgParallax = 0.300000011920929; + Main.bgScale = 1.2f; + Main.bgScale *= 2f; + } + if (Main.treeBG[0] == 184) + { + this.bgParallax = 0.25; + Main.bgScale = 1.2f; + Main.bgScale *= 2f; + } + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); + if (Main.treeBG[0] >= 0) + { + this.LoadBackground(Main.treeBG[0]); + Main.bgW = (int) ((double) Main.backgroundWidth[Main.treeBG[0]] * (double) Main.bgScale); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2)); + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 1800.0 + 1500.0) + (int) this.scAdj; + if (Main.treeBG[0] == 91) + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 1600.0 + 1400.0) + (int) this.scAdj; + if (Main.treeBG[0] == 173) + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 1600.0 + 1400.0) + (int) this.scAdj; + if (Main.treeBG[0] == 184) + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 1600.0 + 1400.0) + (int) this.scAdj; + if (Main.gameMenu) + this.bgTop = 320; + if (Main.treeBG[0] == 50) + this.bgTop -= 50; + if (Main.treeBG[0] == 53) + this.bgTop -= 100; + if (Main.treeBG[0] == 91) + this.bgTop += 200; + if (Main.treeBG[0] == 173) + this.bgTop += 200; + if (Main.treeBG[0] == 178) + this.bgTop += 75; + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int index15 = 0; index15 < this.bgLoops; ++index15) + { + if (Main.backgroundTexture[Main.treeBG[0]] != null) + Main.spriteBatch.Draw(Main.backgroundTexture[Main.treeBG[0]], new Vector2((float) (this.bgStart + Main.bgW * index15), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[Main.treeBG[0]], Main.backgroundHeight[Main.treeBG[0]])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } + } + } + if (Main.treeBG[1] >= 0) + { + this.LoadBackground(Main.treeBG[1]); + Main.bgScale = 1.31f; + Main.bgScale *= 2f; + Main.bgW = (int) ((double) Main.backgroundWidth[Main.treeBG[1]] * (double) Main.bgScale); + this.bgParallax = 0.43; + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2)); + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 1950.0 + 1750.0) + (int) this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 400; + this.bgStart -= 80; + } + if (Main.treeBG[1] == 51) + this.bgTop -= 50; + if (Main.treeBG[1] == 54) + this.bgTop -= 100; + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int index16 = 0; index16 < this.bgLoops; ++index16) + Main.spriteBatch.Draw(Main.backgroundTexture[Main.treeBG[1]], new Vector2((float) (this.bgStart + Main.bgW * index16), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[Main.treeBG[1]], Main.backgroundHeight[Main.treeBG[1]])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.FlipHorizontally, 0.0f); + } + } + if (Main.treeBG[2] >= 0) + { + this.LoadBackground(Main.treeBG[2]); + Main.bgScale = 1.34f; + Main.bgScale *= 2f; + this.bgParallax = 0.49; + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); + if (Main.treeBG[0] == 91) + { + Main.bgScale = 1.3f; + Main.bgScale *= 2f; + this.bgParallax = 0.42; + } + Main.bgW = (int) ((double) Main.backgroundWidth[Main.treeBG[2]] * (double) Main.bgScale); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2)); + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 2100.0 + 2000.0) + (int) this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 480; + this.bgStart -= 120; + } + if (Main.treeBG[2] == 52) + this.bgTop -= 50; + if (Main.treeBG[2] == 55) + this.bgTop -= 100; + if (Main.treeBG[2] == 92) + this.bgTop += 150; + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int index17 = 0; index17 < this.bgLoops; ++index17) + Main.spriteBatch.Draw(Main.backgroundTexture[Main.treeBG[2]], new Vector2((float) (this.bgStart + Main.bgW * index17), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[Main.treeBG[2]], Main.backgroundHeight[Main.treeBG[2]])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } + } } - if ((double) Main.bgAlphaFrontLayer[index] > 0.0 && index == 3) + if ((double) Main.bgAlpha[index1] > 0.0 && index1 == 7) { - int[] jungleBg = Main.jungleBG; - this.DrawSurfaceBG_Jungle(backgroundTopMagicNumber, bgGlobalScaleMultiplier, pushBGTopHack, jungleBg); - this.DrawSurfaceBG_DrawChangeOverlay(5); + if (Main.snowBG[0] >= 0) + { + Main.bgScale = 1.25f; + Main.bgScale *= 2f; + this.LoadBackground(Main.snowBG[0]); + Main.bgW = (int) ((double) Main.backgroundWidth[Main.snowBG[0]] * (double) Main.bgScale); + this.bgParallax = 0.4; + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2)); + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 1800.0 + 1500.0) + (int) this.scAdj; + if (Main.gameMenu) + this.bgTop = 320; + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int index18 = 0; index18 < this.bgLoops; ++index18) + Main.spriteBatch.Draw(Main.backgroundTexture[Main.snowBG[0]], new Vector2((float) (this.bgStart + Main.bgW * index18), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[Main.snowBG[0]], Main.backgroundHeight[Main.snowBG[0]])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } + } + if (Main.snowBG[1] >= 0) + { + Main.bgScale = 1.31f; + Main.bgScale *= 2f; + this.LoadBackground(Main.snowBG[1]); + Main.bgW = (int) ((double) Main.backgroundWidth[Main.snowBG[1]] * (double) Main.bgScale); + this.bgParallax = 0.43; + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2)); + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 1950.0 + 1750.0) + (int) this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 400; + this.bgStart -= 80; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int index19 = 0; index19 < this.bgLoops; ++index19) + Main.spriteBatch.Draw(Main.backgroundTexture[Main.snowBG[1]], new Vector2((float) (this.bgStart + Main.bgW * index19), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[Main.snowBG[1]], Main.backgroundHeight[Main.snowBG[1]])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } + } + if (Main.snowBG[2] >= 0) + { + Main.bgScale = 1.34f; + Main.bgScale *= 2f; + this.LoadBackground(Main.snowBG[2]); + Main.bgW = (int) ((double) Main.backgroundWidth[Main.snowBG[2]] * (double) Main.bgScale); + this.bgParallax = 0.49; + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2)); + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 2100.0 + 2000.0) + (int) this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 480; + this.bgStart -= 120; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int index20 = 0; index20 < this.bgLoops; ++index20) + Main.spriteBatch.Draw(Main.backgroundTexture[Main.snowBG[2]], new Vector2((float) (this.bgStart + Main.bgW * index20), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[Main.snowBG[2]], Main.backgroundHeight[Main.snowBG[2]])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } + } } - if ((double) Main.bgAlphaFrontLayer[index] > 0.0 && index == 4) - this.DrawSurfaceBG_DrawChangeOverlay(10); - if ((double) Main.bgAlphaFrontLayer[index] > 0.0 && index == 5) + if ((double) Main.bgAlpha[index1] > 0.0 && index1 == 8) { - this.DrawSurfaceBG_GoodEvilDesert(backgroundTopMagicNumber, bgGlobalScaleMultiplier, pushBGTopHack); - this.DrawSurfaceBG_DrawChangeOverlay(9); + Main.bgScale = 1.25f; + Main.bgScale *= 2f; + this.LoadBackground(Main.crimsonBG[0]); + Main.bgW = (int) ((double) Main.backgroundWidth[Main.crimsonBG[0]] * (double) Main.bgScale); + this.bgParallax = 0.4; + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2)); + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 1800.0 + 1500.0) + (int) this.scAdj; + if (Main.crimsonBG[0] == 105) + this.bgTop += 50; + if (Main.crimsonBG[0] == 174) + this.bgTop -= 350; + if (Main.gameMenu) + this.bgTop = 320; + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int index21 = 0; index21 < this.bgLoops; ++index21) + Main.spriteBatch.Draw(Main.backgroundTexture[Main.crimsonBG[0]], new Vector2((float) (this.bgStart + Main.bgW * index21), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[Main.crimsonBG[0]], Main.backgroundHeight[Main.crimsonBG[0]])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } + Main.bgScale = 1.31f; + Main.bgScale *= 2f; + if (Main.crimsonBG[1] > -1) + { + this.LoadBackground(Main.crimsonBG[1]); + Main.bgW = (int) ((double) Main.backgroundWidth[Main.crimsonBG[1]] * (double) Main.bgScale); + this.bgParallax = 0.43; + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2)); + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 1950.0 + 1750.0) + (int) this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 400; + this.bgStart -= 80; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int index22 = 0; index22 < this.bgLoops; ++index22) + Main.spriteBatch.Draw(Main.backgroundTexture[Main.crimsonBG[1]], new Vector2((float) (this.bgStart + Main.bgW * index22), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[Main.crimsonBG[1]], Main.backgroundHeight[Main.crimsonBG[1]])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } + } + Main.bgScale = 1.34f; + Main.bgScale *= 2f; + this.LoadBackground(Main.crimsonBG[2]); + Main.bgW = (int) ((double) Main.backgroundWidth[Main.crimsonBG[2]] * (double) Main.bgScale); + this.bgParallax = 0.49; + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2)); + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 2100.0 + 2000.0) + (int) this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 480; + this.bgStart -= 120; + } + if (Main.crimsonBG[2] == 175) + { + this.bgStart -= 1000; + this.bgTop -= 400; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int index23 = 0; index23 < this.bgLoops; ++index23) + Main.spriteBatch.Draw(Main.backgroundTexture[Main.crimsonBG[2]], new Vector2((float) (this.bgStart + Main.bgW * index23), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[Main.crimsonBG[2]], Main.backgroundHeight[Main.crimsonBG[2]])), Main.backColor, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } } - if ((double) Main.bgAlphaFrontLayer[index] > 0.0 && index == 6) + if ((double) Main.bgAlpha[index1] > 0.0 && index1 == 9) { - int[] hallowBg = Main.hallowBG; - this.DrawSurfaceBG_Hallow(backgroundTopMagicNumber, bgGlobalScaleMultiplier, pushBGTopHack, hallowBg); - this.DrawSurfaceBG_DrawChangeOverlay(7); - } - if ((double) Main.bgAlphaFrontLayer[index] > 0.0 && index == 7) - { - int[] snowBg = Main.snowBG; - this.DrawSurfaceBG_Snow(backgroundTopMagicNumber, bgGlobalScaleMultiplier, pushBGTopHack, snowBg); - this.DrawSurfaceBG_DrawChangeOverlay(6); - } - if ((double) Main.bgAlphaFrontLayer[index] > 0.0 && index == 8) - { - int[] crimsonBg = Main.crimsonBG; - this.DrawSurfaceBG_Crimson(backgroundTopMagicNumber, bgGlobalScaleMultiplier, pushBGTopHack, crimsonBg); - this.DrawSurfaceBG_DrawChangeOverlay(8); - } - if ((double) Main.bgAlphaFrontLayer[index] > 0.0 && index == 9) - { - int[] mushroomBg = Main.mushroomBG; - this.DrawSurfaceBG_Mushroom(backgroundTopMagicNumber, bgGlobalScaleMultiplier, pushBGTopHack, mushroomBg); - this.DrawSurfaceBG_DrawChangeOverlay(11); + float num15 = (float) Main.backColor.A / (float) byte.MaxValue; + Microsoft.Xna.Framework.Color backColor1 = Main.backColor; + float num16 = (float) Main.rand.Next(28, 42) * (1f / 1000f) + (float) (270 - (int) Main.mouseTextColor) / 5000f; + float num17 = 0.1f; + float num18 = (float) (0.150000005960464 + (double) num16 / 2.0); + float num19 = 0.3f + num16; + float num20 = num17 * (float) byte.MaxValue; + float num21 = num18 * (float) byte.MaxValue; + float num22 = num19 * (float) byte.MaxValue; + float num23 = num20 * (0.33f * num15); + float num24 = num21 * (0.33f * num15); + float num25 = num22 * (0.33f * num15); + if ((double) num23 > (double) byte.MaxValue) + num23 = (float) byte.MaxValue; + if ((double) num24 > (double) byte.MaxValue) + num24 = (float) byte.MaxValue; + if ((double) num25 > (double) byte.MaxValue) + num25 = (float) byte.MaxValue; + if ((double) num23 > (double) backColor1.R) + backColor1.R = (byte) num23; + if ((double) num24 > (double) backColor1.G) + backColor1.G = (byte) num24; + if ((double) num25 > (double) backColor1.B) + backColor1.B = (byte) num25; + Main.bgScale = 1.25f; + Main.bgScale *= 2f; + this.LoadBackground(46); + Main.bgW = (int) ((double) Main.backgroundWidth[46] * (double) Main.bgScale); + this.bgParallax = 0.4; + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2)); + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 1800.0 + 1400.0) + (int) this.scAdj; + if (Main.gameMenu) + this.bgTop = 320; + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int index24 = 0; index24 < this.bgLoops; ++index24) + Main.spriteBatch.Draw(Main.backgroundTexture[46], new Vector2((float) (this.bgStart + Main.bgW * index24), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[46], Main.backgroundHeight[46])), backColor1, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } + Microsoft.Xna.Framework.Color backColor2 = Main.backColor; + float num26 = (float) Main.rand.Next(28, 42) * (1f / 1000f) + (float) (270 - (int) Main.mouseTextColor) / 5000f; + float num27 = 0.1f; + float num28 = (float) (0.174999997019768 + (double) num26 / 2.0); + float num29 = 0.3f + num26; + float num30 = num27 * (float) byte.MaxValue; + float num31 = num28 * (float) byte.MaxValue; + float num32 = num29 * (float) byte.MaxValue; + float num33 = num30 * (0.5f * num15); + float num34 = num31 * (0.5f * num15); + float num35 = num32 * (0.5f * num15); + if ((double) num33 > (double) byte.MaxValue) + num33 = (float) byte.MaxValue; + if ((double) num34 > (double) byte.MaxValue) + num34 = (float) byte.MaxValue; + if ((double) num35 > (double) byte.MaxValue) + num35 = (float) byte.MaxValue; + if ((double) num33 > (double) backColor2.R) + backColor2.R = (byte) num33; + if ((double) num34 > (double) backColor2.G) + backColor2.G = (byte) num34; + if ((double) num35 > (double) backColor2.B) + backColor2.B = (byte) num35; + Main.bgScale = 1.32f; + Main.bgScale *= 2f; + this.LoadBackground(47); + Main.bgW = (int) ((double) Main.backgroundWidth[47] * (double) Main.bgScale); + this.bgParallax = 0.43; + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2)); + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 1950.0 + 1675.0) + (int) this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 400; + this.bgStart -= 80; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int index25 = 0; index25 < this.bgLoops; ++index25) + Main.spriteBatch.Draw(Main.backgroundTexture[47], new Vector2((float) (this.bgStart + Main.bgW * index25), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[47], Main.backgroundHeight[47])), backColor2, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } + Microsoft.Xna.Framework.Color backColor3 = Main.backColor; + float num36 = (float) Main.rand.Next(28, 42) * (1f / 1000f) + (float) (270 - (int) Main.mouseTextColor) / 3000f; + float num37 = 0.125f; + float num38 = (float) (0.200000002980232 + (double) num36 / 2.0); + float num39 = 0.3f + num36; + float num40 = num37 * (float) ((double) byte.MaxValue * (double) num15 * 0.75); + float num41 = num38 * (float) ((double) byte.MaxValue * (double) num15 * 0.75); + float num42 = num39 * (float) ((double) byte.MaxValue * (double) num15 * 0.75); + if ((double) num40 > (double) byte.MaxValue) + num40 = (float) byte.MaxValue; + if ((double) num41 > (double) byte.MaxValue) + num41 = (float) byte.MaxValue; + if ((double) num42 > (double) byte.MaxValue) + num42 = (float) byte.MaxValue; + if ((double) num40 > (double) backColor3.R) + backColor3.R = (byte) num40; + if ((double) num41 > (double) backColor3.G) + backColor3.G = (byte) num41; + if ((double) num42 > (double) backColor3.B) + backColor3.B = (byte) num42; + Main.bgScale = 1.36f; + Main.bgScale *= 2f; + this.LoadBackground(48); + Main.bgW = (int) ((double) Main.backgroundWidth[48] * (double) Main.bgScale); + this.bgParallax = 0.49; + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgW) - (double) (Main.bgW / 2)); + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 2100.0 + 1950.0) + (int) this.scAdj; + if (Main.gameMenu) + { + this.bgTop = 480; + this.bgStart -= 120; + } + this.bgLoops = Main.screenWidth / Main.bgW + 2; + if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + { + for (int index26 = 0; index26 < this.bgLoops; ++index26) + Main.spriteBatch.Draw(Main.backgroundTexture[48], new Vector2((float) (this.bgStart + Main.bgW * index26), (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[48], Main.backgroundHeight[48])), backColor3, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); + } + SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f); } } } } - if (flag) - { - int num25 = pushBGTopHack - num11; - } - float fogPower = Main.DrawSurfaceBG_GetFogPower(); - if (!Main.mapFullscreen && (double) fogPower > 0.0 && !Main.gameMenu && (double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) + if (!Main.mapFullscreen && (double) Main.cloudAlpha > 0.0 && (double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) { this.bgParallax = 0.1; - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.backgroundWidth[Main.background]) - (double) (Main.backgroundWidth[Main.background] / 2)); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.backgroundWidth[Main.background]) - (double) (Main.backgroundWidth[Main.background] / 2)); this.bgLoops = Main.screenWidth / Main.backgroundWidth[Main.background] + 2; this.bgStartY = 0; this.bgLoopsY = 0; - this.bgTopY = (int) (-(double) Main.screenPosition.Y / (Main.worldSurface * 16.0 - 600.0) * 200.0); - Texture2D texture = TextureAssets.Background[49].Value; + this.bgTop = (int) (-(double) Main.screenPosition.Y / (Main.worldSurface * 16.0 - 600.0) * 200.0); for (int index = 0; index < this.bgLoops; ++index) { - this.bgStartX = 0; - Microsoft.Xna.Framework.Color color = Main.ColorOfTheSkies * fogPower * Main.atmo; - int height = Math.Max(Main.screenHeight + 210, texture.Height); - Main.spriteBatch.Draw(texture, new Microsoft.Xna.Framework.Rectangle(this.bgStartX + texture.Width * index, this.bgTopY, texture.Width, height), color); + Microsoft.Xna.Framework.Color bgColor = Main.bgColor; + this.bgStart = 0; + float cloudAlpha = Main.cloudAlpha; + bgColor.R = (byte) ((double) bgColor.R * (double) cloudAlpha); + bgColor.G = (byte) ((double) bgColor.G * (double) cloudAlpha); + bgColor.B = (byte) ((double) bgColor.B * (double) cloudAlpha); + bgColor.A = (byte) ((double) bgColor.A * (double) cloudAlpha); + Main.spriteBatch.Draw(Main.backgroundTexture[49], new Microsoft.Xna.Framework.Rectangle(this.bgStart + Main.backgroundWidth[49] * index, this.bgTop, Main.backgroundWidth[49], Math.Max(Main.screenHeight, Main.backgroundHeight[49])), bgColor); } } if (Main.mapFullscreen) @@ -44379,1332 +45768,6 @@ label_623: SkyManager.Instance.DrawRemainingDepth(Main.spriteBatch); } - private static float DrawSurfaceBG_GetFogPower() => Math.Max(Main.cloudAlpha, Main.GraveyardVisualIntensity * 0.92f); - - private void DrawSurfaceBG_DrawBackMountainsLayer(int bgTextureIndex) - { - if (bgTextureIndex < 0) - return; - this.LoadBackground(bgTextureIndex); - int layerYoffset = this.DrawSurfaceBG_GetLayerYOffset(bgTextureIndex); - this.bgTopY += layerYoffset; - for (int index = 0; index < this.bgLoops; ++index) - Main.spriteBatch.Draw(TextureAssets.Background[bgTextureIndex].Value, new Vector2((float) (this.bgStartX + Main.bgWidthScaled * index), (float) this.bgTopY), this.GetBackgroundRect(bgTextureIndex), Main.ColorOfSurfaceBackgroundsModified, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); - this.bgTopY -= layerYoffset; - } - - private int DrawSurfaceBG_GetLayerYOffset(int bgTextureIndex) - { - switch (bgTextureIndex) - { - case 59: - return -550; - case 93: - case 168: - case 169: - case 170: - return -50; - case 171: - return -100; - case 172: - return 130; - case 176: - return -760; - case 177: - return -200; - case 179: - return -100; - case 180: - case 181: - case 182: - case 183: - return -350; - case 246: - return -150; - case 247: - return -150; - case 263: - return -700; - case 269: - return -100; - case 270: - return -50; - case 271: - return -300; - case 272: - return -380; - case 277: - return -260; - case 278: - return -120; - case 280: - return -170; - case 281: - return -300; - case 283: - return -800; - default: - return 0; - } - } - - private float GetForestToForestBackgroundLerperValue() => (float) ((double) (Main.GlobalTimeWrappedHourly * 1.570796f).ToRotationVector2().X * 0.5 + 0.5); - - private void DrawSurfaceBG_BackMountainsStep1( - double backgroundTopMagicNumber, - float bgGlobalScaleMultiplier, - int pushBGTopHack) - { - Microsoft.Xna.Framework.Color surfaceBackgroundsBase = Main.ColorOfSurfaceBackgroundsBase; - Main.bgScale = 1f; - this.bgTopY = (int) (backgroundTopMagicNumber * 1300.0 + 1090.0) + (int) this.scAdj + pushBGTopHack; - Main.bgScale *= bgGlobalScaleMultiplier; - this.bgParallax = 0.15; - Main.bgWidthScaled = (int) (1024.0 * (double) Main.bgScale); - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgWidthScaled) - (double) (Main.bgWidthScaled / 2)); - if (Main.bgWidthScaled == 0) - Main.bgWidthScaled = 1024; - this.bgLoops = Main.screenWidth / Main.bgWidthScaled + 2; - if (Main.gameMenu) - this.bgTopY = 100 + pushBGTopHack; - if ((double) Main.screenPosition.Y >= Main.worldSurface * 16.0 + 16.0) - return; - if ((double) Main.bgAlphaFarBackLayer[0] > 0.0) - { - Main.ColorOfSurfaceBackgroundsModified = surfaceBackgroundsBase * Main.bgAlphaFarBackLayer[0]; - this.DrawSurfaceBG_DrawBackMountainsLayer(Main.treeMntBGSet1[0]); - } - if ((double) Main.bgAlphaFarBackLayer[10] > 0.0) - { - Main.ColorOfSurfaceBackgroundsModified = surfaceBackgroundsBase * Main.bgAlphaFarBackLayer[10]; - this.DrawSurfaceBG_DrawBackMountainsLayer(Main.treeMntBGSet2[0]); - } - if ((double) Main.bgAlphaFarBackLayer[11] > 0.0) - { - Main.ColorOfSurfaceBackgroundsModified = surfaceBackgroundsBase * Main.bgAlphaFarBackLayer[11]; - this.DrawSurfaceBG_DrawBackMountainsLayer(Main.treeMntBGSet3[0]); - } - if ((double) Main.bgAlphaFarBackLayer[12] > 0.0) - { - Main.ColorOfSurfaceBackgroundsModified = surfaceBackgroundsBase * Main.bgAlphaFarBackLayer[12]; - this.DrawSurfaceBG_DrawBackMountainsLayer(Main.treeMntBGSet4[0]); - } - if ((double) Main.bgAlphaFarBackLayer[1] > 0.0) - { - Main.ColorOfSurfaceBackgroundsModified = surfaceBackgroundsBase * Main.bgAlphaFarBackLayer[1]; - if (WorldGen.desertBG != 4) - this.DrawSurfaceBG_DrawBackMountainsLayer(23); - } - if ((double) Main.bgAlphaFarBackLayer[2] > 0.0) - { - Main.ColorOfSurfaceBackgroundsModified = surfaceBackgroundsBase * Main.bgAlphaFarBackLayer[2]; - this.DrawSurfaceBG_DrawBackMountainsLayer(24); - } - if ((double) Main.bgAlphaFarBackLayer[4] > 0.0) - { - Main.ColorOfSurfaceBackgroundsModified = surfaceBackgroundsBase * Main.bgAlphaFarBackLayer[4]; - this.DrawSurfaceBG_DrawBackMountainsLayer(Main.snowMntBG[0]); - } - if ((double) Main.bgAlphaFarBackLayer[5] > 0.0) - { - Main.ColorOfSurfaceBackgroundsModified = surfaceBackgroundsBase * Main.bgAlphaFarBackLayer[5]; - if (WorldGen.crimsonBG != 5) - this.DrawSurfaceBG_DrawBackMountainsLayer(24); - } - if ((double) Main.bgAlphaFarBackLayer[6] > 0.0 && WorldGen.hallowBG == 3) - { - Main.ColorOfSurfaceBackgroundsModified = surfaceBackgroundsBase * Main.bgAlphaFarBackLayer[6]; - this.DrawSurfaceBG_DrawBackMountainsLayer(246); - } - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 5f); - } - - private void DrawSurfaceBG_BackMountainsStep2(int pushBGTopHack) - { - if (Main.gameMenu) - { - this.bgTopY = 230 + pushBGTopHack; - this.bgStartX -= 500; - } - Microsoft.Xna.Framework.Color surfaceBackgroundsBase = Main.ColorOfSurfaceBackgroundsBase; - this.UpdateOceanWaterLineForAmbience(); - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); - if ((double) Main.screenPosition.Y >= Main.worldSurface * 16.0 + 16.0) - return; - if ((double) Main.bgAlphaFarBackLayer[0] > 0.0) - { - Main.ColorOfSurfaceBackgroundsModified = surfaceBackgroundsBase * Main.bgAlphaFarBackLayer[0]; - if (Main.treeMntBGSet1[1] > -1) - this.DrawSurfaceBG_DrawBackMountainsLayer(Main.treeMntBGSet1[1]); - } - if ((double) Main.bgAlphaFarBackLayer[1] > 0.0) - { - Main.ColorOfSurfaceBackgroundsModified = surfaceBackgroundsBase * Main.bgAlphaFarBackLayer[1]; - if (WorldGen.desertBG != 4) - this.DrawSurfaceBG_DrawBackMountainsLayer(22); - } - if ((double) Main.bgAlphaFarBackLayer[2] > 0.0) - { - Main.ColorOfSurfaceBackgroundsModified = surfaceBackgroundsBase * Main.bgAlphaFarBackLayer[2]; - this.DrawSurfaceBG_DrawBackMountainsLayer(25); - } - if ((double) Main.bgAlphaFarBackLayer[3] > 0.0) - { - Main.ColorOfSurfaceBackgroundsModified = surfaceBackgroundsBase * Main.bgAlphaFarBackLayer[3]; - this.DrawSurfaceBG_DrawBackMountainsLayer(Main.oceanBG); - } - if ((double) Main.bgAlphaFarBackLayer[4] > 0.0) - { - Main.ColorOfSurfaceBackgroundsModified = surfaceBackgroundsBase * Main.bgAlphaFarBackLayer[4]; - this.DrawSurfaceBG_DrawBackMountainsLayer(Main.snowMntBG[1]); - } - if ((double) Main.bgAlphaFarBackLayer[5] > 0.0) - { - Main.ColorOfSurfaceBackgroundsModified = surfaceBackgroundsBase * Main.bgAlphaFarBackLayer[5]; - if (WorldGen.crimsonBG != 5) - this.DrawSurfaceBG_DrawBackMountainsLayer(42); - } - if ((double) Main.bgAlphaFarBackLayer[6] > 0.0 && WorldGen.hallowBG == 3) - { - Main.ColorOfSurfaceBackgroundsModified = surfaceBackgroundsBase * Main.bgAlphaFarBackLayer[6]; - this.DrawSurfaceBG_DrawBackMountainsLayer(247); - } - if ((double) Main.bgAlphaFarBackLayer[10] > 0.0) - { - Main.ColorOfSurfaceBackgroundsModified = surfaceBackgroundsBase * Main.bgAlphaFarBackLayer[10]; - if (Main.treeMntBGSet2[1] > -1) - this.DrawSurfaceBG_DrawBackMountainsLayer(Main.treeMntBGSet2[1]); - } - if ((double) Main.bgAlphaFarBackLayer[11] > 0.0) - { - Main.ColorOfSurfaceBackgroundsModified = surfaceBackgroundsBase * Main.bgAlphaFarBackLayer[11]; - if (Main.treeMntBGSet3[1] > -1) - this.DrawSurfaceBG_DrawBackMountainsLayer(Main.treeMntBGSet3[1]); - } - if ((double) Main.bgAlphaFarBackLayer[12] <= 0.0) - return; - Main.ColorOfSurfaceBackgroundsModified = surfaceBackgroundsBase * Main.bgAlphaFarBackLayer[12]; - if (Main.treeMntBGSet4[1] <= -1) - return; - this.DrawSurfaceBG_DrawBackMountainsLayer(Main.treeMntBGSet4[1]); - } - - private void UpdateOceanWaterLineForAmbience() - { - int layerYoffset = this.DrawSurfaceBG_GetLayerYOffset(Main.oceanBG); - int num = 0; - switch (Main.oceanBG) - { - case 28: - case 110: - case 111: - case 209: - case 210: - num = 102; - break; - case 283: - num = 124; - break; - } - float yScreenPosition = (float) (this.bgTopY + layerYoffset) + (float) num * Main.bgScale; - AmbientSkyDrawCache.Instance.SetOceanLineInfo(yScreenPosition, Main.bgAlphaFarBackLayer[3]); - } - - private void DrawSurfaceBG_Mushroom( - double backgroundTopMagicNumber, - float bgGlobalScaleMultiplier, - int pushBGTopHack, - int[] bgTexIndexes) - { - Vector3 vector3_1 = new Vector3(0.1f, 0.15f, 0.3f); - Vector3 vector3_2 = new Vector3(0.1f, 0.175f, 0.3f); - Vector3 vector3_3 = new Vector3(0.125f, 0.2f, 0.3f); - float num1 = 0.5f; - float num2 = 0.625f; - float num3 = 0.75f; - Vector3 vector3_4 = vector3_1 * 3f; - Vector3 vector3_5 = vector3_2 * 3f; - Vector3 vector3_6 = vector3_3 * 3f; - float num4 = (float) Main.ColorOfSurfaceBackgroundsModified.A / (float) byte.MaxValue; - Microsoft.Xna.Framework.Color backgroundsModified = Main.ColorOfSurfaceBackgroundsModified; - float num5 = (float) Main.rand.Next(28, 42) * (1f / 1000f) + (float) (270 - (int) Main.mouseTextColor) / 5000f; - float x1 = vector3_4.X; - float num6 = vector3_4.Y + num5 / 2f; - float num7 = vector3_4.Z + num5; - float num8 = x1 * (float) byte.MaxValue; - float num9 = num6 * (float) byte.MaxValue; - float num10 = num7 * (float) byte.MaxValue; - float num11 = num8 * (num1 * num4); - float num12 = num9 * (num1 * num4); - float num13 = num10 * (num1 * num4); - if ((double) num11 > (double) byte.MaxValue) - num11 = (float) byte.MaxValue; - if ((double) num12 > (double) byte.MaxValue) - num12 = (float) byte.MaxValue; - if ((double) num13 > (double) byte.MaxValue) - num13 = (float) byte.MaxValue; - if ((double) num11 > (double) backgroundsModified.R) - backgroundsModified.R = (byte) num11; - if ((double) num12 > (double) backgroundsModified.G) - backgroundsModified.G = (byte) num12; - if ((double) num13 > (double) backgroundsModified.B) - backgroundsModified.B = (byte) num13; - Main.bgScale = 1.25f; - Main.bgScale *= bgGlobalScaleMultiplier; - this.LoadBackground(bgTexIndexes[0]); - Main.bgWidthScaled = (int) ((double) Main.backgroundWidth[bgTexIndexes[0]] * (double) Main.bgScale); - this.bgParallax = 0.4; - this.SetBackgroundOffsets(bgTexIndexes[0], backgroundTopMagicNumber, pushBGTopHack); - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgWidthScaled) - (double) (Main.bgWidthScaled / 2)); - this.bgTopY = (int) (backgroundTopMagicNumber * 1800.0 + 1400.0) + (int) this.scAdj + pushBGTopHack; - this.SetBackgroundOffsets(bgTexIndexes[0], backgroundTopMagicNumber, pushBGTopHack); - if (Main.gameMenu) - this.bgTopY = 320 + pushBGTopHack; - if (Main.bgWidthScaled != 0) - this.bgLoops = Main.screenWidth / Main.bgWidthScaled + 2; - if (TextureAssets.Background[bgTexIndexes[0]].Value == null) - return; - if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) - { - for (int index = 0; index < this.bgLoops; ++index) - Main.spriteBatch.Draw(TextureAssets.Background[bgTexIndexes[0]].Value, new Vector2((float) (this.bgStartX + Main.bgWidthScaled * index), (float) this.bgTopY), this.GetBackgroundRect(bgTexIndexes[0]), backgroundsModified, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); - } - backgroundsModified = Main.ColorOfSurfaceBackgroundsModified; - float num14 = (float) Main.rand.Next(28, 42) * (1f / 1000f) + (float) (270 - (int) Main.mouseTextColor) / 5000f; - float x2 = vector3_5.X; - float num15 = vector3_5.Y + num14 / 2f; - float num16 = vector3_5.Z + num14; - float num17 = x2 * (float) byte.MaxValue; - float num18 = num15 * (float) byte.MaxValue; - float num19 = num16 * (float) byte.MaxValue; - float num20 = num17 * (num2 * num4); - float num21 = num18 * (num2 * num4); - float num22 = num19 * (num2 * num4); - if ((double) num20 > (double) byte.MaxValue) - num20 = (float) byte.MaxValue; - if ((double) num21 > (double) byte.MaxValue) - num21 = (float) byte.MaxValue; - if ((double) num22 > (double) byte.MaxValue) - num22 = (float) byte.MaxValue; - if ((double) num20 > (double) backgroundsModified.R) - backgroundsModified.R = (byte) num20; - if ((double) num21 > (double) backgroundsModified.G) - backgroundsModified.G = (byte) num21; - if ((double) num22 > (double) backgroundsModified.B) - backgroundsModified.B = (byte) num22; - Main.bgScale = 1.32f; - Main.bgScale *= bgGlobalScaleMultiplier; - this.LoadBackground(bgTexIndexes[1]); - Main.bgWidthScaled = (int) ((double) Main.backgroundWidth[bgTexIndexes[1]] * (double) Main.bgScale); - this.bgParallax = 0.43; - this.SetBackgroundOffsets(bgTexIndexes[1], backgroundTopMagicNumber, pushBGTopHack); - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgWidthScaled) - (double) (Main.bgWidthScaled / 2)); - this.bgTopY = (int) (backgroundTopMagicNumber * 1950.0 + 1675.0) + (int) this.scAdj + pushBGTopHack; - this.SetBackgroundOffsets(bgTexIndexes[1], backgroundTopMagicNumber, pushBGTopHack); - if (Main.gameMenu) - { - this.bgTopY = 400 + pushBGTopHack; - this.bgStartX -= 80; - } - if (Main.bgWidthScaled == 0) - return; - this.bgLoops = Main.screenWidth / Main.bgWidthScaled + 2; - if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) - { - for (int index = 0; index < this.bgLoops; ++index) - Main.spriteBatch.Draw(TextureAssets.Background[bgTexIndexes[1]].Value, new Vector2((float) (this.bgStartX + Main.bgWidthScaled * index), (float) this.bgTopY), this.GetBackgroundRect(bgTexIndexes[1]), backgroundsModified, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); - } - backgroundsModified = Main.ColorOfSurfaceBackgroundsModified; - float num23 = (float) Main.rand.Next(28, 42) * (1f / 1000f) + (float) (270 - (int) Main.mouseTextColor) / 3000f; - float x3 = vector3_6.X; - float num24 = vector3_6.Y + num23 / 2f; - float num25 = vector3_6.Z + num23; - float num26 = x3 * ((float) byte.MaxValue * num4 * num3); - float num27 = num24 * ((float) byte.MaxValue * num4 * num3); - float num28 = num25 * ((float) byte.MaxValue * num4 * num3); - if ((double) num26 > (double) byte.MaxValue) - num26 = (float) byte.MaxValue; - if ((double) num27 > (double) byte.MaxValue) - num27 = (float) byte.MaxValue; - if ((double) num28 > (double) byte.MaxValue) - num28 = (float) byte.MaxValue; - if ((double) num26 > (double) backgroundsModified.R) - backgroundsModified.R = (byte) num26; - if ((double) num27 > (double) backgroundsModified.G) - backgroundsModified.G = (byte) num27; - if ((double) num28 > (double) backgroundsModified.B) - backgroundsModified.B = (byte) num28; - Main.bgScale = 1.36f; - Main.bgScale *= bgGlobalScaleMultiplier; - this.LoadBackground(bgTexIndexes[2]); - Main.bgWidthScaled = (int) ((double) Main.backgroundWidth[bgTexIndexes[2]] * (double) Main.bgScale); - this.bgParallax = 0.49; - this.SetBackgroundOffsets(bgTexIndexes[2], backgroundTopMagicNumber, pushBGTopHack); - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgWidthScaled) - (double) (Main.bgWidthScaled / 2)); - this.bgTopY = (int) (backgroundTopMagicNumber * 2100.0 + 1950.0) + (int) this.scAdj + pushBGTopHack; - this.SetBackgroundOffsets(bgTexIndexes[2], backgroundTopMagicNumber, pushBGTopHack); - if (Main.gameMenu) - { - this.bgTopY = 480 + pushBGTopHack; - this.bgStartX -= 120; - } - if (Main.bgWidthScaled == 0) - return; - this.bgLoops = Main.screenWidth / Main.bgWidthScaled + 2; - if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) - { - for (int index = 0; index < this.bgLoops; ++index) - Main.spriteBatch.Draw(TextureAssets.Background[bgTexIndexes[2]].Value, new Vector2((float) (this.bgStartX + Main.bgWidthScaled * index), (float) this.bgTopY), this.GetBackgroundRect(bgTexIndexes[2]), backgroundsModified, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); - } - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f); - } - - private void DrawSurfaceBG_Crimson( - double backgroundTopMagicNumber, - float bgGlobalScaleMultiplier, - int pushBGTopHack, - int[] bgTexIndexes) - { - if (bgTexIndexes[0] > -1) - { - Main.bgScale = 1.25f; - this.bgParallax = 0.4; - this.bgTopY = (int) (backgroundTopMagicNumber * 1800.0 + 1500.0) + (int) this.scAdj + pushBGTopHack; - this.SetBackgroundOffsets(bgTexIndexes[0], backgroundTopMagicNumber, pushBGTopHack); - Main.bgScale *= bgGlobalScaleMultiplier; - this.LoadBackground(bgTexIndexes[0]); - Main.bgWidthScaled = (int) ((double) Main.backgroundWidth[bgTexIndexes[0]] * (double) Main.bgScale); - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgWidthScaled) - (double) (Main.bgWidthScaled / 2)); - if (bgTexIndexes[0] == 105) - this.bgTopY += 50; - if (bgTexIndexes[0] == 174) - this.bgTopY -= 350; - if (Main.gameMenu) - this.bgTopY = 320 + pushBGTopHack; - this.bgLoops = Main.screenWidth / Main.bgWidthScaled + 2; - if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) - { - for (int index = 0; index < this.bgLoops; ++index) - Main.spriteBatch.Draw(TextureAssets.Background[bgTexIndexes[0]].Value, new Vector2((float) (this.bgStartX + Main.bgWidthScaled * index), (float) this.bgTopY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[bgTexIndexes[0]], Main.backgroundHeight[bgTexIndexes[0]])), Main.ColorOfSurfaceBackgroundsModified, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); - } - } - if (bgTexIndexes[1] > -1) - { - Main.bgScale = 1.31f; - this.bgParallax = 0.43; - this.bgTopY = (int) (backgroundTopMagicNumber * 1950.0 + 1750.0) + (int) this.scAdj + pushBGTopHack; - this.SetBackgroundOffsets(bgTexIndexes[1], backgroundTopMagicNumber, pushBGTopHack); - Main.bgScale *= bgGlobalScaleMultiplier; - this.LoadBackground(bgTexIndexes[1]); - Main.bgWidthScaled = (int) ((double) Main.backgroundWidth[bgTexIndexes[1]] * (double) Main.bgScale); - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgWidthScaled) - (double) (Main.bgWidthScaled / 2)); - if (Main.gameMenu) - { - this.bgTopY = 400 + pushBGTopHack; - this.bgStartX -= 80; - } - this.bgLoops = Main.screenWidth / Main.bgWidthScaled + 2; - if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) - { - for (int index = 0; index < this.bgLoops; ++index) - Main.spriteBatch.Draw(TextureAssets.Background[bgTexIndexes[1]].Value, new Vector2((float) (this.bgStartX + Main.bgWidthScaled * index), (float) this.bgTopY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[bgTexIndexes[1]], Main.backgroundHeight[bgTexIndexes[1]])), Main.ColorOfSurfaceBackgroundsModified, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); - } - } - Main.bgScale = 1.34f; - this.bgParallax = 0.49; - this.bgTopY = (int) (backgroundTopMagicNumber * 2100.0 + 2000.0) + (int) this.scAdj + pushBGTopHack; - this.SetBackgroundOffsets(bgTexIndexes[2], backgroundTopMagicNumber, pushBGTopHack); - Main.bgScale *= bgGlobalScaleMultiplier; - this.LoadBackground(bgTexIndexes[2]); - Main.bgWidthScaled = (int) ((double) Main.backgroundWidth[bgTexIndexes[2]] * (double) Main.bgScale); - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgWidthScaled) - (double) (Main.bgWidthScaled / 2)); - if (Main.gameMenu) - { - this.bgTopY = 480 + pushBGTopHack; - this.bgStartX -= 120; - } - if (bgTexIndexes[2] == 175) - { - this.bgStartX -= 1000; - this.bgTopY -= 400; - } - this.bgLoops = Main.screenWidth / Main.bgWidthScaled + 2; - if ((double) Main.screenPosition.Y >= Main.worldSurface * 16.0 + 16.0) - return; - for (int index = 0; index < this.bgLoops; ++index) - Main.spriteBatch.Draw(TextureAssets.Background[bgTexIndexes[2]].Value, new Vector2((float) (this.bgStartX + Main.bgWidthScaled * index), (float) this.bgTopY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[bgTexIndexes[2]], Main.backgroundHeight[bgTexIndexes[2]])), Main.ColorOfSurfaceBackgroundsModified, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); - } - - private void DrawSurfaceBG_Snow( - double backgroundTopMagicNumber, - float bgGlobalScaleMultiplier, - int pushBGTopHack, - int[] bgTexIndexes) - { - if (bgTexIndexes[0] >= 0) - { - Main.bgScale = 1.25f; - this.bgParallax = 0.4; - this.bgTopY = (int) (backgroundTopMagicNumber * 1800.0 + 1500.0) + (int) this.scAdj + pushBGTopHack; - this.SetBackgroundOffsets(bgTexIndexes[0], backgroundTopMagicNumber, pushBGTopHack); - Main.bgScale *= bgGlobalScaleMultiplier; - this.LoadBackground(bgTexIndexes[0]); - Main.bgWidthScaled = (int) ((double) Main.backgroundWidth[bgTexIndexes[0]] * (double) Main.bgScale); - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgWidthScaled) - (double) (Main.bgWidthScaled / 2)); - if (Main.gameMenu) - this.bgTopY = 320 + pushBGTopHack; - this.bgTopY += this.DrawSurfaceBG_GetLayerYOffset(bgTexIndexes[0]); - this.bgLoops = Main.screenWidth / Main.bgWidthScaled + 2; - if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) - { - for (int index = 0; index < this.bgLoops; ++index) - Main.spriteBatch.Draw(TextureAssets.Background[bgTexIndexes[0]].Value, new Vector2((float) (this.bgStartX + Main.bgWidthScaled * index), (float) this.bgTopY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[bgTexIndexes[0]], Main.backgroundHeight[bgTexIndexes[0]])), Main.ColorOfSurfaceBackgroundsModified, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); - } - } - if (bgTexIndexes[1] >= 0) - { - Main.bgScale = 1.31f; - this.bgParallax = 0.43; - this.bgTopY = (int) (backgroundTopMagicNumber * 1950.0 + 1750.0) + (int) this.scAdj + pushBGTopHack; - this.SetBackgroundOffsets(bgTexIndexes[1], backgroundTopMagicNumber, pushBGTopHack); - Main.bgScale *= bgGlobalScaleMultiplier; - this.LoadBackground(bgTexIndexes[1]); - Main.bgWidthScaled = (int) ((double) Main.backgroundWidth[bgTexIndexes[1]] * (double) Main.bgScale); - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgWidthScaled) - (double) (Main.bgWidthScaled / 2)); - if (Main.gameMenu) - { - this.bgTopY = 400 + pushBGTopHack; - this.bgStartX -= 80; - } - this.bgTopY += this.DrawSurfaceBG_GetLayerYOffset(bgTexIndexes[1]); - this.bgLoops = Main.screenWidth / Main.bgWidthScaled + 2; - if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) - { - for (int index = 0; index < this.bgLoops; ++index) - Main.spriteBatch.Draw(TextureAssets.Background[bgTexIndexes[1]].Value, new Vector2((float) (this.bgStartX + Main.bgWidthScaled * index), (float) this.bgTopY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[bgTexIndexes[1]], Main.backgroundHeight[bgTexIndexes[1]])), Main.ColorOfSurfaceBackgroundsModified, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); - } - } - if (bgTexIndexes[2] < 0) - return; - Main.bgScale = 1.34f; - this.bgParallax = 0.49; - this.bgTopY = (int) (backgroundTopMagicNumber * 2100.0 + 2000.0) + (int) this.scAdj + pushBGTopHack; - this.SetBackgroundOffsets(bgTexIndexes[2], backgroundTopMagicNumber, pushBGTopHack); - Main.bgScale *= bgGlobalScaleMultiplier; - this.LoadBackground(bgTexIndexes[2]); - Main.bgWidthScaled = (int) ((double) Main.backgroundWidth[bgTexIndexes[2]] * (double) Main.bgScale); - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgWidthScaled) - (double) (Main.bgWidthScaled / 2)); - if (Main.gameMenu) - { - this.bgTopY = 480 + pushBGTopHack; - this.bgStartX -= 120; - } - this.bgTopY += this.DrawSurfaceBG_GetLayerYOffset(bgTexIndexes[2]); - this.bgLoops = Main.screenWidth / Main.bgWidthScaled + 2; - if ((double) Main.screenPosition.Y >= Main.worldSurface * 16.0 + 16.0) - return; - for (int index = 0; index < this.bgLoops; ++index) - Main.spriteBatch.Draw(TextureAssets.Background[bgTexIndexes[2]].Value, new Vector2((float) (this.bgStartX + Main.bgWidthScaled * index), (float) this.bgTopY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[bgTexIndexes[2]], Main.backgroundHeight[bgTexIndexes[2]])), Main.ColorOfSurfaceBackgroundsModified, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); - } - - private void SetBackgroundOffsets( - int backgroundID, - double backgroundTopMagicNumber, - int pushBGTopHack) - { - int num1 = 0; - int num2 = 0; - switch (backgroundID) - { - case 18: - if (WorldGen.hallowBG == 3) - { - this.bgParallax = 0.17; - Main.bgScale = 1.1f; - num1 = 1400; - num2 = 1100; - break; - } - break; - case 207: - this.bgParallax = 0.32; - break; - case 219: - this.bgParallax = 0.25; - break; - case 220: - this.bgParallax = 0.34; - break; - case 221: - this.bgParallax = 0.43; - break; - case 222: - num1 = 1800; - num2 = 1400; - break; - case 223: - num1 = 2150; - num2 = 1850; - break; - case 224: - num1 = 2500; - num2 = 2400; - break; - case 234: - this.bgParallax = 0.23; - num1 = 1700; - num2 = 1150; - break; - case 235: - this.bgParallax = 0.33; - num1 = 1950; - num2 = 1550; - break; - case 236: - this.bgParallax = 0.41; - num1 = 2100; - num2 = 2000; - break; - case 237: - num1 = 1800; - num2 = 1500; - break; - case 238: - num1 = 1950; - num2 = 1500; - break; - case 239: - num1 = 2100; - num2 = 1900; - break; - case 240: - Main.bgScale = 1.15f; - this.bgParallax = 0.3; - num1 = 1800; - num2 = 1500; - break; - case 241: - Main.bgScale = 1.21f; - this.bgParallax = 0.43; - num1 = 1950; - num2 = 1300; - break; - case 242: - Main.bgScale = 1.34f; - this.bgParallax = 0.49; - num1 = 2100; - num2 = 1400; - break; - case 243: - Main.bgScale = 1.15f; - this.bgParallax = 0.25; - num1 = 1800; - num2 = 1400; - break; - case 244: - Main.bgScale = 1.21f; - this.bgParallax = 0.35; - num1 = 1950; - num2 = 1550; - break; - case 245: - Main.bgScale = 1.24f; - this.bgParallax = 0.45; - num1 = 2100; - num2 = 1650; - break; - case 248: - Main.bgScale = 1.3f; - this.bgParallax = 0.37; - num1 = 1800; - num2 = 1100; - break; - case 249: - Main.bgScale = 1.4f; - this.bgParallax = 0.43; - num1 = 1950; - num2 = 1200; - break; - case 250: - Main.bgScale = 1.7f; - this.bgParallax = 0.49; - num1 = 2000; - num2 = 1000; - break; - case (int) byte.MaxValue: - Main.bgScale = 1.15f; - this.bgParallax = 0.25; - num1 = 1800; - num2 = 1450; - break; - case 256: - Main.bgScale = 1.21f; - this.bgParallax = 0.32; - num1 = 1950; - num2 = 1550; - break; - case 257: - Main.bgScale = 1.34f; - this.bgParallax = 0.4; - num1 = 2100; - num2 = 1550; - break; - case 258: - Main.bgScale = 1.25f; - this.bgParallax = 0.23; - num1 = 1800; - num2 = 850; - break; - case 259: - Main.bgScale = 1.31f; - this.bgParallax = 0.33; - num1 = 1950; - num2 = 1500; - break; - case 260: - Main.bgScale = 1.34f; - this.bgParallax = 0.4; - num1 = 2100; - num2 = 1650; - break; - case 261: - this.bgParallax = 0.27; - break; - case 262: - this.bgParallax = 0.4; - break; - case 263: - Main.bgScale = 1.25f; - this.bgParallax = 0.23; - num1 = 1800; - num2 = 1450; - break; - case 264: - Main.bgScale = 1.31f; - this.bgParallax = 0.33; - num1 = 1950; - num2 = 1700; - break; - case 265: - Main.bgScale = 1.34f; - this.bgParallax = 0.4; - num1 = 2100; - num2 = 2000; - break; - case 266: - Main.bgScale = 1.31f; - this.bgParallax = 0.33; - num1 = 1950; - num2 = 1600; - break; - case 267: - Main.bgScale = 1.25f; - this.bgParallax = 0.23; - num1 = 1700; - num2 = 1300; - break; - case 268: - Main.bgScale = 1.34f; - this.bgParallax = 0.41; - num1 = 2100; - num2 = 1850; - break; - case 273: - this.bgParallax = 0.490000009536743; - num1 = 2100; - num2 = 1560; - break; - case 279: - Main.bgScale = 2.5f; - this.bgParallax = 0.349999994039536; - num1 = 1850; - num2 = 1750; - break; - case 282: - Main.bgScale = 2.6f; - this.bgParallax = 0.25; - num1 = 1800; - num2 = 1340; - break; - case 284: - this.bgParallax = 0.23; - num1 = 1600; - num2 = 900; - break; - case 285: - this.bgParallax = 0.36; - num1 = 1900; - num2 = 960; - break; - case 286: - this.bgParallax = 0.42; - num1 = 2100; - num2 = 1200; - break; - case 287: - this.bgParallax = 0.21; - num1 = 1700; - num2 = 1560; - break; - case 288: - this.bgParallax = 0.33; - num1 = 1950; - num2 = 1730; - break; - case 289: - this.bgParallax = 0.41; - num1 = 2100; - num2 = 1400; - break; - } - if (num1 == 0 && num2 == 0) - return; - this.bgTopY = (int) (backgroundTopMagicNumber * (double) num1 + (double) num2) + (int) this.scAdj + pushBGTopHack; - } - - private void DrawSurfaceBG_Hallow( - double backgroundTopMagicNumber, - float bgGlobalScaleMultiplier, - int pushBGTopHack, - int[] bgTexIndexes) - { - if (bgTexIndexes[0] > 0) - { - Main.bgScale = 1.25f; - this.bgParallax = 0.4; - this.bgTopY = (int) (backgroundTopMagicNumber * 1800.0 + 1500.0) + (int) this.scAdj + pushBGTopHack; - this.SetBackgroundOffsets(bgTexIndexes[0], backgroundTopMagicNumber, pushBGTopHack); - Main.bgScale *= bgGlobalScaleMultiplier; - this.LoadBackground(bgTexIndexes[0]); - Main.bgWidthScaled = (int) ((double) Main.backgroundWidth[bgTexIndexes[0]] * (double) Main.bgScale); - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1.2f / (float) this.bgParallax); - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgWidthScaled) - (double) (Main.bgWidthScaled / 2)); - if (Main.gameMenu) - this.bgTopY = 320 + pushBGTopHack; - this.bgLoops = Main.screenWidth / Main.bgWidthScaled + 2; - if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) - { - for (int index = 0; index < this.bgLoops; ++index) - Main.spriteBatch.Draw(TextureAssets.Background[bgTexIndexes[0]].Value, new Vector2((float) (this.bgStartX + Main.bgWidthScaled * index), (float) this.bgTopY), this.GetBackgroundRect(bgTexIndexes[0]), Main.ColorOfSurfaceBackgroundsModified, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); - } - } - if (bgTexIndexes[1] > 0) - { - Main.bgScale = 1.31f; - this.bgParallax = 0.43; - this.bgTopY = (int) (backgroundTopMagicNumber * 1950.0 + 1750.0) + (int) this.scAdj + pushBGTopHack; - this.SetBackgroundOffsets(bgTexIndexes[1], backgroundTopMagicNumber, pushBGTopHack); - Main.bgScale *= bgGlobalScaleMultiplier; - this.LoadBackground(bgTexIndexes[1]); - Main.bgWidthScaled = (int) ((double) Main.backgroundWidth[bgTexIndexes[1]] * (double) Main.bgScale); - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgWidthScaled) - (double) (Main.bgWidthScaled / 2)); - if (Main.gameMenu) - { - this.bgTopY = 400 + pushBGTopHack; - this.bgStartX -= 80; - } - this.bgLoops = Main.screenWidth / Main.bgWidthScaled + 2; - if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) - { - for (int index = 0; index < this.bgLoops; ++index) - Main.spriteBatch.Draw(TextureAssets.Background[bgTexIndexes[1]].Value, new Vector2((float) (this.bgStartX + Main.bgWidthScaled * index), (float) this.bgTopY), this.GetBackgroundRect(bgTexIndexes[1]), Main.ColorOfSurfaceBackgroundsModified, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); - } - } - if (bgTexIndexes[2] <= 0) - return; - Main.bgScale = 1.34f; - this.bgParallax = 0.49; - this.bgTopY = (int) (backgroundTopMagicNumber * 2100.0 + 2000.0) + (int) this.scAdj + pushBGTopHack; - this.SetBackgroundOffsets(bgTexIndexes[2], backgroundTopMagicNumber, pushBGTopHack); - Main.bgScale *= bgGlobalScaleMultiplier; - this.LoadBackground(bgTexIndexes[2]); - Main.bgWidthScaled = (int) ((double) Main.backgroundWidth[bgTexIndexes[2]] * (double) Main.bgScale); - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgWidthScaled) - (double) (Main.bgWidthScaled / 2)); - if (Main.gameMenu) - { - this.bgTopY = 480 + pushBGTopHack; - this.bgStartX -= 120; - } - this.bgLoops = Main.screenWidth / Main.bgWidthScaled + 2; - if ((double) Main.screenPosition.Y >= Main.worldSurface * 16.0 + 16.0) - return; - for (int index = 0; index < this.bgLoops; ++index) - Main.spriteBatch.Draw(TextureAssets.Background[bgTexIndexes[2]].Value, new Vector2((float) (this.bgStartX + Main.bgWidthScaled * index), (float) this.bgTopY), this.GetBackgroundRect(bgTexIndexes[2]), Main.ColorOfSurfaceBackgroundsModified, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); - } - - private void DrawSurfaceBG_GoodEvilDesert( - double backgroundTopMagicNumber, - float bgGlobalScaleMultiplier, - int pushBGTopHack) - { - this.LoadBackground(26); - Main.bgScale = 1.25f; - Main.bgScale *= bgGlobalScaleMultiplier; - Main.bgWidthScaled = (int) ((double) Main.backgroundWidth[26] * (double) Main.bgScale); - this.bgParallax = 0.37; - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgWidthScaled) - (double) (Main.bgWidthScaled / 2)); - this.bgTopY = (int) (backgroundTopMagicNumber * 1800.0 + 1750.0) + (int) this.scAdj + pushBGTopHack; - if (Main.gameMenu) - this.bgTopY = 320 + pushBGTopHack; - this.bgLoops = Main.screenWidth / Main.bgWidthScaled + 2; - if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) - { - for (int index = 0; index < this.bgLoops; ++index) - Main.spriteBatch.Draw(TextureAssets.Background[26].Value, new Vector2((float) (this.bgStartX + Main.bgWidthScaled * index), (float) this.bgTopY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[26], Main.backgroundHeight[26])), Main.ColorOfSurfaceBackgroundsModified, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); - } - Main.bgScale = 1.34f; - Main.bgScale *= bgGlobalScaleMultiplier; - this.LoadBackground(27); - Main.bgWidthScaled = (int) ((double) Main.backgroundWidth[27] * (double) Main.bgScale); - this.bgParallax = 0.49; - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgWidthScaled) - (double) (Main.bgWidthScaled / 2)); - this.bgTopY = (int) (backgroundTopMagicNumber * 2100.0 + 2150.0) + (int) this.scAdj + pushBGTopHack; - if (Main.gameMenu) - { - this.bgTopY = 480 + pushBGTopHack; - this.bgStartX -= 120; - } - this.bgLoops = Main.screenWidth / Main.bgWidthScaled + 2; - if ((double) Main.screenPosition.Y >= Main.worldSurface * 16.0 + 16.0) - return; - for (int index = 0; index < this.bgLoops; ++index) - Main.spriteBatch.Draw(TextureAssets.Background[27].Value, new Vector2((float) (this.bgStartX + Main.bgWidthScaled * index), (float) this.bgTopY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[27], Main.backgroundHeight[27])), Main.ColorOfSurfaceBackgroundsModified, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); - } - - private void DrawSurfaceBG_Jungle( - double backgroundTopMagicNumber, - float bgGlobalScaleMultiplier, - int pushBGTopHack, - int[] bgTexIndexes) - { - this.LoadBackground(bgTexIndexes[0]); - Main.bgScale = 1.25f; - Main.bgScale *= bgGlobalScaleMultiplier; - Main.bgWidthScaled = (int) ((double) Main.backgroundWidth[bgTexIndexes[0]] * (double) Main.bgScale); - this.bgParallax = 0.4; - this.SetBackgroundOffsets(bgTexIndexes[0], backgroundTopMagicNumber, pushBGTopHack); - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgWidthScaled) - (double) (Main.bgWidthScaled / 2)); - this.bgTopY = (int) (backgroundTopMagicNumber * 1800.0 + 1660.0) + (int) this.scAdj + pushBGTopHack; - this.SetBackgroundOffsets(bgTexIndexes[0], backgroundTopMagicNumber, pushBGTopHack); - if (Main.gameMenu) - this.bgTopY = 320 + pushBGTopHack; - if (bgTexIndexes[0] == 59) - this.bgTopY -= 200; - this.bgTopY += this.DrawSurfaceBG_GetLayerYOffset(bgTexIndexes[0]); - this.bgLoops = Main.screenWidth / Main.bgWidthScaled + 2; - if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) - { - for (int index = 0; index < this.bgLoops; ++index) - Main.spriteBatch.Draw(TextureAssets.Background[bgTexIndexes[0]].Value, new Vector2((float) (this.bgStartX + Main.bgWidthScaled * index), (float) this.bgTopY), this.GetBackgroundRect(bgTexIndexes[0]), Main.ColorOfSurfaceBackgroundsModified, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); - } - this.LoadBackground(bgTexIndexes[1]); - Main.bgScale = 1.31f; - Main.bgScale *= bgGlobalScaleMultiplier; - Main.bgWidthScaled = (int) ((double) Main.backgroundWidth[bgTexIndexes[1]] * (double) Main.bgScale); - this.bgParallax = 0.43; - this.SetBackgroundOffsets(bgTexIndexes[1], backgroundTopMagicNumber, pushBGTopHack); - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgWidthScaled) - (double) (Main.bgWidthScaled / 2)); - this.bgTopY = (int) (backgroundTopMagicNumber * 1950.0 + 1840.0) + (int) this.scAdj + pushBGTopHack; - this.SetBackgroundOffsets(bgTexIndexes[1], backgroundTopMagicNumber, pushBGTopHack); - if (Main.gameMenu) - { - this.bgTopY = 400 + pushBGTopHack; - this.bgStartX -= 80; - } - if (bgTexIndexes[1] == 60) - this.bgTopY -= 175; - this.bgTopY += this.DrawSurfaceBG_GetLayerYOffset(bgTexIndexes[1]); - this.bgLoops = Main.screenWidth / Main.bgWidthScaled + 2; - if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) - { - for (int index = 0; index < this.bgLoops; ++index) - Main.spriteBatch.Draw(TextureAssets.Background[bgTexIndexes[1]].Value, new Vector2((float) (this.bgStartX + Main.bgWidthScaled * index), (float) this.bgTopY), this.GetBackgroundRect(bgTexIndexes[1]), Main.ColorOfSurfaceBackgroundsModified, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.FlipHorizontally, 0.0f); - } - Main.bgScale = 1.34f; - Main.bgScale *= bgGlobalScaleMultiplier; - this.LoadBackground(bgTexIndexes[2]); - Main.bgWidthScaled = (int) ((double) Main.backgroundWidth[bgTexIndexes[2]] * (double) Main.bgScale); - this.bgParallax = 0.49; - this.SetBackgroundOffsets(bgTexIndexes[2], backgroundTopMagicNumber, pushBGTopHack); - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgWidthScaled) - (double) (Main.bgWidthScaled / 2)); - this.bgTopY = (int) (backgroundTopMagicNumber * 2100.0 + 2060.0) + (int) this.scAdj + pushBGTopHack; - this.SetBackgroundOffsets(bgTexIndexes[2], backgroundTopMagicNumber, pushBGTopHack); - if (Main.gameMenu) - { - this.bgTopY = 480 + pushBGTopHack; - this.bgStartX -= 120; - } - if (bgTexIndexes[2] == 61) - this.bgTopY -= 150; - this.bgTopY += this.DrawSurfaceBG_GetLayerYOffset(bgTexIndexes[2]); - this.bgLoops = Main.screenWidth / Main.bgWidthScaled + 2; - if ((double) Main.screenPosition.Y >= Main.worldSurface * 16.0 + 16.0) - return; - for (int index = 0; index < this.bgLoops; ++index) - Main.spriteBatch.Draw(TextureAssets.Background[bgTexIndexes[2]].Value, new Vector2((float) (this.bgStartX + Main.bgWidthScaled * index), (float) this.bgTopY), this.GetBackgroundRect(bgTexIndexes[2]), Main.ColorOfSurfaceBackgroundsModified, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); - } - - private void DrawSurfaceBG_Desert( - double backgroundTopMagicNumber, - float bgGlobalScaleMultiplier, - int pushBGTopHack, - int[] bgTexIndexes) - { - if (bgTexIndexes[0] > 0) - { - Main.bgScale = 1.25f; - this.bgParallax = 0.37; - this.bgTopY = (int) (backgroundTopMagicNumber * 1800.0 + 1750.0) + (int) this.scAdj + pushBGTopHack; - this.SetBackgroundOffsets(bgTexIndexes[0], backgroundTopMagicNumber, pushBGTopHack); - this.LoadBackground(bgTexIndexes[0]); - Main.bgScale *= bgGlobalScaleMultiplier; - float num = (float) Main.backgroundWidth[bgTexIndexes[0]] * Main.bgScale; - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) num) - (double) num / 2.0); - if (Main.gameMenu) - this.bgTopY = 320 + pushBGTopHack; - this.bgLoops = Main.screenWidth / (int) num + 2; - if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) - { - for (int index = 0; index < this.bgLoops; ++index) - Main.spriteBatch.Draw(TextureAssets.Background[bgTexIndexes[0]].Value, new Vector2((float) this.bgStartX + num * (float) index, (float) this.bgTopY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[bgTexIndexes[0]], Main.backgroundHeight[bgTexIndexes[0]])), Main.ColorOfSurfaceBackgroundsModified, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); - } - } - if (bgTexIndexes[1] > 0) - { - Main.bgScale = 1.34f; - this.bgParallax = 0.49; - this.bgTopY = (int) (backgroundTopMagicNumber * 2100.0 + 2150.0) + (int) this.scAdj + pushBGTopHack; - this.SetBackgroundOffsets(bgTexIndexes[1], backgroundTopMagicNumber, pushBGTopHack); - Main.bgScale *= bgGlobalScaleMultiplier; - this.LoadBackground(bgTexIndexes[1]); - Main.bgWidthScaled = (int) ((double) Main.backgroundWidth[bgTexIndexes[1]] * (double) Main.bgScale); - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgWidthScaled) - (double) (Main.bgWidthScaled / 2)); - if (Main.gameMenu) - { - this.bgTopY = 480 + pushBGTopHack; - this.bgStartX -= 120; - } - this.bgLoops = Main.screenWidth / Main.bgWidthScaled + 2; - if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) - { - for (int index = 0; index < this.bgLoops; ++index) - Main.spriteBatch.Draw(TextureAssets.Background[bgTexIndexes[1]].Value, new Vector2((float) (this.bgStartX + Main.bgWidthScaled * index), (float) this.bgTopY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[bgTexIndexes[1]], Main.backgroundHeight[bgTexIndexes[1]])), Main.ColorOfSurfaceBackgroundsModified, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); - } - } - if (bgTexIndexes[2] <= 0) - return; - Main.bgScale = 1.34f; - this.bgParallax = 0.49; - this.bgTopY = (int) (backgroundTopMagicNumber * 2100.0 + 2150.0) + (int) this.scAdj + pushBGTopHack; - this.SetBackgroundOffsets(bgTexIndexes[2], backgroundTopMagicNumber, pushBGTopHack); - Main.bgScale *= bgGlobalScaleMultiplier; - this.LoadBackground(bgTexIndexes[2]); - Main.bgWidthScaled = (int) ((double) Main.backgroundWidth[bgTexIndexes[2]] * (double) Main.bgScale); - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgWidthScaled) - (double) (Main.bgWidthScaled / 2)); - if (Main.gameMenu) - { - this.bgTopY = 480 + pushBGTopHack; - this.bgStartX -= 120; - } - this.bgLoops = Main.screenWidth / Main.bgWidthScaled + 2; - if ((double) Main.screenPosition.Y >= Main.worldSurface * 16.0 + 16.0) - return; - for (int index = 0; index < this.bgLoops; ++index) - Main.spriteBatch.Draw(TextureAssets.Background[bgTexIndexes[2]].Value, new Vector2((float) (this.bgStartX + Main.bgWidthScaled * index), (float) this.bgTopY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[bgTexIndexes[2]], Main.backgroundHeight[bgTexIndexes[2]])), Main.ColorOfSurfaceBackgroundsModified, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); - } - - private void DrawSurfaceBG_DrawChangeOverlay(int backgroundAreaId) - { - Texture2D texture = TextureAssets.MagicPixel.Value; - Microsoft.Xna.Framework.Color color = Microsoft.Xna.Framework.Color.Black * WorldGen.BackgroundsCache.GetFlashPower(backgroundAreaId); - Main.spriteBatch.Draw(texture, new Microsoft.Xna.Framework.Rectangle(0, 0, Main.screenWidth, Main.screenHeight), color); - } - - private void DrawSurfaceBG_Corrupt( - double backgroundTopMagicNumber, - float bgGlobalScaleMultiplier, - int pushBGTopHack, - int[] bgTexIndexes) - { - Main.bgScale = 1.25f; - this.bgParallax = 0.4; - this.bgTopY = (int) (backgroundTopMagicNumber * 1800.0 + 1500.0) + (int) this.scAdj + pushBGTopHack; - this.SetBackgroundOffsets(bgTexIndexes[0], backgroundTopMagicNumber, pushBGTopHack); - Main.bgScale *= bgGlobalScaleMultiplier; - this.LoadBackground(bgTexIndexes[0]); - if (Main.backgroundWidth[bgTexIndexes[0]] == 0 || Main.backgroundHeight[bgTexIndexes[0]] == 0) - return; - Main.bgWidthScaled = (int) ((double) Main.backgroundWidth[bgTexIndexes[0]] * (double) Main.bgScale); - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgWidthScaled) - (double) (Main.bgWidthScaled / 2)); - if (Main.gameMenu) - this.bgTopY = 320 + pushBGTopHack; - if (bgTexIndexes[0] == 56) - this.bgTopY -= 100; - this.bgLoops = Main.screenWidth / Main.bgWidthScaled + 2; - if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) - { - for (int index = 0; index < this.bgLoops; ++index) - Main.spriteBatch.Draw(TextureAssets.Background[bgTexIndexes[0]].Value, new Vector2((float) (this.bgStartX + Main.bgWidthScaled * index), (float) this.bgTopY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[bgTexIndexes[0]], Main.backgroundHeight[bgTexIndexes[0]])), Main.ColorOfSurfaceBackgroundsModified, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); - } - Main.bgScale = 1.31f; - this.bgParallax = 0.43; - this.bgTopY = (int) (backgroundTopMagicNumber * 1950.0 + 1750.0) + (int) this.scAdj + pushBGTopHack; - this.SetBackgroundOffsets(bgTexIndexes[1], backgroundTopMagicNumber, pushBGTopHack); - Main.bgScale *= bgGlobalScaleMultiplier; - this.LoadBackground(bgTexIndexes[1]); - Main.bgWidthScaled = (int) ((double) Main.backgroundWidth[bgTexIndexes[1]] * (double) Main.bgScale); - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgWidthScaled) - (double) (Main.bgWidthScaled / 2)); - if (Main.gameMenu) - { - this.bgTopY = 400 + pushBGTopHack; - this.bgStartX -= 80; - } - if (bgTexIndexes[0] == 56) - this.bgTopY -= 100; - if (Main.bgWidthScaled == 0) - Main.bgWidthScaled = 1; - this.bgLoops = Main.screenWidth / Main.bgWidthScaled + 2; - if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) - { - try - { - Texture2D texture = TextureAssets.Background[bgTexIndexes[1]].Value; - if (texture != null) - { - for (int index = 0; index < this.bgLoops; ++index) - Main.spriteBatch.Draw(texture, new Vector2((float) (this.bgStartX + Main.bgWidthScaled * index), (float) this.bgTopY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[bgTexIndexes[1]], Main.backgroundHeight[bgTexIndexes[1]])), Main.ColorOfSurfaceBackgroundsModified, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.FlipHorizontally, 0.0f); - } - } - catch - { - this.LoadBackground(bgTexIndexes[1]); - } - } - Main.bgScale = 1.34f; - this.bgParallax = 0.49; - this.bgTopY = (int) (backgroundTopMagicNumber * 2100.0 + 2000.0) + (int) this.scAdj + pushBGTopHack; - this.SetBackgroundOffsets(bgTexIndexes[2], backgroundTopMagicNumber, pushBGTopHack); - Main.bgScale *= bgGlobalScaleMultiplier; - this.LoadBackground(bgTexIndexes[2]); - Main.bgWidthScaled = (int) ((double) Main.backgroundWidth[bgTexIndexes[2]] * (double) Main.bgScale); - if (Main.bgWidthScaled == 0) - Main.bgWidthScaled = 150; - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgWidthScaled) - (double) (Main.bgWidthScaled / 2)); - if (Main.gameMenu) - { - this.bgTopY = 480 + pushBGTopHack; - this.bgStartX -= 120; - } - if (bgTexIndexes[0] == 56) - this.bgTopY -= 100; - this.bgLoops = Main.screenWidth / Main.bgWidthScaled + 2; - if ((double) Main.screenPosition.Y >= Main.worldSurface * 16.0 + 16.0) - return; - for (int index = 0; index < this.bgLoops; ++index) - Main.spriteBatch.Draw(TextureAssets.Background[bgTexIndexes[2]].Value, new Vector2((float) (this.bgStartX + Main.bgWidthScaled * index), (float) this.bgTopY), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.backgroundWidth[bgTexIndexes[2]], Main.backgroundHeight[bgTexIndexes[2]])), Main.ColorOfSurfaceBackgroundsModified, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); - } - - private Microsoft.Xna.Framework.Rectangle? GetBackgroundRect(int backgroundTextureIndex) - { - Microsoft.Xna.Framework.Rectangle rectangle1 = new Microsoft.Xna.Framework.Rectangle(0, 0, 1, 1); - switch (backgroundTextureIndex) - { - case 219: - case 220: - case 221: - case 271: - case 272: - case 273: - int num1 = (int) (this.GetBackgroundCounter() / 15U) % 4; - Microsoft.Xna.Framework.Rectangle rectangle2 = TextureAssets.Background[backgroundTextureIndex].Frame(2, 2, num1 % 2, num1 / 2); - rectangle2.Inflate(0, -2); - return new Microsoft.Xna.Framework.Rectangle?(rectangle2); - case 235: - int num2 = (int) (this.GetBackgroundCounter() / 20U) % 4; - Microsoft.Xna.Framework.Rectangle rectangle3 = TextureAssets.Background[backgroundTextureIndex].Frame(2, 2, num2 % 2, num2 / 2); - rectangle3.Inflate(0, -2); - return new Microsoft.Xna.Framework.Rectangle?(rectangle3); - case 281: - int num3 = (int) (this.GetBackgroundCounter() / 5U) % 4; - Microsoft.Xna.Framework.Rectangle rectangle4 = TextureAssets.Background[backgroundTextureIndex].Frame(2, 2, num3 % 2, num3 / 2); - rectangle4.Inflate(0, -2); - return new Microsoft.Xna.Framework.Rectangle?(rectangle4); - default: - return new Microsoft.Xna.Framework.Rectangle?(); - } - } - - private uint GetBackgroundCounter() => !Main.gameMenu ? Main.GameUpdateCount : (uint) ((double) Main.GlobalTimeWrappedHourly * 40.0); - - private void DrawSurfaceBG_Forest( - double backgroundTopMagicNumber, - float bgGlobalScaleMultiplier, - int pushBGTopHack, - int[] bgTexIndexes) - { - Main.bgScale = 1.25f; - this.bgParallax = 0.4; - this.bgTopY = (int) (backgroundTopMagicNumber * 1800.0 + 1500.0) + (int) this.scAdj + pushBGTopHack; - if (bgTexIndexes[0] == 91) - { - this.bgParallax = 0.270000010728836; - Main.bgScale = 1.2f; - } - if (bgTexIndexes[0] == 173) - { - this.bgParallax = 0.25; - Main.bgScale = 1.3f; - } - if (bgTexIndexes[0] == 178) - { - this.bgParallax = 0.300000011920929; - Main.bgScale = 1.2f; - } - if (bgTexIndexes[0] == 184) - { - this.bgParallax = 0.25; - Main.bgScale = 1.2f; - } - if (bgTexIndexes[0] == 282) - Main.bgScale = 1.4f; - this.SetBackgroundOffsets(bgTexIndexes[0], backgroundTopMagicNumber, pushBGTopHack); - Main.bgScale *= bgGlobalScaleMultiplier; - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); - if (bgTexIndexes[0] >= 0) - { - this.SetBackgroundOffsets(bgTexIndexes[0], backgroundTopMagicNumber, pushBGTopHack); - this.LoadBackground(bgTexIndexes[0]); - Main.bgWidthScaled = (int) ((double) Main.backgroundWidth[bgTexIndexes[0]] * (double) Main.bgScale); - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgWidthScaled) - (double) (Main.bgWidthScaled / 2)); - if (bgTexIndexes[0] == 91) - this.bgTopY = (int) (backgroundTopMagicNumber * 1600.0 + 1400.0) + (int) this.scAdj + pushBGTopHack; - if (bgTexIndexes[0] == 173) - this.bgTopY = (int) (backgroundTopMagicNumber * 1600.0 + 1400.0) + (int) this.scAdj + pushBGTopHack; - if (bgTexIndexes[0] == 184) - this.bgTopY = (int) (backgroundTopMagicNumber * 1600.0 + 1400.0) + (int) this.scAdj + pushBGTopHack; - if (Main.gameMenu) - this.bgTopY = 320 + pushBGTopHack; - if (bgTexIndexes[0] == 50) - this.bgTopY -= 50; - if (bgTexIndexes[0] == 53) - this.bgTopY -= 100; - if (bgTexIndexes[0] == 91) - this.bgTopY += 200; - if (bgTexIndexes[0] == 173) - this.bgTopY += 200; - if (bgTexIndexes[0] == 178) - this.bgTopY += 75; - this.bgLoops = Main.screenWidth / Main.bgWidthScaled + 2; - if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) - { - for (int index = 0; index < this.bgLoops; ++index) - { - if (bgTexIndexes[0] != -1) - { - Asset asset = TextureAssets.Background[bgTexIndexes[0]]; - if (bgTexIndexes[0] == 173) - { - int i = 251 + (int) (this.GetBackgroundCounter() / 10U) % 4; - this.LoadBackground(i); - asset = TextureAssets.Background[i]; - } - if (asset.Value != null) - Main.spriteBatch.Draw(asset.Value, new Vector2((float) (this.bgStartX + Main.bgWidthScaled * index), (float) this.bgTopY), this.GetBackgroundRect(bgTexIndexes[0]), Main.ColorOfSurfaceBackgroundsModified, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); - } - } - } - } - if (bgTexIndexes[1] >= 0) - { - this.LoadBackground(bgTexIndexes[1]); - Main.bgScale = 1.31f; - Main.bgScale *= bgGlobalScaleMultiplier; - Main.bgWidthScaled = (int) ((double) Main.backgroundWidth[bgTexIndexes[1]] * (double) Main.bgScale); - if (Main.bgWidthScaled == 0) - Main.bgWidthScaled = 1; - this.bgParallax = 0.43; - this.SetBackgroundOffsets(bgTexIndexes[1], backgroundTopMagicNumber, pushBGTopHack); - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgWidthScaled) - (double) (Main.bgWidthScaled / 2)); - this.bgTopY = (int) (backgroundTopMagicNumber * 1950.0 + 1750.0) + (int) this.scAdj + pushBGTopHack; - if (Main.gameMenu) - { - this.bgTopY = 400 + pushBGTopHack; - this.bgStartX -= 80; - } - if (bgTexIndexes[1] == 51) - this.bgTopY -= 50; - if (bgTexIndexes[1] == 54) - this.bgTopY -= 100; - this.bgLoops = Main.screenWidth / Main.bgWidthScaled + 2; - if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) - { - for (int index = 0; index < this.bgLoops; ++index) - Main.spriteBatch.Draw(TextureAssets.Background[bgTexIndexes[1]].Value, new Vector2((float) (this.bgStartX + Main.bgWidthScaled * index), (float) this.bgTopY), this.GetBackgroundRect(bgTexIndexes[1]), Main.ColorOfSurfaceBackgroundsModified, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.FlipHorizontally, 0.0f); - } - } - if (bgTexIndexes[2] < 0) - return; - this.LoadBackground(bgTexIndexes[2]); - Main.bgScale = 1.34f; - Main.bgScale *= bgGlobalScaleMultiplier; - this.bgParallax = 0.49; - this.SetBackgroundOffsets(bgTexIndexes[2], backgroundTopMagicNumber, pushBGTopHack); - SkyManager.Instance.DrawToDepth(Main.spriteBatch, 1f / (float) this.bgParallax); - if (bgTexIndexes[0] == 91) - { - Main.bgScale = 1.3f; - Main.bgScale *= bgGlobalScaleMultiplier; - this.bgParallax = 0.42; - } - if (bgTexIndexes[2] < 0 && WorldGen.drunkWorldGen) - return; - Main.bgWidthScaled = (int) ((double) Main.backgroundWidth[bgTexIndexes[2]] * (double) Main.bgScale); - if (Main.bgWidthScaled == 0) - Main.bgWidthScaled = 1; - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.bgWidthScaled) - (double) (Main.bgWidthScaled / 2)); - this.bgTopY = (int) (backgroundTopMagicNumber * 2100.0 + 2000.0) + (int) this.scAdj + pushBGTopHack; - if (Main.gameMenu) - { - this.bgTopY = 480 + pushBGTopHack; - this.bgStartX -= 120; - } - if (bgTexIndexes[2] == 52) - this.bgTopY -= 50; - if (bgTexIndexes[2] == 55) - this.bgTopY -= 100; - if (bgTexIndexes[2] == 92) - this.bgTopY += 150; - this.bgLoops = Main.screenWidth / Main.bgWidthScaled + 2; - if ((double) Main.screenPosition.Y >= Main.worldSurface * 16.0 + 16.0) - return; - for (int index = 0; index < this.bgLoops; ++index) - Main.spriteBatch.Draw(TextureAssets.Background[bgTexIndexes[2]].Value, new Vector2((float) (this.bgStartX + Main.bgWidthScaled * index), (float) this.bgTopY), this.GetBackgroundRect(bgTexIndexes[2]), Main.ColorOfSurfaceBackgroundsModified, 0.0f, new Vector2(), Main.bgScale, SpriteEffects.None, 0.0f); - } - private void DrawBackgroundBlackFill() { float num1 = (float) (Main.worldSurface + 2.0) * 16f - Main.screenPosition.Y; @@ -45713,30 +45776,30 @@ label_623: float num4 = MathHelper.Clamp(num2, 0.0f, (float) Main.screenHeight); if ((double) num4 - (double) num3 <= 0.0) return; - Main.spriteBatch.Draw(TextureAssets.BlackTile.Value, new Microsoft.Xna.Framework.Rectangle(0, (int) num3, Main.screenWidth, (int) ((double) num4 - (double) num3)), Microsoft.Xna.Framework.Color.Black); + Main.spriteBatch.Draw(Main.blackTileTexture, new Microsoft.Xna.Framework.Rectangle(0, (int) num3, Main.screenWidth, (int) ((double) num4 - (double) num3)), Microsoft.Xna.Framework.Color.Black); } - public void DrawTileCracks(int crackType, HitTile hitter) + private void DrawTileCracks(int crackType) { Vector2 vector2 = new Vector2((float) Main.offScreenRange, (float) Main.offScreenRange); if (Main.drawToScreen) vector2 = Vector2.Zero; - for (int index = 0; index < hitter.data.Length; ++index) + for (int index = 0; index < Main.player[Main.myPlayer].hitTile.data.Length; ++index) { - if (hitter.data[index].type == crackType) + if (Main.player[Main.myPlayer].hitTile.data[index].type == crackType) { - int damage = hitter.data[index].damage; + int damage = Main.player[Main.myPlayer].hitTile.data[index].damage; if (damage >= 20) { - int x = hitter.data[index].X; - int y = hitter.data[index].Y; + int x = Main.player[Main.myPlayer].hitTile.data[index].X; + int y = Main.player[Main.myPlayer].hitTile.data[index].Y; if (WorldGen.InWorld(x, y)) { bool flag1 = Main.tile[x, y] != null; if (flag1 && crackType == 1) flag1 = flag1 && Main.tile[x, y].active(); if (flag1 && crackType == 2) - flag1 = flag1 && Main.tile[x, y].wall > (ushort) 0; + flag1 = flag1 && Main.tile[x, y].wall > (byte) 0; if (flag1) { bool flag2 = false; @@ -45745,7 +45808,7 @@ label_623: flag2 = false; else if (Main.tileSolid[(int) Main.tile[x, y].type] && !Main.tileSolidTop[(int) Main.tile[x, y].type]) flag2 = true; - else if (WorldGen.IsTreeType((int) Main.tile[x, y].type)) + else if (Main.tile[x, y].type == (ushort) 5) { flag3 = true; int num1 = (int) Main.tile[x, y].frameX / 22; @@ -45770,10 +45833,10 @@ label_623: num = 1; else if (damage >= 20) num = 0; - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(hitter.data[index].crackStyle * 18, num * 18, 16, 16); + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(Main.player[Main.myPlayer].hitTile.data[index].crackStyle * 18, num * 18, 16, 16); if (flag3) - rectangle.X = (4 + hitter.data[index].crackStyle / 2) * 18; - Main.spriteBatch.Draw(TextureAssets.TileCrack.Value, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + vector2, new Microsoft.Xna.Framework.Rectangle?(rectangle), Lighting.GetColor(x, y), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + rectangle.X = (4 + Main.player[Main.myPlayer].hitTile.data[index].crackStyle / 2) * 18; + Main.spriteBatch.Draw(Main.tileCrackTexture, new Vector2((float) (x * 16 - (int) Main.screenPosition.X), (float) (y * 16 - (int) Main.screenPosition.Y)) + vector2, new Microsoft.Xna.Framework.Rectangle?(rectangle), Lighting.GetColor(x, y), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); } } } @@ -45787,17 +45850,17 @@ label_623: bool flag = Main.player[Main.myPlayer].ZoneTowerVortex || Main.player[Main.myPlayer].ZoneTowerNebula || Main.player[Main.myPlayer].ZoneTowerStardust || Main.player[Main.myPlayer].ZoneTowerSolar; for (int index = 0; index < Main.MonolithFilterNames.Length; ++index) { - if (!flag && index == Main.SceneMetrics.ActiveMonolithType) + if (!flag && index == Main.monolithType) { - if (!Terraria.Graphics.Effects.Filters.Scene[Main.MonolithFilterNames[Main.SceneMetrics.ActiveMonolithType]].IsActive()) - Terraria.Graphics.Effects.Filters.Scene.Activate(Main.MonolithFilterNames[Main.SceneMetrics.ActiveMonolithType], new Vector2()); + if (!Filters.Scene[Main.MonolithFilterNames[Main.monolithType]].IsActive()) + Filters.Scene.Activate(Main.MonolithFilterNames[Main.monolithType], new Vector2()); if (!SkyManager.Instance[Main.MonolithSkyNames[index]].IsActive()) SkyManager.Instance.Activate(Main.MonolithSkyNames[index], new Vector2()); } else { - if (Terraria.Graphics.Effects.Filters.Scene[Main.MonolithFilterNames[index]].IsActive()) - Terraria.Graphics.Effects.Filters.Scene.Deactivate(Main.MonolithFilterNames[index]); + if (Filters.Scene[Main.MonolithFilterNames[index]].IsActive()) + Filters.Scene.Deactivate(Main.MonolithFilterNames[index]); if (SkyManager.Instance[Main.MonolithSkyNames[index]].IsActive()) SkyManager.Instance.Deactivate(Main.MonolithSkyNames[index]); } @@ -45819,66 +45882,59 @@ label_623: this.DoDraw(gameTime); if (Main.OnPostDraw != null) Main.OnPostDraw(gameTime); - Main.Assets.TransferCompletedAssets(); this._isDrawingOrUpdating = false; } private void DoDraw(GameTime gameTime) { + if (Main._drawCycleCounter == 0UL) + Main._tileFrameSeed = Utils.RandomNextSeed(Main._tileFrameSeed); + Main._drawCycleCounter = (Main._drawCycleCounter + 1UL) % 5UL; + Main.MenuUI.IsVisible = Main.gameMenu && Main.menuMode == 888; + Main.InGameUI.IsVisible = !Main.gameMenu && Main.InGameUI.CurrentState != null; + PlayerInput.UpdateMainMouse(); + CaptureManager.Instance.DrawTick(); + TimeLogger.NewDrawFrame(); + if (!Main.gameMenu) + this.lookForColorTiles(); + TimeLogger.DetailedDrawTime(0); + if (Main.loadMap) + { + Main.refreshMap = false; + this.DrawToMap(); + TimeLogger.DetailedDrawTime(1); + } + Main.drawToScreen = Lighting.UpdateEveryFrame; + if (Main.drawToScreen && Main.targetSet) + this.ReleaseTargets(); + if (!Main.drawToScreen && !Main.targetSet) + this.InitTargets(); Stopwatch stopwatch1 = new Stopwatch(); stopwatch1.Start(); - if (Main.showSplash) + ++Main.fpsCount; + if (!this.IsActive) + Main.maxQ = true; + this.UpdateDisplaySettings(); + if (Main.OnPreDraw != null) + Main.OnPreDraw(gameTime); + ++Main.drawsCountedForFPS; + Main.screenLastPosition = Main.screenPosition; + if (Main.stackSplit == 0) { - this.DrawSplash(gameTime); - TimeLogger.SplashDrawTime(stopwatch1.Elapsed.TotalMilliseconds); - TimeLogger.EndDrawFrame(); + Main.stackCounter = 0; + Main.stackDelay = 7; + Main.superFastStack = 0; } else { - if (Main._drawCycleCounter == 0UL) - Main.TileFrameSeed = Utils.RandomNextSeed(Main.TileFrameSeed); - Main._drawCycleCounter = (Main._drawCycleCounter + 1UL) % 5UL; - Main.MenuUI.IsVisible = Main.gameMenu && Main.menuMode == 888; - Main.InGameUI.IsVisible = !Main.gameMenu && Main.InGameUI.CurrentState != null; - PlayerInput.UpdateMainMouse(); - this.RefreshPlayerDrawOrder(); - CaptureManager.Instance.DrawTick(); - TimeLogger.NewDrawFrame(); - if (!Main.gameMenu) - this.TilesRenderer.PreparePaintForTilesOnScreen(); - for (int index = 0; index < Main.ContentThatNeedsRenderTargets.Count; ++index) - Main.ContentThatNeedsRenderTargets[index].PrepareRenderTarget(this.GraphicsDevice, Main.spriteBatch); - this.TilePaintSystem.PrepareAllRequests(); - TimeLogger.DetailedDrawTime(0); - if (Main.loadMap) + ++Main.stackCounter; + int num; + if (false) { - Main.refreshMap = false; - this.DrawToMap(); - TimeLogger.DetailedDrawTime(1); - } - Main.drawToScreen = Lighting.UpdateEveryFrame; - if (Main.drawToScreen && Main.targetSet) - this.ReleaseTargets(); - if (!Main.drawToScreen && !Main.targetSet) - this.InitTargets(); - ++Main.fpsCount; - if (!this.IsActive) - Main.maxQ = true; - this.UpdateDisplaySettings(); - if (Main.OnPreDraw != null) - Main.OnPreDraw(gameTime); - ++Main.drawsCountedForFPS; - Main.screenLastPosition = Main.screenPosition; - if (Main.stackSplit == 0) - { - Main.stackCounter = 0; - Main.stackDelay = 7; - Main.superFastStack = 0; + num = 30; } else { - ++Main.stackCounter; - int num; switch (Main.stackDelay) { case 3: @@ -45893,36 +45949,190 @@ label_623: case 6: num = 25; break; - case 7: - num = 30; - break; default: num = 5; break; } - if (Main.stackCounter >= num) + } + if (Main.stackCounter >= num) + { + --Main.stackDelay; + if (Main.stackDelay < 2) { - --Main.stackDelay; - if (Main.stackDelay < 2) + Main.stackDelay = 2; + ++Main.superFastStack; + } + Main.stackCounter = 0; + } + } + if (Main.myPlayer >= 0) + { + Main.player[Main.myPlayer].lastMouseInterface = Main.player[Main.myPlayer].mouseInterface; + Main.player[Main.myPlayer].mouseInterface = false; + } + if (Main.mapTime > 0) + --Main.mapTime; + if (Main.gameMenu) + Main.mapTime = Main.mapTimeMax; + Main.HoverItem = new Item(); + Vector3 vector3 = Vector3.One / new Vector3(1f, 1f, 1f); + if (!Main.gameMenu && Main.netMode != 2) + { + int num1 = 21; + if ((double) Main.cameraX != 0.0 && !Main.player[Main.myPlayer].pulley) + Main.cameraX = 0.0f; + if ((double) Main.cameraX > 0.0) + { + --Main.cameraX; + if ((double) Main.cameraX < 0.0) + Main.cameraX = 0.0f; + } + if ((double) Main.cameraX < 0.0) + { + ++Main.cameraX; + if ((double) Main.cameraX > 0.0) + Main.cameraX = 0.0f; + } + Vector2 screenPosition = Main.screenPosition; + Main.screenPosition.X = (float) ((double) Main.player[Main.myPlayer].position.X + (double) Main.player[Main.myPlayer].width * 0.5 - (double) Main.screenWidth * 0.5 * (double) vector3.X) + Main.cameraX; + Main.screenPosition.Y = (float) ((double) Main.player[Main.myPlayer].position.Y + (double) Main.player[Main.myPlayer].height - (double) num1 - (double) Main.screenHeight * 0.5 * (double) vector3.Y) + Main.player[Main.myPlayer].gfxOffY; + float num2 = 0.0f; + float num3 = 0.0f; + float num4 = 24f; + if (Main.player[Main.myPlayer].noThrow <= 0 && !Main.player[Main.myPlayer].lastMouseInterface || (double) Main.zoomX != 0.0 || (double) Main.zoomY != 0.0) + { + if (PlayerInput.UsingGamepad) + { + Player player = Main.player[Main.myPlayer]; + if ((double) PlayerInput.GamepadThumbstickRight.Length() != 0.0 || !Main.SmartCursorEnabled) { - Main.stackDelay = 2; - ++Main.superFastStack; + float num5 = -1f; + if (player.inventory[player.selectedItem].type == 1254 && player.scope) + num5 = 0.8f; + else if (player.inventory[player.selectedItem].type == 1254) + num5 = 0.6666667f; + else if (player.inventory[player.selectedItem].type == 1299) + num5 = 0.6666667f; + else if (player.scope) + num5 = 0.5f; + Vector2 vector2_1 = (Main.MouseScreen - new Vector2((float) Main.screenWidth, (float) Main.screenHeight) / 2f) / (new Vector2((float) Main.screenWidth, (float) Main.screenHeight) / 2f); + num4 = 48f; + if (vector2_1 != Vector2.Zero && (double) num5 != -1.0) + { + Vector2 vector2_2 = new Vector2((float) Main.screenWidth, (float) Main.screenHeight) * 0.5f * vector2_1 * num5; + num2 = vector2_2.X; + num3 = vector2_2.Y; + } } - Main.stackCounter = 0; + } + else if (Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type == 1254 && Main.player[Main.myPlayer].scope && Main.mouseRight) + { + int num6 = Main.mouseX; + int num7 = Main.mouseY; + if (num6 > Main.screenWidth) + num6 = Main.screenWidth; + if (num6 < 0) + num6 = 0; + if (num7 > Main.screenHeight) + num7 = Main.screenHeight; + if (num7 < 0) + num7 = 0; + num2 = (float) (num6 - Main.screenWidth / 2) / 1.25f; + num3 = (float) (num7 - Main.screenHeight / 2) / 1.25f; + } + else if (Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type == 1254 && Main.mouseRight) + { + int num8 = Main.mouseX; + int num9 = Main.mouseY; + if (num8 > Main.screenWidth) + num8 = Main.screenWidth; + if (num8 < 0) + num8 = 0; + if (num9 > Main.screenHeight) + num9 = Main.screenHeight; + if (num9 < 0) + num9 = 0; + num2 = (float) (num8 - Main.screenWidth / 2) / 1.5f; + num3 = (float) (num9 - Main.screenHeight / 2) / 1.5f; + } + else if (Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type == 1299 && Main.player[Main.myPlayer].selectedItem != 58) + { + int num10 = Main.mouseX; + int num11 = Main.mouseY; + if (num10 > Main.screenWidth) + num10 = Main.screenWidth; + if (num10 < 0) + num10 = 0; + if (num11 > Main.screenHeight) + num11 = Main.screenHeight; + if (num11 < 0) + num11 = 0; + num2 = (float) (num10 - Main.screenWidth / 2) / 1.5f; + num3 = (float) (num11 - Main.screenHeight / 2) / 1.5f; + } + else if (Main.player[Main.myPlayer].scope && Main.mouseRight) + { + int num12 = Main.mouseX; + int num13 = Main.mouseY; + if (num12 > Main.screenWidth) + num12 = Main.screenWidth; + if (num12 < 0) + num12 = 0; + if (num13 > Main.screenHeight) + num13 = Main.screenHeight; + if (num13 < 0) + num13 = 0; + num2 = (float) (num12 - Main.screenWidth / 2) / 2f; + num3 = (float) (num13 - Main.screenHeight / 2) / 2f; } } - if (Main.myPlayer >= 0) + if (float.IsNaN(Main.zoomX)) + Main.zoomX = 0.0f; + if (float.IsNaN(Main.zoomY)) + Main.zoomY = 0.0f; + float num14 = num2 - Main.zoomX; + float num15 = num3 - Main.zoomY; + float num16 = (float) Math.Sqrt((double) num14 * (double) num14 + (double) num15 * (double) num15); + float num17 = (float) Math.Sqrt((double) num14 * (double) num14 + (double) num15 * (double) num15); + if ((double) num17 < (double) num4) { - Main.player[Main.myPlayer].lastMouseInterface = Main.player[Main.myPlayer].mouseInterface; - Main.player[Main.myPlayer].mouseInterface = false; + Main.zoomX = num2; + Main.zoomY = num3; } - if (Main.mapTime > 0) - --Main.mapTime; - if (Main.gameMenu) - Main.mapTime = Main.mapTimeMax; - Main.HoverItem = new Item(); - Main.DoDraw_UpdateCameraPosition(); - Main.CheckMonoliths(); + else + { + float num18 = num4 / num17; + float num19 = num14 * num18; + float num20 = num15 * num18; + Main.zoomX += num19; + Main.zoomY += num20; + } + Main.screenPosition.X += Main.zoomX; + Main.screenPosition.Y += Main.zoomY * Main.player[Main.myPlayer].gravDir; + if ((double) Main.cameraLerp > 0.0) + { + if ((double) Vector2.Distance(screenPosition, Main.screenPosition) - (double) Main.player[Main.myPlayer].velocity.Length() < 0.25 || Main.cameraGamePadLerp && !PlayerInput.UsingGamepad) + { + Main.cameraLerp = 0.0f; + Main.cameraGamePadLerp = false; + } + else + Main.screenPosition = Vector2.Lerp(screenPosition, Main.screenPosition, Main.cameraLerp); + } + Main.screenPosition.X = (float) (int) Main.screenPosition.X; + Main.screenPosition.Y = (float) (int) Main.screenPosition.Y; + } + if (!Main.gameMenu && Main.netMode != 2) + Main.ClampScreenPositionToWorld(); + Main.CheckMonoliths(); + if (Main.showSplash) + { + this.DrawSplash(gameTime); + TimeLogger.SplashDrawTime(stopwatch1.Elapsed.TotalMilliseconds); + TimeLogger.EndDrawFrame(); + } + else + { Main.sunCircle += 0.01f; if ((double) Main.sunCircle > 6.285) Main.sunCircle -= 6.285f; @@ -46058,175 +46268,686 @@ label_623: } } this.bgParallax = 0.1; - this.bgStartX = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.backgroundWidth[Main.background]) - (double) (Main.backgroundWidth[Main.background] / 2)); + this.bgStart = (int) (-Math.IEEERemainder((double) Main.screenPosition.X * this.bgParallax, (double) Main.backgroundWidth[Main.background]) - (double) (Main.backgroundWidth[Main.background] / 2)); this.bgLoops = Main.screenWidth / Main.backgroundWidth[Main.background] + 2; this.bgStartY = 0; this.bgLoopsY = 0; - this.bgTopY = (int) (-(double) Main.screenPosition.Y / (Main.worldSurface * 16.0 - 600.0) * 200.0); + this.bgTop = (int) (-(double) Main.screenPosition.Y / (Main.worldSurface * 16.0 - 600.0) * 200.0); + Main.bgColor = Microsoft.Xna.Framework.Color.White; if (Main.gameMenu || Main.netMode == 2) - this.bgTopY = -200; - float num1 = 0.0005f * (float) Main.dayRate; + this.bgTop = -200; + int num21 = (int) (Main.time / 54000.0 * (double) (Main.screenWidth + Main.sunTexture.Width * 2)) - Main.sunTexture.Width; + int num22 = 0; + Microsoft.Xna.Framework.Color white1 = Microsoft.Xna.Framework.Color.White; + float scale1 = 1f; + float rotation1 = (float) (Main.time / 54000.0 * 2.0 - 7.30000019073486); + int num23 = (int) (Main.time / 32400.0 * (double) (Main.screenWidth + Main.moonTexture[Main.moonType].Width * 2)) - Main.moonTexture[Main.moonType].Width; + int num24 = 0; + Microsoft.Xna.Framework.Color white2 = Microsoft.Xna.Framework.Color.White; + float scale2 = 1f; + float rotation2 = (float) (Main.time / 32400.0 * 2.0 - 7.30000019073486); + if (Main.dayTime) + { + double num25; + if (Main.time < 27000.0) + { + num25 = Math.Pow(1.0 - Main.time / 54000.0 * 2.0, 2.0); + num22 = (int) ((double) this.bgTop + num25 * 250.0 + 180.0); + } + else + { + num25 = Math.Pow((Main.time / 54000.0 - 0.5) * 2.0, 2.0); + num22 = (int) ((double) this.bgTop + num25 * 250.0 + 180.0); + } + scale1 = (float) (1.2 - num25 * 0.4); + } + else + { + double num26; + if (Main.time < 16200.0) + { + num26 = Math.Pow(1.0 - Main.time / 32400.0 * 2.0, 2.0); + num24 = (int) ((double) this.bgTop + num26 * 250.0 + 180.0); + } + else + { + num26 = Math.Pow((Main.time / 32400.0 - 0.5) * 2.0, 2.0); + num24 = (int) ((double) this.bgTop + num26 * 250.0 + 180.0); + } + scale2 = (float) (1.2 - num26 * 0.4); + } + if (Main.dayTime) + { + if (Main.time < 13500.0) + { + float num27 = (float) (Main.time / 13500.0); + white1.R = (byte) ((double) num27 * 200.0 + 55.0); + white1.G = (byte) ((double) num27 * 180.0 + 75.0); + white1.B = (byte) ((double) num27 * 250.0 + 5.0); + Main.bgColor.R = (byte) ((double) num27 * 230.0 + 25.0); + Main.bgColor.G = (byte) ((double) num27 * 220.0 + 35.0); + Main.bgColor.B = (byte) ((double) num27 * 220.0 + 35.0); + } + if (Main.time > 45900.0) + { + float num28 = (float) (1.0 - (Main.time / 54000.0 - 0.85) * (20.0 / 3.0)); + white1.R = (byte) ((double) num28 * 120.0 + 55.0); + white1.G = (byte) ((double) num28 * 100.0 + 25.0); + white1.B = (byte) ((double) num28 * 120.0 + 55.0); + Main.bgColor.R = (byte) ((double) num28 * 200.0 + 35.0); + Main.bgColor.G = (byte) ((double) num28 * 85.0 + 35.0); + Main.bgColor.B = (byte) ((double) num28 * 135.0 + 35.0); + } + else if (Main.time > 37800.0) + { + float num29 = (float) (1.0 - (Main.time / 54000.0 - 0.7) * (20.0 / 3.0)); + white1.R = (byte) ((double) num29 * 80.0 + 175.0); + white1.G = (byte) ((double) num29 * 130.0 + 125.0); + white1.B = (byte) ((double) num29 * 100.0 + 155.0); + Main.bgColor.R = (byte) ((double) num29 * 20.0 + 235.0); + Main.bgColor.G = (byte) ((double) num29 * 135.0 + 120.0); + Main.bgColor.B = (byte) ((double) num29 * 85.0 + 170.0); + } + } + if (!Main.dayTime) + { + if (Main.bloodMoon) + { + if (Main.time < 16200.0) + { + float num30 = (float) (1.0 - Main.time / 16200.0); + white2.R = (byte) ((double) num30 * 10.0 + 205.0); + white2.G = (byte) ((double) num30 * 170.0 + 55.0); + white2.B = (byte) ((double) num30 * 200.0 + 55.0); + Main.bgColor.R = (byte) (40.0 - (double) num30 * 40.0 + 35.0); + Main.bgColor.G = (byte) ((double) num30 * 20.0 + 15.0); + Main.bgColor.B = (byte) ((double) num30 * 20.0 + 15.0); + } + else if (Main.time >= 16200.0) + { + float num31 = (float) ((Main.time / 32400.0 - 0.5) * 2.0); + white2.R = (byte) ((double) num31 * 50.0 + 205.0); + white2.G = (byte) ((double) num31 * 100.0 + 155.0); + white2.B = (byte) ((double) num31 * 100.0 + 155.0); + white2.R = (byte) ((double) num31 * 10.0 + 205.0); + white2.G = (byte) ((double) num31 * 170.0 + 55.0); + white2.B = (byte) ((double) num31 * 200.0 + 55.0); + Main.bgColor.R = (byte) (40.0 - (double) num31 * 40.0 + 35.0); + Main.bgColor.G = (byte) ((double) num31 * 20.0 + 15.0); + Main.bgColor.B = (byte) ((double) num31 * 20.0 + 15.0); + } + } + else if (Main.time < 16200.0) + { + float num32 = (float) (1.0 - Main.time / 16200.0); + white2.R = (byte) ((double) num32 * 10.0 + 205.0); + white2.G = (byte) ((double) num32 * 70.0 + 155.0); + white2.B = (byte) ((double) num32 * 100.0 + 155.0); + Main.bgColor.R = (byte) ((double) num32 * 30.0 + 5.0); + Main.bgColor.G = (byte) ((double) num32 * 30.0 + 5.0); + Main.bgColor.B = (byte) ((double) num32 * 30.0 + 5.0); + } + else if (Main.time >= 16200.0) + { + float num33 = (float) ((Main.time / 32400.0 - 0.5) * 2.0); + white2.R = (byte) ((double) num33 * 50.0 + 205.0); + white2.G = (byte) ((double) num33 * 100.0 + 155.0); + white2.B = (byte) ((double) num33 * 100.0 + 155.0); + Main.bgColor.R = (byte) ((double) num33 * 20.0 + 5.0); + Main.bgColor.G = (byte) ((double) num33 * 30.0 + 5.0); + Main.bgColor.B = (byte) ((double) num33 * 30.0 + 5.0); + } + } + float num34 = 0.0005f * (float) Main.dayRate; if (Main.gameMenu) - num1 *= 20f; + num34 *= 20f; if (Main.raining) { if ((double) Main.cloudAlpha > (double) Main.maxRaining) { - Main.cloudAlpha -= num1; + Main.cloudAlpha -= num34; if ((double) Main.cloudAlpha < (double) Main.maxRaining) Main.cloudAlpha = Main.maxRaining; } else if ((double) Main.cloudAlpha < (double) Main.maxRaining) { - Main.cloudAlpha += num1; + Main.cloudAlpha += num34; if ((double) Main.cloudAlpha > (double) Main.maxRaining) Main.cloudAlpha = Main.maxRaining; } } else { - Main.cloudAlpha -= num1; + Main.cloudAlpha -= num34; if ((double) Main.cloudAlpha < 0.0) Main.cloudAlpha = 0.0f; } + if ((double) Main.cloudAlpha > 0.0) + { + float num35 = (float) (1.0 - (double) Main.cloudAlpha * 0.899999976158142); + Main.bgColor.R = (byte) ((double) Main.bgColor.R * (double) num35); + Main.bgColor.G = (byte) ((double) Main.bgColor.G * (double) num35); + Main.bgColor.B = (byte) ((double) Main.bgColor.B * (double) num35); + } if (Main.gameMenu || Main.netMode == 2) + { + this.bgTop = 0; + if (!Main.dayTime) + { + Main.bgColor.R = (byte) 35; + Main.bgColor.G = (byte) 35; + Main.bgColor.B = (byte) 35; + } + } + if (Main.gameMenu) { Main.bgDelay = 1000; - Main.SceneMetrics.EvilTileCount = (int) ((double) Main.bgAlphaFrontLayer[1] * (double) SceneMetrics.CorruptionTileMax); + Main.evilTiles = (int) ((double) Main.bgAlpha[1] * 500.0); } - Microsoft.Xna.Framework.Color moonColor = Microsoft.Xna.Framework.Color.White; - Microsoft.Xna.Framework.Color sunColor = Microsoft.Xna.Framework.Color.White; - float num2 = (float) (Main.SceneMetrics.MushroomTileCount / SceneMetrics.MushroomTileMax); - float tempMushroomInfluence = Main.SmoothedMushroomLightInfluence; - if ((double) num2 > 0.0) + if (Main.evilTiles > 0) { - double num3 = (double) num2; - if (num3 > (double) tempMushroomInfluence) - tempMushroomInfluence += 0.01f; - if (num3 < (double) tempMushroomInfluence) - tempMushroomInfluence -= 0.01f; + float num36 = (float) Main.evilTiles / 500f; + if ((double) num36 > 1.0) + num36 = 1f; + int r1 = (int) Main.bgColor.R; + int g1 = (int) Main.bgColor.G; + int b1 = (int) Main.bgColor.B; + int num37 = r1 - (int) (100.0 * (double) num36 * ((double) Main.bgColor.R / (double) byte.MaxValue)); + int num38 = g1 - (int) (140.0 * (double) num36 * ((double) Main.bgColor.G / (double) byte.MaxValue)); + int num39 = b1 - (int) (80.0 * (double) num36 * ((double) Main.bgColor.B / (double) byte.MaxValue)); + if (num37 < 15) + num37 = 15; + if (num38 < 15) + num38 = 15; + if (num39 < 15) + num39 = 15; + Main.bgColor.R = (byte) num37; + Main.bgColor.G = (byte) num38; + Main.bgColor.B = (byte) num39; + int r2 = (int) white1.R; + int g2 = (int) white1.G; + int b2 = (int) white1.B; + int num40 = r2 - (int) (100.0 * (double) num36 * ((double) white1.R / (double) byte.MaxValue)); + int num41 = g2 - (int) (100.0 * (double) num36 * ((double) white1.G / (double) byte.MaxValue)); + int num42 = b2 - (int) (0.0 * (double) num36 * ((double) white1.B / (double) byte.MaxValue)); + if (num40 < 15) + num40 = 15; + if (num41 < 15) + num41 = 15; + if (num42 < 15) + num42 = 15; + white1.R = (byte) num40; + white1.G = (byte) num41; + white1.B = (byte) num42; + int r3 = (int) white2.R; + int g3 = (int) white2.G; + int b3 = (int) white2.B; + int num43 = r3 - (int) (140.0 * (double) num36 * ((double) white2.R / (double) byte.MaxValue)); + int num44 = g3 - (int) (190.0 * (double) num36 * ((double) white2.G / (double) byte.MaxValue)); + int num45 = b3 - (int) (170.0 * (double) num36 * ((double) white2.B / (double) byte.MaxValue)); + if (num43 < 15) + num43 = 15; + if (num44 < 15) + num44 = 15; + if (num45 < 15) + num45 = 15; + white2.R = (byte) num43; + white2.G = (byte) num44; + white2.B = (byte) num45; + } + if (Main.bloodTiles > 0) + { + float num46 = (float) Main.bloodTiles / 400f; + if ((double) num46 > 1.0) + num46 = 1f; + int r4 = (int) Main.bgColor.R; + int g4 = (int) Main.bgColor.G; + int b4 = (int) Main.bgColor.B; + int num47 = r4 - (int) (70.0 * (double) num46 * ((double) Main.bgColor.G / (double) byte.MaxValue)); + int num48 = g4 - (int) (110.0 * (double) num46 * ((double) Main.bgColor.G / (double) byte.MaxValue)); + int num49 = b4 - (int) (150.0 * (double) num46 * ((double) Main.bgColor.B / (double) byte.MaxValue)); + if (num47 < 15) + num47 = 15; + if (num48 < 15) + num48 = 15; + if (num49 < 15) + num49 = 15; + Main.bgColor.R = (byte) num47; + Main.bgColor.G = (byte) num48; + Main.bgColor.B = (byte) num49; + int num50 = (int) white1.R; + int g5 = (int) white1.G; + int b5 = (int) white1.B; + int num51 = g5 - (int) (90.0 * (double) num46 * ((double) white1.G / (double) byte.MaxValue)); + int num52 = b5 - (int) (110.0 * (double) num46 * ((double) white1.B / (double) byte.MaxValue)); + if (num50 < 15) + num50 = 15; + if (num51 < 15) + num51 = 15; + if (num52 < 15) + num52 = 15; + white1.R = (byte) num50; + white1.G = (byte) num51; + white1.B = (byte) num52; + int r5 = (int) white2.R; + int g6 = (int) white2.G; + int b6 = (int) white2.B; + int num53 = r5 - (int) (100.0 * (double) num46 * ((double) white2.R / (double) byte.MaxValue)); + int num54 = g6 - (int) (120.0 * (double) num46 * ((double) white2.G / (double) byte.MaxValue)); + int num55 = b6 - (int) (180.0 * (double) num46 * ((double) white2.B / (double) byte.MaxValue)); + if (num53 < 15) + num53 = 15; + if (num54 < 15) + num54 = 15; + if (num55 < 15) + num55 = 15; + white2.R = (byte) num53; + white2.G = (byte) num54; + white2.B = (byte) num55; + } + if (Main.jungleTiles > 0) + { + float num56 = (float) Main.jungleTiles / 200f; + if ((double) num56 > 1.0) + num56 = 1f; + int r6 = (int) Main.bgColor.R; + int num57 = (int) Main.bgColor.G; + int b7 = (int) Main.bgColor.B; + int num58 = r6 - (int) (40.0 * (double) num56 * ((double) Main.bgColor.R / (double) byte.MaxValue)); + int num59 = b7 - (int) (70.0 * (double) num56 * ((double) Main.bgColor.B / (double) byte.MaxValue)); + if (num57 > (int) byte.MaxValue) + num57 = (int) byte.MaxValue; + if (num57 < 15) + num57 = 15; + if (num58 > (int) byte.MaxValue) + num58 = (int) byte.MaxValue; + if (num58 < 15) + num58 = 15; + if (num59 < 15) + num59 = 15; + Main.bgColor.R = (byte) num58; + Main.bgColor.G = (byte) num57; + Main.bgColor.B = (byte) num59; + int r7 = (int) white1.R; + int num60 = (int) white1.G; + int b8 = (int) white1.B; + int num61 = r7 - (int) (30.0 * (double) num56 * ((double) white1.R / (double) byte.MaxValue)); + int num62 = b8 - (int) (10.0 * (double) num56 * ((double) white1.B / (double) byte.MaxValue)); + if (num61 < 15) + num61 = 15; + if (num60 < 15) + num60 = 15; + if (num62 < 15) + num62 = 15; + white1.R = (byte) num61; + white1.G = (byte) num60; + white1.B = (byte) num62; + int r8 = (int) white2.R; + int g = (int) white2.G; + int b9 = (int) white2.B; + int num63 = g - (int) (140.0 * (double) num56 * ((double) white2.R / (double) byte.MaxValue)); + int num64 = r8 - (int) (170.0 * (double) num56 * ((double) white2.G / (double) byte.MaxValue)); + int num65 = b9 - (int) (190.0 * (double) num56 * ((double) white2.B / (double) byte.MaxValue)); + if (num64 < 15) + num64 = 15; + if (num63 < 15) + num63 = 15; + if (num65 < 15) + num65 = 15; + white2.R = (byte) num64; + white2.G = (byte) num63; + white2.B = (byte) num65; + } + if (Main.shroomTiles > 0) + { + double num66 = (double) Main.shroomTiles / 160.0; + if (num66 > (double) Main.shroomLight) + Main.shroomLight += 0.01f; + if (num66 < (double) Main.shroomLight) + Main.shroomLight -= 0.01f; } else - tempMushroomInfluence -= 0.02f; - if ((double) tempMushroomInfluence < 0.0) - tempMushroomInfluence = 0.0f; - if ((double) tempMushroomInfluence > 1.0) - tempMushroomInfluence = 1f; - Main.SmoothedMushroomLightInfluence = tempMushroomInfluence; - Main.SetBackColor(new Main.InfoToSetBackColor() + Main.shroomLight -= 0.02f; + if ((double) Main.shroomLight < 0.0) + Main.shroomLight = 0.0f; + if ((double) Main.shroomLight > 1.0) + Main.shroomLight = 1f; + if ((double) Main.shroomLight > 0.0) { - isInGameMenuOrIsServer = Main.gameMenu || Main.netMode == 2, - CorruptionBiomeInfluence = (float) Main.SceneMetrics.EvilTileCount / (float) SceneMetrics.CorruptionTileMax, - CrimsonBiomeInfluence = (float) Main.SceneMetrics.BloodTileCount / (float) SceneMetrics.CrimsonTileMax, - JungleBiomeInfluence = (float) Main.SceneMetrics.JungleTileCount / (float) SceneMetrics.JungleTileMax, - MushroomBiomeInfluence = Main.SmoothedMushroomLightInfluence, - GraveyardInfluence = Main.GraveyardVisualIntensity, - BloodMoonActive = Main.bloodMoon || Main.SceneMetrics.BloodMoonMonolith, - LanternNightActive = LanternNight.LanternsUp - }, out sunColor, out moonColor); - if (Main.gameMenu || Main.netMode == 2) - this.bgTopY = 0; - Main.ApplyColorOfTheSkiesToTiles(); - Main.UpdateAtmosphereTransparencyToSkyColor(); + float shroomLight = Main.shroomLight; + int r9 = (int) Main.bgColor.R; + int g7 = (int) Main.bgColor.G; + int b10 = (int) Main.bgColor.B; + int num67 = g7 - (int) (250.0 * (double) shroomLight * ((double) Main.bgColor.G / (double) byte.MaxValue)); + int num68 = r9 - (int) (250.0 * (double) shroomLight * ((double) Main.bgColor.R / (double) byte.MaxValue)); + int num69 = b10 - (int) (250.0 * (double) shroomLight * ((double) Main.bgColor.B / (double) byte.MaxValue)); + if (num67 < 15) + num67 = 15; + if (num68 < 15) + num68 = 15; + if (num69 < 15) + num69 = 15; + Main.bgColor.R = (byte) num68; + Main.bgColor.G = (byte) num67; + Main.bgColor.B = (byte) num69; + int r10 = (int) white1.R; + int g8 = (int) white1.G; + int b11 = (int) white1.B; + int num70 = g8 - (int) (10.0 * (double) shroomLight * ((double) white1.G / (double) byte.MaxValue)); + int num71 = r10 - (int) (30.0 * (double) shroomLight * ((double) white1.R / (double) byte.MaxValue)); + int num72 = b11 - (int) (10.0 * (double) shroomLight * ((double) white1.B / (double) byte.MaxValue)); + if (num71 < 15) + num71 = 15; + if (num70 < 15) + num70 = 15; + if (num72 < 15) + num72 = 15; + white1.R = (byte) num71; + white1.G = (byte) num70; + white1.B = (byte) num72; + int r11 = (int) white2.R; + int g9 = (int) white2.G; + int b12 = (int) white2.B; + int num73 = g9 - (int) (140.0 * (double) shroomLight * ((double) white2.R / (double) byte.MaxValue)); + int num74 = r11 - (int) (170.0 * (double) shroomLight * ((double) white2.G / (double) byte.MaxValue)); + int num75 = b12 - (int) (190.0 * (double) shroomLight * ((double) white2.B / (double) byte.MaxValue)); + if (num74 < 15) + num74 = 15; + if (num73 < 15) + num73 = 15; + if (num75 < 15) + num75 = 15; + white2.R = (byte) num74; + white2.G = (byte) num73; + white2.B = (byte) num75; + } + if (Lighting.NotRetro) + { + if (Main.bgColor.R < (byte) 10) + Main.bgColor.R = (byte) 10; + if (Main.bgColor.G < (byte) 10) + Main.bgColor.G = (byte) 10; + if (Main.bgColor.B < (byte) 10) + Main.bgColor.B = (byte) 10; + } + else + { + if (Main.bgColor.R < (byte) 15) + Main.bgColor.R = (byte) 15; + if (Main.bgColor.G < (byte) 15) + Main.bgColor.G = (byte) 15; + if (Main.bgColor.B < (byte) 15) + Main.bgColor.B = (byte) 15; + } + if (Main.bloodMoon) + { + if (Main.bgColor.R < (byte) 25) + Main.bgColor.R = (byte) 25; + if (Main.bgColor.G < (byte) 25) + Main.bgColor.G = (byte) 25; + if (Main.bgColor.B < (byte) 25) + Main.bgColor.B = (byte) 25; + } + if (Main.eclipse && Main.dayTime) + { + float num76 = 1242f; + Main.eclipseLight = (float) Main.time / num76; + if ((double) Main.eclipseLight > 1.0) + Main.eclipseLight = 1f; + } + else if ((double) Main.eclipseLight > 0.0) + { + Main.eclipseLight -= 0.01f; + if ((double) Main.eclipseLight < 0.0) + Main.eclipseLight = 0.0f; + } + if ((double) Main.eclipseLight > 0.0) + { + float num77 = (float) (1.0 - 0.925000011920929 * (double) Main.eclipseLight); + float num78 = (float) (1.0 - 0.959999978542328 * (double) Main.eclipseLight); + float num79 = (float) (1.0 - 1.0 * (double) Main.eclipseLight); + int num80 = (int) ((double) Main.bgColor.R * (double) num77); + int num81 = (int) ((double) Main.bgColor.G * (double) num78); + int num82 = (int) ((double) Main.bgColor.B * (double) num79); + Main.bgColor.R = (byte) num80; + Main.bgColor.G = (byte) num81; + Main.bgColor.B = (byte) num82; + white1.R = byte.MaxValue; + white1.G = (byte) 127; + white1.B = (byte) 67; + if (Main.bgColor.R < (byte) 20) + Main.bgColor.R = (byte) 20; + if (Main.bgColor.G < (byte) 10) + Main.bgColor.G = (byte) 10; + if (!Lighting.NotRetro) + { + if (Main.bgColor.R < (byte) 20) + Main.bgColor.R = (byte) 20; + if (Main.bgColor.G < (byte) 14) + Main.bgColor.G = (byte) 14; + if (Main.bgColor.B < (byte) 6) + Main.bgColor.B = (byte) 6; + } + } + Main.tileColor.A = byte.MaxValue; + Main.tileColor.R = (byte) (((int) Main.bgColor.R + (int) Main.bgColor.G + (int) Main.bgColor.B + (int) Main.bgColor.R * 7) / 10); + Main.tileColor.G = (byte) (((int) Main.bgColor.R + (int) Main.bgColor.G + (int) Main.bgColor.B + (int) Main.bgColor.G * 7) / 10); + Main.tileColor.B = (byte) (((int) Main.bgColor.R + (int) Main.bgColor.G + (int) Main.bgColor.B + (int) Main.bgColor.B * 7) / 10); + Main.tileColor = SkyManager.Instance.ProcessTileColor(Main.tileColor); + float num83 = (float) (Main.maxTilesX / 4200); + float num84 = num83 * num83; + Main.atmo = (float) ((((double) Main.screenPosition.Y + (double) (Main.screenHeight / 2)) / 16.0 - (65.0 + 10.0 * (double) num84)) / (Main.worldSurface / 5.0)); + if ((double) Main.atmo < 0.0) + Main.atmo = 0.0f; + if ((double) Main.atmo > 1.0) + Main.atmo = 1f; + if (Main.gameMenu) + Main.atmo = 1f; + Main.bgColor.R = (byte) ((double) Main.bgColor.R * (double) Main.atmo); + Main.bgColor.G = (byte) ((double) Main.bgColor.G * (double) Main.atmo); + Main.bgColor.B = (byte) ((double) Main.bgColor.B * (double) Main.atmo); + if ((double) Main.atmo <= 0.05) + { + Main.bgColor.R = (byte) 0; + Main.bgColor.G = (byte) 0; + Main.bgColor.B = (byte) 0; + Main.bgColor.A = (byte) 0; + } this.GraphicsDevice.Clear(Microsoft.Xna.Framework.Color.Black); base.Draw(gameTime); - float val2_1 = (float) Main.screenWidth / Main.MinimumZoomComparerX; - float val2_2 = (float) Main.screenHeight / Main.MinimumZoomComparerY; - Main.ForcedMinimumZoom = Math.Max(Math.Max(1f, val2_1), val2_2); + float val2_1 = (float) Main.screenWidth / 1920f; + float val2_2 = (float) Main.screenHeight / 1200f; Main.GameViewMatrix.Effects = Main.gameMenu || (double) Main.player[Main.myPlayer].gravDir == 1.0 ? SpriteEffects.None : SpriteEffects.FlipVertically; Main.BackgroundViewMatrix.Effects = Main.GameViewMatrix.Effects; + Main.ForcedMinimumZoom = Math.Max(Math.Max(1f, val2_1), val2_2); Main.BackgroundViewMatrix.Zoom = new Vector2(Main.ForcedMinimumZoom); Main.GameViewMatrix.Zoom = new Vector2(Main.ForcedMinimumZoom * MathHelper.Clamp(Main.GameZoomTarget, 1f, 2f)); - Main.Rasterizer = Main.gameMenu || (double) Main.player[Main.myPlayer].gravDir == 1.0 ? RasterizerState.CullCounterClockwise : RasterizerState.CullClockwise; - bool flag = !Main.drawToScreen && Main.netMode != 2 && !Main.gameMenu && !Main.mapFullscreen && Lighting.NotRetro && Terraria.Graphics.Effects.Filters.Scene.CanCapture(); + this.Rasterizer = Main.gameMenu || (double) Main.player[Main.myPlayer].gravDir == 1.0 ? RasterizerState.CullCounterClockwise : RasterizerState.CullClockwise; + bool flag = !Main.drawToScreen && Main.netMode != 2 && !Main.gameMenu && !Main.mapFullscreen && Lighting.NotRetro && Filters.Scene.CanCapture(); if (flag) - Terraria.Graphics.Effects.Filters.Scene.BeginCapture(Main.screenTarget, Microsoft.Xna.Framework.Color.Black); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.BackgroundViewMatrix.TransformationMatrix); + Filters.Scene.BeginCapture(); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, this.Rasterizer, (Effect) null, Main.BackgroundViewMatrix.TransformationMatrix); TimeLogger.DetailedDrawReset(); if (!Main.mapFullscreen) { this.unityMouseOver = false; if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0) { - Asset asset = TextureAssets.Background[Main.background]; - Microsoft.Xna.Framework.Rectangle destinationRectangle = new Microsoft.Xna.Framework.Rectangle(this.bgStartX, this.bgTopY, asset.Width(), Math.Max(Main.screenHeight, asset.Height())); - if (destinationRectangle.Bottom < asset.Height()) - { - int num4 = asset.Height() - destinationRectangle.Bottom; - destinationRectangle.Height += num4; - } for (int index = 0; index < this.bgLoops; ++index) - { - destinationRectangle.X = this.bgStartX + asset.Width() * index; - Main.spriteBatch.Draw(asset.Value, destinationRectangle, Main.ColorOfTheSkies); - } + Main.spriteBatch.Draw(Main.backgroundTexture[Main.background], new Microsoft.Xna.Framework.Rectangle(this.bgStart + Main.backgroundWidth[Main.background] * index, this.bgTop, Main.backgroundWidth[Main.background], Math.Max(Main.screenHeight, Main.backgroundHeight[Main.background])), Main.bgColor); TimeLogger.DetailedDrawTime(6); } Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.BackgroundViewMatrix.EffectMatrix); - Main.SceneArea sceneArea = new Main.SceneArea() + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, this.Rasterizer, (Effect) null, Main.BackgroundViewMatrix.EffectMatrix); + if ((double) Main.screenPosition.Y < Main.worldSurface * 16.0 + 16.0 && (double) byte.MaxValue * (1.0 - (double) Main.cloudAlpha) - (double) Main.bgColor.R - 25.0 > 0.0 && Main.netMode != 2) { - bgTopY = this.bgTopY, - totalHeight = (float) Main.screenHeight, - totalWidth = (float) Main.screenWidth, - SceneLocalScreenPositionOffset = Vector2.Zero - }; - this.DrawStarsInBackground(sceneArea); + for (int index = 0; index < Main.numStars; ++index) + { + Microsoft.Xna.Framework.Color color = new Microsoft.Xna.Framework.Color(); + float num85 = (float) Main.evilTiles / 500f; + if ((double) num85 > 1.0) + num85 = 1f; + float num86 = (float) (1.0 - (double) num85 * 0.5); + if (Main.evilTiles <= 0) + num86 = 1f; + int num87 = (int) ((double) ((int) byte.MaxValue - (int) Main.bgColor.R - 100) * (double) Main.star[index].twinkle * (double) num86); + int num88 = (int) ((double) ((int) byte.MaxValue - (int) Main.bgColor.G - 100) * (double) Main.star[index].twinkle * (double) num86); + int num89 = (int) ((double) ((int) byte.MaxValue - (int) Main.bgColor.B - 100) * (double) Main.star[index].twinkle * (double) num86); + if (num87 < 0) + num87 = 0; + if (num88 < 0) + num88 = 0; + if (num89 < 0) + num89 = 0; + color.R = (byte) num87; + color.G = (byte) ((double) num88 * (double) num86); + color.B = (byte) ((double) num89 * (double) num86); + float num90 = Main.star[index].position.X * ((float) Main.screenWidth / 800f); + float num91 = Main.star[index].position.Y * ((float) Main.screenHeight / 600f); + Main.spriteBatch.Draw(Main.starTexture[Main.star[index].type], new Vector2(num90 + (float) Main.starTexture[Main.star[index].type].Width * 0.5f, num91 + (float) Main.starTexture[Main.star[index].type].Height * 0.5f + (float) this.bgTop), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.starTexture[Main.star[index].type].Width, Main.starTexture[Main.star[index].type].Height)), color, Main.star[index].rotation, new Vector2((float) Main.starTexture[Main.star[index].type].Width * 0.5f, (float) Main.starTexture[Main.star[index].type].Height * 0.5f), Main.star[index].scale * Main.star[index].twinkle, SpriteEffects.None, 0.0f); + } + } if ((double) Main.screenPosition.Y / 16.0 < Main.worldSurface + 2.0) - this.DrawSunAndMoon(sceneArea, moonColor, sunColor, tempMushroomInfluence); + { + if (Main.dayTime) + { + scale1 *= 1.1f; + if (Main.eclipse) + { + float num92 = 1f - Main.shroomLight - Main.cloudAlpha * 1.5f; + if ((double) num92 < 0.0) + num92 = 0.0f; + Microsoft.Xna.Framework.Color color1 = new Microsoft.Xna.Framework.Color((int) (byte) ((double) byte.MaxValue * (double) num92), (int) (byte) ((double) white1.G * (double) num92), (int) (byte) ((double) white1.B * (double) num92), (int) (byte) ((double) byte.MaxValue * (double) num92)); + Microsoft.Xna.Framework.Color color2 = new Microsoft.Xna.Framework.Color((int) (byte) ((double) white1.R * (double) num92), (int) (byte) ((double) white1.G * (double) num92), (int) (byte) ((double) white1.B * (double) num92), (int) (byte) ((double) ((int) white1.B - 60) * (double) num92)); + Main.spriteBatch.Draw(Main.sun3Texture, new Vector2((float) num21, (float) (num22 + (int) Main.sunModY)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.sun3Texture.Width, Main.sun3Texture.Height)), color1, rotation1, new Vector2((float) (Main.sun3Texture.Width / 2), (float) (Main.sun3Texture.Height / 2)), scale1, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.sun3Texture, new Vector2((float) num21, (float) (num22 + (int) Main.sunModY)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.sun3Texture.Width, Main.sun3Texture.Height)), color2, rotation1, new Vector2((float) (Main.sun3Texture.Width / 2), (float) (Main.sun3Texture.Height / 2)), scale1, SpriteEffects.None, 0.0f); + } + else if (!Main.gameMenu && Main.player[Main.myPlayer].head == 12) + { + float num93 = 1f - Main.shroomLight - Main.cloudAlpha * 1.5f; + if ((double) num93 < 0.0) + num93 = 0.0f; + Microsoft.Xna.Framework.Color color3 = new Microsoft.Xna.Framework.Color((int) (byte) ((double) byte.MaxValue * (double) num93), (int) (byte) ((double) white1.G * (double) num93), (int) (byte) ((double) white1.B * (double) num93), (int) (byte) ((double) byte.MaxValue * (double) num93)); + Microsoft.Xna.Framework.Color color4 = new Microsoft.Xna.Framework.Color((int) (byte) ((double) white1.R * (double) num93), (int) (byte) ((double) white1.G * (double) num93), (int) (byte) ((double) white1.B * (double) num93), (int) (byte) ((double) ((int) white1.B - 60) * (double) num93)); + Main.spriteBatch.Draw(Main.sun2Texture, new Vector2((float) num21, (float) (num22 + (int) Main.sunModY)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.sun2Texture.Width, Main.sun2Texture.Height)), color3, rotation1, new Vector2((float) (Main.sun2Texture.Width / 2), (float) (Main.sun2Texture.Height / 2)), scale1, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.sun2Texture, new Vector2((float) num21, (float) (num22 + (int) Main.sunModY)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.sun2Texture.Width, Main.sun2Texture.Height)), color4, rotation1, new Vector2((float) (Main.sun2Texture.Width / 2), (float) (Main.sun2Texture.Height / 2)), scale1, SpriteEffects.None, 0.0f); + } + else + { + float num94 = 1f - Main.shroomLight - Main.cloudAlpha * 1.5f; + if ((double) num94 < 0.0) + num94 = 0.0f; + Microsoft.Xna.Framework.Color color5 = new Microsoft.Xna.Framework.Color((int) (byte) ((double) byte.MaxValue * (double) num94), (int) (byte) ((double) white1.G * (double) num94), (int) (byte) ((double) white1.B * (double) num94), (int) (byte) ((double) byte.MaxValue * (double) num94)); + Microsoft.Xna.Framework.Color color6 = new Microsoft.Xna.Framework.Color((int) (byte) ((double) white1.R * (double) num94), (int) (byte) ((double) white1.G * (double) num94), (int) (byte) ((double) white1.B * (double) num94), (int) (byte) ((double) white1.B * (double) num94)); + Main.spriteBatch.Draw(Main.sunTexture, new Vector2((float) num21, (float) (num22 + (int) Main.sunModY)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.sunTexture.Width, Main.sunTexture.Height)), color5, rotation1, new Vector2((float) (Main.sunTexture.Width / 2), (float) (Main.sunTexture.Height / 2)), scale1, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(Main.sunTexture, new Vector2((float) num21, (float) (num22 + (int) Main.sunModY)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.sunTexture.Width, Main.sunTexture.Height)), color6, rotation1, new Vector2((float) (Main.sunTexture.Width / 2), (float) (Main.sunTexture.Height / 2)), scale1, SpriteEffects.None, 0.0f); + } + } + if (!Main.dayTime) + { + float num95 = (float) (1.0 - (double) Main.cloudAlpha * 1.5); + if ((double) num95 < 0.0) + num95 = 0.0f; + white2.R = (byte) ((double) white2.R * (double) num95); + white2.G = (byte) ((double) white2.G * (double) num95); + white2.B = (byte) ((double) white2.B * (double) num95); + white2.A = (byte) ((double) white2.A * (double) num95); + if (Main.pumpkinMoon) + Main.spriteBatch.Draw(Main.pumpkinMoonTexture, new Vector2((float) num23, (float) (num24 + (int) Main.moonModY)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, Main.pumpkinMoonTexture.Width * Main.moonPhase, Main.pumpkinMoonTexture.Width, Main.pumpkinMoonTexture.Width)), white2, rotation2, new Vector2((float) (Main.pumpkinMoonTexture.Width / 2), (float) (Main.pumpkinMoonTexture.Width / 2)), scale2, SpriteEffects.None, 0.0f); + else if (Main.snowMoon) + Main.spriteBatch.Draw(Main.snowMoonTexture, new Vector2((float) num23, (float) (num24 + (int) Main.moonModY)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, Main.snowMoonTexture.Width * Main.moonPhase, Main.snowMoonTexture.Width, Main.snowMoonTexture.Width)), white2, rotation2, new Vector2((float) (Main.snowMoonTexture.Width / 2), (float) (Main.snowMoonTexture.Width / 2)), scale2, SpriteEffects.None, 0.0f); + else + Main.spriteBatch.Draw(Main.moonTexture[Main.moonType], new Vector2((float) num23, (float) (num24 + (int) Main.moonModY)), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, Main.moonTexture[Main.moonType].Width * Main.moonPhase, Main.moonTexture[Main.moonType].Width, Main.moonTexture[Main.moonType].Width)), white2, rotation2, new Vector2((float) (Main.moonTexture[Main.moonType].Width / 2), (float) (Main.moonTexture[Main.moonType].Width / 2)), scale2, SpriteEffects.None, 0.0f); + } + } + Microsoft.Xna.Framework.Rectangle rectangle1 = !Main.dayTime ? new Microsoft.Xna.Framework.Rectangle((int) ((double) num23 - (double) Main.moonTexture[Main.moonType].Width * 0.5 * (double) scale2), (int) ((double) num24 - (double) Main.moonTexture[Main.moonType].Width * 0.5 * (double) scale2 + (double) Main.moonModY), (int) ((double) Main.moonTexture[Main.moonType].Width * (double) scale2), (int) ((double) Main.moonTexture[Main.moonType].Width * (double) scale2)) : new Microsoft.Xna.Framework.Rectangle((int) ((double) num21 - (double) Main.sunTexture.Width * 0.5 * (double) scale1), (int) ((double) num22 - (double) Main.sunTexture.Height * 0.5 * (double) scale1 + (double) Main.sunModY), (int) ((double) Main.sunTexture.Width * (double) scale1), (int) ((double) Main.sunTexture.Width * (double) scale1)); + Microsoft.Xna.Framework.Rectangle rectangle2 = new Microsoft.Xna.Framework.Rectangle(Main.mouseX, Main.mouseY, 1, 1); + Main.sunModY = (short) ((double) Main.sunModY * 0.999); + Main.moonModY = (short) ((double) Main.moonModY * 0.999); + if (Main.gameMenu && Main.netMode != 1) + { + if (Main.mouseLeft && Main.hasFocus) + { + if (rectangle2.Intersects(rectangle1) || Main.grabSky) + { + if (Main.dayTime) + { + Main.time = 54000.0 * ((double) (Main.mouseX + Main.sunTexture.Width) / ((double) Main.screenWidth + (double) (Main.sunTexture.Width * 2))); + Main.sunModY = (short) (Main.mouseY - num22); + if (Main.time > 53990.0) + Main.time = 53990.0; + } + else + { + Main.time = 32400.0 * ((double) (Main.mouseX + Main.moonTexture[Main.moonType].Width) / ((double) Main.screenWidth + (double) (Main.moonTexture[Main.moonType].Width * 2))); + Main.moonModY = (short) (Main.mouseY - num24); + if (Main.time > 32390.0) + Main.time = 32390.0; + } + if (Main.time < 10.0) + Main.time = 10.0; + if (Main.netMode != 0) + NetMessage.SendData(18); + Main.grabSky = true; + } + } + else + Main.grabSky = false; + } TimeLogger.DetailedDrawTime(7); } Overlays.Scene.Draw(Main.spriteBatch, RenderLayers.Sky); Main.spriteBatch.End(); - Vector2 screenPosition = Main.screenPosition; - int screenWidth = Main.screenWidth; - int screenHeight = Main.screenHeight; - Main.screenWidth = (int) ((double) Main.screenWidth / (double) Main.BackgroundViewMatrix.Zoom.X); - Main.screenHeight = (int) ((double) Main.screenHeight / (double) Main.BackgroundViewMatrix.Zoom.Y); - Main.screenPosition += Main.BackgroundViewMatrix.Translation; - Matrix transformationMatrix = Main.BackgroundViewMatrix.TransformationMatrix; - transformationMatrix.Translation -= Main.BackgroundViewMatrix.ZoomMatrix.Translation * new Vector3(1f, Main.BackgroundViewMatrix.Effects.HasFlag((Enum) SpriteEffects.FlipVertically) ? -1f : 1f, 1f); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, Main.Rasterizer, (Effect) null, transformationMatrix); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, this.Rasterizer, (Effect) null, Main.BackgroundViewMatrix.TransformationMatrix); this.DrawBG(); - Main.screenWidth = screenWidth; - Main.screenHeight = screenHeight; - Main.screenPosition = screenPosition; Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.GameViewMatrix.TransformationMatrix); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, this.Rasterizer, (Effect) null, Main.GameViewMatrix.TransformationMatrix); this.DrawBackgroundBlackFill(); Main.spriteBatch.End(); Overlays.Scene.Draw(Main.spriteBatch, RenderLayers.Landscape); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.UIScaleMatrix); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, this.Rasterizer, (Effect) null, Main.UIScaleMatrix); if (Main.gameMenu || Main.netMode == 2) { - Main.spriteBatch.End(); - Microsoft.Xna.Framework.Point screenSizeCache; - Microsoft.Xna.Framework.Point screenSizeCacheAfterScaling; - this.PreDrawMenu(out screenSizeCache, out screenSizeCacheAfterScaling); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.UIScaleMatrix); + bool isActive = this.IsActive; + Microsoft.Xna.Framework.Rectangle[] rectangleArray = new Microsoft.Xna.Framework.Rectangle[6]; + for (int index = 0; index < rectangleArray.Length; ++index) + rectangleArray[index] = new Microsoft.Xna.Framework.Rectangle(index * 4, 0, 2, 40); + Microsoft.Xna.Framework.Color color = Main.bgColor * 0.85f; + for (int index = 0; index < Main.maxRain; ++index) + { + if (Main.rain[index].active) + { + Rain rain = Main.rain[index]; + Main.spriteBatch.Draw(Main.rainTexture, rain.position - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(rectangleArray[(int) rain.type]), color, rain.rotation, Vector2.Zero, rain.scale, SpriteEffects.None, 0.0f); + if (isActive) + rain.Update(); + } + } this.DrawMenu(gameTime); - Main.PostDrawMenu(screenSizeCache, screenSizeCacheAfterScaling); TimeLogger.MenuDrawTime(stopwatch1.Elapsed.TotalMilliseconds); TimeLogger.EndDrawFrame(); } else { Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.Transform); - this.DoLightTiles(); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, this.Rasterizer, (Effect) null, Main.Transform); + this.firstTileX = (int) Math.Floor((double) Main.screenPosition.X / 16.0) - 1; + this.lastTileX = (int) Math.Floor(((double) Main.screenPosition.X + (double) Main.screenWidth) / 16.0) + 2; + this.firstTileY = (int) Math.Floor((double) Main.screenPosition.Y / 16.0) - 1; + this.lastTileY = (int) Math.Floor(((double) Main.screenPosition.Y + (double) Main.screenHeight) / 16.0) + 2; + if (!Main.drawSkip) + Lighting.LightTiles(this.firstTileX, this.lastTileX, this.firstTileY, this.lastTileY); TimeLogger.DetailedDrawReset(); if (Main.mapFullscreen) { if (Main.player[Main.myPlayer].talkNPC >= 0 || Main.player[Main.myPlayer].sign >= 0 || Main.playerInventory && !CaptureManager.Instance.Active) Main.player[Main.myPlayer].ToggleInv(); - this.DrawMap(gameTime); + this.DrawMap(); Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.SamplerStateForCursor, (DepthStencilState) null, (RasterizerState) null, (Effect) null, Main.UIScaleMatrix); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, (DepthStencilState) null, (RasterizerState) null, (Effect) null, Main.UIScaleMatrix); PlayerInput.SetZoom_UI(); this.DrawFPS(); this.DrawPlayerChat(); - Main.DrawPendingMouseText(); - Main.DrawCursor(Main.DrawThickCursor()); PlayerInput.SetZoom_Unscaled(); Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, (DepthStencilState) null, (RasterizerState) null, (Effect) null); @@ -46245,10 +46966,10 @@ label_623: else { Overlays.Scene.Draw(Main.spriteBatch, RenderLayers.InWorldUI); - Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; + Microsoft.Xna.Framework.Color white3 = Microsoft.Xna.Framework.Color.White; if (Main.drawToScreen) { - this.DrawWaters(true); + this.drawWaters(true); } else { @@ -46269,6 +46990,7 @@ label_623: TimeLogger.DetailedDrawTime(12); } Overlays.Scene.Draw(Main.spriteBatch, RenderLayers.Background); + Sandstorm.DrawGrains(Main.spriteBatch); ScreenDarkness.DrawBack(Main.spriteBatch); ++Main.magmaBGFrameCounter; if (Main.magmaBGFrameCounter >= 8) @@ -46278,44 +47000,150 @@ label_623: if (Main.magmaBGFrame >= 3) Main.magmaBGFrame = 0; } - this.DoDraw_WallsTilesNPCs(); - Overlays.Scene.Draw(Main.spriteBatch, RenderLayers.TilesAndNPCs); - if (!Main.mapFullscreen) + try { - if (Main.mapStyle == 2) + this.CacheNPCDraws(); + this.CacheProjDraws(); + this.DrawCachedNPCs(this.DrawCacheNPCsMoonMoon, true); + if (Main.drawToScreen) + { + this.DrawBlack(); + Main.tileBatch.Begin(); + this.DrawWalls(); + Main.tileBatch.End(); + } + else + { + Main.spriteBatch.Draw((Texture2D) this.blackTarget, Main.sceneTilePos - Main.screenPosition, Microsoft.Xna.Framework.Color.White); + TimeLogger.DetailedDrawTime(13); + Main.spriteBatch.Draw((Texture2D) this.wallTarget, Main.sceneWallPos - Main.screenPosition, Microsoft.Xna.Framework.Color.White); + TimeLogger.DetailedDrawTime(14); + } + Overlays.Scene.Draw(Main.spriteBatch, RenderLayers.Walls); + this.DrawWoF(); + if (Main.drawBackGore) + { + Main.drawBackGore = false; + if (Main.ignoreErrors) + { + try + { + this.DrawGoreBehind(); + } + catch (Exception ex) + { + TimeLogger.DrawException(ex); + } + } + else + this.DrawGoreBehind(); + } + MoonlordDeathDrama.DrawPieces(Main.spriteBatch); + MoonlordDeathDrama.DrawExplosions(Main.spriteBatch); + this.DrawCachedNPCs(this.DrawCacheNPCsBehindNonSolidTiles, true); + if (Main.player[Main.myPlayer].detectCreature) + { + if (Main.drawToScreen) + { + this.DrawTiles(false); + TimeLogger.DetailedDrawReset(); + this.waterfallManager.Draw(Main.spriteBatch); + TimeLogger.DetailedDrawTime(16); + this.DrawTiles(); + } + else + { + Main.spriteBatch.Draw((Texture2D) this.tile2Target, Main.sceneTile2Pos - Main.screenPosition, Microsoft.Xna.Framework.Color.White); + TimeLogger.DetailedDrawTime(15); + this.waterfallManager.Draw(Main.spriteBatch); + TimeLogger.DetailedDrawTime(16); + Main.spriteBatch.Draw((Texture2D) this.tileTarget, Main.sceneTilePos - Main.screenPosition, Microsoft.Xna.Framework.Color.White); + TimeLogger.DetailedDrawTime(17); + } + TimeLogger.DetailedDrawReset(); + Main.spriteBatch.End(); + this.DrawCachedProjs(this.DrawCacheProjsBehindNPCsAndTiles); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, this.Rasterizer, (Effect) null, Main.Transform); + this.DrawNPCs(true); + TimeLogger.DetailedDrawTime(18); + Main.spriteBatch.End(); + this.DrawCachedProjs(this.DrawCacheProjsBehindNPCs); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, this.Rasterizer, (Effect) null, Main.Transform); + Main.player[Main.myPlayer].hitTile.DrawFreshAnimations(Main.spriteBatch); + this.DrawNPCs(); + this.DrawCachedNPCs(this.DrawCacheNPCProjectiles, false); + TimeLogger.DetailedDrawTime(19); + } + else + { + if (Main.drawToScreen) + { + this.DrawCachedNPCs(this.DrawCacheNPCsBehindNonSolidTiles, true); + this.DrawTiles(false); + TimeLogger.DetailedDrawReset(); + this.waterfallManager.Draw(Main.spriteBatch); + TimeLogger.DetailedDrawTime(16); + Main.spriteBatch.End(); + this.DrawCachedProjs(this.DrawCacheProjsBehindNPCsAndTiles); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, this.Rasterizer, (Effect) null, Main.Transform); + this.DrawNPCs(true); + TimeLogger.DetailedDrawTime(18); + this.DrawTiles(); + } + else + { + this.DrawCachedNPCs(this.DrawCacheNPCsBehindNonSolidTiles, true); + Main.spriteBatch.Draw((Texture2D) this.tile2Target, Main.sceneTile2Pos - Main.screenPosition, Microsoft.Xna.Framework.Color.White); + TimeLogger.DetailedDrawTime(15); + this.waterfallManager.Draw(Main.spriteBatch); + TimeLogger.DetailedDrawTime(16); + Main.spriteBatch.End(); + this.DrawCachedProjs(this.DrawCacheProjsBehindNPCsAndTiles); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, this.Rasterizer, (Effect) null, Main.Transform); + this.DrawNPCs(true); + TimeLogger.DetailedDrawTime(18); + Main.spriteBatch.Draw((Texture2D) this.tileTarget, Main.sceneTilePos - Main.screenPosition, Microsoft.Xna.Framework.Color.White); + TimeLogger.DetailedDrawTime(17); + } + Main.player[Main.myPlayer].hitTile.DrawFreshAnimations(Main.spriteBatch); + Main.spriteBatch.End(); + this.DrawCachedProjs(this.DrawCacheProjsBehindNPCs); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, this.Rasterizer, (Effect) null, Main.Transform); + TimeLogger.DetailedDrawReset(); + this.DrawNPCs(); + this.DrawCachedNPCs(this.DrawCacheNPCProjectiles, false); + TimeLogger.DetailedDrawTime(19); + } + } + catch (Exception ex) + { + TimeLogger.DrawException(ex); + } + Overlays.Scene.Draw(Main.spriteBatch, RenderLayers.TilesAndNPCs); + if (!Main.mapFullscreen && Main.mapStyle == 2) + { + if (Main.ignoreErrors) { try { - this.DrawMap(gameTime); + this.DrawMap(); } catch (Exception ex) { - if (Main.ignoreErrors) - TimeLogger.DrawException(ex); - else - throw; + TimeLogger.DrawException(ex); } } + else + this.DrawMap(); } TimeLogger.DetailedDrawReset(); Main.spriteBatch.End(); TimeLogger.DetailedDrawTime(35); - Main.HasInteractibleObjectThatIsNotATile = false; this.SortDrawCacheWorms(); - this.DrawSuperSpecialProjectiles(this.DrawCacheFirstFractals); this.DrawCachedProjs(this.DrawCacheProjsBehindProjectiles); this.DrawProjectiles(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.Transform); - Main.ParticleSystem_World_BehindPlayers.Settings.AnchorPosition = -Main.screenPosition; - Main.ParticleSystem_World_BehindPlayers.Draw(Main.spriteBatch); - Main.spriteBatch.End(); - this.DrawPlayers_AfterProjectiles(); - this.DrawCachedProjs(this.DrawCacheProjsOverPlayers); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.Transform); - Main.ParticleSystem_World_OverPlayers.Settings.AnchorPosition = -Main.screenPosition; - Main.ParticleSystem_World_OverPlayers.Draw(Main.spriteBatch); - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.Transform); + this.DrawPlayers(); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, this.Rasterizer, (Effect) null, Main.Transform); this.DrawCachedNPCs(this.DrawCacheNPCsOverPlayers, false); if (!Main.gamePaused) { @@ -46349,11 +47177,11 @@ label_623: this.DrawGore(); Main.spriteBatch.End(); this.DrawDust(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.Transform); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, this.Rasterizer, (Effect) null, Main.Transform); Overlays.Scene.Draw(Main.spriteBatch, RenderLayers.Entities); if (Main.drawToScreen) { - this.DrawWaters(); + this.drawWaters(); if (WiresUI.Settings.DrawWires) this.DrawWires(); } @@ -46374,15 +47202,31 @@ label_623: Main.spriteBatch.End(); Overlays.Scene.Draw(Main.spriteBatch, RenderLayers.All); if (flag) - Terraria.Graphics.Effects.Filters.Scene.EndCapture((RenderTarget2D) null, Main.screenTarget, Main.screenTargetSwap, Microsoft.Xna.Framework.Color.Black); + Filters.Scene.EndCapture(); TimeLogger.DetailedDrawTime(36); if (!Main.hideUI) { - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, (DepthStencilState) null, (RasterizerState) null, (Effect) null, Main.UIScaleMatrix); - TimeLogger.DetailedDrawReset(); - this.DrawPlayerChatBubbles(); - Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, (DepthStencilState) null, (RasterizerState) null, (Effect) null, Main.GameViewMatrix.ZoomMatrix); + TimeLogger.DetailedDrawReset(); + for (int index = 0; index < (int) byte.MaxValue; ++index) + { + if (Main.player[index].active && Main.player[index].chatOverhead.timeLeft > 0 && !Main.player[index].dead) + { + Vector2 messageSize = Main.player[index].chatOverhead.messageSize; + Vector2 vec; + vec.X = (float) ((double) Main.player[index].position.X + (double) (Main.player[index].width / 2) - (double) messageSize.X / 2.0); + vec.Y = (float) ((double) Main.player[index].position.Y - (double) messageSize.Y - 2.0); + vec.Y += Main.player[index].gfxOffY; + vec = vec.Floor(); + if ((double) Main.player[Main.myPlayer].gravDir == -1.0) + { + vec.Y -= Main.screenPosition.Y; + vec.Y = Main.screenPosition.Y + (float) Main.screenHeight - vec.Y; + } + int hoveredSnippet = 0; + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, Main.fontMouseText, Main.player[index].chatOverhead.snippets, vec - Main.screenPosition, 0.0f, Vector2.Zero, Vector2.One, out hoveredSnippet); + } + } float targetScale = CombatText.TargetScale; for (int index1 = 0; index1 < 100; ++index1) { @@ -46391,151 +47235,109 @@ label_623: int index2 = 0; if (Main.combatText[index1].crit) index2 = 1; - Vector2 vector2_1 = FontAssets.CombatText[index2].Value.MeasureString(Main.combatText[index1].text); - Vector2 vector2_2 = new Vector2(vector2_1.X * 0.5f, vector2_1.Y * 0.5f); - float num5 = Main.combatText[index1].scale / targetScale; + Vector2 vector2_3 = Main.fontCombatText[index2].MeasureString(Main.combatText[index1].text); + Vector2 vector2_4 = new Vector2(vector2_3.X * 0.5f, vector2_3.Y * 0.5f); + float num96 = Main.combatText[index1].scale / targetScale; float r = (float) Main.combatText[index1].color.R; float g = (float) Main.combatText[index1].color.G; float b = (float) Main.combatText[index1].color.B; float a = (float) Main.combatText[index1].color.A; - float num6 = r * (float) ((double) num5 * (double) Main.combatText[index1].alpha * 0.300000011920929); - float num7 = b * (float) ((double) num5 * (double) Main.combatText[index1].alpha * 0.300000011920929); - float num8 = g * (float) ((double) num5 * (double) Main.combatText[index1].alpha * 0.300000011920929); - float num9 = a * (num5 * Main.combatText[index1].alpha); - Microsoft.Xna.Framework.Color color = new Microsoft.Xna.Framework.Color((int) num6, (int) num8, (int) num7, (int) num9); + float num97 = r * (float) ((double) num96 * (double) Main.combatText[index1].alpha * 0.300000011920929); + float num98 = b * (float) ((double) num96 * (double) Main.combatText[index1].alpha * 0.300000011920929); + float num99 = g * (float) ((double) num96 * (double) Main.combatText[index1].alpha * 0.300000011920929); + float num100 = a * (num96 * Main.combatText[index1].alpha); + Microsoft.Xna.Framework.Color color = new Microsoft.Xna.Framework.Color((int) num97, (int) num99, (int) num98, (int) num100); for (int index3 = 0; index3 < 5; ++index3) { - float num10 = 0.0f; - float num11 = 0.0f; + float num101 = 0.0f; + float num102 = 0.0f; if (index3 == 0) - num10 -= targetScale; + num101 -= targetScale; else if (index3 == 1) - num10 += targetScale; + num101 += targetScale; else if (index3 == 2) - num11 -= targetScale; + num102 -= targetScale; else if (index3 == 3) { - num11 += targetScale; + num102 += targetScale; } else { - float num12 = (float) Main.combatText[index1].color.R * num5 * Main.combatText[index1].alpha; - float num13 = (float) Main.combatText[index1].color.B * num5 * Main.combatText[index1].alpha; - float num14 = (float) Main.combatText[index1].color.G * num5 * Main.combatText[index1].alpha; - float num15 = (float) Main.combatText[index1].color.A * num5 * Main.combatText[index1].alpha; - color = new Microsoft.Xna.Framework.Color((int) num12, (int) num14, (int) num13, (int) num15); + float num103 = (float) Main.combatText[index1].color.R * num96 * Main.combatText[index1].alpha; + float num104 = (float) Main.combatText[index1].color.B * num96 * Main.combatText[index1].alpha; + float num105 = (float) Main.combatText[index1].color.G * num96 * Main.combatText[index1].alpha; + float num106 = (float) Main.combatText[index1].color.A * num96 * Main.combatText[index1].alpha; + color = new Microsoft.Xna.Framework.Color((int) num103, (int) num105, (int) num104, (int) num106); } if ((double) Main.player[Main.myPlayer].gravDir == -1.0) { - float num16 = Main.combatText[index1].position.Y - Main.screenPosition.Y; - float num17 = (float) Main.screenHeight - num16; - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.CombatText[index2].Value, Main.combatText[index1].text, new Vector2(Main.combatText[index1].position.X - Main.screenPosition.X + num10 + vector2_2.X, num17 + num11 + vector2_2.Y), color, Main.combatText[index1].rotation, vector2_2, Main.combatText[index1].scale, SpriteEffects.None, 0.0f); + float num107 = Main.combatText[index1].position.Y - Main.screenPosition.Y; + float num108 = (float) Main.screenHeight - num107; + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontCombatText[index2], Main.combatText[index1].text, new Vector2(Main.combatText[index1].position.X - Main.screenPosition.X + num101 + vector2_4.X, num108 + num102 + vector2_4.Y), color, Main.combatText[index1].rotation, vector2_4, Main.combatText[index1].scale, SpriteEffects.None, 0.0f); } else - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.CombatText[index2].Value, Main.combatText[index1].text, new Vector2(Main.combatText[index1].position.X - Main.screenPosition.X + num10 + vector2_2.X, Main.combatText[index1].position.Y - Main.screenPosition.Y + num11 + vector2_2.Y), color, Main.combatText[index1].rotation, vector2_2, Main.combatText[index1].scale, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontCombatText[index2], Main.combatText[index1].text, new Vector2(Main.combatText[index1].position.X - Main.screenPosition.X + num101 + vector2_4.X, Main.combatText[index1].position.Y - Main.screenPosition.Y + num102 + vector2_4.Y), color, Main.combatText[index1].rotation, vector2_4, Main.combatText[index1].scale, SpriteEffects.None, 0.0f); } } } - float num18 = PopupText.TargetScale; - if ((double) num18 == 0.0) - num18 = 1f; + float num109 = ItemText.TargetScale; + if ((double) num109 == 0.0) + num109 = 1f; for (int index4 = 0; index4 < 20; ++index4) { - if (Main.popupText[index4].active) + if (Main.itemText[index4].active) { - string str = Main.popupText[index4].name; - if (Main.popupText[index4].stack > 1) - str = str + " (" + (object) Main.popupText[index4].stack + ")"; - Vector2 vector2_3 = FontAssets.MouseText.Value.MeasureString(str); - Vector2 vector2_4 = new Vector2(vector2_3.X * 0.5f, vector2_3.Y * 0.5f); - float num19 = Main.popupText[index4].scale / num18; - int num20 = (int) ((double) byte.MaxValue - (double) byte.MaxValue * (double) num19); - float r = (float) Main.popupText[index4].color.R; - float g = (float) Main.popupText[index4].color.G; - float b = (float) Main.popupText[index4].color.B; - float a = (float) Main.popupText[index4].color.A; - float num21 = r * (float) ((double) num19 * (double) Main.popupText[index4].alpha * 0.300000011920929); - float num22 = b * (float) ((double) num19 * (double) Main.popupText[index4].alpha * 0.300000011920929); - float num23 = g * (float) ((double) num19 * (double) Main.popupText[index4].alpha * 0.300000011920929); - float t = a * (num19 * Main.popupText[index4].alpha); - Microsoft.Xna.Framework.Color color1 = new Microsoft.Xna.Framework.Color((int) num21, (int) num23, (int) num22, (int) t); - Microsoft.Xna.Framework.Color color2 = Microsoft.Xna.Framework.Color.Black; - float num24 = 1f; - Texture2D texture2D = (Texture2D) null; - switch (Main.popupText[index4].context) - { - case PopupTextContext.ItemPickupToVoidContainer: - color2 = new Microsoft.Xna.Framework.Color((int) sbyte.MaxValue, 20, (int) byte.MaxValue) * 0.4f; - num24 = 0.8f; - break; - case PopupTextContext.SonarAlert: - color2 = Microsoft.Xna.Framework.Color.Blue * 0.4f; - if (Main.popupText[index4].npcNetID != 0) - color2 = Microsoft.Xna.Framework.Color.Red * 0.4f; - num24 = 1f; - break; - } - float num25 = (float) num20 / (float) byte.MaxValue; + string str = Main.itemText[index4].name; + if (Main.itemText[index4].stack > 1) + str = str + " (" + (object) Main.itemText[index4].stack + ")"; + Vector2 vector2_5 = Main.fontMouseText.MeasureString(str); + Vector2 vector2_6 = new Vector2(vector2_5.X * 0.5f, vector2_5.Y * 0.5f); + float num110 = Main.itemText[index4].scale / num109; + float r = (float) Main.itemText[index4].color.R; + float g = (float) Main.itemText[index4].color.G; + float b = (float) Main.itemText[index4].color.B; + float a = (float) Main.itemText[index4].color.A; + float num111 = r * (float) ((double) num110 * (double) Main.itemText[index4].alpha * 0.300000011920929); + float num112 = b * (float) ((double) num110 * (double) Main.itemText[index4].alpha * 0.300000011920929); + float num113 = g * (float) ((double) num110 * (double) Main.itemText[index4].alpha * 0.300000011920929); + float num114 = a * (num110 * Main.itemText[index4].alpha); + Microsoft.Xna.Framework.Color color = new Microsoft.Xna.Framework.Color((int) num111, (int) num113, (int) num112, (int) num114); for (int index5 = 0; index5 < 5; ++index5) { - color1 = color2; - float num26 = 0.0f; - float num27 = 0.0f; + float num115 = 0.0f; + float num116 = 0.0f; if (index5 == 0) - num26 -= num18 * 2f; + num115 -= num109 * 2f; else if (index5 == 1) - num26 += num18 * 2f; + num115 += num109 * 2f; else if (index5 == 2) - num27 -= num18 * 2f; + num116 -= num109 * 2f; else if (index5 == 3) - num27 += num18 * 2f; + { + num116 += num109 * 2f; + } else - color1 = Main.popupText[index4].color * num19 * Main.popupText[index4].alpha * num24; + { + float num117 = (float) Main.itemText[index4].color.R * num110 * Main.itemText[index4].alpha; + float num118 = (float) Main.itemText[index4].color.B * num110 * Main.itemText[index4].alpha; + float num119 = (float) Main.itemText[index4].color.G * num110 * Main.itemText[index4].alpha; + float num120 = (float) Main.itemText[index4].color.A * num110 * Main.itemText[index4].alpha; + color = new Microsoft.Xna.Framework.Color((int) num117, (int) num119, (int) num118, (int) num120); + } if (index5 < 4) - { - t = (float) Main.popupText[index4].color.A * num19 * Main.popupText[index4].alpha; - color1 = new Microsoft.Xna.Framework.Color(0, 0, 0, (int) t); - } - if (color2 != Microsoft.Xna.Framework.Color.Black && index5 < 4) - { - num26 *= (float) (1.29999995231628 + 1.29999995231628 * (double) num25); - num27 *= (float) (1.29999995231628 + 1.29999995231628 * (double) num25); - } - float num28 = Main.popupText[index4].position.Y - Main.screenPosition.Y + num27; + color = new Microsoft.Xna.Framework.Color(0, 0, 0, (int) ((float) Main.itemText[index4].color.A * num110 * Main.itemText[index4].alpha)); + float num121 = Main.itemText[index4].position.Y - Main.screenPosition.Y + num116; if ((double) Main.player[Main.myPlayer].gravDir == -1.0) - num28 = (float) Main.screenHeight - num28; - if (color2 != Microsoft.Xna.Framework.Color.Black && index5 < 4) - { - Microsoft.Xna.Framework.Color color3 = color2; - color3.A = (byte) MathHelper.Lerp(60f, (float) sbyte.MaxValue, Utils.GetLerpValue(0.0f, (float) byte.MaxValue, t, true)); - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, str, new Vector2(Main.popupText[index4].position.X - Main.screenPosition.X + num26 + vector2_4.X, num28 + vector2_4.Y), Microsoft.Xna.Framework.Color.Lerp(color1, color3, 0.5f), Main.popupText[index4].rotation, vector2_4, Main.popupText[index4].scale, SpriteEffects.None, 0.0f); - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, str, new Vector2(Main.popupText[index4].position.X - Main.screenPosition.X + num26 + vector2_4.X, num28 + vector2_4.Y), color3, Main.popupText[index4].rotation, vector2_4, Main.popupText[index4].scale, SpriteEffects.None, 0.0f); - } - else - DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, FontAssets.MouseText.Value, str, new Vector2(Main.popupText[index4].position.X - Main.screenPosition.X + num26 + vector2_4.X, num28 + vector2_4.Y), color1, Main.popupText[index4].rotation, vector2_4, Main.popupText[index4].scale, SpriteEffects.None, 0.0f); - if (texture2D != null) - { - float scale = (float) ((1.29999995231628 - (double) num25) * (double) Main.popupText[index4].scale * 0.699999988079071); - Vector2 vector2_5 = new Vector2(Main.popupText[index4].position.X - Main.screenPosition.X + num26 + vector2_4.X, num28 + vector2_4.Y); - Microsoft.Xna.Framework.Color color4 = color2 * 0.6f; - if (index5 == 4) - color4 = Microsoft.Xna.Framework.Color.White * 0.6f; - color4.A = (byte) ((double) color4.A * 0.5); - int num29 = 25; - Main.spriteBatch.Draw(texture2D, vector2_5 + new Vector2((float) ((double) vector2_4.X * -0.5 - (double) num29 - (double) texture2D.Size().X / 2.0), 0.0f), new Microsoft.Xna.Framework.Rectangle?(), color4 * Main.popupText[index4].scale, 0.0f, texture2D.Size() / 2f, scale, SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(texture2D, vector2_5 + new Vector2((float) ((double) vector2_4.X * 0.5 + (double) num29 + (double) texture2D.Size().X / 2.0), 0.0f), new Microsoft.Xna.Framework.Rectangle?(), color4 * Main.popupText[index4].scale, 0.0f, texture2D.Size() / 2f, scale, SpriteEffects.None, 0.0f); - } + num121 = (float) Main.screenHeight - num121; + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str, new Vector2(Main.itemText[index4].position.X - Main.screenPosition.X + num115 + vector2_6.X, num121 + vector2_6.Y), color, Main.itemText[index4].rotation, vector2_6, Main.itemText[index4].scale, SpriteEffects.None, 0.0f); } } } - PlayerInput.SetZoom_UI(); - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, (DepthStencilState) null, (RasterizerState) null, (Effect) null, Main.UIScaleMatrix); - Main.DrawNetplayStatusText(); - this.DrawFPS(); - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, (DepthStencilState) null, (RasterizerState) null, (Effect) null, Main.GameViewMatrix.ZoomMatrix); - PlayerInput.SetZoom_World(); + if (Main.netMode == 1 && Netplay.Connection.StatusText != "" && Netplay.Connection.StatusText != null) + { + string str = Netplay.Connection.StatusText + ": " + (object) (int) ((double) Netplay.Connection.StatusCount / (double) Netplay.Connection.StatusMax * 100.0) + "%"; + DynamicSpriteFontExtensionMethods.DrawString(Main.spriteBatch, Main.fontMouseText, str, new Vector2((float) (628.0 - (double) Main.fontMouseText.MeasureString(str).X * 0.5) + (float) (Main.screenWidth - 800), 84f), new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor), 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + } if (Main.BlackFadeIn > 0) { if (Main.BlackFadeIn < 0) @@ -46544,9 +47346,13 @@ label_623: if (a > (int) byte.MaxValue) a = (int) byte.MaxValue; Main.BlackFadeIn -= 25; - Main.spriteBatch.Draw(TextureAssets.SplashTexture16x9.Value, new Microsoft.Xna.Framework.Rectangle(0, 0, Main.screenWidth, Main.screenHeight), new Microsoft.Xna.Framework.Color(0, 0, 0, a)); + Main.spriteBatch.Draw(Main.loTexture, new Microsoft.Xna.Framework.Rectangle(0, 0, Main.screenWidth, Main.screenHeight), new Microsoft.Xna.Framework.Color(0, 0, 0, a)); } Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, (DepthStencilState) null, (RasterizerState) null, (Effect) null, Main.UIScaleMatrix); + PlayerInput.SetZoom_UI(); + this.DrawFPS(); + Main.spriteBatch.End(); if (!Main.mapFullscreen) { if (Main.ignoreErrors) @@ -46570,14 +47376,10 @@ label_623: TimeLogger.DetailedDrawTime(37); Main.mouseLeftRelease = !Main.mouseLeft; Main.mouseRightRelease = !Main.mouseRight; - if (!PlayerInput.Triggers.Current.MouseRight && !PlayerInput.Triggers.Current.MouseLeft && !Main.preventStackSplitReset) + if (!PlayerInput.Triggers.Current.MouseRight) Main.stackSplit = 0; if (Main.stackSplit > 0) - { --Main.stackSplit; - if (Main.stackSplit == 0) - Main.preventStackSplitReset = false; - } TimeLogger.RenderTime(Main.renderCount, stopwatch1.Elapsed.TotalMilliseconds); TimeLogger.EndDrawFrame(); } @@ -46585,1033 +47387,6 @@ label_623: } } - private static void DoDraw_UpdateCameraPosition() - { - Vector3 vector3 = Vector3.One / new Vector3(1f, 1f, 1f); - if ((Main.gameMenu ? 0 : (Main.netMode != 2 ? 1 : 0)) == 0) - return; - int num1 = 21; - if ((double) Main.cameraX != 0.0 && !Main.player[Main.myPlayer].pulley) - Main.cameraX = 0.0f; - if ((double) Main.cameraX > 0.0) - { - --Main.cameraX; - if ((double) Main.cameraX < 0.0) - Main.cameraX = 0.0f; - } - if ((double) Main.cameraX < 0.0) - { - ++Main.cameraX; - if ((double) Main.cameraX > 0.0) - Main.cameraX = 0.0f; - } - Vector2 screenPosition = Main.screenPosition; - Main.screenPosition.X = (float) ((double) Main.player[Main.myPlayer].position.X + (double) Main.player[Main.myPlayer].width * 0.5 - (double) Main.screenWidth * 0.5 * (double) vector3.X) + Main.cameraX; - Main.screenPosition.Y = (float) ((double) Main.player[Main.myPlayer].position.Y + (double) Main.player[Main.myPlayer].height - (double) num1 - (double) Main.screenHeight * 0.5 * (double) vector3.Y) + Main.player[Main.myPlayer].gfxOffY; - Vector2 vector2_1 = Vector2.Zero; - float num2 = 0.0f; - float num3 = 0.0f; - float max = 36f; - bool flag = false; - if ((Main.player[Main.myPlayer].noThrow <= 0 && !Main.player[Main.myPlayer].lastMouseInterface || !(Main.CurrentPan == Vector2.Zero)) && !Main.player[Main.myPlayer].dead) - { - if (Main.LocalGolfState != null && (Main.LocalGolfState.ShouldCameraTrackBallLastKnownLocation || Main.LocalGolfState.IsTrackingBall)) - { - if (Main.LocalGolfState.IsTrackingBall) - { - Projectile lastHitBall = Main.LocalGolfState.GetLastHitBall(); - Vector2 vector2_2 = lastHitBall.Center - Main.LocalPlayer.Center; - if ((double) lastHitBall.velocity.Length() > 20.0) - max *= 2f; - vector2_1 = Main.CurrentPan * 0.87f + vector2_2 * 0.13f; - flag = true; - } - else if (Main.LocalGolfState.ShouldCameraTrackBallLastKnownLocation) - { - Vector2? lastBallLocation = Main.LocalGolfState.GetLastBallLocation(); - if (lastBallLocation.HasValue) - { - Vector2 vector2_3 = lastBallLocation.Value - Main.LocalPlayer.Center; - vector2_1 = Main.CurrentPan * 0.87f + vector2_3 * 0.13f; - flag = true; - } - } - } - else if (PlayerInput.UsingGamepad) - { - Player player = Main.player[Main.myPlayer]; - if ((double) PlayerInput.GamepadThumbstickRight.Length() != 0.0 || !Main.SmartCursorEnabled) - { - float num4 = -1f; - if (player.inventory[player.selectedItem].type == 1254 && player.scope) - num4 = 0.8f; - else if (player.inventory[player.selectedItem].type == 1254) - num4 = 0.6666667f; - else if (player.inventory[player.selectedItem].type == 1299) - num4 = 0.6666667f; - else if (player.scope) - num4 = 0.5f; - Vector2 vector2_4 = (Main.MouseScreen - new Vector2((float) Main.screenWidth, (float) Main.screenHeight) / 2f) / (new Vector2((float) Main.screenWidth, (float) Main.screenHeight) / 2f); - max = 48f; - if (vector2_4 != Vector2.Zero && (double) num4 != -1.0) - { - Vector2 vector2_5 = new Vector2((float) Main.screenWidth, (float) Main.screenHeight) * 0.5f * vector2_4 * num4; - vector2_1.X = vector2_5.X; - vector2_1.Y = vector2_5.Y; - flag = true; - } - } - } - else if (Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type == 1254 && Main.player[Main.myPlayer].scope && Main.mouseRight) - { - int num5 = Main.mouseX; - int num6 = Main.mouseY; - if (num5 > Main.screenWidth) - num5 = Main.screenWidth; - if (num5 < 0) - num5 = 0; - if (num6 > Main.screenHeight) - num6 = Main.screenHeight; - if (num6 < 0) - num6 = 0; - vector2_1.X = (float) (num5 - Main.screenWidth / 2) / 1.25f; - vector2_1.Y = (float) (num6 - Main.screenHeight / 2) / 1.25f; - flag = true; - } - else if (Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type == 1254 && Main.mouseRight) - { - int num7 = Main.mouseX; - int num8 = Main.mouseY; - if (num7 > Main.screenWidth) - num7 = Main.screenWidth; - if (num7 < 0) - num7 = 0; - if (num8 > Main.screenHeight) - num8 = Main.screenHeight; - if (num8 < 0) - num8 = 0; - vector2_1.X = (float) (num7 - Main.screenWidth / 2) / 1.5f; - vector2_1.Y = (float) (num8 - Main.screenHeight / 2) / 1.5f; - flag = true; - } - else if (Main.player[Main.myPlayer].inventory[Main.player[Main.myPlayer].selectedItem].type == 1299 && Main.player[Main.myPlayer].selectedItem != 58) - { - int num9 = Main.mouseX; - int num10 = Main.mouseY; - if (num9 > Main.screenWidth) - num9 = Main.screenWidth; - if (num9 < 0) - num9 = 0; - if (num10 > Main.screenHeight) - num10 = Main.screenHeight; - if (num10 < 0) - num10 = 0; - vector2_1.X = (float) (num9 - Main.screenWidth / 2) / 1.5f; - vector2_1.Y = (float) (num10 - Main.screenHeight / 2) / 1.5f; - flag = true; - } - else if (Main.player[Main.myPlayer].scope && Main.mouseRight) - { - int num11 = Main.mouseX; - int num12 = Main.mouseY; - if (num11 > Main.screenWidth) - num11 = Main.screenWidth; - if (num11 < 0) - num11 = 0; - if (num12 > Main.screenHeight) - num12 = Main.screenHeight; - if (num12 < 0) - num12 = 0; - vector2_1.X = (float) (num11 - Main.screenWidth / 2) / 2f; - vector2_1.Y = (float) (num12 - Main.screenHeight / 2) / 2f; - flag = true; - } - } - if (float.IsNaN(Main.CurrentPan.X)) - Main.CurrentPan.X = 0.0f; - if (float.IsNaN(Main.CurrentPan.Y)) - Main.CurrentPan.Y = 0.0f; - Vector2 vector2_6 = vector2_1 - Main.CurrentPan; - float num13 = vector2_6.Length(); - float amount = 1f; - if ((double) num3 > (double) num2 + 9.99999974737875E-05) - amount = MathHelper.Clamp((float) (((double) num13 - (double) num2) / ((double) num3 - (double) num2)), 0.0f, 1f); - float num14 = MathHelper.Clamp(MathHelper.SmoothStep(0.0f, num13, amount), 0.0f, max); - if (vector2_1 == Vector2.Zero && !flag) - { - if ((double) Math.Abs(vector2_6.X) >= (double) (Main.screenWidth / 2) || (double) Math.Abs(vector2_6.Y) >= (double) (Main.screenHeight / 2)) - { - Main.renderNow = true; - Main.CurrentPan *= 0.9f; - } - else if ((double) num14 > 9.99999974737875E-05) - Main.CurrentPan += Vector2.Normalize(vector2_6) * num14; - } - else if ((double) num14 > 9.99999974737875E-05) - Main.CurrentPan += Vector2.Normalize(vector2_6) * num14; - Main.screenPosition.X += Main.CurrentPan.X; - Main.screenPosition.Y += Main.CurrentPan.Y * Main.player[Main.myPlayer].gravDir; - if ((double) Main.cameraLerp > 0.0) - { - if ((double) Vector2.Distance(screenPosition, Main.screenPosition) - (double) Main.player[Main.myPlayer].velocity.Length() < 0.25 || Main.cameraGamePadLerp && !PlayerInput.UsingGamepad) - { - Main.cameraLerp = 0.0f; - Main.cameraGamePadLerp = false; - } - else - Main.screenPosition = Vector2.Lerp(screenPosition, Main.screenPosition, Main.cameraLerp); - } - Main.screenPosition.X = (float) (int) Main.screenPosition.X; - Main.screenPosition.Y = (float) (int) Main.screenPosition.Y; - Main.ClampScreenPositionToWorld(); - } - - private void DrawSunAndMoon( - Main.SceneArea sceneArea, - Microsoft.Xna.Framework.Color moonColor, - Microsoft.Xna.Framework.Color sunColor, - float tempMushroomInfluence) - { - Texture2D texture2D1 = TextureAssets.Sun.Value; - int index = Main.moonType; - if (!TextureAssets.Moon.IndexInRange>(index)) - index = Utils.Clamp(index, 0, 8); - Texture2D texture2D2 = TextureAssets.Moon[index].Value; - int bgTopY = sceneArea.bgTopY; - int num1 = (int) (Main.time / 54000.0 * ((double) sceneArea.totalWidth + (double) (texture2D1.Width * 2))) - texture2D1.Width; - int num2 = 0; - float num3 = 1f; - float rotation1 = (float) (Main.time / 54000.0 * 2.0 - 7.30000019073486); - int num4 = (int) (Main.time / 32400.0 * ((double) sceneArea.totalWidth + (double) (texture2D2.Width * 2))) - texture2D2.Width; - int num5 = 0; - float num6 = 1f; - float rotation2 = (float) (Main.time / 32400.0 * 2.0 - 7.30000019073486); - if (Main.dayTime) - { - double num7; - if (Main.time < 27000.0) - { - num7 = Math.Pow(1.0 - Main.time / 54000.0 * 2.0, 2.0); - num2 = (int) ((double) bgTopY + num7 * 250.0 + 180.0); - } - else - { - num7 = Math.Pow((Main.time / 54000.0 - 0.5) * 2.0, 2.0); - num2 = (int) ((double) bgTopY + num7 * 250.0 + 180.0); - } - num3 = (float) (1.2 - num7 * 0.4); - } - else - { - double num8; - if (Main.time < 16200.0) - { - num8 = Math.Pow(1.0 - Main.time / 32400.0 * 2.0, 2.0); - num5 = (int) ((double) bgTopY + num8 * 250.0 + 180.0); - } - else - { - num8 = Math.Pow((Main.time / 32400.0 - 0.5) * 2.0, 2.0); - num5 = (int) ((double) bgTopY + num8 * 250.0 + 180.0); - } - num6 = (float) (1.2 - num8 * 0.4); - } - float scale1 = num3 * Main.ForcedMinimumZoom; - float scale2 = num6 * Main.ForcedMinimumZoom; - if (Main.dayTime) - { - scale1 *= 1.1f; - float num9 = 1f - tempMushroomInfluence - Main.cloudAlpha * 1.5f * Main.atmo; - if ((double) num9 < 0.0) - num9 = 0.0f; - Microsoft.Xna.Framework.Color color1 = new Microsoft.Xna.Framework.Color((int) (byte) ((double) byte.MaxValue * (double) num9), (int) (byte) ((double) sunColor.G * (double) num9), (int) (byte) ((double) sunColor.B * (double) num9), (int) (byte) ((double) byte.MaxValue * (double) num9)); - Microsoft.Xna.Framework.Color color2 = new Microsoft.Xna.Framework.Color((int) (byte) ((double) sunColor.R * (double) num9), (int) (byte) ((double) sunColor.G * (double) num9), (int) (byte) ((double) sunColor.B * (double) num9), (int) (byte) ((double) sunColor.B * (double) num9)); - bool flag = false; - if (Main.eclipse) - { - texture2D1 = TextureAssets.Sun3.Value; - flag = true; - } - else if (!Main.gameMenu && Main.player[Main.myPlayer].head == 12) - { - texture2D1 = TextureAssets.Sun2.Value; - flag = true; - } - if (flag) - color2 = new Microsoft.Xna.Framework.Color((int) (byte) ((double) sunColor.R * (double) num9), (int) (byte) ((double) sunColor.G * (double) num9), (int) (byte) ((double) sunColor.B * (double) num9), (int) (byte) ((double) ((int) sunColor.B - 60) * (double) num9)); - Vector2 origin = texture2D1.Size() / 2f; - Vector2 position = new Vector2((float) num1, (float) (num2 + (int) Main.sunModY)) + sceneArea.SceneLocalScreenPositionOffset; - Main.spriteBatch.Draw(texture2D1, position, new Microsoft.Xna.Framework.Rectangle?(), color1, rotation1, origin, scale1, SpriteEffects.None, 0.0f); - Main.spriteBatch.Draw(texture2D1, position, new Microsoft.Xna.Framework.Rectangle?(), color2, rotation1, origin, scale1, SpriteEffects.None, 0.0f); - } - if (!Main.dayTime) - { - float num10 = (float) (1.0 - (double) Main.cloudAlpha * 1.5 * (double) Main.atmo); - if ((double) num10 < 0.0) - num10 = 0.0f; - moonColor *= num10; - Vector2 position = new Vector2((float) num4, (float) (num5 + (int) Main.moonModY)) + sceneArea.SceneLocalScreenPositionOffset; - if (WorldGen.drunkWorldGen) - Main.spriteBatch.Draw(TextureAssets.SmileyMoon.Value, position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.SmileyMoon.Width(), TextureAssets.SmileyMoon.Height())), moonColor, (float) ((double) rotation2 / 2.0 + 3.14159274101257), new Vector2((float) (TextureAssets.SmileyMoon.Width() / 2), (float) (TextureAssets.SmileyMoon.Width() / 2)), scale2, SpriteEffects.None, 0.0f); - else if (Main.pumpkinMoon) - Main.spriteBatch.Draw(TextureAssets.PumpkinMoon.Value, position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, TextureAssets.PumpkinMoon.Width() * Main.moonPhase, TextureAssets.PumpkinMoon.Width(), TextureAssets.PumpkinMoon.Width())), moonColor, rotation2, new Vector2((float) (TextureAssets.PumpkinMoon.Width() / 2), (float) (TextureAssets.PumpkinMoon.Width() / 2)), scale2, SpriteEffects.None, 0.0f); - else if (Main.snowMoon) - Main.spriteBatch.Draw(TextureAssets.SnowMoon.Value, position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, TextureAssets.SnowMoon.Width() * Main.moonPhase, TextureAssets.SnowMoon.Width(), TextureAssets.SnowMoon.Width())), moonColor, rotation2, new Vector2((float) (TextureAssets.SnowMoon.Width() / 2), (float) (TextureAssets.SnowMoon.Width() / 2)), scale2, SpriteEffects.None, 0.0f); - else - Main.spriteBatch.Draw(TextureAssets.Moon[index].Value, position, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, TextureAssets.Moon[index].Width() * Main.moonPhase, TextureAssets.Moon[index].Width(), TextureAssets.Moon[index].Width())), moonColor, rotation2, new Vector2((float) (TextureAssets.Moon[index].Width() / 2), (float) (TextureAssets.Moon[index].Width() / 2)), scale2, SpriteEffects.None, 0.0f); - } - Microsoft.Xna.Framework.Rectangle rectangle1 = !Main.dayTime ? new Microsoft.Xna.Framework.Rectangle((int) ((double) num4 - (double) TextureAssets.Moon[index].Width() * 0.5 * (double) scale2), (int) ((double) num5 - (double) TextureAssets.Moon[index].Width() * 0.5 * (double) scale2 + (double) Main.moonModY), (int) ((double) TextureAssets.Moon[index].Width() * (double) scale2), (int) ((double) TextureAssets.Moon[index].Width() * (double) scale2)) : new Microsoft.Xna.Framework.Rectangle((int) ((double) num1 - (double) TextureAssets.Sun.Width() * 0.5 * (double) scale1), (int) ((double) num2 - (double) TextureAssets.Sun.Height() * 0.5 * (double) scale1 + (double) Main.sunModY), (int) ((double) TextureAssets.Sun.Width() * (double) scale1), (int) ((double) TextureAssets.Sun.Width() * (double) scale1)); - rectangle1.Offset((int) sceneArea.SceneLocalScreenPositionOffset.X, (int) sceneArea.SceneLocalScreenPositionOffset.Y); - Microsoft.Xna.Framework.Rectangle rectangle2 = new Microsoft.Xna.Framework.Rectangle(Main.mouseX, Main.mouseY, 1, 1); - Main.sunModY = (short) ((double) Main.sunModY * 0.999); - Main.moonModY = (short) ((double) Main.moonModY * 0.999); - if ((!Main.gameMenu ? 0 : (Main.netMode != 1 ? 1 : 0)) == 0) - return; - if (rectangle2.Intersects(rectangle1) || Main.alreadyGrabbingSunOrMoon) - Main.player[Main.myPlayer].mouseInterface = true; - if (Main.mouseLeft && Main.hasFocus) - { - if (!rectangle2.Intersects(rectangle1) && !Main.alreadyGrabbingSunOrMoon) - return; - if (Main.dayTime) - { - Main.time = 54000.0 * ((double) (Main.mouseX + TextureAssets.Sun.Width()) / ((double) Main.screenWidth + (double) (TextureAssets.Sun.Width() * 2))); - Main.sunModY = (short) (Main.mouseY - num2); - if (Main.time > 53990.0) - Main.time = 53990.0; - } - else - { - Main.time = 32400.0 * ((double) (Main.mouseX + TextureAssets.Moon[index].Width()) / ((double) Main.screenWidth + (double) (TextureAssets.Moon[index].Width() * 2))); - Main.moonModY = (short) (Main.mouseY - num5); - if (Main.time > 32390.0) - Main.time = 32390.0; - } - if (Main.time < 10.0) - Main.time = 10.0; - Main.alreadyGrabbingSunOrMoon = true; - } - else - Main.alreadyGrabbingSunOrMoon = false; - } - - private void DrawStarsInBackground(Main.SceneArea sceneArea) - { - if (Main.netMode == 2 || (double) Main.screenPosition.Y >= Main.worldSurface * 16.0 + 16.0) - return; - float num1 = 1f; - if ((double) Main.GraveyardVisualIntensity > 0.0) - { - float num2 = (float) (1.0 - (double) Main.GraveyardVisualIntensity * 1.39999997615814); - if ((double) num2 <= 0.0) - return; - num1 *= num2; - } - Microsoft.Xna.Framework.Color colorOfTheSkies = Main.ColorOfTheSkies; - if ((double) byte.MaxValue * (1.0 - (double) Main.cloudAlpha * (double) Main.atmo) - (double) colorOfTheSkies.R - 25.0 <= 0.0) - return; - for (int index1 = 0; index1 < Main.numStars; ++index1) - { - Star star = Main.star[index1]; - if (star != null && !star.hidden) - { - Microsoft.Xna.Framework.Color color1 = new Microsoft.Xna.Framework.Color(); - float num3 = 1f - star.fadeIn; - int num4 = (int) ((double) ((int) byte.MaxValue - (int) colorOfTheSkies.R - 100) * (double) star.twinkle * (double) num3); - int num5 = (int) ((double) ((int) byte.MaxValue - (int) colorOfTheSkies.G - 100) * (double) star.twinkle * (double) num3); - int num6 = (int) ((double) ((int) byte.MaxValue - (int) colorOfTheSkies.B - 100) * (double) star.twinkle * (double) num3); - int num7 = (num4 + num6 + num5) / 3; - if (num7 > 0) - { - int num8 = (int) ((double) num7 * 1.4); - if (num8 > (int) byte.MaxValue) - num8 = (int) byte.MaxValue; - int num9 = num8; - int num10 = num8; - color1.R = (byte) num8; - color1.G = (byte) num9; - color1.B = (byte) num10; - color1 *= num1; - Vector2 position = new Vector2(star.position.X / 1920f, star.position.Y / 1200f) * new Vector2(sceneArea.totalWidth, sceneArea.totalHeight) + new Vector2(0.0f, (float) sceneArea.bgTopY) + sceneArea.SceneLocalScreenPositionOffset; - Texture2D texture2D = TextureAssets.Star[star.type].Value; - Vector2 origin = texture2D.Size() / 2f; - if (star.falling) - { - star.fadeIn = 0.0f; - int num11 = star.fallTime; - float num12 = 30f; - if ((double) num11 > (double) num12) - num11 = (int) num12; - for (int index2 = 1; index2 < num11; ++index2) - { - Vector2 vector2 = star.fallSpeed * (float) index2 * 0.4f; - float num13 = star.scale * (float) (1.0 - (double) index2 * 1.0 / (double) num12); - Microsoft.Xna.Framework.Color color2 = color1; - double rotation = (double) star.rotation; - Microsoft.Xna.Framework.Color color3 = color2 * (float) (1.0 - (double) index2 * 1.0 / (double) num12); - Main.spriteBatch.Draw(texture2D, position - vector2, new Microsoft.Xna.Framework.Rectangle?(), color3, star.rotation, origin, num13 * star.twinkle * Main.ForcedMinimumZoom, SpriteEffects.None, 0.0f); - } - } - Main.spriteBatch.Draw(texture2D, position, new Microsoft.Xna.Framework.Rectangle?(), color1, star.rotation, origin, star.scale * star.twinkle * Main.ForcedMinimumZoom, SpriteEffects.None, 0.0f); - } - } - } - } - - private static void ApplyColorOfTheSkiesToTiles() - { - Microsoft.Xna.Framework.Color colorOfTheSkies = Main.ColorOfTheSkies; - Main.tileColor.A = byte.MaxValue; - Main.tileColor.R = (byte) (((int) colorOfTheSkies.R + (int) colorOfTheSkies.G + (int) colorOfTheSkies.B + (int) colorOfTheSkies.R * 7) / 10); - Main.tileColor.G = (byte) (((int) colorOfTheSkies.R + (int) colorOfTheSkies.G + (int) colorOfTheSkies.B + (int) colorOfTheSkies.G * 7) / 10); - Main.tileColor.B = (byte) (((int) colorOfTheSkies.R + (int) colorOfTheSkies.G + (int) colorOfTheSkies.B + (int) colorOfTheSkies.B * 7) / 10); - Main.tileColor = SkyManager.Instance.ProcessTileColor(Main.tileColor); - } - - private static void UpdateAtmosphereTransparencyToSkyColor() - { - float num1 = (float) (Main.maxTilesX / 4200); - float num2 = num1 * num1; - Main.atmo = (float) ((((double) Main.screenPosition.Y + (double) (Main.screenHeight / 2)) / 16.0 - (65.0 + 10.0 * (double) num2)) / (Main.worldSurface / 5.0)); - if ((double) Main.atmo < 0.0) - Main.atmo = 0.0f; - if ((double) Main.atmo > 1.0) - Main.atmo = 1f; - if (Main.gameMenu || Main.netMode == 2) - Main.atmo = 1f; - Microsoft.Xna.Framework.Color color = Main.ColorOfTheSkies; - color.R = (byte) ((double) color.R * (double) Main.atmo); - color.G = (byte) ((double) color.G * (double) Main.atmo); - color.B = (byte) ((double) color.B * (double) Main.atmo); - if ((double) Main.atmo <= 0.01) - color = Microsoft.Xna.Framework.Color.Transparent; - Main.ColorOfTheSkies = color; - } - - private void Debug_PrettifyMap() - { - } - - private static void DrawNetplayStatusText() - { - if (Main.netMode != 1 || string.IsNullOrWhiteSpace(Netplay.Connection.StatusText)) - return; - string text = Netplay.Connection.StatusText; - if (!Netplay.Connection.HideStatusTextPercent) - text = text + ": " + (object) (int) ((double) Netplay.Connection.StatusCount / (double) Netplay.Connection.StatusMax * 100.0) + "%"; - if (Main._netplayStatusTextSnippets == null || Main._oldNetplayStatusText != text) - { - Main._netplayStatusTextSnippets = ChatManager.ParseMessage(text, Microsoft.Xna.Framework.Color.White).ToArray(); - Main._oldNetplayStatusText = text; - } - Vector2 position = new Vector2((float) (628.0 - (double) ChatManager.GetStringSize(FontAssets.MouseText.Value, Main._netplayStatusTextSnippets, Vector2.One).X * 0.5) + (float) (Main.screenWidth - 800), 84f); - int hoveredSnippet; - if (Netplay.Connection.StatusTextHasShadows) - ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, FontAssets.MouseText.Value, Main._netplayStatusTextSnippets, position, 0.0f, Vector2.Zero, Vector2.One, out hoveredSnippet); - else - ChatManager.DrawColorCodedString(Main.spriteBatch, FontAssets.MouseText.Value, Main._netplayStatusTextSnippets, position, new Microsoft.Xna.Framework.Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor), 0.0f, Vector2.Zero, Vector2.One, out hoveredSnippet, -1f); - } - - private void DrawPlayerChatBubbles() - { - for (int index = 0; index < (int) byte.MaxValue; ++index) - { - if (Main.player[index].active && Main.player[index].chatOverhead.timeLeft > 0 && !Main.player[index].dead) - { - Vector2 messageSize = Main.player[index].chatOverhead.messageSize; - Vector2 screenPosition = Main.player[index].Top.ToScreenPosition(); - screenPosition.Y -= messageSize.Y + 2f; - if ((double) Main.player[Main.myPlayer].gravDir == -1.0) - screenPosition.Y += 2f; - screenPosition.X -= messageSize.X / 2f; - screenPosition.Y += Main.player[index].gfxOffY; - Vector2 position = screenPosition.Floor(); - int hoveredSnippet = 0; - ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, FontAssets.MouseText.Value, Main.player[index].chatOverhead.snippets, position, 0.0f, Main.player[index].chatOverhead.color, Vector2.Zero, Vector2.One, out hoveredSnippet); - } - } - } - - private void DrawRainInMenu() - { - bool isActive = this.IsActive; - Microsoft.Xna.Framework.Rectangle[] rectangleArray = new Microsoft.Xna.Framework.Rectangle[6]; - for (int index = 0; index < rectangleArray.Length; ++index) - rectangleArray[index] = new Microsoft.Xna.Framework.Rectangle(index * 4, 0, 2, 40); - Microsoft.Xna.Framework.Color color = Main.ColorOfTheSkies * 0.85f; - for (int index = 0; index < Main.maxRain; ++index) - { - if (Main.rain[index].active) - { - Rain rain = Main.rain[index]; - Main.spriteBatch.Draw(TextureAssets.Rain.Value, rain.position - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(rectangleArray[(int) rain.type]), color, rain.rotation, Vector2.Zero, rain.scale, SpriteEffects.None, 0.0f); - if (isActive) - rain.Update(); - } - } - } - - private void DoDraw_WallsTilesNPCs() - { - try - { - this.CacheNPCDraws(); - this.CacheProjDraws(); - this.DrawCachedNPCs(this.DrawCacheNPCsMoonMoon, true); - this.DoDraw_WallsAndBlacks(); - this.DrawWoF(); - this.DrawBackGore(); - MoonlordDeathDrama.DrawPieces(Main.spriteBatch); - MoonlordDeathDrama.DrawExplosions(Main.spriteBatch); - this.DrawCachedNPCs(this.DrawCacheNPCsBehindNonSolidTiles, true); - this.DoDraw_Tiles_NonSolid(); - this.DoDraw_Waterfalls(); - } - catch (Exception ex) - { - TimeLogger.DrawException(ex); - } - Main.spriteBatch.End(); - try - { - int num = Main.player[Main.myPlayer].detectCreature ? 1 : 0; - if (num == 0) - this.DoDraw_DrawNPCsBehindTiles(); - this.DoDraw_Tiles_Solid(); - if (num != 0) - this.DoDraw_DrawNPCsBehindTiles(); - this.DrawPlayers_BehindNPCs(); - this.DoDraw_DrawNPCsOverTiles(); - TimeLogger.DetailedDrawReset(); - } - catch (Exception ex) - { - TimeLogger.DrawException(ex); - } - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.Transform); - } - - private void DoDraw_Waterfalls() - { - this.waterfallManager.Draw(Main.spriteBatch); - TimeLogger.DetailedDrawTime(16); - } - - private void DoDraw_Tiles_Solid() - { - this.TilesRenderer.PreDrawTiles(true, !Main.drawToScreen, false); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.Transform); - try - { - if (Main.drawToScreen) - { - this.DrawTiles(true, !Main.drawToScreen, false); - } - else - { - Main.spriteBatch.Draw((Texture2D) this.tileTarget, Main.sceneTilePos - Main.screenPosition, Microsoft.Xna.Framework.Color.White); - TimeLogger.DetailedDrawTime(17); - } - } - catch (Exception ex) - { - TimeLogger.DrawException(ex); - } - Main.spriteBatch.End(); - this.DrawTileEntities(true, !Main.drawToScreen, false); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.Transform); - try - { - Main.player[Main.myPlayer].hitReplace.DrawFreshAnimations(Main.spriteBatch); - Main.player[Main.myPlayer].hitTile.DrawFreshAnimations(Main.spriteBatch); - } - catch (Exception ex) - { - TimeLogger.DrawException(ex); - } - Main.spriteBatch.End(); - } - - private void DoDraw_Tiles_NonSolid() - { - this.TilesRenderer.PreDrawTiles(false, !Main.drawToScreen, false); - if (Main.drawToScreen) - { - this.DrawTiles(false, !Main.drawToScreen, false); - TimeLogger.DetailedDrawReset(); - } - else - { - Main.spriteBatch.Draw((Texture2D) this.tile2Target, Main.sceneTile2Pos - Main.screenPosition, Microsoft.Xna.Framework.Color.White); - TimeLogger.DetailedDrawTime(15); - } - Main.spriteBatch.End(); - try - { - this.DrawTileEntities(false, !Main.drawToScreen, false); - } - catch (Exception ex) - { - TimeLogger.DrawException(ex); - } - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.Transform); - } - - private void DoDraw_DrawNPCsOverTiles() - { - this.DrawCachedProjs(this.DrawCacheProjsBehindNPCs); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.Transform); - try - { - this.DrawNPCs(); - this.DrawCachedNPCs(this.DrawCacheNPCProjectiles, false); - TimeLogger.DetailedDrawTime(19); - } - catch (Exception ex) - { - TimeLogger.DrawException(ex); - } - Main.spriteBatch.End(); - } - - private void DoDraw_DrawNPCsBehindTiles() - { - this.DrawCachedProjs(this.DrawCacheProjsBehindNPCsAndTiles); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, (Effect) null, Main.Transform); - try - { - this.DrawNPCs(true); - TimeLogger.DetailedDrawTime(18); - } - catch (Exception ex) - { - TimeLogger.DrawException(ex); - } - Main.spriteBatch.End(); - } - - private void DrawBackGore() - { - if (!Main.drawBackGore) - return; - Main.drawBackGore = false; - if (Main.ignoreErrors) - { - try - { - this.DrawGoreBehind(); - } - catch (Exception ex) - { - TimeLogger.DrawException(ex); - } - } - else - this.DrawGoreBehind(); - } - - private void DoDraw_WallsAndBlacks() - { - if (Main.drawToScreen) - { - this.DrawBlack(); - Main.tileBatch.Begin(); - this.DrawWalls(); - Main.tileBatch.End(); - } - else - { - Main.spriteBatch.Draw((Texture2D) this.blackTarget, Main.sceneTilePos - Main.screenPosition, Microsoft.Xna.Framework.Color.White); - TimeLogger.DetailedDrawTime(13); - Main.spriteBatch.Draw((Texture2D) this.wallTarget, Main.sceneWallPos - Main.screenPosition, Microsoft.Xna.Framework.Color.White); - TimeLogger.DetailedDrawTime(14); - } - Overlays.Scene.Draw(Main.spriteBatch, RenderLayers.Walls); - } - - private static void SetBackColor( - Main.InfoToSetBackColor info, - out Microsoft.Xna.Framework.Color sunColor, - out Microsoft.Xna.Framework.Color moonColor) - { - double time = Main.time; - Microsoft.Xna.Framework.Color white = Microsoft.Xna.Framework.Color.White; - sunColor = Microsoft.Xna.Framework.Color.White; - moonColor = Microsoft.Xna.Framework.Color.White; - int num1 = info.isInGameMenuOrIsServer ? 1 : 0; - if (Main.dayTime) - { - if (time < 13500.0) - { - float num2 = (float) (time / 13500.0); - sunColor.R = (byte) ((double) num2 * 200.0 + 55.0); - sunColor.G = (byte) ((double) num2 * 180.0 + 75.0); - sunColor.B = (byte) ((double) num2 * 250.0 + 5.0); - white.R = (byte) ((double) num2 * 230.0 + 25.0); - white.G = (byte) ((double) num2 * 220.0 + 35.0); - white.B = (byte) ((double) num2 * 220.0 + 35.0); - } - if (time > 45900.0) - { - float num3 = (float) (1.0 - (time / 54000.0 - 0.85) * (20.0 / 3.0)); - sunColor.R = (byte) ((double) num3 * 120.0 + 55.0); - sunColor.G = (byte) ((double) num3 * 100.0 + 25.0); - sunColor.B = (byte) ((double) num3 * 120.0 + 55.0); - white.R = (byte) ((double) num3 * 200.0 + 35.0); - white.G = (byte) ((double) num3 * 85.0 + 35.0); - white.B = (byte) ((double) num3 * 135.0 + 35.0); - } - else if (time > 37800.0) - { - float num4 = (float) (1.0 - (time / 54000.0 - 0.7) * (20.0 / 3.0)); - sunColor.R = (byte) ((double) num4 * 80.0 + 175.0); - sunColor.G = (byte) ((double) num4 * 130.0 + 125.0); - sunColor.B = (byte) ((double) num4 * 100.0 + 155.0); - white.R = (byte) ((double) num4 * 20.0 + 235.0); - white.G = (byte) ((double) num4 * 135.0 + 120.0); - white.B = (byte) ((double) num4 * 85.0 + 170.0); - } - } - if (!Main.dayTime) - { - if (info.BloodMoonActive) - { - if (time < 16200.0) - { - float num5 = (float) (1.0 - time / 16200.0); - moonColor.R = (byte) ((double) num5 * 10.0 + 205.0); - moonColor.G = (byte) ((double) num5 * 170.0 + 55.0); - moonColor.B = (byte) ((double) num5 * 200.0 + 55.0); - white.R = (byte) (40.0 - (double) num5 * 40.0 + 35.0); - white.G = (byte) ((double) num5 * 20.0 + 15.0); - white.B = (byte) ((double) num5 * 20.0 + 15.0); - } - else if (time >= 16200.0) - { - float num6 = (float) ((time / 32400.0 - 0.5) * 2.0); - moonColor.R = (byte) ((double) num6 * 50.0 + 205.0); - moonColor.G = (byte) ((double) num6 * 100.0 + 155.0); - moonColor.B = (byte) ((double) num6 * 100.0 + 155.0); - moonColor.R = (byte) ((double) num6 * 10.0 + 205.0); - moonColor.G = (byte) ((double) num6 * 170.0 + 55.0); - moonColor.B = (byte) ((double) num6 * 200.0 + 55.0); - white.R = (byte) (40.0 - (double) num6 * 40.0 + 35.0); - white.G = (byte) ((double) num6 * 20.0 + 15.0); - white.B = (byte) ((double) num6 * 20.0 + 15.0); - } - } - else if (time < 16200.0) - { - float num7 = (float) (1.0 - time / 16200.0); - moonColor.R = (byte) ((double) num7 * 10.0 + 205.0); - moonColor.G = (byte) ((double) num7 * 70.0 + 155.0); - moonColor.B = (byte) ((double) num7 * 100.0 + 155.0); - white.R = (byte) ((double) num7 * 30.0 + 5.0); - white.G = (byte) ((double) num7 * 30.0 + 5.0); - white.B = (byte) ((double) num7 * 30.0 + 5.0); - } - else if (time >= 16200.0) - { - float num8 = (float) ((time / 32400.0 - 0.5) * 2.0); - moonColor.R = (byte) ((double) num8 * 50.0 + 205.0); - moonColor.G = (byte) ((double) num8 * 100.0 + 155.0); - moonColor.B = (byte) ((double) num8 * 100.0 + 155.0); - white.R = (byte) ((double) num8 * 20.0 + 5.0); - white.G = (byte) ((double) num8 * 30.0 + 5.0); - white.B = (byte) ((double) num8 * 30.0 + 5.0); - } - } - if ((double) Main.cloudAlpha > 0.0) - { - float num9 = (float) (1.0 - (double) Main.cloudAlpha * 0.899999976158142 * (double) Main.atmo); - white.R = (byte) ((double) white.R * (double) num9); - white.G = (byte) ((double) white.G * (double) num9); - white.B = (byte) ((double) white.B * (double) num9); - } - if ((double) info.GraveyardInfluence > 0.0) - { - float num10 = (float) (1.0 - (double) info.GraveyardInfluence * 0.600000023841858); - white.R = (byte) ((double) white.R * (double) num10); - white.G = (byte) ((double) white.G * (double) num10); - white.B = (byte) ((double) white.B * (double) num10); - } - if (num1 != 0 && !Main.dayTime) - { - white.R = (byte) 35; - white.G = (byte) 35; - white.B = (byte) 35; - } - if ((double) info.CorruptionBiomeInfluence > 0.0) - { - float num11 = info.CorruptionBiomeInfluence; - if ((double) num11 > 1.0) - num11 = 1f; - int r1 = (int) white.R; - int g1 = (int) white.G; - int b1 = (int) white.B; - int num12 = r1 - (int) (90.0 * (double) num11 * ((double) white.R / (double) byte.MaxValue)); - int num13 = g1 - (int) (140.0 * (double) num11 * ((double) white.G / (double) byte.MaxValue)); - int num14 = b1 - (int) (70.0 * (double) num11 * ((double) white.B / (double) byte.MaxValue)); - if (num12 < 15) - num12 = 15; - if (num13 < 15) - num13 = 15; - if (num14 < 15) - num14 = 15; - white.R = (byte) num12; - white.G = (byte) num13; - white.B = (byte) num14; - int r2 = (int) sunColor.R; - int g2 = (int) sunColor.G; - int b2 = (int) sunColor.B; - int num15 = r2 - (int) (100.0 * (double) num11 * ((double) sunColor.R / (double) byte.MaxValue)); - int num16 = g2 - (int) (100.0 * (double) num11 * ((double) sunColor.G / (double) byte.MaxValue)); - int num17 = b2 - (int) (0.0 * (double) num11 * ((double) sunColor.B / (double) byte.MaxValue)); - if (num15 < 15) - num15 = 15; - if (num16 < 15) - num16 = 15; - if (num17 < 15) - num17 = 15; - sunColor.R = (byte) num15; - sunColor.G = (byte) num16; - sunColor.B = (byte) num17; - } - if ((double) info.CrimsonBiomeInfluence > 0.0) - { - float num18 = info.CrimsonBiomeInfluence; - if ((double) num18 > 1.0) - num18 = 1f; - int r = (int) white.R; - int g3 = (int) white.G; - int b3 = (int) white.B; - int num19 = r - (int) (40.0 * (double) num18 * ((double) white.G / (double) byte.MaxValue)); - int num20 = g3 - (int) (110.0 * (double) num18 * ((double) white.G / (double) byte.MaxValue)); - int num21 = b3 - (int) (140.0 * (double) num18 * ((double) white.B / (double) byte.MaxValue)); - if (num19 < 15) - num19 = 15; - if (num20 < 15) - num20 = 15; - if (num21 < 15) - num21 = 15; - white.R = (byte) num19; - white.G = (byte) num20; - white.B = (byte) num21; - int num22 = (int) sunColor.R; - int g4 = (int) sunColor.G; - int b4 = (int) sunColor.B; - int num23 = g4 - (int) (90.0 * (double) num18 * ((double) sunColor.G / (double) byte.MaxValue)); - int num24 = b4 - (int) (110.0 * (double) num18 * ((double) sunColor.B / (double) byte.MaxValue)); - if (num22 < 15) - num22 = 15; - if (num23 < 15) - num23 = 15; - if (num24 < 15) - num24 = 15; - sunColor.R = (byte) num22; - sunColor.G = (byte) num23; - sunColor.B = (byte) num24; - } - if ((double) info.JungleBiomeInfluence > 0.0) - { - float num25 = info.JungleBiomeInfluence; - if ((double) num25 > 1.0) - num25 = 1f; - int r3 = (int) white.R; - int num26 = (int) white.G; - int b5 = (int) white.B; - int num27 = r3 - (int) (40.0 * (double) num25 * ((double) white.R / (double) byte.MaxValue)); - int num28 = b5 - (int) (70.0 * (double) num25 * ((double) white.B / (double) byte.MaxValue)); - if (num26 > (int) byte.MaxValue) - num26 = (int) byte.MaxValue; - if (num26 < 15) - num26 = 15; - if (num27 > (int) byte.MaxValue) - num27 = (int) byte.MaxValue; - if (num27 < 15) - num27 = 15; - if (num28 < 15) - num28 = 15; - white.R = (byte) num27; - white.G = (byte) num26; - white.B = (byte) num28; - int r4 = (int) sunColor.R; - int num29 = (int) sunColor.G; - int b6 = (int) sunColor.B; - int num30 = r4 - (int) (30.0 * (double) num25 * ((double) sunColor.R / (double) byte.MaxValue)); - int num31 = b6 - (int) (10.0 * (double) num25 * ((double) sunColor.B / (double) byte.MaxValue)); - if (num30 < 15) - num30 = 15; - if (num29 < 15) - num29 = 15; - if (num31 < 15) - num31 = 15; - sunColor.R = (byte) num30; - sunColor.G = (byte) num29; - sunColor.B = (byte) num31; - } - if ((double) info.MushroomBiomeInfluence > 0.0) - { - float mushroomBiomeInfluence = info.MushroomBiomeInfluence; - int r5 = (int) white.R; - int g5 = (int) white.G; - int b7 = (int) white.B; - int num32 = g5 - (int) (250.0 * (double) mushroomBiomeInfluence * ((double) white.G / (double) byte.MaxValue)); - int num33 = r5 - (int) (250.0 * (double) mushroomBiomeInfluence * ((double) white.R / (double) byte.MaxValue)); - int num34 = b7 - (int) (250.0 * (double) mushroomBiomeInfluence * ((double) white.B / (double) byte.MaxValue)); - if (num32 < 15) - num32 = 15; - if (num33 < 15) - num33 = 15; - if (num34 < 15) - num34 = 15; - white.R = (byte) num33; - white.G = (byte) num32; - white.B = (byte) num34; - int r6 = (int) sunColor.R; - int g6 = (int) sunColor.G; - int b8 = (int) sunColor.B; - int num35 = g6 - (int) (10.0 * (double) mushroomBiomeInfluence * ((double) sunColor.G / (double) byte.MaxValue)); - int num36 = r6 - (int) (30.0 * (double) mushroomBiomeInfluence * ((double) sunColor.R / (double) byte.MaxValue)); - int num37 = b8 - (int) (10.0 * (double) mushroomBiomeInfluence * ((double) sunColor.B / (double) byte.MaxValue)); - if (num36 < 15) - num36 = 15; - if (num35 < 15) - num35 = 15; - if (num37 < 15) - num37 = 15; - sunColor.R = (byte) num36; - sunColor.G = (byte) num35; - sunColor.B = (byte) num37; - int r7 = (int) moonColor.R; - int g7 = (int) moonColor.G; - int b9 = (int) moonColor.B; - int num38 = g7 - (int) (140.0 * (double) mushroomBiomeInfluence * ((double) moonColor.R / (double) byte.MaxValue)); - int num39 = r7 - (int) (170.0 * (double) mushroomBiomeInfluence * ((double) moonColor.G / (double) byte.MaxValue)); - int num40 = b9 - (int) (190.0 * (double) mushroomBiomeInfluence * ((double) moonColor.B / (double) byte.MaxValue)); - if (num39 < 15) - num39 = 15; - if (num38 < 15) - num38 = 15; - if (num40 < 15) - num40 = 15; - moonColor.R = (byte) num39; - moonColor.G = (byte) num38; - moonColor.B = (byte) num40; - } - byte num41 = 15; - switch (Main.GetMoonPhase()) - { - case MoonPhase.Full: - num41 = (byte) 19; - break; - case MoonPhase.ThreeQuartersAtLeft: - case MoonPhase.ThreeQuartersAtRight: - num41 = (byte) 17; - break; - case MoonPhase.HalfAtLeft: - case MoonPhase.HalfAtRight: - num41 = (byte) 15; - break; - case MoonPhase.QuarterAtLeft: - case MoonPhase.QuarterAtRight: - num41 = (byte) 13; - break; - case MoonPhase.Empty: - num41 = (byte) 11; - break; - } - if ((int) white.R < (int) num41) - white.R = num41; - if ((int) white.G < (int) num41) - white.G = num41; - if ((int) white.B < (int) num41) - white.B = num41; - if (info.BloodMoonActive) - { - if (white.R < (byte) 25) - white.R = (byte) 25; - if (white.G < (byte) 25) - white.G = (byte) 25; - if (white.B < (byte) 25) - white.B = (byte) 25; - } - if (Main.eclipse && Main.dayTime) - { - float num42 = 1242f; - Main.eclipseLight = (float) time / num42; - if ((double) Main.eclipseLight > 1.0) - Main.eclipseLight = 1f; - } - else if ((double) Main.eclipseLight > 0.0) - { - Main.eclipseLight -= 0.01f; - if ((double) Main.eclipseLight < 0.0) - Main.eclipseLight = 0.0f; - } - if ((double) Main.eclipseLight > 0.0) - { - float num43 = (float) (1.0 - 0.925000011920929 * (double) Main.eclipseLight); - float num44 = (float) (1.0 - 0.959999978542328 * (double) Main.eclipseLight); - float num45 = (float) (1.0 - 1.0 * (double) Main.eclipseLight); - int num46 = (int) ((double) white.R * (double) num43); - int num47 = (int) ((double) white.G * (double) num44); - int num48 = (int) ((double) white.B * (double) num45); - white.R = (byte) num46; - white.G = (byte) num47; - white.B = (byte) num48; - sunColor.R = byte.MaxValue; - sunColor.G = (byte) 127; - sunColor.B = (byte) 67; - if (white.R < (byte) 20) - white.R = (byte) 20; - if (white.G < (byte) 10) - white.G = (byte) 10; - if (!Lighting.NotRetro) - { - if (white.R < (byte) 20) - white.R = (byte) 20; - if (white.G < (byte) 14) - white.G = (byte) 14; - if (white.B < (byte) 6) - white.B = (byte) 6; - } - } - if ((double) Main.lightning > 0.0) - { - float num49 = (float) white.R / (float) byte.MaxValue; - float num50 = (float) white.G / (float) byte.MaxValue; - float num51 = (float) white.B / (float) byte.MaxValue; - float num52 = MathHelper.Lerp(num49, 1f, Main.lightning); - float num53 = MathHelper.Lerp(num50, 1f, Main.lightning); - float num54 = MathHelper.Lerp(num51, 1f, Main.lightning); - white.R = (byte) ((double) num52 * (double) byte.MaxValue); - white.G = (byte) ((double) num53 * (double) byte.MaxValue); - white.B = (byte) ((double) num54 * (double) byte.MaxValue); - } - if (!info.BloodMoonActive) - moonColor = Microsoft.Xna.Framework.Color.White; - Main.ColorOfTheSkies = white; - } - - private void DoLightTiles() - { - Vector2 vector2_1 = Main.Camera.ScaledPosition; - Vector2 vector2_2 = Main.Camera.ScaledSize; - if (!Lighting.UsingNewLighting) - { - vector2_1 = Main.Camera.UnscaledPosition; - vector2_2 = Main.Camera.UnscaledSize; - } - this.firstTileX = (int) Math.Floor((double) vector2_1.X / 16.0) - 1; - this.lastTileX = (int) Math.Floor(((double) vector2_1.X + (double) vector2_2.X) / 16.0) + 2; - this.firstTileY = (int) Math.Floor((double) vector2_1.Y / 16.0) - 1; - this.lastTileY = (int) Math.Floor(((double) vector2_1.Y + (double) vector2_2.Y) / 16.0) + 2; - if (Main.drawSkip) - return; - Lighting.LightTiles(this.firstTileX, this.lastTileX, this.firstTileY, this.lastTileY); - } - private static void ClampScreenPositionToWorld() { Vector2 input1 = new Vector2(Main.leftWorld + 656f, Main.topWorld + 656f) - Main.GameViewMatrix.Translation; @@ -47623,47 +47398,48 @@ label_623: private void DrawBG() { - float num1 = (float) Math.Min(PlayerInput.RealScreenHeight, Main.LogicCheckScreenHeight); - float num2 = (float) ((double) Main.screenPosition.Y + (double) (Main.screenHeight / 2) - (double) num1 / 2.0); - this.scAdj = (float) (Main.worldSurface * 16.0) / (num2 + num1); - float num3 = (float) ((double) Main.maxTilesY * 0.150000005960464 * 16.0) - num2; - if ((double) num3 < 0.0) - num3 = 0.0f; - float num4 = num3 * 0.00025f; - this.scAdj *= 0.45f - num4 * num4; - if (Main.maxTilesY <= 1200) + this.scAdj = 1f - (float) (((double) Main.screenPosition.Y + (double) Main.screenHeight) / (Main.worldSurface * 16.0)); + this.scAdj = (float) (Main.worldSurface * 16.0) / (Main.screenPosition.Y + (float) Main.screenHeight); + float num1 = (float) ((double) Main.maxTilesY * 0.150000005960464 * 16.0) - Main.screenPosition.Y; + if ((double) num1 < 0.0) + num1 = 0.0f; + float num2 = num1 * 0.00025f; + this.scAdj *= 0.45f - num2 * num2; + if ((double) Main.maxTilesY <= 1200.0) this.scAdj *= -500f; - else if (Main.maxTilesY <= 1800) + else if ((double) Main.maxTilesY <= 1800.0) this.scAdj *= -300f; else this.scAdj *= -150f; - this.screenOff = (float) Main.screenHeight - 600f; - this.bgTopY = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 1200.0 + 1190.0) + (int) this.scAdj; - this.cTop = (float) (this.bgTopY - 50); + this.screenOff = (float) (Main.screenHeight - 600); + this.bgTop = (int) ((-(double) Main.screenPosition.Y + (double) this.screenOff / 2.0) / (Main.worldSurface * 16.0) * 1200.0 + 1190.0) + (int) this.scAdj; + this.cTop = (float) (this.bgTop - 50); if (Main.resetClouds) { Cloud.resetClouds(); Main.resetClouds = false; } Main.bgScale = 1f; - Main.bgWidthScaled = (int) ((double) Main.backgroundWidth[Main.treeMntBGSet1[0]] * (double) Main.bgScale); - Main.ColorOfSurfaceBackgroundsModified = Main.ColorOfTheSkies; - Main.ColorOfSurfaceBackgroundsBase = Main.ColorOfTheSkies; - int num5 = Main.GetPreferredBGStyleForPlayer(); - int num6 = 30; - Main.backgroundLayerTransitionSpeed = 0.05f; - if (num5 == 0) - num6 = 60; + Main.bgW = (int) ((double) Main.backgroundWidth[Main.treeMntBG[0]] * (double) Main.bgScale); + Main.backColor = Main.bgColor; + Main.trueBackColor = Main.backColor; + int bgStyle = Main.bgStyle; + int num3 = (int) (((double) Main.screenPosition.X + (double) (Main.screenWidth / 2)) / 16.0); + int num4 = (double) Main.screenPosition.Y / 16.0 >= Main.worldSurface + 10.0 || num3 >= 380 && num3 <= Main.maxTilesX - 380 ? (Main.shroomTiles <= 100 ? (Main.sandTiles <= 1000 ? (!Main.player[Main.myPlayer].ZoneHoly ? (!Main.player[Main.myPlayer].ZoneCorrupt ? (!Main.player[Main.myPlayer].ZoneCrimson ? (!Main.player[Main.myPlayer].ZoneJungle ? (!Main.player[Main.myPlayer].ZoneSnow ? 0 : 7) : 3) : 8) : 1) : 6) : (!Main.player[Main.myPlayer].ZoneCorrupt ? (!Main.player[Main.myPlayer].ZoneCrimson ? (!Main.player[Main.myPlayer].ZoneHoly ? 2 : 5) : 5) : 5)) : 9) : 4; + int num5 = 30; + Main.tranSpeed = 0.05f; + if (num4 == 0) + num5 = 60; if (Main.bgDelay < 0) ++Main.bgDelay; - else if (num5 != Main.bgStyle) + else if (num4 != Main.bgStyle) { ++Main.bgDelay; - if (Main.bgDelay > num6) + if (Main.bgDelay > num5) { Main.bgDelay = -60; - Main.bgStyle = num5; - if (num5 == 0) + Main.bgStyle = num4; + if (num4 == 0) Main.bgDelay = 0; } } @@ -47671,186 +47447,225 @@ label_623: --Main.bgDelay; if (Main.gameMenu) { - Main.backgroundLayerTransitionSpeed = 0.02f; + Main.tranSpeed = 0.02f; Main.bgStyle = Main.dayTime ? 0 : 1; - num5 = Main.bgStyle; - if (WorldGen.drunkWorldGen) - Main.bgStyle = 9; + num4 = Main.bgStyle; } - if (Main.instantBGTransitionCounter > 0) + if (Main.quickBG > 0) { - --Main.instantBGTransitionCounter; - Main.bgStyle = num5; - Main.backgroundLayerTransitionSpeed = 1f; + --Main.quickBG; + Main.bgStyle = num4; + Main.tranSpeed = 1f; } - this.UpdateBGVisibility_BackLayer(new int?(), new float?()); - this.UpdateBGVisibility_FrontLayer(new int?(), new float?()); - try + switch (Main.bgStyle) + { + case 1: + case 5: + case 6: + Main.bgAlpha2[0] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[0] < 0.0) + Main.bgAlpha2[0] = 0.0f; + Main.bgAlpha2[1] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[1] < 0.0) + Main.bgAlpha2[1] = 0.0f; + Main.bgAlpha2[2] += Main.tranSpeed; + if ((double) Main.bgAlpha2[2] > 1.0) + Main.bgAlpha2[2] = 1f; + Main.bgAlpha2[3] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[3] < 0.0) + Main.bgAlpha2[3] = 0.0f; + Main.bgAlpha2[4] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[4] < 0.0) + Main.bgAlpha2[4] = 0.0f; + Main.bgAlpha2[5] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[5] < 0.0) + Main.bgAlpha2[5] = 0.0f; + Main.bgAlpha2[6] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[6] < 0.0) + { + Main.bgAlpha2[6] = 0.0f; + break; + } + break; + case 2: + Main.bgAlpha2[0] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[0] < 0.0) + Main.bgAlpha2[0] = 0.0f; + Main.bgAlpha2[1] += Main.tranSpeed; + if ((double) Main.bgAlpha2[1] > 1.0) + Main.bgAlpha2[1] = 1f; + Main.bgAlpha2[2] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[2] < 0.0) + Main.bgAlpha2[2] = 0.0f; + Main.bgAlpha2[3] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[3] < 0.0) + Main.bgAlpha2[3] = 0.0f; + Main.bgAlpha2[4] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[4] < 0.0) + Main.bgAlpha2[4] = 0.0f; + Main.bgAlpha2[5] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[5] < 0.0) + Main.bgAlpha2[5] = 0.0f; + Main.bgAlpha2[6] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[6] < 0.0) + { + Main.bgAlpha2[6] = 0.0f; + break; + } + break; + case 4: + Main.bgAlpha2[0] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[0] < 0.0) + Main.bgAlpha2[0] = 0.0f; + Main.bgAlpha2[1] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[1] < 0.0) + Main.bgAlpha2[1] = 0.0f; + Main.bgAlpha2[2] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[2] < 0.0) + Main.bgAlpha2[2] = 0.0f; + Main.bgAlpha2[3] += Main.tranSpeed; + if ((double) Main.bgAlpha2[3] > 1.0) + Main.bgAlpha2[3] = 1f; + Main.bgAlpha2[4] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[4] < 0.0) + Main.bgAlpha2[4] = 0.0f; + Main.bgAlpha2[5] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[5] < 0.0) + Main.bgAlpha2[5] = 0.0f; + Main.bgAlpha2[6] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[6] < 0.0) + { + Main.bgAlpha2[6] = 0.0f; + break; + } + break; + case 7: + Main.bgAlpha2[0] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[0] < 0.0) + Main.bgAlpha2[0] = 0.0f; + Main.bgAlpha2[1] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[1] < 0.0) + Main.bgAlpha2[1] = 0.0f; + Main.bgAlpha2[2] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[2] < 0.0) + Main.bgAlpha2[2] = 0.0f; + Main.bgAlpha2[3] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[3] < 0.0) + Main.bgAlpha2[3] = 0.0f; + Main.bgAlpha2[4] += Main.tranSpeed; + if ((double) Main.bgAlpha2[4] > 1.0) + Main.bgAlpha2[4] = 1f; + Main.bgAlpha2[5] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[5] < 0.0) + Main.bgAlpha2[5] = 0.0f; + Main.bgAlpha2[6] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[6] < 0.0) + { + Main.bgAlpha2[6] = 0.0f; + break; + } + break; + case 8: + Main.bgAlpha2[0] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[0] < 0.0) + Main.bgAlpha2[0] = 0.0f; + Main.bgAlpha2[1] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[1] < 0.0) + Main.bgAlpha2[1] = 0.0f; + Main.bgAlpha2[2] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[2] < 0.0) + Main.bgAlpha2[2] = 0.0f; + Main.bgAlpha2[3] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[3] < 0.0) + Main.bgAlpha2[3] = 0.0f; + Main.bgAlpha2[4] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[4] < 0.0) + Main.bgAlpha2[4] = 0.0f; + Main.bgAlpha2[5] += Main.tranSpeed; + if ((double) Main.bgAlpha2[5] > 1.0) + Main.bgAlpha2[5] = 1f; + Main.bgAlpha2[6] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[6] < 0.0) + { + Main.bgAlpha2[6] = 0.0f; + break; + } + break; + case 9: + Main.bgAlpha2[0] += Main.tranSpeed; + if ((double) Main.bgAlpha2[0] > 1.0) + Main.bgAlpha2[0] = 1f; + Main.bgAlpha2[1] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[1] < 0.0) + Main.bgAlpha2[1] = 0.0f; + Main.bgAlpha2[2] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[2] < 0.0) + Main.bgAlpha2[2] = 0.0f; + Main.bgAlpha2[3] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[3] < 0.0) + Main.bgAlpha2[3] = 0.0f; + Main.bgAlpha2[4] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[4] < 0.0) + Main.bgAlpha2[4] = 0.0f; + Main.bgAlpha2[5] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[5] < 0.0) + Main.bgAlpha2[5] = 0.0f; + Main.bgAlpha2[6] += Main.tranSpeed; + if ((double) Main.bgAlpha2[6] > 1.0) + { + Main.bgAlpha2[6] = 1f; + break; + } + break; + default: + Main.bgAlpha2[0] += Main.tranSpeed; + if ((double) Main.bgAlpha2[0] > 1.0) + Main.bgAlpha2[0] = 1f; + Main.bgAlpha2[1] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[1] < 0.0) + Main.bgAlpha2[1] = 0.0f; + Main.bgAlpha2[2] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[2] < 0.0) + Main.bgAlpha2[2] = 0.0f; + Main.bgAlpha2[3] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[3] < 0.0) + Main.bgAlpha2[3] = 0.0f; + Main.bgAlpha2[4] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[4] < 0.0) + Main.bgAlpha2[4] = 0.0f; + Main.bgAlpha2[5] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[5] < 0.0) + Main.bgAlpha2[5] = 0.0f; + Main.bgAlpha2[6] -= Main.tranSpeed; + if ((double) Main.bgAlpha2[6] < 0.0) + { + Main.bgAlpha2[6] = 0.0f; + break; + } + break; + } + if (Main.ignoreErrors) + { + try + { + this.DrawSurfaceBG(); + if (Main.BackgroundEnabled) + this.DrawUnderworldBackground(false); + } + catch (Exception ex) + { + TimeLogger.DrawException(ex); + } + } + else { this.DrawSurfaceBG(); if (Main.BackgroundEnabled) this.DrawUnderworldBackground(false); } - catch (Exception ex) - { - if (!Main.ignoreErrors) - throw ex; - TimeLogger.DrawException(ex); - } TimeLogger.DetailedDrawTime(8); } - private void UpdateBGVisibility_FrontLayer( - int? targetBiomeOverride, - float? transitionAmountOverride) - { - int bgStyle = Main.bgStyle; - if (targetBiomeOverride.HasValue) - bgStyle = targetBiomeOverride.Value; - float layerTransitionSpeed = Main.backgroundLayerTransitionSpeed; - if (transitionAmountOverride.HasValue) - layerTransitionSpeed = transitionAmountOverride.Value; - for (int index = 0; index < Main.bgAlphaFrontLayer.Length; ++index) - { - if (bgStyle == index) - { - Main.bgAlphaFrontLayer[index] += layerTransitionSpeed; - if ((double) Main.bgAlphaFrontLayer[index] > 1.0) - Main.bgAlphaFrontLayer[index] = 1f; - } - else - { - Main.bgAlphaFrontLayer[index] -= layerTransitionSpeed; - if ((double) Main.bgAlphaFrontLayer[index] < 0.0) - Main.bgAlphaFrontLayer[index] = 0.0f; - } - } - } - - private void UpdateBGVisibility_BackLayer( - int? targetBiomeOverride, - float? transitionAmountOverride) - { - int bgStyle = Main.bgStyle; - if (targetBiomeOverride.HasValue) - bgStyle = targetBiomeOverride.Value; - double layerTransitionSpeed = (double) Main.backgroundLayerTransitionSpeed; - if (transitionAmountOverride.HasValue) - { - double num = (double) transitionAmountOverride.Value; - } - switch (bgStyle) - { - case 1: - case 5: - this.DrawBG_ModifyBGFarBackLayerAlpha(2, transitionAmountOverride: transitionAmountOverride); - break; - case 2: - this.DrawBG_ModifyBGFarBackLayerAlpha(1, transitionAmountOverride: transitionAmountOverride); - break; - case 3: - if (WorldGen.jungleBG == 5) - { - this.DrawBG_ModifyBGFarBackLayerAlpha(13, transitionAmountOverride: transitionAmountOverride); - break; - } - this.DrawBG_ModifyBGFarBackLayerAlpha(0, transitionAmountOverride: transitionAmountOverride); - break; - case 4: - this.DrawBG_ModifyBGFarBackLayerAlpha(3, transitionAmountOverride: transitionAmountOverride); - break; - case 6: - if (WorldGen.hallowBG == 3) - { - this.DrawBG_ModifyBGFarBackLayerAlpha(6, transitionAmountOverride: transitionAmountOverride); - break; - } - this.DrawBG_ModifyBGFarBackLayerAlpha(2, transitionAmountOverride: transitionAmountOverride); - break; - case 7: - this.DrawBG_ModifyBGFarBackLayerAlpha(4, transitionAmountOverride: transitionAmountOverride); - break; - case 8: - this.DrawBG_ModifyBGFarBackLayerAlpha(5, transitionAmountOverride: transitionAmountOverride); - break; - case 9: - this.DrawBG_ModifyBGFarBackLayerAlpha(0, new int?(6), transitionAmountOverride); - break; - case 10: - case 11: - case 12: - this.DrawBG_ModifyBGFarBackLayerAlpha(bgStyle, transitionAmountOverride: transitionAmountOverride); - break; - default: - this.DrawBG_ModifyBGFarBackLayerAlpha(0, transitionAmountOverride: transitionAmountOverride); - break; - } - } - - public static int GetPreferredBGStyleForPlayer() - { - int bgStyle = Main.bgStyle; - int num1 = (int) (((double) Main.screenPosition.X + (double) (Main.screenWidth / 2)) / 16.0); - int num2; - if (WorldGen.oceanDepths((int) ((double) Main.screenPosition.X + (double) (Main.screenWidth / 2)) / 16, (int) ((double) Main.screenPosition.Y + (double) (Main.screenHeight / 2)) / 16)) - num2 = !Main.player[Main.myPlayer].ZoneHallow ? (!Main.player[Main.myPlayer].ZoneCorrupt ? (!Main.player[Main.myPlayer].ZoneCrimson ? (Main.SceneMetrics.HoneyBlockCount <= 400 ? 4 : 3) : 8) : (Main.SceneMetrics.BloodTileCount <= Main.SceneMetrics.EvilTileCount ? 1 : 8)) : 6; - else if (Main.player[Main.myPlayer].ZoneGlowshroom) - num2 = 9; - else if (Main.player[Main.myPlayer].ZoneDesert) - num2 = !Main.player[Main.myPlayer].ZoneCorrupt ? (!Main.player[Main.myPlayer].ZoneCrimson ? (!Main.player[Main.myPlayer].ZoneHallow ? 2 : 5) : 5) : 5; - else if (Main.player[Main.myPlayer].ZoneHallow) - num2 = 6; - else if (Main.player[Main.myPlayer].ZoneCorrupt) - num2 = Main.SceneMetrics.BloodTileCount <= Main.SceneMetrics.EvilTileCount ? 1 : 8; - else if (Main.player[Main.myPlayer].ZoneCrimson) - num2 = 8; - else if (Main.player[Main.myPlayer].ZoneJungle) - num2 = 3; - else if (Main.player[Main.myPlayer].ZoneSnow) - { - num2 = 7; - } - else - { - num2 = 0; - if (num1 >= Main.treeX[0]) - { - if (WorldGen.treeBG1 != WorldGen.treeBG2 && num1 < Main.treeX[1]) - num2 = 10; - else if (WorldGen.treeBG1 != WorldGen.treeBG3 && num1 < Main.treeX[2]) - num2 = 11; - else if (WorldGen.treeBG1 != WorldGen.treeBG4) - num2 = 12; - } - } - return num2; - } - - private void DrawBG_ModifyBGFarBackLayerAlpha( - int desiredBG, - int? desiredBG2 = null, - float? transitionAmountOverride = null) - { - float layerTransitionSpeed = Main.backgroundLayerTransitionSpeed; - if (transitionAmountOverride.HasValue) - layerTransitionSpeed = transitionAmountOverride.Value; - for (int index = 0; index < Main.bgAlphaFarBackLayer.Length; ++index) - { - int num1 = desiredBG == index ? 1 : 0; - int num2; - if (desiredBG2.HasValue) - { - int? nullable = desiredBG2; - int num3 = index; - num2 = nullable.GetValueOrDefault() == num3 & nullable.HasValue ? 1 : 0; - } - else - num2 = 0; - bool flag = (num1 | num2) != 0; - Main.bgAlphaFarBackLayer[index] = MathHelper.Clamp(Main.bgAlphaFarBackLayer[index] + (flag ? layerTransitionSpeed : -layerTransitionSpeed), 0.0f, 1f); - } - } - public void DrawInfernoRings() { for (int index1 = 0; index1 < (int) byte.MaxValue; ++index1) @@ -47884,7 +47699,7 @@ label_623: if ((double) scale > 1.0) scale -= num1 * 2f; float num3 = MathHelper.Lerp(0.8f, 0.0f, Math.Abs(scale - num2) * 10f); - Main.spriteBatch.Draw(TextureAssets.FlameRing.Value, Main.player[index1].Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 400 * index2, 400, 400)), new Microsoft.Xna.Framework.Color(num3, num3, num3, num3 / 2f), Main.player[index1].flameRingRot + 1.047198f * (float) index2, new Vector2(200f, 200f), scale, SpriteEffects.None, 0.0f); + Main.spriteBatch.Draw(this.flameRingTexture, Main.player[index1].Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 400 * index2, 400, 400)), new Microsoft.Xna.Framework.Color(num3, num3, num3, num3 / 2f), Main.player[index1].flameRingRot + 1.047198f * (float) index2, new Vector2(200f, 200f), scale, SpriteEffects.None, 0.0f); } } } @@ -47899,21 +47714,21 @@ label_623: switch (Main.invasionType) { case 1: - NPC.SetEventFlagCleared(ref NPC.downedGoblins, 0); + NPC.downedGoblins = true; if (Main.netMode == 2) NetMessage.SendData(7); AchievementsHelper.NotifyProgressionEvent(10); break; case 2: - NPC.SetEventFlagCleared(ref NPC.downedFrost, 1); + NPC.downedFrost = true; AchievementsHelper.NotifyProgressionEvent(12); break; case 3: - NPC.SetEventFlagCleared(ref NPC.downedPirates, 2); + NPC.downedPirates = true; AchievementsHelper.NotifyProgressionEvent(11); break; case 4: - NPC.SetEventFlagCleared(ref NPC.downedMartians, 3); + NPC.downedMartians = true; AchievementsHelper.NotifyProgressionEvent(13); break; } @@ -47932,7 +47747,7 @@ label_623: Main.invasionX = (double) Main.spawnTileX; Main.InvasionWarning(); } - else if ((double) dayRate > 0.0) + else --Main.invasionWarn; } else if (Main.invasionX < (double) Main.spawnTileX) @@ -47943,7 +47758,7 @@ label_623: Main.invasionX = (double) Main.spawnTileX; Main.InvasionWarning(); } - else if ((double) dayRate > 0.0) + else --Main.invasionWarn; } if (Main.invasionWarn > 0) @@ -48036,7 +47851,7 @@ label_623: case 2: if (!(localizedText.Value != "")) break; - ChatHelper.BroadcastChatMessage(NetworkText.FromKey(localizedText.Key), new Microsoft.Xna.Framework.Color(175, 75, (int) byte.MaxValue)); + NetMessage.BroadcastChatMessage(NetworkText.FromKey(localizedText.Key), new Microsoft.Xna.Framework.Color(175, 75, (int) byte.MaxValue)); break; } } @@ -48121,7 +47936,7 @@ label_623: private static void UpdateClient() { if (Main.myPlayer == (int) byte.MaxValue) - Netplay.Disconnect = true; + Netplay.disconnect = true; ++Main.netPlayCounter; if (Main.netPlayCounter > 3600) Main.netPlayCounter = 0; @@ -48139,12 +47954,12 @@ label_623: if (!Main.stopTimeOuts && Netplay.Connection.TimeOutTimer > 7200) { Main.statusText = Lang.inter[43].Value; - Netplay.Disconnect = true; + Netplay.disconnect = true; } } for (int whoAmI = 0; whoAmI < 400; ++whoAmI) { - if (Main.item[whoAmI].active && Main.item[whoAmI].playerIndexTheItemIsReservedFor == Main.myPlayer) + if (Main.item[whoAmI].active && Main.item[whoAmI].owner == Main.myPlayer) Main.item[whoAmI].FindOwner(whoAmI); } } @@ -48173,7 +47988,7 @@ label_623: if (number >= 400) number = 0; ++num; - if (!Main.item[number].active || Main.item[number].playerIndexTheItemIsReservedFor == (int) byte.MaxValue) + if (!Main.item[number].active || Main.item[number].owner == (int) byte.MaxValue) NetMessage.SendData(21, number: number); if (num >= Main.maxItemUpdates || number == Main.lastItemUpdate) flag = false; @@ -48182,82 +47997,172 @@ label_623: } for (int whoAmI = 0; whoAmI < 400; ++whoAmI) { - Item obj = Main.item[whoAmI]; - if (obj.active && (obj.playerIndexTheItemIsReservedFor == (int) byte.MaxValue || !Main.player[obj.playerIndexTheItemIsReservedFor].active)) - obj.FindOwner(whoAmI); + if (Main.item[whoAmI].active && (Main.item[whoAmI].owner == (int) byte.MaxValue || !Main.player[Main.item[whoAmI].owner].active)) + Main.item[whoAmI].FindOwner(whoAmI); } for (int playerIndex = 0; playerIndex < (int) byte.MaxValue; ++playerIndex) { if (Netplay.Clients[playerIndex].IsActive) { ++Netplay.Clients[playerIndex].TimeOutTimer; - if (Netplay.Clients[playerIndex].State == 0) - Netplay.Clients[playerIndex].TimeOutTimer += 3; if (!Main.stopTimeOuts && Netplay.Clients[playerIndex].TimeOutTimer > 7200) - { Netplay.Clients[playerIndex].PendingTermination = true; - Netplay.Clients[playerIndex].PendingTerminationApproved = true; - } } if (Main.player[playerIndex].active) RemoteClient.CheckSection(playerIndex, Main.player[playerIndex].position); } } - public static void NewText(string newText, byte R = 255, byte G = 255, byte B = 255) + public static void NewText(string newText, byte R = 255, byte G = 255, byte B = 255, bool force = false) { - Main.chatMonitor.NewText(newText, R, G, B); - SoundEngine.PlaySound(12); + int num1 = 80; + if (!force && newText.Length > num1) + { + string newText1 = newText; + while (newText1.Length > num1) + { + int num2 = num1; + int startIndex = num2; + while (newText1.Substring(startIndex, 1) != " ") + { + --startIndex; + if (startIndex < 1) + break; + } + if (startIndex == 0) + { + while (newText1.Substring(num2, 1) != " ") + { + ++num2; + if (num2 >= newText1.Length - 1) + break; + } + } + else + num2 = startIndex; + if (num2 >= newText1.Length - 1) + num2 = newText1.Length; + Main.NewText(newText1.Substring(0, num2), R, G, B, true); + newText1 = newText1.Substring(num2); + if (newText1.Length > 0) + { + while (newText1.Substring(0, 1) == " ") + newText1 = newText1.Substring(1); + } + } + if (newText1.Length <= 0) + return; + Main.NewText(newText1, R, G, B, true); + } + else + { + for (int index = Main.numChatLines - 1; index > 0; --index) + { + Main.chatLine[index].text = Main.chatLine[index - 1].text; + Main.chatLine[index].parsedText = Main.chatLine[index - 1].parsedText; + Main.chatLine[index].showTime = Main.chatLine[index - 1].showTime; + Main.chatLine[index].color = Main.chatLine[index - 1].color; + } + Main.chatLine[0].color = R != (byte) 0 || G != (byte) 0 || B != (byte) 0 ? new Microsoft.Xna.Framework.Color((int) R, (int) G, (int) B) : Microsoft.Xna.Framework.Color.White; + Main.chatLine[0].text = newText; + Main.chatLine[0].parsedText = ChatManager.ParseMessage(Main.chatLine[0].text, Main.chatLine[0].color).ToArray(); + Main.chatLine[0].showTime = Main.chatLength; + Main.PlaySound(12); + } } public static void NewTextMultiline(string text, bool force = false, Microsoft.Xna.Framework.Color c = default (Microsoft.Xna.Framework.Color), int WidthLimit = -1) { - Main.chatMonitor.NewTextMultiline(text, force, c, WidthLimit); - SoundEngine.PlaySound(12); + if (c == new Microsoft.Xna.Framework.Color()) + c = Microsoft.Xna.Framework.Color.White; + List> textSnippetListList = WidthLimit == -1 ? Utils.WordwrapStringSmart(text, c, Main.fontMouseText, Main.TextMaxLengthForScreen, 10) : Utils.WordwrapStringSmart(text, c, Main.fontMouseText, WidthLimit, 10); + for (int index = 0; index < textSnippetListList.Count; ++index) + Main.NewText(textSnippetListList[index]); } - public static void StopRain() + public static void NewText(List snippets) + { + for (int index = Main.numChatLines - 1; index > 0; --index) + { + Main.chatLine[index].text = Main.chatLine[index - 1].text; + Main.chatLine[index].parsedText = Main.chatLine[index - 1].parsedText; + Main.chatLine[index].showTime = Main.chatLine[index - 1].showTime; + Main.chatLine[index].color = Main.chatLine[index - 1].color; + } + Main.chatLine[0].text = "whatever"; + Main.chatLine[0].parsedText = snippets.ToArray(); + Main.chatLine[0].showTime = Main.chatLength; + Main.PlaySound(12); + } + + public static void NewTextMultilineOld(string text, bool force = false, Microsoft.Xna.Framework.Color c = default (Microsoft.Xna.Framework.Color)) + { + if (c == new Microsoft.Xna.Framework.Color()) + c = Microsoft.Xna.Framework.Color.White; + int lineAmount; + string[] strArray = Utils.WordwrapString(text, Main.fontMouseText, 460, 10, out lineAmount); + for (int index = 0; index <= lineAmount; ++index) + Main.NewText(strArray[index], c.R, c.G, c.B, force); + } + + private static void StopRain() { Main.rainTime = 0; Main.raining = false; Main.maxRaining = 0.0f; } - public static void StartRain() + private static void StartRain() { int maxValue1 = 86400; int maxValue2 = maxValue1 / 24; - int num1 = Main.rand.Next(maxValue2 * 8, maxValue1); + Main.rainTime = Main.rand.Next(maxValue2 * 8, maxValue1); if (Main.rand.Next(3) == 0) - num1 += Main.rand.Next(0, maxValue2); + Main.rainTime += Main.rand.Next(0, maxValue2); if (Main.rand.Next(4) == 0) - num1 += Main.rand.Next(0, maxValue2 * 2); + Main.rainTime += Main.rand.Next(0, maxValue2 * 2); if (Main.rand.Next(5) == 0) - num1 += Main.rand.Next(0, maxValue2 * 2); + Main.rainTime += Main.rand.Next(0, maxValue2 * 2); if (Main.rand.Next(6) == 0) - num1 += Main.rand.Next(0, maxValue2 * 3); + Main.rainTime += Main.rand.Next(0, maxValue2 * 3); if (Main.rand.Next(7) == 0) - num1 += Main.rand.Next(0, maxValue2 * 4); + Main.rainTime += Main.rand.Next(0, maxValue2 * 4); if (Main.rand.Next(8) == 0) - num1 += Main.rand.Next(0, maxValue2 * 5); - float num2 = 1f; + Main.rainTime += Main.rand.Next(0, maxValue2 * 5); + float num = 1f; if (Main.rand.Next(2) == 0) - num2 += 0.05f; + num += 0.05f; if (Main.rand.Next(3) == 0) - num2 += 0.1f; + num += 0.1f; if (Main.rand.Next(4) == 0) - num2 += 0.15f; + num += 0.15f; if (Main.rand.Next(5) == 0) - num2 += 0.2f; - Main.rainTime = (int) ((double) num1 * (double) num2); + num += 0.2f; + Main.rainTime = (int) ((double) Main.rainTime * (double) num); Main.ChangeRain(); Main.raining = true; } private static void ChangeRain() { - float maxRaining = Main.maxRaining; - Main.maxRaining = (double) Main.cloudBGActive >= 1.0 || (double) Main.numClouds > 150.0 ? (Main.rand.Next(3) != 0 ? (float) Main.rand.Next(40, 91) * 0.01f : (float) Main.rand.Next(20, 91) * 0.01f) : ((double) Main.numClouds <= 100.0 ? (Main.rand.Next(3) != 0 ? (float) Main.rand.Next(5, 31) * 0.01f : (float) Main.rand.Next(5, 41) * 0.01f) : (Main.rand.Next(3) != 0 ? (float) Main.rand.Next(20, 61) * 0.01f : (float) Main.rand.Next(10, 71) * 0.01f)); + if ((double) Main.cloudBGActive >= 1.0 || (double) Main.numClouds > 150.0) + { + if (Main.rand.Next(3) == 0) + Main.maxRaining = (float) Main.rand.Next(20, 90) * 0.01f; + else + Main.maxRaining = (float) Main.rand.Next(40, 90) * 0.01f; + } + else if ((double) Main.numClouds > 100.0) + { + if (Main.rand.Next(3) == 0) + Main.maxRaining = (float) Main.rand.Next(10, 70) * 0.01f; + else + Main.maxRaining = (float) Main.rand.Next(20, 60) * 0.01f; + } + else if (Main.rand.Next(3) == 0) + Main.maxRaining = (float) Main.rand.Next(5, 40) * 0.01f; + else + Main.maxRaining = (float) Main.rand.Next(5, 30) * 0.01f; } public static void StartSlimeRain(bool announce = true) @@ -48274,8 +48179,7 @@ label_623: { if (Main.raining) return; - if (Main.slimeRainTime <= 0.0) - Main.slimeRainTime = (double) Main.rand.Next(32400, 54000); + Main.slimeRainTime = (double) Main.rand.Next(32400, 54000); Main.slimeRain = true; Main.slimeRainKillCount = 0; if (Main.netMode == 0) @@ -48332,14 +48236,6 @@ label_623: private static void UpdateTime() { - if (LanternNight.LanternsUp) - { - Main.cloudBGActive = 0.0f; - if (Main.numClouds > 30) - Main.numClouds = 30; - } - if (Main.ladyBugRainBoost > 0) - Main.ladyBugRainBoost -= Main.dayRate; if (Main.pumpkinMoon) { Main.bloodMoon = false; @@ -48363,45 +48259,30 @@ label_623: } if (Main.raining) { - if (!CreativePowerManager.Instance.GetPower().Enabled) + Main.rainTime -= Main.dayRate; + if (Main.dayRate > 0) { - if (LanternNight.LanternsUp) - { + int num = 86400 / Main.dayRate / 24; + if (Main.rainTime <= 0) Main.StopRain(); - } - else - { - Main.rainTime -= Main.dayRate; - if (Main.dayRate > 0) - { - int num = 86400 / Main.dayRate / 24; - if (Main.rainTime <= 0) - Main.StopRain(); - else if (Main.rand.Next(num * 2) == 0) - Main.ChangeRain(); - } - } + else if (Main.rand.Next(num * 2) == 0) + Main.ChangeRain(); } } - else if (!Main.slimeRain && !LanternNight.LanternsUp && !LanternNight.NextNightIsLanternNight) + else if (!Main.slimeRain) { - int maxValue1 = 86400 / (Main.dayRate != 0 ? Main.dayRate : 1); - if (!CreativePowerManager.Instance.GetPower().Enabled) - { - if (Main.rand.Next((int) ((double) maxValue1 * 5.75)) == 0) - Main.StartRain(); - else if ((double) Main.cloudBGActive >= 1.0 && Main.rand.Next((int) ((double) maxValue1 * 4.25)) == 0) - Main.StartRain(); - else if (Main.ladyBugRainBoost > 0 && Main.rand.Next(maxValue1) == 0) - Main.StartRain(); - } + int num = 86400 / (Main.dayRate != 0 ? Main.dayRate : 1); + if (Main.rand.Next((int) ((double) num * 5.5)) == 0) + Main.StartRain(); + else if ((double) Main.cloudBGActive >= 1.0 && Main.rand.Next(num * 4) == 0) + Main.StartRain(); if (!Main.raining && !NPC.BusyWithAnyInvasionOfSorts()) { - int maxValue2 = (int) (1728000.0 / (double) Main.dayRate); + int maxValue = (int) (1728000.0 / (double) Main.dayRate); if (!NPC.downedSlimeKing) - maxValue2 /= 2; + maxValue /= 2; if (Main.hardMode) - maxValue2 = (int) ((double) maxValue2 * 1.5); + maxValue = (int) ((double) maxValue * 1.5); bool flag = false; for (int index = 0; index < (int) byte.MaxValue; ++index) { @@ -48409,8 +48290,8 @@ label_623: flag = true; } if (!flag) - maxValue2 *= 5; - if (Main.dayRate > 0 && maxValue2 > 0 && (flag || Main.expertMode) && Main.rand.Next(maxValue2) == 0) + maxValue *= 5; + if (Main.dayRate > 0 && maxValue > 0 && (flag || Main.expertMode) && Main.rand.Next(maxValue) == 0) Main.StartSlimeRain(); } } @@ -48421,24 +48302,21 @@ label_623: NetMessage.SendData(7); Main.oldMaxRaining = Main.maxRaining; } - Main.UpdateTimeRate(); + Main.UpdateSundial(); Main.time += (double) Main.dayRate; CultistRitual.UpdateTime(); BirthdayParty.UpdateTime(); - LanternNight.UpdateTime(); Sandstorm.UpdateTime(); DD2Event.UpdateTime(); - WorldGen.mysticLogsEvent.UpdateTime(); - Main.PylonSystem.Update(); if (NPC.MoonLordCountdown > 0) { float intensity = MathHelper.Clamp((float) Math.Sin((double) NPC.MoonLordCountdown / 60.0 * 0.5) * 2f, 0.0f, 1f) * (float) (0.75 - 0.5 * ((double) NPC.MoonLordCountdown / 3600.0)); - if (!Terraria.Graphics.Effects.Filters.Scene["MoonLordShake"].IsActive()) - Terraria.Graphics.Effects.Filters.Scene.Activate("MoonLordShake", Main.player[Main.myPlayer].position); - Terraria.Graphics.Effects.Filters.Scene["MoonLordShake"].GetShader().UseIntensity(intensity); + if (!Filters.Scene["MoonLordShake"].IsActive()) + Filters.Scene.Activate("MoonLordShake", Main.player[Main.myPlayer].position); + Filters.Scene["MoonLordShake"].GetShader().UseIntensity(intensity); } - else if (Terraria.Graphics.Effects.Filters.Scene["MoonLordShake"].IsActive()) - Terraria.Graphics.Effects.Filters.Scene.Deactivate("MoonLordShake"); + else if (Filters.Scene["MoonLordShake"].IsActive()) + Filters.Scene.Deactivate("MoonLordShake"); if (NPC.MoonLordCountdown > 0) { --NPC.MoonLordCountdown; @@ -48454,8 +48332,24 @@ label_623: Main.player[Main.myPlayer].CollectTaxes(); } } - if (Main.netMode != 1) - Main.UpdateSlimeRainWarning(); + if (Main.netMode != 1 && Main.slimeWarningTime > 0) + { + --Main.slimeWarningTime; + if (Main.slimeWarningTime <= 0) + { + if (Main.netMode == 0) + { + if (Main.slimeRainTime > 0.0) + Main.NewText(Lang.gen[74].Value, (byte) 50, B: (byte) 130); + else + Main.NewText(Lang.gen[75].Value, (byte) 50, B: (byte) 130); + } + else if (Main.slimeRainTime > 0.0) + NetMessage.BroadcastChatMessage(NetworkText.FromKey(Lang.gen[74].Key), new Microsoft.Xna.Framework.Color(50, (int) byte.MaxValue, 130)); + else + NetMessage.BroadcastChatMessage(NetworkText.FromKey(Lang.gen[75].Key), new Microsoft.Xna.Framework.Color(50, (int) byte.MaxValue, 130)); + } + } if (Main.netMode != 1) { if (NPC.travelNPC) @@ -48480,11 +48374,10 @@ label_623: } NPC.travelNPC = false; } - bool start = Main.ShouldNormalEventsBeAbleToStart(); if (!Main.dayTime) { Main.eclipse = false; - if (!Main.fastForwardTime && !start) + if (!Main.fastForwardTime) { if (WorldGen.spawnEye && Main.netMode != 1 && Main.time > 4860.0) { @@ -48516,364 +48409,260 @@ label_623: { case 1: NPC.SpawnOnPlayer(plr, 134); - goto label_102; + goto label_98; case 2: NPC.SpawnOnPlayer(plr, 125); NPC.SpawnOnPlayer(plr, 126); - goto label_102; + goto label_98; case 3: NPC.SpawnOnPlayer(plr, (int) sbyte.MaxValue); - goto label_102; + goto label_98; default: - goto label_102; + goto label_98; } } } } -label_102: +label_98: WorldGen.spawnHardBoss = 0; } } if (Main.time > 32400.0) - Main.UpdateTime_StartDay(ref start); - Main.HandleMeteorFall(); + { + if (Main.fastForwardTime) + { + Main.fastForwardTime = false; + Main.UpdateSundial(); + } + Main.checkXMas(); + Main.checkHalloween(); + Main.AnglerQuestSwap(); + BirthdayParty.CheckMorning(); + if (Main.invasionDelay > 0) + --Main.invasionDelay; + WorldGen.prioritizedTownNPC = 0; + Main.checkForSpawns = 0; + Main.time = 0.0; + if (Main.bloodMoon && Main.netMode != 1) + AchievementsHelper.NotifyProgressionEvent(5); + Main.bloodMoon = false; + Main.stopMoonEvent(); + Main.dayTime = true; + if (Main.sundialCooldown > 0) + --Main.sundialCooldown; + ++Main.moonPhase; + if (Main.moonPhase >= 8) + Main.moonPhase = 0; + if (Main.netMode == 2) + { + NetMessage.SendData(7); + WorldGen.saveAndPlay(); + } + if (Main.netMode != 1) + { + AchievementsHelper.NotifyProgressionEvent(1); + if (Main.hardMode && NPC.downedMechBossAny && Main.rand.Next(20) == 0) + { + Main.eclipse = true; + AchievementsHelper.NotifyProgressionEvent(2); + if (Main.eclipse) + { + if (Main.netMode == 0) + Main.NewText(Lang.misc[20].Value, (byte) 50, B: (byte) 130); + else if (Main.netMode == 2) + NetMessage.BroadcastChatMessage(Lang.misc[20].ToNetworkText(), new Microsoft.Xna.Framework.Color(50, (int) byte.MaxValue, 130)); + } + if (Main.netMode == 2) + NetMessage.SendData(7); + } + else if (!Main.snowMoon && !Main.pumpkinMoon && !DD2Event.Ongoing) + { + if (WorldGen.shadowOrbSmashed) + { + if (!NPC.downedGoblins) + { + if (Main.rand.Next(3) == 0) + Main.StartInvasion(); + } + else if (Main.hardMode && Main.rand.Next(60) == 0 || !Main.hardMode && Main.rand.Next(30) == 0) + Main.StartInvasion(); + } + if (Main.invasionType == 0 && Main.hardMode && WorldGen.altarCount > 0 && (NPC.downedPirates && Main.rand.Next(50) == 0 || !NPC.downedPirates && Main.rand.Next(30) == 0)) + Main.StartInvasion(3); + } + } + } + if (Main.time <= 16200.0 || !WorldGen.spawnMeteor) + return; + WorldGen.spawnMeteor = false; + WorldGen.dropMeteor(); } else { - WorldGen.spawnHardBoss = 0; - WorldGen.spawnEye = false; Main.bloodMoon = false; Main.stopMoonEvent(); if (Main.time > 54000.0) - Main.UpdateTime_StartNight(ref start); + { + NPC.setFireFlyChance(); + BirthdayParty.CheckNight(); + WorldGen.prioritizedTownNPC = 0; + Main.checkForSpawns = 0; + if (Main.rand.Next(50) == 0 && Main.netMode != 1 && WorldGen.shadowOrbSmashed) + WorldGen.spawnMeteor = true; + if (Main.eclipse && Main.netMode != 1) + AchievementsHelper.NotifyProgressionEvent(3); + Main.eclipse = false; + if (Main.netMode != 1) + AchievementsHelper.NotifyProgressionEvent(0); + if (!Main.fastForwardTime) + { + if (!NPC.downedBoss1 && Main.netMode != 1) + { + bool flag = false; + for (int index = 0; index < (int) byte.MaxValue; ++index) + { + if (Main.player[index].active && Main.player[index].statLifeMax >= 200 && Main.player[index].statDefense > 10) + { + flag = true; + break; + } + } + if (flag && Main.rand.Next(3) == 0) + { + int num = 0; + for (int index = 0; index < 200; ++index) + { + if (Main.npc[index].active && Main.npc[index].townNPC) + ++num; + } + if (num >= 4) + { + WorldGen.spawnEye = true; + switch (Main.netMode) + { + case 0: + Main.NewText(Lang.misc[9].Value, (byte) 50, B: (byte) 130); + break; + case 2: + NetMessage.BroadcastChatMessage(Lang.misc[9].ToNetworkText(), new Microsoft.Xna.Framework.Color(50, (int) byte.MaxValue, 130)); + break; + } + } + } + } + if (Main.netMode != 1 && !Main.pumpkinMoon && !DD2Event.Ongoing && !Main.snowMoon && WorldGen.altarCount > 0 && Main.hardMode && !WorldGen.spawnEye && Main.rand.Next(10) == 0) + { + bool flag = false; + for (int index = 0; index < 200; ++index) + { + if (Main.npc[index].active && Main.npc[index].boss) + flag = true; + } + if (!flag && (!NPC.downedMechBoss1 || !NPC.downedMechBoss2 || !NPC.downedMechBoss3)) + { + for (int index = 0; index < 1000; ++index) + { + int num = Main.rand.Next(3) + 1; + if (num == 1 && !NPC.downedMechBoss1) + { + WorldGen.spawnHardBoss = num; + switch (Main.netMode) + { + case 0: + Main.NewText(Lang.misc[28].Value, (byte) 50, B: (byte) 130); + goto label_178; + case 2: + NetMessage.BroadcastChatMessage(Lang.misc[28].ToNetworkText(), new Microsoft.Xna.Framework.Color(50, (int) byte.MaxValue, 130)); + goto label_178; + default: + goto label_178; + } + } + else if (num == 2 && !NPC.downedMechBoss2) + { + WorldGen.spawnHardBoss = num; + switch (Main.netMode) + { + case 0: + Main.NewText(Lang.misc[29].Value, (byte) 50, B: (byte) 130); + goto label_178; + case 2: + NetMessage.BroadcastChatMessage(Lang.misc[29].ToNetworkText(), new Microsoft.Xna.Framework.Color(50, (int) byte.MaxValue, 130)); + goto label_178; + default: + goto label_178; + } + } + else if (num == 3 && !NPC.downedMechBoss3) + { + WorldGen.spawnHardBoss = num; + switch (Main.netMode) + { + case 0: + Main.NewText(Lang.misc[30].Value, (byte) 50, B: (byte) 130); + goto label_178; + case 2: + NetMessage.BroadcastChatMessage(Lang.misc[30].ToNetworkText(), new Microsoft.Xna.Framework.Color(50, (int) byte.MaxValue, 130)); + goto label_178; + default: + goto label_178; + } + } + } + } + } +label_178: + if (!WorldGen.spawnEye && Main.moonPhase != 4 && Main.rand.Next(9) == 0 && Main.netMode != 1) + { + for (int index = 0; index < (int) byte.MaxValue; ++index) + { + if (Main.player[index].active && Main.player[index].statLifeMax > 120) + { + Main.bloodMoon = true; + break; + } + } + if (Main.bloodMoon) + { + AchievementsHelper.NotifyProgressionEvent(4); + switch (Main.netMode) + { + case 0: + Main.NewText(Lang.misc[8].Value, (byte) 50, B: (byte) 130); + break; + case 2: + NetMessage.BroadcastChatMessage(Lang.misc[8].ToNetworkText(), new Microsoft.Xna.Framework.Color(50, (int) byte.MaxValue, 130)); + break; + } + } + } + } + Main.time = 0.0; + Main.dayTime = false; + if (Main.netMode == 2) + NetMessage.SendData(7); + } Main.UpdateTime_SpawnTownNPCs(); } } - public static void SkipToTime(int timeToSet, bool setIsDayTime) - { - double time = Main.time; - int num = Main.dayTime ? 1 : 0; - while (setIsDayTime != Main.dayTime) - { - bool start = Main.ShouldNormalEventsBeAbleToStart(); - if (Main.dayTime) - Main.UpdateTime_StartNight(ref start); - else - Main.UpdateTime_StartDay(ref start); - } - Main.time = (double) timeToSet; - if (Main.netMode != 2) - return; - NetMessage.TrySendData(7); - } - - public static bool ShouldNormalEventsBeAbleToStart() => NPC.LunarApocalypseIsUp || NPC.AnyNPCs(398) || NPC.MoonLordCountdown > 0 || LanternNight.LanternsUp; - - public static void UpdateTime_StartNight(ref bool stopEvents) - { - NPC.ResetBadgerHatTime(); - NPC.freeCake = false; - Star.NightSetup(); - NPC.setFireFlyChance(); - BirthdayParty.CheckNight(); - LanternNight.CheckNight(); - WorldGen.mysticLogsEvent.StartNight(); - WorldGen.prioritizedTownNPCType = 0; - Main.checkForSpawns = 0; - if (Main.rand.Next(50) == 0 && Main.netMode != 1 && NPC.downedBoss2) - WorldGen.spawnMeteor = true; - if (LanternNight.LanternsUp) - stopEvents = true; - if (Main.eclipse && Main.netMode != 1) - AchievementsHelper.NotifyProgressionEvent(3); - Main.eclipse = false; - if (Main.netMode != 1) - AchievementsHelper.NotifyProgressionEvent(0); - if (!Main.fastForwardTime && !stopEvents) - { - if (!NPC.downedBoss1 && Main.netMode != 1) - { - bool flag = false; - for (int index = 0; index < (int) byte.MaxValue; ++index) - { - if (Main.player[index].active && Main.player[index].statLifeMax >= 200 && Main.player[index].statDefense > 10) - { - flag = true; - break; - } - } - if (flag && Main.rand.Next(3) == 0) - { - int num = 0; - for (int index = 0; index < 200; ++index) - { - if (Main.npc[index].active && Main.npc[index].townNPC) - ++num; - } - if (num >= 4) - { - WorldGen.spawnEye = true; - switch (Main.netMode) - { - case 0: - Main.NewText(Lang.misc[9].Value, (byte) 50, B: (byte) 130); - break; - case 2: - ChatHelper.BroadcastChatMessage(Lang.misc[9].ToNetworkText(), new Microsoft.Xna.Framework.Color(50, (int) byte.MaxValue, 130)); - break; - } - } - } - } - if (Main.netMode != 1 && !Main.pumpkinMoon && !DD2Event.Ongoing && !Main.snowMoon && WorldGen.altarCount > 0 && Main.hardMode && !WorldGen.spawnEye && Main.rand.Next(10) == 0) - { - bool flag = false; - for (int index = 0; index < 200; ++index) - { - if (Main.npc[index].active && Main.npc[index].boss) - flag = true; - } - if (!flag && (!NPC.downedMechBoss1 || !NPC.downedMechBoss2 || !NPC.downedMechBoss3)) - { - for (int index = 0; index < 1000; ++index) - { - int num = Main.rand.Next(3) + 1; - if (num == 1 && !NPC.downedMechBoss1) - { - WorldGen.spawnHardBoss = num; - switch (Main.netMode) - { - case 0: - Main.NewText(Lang.misc[28].Value, (byte) 50, B: (byte) 130); - goto label_47; - case 2: - ChatHelper.BroadcastChatMessage(Lang.misc[28].ToNetworkText(), new Microsoft.Xna.Framework.Color(50, (int) byte.MaxValue, 130)); - goto label_47; - default: - goto label_47; - } - } - else if (num == 2 && !NPC.downedMechBoss2) - { - WorldGen.spawnHardBoss = num; - switch (Main.netMode) - { - case 0: - Main.NewText(Lang.misc[29].Value, (byte) 50, B: (byte) 130); - goto label_47; - case 2: - ChatHelper.BroadcastChatMessage(Lang.misc[29].ToNetworkText(), new Microsoft.Xna.Framework.Color(50, (int) byte.MaxValue, 130)); - goto label_47; - default: - goto label_47; - } - } - else if (num == 3 && !NPC.downedMechBoss3) - { - WorldGen.spawnHardBoss = num; - switch (Main.netMode) - { - case 0: - Main.NewText(Lang.misc[30].Value, (byte) 50, B: (byte) 130); - goto label_47; - case 2: - ChatHelper.BroadcastChatMessage(Lang.misc[30].ToNetworkText(), new Microsoft.Xna.Framework.Color(50, (int) byte.MaxValue, 130)); - goto label_47; - default: - goto label_47; - } - } - } - } - } -label_47: - if (!WorldGen.spawnEye && Main.moonPhase != 4 && Main.rand.Next(9) == 0 && Main.netMode != 1) - { - for (int index = 0; index < (int) byte.MaxValue; ++index) - { - if (Main.player[index].active && Main.player[index].statLifeMax > 120) - { - Main.bloodMoon = true; - break; - } - } - if (Main.bloodMoon) - { - AchievementsHelper.NotifyProgressionEvent(4); - switch (Main.netMode) - { - case 0: - Main.NewText(Lang.misc[8].Value, (byte) 50, B: (byte) 130); - break; - case 2: - ChatHelper.BroadcastChatMessage(Lang.misc[8].ToNetworkText(), new Microsoft.Xna.Framework.Color(50, (int) byte.MaxValue, 130)); - break; - } - } - } - } - Main.time = 0.0; - Main.dayTime = false; - if (Main.netMode != 2) - return; - NetMessage.SendData(7); - } - - public static void UpdateTime_StartDay(ref bool stopEvents) - { - WorldGen.numTreeShakes = 0; - if (Main.fastForwardTime) - { - Main.fastForwardTime = false; - Main.UpdateTimeRate(); - } - Main.AnglerQuestSwap(); - BirthdayParty.CheckMorning(); - LanternNight.CheckMorning(); - if (Main.invasionDelay > 0) - --Main.invasionDelay; - WorldGen.prioritizedTownNPCType = 0; - Main.checkForSpawns = 0; - Main.time = 0.0; - if (Main.bloodMoon && Main.netMode != 1) - AchievementsHelper.NotifyProgressionEvent(5); - Main.bloodMoon = false; - Main.CheckForMoonEventsStartingTemporarySeasons(); - Main.checkXMas(); - Main.checkHalloween(); - Main.stopMoonEvent(); - Main.dayTime = true; - if (Main.sundialCooldown > 0) - --Main.sundialCooldown; - ++Main.moonPhase; - if (Main.moonPhase >= 8) - Main.moonPhase = 0; - if (Main.drunkWorld && Main.netMode != 1) - WorldGen.crimson = !WorldGen.crimson; - if (Main.netMode == 2) - NetMessage.SendData(7); - if (Main.netMode == 1) - return; - AchievementsHelper.NotifyProgressionEvent(1); - if (stopEvents) - return; - if (Main.hardMode && NPC.downedMechBossAny && Main.rand.Next(20) == 0) - { - Main.eclipse = true; - AchievementsHelper.NotifyProgressionEvent(2); - if (Main.eclipse) - { - if (Main.netMode == 0) - Main.NewText(Lang.misc[20].Value, (byte) 50, B: (byte) 130); - else if (Main.netMode == 2) - ChatHelper.BroadcastChatMessage(Lang.misc[20].ToNetworkText(), new Microsoft.Xna.Framework.Color(50, (int) byte.MaxValue, 130)); - } - if (Main.netMode != 2) - return; - NetMessage.SendData(7); - } - else - { - if (Main.snowMoon || Main.pumpkinMoon || DD2Event.Ongoing) - return; - if (WorldGen.shadowOrbSmashed) - { - if (!NPC.downedGoblins) - { - if (Main.rand.Next(3) == 0) - Main.StartInvasion(); - } - else if (Main.hardMode && Main.rand.Next(60) == 0 || !Main.hardMode && Main.rand.Next(30) == 0) - Main.StartInvasion(); - } - if (Main.invasionType != 0 || !Main.hardMode || WorldGen.altarCount <= 0 || (!NPC.downedPirates || Main.rand.Next(60) != 0) && (NPC.downedPirates || Main.rand.Next(30) != 0)) - return; - Main.StartInvasion(3); - } - } - - private static void HandleMeteorFall() - { - if (Main.netMode != 1 && WorldGen.spawnMeteor) - { - if (Main.time < 15000.0) - { - Main._canShowMeteorFall = true; - } - else - { - if (Main._canShowMeteorFall && Main.time <= 16200.0) - Main.AmbienceServer.ForceEntitySpawn(new AmbienceServer.AmbienceSpawnInfo() - { - skyEntityType = SkyEntityType.Meteor, - targetPlayer = -1 - }); - Main._canShowMeteorFall = false; - } - } - if (Main.time <= 16200.0 || !WorldGen.spawnMeteor) - return; - WorldGen.spawnMeteor = false; - WorldGen.dropMeteor(); - } - - private static void UpdateSlimeRainWarning() - { - if (Main.slimeWarningTime <= 0) - return; - --Main.slimeWarningTime; - if (Main.slimeWarningTime > 0) - return; - if (Main.netMode == 0) - { - if (Main.slimeRainTime > 0.0) - Main.NewText(Lang.gen[74].Value, (byte) 50, B: (byte) 130); - else - Main.NewText(Lang.gen[75].Value, (byte) 50, B: (byte) 130); - } - else if (Main.slimeRainTime > 0.0) - ChatHelper.BroadcastChatMessage(NetworkText.FromKey(Lang.gen[74].Key), new Microsoft.Xna.Framework.Color(50, (int) byte.MaxValue, 130)); - else - ChatHelper.BroadcastChatMessage(NetworkText.FromKey(Lang.gen[75].Key), new Microsoft.Xna.Framework.Color(50, (int) byte.MaxValue, 130)); - } - - public static BestiaryUnlockProgressReport GetBestiaryProgressReport() - { - float num1 = 0.0f; - int num2 = 0; - List entries = Main.BestiaryDB.Entries; - for (int index = 0; index < entries.Count; ++index) - { - int num3 = entries[index].UIInfoProvider.GetEntryUICollectionInfo().UnlockState > BestiaryEntryUnlockState.NotKnownAtAll_0 ? 1 : 0; - ++num2; - num1 += (float) num3; - } - return new BestiaryUnlockProgressReport() - { - EntriesTotal = num2, - CompletionAmountTotal = num1 - }; - } - private static void UpdateTime_SpawnTownNPCs() { - int worldUpdateRate = WorldGen.GetWorldUpdateRate(); - if (Main.netMode == 1 || worldUpdateRate <= 0) + if (Main.netMode == 1 || Main.worldRate <= 0) return; ++Main.checkForSpawns; - if (Main.checkForSpawns < 7200 / worldUpdateRate) + if (Main.checkForSpawns < 7200 / Main.worldRate) return; - Main.checkForSpawns = 0; int num1 = 0; for (int index = 0; index < (int) byte.MaxValue; ++index) { if (Main.player[index].active) ++num1; } - for (int index = 0; index < 663; ++index) + for (int index = 0; index < 580; ++index) Main.townNPCCanSpawn[index] = false; - WorldGen.prioritizedTownNPCType = 0; + Main.checkForSpawns = 0; + WorldGen.prioritizedTownNPC = 0; int num2 = 0; int num3 = 0; int num4 = 0; @@ -48899,11 +48688,6 @@ label_47: int num24 = 0; int num25 = 0; int num26 = 0; - int num27 = 0; - int num28 = 0; - int num29 = 0; - int num30 = 0; - int num31 = 0; for (int npc = 0; npc < 200; ++npc) { if (Main.npc[npc].active && Main.npc[npc].townNPC) @@ -48958,59 +48742,53 @@ label_47: ++num24; if (Main.npc[npc].type == 550) ++num25; - if (Main.npc[npc].type == 588) - ++num26; - if (Main.npc[npc].type == 633) - ++num27; - if (Main.npc[npc].type == 637) - ++num28; - if (Main.npc[npc].type == 638) - ++num29; - if (Main.npc[npc].type == 656) - ++num30; - ++num31; + ++num26; } } - if (WorldGen.prioritizedTownNPCType != 0) + if (WorldGen.prioritizedTownNPC != 0) return; - int num32 = 0; + int num27 = 0; bool flag1 = false; - int num33 = 0; + int num28 = 0; bool flag2 = false; bool flag3 = false; bool flag4 = false; - BestiaryUnlockProgressReport bestiaryProgressReport = Main.GetBestiaryProgressReport(); + bool flag5 = false; for (int index1 = 0; index1 < (int) byte.MaxValue; ++index1) { if (Main.player[index1].active) { for (int index2 = 0; index2 < 58; ++index2) { - if (Main.player[index1].inventory[index2] != null && Main.player[index1].inventory[index2].stack > 0) + if (Main.player[index1].inventory[index2] != null & Main.player[index1].inventory[index2].stack > 0) { - if (num32 < 2000000000) + if (num27 < 2000000000) { if (Main.player[index1].inventory[index2].type == 71) - num32 += Main.player[index1].inventory[index2].stack; + num27 += Main.player[index1].inventory[index2].stack; if (Main.player[index1].inventory[index2].type == 72) - num32 += Main.player[index1].inventory[index2].stack * 100; + num27 += Main.player[index1].inventory[index2].stack * 100; if (Main.player[index1].inventory[index2].type == 73) - num32 += Main.player[index1].inventory[index2].stack * 10000; + num27 += Main.player[index1].inventory[index2].stack * 10000; if (Main.player[index1].inventory[index2].type == 74) - num32 += Main.player[index1].inventory[index2].stack * 1000000; + num27 += Main.player[index1].inventory[index2].stack * 1000000; } if (Main.player[index1].inventory[index2].ammo == AmmoID.Bullet || Main.player[index1].inventory[index2].useAmmo == AmmoID.Bullet) flag2 = true; - if (ItemID.Sets.ItemsThatCountAsBombsForDemolitionistToSpawn[Main.player[index1].inventory[index2].type]) + if (Main.player[index1].inventory[index2].type == 166 || Main.player[index1].inventory[index2].type == 167 || Main.player[index1].inventory[index2].type == 168 || Main.player[index1].inventory[index2].type == 235 || Main.player[index1].inventory[index2].type == 2896 || Main.player[index1].inventory[index2].type == 3547) flag3 = true; if (Main.player[index1].inventory[index2].dye > (byte) 0 || Main.player[index1].inventory[index2].type >= 1107 && Main.player[index1].inventory[index2].type <= 1120 || Main.player[index1].inventory[index2].type >= 3385 && Main.player[index1].inventory[index2].type <= 3388) + { + if (Main.player[index1].inventory[index2].type >= 3385 && Main.player[index1].inventory[index2].type <= 3388) + flag5 = true; flag4 = true; + } } } - int num34 = Main.player[index1].statLifeMax / 20; - if (num34 > 5) + int num29 = Main.player[index1].statLifeMax / 20; + if (num29 > 5) flag1 = true; - num33 += num34; + num28 += num29; if (!flag4) { for (int index3 = 0; index3 < 3; ++index3) @@ -49028,12 +48806,12 @@ label_47: Main.npc[index].homeTileX = Main.dungeonX; Main.npc[index].homeTileY = Main.dungeonY; } - bool flag5 = false; + bool flag6 = false; if (Main.rand.Next(40) == 0) - flag5 = true; + flag6 = true; if (num6 < 1) Main.townNPCCanSpawn[22] = true; - if ((double) num32 > 5000.0 && num2 < 1) + if ((double) num27 > 5000.0 && num2 < 1) Main.townNPCCanSpawn[17] = true; if (flag1 && num3 < 1 && num2 > 0) Main.townNPCCanSpawn[18] = true; @@ -49061,7 +48839,7 @@ label_47: Main.townNPCCanSpawn[142] = true; if (NPC.downedMechBossAny && num15 < 1) Main.townNPCCanSpawn[178] = true; - if (flag4 && num16 < 1 && num31 >= 4) + if (flag4 && num16 < 1 && ((NPC.downedBoss1 || NPC.downedBoss2 ? 1 : (NPC.downedBoss3 ? 1 : 0)) | (flag5 ? 1 : 0)) != 0) Main.townNPCCanSpawn[207] = true; if (NPC.downedQueenBee && num20 < 1) Main.townNPCCanSpawn[228] = true; @@ -49071,104 +48849,64 @@ label_47: Main.townNPCCanSpawn[160] = true; if (Main.hardMode && NPC.downedPlantBoss && num18 < 1) Main.townNPCCanSpawn[209] = true; - if (num31 >= 8 && num19 < 1) + if (num26 >= 8 && num19 < 1) Main.townNPCCanSpawn[227] = true; - if (flag5 && num17 < 1 && num31 >= 14) + if (flag6 && num17 < 1 && num26 >= 14) Main.townNPCCanSpawn[208] = true; if (NPC.savedBartender && num25 < 1) Main.townNPCCanSpawn[550] = true; - if (NPC.savedGolfer && num26 < 1) - Main.townNPCCanSpawn[588] = true; - if ((double) bestiaryProgressReport.CompletionPercent >= 0.100000001490116 && num27 < 1) - Main.townNPCCanSpawn[633] = true; - if (NPC.boughtCat && num28 < 1) - Main.townNPCCanSpawn[637] = true; - if (NPC.boughtDog && num29 < 1) - Main.townNPCCanSpawn[638] = true; - if (NPC.boughtBunny && num30 < 1) - Main.townNPCCanSpawn[656] = true; - int num35 = WorldGen.prioritizedTownNPCType; - if (num35 == 0 && NPC.boughtCat && num28 < 1) - num35 = 637; - if (num35 == 0 && NPC.boughtDog && num29 < 1) - num35 = 638; - if (num35 == 0 && NPC.boughtBunny && num30 < 1) - num35 = 656; - if (num35 == 0 && num6 < 1) - num35 = 22; - if (num35 == 0 && (double) num32 > 5000.0 && num2 < 1) - num35 = 17; - if (num35 == 0 & flag1 && num3 < 1 && num2 > 0) - num35 = 18; - if (num35 == 0 & flag2 && num5 < 1) - num35 = 19; - if (num35 == 0 && NPC.savedGoblin && num11 < 1) - num35 = 107; - if (num35 == 0 && NPC.savedTaxCollector && num24 < 1) - num35 = 441; - if (num35 == 0 && NPC.savedWizard && num10 < 1) - num35 = 108; - if (num35 == 0 && Main.hardMode && num14 < 1) - num35 = 160; - if (num35 == 0 && (NPC.downedBoss1 || NPC.downedBoss2 || NPC.downedBoss3) && num4 < 1) - num35 = 20; - if (num35 == 0 & flag3 && num2 > 0 && num8 < 1) - num35 = 38; - if (num35 == 0 && NPC.downedQueenBee && num20 < 1) - num35 = 228; - if (num35 == 0 && NPC.downedMechBossAny && num15 < 1) - num35 = 178; - if (num35 == 0 && NPC.savedMech && num12 < 1) - num35 = 124; - if (num35 == 0 && NPC.savedAngler && num23 < 1) - num35 = 369; - if (num35 == 0 && Main.hardMode && NPC.downedPlantBoss && num18 < 1) - num35 = 209; - if (num35 == 0 && NPC.downedPirates && num21 < 1) - num35 = 229; - if (num35 == 0 && NPC.downedBoss3 && num9 < 1) - num35 = 54; - if (num35 == 0 && NPC.savedStylist && num22 < 1) - num35 = 353; - if (((num35 != 0 ? 0 : (num31 >= 4 ? 1 : 0)) & (flag4 ? 1 : 0)) != 0 && num16 < 1) - num35 = 207; - if (num35 == 0 && num31 >= 8 && num19 < 1) - num35 = 227; - if (num35 == 0 & flag5 && num31 >= 14 && num17 < 1) - num35 = 208; - if (num35 == 0 && NPC.downedFrost && num13 < 1 && Main.xMas) - num35 = 142; - if (num35 == 0 && NPC.savedBartender && num25 < 1) - num35 = 550; - if (num35 == 0 && NPC.savedGolfer && num26 < 1) - num35 = 588; - if (num35 == 0 && (double) bestiaryProgressReport.CompletionPercent >= 0.100000001490116 && num27 < 1) - num35 = 633; - WorldGen.prioritizedTownNPCType = num35; + if (WorldGen.prioritizedTownNPC == 0 && num6 < 1) + WorldGen.prioritizedTownNPC = 22; + if (WorldGen.prioritizedTownNPC == 0 && (double) num27 > 5000.0 && num2 < 1) + WorldGen.prioritizedTownNPC = 17; + if (WorldGen.prioritizedTownNPC == 0 & flag1 && num3 < 1 && num2 > 0) + WorldGen.prioritizedTownNPC = 18; + if (WorldGen.prioritizedTownNPC == 0 & flag2 && num5 < 1) + WorldGen.prioritizedTownNPC = 19; + if (WorldGen.prioritizedTownNPC == 0 && NPC.savedGoblin && num11 < 1) + WorldGen.prioritizedTownNPC = 107; + if (WorldGen.prioritizedTownNPC == 0 && NPC.savedTaxCollector && num24 < 1) + WorldGen.prioritizedTownNPC = 441; + if (WorldGen.prioritizedTownNPC == 0 && NPC.savedWizard && num10 < 1) + WorldGen.prioritizedTownNPC = 108; + if (WorldGen.prioritizedTownNPC == 0 && Main.hardMode && num14 < 1) + WorldGen.prioritizedTownNPC = 160; + if (WorldGen.prioritizedTownNPC == 0 && (NPC.downedBoss1 || NPC.downedBoss2 || NPC.downedBoss3) && num4 < 1) + WorldGen.prioritizedTownNPC = 20; + if (WorldGen.prioritizedTownNPC == 0 & flag3 && num2 > 0 && num8 < 1) + WorldGen.prioritizedTownNPC = 38; + if (WorldGen.prioritizedTownNPC == 0 && NPC.downedQueenBee && num20 < 1) + WorldGen.prioritizedTownNPC = 228; + if (WorldGen.prioritizedTownNPC == 0 && NPC.downedMechBossAny && num15 < 1) + WorldGen.prioritizedTownNPC = 178; + if (WorldGen.prioritizedTownNPC == 0 && NPC.savedMech && num12 < 1) + WorldGen.prioritizedTownNPC = 124; + if (WorldGen.prioritizedTownNPC == 0 && NPC.savedAngler && num23 < 1) + WorldGen.prioritizedTownNPC = 369; + if (WorldGen.prioritizedTownNPC == 0 && Main.hardMode && NPC.downedPlantBoss && num18 < 1) + WorldGen.prioritizedTownNPC = 209; + if (WorldGen.prioritizedTownNPC == 0 && NPC.downedPirates && num21 < 1) + WorldGen.prioritizedTownNPC = 229; + if (WorldGen.prioritizedTownNPC == 0 && NPC.downedBoss3 && num9 < 1) + WorldGen.prioritizedTownNPC = 54; + if (WorldGen.prioritizedTownNPC == 0 && NPC.savedStylist && num22 < 1) + WorldGen.prioritizedTownNPC = 353; + if (WorldGen.prioritizedTownNPC == 0 & flag4 && num16 < 1) + WorldGen.prioritizedTownNPC = 207; + if (WorldGen.prioritizedTownNPC == 0 && num26 >= 8 && num19 < 1) + WorldGen.prioritizedTownNPC = 227; + if (WorldGen.prioritizedTownNPC == 0 & flag6 && num26 >= 14 && num17 < 1) + WorldGen.prioritizedTownNPC = 208; + if (WorldGen.prioritizedTownNPC == 0 && NPC.downedFrost && num13 < 1 && Main.xMas) + WorldGen.prioritizedTownNPC = 142; + if (WorldGen.prioritizedTownNPC != 0 || !NPC.savedBartender || num25 >= 1) + return; + WorldGen.prioritizedTownNPC = 550; } - public static int DamageVar(float dmg, float luck = 0.0f) - { - float num1 = dmg * (float) (1.0 + (double) Main.rand.Next(-15, 16) * 0.00999999977648258); - if ((double) luck > 0.0) - { - if ((double) Main.rand.NextFloat() < (double) luck) - { - float num2 = dmg * (float) (1.0 + (double) Main.rand.Next(-15, 16) * 0.00999999977648258); - if ((double) num2 > (double) num1) - num1 = num2; - } - } - else if ((double) luck < 0.0 && (double) Main.rand.NextFloat() < -(double) luck) - { - float num3 = dmg * (float) (1.0 + (double) Main.rand.Next(-15, 16) * 0.00999999977648258); - if ((double) num3 < (double) num1) - num1 = num3; - } - return (int) Math.Round((double) num1); - } + public static int DamageVar(float dmg) => (int) Math.Round((double) dmg * (1.0 + (double) Main.rand.Next(-15, 16) * 0.00999999977648258)); - public static double CalculateDamageNPCsTake(int Damage, int Defense) + public static double CalculateDamage(int Damage, int Defense) { double num = (double) Damage - (double) Defense * 0.5; if (num < 1.0) @@ -49176,20 +48914,10 @@ label_47: return num; } - public static double CalculateDamagePlayersTakeInPVP(int Damage, int Defense) + public static double CalculatePlayerDamage(int Damage, int Defense) { double num = (double) Damage - (double) Defense * 0.5; - if (num < 1.0) - num = 1.0; - return num; - } - - public static double CalculateDamagePlayersTake(int Damage, int Defense) - { - double num = (double) Damage - (double) Defense * 0.5; - if (Main.masterMode) - num = (double) (Damage - Defense); - else if (Main.expertMode) + if (Main.expertMode) num = (double) Damage - (double) Defense * 0.75; if (num < 1.0) num = 1.0; @@ -49201,17 +48929,610 @@ label_47: switch (eventType) { case TileChangeType.LavaWater: - SoundEngine.PlaySound(SoundID.LiquidsWaterLava, x * 16 + count * 8, y * 16 + count * 8); + Main.PlaySound(SoundID.LiquidsWaterLava, x * 16 + count * 8, y * 16 + count * 8); break; case TileChangeType.HoneyWater: - SoundEngine.PlaySound(SoundID.LiquidsHoneyWater, x * 16 + count * 8, y * 16 + count * 8); + Main.PlaySound(SoundID.LiquidsHoneyWater, x * 16 + count * 8, y * 16 + count * 8); break; case TileChangeType.HoneyLava: - SoundEngine.PlaySound(SoundID.LiquidsHoneyLava, x * 16 + count * 8, y * 16 + count * 8); + Main.PlaySound(SoundID.LiquidsHoneyLava, x * 16 + count * 8, y * 16 + count * 8); break; } } + public static void PlaySound(int type, Vector2 position, int Style = 1) => Main.PlaySound(type, (int) position.X, (int) position.Y, Style); + + public static void PlaySoundInstance(SoundEffectInstance sound) => sound.Play(); + + public static ActiveSound GetActiveSound(SlotId id) => Main._trackedSounds.Has(id) ? Main._trackedSounds[id] : (ActiveSound) null; + + public static SoundEffectInstance PlaySound( + LegacySoundStyle type, + Vector2 position) + { + return type == null ? (SoundEffectInstance) null : Main.PlaySound(type, (int) position.X, (int) position.Y); + } + + public static SoundEffectInstance PlaySound( + LegacySoundStyle type, + int x = -1, + int y = -1) + { + return type == null ? (SoundEffectInstance) null : Main.PlaySound(type.SoundId, x, y, type.Style, type.Volume, type.GetRandomPitch()); + } + + public static void StopTrackedSounds() + { + foreach (SlotVector.ItemPair trackedSound in (IEnumerable.ItemPair>) Main._trackedSounds) + ((ActiveSound) trackedSound.Value).Stop(); + Main._trackedSounds.Clear(); + } + + public static SlotId PlayTrackedSound(SoundStyle style, Vector2 position) + { + if (Main.dedServ || style == null || !style.IsTrackable) + return (SlotId) SlotId.Invalid; + if ((double) Vector2.DistanceSquared(Main.screenPosition + new Vector2((float) (Main.screenWidth / 2), (float) (Main.screenHeight / 2)), position) > 100000000.0) + return (SlotId) SlotId.Invalid; + ActiveSound activeSound = new ActiveSound(style, position); + return Main._trackedSounds.Add(activeSound); + } + + public static SlotId PlayTrackedSound(SoundStyle style) + { + if (Main.dedServ || style == null || !style.IsTrackable) + return (SlotId) SlotId.Invalid; + ActiveSound activeSound = new ActiveSound(style); + return Main._trackedSounds.Add(activeSound); + } + + public static SoundEffectInstance PlaySound( + int type, + int x = -1, + int y = -1, + int Style = 1, + float volumeScale = 1f, + float pitchOffset = 0.0f) + { + int index1 = Style; + try + { + if (Main.dedServ || (double) Main.soundVolume == 0.0 && (type < 30 || type > 35)) + return (SoundEffectInstance) null; + bool flag = false; + float num1 = 1f; + float num2 = 0.0f; + if (x == -1 || y == -1) + { + flag = true; + } + else + { + if (WorldGen.gen || Main.netMode == 2) + return (SoundEffectInstance) null; + Microsoft.Xna.Framework.Rectangle rectangle1 = new Microsoft.Xna.Framework.Rectangle((int) ((double) Main.screenPosition.X - (double) (Main.screenWidth * 2)), (int) ((double) Main.screenPosition.Y - (double) (Main.screenHeight * 2)), Main.screenWidth * 5, Main.screenHeight * 5); + Microsoft.Xna.Framework.Rectangle rectangle2 = new Microsoft.Xna.Framework.Rectangle(x, y, 1, 1); + Vector2 vector2 = new Vector2(Main.screenPosition.X + (float) Main.screenWidth * 0.5f, Main.screenPosition.Y + (float) Main.screenHeight * 0.5f); + if (rectangle2.Intersects(rectangle1)) + flag = true; + if (flag) + { + num2 = (float) (((double) x - (double) vector2.X) / ((double) Main.screenWidth * 0.5)); + double num3 = (double) Math.Abs((float) x - vector2.X); + float num4 = Math.Abs((float) y - vector2.Y); + num1 = (float) (1.0 - Math.Sqrt(num3 * num3 + (double) num4 * (double) num4) / ((double) Main.screenWidth * 1.5)); + } + } + if ((double) num2 < -1.0) + num2 = -1f; + if ((double) num2 > 1.0) + num2 = 1f; + if ((double) num1 > 1.0) + num1 = 1f; + if ((double) num1 <= 0.0 && (type < 34 || type > 35 || type > 39)) + return (SoundEffectInstance) null; + if (flag) + { + float num5 = type >= 30 && type <= 35 || type == 39 ? num1 * (Main.ambientVolume * (Main.gameInactive ? 0.0f : 1f)) : num1 * Main.soundVolume; + if ((double) num5 > 1.0) + num5 = 1f; + if ((double) num5 <= 0.0 && (type < 30 || type > 35) && type != 39) + return (SoundEffectInstance) null; + SoundEffectInstance sound = (SoundEffectInstance) null; + switch (type) + { + case 0: + int index2 = Main.rand.Next(3); + Main.soundInstanceDig[index2].Stop(); + Main.soundInstanceDig[index2] = Main.soundDig[index2].CreateInstance(); + Main.soundInstanceDig[index2].Volume = num5; + Main.soundInstanceDig[index2].Pan = num2; + Main.soundInstanceDig[index2].Pitch = (float) Main.rand.Next(-10, 11) * 0.01f; + sound = Main.soundInstanceDig[index2]; + break; + case 1: + int index3 = Main.rand.Next(3); + Main.soundInstancePlayerHit[index3].Stop(); + Main.soundInstancePlayerHit[index3] = Main.soundPlayerHit[index3].CreateInstance(); + Main.soundInstancePlayerHit[index3].Volume = num5; + Main.soundInstancePlayerHit[index3].Pan = num2; + sound = Main.soundInstancePlayerHit[index3]; + break; + case 2: + if (index1 == 123) + num5 *= 0.5f; + if (index1 == 124 || index1 == 125) + num5 *= 0.65f; + if (index1 == 116) + num5 *= 0.5f; + if (index1 == 1) + { + int num6 = Main.rand.Next(3); + if (num6 == 1) + index1 = 18; + if (num6 == 2) + index1 = 19; + } + else if (index1 == 55 || index1 == 53) + { + num5 *= 0.75f; + if (index1 == 55) + num5 *= 0.75f; + if (Main.soundInstanceItem[index1].State == SoundState.Playing) + return (SoundEffectInstance) null; + } + else if (index1 == 37) + num5 *= 0.5f; + if (index1 != 9 && index1 != 10 && index1 != 24 && index1 != 26 && index1 != 34 && index1 != 43 && index1 != 103) + Main.soundInstanceItem[index1].Stop(); + Main.soundInstanceItem[index1] = Main.soundItem[index1].CreateInstance(); + Main.soundInstanceItem[index1].Volume = num5; + Main.soundInstanceItem[index1].Pan = num2; + Main.soundInstanceItem[index1].Pitch = index1 != 47 ? (index1 != 53 ? (index1 != 55 ? (float) Main.rand.Next(-6, 7) * 0.01f : (float) -Main.rand.Next(-20, -11) * 0.02f) : (float) Main.rand.Next(-20, -11) * 0.02f) : (float) Main.rand.Next(-5, 6) * 0.19f; + if (index1 == 26 || index1 == 35) + { + Main.soundInstanceItem[index1].Volume = num5 * 0.75f; + Main.soundInstanceItem[index1].Pitch = Main.harpNote; + } + sound = Main.soundInstanceItem[index1]; + break; + case 3: + if (index1 >= 20 && index1 <= 54) + num5 *= 0.5f; + if (index1 == 57 && Main.soundInstanceNPCHit[index1].State == SoundState.Playing) + return (SoundEffectInstance) null; + if (index1 == 57) + num5 *= 0.6f; + if (index1 == 55 || index1 == 56) + num5 *= 0.5f; + Main.soundInstanceNPCHit[index1].Stop(); + Main.soundInstanceNPCHit[index1] = Main.soundNPCHit[index1].CreateInstance(); + Main.soundInstanceNPCHit[index1].Volume = num5; + Main.soundInstanceNPCHit[index1].Pan = num2; + Main.soundInstanceNPCHit[index1].Pitch = (float) Main.rand.Next(-10, 11) * 0.01f; + sound = Main.soundInstanceNPCHit[index1]; + break; + case 4: + if (index1 >= 23 && index1 <= 57) + num5 *= 0.5f; + if (index1 == 61) + num5 *= 0.6f; + if (index1 == 62) + num5 *= 0.6f; + if (index1 == 10 && Main.soundInstanceNPCKilled[index1].State == SoundState.Playing) + return (SoundEffectInstance) null; + Main.soundInstanceNPCKilled[index1] = Main.soundNPCKilled[index1].CreateInstance(); + Main.soundInstanceNPCKilled[index1].Volume = num5; + Main.soundInstanceNPCKilled[index1].Pan = num2; + Main.soundInstanceNPCKilled[index1].Pitch = (float) Main.rand.Next(-10, 11) * 0.01f; + sound = Main.soundInstanceNPCKilled[index1]; + break; + case 5: + Main.soundInstancePlayerKilled.Stop(); + Main.soundInstancePlayerKilled = Main.soundPlayerKilled.CreateInstance(); + Main.soundInstancePlayerKilled.Volume = num5; + Main.soundInstancePlayerKilled.Pan = num2; + sound = Main.soundInstancePlayerKilled; + break; + case 6: + Main.soundInstanceGrass.Stop(); + Main.soundInstanceGrass = Main.soundGrass.CreateInstance(); + Main.soundInstanceGrass.Volume = num5; + Main.soundInstanceGrass.Pan = num2; + Main.soundInstanceGrass.Pitch = (float) Main.rand.Next(-30, 31) * 0.01f; + sound = Main.soundInstanceGrass; + break; + case 7: + Main.soundInstanceGrab.Stop(); + Main.soundInstanceGrab = Main.soundGrab.CreateInstance(); + Main.soundInstanceGrab.Volume = num5; + Main.soundInstanceGrab.Pan = num2; + Main.soundInstanceGrab.Pitch = (float) Main.rand.Next(-10, 11) * 0.01f; + sound = Main.soundInstanceGrab; + break; + case 8: + Main.soundInstanceDoorOpen.Stop(); + Main.soundInstanceDoorOpen = Main.soundDoorOpen.CreateInstance(); + Main.soundInstanceDoorOpen.Volume = num5; + Main.soundInstanceDoorOpen.Pan = num2; + Main.soundInstanceDoorOpen.Pitch = (float) Main.rand.Next(-20, 21) * 0.01f; + sound = Main.soundInstanceDoorOpen; + break; + case 9: + Main.soundInstanceDoorClosed.Stop(); + Main.soundInstanceDoorClosed = Main.soundDoorClosed.CreateInstance(); + Main.soundInstanceDoorClosed.Volume = num5; + Main.soundInstanceDoorClosed.Pan = num2; + Main.soundInstanceDoorOpen.Pitch = (float) Main.rand.Next(-20, 21) * 0.01f; + sound = Main.soundInstanceDoorClosed; + break; + case 10: + Main.soundInstanceMenuOpen.Stop(); + Main.soundInstanceMenuOpen = Main.soundMenuOpen.CreateInstance(); + Main.soundInstanceMenuOpen.Volume = num5; + Main.soundInstanceMenuOpen.Pan = num2; + sound = Main.soundInstanceMenuOpen; + break; + case 11: + Main.soundInstanceMenuClose.Stop(); + Main.soundInstanceMenuClose = Main.soundMenuClose.CreateInstance(); + Main.soundInstanceMenuClose.Volume = num5; + Main.soundInstanceMenuClose.Pan = num2; + sound = Main.soundInstanceMenuClose; + break; + case 12: + Main.soundInstanceMenuTick.Stop(); + Main.soundInstanceMenuTick = Main.soundMenuTick.CreateInstance(); + Main.soundInstanceMenuTick.Volume = num5; + Main.soundInstanceMenuTick.Pan = num2; + sound = Main.soundInstanceMenuTick; + break; + case 13: + Main.soundInstanceShatter.Stop(); + Main.soundInstanceShatter = Main.soundShatter.CreateInstance(); + Main.soundInstanceShatter.Volume = num5; + Main.soundInstanceShatter.Pan = num2; + sound = Main.soundInstanceShatter; + break; + case 14: + switch (Style) + { + case 489: + int index4 = Main.rand.Next(21, 24); + Main.soundInstanceZombie[index4] = Main.soundZombie[index4].CreateInstance(); + Main.soundInstanceZombie[index4].Volume = num5 * 0.4f; + Main.soundInstanceZombie[index4].Pan = num2; + sound = Main.soundInstanceZombie[index4]; + break; + case 542: + int index5 = 7; + Main.soundInstanceZombie[index5] = Main.soundZombie[index5].CreateInstance(); + Main.soundInstanceZombie[index5].Volume = num5 * 0.4f; + Main.soundInstanceZombie[index5].Pan = num2; + sound = Main.soundInstanceZombie[index5]; + break; + default: + int index6 = Main.rand.Next(3); + Main.soundInstanceZombie[index6] = Main.soundZombie[index6].CreateInstance(); + Main.soundInstanceZombie[index6].Volume = num5 * 0.4f; + Main.soundInstanceZombie[index6].Pan = num2; + sound = Main.soundInstanceZombie[index6]; + break; + } + break; + case 15: + float num7 = 1f; + if (index1 == 4) + { + index1 = 1; + num7 = 0.25f; + } + if (Main.soundInstanceRoar[index1].State == SoundState.Stopped) + { + Main.soundInstanceRoar[index1] = Main.soundRoar[index1].CreateInstance(); + Main.soundInstanceRoar[index1].Volume = num5 * num7; + Main.soundInstanceRoar[index1].Pan = num2; + sound = Main.soundInstanceRoar[index1]; + break; + } + break; + case 16: + Main.soundInstanceDoubleJump.Stop(); + Main.soundInstanceDoubleJump = Main.soundDoubleJump.CreateInstance(); + Main.soundInstanceDoubleJump.Volume = num5; + Main.soundInstanceDoubleJump.Pan = num2; + Main.soundInstanceDoubleJump.Pitch = (float) Main.rand.Next(-10, 11) * 0.01f; + sound = Main.soundInstanceDoubleJump; + break; + case 17: + Main.soundInstanceRun.Stop(); + Main.soundInstanceRun = Main.soundRun.CreateInstance(); + Main.soundInstanceRun.Volume = num5; + Main.soundInstanceRun.Pan = num2; + Main.soundInstanceRun.Pitch = (float) Main.rand.Next(-10, 11) * 0.01f; + sound = Main.soundInstanceRun; + break; + case 18: + Main.soundInstanceCoins = Main.soundCoins.CreateInstance(); + Main.soundInstanceCoins.Volume = num5; + Main.soundInstanceCoins.Pan = num2; + sound = Main.soundInstanceCoins; + break; + case 19: + if (Main.soundInstanceSplash[index1].State == SoundState.Stopped) + { + Main.soundInstanceSplash[index1] = Main.soundSplash[index1].CreateInstance(); + Main.soundInstanceSplash[index1].Volume = num5; + Main.soundInstanceSplash[index1].Pan = num2; + Main.soundInstanceSplash[index1].Pitch = (float) Main.rand.Next(-10, 11) * 0.01f; + sound = Main.soundInstanceSplash[index1]; + break; + } + break; + case 20: + int index7 = Main.rand.Next(3); + Main.soundInstanceFemaleHit[index7].Stop(); + Main.soundInstanceFemaleHit[index7] = Main.soundFemaleHit[index7].CreateInstance(); + Main.soundInstanceFemaleHit[index7].Volume = num5; + Main.soundInstanceFemaleHit[index7].Pan = num2; + sound = Main.soundInstanceFemaleHit[index7]; + break; + case 21: + int index8 = Main.rand.Next(3); + Main.soundInstanceTink[index8].Stop(); + Main.soundInstanceTink[index8] = Main.soundTink[index8].CreateInstance(); + Main.soundInstanceTink[index8].Volume = num5; + Main.soundInstanceTink[index8].Pan = num2; + sound = Main.soundInstanceTink[index8]; + break; + case 22: + Main.soundInstanceUnlock.Stop(); + Main.soundInstanceUnlock = Main.soundUnlock.CreateInstance(); + Main.soundInstanceUnlock.Volume = num5; + Main.soundInstanceUnlock.Pan = num2; + sound = Main.soundInstanceUnlock; + break; + case 23: + Main.soundInstanceDrown.Stop(); + Main.soundInstanceDrown = Main.soundDrown.CreateInstance(); + Main.soundInstanceDrown.Volume = num5; + Main.soundInstanceDrown.Pan = num2; + sound = Main.soundInstanceDrown; + break; + case 24: + Main.soundInstanceChat = Main.soundChat.CreateInstance(); + Main.soundInstanceChat.Volume = num5; + Main.soundInstanceChat.Pan = num2; + sound = Main.soundInstanceChat; + break; + case 25: + Main.soundInstanceMaxMana = Main.soundMaxMana.CreateInstance(); + Main.soundInstanceMaxMana.Volume = num5; + Main.soundInstanceMaxMana.Pan = num2; + sound = Main.soundInstanceMaxMana; + break; + case 26: + int index9 = Main.rand.Next(3, 5); + Main.soundInstanceZombie[index9] = Main.soundZombie[index9].CreateInstance(); + Main.soundInstanceZombie[index9].Volume = num5 * 0.9f; + Main.soundInstanceZombie[index9].Pan = num2; + Main.soundInstanceZombie[index9].Pitch = (float) Main.rand.Next(-10, 11) * 0.01f; + sound = Main.soundInstanceZombie[index9]; + break; + case 27: + if (Main.soundInstancePixie.State == SoundState.Playing) + { + Main.soundInstancePixie.Volume = num5; + Main.soundInstancePixie.Pan = num2; + Main.soundInstancePixie.Pitch = (float) Main.rand.Next(-10, 11) * 0.01f; + return (SoundEffectInstance) null; + } + Main.soundInstancePixie.Stop(); + Main.soundInstancePixie = Main.soundPixie.CreateInstance(); + Main.soundInstancePixie.Volume = num5; + Main.soundInstancePixie.Pan = num2; + Main.soundInstancePixie.Pitch = (float) Main.rand.Next(-10, 11) * 0.01f; + sound = Main.soundInstancePixie; + break; + case 28: + if (Main.soundInstanceMech[index1].State == SoundState.Playing) + return (SoundEffectInstance) null; + Main.soundInstanceMech[index1] = Main.soundMech[index1].CreateInstance(); + Main.soundInstanceMech[index1].Volume = num5; + Main.soundInstanceMech[index1].Pan = num2; + Main.soundInstanceMech[index1].Pitch = (float) Main.rand.Next(-10, 11) * 0.01f; + sound = Main.soundInstanceMech[index1]; + break; + case 29: + if (index1 >= 24 && index1 <= 87) + num5 *= 0.5f; + if (index1 >= 88 && index1 <= 91) + num5 *= 0.7f; + if (index1 >= 93 && index1 <= 99) + num5 *= 0.4f; + if (index1 == 92) + num5 *= 0.5f; + if (index1 == 103) + num5 *= 0.4f; + if (index1 == 104) + num5 *= 0.55f; + if (index1 == 100 || index1 == 101) + num5 *= 0.25f; + if (index1 == 102) + num5 *= 0.4f; + if (Main.soundInstanceZombie[index1].State == SoundState.Playing) + return (SoundEffectInstance) null; + Main.soundInstanceZombie[index1] = Main.soundZombie[index1].CreateInstance(); + Main.soundInstanceZombie[index1].Volume = num5; + Main.soundInstanceZombie[index1].Pan = num2; + Main.soundInstanceZombie[index1].Pitch = (float) Main.rand.Next(-10, 11) * 0.01f; + sound = Main.soundInstanceZombie[index1]; + break; + case 30: + int index10 = Main.rand.Next(10, 12); + if (Main.rand.Next(300) == 0) + { + index10 = 12; + if (Main.soundInstanceZombie[index10].State == SoundState.Playing) + return (SoundEffectInstance) null; + } + Main.soundInstanceZombie[index10] = Main.soundZombie[index10].CreateInstance(); + Main.soundInstanceZombie[index10].Volume = num5 * 0.75f; + Main.soundInstanceZombie[index10].Pan = num2; + Main.soundInstanceZombie[index10].Pitch = index10 == 12 ? (float) Main.rand.Next(-40, 21) * 0.01f : (float) Main.rand.Next(-70, 1) * 0.01f; + sound = Main.soundInstanceZombie[index10]; + break; + case 31: + int index11 = 13; + Main.soundInstanceZombie[index11] = Main.soundZombie[index11].CreateInstance(); + Main.soundInstanceZombie[index11].Volume = num5 * 0.35f; + Main.soundInstanceZombie[index11].Pan = num2; + Main.soundInstanceZombie[index11].Pitch = (float) Main.rand.Next(-40, 21) * 0.01f; + sound = Main.soundInstanceZombie[index11]; + break; + case 32: + if (Main.soundInstanceZombie[index1].State == SoundState.Playing) + return (SoundEffectInstance) null; + Main.soundInstanceZombie[index1] = Main.soundZombie[index1].CreateInstance(); + Main.soundInstanceZombie[index1].Volume = num5 * 0.15f; + Main.soundInstanceZombie[index1].Pan = num2; + Main.soundInstanceZombie[index1].Pitch = (float) Main.rand.Next(-70, 26) * 0.01f; + sound = Main.soundInstanceZombie[index1]; + break; + case 33: + int index12 = 15; + if (Main.soundInstanceZombie[index12].State == SoundState.Playing) + return (SoundEffectInstance) null; + Main.soundInstanceZombie[index12] = Main.soundZombie[index12].CreateInstance(); + Main.soundInstanceZombie[index12].Volume = num5 * 0.2f; + Main.soundInstanceZombie[index12].Pan = num2; + Main.soundInstanceZombie[index12].Pitch = (float) Main.rand.Next(-10, 31) * 0.01f; + sound = Main.soundInstanceZombie[index12]; + break; + case 34: + float num8 = (float) index1 / 50f; + if ((double) num8 > 1.0) + num8 = 1f; + float num9 = num5 * num8 * 0.2f; + if ((double) num9 <= 0.0 || x == -1 || y == -1) + { + if (Main.soundInstanceLiquid[0].State == SoundState.Playing) + { + Main.soundInstanceLiquid[0].Stop(); + break; + } + break; + } + if (Main.soundInstanceLiquid[0].State == SoundState.Playing) + { + Main.soundInstanceLiquid[0].Volume = num9; + Main.soundInstanceLiquid[0].Pan = num2; + Main.soundInstanceLiquid[0].Pitch = -0.2f; + break; + } + Main.soundInstanceLiquid[0] = Main.soundLiquid[0].CreateInstance(); + Main.soundInstanceLiquid[0].Volume = num9; + Main.soundInstanceLiquid[0].Pan = num2; + sound = Main.soundInstanceLiquid[0]; + break; + case 35: + float num10 = (float) index1 / 50f; + if ((double) num10 > 1.0) + num10 = 1f; + float num11 = num5 * num10 * 0.65f; + if ((double) num11 <= 0.0 || x == -1 || y == -1) + { + if (Main.soundInstanceLiquid[1].State == SoundState.Playing) + { + Main.soundInstanceLiquid[1].Stop(); + break; + } + break; + } + if (Main.soundInstanceLiquid[1].State == SoundState.Playing) + { + Main.soundInstanceLiquid[1].Volume = num11; + Main.soundInstanceLiquid[1].Pan = num2; + Main.soundInstanceLiquid[1].Pitch = -0.0f; + break; + } + Main.soundInstanceLiquid[1] = Main.soundLiquid[1].CreateInstance(); + Main.soundInstanceLiquid[1].Volume = num11; + Main.soundInstanceLiquid[1].Pan = num2; + sound = Main.soundInstanceLiquid[1]; + break; + case 36: + int index13 = Style; + if (Style == -1) + index13 = 0; + Main.soundInstanceRoar[index13] = Main.soundRoar[index13].CreateInstance(); + Main.soundInstanceRoar[index13].Volume = num5; + Main.soundInstanceRoar[index13].Pan = num2; + if (Style == -1) + Main.soundInstanceRoar[index13].Pitch += 0.6f; + sound = Main.soundInstanceRoar[index13]; + break; + case 37: + int index14 = Main.rand.Next(57, 59); + float num12 = num5 * ((float) Style * 0.05f); + Main.soundInstanceItem[index14] = Main.soundItem[index14].CreateInstance(); + Main.soundInstanceItem[index14].Volume = num12; + Main.soundInstanceItem[index14].Pan = num2; + Main.soundInstanceItem[index14].Pitch = (float) Main.rand.Next(-40, 41) * 0.01f; + sound = Main.soundInstanceItem[index14]; + break; + case 38: + int index15 = Main.rand.Next(5); + Main.soundInstanceCoin[index15] = Main.soundCoin[index15].CreateInstance(); + Main.soundInstanceCoin[index15].Volume = num5; + Main.soundInstanceCoin[index15].Pan = num2; + Main.soundInstanceCoin[index15].Pitch = (float) Main.rand.Next(-40, 41) * (1f / 500f); + sound = Main.soundInstanceCoin[index15]; + break; + case 39: + int index16 = Style; + Main.soundInstanceDrip[index16] = Main.soundDrip[index16].CreateInstance(); + Main.soundInstanceDrip[index16].Volume = num5 * 0.5f; + Main.soundInstanceDrip[index16].Pan = num2; + Main.soundInstanceDrip[index16].Pitch = (float) Main.rand.Next(-30, 31) * 0.01f; + sound = Main.soundInstanceDrip[index16]; + break; + case 40: + Main.soundInstanceCamera.Stop(); + Main.soundInstanceCamera = Main.soundCamera.CreateInstance(); + Main.soundInstanceCamera.Volume = num5; + Main.soundInstanceCamera.Pan = num2; + sound = Main.soundInstanceCamera; + break; + case 41: + Main.soundInstanceMoonlordCry = Main.soundNPCKilled[10].CreateInstance(); + Main.soundInstanceMoonlordCry.Volume = (float) (1.0 / (1.0 + (double) (new Vector2((float) x, (float) y) - Main.player[Main.myPlayer].position).Length())); + Main.soundInstanceMoonlordCry.Pan = num2; + Main.soundInstanceMoonlordCry.Pitch = (float) Main.rand.Next(-10, 11) * 0.01f; + sound = Main.soundInstanceMoonlordCry; + break; + case 42: + sound = Main.trackableSounds[index1].CreateInstance(); + sound.Volume = num5; + sound.Pan = num2; + Main.trackableSoundInstances[index1] = sound; + break; + } + if (sound != null) + { + sound.Pitch += pitchOffset; + sound.Volume *= volumeScale; + Main.PlaySoundInstance(sound); + } + return sound; + } + } + catch + { + } + return (SoundEffectInstance) null; + } + public static void ClearPendingPlayerSelectCallbacks() => Main._pendingCharacterSelect = (Main.OnPlayerSelected) null; public static void SelectPlayer(PlayerFileData data) @@ -49225,7 +49546,7 @@ label_47: { Main.ServerSideCharacter = false; data.SetAsActive(); - SoundEngine.PlaySound(10); + Main.PlaySound(10); if (Main.autoJoin) { if (Netplay.SetRemoteIP(Main.getIP)) @@ -49253,7 +49574,7 @@ label_47: data.SetAsActive(); Main.player[Main.myPlayer].position = Vector2.Zero; Main.LoadWorlds(); - SoundEngine.PlaySound(10); + Main.PlaySound(10); Main.menuMode = 6; } } @@ -49266,6 +49587,8 @@ label_47: public static void SetDisplayMode(int width, int height, bool fullscreen) { + if (Main.graphics.IsFullScreen != fullscreen) + Main.graphics.ToggleFullScreen(); Main.screenMaximized = ((Form) Control.FromHandle(Main.instance.Window.Handle)).WindowState == FormWindowState.Maximized; if (Main.screenBorderless && Main.screenMaximized && !Main.graphics.IsFullScreen) { @@ -49274,14 +49597,21 @@ label_47: } Form form = (Form) Control.FromHandle(Main.instance.Window.Handle); bool flag1 = form.FormBorderStyle == FormBorderStyle.None; + if (!Main.instance.IsActive && (Main.screenBorderless || Main.screenMaximized || Main.graphics.IsFullScreen)) + return; bool flag2 = false; int num1; int num2; - if (((Main.screenBorderless || Main.screenMaximized ? 1 : (Main.graphics.IsFullScreen ? 1 : 0)) | (fullscreen ? 1 : 0)) != 0) + if (Main.screenBorderless || Main.screenMaximized || Main.graphics.IsFullScreen) { form.MinimumSize = new Size(0, 0); - if (!fullscreen) - Main.SetDisplayModeAsBorderless(ref width, ref height, form); + if (Main.screenBorderless && !Main.graphics.IsFullScreen && Main.screenBorderlessPendingResizes > 0) + { + --Main.screenBorderlessPendingResizes; + System.Drawing.Rectangle bounds = Screen.FromPoint(form.Location).Bounds; + width = bounds.Width; + height = bounds.Height; + } if (width > Main.maxScreenW) { double num3 = (double) height / (double) width; @@ -49296,7 +49626,6 @@ label_47: double num6 = (double) height; width = (int) (num5 * num6); } - PlayerInput.RawMouseScale = new Vector2((float) width / (float) Main.instance.Window.ClientBounds.Width, (float) height / (float) Main.instance.Window.ClientBounds.Height); if (!Main.graphics.IsFullScreen) { num1 = Math.Max(Main.graphics.PreferredBackBufferWidth, Main.graphics.GraphicsDevice.Viewport.Width); @@ -49312,7 +49641,6 @@ label_47: } else { - PlayerInput.RawMouseScale = Vector2.One; form.MinimumSize = new Size(Main.minScreenW, Main.minScreenH); if (flag1) { @@ -49321,19 +49649,19 @@ label_47: } width = Math.Min(width, Main.maxScreenW); height = Math.Min(height, Main.maxScreenH); - Viewport viewport = Main.graphics.GraphicsDevice.Viewport; - num1 = viewport.Width; - viewport = Main.graphics.GraphicsDevice.Viewport; - num2 = viewport.Height; + Viewport viewport1 = Main.graphics.GraphicsDevice.Viewport; + num1 = viewport1.Width; + viewport1 = Main.graphics.GraphicsDevice.Viewport; + num2 = viewport1.Height; int preferredBackBufferWidth = Main.graphics.PreferredBackBufferWidth; - viewport = Main.graphics.GraphicsDevice.Viewport; - int width1 = viewport.Width; + Viewport viewport2 = Main.graphics.GraphicsDevice.Viewport; + int width1 = viewport2.Width; int num7; if (preferredBackBufferWidth == width1) { int backBufferHeight = Main.graphics.PreferredBackBufferHeight; - viewport = Main.graphics.GraphicsDevice.Viewport; - int height1 = viewport.Height; + viewport2 = Main.graphics.GraphicsDevice.Viewport; + int height1 = viewport2.Height; num7 = backBufferHeight != height1 ? 1 : 0; } else @@ -49361,13 +49689,6 @@ label_47: height &= 2147483646; width = Math.Max(width, Main.minScreenW); height = Math.Max(height, Main.minScreenH); - if (Main.graphics.IsFullScreen != fullscreen) - { - Main.graphics.PreferredBackBufferWidth = width; - Main.graphics.PreferredBackBufferHeight = height; - Main.graphics.ApplyChanges(); - Main.graphics.ToggleFullScreen(); - } if (((width != num1 ? 1 : (height != num2 ? 1 : 0)) | (flag2 ? 1 : 0)) != 0) { Main.mapTime = 0; @@ -49387,23 +49708,28 @@ label_47: PlayerInput.CacheOriginalScreenDimensions(); if (!fullscreen) { + form.SendToBack(); + form.BringToFront(); if (Main.screenBorderless) { - Main.ApplyBorderlessResolution(form); - form.FormBorderStyle = FormBorderStyle.None; + if (Main.screenBorderlessPendingResizes > 0) + { + --Main.screenBorderlessPendingResizes; + System.Drawing.Rectangle bounds = Screen.FromPoint(form.Location).Bounds; + form.Location = new System.Drawing.Point(bounds.X, bounds.Y); + form.Width = bounds.Width; + form.Height = bounds.Height; + form.FormBorderStyle = FormBorderStyle.None; + } } else form.FormBorderStyle = FormBorderStyle.Sizable; - form.SendToBack(); - form.BringToFront(); } - Lighting.Initialize(); + Lighting.Initialize(true); if (!Main.drawToScreen) Main.instance.InitTargets(); UserInterface.ActiveInstance.Recalculate(); - Main.instance._needsMenuUIRecalculation = true; Console.WriteLine(Language.GetTextValue("Misc.ResolutionChanged", (object) width, (object) height)); - Main.chatMonitor.OnResolutionChange(); } if (Main.graphics.SynchronizeWithVerticalRetrace) return; @@ -49413,26 +49739,18 @@ label_47: public static void FixUIScale() => Main.UIScale = Main.UIScaleWanted; - public void FullscreenStartup() - { - Main.startFullscreen = false; - int preferredBackBufferWidth = Main.graphics.PreferredBackBufferWidth; - int backBufferHeight = Main.graphics.PreferredBackBufferHeight; - Main.Configuration.Get("DisplayWidth", ref preferredBackBufferWidth); - Main.Configuration.Get("DisplayHeight", ref backBufferHeight); - Main.SetDisplayMode(preferredBackBufferWidth, backBufferHeight, true); - } - public void UpdateDisplaySettings() { - if (Main.startFullscreen) - this.FullscreenStartup(); - Main.SetResolution(this.GraphicsDevice.Viewport.Width, this.GraphicsDevice.Viewport.Height); + Viewport viewport = this.GraphicsDevice.Viewport; + int width = viewport.Width; + viewport = this.GraphicsDevice.Viewport; + int height = viewport.Height; + Main.SetResolution(width, height); } public static void OpenPlayerSelect(Main.OnPlayerSelected method) { - if (Main.gameMenu && (Main.menuMode == 10 || Main.menuMode == 14) || WorldGen.gen) + if (Main.gameMenu && (Main.menuMode == 10 || Main.menuMode == 14)) return; if (!Main.gameMenu) { @@ -49465,89 +49783,6 @@ label_47: Main._hasPendingNetmodeChange = true; } - public static void WeGameRequireExitGame() => Main._WeGameReqExit = true; - public delegate void OnPlayerSelected(PlayerFileData player); - - public static class CurrentFrameFlags - { - public static int ActivePlayersCount; - public static int SleepingPlayersCount; - public static bool AnyActiveBossNPC; - public static bool HadAnActiveInteractibleProjectile; - } - - public enum WorldPreparationState - { - AwaitingData, - ProcessingData, - Ready, - } - - internal static class NativeMethods - { - public const uint ES_CONTINUOUS = 2147483648; - public const uint ES_SYSTEM_REQUIRED = 1; - - [DllImport("kernel32.dll")] - public static extern uint SetThreadExecutionState(uint esFlags); - } - - private struct MouseTextCache - { - public bool noOverride; - public bool isValid; - public string cursorText; - public int rare; - public byte diff; - public int X; - public int Y; - public int hackedScreenWidth; - public int hackedScreenHeight; - public string buffTooltip; - } - - protected class TextDisplayCache - { - private string _originalText; - private int _lastScreenWidth; - private int _lastScreenHeight; - - public string[] TextLines { get; private set; } - - public int AmountOfLines { get; private set; } - - public void PrepareCache(string text) - { - if ((0 | (Main.screenWidth != this._lastScreenWidth ? 1 : 0) | (Main.screenHeight != this._lastScreenHeight ? 1 : 0) | (this._originalText != text ? 1 : 0)) == 0) - return; - this._lastScreenWidth = Main.screenWidth; - this._lastScreenHeight = Main.screenHeight; - this._originalText = text; - int lineAmount; - this.TextLines = Utils.WordwrapString(Main.npcChatText, FontAssets.MouseText.Value, 460, 10, out lineAmount); - this.AmountOfLines = lineAmount; - } - } - - public struct SceneArea - { - public Vector2 SceneLocalScreenPositionOffset; - public float totalWidth; - public float totalHeight; - public int bgTopY; - } - - public struct InfoToSetBackColor - { - public bool isInGameMenuOrIsServer; - public float CorruptionBiomeInfluence; - public float CrimsonBiomeInfluence; - public float JungleBiomeInfluence; - public float MushroomBiomeInfluence; - public float GraveyardInfluence; - public bool BloodMoonActive; - public bool LanternNightActive; - } } } diff --git a/Map/IMapLayer.cs b/Map/IMapLayer.cs deleted file mode 100644 index a2cb0c8..0000000 --- a/Map/IMapLayer.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Map.IMapLayer -// 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.Map -{ - public interface IMapLayer - { - void Draw(ref MapOverlayDrawContext context, ref string text); - } -} diff --git a/Map/MapHelper.cs b/Map/MapHelper.cs index 66c0ac8..7ba1d87 100644 --- a/Map/MapHelper.cs +++ b/Map/MapHelper.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Map.MapHelper -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Ionic.Zlib; @@ -9,7 +9,6 @@ using Microsoft.Xna.Framework; using System; using System.Diagnostics; using System.IO; -using System.Threading; using Terraria.IO; using Terraria.Social; using Terraria.Utilities; @@ -37,7 +36,8 @@ namespace Terraria.Map public static int numUpdateTile = 0; public static short[] updateTileX = new short[MapHelper.maxUpdateTile]; public static short[] updateTileY = new short[MapHelper.maxUpdateTile]; - private static object IOLock = new object(); + private static bool saveLock = false; + private static object padlock = new object(); public static int[] tileOptionCounts; public static int[] wallOptionCounts; public static ushort[] tileLookup; @@ -53,48 +53,15 @@ namespace Terraria.Map private static ushort[] snowTypes; private static ushort wallRangeStart; private static ushort wallRangeEnd; - public static bool noStatusText = false; public static void Initialize() { - Color[][] colorArray1 = new Color[623][]; - for (int index = 0; index < 623; ++index) + Color[][] colorArray1 = new Color[470][]; + for (int index = 0; index < 470; ++index) colorArray1[index] = new Color[12]; - colorArray1[621][0] = new Color(250, 250, 250); - colorArray1[622][0] = new Color(235, 235, 249); - colorArray1[518][0] = new Color(26, 196, 84); - colorArray1[518][1] = new Color(48, 208, 234); - colorArray1[518][2] = new Color(135, 196, 26); - colorArray1[519][0] = new Color(28, 216, 109); - colorArray1[519][1] = new Color(107, 182, 0); - colorArray1[519][2] = new Color(75, 184, 230); - colorArray1[519][3] = new Color(208, 80, 80); - colorArray1[519][4] = new Color(141, 137, 223); - colorArray1[519][5] = new Color(182, 175, 130); - colorArray1[549][0] = new Color(54, 83, 20); - colorArray1[528][0] = new Color(182, 175, 130); - colorArray1[529][0] = new Color(99, 150, 8); - colorArray1[529][1] = new Color(139, 154, 64); - colorArray1[529][2] = new Color(34, 129, 168); - colorArray1[529][3] = new Color(180, 82, 82); - colorArray1[529][4] = new Color(113, 108, 205); Color color1 = new Color(151, 107, 75); colorArray1[0][0] = color1; colorArray1[5][0] = color1; - colorArray1[5][1] = new Color(182, 175, 130); - Color color2 = new Color((int) sbyte.MaxValue, (int) sbyte.MaxValue, (int) sbyte.MaxValue); - colorArray1[583][0] = color2; - colorArray1[584][0] = color2; - colorArray1[585][0] = color2; - colorArray1[586][0] = color2; - colorArray1[587][0] = color2; - colorArray1[588][0] = color2; - colorArray1[589][0] = color2; - colorArray1[590][0] = color2; - colorArray1[595][0] = color1; - colorArray1[596][0] = color1; - colorArray1[615][0] = color1; - colorArray1[616][0] = color1; colorArray1[30][0] = color1; colorArray1[191][0] = color1; colorArray1[272][0] = new Color(121, 119, 101); @@ -106,10 +73,7 @@ namespace Terraria.Map colorArray1[138][0] = color1; colorArray1[273][0] = color1; colorArray1[283][0] = color1; - colorArray1[618][0] = color1; colorArray1[2][0] = new Color(28, 216, 94); - colorArray1[477][0] = new Color(28, 216, 94); - colorArray1[492][0] = new Color(78, 193, 227); color1 = new Color(26, 196, 84); colorArray1[3][0] = color1; colorArray1[192][0] = color1; @@ -122,15 +86,12 @@ namespace Terraria.Map colorArray1[7][0] = color1; colorArray1[47][0] = color1; colorArray1[284][0] = color1; - colorArray1[560][0] = color1; color1 = new Color(185, 164, 23); colorArray1[8][0] = color1; colorArray1[45][0] = color1; - colorArray1[560][2] = color1; color1 = new Color(185, 194, 195); colorArray1[9][0] = color1; colorArray1[46][0] = color1; - colorArray1[560][1] = color1; color1 = new Color(98, 95, 167); colorArray1[22][0] = color1; colorArray1[140][0] = color1; @@ -141,11 +102,8 @@ namespace Terraria.Map colorArray1[39][0] = new Color(181, 62, 59); colorArray1[40][0] = new Color(146, 81, 68); colorArray1[41][0] = new Color(66, 84, 109); - colorArray1[481][0] = new Color(66, 84, 109); colorArray1[43][0] = new Color(84, 100, 63); - colorArray1[482][0] = new Color(84, 100, 63); colorArray1[44][0] = new Color(107, 68, 99); - colorArray1[483][0] = new Color(107, 68, 99); colorArray1[53][0] = new Color(186, 168, 84); color1 = new Color(190, 171, 94); colorArray1[151][0] = color1; @@ -174,20 +132,14 @@ namespace Terraria.Map colorArray1[66][0] = new Color(160, 118, 58); colorArray1[67][0] = new Color(140, 58, 166); colorArray1[68][0] = new Color(125, 191, 197); - colorArray1[566][0] = new Color(233, 180, 90); colorArray1[70][0] = new Color(93, (int) sbyte.MaxValue, (int) byte.MaxValue); color1 = new Color(182, 175, 130); colorArray1[71][0] = color1; colorArray1[72][0] = color1; colorArray1[190][0] = color1; - colorArray1[578][0] = new Color(172, 155, 110); color1 = new Color(73, 120, 17); colorArray1[80][0] = color1; - colorArray1[484][0] = color1; colorArray1[188][0] = color1; - colorArray1[80][1] = new Color(87, 84, 151); - colorArray1[80][2] = new Color(34, 129, 168); - colorArray1[80][3] = new Color(130, 56, 55); color1 = new Color(11, 80, 143); colorArray1[107][0] = color1; colorArray1[121][0] = color1; @@ -223,7 +175,6 @@ namespace Terraria.Map color1 = new Color(145, 81, 85); colorArray1[158][0] = color1; colorArray1[232][0] = color1; - colorArray1[575][0] = new Color(125, 61, 65); colorArray1[159][0] = new Color(148, 133, 98); colorArray1[160][0] = new Color(200, 0, 0); colorArray1[160][1] = new Color(0, 200, 0); @@ -250,27 +201,6 @@ namespace Terraria.Map colorArray1[182][0] = new Color(43, 86, 140); colorArray1[183][0] = new Color(121, 49, 134); colorArray1[381][0] = new Color(254, 121, 2); - colorArray1[534][0] = new Color(114, 254, 2); - colorArray1[536][0] = new Color(0, 197, 208); - colorArray1[539][0] = new Color(208, 0, 126); - colorArray1[512][0] = new Color(49, 134, 114); - colorArray1[513][0] = new Color(126, 134, 49); - colorArray1[514][0] = new Color(134, 59, 49); - colorArray1[515][0] = new Color(43, 86, 140); - colorArray1[516][0] = new Color(121, 49, 134); - colorArray1[517][0] = new Color(254, 121, 2); - colorArray1[535][0] = new Color(114, 254, 2); - colorArray1[537][0] = new Color(0, 197, 208); - colorArray1[540][0] = new Color(208, 0, 126); - colorArray1[184][0] = new Color(29, 106, 88); - colorArray1[184][1] = new Color(94, 100, 36); - colorArray1[184][2] = new Color(96, 44, 40); - colorArray1[184][3] = new Color(34, 63, 102); - colorArray1[184][4] = new Color(79, 35, 95); - colorArray1[184][5] = new Color(253, 62, 3); - colorArray1[184][6] = new Color(22, 123, 62); - colorArray1[184][7] = new Color(0, 106, 148); - colorArray1[184][8] = new Color(148, 0, 132); colorArray1[189][0] = new Color(223, (int) byte.MaxValue, (int) byte.MaxValue); colorArray1[193][0] = new Color(56, 121, (int) byte.MaxValue); colorArray1[194][0] = new Color(157, 157, 107); @@ -353,7 +283,6 @@ namespace Terraria.Map colorArray1[310][0] = color1; colorArray1[413][0] = color1; colorArray1[339][0] = color1; - colorArray1[542][0] = color1; colorArray1[358][0] = color1; colorArray1[359][0] = color1; colorArray1[360][0] = color1; @@ -366,56 +295,12 @@ namespace Terraria.Map colorArray1[393][0] = color1; colorArray1[394][0] = color1; colorArray1[414][0] = color1; - colorArray1[505][0] = color1; - colorArray1[543][0] = color1; - colorArray1[598][0] = color1; - colorArray1[521][0] = color1; - colorArray1[522][0] = color1; - colorArray1[523][0] = color1; - colorArray1[524][0] = color1; - colorArray1[525][0] = color1; - colorArray1[526][0] = color1; - colorArray1[527][0] = color1; - colorArray1[532][0] = color1; - colorArray1[533][0] = color1; - colorArray1[538][0] = color1; - colorArray1[544][0] = color1; - colorArray1[550][0] = color1; - colorArray1[551][0] = color1; - colorArray1[553][0] = color1; - colorArray1[554][0] = color1; - colorArray1[555][0] = color1; - colorArray1[556][0] = color1; - colorArray1[558][0] = color1; - colorArray1[559][0] = color1; - colorArray1[580][0] = color1; - colorArray1[582][0] = color1; - colorArray1[599][0] = color1; - colorArray1[600][0] = color1; - colorArray1[601][0] = color1; - colorArray1[602][0] = color1; - colorArray1[603][0] = color1; - colorArray1[604][0] = color1; - colorArray1[605][0] = color1; - colorArray1[606][0] = color1; - colorArray1[607][0] = color1; - colorArray1[608][0] = color1; - colorArray1[609][0] = color1; - colorArray1[610][0] = color1; - colorArray1[611][0] = color1; - colorArray1[612][0] = color1; - colorArray1[619][0] = color1; - colorArray1[620][0] = color1; - colorArray1[552][0] = colorArray1[53][0]; - colorArray1[564][0] = new Color(87, (int) sbyte.MaxValue, 220); colorArray1[408][0] = new Color(85, 83, 82); colorArray1[409][0] = new Color(85, 83, 82); colorArray1[415][0] = new Color(249, 75, 7); colorArray1[416][0] = new Color(0, 160, 170); colorArray1[417][0] = new Color(160, 87, 234); colorArray1[418][0] = new Color(22, 173, 254); - colorArray1[489][0] = new Color((int) byte.MaxValue, 29, 136); - colorArray1[490][0] = new Color(211, 211, 211); colorArray1[311][0] = new Color(117, 61, 25); colorArray1[312][0] = new Color(204, 93, 73); colorArray1[313][0] = new Color(87, 150, 154); @@ -431,18 +316,10 @@ namespace Terraria.Map color1 = new Color(119, 105, 79); colorArray1[11][0] = color1; colorArray1[10][0] = color1; - colorArray1[593][0] = color1; - colorArray1[594][0] = color1; color1 = new Color(191, 142, 111); colorArray1[14][0] = color1; colorArray1[469][0] = color1; - colorArray1[486][0] = color1; - colorArray1[488][0] = new Color((int) sbyte.MaxValue, 92, 69); - colorArray1[487][0] = color1; - colorArray1[487][1] = color1; colorArray1[15][0] = color1; - colorArray1[15][1] = color1; - colorArray1[497][0] = color1; colorArray1[18][0] = color1; colorArray1[19][0] = color1; colorArray1[55][0] = color1; @@ -462,13 +339,9 @@ namespace Terraria.Map colorArray1[216][0] = color1; colorArray1[269][0] = color1; colorArray1[334][0] = color1; - colorArray1[471][0] = color1; - colorArray1[470][0] = color1; - colorArray1[475][0] = color1; colorArray1[377][0] = color1; colorArray1[380][0] = color1; colorArray1[395][0] = color1; - colorArray1[573][0] = color1; colorArray1[12][0] = new Color(174, 24, 69); colorArray1[13][0] = new Color(133, 213, 247); color1 = new Color(144, 148, 144); @@ -498,9 +371,7 @@ namespace Terraria.Map colorArray1[306][0] = color1; colorArray1[307][0] = color1; colorArray1[308][0] = color1; - colorArray1[567][0] = color1; colorArray1[349][0] = new Color(144, 148, 144); - colorArray1[531][0] = new Color(144, 148, 144); colorArray1[105][0] = new Color(144, 148, 144); colorArray1[105][1] = new Color(177, 92, 31); colorArray1[105][2] = new Color(201, 188, 170); @@ -540,14 +411,12 @@ namespace Terraria.Map colorArray1[92][0] = new Color(213, 229, 237); colorArray1[91][0] = new Color(13, 88, 130); colorArray1[215][0] = new Color(254, 121, 2); - colorArray1[592][0] = new Color(254, 121, 2); colorArray1[316][0] = new Color(157, 176, 226); colorArray1[317][0] = new Color(118, 227, 129); colorArray1[318][0] = new Color(227, 118, 215); colorArray1[319][0] = new Color(96, 68, 48); colorArray1[320][0] = new Color(203, 185, 151); colorArray1[321][0] = new Color(96, 77, 64); - colorArray1[574][0] = new Color(76, 57, 44); colorArray1[322][0] = new Color(198, 170, 104); colorArray1[149][0] = new Color(220, 50, 50); colorArray1[149][1] = new Color(0, 220, 50); @@ -578,13 +447,6 @@ namespace Terraria.Map colorArray1[247][0] = new Color(140, 150, 150); colorArray1[271][0] = new Color(107, 250, (int) byte.MaxValue); colorArray1[270][0] = new Color(187, (int) byte.MaxValue, 107); - colorArray1[581][0] = new Color((int) byte.MaxValue, 150, 150); - colorArray1[572][0] = new Color((int) byte.MaxValue, 186, 212); - colorArray1[572][1] = new Color(209, 201, (int) byte.MaxValue); - colorArray1[572][2] = new Color(200, 254, (int) byte.MaxValue); - colorArray1[572][3] = new Color(199, (int) byte.MaxValue, 211); - colorArray1[572][4] = new Color(180, 209, (int) byte.MaxValue); - colorArray1[572][5] = new Color((int) byte.MaxValue, 220, 214); colorArray1[314][0] = new Color(181, 164, 125); colorArray1[324][0] = new Color(228, 213, 173); colorArray1[351][0] = new Color(31, 31, 31); @@ -619,8 +481,7 @@ namespace Terraria.Map colorArray1[82][3] = color1; colorArray1[83][3] = color1; colorArray1[84][3] = color1; - colorArray1[591][6] = color1; - color1 = new Color(32, 168, 117); + color1 = new Color(72, 145, 125); colorArray1[82][4] = color1; colorArray1[83][4] = color1; colorArray1[84][4] = color1; @@ -632,14 +493,6 @@ namespace Terraria.Map colorArray1[82][6] = color1; colorArray1[83][6] = color1; colorArray1[84][6] = color1; - colorArray1[591][1] = new Color(246, 197, 26); - colorArray1[591][2] = new Color(76, 150, 216); - colorArray1[591][3] = new Color(32, 168, 117); - colorArray1[591][4] = new Color(40, 152, 240); - colorArray1[591][5] = new Color(114, 81, 56); - colorArray1[591][6] = new Color(141, 137, 223); - colorArray1[591][7] = new Color(208, 80, 80); - colorArray1[591][8] = new Color(177, 69, 49); colorArray1[165][0] = new Color(115, 173, 229); colorArray1[165][1] = new Color(100, 100, 100); colorArray1[165][2] = new Color(152, 152, 152); @@ -651,17 +504,20 @@ namespace Terraria.Map colorArray1[178][4] = new Color(250, 30, 71); colorArray1[178][5] = new Color(166, 176, 204); colorArray1[178][6] = new Color((int) byte.MaxValue, 217, 120); + colorArray1[184][0] = new Color(29, 106, 88); + colorArray1[184][1] = new Color(94, 100, 36); + colorArray1[184][2] = new Color(96, 44, 40); + colorArray1[184][3] = new Color(34, 63, 102); + colorArray1[184][4] = new Color(79, 35, 95); + colorArray1[184][5] = new Color(253, 62, 3); color1 = new Color(99, 99, 99); colorArray1[185][0] = color1; colorArray1[186][0] = color1; colorArray1[187][0] = color1; - colorArray1[565][0] = color1; - colorArray1[579][0] = color1; color1 = new Color(114, 81, 56); colorArray1[185][1] = color1; colorArray1[186][1] = color1; colorArray1[187][1] = color1; - colorArray1[591][0] = color1; color1 = new Color(133, 133, 101); colorArray1[185][2] = color1; colorArray1[186][2] = color1; @@ -694,10 +550,6 @@ namespace Terraria.Map colorArray1[185][9] = color1; colorArray1[186][9] = color1; colorArray1[187][9] = color1; - color1 = new Color(26, 196, 84); - colorArray1[185][10] = color1; - colorArray1[186][10] = color1; - colorArray1[187][10] = color1; colorArray1[227][0] = new Color(74, 197, 155); colorArray1[227][1] = new Color(54, 153, 88); colorArray1[227][2] = new Color(63, 126, 207); @@ -713,16 +565,11 @@ namespace Terraria.Map colorArray1[373][0] = new Color(9, 61, 191); colorArray1[374][0] = new Color(253, 32, 3); colorArray1[375][0] = new Color((int) byte.MaxValue, 156, 12); - colorArray1[461][0] = new Color(212, 192, 100); - colorArray1[461][1] = new Color(137, 132, 156); - colorArray1[461][2] = new Color(148, 122, 112); - colorArray1[461][3] = new Color(221, 201, 206); + colorArray1[461][0] = new Color((int) byte.MaxValue, 222, 100); colorArray1[323][0] = new Color(182, 141, 86); colorArray1[325][0] = new Color(129, 125, 93); colorArray1[326][0] = new Color(9, 61, 191); colorArray1[327][0] = new Color(253, 32, 3); - colorArray1[507][0] = new Color(5, 5, 5); - colorArray1[508][0] = new Color(5, 5, 5); colorArray1[330][0] = new Color(226, 118, 76); colorArray1[331][0] = new Color(161, 172, 173); colorArray1[332][0] = new Color(204, 181, 72); @@ -746,19 +593,16 @@ namespace Terraria.Map colorArray1[354][0] = new Color(141, 107, 89); colorArray1[355][0] = new Color(141, 107, 89); colorArray1[463][0] = new Color(155, 214, 240); - colorArray1[491][0] = new Color(60, 20, 160); colorArray1[464][0] = new Color(233, 183, 128); colorArray1[465][0] = new Color(51, 84, 195); colorArray1[466][0] = new Color(205, 153, 73); colorArray1[356][0] = new Color(233, 203, 24); colorArray1[357][0] = new Color(168, 178, 204); colorArray1[367][0] = new Color(168, 178, 204); - colorArray1[561][0] = new Color(148, 158, 184); colorArray1[365][0] = new Color(146, 136, 205); colorArray1[366][0] = new Color(223, 232, 233); colorArray1[368][0] = new Color(50, 46, 104); colorArray1[369][0] = new Color(50, 46, 104); - colorArray1[576][0] = new Color(30, 26, 84); colorArray1[370][0] = new Color((int) sbyte.MaxValue, 116, 194); colorArray1[372][0] = new Color(252, 128, 201); colorArray1[371][0] = new Color(249, 101, 189); @@ -776,19 +620,17 @@ namespace Terraria.Map colorArray1[390][0] = new Color(253, 32, 3); colorArray1[397][0] = new Color(212, 192, 100); colorArray1[396][0] = new Color(198, 124, 78); - colorArray1[577][0] = new Color(178, 104, 58); colorArray1[398][0] = new Color(100, 82, 126); colorArray1[399][0] = new Color(77, 76, 66); colorArray1[400][0] = new Color(96, 68, 117); colorArray1[401][0] = new Color(68, 60, 51); colorArray1[402][0] = new Color(174, 168, 186); colorArray1[403][0] = new Color(205, 152, 186); - colorArray1[404][0] = new Color(212, 148, 88); + colorArray1[404][0] = new Color(140, 84, 60); colorArray1[405][0] = new Color(140, 140, 140); colorArray1[406][0] = new Color(120, 120, 120); colorArray1[407][0] = new Color((int) byte.MaxValue, 227, 132); colorArray1[411][0] = new Color(227, 46, 46); - colorArray1[494][0] = new Color(227, 227, 227); colorArray1[421][0] = new Color(65, 75, 90); colorArray1[422][0] = new Color(65, 75, 90); colorArray1[425][0] = new Color(146, 155, 187); @@ -827,10 +669,7 @@ namespace Terraria.Map colorArray1[420][2] = new Color(218, 2, 5); colorArray1[420][3] = new Color(218, 2, 5); colorArray1[420][5] = new Color(218, 2, 5); - colorArray1[476][0] = new Color(160, 160, 160); colorArray1[410][0] = new Color(75, 139, 166); - colorArray1[480][0] = new Color(120, 50, 50); - colorArray1[509][0] = new Color(50, 50, 60); colorArray1[412][0] = new Color(75, 139, 166); colorArray1[443][0] = new Color(144, 148, 144); colorArray1[442][0] = new Color(3, 144, 201); @@ -859,82 +698,16 @@ namespace Terraria.Map colorArray1[462][0] = new Color(231, 178, 28); colorArray1[467][0] = new Color(129, 56, 121); colorArray1[467][1] = new Color((int) byte.MaxValue, 249, 59); - colorArray1[467][2] = new Color(161, 67, 24); - colorArray1[467][3] = new Color(89, 70, 72); - colorArray1[467][4] = new Color(233, 207, 94); - colorArray1[467][5] = new Color(254, 158, 35); - colorArray1[467][6] = new Color(34, 221, 151); - colorArray1[467][7] = new Color(249, 170, 236); - colorArray1[467][8] = new Color(35, 200, 254); - colorArray1[467][9] = new Color(190, 200, 200); - colorArray1[467][10] = new Color(230, 170, 100); - colorArray1[467][11] = new Color(165, 168, 26); - for (int index = 0; index < 12; ++index) - colorArray1[468][index] = colorArray1[467][index]; - colorArray1[472][0] = new Color(190, 160, 140); - colorArray1[473][0] = new Color(85, 114, 123); - colorArray1[474][0] = new Color(116, 94, 97); - colorArray1[478][0] = new Color(108, 34, 35); - colorArray1[479][0] = new Color(178, 114, 68); - colorArray1[485][0] = new Color(198, 134, 88); - colorArray1[492][0] = new Color(78, 193, 227); - colorArray1[492][0] = new Color(78, 193, 227); - colorArray1[493][0] = new Color(250, 249, 252); - colorArray1[493][1] = new Color(240, 90, 90); - colorArray1[493][2] = new Color(98, 230, 92); - colorArray1[493][3] = new Color(95, 197, 238); - colorArray1[493][4] = new Color(241, 221, 100); - colorArray1[493][5] = new Color(213, 92, 237); - colorArray1[494][0] = new Color(224, 219, 236); - colorArray1[495][0] = new Color(253, 227, 215); - colorArray1[496][0] = new Color(165, 159, 153); - colorArray1[498][0] = new Color(202, 174, 165); - colorArray1[499][0] = new Color(160, 187, 142); - colorArray1[500][0] = new Color(254, 158, 35); - colorArray1[501][0] = new Color(34, 221, 151); - colorArray1[502][0] = new Color(249, 170, 236); - colorArray1[503][0] = new Color(35, 200, 254); - colorArray1[506][0] = new Color(61, 61, 61); - colorArray1[510][0] = new Color(191, 142, 111); - colorArray1[511][0] = new Color(187, 68, 74); - colorArray1[520][0] = new Color(224, 219, 236); - colorArray1[545][0] = new Color((int) byte.MaxValue, 126, 145); - colorArray1[530][0] = new Color(107, 182, 0); - colorArray1[530][1] = new Color(23, 154, 209); - colorArray1[530][2] = new Color(238, 97, 94); - colorArray1[530][3] = new Color(113, 108, 205); - colorArray1[546][0] = new Color(60, 60, 60); - colorArray1[557][0] = new Color(60, 60, 60); - colorArray1[547][0] = new Color(120, 110, 100); - colorArray1[548][0] = new Color(120, 110, 100); - colorArray1[562][0] = new Color(165, 168, 26); - colorArray1[563][0] = new Color(165, 168, 26); - colorArray1[571][0] = new Color(165, 168, 26); - colorArray1[568][0] = new Color(248, 203, 233); - colorArray1[569][0] = new Color(203, 248, 218); - colorArray1[570][0] = new Color(160, 242, (int) byte.MaxValue); - colorArray1[597][0] = new Color(28, 216, 94); - colorArray1[597][1] = new Color(183, 237, 20); - colorArray1[597][2] = new Color(185, 83, 200); - colorArray1[597][3] = new Color(131, 128, 168); - colorArray1[597][4] = new Color(38, 142, 214); - colorArray1[597][5] = new Color(229, 154, 9); - colorArray1[597][6] = new Color(142, 227, 234); - colorArray1[597][7] = new Color(98, 111, 223); - colorArray1[597][8] = new Color(241, 233, 158); - colorArray1[617][0] = new Color(233, 207, 94); - Color color3 = new Color(250, 100, 50); - colorArray1[548][1] = color3; - colorArray1[613][0] = color3; - colorArray1[614][0] = color3; + colorArray1[468][0] = colorArray1[467][0]; + colorArray1[468][1] = colorArray1[467][1]; Color[] colorArray2 = new Color[3] { new Color(9, 61, 191), new Color(253, 32, 3), new Color(254, 194, 20) }; - Color[][] colorArray3 = new Color[316][]; - for (int index = 0; index < 316; ++index) + Color[][] colorArray3 = new Color[231][]; + for (int index = 0; index < 231; ++index) colorArray3[index] = new Color[2]; colorArray3[158][0] = new Color(107, 49, 154); colorArray3[163][0] = new Color(154, 148, 49); @@ -1055,7 +828,6 @@ namespace Terraria.Map colorArray3[64][0] = color1; colorArray3[67][0] = color1; colorArray3[78][0] = new Color(63, 39, 26); - colorArray3[244][0] = new Color(63, 39, 26); colorArray3[71][0] = new Color(78, 105, 135); colorArray3[72][0] = new Color(52, 84, 12); colorArray3[73][0] = new Color(190, 204, 223); @@ -1069,7 +841,6 @@ namespace Terraria.Map colorArray3[81][0] = new Color(101, 51, 51); colorArray3[82][0] = new Color(77, 64, 34); colorArray3[83][0] = new Color(62, 38, 41); - colorArray3[234][0] = new Color(60, 36, 39); colorArray3[84][0] = new Color(48, 78, 93); colorArray3[85][0] = new Color(54, 63, 69); color1 = new Color(138, 73, 38); @@ -1120,8 +891,6 @@ namespace Terraria.Map colorArray3[151][0] = new Color(102, 75, 34); colorArray3[167][0] = new Color(70, 68, 51); colorArray3[172][0] = new Color(163, 96, 0); - colorArray3[242][0] = new Color(5, 5, 5); - colorArray3[243][0] = new Color(5, 5, 5); colorArray3[173][0] = new Color(94, 163, 46); colorArray3[174][0] = new Color(117, 32, 59); colorArray3[175][0] = new Color(20, 11, 203); @@ -1141,7 +910,6 @@ namespace Terraria.Map colorArray3[218][0] = new Color(57, 14, 12); colorArray3[219][0] = new Color(96, 72, 133); colorArray3[187][0] = new Color(149, 80, 51); - colorArray3[235][0] = new Color(140, 75, 48); colorArray3[220][0] = new Color(67, 55, 80); colorArray3[221][0] = new Color(64, 37, 29); colorArray3[222][0] = new Color(70, 51, 91); @@ -1177,116 +945,37 @@ namespace Terraria.Map colorArray3[228][0] = new Color(160, 2, 75); colorArray3[229][0] = new Color(100, 55, 164); colorArray3[230][0] = new Color(0, 117, 101); - colorArray3[236][0] = new Color((int) sbyte.MaxValue, 49, 44); - colorArray3[231][0] = new Color(110, 90, 78); - colorArray3[232][0] = new Color(47, 69, 75); - colorArray3[233][0] = new Color(91, 67, 70); - colorArray3[237][0] = new Color(200, 44, 18); - colorArray3[238][0] = new Color(24, 93, 66); - colorArray3[239][0] = new Color(160, 87, 234); - colorArray3[240][0] = new Color(6, 106, (int) byte.MaxValue); - colorArray3[245][0] = new Color(102, 102, 102); - colorArray3[315][0] = new Color(181, 230, 29); - colorArray3[246][0] = new Color(61, 58, 78); - colorArray3[247][0] = new Color(52, 43, 45); - colorArray3[248][0] = new Color(81, 84, 101); - colorArray3[249][0] = new Color(85, 102, 103); - colorArray3[250][0] = new Color(52, 52, 52); - colorArray3[251][0] = new Color(52, 52, 52); - colorArray3[252][0] = new Color(52, 52, 52); - colorArray3[253][0] = new Color(52, 52, 52); - colorArray3[254][0] = new Color(52, 52, 52); - colorArray3[(int) byte.MaxValue][0] = new Color(52, 52, 52); - colorArray3[314][0] = new Color(52, 52, 52); - colorArray3[256][0] = new Color(40, 56, 50); - colorArray3[257][0] = new Color(49, 48, 36); - colorArray3[258][0] = new Color(43, 33, 32); - colorArray3[259][0] = new Color(31, 40, 49); - colorArray3[260][0] = new Color(48, 35, 52); - colorArray3[261][0] = new Color(88, 61, 46); - colorArray3[262][0] = new Color(55, 39, 26); - colorArray3[263][0] = new Color(39, 33, 26); - colorArray3[264][0] = new Color(43, 42, 68); - colorArray3[265][0] = new Color(30, 70, 80); - colorArray3[266][0] = new Color(78, 105, 135); - colorArray3[267][0] = new Color(51, 47, 96); - colorArray3[268][0] = new Color(101, 51, 51); - colorArray3[269][0] = new Color(62, 38, 41); - colorArray3[270][0] = new Color(59, 39, 22); - colorArray3[271][0] = new Color(59, 39, 22); - colorArray3[272][0] = new Color(111, 117, 135); - colorArray3[273][0] = new Color(25, 23, 54); - colorArray3[274][0] = new Color(52, 52, 52); - colorArray3[275][0] = new Color(149, 80, 51); - colorArray3[276][0] = new Color(82, 63, 80); - colorArray3[277][0] = new Color(65, 61, 77); - colorArray3[278][0] = new Color(64, 65, 92); - colorArray3[279][0] = new Color(76, 53, 84); - colorArray3[280][0] = new Color(144, 67, 52); - colorArray3[281][0] = new Color(149, 48, 48); - colorArray3[282][0] = new Color(111, 32, 36); - colorArray3[283][0] = new Color(147, 48, 55); - colorArray3[284][0] = new Color(97, 67, 51); - colorArray3[285][0] = new Color(112, 80, 62); - colorArray3[286][0] = new Color(88, 61, 46); - colorArray3[287][0] = new Color((int) sbyte.MaxValue, 94, 76); - colorArray3[288][0] = new Color(143, 50, 123); - colorArray3[289][0] = new Color(136, 120, 131); - colorArray3[290][0] = new Color(219, 92, 143); - colorArray3[291][0] = new Color(113, 64, 150); - colorArray3[292][0] = new Color(74, 67, 60); - colorArray3[293][0] = new Color(60, 78, 59); - colorArray3[294][0] = new Color(0, 54, 21); - colorArray3[295][0] = new Color(74, 97, 72); - colorArray3[296][0] = new Color(40, 37, 35); - colorArray3[297][0] = new Color(77, 63, 66); - colorArray3[298][0] = new Color(111, 6, 6); - colorArray3[299][0] = new Color(88, 67, 59); - colorArray3[300][0] = new Color(88, 87, 80); - colorArray3[301][0] = new Color(71, 71, 67); - colorArray3[302][0] = new Color(76, 52, 60); - colorArray3[303][0] = new Color(89, 48, 59); - colorArray3[304][0] = new Color(158, 100, 64); - colorArray3[305][0] = new Color(62, 45, 75); - colorArray3[306][0] = new Color(57, 14, 12); - colorArray3[307][0] = new Color(96, 72, 133); - colorArray3[308][0] = new Color(67, 55, 80); - colorArray3[309][0] = new Color(64, 37, 29); - colorArray3[310][0] = new Color(70, 51, 91); - colorArray3[311][0] = new Color(51, 18, 4); - colorArray3[312][0] = new Color(78, 110, 51); - colorArray3[313][0] = new Color(78, 110, 51); Color[] colorArray4 = new Color[256]; - Color color4 = new Color(50, 40, (int) byte.MaxValue); - Color color5 = new Color(145, 185, (int) byte.MaxValue); + Color color2 = new Color(50, 40, (int) byte.MaxValue); + Color color3 = new Color(145, 185, (int) byte.MaxValue); for (int index = 0; index < colorArray4.Length; ++index) { float num1 = (float) index / (float) colorArray4.Length; float num2 = 1f - num1; - colorArray4[index] = new Color((int) (byte) ((double) color4.R * (double) num2 + (double) color5.R * (double) num1), (int) (byte) ((double) color4.G * (double) num2 + (double) color5.G * (double) num1), (int) (byte) ((double) color4.B * (double) num2 + (double) color5.B * (double) num1)); + colorArray4[index] = new Color((int) (byte) ((double) color2.R * (double) num2 + (double) color3.R * (double) num1), (int) (byte) ((double) color2.G * (double) num2 + (double) color3.G * (double) num1), (int) (byte) ((double) color2.B * (double) num2 + (double) color3.B * (double) num1)); } Color[] colorArray5 = new Color[256]; - Color color6 = new Color(88, 61, 46); - Color color7 = new Color(37, 78, 123); + Color color4 = new Color(88, 61, 46); + Color color5 = new Color(37, 78, 123); for (int index = 0; index < colorArray5.Length; ++index) { float num3 = (float) index / (float) byte.MaxValue; float num4 = 1f - num3; - colorArray5[index] = new Color((int) (byte) ((double) color6.R * (double) num4 + (double) color7.R * (double) num3), (int) (byte) ((double) color6.G * (double) num4 + (double) color7.G * (double) num3), (int) (byte) ((double) color6.B * (double) num4 + (double) color7.B * (double) num3)); + colorArray5[index] = new Color((int) (byte) ((double) color4.R * (double) num4 + (double) color5.R * (double) num3), (int) (byte) ((double) color4.G * (double) num4 + (double) color5.G * (double) num3), (int) (byte) ((double) color4.B * (double) num4 + (double) color5.B * (double) num3)); } Color[] colorArray6 = new Color[256]; - Color color8 = new Color(74, 67, 60); - color7 = new Color(53, 70, 97); + Color color6 = new Color(74, 67, 60); + color5 = new Color(53, 70, 97); for (int index = 0; index < colorArray6.Length; ++index) { float num5 = (float) index / (float) byte.MaxValue; float num6 = 1f - num5; - colorArray6[index] = new Color((int) (byte) ((double) color8.R * (double) num6 + (double) color7.R * (double) num5), (int) (byte) ((double) color8.G * (double) num6 + (double) color7.G * (double) num5), (int) (byte) ((double) color8.B * (double) num6 + (double) color7.B * (double) num5)); + colorArray6[index] = new Color((int) (byte) ((double) color6.R * (double) num6 + (double) color5.R * (double) num5), (int) (byte) ((double) color6.G * (double) num6 + (double) color5.G * (double) num5), (int) (byte) ((double) color6.B * (double) num6 + (double) color5.B * (double) num5)); } - Color color9 = new Color(50, 44, 38); + Color color7 = new Color(50, 44, 38); int num7 = 0; - MapHelper.tileOptionCounts = new int[623]; - for (int index1 = 0; index1 < 623; ++index1) + MapHelper.tileOptionCounts = new int[470]; + for (int index1 = 0; index1 < 470; ++index1) { Color[] colorArray7 = colorArray1[index1]; int index2 = 0; @@ -1295,8 +984,8 @@ namespace Terraria.Map MapHelper.tileOptionCounts[index1] = index2; num7 += index2; } - MapHelper.wallOptionCounts = new int[316]; - for (int index3 = 0; index3 < 316; ++index3) + MapHelper.wallOptionCounts = new int[231]; + for (int index3 = 0; index3 < 231; ++index3) { Color[] colorArray8 = colorArray3[index3]; int index4 = 0; @@ -1309,8 +998,8 @@ namespace Terraria.Map MapHelper.colorLookup[0] = Color.Transparent; ushort num8 = 1; MapHelper.tilePosition = num8; - MapHelper.tileLookup = new ushort[623]; - for (int index5 = 0; index5 < 623; ++index5) + MapHelper.tileLookup = new ushort[470]; + for (int index5 = 0; index5 < 470; ++index5) { if (MapHelper.tileOptionCounts[index5] > 0) { @@ -1326,9 +1015,9 @@ namespace Terraria.Map MapHelper.tileLookup[index5] = (ushort) 0; } MapHelper.wallPosition = num8; - MapHelper.wallLookup = new ushort[316]; + MapHelper.wallLookup = new ushort[231]; MapHelper.wallRangeStart = num8; - for (int index7 = 0; index7 < 316; ++index7) + for (int index7 = 0; index7 < 231; ++index7) { if (MapHelper.wallOptionCounts[index7] > 0) { @@ -1369,7 +1058,7 @@ namespace Terraria.Map ++num8; } MapHelper.hellPosition = num8; - MapHelper.colorLookup[(int) num8] = color9; + MapHelper.colorLookup[(int) num8] = color7; MapHelper.snowTypes = new ushort[6]; MapHelper.snowTypes[0] = MapHelper.tileLookup[147]; MapHelper.snowTypes[1] = MapHelper.tileLookup[161]; @@ -1380,10 +1069,6 @@ namespace Terraria.Map Lang.BuildMapAtlas(); } - public static void ResetMapData() => MapHelper.numUpdateTile = 0; - - public static bool HasOption(int tileType, int option) => option < MapHelper.tileOptionCounts[tileType]; - public static int TileToLookup(int tileType, int option) => (int) MapHelper.tileLookup[tileType] + option; public static int LookupCount() => MapHelper.colorLookup.Length; @@ -1422,8 +1107,6 @@ namespace Terraria.Map oldColor.G = (byte) ((uint) byte.MaxValue - (uint) oldColor.G); oldColor.B = (byte) ((uint) byte.MaxValue - (uint) oldColor.B); break; - case 31: - break; default: float num6 = num1; oldColor.R = (byte) ((double) color.R * (double) num6); @@ -1439,7 +1122,7 @@ namespace Terraria.Map byte color = tile.Color; if (color > (byte) 0) MapHelper.MapColor(tile.Type, ref oldColor, color); - if (tile.Light == byte.MaxValue || color == (byte) 31) + if (tile.Light == byte.MaxValue) return oldColor; float num = (float) tile.Light / (float) byte.MaxValue; oldColor.R = (byte) ((double) oldColor.R * (double) num); @@ -1450,52 +1133,352 @@ namespace Terraria.Map public static MapTile CreateMapTile(int i, int j, byte Light) { - Tile tileCache = Main.tile[i, j]; - if (tileCache == null) - return new MapTile(); + Tile tile = Main.tile[i, j] ?? (Main.tile[i, j] = new Tile()); int num1 = 0; int num2 = (int) Light; - MapTile mapTile = Main.Map[i, j]; + ushort type1 = Main.Map[i, j].Type; int num3 = 0; - int baseOption = 0; - if (tileCache.active()) + int num4 = 0; + if (tile.active()) { - int type = (int) tileCache.type; - num3 = (int) MapHelper.tileLookup[type]; - switch (type) - { - case 5: - if (WorldGen.IsThisAMushroomTree(i, j)) - baseOption = 1; - num1 = (int) tileCache.color(); - goto label_11; - case 51: - if ((i + j) % 2 == 0) - { - num3 = 0; - break; - } - break; - } + int type2 = (int) tile.type; + num3 = (int) MapHelper.tileLookup[type2]; + if (type2 == 51 && (i + j) % 2 == 0) + num3 = 0; if (num3 != 0) { - num1 = type != 160 ? (int) tileCache.color() : 0; - MapHelper.GetTileBaseOption(j, tileCache, ref baseOption); + num1 = type2 != 160 ? (int) tile.color() : 0; + switch (type2) + { + case 4: + if (tile.frameX < (short) 66) + ; + num4 = 0; + break; + case 21: + case 441: + switch ((int) tile.frameX / 36) + { + case 1: + case 2: + case 10: + case 13: + case 15: + num4 = 1; + break; + case 3: + case 4: + num4 = 2; + break; + case 6: + num4 = 3; + break; + case 11: + case 17: + num4 = 4; + break; + default: + num4 = 0; + break; + } + break; + case 26: + num4 = tile.frameX < (short) 54 ? 0 : 1; + break; + case 27: + num4 = tile.frameY >= (short) 34 ? 0 : 1; + break; + case 28: + num4 = tile.frameY >= (short) 144 ? (tile.frameY >= (short) 252 ? (tile.frameY < (short) 360 || tile.frameY > (short) 900 && tile.frameY < (short) 1008 ? 2 : (tile.frameY >= (short) 468 ? (tile.frameY >= (short) 576 ? (tile.frameY >= (short) 684 ? (tile.frameY >= (short) 792 ? (tile.frameY >= (short) 898 ? (tile.frameY >= (short) 1006 ? (tile.frameY >= (short) 1114 ? (tile.frameY >= (short) 1222 ? 7 : 3) : 0) : 7) : 8) : 6) : 5) : 4) : 3)) : 1) : 0; + break; + case 31: + num4 = tile.frameX < (short) 36 ? 0 : 1; + break; + case 82: + case 83: + case 84: + num4 = tile.frameX >= (short) 18 ? (tile.frameX >= (short) 36 ? (tile.frameX >= (short) 54 ? (tile.frameX >= (short) 72 ? (tile.frameX >= (short) 90 ? (tile.frameX >= (short) 108 ? 6 : 5) : 4) : 3) : 2) : 1) : 0; + break; + case 105: + num4 = tile.frameX < (short) 1548 || tile.frameX > (short) 1654 ? (tile.frameX < (short) 1656 || tile.frameX > (short) 1798 ? 0 : 2) : 1; + break; + case 133: + num4 = tile.frameX >= (short) 52 ? 1 : 0; + break; + case 134: + num4 = tile.frameX >= (short) 28 ? 1 : 0; + break; + case 137: + num4 = tile.frameY != (short) 0 ? 1 : 0; + break; + case 149: + num4 = j % 3; + break; + case 160: + num4 = j % 3; + break; + case 165: + num4 = tile.frameX >= (short) 54 ? (tile.frameX >= (short) 106 ? (tile.frameX < (short) 216 ? (tile.frameX >= (short) 162 ? 3 : 2) : 1) : 1) : 0; + break; + case 178: + num4 = tile.frameX >= (short) 18 ? (tile.frameX >= (short) 36 ? (tile.frameX >= (short) 54 ? (tile.frameX >= (short) 72 ? (tile.frameX >= (short) 90 ? (tile.frameX >= (short) 108 ? 6 : 5) : 4) : 3) : 2) : 1) : 0; + break; + case 184: + num4 = tile.frameX >= (short) 22 ? (tile.frameX >= (short) 44 ? (tile.frameX >= (short) 66 ? (tile.frameX >= (short) 88 ? (tile.frameX >= (short) 110 ? 5 : 4) : 3) : 2) : 1) : 0; + break; + case 185: + if (tile.frameY < (short) 18) + { + int num5 = (int) tile.frameX / 18; + if (num5 < 6 || num5 == 28 || num5 == 29 || num5 == 30 || num5 == 31 || num5 == 32) + { + num4 = 0; + break; + } + if (num5 < 12 || num5 == 33 || num5 == 34 || num5 == 35) + { + num4 = 1; + break; + } + if (num5 < 28) + { + num4 = 2; + break; + } + if (num5 < 48) + { + num4 = 3; + break; + } + if (num5 < 54) + { + num4 = 4; + break; + } + break; + } + int num6 = (int) tile.frameX / 36; + if (num6 < 6 || num6 == 19 || num6 == 20 || num6 == 21 || num6 == 22 || num6 == 23 || num6 == 24 || num6 == 33 || num6 == 38 || num6 == 39 || num6 == 40) + { + num4 = 0; + break; + } + if (num6 < 16) + { + num4 = 2; + break; + } + if (num6 < 19 || num6 == 31 || num6 == 32) + { + num4 = 1; + break; + } + if (num6 < 31) + { + num4 = 3; + break; + } + if (num6 < 38) + { + num4 = 4; + break; + } + break; + case 186: + int num7 = (int) tile.frameX / 54; + if (num7 < 7) + { + num4 = 2; + break; + } + if (num7 < 22 || num7 == 33 || num7 == 34 || num7 == 35) + { + num4 = 0; + break; + } + if (num7 < 25) + { + num4 = 1; + break; + } + if (num7 == 25) + { + num4 = 5; + break; + } + if (num7 < 32) + { + num4 = 3; + break; + } + break; + case 187: + int num8 = (int) tile.frameX / 54; + if (num8 < 3 || num8 == 14 || num8 == 15 || num8 == 16) + { + num4 = 0; + break; + } + if (num8 < 6) + { + num4 = 6; + break; + } + if (num8 < 9) + { + num4 = 7; + break; + } + if (num8 < 14) + { + num4 = 4; + break; + } + if (num8 < 18) + { + num4 = 4; + break; + } + if (num8 < 23) + { + num4 = 8; + break; + } + if (num8 < 25) + { + num4 = 0; + break; + } + if (num8 < 29) + { + num4 = 1; + break; + } + break; + case 227: + num4 = (int) tile.frameX / 34; + break; + case 240: + int num9 = (int) tile.frameX / 54 + (int) tile.frameY / 54 * 36; + if (num9 >= 0 && num9 <= 11 || num9 >= 47 && num9 <= 53) + { + num4 = 0; + break; + } + if (num9 >= 12 && num9 <= 15) + { + num4 = 1; + break; + } + if (num9 == 16 || num9 == 17) + { + num4 = 2; + break; + } + if (num9 >= 18 && num9 <= 35) + { + num4 = 1; + break; + } + if (num9 >= 41 && num9 <= 45) + { + num4 = 3; + break; + } + if (num9 == 46) + { + num4 = 4; + break; + } + break; + case 242: + switch ((int) tile.frameY / 72) + { + case 22: + case 23: + case 24: + num4 = 1; + break; + default: + num4 = 0; + break; + } + break; + case 419: + int num10 = (int) tile.frameX / 18; + if (num10 > 2) + num10 = 2; + num4 = num10; + break; + case 420: + int num11 = (int) tile.frameY / 18; + if (num11 > 5) + num11 = 5; + num4 = num11; + break; + case 423: + int num12 = (int) tile.frameY / 18; + if (num12 > 6) + num12 = 6; + num4 = num12; + break; + case 428: + int num13 = (int) tile.frameY / 18; + if (num13 > 3) + num13 = 3; + num4 = num13; + break; + case 440: + int num14 = (int) tile.frameX / 54; + if (num14 > 6) + num14 = 6; + num4 = num14; + break; + case 453: + int num15 = (int) tile.frameX / 36; + if (num15 > 2) + num15 = 2; + num4 = num15; + break; + case 457: + int num16 = (int) tile.frameX / 36; + if (num16 > 4) + num16 = 4; + num4 = num16; + break; + case 467: + case 468: + switch ((int) tile.frameX / 36) + { + case 0: + num4 = 0; + break; + case 1: + num4 = 1; + break; + default: + num4 = 0; + break; + } + break; + default: + num4 = 0; + break; + } } } -label_11: if (num3 == 0) { - if (tileCache.liquid > (byte) 32) + if (tile.liquid > (byte) 32) { - int num4 = (int) tileCache.liquidType(); - num3 = (int) MapHelper.liquidPosition + num4; + int num17 = (int) tile.liquidType(); + num3 = (int) MapHelper.liquidPosition + num17; } - else if (tileCache.wall > (ushort) 0 && tileCache.wall < (ushort) 316) + else if (tile.wall > (byte) 0) { - int wall = (int) tileCache.wall; + int wall = (int) tile.wall; num3 = (int) MapHelper.wallLookup[wall]; - num1 = (int) tileCache.wallColor(); + num1 = (int) tile.wallColor(); switch (wall) { case 21: @@ -1506,14 +1489,13 @@ label_11: case 92: case 93: case 168: - case 241: num1 = 0; break; case 27: - baseOption = i % 2; + num4 = i % 2; break; default: - baseOption = 0; + num4 = 0; break; } } @@ -1522,33 +1504,33 @@ label_11: { if ((double) j < Main.worldSurface) { - int num5 = (int) (byte) ((double) byte.MaxValue * ((double) j / Main.worldSurface)); - num3 = (int) MapHelper.skyPosition + num5; + int num18 = (int) (byte) ((double) byte.MaxValue * ((double) j / Main.worldSurface)); + num3 = (int) MapHelper.skyPosition + num18; num2 = (int) byte.MaxValue; num1 = 0; } - else if (j < Main.UnderworldLayer) + else if (j < Main.maxTilesY - 200) { num1 = 0; - byte num6 = 0; - float num7 = (float) ((double) Main.screenPosition.X / 16.0 - 5.0); - float num8 = (float) (((double) Main.screenPosition.X + (double) Main.screenWidth) / 16.0 + 5.0); - float num9 = (float) ((double) Main.screenPosition.Y / 16.0 - 5.0); - float num10 = (float) (((double) Main.screenPosition.Y + (double) Main.screenHeight) / 16.0 + 5.0); - if (((double) i < (double) num7 || (double) i > (double) num8 || (double) j < (double) num9 || (double) j > (double) num10) && i > 40 && i < Main.maxTilesX - 40 && j > 40 && j < Main.maxTilesY - 40) + bool flag = (int) type1 < (int) MapHelper.dirtPosition || (int) type1 >= (int) MapHelper.hellPosition; + byte num19 = 0; + float num20 = (float) ((double) Main.screenPosition.X / 16.0 - 5.0); + float num21 = (float) (((double) Main.screenPosition.X + (double) Main.screenWidth) / 16.0 + 5.0); + float num22 = (float) ((double) Main.screenPosition.Y / 16.0 - 5.0); + float num23 = (float) (((double) Main.screenPosition.Y + (double) Main.screenHeight) / 16.0 + 5.0); + if ((((double) i >= (double) num20 && (double) i <= (double) num21 && (double) j >= (double) num22 && (double) j <= (double) num23 || i <= 40 || i >= Main.maxTilesX - 40 || j <= 40 ? 0 : (j < Main.maxTilesY - 40 ? 1 : 0)) & (flag ? 1 : 0)) != 0) { - for (int x = i - 36; x <= i + 30; x += 10) + for (int index1 = i - 36; index1 <= i + 30; index1 += 10) { - for (int y = j - 36; y <= j + 30; y += 10) + for (int index2 = j - 36; index2 <= j + 30; index2 += 10) { - int type = (int) Main.Map[x, y].Type; - for (int index = 0; index < MapHelper.snowTypes.Length; ++index) + for (int index3 = 0; index3 < MapHelper.snowTypes.Length; ++index3) { - if ((int) MapHelper.snowTypes[index] == type) + if ((int) MapHelper.snowTypes[index3] == (int) type1) { - num6 = byte.MaxValue; - x = i + 31; - y = j + 31; + num19 = byte.MaxValue; + index1 = i + 31; + index2 = j + 31; break; } } @@ -1557,984 +1539,306 @@ label_11: } else { - float num11 = (float) Main.SceneMetrics.SnowTileCount / (float) SceneMetrics.SnowTileMax * (float) byte.MaxValue; - if ((double) num11 > (double) byte.MaxValue) - num11 = (float) byte.MaxValue; - num6 = (byte) num11; + float num24 = (float) Main.snowTiles / 1000f * (float) byte.MaxValue; + if ((double) num24 > (double) byte.MaxValue) + num24 = (float) byte.MaxValue; + num19 = (byte) num24; } - num3 = (double) j >= Main.rockLayer ? (int) MapHelper.rockPosition + (int) num6 : (int) MapHelper.dirtPosition + (int) num6; + num3 = (double) j >= Main.rockLayer ? (int) MapHelper.rockPosition + (int) num19 : (int) MapHelper.dirtPosition + (int) num19; } else num3 = (int) MapHelper.hellPosition; } - return MapTile.Create((ushort) (num3 + baseOption), (byte) num2, (byte) num1); - } - - public static void GetTileBaseOption(int y, Tile tileCache, ref int baseOption) - { - switch (tileCache.type) - { - case 4: - if (tileCache.frameX < (short) 66) - baseOption = 1; - baseOption = 0; - break; - case 15: - int num1 = (int) tileCache.frameY / 40; - baseOption = 0; - if (num1 != 1 && num1 != 20) - break; - baseOption = 1; - break; - case 21: - case 441: - switch ((int) tileCache.frameX / 36) - { - case 1: - case 2: - case 10: - case 13: - case 15: - baseOption = 1; - return; - case 3: - case 4: - baseOption = 2; - return; - case 6: - baseOption = 3; - return; - case 11: - case 17: - baseOption = 4; - return; - default: - baseOption = 0; - return; - } - case 26: - if (tileCache.frameX >= (short) 54) - { - baseOption = 1; - break; - } - baseOption = 0; - break; - case 27: - if (tileCache.frameY < (short) 34) - { - baseOption = 1; - break; - } - baseOption = 0; - break; - case 28: - if (tileCache.frameY < (short) 144) - { - baseOption = 0; - break; - } - if (tileCache.frameY < (short) 252) - { - baseOption = 1; - break; - } - if (tileCache.frameY < (short) 360 || tileCache.frameY > (short) 900 && tileCache.frameY < (short) 1008) - { - baseOption = 2; - break; - } - if (tileCache.frameY < (short) 468) - { - baseOption = 3; - break; - } - if (tileCache.frameY < (short) 576) - { - baseOption = 4; - break; - } - if (tileCache.frameY < (short) 684) - { - baseOption = 5; - break; - } - if (tileCache.frameY < (short) 792) - { - baseOption = 6; - break; - } - if (tileCache.frameY < (short) 898) - { - baseOption = 8; - break; - } - if (tileCache.frameY < (short) 1006) - { - baseOption = 7; - break; - } - if (tileCache.frameY < (short) 1114) - { - baseOption = 0; - break; - } - if (tileCache.frameY < (short) 1222) - { - baseOption = 3; - break; - } - baseOption = 7; - break; - case 31: - if (tileCache.frameX >= (short) 36) - { - baseOption = 1; - break; - } - baseOption = 0; - break; - case 82: - case 83: - case 84: - if (tileCache.frameX < (short) 18) - { - baseOption = 0; - break; - } - if (tileCache.frameX < (short) 36) - { - baseOption = 1; - break; - } - if (tileCache.frameX < (short) 54) - { - baseOption = 2; - break; - } - if (tileCache.frameX < (short) 72) - { - baseOption = 3; - break; - } - if (tileCache.frameX < (short) 90) - { - baseOption = 4; - break; - } - if (tileCache.frameX < (short) 108) - { - baseOption = 5; - break; - } - baseOption = 6; - break; - case 105: - if (tileCache.frameX >= (short) 1548 && tileCache.frameX <= (short) 1654) - { - baseOption = 1; - break; - } - if (tileCache.frameX >= (short) 1656 && tileCache.frameX <= (short) 1798) - { - baseOption = 2; - break; - } - baseOption = 0; - break; - case 133: - if (tileCache.frameX < (short) 52) - { - baseOption = 0; - break; - } - baseOption = 1; - break; - case 134: - if (tileCache.frameX < (short) 28) - { - baseOption = 0; - break; - } - baseOption = 1; - break; - case 137: - if (tileCache.frameY == (short) 0) - { - baseOption = 0; - break; - } - baseOption = 1; - break; - case 149: - baseOption = y % 3; - break; - case 160: - baseOption = y % 3; - break; - case 165: - if (tileCache.frameX < (short) 54) - { - baseOption = 0; - break; - } - if (tileCache.frameX < (short) 106) - { - baseOption = 1; - break; - } - if (tileCache.frameX >= (short) 216) - { - baseOption = 1; - break; - } - if (tileCache.frameX < (short) 162) - { - baseOption = 2; - break; - } - baseOption = 3; - break; - case 178: - if (tileCache.frameX < (short) 18) - { - baseOption = 0; - break; - } - if (tileCache.frameX < (short) 36) - { - baseOption = 1; - break; - } - if (tileCache.frameX < (short) 54) - { - baseOption = 2; - break; - } - if (tileCache.frameX < (short) 72) - { - baseOption = 3; - break; - } - if (tileCache.frameX < (short) 90) - { - baseOption = 4; - break; - } - if (tileCache.frameX < (short) 108) - { - baseOption = 5; - break; - } - baseOption = 6; - break; - case 184: - if (tileCache.frameX < (short) 22) - { - baseOption = 0; - break; - } - if (tileCache.frameX < (short) 44) - { - baseOption = 1; - break; - } - if (tileCache.frameX < (short) 66) - { - baseOption = 2; - break; - } - if (tileCache.frameX < (short) 88) - { - baseOption = 3; - break; - } - if (tileCache.frameX < (short) 110) - { - baseOption = 4; - break; - } - if (tileCache.frameX < (short) 132) - { - baseOption = 5; - break; - } - if (tileCache.frameX < (short) 154) - { - baseOption = 6; - break; - } - if (tileCache.frameX < (short) 176) - { - baseOption = 7; - break; - } - if (tileCache.frameX >= (short) 198) - break; - baseOption = 8; - break; - case 185: - if (tileCache.frameY < (short) 18) - { - int num2 = (int) tileCache.frameX / 18; - if (num2 < 6 || num2 == 28 || num2 == 29 || num2 == 30 || num2 == 31 || num2 == 32) - { - baseOption = 0; - break; - } - if (num2 < 12 || num2 == 33 || num2 == 34 || num2 == 35) - { - baseOption = 1; - break; - } - if (num2 < 28) - { - baseOption = 2; - break; - } - if (num2 < 48) - { - baseOption = 3; - break; - } - if (num2 < 54) - { - baseOption = 4; - break; - } - if (num2 < 72) - { - baseOption = 0; - break; - } - if (num2 != 72) - break; - baseOption = 1; - break; - } - int num3 = (int) tileCache.frameX / 36 + ((int) tileCache.frameY / 18 - 1) * 18; - if (num3 < 6 || num3 == 19 || num3 == 20 || num3 == 21 || num3 == 22 || num3 == 23 || num3 == 24 || num3 == 33 || num3 == 38 || num3 == 39 || num3 == 40) - { - baseOption = 0; - break; - } - if (num3 < 16) - { - baseOption = 2; - break; - } - if (num3 < 19 || num3 == 31 || num3 == 32) - { - baseOption = 1; - break; - } - if (num3 < 31) - { - baseOption = 3; - break; - } - if (num3 < 38) - { - baseOption = 4; - break; - } - if (num3 < 59) - { - baseOption = 0; - break; - } - if (num3 >= 62) - break; - baseOption = 1; - break; - case 186: - int num4 = (int) tileCache.frameX / 54; - if (num4 < 7) - { - baseOption = 2; - break; - } - if (num4 < 22 || num4 == 33 || num4 == 34 || num4 == 35) - { - baseOption = 0; - break; - } - if (num4 < 25) - { - baseOption = 1; - break; - } - if (num4 == 25) - { - baseOption = 5; - break; - } - if (num4 >= 32) - break; - baseOption = 3; - break; - case 187: - int num5 = (int) tileCache.frameX / 54 + (int) tileCache.frameY / 36 * 36; - if (num5 < 3 || num5 == 14 || num5 == 15 || num5 == 16) - { - baseOption = 0; - break; - } - if (num5 < 6) - { - baseOption = 6; - break; - } - if (num5 < 9) - { - baseOption = 7; - break; - } - if (num5 < 14) - { - baseOption = 4; - break; - } - if (num5 < 18) - { - baseOption = 4; - break; - } - if (num5 < 23) - { - baseOption = 8; - break; - } - if (num5 < 25) - { - baseOption = 0; - break; - } - if (num5 < 29) - { - baseOption = 1; - break; - } - if (num5 < 47) - { - baseOption = 0; - break; - } - if (num5 < 50) - { - baseOption = 1; - break; - } - if (num5 < 52) - { - baseOption = 10; - break; - } - if (num5 >= 55) - break; - baseOption = 2; - break; - case 227: - baseOption = (int) tileCache.frameX / 34; - break; - case 240: - int num6 = (int) tileCache.frameX / 54 + (int) tileCache.frameY / 54 * 36; - if (num6 >= 0 && num6 <= 11 || num6 >= 47 && num6 <= 53 || num6 == 72) - { - baseOption = 0; - break; - } - if (num6 >= 12 && num6 <= 15) - { - baseOption = 1; - break; - } - if (num6 == 16 || num6 == 17) - { - baseOption = 2; - break; - } - if (num6 >= 18 && num6 <= 35 || num6 >= 63 && num6 <= 71) - { - baseOption = 1; - break; - } - if (num6 >= 41 && num6 <= 45) - { - baseOption = 3; - break; - } - if (num6 != 46) - break; - baseOption = 4; - break; - case 242: - switch ((int) tileCache.frameY / 72) - { - case 22: - case 23: - case 24: - baseOption = 1; - return; - default: - baseOption = 0; - return; - } - case 419: - int num7 = (int) tileCache.frameX / 18; - if (num7 > 2) - num7 = 2; - baseOption = num7; - break; - case 420: - int num8 = (int) tileCache.frameY / 18; - if (num8 > 5) - num8 = 5; - baseOption = num8; - break; - case 423: - int num9 = (int) tileCache.frameY / 18; - if (num9 > 6) - num9 = 6; - baseOption = num9; - break; - case 428: - int num10 = (int) tileCache.frameY / 18; - if (num10 > 3) - num10 = 3; - baseOption = num10; - break; - case 440: - int num11 = (int) tileCache.frameX / 54; - if (num11 > 6) - num11 = 6; - baseOption = num11; - break; - case 453: - int num12 = (int) tileCache.frameX / 36; - if (num12 > 2) - num12 = 2; - baseOption = num12; - break; - case 457: - int num13 = (int) tileCache.frameX / 36; - if (num13 > 4) - num13 = 4; - baseOption = num13; - break; - case 461: - if (Main.player[Main.myPlayer].ZoneCorrupt) - { - baseOption = 1; - break; - } - if (Main.player[Main.myPlayer].ZoneCrimson) - { - baseOption = 2; - break; - } - if (!Main.player[Main.myPlayer].ZoneHallow) - break; - baseOption = 3; - break; - case 467: - case 468: - int num14 = (int) tileCache.frameX / 36; - if ((uint) num14 > 11U) - { - switch (num14) - { - case 12: - case 13: - baseOption = 10; - return; - default: - baseOption = 0; - return; - } - } - else - { - baseOption = num14; - break; - } - case 493: - if (tileCache.frameX < (short) 18) - { - baseOption = 0; - break; - } - if (tileCache.frameX < (short) 36) - { - baseOption = 1; - break; - } - if (tileCache.frameX < (short) 54) - { - baseOption = 2; - break; - } - if (tileCache.frameX < (short) 72) - { - baseOption = 3; - break; - } - if (tileCache.frameX < (short) 90) - { - baseOption = 4; - break; - } - baseOption = 5; - break; - case 518: - case 519: - baseOption = (int) tileCache.frameY / 18; - break; - case 529: - baseOption = (int) tileCache.frameY / 34; - break; - case 530: - baseOption = (int) tileCache.frameY / 36; - break; - case 548: - if ((int) tileCache.frameX / 54 < 7) - { - baseOption = 0; - break; - } - baseOption = 1; - break; - case 560: - int num15 = (int) tileCache.frameX / 36; - switch (num15) - { - case 0: - case 1: - case 2: - baseOption = num15; - return; - default: - baseOption = 0; - return; - } - case 572: - baseOption = (int) tileCache.frameY / 36; - break; - case 591: - baseOption = (int) tileCache.frameX / 36; - break; - case 597: - int num16 = (int) tileCache.frameX / 54; - switch (num16) - { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - baseOption = num16; - return; - default: - baseOption = 0; - return; - } - default: - baseOption = 0; - break; - } + return MapTile.Create((ushort) (num3 + num4), (byte) num2, (byte) num1); } public static void SaveMap() - { - if (Main.ActivePlayerFileData.IsCloudSave && SocialAPI.Cloud == null || !Main.mapEnabled) - return; - if (!Monitor.TryEnter(MapHelper.IOLock)) - return; - try - { - FileUtilities.ProtectedInvoke(new Action(MapHelper.InternalSaveMap)); - } - catch (Exception ex) - { - using (StreamWriter streamWriter = new StreamWriter("client-crashlog.txt", true)) - { - streamWriter.WriteLine((object) DateTime.Now); - streamWriter.WriteLine((object) ex); - streamWriter.WriteLine(""); - } - } - finally - { - Monitor.Exit(MapHelper.IOLock); - } - } - - private static void InternalSaveMap() { bool isCloudSave = Main.ActivePlayerFileData.IsCloudSave; - string folderPath = Main.playerPathName.Substring(0, Main.playerPathName.Length - 4); - if (!isCloudSave) - Utils.TryCreatingDirectory(folderPath); - string str = folderPath + Path.DirectorySeparatorChar.ToString(); - string path = !Main.ActiveWorldFileData.UseGuidAsMapName ? str + (object) Main.worldID + ".map" : str + (object) Main.ActiveWorldFileData.UniqueId + ".map"; - new Stopwatch().Start(); - if (!Main.gameMenu) - MapHelper.noStatusText = true; - using (MemoryStream memoryStream = new MemoryStream(4000)) + if (isCloudSave && SocialAPI.Cloud == null || !Main.mapEnabled || MapHelper.saveLock) + return; + string path1 = Main.playerPathName.Substring(0, Main.playerPathName.Length - 4); + lock (MapHelper.padlock) { - using (BinaryWriter writer = new BinaryWriter((Stream) memoryStream)) + try { - using (DeflateStream deflateStream = new DeflateStream((Stream) memoryStream, (CompressionMode) 0)) + MapHelper.saveLock = true; + try { - int count = 0; - byte[] buffer = new byte[16384]; - writer.Write(230); - Main.MapFileMetadata.IncrementAndWrite(writer); - writer.Write(Main.worldName); - writer.Write(Main.worldID); - writer.Write(Main.maxTilesY); - writer.Write(Main.maxTilesX); - writer.Write((short) 623); - writer.Write((short) 316); - writer.Write((short) 3); - writer.Write((short) 256); - writer.Write((short) 256); - writer.Write((short) 256); - byte num1 = 1; - byte num2 = 0; - for (int index = 0; index < 623; ++index) + if (!isCloudSave) + Directory.CreateDirectory(path1); + } + catch + { + } + string str = path1 + Path.DirectorySeparatorChar.ToString(); + string path2 = !Main.ActiveWorldFileData.UseGuidAsMapName ? str + (object) Main.worldID + ".map" : str + Main.ActiveWorldFileData.UniqueId.ToString() + ".map"; + new Stopwatch().Start(); + bool flag1 = false; + if (!Main.gameMenu) + flag1 = true; + using (MemoryStream memoryStream = new MemoryStream(4000)) + { + using (BinaryWriter writer = new BinaryWriter((Stream) memoryStream)) { - if (MapHelper.tileOptionCounts[index] != 1) - num2 |= num1; - if (num1 == (byte) 128) + using (DeflateStream deflateStream = new DeflateStream((Stream) memoryStream, (CompressionMode) 0)) { - writer.Write(num2); - num2 = (byte) 0; - num1 = (byte) 1; - } - else - num1 <<= 1; - } - if (num1 != (byte) 1) - writer.Write(num2); - int index1 = 0; - byte num3 = 1; - byte num4 = 0; - for (; index1 < 316; ++index1) - { - if (MapHelper.wallOptionCounts[index1] != 1) - num4 |= num3; - if (num3 == (byte) 128) - { - writer.Write(num4); - num4 = (byte) 0; - num3 = (byte) 1; - } - else - num3 <<= 1; - } - if (num3 != (byte) 1) - writer.Write(num4); - for (int index2 = 0; index2 < 623; ++index2) - { - if (MapHelper.tileOptionCounts[index2] != 1) - writer.Write((byte) MapHelper.tileOptionCounts[index2]); - } - for (int index3 = 0; index3 < 316; ++index3) - { - if (MapHelper.wallOptionCounts[index3] != 1) - writer.Write((byte) MapHelper.wallOptionCounts[index3]); - } - writer.Flush(); - for (int y = 0; y < Main.maxTilesY; ++y) - { - if (!MapHelper.noStatusText) - { - float num5 = (float) y / (float) Main.maxTilesY; - Main.statusText = Lang.gen[66].Value + " " + (object) (int) ((double) num5 * 100.0 + 1.0) + "%"; - } - int num6; - for (int x1 = 0; x1 < Main.maxTilesX; x1 = num6 + 1) - { - MapTile mapTile = Main.Map[x1, y]; - byte num7; - byte num8 = num7 = (byte) 0; - bool flag1 = true; - bool flag2 = true; - int num9 = 0; - int num10 = 0; - byte num11 = 0; - int num12; - ushort num13; - int num14; - if (mapTile.Light <= (byte) 18) + int count = 0; + byte[] buffer = new byte[16384]; + writer.Write(194); + Main.MapFileMetadata.IncrementAndWrite(writer); + writer.Write(Main.worldName); + writer.Write(Main.worldID); + writer.Write(Main.maxTilesY); + writer.Write(Main.maxTilesX); + writer.Write((short) 470); + writer.Write((short) 231); + writer.Write((short) 3); + writer.Write((short) 256); + writer.Write((short) 256); + writer.Write((short) 256); + byte num1 = 1; + byte num2 = 0; + for (int index = 0; index < 470; ++index) { - flag2 = false; - flag1 = false; - num12 = 0; - num13 = (ushort) 0; - num14 = 0; - int x2 = x1 + 1; - for (int index4 = Main.maxTilesX - x1 - 1; index4 > 0 && Main.Map[x2, y].Light <= (byte) 18; ++x2) + if (MapHelper.tileOptionCounts[index] != 1) + num2 |= num1; + if (num1 == (byte) 128) { - ++num14; - --index4; + writer.Write(num2); + num2 = (byte) 0; + num1 = (byte) 1; } + else + num1 <<= 1; } - else + if (num1 != (byte) 1) + writer.Write(num2); + int index1 = 0; + byte num3 = 1; + byte num4 = 0; + for (; index1 < 231; ++index1) { - num11 = mapTile.Color; - num13 = mapTile.Type; - if ((int) num13 < (int) MapHelper.wallPosition) + if (MapHelper.wallOptionCounts[index1] != 1) + num4 |= num3; + if (num3 == (byte) 128) { - num12 = 1; - num13 -= MapHelper.tilePosition; + writer.Write(num4); + num4 = (byte) 0; + num3 = (byte) 1; } - else if ((int) num13 < (int) MapHelper.liquidPosition) + else + num3 <<= 1; + } + if (num3 != (byte) 1) + writer.Write(num4); + for (int index2 = 0; index2 < 470; ++index2) + { + if (MapHelper.tileOptionCounts[index2] != 1) + writer.Write((byte) MapHelper.tileOptionCounts[index2]); + } + for (int index3 = 0; index3 < 231; ++index3) + { + if (MapHelper.wallOptionCounts[index3] != 1) + writer.Write((byte) MapHelper.wallOptionCounts[index3]); + } + writer.Flush(); + for (int y = 0; y < Main.maxTilesY; ++y) + { + if (!flag1) { - num12 = 2; - num13 -= MapHelper.wallPosition; + float num5 = (float) y / (float) Main.maxTilesY; + Main.statusText = Lang.gen[66].Value + " " + (object) (int) ((double) num5 * 100.0 + 1.0) + "%"; } - else if ((int) num13 < (int) MapHelper.skyPosition) + int num6; + for (int x1 = 0; x1 < Main.maxTilesX; x1 = num6 + 1) { - num12 = 3 + ((int) num13 - (int) MapHelper.liquidPosition); - flag1 = false; - } - else if ((int) num13 < (int) MapHelper.dirtPosition) - { - num12 = 6; - flag2 = false; - flag1 = false; - } - else if ((int) num13 < (int) MapHelper.hellPosition) - { - num12 = 7; - if ((int) num13 < (int) MapHelper.rockPosition) - num13 -= MapHelper.dirtPosition; + MapTile mapTile = Main.Map[x1, y]; + byte num7; + byte num8 = num7 = (byte) 0; + bool flag2 = true; + bool flag3 = true; + int num9 = 0; + int num10 = 0; + byte num11 = 0; + int num12; + ushort num13; + int num14; + if (mapTile.Light <= (byte) 18) + { + flag3 = false; + flag2 = false; + num12 = 0; + num13 = (ushort) 0; + num14 = 0; + int x2 = x1 + 1; + for (int index4 = Main.maxTilesX - x1 - 1; index4 > 0 && Main.Map[x2, y].Light <= (byte) 18; ++x2) + { + ++num14; + --index4; + } + } else - num13 -= MapHelper.rockPosition; - } - else - { - num12 = 6; - flag1 = false; - } - if (mapTile.Light == byte.MaxValue) - flag2 = false; - if (flag2) - { - num14 = 0; - int x3 = x1 + 1; - int num15 = Main.maxTilesX - x1 - 1; - num9 = x3; - while (num15 > 0) { - MapTile other = Main.Map[x3, y]; - if (mapTile.EqualsWithoutLight(ref other)) + num11 = mapTile.Color; + num13 = mapTile.Type; + if ((int) num13 < (int) MapHelper.wallPosition) { - --num15; - ++num14; - ++x3; + num12 = 1; + num13 -= MapHelper.tilePosition; + } + else if ((int) num13 < (int) MapHelper.liquidPosition) + { + num12 = 2; + num13 -= MapHelper.wallPosition; + } + else if ((int) num13 < (int) MapHelper.skyPosition) + { + num12 = 3 + ((int) num13 - (int) MapHelper.liquidPosition); + flag2 = false; + } + else if ((int) num13 < (int) MapHelper.dirtPosition) + { + num12 = 6; + flag3 = false; + flag2 = false; + } + else if ((int) num13 < (int) MapHelper.hellPosition) + { + num12 = 7; + if ((int) num13 < (int) MapHelper.rockPosition) + num13 -= MapHelper.dirtPosition; + else + num13 -= MapHelper.rockPosition; } else { - num10 = x3; - break; + num12 = 6; + flag2 = false; } - } - } - else - { - num14 = 0; - int x4 = x1 + 1; - int num16 = Main.maxTilesX - x1 - 1; - while (num16 > 0) - { - MapTile other = Main.Map[x4, y]; - if (mapTile.Equals(ref other)) + if (mapTile.Light == byte.MaxValue) + flag3 = false; + if (flag3) { - --num16; - ++num14; - ++x4; + num14 = 0; + int x3 = x1 + 1; + int num15 = Main.maxTilesX - x1 - 1; + num9 = x3; + while (num15 > 0) + { + MapTile other = Main.Map[x3, y]; + if (mapTile.EqualsWithoutLight(ref other)) + { + --num15; + ++num14; + ++x3; + } + else + { + num10 = x3; + break; + } + } } else - break; + { + num14 = 0; + int x4 = x1 + 1; + int num16 = Main.maxTilesX - x1 - 1; + while (num16 > 0) + { + MapTile other = Main.Map[x4, y]; + if (mapTile.Equals(ref other)) + { + --num16; + ++num14; + ++x4; + } + else + break; + } + } + } + if (num11 > (byte) 0) + num7 |= (byte) ((uint) num11 << 1); + if (num7 != (byte) 0) + num8 |= (byte) 1; + byte num17 = (byte) ((uint) num8 | (uint) (byte) (num12 << 1)); + if (flag2 && num13 > (ushort) byte.MaxValue) + num17 |= (byte) 16; + if (flag3) + num17 |= (byte) 32; + if (num14 > 0) + { + if (num14 > (int) byte.MaxValue) + num17 |= (byte) 128; + else + num17 |= (byte) 64; + } + buffer[count] = num17; + ++count; + if (num7 != (byte) 0) + { + buffer[count] = num7; + ++count; + } + if (flag2) + { + buffer[count] = (byte) num13; + ++count; + if (num13 > (ushort) byte.MaxValue) + { + buffer[count] = (byte) ((uint) num13 >> 8); + ++count; + } + } + if (flag3) + { + buffer[count] = mapTile.Light; + ++count; + } + if (num14 > 0) + { + buffer[count] = (byte) num14; + ++count; + if (num14 > (int) byte.MaxValue) + { + buffer[count] = (byte) (num14 >> 8); + ++count; + } + } + for (int x5 = num9; x5 < num10; ++x5) + { + buffer[count] = Main.Map[x5, y].Light; + ++count; + } + num6 = x1 + num14; + if (count >= 4096) + { + ((Stream) deflateStream).Write(buffer, 0, count); + count = 0; } } } - if (num11 > (byte) 0) - num7 |= (byte) ((uint) num11 << 1); - if (num7 != (byte) 0) - num8 |= (byte) 1; - byte num17 = (byte) ((uint) num8 | (uint) (byte) (num12 << 1)); - if (flag1 && num13 > (ushort) byte.MaxValue) - num17 |= (byte) 16; - if (flag2) - num17 |= (byte) 32; - if (num14 > 0) - { - if (num14 > (int) byte.MaxValue) - num17 |= (byte) 128; - else - num17 |= (byte) 64; - } - buffer[count] = num17; - ++count; - if (num7 != (byte) 0) - { - buffer[count] = num7; - ++count; - } - if (flag1) - { - buffer[count] = (byte) num13; - ++count; - if (num13 > (ushort) byte.MaxValue) - { - buffer[count] = (byte) ((uint) num13 >> 8); - ++count; - } - } - if (flag2) - { - buffer[count] = mapTile.Light; - ++count; - } - if (num14 > 0) - { - buffer[count] = (byte) num14; - ++count; - if (num14 > (int) byte.MaxValue) - { - buffer[count] = (byte) (num14 >> 8); - ++count; - } - } - for (int x5 = num9; x5 < num10; ++x5) - { - buffer[count] = Main.Map[x5, y].Light; - ++count; - } - num6 = x1 + num14; - if (count >= 4096) - { + if (count > 0) ((Stream) deflateStream).Write(buffer, 0, count); - count = 0; - } + ((Stream) deflateStream).Dispose(); + FileUtilities.WriteAllBytes(path2, memoryStream.ToArray(), isCloudSave); } } - if (count > 0) - ((Stream) deflateStream).Write(buffer, 0, count); - ((Stream) deflateStream).Dispose(); - FileUtilities.WriteAllBytes(path, memoryStream.ToArray(), isCloudSave); } } + catch (Exception ex) + { + using (StreamWriter streamWriter = new StreamWriter("client-crashlog.txt", true)) + { + streamWriter.WriteLine((object) DateTime.Now); + streamWriter.WriteLine((object) ex); + streamWriter.WriteLine(""); + } + } + MapHelper.saveLock = false; } - MapHelper.noStatusText = false; } public static void LoadMapVersion1(BinaryReader fileIO, int release) @@ -2585,7 +1889,7 @@ label_11: index = (int) byte.MaxValue; num6 = index + (int) MapHelper.dirtPosition; } - else if (y < Main.UnderworldLayer) + else if (y < Main.maxTilesY - 200) { flag = true; if (index > (int) byte.MaxValue) @@ -2617,7 +1921,7 @@ label_11: flag = true; num9 = index + (int) MapHelper.dirtPosition; } - else if (y < Main.UnderworldLayer) + else if (y < Main.maxTilesY - 200) { flag = true; num9 = index + (int) MapHelper.rockPosition; @@ -2656,7 +1960,7 @@ label_11: flag = true; num12 = index + (int) MapHelper.dirtPosition; } - else if (y < Main.UnderworldLayer) + else if (y < Main.maxTilesY - 200) { flag = true; num12 = index + (int) MapHelper.rockPosition; @@ -2747,7 +2051,7 @@ label_11: ushort num16 = 1; ushort num17 = 1; ushort num18 = num17; - for (int index1 = 0; index1 < 623; ++index1) + for (int index1 = 0; index1 < 470; ++index1) { if (index1 < (int) num4) { @@ -2767,7 +2071,7 @@ label_11: num16 += (ushort) MapHelper.tileOptionCounts[index1]; } ushort num20 = num17; - for (int index3 = 0; index3 < 316; ++index3) + for (int index3 = 0; index3 < 231; ++index3) { if (index3 < (int) num5) { diff --git a/Map/MapIconOverlay.cs b/Map/MapIconOverlay.cs deleted file mode 100644 index 1ac95c6..0000000 --- a/Map/MapIconOverlay.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Map.MapIconOverlay -// 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; -using System.Collections.Generic; - -namespace Terraria.Map -{ - public class MapIconOverlay - { - private readonly List _layers = new List(); - - public MapIconOverlay AddLayer(IMapLayer layer) - { - this._layers.Add(layer); - return this; - } - - public void Draw( - Vector2 mapPosition, - Vector2 mapOffset, - Rectangle? clippingRect, - float mapScale, - float drawScale, - ref string text) - { - MapOverlayDrawContext context = new MapOverlayDrawContext(mapPosition, mapOffset, clippingRect, mapScale, drawScale); - foreach (IMapLayer layer in this._layers) - layer.Draw(ref context, ref text); - } - } -} diff --git a/Map/MapOverlayDrawContext.cs b/Map/MapOverlayDrawContext.cs deleted file mode 100644 index 9ea83fc..0000000 --- a/Map/MapOverlayDrawContext.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Map.MapOverlayDrawContext -// 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; -using Microsoft.Xna.Framework.Graphics; -using Terraria.DataStructures; -using Terraria.UI; - -namespace Terraria.Map -{ - public struct MapOverlayDrawContext - { - private readonly Vector2 _mapPosition; - private readonly Vector2 _mapOffset; - private readonly Rectangle? _clippingRect; - private readonly float _mapScale; - private readonly float _drawScale; - - public MapOverlayDrawContext( - Vector2 mapPosition, - Vector2 mapOffset, - Rectangle? clippingRect, - float mapScale, - float drawScale) - { - this._mapPosition = mapPosition; - this._mapOffset = mapOffset; - this._clippingRect = clippingRect; - this._mapScale = mapScale; - this._drawScale = drawScale; - } - - public MapOverlayDrawContext.DrawResult Draw( - Texture2D texture, - Vector2 position, - Alignment alignment) - { - return this.Draw(texture, position, new SpriteFrame((byte) 1, (byte) 1), alignment); - } - - public MapOverlayDrawContext.DrawResult Draw( - Texture2D texture, - Vector2 position, - SpriteFrame frame, - Alignment alignment) - { - position = (position - this._mapPosition) * this._mapScale + this._mapOffset; - if (this._clippingRect.HasValue && !this._clippingRect.Value.Contains(position.ToPoint())) - return MapOverlayDrawContext.DrawResult.Culled; - Rectangle sourceRectangle = frame.GetSourceRectangle(texture); - Vector2 origin = sourceRectangle.Size() * alignment.OffsetMultiplier; - Main.spriteBatch.Draw(texture, position, new Rectangle?(sourceRectangle), Color.White, 0.0f, origin, this._drawScale, SpriteEffects.None, 0.0f); - position -= origin * this._drawScale; - return new MapOverlayDrawContext.DrawResult(new Rectangle((int) position.X, (int) position.Y, (int) ((double) texture.Width * (double) this._drawScale), (int) ((double) texture.Height * (double) this._drawScale)).Contains(Main.MouseScreen.ToPoint())); - } - - public MapOverlayDrawContext.DrawResult Draw( - Texture2D texture, - Vector2 position, - Color color, - SpriteFrame frame, - float scaleIfNotSelected, - float scaleIfSelected, - Alignment alignment) - { - position = (position - this._mapPosition) * this._mapScale + this._mapOffset; - if (this._clippingRect.HasValue && !this._clippingRect.Value.Contains(position.ToPoint())) - return MapOverlayDrawContext.DrawResult.Culled; - Rectangle sourceRectangle = frame.GetSourceRectangle(texture); - Vector2 origin = sourceRectangle.Size() * alignment.OffsetMultiplier; - Vector2 position1 = position; - float num1 = this._drawScale * scaleIfNotSelected; - Vector2 vector2 = position - origin * num1; - int num2 = new Rectangle((int) vector2.X, (int) vector2.Y, (int) ((double) sourceRectangle.Width * (double) num1), (int) ((double) sourceRectangle.Height * (double) num1)).Contains(Main.MouseScreen.ToPoint()) ? 1 : 0; - float scale = num1; - if (num2 != 0) - scale = this._drawScale * scaleIfSelected; - Main.spriteBatch.Draw(texture, position1, new Rectangle?(sourceRectangle), color, 0.0f, origin, scale, SpriteEffects.None, 0.0f); - return new MapOverlayDrawContext.DrawResult(num2 != 0); - } - - public struct DrawResult - { - public static readonly MapOverlayDrawContext.DrawResult Culled = new MapOverlayDrawContext.DrawResult(false); - public readonly bool IsMouseOver; - - public DrawResult(bool isMouseOver) => this.IsMouseOver = isMouseOver; - } - } -} diff --git a/Map/MapTile.cs b/Map/MapTile.cs index 78c000f..2d82ab4 100644 --- a/Map/MapTile.cs +++ b/Map/MapTile.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Map.MapTile -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Map diff --git a/Map/PingMapLayer.cs b/Map/PingMapLayer.cs deleted file mode 100644 index 493af82..0000000 --- a/Map/PingMapLayer.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Map.PingMapLayer -// 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; -using ReLogic.Utilities; -using System; -using System.Collections.Generic; -using Terraria.DataStructures; -using Terraria.GameContent; -using Terraria.UI; - -namespace Terraria.Map -{ - public class PingMapLayer : IMapLayer - { - private const double PING_DURATION_IN_SECONDS = 15.0; - private const double PING_FRAME_RATE = 10.0; - private readonly SlotVector _pings = new SlotVector(100); - - public void Draw(ref MapOverlayDrawContext context, ref string text) - { - SpriteFrame frame = new SpriteFrame((byte) 1, (byte) 5); - DateTime now = DateTime.Now; - foreach (SlotVector.ItemPair ping1 in (IEnumerable.ItemPair>) this._pings) - { - PingMapLayer.Ping ping2 = (PingMapLayer.Ping) ping1.Value; - double totalSeconds = (now - ping2.Time).TotalSeconds; - int num = (int) (totalSeconds * 10.0); - frame.CurrentRow = (byte) ((uint) num % (uint) frame.RowCount); - context.Draw(TextureAssets.MapPing.Value, ping2.Position, frame, Alignment.Center); - if (totalSeconds > 15.0) - this._pings.Remove((SlotId) ping1.Id); - } - } - - public void Add(Vector2 position) - { - if (this._pings.Count == this._pings.Capacity) - return; - this._pings.Add(new PingMapLayer.Ping(position)); - } - - private struct Ping - { - public readonly Vector2 Position; - public readonly DateTime Time; - - public Ping(Vector2 position) - { - this.Position = position; - this.Time = DateTime.Now; - } - } - } -} diff --git a/Map/SpawnMapLayer.cs b/Map/SpawnMapLayer.cs deleted file mode 100644 index 4729348..0000000 --- a/Map/SpawnMapLayer.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Map.SpawnMapLayer -// 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; -using Terraria.GameContent; -using Terraria.Localization; -using Terraria.UI; - -namespace Terraria.Map -{ - public class SpawnMapLayer : IMapLayer - { - public void Draw(ref MapOverlayDrawContext context, ref string text) - { - Player localPlayer = Main.LocalPlayer; - Vector2 position1 = new Vector2((float) localPlayer.SpawnX, (float) localPlayer.SpawnY); - Vector2 position2 = new Vector2((float) Main.spawnTileX, (float) Main.spawnTileY); - if (context.Draw(TextureAssets.SpawnPoint.Value, position2, Alignment.Bottom).IsMouseOver) - text = Language.GetTextValue("UI.SpawnPoint"); - if (localPlayer.SpawnX == -1 || !context.Draw(TextureAssets.SpawnBed.Value, position1, Alignment.Bottom).IsMouseOver) - return; - text = Language.GetTextValue("UI.SpawnBed"); - } - } -} diff --git a/Map/TeleportPylonsMapLayer.cs b/Map/TeleportPylonsMapLayer.cs deleted file mode 100644 index 3db2f1a..0000000 --- a/Map/TeleportPylonsMapLayer.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Map.TeleportPylonsMapLayer -// 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; -using Microsoft.Xna.Framework.Graphics; -using System.Collections.Generic; -using Terraria.Audio; -using Terraria.DataStructures; -using Terraria.GameContent; -using Terraria.GameContent.Tile_Entities; -using Terraria.UI; - -namespace Terraria.Map -{ - public class TeleportPylonsMapLayer : IMapLayer - { - public void Draw(ref MapOverlayDrawContext context, ref string text) - { - List pylons = Main.PylonSystem.Pylons; - float scaleIfNotSelected = 1f; - float scaleIfSelected = scaleIfNotSelected * 2f; - Texture2D texture = TextureAssets.Extra[182].Value; - int num = TeleportPylonsSystem.IsPlayerNearAPylon(Main.LocalPlayer) ? 1 : 0; - Color color = Color.White; - if (num == 0) - color = Color.Gray * 0.5f; - for (int index = 0; index < pylons.Count; ++index) - { - TeleportPylonInfo info = pylons[index]; - if (context.Draw(texture, info.PositionInTiles.ToVector2() + new Vector2(1.5f, 2f), color, new SpriteFrame((byte) 9, (byte) 1, (byte) info.TypeOfPylon, (byte) 0) - { - PaddingY = 0 - }, scaleIfNotSelected, scaleIfSelected, Alignment.Center).IsMouseOver) - { - Main.cancelWormHole = true; - string itemNameValue = Lang.GetItemNameValue(TETeleportationPylon.GetPylonItemTypeFromTileStyle((int) info.TypeOfPylon)); - text = itemNameValue; - if (Main.mouseLeft && Main.mouseLeftRelease) - { - Main.mouseLeftRelease = false; - Main.mapFullscreen = false; - Main.PylonSystem.RequestTeleportation(info, Main.LocalPlayer); - SoundEngine.PlaySound(11); - } - } - } - } - } -} diff --git a/Map/WorldMap.cs b/Map/WorldMap.cs index b924760..7a7f5b8 100644 --- a/Map/WorldMap.cs +++ b/Map/WorldMap.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Map.WorldMap -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; @@ -16,7 +16,6 @@ namespace Terraria.Map { public readonly int MaxWidth; public readonly int MaxHeight; - public readonly int BlackEdgeWidth = 40; private MapTile[,] _tiles; public MapTile this[int x, int y] => this._tiles[x, y]; @@ -39,8 +38,6 @@ namespace Terraria.Map public bool UpdateLighting(int x, int y, byte light) { MapTile tile = this._tiles[x, y]; - if (light == (byte) 0 && tile.Light == (byte) 0) - return false; MapTile mapTile = MapHelper.CreateMapTile(x, y, Math.Max(tile.Light, light)); if (mapTile.Equals(ref tile)) return false; @@ -63,7 +60,6 @@ namespace Terraria.Map public void Load() { - Lighting.Clear(); bool isCloudSave = Main.ActivePlayerFileData.IsCloudSave; if (isCloudSave && SocialAPI.Cloud == null || !Main.mapEnabled) return; @@ -72,7 +68,7 @@ namespace Terraria.Map if (Main.ActiveWorldFileData.UseGuidAsMapName) { string str3 = str1; - str2 = str1 + (object) Main.ActiveWorldFileData.UniqueId + ".map"; + str2 = str1 + Main.ActiveWorldFileData.UniqueId.ToString() + ".map"; if (!FileUtilities.Exists(str2, isCloudSave)) str2 = str3 + (object) Main.worldID + ".map"; } @@ -91,13 +87,12 @@ namespace Terraria.Map try { int release = fileIO.ReadInt32(); - if (release > 230) + if (release > 194) return; if (release <= 91) MapHelper.LoadMapVersion1(fileIO, release); else MapHelper.LoadMapVersion2(fileIO, release); - this.ClearEdges(); Main.clearMap = true; Main.loadMap = true; Main.loadMapLock = true; @@ -130,29 +125,5 @@ namespace Terraria.Map this._tiles[index1, index2].Clear(); } } - - public void ClearEdges() - { - for (int index1 = 0; index1 < this.MaxWidth; ++index1) - { - for (int index2 = 0; index2 < this.BlackEdgeWidth; ++index2) - this._tiles[index1, index2].Clear(); - } - for (int index3 = 0; index3 < this.MaxWidth; ++index3) - { - for (int index4 = this.MaxHeight - this.BlackEdgeWidth; index4 < this.MaxHeight; ++index4) - this._tiles[index3, index4].Clear(); - } - for (int index = 0; index < this.BlackEdgeWidth; ++index) - { - for (int blackEdgeWidth = this.BlackEdgeWidth; blackEdgeWidth < this.MaxHeight - this.BlackEdgeWidth; ++blackEdgeWidth) - this._tiles[index, blackEdgeWidth].Clear(); - } - for (int index = this.MaxWidth - this.BlackEdgeWidth; index < this.MaxWidth; ++index) - { - for (int blackEdgeWidth = this.BlackEdgeWidth; blackEdgeWidth < this.MaxHeight - this.BlackEdgeWidth; ++blackEdgeWidth) - this._tiles[index, blackEdgeWidth].Clear(); - } - } } } diff --git a/MessageBuffer.cs b/MessageBuffer.cs index 64a8b92..0795f34 100644 --- a/MessageBuffer.cs +++ b/MessageBuffer.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.MessageBuffer -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -10,20 +10,15 @@ using System; using System.Collections.Generic; using System.IO; using Terraria.Audio; -using Terraria.Chat; using Terraria.DataStructures; -using Terraria.Enums; using Terraria.GameContent; using Terraria.GameContent.Achievements; -using Terraria.GameContent.Creative; using Terraria.GameContent.Events; -using Terraria.GameContent.Golf; using Terraria.GameContent.Tile_Entities; using Terraria.GameContent.UI; using Terraria.ID; using Terraria.Localization; using Terraria.Net; -using Terraria.Testing; using Terraria.UI; namespace Terraria @@ -46,7 +41,6 @@ namespace Terraria public MemoryStream writerStream; public BinaryReader reader; public BinaryWriter writer; - public PacketHistory History = new PacketHistory(); public static event TileChangeReceivedEvent OnTileChangeReceived; @@ -89,9 +83,12 @@ namespace Terraria int bufferStart = start + 1; byte num1 = this.readBuffer[start]; messageType = (int) num1; - if (num1 >= (byte) 140) + if (num1 >= (byte) 120) return; - Main.ActiveNetDiagnosticsUI.CountReadMessage((int) num1, length); + ++Main.rxMsg; + Main.rxData += length; + ++Main.rxMsgType[(int) num1]; + Main.rxDataType[(int) num1] += length; if (Main.netMode == 1 && Netplay.Connection.StatusMax > 0) ++Netplay.Connection.StatusCount; if (Main.verboseNetplay) @@ -106,17 +103,12 @@ namespace Terraria } if (Main.netMode == 2 && num1 != (byte) 38 && Netplay.Clients[this.whoAmI].State == -1) { - NetMessage.TrySendData(2, this.whoAmI, text: Lang.mp[1].ToNetworkText()); + NetMessage.SendData(2, this.whoAmI, text: Lang.mp[1].ToNetworkText()); } else { - if (Main.netMode == 2) - { - if (Netplay.Clients[this.whoAmI].State < 10 && num1 > (byte) 12 && num1 != (byte) 93 && num1 != (byte) 16 && num1 != (byte) 42 && num1 != (byte) 50 && num1 != (byte) 38 && num1 != (byte) 68) - NetMessage.BootPlayer(this.whoAmI, Lang.mp[2].ToNetworkText()); - if (Netplay.Clients[this.whoAmI].State == 0 && num1 != (byte) 1) - NetMessage.BootPlayer(this.whoAmI, Lang.mp[2].ToNetworkText()); - } + if (Main.netMode == 2 && Netplay.Clients[this.whoAmI].State < 10 && num1 > (byte) 12 && num1 != (byte) 93 && num1 != (byte) 16 && num1 != (byte) 42 && num1 != (byte) 50 && num1 != (byte) 38 && num1 != (byte) 68) + NetMessage.BootPlayer(this.whoAmI, Lang.mp[2].ToNetworkText()); if (this.reader == null) this.ResetReader(); this.reader.BaseStream.Position = (long) bufferStart; @@ -127,29 +119,29 @@ namespace Terraria break; if (Main.dedServ && Netplay.IsBanned(Netplay.Clients[this.whoAmI].Socket.GetRemoteAddress())) { - NetMessage.TrySendData(2, this.whoAmI, text: Lang.mp[3].ToNetworkText()); + NetMessage.SendData(2, this.whoAmI, text: Lang.mp[3].ToNetworkText()); break; } if (Netplay.Clients[this.whoAmI].State != 0) break; - if (this.reader.ReadString() == "Terraria" + (object) 230) + if (this.reader.ReadString() == "Terraria" + (object) 194) { if (string.IsNullOrEmpty(Netplay.ServerPassword)) { Netplay.Clients[this.whoAmI].State = 1; - NetMessage.TrySendData(3, this.whoAmI); + NetMessage.SendData(3, this.whoAmI); break; } Netplay.Clients[this.whoAmI].State = -1; - NetMessage.TrySendData(37, this.whoAmI); + NetMessage.SendData(37, this.whoAmI); break; } - NetMessage.TrySendData(2, this.whoAmI, text: Lang.mp[4].ToNetworkText()); + NetMessage.SendData(2, this.whoAmI, text: Lang.mp[4].ToNetworkText()); break; case 2: if (Main.netMode != 1) break; - Netplay.Disconnect = true; + Netplay.disconnect = true; Main.statusText = NetworkText.Deserialize(this.reader).ToString(); break; case 3: @@ -166,31 +158,29 @@ namespace Terraria Main.player[number1].whoAmI = number1; Main.myPlayer = number1; Player player1 = Main.player[number1]; - NetMessage.TrySendData(4, number: number1); - NetMessage.TrySendData(68, number: number1); - NetMessage.TrySendData(16, number: number1); - NetMessage.TrySendData(42, number: number1); - NetMessage.TrySendData(50, number: number1); + NetMessage.SendData(4, number: number1); + NetMessage.SendData(68, number: number1); + NetMessage.SendData(16, number: number1); + NetMessage.SendData(42, number: number1); + NetMessage.SendData(50, number: number1); for (int index = 0; index < 59; ++index) - NetMessage.TrySendData(5, number: number1, number2: ((float) index), number3: ((float) player1.inventory[index].prefix)); + NetMessage.SendData(5, number: number1, number2: ((float) index), number3: ((float) player1.inventory[index].prefix)); for (int index = 0; index < player1.armor.Length; ++index) - NetMessage.TrySendData(5, number: number1, number2: ((float) (59 + index)), number3: ((float) player1.armor[index].prefix)); + NetMessage.SendData(5, number: number1, number2: ((float) (59 + index)), number3: ((float) player1.armor[index].prefix)); for (int index = 0; index < player1.dye.Length; ++index) - NetMessage.TrySendData(5, number: number1, number2: ((float) (58 + player1.armor.Length + 1 + index)), number3: ((float) player1.dye[index].prefix)); + NetMessage.SendData(5, number: number1, number2: ((float) (58 + player1.armor.Length + 1 + index)), number3: ((float) player1.dye[index].prefix)); for (int index = 0; index < player1.miscEquips.Length; ++index) - NetMessage.TrySendData(5, number: number1, number2: ((float) (58 + player1.armor.Length + player1.dye.Length + 1 + index)), number3: ((float) player1.miscEquips[index].prefix)); + NetMessage.SendData(5, number: number1, number2: ((float) (58 + player1.armor.Length + player1.dye.Length + 1 + index)), number3: ((float) player1.miscEquips[index].prefix)); for (int index = 0; index < player1.miscDyes.Length; ++index) - NetMessage.TrySendData(5, number: number1, number2: ((float) (58 + player1.armor.Length + player1.dye.Length + player1.miscEquips.Length + 1 + index)), number3: ((float) player1.miscDyes[index].prefix)); + NetMessage.SendData(5, number: number1, number2: ((float) (58 + player1.armor.Length + player1.dye.Length + player1.miscEquips.Length + 1 + index)), number3: ((float) player1.miscDyes[index].prefix)); for (int index = 0; index < player1.bank.item.Length; ++index) - NetMessage.TrySendData(5, number: number1, number2: ((float) (58 + player1.armor.Length + player1.dye.Length + player1.miscEquips.Length + player1.miscDyes.Length + 1 + index)), number3: ((float) player1.bank.item[index].prefix)); + NetMessage.SendData(5, number: number1, number2: ((float) (58 + player1.armor.Length + player1.dye.Length + player1.miscEquips.Length + player1.miscDyes.Length + 1 + index)), number3: ((float) player1.bank.item[index].prefix)); for (int index = 0; index < player1.bank2.item.Length; ++index) - NetMessage.TrySendData(5, number: number1, number2: ((float) (58 + player1.armor.Length + player1.dye.Length + player1.miscEquips.Length + player1.miscDyes.Length + player1.bank.item.Length + 1 + index)), number3: ((float) player1.bank2.item[index].prefix)); - NetMessage.TrySendData(5, number: number1, number2: ((float) (58 + player1.armor.Length + player1.dye.Length + player1.miscEquips.Length + player1.miscDyes.Length + player1.bank.item.Length + player1.bank2.item.Length + 1)), number3: ((float) player1.trashItem.prefix)); + NetMessage.SendData(5, number: number1, number2: ((float) (58 + player1.armor.Length + player1.dye.Length + player1.miscEquips.Length + player1.miscDyes.Length + player1.bank.item.Length + 1 + index)), number3: ((float) player1.bank2.item[index].prefix)); + NetMessage.SendData(5, number: number1, number2: ((float) (58 + player1.armor.Length + player1.dye.Length + player1.miscEquips.Length + player1.miscDyes.Length + player1.bank.item.Length + player1.bank2.item.Length + 1)), number3: ((float) player1.trashItem.prefix)); for (int index = 0; index < player1.bank3.item.Length; ++index) - NetMessage.TrySendData(5, number: number1, number2: ((float) (58 + player1.armor.Length + player1.dye.Length + player1.miscEquips.Length + player1.miscDyes.Length + player1.bank.item.Length + player1.bank2.item.Length + 2 + index)), number3: ((float) player1.bank3.item[index].prefix)); - for (int index = 0; index < player1.bank4.item.Length; ++index) - NetMessage.TrySendData(5, number: number1, number2: ((float) (58 + player1.armor.Length + player1.dye.Length + player1.miscEquips.Length + player1.miscDyes.Length + player1.bank.item.Length + player1.bank2.item.Length + player1.bank3.item.Length + 2 + index)), number3: ((float) player1.bank4.item[index].prefix)); - NetMessage.TrySendData(6); + NetMessage.SendData(5, number: number1, number2: ((float) (58 + player1.armor.Length + player1.dye.Length + player1.miscEquips.Length + player1.miscDyes.Length + player1.bank.item.Length + player1.bank2.item.Length + 2 + index)), number3: ((float) player1.bank3.item[index].prefix)); + NetMessage.SendData(6); if (Netplay.Connection.State != 2) break; Netplay.Connection.State = 3; @@ -204,18 +194,18 @@ namespace Terraria Player player2 = Main.player[number2]; player2.whoAmI = number2; player2.skinVariant = (int) this.reader.ReadByte(); - player2.skinVariant = (int) MathHelper.Clamp((float) player2.skinVariant, 0.0f, 11f); + player2.skinVariant = (int) MathHelper.Clamp((float) player2.skinVariant, 0.0f, 9f); player2.hair = (int) this.reader.ReadByte(); - if (player2.hair >= 162) + if (player2.hair >= 134) player2.hair = 0; player2.name = this.reader.ReadString().Trim().Trim(); player2.hairDye = this.reader.ReadByte(); BitsByte bitsByte1 = (BitsByte) this.reader.ReadByte(); for (int key = 0; key < 8; ++key) - player2.hideVisibleAccessory[key] = bitsByte1[key]; + player2.hideVisual[key] = bitsByte1[key]; bitsByte1 = (BitsByte) this.reader.ReadByte(); for (int key = 0; key < 2; ++key) - player2.hideVisibleAccessory[key + 8] = bitsByte1[key]; + player2.hideVisual[key + 8] = bitsByte1[key]; player2.hideMisc = (BitsByte) this.reader.ReadByte(); player2.hairColor = this.reader.ReadRGB(); player2.skinColor = this.reader.ReadRGB(); @@ -227,17 +217,12 @@ namespace Terraria BitsByte bitsByte2 = (BitsByte) this.reader.ReadByte(); player2.difficulty = (byte) 0; if (bitsByte2[0]) - player2.difficulty = (byte) 1; + ++player2.difficulty; if (bitsByte2[1]) + player2.difficulty += (byte) 2; + if (player2.difficulty > (byte) 2) player2.difficulty = (byte) 2; - if (bitsByte2[3]) - player2.difficulty = (byte) 3; - if (player2.difficulty > (byte) 3) - player2.difficulty = (byte) 3; player2.extraAccessory = bitsByte2[2]; - BitsByte bitsByte3 = (BitsByte) this.reader.ReadByte(); - player2.UsingBiomeTorches = bitsByte3[0]; - player2.happyFunTorchTime = bitsByte3[1]; if (Main.netMode != 2) break; bool flag1 = false; @@ -251,105 +236,80 @@ namespace Terraria } if (flag1) { - NetMessage.TrySendData(2, this.whoAmI, text: NetworkText.FromKey(Lang.mp[5].Key, (object) player2.name)); + NetMessage.SendData(2, this.whoAmI, text: NetworkText.FromFormattable("{0} {1}", (object) player2.name, (object) Lang.mp[5].ToNetworkText())); break; } if (player2.name.Length > Player.nameLen) { - NetMessage.TrySendData(2, this.whoAmI, text: NetworkText.FromKey("Net.NameTooLong")); + NetMessage.SendData(2, this.whoAmI, text: NetworkText.FromKey("Net.NameTooLong")); break; } if (player2.name == "") { - NetMessage.TrySendData(2, this.whoAmI, text: NetworkText.FromKey("Net.EmptyName")); - break; - } - if (player2.difficulty == (byte) 3 && !Main.GameModeInfo.IsJourneyMode) - { - NetMessage.TrySendData(2, this.whoAmI, text: NetworkText.FromKey("Net.PlayerIsCreativeAndWorldIsNotCreative")); - break; - } - if (player2.difficulty != (byte) 3 && Main.GameModeInfo.IsJourneyMode) - { - NetMessage.TrySendData(2, this.whoAmI, text: NetworkText.FromKey("Net.PlayerIsNotCreativeAndWorldIsCreative")); + NetMessage.SendData(2, this.whoAmI, text: NetworkText.FromKey("Net.EmptyName")); break; } Netplay.Clients[this.whoAmI].Name = player2.name; Netplay.Clients[this.whoAmI].Name = player2.name; - NetMessage.TrySendData(4, ignoreClient: this.whoAmI, number: number2); + NetMessage.SendData(4, ignoreClient: this.whoAmI, number: number2); break; case 5: int number3 = (int) this.reader.ReadByte(); if (Main.netMode == 2) number3 = this.whoAmI; - if (number3 == Main.myPlayer && !Main.ServerSideCharacter && !Main.player[number3].HasLockedInventory()) + if (number3 == Main.myPlayer && !Main.ServerSideCharacter && !Main.player[number3].IsStackingItems()) break; Player player3 = Main.player[number3]; lock (player3) { - int index1 = (int) this.reader.ReadInt16(); + int index1 = (int) this.reader.ReadByte(); int num4 = (int) this.reader.ReadInt16(); int pre = (int) this.reader.ReadByte(); int type1 = (int) this.reader.ReadInt16(); - Item[] objArray1 = (Item[]) null; - Item[] objArray2 = (Item[]) null; + Item[] objArray = (Item[]) null; int index2 = 0; bool flag2 = false; - if (index1 > 58 + player3.armor.Length + player3.dye.Length + player3.miscEquips.Length + player3.miscDyes.Length + player3.bank.item.Length + player3.bank2.item.Length + player3.bank3.item.Length + 1) - { - index2 = index1 - 58 - (player3.armor.Length + player3.dye.Length + player3.miscEquips.Length + player3.miscDyes.Length + player3.bank.item.Length + player3.bank2.item.Length + player3.bank3.item.Length + 1) - 1; - objArray1 = player3.bank4.item; - objArray2 = Main.clientPlayer.bank4.item; - } - else if (index1 > 58 + player3.armor.Length + player3.dye.Length + player3.miscEquips.Length + player3.miscDyes.Length + player3.bank.item.Length + player3.bank2.item.Length + 1) + if (index1 > 58 + player3.armor.Length + player3.dye.Length + player3.miscEquips.Length + player3.miscDyes.Length + player3.bank.item.Length + player3.bank2.item.Length + 1) { index2 = index1 - 58 - (player3.armor.Length + player3.dye.Length + player3.miscEquips.Length + player3.miscDyes.Length + player3.bank.item.Length + player3.bank2.item.Length + 1) - 1; - objArray1 = player3.bank3.item; - objArray2 = Main.clientPlayer.bank3.item; + objArray = player3.bank3.item; } else if (index1 > 58 + player3.armor.Length + player3.dye.Length + player3.miscEquips.Length + player3.miscDyes.Length + player3.bank.item.Length + player3.bank2.item.Length) flag2 = true; else if (index1 > 58 + player3.armor.Length + player3.dye.Length + player3.miscEquips.Length + player3.miscDyes.Length + player3.bank.item.Length) { index2 = index1 - 58 - (player3.armor.Length + player3.dye.Length + player3.miscEquips.Length + player3.miscDyes.Length + player3.bank.item.Length) - 1; - objArray1 = player3.bank2.item; - objArray2 = Main.clientPlayer.bank2.item; + objArray = player3.bank2.item; } else if (index1 > 58 + player3.armor.Length + player3.dye.Length + player3.miscEquips.Length + player3.miscDyes.Length) { index2 = index1 - 58 - (player3.armor.Length + player3.dye.Length + player3.miscEquips.Length + player3.miscDyes.Length) - 1; - objArray1 = player3.bank.item; - objArray2 = Main.clientPlayer.bank.item; + objArray = player3.bank.item; } else if (index1 > 58 + player3.armor.Length + player3.dye.Length + player3.miscEquips.Length) { index2 = index1 - 58 - (player3.armor.Length + player3.dye.Length + player3.miscEquips.Length) - 1; - objArray1 = player3.miscDyes; - objArray2 = Main.clientPlayer.miscDyes; + objArray = player3.miscDyes; } else if (index1 > 58 + player3.armor.Length + player3.dye.Length) { index2 = index1 - 58 - (player3.armor.Length + player3.dye.Length) - 1; - objArray1 = player3.miscEquips; - objArray2 = Main.clientPlayer.miscEquips; + objArray = player3.miscEquips; } else if (index1 > 58 + player3.armor.Length) { index2 = index1 - 58 - player3.armor.Length - 1; - objArray1 = player3.dye; - objArray2 = Main.clientPlayer.dye; + objArray = player3.dye; } else if (index1 > 58) { index2 = index1 - 58 - 1; - objArray1 = player3.armor; - objArray2 = Main.clientPlayer.armor; + objArray = player3.armor; } else { index2 = index1; - objArray1 = player3.inventory; - objArray2 = Main.clientPlayer.inventory; + objArray = player3.inventory; } if (flag2) { @@ -357,43 +317,37 @@ namespace Terraria player3.trashItem.netDefaults(type1); player3.trashItem.stack = num4; player3.trashItem.Prefix(pre); - if (number3 == Main.myPlayer && !Main.ServerSideCharacter) - Main.clientPlayer.trashItem = player3.trashItem.Clone(); } else if (index1 <= 58) { - int type2 = objArray1[index2].type; - int stack = objArray1[index2].stack; - objArray1[index2] = new Item(); - objArray1[index2].netDefaults(type1); - objArray1[index2].stack = num4; - objArray1[index2].Prefix(pre); - if (number3 == Main.myPlayer && !Main.ServerSideCharacter) - objArray2[index2] = objArray1[index2].Clone(); + int type2 = objArray[index2].type; + int stack = objArray[index2].stack; + objArray[index2] = new Item(); + objArray[index2].netDefaults(type1); + objArray[index2].stack = num4; + objArray[index2].Prefix(pre); if (number3 == Main.myPlayer && index2 == 58) - Main.mouseItem = objArray1[index2].Clone(); + Main.mouseItem = objArray[index2].Clone(); if (number3 == Main.myPlayer && Main.netMode == 1) { Main.player[number3].inventoryChestStack[index1] = false; - if (objArray1[index2].stack != stack || objArray1[index2].type != type2) + if (objArray[index2].stack != stack || objArray[index2].type != type2) { - Recipe.FindRecipes(true); - SoundEngine.PlaySound(7); + Recipe.FindRecipes(); + Main.PlaySound(7); } } } else { - objArray1[index2] = new Item(); - objArray1[index2].netDefaults(type1); - objArray1[index2].stack = num4; - objArray1[index2].Prefix(pre); - if (number3 == Main.myPlayer && !Main.ServerSideCharacter) - objArray2[index2] = objArray1[index2].Clone(); + objArray[index2] = new Item(); + objArray[index2].netDefaults(type1); + objArray[index2].stack = num4; + objArray[index2].Prefix(pre); } if (Main.netMode != 2 || number3 != this.whoAmI || index1 > 58 + player3.armor.Length + player3.dye.Length + player3.miscEquips.Length + player3.miscDyes.Length) break; - NetMessage.TrySendData(5, ignoreClient: this.whoAmI, number: number3, number2: ((float) index1), number3: ((float) pre)); + NetMessage.SendData(5, ignoreClient: this.whoAmI, number: number3, number2: ((float) index1), number3: ((float) pre)); break; } case 6: @@ -401,17 +355,17 @@ namespace Terraria break; if (Netplay.Clients[this.whoAmI].State == 1) Netplay.Clients[this.whoAmI].State = 2; - NetMessage.TrySendData(7, this.whoAmI); + NetMessage.SendData(7, this.whoAmI); Main.SyncAnInvasion(this.whoAmI); break; case 7: if (Main.netMode != 1) break; Main.time = (double) this.reader.ReadInt32(); - BitsByte bitsByte4 = (BitsByte) this.reader.ReadByte(); - Main.dayTime = bitsByte4[0]; - Main.bloodMoon = bitsByte4[1]; - Main.eclipse = bitsByte4[2]; + BitsByte bitsByte3 = (BitsByte) this.reader.ReadByte(); + Main.dayTime = bitsByte3[0]; + Main.bloodMoon = bitsByte3[1]; + Main.eclipse = bitsByte3[2]; Main.moonPhase = (int) this.reader.ReadByte(); Main.maxTilesX = (int) this.reader.ReadInt16(); Main.maxTilesY = (int) this.reader.ReadInt16(); @@ -421,14 +375,10 @@ namespace Terraria Main.rockLayer = (double) this.reader.ReadInt16(); Main.worldID = this.reader.ReadInt32(); Main.worldName = this.reader.ReadString(); - Main.GameMode = (int) this.reader.ReadByte(); Main.ActiveWorldFileData.UniqueId = new Guid(this.reader.ReadBytes(16)); Main.ActiveWorldFileData.WorldGeneratorVersion = this.reader.ReadUInt64(); Main.moonType = (int) this.reader.ReadByte(); WorldGen.setBG(0, (int) this.reader.ReadByte()); - WorldGen.setBG(10, (int) this.reader.ReadByte()); - WorldGen.setBG(11, (int) this.reader.ReadByte()); - WorldGen.setBG(12, (int) this.reader.ReadByte()); WorldGen.setBG(1, (int) this.reader.ReadByte()); WorldGen.setBG(2, (int) this.reader.ReadByte()); WorldGen.setBG(3, (int) this.reader.ReadByte()); @@ -436,12 +386,10 @@ namespace Terraria WorldGen.setBG(5, (int) this.reader.ReadByte()); WorldGen.setBG(6, (int) this.reader.ReadByte()); WorldGen.setBG(7, (int) this.reader.ReadByte()); - WorldGen.setBG(8, (int) this.reader.ReadByte()); - WorldGen.setBG(9, (int) this.reader.ReadByte()); Main.iceBackStyle = (int) this.reader.ReadByte(); Main.jungleBackStyle = (int) this.reader.ReadByte(); Main.hellBackStyle = (int) this.reader.ReadByte(); - Main.windSpeedTarget = this.reader.ReadSingle(); + Main.windSpeedSet = this.reader.ReadSingle(); Main.numClouds = (int) this.reader.ReadByte(); for (int index = 0; index < 3; ++index) Main.treeX[index] = this.reader.ReadInt32(); @@ -451,80 +399,54 @@ namespace Terraria Main.caveBackX[index] = this.reader.ReadInt32(); for (int index = 0; index < 4; ++index) Main.caveBackStyle[index] = (int) this.reader.ReadByte(); - WorldGen.TreeTops.SyncReceive(this.reader); - WorldGen.BackgroundsCache.UpdateCache(); Main.maxRaining = this.reader.ReadSingle(); Main.raining = (double) Main.maxRaining > 0.0; + BitsByte bitsByte4 = (BitsByte) this.reader.ReadByte(); + WorldGen.shadowOrbSmashed = bitsByte4[0]; + NPC.downedBoss1 = bitsByte4[1]; + NPC.downedBoss2 = bitsByte4[2]; + NPC.downedBoss3 = bitsByte4[3]; + Main.hardMode = bitsByte4[4]; + NPC.downedClown = bitsByte4[5]; + Main.ServerSideCharacter = bitsByte4[6]; + NPC.downedPlantBoss = bitsByte4[7]; BitsByte bitsByte5 = (BitsByte) this.reader.ReadByte(); - WorldGen.shadowOrbSmashed = bitsByte5[0]; - NPC.downedBoss1 = bitsByte5[1]; - NPC.downedBoss2 = bitsByte5[2]; - NPC.downedBoss3 = bitsByte5[3]; - Main.hardMode = bitsByte5[4]; - NPC.downedClown = bitsByte5[5]; - Main.ServerSideCharacter = bitsByte5[6]; - NPC.downedPlantBoss = bitsByte5[7]; + NPC.downedMechBoss1 = bitsByte5[0]; + NPC.downedMechBoss2 = bitsByte5[1]; + NPC.downedMechBoss3 = bitsByte5[2]; + NPC.downedMechBossAny = bitsByte5[3]; + Main.cloudBGActive = bitsByte5[4] ? 1f : 0.0f; + WorldGen.crimson = bitsByte5[5]; + Main.pumpkinMoon = bitsByte5[6]; + Main.snowMoon = bitsByte5[7]; BitsByte bitsByte6 = (BitsByte) this.reader.ReadByte(); - NPC.downedMechBoss1 = bitsByte6[0]; - NPC.downedMechBoss2 = bitsByte6[1]; - NPC.downedMechBoss3 = bitsByte6[2]; - NPC.downedMechBossAny = bitsByte6[3]; - Main.cloudBGActive = bitsByte6[4] ? 1f : 0.0f; - WorldGen.crimson = bitsByte6[5]; - Main.pumpkinMoon = bitsByte6[6]; - Main.snowMoon = bitsByte6[7]; + Main.expertMode = bitsByte6[0]; + Main.fastForwardTime = bitsByte6[1]; + Main.UpdateSundial(); + int num5 = bitsByte6[2] ? 1 : 0; + NPC.downedSlimeKing = bitsByte6[3]; + NPC.downedQueenBee = bitsByte6[4]; + NPC.downedFishron = bitsByte6[5]; + NPC.downedMartians = bitsByte6[6]; + NPC.downedAncientCultist = bitsByte6[7]; BitsByte bitsByte7 = (BitsByte) this.reader.ReadByte(); - Main.fastForwardTime = bitsByte7[1]; - Main.UpdateTimeRate(); - int num5 = bitsByte7[2] ? 1 : 0; - NPC.downedSlimeKing = bitsByte7[3]; - NPC.downedQueenBee = bitsByte7[4]; - NPC.downedFishron = bitsByte7[5]; - NPC.downedMartians = bitsByte7[6]; - NPC.downedAncientCultist = bitsByte7[7]; + NPC.downedMoonlord = bitsByte7[0]; + NPC.downedHalloweenKing = bitsByte7[1]; + NPC.downedHalloweenTree = bitsByte7[2]; + NPC.downedChristmasIceQueen = bitsByte7[3]; + NPC.downedChristmasSantank = bitsByte7[4]; + NPC.downedChristmasTree = bitsByte7[5]; + NPC.downedGolemBoss = bitsByte7[6]; + BirthdayParty.ManualParty = bitsByte7[7]; BitsByte bitsByte8 = (BitsByte) this.reader.ReadByte(); - NPC.downedMoonlord = bitsByte8[0]; - NPC.downedHalloweenKing = bitsByte8[1]; - NPC.downedHalloweenTree = bitsByte8[2]; - NPC.downedChristmasIceQueen = bitsByte8[3]; - NPC.downedChristmasSantank = bitsByte8[4]; - NPC.downedChristmasTree = bitsByte8[5]; - NPC.downedGolemBoss = bitsByte8[6]; - BirthdayParty.ManualParty = bitsByte8[7]; - BitsByte bitsByte9 = (BitsByte) this.reader.ReadByte(); - NPC.downedPirates = bitsByte9[0]; - NPC.downedFrost = bitsByte9[1]; - NPC.downedGoblins = bitsByte9[2]; - Sandstorm.Happening = bitsByte9[3]; - DD2Event.Ongoing = bitsByte9[4]; - DD2Event.DownedInvasionT1 = bitsByte9[5]; - DD2Event.DownedInvasionT2 = bitsByte9[6]; - DD2Event.DownedInvasionT3 = bitsByte9[7]; - BitsByte bitsByte10 = (BitsByte) this.reader.ReadByte(); - NPC.combatBookWasUsed = bitsByte10[0]; - LanternNight.ManualLanterns = bitsByte10[1]; - NPC.downedTowerSolar = bitsByte10[2]; - NPC.downedTowerVortex = bitsByte10[3]; - NPC.downedTowerNebula = bitsByte10[4]; - NPC.downedTowerStardust = bitsByte10[5]; - Main.forceHalloweenForToday = bitsByte10[6]; - Main.forceXMasForToday = bitsByte10[7]; - BitsByte bitsByte11 = (BitsByte) this.reader.ReadByte(); - NPC.boughtCat = bitsByte11[0]; - NPC.boughtDog = bitsByte11[1]; - NPC.boughtBunny = bitsByte11[2]; - NPC.freeCake = bitsByte11[3]; - Main.drunkWorld = bitsByte11[4]; - NPC.downedEmpressOfLight = bitsByte11[5]; - NPC.downedQueenSlime = bitsByte11[6]; - Main.getGoodWorld = bitsByte11[7]; - WorldGen.SavedOreTiers.Copper = (int) this.reader.ReadInt16(); - WorldGen.SavedOreTiers.Iron = (int) this.reader.ReadInt16(); - WorldGen.SavedOreTiers.Silver = (int) this.reader.ReadInt16(); - WorldGen.SavedOreTiers.Gold = (int) this.reader.ReadInt16(); - WorldGen.SavedOreTiers.Cobalt = (int) this.reader.ReadInt16(); - WorldGen.SavedOreTiers.Mythril = (int) this.reader.ReadInt16(); - WorldGen.SavedOreTiers.Adamantite = (int) this.reader.ReadInt16(); + NPC.downedPirates = bitsByte8[0]; + NPC.downedFrost = bitsByte8[1]; + NPC.downedGoblins = bitsByte8[2]; + Sandstorm.Happening = bitsByte8[3]; + DD2Event.Ongoing = bitsByte8[4]; + DD2Event.DownedInvasionT1 = bitsByte8[5]; + DD2Event.DownedInvasionT2 = bitsByte8[6]; + DD2Event.DownedInvasionT3 = bitsByte8[7]; if (num5 != 0) Main.StartSlimeRain(); else @@ -532,13 +454,9 @@ namespace Terraria Main.invasionType = (int) this.reader.ReadSByte(); Main.LobbyId = this.reader.ReadUInt64(); Sandstorm.IntendedSeverity = this.reader.ReadSingle(); - if (Netplay.Connection.State == 3) - { - Main.windSpeedCurrent = Main.windSpeedTarget; - Netplay.Connection.State = 4; - } - Main.checkHalloween(); - Main.checkXMas(); + if (Netplay.Connection.State != 3) + break; + Netplay.Connection.State = 4; break; case 8: if (Main.netMode != 2) @@ -606,7 +524,7 @@ namespace Terraria int number5 = num10 + portals.Count; if (Netplay.Clients[this.whoAmI].State == 2) Netplay.Clients[this.whoAmI].State = 3; - NetMessage.TrySendData(9, this.whoAmI, text: Lang.inter[44].ToNetworkText(), number: number5); + NetMessage.SendData(9, this.whoAmI, text: Lang.inter[44].ToNetworkText(), number: number5); Netplay.Clients[this.whoAmI].StatusText2 = Language.GetTextValue("Net.IsReceivingTileData"); Netplay.Clients[this.whoAmI].StatusMax += number5; for (int sectionX = number4; sectionX < num8; ++sectionX) @@ -614,7 +532,7 @@ namespace Terraria for (int sectionY = num7; sectionY < num9; ++sectionY) NetMessage.SendSection(this.whoAmI, sectionX, sectionY); } - NetMessage.TrySendData(11, this.whoAmI, number: number4, number2: ((float) num7), number3: ((float) (num8 - 1)), number4: ((float) (num9 - 1))); + NetMessage.SendData(11, this.whoAmI, number: number4, number2: ((float) num7), number3: ((float) (num8 - 1)), number4: ((float) (num9 - 1))); if (flag3) { for (int sectionX = num6; sectionX < num11; ++sectionX) @@ -622,48 +540,43 @@ namespace Terraria for (int sectionY = y1; sectionY < num12; ++sectionY) NetMessage.SendSection(this.whoAmI, sectionX, sectionY, true); } - NetMessage.TrySendData(11, this.whoAmI, number: num6, number2: ((float) y1), number3: ((float) (num11 - 1)), number4: ((float) (num12 - 1))); + NetMessage.SendData(11, this.whoAmI, number: num6, number2: ((float) y1), number3: ((float) (num11 - 1)), number4: ((float) (num12 - 1))); } for (int index = 0; index < portals.Count; ++index) NetMessage.SendSection(this.whoAmI, portals[index].X, portals[index].Y, true); for (int index = 0; index < portalCenters.Count; ++index) - NetMessage.TrySendData(11, this.whoAmI, number: (portalCenters[index].X - num13), number2: ((float) (portalCenters[index].Y - num13)), number3: ((float) (portalCenters[index].X + num13 + 1)), number4: ((float) (portalCenters[index].Y + num13 + 1))); + NetMessage.SendData(11, this.whoAmI, number: (portalCenters[index].X - num13), number2: ((float) (portalCenters[index].Y - num13)), number3: ((float) (portalCenters[index].X + num13 + 1)), number4: ((float) (portalCenters[index].Y + num13 + 1))); for (int number6 = 0; number6 < 400; ++number6) { if (Main.item[number6].active) { - NetMessage.TrySendData(21, this.whoAmI, number: number6); - NetMessage.TrySendData(22, this.whoAmI, number: number6); + NetMessage.SendData(21, this.whoAmI, number: number6); + NetMessage.SendData(22, this.whoAmI, number: number6); } } for (int number7 = 0; number7 < 200; ++number7) { if (Main.npc[number7].active) - NetMessage.TrySendData(23, this.whoAmI, number: number7); + NetMessage.SendData(23, this.whoAmI, number: number7); } for (int number8 = 0; number8 < 1000; ++number8) { if (Main.projectile[number8].active && (Main.projPet[Main.projectile[number8].type] || Main.projectile[number8].netImportant)) - NetMessage.TrySendData(27, this.whoAmI, number: number8); + NetMessage.SendData(27, this.whoAmI, number: number8); } - for (int number9 = 0; number9 < 289; ++number9) - NetMessage.TrySendData(83, this.whoAmI, number: number9); - NetMessage.TrySendData(49, this.whoAmI); - NetMessage.TrySendData(57, this.whoAmI); - NetMessage.TrySendData(7, this.whoAmI); - NetMessage.TrySendData(103, number: NPC.MoonLordCountdown); - NetMessage.TrySendData(101, this.whoAmI); - NetMessage.TrySendData(136, this.whoAmI); - Main.BestiaryTracker.OnPlayerJoining(this.whoAmI); - CreativePowerManager.Instance.SyncThingsToJoiningPlayer(this.whoAmI); - Main.PylonSystem.OnPlayerJoining(this.whoAmI); + for (int number9 = 0; number9 < 267; ++number9) + NetMessage.SendData(83, this.whoAmI, number: number9); + NetMessage.SendData(49, this.whoAmI); + NetMessage.SendData(57, this.whoAmI); + NetMessage.SendData(7, this.whoAmI); + NetMessage.SendData(103, number: NPC.MoonLordCountdown); + NetMessage.SendData(101, this.whoAmI); break; case 9: if (Main.netMode != 1) break; Netplay.Connection.StatusMax += this.reader.ReadInt32(); Netplay.Connection.StatusText = NetworkText.Deserialize(this.reader).ToString(); - Netplay.Connection.StatusTextFlags = (BitsByte) this.reader.ReadByte(); break; case 10: if (Main.netMode != 1) @@ -682,11 +595,7 @@ namespace Terraria Player player4 = Main.player[index3]; player4.SpawnX = (int) this.reader.ReadInt16(); player4.SpawnY = (int) this.reader.ReadInt16(); - player4.respawnTimer = this.reader.ReadInt32(); - if (player4.respawnTimer > 0) - player4.dead = true; - PlayerSpawnContext context = (PlayerSpawnContext) this.reader.ReadByte(); - player4.Spawn(context); + player4.Spawn(); if (index3 == Main.myPlayer && Main.netMode != 2) { Main.ActivePlayerFileData.StartPlayTimer(); @@ -697,19 +606,14 @@ namespace Terraria if (Netplay.Clients[this.whoAmI].State == 3) { Netplay.Clients[this.whoAmI].State = 10; + NetMessage.greetPlayer(this.whoAmI); NetMessage.buffer[this.whoAmI].broadcast = true; NetMessage.SyncConnectedPlayer(this.whoAmI); - bool flag4 = NetMessage.DoesPlayerSlotCountAsAHost(this.whoAmI); - Main.countsAsHostForGameplay[this.whoAmI] = flag4; - if (NetMessage.DoesPlayerSlotCountAsAHost(this.whoAmI)) - NetMessage.TrySendData(139, this.whoAmI, number: this.whoAmI, number2: ((float) flag4.ToInt())); - NetMessage.TrySendData(12, ignoreClient: this.whoAmI, number: this.whoAmI, number2: ((float) (byte) context)); - NetMessage.TrySendData(74, this.whoAmI, text: NetworkText.FromLiteral(Main.player[this.whoAmI].name), number: Main.anglerQuest); - NetMessage.TrySendData(129, this.whoAmI); - NetMessage.greetPlayer(this.whoAmI); + NetMessage.SendData(12, ignoreClient: this.whoAmI, number: this.whoAmI); + NetMessage.SendData(74, this.whoAmI, text: NetworkText.FromLiteral(Main.player[this.whoAmI].name), number: Main.anglerQuest); break; } - NetMessage.TrySendData(12, ignoreClient: this.whoAmI, number: this.whoAmI, number2: ((float) (byte) context)); + NetMessage.SendData(12, ignoreClient: this.whoAmI, number: this.whoAmI); break; case 13: int number10 = (int) this.reader.ReadByte(); @@ -718,55 +622,33 @@ namespace Terraria if (Main.netMode == 2) number10 = this.whoAmI; Player player5 = Main.player[number10]; - BitsByte bitsByte12 = (BitsByte) this.reader.ReadByte(); - BitsByte bitsByte13 = (BitsByte) this.reader.ReadByte(); - BitsByte bitsByte14 = (BitsByte) this.reader.ReadByte(); - BitsByte bitsByte15 = (BitsByte) this.reader.ReadByte(); - player5.controlUp = bitsByte12[0]; - player5.controlDown = bitsByte12[1]; - player5.controlLeft = bitsByte12[2]; - player5.controlRight = bitsByte12[3]; - player5.controlJump = bitsByte12[4]; - player5.controlUseItem = bitsByte12[5]; - player5.direction = bitsByte12[6] ? 1 : -1; - if (bitsByte13[0]) + BitsByte bitsByte9 = (BitsByte) this.reader.ReadByte(); + player5.controlUp = bitsByte9[0]; + player5.controlDown = bitsByte9[1]; + player5.controlLeft = bitsByte9[2]; + player5.controlRight = bitsByte9[3]; + player5.controlJump = bitsByte9[4]; + player5.controlUseItem = bitsByte9[5]; + player5.direction = bitsByte9[6] ? 1 : -1; + BitsByte bitsByte10 = (BitsByte) this.reader.ReadByte(); + if (bitsByte10[0]) { player5.pulley = true; - player5.pulleyDir = bitsByte13[1] ? (byte) 2 : (byte) 1; + player5.pulleyDir = bitsByte10[1] ? (byte) 2 : (byte) 1; } else player5.pulley = false; - player5.vortexStealthActive = bitsByte13[3]; - player5.gravDir = bitsByte13[4] ? 1f : -1f; - player5.TryTogglingShield(bitsByte13[5]); - player5.ghost = bitsByte13[6]; player5.selectedItem = (int) this.reader.ReadByte(); player5.position = this.reader.ReadVector2(); - if (bitsByte13[2]) + if (bitsByte10[2]) player5.velocity = this.reader.ReadVector2(); else player5.velocity = Vector2.Zero; - if (bitsByte14[6]) - { - player5.PotionOfReturnOriginalUsePosition = new Vector2?(this.reader.ReadVector2()); - player5.PotionOfReturnHomePosition = new Vector2?(this.reader.ReadVector2()); - } - else - { - player5.PotionOfReturnOriginalUsePosition = new Vector2?(); - player5.PotionOfReturnHomePosition = new Vector2?(); - } - player5.tryKeepingHoveringUp = bitsByte14[0]; - player5.IsVoidVaultEnabled = bitsByte14[1]; - player5.sitting.isSitting = bitsByte14[2]; - player5.downedDD2EventAnyDifficulty = bitsByte14[3]; - player5.isPettingAnimal = bitsByte14[4]; - player5.isTheAnimalBeingPetSmall = bitsByte14[5]; - player5.tryKeepingHoveringDown = bitsByte14[7]; - player5.sleeping.SetIsSleepingAndAdjustPlayerRotation(player5, bitsByte15[0]); + player5.vortexStealthActive = bitsByte10[3]; + player5.gravDir = bitsByte10[4] ? 1f : -1f; if (Main.netMode != 2 || Netplay.Clients[this.whoAmI].State != 10) break; - NetMessage.TrySendData(13, ignoreClient: this.whoAmI, number: number10); + NetMessage.SendData(13, ignoreClient: this.whoAmI, number: number10); break; case 14: int playerIndex = (int) this.reader.ReadByte(); @@ -792,8 +674,6 @@ namespace Terraria } Player.Hooks.PlayerDisconnect(playerIndex); break; - case 15: - break; case 16: int number11 = (int) this.reader.ReadByte(); if (number11 == Main.myPlayer && !Main.ServerSideCharacter) @@ -808,7 +688,7 @@ namespace Terraria player6.dead = player6.statLife <= 0; if (Main.netMode != 2) break; - NetMessage.TrySendData(16, ignoreClient: this.whoAmI, number: number11); + NetMessage.SendData(16, ignoreClient: this.whoAmI, number: number11); break; case 17: byte num17 = this.reader.ReadByte(); @@ -834,11 +714,7 @@ namespace Terraria fail = true; } if (num17 == (byte) 0) - { WorldGen.KillTile(index4, index5, fail); - if (Main.netMode == 1 && !fail) - HitTile.ClearAllTilesAtThisLocation(index4, index5); - } if (num17 == (byte) 1) WorldGen.PlaceTile(index4, index5, (int) num18, forced: true, style: num19); if (num17 == (byte) 2) @@ -887,31 +763,10 @@ namespace Terraria Wiring.SetCurrentUser(); break; } - if (num17 == (byte) 20) - { - if (!WorldGen.InWorld(index4, index5, 2)) - break; - int type = (int) Main.tile[index4, index5].type; - WorldGen.KillTile(index4, index5, fail); - short num20 = (int) Main.tile[index4, index5].type == type ? (short) 1 : (short) 0; - if (Main.netMode != 2) - break; - NetMessage.TrySendData(17, number: ((int) num17), number2: ((float) index4), number3: ((float) index5), number4: ((float) num20), number5: num19); - break; - } - if (num17 == (byte) 21) - WorldGen.ReplaceTile(index4, index5, (ushort) num18, num19); - if (num17 == (byte) 22) - WorldGen.ReplaceWall(index4, index5, (ushort) num18); - if (num17 == (byte) 23) - { - WorldGen.SlopeTile(index4, index5, (int) num18); - WorldGen.PoundTile(index4, index5); - } if (Main.netMode != 2) break; - NetMessage.TrySendData(17, ignoreClient: this.whoAmI, number: ((int) num17), number2: ((float) index4), number3: ((float) index5), number4: ((float) num18), number5: num19); - if (num17 != (byte) 1 && num17 != (byte) 21 || !TileID.Sets.Falling[(int) num18]) + NetMessage.SendData(17, ignoreClient: this.whoAmI, number: ((int) num17), number2: ((float) index4), number3: ((float) index5), number4: ((float) num18), number5: num19); + if (num17 != (byte) 1 || num18 != (short) 53) break; NetMessage.SendTileSquare(-1, index4, index5, 1); break; @@ -924,79 +779,79 @@ namespace Terraria Main.moonModY = this.reader.ReadInt16(); break; case 19: - byte num21 = this.reader.ReadByte(); + byte num20 = this.reader.ReadByte(); + int num21 = (int) this.reader.ReadInt16(); int num22 = (int) this.reader.ReadInt16(); - int num23 = (int) this.reader.ReadInt16(); - if (!WorldGen.InWorld(num22, num23, 3)) + if (!WorldGen.InWorld(num21, num22, 3)) break; int direction1 = this.reader.ReadByte() == (byte) 0 ? -1 : 1; - switch (num21) + switch (num20) { case 0: - WorldGen.OpenDoor(num22, num23, direction1); + WorldGen.OpenDoor(num21, num22, direction1); break; case 1: - WorldGen.CloseDoor(num22, num23, true); + WorldGen.CloseDoor(num21, num22, true); break; case 2: - WorldGen.ShiftTrapdoor(num22, num23, direction1 == 1, 1); + WorldGen.ShiftTrapdoor(num21, num22, direction1 == 1, 1); break; case 3: - WorldGen.ShiftTrapdoor(num22, num23, direction1 == 1, 0); + WorldGen.ShiftTrapdoor(num21, num22, direction1 == 1, 0); break; case 4: - WorldGen.ShiftTallGate(num22, num23, false, true); + WorldGen.ShiftTallGate(num21, num22, false); break; case 5: - WorldGen.ShiftTallGate(num22, num23, true, true); + WorldGen.ShiftTallGate(num21, num22, true); break; } if (Main.netMode != 2) break; - NetMessage.TrySendData(19, ignoreClient: this.whoAmI, number: ((int) num21), number2: ((float) num22), number3: ((float) num23), number4: (direction1 == 1 ? 1f : 0.0f)); + NetMessage.SendData(19, ignoreClient: this.whoAmI, number: ((int) num20), number2: ((float) num21), number3: ((float) num22), number4: (direction1 == 1 ? 1f : 0.0f)); break; case 20: - int num24 = (int) this.reader.ReadUInt16(); - short num25 = (short) (num24 & (int) short.MaxValue); - int num26 = (uint) (num24 & 32768) > 0U ? 1 : 0; - byte num27 = 0; - if (num26 != 0) - num27 = this.reader.ReadByte(); + int num23 = (int) this.reader.ReadUInt16(); + short num24 = (short) (num23 & (int) short.MaxValue); + int num25 = (uint) (num23 & 32768) > 0U ? 1 : 0; + byte num26 = 0; + if (num25 != 0) + num26 = this.reader.ReadByte(); + int num27 = (int) this.reader.ReadInt16(); int num28 = (int) this.reader.ReadInt16(); - int num29 = (int) this.reader.ReadInt16(); - if (!WorldGen.InWorld(num28, num29, 3)) + if (!WorldGen.InWorld(num27, num28, 3)) break; TileChangeType type3 = TileChangeType.None; - if (Enum.IsDefined(typeof (TileChangeType), (object) num27)) - type3 = (TileChangeType) num27; + if (Enum.IsDefined(typeof (TileChangeType), (object) num26)) + type3 = (TileChangeType) num26; if (MessageBuffer.OnTileChangeReceived != null) - MessageBuffer.OnTileChangeReceived(num28, num29, (int) num25, type3); - BitsByte bitsByte16 = (BitsByte) (byte) 0; - BitsByte bitsByte17 = (BitsByte) (byte) 0; - for (int index6 = num28; index6 < num28 + (int) num25; ++index6) + MessageBuffer.OnTileChangeReceived(num27, num28, (int) num24, type3); + BitsByte bitsByte11 = (BitsByte) (byte) 0; + BitsByte bitsByte12 = (BitsByte) (byte) 0; + for (int index6 = num27; index6 < num27 + (int) num24; ++index6) { - for (int index7 = num29; index7 < num29 + (int) num25; ++index7) + for (int index7 = num28; index7 < num28 + (int) num24; ++index7) { if (Main.tile[index6, index7] == null) Main.tile[index6, index7] = new Tile(); Tile tile = Main.tile[index6, index7]; - bool flag5 = tile.active(); - BitsByte bitsByte18 = (BitsByte) this.reader.ReadByte(); - BitsByte bitsByte19 = (BitsByte) this.reader.ReadByte(); - tile.active(bitsByte18[0]); - tile.wall = bitsByte18[2] ? (ushort) 1 : (ushort) 0; - bool flag6 = bitsByte18[3]; + bool flag4 = tile.active(); + BitsByte bitsByte13 = (BitsByte) this.reader.ReadByte(); + BitsByte bitsByte14 = (BitsByte) this.reader.ReadByte(); + tile.active(bitsByte13[0]); + tile.wall = bitsByte13[2] ? (byte) 1 : (byte) 0; + bool flag5 = bitsByte13[3]; if (Main.netMode != 2) - tile.liquid = flag6 ? (byte) 1 : (byte) 0; - tile.wire(bitsByte18[4]); - tile.halfBrick(bitsByte18[5]); - tile.actuator(bitsByte18[6]); - tile.inActive(bitsByte18[7]); - tile.wire2(bitsByte19[0]); - tile.wire3(bitsByte19[1]); - if (bitsByte19[2]) + tile.liquid = flag5 ? (byte) 1 : (byte) 0; + tile.wire(bitsByte13[4]); + tile.halfBrick(bitsByte13[5]); + tile.actuator(bitsByte13[6]); + tile.inActive(bitsByte13[7]); + tile.wire2(bitsByte14[0]); + tile.wire3(bitsByte14[1]); + if (bitsByte14[2]) tile.color(this.reader.ReadByte()); - if (bitsByte19[3]) + if (bitsByte14[3]) tile.wallColor(this.reader.ReadByte()); if (tile.active()) { @@ -1007,34 +862,34 @@ namespace Terraria tile.frameX = this.reader.ReadInt16(); tile.frameY = this.reader.ReadInt16(); } - else if (!flag5 || (int) tile.type != type4) + else if (!flag4 || (int) tile.type != type4) { tile.frameX = (short) -1; tile.frameY = (short) -1; } byte slope = 0; - if (bitsByte19[4]) + if (bitsByte14[4]) ++slope; - if (bitsByte19[5]) + if (bitsByte14[5]) slope += (byte) 2; - if (bitsByte19[6]) + if (bitsByte14[6]) slope += (byte) 4; tile.slope(slope); } - tile.wire4(bitsByte19[7]); - if (tile.wall > (ushort) 0) - tile.wall = this.reader.ReadUInt16(); - if (flag6) + tile.wire4(bitsByte14[7]); + if (tile.wall > (byte) 0) + tile.wall = this.reader.ReadByte(); + if (flag5) { tile.liquid = this.reader.ReadByte(); tile.liquidType((int) this.reader.ReadByte()); } } } - WorldGen.RangeFrame(num28, num29, num28 + (int) num25, num29 + (int) num25); + WorldGen.RangeFrame(num27, num28, num27 + (int) num24, num28 + (int) num24); if (Main.netMode != 2) break; - NetMessage.TrySendData((int) num1, ignoreClient: this.whoAmI, number: ((int) num25), number2: ((float) num28), number3: ((float) num29)); + NetMessage.SendData((int) num1, ignoreClient: this.whoAmI, number: ((int) num24), number2: ((float) num27), number3: ((float) num28)); break; case 21: case 90: @@ -1043,7 +898,7 @@ namespace Terraria Vector2 vector2_2 = this.reader.ReadVector2(); int Stack = (int) this.reader.ReadInt16(); int pre1 = (int) this.reader.ReadByte(); - int num30 = (int) this.reader.ReadByte(); + int num29 = (int) this.reader.ReadByte(); int type5 = (int) this.reader.ReadInt16(); if (Main.netMode == 1) { @@ -1054,11 +909,9 @@ namespace Terraria } int index9 = index8; Item obj = Main.item[index9]; - ItemSyncPersistentStats syncPersistentStats = new ItemSyncPersistentStats(); - syncPersistentStats.CopyFrom(obj); - bool flag7 = (obj.newAndShiny || obj.netID != type5) && ItemSlot.Options.HighlightNewItems && (type5 < 0 || type5 >= 5045 || !ItemID.Sets.NeverAppearsAsNewInInventory[type5]); + bool flag6 = (obj.newAndShiny || obj.netID != type5) && ItemSlot.Options.HighlightNewItems && (type5 < 0 || type5 >= 3930 || !ItemID.Sets.NeverShiny[type5]); obj.netDefaults(type5); - obj.newAndShiny = flag7; + obj.newAndShiny = flag6; obj.Prefix(pre1); obj.stack = Stack; obj.position = vector2_1; @@ -1067,27 +920,26 @@ namespace Terraria if (num1 == (byte) 90) { obj.instanced = true; - obj.playerIndexTheItemIsReservedFor = Main.myPlayer; + obj.owner = Main.myPlayer; obj.keepTime = 600; } obj.wet = Collision.WetCollision(obj.position, obj.width, obj.height); - syncPersistentStats.PasteInto(obj); break; } - if (Main.timeItemSlotCannotBeReusedFor[index8] > 0) + if (Main.itemLockoutTime[index8] > 0) break; if (type5 == 0) { if (index8 >= 400) break; Main.item[index8].active = false; - NetMessage.TrySendData(21, number: index8); + NetMessage.SendData(21, number: index8); break; } - bool flag8 = false; + bool flag7 = false; if (index8 == 400) - flag8 = true; - if (flag8) + flag7 = true; + if (flag7) { Item obj = new Item(); obj.netDefaults(type5); @@ -1100,11 +952,11 @@ namespace Terraria obj1.position = vector2_1; obj1.velocity = vector2_2; obj1.active = true; - obj1.playerIndexTheItemIsReservedFor = Main.myPlayer; - if (flag8) + obj1.owner = Main.myPlayer; + if (flag7) { - NetMessage.TrySendData(21, number: index8); - if (num30 == 0) + NetMessage.SendData(21, number: index8); + if (num29 == 0) { Main.item[index8].ownIgnore = this.whoAmI; Main.item[index8].ownTime = 100; @@ -1112,20 +964,20 @@ namespace Terraria Main.item[index8].FindOwner(index8); break; } - NetMessage.TrySendData(21, ignoreClient: this.whoAmI, number: index8); + NetMessage.SendData(21, ignoreClient: this.whoAmI, number: index8); break; case 22: int number12 = (int) this.reader.ReadInt16(); - int num31 = (int) this.reader.ReadByte(); - if (Main.netMode == 2 && Main.item[number12].playerIndexTheItemIsReservedFor != this.whoAmI) + int num30 = (int) this.reader.ReadByte(); + if (Main.netMode == 2 && Main.item[number12].owner != this.whoAmI) break; - Main.item[number12].playerIndexTheItemIsReservedFor = num31; - Main.item[number12].keepTime = num31 != Main.myPlayer ? 0 : 15; + Main.item[number12].owner = num30; + Main.item[number12].keepTime = num30 != Main.myPlayer ? 0 : 15; if (Main.netMode != 2) break; - Main.item[number12].playerIndexTheItemIsReservedFor = (int) byte.MaxValue; + Main.item[number12].owner = (int) byte.MaxValue; Main.item[number12].keepTime = 15; - NetMessage.TrySendData(22, number: number12); + NetMessage.SendData(22, number: number12); break; case 23: if (Main.netMode != 1) @@ -1133,64 +985,53 @@ namespace Terraria int index10 = (int) this.reader.ReadInt16(); Vector2 vector2_3 = this.reader.ReadVector2(); Vector2 vector2_4 = this.reader.ReadVector2(); - int num32 = (int) this.reader.ReadUInt16(); - if (num32 == (int) ushort.MaxValue) - num32 = 0; - BitsByte bitsByte20 = (BitsByte) this.reader.ReadByte(); - BitsByte bitsByte21 = (BitsByte) this.reader.ReadByte(); + int num31 = (int) this.reader.ReadUInt16(); + if (num31 == (int) ushort.MaxValue) + num31 = 0; + BitsByte bitsByte15 = (BitsByte) this.reader.ReadByte(); float[] numArray1 = new float[NPC.maxAI]; for (int index11 = 0; index11 < NPC.maxAI; ++index11) - numArray1[index11] = !bitsByte20[index11 + 2] ? 0.0f : this.reader.ReadSingle(); + numArray1[index11] = !bitsByte15[index11 + 2] ? 0.0f : this.reader.ReadSingle(); int Type1 = (int) this.reader.ReadInt16(); - int? nullable = new int?(1); - if (bitsByte21[0]) - nullable = new int?((int) this.reader.ReadByte()); - float num33 = 1f; - if (bitsByte21[2]) - num33 = this.reader.ReadSingle(); - int num34 = 0; - if (!bitsByte20[7]) + int num32 = 0; + if (!bitsByte15[7]) { switch (this.reader.ReadByte()) { case 2: - num34 = (int) this.reader.ReadInt16(); + num32 = (int) this.reader.ReadInt16(); break; case 4: - num34 = this.reader.ReadInt32(); + num32 = this.reader.ReadInt32(); break; default: - num34 = (int) this.reader.ReadSByte(); + num32 = (int) this.reader.ReadSByte(); break; } } int oldType = -1; NPC npc1 = Main.npc[index10]; - if (npc1.active && Main.multiplayerNPCSmoothingRange > 0 && (double) Vector2.DistanceSquared(npc1.position, vector2_3) < 640000.0) - npc1.netOffset += npc1.position - vector2_3; if (!npc1.active || npc1.netID != Type1) { - npc1.netOffset *= 0.0f; if (npc1.active) oldType = npc1.type; npc1.active = true; npc1.SetDefaults(Type1); } + if ((double) Vector2.DistanceSquared(npc1.position, vector2_3) < 6400.0) + npc1.visualOffset = npc1.position - vector2_3; npc1.position = vector2_3; npc1.velocity = vector2_4; - npc1.target = num32; - npc1.direction = bitsByte20[0] ? 1 : -1; - npc1.directionY = bitsByte20[1] ? 1 : -1; - npc1.spriteDirection = bitsByte20[6] ? 1 : -1; - if (bitsByte20[7]) - num34 = npc1.life = npc1.lifeMax; + npc1.target = num31; + npc1.direction = bitsByte15[0] ? 1 : -1; + npc1.directionY = bitsByte15[1] ? 1 : -1; + npc1.spriteDirection = bitsByte15[6] ? 1 : -1; + if (bitsByte15[7]) + num32 = npc1.life = npc1.lifeMax; else - npc1.life = num34; - if (num34 <= 0) + npc1.life = num32; + if (num32 <= 0) npc1.active = false; - npc1.SpawnedFromStatue = bitsByte21[0]; - if (npc1.SpawnedFromStatue) - npc1.value = 0.0f; for (int index12 = 0; index12 < NPC.maxAI; ++index12) npc1.ai[index12] = numArray1[index12]; if (oldType > -1 && oldType != npc1.type) @@ -1199,7 +1040,7 @@ namespace Terraria NPC.plantBoss = index10; if (Type1 == 245) NPC.golemBoss = index10; - if (npc1.type < 0 || npc1.type >= 663 || !Main.npcCatchable[npc1.type]) + if (npc1.type < 0 || npc1.type >= 580 || !Main.npcCatchable[npc1.type]) break; npc1.releaseOwner = (short) this.reader.ReadByte(); break; @@ -1212,46 +1053,34 @@ namespace Terraria Main.npc[number13].StrikeNPC(player7.inventory[player7.selectedItem].damage, player7.inventory[player7.selectedItem].knockBack, player7.direction); if (Main.netMode != 2) break; - NetMessage.TrySendData(24, ignoreClient: this.whoAmI, number: number13, number2: ((float) index13)); - NetMessage.TrySendData(23, number: number13); - break; - case 25: - break; - case 26: + NetMessage.SendData(24, ignoreClient: this.whoAmI, number: number13, number2: ((float) index13)); + NetMessage.SendData(23, number: number13); break; case 27: - int num35 = (int) this.reader.ReadInt16(); + int num33 = (int) this.reader.ReadInt16(); Vector2 vector2_5 = this.reader.ReadVector2(); Vector2 vector2_6 = this.reader.ReadVector2(); + float num34 = this.reader.ReadSingle(); + int num35 = (int) this.reader.ReadInt16(); int index14 = (int) this.reader.ReadByte(); int Type2 = (int) this.reader.ReadInt16(); - BitsByte bitsByte22 = (BitsByte) this.reader.ReadByte(); + BitsByte bitsByte16 = (BitsByte) this.reader.ReadByte(); float[] numArray2 = new float[Projectile.maxAI]; for (int key = 0; key < Projectile.maxAI; ++key) - numArray2[key] = !bitsByte22[key] ? 0.0f : this.reader.ReadSingle(); - int num36 = bitsByte22[4] ? (int) this.reader.ReadInt16() : 0; - float num37 = bitsByte22[5] ? this.reader.ReadSingle() : 0.0f; - int num38 = bitsByte22[6] ? (int) this.reader.ReadInt16() : 0; - int index15 = bitsByte22[7] ? (int) this.reader.ReadInt16() : -1; + numArray2[key] = !bitsByte16[key] ? 0.0f : this.reader.ReadSingle(); + int index15 = bitsByte16[Projectile.maxAI] ? (int) this.reader.ReadInt16() : -1; if (index15 >= 1000) index15 = -1; if (Main.netMode == 2) { - if (Type2 == 949) - { - index14 = (int) byte.MaxValue; - } - else - { - index14 = this.whoAmI; - if (Main.projHostile[Type2]) - break; - } + index14 = this.whoAmI; + if (Main.projHostile[Type2]) + break; } int number14 = 1000; for (int index16 = 0; index16 < 1000; ++index16) { - if (Main.projectile[index16].owner == index14 && Main.projectile[index16].identity == num35 && Main.projectile[index16].active) + if (Main.projectile[index16].owner == index14 && Main.projectile[index16].identity == num33 && Main.projectile[index16].active) { number14 = index16; break; @@ -1268,41 +1097,38 @@ namespace Terraria } } } - if (number14 == 1000) - number14 = Projectile.FindOldestProjectile(); - Projectile projectile = Main.projectile[number14]; - if (!projectile.active || projectile.type != Type2) + Projectile projectile1 = Main.projectile[number14]; + if (!projectile1.active || projectile1.type != Type2) { - projectile.SetDefaults(Type2); + projectile1.SetDefaults(Type2); if (Main.netMode == 2) ++Netplay.Clients[this.whoAmI].SpamProjectile; } - projectile.identity = num35; - projectile.position = vector2_5; - projectile.velocity = vector2_6; - projectile.type = Type2; - projectile.damage = num36; - projectile.originalDamage = num38; - projectile.knockBack = num37; - projectile.owner = index14; + projectile1.identity = num33; + projectile1.position = vector2_5; + projectile1.velocity = vector2_6; + projectile1.type = Type2; + projectile1.damage = num35; + projectile1.knockBack = num34; + projectile1.owner = index14; for (int index18 = 0; index18 < Projectile.maxAI; ++index18) - projectile.ai[index18] = numArray2[index18]; + projectile1.ai[index18] = numArray2[index18]; if (index15 >= 0) { - projectile.projUUID = index15; + projectile1.projUUID = index15; Main.projectileIdentity[index14, index15] = number14; } - projectile.ProjectileFixDesperation(); + projectile1.ProjectileFixDesperation(); if (Main.netMode != 2) break; - NetMessage.TrySendData(27, ignoreClient: this.whoAmI, number: number14); + NetMessage.SendData(27, ignoreClient: this.whoAmI, number: number14); break; case 28: int number15 = (int) this.reader.ReadInt16(); int Damage1 = (int) this.reader.ReadInt16(); - float num39 = this.reader.ReadSingle(); + float num36 = this.reader.ReadSingle(); int hitDirection = (int) this.reader.ReadByte() - 1; - byte num40 = this.reader.ReadByte(); + byte num37 = this.reader.ReadByte(); if (Main.netMode == 2) { if (Damage1 < 0) @@ -1311,7 +1137,7 @@ namespace Terraria } if (Damage1 >= 0) { - Main.npc[number15].StrikeNPC(Damage1, num39, hitDirection, num40 == (byte) 1, fromNet: true); + Main.npc[number15].StrikeNPC(Damage1, num36, hitDirection, num37 == (byte) 1, fromNet: true); } else { @@ -1321,28 +1147,28 @@ namespace Terraria } if (Main.netMode != 2) break; - NetMessage.TrySendData(28, ignoreClient: this.whoAmI, number: number15, number2: ((float) Damage1), number3: num39, number4: ((float) hitDirection), number5: ((int) num40)); + NetMessage.SendData(28, ignoreClient: this.whoAmI, number: number15, number2: ((float) Damage1), number3: num36, number4: ((float) hitDirection), number5: ((int) num37)); if (Main.npc[number15].life <= 0) - NetMessage.TrySendData(23, number: number15); + NetMessage.SendData(23, number: number15); else Main.npc[number15].netUpdate = true; if (Main.npc[number15].realLife < 0) break; if (Main.npc[Main.npc[number15].realLife].life <= 0) { - NetMessage.TrySendData(23, number: Main.npc[number15].realLife); + NetMessage.SendData(23, number: Main.npc[number15].realLife); break; } Main.npc[Main.npc[number15].realLife].netUpdate = true; break; case 29: int number16 = (int) this.reader.ReadInt16(); - int num41 = (int) this.reader.ReadByte(); + int num38 = (int) this.reader.ReadByte(); if (Main.netMode == 2) - num41 = this.whoAmI; + num38 = this.whoAmI; for (int index19 = 0; index19 < 1000; ++index19) { - if (Main.projectile[index19].owner == num41 && Main.projectile[index19].identity == number16 && Main.projectile[index19].active) + if (Main.projectile[index19].owner == num38 && Main.projectile[index19].identity == number16 && Main.projectile[index19].active) { Main.projectile[index19].Kill(); break; @@ -1350,72 +1176,62 @@ namespace Terraria } if (Main.netMode != 2) break; - NetMessage.TrySendData(29, ignoreClient: this.whoAmI, number: number16, number2: ((float) num41)); + NetMessage.SendData(29, ignoreClient: this.whoAmI, number: number16, number2: ((float) num38)); break; case 30: int number17 = (int) this.reader.ReadByte(); if (Main.netMode == 2) number17 = this.whoAmI; - bool flag9 = this.reader.ReadBoolean(); - Main.player[number17].hostile = flag9; + bool flag8 = this.reader.ReadBoolean(); + Main.player[number17].hostile = flag8; if (Main.netMode != 2) break; - NetMessage.TrySendData(30, ignoreClient: this.whoAmI, number: number17); - LocalizedText localizedText1 = flag9 ? Lang.mp[11] : Lang.mp[12]; + NetMessage.SendData(30, ignoreClient: this.whoAmI, number: number17); + LocalizedText localizedText1 = flag8 ? Lang.mp[11] : Lang.mp[12]; Color color1 = Main.teamColor[Main.player[number17].team]; - ChatHelper.BroadcastChatMessage(NetworkText.FromKey(localizedText1.Key, (object) Main.player[number17].name), color1); + NetMessage.BroadcastChatMessage(NetworkText.FromKey(localizedText1.Key, (object) Main.player[number17].name), color1); break; case 31: if (Main.netMode != 2) break; - int num42 = (int) this.reader.ReadInt16(); - int num43 = (int) this.reader.ReadInt16(); - int chest1 = Chest.FindChest(num42, num43); + int chest1 = Chest.FindChest((int) this.reader.ReadInt16(), (int) this.reader.ReadInt16()); if (chest1 <= -1 || Chest.UsingChest(chest1) != -1) break; for (int index20 = 0; index20 < 40; ++index20) - NetMessage.TrySendData(32, this.whoAmI, number: chest1, number2: ((float) index20)); - NetMessage.TrySendData(33, this.whoAmI, number: chest1); + NetMessage.SendData(32, this.whoAmI, number: chest1, number2: ((float) index20)); + NetMessage.SendData(33, this.whoAmI, number: chest1); Main.player[this.whoAmI].chest = chest1; if (Main.myPlayer == this.whoAmI) Main.recBigList = false; - NetMessage.TrySendData(80, ignoreClient: this.whoAmI, number: this.whoAmI, number2: ((float) chest1)); - if (Main.netMode != 2 || !WorldGen.IsChestRigged(num42, num43)) - break; - Wiring.SetCurrentUser(this.whoAmI); - Wiring.HitSwitch(num42, num43); - Wiring.SetCurrentUser(); - NetMessage.TrySendData(59, ignoreClient: this.whoAmI, number: num42, number2: ((float) num43)); + NetMessage.SendData(80, ignoreClient: this.whoAmI, number: this.whoAmI, number2: ((float) chest1)); break; case 32: int index21 = (int) this.reader.ReadInt16(); int index22 = (int) this.reader.ReadByte(); - int num44 = (int) this.reader.ReadInt16(); + int num39 = (int) this.reader.ReadInt16(); int pre2 = (int) this.reader.ReadByte(); int type6 = (int) this.reader.ReadInt16(); - if (index21 < 0 || index21 >= 8000) - break; if (Main.chest[index21] == null) Main.chest[index21] = new Chest(); if (Main.chest[index21].item[index22] == null) Main.chest[index21].item[index22] = new Item(); Main.chest[index21].item[index22].netDefaults(type6); Main.chest[index21].item[index22].Prefix(pre2); - Main.chest[index21].item[index22].stack = num44; - Recipe.FindRecipes(true); + Main.chest[index21].item[index22].stack = num39; + Recipe.FindRecipes(); break; case 33: - int num45 = (int) this.reader.ReadInt16(); + int num40 = (int) this.reader.ReadInt16(); int index23 = (int) this.reader.ReadInt16(); int index24 = (int) this.reader.ReadInt16(); - int num46 = (int) this.reader.ReadByte(); + int num41 = (int) this.reader.ReadByte(); string str1 = string.Empty; - if (num46 != 0) + if (num41 != 0) { - if (num46 <= 20) + if (num41 <= 20) str1 = this.reader.ReadString(); - else if (num46 != (int) byte.MaxValue) - num46 = 0; + else if (num41 != (int) byte.MaxValue) + num41 = 0; } if (Main.netMode == 1) { @@ -1423,41 +1239,41 @@ namespace Terraria if (player8.chest == -1) { Main.playerInventory = true; - SoundEngine.PlaySound(10); + Main.PlaySound(10); } - else if (player8.chest != num45 && num45 != -1) + else if (player8.chest != num40 && num40 != -1) { Main.playerInventory = true; - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.recBigList = false; } - else if (player8.chest != -1 && num45 == -1) + else if (player8.chest != -1 && num40 == -1) { - SoundEngine.PlaySound(11); + Main.PlaySound(11); Main.recBigList = false; } - player8.chest = num45; + player8.chest = num40; player8.chestX = index23; player8.chestY = index24; - Recipe.FindRecipes(true); + Recipe.FindRecipes(); if (Main.tile[index23, index24].frameX < (short) 36 || Main.tile[index23, index24].frameX >= (short) 72) break; AchievementsHelper.HandleSpecialEvent(Main.player[Main.myPlayer], 16); break; } - if (num46 != 0) + if (num41 != 0) { int chest2 = Main.player[this.whoAmI].chest; Chest chest3 = Main.chest[chest2]; chest3.name = str1; - NetMessage.TrySendData(69, ignoreClient: this.whoAmI, number: chest2, number2: ((float) chest3.x), number3: ((float) chest3.y)); + NetMessage.SendData(69, ignoreClient: this.whoAmI, number: chest2, number2: ((float) chest3.x), number3: ((float) chest3.y)); } - Main.player[this.whoAmI].chest = num45; - Recipe.FindRecipes(true); - NetMessage.TrySendData(80, ignoreClient: this.whoAmI, number: this.whoAmI, number2: ((float) num45)); + Main.player[this.whoAmI].chest = num40; + Recipe.FindRecipes(); + NetMessage.SendData(80, ignoreClient: this.whoAmI, number: this.whoAmI, number2: ((float) num40)); break; case 34: - byte num47 = this.reader.ReadByte(); + byte num42 = this.reader.ReadByte(); int index25 = (int) this.reader.ReadInt16(); int index26 = (int) this.reader.ReadInt16(); int style1 = (int) this.reader.ReadInt16(); @@ -1466,19 +1282,19 @@ namespace Terraria id = 0; if (Main.netMode == 2) { - if (num47 == (byte) 0) + if (num42 == (byte) 0) { int number5_1 = WorldGen.PlaceChest(index25, index26, style: style1); if (number5_1 == -1) { - NetMessage.TrySendData(34, this.whoAmI, number: ((int) num47), number2: ((float) index25), number3: ((float) index26), number4: ((float) style1), number5: number5_1); + NetMessage.SendData(34, this.whoAmI, number: ((int) num42), number2: ((float) index25), number3: ((float) index26), number4: ((float) style1), number5: number5_1); Item.NewItem(index25 * 16, index26 * 16, 32, 32, Chest.chestItemSpawn[style1], noBroadcast: true); break; } - NetMessage.TrySendData(34, number: ((int) num47), number2: ((float) index25), number3: ((float) index26), number4: ((float) style1), number5: number5_1); + NetMessage.SendData(34, number: ((int) num42), number2: ((float) index25), number3: ((float) index26), number4: ((float) style1), number5: number5_1); break; } - if (num47 == (byte) 1 && Main.tile[index25, index26].type == (ushort) 21) + if (num42 == (byte) 1 && Main.tile[index25, index26].type == (ushort) 21) { Tile tile = Main.tile[index25, index26]; if ((int) tile.frameX % 36 != 0) @@ -1489,47 +1305,47 @@ namespace Terraria WorldGen.KillTile(index25, index26); if (tile.active()) break; - NetMessage.TrySendData(34, number: ((int) num47), number2: ((float) index25), number3: ((float) index26), number5: chest4); + NetMessage.SendData(34, number: ((int) num42), number2: ((float) index25), number3: ((float) index26), number5: chest4); break; } - if (num47 == (byte) 2) + if (num42 == (byte) 2) { int number5_2 = WorldGen.PlaceChest(index25, index26, (ushort) 88, style: style1); if (number5_2 == -1) { - NetMessage.TrySendData(34, this.whoAmI, number: ((int) num47), number2: ((float) index25), number3: ((float) index26), number4: ((float) style1), number5: number5_2); + NetMessage.SendData(34, this.whoAmI, number: ((int) num42), number2: ((float) index25), number3: ((float) index26), number4: ((float) style1), number5: number5_2); Item.NewItem(index25 * 16, index26 * 16, 32, 32, Chest.dresserItemSpawn[style1], noBroadcast: true); break; } - NetMessage.TrySendData(34, number: ((int) num47), number2: ((float) index25), number3: ((float) index26), number4: ((float) style1), number5: number5_2); + NetMessage.SendData(34, number: ((int) num42), number2: ((float) index25), number3: ((float) index26), number4: ((float) style1), number5: number5_2); break; } - if (num47 == (byte) 3 && Main.tile[index25, index26].type == (ushort) 88) + if (num42 == (byte) 3 && Main.tile[index25, index26].type == (ushort) 88) { Tile tile = Main.tile[index25, index26]; - int num48 = index25 - (int) tile.frameX % 54 / 18; + int num43 = index25 - (int) tile.frameX % 54 / 18; if ((int) tile.frameY % 36 != 0) --index26; - int chest5 = Chest.FindChest(num48, index26); - WorldGen.KillTile(num48, index26); + int chest5 = Chest.FindChest(num43, index26); + WorldGen.KillTile(num43, index26); if (tile.active()) break; - NetMessage.TrySendData(34, number: ((int) num47), number2: ((float) num48), number3: ((float) index26), number5: chest5); + NetMessage.SendData(34, number: ((int) num42), number2: ((float) num43), number3: ((float) index26), number5: chest5); break; } - if (num47 == (byte) 4) + if (num42 == (byte) 4) { int number5_3 = WorldGen.PlaceChest(index25, index26, (ushort) 467, style: style1); if (number5_3 == -1) { - NetMessage.TrySendData(34, this.whoAmI, number: ((int) num47), number2: ((float) index25), number3: ((float) index26), number4: ((float) style1), number5: number5_3); + NetMessage.SendData(34, this.whoAmI, number: ((int) num42), number2: ((float) index25), number3: ((float) index26), number4: ((float) style1), number5: number5_3); Item.NewItem(index25 * 16, index26 * 16, 32, 32, Chest.chestItemSpawn2[style1], noBroadcast: true); break; } - NetMessage.TrySendData(34, number: ((int) num47), number2: ((float) index25), number3: ((float) index26), number4: ((float) style1), number5: number5_3); + NetMessage.SendData(34, number: ((int) num42), number2: ((float) index25), number3: ((float) index26), number4: ((float) style1), number5: number5_3); break; } - if (num47 != (byte) 5 || Main.tile[index25, index26].type != (ushort) 467) + if (num42 != (byte) 5 || Main.tile[index25, index26].type != (ushort) 467) break; Tile tile1 = Main.tile[index25, index26]; if ((int) tile1.frameX % 36 != 0) @@ -1540,10 +1356,10 @@ namespace Terraria WorldGen.KillTile(index25, index26); if (tile1.active()) break; - NetMessage.TrySendData(34, number: ((int) num47), number2: ((float) index25), number3: ((float) index26), number5: chest6); + NetMessage.SendData(34, number: ((int) num42), number2: ((float) index25), number3: ((float) index26), number5: chest6); break; } - switch (num47) + switch (num42) { case 0: if (id == -1) @@ -1551,7 +1367,6 @@ namespace Terraria WorldGen.KillTile(index25, index26); return; } - SoundEngine.PlaySound(0, index25 * 16, index26 * 16); WorldGen.PlaceChestDirect(index25, index26, (ushort) 21, style1, id); return; case 2: @@ -1560,7 +1375,6 @@ namespace Terraria WorldGen.KillTile(index25, index26); return; } - SoundEngine.PlaySound(0, index25 * 16, index26 * 16); WorldGen.PlaceDresserDirect(index25, index26, (ushort) 88, style1, id); return; case 4: @@ -1569,7 +1383,6 @@ namespace Terraria WorldGen.KillTile(index25, index26); return; } - SoundEngine.PlaySound(0, index25 * 16, index26 * 16); WorldGen.PlaceChestDirect(index25, index26, (ushort) 467, style1, id); return; default: @@ -1586,7 +1399,7 @@ namespace Terraria Main.player[number18].HealEffect(healAmount1); if (Main.netMode != 2) break; - NetMessage.TrySendData(35, ignoreClient: this.whoAmI, number: number18, number2: ((float) healAmount1)); + NetMessage.SendData(35, ignoreClient: this.whoAmI, number: number18, number2: ((float) healAmount1)); break; case 36: int number19 = (int) this.reader.ReadByte(); @@ -1599,14 +1412,14 @@ namespace Terraria player9.zone4 = (BitsByte) this.reader.ReadByte(); if (Main.netMode != 2) break; - NetMessage.TrySendData(36, ignoreClient: this.whoAmI, number: number19); + NetMessage.SendData(36, ignoreClient: this.whoAmI, number: number19); break; case 37: if (Main.netMode != 1) break; if (Main.autoPass) { - NetMessage.TrySendData(38); + NetMessage.SendData(38); Main.autoPass = false; break; } @@ -1619,41 +1432,41 @@ namespace Terraria if (this.reader.ReadString() == Netplay.ServerPassword) { Netplay.Clients[this.whoAmI].State = 1; - NetMessage.TrySendData(3, this.whoAmI); + NetMessage.SendData(3, this.whoAmI); break; } - NetMessage.TrySendData(2, this.whoAmI, text: Lang.mp[1].ToNetworkText()); + NetMessage.SendData(2, this.whoAmI, text: Lang.mp[1].ToNetworkText()); break; case 39: if (Main.netMode != 1) break; int number20 = (int) this.reader.ReadInt16(); - Main.item[number20].playerIndexTheItemIsReservedFor = (int) byte.MaxValue; - NetMessage.TrySendData(22, number: number20); + Main.item[number20].owner = (int) byte.MaxValue; + NetMessage.SendData(22, number: number20); break; case 40: int number21 = (int) this.reader.ReadByte(); if (Main.netMode == 2) number21 = this.whoAmI; - int npcIndex = (int) this.reader.ReadInt16(); - Main.player[number21].SetTalkNPC(npcIndex, true); + int num44 = (int) this.reader.ReadInt16(); + Main.player[number21].talkNPC = num44; if (Main.netMode != 2) break; - NetMessage.TrySendData(40, ignoreClient: this.whoAmI, number: number21); + NetMessage.SendData(40, ignoreClient: this.whoAmI, number: number21); break; case 41: int number22 = (int) this.reader.ReadByte(); if (Main.netMode == 2) number22 = this.whoAmI; Player player10 = Main.player[number22]; - float num49 = this.reader.ReadSingle(); - int num50 = (int) this.reader.ReadInt16(); - player10.itemRotation = num49; - player10.itemAnimation = num50; + float num45 = this.reader.ReadSingle(); + int num46 = (int) this.reader.ReadInt16(); + player10.itemRotation = num45; + player10.itemAnimation = num46; player10.channel = player10.inventory[player10.selectedItem].channel; if (Main.netMode != 2) break; - NetMessage.TrySendData(41, ignoreClient: this.whoAmI, number: number22); + NetMessage.SendData(41, ignoreClient: this.whoAmI, number: number22); break; case 42: int index27 = (int) this.reader.ReadByte(); @@ -1661,10 +1474,10 @@ namespace Terraria index27 = this.whoAmI; else if (Main.myPlayer == index27 && !Main.ServerSideCharacter) break; - int num51 = (int) this.reader.ReadInt16(); - int num52 = (int) this.reader.ReadInt16(); - Main.player[index27].statMana = num51; - Main.player[index27].statManaMax = num52; + int num47 = (int) this.reader.ReadInt16(); + int num48 = (int) this.reader.ReadInt16(); + Main.player[index27].statMana = num47; + Main.player[index27].statManaMax = num48; break; case 43: int number23 = (int) this.reader.ReadByte(); @@ -1675,9 +1488,7 @@ namespace Terraria Main.player[number23].ManaEffect(manaAmount); if (Main.netMode != 2) break; - NetMessage.TrySendData(43, ignoreClient: this.whoAmI, number: number23, number2: ((float) manaAmount)); - break; - case 44: + NetMessage.SendData(43, ignoreClient: this.whoAmI, number: number23, number2: ((float) manaAmount)); break; case 45: int number24 = (int) this.reader.ReadByte(); @@ -1690,14 +1501,14 @@ namespace Terraria Color color2 = Main.teamColor[index28]; if (Main.netMode != 2) break; - NetMessage.TrySendData(45, ignoreClient: this.whoAmI, number: number24); + NetMessage.SendData(45, ignoreClient: this.whoAmI, number: number24); LocalizedText localizedText2 = Lang.mp[13 + index28]; if (index28 == 5) localizedText2 = Lang.mp[22]; for (int playerId = 0; playerId < (int) byte.MaxValue; ++playerId) { if (playerId == this.whoAmI || team > 0 && Main.player[playerId].team == team || index28 > 0 && Main.player[playerId].team == index28) - ChatHelper.SendChatMessageToClient(NetworkText.FromKey(localizedText2.Key, (object) player11.name), color2, playerId); + NetMessage.SendChatMessageToClient(NetworkText.FromKey(localizedText2.Key, (object) player11.name), color2, playerId); } break; case 46: @@ -1706,55 +1517,52 @@ namespace Terraria int number25 = Sign.ReadSign((int) this.reader.ReadInt16(), (int) this.reader.ReadInt16()); if (number25 < 0) break; - NetMessage.TrySendData(47, this.whoAmI, number: number25, number2: ((float) this.whoAmI)); + NetMessage.SendData(47, this.whoAmI, number: number25, number2: ((float) this.whoAmI)); break; case 47: int index29 = (int) this.reader.ReadInt16(); - int num53 = (int) this.reader.ReadInt16(); - int num54 = (int) this.reader.ReadInt16(); + int num49 = (int) this.reader.ReadInt16(); + int num50 = (int) this.reader.ReadInt16(); string text1 = this.reader.ReadString(); - int num55 = (int) this.reader.ReadByte(); - BitsByte bitsByte23 = (BitsByte) this.reader.ReadByte(); - if (index29 < 0 || index29 >= 1000) - break; string str2 = (string) null; if (Main.sign[index29] != null) str2 = Main.sign[index29].text; Main.sign[index29] = new Sign(); - Main.sign[index29].x = num53; - Main.sign[index29].y = num54; + Main.sign[index29].x = num49; + Main.sign[index29].y = num50; Sign.TextSign(index29, text1); + int num51 = (int) this.reader.ReadByte(); if (Main.netMode == 2 && str2 != text1) { - num55 = this.whoAmI; - NetMessage.TrySendData(47, ignoreClient: this.whoAmI, number: index29, number2: ((float) num55)); + num51 = this.whoAmI; + NetMessage.SendData(47, ignoreClient: this.whoAmI, number: index29, number2: ((float) num51)); } - if (Main.netMode != 1 || num55 != Main.myPlayer || Main.sign[index29] == null || bitsByte23[0]) + if (Main.netMode != 1 || num51 != Main.myPlayer || Main.sign[index29] == null) break; Main.playerInventory = false; - Main.player[Main.myPlayer].SetTalkNPC(-1, true); + Main.player[Main.myPlayer].talkNPC = -1; Main.npcChatCornerItem = 0; Main.editSign = false; - SoundEngine.PlaySound(10); + Main.PlaySound(10); Main.player[Main.myPlayer].sign = index29; Main.npcChatText = Main.sign[index29].text; break; case 48: int i1 = (int) this.reader.ReadInt16(); int j1 = (int) this.reader.ReadInt16(); - byte num56 = this.reader.ReadByte(); - byte num57 = this.reader.ReadByte(); - if (Main.netMode == 2 && Netplay.SpamCheck) + byte num52 = this.reader.ReadByte(); + byte num53 = this.reader.ReadByte(); + if (Main.netMode == 2 && Netplay.spamCheck) { int whoAmI = this.whoAmI; - int num58 = (int) ((double) Main.player[whoAmI].position.X + (double) (Main.player[whoAmI].width / 2)); - int num59 = (int) ((double) Main.player[whoAmI].position.Y + (double) (Main.player[whoAmI].height / 2)); - int num60 = 10; - int num61 = num58 - num60; - int num62 = num58 + num60; - int num63 = num59 - num60; - int num64 = num59 + num60; - if (i1 < num61 || i1 > num62 || j1 < num63 || j1 > num64) + int num54 = (int) ((double) Main.player[whoAmI].position.X + (double) (Main.player[whoAmI].width / 2)); + int num55 = (int) ((double) Main.player[whoAmI].position.Y + (double) (Main.player[whoAmI].height / 2)); + int num56 = 10; + int num57 = num54 - num56; + int num58 = num54 + num56; + int num59 = num55 - num56; + int num60 = num55 + num56; + if (i1 < num57 || i1 > num58 || j1 < num59 || j1 > num60) { NetMessage.BootPlayer(this.whoAmI, NetworkText.FromKey("Net.CheatingLiquidSpam")); break; @@ -1764,8 +1572,8 @@ namespace Terraria Main.tile[i1, j1] = new Tile(); lock (Main.tile[i1, j1]) { - Main.tile[i1, j1].liquid = num56; - Main.tile[i1, j1].liquidType((int) num57); + Main.tile[i1, j1].liquid = num52; + Main.tile[i1, j1].liquidType((int) num53); if (Main.netMode != 2) break; WorldGen.SquareTileFrame(i1, j1); @@ -1777,7 +1585,7 @@ namespace Terraria Netplay.Connection.State = 10; Main.ActivePlayerFileData.StartPlayTimer(); Player.Hooks.EnterWorld(Main.myPlayer); - Main.player[Main.myPlayer].Spawn(PlayerSpawnContext.SpawningIntoWorld); + Main.player[Main.myPlayer].Spawn(); break; case 50: int number26 = (int) this.reader.ReadByte(); @@ -1788,17 +1596,17 @@ namespace Terraria Player player12 = Main.player[number26]; for (int index30 = 0; index30 < 22; ++index30) { - player12.buffType[index30] = (int) this.reader.ReadUInt16(); + player12.buffType[index30] = (int) this.reader.ReadByte(); player12.buffTime[index30] = player12.buffType[index30] <= 0 ? 0 : 60; } if (Main.netMode != 2) break; - NetMessage.TrySendData(50, ignoreClient: this.whoAmI, number: number26); + NetMessage.SendData(50, ignoreClient: this.whoAmI, number: number26); break; case 51: - byte num65 = this.reader.ReadByte(); - byte num66 = this.reader.ReadByte(); - switch (num66) + byte num61 = this.reader.ReadByte(); + byte num62 = this.reader.ReadByte(); + switch (num62) { case 1: NPC.SpawnSkeletron(); @@ -1806,10 +1614,10 @@ namespace Terraria case 2: if (Main.netMode == 2) { - NetMessage.TrySendData(51, ignoreClient: this.whoAmI, number: ((int) num65), number2: ((float) num66)); + NetMessage.SendData(51, ignoreClient: this.whoAmI, number: ((int) num61), number2: ((float) num62)); return; } - SoundEngine.PlaySound(SoundID.Item1, (int) Main.player[(int) num65].position.X, (int) Main.player[(int) num65].position.Y); + Main.PlaySound(SoundID.Item1, (int) Main.player[(int) num61].position.X, (int) Main.player[(int) num61].position.Y); return; case 3: if (Main.netMode != 2) @@ -1817,40 +1625,40 @@ namespace Terraria Main.Sundialing(); return; case 4: - Main.npc[(int) num65].BigMimicSpawnSmoke(); + Main.npc[(int) num61].BigMimicSpawnSmoke(); return; default: return; } case 52: - int num67 = (int) this.reader.ReadByte(); - int num68 = (int) this.reader.ReadInt16(); - int num69 = (int) this.reader.ReadInt16(); - if (num67 == 1) + int num63 = (int) this.reader.ReadByte(); + int num64 = (int) this.reader.ReadInt16(); + int num65 = (int) this.reader.ReadInt16(); + if (num63 == 1) { - Chest.Unlock(num68, num69); + Chest.Unlock(num64, num65); if (Main.netMode == 2) { - NetMessage.TrySendData(52, ignoreClient: this.whoAmI, number2: ((float) num67), number3: ((float) num68), number4: ((float) num69)); - NetMessage.SendTileSquare(-1, num68, num69, 2); + NetMessage.SendData(52, ignoreClient: this.whoAmI, number2: ((float) num63), number3: ((float) num64), number4: ((float) num65)); + NetMessage.SendTileSquare(-1, num64, num65, 2); } } - if (num67 != 2) + if (num63 != 2) break; - WorldGen.UnlockDoor(num68, num69); + WorldGen.UnlockDoor(num64, num65); if (Main.netMode != 2) break; - NetMessage.TrySendData(52, ignoreClient: this.whoAmI, number2: ((float) num67), number3: ((float) num68), number4: ((float) num69)); - NetMessage.SendTileSquare(-1, num68, num69, 2); + NetMessage.SendData(52, ignoreClient: this.whoAmI, number2: ((float) num63), number3: ((float) num64), number4: ((float) num65)); + NetMessage.SendTileSquare(-1, num64, num65, 2); break; case 53: int number27 = (int) this.reader.ReadInt16(); - int type7 = (int) this.reader.ReadUInt16(); + int type7 = (int) this.reader.ReadByte(); int time1 = (int) this.reader.ReadInt16(); Main.npc[number27].AddBuff(type7, time1, true); if (Main.netMode != 2) break; - NetMessage.TrySendData(54, number: number27); + NetMessage.SendData(54, number: number27); break; case 54: if (Main.netMode != 1) @@ -1859,24 +1667,24 @@ namespace Terraria NPC npc2 = Main.npc[index31]; for (int index32 = 0; index32 < 5; ++index32) { - npc2.buffType[index32] = (int) this.reader.ReadUInt16(); + npc2.buffType[index32] = (int) this.reader.ReadByte(); npc2.buffTime[index32] = (int) this.reader.ReadInt16(); } break; case 55: int index33 = (int) this.reader.ReadByte(); - int type8 = (int) this.reader.ReadUInt16(); - int timeToAdd = this.reader.ReadInt32(); + int type8 = (int) this.reader.ReadByte(); + int time1_1 = this.reader.ReadInt32(); if (Main.netMode == 2 && index33 != this.whoAmI && !Main.pvpBuff[type8]) break; if (Main.netMode == 1 && index33 == Main.myPlayer) { - Main.player[index33].AddBuff(type8, timeToAdd); + Main.player[index33].AddBuff(type8, time1_1); break; } if (Main.netMode != 2) break; - NetMessage.TrySendData(55, index33, number: index33, number2: ((float) type8), number3: ((float) timeToAdd)); + NetMessage.SendData(55, index33, number: index33, number2: ((float) type8), number3: ((float) time1_1)); break; case 56: int number28 = (int) this.reader.ReadInt16(); @@ -1886,13 +1694,11 @@ namespace Terraria { string str3 = this.reader.ReadString(); Main.npc[number28].GivenName = str3; - int num70 = this.reader.ReadInt32(); - Main.npc[number28].townNpcVariationIndex = num70; break; } if (Main.netMode != 2) break; - NetMessage.TrySendData(56, this.whoAmI, number: number28); + NetMessage.SendData(56, this.whoAmI, number: number28); break; case 57: if (Main.netMode != 1) @@ -1905,49 +1711,34 @@ namespace Terraria int index34 = (int) this.reader.ReadByte(); if (Main.netMode == 2) index34 = this.whoAmI; - float num71 = this.reader.ReadSingle(); + float number2_1 = this.reader.ReadSingle(); if (Main.netMode == 2) { - NetMessage.TrySendData(58, ignoreClient: this.whoAmI, number: this.whoAmI, number2: num71); + NetMessage.SendData(58, ignoreClient: this.whoAmI, number: this.whoAmI, number2: number2_1); break; } Player player13 = Main.player[index34]; - int type9 = player13.inventory[player13.selectedItem].type; - switch (type9) - { - case 4057: - case 4372: - case 4715: - player13.PlayGuitarChord(num71); - return; - case 4673: - player13.PlayDrums(num71); - return; - default: - Main.musicPitch = num71; - LegacySoundStyle type10 = SoundID.Item26; - if (type9 == 507) - type10 = SoundID.Item35; - if (type9 == 1305) - type10 = SoundID.Item47; - SoundEngine.PlaySound(type10, player13.position); - return; - } + Main.harpNote = number2_1; + LegacySoundStyle type9 = SoundID.Item26; + if (player13.inventory[player13.selectedItem].type == 507) + type9 = SoundID.Item35; + Main.PlaySound(type9, player13.position); + break; case 59: - int num72 = (int) this.reader.ReadInt16(); + int num66 = (int) this.reader.ReadInt16(); int j2 = (int) this.reader.ReadInt16(); Wiring.SetCurrentUser(this.whoAmI); - Wiring.HitSwitch(num72, j2); + Wiring.HitSwitch(num66, j2); Wiring.SetCurrentUser(); if (Main.netMode != 2) break; - NetMessage.TrySendData(59, ignoreClient: this.whoAmI, number: num72, number2: ((float) j2)); + NetMessage.SendData(59, ignoreClient: this.whoAmI, number: num66, number2: ((float) j2)); break; case 60: int n = (int) this.reader.ReadInt16(); int x1 = (int) this.reader.ReadInt16(); int y4 = (int) this.reader.ReadInt16(); - byte num73 = this.reader.ReadByte(); + byte num67 = this.reader.ReadByte(); if (n >= 200) { NetMessage.BootPlayer(this.whoAmI, NetworkText.FromKey("Net.CheatingInvalid")); @@ -1955,20 +1746,20 @@ namespace Terraria } if (Main.netMode == 1) { - Main.npc[n].homeless = num73 == (byte) 1; + Main.npc[n].homeless = num67 == (byte) 1; Main.npc[n].homeTileX = x1; Main.npc[n].homeTileY = y4; - if (num73 == (byte) 1) + if (num67 == (byte) 1) { WorldGen.TownManager.KickOut(Main.npc[n].type); break; } - if (num73 != (byte) 2) + if (num67 != (byte) 2) break; WorldGen.TownManager.SetRoom(Main.npc[n].type, x1, y4); break; } - if (num73 == (byte) 1) + if (num67 == (byte) 1) { WorldGen.kickOut(n); break; @@ -1980,7 +1771,7 @@ namespace Terraria int Type3 = (int) this.reader.ReadInt16(); if (Main.netMode != 2) break; - if (Type3 >= 0 && Type3 < 663 && NPCID.Sets.MPAllowedEnemies[Type3]) + if (Type3 >= 0 && Type3 < 580 && NPCID.Sets.MPAllowedEnemies[Type3]) { if (NPC.AnyNPCs(Type3)) break; @@ -1989,231 +1780,193 @@ namespace Terraria } switch (Type3) { - case -14: - ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Misc.LicenseBunnyUsed"), new Color(50, (int) byte.MaxValue, 130)); - NPC.boughtBunny = true; - NetMessage.TrySendData(7); - return; - case -13: - ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Misc.LicenseDogUsed"), new Color(50, (int) byte.MaxValue, 130)); - NPC.boughtDog = true; - NetMessage.TrySendData(7); - return; - case -12: - ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Misc.LicenseCatUsed"), new Color(50, (int) byte.MaxValue, 130)); - NPC.boughtCat = true; - NetMessage.TrySendData(7); - return; - case -11: - ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Misc.CombatBookUsed"), new Color(50, (int) byte.MaxValue, 130)); - NPC.combatBookWasUsed = true; - NetMessage.TrySendData(7); - return; - case -10: - if (Main.dayTime || Main.bloodMoon) - return; - ChatHelper.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[8].Key), new Color(50, (int) byte.MaxValue, 130)); - Main.bloodMoon = true; - if (Main.GetMoonPhase() == MoonPhase.Empty) - Main.moonPhase = 5; - AchievementsHelper.NotifyProgressionEvent(4); - NetMessage.TrySendData(7); - return; case -8: if (!NPC.downedGolemBoss || !Main.hardMode || NPC.AnyDanger() || NPC.AnyoneNearCultists()) return; WorldGen.StartImpendingDoom(); - NetMessage.TrySendData(7); + NetMessage.SendData(7); return; case -7: Main.invasionDelay = 0; Main.StartInvasion(4); - NetMessage.TrySendData(7); - NetMessage.TrySendData(78, number2: 1f, number3: ((float) (Main.invasionType + 3))); + NetMessage.SendData(7); + NetMessage.SendData(78, number2: 1f, number3: ((float) (Main.invasionType + 3))); return; case -6: if (!Main.dayTime || Main.eclipse) return; - ChatHelper.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[20].Key), new Color(50, (int) byte.MaxValue, 130)); + NetMessage.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[20].Key), new Color(50, (int) byte.MaxValue, 130)); Main.eclipse = true; - NetMessage.TrySendData(7); + NetMessage.SendData(7); return; case -5: if (Main.dayTime || DD2Event.Ongoing) return; - ChatHelper.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[34].Key), new Color(50, (int) byte.MaxValue, 130)); + NetMessage.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[34].Key), new Color(50, (int) byte.MaxValue, 130)); Main.startSnowMoon(); - NetMessage.TrySendData(7); - NetMessage.TrySendData(78, number2: 1f, number3: 1f, number4: 1f); + NetMessage.SendData(7); + NetMessage.SendData(78, number2: 1f, number3: 1f, number4: 1f); return; case -4: if (Main.dayTime || DD2Event.Ongoing) return; - ChatHelper.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[31].Key), new Color(50, (int) byte.MaxValue, 130)); + NetMessage.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[31].Key), new Color(50, (int) byte.MaxValue, 130)); Main.startPumpkinMoon(); - NetMessage.TrySendData(7); - NetMessage.TrySendData(78, number2: 1f, number3: 2f, number4: 1f); + NetMessage.SendData(7); + NetMessage.SendData(78, number2: 1f, number3: 2f, number4: 1f); return; default: if (Type3 >= 0) return; - int type11 = 1; + int type10 = 1; if (Type3 > -5) - type11 = -Type3; - if (type11 > 0 && Main.invasionType == 0) + type10 = -Type3; + if (type10 > 0 && Main.invasionType == 0) { Main.invasionDelay = 0; - Main.StartInvasion(type11); + Main.StartInvasion(type10); } - NetMessage.TrySendData(78, number2: 1f, number3: ((float) (Main.invasionType + 3))); + NetMessage.SendData(78, number2: 1f, number3: ((float) (Main.invasionType + 3))); return; } case 62: int number29 = (int) this.reader.ReadByte(); - int num74 = (int) this.reader.ReadByte(); + int num68 = (int) this.reader.ReadByte(); if (Main.netMode == 2) number29 = this.whoAmI; - if (num74 == 1) + if (num68 == 1) Main.player[number29].NinjaDodge(); - if (num74 == 2) + if (num68 == 2) Main.player[number29].ShadowDodge(); - if (num74 == 4) - Main.player[number29].BrainOfConfusionDodge(); if (Main.netMode != 2) break; - NetMessage.TrySendData(62, ignoreClient: this.whoAmI, number: number29, number2: ((float) num74)); + NetMessage.SendData(62, ignoreClient: this.whoAmI, number: number29, number2: ((float) num68)); break; case 63: - int num75 = (int) this.reader.ReadInt16(); + int num69 = (int) this.reader.ReadInt16(); int y5 = (int) this.reader.ReadInt16(); byte color3 = this.reader.ReadByte(); - WorldGen.paintTile(num75, y5, color3); + WorldGen.paintTile(num69, y5, color3); if (Main.netMode != 2) break; - NetMessage.TrySendData(63, ignoreClient: this.whoAmI, number: num75, number2: ((float) y5), number3: ((float) color3)); + NetMessage.SendData(63, ignoreClient: this.whoAmI, number: num69, number2: ((float) y5), number3: ((float) color3)); break; case 64: - int num76 = (int) this.reader.ReadInt16(); + int num70 = (int) this.reader.ReadInt16(); int y6 = (int) this.reader.ReadInt16(); byte color4 = this.reader.ReadByte(); - WorldGen.paintWall(num76, y6, color4); + WorldGen.paintWall(num70, y6, color4); if (Main.netMode != 2) break; - NetMessage.TrySendData(64, ignoreClient: this.whoAmI, number: num76, number2: ((float) y6), number3: ((float) color4)); + NetMessage.SendData(64, ignoreClient: this.whoAmI, number: num70, number2: ((float) y6), number3: ((float) color4)); break; case 65: - BitsByte bitsByte24 = (BitsByte) this.reader.ReadByte(); + BitsByte bitsByte17 = (BitsByte) this.reader.ReadByte(); int index35 = (int) this.reader.ReadInt16(); if (Main.netMode == 2) index35 = this.whoAmI; Vector2 vector2_7 = this.reader.ReadVector2(); - int num77 = (int) this.reader.ReadByte(); - int number30 = 0; - if (bitsByte24[0]) - ++number30; - if (bitsByte24[1]) - number30 += 2; - bool flag10 = false; - if (bitsByte24[2]) - flag10 = true; - int num78 = 0; - if (bitsByte24[3]) - num78 = this.reader.ReadInt32(); - if (flag10) - vector2_7 = Main.player[index35].position; - switch (number30) + int num71 = 0; + int num72 = 0; + if (bitsByte17[0]) + ++num71; + if (bitsByte17[1]) + num71 += 2; + if (bitsByte17[2]) + ++num72; + if (bitsByte17[3]) + num72 += 2; + switch (num71) { case 0: - Main.player[index35].Teleport(vector2_7, num77, num78); + Main.player[index35].Teleport(vector2_7, num72); break; case 1: - Main.npc[index35].Teleport(vector2_7, num77, num78); + Main.npc[index35].Teleport(vector2_7, num72); break; case 2: - Main.player[index35].Teleport(vector2_7, num77, num78); + Main.player[index35].Teleport(vector2_7, num72); if (Main.netMode == 2) { RemoteClient.CheckSection(this.whoAmI, vector2_7); - NetMessage.TrySendData(65, number2: ((float) index35), number3: vector2_7.X, number4: vector2_7.Y, number5: num77, number6: flag10.ToInt(), number7: num78); + NetMessage.SendData(65, number2: ((float) index35), number3: vector2_7.X, number4: vector2_7.Y, number5: num72); int index36 = -1; - float num79 = 9999f; + float num73 = 9999f; for (int index37 = 0; index37 < (int) byte.MaxValue; ++index37) { if (Main.player[index37].active && index37 != this.whoAmI) { Vector2 vector2_8 = Main.player[index37].position - Main.player[this.whoAmI].position; - if ((double) vector2_8.Length() < (double) num79) + if ((double) vector2_8.Length() < (double) num73) { - num79 = vector2_8.Length(); + num73 = vector2_8.Length(); index36 = index37; } } } if (index36 >= 0) { - ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Game.HasTeleportedTo", (object) Main.player[this.whoAmI].name, (object) Main.player[index36].name), new Color(250, 250, 0)); + NetMessage.BroadcastChatMessage(NetworkText.FromKey("Game.HasTeleportedTo", (object) Main.player[this.whoAmI].name, (object) Main.player[index36].name), new Color(250, 250, 0)); break; } break; } break; } - if (Main.netMode != 2 || number30 != 0) + if (Main.netMode != 2 || num71 != 0) break; - NetMessage.TrySendData(65, ignoreClient: this.whoAmI, number: number30, number2: ((float) index35), number3: vector2_7.X, number4: vector2_7.Y, number5: num77, number6: flag10.ToInt(), number7: num78); + NetMessage.SendData(65, ignoreClient: this.whoAmI, number2: ((float) index35), number3: vector2_7.X, number4: vector2_7.Y, number5: num72); break; case 66: - int number31 = (int) this.reader.ReadByte(); + int number30 = (int) this.reader.ReadByte(); int healAmount2 = (int) this.reader.ReadInt16(); if (healAmount2 <= 0) break; - Player player14 = Main.player[number31]; + Player player14 = Main.player[number30]; player14.statLife += healAmount2; if (player14.statLife > player14.statLifeMax2) player14.statLife = player14.statLifeMax2; player14.HealEffect(healAmount2, false); if (Main.netMode != 2) break; - NetMessage.TrySendData(66, ignoreClient: this.whoAmI, number: number31, number2: ((float) healAmount2)); - break; - case 67: + NetMessage.SendData(66, ignoreClient: this.whoAmI, number: number30, number2: ((float) healAmount2)); break; case 68: this.reader.ReadString(); break; case 69: - int number32 = (int) this.reader.ReadInt16(); - int X1 = (int) this.reader.ReadInt16(); - int Y1 = (int) this.reader.ReadInt16(); + int number31 = (int) this.reader.ReadInt16(); + int X = (int) this.reader.ReadInt16(); + int Y = (int) this.reader.ReadInt16(); if (Main.netMode == 1) { - if (number32 < 0 || number32 >= 8000) + if (number31 < 0 || number31 >= 1000) break; - Chest chest7 = Main.chest[number32]; + Chest chest7 = Main.chest[number31]; if (chest7 == null) { chest7 = new Chest(); - chest7.x = X1; - chest7.y = Y1; - Main.chest[number32] = chest7; + chest7.x = X; + chest7.y = Y; + Main.chest[number31] = chest7; } - else if (chest7.x != X1 || chest7.y != Y1) + else if (chest7.x != X || chest7.y != Y) break; chest7.name = this.reader.ReadString(); break; } - if (number32 < -1 || number32 >= 8000) + if (number31 < -1 || number31 >= 1000) break; - if (number32 == -1) + if (number31 == -1) { - number32 = Chest.FindChest(X1, Y1); - if (number32 == -1) + number31 = Chest.FindChest(X, Y); + if (number31 == -1) break; } - Chest chest8 = Main.chest[number32]; - if (chest8.x != X1 || chest8.y != Y1) + Chest chest8 = Main.chest[number31]; + if (chest8.x != X || chest8.y != Y) break; - NetMessage.TrySendData(69, this.whoAmI, number: number32, number2: ((float) X1), number3: ((float) Y1)); + NetMessage.SendData(69, this.whoAmI, number: number31, number2: ((float) X), number3: ((float) Y)); break; case 70: if (Main.netMode != 2) @@ -2230,14 +1983,14 @@ namespace Terraria if (Main.netMode != 2) break; int x2 = this.reader.ReadInt32(); - int num80 = this.reader.ReadInt32(); - int num81 = (int) this.reader.ReadInt16(); - byte num82 = this.reader.ReadByte(); - int y7 = num80; - int Type4 = num81; - int Style1 = (int) num82; + int num74 = this.reader.ReadInt32(); + int num75 = (int) this.reader.ReadInt16(); + byte num76 = this.reader.ReadByte(); + int y7 = num74; + int Type4 = num75; + int Style = (int) num76; int whoAmI1 = this.whoAmI; - NPC.ReleaseNPC(x2, y7, Type4, Style1, whoAmI1); + NPC.ReleaseNPC(x2, y7, Type4, Style, whoAmI1); break; case 72: if (Main.netMode != 1) @@ -2246,20 +1999,8 @@ namespace Terraria Main.travelShop[index38] = (int) this.reader.ReadInt16(); break; case 73: - switch (this.reader.ReadByte()) - { - case 0: - Main.player[this.whoAmI].TeleportationPotion(); - return; - case 1: - Main.player[this.whoAmI].MagicConch(); - return; - case 2: - Main.player[this.whoAmI].DemonConch(); - return; - default: - return; - } + Main.player[this.whoAmI].TeleportationPotion(); + break; case 74: if (Main.netMode != 1) break; @@ -2275,27 +2016,25 @@ namespace Terraria Main.anglerWhoFinishedToday.Add(name); break; case 76: - int number33 = (int) this.reader.ReadByte(); - if (number33 == Main.myPlayer && !Main.ServerSideCharacter) + int number32 = (int) this.reader.ReadByte(); + if (number32 == Main.myPlayer && !Main.ServerSideCharacter) break; if (Main.netMode == 2) - number33 = this.whoAmI; - Player player15 = Main.player[number33]; - player15.anglerQuestsFinished = this.reader.ReadInt32(); - player15.golferScoreAccumulated = this.reader.ReadInt32(); + number32 = this.whoAmI; + Main.player[number32].anglerQuestsFinished = this.reader.ReadInt32(); if (Main.netMode != 2) break; - NetMessage.TrySendData(76, ignoreClient: this.whoAmI, number: number33); + NetMessage.SendData(76, ignoreClient: this.whoAmI, number: number32); break; case 77: - int type12 = (int) this.reader.ReadInt16(); - ushort num83 = this.reader.ReadUInt16(); - short num84 = this.reader.ReadInt16(); - short num85 = this.reader.ReadInt16(); - int num86 = (int) num83; - int x3 = (int) num84; - int y8 = (int) num85; - Animation.NewTemporaryAnimation(type12, (ushort) num86, x3, y8); + int type11 = (int) this.reader.ReadInt16(); + ushort num77 = this.reader.ReadUInt16(); + short num78 = this.reader.ReadInt16(); + short num79 = this.reader.ReadInt16(); + int num80 = (int) num77; + int x3 = (int) num78; + int y8 = (int) num79; + Animation.NewTemporaryAnimation(type11, (ushort) num80, x3, y8); break; case 78: if (Main.netMode != 1) @@ -2305,9 +2044,9 @@ namespace Terraria case 79: int x4 = (int) this.reader.ReadInt16(); int y9 = (int) this.reader.ReadInt16(); - short num87 = this.reader.ReadInt16(); + short num81 = this.reader.ReadInt16(); int style2 = (int) this.reader.ReadInt16(); - int num88 = (int) this.reader.ReadByte(); + int num82 = (int) this.reader.ReadByte(); int random = (int) this.reader.ReadSByte(); int direction2 = !this.reader.ReadBoolean() ? -1 : 1; if (Main.netMode == 2) @@ -2316,59 +2055,59 @@ namespace Terraria if (!WorldGen.InWorld(x4, y9, 10) || !Netplay.Clients[this.whoAmI].TileSections[Netplay.GetSectionX(x4), Netplay.GetSectionY(y9)]) break; } - WorldGen.PlaceObject(x4, y9, (int) num87, style: style2, alternate: num88, random: random, direction: direction2); + WorldGen.PlaceObject(x4, y9, (int) num81, style: style2, alternate: num82, random: random, direction: direction2); if (Main.netMode != 2) break; - NetMessage.SendObjectPlacment(this.whoAmI, x4, y9, (int) num87, style2, num88, random, direction2); + NetMessage.SendObjectPlacment(this.whoAmI, x4, y9, (int) num81, style2, num82, random, direction2); break; case 80: if (Main.netMode != 1) break; int index39 = (int) this.reader.ReadByte(); - int num89 = (int) this.reader.ReadInt16(); - if (num89 < -3 || num89 >= 8000) + int num83 = (int) this.reader.ReadInt16(); + if (num83 < -3 || num83 >= 1000) break; - Main.player[index39].chest = num89; - Recipe.FindRecipes(true); + Main.player[index39].chest = num83; + Recipe.FindRecipes(); break; case 81: if (Main.netMode != 1) break; int x5 = (int) this.reader.ReadSingle(); - int num90 = (int) this.reader.ReadSingle(); + int num84 = (int) this.reader.ReadSingle(); Color color5 = this.reader.ReadRGB(); int amount = this.reader.ReadInt32(); - int y10 = num90; + int y10 = num84; CombatText.NewText(new Rectangle(x5, y10, 0, 0), color5, amount); break; case 82: - NetManager.Instance.Read(this.reader, this.whoAmI, length); + NetManager.Instance.Read(this.reader, this.whoAmI); break; case 83: if (Main.netMode != 1) break; int index40 = (int) this.reader.ReadInt16(); - int num91 = this.reader.ReadInt32(); - if (index40 < 0 || index40 >= 289) + int num85 = this.reader.ReadInt32(); + if (index40 < 0 || index40 >= 267) break; - NPC.killCount[index40] = num91; + NPC.killCount[index40] = num85; break; case 84: - int number34 = (int) this.reader.ReadByte(); + int number33 = (int) this.reader.ReadByte(); if (Main.netMode == 2) - number34 = this.whoAmI; - float num92 = this.reader.ReadSingle(); - Main.player[number34].stealth = num92; + number33 = this.whoAmI; + float num86 = this.reader.ReadSingle(); + Main.player[number33].stealth = num86; if (Main.netMode != 2) break; - NetMessage.TrySendData(84, ignoreClient: this.whoAmI, number: number34); + NetMessage.SendData(84, ignoreClient: this.whoAmI, number: number33); break; case 85: int whoAmI2 = this.whoAmI; - byte num93 = this.reader.ReadByte(); - if (Main.netMode != 2 || whoAmI2 >= (int) byte.MaxValue || num93 >= (byte) 58) + byte num87 = this.reader.ReadByte(); + if (Main.netMode != 2 || whoAmI2 >= (int) byte.MaxValue || num87 >= (byte) 58) break; - Chest.ServerPlaceItem(this.whoAmI, (int) num93); + Chest.ServerPlaceItem(this.whoAmI, (int) num87); break; case 86: if (Main.netMode != 1) @@ -2379,24 +2118,35 @@ namespace Terraria TileEntity tileEntity; if (!TileEntity.ByID.TryGetValue(key1, out tileEntity)) break; - TileEntity.ByID.Remove(key1); - TileEntity.ByPosition.Remove(tileEntity.Position); + switch (tileEntity) + { + case TETrainingDummy _: + case TEItemFrame _: + case TELogicSensor _: + TileEntity.ByID.Remove(key1); + TileEntity.ByPosition.Remove(tileEntity.Position); + return; + default: + return; + } + } + else + { + TileEntity tileEntity = TileEntity.Read(this.reader, true); + tileEntity.ID = key1; + TileEntity.ByID[tileEntity.ID] = tileEntity; + TileEntity.ByPosition[tileEntity.Position] = tileEntity; break; } - TileEntity tileEntity1 = TileEntity.Read(this.reader, true); - tileEntity1.ID = key1; - TileEntity.ByID[tileEntity1.ID] = tileEntity1; - TileEntity.ByPosition[tileEntity1.Position] = tileEntity1; - break; case 87: if (Main.netMode != 2) break; - int num94 = (int) this.reader.ReadInt16(); - int num95 = (int) this.reader.ReadInt16(); - int type13 = (int) this.reader.ReadByte(); - if (!WorldGen.InWorld(num94, num95) || TileEntity.ByPosition.ContainsKey(new Point16(num94, num95))) + int num88 = (int) this.reader.ReadInt16(); + int num89 = (int) this.reader.ReadInt16(); + int type12 = (int) this.reader.ReadByte(); + if (!WorldGen.InWorld(num88, num89) || TileEntity.ByPosition.ContainsKey(new Point16(num88, num89))) break; - TileEntity.PlaceEntityNet(num94, num95, type13); + TileEntity.PlaceEntityNet(num88, num89, type12); break; case 88: if (Main.netMode != 1) @@ -2405,35 +2155,35 @@ namespace Terraria if (index41 < 0 || index41 > 400) break; Item obj2 = Main.item[index41]; - BitsByte bitsByte25 = (BitsByte) this.reader.ReadByte(); - if (bitsByte25[0]) + BitsByte bitsByte18 = (BitsByte) this.reader.ReadByte(); + if (bitsByte18[0]) obj2.color.PackedValue = this.reader.ReadUInt32(); - if (bitsByte25[1]) + if (bitsByte18[1]) obj2.damage = (int) this.reader.ReadUInt16(); - if (bitsByte25[2]) + if (bitsByte18[2]) obj2.knockBack = this.reader.ReadSingle(); - if (bitsByte25[3]) + if (bitsByte18[3]) obj2.useAnimation = (int) this.reader.ReadUInt16(); - if (bitsByte25[4]) + if (bitsByte18[4]) obj2.useTime = (int) this.reader.ReadUInt16(); - if (bitsByte25[5]) + if (bitsByte18[5]) obj2.shoot = (int) this.reader.ReadInt16(); - if (bitsByte25[6]) + if (bitsByte18[6]) obj2.shootSpeed = this.reader.ReadSingle(); - if (!bitsByte25[7]) + if (!bitsByte18[7]) break; - bitsByte25 = (BitsByte) this.reader.ReadByte(); - if (bitsByte25[0]) + bitsByte18 = (BitsByte) this.reader.ReadByte(); + if (bitsByte18[0]) obj2.width = (int) this.reader.ReadInt16(); - if (bitsByte25[1]) + if (bitsByte18[1]) obj2.height = (int) this.reader.ReadInt16(); - if (bitsByte25[2]) + if (bitsByte18[2]) obj2.scale = this.reader.ReadSingle(); - if (bitsByte25[3]) + if (bitsByte18[3]) obj2.ammo = (int) this.reader.ReadInt16(); - if (bitsByte25[4]) + if (bitsByte18[4]) obj2.useAmmo = (int) this.reader.ReadInt16(); - if (!bitsByte25[5]) + if (!bitsByte18[5]) break; obj2.notAmmo = this.reader.ReadBoolean(); break; @@ -2441,100 +2191,87 @@ namespace Terraria if (Main.netMode != 2) break; int x6 = (int) this.reader.ReadInt16(); - int num96 = (int) this.reader.ReadInt16(); - int num97 = (int) this.reader.ReadInt16(); - int num98 = (int) this.reader.ReadByte(); - int num99 = (int) this.reader.ReadInt16(); - int y11 = num96; - int netid1 = num97; - int prefix1 = num98; - int stack1 = num99; - TEItemFrame.TryPlacing(x6, y11, netid1, prefix1, stack1); + int num90 = (int) this.reader.ReadInt16(); + int num91 = (int) this.reader.ReadInt16(); + int num92 = (int) this.reader.ReadByte(); + int num93 = (int) this.reader.ReadInt16(); + int y11 = num90; + int netid = num91; + int prefix = num92; + int stack1 = num93; + TEItemFrame.TryPlacing(x6, y11, netid, prefix, stack1); break; case 91: if (Main.netMode != 1) break; - int num100 = this.reader.ReadInt32(); - int type14 = (int) this.reader.ReadByte(); - if (type14 == (int) byte.MaxValue) + int key2 = this.reader.ReadInt32(); + int type13 = (int) this.reader.ReadByte(); + if (type13 == (int) byte.MaxValue) { - if (!EmoteBubble.byID.ContainsKey(num100)) + if (!EmoteBubble.byID.ContainsKey(key2)) break; - EmoteBubble.byID.Remove(num100); + EmoteBubble.byID.Remove(key2); break; } int meta = (int) this.reader.ReadUInt16(); - int time2 = (int) this.reader.ReadUInt16(); + int time2 = (int) this.reader.ReadByte(); int emotion = (int) this.reader.ReadByte(); - int num101 = 0; + int num94 = 0; if (emotion < 0) - num101 = (int) this.reader.ReadInt16(); - WorldUIAnchor bubbleAnchor = EmoteBubble.DeserializeNetAnchor(type14, meta); - if (type14 == 1) - Main.player[meta].emoteTime = 360; + num94 = (int) this.reader.ReadInt16(); + WorldUIAnchor bubbleAnchor = EmoteBubble.DeserializeNetAnchor(type13, meta); lock (EmoteBubble.byID) { - if (!EmoteBubble.byID.ContainsKey(num100)) + if (!EmoteBubble.byID.ContainsKey(key2)) { - EmoteBubble.byID[num100] = new EmoteBubble(emotion, bubbleAnchor, time2); + EmoteBubble.byID[key2] = new EmoteBubble(emotion, bubbleAnchor, time2); } else { - EmoteBubble.byID[num100].lifeTime = time2; - EmoteBubble.byID[num100].lifeTimeStart = time2; - EmoteBubble.byID[num100].emote = emotion; - EmoteBubble.byID[num100].anchor = bubbleAnchor; + EmoteBubble.byID[key2].lifeTime = time2; + EmoteBubble.byID[key2].lifeTimeStart = time2; + EmoteBubble.byID[key2].emote = emotion; + EmoteBubble.byID[key2].anchor = bubbleAnchor; } - EmoteBubble.byID[num100].ID = num100; - EmoteBubble.byID[num100].metadata = num101; - EmoteBubble.OnBubbleChange(num100); + EmoteBubble.byID[key2].ID = key2; + EmoteBubble.byID[key2].metadata = num94; break; } case 92: - int number35 = (int) this.reader.ReadInt16(); - int num102 = this.reader.ReadInt32(); - float num103 = this.reader.ReadSingle(); - float num104 = this.reader.ReadSingle(); - if (number35 < 0 || number35 > 200) + int number34 = (int) this.reader.ReadInt16(); + float num95 = this.reader.ReadSingle(); + float num96 = this.reader.ReadSingle(); + float num97 = this.reader.ReadSingle(); + if (number34 < 0 || number34 > 200) break; if (Main.netMode == 1) { - Main.npc[number35].moneyPing(new Vector2(num103, num104)); - Main.npc[number35].extraValue = num102; + Main.npc[number34].moneyPing(new Vector2(num96, num97)); + Main.npc[number34].extraValue = num95; break; } - Main.npc[number35].extraValue += num102; - NetMessage.TrySendData(92, number: number35, number2: ((float) Main.npc[number35].extraValue), number3: num103, number4: num104); - break; - case 93: + Main.npc[number34].extraValue += num95; + NetMessage.SendData(92, number: number34, number2: Main.npc[number34].extraValue, number3: num96, number4: num97); break; case 95: - ushort num105 = this.reader.ReadUInt16(); - int num106 = (int) this.reader.ReadByte(); - if (Main.netMode != 2) + ushort num98 = this.reader.ReadUInt16(); + if (Main.netMode != 2 || num98 < (ushort) 0 || num98 >= (ushort) 1000) break; - for (int index42 = 0; index42 < 1000; ++index42) - { - if (Main.projectile[index42].owner == (int) num105 && Main.projectile[index42].active && Main.projectile[index42].type == 602 && (double) Main.projectile[index42].ai[1] == (double) num106) - { - Main.projectile[index42].Kill(); - NetMessage.TrySendData(29, number: Main.projectile[index42].identity, number2: ((float) num105)); - break; - } - } + Projectile projectile2 = Main.projectile[(int) num98]; + if (projectile2.type != 602) + break; + projectile2.Kill(); + NetMessage.SendData(29, number: projectile2.whoAmI, number2: ((float) projectile2.owner)); break; case 96: - int number36 = (int) this.reader.ReadByte(); - Player player16 = Main.player[number36]; + int index42 = (int) this.reader.ReadByte(); + Player player15 = Main.player[index42]; int extraInfo1 = (int) this.reader.ReadInt16(); Vector2 newPos1 = this.reader.ReadVector2(); Vector2 vector2_9 = this.reader.ReadVector2(); - player16.lastPortalColorIndex = extraInfo1 + (extraInfo1 % 2 == 0 ? 1 : -1); - player16.Teleport(newPos1, 4, extraInfo1); - player16.velocity = vector2_9; - if (Main.netMode != 2) - break; - NetMessage.SendData(96, number: number36, number2: newPos1.X, number3: newPos1.Y, number4: ((float) extraInfo1)); + player15.lastPortalColorIndex = extraInfo1 + (extraInfo1 % 2 == 0 ? 1 : -1); + player15.Teleport(newPos1, 4, extraInfo1); + player15.velocity = vector2_9; break; case 97: if (Main.netMode != 1) @@ -2547,13 +2284,13 @@ namespace Terraria AchievementsHelper.NotifyProgressionEvent((int) this.reader.ReadInt16()); break; case 99: - int number37 = (int) this.reader.ReadByte(); + int number35 = (int) this.reader.ReadByte(); if (Main.netMode == 2) - number37 = this.whoAmI; - Main.player[number37].MinionRestTargetPoint = this.reader.ReadVector2(); + number35 = this.whoAmI; + Main.player[number35].MinionRestTargetPoint = this.reader.ReadVector2(); if (Main.netMode != 2) break; - NetMessage.TrySendData(99, ignoreClient: this.whoAmI, number: number37); + NetMessage.SendData(99, ignoreClient: this.whoAmI, number: number35); break; case 100: int index43 = (int) this.reader.ReadUInt16(); @@ -2564,7 +2301,6 @@ namespace Terraria npc3.lastPortalColorIndex = extraInfo2 + (extraInfo2 % 2 == 0 ? 1 : -1); npc3.Teleport(newPos2, 4, extraInfo2); npc3.velocity = vector2_10; - npc3.netOffset *= 0.0f; break; case 101: if (Main.netMode == 2) @@ -2593,56 +2329,56 @@ namespace Terraria break; case 102: int index44 = (int) this.reader.ReadByte(); - ushort num107 = this.reader.ReadUInt16(); + byte num99 = this.reader.ReadByte(); Vector2 Other = this.reader.ReadVector2(); if (Main.netMode == 2) { - NetMessage.TrySendData(102, number: this.whoAmI, number2: ((float) num107), number3: Other.X, number4: Other.Y); + NetMessage.SendData(102, number: this.whoAmI, number2: ((float) num99), number3: Other.X, number4: Other.Y); break; } - Player player17 = Main.player[index44]; + Player player16 = Main.player[index44]; for (int index45 = 0; index45 < (int) byte.MaxValue; ++index45) { - Player player18 = Main.player[index45]; - if (player18.active && !player18.dead && (player17.team == 0 || player17.team == player18.team) && (double) player18.Distance(Other) < 700.0) + Player player17 = Main.player[index45]; + if (player17.active && !player17.dead && (player16.team == 0 || player16.team == player17.team) && (double) player17.Distance(Other) < 700.0) { - Vector2 vector2_11 = player17.Center - player18.Center; + Vector2 vector2_11 = player16.Center - player17.Center; Vector2 vec = Vector2.Normalize(vector2_11); if (!vec.HasNaNs()) { - int num108 = 90; - float num109 = 0.0f; - float num110 = 0.2094395f; + int num100 = 90; + float num101 = 0.0f; + float num102 = 0.2094395f; Vector2 spinningpoint = new Vector2(0.0f, -8f); Vector2 vector2_12 = new Vector2(-3f); - float num111 = 0.0f; - float num112 = 0.005f; - switch (num107) + float num103 = 0.0f; + float num104 = 0.005f; + switch (num99) { case 173: - num108 = 90; + num100 = 90; break; case 176: - num108 = 88; + num100 = 88; break; case 179: - num108 = 86; + num100 = 86; break; } for (int index46 = 0; (double) index46 < (double) vector2_11.Length() / 6.0; ++index46) { - Vector2 Position = player18.Center + 6f * (float) index46 * vec + spinningpoint.RotatedBy((double) num109) + vector2_12; - num109 += num110; - int Type5 = num108; + Vector2 Position = player17.Center + 6f * (float) index46 * vec + spinningpoint.RotatedBy((double) num101) + vector2_12; + num101 += num102; + int Type5 = num100; Color newColor = new Color(); int index47 = Dust.NewDust(Position, 6, 6, Type5, Alpha: 100, newColor: newColor, Scale: 1.5f); Main.dust[index47].noGravity = true; Main.dust[index47].velocity = Vector2.Zero; - Main.dust[index47].fadeIn = (num111 += num112); + Main.dust[index47].fadeIn = (num103 += num104); Main.dust[index47].velocity += vec * 1.5f; } } - player18.NebulaLevelup((int) num107); + player17.NebulaLevelup((int) num99); } } break; @@ -2654,31 +2390,31 @@ namespace Terraria case 104: if (Main.netMode != 1 || Main.npcShop <= 0) break; - Item[] objArray = Main.instance.shop[Main.npcShop].item; + Item[] objArray1 = Main.instance.shop[Main.npcShop].item; int index48 = (int) this.reader.ReadByte(); - int type15 = (int) this.reader.ReadInt16(); - int num113 = (int) this.reader.ReadInt16(); + int type14 = (int) this.reader.ReadInt16(); + int num105 = (int) this.reader.ReadInt16(); int pre3 = (int) this.reader.ReadByte(); - int num114 = this.reader.ReadInt32(); - BitsByte bitsByte26 = (BitsByte) this.reader.ReadByte(); - if (index48 >= objArray.Length) + int num106 = this.reader.ReadInt32(); + BitsByte bitsByte19 = (BitsByte) this.reader.ReadByte(); + if (index48 >= objArray1.Length) break; - objArray[index48] = new Item(); - objArray[index48].netDefaults(type15); - objArray[index48].stack = num113; - objArray[index48].Prefix(pre3); - objArray[index48].value = num114; - objArray[index48].buyOnce = bitsByte26[0]; + objArray1[index48] = new Item(); + objArray1[index48].netDefaults(type14); + objArray1[index48].stack = num105; + objArray1[index48].Prefix(pre3); + objArray1[index48].value = num106; + objArray1[index48].buyOnce = bitsByte19[0]; break; case 105: if (Main.netMode == 1) break; int i3 = (int) this.reader.ReadInt16(); - int num115 = (int) this.reader.ReadInt16(); - bool flag11 = this.reader.ReadBoolean(); - int j3 = num115; - int num116 = flag11 ? 1 : 0; - WorldGen.ToggleGemLock(i3, j3, num116 != 0); + int num107 = (int) this.reader.ReadInt16(); + bool flag9 = this.reader.ReadBoolean(); + int j3 = num107; + int num108 = flag9 ? 1 : 0; + WorldGen.ToggleGemLock(i3, j3, num108 != 0); break; case 106: if (Main.netMode != 1) @@ -2693,9 +2429,9 @@ namespace Terraria break; Color color6 = this.reader.ReadRGB(); string text2 = NetworkText.Deserialize(this.reader).ToString(); - int num117 = (int) this.reader.ReadInt16(); + int num109 = (int) this.reader.ReadInt16(); Color c = color6; - int WidthLimit = num117; + int WidthLimit = num109; Main.NewTextMultiline(text2, c: c, WidthLimit: WidthLimit); break; case 108: @@ -2716,29 +2452,29 @@ namespace Terraria if (Main.netMode != 2) break; int x8 = (int) this.reader.ReadInt16(); - int num118 = (int) this.reader.ReadInt16(); + int num110 = (int) this.reader.ReadInt16(); int x9 = (int) this.reader.ReadInt16(); int y13 = (int) this.reader.ReadInt16(); - int num119 = (int) this.reader.ReadByte(); + int num111 = (int) this.reader.ReadByte(); int whoAmI3 = this.whoAmI; WiresUI.Settings.MultiToolMode toolMode = WiresUI.Settings.ToolMode; - WiresUI.Settings.ToolMode = (WiresUI.Settings.MultiToolMode) num119; - int y14 = num118; + WiresUI.Settings.ToolMode = (WiresUI.Settings.MultiToolMode) num111; + int y14 = num110; Wiring.MassWireOperation(new Point(x8, y14), new Point(x9, y13), Main.player[whoAmI3]); WiresUI.Settings.ToolMode = toolMode; break; case 110: if (Main.netMode != 1) break; - int type16 = (int) this.reader.ReadInt16(); - int num120 = (int) this.reader.ReadInt16(); + int type15 = (int) this.reader.ReadInt16(); + int num112 = (int) this.reader.ReadInt16(); int index49 = (int) this.reader.ReadByte(); if (index49 != Main.myPlayer) break; - Player player19 = Main.player[index49]; - for (int index50 = 0; index50 < num120; ++index50) - player19.ConsumeItem(type16); - player19.wireOperationsCooldown = 0; + Player player18 = Main.player[index49]; + for (int index50 = 0; index50 < num112; ++index50) + player18.ConsumeItem(type15); + player18.wireOperationsCooldown = 0; break; case 111: if (Main.netMode != 2) @@ -2746,26 +2482,19 @@ namespace Terraria BirthdayParty.ToggleManualParty(); break; case 112: - int number38 = (int) this.reader.ReadByte(); - int x10 = this.reader.ReadInt32(); - int y15 = this.reader.ReadInt32(); - int num121 = (int) this.reader.ReadByte(); - int num122 = (int) this.reader.ReadInt16(); - switch (number38) - { - case 1: - if (Main.netMode == 1) - WorldGen.TreeGrowFX(x10, y15, num121, num122); - if (Main.netMode != 2) - return; - NetMessage.TrySendData((int) num1, number: number38, number2: ((float) x10), number3: ((float) y15), number4: ((float) num121), number5: num122); - return; - case 2: - NPC.FairyEffects(new Vector2((float) x10, (float) y15), num121); - return; - default: - return; - } + int number36 = (int) this.reader.ReadByte(); + int x10 = (int) this.reader.ReadInt16(); + int y15 = (int) this.reader.ReadInt16(); + int height = (int) this.reader.ReadByte(); + int num113 = (int) this.reader.ReadInt16(); + if (number36 != 1) + break; + if (Main.netMode == 1) + WorldGen.TreeGrowFX(x10, y15, height, num113); + if (Main.netMode != 2) + break; + NetMessage.SendData((int) num1, number: number36, number2: ((float) x10), number3: ((float) y15), number4: ((float) height), number5: num113); + break; case 113: int x11 = (int) this.reader.ReadInt16(); int y16 = (int) this.reader.ReadInt16(); @@ -2781,13 +2510,13 @@ namespace Terraria DD2Event.WipeEntities(); break; case 115: - int number39 = (int) this.reader.ReadByte(); + int number37 = (int) this.reader.ReadByte(); if (Main.netMode == 2) - number39 = this.whoAmI; - Main.player[number39].MinionAttackTargetNPC = (int) this.reader.ReadInt16(); + number37 = this.whoAmI; + Main.player[number37].MinionAttackTargetNPC = (int) this.reader.ReadInt16(); if (Main.netMode != 2) break; - NetMessage.TrySendData(115, ignoreClient: this.whoAmI, number: number39); + NetMessage.SendData(115, ignoreClient: this.whoAmI, number: number37); break; case 116: if (Main.netMode != 1) @@ -2799,16 +2528,16 @@ namespace Terraria if (Main.netMode == 2 && this.whoAmI != playerTargetIndex1 && (!Main.player[playerTargetIndex1].hostile || !Main.player[this.whoAmI].hostile)) break; PlayerDeathReason playerDeathReason1 = PlayerDeathReason.FromReader(this.reader); - int num123 = (int) this.reader.ReadInt16(); - int num124 = (int) this.reader.ReadByte() - 1; - BitsByte bitsByte27 = (BitsByte) this.reader.ReadByte(); - bool flag12 = bitsByte27[0]; - bool pvp1 = bitsByte27[1]; - int num125 = (int) this.reader.ReadSByte(); - Main.player[playerTargetIndex1].Hurt(playerDeathReason1, num123, num124, pvp1, true, flag12, num125); + int num114 = (int) this.reader.ReadInt16(); + int num115 = (int) this.reader.ReadByte() - 1; + BitsByte bitsByte20 = (BitsByte) this.reader.ReadByte(); + bool flag10 = bitsByte20[0]; + bool pvp1 = bitsByte20[1]; + int num116 = (int) this.reader.ReadSByte(); + Main.player[playerTargetIndex1].Hurt(playerDeathReason1, num114, num115, pvp1, true, flag10, num116); if (Main.netMode != 2) break; - NetMessage.SendPlayerHurt(playerTargetIndex1, playerDeathReason1, num123, num124, flag12, pvp1, num125, ignoreClient: this.whoAmI); + NetMessage.SendPlayerHurt(playerTargetIndex1, playerDeathReason1, num114, num115, flag10, pvp1, num116, ignoreClient: this.whoAmI); break; case 118: int playerTargetIndex2 = (int) this.reader.ReadByte(); @@ -2816,299 +2545,23 @@ namespace Terraria playerTargetIndex2 = this.whoAmI; PlayerDeathReason playerDeathReason2 = PlayerDeathReason.FromReader(this.reader); int damage = (int) this.reader.ReadInt16(); - int num126 = (int) this.reader.ReadByte() - 1; + int num117 = (int) this.reader.ReadByte() - 1; bool pvp2 = ((BitsByte) this.reader.ReadByte())[0]; - Main.player[playerTargetIndex2].KillMe(playerDeathReason2, (double) damage, num126, pvp2); + Main.player[playerTargetIndex2].KillMe(playerDeathReason2, (double) damage, num117, pvp2); if (Main.netMode != 2) break; - NetMessage.SendPlayerDeath(playerTargetIndex2, playerDeathReason2, damage, num126, pvp2, ignoreClient: this.whoAmI); + NetMessage.SendPlayerDeath(playerTargetIndex2, playerDeathReason2, damage, num117, pvp2, ignoreClient: this.whoAmI); break; case 119: if (Main.netMode != 1) break; int x12 = (int) this.reader.ReadSingle(); - int num127 = (int) this.reader.ReadSingle(); + int num118 = (int) this.reader.ReadSingle(); Color color7 = this.reader.ReadRGB(); NetworkText networkText = NetworkText.Deserialize(this.reader); - int y17 = num127; + int y17 = num118; CombatText.NewText(new Rectangle(x12, y17, 0, 0), color7, networkText.ToString()); break; - case 120: - int index51 = (int) this.reader.ReadByte(); - if (Main.netMode == 2) - index51 = this.whoAmI; - int num128 = (int) this.reader.ReadByte(); - if (num128 < 0 || num128 >= 145 || Main.netMode != 2) - break; - EmoteBubble.NewBubble(num128, new WorldUIAnchor((Entity) Main.player[index51]), 360); - EmoteBubble.CheckForNPCsToReactToEmoteBubble(num128, Main.player[index51]); - break; - case 121: - int num129 = (int) this.reader.ReadByte(); - if (Main.netMode == 2) - num129 = this.whoAmI; - int key2 = this.reader.ReadInt32(); - int itemIndex1 = (int) this.reader.ReadByte(); - bool dye1 = false; - if (itemIndex1 >= 8) - { - dye1 = true; - itemIndex1 -= 8; - } - TileEntity tileEntity2; - if (!TileEntity.ByID.TryGetValue(key2, out tileEntity2)) - { - this.reader.ReadInt32(); - int num130 = (int) this.reader.ReadByte(); - break; - } - if (itemIndex1 >= 8) - tileEntity2 = (TileEntity) null; - if (tileEntity2 is TEDisplayDoll teDisplayDoll4) - { - teDisplayDoll4.ReadItem(itemIndex1, this.reader, dye1); - } - else - { - this.reader.ReadInt32(); - int num131 = (int) this.reader.ReadByte(); - } - if (Main.netMode != 2) - break; - NetMessage.TrySendData((int) num1, ignoreClient: num129, number: num129, number2: ((float) key2), number3: ((float) itemIndex1), number4: ((float) dye1.ToInt())); - break; - case 122: - int num132 = this.reader.ReadInt32(); - int index52 = (int) this.reader.ReadByte(); - if (Main.netMode == 2) - index52 = this.whoAmI; - if (Main.netMode == 2) - { - if (num132 == -1) - { - Main.player[index52].tileEntityAnchor.Clear(); - NetMessage.TrySendData((int) num1, number: num132, number2: ((float) index52)); - break; - } - TileEntity tileEntity3; - if (!TileEntity.IsOccupied(num132, out int _) && TileEntity.ByID.TryGetValue(num132, out tileEntity3)) - { - Main.player[index52].tileEntityAnchor.Set(num132, (int) tileEntity3.Position.X, (int) tileEntity3.Position.Y); - NetMessage.TrySendData((int) num1, number: num132, number2: ((float) index52)); - } - } - if (Main.netMode != 1) - break; - if (num132 == -1) - { - Main.player[index52].tileEntityAnchor.Clear(); - break; - } - TileEntity tileEntity4; - if (!TileEntity.ByID.TryGetValue(num132, out tileEntity4)) - break; - TileEntity.SetInteractionAnchor(Main.player[index52], (int) tileEntity4.Position.X, (int) tileEntity4.Position.Y, num132); - break; - case 123: - if (Main.netMode != 2) - break; - int x13 = (int) this.reader.ReadInt16(); - int num133 = (int) this.reader.ReadInt16(); - int num134 = (int) this.reader.ReadInt16(); - int num135 = (int) this.reader.ReadByte(); - int num136 = (int) this.reader.ReadInt16(); - int y18 = num133; - int netid2 = num134; - int prefix2 = num135; - int stack2 = num136; - TEWeaponsRack.TryPlacing(x13, y18, netid2, prefix2, stack2); - break; - case 124: - int num137 = (int) this.reader.ReadByte(); - if (Main.netMode == 2) - num137 = this.whoAmI; - int key3 = this.reader.ReadInt32(); - int itemIndex2 = (int) this.reader.ReadByte(); - bool dye2 = false; - if (itemIndex2 >= 2) - { - dye2 = true; - itemIndex2 -= 2; - } - TileEntity tileEntity5; - if (!TileEntity.ByID.TryGetValue(key3, out tileEntity5)) - { - this.reader.ReadInt32(); - int num138 = (int) this.reader.ReadByte(); - break; - } - if (itemIndex2 >= 2) - tileEntity5 = (TileEntity) null; - if (tileEntity5 is TEHatRack teHatRack4) - { - teHatRack4.ReadItem(itemIndex2, this.reader, dye2); - } - else - { - this.reader.ReadInt32(); - int num139 = (int) this.reader.ReadByte(); - } - if (Main.netMode != 2) - break; - NetMessage.TrySendData((int) num1, ignoreClient: num137, number: num137, number2: ((float) key3), number3: ((float) itemIndex2), number4: ((float) dye2.ToInt())); - break; - case 125: - int num140 = (int) this.reader.ReadByte(); - int x14 = (int) this.reader.ReadInt16(); - int y19 = (int) this.reader.ReadInt16(); - int pickDamage = (int) this.reader.ReadByte(); - if (Main.netMode == 2) - num140 = this.whoAmI; - if (Main.netMode == 1) - Main.player[Main.myPlayer].GetOtherPlayersPickTile(x14, y19, pickDamage); - if (Main.netMode != 2) - break; - NetMessage.TrySendData(125, ignoreClient: num140, number: num140, number2: ((float) x14), number3: ((float) y19), number4: ((float) pickDamage)); - break; - case 126: - if (Main.netMode != 1) - break; - NPC.RevengeManager.AddMarkerFromReader(this.reader); - break; - case 127: - int markerUniqueID = this.reader.ReadInt32(); - if (Main.netMode != 1) - break; - NPC.RevengeManager.DestroyMarker(markerUniqueID); - break; - case 128: - int num141 = (int) this.reader.ReadByte(); - int num142 = (int) this.reader.ReadUInt16(); - int num143 = (int) this.reader.ReadUInt16(); - int numberOfHits = (int) this.reader.ReadUInt16(); - int projid = (int) this.reader.ReadUInt16(); - if (Main.netMode == 2) - { - NetMessage.SendData(128, ignoreClient: num141, number: num141, number2: ((float) numberOfHits), number3: ((float) projid), number5: num142, number6: num143); - break; - } - GolfHelper.ContactListener.PutBallInCup_TextAndEffects(new Point(num142, num143), num141, numberOfHits, projid); - break; - case 129: - if (Main.netMode != 1) - break; - Main.FixUIScale(); - Main.TrySetPreparationState(Main.WorldPreparationState.ProcessingData); - break; - case 130: - if (Main.netMode != 2) - break; - int num144 = (int) this.reader.ReadUInt16(); - int num145 = (int) this.reader.ReadUInt16(); - int Type6 = (int) this.reader.ReadInt16(); - int X2 = num144 * 16; - int num146 = num145 * 16; - NPC npc4 = new NPC(); - npc4.SetDefaults(Type6); - int type17 = npc4.type; - int netId = npc4.netID; - int Y2 = num146; - int Type7 = Type6; - int number40 = NPC.NewNPC(X2, Y2, Type7); - if (netId == type17) - break; - Main.npc[number40].SetDefaults(netId); - NetMessage.TrySendData(23, number: number40); - break; - case 131: - if (Main.netMode != 1) - break; - int index53 = (int) this.reader.ReadUInt16(); - NPC npc5 = index53 >= 200 ? new NPC() : Main.npc[index53]; - if (this.reader.ReadByte() != (byte) 1) - break; - int time3 = this.reader.ReadInt32(); - int fromWho = (int) this.reader.ReadInt16(); - npc5.GetImmuneTime(fromWho, time3); - break; - case 132: - if (Main.netMode != 1) - break; - Point point = this.reader.ReadVector2().ToPoint(); - ushort key4 = this.reader.ReadUInt16(); - LegacySoundStyle legacySoundStyle = SoundID.SoundByIndex[key4]; - BitsByte bitsByte28 = (BitsByte) this.reader.ReadByte(); - int Style2 = !bitsByte28[0] ? legacySoundStyle.Style : this.reader.ReadInt32(); - float volumeScale = !bitsByte28[1] ? legacySoundStyle.Volume : MathHelper.Clamp(this.reader.ReadSingle(), 0.0f, 1f); - float pitchOffset = !bitsByte28[2] ? legacySoundStyle.GetRandomPitch() : MathHelper.Clamp(this.reader.ReadSingle(), -1f, 1f); - SoundEngine.PlaySound(legacySoundStyle.SoundId, point.X, point.Y, Style2, volumeScale, pitchOffset); - break; - case 133: - if (Main.netMode != 2) - break; - int x15 = (int) this.reader.ReadInt16(); - int num147 = (int) this.reader.ReadInt16(); - int num148 = (int) this.reader.ReadInt16(); - int num149 = (int) this.reader.ReadByte(); - int num150 = (int) this.reader.ReadInt16(); - int y20 = num147; - int netid3 = num148; - int prefix3 = num149; - int stack3 = num150; - TEFoodPlatter.TryPlacing(x15, y20, netid3, prefix3, stack3); - break; - case 134: - int index54 = (int) this.reader.ReadByte(); - int num151 = this.reader.ReadInt32(); - float num152 = this.reader.ReadSingle(); - byte num153 = this.reader.ReadByte(); - bool flag13 = this.reader.ReadBoolean(); - if (Main.netMode == 2) - index54 = this.whoAmI; - Player player20 = Main.player[index54]; - player20.ladyBugLuckTimeLeft = num151; - player20.torchLuck = num152; - player20.luckPotion = num153; - player20.HasGardenGnomeNearby = flag13; - player20.RecalculateLuck(); - if (Main.netMode != 2) - break; - NetMessage.SendData(134, ignoreClient: index54, number: index54); - break; - case 135: - int index55 = (int) this.reader.ReadByte(); - if (Main.netMode != 1) - break; - Main.player[index55].immuneAlpha = (int) byte.MaxValue; - break; - case 136: - for (int index56 = 0; index56 < 2; ++index56) - { - for (int index57 = 0; index57 < 3; ++index57) - NPC.cavernMonsterType[index56, index57] = (int) this.reader.ReadUInt16(); - } - break; - case 137: - if (Main.netMode != 2) - break; - int index58 = (int) this.reader.ReadInt16(); - int buffTypeToRemove = (int) this.reader.ReadUInt16(); - if (index58 < 0 || index58 >= 200) - break; - Main.npc[index58].RequestBuffRemoval(buffTypeToRemove); - break; - case 139: - if (Main.netMode == 2) - break; - int index59 = (int) this.reader.ReadByte(); - bool flag14 = this.reader.ReadBoolean(); - Main.countsAsHostForGameplay[index59] = flag14; - break; - default: - if (Netplay.Clients[this.whoAmI].State != 0) - break; - NetMessage.BootPlayer(this.whoAmI, Lang.mp[2].ToNetworkText()); - break; } } } diff --git a/Minecart.cs b/Minecart.cs index 8d5a367..198b035 100644 --- a/Minecart.cs +++ b/Minecart.cs @@ -1,12 +1,12 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Minecart -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using System; -using Terraria.GameContent; +using Terraria.ID; namespace Terraria { @@ -50,7 +50,7 @@ namespace Terraria public static void Initialize() { - if ((double) TextureAssets.MinecartMount.Width() != 50.0) + if ((double) Main.minecartMountTexture.Width != 50.0) throw new Exception("Be sure to update Minecart.textureWidth to match the actual texture size of " + (object) 50f + "."); Minecart._rightSideConnection = new int[36]; Minecart._leftSideConnection = new int[36]; @@ -439,8 +439,6 @@ namespace Terraria } } - public static bool IsPressurePlate(Tile tile) => tile.active() && tile.type == (ushort) 314 && (tile.frameX == (short) 20 || tile.frameX == (short) 21); - public static BitsByte TrackCollision( ref Vector2 Position, ref Vector2 Velocity, @@ -451,7 +449,7 @@ namespace Terraria bool followUp, int fallStart, bool trackOnly, - Mount.MountDelegatesData delegatesData) + Action MinecartDust) { if (followDown & followUp) { @@ -709,8 +707,8 @@ namespace Terraria int num11 = (int) ((double) Position.Y / 16.0); if (fallStart < num11 - 1) { - delegatesData.MinecartLandingSound(Position, Width, Height); - Minecart.WheelSparks(delegatesData.MinecartDust, Position, Width, Height, 10); + Main.PlaySound(SoundID.Item53, (int) Position.X + Width / 2, (int) Position.Y + Height / 2); + Minecart.WheelSparks(MinecartDust, Position, Width, Height, 10); } } if (trackState1 == Minecart.TrackState.AboveFront && Minecart._trackType[index7] == 1) @@ -824,8 +822,7 @@ label_99: public static bool FrameTrack(int i, int j, bool pound, bool mute = false) { - if (Minecart._trackType == null) - return false; + int index1 = 0; Tile tileTrack = Main.tile[i, j]; if (tileTrack == null) { @@ -834,13 +831,26 @@ label_99: } if (mute && tileTrack.type != (ushort) 314) return false; - int tilesSetLookupIndex = Minecart.GetNearbyTilesSetLookupIndex(i, j); - int index1 = (int) tileTrack.FrontTrack(); + if (Main.tile[i - 1, j - 1] != null && Main.tile[i - 1, j - 1].type == (ushort) 314) + ++index1; + if (Main.tile[i - 1, j] != null && Main.tile[i - 1, j].type == (ushort) 314) + index1 += 2; + if (Main.tile[i - 1, j + 1] != null && Main.tile[i - 1, j + 1].type == (ushort) 314) + index1 += 4; + if (Main.tile[i + 1, j - 1] != null && Main.tile[i + 1, j - 1].type == (ushort) 314) + index1 += 8; + if (Main.tile[i + 1, j] != null && Main.tile[i + 1, j].type == (ushort) 314) + index1 += 16; + if (Main.tile[i + 1, j + 1] != null && Main.tile[i + 1, j + 1].type == (ushort) 314) + index1 += 32; + int index2 = (int) tileTrack.FrontTrack(); int num1 = (int) tileTrack.BackTrack(); - int num2 = index1 < 0 || index1 >= Minecart._trackType.Length ? 0 : Minecart._trackType[index1]; - int index2 = -1; + if (Minecart._trackType == null) + return false; + int num2 = index2 < 0 || index2 >= Minecart._trackType.Length ? 0 : Minecart._trackType[index2]; int index3 = -1; - int[] trackSwitchOption = Minecart._trackSwitchOptions[tilesSetLookupIndex]; + int index4 = -1; + int[] trackSwitchOption = Minecart._trackSwitchOptions[index1]; if (trackSwitchOption == null) { if (pound) @@ -854,67 +864,67 @@ label_99: int num3 = -1; int num4 = -1; bool flag = false; - for (int index4 = 0; index4 < trackSwitchOption.Length; ++index4) + for (int index5 = 0; index5 < trackSwitchOption.Length; ++index5) { - int index5 = trackSwitchOption[index4]; - if (num1 == trackSwitchOption[index4]) - index3 = index4; - if (Minecart._trackType[index5] == num2) + int index6 = trackSwitchOption[index5]; + if (num1 == trackSwitchOption[index5]) + index4 = index5; + if (Minecart._trackType[index6] == num2) { - if (Minecart._leftSideConnection[index5] == -1 || Minecart._rightSideConnection[index5] == -1) + if (Minecart._leftSideConnection[index6] == -1 || Minecart._rightSideConnection[index6] == -1) { - if (index1 == trackSwitchOption[index4]) + if (index2 == trackSwitchOption[index5]) { - index2 = index4; + index3 = index5; flag = true; } if (num3 == -1) - num3 = index4; + num3 = index5; } else { - if (index1 == trackSwitchOption[index4]) + if (index2 == trackSwitchOption[index5]) { - index2 = index4; + index3 = index5; flag = false; } if (num4 == -1) - num4 = index4; + num4 = index5; } } } if (num4 != -1) { - if (index2 == -1 | flag) - index2 = num4; + if (index3 == -1 | flag) + index3 = num4; } else { - if (index2 == -1) + if (index3 == -1) { if (num2 == 2 || num2 == 1) return false; - index2 = num3; + index3 = num3; } - index3 = -1; + index4 = -1; } } else { - for (int index6 = 0; index6 < trackSwitchOption.Length; ++index6) + for (int index7 = 0; index7 < trackSwitchOption.Length; ++index7) { - if (index1 == trackSwitchOption[index6]) - index2 = index6; - if (num1 == trackSwitchOption[index6]) - index3 = index6; + if (index2 == trackSwitchOption[index7]) + index3 = index7; + if (num1 == trackSwitchOption[index7]) + index4 = index7; } int num5 = 0; int num6 = 0; - for (int index7 = 0; index7 < trackSwitchOption.Length; ++index7) + for (int index8 = 0; index8 < trackSwitchOption.Length; ++index8) { - if (Minecart._trackType[trackSwitchOption[index7]] == num2) + if (Minecart._trackType[trackSwitchOption[index8]] == num2) { - if (Minecart._leftSideConnection[trackSwitchOption[index7]] == -1 || Minecart._rightSideConnection[trackSwitchOption[index7]] == -1) + if (Minecart._leftSideConnection[trackSwitchOption[index8]] == -1 || Minecart._rightSideConnection[trackSwitchOption[index8]] == -1) ++num6; else ++num5; @@ -928,13 +938,13 @@ label_99: { while (!flag2) { - ++index3; - if (index3 >= trackSwitchOption.Length) + ++index4; + if (index4 >= trackSwitchOption.Length) { - index3 = -1; + index4 = -1; break; } - if ((Minecart._leftSideConnection[trackSwitchOption[index3]] != Minecart._leftSideConnection[trackSwitchOption[index2]] || Minecart._rightSideConnection[trackSwitchOption[index3]] != Minecart._rightSideConnection[trackSwitchOption[index2]]) && Minecart._trackType[trackSwitchOption[index3]] == num2 && Minecart._leftSideConnection[trackSwitchOption[index3]] != -1 && Minecart._rightSideConnection[trackSwitchOption[index3]] != -1) + if ((Minecart._leftSideConnection[trackSwitchOption[index4]] != Minecart._leftSideConnection[trackSwitchOption[index3]] || Minecart._rightSideConnection[trackSwitchOption[index4]] != Minecart._rightSideConnection[trackSwitchOption[index3]]) && Minecart._trackType[trackSwitchOption[index4]] == num2 && Minecart._leftSideConnection[trackSwitchOption[index4]] != -1 && Minecart._rightSideConnection[trackSwitchOption[index4]] != -1) flag2 = true; } } @@ -942,23 +952,23 @@ label_99: { do { - ++index2; - if (index2 >= trackSwitchOption.Length) + ++index3; + if (index3 >= trackSwitchOption.Length) { - index2 = -1; + index3 = -1; do { - ++index2; + ++index3; } - while (Minecart._trackType[trackSwitchOption[index2]] != num2 || (Minecart._leftSideConnection[trackSwitchOption[index2]] == -1 ? 1 : (Minecart._rightSideConnection[trackSwitchOption[index2]] == -1 ? 1 : 0)) != (flag1 ? 1 : 0)); + while (Minecart._trackType[trackSwitchOption[index3]] != num2 || (Minecart._leftSideConnection[trackSwitchOption[index3]] == -1 ? 1 : (Minecart._rightSideConnection[trackSwitchOption[index3]] == -1 ? 1 : 0)) != (flag1 ? 1 : 0)); break; } } - while (Minecart._trackType[trackSwitchOption[index2]] != num2 || (Minecart._leftSideConnection[trackSwitchOption[index2]] == -1 ? 1 : (Minecart._rightSideConnection[trackSwitchOption[index2]] == -1 ? 1 : 0)) != (flag1 ? 1 : 0)); + while (Minecart._trackType[trackSwitchOption[index3]] != num2 || (Minecart._leftSideConnection[trackSwitchOption[index3]] == -1 ? 1 : (Minecart._rightSideConnection[trackSwitchOption[index3]] == -1 ? 1 : 0)) != (flag1 ? 1 : 0)); } } bool flag3 = false; - switch (index2) + switch (index3) { case -2: if ((int) tileTrack.FrontTrack() != (int) Minecart._firstPressureFrame) @@ -975,21 +985,21 @@ label_99: } break; default: - if ((int) tileTrack.FrontTrack() != trackSwitchOption[index2]) + if ((int) tileTrack.FrontTrack() != trackSwitchOption[index3]) { flag3 = true; break; } break; } - if (index3 == -1) + if (index4 == -1) { if (tileTrack.BackTrack() != (short) -1) flag3 = true; } - else if ((int) tileTrack.BackTrack() != trackSwitchOption[index3]) + else if ((int) tileTrack.BackTrack() != trackSwitchOption[index4]) flag3 = true; - switch (index2) + switch (index3) { case -2: tileTrack.FrontTrack(Minecart._firstPressureFrame); @@ -998,36 +1008,18 @@ label_99: tileTrack.FrontTrack((short) 0); break; default: - tileTrack.FrontTrack((short) trackSwitchOption[index2]); + tileTrack.FrontTrack((short) trackSwitchOption[index3]); break; } - if (index3 == -1) + if (index4 == -1) tileTrack.BackTrack((short) -1); else - tileTrack.BackTrack((short) trackSwitchOption[index3]); + tileTrack.BackTrack((short) trackSwitchOption[index4]); if (pound & flag3 && !mute) WorldGen.KillTile(i, j, true); return true; } - private static int GetNearbyTilesSetLookupIndex(int i, int j) - { - int num = 0; - if (Main.tile[i - 1, j - 1] != null && Main.tile[i - 1, j - 1].type == (ushort) 314) - ++num; - if (Main.tile[i - 1, j] != null && Main.tile[i - 1, j].type == (ushort) 314) - num += 2; - if (Main.tile[i - 1, j + 1] != null && Main.tile[i - 1, j + 1].type == (ushort) 314) - num += 4; - if (Main.tile[i + 1, j - 1] != null && Main.tile[i + 1, j - 1].type == (ushort) 314) - num += 8; - if (Main.tile[i + 1, j] != null && Main.tile[i + 1, j].type == (ushort) 314) - num += 16; - if (Main.tile[i + 1, j + 1] != null && Main.tile[i + 1, j + 1].type == (ushort) 314) - num += 32; - return num; - } - public static bool GetOnTrack( int tileX, int tileY, @@ -1089,57 +1081,37 @@ label_99: int Height, bool followDown, bool followUp, - Mount.MountDelegatesData delegatesData) + Action MinecartDust) { - Vector2 leftWheel; - Vector2 rightWheel; - Minecart.GetWheelsPositions(Position, Width, Height, followDown, followUp, delegatesData, out leftWheel, out rightWheel); - float num1 = rightWheel.Y - leftWheel.Y; - float num2 = rightWheel.X - leftWheel.X; + Vector2 Position1 = Position; + Vector2 Position2 = Position; + Vector2 zero = Vector2.Zero; + Vector2 Velocity = new Vector2(-12f, 0.0f); + Minecart.TrackCollision(ref Position1, ref Velocity, ref zero, Width, Height, followDown, followUp, 0, true, MinecartDust); + Vector2 vector2_1 = Position1 + Velocity; + Velocity = new Vector2(12f, 0.0f); + Minecart.TrackCollision(ref Position2, ref Velocity, ref zero, Width, Height, followDown, followUp, 0, true, MinecartDust); + Vector2 vector2_2 = Position2 + Velocity; + float num1 = vector2_2.Y - vector2_1.Y; + float num2 = vector2_2.X - vector2_1.X; float num3 = num1 / num2; - double num4 = (double) leftWheel.Y + ((double) Position.X - (double) leftWheel.X) * (double) num3; + double num4 = (double) vector2_1.Y + ((double) Position.X - (double) vector2_1.X) * (double) num3; float num5 = (Position.X - (float) (int) Position.X) * num3; rotation = (float) Math.Atan2((double) num1, (double) num2); double y = (double) Position.Y; return (float) (num4 - y) + num5; } - public static void GetWheelsPositions( - Vector2 Position, - int Width, - int Height, - bool followDown, - bool followUp, - Mount.MountDelegatesData delegatesData, - out Vector2 leftWheel, - out Vector2 rightWheel) - { - leftWheel = Position; - rightWheel = Position; - Vector2 zero = Vector2.Zero; - Vector2 Velocity = new Vector2(-12f, 0.0f); - Minecart.TrackCollision(ref leftWheel, ref Velocity, ref zero, Width, Height, followDown, followUp, 0, true, delegatesData); - leftWheel += Velocity; - Velocity = new Vector2(12f, 0.0f); - Minecart.TrackCollision(ref rightWheel, ref Velocity, ref zero, Width, Height, followDown, followUp, 0, true, delegatesData); - rightWheel += Velocity; - } - public static void HitTrackSwitch(Vector2 Position, int Width, int Height) { - Vector2 magnetPosition = Minecart.GetMagnetPosition(Position, Width, Height); - int num = (int) ((double) magnetPosition.X / 16.0); - int j = (int) ((double) magnetPosition.Y / 16.0); + Vector2 vector2_1 = new Vector2((float) (Width / 2) - 25f, (float) (Height / 2)); + Vector2 vector2_2 = Position + new Vector2((float) (Width / 2) - 25f, (float) (Height / 2)) + Minecart._trackMagnetOffset; + int num = (int) ((double) vector2_2.X / 16.0); + int j = (int) ((double) vector2_2.Y / 16.0); Wiring.HitSwitch(num, j); NetMessage.SendData(59, number: num, number2: ((float) j)); } - public static Vector2 GetMagnetPosition(Vector2 Position, int Width, int Height) - { - Vector2 vector2 = new Vector2((float) (Width / 2) - 25f, (float) (Height / 2)); - return Position + new Vector2((float) (Width / 2) - 25f, (float) (Height / 2)) + Minecart._trackMagnetOffset; - } - public static void FlipSwitchTrack(int i, int j) { Tile tileTrack = Main.tile[i, j]; @@ -1365,85 +1337,6 @@ label_99: return rectangle; } - public static bool GetAreExpectationsForSidesMet( - Point tileCoords, - int? expectedYOffsetForLeft, - int? expectedYOffsetForRight) - { - Tile tileTrack = Main.tile[tileCoords.X, tileCoords.Y]; - if (expectedYOffsetForLeft.HasValue) - { - short num1 = tileTrack.FrontTrack(); - int num2 = Minecart.ConvertOffsetYToTrackConnectionValue(expectedYOffsetForLeft.Value); - if (Minecart._leftSideConnection[(int) num1] != num2) - return false; - } - if (expectedYOffsetForRight.HasValue) - { - short num3 = tileTrack.FrontTrack(); - int num4 = Minecart.ConvertOffsetYToTrackConnectionValue(expectedYOffsetForRight.Value); - if (Minecart._rightSideConnection[(int) num3] != num4) - return false; - } - return true; - } - - public static void TryFittingTileOrientation( - Point tileCoords, - int? expectedYOffsetForLeft, - int? expectedYOffsetForRight) - { - int tilesSetLookupIndex = Minecart.GetNearbyTilesSetLookupIndex(tileCoords.X, tileCoords.Y); - int[] trackSwitchOption = Minecart._trackSwitchOptions[tilesSetLookupIndex]; - if (trackSwitchOption == null) - return; - Tile tileSafely = Framing.GetTileSafely(tileCoords); - int num1 = Minecart._trackType[(int) tileSafely.FrontTrack()]; - int? nullable = new int?(); - for (int index1 = 0; index1 < trackSwitchOption.Length; ++index1) - { - int index2 = trackSwitchOption[index1]; - int num2 = Minecart._leftSideConnection[index2]; - int num3 = Minecart._rightSideConnection[index2]; - int num4 = Minecart._trackType[index2]; - if (expectedYOffsetForLeft.HasValue) - { - int num5 = Minecart.ConvertOffsetYToTrackConnectionValue(expectedYOffsetForLeft.Value); - if (Minecart._leftSideConnection[index2] != num5) - continue; - } - if (expectedYOffsetForRight.HasValue) - { - int num6 = Minecart.ConvertOffsetYToTrackConnectionValue(expectedYOffsetForRight.Value); - if (Minecart._rightSideConnection[index2] != num6) - continue; - } - if (Minecart._trackType[index2] == num1) - { - nullable = new int?(index2); - break; - } - } - if (!nullable.HasValue) - return; - tileSafely.FrontTrack((short) nullable.Value); - NetMessage.SendTileSquare(-1, tileCoords.X, tileCoords.Y, 1); - } - - private static int ConvertOffsetYToTrackConnectionValue(int offsetY) - { - if (offsetY == -1) - return 0; - return offsetY != 1 ? 1 : 2; - } - - private static int ConvertTrackConnectionValueToOffsetY(int trackConnectionValue) - { - if (trackConnectionValue == 0) - return -1; - return trackConnectionValue != 2 ? 0 : 1; - } - public static void WheelSparks( Action DustAction, Vector2 Position, diff --git a/Modules/AnchorDataModule.cs b/Modules/AnchorDataModule.cs index 353ff84..7bff954 100644 --- a/Modules/AnchorDataModule.cs +++ b/Modules/AnchorDataModule.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Modules.AnchorDataModule -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Terraria.DataStructures; diff --git a/Modules/AnchorTypesModule.cs b/Modules/AnchorTypesModule.cs index 62b0254..fc478b7 100644 --- a/Modules/AnchorTypesModule.cs +++ b/Modules/AnchorTypesModule.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Modules.AnchorTypesModule -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; diff --git a/Modules/LiquidDeathModule.cs b/Modules/LiquidDeathModule.cs index b12fcf1..87b15af 100644 --- a/Modules/LiquidDeathModule.cs +++ b/Modules/LiquidDeathModule.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Modules.LiquidDeathModule -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Modules diff --git a/Modules/LiquidPlacementModule.cs b/Modules/LiquidPlacementModule.cs index 496ca37..c363845 100644 --- a/Modules/LiquidPlacementModule.cs +++ b/Modules/LiquidPlacementModule.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Modules.LiquidPlacementModule -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Terraria.Enums; diff --git a/Modules/TileObjectAlternatesModule.cs b/Modules/TileObjectAlternatesModule.cs index c2fd248..d7fafb1 100644 --- a/Modules/TileObjectAlternatesModule.cs +++ b/Modules/TileObjectAlternatesModule.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Modules.TileObjectAlternatesModule -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System.Collections.Generic; diff --git a/Modules/TileObjectBaseModule.cs b/Modules/TileObjectBaseModule.cs index b41e160..e525482 100644 --- a/Modules/TileObjectBaseModule.cs +++ b/Modules/TileObjectBaseModule.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Modules.TileObjectBaseModule -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Terraria.DataStructures; diff --git a/Modules/TileObjectCoordinatesModule.cs b/Modules/TileObjectCoordinatesModule.cs index 1da646f..e314971 100644 --- a/Modules/TileObjectCoordinatesModule.cs +++ b/Modules/TileObjectCoordinatesModule.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Modules.TileObjectCoordinatesModule -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; @@ -18,7 +18,6 @@ namespace Terraria.Modules public int styleWidth; public int styleHeight; public bool calculated; - public int drawStyleOffset; public TileObjectCoordinatesModule(TileObjectCoordinatesModule copyFrom = null, int[] drawHeight = null) { @@ -28,7 +27,6 @@ namespace Terraria.Modules this.padding = 0; this.paddingFix = Point16.Zero; this.styleWidth = 0; - this.drawStyleOffset = 0; this.styleHeight = 0; this.calculated = false; this.heights = drawHeight; @@ -38,7 +36,6 @@ namespace Terraria.Modules this.width = copyFrom.width; this.padding = copyFrom.padding; this.paddingFix = copyFrom.paddingFix; - this.drawStyleOffset = copyFrom.drawStyleOffset; this.styleWidth = copyFrom.styleWidth; this.styleHeight = copyFrom.styleHeight; this.calculated = copyFrom.calculated; diff --git a/Modules/TileObjectDrawModule.cs b/Modules/TileObjectDrawModule.cs index 6d46d1c..e814db1 100644 --- a/Modules/TileObjectDrawModule.cs +++ b/Modules/TileObjectDrawModule.cs @@ -1,14 +1,13 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Modules.TileObjectDrawModule -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Modules { public class TileObjectDrawModule { - public int xOffset; public int yOffset; public bool flipHorizontal; public bool flipVertical; @@ -18,7 +17,6 @@ namespace Terraria.Modules { if (copyFrom == null) { - this.xOffset = 0; this.yOffset = 0; this.flipHorizontal = false; this.flipVertical = false; @@ -26,7 +24,6 @@ namespace Terraria.Modules } else { - this.xOffset = copyFrom.xOffset; this.yOffset = copyFrom.yOffset; this.flipHorizontal = copyFrom.flipHorizontal; this.flipVertical = copyFrom.flipVertical; diff --git a/Modules/TileObjectStyleModule.cs b/Modules/TileObjectStyleModule.cs index d5e2e18..cf88176 100644 --- a/Modules/TileObjectStyleModule.cs +++ b/Modules/TileObjectStyleModule.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Modules.TileObjectStyleModule -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Modules @@ -13,8 +13,6 @@ namespace Terraria.Modules public int styleWrapLimit; public int styleMultiplier; public int styleLineSkip; - public int? styleWrapLimitVisualOverride; - public int? styleLineSkipVisualoverride; public TileObjectStyleModule(TileObjectStyleModule copyFrom = null) { @@ -23,8 +21,6 @@ namespace Terraria.Modules this.style = 0; this.horizontal = false; this.styleWrapLimit = 0; - this.styleWrapLimitVisualOverride = new int?(); - this.styleLineSkipVisualoverride = new int?(); this.styleMultiplier = 1; this.styleLineSkip = 1; } @@ -35,8 +31,6 @@ namespace Terraria.Modules this.styleWrapLimit = copyFrom.styleWrapLimit; this.styleMultiplier = copyFrom.styleMultiplier; this.styleLineSkip = copyFrom.styleLineSkip; - this.styleWrapLimitVisualOverride = copyFrom.styleWrapLimitVisualOverride; - this.styleLineSkipVisualoverride = copyFrom.styleLineSkipVisualoverride; } } } diff --git a/Modules/TileObjectSubTilesModule.cs b/Modules/TileObjectSubTilesModule.cs index a26b894..b87c924 100644 --- a/Modules/TileObjectSubTilesModule.cs +++ b/Modules/TileObjectSubTilesModule.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Modules.TileObjectSubTilesModule -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System.Collections.Generic; diff --git a/Modules/TilePlacementHooksModule.cs b/Modules/TilePlacementHooksModule.cs index 80c4d34..480179a 100644 --- a/Modules/TilePlacementHooksModule.cs +++ b/Modules/TilePlacementHooksModule.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Modules.TilePlacementHooksModule -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Terraria.DataStructures; diff --git a/Mount.cs b/Mount.cs index 5bab1e1..b0afa95 100644 --- a/Mount.cs +++ b/Mount.cs @@ -1,19 +1,15 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Mount -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using System; using System.Collections.Generic; -using Terraria.Audio; using Terraria.DataStructures; -using Terraria.GameContent; using Terraria.GameContent.Achievements; -using Terraria.GameContent.Drawing; using Terraria.Graphics.Shaders; using Terraria.ID; @@ -22,6 +18,23 @@ namespace Terraria public class Mount { public static int currentShader = 0; + public const int None = -1; + public const int Rudolph = 0; + public const int Bunny = 1; + public const int Pigron = 2; + public const int Slime = 3; + public const int Turtle = 4; + public const int Bee = 5; + public const int Minecart = 6; + public const int UFO = 7; + public const int Drill = 8; + public const int Scutlix = 9; + public const int Unicorn = 10; + public const int MinecartMech = 11; + public const int CuteFishron = 12; + public const int MinecartWood = 13; + public const int Basilisk = 14; + public const int maxMounts = 15; public const int FrameStanding = 0; public const int FrameRunning = 1; public const int FrameInAir = 2; @@ -45,7 +58,6 @@ namespace Terraria public static int drillPickTime = 6; public static int drillBeamCooldownMax = 1; public const float maxDrillLength = 48f; - private static Vector2 santankTextureSize; private Mount.MountData _data; private int _type; private bool _flipDraw; @@ -68,11 +80,6 @@ namespace Terraria public List _debugDraw; private object _mountSpecificData; private bool _active; - private Mount.MountDelegatesData _defaultDelegatesData = new Mount.MountDelegatesData(); - - private static void MeowcartLandingSound(Vector2 Position, int Width, int Height) => SoundEngine.PlaySound(37, (int) Position.X + Width / 2, (int) Position.Y + Height / 2, 5); - - private static void MeowcartBumperSound(Vector2 Position, int Width, int Height) => SoundEngine.PlaySound(37, (int) Position.X + Width / 2, (int) Position.Y + Height / 2, 3); public Mount() { @@ -101,7 +108,7 @@ namespace Terraria public static void Initialize() { - Mount.mounts = new Mount.MountData[MountID.Count]; + Mount.mounts = new Mount.MountData[15]; Mount.MountData mountData1 = new Mount.MountData(); Mount.mounts[0] = mountData1; mountData1.spawnDust = 57; @@ -146,12 +153,12 @@ namespace Terraria mountData1.swimFrameStart = mountData1.inAirFrameStart; if (Main.netMode != 2) { - mountData1.backTexture = TextureAssets.RudolphMount[0]; - mountData1.backTextureExtra = (Asset) Asset.Empty; - mountData1.frontTexture = TextureAssets.RudolphMount[1]; - mountData1.frontTextureExtra = TextureAssets.RudolphMount[2]; - mountData1.textureWidth = mountData1.backTexture.Width(); - mountData1.textureHeight = mountData1.backTexture.Height(); + mountData1.backTexture = Main.rudolphMountTexture[0]; + mountData1.backTextureExtra = (Texture2D) null; + mountData1.frontTexture = Main.rudolphMountTexture[1]; + mountData1.frontTextureExtra = Main.rudolphMountTexture[2]; + mountData1.textureWidth = mountData1.backTexture.Width; + mountData1.textureHeight = mountData1.backTexture.Height; } Mount.MountData mountData2 = new Mount.MountData(); Mount.mounts[2] = mountData2; @@ -197,12 +204,12 @@ namespace Terraria mountData2.swimFrameStart = mountData2.inAirFrameStart; if (Main.netMode != 2) { - mountData2.backTexture = TextureAssets.PigronMount; - mountData2.backTextureExtra = (Asset) Asset.Empty; - mountData2.frontTexture = (Asset) Asset.Empty; - mountData2.frontTextureExtra = (Asset) Asset.Empty; - mountData2.textureWidth = mountData2.backTexture.Width(); - mountData2.textureHeight = mountData2.backTexture.Height(); + mountData2.backTexture = Main.pigronMountTexture; + mountData2.backTextureExtra = (Texture2D) null; + mountData2.frontTexture = (Texture2D) null; + mountData2.frontTextureExtra = (Texture2D) null; + mountData2.textureWidth = mountData2.backTexture.Width; + mountData2.textureHeight = mountData2.backTexture.Height; } Mount.MountData mountData3 = new Mount.MountData(); Mount.mounts[1] = mountData3; @@ -212,7 +219,7 @@ namespace Terraria mountData3.flightTimeMax = 0; mountData3.fallDamage = 0.8f; mountData3.runSpeed = 4f; - mountData3.dashSpeed = 7.8f; + mountData3.dashSpeed = 7.5f; mountData3.acceleration = 0.13f; mountData3.jumpHeight = 15; mountData3.jumpSpeed = 5.01f; @@ -250,12 +257,12 @@ namespace Terraria mountData3.swimFrameStart = mountData3.inAirFrameStart; if (Main.netMode != 2) { - mountData3.backTexture = TextureAssets.BunnyMount; - mountData3.backTextureExtra = (Asset) Asset.Empty; - mountData3.frontTexture = (Asset) Asset.Empty; - mountData3.frontTextureExtra = (Asset) Asset.Empty; - mountData3.textureWidth = mountData3.backTexture.Width(); - mountData3.textureHeight = mountData3.backTexture.Height(); + mountData3.backTexture = Main.bunnyMountTexture; + mountData3.backTextureExtra = (Texture2D) null; + mountData3.frontTexture = (Texture2D) null; + mountData3.frontTextureExtra = (Texture2D) null; + mountData3.textureWidth = mountData3.backTexture.Width; + mountData3.textureHeight = mountData3.backTexture.Height; } Mount.MountData mountData4 = new Mount.MountData(); Mount.mounts[3] = mountData4; @@ -279,7 +286,7 @@ namespace Terraria mountData4.playerYOffsets = numArray4; mountData4.xOffset = 1; mountData4.bodyFrame = 3; - mountData4.yOffset = 11; + mountData4.yOffset = 10; mountData4.playerHeadOffset = 22; mountData4.standingFrameCount = 1; mountData4.standingFrameDelay = 12; @@ -299,19 +306,18 @@ namespace Terraria mountData4.idleFrameLoop = false; if (Main.netMode != 2) { - mountData4.backTexture = TextureAssets.SlimeMount; - mountData4.backTextureExtra = (Asset) Asset.Empty; - mountData4.frontTexture = (Asset) Asset.Empty; - mountData4.frontTextureExtra = (Asset) Asset.Empty; - mountData4.textureWidth = mountData4.backTexture.Width(); - mountData4.textureHeight = mountData4.backTexture.Height(); + mountData4.backTexture = Main.slimeMountTexture; + mountData4.backTextureExtra = (Texture2D) null; + mountData4.frontTexture = (Texture2D) null; + mountData4.frontTextureExtra = (Texture2D) null; + mountData4.textureWidth = mountData4.backTexture.Width; + mountData4.textureHeight = mountData4.backTexture.Height; } Mount.MountData mountData5 = new Mount.MountData(); Mount.mounts[6] = mountData5; mountData5.Minecart = true; mountData5.MinecartDirectional = true; - mountData5.delegations = new Mount.MountDelegatesData(); - mountData5.delegations.MinecartDust = new Action(DelegateMethods.Minecart.Sparks); + mountData5.MinecartDust = new Action(DelegateMethods.Minecart.Sparks); mountData5.spawnDust = 213; mountData5.buff = 118; mountData5.extraBuff = 138; @@ -351,410 +357,284 @@ namespace Terraria mountData5.idleFrameLoop = false; if (Main.netMode != 2) { - mountData5.backTexture = (Asset) Asset.Empty; - mountData5.backTextureExtra = (Asset) Asset.Empty; - mountData5.frontTexture = TextureAssets.MinecartMount; - mountData5.frontTextureExtra = (Asset) Asset.Empty; - mountData5.textureWidth = mountData5.frontTexture.Width(); - mountData5.textureHeight = mountData5.frontTexture.Height(); + mountData5.backTexture = (Texture2D) null; + mountData5.backTextureExtra = (Texture2D) null; + mountData5.frontTexture = Main.minecartMountTexture; + mountData5.frontTextureExtra = (Texture2D) null; + mountData5.textureWidth = mountData5.frontTexture.Width; + mountData5.textureHeight = mountData5.frontTexture.Height; } - Mount.MountData newMount1 = new Mount.MountData(); - Mount.mounts[15] = newMount1; - Mount.SetAsMinecart(newMount1, 209, 208, TextureAssets.DesertMinecartMount); - Mount.MountData newMount2 = new Mount.MountData(); - Mount.mounts[18] = newMount2; - Mount.SetAsMinecart(newMount2, 221, 220, TextureAssets.Extra[108]); - Mount.MountData newMount3 = new Mount.MountData(); - Mount.mounts[19] = newMount3; - Mount.SetAsMinecart(newMount3, 223, 222, TextureAssets.Extra[109]); - Mount.MountData newMount4 = new Mount.MountData(); - Mount.mounts[20] = newMount4; - Mount.SetAsMinecart(newMount4, 225, 224, TextureAssets.Extra[110]); - Mount.MountData newMount5 = new Mount.MountData(); - Mount.mounts[21] = newMount5; - Mount.SetAsMinecart(newMount5, 227, 226, TextureAssets.Extra[111]); - Mount.MountData newMount6 = new Mount.MountData(); - Mount.mounts[22] = newMount6; - Mount.SetAsMinecart(newMount6, 229, 228, TextureAssets.Extra[112]); - Mount.MountData newMount7 = new Mount.MountData(); - Mount.mounts[24] = newMount7; - Mount.SetAsMinecart(newMount7, 232, 231, TextureAssets.Extra[115]); - newMount7.frontTextureGlow = TextureAssets.Extra[116]; - Mount.MountData newMount8 = new Mount.MountData(); - Mount.mounts[25] = newMount8; - Mount.SetAsMinecart(newMount8, 234, 233, TextureAssets.Extra[117]); - Mount.MountData newMount9 = new Mount.MountData(); - Mount.mounts[26] = newMount9; - Mount.SetAsMinecart(newMount9, 236, 235, TextureAssets.Extra[118]); - Mount.MountData newMount10 = new Mount.MountData(); - Mount.mounts[27] = newMount10; - Mount.SetAsMinecart(newMount10, 238, 237, TextureAssets.Extra[119]); - Mount.MountData newMount11 = new Mount.MountData(); - Mount.mounts[28] = newMount11; - Mount.SetAsMinecart(newMount11, 240, 239, TextureAssets.Extra[120]); - Mount.MountData newMount12 = new Mount.MountData(); - Mount.mounts[29] = newMount12; - Mount.SetAsMinecart(newMount12, 242, 241, TextureAssets.Extra[121]); - Mount.MountData newMount13 = new Mount.MountData(); - Mount.mounts[30] = newMount13; - Mount.SetAsMinecart(newMount13, 244, 243, TextureAssets.Extra[122]); - Mount.MountData newMount14 = new Mount.MountData(); - Mount.mounts[31] = newMount14; - Mount.SetAsMinecart(newMount14, 246, 245, TextureAssets.Extra[123]); - Mount.MountData newMount15 = new Mount.MountData(); - Mount.mounts[32] = newMount15; - Mount.SetAsMinecart(newMount15, 248, 247, TextureAssets.Extra[124]); - Mount.MountData newMount16 = new Mount.MountData(); - Mount.mounts[33] = newMount16; - Mount.SetAsMinecart(newMount16, 250, 249, TextureAssets.Extra[125]); - newMount16.delegations.MinecartDust = new Action(DelegateMethods.Minecart.SparksMeow); - newMount16.delegations.MinecartLandingSound = new Action(Mount.MeowcartLandingSound); - newMount16.delegations.MinecartBumperSound = new Action(Mount.MeowcartBumperSound); - Mount.MountData newMount17 = new Mount.MountData(); - Mount.mounts[34] = newMount17; - Mount.SetAsMinecart(newMount17, 252, 251, TextureAssets.Extra[126]); - Mount.MountData newMount18 = new Mount.MountData(); - Mount.mounts[35] = newMount18; - Mount.SetAsMinecart(newMount18, 254, 253, TextureAssets.Extra[(int) sbyte.MaxValue]); - Mount.MountData newMount19 = new Mount.MountData(); - Mount.mounts[36] = newMount19; - Mount.SetAsMinecart(newMount19, 256, (int) byte.MaxValue, TextureAssets.Extra[128]); - Mount.MountData newMount20 = new Mount.MountData(); - Mount.mounts[38] = newMount20; - Mount.SetAsMinecart(newMount20, 270, 269, TextureAssets.Extra[150]); - if (Main.netMode != 2) - newMount20.backTexture = newMount20.frontTexture; - Mount.MountData newMount21 = new Mount.MountData(); - Mount.mounts[39] = newMount21; - Mount.SetAsMinecart(newMount21, 273, 272, TextureAssets.Extra[155]); - newMount21.yOffset -= 2; - if (Main.netMode != 2) - newMount21.frontTextureExtra = TextureAssets.Extra[165]; - newMount21.runSpeed = 6f; - newMount21.dashSpeed = 6f; - newMount21.acceleration = 0.02f; Mount.MountData mountData6 = new Mount.MountData(); - Mount.mounts[16] = mountData6; - mountData6.Minecart = true; - mountData6.delegations = new Mount.MountDelegatesData(); - mountData6.delegations.MinecartDust = new Action(DelegateMethods.Minecart.Sparks); - mountData6.spawnDust = 213; - mountData6.buff = 211; - mountData6.extraBuff = 210; - mountData6.heightBoost = 10; + Mount.mounts[4] = mountData6; + mountData6.spawnDust = 56; + mountData6.buff = 131; + mountData6.heightBoost = 26; mountData6.flightTimeMax = 0; mountData6.fallDamage = 1f; - mountData6.runSpeed = 13f; - mountData6.dashSpeed = 13f; - mountData6.acceleration = 0.04f; - mountData6.jumpHeight = 15; - mountData6.jumpSpeed = 5.15f; - mountData6.blockExtraJumps = true; - mountData6.totalFrames = 3; + mountData6.runSpeed = 2f; + mountData6.dashSpeed = 2f; + mountData6.swimSpeed = 6f; + mountData6.acceleration = 0.08f; + mountData6.jumpHeight = 10; + mountData6.jumpSpeed = 3.15f; + mountData6.totalFrames = 12; int[] numArray6 = new int[mountData6.totalFrames]; for (int index = 0; index < numArray6.Length; ++index) - numArray6[index] = 8; + numArray6[index] = 26; mountData6.playerYOffsets = numArray6; mountData6.xOffset = 1; mountData6.bodyFrame = 3; mountData6.yOffset = 13; - mountData6.playerHeadOffset = 14; + mountData6.playerHeadOffset = 30; mountData6.standingFrameCount = 1; mountData6.standingFrameDelay = 12; mountData6.standingFrameStart = 0; - mountData6.runningFrameCount = 3; + mountData6.runningFrameCount = 6; mountData6.runningFrameDelay = 12; mountData6.runningFrameStart = 0; mountData6.flyingFrameCount = 0; mountData6.flyingFrameDelay = 0; mountData6.flyingFrameStart = 0; - mountData6.inAirFrameCount = 0; - mountData6.inAirFrameDelay = 0; - mountData6.inAirFrameStart = 0; + mountData6.inAirFrameCount = 1; + mountData6.inAirFrameDelay = 12; + mountData6.inAirFrameStart = 3; mountData6.idleFrameCount = 0; mountData6.idleFrameDelay = 0; mountData6.idleFrameStart = 0; mountData6.idleFrameLoop = false; + mountData6.swimFrameCount = 6; + mountData6.swimFrameDelay = 12; + mountData6.swimFrameStart = 6; if (Main.netMode != 2) { - mountData6.backTexture = (Asset) Asset.Empty; - mountData6.backTextureExtra = (Asset) Asset.Empty; - mountData6.frontTexture = TextureAssets.FishMinecartMount; - mountData6.frontTextureExtra = (Asset) Asset.Empty; - mountData6.textureWidth = mountData6.frontTexture.Width(); - mountData6.textureHeight = mountData6.frontTexture.Height(); + mountData6.backTexture = Main.turtleMountTexture; + mountData6.backTextureExtra = (Texture2D) null; + mountData6.frontTexture = (Texture2D) null; + mountData6.frontTextureExtra = (Texture2D) null; + mountData6.textureWidth = mountData6.backTexture.Width; + mountData6.textureHeight = mountData6.backTexture.Height; } Mount.MountData mountData7 = new Mount.MountData(); - Mount.mounts[4] = mountData7; - mountData7.spawnDust = 56; - mountData7.buff = 131; - mountData7.heightBoost = 26; - mountData7.flightTimeMax = 0; - mountData7.fallDamage = 1f; + Mount.mounts[5] = mountData7; + mountData7.spawnDust = 152; + mountData7.buff = 132; + mountData7.heightBoost = 16; + mountData7.flightTimeMax = 320; + mountData7.fatigueMax = 320; + mountData7.fallDamage = 0.0f; + mountData7.usesHover = true; mountData7.runSpeed = 2f; mountData7.dashSpeed = 2f; - mountData7.swimSpeed = 6f; - mountData7.acceleration = 0.08f; + mountData7.acceleration = 0.16f; mountData7.jumpHeight = 10; - mountData7.jumpSpeed = 3.15f; + mountData7.jumpSpeed = 4f; + mountData7.blockExtraJumps = true; mountData7.totalFrames = 12; int[] numArray7 = new int[mountData7.totalFrames]; for (int index = 0; index < numArray7.Length; ++index) - numArray7[index] = 26; + numArray7[index] = 16; + numArray7[8] = 18; mountData7.playerYOffsets = numArray7; mountData7.xOffset = 1; mountData7.bodyFrame = 3; - mountData7.yOffset = 13; - mountData7.playerHeadOffset = 28; + mountData7.yOffset = 4; + mountData7.playerHeadOffset = 18; mountData7.standingFrameCount = 1; mountData7.standingFrameDelay = 12; mountData7.standingFrameStart = 0; - mountData7.runningFrameCount = 6; + mountData7.runningFrameCount = 5; mountData7.runningFrameDelay = 12; mountData7.runningFrameStart = 0; - mountData7.flyingFrameCount = 0; - mountData7.flyingFrameDelay = 0; - mountData7.flyingFrameStart = 0; - mountData7.inAirFrameCount = 1; + mountData7.flyingFrameCount = 3; + mountData7.flyingFrameDelay = 12; + mountData7.flyingFrameStart = 5; + mountData7.inAirFrameCount = 3; mountData7.inAirFrameDelay = 12; - mountData7.inAirFrameStart = 3; - mountData7.idleFrameCount = 0; - mountData7.idleFrameDelay = 0; - mountData7.idleFrameStart = 0; - mountData7.idleFrameLoop = false; - mountData7.swimFrameCount = 6; + mountData7.inAirFrameStart = 5; + mountData7.idleFrameCount = 4; + mountData7.idleFrameDelay = 12; + mountData7.idleFrameStart = 8; + mountData7.idleFrameLoop = true; + mountData7.swimFrameCount = 0; mountData7.swimFrameDelay = 12; - mountData7.swimFrameStart = 6; + mountData7.swimFrameStart = 0; if (Main.netMode != 2) { - mountData7.backTexture = TextureAssets.TurtleMount; - mountData7.backTextureExtra = (Asset) Asset.Empty; - mountData7.frontTexture = (Asset) Asset.Empty; - mountData7.frontTextureExtra = (Asset) Asset.Empty; - mountData7.textureWidth = mountData7.backTexture.Width(); - mountData7.textureHeight = mountData7.backTexture.Height(); + mountData7.backTexture = Main.beeMountTexture[0]; + mountData7.backTextureExtra = Main.beeMountTexture[1]; + mountData7.frontTexture = (Texture2D) null; + mountData7.frontTextureExtra = (Texture2D) null; + mountData7.textureWidth = mountData7.backTexture.Width; + mountData7.textureHeight = mountData7.backTexture.Height; } Mount.MountData mountData8 = new Mount.MountData(); - Mount.mounts[5] = mountData8; - mountData8.spawnDust = 152; - mountData8.buff = 132; + Mount.mounts[7] = mountData8; + mountData8.spawnDust = 226; + mountData8.spawnDustNoGravity = true; + mountData8.buff = 141; mountData8.heightBoost = 16; mountData8.flightTimeMax = 320; mountData8.fatigueMax = 320; mountData8.fallDamage = 0.0f; mountData8.usesHover = true; - mountData8.runSpeed = 2f; - mountData8.dashSpeed = 2f; + mountData8.runSpeed = 8f; + mountData8.dashSpeed = 8f; mountData8.acceleration = 0.16f; mountData8.jumpHeight = 10; mountData8.jumpSpeed = 4f; mountData8.blockExtraJumps = true; - mountData8.totalFrames = 12; + mountData8.totalFrames = 8; int[] numArray8 = new int[mountData8.totalFrames]; for (int index = 0; index < numArray8.Length; ++index) numArray8[index] = 16; - numArray8[8] = 18; mountData8.playerYOffsets = numArray8; mountData8.xOffset = 1; mountData8.bodyFrame = 3; mountData8.yOffset = 4; mountData8.playerHeadOffset = 18; - mountData8.standingFrameCount = 1; - mountData8.standingFrameDelay = 12; + mountData8.standingFrameCount = 8; + mountData8.standingFrameDelay = 4; mountData8.standingFrameStart = 0; - mountData8.runningFrameCount = 5; - mountData8.runningFrameDelay = 12; + mountData8.runningFrameCount = 8; + mountData8.runningFrameDelay = 4; mountData8.runningFrameStart = 0; - mountData8.flyingFrameCount = 3; - mountData8.flyingFrameDelay = 12; - mountData8.flyingFrameStart = 5; - mountData8.inAirFrameCount = 3; - mountData8.inAirFrameDelay = 12; - mountData8.inAirFrameStart = 5; - mountData8.idleFrameCount = 4; + mountData8.flyingFrameCount = 8; + mountData8.flyingFrameDelay = 4; + mountData8.flyingFrameStart = 0; + mountData8.inAirFrameCount = 8; + mountData8.inAirFrameDelay = 4; + mountData8.inAirFrameStart = 0; + mountData8.idleFrameCount = 0; mountData8.idleFrameDelay = 12; - mountData8.idleFrameStart = 8; + mountData8.idleFrameStart = 0; mountData8.idleFrameLoop = true; mountData8.swimFrameCount = 0; mountData8.swimFrameDelay = 12; mountData8.swimFrameStart = 0; if (Main.netMode != 2) { - mountData8.backTexture = TextureAssets.BeeMount[0]; - mountData8.backTextureExtra = TextureAssets.BeeMount[1]; - mountData8.frontTexture = (Asset) Asset.Empty; - mountData8.frontTextureExtra = (Asset) Asset.Empty; - mountData8.textureWidth = mountData8.backTexture.Width(); - mountData8.textureHeight = mountData8.backTexture.Height(); + mountData8.backTexture = (Texture2D) null; + mountData8.backTextureExtra = (Texture2D) null; + mountData8.frontTexture = Main.UFOMountTexture[0]; + mountData8.frontTextureExtra = Main.UFOMountTexture[1]; + mountData8.textureWidth = mountData8.frontTexture.Width; + mountData8.textureHeight = mountData8.frontTexture.Height; } Mount.MountData mountData9 = new Mount.MountData(); - Mount.mounts[7] = mountData9; + Mount.mounts[8] = mountData9; mountData9.spawnDust = 226; - mountData9.spawnDustNoGravity = true; - mountData9.buff = 141; + mountData9.buff = 142; mountData9.heightBoost = 16; mountData9.flightTimeMax = 320; mountData9.fatigueMax = 320; - mountData9.fallDamage = 0.0f; + mountData9.fallDamage = 1f; mountData9.usesHover = true; - mountData9.runSpeed = 8f; - mountData9.dashSpeed = 8f; + mountData9.swimSpeed = 4f; + mountData9.runSpeed = 6f; + mountData9.dashSpeed = 4f; mountData9.acceleration = 0.16f; mountData9.jumpHeight = 10; mountData9.jumpSpeed = 4f; mountData9.blockExtraJumps = true; - mountData9.totalFrames = 8; + mountData9.emitsLight = true; + mountData9.lightColor = new Vector3(0.3f, 0.3f, 0.4f); + mountData9.totalFrames = 1; int[] numArray9 = new int[mountData9.totalFrames]; for (int index = 0; index < numArray9.Length; ++index) - numArray9[index] = 16; + numArray9[index] = 4; mountData9.playerYOffsets = numArray9; mountData9.xOffset = 1; mountData9.bodyFrame = 3; mountData9.yOffset = 4; mountData9.playerHeadOffset = 18; - mountData9.standingFrameCount = 8; - mountData9.standingFrameDelay = 4; + mountData9.standingFrameCount = 1; + mountData9.standingFrameDelay = 12; mountData9.standingFrameStart = 0; - mountData9.runningFrameCount = 8; - mountData9.runningFrameDelay = 4; + mountData9.runningFrameCount = 1; + mountData9.runningFrameDelay = 12; mountData9.runningFrameStart = 0; - mountData9.flyingFrameCount = 8; - mountData9.flyingFrameDelay = 4; + mountData9.flyingFrameCount = 1; + mountData9.flyingFrameDelay = 12; mountData9.flyingFrameStart = 0; - mountData9.inAirFrameCount = 8; - mountData9.inAirFrameDelay = 4; + mountData9.inAirFrameCount = 1; + mountData9.inAirFrameDelay = 12; mountData9.inAirFrameStart = 0; mountData9.idleFrameCount = 0; mountData9.idleFrameDelay = 12; - mountData9.idleFrameStart = 0; - mountData9.idleFrameLoop = true; + mountData9.idleFrameStart = 8; mountData9.swimFrameCount = 0; mountData9.swimFrameDelay = 12; mountData9.swimFrameStart = 0; if (Main.netMode != 2) { - mountData9.backTexture = (Asset) Asset.Empty; - mountData9.backTextureExtra = (Asset) Asset.Empty; - mountData9.frontTexture = TextureAssets.UfoMount[0]; - mountData9.frontTextureExtra = TextureAssets.UfoMount[1]; - mountData9.textureWidth = mountData9.frontTexture.Width(); - mountData9.textureHeight = mountData9.frontTexture.Height(); + mountData9.backTexture = Main.drillMountTexture[0]; + mountData9.backTextureGlow = Main.drillMountTexture[3]; + mountData9.backTextureExtra = (Texture2D) null; + mountData9.backTextureExtraGlow = (Texture2D) null; + mountData9.frontTexture = Main.drillMountTexture[1]; + mountData9.frontTextureGlow = Main.drillMountTexture[4]; + mountData9.frontTextureExtra = Main.drillMountTexture[2]; + mountData9.frontTextureExtraGlow = Main.drillMountTexture[5]; + mountData9.textureWidth = mountData9.frontTexture.Width; + mountData9.textureHeight = mountData9.frontTexture.Height; } + Mount.drillTextureSize = new Vector2(80f, 80f); + Vector2 vector2_1 = new Vector2((float) mountData9.textureWidth, (float) (mountData9.textureHeight / mountData9.totalFrames)); + if (Mount.drillTextureSize != vector2_1) + throw new Exception("Be sure to update the Drill texture origin to match the actual texture size of " + (object) mountData9.textureWidth + ", " + (object) mountData9.textureHeight + "."); Mount.MountData mountData10 = new Mount.MountData(); - Mount.mounts[8] = mountData10; - mountData10.spawnDust = 226; - mountData10.buff = 142; + Mount.mounts[9] = mountData10; + mountData10.spawnDust = 152; + mountData10.buff = 143; mountData10.heightBoost = 16; - mountData10.flightTimeMax = 320; - mountData10.fatigueMax = 320; - mountData10.fallDamage = 1f; - mountData10.usesHover = true; - mountData10.swimSpeed = 4f; - mountData10.runSpeed = 6f; - mountData10.dashSpeed = 4f; - mountData10.acceleration = 0.16f; - mountData10.jumpHeight = 10; - mountData10.jumpSpeed = 4f; - mountData10.blockExtraJumps = true; - mountData10.emitsLight = true; - mountData10.lightColor = new Vector3(0.3f, 0.3f, 0.4f); - mountData10.totalFrames = 1; + mountData10.flightTimeMax = 0; + mountData10.fatigueMax = 0; + mountData10.fallDamage = 0.0f; + mountData10.abilityChargeMax = 40; + mountData10.abilityCooldown = 20; + mountData10.abilityDuration = 0; + mountData10.runSpeed = 8f; + mountData10.dashSpeed = 8f; + mountData10.acceleration = 0.4f; + mountData10.jumpHeight = 22; + mountData10.jumpSpeed = 10.01f; + mountData10.blockExtraJumps = false; + mountData10.totalFrames = 12; int[] numArray10 = new int[mountData10.totalFrames]; for (int index = 0; index < numArray10.Length; ++index) - numArray10[index] = 4; + numArray10[index] = 16; mountData10.playerYOffsets = numArray10; mountData10.xOffset = 1; mountData10.bodyFrame = 3; - mountData10.yOffset = 4; + mountData10.yOffset = 6; mountData10.playerHeadOffset = 18; - mountData10.standingFrameCount = 1; + mountData10.standingFrameCount = 6; mountData10.standingFrameDelay = 12; - mountData10.standingFrameStart = 0; - mountData10.runningFrameCount = 1; + mountData10.standingFrameStart = 6; + mountData10.runningFrameCount = 6; mountData10.runningFrameDelay = 12; mountData10.runningFrameStart = 0; - mountData10.flyingFrameCount = 1; + mountData10.flyingFrameCount = 0; mountData10.flyingFrameDelay = 12; mountData10.flyingFrameStart = 0; mountData10.inAirFrameCount = 1; mountData10.inAirFrameDelay = 12; - mountData10.inAirFrameStart = 0; + mountData10.inAirFrameStart = 1; mountData10.idleFrameCount = 0; mountData10.idleFrameDelay = 12; - mountData10.idleFrameStart = 8; + mountData10.idleFrameStart = 6; + mountData10.idleFrameLoop = true; mountData10.swimFrameCount = 0; mountData10.swimFrameDelay = 12; mountData10.swimFrameStart = 0; if (Main.netMode != 2) { - mountData10.backTexture = TextureAssets.DrillMount[0]; - mountData10.backTextureGlow = TextureAssets.DrillMount[3]; - mountData10.backTextureExtra = (Asset) Asset.Empty; - mountData10.backTextureExtraGlow = (Asset) Asset.Empty; - mountData10.frontTexture = TextureAssets.DrillMount[1]; - mountData10.frontTextureGlow = TextureAssets.DrillMount[4]; - mountData10.frontTextureExtra = TextureAssets.DrillMount[2]; - mountData10.frontTextureExtraGlow = TextureAssets.DrillMount[5]; - mountData10.textureWidth = mountData10.frontTexture.Width(); - mountData10.textureHeight = mountData10.frontTexture.Height(); - } - Mount.drillTextureSize = new Vector2(80f, 80f); - Vector2 vector2_1 = new Vector2((float) mountData10.textureWidth, (float) (mountData10.textureHeight / mountData10.totalFrames)); - if (Mount.drillTextureSize != vector2_1) - throw new Exception("Be sure to update the Drill texture origin to match the actual texture size of " + (object) mountData10.textureWidth + ", " + (object) mountData10.textureHeight + "."); - Mount.MountData mountData11 = new Mount.MountData(); - Mount.mounts[9] = mountData11; - mountData11.spawnDust = 15; - mountData11.buff = 143; - mountData11.heightBoost = 16; - mountData11.flightTimeMax = 0; - mountData11.fatigueMax = 0; - mountData11.fallDamage = 0.0f; - mountData11.abilityChargeMax = 40; - mountData11.abilityCooldown = 20; - mountData11.abilityDuration = 0; - mountData11.runSpeed = 8f; - mountData11.dashSpeed = 8f; - mountData11.acceleration = 0.4f; - mountData11.jumpHeight = 22; - mountData11.jumpSpeed = 10.01f; - mountData11.blockExtraJumps = false; - mountData11.totalFrames = 12; - int[] numArray11 = new int[mountData11.totalFrames]; - for (int index = 0; index < numArray11.Length; ++index) - numArray11[index] = 16; - mountData11.playerYOffsets = numArray11; - mountData11.xOffset = 1; - mountData11.bodyFrame = 3; - mountData11.yOffset = 6; - mountData11.playerHeadOffset = 18; - mountData11.standingFrameCount = 6; - mountData11.standingFrameDelay = 12; - mountData11.standingFrameStart = 6; - mountData11.runningFrameCount = 6; - mountData11.runningFrameDelay = 12; - mountData11.runningFrameStart = 0; - mountData11.flyingFrameCount = 0; - mountData11.flyingFrameDelay = 12; - mountData11.flyingFrameStart = 0; - mountData11.inAirFrameCount = 1; - mountData11.inAirFrameDelay = 12; - mountData11.inAirFrameStart = 1; - mountData11.idleFrameCount = 0; - mountData11.idleFrameDelay = 12; - mountData11.idleFrameStart = 6; - mountData11.idleFrameLoop = true; - mountData11.swimFrameCount = 0; - mountData11.swimFrameDelay = 12; - mountData11.swimFrameStart = 0; - if (Main.netMode != 2) - { - mountData11.backTexture = TextureAssets.ScutlixMount[0]; - mountData11.backTextureExtra = (Asset) Asset.Empty; - mountData11.frontTexture = TextureAssets.ScutlixMount[1]; - mountData11.frontTextureExtra = TextureAssets.ScutlixMount[2]; - mountData11.textureWidth = mountData11.backTexture.Width(); - mountData11.textureHeight = mountData11.backTexture.Height(); + mountData10.backTexture = Main.scutlixMountTexture[0]; + mountData10.backTextureExtra = (Texture2D) null; + mountData10.frontTexture = Main.scutlixMountTexture[1]; + mountData10.frontTextureExtra = Main.scutlixMountTexture[2]; + mountData10.textureWidth = mountData10.backTexture.Width; + mountData10.textureHeight = mountData10.backTexture.Height; } Mount.scutlixEyePositions = new Vector2[10]; Mount.scutlixEyePositions[0] = new Vector2(60f, 2f); @@ -768,919 +648,272 @@ namespace Terraria Mount.scutlixEyePositions[8] = new Vector2(70f, 34f); Mount.scutlixEyePositions[9] = new Vector2(76f, 34f); Mount.scutlixTextureSize = new Vector2(45f, 54f); - Vector2 vector2_2 = new Vector2((float) (mountData11.textureWidth / 2), (float) (mountData11.textureHeight / mountData11.totalFrames)); + Vector2 vector2_2 = new Vector2((float) (mountData10.textureWidth / 2), (float) (mountData10.textureHeight / mountData10.totalFrames)); if (Mount.scutlixTextureSize != vector2_2) - throw new Exception("Be sure to update the Scutlix texture origin to match the actual texture size of " + (object) mountData11.textureWidth + ", " + (object) mountData11.textureHeight + "."); + throw new Exception("Be sure to update the Scutlix texture origin to match the actual texture size of " + (object) mountData10.textureWidth + ", " + (object) mountData10.textureHeight + "."); for (int index = 0; index < Mount.scutlixEyePositions.Length; ++index) Mount.scutlixEyePositions[index] -= Mount.scutlixTextureSize; + Mount.MountData mountData11 = new Mount.MountData(); + Mount.mounts[10] = mountData11; + mountData11.spawnDust = 15; + mountData11.buff = 162; + mountData11.heightBoost = 34; + mountData11.flightTimeMax = 0; + mountData11.fallDamage = 0.2f; + mountData11.runSpeed = 4f; + mountData11.dashSpeed = 12f; + mountData11.acceleration = 0.3f; + mountData11.jumpHeight = 10; + mountData11.jumpSpeed = 8.01f; + mountData11.totalFrames = 16; + int[] numArray11 = new int[mountData11.totalFrames]; + for (int index = 0; index < numArray11.Length; ++index) + numArray11[index] = 28; + numArray11[3] += 2; + numArray11[4] += 2; + numArray11[7] += 2; + numArray11[8] += 2; + numArray11[12] += 2; + numArray11[13] += 2; + numArray11[15] += 4; + mountData11.playerYOffsets = numArray11; + mountData11.xOffset = 5; + mountData11.bodyFrame = 3; + mountData11.yOffset = 1; + mountData11.playerHeadOffset = 31; + mountData11.standingFrameCount = 1; + mountData11.standingFrameDelay = 12; + mountData11.standingFrameStart = 0; + mountData11.runningFrameCount = 7; + mountData11.runningFrameDelay = 15; + mountData11.runningFrameStart = 1; + mountData11.dashingFrameCount = 6; + mountData11.dashingFrameDelay = 40; + mountData11.dashingFrameStart = 9; + mountData11.flyingFrameCount = 6; + mountData11.flyingFrameDelay = 6; + mountData11.flyingFrameStart = 1; + mountData11.inAirFrameCount = 1; + mountData11.inAirFrameDelay = 12; + mountData11.inAirFrameStart = 15; + mountData11.idleFrameCount = 0; + mountData11.idleFrameDelay = 0; + mountData11.idleFrameStart = 0; + mountData11.idleFrameLoop = false; + mountData11.swimFrameCount = mountData11.inAirFrameCount; + mountData11.swimFrameDelay = mountData11.inAirFrameDelay; + mountData11.swimFrameStart = mountData11.inAirFrameStart; + if (Main.netMode != 2) + { + mountData11.backTexture = Main.unicornMountTexture; + mountData11.backTextureExtra = (Texture2D) null; + mountData11.frontTexture = (Texture2D) null; + mountData11.frontTextureExtra = (Texture2D) null; + mountData11.textureWidth = mountData11.backTexture.Width; + mountData11.textureHeight = mountData11.backTexture.Height; + } Mount.MountData mountData12 = new Mount.MountData(); - Mount.mounts[10] = mountData12; - mountData12.spawnDust = 15; - mountData12.buff = 162; - mountData12.heightBoost = 34; + Mount.mounts[11] = mountData12; + mountData12.Minecart = true; + mountData12.MinecartDust = new Action(DelegateMethods.Minecart.SparksMech); + mountData12.spawnDust = 213; + mountData12.buff = 167; + mountData12.extraBuff = 166; + mountData12.heightBoost = 12; mountData12.flightTimeMax = 0; - mountData12.fallDamage = 0.2f; - mountData12.runSpeed = 4f; - mountData12.dashSpeed = 12f; - mountData12.acceleration = 0.3f; - mountData12.jumpHeight = 10; - mountData12.jumpSpeed = 8.01f; - mountData12.totalFrames = 16; + mountData12.fallDamage = 1f; + mountData12.runSpeed = 20f; + mountData12.dashSpeed = 20f; + mountData12.acceleration = 0.1f; + mountData12.jumpHeight = 15; + mountData12.jumpSpeed = 5.15f; + mountData12.blockExtraJumps = true; + mountData12.totalFrames = 3; int[] numArray12 = new int[mountData12.totalFrames]; for (int index = 0; index < numArray12.Length; ++index) - numArray12[index] = 28; - numArray12[3] += 2; - numArray12[4] += 2; - numArray12[7] += 2; - numArray12[8] += 2; - numArray12[12] += 2; - numArray12[13] += 2; - numArray12[15] += 4; + numArray12[index] = 9; mountData12.playerYOffsets = numArray12; - mountData12.xOffset = 5; + mountData12.xOffset = -1; mountData12.bodyFrame = 3; - mountData12.yOffset = 1; - mountData12.playerHeadOffset = 34; + mountData12.yOffset = 11; + mountData12.playerHeadOffset = 14; mountData12.standingFrameCount = 1; mountData12.standingFrameDelay = 12; mountData12.standingFrameStart = 0; - mountData12.runningFrameCount = 7; - mountData12.runningFrameDelay = 15; - mountData12.runningFrameStart = 1; - mountData12.dashingFrameCount = 6; - mountData12.dashingFrameDelay = 40; - mountData12.dashingFrameStart = 9; - mountData12.flyingFrameCount = 6; - mountData12.flyingFrameDelay = 6; - mountData12.flyingFrameStart = 1; - mountData12.inAirFrameCount = 1; - mountData12.inAirFrameDelay = 12; - mountData12.inAirFrameStart = 15; + mountData12.runningFrameCount = 3; + mountData12.runningFrameDelay = 12; + mountData12.runningFrameStart = 0; + mountData12.flyingFrameCount = 0; + mountData12.flyingFrameDelay = 0; + mountData12.flyingFrameStart = 0; + mountData12.inAirFrameCount = 0; + mountData12.inAirFrameDelay = 0; + mountData12.inAirFrameStart = 0; mountData12.idleFrameCount = 0; mountData12.idleFrameDelay = 0; mountData12.idleFrameStart = 0; mountData12.idleFrameLoop = false; - mountData12.swimFrameCount = mountData12.inAirFrameCount; - mountData12.swimFrameDelay = mountData12.inAirFrameDelay; - mountData12.swimFrameStart = mountData12.inAirFrameStart; if (Main.netMode != 2) { - mountData12.backTexture = TextureAssets.UnicornMount; - mountData12.backTextureExtra = (Asset) Asset.Empty; - mountData12.frontTexture = (Asset) Asset.Empty; - mountData12.frontTextureExtra = (Asset) Asset.Empty; - mountData12.textureWidth = mountData12.backTexture.Width(); - mountData12.textureHeight = mountData12.backTexture.Height(); + mountData12.backTexture = (Texture2D) null; + mountData12.backTextureExtra = (Texture2D) null; + mountData12.frontTexture = Main.minecartMechMountTexture[0]; + mountData12.frontTextureGlow = Main.minecartMechMountTexture[1]; + mountData12.frontTextureExtra = (Texture2D) null; + mountData12.textureWidth = mountData12.frontTexture.Width; + mountData12.textureHeight = mountData12.frontTexture.Height; } Mount.MountData mountData13 = new Mount.MountData(); - Mount.mounts[11] = mountData13; - mountData13.Minecart = true; - mountData13.delegations = new Mount.MountDelegatesData(); - mountData13.delegations.MinecartDust = new Action(DelegateMethods.Minecart.SparksMech); - mountData13.spawnDust = 213; - mountData13.buff = 167; - mountData13.extraBuff = 166; - mountData13.heightBoost = 12; - mountData13.flightTimeMax = 0; - mountData13.fallDamage = 1f; - mountData13.runSpeed = 20f; - mountData13.dashSpeed = 20f; - mountData13.acceleration = 0.1f; - mountData13.jumpHeight = 15; - mountData13.jumpSpeed = 5.15f; + Mount.mounts[12] = mountData13; + mountData13.spawnDust = 15; + mountData13.buff = 168; + mountData13.heightBoost = 14; + mountData13.flightTimeMax = 320; + mountData13.fatigueMax = 320; + mountData13.fallDamage = 0.0f; + mountData13.usesHover = true; + mountData13.runSpeed = 2f; + mountData13.dashSpeed = 1f; + mountData13.acceleration = 0.2f; + mountData13.jumpHeight = 4; + mountData13.jumpSpeed = 3f; + mountData13.swimSpeed = 16f; mountData13.blockExtraJumps = true; - mountData13.totalFrames = 3; + mountData13.totalFrames = 23; int[] numArray13 = new int[mountData13.totalFrames]; for (int index = 0; index < numArray13.Length; ++index) - numArray13[index] = 9; + numArray13[index] = 12; mountData13.playerYOffsets = numArray13; - mountData13.xOffset = -1; + mountData13.xOffset = 2; mountData13.bodyFrame = 3; - mountData13.yOffset = 11; - mountData13.playerHeadOffset = 14; + mountData13.yOffset = 16; + mountData13.playerHeadOffset = 31; mountData13.standingFrameCount = 1; mountData13.standingFrameDelay = 12; - mountData13.standingFrameStart = 0; - mountData13.runningFrameCount = 3; - mountData13.runningFrameDelay = 12; - mountData13.runningFrameStart = 0; - mountData13.flyingFrameCount = 0; - mountData13.flyingFrameDelay = 0; + mountData13.standingFrameStart = 8; + mountData13.runningFrameCount = 7; + mountData13.runningFrameDelay = 14; + mountData13.runningFrameStart = 8; + mountData13.flyingFrameCount = 8; + mountData13.flyingFrameDelay = 16; mountData13.flyingFrameStart = 0; - mountData13.inAirFrameCount = 0; - mountData13.inAirFrameDelay = 0; + mountData13.inAirFrameCount = 8; + mountData13.inAirFrameDelay = 6; mountData13.inAirFrameStart = 0; mountData13.idleFrameCount = 0; mountData13.idleFrameDelay = 0; mountData13.idleFrameStart = 0; mountData13.idleFrameLoop = false; + mountData13.swimFrameCount = 8; + mountData13.swimFrameDelay = 4; + mountData13.swimFrameStart = 15; if (Main.netMode != 2) { - mountData13.backTexture = (Asset) Asset.Empty; - mountData13.backTextureExtra = (Asset) Asset.Empty; - mountData13.frontTexture = TextureAssets.MinecartMechMount[0]; - mountData13.frontTextureGlow = TextureAssets.MinecartMechMount[1]; - mountData13.frontTextureExtra = (Asset) Asset.Empty; - mountData13.textureWidth = mountData13.frontTexture.Width(); - mountData13.textureHeight = mountData13.frontTexture.Height(); + mountData13.backTexture = Main.cuteFishronMountTexture[0]; + mountData13.backTextureGlow = Main.cuteFishronMountTexture[1]; + mountData13.frontTexture = (Texture2D) null; + mountData13.frontTextureExtra = (Texture2D) null; + mountData13.textureWidth = mountData13.backTexture.Width; + mountData13.textureHeight = mountData13.backTexture.Height; } Mount.MountData mountData14 = new Mount.MountData(); - Mount.mounts[12] = mountData14; - mountData14.spawnDust = 15; - mountData14.buff = 168; - mountData14.heightBoost = 14; - mountData14.flightTimeMax = 320; - mountData14.fatigueMax = 320; - mountData14.fallDamage = 0.0f; - mountData14.usesHover = true; - mountData14.runSpeed = 2f; - mountData14.dashSpeed = 1f; - mountData14.acceleration = 0.2f; - mountData14.jumpHeight = 4; - mountData14.jumpSpeed = 3f; - mountData14.swimSpeed = 16f; + Mount.mounts[13] = mountData14; + mountData14.Minecart = true; + mountData14.MinecartDirectional = true; + mountData14.MinecartDust = new Action(DelegateMethods.Minecart.Sparks); + mountData14.spawnDust = 213; + mountData14.buff = 184; + mountData14.extraBuff = 185; + mountData14.heightBoost = 10; + mountData14.flightTimeMax = 0; + mountData14.fallDamage = 1f; + mountData14.runSpeed = 10f; + mountData14.dashSpeed = 10f; + mountData14.acceleration = 0.03f; + mountData14.jumpHeight = 12; + mountData14.jumpSpeed = 5.15f; mountData14.blockExtraJumps = true; - mountData14.totalFrames = 23; + mountData14.totalFrames = 3; int[] numArray14 = new int[mountData14.totalFrames]; for (int index = 0; index < numArray14.Length; ++index) - numArray14[index] = 12; + numArray14[index] = 8; mountData14.playerYOffsets = numArray14; - mountData14.xOffset = 2; + mountData14.xOffset = 1; mountData14.bodyFrame = 3; - mountData14.yOffset = 16; - mountData14.playerHeadOffset = 16; + mountData14.yOffset = 13; + mountData14.playerHeadOffset = 14; mountData14.standingFrameCount = 1; mountData14.standingFrameDelay = 12; - mountData14.standingFrameStart = 8; - mountData14.runningFrameCount = 7; - mountData14.runningFrameDelay = 14; - mountData14.runningFrameStart = 8; - mountData14.flyingFrameCount = 8; - mountData14.flyingFrameDelay = 16; + mountData14.standingFrameStart = 0; + mountData14.runningFrameCount = 3; + mountData14.runningFrameDelay = 12; + mountData14.runningFrameStart = 0; + mountData14.flyingFrameCount = 0; + mountData14.flyingFrameDelay = 0; mountData14.flyingFrameStart = 0; - mountData14.inAirFrameCount = 8; - mountData14.inAirFrameDelay = 6; + mountData14.inAirFrameCount = 0; + mountData14.inAirFrameDelay = 0; mountData14.inAirFrameStart = 0; mountData14.idleFrameCount = 0; mountData14.idleFrameDelay = 0; mountData14.idleFrameStart = 0; mountData14.idleFrameLoop = false; - mountData14.swimFrameCount = 8; - mountData14.swimFrameDelay = 4; - mountData14.swimFrameStart = 15; if (Main.netMode != 2) { - mountData14.backTexture = TextureAssets.CuteFishronMount[0]; - mountData14.backTextureGlow = TextureAssets.CuteFishronMount[1]; - mountData14.frontTexture = (Asset) Asset.Empty; - mountData14.frontTextureExtra = (Asset) Asset.Empty; - mountData14.textureWidth = mountData14.backTexture.Width(); - mountData14.textureHeight = mountData14.backTexture.Height(); + mountData14.backTexture = (Texture2D) null; + mountData14.backTextureExtra = (Texture2D) null; + mountData14.frontTexture = Main.minecartWoodMountTexture; + mountData14.frontTextureExtra = (Texture2D) null; + mountData14.textureWidth = mountData14.frontTexture.Width; + mountData14.textureHeight = mountData14.frontTexture.Height; } Mount.MountData mountData15 = new Mount.MountData(); - Mount.mounts[13] = mountData15; - mountData15.Minecart = true; - mountData15.MinecartDirectional = true; - mountData15.delegations = new Mount.MountDelegatesData(); - mountData15.delegations.MinecartDust = new Action(DelegateMethods.Minecart.Sparks); - mountData15.spawnDust = 213; - mountData15.buff = 184; - mountData15.extraBuff = 185; - mountData15.heightBoost = 10; + Mount.mounts[14] = mountData15; + mountData15.spawnDust = 15; + mountData15.buff = 193; + mountData15.heightBoost = 8; mountData15.flightTimeMax = 0; - mountData15.fallDamage = 1f; - mountData15.runSpeed = 10f; - mountData15.dashSpeed = 10f; - mountData15.acceleration = 0.03f; - mountData15.jumpHeight = 12; - mountData15.jumpSpeed = 5.15f; - mountData15.blockExtraJumps = true; - mountData15.totalFrames = 3; + mountData15.fallDamage = 0.2f; + mountData15.runSpeed = 8f; + mountData15.acceleration = 0.25f; + mountData15.jumpHeight = 20; + mountData15.jumpSpeed = 8.01f; + mountData15.totalFrames = 8; int[] numArray15 = new int[mountData15.totalFrames]; for (int index = 0; index < numArray15.Length; ++index) numArray15[index] = 8; + numArray15[1] += 2; + numArray15[3] += 2; + numArray15[6] += 2; mountData15.playerYOffsets = numArray15; - mountData15.xOffset = 1; + mountData15.xOffset = 4; mountData15.bodyFrame = 3; - mountData15.yOffset = 13; - mountData15.playerHeadOffset = 14; + mountData15.yOffset = 9; + mountData15.playerHeadOffset = 10; mountData15.standingFrameCount = 1; mountData15.standingFrameDelay = 12; mountData15.standingFrameStart = 0; - mountData15.runningFrameCount = 3; - mountData15.runningFrameDelay = 12; - mountData15.runningFrameStart = 0; - mountData15.flyingFrameCount = 0; - mountData15.flyingFrameDelay = 0; - mountData15.flyingFrameStart = 0; - mountData15.inAirFrameCount = 0; - mountData15.inAirFrameDelay = 0; - mountData15.inAirFrameStart = 0; + mountData15.runningFrameCount = 6; + mountData15.runningFrameDelay = 30; + mountData15.runningFrameStart = 2; + mountData15.inAirFrameCount = 1; + mountData15.inAirFrameDelay = 12; + mountData15.inAirFrameStart = 1; mountData15.idleFrameCount = 0; mountData15.idleFrameDelay = 0; mountData15.idleFrameStart = 0; mountData15.idleFrameLoop = false; - if (Main.netMode != 2) - { - mountData15.backTexture = (Asset) Asset.Empty; - mountData15.backTextureExtra = (Asset) Asset.Empty; - mountData15.frontTexture = TextureAssets.MinecartWoodMount; - mountData15.frontTextureExtra = (Asset) Asset.Empty; - mountData15.textureWidth = mountData15.frontTexture.Width(); - mountData15.textureHeight = mountData15.frontTexture.Height(); - } - Mount.MountData mountData16 = new Mount.MountData(); - Mount.mounts[14] = mountData16; - mountData16.spawnDust = 15; - mountData16.buff = 193; - mountData16.heightBoost = 8; - mountData16.flightTimeMax = 0; - mountData16.fallDamage = 0.2f; - mountData16.runSpeed = 8f; - mountData16.acceleration = 0.25f; - mountData16.jumpHeight = 20; - mountData16.jumpSpeed = 8.01f; - mountData16.totalFrames = 8; - int[] numArray16 = new int[mountData16.totalFrames]; - for (int index = 0; index < numArray16.Length; ++index) - numArray16[index] = 8; - numArray16[1] += 2; - numArray16[3] += 2; - numArray16[6] += 2; - mountData16.playerYOffsets = numArray16; - mountData16.xOffset = 4; - mountData16.bodyFrame = 3; - mountData16.yOffset = 9; - mountData16.playerHeadOffset = 10; - mountData16.standingFrameCount = 1; - mountData16.standingFrameDelay = 12; - mountData16.standingFrameStart = 0; - mountData16.runningFrameCount = 6; - mountData16.runningFrameDelay = 30; - mountData16.runningFrameStart = 2; - mountData16.inAirFrameCount = 1; - mountData16.inAirFrameDelay = 12; - mountData16.inAirFrameStart = 1; - mountData16.idleFrameCount = 0; - mountData16.idleFrameDelay = 0; - mountData16.idleFrameStart = 0; - mountData16.idleFrameLoop = false; - mountData16.swimFrameCount = mountData16.inAirFrameCount; - mountData16.swimFrameDelay = mountData16.inAirFrameDelay; - mountData16.swimFrameStart = mountData16.inAirFrameStart; - if (Main.netMode != 2) - { - mountData16.backTexture = TextureAssets.BasiliskMount; - mountData16.backTextureExtra = (Asset) Asset.Empty; - mountData16.frontTexture = (Asset) Asset.Empty; - mountData16.frontTextureExtra = (Asset) Asset.Empty; - mountData16.textureWidth = mountData16.backTexture.Width(); - mountData16.textureHeight = mountData16.backTexture.Height(); - } - Mount.MountData mountData17 = new Mount.MountData(); - Mount.mounts[17] = mountData17; - mountData17.spawnDust = 15; - mountData17.buff = 212; - mountData17.heightBoost = 16; - mountData17.flightTimeMax = 0; - mountData17.fallDamage = 0.2f; - mountData17.runSpeed = 8f; - mountData17.acceleration = 0.25f; - mountData17.jumpHeight = 20; - mountData17.jumpSpeed = 8.01f; - mountData17.totalFrames = 4; - int[] numArray17 = new int[mountData17.totalFrames]; - for (int index = 0; index < numArray17.Length; ++index) - numArray17[index] = 8; - mountData17.playerYOffsets = numArray17; - mountData17.xOffset = 2; - mountData17.bodyFrame = 3; - mountData17.yOffset = 17 - mountData17.heightBoost; - mountData17.playerHeadOffset = 18; - mountData17.standingFrameCount = 1; - mountData17.standingFrameDelay = 12; - mountData17.standingFrameStart = 0; - mountData17.runningFrameCount = 4; - mountData17.runningFrameDelay = 12; - mountData17.runningFrameStart = 0; - mountData17.inAirFrameCount = 1; - mountData17.inAirFrameDelay = 12; - mountData17.inAirFrameStart = 1; - mountData17.idleFrameCount = 0; - mountData17.idleFrameDelay = 0; - mountData17.idleFrameStart = 0; - mountData17.idleFrameLoop = false; - mountData17.swimFrameCount = mountData17.inAirFrameCount; - mountData17.swimFrameDelay = mountData17.inAirFrameDelay; - mountData17.swimFrameStart = mountData17.inAirFrameStart; - if (Main.netMode != 2) - { - mountData17.backTexture = TextureAssets.Extra[97]; - mountData17.backTextureExtra = TextureAssets.Extra[96]; - mountData17.frontTexture = (Asset) Asset.Empty; - mountData17.frontTextureExtra = (Asset) Asset.Empty; - mountData17.textureWidth = mountData17.backTextureExtra.Width(); - mountData17.textureHeight = mountData17.backTextureExtra.Height(); - } - Mount.MountData mountData18 = new Mount.MountData(); - Mount.mounts[23] = mountData18; - mountData18.spawnDust = 43; - mountData18.spawnDustNoGravity = true; - mountData18.buff = 230; - mountData18.heightBoost = 0; - mountData18.flightTimeMax = 320; - mountData18.fatigueMax = 320; - mountData18.fallDamage = 0.0f; - mountData18.usesHover = true; - mountData18.runSpeed = 8f; - mountData18.dashSpeed = 8f; - mountData18.acceleration = 0.16f; - mountData18.jumpHeight = 10; - mountData18.jumpSpeed = 4f; - mountData18.blockExtraJumps = true; - mountData18.totalFrames = 6; - int[] numArray18 = new int[mountData18.totalFrames]; - for (int index = 0; index < numArray18.Length; ++index) - numArray18[index] = 6; - mountData18.playerYOffsets = numArray18; - mountData18.xOffset = -2; - mountData18.bodyFrame = 0; - mountData18.yOffset = 8; - mountData18.playerHeadOffset = 0; - mountData18.standingFrameCount = 1; - mountData18.standingFrameDelay = 0; - mountData18.standingFrameStart = 0; - mountData18.runningFrameCount = 1; - mountData18.runningFrameDelay = 0; - mountData18.runningFrameStart = 0; - mountData18.flyingFrameCount = 1; - mountData18.flyingFrameDelay = 0; - mountData18.flyingFrameStart = 0; - mountData18.inAirFrameCount = 6; - mountData18.inAirFrameDelay = 8; - mountData18.inAirFrameStart = 0; - mountData18.idleFrameCount = 0; - mountData18.idleFrameDelay = 0; - mountData18.idleFrameStart = 0; - mountData18.idleFrameLoop = true; - mountData18.swimFrameCount = 0; - mountData18.swimFrameDelay = 0; - mountData18.swimFrameStart = 0; - if (Main.netMode != 2) - { - mountData18.backTexture = TextureAssets.Extra[113]; - mountData18.backTextureExtra = (Asset) Asset.Empty; - mountData18.frontTexture = (Asset) Asset.Empty; - mountData18.frontTextureExtra = (Asset) Asset.Empty; - mountData18.textureWidth = mountData18.backTexture.Width(); - mountData18.textureHeight = mountData18.backTexture.Height(); - } - Mount.MountData mountData19 = new Mount.MountData(); - Mount.mounts[37] = mountData19; - mountData19.spawnDust = 282; - mountData19.buff = 265; - mountData19.heightBoost = 12; - mountData19.flightTimeMax = 0; - mountData19.fallDamage = 0.2f; - mountData19.runSpeed = 7.5f; - mountData19.acceleration = 0.15f; - mountData19.jumpHeight = 14; - mountData19.jumpSpeed = 6.01f; - mountData19.totalFrames = 10; - int[] numArray19 = new int[mountData19.totalFrames]; - for (int index = 0; index < numArray19.Length; ++index) - numArray19[index] = 20; - mountData19.playerYOffsets = numArray19; - mountData19.xOffset = 5; - mountData19.bodyFrame = 4; - mountData19.yOffset = 1; - mountData19.playerHeadOffset = 20; - mountData19.standingFrameCount = 1; - mountData19.standingFrameDelay = 12; - mountData19.standingFrameStart = 0; - mountData19.runningFrameCount = 7; - mountData19.runningFrameDelay = 20; - mountData19.runningFrameStart = 2; - mountData19.inAirFrameCount = 1; - mountData19.inAirFrameDelay = 12; - mountData19.inAirFrameStart = 1; - mountData19.idleFrameCount = 0; - mountData19.idleFrameDelay = 0; - mountData19.idleFrameStart = 0; - mountData19.idleFrameLoop = false; - mountData19.swimFrameCount = mountData19.runningFrameCount; - mountData19.swimFrameDelay = 10; - mountData19.swimFrameStart = mountData19.runningFrameStart; - if (Main.netMode != 2) - { - mountData19.backTexture = TextureAssets.Extra[149]; - mountData19.backTextureExtra = (Asset) Asset.Empty; - mountData19.frontTexture = (Asset) Asset.Empty; - mountData19.frontTextureExtra = (Asset) Asset.Empty; - mountData19.textureWidth = mountData19.backTexture.Width(); - mountData19.textureHeight = mountData19.backTexture.Height(); - } - Mount.MountData newMount22 = new Mount.MountData(); - Mount.mounts[40] = newMount22; - Mount.SetAsHorse(newMount22, 275, TextureAssets.Extra[161]); - Mount.MountData newMount23 = new Mount.MountData(); - Mount.mounts[41] = newMount23; - Mount.SetAsHorse(newMount23, 276, TextureAssets.Extra[162]); - Mount.MountData newMount24 = new Mount.MountData(); - Mount.mounts[42] = newMount24; - Mount.SetAsHorse(newMount24, 277, TextureAssets.Extra[163]); - Mount.MountData mountData20 = new Mount.MountData(); - Mount.mounts[43] = mountData20; - mountData20.spawnDust = 15; - mountData20.buff = 278; - mountData20.heightBoost = 12; - mountData20.flightTimeMax = 0; - mountData20.fallDamage = 0.4f; - mountData20.runSpeed = 5f; - mountData20.acceleration = 0.1f; - mountData20.jumpHeight = 8; - mountData20.jumpSpeed = 8f; - mountData20.constantJump = true; - mountData20.totalFrames = 4; - int[] numArray20 = new int[mountData20.totalFrames]; - for (int index = 0; index < numArray20.Length; ++index) - numArray20[index] = 14; - mountData20.playerYOffsets = numArray20; - mountData20.xOffset = 5; - mountData20.bodyFrame = 4; - mountData20.yOffset = 10; - mountData20.playerHeadOffset = 10; - mountData20.standingFrameCount = 1; - mountData20.standingFrameDelay = 5; - mountData20.standingFrameStart = 0; - mountData20.runningFrameCount = 4; - mountData20.runningFrameDelay = 5; - mountData20.runningFrameStart = 0; - mountData20.inAirFrameCount = 1; - mountData20.inAirFrameDelay = 5; - mountData20.inAirFrameStart = 0; - mountData20.idleFrameCount = 0; - mountData20.idleFrameDelay = 0; - mountData20.idleFrameStart = 0; - mountData20.idleFrameLoop = false; - mountData20.swimFrameCount = 1; - mountData20.swimFrameDelay = 5; - mountData20.swimFrameStart = 0; - if (Main.netMode != 2) - { - mountData20.backTexture = (Asset) Asset.Empty; - mountData20.backTextureExtra = (Asset) Asset.Empty; - mountData20.frontTexture = TextureAssets.Extra[164]; - mountData20.frontTextureExtra = (Asset) Asset.Empty; - mountData20.textureWidth = mountData20.frontTexture.Width(); - mountData20.textureHeight = mountData20.frontTexture.Height(); - } - Mount.MountData mountData21 = new Mount.MountData(); - Mount.mounts[44] = mountData21; - mountData21.spawnDust = 228; - mountData21.buff = 279; - mountData21.heightBoost = 24; - mountData21.flightTimeMax = 320; - mountData21.fatigueMax = 320; - mountData21.fallDamage = 0.0f; - mountData21.usesHover = true; - mountData21.runSpeed = 8f; - mountData21.dashSpeed = 16f; - mountData21.acceleration = 0.1f; - mountData21.jumpHeight = 3; - mountData21.jumpSpeed = 1f; - mountData21.swimSpeed = mountData21.runSpeed; - mountData21.blockExtraJumps = true; - mountData21.totalFrames = 10; - int[] numArray21 = new int[mountData21.totalFrames]; - for (int index = 0; index < numArray21.Length; ++index) - numArray21[index] = 9; - mountData21.playerYOffsets = numArray21; - mountData21.xOffset = 0; - mountData21.bodyFrame = 3; - mountData21.yOffset = 8; - mountData21.playerHeadOffset = 16; - mountData21.runningFrameCount = 10; - mountData21.runningFrameDelay = 8; - mountData21.runningFrameStart = 0; - if (Main.netMode != 2) - { - mountData21.backTexture = (Asset) Asset.Empty; - mountData21.backTextureExtra = (Asset) Asset.Empty; - mountData21.frontTexture = TextureAssets.Extra[166]; - mountData21.frontTextureExtra = (Asset) Asset.Empty; - mountData21.textureWidth = mountData21.frontTexture.Width(); - mountData21.textureHeight = mountData21.frontTexture.Height(); - } - Mount.MountData mountData22 = new Mount.MountData(); - Mount.mounts[45] = mountData22; - mountData22.spawnDust = 6; - mountData22.buff = 280; - mountData22.heightBoost = 25; - mountData22.flightTimeMax = 0; - mountData22.fallDamage = 0.1f; - mountData22.runSpeed = 12f; - mountData22.dashSpeed = 16f; - mountData22.acceleration = 0.5f; - mountData22.jumpHeight = 14; - mountData22.jumpSpeed = 7f; - mountData22.emitsLight = true; - mountData22.lightColor = new Vector3(0.6f, 0.4f, 0.35f); - mountData22.totalFrames = 8; - int[] numArray22 = new int[mountData22.totalFrames]; - for (int index = 0; index < numArray22.Length; ++index) - numArray22[index] = 30; - mountData22.playerYOffsets = numArray22; - mountData22.xOffset = 0; - mountData22.bodyFrame = 0; - mountData22.xOffset = 2; - mountData22.yOffset = 1; - mountData22.playerHeadOffset = 20; - mountData22.standingFrameCount = 1; - mountData22.standingFrameDelay = 20; - mountData22.standingFrameStart = 0; - mountData22.runningFrameCount = 6; - mountData22.runningFrameDelay = 20; - mountData22.runningFrameStart = 2; - mountData22.inAirFrameCount = 1; - mountData22.inAirFrameDelay = 20; - mountData22.inAirFrameStart = 1; - mountData22.swimFrameCount = mountData22.runningFrameCount; - mountData22.swimFrameDelay = 20; - mountData22.swimFrameStart = mountData22.runningFrameStart; - if (Main.netMode != 2) - { - mountData22.backTexture = TextureAssets.Extra[167]; - mountData22.backTextureGlow = TextureAssets.GlowMask[283]; - mountData22.frontTexture = (Asset) Asset.Empty; - mountData22.frontTextureExtra = (Asset) Asset.Empty; - mountData22.textureWidth = mountData22.backTexture.Width(); - mountData22.textureHeight = mountData22.backTexture.Height(); - } - Mount.MountData mountData23 = new Mount.MountData(); - Mount.mounts[46] = mountData23; - mountData23.spawnDust = 15; - mountData23.buff = 281; - mountData23.heightBoost = 0; - mountData23.flightTimeMax = 0; - mountData23.fatigueMax = 0; - mountData23.fallDamage = 0.0f; - mountData23.abilityChargeMax = 40; - mountData23.abilityCooldown = 40; - mountData23.abilityDuration = 0; - mountData23.runSpeed = 8f; - mountData23.dashSpeed = 8f; - mountData23.acceleration = 0.4f; - mountData23.jumpHeight = 8; - mountData23.jumpSpeed = 9.01f; - mountData23.blockExtraJumps = false; - mountData23.totalFrames = 27; - int[] numArray23 = new int[mountData23.totalFrames]; - for (int index = 0; index < numArray23.Length; ++index) - { - numArray23[index] = 4; - if (index == 1 || index == 2 || index == 7 || index == 8) - numArray23[index] += 2; - } - mountData23.playerYOffsets = numArray23; - mountData23.xOffset = 1; - mountData23.bodyFrame = 3; - mountData23.yOffset = 1; - mountData23.playerHeadOffset = 2; - mountData23.standingFrameCount = 1; - mountData23.standingFrameDelay = 12; - mountData23.standingFrameStart = 0; - mountData23.runningFrameCount = 11; - mountData23.runningFrameDelay = 12; - mountData23.runningFrameStart = 0; - mountData23.inAirFrameCount = 11; - mountData23.inAirFrameDelay = 12; - mountData23.inAirFrameStart = 1; - mountData23.swimFrameCount = mountData23.runningFrameCount; - mountData23.swimFrameDelay = mountData23.runningFrameDelay; - mountData23.swimFrameStart = mountData23.runningFrameStart; - Mount.santankTextureSize = new Vector2(23f, 2f); - if (Main.netMode != 2) - { - mountData23.backTexture = (Asset) Asset.Empty; - mountData23.backTextureExtra = (Asset) Asset.Empty; - mountData23.frontTexture = TextureAssets.Extra[168]; - mountData23.frontTextureExtra = TextureAssets.Extra[168]; - mountData23.textureWidth = mountData23.frontTexture.Width(); - mountData23.textureHeight = mountData23.frontTexture.Height(); - } - Mount.MountData mountData24 = new Mount.MountData(); - Mount.mounts[47] = mountData24; - mountData24.spawnDust = 5; - mountData24.buff = 282; - mountData24.heightBoost = 34; - mountData24.flightTimeMax = 0; - mountData24.fallDamage = 0.2f; - mountData24.runSpeed = 4f; - mountData24.dashSpeed = 12f; - mountData24.acceleration = 0.3f; - mountData24.jumpHeight = 10; - mountData24.jumpSpeed = 8.01f; - mountData24.totalFrames = 16; - int[] numArray24 = new int[mountData24.totalFrames]; - for (int index = 0; index < numArray24.Length; ++index) - numArray24[index] = 30; - numArray24[3] += 2; - numArray24[4] += 2; - numArray24[7] += 2; - numArray24[8] += 2; - numArray24[12] += 2; - numArray24[13] += 2; - numArray24[15] += 4; - mountData24.playerYOffsets = numArray24; - mountData24.xOffset = 5; - mountData24.bodyFrame = 3; - mountData24.yOffset = -1; - mountData24.playerHeadOffset = 34; - mountData24.standingFrameCount = 1; - mountData24.standingFrameDelay = 12; - mountData24.standingFrameStart = 0; - mountData24.runningFrameCount = 7; - mountData24.runningFrameDelay = 15; - mountData24.runningFrameStart = 1; - mountData24.dashingFrameCount = 6; - mountData24.dashingFrameDelay = 40; - mountData24.dashingFrameStart = 9; - mountData24.flyingFrameCount = 6; - mountData24.flyingFrameDelay = 6; - mountData24.flyingFrameStart = 1; - mountData24.inAirFrameCount = 1; - mountData24.inAirFrameDelay = 12; - mountData24.inAirFrameStart = 15; - mountData24.idleFrameCount = 0; - mountData24.idleFrameDelay = 0; - mountData24.idleFrameStart = 0; - mountData24.idleFrameLoop = false; - mountData24.swimFrameCount = mountData24.inAirFrameCount; - mountData24.swimFrameDelay = mountData24.inAirFrameDelay; - mountData24.swimFrameStart = mountData24.inAirFrameStart; - if (Main.netMode != 2) - { - mountData24.backTexture = TextureAssets.Extra[169]; - mountData24.backTextureGlow = TextureAssets.GlowMask[284]; - mountData24.frontTexture = (Asset) Asset.Empty; - mountData24.frontTextureExtra = (Asset) Asset.Empty; - mountData24.textureWidth = mountData24.backTexture.Width(); - mountData24.textureHeight = mountData24.backTexture.Height(); - } - Mount.MountData mountData25 = new Mount.MountData(); - Mount.mounts[48] = mountData25; - mountData25.spawnDust = 62; - mountData25.buff = 283; - mountData25.heightBoost = 14; - mountData25.flightTimeMax = 320; - mountData25.fallDamage = 0.0f; - mountData25.usesHover = true; - mountData25.runSpeed = 8f; - mountData25.dashSpeed = 8f; - mountData25.acceleration = 0.2f; - mountData25.jumpHeight = 5; - mountData25.jumpSpeed = 6f; - mountData25.swimSpeed = mountData25.runSpeed; - mountData25.totalFrames = 6; - int[] numArray25 = new int[mountData25.totalFrames]; - for (int index = 0; index < numArray25.Length; ++index) - numArray25[index] = 9; - numArray25[0] += 6; - numArray25[1] += 6; - numArray25[2] += 4; - numArray25[3] += 4; - numArray25[4] += 4; - numArray25[5] += 6; - mountData25.playerYOffsets = numArray25; - mountData25.xOffset = 1; - mountData25.bodyFrame = 0; - mountData25.yOffset = 16; - mountData25.playerHeadOffset = 16; - mountData25.runningFrameCount = 6; - mountData25.runningFrameDelay = 8; - mountData25.runningFrameStart = 0; - if (Main.netMode != 2) - { - mountData25.backTexture = TextureAssets.Extra[170]; - mountData25.backTextureExtra = (Asset) Asset.Empty; - mountData25.frontTexture = (Asset) Asset.Empty; - mountData25.frontTextureExtra = (Asset) Asset.Empty; - mountData25.textureWidth = mountData25.backTexture.Width(); - mountData25.textureHeight = mountData25.backTexture.Height(); - } - Mount.MountData mountData26 = new Mount.MountData(); - Mount.mounts[49] = mountData26; - mountData26.spawnDust = 35; - mountData26.buff = 305; - mountData26.heightBoost = 8; - mountData26.runSpeed = 2f; - mountData26.dashSpeed = 1f; - mountData26.acceleration = 0.4f; - mountData26.jumpHeight = 4; - mountData26.jumpSpeed = 3f; - mountData26.swimSpeed = 14f; - mountData26.blockExtraJumps = true; - mountData26.flightTimeMax = 0; - mountData26.fatigueMax = 320; - mountData26.usesHover = true; - mountData26.emitsLight = true; - mountData26.lightColor = new Vector3(0.3f, 0.15f, 0.1f); - mountData26.totalFrames = 8; - int[] numArray26 = new int[mountData26.totalFrames]; - for (int index = 0; index < numArray26.Length; ++index) - numArray26[index] = 10; - mountData26.playerYOffsets = numArray26; - mountData26.xOffset = 2; - mountData26.bodyFrame = 3; - mountData26.yOffset = 1; - mountData26.playerHeadOffset = 16; - mountData26.standingFrameCount = 1; - mountData26.standingFrameDelay = 12; - mountData26.standingFrameStart = 4; - mountData26.runningFrameCount = 4; - mountData26.runningFrameDelay = 14; - mountData26.runningFrameStart = 4; - mountData26.inAirFrameCount = 1; - mountData26.inAirFrameDelay = 6; - mountData26.inAirFrameStart = 4; - mountData26.swimFrameCount = 4; - mountData26.swimFrameDelay = 16; - mountData26.swimFrameStart = 0; - if (Main.netMode != 2) - { - mountData26.backTexture = TextureAssets.Extra[172]; - mountData26.backTextureGlow = TextureAssets.GlowMask[285]; - mountData26.frontTexture = (Asset) Asset.Empty; - mountData26.frontTextureExtra = (Asset) Asset.Empty; - mountData26.textureWidth = mountData26.backTexture.Width(); - mountData26.textureHeight = mountData26.backTexture.Height(); - } - Mount.MountData mountData27 = new Mount.MountData(); - Mount.mounts[50] = mountData27; - mountData27.spawnDust = 243; - mountData27.buff = 318; - mountData27.heightBoost = 20; - mountData27.flightTimeMax = 160; - mountData27.fallDamage = 0.5f; - mountData27.runSpeed = 6.5f; - mountData27.dashSpeed = 6.5f; - mountData27.acceleration = 0.2f; - mountData27.jumpHeight = 10; - mountData27.jumpSpeed = 7.25f; - mountData27.constantJump = true; - mountData27.totalFrames = 8; - int[] numArray27 = new int[mountData27.totalFrames]; - for (int index = 0; index < numArray27.Length; ++index) - numArray27[index] = 20; - numArray27[1] += 2; - numArray27[4] += 2; - numArray27[5] += 2; - mountData27.playerYOffsets = numArray27; - mountData27.xOffset = 1; - mountData27.bodyFrame = 3; - mountData27.yOffset = -1; - mountData27.playerHeadOffset = 22; - mountData27.standingFrameCount = 1; - mountData27.standingFrameDelay = 12; - mountData27.standingFrameStart = 0; - mountData27.runningFrameCount = 5; - mountData27.runningFrameDelay = 16; - mountData27.runningFrameStart = 0; - mountData27.flyingFrameCount = 0; - mountData27.flyingFrameDelay = 0; - mountData27.flyingFrameStart = 0; - mountData27.inAirFrameCount = 1; - mountData27.inAirFrameDelay = 12; - mountData27.inAirFrameStart = 5; - mountData27.idleFrameCount = 0; - mountData27.idleFrameDelay = 0; - mountData27.idleFrameStart = 0; - mountData27.idleFrameLoop = false; + mountData15.swimFrameCount = mountData15.inAirFrameCount; + mountData15.swimFrameDelay = mountData15.inAirFrameDelay; + mountData15.swimFrameStart = mountData15.inAirFrameStart; if (Main.netMode == 2) return; - mountData27.backTexture = TextureAssets.Extra[204]; - mountData27.backTextureExtra = (Asset) Asset.Empty; - mountData27.frontTexture = (Asset) Asset.Empty; - mountData27.frontTextureExtra = (Asset) Asset.Empty; - mountData27.textureWidth = mountData27.backTexture.Width(); - mountData27.textureHeight = mountData27.backTexture.Height(); - } - - private static void SetAsHorse(Mount.MountData newMount, int buff, Asset texture) - { - newMount.spawnDust = 3; - newMount.buff = buff; - newMount.heightBoost = 34; - newMount.flightTimeMax = 0; - newMount.fallDamage = 0.5f; - newMount.runSpeed = 3f; - newMount.dashSpeed = 8f; - newMount.acceleration = 0.25f; - newMount.jumpHeight = 6; - newMount.jumpSpeed = 7.01f; - newMount.totalFrames = 16; - int[] numArray = new int[newMount.totalFrames]; - for (int index = 0; index < numArray.Length; ++index) - numArray[index] = 28; - numArray[3] += 2; - numArray[4] += 2; - numArray[7] += 2; - numArray[8] += 2; - numArray[12] += 2; - numArray[13] += 2; - numArray[15] += 4; - newMount.playerYOffsets = numArray; - newMount.xOffset = 5; - newMount.bodyFrame = 3; - newMount.yOffset = 1; - newMount.playerHeadOffset = 34; - newMount.standingFrameCount = 1; - newMount.standingFrameDelay = 12; - newMount.standingFrameStart = 0; - newMount.runningFrameCount = 7; - newMount.runningFrameDelay = 15; - newMount.runningFrameStart = 1; - newMount.dashingFrameCount = 6; - newMount.dashingFrameDelay = 40; - newMount.dashingFrameStart = 9; - newMount.flyingFrameCount = 6; - newMount.flyingFrameDelay = 6; - newMount.flyingFrameStart = 1; - newMount.inAirFrameCount = 1; - newMount.inAirFrameDelay = 12; - newMount.inAirFrameStart = 15; - newMount.idleFrameCount = 0; - newMount.idleFrameDelay = 0; - newMount.idleFrameStart = 0; - newMount.idleFrameLoop = false; - newMount.swimFrameCount = newMount.inAirFrameCount; - newMount.swimFrameDelay = newMount.inAirFrameDelay; - newMount.swimFrameStart = newMount.inAirFrameStart; - if (Main.netMode == 2) - return; - newMount.backTexture = texture; - newMount.backTextureExtra = (Asset) Asset.Empty; - newMount.frontTexture = (Asset) Asset.Empty; - newMount.frontTextureExtra = (Asset) Asset.Empty; - newMount.textureWidth = newMount.backTexture.Width(); - newMount.textureHeight = newMount.backTexture.Height(); - } - - private static void SetAsMinecart( - Mount.MountData newMount, - int buffToLeft, - int buffToRight, - Asset texture) - { - newMount.Minecart = true; - newMount.delegations = new Mount.MountDelegatesData(); - newMount.delegations.MinecartDust = new Action(DelegateMethods.Minecart.Sparks); - newMount.spawnDust = 213; - newMount.buff = buffToLeft; - newMount.extraBuff = buffToRight; - newMount.heightBoost = 10; - newMount.flightTimeMax = 0; - newMount.fallDamage = 1f; - newMount.runSpeed = 13f; - newMount.dashSpeed = 13f; - newMount.acceleration = 0.04f; - newMount.jumpHeight = 15; - newMount.jumpSpeed = 5.15f; - newMount.blockExtraJumps = true; - newMount.totalFrames = 3; - int[] numArray = new int[newMount.totalFrames]; - for (int index = 0; index < numArray.Length; ++index) - numArray[index] = 8; - newMount.playerYOffsets = numArray; - newMount.xOffset = 1; - newMount.bodyFrame = 3; - newMount.yOffset = 13; - newMount.playerHeadOffset = 14; - newMount.standingFrameCount = 1; - newMount.standingFrameDelay = 12; - newMount.standingFrameStart = 0; - newMount.runningFrameCount = 3; - newMount.runningFrameDelay = 12; - newMount.runningFrameStart = 0; - newMount.flyingFrameCount = 0; - newMount.flyingFrameDelay = 0; - newMount.flyingFrameStart = 0; - newMount.inAirFrameCount = 0; - newMount.inAirFrameDelay = 0; - newMount.inAirFrameStart = 0; - newMount.idleFrameCount = 0; - newMount.idleFrameDelay = 0; - newMount.idleFrameStart = 0; - newMount.idleFrameLoop = false; - if (Main.netMode == 2) - return; - newMount.backTexture = (Asset) Asset.Empty; - newMount.backTextureExtra = (Asset) Asset.Empty; - newMount.frontTexture = texture; - newMount.frontTextureExtra = (Asset) Asset.Empty; - newMount.textureWidth = newMount.frontTexture.Width(); - newMount.textureHeight = newMount.frontTexture.Height(); + mountData15.backTexture = Main.basiliskMountTexture; + mountData15.backTextureExtra = (Texture2D) null; + mountData15.frontTexture = (Texture2D) null; + mountData15.frontTextureExtra = (Texture2D) null; + mountData15.textureWidth = mountData15.backTexture.Width; + mountData15.textureHeight = mountData15.backTexture.Height; } public bool Active => this._active; @@ -1699,27 +932,23 @@ namespace Terraria public int PlayerOffset => !this._active ? 0 : this._data.playerYOffsets[this._frame]; - public int PlayerOffsetHitbox => !this._active ? 0 : -this.PlayerOffset + this._data.heightBoost; + public int PlayerOffsetHitbox => !this._active ? 0 : this._data.playerYOffsets[0] - this._data.playerYOffsets[this._frame] + this._data.playerYOffsets[0] / 4; public int PlayerHeadOffset => !this._active ? 0 : this._data.playerHeadOffset; public int HeightBoost => this._data.heightBoost; - public static int GetHeightBoost(int MountType) => MountType <= -1 || MountType >= MountID.Count ? 0 : Mount.mounts[MountType].heightBoost; + public static int GetHeightBoost(int MountType) => MountType <= -1 || MountType >= 15 ? 0 : Mount.mounts[MountType].heightBoost; public float RunSpeed { get { - if (this._type == 4 && this._frameState == 4 || (this._type == 12 || this._type == 44 || this._type == 49) && this._frameState == 4) + if (this._type == 4 && this._frameState == 4 || this._type == 12 && this._frameState == 4) return this._data.swimSpeed; if (this._type == 12 && this._frameState == 2) - return this._data.runSpeed + 13.5f; - if (this._type == 44 && this._frameState == 2) - return this._data.runSpeed + 4f; - if (this._type == 5 && this._frameState == 2) - return this._data.runSpeed + (float) (4.0 * (1.0 - (double) (this._fatigue / this._fatigueMax))); - return this._type == 50 && this._frameState == 2 ? this._data.runSpeed + 4f : this._data.runSpeed; + return this._data.runSpeed + 11f; + return this._type == 5 && this._frameState == 2 ? this._data.runSpeed + (float) (4.0 * (1.0 - (double) (this._fatigue / this._fatigueMax))) : this._data.runSpeed; } } @@ -1741,7 +970,6 @@ namespace Terraria jumpHeight += (int) ((double) Math.Abs(xVelocity) / 2.5); break; case 4: - case 49: if (this._frameState == 4) { jumpHeight += 5; @@ -1762,7 +990,6 @@ namespace Terraria jumpSpeed += Math.Abs(xVelocity) / 7f; break; case 4: - case 49: if (this._frameState == 4) { jumpSpeed += 2.5f; @@ -1777,26 +1004,19 @@ namespace Terraria public bool BlockExtraJumps => this._data.blockExtraJumps; - public bool IsConsideredASlimeMount => this._type == 3 || this._type == 50; - public bool Cart => this._data != null && this._active && this._data.Minecart; public bool Directional => this._data == null || this._data.MinecartDirectional; - public Mount.MountDelegatesData Delegations => this._data == null ? this._defaultDelegatesData : this._data.delegations; + public Action MinecartDust => this._data == null ? new Action(DelegateMethods.Minecart.Sparks) : this._data.MinecartDust; public Vector2 Origin => new Vector2((float) this._data.textureWidth / 2f, (float) this._data.textureHeight / (2f * (float) this._data.totalFrames)); - public bool CanFly() => this._active && this._data.flightTimeMax != 0 && this._type != 48; + public bool CanFly => this._active && this._data.flightTimeMax != 0; - public bool CanHover() - { - if (!this._active || !this._data.usesHover) - return false; - if (this._type == 49) - return this._frameState == 4; - return this._data.usesHover; - } + public bool CanHover => this._active && this._data.usesHover; + + public bool AbilityReady => this._abilityCooldown == 0; public bool AbilityCharging => this._abilityCharging; @@ -1810,12 +1030,11 @@ namespace Terraria { if (this._type != 9) return; - int Type = 441; double num = (double) Main.screenPosition.X + (double) Main.mouseX; float Y = Main.screenPosition.Y + (float) Main.mouseY; float ai0 = (float) num - mountedPlayer.position.X; float ai1 = Y - mountedPlayer.position.Y; - Projectile.NewProjectile((float) num, Y, 0.0f, 0.0f, Type, 0, 0.0f, mountedPlayer.whoAmI, ai0, ai1); + Projectile.NewProjectile((float) num, Y, 0.0f, 0.0f, 441, 0, 0.0f, mountedPlayer.whoAmI, ai0, ai1); this._abilityCharging = true; } else @@ -1828,15 +1047,11 @@ namespace Terraria public void StopAbilityCharge() { - switch (this._type) - { - case 9: - case 46: - this._abilityCharging = false; - this._abilityCooldown = this._data.abilityCooldown; - this._abilityDuration = this._data.abilityDuration; - break; - } + if (this._type != 9) + return; + this._abilityCharging = false; + this._abilityCooldown = this._data.abilityCooldown; + this._abilityDuration = this._data.abilityDuration; } public bool CheckBuff(int buffID) => this._data.buff == buffID || this._data.extraBuff == buffID; @@ -1938,7 +1153,7 @@ namespace Terraria Main.dust[index3].customData = (object) mountedPlayer; } if (flag1) - Tile.SmoothSlope((int) point16.X, (int) point16.Y, sync: true); + Tile.SmoothSlope((int) point16.X, (int) point16.Y); beam.cooldown = Mount.drillPickTime; break; } @@ -1962,7 +1177,7 @@ namespace Terraria Vector2 vector2_3 = center + vector2_2 * num2; Point16 tilePoint = new Point16(-1, -1); Vector2 end = vector2_3; - Utils.TileActionAttempt plot = (Utils.TileActionAttempt) ((x, y) => + Utils.PerLinePoint plot = (Utils.PerLinePoint) ((x, y) => { tilePoint = new Point16(x, y); for (int index = 0; index < data.beams.Length; ++index) @@ -2005,7 +1220,6 @@ namespace Terraria case 9: if (Main.myPlayer != mountedPlayer.whoAmI) break; - int Type1 = 606; mousePosition = this.ClampToDeadZone(mountedPlayer, mousePosition); Vector2 vector2_1; vector2_1.X = mountedPlayer.position.X + (float) (mountedPlayer.width / 2); @@ -2021,88 +1235,47 @@ namespace Terraria Vector2 vector2_4 = vector2_3 * 14f; int Damage = 100; vector2_2 += vector2_4; - Projectile.NewProjectile(vector2_2.X, vector2_2.Y, vector2_4.X, vector2_4.Y, Type1, Damage, 0.0f, Main.myPlayer); + Projectile.NewProjectile(vector2_2.X, vector2_2.Y, vector2_4.X, vector2_4.Y, 606, Damage, 0.0f, Main.myPlayer); } break; - case 46: - if (Main.myPlayer != mountedPlayer.whoAmI) - break; - if (this._abilityCooldown <= 10) - { - int Damage = 120; - Vector2 vector2_5 = mountedPlayer.Center + new Vector2((float) (mountedPlayer.width * -mountedPlayer.direction), 26f); - Vector2 vector2_6 = new Vector2(0.0f, -4f).RotatedByRandom(0.100000001490116); - Projectile.NewProjectile(vector2_5.X, vector2_5.Y, vector2_6.X, vector2_6.Y, 930, Damage, 0.0f, Main.myPlayer); - SoundEngine.PlaySound(SoundID.Item89.SoundId, (int) vector2_5.X, (int) vector2_5.Y, SoundID.Item89.Style, 0.2f); - } - int Type2 = 14; - int Damage1 = 100; - mousePosition = this.ClampToDeadZone(mountedPlayer, mousePosition); - Vector2 vector2_7; - vector2_7.X = mountedPlayer.position.X + (float) (mountedPlayer.width / 2); - vector2_7.Y = mountedPlayer.position.Y + (float) mountedPlayer.height; - Vector2 vector2_8 = new Vector2(vector2_7.X + (float) (mountedPlayer.width * mountedPlayer.direction), vector2_7.Y - 12f); - Vector2 vector2_9 = ((mousePosition - vector2_8).SafeNormalize(Vector2.Zero) * 12f).RotatedByRandom(0.200000002980232); - Projectile.NewProjectile(vector2_8.X, vector2_8.Y, vector2_9.X, vector2_9.Y, Type2, Damage1, 0.0f, Main.myPlayer); - SoundEngine.PlaySound(SoundID.Item11.SoundId, (int) vector2_8.X, (int) vector2_8.Y, SoundID.Item11.Style, 0.2f); - break; } } public bool Hover(Player mountedPlayer) { - bool flag1 = this.DoesHoverIgnoresFatigue(); - bool flag2 = this._frameState == 2 || this._frameState == 4; - if (this._type == 49) - flag2 = this._frameState == 4; - if (flag2) + if (this._frameState == 2 || this._frameState == 4) { - bool flag3 = true; + bool flag = true; float num1 = 1f; float num2 = mountedPlayer.gravity / Player.defaultGravity; if (mountedPlayer.slowFall) num2 /= 3f; if ((double) num2 < 0.25) num2 = 0.25f; - if (!flag1) + if (this._type != 7 && this._type != 8 && this._type != 12) { if (this._flyTime > 0) --this._flyTime; else if ((double) this._fatigue < (double) this._fatigueMax) this._fatigue += num2; else - flag3 = false; + flag = false; } if (this._type == 12 && !mountedPlayer.MountFishronSpecial) num1 = 0.5f; float num3 = this._fatigue / this._fatigueMax; - if (flag1) + if (this._type == 7 || this._type == 8 || this._type == 12) num3 = 0.0f; - bool flag4 = true; - if (this._type == 48) - flag4 = false; float num4 = 4f * num3; float num5 = 4f * num3; - bool flag5 = false; - if (this._type == 48) - { - num4 = 0.0f; - num5 = 0.0f; - if (!flag3) - flag5 = true; - if (mountedPlayer.controlDown) - num5 = 8f; - } if ((double) num4 == 0.0) num4 = -1f / 1000f; if ((double) num5 == 0.0) num5 = -1f / 1000f; float num6 = mountedPlayer.velocity.Y; - if (((!flag4 ? 0 : (mountedPlayer.controlUp ? 1 : (mountedPlayer.controlJump ? 1 : 0))) & (flag3 ? 1 : 0)) != 0) + if (((mountedPlayer.controlUp ? 1 : (mountedPlayer.controlJump ? 1 : 0)) & (flag ? 1 : 0)) != 0) { num4 = (float) (-2.0 - 6.0 * (1.0 - (double) num3)); - if (this._type == 48) - num4 /= 3f; num6 -= this._data.acceleration * num1; } else if (mountedPlayer.controlDown) @@ -2110,12 +1283,6 @@ namespace Terraria num6 += this._data.acceleration * num1; num5 = 8f; } - else if (flag5) - { - float num7 = mountedPlayer.gravity * mountedPlayer.gravDir; - num6 += num7; - num5 = 4f; - } else { int jump = mountedPlayer.jump; @@ -2135,75 +1302,44 @@ namespace Terraria num6 -= this._data.acceleration * num1; } mountedPlayer.velocity.Y = num6; - if ((double) num4 == -1.0 / 1000.0 && (double) num5 == -1.0 / 1000.0 && (double) num6 == -1.0 / 1000.0) - mountedPlayer.position.Y -= -1f / 1000f; mountedPlayer.fallStart = (int) ((double) mountedPlayer.position.Y / 16.0); } - else if (!flag1) + else if (this._type != 7 && this._type != 8 && this._type != 12) mountedPlayer.velocity.Y += mountedPlayer.gravity * mountedPlayer.gravDir; else if ((double) mountedPlayer.velocity.Y == 0.0) - { - Vector2 Velocity = Vector2.UnitY * mountedPlayer.gravDir * 1f; - if ((double) Collision.TileCollision(mountedPlayer.position, Velocity, mountedPlayer.width, mountedPlayer.height, gravDir: ((int) mountedPlayer.gravDir)).Y != 0.0 || mountedPlayer.controlDown) - mountedPlayer.velocity.Y = 1f / 1000f; - } - else if ((double) mountedPlayer.velocity.Y == -1.0 / 1000.0) - mountedPlayer.velocity.Y -= -1f / 1000f; + mountedPlayer.velocity.Y = 1f / 1000f; if (this._type == 7) { - float num8 = mountedPlayer.velocity.X / this._data.dashSpeed; - if ((double) num8 > 0.95) - num8 = 0.95f; - if ((double) num8 < -0.95) - num8 = -0.95f; - float num9 = (float) (0.785398185253143 * (double) num8 / 2.0); - float num10 = Math.Abs((float) (2.0 - (double) this._frame / 2.0)) / 2f; - Lighting.AddLight((int) ((double) mountedPlayer.position.X + (double) (mountedPlayer.width / 2)) / 16, (int) ((double) mountedPlayer.position.Y + (double) (mountedPlayer.height / 2)) / 16, 0.4f, 0.2f * num10, 0.0f); - mountedPlayer.fullRotation = num9; + float num7 = mountedPlayer.velocity.X / this._data.dashSpeed; + if ((double) num7 > 0.95) + num7 = 0.95f; + if ((double) num7 < -0.95) + num7 = -0.95f; + float num8 = (float) (0.785398185253143 * (double) num7 / 2.0); + float num9 = Math.Abs((float) (2.0 - (double) this._frame / 2.0)) / 2f; + Lighting.AddLight((int) ((double) mountedPlayer.position.X + (double) (mountedPlayer.width / 2)) / 16, (int) ((double) mountedPlayer.position.Y + (double) (mountedPlayer.height / 2)) / 16, 0.4f, 0.2f * num9, 0.0f); + mountedPlayer.fullRotation = num8; } else if (this._type == 8) { - float num11 = mountedPlayer.velocity.X / this._data.dashSpeed; - if ((double) num11 > 0.95) - num11 = 0.95f; - if ((double) num11 < -0.95) - num11 = -0.95f; - float num12 = (float) (0.785398185253143 * (double) num11 / 2.0); - mountedPlayer.fullRotation = num12; + float num10 = mountedPlayer.velocity.X / this._data.dashSpeed; + if ((double) num10 > 0.95) + num10 = 0.95f; + if ((double) num10 < -0.95) + num10 = -0.95f; + float num11 = (float) (0.785398185253143 * (double) num10 / 2.0); + mountedPlayer.fullRotation = num11; Mount.DrillMountData mountSpecificData = (Mount.DrillMountData) this._mountSpecificData; - float num13 = mountSpecificData.outerRingRotation + mountedPlayer.velocity.X / 80f; - if ((double) num13 > 3.14159274101257) - num13 -= 6.283185f; - else if ((double) num13 < -3.14159274101257) - num13 += 6.283185f; - mountSpecificData.outerRingRotation = num13; - } - else if (this._type == 23) - { - float num14 = MathHelper.Clamp(-mountedPlayer.velocity.Y / this._data.dashSpeed, -1f, 1f); - float num15 = MathHelper.Clamp(mountedPlayer.velocity.X / this._data.dashSpeed, -1f, 1f); - float num16 = -0.1963495f * num14 * (float) mountedPlayer.direction + 0.1963495f * num15; - mountedPlayer.fullRotation = num16; - mountedPlayer.fullRotationOrigin = new Vector2((float) (mountedPlayer.width / 2), (float) mountedPlayer.height); + float num12 = mountSpecificData.outerRingRotation + mountedPlayer.velocity.X / 80f; + if ((double) num12 > 3.14159274101257) + num12 -= 6.283185f; + else if ((double) num12 < -3.14159274101257) + num12 += 6.283185f; + mountSpecificData.outerRingRotation = num12; } return true; } - private bool DoesHoverIgnoresFatigue() => this._type == 7 || this._type == 8 || this._type == 12 || this._type == 23 || this._type == 44 || this._type == 49; - - private float GetWitchBroomTrinketRotation(Player player) - { - float num1 = Utils.Clamp(player.velocity.X / 10f, -1f, 1f); - Point tileCoordinates = player.Center.ToTileCoordinates(); - float num2 = 0.5f; - if (WorldGen.InAPlaceWithWind(tileCoordinates.X, tileCoordinates.Y, 1, 1)) - num2 = 1f; - float num3 = (float) (Math.Sin((double) player.miscCounter / 300.0 * 6.28318548202515 * 3.0) * 0.785398185253143 * (double) Math.Abs(Main.WindForVisuals) * 0.5 + 0.785398185253143 * -(double) Main.WindForVisuals * 0.5) * num2; - return (float) ((double) num1 * Math.Sin((double) player.miscCounter / 150.0 * 6.28318548202515 * 3.0) * 0.785398185253143 * 0.5 + (double) num1 * 0.785398185253143 * 0.5) + num3; - } - - private Vector2 GetWitchBroomTrinketOriginOffset(Player player) => new Vector2((float) (27 * player.direction), 5f); - public void UpdateFrame(Player mountedPlayer, int state, Vector2 velocity) { if (this._frameState != state) @@ -2292,10 +1428,6 @@ namespace Terraria } break; case 10: - case 40: - case 41: - case 42: - case 47: bool flag1 = (double) Math.Abs(velocity.X) > (double) this.DashSpeed - (double) this.RunSpeed / 2.0; if (state == 1) { @@ -2309,30 +1441,25 @@ namespace Terraria } else this._frameExtra = 0; - if (((this._type == 10 ? 1 : (this._type == 47 ? 1 : 0)) & (flag2 ? 1 : 0)) != 0) + if (flag2) { - int Type = 6; - if (this._type == 10) - Type = Utils.SelectRandom(Main.rand, 176, 177, 179); Vector2 Position = mountedPlayer.Center + new Vector2((float) (mountedPlayer.width * mountedPlayer.direction), 0.0f); Vector2 vector2_1 = new Vector2(40f, 30f); float num8 = 6.283185f * Main.rand.NextFloat(); for (float num9 = 0.0f; (double) num9 < 14.0; ++num9) { - Dust dust = Main.dust[Dust.NewDust(Position, 0, 0, Type)]; + Dust dust = Main.dust[Dust.NewDust(Position, 0, 0, Utils.SelectRandom(Main.rand, 176, 177, 179))]; Vector2 vector2_2 = Vector2.UnitY.RotatedBy((double) num9 * 6.28318548202515 / 14.0 + (double) num8) * (0.2f * (float) this._frameExtra); dust.position = Position + vector2_2 * vector2_1; dust.velocity = vector2_2 + new Vector2(this.RunSpeed - (float) (Math.Sign(velocity.X) * this._frameExtra * 2), 0.0f); dust.noGravity = true; - if (this._type == 47) - dust.noLightEmittence = true; dust.scale = (float) (1.0 + (double) Main.rand.NextFloat() * 0.800000011920929); dust.fadeIn = Main.rand.NextFloat() * 2f; dust.shader = GameShaders.Armor.GetSecondaryShader(mountedPlayer.cMount, mountedPlayer); } } } - if (this._type == 10 & flag1) + if (flag1) { Dust dust = Main.dust[Dust.NewDust(mountedPlayer.position, mountedPlayer.width, mountedPlayer.height, Utils.SelectRandom(Main.rand, 176, 177, 179))]; dust.velocity = Vector2.Zero; @@ -2340,20 +1467,6 @@ namespace Terraria dust.scale = (float) (0.5 + (double) Main.rand.NextFloat() * 0.800000011920929); dust.fadeIn = (float) (1.0 + (double) Main.rand.NextFloat() * 2.0); dust.shader = GameShaders.Armor.GetSecondaryShader(mountedPlayer.cMount, mountedPlayer); - } - if (this._type == 47 & flag1 && (double) velocity.Y == 0.0) - { - int i = (int) mountedPlayer.Center.X / 16; - int num = (int) ((double) mountedPlayer.position.Y + (double) mountedPlayer.height - 1.0) / 16; - Tile tile = Main.tile[i, num + 1]; - if (tile != null && tile.active() && tile.liquid == (byte) 0 && WorldGen.SolidTileAllowBottomSlope(i, num + 1)) - { - ParticleOrchestrator.RequestParticleSpawn(true, ParticleOrchestraType.WallOfFleshGoatMountFlames, new ParticleOrchestraSettings() - { - PositionInWorld = new Vector2((float) (i * 16 + 8), (float) (num * 16 + 16)) - }, new int?(mountedPlayer.whoAmI)); - break; - } break; } break; @@ -2407,209 +1520,6 @@ namespace Terraria break; } break; - case 17: - this.UpdateFrame_GolfCart(mountedPlayer, state, velocity); - break; - case 39: - ++this._frameExtraCounter; - if ((double) this._frameExtraCounter > 6.0) - { - this._frameExtraCounter = 0.0f; - ++this._frameExtra; - if (this._frameExtra > 5) - { - this._frameExtra = 0; - break; - } - break; - } - break; - case 43: - if ((double) mountedPlayer.velocity.Y == 0.0) - mountedPlayer.isPerformingPogostickTricks = false; - if (mountedPlayer.isPerformingPogostickTricks) - mountedPlayer.fullRotation += (float) ((double) mountedPlayer.direction * 6.28318548202515 / 30.0); - else - mountedPlayer.fullRotation = (float) ((double) Math.Sign(mountedPlayer.velocity.X) * (double) Utils.GetLerpValue(0.0f, this.RunSpeed - 0.2f, Math.Abs(mountedPlayer.velocity.X), true) * 0.400000005960464); - mountedPlayer.fullRotationOrigin = new Vector2((float) (mountedPlayer.width / 2), (float) mountedPlayer.height * 0.8f); - break; - case 44: - state = 1; - bool flag3 = (double) Math.Abs(velocity.X) > (double) this.DashSpeed - (double) this.RunSpeed / 4.0; - if (this._mountSpecificData == null) - this._mountSpecificData = (object) false; - bool mountSpecificData1 = (bool) this._mountSpecificData; - if (mountSpecificData1 && !flag3) - this._mountSpecificData = (object) false; - else if (!mountSpecificData1 & flag3) - { - this._mountSpecificData = (object) true; - Vector2 Position = mountedPlayer.Center + new Vector2((float) (mountedPlayer.width * mountedPlayer.direction), 0.0f); - Vector2 vector2_3 = new Vector2(40f, 30f); - float num13 = 6.283185f * Main.rand.NextFloat(); - for (float num14 = 0.0f; (double) num14 < 20.0; ++num14) - { - Dust dust = Main.dust[Dust.NewDust(Position, 0, 0, 228)]; - Vector2 vector2_4 = Vector2.UnitY.RotatedBy((double) num14 * 6.28318548202515 / 20.0 + (double) num13) * 0.8f; - dust.position = Position + vector2_4 * vector2_3; - dust.velocity = vector2_4 + new Vector2(this.RunSpeed - (float) Math.Sign(velocity.Length()), 0.0f); - if ((double) velocity.X > 0.0) - dust.velocity.X *= -1f; - if (Main.rand.Next(2) == 0) - dust.velocity *= 0.5f; - dust.noGravity = true; - dust.scale = (float) (1.5 + (double) Main.rand.NextFloat() * 0.800000011920929); - dust.fadeIn = 0.0f; - dust.shader = GameShaders.Armor.GetSecondaryShader(mountedPlayer.cMount, mountedPlayer); - } - } - int maxValue = (int) this.RunSpeed - (int) Math.Abs(velocity.X); - if (maxValue <= 0) - maxValue = 1; - if (Main.rand.Next(maxValue) == 0) - { - int Height = 22; - int num15 = mountedPlayer.width / 2 + 10; - Vector2 bottom = mountedPlayer.Bottom; - bottom.X -= (float) num15; - bottom.Y -= (float) (Height - 6); - Dust dust = Main.dust[Dust.NewDust(bottom, num15 * 2, Height, 228)]; - dust.velocity = Vector2.Zero; - dust.noGravity = true; - dust.noLight = true; - dust.scale = (float) (0.25 + (double) Main.rand.NextFloat() * 0.800000011920929); - dust.fadeIn = (float) (0.5 + (double) Main.rand.NextFloat() * 2.0); - dust.shader = GameShaders.Armor.GetSecondaryShader(mountedPlayer.cMount, mountedPlayer); - break; - } - break; - case 45: - bool flag4 = (double) Math.Abs(velocity.X) > (double) this.DashSpeed * 0.899999976158142; - if (this._mountSpecificData == null) - this._mountSpecificData = (object) false; - bool mountSpecificData2 = (bool) this._mountSpecificData; - if (mountSpecificData2 && !flag4) - this._mountSpecificData = (object) false; - else if (!mountSpecificData2 & flag4) - { - this._mountSpecificData = (object) true; - Vector2 Position = mountedPlayer.Center + new Vector2((float) (mountedPlayer.width * mountedPlayer.direction), 0.0f); - Vector2 vector2_5 = new Vector2(40f, 30f); - float num16 = 6.283185f * Main.rand.NextFloat(); - for (float num17 = 0.0f; (double) num17 < 20.0; ++num17) - { - Dust dust = Main.dust[Dust.NewDust(Position, 0, 0, 6)]; - Vector2 vector2_6 = Vector2.UnitY.RotatedBy((double) num17 * 6.28318548202515 / 20.0 + (double) num16) * 0.8f; - dust.position = Position + vector2_6 * vector2_5; - dust.velocity = vector2_6 + new Vector2(this.RunSpeed - (float) Math.Sign(velocity.Length()), 0.0f); - if ((double) velocity.X > 0.0) - dust.velocity.X *= -1f; - if (Main.rand.Next(2) == 0) - dust.velocity *= 0.5f; - dust.noGravity = true; - dust.scale = (float) (1.5 + (double) Main.rand.NextFloat() * 0.800000011920929); - dust.fadeIn = 0.0f; - dust.shader = GameShaders.Armor.GetSecondaryShader(mountedPlayer.cMount, mountedPlayer); - } - } - if (flag4) - { - int Type = (int) Utils.SelectRandom(Main.rand, (short) 6, (short) 6, (short) 31); - int num18 = 6; - Dust dust = Main.dust[Dust.NewDust(mountedPlayer.Center - new Vector2((float) num18, (float) (num18 - 12)), num18 * 2, num18 * 2, Type)]; - dust.velocity = mountedPlayer.velocity * 0.1f; - if (Main.rand.Next(2) == 0) - dust.noGravity = true; - dust.scale = (float) (0.699999988079071 + (double) Main.rand.NextFloat() * 0.800000011920929); - if (Main.rand.Next(3) == 0) - dust.fadeIn = 0.1f; - if (Type == 31) - { - dust.noGravity = true; - dust.scale *= 1.5f; - dust.fadeIn = 0.2f; - } - dust.shader = GameShaders.Armor.GetSecondaryShader(mountedPlayer.cMount, mountedPlayer); - break; - } - break; - case 46: - if (state != 0) - state = 1; - if (!this._aiming) - { - if (state == 0) - { - this._frameExtra = 12; - this._frameExtraCounter = 0.0f; - break; - } - if (this._frameExtra < 12) - this._frameExtra = 12; - this._frameExtraCounter += Math.Abs(velocity.X); - if ((double) this._frameExtraCounter >= 8.0) - { - this._frameExtraCounter = 0.0f; - ++this._frameExtra; - if (this._frameExtra >= 24) - { - this._frameExtra = 12; - break; - } - break; - } - break; - } - if (this._frameExtra < 24) - this._frameExtra = 24; - ++this._frameExtraCounter; - if ((double) this._frameExtraCounter >= 3.0) - { - this._frameExtraCounter = 0.0f; - ++this._frameExtra; - if (this._frameExtra >= 27) - { - this._frameExtra = 24; - break; - } - break; - } - break; - case 48: - state = 1; - break; - case 49: - if (state != 4 && mountedPlayer.wet) - this._frameState = state = 4; - double num19 = (double) velocity.Length(); - float num20 = mountedPlayer.velocity.Y * 0.05f; - if (mountedPlayer.direction < 0) - num20 *= -1f; - mountedPlayer.fullRotation = num20; - mountedPlayer.fullRotationOrigin = new Vector2((float) (mountedPlayer.width / 2), (float) (mountedPlayer.height / 2)); - break; - case 50: - if ((double) mountedPlayer.velocity.Y == 0.0) - { - this._frameExtraCounter = 0.0f; - this._frameExtra = 3; - break; - } - ++this._frameExtraCounter; - if (this.Flight()) - ++this._frameExtraCounter; - if ((double) this._frameExtraCounter > 7.0) - { - this._frameExtraCounter = 0.0f; - ++this._frameExtra; - if (this._frameExtra > 3) - { - this._frameExtra = 0; - break; - } - break; - } - break; } switch (state) { @@ -2630,11 +1540,7 @@ namespace Terraria } } else if (this._idleTime == 0) - { this._idleTimeNext = Main.rand.Next(900, 1500); - if (this._type == 17) - this._idleTimeNext = Main.rand.Next(120, 300); - } ++this._idleTime; } ++this._frameCounter; @@ -2643,9 +1549,8 @@ namespace Terraria float idleFrameDelay = (float) this._data.idleFrameDelay; if (this._type == 5) idleFrameDelay *= (float) (2.0 - 1.0 * (double) this._fatigue / (double) this._fatigueMax); - int num21 = (int) ((double) (this._idleTime - this._idleTimeNext) / (double) idleFrameDelay); - int idleFrameCount = this._data.idleFrameCount; - if (num21 >= idleFrameCount) + int num13 = (int) ((double) (this._idleTime - this._idleTimeNext) / (double) idleFrameDelay); + if (num13 >= this._data.idleFrameCount) { if (this._data.idleFrameLoop) { @@ -2660,13 +1565,10 @@ namespace Terraria } } else - this._frame = this._data.idleFrameStart + num21; - if (this._type == 5) - this._frameExtra = this._frame; - if (this._type != 17) + this._frame = this._data.idleFrameStart + num13; + if (this._type != 5) break; this._frameExtra = this._frame; - this._frame = 0; break; } if ((double) this._frameCounter > (double) this._data.standingFrameDelay) @@ -2679,34 +1581,24 @@ namespace Terraria this._frame = this._data.standingFrameStart; break; case 1: - float num22; + float num14; switch (this._type) { case 6: - num22 = this._flipDraw ? velocity.X : -velocity.X; + num14 = this._flipDraw ? velocity.X : -velocity.X; break; case 9: - case 46: - num22 = !this._flipDraw ? Math.Abs(velocity.X) : -Math.Abs(velocity.X); + num14 = !this._flipDraw ? Math.Abs(velocity.X) : -Math.Abs(velocity.X); break; case 13: - num22 = this._flipDraw ? velocity.X : -velocity.X; - break; - case 44: - num22 = Math.Max(1f, Math.Abs(velocity.X) * 0.25f); - break; - case 48: - num22 = Math.Max(0.5f, velocity.Length() * 0.125f); - break; - case 50: - num22 = Math.Abs(velocity.X) * 0.5f; + num14 = this._flipDraw ? velocity.X : -velocity.X; break; default: - num22 = Math.Abs(velocity.X); + num14 = Math.Abs(velocity.X); break; } - this._frameCounter += num22; - if ((double) num22 >= 0.0) + this._frameCounter += num14; + if ((double) num14 >= 0.0) { if ((double) this._frameCounter > (double) this._data.runningFrameDelay) { @@ -2746,31 +1638,17 @@ namespace Terraria this._frame = 6; break; } - if (this._type == 5) + if (this._type != 5) + break; + this._frameExtraCounter += (float) (6.0 - 4.0 * (double) (this._fatigue / this._fatigueMax)); + if ((double) this._frameExtraCounter > (double) this._data.flyingFrameDelay) { - this._frameExtraCounter += (float) (6.0 - 4.0 * (double) (this._fatigue / this._fatigueMax)); - if ((double) this._frameExtraCounter > (double) this._data.flyingFrameDelay) - { - ++this._frameExtra; - this._frameExtraCounter -= (float) this._data.flyingFrameDelay; - } - if (this._frameExtra >= this._data.flyingFrameStart && this._frameExtra < this._data.flyingFrameStart + this._data.flyingFrameCount) - break; - this._frameExtra = this._data.flyingFrameStart; - break; + ++this._frameExtra; + this._frameExtraCounter -= (float) this._data.flyingFrameDelay; } - if (this._type != 23) + if (this._frameExtra >= this._data.flyingFrameStart && this._frameExtra < this._data.flyingFrameStart + this._data.flyingFrameCount) break; - float num23 = mountedPlayer.velocity.Length(); - if ((double) num23 < 1.0) - { - this._frame = 0; - this._frameCounter = 0.0f; - break; - } - if ((double) num23 <= 5.0) - break; - ++this._frameCounter; + this._frameExtra = this._data.flyingFrameStart; break; case 3: ++this._frameCounter; @@ -2790,31 +1668,29 @@ namespace Terraria this._frameCounter -= (float) this._data.swimFrameDelay; ++this._frame; } - if (this._frame < this._data.swimFrameStart || this._frame >= this._data.swimFrameStart + this._data.swimFrameCount) - this._frame = this._data.swimFrameStart; - if (this.Type != 37 || (double) velocity.X != 0.0) + if (this._frame >= this._data.swimFrameStart && this._frame < this._data.swimFrameStart + this._data.swimFrameCount) break; - this._frame = 4; + this._frame = this._data.swimFrameStart; break; case 5: - float num24; + float num15; switch (this._type) { case 6: - num24 = this._flipDraw ? velocity.X : -velocity.X; + num15 = this._flipDraw ? velocity.X : -velocity.X; break; case 9: - num24 = !this._flipDraw ? Math.Abs(velocity.X) : -Math.Abs(velocity.X); + num15 = !this._flipDraw ? Math.Abs(velocity.X) : -Math.Abs(velocity.X); break; case 13: - num24 = this._flipDraw ? velocity.X : -velocity.X; + num15 = this._flipDraw ? velocity.X : -velocity.X; break; default: - num24 = Math.Abs(velocity.X); + num15 = Math.Abs(velocity.X); break; } - this._frameCounter += num24; - if ((double) num24 >= 0.0) + this._frameCounter += num15; + if ((double) num15 >= 0.0) { if ((double) this._frameCounter > (double) this._data.dashingFrameDelay) { @@ -2838,228 +1714,6 @@ namespace Terraria } } - public void TryBeginningFlight(Player mountedPlayer, int state) - { - if (this._frameState == state || (state == 2 ? 1 : (state == 3 ? 1 : 0)) == 0 || !this.CanHover() || mountedPlayer.controlUp || mountedPlayer.controlDown || mountedPlayer.controlJump) - return; - Vector2 Velocity = Vector2.UnitY * mountedPlayer.gravDir; - if ((double) Collision.TileCollision(mountedPlayer.position + new Vector2(0.0f, -1f / 1000f), Velocity, mountedPlayer.width, mountedPlayer.height, gravDir: ((int) mountedPlayer.gravDir)).Y == 0.0) - return; - if (this.DoesHoverIgnoresFatigue()) - { - mountedPlayer.position.Y += -1f / 1000f; - } - else - { - float num = mountedPlayer.gravity * mountedPlayer.gravDir; - mountedPlayer.position.Y -= mountedPlayer.velocity.Y; - mountedPlayer.velocity.Y -= num; - } - } - - public int GetIntendedGroundedFrame(Player mountedPlayer) => ((double) mountedPlayer.velocity.X == 0.0 ? 1 : (!mountedPlayer.slippy && !mountedPlayer.slippy2 && !mountedPlayer.windPushed || mountedPlayer.controlLeft ? 0 : (!mountedPlayer.controlRight ? 1 : 0))) != 0 ? 0 : 1; - - public void TryLanding(Player mountedPlayer) - { - if ((this._frameState == 3 ? 1 : (this._frameState == 2 ? 1 : 0)) == 0 || mountedPlayer.controlUp || mountedPlayer.controlDown || mountedPlayer.controlJump) - return; - Vector2 Velocity = Vector2.UnitY * mountedPlayer.gravDir * 4f; - if ((double) Collision.TileCollision(mountedPlayer.position, Velocity, mountedPlayer.width, mountedPlayer.height, gravDir: ((int) mountedPlayer.gravDir)).Y != 0.0) - return; - this.UpdateFrame(mountedPlayer, this.GetIntendedGroundedFrame(mountedPlayer), mountedPlayer.velocity); - } - - private void UpdateFrame_GolfCart(Player mountedPlayer, int state, Vector2 velocity) - { - if (state != 2) - { - if ((double) this._frameExtraCounter != 0.0 || this._frameExtra != 0) - { - if ((double) this._frameExtraCounter == -1.0) - { - this._frameExtraCounter = 0.0f; - this._frameExtra = 1; - } - if ((double) ++this._frameExtraCounter >= 6.0) - { - this._frameExtraCounter = 0.0f; - if (this._frameExtra > 0) - --this._frameExtra; - } - } - else - { - this._frameExtra = 0; - this._frameExtraCounter = 0.0f; - } - } - else if ((double) velocity.Y >= 0.0) - { - if (this._frameExtra < 1) - this._frameExtra = 1; - if (this._frameExtra == 2) - this._frameExtraCounter = -1f; - else if ((double) ++this._frameExtraCounter >= 6.0) - { - this._frameExtraCounter = 0.0f; - if (this._frameExtra < 2) - ++this._frameExtra; - } - } - if ((state == 2 || state == 0 || state == 3 ? 0 : (state != 4 ? 1 : 0)) != 0) - { - Mount.EmitGolfCartWheelDust(mountedPlayer, mountedPlayer.Bottom + new Vector2((float) (mountedPlayer.direction * -20), 0.0f)); - Mount.EmitGolfCartWheelDust(mountedPlayer, mountedPlayer.Bottom + new Vector2((float) (mountedPlayer.direction * 20), 0.0f)); - } - Mount.EmitGolfCartlight(mountedPlayer.Bottom + new Vector2((float) (mountedPlayer.direction * 40), -20f), mountedPlayer.direction); - } - - private static void EmitGolfCartSmoke(Player mountedPlayer, bool rushing) - { - Vector2 Position = mountedPlayer.Bottom + new Vector2((float) (-mountedPlayer.direction * 34), (float) (-(double) mountedPlayer.gravDir * 12.0)); - Dust dust = Dust.NewDustDirect(Position, 0, 0, 31, (float) -mountedPlayer.direction, (float) (-(double) mountedPlayer.gravDir * 0.239999994635582), 100); - dust.position = Position; - dust.velocity *= 0.1f; - dust.velocity += new Vector2((float) -mountedPlayer.direction, (float) (-(double) mountedPlayer.gravDir * 0.25)); - dust.scale = 0.5f; - if ((double) mountedPlayer.velocity.X != 0.0) - dust.velocity += new Vector2((float) Math.Sign(mountedPlayer.velocity.X) * 1.3f, 0.0f); - if (!rushing) - return; - dust.fadeIn = 0.8f; - } - - private static void EmitGolfCartlight(Vector2 worldLocation, int playerDirection) - { - float num1 = 0.0f; - if (playerDirection == -1) - num1 = 3.141593f; - float num2 = (float) Math.PI / 32f; - int num3 = 5; - float num4 = 200f; - DelegateMethods.v2_1 = worldLocation.ToTileCoordinates().ToVector2(); - DelegateMethods.f_1 = num4 / 16f; - DelegateMethods.v3_1 = new Vector3(0.7f, 0.7f, 0.7f); - for (float num5 = 0.0f; (double) num5 < (double) num3; ++num5) - { - Vector2 rotationVector2 = (num1 + num2 * (num5 - (float) (num3 / 2))).ToRotationVector2(); - Utils.PlotTileLine(worldLocation, worldLocation + rotationVector2 * num4, 8f, new Utils.TileActionAttempt(DelegateMethods.CastLightOpen_StopForSolids_ScaleWithDistance)); - } - } - - private static bool ShouldGolfCartEmitLight() => true; - - private static void EmitGolfCartWheelDust(Player mountedPlayer, Vector2 legSpot) - { - if (Main.rand.Next(5) != 0) - return; - Point tileCoordinates = (legSpot + new Vector2(0.0f, mountedPlayer.gravDir * 2f)).ToTileCoordinates(); - if (!WorldGen.InWorld(tileCoordinates.X, tileCoordinates.Y, 10)) - return; - Tile tileSafely = Framing.GetTileSafely(tileCoordinates.X, tileCoordinates.Y); - if (!WorldGen.SolidTile(tileCoordinates)) - return; - int num = WorldGen.KillTile_GetTileDustAmount(true, tileSafely); - if (num > 1) - num = 1; - Vector2 vector2 = new Vector2((float) -mountedPlayer.direction, (float) (-(double) mountedPlayer.gravDir * 1.0)); - for (int index = 0; index < num; ++index) - { - Dust dust = Main.dust[WorldGen.KillTile_MakeTileDust(tileCoordinates.X, tileCoordinates.Y, tileSafely)]; - dust.velocity *= 0.2f; - dust.velocity += vector2; - dust.position = legSpot; - dust.scale *= 0.8f; - dust.fadeIn *= 0.8f; - } - } - - private void DoGemMinecartEffect(Player mountedPlayer, int dustType) - { - if (Main.rand.Next(10) != 0) - return; - Vector2 vector2_1 = Main.rand.NextVector2Square(-1f, 1f) * new Vector2(22f, 10f); - Vector2 vector2_2 = new Vector2(0.0f, 10f) * mountedPlayer.Directions; - Vector2 pos = mountedPlayer.Center + vector2_2 + vector2_1; - Dust dust = Dust.NewDustPerfect(mountedPlayer.RotatedRelativePoint(pos), dustType); - dust.noGravity = true; - dust.fadeIn = 0.6f; - dust.scale = 0.4f; - dust.velocity *= 0.25f; - dust.shader = GameShaders.Armor.GetSecondaryShader(mountedPlayer.cMount, mountedPlayer); - } - - private void DoSteamMinecartEffect(Player mountedPlayer, int dustType) - { - float num = Math.Abs(mountedPlayer.velocity.X); - if ((double) num < 1.0 || (double) num < 6.0 && this._frame != 0) - return; - Vector2 vector2_1 = Main.rand.NextVector2Square(-1f, 1f) * new Vector2(3f, 3f); - Vector2 vector2_2 = new Vector2(-10f, -4f) * mountedPlayer.Directions; - Vector2 pos = mountedPlayer.Center + vector2_2 + vector2_1; - Dust dust = Dust.NewDustPerfect(mountedPlayer.RotatedRelativePoint(pos), dustType); - dust.noGravity = true; - dust.fadeIn = 0.6f; - dust.scale = 1.8f; - dust.velocity *= 0.25f; - dust.velocity.Y -= 2f; - dust.shader = GameShaders.Armor.GetSecondaryShader(mountedPlayer.cMount, mountedPlayer); - } - - private void DoExhaustMinecartEffect(Player mountedPlayer, int dustType) - { - float num1 = mountedPlayer.velocity.Length(); - if ((double) num1 < 1.0 && Main.rand.Next(4) != 0) - return; - int num2 = 1 + (int) num1 / 6; - while (num2 > 0) - { - --num2; - Vector2 vector2_1 = Main.rand.NextVector2Square(-1f, 1f) * new Vector2(3f, 3f); - Vector2 vector2_2 = new Vector2(-18f, 20f) * mountedPlayer.Directions; - if ((double) num1 > 6.0) - vector2_2.X += (float) (4 * mountedPlayer.direction); - if (num2 > 0) - vector2_2 += mountedPlayer.velocity * (float) (num2 / 3); - Vector2 pos = mountedPlayer.Center + vector2_2 + vector2_1; - Dust dust = Dust.NewDustPerfect(mountedPlayer.RotatedRelativePoint(pos), dustType); - dust.noGravity = true; - dust.fadeIn = 0.6f; - dust.scale = 1.2f; - dust.velocity *= 0.2f; - if ((double) num1 < 1.0) - dust.velocity.X -= 0.5f * (float) mountedPlayer.direction; - dust.shader = GameShaders.Armor.GetSecondaryShader(mountedPlayer.cMount, mountedPlayer); - } - } - - private void DoConfettiMinecartEffect(Player mountedPlayer) - { - float num1 = mountedPlayer.velocity.Length(); - if ((double) num1 < 1.0 && Main.rand.Next(6) != 0 || (double) num1 < 3.0 && Main.rand.Next(3) != 0) - return; - int num2 = 1 + (int) num1 / 6; - while (num2 > 0) - { - --num2; - float num3 = Main.rand.NextFloat() * 2f; - Vector2 vector2_1 = Main.rand.NextVector2Square(-1f, 1f) * new Vector2(3f, 8f); - Vector2 vector2_2 = new Vector2(-18f, 4f) * mountedPlayer.Directions; - vector2_2.X += (float) ((double) num1 * (double) mountedPlayer.direction * 0.5 + (double) (mountedPlayer.direction * num2) * (double) num3); - if (num2 > 0) - vector2_2 += mountedPlayer.velocity * (float) (num2 / 3); - Vector2 pos = mountedPlayer.Center + vector2_2 + vector2_1; - Dust dust = Dust.NewDustPerfect(mountedPlayer.RotatedRelativePoint(pos), 139 + Main.rand.Next(4)); - dust.noGravity = true; - dust.fadeIn = 0.6f; - dust.scale = (float) (0.5 + (double) num3 / 2.0); - dust.velocity *= 0.2f; - if ((double) num1 < 1.0) - dust.velocity.X -= 0.5f * (float) mountedPlayer.direction; - dust.shader = GameShaders.Armor.GetSecondaryShader(mountedPlayer.cMount, mountedPlayer); - } - } - public void UpdateEffects(Player mountedPlayer) { mountedPlayer.autoJump = this.AutoJump; @@ -3071,32 +1725,28 @@ namespace Terraria this._abilityActive = false; break; case 9: - case 46: - if (this._type == 46) - mountedPlayer.hasJumpOption_Santank = true; Vector2 center = mountedPlayer.Center; Vector2 mousePosition = center; bool flag1 = false; float num1 = 1500f; - float num2 = 500f; for (int index = 0; index < 200; ++index) { NPC npc = Main.npc[index]; if (npc.CanBeChasedBy((object) this)) { Vector2 v = npc.Center - center; - float num3 = v.Length(); - if ((double) num3 < (double) num2 && ((double) Vector2.Distance(mousePosition, center) > (double) num3 && (double) num3 < (double) num1 || !flag1)) + float num2 = v.Length(); + if ((double) Vector2.Distance(mousePosition, center) > (double) num2 && (double) num2 < (double) num1 || !flag1) { bool flag2 = true; - float num4 = Math.Abs(v.ToRotation()); - if (mountedPlayer.direction == 1 && (double) num4 > 1.04719759490799) + float num3 = Math.Abs(v.ToRotation()); + if (mountedPlayer.direction == 1 && (double) num3 > 1.04719759490799) flag2 = false; - else if (mountedPlayer.direction == -1 && (double) num4 < 2.09439514610459) + else if (mountedPlayer.direction == -1 && (double) num3 < 2.09439514610459) flag2 = false; if (Collision.CanHitLine(center, 0, 0, npc.position, npc.width, npc.height) & flag2) { - num1 = num3; + num1 = num2; mousePosition = npc.Center; flag1 = true; } @@ -3105,14 +1755,10 @@ namespace Terraria } if (flag1) { - bool flag3 = this._abilityCooldown == 0; - if (this._type == 46) - flag3 = this._abilityCooldown % 10 == 0; - if (flag3 && mountedPlayer.whoAmI == Main.myPlayer) + if (this._abilityCooldown == 0 && mountedPlayer.whoAmI == Main.myPlayer) { this.AimAbility(mountedPlayer, mousePosition); - if (this._abilityCooldown == 0) - this.StopAbilityCharge(); + this.StopAbilityCharge(); this.UseAbility(mountedPlayer, mousePosition, false); break; } @@ -3124,7 +1770,7 @@ namespace Terraria this.ResetHeadPosition(); break; case 10: - mountedPlayer.hasJumpOption_Unicorn = true; + mountedPlayer.doubleJumpUnicorn = true; if ((double) Math.Abs(mountedPlayer.velocity.X) > (double) mountedPlayer.mount.DashSpeed - (double) mountedPlayer.mount.RunSpeed / 2.0) mountedPlayer.noKnockback = true; if (mountedPlayer.itemAnimation <= 0 || mountedPlayer.inventory[mountedPlayer.selectedItem].type != 1260) @@ -3133,39 +1779,39 @@ namespace Terraria break; case 11: Vector3 vector3_1 = new Vector3(0.4f, 0.12f, 0.15f); - float num5 = (float) (1.0 + (double) Math.Abs(mountedPlayer.velocity.X) / (double) this.RunSpeed * 2.5); - mountedPlayer.statDefense += (int) (2.0 * (double) num5); - int num6 = Math.Sign(mountedPlayer.velocity.X); - if (num6 == 0) - num6 = mountedPlayer.direction; + float num4 = (float) (1.0 + (double) Math.Abs(mountedPlayer.velocity.X) / (double) this.RunSpeed * 2.5); + mountedPlayer.statDefense += (int) (2.0 * (double) num4); + int num5 = Math.Sign(mountedPlayer.velocity.X); + if (num5 == 0) + num5 = mountedPlayer.direction; if (Main.netMode != 2) { - Vector3 vector3_2 = vector3_1 * num5; + Vector3 vector3_2 = vector3_1 * num4; Lighting.AddLight(mountedPlayer.Center, vector3_2.X, vector3_2.Y, vector3_2.Z); Lighting.AddLight(mountedPlayer.Top, vector3_2.X, vector3_2.Y, vector3_2.Z); Lighting.AddLight(mountedPlayer.Bottom, vector3_2.X, vector3_2.Y, vector3_2.Z); Lighting.AddLight(mountedPlayer.Left, vector3_2.X, vector3_2.Y, vector3_2.Z); Lighting.AddLight(mountedPlayer.Right, vector3_2.X, vector3_2.Y, vector3_2.Z); - float num7 = -24f; - if (mountedPlayer.direction != num6) - num7 = -22f; - if (num6 == -1) - ++num7; - Vector2 vector2_1 = new Vector2(num7 * (float) num6, -19f).RotatedBy((double) mountedPlayer.fullRotation); + float num6 = -24f; + if (mountedPlayer.direction != num5) + num6 = -22f; + if (num5 == -1) + ++num6; + Vector2 vector2_1 = new Vector2(num6 * (float) num5, -19f).RotatedBy((double) mountedPlayer.fullRotation); Vector2 vector2_2 = new Vector2(MathHelper.Lerp(0.0f, -8f, mountedPlayer.fullRotation / 0.7853982f), MathHelper.Lerp(0.0f, 2f, Math.Abs(mountedPlayer.fullRotation / 0.7853982f))).RotatedBy((double) mountedPlayer.fullRotation); - if (num6 == Math.Sign(mountedPlayer.fullRotation)) + if (num5 == Math.Sign(mountedPlayer.fullRotation)) vector2_2 *= MathHelper.Lerp(1f, 0.6f, Math.Abs(mountedPlayer.fullRotation / 0.7853982f)); Vector2 vector2_3 = mountedPlayer.Bottom + vector2_1 + vector2_2; Vector2 vector2_4 = mountedPlayer.oldPosition + mountedPlayer.Size * new Vector2(0.5f, 1f) + vector2_1 + vector2_2; if ((double) Vector2.Distance(vector2_3, vector2_4) > 3.0) { - int num8 = (int) Vector2.Distance(vector2_3, vector2_4) / 3; + int num7 = (int) Vector2.Distance(vector2_3, vector2_4) / 3; if ((double) Vector2.Distance(vector2_3, vector2_4) % 3.0 != 0.0) - ++num8; - for (float num9 = 1f; (double) num9 <= (double) num8; ++num9) + ++num7; + for (float num8 = 1f; (double) num8 <= (double) num7; ++num8) { Dust dust = Main.dust[Dust.NewDust(mountedPlayer.Center, 0, 0, 182)]; - dust.position = Vector2.Lerp(vector2_4, vector2_3, num9 / (float) num8); + dust.position = Vector2.Lerp(vector2_4, vector2_3, num8 / (float) num7); dust.noGravity = true; dust.velocity = Vector2.Zero; dust.customData = (object) mountedPlayer; @@ -3185,20 +1831,20 @@ namespace Terraria if (mountedPlayer.whoAmI != Main.myPlayer || (double) mountedPlayer.velocity.X == 0.0) break; Vector2 minecartMechPoint = Mount.GetMinecartMechPoint(mountedPlayer, 20, -19); - int num10 = 60; - int num11 = 0; - float num12 = 0.0f; + int num9 = 60; + int num10 = 0; + float num11 = 0.0f; for (int index1 = 0; index1 < 200; ++index1) { NPC npc = Main.npc[index1]; - if (npc.active && npc.immune[mountedPlayer.whoAmI] <= 0 && !npc.dontTakeDamage && (double) npc.Distance(minecartMechPoint) < 300.0 && npc.CanBeChasedBy((object) mountedPlayer) && Collision.CanHitLine(npc.position, npc.width, npc.height, minecartMechPoint, 0, 0) && (double) Math.Abs(MathHelper.WrapAngle(MathHelper.WrapAngle(npc.AngleFrom(minecartMechPoint)) - MathHelper.WrapAngle((double) mountedPlayer.fullRotation + (double) num6 == -1.0 ? 3.141593f : 0.0f))) < 0.785398185253143) + if (npc.active && npc.immune[mountedPlayer.whoAmI] <= 0 && !npc.dontTakeDamage && (double) npc.Distance(minecartMechPoint) < 300.0 && npc.CanBeChasedBy((object) mountedPlayer) && Collision.CanHitLine(npc.position, npc.width, npc.height, minecartMechPoint, 0, 0) && (double) Math.Abs(MathHelper.WrapAngle(MathHelper.WrapAngle(npc.AngleFrom(minecartMechPoint)) - MathHelper.WrapAngle((double) mountedPlayer.fullRotation + (double) num5 == -1.0 ? 3.141593f : 0.0f))) < 0.785398185253143) { Vector2 v = npc.position + npc.Size * Utils.RandomVector2(Main.rand, 0.0f, 1f) - minecartMechPoint; - num12 += v.ToRotation(); - ++num11; + num11 += v.ToRotation(); + ++num10; int index2 = Projectile.NewProjectile(minecartMechPoint.X, minecartMechPoint.Y, v.X, v.Y, 591, 0, 0.0f, mountedPlayer.whoAmI, (float) mountedPlayer.whoAmI); Main.projectile[index2].Center = npc.Center; - Main.projectile[index2].damage = num10; + Main.projectile[index2].damage = num9; Main.projectile[index2].Damage(); Main.projectile[index2].damage = 0; Main.projectile[index2].Center = minecartMechPoint; @@ -3218,143 +1864,13 @@ namespace Terraria mountedPlayer.rangedDamage += 0.15f; mountedPlayer.magicDamage += 0.15f; mountedPlayer.minionDamage += 0.15f; + mountedPlayer.thrownDamage += 0.15f; } if (mountedPlayer.statLife <= mountedPlayer.statLifeMax2 / 2) mountedPlayer.MountFishronSpecialCounter = 60f; - if (!mountedPlayer.wet && (!Main.raining || !WorldGen.InAPlaceWithWind(mountedPlayer.position, mountedPlayer.width, mountedPlayer.height))) + if (!mountedPlayer.wet) break; - mountedPlayer.MountFishronSpecialCounter = 420f; - break; - case 14: - mountedPlayer.hasJumpOption_Basilisk = true; - if ((double) Math.Abs(mountedPlayer.velocity.X) <= (double) mountedPlayer.mount.DashSpeed - (double) mountedPlayer.mount.RunSpeed / 2.0) - break; - mountedPlayer.noKnockback = true; - break; - case 16: - mountedPlayer.ignoreWater = true; - break; - case 22: - mountedPlayer.lavaMax += 420; - Vector2 pos1 = mountedPlayer.Center + new Vector2(20f, 10f) * mountedPlayer.Directions; - Vector2 pos2 = pos1 + mountedPlayer.velocity; - Vector2 pos3 = pos1 + new Vector2(-1f, -0.5f) * mountedPlayer.Directions; - Vector2 vector2_5 = mountedPlayer.RotatedRelativePoint(pos1); - Vector2 vector2_6 = mountedPlayer.RotatedRelativePoint(pos2); - Vector2 vector2_7 = mountedPlayer.RotatedRelativePoint(pos3); - Vector2 vector2_8 = mountedPlayer.shadowPos[2] - mountedPlayer.position + vector2_5; - Vector2 vector2_9 = vector2_6 - vector2_5; - Vector2 vector2_10 = vector2_5 + vector2_9; - Vector2 vector2_11 = vector2_8 + vector2_9; - Vector2 vector2_12 = vector2_6 - vector2_7; - float num13 = MathHelper.Clamp(mountedPlayer.velocity.Length() / 5f, 0.0f, 1f); - for (float amount = 0.0f; (double) amount <= 1.0; amount += 0.1f) - { - if ((double) Main.rand.NextFloat() >= (double) num13) - { - Dust dust = Dust.NewDustPerfect(Vector2.Lerp(vector2_11, vector2_10, amount), 65, new Vector2?(Main.rand.NextVector2Circular(0.5f, 0.5f) * num13)); - dust.scale = 0.6f; - dust.fadeIn = 0.0f; - dust.customData = (object) mountedPlayer; - dust.velocity *= -1f; - dust.noGravity = true; - dust.velocity -= vector2_12; - if (Main.rand.Next(10) == 0) - { - dust.fadeIn = 1.3f; - dust.velocity = Main.rand.NextVector2Circular(3f, 3f) * num13; - } - } - } - break; - case 23: - Vector2 pos4 = mountedPlayer.Center + this.GetWitchBroomTrinketOriginOffset(mountedPlayer) + (this.GetWitchBroomTrinketRotation(mountedPlayer) + 1.570796f).ToRotationVector2() * 11f; - Vector3 rgb = new Vector3(1f, 0.75f, 0.5f) * 0.85f; - Vector2 vector2_13 = mountedPlayer.RotatedRelativePoint(pos4); - Lighting.AddLight(vector2_13, rgb); - if (Main.rand.Next(45) == 0) - { - Vector2 vector2_14 = Main.rand.NextVector2Circular(4f, 4f); - Dust dust = Dust.NewDustPerfect(vector2_13 + vector2_14, 43, new Vector2?(Vector2.Zero), 254, new Color((int) byte.MaxValue, (int) byte.MaxValue, 0, (int) byte.MaxValue), 0.3f); - if (vector2_14 != Vector2.Zero) - dust.velocity = vector2_13.DirectionTo(dust.position) * 0.2f; - dust.fadeIn = 0.3f; - dust.noLightEmittence = true; - dust.customData = (object) mountedPlayer; - dust.shader = GameShaders.Armor.GetSecondaryShader(mountedPlayer.cMount, mountedPlayer); - } - float num14 = 0.1f + mountedPlayer.velocity.Length() / 30f; - Vector2 pos5 = mountedPlayer.Center + new Vector2((float) (18.0 - 20.0 * (double) Main.rand.NextFloat() * (double) mountedPlayer.direction), 12f); - Vector2 pos6 = mountedPlayer.Center + new Vector2((float) (52 * mountedPlayer.direction), -6f); - Vector2 vector2_15 = mountedPlayer.RotatedRelativePoint(pos5); - Vector2 Origin = mountedPlayer.RotatedRelativePoint(pos6); - if ((double) Main.rand.NextFloat() > (double) num14) - break; - float num15 = Main.rand.NextFloat(); - for (float num16 = 0.0f; (double) num16 < 1.0; num16 += 0.125f) - { - if (Main.rand.Next(15) == 0) - { - Vector2 vector2_16 = ((6.283185f * num16 + num15).ToRotationVector2() * new Vector2(0.5f, 1f) * 4f).RotatedBy((double) mountedPlayer.fullRotation); - Dust dust = Dust.NewDustPerfect(vector2_15 + vector2_16, 43, new Vector2?(Vector2.Zero), 254, new Color((int) byte.MaxValue, (int) byte.MaxValue, 0, (int) byte.MaxValue), 0.3f); - dust.velocity = vector2_16 * 0.025f + Origin.DirectionTo(dust.position) * 0.5f; - dust.fadeIn = 0.3f; - dust.noLightEmittence = true; - dust.shader = GameShaders.Armor.GetSecondaryShader(mountedPlayer.cMount, mountedPlayer); - } - } - break; - case 24: - DelegateMethods.v3_1 = new Vector3(0.1f, 0.3f, 1f) * 0.4f; - Utils.PlotTileLine(mountedPlayer.MountedCenter, mountedPlayer.MountedCenter + mountedPlayer.velocity * 6f, 40f, new Utils.TileActionAttempt(DelegateMethods.CastLightOpen)); - Utils.PlotTileLine(mountedPlayer.Left, mountedPlayer.Right, 40f, new Utils.TileActionAttempt(DelegateMethods.CastLightOpen)); - break; - case 25: - this.DoGemMinecartEffect(mountedPlayer, 86); - break; - case 26: - this.DoGemMinecartEffect(mountedPlayer, 87); - break; - case 27: - this.DoGemMinecartEffect(mountedPlayer, 88); - break; - case 28: - this.DoGemMinecartEffect(mountedPlayer, 89); - break; - case 29: - this.DoGemMinecartEffect(mountedPlayer, 90); - break; - case 30: - this.DoGemMinecartEffect(mountedPlayer, 91); - break; - case 31: - this.DoGemMinecartEffect(mountedPlayer, 262); - break; - case 32: - this.DoExhaustMinecartEffect(mountedPlayer, 31); - break; - case 34: - this.DoConfettiMinecartEffect(mountedPlayer); - break; - case 36: - this.DoSteamMinecartEffect(mountedPlayer, 303); - break; - case 37: - mountedPlayer.canFloatInWater = true; - mountedPlayer.accFlipper = true; - break; - case 40: - case 41: - case 42: - if ((double) Math.Abs(mountedPlayer.velocity.X) <= (double) mountedPlayer.mount.DashSpeed - (double) mountedPlayer.mount.RunSpeed / 2.0) - break; - mountedPlayer.noKnockback = true; - break; - case 47: - mountedPlayer.hasJumpOption_WallOfFleshGoat = true; - if ((double) Math.Abs(mountedPlayer.velocity.X) <= (double) mountedPlayer.mount.DashSpeed - (double) mountedPlayer.mount.RunSpeed / 2.0) - break; - mountedPlayer.noKnockback = true; + mountedPlayer.MountFishronSpecialCounter = 300f; break; } } @@ -3402,8 +1918,7 @@ namespace Terraria if (!this._aiming) return; this._aiming = false; - if (this._type != 46) - this._frameExtra = 0; + this._frameExtra = 0; this._flipDraw = false; } @@ -3421,10 +1936,6 @@ namespace Terraria y = (int) Mount.scutlixTextureSize.Y; x = (int) Mount.scutlixTextureSize.X; break; - case 46: - y = (int) Mount.santankTextureSize.Y; - x = (int) Mount.santankTextureSize.X; - break; default: return position; } @@ -3468,8 +1979,8 @@ namespace Terraria mountSpecificData.crosshairPosition = mousePosition; return true; case 9: - int frameExtra1 = this._frameExtra; - int direction1 = mountedPlayer.direction; + int frameExtra = this._frameExtra; + int direction = mountedPlayer.direction; float num2 = MathHelper.ToDegrees((this.ClampToDeadZone(mountedPlayer, mousePosition) - mountedPlayer.Center).ToRotation()); if ((double) num2 > 90.0) { @@ -3514,37 +2025,7 @@ namespace Terraria Lighting.AddLight((int) ((double) vector2_2.X / 16.0), (int) ((double) vector2_2.Y / 16.0), 1f * abilityCharge, 0.0f, 0.0f); } } - return this._frameExtra != frameExtra1 || mountedPlayer.direction != direction1; - case 46: - int frameExtra2 = this._frameExtra; - int direction2 = mountedPlayer.direction; - float degrees = MathHelper.ToDegrees((this.ClampToDeadZone(mountedPlayer, mousePosition) - mountedPlayer.Center).ToRotation()); - float num4; - if ((double) degrees > 90.0) - { - mountedPlayer.direction = -1; - num4 = 180f - degrees; - } - else if ((double) degrees < -90.0) - { - mountedPlayer.direction = -1; - num4 = -180f - degrees; - } - else - mountedPlayer.direction = 1; - this._flipDraw = mountedPlayer.direction > 0 && (double) mountedPlayer.velocity.X < 0.0 || mountedPlayer.direction < 0 && (double) mountedPlayer.velocity.X > 0.0; - if ((double) this.AbilityCharge > 0.0) - { - Vector2 vector2_3; - vector2_3.X = mountedPlayer.position.X + (float) (mountedPlayer.width / 2); - vector2_3.Y = mountedPlayer.position.Y + (float) mountedPlayer.height; - for (int index = 0; index < 2; ++index) - { - Vector2 vector2_4 = new Vector2(vector2_3.X + (float) (mountedPlayer.width * mountedPlayer.direction), vector2_3.Y - 12f); - Lighting.AddLight((int) ((double) vector2_4.X / 16.0), (int) ((double) vector2_4.Y / 16.0), 0.7f, 0.4f, 0.4f); - } - } - return this._frameExtra != frameExtra2 || mountedPlayer.direction != direction2; + return this._frameExtra != frameExtra || mountedPlayer.direction != direction; default: return false; } @@ -3566,35 +2047,28 @@ namespace Terraria switch (drawType) { case 0: - texture1 = this._data.backTexture.Value; - texture2 = this._data.backTextureGlow.Value; + texture1 = this._data.backTexture; + texture2 = this._data.backTextureGlow; break; case 1: - texture1 = this._data.backTextureExtra.Value; - texture2 = this._data.backTextureExtraGlow.Value; + texture1 = this._data.backTextureExtra; + texture2 = this._data.backTextureExtraGlow; break; case 2: if (this._type == 0 && this._idleTime >= this._idleTimeNext) return; - texture1 = this._data.frontTexture.Value; - texture2 = this._data.frontTextureGlow.Value; + texture1 = this._data.frontTexture; + texture2 = this._data.frontTextureGlow; break; case 3: - texture1 = this._data.frontTextureExtra.Value; - texture2 = this._data.frontTextureExtraGlow.Value; + texture1 = this._data.frontTextureExtra; + texture2 = this._data.frontTextureExtraGlow; break; default: texture1 = (Texture2D) null; texture2 = (Texture2D) null; break; } - if (this._type == 50 && texture1 != null) - { - PlayerQueenSlimeMountTextureContent queenSlimeMount = TextureAssets.RenderTargets.QueenSlimeMount; - queenSlimeMount.Request(); - if (queenSlimeMount.IsReady) - texture1 = (Texture2D) queenSlimeMount.GetTarget(); - } if (texture1 == null) return; switch (this._type) @@ -3611,100 +2085,48 @@ namespace Terraria xoffset *= -1; Position.X = (float) (int) ((double) Position.X - (double) Main.screenPosition.X + (double) (drawPlayer.width / 2) + (double) xoffset); Position.Y = (float) (int) ((double) Position.Y - (double) Main.screenPosition.Y + (double) (drawPlayer.height / 2) + (double) num1); - bool flag1 = true; - int num2 = this._data.totalFrames; - int num3 = this._data.textureHeight; - int num4; + bool flag1 = false; + int num2; switch (this._type) { case 5: switch (drawType) { case 0: - num4 = this._frame; + num2 = this._frame; break; case 1: - num4 = this._frameExtra; + num2 = this._frameExtra; break; default: - num4 = 0; + num2 = 0; break; } break; case 9: + flag1 = true; switch (drawType) { case 0: - num4 = this._frame; + num2 = this._frame; break; case 2: - num4 = this._frameExtra; + num2 = this._frameExtra; break; case 3: - num4 = this._frameExtra; + num2 = this._frameExtra; break; default: - num4 = 0; - break; - } - break; - case 17: - num3 = texture1.Height; - switch (drawType) - { - case 0: - num4 = this._frame; - num2 = 4; - break; - case 1: - num4 = this._frameExtra; - num2 = 4; - break; - default: - num4 = 0; - break; - } - break; - case 23: - num4 = this._frame; - break; - case 39: - num3 = texture1.Height; - switch (drawType) - { - case 2: - num4 = this._frame; - num2 = 3; - break; - case 3: - num4 = this._frameExtra; - num2 = 6; - break; - default: - num4 = 0; - break; - } - break; - case 46: - switch (drawType) - { - case 2: - num4 = this._frame; - break; - case 3: - num4 = this._frameExtra; - break; - default: - num4 = 0; + num2 = 0; break; } break; default: - num4 = this._frame; + num2 = this._frame; break; } - int height = num3 / num2; - Rectangle rectangle1 = new Rectangle(0, height * num4, this._data.textureWidth, height); + int height = this._data.textureHeight / this._data.totalFrames; + Rectangle rectangle1 = new Rectangle(0, height * num2, this._data.textureWidth, height); if (flag1) rectangle1.Height -= 2; switch (this._type) @@ -3748,27 +2170,12 @@ namespace Terraria case 12: if (drawType == 0) { - float num5 = MathHelper.Clamp(drawPlayer.MountFishronSpecialCounter / 60f, 0.0f, 1f); + float num3 = MathHelper.Clamp(drawPlayer.MountFishronSpecialCounter / 60f, 0.0f, 1f); Color color2 = Colors.CurrentLiquidColor; if (color2 == Color.Transparent) color2 = Color.White; color2.A = (byte) 127; - color1 = color2 * num5; - break; - } - break; - case 24: - if (drawType == 2) - { - color1 = Color.SkyBlue * 0.5f; - color1.A = (byte) 20; - break; - } - break; - case 45: - if (drawType == 2) - { - color1 = new Color(150, 110, 110, 100); + color1 = color2 * num3; break; } break; @@ -3793,7 +2200,7 @@ namespace Terraria break; } Vector2 origin = this.Origin; - int type = this._type; + int type1 = this._type; float scale1 = 1f; SpriteEffects effect; switch (this._type) @@ -3808,89 +2215,16 @@ namespace Terraria case 8: effect = drawPlayer.direction != 1 || drawType != 2 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; break; + case 11: + effect = Math.Sign(drawPlayer.velocity.X) == -drawPlayer.direction ? playerEffect ^ SpriteEffects.FlipHorizontally : playerEffect; + break; default: effect = playerEffect; break; } - if (MountID.Sets.FacePlayersVelocity[this._type]) - effect = Math.Sign(drawPlayer.velocity.X) == -drawPlayer.direction ? playerEffect ^ SpriteEffects.FlipHorizontally : playerEffect; bool flag2 = false; + int type2 = this._type; DrawData drawData; - switch (this._type) - { - case 35: - if (drawType == 2) - { - Mount.ExtraFrameMountData mountSpecificData2 = (Mount.ExtraFrameMountData) this._mountSpecificData; - int num6 = -36; - if (effect.HasFlag((Enum) SpriteEffects.FlipHorizontally)) - num6 *= -1; - Vector2 vector2 = new Vector2((float) num6, -26f); - if ((double) shadow == 0.0) - { - if ((double) Math.Abs(drawPlayer.velocity.X) > 1.0) - { - mountSpecificData2.frameCounter += Math.Min(2f, Math.Abs(drawPlayer.velocity.X * 0.4f)); - while ((double) mountSpecificData2.frameCounter > 6.0) - { - mountSpecificData2.frameCounter -= 6f; - ++mountSpecificData2.frame; - if (mountSpecificData2.frame > 2 && mountSpecificData2.frame < 5 || mountSpecificData2.frame > 7) - mountSpecificData2.frame = 0; - } - } - else - { - ++mountSpecificData2.frameCounter; - while ((double) mountSpecificData2.frameCounter > 6.0) - { - mountSpecificData2.frameCounter -= 6f; - ++mountSpecificData2.frame; - if (mountSpecificData2.frame > 5) - mountSpecificData2.frame = 5; - } - } - } - Texture2D texture2D = TextureAssets.Extra[142].Value; - Rectangle rectangle2 = texture2D.Frame(verticalFrames: 8, frameY: mountSpecificData2.frame); - if (flag1) - rectangle2.Height -= 2; - drawData = new DrawData(texture2D, Position + vector2, new Rectangle?(rectangle2), drawColor, rotation1, origin, scale1, effect, 0); - drawData.shader = Mount.currentShader; - playerDrawData.Add(drawData); - break; - } - break; - case 38: - if (drawType == 0) - { - int num7 = 0; - if (effect.HasFlag((Enum) SpriteEffects.FlipHorizontally)) - num7 = 22; - Vector2 vector2 = new Vector2((float) num7, -10f); - Texture2D texture2D = TextureAssets.Extra[151].Value; - Rectangle rectangle3 = texture2D.Frame(); - drawData = new DrawData(texture2D, Position + vector2, new Rectangle?(rectangle3), drawColor, rotation1, origin, scale1, effect, 0); - drawData.shader = Mount.currentShader; - playerDrawData.Add(drawData); - flag2 = true; - break; - } - break; - case 50: - if (drawType == 0) - { - Vector2 position = Position + new Vector2(0.0f, (float) (8 - this.PlayerOffset + 20)); - Rectangle rectangle4 = new Rectangle(0, height * this._frameExtra, this._data.textureWidth, height); - if (flag1) - rectangle4.Height -= 2; - drawData = new DrawData(TextureAssets.Extra[207].Value, position, new Rectangle?(rectangle4), drawColor, rotation1, origin, scale1, effect, 0); - drawData.shader = Mount.currentShader; - playerDrawData.Add(drawData); - break; - } - break; - } if (!flag2) { drawData = new DrawData(texture1, Position, new Rectangle?(rectangle1), drawColor, rotation1, origin, scale1, effect, 0); @@ -3903,119 +2237,44 @@ namespace Terraria } playerDrawData.Add(drawData); } - switch (this._type) + if (this._type != 8 || drawType != 3) + return; + Mount.DrillMountData mountSpecificData2 = (Mount.DrillMountData) this._mountSpecificData; + Rectangle rectangle2 = new Rectangle(0, 0, 1, 1); + Vector2 vector2_1 = Mount.drillDiodePoint1.RotatedBy((double) mountSpecificData2.diodeRotation); + Vector2 vector2_2 = Mount.drillDiodePoint2.RotatedBy((double) mountSpecificData2.diodeRotation); + for (int index1 = 0; index1 < mountSpecificData2.beams.Length; ++index1) { - case 8: - if (drawType != 3) - break; - Mount.DrillMountData mountSpecificData3 = (Mount.DrillMountData) this._mountSpecificData; - Rectangle rectangle5 = new Rectangle(0, 0, 1, 1); - Vector2 vector2_1 = Mount.drillDiodePoint1.RotatedBy((double) mountSpecificData3.diodeRotation); - Vector2 vector2_2 = Mount.drillDiodePoint2.RotatedBy((double) mountSpecificData3.diodeRotation); - for (int index1 = 0; index1 < mountSpecificData3.beams.Length; ++index1) + Mount.DrillBeam beam = mountSpecificData2.beams[index1]; + if (!(beam.curTileTarget == Point16.NegativeOne)) + { + for (int index2 = 0; index2 < 2; ++index2) { - Mount.DrillBeam beam = mountSpecificData3.beams[index1]; - if (!(beam.curTileTarget == Point16.NegativeOne)) + Vector2 vector2_3 = new Vector2((float) ((int) beam.curTileTarget.X * 16 + 8), (float) ((int) beam.curTileTarget.Y * 16 + 8)) - Main.screenPosition - Position; + Vector2 vector2_4; + Color color3; + if (index2 == 0) { - for (int index2 = 0; index2 < 2; ++index2) - { - Vector2 vector2_3 = new Vector2((float) ((int) beam.curTileTarget.X * 16 + 8), (float) ((int) beam.curTileTarget.Y * 16 + 8)) - Main.screenPosition - Position; - Vector2 vector2_4; - Color color3; - if (index2 == 0) - { - vector2_4 = vector2_1; - color3 = Color.CornflowerBlue; - } - else - { - vector2_4 = vector2_2; - color3 = Color.LightGreen; - } - color3.A = (byte) 128; - Color color4 = color3 * 0.5f; - Vector2 vector2_5 = vector2_4; - Vector2 v = vector2_3 - vector2_5; - float rotation2 = v.ToRotation(); - Vector2 scale2 = new Vector2(2f, v.Length()); - drawData = new DrawData(TextureAssets.MagicPixel.Value, vector2_4 + Position, new Rectangle?(rectangle5), color4, rotation2 - 1.570796f, Vector2.Zero, scale2, SpriteEffects.None, 0); - drawData.ignorePlayerRotation = true; - drawData.shader = Mount.currentShader; - playerDrawData.Add(drawData); - } + vector2_4 = vector2_1; + color3 = Color.CornflowerBlue; } - } - break; - case 17: - if (drawType != 1 || !Mount.ShouldGolfCartEmitLight()) - break; - rectangle1 = new Rectangle(0, height * 3, this._data.textureWidth, height); - if (flag1) - rectangle1.Height -= 2; - drawColor = Color.White * 1f; - drawColor.A = (byte) 0; - drawData = new DrawData(texture1, Position, new Rectangle?(rectangle1), drawColor, rotation1, origin, scale1, effect, 0); - drawData.shader = Mount.currentShader; - playerDrawData.Add(drawData); - break; - case 23: - if (drawType != 0) - break; - Texture2D texture2D1 = TextureAssets.Extra[114].Value; - rectangle1 = texture2D1.Frame(2); - int width = rectangle1.Width; - rectangle1.Width -= 2; - double broomTrinketRotation = (double) this.GetWitchBroomTrinketRotation(drawPlayer); - Position = drawPlayer.Center + this.GetWitchBroomTrinketOriginOffset(drawPlayer) - Main.screenPosition; - float rotation3 = (float) broomTrinketRotation; - origin = new Vector2((float) (rectangle1.Width / 2), 0.0f); - drawData = new DrawData(texture2D1, Position.Floor(), new Rectangle?(rectangle1), drawColor, rotation3, origin, scale1, effect, 0); - drawData.shader = Mount.currentShader; - playerDrawData.Add(drawData); - new Color(new Vector3(0.9f, 0.85f, 0.0f)).A /= (byte) 2; - float num8 = ((float) ((double) drawPlayer.miscCounter / 75.0 * 6.28318548202515)).ToRotationVector2().X * 1f; - Color color5 = new Color(80, 70, 40, 0) * (float) ((double) num8 / 8.0 + 0.5) * 0.8f; - rectangle1.X += width; - for (int index = 0; index < 4; ++index) - { - drawData = new DrawData(texture2D1, (Position + ((float) index * 1.570796f).ToRotationVector2() * num8).Floor(), new Rectangle?(rectangle1), color5, rotation3, origin, scale1, effect, 0); + else + { + vector2_4 = vector2_2; + color3 = Color.LightGreen; + } + color3.A = (byte) 128; + Color color4 = color3 * 0.5f; + Vector2 vector2_5 = vector2_4; + Vector2 v = vector2_3 - vector2_5; + float rotation2 = v.ToRotation(); + Vector2 scale2 = new Vector2(2f, v.Length()); + drawData = new DrawData(Main.magicPixel, vector2_4 + Position, new Rectangle?(rectangle2), color4, rotation2 - 1.570796f, Vector2.Zero, scale2, SpriteEffects.None, 0); + drawData.ignorePlayerRotation = true; drawData.shader = Mount.currentShader; playerDrawData.Add(drawData); } - break; - case 45: - if (drawType != 0 || (double) shadow != 0.0) - break; - if ((double) Math.Abs(drawPlayer.velocity.X) > (double) this.DashSpeed * 0.899999976158142) - { - color1 = new Color((int) byte.MaxValue, 220, 220, 200); - scale1 = 1.1f; - } - for (int index = 0; index < 2; ++index) - { - Vector2 position = Position + new Vector2((float) Main.rand.Next(-10, 11) * 0.1f, (float) Main.rand.Next(-10, 11) * 0.1f); - rectangle1 = new Rectangle(0, height * 3, this._data.textureWidth, height); - if (flag1) - rectangle1.Height -= 2; - drawData = new DrawData(texture2, position, new Rectangle?(rectangle1), color1, rotation1, origin, scale1, effect, 0); - drawData.shader = Mount.currentShader; - playerDrawData.Add(drawData); - } - break; - case 50: - if (drawType != 0) - break; - drawData = new DrawData(TextureAssets.Extra[205].Value, Position, new Rectangle?(rectangle1), drawColor, rotation1, origin, scale1, effect, 0); - drawData.shader = Mount.currentShader; - playerDrawData.Add(drawData); - Vector2 position1 = Position + new Vector2(0.0f, (float) (8 - this.PlayerOffset + 20)); - Rectangle rectangle6 = new Rectangle(0, height * this._frameExtra, this._data.textureWidth, height); - if (flag1) - rectangle6.Height -= 2; - drawData = new DrawData(TextureAssets.Extra[206].Value, position1, new Rectangle?(rectangle6), drawColor, rotation1, origin, scale1, effect, 0); - drawData.shader = Mount.currentShader; - playerDrawData.Add(drawData); - break; + } } } @@ -4036,7 +2295,37 @@ namespace Terraria } mountedPlayer.fullRotation = 0.0f; mountedPlayer.fullRotationOrigin = Vector2.Zero; - this.DoSpawnDust(mountedPlayer, true); + if (Main.netMode != 2) + { + for (int index1 = 0; index1 < 100; ++index1) + { + if (this._type == 6 || this._type == 11 || this._type == 13) + { + if (index1 % 10 == 0) + { + int Type = Main.rand.Next(61, 64); + int index2 = Gore.NewGore(new Vector2(mountedPlayer.position.X - 20f, mountedPlayer.position.Y), Vector2.Zero, Type); + Main.gore[index2].alpha = 100; + Main.gore[index2].velocity = Vector2.Transform(new Vector2(1f, 0.0f), Matrix.CreateRotationZ((float) (Main.rand.NextDouble() * 6.28318548202515))); + } + } + else + { + int index3 = Dust.NewDust(new Vector2(mountedPlayer.position.X - 20f, mountedPlayer.position.Y), mountedPlayer.width + 40, mountedPlayer.height, this._data.spawnDust); + Main.dust[index3].scale += (float) Main.rand.Next(-10, 21) * 0.01f; + if (this._data.spawnDustNoGravity) + Main.dust[index3].noGravity = true; + else if (Main.rand.Next(2) == 0) + { + Main.dust[index3].scale *= 1.3f; + Main.dust[index3].noGravity = true; + } + else + Main.dust[index3].velocity *= 0.5f; + Main.dust[index3].velocity += mountedPlayer.velocity * 0.8f; + } + } + } this.Reset(); mountedPlayer.position.Y += (float) mountedPlayer.height; mountedPlayer.height = 42; @@ -4048,7 +2337,7 @@ namespace Terraria public void SetMount(int m, Player mountedPlayer, bool faceLeft = false) { - if (this._type == m || m <= -1 || m >= MountID.Count || m == 5 && mountedPlayer.wet) + if (this._type == m || m <= -1 || m >= 15 || m == 5 && mountedPlayer.wet) return; if (this._active) { @@ -4081,8 +2370,6 @@ namespace Terraria } if (this._type == 9 && this._abilityCooldown < 20) this._abilityCooldown = 20; - if (this._type == 46 && this._abilityCooldown < 40) - this._abilityCooldown = 40; mountedPlayer.position.Y += (float) mountedPlayer.height; for (int index = 0; index < mountedPlayer.shadowPos.Length; ++index) mountedPlayer.shadowPos[index].Y += (float) mountedPlayer.height; @@ -4090,94 +2377,52 @@ namespace Terraria mountedPlayer.position.Y -= (float) mountedPlayer.height; for (int index = 0; index < mountedPlayer.shadowPos.Length; ++index) mountedPlayer.shadowPos[index].Y -= (float) mountedPlayer.height; - mountedPlayer.ResetAdvancedShadows(); if (this._type == 7 || this._type == 8) mountedPlayer.fullRotationOrigin = new Vector2((float) (mountedPlayer.width / 2), (float) (mountedPlayer.height / 2)); if (this._type == 8) this._mountSpecificData = (object) new Mount.DrillMountData(); - if (this._type == 35) - this._mountSpecificData = (object) new Mount.ExtraFrameMountData(); - this.DoSpawnDust(mountedPlayer, false); + if (Main.netMode != 2) + { + for (int index1 = 0; index1 < 100; ++index1) + { + if (this._type == 6 || this._type == 11 || this._type == 13) + { + if (index1 % 10 == 0) + { + int Type = Main.rand.Next(61, 64); + int index2 = Gore.NewGore(new Vector2(mountedPlayer.position.X - 20f, mountedPlayer.position.Y), Vector2.Zero, Type); + Main.gore[index2].alpha = 100; + Main.gore[index2].velocity = Vector2.Transform(new Vector2(1f, 0.0f), Matrix.CreateRotationZ((float) (Main.rand.NextDouble() * 6.28318548202515))); + } + } + else + { + int index3 = Dust.NewDust(new Vector2(mountedPlayer.position.X - 20f, mountedPlayer.position.Y), mountedPlayer.width + 40, mountedPlayer.height, this._data.spawnDust); + Main.dust[index3].scale += (float) Main.rand.Next(-10, 21) * 0.01f; + if (this._data.spawnDustNoGravity) + Main.dust[index3].noGravity = true; + else if (Main.rand.Next(2) == 0) + { + Main.dust[index3].scale *= 1.3f; + Main.dust[index3].noGravity = true; + } + else + Main.dust[index3].velocity *= 0.5f; + Main.dust[index3].velocity += mountedPlayer.velocity * 0.8f; + } + } + } if (mountedPlayer.whoAmI != Main.myPlayer) return; NetMessage.SendData(13, number: mountedPlayer.whoAmI); } - private void DoSpawnDust(Player mountedPlayer, bool isDismounting) + public bool CanMount(int m, Player mountingPlayer) { - if (Main.netMode == 2) - return; - Color newColor = Color.Transparent; - if (this._type == 23) - newColor = new Color((int) byte.MaxValue, (int) byte.MaxValue, 0, (int) byte.MaxValue); - for (int index1 = 0; index1 < 100; ++index1) - { - if (MountID.Sets.Cart[this._type]) - { - if (index1 % 10 == 0) - { - int Type = Main.rand.Next(61, 64); - int index2 = Gore.NewGore(new Vector2(mountedPlayer.position.X - 20f, mountedPlayer.position.Y), Vector2.Zero, Type); - Main.gore[index2].alpha = 100; - Main.gore[index2].velocity = Vector2.Transform(new Vector2(1f, 0.0f), Matrix.CreateRotationZ((float) (Main.rand.NextDouble() * 6.28318548202515))); - } - } - else - { - int Type = this._data.spawnDust; - float Scale = 1f; - int Alpha = 0; - if (this._type == 40 || this._type == 41 || this._type == 42) - { - Type = Main.rand.Next(2) != 0 ? 16 : 31; - Scale = 0.9f; - Alpha = 50; - if (this._type == 42) - Type = 31; - if (this._type == 41) - Type = 16; - } - int index3 = Dust.NewDust(new Vector2(mountedPlayer.position.X - 20f, mountedPlayer.position.Y), mountedPlayer.width + 40, mountedPlayer.height, Type, Alpha: Alpha, newColor: newColor, Scale: Scale); - Main.dust[index3].scale += (float) Main.rand.Next(-10, 21) * 0.01f; - if (this._data.spawnDustNoGravity) - Main.dust[index3].noGravity = true; - else if (Main.rand.Next(2) == 0) - { - Main.dust[index3].scale *= 1.3f; - Main.dust[index3].noGravity = true; - } - else - Main.dust[index3].velocity *= 0.5f; - Main.dust[index3].velocity += mountedPlayer.velocity * 0.8f; - if (this._type == 40 || this._type == 41 || this._type == 42) - Main.dust[index3].velocity *= Main.rand.NextFloat(); - } - } - if (this._type == 40 || this._type == 41 || this._type == 42) - { - for (int index4 = 0; index4 < 5; ++index4) - { - int Type = Main.rand.Next(61, 64); - if (this._type == 41 || this._type == 40 && Main.rand.Next(2) == 0) - Type = Main.rand.Next(11, 14); - int index5 = Gore.NewGore(new Vector2(mountedPlayer.position.X + (float) (mountedPlayer.direction * 8), mountedPlayer.position.Y + 20f), Vector2.Zero, Type); - Main.gore[index5].alpha = 100; - Main.gore[index5].velocity = Vector2.Transform(new Vector2(1f, 0.0f), Matrix.CreateRotationZ((float) (Main.rand.NextDouble() * 6.28318548202515))) * 1.4f; - } - } - if (this._type != 23) - return; - for (int index6 = 0; index6 < 4; ++index6) - { - int Type = Main.rand.Next(61, 64); - int index7 = Gore.NewGore(new Vector2(mountedPlayer.position.X - 20f, mountedPlayer.position.Y), Vector2.Zero, Type); - Main.gore[index7].alpha = 100; - Main.gore[index7].velocity = Vector2.Transform(new Vector2(1f, 0.0f), Matrix.CreateRotationZ((float) (Main.rand.NextDouble() * 6.28318548202515))); - } + int Height = 42 + Mount.mounts[m].heightBoost; + return Collision.IsClearSpotTest(mountingPlayer.position + new Vector2(0.0f, (float) (mountingPlayer.height - Height)) + mountingPlayer.velocity, 16f, mountingPlayer.width, Height, true, true); } - public bool CanMount(int m, Player mountingPlayer) => mountingPlayer.CanFitSpace(Mount.mounts[m].heightBoost); - public bool FindTileHeight(Vector2 position, int maxTilesDown, out float tileHeight) { int index1 = (int) ((double) position.X / 16.0); @@ -4234,49 +2479,16 @@ namespace Terraria } } - private class BooleanMountData - { - public bool boolean; - - public BooleanMountData() => this.boolean = false; - } - - private class ExtraFrameMountData - { - public int frame; - public float frameCounter; - - public ExtraFrameMountData() - { - this.frame = 0; - this.frameCounter = 0.0f; - } - } - - public class MountDelegatesData - { - public Action MinecartDust; - public Action MinecartLandingSound; - public Action MinecartBumperSound; - - public MountDelegatesData() - { - this.MinecartDust = new Action(DelegateMethods.Minecart.Sparks); - this.MinecartLandingSound = new Action(DelegateMethods.Minecart.LandingSound); - this.MinecartBumperSound = new Action(DelegateMethods.Minecart.BumperSound); - } - } - private class MountData { - public Asset backTexture = (Asset) Asset.Empty; - public Asset backTextureGlow = (Asset) Asset.Empty; - public Asset backTextureExtra = (Asset) Asset.Empty; - public Asset backTextureExtraGlow = (Asset) Asset.Empty; - public Asset frontTexture = (Asset) Asset.Empty; - public Asset frontTextureGlow = (Asset) Asset.Empty; - public Asset frontTextureExtra = (Asset) Asset.Empty; - public Asset frontTextureExtraGlow = (Asset) Asset.Empty; + public Texture2D backTexture; + public Texture2D backTextureGlow; + public Texture2D backTextureExtra; + public Texture2D backTextureExtraGlow; + public Texture2D frontTexture; + public Texture2D frontTextureGlow; + public Texture2D frontTextureExtra; + public Texture2D frontTextureExtraGlow; public int textureWidth; public int textureHeight; public int xOffset; @@ -4329,9 +2541,9 @@ namespace Terraria public int dashingFrameDelay; public bool Minecart; public bool MinecartDirectional; + public Action MinecartDust; public Vector3 lightColor = Vector3.One; public bool emitsLight; - public Mount.MountDelegatesData delegations; } } } diff --git a/NPC.cs b/NPC.cs index d716db5..45abb32 100644 --- a/NPC.cs +++ b/NPC.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.NPC -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -10,35 +10,27 @@ using ReLogic.Utilities; using System; using System.Collections.Generic; using Terraria.Audio; -using Terraria.Chat; using Terraria.DataStructures; using Terraria.Enums; using Terraria.GameContent; using Terraria.GameContent.Achievements; -using Terraria.GameContent.Creative; -using Terraria.GameContent.Drawing; using Terraria.GameContent.Events; -using Terraria.GameContent.ItemDropRules; -using Terraria.GameContent.RGB; using Terraria.GameContent.UI; using Terraria.ID; using Terraria.Localization; using Terraria.Utilities; -using Terraria.WorldBuilding; +using Terraria.World.Generation; namespace Terraria { public class NPC : Entity { private const int NPC_TARGETS_START = 300; - public bool IsABestiaryIconDummy; - public bool ForcePartyHatOn; private float waterMovementSpeed = 0.5f; private float lavaMovementSpeed = 0.5f; private float honeyMovementSpeed = 0.25f; public static readonly int[,,,] MoonLordAttacksArray = NPC.InitializeMoonLordAttacks(); public static readonly int[,] MoonLordAttacksArray2 = NPC.InitializeMoonLordAttacks2(); - public static int MoonLordFightingDistance = 4500; public static int MoonLordCountdown = 0; public const int MaxMoonLordCountdown = 3600; public int teleportStyle; @@ -46,21 +38,18 @@ namespace Terraria public static int immuneTime = 20; public static int maxAI = 4; public int netSpam; - public static int goldCritterChance = 400; - public static int[] killCount = new int[663]; + public static int goldCritterChance = 150; + public static int[] killCount = new int[580]; public static float waveKills = 0.0f; public static int waveNumber = 0; public const float nameOverIncrement = 0.025f; - public const float nameOverDistance = 350f; + public const float nameOverDistance = 400f; public float nameOver; public bool SpawnedFromStatue; public bool dripping; public bool drippingSlime; - public bool drippingSparkleSlime; - public static readonly int AFKTimeNeededForNoWorms = 300; public int altTexture; - public int townNpcVariationIndex; - public Vector2 netOffset = Vector2.Zero; + public Vector2 visualOffset = Vector2.Zero; public short catchItem; public short releaseOwner = (short) byte.MaxValue; public int rarity; @@ -68,7 +57,6 @@ namespace Terraria public bool[] playerInteraction = new bool[256]; public int lastInteraction = (int) byte.MaxValue; public float takenDamageMultiplier = 1f; - public static bool freeCake = false; private static int spawnSpaceX = 3; private static int spawnSpaceY = 3; public float gfxOffY; @@ -84,7 +72,7 @@ namespace Terraria public static int butterflyChance = 0; private byte netStream; private byte[] streamPlayer = new byte[(int) byte.MaxValue]; - private bool needsUniqueInfoUpdate = true; + private byte npcNameLookup; public Vector2[] oldPos = new Vector2[10]; public float[] oldRot = new float[10]; public bool setFrameSize; @@ -114,20 +102,13 @@ namespace Terraria public const int maxBuffs = 5; public int[] buffType = new int[5]; public int[] buffTime = new int[5]; - public bool[] buffImmune = new bool[323]; + public bool[] buffImmune = new bool[206]; public bool midas; public bool ichor; public bool onFire; public bool onFire2; public bool onFrostBurn; public bool poisoned; - public bool markedByScytheWhip; - public bool markedByThornWhip; - public bool markedByFireWhip; - public bool markedByRainbowWhip; - public bool markedByBlandWhip; - public bool markedBySwordWhip; - public bool markedByMaceWhip; public bool venom; public bool shadowFlame; public bool soulDrain; @@ -155,11 +136,6 @@ namespace Terraria public static bool savedAngler = false; public static bool savedStylist = false; public static bool savedBartender = false; - public static bool savedGolfer = false; - public static bool boughtCat = false; - public static bool boughtDog = false; - public static bool boughtBunny = false; - public static bool combatBookWasUsed = false; public static bool downedBoss1 = false; public static bool downedBoss2 = false; public static bool downedBoss3 = false; @@ -184,8 +160,6 @@ namespace Terraria public static bool downedTowerVortex = false; public static bool downedTowerNebula = false; public static bool downedTowerStardust = false; - public static bool downedEmpressOfLight = false; - public static bool downedQueenSlime = false; public static int ShieldStrengthTowerSolar = 0; public static int ShieldStrengthTowerVortex = 0; public static int ShieldStrengthTowerNebula = 0; @@ -201,12 +175,10 @@ namespace Terraria public static bool downedMechBoss1 = false; public static bool downedMechBoss2 = false; public static bool downedMechBoss3 = false; - public static bool[] npcsFoundForCheckActive = new bool[663]; - public static int[] lazyNPCOwnedProjectileSearchArray = new int[200]; + public static bool[] npcsFoundForCheckActive = new bool[580]; private static int spawnRate = NPC.defaultSpawnRate; private static int maxSpawns = NPC.defaultMaxSpawns; public int soundDelay; - public static CoinLossRevengeSystem RevengeManager = new CoinLossRevengeSystem(); public int[] immune = new int[256]; public int directionY = 1; public int type; @@ -249,17 +221,14 @@ namespace Terraria public bool behindTiles; public bool lavaImmune; public float value; - public int extraValue; + public float extraValue; public bool dontTakeDamage; public int netID; - public int statsAreScaledForThisManyPlayers; - public float strengthMultiplier = 1f; public bool townNPC; public static bool travelNPC = false; public bool homeless; public int homeTileX = -1; public int homeTileY = -1; - public int housingCategory; public bool oldHomeless; public int oldHomeTileX = -1; public int oldHomeTileY = -1; @@ -271,22 +240,12 @@ namespace Terraria public int breath; public const int breathMax = 200; public int breathCounter; - public bool reflectsProjectiles; + public bool reflectingProjectiles; public int lastPortalColorIndex; - public bool despawnEncouraged; public static int[,] cavernMonsterType = new int[2, 3]; - private static bool EoCKilledToday; - private static bool WoFKilledToday; - public static bool fairyLog = false; private static int ignorePlayerInteractions = 0; - public static int ladyBugGoodLuckTime = 43200; - public static int ladyBugBadLuckTime = -10800; - private static int ladyBugRainTime = 1800; - public static int offSetDelayTime = 60; - public bool CanTalk => this.isLikeATownNPC && this.aiStyle == 7 && (double) this.velocity.Y == 0.0 && !NPCID.Sets.IsTownPet[this.type]; - - public bool CanBeTalkedTo => this.isLikeATownNPC && this.aiStyle == 7 && (double) this.velocity.Y == 0.0; + public bool CanTalk => (this.townNPC || this.type == 453) && this.aiStyle == 7 && (double) this.velocity.Y == 0.0; public bool HasValidTarget { @@ -336,7 +295,7 @@ namespace Terraria else numArray = new int[3, 3, 2, 5]; numArray[0, 0, 0, 0] = 0; - numArray[0, 0, 1, 0] = 50; + numArray[0, 0, 1, 0] = 60; numArray[0, 0, 0, 1] = 1; numArray[0, 0, 1, 1] = 70; numArray[0, 0, 0, 2] = 2; @@ -348,21 +307,21 @@ namespace Terraria numArray[0, 1, 0, 0] = 1; numArray[0, 1, 1, 0] = 70; numArray[0, 1, 0, 1] = 0; - numArray[0, 1, 1, 1] = 50; + numArray[0, 1, 1, 1] = 120; numArray[0, 1, 0, 2] = 3; numArray[0, 1, 1, 2] = 90; numArray[0, 1, 0, 3] = 0; - numArray[0, 1, 1, 3] = 60; + numArray[0, 1, 1, 3] = 120; numArray[0, 1, 0, 4] = 2; - numArray[0, 1, 1, 4] = 330; + numArray[0, 1, 1, 4] = 390; numArray[0, 2, 0, 0] = 3; - numArray[0, 2, 1, 0] = 180; + numArray[0, 2, 1, 0] = 90; numArray[0, 2, 0, 1] = 0; - numArray[0, 2, 1, 1] = 30; + numArray[0, 2, 1, 1] = 120; numArray[0, 2, 0, 2] = 2; numArray[0, 2, 1, 2] = 435; - numArray[0, 2, 0, 3] = 3; - numArray[0, 2, 1, 3] = 180; + numArray[0, 2, 0, 3] = 0; + numArray[0, 2, 1, 3] = 120; numArray[0, 2, 0, 4] = 1; numArray[0, 2, 1, 4] = 375; numArray[1, 0, 0, 0] = 0; @@ -480,16 +439,6 @@ namespace Terraria set => this._givenName = value ?? ""; } - public static string GetFullnameByID(int npcID) - { - for (int index = 0; index < 200; ++index) - { - if (Main.npc[index].active && Main.npc[index].type == npcID) - return Main.npc[index].FullName; - } - return Lang.GetNPCNameValue(npcID); - } - public static bool downedTowers => NPC.downedTowerSolar && NPC.downedTowerVortex && NPC.downedTowerNebula && NPC.downedTowerStardust; public static int ShieldStrengthTowerMax => !Main.expertMode ? NPC.LunarShieldPowerNormal : NPC.LunarShieldPowerExpert; @@ -504,45 +453,6 @@ namespace Terraria set => this.alpha = (int) MathHelper.Clamp((float) ((1.0 - (double) value) * (double) byte.MaxValue), 0.0f, (float) byte.MaxValue); } - public int GetAttackDamage_ScaledByStrength(float normalDamage) => (int) ((double) normalDamage * (double) Main.GameModeInfo.EnemyDamageMultiplier * (double) this.strengthMultiplier); - - public float GetAttackDamage_LerpBetweenFinalValuesFloat(float normalDamage, float expertDamage) - { - float amount = Main.expertMode ? 1f : 0.0f; - if (Main.GameModeInfo.IsJourneyMode) - amount = MathHelper.Clamp(this.strengthMultiplier - 1f, 0.0f, 1f); - return MathHelper.Lerp(normalDamage, expertDamage, amount); - } - - public int GetAttackDamage_LerpBetweenFinalValues(float normalDamage, float expertDamage) - { - float amount = Main.expertMode ? 1f : 0.0f; - if (Main.GameModeInfo.IsJourneyMode) - amount = MathHelper.Clamp(this.strengthMultiplier - 1f, 0.0f, 1f); - return (int) MathHelper.Lerp(normalDamage, expertDamage, amount); - } - - public int GetAttackDamage_ForProjectiles(float normalDamage, float expertDamage) - { - float amount = Main.expertMode ? 1f : 0.0f; - if (Main.GameModeInfo.IsJourneyMode) - amount = MathHelper.Clamp(this.strengthMultiplier - 1f, 0.0f, 1f); - return (int) MathHelper.Lerp(normalDamage, expertDamage, amount); - } - - public int GetAttackDamage_ForProjectiles_MultiLerp( - float normalDamage, - float expertDamage, - float masterDamage) - { - float percent = Main.masterMode ? 1f : (Main.expertMode ? 0.5f : 0.0f); - if (Main.GameModeInfo.IsJourneyMode) - percent = MathHelper.Clamp(this.strengthMultiplier - 1f, 0.0f, 2f) / 2f; - return (int) Utils.MultiLerp(percent, normalDamage, expertDamage, masterDamage); - } - - public bool isLikeATownNPC => this.type == 453 || this.townNPC; - public static void ClearFoundActiveNPCs() { for (int index = 0; index < NPC.npcsFoundForCheckActive.Length; ++index) @@ -554,90 +464,12 @@ namespace Terraria for (int index = 0; index < 200; ++index) { NPC npc = Main.npc[index]; - if (npc.active && npc.type >= 0 && npc.type < 663) + if (npc.active && npc.type >= 0 && npc.type < 580) NPC.npcsFoundForCheckActive[npc.type] = true; } - NPC.UpdateRGBPeriheralProbe(); } - public static void ClearFoundNPCTypesForBestiary() - { - for (int index = 0; index < NPC.npcsFoundForCheckActive.Length; ++index) - NPC.npcsFoundForCheckActive[index] = false; - } - - public static void UpdateRGBPeriheralProbe() - { - int num1 = 0; - int num2 = Main.LocalPlayer.ZoneOverworldHeight ? 1 : 0; - if (NPC.npcsFoundForCheckActive[4]) - num1 = 4; - if (NPC.npcsFoundForCheckActive[50]) - num1 = 50; - if (num2 != 0 && Main.invasionType == 1) - num1 = -1; - if (NPC.npcsFoundForCheckActive[13]) - num1 = 13; - if (NPC.npcsFoundForCheckActive[266]) - num1 = 266; - if (NPC.npcsFoundForCheckActive[222]) - num1 = 222; - if (NPC.npcsFoundForCheckActive[35]) - num1 = 35; - if (NPC.npcsFoundForCheckActive[113]) - num1 = 113; - if (num2 != 0 && Main.invasionType == 2) - num1 = -2; - if (NPC.npcsFoundForCheckActive[657]) - num1 = 657; - if (NPC.npcsFoundForCheckActive[126] || NPC.npcsFoundForCheckActive[125]) - num1 = 126; - if (NPC.npcsFoundForCheckActive[134]) - num1 = 134; - if (NPC.npcsFoundForCheckActive[(int) sbyte.MaxValue]) - num1 = (int) sbyte.MaxValue; - if (num2 != 0 && Main.invasionType == 3) - num1 = -3; - if (NPC.npcsFoundForCheckActive[262]) - num1 = 262; - if (NPC.npcsFoundForCheckActive[245]) - num1 = 245; - if (NPC.npcsFoundForCheckActive[636]) - num1 = 636; - if (DD2Event.Ongoing) - num1 = -6; - if (num2 != 0 && Main.invasionType == 4) - num1 = -4; - if (NPC.npcsFoundForCheckActive[439]) - num1 = 439; - if (NPC.npcsFoundForCheckActive[370]) - num1 = 370; - if (NPC.npcsFoundForCheckActive[398]) - num1 = 398; - CommonConditions.Boss.HighestTierBossOrEvent = num1; - } - - public void SpawnWithHigherTime(int timeMult) => this.timeLeft = NPC.activeTime * timeMult; - - public void EncourageDespawn(int despawnTime) - { - if (this.timeLeft > despawnTime) - this.timeLeft = despawnTime; - this.despawnEncouraged = true; - } - - public void DiscourageDespawn(int despawnTime) - { - if (this.timeLeft < despawnTime) - this.timeLeft = despawnTime; - this.despawnEncouraged = false; - } - - public static bool WouldBeEncouragedToDespawn(int aistyle, int type) => aistyle == 4 && Main.dayTime; - - public static string getNewNPCName(int npcType) => NPC.getNewNPCNameInner(npcType); - - private static string getNewNPCNameInner(int npcType) + public static string getNewNPCName(int npcType) { switch (npcType) { @@ -683,11 +515,11 @@ namespace Terraria case 18: return "Walter"; case 19: - return "Isaac"; + return "Finn"; case 20: - return "Joseph"; + return "Isaac"; case 21: - return "Kristian"; + return "Joseph"; default: return "Ralph"; } @@ -966,7 +798,7 @@ namespace Terraria return "Darur"; } case 54: - switch (WorldGen.genRand.Next(27)) + switch (WorldGen.genRand.Next(26)) { case 0: return "Sebastian"; @@ -1536,7 +1368,7 @@ namespace Terraria return "Willy"; } case 369: - switch (WorldGen.genRand.Next(21)) + switch (WorldGen.genRand.Next(22)) { case 0: return "Bobby"; @@ -1567,16 +1399,18 @@ namespace Terraria case 13: return "Grayson"; case 14: - return "Miles"; + return "Bryce"; case 15: - return "Charles"; + return "Miles"; case 16: - return "Adam"; + return "Charles"; case 17: - return "Tyler"; + return "Adam"; case 18: - return "Jey"; + return "Tyler"; case 19: + return "Jey"; + case 20: return "Ivan"; default: return "Izzy"; @@ -1649,16 +1483,6 @@ namespace Terraria } case 550: return Language.RandomFromCategory("BartenderNames", WorldGen.genRand).Value; - case 588: - return Language.RandomFromCategory("GolferNames", WorldGen.genRand).Value; - case 633: - return Language.RandomFromCategory("BestiaryGirlNames", WorldGen.genRand).Value; - case 637: - return Language.RandomFromCategory("CatNames_Siamese", WorldGen.genRand).Value; - case 638: - return Language.RandomFromCategory("DogNames_Labrador", WorldGen.genRand).Value; - case 656: - return Language.RandomFromCategory("BunnyNames_White", WorldGen.genRand).Value; default: return ""; } @@ -1666,24 +1490,6 @@ namespace Terraria public NetworkText GetTypeNetName() => NetworkText.FromKey(Lang.GetNPCName(this.netID).Key); - public void GetLifeStats(out int statLife, out int statLifeMax) - { - statLife = this.life; - statLifeMax = this.lifeMax; - if (this.realLife == -1) - return; - statLife = Main.npc[this.realLife].life; - statLifeMax = Main.npc[this.realLife].lifeMax; - } - - public float GetLifePercent() - { - int statLife; - int statLifeMax; - this.GetLifeStats(out statLife, out statLifeMax); - return (float) statLife / (float) statLifeMax; - } - public NetworkText GetFullNetName() { if (!this.HasGivenName) @@ -1705,7 +1511,6 @@ namespace Terraria if (flag) { Main.npc[index].GivenName = NPC.getNewNPCName(npcType); - Main.npc[index].needsUniqueInfoUpdate = true; } else { @@ -1745,98 +1550,26 @@ namespace Terraria int num3 = 0; for (int index = 0; index < 200; ++index) { - if (Main.npc[index].active) + if (Main.npc[index].active && Main.npc[index].type == type) { - bool flag = false; - if (Main.npc[index].type == type) - { - flag = true; - } - else - { - switch (type) - { - case 46: - case 303: - case 337: - case 540: - if (Main.npc[index].type == 46 || Main.npc[index].type == 540 || Main.npc[index].type == 303 || Main.npc[index].type == 337) - { - flag = true; - goto label_19; - } - else - goto label_19; - case 55: - if (Main.npc[index].type == 230) - { - flag = true; - goto label_19; - } - else - break; - case 362: - case 364: - if (Main.npc[index].type == 362 || Main.npc[index].type == 363 || Main.npc[index].type == 364 || Main.npc[index].type == 365) - { - flag = true; - goto label_19; - } - else - goto label_19; - case 602: - if (Main.npc[index].type == 602 || Main.npc[index].type == 603) - { - flag = true; - goto label_19; - } - else - goto label_19; - case 608: - if (Main.npc[index].type == 608 || Main.npc[index].type == 609) - { - flag = true; - goto label_19; - } - else - goto label_19; - case 616: - case 617: - if (Main.npc[index].type == 616 || Main.npc[index].type == 617) - { - flag = true; - goto label_19; - } - else - goto label_19; - } - if (NPCID.Sets.IsDragonfly[type] && NPCID.Sets.IsDragonfly[Main.npc[index].type]) - flag = true; - } -label_19: - if (flag) - { - ++num1; - Vector2 vector2 = new Vector2(x, y); - double num4 = (double) Main.npc[index].position.X - (double) vector2.X; - float num5 = Main.npc[index].position.Y - vector2.Y; - double num6 = Math.Sqrt(num4 * num4 + (double) num5 * (double) num5); - if (num6 < 200.0) - ++num2; - if (num6 < 600.0) - ++num3; - } + ++num1; + Vector2 vector2 = new Vector2(x, y); + double num4 = (double) Main.npc[index].position.X - (double) vector2.X; + float num5 = Main.npc[index].position.Y - vector2.Y; + double num6 = Math.Sqrt(num4 * num4 + (double) num5 * (double) num5); + if (num6 < 200.0) + ++num2; + if (num6 < 600.0) + ++num3; } } return num2 < 3 && num3 < 6 && num1 < 10; } - public static int TypeToDefaultHeadIndex(int type) + public static int TypeToHeadIndex(int type) { switch (type) { - case 0: - return 0; case 17: return 2; case 18: @@ -1885,24 +1618,14 @@ label_19: return 23; case 550: return 24; - case 588: - return 25; - case 633: - return 26; - case 637: - return 27; - case 638: - return 33; - case 656: - return 39; default: return -1; } } - public static int DefaultHeadIndexToType(int headIndex) + public static int HeadIndexToType(int type) { - switch (headIndex) + switch (type) { case 1: return 22; @@ -1952,16 +1675,6 @@ label_19: return 441; case 24: return 550; - case 25: - return 588; - case 26: - return 633; - case 27: - return 637; - case 33: - return 638; - case 39: - return 656; default: return -1; } @@ -1982,7 +1695,7 @@ label_19: case 125: if ((double) this.ai[0] >= 3.0) { - num = 16; + num = 20; break; } break; @@ -2056,7 +1769,7 @@ label_19: public int BannerID() => this.netID >= -10 ? this.netID : this.type; - private void SetDefaultsFromNetId(int id, NPCSpawnParams spawnparams = default (NPCSpawnParams)) + private void SetDefaultsFromNetId(int id) { bool flag = false; int Type = NPCID.FromNetId(id); @@ -2064,8 +1777,7 @@ label_19: switch (id) { case -65: - this.SetDefaults_ForNetId(Type, spawnparams, 1.21f); - flag = false; + this.SetDefaults(Type, 1.21f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2074,8 +1786,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -64: - this.SetDefaults_ForNetId(Type, spawnparams, 0.87f); - flag = false; + this.SetDefaults(Type, 0.87f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2084,8 +1795,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -63: - this.SetDefaults_ForNetId(Type, spawnparams, 1.16f); - flag = false; + this.SetDefaults(Type, 1.16f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2094,8 +1804,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -62: - this.SetDefaults_ForNetId(Type, spawnparams, 0.78f); - flag = false; + this.SetDefaults(Type, 0.78f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2104,8 +1813,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -61: - this.SetDefaults_ForNetId(Type, spawnparams, 1.1f); - flag = false; + this.SetDefaults(Type, 1.1f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2114,8 +1822,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -60: - this.SetDefaults_ForNetId(Type, spawnparams, 0.92f); - flag = false; + this.SetDefaults(Type, 0.92f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2124,8 +1831,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -59: - this.SetDefaults_ForNetId(Type, spawnparams, 1.15f); - flag = false; + this.SetDefaults(Type, 1.15f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2134,8 +1840,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -58: - this.SetDefaults_ForNetId(Type, spawnparams, 0.8f); - flag = false; + this.SetDefaults(Type, 0.8f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2144,8 +1849,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -57: - this.SetDefaults_ForNetId(Type, spawnparams, 1.25f); - flag = false; + this.SetDefaults(Type, 1.25f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2154,8 +1858,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -56: - this.SetDefaults_ForNetId(Type, spawnparams, 0.85f); - flag = false; + this.SetDefaults(Type, 0.85f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2164,8 +1867,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -55: - this.SetDefaults_ForNetId(Type, spawnparams, 1.1f); - flag = false; + this.SetDefaults(Type, 1.1f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2174,8 +1876,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -54: - this.SetDefaults_ForNetId(Type, spawnparams, 0.9f); - flag = false; + this.SetDefaults(Type, 0.9f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2184,8 +1885,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -53: - this.SetDefaults_ForNetId(Type, spawnparams, 1.15f); - flag = false; + this.SetDefaults(Type, 1.15f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2194,8 +1894,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -52: - this.SetDefaults_ForNetId(Type, spawnparams, 0.85f); - flag = false; + this.SetDefaults(Type, 0.85f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2204,8 +1903,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -51: - this.SetDefaults_ForNetId(Type, spawnparams, 1.13f); - flag = false; + this.SetDefaults(Type, 1.13f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2214,8 +1912,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -50: - this.SetDefaults_ForNetId(Type, spawnparams, 0.87f); - flag = false; + this.SetDefaults(Type, 0.87f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2224,8 +1921,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -49: - this.SetDefaults_ForNetId(Type, spawnparams, 1.07f); - flag = false; + this.SetDefaults(Type, 1.07f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2234,8 +1930,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -48: - this.SetDefaults_ForNetId(Type, spawnparams, 0.93f); - flag = false; + this.SetDefaults(Type, 0.93f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2244,8 +1939,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -47: - this.SetDefaults_ForNetId(Type, spawnparams, 1.1f); - flag = false; + this.SetDefaults(Type, 1.1f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2254,8 +1948,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -46: - this.SetDefaults_ForNetId(Type, spawnparams, 0.9f); - flag = false; + this.SetDefaults(Type, 0.9f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2264,8 +1957,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -45: - this.SetDefaults_ForNetId(Type, spawnparams, 1.05f); - flag = false; + this.SetDefaults(Type, 1.05f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2274,8 +1966,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -44: - this.SetDefaults_ForNetId(Type, spawnparams, 0.87f); - flag = false; + this.SetDefaults(Type, 0.87f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2284,8 +1975,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -43: - this.SetDefaults_ForNetId(Type, spawnparams, 1.15f); - flag = false; + this.SetDefaults(Type, 1.15f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2294,8 +1984,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -42: - this.SetDefaults_ForNetId(Type, spawnparams, 1.1f); - flag = false; + this.SetDefaults(Type, 1.1f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2304,8 +1993,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -41: - this.SetDefaults_ForNetId(Type, spawnparams, 0.85f); - flag = false; + this.SetDefaults(Type, 0.85f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2314,8 +2002,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -40: - this.SetDefaults_ForNetId(Type, spawnparams, 0.9f); - flag = false; + this.SetDefaults(Type, 0.9f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2324,8 +2011,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -39: - this.SetDefaults_ForNetId(Type, spawnparams, 1.1f); - flag = false; + this.SetDefaults(Type, 1.1f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2334,8 +2020,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -38: - this.SetDefaults_ForNetId(Type, spawnparams, 1.15f); - flag = false; + this.SetDefaults(Type, 1.15f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2344,8 +2029,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -37: - this.SetDefaults_ForNetId(Type, spawnparams, 1.08f); - flag = false; + this.SetDefaults(Type, 1.08f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2354,8 +2038,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -36: - this.SetDefaults_ForNetId(Type, spawnparams, 0.92f); - flag = false; + this.SetDefaults(Type, 0.92f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2364,8 +2047,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -35: - this.SetDefaults_ForNetId(Type, spawnparams, 1.13f); - flag = false; + this.SetDefaults(Type, 1.13f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2374,8 +2056,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -34: - this.SetDefaults_ForNetId(Type, spawnparams, 0.87f); - flag = false; + this.SetDefaults(Type, 0.87f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2384,8 +2065,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -33: - this.SetDefaults_ForNetId(Type, spawnparams, 1.11f); - flag = false; + this.SetDefaults(Type, 1.11f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2394,8 +2074,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -32: - this.SetDefaults_ForNetId(Type, spawnparams, 0.89f); - flag = false; + this.SetDefaults(Type, 0.89f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2404,8 +2083,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -31: - this.SetDefaults_ForNetId(Type, spawnparams, 1.13f); - flag = false; + this.SetDefaults(Type, 1.13f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2414,8 +2092,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -30: - this.SetDefaults_ForNetId(Type, spawnparams, 0.93f); - flag = false; + this.SetDefaults(Type, 0.93f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2424,8 +2101,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -29: - this.SetDefaults_ForNetId(Type, spawnparams, 1.15f); - flag = false; + this.SetDefaults(Type, 1.15f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2434,8 +2110,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -28: - this.SetDefaults_ForNetId(Type, spawnparams, 0.85f); - flag = false; + this.SetDefaults(Type, 0.85f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2444,8 +2119,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -27: - this.SetDefaults_ForNetId(Type, spawnparams, 1.1f); - flag = false; + this.SetDefaults(Type, 1.1f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2454,8 +2128,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -26: - this.SetDefaults_ForNetId(Type, spawnparams, 0.9f); - flag = false; + this.SetDefaults(Type, 0.9f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2464,8 +2137,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -25: - this.SetDefaults_ForNetId(Type, spawnparams, 1.15f); - flag = false; + this.SetDefaults(Type, 1.15f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2474,8 +2146,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -24: - this.SetDefaults_ForNetId(Type, spawnparams, 0.85f); - flag = false; + this.SetDefaults(Type, 0.85f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2484,8 +2155,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -23: - this.SetDefaults_ForNetId(Type, spawnparams, 1.15f); - flag = false; + this.SetDefaults(Type, 1.15f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2494,8 +2164,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -22: - this.SetDefaults_ForNetId(Type, spawnparams, 0.85f); - flag = false; + this.SetDefaults(Type, 0.85f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2504,8 +2173,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -21: - this.SetDefaults_ForNetId(Type, spawnparams, 1.2f); - flag = false; + this.SetDefaults(Type, 1.2f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2514,7 +2182,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -20: - this.SetDefaults_ForNetId(Type, 1.1f); + this.SetDefaults(Type, 1.1f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2523,8 +2191,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -19: - this.SetDefaults_ForNetId(Type, spawnparams, 0.9f); - flag = false; + this.SetDefaults(Type, 0.9f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2533,8 +2200,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -18: - this.SetDefaults_ForNetId(Type, spawnparams, 0.8f); - flag = false; + this.SetDefaults(Type, 0.8f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2543,8 +2209,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -17: - this.SetDefaults_ForNetId(Type, spawnparams, 1.2f); - flag = false; + this.SetDefaults(Type, 1.2f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2553,8 +2218,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -16: - this.SetDefaults_ForNetId(Type, spawnparams, 0.85f); - flag = false; + this.SetDefaults(Type, 0.85f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2563,8 +2227,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -15: - this.SetDefaults_ForNetId(Type, spawnparams, 1.15f); - flag = false; + this.SetDefaults(Type, 1.15f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale * 1.1); this.life = 400; @@ -2574,8 +2237,7 @@ label_19: this.height = 44; break; case -14: - this.SetDefaults_ForNetId(Type, spawnparams, 1.15f); - flag = false; + this.SetDefaults(Type, 1.15f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale * 1.1); this.life = (int) ((double) this.life * (double) this.scale * 1.1); @@ -2584,16 +2246,14 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -13: - this.SetDefaults_ForNetId(Type, spawnparams, 0.9f); - flag = false; + this.SetDefaults(Type, 0.9f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); this.value = (float) (int) ((double) this.value * (double) this.scale); break; case -12: - this.SetDefaults_ForNetId(Type, spawnparams, 1.15f); - flag = false; + this.SetDefaults(Type, 1.15f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2602,8 +2262,7 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -11: - this.SetDefaults_ForNetId(Type, spawnparams, 0.85f); - flag = false; + this.SetDefaults(Type, 0.85f); this.defense = (int) ((double) this.defense * (double) this.scale); this.damage = (int) ((double) this.damage * (double) this.scale); this.life = (int) ((double) this.life * (double) this.scale); @@ -2612,54 +2271,53 @@ label_19: this.knockBackResist *= 2f - this.scale; break; case -10: - this.SetDefaults_ForNetId(Type, 1.1f); - flag = true; + this.SetDefaults(Type, 1.1f); this.damage = 18; this.defense = 6; this.life = 60; this.color = new Color(143, 215, 93, 100); this.value = 500f; + flag = true; break; case -9: - this.SetDefaults_ForNetId(Type, 1.2f); - flag = true; + this.SetDefaults(Type, 1.2f); this.damage = 15; this.defense = 7; this.life = 45; this.color = new Color((int) byte.MaxValue, (int) byte.MaxValue, 0, 100); this.value = 10f; + flag = true; break; case -8: - this.SetDefaults_ForNetId(Type, 1.025f); - flag = true; + this.SetDefaults(Type, 1.025f); this.damage = 12; this.defense = 4; this.life = 35; this.color = new Color((int) byte.MaxValue, 30, 0, 100); this.value = 8f; + flag = true; break; case -7: - this.SetDefaults_ForNetId(Type, 1.2f); - flag = true; + this.SetDefaults(Type, 1.2f); this.damage = 12; this.defense = 6; this.life = 40; this.knockBackResist *= 0.9f; this.color = new Color(200, 0, (int) byte.MaxValue, 150); this.value = 10f; + flag = true; break; case -6: - this.SetDefaults_ForNetId(Type, 1.05f); - flag = true; + this.SetDefaults(Type, 1.05f); this.damage = 15; this.defense = 4; this.life = 45; this.color = new Color(0, 0, 0, 50); this.value = 20f; + flag = true; break; case -5: - this.SetDefaults_ForNetId(Type, 0.9f); - flag = true; + this.SetDefaults(Type, 0.9f); this.damage = 13; this.defense = 4; this.life = 30; @@ -2667,45 +2325,46 @@ label_19: this.alpha = 120; this.color = new Color(0, 0, 0, 50); this.value = 10f; + flag = true; break; case -4: - this.SetDefaults_ForNetId(Type, 0.6f); - flag = true; + this.SetDefaults(Type, 0.6f); this.damage = 5; this.defense = 5; this.life = 150; this.knockBackResist *= 1.4f; this.color = new Color(250, 30, 90, 90); this.value = 10000f; - this.rarity = 2; + flag = true; + this.rarity = 1; break; case -3: - this.SetDefaults_ForNetId(Type, 0.9f); - flag = true; + this.SetDefaults(Type, 0.9f); this.damage = 6; this.defense = 0; this.life = 14; this.knockBackResist *= 1.2f; this.color = new Color(0, 220, 40, 100); this.value = 3f; + flag = true; break; case -2: - this.SetDefaults_ForNetId(Type, 0.9f); - flag = true; + this.SetDefaults(Type, 0.9f); this.damage = 45; this.defense = 20; this.life = 90; this.knockBackResist *= 1.2f; this.value = 100f; + flag = true; break; case -1: - this.SetDefaults_ForNetId(Type, 0.6f); - flag = true; + this.SetDefaults(Type, 0.6f); this.damage = 45; this.defense = 10; this.life = 90; this.knockBackResist *= 1.2f; this.value = 100f; + flag = true; break; default: return; @@ -2714,10 +2373,9 @@ label_19: this.lifeMax = this.life; this.defDamage = this.damage; this.defDefense = this.defense; - if (!flag) + if (!(Main.expertMode & flag)) return; - this.ScaleStats(spawnparams.playerCountForMultiplayerDifficultyOverride, spawnparams.gameModeData, spawnparams.strengthMultiplierOverride); - this.life = this.lifeMax; + this.scaleStats(); } public void SetDefaultsKeepPlayerInteraction(int Type) @@ -2730,70 +2388,33 @@ label_19: this.playerInteraction[index] = flagArray[index]; } - public void SetDefaults_ForNetId(int Type, float scaleOverride) => this.SetDefaults(Type); - - public void SetDefaults_ForNetId(int Type, NPCSpawnParams spawnparams, float scaleOverride) => this.SetDefaults(Type, spawnparams.WithScale(scaleOverride)); - - public void SetDefaults(int Type, NPCSpawnParams spawnparams = default (NPCSpawnParams)) + public void SetDefaults(int Type, float scaleOverride = -1f) { - if (spawnparams.gameModeData == null) - spawnparams.gameModeData = Main.GameModeInfo; - if (Main.getGoodWorld && spawnparams.sizeScaleOverride.HasValue) - { - ref NPCSpawnParams local = ref spawnparams; - float? sizeScaleOverride1 = spawnparams.sizeScaleOverride; - float? sizeScaleOverride2 = spawnparams.sizeScaleOverride; - float? nullable1 = spawnparams.sizeScaleOverride; - float? nullable2 = sizeScaleOverride2.HasValue & nullable1.HasValue ? new float?(sizeScaleOverride2.GetValueOrDefault() * nullable1.GetValueOrDefault()) : new float?(); - float? nullable3; - if (!(sizeScaleOverride1.HasValue & nullable2.HasValue)) - { - nullable1 = new float?(); - nullable3 = nullable1; - } - else - nullable3 = new float?(sizeScaleOverride1.GetValueOrDefault() + nullable2.GetValueOrDefault()); - float? nullable4 = nullable3; - float num = 2f; - float? nullable5; - if (!nullable4.HasValue) - { - nullable2 = new float?(); - nullable5 = nullable2; - } - else - nullable5 = new float?(nullable4.GetValueOrDefault() / num); - local.sizeScaleOverride = nullable5; - } if (Type < 0) { - this.SetDefaultsFromNetId(Type, spawnparams); + this.SetDefaultsFromNetId(Type); } else { this.waterMovementSpeed = this.lavaMovementSpeed = 0.5f; this.honeyMovementSpeed = 0.25f; - this.netOffset *= 0.0f; this.altTexture = 0; - this.townNpcVariationIndex = 0; this.nameOver = 0.0f; this.takenDamageMultiplier = 1f; - this.extraValue = 0; + this.extraValue = 0.0f; for (int index = 0; index < this.playerInteraction.Length; ++index) this.playerInteraction[index] = false; this.rarity = 0; this.dontCountMe = false; this.releaseOwner = (short) byte.MaxValue; this.catchItem = (short) 0; - this.needsUniqueInfoUpdate = true; + this.npcNameLookup = (byte) 0; this.netStream = (byte) 32; bool flag = false; this.netID = 0; this.netAlways = false; this.netSpam = 0; this.SpawnedFromStatue = false; - this.statsAreScaledForThisManyPlayers = 0; - this.strengthMultiplier = 1f; int newSize = 10; if (Type >= 0) newSize = NPCID.Sets.TrailCacheLength[Type]; @@ -2813,7 +2434,7 @@ label_19: this.buffTime[index] = 0; this.buffType[index] = 0; } - for (int index = 0; index < 323; ++index) + for (int index = 0; index < 206; ++index) this.buffImmune[index] = false; this.setFrameSize = false; this.buffImmune[31] = true; @@ -2822,13 +2443,6 @@ label_19: this.lifeRegen = 0; this.lifeRegenExpectedLossPerSecond = -1; this.lifeRegenCount = 0; - this.markedByScytheWhip = false; - this.markedByThornWhip = false; - this.markedByFireWhip = false; - this.markedByRainbowWhip = false; - this.markedByBlandWhip = false; - this.markedBySwordWhip = false; - this.markedByMaceWhip = false; this.poisoned = false; this.soulDrain = false; this.venom = false; @@ -2854,7 +2468,6 @@ label_19: this.homeless = false; this.homeTileX = -1; this.homeTileY = -1; - this.housingCategory = 0; this.friendly = false; this.behindTiles = false; this.boss = false; @@ -2890,7 +2503,7 @@ label_19: this.chaseable = true; this.breath = 200; this.breathCounter = 0; - this.reflectsProjectiles = false; + this.reflectingProjectiles = false; this.canGhostHeal = true; this.javelined = false; this.daybreak = false; @@ -2898,7 +2511,6 @@ label_19: this.dryadBane = false; this.betsysCurse = false; this.oiled = false; - this.despawnEncouraged = false; for (int index = 0; index < NPC.maxAI; ++index) this.ai[index] = 0.0f; for (int index = 0; index < NPC.maxAI; ++index) @@ -3058,7 +2670,7 @@ label_19: this.knockBackResist = 0.0f; this.noGravity = true; this.noTileCollide = true; - this.SpawnWithHigherTime(30); + this.timeLeft = NPC.activeTime * 30; this.boss = true; this.value = 30000f; this.npcSlots = 5f; @@ -3207,19 +2819,18 @@ label_19: this.netAlways = true; this.damage = 22; this.defense = 2; - this.lifeMax = 150; + this.lifeMax = 65; this.HitSound = SoundID.NPCHit1; this.DeathSound = SoundID.NPCDeath1; this.noGravity = true; this.noTileCollide = true; this.knockBackResist = 0.0f; this.behindTiles = true; - this.value = 800f; + this.value = 300f; this.scale = 1f; this.buffImmune[20] = true; this.buffImmune[24] = true; this.buffImmune[39] = true; - this.alpha = (int) byte.MaxValue; } else if (this.type == 14) { @@ -3236,13 +2847,12 @@ label_19: this.noTileCollide = true; this.knockBackResist = 0.0f; this.behindTiles = true; - this.value = 800f; + this.value = 300f; this.scale = 1f; this.buffImmune[20] = true; this.buffImmune[24] = true; this.buffImmune[39] = true; this.dontCountMe = true; - this.alpha = (int) byte.MaxValue; } else if (this.type == 15) { @@ -3252,20 +2862,19 @@ label_19: this.netAlways = true; this.damage = 11; this.defense = 8; - this.lifeMax = 150; + this.lifeMax = 220; this.HitSound = SoundID.NPCHit1; this.DeathSound = SoundID.NPCDeath1; this.noGravity = true; this.noTileCollide = true; this.knockBackResist = 0.0f; this.behindTiles = true; - this.value = 800f; + this.value = 300f; this.scale = 1f; this.buffImmune[20] = true; this.buffImmune[24] = true; this.buffImmune[39] = true; this.dontCountMe = true; - this.alpha = (int) byte.MaxValue; } else if (this.type == 16) { @@ -3659,7 +3268,6 @@ label_19: this.value = 250f; this.buffImmune[20] = true; this.buffImmune[31] = false; - this.rarity = 1; } else if (this.type == 45) { @@ -3745,7 +3353,7 @@ label_19: this.value = 10000f; this.scale = 1.25f; this.buffImmune[20] = true; - this.SpawnWithHigherTime(30); + this.timeLeft = NPC.activeTime * 30; } else if (this.type == 51) { @@ -3982,9 +3590,9 @@ label_19: this.damage = 32; this.defense = 8; this.lifeMax = 140; - this.HitSound = SoundID.NPCHit21; + this.HitSound = SoundID.NPCHit1; this.knockBackResist = 0.8f; - this.DeathSound = SoundID.NPCDeath24; + this.DeathSound = SoundID.NPCDeath1; this.value = 1000f; this.lavaImmune = true; this.buffImmune[24] = true; @@ -4684,14 +4292,13 @@ label_19: this.width = 34; this.height = 78; this.aiStyle = 3; - this.damage = 60; - this.defense = 25; - this.lifeMax = 800; + this.damage = 50; + this.defense = 20; + this.lifeMax = 400; this.HitSound = SoundID.NPCHit1; this.DeathSound = SoundID.NPCDeath2; - this.knockBackResist = 0.2f; - this.value = 10000f; - this.rarity = 1; + this.knockBackResist = 0.4f; + this.value = 8000f; } else if (this.type == 110) { @@ -4930,7 +4537,7 @@ label_19: this.knockBackResist = 0.0f; this.noGravity = true; this.noTileCollide = true; - this.SpawnWithHigherTime(30); + this.timeLeft = NPC.activeTime * 30; this.boss = true; this.value = 120000f; this.npcSlots = 5f; @@ -4948,7 +4555,7 @@ label_19: this.knockBackResist = 0.0f; this.noGravity = true; this.noTileCollide = true; - this.SpawnWithHigherTime(30); + this.timeLeft = NPC.activeTime * 30; this.boss = true; this.value = 120000f; this.npcSlots = 5f; @@ -5259,7 +4866,6 @@ label_19: this.buffImmune[31] = false; this.buffImmune[24] = true; this.buffImmune[39] = true; - this.coldDamage = true; } else if (this.type == 144) { @@ -5500,13 +5106,13 @@ label_19: this.defense = 40; this.lifeMax = 350; this.HitSound = SoundID.NPCHit29; - this.DeathSound = SoundID.NPCDeath32; + this.DeathSound = SoundID.NPCDeath31; this.knockBackResist = 0.25f; this.value = 500f; this.buffImmune[20] = true; this.buffImmune[31] = false; this.npcSlots = 0.5f; - this.SpawnWithHigherTime(2); + this.timeLeft = NPC.activeTime * 2; } else if (this.type == 238) { @@ -5518,10 +5124,10 @@ label_19: this.defense = 40; this.lifeMax = 350; this.HitSound = SoundID.NPCHit29; - this.DeathSound = SoundID.NPCDeath32; + this.DeathSound = SoundID.NPCDeath31; this.knockBackResist = 0.25f; this.value = 500f; - this.SpawnWithHigherTime(2); + this.timeLeft = NPC.activeTime * 2; this.npcSlots = 0.5f; this.buffImmune[20] = true; this.buffImmune[31] = false; @@ -5535,10 +5141,10 @@ label_19: this.defense = 10; this.lifeMax = 80; this.HitSound = SoundID.NPCHit29; - this.DeathSound = SoundID.NPCDeath32; + this.DeathSound = SoundID.NPCDeath31; this.knockBackResist = 0.25f; this.value = 100f; - this.SpawnWithHigherTime(2); + this.timeLeft = NPC.activeTime * 2; this.npcSlots = 0.5f; this.buffImmune[20] = true; } @@ -5552,10 +5158,10 @@ label_19: this.defense = 10; this.lifeMax = 80; this.HitSound = SoundID.NPCHit29; - this.DeathSound = SoundID.NPCDeath32; + this.DeathSound = SoundID.NPCDeath31; this.knockBackResist = 0.25f; this.value = 100f; - this.SpawnWithHigherTime(2); + this.timeLeft = NPC.activeTime * 2; this.npcSlots = 0.5f; this.buffImmune[20] = true; } @@ -5990,7 +5596,6 @@ label_19: this.DeathSound = SoundID.NPCDeath1; this.knockBackResist = 0.5f; this.rarity = 1; - this.value = (float) Item.buyPrice(gold: 5); } else if (this.type == 196) { @@ -6003,7 +5608,7 @@ label_19: this.HitSound = SoundID.NPCHit1; this.DeathSound = SoundID.NPCDeath2; this.knockBackResist = 0.4f; - this.value = (float) Item.buyPrice(gold: 5); + this.value = 10000f; this.buffImmune[31] = false; this.rarity = 1; } @@ -6302,7 +5907,6 @@ label_19: this.value = 50000f; this.buffImmune[20] = true; this.buffImmune[31] = true; - this.rarity = 1; } else if (this.type == 217) { @@ -6315,7 +5919,6 @@ label_19: this.HitSound = SoundID.NPCHit1; this.DeathSound = SoundID.NPCDeath16; this.value = 60f; - this.rarity = 1; } else if (this.type == 218) { @@ -6328,7 +5931,6 @@ label_19: this.HitSound = SoundID.NPCHit1; this.DeathSound = SoundID.NPCDeath16; this.value = 60f; - this.rarity = 1; } else if (this.type == 219) { @@ -6341,7 +5943,6 @@ label_19: this.HitSound = SoundID.NPCHit1; this.DeathSound = SoundID.NPCDeath16; this.value = 60f; - this.rarity = 1; } else if (this.type == 220) { @@ -6354,7 +5955,6 @@ label_19: this.HitSound = SoundID.NPCHit1; this.DeathSound = SoundID.NPCDeath1; this.value = 60f; - this.rarity = 1; } else if (this.type == 221) { @@ -6369,7 +5969,6 @@ label_19: this.DeathSound = SoundID.NPCDeath1; this.value = 100f; this.alpha = 20; - this.rarity = 1; } else if (this.type == 222) { @@ -6384,9 +5983,9 @@ label_19: this.knockBackResist = 0.0f; this.noGravity = true; this.noTileCollide = true; - this.SpawnWithHigherTime(30); + this.timeLeft = NPC.activeTime * 30; this.boss = true; - this.value = 50000f; + this.value = 100000f; this.npcSlots = 7f; } else if (this.type == 223) @@ -6414,7 +6013,7 @@ label_19: this.HitSound = SoundID.NPCHit1; this.knockBackResist = 0.8f; this.DeathSound = SoundID.NPCDeath1; - this.value = 300f; + this.value = 90f; this.buffImmune[31] = false; } if (this.type == 225) @@ -6428,7 +6027,7 @@ label_19: this.HitSound = SoundID.NPCHit1; this.DeathSound = SoundID.NPCDeath1; this.knockBackResist = 0.75f; - this.value = 200f; + this.value = 25f; this.buffImmune[20] = true; this.buffImmune[31] = false; } @@ -6588,7 +6187,7 @@ label_19: this.DeathSound = SoundID.NPCDeath1; this.knockBackResist = 0.25f; this.value = 1000f; - this.SpawnWithHigherTime(2); + this.timeLeft = NPC.activeTime * 2; this.npcSlots = 0.75f; this.buffImmune[20] = true; } @@ -6605,7 +6204,7 @@ label_19: this.DeathSound = SoundID.NPCDeath1; this.knockBackResist = 0.25f; this.value = 1000f; - this.SpawnWithHigherTime(2); + this.timeLeft = NPC.activeTime * 2; this.npcSlots = 0.75f; this.buffImmune[20] = true; } @@ -6621,14 +6220,14 @@ label_19: this.DeathSound = SoundID.NPCDeath23; this.knockBackResist = 0.5f; this.value = 130f; - this.SpawnWithHigherTime(2); + this.timeLeft = NPC.activeTime * 2; this.buffImmune[20] = true; } else if (this.type == 240) { this.noGravity = true; - this.width = 36; - this.height = 36; + this.width = 50; + this.height = 20; this.aiStyle = 40; this.damage = 30; this.defense = 8; @@ -6637,7 +6236,7 @@ label_19: this.DeathSound = SoundID.NPCDeath23; this.knockBackResist = 0.5f; this.value = 130f; - this.SpawnWithHigherTime(2); + this.timeLeft = NPC.activeTime * 2; this.buffImmune[20] = true; } else if (this.type == 241) @@ -6793,7 +6392,6 @@ label_19: this.knockBackResist = 0.3f; this.value = (float) Item.buyPrice(silver: 50); this.buffImmune[31] = false; - this.rarity = 2; } else if (this.type == 252) { @@ -7006,10 +6604,10 @@ label_19: this.lifeMax = 1000; this.HitSound = SoundID.NPCHit9; this.DeathSound = SoundID.NPCDeath11; - this.knockBackResist = 0.5f; + this.knockBackResist = 0.0f; this.noGravity = true; this.noTileCollide = true; - this.SpawnWithHigherTime(30); + this.timeLeft = NPC.activeTime * 30; this.boss = true; this.value = 50000f; this.npcSlots = 6f; @@ -7618,15 +7216,15 @@ label_19: this.width = 24; this.height = 44; this.aiStyle = 22; - this.damage = 18; - this.defense = 8; - this.lifeMax = 70; + this.damage = 40; + this.defense = 14; + this.lifeMax = 100; this.HitSound = SoundID.NPCHit1; this.DeathSound = SoundID.NPCDeath6; this.alpha = 100; - this.value = 90f; + this.value = 700f; flag = true; - this.knockBackResist = 0.6f; + this.knockBackResist = 0.7f; } else if (this.type == 317) { @@ -7808,7 +7406,6 @@ label_19: flag = true; this.dontTakeDamage = true; this.npcSlots = 0.0f; - this.dontCountMe = true; } else if (this.type == 329) { @@ -8034,7 +7631,7 @@ label_19: this.HitSound = SoundID.NPCHit7; this.DeathSound = SoundID.NPCDeath5; this.knockBackResist = 0.0f; - this.value = 50000f; + this.value = 10000f; this.buffImmune[20] = true; this.noTileCollide = true; this.noGravity = true; @@ -8268,8 +7865,8 @@ label_19: } else if (this.type == 361) { - this.width = 12; - this.height = 10; + this.width = 18; + this.height = 20; this.aiStyle = 7; this.damage = 0; this.defense = 0; @@ -8380,10 +7977,10 @@ label_19: this.npcSlots = 10f; this.HitSound = SoundID.NPCHit14; this.DeathSound = SoundID.NPCDeath20; - this.value = 250000f; + this.value = 10000f; this.boss = true; this.netAlways = true; - this.SpawnWithHigherTime(30); + this.timeLeft = NPC.activeTime * 30; this.buffImmune[20] = true; this.buffImmune[24] = true; this.buffImmune[31] = true; @@ -8481,7 +8078,7 @@ label_19: else if (this.type == 377) { this.width = 14; - this.height = 10; + this.height = 12; this.aiStyle = 1; this.damage = 0; this.defense = 0; @@ -8498,7 +8095,7 @@ label_19: this.width = 20; this.height = 26; this.aiStyle = 41; - this.damage = 200; + this.damage = 80; this.defense = 30; this.lifeMax = 200; this.HitSound = SoundID.NPCHit1; @@ -8752,7 +8349,7 @@ label_19: this.DeathSound = SoundID.NPCDeath14; this.npcSlots = 0.0f; this.noGravity = true; - this.SpawnWithHigherTime(30); + this.timeLeft = NPC.activeTime * 30; this.chaseable = false; this.netAlways = true; this.rarity = 1; @@ -8805,7 +8402,7 @@ label_19: this.aiStyle = 77; this.HitSound = SoundID.NPCHit57; this.DeathSound = (LegacySoundStyle) null; - this.value = 1000000f; + this.value = 0.0f; this.npcSlots = 6f; this.knockBackResist = 0.0f; this.noGravity = true; @@ -8868,7 +8465,6 @@ label_19: this.noTileCollide = true; this.dontTakeDamage = true; this.netAlways = true; - this.chaseable = false; } else if (this.type == 438) { @@ -8901,10 +8497,10 @@ label_19: this.npcSlots = 10f; this.HitSound = SoundID.NPCHit55; this.DeathSound = SoundID.NPCDeath59; - this.value = 100000f; + this.value = 10000f; this.boss = true; this.netAlways = true; - this.SpawnWithHigherTime(30); + this.timeLeft = NPC.activeTime * 30; flag = true; } else if (this.type == 440) @@ -8922,7 +8518,7 @@ label_19: this.HitSound = SoundID.NPCHit2; this.DeathSound = SoundID.NPCDeath2; this.netAlways = true; - this.SpawnWithHigherTime(30); + this.timeLeft = NPC.activeTime * 30; flag = true; this.chaseable = false; } @@ -8971,8 +8567,8 @@ label_19: } else if (this.type == 445) { - this.width = 12; - this.height = 10; + this.width = 18; + this.height = 20; this.aiStyle = 7; this.damage = 0; this.defense = 0; @@ -8985,7 +8581,7 @@ label_19: else if (this.type == 446) { this.width = 14; - this.height = 10; + this.height = 12; this.aiStyle = 1; this.damage = 0; this.defense = 0; @@ -9099,7 +8695,6 @@ label_19: this.DeathSound = SoundID.NPCDeath2; this.knockBackResist = 0.5f; this.npcSlots = 7f; - this.rarity = 1; } else if (this.type == 454) { @@ -9215,7 +8810,7 @@ label_19: this.buffImmune[20] = true; this.buffImmune[24] = true; this.buffImmune[39] = true; - this.rarity = 5; + this.rarity = 2; } else if (this.type == 480) { @@ -9229,7 +8824,6 @@ label_19: this.DeathSound = SoundID.NPCDeath1; this.knockBackResist = 0.15f; this.value = 1000f; - this.rarity = 1; } else if (this.type == 481) { @@ -9255,7 +8849,7 @@ label_19: this.defense = 18; this.lifeMax = 110; this.HitSound = SoundID.NPCHit41; - this.DeathSound = SoundID.NPCDeath43; + this.DeathSound = SoundID.NPCDeath44; this.knockBackResist = 0.35f; this.value = 500f; this.buffImmune[20] = true; @@ -9430,16 +9024,16 @@ label_19: this.width = 22; this.height = 22; this.aiStyle = 6; - this.damage = 18; + this.damage = 34; this.defense = 0; - this.lifeMax = 60; + this.lifeMax = 80; this.HitSound = SoundID.NPCHit1; this.DeathSound = SoundID.NPCDeath1; this.noGravity = true; this.noTileCollide = true; this.knockBackResist = 0.0f; this.behindTiles = true; - this.value = 130f; + this.value = 140f; } else if (this.type == 514) { @@ -9447,16 +9041,16 @@ label_19: this.height = 22; this.aiStyle = 6; this.netAlways = true; - this.damage = 7; - this.defense = 16; - this.lifeMax = 60; + this.damage = 18; + this.defense = 12; + this.lifeMax = 80; this.HitSound = SoundID.NPCHit1; this.DeathSound = SoundID.NPCDeath1; this.noGravity = true; this.noTileCollide = true; this.knockBackResist = 0.0f; this.behindTiles = true; - this.value = 130f; + this.value = 140f; this.dontCountMe = true; this.npcSlots = 0.0f; } @@ -9466,16 +9060,16 @@ label_19: this.height = 22; this.aiStyle = 6; this.netAlways = true; - this.damage = 7; + this.damage = 16; this.defense = 20; - this.lifeMax = 60; + this.lifeMax = 80; this.HitSound = SoundID.NPCHit1; this.DeathSound = SoundID.NPCDeath1; this.noGravity = true; this.noTileCollide = true; this.knockBackResist = 0.0f; this.behindTiles = true; - this.value = 130f; + this.value = 140f; this.dontCountMe = true; this.npcSlots = 0.0f; } @@ -9536,56 +9130,28 @@ label_19: } else if (this.type == 508) { - this.width = 50; + this.width = 33; this.height = 31; this.aiStyle = 3; - this.damage = 38; - this.defense = 22; - this.lifeMax = 110; + this.damage = 24; + this.defense = 16; + this.lifeMax = 70; this.HitSound = SoundID.NPCHit31; this.DeathSound = SoundID.NPCDeath34; - this.knockBackResist = 0.4f; - this.value = 175f; + this.knockBackResist = 0.2f; + this.value = 80f; this.buffImmune[31] = false; + this.npcSlots = 0.8f; } else if (this.type == 509) { this.width = 40; this.height = 31; this.aiStyle = 44; - this.damage = 34; - this.defense = 18; - this.lifeMax = 90; - this.knockBackResist = 0.3f; - this.HitSound = SoundID.NPCHit32; - this.DeathSound = SoundID.NPCDeath35; - this.value = 1775f; - this.buffImmune[31] = false; - } - else if (this.type == 580) - { - this.width = 26; - this.height = 26; - this.aiStyle = 3; - this.damage = 25; - this.defense = 10; - this.lifeMax = 80; - this.HitSound = SoundID.NPCHit31; - this.DeathSound = SoundID.NPCDeath34; - this.knockBackResist = 0.5f; - this.value = 80f; - this.buffImmune[31] = false; - this.npcSlots = 0.8f; - } - else if (this.type == 581) - { - this.width = 30; - this.height = 22; - this.aiStyle = 44; - this.damage = 29; - this.defense = 8; - this.lifeMax = 60; - this.knockBackResist = 0.5f; + this.damage = 30; + this.defense = 12; + this.lifeMax = 50; + this.knockBackResist = 0.6f; this.HitSound = SoundID.NPCHit32; this.DeathSound = SoundID.NPCDeath35; this.value = 90f; @@ -9657,7 +9223,7 @@ label_19: this.DeathSound = SoundID.NPCDeath19; this.knockBackResist = 0.5f; this.value = 600f; - this.SpawnWithHigherTime(2); + this.timeLeft = NPC.activeTime * 2; this.buffImmune[20] = true; this.buffImmune[70] = true; } @@ -9674,7 +9240,7 @@ label_19: this.DeathSound = SoundID.NPCDeath19; this.knockBackResist = 0.5f; this.value = 600f; - this.SpawnWithHigherTime(2); + this.timeLeft = NPC.activeTime * 2; this.buffImmune[20] = true; this.buffImmune[70] = true; } @@ -10096,7 +9662,7 @@ label_19: { this.npcSlots = 2f; this.width = 46; - this.height = 52; + this.height = 32; this.aiStyle = 39; this.damage = 80; this.defense = 34; @@ -10356,7 +9922,6 @@ label_19: else if (this.type == 477) { this.noGravity = true; - this.netAlways = true; this.width = 80; this.height = 50; this.aiStyle = 88; @@ -10368,7 +9933,6 @@ label_19: this.value = 50000f; this.knockBackResist = 0.2f; this.buffImmune[20] = true; - this.rarity = 1; } else if (this.type == 478) { @@ -10403,7 +9967,7 @@ label_19: { this.scale = 0.9f; this.width = 18; - this.height = 38; + this.height = 40; this.aiStyle = 3; this.damage = 12; this.defense = 4; @@ -10418,7 +9982,7 @@ label_19: { this.scale = 0.95f; this.width = 18; - this.height = 38; + this.height = 40; this.aiStyle = 3; this.damage = 20; this.defense = 6; @@ -10433,7 +9997,7 @@ label_19: { this.scale = 1.1f; this.width = 18; - this.height = 38; + this.height = 40; this.aiStyle = 3; this.damage = 25; this.defense = 8; @@ -10447,7 +10011,7 @@ label_19: else if (this.type == 29) { this.width = 18; - this.height = 38; + this.height = 40; this.aiStyle = 8; this.damage = 20; this.defense = 2; @@ -10476,7 +10040,7 @@ label_19: { this.scale = 0.95f; this.width = 18; - this.height = 38; + this.height = 40; this.aiStyle = 3; this.damage = 20; this.defense = 6; @@ -10490,7 +10054,7 @@ label_19: else if (this.type == 471) { this.width = 18; - this.height = 38; + this.height = 40; this.aiStyle = 3; this.damage = 80; this.defense = 26; @@ -10500,7 +10064,6 @@ label_19: this.knockBackResist = 0.15f; this.value = 5000f; flag = true; - this.rarity = 1; } else if (this.type == 472) { @@ -10632,15 +10195,15 @@ label_19: this.width = 30; this.height = 24; this.aiStyle = 1; - this.damage = 15; - this.defense = 5; - this.lifeMax = 50; + this.damage = 11; + this.defense = 8; + this.lifeMax = 60; this.HitSound = SoundID.NPCHit1; this.DeathSound = SoundID.NPCDeath1; this.alpha = 50; this.color = new Color((int) byte.MaxValue, 250, 0, 0) * 0.2f; this.value = 75f; - this.knockBackResist = 0.7f; + this.knockBackResist = 0.8f; this.buffImmune[20] = true; this.buffImmune[31] = false; } @@ -10751,12 +10314,13 @@ label_19: this.height = 30; this.aiStyle = 26; this.damage = 30; - this.defense = 6; - this.lifeMax = 50; + this.defense = 10; + this.lifeMax = 60; this.HitSound = SoundID.NPCHit11; this.DeathSound = SoundID.NPCDeath15; this.knockBackResist = 0.8f; - this.value = 100f; + this.value = 130f; + this.behindTiles = true; } else if (this.type == 547) { @@ -11335,837 +10899,24 @@ label_19: this.scale = 1f; this.rarity = 1; } - else if (this.type == 582) - { - this.width = 18; - this.height = 18; - this.aiStyle = 3; - this.damage = 12; - this.defense = 4; - this.lifeMax = 45; - this.HitSound = SoundID.NPCHit31; - this.DeathSound = SoundID.NPCDeath34; - this.knockBackResist = 0.75f; - this.value = 40f; - this.buffImmune[31] = false; - this.npcSlots = 0.4f; - } - else if (this.type == 583 || this.type == 584 || this.type == 585) - { - this.width = 18; - this.height = 20; - this.aiStyle = 112; - this.damage = 0; - this.defense = 0; - this.lifeMax = 5; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - switch (this.type) - { - case 583: - this.catchItem = (short) 4068; - break; - case 584: - this.catchItem = (short) 4069; - break; - case 585: - this.catchItem = (short) 4070; - break; - } - this.noGravity = true; - this.rarity = 2; - for (int index = 0; index < 323; ++index) - this.buffImmune[index] = true; - } - else if (this.type == 586) - { - this.width = 18; - this.height = 40; - this.aiStyle = 3; - this.damage = 40; - this.defense = 20; - this.lifeMax = 400; - this.HitSound = SoundID.NPCHit18; - this.DeathSound = SoundID.NPCDeath21; - this.knockBackResist = 0.0f; - this.value = 1000f; - this.buffImmune[31] = false; - this.alpha = (int) byte.MaxValue; - this.rarity = 1; - } - else if (this.type == 587) - { - this.width = 32; - this.height = 18; - this.aiStyle = 44; - this.damage = 35; - this.defense = 18; - this.lifeMax = 300; - this.HitSound = SoundID.NPCHit1; - this.knockBackResist = 0.0f; - this.DeathSound = SoundID.NPCDeath1; - this.value = 1000f; - this.buffImmune[31] = false; - this.alpha = (int) byte.MaxValue; - this.rarity = 1; - } - else if (this.type == 588) - { - this.townNPC = true; - this.friendly = true; - this.width = 18; - this.height = 40; - this.aiStyle = 7; - this.damage = 10; - this.defense = 15; - this.lifeMax = 250; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.knockBackResist = 0.5f; - } - else if (this.type == 589) - { - this.friendly = true; - this.width = 18; - this.height = 34; - this.aiStyle = 0; - this.damage = 10; - this.defense = 15; - this.lifeMax = 250; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.knockBackResist = 0.5f; - this.rarity = 1; - } - else if (this.type == 590 || this.type == 591) - { - this.width = 18; - this.height = 40; - this.aiStyle = 3; - this.damage = 14; - this.defense = 6; - this.lifeMax = 45; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath2; - this.knockBackResist = 0.5f; - this.value = 60f; - this.buffImmune[31] = false; - } - else if (this.type == 592) - { - this.noGravity = true; - this.width = 20; - this.height = 18; - this.aiStyle = 16; - this.damage = 0; - this.defense = 0; - this.lifeMax = 5; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.knockBackResist = 0.5f; - this.catchItem = (short) 4274; - this.rarity = 3; - } - else if (this.type == 593) - { - this.width = 18; - this.height = 20; - this.aiStyle = 7; - this.damage = 0; - this.defense = 0; - this.lifeMax = 5; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.catchItem = (short) 4274; - this.rarity = 3; - } - else if (this.type == 594) - { - this.width = 20; - this.height = 20; - this.aiStyle = 113; - this.damage = 0; - this.defense = 0; - this.knockBackResist = 0.3f; - this.lifeMax = 1; - this.DeathSound = SoundID.NPCDeath63; - this.value = 0.0f; - this.noGravity = true; - } - else if (this.type >= 595 && this.type <= 601) - { - this.timeLeft *= 3; - this.width = 10; - this.height = 10; - this.aiStyle = 114; - this.damage = 0; - this.defense = 0; - this.lifeMax = 5; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.npcSlots = 0.25f; - this.noGravity = true; - if (this.type == 601) - this.rarity = 3; - this.catchItem = (short) (this.type - 595 + 4334); - } - else if (this.type == 602) - { - this.width = 22; - this.height = 26; - this.aiStyle = 7; - this.damage = 0; - this.defense = 0; - this.lifeMax = 5; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.catchItem = (short) 4359; - } - else if (this.type == 603) - { - this.width = 28; - this.height = 22; - this.aiStyle = 68; - this.damage = 0; - this.defense = 0; - this.lifeMax = 5; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.catchItem = (short) 4359; - } - else if (this.type == 604 || this.type == 605) - { - this.width = 10; - this.height = 10; - this.aiStyle = 115; - this.damage = 0; - this.defense = 0; - this.lifeMax = 5; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.npcSlots = 0.25f; - this.noGravity = true; - if (this.type == 605) - this.rarity = 3; - this.catchItem = (short) (this.type - 604 + 4361); - } - else if (this.type == 606) - { - this.width = 10; - this.height = 4; - this.aiStyle = 66; - this.damage = 0; - this.defense = 0; - this.lifeMax = 5; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.npcSlots = 0.1f; - this.catchItem = (short) 4363; - this.friendly = true; - } - else if (this.type == 607) - { - this.noGravity = true; - this.width = 20; - this.height = 18; - this.aiStyle = 16; - this.damage = 0; - this.defense = 0; - this.lifeMax = 5; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.knockBackResist = 0.5f; - this.catchItem = (short) 4373; - } - else if (this.type == 608) - { - this.width = 22; - this.height = 26; - this.aiStyle = 7; - this.damage = 0; - this.defense = 0; - this.lifeMax = 5; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.catchItem = (short) 4374; - } - else if (this.type == 609) - { - this.width = 28; - this.height = 22; - this.aiStyle = 68; - this.damage = 0; - this.defense = 0; - this.lifeMax = 5; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.catchItem = (short) 4374; - } - else if (this.type == 610) - { - this.width = 14; - this.height = 12; - this.aiStyle = 7; - this.damage = 0; - this.defense = 0; - this.lifeMax = 5; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath4; - this.npcSlots = 0.25f; - this.catchItem = (short) 4375; - } - else if (this.type == 611) - { - this.width = 18; - this.height = 34; - this.aiStyle = 24; - this.damage = 0; - this.defense = 0; - this.lifeMax = 5; - this.HitSound = SoundID.NPCHit1; - this.knockBackResist = 0.8f; - this.DeathSound = SoundID.NPCDeath1; - this.catchItem = (short) 4395; - this.npcSlots = 0.4f; - } - else if (this.type == 612 || this.type == 613) - { - this.width = 10; - this.height = 10; - this.aiStyle = 116; - this.damage = 0; - this.defense = 0; - this.lifeMax = 5; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.npcSlots = 0.25f; - if (this.type == 613) - this.rarity = 3; - this.catchItem = (short) (this.type - 612 + 4418); - this.waterMovementSpeed = 1f; - this.lavaMovementSpeed = 1f; - this.honeyMovementSpeed = 1f; - } - else if (this.type == 614) - { - this.width = 18; - this.height = 20; - this.aiStyle = 7; - this.damage = 0; - this.defense = 0; - this.lifeMax = 5; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = (LegacySoundStyle) null; - this.catchItem = (short) 1338; - } - else if (this.type == 615) - { - this.noGravity = true; - this.width = 20; - this.height = 18; - this.aiStyle = 16; - this.damage = 0; - this.defense = 0; - this.lifeMax = 5; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.knockBackResist = 0.5f; - } - else if (this.type == 616 || this.type == 617) - { - this.width = 22; - this.height = 20; - this.aiStyle = 7; - this.damage = 0; - this.defense = 0; - this.lifeMax = 5; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.knockBackResist = 0.5f; - this.catchItem = (short) (this.type - 616 + 4464); - } - else if (this.type == 618) - { - this.noGravity = true; - this.width = 100; - this.height = 100; - this.aiStyle = 117; - this.damage = 55; - this.defense = 24; - this.lifeMax = 7000; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.knockBackResist = 0.0f; - this.value = (float) Item.buyPrice(gold: 2); - this.noTileCollide = true; - this.rarity = 1; - } - else if (this.type == 619) - { - this.npcSlots = 1f; - this.width = 44; - this.height = 44; - this.aiStyle = 5; - this.damage = 60; - this.defense = 16; - this.lifeMax = 1000; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.noGravity = true; - this.knockBackResist = 0.0f; - this.value = 500f; - this.alpha = (int) byte.MaxValue; - } - else if (this.type == 620) - { - this.lifeMax = 5000; - this.defense = 30; - this.damage = 70; - this.width = 34; - this.height = 58; - this.aiStyle = 107; - this.HitSound = SoundID.DD2_DrakinHurt; - this.DeathSound = SoundID.DD2_DrakinDeath; - this.knockBackResist = 0.0f; - this.value = (float) Item.buyPrice(silver: 75); - this.npcSlots = 0.0f; - this.lavaImmune = true; - this.LazySetLiquidMovementDD2(); - this.netAlways = true; - this.alpha = (int) byte.MaxValue; - this.rarity = 1; - } - else if (this.type == 621) - { - this.npcSlots = 5f; - this.width = 28; - this.height = 28; - this.aiStyle = 6; - this.damage = 90; - this.defense = 0; - this.lifeMax = 6000; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.noGravity = true; - this.noTileCollide = true; - this.knockBackResist = 0.0f; - this.behindTiles = true; - this.value = (float) Item.buyPrice(silver: 75); - this.alpha = (int) byte.MaxValue; - this.rarity = 1; - } - else if (this.type == 622) - { - this.width = 28; - this.height = 28; - this.aiStyle = 6; - this.netAlways = true; - this.damage = 60; - this.defense = 30; - this.lifeMax = 6000; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.noGravity = true; - this.noTileCollide = true; - this.knockBackResist = 0.0f; - this.behindTiles = true; - this.dontCountMe = true; - this.npcSlots = 0.0f; - this.alpha = (int) byte.MaxValue; - } - else if (this.type == 623) - { - this.width = 28; - this.height = 28; - this.aiStyle = 6; - this.netAlways = true; - this.damage = 50; - this.defense = 40; - this.lifeMax = 6000; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.noGravity = true; - this.noTileCollide = true; - this.knockBackResist = 0.0f; - this.behindTiles = true; - this.dontCountMe = true; - this.npcSlots = 0.0f; - this.alpha = (int) byte.MaxValue; - } - else if (this.type == 624) - { - this.width = 14; - this.height = 30; - this.aiStyle = 3; - this.damage = 10; - this.defense = 0; - this.lifeMax = 25; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.knockBackResist = 1f; - this.rarity = 1; - } - else if (this.type == 625) - { - this.width = 22; - this.height = 20; - this.aiStyle = 7; - this.damage = 0; - this.defense = 0; - this.lifeMax = 5; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.knockBackResist = 0.5f; - } - else if (this.type == 626 || this.type == 627) - { - this.width = 16; - this.height = 20; - this.aiStyle = 118; - this.damage = 0; - this.defense = 0; - this.lifeMax = 5; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.knockBackResist = 1f; - if (this.type == 627) - this.rarity = 3; - this.catchItem = (short) 4480; - if (this.type == 627) - this.catchItem = (short) 4482; - } - else if (this.type == 628) - { - this.width = 22; - this.height = 40; - this.aiStyle = 119; - this.damage = 15; - this.defense = 0; - this.lifeMax = 50; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.knockBackResist = 0.0f; - this.value = 50f; - } - else if (this.type == 629) - { - this.width = 24; - this.height = 24; - this.aiStyle = 25; - this.damage = 80; - this.defense = 30; - this.lifeMax = 500; - this.HitSound = SoundID.NPCHit4; - this.DeathSound = SoundID.NPCDeath6; - this.value = 100000f; - this.knockBackResist = 0.3f; - this.buffImmune[20] = true; - this.buffImmune[24] = true; - this.buffImmune[39] = true; - this.rarity = 4; - } - else if (this.type == 630) - { - this.width = 18; - this.height = 40; - this.aiStyle = 3; - this.damage = 60; - this.defense = 18; - this.lifeMax = 180; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath6; - this.knockBackResist = 0.5f; - this.value = 700f; - this.buffImmune[31] = false; - } - else if (this.type == 631) - { - this.width = 36; - this.height = 48; - this.scale = 1.1f; - this.aiStyle = 3; - this.damage = 85; - this.defense = 35; - this.lifeMax = 1000; - this.HitSound = SoundID.NPCHit41; - this.DeathSound = SoundID.NPCDeath43; - this.knockBackResist = 0.1f; - this.value = 50000f; - this.buffImmune[20] = true; - this.buffImmune[24] = true; - } - else if (this.type == 632) - { - this.width = 18; - this.height = 40; - this.aiStyle = 3; - this.damage = 14; - this.defense = 6; - this.lifeMax = 45; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath2; - this.knockBackResist = 0.5f; - this.value = 60f; - this.buffImmune[31] = false; - } - else if (this.type == 633) - { - this.townNPC = true; - this.friendly = true; - this.width = 18; - this.height = 40; - this.aiStyle = 7; - this.damage = 10; - this.defense = 15; - this.lifeMax = 250; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.knockBackResist = 0.5f; - } - else if (this.type == 634) - { - this.npcSlots = 0.5f; - this.width = 22; - this.height = 18; - this.aiStyle = 14; - this.damage = 13; - this.defense = 2; - this.lifeMax = 16; - this.HitSound = SoundID.NPCHit1; - this.knockBackResist = 0.8f; - this.DeathSound = SoundID.NPCDeath4; - this.value = 90f; - this.buffImmune[31] = false; - } - else if (this.type == 635) - { - this.width = 18; - this.height = 40; - this.aiStyle = 3; - this.damage = 20; - this.defense = 8; - this.lifeMax = 60; - this.HitSound = SoundID.NPCHit2; - this.DeathSound = SoundID.NPCDeath2; - this.knockBackResist = 0.5f; - this.value = 100f; - this.buffImmune[20] = true; - this.buffImmune[31] = false; - } - else if (this.type == 636) - { - this.noGravity = true; - this.width = 100; - this.height = 100; - this.aiStyle = 120; - this.damage = 80; - this.defense = 50; - this.lifeMax = 70000; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath65; - this.knockBackResist = 0.0f; - this.value = 250000f; - this.noTileCollide = true; - this.boss = true; - this.Opacity = 0.0f; - } - else if (this.type == 637 || this.type == 638) - { - this.townNPC = true; - this.friendly = true; - this.width = 18; - this.height = 28; - if (this.type == 637) - this.height = 20; - this.aiStyle = 7; - this.damage = 10; - this.defense = 15; - this.lifeMax = 250; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath6; - this.knockBackResist = 0.5f; - this.housingCategory = 1; - } - else if (this.type >= 639 && this.type <= 645) - { - this.width = 18; - this.height = 20; - this.aiStyle = 7; - this.damage = 0; - this.defense = 0; - this.lifeMax = 5; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.catchItem = (short) (4831 + (this.type - 639)); - } - else if (this.type >= 646 && this.type <= 652) - { - this.width = 18; - this.height = 20; - this.aiStyle = 7; - this.damage = 0; - this.defense = 0; - this.lifeMax = 5; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.catchItem = (short) (4838 + (this.type - 646)); - } - else if (this.type == 653) - { - this.width = 10; - this.height = 10; - this.aiStyle = 65; - this.damage = 0; - this.defense = 0; - this.lifeMax = 5; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.npcSlots = 0.25f; - this.noGravity = true; - this.lavaImmune = true; - this.catchItem = (short) 4845; - } - else if (this.type == 654) - { - this.width = 10; - this.height = 10; - this.aiStyle = 64; - this.damage = 0; - this.defense = 0; - this.lifeMax = 5; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.npcSlots = 0.2f; - this.noGravity = true; - this.lavaImmune = true; - this.catchItem = (short) 4847; - } - else if (this.type == 655) - { - this.width = 14; - this.height = 14; - this.aiStyle = 67; - this.damage = 0; - this.defense = 0; - this.lifeMax = 5; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.npcSlots = 0.5f; - this.noGravity = true; - this.lavaImmune = true; - this.catchItem = (short) 4849; - } - else if (this.type == 656) - { - this.townNPC = true; - this.friendly = true; - this.width = 18; - this.height = 20; - this.aiStyle = 7; - this.damage = 10; - this.defense = 15; - this.lifeMax = 250; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath6; - this.knockBackResist = 0.5f; - this.housingCategory = 1; - } - else if (this.type == 657) - { - this.width = 114; - this.height = 100; - this.aiStyle = 121; - this.damage = 60; - this.defense = 26; - this.lifeMax = 18000; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath64; - this.lavaImmune = true; - this.knockBackResist = 0.0f; - this.value = 60000f; - this.buffImmune[20] = true; - this.buffImmune[31] = true; - this.boss = true; - } - else if (this.type == 658 || this.type == 659) - { - this.width = 24; - this.height = 18; - this.aiStyle = 1; - this.damage = 40; - this.defense = 35; - this.lifeMax = 150; - this.scale = 1f; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.buffImmune[20] = true; - } - else if (this.type == 660) - { - this.width = 40; - this.height = 30; - this.aiStyle = 14; - this.damage = 50; - this.defense = 30; - this.lifeMax = 120; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.knockBackResist = 0.8f; - this.scale = 1f; - this.buffImmune[20] = true; - } - else if (this.type == 661) - { - this.width = 10; - this.height = 10; - this.aiStyle = 65; - this.damage = 0; - this.defense = 0; - this.lifeMax = 5; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath1; - this.npcSlots = 0.25f; - this.noGravity = true; - this.lavaImmune = true; - this.catchItem = (short) 4961; - this.rarity = 4; - } - else if (this.type == 662) - { - this.width = 18; - this.height = 40; - this.aiStyle = 122; - this.damage = 75; - this.defense = 22; - this.lifeMax = 500; - this.HitSound = SoundID.NPCHit1; - this.DeathSound = SoundID.NPCDeath6; - this.knockBackResist = 0.2f; - this.value = 0.0f; - flag = true; - this.noTileCollide = true; - this.lavaImmune = true; - this.trapImmune = true; - this.noGravity = true; - } if (flag) { - for (int index = 0; index < 323; ++index) + for (int index = 0; index < 206; ++index) this.buffImmune[index] = true; } if (Main.dedServ) this.frame = new Microsoft.Xna.Framework.Rectangle(); - else if (TextureAssets.Npc[this.type] != null && TextureAssets.Npc[this.type].IsLoaded) - this.frame = new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Npc[this.type].Width(), TextureAssets.Npc[this.type].Height() / Main.npcFrameCount[this.type]); + else if (Main.NPCLoaded[this.type]) + this.frame = new Microsoft.Xna.Framework.Rectangle(0, 0, Main.npcTexture[this.type].Width, Main.npcTexture[this.type].Height / Main.npcFrameCount[this.type]); else this.setFrameSize = true; - if (spawnparams.sizeScaleOverride.HasValue) + if ((double) scaleOverride > 0.0) { int num1 = (int) ((double) this.width * (double) this.scale); int num2 = (int) ((double) this.height * (double) this.scale); this.position.X += (float) (num1 / 2); this.position.Y += (float) num2; - this.scale = spawnparams.sizeScaleOverride.Value; + this.scale = scaleOverride; this.width = (int) ((double) this.width * (double) this.scale); this.height = (int) ((double) this.height * (double) this.scale); if (this.height == 16 || this.height == 32) @@ -12186,93 +10937,9 @@ label_19: this.defDamage = this.damage; this.defDefense = this.defense; this.netID = this.type; - if (Main.getGoodWorld) - this.getGoodAdjustments(); - this.ScaleStats(spawnparams.playerCountForMultiplayerDifficultyOverride, spawnparams.gameModeData, spawnparams.strengthMultiplierOverride); - this.life = this.lifeMax; - } - } - - private void getGoodAdjustments() - { - if (this.type == 13) - { - this.scale *= 1.4f; - this.defense += 2; - } - else if (this.type == 14) - { - this.scale *= 1.4f; - this.defense += 2; - } - else if (this.type == 15) - { - this.scale *= 1.4f; - this.defense += 2; - } - else if (this.type == 35) - this.scale *= 1.25f; - else if (this.type == 36) - this.scale *= 1.15f; - else if (this.type == 113) - { - this.scale *= 0.65f; - this.lifeMax = (int) ((double) this.lifeMax * 1.5); - this.defense += 3; - } - else if (this.type == 114) - { - this.scale *= 0.65f; - this.lifeMax = (int) ((double) this.lifeMax * 1.5); - this.defense += 3; - } - else if (this.type == 115) - this.scale *= 1.4f; - else if (this.type == 116) - this.scale *= 1.4f; - else if (this.type == 125) - this.scale *= 0.8f; - else if (this.type == 126) - this.scale *= 0.8f; - else if (this.type == (int) sbyte.MaxValue) - this.scale *= 1.1f; - else if (this.type == 128) - this.scale *= 1.1f; - else if (this.type == 129) - this.scale *= 1.1f; - else if (this.type == 130) - this.scale *= 1.1f; - else if (this.type == 131) - this.scale *= 1.1f; - else if (this.type == 134) - this.scale *= 1.3f; - else if (this.type == 135) - this.scale *= 1.3f; - else if (this.type == 136) - this.scale *= 1.3f; - else if (this.type == 139) - this.scale *= 1.3f; - else if (this.type == 222) - this.scale *= 1.2f; - else if (this.type == 245) - this.scale *= 0.5f; - else if (this.type == 246) - this.scale *= 0.5f; - else if (this.type == 247 || this.type == 248) - this.scale *= 0.5f; - else if (this.type == 249) - this.scale *= 0.5f; - else if (this.type == 262) - { - this.scale *= 1.3f; - } - else - { - if (this.type != 266) + if (!Main.expertMode) return; - this.defense = (int) ((double) this.defense * 1.5); - this.damage = (int) ((double) this.damage * 1.2); - this.scale *= 1.1f; + this.scaleStats(); } } @@ -12283,7 +10950,7 @@ label_19: this.honeyMovementSpeed = 1f; } - public static void SetWorldSpecificMonstersByWorldID() + public static void setWorldMonsters() { UnifiedRandom unifiedRandom = new UnifiedRandom(Main.worldID); int num1 = unifiedRandom.Next(3); @@ -12313,111 +10980,18 @@ label_19: } } - public NPCSpawnParams GetMatchingSpawnParams() => new NPCSpawnParams() + public void scaleStats() { - sizeScaleOverride = new float?(-1f), - playerCountForMultiplayerDifficultyOverride = new int?(this.statsAreScaledForThisManyPlayers), - strengthMultiplierOverride = new float?(this.strengthMultiplier) - }; - - public void ScaleStats( - int? activePlayersCount, - GameModeData gameModeData, - float? strengthOverride) - { - if ((!NPCID.Sets.NeedsExpertScaling.IndexInRange(this.type) || !NPCID.Sets.NeedsExpertScaling[this.type]) && (this.lifeMax <= 5 || this.damage == 0 || this.friendly || this.townNPC)) + if (!Main.expertMode) return; - float strength = 1f; - if (strengthOverride.HasValue) - strength = strengthOverride.Value; - else if (gameModeData.IsJourneyMode) + if (this.friendly) { - CreativePowers.DifficultySliderPower power = CreativePowerManager.Instance.GetPower(); - if (power != null && power.GetIsUnlocked()) - strength = power.StrengthMultiplierToGiveNPCs; + int life = this.life; } - NPCStrengthHelper npcStrengthHelper = new NPCStrengthHelper(gameModeData, strength); - if (npcStrengthHelper.IsExpertMode) - this.ScaleStats_ApplyExpertTweaks(); - this.ScaleStats_ApplyGameMode(gameModeData); - if (npcStrengthHelper.IsExpertMode) - { - int numPlayers = !activePlayersCount.HasValue ? NPC.GetActivePlayerCount() : activePlayersCount.Value; - this.statsAreScaledForThisManyPlayers = numPlayers; - float balance; - float boost; - NPC.GetStatScalingFactors(numPlayers, out balance, out boost); - float bossAdjustment = 1f; - if (npcStrengthHelper.IsMasterMode) - bossAdjustment = 0.85f; - this.ScaleStats_ApplyMultiplayerStats(numPlayers, balance, boost, bossAdjustment); - } - this.strengthMultiplier = strength; - this.ScaleStats_UseStrengthMultiplier(this.strengthMultiplier); - if ((this.type < 0 ? 0 : (NPCID.Sets.ProjectileNPC[this.type] ? 1 : 0)) == 0 && this.lifeMax < 6) - this.lifeMax = 6; - this.life = this.lifeMax; - this.defDamage = this.damage; - this.defDefense = this.defense; - } - - public void ScaleStats_UseStrengthMultiplier(float strength) - { - if ((this.type < 0 ? 0 : (NPCID.Sets.ProjectileNPC[this.type] ? 1 : 0)) == 0) - this.lifeMax = (int) ((double) this.lifeMax * (double) strength); - this.damage = (int) ((double) this.damage * (double) strength); - } - - public void ScaleStats_Old(int? activePlayersCount, GameModeData gameModeData) - { - if (!gameModeData.IsExpertMode || (this.type < 0 || !NPCID.Sets.NeedsExpertScaling[this.type]) && (this.life <= 5 || this.damage == 0 || this.friendly || this.townNPC)) + if ((this.type < 0 || !NPCID.Sets.NeedsExpertScaling[this.type]) && (this.life <= 5 || this.damage == 0 || this.friendly || this.townNPC)) return; - this.ScaleStats_ApplyExpertTweaks(); - this.ScaleStats_ApplyGameMode(gameModeData); - int numPlayers = !activePlayersCount.HasValue ? NPC.GetActivePlayerCount() : activePlayersCount.Value; - this.statsAreScaledForThisManyPlayers = numPlayers; - float balance; - float boost; - NPC.GetStatScalingFactors(numPlayers, out balance, out boost); - float bossAdjustment = 1f; - if (gameModeData.IsMasterMode) - bossAdjustment = 0.85f; - this.ScaleStats_ApplyMultiplayerStats(numPlayers, balance, boost, bossAdjustment); - } - - public static float GetBalance() - { - float balance; - NPC.GetStatScalingFactors(NPC.GetActivePlayerCount(), out balance, out float _); - return balance; - } - - private float GetMyBalance() - { - if (this.statsAreScaledForThisManyPlayers <= 1) - return 1f; - float balance; - NPC.GetStatScalingFactors(this.statsAreScaledForThisManyPlayers, out balance, out float _); - return balance; - } - - private static int GetActivePlayerCount() - { - if (Main.netMode == 0) - return 1; - int num = 0; - for (int index = 0; index < (int) byte.MaxValue; ++index) - { - if (Main.player[index] != null && Main.player[index].active) - ++num; - } - return num; - } - - private void ScaleStats_ApplyExpertTweaks() - { bool flag = this.type >= 0 && NPCID.Sets.ProjectileNPC[this.type]; - if (!NPCID.Sets.DontDoHardmodeScaling[this.type] && Main.hardMode && !this.boss && this.lifeMax < 1000) + if (this.type != 5 && (this.type < 13 || this.type > 15) && this.type != 267 && (this.type < 113 || this.type > 119) && Main.hardMode && !this.boss && this.lifeMax < 1000) { int num1 = this.damage + this.defense + this.lifeMax / 4; if (num1 == 0) @@ -12437,44 +11011,46 @@ label_19: } } } - if (this.type != 210 && this.type != 211) - return; - this.damage = (int) ((double) this.damage * 0.600000023841858); - this.lifeMax = (int) ((double) this.lifeMax * 0.800000011920929); - this.defense = (int) ((double) this.defense * 0.800000011920929); - } - - private void ScaleStats_ApplyGameMode(GameModeData gameModeData) - { - int num1 = this.type < 0 ? 0 : (NPCID.Sets.ProjectileNPC[this.type] ? 1 : 0); - int num2 = 0; - if (Main.getGoodWorld) - ++num2; - if (num1 == 0) + if (this.type == 210 || this.type == 211) { - this.value = (float) (int) ((double) this.value * ((double) gameModeData.EnemyMoneyDropMultiplier + (double) num2)); - this.lifeMax = (int) ((double) this.lifeMax * ((double) gameModeData.EnemyMaxLifeMultiplier + (double) num2)); + this.damage = (int) ((double) this.damage * 0.600000023841858); + this.lifeMax = (int) ((double) this.lifeMax * 0.800000011920929); + this.defense = (int) ((double) this.defense * 0.800000011920929); } - this.damage = (int) ((double) this.damage * ((double) gameModeData.EnemyDamageMultiplier + (double) num2)); - this.knockBackResist *= gameModeData.KnockbackToEnemiesMultiplier; - if (!Main.getGoodWorld) - return; - this.damage += this.damage / 3; - } - - private void ScaleStats_ApplyMultiplayerStats( - int numPlayers, - float balance, - float boost, - float bossAdjustment) - { + if (!flag) + { + this.value = (float) (int) ((double) this.value * 2.5); + this.lifeMax = (int) ((double) this.lifeMax * (double) Main.expertLife); + } + this.damage = (int) ((double) this.damage * (double) Main.expertDamage); + this.knockBackResist *= Main.expertKnockBack; + int num4 = 0; + float num5 = 1f; + float num6 = 0.35f; + if (Main.netMode != 0) + { + for (int index = 0; index < (int) byte.MaxValue; ++index) + { + if (Main.player[index].active) + ++num4; + } + for (int index = 1; index < num4; ++index) + { + num5 += num6; + num6 += (float) ((1.0 - (double) num6) / 3.0); + } + } + if ((double) num5 > 8.0) + num5 = (float) (((double) num5 * 2.0 + 8.0) / 3.0); + if ((double) num5 > 1000.0) + num5 = 1000f; if (this.type == 5) - this.lifeMax = (int) ((double) this.lifeMax * 0.75 * (double) bossAdjustment); + this.lifeMax = (int) ((double) this.lifeMax * 0.75); if (this.type == 4) - this.lifeMax = (int) ((double) this.lifeMax * 0.65 * (double) balance * (double) bossAdjustment); + this.lifeMax = (int) ((double) this.lifeMax * 0.65 * (double) num5); if (this.type >= 13 && this.type <= 15) { - this.lifeMax = (int) ((double) this.lifeMax * 0.7 * (double) balance * (double) bossAdjustment); + this.lifeMax = (int) ((double) this.lifeMax * 0.7 * (double) num5); if (this.type == 13) this.damage = (int) ((double) this.damage * 1.1); if (this.type == 14) @@ -12484,82 +11060,65 @@ label_19: this.scale *= 1.2f; this.defense += 2; } - if (this.type == 266 || this.type == 267) + if (this.type == 266) { - this.lifeMax = (int) ((double) this.lifeMax * 0.85 * (double) balance * (double) bossAdjustment); + this.lifeMax = (int) ((double) this.lifeMax * 0.85 * (double) num5); this.damage = (int) ((double) this.damage * 0.9); this.scale *= 1.05f; - for (float num = 1f; (double) num < (double) balance; num += 0.34f) - { - if ((double) this.knockBackResist < 0.1) - { - this.knockBackResist = 0.0f; - break; - } - this.knockBackResist *= 0.8f; - } } if (this.type == 50) { - this.lifeMax = (int) ((double) this.lifeMax * 0.7 * (double) balance * (double) bossAdjustment); + this.lifeMax = (int) ((double) this.lifeMax * 0.7 * (double) num5); this.damage = (int) ((double) this.damage * 0.8); } if (this.type == 471) - this.lifeMax = (int) ((double) this.lifeMax * 0.85 * ((double) balance * 2.0 + 1.0) / 3.0); + this.lifeMax = (int) ((double) this.lifeMax * 0.85 * ((double) num5 * 2.0 + 1.0) / 3.0); if (this.type == 472) { - this.lifeMax = (int) ((double) this.lifeMax * 0.85 * ((double) balance + 1.0) / 2.0); + this.lifeMax = (int) ((double) this.lifeMax * 0.85 * ((double) num5 + 1.0) / 2.0); this.damage = (int) ((double) this.damage * 0.8); } if (this.type == 222) { - this.lifeMax = (int) ((double) this.lifeMax * 0.7 * (double) balance * (double) bossAdjustment); + this.lifeMax = (int) ((double) this.lifeMax * 0.7 * (double) num5); this.damage = (int) ((double) this.damage * 0.9); } if (this.type == 210 || this.type == 211) this.lifeMax = (int) ((double) this.lifeMax * 0.75); if (this.type == 35) { - this.lifeMax = (int) ((double) this.lifeMax * (double) balance * (double) bossAdjustment); + this.lifeMax = (int) ((double) this.lifeMax * (double) num5); this.damage = (int) ((double) this.damage * 1.1); } else if (this.type == 36) { - this.lifeMax = (int) ((double) this.lifeMax * 1.3 * (double) balance * (double) bossAdjustment); + this.lifeMax = (int) ((double) this.lifeMax * 1.3 * (double) num5); this.damage = (int) ((double) this.damage * 1.1); } if (this.type == 113 || this.type == 114) { this.defense += 6; - this.lifeMax = (int) ((double) this.lifeMax * 0.7 * (double) balance * (double) bossAdjustment); + this.lifeMax = (int) ((double) this.lifeMax * 0.7 * (double) num5); this.damage = (int) ((double) this.damage * 1.5); } else if (this.type == 115) { - this.lifeMax = (int) ((double) this.lifeMax * 0.7 * (double) balance); - if (numPlayers > 4) - this.knockBackResist = 0.0f; - else if (numPlayers > 1) - this.knockBackResist *= 1f - boost; + this.lifeMax = (int) ((double) this.lifeMax * 0.7 * (double) num5); + if (num4 > 1) + this.knockBackResist *= 1f - num6; this.defense += 6; } else if (this.type == 116) { - this.lifeMax = (int) ((double) this.lifeMax * 0.7 * (double) balance); - if (numPlayers > 4) - this.knockBackResist = 0.0f; - else if (numPlayers > 1) - this.knockBackResist *= 1f - boost; + this.lifeMax = (int) ((double) this.lifeMax * 0.7 * (double) num5); + if (num4 > 1) + this.knockBackResist *= 1f - num6; } else if (this.type == 117 || this.type == 118 || this.type == 119) this.lifeMax = (int) ((double) this.lifeMax * 0.8); - if (this.type == 657) - this.lifeMax = (int) ((double) this.lifeMax * 0.800000011920929 * (double) balance * (double) bossAdjustment); - if (this.type >= 658 && this.type <= 660) - this.lifeMax = (int) ((double) this.lifeMax * 0.75 * (double) balance * (double) bossAdjustment); if (this.type >= 134 && this.type <= 136) { - this.lifeMax = (int) ((double) this.lifeMax * 0.75 * (double) balance * (double) bossAdjustment); + this.lifeMax = (int) ((double) this.lifeMax * 0.75 * (double) num5); if (this.type == 134) this.damage *= 2; if (this.type == 135) @@ -12570,43 +11129,33 @@ label_19: } else if (this.type == 139) { - this.lifeMax = (int) ((double) this.lifeMax * 0.75 * ((double) balance * 2.0 + 1.0) / 3.0); + this.lifeMax = (int) ((double) this.lifeMax * 0.75 * ((double) num5 * 2.0 + 1.0) / 3.0); this.damage = (int) ((double) this.damage * 0.8); this.scale *= 1.05f; } if (this.type >= (int) sbyte.MaxValue && this.type <= 131) { - this.lifeMax = (int) ((double) this.lifeMax * 0.75 * (double) balance * (double) bossAdjustment); + this.lifeMax = (int) ((double) this.lifeMax * 0.75 * (double) num5); this.damage = (int) ((double) this.damage * 0.85); } if (this.type >= 125 && this.type <= 126) { - this.lifeMax = (int) ((double) this.lifeMax * 0.75 * (double) balance * (double) bossAdjustment); + this.lifeMax = (int) ((double) this.lifeMax * 0.75 * (double) num5); this.damage = (int) ((double) this.damage * 0.85); } - if (this.type == 262) + if (this.type >= 262 && this.type <= 262) { - this.lifeMax = (int) ((double) this.lifeMax * 0.7 * (double) balance * (double) bossAdjustment); - this.damage = (int) ((double) this.damage * 1.15); - } - else if (this.type == 264) - { - this.lifeMax = (int) ((double) this.lifeMax * (double) balance * (double) bossAdjustment); - this.damage = (int) ((double) this.damage * 1.15); - } - if (this.type == 636) - { - this.lifeMax = (int) ((double) this.lifeMax * 0.7 * (double) balance * (double) bossAdjustment); + this.lifeMax = (int) ((double) this.lifeMax * 0.7 * (double) num5); this.damage = (int) ((double) this.damage * 1.15); } if (this.type >= 245 && this.type <= 249) { - this.lifeMax = (int) ((double) this.lifeMax * 0.75 * (double) balance * (double) bossAdjustment); + this.lifeMax = (int) ((double) this.lifeMax * 0.75 * (double) num5); this.damage = (int) ((double) this.damage * 0.8); } if (this.type == 370) { - this.lifeMax = (int) ((double) this.lifeMax * 0.6 * (double) balance * (double) bossAdjustment); + this.lifeMax = (int) ((double) this.lifeMax * 0.6 * (double) num5); this.damage = (int) ((double) this.damage * 0.7); } else if (this.type == 371 || this.type == 372 || this.type == 373) @@ -12618,24 +11167,19 @@ label_19: if (this.type == 439 || this.type == 440 || this.type >= 454 && this.type <= 459 || this.type == 522 || this.type == 523) { if (this.type != 522) - this.lifeMax = (int) ((double) this.lifeMax * 0.625 * (double) balance * (double) bossAdjustment); + this.lifeMax = (int) ((double) this.lifeMax * 0.625 * (double) num5); this.damage = (int) ((double) this.damage * 0.75); } if (this.type == 397 || this.type == 396 || this.type == 398) { - this.lifeMax = (int) ((double) this.lifeMax * 0.75 * (double) balance * (double) bossAdjustment); + this.lifeMax = (int) ((double) this.lifeMax * 0.75 * (double) num5); this.damage = (int) ((double) this.damage * 0.75); } if (this.type == 551) { - this.lifeMax = (int) ((double) this.lifeMax * 0.75 * (double) balance * (double) bossAdjustment); + this.lifeMax = (int) ((double) this.lifeMax * 0.75 * (double) num5); this.damage = (int) ((double) this.damage * 0.65); } - else if (NPCID.Sets.BelongsToInvasionOldOnesArmy[this.type]) - { - int num = 7; - this.lifeMax = (int) ((double) this.lifeMax * (double) ((float) ((double) balance * (double) (num - 1) + 1.0) / (float) num) * (double) bossAdjustment); - } switch (this.type) { case 305: @@ -12657,7 +11201,7 @@ label_19: break; case 325: case 327: - this.lifeMax = (int) ((double) this.lifeMax * 0.65 * (double) bossAdjustment); + this.lifeMax = (int) ((double) this.lifeMax * 0.65); this.damage = (int) ((double) this.damage * 0.75); break; } @@ -12679,7 +11223,7 @@ label_19: case 344: case 345: case 346: - this.lifeMax = (int) ((double) this.lifeMax * 0.65 * (double) bossAdjustment); + this.lifeMax = (int) ((double) this.lifeMax * 0.65); this.damage = (int) ((double) this.damage * 0.75); break; } @@ -12688,22 +11232,6 @@ label_19: this.life = this.lifeMax; } - private static void GetStatScalingFactors(int numPlayers, out float balance, out float boost) - { - balance = 1f; - boost = 0.35f; - for (int index = 1; index < numPlayers; ++index) - { - balance += boost; - boost += (float) ((1.0 - (double) boost) / 3.0); - } - if ((double) balance > 8.0) - balance = (float) (((double) balance * 2.0 + 8.0) / 3.0); - if ((double) balance <= 1000.0) - return; - balance = 1000f; - } - public static bool GetNPCLocation( int i, bool seekHead, @@ -12830,15 +11358,6 @@ label_19: num1 = 513; index1 = 1; break; - case 621: - num1 = 623; - index1 = 0; - break; - case 622: - case 623: - num1 = 621; - index1 = 1; - break; } if (index1 != -1) { @@ -12893,3378 +11412,13 @@ label_19: public void AI() { - // ISSUE: The method is too long to display (123208 instructions) - } - - public void AI_122_PirateGhost() - { - if ((double) this.localAI[0] == 0.0) - { - this.localAI[0] = 1f; - SoundEngine.PlaySound(SoundID.NPCHit6, this.position); - } - NPCAimedTarget targetData = this.GetTargetData(); - if (targetData.Invalid) - { - this.TargetClosest(); - targetData = this.GetTargetData(); - } - if (targetData.Invalid) - { - this.velocity = this.velocity * 0.9f; - this.alpha = Utils.Clamp(this.alpha + 5, 0, (int) byte.MaxValue); - if (this.alpha < (int) byte.MaxValue) - return; - this.StrikeNPCNoInteraction(9999, 0.0f, 0); - } - else - { - this.alpha = Utils.Clamp(this.alpha - 5, 0, (int) byte.MaxValue); - this.velocity = this.velocity.MoveTowards(Vector2.Zero.MoveTowards(targetData.Center - this.Center, 4f), 0.1333333f); - for (int index = 0; index < 200; ++index) - { - if (Main.npc[index].active && Main.npc[index].type == this.type && index != this.whoAmI) - { - Vector2 vector2 = Main.npc[index].Center - this.Center; - if ((double) vector2.Length() < 50.0) - { - vector2.Normalize(); - vector2 *= 0.1f; - this.velocity = this.velocity - vector2; - this.velocity.X -= vector2.X * 1f; - } - } - } - } - } - - public void AI_000_TransformBoundNPC(int playerID, int npcType) - { - this.Transform(npcType); - Main.BestiaryTracker.Chats.RegisterChatStartWith(this); - Main.player[playerID].SetTalkNPC(this.whoAmI); - if (Main.netMode != 2) - return; - NetMessage.SendData(40, number: playerID); - } - - private void AI_065_Butterflies() - { - float num1 = this.ai[0]; - float num2 = this.ai[1]; - Color color; - if (this.type == 661) - { - color = Main.hslToRgb((float) ((double) Main.GlobalTimeWrappedHourly * 0.330000013113022 % 1.0), 1f, 0.5f); - Lighting.AddLight(this.Center, color.ToVector3() * 0.3f + Vector3.One * 0.1f); - int num3 = 60; - bool flag = false; - int num4 = 50; - NPCAimedTarget targetData = this.GetTargetData(); - if (targetData.Invalid || (double) targetData.Center.Distance(this.Center) >= 300.0) - flag = true; - if (!targetData.Invalid && targetData.Type == NPCTargetType.Player && !Main.player[this.target].ZoneHallow) - { - num4 = num3; - flag = true; - } - this.ai[2] = MathHelper.Clamp(this.ai[2] + (float) flag.ToDirectionInt(), 0.0f, (float) num4); - if ((double) this.ai[2] >= (double) num3) - { - this.active = false; - if (Main.netMode == 1) - return; - NetMessage.SendData(23, number: this.whoAmI); - return; - } - this.Opacity = Utils.GetLerpValue((float) num3, (float) num4 / 2f, this.ai[2], true); - if ((double) this.ai[2] > 0.0) - { - int num5 = 1; - for (int index = 0; index < num5; ++index) - { - if (Main.rand.Next(5) == 0) - { - float num6 = MathHelper.Lerp(0.9f, 0.6f, this.Opacity); - int dustIndex = Dust.NewDust(this.position, this.width, this.height, 267, newColor: (Main.hslToRgb((float) ((double) Main.GlobalTimeWrappedHourly * 0.300000011920929 % 1.0), 1f, 0.5f) * 0.5f)); - Main.dust[dustIndex].position = this.Center + Main.rand.NextVector2Circular((float) this.width, (float) this.height); - Main.dust[dustIndex].velocity *= Main.rand.NextFloat() * 0.8f; - Main.dust[dustIndex].velocity += this.velocity * 0.6f; - Main.dust[dustIndex].noGravity = true; - Main.dust[dustIndex].fadeIn = (float) (0.600000023841858 + (double) Main.rand.NextFloat() * 0.699999988079071 * (double) num6); - Main.dust[dustIndex].scale = 0.35f; - if (dustIndex != 6000) - { - Dust dust = Dust.CloneDust(dustIndex); - dust.scale /= 2f; - dust.fadeIn *= 0.85f; - dust.color = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue) * 0.5f; - } - } - } - } - this.dontTakeDamage = (double) this.ai[2] >= (double) (num4 / 2); - } - if (Main.netMode != 1) - { - if ((double) this.ai[2] == 0.0 && this.type != 661) - { - int num7 = 0; - int num8 = 4; - int num9 = 6; - int num10 = 3; - int num11 = 7; - int num12 = 2; - int num13 = 1; - int num14 = 5; - int num15 = Main.rand.Next(100); - this.ai[2] = (float) (1 + (num15 != 0 ? (num15 >= 3 ? (num15 >= 9 ? (num15 >= 19 ? (num15 >= 34 ? (num15 >= 53 ? (num15 >= 75 ? num7 : num8) : num9) : num10) : num11) : num12) : num13) : num14)); - } - if ((double) this.ai[3] == 0.0) - this.ai[3] = (float) Main.rand.Next(75, 111) * 0.01f; - --this.localAI[0]; - if ((double) this.localAI[0] <= 0.0) - { - this.localAI[0] = (float) Main.rand.Next(90, 240); - this.TargetClosest(); - float num16 = Math.Abs(this.Center.X - Main.player[this.target].Center.X); - if ((double) num16 > 700.0 && (double) this.localAI[3] == 0.0) - { - float num17 = (float) Main.rand.Next(50, 151) * 0.01f; - if ((double) num16 > 1000.0) - num17 = (float) Main.rand.Next(150, 201) * 0.01f; - else if ((double) num16 > 850.0) - num17 = (float) Main.rand.Next(100, 151) * 0.01f; - int num18 = this.direction * Main.rand.Next(100, 251); - int num19 = Main.rand.Next(-50, 51); - if ((double) this.position.Y > (double) Main.player[this.target].position.Y - 100.0) - num19 -= Main.rand.Next(100, 251); - float num20 = num17 / (float) Math.Sqrt((double) (num18 * num18 + num19 * num19)); - num1 = (float) num18 * num20; - num2 = (float) num19 * num20; - } - else - { - this.localAI[3] = 1f; - double num21 = (double) Main.rand.Next(26, 301) * 0.00999999977648258; - int num22 = Main.rand.Next(-100, 101); - int num23 = Main.rand.Next(-100, 101); - double num24 = Math.Sqrt((double) (num22 * num22 + num23 * num23)); - float num25 = (float) (num21 / num24); - num1 = (float) num22 * num25; - num2 = (float) num23 * num25; - } - this.netUpdate = true; - } - } - this.scale = this.ai[3]; - int num26 = 60; - this.velocity.X = (this.velocity.X * (float) (num26 - 1) + num1) / (float) num26; - this.velocity.Y = (this.velocity.Y * (float) (num26 - 1) + num2) / (float) num26; - if ((double) this.velocity.Y > 0.0) - { - int num27 = 3; - int index1 = (int) this.Center.X / 16; - int num28 = (int) this.Center.Y / 16; - for (int index2 = num28; index2 < num28 + num27; ++index2) - { - if (Main.tile[index1, index2] != null && (Main.tile[index1, index2].nactive() && Main.tileSolid[(int) Main.tile[index1, index2].type] || Main.tile[index1, index2].liquid > (byte) 0)) - { - num2 *= -1f; - if ((double) this.velocity.Y > 0.0) - this.velocity.Y *= 0.9f; - } - } - } - if ((double) this.velocity.Y < 0.0) - { - int num29 = 30; - bool flag = false; - int index3 = (int) this.Center.X / 16; - int num30 = (int) this.Center.Y / 16; - for (int index4 = num30; index4 < num30 + num29; ++index4) - { - if (Main.tile[index3, index4] != null && Main.tile[index3, index4].nactive() && Main.tileSolid[(int) Main.tile[index3, index4].type]) - flag = true; - } - if (!flag) - { - num2 *= -1f; - if ((double) this.velocity.Y < 0.0) - this.velocity.Y *= 0.9f; - } - } - if ((double) this.localAI[1] > 0.0) - { - --this.localAI[1]; - } - else - { - this.localAI[1] = 15f; - if (this.type == 661) - this.localAI[1] = 10f; - float num31 = 0.0f; - Vector2 zero = Vector2.Zero; - for (int index = 0; index < 200; ++index) - { - NPC npc = Main.npc[index]; - if (npc.active && npc.damage > 0 && !npc.friendly && (double) npc.Hitbox.Distance(this.Center) <= 100.0) - { - ++num31; - zero += this.DirectionFrom(npc.Center); - } - } - if ((double) num31 > 0.0) - { - this.velocity = this.velocity + zero / num31 * 2f; - if ((double) this.velocity.Length() > 16.0) - this.velocity = this.velocity.SafeNormalize(Vector2.Zero) * 16f; - } - } - if (this.collideX) - { - num1 = (double) this.velocity.X >= 0.0 ? -Math.Abs(num1) : Math.Abs(num1); - this.velocity.X *= -0.2f; - } - if ((double) this.velocity.X < 0.0) - this.direction = -1; - if ((double) this.velocity.X > 0.0) - this.direction = 1; - this.ai[0] = num1; - this.ai[1] = num2; - if (this.type == 356) - this.catchItem = (short) (1994.0 + (double) this.ai[2] - 1.0); - if (this.type != 653) - return; - this.position = this.position + this.netOffset; - Lighting.AddLight((int) this.Center.X / 16, (int) this.Center.Y / 16, 0.6f, 0.3f, 0.1f); - if (Main.rand.Next(60) == 0) - { - Vector2 position = this.position; - int width = this.width; - int height = this.height; - color = new Color(); - Color newColor = color; - int index = Dust.NewDust(position, width, height, 6, Alpha: 254, newColor: newColor); - Main.dust[index].velocity *= 0.0f; - } - this.position = this.position - this.netOffset; - } - - public static Color AI_121_QueenSlime_GetDustColor() => Color.Lerp(new Color(0, 160, (int) byte.MaxValue), Color.Lerp(new Color(200, 200, 200), new Color((int) byte.MaxValue, 80, (int) byte.MaxValue), Main.rand.NextFloat()), Main.rand.NextFloat()); - - private void AI_121_QueenSlime_FlyMovement() - { - this.noTileCollide = true; - this.noGravity = true; - float num1 = 14f; - float moveSpeed = 0.1f; - float num2 = 250f; - this.TargetClosest(); - Vector2 vector2 = this.Center; - if (this.timeLeft > 10) - { - if (!Collision.CanHit((Entity) this, (Entity) Main.player[this.target])) - { - bool flag = false; - Vector2 center = Main.player[this.target].Center; - for (int index = 0; index < 16; ++index) - { - float num3 = (float) (16 * index); - Point tileCoordinates = (center + new Vector2(0.0f, -num3)).ToTileCoordinates(); - if (WorldGen.SolidOrSlopedTile(tileCoordinates.X, tileCoordinates.Y)) - { - vector2 = center + new Vector2(0.0f, (float) (-(double) num3 + 16.0)) - this.Center; - flag = true; - break; - } - } - if (!flag) - vector2 = center - this.Center; - } - else - vector2 = Main.player[this.target].Center + new Vector2(0.0f, -num2) - this.Center; - } - else - vector2 = this.Center + new Vector2(500f * (float) this.direction, -num2) - this.Center; - float num4 = vector2.Length(); - if ((double) Math.Abs(vector2.X) < 40.0) - vector2.X = this.velocity.X; - if ((double) num4 > 100.0 && ((double) this.velocity.X < -12.0 && (double) vector2.X > 0.0 || (double) this.velocity.X > 12.0 && (double) vector2.X < 0.0)) - moveSpeed = 0.2f; - Vector2 desiredVelocity; - if ((double) num4 < 40.0) - desiredVelocity = this.velocity; - else if ((double) num4 < 80.0) - { - vector2.Normalize(); - desiredVelocity = vector2 * (num1 * 0.65f); - } - else - { - vector2.Normalize(); - desiredVelocity = vector2 * num1; - } - this.SimpleFlyMovement(desiredVelocity, moveSpeed); - this.rotation = this.velocity.X * 0.1f; - if ((double) this.rotation > 0.5) - this.rotation = 0.5f; - if ((double) this.rotation >= -0.5) - return; - this.rotation = -0.5f; - } - - private void AI_121_QueenSlime() - { - int Damage1 = 30; - int Damage2 = 40; - int num1 = Main.expertMode ? 1 : 0; - float num2 = 1f; - bool flag1 = false; - bool flag2 = this.life <= this.lifeMax / 2; - if ((double) this.localAI[0] == 0.0) - { - this.ai[1] = -100f; - this.localAI[0] = (float) this.lifeMax; - this.TargetClosest(); - this.netUpdate = true; - } - Lighting.AddLight(this.Center, 1f, 0.7f, 0.9f); - int num3 = 500; - if (Main.player[this.target].dead || (double) Math.Abs(this.Center.X - Main.player[this.target].Center.X) / 16.0 > (double) num3) - { - this.TargetClosest(); - if (Main.player[this.target].dead || (double) Math.Abs(this.Center.X - Main.player[this.target].Center.X) / 16.0 > (double) num3) - { - this.EncourageDespawn(10); - if ((double) Main.player[this.target].Center.X < (double) this.Center.X) - this.direction = 1; - else - this.direction = -1; - } - } - if (!Main.player[this.target].dead && this.timeLeft > 10 && !flag2 && (double) this.ai[3] >= 300.0 && (double) this.ai[0] == 0.0 && (double) this.velocity.Y == 0.0) - { - this.ai[0] = 2f; - this.ai[1] = 0.0f; - if (Main.netMode != 1) - { - this.netUpdate = true; - this.TargetClosest(false); - Point tileCoordinates1 = this.Center.ToTileCoordinates(); - Point tileCoordinates2 = Main.player[this.target].Center.ToTileCoordinates(); - Vector2 vector2 = Main.player[this.target].Center - this.Center; - int num4 = 10; - int num5 = 0; - int num6 = 7; - int num7 = 0; - bool flag3 = false; - if ((double) this.ai[3] >= 360.0 || (double) vector2.Length() > 2000.0) - { - if ((double) this.ai[3] > 360.0) - this.ai[3] = 360f; - flag3 = true; - num7 = 100; - } - while (!flag3 && num7 < 100) - { - ++num7; - int index1 = Main.rand.Next(tileCoordinates2.X - num4, tileCoordinates2.X + num4 + 1); - int index2 = Main.rand.Next(tileCoordinates2.Y - num4, tileCoordinates2.Y + 1); - if ((index2 < tileCoordinates2.Y - num6 || index2 > tileCoordinates2.Y + num6 || index1 < tileCoordinates2.X - num6 || index1 > tileCoordinates2.X + num6) && (index2 < tileCoordinates1.Y - num5 || index2 > tileCoordinates1.Y + num5 || index1 < tileCoordinates1.X - num5 || index1 > tileCoordinates1.X + num5) && !Main.tile[index1, index2].nactive()) - { - int index3 = index2; - int num8 = 0; - if ((!Main.tile[index1, index3].nactive() || !Main.tileSolid[(int) Main.tile[index1, index3].type] ? 0 : (!Main.tileSolidTop[(int) Main.tile[index1, index3].type] ? 1 : 0)) != 0) - { - num8 = 1; - } - else - { - for (; num8 < 150 && index3 + num8 < Main.maxTilesY; ++num8) - { - int index4 = index3 + num8; - if ((!Main.tile[index1, index4].nactive() || !Main.tileSolid[(int) Main.tile[index1, index4].type] ? 0 : (!Main.tileSolidTop[(int) Main.tile[index1, index4].type] ? 1 : 0)) != 0) - { - --num8; - break; - } - } - } - int index5 = index2 + num8; - bool flag4 = true; - if (flag4 && Main.tile[index1, index5].lava()) - flag4 = false; - if (flag4 && !Collision.CanHitLine(this.Center, 0, 0, Main.player[this.target].Center, 0, 0)) - flag4 = false; - if (flag4) - { - this.localAI[1] = (float) (index1 * 16 + 8); - this.localAI[2] = (float) (index5 * 16 + 16); - break; - } - } - } - if (num7 >= 100) - { - Vector2 bottom = Main.player[(int) Player.FindClosest(this.position, this.width, this.height)].Bottom; - this.localAI[1] = bottom.X; - this.localAI[2] = bottom.Y; - this.ai[3] = 0.0f; - } - } - } - if (!flag2 && (!Collision.CanHitLine(this.Center, 0, 0, Main.player[this.target].Center, 0, 0) || (double) Math.Abs(this.Top.Y - Main.player[this.target].Bottom.Y) > 320.0)) - { - this.ai[3] += 1.5f; - } - else - { - float num9 = this.ai[3]; - --this.ai[3]; - if ((double) this.ai[3] < 0.0) - { - if (Main.netMode != 1 && (double) num9 > 0.0) - this.netUpdate = true; - this.ai[3] = 0.0f; - } - } - if (this.timeLeft <= 10 && (flag2 && (double) this.ai[0] != 0.0 || !flag2 && (double) this.ai[0] != 3.0)) - { - this.ai[0] = !flag2 ? 3f : 0.0f; - this.ai[1] = 0.0f; - this.ai[2] = 0.0f; - this.ai[3] = 0.0f; - this.netUpdate = true; - } - this.noTileCollide = false; - this.noGravity = false; - if (flag2) - { - ++this.localAI[3]; - if ((double) this.localAI[3] >= 24.0) - this.localAI[3] = 0.0f; - if ((double) this.ai[0] == 4.0 && (double) this.ai[2] == 1.0) - this.localAI[3] = 6f; - if ((double) this.ai[0] == 5.0 && (double) this.ai[2] != 1.0) - this.localAI[3] = 7f; - } - switch ((int) this.ai[0]) - { - case 0: - if (flag2) - { - this.AI_121_QueenSlime_FlyMovement(); - } - else - { - this.noTileCollide = false; - this.noGravity = false; - if ((double) this.velocity.Y == 0.0) - { - this.velocity.X *= 0.8f; - if ((double) this.velocity.X > -0.1 && (double) this.velocity.X < 0.1) - this.velocity.X = 0.0f; - } - } - if (this.timeLeft > 10 && (flag2 || (double) this.velocity.Y == 0.0)) - { - ++this.ai[1]; - int num10 = 60; - if (flag2) - num10 = 120; - if ((double) this.ai[1] > (double) num10) - { - this.ai[1] = 0.0f; - if (flag2) - { - Player player = Main.player[this.target]; - this.ai[0] = Main.rand.Next(2) == 1 ? 5f : 4f; - if ((double) this.ai[0] == 4.0) - { - this.ai[2] = 1f; - if (player != null && player.active && !player.dead && ((double) player.Bottom.Y < (double) this.Bottom.Y || (double) Math.Abs(player.Center.X - this.Center.X) > 250.0)) - { - this.ai[0] = 5f; - this.ai[2] = 0.0f; - } - } - } - else - { - switch (Main.rand.Next(3)) - { - case 1: - this.ai[0] = 4f; - break; - case 2: - this.ai[0] = 5f; - break; - default: - this.ai[0] = 3f; - break; - } - } - this.netUpdate = true; - break; - } - break; - } - break; - case 1: - this.rotation = 0.0f; - ++this.ai[1]; - num2 = (float) (0.5 + (double) MathHelper.Clamp(this.ai[1] / 30f, 0.0f, 1f) * 0.5); - if ((double) this.ai[1] >= 30.0 && Main.netMode != 1) - { - this.ai[0] = 0.0f; - this.ai[1] = 0.0f; - this.netUpdate = true; - this.TargetClosest(); - } - if (Main.netMode == 1 && (double) this.ai[1] >= 60.0) - { - this.ai[0] = 0.0f; - this.ai[1] = 0.0f; - this.TargetClosest(); - } - Color dustColor1 = NPC.AI_121_QueenSlime_GetDustColor(); - dustColor1.A = (byte) 150; - for (int index6 = 0; index6 < 10; ++index6) - { - int index7 = Dust.NewDust(this.position + Vector2.UnitX * -20f, this.width + 40, this.height, 4, this.velocity.X, this.velocity.Y, 50, dustColor1, 1.5f); - Main.dust[index7].noGravity = true; - Main.dust[index7].velocity *= 2f; - } - break; - case 2: - this.rotation = 0.0f; - ++this.ai[1]; - num2 = (float) (0.5 + (double) MathHelper.Clamp((float) ((60.0 - (double) this.ai[1]) / 60.0), 0.0f, 1f) * 0.5); - if ((double) this.ai[1] >= 60.0) - flag1 = true; - if ((double) this.ai[1] == 60.0) - Gore.NewGore(this.Center + new Vector2(-40f, (float) (-this.height / 2)), this.velocity, 1258); - if ((double) this.ai[1] >= 60.0 && Main.netMode != 1) - { - this.Bottom = new Vector2(this.localAI[1], this.localAI[2]); - this.ai[0] = 1f; - this.ai[1] = 0.0f; - this.netUpdate = true; - } - if (Main.netMode == 1 && (double) this.ai[1] >= 120.0) - { - this.ai[0] = 1f; - this.ai[1] = 0.0f; - } - if (!flag1) - { - Color dustColor2 = NPC.AI_121_QueenSlime_GetDustColor(); - dustColor2.A = (byte) 150; - for (int index8 = 0; index8 < 10; ++index8) - { - int index9 = Dust.NewDust(this.position + Vector2.UnitX * -20f, this.width + 40, this.height, 4, this.velocity.X, this.velocity.Y, 50, dustColor2, 1.5f); - Main.dust[index9].noGravity = true; - Main.dust[index9].velocity *= 0.5f; - } - break; - } - break; - case 3: - this.rotation = 0.0f; - if ((double) this.velocity.Y == 0.0) - { - this.velocity.X *= 0.8f; - if ((double) this.velocity.X > -0.1 && (double) this.velocity.X < 0.1) - this.velocity.X = 0.0f; - this.ai[1] += 4f; - if ((double) this.life < (double) this.lifeMax * 0.66) - this.ai[1] += 4f; - if ((double) this.life < (double) this.lifeMax * 0.33) - this.ai[1] += 4f; - if ((double) this.ai[1] >= 0.0) - { - this.netUpdate = true; - this.TargetClosest(); - if ((double) this.ai[2] == 3.0) - { - this.velocity.Y = -13f; - this.velocity.X += 3.5f * (float) this.direction; - this.ai[1] = 0.0f; - this.ai[2] = 0.0f; - if (this.timeLeft > 10) - { - this.ai[0] = 0.0f; - break; - } - this.ai[1] = -60f; - break; - } - if ((double) this.ai[2] == 2.0) - { - this.velocity.Y = -6f; - this.velocity.X += 4.5f * (float) this.direction; - this.ai[1] = -40f; - ++this.ai[2]; - break; - } - this.velocity.Y = -8f; - this.velocity.X += 4f * (float) this.direction; - this.ai[1] = -40f; - ++this.ai[2]; - break; - } - break; - } - if (this.target < (int) byte.MaxValue) - { - float num11 = 3f; - if (Main.getGoodWorld) - num11 = 7f; - if (this.direction == 1 && (double) this.velocity.X < (double) num11 || this.direction == -1 && (double) this.velocity.X > -(double) num11) - { - if (this.direction == -1 && (double) this.velocity.X < 0.1 || this.direction == 1 && (double) this.velocity.X > -0.1) - { - this.velocity.X += 0.2f * (float) this.direction; - break; - } - this.velocity.X *= 0.93f; - break; - } - break; - } - break; - case 4: - this.rotation *= 0.9f; - this.noTileCollide = true; - this.noGravity = true; - if ((double) this.ai[2] == 1.0) - { - this.noTileCollide = false; - this.noGravity = false; - int num12 = 30; - if (flag2) - num12 = 10; - if (Main.getGoodWorld) - num12 = 0; - Player player = Main.player[this.target]; - Vector2 center1 = this.Center; - if (!player.dead && player.active && (double) Math.Abs(this.Center.X - player.Center.X) / 16.0 <= (double) num3) - { - Vector2 center2 = player.Center; - } - if ((double) this.velocity.Y == 0.0) - { - this.ai[0] = 0.0f; - this.ai[1] = 0.0f; - this.ai[2] = 0.0f; - this.netUpdate = true; - SoundEngine.PlaySound(SoundID.Item167, this.Center); - if (Main.netMode != 1) - Projectile.NewProjectile(this.Bottom, Vector2.Zero, 922, Damage2, 0.0f, Main.myPlayer); - for (int index10 = 0; index10 < 20; ++index10) - { - int index11 = Dust.NewDust(this.Bottom - new Vector2((float) (this.width / 2), 30f), this.width, 30, 31, this.velocity.X, this.velocity.Y, 40, NPC.AI_121_QueenSlime_GetDustColor()); - Main.dust[index11].noGravity = true; - Main.dust[index11].velocity.Y = (float) ((double) Main.rand.NextFloat() * -3.0 - 5.0); - Main.dust[index11].velocity.X *= 7f; - } - } - else if ((double) this.ai[1] >= (double) num12) - { - for (int index12 = 0; index12 < 4; ++index12) - { - Vector2 Position = this.Bottom - new Vector2(Main.rand.NextFloatDirection() * 16f, (float) Main.rand.Next(8)); - int index13 = Dust.NewDust(Position, 2, 2, 31, this.velocity.X, this.velocity.Y, 40, NPC.AI_121_QueenSlime_GetDustColor(), 1.4f); - Main.dust[index13].position = Position; - Main.dust[index13].noGravity = true; - Main.dust[index13].velocity.Y = this.velocity.Y * 0.9f; - Main.dust[index13].velocity.X = (float) ((Main.rand.Next(2) == 0 ? -10.0 : 10.0) + (double) Main.rand.NextFloatDirection() * 3.0); - } - } - this.velocity.X *= 0.8f; - float num13 = this.ai[1]; - ++this.ai[1]; - if ((double) this.ai[1] >= (double) num12) - { - if ((double) num13 < (double) num12) - this.netUpdate = true; - if (flag2 && (double) this.ai[1] > (double) (num12 + 120)) - { - this.ai[0] = 0.0f; - this.ai[1] = 0.0f; - this.ai[2] = 0.0f; - this.velocity.Y *= 0.8f; - this.netUpdate = true; - break; - } - ++this.velocity.Y; - float num14 = 14f; - if (Main.getGoodWorld) - { - ++this.velocity.Y; - num14 = 15.99f; - } - if ((double) this.velocity.Y == 0.0) - this.velocity.Y = 0.01f; - if ((double) this.velocity.Y >= (double) num14) - { - this.velocity.Y = num14; - break; - } - break; - } - this.velocity.Y *= 0.8f; - break; - } - if (Main.netMode != 1 && (double) this.ai[1] == 0.0) - { - this.TargetClosest(); - this.netUpdate = true; - } - ++this.ai[1]; - if ((double) this.ai[1] >= 30.0) - { - if ((double) this.ai[1] >= 60.0) - { - this.ai[1] = 60f; - if (Main.netMode != 1) - { - this.ai[1] = 0.0f; - this.ai[2] = 1f; - this.velocity.Y = -3f; - this.netUpdate = true; - } - } - Player player = Main.player[this.target]; - Vector2 center = this.Center; - if (!player.dead && player.active && (double) Math.Abs(this.Center.X - player.Center.X) / 16.0 <= (double) num3) - center = player.Center; - center.Y -= 384f; - if ((double) this.velocity.Y == 0.0) - { - this.velocity = center - this.Center; - this.velocity = this.velocity.SafeNormalize(Vector2.Zero); - this.velocity = this.velocity * 20f; - break; - } - this.velocity.Y *= 0.95f; - break; - } - break; - case 5: - this.rotation *= 0.9f; - this.noTileCollide = true; - this.noGravity = true; - if (flag2) - this.ai[3] = 0.0f; - if ((double) this.ai[2] == 1.0) - { - ++this.ai[1]; - if ((double) this.ai[1] >= 10.0) - { - if (Main.netMode != 1) - { - int num15 = 10; - if (Main.getGoodWorld) - num15 = 15; - int num16 = num15; - if (!flag2) - num16 = 6; - for (int index = 0; index < num16; ++index) - { - Vector2 spinningpoint = new Vector2(9f, 0.0f); - spinningpoint = spinningpoint.RotatedBy((double) -index * 6.28318548202515 / (double) num15, Vector2.Zero); - Projectile.NewProjectile(this.Center.X, this.Center.Y, spinningpoint.X, spinningpoint.Y, 926, Damage1, 0.0f, Main.myPlayer); - } - } - this.ai[0] = 0.0f; - this.ai[1] = 0.0f; - this.ai[2] = 0.0f; - this.netUpdate = true; - break; - } - break; - } - if (Main.netMode != 1 && (double) this.ai[1] == 0.0) - { - this.TargetClosest(); - this.netUpdate = true; - } - ++this.ai[1]; - if ((double) this.ai[1] >= 50.0) - { - this.ai[1] = 50f; - if (Main.netMode != 1) - { - this.ai[1] = 0.0f; - this.ai[2] = 1f; - this.netUpdate = true; - } - } - float num17 = 100f; - for (int index14 = 0; index14 < 4; ++index14) - { - Vector2 Position = this.Center + Main.rand.NextVector2CircularEdge(num17, num17); - if (!flag2) - Position += new Vector2(0.0f, 20f); - Vector2 vector2 = (Position - this.Center).SafeNormalize(Vector2.Zero) * -8f; - int index15 = Dust.NewDust(Position, 2, 2, 31, vector2.X, vector2.Y, 40, NPC.AI_121_QueenSlime_GetDustColor(), 1.8f); - Main.dust[index15].position = Position; - Main.dust[index15].noGravity = true; - Main.dust[index15].alpha = 250; - Main.dust[index15].velocity = vector2; - Main.dust[index15].customData = (object) this; - } - if (flag2) - { - this.AI_121_QueenSlime_FlyMovement(); - break; - } - break; - } - this.dontTakeDamage = this.hide = flag1; - if ((double) num2 != (double) this.scale) - { - this.position.X += (float) (this.width / 2); - this.position.Y += (float) this.height; - this.scale = num2; - this.width = (int) (114.0 * (double) this.scale); - this.height = (int) (100.0 * (double) this.scale); - this.position.X -= (float) (this.width / 2); - this.position.Y -= (float) this.height; - } - if (this.life <= 0) - return; - if (Main.rand.Next(360) == 0) - SoundEngine.PlaySound(65, this.position); - if (Main.netMode == 1) - return; - if ((double) this.localAI[0] >= (double) (this.lifeMax / 2) && this.life < this.lifeMax / 2) - { - this.localAI[0] = (float) this.life; - this.ai[0] = 0.0f; - this.ai[1] = 0.0f; - this.ai[2] = 0.0f; - this.netUpdate = true; - } - int num18 = (int) ((double) this.lifeMax * 0.0199999995529652); - if (flag2) - num18 = (int) ((double) this.lifeMax * 0.0149999996647239); - if ((double) (this.life + num18) >= (double) this.localAI[0]) - return; - this.localAI[0] = (float) this.life; - int num19 = Main.rand.Next(1, 3); - for (int index = 0; index < num19; ++index) - { - int X = (int) ((double) this.position.X + (double) Main.rand.Next(this.width - 32)); - int Y = (int) ((double) this.position.Y + (double) Main.rand.Next(this.height - 32)); - int Type = 658; - switch (Main.rand.Next(3)) - { - case 0: - Type = 658; - break; - case 1: - Type = 659; - break; - case 2: - Type = 660; - break; - } - int number = NPC.NewNPC(X, Y, Type); - Main.npc[number].SetDefaults(Type); - Main.npc[number].velocity.X = (float) Main.rand.Next(-15, 16) * 0.1f; - Main.npc[number].velocity.Y = (float) Main.rand.Next(-30, 1) * 0.1f; - Main.npc[number].ai[0] = (float) (-500 * Main.rand.Next(3)); - Main.npc[number].ai[1] = 0.0f; - if (Main.netMode == 2 && number < 200) - NetMessage.SendData(23, number: number); - } - } - - public bool AI_120_HallowBoss_IsInPhase2() => (double) this.ai[3] == 1.0 || (double) this.ai[3] == 3.0; - - public bool AI_120_HallowBoss_IsGenuinelyEnraged() => (double) this.ai[3] == 2.0 || (double) this.ai[3] == 3.0; - - private void AI_120_HallowBoss_DoMagicEffect(Vector2 spot, int effectType, float progress) - { - float num1 = 4f; - float num2 = 1f; - float num3 = 0.0f; - float num4 = 0.5f; - int num5 = 2; - int Type = 267; - switch (effectType) - { - case 1: - num2 = 0.5f; - num3 = 2f; - num4 = 0.0f; - break; - case 2: - case 4: - num1 = 50f; - num2 = 0.5f; - num3 = 0.0f; - num4 = 0.0f; - num5 = 4; - break; - case 3: - num1 = 30f; - num2 = 0.1f; - num3 = 2.5f; - num4 = 0.0f; - break; - case 5: - if ((double) progress == 0.0) - { - num5 = 0; - } - else - { - num5 = 5; - Type = Main.rand.Next(86, 92); - } - if ((double) progress >= 1.0) - { - num5 = 0; - break; - } - break; - } - for (int index = 0; index < num5; ++index) - { - Dust dust = Dust.NewDustPerfect(spot, Type, new Vector2?(Main.rand.NextVector2CircularEdge(num1, num1) * (Main.rand.NextFloat() * (1f - num4) + num4)), newColor: Main.hslToRgb(Main.rand.NextFloat(), 1f, 0.5f), Scale: ((float) ((double) Main.rand.NextFloat() * 2.0 + 2.0) * num2)); - dust.fadeIn = num3; - dust.noGravity = true; - switch (effectType) - { - case 2: - case 4: - dust.velocity *= 0.005f; - dust.scale = 3f * Utils.GetLerpValue(0.7f, 0.0f, progress, true) * Utils.GetLerpValue(0.0f, 0.3f, progress, true); - dust.velocity = ((float) (6.28318548202515 * ((double) index / 4.0) + 0.785398185253143)).ToRotationVector2() * 8f * Utils.GetLerpValue(1f, 0.0f, progress, true); - dust.velocity += this.velocity * 0.3f; - float num6 = 0.0f; - if (effectType == 4) - num6 = 0.5f; - dust.color = Main.hslToRgb((float) (((double) index / 5.0 + (double) num6 + (double) progress * 0.5) % 1.0), 1f, 0.5f); - dust.color.A /= (byte) 2; - dust.alpha = (int) sbyte.MaxValue; - break; - case 5: - if ((double) progress == 0.0) - { - dust.customData = (object) this; - dust.scale = 1.5f; - dust.fadeIn = 0.0f; - dust.velocity = new Vector2(0.0f, -1f) + Main.rand.NextVector2Circular(1f, 1f); - dust.color = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 80) * 0.3f; - break; - } - dust.color = Main.hslToRgb((float) ((double) progress * 2.0 % 1.0), 1f, 0.5f); - dust.alpha = 0; - dust.scale = 1f; - dust.fadeIn = 1.3f; - dust.velocity *= 3f; - dust.velocity.X *= 0.1f; - dust.velocity += this.velocity * 1f; - break; - } - } - } - - public static bool ShouldEmpressBeEnraged() => Main.dayTime; - - private void AI_120_HallowBoss() - { - Vector2 vector2_1 = new Vector2(-150f, -250f); - Vector2 vector2_2 = new Vector2(150f, -250f); - Vector2 vector2_3 = new Vector2(0.0f, -350f); - Vector2 vector2_4 = new Vector2(0.0f, -350f); - Vector2 vector2_5 = new Vector2(-80f, -500f); - float moveSpeed = 0.5f; - float num1 = 12f; - float num2 = 40f; - float num3 = 6400f; - int Damage1 = 40; - int num4 = 50; - int num5 = 70; - int num6 = 45; - int num7 = 45; - int num8 = 50; - bool flag1 = this.AI_120_HallowBoss_IsInPhase2(); - bool flag2 = Main.expertMode; - bool flag3 = flag1 & flag2; - bool flag4 = NPC.ShouldEmpressBeEnraged(); - if (this.life == this.lifeMax & flag4 && !this.AI_120_HallowBoss_IsGenuinelyEnraged()) - this.ai[3] += 2f; - bool flag5 = true; - int num9 = 30; - int num10 = 30; - int num11 = 30; - int num12 = 35; - int num13 = 65; - if (flag1) - { - num4 = 60; - num6 = 50; - num7 = 50; - num8 = 60; - num5 = 65; - num9 = 35; - num10 = 35; - num11 = 35; - num12 = 40; - num13 = 30; - } - int Damage2 = this.GetAttackDamage_ForProjectiles((float) num4, (float) num9); - int Damage3 = this.GetAttackDamage_ForProjectiles((float) num6, (float) num10); - int Damage4 = this.GetAttackDamage_ForProjectiles((float) num7, (float) num11); - int Damage5 = this.GetAttackDamage_ForProjectiles((float) num8, (float) num12); - int Damage6 = this.GetAttackDamage_ForProjectiles((float) num5, (float) num13); - if (flag4) - { - Damage2 = 9999; - Damage3 = 9999; - Damage4 = 9999; - Damage5 = 9999; - Damage6 = 9999; - flag2 = true; - } - float num14 = flag2 ? 0.3f : 1f; - bool flag6 = true; - int num15 = 0; - if (flag1) - num15 += 15; - if (flag2) - num15 += 5; - switch ((int) this.ai[0]) - { - case 0: - if ((double) this.ai[1] == 0.0) - { - this.velocity = new Vector2(0.0f, 5f); - if (Main.netMode != 1) - Projectile.NewProjectile(this.Center + new Vector2(0.0f, -80f), Vector2.Zero, 874, 0, 0.0f, Main.myPlayer); - } - if ((double) this.ai[1] == 10.0) - SoundEngine.PlaySound(SoundID.Item161, this.Center); - this.velocity = this.velocity * 0.95f; - if ((double) this.ai[1] > 10.0 && (double) this.ai[1] < 150.0) - { - int num16 = 2; - for (int index = 0; index < num16; ++index) - { - float num17 = MathHelper.Lerp(1.3f, 0.7f, this.Opacity) * Utils.GetLerpValue(0.0f, 120f, this.ai[1], true); - int dustIndex = Dust.NewDust(this.position, this.width, this.height, 267, newColor: Main.hslToRgb(this.ai[1] / 180f, 1f, 0.5f)); - Main.dust[dustIndex].position = this.Center + Main.rand.NextVector2Circular((float) this.width * 3f, (float) this.height * 3f) + new Vector2(0.0f, -150f); - Main.dust[dustIndex].velocity *= Main.rand.NextFloat() * 0.8f; - Main.dust[dustIndex].noGravity = true; - Main.dust[dustIndex].fadeIn = (float) (0.600000023841858 + (double) Main.rand.NextFloat() * 0.699999988079071 * (double) num17); - Main.dust[dustIndex].velocity += Vector2.UnitY * 3f; - Main.dust[dustIndex].scale = 0.35f; - if (dustIndex != 6000) - { - Dust dust = Dust.CloneDust(dustIndex); - dust.scale /= 2f; - dust.fadeIn *= 0.85f; - dust.color = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); - } - } - } - ++this.ai[1]; - flag5 = false; - flag6 = false; - this.Opacity = MathHelper.Clamp(this.ai[1] / 180f, 0.0f, 1f); - if ((double) this.ai[1] >= 180.0) - { - this.ai[0] = 1f; - this.ai[1] = 0.0f; - this.netUpdate = true; - this.TargetClosest(); - break; - } - break; - case 1: - float num18 = flag1 ? 20f : 45f; - if (Main.getGoodWorld) - num18 /= 2f; - if ((double) this.ai[1] <= 10.0) - { - if ((double) this.ai[1] == 0.0) - this.TargetClosest(); - NPCAimedTarget targetData = this.GetTargetData(); - if (targetData.Invalid) - { - this.ai[0] = 13f; - this.ai[1] = 0.0f; - ++this.ai[2]; - this.velocity = this.velocity / 4f; - this.netUpdate = true; - break; - } - Vector2 vector2_6 = targetData.Center + new Vector2(0.0f, -300f); - if ((double) this.Distance(vector2_6) > 200.0) - vector2_6 -= this.DirectionTo(vector2_6) * 100f; - Vector2 v = vector2_6 - this.Center; - float lerpValue = Utils.GetLerpValue(100f, 600f, v.Length(), false); - float num19 = v.Length(); - if ((double) num19 > 18.0) - num19 = 18f; - this.velocity = Vector2.Lerp(v.SafeNormalize(Vector2.Zero) * num19, v / 6f, lerpValue); - this.netUpdate = true; - } - this.velocity = this.velocity * 0.92f; - ++this.ai[1]; - if ((double) this.ai[1] >= (double) num18) - { - int num20 = (int) this.ai[2]; - int num21 = 2; - int num22 = 0; - if (!flag1) - { - int num23 = num22; - int num24 = num23 + 1; - int num25 = num23; - int num26 = num24; - int num27 = num26 + 1; - int num28 = num26; - int num29 = num27; - int num30 = num29 + 1; - int num31 = num29; - int num32 = num30; - int num33 = num32 + 1; - int num34 = num32; - int num35 = num33; - int num36 = num35 + 1; - int num37 = num35; - int num38 = num36; - int num39 = num38 + 1; - int num40 = num38; - int num41 = num39; - int num42 = num41 + 1; - int num43 = num41; - int num44 = num42; - int num45 = num44 + 1; - int num46 = num44; - int num47 = num45; - int num48 = num47 + 1; - int num49 = num47; - int num50 = num48; - num22 = num50 + 1; - int num51 = num50; - if (num20 % num22 == num25) - num21 = 2; - if (num20 % num22 == num28) - num21 = 8; - if (num20 % num22 == num31) - num21 = 6; - if (num20 % num22 == num34) - num21 = 8; - if (num20 % num22 == num37) - num21 = 5; - if (num20 % num22 == num40) - num21 = 2; - if (num20 % num22 == num43) - num21 = 8; - if (num20 % num22 == num46) - num21 = 4; - if (num20 % num22 == num49) - num21 = 8; - if (num20 % num22 == num51) - num21 = 5; - if ((double) this.life / (double) this.lifeMax <= 0.5) - num21 = 10; - } - if (flag1) - { - int num52 = num22; - int num53 = num52 + 1; - int num54 = num52; - int num55 = num53; - int num56 = num55 + 1; - int num57 = num55; - int num58 = num56; - int num59 = num58 + 1; - int num60 = num58; - int num61 = -1; - if (flag2) - num61 = num59++; - int num62 = num59; - int num63 = num62 + 1; - int num64 = num62; - int num65 = num63; - int num66 = num65 + 1; - int num67 = num65; - int num68 = num66; - int num69 = num68 + 1; - int num70 = num68; - int num71 = num69; - int num72 = num71 + 1; - int num73 = num71; - int num74 = num72; - int num75 = num74 + 1; - int num76 = num74; - int num77 = num75; - int num78 = num77 + 1; - int num79 = num77; - if (num20 % num78 == num54) - num21 = 7; - if (num20 % num78 == num57) - num21 = 2; - if (num20 % num78 == num60) - num21 = 8; - if (num20 % num78 == num64) - num21 = 5; - if (num20 % num78 == num67) - num21 = 2; - if (num20 % num78 == num70) - num21 = 6; - if (num20 % num78 == num70) - num21 = 6; - if (num20 % num78 == num73) - num21 = 4; - if (num20 % num78 == num76) - num21 = 8; - if (num20 % num78 == num61) - num21 = 11; - if (num20 % num78 == num79) - num21 = 12; - } - this.TargetClosest(); - NPCAimedTarget targetData = this.GetTargetData(); - bool flag7 = false; - if (this.AI_120_HallowBoss_IsGenuinelyEnraged()) - { - if (!Main.dayTime) - flag7 = true; - if (Main.dayTime && Main.time >= 53400.0) - flag7 = true; - } - if (((targetData.Invalid ? 1 : ((double) this.Distance(targetData.Center) > (double) num3 ? 1 : 0)) | (flag7 ? 1 : 0)) != 0) - num21 = 13; - if (num21 == 8 && (double) targetData.Center.X > (double) this.Center.X) - num21 = 9; - if (flag2 && (num21 == 5 ? 1 : (num21 == 12 ? 1 : 0)) == 0) - this.velocity = this.DirectionFrom(targetData.Center).SafeNormalize(Vector2.Zero).RotatedBy(1.57079637050629 * (double) ((double) targetData.Center.X > (double) this.Center.X).ToDirectionInt()) * 20f; - this.ai[0] = (float) num21; - this.ai[1] = 0.0f; - ++this.ai[2]; - this.netUpdate = true; - break; - } - break; - case 2: - if ((double) this.ai[1] == 0.0) - SoundEngine.PlaySound(SoundID.Item164, this.Center); - float num80 = 90f - (float) num15; - Vector2 vector2_7 = new Vector2(-55f, -30f); - NPCAimedTarget targetData1 = this.GetTargetData(); - Vector2 vector2_8 = targetData1.Invalid ? this.Center : targetData1.Center; - if ((double) this.Distance(vector2_8 + vector2_1) > (double) num2) - this.SimpleFlyMovement(this.DirectionTo(vector2_8 + vector2_1).SafeNormalize(Vector2.Zero) * num1, moveSpeed); - if ((double) this.ai[1] < 60.0) - this.AI_120_HallowBoss_DoMagicEffect(this.Center + vector2_7, 1, Utils.GetLerpValue(0.0f, 60f, this.ai[1], true)); - int num81 = 3; - if (flag2) - num81 = 2; - if ((int) this.ai[1] % num81 == 0 && (double) this.ai[1] < 60.0) - { - float ai1 = this.ai[1] / 60f; - Vector2 velocity = new Vector2(0.0f, -6f).RotatedBy(1.57079637050629 * (double) Main.rand.NextFloatDirection()); - if (flag3) - velocity = new Vector2(0.0f, -10f).RotatedBy(6.28318548202515 * (double) Main.rand.NextFloat()); - if (Main.netMode != 1) - Projectile.NewProjectile(this.Center + vector2_7, velocity, 873, Damage3, 0.0f, Main.myPlayer, (float) this.target, ai1); - if (Main.netMode != 1) - { - int num82 = (int) ((double) this.ai[1] / (double) num81); - for (int playerIndex = 0; playerIndex < (int) byte.MaxValue; ++playerIndex) - { - if (this.AI_120_HallowBoss_CanShootExtraAt(playerIndex, num82 % 3, 3, 2400f)) - Projectile.NewProjectile(this.Center + vector2_7, velocity, 873, Damage3, 0.0f, Main.myPlayer, (float) playerIndex, ai1); - } - } - } - ++this.ai[1]; - if ((double) this.ai[1] >= 60.0 + (double) num80) - { - this.ai[0] = 1f; - this.ai[1] = 0.0f; - this.netUpdate = true; - break; - } - break; - case 3: - ++this.ai[1]; - NPCAimedTarget targetData2 = this.GetTargetData(); - Vector2 vector2_9 = targetData2.Invalid ? this.Center : targetData2.Center; - if ((double) this.Distance(vector2_9 + vector2_2) > (double) num2) - this.SimpleFlyMovement(this.DirectionTo(vector2_9 + vector2_2).SafeNormalize(Vector2.Zero) * num1, moveSpeed); - if ((int) this.ai[1] % 180 == 0) - { - Vector2 vector2_10 = new Vector2(0.0f, -100f); - Projectile.NewProjectile(targetData2.Center + vector2_10, Vector2.Zero, 874, Damage1, 0.0f, Main.myPlayer); - } - if ((double) this.ai[1] >= 120.0) - { - this.ai[0] = 1f; - this.ai[1] = 0.0f; - this.netUpdate = true; - break; - } - break; - case 4: - float num83 = (float) (20 - num15); - Vector2 vector2_11 = new Vector2(0.0f, -100f); - if ((double) this.ai[1] == 0.0) - SoundEngine.PlaySound(SoundID.Item162, this.Center); - if ((double) this.ai[1] >= 6.0 && (double) this.ai[1] < 54.0) - { - this.AI_120_HallowBoss_DoMagicEffect(this.Center + new Vector2(-55f, -20f), 2, Utils.GetLerpValue(0.0f, 100f, this.ai[1], true)); - this.AI_120_HallowBoss_DoMagicEffect(this.Center + new Vector2(55f, -20f), 4, Utils.GetLerpValue(0.0f, 100f, this.ai[1], true)); - } - NPCAimedTarget targetData3 = this.GetTargetData(); - Vector2 vector2_12 = targetData3.Invalid ? this.Center : targetData3.Center; - if ((double) this.Distance(vector2_12 + vector2_3) > (double) num2) - this.SimpleFlyMovement(this.DirectionTo(vector2_12 + vector2_3).SafeNormalize(Vector2.Zero) * num1, moveSpeed); - int num84 = 4; - if (flag2) - num84 = 5; - if ((int) this.ai[1] % 4 == 0 && (double) this.ai[1] < 100.0) - { - int num85 = 1; - for (int index = 0; index < num85; ++index) - { - int num86 = (int) this.ai[1] / 4; - Vector2 vector2_13 = Vector2.UnitX.RotatedBy(3.14159274101257 / (double) (num84 * 2) + (double) num86 * (3.14159274101257 / (double) num84) + 0.0); - if (!flag2) - vector2_13.X += (double) vector2_13.X > 0.0 ? 0.5f : -0.5f; - vector2_13.Normalize(); - float num87 = 300f; - if (flag2) - num87 = 450f; - Vector2 center1 = targetData3.Center; - if ((double) this.Distance(center1) <= 2400.0) - { - if ((double) Vector2.Dot(targetData3.Velocity.SafeNormalize(Vector2.UnitY), vector2_13) > 0.0) - vector2_13 *= -1f; - int num88 = 90; - Vector2 vector2_14 = center1 + targetData3.Velocity * (float) num88; - Vector2 vector2_15 = center1 + vector2_13 * num87 - targetData3.Velocity * 30f; - if ((double) vector2_15.Distance(center1) < (double) num87) - { - Vector2 vector2_16 = center1 - vector2_15; - if (vector2_16 == Vector2.Zero) - vector2_16 = vector2_13; - vector2_15 = center1 - Vector2.Normalize(vector2_16) * num87; - } - Vector2 vector2_17 = vector2_15; - Vector2 v1 = vector2_14 - vector2_17; - if (Main.netMode != 1) - Projectile.NewProjectile(vector2_15, Vector2.Zero, 919, Damage2, 0.0f, Main.myPlayer, v1.ToRotation(), this.ai[1] / 100f); - if (Main.netMode != 1) - { - int num89 = (int) ((double) this.ai[1] / 4.0); - for (int playerIndex = 0; playerIndex < (int) byte.MaxValue; ++playerIndex) - { - if (this.AI_120_HallowBoss_CanShootExtraAt(playerIndex, num89 % 3, 3, 2400f)) - { - Player player = Main.player[playerIndex]; - Vector2 center2 = player.Center; - if ((double) Vector2.Dot(player.velocity.SafeNormalize(Vector2.UnitY), vector2_13) > 0.0) - vector2_13 *= -1f; - Vector2 vector2_18 = center2 + player.velocity * (float) num88; - Vector2 vector2_19 = center2 + vector2_13 * num87 - player.velocity * 30f; - if ((double) vector2_19.Distance(center2) < (double) num87) - { - Vector2 vector2_20 = center2 - vector2_19; - if (vector2_20 == Vector2.Zero) - vector2_20 = vector2_13; - vector2_19 = center2 - Vector2.Normalize(vector2_20) * num87; - } - Vector2 vector2_21 = vector2_19; - Vector2 v2 = vector2_18 - vector2_21; - Projectile.NewProjectile(vector2_19, Vector2.Zero, 919, Damage2, 0.0f, Main.myPlayer, v2.ToRotation(), this.ai[1] / 100f); - } - } - } - } - } - } - ++this.ai[1]; - if ((double) this.ai[1] >= 100.0 + (double) num83) - { - this.ai[0] = 1f; - this.ai[1] = 0.0f; - this.netUpdate = true; - break; - } - break; - case 5: - if ((double) this.ai[1] == 0.0) - SoundEngine.PlaySound(SoundID.Item163, this.Center); - float num90 = 30f - (float) num15; - Vector2 vector2_22 = new Vector2(55f, -30f); - Vector2 vector2_23 = this.Center + vector2_22; - if ((double) this.ai[1] < 42.0) - this.AI_120_HallowBoss_DoMagicEffect(this.Center + vector2_22, 3, Utils.GetLerpValue(0.0f, 42f, this.ai[1], true)); - NPCAimedTarget targetData4 = this.GetTargetData(); - Vector2 vector2_24 = targetData4.Invalid ? this.Center : targetData4.Center; - if ((double) this.Distance(vector2_24 + vector2_4) > (double) num2) - this.SimpleFlyMovement(this.DirectionTo(vector2_24 + vector2_4).SafeNormalize(Vector2.Zero) * num1, moveSpeed); - if ((int) this.ai[1] % 42 == 0 && (double) this.ai[1] < 42.0) - { - float num91 = 6.283185f * Main.rand.NextFloat(); - for (float num92 = 0.0f; (double) num92 < 1.0; num92 += 0.07692308f) - { - float ai1 = num92; - Vector2 spinningpoint = Vector2.UnitY.RotatedBy(1.57079637050629 + 6.28318548202515 * (double) ai1 + (double) num91); - if (Main.netMode != 1) - Projectile.NewProjectile(vector2_23 + spinningpoint.RotatedBy(-1.57079637050629) * 30f, spinningpoint * 8f, 872, Damage4, 0.0f, Main.myPlayer, ai1: ai1); - } - } - ++this.ai[1]; - if ((double) this.ai[1] >= 42.0 + (double) num90) - { - this.ai[0] = 1f; - this.ai[1] = 0.0f; - this.netUpdate = true; - break; - } - break; - case 6: - float num93 = (float) (120 - num15); - Vector2 position = this.Center + new Vector2(0.0f, -100f); - NPCAimedTarget targetData5 = this.GetTargetData(); - Vector2 vector2_25 = targetData5.Invalid ? this.Center : targetData5.Center; - if ((double) this.Distance(vector2_25 + vector2_5) > (double) num2) - this.SimpleFlyMovement(this.DirectionTo(vector2_25 + vector2_5).SafeNormalize(Vector2.Zero) * num1 * 0.3f, moveSpeed * 0.7f); - if ((int) this.ai[1] % 60 == 0 && (double) this.ai[1] < 180.0) - { - int num94 = (int) this.ai[1] / 60; - int num95 = (double) targetData5.Center.X > (double) this.Center.X ? 1 : 0; - float num96 = 6f; - if (flag2) - num96 = 8f; - float num97 = 1f / num96; - for (float num98 = 0.0f; (double) num98 < 1.0; num98 += num97) - { - float ai0 = (float) (6.28318548202515 * (((double) num98 + (double) num97 * 0.5 + (double) num94 * (double) num97 * 0.5) % 1.0 + (double) num95)); - if (Main.netMode != 1) - Projectile.NewProjectile(position, Vector2.Zero, 923, Damage5, 0.0f, Main.myPlayer, ai0, (float) this.whoAmI); - } - } - ++this.ai[1]; - if ((double) this.ai[1] >= 180.0 + (double) num93) - { - this.ai[0] = 1f; - this.ai[1] = 0.0f; - this.netUpdate = true; - break; - } - break; - case 7: - float num99 = 20f; - float num100 = 60f; - float num101 = num100 * 4f; - if (flag2) - { - num99 = 40f; - num100 = 40f; - num101 = num100 * 6f; - } - float num102 = num99 - (float) num15; - NPCAimedTarget targetData6 = this.GetTargetData(); - Vector2 vector2_26 = targetData6.Invalid ? this.Center : targetData6.Center; - if ((double) this.Distance(vector2_26 + vector2_4) > (double) num2) - this.SimpleFlyMovement(this.DirectionTo(vector2_26 + vector2_4).SafeNormalize(Vector2.Zero) * num1 * 0.4f, moveSpeed); - if ((double) (int) this.ai[1] % (double) num100 == 0.0 && (double) this.ai[1] < (double) num101) - { - SoundEngine.PlaySound(SoundID.Item162, this.Center); - double num103 = (double) Main.rand.NextFloat(); - int num104 = (int) this.ai[1] / (int) num100; - float num105 = 13f; - float num106 = 150f; - float y = num105 * num106; - Vector2 center = targetData6.Center; - if ((double) this.Distance(center) <= 3200.0) - { - Vector2 vector2_27 = Vector2.Zero; - Vector2 vector2_28 = Vector2.UnitY; - float num107 = 0.4f; - float num108 = 1.4f; - float num109 = 1f; - if (flag2) - { - num105 += 5f; - num106 += 50f; - num109 *= 1f; - y *= 0.5f; - } - switch (num104) - { - case 0: - center += new Vector2((float) (-(double) y / 2.0), 0.0f) * num109; - vector2_27 = new Vector2(0.0f, y); - vector2_28 = Vector2.UnitX; - break; - case 1: - center += new Vector2(y / 2f, num106 / 2f) * num109; - vector2_27 = new Vector2(0.0f, y); - vector2_28 = -Vector2.UnitX; - break; - case 2: - center += new Vector2(-y, -y) * num107 * num109; - vector2_27 = new Vector2(y * num108, 0.0f); - vector2_28 = new Vector2(1f, 1f); - break; - case 3: - center += new Vector2((float) ((double) y * (double) num107 + (double) num106 / 2.0), -y * num107) * num109; - vector2_27 = new Vector2(-y * num108, 0.0f); - vector2_28 = new Vector2(-1f, 1f); - break; - case 4: - center += new Vector2(-y, y) * num107 * num109; - vector2_27 = new Vector2(y * num108, 0.0f); - vector2_28 = center.DirectionTo(targetData6.Center); - break; - case 5: - center += new Vector2((float) ((double) y * (double) num107 + (double) num106 / 2.0), y * num107) * num109; - vector2_27 = new Vector2(-y * num108, 0.0f); - vector2_28 = center.DirectionTo(targetData6.Center); - break; - } - for (float num110 = 0.0f; (double) num110 <= 1.0; num110 += 1f / num105) - { - Vector2 vector2_29 = center + vector2_27 * (num110 - 0.5f); - Vector2 v = vector2_28; - if (flag2) - { - Vector2 vector2_30 = targetData6.Velocity * 20f * num110; - Vector2 vector2_31 = vector2_29.DirectionTo(targetData6.Center + vector2_30); - v = Vector2.Lerp(vector2_28, vector2_31, 0.75f).SafeNormalize(Vector2.UnitY); - } - float ai1 = num110; - if (Main.netMode != 1) - Projectile.NewProjectile(vector2_29, Vector2.Zero, 919, Damage6, 0.0f, Main.myPlayer, v.ToRotation(), ai1); - } - } - } - ++this.ai[1]; - if ((double) this.ai[1] >= (double) num101 + (double) num102) - { - this.ai[0] = 1f; - this.ai[1] = 0.0f; - this.netUpdate = true; - break; - } - break; - case 8: - case 9: - float num111 = (float) (20 - num15); - Vector2 vector2_32 = this.Center + new Vector2(0.0f, -100f); - flag6 = (double) this.ai[1] < 6.0 || (double) this.ai[1] > 40.0; - int num112 = (double) this.ai[0] == 8.0 ? -1 : 1; - this.AI_120_HallowBoss_DoMagicEffect(this.Center, 5, Utils.GetLerpValue(40f, 90f, this.ai[1], true)); - if ((double) this.ai[1] <= 40.0) - { - if ((double) this.ai[1] == 20.0) - SoundEngine.PlaySound(SoundID.Item160, this.Center); - NPCAimedTarget targetData7 = this.GetTargetData(); - this.SimpleFlyMovement(this.DirectionTo((targetData7.Invalid ? this.Center : targetData7.Center) + new Vector2((float) (num112 * -550), 0.0f)).SafeNormalize(Vector2.Zero) * num1, moveSpeed * 2f); - if ((double) this.ai[1] == 40.0) - this.velocity = this.velocity * 0.3f; - } - else if ((double) this.ai[1] <= 90.0) - { - this.velocity = Vector2.Lerp(this.velocity, new Vector2((float) (num112 * 50), 0.0f), 0.05f); - if ((double) this.ai[1] == 90.0) - this.velocity = this.velocity * 0.7f; - num14 *= 1.5f; - } - else - this.velocity = this.velocity * 0.92f; - ++this.ai[1]; - if ((double) this.ai[1] >= 90.0 + (double) num111) - { - this.ai[0] = 1f; - this.ai[1] = 0.0f; - this.netUpdate = true; - break; - } - break; - case 10: - float num113 = (float) (20 - num15); - if ((double) this.ai[1] == 0.0) - SoundEngine.PlaySound(SoundID.Item161, this.Center); - flag6 = (double) this.ai[1] < 30.0 || (double) this.ai[1] > 170.0; - this.velocity = this.velocity * 0.95f; - if ((double) this.ai[1] == 90.0) - { - if ((double) this.ai[3] == 0.0) - this.ai[3] = 1f; - if ((double) this.ai[3] == 2.0) - this.ai[3] = 3f; - this.Center = this.GetTargetData().Center + new Vector2(0.0f, -250f); - this.netUpdate = true; - } - ++this.ai[1]; - if ((double) this.ai[1] >= 180.0 + (double) num113) - { - this.ai[0] = 1f; - this.ai[1] = 0.0f; - this.ai[2] = 0.0f; - this.netUpdate = true; - break; - } - break; - case 11: - if ((double) this.ai[1] == 0.0) - SoundEngine.PlaySound(SoundID.Item162, this.Center); - float num114 = (float) (20 - num15); - Vector2 vector2_33 = new Vector2(0.0f, -100f); - if ((double) this.ai[1] >= 6.0 && (double) this.ai[1] < 54.0) - { - this.AI_120_HallowBoss_DoMagicEffect(this.Center + new Vector2(-55f, -20f), 2, Utils.GetLerpValue(0.0f, 100f, this.ai[1], true)); - this.AI_120_HallowBoss_DoMagicEffect(this.Center + new Vector2(55f, -20f), 4, Utils.GetLerpValue(0.0f, 100f, this.ai[1], true)); - } - NPCAimedTarget targetData8 = this.GetTargetData(); - Vector2 vector2_34 = targetData8.Invalid ? this.Center : targetData8.Center; - if ((double) this.Distance(vector2_34 + vector2_3) > (double) num2) - this.SimpleFlyMovement(this.DirectionTo(vector2_34 + vector2_3).SafeNormalize(Vector2.Zero) * num1, moveSpeed); - if ((int) this.ai[1] % 3 == 0 && (double) this.ai[1] < 100.0) - { - int num115 = 1; - for (int index = 0; index < num115; ++index) - { - Vector2 v3 = -targetData8.Velocity; - v3.SafeNormalize(-Vector2.UnitY); - float num116 = 100f; - Vector2 center3 = targetData8.Center; - if ((double) this.Distance(center3) <= 2400.0) - { - int num117 = 90; - Vector2 vector2_35 = center3 + targetData8.Velocity * (float) num117; - Vector2 vector2_36 = center3 + v3 * num116; - if ((double) vector2_36.Distance(center3) < (double) num116) - { - Vector2 vector2_37 = center3 - vector2_36; - if (vector2_37 == Vector2.Zero) - vector2_37 = v3; - vector2_36 = center3 - Vector2.Normalize(vector2_37) * num116; - } - Vector2 vector2_38 = vector2_36; - Vector2 v4 = vector2_35 - vector2_38; - if (Main.netMode != 1) - Projectile.NewProjectile(vector2_36, Vector2.Zero, 919, Damage2, 0.0f, Main.myPlayer, v4.ToRotation(), this.ai[1] / 100f); - if (Main.netMode != 1) - { - int num118 = (int) ((double) this.ai[1] / 3.0); - for (int playerIndex = 0; playerIndex < (int) byte.MaxValue; ++playerIndex) - { - if (this.AI_120_HallowBoss_CanShootExtraAt(playerIndex, num118 % 3, 3, 2400f)) - { - Player player = Main.player[playerIndex]; - Vector2 v5 = -player.velocity; - v5.SafeNormalize(-Vector2.UnitY); - float num119 = 100f; - Vector2 center4 = player.Center; - int num120 = 90; - Vector2 vector2_39 = center4 + player.velocity * (float) num120; - Vector2 vector2_40 = center4 + v5 * num119; - if ((double) vector2_40.Distance(center4) < (double) num119) - { - Vector2 vector2_41 = center4 - vector2_40; - if (vector2_41 == Vector2.Zero) - vector2_41 = v5; - vector2_40 = center4 - Vector2.Normalize(vector2_41) * num119; - } - Vector2 vector2_42 = vector2_40; - Vector2 v6 = vector2_39 - vector2_42; - Projectile.NewProjectile(vector2_40, Vector2.Zero, 919, Damage2, 0.0f, Main.myPlayer, v6.ToRotation(), this.ai[1] / 100f); - } - } - } - } - } - } - ++this.ai[1]; - if ((double) this.ai[1] >= 100.0 + (double) num114) - { - this.ai[0] = 1f; - this.ai[1] = 0.0f; - this.netUpdate = true; - break; - } - break; - case 12: - float num121 = 90f - (float) num15; - Vector2 vector2_43 = new Vector2(-55f, -30f); - if ((double) this.ai[1] == 0.0) - { - SoundEngine.PlaySound(SoundID.Item165, this.Center); - this.velocity = new Vector2(0.0f, -12f); - } - this.velocity = this.velocity * 0.95f; - bool flag8 = (double) this.ai[1] < 60.0 && (double) this.ai[1] >= 10.0; - if (flag8) - this.AI_120_HallowBoss_DoMagicEffect(this.Center + vector2_43, 1, Utils.GetLerpValue(0.0f, 60f, this.ai[1], true)); - int num122 = 6; - if (flag2) - num122 = 4; - float ai1_1 = (float) (((double) this.ai[1] - 10.0) / 50.0); - if ((int) this.ai[1] % num122 == 0 & flag8) - { - double num123 = (double) this.ai[1] / 60.0; - Vector2 velocity = new Vector2(0.0f, -20f).RotatedBy(6.28318548202515 * (double) ai1_1); - if (Main.netMode != 1) - Projectile.NewProjectile(this.Center + vector2_43, velocity, 873, Damage3, 0.0f, Main.myPlayer, (float) this.target, ai1_1); - if (Main.netMode != 1) - { - int num124 = (int) ((double) this.ai[1] % (double) num122); - for (int playerIndex = 0; playerIndex < (int) byte.MaxValue; ++playerIndex) - { - if (this.AI_120_HallowBoss_CanShootExtraAt(playerIndex, num124 % 3, 3, 2400f)) - Projectile.NewProjectile(this.Center + vector2_43, velocity, 873, Damage3, 0.0f, Main.myPlayer, (float) playerIndex, ai1_1); - } - } - } - ++this.ai[1]; - if ((double) this.ai[1] >= 60.0 + (double) num121) - { - this.ai[0] = 1f; - this.ai[1] = 0.0f; - this.netUpdate = true; - break; - } - break; - case 13: - Vector2 vector2_44 = new Vector2(-55f, -30f); - if ((double) this.ai[1] == 0.0) - { - SoundEngine.PlaySound(SoundID.Item165, this.Center); - this.velocity = new Vector2(0.0f, -7f); - } - this.velocity = this.velocity * 0.95f; - this.TargetClosest(); - NPCAimedTarget targetData9 = this.GetTargetData(); - flag5 = false; - bool flag9 = false; - bool flag10 = false; - if (!flag9) - { - if (this.AI_120_HallowBoss_IsGenuinelyEnraged()) - { - if (!Main.dayTime) - flag10 = true; - if (Main.dayTime && Main.time >= 53400.0) - flag10 = true; - } - flag9 |= flag10; - } - if (!flag9) - { - bool flag11 = targetData9.Invalid || (double) this.Distance(targetData9.Center) > (double) num3; - flag9 |= flag11; - } - this.alpha = Utils.Clamp(this.alpha + flag9.ToDirectionInt() * 5, 0, (int) byte.MaxValue); - bool flag12 = this.alpha == 0 || this.alpha == (int) byte.MaxValue; - int num125 = 5; - for (int index = 0; index < num125; ++index) - { - float num126 = MathHelper.Lerp(1.3f, 0.7f, this.Opacity); - int dustIndex = Dust.NewDust(this.position - this.Size * 0.5f, this.width * 2, this.height * 2, 267, newColor: Main.hslToRgb(Main.rand.NextFloat(), 1f, 0.5f)); - Main.dust[dustIndex].position = this.Center + Main.rand.NextVector2Circular((float) this.width, (float) this.height); - Main.dust[dustIndex].velocity *= Main.rand.NextFloat() * 0.8f; - Main.dust[dustIndex].noGravity = true; - Main.dust[dustIndex].scale = (float) (0.899999976158142 + (double) Main.rand.NextFloat() * 1.20000004768372); - Main.dust[dustIndex].fadeIn = (float) (0.400000005960464 + (double) Main.rand.NextFloat() * 1.20000004768372 * (double) num126); - Main.dust[dustIndex].velocity += Vector2.UnitY * -2f; - Main.dust[dustIndex].scale = 0.35f; - if (dustIndex != 6000) - { - Dust dust = Dust.CloneDust(dustIndex); - dust.scale /= 2f; - dust.fadeIn *= 0.85f; - dust.color = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); - } - } - ++this.ai[1]; - if ((double) this.ai[1] >= 20.0 & flag12) - { - if (this.alpha == (int) byte.MaxValue) - { - this.active = false; - if (Main.netMode == 1) - return; - NetMessage.SendData(23, number: this.whoAmI); - return; - } - this.ai[0] = 1f; - this.ai[1] = 0.0f; - this.netUpdate = true; - break; - } - break; - } - this.dontTakeDamage = !flag6; - this.damage = this.GetAttackDamage_ScaledByStrength((float) this.defDamage * num14); - if (flag4) - this.damage = 9999; - this.defense = !flag1 ? this.defDefense : (int) ((double) this.defDefense * 1.20000004768372); - if ((double) ++this.localAI[0] >= 44.0) - this.localAI[0] = 0.0f; - if (flag5) - this.alpha = Utils.Clamp(this.alpha - 5, 0, (int) byte.MaxValue); - Lighting.AddLight(this.Center, Vector3.One * this.Opacity); - } - - private static void AI_120_HallowBoss_DeprecatedShot( - ref NPCAimedTarget targetData, - float stormsCount, - int stormIndexInSeries, - ref Vector2 offsetDirection, - float distance) - { - int num = 1; - Vector2 position1 = offsetDirection * distance * (float) num * new Vector2(3f, 1f) - targetData.Velocity * 90f + targetData.Center; - Vector2 vector2_1 = position1 - targetData.Center; - if ((double) Vector2.Dot(targetData.Velocity.SafeNormalize(Vector2.Zero), vector2_1.SafeNormalize(Vector2.Zero)) > 0.970000028610229) - { - Vector2 vector2_2 = vector2_1.RotatedBy(0.785398185253143 * (double) (Main.rand.Next(2) * 2 - 1)); - position1 = targetData.Center + vector2_2; - } - Vector2 position2 = position1; - Vector2 velocity = (targetData.Center - position2) / 90f; - Projectile.NewProjectile(position2, velocity, 871, 1, 0.0f, Main.myPlayer); - if (stormIndexInSeries == 0) - position1 = position2; - Projectile.NewProjectile(position1, Vector2.Zero, 871, 1, 0.0f, Main.myPlayer, ai1: ((float) stormIndexInSeries * (1f / stormsCount))); - } - - private bool AI_120_HallowBoss_CanShootExtraAt( - int playerIndex, - int rotationIndexToAttack, - int rotationSize, - float attackScanDistance) - { - if (playerIndex == this.target || playerIndex % rotationSize != rotationIndexToAttack) - return false; - Player player = Main.player[playerIndex]; - return player.active && !player.dead && this.playerInteraction[playerIndex] && (double) this.Distance(player.Center) <= (double) attackScanDistance; - } - - private void AI_119_Dandelion() - { - this.TargetClosest(); - Player player = Main.player[this.target]; - float windSpeedCurrent = Main.windSpeedCurrent; - float num1 = player.Center.X - this.Center.X; - float num2 = Math.Abs(num1); - float num3 = Math.Abs(player.Center.Y - this.Center.Y); - if (!Main.IsItAHappyWindyDay && this.timeLeft > 10) - this.timeLeft = 10; - bool flag = player.active && !player.dead && (double) num3 < 100.0 && (double) num2 < 600.0 && ((double) num1 > 0.0 && (double) windSpeedCurrent > 0.0 || (double) num1 < 0.0 && (double) windSpeedCurrent < 0.0); - if ((double) this.ai[0] == 1.0) - { - this.localAI[0] = 0.0f; - if ((double) num2 < 500.0) - this.localAI[0] = 1f; - if (Main.netMode == 1) - return; - if (!flag) - { - this.ai[0] = 0.0f; - this.netUpdate = true; - } - else - { - if ((double) this.localAI[0] != 1.0) - return; - ++this.localAI[1]; - if ((double) this.localAI[1] > 80.0) - { - this.ai[0] = 0.0f; - this.netUpdate = true; - } - else - { - if ((double) this.localAI[1] != 40.0) - return; - for (int index = 0; index < 1 + Main.rand.Next(3); ++index) - { - int num4 = -1; - if ((double) num1 > 0.0) - num4 = 1; - Vector2 velocity = new Vector2(2f * (float) num4, -2f); - Vector2 vector2 = new Vector2((float) (num4 * Main.rand.Next(-2, 10)), (float) (10 + Main.rand.Next(-6, 6))); - velocity += vector2 * 0.25f; - Vector2 position = this.Center + vector2; - position.X += (float) (num4 * 6); - if ((double) velocity.Y > 0.0) - velocity.Y *= -1f; - Projectile.NewProjectile(position, velocity, 836, this.damage / 2, 1f, ai0: ((float) this.target)); - } - this.netUpdate = true; - } - } - } - else - { - if ((double) this.ai[0] != 0.0) - return; - this.localAI[0] = 0.0f; - this.localAI[1] = 0.0f; - if (!(Main.netMode != 1 & flag)) - return; - this.ai[0] = 1f; - this.netUpdate = true; - } - } - - private void AI_118_Seahorses() - { - this.noGravity = this.wet; - float waterLineHeight; - Collision.GetWaterLineIterate(this.Center.ToTileCoordinates(), out waterLineHeight); - bool flag1 = (double) waterLineHeight > 0.0 && (double) this.Top.Y - (double) waterLineHeight < 20.0; - if (!this.wet) - { - if ((double) this.velocity.Y == 0.0) - this.velocity.X *= 0.95f; - this.rotation += (float) (((double) this.velocity.X + (double) this.velocity.Y) / 2.0 * 0.0500000007450581); - } - else - { - --this.ai[1]; - if ((double) this.ai[1] <= 0.0) - { - this.velocity = this.velocity + this.ai[0].ToRotationVector2() * 0.06f; - float num = this.velocity.Length(); - if ((double) num > 3.0 || (double) num < -3.0) - { - this.velocity.X = Math.Min(3f, Math.Max(-3f, this.velocity.X)); - this.ai[1] = (float) Main.rand.Next(450, 600); - this.ai[0] = Main.rand.NextFloat() * 6.283185f; - if (flag1 && (double) this.ai[0] > 3.14159274101257) - this.ai[0] -= 3.141593f; - this.netUpdate = true; - } - } - else - this.velocity = this.velocity * 0.95f; - this.rotation = this.velocity.X * 0.1f; - } - bool flag2 = this.collideY && this.wet && (!flag1 || (double) this.velocity.Y < 0.0); - if (!(this.collideX | flag2)) - return; - Vector2 rotationVector2 = this.ai[0].ToRotationVector2(); - if (this.collideX) - rotationVector2.X *= -1f; - if (flag2) - rotationVector2.Y *= -1f; - this.ai[0] = rotationVector2.ToRotation(); - this.velocity = this.ai[0].ToRotationVector2() * this.velocity.Length(); - this.netUpdate = true; - } - - private void AI_117_BloodNautilus() - { - float moveSpeed = 0.15f; - float num1 = 7.5f; - float num2 = 60f; - float num3 = 90f; - float num4 = 180f; - float num5 = 90f; - float num6 = 90f; - int num7 = 3; - float num8 = 180f; - bool flag = false; - if ((double) this.localAI[0] == 0.0) - { - this.localAI[0] = 1f; - this.alpha = (int) byte.MaxValue; - if (Main.netMode != 1) - { - this.ai[0] = -1f; - this.netUpdate = true; - } - } - if ((double) this.ai[0] != -1.0 && Main.rand.Next(4) == 0) - { - this.position = this.position + this.netOffset; - Dust dust = Dust.NewDustDirect(this.position + new Vector2(5f), this.width - 10, this.height - 10, 5); - dust.velocity *= 0.5f; - if ((double) dust.velocity.Y < 0.0) - dust.velocity.Y *= -1f; - dust.alpha = 120; - dust.scale = (float) (1.0 + (double) Main.rand.NextFloat() * 0.400000005960464); - dust.velocity += this.velocity * 0.3f; - this.position = this.position - this.netOffset; - } - if (this.target == (int) byte.MaxValue) - { - this.TargetClosest(); - this.ai[2] = (float) this.direction; - } - if (Main.player[this.target].dead || (double) Vector2.Distance(Main.player[this.target].Center, this.Center) > 2000.0) - this.TargetClosest(); - NPCAimedTarget npcAimedTarget = this.GetTargetData(); - if (Main.dayTime || !Main.bloodMoon) - npcAimedTarget = new NPCAimedTarget(); - int num9 = -1; - switch (this.ai[0]) - { - case -1f: - this.velocity = this.velocity * 0.98f; - int num10 = Math.Sign(npcAimedTarget.Center.X - this.Center.X); - if (num10 != 0) - { - this.direction = num10; - this.spriteDirection = -this.direction; - } - if ((double) this.localAI[1] == 0.0 && this.alpha < 100) - { - this.localAI[1] = 1f; - int num11 = 36; - for (int index1 = 0; index1 < num11; ++index1) - { - this.position = this.position + this.netOffset; - Vector2 vector2_1 = (Vector2.Normalize(this.velocity) * new Vector2((float) this.width / 2f, (float) this.height) * 0.75f * 0.5f).RotatedBy((double) (index1 - (num11 / 2 - 1)) * 6.28318548202515 / (double) num11) + this.Center; - Vector2 vector2_2 = vector2_1 - this.Center; - int index2 = Dust.NewDust(vector2_1 + vector2_2, 0, 0, 5, vector2_2.X * 2f, vector2_2.Y * 2f, 100, Scale: 1.4f); - Main.dust[index2].noGravity = true; - Main.dust[index2].velocity = Vector2.Normalize(vector2_2) * 3f; - this.position = this.position - this.netOffset; - } - } - if ((double) this.ai[2] > 5.0) - { - this.velocity.Y = -2.5f; - this.alpha -= 10; - if (Collision.SolidCollision(this.position, this.width, this.height)) - { - this.alpha += 15; - if (this.alpha > 150) - this.alpha = 150; - } - if (this.alpha < 0) - this.alpha = 0; - } - ++this.ai[2]; - if ((double) this.ai[2] >= 50.0) - { - this.ai[0] = 0.0f; - this.ai[1] = 0.0f; - this.ai[2] = 0.0f; - this.ai[3] = 0.0f; - this.netUpdate = true; - break; - } - break; - case 0.0f: - Vector2 vector2_3 = npcAimedTarget.Center + new Vector2((float) (-(double) this.ai[2] * 300.0), -200f); - if ((double) this.Center.Distance(vector2_3) > 50.0) - this.SimpleFlyMovement(this.DirectionTo(vector2_3) * num1, moveSpeed); - this.direction = (double) this.Center.X < (double) npcAimedTarget.Center.X ? 1 : -1; - float targetAngle1 = this.Center.DirectionTo(npcAimedTarget.Center).ToRotation() - 0.4712389f * (float) this.spriteDirection; - if (this.spriteDirection == -1) - targetAngle1 += 3.141593f; - if (this.spriteDirection != this.direction) - { - this.spriteDirection = this.direction; - this.rotation = -this.rotation; - targetAngle1 = -targetAngle1; - } - this.rotation = this.rotation.AngleTowards(targetAngle1, 0.02f); - ++this.ai[1]; - if ((double) this.ai[1] > (double) num2) - { - int num12 = (int) this.ai[3]; - if (num12 % 7 == 3) - { - num9 = 3; - break; - } - if (num12 % 2 == 0) - { - SoundEngine.PlaySound(SoundID.Item170, this.Center); - num9 = 2; - break; - } - SoundEngine.PlaySound(SoundID.Item170, this.Center); - num9 = 1; - break; - } - break; - case 1f: - this.direction = (double) this.Center.X < (double) npcAimedTarget.Center.X ? -1 : 1; - float targetAngle2 = this.Center.DirectionFrom(npcAimedTarget.Center).ToRotation() - 0.4712389f * (float) this.spriteDirection; - if (this.spriteDirection == -1) - targetAngle2 += 3.141593f; - if (this.spriteDirection != this.direction & (double) this.ai[1] < (double) num3) - { - this.spriteDirection = this.direction; - this.rotation = -this.rotation; - targetAngle2 = -targetAngle2; - } - if ((double) this.ai[1] < (double) num3) - { - if ((double) this.ai[1] == (double) num3 - 1.0) - SoundEngine.PlaySound(SoundID.Item172, this.Center); - flag = true; - this.velocity = this.velocity * 0.95f; - this.rotation = this.rotation.AngleLerp(targetAngle2, 0.02f); - this.position = this.position + this.netOffset; - Vector2 mouthPosition; - Vector2 mouthDirection; - this.BloodNautilus_GetMouthPositionAndRotation(out mouthPosition, out mouthDirection); - Dust dust1 = Dust.NewDustDirect(mouthPosition + mouthDirection * 60f - new Vector2(40f), 80, 80, 16, Alpha: 150, newColor: Color.Transparent, Scale: 0.6f); - dust1.fadeIn = 1f; - dust1.velocity = dust1.position.DirectionTo(mouthPosition + Main.rand.NextVector2Circular(15f, 15f)) * dust1.velocity.Length(); - dust1.noGravity = true; - Dust dust2 = Dust.NewDustDirect(mouthPosition + mouthDirection * 100f - new Vector2(30f), 60, 60, 16, Alpha: 100, newColor: Color.Transparent, Scale: 0.9f); - dust2.fadeIn = 1.5f; - dust2.velocity = dust2.position.DirectionTo(mouthPosition + Main.rand.NextVector2Circular(15f, 15f)) * (dust2.velocity.Length() + 5f); - dust2.noGravity = true; - this.position = this.position - this.netOffset; - } - else if ((double) this.ai[1] < (double) num3 + (double) num4) - { - this.position = this.position + this.netOffset; - this.rotation = this.rotation.AngleLerp(targetAngle2, 0.07f); - Vector2 mouthPosition; - Vector2 mouthDirection; - this.BloodNautilus_GetMouthPositionAndRotation(out mouthPosition, out mouthDirection); - if ((double) this.Center.Distance(npcAimedTarget.Center) > 30.0) - this.velocity = mouthDirection * -16f + this.Center.DirectionTo(npcAimedTarget.Center) * 2f; - for (int index = 0; index < 4; ++index) - { - Dust dust3 = Dust.NewDustDirect(mouthPosition + mouthDirection * 60f - new Vector2(15f), 30, 30, 5, newColor: Color.Transparent, Scale: 1.5f); - dust3.velocity = dust3.position.DirectionFrom(mouthPosition + Main.rand.NextVector2Circular(5f, 5f)) * dust3.velocity.Length(); - dust3.position -= mouthDirection * 60f; - Dust dust4 = Dust.NewDustDirect(mouthPosition + mouthDirection * 100f - new Vector2(20f), 40, 40, 5, Alpha: 100, newColor: Color.Transparent, Scale: 1.5f); - dust4.velocity = dust4.position.DirectionFrom(mouthPosition + Main.rand.NextVector2Circular(10f, 10f)) * (dust4.velocity.Length() + 5f); - dust4.position -= mouthDirection * 100f; - } - this.position = this.position - this.netOffset; - } - ++this.ai[1]; - if ((double) this.ai[1] >= (double) num3 + (double) num4) - { - num9 = 0; - break; - } - break; - case 2f: - this.direction = (double) this.Center.X < (double) npcAimedTarget.Center.X ? 1 : -1; - float targetAngle3 = this.Center.DirectionTo(npcAimedTarget.Center).ToRotation() - 0.4712389f * (float) this.spriteDirection; - if (this.spriteDirection == -1) - targetAngle3 += 3.141593f; - if (this.spriteDirection != this.direction) - { - this.spriteDirection = this.direction; - this.rotation = -this.rotation; - targetAngle3 = -targetAngle3; - } - this.rotation = this.rotation.AngleLerp(targetAngle3, 0.2f); - if ((double) this.ai[1] < (double) num5) - { - this.position = this.position + this.netOffset; - this.velocity = this.velocity * 0.95f; - Vector2 mouthPosition; - Vector2 mouthDirection; - this.BloodNautilus_GetMouthPositionAndRotation(out mouthPosition, out mouthDirection); - if (Main.rand.Next(4) != 0) - { - Dust dust5 = Dust.NewDustDirect(mouthPosition + mouthDirection * 60f - new Vector2(60f), 120, 120, 16, Alpha: 150, newColor: Color.Transparent, Scale: 0.6f); - dust5.fadeIn = 1f; - dust5.velocity = dust5.position.DirectionTo(mouthPosition + Main.rand.NextVector2Circular(15f, 15f)) * (dust5.velocity.Length() + 3f); - dust5.noGravity = true; - Dust dust6 = Dust.NewDustDirect(mouthPosition + mouthDirection * 100f - new Vector2(80f), 160, 160, 16, Alpha: 100, newColor: Color.Transparent, Scale: 0.9f); - dust6.fadeIn = 1.5f; - dust6.velocity = dust6.position.DirectionTo(mouthPosition + Main.rand.NextVector2Circular(15f, 15f)) * (dust6.velocity.Length() + 5f); - dust6.noGravity = true; - } - this.position = this.position - this.netOffset; - } - else if ((double) this.ai[1] < (double) num5 + (double) num6) - { - this.position = this.position + this.netOffset; - this.velocity = this.velocity * 0.9f; - float num13 = (float) (((double) this.ai[1] - (double) num5) % ((double) num6 / (double) num7)); - Vector2 mouthPosition; - Vector2 mouthDirection; - this.BloodNautilus_GetMouthPositionAndRotation(out mouthPosition, out mouthDirection); - if ((double) num13 < (double) num6 / (double) num7 * 0.800000011920929) - { - for (int index = 0; index < 5; ++index) - { - Dust dust7 = Dust.NewDustDirect(mouthPosition + mouthDirection * 50f - new Vector2(15f), 30, 30, 5, newColor: Color.Transparent, Scale: 1.5f); - dust7.velocity = dust7.position.DirectionFrom(mouthPosition + Main.rand.NextVector2Circular(5f, 5f)) * dust7.velocity.Length(); - dust7.position -= mouthDirection * 60f; - Dust dust8 = Dust.NewDustDirect(mouthPosition + mouthDirection * 90f - new Vector2(20f), 40, 40, 5, Alpha: 100, newColor: Color.Transparent, Scale: 1.5f); - dust8.velocity = dust8.position.DirectionFrom(mouthPosition + Main.rand.NextVector2Circular(10f, 10f)) * (dust8.velocity.Length() + 5f); - dust8.position -= mouthDirection * 100f; - } - } - if ((int) num13 == 0) - { - this.velocity = this.velocity + mouthDirection * -8f; - for (int index = 0; index < 20; ++index) - { - Dust dust9 = Dust.NewDustDirect(mouthPosition + mouthDirection * 60f - new Vector2(15f), 30, 30, 5, newColor: Color.Transparent, Scale: 1.5f); - dust9.velocity = dust9.position.DirectionFrom(mouthPosition + Main.rand.NextVector2Circular(5f, 5f)) * dust9.velocity.Length(); - dust9.position -= mouthDirection * 60f; - Dust dust10 = Dust.NewDustDirect(mouthPosition + mouthDirection * 100f - new Vector2(20f), 40, 40, 5, Alpha: 100, newColor: Color.Transparent, Scale: 1.5f); - dust10.velocity = dust10.position.DirectionFrom(mouthPosition + Main.rand.NextVector2Circular(10f, 10f)) * (dust10.velocity.Length() + 5f); - dust10.position -= mouthDirection * 100f; - } - if (Main.netMode != 1) - { - int num14 = Main.rand.Next(5, 11); - Vector2 vector2_4 = mouthDirection * 10f; - int damageForProjectiles = this.GetAttackDamage_ForProjectiles(30f, 25f); - for (int index = 0; index < num14; ++index) - { - Vector2 velocity = vector2_4 + Main.rand.NextVector2Square(-6f, 6f); - Projectile.NewProjectile(mouthPosition - mouthDirection * 5f, velocity, 814, damageForProjectiles, 0.0f, Main.myPlayer); - } - } - } - this.position = this.position - this.netOffset; - } - ++this.ai[1]; - if ((double) this.ai[1] >= (double) num5 + (double) num6) - { - num9 = 0; - break; - } - break; - case 3f: - this.direction = (double) this.Center.X < (double) npcAimedTarget.Center.X ? 1 : -1; - float targetAngle4 = 0.0f; - this.spriteDirection = this.direction; - if ((double) this.ai[1] < (double) num8) - { - this.position = this.position + this.netOffset; - this.velocity = Vector2.Lerp(this.velocity, new Vector2(0.0f, MathHelper.Clamp((float) (1.0 - (double) this.ai[1] / (double) num8 * 1.5), 0.0f, 1f) * -1.5f), 0.03f); - this.velocity = Vector2.Zero; - this.rotation = this.rotation.AngleLerp(targetAngle4, 0.02f); - this.BloodNautilus_GetMouthPositionAndRotation(out Vector2 _, out Vector2 _); - float t = this.ai[1] / num8; - Lighting.AddLight(this.Center, new Vector3(1f, 0.5f, 0.5f) * (Utils.GetLerpValue(0.0f, 0.5f, t, false) * Utils.GetLerpValue(1f, 0.5f, t, false))); - if (Main.rand.Next(3) != 0) - { - Dust dust = Dust.NewDustDirect(this.Center - new Vector2(6f), 12, 12, 5, Alpha: 60, newColor: Color.Transparent, Scale: 1.4f); - dust.position += new Vector2((float) (this.spriteDirection * 12), 12f); - dust.velocity *= 0.1f; - } - this.position = this.position - this.netOffset; - } - if ((double) this.ai[1] == 10.0 || (double) this.ai[1] == 20.0 || (double) this.ai[1] == 30.0) - this.BloodNautilus_CallForHelp(); - ++this.ai[1]; - if ((double) this.ai[1] >= (double) num8) - { - num9 = 0; - break; - } - break; - } - if (num9 != -1) - { - this.ai[0] = (float) num9; - this.ai[1] = 0.0f; - this.ai[2] = 0.0f; - this.netUpdate = true; - this.TargetClosest(); - if (num9 == 0) - this.ai[2] = (float) this.direction; - else - ++this.ai[3]; - } - this.reflectsProjectiles = flag; - } - - private void BloodNautilus_CallForHelp() - { - if (Main.netMode == 1 || !Main.player[this.target].active || Main.player[this.target].dead || (double) this.Distance(Main.player[this.target].Center) > 2000.0 || NPC.CountNPCS(619) >= 3) - return; - Point tileCoordinates = this.Center.ToTileCoordinates(); - Point point = tileCoordinates; - int num1 = 20; - int num2 = 3; - int num3 = 8; - int num4 = 2; - int num5 = 0; - bool flag1 = false; - while (!flag1 && num5 < 100) - { - ++num5; - int index1 = Main.rand.Next(point.X - num1, point.X + num1 + 1); - int index2 = Main.rand.Next(point.Y - num1, point.Y + num1 + 1); - if ((index2 < point.Y - num3 || index2 > point.Y + num3 || index1 < point.X - num3 || index1 > point.X + num3) && (index2 < tileCoordinates.Y - num2 || index2 > tileCoordinates.Y + num2 || index1 < tileCoordinates.X - num2 || index1 > tileCoordinates.X + num2) && !Main.tile[index1, index2].nactive()) - { - bool flag2 = true; - if (flag2 && Main.tile[index1, index2].lava()) - flag2 = false; - if (flag2 && Collision.SolidTiles(index1 - num4, index1 + num4, index2 - num4, index2 + num4)) - flag2 = false; - if (flag2 && !Collision.CanHitLine(this.Center, 0, 0, Main.player[this.target].Center, 0, 0)) - flag2 = false; - if (flag2) - { - Projectile.NewProjectile((float) (index1 * 16 + 8), (float) (index2 * 16 + 8), 0.0f, 0.0f, 813, 0, 0.0f, Main.myPlayer); - break; - } - } - } - } - - public static bool TooWindyForButterflies => (double) Math.Abs(Main.windSpeedTarget) >= 0.400000005960464; - - private void AI_116_WaterStriders() - { - bool flag1 = false; - float waterLineHeight; - if (Collision.GetWaterLine(this.Center.ToTileCoordinates(), out waterLineHeight)) - { - float num = this.Bottom.Y - 1f; - if ((double) this.Center.Y > (double) waterLineHeight) - { - this.velocity.Y -= 0.8f; - if ((double) this.velocity.Y < -4.0) - this.velocity.Y = -4f; - if ((double) num + (double) this.velocity.Y < (double) waterLineHeight) - this.velocity.Y = waterLineHeight - num; - } - else - { - this.velocity.Y = MathHelper.Min(this.velocity.Y, waterLineHeight - num); - flag1 = true; - } - } - else if (this.wet) - this.velocity.Y -= 0.2f; - if ((int) this.ai[0] != 0) - return; - ++this.ai[1]; - this.velocity.X *= 0.9f; - if ((double) this.velocity.Y == 0.0) - this.velocity.X *= 0.6f; - bool flag2 = this.wet | flag1; - bool flag3 = flag2 || (double) this.velocity.Y == 0.0; - int num1 = Main.rand.Next(120, 241); - if (!flag2) - num1 = Main.rand.Next(60, 241); - if (!flag3 || (double) this.ai[1] < (double) num1) - return; - this.ai[1] = 0.0f; - this.velocity.X = Main.rand.NextFloatDirection() * 5f; - this.netUpdate = true; - if (flag2) - return; - if ((double) this.velocity.Y == 0.0) - this.velocity.Y = -2f; - this.ai[1] = 60f; - } - - private void AI_115_LadyBugs() - { - if (Main.netMode != 1) - { - if ((double) this.ai[1] == 0.0) - { - this.ai[1] = (float) ((double) Main.rand.NextFloat() * 0.200000002980232 + 0.699999988079071); - this.netUpdate = true; - } - if ((double) --this.localAI[0] <= 0.0) - { - this.localAI[0] = (float) Main.rand.Next(60, 181); - if (Main.rand.Next(5) == 0) - { - if ((double) this.ai[2] == 0.0) - { - this.ai[2] = 1f; - this.ai[0] = 0.0f; - this.netUpdate = true; - } - else if ((double) this.ai[2] == 1.0) - { - this.TargetClosest(); - this.ai[2] = 0.0f; - this.ai[0] = Main.rand.NextFloat() * 6.283185f; - if ((double) this.Distance(Main.player[this.target].Center) > 700.0) - this.ai[0] = this.AngleTo(Main.player[this.target].Center) + Main.rand.NextFloatDirection() * 0.3f; - this.netUpdate = true; - } - } - this.TargetClosest(); - this.ai[0] = Main.rand.NextFloat() * 6.283185f; - if ((double) this.Distance(Main.player[this.target].Center) > 700.0) - this.ai[0] = this.AngleTo(Main.player[this.target].Center) + Main.rand.NextFloatDirection() * 0.3f; - this.netUpdate = true; - } - } - this.scale = this.ai[1]; - if ((double) this.ai[2] == 0.0) - { - Vector2 vector2 = this.ai[0].ToRotationVector2() * 1f; - vector2.X += Main.windSpeedTarget * 0.8f; - this.velocity = Vector2.Lerp(this.velocity, vector2, 0.0125f); - if ((double) this.velocity.Y > 0.0) - { - int num1 = 4; - int index1 = (int) this.Center.X / 16; - int num2 = (int) this.Center.Y / 16; - for (int index2 = num2; index2 < num2 + num1; ++index2) - { - if (Main.tile[index1, index2] != null && (Main.tile[index1, index2].nactive() && Main.tileSolid[(int) Main.tile[index1, index2].type] || Main.tile[index1, index2].liquid > (byte) 0)) - { - this.ai[0] = -this.ai[0]; - if ((double) this.velocity.Y > 0.0) - this.velocity.Y *= 0.9f; - } - } - } - if ((double) this.velocity.Y < 0.0) - { - int num3 = 30; - bool flag = false; - int index3 = (int) this.Center.X / 16; - int num4 = (int) this.Center.Y / 16; - for (int index4 = num4; index4 < num4 + num3; ++index4) - { - if (Main.tile[index3, index4] != null && (Main.tile[index3, index4].nactive() && Main.tileSolid[(int) Main.tile[index3, index4].type] || Main.tile[index3, index4].liquid > (byte) 0)) - flag = true; - } - if (!flag) - { - this.ai[0] = -this.ai[0]; - if ((double) this.velocity.Y < 0.0) - this.velocity.Y *= 0.9f; - } - } - if (this.collideX) - { - this.ai[0] = (float) (-(double) this.ai[0] + 3.14159274101257); - this.velocity.X *= -0.2f; - } - } - else - { - if ((double) this.velocity.Y > 0.0) - { - int num5 = 4; - int index5 = (int) this.Center.X / 16 + this.direction; - int num6 = (int) this.Center.Y / 16; - for (int index6 = num6; index6 < num6 + num5; ++index6) - { - if (Main.tile[index5, index6] != null && Main.tile[index5, index6].liquid > (byte) 0) - { - this.TargetClosest(); - this.velocity.Y = -1f; - this.ai[2] = 0.0f; - this.ai[0] = (float) ((double) Main.rand.NextFloat() * 0.785398185253143 - 1.57079637050629); - if ((double) this.Distance(Main.player[this.target].Center) > 700.0) - this.ai[0] = this.AngleTo(Main.player[this.target].Center) + Main.rand.NextFloatDirection() * 0.3f; - this.netUpdate = true; - return; - } - } - } - if ((double) this.velocity.Y != 0.0) - { - this.velocity.X *= 0.98f; - this.velocity.Y = MathHelper.Lerp(this.velocity.Y, 2f, 0.005f); - } - else - { - this.velocity = Vector2.Lerp(this.velocity, Vector2.UnitX * (float) this.direction, 0.05f); - this.velocity.Y += 0.2f; - if (this.collideX) - { - this.direction *= -1; - this.velocity.X *= -0.2f; - this.netUpdate = true; - } - } - } - this.direction = (double) this.velocity.X > 0.0 ? 1 : -1; - } - - private void AI_114_Dragonflies() - { - if ((double) this.localAI[0] == 0.0 && Main.netMode != 1) - { - this.localAI[0] = 1f; - Vector2 center = this.Center; - this.ai[2] = center.X; - this.ai[3] = center.Y; - this.velocity = (Main.rand.NextVector2Circular(5f, 3f) + Main.rand.NextVector2CircularEdge(5f, 3f)) * 0.4f; - this.ai[1] = 0.0f; - this.ai[0] = 1f; - this.netUpdate = true; - } - switch ((int) this.ai[0]) - { - case 0: - this.velocity = this.velocity * 0.94f; - if (Main.netMode != 1 && (double) ++this.ai[1] >= (double) (60 + Main.rand.Next(60))) - { - Vector2 vector2 = new Vector2(this.ai[2], this.ai[3]); - if ((double) this.Distance(vector2) > 96.0) - this.velocity = this.DirectionTo(vector2) * 3f; - else if ((double) this.Distance(vector2) > 16.0) - this.velocity = this.DirectionTo(vector2) * 1f + Main.rand.NextVector2Circular(1f, 0.5f); - else - this.velocity = (Main.rand.NextVector2Circular(5f, 3f) + Main.rand.NextVector2CircularEdge(5f, 3f)) * 0.4f; - this.ai[1] = 0.0f; - this.ai[0] = 1f; - this.netUpdate = true; - break; - } - break; - case 1: - int num1 = 4; - if ((double) this.Distance(new Vector2(this.ai[2], this.ai[3])) > 112.0) - num1 = 200; - if ((double) ++this.ai[1] >= (double) num1) - { - this.ai[1] = 0.0f; - this.ai[0] = 0.0f; - this.netUpdate = true; - } - int index1 = (int) this.Center.X / 16; - int num2 = (int) this.Center.Y / 16; - int num3 = 3; - for (int index2 = num2; index2 < num2 + num3; ++index2) - { - if (Main.tile[index1, index2] != null && (Main.tile[index1, index2].nactive() && Main.tileSolid[(int) Main.tile[index1, index2].type] || Main.tile[index1, index2].liquid > (byte) 0)) - { - if ((double) this.velocity.Y > 0.0) - this.velocity.Y *= 0.9f; - this.velocity.Y -= 0.2f; - } - } - if ((double) this.velocity.Y < 0.0) - { - int num4 = 30; - bool flag = false; - for (int index3 = num2; index3 < num2 + num4; ++index3) - { - if (Main.tile[index1, index3] != null && Main.tile[index1, index3].nactive() && Main.tileSolid[(int) Main.tile[index1, index3].type]) - { - flag = true; - break; - } - } - if (!flag && (double) this.velocity.Y < 0.0) - { - this.velocity.Y *= 0.9f; - break; - } - break; - } - break; - } - if ((double) this.velocity.X != 0.0) - this.direction = (double) this.velocity.X > 0.0 ? 1 : -1; - if (this.wet) - this.velocity.Y = -3f; - if ((double) this.localAI[1] > 0.0) - { - --this.localAI[1]; - } - else - { - this.localAI[1] = 15f; - float num5 = 0.0f; - Vector2 zero = Vector2.Zero; - for (int index4 = 0; index4 < 200; ++index4) - { - NPC npc = Main.npc[index4]; - if (npc.active && npc.damage > 0 && !npc.friendly && (double) npc.Hitbox.Distance(this.Center) <= 100.0) - { - ++num5; - zero += this.DirectionFrom(npc.Center); - } - } - for (int index5 = 0; index5 < (int) byte.MaxValue; ++index5) - { - Player player = Main.player[index5]; - if (player.active && (double) player.Hitbox.Distance(this.Center) <= 150.0) - { - ++num5; - zero += this.DirectionFrom(player.Center); - } - } - if ((double) num5 > 0.0) - { - float num6 = 2f; - Vector2 vector2_1 = zero / num5 * num6; - this.velocity = this.velocity + vector2_1; - if ((double) this.velocity.Length() > 16.0) - this.velocity = this.velocity.SafeNormalize(Vector2.Zero) * 16f; - Vector2 vector2_2 = this.Center + vector2_1 * 10f; - this.ai[1] = -10f; - this.ai[0] = 1f; - this.ai[2] = vector2_2.X; - this.ai[3] = vector2_2.Y; - this.netUpdate = true; - } - else - { - if (Main.netMode == 1 || (double) (new Vector2(this.ai[2], this.ai[3]) - this.Center).Length() >= 16.0) - return; - int maxValue = 30; - if (Main.tile[(int) this.ai[2] / 16, (int) this.ai[3] / 16].type != (ushort) 519) - maxValue = 4; - if (Main.rand.Next(maxValue) != 0) - return; - int cattailX = (int) this.ai[2]; - int cattailY = (int) this.ai[2]; - if (NPC.FindCattailTop((int) this.ai[2] / 16, (int) this.ai[3] / 16, out cattailX, out cattailY)) - { - this.ai[2] = (float) (cattailX * 16); - this.ai[3] = (float) (cattailY * 16); - this.netUpdate = true; - } - else - { - int i = (int) ((double) this.Center.X / 16.0); - int j = (int) ((double) this.Center.Y / 16.0); - while (!WorldGen.SolidTile(i, j) && (double) j < Main.worldSurface) - ++j; - int num7 = j - Main.rand.Next(3, 6); - this.ai[2] = (float) (i * 16); - this.ai[3] = (float) (num7 * 16); - this.netUpdate = true; - } - } - } - } - - private void AI_113_WindyBalloon() - { - if ((double) this.localAI[0] == 0.0 && Main.netMode != 1) - { - this.TargetClosest(); - this.localAI[0] = 1f; - this.ai[2] = (float) (Main.rand.Next(7) + 1); - int index = NPC.NewNPC((int) this.position.X, (int) this.position.Y, 1); - if (Main.rand.Next(180) == 0) - Main.npc[index].SetDefaults(-4); - else if (Main.rand.Next(10) == 0) - Main.npc[index].SetDefaults(-7); - else if (Main.rand.Next(3) == 0) - Main.npc[index].SetDefaults(-3); - Main.npc[index].ai[0] = -999f; - Main.npc[index].netUpdate = true; - this.ai[3] = (float) index; - this.netUpdate = true; - this.ai[1] = Main.npc[index].scale; - } - this.position = this.Center; - this.Size = new Vector2(20f, 20f) * this.ai[1]; - this.scale = this.ai[1]; - this.Center = this.position; - NPC slaveNpc = this.AI_113_WindyBalloon_GetSlaveNPC(); - this.rotation = this.velocity.X * 0.05f; - if (slaveNpc != null) - { - NPCAimedTarget targetData = this.GetTargetData(); - float num1 = float.PositiveInfinity; - int num2 = 0; - Vector2 zero = Vector2.Zero; - if (!targetData.Invalid) - { - Vector2 vector2 = targetData.Center - this.Bottom; - if ((double) vector2.Y < 0.0) - num2 = (int) vector2.Y / -16; - num1 = vector2.Length(); - if (this.direction != Math.Sign(vector2.X)) - num2 = 0; - } - if (this.wet || slaveNpc.wet || this.collideX || this.collideY && (double) this.oldVelocity.Y < 0.0) - { - float num3 = this.oldVelocity.X + (float) (this.direction * 8); - this.position.X -= num3; - slaveNpc.position.X -= num3; - this.TargetClosest(false); - this.direction *= -1; - this.velocity.X = (float) (this.direction * 2); - this.life = -1; - this.HitEffect(); - this.active = false; - this.netUpdate = true; - SoundEngine.PlaySound(this.DeathSound, this.position); - } - else - { - if (this.collideY) - { - this.velocity.Y = (double) this.oldVelocity.Y > 0.0 ? 1f : -1f; - this.TargetClosest(false); - } - float num4 = (float) (2.0 + (double) Math.Abs(Main.windSpeedTarget) * 2.0); - if (Math.Sign(this.velocity.X) != this.direction || (double) Math.Abs(this.velocity.X) < (double) num4) - { - this.velocity.X += (float) this.direction * 0.01f; - if ((double) this.velocity.X * (double) this.direction < 0.0) - { - if ((double) Math.Abs(this.velocity.X) > (double) num4) - this.velocity.X += (float) this.direction * 0.1f; - else - this.velocity.X += (float) this.direction * 0.05f; - } - else if ((double) Math.Abs(this.velocity.X) > (double) num4) - this.velocity.X = (float) this.direction * num4; - } - int index1 = (int) (((double) this.position.X + (double) (this.width / 2)) / 16.0) + this.direction; - int num5 = (int) (((double) this.position.Y + (double) this.height) / 16.0); - bool flag1 = true; - int num6 = 8 + num2; - bool flag2 = false; - for (int index2 = num5; index2 < num5 + num6; ++index2) - { - if (Main.tile[index1, index2] == null) - Main.tile[index1, index2] = new Tile(); - if (Main.tile[index1, index2].nactive() && Main.tileSolid[(int) Main.tile[index1, index2].type] || Main.tile[index1, index2].liquid > (byte) 0) - { - if (index2 < num5 + 5 + num2) - flag2 = true; - flag1 = false; - break; - } - } - if ((double) num1 < 400.0 && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) - { - float num7 = 2f; - float num8 = 0.035f; - if ((double) this.Center.Y + (double) (this.height / 4) > (double) Main.player[this.target].position.Y + (double) (Main.player[this.target].height / 4) && (double) this.velocity.Y > -(double) num7) - { - this.velocity.Y -= num8; - if ((double) this.velocity.Y > 0.0) - this.velocity.Y -= num8; - } - else if ((double) this.Center.Y + (double) (this.height / 4) < (double) Main.player[this.target].position.Y + (double) (Main.player[this.target].height / 4) && (double) this.velocity.Y < (double) num7) - { - this.velocity.Y += num8; - if ((double) this.velocity.Y < 0.0) - this.velocity.Y += num8; - } - } - else - { - if (flag1) - this.velocity.Y += 0.05f; - else - this.velocity.Y -= 0.1f; - if (flag2) - this.velocity.Y -= 0.2f; - if ((double) this.velocity.Y > 2.0) - this.velocity.Y = 2f; - if ((double) this.velocity.Y < -4.0) - this.velocity.Y = -4f; - } - slaveNpc.Center = this.Bottom + new Vector2(0.0f, -8f) + new Vector2(0.0f, 56f * this.ai[1]); - slaveNpc.velocity = this.velocity; - } - } - else - { - this.velocity.Y = MathHelper.Clamp(this.velocity.Y - 0.2f, -8f, 8f); - this.velocity.X = MathHelper.Clamp(this.velocity.X + Main.windSpeedTarget * 0.3f, -4f, 4f); - if (!this.collideX && !this.collideY) - return; - this.position.X -= this.oldVelocity.X + (float) (this.direction * 8); - this.TargetClosest(false); - this.direction *= -1; - this.velocity.X = (float) (this.direction * 2); - this.life = -1; - this.HitEffect(); - this.active = false; - this.netUpdate = true; - SoundEngine.PlaySound(this.DeathSound, this.position); - } - } - - public NPC AI_113_WindyBalloon_GetSlaveNPC() - { - int index = (int) this.ai[3]; - NPC npc; - if (index >= 0 && index < 200) - { - npc = Main.npc[index]; - if (!npc.active || npc.type != 1 || (double) npc.ai[0] != -999.0) - { - npc = (NPC) null; - this.ai[3] = -1f; - this.netUpdate = true; - } - } - else - npc = (NPC) null; - return npc; - } - - private void AI_112_FairyCritter() - { - bool flag1 = false; - this.lavaImmune = true; - if (Main.netMode != 1 && (double) this.ai[2] > 1.0) - { - int num = 18000; - ++this.localAI[1]; - if ((double) this.localAI[1] >= (double) num) - { - this.ai[2] = 7f; - if ((double) Main.player[this.target].Center.X < (double) this.Center.X) - this.direction = 1; - else - this.direction = -1; - this.netUpdate = true; - } - } - switch ((int) this.ai[2]) - { - case 0: - this.lavaImmune = false; - this.noTileCollide = false; - if ((double) this.ai[0] == 0.0 && (double) this.ai[1] == 0.0) - { - this.ai[0] = this.Center.X; - this.ai[1] = this.Center.Y; - } - if ((double) this.localAI[0] == 0.0) - { - this.localAI[0] = 1f; - this.velocity = new Vector2(MathHelper.Lerp(2f, 4f, Main.rand.NextFloat()) * (float) (Main.rand.Next(2) * 2 - 1), MathHelper.Lerp(1f, 2f, Main.rand.NextFloat()) * (float) (Main.rand.Next(2) * 2 - 1)); - this.velocity = this.velocity * 0.7f; - this.netUpdate = true; - } - Vector2 vector2_1 = new Vector2(this.ai[0], this.ai[1]) - this.Center; - if ((double) vector2_1.Length() > 20.0) - { - this.velocity = this.velocity + new Vector2((double) vector2_1.X > 0.0 ? 1f : -1f, (double) vector2_1.Y > 0.0 ? 1f : -1f) * 0.04f; - if ((double) Math.Abs(this.velocity.Y) > 2.0) - this.velocity.Y *= 0.95f; - } - this.TargetClosest(); - Player player = Main.player[this.target]; - if (!player.dead && (double) player.Distance(this.Center) < 250.0) - { - this.ai[2] = 1f; - this.direction = (double) player.Center.X > (double) this.Center.X ? -1 : 1; - if ((double) this.velocity.X * (double) this.direction < 0.0) - this.velocity.X = (float) (this.direction * 2); - this.ai[3] = 0.0f; - this.netUpdate = true; - break; - } - break; - case 1: - this.lavaImmune = false; - this.noTileCollide = false; - if (this.collideX) - { - this.direction *= -1; - this.velocity.X = (float) (this.direction * 2); - } - if (this.collideY) - this.velocity.Y = (double) this.oldVelocity.Y > 0.0 ? 1f : -1f; - float num1 = 4.5f; - if (Math.Sign(this.velocity.X) != this.direction || (double) Math.Abs(this.velocity.X) < (double) num1) - { - this.velocity.X += (float) this.direction * 0.04f; - if ((double) this.velocity.X * (double) this.direction < 0.0) - { - if ((double) Math.Abs(this.velocity.X) > (double) num1) - this.velocity.X += (float) this.direction * 0.4f; - else - this.velocity.X += (float) this.direction * 0.2f; - } - else if ((double) Math.Abs(this.velocity.X) > (double) num1) - this.velocity.X = (float) this.direction * num1; - } - int num2 = (int) (((double) this.position.X + (double) (this.width / 2)) / 16.0); - int num3 = 20; - if (this.direction < 0) - num2 -= num3; - int num4 = (int) (((double) this.position.Y + (double) this.height) / 16.0); - bool flag2 = true; - int num5 = 8; - bool flag3 = false; - for (int index1 = num2; index1 <= num2 + num3; ++index1) - { - for (int index2 = num4; index2 < num4 + num5; ++index2) - { - if (Main.tile[index1, index2] == null) - Main.tile[index1, index2] = new Tile(); - if (Main.tile[index1, index2].nactive() && Main.tileSolid[(int) Main.tile[index1, index2].type] || Main.tile[index1, index2].liquid > (byte) 0) - { - if (index2 < num4 + 5) - flag3 = true; - flag2 = false; - break; - } - } - } - if (flag2) - this.velocity.Y += 0.05f; - else - this.velocity.Y -= 0.2f; - if (flag3) - this.velocity.Y -= 0.3f; - if ((double) this.velocity.Y > 3.0) - this.velocity.Y = 3f; - if ((double) this.velocity.Y < -5.0) - { - this.velocity.Y = -5f; - break; - } - break; - case 2: - this.noTileCollide = true; - NPCAimedTarget targetData1 = this.GetTargetData(); - bool flag4 = false; - if (targetData1.Type == NPCTargetType.Player) - flag4 = Main.player[this.target].dead; - if (flag4) - { - this.ai[2] = 1f; - this.direction = (double) targetData1.Center.X > (double) this.Center.X ? -1 : 1; - if ((double) this.velocity.X * (double) this.direction < 0.0) - this.velocity.X = (float) (this.direction * 2); - this.ai[3] = 0.0f; - this.netUpdate = true; - break; - } - Microsoft.Xna.Framework.Rectangle r1 = Utils.CenteredRectangle(targetData1.Center, new Vector2((float) (targetData1.Width + 60), (float) (targetData1.Height / 2))); - if (Main.netMode != 1 && this.Hitbox.Intersects(r1)) - { - Point treasureCoords; - if (this.GetFairyTreasureCoords(out treasureCoords)) - { - this.ai[0] = (float) treasureCoords.X; - this.ai[1] = (float) treasureCoords.Y; - this.ai[2] = 3f; - this.ai[3] = 0.0f; - this.netUpdate = true; - break; - } - this.ai[2] = 6f; - this.ai[3] = 0.0f; - this.netUpdate = true; - break; - } - Vector2 vector2_2 = r1.ClosestPointInRect(this.Center); - Vector2 vector2_3 = this.DirectionTo(vector2_2) * 2f; - float num6 = this.Distance(vector2_2); - if ((double) num6 > 150.0) - vector2_3 *= 2f; - else if ((double) num6 > 80.0) - vector2_3 *= 1.5f; - this.velocity = Vector2.Lerp(this.velocity, vector2_3, 0.07f); - Point tileCoordinates1 = this.Center.ToTileCoordinates(); - if ((double) this.ai[3] < 300.0) - { - bool goDownwards; - bool goUpwards; - this.GetBirdFlightRecommendation(6, 3, tileCoordinates1, out goDownwards, out goUpwards); - if (goDownwards) - this.velocity.Y += 0.05f; - if (goUpwards) - this.velocity.Y -= 0.02f; - if ((double) this.velocity.Y > 2.0) - this.velocity.Y = 2f; - if ((double) this.velocity.Y < -4.0) - this.velocity.Y = -4f; - } - if (WorldGen.InWorld(tileCoordinates1.X, tileCoordinates1.Y)) - { - this.ai[3] = !WorldGen.SolidTile(tileCoordinates1) ? Math.Max(this.ai[3] - 1f, 0.0f) : Math.Min(this.ai[3] + 2f, 400f); - break; - } - break; - case 3: - this.noTileCollide = true; - if ((double) this.ai[3] == 15.0) - SoundEngine.PlaySound(27, (int) this.position.X, (int) this.position.Y); - if ((double) this.ai[3] <= 15.0) - { - this.velocity = this.velocity * 0.9f; - } - else - { - this.spriteDirection = (double) Main.player[this.target].Center.X <= (double) this.Center.X ? 1 : -1; - flag1 = true; - float num7 = 0.0f; - float num8 = this.ai[3] - 15f; - float circleHeight = 22f; - if ((double) num8 <= 65.0) - { - num7 = 0.3926991f; - circleHeight = 14f; - } - else if ((double) num8 <= 130.0) - { - num7 = -0.3926991f; - circleHeight = 18f; - } - float circleRotation = num7 * (float) this.direction; - Vector2 fairyCircleOffset = this.GetFairyCircleOffset(num8 / 65f, circleRotation, circleHeight); - this.velocity = this.GetFairyCircleOffset((float) ((double) num8 / 65.0 + 1.0 / 65.0), circleRotation, circleHeight) - fairyCircleOffset; - } - ++this.ai[3]; - if ((double) this.ai[3] >= 210.0) - { - this.ai[2] = 4f; - this.TargetClosest(); - this.ai[3] = 0.0f; - this.netUpdate = true; - break; - } - break; - case 4: - this.noTileCollide = true; - NPCAimedTarget targetData2 = this.GetTargetData(); - bool flag5 = false; - if (targetData2.Type == NPCTargetType.Player) - flag5 = Main.player[this.target].dead; - if (flag5) - { - this.ai[2] = 1f; - this.direction = (double) targetData2.Center.X > (double) this.Center.X ? -1 : 1; - if ((double) this.velocity.X * (double) this.direction < 0.0) - this.velocity.X = (float) (this.direction * 2); - this.ai[3] = 0.0f; - this.netUpdate = true; - break; - } - Microsoft.Xna.Framework.Rectangle r2 = Utils.CenteredRectangle(new Vector2((float) ((double) this.ai[0] * 16.0 + 8.0), (float) ((double) this.ai[1] * 16.0 + 8.0)), Vector2.One * 5f); - if (this.Hitbox.Intersects(r2)) - { - this.ai[2] = 5f; - this.ai[3] = 0.0f; - this.netUpdate = true; - break; - } - float num9 = this.Distance(targetData2.Center); - float num10 = 300f; - if ((double) num9 > (double) num10) - { - if ((double) num9 < (double) num10 + 100.0 && !Collision.SolidCollision(this.position, this.width, this.height)) - { - this.noTileCollide = false; - if (this.collideX) - this.velocity.X *= -1f; - if (this.collideY) - this.velocity.Y *= -1f; - } - flag1 = true; - this.spriteDirection = (double) Main.player[this.target].Center.X <= (double) this.Center.X ? 1 : -1; - Vector2 vector2_4 = this.DirectionFrom(targetData2.Center); - if ((double) num9 > (double) num10 + 60.0) - { - this.velocity = this.velocity + vector2_4 * -0.1f; - if (Main.rand.Next(30) == 0) - SoundEngine.PlaySound(27, (int) this.position.X, (int) this.position.Y); - } - else if ((double) num9 < (double) num10 + 30.0) - this.velocity = this.velocity + this.DirectionTo(r2.ClosestPointInRect(this.Center)) * 0.1f; - if ((double) this.velocity.Length() > 1.0) - { - this.velocity = this.velocity * (1f / this.velocity.Length()); - break; - } - break; - } - Vector2 vector2_5 = r2.ClosestPointInRect(this.Center); - Vector2 vector2_6 = this.DirectionTo(vector2_5); - float num11 = this.Distance(vector2_5); - if ((double) num11 > 150.0) - vector2_6 *= 3f; - else if ((double) num11 > 80.0) - vector2_6 *= 2f; - Point tileCoordinates2 = this.Center.ToTileCoordinates(); - if ((double) this.ai[3] < 300.0) - { - this.velocity = Vector2.Lerp(this.velocity, vector2_6, 0.07f); - bool goDownwards; - bool goUpwards; - this.GetBirdFlightRecommendation(4, 2, tileCoordinates2, out goDownwards, out goUpwards); - if (goDownwards) - this.velocity.Y += 0.05f; - if (goUpwards) - this.velocity.Y -= 0.05f; - if ((double) this.velocity.Y > 1.0) - this.velocity.Y = 1f; - if ((double) this.velocity.Y < -1.0) - this.velocity.Y = -1f; - } - else - this.velocity = Vector2.Lerp(this.velocity, vector2_6, 0.07f); - this.ai[3] = !WorldGen.SolidTile(tileCoordinates2) ? Math.Max(this.ai[3] - 1f, 0.0f) : Math.Min(this.ai[3] + 2f, 400f); - break; - case 5: - this.localAI[1] = 0.0f; - this.noTileCollide = true; - bool flag6 = false; - Tile tileSafely = Framing.GetTileSafely(new Point((int) this.ai[0], (int) this.ai[1])); - if (!tileSafely.active() || !SceneMetrics.IsValidForOreFinder(tileSafely)) - flag6 = true; - if ((double) this.ai[3] == 15.0) - SoundEngine.PlaySound(27, (int) this.position.X, (int) this.position.Y); - if ((double) this.ai[3] <= 15.0) - { - this.velocity = this.velocity * 0.9f; - } - else - { - flag1 = true; - float num12 = this.ai[3] - 15f; - int num13; - float num14 = (float) (Math.Cos((double) (num13 = (int) ((double) num12 / 50.0)) * 1.0) * 6.28318548202515 / 16.0); - float circleHeight = (float) (Math.Cos((double) num13 * 2.0) * 10.0 + 8.0); - float circleRotation = num14 * (float) this.direction; - Vector2 fairyCircleOffset = this.GetFairyCircleOffset(num12 / 50f, circleRotation, circleHeight); - this.velocity = this.GetFairyCircleOffset((float) ((double) num12 / 50.0 + 0.0199999995529652), circleRotation, circleHeight) - fairyCircleOffset; - this.spriteDirection = (double) Main.player[this.target].Center.X <= (double) this.Center.X ? 1 : -1; - } - ++this.ai[3]; - if (Main.netMode != 1 && (double) this.ai[3] > 200.0) - { - this.active = false; - switch (Main.netMode) - { - case 0: - NPC.FairyEffects(this.Center, this.type - 583); - break; - case 2: - this.netSkip = -1; - this.life = 0; - NetMessage.SendData(23, number: this.whoAmI); - NetMessage.SendData(112, number: 2, number2: ((float) (int) this.Center.X), number3: ((float) (int) this.Center.Y), number4: ((float) (this.type - 583))); - break; - } - } - else - break; - break; - case 6: - this.noTileCollide = true; - Vector2 vector2_7 = Main.player[this.target].Center - this.Center; - if ((double) vector2_7.Length() > 100.0) - { - this.ai[2] = 2f; - this.TargetClosest(); - this.ai[3] = 0.0f; - this.netUpdate = true; - break; - } - if (!Collision.SolidCollision(this.position, this.width, this.height)) - { - this.noTileCollide = false; - if (this.collideX) - this.velocity.X *= -1f; - if (this.collideY) - this.velocity.Y *= -1f; - } - if ((double) vector2_7.Length() > 20.0) - { - this.velocity = this.velocity + new Vector2((double) vector2_7.X > 0.0 ? 1f : -1f, (double) vector2_7.Y > 0.0 ? 1f : -1f) * 0.04f; - if ((double) Math.Abs(this.velocity.Y) > 2.0) - this.velocity.Y *= 0.95f; - } - Point treasureCoords1; - if (Main.netMode != 1 && this.GetFairyTreasureCoords(out treasureCoords1)) - { - this.ai[0] = (float) treasureCoords1.X; - this.ai[1] = (float) treasureCoords1.Y; - this.ai[2] = 3f; - this.ai[3] = 0.0f; - this.netUpdate = true; - break; - } - break; - case 7: - this.noTileCollide = true; - this.velocity.X += 0.05f * (float) this.direction; - this.velocity.X = MathHelper.Clamp(this.velocity.X, -10f, 10f); - this.velocity.Y -= 0.025f; - this.velocity.Y = MathHelper.Clamp(this.velocity.Y, -5f, 5f); - this.EncourageDespawn(10); - break; - } - this.dontTakeDamage = this.dontTakeDamageFromHostiles = (double) this.ai[2] > 1.0; - for (int index = 0; index < 200; ++index) - { - if (index != this.whoAmI && Main.npc[index].active && Main.npc[index].aiStyle == 112 && (double) Math.Abs(this.position.X - Main.npc[index].position.X) + (double) Math.Abs(this.position.Y - Main.npc[index].position.Y) < (double) this.width * 1.5) - { - if ((double) this.position.Y < (double) Main.npc[index].position.Y) - this.velocity.Y -= 0.05f; - else - this.velocity.Y += 0.05f; - } - } - if (!flag1) - { - this.direction = (double) this.velocity.X >= 0.0 ? 1 : -1; - this.spriteDirection = -this.direction; - } - Color color1 = Color.HotPink; - Color color2 = Color.LightPink; - int num15 = 4; - if (this.type == 584) - { - color1 = Color.LimeGreen; - color2 = Color.LightSeaGreen; - } - if (this.type == 585) - { - color1 = Color.RoyalBlue; - color2 = Color.LightBlue; - } - if ((int) Main.timeForVisualEffects % 2 == 0) - { - this.position = this.position + this.netOffset; - Dust dust = Dust.NewDustDirect(this.Center - new Vector2((float) num15) * 0.5f, num15 + 4, num15 + 4, 278, Alpha: 200, newColor: Color.Lerp(color1, color2, Main.rand.NextFloat()), Scale: 0.65f); - dust.velocity *= 0.0f; - dust.velocity += this.velocity * 0.3f; - dust.noGravity = true; - dust.noLight = true; - this.position = this.position - this.netOffset; - } - Lighting.AddLight(this.Center, color1.ToVector3() * 0.7f); - } - - public static void FairyEffects(Vector2 Position, int type) - { - Color color1 = Color.HotPink; - Color color2 = Color.LightPink; - int num = 4; - if (type == 1) - { - color1 = Color.LimeGreen; - color2 = Color.LightSeaGreen; - } - if (type == 2) - { - color1 = Color.RoyalBlue; - color2 = Color.LightBlue; - } - for (int index = 0; index < 40; ++index) - { - Dust dust = Dust.NewDustDirect(Position - new Vector2((float) num) * 0.5f, num + 4, num + 4, 278, Alpha: 200, newColor: Color.Lerp(color1, color2, Main.rand.NextFloat()), Scale: 0.65f); - dust.velocity *= 1.5f; - if (index >= 30) - dust.velocity *= 3.5f; - else if (index >= 20) - dust.velocity *= 2f; - dust.fadeIn = (float) Main.rand.Next(0, 17) * 0.1f; - dust.noGravity = true; - } - SoundEngine.PlaySound(SoundID.Item4, (int) Position.X, (int) Position.Y); - } - - private void GetBirdFlightRecommendation( - int downScanRange, - int upRange, - Point tCoords, - out bool goDownwards, - out bool goUpwards) - { - tCoords.X += this.direction; - goDownwards = true; - goUpwards = false; - int x = tCoords.X; - for (int y = tCoords.Y; y < tCoords.Y + downScanRange && WorldGen.InWorld(x, y); ++y) - { - Tile tile = Main.tile[x, y]; - if (tile == null) - break; - if (tile.nactive() && Main.tileSolid[(int) tile.type] || tile.liquid > (byte) 0) - { - if (y < tCoords.Y + upRange) - goUpwards = true; - goDownwards = false; - break; - } - } - } - - private Vector2 GetFairyCircleOffset( - float elapsedTime, - float circleRotation, - float circleHeight) - { - return ((((float) (6.28318548202515 * (double) elapsedTime + 1.57079637050629)).ToRotationVector2() + new Vector2(0.0f, -1f)) * new Vector2((float) (6 * -this.direction), circleHeight)).RotatedBy((double) circleRotation); - } - - private bool GetFairyTreasureCoords(out Point treasureCoords) - { - treasureCoords = new Point(); - Point tileCoordinates = this.Center.ToTileCoordinates(); - Microsoft.Xna.Framework.Rectangle rectangle1 = new Microsoft.Xna.Framework.Rectangle(tileCoordinates.X, tileCoordinates.Y, 1, 1); - rectangle1.Inflate(75, 50); - int blackEdgeWidth = Main.Map.BlackEdgeWidth; - Microsoft.Xna.Framework.Rectangle rectangle2 = new Microsoft.Xna.Framework.Rectangle(0, 0, Main.maxTilesX, Main.maxTilesY); - rectangle2.Inflate(-blackEdgeWidth, -blackEdgeWidth); - Microsoft.Xna.Framework.Rectangle rectangle3 = Microsoft.Xna.Framework.Rectangle.Intersect(rectangle1, rectangle2); - int num1 = -1; - float num2 = -1f; - for (int left = rectangle3.Left; left <= rectangle3.Right; ++left) - { - for (int top = rectangle3.Top; top <= rectangle3.Bottom; ++top) - { - Tile t = Main.tile[left, top]; - if (t != null && t.active() && TileID.Sets.FriendlyFairyCanLureTo[(int) t.type] && SceneMetrics.IsValidForOreFinder(t)) - { - short num3 = Main.tileOreFinderPriority[(int) t.type]; - if (TileID.Sets.Ore[(int) t.type]) - { - int num4 = 3; - int num5 = 3; - int num6 = 40; - int num7 = 0; - for (int index1 = left - num4; index1 <= left + num4; ++index1) - { - for (int index2 = top - num5; index2 <= top + num5; ++index2) - { - if (Main.tile[index1, index2].active() && (int) Main.tile[index1, index2].type == (int) t.type) - ++num7; - } - } - if (num7 < num6) - num3 = (short) -1; - } - if (num1 <= (int) num3) - { - float num8 = this.Distance(new Vector2((float) (left * 16 + 8), (float) (top * 16 + 8))); - if (num1 != (int) num3 || (double) num8 < (double) num2) - { - num1 = (int) num3; - num2 = num8; - treasureCoords.X = left; - treasureCoords.Y = top; - } - } - } - } - } - return num1 != -1; + // ISSUE: The method is too long to display (119166 instructions) } private void AI_069_DukeFishron() { bool expertMode = Main.expertMode; - float num1 = expertMode ? 1.2f : 1f; + float num1 = expertMode ? 0.6f * Main.damageMultiplier : 1f; bool flag1 = (double) this.life <= (double) this.lifeMax * 0.5; bool flag2 = expertMode && (double) this.life <= (double) this.lifeMax * 0.15; bool flag3 = (double) this.ai[0] > 4.0; @@ -16331,7 +11485,7 @@ label_19: int num19 = 75; Vector2 center = this.Center; Player player = Main.player[this.target]; - if (this.target < 0 || this.target == (int) byte.MaxValue || player.dead || !player.active || (double) Vector2.Distance(player.Center, center) > 5600.0) + if (this.target < 0 || this.target == (int) byte.MaxValue || player.dead || !player.active) { this.TargetClosest(); player = Main.player[this.target]; @@ -16340,7 +11494,8 @@ label_19: if (player.dead || (double) Vector2.Distance(player.Center, center) > 5600.0) { this.velocity.Y -= 0.4f; - this.EncourageDespawn(10); + if (this.timeLeft > 10) + this.timeLeft = 10; this.ai[0] = (double) this.ai[0] <= 4.0 ? 0.0f : 5f; this.ai[2] = 0.0f; } @@ -16454,7 +11609,7 @@ label_19: Main.dust[index2].noLight = true; Main.dust[index2].velocity = Vector2.Normalize(vector2_2) * 3f; } - SoundEngine.PlaySound(29, (int) center.X, (int) center.Y, 20); + Main.PlaySound(29, (int) center.X, (int) center.Y, 20); } ++this.ai[2]; if ((double) this.ai[2] < (double) num19) @@ -16620,10 +11775,10 @@ label_19: this.velocity.Y -= num8; } if ((double) this.ai[2] == 0.0) - SoundEngine.PlaySound(29, (int) center.X, (int) center.Y, 20); + Main.PlaySound(29, (int) center.X, (int) center.Y, 20); if ((double) this.ai[2] % (double) num7 == 0.0) { - SoundEngine.PlaySound(4, (int) this.Center.X, (int) this.Center.Y, 19); + Main.PlaySound(4, (int) this.Center.X, (int) this.Center.Y, 19); if (Main.netMode != 1) { Vector2 vector2_7 = Vector2.Normalize(player.Center - center) * (float) (this.width + 20) / 2f + center; @@ -16651,7 +11806,7 @@ label_19: this.velocity = this.velocity * 0.98f; this.velocity.Y = MathHelper.Lerp(this.velocity.Y, 0.0f, 0.02f); if ((double) this.ai[2] == (double) (num10 - 30)) - SoundEngine.PlaySound(29, (int) center.X, (int) center.Y, 9); + Main.PlaySound(29, (int) center.X, (int) center.Y, 9); if (Main.netMode != 1 && (double) this.ai[2] == (double) (num10 - 30)) { Vector2 vector2 = this.rotation.ToRotationVector2() * (Vector2.UnitX * (float) this.direction) * (float) (this.width + 20) / 2f + center; @@ -16671,7 +11826,7 @@ label_19: this.velocity = this.velocity * 0.98f; this.velocity.Y = MathHelper.Lerp(this.velocity.Y, 0.0f, 0.02f); if ((double) this.ai[2] == (double) (num11 - 60)) - SoundEngine.PlaySound(29, (int) center.X, (int) center.Y, 20); + Main.PlaySound(29, (int) center.X, (int) center.Y, 20); ++this.ai[2]; if ((double) this.ai[2] < (double) num11) return; @@ -16815,10 +11970,10 @@ label_19: else if ((double) this.ai[0] == 7.0) { if ((double) this.ai[2] == 0.0) - SoundEngine.PlaySound(29, (int) center.X, (int) center.Y, 20); + Main.PlaySound(29, (int) center.X, (int) center.Y, 20); if ((double) this.ai[2] % (double) num15 == 0.0) { - SoundEngine.PlaySound(4, (int) this.Center.X, (int) this.Center.Y, 19); + Main.PlaySound(4, (int) this.Center.X, (int) this.Center.Y, 19); if (Main.netMode != 1) { Vector2 vector2 = Vector2.Normalize(this.velocity) * (float) (this.width + 20) / 2f + center; @@ -16844,7 +11999,7 @@ label_19: this.velocity = this.velocity * 0.98f; this.velocity.Y = MathHelper.Lerp(this.velocity.Y, 0.0f, 0.02f); if ((double) this.ai[2] == (double) (num10 - 30)) - SoundEngine.PlaySound(29, (int) center.X, (int) center.Y, 20); + Main.PlaySound(29, (int) center.X, (int) center.Y, 20); if (Main.netMode != 1 && (double) this.ai[2] == (double) (num10 - 30)) Projectile.NewProjectile(center.X, center.Y, 0.0f, 0.0f, 385, 0, 0.0f, Main.myPlayer, 1f, (float) (this.target + 1)); ++this.ai[2]; @@ -16877,7 +12032,7 @@ label_19: this.velocity = this.velocity * 0.98f; this.velocity.Y = MathHelper.Lerp(this.velocity.Y, 0.0f, 0.02f); if ((double) this.ai[2] == (double) (num12 - 60)) - SoundEngine.PlaySound(29, (int) center.X, (int) center.Y, 20); + Main.PlaySound(29, (int) center.X, (int) center.Y, 20); ++this.ai[2]; if ((double) this.ai[2] < (double) num12) return; @@ -17005,7 +12160,7 @@ label_19: this.velocity = this.velocity * 0.98f; this.velocity.Y = MathHelper.Lerp(this.velocity.Y, 0.0f, 0.02f); if ((double) this.ai[2] == (double) (num13 / 2)) - SoundEngine.PlaySound(29, (int) center.X, (int) center.Y, 20); + Main.PlaySound(29, (int) center.X, (int) center.Y, 20); if (Main.netMode != 1 && (double) this.ai[2] == (double) (num13 / 2)) { if ((double) this.ai[1] == 0.0) @@ -17042,7 +12197,7 @@ label_19: if ((double) this.ai[0] != 13.0) return; if ((double) this.ai[2] == 0.0) - SoundEngine.PlaySound(29, (int) center.X, (int) center.Y, 20); + Main.PlaySound(29, (int) center.X, (int) center.Y, 20); this.velocity = this.velocity.RotatedBy(-(double) num18 * (double) this.direction); this.rotation -= num18 * (float) this.direction; ++this.ai[2]; @@ -17103,8 +12258,6 @@ label_19: this.realLife = this.whoAmI; int index3 = this.whoAmI; int num = 80; - if (Main.getGoodWorld) - num *= 2; for (int index4 = 0; index4 <= num; ++index4) { int Type = 135; @@ -17136,11 +12289,13 @@ label_19: float num5 = num2 * num3; float SpeedX = num4 + (float) Main.rand.Next(-20, 21) * 0.05f; float SpeedY = num5 + (float) Main.rand.Next(-20, 21) * 0.05f; - int damageForProjectiles = this.GetAttackDamage_ForProjectiles(22f, 18f); + int Damage = 22; + if (Main.expertMode) + Damage = 18; int Type = 100; vector2.X += SpeedX * 5f; vector2.Y += SpeedY * 5f; - int index = Projectile.NewProjectile(vector2.X, vector2.Y, SpeedX, SpeedY, Type, damageForProjectiles, 0.0f, Main.myPlayer); + int index = Projectile.NewProjectile(vector2.X, vector2.Y, SpeedX, SpeedY, Type, Damage, 0.0f, Main.myPlayer); Main.projectile[index].timeLeft = 300; this.netUpdate = true; } @@ -17232,11 +12387,6 @@ label_19: } float num12 = 0.1f; float num13 = 0.15f; - if (Main.getGoodWorld) - { - num12 *= 1.2f; - num13 *= 1.2f; - } Vector2 vector2_1 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); float num14 = Main.player[this.target].position.X + (float) (Main.player[this.target].width / 2); float num15 = Main.player[this.target].position.Y + (float) (Main.player[this.target].height / 2); @@ -17310,7 +12460,7 @@ label_19: if ((double) num26 > 20.0) num26 = 20f; this.soundDelay = (int) num26; - SoundEngine.PlaySound(15, (int) this.position.X, (int) this.position.Y); + Main.PlaySound(15, (int) this.position.X, (int) this.position.Y); } float num27 = (float) Math.Sqrt((double) num18 * (double) num18 + (double) num19 * (double) num19); float num28 = Math.Abs(num18); @@ -17405,51 +12555,8 @@ label_19: private void AI_005_EaterOfSouls() { - if (this.type == 210 || this.type == 211) - NPCUtils.TargetClosestNonBees(this); - else if (this.target < 0 || this.target <= (int) byte.MaxValue || Main.player[this.target].dead) + if (this.target < 0 || this.target == (int) byte.MaxValue || Main.player[this.target].dead) this.TargetClosest(); - if (this.type == 619) - { - if (Main.dayTime) - { - this.velocity.Y -= 0.3f; - this.EncourageDespawn(60); - } - this.position = this.position + this.netOffset; - if (this.alpha == (int) byte.MaxValue) - { - this.spriteDirection = this.direction; - this.velocity.Y = -6f; - for (int index = 0; index < 35; ++index) - { - Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 5); - dust.velocity *= 1f; - dust.scale = (float) (1.0 + (double) Main.rand.NextFloat() * 0.5); - dust.fadeIn = (float) (1.5 + (double) Main.rand.NextFloat() * 0.5); - dust.velocity += this.velocity * 0.5f; - } - } - this.alpha -= 15; - if (this.alpha < 0) - this.alpha = 0; - if (this.alpha != 0) - { - for (int index = 0; index < 2; ++index) - { - Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 5); - dust.velocity *= 1f; - dust.scale = (float) (1.0 + (double) Main.rand.NextFloat() * 0.5); - dust.fadeIn = (float) (1.5 + (double) Main.rand.NextFloat() * 0.5); - dust.velocity += this.velocity * 0.3f; - } - } - this.position = this.position - this.netOffset; - } - NPCAimedTarget targetData = this.GetTargetData(); - bool flag1 = false; - if (targetData.Type == NPCTargetType.Player) - flag1 = Main.player[this.target].dead; float num1 = 6f; float num2 = 0.05f; if (this.type == 6 || this.type == 173) @@ -17464,14 +12571,9 @@ label_19: num1 = 4.2f; num2 = 0.022f; } - else if (this.type == 619) - { - num1 = 6f; - num2 = 0.1f; - } else if (this.type == 252) { - if (targetData.Type != NPCTargetType.None && Collision.CanHit((Entity) this, targetData)) + if (Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) { num1 = 6f; num2 = 0.1f; @@ -17493,13 +12595,6 @@ label_19: } num1 = num3 * (1f - this.scale); num2 = num4 * (1f - this.scale); - if ((double) this.position.Y / 16.0 < Main.worldSurface) - { - if ((double) Main.player[this.target].position.Y - (double) this.position.Y > 300.0 && (double) this.velocity.Y < 0.0) - this.velocity.Y *= 0.97f; - if ((double) Main.player[this.target].position.Y - (double) this.position.Y < 80.0 && (double) this.velocity.Y > 0.0) - this.velocity.Y *= 0.97f; - } } else if (this.type == 205) { @@ -17523,8 +12618,8 @@ label_19: } else if (this.type == 210 || this.type == 211) { - ++this.ai[1]; - float num5 = (float) (((double) this.ai[1] - 60.0) / 60.0); + ++this.localAI[0]; + float num5 = (float) (((double) this.localAI[0] - 60.0) / 60.0); if ((double) num5 > 1.0) { num5 = 1f; @@ -17544,8 +12639,8 @@ label_19: num2 = 0.1f * num5; } Vector2 vector2_1 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); - float num6 = targetData.Position.X + (float) (targetData.Width / 2); - float num7 = targetData.Position.Y + (float) (targetData.Height / 2); + float num6 = Main.player[this.target].position.X + (float) (Main.player[this.target].width / 2); + float num7 = Main.player[this.target].position.Y + (float) (Main.player[this.target].height / 2); float num8 = (float) ((int) ((double) num6 / 8.0) * 8); float num9 = (float) ((int) ((double) num7 / 8.0) * 8); vector2_1.X = (float) ((int) ((double) vector2_1.X / 8.0) * 8); @@ -17554,9 +12649,9 @@ label_19: float num11 = num9 - vector2_1.Y; float num12 = (float) Math.Sqrt((double) num10 * (double) num10 + (double) num11 * (double) num11); float num13 = num12; - bool flag2 = false; + bool flag = false; if ((double) num12 > 600.0) - flag2 = true; + flag = true; float SpeedX1; float SpeedY1; if ((double) num12 == 0.0) @@ -17570,13 +12665,9 @@ label_19: SpeedX1 = num10 * num14; SpeedY1 = num11 * num14; } - int num15 = this.type == 6 || this.type == 139 || this.type == 173 ? 1 : (this.type == 205 ? 1 : 0); - bool flag3 = this.type == 42 || this.type == 94 || this.type == 619 || this.type == 176 || this.type == 210 || this.type == 211 || this.type >= 231 && this.type <= 235; - bool flag4 = this.type != 173 && this.type != 6 && this.type != 42 && (this.type < 231 || this.type > 235) && this.type != 94 && this.type != 139 && this.type != 619; - int num16 = flag3 ? 1 : 0; - if ((num15 | num16) != 0) + if (this.type == 6 || this.type == 42 || this.type == 94 || this.type == 139 || this.type == 173 || this.type == 176 || this.type == 205 || this.type == 210 || this.type == 211 || this.type >= 231 && this.type <= 235) { - if ((double) num13 > 100.0 | flag3) + if ((double) num13 > 100.0 || this.type == 42 || this.type == 94 || this.type == 176 || this.type == 210 || this.type == 211 || this.type >= 231 && this.type <= 235) { ++this.ai[0]; if ((double) this.ai[0] > 0.0) @@ -17590,41 +12681,39 @@ label_19: if ((double) this.ai[0] > 200.0) this.ai[0] = -200f; } - if ((double) num13 < 150.0 && (this.type == 6 || this.type == 94 || this.type == 173 || this.type == 619)) + if ((double) num13 < 150.0 && (this.type == 6 || this.type == 94 || this.type == 173)) { this.velocity.X += SpeedX1 * 0.007f; this.velocity.Y += SpeedY1 * 0.007f; } } - if (flag1) + if (Main.player[this.target].dead) { SpeedX1 = (float) ((double) this.direction * (double) num1 / 2.0); SpeedY1 = (float) (-(double) num1 / 2.0); } - else if (this.type == 619 && (double) this.Center.Y > (double) targetData.Center.Y - 200.0) - this.velocity.Y -= 0.3f; if ((double) this.velocity.X < (double) SpeedX1) { this.velocity.X += num2; - if (flag4 && (double) this.velocity.X < 0.0 && (double) SpeedX1 > 0.0) + if (this.type != 173 && this.type != 6 && this.type != 42 && (this.type < 231 || this.type > 235) && this.type != 94 && this.type != 139 && (double) this.velocity.X < 0.0 && (double) SpeedX1 > 0.0) this.velocity.X += num2; } else if ((double) this.velocity.X > (double) SpeedX1) { this.velocity.X -= num2; - if (flag4 && (double) this.velocity.X > 0.0 && (double) SpeedX1 < 0.0) + if (this.type != 173 && this.type != 6 && this.type != 42 && (this.type < 231 || this.type > 235) && this.type != 94 && this.type != 139 && (double) this.velocity.X > 0.0 && (double) SpeedX1 < 0.0) this.velocity.X -= num2; } if ((double) this.velocity.Y < (double) SpeedY1) { this.velocity.Y += num2; - if (flag4 && (double) this.velocity.Y < 0.0 && (double) SpeedY1 > 0.0) + if (this.type != 173 && this.type != 6 && this.type != 42 && (this.type < 231 || this.type > 235) && this.type != 94 && this.type != 139 && (double) this.velocity.Y < 0.0 && (double) SpeedY1 > 0.0) this.velocity.Y += num2; } else if ((double) this.velocity.Y > (double) SpeedY1) { this.velocity.Y -= num2; - if (flag4 && (double) this.velocity.Y > 0.0 && (double) SpeedY1 < 0.0) + if (this.type != 173 && this.type != 6 && this.type != 42 && (this.type < 231 || this.type > 235) && this.type != 94 && this.type != 139 && (double) this.velocity.Y > 0.0 && (double) SpeedY1 < 0.0) this.velocity.Y -= num2; } if (this.type == 23) @@ -17648,11 +12737,13 @@ label_19: if (Main.netMode != 1 && (double) this.localAI[0] >= 120.0) { this.localAI[0] = 0.0f; - if (targetData.Type != NPCTargetType.None && Collision.CanHit((Entity) this, targetData)) + if (Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) { - int damageForProjectiles = this.GetAttackDamage_ForProjectiles(25f, 22f); + int Damage = 25; + if (Main.expertMode) + Damage = 22; int Type = 84; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX1, SpeedY1, Type, damageForProjectiles, 0.0f, Main.myPlayer); + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX1, SpeedY1, Type, Damage, 0.0f, Main.myPlayer); } } if (!WorldGen.SolidTile(((int) this.position.X + this.width / 2) / 16, ((int) this.position.Y + this.height / 2) / 16)) @@ -17668,7 +12759,7 @@ label_19: this.rotation = (float) Math.Atan2((double) SpeedY1, (double) SpeedX1) + 3.14f; } } - else if (this.type == 6 || this.type == 94 || this.type == 173 || this.type == 619) + else if (this.type == 6 || this.type == 94 || this.type == 173) this.rotation = (float) Math.Atan2((double) SpeedY1, (double) SpeedX1) - 1.57f; else if (this.type == 42 || this.type == 176 || this.type == 205 || this.type >= 231 && this.type <= 235) { @@ -17680,15 +12771,15 @@ label_19: } else this.rotation = (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X) - 1.57f; - if (this.type == 6 || this.type == 619 || this.type == 23 || this.type == 42 || this.type == 94 || this.type == 139 || this.type == 173 || this.type == 176 || this.type == 205 || this.type == 210 || this.type == 211 || this.type >= 231 && this.type <= 235) + if (this.type == 6 || this.type == 23 || this.type == 42 || this.type == 94 || this.type == 139 || this.type == 173 || this.type == 176 || this.type == 205 || this.type == 210 || this.type == 211 || this.type >= 231 && this.type <= 235) { - float num17 = 0.7f; + float num15 = 0.7f; if (this.type == 6 || this.type == 173) - num17 = 0.4f; + num15 = 0.4f; if (this.collideX) { this.netUpdate = true; - this.velocity.X = this.oldVelocity.X * -num17; + this.velocity.X = this.oldVelocity.X * -num15; if (this.direction == -1 && (double) this.velocity.X > 0.0 && (double) this.velocity.X < 2.0) this.velocity.X = 2f; if (this.direction == 1 && (double) this.velocity.X < 0.0 && (double) this.velocity.X > -2.0) @@ -17697,17 +12788,18 @@ label_19: if (this.collideY) { this.netUpdate = true; - this.velocity.Y = this.oldVelocity.Y * -num17; + this.velocity.Y = this.oldVelocity.Y * -num15; if ((double) this.velocity.Y > 0.0 && (double) this.velocity.Y < 1.5) this.velocity.Y = 2f; if ((double) this.velocity.Y < 0.0 && (double) this.velocity.Y > -1.5) this.velocity.Y = -2f; } - this.position = this.position + this.netOffset; - if (this.type == 619) + if (this.type == 23) { - int index = Dust.NewDust(this.position, this.width, this.height, 5, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100); - Main.dust[index].velocity *= 0.5f; + int index = Dust.NewDust(new Vector2(this.position.X - this.velocity.X, this.position.Y - this.velocity.Y), this.width, this.height, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, Scale: 2f); + Main.dust[index].noGravity = true; + Main.dust[index].velocity.X *= 0.3f; + Main.dust[index].velocity.Y *= 0.3f; } else if (this.type != 42 && this.type != 139 && this.type != 176 && this.type != 205 && this.type != 210 && this.type != 211 && this.type != 252 && (this.type < 231 || this.type > 235) && Main.rand.Next(20) == 0) { @@ -17718,7 +12810,6 @@ label_19: Main.dust[index].velocity.X *= 0.5f; Main.dust[index].velocity.Y *= 0.1f; } - this.position = this.position - this.netOffset; } else if (this.type != 252 && Main.rand.Next(40) == 0) { @@ -17726,7 +12817,7 @@ label_19: Main.dust[index].velocity.X *= 0.5f; Main.dust[index].velocity.Y *= 0.1f; } - if ((this.type == 6 || this.type == 94 || this.type == 173 || this.type == 619) && this.wet) + if ((this.type == 6 || this.type == 94 || this.type == 173) && this.wet) { if ((double) this.velocity.Y > 0.0) this.velocity.Y *= 0.95f; @@ -17756,7 +12847,7 @@ label_19: } if ((double) this.ai[1] == 101.0) { - SoundEngine.PlaySound(SoundID.Item17, this.position); + Main.PlaySound(SoundID.Item17, this.position); this.ai[1] = 0.0f; } if (Main.netMode != 1) @@ -17764,26 +12855,22 @@ label_19: this.ai[1] += (float) Main.rand.Next(5, 20) * 0.1f * this.scale; if (this.type == 176) this.ai[1] += (float) Main.rand.Next(5, 20) * 0.1f * this.scale; - if (targetData.Type == NPCTargetType.Player) - { - Player player = Main.player[this.target]; - if (player != null && (double) player.stealth == 0.0 && player.itemAnimation == 0) - this.ai[1] = 0.0f; - } + if ((double) Main.player[this.target].stealth == 0.0 && Main.player[this.target].itemAnimation == 0) + this.ai[1] = 0.0f; if ((double) this.ai[1] >= 130.0) { - if (targetData.Type != NPCTargetType.None && Collision.CanHit((Entity) this, targetData)) + if (Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) { - float num18 = 8f; + float num16 = 8f; Vector2 vector2_2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) (this.height / 2)); - float num19 = targetData.Center.X - vector2_2.X + (float) Main.rand.Next(-20, 21); - float num20 = targetData.Center.Y - vector2_2.Y + (float) Main.rand.Next(-20, 21); - if ((double) num19 < 0.0 && (double) this.velocity.X < 0.0 || (double) num19 > 0.0 && (double) this.velocity.X > 0.0) + float num17 = Main.player[this.target].position.X + (float) Main.player[this.target].width * 0.5f - vector2_2.X + (float) Main.rand.Next(-20, 21); + float num18 = Main.player[this.target].position.Y + (float) Main.player[this.target].height * 0.5f - vector2_2.Y + (float) Main.rand.Next(-20, 21); + if ((double) num17 < 0.0 && (double) this.velocity.X < 0.0 || (double) num17 > 0.0 && (double) this.velocity.X > 0.0) { - float num21 = (float) Math.Sqrt((double) num19 * (double) num19 + (double) num20 * (double) num20); - float num22 = num18 / num21; - float SpeedX2 = num19 * num22; - float SpeedY2 = num20 * num22; + float num19 = (float) Math.Sqrt((double) num17 * (double) num17 + (double) num18 * (double) num18); + float num20 = num16 / num19; + float SpeedX2 = num17 * num20; + float SpeedY2 = num18 * num20; int Damage = (int) (10.0 * (double) this.scale); if (this.type == 176) Damage = (int) (30.0 * (double) this.scale); @@ -17801,7 +12888,7 @@ label_19: } } } - if (this.type == 139 & flag2) + if (this.type == 139 & flag) { if ((double) this.velocity.X > 0.0 && (double) SpeedX1 > 0.0 || (double) this.velocity.X < 0.0 && (double) SpeedX1 < 0.0) { @@ -17811,77 +12898,35 @@ label_19: else this.velocity.X *= 0.9f; } - if (Main.netMode != 1) + if (Main.netMode != 1 && this.type == 94 && !Main.player[this.target].dead) { - if (this.type == 94 && !flag1) + if (this.justHit) + this.localAI[0] = 0.0f; + ++this.localAI[0]; + if ((double) this.localAI[0] == 180.0) { - if (this.justHit) - this.localAI[0] = 0.0f; - ++this.localAI[0]; - if ((double) this.localAI[0] == 180.0) - { - if (targetData.Type != NPCTargetType.None && Collision.CanHit((Entity) this, targetData)) - NPC.NewNPC((int) ((double) this.position.X + (double) (this.width / 2) + (double) this.velocity.X), (int) ((double) this.position.Y + (double) (this.height / 2) + (double) this.velocity.Y), 112); - this.localAI[0] = 0.0f; - } - } - if (this.type == 619 && !flag1) - { - if (this.justHit) - this.localAI[0] += 10f; - ++this.localAI[0]; - if ((double) this.localAI[0] >= 120.0) - { - if (targetData.Type != NPCTargetType.None && Collision.CanHit((Entity) this, targetData)) - { - if ((double) (this.Center - targetData.Center).Length() < 400.0) - { - this.velocity = -this.DirectionTo(new Vector2(targetData.Center.X, targetData.Position.Y)) * 5f; - this.netUpdate = true; - this.localAI[0] = 0.0f; - Projectile.NewProjectile(this.Center, this.DirectionTo(new Vector2(targetData.Center.X + (float) Main.rand.Next(-100, 101), targetData.Position.Y + (float) Main.rand.Next(-100, 101))) * 15f, 811, 50, 1f, Main.myPlayer); - } - else - this.localAI[0] = 50f; - } - else - this.localAI[0] = 50f; - } + if (Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + NPC.NewNPC((int) ((double) this.position.X + (double) (this.width / 2) + (double) this.velocity.X), (int) ((double) this.position.Y + (double) (this.height / 2) + (double) this.velocity.Y), 112); + this.localAI[0] = 0.0f; } } - if (((!Main.dayTime || this.type == 173 || this.type == 619 || this.type == 6 || this.type == 23 || this.type == 42 || this.type == 94 || this.type == 176 || this.type == 205 || this.type == 210 || this.type == 211 || this.type == 252 ? 0 : (this.type < 231 ? 1 : (this.type > 235 ? 1 : 0))) | (flag1 ? 1 : 0)) != 0) + if (Main.dayTime && this.type != 173 && this.type != 6 && this.type != 23 && this.type != 42 && this.type != 94 && this.type != 176 && this.type != 205 && this.type != 210 && this.type != 211 && this.type != 252 && (this.type < 231 || this.type > 235) || Main.player[this.target].dead) { this.velocity.Y -= num2 * 2f; - this.EncourageDespawn(10); + if (this.timeLeft > 10) + this.timeLeft = 10; } if (((double) this.velocity.X <= 0.0 || (double) this.oldVelocity.X >= 0.0) && ((double) this.velocity.X >= 0.0 || (double) this.oldVelocity.X <= 0.0) && ((double) this.velocity.Y <= 0.0 || (double) this.oldVelocity.Y >= 0.0) && ((double) this.velocity.Y >= 0.0 || (double) this.oldVelocity.Y <= 0.0) || this.justHit) return; this.netUpdate = true; } - public void CopyInteractions(NPC npc) - { - for (int index = 0; index < this.playerInteraction.Length; ++index) - this.playerInteraction[index] = npc.playerInteraction[index]; - this.lastInteraction = npc.lastInteraction; - } - - public static int GetEaterOfWorldsSegmentsCount() => !Main.expertMode ? 65 : 70; - - public static int GetEaterOfWorldsSegmentsCountByGamemode(int gamemode) - { - GameModeData gameModeData; - return !Main.RegisterdGameModes.TryGetValue(gamemode, out gameModeData) || !gameModeData.IsExpertMode ? 65 : 70; - } - - public static int GetBrainOfCthuluCreepersCount() => Main.getGoodWorld ? 40 : 20; - private void AI_006_Worms() { if (this.type == 117 && (double) this.localAI[1] == 0.0) { this.localAI[1] = 1f; - SoundEngine.PlaySound(SoundID.NPCDeath13, this.position); + Main.PlaySound(SoundID.NPCDeath13, this.position); int num = 1; if ((double) this.velocity.X < 0.0) num = -1; @@ -17890,7 +12935,7 @@ label_19: } if (this.type == 454 && (double) this.localAI[3] == 0.0) { - SoundEngine.PlaySound(SoundID.Item119, this.position); + Main.PlaySound(SoundID.Item119, this.position); this.localAI[3] = 1f; } if (this.type >= 454 && this.type <= 459) @@ -17912,25 +12957,6 @@ label_19: this.alpha = 0; } } - if (this.type >= 621 && this.type <= 623) - { - this.position = this.position + this.netOffset; - this.dontTakeDamage = this.alpha > 0; - if (this.type == 621 || this.type != 621 && Main.npc[(int) this.ai[1]].alpha < 85) - { - if (this.dontTakeDamage) - { - for (int index = 0; index < 2; ++index) - Dust.NewDust(this.position, this.width, this.height, 5, Alpha: 100); - } - this.alpha -= 42; - if (this.alpha < 0) - this.alpha = 0; - } - if (this.alpha == 0 && Main.rand.Next(5) == 0) - Dust.NewDust(this.position, this.width, this.height, 5, Alpha: 100); - this.position = this.position - this.netOffset; - } else if (this.type == 402 && (double) this.ai[1] == 0.0) { this.ai[1] = (float) Main.rand.Next(-2, 0); @@ -17938,11 +12964,9 @@ label_19: } if (Main.netMode != 1 && Main.expertMode) { - if (this.type == 14 && ((double) this.position.Y / 16.0 < Main.worldSurface || Main.getGoodWorld)) + if (this.type == 14 && (double) this.position.Y / 16.0 < Main.worldSurface) { - int x = (int) ((double) this.Center.X / 16.0); - int y = (int) ((double) this.Center.Y / 16.0); - if (WorldGen.InWorld(x, y) && Main.tile[x, y].wall == (ushort) 0 && Main.rand.Next(900) == 0) + if (Main.rand.Next(900) == 0) { this.TargetClosest(); if (Collision.CanHitLine(this.Center, 1, 1, Main.player[this.target].Center, 1, 1)) @@ -17975,9 +12999,6 @@ label_19: flag1 = !Main.player[this.target].ZoneUndergroundDesert; num1 = 0.1f; break; - case 621: - flag1 = false; - break; } if (this.type >= 13 && this.type <= 15) this.realLife = -1; @@ -17987,15 +13008,11 @@ label_19: this.TargetClosest(); if (Main.player[this.target].dead || flag1 && (double) Main.player[this.target].position.Y < Main.worldSurface * 16.0) { - this.EncourageDespawn(300); + if (this.timeLeft > 300) + this.timeLeft = 300; if (flag1) this.velocity.Y += num1; } - if (this.type == 621 && Main.dayTime) - { - this.EncourageDespawn(60); - ++this.velocity.Y; - } if (Main.netMode != 1) { if (this.type == 87 && (double) this.ai[0] == 0.0) @@ -18029,7 +13046,6 @@ label_19: Main.npc[number].ai[3] = (float) this.whoAmI; Main.npc[number].realLife = this.whoAmI; Main.npc[number].ai[1] = (float) index3; - Main.npc[number].CopyInteractions(this); Main.npc[index3].ai[0] = (float) number; NetMessage.SendData(23, number: number); index3 = number; @@ -18066,7 +13082,6 @@ label_19: Main.npc[number].ai[3] = (float) this.whoAmI; Main.npc[number].realLife = this.whoAmI; Main.npc[number].ai[1] = (float) index5; - Main.npc[number].CopyInteractions(this); Main.npc[index5].ai[0] = (float) number; NetMessage.SendData(23, number: number); index5 = number; @@ -18087,7 +13102,6 @@ label_19: Main.npc[number].ai[3] = (float) this.whoAmI; Main.npc[number].realLife = this.whoAmI; Main.npc[number].ai[1] = (float) index7; - Main.npc[number].CopyInteractions(this); Main.npc[index7].ai[0] = (float) number; NetMessage.SendData(23, number: number); index7 = number; @@ -18108,33 +13122,11 @@ label_19: Main.npc[number].ai[3] = (float) this.whoAmI; Main.npc[number].realLife = this.whoAmI; Main.npc[number].ai[1] = (float) index9; - Main.npc[number].CopyInteractions(this); Main.npc[index9].ai[0] = (float) number; NetMessage.SendData(23, number: number); index9 = number; } } - if (this.type == 621 && (double) this.ai[0] == 0.0) - { - this.ai[3] = (float) this.whoAmI; - this.realLife = this.whoAmI; - int index11 = this.whoAmI; - int num4 = 16; - for (int index12 = 0; index12 < num4; ++index12) - { - int Type = 622; - if (index12 == num4 - 1) - Type = 623; - int number = NPC.NewNPC((int) ((double) this.position.X + (double) (this.width / 2)), (int) ((double) this.position.Y + (double) this.height), Type, this.whoAmI); - Main.npc[number].ai[3] = (float) this.whoAmI; - Main.npc[number].realLife = this.whoAmI; - Main.npc[number].ai[1] = (float) index11; - Main.npc[number].CopyInteractions(this); - Main.npc[index11].ai[0] = (float) number; - NetMessage.SendData(23, number: number); - index11 = number; - } - } else if ((this.type == 7 || this.type == 8 || this.type == 10 || this.type == 11 || this.type == 13 || this.type == 14 || this.type == 39 || this.type == 40 || this.type == 95 || this.type == 96 || this.type == 98 || this.type == 99 || this.type == 117 || this.type == 118) && (double) this.ai[0] == 0.0) { if (this.type == 7 || this.type == 10 || this.type == 13 || this.type == 39 || this.type == 95 || this.type == 98 || this.type == 117) @@ -18148,7 +13140,11 @@ label_19: if (this.type == 10) this.ai[2] = (float) Main.rand.Next(4, 7); if (this.type == 13) - this.ai[2] = (float) NPC.GetEaterOfWorldsSegmentsCount(); + { + this.ai[2] = (float) Main.rand.Next(45, 56); + if (Main.expertMode) + this.ai[2] = (float) (int) ((double) this.ai[2] * 1.10000002384186); + } if (this.type == 39) this.ai[2] = (float) Main.rand.Next(12, 19); if (this.type == 95) @@ -18158,18 +13154,9 @@ label_19: if (this.type == 117) this.ai[2] = (float) Main.rand.Next(3, 6); this.ai[0] = (float) NPC.NewNPC((int) ((double) this.position.X + (double) (this.width / 2)), (int) ((double) this.position.Y + (double) this.height), this.type + 1, this.whoAmI); - Main.npc[(int) this.ai[0]].CopyInteractions(this); - } - else if ((this.type == 8 || this.type == 11 || this.type == 14 || this.type == 40 || this.type == 96 || this.type == 99 || this.type == 118) && (double) this.ai[2] > 0.0) - { - this.ai[0] = (float) NPC.NewNPC((int) ((double) this.position.X + (double) (this.width / 2)), (int) ((double) this.position.Y + (double) this.height), this.type, this.whoAmI); - Main.npc[(int) this.ai[0]].CopyInteractions(this); } else - { - this.ai[0] = (float) NPC.NewNPC((int) ((double) this.position.X + (double) (this.width / 2)), (int) ((double) this.position.Y + (double) this.height), this.type + 1, this.whoAmI); - Main.npc[(int) this.ai[0]].CopyInteractions(this); - } + this.ai[0] = this.type != 8 && this.type != 11 && this.type != 14 && this.type != 40 && this.type != 96 && this.type != 99 && this.type != 118 || (double) this.ai[2] <= 0.0 ? (float) NPC.NewNPC((int) ((double) this.position.X + (double) (this.width / 2)), (int) ((double) this.position.Y + (double) this.height), this.type + 1, this.whoAmI) : (float) NPC.NewNPC((int) ((double) this.position.X + (double) (this.width / 2)), (int) ((double) this.position.Y + (double) this.height), this.type, this.whoAmI); if (this.type < 13 || this.type > 15) { Main.npc[(int) this.ai[0]].ai[3] = this.ai[3]; @@ -18183,21 +13170,20 @@ label_19: { this.ai[3] = (float) this.whoAmI; this.realLife = this.whoAmI; - int index13 = this.whoAmI; - int num5 = 30; - for (int index14 = 0; index14 < num5; ++index14) + int index11 = this.whoAmI; + int num4 = 30; + for (int index12 = 0; index12 < num4; ++index12) { int Type = 413; - if (index14 == num5 - 1) + if (index12 == num4 - 1) Type = 414; int number = NPC.NewNPC((int) ((double) this.position.X + (double) (this.width / 2)), (int) ((double) this.position.Y + (double) this.height), Type, this.whoAmI); Main.npc[number].ai[3] = (float) this.whoAmI; Main.npc[number].realLife = this.whoAmI; - Main.npc[number].ai[1] = (float) index13; - Main.npc[number].CopyInteractions(this); - Main.npc[index13].ai[0] = (float) number; + Main.npc[number].ai[1] = (float) index11; + Main.npc[index11].ai[0] = (float) number; NetMessage.SendData(23, number: number); - index13 = number; + index11 = number; } } switch (this.type) @@ -18230,8 +13216,6 @@ label_19: case 512: case 514: case 515: - case 622: - case 623: if (!Main.npc[(int) this.ai[1]].active || Main.npc[(int) this.ai[1]].aiStyle != this.aiStyle) { this.life = 0; @@ -18272,8 +13256,6 @@ label_19: case 511: case 513: case 514: - case 621: - case 622: if (!Main.npc[(int) this.ai[0]].active || Main.npc[(int) this.ai[0]].aiStyle != this.aiStyle) { this.life = 0; @@ -18314,62 +13296,57 @@ label_19: { this.type = 13; int whoAmI = this.whoAmI; - float num6 = (float) this.life / (float) this.lifeMax; - float num7 = this.ai[0]; + float num5 = (float) this.life / (float) this.lifeMax; + float num6 = this.ai[0]; this.SetDefaultsKeepPlayerInteraction(this.type); - this.life = (int) ((double) this.lifeMax * (double) num6); - this.ai[0] = num7; + this.life = (int) ((double) this.lifeMax * (double) num5); + this.ai[0] = num6; this.TargetClosest(); this.netUpdate = true; this.whoAmI = whoAmI; - this.alpha = 0; } if (this.type == 14 && (!Main.npc[(int) this.ai[0]].active || Main.npc[(int) this.ai[0]].aiStyle != this.aiStyle)) { - this.type = 15; int whoAmI = this.whoAmI; - float num8 = (float) this.life / (float) this.lifeMax; - float num9 = this.ai[1]; + float num7 = (float) this.life / (float) this.lifeMax; + float num8 = this.ai[1]; this.SetDefaultsKeepPlayerInteraction(this.type); - this.life = (int) ((double) this.lifeMax * (double) num8); - this.ai[1] = num9; + this.life = (int) ((double) this.lifeMax * (double) num7); + this.ai[1] = num8; this.TargetClosest(); this.netUpdate = true; this.whoAmI = whoAmI; - this.alpha = 0; } } if (!this.active && Main.netMode == 2) NetMessage.SendData(28, number: this.whoAmI, number2: -1f); } - int num10 = (int) ((double) this.position.X / 16.0) - 1; - int num11 = (int) (((double) this.position.X + (double) this.width) / 16.0) + 2; - int num12 = (int) ((double) this.position.Y / 16.0) - 1; - int num13 = (int) (((double) this.position.Y + (double) this.height) / 16.0) + 2; - if (num10 < 0) - num10 = 0; - if (num11 > Main.maxTilesX) - num11 = Main.maxTilesX; - if (num12 < 0) - num12 = 0; - if (num13 > Main.maxTilesY) - num13 = Main.maxTilesY; + int num9 = (int) ((double) this.position.X / 16.0) - 1; + int num10 = (int) (((double) this.position.X + (double) this.width) / 16.0) + 2; + int num11 = (int) ((double) this.position.Y / 16.0) - 1; + int num12 = (int) (((double) this.position.Y + (double) this.height) / 16.0) + 2; + if (num9 < 0) + num9 = 0; + if (num10 > Main.maxTilesX) + num10 = Main.maxTilesX; + if (num11 < 0) + num11 = 0; + if (num12 > Main.maxTilesY) + num12 = Main.maxTilesY; bool flag2 = false; if (this.type >= 87 && this.type <= 92) flag2 = true; if (this.type >= 454 && this.type <= 459) flag2 = true; - if (this.type >= 621 && this.type <= 623) - flag2 = true; if (this.type == 402 && (double) this.ai[1] == -1.0) flag2 = true; if (this.type >= 412 && this.type <= 414) flag2 = true; if (!flag2) { - for (int i = num10; i < num11; ++i) + for (int i = num9; i < num10; ++i) { - for (int j = num12; j < num13; ++j) + for (int j = num11; j < num12; ++j) { if (Main.tile[i, j] != null && (Main.tile[i, j].nactive() && (Main.tileSolid[(int) Main.tile[i, j].type] || Main.tileSolidTop[(int) Main.tile[i, j].type] && Main.tile[i, j].frameY == (short) 0) || Main.tile[i, j].liquid > (byte) 64)) { @@ -18379,23 +13356,23 @@ label_19: if ((double) this.position.X + (double) this.width > (double) vector2.X && (double) this.position.X < (double) vector2.X + 16.0 && (double) this.position.Y + (double) this.height > (double) vector2.Y && (double) this.position.Y < (double) vector2.Y + 16.0) { flag2 = true; - if (Main.rand.Next(100) == 0 && this.type != 117 && Main.tile[i, j].nactive() && Main.tileSolid[(int) Main.tile[i, j].type]) + if (Main.rand.Next(100) == 0 && this.type != 117 && Main.tile[i, j].nactive()) WorldGen.KillTile(i, j, true, true); } } } } } - if (!flag2 && (this.type == 7 || this.type == 10 || this.type == 13 || this.type == 39 || this.type == 95 || this.type == 98 || this.type == 117 || this.type == 375 || this.type == 454 || this.type == 510 || this.type == 513 || this.type == 621)) + if (!flag2 && (this.type == 7 || this.type == 10 || this.type == 13 || this.type == 39 || this.type == 95 || this.type == 98 || this.type == 117 || this.type == 375 || this.type == 454 || this.type == 510 || this.type == 513)) { Microsoft.Xna.Framework.Rectangle rectangle1 = new Microsoft.Xna.Framework.Rectangle((int) this.position.X, (int) this.position.Y, this.width, this.height); - int num14 = 1000; + int num13 = 1000; bool flag3 = true; for (int index = 0; index < (int) byte.MaxValue; ++index) { if (Main.player[index].active) { - Microsoft.Xna.Framework.Rectangle rectangle2 = new Microsoft.Xna.Framework.Rectangle((int) Main.player[index].position.X - num14, (int) Main.player[index].position.Y - num14, num14 * 2, num14 * 2); + Microsoft.Xna.Framework.Rectangle rectangle2 = new Microsoft.Xna.Framework.Rectangle((int) Main.player[index].position.X - num13, (int) Main.player[index].position.Y - num13, num13 * 2, num13 * 2); if (rectangle1.Intersects(rectangle2)) { flag3 = false; @@ -18406,7 +13383,7 @@ label_19: if (flag3) flag2 = true; } - if (this.type >= 87 && this.type <= 92 || this.type >= 454 && this.type <= 459 || this.type >= 621 && this.type <= 623) + if (this.type >= 87 && this.type <= 92 || this.type >= 454 && this.type <= 459) { if ((double) this.velocity.X < 0.0) this.spriteDirection = 1; @@ -18433,7 +13410,6 @@ label_19: } if (this.type == 412) { - this.position = this.position + this.netOffset; Vector2 vector2_1 = this.Center + (this.rotation - 1.570796f).ToRotationVector2() * 8f; Vector2 vector2_2 = this.rotation.ToRotationVector2() * 16f; Dust dust1 = Main.dust[Dust.NewDust(vector2_1 + vector2_2, 0, 0, 6, this.velocity.X, this.velocity.Y, 100, Color.Transparent, (float) (1.0 + (double) Main.rand.NextFloat() * 3.0))]; @@ -18448,153 +13424,142 @@ label_19: dust2.position -= new Vector2(4f); dust2.fadeIn = 1f; dust2.velocity = Vector2.Zero; - this.position = this.position - this.netOffset; } - float num15 = 8f; - float num16 = 0.07f; + float num14 = 8f; + float num15 = 0.07f; if (this.type == 95) { - num15 = 5.5f; - num16 = 0.045f; + num14 = 5.5f; + num15 = 0.045f; } if (this.type == 10) { - num15 = 6f; - num16 = 0.05f; + num14 = 6f; + num15 = 0.05f; } if (this.type == 513) { - num15 = 7f; - num16 = 0.1f; + num14 = 7f; + num15 = 0.1f; } if (this.type == 13) { - num15 = 10f; - num16 = 0.07f; + num14 = 10f; + num15 = 0.07f; if (Main.expertMode) { - num15 = 12f; - num16 = 0.15f; - } - if (Main.getGoodWorld) - { - num15 += 4f; - num16 += 0.05f; + num14 = 12f; + num15 = 0.15f; } } if (this.type == 510) { if (!Main.player[this.target].dead && Main.player[this.target].ZoneSandstorm) { - num15 = 16f; - num16 = 0.35f; + num14 = 16f; + num15 = 0.35f; } else { - num15 = 10f; - num16 = 0.25f; + num14 = 10f; + num15 = 0.25f; } } if (this.type == 87) { - num15 = 11f; - num16 = 0.25f; - } - if (this.type == 621) - { - num15 = 15f; - num16 = 0.45f; + num14 = 11f; + num15 = 0.25f; } if (this.type == 375) { - num15 = 6f; - num16 = 0.15f; + num14 = 6f; + num15 = 0.15f; } if (this.type == 454) { - num15 = 20f; - num16 = 0.55f; + num14 = 20f; + num15 = 0.55f; } if (this.type == 402) { - num15 = 6f; - num16 = 0.2f; + num14 = 6f; + num15 = 0.2f; } - if (this.type == 117 && Main.wofNPCIndex >= 0) + if (this.type == 117 && Main.wof >= 0) { - double num17; - if ((num17 = (double) ((float) Main.npc[Main.wofNPCIndex].life / (float) Main.npc[Main.wofNPCIndex].lifeMax)) < 0.5) + double num16; + if ((num16 = (double) ((float) Main.npc[Main.wof].life / (float) Main.npc[Main.wof].lifeMax)) < 0.5) { - ++num15; - num16 += 0.1f; + ++num14; + num15 += 0.1f; } - if (num17 < 0.25) + if (num16 < 0.25) { - ++num15; - num16 += 0.1f; + ++num14; + num15 += 0.1f; } - if (num17 < 0.1) + if (num16 < 0.1) { - num15 += 2f; - num16 += 0.1f; + num14 += 2f; + num15 += 0.1f; } } Vector2 vector2_3 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); - float num18 = Main.player[this.target].position.X + (float) (Main.player[this.target].width / 2); - float num19 = Main.player[this.target].position.Y + (float) (Main.player[this.target].height / 2); + float num17 = Main.player[this.target].position.X + (float) (Main.player[this.target].width / 2); + float num18 = Main.player[this.target].position.Y + (float) (Main.player[this.target].height / 2); if (this.type == 412) { - num15 = 10f; - num16 = 0.3f; - int num20 = -1; - int num21 = (int) ((double) Main.player[this.target].Center.X / 16.0); - int num22 = (int) ((double) Main.player[this.target].Center.Y / 16.0); - for (int i = num21 - 2; i <= num21 + 2; ++i) + num14 = 10f; + num15 = 0.3f; + int num19 = -1; + int num20 = (int) ((double) Main.player[this.target].Center.X / 16.0); + int num21 = (int) ((double) Main.player[this.target].Center.Y / 16.0); + for (int i = num20 - 2; i <= num20 + 2; ++i) { - for (int j = num22; j <= num22 + 15; ++j) + for (int j = num21; j <= num21 + 15; ++j) { if (WorldGen.SolidTile2(i, j)) { - num20 = j; + num19 = j; break; } } - if (num20 > 0) + if (num19 > 0) break; } - if (num20 > 0) + if (num19 > 0) { - num20 *= 16; - float num23 = (float) (num20 - 800); - if ((double) Main.player[this.target].position.Y > (double) num23) + num19 *= 16; + float num22 = (float) (num19 - 800); + if ((double) Main.player[this.target].position.Y > (double) num22) { - num19 = num23; + num18 = num22; if ((double) Math.Abs(this.Center.X - Main.player[this.target].Center.X) < 500.0) - num18 = (double) this.velocity.X <= 0.0 ? Main.player[this.target].Center.X - 600f : Main.player[this.target].Center.X + 600f; + num17 = (double) this.velocity.X <= 0.0 ? Main.player[this.target].Center.X - 600f : Main.player[this.target].Center.X + 600f; } } else { - num15 = 14f; - num16 = 0.5f; + num14 = 14f; + num15 = 0.5f; } - float num24 = num15 * 1.3f; - float num25 = num15 * 0.7f; - float num26 = this.velocity.Length(); - if ((double) num26 > 0.0) + float num23 = num14 * 1.3f; + float num24 = num14 * 0.7f; + float num25 = this.velocity.Length(); + if ((double) num25 > 0.0) { - if ((double) num26 > (double) num24) + if ((double) num25 > (double) num23) + { + this.velocity.Normalize(); + this.velocity = this.velocity * num23; + } + else if ((double) num25 < (double) num24) { this.velocity.Normalize(); this.velocity = this.velocity * num24; } - else if ((double) num26 < (double) num25) - { - this.velocity.Normalize(); - this.velocity = this.velocity * num25; - } } - if (num20 > 0) + if (num19 > 0) { for (int index = 0; index < 200; ++index) { @@ -18605,8 +13570,8 @@ label_19: { vector2_4.Normalize(); Vector2 vector2_5 = vector2_4 * 1000f; - num18 -= vector2_5.X; - num19 -= vector2_5.Y; + num17 -= vector2_5.X; + num18 -= vector2_5.Y; } } } @@ -18622,25 +13587,25 @@ label_19: { vector2_6.Normalize(); Vector2 vector2_7 = vector2_6 * 200f; - num18 -= vector2_7.X; - num19 -= vector2_7.Y; + num17 -= vector2_7.X; + num18 -= vector2_7.Y; } } } } } + float num26 = (float) ((int) ((double) num17 / 16.0) * 16); float num27 = (float) ((int) ((double) num18 / 16.0) * 16); - float num28 = (float) ((int) ((double) num19 / 16.0) * 16); vector2_3.X = (float) ((int) ((double) vector2_3.X / 16.0) * 16); vector2_3.Y = (float) ((int) ((double) vector2_3.Y / 16.0) * 16); - float num29 = num27 - vector2_3.X; - float num30 = num28 - vector2_3.Y; + float num28 = num26 - vector2_3.X; + float num29 = num27 - vector2_3.Y; if (this.type == 375) { + num28 *= -1f; num29 *= -1f; - num30 *= -1f; } - float num31 = (float) Math.Sqrt((double) num29 * (double) num29 + (double) num30 * (double) num30); + float num30 = (float) Math.Sqrt((double) num28 * (double) num28 + (double) num29 * (double) num29); if ((double) this.ai[1] > 0.0) { if ((double) this.ai[1] < (double) Main.npc.Length) @@ -18648,114 +13613,95 @@ label_19: try { vector2_3 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); - num29 = Main.npc[(int) this.ai[1]].position.X + (float) (Main.npc[(int) this.ai[1]].width / 2) - vector2_3.X; - num30 = Main.npc[(int) this.ai[1]].position.Y + (float) (Main.npc[(int) this.ai[1]].height / 2) - vector2_3.Y; + num28 = Main.npc[(int) this.ai[1]].position.X + (float) (Main.npc[(int) this.ai[1]].width / 2) - vector2_3.X; + num29 = Main.npc[(int) this.ai[1]].position.Y + (float) (Main.npc[(int) this.ai[1]].height / 2) - vector2_3.Y; } catch { } - this.rotation = (float) Math.Atan2((double) num30, (double) num29) + 1.57f; - float num32 = (float) Math.Sqrt((double) num29 * (double) num29 + (double) num30 * (double) num30); - int num33 = this.width; + this.rotation = (float) Math.Atan2((double) num29, (double) num28) + 1.57f; + float num31 = (float) Math.Sqrt((double) num28 * (double) num28 + (double) num29 * (double) num29); + int num32 = this.width; if (this.type >= 87 && this.type <= 92) - num33 = 42; + num32 = 42; if (this.type >= 454 && this.type <= 459) - num33 = 36; + num32 = 36; if (this.type >= 13 && this.type <= 15) - num33 = (int) ((double) num33 * (double) this.scale); - if (this.type >= 513 && this.type <= 515) - num33 -= 6; + num32 = (int) ((double) num32 * (double) this.scale); if (this.type >= 412 && this.type <= 414) - num33 += 6; - if (this.type >= 621 && this.type <= 623) - num33 = 24; - if (Main.getGoodWorld && this.type >= 13 && this.type <= 15) - num33 = 62; - float num34 = (num32 - (float) num33) / num32; - float num35 = num29 * num34; - float num36 = num30 * num34; + num32 += 6; + float num33 = (num31 - (float) num32) / num31; + float num34 = num28 * num33; + float num35 = num29 * num33; this.velocity = Vector2.Zero; - this.position.X += num35; - this.position.Y += num36; + this.position.X += num34; + this.position.Y += num35; if (this.type >= 87 && this.type <= 92) { - if ((double) num35 < 0.0) + if ((double) num34 < 0.0) this.spriteDirection = 1; - else if ((double) num35 > 0.0) + else if ((double) num34 > 0.0) this.spriteDirection = -1; } - if (this.type >= 454 && this.type <= 459) + if (this.type < 454 || this.type > 459) + return; + if ((double) num34 < 0.0) { - if ((double) num35 < 0.0) - this.spriteDirection = 1; - else if ((double) num35 > 0.0) - this.spriteDirection = -1; + this.spriteDirection = 1; + return; } - if (this.type >= 621 && this.type <= 623) - { - if ((double) num35 < 0.0) - { - this.spriteDirection = 1; - goto label_422; - } - else if ((double) num35 > 0.0) - { - this.spriteDirection = -1; - goto label_422; - } - else - goto label_422; - } - else - goto label_422; + if ((double) num34 <= 0.0) + return; + this.spriteDirection = -1; + return; } } if (!flag2) { this.TargetClosest(); this.velocity.Y += 0.11f; - if ((double) this.velocity.Y > (double) num15) - this.velocity.Y = num15; - if ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) < (double) num15 * 0.4) + if ((double) this.velocity.Y > (double) num14) + this.velocity.Y = num14; + if ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) < (double) num14 * 0.4) { if ((double) this.velocity.X < 0.0) - this.velocity.X -= num16 * 1.1f; + this.velocity.X -= num15 * 1.1f; else - this.velocity.X += num16 * 1.1f; + this.velocity.X += num15 * 1.1f; } - else if ((double) this.velocity.Y == (double) num15) + else if ((double) this.velocity.Y == (double) num14) { - if ((double) this.velocity.X < (double) num29) - this.velocity.X += num16; - else if ((double) this.velocity.X > (double) num29) - this.velocity.X -= num16; + if ((double) this.velocity.X < (double) num28) + this.velocity.X += num15; + else if ((double) this.velocity.X > (double) num28) + this.velocity.X -= num15; } else if ((double) this.velocity.Y > 4.0) { if ((double) this.velocity.X < 0.0) - this.velocity.X += num16 * 0.9f; + this.velocity.X += num15 * 0.9f; else - this.velocity.X -= num16 * 0.9f; + this.velocity.X -= num15 * 0.9f; } } else { - if (this.type != 621 && this.type != 87 && this.type != 117 && this.type != 454 && this.type != 412 && this.soundDelay == 0) + if (this.type != 87 && this.type != 117 && this.type != 454 && this.type != 412 && this.soundDelay == 0) { - float num37 = num31 / 40f; - if ((double) num37 < 10.0) - num37 = 10f; - if ((double) num37 > 20.0) - num37 = 20f; - this.soundDelay = (int) num37; - SoundEngine.PlaySound(15, (int) this.position.X, (int) this.position.Y); + float num36 = num30 / 40f; + if ((double) num36 < 10.0) + num36 = 10f; + if ((double) num36 > 20.0) + num36 = 20f; + this.soundDelay = (int) num36; + Main.PlaySound(15, (int) this.position.X, (int) this.position.Y); } - float num38 = (float) Math.Sqrt((double) num29 * (double) num29 + (double) num30 * (double) num30); + float num37 = (float) Math.Sqrt((double) num28 * (double) num28 + (double) num29 * (double) num29); + float num38 = Math.Abs(num28); float num39 = Math.Abs(num29); - float num40 = Math.Abs(num30); - float num41 = num15 / num38; - float num42 = num29 * num41; - float num43 = num30 * num41; + float num40 = num14 / num37; + float num41 = num28 * num40; + float num42 = num29 * num40; bool flag4 = false; if ((this.type == 7 || this.type == 13) && (!Main.player[this.target].ZoneCorrupt && !Main.player[this.target].ZoneCrimson || Main.player[this.target].dead)) flag4 = true; @@ -18776,10 +13722,10 @@ label_19: if (Main.netMode != 1 && (double) this.position.Y / 16.0 > (Main.rockLayer + (double) Main.maxTilesY) / 2.0) { this.active = false; - int num44; - for (int number = (int) this.ai[0]; number > 0 && number < 200 && Main.npc[number].active && Main.npc[number].aiStyle == this.aiStyle; number = num44) + int num43; + for (int number = (int) this.ai[0]; number > 0 && number < 200 && Main.npc[number].active && Main.npc[number].aiStyle == this.aiStyle; number = num43) { - num44 = (int) Main.npc[number].ai[0]; + num43 = (int) Main.npc[number].ai[0]; Main.npc[number].active = false; this.life = 0; if (Main.netMode == 2) @@ -18788,115 +13734,112 @@ label_19: if (Main.netMode == 2) NetMessage.SendData(23, number: this.whoAmI); } - num42 = 0.0f; - num43 = num15; + num41 = 0.0f; + num42 = num14; } } bool flag6 = false; if (this.type == 87) { - if (((double) this.velocity.X > 0.0 && (double) num42 < 0.0 || (double) this.velocity.X < 0.0 && (double) num42 > 0.0 || (double) this.velocity.Y > 0.0 && (double) num43 < 0.0 || (double) this.velocity.Y < 0.0 && (double) num43 > 0.0) && (double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) > (double) num16 / 2.0 && (double) num38 < 300.0) + if (((double) this.velocity.X > 0.0 && (double) num41 < 0.0 || (double) this.velocity.X < 0.0 && (double) num41 > 0.0 || (double) this.velocity.Y > 0.0 && (double) num42 < 0.0 || (double) this.velocity.Y < 0.0 && (double) num42 > 0.0) && (double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) > (double) num15 / 2.0 && (double) num37 < 300.0) { flag6 = true; - if ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) < (double) num15) + if ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) < (double) num14) this.velocity = this.velocity * 1.1f; } if ((double) this.position.Y > (double) Main.player[this.target].position.Y || (double) Main.player[this.target].position.Y / 16.0 > Main.worldSurface || Main.player[this.target].dead) { flag6 = true; - if ((double) Math.Abs(this.velocity.X) < (double) num15 / 2.0) + if ((double) Math.Abs(this.velocity.X) < (double) num14 / 2.0) { if ((double) this.velocity.X == 0.0) this.velocity.X -= (float) this.direction; this.velocity.X *= 1.1f; } - else if ((double) this.velocity.Y > -(double) num15) - this.velocity.Y -= num16; + else if ((double) this.velocity.Y > -(double) num14) + this.velocity.Y -= num15; } } - if (this.type == 454 || this.type == 621) + if (this.type == 454) { - float num45 = 300f; - if (this.type == 621) - num45 = 120f; - if (((double) this.velocity.X > 0.0 && (double) num42 < 0.0 || (double) this.velocity.X < 0.0 && (double) num42 > 0.0 || (double) this.velocity.Y > 0.0 && (double) num43 < 0.0 || (double) this.velocity.Y < 0.0 && (double) num43 > 0.0) && (double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) > (double) num16 / 2.0 && (double) num38 < (double) num45) + if (((double) this.velocity.X > 0.0 && (double) num41 < 0.0 || (double) this.velocity.X < 0.0 && (double) num41 > 0.0 || (double) this.velocity.Y > 0.0 && (double) num42 < 0.0 || (double) this.velocity.Y < 0.0 && (double) num42 > 0.0) && (double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) > (double) num15 / 2.0 && (double) num37 < 300.0) { flag6 = true; - if ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) < (double) num15) + if ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) < (double) num14) this.velocity = this.velocity * 1.1f; } if ((double) this.position.Y > (double) Main.player[this.target].position.Y || Main.player[this.target].dead) { flag6 = true; - if ((double) Math.Abs(this.velocity.X) < (double) num15 / 2.0) + if ((double) Math.Abs(this.velocity.X) < (double) num14 / 2.0) { if ((double) this.velocity.X == 0.0) this.velocity.X -= (float) this.direction; this.velocity.X *= 1.1f; } - else if ((double) this.velocity.Y > -(double) num15) - this.velocity.Y -= num16; + else if ((double) this.velocity.Y > -(double) num14) + this.velocity.Y -= num15; } } if (!flag6) { - if ((double) this.velocity.X > 0.0 && (double) num42 > 0.0 || (double) this.velocity.X < 0.0 && (double) num42 < 0.0 || (double) this.velocity.Y > 0.0 && (double) num43 > 0.0 || (double) this.velocity.Y < 0.0 && (double) num43 < 0.0) + if ((double) this.velocity.X > 0.0 && (double) num41 > 0.0 || (double) this.velocity.X < 0.0 && (double) num41 < 0.0 || (double) this.velocity.Y > 0.0 && (double) num42 > 0.0 || (double) this.velocity.Y < 0.0 && (double) num42 < 0.0) { - if ((double) this.velocity.X < (double) num42) - this.velocity.X += num16; - else if ((double) this.velocity.X > (double) num42) - this.velocity.X -= num16; - if ((double) this.velocity.Y < (double) num43) - this.velocity.Y += num16; - else if ((double) this.velocity.Y > (double) num43) - this.velocity.Y -= num16; - if ((double) Math.Abs(num43) < (double) num15 * 0.2 && ((double) this.velocity.X > 0.0 && (double) num42 < 0.0 || (double) this.velocity.X < 0.0 && (double) num42 > 0.0)) + if ((double) this.velocity.X < (double) num41) + this.velocity.X += num15; + else if ((double) this.velocity.X > (double) num41) + this.velocity.X -= num15; + if ((double) this.velocity.Y < (double) num42) + this.velocity.Y += num15; + else if ((double) this.velocity.Y > (double) num42) + this.velocity.Y -= num15; + if ((double) Math.Abs(num42) < (double) num14 * 0.2 && ((double) this.velocity.X > 0.0 && (double) num41 < 0.0 || (double) this.velocity.X < 0.0 && (double) num41 > 0.0)) { if ((double) this.velocity.Y > 0.0) - this.velocity.Y += num16 * 2f; + this.velocity.Y += num15 * 2f; else - this.velocity.Y -= num16 * 2f; + this.velocity.Y -= num15 * 2f; } - if ((double) Math.Abs(num42) < (double) num15 * 0.2 && ((double) this.velocity.Y > 0.0 && (double) num43 < 0.0 || (double) this.velocity.Y < 0.0 && (double) num43 > 0.0)) + if ((double) Math.Abs(num41) < (double) num14 * 0.2 && ((double) this.velocity.Y > 0.0 && (double) num42 < 0.0 || (double) this.velocity.Y < 0.0 && (double) num42 > 0.0)) { if ((double) this.velocity.X > 0.0) - this.velocity.X += num16 * 2f; + this.velocity.X += num15 * 2f; else - this.velocity.X -= num16 * 2f; + this.velocity.X -= num15 * 2f; } } - else if ((double) num39 > (double) num40) + else if ((double) num38 > (double) num39) { - if ((double) this.velocity.X < (double) num42) - this.velocity.X += num16 * 1.1f; - else if ((double) this.velocity.X > (double) num42) - this.velocity.X -= num16 * 1.1f; - if ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) < (double) num15 * 0.5) + if ((double) this.velocity.X < (double) num41) + this.velocity.X += num15 * 1.1f; + else if ((double) this.velocity.X > (double) num41) + this.velocity.X -= num15 * 1.1f; + if ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) < (double) num14 * 0.5) { if ((double) this.velocity.Y > 0.0) - this.velocity.Y += num16; + this.velocity.Y += num15; else - this.velocity.Y -= num16; + this.velocity.Y -= num15; } } else { - if ((double) this.velocity.Y < (double) num43) - this.velocity.Y += num16 * 1.1f; - else if ((double) this.velocity.Y > (double) num43) - this.velocity.Y -= num16 * 1.1f; - if ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) < (double) num15 * 0.5) + if ((double) this.velocity.Y < (double) num42) + this.velocity.Y += num15 * 1.1f; + else if ((double) this.velocity.Y > (double) num42) + this.velocity.Y -= num15 * 1.1f; + if ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) < (double) num14 * 0.5) { if ((double) this.velocity.X > 0.0) - this.velocity.X += num16; + this.velocity.X += num15; else - this.velocity.X -= num16; + this.velocity.X -= num15; } } } } this.rotation = (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X) + 1.57f; - if (this.type == 7 || this.type == 10 || this.type == 13 || this.type == 39 || this.type == 95 || this.type == 98 || this.type == 117 || this.type == 510 || this.type == 513 || this.type == 621) + if (this.type == 7 || this.type == 10 || this.type == 13 || this.type == 39 || this.type == 95 || this.type == 98 || this.type == 117 || this.type == 510 || this.type == 513) { if (flag2) { @@ -18913,45 +13856,27 @@ label_19: if (((double) this.velocity.X > 0.0 && (double) this.oldVelocity.X < 0.0 || (double) this.velocity.X < 0.0 && (double) this.oldVelocity.X > 0.0 || (double) this.velocity.Y > 0.0 && (double) this.oldVelocity.Y < 0.0 || (double) this.velocity.Y < 0.0 && (double) this.oldVelocity.Y > 0.0) && !this.justHit) this.netUpdate = true; } - if (this.type == 454) - { - float num46 = Vector2.Distance(Main.player[this.target].Center, this.Center); - int num47 = 0; - if ((double) Vector2.Normalize(Main.player[this.target].Center - this.Center).ToRotation().AngleTowards(this.velocity.ToRotation(), 1.570796f) == (double) this.velocity.ToRotation() && (double) num46 < 350.0) - num47 = 4; - if ((double) num47 > this.frameCounter) - ++this.frameCounter; - if ((double) num47 < this.frameCounter) - --this.frameCounter; - if (this.frameCounter < 0.0) - this.frameCounter = 0.0; - if (this.frameCounter > 4.0) - this.frameCounter = 4.0; - } -label_422: - if (this.type < 13 || this.type > 15 || this.type != 13 && (this.type == 13 || Main.npc[(int) this.ai[1]].alpha >= 85)) + if (this.type != 454) return; - if (this.alpha > 0 && this.life > 0) - { - for (int index15 = 0; index15 < 2; ++index15) - { - int index16 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 14, Alpha: 100, Scale: 2f); - Main.dust[index16].noGravity = true; - Main.dust[index16].noLight = true; - } - } - if ((double) (this.position - this.oldPosition).Length() <= 2.0) + float num44 = Vector2.Distance(Main.player[this.target].Center, this.Center); + int num45 = 0; + if ((double) Vector2.Normalize(Main.player[this.target].Center - this.Center).ToRotation().AngleTowards(this.velocity.ToRotation(), 1.570796f) == (double) this.velocity.ToRotation() && (double) num44 < 350.0) + num45 = 4; + if ((double) num45 > this.frameCounter) + ++this.frameCounter; + if ((double) num45 < this.frameCounter) + --this.frameCounter; + if (this.frameCounter < 0.0) + this.frameCounter = 0.0; + if (this.frameCounter <= 4.0) return; - this.alpha -= 42; - if (this.alpha >= 0) - return; - this.alpha = 0; + this.frameCounter = 4.0; } private void AI_002_FloatingEye() { if ((this.type == 170 || this.type == 171 || this.type == 180) && Main.rand.Next(1000) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, 9); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, 9); this.noGravity = true; if (!this.noTileCollide) { @@ -18972,9 +13897,10 @@ label_422: this.velocity.Y = -1f; } } - if (NPC.DespawnEncouragement_AIStyle2_FloatingEye_IsDiscouraged(this.type, this.position, this.target)) + if (Main.dayTime && (double) this.position.Y <= Main.worldSurface * 16.0 && (this.type == 2 || this.type == 133 || this.type == 190 || this.type == 191 || this.type == 192 || this.type == 193 || this.type == 194 || this.type == 317 || this.type == 318)) { - this.EncourageDespawn(10); + if (this.timeLeft > 10) + this.timeLeft = 10; this.directionY = -1; if ((double) this.velocity.Y > 0.0) this.direction = 1; @@ -19103,11 +14029,9 @@ label_422: } if (Main.rand.Next(40) == 0) { - this.position = this.position + this.netOffset; int index = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float) this.height * 0.25f), this.width, (int) ((double) this.height * 0.5), 5, this.velocity.X, 2f); Main.dust[index].velocity.X *= 0.5f; Main.dust[index].velocity.Y *= 0.1f; - this.position = this.position - this.netOffset; } } else if (this.type == 133) @@ -19248,11 +14172,9 @@ label_422: } if ((this.type == 2 || this.type == 133 || this.type == 190 || this.type == 191 || this.type == 192 || this.type == 193 || this.type == 194) && Main.rand.Next(40) == 0) { - this.position = this.position + this.netOffset; int index = Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float) this.height * 0.25f), this.width, (int) ((double) this.height * 0.5), 5, this.velocity.X, 2f); Main.dust[index].velocity.X *= 0.5f; Main.dust[index].velocity.Y *= 0.1f; - this.position = this.position - this.netOffset; } if (!this.wet || this.type == 170 || this.type == 171 || this.type == 172) return; @@ -19264,101 +14186,9 @@ label_422: this.TargetClosest(); } - public static bool DespawnEncouragement_AIStyle2_FloatingEye_IsDiscouraged( - int npcID, - Vector2 npcPosition, - int target = 255) - { - if (Main.player[target].ZoneGraveyard || !Main.dayTime || (double) npcPosition.Y > Main.worldSurface * 16.0) - return false; - return npcID == 2 || npcID == 133 || npcID == 190 || npcID == 191 || npcID == 192 || npcID == 193 || npcID == 194 || npcID == 317 || npcID == 318; - } - - private bool AI_007_TownEntities_IsInAGoodRestingSpot( - int tileX, - int tileY, - int idealRestX, - int idealRestY) - { - return !Main.dayTime && (double) this.ai[0] == 5.0 ? Math.Abs(tileX - idealRestX) < 7 && Math.Abs(tileY - idealRestY) < 7 : (this.type != 361 && this.type != 445 || !this.wet) && tileX == idealRestX && tileY == idealRestY; - } - - private void AI_007_FindGoodRestingSpot( - int myTileX, - int myTileY, - out int floorX, - out int floorY) - { - floorX = this.homeTileX; - floorY = this.homeTileY; - if (floorX == -1 || floorY == -1) - return; - while (!WorldGen.SolidOrSlopedTile(floorX, floorY) && floorY < Main.maxTilesY - 20) - ++floorY; - if (Main.dayTime || (double) this.ai[0] == 5.0 && Math.Abs(myTileX - floorX) < 7 && Math.Abs(myTileY - floorY) < 7) - return; - Point point1 = new Point(floorX, floorY); - Point point2 = new Point(-1, -1); - int num1 = -1; - int num2 = 7; - int num3 = 6; - int num4 = 2; - int num5 = 1; - int num6 = 2; - for (int index1 = point1.X - num2; index1 <= point1.X + num2; index1 += num5) - { - for (int index2 = point1.Y + num4; index2 >= point1.Y - num3; index2 -= num6) - { - Tile tile = Main.tile[index1, index2]; - if (tile != null && tile.active() && (!TileID.Sets.CanBeSatOnForNPCs[(int) tile.type] || (int) tile.frameY % 40 != 0 || index2 + 1 <= point1.Y + num4)) - { - int num7 = Math.Abs(index1 - point1.X) + Math.Abs(index2 - point1.Y); - if (num1 == -1 || num7 < num1) - { - num1 = num7; - point2.X = index1; - point2.Y = index2; - } - } - } - } - if (num1 == -1) - return; - Tile tile1 = Main.tile[point2.X, point2.Y]; - if (tile1.type == (ushort) 497 || tile1.type == (ushort) 15) - { - if ((int) tile1.frameY % 40 != 0) - --point2.Y; - point2.Y += 2; - } - floorX = point2.X; - floorY = point2.Y; - } - - private void AI_007_TryForcingSitting(int homeFloorX, int homeFloorY) - { - Tile tile = Main.tile[homeFloorX, homeFloorY - 1]; - bool flag = this.type != 638 && this.type != 656 && (double) this.ai[0] != 5.0; - if (flag) - flag = ((flag ? 1 : 0) & (tile == null || !tile.active() ? 0 : (tile.type == (ushort) 15 ? 1 : (tile.type == (ushort) 497 ? 1 : 0)))) != 0; - if (flag) - flag = ((flag ? 1 : 0) & (tile.type != (ushort) 15 ? 1 : (tile.frameY != (short) 1080 ? 1 : 0))) != 0; - if (!flag) - return; - this.ai[0] = 5f; - this.ai[1] = (float) (900 + Main.rand.Next(10800)); - this.direction = tile.frameX == (short) 0 ? -1 : 1; - this.Bottom = new Vector2((float) (homeFloorX * 16 + 8 + 2 * this.direction), (float) (homeFloorY * 16)); - this.velocity = Vector2.Zero; - this.localAI[3] = 0.0f; - this.netUpdate = true; - } - private void AI_007_TownEntities() { int maxValue1 = 300; - if (this.type == 638 || this.type == 656) - maxValue1 = 0; bool flag1 = Main.raining; if (!Main.dayTime) flag1 = true; @@ -19367,14 +14197,9 @@ label_422: if (Main.slimeRain) flag1 = true; float num1 = 1f; - this.defense = !Main.masterMode ? (!Main.expertMode ? (this.dryadWard ? this.defDefense + 6 : this.defDefense) : (this.dryadWard ? this.defDefense + 10 : this.defDefense)) : (this.dryadWard ? this.defDefense + 14 : this.defDefense); - if (this.isLikeATownNPC) + this.defense = !Main.expertMode ? (this.dryadWard ? this.defDefense + 6 : this.defDefense) : (this.dryadWard ? this.defDefense + 10 : this.defDefense); + if (this.townNPC || this.type == 453) { - if (NPC.combatBookWasUsed) - { - num1 += 0.2f; - this.defense += 6; - } if (NPC.downedBoss1) { num1 += 0.1f; @@ -19400,11 +14225,6 @@ label_422: num1 += 0.4f; this.defense += 12; } - if (NPC.downedQueenSlime) - { - num1 += 0.15f; - this.defense += 6; - } if (NPC.downedMechBoss1) { num1 += 0.15f; @@ -19425,11 +14245,6 @@ label_422: num1 += 0.15f; this.defense += 8; } - if (NPC.downedQueenSlime) - { - num1 += 0.15f; - this.defense += 8; - } if (NPC.downedGolemBoss) { num1 += 0.15f; @@ -19451,17 +14266,18 @@ label_422: this.localAI[0] = (float) Main.rand.Next(1, 5); if (this.type == 124) { - int projectileSearch = NPC.lazyNPCOwnedProjectileSearchArray[this.whoAmI]; bool flag2 = false; - if (Main.projectile.IndexInRange(projectileSearch)) + for (int index = 0; index < 1000; ++index) { - Projectile projectile = Main.projectile[projectileSearch]; - if (projectile.active && projectile.type == 582 && (double) projectile.ai[1] == (double) this.whoAmI) + if (Main.projectile[index].active && Main.projectile[index].type == 582 && (double) Main.projectile[index].ai[1] == (double) this.whoAmI) + { flag2 = true; + break; + } } this.localAI[0] = (float) flag2.ToInt(); } - if ((this.type == 362 || this.type == 364 || this.type == 602 || this.type == 608) && Main.netMode != 1 && ((double) this.velocity.Y > 4.0 || (double) this.velocity.Y < -4.0 || this.wet)) + if ((this.type == 362 || this.type == 364) && Main.netMode != 1 && ((double) this.velocity.Y > 4.0 || (double) this.velocity.Y < -4.0 || this.wet)) { int direction = this.direction; this.Transform(this.type + 1); @@ -19494,11 +14310,8 @@ label_422: case 550: NPC.savedBartender = true; break; - case 588: - NPC.savedGolfer = true; - break; } - if (this.type >= 0 && this.type < 663 && NPCID.Sets.TownCritter[this.type] && this.target == (int) byte.MaxValue) + if (this.type >= 0 && this.type < 580 && NPCID.Sets.TownCritter[this.type] && this.target == (int) byte.MaxValue) { this.TargetClosest(); if ((double) this.position.X < (double) Main.player[this.target].position.X) @@ -19520,19 +14333,15 @@ label_422: this.homeTileY = (int) ((double) this.position.Y + (double) this.height + 4.0) / 16; } bool flag3 = false; - int index1 = (int) ((double) this.position.X + (double) (this.width / 2)) / 16; - int index2 = (int) ((double) this.position.Y + (double) this.height + 1.0) / 16; - int floorX; - int floorY; - this.AI_007_FindGoodRestingSpot(index1, index2, out floorX, out floorY); + int homeTileY = this.homeTileY; if (this.type == 441) NPC.taxCollector = true; this.directionY = -1; if (this.direction == 0) this.direction = 1; - for (int index3 = 0; index3 < (int) byte.MaxValue; ++index3) + for (int index = 0; index < (int) byte.MaxValue; ++index) { - if (Main.player[index3].active && Main.player[index3].talkNPC == this.whoAmI) + if (Main.player[index].active && Main.player[index].talkNPC == this.whoAmI) { flag3 = true; if ((double) this.ai[0] != 0.0) @@ -19540,7 +14349,7 @@ label_422: this.ai[0] = 0.0f; this.ai[1] = 300f; this.localAI[3] = 100f; - if ((double) Main.player[index3].position.X + (double) (Main.player[index3].width / 2) < (double) this.position.X + (double) (this.width / 2)) + if ((double) Main.player[index].position.X + (double) (Main.player[index].width / 2) < (double) this.position.X + (double) (this.width / 2)) this.direction = -1; else this.direction = 1; @@ -19554,7 +14363,7 @@ label_422: this.netUpdate = true; if (this.type != 37) return; - SoundEngine.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); + Main.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); } else { @@ -19569,6 +14378,11 @@ label_422: this.netUpdate = true; } } + if (Main.netMode != 1 && this.homeTileY > 0) + { + while (!WorldGen.SolidTile(this.homeTileX, homeTileY) && homeTileY < Main.maxTilesY - 20) + ++homeTileY; + } if (this.type == 368) { this.homeless = true; @@ -19593,40 +14407,43 @@ label_422: this.ai[0] = 1f; this.ai[1] = 200f; } - if ((double) this.position.X / 16.0 < 300.0) + if ((double) this.position.X / 16.0 < 200.0) this.direction = 1; - else if ((double) this.position.X / 16.0 > (double) (Main.maxTilesX - 300)) + else if ((double) this.position.X / 16.0 > (double) (Main.maxTilesX - 200)) this.direction = -1; } - if (!WorldGen.InWorld(index1, index2) || Main.tile[index1, index2] == null) + int x = (int) ((double) this.position.X + (double) (this.width / 2)) / 16; + int y = (int) ((double) this.position.Y + (double) this.height + 1.0) / 16; + if (!WorldGen.InWorld(x, y) || Main.tile[x, y] == null) return; - if (!this.homeless && Main.netMode != 1 && this.townNPC && (flag1 || Main.tileDungeon[(int) Main.tile[index1, index2].type]) && !this.AI_007_TownEntities_IsInAGoodRestingSpot(index1, index2, floorX, floorY)) + if (!this.homeless && Main.netMode != 1 && this.townNPC && (flag1 || Main.tileDungeon[(int) Main.tile[x, y].type]) && (x != this.homeTileX || y != homeTileY)) { bool flag4 = true; - for (int index4 = 0; index4 < 2 && flag4; ++index4) + for (int index1 = 0; index1 < 2; ++index1) { Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle((int) ((double) this.position.X + (double) (this.width / 2) - (double) (NPC.sWidth / 2) - (double) NPC.safeRangeX), (int) ((double) this.position.Y + (double) (this.height / 2) - (double) (NPC.sHeight / 2) - (double) NPC.safeRangeY), NPC.sWidth + NPC.safeRangeX * 2, NPC.sHeight + NPC.safeRangeY * 2); - if (index4 == 1) - rectangle = new Microsoft.Xna.Framework.Rectangle(floorX * 16 + 8 - NPC.sWidth / 2 - NPC.safeRangeX, floorY * 16 + 8 - NPC.sHeight / 2 - NPC.safeRangeY, NPC.sWidth + NPC.safeRangeX * 2, NPC.sHeight + NPC.safeRangeY * 2); - for (int index5 = 0; index5 < (int) byte.MaxValue; ++index5) + if (index1 == 1) + rectangle = new Microsoft.Xna.Framework.Rectangle(this.homeTileX * 16 + 8 - NPC.sWidth / 2 - NPC.safeRangeX, homeTileY * 16 + 8 - NPC.sHeight / 2 - NPC.safeRangeY, NPC.sWidth + NPC.safeRangeX * 2, NPC.sHeight + NPC.safeRangeY * 2); + for (int index2 = 0; index2 < (int) byte.MaxValue; ++index2) { - if (Main.player[index5].active && new Microsoft.Xna.Framework.Rectangle((int) Main.player[index5].position.X, (int) Main.player[index5].position.Y, Main.player[index5].width, Main.player[index5].height).Intersects(rectangle)) + if (Main.player[index2].active && new Microsoft.Xna.Framework.Rectangle((int) Main.player[index2].position.X, (int) Main.player[index2].position.Y, Main.player[index2].width, Main.player[index2].height).Intersects(rectangle)) { flag4 = false; break; } + if (!flag4) + break; } } if (flag4) { - if (this.type == 37 || !Collision.SolidTiles(floorX - 1, floorX + 1, floorY - 3, floorY - 1)) + if (this.type == 37 || !Collision.SolidTiles(this.homeTileX - 1, this.homeTileX + 1, homeTileY - 3, homeTileY - 1)) { this.velocity.X = 0.0f; this.velocity.Y = 0.0f; - this.position.X = (float) (floorX * 16 + 8 - this.width / 2); - this.position.Y = (float) (floorY * 16 - this.height) - 0.1f; + this.position.X = (float) (this.homeTileX * 16 + 8 - this.width / 2); + this.position.Y = (float) (homeTileY * 16 - this.height) - 0.1f; this.netUpdate = true; - this.AI_007_TryForcingSitting(floorX, floorY); } else { @@ -19635,69 +14452,48 @@ label_422: } } } - bool flag5 = this.type == 300 || this.type == 447 || this.type == 610; - bool flag6 = this.type == 616 || this.type == 617 || this.type == 625; - bool flag7 = this.type == 361 || this.type == 445; - bool canBreathUnderWater = flag6 | flag7; - int num2 = NPCID.Sets.IsTownPet[this.type] ? 1 : 0; - bool flag8 = flag6 | flag7; - float num3 = 200f; + bool flag5 = this.type == 300 || this.type == 447; + float num2 = 200f; if (NPCID.Sets.DangerDetectRange[this.type] != -1) - num3 = (float) NPCID.Sets.DangerDetectRange[this.type]; - bool flag9 = false; - bool flag10 = false; + num2 = (float) NPCID.Sets.DangerDetectRange[this.type]; + bool flag6 = false; + bool flag7 = false; + float num3 = -1f; float num4 = -1f; - float num5 = -1f; - int num6 = 0; - int index6 = -1; - int index7 = -1; - if (!flag6 && Main.netMode != 1 && !flag3) + int num5 = 0; + int index3 = -1; + int index4 = -1; + if (Main.netMode != 1 && !flag3) { - for (int index8 = 0; index8 < 200; ++index8) + for (int index5 = 0; index5 < 200; ++index5) { - if (Main.npc[index8].active && !Main.npc[index8].friendly && Main.npc[index8].damage > 0 && (double) Main.npc[index8].Distance(this.Center) < (double) num3 && (this.type != 453 || !NPCID.Sets.Skeletons[Main.npc[index8].type]) && (Main.npc[index8].noTileCollide || Collision.CanHit(this.Center, 0, 0, Main.npc[index8].Center, 0, 0))) + if (Main.npc[index5].active && !Main.npc[index5].friendly && Main.npc[index5].damage > 0 && (double) Main.npc[index5].Distance(this.Center) < (double) num2 && (this.type != 453 || !NPCID.Sets.Skeletons.Contains(Main.npc[index5].netID))) { - flag9 = true; - float num7 = Main.npc[index8].Center.X - this.Center.X; - if (this.type == 614) + flag6 = true; + float num6 = Main.npc[index5].Center.X - this.Center.X; + if ((double) num6 < 0.0 && ((double) num3 == -1.0 || (double) num6 > (double) num3)) { - if ((double) num7 < 0.0 && ((double) num4 == -1.0 || (double) num7 > (double) num4)) - { - num5 = num7; - index7 = index8; - } - if ((double) num7 > 0.0 && ((double) num5 == -1.0 || (double) num7 < (double) num5)) - { - num4 = num7; - index6 = index8; - } + num3 = num6; + index3 = index5; } - else + if ((double) num6 > 0.0 && ((double) num4 == -1.0 || (double) num6 < (double) num4)) { - if ((double) num7 < 0.0 && ((double) num4 == -1.0 || (double) num7 > (double) num4)) - { - num4 = num7; - index6 = index8; - } - if ((double) num7 > 0.0 && ((double) num5 == -1.0 || (double) num7 < (double) num5)) - { - num5 = num7; - index7 = index8; - } + num4 = num6; + index4 = index5; } } } - if (flag9) + if (flag6) { - num6 = (double) num4 != -1.0 ? ((double) num5 != -1.0 ? ((double) num5 < -(double) num4).ToDirectionInt() : -1) : 1; - float num8 = 0.0f; - if ((double) num4 != -1.0) - num8 = -num4; - if ((double) num8 == 0.0 || (double) num5 < (double) num8 && (double) num5 > 0.0) - num8 = num5; + num5 = (double) num3 != -1.0 ? ((double) num4 != -1.0 ? ((double) num4 < -(double) num3).ToDirectionInt() : -1) : 1; + float num7 = 0.0f; + if ((double) num3 != -1.0) + num7 = -num3; + if ((double) num7 == 0.0 || (double) num4 < (double) num7 && (double) num4 > 0.0) + num7 = num4; if ((double) this.ai[0] == 8.0) { - if (this.direction == -num6) + if (this.direction == -num5) { this.ai[0] = 1f; this.ai[1] = (float) (300 + Main.rand.Next(300)); @@ -19708,44 +14504,36 @@ label_422: } else if ((double) this.ai[0] != 10.0 && (double) this.ai[0] != 12.0 && (double) this.ai[0] != 13.0 && (double) this.ai[0] != 14.0 && (double) this.ai[0] != 15.0) { - if (NPCID.Sets.PrettySafe[this.type] != -1 && (double) NPCID.Sets.PrettySafe[this.type] < (double) num8) + if (NPCID.Sets.PrettySafe[this.type] != -1 && (double) NPCID.Sets.PrettySafe[this.type] < (double) num7) { - flag9 = false; - flag10 = NPCID.Sets.AttackType[this.type] > -1; + flag6 = false; + flag7 = true; } else if ((double) this.ai[0] != 1.0) { - int tileX = (int) (((double) this.position.X + (double) (this.width / 2) + (double) (15 * this.direction)) / 16.0); - int tileY = (int) (((double) this.position.Y + (double) this.height - 16.0) / 16.0); - bool currentlyDrowning = this.wet && !canBreathUnderWater; - bool avoidFalling; - this.AI_007_TownEntities_GetWalkPrediction(index1, floorX, canBreathUnderWater, currentlyDrowning, tileX, tileY, out bool _, out avoidFalling); - if (!avoidFalling) + if (((double) this.ai[0] == 3.0 || (double) this.ai[0] == 4.0 || (double) this.ai[0] == 16.0 ? 1 : ((double) this.ai[0] == 17.0 ? 1 : 0)) != 0) { - if (((double) this.ai[0] == 3.0 || (double) this.ai[0] == 4.0 || (double) this.ai[0] == 16.0 ? 1 : ((double) this.ai[0] == 17.0 ? 1 : 0)) != 0) + NPC npc = Main.npc[(int) this.ai[2]]; + if (npc.active) { - NPC npc = Main.npc[(int) this.ai[2]]; - if (npc.active) - { - npc.ai[0] = 1f; - npc.ai[1] = (float) (120 + Main.rand.Next(120)); - npc.ai[2] = 0.0f; - npc.localAI[3] = 0.0f; - npc.direction = -num6; - npc.netUpdate = true; - } + npc.ai[0] = 1f; + npc.ai[1] = (float) (120 + Main.rand.Next(120)); + npc.ai[2] = 0.0f; + npc.localAI[3] = 0.0f; + npc.direction = -num5; + npc.netUpdate = true; } - this.ai[0] = 1f; - this.ai[1] = (float) (120 + Main.rand.Next(120)); - this.ai[2] = 0.0f; - this.localAI[3] = 0.0f; - this.direction = -num6; - this.netUpdate = true; } + this.ai[0] = 1f; + this.ai[1] = (float) (120 + Main.rand.Next(120)); + this.ai[2] = 0.0f; + this.localAI[3] = 0.0f; + this.direction = -num5; + this.netUpdate = true; } - else if ((double) this.ai[0] == 1.0 && this.direction != -num6) + else if ((double) this.ai[0] == 1.0 && this.direction != -num5) { - this.direction = -num6; + this.direction = -num5; this.netUpdate = true; } } @@ -19755,42 +14543,24 @@ label_422: { if ((double) this.localAI[3] > 0.0) --this.localAI[3]; - int petIdleChance = 120; - if (this.type == 638) - petIdleChance = 60; - if (flag7 && this.wet) - { - this.ai[0] = 1f; - this.ai[1] = (float) (200 + Main.rand.Next(500, 700)); - this.ai[2] = 0.0f; - this.localAI[3] = 0.0f; - this.netUpdate = true; - } - else if (flag1 && !flag3 && !NPCID.Sets.TownCritter[this.type]) + if (flag1 && !flag3 && !NPCID.Sets.TownCritter[this.type]) { if (Main.netMode != 1) { - if (index1 == floorX && index2 == floorY) + if (x == this.homeTileX && y == homeTileY) { if ((double) this.velocity.X != 0.0) this.netUpdate = true; if ((double) this.velocity.X > 0.100000001490116) this.velocity.X -= 0.1f; else if ((double) this.velocity.X < -0.100000001490116) - { this.velocity.X += 0.1f; - } else - { this.velocity.X = 0.0f; - this.AI_007_TryForcingSitting(floorX, floorY); - } - if (NPCID.Sets.IsTownPet[this.type]) - this.AI_007_AttemptToPlayIdleAnimationsForPets(petIdleChance * 4); } else { - if (index1 > floorX) + if (x > this.homeTileX) this.direction = -1; else this.direction = 1; @@ -19814,51 +14584,32 @@ label_422: this.velocity.X = 0.0f; if (Main.netMode != 1) { - if (!flag3 && NPCID.Sets.IsTownPet[this.type] && (double) this.ai[1] >= 100.0 && (double) this.ai[1] <= 150.0) - this.AI_007_AttemptToPlayIdleAnimationsForPets(petIdleChance); if ((double) this.ai[1] > 0.0) --this.ai[1]; - bool flag11 = true; - int tileX = (int) (((double) this.position.X + (double) (this.width / 2) + (double) (15 * this.direction)) / 16.0); - int tileY = (int) (((double) this.position.Y + (double) this.height - 16.0) / 16.0); - bool currentlyDrowning = this.wet && !canBreathUnderWater; - bool avoidFalling; - this.AI_007_TownEntities_GetWalkPrediction(index1, floorX, canBreathUnderWater, currentlyDrowning, tileX, tileY, out bool _, out avoidFalling); - if (avoidFalling) - flag11 = false; if ((double) this.ai[1] <= 0.0) { - if (flag11) - { - this.ai[0] = 1f; - this.ai[1] = (float) (200 + Main.rand.Next(300)); - this.ai[2] = 0.0f; - if (NPCID.Sets.TownCritter[this.type]) - this.ai[1] += (float) Main.rand.Next(200, 400); - this.localAI[3] = 0.0f; - this.netUpdate = true; - } - else - { - this.direction *= -1; - this.ai[1] = (float) (60 + Main.rand.Next(120)); - this.netUpdate = true; - } + this.ai[0] = 1f; + this.ai[1] = (float) (200 + Main.rand.Next(300)); + this.ai[2] = 0.0f; + if (NPCID.Sets.TownCritter[this.type]) + this.ai[1] += (float) Main.rand.Next(200, 400); + this.localAI[3] = 0.0f; + this.netUpdate = true; } } } - if (Main.netMode != 1 && (!flag1 || this.AI_007_TownEntities_IsInAGoodRestingSpot(index1, index2, floorX, floorY))) + if (Main.netMode != 1 && (!flag1 || x == this.homeTileX && y == homeTileY)) { - if (index1 < floorX - 25 || index1 > floorX + 25) + if (x < this.homeTileX - 25 || x > this.homeTileX + 25) { if ((double) this.localAI[3] == 0.0) { - if (index1 < floorX - 50 && this.direction == -1) + if (x < this.homeTileX - 50 && this.direction == -1) { this.direction = 1; this.netUpdate = true; } - else if (index1 > floorX + 50 && this.direction == 1) + else if (x > this.homeTileX + 50 && this.direction == 1) { this.direction = -1; this.netUpdate = true; @@ -19875,7 +14626,7 @@ label_422: } else if ((double) this.ai[0] == 1.0) { - if (Main.netMode != 1 & flag1 && this.AI_007_TownEntities_IsInAGoodRestingSpot(index1, index2, floorX, floorY) && !NPCID.Sets.TownCritter[this.type]) + if (Main.netMode != 1 & flag1 && x == this.homeTileX && y == this.homeTileY && !NPCID.Sets.TownCritter[this.type]) { this.ai[0] = 0.0f; this.ai[1] = (float) (200 + Main.rand.Next(200)); @@ -19884,14 +14635,14 @@ label_422: } else { - bool currentlyDrowning = !canBreathUnderWater && Collision.DrownCollision(this.position, this.width, this.height, 1f, true); - if (!currentlyDrowning) + bool flag8 = Collision.DrownCollision(this.position, this.width, this.height, 1f); + if (!flag8) { - if (Main.netMode != 1 && !this.homeless && !Main.tileDungeon[(int) Main.tile[index1, index2].type] && (index1 < floorX - 35 || index1 > floorX + 35)) + if (Main.netMode != 1 && !this.homeless && !Main.tileDungeon[(int) Main.tile[x, y].type] && (x < this.homeTileX - 35 || x > this.homeTileX + 35)) { - if ((double) this.position.X < (double) (floorX * 16) && this.direction == -1) + if ((double) this.position.X < (double) (this.homeTileX * 16) && this.direction == -1) this.ai[1] -= 5f; - else if ((double) this.position.X > (double) (floorX * 16) && this.direction == 1) + else if ((double) this.position.X > (double) (this.homeTileX * 16) && this.direction == 1) this.ai[1] -= 5f; } --this.ai[1]; @@ -19934,113 +14685,103 @@ label_422: else this.closeDoor = false; } - float num9 = 1f; - float num10 = 0.07f; - if (this.type == 614 & flag9) - { - num9 = 1.5f; - num10 = 0.1f; - } - else if (this.type == 299 || this.type == 539 || this.type == 538 || this.type >= 639 && this.type <= 645) - num9 = 1.5f; - else if (flag6) - { - if (this.wet) - { - num10 = 1f; - num9 = 2f; - } - else - { - num10 = 0.07f; - num9 = 0.5f; - } - } - if (this.type == 625) - { - if (this.wet) - { - num10 = 1f; - num9 = 2.5f; - } - else - { - num10 = 0.07f; - num9 = 0.2f; - } - } + float num8 = 1f; + float num9 = 0.07f; + if (this.type == 299 || this.type == 539 || this.type == 538) + num8 = 1.5f; if (flag5) { - num9 = 2f; - num10 = 1f; + num8 = 2f; + num9 = 1f; } - if (this.friendly && flag9 | currentlyDrowning) + if (this.friendly && flag6 | flag8) { - num9 = 1.5f + (float) (1.0 - (double) this.life / (double) this.lifeMax) * 0.9f; - num10 = 0.1f; + num8 = 1.5f + (float) (1.0 - (double) this.life / (double) this.lifeMax) * 0.9f; + num9 = 0.1f; } - if (flag7 && this.wet) - { - if ((double) Math.Abs(this.velocity.X) < 0.0500000007450581 && (double) Math.Abs(this.velocity.Y) < 0.0500000007450581) - this.velocity.X += num9 * 10f * (float) this.direction; - else - this.velocity.X *= 0.9f; - } - else if ((double) this.velocity.X < -(double) num9 || (double) this.velocity.X > (double) num9) + if ((double) this.velocity.X < -(double) num8 || (double) this.velocity.X > (double) num8) { if ((double) this.velocity.Y == 0.0) this.velocity = this.velocity * 0.8f; } - else if ((double) this.velocity.X < (double) num9 && this.direction == 1) + else if ((double) this.velocity.X < (double) num8 && this.direction == 1) { - this.velocity.X += num10; - if ((double) this.velocity.X > (double) num9) - this.velocity.X = num9; + this.velocity.X += num9; + if ((double) this.velocity.X > (double) num8) + this.velocity.X = num8; } - else if ((double) this.velocity.X > -(double) num9 && this.direction == -1) + else if ((double) this.velocity.X > -(double) num8 && this.direction == -1) { - this.velocity.X -= num10; - if ((double) this.velocity.X > (double) num9) - this.velocity.X = num9; + this.velocity.X -= num9; + if ((double) this.velocity.X > (double) num8) + this.velocity.X = num8; } bool holdsMatching = true; if ((double) (this.homeTileY * 16 - 32) > (double) this.position.Y) holdsMatching = false; - if (!holdsMatching && (double) this.velocity.Y == 0.0) + if (this.direction == 1 && (double) this.position.Y + (double) (this.width / 2) > (double) (this.homeTileX * 16) || this.direction == -1 && (double) this.position.Y + (double) (this.width / 2) < (double) (this.homeTileX * 16)) + holdsMatching = true; + if ((double) this.velocity.Y == 0.0) Collision.StepDown(ref this.position, ref this.velocity, this.width, this.height, ref this.stepSpeed, ref this.gfxOffY); if ((double) this.velocity.Y >= 0.0) Collision.StepUp(ref this.position, ref this.velocity, this.width, this.height, ref this.stepSpeed, ref this.gfxOffY, holdsMatching: holdsMatching, specialChecksMode: 1); if ((double) this.velocity.Y == 0.0) { - int num11 = (int) (((double) this.position.X + (double) (this.width / 2) + (double) (15 * this.direction)) / 16.0); - int num12 = (int) (((double) this.position.Y + (double) this.height - 16.0) / 16.0); - bool keepwalking; - bool avoidFalling; - this.AI_007_TownEntities_GetWalkPrediction(index1, floorX, canBreathUnderWater, currentlyDrowning, num11, num12, out keepwalking, out avoidFalling); - if (!avoidFalling && this.wet && !canBreathUnderWater && this.AI_007_TownEntities_CheckIfWillDrown(currentlyDrowning) && (double) this.localAI[3] <= 0.0) + int num10 = (int) (((double) this.position.X + (double) (this.width / 2) + (double) (15 * this.direction)) / 16.0); + int j = (int) (((double) this.position.Y + (double) this.height - 16.0) / 16.0); + bool flag9 = false; + bool flag10 = true; + bool flag11 = x >= this.homeTileX - 35 && x <= this.homeTileX + 35; + if (this.townNPC && (double) this.ai[1] < 30.0) { - avoidFalling = true; - this.localAI[3] = 600f; - } - if (avoidFalling) - { - int num13 = (int) (((double) this.position.X + (double) (this.width / 2)) / 16.0); - int num14 = 0; - for (int index9 = -1; index9 <= 1; ++index9) + flag9 = !Utils.PlotTileLine(this.Top, this.Bottom, (float) this.width, new Utils.PerLinePoint(DelegateMethods.SearchAvoidedByNPCs)); + if (!flag9) { - Tile tileSafely = Framing.GetTileSafely(num13 + index9, num12 + 1); - if (tileSafely.nactive() && Main.tileSolid[(int) tileSafely.type]) - ++num14; + Microsoft.Xna.Framework.Rectangle hitbox = this.Hitbox; + hitbox.X -= 20; + hitbox.Width += 40; + for (int index6 = 0; index6 < 200; ++index6) + { + if (Main.npc[index6].active && Main.npc[index6].friendly && index6 != this.whoAmI && (double) Main.npc[index6].velocity.X == 0.0 && hitbox.Intersects(Main.npc[index6].Hitbox)) + { + flag9 = true; + break; + } + } } - if (num14 <= 2) + } + if (!flag9 & flag8) + flag9 = true; + if (flag10 && (NPCID.Sets.TownCritter[this.type] || !flag11 && this.direction == Math.Sign(this.homeTileX - x))) + flag10 = false; + if (flag10) + { + int num11 = 0; + for (int index7 = -1; index7 <= 4; ++index7) { - if ((double) this.velocity.X != 0.0) - this.netUpdate = true; - keepwalking = avoidFalling = false; - this.ai[0] = 0.0f; - this.ai[1] = (float) (50 + Main.rand.Next(50)); - this.ai[2] = 0.0f; - this.localAI[3] = 40f; + Tile tileSafely = Framing.GetTileSafely(num10 - this.direction * num11, j + index7); + if (tileSafely.lava() && tileSafely.liquid > (byte) 0) + { + flag10 = true; + break; + } + if (tileSafely.nactive() && Main.tileSolid[(int) tileSafely.type]) + { + flag10 = false; + break; + } + } + } + if (!flag10 && this.wet) + { + bool flag12 = flag8; + bool flag13 = false; + if (!flag12) + flag13 = Collision.DrownCollision(this.position + new Vector2((float) (this.width * this.direction), 0.0f), this.width, this.height, 1f); + if ((flag13 || Collision.DrownCollision(this.position + new Vector2((float) (this.width * this.direction), (float) (this.height * 2 - 16 - (flag12 ? 16 : 0))), this.width, 16 + (flag12 ? 16 : 0), 1f)) && (double) this.localAI[3] <= 0.0) + { + flag10 = true; + this.localAI[3] = 600f; } } if ((double) this.position.X == (double) this.localAI[3]) @@ -20049,45 +14790,44 @@ label_422: this.netUpdate = true; this.localAI[3] = 600f; } - if (currentlyDrowning) + if (flag8) { if ((double) this.localAI[3] > 0.0) --this.localAI[3]; } else this.localAI[3] = -1f; - Tile tileSafely1 = Framing.GetTileSafely(num11, num12); - Tile tileSafely2 = Framing.GetTileSafely(num11, num12 - 1); - Tile tileSafely3 = Framing.GetTileSafely(num11, num12 - 2); - bool flag12 = this.height / 16 < 3; + Tile tileSafely1 = Framing.GetTileSafely(num10, j); + Tile tileSafely2 = Framing.GetTileSafely(num10, j - 1); + Tile tileSafely3 = Framing.GetTileSafely(num10, j - 2); if (this.townNPC && tileSafely3.nactive() && (tileSafely3.type == (ushort) 10 || tileSafely3.type == (ushort) 388) && Main.rand.Next(10) == 0 | flag1) { if (Main.netMode != 1) { - if (WorldGen.OpenDoor(num11, num12 - 2, this.direction)) + if (WorldGen.OpenDoor(num10, j - 2, this.direction)) { this.closeDoor = true; - this.doorX = num11; - this.doorY = num12 - 2; - NetMessage.SendData(19, number2: ((float) num11), number3: ((float) (num12 - 2)), number4: ((float) this.direction)); + this.doorX = num10; + this.doorY = j - 2; + NetMessage.SendData(19, number2: ((float) num10), number3: ((float) (j - 2)), number4: ((float) this.direction)); this.netUpdate = true; this.ai[1] += 80f; } - else if (WorldGen.OpenDoor(num11, num12 - 2, -this.direction)) + else if (WorldGen.OpenDoor(num10, j - 2, -this.direction)) { this.closeDoor = true; - this.doorX = num11; - this.doorY = num12 - 2; - NetMessage.SendData(19, number2: ((float) num11), number3: ((float) (num12 - 2)), number4: ((float) -this.direction)); + this.doorX = num10; + this.doorY = j - 2; + NetMessage.SendData(19, number2: ((float) num10), number3: ((float) (j - 2)), number4: ((float) -this.direction)); this.netUpdate = true; this.ai[1] += 80f; } - else if (WorldGen.ShiftTallGate(num11, num12 - 2, false)) + else if (WorldGen.ShiftTallGate(num10, j - 2, false)) { this.closeDoor = true; - this.doorX = num11; - this.doorY = num12 - 2; - NetMessage.SendData(19, number: 4, number2: ((float) num11), number3: ((float) (num12 - 2))); + this.doorX = num10; + this.doorY = j - 2; + NetMessage.SendData(19, number: 4, number2: ((float) num10), number3: ((float) (j - 2))); this.netUpdate = true; this.ai[1] += 80f; } @@ -20102,11 +14842,9 @@ label_422: { if ((double) this.velocity.X < 0.0 && this.spriteDirection == -1 || (double) this.velocity.X > 0.0 && this.spriteDirection == 1) { - bool flag13 = false; - bool flag14 = false; - if (tileSafely3.nactive() && Main.tileSolid[(int) tileSafely3.type] && !Main.tileSolidTop[(int) tileSafely3.type] && (!flag12 || tileSafely2.nactive() && Main.tileSolid[(int) tileSafely2.type] && !Main.tileSolidTop[(int) tileSafely2.type])) + if (tileSafely3.nactive() && Main.tileSolid[(int) tileSafely3.type] && !Main.tileSolidTop[(int) tileSafely3.type]) { - if (!Collision.SolidTilesVersatile(num11 - this.direction * 2, num11 - this.direction, num12 - 5, num12 - 1) && !Collision.SolidTiles(num11, num11, num12 - 5, num12 - 3)) + if (!Collision.SolidTilesVersatile(num10 - this.direction * 2, num10 - this.direction, j - 5, j - 1) && !Collision.SolidTiles(num10, num10, j - 5, j - 3)) { this.velocity.Y = -6f; this.netUpdate = true; @@ -20120,65 +14858,79 @@ label_422: this.netUpdate = true; } } - else if (flag9) + else if (flag6) { - flag14 = true; - flag13 = true; + flag9 = false; + this.velocity.X = 0.0f; + this.direction *= -1; + this.netUpdate = true; + this.ai[0] = 8f; + this.ai[1] = 240f; } else - flag13 = true; + { + this.direction *= -1; + this.netUpdate = true; + } } else if (tileSafely2.nactive() && Main.tileSolid[(int) tileSafely2.type] && !Main.tileSolidTop[(int) tileSafely2.type]) { - if (!Collision.SolidTilesVersatile(num11 - this.direction * 2, num11 - this.direction, num12 - 4, num12 - 1) && !Collision.SolidTiles(num11, num11, num12 - 4, num12 - 2)) + if (!Collision.SolidTilesVersatile(num10 - this.direction * 2, num10 - this.direction, j - 4, j - 1) && !Collision.SolidTiles(num10, num10, j - 4, j - 2)) { this.velocity.Y = -5f; this.netUpdate = true; } - else if (flag9) + else if (flag6) { - flag14 = true; - flag13 = true; + flag9 = false; + this.velocity.X = 0.0f; + this.direction *= -1; + this.netUpdate = true; + this.ai[0] = 8f; + this.ai[1] = 240f; } else - flag13 = true; + { + this.direction *= -1; + this.netUpdate = true; + } } - else if ((double) this.position.Y + (double) this.height - (double) (num12 * 16) > 20.0 && tileSafely1.nactive() && Main.tileSolid[(int) tileSafely1.type] && !tileSafely1.topSlope()) + else if ((double) this.position.Y + (double) this.height - (double) (j * 16) > 20.0 && tileSafely1.nactive() && Main.tileSolid[(int) tileSafely1.type] && !tileSafely1.topSlope()) { - if (!Collision.SolidTilesVersatile(num11 - this.direction * 2, num11, num12 - 3, num12 - 1)) + if (!Collision.SolidTilesVersatile(num10 - this.direction * 2, num10, j - 3, j - 1)) { this.velocity.Y = -4.4f; this.netUpdate = true; } - else if (flag9) + else if (flag6) { - flag14 = true; - flag13 = true; + flag9 = false; + this.velocity.X = 0.0f; + this.direction *= -1; + this.netUpdate = true; + this.ai[0] = 8f; + this.ai[1] = 240f; } else - flag13 = true; + { + this.direction *= -1; + this.netUpdate = true; + } } - else if (avoidFalling) - { - flag13 = true; - if (flag9) - flag14 = true; - } - if (flag14) - { - keepwalking = false; - this.velocity.X = 0.0f; - this.ai[0] = 8f; - this.ai[1] = 240f; - this.netUpdate = true; - } - if (flag13) + else if (flag10) { this.direction *= -1; this.velocity.X *= -1f; this.netUpdate = true; + if (flag6) + { + flag9 = false; + this.velocity.X = 0.0f; + this.ai[0] = 8f; + this.ai[1] = 240f; + } } - if (keepwalking) + if (flag9) { this.ai[1] = 90f; this.netUpdate = true; @@ -20216,23 +14968,20 @@ label_422: this.netUpdate = true; } } - else if ((double) this.ai[0] == 3.0 || (double) this.ai[0] == 4.0 || (double) this.ai[0] == 5.0 || (double) this.ai[0] == 8.0 || (double) this.ai[0] == 9.0 || (double) this.ai[0] == 16.0 || (double) this.ai[0] == 17.0 || (double) this.ai[0] == 20.0 || (double) this.ai[0] == 21.0 || (double) this.ai[0] == 22.0 || (double) this.ai[0] == 23.0) + else if ((double) this.ai[0] == 3.0 || (double) this.ai[0] == 4.0 || (double) this.ai[0] == 5.0 || (double) this.ai[0] == 8.0 || (double) this.ai[0] == 9.0 || (double) this.ai[0] == 16.0 || (double) this.ai[0] == 17.0) { this.velocity.X *= 0.8f; --this.ai[1]; - if ((double) this.ai[0] == 8.0 && (double) this.ai[1] < 60.0 & flag9) + if ((double) this.ai[0] == 8.0 && (double) this.ai[1] < 60.0 & flag6) { this.ai[1] = 180f; this.netUpdate = true; } if ((double) this.ai[0] == 5.0) { - Point tileCoordinates = (this.Bottom + Vector2.UnitY * -2f).ToTileCoordinates(); - Tile tile = Main.tile[tileCoordinates.X, tileCoordinates.Y]; - if (tile.type != (ushort) 15 && tile.type != (ushort) 497) + Point tileCoordinates = this.Center.ToTileCoordinates(); + if (Main.tile[tileCoordinates.X, tileCoordinates.Y].type != (ushort) 15) this.ai[1] = 0.0f; - else - Main.sittingManager.AddNPC(this.whoAmI, tileCoordinates); } if ((double) this.ai[1] <= 0.0) { @@ -20243,21 +14992,21 @@ label_422: this.netUpdate = true; } } - else if ((double) this.ai[0] == 6.0 || (double) this.ai[0] == 7.0 || (double) this.ai[0] == 18.0 || (double) this.ai[0] == 19.0) + else if ((double) this.ai[0] == 6.0 || (double) this.ai[0] == 7.0 || (double) this.ai[0] == 18.0) { if ((double) this.ai[0] == 18.0 && ((double) this.localAI[3] < 1.0 || (double) this.localAI[3] > 2.0)) this.localAI[3] = 2f; this.velocity.X *= 0.8f; --this.ai[1]; - int index10 = (int) this.ai[2]; - if (index10 < 0 || index10 > (int) byte.MaxValue || !Main.player[index10].CanBeTalkedTo || (double) Main.player[index10].Distance(this.Center) > 200.0 || !Collision.CanHitLine(this.Top, 0, 0, Main.player[index10].Top, 0, 0)) + int index8 = (int) this.ai[2]; + if (index8 < 0 || index8 > (int) byte.MaxValue || !Main.player[index8].active || Main.player[index8].dead || (double) Main.player[index8].Distance(this.Center) > 200.0 || !Collision.CanHitLine(this.Top, 0, 0, Main.player[index8].Top, 0, 0)) this.ai[1] = 0.0f; if ((double) this.ai[1] > 0.0) { - int num15 = (double) this.Center.X < (double) Main.player[index10].Center.X ? 1 : -1; - if (num15 != this.direction) + int num12 = (double) this.Center.X < (double) Main.player[index8].Center.X ? 1 : -1; + if (num12 != this.direction) this.netUpdate = true; - this.direction = num15; + this.direction = num12; } else { @@ -20271,14 +15020,14 @@ label_422: else if ((double) this.ai[0] == 10.0) { int Type = 0; - int num16 = 0; + int num13 = 0; float KnockBack = 0.0f; - float num17 = 0.0f; - int num18 = 0; - int num19 = 0; + float num14 = 0.0f; + int num15 = 0; + int num16 = 0; int maxValue2 = 0; - float num20 = 0.0f; - float num21 = (float) NPCID.Sets.DangerDetectRange[this.type]; + float num17 = 0.0f; + float num18 = (float) NPCID.Sets.DangerDetectRange[this.type]; float max = 0.0f; if ((double) NPCID.Sets.AttackTime[this.type] == (double) this.ai[1]) { @@ -20288,201 +15037,172 @@ label_422: if (this.type == 38) { Type = 30; - num17 = 6f; - num16 = 20; - num18 = 10; - num19 = 180; + num14 = 6f; + num13 = 20; + num15 = 10; + num16 = 180; maxValue2 = 120; - num20 = 16f; + num17 = 16f; KnockBack = 7f; } - else if (this.type == 633) - { - Type = 880; - num17 = 24f; - num16 = 15; - num18 = 1; - num20 = 0.0f; - KnockBack = 7f; - num19 = 15; - maxValue2 = 10; - if (this.ShouldBestiaryGirlBeLycantrope()) - { - Type = 929; - num16 = (int) ((double) num16 * 1.5); - } - } else if (this.type == 550) { Type = 669; - num17 = 6f; - num16 = 24; - num18 = 10; - num19 = 120; + num14 = 6f; + num13 = 24; + num15 = 10; + num16 = 120; maxValue2 = 60; - num20 = 16f; - KnockBack = 9f; - } - else if (this.type == 588) - { - Type = 721; - num17 = 8f; - num16 = 15; - num18 = 5; - num19 = 20; - maxValue2 = 10; - num20 = 16f; + num17 = 16f; KnockBack = 9f; } else if (this.type == 208) { Type = 588; - num17 = 6f; - num16 = 30; - num18 = 10; - num19 = 60; + num14 = 6f; + num13 = 30; + num15 = 10; + num16 = 60; maxValue2 = 120; - num20 = 16f; + num17 = 16f; KnockBack = 6f; } else if (this.type == 17) { Type = 48; - num17 = 9f; - num16 = 12; - num18 = 10; - num19 = 60; + num14 = 9f; + num13 = 12; + num15 = 10; + num16 = 60; maxValue2 = 60; - num20 = 16f; + num17 = 16f; KnockBack = 1.5f; } else if (this.type == 369) { Type = 520; - num17 = 12f; - num16 = 10; - num18 = 10; - num19 = 0; + num14 = 12f; + num13 = 10; + num15 = 10; + num16 = 0; maxValue2 = 1; - num20 = 16f; + num17 = 16f; KnockBack = 3f; } else if (this.type == 453) { Type = 21; - num17 = 14f; - num16 = 14; - num18 = 10; - num19 = 0; + num14 = 14f; + num13 = 14; + num15 = 10; + num16 = 0; maxValue2 = 1; - num20 = 16f; + num17 = 16f; KnockBack = 3f; } else if (this.type == 107) { Type = 24; - num17 = 5f; - num16 = 15; - num18 = 10; - num19 = 60; + num14 = 5f; + num13 = 15; + num15 = 10; + num16 = 60; maxValue2 = 60; - num20 = 16f; + num17 = 16f; KnockBack = 1f; } else if (this.type == 124) { Type = 582; - num17 = 10f; - num16 = 11; - num18 = 1; - num19 = 30; + num14 = 10f; + num13 = 11; + num15 = 1; + num16 = 30; maxValue2 = 30; KnockBack = 3.5f; } else if (this.type == 18) { Type = 583; - num17 = 8f; - num16 = 8; - num18 = 1; - num19 = 15; + num14 = 8f; + num13 = 8; + num15 = 1; + num16 = 15; maxValue2 = 10; KnockBack = 2f; - num20 = 10f; + num17 = 10f; } else if (this.type == 142) { Type = 589; - num17 = 7f; - num16 = 22; - num18 = 1; - num19 = 10; + num14 = 7f; + num13 = 22; + num15 = 1; + num16 = 10; maxValue2 = 1; KnockBack = 2f; - num20 = 10f; + num17 = 10f; } if (Main.expertMode) - num16 = (int) ((double) num16 * (double) Main.GameModeInfo.TownNPCDamageMultiplier); - int Damage = (int) ((double) num16 * (double) num1); + num13 = (int) ((double) num13 * (double) Main.expertNPCDamage); + int Damage = (int) ((double) num13 * (double) num1); this.velocity.X *= 0.8f; --this.ai[1]; ++this.localAI[3]; - if ((double) this.localAI[3] == (double) num18 && Main.netMode != 1) + if ((double) this.localAI[3] == (double) num15 && Main.netMode != 1) { Vector2 vec = -Vector2.UnitY; - if (num6 == 1 && this.spriteDirection == 1 && index7 != -1) - vec = this.DirectionTo(Main.npc[index7].Center + new Vector2(0.0f, -num20 * MathHelper.Clamp(this.Distance(Main.npc[index7].Center) / num21, 0.0f, 1f))); - if (num6 == -1 && this.spriteDirection == -1 && index6 != -1) - vec = this.DirectionTo(Main.npc[index6].Center + new Vector2(0.0f, -num20 * MathHelper.Clamp(this.Distance(Main.npc[index6].Center) / num21, 0.0f, 1f))); + if (num5 == 1 && this.spriteDirection == 1 && index4 != -1) + vec = this.DirectionTo(Main.npc[index4].Center + new Vector2(0.0f, -num17 * MathHelper.Clamp(this.Distance(Main.npc[index4].Center) / num18, 0.0f, 1f))); + if (num5 == -1 && this.spriteDirection == -1 && index3 != -1) + vec = this.DirectionTo(Main.npc[index3].Center + new Vector2(0.0f, -num17 * MathHelper.Clamp(this.Distance(Main.npc[index3].Center) / num18, 0.0f, 1f))); if (vec.HasNaNs() || Math.Sign(vec.X) != this.spriteDirection) vec = new Vector2((float) this.spriteDirection, -1f); - Vector2 vector2 = vec * num17 + Utils.RandomVector2(Main.rand, -max, max); - int index11 = this.type != 124 ? (this.type != 142 ? Projectile.NewProjectile(this.Center.X + (float) (this.spriteDirection * 16), this.Center.Y - 2f, vector2.X, vector2.Y, Type, Damage, KnockBack, Main.myPlayer) : Projectile.NewProjectile(this.Center.X + (float) (this.spriteDirection * 16), this.Center.Y - 2f, vector2.X, vector2.Y, Type, Damage, KnockBack, Main.myPlayer, ai1: ((float) Main.rand.Next(5)))) : Projectile.NewProjectile(this.Center.X + (float) (this.spriteDirection * 16), this.Center.Y - 2f, vector2.X, vector2.Y, Type, Damage, KnockBack, Main.myPlayer, ai1: ((float) this.whoAmI)); - Main.projectile[index11].npcProj = true; - Main.projectile[index11].noDropItem = true; - if (this.type == 588) - Main.projectile[index11].timeLeft = 480; + Vector2 vector2 = vec * num14 + Utils.RandomVector2(Main.rand, -max, max); + int index9 = this.type != 124 ? (this.type != 142 ? Projectile.NewProjectile(this.Center.X + (float) (this.spriteDirection * 16), this.Center.Y - 2f, vector2.X, vector2.Y, Type, Damage, KnockBack, Main.myPlayer) : Projectile.NewProjectile(this.Center.X + (float) (this.spriteDirection * 16), this.Center.Y - 2f, vector2.X, vector2.Y, Type, Damage, KnockBack, Main.myPlayer, ai1: ((float) Main.rand.Next(5)))) : Projectile.NewProjectile(this.Center.X + (float) (this.spriteDirection * 16), this.Center.Y - 2f, vector2.X, vector2.Y, Type, Damage, KnockBack, Main.myPlayer, ai1: ((float) this.whoAmI)); + Main.projectile[index9].npcProj = true; + Main.projectile[index9].noDropItem = true; } if ((double) this.ai[1] <= 0.0) { - this.ai[0] = (double) this.localAI[2] == 8.0 & flag9 ? 8f : 0.0f; - this.ai[1] = (float) (num19 + Main.rand.Next(maxValue2)); + this.ai[0] = (double) this.localAI[2] == 8.0 & flag6 ? 8f : 0.0f; + this.ai[1] = (float) (num16 + Main.rand.Next(maxValue2)); this.ai[2] = 0.0f; - this.localAI[1] = this.localAI[3] = (float) (num19 / 2 + Main.rand.Next(maxValue2)); + this.localAI[1] = this.localAI[3] = (float) (num16 / 2 + Main.rand.Next(maxValue2)); this.netUpdate = true; } } else if ((double) this.ai[0] == 12.0) { int Type = 0; + int num19 = 0; + float num20 = 0.0f; + int num21 = 0; int num22 = 0; - float num23 = 0.0f; - int num24 = 0; - int num25 = 0; int maxValue3 = 0; float KnockBack = 0.0f; - int num26 = 0; - bool flag15 = false; + int num23 = 0; + bool flag14 = false; float max = 0.0f; if ((double) NPCID.Sets.AttackTime[this.type] == (double) this.ai[1]) { this.frameCounter = 0.0; this.localAI[3] = 0.0f; } - int index12 = -1; - if (num6 == 1 && this.spriteDirection == 1) - index12 = index7; - if (num6 == -1 && this.spriteDirection == -1) - index12 = index6; + int index10 = -1; + if (num5 == 1 && this.spriteDirection == 1) + index10 = index4; + if (num5 == -1 && this.spriteDirection == -1) + index10 = index3; if (this.type == 19) { Type = 14; - num23 = 13f; - num22 = 24; - num25 = 14; + num20 = 13f; + num19 = 24; + num22 = 14; maxValue3 = 4; KnockBack = 3f; - num24 = 1; + num21 = 1; max = 0.5f; if ((double) NPCID.Sets.AttackTime[this.type] == (double) this.ai[1]) { @@ -20491,188 +15211,188 @@ label_422: } if (Main.hardMode) { - num22 = 15; - if ((double) this.localAI[3] > (double) num24) + num19 = 15; + if ((double) this.localAI[3] > (double) num21) { - num24 = 10; - flag15 = true; + num21 = 10; + flag14 = true; } - if ((double) this.localAI[3] > (double) num24) + if ((double) this.localAI[3] > (double) num21) { - num24 = 20; - flag15 = true; + num21 = 20; + flag14 = true; } - if ((double) this.localAI[3] > (double) num24) + if ((double) this.localAI[3] > (double) num21) { - num24 = 30; - flag15 = true; + num21 = 30; + flag14 = true; } } } else if (this.type == 227) { Type = 587; - num23 = 10f; - num22 = 8; - num25 = 10; + num20 = 10f; + num19 = 8; + num22 = 10; maxValue3 = 1; KnockBack = 1.75f; - num24 = 1; + num21 = 1; max = 0.5f; - if ((double) this.localAI[3] > (double) num24) + if ((double) this.localAI[3] > (double) num21) { - num24 = 12; - flag15 = true; + num21 = 12; + flag14 = true; } - if ((double) this.localAI[3] > (double) num24) + if ((double) this.localAI[3] > (double) num21) { - num24 = 24; - flag15 = true; + num21 = 24; + flag14 = true; } if (Main.hardMode) - num22 += 2; + num19 += 2; } else if (this.type == 368) { Type = 14; - num23 = 13f; - num22 = 24; - num25 = 12; + num20 = 13f; + num19 = 24; + num22 = 12; maxValue3 = 5; KnockBack = 2f; - num24 = 1; + num21 = 1; max = 0.2f; if (Main.hardMode) { - num22 = 30; + num19 = 30; Type = 357; } } else if (this.type == 22) { - num23 = 10f; - num22 = 8; - num24 = 1; + num20 = 10f; + num19 = 8; + num21 = 1; if (Main.hardMode) { Type = 2; - num25 = 15; + num22 = 15; maxValue3 = 10; - num22 += 6; + num19 += 6; } else { Type = 1; - num25 = 30; + num22 = 30; maxValue3 = 20; } KnockBack = 2.75f; - num26 = 4; + num23 = 4; max = 0.7f; } else if (this.type == 228) { Type = 267; - num23 = 14f; - num22 = 20; - num24 = 1; - num25 = 10; + num20 = 14f; + num19 = 20; + num21 = 1; + num22 = 10; maxValue3 = 1; KnockBack = 3f; - num26 = 6; + num23 = 6; max = 0.4f; } else if (this.type == 178) { Type = 242; - num23 = 13f; - num22 = 15; - num25 = 10; + num20 = 13f; + num19 = 15; + num22 = 10; maxValue3 = 1; KnockBack = 2f; - num24 = 1; - if ((double) this.localAI[3] > (double) num24) + num21 = 1; + if ((double) this.localAI[3] > (double) num21) { - num24 = 8; - flag15 = true; + num21 = 8; + flag14 = true; } - if ((double) this.localAI[3] > (double) num24) + if ((double) this.localAI[3] > (double) num21) { - num24 = 16; - flag15 = true; + num21 = 16; + flag14 = true; } max = 0.3f; } else if (this.type == 229) { Type = 14; - num23 = 14f; - num22 = 24; - num25 = 10; + num20 = 14f; + num19 = 24; + num22 = 10; maxValue3 = 1; KnockBack = 2f; - num24 = 1; + num21 = 1; max = 0.7f; - if ((double) this.localAI[3] > (double) num24) + if ((double) this.localAI[3] > (double) num21) { - num24 = 16; - flag15 = true; + num21 = 16; + flag14 = true; } - if ((double) this.localAI[3] > (double) num24) + if ((double) this.localAI[3] > (double) num21) { - num24 = 24; - flag15 = true; + num21 = 24; + flag14 = true; } - if ((double) this.localAI[3] > (double) num24) + if ((double) this.localAI[3] > (double) num21) { - num24 = 32; - flag15 = true; + num21 = 32; + flag14 = true; } - if ((double) this.localAI[3] > (double) num24) + if ((double) this.localAI[3] > (double) num21) { - num24 = 40; - flag15 = true; + num21 = 40; + flag14 = true; } - if ((double) this.localAI[3] > (double) num24) + if ((double) this.localAI[3] > (double) num21) { - num24 = 48; - flag15 = true; + num21 = 48; + flag14 = true; } - if ((double) this.localAI[3] == 0.0 && index12 != -1 && (double) this.Distance(Main.npc[index12].Center) < (double) NPCID.Sets.PrettySafe[this.type]) + if ((double) this.localAI[3] == 0.0 && index10 != -1 && (double) this.Distance(Main.npc[index10].Center) < (double) NPCID.Sets.PrettySafe[this.type]) { max = 0.1f; Type = 162; - num22 = 50; + num19 = 50; KnockBack = 10f; - num23 = 24f; + num20 = 24f; } } else if (this.type == 209) { Type = Utils.SelectRandom(Main.rand, 134, 133, 135); - num24 = 1; + num21 = 1; switch (Type) { case 133: - num23 = 10f; - num22 = 25; - num25 = 10; + num20 = 10f; + num19 = 25; + num22 = 10; maxValue3 = 1; KnockBack = 6f; max = 0.2f; break; case 134: - num23 = 13f; + num20 = 13f; + num19 = 20; num22 = 20; - num25 = 20; maxValue3 = 10; KnockBack = 4f; max = 0.1f; break; case 135: - num23 = 12f; + num20 = 12f; + num19 = 30; num22 = 30; - num25 = 30; maxValue3 = 10; KnockBack = 7f; max = 0.2f; @@ -20680,35 +15400,35 @@ label_422: } } if (Main.expertMode) - num22 = (int) ((double) num22 * (double) Main.GameModeInfo.TownNPCDamageMultiplier); - int Damage = (int) ((double) num22 * (double) num1); + num19 = (int) ((double) num19 * (double) Main.expertNPCDamage); + int Damage = (int) ((double) num19 * (double) num1); this.velocity.X *= 0.8f; --this.ai[1]; ++this.localAI[3]; - if ((double) this.localAI[3] == (double) num24 && Main.netMode != 1) + if ((double) this.localAI[3] == (double) num21 && Main.netMode != 1) { Vector2 vec = Vector2.Zero; - if (index12 != -1) - vec = this.DirectionTo(Main.npc[index12].Center + new Vector2(0.0f, (float) -num26)); + if (index10 != -1) + vec = this.DirectionTo(Main.npc[index10].Center + new Vector2(0.0f, (float) -num23)); if (vec.HasNaNs() || Math.Sign(vec.X) != this.spriteDirection) vec = new Vector2((float) this.spriteDirection, 0.0f); - Vector2 vector2 = vec * num23 + Utils.RandomVector2(Main.rand, -max, max); - int index13 = this.type != 227 ? Projectile.NewProjectile(this.Center.X + (float) (this.spriteDirection * 16), this.Center.Y - 2f, vector2.X, vector2.Y, Type, Damage, KnockBack, Main.myPlayer) : Projectile.NewProjectile(this.Center.X + (float) (this.spriteDirection * 16), this.Center.Y - 2f, vector2.X, vector2.Y, Type, Damage, KnockBack, Main.myPlayer, ai1: ((float) Main.rand.Next(12) / 6f)); - Main.projectile[index13].npcProj = true; - Main.projectile[index13].noDropItem = true; + Vector2 vector2 = vec * num20 + Utils.RandomVector2(Main.rand, -max, max); + int index11 = this.type != 227 ? Projectile.NewProjectile(this.Center.X + (float) (this.spriteDirection * 16), this.Center.Y - 2f, vector2.X, vector2.Y, Type, Damage, KnockBack, Main.myPlayer) : Projectile.NewProjectile(this.Center.X + (float) (this.spriteDirection * 16), this.Center.Y - 2f, vector2.X, vector2.Y, Type, Damage, KnockBack, Main.myPlayer, ai1: ((float) Main.rand.Next(12) / 6f)); + Main.projectile[index11].npcProj = true; + Main.projectile[index11].noDropItem = true; } - if ((double) this.localAI[3] == (double) num24 & flag15 && index12 != -1) + if ((double) this.localAI[3] == (double) num21 & flag14 && index10 != -1) { - Vector2 vector2 = this.DirectionTo(Main.npc[index12].Center); + Vector2 vector2 = this.DirectionTo(Main.npc[index10].Center); if ((double) vector2.Y <= 0.5 && (double) vector2.Y >= -0.5) this.ai[2] = vector2.Y; } if ((double) this.ai[1] <= 0.0) { - this.ai[0] = (double) this.localAI[2] == 8.0 & flag9 ? 8f : 0.0f; - this.ai[1] = (float) (num25 + Main.rand.Next(maxValue3)); + this.ai[0] = (double) this.localAI[2] == 8.0 & flag6 ? 8f : 0.0f; + this.ai[1] = (float) (num22 + Main.rand.Next(maxValue3)); this.ai[2] = 0.0f; - this.localAI[1] = this.localAI[3] = (float) (num25 / 2 + Main.rand.Next(maxValue3)); + this.localAI[1] = this.localAI[3] = (float) (num22 / 2 + Main.rand.Next(maxValue3)); this.netUpdate = true; } } @@ -20725,9 +15445,9 @@ label_422: if (vec.HasNaNs() || Math.Sign(vec.X) == -this.spriteDirection) vec = new Vector2((float) this.spriteDirection, -1f); Vector2 vector2 = vec * 8f; - int index14 = Projectile.NewProjectile(this.Center.X + (float) (this.spriteDirection * 16), this.Center.Y - 2f, vector2.X, vector2.Y, 584, 0, 0.0f, Main.myPlayer, this.ai[2]); - Main.projectile[index14].npcProj = true; - Main.projectile[index14].noDropItem = true; + int index12 = Projectile.NewProjectile(this.Center.X + (float) (this.spriteDirection * 16), this.Center.Y - 2f, vector2.X, vector2.Y, 584, 0, 0.0f, Main.myPlayer, this.ai[2]); + Main.projectile[index12].npcProj = true; + Main.projectile[index12].noDropItem = true; } if ((double) this.ai[1] <= 0.0) { @@ -20741,33 +15461,33 @@ label_422: else if ((double) this.ai[0] == 14.0) { int Type = 0; + int num24 = 0; + float num25 = 0.0f; + int num26 = 0; int num27 = 0; - float num28 = 0.0f; - int num29 = 0; - int num30 = 0; int maxValue4 = 0; float KnockBack = 0.0f; - float num31 = 0.0f; - float num32 = (float) NPCID.Sets.DangerDetectRange[this.type]; - float num33 = 1f; + float num28 = 0.0f; + float num29 = (float) NPCID.Sets.DangerDetectRange[this.type]; + float num30 = 1f; float max = 0.0f; if ((double) NPCID.Sets.AttackTime[this.type] == (double) this.ai[1]) { this.frameCounter = 0.0; this.localAI[3] = 0.0f; } - int index15 = -1; - if (num6 == 1 && this.spriteDirection == 1) - index15 = index7; - if (num6 == -1 && this.spriteDirection == -1) - index15 = index6; + int index13 = -1; + if (num5 == 1 && this.spriteDirection == 1) + index13 = index4; + if (num5 == -1 && this.spriteDirection == -1) + index13 = index3; if (this.type == 54) { Type = 585; - num28 = 10f; - num27 = 16; - num29 = 30; - num30 = 20; + num25 = 10f; + num24 = 16; + num26 = 30; + num27 = 20; maxValue4 = 15; KnockBack = 2f; max = 1f; @@ -20775,162 +15495,154 @@ label_422: else if (this.type == 108) { Type = 15; - num28 = 6f; - num27 = 18; - num29 = 15; - num30 = 15; + num25 = 6f; + num24 = 18; + num26 = 15; + num27 = 15; maxValue4 = 5; KnockBack = 3f; - num31 = 20f; + num28 = 20f; } else if (this.type == 160) { Type = 590; - num27 = 40; - num29 = 15; - num30 = 10; + num24 = 40; + num26 = 15; + num27 = 10; maxValue4 = 1; KnockBack = 3f; - while ((double) this.localAI[3] > (double) num29) - num29 += 15; + while ((double) this.localAI[3] > (double) num26) + num26 += 15; } else if (this.type == 20) { Type = 586; - num29 = 24; - num30 = 10; + num26 = 24; + num27 = 10; maxValue4 = 1; KnockBack = 3f; } if (Main.expertMode) - num27 = (int) ((double) num27 * (double) Main.GameModeInfo.TownNPCDamageMultiplier); - int Damage = (int) ((double) num27 * (double) num1); + num24 = (int) ((double) num24 * (double) Main.expertNPCDamage); + int Damage = (int) ((double) num24 * (double) num1); this.velocity.X *= 0.8f; --this.ai[1]; ++this.localAI[3]; - if ((double) this.localAI[3] == (double) num29 && Main.netMode != 1) + if ((double) this.localAI[3] == (double) num26 && Main.netMode != 1) { Vector2 vec = Vector2.Zero; - if (index15 != -1) - vec = this.DirectionTo(Main.npc[index15].Center + new Vector2(0.0f, -num31 * MathHelper.Clamp(this.Distance(Main.npc[index15].Center) / num32, 0.0f, 1f))); + if (index13 != -1) + vec = this.DirectionTo(Main.npc[index13].Center + new Vector2(0.0f, -num28 * MathHelper.Clamp(this.Distance(Main.npc[index13].Center) / num29, 0.0f, 1f))); if (vec.HasNaNs() || Math.Sign(vec.X) != this.spriteDirection) vec = new Vector2((float) this.spriteDirection, 0.0f); - Vector2 vector2_1 = vec * num28 + Utils.RandomVector2(Main.rand, -max, max); + Vector2 vector2_1 = vec * num25 + Utils.RandomVector2(Main.rand, -max, max); if (this.type == 108) { - int num34 = Utils.SelectRandom(Main.rand, 1, 1, 1, 1, 2, 2, 3); - for (int index16 = 0; index16 < num34; ++index16) + int num31 = Utils.SelectRandom(Main.rand, 1, 1, 1, 1, 2, 2, 3); + for (int index14 = 0; index14 < num31; ++index14) { Vector2 vector2_2 = Utils.RandomVector2(Main.rand, -3.4f, 3.4f); - int index17 = Projectile.NewProjectile(this.Center.X + (float) (this.spriteDirection * 16), this.Center.Y - 2f, vector2_1.X + vector2_2.X, vector2_1.Y + vector2_2.Y, Type, Damage, KnockBack, Main.myPlayer); - Main.projectile[index17].npcProj = true; - Main.projectile[index17].noDropItem = true; + int index15 = Projectile.NewProjectile(this.Center.X + (float) (this.spriteDirection * 16), this.Center.Y - 2f, vector2_1.X + vector2_2.X, vector2_1.Y + vector2_2.Y, Type, Damage, KnockBack, Main.myPlayer); + Main.projectile[index15].npcProj = true; + Main.projectile[index15].noDropItem = true; } } else if (this.type == 160) { - if (index15 != -1) + if (index13 != -1) { - Vector2 vector2_3 = Main.npc[index15].position - Main.npc[index15].Size * 2f + Main.npc[index15].Size * Utils.RandomVector2(Main.rand, 0.0f, 1f) * 5f; - for (int index18 = 10; index18 > 0 && WorldGen.SolidTile(Framing.GetTileSafely((int) vector2_3.X / 16, (int) vector2_3.Y / 16)); vector2_3 = Main.npc[index15].position - Main.npc[index15].Size * 2f + Main.npc[index15].Size * Utils.RandomVector2(Main.rand, 0.0f, 1f) * 5f) - --index18; - int index19 = Projectile.NewProjectile(vector2_3.X, vector2_3.Y, 0.0f, 0.0f, Type, Damage, KnockBack, Main.myPlayer); - Main.projectile[index19].npcProj = true; - Main.projectile[index19].noDropItem = true; + Vector2 vector2_3 = Main.npc[index13].position - Main.npc[index13].Size * 2f + Main.npc[index13].Size * Utils.RandomVector2(Main.rand, 0.0f, 1f) * 5f; + for (int index16 = 10; index16 > 0 && WorldGen.SolidTile(Framing.GetTileSafely((int) vector2_3.X / 16, (int) vector2_3.Y / 16)); vector2_3 = Main.npc[index13].position - Main.npc[index13].Size * 2f + Main.npc[index13].Size * Utils.RandomVector2(Main.rand, 0.0f, 1f) * 5f) + --index16; + int index17 = Projectile.NewProjectile(vector2_3.X, vector2_3.Y, 0.0f, 0.0f, Type, Damage, KnockBack, Main.myPlayer); + Main.projectile[index17].npcProj = true; + Main.projectile[index17].noDropItem = true; } } else if (this.type == 20) { - int index20 = Projectile.NewProjectile(this.Center.X + (float) (this.spriteDirection * 16), this.Center.Y - 2f, vector2_1.X, vector2_1.Y, Type, Damage, KnockBack, Main.myPlayer, ai1: ((float) this.whoAmI)); - Main.projectile[index20].npcProj = true; - Main.projectile[index20].noDropItem = true; + int index18 = Projectile.NewProjectile(this.Center.X + (float) (this.spriteDirection * 16), this.Center.Y - 2f, vector2_1.X, vector2_1.Y, Type, Damage, KnockBack, Main.myPlayer, ai1: ((float) this.whoAmI)); + Main.projectile[index18].npcProj = true; + Main.projectile[index18].noDropItem = true; } else { - int index21 = Projectile.NewProjectile(this.Center.X + (float) (this.spriteDirection * 16), this.Center.Y - 2f, vector2_1.X, vector2_1.Y, Type, Damage, KnockBack, Main.myPlayer); - Main.projectile[index21].npcProj = true; - Main.projectile[index21].noDropItem = true; + int index19 = Projectile.NewProjectile(this.Center.X + (float) (this.spriteDirection * 16), this.Center.Y - 2f, vector2_1.X, vector2_1.Y, Type, Damage, KnockBack, Main.myPlayer); + Main.projectile[index19].npcProj = true; + Main.projectile[index19].noDropItem = true; } } - if ((double) num33 > 0.0) + if ((double) num30 > 0.0) { - Vector3 vector3 = NPCID.Sets.MagicAuraColor[this.type].ToVector3() * num33; + Vector3 vector3 = NPCID.Sets.MagicAuraColor[this.type].ToVector3() * num30; Lighting.AddLight(this.Center, vector3.X, vector3.Y, vector3.Z); } if ((double) this.ai[1] <= 0.0) { - this.ai[0] = (double) this.localAI[2] == 8.0 & flag9 ? 8f : 0.0f; - this.ai[1] = (float) (num30 + Main.rand.Next(maxValue4)); + this.ai[0] = (double) this.localAI[2] == 8.0 & flag6 ? 8f : 0.0f; + this.ai[1] = (float) (num27 + Main.rand.Next(maxValue4)); this.ai[2] = 0.0f; - this.localAI[1] = this.localAI[3] = (float) (num30 / 2 + Main.rand.Next(maxValue4)); + this.localAI[1] = this.localAI[3] = (float) (num27 / 2 + Main.rand.Next(maxValue4)); this.netUpdate = true; } } else if ((double) this.ai[0] == 15.0) { - int num35 = 0; + int num32 = 0; int maxValue5 = 0; if ((double) NPCID.Sets.AttackTime[this.type] == (double) this.ai[1]) { this.frameCounter = 0.0; this.localAI[3] = 0.0f; } + int num33 = 0; + float num34 = 0.0f; + int num35 = 0; int num36 = 0; - float num37 = 0.0f; - int num38 = 0; - int num39 = 0; - if (num6 == 1) + if (num5 == 1) { int spriteDirection1 = this.spriteDirection; } - if (num6 == -1) + if (num5 == -1) { int spriteDirection2 = this.spriteDirection; } if (this.type == 207) { - num36 = 11; - num38 = num39 = 32; - num35 = 12; + num33 = 11; + num35 = num36 = 32; + num32 = 12; maxValue5 = 6; - num37 = 4.25f; + num34 = 4.25f; } else if (this.type == 441) { - num36 = 9; - num38 = num39 = 28; - num35 = 9; + num33 = 9; + num35 = num36 = 28; + num32 = 9; maxValue5 = 3; - num37 = 3.5f; + num34 = 3.5f; } else if (this.type == 353) { - num36 = 10; - num38 = num39 = 32; - num35 = 15; + num33 = 10; + num35 = num36 = 32; + num32 = 15; maxValue5 = 8; - num37 = 5f; - } - else if (this.type == 637 || this.type == 638 || this.type == 656) - { - num36 = 10; - num38 = num39 = 32; - num35 = 15; - maxValue5 = 8; - num37 = 3f; + num34 = 5f; } if (Main.expertMode) - num36 = (int) ((double) num36 * (double) Main.GameModeInfo.TownNPCDamageMultiplier); - int Damage = (int) ((double) num36 * (double) num1); + num33 = (int) ((double) num33 * (double) Main.expertNPCDamage); + int Damage = (int) ((double) num33 * (double) num1); this.velocity.X *= 0.8f; --this.ai[1]; if (Main.netMode != 1) { - Tuple swingStats = this.GetSwingStats(NPCID.Sets.AttackTime[this.type] * 2, (int) this.ai[1], this.spriteDirection, num38, num39); - Microsoft.Xna.Framework.Rectangle itemRectangle = new Microsoft.Xna.Framework.Rectangle((int) swingStats.Item1.X, (int) swingStats.Item1.Y, num38, num39); + Tuple swingStats = this.GetSwingStats(NPCID.Sets.AttackTime[this.type] * 2, (int) this.ai[1], this.spriteDirection, num35, num36); + Microsoft.Xna.Framework.Rectangle itemRectangle = new Microsoft.Xna.Framework.Rectangle((int) swingStats.Item1.X, (int) swingStats.Item1.Y, num35, num36); if (this.spriteDirection == -1) - itemRectangle.X -= num38; - itemRectangle.Y -= num39; + itemRectangle.X -= num35; + itemRectangle.Y -= num36; this.TweakSwingStats(NPCID.Sets.AttackTime[this.type] * 2, (int) this.ai[1], this.spriteDirection, ref itemRectangle); int player = Main.myPlayer; for (int number = 0; number < 200; ++number) @@ -20938,9 +15650,9 @@ label_422: NPC npc = Main.npc[number]; if (npc.active && npc.immune[player] == 0 && !npc.dontTakeDamage && !npc.friendly && npc.damage > 0 && itemRectangle.Intersects(npc.Hitbox) && (npc.noTileCollide || Collision.CanHit(this.position, this.width, this.height, npc.position, npc.width, npc.height))) { - npc.StrikeNPCNoInteraction(Damage, num37, this.spriteDirection); + npc.StrikeNPCNoInteraction(Damage, num34, this.spriteDirection); if (Main.netMode != 0) - NetMessage.SendData(28, number: number, number2: ((float) Damage), number3: num37, number4: ((float) this.spriteDirection)); + NetMessage.SendData(28, number: number, number2: ((float) Damage), number3: num34, number4: ((float) this.spriteDirection)); npc.netUpdate = true; npc.immune[player] = (int) this.ai[1] + 2; } @@ -20948,111 +15660,84 @@ label_422: } if ((double) this.ai[1] <= 0.0) { - bool flag16 = false; - if (flag9) + bool flag15 = false; + if (flag6) { - if (!Collision.CanHit(this.Center, 0, 0, this.Center + Vector2.UnitX * (float) -num6 * 32f, 0, 0) || (double) this.localAI[2] == 8.0) - flag16 = true; - if (flag16) + if (!Collision.CanHit(this.Center, 0, 0, this.Center + Vector2.UnitX * (float) -num5 * 32f, 0, 0) || (double) this.localAI[2] == 8.0) + flag15 = true; + if (flag15) { - int num40 = NPCID.Sets.AttackTime[this.type]; - int index22 = num6 == 1 ? index7 : index6; - int index23 = num6 == 1 ? index6 : index7; - if (index22 != -1 && !Collision.CanHit(this.Center, 0, 0, Main.npc[index22].Center, 0, 0)) - index22 = index23 == -1 || !Collision.CanHit(this.Center, 0, 0, Main.npc[index23].Center, 0, 0) ? -1 : index23; - if (index22 != -1) + int num37 = NPCID.Sets.AttackTime[this.type]; + int index20 = num5 == 1 ? index4 : index3; + int index21 = num5 == 1 ? index3 : index4; + if (index20 != -1 && !Collision.CanHit(this.Center, 0, 0, Main.npc[index20].Center, 0, 0)) + index20 = index21 == -1 || !Collision.CanHit(this.Center, 0, 0, Main.npc[index21].Center, 0, 0) ? -1 : index21; + if (index20 != -1) { this.ai[0] = 15f; - this.ai[1] = (float) num40; + this.ai[1] = (float) num37; this.ai[2] = 0.0f; this.localAI[3] = 0.0f; - this.direction = (double) this.position.X < (double) Main.npc[index22].position.X ? 1 : -1; + this.direction = (double) this.position.X < (double) Main.npc[index20].position.X ? 1 : -1; this.netUpdate = true; } else - flag16 = false; + flag15 = false; } } - if (!flag16) + if (!flag15) { - this.ai[0] = (double) this.localAI[2] == 8.0 & flag9 ? 8f : 0.0f; - this.ai[1] = (float) (num35 + Main.rand.Next(maxValue5)); + this.ai[0] = (double) this.localAI[2] == 8.0 & flag6 ? 8f : 0.0f; + this.ai[1] = (float) (num32 + Main.rand.Next(maxValue5)); this.ai[2] = 0.0f; - this.localAI[1] = this.localAI[3] = (float) (num35 / 2 + Main.rand.Next(maxValue5)); + this.localAI[1] = this.localAI[3] = (float) (num32 / 2 + Main.rand.Next(maxValue5)); this.netUpdate = true; } } } - if (flag8 && this.wet) - { - if (flag7) - this.ai[1] = 50f; - if (this.collideX) - { - this.direction *= -1; - this.velocity.X *= -0.25f; - } - float waterLineHeight; - if (Collision.GetWaterLine(this.Center.ToTileCoordinates(), out waterLineHeight)) - { - float num41 = this.Center.Y + 1f; - if ((double) this.Center.Y > (double) waterLineHeight) - { - this.velocity.Y -= 0.8f; - if ((double) this.velocity.Y < -4.0) - this.velocity.Y = -4f; - if ((double) num41 + (double) this.velocity.Y < (double) waterLineHeight) - this.velocity.Y = waterLineHeight - num41; - } - else - this.velocity.Y = MathHelper.Min(this.velocity.Y, waterLineHeight - num41); - } - else - this.velocity.Y -= 0.2f; - } - if (Main.netMode == 1 || !this.isLikeATownNPC || flag3) + if (Main.netMode == 1 || !this.townNPC && this.type != 453 || flag3) return; - bool flag17 = (double) this.ai[0] < 2.0 && !flag9; - bool flag18 = ((double) this.ai[0] < 2.0 || (double) this.ai[0] == 8.0) && flag9 | flag10; + bool flag16 = (double) this.ai[0] < 2.0 && !flag6; + bool flag17 = ((double) this.ai[0] < 2.0 || (double) this.ai[0] == 8.0) && flag6 | flag7; if ((double) this.localAI[1] > 0.0) --this.localAI[1]; if ((double) this.localAI[1] > 0.0) - flag18 = false; - if (flag18 && this.type == 124 && (double) this.localAI[0] == 1.0) - flag18 = false; - if (flag18 && this.type == 20) + flag17 = false; + if (flag17 && this.type == 124 && (double) this.localAI[0] == 1.0) + flag17 = false; + if (flag17 && this.type == 20) { - flag18 = false; - for (int index24 = 0; index24 < 200; ++index24) + flag17 = false; + for (int index22 = 0; index22 < 200; ++index22) { - NPC npc = Main.npc[index24]; + NPC npc = Main.npc[index22]; if (npc.active && npc.townNPC && (double) this.Distance(npc.Center) <= 1200.0 && npc.FindBuffIndex(165) == -1) { - flag18 = true; + flag17 = true; break; } } } - if (this.CanTalk & flag17 && (double) this.ai[0] == 0.0 && (double) this.velocity.Y == 0.0 && Main.rand.Next(300) == 0) + if (flag16 && (double) this.ai[0] == 0.0 && (double) this.velocity.Y == 0.0 && Main.rand.Next(300) == 0) { - int num42 = 420; - int num43 = Main.rand.Next(2) != 0 ? num42 * Main.rand.Next(1, 3) : num42 * Main.rand.Next(1, 4); - int num44 = 100; - int num45 = 20; - for (int index25 = 0; index25 < 200; ++index25) + int num38 = 420; + int num39 = Main.rand.Next(2) != 0 ? num38 * Main.rand.Next(1, 3) : num38 * Main.rand.Next(1, 4); + int num40 = 100; + int num41 = 20; + for (int index23 = 0; index23 < 200; ++index23) { - NPC npc = Main.npc[index25]; - bool flag19 = (double) npc.ai[0] == 1.0 && npc.closeDoor || (double) npc.ai[0] == 1.0 && (double) npc.ai[1] > 200.0 || (double) npc.ai[0] > 1.0; - if (npc != this && npc.active && npc.CanBeTalkedTo && !flag19 && (double) npc.Distance(this.Center) < (double) num44 && (double) npc.Distance(this.Center) > (double) num45 && Collision.CanHit(this.Center, 0, 0, npc.Center, 0, 0)) + NPC npc = Main.npc[index23]; + bool flag18 = (double) npc.ai[0] == 1.0 && npc.closeDoor || (double) npc.ai[0] == 1.0 && (double) npc.ai[1] > 200.0 || (double) npc.ai[0] > 1.0; + if (npc != this && npc.active && npc.CanTalk && !flag18 && (double) npc.Distance(this.Center) < (double) num40 && (double) npc.Distance(this.Center) > (double) num41 && Collision.CanHit(this.Center, 0, 0, npc.Center, 0, 0)) { int directionInt = ((double) this.position.X < (double) npc.position.X).ToDirectionInt(); this.ai[0] = 3f; - this.ai[1] = (float) num43; - this.ai[2] = (float) index25; + this.ai[1] = (float) num39; + this.ai[2] = (float) index23; this.direction = directionInt; this.netUpdate = true; npc.ai[0] = 4f; - npc.ai[1] = (float) num43; + npc.ai[1] = (float) num39; npc.ai[2] = (float) this.whoAmI; npc.direction = -directionInt; npc.netUpdate = true; @@ -21060,28 +15745,28 @@ label_422: } } } - else if (this.CanTalk & flag17 && (double) this.ai[0] == 0.0 && (double) this.velocity.Y == 0.0 && Main.rand.Next(1800) == 0) + else if (flag16 && (double) this.ai[0] == 0.0 && (double) this.velocity.Y == 0.0 && Main.rand.Next(1800) == 0) { - int num46 = 420; - int num47 = Main.rand.Next(2) != 0 ? num46 * Main.rand.Next(1, 3) : num46 * Main.rand.Next(1, 4); - int num48 = 100; - int num49 = 20; - for (int index26 = 0; index26 < 200; ++index26) + int num42 = 420; + int num43 = Main.rand.Next(2) != 0 ? num42 * Main.rand.Next(1, 3) : num42 * Main.rand.Next(1, 4); + int num44 = 100; + int num45 = 20; + for (int index24 = 0; index24 < 200; ++index24) { - NPC npc = Main.npc[index26]; - bool flag20 = (double) npc.ai[0] == 1.0 && npc.closeDoor || (double) npc.ai[0] == 1.0 && (double) npc.ai[1] > 200.0 || (double) npc.ai[0] > 1.0; - if (npc != this && npc.active && npc.CanBeTalkedTo && !NPCID.Sets.IsTownPet[npc.type] && !flag20 && (double) npc.Distance(this.Center) < (double) num48 && (double) npc.Distance(this.Center) > (double) num49 && Collision.CanHit(this.Center, 0, 0, npc.Center, 0, 0)) + NPC npc = Main.npc[index24]; + bool flag19 = (double) npc.ai[0] == 1.0 && npc.closeDoor || (double) npc.ai[0] == 1.0 && (double) npc.ai[1] > 200.0 || (double) npc.ai[0] > 1.0; + if (npc != this && npc.active && npc.CanTalk && !flag19 && (double) npc.Distance(this.Center) < (double) num44 && (double) npc.Distance(this.Center) > (double) num45 && Collision.CanHit(this.Center, 0, 0, npc.Center, 0, 0)) { int directionInt = ((double) this.position.X < (double) npc.position.X).ToDirectionInt(); this.ai[0] = 16f; - this.ai[1] = (float) num47; - this.ai[2] = (float) index26; + this.ai[1] = (float) num43; + this.ai[2] = (float) index24; this.localAI[2] = (float) Main.rand.Next(4); this.localAI[3] = (float) Main.rand.Next(3 - (int) this.localAI[2]); this.direction = directionInt; this.netUpdate = true; npc.ai[0] = 17f; - npc.ai[1] = (float) num47; + npc.ai[1] = (float) num43; npc.ai[2] = (float) this.whoAmI; npc.localAI[2] = 0.0f; npc.localAI[3] = 0.0f; @@ -21091,9 +15776,59 @@ label_422: } } } - else if (!NPCID.Sets.IsTownPet[this.type] & flag17 && (double) this.ai[0] == 0.0 && (double) this.velocity.Y == 0.0 && Main.rand.Next(1200) == 0 && (this.type == 208 || BirthdayParty.PartyIsUp && NPCID.Sets.AttackType[this.type] == NPCID.Sets.AttackType[208])) + else if (flag16 && (double) this.ai[0] == 0.0 && (double) this.velocity.Y == 0.0 && Main.rand.Next(1200) == 0 && (this.type == 208 || BirthdayParty.PartyIsUp && NPCID.Sets.AttackType[this.type] == NPCID.Sets.AttackType[208])) { - int num50 = 300; + int num46 = 300; + int num47 = 150; + for (int index25 = 0; index25 < (int) byte.MaxValue; ++index25) + { + Player player = Main.player[index25]; + if (player.active && !player.dead && (double) player.Distance(this.Center) < (double) num47 && Collision.CanHitLine(this.Top, 0, 0, player.Top, 0, 0)) + { + int directionInt = ((double) this.position.X < (double) player.position.X).ToDirectionInt(); + this.ai[0] = 6f; + this.ai[1] = (float) num46; + this.ai[2] = (float) index25; + this.direction = directionInt; + this.netUpdate = true; + break; + } + } + } + else if (flag16 && (double) this.ai[0] == 0.0 && (double) this.velocity.Y == 0.0 && Main.rand.Next(600) == 0 && this.type == 550) + { + int num48 = 300; + int num49 = 150; + for (int index26 = 0; index26 < (int) byte.MaxValue; ++index26) + { + Player player = Main.player[index26]; + if (player.active && !player.dead && (double) player.Distance(this.Center) < (double) num49 && Collision.CanHitLine(this.Top, 0, 0, player.Top, 0, 0)) + { + int directionInt = ((double) this.position.X < (double) player.position.X).ToDirectionInt(); + this.ai[0] = 18f; + this.ai[1] = (float) num48; + this.ai[2] = (float) index26; + this.direction = directionInt; + this.netUpdate = true; + break; + } + } + } + else if (flag16 && (double) this.ai[0] == 0.0 && (double) this.velocity.Y == 0.0 && Main.rand.Next(1800) == 0) + { + this.ai[0] = 2f; + this.ai[1] = (float) (45 * Main.rand.Next(1, 2)); + this.netUpdate = true; + } + else if (flag16 && (double) this.ai[0] == 0.0 && (double) this.velocity.Y == 0.0 && Main.rand.Next(600) == 0 && this.type == 229 && !flag7) + { + this.ai[0] = 11f; + this.ai[1] = (float) (30 * Main.rand.Next(1, 4)); + this.netUpdate = true; + } + else if (flag16 && (double) this.ai[0] == 0.0 && (double) this.velocity.Y == 0.0 && Main.rand.Next(1200) == 0) + { + int num50 = 220; int num51 = 150; for (int index27 = 0; index27 < (int) byte.MaxValue; ++index27) { @@ -21101,7 +15836,7 @@ label_422: if (player.active && !player.dead && (double) player.Distance(this.Center) < (double) num51 && Collision.CanHitLine(this.Top, 0, 0, player.Top, 0, 0)) { int directionInt = ((double) this.position.X < (double) player.position.X).ToDirectionInt(); - this.ai[0] = 6f; + this.ai[0] = 7f; this.ai[1] = (float) num50; this.ai[2] = (float) index27; this.direction = directionInt; @@ -21110,108 +15845,50 @@ label_422: } } } - else if (flag17 && (double) this.ai[0] == 0.0 && (double) this.velocity.Y == 0.0 && Main.rand.Next(600) == 0 && this.type == 550) + else if (flag16 && (double) this.ai[0] == 1.0 && (double) this.velocity.Y == 0.0 && Main.rand.Next(maxValue1) == 0) { - int num52 = 300; - int num53 = 150; - for (int index28 = 0; index28 < (int) byte.MaxValue; ++index28) + Point tileCoordinates = this.Center.ToTileCoordinates(); + bool flag20 = WorldGen.InWorld(tileCoordinates.X, tileCoordinates.Y, 1); + if (flag20) { - Player player = Main.player[index28]; - if (player.active && !player.dead && (double) player.Distance(this.Center) < (double) num53 && Collision.CanHitLine(this.Top, 0, 0, player.Top, 0, 0)) + for (int index28 = 0; index28 < 200; ++index28) { - int directionInt = ((double) this.position.X < (double) player.position.X).ToDirectionInt(); - this.ai[0] = 18f; - this.ai[1] = (float) num52; - this.ai[2] = (float) index28; - this.direction = directionInt; - this.netUpdate = true; - break; - } - } - } - else if (!NPCID.Sets.IsTownPet[this.type] & flag17 && (double) this.ai[0] == 0.0 && (double) this.velocity.Y == 0.0 && Main.rand.Next(1800) == 0) - { - this.ai[0] = 2f; - this.ai[1] = (float) (45 * Main.rand.Next(1, 2)); - this.netUpdate = true; - } - else if (flag17 && (double) this.ai[0] == 0.0 && (double) this.velocity.Y == 0.0 && Main.rand.Next(600) == 0 && this.type == 229 && !flag10) - { - this.ai[0] = 11f; - this.ai[1] = (float) (30 * Main.rand.Next(1, 4)); - this.netUpdate = true; - } - else if (flag17 && (double) this.ai[0] == 0.0 && (double) this.velocity.Y == 0.0 && Main.rand.Next(1200) == 0) - { - int num54 = 220; - int num55 = 150; - for (int index29 = 0; index29 < (int) byte.MaxValue; ++index29) - { - Player player = Main.player[index29]; - if (player.CanBeTalkedTo && (double) player.Distance(this.Center) < (double) num55 && Collision.CanHitLine(this.Top, 0, 0, player.Top, 0, 0)) - { - int directionInt = ((double) this.position.X < (double) player.position.X).ToDirectionInt(); - this.ai[0] = 7f; - this.ai[1] = (float) num54; - this.ai[2] = (float) index29; - this.direction = directionInt; - this.netUpdate = true; - break; - } - } - } - else if (flag17 && (double) this.ai[0] == 1.0 && (double) this.velocity.Y == 0.0 && maxValue1 > 0 && Main.rand.Next(maxValue1) == 0) - { - Point tileCoordinates = (this.Bottom + Vector2.UnitY * -2f).ToTileCoordinates(); - bool flag21 = WorldGen.InWorld(tileCoordinates.X, tileCoordinates.Y, 1); - if (flag21) - { - for (int index30 = 0; index30 < 200; ++index30) - { - if (Main.npc[index30].active && Main.npc[index30].aiStyle == 7 && Main.npc[index30].townNPC && (double) Main.npc[index30].ai[0] == 5.0 && (Main.npc[index30].Bottom + Vector2.UnitY * -2f).ToTileCoordinates() == tileCoordinates) + if (Main.npc[index28].active && Main.npc[index28].aiStyle == 7 && Main.npc[index28].townNPC && (double) Main.npc[index28].ai[0] == 5.0 && Main.npc[index28].Center.ToTileCoordinates() == tileCoordinates) { - flag21 = false; - break; - } - } - for (int index31 = 0; index31 < (int) byte.MaxValue; ++index31) - { - if (Main.player[index31].active && Main.player[index31].sitting.isSitting && Main.player[index31].Center.ToTileCoordinates() == tileCoordinates) - { - flag21 = false; + flag20 = false; break; } } } - if (flag21) + if (flag20) { Tile tile = Main.tile[tileCoordinates.X, tileCoordinates.Y]; - bool flag22 = tile.type == (ushort) 15 || tile.type == (ushort) 497; - if (flag22 && tile.type == (ushort) 15 && tile.frameY == (short) 1098) - flag22 = false; - if (flag22) + bool flag21 = tile.type == (ushort) 15; + if (flag21 && tile.frameY == (short) 1080) + flag21 = false; + if (flag21) { this.ai[0] = 5f; this.ai[1] = (float) (900 + Main.rand.Next(10800)); this.direction = tile.frameX == (short) 0 ? -1 : 1; - this.Bottom = new Vector2((float) (tileCoordinates.X * 16 + 8 + 2 * this.direction), (float) (tileCoordinates.Y * 16 + 16)); + this.Bottom = new Vector2((float) (tileCoordinates.X * 16 + 8 + 2 * this.direction), (float) (tileCoordinates.Y * 16 + 32)); this.velocity = Vector2.Zero; this.localAI[3] = 0.0f; this.netUpdate = true; } } } - else if (flag17 && (double) this.ai[0] == 1.0 && (double) this.velocity.Y == 0.0 && Main.rand.Next(600) == 0 && Utils.PlotTileLine(this.Top, this.Bottom, (float) this.width, new Utils.TileActionAttempt(DelegateMethods.SearchAvoidedByNPCs))) + else if (flag16 && (double) this.ai[0] == 1.0 && (double) this.velocity.Y == 0.0 && Main.rand.Next(600) == 0 && Utils.PlotTileLine(this.Top, this.Bottom, (float) this.width, new Utils.PerLinePoint(DelegateMethods.SearchAvoidedByNPCs))) { Point tileCoordinates = (this.Center + new Vector2((float) (this.direction * 10), 0.0f)).ToTileCoordinates(); - bool flag23 = WorldGen.InWorld(tileCoordinates.X, tileCoordinates.Y, 1); - if (flag23) + bool flag22 = WorldGen.InWorld(tileCoordinates.X, tileCoordinates.Y, 1); + if (flag22) { Tile tileSafely = Framing.GetTileSafely(tileCoordinates.X, tileCoordinates.Y); if (!tileSafely.nactive() || !TileID.Sets.InteractibleByNPCs[(int) tileSafely.type]) - flag23 = false; + flag22 = false; } - if (flag23) + if (flag22) { this.ai[0] = 9f; this.ai[1] = (float) (40 + Main.rand.Next(90)); @@ -21220,260 +15897,114 @@ label_422: this.netUpdate = true; } } - if (Main.netMode != 1 && (double) this.ai[0] < 2.0 && (double) this.velocity.Y == 0.0 && this.type == 18 && this.breath > 0) + if ((double) this.ai[0] < 2.0 && (double) this.velocity.Y == 0.0 && this.type == 18) { - int index32 = -1; - for (int index33 = 0; index33 < 200; ++index33) + int index29 = -1; + for (int index30 = 0; index30 < 200; ++index30) { - NPC npc = Main.npc[index33]; - if (npc.active && npc.townNPC && npc.life != npc.lifeMax && (index32 == -1 || npc.lifeMax - npc.life > Main.npc[index32].lifeMax - Main.npc[index32].life) && Collision.CanHitLine(this.position, this.width, this.height, npc.position, npc.width, npc.height) && (double) this.Distance(npc.Center) < 500.0) - index32 = index33; + NPC npc = Main.npc[index30]; + if (npc.active && npc.townNPC && npc.life != npc.lifeMax && (index29 == -1 || npc.lifeMax - npc.life > Main.npc[index29].lifeMax - Main.npc[index29].life) && Collision.CanHitLine(this.position, this.width, this.height, npc.position, npc.width, npc.height) && (double) this.Distance(npc.Center) < 500.0) + index29 = index30; } - if (index32 != -1) + if (index29 != -1) { this.ai[0] = 13f; this.ai[1] = 34f; - this.ai[2] = (float) index32; + this.ai[2] = (float) index29; this.localAI[3] = 0.0f; - this.direction = (double) this.position.X < (double) Main.npc[index32].position.X ? 1 : -1; + this.direction = (double) this.position.X < (double) Main.npc[index29].position.X ? 1 : -1; this.netUpdate = true; } } - if (flag18 && (double) this.velocity.Y == 0.0 && NPCID.Sets.AttackType[this.type] == 0 && NPCID.Sets.AttackAverageChance[this.type] > 0 && Main.rand.Next(NPCID.Sets.AttackAverageChance[this.type] * 2) == 0) + if (flag17 && (double) this.velocity.Y == 0.0 && NPCID.Sets.AttackType[this.type] == 0 && NPCID.Sets.AttackAverageChance[this.type] > 0 && Main.rand.Next(NPCID.Sets.AttackAverageChance[this.type] * 2) == 0) { - int num56 = NPCID.Sets.AttackTime[this.type]; - int index34 = num6 == 1 ? index7 : index6; - int index35 = num6 == 1 ? index6 : index7; - if (index34 != -1 && !Collision.CanHit(this.Center, 0, 0, Main.npc[index34].Center, 0, 0)) - index34 = index35 == -1 || !Collision.CanHit(this.Center, 0, 0, Main.npc[index35].Center, 0, 0) ? -1 : index35; - bool flag24 = index34 != -1; - if (flag24 && this.type == 633) - flag24 = (double) Vector2.Distance(this.Center, Main.npc[index34].Center) <= 50.0; - if (flag24) + int num52 = NPCID.Sets.AttackTime[this.type]; + int index31 = num5 == 1 ? index4 : index3; + int index32 = num5 == 1 ? index3 : index4; + if (index31 != -1 && !Collision.CanHit(this.Center, 0, 0, Main.npc[index31].Center, 0, 0)) + index31 = index32 == -1 || !Collision.CanHit(this.Center, 0, 0, Main.npc[index32].Center, 0, 0) ? -1 : index32; + if (index31 != -1) { this.localAI[2] = this.ai[0]; this.ai[0] = 10f; - this.ai[1] = (float) num56; + this.ai[1] = (float) num52; this.ai[2] = 0.0f; this.localAI[3] = 0.0f; - this.direction = (double) this.position.X < (double) Main.npc[index34].position.X ? 1 : -1; + this.direction = (double) this.position.X < (double) Main.npc[index31].position.X ? 1 : -1; this.netUpdate = true; } } - else if (flag18 && (double) this.velocity.Y == 0.0 && NPCID.Sets.AttackType[this.type] == 1 && NPCID.Sets.AttackAverageChance[this.type] > 0 && Main.rand.Next(NPCID.Sets.AttackAverageChance[this.type] * 2) == 0) + else if (flag17 && (double) this.velocity.Y == 0.0 && NPCID.Sets.AttackType[this.type] == 1 && NPCID.Sets.AttackAverageChance[this.type] > 0 && Main.rand.Next(NPCID.Sets.AttackAverageChance[this.type] * 2) == 0) { - int num57 = NPCID.Sets.AttackTime[this.type]; - int index36 = num6 == 1 ? index7 : index6; - int index37 = num6 == 1 ? index6 : index7; - if (index36 != -1 && !Collision.CanHitLine(this.Center, 0, 0, Main.npc[index36].Center, 0, 0)) - index36 = index37 == -1 || !Collision.CanHitLine(this.Center, 0, 0, Main.npc[index37].Center, 0, 0) ? -1 : index37; - if (index36 != -1) + int num53 = NPCID.Sets.AttackTime[this.type]; + int index33 = num5 == 1 ? index4 : index3; + int index34 = num5 == 1 ? index3 : index4; + if (index33 != -1 && !Collision.CanHitLine(this.Center, 0, 0, Main.npc[index33].Center, 0, 0)) + index33 = index34 == -1 || !Collision.CanHitLine(this.Center, 0, 0, Main.npc[index34].Center, 0, 0) ? -1 : index34; + if (index33 != -1) { - Vector2 vector2 = this.DirectionTo(Main.npc[index36].Center); + Vector2 vector2 = this.DirectionTo(Main.npc[index33].Center); if ((double) vector2.Y <= 0.5 && (double) vector2.Y >= -0.5) { this.localAI[2] = this.ai[0]; this.ai[0] = 12f; - this.ai[1] = (float) num57; + this.ai[1] = (float) num53; this.ai[2] = vector2.Y; this.localAI[3] = 0.0f; - this.direction = (double) this.position.X < (double) Main.npc[index36].position.X ? 1 : -1; + this.direction = (double) this.position.X < (double) Main.npc[index33].position.X ? 1 : -1; this.netUpdate = true; } } } - if (flag18 && (double) this.velocity.Y == 0.0 && NPCID.Sets.AttackType[this.type] == 2 && NPCID.Sets.AttackAverageChance[this.type] > 0 && Main.rand.Next(NPCID.Sets.AttackAverageChance[this.type] * 2) == 0) + if (flag17 && (double) this.velocity.Y == 0.0 && NPCID.Sets.AttackType[this.type] == 2 && NPCID.Sets.AttackAverageChance[this.type] > 0 && Main.rand.Next(NPCID.Sets.AttackAverageChance[this.type] * 2) == 0) { - int num58 = NPCID.Sets.AttackTime[this.type]; - int index38 = num6 == 1 ? index7 : index6; - int index39 = num6 == 1 ? index6 : index7; - if (index38 != -1 && !Collision.CanHitLine(this.Center, 0, 0, Main.npc[index38].Center, 0, 0)) - index38 = index39 == -1 || !Collision.CanHitLine(this.Center, 0, 0, Main.npc[index39].Center, 0, 0) ? -1 : index39; - if (index38 != -1) + int num54 = NPCID.Sets.AttackTime[this.type]; + int index35 = num5 == 1 ? index4 : index3; + int index36 = num5 == 1 ? index3 : index4; + if (index35 != -1 && !Collision.CanHitLine(this.Center, 0, 0, Main.npc[index35].Center, 0, 0)) + index35 = index36 == -1 || !Collision.CanHitLine(this.Center, 0, 0, Main.npc[index36].Center, 0, 0) ? -1 : index36; + if (index35 != -1) { this.localAI[2] = this.ai[0]; this.ai[0] = 14f; - this.ai[1] = (float) num58; + this.ai[1] = (float) num54; this.ai[2] = 0.0f; this.localAI[3] = 0.0f; - this.direction = (double) this.position.X < (double) Main.npc[index38].position.X ? 1 : -1; + this.direction = (double) this.position.X < (double) Main.npc[index35].position.X ? 1 : -1; this.netUpdate = true; } else if (this.type == 20) { this.localAI[2] = this.ai[0]; this.ai[0] = 14f; - this.ai[1] = (float) num58; + this.ai[1] = (float) num54; this.ai[2] = 0.0f; this.localAI[3] = 0.0f; this.netUpdate = true; } } - if (!flag18 || (double) this.velocity.Y != 0.0 || NPCID.Sets.AttackType[this.type] != 3 || NPCID.Sets.AttackAverageChance[this.type] <= 0 || Main.rand.Next(NPCID.Sets.AttackAverageChance[this.type] * 2) != 0) + if (!flag17 || (double) this.velocity.Y != 0.0 || NPCID.Sets.AttackType[this.type] != 3 || NPCID.Sets.AttackAverageChance[this.type] <= 0 || Main.rand.Next(NPCID.Sets.AttackAverageChance[this.type] * 2) != 0) return; - int num59 = NPCID.Sets.AttackTime[this.type]; - int index40 = num6 == 1 ? index7 : index6; - int index41 = num6 == 1 ? index6 : index7; - if (index40 != -1 && !Collision.CanHit(this.Center, 0, 0, Main.npc[index40].Center, 0, 0)) - index40 = index41 == -1 || !Collision.CanHit(this.Center, 0, 0, Main.npc[index41].Center, 0, 0) ? -1 : index41; - if (index40 == -1) + int num55 = NPCID.Sets.AttackTime[this.type]; + int index37 = num5 == 1 ? index4 : index3; + int index38 = num5 == 1 ? index3 : index4; + if (index37 != -1 && !Collision.CanHit(this.Center, 0, 0, Main.npc[index37].Center, 0, 0)) + index37 = index38 == -1 || !Collision.CanHit(this.Center, 0, 0, Main.npc[index38].Center, 0, 0) ? -1 : index38; + if (index37 == -1) return; this.localAI[2] = this.ai[0]; this.ai[0] = 15f; - this.ai[1] = (float) num59; + this.ai[1] = (float) num55; this.ai[2] = 0.0f; this.localAI[3] = 0.0f; - this.direction = (double) this.position.X < (double) Main.npc[index40].position.X ? 1 : -1; + this.direction = (double) this.position.X < (double) Main.npc[index37].position.X ? 1 : -1; this.netUpdate = true; } } } - private void AI_007_TownEntities_GetWalkPrediction( - int myTileX, - int homeFloorX, - bool canBreathUnderWater, - bool currentlyDrowning, - int tileX, - int tileY, - out bool keepwalking, - out bool avoidFalling) - { - keepwalking = false; - avoidFalling = true; - bool flag = myTileX >= homeFloorX - 35 && myTileX <= homeFloorX + 35; - if (this.townNPC && (double) this.ai[1] < 30.0) - { - keepwalking = !Utils.PlotTileLine(this.Top, this.Bottom, (float) this.width, new Utils.TileActionAttempt(DelegateMethods.SearchAvoidedByNPCs)); - if (!keepwalking) - { - Microsoft.Xna.Framework.Rectangle hitbox = this.Hitbox; - hitbox.X -= 20; - hitbox.Width += 40; - for (int index = 0; index < 200; ++index) - { - if (Main.npc[index].active && Main.npc[index].friendly && index != this.whoAmI && (double) Main.npc[index].velocity.X == 0.0 && hitbox.Intersects(Main.npc[index].Hitbox)) - { - keepwalking = true; - break; - } - } - } - } - if (!keepwalking & currentlyDrowning) - keepwalking = true; - if (avoidFalling && (NPCID.Sets.TownCritter[this.type] || !flag && this.direction == Math.Sign(homeFloorX - myTileX))) - avoidFalling = false; - if (!avoidFalling) - return; - int num = 0; - for (int index = -1; index <= 4; ++index) - { - Tile tileSafely = Framing.GetTileSafely(tileX - this.direction * num, tileY + index); - if (tileSafely.lava() && tileSafely.liquid > (byte) 0) - { - avoidFalling = true; - break; - } - if (tileSafely.nactive() && Main.tileSolid[(int) tileSafely.type]) - { - avoidFalling = false; - break; - } - } - } - - private bool AI_007_TownEntities_CheckIfWillDrown(bool currentlyDrowning) - { - bool flag1 = currentlyDrowning; - bool flag2 = false; - if (!flag1) - flag2 = Collision.DrownCollision(this.position + new Vector2((float) (this.width * this.direction), 0.0f), this.width, this.height, 1f); - return flag2 || Collision.DrownCollision(this.position + new Vector2((float) (this.width * this.direction), (float) (this.height * 2 - 16 - (flag1 ? 16 : 0))), this.width, 16 + (flag1 ? 16 : 0), 1f); - } - - private void AI_007_AttemptToPlayIdleAnimationsForPets(int petIdleChance) - { - if ((double) this.velocity.X != 0.0 || Main.netMode == 1 || Main.rand.Next(petIdleChance) != 0) - return; - int num = 3; - if (this.type == 638) - num = 2; - this.ai[0] = (float) Main.rand.Next(20, 20 + num); - this.ai[1] = (float) (200 + Main.rand.Next(300)); - if ((double) this.ai[0] == 20.0 && this.type == 637) - this.ai[1] = (float) (500 + Main.rand.Next(200)); - if ((double) this.ai[0] == 21.0 && this.type == 638) - this.ai[1] = (float) (100 + Main.rand.Next(100)); - if ((double) this.ai[0] == 22.0 && this.type == 656) - this.ai[1] = (float) (200 + Main.rand.Next(200)); - this.ai[2] = 0.0f; - this.localAI[3] = 0.0f; - this.netUpdate = true; - } - - public bool NPCCanStickToWalls() - { - int num1 = (int) this.Center.X / 16; - int num2 = (int) this.Center.Y / 16; - int num3 = 0; - for (int i = num1 - 1; i <= num1 + 1; ++i) - { - for (int j = num2 - 1; j <= num2 + 1; ++j) - { - Tile tileSafely = Framing.GetTileSafely(i, j); - if ((!tileSafely.active() || !Main.tileSolid[(int) tileSafely.type] || TileID.Sets.Platforms[(int) tileSafely.type]) && tileSafely.wall > (ushort) 0) - { - ++num3; - if (num3 > 4) - return true; - } - } - } - return false; - } - private void AI_003_Fighters() { - if ((double) Main.player[this.target].position.Y + (double) Main.player[this.target].height == (double) this.position.Y + (double) this.height) - this.directionY = -1; - bool flag1 = false; - if (this.type == 624) - { - int num = (int) ((double) this.Center.X / 16.0); - int j = (int) ((double) this.Bottom.Y / 16.0); - if (Main.dayTime && WorldGen.InAPlaceWithWind(this.position, this.width, this.height)) - { - this.position = this.position + this.netOffset; - int index1 = Dust.NewDust(this.position, this.width, this.height, 43, Alpha: 254, newColor: Color.White, Scale: 0.5f); - Main.dust[index1].velocity *= 0.2f; - this.position = this.position - this.netOffset; - if (WorldGen.SolidTileAllowBottomSlope(num, j)) - { - for (int index2 = 0; index2 < 5; ++index2) - { - this.position = this.position + this.netOffset; - int index3 = Dust.NewDust(this.position, this.width, this.height, 43, Alpha: 254, newColor: Color.White, Scale: 0.5f); - Main.dust[index3].velocity *= 0.2f; - this.position = this.position - this.netOffset; - } - if (Main.netMode != 1 && TileObject.CanPlace(num, j - 1, 567, 0, this.direction, out TileObject _, true) && WorldGen.PlaceTile(num, j - 1, 567, style: Main.rand.Next(5))) - { - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, num, j - 1, 3); - if (Main.netMode != 1) - { - if (this.IsNPCValidForBestiaryKillCredit()) - Main.BestiaryTracker.Kills.RegisterKill(this); - this.CountKillForBannersAndDropThem(); - } - this.life = 0; - this.active = false; - return; - } - } - } - } if (this.type == 466) { int num = 200; @@ -21574,7 +16105,7 @@ label_422: this.velocity = (this.velocity * 9f + vector2_1) / 10f; return; } - this.knockBackResist = 0.4f * Main.GameModeInfo.KnockbackToEnemiesMultiplier; + this.knockBackResist = 0.4f * Main.knockBackMultiplier; this.noGravity = false; Vector2 center1 = this.Center; this.width = 18; @@ -21596,116 +16127,10 @@ label_422: this.spriteDirection = this.direction; } } - if (this.type == 586) - { - if (this.alpha == (int) byte.MaxValue) - { - this.TargetClosest(); - this.spriteDirection = this.direction; - this.velocity.Y = -6f; - this.netUpdate = true; - for (int index = 0; index < 35; ++index) - { - Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 5); - dust.velocity *= 1f; - dust.scale = (float) (1.0 + (double) Main.rand.NextFloat() * 0.5); - dust.fadeIn = (float) (1.5 + (double) Main.rand.NextFloat() * 0.5); - dust.velocity += this.velocity * 0.5f; - } - } - this.alpha -= 15; - if (this.alpha < 0) - this.alpha = 0; - this.position = this.position + this.netOffset; - if (this.alpha != 0) - { - for (int index = 0; index < 2; ++index) - { - Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 5); - dust.velocity *= 1f; - dust.scale = (float) (1.0 + (double) Main.rand.NextFloat() * 0.5); - dust.fadeIn = (float) (1.5 + (double) Main.rand.NextFloat() * 0.5); - dust.velocity += this.velocity * 0.3f; - } - } - if (Main.rand.Next(3) == 0) - { - Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 5); - dust.velocity *= 0.0f; - dust.alpha = 120; - dust.scale = (float) (0.699999988079071 + (double) Main.rand.NextFloat() * 0.5); - dust.velocity += this.velocity * 0.3f; - } - this.position = this.position - this.netOffset; - if (this.wet) - { - this.knockBackResist = 0.0f; - this.ai[3] = -0.10101f; - this.noGravity = true; - Vector2 center = this.Center; - this.position.X = center.X - (float) (this.width / 2); - this.position.Y = center.Y - (float) (this.height / 2); - this.TargetClosest(); - if (this.collideX) - this.velocity.X = -this.oldVelocity.X; - if ((double) this.velocity.X < 0.0) - this.direction = -1; - if ((double) this.velocity.X > 0.0) - this.direction = 1; - if (Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].Center, 1, 1)) - { - Vector2 vector2_2 = Main.player[this.target].Center - this.Center; - vector2_2.Normalize(); - float num = MathHelper.Clamp(1f + Math.Abs(this.Center.Y - Main.player[this.target].Center.Y) / 40f, 5f, 20f); - Vector2 vector2_3 = vector2_2 * num; - if ((double) this.velocity.Y > 0.0) - { - this.velocity = (this.velocity * 29f + vector2_3) / 30f; - return; - } - this.velocity = (this.velocity * 4f + vector2_3) / 5f; - return; - } - float num1 = 5f; - if ((double) this.velocity.Y > 0.0) - num1 = 3f; - if ((double) this.velocity.Y < 0.0) - num1 = 8f; - Vector2 vector2 = new Vector2((float) this.direction, -1f); - vector2.Normalize(); - vector2 *= num1; - if ((double) num1 < 5.0) - { - this.velocity = (this.velocity * 24f + vector2) / 25f; - return; - } - this.velocity = (this.velocity * 9f + vector2) / 10f; - return; - } - this.noGravity = false; - Vector2 center2 = this.Center; - this.position.X = center2.X - (float) (this.width / 2); - this.position.Y = center2.Y - (float) (this.height / 2); - if ((double) this.ai[3] == -0.101010002195835) - { - this.ai[3] = 0.0f; - float num = this.velocity.Length() * 2f; - if ((double) num > 15.0) - num = 15f; - this.velocity.Normalize(); - this.velocity = this.velocity * num; - if ((double) this.velocity.X < 0.0) - this.direction = -1; - if ((double) this.velocity.X > 0.0) - this.direction = 1; - this.spriteDirection = this.direction; - } - } if (this.type == 379 || this.type == 380) { if ((double) this.ai[3] < 0.0) { - this.directionY = -1; this.damage = 0; this.velocity.X *= 0.93f; if ((double) this.velocity.X > -0.1 && (double) this.velocity.X < 0.1) @@ -21760,8 +16185,8 @@ label_422: } if (this.type == 482) { - int num2 = 300; - int num3 = 120; + int num1 = 300; + int num2 = 120; this.dontTakeDamage = false; if ((double) this.ai[2] < 0.0) { @@ -21778,7 +16203,7 @@ label_422: this.velocity.X += (float) this.direction * 0.3f; return; } - if ((double) this.ai[2] < (double) num2) + if ((double) this.ai[2] < (double) num1) { if (this.justHit) this.ai[2] += 15f; @@ -21786,82 +16211,23 @@ label_422: } else if ((double) this.velocity.Y == 0.0) { - this.ai[2] = (float) -num3; + this.ai[2] = (float) -num2; this.netUpdate = true; } } - Microsoft.Xna.Framework.Rectangle hitbox; - if (this.type == 631) - { - if (this.target < 0 || this.target == (int) byte.MaxValue || Main.player[this.target].dead || !Main.player[this.target].active) - this.TargetClosest((double) this.ai[2] > 0.0); - Player player = Main.player[this.target]; - bool flag2 = !player.dead && player.active && (double) this.Center.Distance(player.Center) < 320.0; - int num4 = 24; - if ((double) this.ai[2] == 0.0) - { - this.ai[3] = 65f; - if (flag2 && Collision.CanHit((Entity) player, (Entity) this)) - { - this.ai[2] = 100f; - this.ai[3] = 0.0f; - this.velocity.X = (float) this.direction * 0.01f; - this.netUpdate = true; - } - } - else - { - if ((double) this.ai[2] < 100.0) - { - ++this.ai[2]; - this.velocity.X *= 0.9f; - if ((double) Math.Abs(this.velocity.X) < 0.001) - this.velocity.X = 0.0f; - if ((double) Math.Abs(this.velocity.Y) > 1.0) - this.ai[2] = 0.0f; - if ((double) this.ai[2] == (double) (100 - num4 / 2) && Main.netMode != 1 && !player.Hitbox.Intersects(this.Hitbox) && Collision.CanHit((Entity) player, (Entity) this)) - { - float num5 = 10f; - Vector2 center = this.Center; - Vector2 vec = this.DirectionTo(Main.player[this.target].Center) * num5; - if (vec.HasNaNs()) - vec = new Vector2((float) this.direction * num5, 0.0f); - int Damage = this.damage / 4; - Vector2 vector2 = (vec + Utils.RandomVector2(Main.rand, -0.8f, 0.8f)).SafeNormalize(Vector2.Zero) * num5; - Projectile.NewProjectile(center.X, center.Y, vector2.X, vector2.Y, 909, Damage, 1f, Main.myPlayer); - } - if ((double) this.ai[2] < 100.0) - return; - this.ai[2] = 100f; - this.ai[3] = 0.0f; - this.velocity.X = (float) this.direction * 0.01f; - this.netUpdate = true; - return; - } - if ((double) this.velocity.Y == 0.0 && flag2) - { - hitbox = player.Hitbox; - if (hitbox.Intersects(this.Hitbox) || Collision.CanHit((Entity) player, (Entity) this)) - { - this.ai[2] = (float) (100 - num4); - this.netUpdate = true; - } - } - } - } if (this.type == 480) { - int num6 = 180; - int num7 = 300; - int num8 = 180; - int num9 = 60; - int num10 = 20; + int num3 = 180; + int num4 = 300; + int num5 = 180; + int num6 = 60; + int num7 = 20; if (this.life < this.lifeMax / 3) { - num6 = 120; - num7 = 240; - num8 = 240; - num9 = 90; + num3 = 120; + num4 = 240; + num5 = 240; + num6 = 90; } if ((double) this.ai[2] > 0.0) --this.ai[2]; @@ -21869,100 +16235,96 @@ label_422: { if (((double) Main.player[this.target].Center.X < (double) this.Center.X && this.direction < 0 || (double) Main.player[this.target].Center.X > (double) this.Center.X && this.direction > 0) && (double) this.velocity.Y == 0.0 && (double) this.Distance(Main.player[this.target].Center) < 900.0 && Collision.CanHit(this.Center, 1, 1, Main.player[this.target].Center, 1, 1)) { - this.ai[2] = (float) (-num8 - num10); + this.ai[2] = (float) (-num5 - num7); this.netUpdate = true; } } else { - if ((double) this.ai[2] < 0.0 && (double) this.ai[2] < (double) -num8) + if ((double) this.ai[2] < 0.0 && (double) this.ai[2] < (double) -num5) { - this.position = this.position + this.netOffset; this.velocity.X *= 0.9f; if ((double) this.velocity.Y < -2.0 || (double) this.velocity.Y > 4.0 || this.justHit) { - this.ai[2] = (float) num6; + this.ai[2] = (float) num3; } else { ++this.ai[2]; if ((double) this.ai[2] == 0.0) - this.ai[2] = (float) num7; + this.ai[2] = (float) num4; } - float num11 = this.ai[2] + (float) num8 + (float) num10; - if ((double) num11 == 1.0) - SoundEngine.PlaySound(4, (int) this.position.X, (int) this.position.Y, 17); - if ((double) num11 < (double) num10) + float num8 = this.ai[2] + (float) num5 + (float) num7; + if ((double) num8 == 1.0) + Main.PlaySound(4, (int) this.position.X, (int) this.position.Y, 17); + if ((double) num8 < (double) num7) { Vector2 Position = this.Top + new Vector2((float) (this.spriteDirection * 6), 6f); - float num12 = MathHelper.Lerp(20f, 30f, (float) (((double) num11 * 3.0 + 50.0) / 182.0)); - double num13 = (double) Main.rand.NextFloat(); - for (float num14 = 0.0f; (double) num14 < 2.0; ++num14) + float num9 = MathHelper.Lerp(20f, 30f, (float) (((double) num8 * 3.0 + 50.0) / 182.0)); + double num10 = (double) Main.rand.NextFloat(); + for (float num11 = 0.0f; (double) num11 < 2.0; ++num11) { Vector2 vector2 = Vector2.UnitY.RotatedByRandom(6.28318548202515) * (float) ((double) Main.rand.NextFloat() * 0.5 + 0.5); Dust dust = Main.dust[Dust.NewDust(Position, 0, 0, 228)]; - dust.position = Position + vector2 * num12; + dust.position = Position + vector2 * num9; dust.noGravity = true; dust.velocity = vector2 * 2f; dust.scale = (float) (0.5 + (double) Main.rand.NextFloat() * 0.5); } } Lighting.AddLight(this.Center, 0.9f, 0.75f, 0.1f); - this.position = this.position - this.netOffset; return; } - if ((double) this.ai[2] < 0.0 && (double) this.ai[2] >= (double) -num8) + if ((double) this.ai[2] < 0.0 && (double) this.ai[2] >= (double) -num5) { - this.position = this.position + this.netOffset; Lighting.AddLight(this.Center, 0.9f, 0.75f, 0.1f); this.velocity.X *= 0.9f; if ((double) this.velocity.Y < -2.0 || (double) this.velocity.Y > 4.0 || this.justHit) { - this.ai[2] = (float) num6; + this.ai[2] = (float) num3; } else { ++this.ai[2]; if ((double) this.ai[2] == 0.0) - this.ai[2] = (float) num7; + this.ai[2] = (float) num4; } - float num15 = this.ai[2] + (float) num8; - if ((double) num15 < 180.0 && (Main.rand.Next(3) == 0 || (double) this.ai[2] % 3.0 == 0.0)) + float num12 = this.ai[2] + (float) num5; + if ((double) num12 < 180.0 && (Main.rand.Next(3) == 0 || (double) this.ai[2] % 3.0 == 0.0)) { Vector2 Position = this.Top + new Vector2((float) (this.spriteDirection * 10), 10f); - float num16 = MathHelper.Lerp(20f, 30f, (float) (((double) num15 * 3.0 + 50.0) / 182.0)); - double num17 = (double) Main.rand.NextFloat(); - for (float num18 = 0.0f; (double) num18 < 1.0; ++num18) + float num13 = MathHelper.Lerp(20f, 30f, (float) (((double) num12 * 3.0 + 50.0) / 182.0)); + double num14 = (double) Main.rand.NextFloat(); + for (float num15 = 0.0f; (double) num15 < 1.0; ++num15) { Vector2 vector2 = Vector2.UnitY.RotatedByRandom(6.28318548202515) * (float) ((double) Main.rand.NextFloat() * 0.5 + 0.5); Dust dust = Main.dust[Dust.NewDust(Position, 0, 0, 228)]; - dust.position = Position + vector2 * num16; + dust.position = Position + vector2 * num13; dust.noGravity = true; dust.velocity = vector2 * 4f; dust.scale = 0.5f + Main.rand.NextFloat(); } } - this.position = this.position - this.netOffset; if (Main.netMode == 2) return; Player player1 = Main.player[Main.myPlayer]; int player2 = Main.myPlayer; if (player1.dead || !player1.active || player1.FindBuffIndex(156) != -1) return; - Vector2 vector2_4 = player1.Center - this.Center; - if ((double) vector2_4.Length() >= 700.0) + Vector2 vector2_2 = player1.Center - this.Center; + if ((double) vector2_2.Length() >= 700.0) return; - bool flag3 = (double) vector2_4.Length() < 30.0; - if (!flag3) + bool flag = (double) vector2_2.Length() < 30.0; + if (!flag) { float x = 0.7853982f.ToRotationVector2().X; - Vector2 vector2_5 = Vector2.Normalize(vector2_4); - if ((double) vector2_5.X > (double) x || (double) vector2_5.X < -(double) x) - flag3 = true; + Vector2 vector2_3 = Vector2.Normalize(vector2_2); + if ((double) vector2_3.X > (double) x || (double) vector2_3.X < -(double) x) + flag = true; } - if (((double) player1.Center.X >= (double) this.Center.X || this.direction >= 0 || player1.direction <= 0) && ((double) player1.Center.X <= (double) this.Center.X || this.direction <= 0 || player1.direction >= 0) || !flag3 || (Collision.CanHitLine(this.Center, 1, 1, player1.Center, 1, 1) || Collision.CanHitLine(this.Center - Vector2.UnitY * 16f, 1, 1, player1.Center, 1, 1) ? 1 : (Collision.CanHitLine(this.Center + Vector2.UnitY * 8f, 1, 1, player1.Center, 1, 1) ? 1 : 0)) == 0 || player1.creativeGodMode) + if (((double) player1.Center.X >= (double) this.Center.X || this.direction >= 0 || player1.direction <= 0) && ((double) player1.Center.X <= (double) this.Center.X || this.direction <= 0 || player1.direction >= 0) || !flag || (Collision.CanHitLine(this.Center, 1, 1, player1.Center, 1, 1) || Collision.CanHitLine(this.Center - Vector2.UnitY * 16f, 1, 1, player1.Center, 1, 1) ? 1 : (Collision.CanHitLine(this.Center + Vector2.UnitY * 8f, 1, 1, player1.Center, 1, 1) ? 1 : 0)) == 0) return; - player1.AddBuff(156, num9 + (int) this.ai[2] * -1); + player1.AddBuff(156, num6 + (int) this.ai[2] * -1); return; } } @@ -21994,7 +16356,7 @@ label_422: else { this.localAI[3] = 0.0f; - this.knockBackResist = 0.35f * Main.GameModeInfo.KnockbackToEnemiesMultiplier; + this.knockBackResist = 0.35f * Main.knockBackMultiplier; this.rotation *= 0.9f; this.defense = this.defDefense; this.noGravity = false; @@ -22008,15 +16370,15 @@ label_422: if ((double) this.ai[3] == -1.0) { this.TargetClosest(); - float num19 = 8f; - float num20 = 40f; - Vector2 vector2 = Main.player[this.target].Center - this.Center; - float num21 = vector2.Length(); - float num22 = num19 + num21 / 200f; - vector2.Normalize(); - vector2 *= num22; - this.velocity = (this.velocity * (num20 - 1f) + vector2) / num20; - if ((double) num21 >= 500.0 || Collision.SolidCollision(this.position, this.width, this.height)) + float num16 = 8f; + float num17 = 40f; + Vector2 vector2_4 = Main.player[this.target].Center - this.Center; + float num18 = vector2_4.Length(); + float num19 = num16 + num18 / 200f; + vector2_4.Normalize(); + Vector2 vector2_5 = vector2_4 * num19; + this.velocity = (this.velocity * (num17 - 1f) + vector2_5) / num17; + if ((double) num18 >= 500.0 || Collision.SolidCollision(this.position, this.width, this.height)) return; this.ai[3] = 0.0f; this.ai[2] = 0.0f; @@ -22067,17 +16429,17 @@ label_422: this.velocity.Y += 0.1f; if ((double) this.velocity.Length() > 4.0) this.velocity = this.velocity * 0.9f; - int index4 = (int) this.Center.X / 16; - int index5 = (int) ((double) this.position.Y + (double) this.height + 12.0) / 16; - bool flag4 = false; - for (int index6 = index4 - 1; index6 <= index4 + 1; ++index6) + int index1 = (int) this.Center.X / 16; + int index2 = (int) ((double) this.position.Y + (double) this.height + 12.0) / 16; + bool flag = false; + for (int index3 = index1 - 1; index3 <= index1 + 1; ++index3) { - if (Main.tile[index6, index5] == null) - Main.tile[index4, index5] = new Tile(); - if (Main.tile[index6, index5].active() && Main.tileSolid[(int) Main.tile[index6, index5].type]) - flag4 = true; + if (Main.tile[index3, index2] == null) + Main.tile[index1, index2] = new Tile(); + if (Main.tile[index3, index2].active() && Main.tileSolid[(int) Main.tile[index3, index2].type]) + flag = true; } - if (flag4 && !Collision.SolidCollision(this.position, this.width, this.height)) + if (flag && !Collision.SolidCollision(this.position, this.width, this.height)) { this.ai[3] = 0.0f; this.ai[2] = 0.0f; @@ -22106,7 +16468,7 @@ label_422: this.ai[3] = -2f; this.ai[2] = 0.0f; } - for (int index7 = 0; index7 < 2; ++index7) + for (int index4 = 0; index4 < 2; ++index4) { Vector2 vector2_6 = center; Vector2 vector2_7 = new Vector2((float) Main.rand.Next(-100, 101), (float) Main.rand.Next(-100, 101)); @@ -22117,13 +16479,13 @@ label_422: vector2_8.Normalize(); vector2_7 = vector2_8 * ((float) Main.rand.Next(50, 90) * 0.1f); Color newColor = new Color(); - int index8 = Dust.NewDust(Position, 1, 1, 27, newColor: newColor); - Main.dust[index8].velocity = -vector2_7 * 0.3f; - Main.dust[index8].alpha = 100; + int index5 = Dust.NewDust(Position, 1, 1, 27, newColor: newColor); + Main.dust[index5].velocity = -vector2_7 * 0.3f; + Main.dust[index5].alpha = 100; if (Main.rand.Next(2) == 0) { - Main.dust[index8].noGravity = true; - Main.dust[index8].scale += 0.3f; + Main.dust[index5].noGravity = true; + Main.dust[index5].scale += 0.3f; } } return; @@ -22158,17 +16520,17 @@ label_422: if (Main.player[this.target].dead) { this.TargetClosest(); - if (Main.player[this.target].dead) - this.EncourageDespawn(1); + if (Main.player[this.target].dead && this.timeLeft > 1) + this.timeLeft = 1; } } if (this.type == 419) { - this.reflectsProjectiles = false; + this.reflectingProjectiles = false; this.takenDamageMultiplier = 1f; - int num23 = 6; - int num24 = 10; - float num25 = 16f; + int num20 = 6; + int num21 = 10; + float num22 = 16f; if ((double) this.ai[2] > 0.0) --this.ai[2]; if ((double) this.ai[2] == 0.0) @@ -22182,35 +16544,35 @@ label_422: } else { - if ((double) this.ai[2] < 0.0 && (double) this.ai[2] > (double) -num23) + if ((double) this.ai[2] < 0.0 && (double) this.ai[2] > (double) -num20) { --this.ai[2]; this.velocity.X *= 0.9f; return; } - if ((double) this.ai[2] == (double) -num23) + if ((double) this.ai[2] == (double) -num20) { --this.ai[2]; this.TargetClosest(); Vector2 vec = this.DirectionTo(Main.player[this.target].Top + new Vector2(0.0f, -30f)); if (vec.HasNaNs()) vec = Vector2.Normalize(new Vector2((float) this.spriteDirection, -1f)); - this.velocity = vec * num25; + this.velocity = vec * num22; this.netUpdate = true; return; } - if ((double) this.ai[2] < (double) -num23) + if ((double) this.ai[2] < (double) -num20) { --this.ai[2]; if ((double) this.velocity.Y == 0.0) this.ai[2] = 60f; - else if ((double) this.ai[2] < (double) (-num23 - num24)) + else if ((double) this.ai[2] < (double) (-num20 - num21)) { this.velocity.Y += 0.15f; if ((double) this.velocity.Y > 24.0) this.velocity.Y = 24f; } - this.reflectsProjectiles = true; + this.reflectingProjectiles = true; this.takenDamageMultiplier = 3f; if (!this.justHit) return; @@ -22222,8 +16584,8 @@ label_422: } if (this.type == 415) { - int num26 = 42; - int num27 = 18; + int num23 = 42; + int num24 = 18; if (this.justHit) { this.ai[2] = 120f; @@ -22233,13 +16595,13 @@ label_422: --this.ai[2]; if ((double) this.ai[2] == 0.0) { - int num28 = 0; + int num25 = 0; for (int index = 0; index < 200; ++index) { if (Main.npc[index].active && Main.npc[index].type == 516) - ++num28; + ++num25; } - if (num28 > 6) + if (num25 > 6) this.ai[2] = 90f; else if (((double) Main.player[this.target].Center.X < (double) this.Center.X && this.direction < 0 || (double) Main.player[this.target].Center.X > (double) this.Center.X && this.direction > 0) && Collision.CanHit(this.Center, 1, 1, Main.player[this.target].Center, 1, 1)) { @@ -22248,15 +16610,14 @@ label_422: this.TargetClosest(); } } - else if ((double) this.ai[2] < 0.0 && (double) this.ai[2] > (double) -num26) + else if ((double) this.ai[2] < 0.0 && (double) this.ai[2] > (double) -num23) { --this.ai[2]; - if ((double) this.ai[2] == (double) -num26) + if ((double) this.ai[2] == (double) -num23) this.ai[2] = (float) (180 + 30 * Main.rand.Next(10)); this.velocity.X *= 0.8f; - if ((double) this.ai[2] != (double) -num27 && (double) this.ai[2] != (double) (-num27 - 8) && (double) this.ai[2] != (double) (-num27 - 16)) + if ((double) this.ai[2] != (double) -num24 && (double) this.ai[2] != (double) (-num24 - 8) && (double) this.ai[2] != (double) (-num24 - 16)) return; - this.position = this.position + this.netOffset; for (int index = 0; index < 20; ++index) { Vector2 Position = this.Center + Vector2.UnitX * (float) this.spriteDirection * 40f; @@ -22268,7 +16629,6 @@ label_422: dust.fadeIn = 0.7f; dust.noGravity = true; } - this.position = this.position - this.netOffset; if ((double) this.velocity.X > -0.5 && (double) this.velocity.X < 0.5) this.velocity.X = 0.0f; if (Main.netMode == 1) @@ -22295,7 +16655,6 @@ label_422: int maxValue = (double) this.localAI[0] >= 60.0 ? ((double) this.localAI[0] >= 120.0 ? ((double) this.localAI[0] >= 180.0 ? ((double) this.localAI[0] >= 240.0 ? ((double) this.localAI[0] >= 300.0 ? 1 : 1) : 2) : 4) : 8) : 16; if (Main.rand.Next(maxValue) == 0) { - this.position = this.position + this.netOffset; Dust dust = Main.dust[Dust.NewDust(this.position, this.width, this.height, 229)]; dust.noGravity = true; dust.scale = 1f; @@ -22304,7 +16663,6 @@ label_422: dust.position -= dust.velocity * 5f; dust.position.X += (float) (this.direction * 6); dust.position.Y += 4f; - this.position = this.position - this.netOffset; } } if (this.type == 427) @@ -22326,118 +16684,63 @@ label_422: int maxValue = (double) this.localAI[0] >= 360.0 ? ((double) this.localAI[0] >= 720.0 ? ((double) this.localAI[0] >= 1080.0 ? ((double) this.localAI[0] >= 1440.0 ? ((double) this.localAI[0] >= 1800.0 ? 1 : 1) : 2) : 6) : 16) : 32; if (Main.rand.Next(maxValue) == 0) { - this.position = this.position + this.netOffset; Dust dust = Main.dust[Dust.NewDust(this.position, this.width, this.height, 229)]; dust.noGravity = true; dust.scale = 1f; dust.noLight = true; - this.position = this.position - this.netOffset; } } - if (this.type == 590) - { - this.position = this.position + this.netOffset; - int num29 = (int) ((double) this.position.Y + 6.0) / 16; - if (this.spriteDirection < 0) - { - int num30 = (int) ((double) this.Center.X - 22.0) / 16; - Tile tileSafely1 = Framing.GetTileSafely(num30, num29); - Tile tileSafely2 = Framing.GetTileSafely(num30 + 1, num29); - if (WorldGen.InWorld(num30, num29) && tileSafely2.liquid == (byte) 0 && tileSafely1.liquid == (byte) 0) - { - Lighting.AddLight(num30, num29, 1f, 0.95f, 0.8f); - if (Main.rand.Next(30) == 0) - Dust.NewDust(new Vector2(this.Center.X - 22f, this.position.Y + 6f), 1, 1, 6); - } - } - else - { - int num31 = (int) ((double) this.Center.X + 14.0) / 16; - Tile tileSafely3 = Framing.GetTileSafely(num31, num29); - Tile tileSafely4 = Framing.GetTileSafely(num31 - 1, num29); - if (WorldGen.InWorld(num31, num29) && tileSafely4.liquid == (byte) 0 && tileSafely3.liquid == (byte) 0) - { - Lighting.AddLight(num31, num29, 1f, 0.95f, 0.8f); - if (Main.rand.Next(30) == 0) - Dust.NewDust(new Vector2(this.Center.X + 14f, this.position.Y + 6f), 1, 1, 6); - } - } - this.position = this.position - this.netOffset; - } - else if (this.type == 591) - { - this.position = this.position + this.netOffset; - if (!this.wet) - { - if (this.spriteDirection < 0) - { - Lighting.AddLight(new Vector2(this.Center.X - 36f, this.position.Y + 24f), 1f, 0.95f, 0.8f); - if ((double) this.ai[2] == 0.0 && Main.rand.Next(30) == 0) - Dust.NewDust(new Vector2(this.Center.X - 36f, this.position.Y + 24f), 1, 1, 6); - } - else - { - Lighting.AddLight(new Vector2(this.Center.X + 28f, this.position.Y + 24f), 1f, 0.95f, 0.8f); - if ((double) this.ai[2] == 0.0 && Main.rand.Next(30) == 0) - Dust.NewDust(new Vector2(this.Center.X + 28f, this.position.Y + 24f), 1, 1, 6); - } - } - this.position = this.position - this.netOffset; - } - bool flag5 = false; - bool flag6 = false; + bool flag1 = false; if ((double) this.velocity.X == 0.0) - flag6 = true; + flag1 = true; if (this.justHit) - flag6 = false; + flag1 = false; if (Main.netMode != 1 && this.type == 198 && (double) this.life <= (double) this.lifeMax * 0.55) this.Transform(199); if (Main.netMode != 1 && this.type == 348 && (double) this.life <= (double) this.lifeMax * 0.55) this.Transform(349); - int num32 = 60; + int num26 = 60; if (this.type == 120) { - num32 = 180; + num26 = 180; if ((double) this.ai[3] == -120.0) { this.velocity = this.velocity * 0.0f; this.ai[3] = 0.0f; - this.position = this.position + this.netOffset; - SoundEngine.PlaySound(SoundID.Item8, this.position); + Main.PlaySound(SoundID.Item8, this.position); Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); - float num33 = this.oldPos[2].X + (float) this.width * 0.5f - vector2.X; - float num34 = this.oldPos[2].Y + (float) this.height * 0.5f - vector2.Y; - float num35 = 2f / (float) Math.Sqrt((double) num33 * (double) num33 + (double) num34 * (double) num34); - float SpeedX = num33 * num35; - float SpeedY = num34 * num35; - for (int index9 = 0; index9 < 20; ++index9) + float num27 = this.oldPos[2].X + (float) this.width * 0.5f - vector2.X; + float num28 = this.oldPos[2].Y + (float) this.height * 0.5f - vector2.Y; + float num29 = 2f / (float) Math.Sqrt((double) num27 * (double) num27 + (double) num28 * (double) num28); + float SpeedX = num27 * num29; + float SpeedY = num28 * num29; + for (int index6 = 0; index6 < 20; ++index6) { - int index10 = Dust.NewDust(this.position, this.width, this.height, 71, SpeedX, SpeedY, 200, Scale: 2f); - Main.dust[index10].noGravity = true; - Main.dust[index10].velocity.X *= 2f; + int index7 = Dust.NewDust(this.position, this.width, this.height, 71, SpeedX, SpeedY, 200, Scale: 2f); + Main.dust[index7].noGravity = true; + Main.dust[index7].velocity.X *= 2f; } - for (int index11 = 0; index11 < 20; ++index11) + for (int index8 = 0; index8 < 20; ++index8) { - int index12 = Dust.NewDust(this.oldPos[2], this.width, this.height, 71, -SpeedX, -SpeedY, 200, Scale: 2f); - Main.dust[index12].noGravity = true; - Main.dust[index12].velocity.X *= 2f; + int index9 = Dust.NewDust(this.oldPos[2], this.width, this.height, 71, -SpeedX, -SpeedY, 200, Scale: 2f); + Main.dust[index9].noGravity = true; + Main.dust[index9].velocity.X *= 2f; } - this.position = this.position - this.netOffset; } } - bool flag7 = false; - bool flag8 = true; - if (this.type == 343 || this.type == 47 || this.type == 67 || this.type == 109 || this.type == 110 || this.type == 111 || this.type == 120 || this.type == 163 || this.type == 164 || this.type == 239 || this.type == 168 || this.type == 199 || this.type == 206 || this.type == 214 || this.type == 215 || this.type == 216 || this.type == 217 || this.type == 218 || this.type == 219 || this.type == 220 || this.type == 226 || this.type == 243 || this.type == 251 || this.type == 257 || this.type == 258 || this.type == 290 || this.type == 291 || this.type == 292 || this.type == 293 || this.type == 305 || this.type == 306 || this.type == 307 || this.type == 308 || this.type == 309 || this.type == 348 || this.type == 349 || this.type == 350 || this.type == 351 || this.type == 379 || this.type >= 430 && this.type <= 436 || this.type == 591 || this.type == 380 || this.type == 381 || this.type == 382 || this.type == 383 || this.type == 386 || this.type == 391 || this.type >= 449 && this.type <= 452 || this.type == 466 || this.type == 464 || this.type == 166 || this.type == 469 || this.type == 468 || this.type == 471 || this.type == 470 || this.type == 480 || this.type == 481 || this.type == 482 || this.type == 411 || this.type == 424 || this.type == 409 || this.type >= 494 && this.type <= 506 || this.type == 425 || this.type == 427 || this.type == 426 || this.type == 428 || this.type == 580 || this.type == 508 || this.type == 415 || this.type == 419 || this.type == 520 || this.type >= 524 && this.type <= 527 || this.type == 528 || this.type == 529 || this.type == 530 || this.type == 532 || this.type == 582 || this.type == 624 || this.type == 631) - flag8 = false; - bool flag9 = false; + bool flag2 = false; + bool flag3 = true; + if (this.type == 343 || this.type == 47 || this.type == 67 || this.type == 109 || this.type == 110 || this.type == 111 || this.type == 120 || this.type == 163 || this.type == 164 || this.type == 239 || this.type == 168 || this.type == 199 || this.type == 206 || this.type == 214 || this.type == 215 || this.type == 216 || this.type == 217 || this.type == 218 || this.type == 219 || this.type == 220 || this.type == 226 || this.type == 243 || this.type == 251 || this.type == 257 || this.type == 258 || this.type == 290 || this.type == 291 || this.type == 292 || this.type == 293 || this.type == 305 || this.type == 306 || this.type == 307 || this.type == 308 || this.type == 309 || this.type == 348 || this.type == 349 || this.type == 350 || this.type == 351 || this.type == 379 || this.type >= 430 && this.type <= 436 || this.type == 380 || this.type == 381 || this.type == 382 || this.type == 383 || this.type == 386 || this.type == 391 || this.type >= 449 && this.type <= 452 || this.type == 466 || this.type == 464 || this.type == 166 || this.type == 469 || this.type == 468 || this.type == 471 || this.type == 470 || this.type == 480 || this.type == 481 || this.type == 482 || this.type == 411 || this.type == 424 || this.type == 409 || this.type >= 494 && this.type <= 506 || this.type == 425 || this.type == 427 || this.type == 426 || this.type == 428 || this.type == 508 || this.type == 415 || this.type == 419 || this.type == 520 || this.type >= 524 && this.type <= 527 || this.type == 528 || this.type == 529 || this.type == 530 || this.type == 532) + flag3 = false; + bool flag4 = false; switch (this.type) { case 425: case 471: - flag9 = true; + flag4 = true; break; } - bool flag10 = true; + bool flag5 = true; switch (this.type) { case 110: @@ -22471,28 +16774,25 @@ label_422: case 520: if ((double) this.ai[2] > 0.0) { - flag10 = false; + flag5 = false; break; } break; } - if (!flag9 & flag10) + if (!flag4 & flag5) { if ((double) this.velocity.Y == 0.0 && ((double) this.velocity.X > 0.0 && this.direction < 0 || (double) this.velocity.X < 0.0 && this.direction > 0)) - flag7 = true; - if ((((double) this.position.X == (double) this.oldPosition.X ? 1 : ((double) this.ai[3] >= (double) num32 ? 1 : 0)) | (flag7 ? 1 : 0)) != 0) + flag2 = true; + if ((((double) this.position.X == (double) this.oldPosition.X ? 1 : ((double) this.ai[3] >= (double) num26 ? 1 : 0)) | (flag2 ? 1 : 0)) != 0) ++this.ai[3]; else if ((double) Math.Abs(this.velocity.X) > 0.9 && (double) this.ai[3] > 0.0) --this.ai[3]; - if ((double) this.ai[3] > (double) (num32 * 10)) + if ((double) this.ai[3] > (double) (num26 * 10)) this.ai[3] = 0.0f; if (this.justHit) this.ai[3] = 0.0f; - if ((double) this.ai[3] == (double) num32) + if ((double) this.ai[3] == (double) num26) this.netUpdate = true; - hitbox = Main.player[this.target].Hitbox; - if (hitbox.Intersects(this.Hitbox)) - this.ai[3] = 0.0f; } if (this.type == 463 && Main.netMode != 1) { @@ -22516,15 +16816,15 @@ label_422: } if (maxValue > 1) { - for (int index13 = 0; index13 < 100; ++index13) + for (int index10 = 0; index10 < 100; ++index10) { - int index14 = Main.rand.Next(maxValue); - int index15 = index14; - while (index15 == index14) - index15 = Main.rand.Next(maxValue); - int num36 = numArray[index14]; - numArray[index14] = numArray[index15]; - numArray[index15] = num36; + int index11 = Main.rand.Next(maxValue); + int index12 = index11; + while (index12 == index11) + index12 = Main.rand.Next(maxValue); + int num30 = numArray[index11]; + numArray[index11] = numArray[index12]; + numArray[index12] = num30; } } Vector2 vector2_10 = new Vector2(-1f, -1f); @@ -22537,7 +16837,7 @@ label_422: vector2_10.Normalize(); for (int index = 0; index < length; ++index) { - float num37 = (float) Main.rand.Next(8, 13); + float num31 = (float) Main.rand.Next(8, 13); Vector2 vector2_12 = new Vector2((float) Main.rand.Next(-100, 101), (float) Main.rand.Next(-100, 101)); vector2_12.Normalize(); if (maxValue > 0) @@ -22545,58 +16845,57 @@ label_422: vector2_12 += vector2_10; vector2_12.Normalize(); } - vector2_12 *= num37; + vector2_12 *= num31; if (maxValue > 0) { --maxValue; vector2_12 = Main.player[numArray[maxValue]].Center - this.Center; vector2_12.Normalize(); - vector2_12 *= num37; + vector2_12 *= num31; } Projectile.NewProjectile(this.Center.X, this.position.Y + (float) (this.width / 4), vector2_12.X, vector2_12.Y, 498, (int) ((double) this.damage * 0.15), 1f); } } } if (this.type == 460) - this.knockBackResist = (double) this.velocity.Y < -(double) NPC.gravity || (double) this.velocity.Y > (double) NPC.gravity ? 0.0f : 0.25f * Main.GameModeInfo.KnockbackToEnemiesMultiplier; + this.knockBackResist = (double) this.velocity.Y < -(double) NPC.gravity || (double) this.velocity.Y > (double) NPC.gravity ? 0.0f : 0.25f * Main.knockBackMultiplier; if (this.type == 469) { - this.knockBackResist = 0.45f * Main.GameModeInfo.KnockbackToEnemiesMultiplier; + this.knockBackResist = 0.45f * Main.knockBackMultiplier; if ((double) this.ai[2] == 1.0) this.knockBackResist = 0.0f; - bool flag11 = false; - int num38 = (int) this.Center.X / 16; - int num39 = (int) this.Center.Y / 16; - for (int index16 = num38 - 1; index16 <= num38 + 1; ++index16) + bool flag6 = false; + int num32 = (int) this.Center.X / 16; + int num33 = (int) this.Center.Y / 16; + for (int index13 = num32 - 1; index13 <= num32 + 1; ++index13) { - for (int index17 = num39 - 1; index17 <= num39 + 1; ++index17) + for (int index14 = num33 - 1; index14 <= num33 + 1; ++index14) { - if (Main.tile[index16, index17] != null && Main.tile[index16, index17].wall > (ushort) 0) + if (Main.tile[index13, index14] != null && Main.tile[index13, index14].wall > (byte) 0) { - flag11 = true; + flag6 = true; break; } } - if (flag11) + if (flag6) break; } - if ((double) this.ai[2] == 0.0 & flag11) + if ((double) this.ai[2] == 0.0 & flag6) { if ((double) this.velocity.Y == 0.0) { - flag1 = true; this.velocity.Y = -4.6f; this.velocity.X *= 1.3f; } - else if ((double) this.velocity.Y > 0.0 && !Main.player[this.target].dead) + else if ((double) this.velocity.Y > 0.0) this.ai[2] = 1f; } - if (flag11 && (double) this.ai[2] == 1.0 && !Main.player[this.target].dead && Collision.CanHit(this.Center, 1, 1, Main.player[this.target].Center, 1, 1)) + if (flag6 && (double) this.ai[2] == 1.0 && Collision.CanHit(this.Center, 1, 1, Main.player[this.target].Center, 1, 1)) { Vector2 vector2 = Main.player[this.target].Center - this.Center; - float num40 = vector2.Length(); + float num34 = vector2.Length(); vector2.Normalize(); - this.velocity = (this.velocity * 29f + vector2 * (float) (4.5 + (double) num40 / 300.0)) / 30f; + this.velocity = (this.velocity * 29f + vector2 * (float) (4.5 + (double) num34 / 300.0)) / 30f; this.noGravity = true; this.ai[2] = 1f; return; @@ -22606,7 +16905,6 @@ label_422: } if (this.type == 462 && (double) this.velocity.Y == 0.0 && (double) (Main.player[this.target].Center - this.Center).Length() < 150.0 && (double) Math.Abs(this.velocity.X) > 3.0 && ((double) this.velocity.X < 0.0 && (double) this.Center.X > (double) Main.player[this.target].Center.X || (double) this.velocity.X > 0.0 && (double) this.Center.X < (double) Main.player[this.target].Center.X)) { - flag1 = true; this.velocity.X *= 1.75f; this.velocity.Y -= 4.5f; if ((double) this.Center.Y - (double) Main.player[this.target].Center.Y > 20.0) @@ -22625,48 +16923,28 @@ label_422: this.velocity.X = 7f; } } - if (this.type == 624 && this.target < (int) byte.MaxValue) + if ((double) this.ai[3] < (double) num26 && (Main.eclipse || !Main.dayTime || (double) this.position.Y > Main.worldSurface * 16.0 || Main.invasionType == 1 && (this.type == 343 || this.type == 350) || Main.invasionType == 1 && (this.type == 26 || this.type == 27 || this.type == 28 || this.type == 111 || this.type == 471) || this.type == 73 || Main.invasionType == 3 && this.type >= 212 && this.type <= 216 || Main.invasionType == 4 && (this.type == 381 || this.type == 382 || this.type == 383 || this.type == 385 || this.type == 386 || this.type == 389 || this.type == 391 || this.type == 520) || this.type == 31 || this.type == 294 || this.type == 295 || this.type == 296 || this.type == 47 || this.type == 67 || this.type == 77 || this.type == 78 || this.type == 79 || this.type == 80 || this.type == 110 || this.type == 120 || this.type == 168 || this.type == 181 || this.type == 185 || this.type == 198 || this.type == 199 || this.type == 206 || this.type == 217 || this.type == 218 || this.type == 219 || this.type == 220 || this.type == 239 || this.type == 243 || this.type == 254 || this.type == (int) byte.MaxValue || this.type == 257 || this.type == 258 || this.type == 291 || this.type == 292 || this.type == 293 || this.type == 379 || this.type == 380 || this.type == 464 || this.type == 470 || this.type == 424 || this.type == 411 && ((double) this.ai[1] >= 180.0 || (double) this.ai[1] < 90.0) || this.type == 409 || this.type == 425 || this.type == 429 || this.type == 427 || this.type == 428 || this.type == 508 || this.type == 415 || this.type == 419 || this.type >= 524 && this.type <= 527 || this.type == 528 || this.type == 529 || this.type == 530 || this.type == 532)) { - if (!Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) - { - this.ai[3] = (float) num32; - this.directionY = -1; - if (this.type == 624 && (!Main.dayTime || !WorldGen.InAPlaceWithWind(this.position, this.width, this.height)) && (double) (this.Center - Main.player[this.target].Center).Length() > 500.0) - { - this.velocity.X *= 0.95f; - if ((double) this.velocity.X <= -0.1 || (double) this.velocity.X >= 0.1) - return; - this.velocity.X = 0.0f; - return; - } - } - else if ((double) Main.player[this.target].Center.Y > (double) this.Center.Y - 128.0) - this.ai[3] = 0.0f; - } - if ((double) this.ai[3] < (double) num32 && NPC.DespawnEncouragement_AIStyle3_Fighters_NotDiscouraged(this.type, this.position, this)) - { - if ((this.type == 3 || this.type == 591 || this.type == 590 || this.type == 331 || this.type == 332 || this.type == 21 || this.type >= 449 && this.type <= 452 || this.type == 31 || this.type == 294 || this.type == 295 || this.type == 296 || this.type == 77 || this.type == 110 || this.type == 132 || this.type == 167 || this.type == 161 || this.type == 162 || this.type == 186 || this.type == 187 || this.type == 188 || this.type == 189 || this.type == 197 || this.type == 200 || this.type == 201 || this.type == 202 || this.type == 203 || this.type == 223 || this.type == 291 || this.type == 292 || this.type == 293 || this.type == 320 || this.type == 321 || this.type == 319 || this.type == 481 || this.type == 632 || this.type == 635) && Main.rand.Next(1000) == 0) - SoundEngine.PlaySound(14, (int) this.position.X, (int) this.position.Y); - if ((this.type == 489 || this.type == 586) && Main.rand.Next(800) == 0) - SoundEngine.PlaySound(14, (int) this.position.X, (int) this.position.Y, this.type); - if ((this.type == 78 || this.type == 79 || this.type == 80 || this.type == 630) && Main.rand.Next(500) == 0) - SoundEngine.PlaySound(26, (int) this.position.X, (int) this.position.Y); + if ((this.type == 3 || this.type == 331 || this.type == 332 || this.type == 21 || this.type >= 449 && this.type <= 452 || this.type == 31 || this.type == 294 || this.type == 295 || this.type == 296 || this.type == 77 || this.type == 110 || this.type == 132 || this.type == 167 || this.type == 161 || this.type == 162 || this.type == 186 || this.type == 187 || this.type == 188 || this.type == 189 || this.type == 197 || this.type == 200 || this.type == 201 || this.type == 202 || this.type == 203 || this.type == 223 || this.type == 291 || this.type == 292 || this.type == 293 || this.type == 320 || this.type == 321 || this.type == 319 || this.type == 481) && Main.rand.Next(1000) == 0) + Main.PlaySound(14, (int) this.position.X, (int) this.position.Y); + if (this.type == 489 && Main.rand.Next(800) == 0) + Main.PlaySound(14, (int) this.position.X, (int) this.position.Y, this.type); + if ((this.type == 78 || this.type == 79 || this.type == 80) && Main.rand.Next(500) == 0) + Main.PlaySound(26, (int) this.position.X, (int) this.position.Y); if (this.type == 159 && Main.rand.Next(500) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, 7); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, 7); if (this.type == 162 && Main.rand.Next(500) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, 6); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, 6); if (this.type == 181 && Main.rand.Next(500) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, 8); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, 8); if (this.type >= 269 && this.type <= 280 && Main.rand.Next(1000) == 0) - SoundEngine.PlaySound(14, (int) this.position.X, (int) this.position.Y); + Main.PlaySound(14, (int) this.position.X, (int) this.position.Y); this.TargetClosest(); - if (this.directionY > 0 && (double) Main.player[this.target].Center.Y <= (double) this.Bottom.Y) - this.directionY = -1; } - else if ((double) this.ai[2] <= 0.0 || !NPC.DespawnEncouragement_AIStyle3_Fighters_CanBeBusyWithAction(this.type)) + else if ((double) this.ai[2] <= 0.0 || this.type != 110 && this.type != 111 && this.type != 206 && this.type != 216 && this.type != 214 && this.type != 215 && this.type != 291 && this.type != 292 && this.type != 293 && this.type != 350 && this.type != 381 && this.type != 382 && this.type != 383 && this.type != 385 && this.type != 386 && this.type != 389 && this.type != 391 && this.type != 469 && this.type != 166 && this.type != 466 && this.type != 471 && this.type != 411 && this.type != 409 && this.type != 424 && this.type != 425 && this.type != 426 && this.type != 415 && this.type != 419 && this.type != 520) { - if (Main.dayTime && (double) this.position.Y / 16.0 < Main.worldSurface && this.type != 624 && this.type != 631) - this.EncourageDespawn(10); + if (Main.dayTime && (double) this.position.Y / 16.0 < Main.worldSurface && this.timeLeft > 10) + this.timeLeft = 10; if ((double) this.velocity.X == 0.0) { if ((double) this.velocity.Y == 0.0) @@ -22799,138 +17077,130 @@ label_422: this.velocity.X = -2f; } } - else if (this.type == 21 || this.type == 26 || this.type == 31 || this.type == 294 || this.type == 295 || this.type == 296 || this.type == 47 || this.type == 73 || this.type == 140 || this.type == 164 || this.type == 239 || this.type == 167 || this.type == 168 || this.type == 185 || this.type == 198 || this.type == 201 || this.type == 202 || this.type == 203 || this.type == 217 || this.type == 218 || this.type == 219 || this.type == 226 || this.type == 181 || this.type == 254 || this.type == 338 || this.type == 339 || this.type == 340 || this.type == 342 || this.type == 385 || this.type == 389 || this.type == 462 || this.type == 463 || this.type == 466 || this.type == 464 || this.type == 469 || this.type == 470 || this.type == 480 || this.type == 482 || this.type == 425 || this.type == 429 || this.type == 586 || this.type == 631 || this.type == 635) + else if (this.type == 21 || this.type == 26 || this.type == 31 || this.type == 294 || this.type == 295 || this.type == 296 || this.type == 47 || this.type == 73 || this.type == 140 || this.type == 164 || this.type == 239 || this.type == 167 || this.type == 168 || this.type == 185 || this.type == 198 || this.type == 201 || this.type == 202 || this.type == 203 || this.type == 217 || this.type == 218 || this.type == 219 || this.type == 226 || this.type == 181 || this.type == 254 || this.type == 338 || this.type == 339 || this.type == 340 || this.type == 342 || this.type == 385 || this.type == 389 || this.type == 462 || this.type == 463 || this.type == 466 || this.type == 464 || this.type == 469 || this.type == 470 || this.type == 480 || this.type == 482 || this.type == 425 || this.type == 429) { - float num41 = 1.5f; + float num35 = 1.5f; if (this.type == 294) - num41 = 2f; + num35 = 2f; else if (this.type == 295) - num41 = 1.75f; + num35 = 1.75f; else if (this.type == 296) - num41 = 1.25f; + num35 = 1.25f; else if (this.type == 201) - num41 = 1.1f; + num35 = 1.1f; else if (this.type == 202) - num41 = 0.9f; + num35 = 0.9f; else if (this.type == 203) - num41 = 1.2f; + num35 = 1.2f; else if (this.type == 338) - num41 = 1.75f; + num35 = 1.75f; else if (this.type == 339) - num41 = 1.25f; + num35 = 1.25f; else if (this.type == 340) - num41 = 2f; + num35 = 2f; else if (this.type == 385) - num41 = 1.8f; + num35 = 1.8f; else if (this.type == 389) - num41 = 2.25f; + num35 = 2.25f; else if (this.type == 462) - num41 = 4f; + num35 = 4f; else if (this.type == 463) - num41 = 0.75f; + num35 = 0.75f; else if (this.type == 466) - num41 = 3.75f; + num35 = 3.75f; else if (this.type == 469) - num41 = 3.25f; + num35 = 3.25f; else if (this.type == 480) - num41 = (float) (1.5 + (1.0 - (double) this.life / (double) this.lifeMax) * 2.0); + num35 = (float) (1.5 + (1.0 - (double) this.life / (double) this.lifeMax) * 2.0); else if (this.type == 425) - num41 = 6f; + num35 = 6f; else if (this.type == 429) - num41 = 4f; - else if (this.type == 631) - num41 = 0.9f; - else if (this.type == 586) - num41 = (float) (1.5 + (1.0 - (double) this.life / (double) this.lifeMax) * 3.5); - if (this.type == 21 || this.type == 201 || this.type == 202 || this.type == 203 || this.type == 342 || this.type == 635) - num41 *= (float) (1.0 + (1.0 - (double) this.scale)); - if ((double) this.velocity.X < -(double) num41 || (double) this.velocity.X > (double) num41) + num35 = 4f; + if (this.type == 21 || this.type == 201 || this.type == 202 || this.type == 203 || this.type == 342) + num35 *= (float) (1.0 + (1.0 - (double) this.scale)); + if ((double) this.velocity.X < -(double) num35 || (double) this.velocity.X > (double) num35) { if ((double) this.velocity.Y == 0.0) this.velocity = this.velocity * 0.8f; } - else if ((double) this.velocity.X < (double) num41 && this.direction == 1) + else if ((double) this.velocity.X < (double) num35 && this.direction == 1) { if (this.type == 466 && (double) this.velocity.X < -2.0) this.velocity.X *= 0.9f; - if (this.type == 586 && (double) this.velocity.Y == 0.0 && (double) this.velocity.X < -1.0) - this.velocity.X *= 0.9f; this.velocity.X += 0.07f; - if ((double) this.velocity.X > (double) num41) - this.velocity.X = num41; + if ((double) this.velocity.X > (double) num35) + this.velocity.X = num35; } - else if ((double) this.velocity.X > -(double) num41 && this.direction == -1) + else if ((double) this.velocity.X > -(double) num35 && this.direction == -1) { if (this.type == 466 && (double) this.velocity.X > 2.0) this.velocity.X *= 0.9f; - if (this.type == 586 && (double) this.velocity.Y == 0.0 && (double) this.velocity.X > 1.0) - this.velocity.X *= 0.9f; this.velocity.X -= 0.07f; - if ((double) this.velocity.X < -(double) num41) - this.velocity.X = -num41; + if ((double) this.velocity.X < -(double) num35) + this.velocity.X = -num35; } if ((double) this.velocity.Y == 0.0 && this.type == 462 && (this.direction > 0 && (double) this.velocity.X < 0.0 || this.direction < 0 && (double) this.velocity.X > 0.0)) this.velocity.X *= 0.9f; } else if (this.type >= 269 && this.type <= 280) { - float num42 = 1.5f; + float num36 = 1.5f; if (this.type == 269) - num42 = 2f; + num36 = 2f; if (this.type == 270) - num42 = 1f; + num36 = 1f; if (this.type == 271) - num42 = 1.5f; + num36 = 1.5f; if (this.type == 272) - num42 = 3f; + num36 = 3f; if (this.type == 273) - num42 = 1.25f; + num36 = 1.25f; if (this.type == 274) - num42 = 3f; + num36 = 3f; if (this.type == 275) - num42 = 3.25f; + num36 = 3.25f; if (this.type == 276) - num42 = 2f; + num36 = 2f; if (this.type == 277) - num42 = 2.75f; + num36 = 2.75f; if (this.type == 278) - num42 = 1.8f; + num36 = 1.8f; if (this.type == 279) - num42 = 1.3f; + num36 = 1.3f; if (this.type == 280) - num42 = 2.5f; - float num43 = num42 * (float) (1.0 + (1.0 - (double) this.scale)); - if ((double) this.velocity.X < -(double) num43 || (double) this.velocity.X > (double) num43) + num36 = 2.5f; + float num37 = num36 * (float) (1.0 + (1.0 - (double) this.scale)); + if ((double) this.velocity.X < -(double) num37 || (double) this.velocity.X > (double) num37) { if ((double) this.velocity.Y == 0.0) this.velocity = this.velocity * 0.8f; } - else if ((double) this.velocity.X < (double) num43 && this.direction == 1) + else if ((double) this.velocity.X < (double) num37 && this.direction == 1) { this.velocity.X += 0.07f; - if ((double) this.velocity.X > (double) num43) - this.velocity.X = num43; + if ((double) this.velocity.X > (double) num37) + this.velocity.X = num37; } - else if ((double) this.velocity.X > -(double) num43 && this.direction == -1) + else if ((double) this.velocity.X > -(double) num37 && this.direction == -1) { this.velocity.X -= 0.07f; - if ((double) this.velocity.X < -(double) num43) - this.velocity.X = -num43; + if ((double) this.velocity.X < -(double) num37) + this.velocity.X = -num37; } } else if (this.type >= 305 && this.type <= 314) { - float num44 = 1.5f; + float num38 = 1.5f; if (this.type == 305 || this.type == 310) - num44 = 2f; + num38 = 2f; if (this.type == 306 || this.type == 311) - num44 = 1.25f; + num38 = 1.25f; if (this.type == 307 || this.type == 312) - num44 = 2.25f; + num38 = 2.25f; if (this.type == 308 || this.type == 313) - num44 = 1.5f; + num38 = 1.5f; if (this.type == 309 || this.type == 314) - num44 = 1f; + num38 = 1f; if (this.type < 310) { if ((double) this.velocity.Y == 0.0) @@ -22938,30 +17208,29 @@ label_422: this.velocity.X *= 0.85f; if ((double) this.velocity.X > -0.3 && (double) this.velocity.X < 0.3) { - flag1 = true; this.velocity.Y = -7f; - this.velocity.X = num44 * (float) this.direction; + this.velocity.X = num38 * (float) this.direction; } } else if (this.spriteDirection == this.direction) - this.velocity.X = (float) (((double) this.velocity.X * 10.0 + (double) num44 * (double) this.direction) / 11.0); + this.velocity.X = (float) (((double) this.velocity.X * 10.0 + (double) num38 * (double) this.direction) / 11.0); } - else if ((double) this.velocity.X < -(double) num44 || (double) this.velocity.X > (double) num44) + else if ((double) this.velocity.X < -(double) num38 || (double) this.velocity.X > (double) num38) { if ((double) this.velocity.Y == 0.0) this.velocity = this.velocity * 0.8f; } - else if ((double) this.velocity.X < (double) num44 && this.direction == 1) + else if ((double) this.velocity.X < (double) num38 && this.direction == 1) { this.velocity.X += 0.07f; - if ((double) this.velocity.X > (double) num44) - this.velocity.X = num44; + if ((double) this.velocity.X > (double) num38) + this.velocity.X = num38; } - else if ((double) this.velocity.X > -(double) num44 && this.direction == -1) + else if ((double) this.velocity.X > -(double) num38 && this.direction == -1) { this.velocity.X -= 0.07f; - if ((double) this.velocity.X < -(double) num44) - this.velocity.X = -num44; + if ((double) this.velocity.X < -(double) num38) + this.velocity.X = -num38; } } else if (this.type == 67 || this.type == 220 || this.type == 428) @@ -22984,17 +17253,63 @@ label_422: this.velocity.X = -0.5f; } } - else if (this.type == 78 || this.type == 79 || this.type == 80 || this.type == 630) + else if (this.type == 78 || this.type == 79 || this.type == 80) { - float num45 = 1f; - float num46 = 0.05f; + float num39 = 1f; + float num40 = 0.05f; if (this.life < this.lifeMax / 2) { - num45 = 2f; - num46 = 0.1f; + num39 = 2f; + num40 = 0.1f; } - if (this.type == 79 || this.type == 630) - num45 *= 1.5f; + if (this.type == 79) + num39 *= 1.5f; + if ((double) this.velocity.X < -(double) num39 || (double) this.velocity.X > (double) num39) + { + if ((double) this.velocity.Y == 0.0) + this.velocity = this.velocity * 0.7f; + } + else if ((double) this.velocity.X < (double) num39 && this.direction == 1) + { + this.velocity.X += num40; + if ((double) this.velocity.X > (double) num39) + this.velocity.X = num39; + } + else if ((double) this.velocity.X > -(double) num39 && this.direction == -1) + { + this.velocity.X -= num40; + if ((double) this.velocity.X < -(double) num39) + this.velocity.X = -num39; + } + } + else if (this.type == 287) + { + float num41 = 5f; + float num42 = 0.2f; + if ((double) this.velocity.X < -(double) num41 || (double) this.velocity.X > (double) num41) + { + if ((double) this.velocity.Y == 0.0) + this.velocity = this.velocity * 0.7f; + } + else if ((double) this.velocity.X < (double) num41 && this.direction == 1) + { + this.velocity.X += num42; + if ((double) this.velocity.X > (double) num41) + this.velocity.X = num41; + } + else if ((double) this.velocity.X > -(double) num41 && this.direction == -1) + { + this.velocity.X -= num42; + if ((double) this.velocity.X < -(double) num41) + this.velocity.X = -num41; + } + } + else if (this.type == 243) + { + float num43 = 1f; + float num44 = 0.07f; + float num45 = num43 + (float) ((1.0 - (double) this.life / (double) this.lifeMax) * 1.5); + float num46 = num44 + (float) ((1.0 - (double) this.life / (double) this.lifeMax) * 0.150000005960464); if ((double) this.velocity.X < -(double) num45 || (double) this.velocity.X > (double) num45) { if ((double) this.velocity.Y == 0.0) @@ -23013,74 +17328,28 @@ label_422: this.velocity.X = -num45; } } - else if (this.type == 287) - { - float num47 = 5f; - float num48 = 0.2f; - if ((double) this.velocity.X < -(double) num47 || (double) this.velocity.X > (double) num47) - { - if ((double) this.velocity.Y == 0.0) - this.velocity = this.velocity * 0.7f; - } - else if ((double) this.velocity.X < (double) num47 && this.direction == 1) - { - this.velocity.X += num48; - if ((double) this.velocity.X > (double) num47) - this.velocity.X = num47; - } - else if ((double) this.velocity.X > -(double) num47 && this.direction == -1) - { - this.velocity.X -= num48; - if ((double) this.velocity.X < -(double) num47) - this.velocity.X = -num47; - } - } - else if (this.type == 243) - { - float num49 = 1f; - float num50 = 0.07f; - float num51 = num49 + (float) ((1.0 - (double) this.life / (double) this.lifeMax) * 1.5); - float num52 = num50 + (float) ((1.0 - (double) this.life / (double) this.lifeMax) * 0.150000005960464); - if ((double) this.velocity.X < -(double) num51 || (double) this.velocity.X > (double) num51) - { - if ((double) this.velocity.Y == 0.0) - this.velocity = this.velocity * 0.7f; - } - else if ((double) this.velocity.X < (double) num51 && this.direction == 1) - { - this.velocity.X += num52; - if ((double) this.velocity.X > (double) num51) - this.velocity.X = num51; - } - else if ((double) this.velocity.X > -(double) num51 && this.direction == -1) - { - this.velocity.X -= num52; - if ((double) this.velocity.X < -(double) num51) - this.velocity.X = -num51; - } - } else if (this.type == 251) { - float num53 = 1f; - float num54 = 0.08f; - float num55 = num53 + (float) ((1.0 - (double) this.life / (double) this.lifeMax) * 2.0); - float num56 = num54 + (float) ((1.0 - (double) this.life / (double) this.lifeMax) * 0.200000002980232); - if ((double) this.velocity.X < -(double) num55 || (double) this.velocity.X > (double) num55) + float num47 = 1f; + float num48 = 0.08f; + float num49 = num47 + (float) ((1.0 - (double) this.life / (double) this.lifeMax) * 2.0); + float num50 = num48 + (float) ((1.0 - (double) this.life / (double) this.lifeMax) * 0.200000002980232); + if ((double) this.velocity.X < -(double) num49 || (double) this.velocity.X > (double) num49) { if ((double) this.velocity.Y == 0.0) this.velocity = this.velocity * 0.7f; } - else if ((double) this.velocity.X < (double) num55 && this.direction == 1) + else if ((double) this.velocity.X < (double) num49 && this.direction == 1) { - this.velocity.X += num56; - if ((double) this.velocity.X > (double) num55) - this.velocity.X = num55; + this.velocity.X += num50; + if ((double) this.velocity.X > (double) num49) + this.velocity.X = num49; } - else if ((double) this.velocity.X > -(double) num55 && this.direction == -1) + else if ((double) this.velocity.X > -(double) num49 && this.direction == -1) { - this.velocity.X -= num56; - if ((double) this.velocity.X < -(double) num55) - this.velocity.X = -num55; + this.velocity.X -= num50; + if ((double) this.velocity.X < -(double) num49) + this.velocity.X = -num49; } } else if (this.type == 386) @@ -23092,113 +17361,98 @@ label_422: } else { - float num57 = 0.15f; - float num58 = 1.5f; - if ((double) this.velocity.X < -(double) num58 || (double) this.velocity.X > (double) num58) + float num51 = 0.15f; + float num52 = 1.5f; + if ((double) this.velocity.X < -(double) num52 || (double) this.velocity.X > (double) num52) { if ((double) this.velocity.Y == 0.0) this.velocity = this.velocity * 0.7f; } - else if ((double) this.velocity.X < (double) num58 && this.direction == 1) + else if ((double) this.velocity.X < (double) num52 && this.direction == 1) { - this.velocity.X += num57; - if ((double) this.velocity.X > (double) num58) - this.velocity.X = num58; + this.velocity.X += num51; + if ((double) this.velocity.X > (double) num52) + this.velocity.X = num52; } - else if ((double) this.velocity.X > -(double) num58 && this.direction == -1) + else if ((double) this.velocity.X > -(double) num52 && this.direction == -1) { - this.velocity.X -= num57; - if ((double) this.velocity.X < -(double) num58) - this.velocity.X = -num58; + this.velocity.X -= num51; + if ((double) this.velocity.X < -(double) num52) + this.velocity.X = -num52; } } } else if (this.type == 460) { - float num59 = 3f; - float num60 = 0.1f; + float num53 = 3f; + float num54 = 0.1f; if ((double) Math.Abs(this.velocity.X) > 2.0) - num60 *= 0.8f; + num54 *= 0.8f; if ((double) Math.Abs(this.velocity.X) > 2.5) - num60 *= 0.8f; + num54 *= 0.8f; if ((double) Math.Abs(this.velocity.X) > 3.0) - num60 *= 0.8f; + num54 *= 0.8f; if ((double) Math.Abs(this.velocity.X) > 3.5) - num60 *= 0.8f; + num54 *= 0.8f; if ((double) Math.Abs(this.velocity.X) > 4.0) - num60 *= 0.8f; + num54 *= 0.8f; if ((double) Math.Abs(this.velocity.X) > 4.5) - num60 *= 0.8f; + num54 *= 0.8f; if ((double) Math.Abs(this.velocity.X) > 5.0) - num60 *= 0.8f; + num54 *= 0.8f; if ((double) Math.Abs(this.velocity.X) > 5.5) - num60 *= 0.8f; - float num61 = num59 + (float) ((1.0 - (double) this.life / (double) this.lifeMax) * 3.0); - if ((double) this.velocity.X < -(double) num61 || (double) this.velocity.X > (double) num61) + num54 *= 0.8f; + float num55 = num53 + (float) ((1.0 - (double) this.life / (double) this.lifeMax) * 3.0); + if ((double) this.velocity.X < -(double) num55 || (double) this.velocity.X > (double) num55) { if ((double) this.velocity.Y == 0.0) this.velocity = this.velocity * 0.7f; } - else if ((double) this.velocity.X < (double) num61 && this.direction == 1) + else if ((double) this.velocity.X < (double) num55 && this.direction == 1) { if ((double) this.velocity.X < 0.0) this.velocity.X *= 0.93f; - this.velocity.X += num60; - if ((double) this.velocity.X > (double) num61) - this.velocity.X = num61; + this.velocity.X += num54; + if ((double) this.velocity.X > (double) num55) + this.velocity.X = num55; } - else if ((double) this.velocity.X > -(double) num61 && this.direction == -1) + else if ((double) this.velocity.X > -(double) num55 && this.direction == -1) { if ((double) this.velocity.X > 0.0) this.velocity.X *= 0.93f; - this.velocity.X -= num60; - if ((double) this.velocity.X < -(double) num61) - this.velocity.X = -num61; + this.velocity.X -= num54; + if ((double) this.velocity.X < -(double) num55) + this.velocity.X = -num55; } } - else if (this.type == 508 || this.type == 580 || this.type == 582) + else if (this.type == 508) { - float num62 = 2.5f; - float num63 = 10f; - float num64 = Math.Abs(this.velocity.X); - if (this.type == 582) + float num56 = 2.5f; + float num57 = 40f; + float num58 = Math.Abs(this.velocity.X); + if ((double) num58 > 2.75) { - num62 = 2.5f; - num63 = 7f; - if ((double) num64 > 2.75) - { - num62 = 3.5f; - num63 += 75f; - } - else if ((double) num64 > 2.25) - { - num62 = 2f; - num63 += 55f; - } + num56 = 3.5f; + num57 += 80f; } - else if ((double) num64 > 2.75) + else if ((double) num58 > 2.25) { - num62 = 3.5f; - num63 += 80f; - } - else if ((double) num64 > 2.25) - { - num62 = 3f; - num63 += 60f; + num56 = 3f; + num57 += 60f; } if ((double) Math.Abs(this.velocity.Y) < 0.5) { if ((double) this.velocity.X > 0.0 && this.direction < 0) - this.velocity = this.velocity * 0.95f; + this.velocity = this.velocity * 0.9f; if ((double) this.velocity.X < 0.0 && this.direction > 0) - this.velocity = this.velocity * 0.95f; + this.velocity = this.velocity * 0.9f; } if ((double) Math.Abs(this.velocity.Y) > (double) NPC.gravity) - num63 *= 3f; + num57 *= 3f; if ((double) this.velocity.X <= 0.0 && this.direction < 0) - this.velocity.X = (float) (((double) this.velocity.X * (double) num63 - (double) num62) / ((double) num63 + 1.0)); + this.velocity.X = (float) (((double) this.velocity.X * (double) num57 - (double) num56) / ((double) num57 + 1.0)); else if ((double) this.velocity.X >= 0.0 && this.direction > 0) - this.velocity.X = (float) (((double) this.velocity.X * (double) num63 + (double) num62) / ((double) num63 + 1.0)); + this.velocity.X = (float) (((double) this.velocity.X * (double) num57 + (double) num56) / ((double) num57 + 1.0)); else if ((double) Math.Abs(this.Center.X - Main.player[this.target].Center.X) > 20.0 && (double) Math.Abs(this.velocity.Y) <= (double) NPC.gravity) { this.velocity.X *= 0.99f; @@ -23207,87 +17461,87 @@ label_422: } else if (this.type == 391 || this.type == 427 || this.type == 415 || this.type == 419 || this.type == 518 || this.type == 532) { - float num65 = 5f; - float num66 = 0.25f; - float num67 = 0.7f; + float num59 = 5f; + float num60 = 0.25f; + float num61 = 0.7f; if (this.type == 427) { - num65 = 6f; - num66 = 0.2f; - num67 = 0.8f; + num59 = 6f; + num60 = 0.2f; + num61 = 0.8f; } else if (this.type == 415) { - num65 = 4f; - num66 = 0.1f; - num67 = 0.95f; + num59 = 4f; + num60 = 0.1f; + num61 = 0.95f; } else if (this.type == 419) { - num65 = 6f; - num66 = 0.15f; - num67 = 0.85f; + num59 = 6f; + num60 = 0.15f; + num61 = 0.85f; } else if (this.type == 518) { - num65 = 5f; - num66 = 0.1f; - num67 = 0.95f; + num59 = 5f; + num60 = 0.1f; + num61 = 0.95f; } else if (this.type == 532) { - num65 = 5f; - num66 = 0.15f; - num67 = 0.98f; + num59 = 5f; + num60 = 0.15f; + num61 = 0.98f; } - if ((double) this.velocity.X < -(double) num65 || (double) this.velocity.X > (double) num65) + if ((double) this.velocity.X < -(double) num59 || (double) this.velocity.X > (double) num59) { if ((double) this.velocity.Y == 0.0) - this.velocity = this.velocity * num67; + this.velocity = this.velocity * num61; } - else if ((double) this.velocity.X < (double) num65 && this.direction == 1) + else if ((double) this.velocity.X < (double) num59 && this.direction == 1) { - this.velocity.X += num66; - if ((double) this.velocity.X > (double) num65) - this.velocity.X = num65; + this.velocity.X += num60; + if ((double) this.velocity.X > (double) num59) + this.velocity.X = num59; } - else if ((double) this.velocity.X > -(double) num65 && this.direction == -1) + else if ((double) this.velocity.X > -(double) num59 && this.direction == -1) { - this.velocity.X -= num66; - if ((double) this.velocity.X < -(double) num65) - this.velocity.X = -num65; + this.velocity.X -= num60; + if ((double) this.velocity.X < -(double) num59) + this.velocity.X = -num59; } } - else if (this.type >= 430 && this.type <= 436 || this.type == 494 || this.type == 495 || this.type == 591) + else if (this.type >= 430 && this.type <= 436 || this.type == 494 || this.type == 495) { if ((double) this.ai[2] == 0.0) { this.damage = this.defDamage; - float num68 = 1f * (float) (1.0 + (1.0 - (double) this.scale)); - if ((double) this.velocity.X < -(double) num68 || (double) this.velocity.X > (double) num68) + float num62 = 1f * (float) (1.0 + (1.0 - (double) this.scale)); + if ((double) this.velocity.X < -(double) num62 || (double) this.velocity.X > (double) num62) { if ((double) this.velocity.Y == 0.0) this.velocity = this.velocity * 0.8f; } - else if ((double) this.velocity.X < (double) num68 && this.direction == 1) + else if ((double) this.velocity.X < (double) num62 && this.direction == 1) { this.velocity.X += 0.07f; - if ((double) this.velocity.X > (double) num68) - this.velocity.X = num68; + if ((double) this.velocity.X > (double) num62) + this.velocity.X = num62; } - else if ((double) this.velocity.X > -(double) num68 && this.direction == -1) + else if ((double) this.velocity.X > -(double) num62 && this.direction == -1) { this.velocity.X -= 0.07f; - if ((double) this.velocity.X < -(double) num68) - this.velocity.X = -num68; + if ((double) this.velocity.X < -(double) num62) + this.velocity.X = -num62; } if ((double) this.velocity.Y == 0.0 && (!Main.dayTime || (double) this.position.Y > Main.worldSurface * 16.0) && !Main.player[this.target].dead) { Vector2 vector2 = this.Center - Main.player[this.target].Center; - int num69 = 50; + int num63 = 50; if (this.type >= 494 && this.type <= 495) - num69 = 42; - if ((double) vector2.Length() < (double) num69 && Collision.CanHit(this.Center, 1, 1, Main.player[this.target].Center, 1, 1)) + num63 = 42; + if ((double) vector2.Length() < (double) num63 && Collision.CanHit(this.Center, 1, 1, Main.player[this.target].Center, 1, 1)) { this.velocity.X *= 0.7f; this.ai[2] = 1f; @@ -23308,50 +17562,46 @@ label_422: } else if (this.type != 110 && this.type != 111 && this.type != 206 && this.type != 214 && this.type != 215 && this.type != 216 && this.type != 290 && this.type != 291 && this.type != 292 && this.type != 293 && this.type != 350 && this.type != 379 && this.type != 380 && this.type != 381 && this.type != 382 && (this.type < 449 || this.type > 452) && this.type != 468 && this.type != 481 && this.type != 411 && this.type != 409 && (this.type < 498 || this.type > 506) && this.type != 424 && this.type != 426 && this.type != 520) { - float num70 = 1f; - if (this.type == 624) - num70 = 2.5f; + float num64 = 1f; if (this.type == 186) - num70 = 1.1f; + num64 = 1.1f; if (this.type == 187) - num70 = 0.9f; + num64 = 0.9f; if (this.type == 188) - num70 = 1.2f; + num64 = 1.2f; if (this.type == 189) - num70 = 0.8f; + num64 = 0.8f; if (this.type == 132) - num70 = 0.95f; + num64 = 0.95f; if (this.type == 200) - num70 = 0.87f; + num64 = 0.87f; if (this.type == 223) - num70 = 1.05f; - if (this.type == 632) - num70 = 0.8f; + num64 = 1.05f; if (this.type == 489) { - float num71 = (Main.player[this.target].Center - this.Center).Length() * (1f / 400f); - if ((double) num71 > 1.5) - num71 = 1.5f; - num70 = (!Main.expertMode ? 2.5f - num71 : 3f - num71) * 0.8f; + float num65 = (Main.player[this.target].Center - this.Center).Length() * (1f / 400f); + if ((double) num65 > 1.5) + num65 = 1.5f; + num64 = (!Main.expertMode ? 2.5f - num65 : 3f - num65) * 0.8f; } if (this.type == 489 || this.type == 3 || this.type == 132 || this.type == 186 || this.type == 187 || this.type == 188 || this.type == 189 || this.type == 200 || this.type == 223 || this.type == 331 || this.type == 332) - num70 *= (float) (1.0 + (1.0 - (double) this.scale)); - if ((double) this.velocity.X < -(double) num70 || (double) this.velocity.X > (double) num70) + num64 *= (float) (1.0 + (1.0 - (double) this.scale)); + if ((double) this.velocity.X < -(double) num64 || (double) this.velocity.X > (double) num64) { if ((double) this.velocity.Y == 0.0) this.velocity = this.velocity * 0.8f; } - else if ((double) this.velocity.X < (double) num70 && this.direction == 1) + else if ((double) this.velocity.X < (double) num64 && this.direction == 1) { this.velocity.X += 0.07f; - if ((double) this.velocity.X > (double) num70) - this.velocity.X = num70; + if ((double) this.velocity.X > (double) num64) + this.velocity.X = num64; } - else if ((double) this.velocity.X > -(double) num70 && this.direction == -1) + else if ((double) this.velocity.X > -(double) num64 && this.direction == -1) { this.velocity.X -= 0.07f; - if ((double) this.velocity.X < -(double) num70) - this.velocity.X = -num70; + if ((double) this.velocity.X < -(double) num64) + this.velocity.X = -num64; } } if (this.type >= 277 && this.type <= 280) @@ -23392,10 +17642,7 @@ label_422: this.velocity.X += 0.1f; } else if ((double) Main.player[this.target].Center.Y + 50.0 < (double) this.position.Y && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) - { - flag1 = true; this.velocity.Y = -7f; - } } else if (this.type == 425) { @@ -23407,39 +17654,37 @@ label_422: this.spriteDirection = -this.direction; if (Collision.CanHit(this.Center, 0, 0, Main.player[this.target].Center, 0, 0)) { - float num72 = Main.player[this.target].Center.X - (float) (this.direction * 400) - this.Center.X; - float num73 = Main.player[this.target].Bottom.Y - this.Bottom.Y; - if ((double) num72 < 0.0 && (double) this.velocity.X > 0.0) + float num66 = Main.player[this.target].Center.X - (float) (this.direction * 400) - this.Center.X; + float num67 = Main.player[this.target].Bottom.Y - this.Bottom.Y; + if ((double) num66 < 0.0 && (double) this.velocity.X > 0.0) this.velocity.X *= 0.9f; - else if ((double) num72 > 0.0 && (double) this.velocity.X < 0.0) + else if ((double) num66 > 0.0 && (double) this.velocity.X < 0.0) this.velocity.X *= 0.9f; - if ((double) num72 < 0.0 && (double) this.velocity.X > -5.0) + if ((double) num66 < 0.0 && (double) this.velocity.X > -5.0) this.velocity.X -= 0.1f; - else if ((double) num72 > 0.0 && (double) this.velocity.X < 5.0) + else if ((double) num66 > 0.0 && (double) this.velocity.X < 5.0) this.velocity.X += 0.1f; if ((double) this.velocity.X > 6.0) this.velocity.X = 6f; if ((double) this.velocity.X < -6.0) this.velocity.X = -6f; - if ((double) num73 < -20.0 && (double) this.velocity.Y > 0.0) + if ((double) num67 < -20.0 && (double) this.velocity.Y > 0.0) this.velocity.Y *= 0.8f; - else if ((double) num73 > 20.0 && (double) this.velocity.Y < 0.0) + else if ((double) num67 > 20.0 && (double) this.velocity.Y < 0.0) this.velocity.Y *= 0.8f; - if ((double) num73 < -20.0 && (double) this.velocity.Y > -5.0) + if ((double) num67 < -20.0 && (double) this.velocity.Y > -5.0) this.velocity.Y -= 0.3f; - else if ((double) num73 > 20.0 && (double) this.velocity.Y < 5.0) + else if ((double) num67 > 20.0 && (double) this.velocity.Y < 5.0) this.velocity.Y += 0.3f; } if (Main.rand.Next(3) == 0) { - this.position = this.position + this.netOffset; Vector2 Position = this.Center + new Vector2((float) (this.direction * -14), -8f) - Vector2.One * 4f; Vector2 vector2 = new Vector2((float) (this.direction * -6), 12f) * 0.2f + Utils.RandomVector2(Main.rand, -1f, 1f) * 0.1f; Dust dust = Main.dust[Dust.NewDust(Position, 8, 8, 229, vector2.X, vector2.Y, 100, Color.Transparent, (float) (1.0 + (double) Main.rand.NextFloat() * 0.5))]; dust.noGravity = true; dust.velocity = vector2; dust.customData = (object) this; - this.position = this.position - this.netOffset; } for (int index = 0; index < 200; ++index) { @@ -23458,7 +17703,6 @@ label_422: } else if ((double) Main.player[this.target].Center.Y + 100.0 < (double) this.position.Y && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) { - flag1 = true; this.velocity.Y = -5f; this.ai[2] = 1f; } @@ -23472,11 +17716,11 @@ label_422: Vector2 vec = this.DirectionTo(Main.player[this.target].Center) * 7f; if (vec.HasNaNs()) vec = new Vector2((float) (this.direction * 8), 0.0f); - int damageForProjectiles = this.GetAttackDamage_ForProjectiles(75f, 50f); + int Damage = Main.expertMode ? 50 : 75; for (int index = 0; index < 4; ++index) { Vector2 vector2_14 = vec + Utils.RandomVector2(Main.rand, -0.8f, 0.8f); - Projectile.NewProjectile(vector2_13.X, vector2_13.Y, vector2_14.X, vector2_14.Y, 577, damageForProjectiles, 1f, Main.myPlayer); + Projectile.NewProjectile(vector2_13.X, vector2_13.Y, vector2_14.X, vector2_14.Y, 577, Damage, 1f, Main.myPlayer); } } } @@ -23496,27 +17740,27 @@ label_422: this.spriteDirection = -this.direction; if (Collision.CanHit(this.Center, 0, 0, Main.player[this.target].Center, 0, 0)) { - float num74 = Main.player[this.target].Center.X - this.Center.X; - float num75 = Main.player[this.target].Center.Y - this.Center.Y; - if ((double) num74 < 0.0 && (double) this.velocity.X > 0.0) + float num68 = Main.player[this.target].Center.X - this.Center.X; + float num69 = Main.player[this.target].Center.Y - this.Center.Y; + if ((double) num68 < 0.0 && (double) this.velocity.X > 0.0) this.velocity.X *= 0.98f; - else if ((double) num74 > 0.0 && (double) this.velocity.X < 0.0) + else if ((double) num68 > 0.0 && (double) this.velocity.X < 0.0) this.velocity.X *= 0.98f; - if ((double) num74 < -20.0 && (double) this.velocity.X > -6.0) + if ((double) num68 < -20.0 && (double) this.velocity.X > -6.0) this.velocity.X -= 0.015f; - else if ((double) num74 > 20.0 && (double) this.velocity.X < 6.0) + else if ((double) num68 > 20.0 && (double) this.velocity.X < 6.0) this.velocity.X += 0.015f; if ((double) this.velocity.X > 6.0) this.velocity.X = 6f; if ((double) this.velocity.X < -6.0) this.velocity.X = -6f; - if ((double) num75 < -20.0 && (double) this.velocity.Y > 0.0) + if ((double) num69 < -20.0 && (double) this.velocity.Y > 0.0) this.velocity.Y *= 0.98f; - else if ((double) num75 > 20.0 && (double) this.velocity.Y < 0.0) + else if ((double) num69 > 20.0 && (double) this.velocity.Y < 0.0) this.velocity.Y *= 0.98f; - if ((double) num75 < -20.0 && (double) this.velocity.Y > -6.0) + if ((double) num69 < -20.0 && (double) this.velocity.Y > -6.0) this.velocity.Y -= 0.15f; - else if ((double) num75 > 20.0 && (double) this.velocity.Y < 6.0) + else if ((double) num69 > 20.0 && (double) this.velocity.Y < 6.0) this.velocity.Y += 0.15f; } for (int index = 0; index < 200; ++index) @@ -23536,7 +17780,6 @@ label_422: } else if ((double) Main.player[this.target].Center.Y + 100.0 < (double) this.position.Y && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) { - flag1 = true; this.velocity.Y = -5f; this.ai[2] = 1f; } @@ -23555,14 +17798,14 @@ label_422: this.spriteDirection = this.direction; if (Collision.CanHit(this.Center, 0, 0, Main.player[this.target].Center, 0, 0)) { - float num76 = Main.player[this.target].Center.X - (float) (this.direction * 300) - this.Center.X; - if ((double) num76 < 40.0 && (double) this.velocity.X > 0.0) + float num70 = Main.player[this.target].Center.X - (float) (this.direction * 300) - this.Center.X; + if ((double) num70 < 40.0 && (double) this.velocity.X > 0.0) this.velocity.X *= 0.98f; - else if ((double) num76 > 40.0 && (double) this.velocity.X < 0.0) + else if ((double) num70 > 40.0 && (double) this.velocity.X < 0.0) this.velocity.X *= 0.98f; - if ((double) num76 < 40.0 && (double) this.velocity.X > -5.0) + if ((double) num70 < 40.0 && (double) this.velocity.X > -5.0) this.velocity.X -= 0.2f; - else if ((double) num76 > 40.0 && (double) this.velocity.X < 5.0) + else if ((double) num70 > 40.0 && (double) this.velocity.X < 5.0) this.velocity.X += 0.2f; if ((double) this.velocity.X > 6.0) this.velocity.X = 6f; @@ -23571,10 +17814,7 @@ label_422: } } else if ((double) Main.player[this.target].Center.Y + 100.0 < (double) this.position.Y && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) - { - flag1 = true; this.velocity.Y = -6f; - } for (int index = 0; index < 200; ++index) { if (index != this.whoAmI && Main.npc[index].active && Main.npc[index].type == this.type && (double) Math.Abs(this.position.X - Main.npc[index].position.X) + (double) Math.Abs(this.position.Y - Main.npc[index].position.Y) < (double) this.width) @@ -23591,26 +17831,21 @@ label_422: } if (Main.rand.Next(6) == 0 && (double) this.ai[1] <= 20.0) { - this.position = this.position + this.netOffset; Dust dust = Main.dust[Dust.NewDust(this.Center + new Vector2(this.spriteDirection == 1 ? 8f : -20f, -20f), 8, 8, 229, this.velocity.X, this.velocity.Y, 100)]; dust.velocity = dust.velocity / 4f + this.velocity / 2f; dust.scale = 0.6f; dust.noLight = true; - this.position = this.position - this.netOffset; } if ((double) this.ai[1] >= 57.0) { - this.position = this.position + this.netOffset; int Type = Utils.SelectRandom(Main.rand, 161, 229); Dust dust = Main.dust[Dust.NewDust(this.Center + new Vector2(this.spriteDirection == 1 ? 8f : -20f, -20f), 8, 8, Type, this.velocity.X, this.velocity.Y, 100)]; dust.velocity = dust.velocity / 4f + this.DirectionTo(Main.player[this.target].Top); dust.scale = 1.2f; dust.noLight = true; - this.position = this.position - this.netOffset; } if (Main.rand.Next(6) == 0) { - this.position = this.position + this.netOffset; Dust dust = Main.dust[Dust.NewDust(this.Center, 2, 2, 229)]; dust.position = this.Center + new Vector2(this.spriteDirection == 1 ? 26f : -26f, 24f); dust.velocity.X = 0.0f; @@ -23619,7 +17854,6 @@ label_422: dust.noGravity = true; dust.scale = 1f; dust.noLight = true; - this.position = this.position - this.netOffset; } } else if (this.type == 185) @@ -23642,57 +17876,109 @@ label_422: if (this.type == 159 && Main.netMode != 1) { Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); - double num77 = (double) Main.player[this.target].position.X + (double) Main.player[this.target].width * 0.5 - (double) vector2.X; - float num78 = Main.player[this.target].position.Y + (float) Main.player[this.target].height * 0.5f - vector2.Y; - if (Math.Sqrt(num77 * num77 + (double) num78 * (double) num78) > 300.0) + double num71 = (double) Main.player[this.target].position.X + (double) Main.player[this.target].width * 0.5 - (double) vector2.X; + float num72 = Main.player[this.target].position.Y + (float) Main.player[this.target].height * 0.5f - vector2.Y; + if (Math.Sqrt(num71 * num71 + (double) num72 * (double) num72) > 300.0) this.Transform(158); } - if (Main.netMode != 1) + if (this.type == 164 && Main.netMode != 1 && (double) this.velocity.Y == 0.0) { - if (Main.expertMode && this.target >= 0 && (this.type == 163 || this.type == 238) && Collision.CanHit(this.Center, 1, 1, Main.player[this.target].Center, 1, 1)) + int num73 = (int) this.Center.X / 16; + int num74 = (int) this.Center.Y / 16; + bool flag7 = false; + for (int index15 = num73 - 1; index15 <= num73 + 1; ++index15) { - ++this.localAI[0]; - if (this.justHit) + for (int index16 = num74 - 1; index16 <= num74 + 1; ++index16) { - this.localAI[0] -= (float) Main.rand.Next(20, 60); - if ((double) this.localAI[0] < 0.0) - this.localAI[0] = 0.0f; + if (Main.tile[index15, index16].wall > (byte) 0) + flag7 = true; } - if ((double) this.localAI[0] > (double) Main.rand.Next(180, 900)) + } + if (flag7) + this.Transform(165); + } + if (this.type == 239 && Main.netMode != 1 && (double) this.velocity.Y == 0.0) + { + int num75 = (int) this.Center.X / 16; + int num76 = (int) this.Center.Y / 16; + bool flag8 = false; + for (int index17 = num75 - 1; index17 <= num75 + 1; ++index17) + { + for (int index18 = num76 - 1; index18 <= num76 + 1; ++index18) { + if (Main.tile[index17, index18].wall > (byte) 0) + flag8 = true; + } + } + if (flag8) + this.Transform(240); + } + if (this.type == 530 && Main.netMode != 1 && (double) this.velocity.Y == 0.0) + { + int num77 = (int) this.Center.X / 16; + int num78 = (int) this.Center.Y / 16; + bool flag9 = false; + for (int index19 = num77 - 1; index19 <= num77 + 1; ++index19) + { + for (int index20 = num78 - 1; index20 <= num78 + 1; ++index20) + { + if (Main.tile[index19, index20].wall > (byte) 0) + flag9 = true; + } + } + if (flag9) + this.Transform(531); + } + if (Main.netMode != 1 && Main.expertMode && this.target >= 0 && (this.type == 163 || this.type == 238) && Collision.CanHit(this.Center, 1, 1, Main.player[this.target].Center, 1, 1)) + { + ++this.localAI[0]; + if (this.justHit) + { + this.localAI[0] -= (float) Main.rand.Next(20, 60); + if ((double) this.localAI[0] < 0.0) this.localAI[0] = 0.0f; - Vector2 vector2 = Main.player[this.target].Center - this.Center; - vector2.Normalize(); - vector2 *= 8f; - int damageForProjectiles = this.GetAttackDamage_ForProjectiles(18f, 18f); - Projectile.NewProjectile(this.Center.X, this.Center.Y, vector2.X, vector2.Y, 472, damageForProjectiles, 0.0f, Main.myPlayer); - } } - if ((double) this.velocity.Y == 0.0) + if ((double) this.localAI[0] > (double) Main.rand.Next(180, 900)) { - int newType = -1; - switch (this.type) - { - case 163: - newType = 238; - break; - case 164: - newType = 165; - break; - case 236: - newType = 237; - break; - case 239: - newType = 240; - break; - case 530: - newType = 531; - break; - } - if (newType != -1 && this.NPCCanStickToWalls()) - this.Transform(newType); + this.localAI[0] = 0.0f; + Vector2 vector2 = Main.player[this.target].Center - this.Center; + vector2.Normalize(); + vector2 *= 8f; + Projectile.NewProjectile(this.Center.X, this.Center.Y, vector2.X, vector2.Y, 472, 18, 0.0f, Main.myPlayer); } } + if (this.type == 163 && Main.netMode != 1 && (double) this.velocity.Y == 0.0) + { + int num79 = (int) this.Center.X / 16; + int num80 = (int) this.Center.Y / 16; + bool flag10 = false; + for (int index21 = num79 - 1; index21 <= num79 + 1; ++index21) + { + for (int index22 = num80 - 1; index22 <= num80 + 1; ++index22) + { + if (Main.tile[index21, index22].wall > (byte) 0) + flag10 = true; + } + } + if (flag10) + this.Transform(238); + } + if (this.type == 236 && Main.netMode != 1 && (double) this.velocity.Y == 0.0) + { + int num81 = (int) this.Center.X / 16; + int num82 = (int) this.Center.Y / 16; + bool flag11 = false; + for (int index23 = num81 - 1; index23 <= num81 + 1; ++index23) + { + for (int index24 = num82 - 1; index24 <= num82 + 1; ++index24) + { + if (Main.tile[index23, index24].wall > (byte) 0) + flag11 = true; + } + } + if (flag11) + this.Transform(237); + } if (this.type == 243) { if (this.justHit && Main.rand.Next(3) == 0) @@ -23702,20 +17988,20 @@ label_422: if (this.confused) this.ai[2] = 0.0f; ++this.ai[2]; - float num79 = (float) Main.rand.Next(30, 900) * ((float) this.life / (float) this.lifeMax) + 30f; - if (Main.netMode != 1 && (double) this.ai[2] >= (double) num79 && (double) this.velocity.Y == 0.0 && !Main.player[this.target].dead && !Main.player[this.target].frozen && (this.direction > 0 && (double) this.Center.X < (double) Main.player[this.target].Center.X || this.direction < 0 && (double) this.Center.X > (double) Main.player[this.target].Center.X) && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + float num83 = (float) Main.rand.Next(30, 900) * ((float) this.life / (float) this.lifeMax) + 30f; + if (Main.netMode != 1 && (double) this.ai[2] >= (double) num83 && (double) this.velocity.Y == 0.0 && !Main.player[this.target].dead && !Main.player[this.target].frozen && (this.direction > 0 && (double) this.Center.X < (double) Main.player[this.target].Center.X || this.direction < 0 && (double) this.Center.X > (double) Main.player[this.target].Center.X) && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) { Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + 20f); vector2.X += (float) (10 * this.direction); - float num80 = Main.player[this.target].position.X + (float) Main.player[this.target].width * 0.5f - vector2.X; - float num81 = Main.player[this.target].position.Y + (float) Main.player[this.target].height * 0.5f - vector2.Y; - float num82 = num80 + (float) Main.rand.Next(-40, 41); - float num83 = num81 + (float) Main.rand.Next(-40, 41); - float num84 = (float) Math.Sqrt((double) num82 * (double) num82 + (double) num83 * (double) num83); + float num84 = Main.player[this.target].position.X + (float) Main.player[this.target].width * 0.5f - vector2.X; + float num85 = Main.player[this.target].position.Y + (float) Main.player[this.target].height * 0.5f - vector2.Y; + float num86 = num84 + (float) Main.rand.Next(-40, 41); + float num87 = num85 + (float) Main.rand.Next(-40, 41); + float num88 = (float) Math.Sqrt((double) num86 * (double) num86 + (double) num87 * (double) num87); this.netUpdate = true; - float num85 = (float) (15.0 / (double) num84); - float SpeedX = num82 * num85; - float SpeedY = num83 * num85; + float num89 = (float) (15.0 / (double) num88); + float SpeedX = num86 * num89; + float SpeedY = num87 * num89; int Damage = 32; int Type = 257; vector2.X += SpeedX * 3f; @@ -23733,20 +18019,20 @@ label_422: if (this.confused) this.ai[2] = 0.0f; ++this.ai[2]; - float num86 = (float) Main.rand.Next(60, 1800) * ((float) this.life / (float) this.lifeMax) + 15f; - if (Main.netMode != 1 && (double) this.ai[2] >= (double) num86 && (double) this.velocity.Y == 0.0 && !Main.player[this.target].dead && !Main.player[this.target].frozen && (this.direction > 0 && (double) this.Center.X < (double) Main.player[this.target].Center.X || this.direction < 0 && (double) this.Center.X > (double) Main.player[this.target].Center.X) && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) + float num90 = (float) Main.rand.Next(60, 1800) * ((float) this.life / (float) this.lifeMax) + 15f; + if (Main.netMode != 1 && (double) this.ai[2] >= (double) num90 && (double) this.velocity.Y == 0.0 && !Main.player[this.target].dead && !Main.player[this.target].frozen && (this.direction > 0 && (double) this.Center.X < (double) Main.player[this.target].Center.X || this.direction < 0 && (double) this.Center.X > (double) Main.player[this.target].Center.X) && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height)) { Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + 12f); vector2.X += (float) (6 * this.direction); - float num87 = Main.player[this.target].position.X + (float) Main.player[this.target].width * 0.5f - vector2.X; - float num88 = Main.player[this.target].position.Y + (float) Main.player[this.target].height * 0.5f - vector2.Y; - float num89 = num87 + (float) Main.rand.Next(-40, 41); - float num90 = num88 + (float) Main.rand.Next(-30, 0); - float num91 = (float) Math.Sqrt((double) num89 * (double) num89 + (double) num90 * (double) num90); + float num91 = Main.player[this.target].position.X + (float) Main.player[this.target].width * 0.5f - vector2.X; + float num92 = Main.player[this.target].position.Y + (float) Main.player[this.target].height * 0.5f - vector2.Y; + float num93 = num91 + (float) Main.rand.Next(-40, 41); + float num94 = num92 + (float) Main.rand.Next(-30, 0); + float num95 = (float) Math.Sqrt((double) num93 * (double) num93 + (double) num94 * (double) num94); this.netUpdate = true; - float num92 = (float) (15.0 / (double) num91); - float SpeedX = num89 * num92; - float SpeedY = num90 * num92; + float num96 = (float) (15.0 / (double) num95); + float SpeedX = num93 * num96; + float SpeedY = num94 * num96; int Damage = 30; int Type = 83; vector2.X += SpeedX * 3f; @@ -23771,30 +18057,30 @@ label_422: this.ai[2] = -30f; if ((double) this.ai[2] == 30.0) { - int num93 = (int) this.position.X / 16; - int num94 = (int) this.position.Y / 16; - int num95 = (int) this.position.X / 16; - int num96 = (int) this.position.Y / 16; - int num97 = 5; - int num98 = 0; + int num97 = (int) this.position.X / 16; + int num98 = (int) this.position.Y / 16; + int num99 = (int) this.position.X / 16; + int num100 = (int) this.position.Y / 16; + int num101 = 5; + int num102 = 0; bool flag12 = false; - int num99 = 2; - int num100 = 0; - while (!flag12 && num98 < 100) + int num103 = 2; + int num104 = 0; + while (!flag12 && num102 < 100) { - ++num98; - int index18 = Main.rand.Next(num93 - num97, num93 + num97); - for (int index19 = Main.rand.Next(num94 - num97, num94 + num97); index19 < num94 + num97; ++index19) + ++num102; + int index25 = Main.rand.Next(num97 - num101, num97 + num101); + for (int index26 = Main.rand.Next(num98 - num101, num98 + num101); index26 < num98 + num101; ++index26) { - if ((index19 < num94 - num99 || index19 > num94 + num99 || index18 < num93 - num99 || index18 > num93 + num99) && (index19 < num96 - num100 || index19 > num96 + num100 || index18 < num95 - num100 || index18 > num95 + num100) && Main.tile[index18, index19].nactive()) + if ((index26 < num98 - num103 || index26 > num98 + num103 || index25 < num97 - num103 || index25 > num97 + num103) && (index26 < num100 - num104 || index26 > num100 + num104 || index25 < num99 - num104 || index25 > num99 + num104) && Main.tile[index25, index26].nactive()) { bool flag13 = true; - if (Main.tile[index18, index19 - 1].lava()) + if (Main.tile[index25, index26 - 1].lava()) flag13 = false; - if (flag13 && Main.tileSolid[(int) Main.tile[index18, index19].type] && !Collision.SolidTiles(index18 - 1, index18 + 1, index19 - 4, index19 - 1)) + if (flag13 && Main.tileSolid[(int) Main.tile[index25, index26].type] && !Collision.SolidTiles(index25 - 1, index25 + 1, index26 - 4, index26 - 1)) { - int index20 = NPC.NewNPC(index18 * 16 - this.width / 2, index19 * 16, 387); - Main.npc[index20].position.Y = (float) (index19 * 16 - Main.npc[index20].height); + int index27 = NPC.NewNPC(index25 * 16 - this.width / 2, index26 * 16, 387); + Main.npc[index27].position.Y = (float) (index26 * 16 - Main.npc[index27].height); flag12 = true; this.netUpdate = true; break; @@ -23831,457 +18117,462 @@ label_422: bool flag14 = this.type == 381 || this.type == 382 || this.type == 520; bool flag15 = this.type == 426; bool flag16 = true; - int num101 = -1; - int num102 = -1; + int num105 = -1; + int num106 = -1; if (this.type == 411) { flag14 = true; - num101 = 90; - num102 = 90; + num105 = 90; + num106 = 90; if ((double) this.ai[1] <= 150.0) flag16 = false; } - if ((double) this.ai[1] > 0.0) - --this.ai[1]; - if (this.justHit) - { - this.ai[1] = 30f; - this.ai[2] = 0.0f; - } - int num103 = 70; - if (this.type == 379 || this.type == 380) - num103 = 80; - if (this.type == 381 || this.type == 382) - num103 = 80; - if (this.type == 520) - num103 = 15; - if (this.type == 350) - num103 = 110; - if (this.type == 291) - num103 = 200; - if (this.type == 292) - num103 = 120; - if (this.type == 293) - num103 = 90; - if (this.type == 111) - num103 = 180; - if (this.type == 206) - num103 = 50; - if (this.type == 481) - num103 = 100; - if (this.type == 214) - num103 = 40; - if (this.type == 215) - num103 = 80; - if (this.type == 290) - num103 = 30; - if (this.type == 411) - num103 = 300; - if (this.type == 409) - num103 = 60; - if (this.type == 424) - num103 = 180; - if (this.type == 426) - num103 = 60; - bool flag17 = false; - if (this.type == 216) - { - if ((double) this.localAI[2] >= 20.0) - flag17 = true; - num103 = !flag17 ? 8 : 60; - } - int num104 = num103 / 2; - if (this.type == 424) - num104 = num103 - 1; - if (this.type == 426) - num104 = num103 - 1; if (this.confused) - this.ai[2] = 0.0f; - if ((double) this.ai[2] > 0.0) { - if (flag16) - this.TargetClosest(); - if ((double) this.ai[1] == (double) num104) + this.ai[2] = 0.0f; + } + else + { + if ((double) this.ai[1] > 0.0) + --this.ai[1]; + if (this.justHit) { - if (this.type == 216) - ++this.localAI[2]; - float num105 = 11f; - if (this.type == 111) - num105 = 9f; - if (this.type == 206) - num105 = 7f; - if (this.type == 290) - num105 = 9f; - if (this.type == 293) - num105 = 4f; - if (this.type == 214) - num105 = 14f; - if (this.type == 215) - num105 = 16f; - if (this.type == 382) - num105 = 7f; - if (this.type == 520) - num105 = 8f; - if (this.type == 409) - num105 = 4f; - if (this.type >= 449 && this.type <= 452) - num105 = 7f; - if (this.type == 481) - num105 = 8f; - if (this.type == 468) - num105 = 7.5f; - if (this.type == 411) - num105 = 1f; - if (this.type >= 498 && this.type <= 506) - num105 = 7f; - Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); - if (this.type == 481) - vector2.Y -= 14f; - if (this.type == 206) - vector2.Y -= 10f; - if (this.type == 290) - vector2.Y -= 10f; - if (this.type == 381 || this.type == 382) - vector2.Y += 6f; - if (this.type == 520) - vector2.Y = this.position.Y + 20f; - if (this.type >= 498 && this.type <= 506) - vector2.Y -= 8f; - if (this.type == 426) - vector2 += new Vector2((float) (this.spriteDirection * 2), -12f); - float num106 = Main.player[this.target].position.X + (float) Main.player[this.target].width * 0.5f - vector2.X; - float num107 = Math.Abs(num106) * 0.1f; - if (this.type == 291 || this.type == 292) - num107 = 0.0f; - if (this.type == 215) - num107 = Math.Abs(num106) * 0.08f; - if (this.type == 214 || this.type == 216 && !flag17) - num107 = 0.0f; - if (this.type == 381 || this.type == 382 || this.type == 520) - num107 = 0.0f; - if (this.type >= 449 && this.type <= 452) - num107 = (float) ((double) Math.Abs(num106) * (double) Main.rand.Next(10, 50) * 0.00999999977648258); - if (this.type == 468) - num107 = (float) ((double) Math.Abs(num106) * (double) Main.rand.Next(10, 50) * 0.00999999977648258); - if (this.type == 481) - num107 = (float) ((double) Math.Abs(num106) * (double) Main.rand.Next(-10, 11) * 0.00350000010803342); - if (this.type >= 498 && this.type <= 506) - num107 = (float) ((double) Math.Abs(num106) * (double) Main.rand.Next(1, 11) * (1.0 / 400.0)); - float num108 = Main.player[this.target].position.Y + (float) Main.player[this.target].height * 0.5f - vector2.Y - num107; - if (this.type == 291) + this.ai[1] = 30f; + this.ai[2] = 0.0f; + } + int num107 = 70; + if (this.type == 379 || this.type == 380) + num107 = 80; + if (this.type == 381 || this.type == 382) + num107 = 80; + if (this.type == 520) + num107 = 15; + if (this.type == 350) + num107 = 110; + if (this.type == 291) + num107 = 200; + if (this.type == 292) + num107 = 120; + if (this.type == 293) + num107 = 90; + if (this.type == 111) + num107 = 180; + if (this.type == 206) + num107 = 50; + if (this.type == 481) + num107 = 100; + if (this.type == 214) + num107 = 40; + if (this.type == 215) + num107 = 80; + if (this.type == 290) + num107 = 30; + if (this.type == 411) + num107 = 300; + if (this.type == 409) + num107 = 60; + if (this.type == 424) + num107 = 180; + if (this.type == 426) + num107 = 60; + bool flag17 = false; + if (this.type == 216) + { + if ((double) this.localAI[2] >= 20.0) + flag17 = true; + num107 = !flag17 ? 8 : 60; + } + int num108 = num107 / 2; + if (this.type == 424) + num108 = num107 - 1; + if (this.type == 426) + num108 = num107 - 1; + if ((double) this.ai[2] > 0.0) + { + if (flag16) + this.TargetClosest(); + if ((double) this.ai[1] == (double) num108) { - num106 += (float) Main.rand.Next(-40, 41) * 0.2f; - num108 += (float) Main.rand.Next(-40, 41) * 0.2f; - } - else if (this.type == 381 || this.type == 382 || this.type == 520) - { - float num109 = num106 + (float) Main.rand.Next(-100, 101) * 0.4f; - float num110 = num108 + (float) Main.rand.Next(-100, 101) * 0.4f; - num106 = num109 * ((float) Main.rand.Next(85, 116) * 0.01f); - num108 = num110 * ((float) Main.rand.Next(85, 116) * 0.01f); + if (this.type == 216) + ++this.localAI[2]; + float num109 = 11f; + if (this.type == 111) + num109 = 9f; + if (this.type == 206) + num109 = 7f; + if (this.type == 290) + num109 = 9f; + if (this.type == 293) + num109 = 4f; + if (this.type == 214) + num109 = 14f; + if (this.type == 215) + num109 = 16f; + if (this.type == 382) + num109 = 7f; if (this.type == 520) + num109 = 8f; + if (this.type == 409) + num109 = 4f; + if (this.type >= 449 && this.type <= 452) + num109 = 7f; + if (this.type == 481) + num109 = 8f; + if (this.type == 468) + num109 = 7.5f; + if (this.type == 411) + num109 = 1f; + if (this.type >= 498 && this.type <= 506) + num109 = 7f; + Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); + if (this.type == 481) + vector2.Y -= 14f; + if (this.type == 206) + vector2.Y -= 10f; + if (this.type == 290) + vector2.Y -= 10f; + if (this.type == 381 || this.type == 382) + vector2.Y += 6f; + if (this.type == 520) + vector2.Y = this.position.Y + 20f; + if (this.type >= 498 && this.type <= 506) + vector2.Y -= 8f; + if (this.type == 426) + vector2 += new Vector2((float) (this.spriteDirection * 2), -12f); + float num110 = Main.player[this.target].position.X + (float) Main.player[this.target].width * 0.5f - vector2.X; + float num111 = Math.Abs(num110) * 0.1f; + if (this.type == 291 || this.type == 292) + num111 = 0.0f; + if (this.type == 215) + num111 = Math.Abs(num110) * 0.08f; + if (this.type == 214 || this.type == 216 && !flag17) + num111 = 0.0f; + if (this.type == 381 || this.type == 382 || this.type == 520) + num111 = 0.0f; + if (this.type >= 449 && this.type <= 452) + num111 = (float) ((double) Math.Abs(num110) * (double) Main.rand.Next(10, 50) * 0.00999999977648258); + if (this.type == 468) + num111 = (float) ((double) Math.Abs(num110) * (double) Main.rand.Next(10, 50) * 0.00999999977648258); + if (this.type == 481) + num111 = (float) ((double) Math.Abs(num110) * (double) Main.rand.Next(-10, 11) * 0.00350000010803342); + if (this.type >= 498 && this.type <= 506) + num111 = (float) ((double) Math.Abs(num110) * (double) Main.rand.Next(1, 11) * (1.0 / 400.0)); + float num112 = Main.player[this.target].position.Y + (float) Main.player[this.target].height * 0.5f - vector2.Y - num111; + if (this.type == 291) { - float num111 = num106 + (float) Main.rand.Next(-100, 101) * 0.6f; - float num112 = num108 + (float) Main.rand.Next(-100, 101) * 0.6f; - num106 = num111 * ((float) Main.rand.Next(85, 116) * 0.015f); - num108 = num112 * ((float) Main.rand.Next(85, 116) * 0.015f); + num110 += (float) Main.rand.Next(-40, 41) * 0.2f; + num112 += (float) Main.rand.Next(-40, 41) * 0.2f; } - } - else if (this.type == 481) - { - num106 += (float) Main.rand.Next(-40, 41) * 0.4f; - num108 += (float) Main.rand.Next(-40, 41) * 0.4f; - } - else if (this.type >= 498 && this.type <= 506) - { - num106 += (float) Main.rand.Next(-40, 41) * 0.3f; - num108 += (float) Main.rand.Next(-40, 41) * 0.3f; - } - else if (this.type != 292) - { - num106 += (float) Main.rand.Next(-40, 41); - num108 += (float) Main.rand.Next(-40, 41); - } - float num113 = (float) Math.Sqrt((double) num106 * (double) num106 + (double) num108 * (double) num108); - this.netUpdate = true; - float num114 = num105 / num113; - float num115 = num106 * num114; - float SpeedY = num108 * num114; - int Damage = 35; - int Type = 82; - if (this.type == 111) - Damage = 11; - if (this.type == 206) - Damage = 37; - if (this.type == 379 || this.type == 380) - Damage = 40; - if (this.type == 350) - Damage = 45; - if (this.type == 468) - Damage = 50; - if (this.type == 111) - Type = 81; - if (this.type == 379 || this.type == 380) - Type = 81; - if (this.type == 381) - { - Type = 436; - Damage = 24; - } - if (this.type == 382) - { - Type = 438; - Damage = 30; - } - if (this.type == 520) - { - Type = 592; - Damage = 35; - } - if (this.type >= 449 && this.type <= 452) - { - Type = 471; - Damage = 15; - } - if (this.type >= 498 && this.type <= 506) - { - Type = 572; - Damage = 14; - } - if (this.type == 481) - { - Type = 508; - Damage = 18; - } - if (this.type == 206) - Type = 177; - if (this.type == 468) - Type = 501; - if (this.type == 411) - { - Type = 537; - Damage = this.GetAttackDamage_ForProjectiles(60f, 45f); - } - if (this.type == 424) - { - Type = 573; - Damage = this.GetAttackDamage_ForProjectiles(60f, 45f); - } - if (this.type == 426) - { - Type = 581; - Damage = this.GetAttackDamage_ForProjectiles(60f, 45f); - } - if (this.type == 291) - { - Type = 302; - Damage = 100; - } - if (this.type == 290) - { - Type = 300; - Damage = 60; - } - if (this.type == 293) - { - Type = 303; - Damage = 60; - } - if (this.type == 214) - { - Type = 180; - Damage = 25; - } - if (this.type == 215) - { - Type = 82; - Damage = 40; - } - if (this.type == 292) - { - Damage = 50; - Type = 180; - } - if (this.type == 216) - { - Type = 180; - Damage = 30; - if (flag17) + else if (this.type == 381 || this.type == 382 || this.type == 520) { - Damage = 100; - Type = 240; - this.localAI[2] = 0.0f; - } - } - vector2.X += num115; - vector2.Y += SpeedY; - if (this.type == 290) - Damage = this.GetAttackDamage_ForProjectiles((float) Damage, (float) Damage * 0.75f); - if (this.type >= 381 && this.type <= 392) - Damage = this.GetAttackDamage_ForProjectiles((float) Damage, (float) Damage * 0.8f); - if (Main.netMode != 1) - { - if (this.type == 292) - { - for (int index = 0; index < 4; ++index) + float num113 = num110 + (float) Main.rand.Next(-100, 101) * 0.4f; + float num114 = num112 + (float) Main.rand.Next(-100, 101) * 0.4f; + num110 = num113 * ((float) Main.rand.Next(85, 116) * 0.01f); + num112 = num114 * ((float) Main.rand.Next(85, 116) * 0.01f); + if (this.type == 520) { - float num116 = Main.player[this.target].position.X + (float) Main.player[this.target].width * 0.5f - vector2.X; - float num117 = Main.player[this.target].position.Y + (float) Main.player[this.target].height * 0.5f - vector2.Y; - float num118 = 12f / (float) Math.Sqrt((double) num116 * (double) num116 + (double) num117 * (double) num117); - float num119; - float num120 = num119 = num116 + (float) Main.rand.Next(-40, 41); - float num121; - float num122 = num121 = num117 + (float) Main.rand.Next(-40, 41); - num115 = num120 * num118; - SpeedY = num122 * num118; - Projectile.NewProjectile(vector2.X, vector2.Y, num115, SpeedY, Type, Damage, 0.0f, Main.myPlayer); + float num115 = num110 + (float) Main.rand.Next(-100, 101) * 0.6f; + float num116 = num112 + (float) Main.rand.Next(-100, 101) * 0.6f; + num110 = num115 * ((float) Main.rand.Next(85, 116) * 0.015f); + num112 = num116 * ((float) Main.rand.Next(85, 116) * 0.015f); } } - else if (this.type == 411) - Projectile.NewProjectile(vector2.X, vector2.Y, num115, SpeedY, Type, Damage, 0.0f, Main.myPlayer, ai1: ((float) this.whoAmI)); - else if (this.type == 424) + else if (this.type == 481) { - for (int index = 0; index < 4; ++index) - Projectile.NewProjectile(this.Center.X - (float) (this.spriteDirection * 4), this.Center.Y + 6f, (float) (2 * index - 3) * 0.15f, (float) ((double) -Main.rand.Next(0, 3) * 0.200000002980232 - 0.100000001490116), Type, Damage, 0.0f, Main.myPlayer, ai1: ((float) this.whoAmI)); + num110 += (float) Main.rand.Next(-40, 41) * 0.4f; + num112 += (float) Main.rand.Next(-40, 41) * 0.4f; } - else if (this.type == 409) + else if (this.type >= 498 && this.type <= 506) { - int index = NPC.NewNPC((int) this.Center.X, (int) this.Center.Y, 410, this.whoAmI); - Main.npc[index].velocity = new Vector2(num115, SpeedY - 6f); + num110 += (float) Main.rand.Next(-40, 41) * 0.3f; + num112 += (float) Main.rand.Next(-40, 41) * 0.3f; } - else - Projectile.NewProjectile(vector2.X, vector2.Y, num115, SpeedY, Type, Damage, 0.0f, Main.myPlayer); - } - this.ai[2] = (double) Math.Abs(SpeedY) <= (double) Math.Abs(num115) * 2.0 ? ((double) Math.Abs(num115) <= (double) Math.Abs(SpeedY) * 2.0 ? ((double) SpeedY <= 0.0 ? 4f : 2f) : 3f) : ((double) SpeedY <= 0.0 ? 5f : 1f); - } - if ((double) this.velocity.Y != 0.0 && !flag15 || (double) this.ai[1] <= 0.0) - { - this.ai[2] = 0.0f; - this.ai[1] = 0.0f; - } - else if (!flag14 || num101 != -1 && (double) this.ai[1] >= (double) num101 && (double) this.ai[1] < (double) (num101 + num102) && (!flag15 || (double) this.velocity.Y == 0.0)) - { - this.velocity.X *= 0.9f; - this.spriteDirection = this.direction; - } - } - if (this.type == 468 && !Main.eclipse) - flag14 = true; - else if ((double) this.ai[2] <= 0.0 | flag14 && (double) this.velocity.Y == 0.0 | flag15 && (double) this.ai[1] <= 0.0 && !Main.player[this.target].dead) - { - bool flag18 = Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height); - if (this.type == 520) - flag18 = Collision.CanHitLine(this.Top + new Vector2(0.0f, 20f), 0, 0, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height); - if ((double) Main.player[this.target].stealth == 0.0 && Main.player[this.target].itemAnimation == 0) - flag18 = false; - if (flag18) - { - float num123 = 10f; - Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); - float num124 = Main.player[this.target].position.X + (float) Main.player[this.target].width * 0.5f - vector2.X; - float num125 = Math.Abs(num124) * 0.1f; - float num126 = Main.player[this.target].position.Y + (float) Main.player[this.target].height * 0.5f - vector2.Y - num125; - float num127 = num124 + (float) Main.rand.Next(-40, 41); - float num128 = num126 + (float) Main.rand.Next(-40, 41); - float num129 = (float) Math.Sqrt((double) num127 * (double) num127 + (double) num128 * (double) num128); - float num130 = 700f; - if (this.type == 214) - num130 = 550f; - if (this.type == 215) - num130 = 800f; - if (this.type >= 498 && this.type <= 506) - num130 = 190f; - if (this.type >= 449 && this.type <= 452) - num130 = 200f; - if (this.type == 481) - num130 = 400f; - if (this.type == 468) - num130 = 400f; - if ((double) num129 < (double) num130) - { + else if (this.type != 292) + { + num110 += (float) Main.rand.Next(-40, 41); + num112 += (float) Main.rand.Next(-40, 41); + } + float num117 = (float) Math.Sqrt((double) num110 * (double) num110 + (double) num112 * (double) num112); this.netUpdate = true; - this.velocity.X *= 0.5f; - float num131 = num123 / num129; - float num132 = num127 * num131; - float num133 = num128 * num131; - this.ai[2] = 3f; - this.ai[1] = (float) num103; - this.ai[2] = (double) Math.Abs(num133) <= (double) Math.Abs(num132) * 2.0 ? ((double) Math.Abs(num132) <= (double) Math.Abs(num133) * 2.0 ? ((double) num133 <= 0.0 ? 4f : 2f) : 3f) : ((double) num133 <= 0.0 ? 5f : 1f); + float num118 = num109 / num117; + float num119 = num110 * num118; + float SpeedY = num112 * num118; + int Damage = 35; + int Type = 82; + if (this.type == 111) + Damage = 11; + if (this.type == 206) + Damage = 37; + if (this.type == 379 || this.type == 380) + Damage = 40; + if (this.type == 350) + Damage = 45; + if (this.type == 468) + Damage = 50; + if (this.type == 111) + Type = 81; + if (this.type == 379 || this.type == 380) + Type = 81; + if (this.type == 381) + { + Type = 436; + Damage = 24; + } + if (this.type == 382) + { + Type = 438; + Damage = 30; + } + if (this.type == 520) + { + Type = 592; + Damage = 35; + } + if (this.type >= 449 && this.type <= 452) + { + Type = 471; + Damage = 20; + } + if (this.type >= 498 && this.type <= 506) + { + Type = 572; + Damage = 14; + } + if (this.type == 481) + { + Type = 508; + Damage = 18; + } + if (this.type == 206) + Type = 177; + if (this.type == 468) + Type = 501; + if (this.type == 411) + { + Type = 537; + Damage = Main.expertMode ? 45 : 60; + } + if (this.type == 424) + { + Type = 573; + Damage = Main.expertMode ? 45 : 60; + } + if (this.type == 426) + { + Type = 581; + Damage = Main.expertMode ? 45 : 60; + } + if (this.type == 291) + { + Type = 302; + Damage = 100; + } + if (this.type == 290) + { + Type = 300; + Damage = 60; + } + if (this.type == 293) + { + Type = 303; + Damage = 60; + } + if (this.type == 214) + { + Type = 180; + Damage = 25; + } + if (this.type == 215) + { + Type = 82; + Damage = 40; + } + if (this.type == 292) + { + Damage = 50; + Type = 180; + } + if (this.type == 216) + { + Type = 180; + Damage = 30; + if (flag17) + { + Damage = 100; + Type = 240; + this.localAI[2] = 0.0f; + } + } + vector2.X += num119; + vector2.Y += SpeedY; + if (Main.expertMode && this.type == 290) + Damage = (int) ((double) Damage * 0.75); + if (Main.expertMode && this.type >= 381 && this.type <= 392) + Damage = (int) ((double) Damage * 0.8); + if (Main.netMode != 1) + { + if (this.type == 292) + { + for (int index = 0; index < 4; ++index) + { + float num120 = Main.player[this.target].position.X + (float) Main.player[this.target].width * 0.5f - vector2.X; + float num121 = Main.player[this.target].position.Y + (float) Main.player[this.target].height * 0.5f - vector2.Y; + float num122 = 12f / (float) Math.Sqrt((double) num120 * (double) num120 + (double) num121 * (double) num121); + float num123; + float num124 = num123 = num120 + (float) Main.rand.Next(-40, 41); + float num125; + float num126 = num125 = num121 + (float) Main.rand.Next(-40, 41); + num119 = num124 * num122; + SpeedY = num126 * num122; + Projectile.NewProjectile(vector2.X, vector2.Y, num119, SpeedY, Type, Damage, 0.0f, Main.myPlayer); + } + } + else if (this.type == 411) + Projectile.NewProjectile(vector2.X, vector2.Y, num119, SpeedY, Type, Damage, 0.0f, Main.myPlayer, ai1: ((float) this.whoAmI)); + else if (this.type == 424) + { + for (int index = 0; index < 4; ++index) + Projectile.NewProjectile(this.Center.X - (float) (this.spriteDirection * 4), this.Center.Y + 6f, (float) (2 * index - 3) * 0.15f, (float) ((double) -Main.rand.Next(0, 3) * 0.200000002980232 - 0.100000001490116), Type, Damage, 0.0f, Main.myPlayer, ai1: ((float) this.whoAmI)); + } + else if (this.type == 409) + { + int index = NPC.NewNPC((int) this.Center.X, (int) this.Center.Y, 410, this.whoAmI); + Main.npc[index].velocity = new Vector2(num119, SpeedY - 6f); + } + else + Projectile.NewProjectile(vector2.X, vector2.Y, num119, SpeedY, Type, Damage, 0.0f, Main.myPlayer); + } + this.ai[2] = (double) Math.Abs(SpeedY) <= (double) Math.Abs(num119) * 2.0 ? ((double) Math.Abs(num119) <= (double) Math.Abs(SpeedY) * 2.0 ? ((double) SpeedY <= 0.0 ? 4f : 2f) : 3f) : ((double) SpeedY <= 0.0 ? 5f : 1f); + } + if ((double) this.velocity.Y != 0.0 && !flag15 || (double) this.ai[1] <= 0.0) + { + this.ai[2] = 0.0f; + this.ai[1] = 0.0f; + } + else if (!flag14 || num105 != -1 && (double) this.ai[1] >= (double) num105 && (double) this.ai[1] < (double) (num105 + num106) && (!flag15 || (double) this.velocity.Y == 0.0)) + { + this.velocity.X *= 0.9f; + this.spriteDirection = this.direction; } } - } - if ((double) this.ai[2] <= 0.0 || flag14 && (num101 == -1 || (double) this.ai[1] < (double) num101 || (double) this.ai[1] >= (double) (num101 + num102))) - { - float num134 = 1f; - float num135 = 0.07f; - float num136 = 0.8f; - if (this.type == 214) + if (this.type == 468 && !Main.eclipse) + flag14 = true; + else if ((double) this.ai[2] <= 0.0 | flag14 && (double) this.velocity.Y == 0.0 | flag15 && (double) this.ai[1] <= 0.0 && !Main.player[this.target].dead) { - num134 = 2f; - num135 = 0.09f; + bool flag18 = Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height); + if (this.type == 520) + flag18 = Collision.CanHitLine(this.Top + new Vector2(0.0f, 20f), 0, 0, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height); + if ((double) Main.player[this.target].stealth == 0.0 && Main.player[this.target].itemAnimation == 0) + flag18 = false; + if (flag18) + { + float num127 = 10f; + Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); + float num128 = Main.player[this.target].position.X + (float) Main.player[this.target].width * 0.5f - vector2.X; + float num129 = Math.Abs(num128) * 0.1f; + float num130 = Main.player[this.target].position.Y + (float) Main.player[this.target].height * 0.5f - vector2.Y - num129; + float num131 = num128 + (float) Main.rand.Next(-40, 41); + float num132 = num130 + (float) Main.rand.Next(-40, 41); + float num133 = (float) Math.Sqrt((double) num131 * (double) num131 + (double) num132 * (double) num132); + float num134 = 700f; + if (this.type == 214) + num134 = 550f; + if (this.type == 215) + num134 = 800f; + if (this.type >= 498 && this.type <= 506) + num134 = 190f; + if (this.type >= 449 && this.type <= 452) + num134 = 200f; + if (this.type == 481) + num134 = 400f; + if (this.type == 468) + num134 = 400f; + if ((double) num133 < (double) num134) + { + this.netUpdate = true; + this.velocity.X *= 0.5f; + float num135 = num127 / num133; + float num136 = num131 * num135; + float num137 = num132 * num135; + this.ai[2] = 3f; + this.ai[1] = (float) num107; + this.ai[2] = (double) Math.Abs(num137) <= (double) Math.Abs(num136) * 2.0 ? ((double) Math.Abs(num136) <= (double) Math.Abs(num137) * 2.0 ? ((double) num137 <= 0.0 ? 4f : 2f) : 3f) : ((double) num137 <= 0.0 ? 5f : 1f); + } + } } - else if (this.type == 215) + if ((double) this.ai[2] <= 0.0 || flag14 && (num105 == -1 || (double) this.ai[1] < (double) num105 || (double) this.ai[1] >= (double) (num105 + num106))) { - num134 = 1.5f; - num135 = 0.08f; + float num138 = 1f; + float num139 = 0.07f; + float num140 = 0.8f; + if (this.type == 214) + { + num138 = 2f; + num139 = 0.09f; + } + else if (this.type == 215) + { + num138 = 1.5f; + num139 = 0.08f; + } + else if (this.type == 381 || this.type == 382) + { + num138 = 2f; + num139 = 0.5f; + } + else if (this.type == 520) + { + num138 = 4f; + num139 = 1f; + num140 = 0.7f; + } + else if (this.type == 411) + { + num138 = 2f; + num139 = 0.5f; + } + else if (this.type == 409) + { + num138 = 2f; + num139 = 0.5f; + } + bool flag19 = false; + if ((this.type == 381 || this.type == 382) && (double) Vector2.Distance(this.Center, Main.player[this.target].Center) < 300.0 && Collision.CanHitLine(this.Center, 0, 0, Main.player[this.target].Center, 0, 0)) + { + flag19 = true; + this.ai[3] = 0.0f; + } + if (this.type == 520 && (double) Vector2.Distance(this.Center, Main.player[this.target].Center) < 400.0 && Collision.CanHitLine(this.Center, 0, 0, Main.player[this.target].Center, 0, 0)) + { + flag19 = true; + this.ai[3] = 0.0f; + } + if ((((double) this.velocity.X < -(double) num138 ? 1 : ((double) this.velocity.X > (double) num138 ? 1 : 0)) | (flag19 ? 1 : 0)) != 0) + { + if ((double) this.velocity.Y == 0.0) + this.velocity = this.velocity * num140; + } + else if ((double) this.velocity.X < (double) num138 && this.direction == 1) + { + this.velocity.X += num139; + if ((double) this.velocity.X > (double) num138) + this.velocity.X = num138; + } + else if ((double) this.velocity.X > -(double) num138 && this.direction == -1) + { + this.velocity.X -= num139; + if ((double) this.velocity.X < -(double) num138) + this.velocity.X = -num138; + } } - else if (this.type == 381 || this.type == 382) + if (this.type == 520) { - num134 = 2f; - num135 = 0.5f; - } - else if (this.type == 520) - { - num134 = 4f; - num135 = 1f; - num136 = 0.7f; - } - else if (this.type == 411) - { - num134 = 2f; - num135 = 0.5f; - } - else if (this.type == 409) - { - num134 = 2f; - num135 = 0.5f; - } - bool flag19 = false; - if ((this.type == 381 || this.type == 382) && (double) Vector2.Distance(this.Center, Main.player[this.target].Center) < 300.0 && Collision.CanHitLine(this.Center, 0, 0, Main.player[this.target].Center, 0, 0)) - { - flag19 = true; - this.ai[3] = 0.0f; - } - if (this.type == 520 && (double) Vector2.Distance(this.Center, Main.player[this.target].Center) < 400.0 && Collision.CanHitLine(this.Center, 0, 0, Main.player[this.target].Center, 0, 0)) - { - flag19 = true; - this.ai[3] = 0.0f; - } - if ((((double) this.velocity.X < -(double) num134 ? 1 : ((double) this.velocity.X > (double) num134 ? 1 : 0)) | (flag19 ? 1 : 0)) != 0) - { - if ((double) this.velocity.Y == 0.0) - this.velocity = this.velocity * num136; - } - else if ((double) this.velocity.X < (double) num134 && this.direction == 1) - { - this.velocity.X += num135; - if ((double) this.velocity.X > (double) num134) - this.velocity.X = num134; - } - else if ((double) this.velocity.X > -(double) num134 && this.direction == -1) - { - this.velocity.X -= num135; - if ((double) this.velocity.X < -(double) num134) - this.velocity.X = -num134; - } - } - if (this.type == 520) - { - ++this.localAI[2]; - if ((double) this.localAI[2] >= 6.0) - { - this.localAI[2] = 0.0f; - this.localAI[3] = Main.player[this.target].DirectionFrom(this.Top + new Vector2(0.0f, 20f)).ToRotation(); + ++this.localAI[2]; + if ((double) this.localAI[2] >= 6.0) + { + this.localAI[2] = 0.0f; + this.localAI[3] = Main.player[this.target].DirectionFrom(this.Top + new Vector2(0.0f, 20f)).ToRotation(); + } } } } @@ -24290,188 +18581,161 @@ label_422: if (this.justHit) this.ai[2] = 0.0f; ++this.ai[2]; - if ((double) this.ai[2] > 60.0) + if ((double) this.ai[2] > 450.0) { Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f - (float) (this.direction * 24), this.position.Y + 4f); - if (Main.rand.Next(5) != 0 || NPC.AnyNPCs(378)) - { - int num137 = Main.rand.Next(3, 8) * this.direction; - int num138 = Main.rand.Next(-8, -5); - int index = Projectile.NewProjectile(vector2.X, vector2.Y, (float) num137, (float) num138, 75, 80, 0.0f, Main.myPlayer); - Main.projectile[index].timeLeft = 300; - this.ai[2] = 0.0f; - } - else - { - this.ai[2] = -120f; - NetMessage.SendData(23, number: NPC.NewNPC((int) vector2.X, (int) vector2.Y, 378)); - } + int num141 = 3 * this.direction; + int num142 = -5; + int index = Projectile.NewProjectile(vector2.X, vector2.Y, (float) num141, (float) num142, 75, 0, 0.0f, Main.myPlayer); + Main.projectile[index].timeLeft = 300; + this.ai[2] = 0.0f; } } - if ((double) this.velocity.Y == 0.0 | flag1) + bool flag20 = false; + if ((double) this.velocity.Y == 0.0) { - int index21 = (int) ((double) this.position.Y + (double) this.height + 7.0) / 16; - int index22 = (int) ((double) this.position.Y - 9.0) / 16; - int num139 = (int) this.position.X / 16; - int num140 = (int) ((double) this.position.X + (double) this.width) / 16; - int num141 = (int) ((double) this.position.X + 8.0) / 16; - int num142 = (int) ((double) this.position.X + (double) this.width - 8.0) / 16; - bool flag20 = false; - for (int index23 = num141; index23 <= num142; ++index23) + int index28 = (int) ((double) this.position.Y + (double) this.height + 7.0) / 16; + int num143 = (int) this.position.X / 16; + int num144 = (int) ((double) this.position.X + (double) this.width) / 16; + for (int index29 = num143; index29 <= num144; ++index29) { - if (index23 >= num139 && index23 <= num140 && Main.tile[index23, index21] == null) + if (Main.tile[index29, index28] == null) + return; + if (Main.tile[index29, index28].nactive() && Main.tileSolid[(int) Main.tile[index29, index28].type]) { flag20 = true; - } - else - { - if (Main.tile[index23, index22] != null && Main.tile[index23, index22].nactive() && Main.tileSolid[(int) Main.tile[index23, index22].type]) - { - flag5 = false; - break; - } - if (!flag20 && index23 >= num139 && index23 <= num140 && Main.tile[index23, index21].nactive() && Main.tileSolid[(int) Main.tile[index23, index21].type]) - flag5 = true; + break; } } - if (!flag5 && (double) this.velocity.Y < 0.0) - this.velocity.Y = 0.0f; - if (flag20) - return; } if (this.type == 428) - flag5 = false; - if ((double) this.velocity.Y >= 0.0 && (this.type != 580 || this.directionY != 1)) + flag20 = false; + if ((double) this.velocity.Y >= 0.0) { - int num143 = 0; + int num145 = 0; if ((double) this.velocity.X < 0.0) - num143 = -1; + num145 = -1; if ((double) this.velocity.X > 0.0) - num143 = 1; + num145 = 1; Vector2 position = this.position; position.X += this.velocity.X; - int x = (int) (((double) position.X + (double) (this.width / 2) + (double) ((this.width / 2 + 1) * num143)) / 16.0); - int y = (int) (((double) position.Y + (double) this.height - 1.0) / 16.0); - if (WorldGen.InWorld(x, y, 4)) + int index30 = (int) (((double) position.X + (double) (this.width / 2) + (double) ((this.width / 2 + 1) * num145)) / 16.0); + int index31 = (int) (((double) position.Y + (double) this.height - 1.0) / 16.0); + if (Main.tile[index30, index31] == null) + Main.tile[index30, index31] = new Tile(); + if (Main.tile[index30, index31 - 1] == null) + Main.tile[index30, index31 - 1] = new Tile(); + if (Main.tile[index30, index31 - 2] == null) + Main.tile[index30, index31 - 2] = new Tile(); + if (Main.tile[index30, index31 - 3] == null) + Main.tile[index30, index31 - 3] = new Tile(); + if (Main.tile[index30, index31 + 1] == null) + Main.tile[index30, index31 + 1] = new Tile(); + if (Main.tile[index30 - num145, index31 - 3] == null) + Main.tile[index30 - num145, index31 - 3] = new Tile(); + if ((double) (index30 * 16) < (double) position.X + (double) this.width && (double) (index30 * 16 + 16) > (double) position.X && (Main.tile[index30, index31].nactive() && !Main.tile[index30, index31].topSlope() && !Main.tile[index30, index31 - 1].topSlope() && Main.tileSolid[(int) Main.tile[index30, index31].type] && !Main.tileSolidTop[(int) Main.tile[index30, index31].type] || Main.tile[index30, index31 - 1].halfBrick() && Main.tile[index30, index31 - 1].nactive()) && (!Main.tile[index30, index31 - 1].nactive() || !Main.tileSolid[(int) Main.tile[index30, index31 - 1].type] || Main.tileSolidTop[(int) Main.tile[index30, index31 - 1].type] || Main.tile[index30, index31 - 1].halfBrick() && (!Main.tile[index30, index31 - 4].nactive() || !Main.tileSolid[(int) Main.tile[index30, index31 - 4].type] || Main.tileSolidTop[(int) Main.tile[index30, index31 - 4].type])) && (!Main.tile[index30, index31 - 2].nactive() || !Main.tileSolid[(int) Main.tile[index30, index31 - 2].type] || Main.tileSolidTop[(int) Main.tile[index30, index31 - 2].type]) && (!Main.tile[index30, index31 - 3].nactive() || !Main.tileSolid[(int) Main.tile[index30, index31 - 3].type] || Main.tileSolidTop[(int) Main.tile[index30, index31 - 3].type]) && (!Main.tile[index30 - num145, index31 - 3].nactive() || !Main.tileSolid[(int) Main.tile[index30 - num145, index31 - 3].type])) { - if (Main.tile[x, y] == null) - Main.tile[x, y] = new Tile(); - if (Main.tile[x, y - 1] == null) - Main.tile[x, y - 1] = new Tile(); - if (Main.tile[x, y - 2] == null) - Main.tile[x, y - 2] = new Tile(); - if (Main.tile[x, y - 3] == null) - Main.tile[x, y - 3] = new Tile(); - if (Main.tile[x, y + 1] == null) - Main.tile[x, y + 1] = new Tile(); - if (Main.tile[x - num143, y - 3] == null) - Main.tile[x - num143, y - 3] = new Tile(); - if ((double) (x * 16) < (double) position.X + (double) this.width && (double) (x * 16 + 16) > (double) position.X && (Main.tile[x, y].nactive() && !Main.tile[x, y].topSlope() && !Main.tile[x, y - 1].topSlope() && Main.tileSolid[(int) Main.tile[x, y].type] && !Main.tileSolidTop[(int) Main.tile[x, y].type] || Main.tile[x, y - 1].halfBrick() && Main.tile[x, y - 1].nactive()) && (!Main.tile[x, y - 1].nactive() || !Main.tileSolid[(int) Main.tile[x, y - 1].type] || Main.tileSolidTop[(int) Main.tile[x, y - 1].type] || Main.tile[x, y - 1].halfBrick() && (!Main.tile[x, y - 4].nactive() || !Main.tileSolid[(int) Main.tile[x, y - 4].type] || Main.tileSolidTop[(int) Main.tile[x, y - 4].type])) && (!Main.tile[x, y - 2].nactive() || !Main.tileSolid[(int) Main.tile[x, y - 2].type] || Main.tileSolidTop[(int) Main.tile[x, y - 2].type]) && (!Main.tile[x, y - 3].nactive() || !Main.tileSolid[(int) Main.tile[x, y - 3].type] || Main.tileSolidTop[(int) Main.tile[x, y - 3].type]) && (!Main.tile[x - num143, y - 3].nactive() || !Main.tileSolid[(int) Main.tile[x - num143, y - 3].type])) + float num146 = (float) (index31 * 16); + if (Main.tile[index30, index31].halfBrick()) + num146 += 8f; + if (Main.tile[index30, index31 - 1].halfBrick()) + num146 -= 8f; + if ((double) num146 < (double) position.Y + (double) this.height) { - float num144 = (float) (y * 16); - if (Main.tile[x, y].halfBrick()) - num144 += 8f; - if (Main.tile[x, y - 1].halfBrick()) - num144 -= 8f; - if ((double) num144 < (double) position.Y + (double) this.height) + float num147 = position.Y + (float) this.height - num146; + float num148 = 16.1f; + if (this.type == 163 || this.type == 164 || this.type == 236 || this.type == 239 || this.type == 530) + num148 += 8f; + if ((double) num147 <= (double) num148) { - float num145 = position.Y + (float) this.height - num144; - float num146 = 16.1f; - if (this.type == 163 || this.type == 164 || this.type == 236 || this.type == 239 || this.type == 530) - num146 += 8f; - if ((double) num145 <= (double) num146) - { - this.gfxOffY += this.position.Y + (float) this.height - num144; - this.position.Y = num144 - (float) this.height; - this.stepSpeed = (double) num145 >= 9.0 ? 2f : 1f; - } + this.gfxOffY += this.position.Y + (float) this.height - num146; + this.position.Y = num146 - (float) this.height; + this.stepSpeed = (double) num147 >= 9.0 ? 2f : 1f; } } } } - if (flag5) + if (flag20) { - int index24 = (int) (((double) this.position.X + (double) (this.width / 2) + (double) (15 * this.direction)) / 16.0); - int index25 = (int) (((double) this.position.Y + (double) this.height - 15.0) / 16.0); - if (this.type == 109 || this.type == 163 || this.type == 164 || this.type == 199 || this.type == 236 || this.type == 239 || this.type == 257 || this.type == 258 || this.type == 290 || this.type == 391 || this.type == 425 || this.type == 427 || this.type == 426 || this.type == 580 || this.type == 508 || this.type == 415 || this.type == 530 || this.type == 532 || this.type == 582) - index24 = (int) (((double) this.position.X + (double) (this.width / 2) + (double) ((this.width / 2 + 16) * this.direction)) / 16.0); - if (Main.tile[index24, index25] == null) - Main.tile[index24, index25] = new Tile(); - if (Main.tile[index24, index25 - 1] == null) - Main.tile[index24, index25 - 1] = new Tile(); - if (Main.tile[index24, index25 - 2] == null) - Main.tile[index24, index25 - 2] = new Tile(); - if (Main.tile[index24, index25 - 3] == null) - Main.tile[index24, index25 - 3] = new Tile(); - if (Main.tile[index24, index25 + 1] == null) - Main.tile[index24, index25 + 1] = new Tile(); - if (Main.tile[index24 + this.direction, index25 - 1] == null) - Main.tile[index24 + this.direction, index25 - 1] = new Tile(); - if (Main.tile[index24 + this.direction, index25 + 1] == null) - Main.tile[index24 + this.direction, index25 + 1] = new Tile(); - if (Main.tile[index24 - this.direction, index25 + 1] == null) - Main.tile[index24 - this.direction, index25 + 1] = new Tile(); - Main.tile[index24, index25 + 1].halfBrick(); - if (((!Main.tile[index24, index25 - 1].nactive() ? 0 : (Main.tile[index24, index25 - 1].type == (ushort) 10 ? 1 : (Main.tile[index24, index25 - 1].type == (ushort) 388 ? 1 : 0))) & (flag8 ? 1 : 0)) != 0) + int index32 = (int) (((double) this.position.X + (double) (this.width / 2) + (double) (15 * this.direction)) / 16.0); + int index33 = (int) (((double) this.position.Y + (double) this.height - 15.0) / 16.0); + if (this.type == 109 || this.type == 163 || this.type == 164 || this.type == 199 || this.type == 236 || this.type == 239 || this.type == 257 || this.type == 258 || this.type == 290 || this.type == 391 || this.type == 425 || this.type == 427 || this.type == 426 || this.type == 508 || this.type == 415 || this.type == 530 || this.type == 532) + index32 = (int) (((double) this.position.X + (double) (this.width / 2) + (double) ((this.width / 2 + 16) * this.direction)) / 16.0); + if (Main.tile[index32, index33] == null) + Main.tile[index32, index33] = new Tile(); + if (Main.tile[index32, index33 - 1] == null) + Main.tile[index32, index33 - 1] = new Tile(); + if (Main.tile[index32, index33 - 2] == null) + Main.tile[index32, index33 - 2] = new Tile(); + if (Main.tile[index32, index33 - 3] == null) + Main.tile[index32, index33 - 3] = new Tile(); + if (Main.tile[index32, index33 + 1] == null) + Main.tile[index32, index33 + 1] = new Tile(); + if (Main.tile[index32 + this.direction, index33 - 1] == null) + Main.tile[index32 + this.direction, index33 - 1] = new Tile(); + if (Main.tile[index32 + this.direction, index33 + 1] == null) + Main.tile[index32 + this.direction, index33 + 1] = new Tile(); + if (Main.tile[index32 - this.direction, index33 + 1] == null) + Main.tile[index32 - this.direction, index33 + 1] = new Tile(); + Main.tile[index32, index33 + 1].halfBrick(); + if (((!Main.tile[index32, index33 - 1].nactive() ? 0 : (Main.tile[index32, index33 - 1].type == (ushort) 10 ? 1 : (Main.tile[index32, index33 - 1].type == (ushort) 388 ? 1 : 0))) & (flag3 ? 1 : 0)) != 0) { ++this.ai[2]; this.ai[3] = 0.0f; if ((double) this.ai[2] >= 60.0) { - bool flag21 = this.type == 3 || this.type == 430 || this.type == 590 || this.type == 331 || this.type == 332 || this.type == 132 || this.type == 161 || this.type == 186 || this.type == 187 || this.type == 188 || this.type == 189 || this.type == 200 || this.type == 223 || this.type == 320 || this.type == 321 || this.type == 319 || this.type == 21 || this.type == 324 || this.type == 323 || this.type == 322 || this.type == 44 || this.type == 196 || this.type == 167 || this.type == 77 || this.type == 197 || this.type == 202 || this.type == 203 || this.type == 449 || this.type == 450 || this.type == 451 || this.type == 452 || this.type == 481 || this.type == 201 || this.type == 635; - bool flag22 = Main.player[this.target].ZoneGraveyard && Main.rand.Next(60) == 0; - if (((!Main.bloodMoon || Main.getGoodWorld ? (!flag22 ? 1 : 0) : 0) & (flag21 ? 1 : 0)) != 0) + if (!Main.bloodMoon && (this.type == 3 || this.type == 331 || this.type == 332 || this.type == 132 || this.type == 161 || this.type == 186 || this.type == 187 || this.type == 188 || this.type == 189 || this.type == 200 || this.type == 223 || this.type == 320 || this.type == 321 || this.type == 319)) this.ai[1] = 0.0f; this.velocity.X = 0.5f * (float) -this.direction; - int num147 = 5; - if (Main.tile[index24, index25 - 1].type == (ushort) 388) - num147 = 2; - this.ai[1] += (float) num147; + int num149 = 5; + if (Main.tile[index32, index33 - 1].type == (ushort) 388) + num149 = 2; + this.ai[1] += (float) num149; if (this.type == 27) ++this.ai[1]; if (this.type == 31 || this.type == 294 || this.type == 295 || this.type == 296) this.ai[1] += 6f; this.ai[2] = 0.0f; - bool flag23 = false; + bool flag21 = false; if ((double) this.ai[1] >= 10.0) { - flag23 = true; + flag21 = true; this.ai[1] = 10f; } if (this.type == 460) - flag23 = true; - WorldGen.KillTile(index24, index25 - 1, true); - if ((Main.netMode != 1 || !flag23) && flag23 && Main.netMode != 1) + flag21 = true; + WorldGen.KillTile(index32, index33 - 1, true); + if ((Main.netMode != 1 || !flag21) && flag21 && Main.netMode != 1) { if (this.type == 26) { - WorldGen.KillTile(index24, index25 - 1); + WorldGen.KillTile(index32, index33 - 1); if (Main.netMode == 2) - NetMessage.SendData(17, number2: ((float) index24), number3: ((float) (index25 - 1))); + NetMessage.SendData(17, number2: ((float) index32), number3: ((float) (index33 - 1))); } else { - if (Main.tile[index24, index25 - 1].type == (ushort) 10) + if (Main.tile[index32, index33 - 1].type == (ushort) 10) { - bool flag24 = WorldGen.OpenDoor(index24, index25 - 1, this.direction); - if (!flag24) + bool flag22 = WorldGen.OpenDoor(index32, index33 - 1, this.direction); + if (!flag22) { - this.ai[3] = (float) num32; + this.ai[3] = (float) num26; this.netUpdate = true; } - if (Main.netMode == 2 & flag24) - NetMessage.SendData(19, number2: ((float) index24), number3: ((float) (index25 - 1)), number4: ((float) this.direction)); + if (Main.netMode == 2 & flag22) + NetMessage.SendData(19, number2: ((float) index32), number3: ((float) (index33 - 1)), number4: ((float) this.direction)); } - if (Main.tile[index24, index25 - 1].type == (ushort) 388) + if (Main.tile[index32, index33 - 1].type == (ushort) 388) { - bool flag25 = WorldGen.ShiftTallGate(index24, index25 - 1, false); - if (!flag25) + bool flag23 = WorldGen.ShiftTallGate(index32, index33 - 1, false); + if (!flag23) { - this.ai[3] = (float) num32; + this.ai[3] = (float) num26; this.netUpdate = true; } - if (Main.netMode == 2 & flag25) - NetMessage.SendData(19, number: 4, number2: ((float) index24), number3: ((float) (index25 - 1))); + if (Main.netMode == 2 & flag23) + NetMessage.SendData(19, number: 4, number2: ((float) index32), number3: ((float) (index33 - 1))); } } } @@ -24484,9 +18748,9 @@ label_422: spriteDirection *= -1; if ((double) this.velocity.X < 0.0 && spriteDirection == -1 || (double) this.velocity.X > 0.0 && spriteDirection == 1) { - if (this.height >= 32 && Main.tile[index24, index25 - 2].nactive() && Main.tileSolid[(int) Main.tile[index24, index25 - 2].type]) + if (this.height >= 32 && Main.tile[index32, index33 - 2].nactive() && Main.tileSolid[(int) Main.tile[index32, index33 - 2].type]) { - if (Main.tile[index24, index25 - 3].nactive() && Main.tileSolid[(int) Main.tile[index24, index25 - 3].type]) + if (Main.tile[index32, index33 - 3].nactive() && Main.tileSolid[(int) Main.tile[index32, index33 - 3].type]) { this.velocity.Y = -8f; this.netUpdate = true; @@ -24497,122 +18761,39 @@ label_422: this.netUpdate = true; } } - else if (Main.tile[index24, index25 - 1].nactive() && Main.tileSolid[(int) Main.tile[index24, index25 - 1].type]) + else if (Main.tile[index32, index33 - 1].nactive() && Main.tileSolid[(int) Main.tile[index32, index33 - 1].type]) { - if (this.type == 624) - { - this.velocity.Y = -8f; - if (WorldGen.SolidTile((int) this.Center.X / 16, (int) ((double) this.position.Y + (double) this.height) / 16 - 8)) - { - this.direction *= -1; - this.spriteDirection = this.direction; - this.velocity.X = (float) (3 * this.direction); - } - } - else - this.velocity.Y = -6f; + this.velocity.Y = -6f; this.netUpdate = true; } - else if ((double) this.position.Y + (double) this.height - (double) (index25 * 16) > 20.0 && Main.tile[index24, index25].nactive() && !Main.tile[index24, index25].topSlope() && Main.tileSolid[(int) Main.tile[index24, index25].type]) + else if ((double) this.position.Y + (double) this.height - (double) (index33 * 16) > 20.0 && Main.tile[index32, index33].nactive() && !Main.tile[index32, index33].topSlope() && Main.tileSolid[(int) Main.tile[index32, index33].type]) { this.velocity.Y = -5f; this.netUpdate = true; } - else if (this.directionY < 0 && this.type != 67 && (!Main.tile[index24, index25 + 1].nactive() || !Main.tileSolid[(int) Main.tile[index24, index25 + 1].type]) && (!Main.tile[index24 + this.direction, index25 + 1].nactive() || !Main.tileSolid[(int) Main.tile[index24 + this.direction, index25 + 1].type])) + else if (this.directionY < 0 && this.type != 67 && (!Main.tile[index32, index33 + 1].nactive() || !Main.tileSolid[(int) Main.tile[index32, index33 + 1].type]) && (!Main.tile[index32 + this.direction, index33 + 1].nactive() || !Main.tileSolid[(int) Main.tile[index32 + this.direction, index33 + 1].type])) { this.velocity.Y = -8f; this.velocity.X *= 1.5f; this.netUpdate = true; } - else if (flag8) + else if (flag3) { this.ai[1] = 0.0f; this.ai[2] = 0.0f; } - if ((double) this.velocity.Y == 0.0 & flag6 && (double) this.ai[3] == 1.0) + if ((double) this.velocity.Y == 0.0 & flag1 && (double) this.ai[3] == 1.0) this.velocity.Y = -5f; - if ((double) this.velocity.Y == 0.0 && (Main.expertMode ? 1 : (this.type == 586 ? 1 : 0)) != 0 && (double) Main.player[this.target].Bottom.Y < (double) this.Top.Y && (double) Math.Abs(this.Center.X - Main.player[this.target].Center.X) < (double) (Main.player[this.target].width * 3) && Collision.CanHit((Entity) this, (Entity) Main.player[this.target])) - { - if (this.type == 586) - { - int num148 = (int) (((double) this.Bottom.Y - 16.0 - (double) Main.player[this.target].Bottom.Y) / 16.0); - if (num148 < 14 && Collision.CanHit((Entity) this, (Entity) Main.player[this.target])) - { - if (num148 < 7) - this.velocity.Y = -8.8f; - else if (num148 < 8) - this.velocity.Y = -9.2f; - else if (num148 < 9) - this.velocity.Y = -9.7f; - else if (num148 < 10) - this.velocity.Y = -10.3f; - else if (num148 < 11) - this.velocity.Y = -10.6f; - else - this.velocity.Y = -11f; - } - } - if ((double) this.velocity.Y == 0.0) - { - int num149 = 6; - if ((double) Main.player[this.target].Bottom.Y > (double) this.Top.Y - (double) (num149 * 16)) - { - this.velocity.Y = -7.9f; - } - else - { - int index26 = (int) ((double) this.Center.X / 16.0); - int num150 = (int) ((double) this.Bottom.Y / 16.0) - 1; - for (int index27 = num150; index27 > num150 - num149; --index27) - { - if (Main.tile[index26, index27].nactive() && TileID.Sets.Platforms[(int) Main.tile[index26, index27].type]) - { - this.velocity.Y = -7.9f; - break; - } - } - } - } - } } - if ((this.type == 31 || this.type == 294 || this.type == 295 || this.type == 296 || this.type == 47 || this.type == 77 || this.type == 104 || this.type == 168 || this.type == 196 || this.type == 385 || this.type == 389 || this.type == 464 || this.type == 470 || this.type >= 524 && this.type <= 527) && (double) this.velocity.Y == 0.0) + if ((this.type == 31 || this.type == 294 || this.type == 295 || this.type == 296 || this.type == 47 || this.type == 77 || this.type == 104 || this.type == 168 || this.type == 196 || this.type == 385 || this.type == 389 || this.type == 464 || this.type == 470 || this.type >= 524 && this.type <= 527) && (double) this.velocity.Y == 0.0 && (double) Math.Abs((float) ((double) this.position.X + (double) (this.width / 2) - ((double) Main.player[this.target].position.X + (double) (Main.player[this.target].width / 2)))) < 100.0 && (double) Math.Abs((float) ((double) this.position.Y + (double) (this.height / 2) - ((double) Main.player[this.target].position.Y + (double) (Main.player[this.target].height / 2)))) < 50.0 && (this.direction > 0 && (double) this.velocity.X >= 1.0 || this.direction < 0 && (double) this.velocity.X <= -1.0)) { - int num151 = 100; - int num152 = 50; - if (this.type == 586) - { - num151 = 150; - num152 = 150; - } - if ((double) Math.Abs((float) ((double) this.position.X + (double) (this.width / 2) - ((double) Main.player[this.target].position.X + (double) (Main.player[this.target].width / 2)))) < (double) num151 && (double) Math.Abs((float) ((double) this.position.Y + (double) (this.height / 2) - ((double) Main.player[this.target].position.Y + (double) (Main.player[this.target].height / 2)))) < (double) num152 && (this.direction > 0 && (double) this.velocity.X >= 1.0 || this.direction < 0 && (double) this.velocity.X <= -1.0)) - { - if (this.type == 586) - { - this.velocity.X += (float) this.direction; - this.velocity.X *= 2f; - if ((double) this.velocity.X > 8.0) - this.velocity.X = 8f; - if ((double) this.velocity.X < -8.0) - this.velocity.X = -8f; - this.velocity.Y = -4.5f; - if ((double) this.position.Y > (double) Main.player[this.target].position.Y + 40.0) - this.velocity.Y -= 2f; - if ((double) this.position.Y > (double) Main.player[this.target].position.Y + 80.0) - this.velocity.Y -= 2f; - if ((double) this.position.Y > (double) Main.player[this.target].position.Y + 120.0) - this.velocity.Y -= 2f; - } - else - { - this.velocity.X *= 2f; - if ((double) this.velocity.X > 3.0) - this.velocity.X = 3f; - if ((double) this.velocity.X < -3.0) - this.velocity.X = -3f; - this.velocity.Y = -4f; - } - this.netUpdate = true; - } + this.velocity.X *= 2f; + if ((double) this.velocity.X > 3.0) + this.velocity.X = 3f; + if ((double) this.velocity.X < -3.0) + this.velocity.X = -3f; + this.velocity.Y = -4f; + this.netUpdate = true; } if (this.type == 120 && (double) this.velocity.Y < 0.0) this.velocity.Y *= 1.1f; @@ -24634,42 +18815,42 @@ label_422: } } } - else if (flag8) + else if (flag3) { this.ai[1] = 0.0f; this.ai[2] = 0.0f; } - if (Main.netMode == 1 || this.type != 120 || (double) this.ai[3] < (double) num32) + if (Main.netMode == 1 || this.type != 120 || (double) this.ai[3] < (double) num26) return; - int num153 = (int) Main.player[this.target].position.X / 16; - int num154 = (int) Main.player[this.target].position.Y / 16; - int num155 = (int) this.position.X / 16; - int num156 = (int) this.position.Y / 16; - int num157 = 20; - int num158 = 0; - bool flag26 = false; + int num150 = (int) Main.player[this.target].position.X / 16; + int num151 = (int) Main.player[this.target].position.Y / 16; + int num152 = (int) this.position.X / 16; + int num153 = (int) this.position.Y / 16; + int num154 = 20; + int num155 = 0; + bool flag24 = false; if ((double) Math.Abs(this.position.X - Main.player[this.target].position.X) + (double) Math.Abs(this.position.Y - Main.player[this.target].position.Y) > 2000.0) { - num158 = 100; - flag26 = true; + num155 = 100; + flag24 = true; } - while (!flag26 && num158 < 100) + while (!flag24 && num155 < 100) { - ++num158; - int index28 = Main.rand.Next(num153 - num157, num153 + num157); - for (int index29 = Main.rand.Next(num154 - num157, num154 + num157); index29 < num154 + num157; ++index29) + ++num155; + int index34 = Main.rand.Next(num150 - num154, num150 + num154); + for (int index35 = Main.rand.Next(num151 - num154, num151 + num154); index35 < num151 + num154; ++index35) { - if ((index29 < num154 - 4 || index29 > num154 + 4 || index28 < num153 - 4 || index28 > num153 + 4) && (index29 < num156 - 1 || index29 > num156 + 1 || index28 < num155 - 1 || index28 > num155 + 1) && Main.tile[index28, index29].nactive()) + if ((index35 < num151 - 4 || index35 > num151 + 4 || index34 < num150 - 4 || index34 > num150 + 4) && (index35 < num153 - 1 || index35 > num153 + 1 || index34 < num152 - 1 || index34 > num152 + 1) && Main.tile[index34, index35].nactive()) { - bool flag27 = true; - if (this.type == 32 && Main.tile[index28, index29 - 1].wall == (ushort) 0) - flag27 = false; - else if (Main.tile[index28, index29 - 1].lava()) - flag27 = false; - if (flag27 && Main.tileSolid[(int) Main.tile[index28, index29].type] && !Collision.SolidTiles(index28 - 1, index28 + 1, index29 - 4, index29 - 1)) + bool flag25 = true; + if (this.type == 32 && Main.tile[index34, index35 - 1].wall == (byte) 0) + flag25 = false; + else if (Main.tile[index34, index35 - 1].lava()) + flag25 = false; + if (flag25 && Main.tileSolid[(int) Main.tile[index34, index35].type] && !Collision.SolidTiles(index34 - 1, index34 + 1, index35 - 4, index35 - 1)) { - this.position.X = (float) (index28 * 16 - this.width / 2); - this.position.Y = (float) (index29 * 16 - this.height); + this.position.X = (float) (index34 * 16 - this.width / 2); + this.position.Y = (float) (index35 * 16 - this.height); this.netUpdate = true; this.ai[3] = -120f; } @@ -24678,16 +18859,6 @@ label_422: } } - public static bool DespawnEncouragement_AIStyle3_Fighters_NotDiscouraged( - int npcID, - Vector2 position, - NPC npcInstance) - { - return Main.eclipse || !Main.dayTime || npcInstance != null && npcInstance.SpawnedFromStatue || (double) position.Y > Main.worldSurface * 16.0 || npcInstance != null && Main.player[npcInstance.target].ZoneGraveyard || Main.snowMoon && (npcID == 343 || npcID == 350) || Main.invasionType == 1 && (npcID == 26 || npcID == 27 || npcID == 28 || npcID == 111 || npcID == 471) || npcID == 73 || npcID == 624 || npcID == 631 && (double) npcInstance.ai[2] > 0.0 || Main.invasionType == 3 && npcID >= 212 && npcID <= 216 || Main.invasionType == 4 && (npcID == 381 || npcID == 382 || npcID == 383 || npcID == 385 || npcID == 386 || npcID == 389 || npcID == 391 || npcID == 520) || npcID == 31 || npcID == 294 || npcID == 295 || npcID == 296 || npcID == 47 || npcID == 67 || npcID == 77 || npcID == 78 || npcID == 79 || npcID == 80 || npcID == 630 || npcID == 110 || npcID == 120 || npcID == 168 || npcID == 181 || npcID == 185 || npcID == 198 || npcID == 199 || npcID == 206 || npcID == 217 || npcID == 218 || npcID == 219 || npcID == 220 || npcID == 239 || npcID == 243 || npcID == 254 || npcID == (int) byte.MaxValue || npcID == 257 || npcID == 258 || npcID == 291 || npcID == 292 || npcID == 293 || npcID == 379 || npcID == 380 || npcID == 464 || npcID == 470 || npcID == 424 || npcID == 411 && (npcInstance == null || (double) npcInstance.ai[1] >= 180.0 || (double) npcInstance.ai[1] < 90.0) || npcID == 409 || npcID == 425 || npcID == 429 || npcID == 427 || npcID == 428 || npcID == 580 || npcID == 582 || npcID == 508 || npcID == 415 || npcID == 419 || npcID >= 524 && npcID <= 527 || npcID == 528 || npcID == 529 || npcID == 530 || npcID == 532; - } - - public static bool DespawnEncouragement_AIStyle3_Fighters_CanBeBusyWithAction(int npcID) => npcID == 110 || npcID == 111 || npcID == 206 || npcID == 216 || npcID == 214 || npcID == 215 || npcID == 291 || npcID == 292 || npcID == 293 || npcID == 350 || npcID == 381 || npcID == 382 || npcID == 383 || npcID == 385 || npcID == 386 || npcID == 389 || npcID == 391 || npcID == 469 || npcID == 166 || npcID == 466 || npcID == 471 || npcID == 411 || npcID == 409 || npcID == 424 || npcID == 425 || npcID == 426 || npcID == 415 || npcID == 419 || npcID == 520; - private void AI_001_Slimes() { if (this.type == 1 && ((double) this.ai[1] == 1.0 || (double) this.ai[1] == 2.0 || (double) this.ai[1] == 3.0)) @@ -24697,597 +18868,412 @@ label_422: this.ai[1] = -1f; if (Main.rand.Next(20) == 0) { - this.ai[1] = (float) NPC.AI_001_Slimes_GenerateItemInsideBody((double) this.ai[0] == -999.0); + int num; + switch (Main.rand.Next(4)) + { + case 0: + switch (Main.rand.Next(7)) + { + case 0: + num = 290; + break; + case 1: + num = 292; + break; + case 2: + num = 296; + break; + case 3: + num = 2322; + break; + default: + num = Main.netMode == 0 || Main.rand.Next(2) != 0 ? 2350 : 2997; + break; + } + break; + case 1: + switch (Main.rand.Next(4)) + { + case 0: + num = 8; + break; + case 1: + num = 166; + break; + case 2: + num = 965; + break; + default: + num = 58; + break; + } + break; + case 2: + num = Main.rand.Next(2) != 0 ? Main.rand.Next(699, 703) : Main.rand.Next(11, 15); + break; + default: + switch (Main.rand.Next(3)) + { + case 0: + num = 71; + break; + case 1: + num = 72; + break; + default: + num = 73; + break; + } + break; + } + this.ai[1] = (float) num; this.netUpdate = true; } } - if (this.type == 1 && (double) this.ai[0] == -999.0) + if (this.type == 244) { - this.frame.Y = 0; - this.frameCounter = 0.0; - this.rotation = 0.0f; + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), (float) Main.DiscoR / (float) byte.MaxValue * 1f, (float) Main.DiscoG / (float) byte.MaxValue * 1f, (float) Main.DiscoB / (float) byte.MaxValue * 1f); + this.color.R = (byte) Main.DiscoR; + this.color.G = (byte) Main.DiscoG; + this.color.B = (byte) Main.DiscoB; + this.color.A = (byte) 100; + this.alpha = 175; } - else + bool flag = false; + if (!Main.dayTime || this.life != this.lifeMax || (double) this.position.Y > Main.worldSurface * 16.0 || Main.slimeRain) + flag = true; + if (this.type == 81) { - if (this.type == 244) + flag = true; + if (Main.rand.Next(30) == 0) { - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), (float) Main.DiscoR / (float) byte.MaxValue * 1f, (float) Main.DiscoG / (float) byte.MaxValue * 1f, (float) Main.DiscoB / (float) byte.MaxValue * 1f); - this.AI_001_SetRainbowSlimeColor(); + int index = Dust.NewDust(this.position, this.width, this.height, 14, Alpha: this.alpha, newColor: this.color); + Main.dust[index].velocity *= 0.3f; } - bool flag = false; - if (!Main.dayTime || this.life != this.lifeMax || (double) this.position.Y > Main.worldSurface * 16.0 || Main.slimeRain) - flag = true; - if (this.type == 81) + } + if ((this.type == 377 || this.type == 446) && this.target != (int) byte.MaxValue && !Main.player[this.target].dead && (double) Vector2.Distance(this.Center, Main.player[this.target].Center) <= 200.0) + flag = true; + if (this.type == 183) + flag = true; + if (this.type == 304) + flag = true; + if (this.type == 244) + { + flag = true; + this.ai[0] += 2f; + } + if (this.type == 147 && Main.rand.Next(10) == 0) + { + int index = Dust.NewDust(this.position, this.width, this.height, 76); + Main.dust[index].noGravity = true; + Main.dust[index].velocity *= 0.1f; + } + if (this.type == 184) + { + if (Main.rand.Next(8) == 0) { - flag = true; - if (Main.rand.Next(30) == 0) - { - this.position = this.position + this.netOffset; - int index = Dust.NewDust(this.position, this.width, this.height, 14, Alpha: this.alpha, newColor: this.color); - Main.dust[index].velocity *= 0.3f; - this.position = this.position - this.netOffset; - } - } - if ((this.type == 377 || this.type == 446) && this.target != (int) byte.MaxValue && !Main.player[this.target].dead && (double) Vector2.Distance(this.Center, Main.player[this.target].Center) <= 200.0 && !this.wet) - flag = true; - if (this.type == 183) - flag = true; - if (this.type == 304) - flag = true; - if (this.type == 244) - { - flag = true; - this.ai[0] += 2f; - } - if (this.type == 147 && Main.rand.Next(10) == 0) - { - this.position = this.position + this.netOffset; - int index = Dust.NewDust(this.position, this.width, this.height, 76); + int index = Dust.NewDust(this.position - this.velocity, this.width, this.height, 76); Main.dust[index].noGravity = true; - Main.dust[index].velocity *= 0.1f; - this.position = this.position - this.netOffset; + Main.dust[index].velocity *= 0.15f; } - if (this.type == 184) + flag = true; + if ((double) this.localAI[0] > 0.0) + --this.localAI[0]; + if (!this.wet && !Main.player[this.target].npcTypeNoAggro[this.type]) { - if (Main.rand.Next(8) == 0) + Vector2 vector2_1 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); + float num1 = Main.player[this.target].position.X + (float) Main.player[this.target].width * 0.5f - vector2_1.X; + float num2 = Main.player[this.target].position.Y - vector2_1.Y; + float num3 = (float) Math.Sqrt((double) num1 * (double) num1 + (double) num2 * (double) num2); + if (Main.expertMode && (double) num3 < 120.0 && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height) && (double) this.velocity.Y == 0.0) { - this.position = this.position + this.netOffset; - int index = Dust.NewDust(this.position - this.velocity, this.width, this.height, 76); - Main.dust[index].noGravity = true; - Main.dust[index].velocity *= 0.15f; - this.position = this.position - this.netOffset; - } - flag = true; - if ((double) this.localAI[0] > 0.0) - --this.localAI[0]; - if (!this.wet && !Main.player[this.target].npcTypeNoAggro[this.type]) - { - Vector2 vector2_1 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); - float num1 = Main.player[this.target].position.X + (float) Main.player[this.target].width * 0.5f - vector2_1.X; - float num2 = Main.player[this.target].position.Y - vector2_1.Y; - float num3 = (float) Math.Sqrt((double) num1 * (double) num1 + (double) num2 * (double) num2); - if (Main.expertMode && (double) num3 < 120.0 && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height) && (double) this.velocity.Y == 0.0) + this.ai[0] = -40f; + if ((double) this.velocity.Y == 0.0) + this.velocity.X *= 0.9f; + if (Main.netMode != 1 && (double) this.localAI[0] == 0.0) { - this.ai[0] = -40f; - if ((double) this.velocity.Y == 0.0) - this.velocity.X *= 0.9f; - if (Main.netMode != 1 && (double) this.localAI[0] == 0.0) + for (int index = 0; index < 5; ++index) { - for (int index = 0; index < 5; ++index) - { - Vector2 vector2_2 = new Vector2((float) (index - 2), -4f); - vector2_2.X *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00499999988824129); - vector2_2.Y *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00499999988824129); - vector2_2.Normalize(); - vector2_2 *= (float) (4.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); - int damageForProjectiles = this.GetAttackDamage_ForProjectiles(9f, 9f); - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, vector2_2.X, vector2_2.Y, 174, damageForProjectiles, 0.0f, Main.myPlayer); - this.localAI[0] = 30f; - } - } - } - else if ((double) num3 < 200.0 && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height) && (double) this.velocity.Y == 0.0) - { - this.ai[0] = -40f; - if ((double) this.velocity.Y == 0.0) - this.velocity.X *= 0.9f; - if (Main.netMode != 1 && (double) this.localAI[0] == 0.0) - { - float num4 = Main.player[this.target].position.Y - vector2_1.Y - (float) Main.rand.Next(0, 200); - float num5 = 4.5f / (float) Math.Sqrt((double) num1 * (double) num1 + (double) num4 * (double) num4); - float SpeedX = num1 * num5; - float SpeedY = num4 * num5; - this.localAI[0] = 50f; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, 174, 9, 0.0f, Main.myPlayer); + Vector2 vector2_2 = new Vector2((float) (index - 2), -4f); + vector2_2.X *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00499999988824129); + vector2_2.Y *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00499999988824129); + vector2_2.Normalize(); + vector2_2 *= (float) (4.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, vector2_2.X, vector2_2.Y, 174, 9, 0.0f, Main.myPlayer); + this.localAI[0] = 30f; } } } - } - if (this.type == 535) - { - flag = true; - if ((double) this.localAI[0] > 0.0) - --this.localAI[0]; - if (!this.wet && !Main.player[this.target].npcTypeNoAggro[this.type]) + else if ((double) num3 < 200.0 && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height) && (double) this.velocity.Y == 0.0) { - Vector2 vector2_3 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); - float num6 = Main.player[this.target].position.X + (float) Main.player[this.target].width * 0.5f - vector2_3.X; - float num7 = Main.player[this.target].position.Y - vector2_3.Y; - float num8 = (float) Math.Sqrt((double) num6 * (double) num6 + (double) num7 * (double) num7); - if (Main.expertMode && (double) num8 < 120.0 && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height) && (double) this.velocity.Y == 0.0) + this.ai[0] = -40f; + if ((double) this.velocity.Y == 0.0) + this.velocity.X *= 0.9f; + if (Main.netMode != 1 && (double) this.localAI[0] == 0.0) { - this.ai[0] = -40f; - if ((double) this.velocity.Y == 0.0) - this.velocity.X *= 0.9f; - if (Main.netMode != 1 && (double) this.localAI[0] == 0.0) - { - for (int index = 0; index < 5; ++index) - { - Vector2 vector2_4 = new Vector2((float) (index - 2), -4f); - vector2_4.X *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00499999988824129); - vector2_4.Y *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00499999988824129); - vector2_4.Normalize(); - vector2_4 *= (float) (4.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); - int damageForProjectiles = this.GetAttackDamage_ForProjectiles(9f, 9f); - Projectile.NewProjectile(vector2_3.X, vector2_3.Y, vector2_4.X, vector2_4.Y, 605, damageForProjectiles, 0.0f, Main.myPlayer); - this.localAI[0] = 30f; - } - } - } - else if ((double) num8 < 200.0 && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height) && (double) this.velocity.Y == 0.0) - { - this.ai[0] = -40f; - if ((double) this.velocity.Y == 0.0) - this.velocity.X *= 0.9f; - if (Main.netMode != 1 && (double) this.localAI[0] == 0.0) - { - float num9 = Main.player[this.target].position.Y - vector2_3.Y - (float) Main.rand.Next(0, 200); - float num10 = 4.5f / (float) Math.Sqrt((double) num6 * (double) num6 + (double) num9 * (double) num9); - float SpeedX = num6 * num10; - float SpeedY = num9 * num10; - this.localAI[0] = 50f; - Projectile.NewProjectile(vector2_3.X, vector2_3.Y, SpeedX, SpeedY, 605, 9, 0.0f, Main.myPlayer); - } + float num4 = Main.player[this.target].position.Y - vector2_1.Y - (float) Main.rand.Next(0, 200); + float num5 = 4.5f / (float) Math.Sqrt((double) num1 * (double) num1 + (double) num4 * (double) num4); + float SpeedX = num1 * num5; + float SpeedY = num4 * num5; + this.localAI[0] = 50f; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, 174, 9, 0.0f, Main.myPlayer); } } } - if (this.type == 658) + } + if (this.type == 535) + { + flag = true; + if ((double) this.localAI[0] > 0.0) + --this.localAI[0]; + if (!this.wet && !Main.player[this.target].npcTypeNoAggro[this.type]) { - flag = true; - if ((double) this.localAI[0] > 0.0) - --this.localAI[0]; - if (!this.wet && Main.player[this.target].active && !Main.player[this.target].dead && !Main.player[this.target].npcTypeNoAggro[this.type]) + Vector2 vector2_3 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); + float num6 = Main.player[this.target].position.X + (float) Main.player[this.target].width * 0.5f - vector2_3.X; + float num7 = Main.player[this.target].position.Y - vector2_3.Y; + float num8 = (float) Math.Sqrt((double) num6 * (double) num6 + (double) num7 * (double) num7); + if (Main.expertMode && (double) num8 < 120.0 && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height) && (double) this.velocity.Y == 0.0) { - Player player = Main.player[this.target]; - Vector2 center = this.Center; - float num11 = player.Center.X - center.X; - float num12 = player.Center.Y - center.Y; - float num13 = (float) Math.Sqrt((double) num11 * (double) num11 + (double) num12 * (double) num12); - int num14 = NPC.CountNPCS(658); - if (Main.expertMode && num14 < 5 && (double) Math.Abs(num11) < 500.0 && (double) Math.Abs(num12) < 550.0 && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height) && (double) this.velocity.Y == 0.0) + this.ai[0] = -40f; + if ((double) this.velocity.Y == 0.0) + this.velocity.X *= 0.9f; + if (Main.netMode != 1 && (double) this.localAI[0] == 0.0) { - this.ai[0] = -40f; - if ((double) this.velocity.Y == 0.0) - this.velocity.X *= 0.9f; - if (Main.netMode != 1 && (double) this.localAI[0] == 0.0) + for (int index = 0; index < 5; ++index) { - for (int index = 0; index < 3; ++index) - { - Vector2 vector2 = new Vector2((float) (index - 1), -4f); - vector2.X *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00499999988824129); - vector2.Y *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00499999988824129); - vector2.Normalize(); - vector2 *= (float) (6.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); - if ((double) num13 > 350.0) - vector2 *= 2f; - else if ((double) num13 > 250.0) - vector2 *= 1.5f; - int projectilesMultiLerp = this.GetAttackDamage_ForProjectiles_MultiLerp(15f, 20f, 25f); - Projectile.NewProjectile(center.X, center.Y, vector2.X, vector2.Y, 920, projectilesMultiLerp, 0.0f, Main.myPlayer); - this.localAI[0] = 25f; - if (num14 > 4) - break; - } - } - } - else if ((double) Math.Abs(num11) < 500.0 && (double) Math.Abs(num12) < 550.0 && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height) && (double) this.velocity.Y == 0.0) - { - float num15 = num13; - this.ai[0] = -40f; - if ((double) this.velocity.Y == 0.0) - this.velocity.X *= 0.9f; - if (Main.netMode != 1 && (double) this.localAI[0] == 0.0) - { - float num16 = Main.player[this.target].position.Y - center.Y - (float) Main.rand.Next(0, 200); - float num17 = 4.5f / (float) Math.Sqrt((double) num11 * (double) num11 + (double) num16 * (double) num16) * 2f; - if ((double) num15 > 350.0) - num17 *= 2f; - else if ((double) num15 > 250.0) - num17 *= 1.5f; - float SpeedX = num11 * num17; - float SpeedY = num16 * num17; - this.localAI[0] = 50f; - int projectilesMultiLerp = this.GetAttackDamage_ForProjectiles_MultiLerp(15f, 20f, 25f); - Projectile.NewProjectile(center.X, center.Y, SpeedX, SpeedY, 920, projectilesMultiLerp, 0.0f, Main.myPlayer); + Vector2 vector2_4 = new Vector2((float) (index - 2), -4f); + vector2_4.X *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00499999988824129); + vector2_4.Y *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00499999988824129); + vector2_4.Normalize(); + vector2_4 *= (float) (4.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); + Projectile.NewProjectile(vector2_3.X, vector2_3.Y, vector2_4.X, vector2_4.Y, 605, 9, 0.0f, Main.myPlayer); + this.localAI[0] = 30f; } } } - } - if (this.type == 659) - { - flag = true; - if ((double) this.localAI[0] > 0.0) - --this.localAI[0]; - if (!this.wet && Main.player[this.target].active && !Main.player[this.target].dead && !Main.player[this.target].npcTypeNoAggro[this.type]) + else if ((double) num8 < 200.0 && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height) && (double) this.velocity.Y == 0.0) { - Player player = Main.player[this.target]; - Vector2 center = this.Center; - float num18 = player.Center.X - center.X; - float num19 = player.Center.Y - center.Y; - float num20 = (float) Math.Sqrt((double) num18 * (double) num18 + (double) num19 * (double) num19); - if ((double) Math.Abs(num18) < 500.0 && (double) Math.Abs(num19) < 550.0 && Collision.CanHit(this.position, this.width, this.height, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height) && (double) this.velocity.Y == 0.0) + this.ai[0] = -40f; + if ((double) this.velocity.Y == 0.0) + this.velocity.X *= 0.9f; + if (Main.netMode != 1 && (double) this.localAI[0] == 0.0) { - this.ai[0] = -40f; - if ((double) this.velocity.Y == 0.0) - this.velocity.X *= 0.9f; - if (Main.netMode != 1 && (double) this.localAI[0] == 0.0) - { - float num21 = Main.player[this.target].position.Y - center.Y - (float) Main.rand.Next(0, 200); - float num22 = 4.5f / (float) Math.Sqrt((double) num18 * (double) num18 + (double) num21 * (double) num21) * 2f; - if ((double) num20 > 350.0) - num22 *= 1.75f; - else if ((double) num20 > 250.0) - num22 *= 1.25f; - float SpeedX = num18 * num22; - float SpeedY = num21 * num22; - this.localAI[0] = 40f; - if (Main.expertMode) - this.localAI[0] = 30f; - int projectilesMultiLerp = this.GetAttackDamage_ForProjectiles_MultiLerp(15f, 20f, 25f); - Projectile.NewProjectile(center.X, center.Y, SpeedX, SpeedY, 921, projectilesMultiLerp, 0.0f, Main.myPlayer); - } + float num9 = Main.player[this.target].position.Y - vector2_3.Y - (float) Main.rand.Next(0, 200); + float num10 = 4.5f / (float) Math.Sqrt((double) num6 * (double) num6 + (double) num9 * (double) num9); + float SpeedX = num6 * num10; + float SpeedY = num9 * num10; + this.localAI[0] = 50f; + Projectile.NewProjectile(vector2_3.X, vector2_3.Y, SpeedX, SpeedY, 605, 9, 0.0f, Main.myPlayer); } } } - if (this.type == 204) + } + if (this.type == 204) + { + flag = true; + if ((double) this.localAI[0] > 0.0) + --this.localAI[0]; + if (!this.wet && !Main.player[this.target].npcTypeNoAggro[this.type]) { - flag = true; - if ((double) this.localAI[0] > 0.0) - --this.localAI[0]; - if (!this.wet && !Main.player[this.target].npcTypeNoAggro[this.type]) + Vector2 vector2_5 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); + float num11 = Main.player[this.target].position.X + (float) Main.player[this.target].width * 0.5f - vector2_5.X; + float num12 = Main.player[this.target].position.Y - vector2_5.Y; + float num13 = (float) Math.Sqrt((double) num11 * (double) num11 + (double) num12 * (double) num12); + if (Main.expertMode && (double) num13 < 200.0 && Collision.CanHit(new Vector2(this.position.X, this.position.Y - 20f), this.width, this.height + 20, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height) && (double) this.velocity.Y == 0.0) { - Vector2 vector2_5 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); - float num23 = Main.player[this.target].position.X + (float) Main.player[this.target].width * 0.5f - vector2_5.X; - float num24 = Main.player[this.target].position.Y - vector2_5.Y; - float num25 = (float) Math.Sqrt((double) num23 * (double) num23 + (double) num24 * (double) num24); - if (Main.expertMode && (double) num25 < 200.0 && Collision.CanHit(new Vector2(this.position.X, this.position.Y - 20f), this.width, this.height + 20, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height) && (double) this.velocity.Y == 0.0) + this.ai[0] = -40f; + if ((double) this.velocity.Y == 0.0) + this.velocity.X *= 0.9f; + if (Main.netMode != 1 && (double) this.localAI[0] == 0.0) { - this.ai[0] = -40f; - if ((double) this.velocity.Y == 0.0) - this.velocity.X *= 0.9f; - if (Main.netMode != 1 && (double) this.localAI[0] == 0.0) + for (int index = 0; index < 5; ++index) { - for (int index = 0; index < 5; ++index) - { - Vector2 vector2_6 = new Vector2((float) (index - 2), -2f); - vector2_6.X *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.0199999995529652); - vector2_6.Y *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.0199999995529652); - vector2_6.Normalize(); - vector2_6 *= (float) (3.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); - int damageForProjectiles = this.GetAttackDamage_ForProjectiles(13f, 13f); - Projectile.NewProjectile(vector2_5.X, vector2_5.Y, vector2_6.X, vector2_6.Y, 176, damageForProjectiles, 0.0f, Main.myPlayer); - this.localAI[0] = 80f; - } - } - } - if ((double) num25 < 400.0 && Collision.CanHit(new Vector2(this.position.X, this.position.Y - 20f), this.width, this.height + 20, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height) && (double) this.velocity.Y == 0.0) - { - this.ai[0] = -80f; - if ((double) this.velocity.Y == 0.0) - this.velocity.X *= 0.9f; - if (Main.netMode != 1 && (double) this.localAI[0] == 0.0) - { - float num26 = Main.player[this.target].position.Y - vector2_5.Y - (float) Main.rand.Next(-30, 20) - num25 * 0.05f; - float num27 = Main.player[this.target].position.X - vector2_5.X - (float) Main.rand.Next(-20, 20); - float num28 = 7f / (float) Math.Sqrt((double) num27 * (double) num27 + (double) num26 * (double) num26); - float SpeedX = num27 * num28; - float SpeedY = num26 * num28; - this.localAI[0] = 65f; - Projectile.NewProjectile(vector2_5.X, vector2_5.Y, SpeedX, SpeedY, 176, 13, 0.0f, Main.myPlayer); + Vector2 vector2_6 = new Vector2((float) (index - 2), -2f); + vector2_6.X *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.0199999995529652); + vector2_6.Y *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.0199999995529652); + vector2_6.Normalize(); + vector2_6 *= (float) (3.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); + Projectile.NewProjectile(vector2_5.X, vector2_5.Y, vector2_6.X, vector2_6.Y, 176, 13, 0.0f, Main.myPlayer); + this.localAI[0] = 80f; } } } + if ((double) num13 < 400.0 && Collision.CanHit(new Vector2(this.position.X, this.position.Y - 20f), this.width, this.height + 20, Main.player[this.target].position, Main.player[this.target].width, Main.player[this.target].height) && (double) this.velocity.Y == 0.0) + { + this.ai[0] = -80f; + if ((double) this.velocity.Y == 0.0) + this.velocity.X *= 0.9f; + if (Main.netMode != 1 && (double) this.localAI[0] == 0.0) + { + float num14 = Main.player[this.target].position.Y - vector2_5.Y - (float) Main.rand.Next(-30, 20) - num13 * 0.05f; + float num15 = Main.player[this.target].position.X - vector2_5.X - (float) Main.rand.Next(-20, 20); + float num16 = 7f / (float) Math.Sqrt((double) num15 * (double) num15 + (double) num14 * (double) num14); + float SpeedX = num15 * num16; + float SpeedY = num14 * num16; + this.localAI[0] = 65f; + Projectile.NewProjectile(vector2_5.X, vector2_5.Y, SpeedX, SpeedY, 176, 13, 0.0f, Main.myPlayer); + } + } } - if (this.type == 377 || this.type == 446) + } + if (this.type == 377 || this.type == 446) + { + if ((double) this.localAI[2] < 90.0) + ++this.localAI[2]; + else + this.friendly = false; + } + if (this.type == 59) + { + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 1f, 0.3f, 0.1f); + int index = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, Scale: 1.7f); + Main.dust[index].noGravity = true; + } + if ((double) this.ai[2] > 1.0) + --this.ai[2]; + if (this.wet) + { + if (this.collideY) + this.velocity.Y = -2f; + if ((double) this.velocity.Y < 0.0 && (double) this.ai[3] == (double) this.position.X) { - if ((double) this.localAI[2] < 90.0) - ++this.localAI[2]; - else - this.friendly = false; + this.direction *= -1; + this.ai[2] = 200f; } + if ((double) this.velocity.Y > 0.0) + this.ai[3] = this.position.X; if (this.type == 59) { - this.position = this.position + this.netOffset; - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), 1f, 0.3f, 0.1f); - int index = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, Scale: 1.7f); - Main.dust[index].noGravity = true; - this.position = this.position - this.netOffset; - } - if ((double) this.ai[2] > 1.0) - --this.ai[2]; - if (this.wet) - { - if (this.collideY) - this.velocity.Y = -2f; - if ((double) this.velocity.Y < 0.0 && (double) this.ai[3] == (double) this.position.X) - { - this.direction *= -1; - this.ai[2] = 200f; - } - if ((double) this.velocity.Y > 0.0) - this.ai[3] = this.position.X; - if (this.type == 59) - { - if ((double) this.velocity.Y > 2.0) - this.velocity.Y *= 0.9f; - else if (this.directionY < 0) - this.velocity.Y -= 0.8f; - this.velocity.Y -= 0.5f; - if ((double) this.velocity.Y < -10.0) - this.velocity.Y = -10f; - } - else - { - if ((double) this.velocity.Y > 2.0) - this.velocity.Y *= 0.9f; - this.velocity.Y -= 0.5f; - if ((double) this.velocity.Y < -4.0) - this.velocity.Y = -4f; - } - if ((double) this.ai[2] == 1.0 & flag) - this.TargetClosest(); - } - this.aiAction = 0; - if ((double) this.ai[2] == 0.0) - { - this.ai[0] = -100f; - this.ai[2] = 1f; - this.TargetClosest(); - } - if ((double) this.velocity.Y == 0.0) - { - if (this.collideY && (double) this.oldVelocity.Y != 0.0 && Collision.SolidCollision(this.position, this.width, this.height)) - this.position.X -= this.velocity.X + (float) this.direction; - if ((double) this.ai[3] == (double) this.position.X) - { - this.direction *= -1; - this.ai[2] = 200f; - } - this.ai[3] = 0.0f; - this.velocity.X *= 0.8f; - if ((double) this.velocity.X > -0.1 && (double) this.velocity.X < 0.1) - this.velocity.X = 0.0f; - if (flag) - ++this.ai[0]; - ++this.ai[0]; - if (this.type == 59) - this.ai[0] += 2f; - if (this.type == 71) - this.ai[0] += 3f; - if (this.type == 138) - this.ai[0] += 2f; - if (this.type == 183) - ++this.ai[0]; - if (this.type == 658) - this.ai[0] += 5f; - if (this.type == 659) - this.ai[0] += 3f; - if (this.type == 304) - this.ai[0] += (float) ((1 - this.life / this.lifeMax) * 10); - if (this.type == 377 || this.type == 446) - this.ai[0] += 3f; - if (this.type == 81) - { - if ((double) this.scale >= 0.0) - this.ai[0] += 4f; - else - ++this.ai[0]; - } - float num29 = -1000f; - if (this.type == 659) - num29 = -500f; - int num30 = 0; - if ((double) this.ai[0] >= 0.0) - num30 = 1; - if ((double) this.ai[0] >= (double) num29 && (double) this.ai[0] <= (double) num29 * 0.5) - num30 = 2; - if ((double) this.ai[0] >= (double) num29 * 2.0 && (double) this.ai[0] <= (double) num29 * 1.5) - num30 = 3; - if (num30 > 0) - { - this.netUpdate = true; - if (flag && (double) this.ai[2] == 1.0) - this.TargetClosest(); - if (num30 == 3) - { - this.velocity.Y = -8f; - if (this.type == 59) - this.velocity.Y -= 2f; - this.velocity.X += (float) (3 * this.direction); - if (this.type == 59) - this.velocity.X += 0.5f * (float) this.direction; - this.ai[0] = -200f; - this.ai[3] = this.position.X; - } - else - { - this.velocity.Y = -6f; - this.velocity.X += (float) (2 * this.direction); - if (this.type == 59) - this.velocity.X += (float) (2 * this.direction); - this.ai[0] = -120f; - if (num30 == 1) - this.ai[0] += num29; - else - this.ai[0] += num29 * 2f; - } - if (this.type == 659) - { - this.velocity.Y *= 1.6f; - this.velocity.X *= 1.2f; - } - if (this.type == 141) - { - this.velocity.Y *= 1.3f; - this.velocity.X *= 1.2f; - } - if (this.type != 377 && this.type != 446) - return; + if ((double) this.velocity.Y > 2.0) this.velocity.Y *= 0.9f; - this.velocity.X *= 0.6f; - if (flag) - { - this.direction = -this.direction; - this.velocity.X *= -1f; - } - if (!WorldGen.SolidTile((int) ((double) this.Center.X / 16.0), (int) ((double) this.Center.Y / 16.0) - 1) || -(double) this.velocity.Y + (double) this.height <= 16.0) - return; - this.velocity.Y = (float) -(16 - this.height); - } - else - { - if ((double) this.ai[0] < -30.0) - return; - this.aiAction = 1; - } + else if (this.directionY < 0) + this.velocity.Y -= 0.8f; + this.velocity.Y -= 0.5f; + if ((double) this.velocity.Y < -10.0) + this.velocity.Y = -10f; } else { - if (this.target >= (int) byte.MaxValue || (this.direction != 1 || (double) this.velocity.X >= 3.0) && (this.direction != -1 || (double) this.velocity.X <= -3.0)) - return; - if (this.collideX && (double) Math.Abs(this.velocity.X) == 0.200000002980232) - this.position.X -= 1.4f * (float) this.direction; - if (this.collideY && (double) this.oldVelocity.Y != 0.0 && Collision.SolidCollision(this.position, this.width, this.height)) - this.position.X -= this.velocity.X + (float) this.direction; - if (this.direction == -1 && (double) this.velocity.X < 0.01 || this.direction == 1 && (double) this.velocity.X > -0.01) - this.velocity.X += 0.2f * (float) this.direction; - else - this.velocity.X *= 0.93f; + if ((double) this.velocity.Y > 2.0) + this.velocity.Y *= 0.9f; + this.velocity.Y -= 0.5f; + if ((double) this.velocity.Y < -4.0) + this.velocity.Y = -4f; } + if ((double) this.ai[2] == 1.0 & flag) + this.TargetClosest(); } - } - - public void AI_001_SetRainbowSlimeColor() - { - this.color.R = (byte) Main.DiscoR; - this.color.G = (byte) Main.DiscoG; - this.color.B = (byte) Main.DiscoB; - this.color.A = (byte) 100; - this.alpha = 175; - } - - private static int AI_001_Slimes_GenerateItemInsideBody(bool isBallooned) - { - int num1 = Main.rand.Next(4); - int num2; - if (isBallooned) + this.aiAction = 0; + if ((double) this.ai[2] == 0.0) { - switch (Main.rand.Next(13)) + this.ai[0] = -100f; + this.ai[2] = 1f; + this.TargetClosest(); + } + if ((double) this.velocity.Y == 0.0) + { + if (this.collideY && (double) this.oldVelocity.Y != 0.0 && Collision.SolidCollision(this.position, this.width, this.height)) + this.position.X -= this.velocity.X + (float) this.direction; + if ((double) this.ai[3] == (double) this.position.X) { - case 1: - num2 = 4368; - break; - case 2: - num2 = 4369; - break; - case 3: - num2 = 4370; - break; - case 4: - num2 = 4371; - break; - case 5: - num2 = 4612; - break; - case 6: - num2 = 4674; - break; - case 7: - case 8: - case 9: - num2 = 4343; - break; - case 10: - case 11: - case 12: - num2 = 4344; - break; - default: - num2 = 4367; - break; + this.direction *= -1; + this.ai[2] = 200f; + } + this.ai[3] = 0.0f; + this.velocity.X *= 0.8f; + if ((double) this.velocity.X > -0.1 && (double) this.velocity.X < 0.1) + this.velocity.X = 0.0f; + if (flag) + ++this.ai[0]; + ++this.ai[0]; + if (this.type == 59) + this.ai[0] += 2f; + if (this.type == 71) + this.ai[0] += 3f; + if (this.type == 138) + this.ai[0] += 2f; + if (this.type == 183) + ++this.ai[0]; + if (this.type == 304) + this.ai[0] += (float) ((1 - this.life / this.lifeMax) * 10); + if (this.type == 377 || this.type == 446) + this.ai[0] += 3f; + if (this.type == 81) + { + if ((double) this.scale >= 0.0) + this.ai[0] += 4f; + else + ++this.ai[0]; + } + int num = 0; + if ((double) this.ai[0] >= 0.0) + num = 1; + if ((double) this.ai[0] >= -1000.0 && (double) this.ai[0] <= -500.0) + num = 2; + if ((double) this.ai[0] >= -2000.0 && (double) this.ai[0] <= -1500.0) + num = 3; + if (num > 0) + { + this.netUpdate = true; + if (flag && (double) this.ai[2] == 1.0) + this.TargetClosest(); + if (num == 3) + { + this.velocity.Y = -8f; + if (this.type == 59) + this.velocity.Y -= 2f; + this.velocity.X += (float) (3 * this.direction); + if (this.type == 59) + this.velocity.X += 0.5f * (float) this.direction; + this.ai[0] = -200f; + this.ai[3] = this.position.X; + } + else + { + this.velocity.Y = -6f; + this.velocity.X += (float) (2 * this.direction); + if (this.type == 59) + this.velocity.X += (float) (2 * this.direction); + this.ai[0] = -120f; + if (num == 1) + this.ai[0] -= 1000f; + else + this.ai[0] -= 2000f; + } + if (this.type == 141) + { + this.velocity.Y *= 1.3f; + this.velocity.X *= 1.2f; + } + if (this.type != 377 && this.type != 446) + return; + this.velocity.Y *= 0.9f; + this.velocity.X *= 0.6f; + if (!flag) + return; + this.direction = -this.direction; + this.velocity.X *= -1f; + } + else + { + if ((double) this.ai[0] < -30.0) + return; + this.aiAction = 1; } } else { - switch (num1) - { - case 0: - switch (Main.rand.Next(7)) - { - case 0: - num2 = 290; - break; - case 1: - num2 = 292; - break; - case 2: - num2 = 296; - break; - case 3: - num2 = 2322; - break; - default: - num2 = Main.netMode == 0 || Main.rand.Next(2) != 0 ? 2350 : 2997; - break; - } - break; - case 1: - switch (Main.rand.Next(4)) - { - case 0: - num2 = 8; - break; - case 1: - num2 = 166; - break; - case 2: - num2 = 965; - break; - default: - num2 = 58; - break; - } - break; - case 2: - num2 = Main.rand.Next(2) != 0 ? Main.rand.Next(699, 703) : Main.rand.Next(11, 15); - break; - default: - switch (Main.rand.Next(3)) - { - case 0: - num2 = 71; - break; - case 1: - num2 = 72; - break; - default: - num2 = 73; - break; - } - break; - } + if (this.target >= (int) byte.MaxValue || (this.direction != 1 || (double) this.velocity.X >= 3.0) && (this.direction != -1 || (double) this.velocity.X <= -3.0)) + return; + if (this.collideX && (double) Math.Abs(this.velocity.X) == 0.200000002980232) + this.position.X -= 1.4f * (float) this.direction; + if (this.collideY && (double) this.oldVelocity.Y != 0.0 && Collision.SolidCollision(this.position, this.width, this.height)) + this.position.X -= this.velocity.X + (float) this.direction; + if (this.direction == -1 && (double) this.velocity.X < 0.01 || this.direction == 1 && (double) this.velocity.X > -0.01) + this.velocity.X += 0.2f * (float) this.direction; + else + this.velocity.X *= 0.93f; } - return num2; } private void AI_110_Betsy() @@ -25405,7 +19391,7 @@ label_422: else if ((double) this.ai[0] == 2.0) { if ((double) this.ai[1] == 0.0) - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_BetsyWindAttack, this.Center); + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_BetsyWindAttack, this.Center); if ((double) ++this.ai[1] >= (double) num6) { this.ai[0] = 1f; @@ -25415,7 +19401,7 @@ label_422: } else if ((double) this.ai[0] == 3.0) { - ActiveSound activeSound = SoundEngine.GetActiveSound(SlotId.FromFloat(this.localAI[2])); + ActiveSound activeSound = Main.GetActiveSound(SlotId.FromFloat(this.localAI[2])); if (activeSound != null) activeSound.Position = this.Center; ++this.ai[1]; @@ -25441,7 +19427,7 @@ label_422: if (Main.netMode != 1) Projectile.NewProjectile(this.Center, this.velocity, 687, Damage1, 0.0f, Main.myPlayer, ai1: ((float) this.whoAmI)); float[] localAi = this.localAI; - SlotId slotId = SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_BetsyFlameBreath, this.Center); + SlotId slotId = Main.PlayTrackedSound((SoundStyle) SoundID.DD2_BetsyFlameBreath, this.Center); double num31 = (double) ((SlotId) ref slotId).ToFloat(); localAi[2] = (float) num31; } @@ -25511,7 +19497,7 @@ label_422: this.rotation -= num22 * (float) this.direction; num2 *= 0.7f; if ((double) this.ai[1] == 1.0) - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_BetsyFlyingCircleAttack, this.Center); + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_BetsyFlyingCircleAttack, this.Center); if ((double) ++this.ai[1] >= (double) num21) { this.ai[0] = 1f; @@ -25536,7 +19522,7 @@ label_422: else { if ((double) this.ai[1] == 1.0) - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_BetsyScream); + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_BetsyScream); if ((double) this.ai[1] < (double) num26) this.velocity = this.velocity * 0.95f; else @@ -25602,7 +19588,7 @@ label_422: { Point point = vector2.ToPoint(); NPC.NewNPC(point.X, point.Y, 560, this.whoAmI); - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_BetsySummon, vector2); + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_BetsySummon, vector2); } } List npcList = new List(); @@ -25619,7 +19605,7 @@ label_422: NPC npc = npcList[Main.rand.Next(npcList.Count)]; Point point = npc.Center.ToPoint(); NPC.NewNPC(point.X, point.Y, 560); - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_BetsySummon, npc.Center); + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_BetsySummon, npc.Center); } } } @@ -25682,7 +19668,7 @@ label_422: targetAngle += 3.141593f; if ((double) maxChange != 0.0) this.rotation = this.rotation.AngleTowards(targetAngle, maxChange); - if (SoundEngine.GetActiveSound(SlotId.FromFloat(this.localAI[2])) != null) + if (Main.GetActiveSound(SlotId.FromFloat(this.localAI[2])) != null) return; float[] localAi1 = this.localAI; SlotId invalid = (SlotId) SlotId.Invalid; @@ -25723,32 +19709,6 @@ label_422: if (flag4) this.velocity.Y = 0.0f; } - if (this.type == 315) - { - Lighting.AddLight(this.Center, 0.4f, 0.36f, 0.2f); - int num3 = this.frame.Height; - if (num3 < 1) - num3 = 1; - switch (this.frame.Y / num3) - { - case 4: - case 5: - case 6: - case 7: - Vector2 vector2_1 = this.Bottom + new Vector2(-30f, -8f); - Vector2 vector2_2 = new Vector2(60f, 8f); - if (Main.rand.Next(3) != 0) - { - Dust dust = Dust.NewDustPerfect(vector2_1 + new Vector2(Main.rand.NextFloat() * vector2_2.X, Main.rand.NextFloat() * vector2_2.Y), 6, new Vector2?(this.velocity)); - dust.scale = 0.6f; - dust.fadeIn = 1.1f; - dust.noGravity = true; - dust.noLight = true; - break; - } - break; - } - } if ((((double) this.position.X == (double) this.oldPosition.X ? 1 : ((double) this.ai[3] >= (double) num1 ? 1 : 0)) | (flag2 ? 1 : 0)) != 0) { ++this.ai[3]; @@ -25762,11 +19722,11 @@ label_422: this.ai[3] = 0.0f; if ((double) this.ai[3] == (double) num1) this.netUpdate = true; - Vector2 vector2_3 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); - double num4 = (double) Main.player[this.target].position.X + (double) Main.player[this.target].width * 0.5 - (double) vector2_3.X; - float num5 = Main.player[this.target].position.Y - vector2_3.Y; - float num6 = (float) Math.Sqrt(num4 * num4 + (double) num5 * (double) num5); - if ((double) num6 < 200.0 && !flag3) + Vector2 vector2_1 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); + double num3 = (double) Main.player[this.target].position.X + (double) Main.player[this.target].width * 0.5 - (double) vector2_1.X; + float num4 = Main.player[this.target].position.Y - vector2_1.Y; + float num5 = (float) Math.Sqrt(num3 * num3 + (double) num4 * (double) num4); + if ((double) num5 < 200.0 && !flag3) this.ai[3] = 0.0f; if (this.type == 410) { @@ -25802,10 +19762,10 @@ label_422: { Vector2 Position = this.Center + Vector2.UnitX * (float) this.spriteDirection * -20f; Dust dust = Main.dust[Dust.NewDust(Position, 0, 0, 242)]; - Vector2 vector2_4 = Vector2.UnitY.RotatedByRandom(6.28318548202515); - dust.position = Position + vector2_4 * 20f; - dust.velocity = -vector2_4 * 2f; - dust.scale = (float) (0.5 + (double) vector2_4.X * (double) -this.spriteDirection); + Vector2 vector2_2 = Vector2.UnitY.RotatedByRandom(6.28318548202515); + dust.position = Position + vector2_2 * 20f; + dust.velocity = -vector2_2 * 2f; + dust.scale = (float) (0.5 + (double) vector2_2.X * (double) -this.spriteDirection); dust.fadeIn = 1f; dust.noGravity = true; } @@ -25815,10 +19775,10 @@ label_422: { Vector2 Position = this.Center + Vector2.UnitX * (float) this.spriteDirection * -20f; Dust dust = Main.dust[Dust.NewDust(Position, 0, 0, 242)]; - Vector2 vector2_5 = Vector2.UnitY.RotatedByRandom(6.28318548202515); - dust.position = Position + vector2_5 * 4f; - dust.velocity = vector2_5 * 4f + Vector2.UnitX * Main.rand.NextFloat() * (float) this.spriteDirection * -5f; - dust.scale = (float) (0.5 + (double) vector2_5.X * (double) -this.spriteDirection); + Vector2 vector2_3 = Vector2.UnitY.RotatedByRandom(6.28318548202515); + dust.position = Position + vector2_3 * 4f; + dust.velocity = vector2_3 * 4f + Vector2.UnitX * Main.rand.NextFloat() * (float) this.spriteDirection * -5f; + dust.scale = (float) (0.5 + (double) vector2_3.X * (double) -this.spriteDirection); dust.fadeIn = 1f; dust.noGravity = true; } @@ -25826,7 +19786,7 @@ label_422: if ((double) this.velocity.X > -0.5 && (double) this.velocity.X < 0.5) this.velocity.X = 0.0f; if ((double) this.ai[1] == 30.0 && Main.netMode != 1) - Projectile.NewProjectile(this.Center.X + (float) (this.spriteDirection * -20), this.Center.Y, (float) (this.spriteDirection * -7), 0.0f, 575, this.GetAttackDamage_ForProjectiles(50f, 35f), 0.0f, Main.myPlayer, (float) this.target); + Projectile.NewProjectile(this.Center.X + (float) (this.spriteDirection * -20), this.Center.Y, (float) (this.spriteDirection * -7), 0.0f, 575, Main.expertMode ? 35 : 50, 0.0f, Main.myPlayer, (float) this.target); if ((double) this.ai[1] >= 60.0) { this.ai[1] = (float) -Main.rand.Next(320, 601); @@ -25836,42 +19796,34 @@ label_422: else { ++this.ai[1]; - if ((double) this.ai[1] >= 180.0 && (double) num6 < 500.0 && (double) this.velocity.Y == 0.0) + if ((double) this.ai[1] >= 180.0 && (double) num5 < 500.0 && (double) this.velocity.Y == 0.0) { flag1 = true; this.ai[1] = 0.0f; this.ai[2] = 1f; this.netUpdate = true; } - else if ((double) this.velocity.Y == 0.0 && (double) num6 < 100.0 && (double) Math.Abs(this.velocity.X) > 3.0 && ((double) this.Center.X < (double) Main.player[this.target].Center.X && (double) this.velocity.X > 0.0 || (double) this.Center.X > (double) Main.player[this.target].Center.X && (double) this.velocity.X < 0.0)) + else if ((double) this.velocity.Y == 0.0 && (double) num5 < 100.0 && (double) Math.Abs(this.velocity.X) > 3.0 && ((double) this.Center.X < (double) Main.player[this.target].Center.X && (double) this.velocity.X > 0.0 || (double) this.Center.X > (double) Main.player[this.target].Center.X && (double) this.velocity.X < 0.0)) this.velocity.Y -= 4f; } } else if (this.type == 155 || this.type == 329) { - if ((double) this.velocity.Y == 0.0 && (double) num6 < 100.0 && (double) Math.Abs(this.velocity.X) > 3.0 && ((double) this.position.X + (double) (this.width / 2) < (double) Main.player[this.target].position.X + (double) (Main.player[this.target].width / 2) && (double) this.velocity.X > 0.0 || (double) this.position.X + (double) (this.width / 2) > (double) Main.player[this.target].position.X + (double) (Main.player[this.target].width / 2) && (double) this.velocity.X < 0.0)) + if ((double) this.velocity.Y == 0.0 && (double) num5 < 100.0 && (double) Math.Abs(this.velocity.X) > 3.0 && ((double) this.position.X + (double) (this.width / 2) < (double) Main.player[this.target].position.X + (double) (Main.player[this.target].width / 2) && (double) this.velocity.X > 0.0 || (double) this.position.X + (double) (this.width / 2) > (double) Main.player[this.target].position.X + (double) (Main.player[this.target].width / 2) && (double) this.velocity.X < 0.0)) this.velocity.Y -= 4f; } else if (this.type == 546 && (double) this.velocity.Y == 0.0 && (double) Math.Abs(this.velocity.X) > 3.0 && ((double) this.Center.X < (double) Main.player[this.target].Center.X && (double) this.velocity.X > 0.0 || (double) this.Center.X > (double) Main.player[this.target].Center.X && (double) this.velocity.X < 0.0)) { this.velocity.Y -= 4f; - SoundEngine.PlaySound(3, this.Center, 11); - } - if (this.type == 546 && !Main.player[this.target].ZoneDesert) - { - int direction = this.direction; - this.TargetClosest(); - if (!Main.player[this.target].ZoneDesert) - { - this.EncourageDespawn(10); - this.ai[3] = (float) num1; - this.direction = direction; - } + Main.PlaySound(3, this.Center, 11); } if ((double) this.ai[3] < (double) num1) { if ((this.type == 329 || this.type == 315) && !Main.pumpkinMoon) - this.EncourageDespawn(10); + { + if (this.timeLeft > 10) + this.timeLeft = 10; + } else this.TargetClosest(); } @@ -25896,8 +19848,8 @@ label_422: if (this.direction == 0) this.direction = 1; } - float num7 = 6f; - float num8 = 0.07f; + float num6 = 6f; + float num7 = 0.07f; if (!flag1 && ((double) this.velocity.Y == 0.0 || this.wet || (double) this.velocity.X <= 0.0 && this.direction < 0 || (double) this.velocity.X >= 0.0 && this.direction > 0)) { if (this.type == 155) @@ -25924,76 +19876,76 @@ label_422: this.velocity.X *= 0.95f; if ((double) this.velocity.X < 0.0 && this.direction > 0) this.velocity.X *= 0.95f; - if ((double) this.velocity.X < -(double) num7 || (double) this.velocity.X > (double) num7) + if ((double) this.velocity.X < -(double) num6 || (double) this.velocity.X > (double) num6) { if ((double) this.velocity.Y == 0.0) this.velocity = this.velocity * 0.8f; } - else if ((double) this.velocity.X < (double) num7 && this.direction == 1) + else if ((double) this.velocity.X < (double) num6 && this.direction == 1) { this.velocity.X += 0.07f; - if ((double) this.velocity.X > (double) num7) - this.velocity.X = num7; + if ((double) this.velocity.X > (double) num6) + this.velocity.X = num6; } - else if ((double) this.velocity.X > -(double) num7 && this.direction == -1) + else if ((double) this.velocity.X > -(double) num6 && this.direction == -1) { this.velocity.X -= 0.07f; - if ((double) this.velocity.X < -(double) num7) - this.velocity.X = -num7; + if ((double) this.velocity.X < -(double) num6) + this.velocity.X = -num6; } } else if (this.type == 410) { if (Math.Sign(this.velocity.X) != this.direction) this.velocity.X *= 0.9f; - num7 = 6f; - num8 = 0.2f; + num6 = 6f; + num7 = 0.2f; } else if (this.type == 423) { if (Math.Sign(this.velocity.X) != this.direction) this.velocity.X *= 0.85f; - num7 = 10f; - num8 = 0.2f; + num6 = 10f; + num7 = 0.2f; } else if (this.type == 546) { if (Math.Sign(this.velocity.X) != this.direction) this.velocity.X *= 0.92f; - float num9 = MathHelper.Lerp(0.6f, 1f, Math.Abs(Main.windSpeedTarget)) * (float) Math.Sign(Main.windSpeedTarget); + float num8 = MathHelper.Lerp(0.6f, 1f, Math.Abs(Main.windSpeedSet)) * (float) Math.Sign(Main.windSpeedSet); if (!Main.player[this.target].ZoneSandstorm) - num9 = 0.0f; - num7 = (float) (4.0 + (double) num9 * (double) this.direction * 3.0); - num8 = 0.05f; + num8 = 0.0f; + num6 = (float) (5.0 + (double) num8 * (double) this.direction * 4.0); + num7 = 0.2f; } - if ((double) this.velocity.X < -(double) num7 || (double) this.velocity.X > (double) num7) + if ((double) this.velocity.X < -(double) num6 || (double) this.velocity.X > (double) num6) { if ((double) this.velocity.Y == 0.0) this.velocity = this.velocity * 0.8f; } - else if ((double) this.velocity.X < (double) num7 && this.direction == 1) + else if ((double) this.velocity.X < (double) num6 && this.direction == 1) { - this.velocity.X += num8; - if ((double) this.velocity.X > (double) num7) - this.velocity.X = num7; + this.velocity.X += num7; + if ((double) this.velocity.X > (double) num6) + this.velocity.X = num6; } - else if ((double) this.velocity.X > -(double) num7 && this.direction == -1) + else if ((double) this.velocity.X > -(double) num6 && this.direction == -1) { - this.velocity.X -= num8; - if ((double) this.velocity.X < -(double) num7) - this.velocity.X = -num7; + this.velocity.X -= num7; + if ((double) this.velocity.X < -(double) num6) + this.velocity.X = -num6; } } if ((double) this.velocity.Y >= 0.0) { - int num10 = 0; + int num9 = 0; if ((double) this.velocity.X < 0.0) - num10 = -1; + num9 = -1; if ((double) this.velocity.X > 0.0) - num10 = 1; + num9 = 1; Vector2 position = this.position; position.X += this.velocity.X; - int index1 = (int) (((double) position.X + (double) (this.width / 2) + (double) ((this.width / 2 + 1) * num10)) / 16.0); + int index1 = (int) (((double) position.X + (double) (this.width / 2) + (double) ((this.width / 2 + 1) * num9)) / 16.0); int index2 = (int) (((double) position.Y + (double) this.height - 1.0) / 16.0); if (Main.tile[index1, index2] == null) Main.tile[index1, index2] = new Tile(); @@ -26005,100 +19957,83 @@ label_422: Main.tile[index1, index2 - 3] = new Tile(); if (Main.tile[index1, index2 + 1] == null) Main.tile[index1, index2 + 1] = new Tile(); - if ((double) (index1 * 16) < (double) position.X + (double) this.width && (double) (index1 * 16 + 16) > (double) position.X && (Main.tile[index1, index2].nactive() && !Main.tile[index1, index2].topSlope() && !Main.tile[index1, index2 - 1].topSlope() && Main.tileSolid[(int) Main.tile[index1, index2].type] && !Main.tileSolidTop[(int) Main.tile[index1, index2].type] || Main.tile[index1, index2 - 1].halfBrick() && Main.tile[index1, index2 - 1].nactive()) && (!Main.tile[index1, index2 - 1].nactive() || !Main.tileSolid[(int) Main.tile[index1, index2 - 1].type] || Main.tileSolidTop[(int) Main.tile[index1, index2 - 1].type] || Main.tile[index1, index2 - 1].halfBrick() && (!Main.tile[index1, index2 - 4].nactive() || !Main.tileSolid[(int) Main.tile[index1, index2 - 4].type] || Main.tileSolidTop[(int) Main.tile[index1, index2 - 4].type])) && (!Main.tile[index1, index2 - 2].nactive() || !Main.tileSolid[(int) Main.tile[index1, index2 - 2].type] || Main.tileSolidTop[(int) Main.tile[index1, index2 - 2].type]) && (!Main.tile[index1, index2 - 3].nactive() || !Main.tileSolid[(int) Main.tile[index1, index2 - 3].type] || Main.tileSolidTop[(int) Main.tile[index1, index2 - 3].type]) && (!Main.tile[index1 - num10, index2 - 3].nactive() || !Main.tileSolid[(int) Main.tile[index1 - num10, index2 - 3].type])) + if ((double) (index1 * 16) < (double) position.X + (double) this.width && (double) (index1 * 16 + 16) > (double) position.X && (Main.tile[index1, index2].nactive() && !Main.tile[index1, index2].topSlope() && !Main.tile[index1, index2 - 1].topSlope() && Main.tileSolid[(int) Main.tile[index1, index2].type] && !Main.tileSolidTop[(int) Main.tile[index1, index2].type] || Main.tile[index1, index2 - 1].halfBrick() && Main.tile[index1, index2 - 1].nactive()) && (!Main.tile[index1, index2 - 1].nactive() || !Main.tileSolid[(int) Main.tile[index1, index2 - 1].type] || Main.tileSolidTop[(int) Main.tile[index1, index2 - 1].type] || Main.tile[index1, index2 - 1].halfBrick() && (!Main.tile[index1, index2 - 4].nactive() || !Main.tileSolid[(int) Main.tile[index1, index2 - 4].type] || Main.tileSolidTop[(int) Main.tile[index1, index2 - 4].type])) && (!Main.tile[index1, index2 - 2].nactive() || !Main.tileSolid[(int) Main.tile[index1, index2 - 2].type] || Main.tileSolidTop[(int) Main.tile[index1, index2 - 2].type]) && (!Main.tile[index1, index2 - 3].nactive() || !Main.tileSolid[(int) Main.tile[index1, index2 - 3].type] || Main.tileSolidTop[(int) Main.tile[index1, index2 - 3].type]) && (!Main.tile[index1 - num9, index2 - 3].nactive() || !Main.tileSolid[(int) Main.tile[index1 - num9, index2 - 3].type])) { - float num11 = (float) (index2 * 16); + float num10 = (float) (index2 * 16); if (Main.tile[index1, index2].halfBrick()) - num11 += 8f; + num10 += 8f; if (Main.tile[index1, index2 - 1].halfBrick()) - num11 -= 8f; - if ((double) num11 < (double) position.Y + (double) this.height) + num10 -= 8f; + if ((double) num10 < (double) position.Y + (double) this.height) { - float num12 = position.Y + (float) this.height - num11; - if ((double) num12 <= 16.1) + float num11 = position.Y + (float) this.height - num10; + if ((double) num11 <= 16.1) { - this.gfxOffY += this.position.Y + (float) this.height - num11; - this.position.Y = num11 - (float) this.height; - this.stepSpeed = (double) num12 >= 9.0 ? 2f : 1f; + this.gfxOffY += this.position.Y + (float) this.height - num10; + this.position.Y = num10 - (float) this.height; + this.stepSpeed = (double) num11 >= 9.0 ? 2f : 1f; } } } } if ((double) this.velocity.Y == 0.0) { - bool flag6 = true; - int index3 = (int) ((double) this.position.Y - 7.0) / 16; - int num13 = (int) ((double) this.position.X - 7.0) / 16; - int num14 = (int) ((double) this.position.X + (double) this.width + 7.0) / 16; - for (int index4 = num13; index4 <= num14; ++index4) + int index3 = (int) (((double) this.position.X + (double) (this.width / 2) + (double) ((this.width / 2 + 2) * this.direction) + (double) this.velocity.X * 5.0) / 16.0); + int index4 = (int) (((double) this.position.Y + (double) this.height - 15.0) / 16.0); + if (Main.tile[index3, index4] == null) + Main.tile[index3, index4] = new Tile(); + if (Main.tile[index3, index4 - 1] == null) + Main.tile[index3, index4 - 1] = new Tile(); + if (Main.tile[index3, index4 - 2] == null) + Main.tile[index3, index4 - 2] = new Tile(); + if (Main.tile[index3, index4 - 3] == null) + Main.tile[index3, index4 - 3] = new Tile(); + if (Main.tile[index3, index4 + 1] == null) + Main.tile[index3, index4 + 1] = new Tile(); + if (Main.tile[index3 + this.direction, index4 - 1] == null) + Main.tile[index3 + this.direction, index4 - 1] = new Tile(); + if (Main.tile[index3 + this.direction, index4 + 1] == null) + Main.tile[index3 + this.direction, index4 + 1] = new Tile(); + if (Main.tile[index3 - this.direction, index4 + 1] == null) + Main.tile[index3 - this.direction, index4 + 1] = new Tile(); + int spriteDirection = this.spriteDirection; + if (this.type == 423 || this.type == 410 || this.type == 546) + spriteDirection *= -1; + if ((double) this.velocity.X < 0.0 && spriteDirection == -1 || (double) this.velocity.X > 0.0 && spriteDirection == 1) { - if (Main.tile[index4, index3] != null && Main.tile[index4, index3].nactive() && Main.tileSolid[(int) Main.tile[index4, index3].type]) + bool flag6 = this.type == 410 || this.type == 423; + float num12 = 3f; + if (Main.tile[index3, index4 - 2].nactive() && Main.tileSolid[(int) Main.tile[index3, index4 - 2].type]) { - flag6 = false; - break; + if (Main.tile[index3, index4 - 3].nactive() && Main.tileSolid[(int) Main.tile[index3, index4 - 3].type]) + { + this.velocity.Y = -8.5f; + this.netUpdate = true; + } + else + { + this.velocity.Y = -7.5f; + this.netUpdate = true; + } } - } - if (flag6) - { - int index5 = (int) (((double) this.position.X + (double) (this.width / 2) + (double) ((this.width / 2 + 2) * this.direction) + (double) this.velocity.X * 5.0) / 16.0); - int index6 = (int) (((double) this.position.Y + (double) this.height - 15.0) / 16.0); - if (Main.tile[index5, index6] == null) - Main.tile[index5, index6] = new Tile(); - if (Main.tile[index5, index6 - 1] == null) - Main.tile[index5, index6 - 1] = new Tile(); - if (Main.tile[index5, index6 - 2] == null) - Main.tile[index5, index6 - 2] = new Tile(); - if (Main.tile[index5, index6 - 3] == null) - Main.tile[index5, index6 - 3] = new Tile(); - if (Main.tile[index5, index6 + 1] == null) - Main.tile[index5, index6 + 1] = new Tile(); - if (Main.tile[index5 + this.direction, index6 - 1] == null) - Main.tile[index5 + this.direction, index6 - 1] = new Tile(); - if (Main.tile[index5 + this.direction, index6 + 1] == null) - Main.tile[index5 + this.direction, index6 + 1] = new Tile(); - if (Main.tile[index5 - this.direction, index6 + 1] == null) - Main.tile[index5 - this.direction, index6 + 1] = new Tile(); - if (Main.tile[index5 + this.direction, index6 + 3] == null) - Main.tile[index5 + this.direction, index6 + 3] = new Tile(); - int spriteDirection = this.spriteDirection; - if (this.type == 423 || this.type == 410 || this.type == 546) - spriteDirection *= -1; - if ((double) this.velocity.X < 0.0 && spriteDirection == -1 || (double) this.velocity.X > 0.0 && spriteDirection == 1) + else if (Main.tile[index3, index4 - 1].nactive() && !Main.tile[index3, index4 - 1].topSlope() && Main.tileSolid[(int) Main.tile[index3, index4 - 1].type]) { - bool flag7 = this.type == 410 || this.type == 423; - float num15 = 3f; - if (Main.tile[index5, index6 - 2].nactive() && Main.tileSolid[(int) Main.tile[index5, index6 - 2].type]) - { - if (Main.tile[index5, index6 - 3].nactive() && Main.tileSolid[(int) Main.tile[index5, index6 - 3].type]) - { - this.velocity.Y = -8.5f; - this.netUpdate = true; - } - else - { - this.velocity.Y = -7.5f; - this.netUpdate = true; - } - } - else if (Main.tile[index5, index6 - 1].nactive() && !Main.tile[index5, index6 - 1].topSlope() && Main.tileSolid[(int) Main.tile[index5, index6 - 1].type]) - { - this.velocity.Y = -7f; - this.netUpdate = true; - } - else if ((double) this.position.Y + (double) this.height - (double) (index6 * 16) > 20.0 && Main.tile[index5, index6].nactive() && !Main.tile[index5, index6].topSlope() && Main.tileSolid[(int) Main.tile[index5, index6].type]) - { - this.velocity.Y = -6f; - this.netUpdate = true; - } - else if ((this.directionY < 0 || (double) Math.Abs(this.velocity.X) > (double) num15) && (!flag7 || !Main.tile[index5, index6 + 1].nactive() || !Main.tileSolid[(int) Main.tile[index5, index6 + 1].type]) && (!Main.tile[index5, index6 + 2].nactive() || !Main.tileSolid[(int) Main.tile[index5, index6 + 2].type]) && (!Main.tile[index5 + this.direction, index6 + 3].nactive() || !Main.tileSolid[(int) Main.tile[index5 + this.direction, index6 + 3].type])) - { - this.velocity.Y = -8f; - this.netUpdate = true; - } + this.velocity.Y = -7f; + this.netUpdate = true; + } + else if ((double) this.position.Y + (double) this.height - (double) (index4 * 16) > 20.0 && Main.tile[index3, index4].nactive() && !Main.tile[index3, index4].topSlope() && Main.tileSolid[(int) Main.tile[index3, index4].type]) + { + this.velocity.Y = -6f; + this.netUpdate = true; + } + else if ((this.directionY < 0 || (double) Math.Abs(this.velocity.X) > (double) num12) && (!flag6 || !Main.tile[index3, index4 + 1].nactive() || !Main.tileSolid[(int) Main.tile[index3, index4 + 1].type]) && (!Main.tile[index3, index4 + 2].nactive() || !Main.tileSolid[(int) Main.tile[index3, index4 + 2].type]) && (!Main.tile[index3 + this.direction, index4 + 3].nactive() || !Main.tileSolid[(int) Main.tile[index3 + this.direction, index4 + 3].type])) + { + this.velocity.Y = -8f; + this.netUpdate = true; } } } - if (this.type == 423 && (double) Math.Abs(this.velocity.X) >= (double) num7 * 0.949999988079071) + if (this.type == 423 && (double) Math.Abs(this.velocity.X) >= (double) num6 * 0.949999988079071) { Microsoft.Xna.Framework.Rectangle hitbox = this.Hitbox; for (int index = 0; index < 2; ++index) @@ -26157,51 +20092,35 @@ label_422: int num14 = 1; float num15 = 1f; bool flag16 = false; - float num16 = 30f; - float num17 = 0.0f; - bool flag17 = false; - bool flag18 = true; + bool flag17 = true; + bool flag18 = false; + int num16 = 30; bool flag19 = false; - int num18 = 30; bool flag20 = false; bool flag21 = false; bool flag22 = false; - bool flag23 = false; LegacySoundStyle legacySoundStyle = (LegacySoundStyle) null; int maxValue1 = 0; - bool flag24 = false; + bool flag23 = false; float max2 = 1f; - float num19 = 0.07f; - float num20 = 0.8f; - float num21 = (float) (this.width / 2 + 6); - bool flag25 = this.directionY < 0; + float num17 = 0.07f; + float num18 = 0.8f; + float num19 = (float) (this.width / 2 + 6); + bool flag24 = this.directionY < 0; + bool flag25 = false; + int num20 = 1; bool flag26 = false; - int num22 = 1; - bool flag27 = false; - float num23 = 5f; - float num24 = 3f; - float num25 = 8f; - float amount1 = 0.05f; - float amount2 = 0.04f; - float amount3 = 0.1f; - bool flag28 = false; - float num26 = 0.025f; + float num21 = 0.025f; NPCAimedTarget targetData = this.GetTargetData(); - NPCUtils.NPCTargetingMethod npcTargetingMethod = new NPCUtils.NPCTargetingMethod(NPCUtils.TargetClosestCommon); - if (NPCID.Sets.BelongsToInvasionOldOnesArmy[this.type]) - npcTargetingMethod = new NPCUtils.NPCTargetingMethod(NPCUtils.TargetClosestOldOnesInvasion); if (targetData.Type == NPCTargetType.NPC && Main.npc[this.TranslatedTargetIndex].type == 548 && Main.npc[this.TranslatedTargetIndex].dontTakeDamageFromHostiles) { - npcTargetingMethod(this, true, new Vector2?()); + NPCUtils.TargetClosestOldOnesInvasion(this); targetData = this.GetTargetData(); } - if (NPCID.Sets.FighterUsesDD2PortalAppearEffect[this.type]) - { - if (!targetData.Invalid) - flag2 = !Collision.CanHit(this.Center, 0, 0, targetData.Center, 0, 0) && (this.direction == Math.Sign(targetData.Center.X - this.Center.X) || this.noGravity && (double) this.Distance(targetData.Center) > 50.0 && (double) this.Center.Y > (double) targetData.Center.Y); - flag2 &= (double) this.ai[0] <= 0.0; - } - if (flag2) + if (!targetData.Invalid) + flag2 = !Collision.CanHit(this.Center, 0, 0, targetData.Center, 0, 0) && (this.direction == Math.Sign(targetData.Center.X - this.Center.X) || this.noGravity && (double) this.Distance(targetData.Center) > 50.0 && (double) this.Center.Y > (double) targetData.Center.Y); + bool flag27 = flag2 & (double) this.ai[0] <= 0.0; + if (flag27) { if ((double) this.velocity.Y == 0.0 || (double) Math.Abs(targetData.Center.Y - this.Center.Y) > 800.0) { @@ -26214,8 +20133,8 @@ label_422: this.noGravity = false; this.noTileCollide = false; } - bool flag29 = NPCID.Sets.FighterUsesDD2PortalAppearEffect[this.type]; - bool flag30 = true; + bool flag28 = NPCID.Sets.FighterUsesDD2PortalAppearEffect[this.type]; + bool flag29 = true; Vector2 size; switch (this.type) { @@ -26225,20 +20144,20 @@ label_422: legacySoundStyle = SoundID.DD2_GoblinScream; maxValue1 = 1000; flag5 = true; - flag21 = DD2Event.EnemiesShouldChasePlayers; + flag20 = DD2Event.EnemiesShouldChasePlayers; if (this.type == 553) { - num19 += 0.01f; + num17 += 0.01f; max2 += 0.2f; } if (this.type == 554) { - num19 += 0.02f; + num17 += 0.02f; max2 += 0.4f; } if ((double) this.localAI[3] < 60.0) { - num19 = (float) (0.00999999977648258 + (double) this.localAI[3] / 60.0 * 0.0500000007450581); + num17 = (float) (0.00999999977648258 + (double) this.localAI[3] / 60.0 * 0.0500000007450581); break; } break; @@ -26247,9 +20166,9 @@ label_422: case 557: maxValue1 = 800; legacySoundStyle = SoundID.DD2_GoblinBomberScream; - int num27 = (double) this.localAI[3] >= 60.0 ? 1 : 0; - flag21 = DD2Event.EnemiesShouldChasePlayers; - flag24 = true; + int num22 = (double) this.localAI[3] >= 60.0 ? 1 : 0; + flag20 = DD2Event.EnemiesShouldChasePlayers; + flag23 = true; flag12 = true; flag15 = (double) this.ai[1] > 18.0; num8 = 42; @@ -26261,47 +20180,47 @@ label_422: max1 = 0.5f; num11 = 280f; num10 = 6f; - if (num27 == 0) + if (num22 == 0) { num11 = 1f; - num19 = (float) (0.00999999977648258 + (double) this.localAI[3] / 60.0 * 0.0500000007450581); + num17 = (float) (0.00999999977648258 + (double) this.localAI[3] / 60.0 * 0.0500000007450581); } if (this.type == 555) { max2 = 0.88f; max1 = 0.6f; - Damage = this.GetAttackDamage_ForProjectiles(20f, 15f); + Damage = Main.expertMode ? 15 : 20; } if (this.type == 555) { max2 = 0.88f; max1 = 0.6f; - Damage = this.GetAttackDamage_ForProjectiles(30f, 25f); + Damage = Main.expertMode ? 25 : 30; } if (this.type == 557) { max2 = 1.12f; max1 = 0.4f; - Damage = this.GetAttackDamage_ForProjectiles(40f, 35f); + Damage = Main.expertMode ? 35 : 40; } if ((double) this.ai[1] == (double) num9) { - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_GoblinBomberThrow, this.Center); + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_GoblinBomberThrow, this.Center); break; } break; case 561: case 562: case 563: - int num28 = (double) this.localAI[3] >= 60.0 ? 1 : 0; + int num23 = (double) this.localAI[3] >= 60.0 ? 1 : 0; if ((double) this.ai[1] == 82.0) { - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_JavelinThrowersAttack, this.Center); + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_JavelinThrowersAttack, this.Center); maxValue1 = 7; legacySoundStyle = SoundID.DD2_JavelinThrowersTaunt; } - flag21 = DD2Event.EnemiesShouldChasePlayers; - flag24 = true; + flag20 = DD2Event.EnemiesShouldChasePlayers; + flag23 = true; flag12 = true; flag15 = (double) this.ai[1] > 82.0; num8 = 90; @@ -26314,16 +20233,16 @@ label_422: max1 = 0.5f; num11 = 600f; num10 = 13f; - if (num28 == 0) + if (num23 == 0) { num11 = 1f; - num19 = (float) (0.00999999977648258 + (double) this.localAI[3] / 60.0 * 0.0500000007450581); + num17 = (float) (0.00999999977648258 + (double) this.localAI[3] / 60.0 * 0.0500000007450581); } if (this.type == 561) { max2 = 0.88f; max1 = 0.6f; - Damage = this.GetAttackDamage_ForProjectiles(15f, 10f); + Damage = Main.expertMode ? 10 : 15; num10 = 11.5f; num11 -= 100f; } @@ -26331,7 +20250,7 @@ label_422: { max2 = 0.94f; max1 = 0.5f; - Damage = this.GetAttackDamage_ForProjectiles(30f, 20f); + Damage = Main.expertMode ? 20 : 30; num10 = 12.2f; num11 -= 50f; } @@ -26339,74 +20258,74 @@ label_422: { max2 = 1f; max1 = 0.4f; - Damage = this.GetAttackDamage_ForProjectiles(45f, 30f); + Damage = Main.expertMode ? 30 : 45; break; } break; case 566: case 567: DelegateMethods.v3_1 = new Vector3(0.3f, 0.05f, 0.45f) * 1.5f; - Utils.PlotTileLine(this.Top, this.Bottom, (float) this.width, new Utils.TileActionAttempt(DelegateMethods.CastLightOpen)); - flag21 = DD2Event.EnemiesShouldChasePlayers; - int num29 = (double) this.localAI[3] >= 120.0 ? 1 : 0; - if (num29 == 0) - num19 = 0.0f; - if (num29 != 0) + Utils.PlotTileLine(this.Top, this.Bottom, (float) this.width, new Utils.PerLinePoint(DelegateMethods.CastLightOpen)); + flag20 = DD2Event.EnemiesShouldChasePlayers; + int num24 = (double) this.localAI[3] >= 120.0 ? 1 : 0; + if (num24 == 0) + num17 = 0.0f; + if (num24 != 0) { this.dontTakeDamage = false; break; } this.dontTakeDamage = true; this.velocity.X = 0.0f; - flag24 = true; - flag20 = true; + flag23 = true; + flag19 = true; this.ai[3] = 0.0f; if ((double) this.localAI[3] == 0.0) this.alpha = (int) byte.MaxValue; ++this.localAI[3]; - float num30 = this.localAI[3]; - if ((double) num30 >= 110.0) + float num25 = this.localAI[3]; + if ((double) num25 >= 110.0) { this.alpha -= 26; if (this.alpha < 0) this.alpha = 0; } - if ((double) num30 >= 100.0) + if ((double) num25 >= 100.0) { - int num31 = (int) this.localAI[3] / 20; + int num26 = (int) this.localAI[3] / 20; size = this.Size; - float num32 = size.Length() / 2f / 20f; + float num27 = size.Length() / 2f / 20f; int maxValue2 = 5; - for (int index = 0; index < num31 * 2; ++index) + for (int index = 0; index < num26 * 2; ++index) { if (Main.rand.Next(maxValue2) == 0) { Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 236, this.velocity.X * 1f); dust.scale = 1f; dust.fadeIn = 0.3f; - dust.velocity = new Vector2(Main.rand.NextFloatDirection() * 1f, -dust.velocity.Length()) * 1.25f * num32; + dust.velocity = new Vector2(Main.rand.NextFloatDirection() * 1f, -dust.velocity.Length()) * 1.25f * num27; } } } else { - int num33 = (int) this.localAI[3] / 10; + int num28 = (int) this.localAI[3] / 10; size = this.Size; - float num34 = size.Length() / 2f / 20f; + float num29 = size.Length() / 2f / 20f; int maxValue3 = 5; - for (int index = 0; (double) index < (double) num33 * 1.29999995231628; ++index) + for (int index = 0; (double) index < (double) num28 * 1.29999995231628; ++index) { if (Main.rand.Next(maxValue3) == 0) { Dust dust = Dust.NewDustDirect(this.position + new Vector2((float) (-this.width / 2), 8f), this.width + this.width, this.height, 27, this.velocity.X * 1f, Alpha: 100); dust.scale = 1.1f; dust.fadeIn = 0.1f; - dust.velocity = new Vector2(Main.rand.NextFloatDirection() * 0.1f, -dust.velocity.Length()) * 1.05f * num34 * Main.rand.NextFloat(); - dust.velocity.Y *= Utils.GetLerpValue((float) this.width * 0.75f, 0.0f, Math.Abs(dust.position.X - this.Center.X), true); + dust.velocity = new Vector2(Main.rand.NextFloatDirection() * 0.1f, -dust.velocity.Length()) * 1.05f * num29 * Main.rand.NextFloat(); + dust.velocity.Y *= Utils.InverseLerp((float) this.width * 0.75f, 0.0f, Math.Abs(dust.position.X - this.Center.X), true); } } } - if ((double) num30 > 100.0 && (int) num30 % 4 == 0) + if ((double) num25 > 100.0 && (int) num25 % 4 == 0) { Gore.NewGoreDirect(this.Left, new Vector2(0.0f, -3f), Utils.SelectRandom(Main.rand, 971, 972), 0.85f).velocity.X *= 0.8f; break; @@ -26415,21 +20334,21 @@ label_422: case 568: case 569: num5 = 110; - num19 = 0.16f; - num20 = 0.7f; + num17 = 0.16f; + num18 = 0.7f; max2 = 1.4f; flag5 = true; num4 = 600f; - flag21 = DD2Event.EnemiesShouldChasePlayers; + flag20 = DD2Event.EnemiesShouldChasePlayers; if ((double) this.localAI[3] < 60.0) - num19 = (float) (0.00999999977648258 + (double) this.localAI[3] / 60.0 * 0.0500000007450581); + num17 = (float) (0.00999999977648258 + (double) this.localAI[3] / 60.0 * 0.0500000007450581); SlotId slotId1; if ((double) this.ai[0] == 0.0) { float[] localAi = this.localAI; slotId1 = (SlotId) SlotId.Invalid; - double num35 = (double) ((SlotId) ref slotId1).ToFloat(); - localAi[1] = (float) num35; + double num30 = (double) ((SlotId) ref slotId1).ToFloat(); + localAi[1] = (float) num30; } if ((double) this.ai[0] == 1.0) { @@ -26443,13 +20362,13 @@ label_422: dust.fadeIn = 1.5f; dust.position.Y += 4f; } - ActiveSound activeSound = SoundEngine.GetActiveSound(SlotId.FromFloat(this.localAI[1])); + ActiveSound activeSound = Main.GetActiveSound(SlotId.FromFloat(this.localAI[1])); if (activeSound == null) { float[] localAi = this.localAI; - slotId1 = SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_WitherBeastAuraPulse, this.Center); - double num36 = (double) ((SlotId) ref slotId1).ToFloat(); - localAi[1] = (float) num36; + slotId1 = Main.PlayTrackedSound((SoundStyle) SoundID.DD2_WitherBeastAuraPulse, this.Center); + double num31 = (double) ((SlotId) ref slotId1).ToFloat(); + localAi[1] = (float) num31; } else activeSound.Position = this.Center; @@ -26468,7 +20387,7 @@ label_422: if (Main.netMode != 2) { Player player = Main.player[Main.myPlayer]; - if (!player.dead && player.active && (double) (player.Center - this.Center).Length() < 400.0 && !player.creativeGodMode) + if (!player.dead && player.active && (double) (player.Center - this.Center).Length() < 400.0) player.AddBuff(195, 3, false); } if ((double) this.ai[1] > 0.0) @@ -26497,8 +20416,8 @@ label_422: break; case 570: case 571: - flag21 = DD2Event.EnemiesShouldChasePlayers; - flag24 = true; + flag20 = DD2Event.EnemiesShouldChasePlayers; + flag23 = true; flag12 = true; flag15 = (double) this.ai[1] > 40.0; num8 = 60; @@ -26517,21 +20436,21 @@ label_422: num15 = 0.0f; if (this.type == 570) max1 = 2.5f; - Damage = this.GetAttackDamage_ForProjectiles(35f, 25f); + Damage = Main.expertMode ? 25 : 35; if (this.type == 571) - Damage = this.GetAttackDamage_ForProjectiles(60f, 45f); + Damage = Main.expertMode ? 45 : 60; max2 = 0.77f; if ((double) this.ai[0] > 0.0) { if ((double) this.ai[1] == 40.0) - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_DrakinShot, this.Center); + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_DrakinShot, this.Center); else if ((double) this.ai[1] == 60.0) - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_DrakinBreathIn, this.Center); + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_DrakinBreathIn, this.Center); } if ((double) this.localAI[3] < 60.0) { num11 = 1f; - num19 = (float) (0.00999999977648258 + (double) this.localAI[3] / 60.0 * 0.0500000007450581); + num17 = (float) (0.00999999977648258 + (double) this.localAI[3] / 60.0 * 0.0500000007450581); break; } break; @@ -26542,23 +20461,23 @@ label_422: { float[] localAi1 = this.localAI; SlotId invalid = (SlotId) SlotId.Invalid; - double num37 = (double) ((SlotId) ref invalid).ToFloat(); - localAi1[0] = (float) num37; + double num32 = (double) ((SlotId) ref invalid).ToFloat(); + localAi1[0] = (float) num32; float[] localAi2 = this.localAI; slotId2 = (SlotId) SlotId.Invalid; - double num38 = (double) ((SlotId) ref slotId2).ToFloat(); - localAi2[1] = (float) num38; + double num33 = (double) ((SlotId) ref slotId2).ToFloat(); + localAi2[1] = (float) num33; } - flag21 = DD2Event.EnemiesShouldChasePlayers; + flag20 = DD2Event.EnemiesShouldChasePlayers; if ((double) this.ai[1] == 2.0) { - SoundEngine.GetActiveSound(SlotId.FromFloat(this.localAI[0]))?.Stop(); - SoundEngine.GetActiveSound(SlotId.FromFloat(this.localAI[1]))?.Stop(); + Main.GetActiveSound(SlotId.FromFloat(this.localAI[0]))?.Stop(); + Main.GetActiveSound(SlotId.FromFloat(this.localAI[1]))?.Stop(); this.position = this.Center; this.width = this.height = 192; this.Center = this.position; this.velocity = Vector2.Zero; - this.damage = this.GetAttackDamage_ScaledByStrength(80f); + this.damage = (int) (80.0 * (double) Main.damageMultiplier); this.alpha = (int) byte.MaxValue; for (int index1 = 0; index1 < 4; ++index1) { @@ -26602,7 +20521,7 @@ label_422: ++this.ai[0]; if ((double) this.ai[0] < 3.0) return; - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_KoboldExplosion, this.Center); + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_KoboldExplosion, this.Center); this.life = 0; this.HitEffect(); this.active = false; @@ -26614,21 +20533,21 @@ label_422: if (!((SlotId) ref slotId3).IsValid) { float[] localAi = this.localAI; - slotId2 = SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_KoboldIgnite, this.Center); - double num39 = (double) ((SlotId) ref slotId2).ToFloat(); - localAi[0] = (float) num39; + slotId2 = Main.PlayTrackedSound((SoundStyle) SoundID.DD2_KoboldIgnite, this.Center); + double num34 = (double) ((SlotId) ref slotId2).ToFloat(); + localAi[0] = (float) num34; } ++this.localAI[2]; if ((double) this.localAI[2] == 30.0) { float[] localAi3 = this.localAI; - slotId2 = SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_KoboldIgniteLoop, this.Center); - double num40 = (double) ((SlotId) ref slotId2).ToFloat(); - localAi3[0] = (float) num40; + slotId2 = Main.PlayTrackedSound((SoundStyle) SoundID.DD2_KoboldIgniteLoop, this.Center); + double num35 = (double) ((SlotId) ref slotId2).ToFloat(); + localAi3[0] = (float) num35; float[] localAi4 = this.localAI; - slotId2 = SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_KoboldScreamChargeLoop, this.Center); - double num41 = (double) ((SlotId) ref slotId2).ToFloat(); - localAi4[1] = (float) num41; + slotId2 = Main.PlayTrackedSound((SoundStyle) SoundID.DD2_KoboldScreamChargeLoop, this.Center); + double num36 = (double) ((SlotId) ref slotId2).ToFloat(); + localAi4[1] = (float) num36; } } if ((double) this.ai[0] > 0.0 && (double) this.ai[1] == 1.0) @@ -26643,23 +20562,23 @@ label_422: this.ai[1] = 1f; if ((double) this.ai[0] == 0.0 && (double) this.ai[1] == 1.0) { - ActiveSound activeSound1 = SoundEngine.GetActiveSound(SlotId.FromFloat(this.localAI[0])); + ActiveSound activeSound1 = Main.GetActiveSound(SlotId.FromFloat(this.localAI[0])); if (activeSound1 == null) { float[] localAi = this.localAI; - slotId2 = SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_KoboldIgniteLoop, this.Center); - double num42 = (double) ((SlotId) ref slotId2).ToFloat(); - localAi[0] = (float) num42; + slotId2 = Main.PlayTrackedSound((SoundStyle) SoundID.DD2_KoboldIgniteLoop, this.Center); + double num37 = (double) ((SlotId) ref slotId2).ToFloat(); + localAi[0] = (float) num37; } else activeSound1.Position = this.Center; - ActiveSound activeSound2 = SoundEngine.GetActiveSound(SlotId.FromFloat(this.localAI[1])); + ActiveSound activeSound2 = Main.GetActiveSound(SlotId.FromFloat(this.localAI[1])); if (activeSound2 == null) { float[] localAi = this.localAI; - slotId2 = SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_KoboldScreamChargeLoop, this.Center); - double num43 = (double) ((SlotId) ref slotId2).ToFloat(); - localAi[1] = (float) num43; + slotId2 = Main.PlayTrackedSound((SoundStyle) SoundID.DD2_KoboldScreamChargeLoop, this.Center); + double num38 = (double) ((SlotId) ref slotId2).ToFloat(); + localAi[1] = (float) num38; } else activeSound2.Position = this.Center; @@ -26669,7 +20588,7 @@ label_422: flag5 = true; num5 = 40; num4 = 64f; - num19 = 0.3f; + num17 = 0.3f; max2 = 4f; Vector2 Position = this.Center + new Vector2((float) (this.spriteDirection * 12), 0.0f); if (Main.rand.Next(6) == 0) @@ -26700,7 +20619,7 @@ label_422: } if ((double) this.localAI[3] < 60.0) { - num19 = (float) (0.00999999977648258 + (double) this.localAI[3] / 60.0 * 0.0500000007450581); + num17 = (float) (0.00999999977648258 + (double) this.localAI[3] / 60.0 * 0.0500000007450581); break; } break; @@ -26708,33 +20627,33 @@ label_422: case 577: maxValue1 = 700; legacySoundStyle = SoundID.DD2_OgreRoar; - num21 -= 32f; + num19 -= 32f; flag5 = true; num6 = 60; num4 = 130f; num5 = 44; - flag21 = DD2Event.EnemiesShouldChasePlayers; + flag20 = DD2Event.EnemiesShouldChasePlayers; num7 = 0.7f; if ((double) this.localAI[0] > 0.0) --this.localAI[0]; if ((double) this.ai[0] <= 0.0) { - float num44 = this.ai[1]; - float num45 = this.Distance(targetData.Center); + float num39 = this.ai[1]; + float num40 = this.Distance(targetData.Center); if ((double) this.localAI[3] >= 60.0) { - if ((double) num45 <= (double) num4 + 300.0 && (double) this.localAI[0] <= 0.0) + if ((double) num40 <= (double) num4 + 300.0 && (double) this.localAI[0] <= 0.0) this.ai[1] = 2f; - else if ((double) num45 > (double) num4 + 30.0) + else if ((double) num40 > (double) num4 + 30.0) this.ai[1] = 1f; - else if ((double) num45 <= (double) num4) + else if ((double) num40 <= (double) num4) { this.ai[1] = 0.0f; - if ((double) num44 == 1.0) + if ((double) num39 == 1.0) this.ai[0] = 0.0f; } } - if ((double) num44 != (double) this.ai[1]) + if ((double) num39 != (double) this.ai[1]) this.netUpdate = true; } else if ((double) this.ai[1] == 2.0) @@ -26745,7 +20664,7 @@ label_422: num5 = 44; if ((double) this.ai[0] == 40.0) { - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_OgreAttack, this.Center); + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_OgreAttack, this.Center); break; } break; @@ -26754,13 +20673,13 @@ label_422: num5 = 90; num4 = 1000f; num6 = 240; - Damage = this.GetAttackDamage_ForProjectiles(40f, 30f); + Damage = this.type != 576 ? (Main.expertMode ? 30 : 40) : (Main.expertMode ? 30 : 40); flag15 = false; vector2_1 = new Vector2((float) (this.direction * 30), -70f); Type = 676; if ((double) this.ai[0] == 80.0) { - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_OgreSpit, this.Center); + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_OgreSpit, this.Center); break; } break; @@ -26768,7 +20687,7 @@ label_422: num5 = 90; num4 = 250f; flag4 = true; - Damage = this.GetAttackDamage_ForProjectiles(60f, 40f); + Damage = this.type != 576 ? (Main.expertMode ? 40 : 60) : (Main.expertMode ? 40 : 60); num9 = 36; num1 = 56; num2 = 41; @@ -26779,7 +20698,7 @@ label_422: vector2_1 = new Vector2((float) (-this.direction * 20), (float) (this.height / 2 - 1)); if ((double) this.ai[0] == 40.0) { - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_OgreGroundPound, this.Center); + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_OgreGroundPound, this.Center); break; } break; @@ -26790,672 +20709,514 @@ label_422: break; } break; - case 620: - flag27 = this.wet; - flag30 = false; - flag16 = true; - num17 = 150f; - num16 = 20f; - bool dayTime = Main.dayTime; - flag21 = !dayTime; - flag24 = true; - flag12 = true; - flag15 = (double) this.ai[1] > 40.0; - num8 = 60; - num9 = 40; - if ((double) this.ai[1] > 10.0 && (double) this.ai[1] <= 40.0 && (int) this.ai[1] % 5 == 0) - num9 = (int) this.ai[1] - 1; - Type = 811; - vector2_1.X -= (float) (4 * this.direction); - vector2_1.Y -= 20f; - num13 = 0.15f; - max1 = 2.5f; - num11 = 600f; - num10 = 13f; - num14 = 1; - num15 = 0.0f; - Damage = this.GetAttackDamage_ForProjectiles(40f, 30f); - max2 = 8f; - num19 *= 3f; - num20 = 0.9f; - if ((double) this.ai[0] > 0.0) - { - if ((double) this.ai[1] == 40.0) - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_DrakinShot, this.Center); - else if ((double) this.ai[1] == 60.0) - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_DrakinBreathIn, this.Center); - } - this.position = this.position + this.netOffset; - if (this.alpha == (int) byte.MaxValue) - { - this.spriteDirection = this.direction; - this.velocity.Y = -6f; - this.netUpdate = true; - for (int index = 0; index < 35; ++index) - { - Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 5); - dust.velocity *= 1f; - dust.scale = (float) (1.0 + (double) Main.rand.NextFloat() * 0.5); - dust.fadeIn = (float) (1.5 + (double) Main.rand.NextFloat() * 0.5); - dust.velocity += this.velocity * 0.5f; - } - } - this.alpha -= 15; - if (this.alpha < 0) - this.alpha = 0; - if (this.alpha != 0) - { - for (int index = 0; index < 2; ++index) - { - Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 5); - dust.velocity *= 1f; - dust.scale = (float) (1.0 + (double) Main.rand.NextFloat() * 0.5); - dust.fadeIn = (float) (1.5 + (double) Main.rand.NextFloat() * 0.5); - dust.velocity += this.velocity * 0.3f; - } - } - if (Main.rand.Next(3) == 0) - Dust.NewDustDirect(this.position, this.width, this.height, 5, Alpha: 50, Scale: 1.3f).velocity = Vector2.Zero; - this.position = this.position - this.netOffset; - if (dayTime) - { - flag12 = false; - flag24 = false; - flag23 = true; - break; - } - if ((double) this.velocity.Y == 0.0 && (double) targetData.Hitbox.Bottom < (double) this.Top.Y && (double) Math.Abs(this.Center.X - (float) targetData.Hitbox.Center.X) < (double) (this.width * 3) && Collision.CanHit(this.Hitbox.TopLeft(), this.Hitbox.Width, this.Hitbox.Height, targetData.Hitbox.TopLeft(), targetData.Hitbox.Width, targetData.Hitbox.Height)) - { - int num46 = (int) (((double) this.Bottom.Y - 16.0 - (double) targetData.Hitbox.Bottom) / 16.0); - if (num46 < 27) - { - if (num46 < 11) - { - this.velocity.Y = -11f; - break; - } - if (num46 < 15) - { - this.velocity.Y = -13f; - break; - } - if (num46 < 19) - { - this.velocity.Y = -14f; - break; - } - this.velocity.Y = -15.9f; - break; - } - break; - } - break; } - if (flag28) + if (flag26) { - bool flag31 = (double) this.velocity.Y == 0.0; + bool flag30 = (double) this.velocity.Y == 0.0; for (int index = 0; index < 200; ++index) { if (index != this.whoAmI && Main.npc[index].active && Main.npc[index].type == this.type && (double) Math.Abs(this.position.X - Main.npc[index].position.X) + (double) Math.Abs(this.position.Y - Main.npc[index].position.Y) < (double) this.width) { if ((double) this.position.X < (double) Main.npc[index].position.X) - this.velocity.X -= num26; + this.velocity.X -= num21; else - this.velocity.X += num26; + this.velocity.X += num21; if ((double) this.position.Y < (double) Main.npc[index].position.Y) - this.velocity.Y -= num26; + this.velocity.Y -= num21; else - this.velocity.Y += num26; + this.velocity.Y += num21; } } - if (flag31) + if (flag30) this.velocity.Y = 0.0f; } - if (flag29) + if (flag28) { if ((double) this.localAI[3] == 0.0) this.alpha = (int) byte.MaxValue; if ((double) this.localAI[3] == 30.0) - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_EtherianPortalSpawnEnemy, this.Center); + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_EtherianPortalSpawnEnemy, this.Center); if ((double) this.localAI[3] < 60.0) { ++this.localAI[3]; this.alpha -= 5; if (this.alpha < 0) this.alpha = 0; - int num47 = (int) this.localAI[3] / 10; + int num41 = (int) this.localAI[3] / 10; size = this.Size; - float num48 = size.Length() / 2f / 20f; + float num42 = size.Length() / 2f / 20f; int maxValue4 = 5; if (this.type == 576 || this.type == 577) maxValue4 = 1; - for (int index = 0; index < num47; ++index) + for (int index = 0; index < num41; ++index) { if (Main.rand.Next(maxValue4) == 0) { Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 27, this.velocity.X * 1f, Alpha: 100); dust.scale = 0.55f; dust.fadeIn = 0.7f; - dust.velocity *= 0.1f * num48; + dust.velocity *= 0.1f * num42; dust.velocity += this.velocity; } } } } - if (flag27) + bool flag31 = false; + if (flag12 | flag5 && (double) this.ai[0] > 0.0) + flag17 = false; + if (flag12 && (double) this.ai[1] > 0.0) + flag21 = true; + if (flag5 && (double) this.ai[0] > 0.0) + flag21 = true; + if (flag5) { - this.noGravity = true; - this.TargetClosest(false); - if (this.collideX) - this.velocity.X = -this.oldVelocity.X; - if ((double) this.velocity.X != 0.0) - this.direction = Math.Sign(this.direction); - if (Collision.CanHit(this.position, this.width, this.height, targetData.Position, targetData.Width, targetData.Height)) + if ((double) this.ai[0] < 0.0) { - Vector2 vector2_3 = targetData.Center - this.Center; - vector2_3.Normalize(); - this.velocity = Vector2.Lerp(this.velocity, vector2_3 * num23, amount1); + ++this.ai[0]; + flag1 = false; + } + if ((double) this.ai[0] == 0.0 && (double) this.velocity.Y == 0.0 | flag6 && targetData.Type != NPCTargetType.None && (Collision.CanHit(this.position, this.width, this.height, targetData.Position, targetData.Width, targetData.Height) ? 1 : (Collision.CanHitLine(this.position, this.width, this.height, targetData.Position, targetData.Width, targetData.Height) ? 1 : 0)) != 0 && (double) (targetData.Center - this.Center).Length() < (double) num4) + { + this.ai[0] = (float) num5; + this.netUpdate = true; + } + if ((double) this.ai[0] > 0.0) + { + this.spriteDirection = this.direction * num20; + if (flag7) + { + this.velocity.X *= num7; + flag23 = true; + flag19 = true; + this.ai[3] = 0.0f; + } + --this.ai[0]; + if ((double) this.ai[0] == 0.0) + this.ai[0] = (float) -num6; + } + } + if (flag3 && (double) this.ai[0] > 0.0) + { + if (flag15) + { + NPCUtils.TargetClosestOldOnesInvasion(this); + targetData = this.GetTargetData(); + } + if ((double) this.ai[0] == (double) num9) + { + Vector2 vector2_3 = this.Center + vector2_1; + Vector2 v = targetData.Center - vector2_3; + v.Y -= Math.Abs(v.X) * num13; + Vector2 vector2_4 = v.SafeNormalize(-Vector2.UnitY) * num10; + for (int index = 0; index < num14; ++index) + { + Vector2 vector2_5 = vector2_4; + Vector2 vector2_6 = vector2_3; + Vector2 velocity = !nullable.HasValue ? vector2_5 + Utils.RandomVector2(Main.rand, -max1, max1) : vector2_5 + nullable.Value; + Vector2 position = vector2_6 + vector2_4 * num15; + if (Main.netMode != 1) + Projectile.NewProjectile(position, velocity, Type, Damage, 0.0f, Main.myPlayer); + } + } + } + if (flag4 && (double) this.ai[0] > 0.0) + { + if ((double) this.velocity.Y != 0.0 && (double) this.ai[0] < (double) num2) + this.ai[0] = (float) num2; + if ((double) this.ai[0] == (double) num1) + this.velocity.Y = -num3; + } + if (!flag16 & flag17) + { + if ((double) this.velocity.Y == 0.0 && (double) this.velocity.X * (double) this.direction < 0.0) + flag18 = true; + if ((((double) this.position.X == (double) this.oldPosition.X ? 1 : ((double) this.ai[3] >= (double) num16 ? 1 : 0)) | (flag18 ? 1 : 0)) != 0) + ++this.ai[3]; + else if ((double) Math.Abs(this.velocity.X) > 0.899999976158142 && (double) this.ai[3] > 0.0) + --this.ai[3]; + if ((double) this.ai[3] > (double) (num16 * 10)) + this.ai[3] = 0.0f; + if (this.justHit && !flag29) + this.ai[3] = 0.0f; + if ((double) this.ai[3] == (double) num16) + { + this.netUpdate = true; + if (flag29) + { + this.noGravity = true; + this.noTileCollide = true; + this.position.X += (float) (this.direction * this.width * 2); + int num43 = 20; + size = this.Size; + float num44 = size.Length() / 2f / 20f; + int maxValue5 = 5; + if (this.type == 576 || this.type == 577) + maxValue5 = 1; + for (int index = 0; index < num43; ++index) + { + if (Main.rand.Next(maxValue5) == 0) + { + Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 27, this.velocity.X * 1f, Alpha: 100); + dust.scale = 0.55f; + dust.fadeIn = 0.7f; + dust.velocity *= 3f * num44; + dust.noGravity = true; + dust.fadeIn = 1.5f; + dust.velocity *= 3f; + } + } + return; + } + } + } + if (!flag19) + { + if ((double) this.ai[3] < (double) num16 & flag20) + { + if (maxValue1 > 0 && Main.rand.Next(maxValue1) == 0) + Main.PlayTrackedSound((SoundStyle) legacySoundStyle, this.Center); + NPCUtils.TargetClosestOldOnesInvasion(this); + targetData = this.GetTargetData(); + } + else if (!flag21) + { + if (flag22 && this.timeLeft > 10) + this.timeLeft = 10; + if ((double) this.velocity.X == 0.0) + { + if ((double) this.velocity.Y == 0.0) + { + ++this.ai[2]; + if ((double) this.ai[2] >= 2.0) + { + this.direction *= -1; + this.spriteDirection = this.direction * num20; + this.ai[2] = 0.0f; + } + } + } + else + this.ai[2] = 0.0f; + if (this.direction == 0) + this.direction = 1; + } + } + if (!flag23) + { + if ((double) this.velocity.X < -(double) max2 || (double) this.velocity.X > (double) max2) + { + if ((double) this.velocity.Y == 0.0) + this.velocity = this.velocity * num18; + } + else if ((double) this.velocity.X < (double) max2 && this.direction == 1 || (double) this.velocity.X > -(double) max2 && this.direction == -1) + this.velocity.X = MathHelper.Clamp(this.velocity.X + num17 * (float) this.direction, -max2, max2); + } + if (flag12) + { + if (this.confused) + { + this.ai[0] = 0.0f; } else { - float num49 = num23; - if ((double) this.velocity.Y > 0.0) - num49 = num24; - if ((double) this.velocity.Y < 0.0) - num49 = num25; - Vector2 vector2_4 = new Vector2((float) this.direction, -1f); - vector2_4.Normalize(); - Vector2 vector2_5 = vector2_4 * num49; - if ((double) num49 < (double) num23) - this.velocity = Vector2.Lerp(this.velocity, vector2_5, amount2); - else - this.velocity = Vector2.Lerp(this.velocity, vector2_5, amount3); - } - } - else - { - bool flag32 = false; - if (flag12 | flag5 && (double) this.ai[0] > 0.0) - flag18 = false; - if (flag12 && (double) this.ai[1] > 0.0) - flag22 = true; - if (flag5 && (double) this.ai[0] > 0.0) - flag22 = true; - if (flag5) - { - if ((double) this.ai[0] < 0.0) + if ((double) this.ai[1] > 0.0) + --this.ai[1]; + if (this.justHit) { - ++this.ai[0]; - flag1 = false; - } - if ((double) this.ai[0] == 0.0 && (double) this.velocity.Y == 0.0 | flag6 && targetData.Type != NPCTargetType.None && (Collision.CanHit(this.position, this.width, this.height, targetData.Position, targetData.Width, targetData.Height) ? 1 : (Collision.CanHitLine(this.position, this.width, this.height, targetData.Position, targetData.Width, targetData.Height) ? 1 : 0)) != 0 && (double) (targetData.Center - this.Center).Length() < (double) num4) - { - this.ai[0] = (float) num5; - this.netUpdate = true; + this.ai[1] = 30f; + this.ai[0] = 0.0f; } if ((double) this.ai[0] > 0.0) { - this.spriteDirection = this.direction * num22; - if (flag7) + if (flag15) { - this.velocity.X *= num7; - flag24 = true; - flag20 = true; - this.ai[3] = 0.0f; - this.netUpdate = true; + NPCUtils.TargetClosestOldOnesInvasion(this); + targetData = this.GetTargetData(); } - --this.ai[0]; - if ((double) this.ai[0] == 0.0) + if ((double) this.ai[1] == (double) num9) { - this.ai[0] = (float) -num6; - this.netUpdate = true; - } - } - } - if (flag3 && (double) this.ai[0] > 0.0) - { - if (flag15) - { - npcTargetingMethod(this, true, new Vector2?()); - targetData = this.GetTargetData(); - } - if ((double) this.ai[0] == (double) num9) - { - Vector2 vector2_6 = this.Center + vector2_1; - Vector2 v = targetData.Center - vector2_6; - v.Y -= Math.Abs(v.X) * num13; - Vector2 vector2_7 = v.SafeNormalize(-Vector2.UnitY) * num10; - for (int index = 0; index < num14; ++index) - { - Vector2 vector2_8 = vector2_7; - Vector2 vector2_9 = vector2_6; - Vector2 velocity = !nullable.HasValue ? vector2_8 + Utils.RandomVector2(Main.rand, -max1, max1) : vector2_8 + nullable.Value; - Vector2 position = vector2_9 + vector2_7 * num15; - if (Main.netMode != 1) - Projectile.NewProjectile(position, velocity, Type, Damage, 0.0f, Main.myPlayer); - } - } - } - if (flag4 && (double) this.ai[0] > 0.0) - { - if ((double) this.velocity.Y != 0.0 && (double) this.ai[0] < (double) num2) - this.ai[0] = (float) num2; - if ((double) this.ai[0] == (double) num1) - this.velocity.Y = -num3; - } - if (!flag17 & flag18) - { - if ((double) this.velocity.Y == 0.0 && (double) this.velocity.X * (double) this.direction < 0.0) - flag19 = true; - if ((((double) this.position.X == (double) this.oldPosition.X ? 1 : ((double) this.ai[3] >= (double) num18 ? 1 : 0)) | (flag19 ? 1 : 0)) != 0) - ++this.ai[3]; - else if ((double) Math.Abs(this.velocity.X) > 0.899999976158142 && (double) this.ai[3] > 0.0) - --this.ai[3]; - if ((double) this.ai[3] > (double) (num18 * 10)) - this.ai[3] = 0.0f; - if (this.justHit && !flag30) - this.ai[3] = 0.0f; - if (targetData.Hitbox.Intersects(this.Hitbox)) - this.ai[3] = 0.0f; - if ((double) this.ai[3] == (double) num18) - { - this.netUpdate = true; - if (flag30) - { - this.noGravity = true; - this.noTileCollide = true; - this.position.X += (float) (this.direction * this.width * 2); - int num50 = 20; - size = this.Size; - float num51 = size.Length() / 2f / 20f; - int maxValue5 = 5; - if (this.type == 576 || this.type == 577) - maxValue5 = 1; - for (int index = 0; index < num50; ++index) + Vector2 vector2_7 = this.Center + vector2_1; + Vector2 v = targetData.Center - vector2_7; + v.Y -= Math.Abs(v.X) * num13; + Vector2 vector2_8 = v.SafeNormalize(-Vector2.UnitY) * num10; + for (int index = 0; index < num14; ++index) { - if (Main.rand.Next(maxValue5) == 0) - { - Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 27, this.velocity.X * 1f, Alpha: 100); - dust.scale = 0.55f; - dust.fadeIn = 0.7f; - dust.velocity *= 3f * num51; - dust.noGravity = true; - dust.fadeIn = 1.5f; - dust.velocity *= 3f; - } + Vector2 vector2_9 = vector2_7; + Vector2 vector2_10 = vector2_8; + Vector2 velocity = !nullable.HasValue ? vector2_10 + Utils.RandomVector2(Main.rand, -max1, max1) : vector2_10 + nullable.Value; + Vector2 position = vector2_9 + velocity * num15; + if (Main.netMode != 1) + Projectile.NewProjectile(position, velocity, Type, Damage, 0.0f, Main.myPlayer); } - return; + this.ai[0] = (double) Math.Abs(vector2_8.Y) <= (double) Math.Abs(vector2_8.X) * 2.0 ? ((double) Math.Abs(vector2_8.X) <= (double) Math.Abs(vector2_8.Y) * 2.0 ? ((double) vector2_8.Y > 0.0 ? 2f : 4f) : 3f) : ((double) vector2_8.Y > 0.0 ? 1f : 5f); + } + if ((double) this.velocity.Y != 0.0 && !flag14 || (double) this.ai[1] <= 0.0) + { + this.ai[0] = 0.0f; + this.ai[1] = 0.0f; + } + else if (!flag13) + { + this.velocity.X *= 0.9f; + this.spriteDirection = this.direction * num20; } } - } - if (!flag20) - { - if ((double) this.ai[3] < (double) num18 & flag21) + if ((double) this.ai[0] <= 0.0 | flag13 && (double) this.velocity.Y == 0.0 | flag14 && (double) this.ai[1] <= 0.0 && targetData.Type != NPCTargetType.None && Collision.CanHit(this.position, this.width, this.height, targetData.Position, targetData.Width, targetData.Height)) { - if (maxValue1 > 0 && Main.rand.Next(maxValue1) == 0) - SoundEngine.PlayTrackedSound((SoundStyle) legacySoundStyle, this.Center); - int num52 = this.HasValidTarget ? 1 : 0; - npcTargetingMethod(this, true, new Vector2?()); - targetData = this.GetTargetData(); - int num53 = this.HasValidTarget ? 1 : 0; - if (num52 != num53) + Vector2 vector2_11 = targetData.Center - this.Center; + if ((double) vector2_11.Length() < (double) num11) + { this.netUpdate = true; + this.velocity.X *= 0.5f; + this.ai[0] = 3f; + this.ai[1] = (float) num8; + this.ai[0] = (double) Math.Abs(vector2_11.Y) <= (double) Math.Abs(vector2_11.X) * 2.0 ? ((double) Math.Abs(vector2_11.X) <= (double) Math.Abs(vector2_11.Y) * 2.0 ? ((double) vector2_11.Y > 0.0 ? 2f : 4f) : 3f) : ((double) vector2_11.Y > 0.0 ? 1f : 5f); + } } - else if (!flag22) + if ((double) this.ai[0] <= 0.0 | flag13) { - if (flag23) - this.EncourageDespawn(10); - if ((double) this.velocity.X == 0.0) + bool flag32 = (double) this.Distance(targetData.Center) < (double) num12; + if (flag32 && Collision.CanHitLine(this.position, this.width, this.height, targetData.Position, targetData.Width, targetData.Height)) + this.ai[3] = 0.0f; + if ((((double) this.velocity.X < -(double) max2 ? 1 : ((double) this.velocity.X > (double) max2 ? 1 : 0)) | (flag32 ? 1 : 0)) != 0) { if ((double) this.velocity.Y == 0.0) + this.velocity.X *= num18; + } + else if ((double) this.velocity.X < (double) max2 && this.direction == 1 || (double) this.velocity.X > -(double) max2 && this.direction == -1) + this.velocity.X = MathHelper.Clamp(this.velocity.X + num17 * (float) this.direction, -max2, max2); + } + } + } + if ((double) this.velocity.Y == 0.0) + { + int index12 = (int) ((double) this.Bottom.Y + 7.0) / 16; + int num45 = (int) this.Left.X / 16; + int num46 = (int) this.Right.X / 16; + int index13; + for (int index14 = num45; index14 <= num46; index14 = index13 + 1) + { + index13 = Utils.Clamp(index14, 0, Main.maxTilesX); + index12 = Utils.Clamp(index12, 0, Main.maxTilesY); + Tile tile = Main.tile[index13, index12]; + if (tile == null) + return; + if (tile.nactive() && Main.tileSolid[(int) tile.type]) + { + flag31 = true; + break; + } + } + } + Point tileCoordinates1 = this.Center.ToTileCoordinates(); + if (WorldGen.InWorld(tileCoordinates1.X, tileCoordinates1.Y, 5) && !this.noGravity) + { + Vector2 cPosition; + int cWidth; + int cHeight; + this.GetTileCollisionParameters(out cPosition, out cWidth, out cHeight); + Vector2 vector2_12 = this.position - cPosition; + Collision.StepUp(ref cPosition, ref this.velocity, cWidth, cHeight, ref this.stepSpeed, ref this.gfxOffY); + this.position = cPosition + vector2_12; + } + if (flag31) + { + int index = (int) ((double) this.Center.X + (double) num19 * (double) this.direction) / 16; + int j = ((int) this.Bottom.Y - 15) / 16; + bool flag33 = (double) this.position.Y + (double) this.height - (double) (j * 16) > 20.0; + Tile tileSafely1 = Framing.GetTileSafely(index + this.direction, j + 1); + Tile tileSafely2 = Framing.GetTileSafely(index, j + 1); + Tile tileSafely3 = Framing.GetTileSafely(index, j); + Tile tileSafely4 = Framing.GetTileSafely(index, j - 1); + Tile tileSafely5 = Framing.GetTileSafely(index, j - 2); + Tile tileSafely6 = Framing.GetTileSafely(index, j - 3); + if (flag8 && tileSafely4.nactive() && (tileSafely4.type == (ushort) 10 || tileSafely4.type == (ushort) 388)) + { + ++this.ai[0]; + this.ai[3] = 0.0f; + if ((double) this.ai[0] >= 60.0) + { + if (flag9) + this.ai[1] = 0.0f; + int num47 = 5; + if (Main.tile[index, j - 1].type == (ushort) 388) + num47 = 2; + this.velocity.X = 0.5f * (float) -this.direction; + this.ai[1] += (float) num47; + bool flag34 = false; + if ((double) this.ai[1] >= 10.0) + { + flag34 = true; + this.ai[1] = 10f; + } + if (flag10) + flag34 = true; + WorldGen.KillTile(index, j - 1, true); + if (Main.netMode != 1 & flag34) + { + if (flag11) { - ++this.ai[2]; - if ((double) this.ai[2] >= 2.0) + WorldGen.KillTile(index, j - 1); + if (Main.netMode == 2) + NetMessage.SendData(17, number2: ((float) index), number3: ((float) (j - 1))); + } + else + { + if (tileSafely4.type == (ushort) 10) { - this.direction *= -1; - this.spriteDirection = this.direction * num22; - this.ai[2] = 0.0f; - this.netUpdate = true; - } - } - } - else if ((double) this.ai[2] != 0.0) - { - this.ai[2] = 0.0f; - this.netUpdate = true; - } - if (this.direction == 0) - this.direction = 1; - } - } - if (!flag24) - { - if ((double) this.velocity.X < -(double) max2 || (double) this.velocity.X > (double) max2) - { - if ((double) this.velocity.Y == 0.0) - this.velocity = this.velocity * num20; - } - else if ((double) this.velocity.X < (double) max2 && this.direction == 1 || (double) this.velocity.X > -(double) max2 && this.direction == -1) - this.velocity.X = MathHelper.Clamp(this.velocity.X + num19 * (float) this.direction, -max2, max2); - } - if (flag12) - { - if (this.confused) - { - this.ai[0] = 0.0f; - } - else - { - if ((double) this.ai[1] > 0.0) - --this.ai[1]; - if (this.justHit) - { - this.ai[1] = num16; - this.ai[0] = 0.0f; - } - if ((double) this.ai[0] > 0.0) - { - if (flag15) - { - npcTargetingMethod(this, true, new Vector2?()); - targetData = this.GetTargetData(); - } - if ((double) this.ai[1] == (double) num9) - { - Vector2 vector2_10 = this.Center + vector2_1; - Vector2 v = targetData.Center - vector2_10; - v.Y -= Math.Abs(v.X) * num13; - Vector2 vector2_11 = v.SafeNormalize(-Vector2.UnitY) * num10; - for (int index = 0; index < num14; ++index) - { - Vector2 vector2_12 = vector2_10; - Vector2 vector2_13 = vector2_11; - Vector2 velocity = !nullable.HasValue ? vector2_13 + Utils.RandomVector2(Main.rand, -max1, max1) : vector2_13 + nullable.Value; - Vector2 position = vector2_12 + velocity * num15; - if (Main.netMode != 1) - Projectile.NewProjectile(position, velocity, Type, Damage, 0.0f, Main.myPlayer); - } - this.ai[0] = (double) Math.Abs(vector2_11.Y) <= (double) Math.Abs(vector2_11.X) * 2.0 ? ((double) Math.Abs(vector2_11.X) <= (double) Math.Abs(vector2_11.Y) * 2.0 ? ((double) vector2_11.Y > 0.0 ? 2f : 4f) : 3f) : ((double) vector2_11.Y > 0.0 ? 1f : 5f); - if (flag16) - this.direction = (double) vector2_11.X > 0.0 ? 1 : -1; - } - bool flag33 = true; - if ((double) this.velocity.Y != 0.0 && !flag14 || (double) this.ai[1] <= 0.0) - { - bool flag34 = false; - if ((double) num17 != 0.0 && (double) this.ai[1] <= 0.0) - flag34 = true; - this.ai[0] = 0.0f; - this.ai[1] = flag34 ? num17 : 0.0f; - } - else if (!flag13 || !flag33 && (!flag14 || (double) this.velocity.Y == 0.0)) - { - this.velocity.X *= 0.9f; - this.spriteDirection = this.direction * num22; - } - } - if ((double) this.ai[0] <= 0.0 | flag13 && (double) this.velocity.Y == 0.0 | flag14 && (double) this.ai[1] <= 0.0 && targetData.Type != NPCTargetType.None && Collision.CanHit(this.position, this.width, this.height, targetData.Position, targetData.Width, targetData.Height)) - { - Vector2 vector2_14 = targetData.Center - this.Center; - if ((double) vector2_14.Length() < (double) num11) - { - this.netUpdate = true; - this.velocity.X *= 0.5f; - this.ai[0] = 3f; - this.ai[1] = (float) num8; - this.ai[0] = (double) Math.Abs(vector2_14.Y) <= (double) Math.Abs(vector2_14.X) * 2.0 ? ((double) Math.Abs(vector2_14.X) <= (double) Math.Abs(vector2_14.Y) * 2.0 ? ((double) vector2_14.Y > 0.0 ? 2f : 4f) : 3f) : ((double) vector2_14.Y > 0.0 ? 1f : 5f); - if (flag16) - this.direction = (double) vector2_14.X > 0.0 ? 1 : -1; - } - } - if ((double) this.ai[0] <= 0.0 || flag13) - { - bool flag35 = (double) this.Distance(targetData.Center) < (double) num12; - if (flag35 && Collision.CanHitLine(this.position, this.width, this.height, targetData.Position, targetData.Width, targetData.Height)) - this.ai[3] = 0.0f; - if ((((double) this.velocity.X < -(double) max2 ? 1 : ((double) this.velocity.X > (double) max2 ? 1 : 0)) | (flag35 ? 1 : 0)) != 0) - { - if ((double) this.velocity.Y == 0.0) - this.velocity.X *= num20; - } - else if ((double) this.velocity.X < (double) max2 && this.direction == 1 || (double) this.velocity.X > -(double) max2 && this.direction == -1) - this.velocity.X = MathHelper.Clamp(this.velocity.X + num19 * (float) this.direction, -max2, max2); - } - } - } - if ((double) this.velocity.Y == 0.0) - { - int index12 = (int) ((double) this.Bottom.Y + 7.0) / 16; - int num54 = (int) this.Left.X / 16; - int num55 = (int) this.Right.X / 16; - int index13; - for (int index14 = num54; index14 <= num55; index14 = index13 + 1) - { - index13 = Utils.Clamp(index14, 0, Main.maxTilesX); - index12 = Utils.Clamp(index12, 0, Main.maxTilesY); - Tile tile = Main.tile[index13, index12]; - if (tile == null) - return; - if (tile.nactive() && Main.tileSolid[(int) tile.type]) - { - flag32 = true; - break; - } - } - } - Point tileCoordinates = this.Center.ToTileCoordinates(); - if (WorldGen.InWorld(tileCoordinates.X, tileCoordinates.Y, 5) && !this.noGravity) - { - Vector2 cPosition; - int cWidth; - int cHeight; - this.GetTileCollisionParameters(out cPosition, out cWidth, out cHeight); - Vector2 vector2_15 = this.position - cPosition; - Collision.StepUp(ref cPosition, ref this.velocity, cWidth, cHeight, ref this.stepSpeed, ref this.gfxOffY); - this.position = cPosition + vector2_15; - } - if (flag32) - { - int index = (int) ((double) this.Center.X + (double) num21 * (double) this.direction) / 16; - int j = ((int) this.Bottom.Y - 15) / 16; - bool flag36 = (double) this.position.Y + (double) this.height - (double) (j * 16) > 20.0; - Tile tileSafely1 = Framing.GetTileSafely(index + this.direction, j + 1); - Tile tileSafely2 = Framing.GetTileSafely(index, j + 1); - Tile tileSafely3 = Framing.GetTileSafely(index, j); - Tile tileSafely4 = Framing.GetTileSafely(index, j - 1); - Tile tileSafely5 = Framing.GetTileSafely(index, j - 2); - Tile tileSafely6 = Framing.GetTileSafely(index, j - 3); - if (flag8 && tileSafely4.nactive() && (tileSafely4.type == (ushort) 10 || tileSafely4.type == (ushort) 388)) - { - ++this.ai[0]; - this.ai[3] = 0.0f; - if ((double) this.ai[0] >= 60.0) - { - if (flag9) - this.ai[1] = 0.0f; - int num56 = 5; - if (Main.tile[index, j - 1].type == (ushort) 388) - num56 = 2; - this.velocity.X = 0.5f * (float) -this.direction; - this.ai[1] += (float) num56; - bool flag37 = false; - if ((double) this.ai[1] >= 10.0) - { - flag37 = true; - this.ai[1] = 10f; - } - if (flag10) - flag37 = true; - WorldGen.KillTile(index, j - 1, true); - if (Main.netMode != 1 & flag37) - { - if (flag11) - { - WorldGen.KillTile(index, j - 1); - if (Main.netMode == 2) - NetMessage.SendData(17, number2: ((float) index), number3: ((float) (j - 1))); - } - else - { - if (tileSafely4.type == (ushort) 10) + bool flag35 = WorldGen.OpenDoor(index, j - 1, this.direction); + if (!flag35) { - bool flag38 = WorldGen.OpenDoor(index, j - 1, this.direction); - if (!flag38) - { - this.ai[3] = (float) num18; - this.netUpdate = true; - } - if (Main.netMode == 2 & flag38) - NetMessage.SendData(19, number2: ((float) index), number3: ((float) (j - 1)), number4: ((float) this.direction)); + this.ai[3] = (float) num16; + this.netUpdate = true; } - if (tileSafely4.type == (ushort) 388) + if (Main.netMode == 2 & flag35) + NetMessage.SendData(19, number2: ((float) index), number3: ((float) (j - 1)), number4: ((float) this.direction)); + } + if (tileSafely4.type == (ushort) 388) + { + bool flag36 = WorldGen.ShiftTallGate(index, j - 1, false); + if (!flag36) { - bool flag39 = WorldGen.ShiftTallGate(index, j - 1, false); - if (!flag39) - { - this.ai[3] = (float) num18; - this.netUpdate = true; - } - if (Main.netMode == 2 & flag39) - NetMessage.SendData(19, number: 4, number2: ((float) index), number3: ((float) (j - 1)), number4: ((float) this.direction)); + this.ai[3] = (float) num16; + this.netUpdate = true; } + if (Main.netMode == 2 & flag36) + NetMessage.SendData(19, number: 4, number2: ((float) index), number3: ((float) (j - 1)), number4: ((float) this.direction)); } } } } - else - { - if ((double) this.velocity.X * (double) (this.spriteDirection * num22) > 0.0) - { - if (this.height >= 32 && tileSafely5.nactive() && Main.tileSolid[(int) tileSafely5.type]) - { - this.netUpdate = true; - this.velocity.Y = -7f; - if (tileSafely6.nactive() && Main.tileSolid[(int) tileSafely6.type]) - this.velocity.Y = -8f; - } - else if (tileSafely4.nactive() && Main.tileSolid[(int) tileSafely4.type]) - { - this.velocity.Y = -6f; - this.netUpdate = true; - } - else if (flag36 && tileSafely3.nactive() && !tileSafely3.topSlope() && Main.tileSolid[(int) tileSafely3.type]) - { - this.velocity.Y = -5f; - this.netUpdate = true; - } - else if (flag25 && (!tileSafely2.nactive() || !Main.tileSolid[(int) tileSafely2.type]) && (!tileSafely1.nactive() || !Main.tileSolid[(int) tileSafely1.type])) - { - this.velocity.X *= 1.5f; - this.velocity.Y = -8f; - this.netUpdate = true; - } - else if (flag8) - { - this.ai[0] = 0.0f; - this.ai[1] = 0.0f; - } - if ((double) this.velocity.Y == 0.0 & flag1 && (double) this.ai[3] == 1.0) - { - this.velocity.Y = -5f; - this.netUpdate = true; - } - } - if (flag26 && (double) this.velocity.Y == 0.0 && (double) Math.Abs(targetData.Center.X - this.Center.X) < 100.0 && (double) Math.Abs(targetData.Center.Y - this.Center.Y) < 50.0 && (double) Math.Abs(this.velocity.X) >= 1.0 && (double) this.velocity.X * (double) this.direction > 0.0) - { - this.velocity.X = MathHelper.Clamp(this.velocity.X * 2f, -3f, 3f); - this.velocity.Y = -4f; - this.netAlways = true; - } - } - } - else if (flag8) - { - this.ai[0] = 0.0f; - this.ai[1] = 0.0f; - } - if (!flag2 || !this.noTileCollide) - return; - this.wet = false; - if (flag29) - { - if (this.alpha < 60) - this.alpha += 20; - this.localAI[3] = 40f; - } - int num57 = (double) this.velocity.Y == 0.0 ? 1 : 0; - if ((double) Math.Abs(this.Center.X - targetData.Center.X) > 200.0) - { - this.spriteDirection = this.direction = (double) targetData.Center.X > (double) this.Center.X ? 1 : -1; - this.velocity.X = MathHelper.Lerp(this.velocity.X, (float) this.direction, 0.05f); - } - int Width = 80; - int height = this.height; - Vector2 Position = new Vector2(this.Center.X - (float) (Width / 2), this.position.Y + (float) this.height - (float) height); - bool flag40 = false; - if ((double) this.position.Y + (double) this.height < (double) targetData.Position.Y + (double) targetData.Height - 16.0) - flag40 = true; - if (flag40) - this.velocity.Y += 0.5f; - else if (Collision.SolidCollision(Position, Width, height) || (double) targetData.Center.Y - (double) this.Center.Y < -100.0 || (double) targetData.Center.Y - (double) this.Center.Y < 10.0 && (double) Math.Abs(targetData.Center.X - this.Center.X) < 60.0) - { - if ((double) this.velocity.Y > 0.0) - this.velocity.Y = 0.0f; - if ((double) this.velocity.Y > -0.2) - this.velocity.Y -= 0.025f; - else - this.velocity.Y -= 0.2f; - if ((double) this.velocity.Y < -4.0) - this.velocity.Y = -4f; } else { - if ((double) this.velocity.Y < 0.0) - this.velocity.Y = 0.0f; - if ((double) this.velocity.Y < 0.1) - this.velocity.Y += 0.025f; - else - this.velocity.Y += 0.5f; + if ((double) this.velocity.X * (double) (this.spriteDirection * num20) > 0.0) + { + if (this.height >= 32 && tileSafely5.nactive() && Main.tileSolid[(int) tileSafely5.type]) + { + this.netUpdate = true; + this.velocity.Y = -7f; + if (tileSafely6.nactive() && Main.tileSolid[(int) tileSafely6.type]) + this.velocity.Y = -8f; + } + else if (tileSafely4.nactive() && Main.tileSolid[(int) tileSafely4.type]) + { + this.velocity.Y = -6f; + this.netUpdate = true; + } + else if (flag33 && tileSafely3.nactive() && !tileSafely3.topSlope() && Main.tileSolid[(int) tileSafely3.type]) + { + this.velocity.Y = -5f; + this.netUpdate = true; + } + else if (flag24 && (!tileSafely2.nactive() || !Main.tileSolid[(int) tileSafely2.type]) && (!tileSafely1.nactive() || !Main.tileSolid[(int) tileSafely1.type])) + { + this.velocity.X *= 1.5f; + this.velocity.Y = -8f; + this.netUpdate = true; + } + else if (flag8) + { + this.ai[0] = 0.0f; + this.ai[1] = 0.0f; + } + if ((double) this.velocity.Y == 0.0 & flag1 && (double) this.ai[3] == 1.0) + { + this.velocity.Y = -5f; + this.netUpdate = true; + } + } + if (flag25 && (double) this.velocity.Y == 0.0 && (double) Math.Abs(targetData.Center.X - this.Center.X) < 100.0 && (double) Math.Abs(targetData.Center.Y - this.Center.Y) < 50.0 && (double) Math.Abs(this.velocity.X) >= 1.0 && (double) this.velocity.X * (double) this.direction > 0.0) + { + this.velocity.X = MathHelper.Clamp(this.velocity.X * 2f, -3f, 3f); + this.velocity.Y = -4f; + this.netAlways = true; + } } - if ((double) this.velocity.Y > 10.0) - this.velocity.Y = 10f; - if (num57 == 0) - return; - this.velocity.Y = 0.0f; } + else if (flag8) + { + this.ai[0] = 0.0f; + this.ai[1] = 0.0f; + } + if (!flag27 || !this.noTileCollide) + return; + if (flag28) + { + if (this.alpha < 60) + this.alpha += 20; + this.localAI[3] = 40f; + } + int num48 = (double) this.velocity.Y == 0.0 ? 1 : 0; + if ((double) Math.Abs(this.Center.X - targetData.Center.X) > 200.0) + { + this.spriteDirection = this.direction = (double) targetData.Center.X > (double) this.Center.X ? 1 : -1; + this.velocity.X = MathHelper.Lerp(this.velocity.X, (float) this.direction, 0.05f); + } + int Width = 80; + int height = this.height; + Vector2 Position1 = new Vector2(this.Center.X - (float) (Width / 2), this.position.Y + (float) this.height - (float) height); + bool flag37 = false; + if ((double) this.position.Y + (double) this.height < (double) targetData.Position.Y + (double) targetData.Height - 16.0) + flag37 = true; + if (flag37) + this.velocity.Y += 0.5f; + else if (Collision.SolidCollision(Position1, Width, height) || (double) targetData.Center.Y - (double) this.Center.Y < -100.0) + { + if ((double) this.velocity.Y > 0.0) + this.velocity.Y = 0.0f; + if ((double) this.velocity.Y > -0.2) + this.velocity.Y -= 0.025f; + else + this.velocity.Y -= 0.2f; + if ((double) this.velocity.Y < -4.0) + this.velocity.Y = -4f; + } + else + { + if ((double) this.velocity.Y < 0.0) + this.velocity.Y = 0.0f; + if ((double) this.velocity.Y < 0.1) + this.velocity.Y += 0.025f; + else + this.velocity.Y += 0.5f; + } + if ((double) this.velocity.Y > 10.0) + this.velocity.Y = 10f; + if (num48 == 0) + return; + this.velocity.Y = 0.0f; } private void AI_084_LunaticCultist() { if ((double) this.ai[0] != -1.0 && Main.rand.Next(1000) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(88, 92)); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(88, 92)); bool expertMode = Main.expertMode; bool flag1 = this.life <= this.lifeMax / 2; int num1 = 120; - int damageForProjectiles1 = this.GetAttackDamage_ForProjectiles(35f, 25f); + int Damage1 = 35; if (expertMode) + { num1 = 90; - if (Main.getGoodWorld) - num1 -= 30; + Damage1 = 25; + } int num2 = 18; int num3 = 3; - int damageForProjectiles2 = this.GetAttackDamage_ForProjectiles(30f, 20f); + int Damage2 = 30; if (expertMode) { num2 = 12; num3 = 4; - } - if (Main.getGoodWorld) - { - num2 = 10; - num3 = 5; + Damage2 = 20; } int num4 = 80; - int damageForProjectiles3 = this.GetAttackDamage_ForProjectiles(45f, 30f); + int Damage3 = 45; if (expertMode) + { num4 = 40; - if (Main.getGoodWorld) - num4 -= 20; + Damage3 = 30; + } int num5 = 20; int num6 = 2; if (expertMode) @@ -27572,7 +21333,7 @@ label_422: float num10 = this.ai[3]; if ((double) this.localAI[0] == 0.0) { - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, 89); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, 89); this.localAI[0] = 1f; this.alpha = (int) byte.MaxValue; this.rotation = 0.0f; @@ -27598,7 +21359,7 @@ label_422: { this.velocity = this.velocity * 0.95f; if ((double) this.localAI[2] != 13.0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, 105); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, 105); this.localAI[2] = 13f; } else if ((double) this.ai[1] > 300.0) @@ -27860,7 +21621,7 @@ label_422: for (int index = 0; index < 1; ++index) { Vector2 vector2_6 = vec3 * 4f; - Projectile.NewProjectile(vector2_5.X, vector2_5.Y, vector2_6.X, vector2_6.Y, 464, damageForProjectiles1, 0.0f, Main.myPlayer, ai1: 1f); + Projectile.NewProjectile(vector2_5.X, vector2_5.Y, vector2_6.X, vector2_6.Y, 464, Damage1, 0.0f, Main.myPlayer, ai1: 1f); } } } @@ -27926,7 +21687,7 @@ label_422: for (int index = 0; index < 1; ++index) { Vector2 vector2_10 = (vec6 * (float) (6.0 + Main.rand.NextDouble() * 4.0)).RotatedByRandom(0.523598790168762); - Projectile.NewProjectile(vector2_9.X, vector2_9.Y, vector2_10.X, vector2_10.Y, 467, damageForProjectiles2, 0.0f, Main.myPlayer); + Projectile.NewProjectile(vector2_9.X, vector2_9.Y, vector2_10.X, vector2_10.Y, 467, Damage2, 0.0f, Main.myPlayer); } } } @@ -27972,7 +21733,7 @@ label_422: } } if ((int) ((double) this.ai[1] - 20.0) % num4 == 0) - Projectile.NewProjectile(this.Center.X, this.Center.Y - 100f, 0.0f, 0.0f, 465, damageForProjectiles3, 0.0f, Main.myPlayer); + Projectile.NewProjectile(this.Center.X, this.Center.Y - 100f, 0.0f, 0.0f, 465, Damage3, 0.0f, Main.myPlayer); } ++this.ai[1]; if ((double) this.ai[1] >= (double) (20 + num4)) @@ -28350,7 +22111,7 @@ label_422: if ((double) this.localAI[0] == 0.0) this.alpha = (int) byte.MaxValue; if ((double) this.localAI[0] == 30.0) - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_EtherianPortalSpawnEnemy, this.Center); + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_EtherianPortalSpawnEnemy, this.Center); if ((double) this.localAI[0] < 60.0) { ++this.localAI[0]; @@ -28400,7 +22161,7 @@ label_422: this.rotation -= 3.141593f; float num20 = num13 * num12; if (Main.expertMode) - num1 *= Main.GameModeInfo.KnockbackToEnemiesMultiplier; + num1 *= Main.expertKnockBack; SlotId slotId; if ((double) this.ai[0] == 0.0) { @@ -28450,13 +22211,13 @@ label_422: if (this.type == 558 || this.type == 559 || this.type == 560) { float[] localAi1 = this.localAI; - slotId = SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_WyvernDiveDown, this.Center); + slotId = Main.PlayTrackedSound((SoundStyle) SoundID.DD2_WyvernDiveDown, this.Center); double num25 = (double) ((SlotId) ref slotId).ToFloat(); localAi1[1] = (float) num25; if (Main.rand.Next(5) == 0) { float[] localAi2 = this.localAI; - slotId = SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_WyvernScream, this.Center); + slotId = Main.PlayTrackedSound((SoundStyle) SoundID.DD2_WyvernScream, this.Center); double num26 = (double) ((SlotId) ref slotId).ToFloat(); localAi2[2] = (float) num26; } @@ -28464,10 +22225,10 @@ label_422: else if (this.type == 574 || this.type == 575) { float[] localAi = this.localAI; - slotId = SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_KoboldFlyerChargeScream, this.Center); + slotId = Main.PlayTrackedSound((SoundStyle) SoundID.DD2_KoboldFlyerChargeScream, this.Center); double num27 = (double) ((SlotId) ref slotId).ToFloat(); localAi[1] = (float) num27; - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_KoboldIgnite, this.Center); + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_KoboldIgnite, this.Center); } } if ((double) this.ai[1] >= (double) num6) @@ -28484,11 +22245,11 @@ label_422: { if ((double) this.ai[1] >= 20.0 && (this.type == 574 || this.type == 575)) { - ActiveSound activeSound = SoundEngine.GetActiveSound(SlotId.FromFloat(this.localAI[2])); + ActiveSound activeSound = Main.GetActiveSound(SlotId.FromFloat(this.localAI[2])); if (activeSound == null) { float[] localAi = this.localAI; - slotId = SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_KoboldIgniteLoop, this.Center); + slotId = Main.PlayTrackedSound((SoundStyle) SoundID.DD2_KoboldIgniteLoop, this.Center); double num28 = (double) ((SlotId) ref slotId).ToFloat(); localAi[2] = (float) num28; } @@ -28544,7 +22305,7 @@ label_422: } this.velocity = this.velocity * 0.95f; } - ActiveSound activeSound1 = SoundEngine.GetActiveSound(SlotId.FromFloat(this.localAI[1])); + ActiveSound activeSound1 = Main.GetActiveSound(SlotId.FromFloat(this.localAI[1])); if (activeSound1 != null) { activeSound1.Position = this.Center; @@ -28558,7 +22319,7 @@ label_422: } if (this.type == 558 || this.type == 559 || this.type == 560) { - ActiveSound activeSound2 = SoundEngine.GetActiveSound(SlotId.FromFloat(this.localAI[2])); + ActiveSound activeSound2 = Main.GetActiveSound(SlotId.FromFloat(this.localAI[2])); if (activeSound2 != null) { activeSound2.Position = this.Center; @@ -28586,7 +22347,7 @@ label_422: this.position.X -= (float) (this.width / 2); this.position.Y -= (float) (this.height / 2); this.velocity = Vector2.Zero; - this.damage = this.GetAttackDamage_ScaledByStrength(80f); + this.damage = (int) (80.0 * (double) Main.damageMultiplier); this.alpha = (int) byte.MaxValue; if ((double) this.ai[1] == 0.0 && (this.type == 574 || this.type == 575)) { @@ -28633,7 +22394,7 @@ label_422: ++this.ai[1]; if ((double) this.ai[1] < 3.0) return; - SoundEngine.PlaySound(SoundID.Item14, this.position); + Main.PlaySound(SoundID.Item14, this.position); this.life = 0; this.HitEffect(); this.active = false; @@ -28677,7 +22438,7 @@ label_422: num9 = 0.1f; this.localAI[2] = 0.0f; DelegateMethods.v3_1 = new Vector3(0.3f, 0.05f, 0.45f) * 1.5f; - Utils.PlotTileLine(this.Top, this.Bottom, (float) this.width, new Utils.TileActionAttempt(DelegateMethods.CastLightOpen)); + Utils.PlotTileLine(this.Top, this.Bottom, (float) this.width, new Utils.PerLinePoint(DelegateMethods.CastLightOpen)); if ((double) this.ai[0] < 0.0) this.ai[0] = MathHelper.Min(this.ai[0] + 1f, 0.0f); if ((double) this.ai[0] > 0.0) @@ -28687,7 +22448,7 @@ label_422: num12 = 0.9f; --this.ai[0]; if ((double) this.ai[0] == 80.0 && (double) this.ai[1] == 2.0) - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_DarkMageSummonSkeleton, this.Center); + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_DarkMageSummonSkeleton, this.Center); if ((double) this.ai[1] == 2.0 && (double) this.ai[0] == 64.0 && Main.netMode != 1) { Projectile.NewProjectile(this.Center + new Vector2((float) (this.direction * 24), -40f), Vector2.Zero, 673, 0, 0.0f, Main.myPlayer); @@ -28701,11 +22462,11 @@ label_422: Projectile.NewProjectile(this.Center + new Vector2((float) (this.direction * 10), -16f), velocity, 675, 40, 0.0f, Main.myPlayer); } if ((double) this.ai[0] == 126.0 && (double) this.ai[1] == 1.0) - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_DarkMageCastHeal, this.Center); + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_DarkMageCastHeal, this.Center); if ((double) this.ai[1] == 1.0 && Main.netMode != 1 && ((double) this.ai[0] == 40.0 || (double) this.ai[0] == 48.0 || (double) this.ai[0] == 56.0)) { Point result; - if (WorldUtils.Find(new Vector2(this.Center.X + (float) (this.direction * 240), this.Center.Y).ToTileCoordinates(), Searches.Chain((GenSearch) new Searches.Down(50), (GenCondition) new Terraria.WorldBuilding.Conditions.IsSolid()), out result)) + if (WorldUtils.Find(new Vector2(this.Center.X + (float) (this.direction * 240), this.Center.Y).ToTileCoordinates(), Searches.Chain((GenSearch) new Searches.Down(50), (GenCondition) new Conditions.IsSolid()), out result)) Projectile.NewProjectile(result.ToWorldCoordinates(autoAddY: 0.0f), Vector2.Zero, 674, 0, 0.0f, Main.myPlayer); } if ((double) this.ai[0] <= 0.0) @@ -28763,7 +22524,7 @@ label_422: if ((double) this.localAI[3] == 0.0) this.alpha = (int) byte.MaxValue; if ((double) this.localAI[3] == 30.0) - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_EtherianPortalSpawnEnemy, this.Center); + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_EtherianPortalSpawnEnemy, this.Center); if ((double) this.localAI[3] < 60.0) { ++this.localAI[3]; @@ -28992,13 +22753,12 @@ label_422: flag2 = true; num11 = 0.1f; Type = 682; - Damage = 50; + Damage = 10; num9 = 10f; num10 = 50f; num6 = 5; num7 = 30; center += new Vector2((float) (-this.spriteDirection * 20), 10f); - this.position = this.position + this.netOffset; if (Main.rand.Next(15) == 0) { Vector2 position = this.position; @@ -29024,14 +22784,13 @@ label_422: dust2.noGravity = true; dust2.customData = (object) this; } - this.position = this.position - this.netOffset; } if (flag3) { if ((double) this.localAI[1] == 0.0) this.alpha = (int) byte.MaxValue; if ((double) this.localAI[1] == 30.0) - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_EtherianPortalSpawnEnemy, this.Center); + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_EtherianPortalSpawnEnemy, this.Center); if ((double) this.localAI[1] < 60.0) { ++this.localAI[1]; @@ -29084,7 +22843,9 @@ label_422: if (!flag1) { this.velocity = (this.velocity * (num2 - 1f) + vector2_1) / num2; - this.EncourageDespawn(10); + if (this.timeLeft <= 10) + return; + this.timeLeft = 10; } else if ((double) v.Length() > (double) num8 || !flag4) this.velocity = (this.velocity * (num3 - 1f) + vector2_1) / num3; @@ -29116,56 +22877,42 @@ label_422: public void ReflectProjectiles(Microsoft.Xna.Framework.Rectangle myRect) { - for (int index = 0; index < 1000; ++index) + for (int i = 0; i < 1000; ++i) { - if (Main.projectile[index].active && Main.projectile[index].CanBeReflected() && this.CanReflectProjectile(Main.projectile[index])) - this.ReflectProjectile(Main.projectile[index]); + if (Main.projectile[i].active && Main.projectile[i].CanReflect()) + { + Microsoft.Xna.Framework.Rectangle hitbox = Main.projectile[i].Hitbox; + if (myRect.Intersects(hitbox)) + this.ReflectProjectile(i); + } } } - public bool CanReflectProjectile(Projectile proj) + public void ReflectProjectile(int i) { - bool flag = proj.Hitbox.Intersects(this.Hitbox); - if (this.type == 618) - this.BloodNautilus_GetMouthPositionAndRotation(out Vector2 _, out Vector2 _); - return flag; - } - - public void BloodNautilus_GetMouthPositionAndRotation( - out Vector2 mouthPosition, - out Vector2 mouthDirection) - { - float f = this.rotation + 0.4712389f * (float) this.spriteDirection; - if (this.spriteDirection == -1) - f += 3.141593f; - mouthDirection = f.ToRotationVector2(); - mouthPosition = this.Center + mouthDirection * 50f; - } - - public void ReflectProjectile(Projectile proj) - { - SoundEngine.PlaySound(SoundID.Item150, proj.position); + if (this.HitSound != null) + Main.PlaySound(this.HitSound, Main.projectile[i].position); for (int index1 = 0; index1 < 3; ++index1) { - int index2 = Dust.NewDust(proj.position, proj.width, proj.height, 31); + int index2 = Dust.NewDust(Main.projectile[i].position, Main.projectile[i].width, Main.projectile[i].height, 31); Main.dust[index2].velocity *= 0.3f; } - proj.hostile = true; - proj.friendly = false; - Vector2 vector2 = Main.player[proj.owner].Center - proj.Center; - vector2.Normalize(); - vector2 *= proj.oldVelocity.Length(); - proj.velocity = new Vector2((float) Main.rand.Next(-100, 101), (float) Main.rand.Next(-100, 101)); - proj.velocity.Normalize(); - Projectile projectile1 = proj; - projectile1.velocity = projectile1.velocity * vector2.Length(); - Projectile projectile2 = proj; - projectile2.velocity = projectile2.velocity + vector2 * 20f; - proj.velocity.Normalize(); - Projectile projectile3 = proj; - projectile3.velocity = projectile3.velocity * vector2.Length(); - proj.damage /= 2; - proj.penetrate = 1; + Main.projectile[i].hostile = true; + Main.projectile[i].friendly = false; + Vector2 vector2_1 = Main.player[Main.projectile[i].owner].Center - Main.projectile[i].Center; + vector2_1.Normalize(); + Vector2 vector2_2 = vector2_1 * Main.projectile[i].oldVelocity.Length(); + Main.projectile[i].velocity = new Vector2((float) Main.rand.Next(-100, 101), (float) Main.rand.Next(-100, 101)); + Main.projectile[i].velocity.Normalize(); + Projectile projectile1 = Main.projectile[i]; + projectile1.velocity = projectile1.velocity * vector2_2.Length(); + Projectile projectile2 = Main.projectile[i]; + projectile2.velocity = projectile2.velocity + vector2_2 * 20f; + Main.projectile[i].velocity.Normalize(); + Projectile projectile3 = Main.projectile[i]; + projectile3.velocity = projectile3.velocity * vector2_2.Length(); + Main.projectile[i].damage /= 2; + Main.projectile[i].penetrate = 1; } public int GetShootingFrame(float circleY) @@ -29285,14 +23032,7 @@ label_422: } } - public bool UsesPartyHat() - { - if (this.type == 441 || this.type == 37 || this.type == 633) - return false; - if (this.ForcePartyHatOn) - return true; - return !this.IsABestiaryIconDummy && this.frame.Height > 0 && this.townNPC && BirthdayParty.PartyIsUp; - } + public bool UsesPartyHat() => this.frame.Height > 0 && this.townNPC && BirthdayParty.PartyIsUp && this.type != 441 && this.type != 37; public PartyHatColor GetPartyHatColor() { @@ -29305,6174 +23045,1476 @@ label_422: int num2 = num1 + this.whoAmI + moonPhase * (this.whoAmI % 2 == 0).ToDirectionInt(); if (num2 < 0) num2 += 5; - int num3 = num2 % 5; - if (num3 == 0) - ++num3; - return (PartyHatColor) num3; - } - - public void SetFrameSize() - { - Main.instance.LoadNPC(this.type); - if (!this.setFrameSize) - return; - this.frame = new Microsoft.Xna.Framework.Rectangle(0, 0, TextureAssets.Npc[this.type].Width(), TextureAssets.Npc[this.type].Height() / Main.npcFrameCount[this.type]); - this.setFrameSize = false; + return (PartyHatColor) (num2 % 5); } public void FindFrame() { - this.position = this.position + this.netOffset; int num1 = 1; if (!Main.dedServ) { - if (!TextureAssets.Npc[this.type].IsLoaded) + if (!Main.NPCLoaded[this.type] || Main.npcTexture[this.type] == null) return; - num1 = TextureAssets.Npc[this.type].Height() / Main.npcFrameCount[this.type]; + num1 = Main.npcTexture[this.type].Height / Main.npcFrameCount[this.type]; } int num2 = 0; if (this.aiAction == 0) num2 = (double) this.velocity.Y >= 0.0 ? ((double) this.velocity.Y <= 0.0 ? ((double) this.velocity.X == 0.0 ? 0 : 1) : 3) : 2; else if (this.aiAction == 1) num2 = 4; - switch (this.type) + if (this.type == 568 || this.type == 569) { - case 1: - case 16: - case 59: - case 71: - case 81: - case 138: - case 147: - case 183: - case 184: - case 204: - case 225: - case 302: - case 304: - case 333: - case 334: - case 335: - case 336: - case 535: - case 537: - case 658: - case 659: - if (this.type == 302 || this.type == 304) - this.spriteDirection = this.direction; - ++this.frameCounter; - if (num2 > 0) - ++this.frameCounter; - if (num2 == 4) - ++this.frameCounter; - if (this.frameCounter >= 8.0) - { - this.frame.Y += num1; + if ((double) this.ai[0] > 0.0) + { + int num3 = this.frame.Y / this.frame.Height; + this.spriteDirection = this.direction; + if (num3 < 5 || num3 > 16) this.frameCounter = 0.0; - } - if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - case 2: - case 23: - case 121: - case 169: - case 190: - case 191: - case 192: - case 193: - case 194: - case 317: - case 318: - case 660: - if (this.type == 23) - { - int index = Dust.NewDust(new Vector2(this.position.X - this.velocity.X, this.position.Y - this.velocity.Y), this.width, this.height, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, Scale: 2f); - Main.dust[index].noGravity = true; - Main.dust[index].velocity.X *= 0.3f; - Main.dust[index].velocity.Y *= 0.3f; - } - if ((this.type == 121 || this.type == 660) && (double) this.localAI[0] == 0.0) - { - this.localAI[0] = 1f; - this.frame.Y = num1 * 2; - } - if (this.type == 2 || this.type == 190 || this.type == 191 || this.type == 192 || this.type == 193 || this.type == 194 || this.type == 317 || this.type == 318) - { - if ((double) this.velocity.X > 0.0) - { - this.spriteDirection = 1; - this.rotation = (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X); - } - if ((double) this.velocity.X < 0.0) - { - this.spriteDirection = -1; - this.rotation = (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X) + 3.14f; - } - } - else if (this.type == 2 || this.type == 121 || this.type == 660) - { - if ((double) this.velocity.X > 0.0) - this.spriteDirection = 1; - if ((double) this.velocity.X < 0.0) - this.spriteDirection = -1; - this.rotation = this.velocity.X * 0.1f; - } + int num4 = 7; ++this.frameCounter; - float num3 = 8f; - if (this.type == 660) - num3 = 6f; - if (this.frameCounter >= (double) num3) + int num5 = 0; + int num6; + if (this.frameCounter >= (double) (5 * (num6 = num5 + 1))) + num4 = 8; + int num7; + if (this.frameCounter >= (double) (5 * (num7 = num6 + 1))) + num4 = 9; + int num8; + if (this.frameCounter >= (double) (5 * (num8 = num7 + 1))) + num4 = 10; + int num9; + if (this.frameCounter >= (double) (5 * (num9 = num8 + 1))) + num4 = 7; + int num10; + if (this.frameCounter >= (double) (5 * (num10 = num9 + 1))) + num4 = 8; + int num11; + if (this.frameCounter >= (double) (5 * (num11 = num10 + 1))) + num4 = 9; + int num12; + if (this.frameCounter >= (double) (5 * (num12 = num11 + 1))) + num4 = 10; + int num13; + if (this.frameCounter >= (double) (5 * (num13 = num12 + 1))) + num4 = 7; + int num14; + if (this.frameCounter >= (double) (5 * (num14 = num13 + 1))) + num4 = 8; + int num15; + if (this.frameCounter >= (double) (5 * (num15 = num14 + 1))) + num4 = 9; + int num16; + if (this.frameCounter >= (double) (5 * (num16 = num15 + 1))) + num4 = 10; + int num17; + if (this.frameCounter >= (double) (5 * (num17 = num16 + 1))) + num4 = 7; + int num18; + if (this.frameCounter >= (double) (5 * (num18 = num17 + 1))) + num4 = 8; + int num19; + if (this.frameCounter >= (double) (5 * (num19 = num18 + 1))) + num4 = 9; + int num20; + if (this.frameCounter >= (double) (5 * (num20 = num19 + 1))) + num4 = 10; + int num21; + if (this.frameCounter >= (double) (5 * (num21 = num20 + 1))) + num4 = 7; + int num22; + if (this.frameCounter >= (double) (5 * (num22 = num21 + 1))) + num4 = 8; + int num23; + if (this.frameCounter >= (double) (5 * (num23 = num22 + 1))) + num4 = 9; + int num24; + if (this.frameCounter >= (double) (5 * (num24 = num23 + 1))) + num4 = 10; + int num25; + if (this.frameCounter >= (double) (5 * (num25 = num24 + 1))) + num4 = 7; + int num26; + if (this.frameCounter >= (double) (5 * (num26 = num25 + 1))) + num4 = 8; + int num27; + if (this.frameCounter >= (double) (5 * (num27 = num26 + 1))) + num4 = 9; + int num28; + if (this.frameCounter >= (double) (5 * (num28 = num27 + 1))) + num4 = 10; + int num29; + if (this.frameCounter >= (double) (5 * (num29 = num28 + 1))) + num4 = 11; + int num30; + if (this.frameCounter >= (double) (5 * (num30 = num29 + 1))) + num4 = 12; + int num31; + if (this.frameCounter >= (double) (5 * (num31 = num30 + 1))) + num4 = 13; + int num32; + if (this.frameCounter >= (double) (5 * (num32 = num31 + 1))) + num4 = 14; + if (this.frameCounter >= 270.0) { - this.frame.Y += num1; - this.frameCounter = 0.0; + num4 = 14; + this.frameCounter -= 10.0; } - if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - case 3: - case 52: - case 53: - case 132: - case 161: - case 186: - case 187: - case 188: - case 189: - case 200: - case 223: - case 251: - case 254: - case (int) byte.MaxValue: - case 319: - case 320: - case 321: - case 331: - case 332: - case 342: - case 536: - case 590: + this.frame.Y = num1 * num4; + } + else + { if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - } + this.spriteDirection = this.direction; if ((double) this.velocity.Y != 0.0 || this.direction == -1 && (double) this.velocity.X > 0.0 || this.direction == 1 && (double) this.velocity.X < 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = num1 * 2; - break; - } - if ((double) this.velocity.X == 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = 0; - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X); - if (this.frameCounter < 8.0) - { - this.frame.Y = 0; - break; - } - if (this.frameCounter < 16.0) - { - this.frame.Y = num1; - break; - } - if (this.frameCounter < 24.0) - { - this.frame.Y = num1 * 2; - break; - } - if (this.frameCounter < 32.0) - { - this.frame.Y = num1; - break; - } - this.frameCounter = 0.0; - break; - case 4: - case 125: - case 126: - ++this.frameCounter; - if (this.frameCounter < 7.0) - this.frame.Y = 0; - else if (this.frameCounter < 14.0) - this.frame.Y = num1; - else if (this.frameCounter < 21.0) - { - this.frame.Y = num1 * 2; - } - else - { - this.frameCounter = 0.0; - this.frame.Y = 0; - } - if ((double) this.ai[0] > 1.0) - { - this.frame.Y += num1 * 3; - break; - } - break; - case 5: - ++this.frameCounter; - if (this.frameCounter >= 8.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - case 6: - case 173: - ++this.frameCounter; - if (this.frameCounter >= 8.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - case 17: - case 18: - case 19: - case 20: - case 21: - case 22: - case 26: - case 27: - case 28: - case 31: - case 37: - case 38: - case 44: - case 54: - case 73: - case 77: - case 78: - case 79: - case 80: - case 104: - case 107: - case 108: - case 120: - case 124: - case 140: - case 142: - case 159: - case 160: - case 162: - case 167: - case 178: - case 181: - case 185: - case 196: - case 197: - case 198: - case 201: - case 202: - case 203: - case 207: - case 208: - case 209: - case 212: - case 213: - case 227: - case 228: - case 229: - case 287: - case 294: - case 295: - case 296: - case 310: - case 311: - case 312: - case 313: - case 314: - case 322: - case 323: - case 324: - case 326: - case 338: - case 339: - case 340: - case 353: - case 368: - case 369: - case 441: - case 453: - case 460: - case 462: - case 463: - case 489: - case 534: - case 550: - case 588: - case 630: - case 632: - case 633: - case 635: - case 637: - case 638: - case 656: - int num4 = this.isLikeATownNPC ? NPCID.Sets.ExtraFramesCount[this.type] : 0; - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - int num5 = Main.npcFrameCount[this.type] - NPCID.Sets.AttackFrameCount[this.type]; - if ((double) this.ai[0] >= 20.0 && (double) this.ai[0] <= 22.0) - { - int num6 = this.frame.Y / num1; - switch (this.ai[0]) - { - case 20f: - if (this.type == 656) - { - if ((double) this.ai[1] > 30.0 && (num6 < 7 || num6 > 9)) - num6 = 7; - if (num6 > 0) - ++this.frameCounter; - if (this.frameCounter > 4.0) - { - this.frameCounter = 0.0; - ++num6; - if (num6 > 8 && (double) this.ai[1] > 30.0) - num6 = 8; - if (num6 > 9) - num6 = 0; - } - } - if (this.type == 637) - { - if ((double) this.ai[1] > 30.0 && (num6 < 10 || num6 > 16)) - num6 = 10; - if (num6 > 0) - ++this.frameCounter; - if (this.frameCounter > 4.0) - { - this.frameCounter = 0.0; - ++num6; - if (num6 > 13 && (double) this.ai[1] > 30.0) - num6 = 13; - if (num6 > 16) - num6 = 0; - } - } - if (this.type == 638) - { - if ((double) this.ai[1] > 30.0 && (num6 < 23 || num6 > 27)) - num6 = 23; - if (num6 > 0) - ++this.frameCounter; - if (this.frameCounter > 4.0) - { - this.frameCounter = 0.0; - ++num6; - if (num6 > 26 && (double) this.ai[1] > 30.0) - num6 = 24; - if (num6 > 27) - { - num6 = 0; - break; - } - break; - } - break; - } - break; - case 21f: - if (this.type == 656) - { - if ((double) this.ai[1] > 30.0 && (num6 < 10 || num6 > 16)) - num6 = 10; - if (num6 > 0) - ++this.frameCounter; - if (this.frameCounter > 4.0) - { - this.frameCounter = 0.0; - ++num6; - if (num6 > 13 && (double) this.ai[1] > 30.0) - num6 = 13; - if (num6 > 16) - num6 = 0; - } - } - if (this.type == 637) - { - if ((double) this.ai[1] > 30.0 && (num6 < 17 || num6 > 21)) - num6 = 17; - if (num6 > 0) - ++this.frameCounter; - if (this.frameCounter > 4.0) - { - this.frameCounter = 0.0; - ++num6; - if (num6 > 19 && (double) this.ai[1] > 30.0) - num6 = 19; - if (num6 > 21) - num6 = 0; - } - } - if (this.type == 638) - { - if ((double) this.ai[1] > 30.0 && (num6 < 17 || num6 > 22)) - num6 = 17; - if (num6 > 0) - ++this.frameCounter; - if (this.frameCounter > 4.0) - { - this.frameCounter = 0.0; - ++num6; - if (num6 > 21 && (double) this.ai[1] > 30.0) - num6 = 18; - if (num6 > 22) - { - num6 = 0; - break; - } - break; - } - break; - } - break; - case 22f: - if (this.type == 656) - { - int num7 = Main.npcFrameCount[this.type]; - if ((double) this.ai[1] > 40.0 && (num6 < 17 || num6 >= num7)) - num6 = 17; - if (num6 > 0) - ++this.frameCounter; - if (this.frameCounter > 4.0) - { - this.frameCounter = 0.0; - ++num6; - if (num6 > 20 && (double) this.ai[1] > 40.0) - num6 = 19; - if (num6 >= num7) - num6 = 0; - } - } - if (this.type == 637) - { - if ((double) this.ai[1] > 30.0 && (num6 < 17 || num6 > 27)) - num6 = 17; - if (num6 > 0) - ++this.frameCounter; - if (this.frameCounter > 4.0) - { - this.frameCounter = 0.0; - ++num6; - if (num6 > 27) - { - num6 = (double) this.ai[1] > 30.0 ? 22 : 20; - break; - } - if ((double) this.ai[1] <= 30.0 && num6 == 22) - { - num6 = 0; - break; - } - if ((double) this.ai[1] > 30.0 && num6 > 19 && num6 < 22) - { - num6 = 22; - break; - } - break; - } - break; - } - break; - } - this.frame.Y = num6 * num1; - break; - } - if ((double) this.ai[0] == 2.0) - { - ++this.frameCounter; - if (this.frame.Y / num1 == num5 - 1 && this.frameCounter >= 5.0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - break; - } - if (this.frame.Y / num1 == 0 && this.frameCounter >= 40.0) - { - this.frame.Y = num1 * (num5 - 1); - this.frameCounter = 0.0; - break; - } - if (this.frame.Y != 0 && this.frame.Y != num1 * (num5 - 1)) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - break; - } - break; - } - if ((double) this.ai[0] == 11.0) - { - ++this.frameCounter; - if (this.frame.Y / num1 == num5 - 1 && this.frameCounter >= 50.0) - { - if (this.frameCounter == 50.0) - { - int num8 = Main.rand.Next(4); - for (int index1 = 0; index1 < 3 + num8; ++index1) - { - int index2 = Dust.NewDust(this.Center + Vector2.UnitX * (float) -this.direction * 8f - Vector2.One * 5f + Vector2.UnitY * 8f, 3, 6, 216, (float) -this.direction, 1f); - Main.dust[index2].velocity /= 2f; - Main.dust[index2].scale = 0.8f; - } - if (Main.rand.Next(30) == 0) - { - int index = Gore.NewGore(this.Center + Vector2.UnitX * (float) -this.direction * 8f, Vector2.Zero, Main.rand.Next(580, 583)); - Main.gore[index].velocity /= 2f; - Main.gore[index].velocity.Y = Math.Abs(Main.gore[index].velocity.Y); - Main.gore[index].velocity.X = -Math.Abs(Main.gore[index].velocity.X) * (float) this.direction; - } - } - if (this.frameCounter >= 100.0 && Main.rand.Next(20) == 0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - break; - } - break; - } - if (this.frame.Y / num1 == 0 && this.frameCounter >= 20.0) - { - this.frame.Y = num1 * (num5 - 1); - this.frameCounter = 0.0; - if (Main.netMode != 1) - { - EmoteBubble.NewBubble(89, new WorldUIAnchor((Entity) this), 90); - break; - } - break; - } - if (this.frame.Y != 0 && this.frame.Y != num1 * (num5 - 1)) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - break; - } - break; - } - if ((double) this.ai[0] == 5.0) - { - this.frame.Y = num1 * (num5 - 3); - if (this.type == 637) - this.frame.Y = num1 * 19; - this.frameCounter = 0.0; - break; - } - if ((double) this.ai[0] == 6.0) - { - ++this.frameCounter; - int num9 = this.frame.Y / num1; - switch (num5 - num9) - { - case 1: - case 2: - case 4: - case 5: - int num10 = this.frameCounter >= 10.0 ? (this.frameCounter >= 16.0 ? (this.frameCounter >= 46.0 ? (this.frameCounter >= 60.0 ? (this.frameCounter >= 66.0 ? (this.frameCounter >= 72.0 ? (this.frameCounter >= 102.0 ? (this.frameCounter >= 108.0 ? (this.frameCounter >= 114.0 ? (this.frameCounter >= 120.0 ? (this.frameCounter >= 150.0 ? (this.frameCounter >= 156.0 ? (this.frameCounter >= 162.0 ? (this.frameCounter >= 168.0 ? (this.frameCounter >= 198.0 ? (this.frameCounter >= 204.0 ? (this.frameCounter >= 210.0 ? (this.frameCounter >= 216.0 ? (this.frameCounter >= 246.0 ? (this.frameCounter >= 252.0 ? (this.frameCounter >= 258.0 ? (this.frameCounter >= 264.0 ? (this.frameCounter >= 294.0 ? (this.frameCounter >= 300.0 ? 0 : num5 - 5) : num5 - 4) : num5 - 5) : 0) : num5 - 5) : num5 - 4) : num5 - 5) : 0) : num5 - 5) : num5 - 4) : num5 - 5) : 0) : num5 - 5) : num5 - 4) : num5 - 5) : 0) : num5 - 5) : num5 - 4) : num5 - 5) : 0) : num5 - 5) : num5 - 4) : num5 - 5) : 0; - if (num10 == num5 - 4 && num9 == num5 - 5) - { - Vector2 Position = this.Center + new Vector2((float) (10 * this.direction), -4f); - for (int index3 = 0; index3 < 8; ++index3) - { - int Type = Main.rand.Next(139, 143); - int index4 = Dust.NewDust(Position, 0, 0, Type, this.velocity.X + (float) this.direction, this.velocity.Y - 2.5f, Scale: 1.2f); - Main.dust[index4].velocity.X += (float) this.direction * 1.5f; - Main.dust[index4].position -= new Vector2(4f); - Main.dust[index4].velocity *= 2f; - Main.dust[index4].scale = (float) (0.699999988079071 + (double) Main.rand.NextFloat() * 0.300000011920929); - } - } - this.frame.Y = num1 * num10; - if (this.frameCounter >= 300.0) - { - this.frameCounter = 0.0; - break; - } - break; - default: - if (num9 != 0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - goto case 1; - } - else - goto case 1; - } - } - else if (((double) this.ai[0] == 7.0 || (double) this.ai[0] == 19.0) && !NPCID.Sets.IsTownPet[this.type]) - { - ++this.frameCounter; - int num11 = this.frame.Y / num1; - switch (num5 - num11) - { - case 1: - case 2: - case 4: - case 5: - int num12 = 0; - if (this.frameCounter < 16.0) - num12 = 0; - else if (this.frameCounter == 16.0 && Main.netMode != 1) - EmoteBubble.NewBubbleNPC(new WorldUIAnchor((Entity) this), 112); - else if (this.frameCounter < 128.0) - num12 = this.frameCounter % 16.0 < 8.0 ? num5 - 2 : 0; - else if (this.frameCounter < 160.0) - num12 = 0; - else if (this.frameCounter == 160.0 && Main.netMode != 1) - EmoteBubble.NewBubbleNPC(new WorldUIAnchor((Entity) this), 60); - else - num12 = this.frameCounter >= 220.0 ? 0 : (this.frameCounter % 12.0 < 6.0 ? num5 - 2 : 0); - this.frame.Y = num1 * num12; - if (this.frameCounter >= 220.0) - { - this.frameCounter = 0.0; - break; - } - break; - default: - if (num11 != 0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - goto case 1; - } - else - goto case 1; - } - } - else if ((double) this.ai[0] == 9.0) - { - ++this.frameCounter; - int num13 = this.frame.Y / num1; - switch (num5 - num13) - { - case 1: - case 2: - case 4: - case 5: - int num14 = this.frameCounter >= 10.0 ? (this.frameCounter >= 16.0 ? num5 - 4 : num5 - 5) : 0; - if ((double) this.ai[1] < 16.0) - num14 = num5 - 5; - if ((double) this.ai[1] < 10.0) - num14 = 0; - this.frame.Y = num1 * num14; - break; - default: - if (num13 != 0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - goto case 1; - } - else - goto case 1; - } - } - else if ((double) this.ai[0] == 18.0) - { - ++this.frameCounter; - int num15 = this.frame.Y / num1; - switch (num5 - num15) - { - case 1: - case 2: - case 4: - case 5: - int num16 = 0; - num16 = this.frameCounter >= 10.0 ? (this.frameCounter >= 16.0 ? num5 - 2 : num5 - 1) : 0; - if ((double) this.ai[1] < 16.0) - num16 = num5 - 1; - if ((double) this.ai[1] < 10.0) - num16 = 0; - int num17 = Main.npcFrameCount[this.type] - 2; - this.frame.Y = num1 * num17; - break; - default: - if (num15 != 0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - goto case 1; - } - else - goto case 1; - } - } - else - { - if ((double) this.ai[0] == 10.0 || (double) this.ai[0] == 13.0) - { - ++this.frameCounter; - int num18 = this.frame.Y / num1; - if ((uint) (num18 - num5) > 3U && num18 != 0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - } - int num19 = 10; - int num20 = 6; - if (this.type == 633) - { - num19 = 0; - num20 = 2; - } - int num21 = this.frameCounter >= (double) num19 ? (this.frameCounter >= (double) (num19 + num20) ? (this.frameCounter >= (double) (num19 + num20 * 2) ? (this.frameCounter >= (double) (num19 + num20 * 3) ? (this.frameCounter >= (double) (num19 + num20 * 4) ? 0 : num5 + 3) : num5 + 2) : num5 + 1) : num5) : 0; - this.frame.Y = num1 * num21; - break; - } - if ((double) this.ai[0] == 15.0) - { - ++this.frameCounter; - int num22 = this.frame.Y / num1; - if ((uint) (num22 - num5) > 3U && num22 != 0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - } - float num23 = this.ai[1] / (float) NPCID.Sets.AttackTime[this.type]; - int num24 = (double) num23 <= 0.649999976158142 ? ((double) num23 <= 0.5 ? ((double) num23 <= 0.349999994039536 ? ((double) num23 <= 0.0 ? 0 : num5 + 3) : num5 + 2) : num5 + 1) : num5; - this.frame.Y = num1 * num24; - break; - } - if ((double) this.ai[0] == 12.0) - { - ++this.frameCounter; - int num25 = this.frame.Y / num1; - if ((uint) (num25 - num5) > 4U && num25 != 0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - } - int num26 = num5 + this.GetShootingFrame(this.ai[2]); - this.frame.Y = num1 * num26; - break; - } - if ((double) this.ai[0] == 14.0) - { - ++this.frameCounter; - int num27 = this.frame.Y / num1; - if ((uint) (num27 - num5) > 1U && num27 != 0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - } - int num28 = 12; - int num29 = this.frameCounter % (double) num28 * 2.0 < (double) num28 ? num5 : num5 + 1; - this.frame.Y = num1 * num29; - break; - } - if (this.CanTalk && ((double) this.ai[0] == 3.0 || (double) this.ai[0] == 4.0)) - { - ++this.frameCounter; - int num30 = this.frame.Y / num1; - switch (num5 - num30) - { - case 1: - case 2: - case 4: - case 5: - bool flag = (double) this.ai[0] == 3.0; - int num31 = 0; - int num32 = 0; - int time1 = -1; - int time2 = -1; - if (this.frameCounter < 10.0) - num31 = 0; - else if (this.frameCounter < 16.0) - num31 = num5 - 5; - else if (this.frameCounter < 46.0) - num31 = num5 - 4; - else if (this.frameCounter < 60.0) - num31 = num5 - 5; - else if (this.frameCounter < 216.0) - num31 = 0; - else if (this.frameCounter == 216.0 && Main.netMode != 1) - time1 = 70; - else if (this.frameCounter < 286.0) - num31 = this.frameCounter % 12.0 < 6.0 ? num5 - 2 : 0; - else if (this.frameCounter < 320.0) - num31 = 0; - else if (this.frameCounter == 320.0 && Main.netMode != 1) - time1 = 100; - else - num31 = this.frameCounter >= 420.0 ? 0 : (this.frameCounter % 16.0 < 8.0 ? num5 - 2 : 0); - if (this.frameCounter < 70.0) - num32 = 0; - else if (this.frameCounter == 70.0 && Main.netMode != 1) - time2 = 90; - else - num32 = this.frameCounter >= 160.0 ? (this.frameCounter >= 166.0 ? (this.frameCounter >= 186.0 ? (this.frameCounter >= 200.0 ? (this.frameCounter >= 320.0 ? (this.frameCounter >= 326.0 ? 0 : num5 - 1) : 0) : num5 - 5) : num5 - 4) : num5 - 5) : (this.frameCounter % 16.0 < 8.0 ? num5 - 2 : 0); - if (flag) - { - NPC npc = Main.npc[(int) this.ai[2]]; - if (time1 != -1) - EmoteBubble.NewBubbleNPC(new WorldUIAnchor((Entity) this), time1, new WorldUIAnchor((Entity) npc)); - if (time2 != -1 && npc.CanTalk) - EmoteBubble.NewBubbleNPC(new WorldUIAnchor((Entity) npc), time2, new WorldUIAnchor((Entity) this)); - } - this.frame.Y = num1 * (flag ? num31 : num32); - if (this.frameCounter >= 420.0) - { - this.frameCounter = 0.0; - break; - } - break; - default: - if (num30 != 0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - goto case 1; - } - else - goto case 1; - } - } - else if (this.CanTalk && ((double) this.ai[0] == 16.0 || (double) this.ai[0] == 17.0)) - { - ++this.frameCounter; - int num33 = this.frame.Y / num1; - switch (num5 - num33) - { - case 1: - case 2: - case 4: - case 5: - bool flag = (double) this.ai[0] == 16.0; - int num34 = 0; - int time = -1; - if (this.frameCounter < 10.0) - num34 = 0; - else if (this.frameCounter < 16.0) - num34 = num5 - 5; - else if (this.frameCounter < 22.0) - num34 = num5 - 4; - else if (this.frameCounter < 28.0) - num34 = num5 - 5; - else if (this.frameCounter < 34.0) - num34 = num5 - 4; - else if (this.frameCounter < 40.0) - num34 = num5 - 5; - else if (this.frameCounter == 40.0 && Main.netMode != 1) - time = 45; - else if (this.frameCounter < 70.0) - num34 = num5 - 4; - else if (this.frameCounter < 76.0) - num34 = num5 - 5; - else if (this.frameCounter < 82.0) - num34 = num5 - 4; - else if (this.frameCounter < 88.0) - num34 = num5 - 5; - else if (this.frameCounter < 94.0) - num34 = num5 - 4; - else if (this.frameCounter < 100.0) - num34 = num5 - 5; - else if (this.frameCounter == 100.0 && Main.netMode != 1) - time = 45; - else if (this.frameCounter < 130.0) - num34 = num5 - 4; - else if (this.frameCounter < 136.0) - num34 = num5 - 5; - else if (this.frameCounter < 142.0) - num34 = num5 - 4; - else if (this.frameCounter < 148.0) - num34 = num5 - 5; - else if (this.frameCounter < 154.0) - num34 = num5 - 4; - else if (this.frameCounter < 160.0) - num34 = num5 - 5; - else if (this.frameCounter == 160.0 && Main.netMode != 1) - time = 75; - else - num34 = this.frameCounter >= 220.0 ? (this.frameCounter >= 226.0 ? 0 : num5 - 5) : num5 - 4; - if (flag && time != -1) - { - int num35 = (int) this.localAI[2]; - int num36 = (int) this.localAI[3]; - int num37 = (int) Main.npc[(int) this.ai[2]].localAI[3]; - int num38 = (int) Main.npc[(int) this.ai[2]].localAI[2]; - int num39 = 3 - num35 - num36; - int num40 = 0; - if (this.frameCounter == 40.0) - num40 = 1; - if (this.frameCounter == 100.0) - num40 = 2; - if (this.frameCounter == 160.0) - num40 = 3; - int num41 = 3 - num40; - int num42 = -1; - int num43 = 0; - while (num42 < 0 && ++num43 < 100) - { - num42 = Main.rand.Next(2); - if (num42 == 0 && num38 >= num36) - num42 = -1; - if (num42 == 1 && num37 >= num35) - num42 = -1; - if (num42 == -1 && num41 <= num39) - num42 = 2; - } - if (num42 == 0) - { - ++Main.npc[(int) this.ai[2]].localAI[3]; - ++num37; - } - if (num42 == 1) - { - ++Main.npc[(int) this.ai[2]].localAI[2]; - ++num38; - } - int emoticon1 = Utils.SelectRandom(Main.rand, 38, 37, 36); - int emoticon2 = emoticon1; - if (num42 == 0) - { - switch (emoticon1) - { - case 36: - emoticon2 = 38; - break; - case 37: - emoticon2 = 36; - break; - case 38: - emoticon2 = 37; - break; - } - } - else if (num42 == 1) - { - switch (emoticon1) - { - case 36: - emoticon2 = 37; - break; - case 37: - emoticon2 = 38; - break; - case 38: - emoticon2 = 36; - break; - } - } - if (num41 == 0) - { - if (num37 >= 2) - emoticon1 -= 3; - if (num38 >= 2) - emoticon2 -= 3; - } - EmoteBubble.NewBubble(emoticon1, new WorldUIAnchor((Entity) this), time); - EmoteBubble.NewBubble(emoticon2, new WorldUIAnchor((Entity) Main.npc[(int) this.ai[2]]), time); - } - this.frame.Y = num1 * (flag ? num34 : num34); - if (this.frameCounter >= 420.0) - { - this.frameCounter = 0.0; - break; - } - break; - default: - if (num33 != 0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - goto case 1; - } - else - goto case 1; - } - } - else - { - if ((double) this.velocity.X == 0.0) - { - if (this.type == 638) - { - int num44 = this.frame.Y / num1; - if (num44 > 7) - num44 = 0; - ++this.frameCounter; - if (this.frameCounter > 4.0) - { - this.frameCounter = 0.0; - ++num44; - if (num44 > 7) - num44 = 0; - } - this.frame.Y = num44 * num1; - break; - } - if (this.type == 140 || this.type == 489) - { - this.frame.Y = num1; - this.frameCounter = 0.0; - break; - } - this.frame.Y = 0; - this.frameCounter = 0.0; - break; - } - int num45 = 6; - if (this.type == 632) - num45 = 12; - if (this.type == 534) - num45 = 12; - if (this.type == 638) - num45 = 12; - if (this.type == 656) - num45 = 12; - if (this.type == 489) - { - num45 = 8; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.0; - this.frameCounter += 0.5; - } - else - { - this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; - ++this.frameCounter; - } - if (this.type == 462) - num45 = 9; - int num46 = num1 * 2; - if (this.type == 638) - num46 = num1 * 9; - if (this.type == 656) - num46 = num1; - if (this.frame.Y < num46) - this.frame.Y = num46; - if (this.frameCounter > (double) num45) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type] - num4) - { - this.frame.Y = num46; - break; - } - break; - } - } - } - else - { - if (this.type == 462) - { - this.frameCounter = 0.0; - this.frame.Y = (double) this.velocity.Y >= 0.0 ? num1 * 2 : num1; - break; - } - this.frameCounter = 0.0; - this.frame.Y = num1; - if (this.type == 489 || this.type == 21 || this.type == 31 || this.type == 294 || this.type == 326 || this.type == 295 || this.type == 296 || this.type == 44 || this.type == 77 || this.type == 120 || this.type == 140 || this.type == 159 || this.type == 167 || this.type == 197 || this.type == 201 || this.type == 202) - this.frame.Y = 0; - if (this.type == 638) - { - this.frame.Y = num1 * 8; - break; - } - break; - } - break; - case 24: - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - } - if ((double) this.ai[1] > 0.0) - { - if (this.frame.Y < 4) - this.frameCounter = 0.0; - ++this.frameCounter; - if (this.frameCounter <= 4.0) - { - this.frame.Y = num1 * 4; - break; - } - if (this.frameCounter <= 8.0) - { - this.frame.Y = num1 * 5; - break; - } - if (this.frameCounter <= 12.0) - { - this.frame.Y = num1 * 6; - break; - } - if (this.frameCounter <= 16.0) - { - this.frame.Y = num1 * 7; - break; - } - if (this.frameCounter <= 20.0) - { - this.frame.Y = num1 * 8; - break; - } - this.frame.Y = num1 * 9; - this.frameCounter = 100.0; - break; - } - ++this.frameCounter; - if (this.frameCounter <= 4.0) - { - this.frame.Y = 0; - break; - } - if (this.frameCounter <= 8.0) - { - this.frame.Y = num1; - break; - } - if (this.frameCounter <= 12.0) - { - this.frame.Y = num1 * 2; - break; - } - this.frame.Y = num1 * 3; - if (this.frameCounter >= 16.0) - { - this.frameCounter = 0.0; - break; - } - break; - case 29: - case 32: - case 45: - case 172: - case 281: - case 282: - case 283: - case 284: - case 285: - case 286: - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - } - this.frame.Y = 0; - if ((double) this.velocity.Y != 0.0) - { - this.frame.Y += num1 * 2; - break; - } - if ((double) this.ai[1] > 0.0) - { - this.frame.Y += num1; - break; - } - break; - case 34: - ++this.frameCounter; - if (this.frameCounter >= 4.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - case 42: - case 231: - case 232: - case 233: - case 234: - case 235: - ++this.frameCounter; - if (this.frameCounter < 2.0) - { - this.frame.Y = 0; - break; - } - if (this.frameCounter < 4.0) - { - this.frame.Y = num1; - break; - } - if (this.frameCounter < 6.0) - { - this.frame.Y = num1 * 2; - break; - } - if (this.frameCounter < 8.0) - { - this.frame.Y = num1; - break; - } - this.frameCounter = 0.0; - break; - case 43: - case 56: - case 175: - ++this.frameCounter; - if (this.frameCounter < 6.0) - this.frame.Y = 0; - else if (this.frameCounter < 12.0) - this.frame.Y = num1; - else if (this.frameCounter < 18.0) - this.frame.Y = num1 * 2; - else if (this.frameCounter < 24.0) - this.frame.Y = num1; - if (this.frameCounter == 23.0) - { - this.frameCounter = 0.0; - break; - } - break; - case 46: - case 47: - case 303: - case 337: - case 443: - case 464: - case 540: - case 614: - case 646: - case 647: - case 648: - case 649: - case 650: - case 651: - case 652: - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.0; - ++this.frameCounter; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - } - if ((double) this.velocity.Y < 0.0) { this.frameCounter = 0.0; this.frame.Y = num1 * 4; - break; } - if ((double) this.velocity.Y > 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = num1 * 6; - break; - } - break; - case 48: - case 49: - case 51: - case 60: - case 82: - case 93: - case 137: - case 182: - case 210: - case 211: - case 253: - case 316: - case 634: - case 662: - if (this.type == 60) - { - int index = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, Scale: 2f); - Main.dust[index].noGravity = true; - } - if (this.type == 634 && Main.rand.Next(10) == 0) - { - int index = Dust.NewDust(this.position, this.width, this.height, 165, this.velocity.X, this.velocity.Y, 50); - Main.dust[index].velocity *= 0.1f; - Main.dust[index].noGravity = true; - } - if ((double) this.velocity.X > 0.0) - this.spriteDirection = 1; - if ((double) this.velocity.X < 0.0) - this.spriteDirection = -1; - this.rotation = this.velocity.X * 0.1f; - if (this.type == 210 || this.type == 211) - { - ++this.frameCounter; - this.rotation = this.velocity.X * 0.2f; - } - ++this.frameCounter; - int num47 = 6; - int num48 = Main.npcFrameCount[this.type]; - if (this.type == 49 || this.type == 51 || this.type == 60 || this.type == 634) - --num48; - if (this.type == 48) - num47 = 5; - if (this.frameCounter >= (double) num47) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y >= num1 * num48) - { - this.frame.Y = 0; - break; - } - break; - case 50: - if ((double) this.velocity.Y != 0.0) - { - if (this.frame.Y < num1 * 4) - { - this.frame.Y = num1 * 4; - this.frameCounter = 0.0; - } - if (++this.frameCounter >= 4.0) - { - this.frame.Y = num1 * 5; - break; - } - break; - } - if (this.frame.Y >= num1 * 5) - { - this.frame.Y = num1 * 4; - this.frameCounter = 0.0; - } - ++this.frameCounter; - if (num2 > 0) - ++this.frameCounter; - if (num2 == 4) - ++this.frameCounter; - if (this.frameCounter >= 8.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - if (this.frame.Y >= num1 * 4) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 55: - case 57: - case 58: - case 102: - case 241: - case 465: - case 592: - case 607: - this.spriteDirection = this.direction; - ++this.frameCounter; - if (this.wet) - { - if (this.frameCounter < 6.0) - { - this.frame.Y = 0; - break; - } - if (this.frameCounter < 12.0) - { - this.frame.Y = num1; - break; - } - if (this.frameCounter < 18.0) - { - this.frame.Y = num1 * 2; - break; - } - if (this.frameCounter < 24.0) - { - this.frame.Y = num1 * 3; - break; - } - this.frameCounter = 0.0; - break; - } - if (this.frameCounter < 6.0) - { - this.frame.Y = num1 * 4; - break; - } - if (this.frameCounter < 12.0) - { - this.frame.Y = num1 * 5; - break; - } - this.frameCounter = 0.0; - break; - case 61: - this.spriteDirection = this.direction; - this.rotation = this.velocity.X * 0.1f; - if ((double) this.velocity.X == 0.0 && (double) this.velocity.Y == 0.0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - break; - } - int num49 = 5; - int num50 = 5; - ++this.frameCounter; - if (this.frameCounter >= (double) (num49 * num50)) - this.frameCounter = 0.0; - this.frame.Y = ((int) (this.frameCounter / (double) num49) + 1) * num1; - break; - case 62: - case 66: - this.spriteDirection = this.direction; - this.rotation = this.velocity.X * 0.1f; - int num51 = 5; - int num52 = 5; - ++this.frameCounter; - if (this.frameCounter >= (double) (num51 * num52)) - this.frameCounter = 0.0; - this.frame.Y = (int) (this.frameCounter / (double) num51) * num1; - break; - case 63: - case 64: - case 103: - case 242: - case 256: - if ((this.type == 63 || this.type == 64 || this.type == 103 || this.type == 242) && (double) this.ai[1] == 1.0) - { - ++this.frameCounter; - if (this.frameCounter > 4.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - } - if (this.frame.Y > num1 * 6) - this.frame.Y = num1 * 4; - if (this.frame.Y >= num1 * 4) - return; - this.frame.Y = num1 * 4; - return; - } - ++this.frameCounter; - if (this.frameCounter < 6.0) - { - this.frame.Y = 0; - break; - } - if (this.frameCounter < 12.0) - { - this.frame.Y = num1; - break; - } - if (this.frameCounter < 18.0) - { - this.frame.Y = num1 * 2; - break; - } - this.frame.Y = num1 * 3; - if (this.frameCounter >= 23.0) - { - this.frameCounter = 0.0; - break; - } - break; - case 65: - this.spriteDirection = this.direction; - ++this.frameCounter; - if (this.wet && this.type == 65) - { - if (this.frameCounter < 6.0) - { - this.frame.Y = 0; - break; - } - if (this.frameCounter < 12.0) - { - this.frame.Y = num1; - break; - } - if (this.frameCounter < 18.0) - { - this.frame.Y = num1 * 2; - break; - } - if (this.frameCounter < 24.0) - { - this.frame.Y = num1 * 3; - break; - } - this.frameCounter = 0.0; - break; - } - break; - case 67: - case 217: - case 218: - case 219: - if ((double) this.velocity.Y == 0.0) - this.spriteDirection = this.direction; - ++this.frameCounter; - if (this.frameCounter >= 6.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 69: - if ((double) this.ai[0] < 190.0) - { - ++this.frameCounter; - if (this.frameCounter >= 6.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type] - 1) - { - this.frame.Y = 0; - break; - } - break; - } - break; - } - this.frameCounter = 0.0; - this.frame.Y = num1 * (Main.npcFrameCount[this.type] - 1); - break; - case 72: - ++this.frameCounter; - if (this.frameCounter >= 3.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 74: - case 297: - case 298: - case 442: - this.spriteDirection = this.direction; - this.rotation = this.velocity.X * 0.1f; - if ((double) this.velocity.X == 0.0 && (double) this.velocity.Y == 0.0) - { - this.frame.Y = num1 * 4; - this.frameCounter = 0.0; - break; - } - int num53 = Main.npcFrameCount[this.type] - 1; - ++this.frameCounter; - if (this.frameCounter >= 4.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y >= num1 * num53) - { - this.frame.Y = 0; - break; - } - break; - case 75: - this.spriteDirection = (double) this.velocity.X <= 0.0 ? -1 : 1; - this.rotation = this.velocity.X * 0.1f; - ++this.frameCounter; - if (this.frameCounter >= 4.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - case 83: - case 84: - case 179: - if ((double) this.ai[0] == 2.0) - { - this.frameCounter = 0.0; - this.frame.Y = 0; - break; - } - ++this.frameCounter; - if (this.frameCounter >= 4.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 85: - case 341: - case 629: - if ((double) this.ai[0] == 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = 0; - } - else - { - int num54 = 3; - if ((double) this.velocity.Y == 0.0) - --this.frameCounter; - else - ++this.frameCounter; - if (this.frameCounter < 0.0) - this.frameCounter = 0.0; - if (this.frameCounter > (double) (num54 * 4)) - this.frameCounter = (double) (num54 * 4); - if (this.frameCounter < (double) num54) - this.frame.Y = num1; - else if (this.frameCounter < (double) (num54 * 2)) - this.frame.Y = num1 * 2; - else if (this.frameCounter < (double) (num54 * 3)) - this.frame.Y = num1 * 3; - else if (this.frameCounter < (double) (num54 * 4)) - this.frame.Y = num1 * 4; - else if (this.frameCounter < (double) (num54 * 5)) - this.frame.Y = num1 * 5; - else if (this.frameCounter < (double) (num54 * 6)) - this.frame.Y = num1 * 4; - else if (this.frameCounter < (double) (num54 * 7)) - { - this.frame.Y = num1 * 3; - } - else - { - this.frame.Y = num1 * 2; - if (this.frameCounter >= (double) (num54 * 8)) - this.frameCounter = (double) num54; - } - } - if ((double) this.ai[3] == 2.0 || this.IsABestiaryIconDummy && this.type == 85) - { - this.frame.Y += num1 * 6; - break; - } - if ((double) this.ai[3] == 3.0) - { - this.frame.Y += num1 * 12; - break; - } - break; - case 86: - if ((double) this.velocity.Y == 0.0 || this.wet) - this.spriteDirection = (double) this.velocity.X >= -2.0 ? ((double) this.velocity.X <= 2.0 ? this.direction : 1) : -1; - if ((double) this.velocity.Y != 0.0) - { - this.frame.Y = num1 * 15; - this.frameCounter = 0.0; - break; - } - if ((double) this.velocity.X == 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = 0; - break; - } - if ((double) Math.Abs(this.velocity.X) < 3.0) - { - this.frameCounter += (double) Math.Abs(this.velocity.X); - if (this.frameCounter >= 6.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y / num1 >= 9) - this.frame.Y = num1; - if (this.frame.Y / num1 <= 0) - { - this.frame.Y = num1; - break; - } - break; - } - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X); - if (this.frameCounter >= 10.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y / num1 >= 15) - this.frame.Y = num1 * 9; - if (this.frame.Y / num1 <= 8) - { - this.frame.Y = num1 * 9; - break; - } - break; - } - break; - case 94: - ++this.frameCounter; - if (this.frameCounter < 6.0) - { - this.frame.Y = 0; - break; - } - if (this.frameCounter < 12.0) - { - this.frame.Y = num1; - break; - } - if (this.frameCounter < 18.0) - { - this.frame.Y = num1 * 2; - break; - } - this.frame.Y = num1; - if (this.frameCounter >= 23.0) - { - this.frameCounter = 0.0; - break; - } - break; - case 101: - ++this.frameCounter; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1 * 2; - this.frameCounter = 0.0; - } - if (this.frame.Y > num1 * 2) - { - this.frame.Y = 0; - break; - } - break; - case 109: - if ((double) this.velocity.Y == 0.0 && ((double) this.velocity.X <= 0.0 && this.direction < 0 || (double) this.velocity.X >= 0.0 && this.direction > 0)) - this.spriteDirection = this.direction; - this.frameCounter += (double) Math.Abs(this.velocity.X); - if (this.frameCounter >= 7.0) - { - this.frameCounter -= 7.0; - this.frame.Y += num1; - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 110: - case 214: - case 215: - case 216: - case 293: - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - if ((double) this.ai[2] > 0.0) - { - this.spriteDirection = this.direction; - this.frame.Y = num1 * (int) this.ai[2]; - this.frameCounter = 0.0; - break; - } - if (this.frame.Y < num1 * 6) - this.frame.Y = num1 * 6; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; - this.frameCounter += (double) this.velocity.X; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = num1 * 6; - break; - } - break; - } - this.frameCounter = 0.0; - this.frame.Y = 0; - break; - case 111: - case 291: - case 292: - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - if ((double) this.ai[2] > 0.0) - { - this.spriteDirection = this.direction; - this.frame.Y = num1 * ((int) this.ai[2] - 1); - this.frameCounter = 0.0; - break; - } - if (this.frame.Y < num1 * 7) - this.frame.Y = num1 * 7; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; - this.frameCounter += (double) this.velocity.X * 1.29999995231628; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = num1 * 7; - break; - } - break; - } - this.frameCounter = 0.0; - this.frame.Y = num1 * 6; - break; - case 113: - case 114: - if ((double) this.ai[2] == 0.0) - { - ++this.frameCounter; - if (this.frameCounter >= 12.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - } - this.frame.Y = 0; - this.frameCounter = -60.0; - break; - case 115: - ++this.frameCounter; - if (this.frameCounter < 3.0) - this.frame.Y = 0; - else if (this.frameCounter < 6.0) - this.frame.Y = num1; - else if (this.frameCounter < 12.0) - this.frame.Y = num1 * 2; - else if (this.frameCounter < 15.0) - this.frame.Y = num1; - if (this.frameCounter == 15.0) - { - this.frameCounter = 0.0; - break; - } - break; - case 116: - if ((double) this.velocity.X > 0.0) - { - this.spriteDirection = 1; - this.rotation = (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X); - } - if ((double) this.velocity.X < 0.0) - { - this.spriteDirection = -1; - this.rotation = (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X) + 3.14f; - } - ++this.frameCounter; - if (this.frameCounter >= 5.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - case 122: - this.spriteDirection = this.direction; - this.rotation = this.velocity.X * 0.05f; - if ((double) this.ai[3] > 0.0) - { - int num55 = (int) ((double) this.ai[3] / 8.0); - this.frameCounter = 0.0; - this.frame.Y = (num55 + 3) * num1; - break; - } - ++this.frameCounter; - if (this.frameCounter >= 8.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y >= num1 * 3) - { - this.frame.Y = 0; - break; - } - break; - case (int) sbyte.MaxValue: - if ((double) this.ai[1] == 0.0) - { - ++this.frameCounter; - if (this.frameCounter >= 12.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y / num1 >= 2) - { - this.frame.Y = 0; - break; - } - break; - } - break; - } - this.frameCounter = 0.0; - this.frame.Y = num1 * 2; - break; - case 129: - if ((double) this.velocity.Y == 0.0) - this.spriteDirection = this.direction; - ++this.frameCounter; - if (this.frameCounter >= 2.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 130: - if ((double) this.velocity.Y == 0.0) - this.spriteDirection = this.direction; - ++this.frameCounter; - if (this.frameCounter >= 8.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 133: - if ((double) this.velocity.X > 0.0) - { - this.spriteDirection = 1; - this.rotation = (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X); - } - if ((double) this.velocity.X < 0.0) - { - this.spriteDirection = -1; - this.rotation = (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X) + 3.14f; - } - ++this.frameCounter; - this.frame.Y = this.frameCounter < 8.0 ? 0 : num1; - if (this.frameCounter >= 16.0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - } - if ((double) this.life < (double) this.lifeMax * 0.5) - { - this.frame.Y += num1 * 2; - break; - } - break; - case 135: - this.frame.Y = (double) this.ai[2] != 0.0 ? num1 : 0; - break; - case 141: - this.spriteDirection = this.direction; - if ((double) this.velocity.Y != 0.0) - { - this.frame.Y = num1 * 2; - break; - } - ++this.frameCounter; - if (this.frameCounter >= 8.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y > num1) - { - this.frame.Y = 0; - break; - } - break; - case 143: - if ((double) this.velocity.Y > 0.0) - ++this.frameCounter; - else if ((double) this.velocity.Y < 0.0) - --this.frameCounter; - if (this.frameCounter < 6.0) - this.frame.Y = num1; - else if (this.frameCounter < 12.0) - this.frame.Y = num1 * 2; - else if (this.frameCounter < 18.0) - this.frame.Y = num1 * 3; - if (this.frameCounter < 0.0) - this.frameCounter = 0.0; - if (this.frameCounter > 17.0) - { - this.frameCounter = 17.0; - break; - } - break; - case 144: - if ((double) this.velocity.X == 0.0 && (double) this.velocity.Y == 0.0) - { - ++this.localAI[3]; - if ((double) this.localAI[3] < 6.0) - this.frame.Y = 0; - else if ((double) this.localAI[3] < 12.0) - this.frame.Y = num1; - if ((double) this.localAI[3] >= 11.0) - { - this.localAI[3] = 0.0f; - break; - } - break; - } - if ((double) this.velocity.Y > 0.0) - ++this.frameCounter; - else if ((double) this.velocity.Y < 0.0) - --this.frameCounter; - if (this.frameCounter < 6.0) - this.frame.Y = num1 * 2; - else if (this.frameCounter < 12.0) - this.frame.Y = num1 * 3; - else if (this.frameCounter < 18.0) - this.frame.Y = num1 * 4; - if (this.frameCounter < 0.0) - this.frameCounter = 0.0; - if (this.frameCounter > 17.0) - { - this.frameCounter = 17.0; - break; - } - break; - case 145: - if ((double) this.velocity.X == 0.0 && (double) this.velocity.Y == 0.0) - { - if ((double) this.ai[2] < 4.0) - { - this.frame.Y = 0; - break; - } - if ((double) this.ai[2] < 8.0) - { - this.frame.Y = num1; - break; - } - if ((double) this.ai[2] < 12.0) - { - this.frame.Y = num1 * 2; - break; - } - if ((double) this.ai[2] < 16.0) - { - this.frame.Y = num1 * 3; - break; - } - break; - } - if ((double) this.velocity.Y > 0.0) - ++this.frameCounter; - else if ((double) this.velocity.Y < 0.0) - --this.frameCounter; - if (this.frameCounter < 6.0) - this.frame.Y = num1 * 4; - else if (this.frameCounter < 12.0) - this.frame.Y = num1 * 5; - else if (this.frameCounter < 18.0) - this.frame.Y = num1 * 6; - if (this.frameCounter < 0.0) - this.frameCounter = 0.0; - if (this.frameCounter > 17.0) - { - this.frameCounter = 17.0; - break; - } - break; - case 148: - case 149: - case 168: - case 470: - int num56 = 0; - if ((double) this.localAI[0] == 2.0) - num56 = 3; - if ((double) this.localAI[0] == 3.0) - num56 = 6; - if ((double) this.localAI[0] == 4.0) - num56 = 9; - int num57 = num56 * num1; - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = num57; - this.frameCounter = 0.0; - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.0; - if (this.frameCounter < 6.0) - { - this.frame.Y = num57; - break; - } - if (this.frameCounter < 12.0) - { - this.frame.Y = num1 + num57; - break; - } - if (this.frameCounter < 15.0) - { - this.frame.Y = num1 * 2 + num57; - break; - } - this.frameCounter = 0.0; - this.frame.Y = num1 * 2 + num57; - break; - } - if ((double) this.velocity.Y < 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = num1 * 2 + num57; - break; - } - if ((double) this.velocity.Y > 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = num1 * 2 + num57; - break; - } - break; - case 150: - case 151: - case 152: - case 158: - case 226: - if (this.type == 151) - { - int index = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, Scale: 2f); - Main.dust[index].noGravity = true; - } - if (this.type == 150 && Main.rand.Next(10) == 0) - { - int index = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 67, this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 90, Scale: 1.5f); - Main.dust[index].noGravity = true; - Main.dust[index].velocity *= 0.2f; - Main.dust[index].noLight = true; - } - if ((double) this.velocity.X > 0.0) - this.spriteDirection = 1; - if ((double) this.velocity.X < 0.0) - this.spriteDirection = -1; - this.rotation = this.velocity.X * 0.1f; - ++this.frameCounter; - if (this.frameCounter >= 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y >= num1 * 4) - { - this.frame.Y = 0; - break; - } - break; - case 155: - int num58 = this.frame.Y / num1; - if (this.IsABestiaryIconDummy && num58 < 3) - num58 = 3; - if ((double) this.velocity.Y < 0.0) - num58 = 10; - else if ((double) this.velocity.Y > 0.0) - num58 = 11; else if ((double) this.velocity.X == 0.0) { - num58 = 0; this.frameCounter = 0.0; - } - else if ((this.direction > 0 && (double) this.velocity.X < 0.0 || this.direction < 0 && (double) this.velocity.X > 0.0) && (double) Math.Abs(this.velocity.X) < 4.0) - { - this.spriteDirection = this.direction; - if (num58 > 2) - { - num58 = 0; - this.frameCounter = 0.0; - } - if (num58 < 2) - { - ++this.frameCounter; - if (this.frameCounter > 5.0) - { - this.frameCounter = 0.0; - ++num58; - } - } - else - this.frameCounter = 0.0; - } - else - { - this.spriteDirection = (double) this.velocity.X < 0.0 ? -1 : 1; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 0.400000005960464; - if (num58 == 10 || num58 == 11) - { - num58 = 12; - this.frameCounter = 0.0; - } - else if (this.frameCounter > 8.0) - { - this.frameCounter -= 8.0; - ++num58; - if (num58 > 9) - num58 = 3; - } - } - this.frame.Y = num58 * num1; - break; - case 156: - this.spriteDirection = this.direction; - this.rotation = this.velocity.X * 0.1f; - ++this.frameCounter; - if (this.frameCounter >= 20.0) - this.frameCounter = 0.0; - this.frame.Y = (int) this.frameCounter / 4 * num1; - break; - case 157: - this.spriteDirection = this.direction; - ++this.frameCounter; - if (!this.wet) - ++this.frameCounter; - int num59 = 5; - if (this.frameCounter < (double) num59) - { - this.frame.Y = 0; - break; - } - if (this.frameCounter < (double) (num59 * 2)) - { - this.frame.Y = num1; - break; - } - if (this.frameCounter < (double) (num59 * 3)) - { - this.frame.Y = num1 * 2; - break; - } - if (this.frameCounter < (double) (num59 * 4)) - { - this.frame.Y = num1; - break; - } - if (this.frameCounter < (double) (num59 * 5)) - { - this.frame.Y = num1 * 3; - break; - } - if (this.frameCounter < (double) (num59 * 6)) - { - this.frame.Y = num1 * 4; - break; - } - if (this.frameCounter < (double) (num59 * 7)) - { - this.frame.Y = num1 * 5; - break; - } - if (this.frameCounter < (double) (num59 * 8)) - { - this.frame.Y = num1 * 4; - break; - } - this.frameCounter = 0.0; - break; - case 163: - if ((double) this.velocity.Y != 0.0) - { - this.frameCounter = -12.0; - this.frame.Y = (double) this.velocity.Y >= 0.0 ? num1 * 6 : num1 * 5; - break; - } - this.spriteDirection = this.direction; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.10000002384186; - if (this.frameCounter < -6.0) - { this.frame.Y = num1 * 6; - break; } - if (this.frameCounter < 0.0) - { - this.frame.Y = num1 * 7; - break; - } - if (this.frameCounter < 6.0) - { - this.frame.Y = num1; - break; - } - if (this.frameCounter < 12.0) - { - this.frame.Y = num1 * 2; - break; - } - if (this.frameCounter < 18.0) - { - this.frame.Y = num1 * 3; - break; - } - this.frameCounter = 0.0; - break; - case 164: - case 239: - case 530: - if ((double) this.velocity.Y != 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = (double) this.velocity.Y >= 0.0 ? 0 : num1 * 4; - break; - } - this.spriteDirection = this.direction; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.10000002384186; - if (this.frameCounter < 6.0) - { - this.frame.Y = num1; - break; - } - if (this.frameCounter < 12.0) - { - this.frame.Y = num1 * 2; - break; - } - if (this.frameCounter < 18.0) - { - this.frame.Y = num1 * 3; - break; - } - this.frameCounter = 0.0; - break; - case 165: - case 237: - case 238: - case 240: - case 531: - float num60 = 0.5f; - if (this.type == 531) - num60 = 0.4f; - this.frameCounter += ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y)) * (double) num60; - if (this.frameCounter < 6.0) - { - this.frame.Y = 0; - break; - } - if (this.frameCounter < 12.0) - { - this.frame.Y = num1; - break; - } - if (this.frameCounter < 18.0) - { - this.frame.Y = num1 * 2; - break; - } - if (this.frameCounter < 24.0) - { - this.frame.Y = num1 * 3; - break; - } - this.frameCounter = 0.0; - break; - case 166: - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - if ((double) this.velocity.X == 0.0) - { - this.frameCounter += 2.0; - if (this.frameCounter > 7.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 > 5) - { - this.frame.Y = 0; - break; - } - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X); - ++this.frameCounter; - if (this.frameCounter > 9.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 > 12) - this.frame.Y = num1 * 7; - if (this.frame.Y / num1 < 7) - { - this.frame.Y = num1 * 7; - break; - } - break; - } - this.frameCounter = 0.0; - this.frame.Y = num1 * 6; - break; - case 170: - case 171: - case 180: - this.spriteDirection = this.direction; - ++this.frameCounter; - if (this.frameCounter >= 4.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y >= num1 * 14) - { - this.frame.Y = 0; - break; - } - break; - case 174: - if (this.IsABestiaryIconDummy) - { - ++this.frameCounter; - if (this.frameCounter > 5.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - } - if (this.frame.Y > num1 * 4) - { - this.frame.Y = 0; - break; - } - break; - } - this.frame.Y = (double) this.velocity.Y != 0.0 ? ((double) this.velocity.Y >= -1.5 ? ((double) this.velocity.Y <= 1.5 ? num1 * 2 : num1 * 3) : num1) : 0; - break; - case 176: - ++this.frameCounter; - if (this.frameCounter > 4.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y > num1) - { - this.frame.Y = 0; - break; - } - break; - case 177: - if ((double) this.velocity.Y == 0.0) - { - ++this.frameCounter; - if (this.frameCounter >= 10.0) - { - this.frameCounter = 30.0; - this.frame.Y = 0; - break; - } - this.frame.Y = num1; - break; - } - if ((double) this.velocity.Y < 0.0) - { - this.frame.Y = num1 * 2; - break; - } - this.frameCounter = 0.0; - this.frame.Y = num1 * 2; - break; - case 195: - this.frame.Y = (double) this.ai[0] >= 3.0 ? ((double) this.ai[0] >= 6.0 ? ((double) this.ai[0] >= 9.0 ? ((double) this.ai[0] >= 12.0 ? ((double) this.ai[0] >= 15.0 ? num1 * 5 : num1 * 4) : num1 * 3) : num1 * 2) : num1) : 0; - break; - case 199: - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - } - if (this.frame.Y < num1 * 3) - { - ++this.frameCounter; - if (this.frameCounter > 6.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - break; - } - break; - } - if ((double) this.velocity.Y == 0.0) + else { this.frameCounter += (double) Math.Abs(this.velocity.X); - if (this.frameCounter > 12.0) - { + if (this.frameCounter >= 56.0 || this.frameCounter < 0.0) this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y > num1 * 7) - { - this.frame.Y = num1 * 3; - break; - } - break; - } - break; + this.frame.Y = num1 * (int) (this.frameCounter / 8.0); } - break; - case 205: - this.frameCounter += 0.5; - if (this.frameCounter < 2.0) - { - this.frame.Y = 0; - break; - } - if (this.frameCounter < 4.0) - { - this.frame.Y = num1; - break; - } - if (this.frameCounter < 6.0) - { - this.frame.Y = num1 * 2; - break; - } - if (this.frameCounter < 8.0) - { - this.frame.Y = num1; - break; - } - this.frameCounter = 0.0; - break; - case 206: - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - if ((double) this.ai[2] > 0.0) - { - this.spriteDirection = this.direction; - this.frame.Y = num1 * (int) this.ai[2]; - this.frameCounter = 0.0; - break; - } - if (this.frame.Y < num1 * 6) - this.frame.Y = num1 * 6; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; - this.frameCounter += (double) this.velocity.X; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = num1 * 6; - break; - } - break; - } - this.frameCounter = 0.0; - this.frame.Y = 0; - break; - case 220: - if ((double) this.velocity.Y == 0.0) - this.spriteDirection = this.direction; - ++this.frameCounter; - if (this.frameCounter >= 10.0) - { + } + } + else if (this.type == 551) + { + int num33 = this.frame.Y / num1; + int num34; + if ((double) this.ai[0] == 4.0) + { + float num35 = 60f; + int num36 = 6 * 10; + if (num33 < 5) this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 221: - if ((double) this.localAI[2] == 1.0) - { - if ((double) this.localAI[0] == 1.0) - { - this.frame.Y = 0; - this.localAI[0] = 0.0f; - } - ++this.frameCounter; - if (this.frameCounter >= 8.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) - { - this.frame.Y = num1 * Main.npcFrameCount[this.type] - num1; - break; - } - break; - } - ++this.frameCounter; - if (this.frameCounter >= 13.0) - { - this.frame.Y += num1; + num34 = 5; + this.frameCounter = (double) (int) this.ai[1]; + int num37 = 0; + int num38; + if (this.frameCounter >= (double) (5 * (num38 = num37 + 1))) + num34 = 6; + num38 = 0; + if (this.frameCounter >= (double) num35 - 6.0) + num34 = 7; + if (this.frameCounter >= (double) num35 - 3.0) + num34 = 8; + if (this.frameCounter >= (double) num35) + num34 = 9 + (int) this.frameCounter / 3 % 2; + int num39 = 0; + if (this.frameCounter >= (double) num35 + (double) num36 + 3.0) + num34 = 8; + int num40; + if (this.frameCounter >= (double) num35 + (double) num36 + 3.0 + (double) (5 * (num40 = num39 + 1))) + num34 = 7; + if (this.frameCounter >= (double) num35 + (double) num36 + 3.0 + (double) (5 * (num38 = num40 + 1))) + num34 = 0; + } + else if ((double) this.ai[0] == 3.0) + { + float num41 = 40f; + float num42 = 80f; + float num43 = num41 + num42; + float num44 = 25f; + if (num33 < 5) this.frameCounter = 0.0; - } - if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - case 222: - ++this.frameCounter; - if ((double) this.localAI[0] == 1.0) - { - if (this.frameCounter > 4.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y >= num1 * 4) - { - this.frame.Y = 0; - break; - } - break; - } - if (this.frameCounter > 4.0) - { - this.frame.Y += num1; + num34 = 5; + this.frameCounter = (double) (int) this.ai[1]; + int num45 = 0; + int num46; + if (this.frameCounter >= (double) (5 * (num46 = num45 + 1))) + num34 = 6; + num46 = 0; + if (this.frameCounter >= (double) num41 - 6.0) + num34 = 7; + if (this.frameCounter >= (double) num41 - 3.0) + num34 = 8; + if (this.frameCounter >= (double) num41) + num34 = 9 + (int) this.frameCounter / 3 % 2; + int num47 = 0; + if (this.frameCounter >= (double) num43 - (double) num44 + 3.0) + num34 = 8; + int num48; + if (this.frameCounter >= (double) num43 - (double) num44 + 3.0 + (double) (5 * (num48 = num47 + 1))) + num34 = 7; + if (this.frameCounter >= (double) num43 - (double) num44 + 3.0 + (double) (5 * (num46 = num48 + 1))) + num34 = 0; + } + else if ((double) this.ai[0] == 5.0) + num34 = 3; + else if ((double) this.ai[0] == 6.0) + { + if (num33 > 4) this.frameCounter = 0.0; - } - if (this.frame.Y < num1 * 4) - this.frame.Y = num1 * 4; - if (this.frame.Y >= num1 * 12) - { - this.frame.Y = num1 * 4; - break; - } - break; - case 224: - case 587: - if ((double) this.velocity.X > 0.0) - { - this.spriteDirection = 1; - this.rotation = this.velocity.Y * 0.2f; - } - if ((double) this.velocity.X < 0.0) - { - this.spriteDirection = -1; - this.rotation = (float) (-(double) this.velocity.Y * 0.200000002980232); - } - ++this.frameCounter; - if (this.frameCounter >= 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y >= num1 * 4) - { - this.frame.Y = 0; - break; - } - break; - case 230: - if ((double) this.velocity.Y == 0.0) - { - this.rotation = 0.0f; - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; - ++this.frameCounter; - if (this.frameCounter > 10.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - } - this.frameCounter = 0.0; - this.frame.Y = 0; - if ((double) this.velocity.Y > 4.0) - { - this.rotation -= this.velocity.Y * 0.01f; - break; - } - break; - case 236: - if ((double) this.velocity.Y == 0.0) - this.spriteDirection = this.direction; - else - this.frame.Y = 0; - this.frameCounter += (double) Math.Abs(this.velocity.X); - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y > num1 || (double) this.velocity.Y != 0.0) - { - this.frame.Y = 0; - break; - } - break; - case 243: - if (this.frameCounter < 0.0) - { - if ((double) this.velocity.Y == 0.0) - { - ++this.frameCounter; - if (this.frameCounter < -12.0) - { - if (this.frame.Y > num1 * 9) - { - this.frame.Y = num1 * 11; - break; - } - break; - } - if (this.frameCounter < -6.0) - { - if (this.frame.Y > num1 * 9) - { - this.frame.Y = num1 * 12; - break; - } - break; - } - if (this.frameCounter < 0.0) - { - this.frameCounter = 0.0; - if (this.frame.Y > num1 * 9) - { - this.frame.Y = num1 * 11; - break; - } - break; - } - break; - } - this.frameCounter = -18.0; - this.frame.Y = (double) this.velocity.Y >= 0.0 ? num1 * 13 : num1 * 14; - break; - } + num34 = 1; + this.frameCounter = (double) (int) this.ai[1]; + int num49 = 0; + int num50; + if (this.frameCounter >= (double) (8 * (num50 = num49 + 1))) + num34 = 2; + int num51; + if (this.frameCounter >= (double) (8 * (num51 = num50 + 1))) + num34 = 3; + int num52; + if (this.frameCounter >= (double) (8 * (num52 = num51 + 1))) + num34 = 4; + int num53; + if (this.frameCounter >= (double) (8 * (num53 = num52 + 1))) + num34 = 3; + int num54; + if (this.frameCounter >= (double) (8 * (num54 = num53 + 1))) + num34 = 4; + int num55; + if (this.frameCounter >= (double) (8 * (num55 = num54 + 1))) + num34 = 3; + int num56; + if (this.frameCounter >= (double) (8 * (num56 = num55 + 1))) + num34 = 2; + int num57; + if (this.frameCounter >= (double) (8 * (num57 = num56 + 1))) + num34 = 1; + int num58; + if (this.frameCounter >= (double) (8 * (num58 = num57 + 1))) + num34 = 0; + } + else + num34 = 0; + this.frame.Y = num1 * num34; + } + if (this.type == 552 || this.type == 553 || this.type == 554) + { + if ((double) this.ai[0] > 0.0) + { this.spriteDirection = this.direction; - this.frameCounter += (double) Math.Abs(this.velocity.X * 1.1f); - if (this.frameCounter >= 6.0) + if (this.frame.Y < num1 * 10 || this.frame.Y > num1 * 13 || (double) this.ai[1] == 29.0) { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y > num1 * 9) - this.frame.Y = 0; - } - if ((double) this.velocity.Y < -2.0 || (double) this.velocity.Y > 5.0) - { - this.frameCounter = -18.0; - break; - } - break; - case 244: - ++this.frameCounter; - if (num2 > 0) - ++this.frameCounter; - if (num2 == 4) - ++this.frameCounter; - if (this.frameCounter >= 8.0) - { - this.frame.Y += num1; + this.frame.Y = num1 * 10; this.frameCounter = 0.0; } - if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - case 245: - if ((double) this.ai[0] == 0.0) - { - this.frame.Y = (double) this.ai[1] >= -16.0 ? ((double) this.ai[1] >= -12.0 ? ((double) this.ai[1] >= -8.0 ? ((double) this.ai[1] >= -4.0 ? ((double) this.ai[1] >= 0.0 ? 0 : num1 * 4) : num1 * 3) : num1 * 2) : num1) : 0; - break; - } - if ((double) this.ai[0] == 1.0) - { - this.frame.Y = 1; - break; - } - break; - case 246: - if ((double) this.ai[0] == 0.0) - { - this.frame.Y = (double) this.localAI[0] != 1.0 ? 0 : num1; - break; - } - if ((double) this.ai[0] == 1.0) - { - this.frame.Y = (double) this.localAI[0] != 1.0 ? 0 : num1; - if ((double) this.localAI[1] == -1.0) - this.frame.Y += num1 * 4; - if ((double) this.localAI[1] == 1.0) - { - this.frame.Y += num1 * 2; - break; - } - break; - } - break; - case 249: - this.frame.Y = (double) this.localAI[0] != 1.0 ? 0 : num1; - if (++this.frameCounter >= 16.0) - { - this.frameCounter = 0.0; - break; - } - break; - case 250: - case 264: - case 268: - ++this.frameCounter; - if (this.frameCounter >= 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - case 252: - case 301: - if (this.type == 301) - { - if ((double) this.velocity.Y == 0.0) - { - this.spriteDirection = -this.direction; - } - else - { - if ((double) this.velocity.X > 0.5) - this.spriteDirection = -1; - if ((double) this.velocity.X < -0.5) - this.spriteDirection = 1; - } - } - else - { - if ((double) this.velocity.X > 0.5) - this.spriteDirection = 1; - if ((double) this.velocity.X < -0.5) - this.spriteDirection = -1; - } - this.rotation = this.velocity.X * 0.1f; - if ((double) this.velocity.X == 0.0 && (double) this.velocity.Y == 0.0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - break; - } - ++this.frameCounter; - if (this.frameCounter > 4.0) + if (++this.frameCounter >= 6.0 && this.frame.Y < num1 * 13) { this.frameCounter = 0.0; this.frame.Y += num1; } - if (this.frame.Y > num1 * 4 || this.frame.Y == 0) - { - this.frame.Y = num1; - break; - } - break; - case 257: + } + else + { if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - } + this.spriteDirection = this.direction; if ((double) this.velocity.Y != 0.0 || this.direction == -1 && (double) this.velocity.X > 0.0 || this.direction == 1 && (double) this.velocity.X < 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = num1 * 4; - break; - } - if ((double) this.velocity.X == 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = 0; - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X); - if (this.frameCounter < 8.0) - { - this.frame.Y = 0; - break; - } - if (this.frameCounter < 16.0) - { - this.frame.Y = num1; - break; - } - if (this.frameCounter < 24.0) - { - this.frame.Y = num1 * 2; - break; - } - if (this.frameCounter < 32.0) - { - this.frame.Y = num1 * 3; - break; - } - this.frameCounter = 0.0; - break; - case 258: - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - } - if ((double) this.velocity.Y != 0.0 || this.direction == -1 && (double) this.velocity.X > 0.0 || this.direction == 1 && (double) this.velocity.X < 0.0) - { - ++this.frameCounter; - if (this.frameCounter > 1.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y > num1 * 5 || this.frame.Y < num1 * 3) - { - this.frame.Y = num1 * 3; - break; - } - break; - } - if ((double) this.velocity.X == 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = 0; - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X); - if (this.frameCounter < 8.0) - { - this.frame.Y = 0; - break; - } - if (this.frameCounter < 16.0) - { - this.frame.Y = num1; - break; - } - if (this.frameCounter < 24.0) - { - this.frame.Y = num1 * 2; - break; - } - this.frameCounter = 0.0; - break; - case 262: - ++this.frameCounter; - if (this.frameCounter > 6.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - } - if (this.life > this.lifeMax / 2) - { - if (this.frame.Y > num1 * 3) - { - this.frame.Y = 0; - break; - } - break; - } - if (this.frame.Y < num1 * 4) - this.frame.Y = num1 * 4; - if (this.frame.Y > num1 * 7) - { - this.frame.Y = num1 * 4; - break; - } - break; - case 263: - if ((double) this.velocity.X == 0.0 && (double) this.velocity.Y == 0.0) - { - if (this.frame.Y > 0) - { - ++this.frameCounter; - if (this.frameCounter > 4.0) - { - this.frameCounter = 0.0; - this.frame.Y -= num1; - break; - } - break; - } - break; - } - if (this.frame.Y < 2) - { - ++this.frameCounter; - if (this.frameCounter > 4.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - break; - } - break; - } - break; - case 266: - ++this.frameCounter; - if (this.frameCounter > 6.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - } - if ((double) this.ai[0] >= 0.0) - { - if (this.frame.Y > num1 * 3) - { - this.frame.Y = 0; - break; - } - break; - } - if (this.frame.Y < num1 * 4) - this.frame.Y = num1 * 4; - if (this.frame.Y > num1 * 7) - { - this.frame.Y = num1 * 4; - break; - } - break; - case 269: - case 270: - case 271: - case 272: - case 273: - case 274: - case 275: - case 276: - case 277: - case 278: - case 279: - case 280: - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - if ((double) this.velocity.X == 0.0) - { - if (this.type == 140) - { - this.frame.Y = num1; - this.frameCounter = 0.0; - break; - } - this.frame.Y = 0; - this.frameCounter = 0.0; - break; - } - if (this.frame.Y < num1 * 2) - this.frame.Y = num1 * 2; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; - ++this.frameCounter; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = num1 * 2; - break; - } - break; - } - this.frameCounter = 0.0; - this.frame.Y = 0; - break; - case 288: - ++this.frameCounter; - if (this.frameCounter >= 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - case 289: - ++this.frameCounter; - if (this.frameCounter < 4.0) - this.frame.Y = 0; - else if (this.frameCounter < 8.0) - { - this.frame.Y = num1; - } - else - { - this.frame.Y = num1 * 2; - this.frameCounter = 0.0; - if (this.frameCounter > 12.0) - this.frameCounter = 0.0; - } - if ((double) this.ai[3] == 1.0) - { - this.frame.Y += num1 * 3; - break; - } - break; - case 290: - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - if ((double) this.ai[2] > 0.0) - { - this.frame.Y = (double) this.ai[1] >= 10.0 ? ((double) this.ai[1] >= 20.0 ? num1 * 9 : num1 * 10) : num1 * 11; - break; - } - if ((double) this.velocity.X == 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = 0; - break; - } - if (this.frame.Y < num1 * 2) - this.frame.Y = num1 * 2; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.0; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y > num1 * 8) - { - this.frame.Y = num1 * 2; - break; - } - break; - } - this.frameCounter = 0.0; - this.frame.Y = num1; - break; - case 299: - case 538: - case 539: - case 639: - case 640: - case 641: - case 642: - case 643: - case 644: - case 645: - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X) * 0.5; - ++this.frameCounter; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type] - 1) - { - this.frame.Y = num1; - break; - } - break; - } - if ((double) this.velocity.Y < 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = num1 * 2; - break; - } - if ((double) this.velocity.Y > 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = num1 * 4; - break; - } - break; - case 300: - case 447: - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - if ((double) this.velocity.X == 0.0) - { - ++this.frameCounter; - if (this.frameCounter > 8.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 > 1) - { - this.frame.Y = 0; - break; - } - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X) * 0.5; - ++this.frameCounter; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = num1 * 2; - break; - } - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X) * 0.5; - ++this.frameCounter; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = num1 * 2; - break; - } - break; - case 305: - case 306: - case 307: - case 308: - case 309: - if ((double) this.velocity.Y == 0.0) - this.spriteDirection = this.direction; - this.frame.Y = (double) this.velocity.Y >= -3.0 ? ((double) this.velocity.Y > 0.0 ? ((double) this.velocity.Y >= 2.0 ? num1 : num1 * 3) : 0) : num1 * 5; - this.rotation = this.velocity.X * 0.1f; - break; - case 315: - if ((double) this.velocity.Y == 0.0 || this.wet) - this.spriteDirection = (double) this.velocity.X >= -1.0 ? ((double) this.velocity.X <= 1.0 ? this.direction : 1) : -1; - if ((double) this.velocity.Y != 0.0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X); - if (this.frameCounter >= 8.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y / num1 > 10) - { - this.frame.Y = num1; - break; - } - break; - } - break; - case 325: - if ((double) this.velocity.X == 0.0) - { - ++this.frameCounter; - if (this.frameCounter > 4.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - } - if (this.frame.Y > num1 * 4) - { - this.frame.Y = 0; - break; - } - break; - } - ++this.frameCounter; - if (this.frameCounter > 4.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - } - if (this.frame.Y < num1 * 5) - this.frame.Y = num1 * 5; - if (this.frame.Y > num1 * 9) - { - this.frame.Y = num1 * 5; - break; - } - break; - case 327: - if ((double) this.ai[3] == 0.0) - { - if (this.frame.Y > num1 * 5) - ++this.frameCounter; - else if (this.frame.Y > 0) - --this.frameCounter; - } - else if ((double) this.ai[3] == 1.0) - { - if (this.frame.Y > num1 * 10) - ++this.frameCounter; - else if (this.frame.Y > num1 * 4) - --this.frameCounter; - else if (this.frame.Y < num1 * 4) - ++this.frameCounter; - } - else if ((double) this.ai[3] == 2.0) - { - if (this.frame.Y < num1 * 2) - --this.frameCounter; - else if (this.frame.Y > num1 * 8) - --this.frameCounter; - else if (this.frame.Y < num1 * 8) - ++this.frameCounter; - } - if (this.frameCounter > 6.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y > num1 * 11) - this.frame.Y = 0; - } - if (this.frameCounter < 0.0) - { - this.frameCounter = 6.0; - this.frame.Y -= num1; - if (this.frame.Y < 0) - { - this.frame.Y = num1 * 11; - break; - } - break; - } - break; - case 329: - if ((double) this.velocity.Y > 0.0) - { - this.frame.Y = num1 * 3; - this.frameCounter = 0.0; - break; - } - if ((double) this.velocity.Y < 0.0) - { - this.frame.Y = num1 * 2; - this.frameCounter = 0.0; - break; - } - this.spriteDirection = this.direction; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 0.400000005960464; - if (this.frameCounter > 4.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y < num1 * 2) - this.frame.Y = num1 * 2; - if (this.frame.Y > num1 * 9) - { - this.frame.Y = num1 * 2; - break; - } - break; - } - break; - case 330: - if ((double) this.velocity.X > 0.0) - this.spriteDirection = 1; - if ((double) this.velocity.X < 0.0) - this.spriteDirection = -1; - this.rotation = this.velocity.X * 0.15f; - ++this.frameCounter; - if (this.frameCounter >= 8.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - case 343: - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = num1 * 2; - this.frameCounter = 0.0; - break; - } - if (this.frame.Y < num1 * 2) - this.frame.Y = num1 * 2; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.0; - ++this.frameCounter; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = num1 * 2; - break; - } - break; - } - this.frame.Y = (double) this.velocity.Y >= 0.0 ? num1 : 0; - this.frameCounter = 0.0; - break; - case 344: - if ((double) this.velocity.X == 0.0) - { - ++this.frameCounter; - if (this.frameCounter > 5.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - } - if (this.frame.Y > num1 * 9) - { - this.frame.Y = 0; - break; - } - break; - } - this.frameCounter += (double) Math.Max(1f, Math.Abs(this.velocity.X) * 0.75f); - if (this.frameCounter > 5.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - } - if (this.frame.Y > num1 * 9) - { - this.frame.Y = 0; - break; - } - break; - case 345: - if ((double) this.ai[0] == 0.0) - { - this.frame.Y = (double) this.ai[3] < 0.0 ? ((double) this.velocity.X >= 0.0 ? num1 * 2 : num1) : 0; - break; - } - if ((double) this.ai[0] == 1.0) - { - ++this.frameCounter; - if (this.frameCounter > 5.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - } - if (this.frame.Y > num1 * 4) - this.frame.Y = num1 * 3; - if (this.frame.Y < num1 * 3) - { - this.frame.Y = num1 * 3; - break; - } - break; - } - if ((double) this.ai[0] == 2.0) - { - this.frame.Y = num1 * 5; - break; - } - break; - case 346: - if ((double) this.ai[0] == 1.0) - { - this.spriteDirection = this.direction; - ++this.frameCounter; - if (this.frameCounter > 2.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y > num1 * 8) - this.frame.Y = num1 * 6; - if (this.frame.Y < num1 * 6) - { - this.frame.Y = num1 * 6; - break; - } - break; - } - if ((double) this.velocity.X == 0.0) - { - ref int local = ref this.frame.Y; - local = local; - this.frameCounter = 0.0; - break; - } - this.spriteDirection = this.direction; - ++this.frameCounter; - this.frameCounter += (double) Math.Abs(this.velocity.X) / 2.0; - if (this.frameCounter > 4.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y > num1 * 5) - this.frame.Y = num1; - if (this.frame.Y < num1) - { - this.frame.Y = num1; - break; - } - break; - case 347: - ++this.frameCounter; - if (this.frameCounter > 1.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y > num1 * 3) - { - this.frame.Y = 0; - break; - } - break; - case 348: - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - } - if ((double) this.velocity.Y != 0.0) { this.frameCounter = 0.0; this.frame.Y = num1 * 8; - break; } - if ((double) this.velocity.X == 0.0) + else if ((double) this.velocity.X == 0.0) { this.frameCounter = 0.0; - this.frame.Y = 0; - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X); - ++this.frameCounter; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y > num1 * 7) - { - this.frame.Y = num1; - break; - } - break; - case 349: - ++this.frameCounter; - if (this.frameCounter > 3.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y > num1 * 7) - { - this.frame.Y = 0; - break; - } - break; - case 350: - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - if ((double) this.ai[2] > 0.0) - { - this.spriteDirection = this.direction; - this.frame.Y = num1 * ((int) this.ai[2] - 1); - this.frameCounter = 0.0; - break; - } - if (this.frame.Y < num1 * 7) - this.frame.Y = num1 * 7; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; - this.frameCounter += (double) this.velocity.X * 1.29999995231628; - if (this.frameCounter > 4.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = num1 * 7; - break; - } - break; - } - this.frameCounter = 0.0; - this.frame.Y = num1 * 5; - break; - case 351: - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - break; - } - if (this.frame.Y < num1 * 2) - this.frame.Y = num1 * 2; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.0; - ++this.frameCounter; - if (this.frameCounter > 8.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = num1 * 2; - break; - } - break; - } - this.frame.Y = (double) this.velocity.Y >= 0.0 ? num1 : num1; - this.frameCounter = 0.0; - break; - case 352: - ++this.frameCounter; - if (this.frameCounter > 3.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y > num1 * 5) - { - this.frame.Y = 0; - break; - } - break; - case 355: - case 358: - case 654: - this.spriteDirection = this.direction; - ++this.frameCounter; - if (this.frameCounter < 4.0) - { - this.frame.Y = 0; - } - else - { - this.frame.Y = num1; - if (this.frameCounter >= 7.0) - this.frameCounter = 0.0; - } - if ((double) this.localAI[2] <= 0.0) - { - this.frame.Y += num1 * 2; - break; - } - break; - case 356: - case 444: - case 653: - case 661: - int num61 = 7; - this.rotation = this.velocity.X * 0.3f; - this.spriteDirection = this.direction; - this.frameCounter = this.frameCounter + 1.0 + ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y)) / 2.0; - if (this.frameCounter < (double) num61) - this.frame.Y = 0; - else if (this.frameCounter < (double) (num61 * 2)) - this.frame.Y = num1; - else if (this.frameCounter < (double) (num61 * 3)) - { - this.frame.Y = num1 * 2; - } - else - { - this.frame.Y = num1; - if (this.frameCounter >= (double) (num61 * 4 - 1)) - this.frameCounter = 0.0; - } - if (this.type != 444 && this.type != 653 && this.type != 661) - { - this.frame.Y += (int) ((double) (num1 * 3) * ((double) this.ai[2] - 1.0)); - break; - } - break; - case 357: - case 448: - case 484: - case 606: - this.localAI[0] = -2f; - if ((double) this.velocity.Y == 0.0) - { - this.rotation = 0.0f; - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = num1; - this.frameCounter = 0.0; - } - else - { - ++this.frameCounter; - if (this.frameCounter > 12.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y > num1) - this.frame.Y = 0; - } - } - } - else - { - this.rotation += (float) this.direction * 0.1f; - this.frame.Y = num1; - } - int i1 = (int) this.Center.X / 16; - int j1 = (int) this.position.Y / 16; - Tile tileSafely1 = Framing.GetTileSafely(i1, j1); - if (tileSafely1 != null) - { - if (tileSafely1.slope() == (byte) 0) - { - int j2 = j1 + 1; - tileSafely1 = Framing.GetTileSafely(i1, j2); - } - if (tileSafely1.slope() == (byte) 1) - { - this.rotation = 0.785f; - this.localAI[0] = 0.0f; - break; - } - if (tileSafely1.slope() == (byte) 2) - { - this.rotation = -0.785f; - this.localAI[0] = 0.0f; - break; - } - break; - } - break; - case 359: - case 360: - case 655: - if ((double) this.velocity.Y > 1.0) - { - ++this.frameCounter; - int num62 = 6; - if (this.frameCounter < (double) num62) - { - this.frame.Y = num1 * 4; - break; - } - this.frame.Y = num1 * 5; - if (this.frameCounter >= (double) (num62 * 2 - 1)) - { - this.frameCounter = 0.0; - break; - } - break; - } - ++this.frameCounter; - int num63 = 10; - if (this.frameCounter < (double) num63) - { - this.frame.Y = 0; - break; - } - if (this.frameCounter < (double) (num63 * 2)) - { - this.frame.Y = num1; - break; - } - if (this.frameCounter < (double) (num63 * 3)) - { - this.frame.Y = num1 * 2; - break; - } - if (this.frameCounter < (double) (num63 * 4)) - { - this.frame.Y = num1 * 3; - break; - } - if (this.frameCounter < (double) (num63 * 5)) - { - this.frame.Y = num1 * 2; - break; - } - this.frame.Y = num1; - if (this.frameCounter >= (double) (num63 * 6 - 1)) - { - this.frameCounter = 0.0; - break; - } - break; - case 361: - case 445: - this.spriteDirection = this.direction; - if (this.wet) - { - this.frameCounter = 0.0; - this.frame.Y = (double) this.velocity.X > 0.25 || (double) this.velocity.X < -0.25 ? num1 * 10 : ((double) this.velocity.X > 0.150000005960464 || (double) this.velocity.X < -0.150000005960464 ? num1 * 11 : num1 * 12); - break; - } - if ((double) this.velocity.Y == 0.0) - { - if ((double) this.velocity.X == 0.0) - { - ++this.frameCounter; - if (this.frameCounter > 6.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - } - if (this.frame.Y > num1 * 5) - { - this.frame.Y = 0; - break; - } - break; - } - ++this.frameCounter; - int num64 = 6; - if (this.frameCounter < (double) num64) - { - this.frame.Y = 0; - break; - } - if (this.frameCounter < (double) (num64 * 2)) - { - this.frame.Y = num1 * 6; - break; - } - if (this.frameCounter < (double) (num64 * 3)) - { - this.frame.Y = num1 * 8; - break; - } this.frame.Y = num1 * 9; - if (this.frameCounter >= (double) (num64 * 4 - 1)) - { - this.frameCounter = 0.0; - break; - } - break; - } - this.frame.Y = (double) this.velocity.Y <= 0.0 ? num1 * 8 : num1 * 9; - break; - case 362: - case 364: - case 608: - this.spriteDirection = this.direction; - if ((double) this.velocity.X == 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = 0; - break; - } - ++this.frameCounter; - if (this.frameCounter >= 4.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y >= num1 * 10) - this.frame.Y = num1 * 3; - if (this.frame.Y < num1 * 3) - { - this.frame.Y = num1 * 3; - break; - } - break; - case 363: - case 365: - case 609: - this.spriteDirection = this.direction; - if (this.wet) - { - ++this.frameCounter; - if (this.frameCounter >= 8.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y > num1 * 2) - this.frame.Y = num1; - if (this.frame.Y < num1) - this.frame.Y = num1; - this.rotation = 0.0f; - break; - } - if ((double) this.velocity.X == 0.0 && (double) this.velocity.Y == 0.0) - { - this.frame.Y = num1; - this.frameCounter = 0.0; - this.rotation = 0.0f; - break; - } - this.rotation = this.velocity.X * 0.1f; - ++this.frameCounter; - if (this.frameCounter >= 4.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) - this.frame.Y = num1 * 11; - if (this.frame.Y < num1 * 11) - { - this.frame.Y = num1 * 11; - break; - } - break; - case 366: - case 367: - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - } - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.0; - ++this.frameCounter; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - case 370: - if ((double) this.ai[0] == 0.0 || (double) this.ai[0] == 5.0) - { - int num65 = 5; - if ((double) this.ai[0] == 5.0) - num65 = 4; - ++this.frameCounter; - if (this.frameCounter > (double) num65) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - } - if (this.frame.Y >= num1 * 6) - this.frame.Y = 0; - } - if ((double) this.ai[0] == 1.0 || (double) this.ai[0] == 6.0) - this.frame.Y = (double) this.ai[2] >= 10.0 ? num1 * 7 : num1 * 6; - if ((double) this.ai[0] == 2.0 || (double) this.ai[0] == 7.0) - this.frame.Y = (double) this.ai[2] >= 10.0 ? num1 * 7 : num1 * 6; - if ((double) this.ai[0] == 3.0 || (double) this.ai[0] == 8.0 || (double) this.ai[0] == -1.0) - { - int num66 = 90; - if ((double) this.ai[2] < (double) (num66 - 30) || (double) this.ai[2] > (double) (num66 - 10)) - { - ++this.frameCounter; - if (this.frameCounter > 5.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - } - if (this.frame.Y >= num1 * 6) - this.frame.Y = 0; - } - else - { - this.frame.Y = num1 * 6; - if ((double) this.ai[2] > (double) (num66 - 20) && (double) this.ai[2] < (double) (num66 - 15)) - this.frame.Y = num1 * 7; - } - } - if ((double) this.ai[0] == 4.0 || (double) this.ai[0] == 9.0) - { - int num67 = 180; - if ((double) this.ai[2] < (double) (num67 - 60) || (double) this.ai[2] > (double) (num67 - 20)) - { - ++this.frameCounter; - if (this.frameCounter > 5.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - } - if (this.frame.Y >= num1 * 6) - { - this.frame.Y = 0; - break; - } - break; - } - this.frame.Y = num1 * 6; - if ((double) this.ai[2] > (double) (num67 - 50) && (double) this.ai[2] < (double) (num67 - 25)) - { - this.frame.Y = num1 * 7; - break; - } - break; - } - break; - case 371: - case 372: - case 373: - this.frame.Y = num1; - break; - case 374: - this.localAI[0] = -2f; - if ((double) this.velocity.Y == 0.0) - { - this.rotation = 0.0f; - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - break; - } - ++this.frameCounter; - if (this.frameCounter > 6.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y >= num1 * 4) - { - this.frame.Y = num1; - break; - } - break; - } - break; - } - this.rotation += (float) this.direction * 0.1f; - ++this.frameCounter; - if (this.frameCounter > 3.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y >= num1 * 4) - { - this.frame.Y = num1; - break; - } - break; - } - break; - case 375: - ++this.frameCounter; - if (this.frameCounter > 4.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y >= num1 * 4) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 376: - ++this.frameCounter; - if (this.frameCounter > 30.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y >= num1 * 2) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 377: - case 446: - if (this.IsABestiaryIconDummy) - { - ++this.frameCounter; - if (this.frameCounter > 4.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - } - if (this.frame.Y > num1) - this.frame.Y = 0; } else - this.frame.Y = (double) this.velocity.Y == 0.0 ? 0 : num1; + { + this.frameCounter += (double) Math.Abs(this.velocity.X); + if (this.frameCounter >= 64.0 || this.frameCounter < 0.0) + this.frameCounter = 0.0; + this.frame.Y = num1 * (int) (this.frameCounter / 8.0); + } + } + } + if (this.type == 572 || this.type == 573) + { + if ((double) this.ai[0] > 0.0 && (double) this.ai[1] == 0.0) + { this.spriteDirection = this.direction; - break; - case 378: - if ((double) this.velocity.Y != 0.0 && this.frame.Y < num1 * 2) - this.frame.Y += num1 * 2; - if ((double) this.velocity.Y == 0.0 && this.frame.Y > num1 * 2) - this.frame.Y -= num1 * 2; - ++this.frameCounter; - if (this.frameCounter >= 6.0) + if (this.frame.Y != num1 * 8 || this.frameCounter > 2.0) { + this.frame.Y = num1 * 8; this.frameCounter = 0.0; - this.frame.Y += num1; - if ((double) this.velocity.Y != 0.0 && this.frame.Y >= num1 * 4) - this.frame.Y = num1 * 2; - if ((double) this.velocity.Y == 0.0 && this.frame.Y >= num1 * 2) - { - this.frame.Y = 0; - break; - } - break; } - break; - case 379: - case 380: - if ((double) this.velocity.Y == 0.0) + if (this.frameCounter == 0.0) { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - if ((double) this.ai[2] > 0.0) - { - this.spriteDirection = this.direction; - this.frame.Y = num1 * ((int) this.ai[2] - 1 + 2); - this.frameCounter = 0.0; - break; - } - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = 0; - break; - } - if (this.frame.Y < num1 * 7) - this.frame.Y = num1 * 7; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = num1 * 7; - break; - } - break; - } - this.frameCounter = 0.0; - this.frame.Y = num1; - break; - case 381: - case 382: - case 383: - case 385: - case 389: - if ((double) this.velocity.Y == 0.0) - { - this.spriteDirection = this.direction; - if (this.frame.Y < num1 * 2) - this.frame.Y = num1 * 2; - if (this.type == 389 || this.type == 385) - this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.2; - else - this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - this.frame.Y = num1 * 2; - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = 0; - break; - } - break; - } - this.frameCounter = 0.0; - this.frame.Y = num1; - break; - case 386: - if ((double) this.ai[2] > 0.0) - { - int num68 = (int) this.ai[2] / 12; - this.frame.Y = num1 * (9 + num68 % 2); - break; - } - if ((double) this.velocity.Y == 0.0) - { - this.spriteDirection = this.direction; - if (this.frame.Y < num1 * 2) - this.frame.Y = num1 * 2; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= 9) - this.frame.Y = num1 * 2; - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = 0; - break; - } - break; - } - this.frameCounter = 0.0; - this.frame.Y = num1; - break; - case 387: - if ((double) this.ai[0] > 0.0) - { - ++this.frameCounter; - if ((double) this.ai[0] >= 20.0) - ++this.frameCounter; - if ((double) this.ai[0] >= 40.0) - ++this.frameCounter; - if (this.frameCounter >= 10.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y >= num1 * 2) - { - this.frame.Y = 0; - break; - } - break; - } - break; - } - ++this.frameCounter; - if (this.frameCounter >= 15.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y >= num1 * 2) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 388: - ++this.frameCounter; - if (this.frameCounter >= 6.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y >= num1 * 2) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 390: - if (this.IsABestiaryIconDummy) - { - this.frameCounter += (double) Math.Abs(this.velocity.X) * 0.5; - if (this.frameCounter > 6.0) - { - this.frameCounter = 0.0; - ++this.localAI[3]; - if ((double) this.localAI[3] >= (double) Main.npcFrameCount[391]) - this.localAI[3] = 0.0f; - } - } - if (this.direction != 0) - this.spriteDirection = -this.direction; - this.frame.Y = (double) this.ai[2] <= 0.0 ? num1 * 2 : num1 * ((int) this.ai[2] - 1); - break; - case 391: - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = -1; - if (this.direction == -1) - this.spriteDirection = 1; - if (this.frame.Y < num1) - this.frame.Y = num1; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 0.5; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - this.frame.Y = num1; - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = 0; - break; - } - break; - } - this.frameCounter = 0.0; - this.frame.Y = 0; - break; - case 392: - float num69 = 20f; - float num70 = 240f; - bool flag1 = (double) this.ai[3] >= (double) num69 && (double) this.ai[3] < (double) num69 + (double) num70; - ++this.frameCounter; - if (flag1) - ++this.frameCounter; - if (this.frameCounter >= 12.0) - this.frameCounter = 0.0; - int num71 = (int) this.frameCounter % 12 / 3; - this.frame.Y = num1 * num71; - break; - case 393: - Vector2 rotationVector2 = this.ai[2].ToRotationVector2(); - int num72 = (double) rotationVector2.Y <= (double) Math.Abs(rotationVector2.X) * 2.0 ? ((double) rotationVector2.Y <= (double) Math.Abs(rotationVector2.X) * 1.5 ? ((double) Math.Abs(rotationVector2.X) <= (double) rotationVector2.Y * 2.0 ? ((double) Math.Abs(rotationVector2.X) <= (double) rotationVector2.Y * 1.5 ? ((double) rotationVector2.X > 0.0 ? 6 : 2) : ((double) rotationVector2.X > 0.0 ? 7 : 1)) : ((double) rotationVector2.X > 0.0 ? 8 : 0)) : ((double) rotationVector2.X > 0.0 ? 5 : 3)) : 4; - this.frame.Y = num1 * num72; - float num73 = 280f; - float num74 = 140f; - if ((double) this.ai[3] >= (double) num73 && (double) this.ai[3] < (double) num73 + (double) num74 && (int) this.ai[3] % 6 <= 2) - { - this.frame.Y += num1 * 9; - break; - } - break; - case 394: - int num75 = (int) this.ai[3] - 300; - if (num75 >= 120) - { - int num76 = num75 - 120; - this.frame.Y = num76 < 160 ? (num76 < 20 ? num1 * (4 + num76 / 5) : num1 * (num76 / 4 % 4)) : num1 * (7 - (num76 - 160) / 5); - break; - } - this.frame.Y = num1 * 4; - break; - case 395: - float num77 = 20f; - float num78 = 240f; - bool flag2 = (double) this.ai[3] >= (double) num77 && (double) this.ai[3] < (double) num77 + (double) num78; - ++this.frameCounter; - if (this.frameCounter >= 66.0) - this.frameCounter = 0.0; - if (flag2) - { - ++this.frameCounter; - if (this.frameCounter >= 54.0 || this.frameCounter < 36.0) - this.frameCounter = 36.0; - } - int num79 = (int) this.frameCounter % 66 / 6; - this.frame.Y = num1 * num79; - break; - case 397: - int num80 = (int) this.frameCounter / 7; - this.frame.Y = num1 * num80; - break; - case 398: - if ((double) this.ai[0] <= 0.0) - { - this.frame.Y = 0; - break; - } - if (this.frame.Y == 0) - { - Gore.NewGore(this.position + new Vector2(-10f, -15f), this.velocity, 619); - Gore.NewGore(this.position + new Vector2(10f, -15f), this.velocity, 620); - Gore.NewGore(this.position + new Vector2(-10f, 15f), this.velocity, 621); - Gore.NewGore(this.position + new Vector2(10f, 15f), this.velocity, 622); - for (int index = 0; index < 50; ++index) - { - this.frame.Y = num1; - Dust.NewDust(this.position, this.width, this.height, 209); - } - } - ++this.frameCounter; - if (this.frameCounter >= 30.0) - this.frameCounter = 6.0; - int num81 = (int) this.frameCounter % 30 / 6; - this.frame.Y = num1 * num81; - break; - case 399: - this.frameCounter = (this.frameCounter + 0.25) % 4.0 + ((double) this.ai[0] == 0.0 ? 0.0 : 4.0); - this.frame.Y = num1 * (int) this.frameCounter; - break; - case 400: - ++this.frameCounter; - if ((double) this.ai[0] == 0.0 || (double) this.ai[0] == 3.0) - ++this.frameCounter; - if (this.frameCounter >= 16.0) - this.frameCounter = 0.0; - int num82 = (int) this.frameCounter % 16 / 4; - this.frame.Y = num1 * num82; - break; - case 405: - case 406: - if (++this.frameCounter >= 4.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 407: - if (++this.frameCounter >= 6.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 409: - if ((double) this.velocity.Y == 0.0 && (double) this.ai[1] <= 30.0 && (double) this.ai[1] > 0.0) - { - this.frame.Y = num1 * (Main.npcFrameCount[this.type] - 1); - this.frameCounter = 0.0; - break; + this.frameCounter = 1.0; + EmoteBubble.NewBubble(3, new WorldUIAnchor((Entity) this), 60); } + } + else if ((double) this.ai[1] == 1.0) + { if ((double) this.velocity.Y == 0.0) this.spriteDirection = this.direction; - if (++this.frameCounter >= 6.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type] - 2) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 410: - this.frameCounter += (double) Math.Abs(this.velocity.X); - if (this.frameCounter >= 10.0) - { - this.frameCounter -= 10.0; - this.frame.Y += num1; - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 411: - if ((double) this.ai[1] >= 90.0 && (double) this.ai[1] < 180.0) - { - this.spriteDirection = -this.direction; - this.frame.Y = num1 * (Main.npcFrameCount[this.type] - 1); - this.frameCounter = 0.0; - break; - } - if ((double) this.velocity.Y == 0.0) - { - if (this.direction != 0) - this.spriteDirection = -this.direction; - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - break; - } - if (this.frame.Y < num1 * 2) - this.frame.Y = num1 * 2; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.0; - ++this.frameCounter; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type] - 1) - { - this.frame.Y = num1 * 2; - break; - } - break; - } - this.frame.Y = num1; - this.frameCounter = 0.0; - break; - case 415: - if ((double) this.ai[2] < 0.0) - { - if (this.frame.Y / num1 != 8 && this.frame.Y / num1 != 9 && this.frame.Y / num1 != 0) - this.frameCounter = 0.0; - ++this.frameCounter; - int num83 = 0; - int num84 = 18; - int num85 = 4; - if (this.frameCounter > (double) (num84 - num85 * 2)) - num83 = 8 + (int) this.frameCounter / 4 % 2; - if (this.frameCounter > (double) (num84 + num85 * 6)) - { - num83 = 0; - this.frameCounter = 0.0; - } - this.frame.Y = num1 * num83; - break; - } - if ((double) this.velocity.Y == 0.0) - { - if (this.direction != 0) - this.spriteDirection = this.direction; - if (this.frame.Y < num1 * 2) - this.frame.Y = num1 * 2; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 0.5; - if (this.frameCounter >= 8.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type] - 2) - this.frame.Y = num1 * 2; - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = 0; - break; - } - break; - } - this.frameCounter = 0.0; - this.frame.Y = num1; - break; - case 416: - if (this.IsABestiaryIconDummy) - { - ++this.frameCounter; - if (this.frameCounter > 5.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - } - if (this.frame.Y < num1 * 2 || this.frame.Y > num1 * 7) - { - this.frame.Y = num1 * 2; - break; - } - break; - } - if (Main.netMode != 2 && !Main.dedServ) - { - int index = (int) this.ai[0]; - if (Main.npc[index].active && Main.npc[index].type == 415 && TextureAssets.Npc[415].IsLoaded) - { - this.frame.Y = Main.npc[index].frame.Y / (TextureAssets.Npc[415].Height() / Main.npcFrameCount[415]) * num1; - break; - } - break; - } - break; - case 417: - if ((double) this.ai[0] == 0.0) - { - this.rotation = 0.0f; - if ((double) this.velocity.Y == 0.0) - this.spriteDirection = this.direction; - else if ((double) this.velocity.Y < 0.0) - this.frameCounter = 0.0; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.10000002384186; - this.frame.Y = (int) (this.frameCounter / 6.0) * num1; - if (this.frameCounter >= 48.0) - { - this.frameCounter = 0.0; - break; - } - break; - } - if ((double) this.ai[0] == 1.0) - { - this.frameCounter = 0.0; - this.frame.Y = num1 * (9 + (int) ((double) this.ai[1] / 6.0)); - break; - } - if ((double) this.ai[0] == 5.0) - { - this.frameCounter = 0.0; - this.frame.Y = num1 * (13 - (int) ((double) this.ai[1] / 6.0)); - break; - } - this.frameCounter = 0.0; - this.frame.Y = num1 * 14; - break; - case 418: - if ((double) this.ai[0] == 0.0 || (double) this.ai[0] == 1.0 || (double) this.ai[0] == -1.0) - { - ++this.frameCounter; - if (this.frameCounter > 6.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - } - if (this.frame.Y > num1 * 4) - { - this.frame.Y = 0; - break; - } - break; - } - if ((double) this.ai[0] == 2.0) - { - this.frame.Y = (double) this.ai[1] >= 10.0 ? ((double) this.ai[1] >= 20.0 ? num1 * 7 : num1 * 6) : num1 * 5; - break; - } - if ((double) this.ai[0] == -2.0) - { - ++this.frameCounter; - if (this.frameCounter > 12.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - } - if (this.frame.Y > num1 * 7) - { - this.frame.Y = num1 * 5; - break; - } - break; - } - break; - case 419: - if ((double) this.ai[2] < 0.0) - { - int num86 = 1; - if (this.direction != 0) - this.spriteDirection = this.direction; - if (this.frame.Y / num1 >= 9) - { - this.frame.Y = num1 * 2; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 < 2) - { - this.frame.Y = num1 * 2; - this.frameCounter = 0.0; - } - ++this.frameCounter; - if (this.frameCounter >= (double) (num86 * 4 + 6)) - this.frameCounter = 8.0; - this.frame.Y = this.frameCounter >= 6.0 ? num1 * (int) (4.0 + (this.frameCounter - 6.0) / (double) num86) : num1 * (int) (2.0 + this.frameCounter / 3.0); - break; - } - if ((double) this.velocity.Y == 0.0) - { - if (this.direction != 0) - this.spriteDirection = this.direction; - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.0; - ++this.frameCounter; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - this.frame.Y = num1 * 9; - if (this.frame.Y / num1 < 9) - { - this.frame.Y = num1 * 9; - break; - } - break; - } - this.frame.Y = num1; - this.frameCounter = 0.0; - break; - case 420: - if (++this.frameCounter >= 5.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 421: - if ((double) this.ai[0] == 5.0) - ++this.frameCounter; - if (++this.frameCounter >= 5.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 423: - if ((double) this.ai[2] == 1.0) - { - int num87 = 2; - if ((double) this.ai[1] >= 30.0 && (double) this.ai[1] < 45.0) - num87 = 3; - this.frame.Y = num87 * num1; - break; - } - if ((double) this.velocity.Y != 0.0) - { - this.frame.Y = num1; - break; - } - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = 0; - break; - } - if ((double) this.velocity.X != 0.0) - this.spriteDirection = Math.Sign(-this.velocity.X); - if (this.frame.Y / num1 < 4) - this.frame.Y = num1 * 4; - this.frameCounter += 1.0 + (double) Math.Abs(this.velocity.X) / 2.0; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = num1 * 4; - break; - } - break; - case 424: - if ((double) this.velocity.Y == 0.0) - { - if (this.direction != 0) - this.spriteDirection = -this.direction; - if ((double) this.ai[2] > 0.0) - { - this.frame.Y = num1 * ((double) this.ai[1] > 90.0 ? Main.npcFrameCount[this.type] - 2 : Main.npcFrameCount[this.type] - 1); - this.frameCounter = 0.0; - break; - } - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = 0; - break; - } - if (this.frame.Y < num1 * 2) - this.frame.Y = num1 * 2; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; - this.frameCounter += (double) this.velocity.X * 1.29999995231628; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type] - 2) - { - this.frame.Y = num1 * 2; - break; - } - break; - } - this.frameCounter = 0.0; - this.frame.Y = num1; - break; - case 425: - if (this.direction != 0) - this.spriteDirection = -this.direction; - if ((double) this.ai[2] == 1.0) - { - ++this.frameCounter; - if (this.frameCounter >= 3.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y > num1 * 12 || this.frame.Y < num1 * 10) - { - this.frame.Y = num1 * 10; - break; - } - break; - } - if ((double) this.velocity.Y != 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = num1; - break; - } - if ((double) this.velocity.X == 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = 0; - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X); - if (this.frameCounter >= 8.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y > num1 * 9 || this.frame.Y < num1 * 2) - { - this.frame.Y = num1 * 2; - break; - } - break; - case 426: - if (this.direction != 0) - this.spriteDirection = this.direction; - if ((double) this.ai[1] >= 45.0) - { - if ((double) this.velocity.Y == 0.0) - { - this.frame.Y = num1 * 8; - break; - } - ++this.frameCounter; - if (this.frameCounter >= 2.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y >= num1 * 15 || this.frame.Y < num1 * 12) - { - this.frame.Y = num1 * 12; - break; - } - break; - } - if ((double) this.velocity.Y != 0.0) - { - ++this.frameCounter; - if (this.frameCounter >= 2.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y >= num1 * 12 || this.frame.Y < num1 * 9) - { - this.frame.Y = num1 * 9; - break; - } - break; - } - if ((double) this.velocity.X == 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = 0; - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X); - if (this.frameCounter >= 10.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y > num1 * 7 || this.frame.Y < num1) - { - this.frame.Y = num1; - break; - } - break; - case 427: - if (this.direction != 0) - this.spriteDirection = this.direction; - if ((double) this.velocity.Y != 0.0) - { - ++this.frameCounter; - if (this.frameCounter >= 2.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y >= num1 * 9 || this.frame.Y < num1 * 6) - { - this.frame.Y = num1 * 6; - break; - } - break; - } - if ((double) this.velocity.X == 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = 0; - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X); - if (this.frameCounter >= 8.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y > num1 * 5 || this.frame.Y < num1) - { - this.frame.Y = num1; - break; - } - break; - case 428: - if ((double) this.velocity.Y == 0.0) - { - if (this.direction != 0) - this.spriteDirection = this.direction; - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.0; - if (++this.frameCounter > 10.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type] - 1) - { - this.frame.Y = 0; - break; - } - break; - } - if (this.frame.Y / num1 != 4) - { - if (this.frameCounter > 0.0) - this.frameCounter = 0.0; - if (--this.frameCounter < -10.0 || (double) this.velocity.Y > 0.600000023841858) - { - this.frame.Y = num1 * 4; - this.frameCounter = 0.0; - break; - } - break; - } - break; - case 429: - if ((double) this.velocity.Y == 0.0) - { - if (this.direction != 0) - this.spriteDirection = this.direction; - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - break; - } - if (this.frame.Y < num1 * 2) - this.frame.Y = num1 * 2; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.0; - ++this.frameCounter; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = num1 * 2; - break; - } - break; - } - this.frame.Y = num1; - this.frameCounter = 0.0; - break; - case 430: - case 431: - case 432: - case 433: - case 434: - case 435: - case 436: - case 591: - if ((double) this.ai[2] > 0.0) - { - this.frame.Y = (double) this.ai[2] >= 5.0 ? ((double) this.ai[2] >= 10.0 ? ((double) this.ai[2] >= 15.0 ? num1 * 6 : num1 * 5) : num1 * 4) : num1 * 3; - break; - } - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - } if ((double) this.velocity.Y != 0.0 || this.direction == -1 && (double) this.velocity.X > 0.0 || this.direction == 1 && (double) this.velocity.X < 0.0) { this.frameCounter = 0.0; - this.frame.Y = num1 * 2; - break; + this.frame.Y = num1 * 17; } - if ((double) this.velocity.X == 0.0) + else if ((double) this.velocity.X == 0.0) { this.frameCounter = 0.0; - this.frame.Y = 0; - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X); - if (this.frameCounter < 8.0) - { - this.frame.Y = 0; - break; - } - if (this.frameCounter < 16.0) - { - this.frame.Y = num1; - break; - } - if (this.frameCounter < 24.0) - { - this.frame.Y = num1 * 2; - break; - } - if (this.frameCounter < 32.0) - { - this.frame.Y = num1; - break; - } - this.frameCounter = 0.0; - break; - case 437: - ++this.frameCounter; - if (this.frameCounter >= 20.0) - this.frameCounter = 0.0; - int num88 = (int) this.frameCounter % 20 / 5; - this.frame.Y = num1 * num88; - break; - case 438: - ++this.frameCounter; - if ((double) this.ai[1] == 1.0) - ++this.frameCounter; - if (this.frameCounter >= 49.0) - this.frameCounter = 0.0; - int num89 = (int) this.frameCounter % 49 / 7; - if (num89 >= 4) - num89 = 6 - num89; - this.frame.Y = num1 * num89; - break; - case 439: - case 440: - int num90 = (int) this.localAI[2]; - if (this.IsABestiaryIconDummy) - { - if (this.frameCounter > 5.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - } - if (this.frame.Y < num1 * 4 || this.frame.Y > num1 * 6) - this.frame.Y = num1 * 4; + this.frame.Y = num1 * 8; } else { - switch (num90) - { - case 0: - if (this.frameCounter >= 15.0) - { - this.frameCounter = 0.0; - this.frame.Y = 0; - break; - } - if (this.frame.Y != 0) - { - this.frame.Y = ((int) this.frameCounter / 5 + 4) * num1; - break; - } - break; - case 1: - if (this.frameCounter >= 15.0) - { - this.frameCounter = 0.0; - this.frame.Y = num1; - break; - } - if (this.frame.Y != num1) - { - this.frame.Y = ((int) this.frameCounter / 5 + 10) * num1; - break; - } - break; - case 2: - if (this.frameCounter >= 15.0) - { - this.frameCounter = 0.0; - this.frame.Y = num1 * 2; - break; - } - if (this.frame.Y != num1 * 2) - { - this.frame.Y = ((int) this.frameCounter / 5 + 7) * num1; - break; - } - break; - case 10: - if (this.frameCounter >= 15.0) - this.frameCounter = 0.0; - this.frame.Y = ((int) this.frameCounter / 5 + 4) * num1; - break; - case 11: - if (this.frameCounter >= 15.0) - this.frameCounter = 0.0; - this.frame.Y = ((int) this.frameCounter / 5 + 10) * num1; - break; - case 12: - if (this.frameCounter >= 15.0) - this.frameCounter = 0.0; - this.frame.Y = ((int) this.frameCounter / 5 + 7) * num1; - break; - case 13: - if (this.frameCounter >= 15.0) - this.frameCounter = 0.0; - this.frame.Y = ((int) this.frameCounter / 5 + 13) * num1; - break; - } - } - ++this.frameCounter; - break; - case 449: - case 450: - case 451: - case 452: - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - if ((double) this.ai[2] > 0.0) - { - this.spriteDirection = this.direction; - int num91 = Main.npcFrameCount[this.type] - 5; - int num92 = 7; - int num93 = (double) this.ai[1] < 50.0 ? ((double) this.ai[1] < (double) (50 - num92) ? ((double) this.ai[1] < (double) (50 - num92 * 2) ? ((double) this.ai[1] < (double) (50 - num92 * 3) ? 0 : 4) : 3) : 2) : 1; - this.frame.Y = num1 * (num91 + num93); - this.frameCounter = 0.0; - break; - } - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = 0; - break; - } - if (this.frame.Y < num1 * 2) - this.frame.Y = num1 * 2; - if (this.frame.Y < num1 * 2) - this.frame.Y = num1 * 2; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= 15) - { - this.frame.Y = num1 * 2; - break; - } - break; - } - this.frameCounter = 0.0; - this.frame.Y = num1; - break; - case 454: - int num94 = (int) (this.frameCounter / 2.0); - this.frame.Y = num1 * num94; - break; - case 461: - if (this.wet) - { - if ((double) this.velocity.X < 0.0) - this.direction = -1; - if ((double) this.velocity.X > 0.0) - this.direction = 1; - if (this.spriteDirection != this.direction) - { - this.rotation *= -1f; - this.spriteDirection = this.direction; - } - float num95 = (float) Math.Atan2((double) this.velocity.Y * (double) this.direction, (double) this.velocity.X * (double) this.direction); - if ((double) Math.Abs(this.rotation - num95) >= 3.14) - { - if ((double) num95 < (double) this.rotation) - this.rotation -= 6.28f; - else - this.rotation += 6.28f; - } - this.rotation = (float) (((double) this.rotation * 4.0 + (double) num95) / 5.0); - this.frameCounter += (double) Math.Abs(this.velocity.Length()); - ++this.frameCounter; - if (this.frameCounter > 8.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 > 20) - { - this.frame.Y = num1 * 16; - break; - } - if (this.frame.Y / num1 < 16) - { - this.frame.Y = num1 * 19; - break; - } - break; - } - if ((double) this.rotation > 3.14) - this.rotation -= 6.28f; - if ((double) this.rotation > -0.01 && (double) this.rotation < 0.01) - this.rotation = 0.0f; - else - this.rotation *= 0.9f; - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - break; - } - if (this.frame.Y < num1 * 2) - this.frame.Y = num1 * 2; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; - ++this.frameCounter; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 > 15) - { - this.frame.Y = num1 * 2; - break; - } - break; - } - this.frameCounter = 0.0; - this.frame.Y = num1; - break; - case 466: - if (!this.IsABestiaryIconDummy && (double) this.ai[2] <= 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - this.frame.Y = (double) this.ai[2] != 0.0 ? ((double) this.ai[2] >= -8.0 ? num1 * 2 : num1) : 0; - break; - } - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = num1 * 2; - this.frameCounter = 0.0; - break; - } - if (this.frame.Y / num1 < 4) - this.frame.Y = num1 * 4; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; - ++this.frameCounter; - if (this.frameCounter > 7.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 > 17) - this.frame.Y = num1 * 4; - if (this.frame.Y / num1 < 4) - { - this.frame.Y = num1 * 4; - break; - } - break; - } - this.frameCounter = 0.0; - this.frame.Y = num1 * 3; - break; - case 467: - if ((double) this.ai[0] == 1.0 || this.IsABestiaryIconDummy) - { - ++this.frameCounter; - if (this.frameCounter > 4.0) - { - this.frameCounter = 0.0; - if (this.frame.Y < num1 * 6) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - break; - } - if (this.IsABestiaryIconDummy) - { - this.frame.Y = 0; - break; - } - break; - } - break; - } - ++this.frameCounter; - if (this.frameCounter > 4.0) - { - this.frameCounter = 0.0; - if (this.frame.Y > num1 * 3) - this.frame.Y = num1 * 3; - if (this.frame.Y > 0) - { - this.frame.Y -= num1; - this.frameCounter = 0.0; - break; - } - break; - } - break; - case 468: - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - if ((double) this.ai[2] > 0.0) - { - this.spriteDirection = this.direction; - int num96 = 0; - if ((double) this.ai[1] < 22.0) - num96 = -15; - else if ((double) this.ai[1] < 28.0) - num96 = 3; - else if ((double) this.ai[1] < 34.0) - num96 = 2; - else if ((double) this.ai[1] < 40.0) - num96 = 1; - this.frame.Y = num1 * (15 + num96); - this.frameCounter = 0.0; - break; - } - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = 0; - break; - } - if (this.frame.Y < num1 * 2) - this.frame.Y = num1 * 2; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= 15) - { - this.frame.Y = num1 * 2; - break; - } - break; - } - this.frameCounter = 0.0; - this.frame.Y = num1; - break; - case 469: - if ((double) this.ai[2] == 1.0) - { - this.rotation = (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X) + 1.57f; - if ((double) this.velocity.X < 0.0) - this.direction = -1; - if ((double) this.velocity.X > 0.0) - this.direction = 1; - this.spriteDirection = this.direction; - this.frameCounter += (double) Math.Abs(this.velocity.Length()); - if (this.frameCounter > 11.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 > 5) - this.frame.Y = num1 * 2; - if (this.frame.Y / num1 < 2) - { - this.frame.Y = num1 * 2; - break; - } - break; - } - this.rotation = 0.0f; - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - if ((double) this.velocity.X == 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = 0; - break; - } this.frameCounter += (double) Math.Abs(this.velocity.X); - ++this.frameCounter; - if (this.frameCounter > 9.0) - { - this.frame.Y += num1; + if (this.frameCounter >= 64.0 || this.frameCounter < 0.0) this.frameCounter = 0.0; - } - if (this.frame.Y / num1 > 11) - this.frame.Y = num1 * 6; - if (this.frame.Y / num1 < 6) - { - this.frame.Y = num1 * 6; - break; - } - break; - } - this.frameCounter = 0.0; - this.frame.Y = num1; - break; - case 471: - bool flag3 = false; - if ((double) this.ai[3] < 0.0) - flag3 = true; - if (flag3) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - this.frameCounter += (double) Math.Abs(this.velocity.Length()) * 0.5; - ++this.frameCounter; - if (this.frameCounter < 6.0) - { - this.frame.Y = num1 * 17; - break; - } - if (this.frameCounter < 12.0) - { - this.frame.Y = num1 * 18; - break; - } - if (this.frameCounter < 18.0) - { - this.frame.Y = num1 * 19; - break; - } - if (this.frameCounter < 23.0) - { - this.frame.Y = num1 * 18; - break; - } - this.frame.Y = num1 * 18; - this.frameCounter = 0.0; - break; - } - if ((double) this.ai[3] == 1.0) - { - this.frame.Y = num1 * 16; - this.frameCounter = 0.0; - break; + this.frame.Y = num1 * ((int) (this.frameCounter / 8.0) + 8); } + } + else + { if ((double) this.velocity.Y == 0.0) + this.spriteDirection = this.direction; + if ((double) this.velocity.Y != 0.0 || this.direction == -1 && (double) this.velocity.X > 0.0 || this.direction == 1 && (double) this.velocity.X < 0.0) { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; - ++this.frameCounter; - if (this.frameCounter > 7.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 > 15) - this.frame.Y = num1 * 2; - if (this.frame.Y / num1 < 2) - { - this.frame.Y = num1 * 2; - break; - } - break; + this.frameCounter = 0.0; + this.frame.Y = num1 * 16; + } + else if ((double) this.velocity.X == 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = 0; } - this.frameCounter = 0.0; - this.frame.Y = num1; - break; - case 472: - if ((double) this.velocity.X < 0.0) - this.direction = -1; else - this.direction = 1; + { + this.frameCounter += (double) Math.Abs(this.velocity.X); + if (this.frameCounter >= 64.0 || this.frameCounter < 0.0) + this.frameCounter = 0.0; + this.frame.Y = num1 * (int) (this.frameCounter / 8.0); + } + } + } + if (this.type == 566 || this.type == 567) + { + if ((double) this.velocity.Y == 0.0) + this.spriteDirection = this.direction; + if ((double) this.velocity.Y != 0.0 || this.direction == -1 && (double) this.velocity.X > 0.0 || this.direction == 1 && (double) this.velocity.X < 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = num1 * 8; + } + else if ((double) this.velocity.X == 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X); + if (this.frameCounter >= 64.0 || this.frameCounter < 0.0) + this.frameCounter = 0.0; + this.frame.Y = num1 * (int) (this.frameCounter / 8.0); + } + } + if (this.type == 576 || this.type == 577) + { + int num59 = this.frame.Y; + this.frame.Width = 80; + if ((double) this.ai[0] > 0.0 && (double) this.ai[1] == 0.0) + { + this.spriteDirection = this.direction; + if (num59 < 11 || num59 > 20) + { + num59 = 11; + this.frameCounter = 0.0; + } + int num60 = 4; + if (num59 == 13 || num59 == 19) + num60 = 8; + if (num59 == 14 || num59 == 18) + num60 = 2; + if (++this.frameCounter >= (double) num60 && num59 < 20) + { + this.frameCounter = 0.0; + ++num59; + } + } + else if ((double) this.ai[0] > 0.0 && (double) this.ai[1] == 2.0) + { + this.spriteDirection = this.direction; + if (num59 < 37 || num59 > 47) + { + num59 = 39; + this.frameCounter = 0.0; + } + int num61 = 5; + if (num59 == 42) + num61 = 6; + if (num59 == 45) + num61 = 8; + if (num59 == 46) + num61 = 4; + if (num59 == 47) + num61 = 26; + if (num59 == 37 || num59 == 38) + num61 = 7; + bool flag = true; + if (num59 == 46 && (double) this.velocity.Y != 0.0) + flag = false; + if (num59 == 38) + flag = false; + if (flag) + ++this.frameCounter; + if (this.frameCounter >= (double) num61) + { + if (num59 < 47) + { + this.frameCounter = 0.0; + ++num59; + } + else + { + num59 = 37; + this.frameCounter = 0.0; + } + } + } + else if ((double) this.ai[0] > 0.0 && (double) this.ai[1] == 1.0) + { + this.spriteDirection = this.direction; + if (num59 < 21 || num59 > 38) + { + num59 = 21; + this.frameCounter = 0.0; + } + if (++this.frameCounter >= 5.0 && num59 < 38) + { + this.frameCounter = 0.0; + ++num59; + } + } + else + { + if ((double) this.velocity.Y == 0.0) + this.spriteDirection = this.direction; + if ((double) this.velocity.Y != 0.0) + { + this.frameCounter = 0.0; + num59 = 43; + } + else if ((double) this.velocity.X == 0.0) + { + this.frameCounter = 0.0; + num59 = 0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X); + if (this.frameCounter >= 60.0 || this.frameCounter < 0.0) + this.frameCounter = 0.0; + num59 = 1 + (int) (this.frameCounter / 6.0); + } + } + this.frame.Y = num59; + } + if (this.type == 570 || this.type == 571) + { + if ((double) this.ai[1] > 0.0 && (double) this.ai[0] > 0.0) + { + this.spriteDirection = this.direction; + if (this.frame.Y < num1 * 10 || this.frame.Y > num1 * 15 || (double) this.ai[1] == 59.0) + { + this.frame.Y = num1 * 10; + this.frameCounter = 0.0; + } + int num62 = 5; + if (this.frame.Y == num1 * 14) + num62 = 35; + if (++this.frameCounter >= (double) num62 && this.frame.Y < num1 * 15) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + } + } + else + { + if ((double) this.velocity.Y == 0.0) + this.spriteDirection = this.direction; + if ((double) this.velocity.Y != 0.0 || this.direction == -1 && (double) this.velocity.X > 0.0 || this.direction == 1 && (double) this.velocity.X < 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = num1; + } + else if ((double) this.velocity.X == 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = num1 * 9; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X); + if (this.frameCounter >= 64.0 || this.frameCounter < 0.0) + this.frameCounter = 0.0; + this.frame.Y = num1 * (int) (this.frameCounter / 8.0 + 2.0); + } + } + } + if (this.type == 561 || this.type == 562 || this.type == 563) + { + if (this.justHit) + this.justHit = this.justHit; + if ((double) this.ai[1] > 0.0 && (double) this.ai[0] > 0.0) + { + this.spriteDirection = this.direction; + if (this.frame.Y < num1 * 10 || this.frame.Y > num1 * 13 || (double) this.ai[1] == 89.0) + { + this.frame.Y = num1 * 10; + this.frameCounter = 0.0; + } + if (++this.frameCounter >= 6.0 && this.frame.Y < num1 * 13) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + } + } + else + { + if ((double) this.velocity.Y == 0.0) + this.spriteDirection = this.direction; + if ((double) this.velocity.Y != 0.0 || this.direction == -1 && (double) this.velocity.X > 0.0 || this.direction == 1 && (double) this.velocity.X < 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = num1 * 8; + } + else if ((double) this.velocity.X == 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = num1 * 9; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X); + if (this.frameCounter >= 64.0 || this.frameCounter < 0.0) + this.frameCounter = 0.0; + this.frame.Y = num1 * (int) (this.frameCounter / 8.0); + } + } + } + if (this.type == 555 || this.type == 556 || this.type == 557) + { + if ((double) this.ai[1] > 0.0 && (double) this.ai[0] > 0.0) + { + this.spriteDirection = this.direction; + if (this.frame.Y < num1 * 10 || this.frame.Y > num1 * 16 || (double) this.ai[1] == 41.0) + { + this.frame.Y = num1 * 10; + this.frameCounter = 0.0; + } + if (++this.frameCounter >= 6.0 && this.frame.Y < num1 * 16) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + } + } + else + { + if ((double) this.velocity.Y == 0.0) + this.spriteDirection = this.direction; + if ((double) this.velocity.Y != 0.0 || this.direction == -1 && (double) this.velocity.X > 0.0 || this.direction == 1 && (double) this.velocity.X < 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = num1; + } + else if ((double) this.velocity.X == 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X); + if (this.frameCounter >= 64.0 || this.frameCounter < 0.0) + this.frameCounter = 0.0; + this.frame.Y = num1 * ((int) (this.frameCounter / 8.0) + 2); + } + } + } + if (this.type == 558 || this.type == 559 || this.type == 560) + { + if ((double) this.velocity.X > 0.0) + this.spriteDirection = 1; + if ((double) this.velocity.X < 0.0) + this.spriteDirection = -1; + float num63 = this.velocity.ToRotation(); + if ((double) this.velocity.X < 0.0) + num63 += 3.141593f; + if ((double) this.ai[0] != 2.0) + num63 = this.velocity.X * 0.1f; + this.rotation = num63; + if ((double) this.ai[0] == 2.0) + this.frame.Y = num1 * 4; + else if (++this.frameCounter >= 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + if (this.frame.Y >= num1 * 4) + this.frame.Y = 0; + } + } + if (this.type == 578) + { + this.rotation = this.velocity.X * 0.1f; + if (++this.frameCounter >= 4.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + if (this.frame.Y >= num1 * 4) + this.frame.Y = 0; + } + } + if (this.type == 574 || this.type == 575) + { + if ((double) this.velocity.X > 0.0) + this.spriteDirection = 1; + if ((double) this.velocity.X < 0.0) + this.spriteDirection = -1; + float rotation = this.velocity.ToRotation(); + if ((double) this.velocity.X < 0.0) + rotation += 3.141593f; + this.rotation = this.rotation.AngleTowards(rotation, 0.02f); + if ((double) this.ai[0] != 0.0) + { + if (this.frame.Y < num1 * 2) + { + this.frame.Y = num1 * 2; + this.frameCounter = 0.0; + } + int num64 = 4; + if (this.frame.Y >= num1 * 5) + num64 = 8; + Vector2 Position = this.Center + new Vector2((float) (56 * this.spriteDirection), -30f).RotatedBy((double) this.rotation); + if (++this.frameCounter >= (double) num64 && this.frame.Y < num1 * 9) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y == num1 * 9) + { + for (int index = 0; index < 8; ++index) + { + Dust dust = Dust.NewDustDirect(Position, 0, 0, 6, Alpha: 100); + dust.velocity *= 3f; + dust.scale = 0.6f; + dust.fadeIn = 1.2f; + dust.noGravity = true; + dust.noLight = true; + } + } + } + if (this.frame.Y >= num1 * 9 && (double) this.ai[0] < 3.0) + { + Vector2 vector2_1 = Position; + Vector2 vector2_2 = Position + (this.oldPos[3] - this.position); + int maxValue = 5; + if (this.frameCounter > 60.0) + maxValue = 4; + if (this.frameCounter > 180.0) + maxValue = 3; + if (this.frameCounter > 300.0) + maxValue = 2; + if (this.frameCounter > 600.0) + maxValue = 1; + for (int index = 0; index < 2; ++index) + { + if (Main.rand.Next(maxValue) == 0) + { + Dust dust = Dust.NewDustDirect(Vector2.Lerp(vector2_2, vector2_1, (float) ((double) index / 10.0 + 0.100000001490116)), 0, 0, 6, Alpha: 50); + dust.scale = 0.3f; + dust.fadeIn = 1.5f; + dust.noGravity = true; + dust.noLight = true; + } + } + } + } + else if (++this.frameCounter >= 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + if (this.frame.Y >= num1 * 2) + this.frame.Y = 0; + } + } + if (this.type == 549) + { + this.spriteDirection = 1; + this.rotation = 0.0f; + if (++this.frameCounter >= 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) + this.frame.Y = 0; + } + } + if (this.type == 564 || this.type == 565) + { + int y = this.frame.Y; + this.frame.Width = 80; + this.frame.Height = 80; + int num65; + if ((double) this.ai[0] > 0.0 && (double) this.ai[1] == 0.0) + { + this.spriteDirection = this.direction; + if (y < 5 || y > 13) + this.frameCounter = 0.0; + num65 = 5; + ++this.frameCounter; + int num66 = 0; + int num67; + if (this.frameCounter >= (double) (7 * (num67 = num66 + 1))) + num65 = 6; + int num68; + if (this.frameCounter >= (double) (7 * (num68 = num67 + 1))) + num65 = 7; + int num69; + if (this.frameCounter >= (double) (7 * (num69 = num68 + 1))) + num65 = 5; + int num70; + if (this.frameCounter >= (double) (7 * (num70 = num69 + 1))) + num65 = 6; + int num71; + if (this.frameCounter >= (double) (7 * (num71 = num70 + 1))) + num65 = 7; + int num72; + if (this.frameCounter >= (double) (7 * (num72 = num71 + 1))) + num65 = 5; + int num73; + if (this.frameCounter >= (double) (7 * (num73 = num72 + 1))) + num65 = 6; + int num74; + if (this.frameCounter >= (double) (7 * (num74 = num73 + 1))) + num65 = 7; + int num75; + if (this.frameCounter >= (double) (7 * (num75 = num74 + 1))) + num65 = 8; + int num76; + if (this.frameCounter >= (double) (7 * (num76 = num75 + 1))) + num65 = 9; + int num77; + if (this.frameCounter >= (double) (7 * (num77 = num76 + 1))) + num65 = 10; + int num78; + if (this.frameCounter >= (double) (7 * (num78 = num77 + 1))) + num65 = 11; + int num79; + if (this.frameCounter >= (double) (7 * (num79 = num78 + 1))) + num65 = 12; + int num80; + if (this.frameCounter >= (double) (7 * (num80 = num79 + 1))) + { + num65 = 5; + this.frameCounter = 0.0; + } + } + else if ((double) this.ai[0] > 0.0 && (double) this.ai[1] == 1.0) + { + this.spriteDirection = this.direction; + if (y < 13 || y > 25) + this.frameCounter = 0.0; + num65 = 13; + ++this.frameCounter; + int num81 = 0; + int num82; + if (this.frameCounter >= (double) (8 * (num82 = num81 + 1))) + num65 = 14; + int num83; + if (this.frameCounter >= (double) (8 * (num83 = num82 + 1))) + num65 = 15; + int num84; + if (this.frameCounter >= (double) (8 * (num84 = num83 + 1))) + num65 = 16; + int num85; + if (this.frameCounter >= (double) (8 * (num85 = num84 + 1))) + num65 = 17; + int num86; + if (this.frameCounter >= (double) (8 * (num86 = num85 + 1))) + num65 = 18; + int num87; + if (this.frameCounter >= (double) (8 * (num87 = num86 + 1))) + num65 = 19; + int num88; + if (this.frameCounter >= (double) (8 * (num88 = num87 + 1))) + num65 = 20; + int num89; + if (this.frameCounter >= (double) (8 * (num89 = num88 + 1))) + num65 = 18; + int num90; + if (this.frameCounter >= (double) (8 * (num90 = num89 + 1))) + num65 = 19; + int num91; + if (this.frameCounter >= (double) (8 * (num91 = num90 + 1))) + num65 = 20; + int num92; + if (this.frameCounter >= (double) (8 * (num92 = num91 + 1))) + num65 = 21; + int num93; + if (this.frameCounter >= (double) (8 * (num93 = num92 + 1))) + num65 = 22; + int num94; + if (this.frameCounter >= (double) (8 * (num94 = num93 + 1))) + num65 = 23; + int num95; + if (this.frameCounter >= (double) (8 * (num95 = num94 + 1))) + num65 = 24; + int num96; + if (this.frameCounter >= (double) (8 * (num96 = num95 + 1))) + num65 = 25; + int num97; + if (this.frameCounter >= (double) (8 * (num97 = num96 + 1))) + { + num65 = 14; + this.frameCounter = 0.0; + } + } + else if ((double) this.ai[0] > 0.0 && (double) this.ai[1] == 2.0) + { + this.spriteDirection = this.direction; + if (y < 26 || y > 40) + this.frameCounter = 0.0; + num65 = 26; + ++this.frameCounter; + int num98 = 0; + int num99; + if (this.frameCounter >= (double) (8 * (num99 = num98 + 1))) + num65 = 27; + int num100; + if (this.frameCounter >= (double) (8 * (num100 = num99 + 1))) + num65 = 28; + int num101; + if (this.frameCounter >= (double) (8 * (num101 = num100 + 1))) + num65 = 29; + int num102; + if (this.frameCounter >= (double) (8 * (num102 = num101 + 1))) + num65 = 26; + int num103; + if (this.frameCounter >= (double) (8 * (num103 = num102 + 1))) + num65 = 27; + int num104; + if (this.frameCounter >= (double) (8 * (num104 = num103 + 1))) + num65 = 28; + int num105; + if (this.frameCounter >= (double) (8 * (num105 = num104 + 1))) + num65 = 29; + int num106; + if (this.frameCounter >= (double) (8 * (num106 = num105 + 1))) + num65 = 26; + int num107; + if (this.frameCounter >= (double) (8 * (num107 = num106 + 1))) + num65 = 27; + int num108; + if (this.frameCounter >= (double) (8 * (num108 = num107 + 1))) + num65 = 28; + int num109; + if (this.frameCounter >= (double) (8 * (num109 = num108 + 1))) + num65 = 29; + int num110; + if (this.frameCounter >= (double) (8 * (num110 = num109 + 1))) + num65 = 30; + int num111; + if (this.frameCounter >= (double) (8 * (num111 = num110 + 1))) + num65 = 31; + int num112; + if (this.frameCounter >= (double) (8 * (num112 = num111 + 1))) + num65 = 32; + int num113; + if (this.frameCounter >= (double) (8 * (num113 = num112 + 1))) + num65 = 33; + int num114; + if (this.frameCounter >= (double) (8 * (num114 = num113 + 1))) + num65 = 34; + int num115; + if (this.frameCounter >= (double) (8 * (num115 = num114 + 1))) + num65 = 35; + int num116; + if (this.frameCounter >= (double) (8 * (num116 = num115 + 1))) + num65 = 36; + int num117; + if (this.frameCounter >= (double) (8 * (num117 = num116 + 1))) + num65 = 37; + int num118; + if (this.frameCounter >= (double) (8 * (num118 = num117 + 1))) + num65 = 38; + int num119; + if (this.frameCounter >= (double) (8 * (num119 = num118 + 1))) + num65 = 39; + int num120; + if (this.frameCounter >= (double) (8 * (num120 = num119 + 1))) + num65 = 40; + int num121; + if (this.frameCounter >= (double) (8 * (num121 = num120 + 1))) + { + num65 = 26; + this.frameCounter = 0.0; + } + } + else + { + this.frameCounter = this.frameCounter + (double) this.velocity.Length() * 0.100000001490116 + 1.0; + if (this.frameCounter >= 40.0 || this.frameCounter < 0.0) + this.frameCounter = 0.0; + num65 = (int) (this.frameCounter / 8.0); + } + this.frame.Y = num65; + } + if (this.type == 338 || this.type == 339 || this.type == 340 || this.type == 17 || this.type == 18 || this.type == 19 || this.type == 20 || this.type == 22 || this.type == 142 || this.type == 353 || this.type == 178 || this.type == 38 || this.type == 26 || this.type == 27 || this.type == 28 || this.type == 31 || this.type == 294 || this.type == 295 || this.type == 296 || this.type == 21 || this.type == 44 || this.type == 54 || this.type == 37 || this.type == 73 || this.type == 77 || this.type == 78 || this.type == 79 || this.type == 80 || this.type == 104 || this.type == 107 || this.type == 108 || this.type == 120 || this.type == 124 || this.type == 140 || this.type == 159 || this.type == 160 || this.type == 167 || this.type == 181 || this.type == 185 || this.type == 196 || this.type == 197 || this.type == 198 || this.type == 201 || this.type == 202 || this.type == 203 || this.type == 207 || this.type == 208 || this.type == 209 || this.type == 212 || this.type == 213 || this.type == 227 || this.type == 228 || this.type == 229 || this.type == 287 || this.type >= 310 && this.type <= 314 || this.type >= 322 && this.type <= 324 || this.type == 326 || this.type == 368 || this.type == 369 || this.type == 453 || this.type == 460 || this.type == 462 || this.type == 463 || this.type == 489 || this.type == 441 || this.type == 534 || this.type == 550) + { + int num122 = this.townNPC || this.type == 453 ? NPCID.Sets.ExtraFramesCount[this.type] : 0; + if ((double) this.velocity.Y == 0.0) + { if (this.direction == 1) this.spriteDirection = 1; if (this.direction == -1) this.spriteDirection = -1; - this.rotation = (float) Math.Atan2((double) this.velocity.Y * (double) this.direction, (double) this.velocity.X * (double) this.direction); - ++this.frameCounter; - if (this.frameCounter > 4.0) + int num123 = Main.npcFrameCount[this.type] - NPCID.Sets.AttackFrameCount[this.type]; + if ((double) this.ai[0] == 2.0) { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= 6) - { - this.frame.Y = 0; - break; - } - break; - case 473: - case 474: - case 475: - case 476: - if ((double) this.velocity.Y == 0.0) - this.spriteDirection = this.direction; - if ((double) this.ai[0] == 0.0 || (double) this.ai[0] == 7.0) - { - this.rotation = 0.0f; - this.frameCounter = 0.0; - this.frame.Y = 0; - break; - } - if ((double) this.ai[0] == 1.0) - { - this.rotation = 0.0f; - this.frameCounter = 0.0; - int num97 = 6; - this.frame.Y = (double) this.ai[1] >= (double) num97 ? ((double) this.ai[1] >= (double) (num97 * 2) ? ((double) this.ai[1] >= (double) (num97 * 3) ? ((double) this.ai[1] >= (double) (num97 * 4) ? ((double) this.ai[1] >= (double) (num97 * 5) ? num1 * 6 : num1 * 5) : num1 * 4) : num1 * 3) : num1 * 2) : num1; - break; - } - if ((double) this.ai[0] == 2.0 || (double) this.ai[0] == 6.0) - { - this.rotation = 0.0f; - if ((double) this.velocity.Y == 0.0) + ++this.frameCounter; + if (this.frame.Y / num1 == num123 - 1 && this.frameCounter >= 5.0) { - int num98 = 6; - ++this.frameCounter; - if (this.frame.Y < num1 * 7) - this.frame.Y = num1 * 12; - if (this.frame.Y < num1 * 10) + this.frame.Y = 0; + this.frameCounter = 0.0; + } + else if (this.frame.Y / num1 == 0 && this.frameCounter >= 40.0) + { + this.frame.Y = num1 * (num123 - 1); + this.frameCounter = 0.0; + } + else if (this.frame.Y != 0 && this.frame.Y != num1 * (num123 - 1)) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + } + else if ((double) this.ai[0] == 11.0) + { + ++this.frameCounter; + if (this.frame.Y / num1 == num123 - 1 && this.frameCounter >= 20.0) + { + if (this.frameCounter == 20.0) { - if (this.frameCounter > 8.0) + int num124 = Main.rand.Next(4); + for (int index1 = 0; index1 < 3 + num124; ++index1) { - this.frame.Y += num1; - this.frameCounter = 0.0; - if (this.frame.Y == num1 * 10) + int index2 = Dust.NewDust(this.Center + Vector2.UnitX * (float) -this.direction * 8f - Vector2.One * 5f + Vector2.UnitY * 8f, 3, 6, 216, (float) -this.direction, 1f); + Main.dust[index2].velocity /= 2f; + Main.dust[index2].scale = 0.8f; + } + if (Main.rand.Next(30) == 0) + { + int index = Gore.NewGore(this.Center + Vector2.UnitX * (float) -this.direction * 8f, Vector2.Zero, Main.rand.Next(580, 583)); + Main.gore[index].velocity /= 2f; + Main.gore[index].velocity.Y = Math.Abs(Main.gore[index].velocity.Y); + Main.gore[index].velocity.X = -Math.Abs(Main.gore[index].velocity.X) * (float) this.direction; + } + } + if (this.frameCounter >= 40.0 && Main.rand.Next(20) == 0) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + } + else if (this.frame.Y / num1 == 0 && this.frameCounter >= 20.0) + { + this.frame.Y = num1 * (num123 - 1); + this.frameCounter = 0.0; + if (Main.netMode != 1) + EmoteBubble.NewBubble(89, new WorldUIAnchor((Entity) this), 30); + } + else if (this.frame.Y != 0 && this.frame.Y != num1 * (num123 - 1)) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + } + else if ((double) this.ai[0] == 5.0) + { + this.frame.Y = num1 * (num123 - 3); + this.frameCounter = 0.0; + } + else if ((double) this.ai[0] == 6.0) + { + ++this.frameCounter; + int num125 = this.frame.Y / num1; + switch (num123 - num125) + { + case 1: + case 2: + case 4: + case 5: + int num126 = this.frameCounter >= 10.0 ? (this.frameCounter >= 16.0 ? (this.frameCounter >= 46.0 ? (this.frameCounter >= 60.0 ? (this.frameCounter >= 66.0 ? (this.frameCounter >= 72.0 ? (this.frameCounter >= 102.0 ? (this.frameCounter >= 108.0 ? (this.frameCounter >= 114.0 ? (this.frameCounter >= 120.0 ? (this.frameCounter >= 150.0 ? (this.frameCounter >= 156.0 ? (this.frameCounter >= 162.0 ? (this.frameCounter >= 168.0 ? (this.frameCounter >= 198.0 ? (this.frameCounter >= 204.0 ? (this.frameCounter >= 210.0 ? (this.frameCounter >= 216.0 ? (this.frameCounter >= 246.0 ? (this.frameCounter >= 252.0 ? (this.frameCounter >= 258.0 ? (this.frameCounter >= 264.0 ? (this.frameCounter >= 294.0 ? (this.frameCounter >= 300.0 ? 0 : num123 - 5) : num123 - 4) : num123 - 5) : 0) : num123 - 5) : num123 - 4) : num123 - 5) : 0) : num123 - 5) : num123 - 4) : num123 - 5) : 0) : num123 - 5) : num123 - 4) : num123 - 5) : 0) : num123 - 5) : num123 - 4) : num123 - 5) : 0) : num123 - 5) : num123 - 4) : num123 - 5) : 0; + if (num126 == num123 - 4 && num125 == num123 - 5) + { + Vector2 Position = this.Center + new Vector2((float) (10 * this.direction), -4f); + for (int index3 = 0; index3 < 8; ++index3) { - this.frameCounter = (double) (num98 * 2); - break; + int Type = Main.rand.Next(139, 143); + int index4 = Dust.NewDust(Position, 0, 0, Type, this.velocity.X + (float) this.direction, this.velocity.Y - 2.5f, Scale: 1.2f); + Main.dust[index4].velocity.X += (float) this.direction * 1.5f; + Main.dust[index4].position -= new Vector2(4f); + Main.dust[index4].velocity *= 2f; + Main.dust[index4].scale = (float) (0.699999988079071 + (double) Main.rand.NextFloat() * 0.300000011920929); } + } + this.frame.Y = num1 * num126; + if (this.frameCounter >= 300.0) + { + this.frameCounter = 0.0; break; } break; - } - if (this.frameCounter < (double) num98) - { - this.frame.Y = num1 * 12; - break; - } - if (this.frameCounter < (double) (num98 * 2)) - { - this.frame.Y = num1 * 11; - break; - } - if (this.frameCounter < (double) (num98 * 3)) - { - this.frame.Y = num1 * 10; - break; - } - this.frame.Y = num1 * 11; - if (this.frameCounter >= (double) (num98 * 4 - 1)) - { - this.frameCounter = 0.0; - break; - } - break; + default: + if (num125 != 0) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + goto case 1; + } + else + goto case 1; } - this.frame.Y = num1 * 13; - this.frameCounter = 0.0; - break; } - if ((double) this.ai[0] == 3.0) + else if ((double) this.ai[0] == 7.0) { - this.rotation = 0.0f; ++this.frameCounter; - if (this.frameCounter > 6.0) + int num127 = this.frame.Y / num1; + switch (num123 - num127) { - this.frameCounter = 0.0; - if (this.frame.Y > num1 * 7) - { - this.frame.Y -= num1; + case 1: + case 2: + case 4: + case 5: + int num128 = 0; + if (this.frameCounter < 16.0) + num128 = 0; + else if (this.frameCounter == 16.0 && Main.netMode != 1) + EmoteBubble.NewBubbleNPC(new WorldUIAnchor((Entity) this), 112); + else if (this.frameCounter < 128.0) + num128 = this.frameCounter % 16.0 < 8.0 ? num123 - 2 : 0; + else if (this.frameCounter < 160.0) + num128 = 0; + else if (this.frameCounter == 160.0 && Main.netMode != 1) + EmoteBubble.NewBubbleNPC(new WorldUIAnchor((Entity) this), 60); + else + num128 = this.frameCounter >= 220.0 ? 0 : (this.frameCounter % 12.0 < 6.0 ? num123 - 2 : 0); + this.frame.Y = num1 * num128; + if (this.frameCounter >= 220.0) + { + this.frameCounter = 0.0; + break; + } break; - } - break; + default: + if (num127 != 0) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + goto case 1; + } + else + goto case 1; } - break; } - if ((double) this.ai[0] == 4.0 || (double) this.ai[0] == 5.0) + else if ((double) this.ai[0] == 9.0) { - if ((double) this.ai[0] == 4.0 && (double) this.ai[2] == 1.0) - this.rotation = 0.0f; - this.frame.Y = num1 * 13; - this.frameCounter = 0.0; - break; - } - if ((double) this.ai[0] == 4.09999990463257) - { - this.rotation = 0.0f; - if (this.frame.Y > num1 * 6) - this.frameCounter = 0.0; ++this.frameCounter; - int num99 = 4; - if (this.frameCounter < (double) num99) + int num129 = this.frame.Y / num1; + switch (num123 - num129) { - this.frame.Y = num1 * 6; - break; - } - if (this.frameCounter < (double) (num99 * 2)) - { - this.frame.Y = num1 * 5; - break; - } - if (this.frameCounter < (double) (num99 * 3)) - { - this.frame.Y = num1 * 4; - break; - } - if (this.frameCounter < (double) (num99 * 4)) - { - this.frame.Y = num1 * 3; - break; - } - if (this.frameCounter < (double) (num99 * 5)) - { - this.frame.Y = num1 * 4; - break; - } - this.frame.Y = num1 * 5; - if (this.frameCounter >= (double) (num99 * 6 - 1)) - { - this.frameCounter = 0.0; - break; - } - break; - } - break; - case 477: - this.frameCounter += (double) this.velocity.Length() / 4.0; - ++this.frameCounter; - if (this.frameCounter >= 6.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - } - if (this.frame.Y / num1 > 5) - { - this.frame.Y = 0; - break; - } - break; - case 479: - ++this.frameCounter; - int num100 = 4; - if (this.frameCounter < (double) num100) - { - this.frame.Y = 0; - break; - } - if (this.frameCounter < (double) (num100 * 2)) - { - this.frame.Y = num1; - break; - } - if (this.frameCounter < (double) (num100 * 3)) - { - this.frame.Y = num1 * 2; - break; - } - if (this.frameCounter < (double) (num100 * 4 - 1)) - { - this.frame.Y = num1; - break; - } - this.frameCounter = 0.0; - break; - case 480: - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - if ((double) this.ai[2] < 0.0) - { - ++this.frameCounter; - if (this.frameCounter > 3.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y >= Main.npcFrameCount[this.type] * num1) - { - this.frame.Y = num1 * 21; + case 1: + case 2: + case 4: + case 5: + int num130 = this.frameCounter >= 10.0 ? (this.frameCounter >= 16.0 ? num123 - 4 : num123 - 5) : 0; + if ((double) this.ai[1] < 16.0) + num130 = num123 - 5; + if ((double) this.ai[1] < 10.0) + num130 = 0; + this.frame.Y = num1 * num130; break; - } - if (this.frame.Y < num1 * 21) - { - this.frame.Y = num1 * 21; - break; - } - break; + default: + if (num129 != 0) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + goto case 1; + } + else + goto case 1; } - if ((double) this.velocity.X == 0.0) - { - ++this.frameCounter; - if (this.frameCounter > 4.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 > 7) - { - this.frame.Y = 0; - break; - } - break; - } - this.frameCounter += 1.0 + (double) Math.Abs(this.velocity.X); - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type] - 4) - { - this.frame.Y = num1 * 10; - break; - } - if (this.frame.Y / num1 < 10) - { - this.frame.Y = num1 * 10; - break; - } - break; } - this.frameCounter = 0.0; - this.frame.Y = num1 * 8; - break; - case 481: - if ((double) this.velocity.Y == 0.0) + else if ((double) this.ai[0] == 18.0) { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - if ((double) this.ai[2] > 0.0) + ++this.frameCounter; + int num131 = this.frame.Y / num1; + switch (num123 - num131) { - this.spriteDirection = this.direction; - int num101 = 0; - if ((double) this.ai[1] < 22.0) - num101 = -14; - else if ((double) this.ai[1] < 28.0) - num101 = 3; - else if ((double) this.ai[1] < 34.0) - num101 = 2; - else if ((double) this.ai[1] < 40.0) - num101 = 1; - this.frame.Y = num1 * (15 + num101); - this.frameCounter = 0.0; - break; + case 1: + case 2: + case 4: + case 5: + int num132 = 0; + num132 = this.frameCounter >= 10.0 ? (this.frameCounter >= 16.0 ? num123 - 2 : num123 - 1) : 0; + if ((double) this.ai[1] < 16.0) + num132 = num123 - 1; + if ((double) this.ai[1] < 10.0) + num132 = 0; + int num133 = Main.npcFrameCount[this.type] - 2; + this.frame.Y = num1 * num133; + break; + default: + if (num131 != 0) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + goto case 1; + } + else + goto case 1; } - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = num1; - break; - } - if (this.frame.Y < num1 * 2) - this.frame.Y = num1 * 2; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= 15) - { - this.frame.Y = num1 * 2; - break; - } - break; } - this.frameCounter = 0.0; - this.frame.Y = 0; - break; - case 482: - if ((double) this.velocity.Y == 0.0) + else if ((double) this.ai[0] == 10.0 || (double) this.ai[0] == 13.0) { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - if ((double) this.ai[2] < 0.0) + ++this.frameCounter; + int num134 = this.frame.Y / num1; + if ((uint) (num134 - num123) > 3U && num134 != 0) { - ++this.frameCounter; - if (this.frameCounter > 3.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y >= Main.npcFrameCount[this.type] * num1) - { - this.frame.Y = num1 * 11; - break; - } - if (this.frame.Y < num1 * 11) - { - this.frame.Y = num1 * 11; - break; - } - break; - } - if ((double) this.velocity.X == 0.0) - { - ++this.frameCounter; this.frame.Y = 0; - break; - } - this.frameCounter += 0.200000002980232 + (double) Math.Abs(this.velocity.X); - if (this.frameCounter > 8.0) - { - this.frame.Y += num1; this.frameCounter = 0.0; } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type] - 10) - { - this.frame.Y = num1 * 2; - break; - } - if (this.frame.Y / num1 < 2) - { - this.frame.Y = num1 * 2; - break; - } - break; + int num135 = 10; + int num136 = 6; + int num137 = this.frameCounter >= (double) num135 ? (this.frameCounter >= (double) (num135 + num136) ? (this.frameCounter >= (double) (num135 + num136 * 2) ? (this.frameCounter >= (double) (num135 + num136 * 3) ? (this.frameCounter >= (double) (num135 + num136 * 4) ? 0 : num123 + 3) : num123 + 2) : num123 + 1) : num123) : 0; + this.frame.Y = num1 * num137; } - this.frameCounter = 0.0; - this.frame.Y = num1; - break; - case 483: - if ((double) this.ai[0] == -1.0) + else if ((double) this.ai[0] == 15.0) { ++this.frameCounter; - if (this.frameCounter > 4.0) + int num138 = this.frame.Y / num1; + if ((uint) (num138 - num123) > 3U && num138 != 0) { - this.frame.Y += num1; + this.frame.Y = 0; this.frameCounter = 0.0; } - if (this.frame.Y > num1 * 21) - this.frame.Y = num1 * 21; - else if (this.frame.Y < num1 * 13) - this.frame.Y = num1 * 13; - this.rotation += this.velocity.X * 0.2f; - break; + float num139 = this.ai[1] / (float) NPCID.Sets.AttackTime[this.type]; + int num140 = (double) num139 <= 0.649999976158142 ? ((double) num139 <= 0.5 ? ((double) num139 <= 0.349999994039536 ? ((double) num139 <= 0.0 ? 0 : num123 + 3) : num123 + 2) : num123 + 1) : num123; + this.frame.Y = num1 * num140; } - ++this.frameCounter; - if (this.frameCounter > 4.0) + else if ((double) this.ai[0] == 12.0) { - this.frame.Y += num1; - this.frameCounter = 0.0; + ++this.frameCounter; + int num141 = this.frame.Y / num1; + if ((uint) (num141 - num123) > 4U && num141 != 0) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + int num142 = num123 + this.GetShootingFrame(this.ai[2]); + this.frame.Y = num1 * num142; } - if (this.frame.Y > num1 * 11) - this.frame.Y = 0; - this.rotation = this.velocity.X * 0.1f; - break; - case 485: - case 486: - case 487: - this.spriteDirection = this.direction; - this.localAI[0] = -2f; - if ((double) this.velocity.Y == 0.0) + else if ((double) this.ai[0] == 14.0) { - this.rotation = 0.0f; - if ((double) this.velocity.X == 0.0) + ++this.frameCounter; + int num143 = this.frame.Y / num1; + if ((uint) (num143 - num123) > 1U && num143 != 0) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + int num144 = 12; + int num145 = this.frameCounter % (double) num144 * 2.0 < (double) num144 ? num123 : num123 + 1; + this.frame.Y = num1 * num145; + } + else if ((double) this.ai[0] == 3.0 || (double) this.ai[0] == 4.0) + { + ++this.frameCounter; + int num146 = this.frame.Y / num1; + switch (num123 - num146) + { + case 1: + case 2: + case 4: + case 5: + bool flag = (double) this.ai[0] == 3.0; + int num147 = 0; + int num148 = 0; + int time1 = -1; + int time2 = -1; + if (this.frameCounter < 10.0) + num147 = 0; + else if (this.frameCounter < 16.0) + num147 = num123 - 5; + else if (this.frameCounter < 46.0) + num147 = num123 - 4; + else if (this.frameCounter < 60.0) + num147 = num123 - 5; + else if (this.frameCounter < 216.0) + num147 = 0; + else if (this.frameCounter == 216.0 && Main.netMode != 1) + time1 = 70; + else if (this.frameCounter < 286.0) + num147 = this.frameCounter % 12.0 < 6.0 ? num123 - 2 : 0; + else if (this.frameCounter < 320.0) + num147 = 0; + else if (this.frameCounter == 320.0 && Main.netMode != 1) + time1 = 100; + else + num147 = this.frameCounter >= 420.0 ? 0 : (this.frameCounter % 16.0 < 8.0 ? num123 - 2 : 0); + if (this.frameCounter < 70.0) + num148 = 0; + else if (this.frameCounter == 70.0 && Main.netMode != 1) + time2 = 90; + else + num148 = this.frameCounter >= 160.0 ? (this.frameCounter >= 166.0 ? (this.frameCounter >= 186.0 ? (this.frameCounter >= 200.0 ? (this.frameCounter >= 320.0 ? (this.frameCounter >= 326.0 ? 0 : num123 - 1) : 0) : num123 - 5) : num123 - 4) : num123 - 5) : (this.frameCounter % 16.0 < 8.0 ? num123 - 2 : 0); + if (flag) + { + if (time1 != -1) + EmoteBubble.NewBubbleNPC(new WorldUIAnchor((Entity) this), time1, new WorldUIAnchor((Entity) Main.npc[(int) this.ai[2]])); + if (time2 != -1) + EmoteBubble.NewBubbleNPC(new WorldUIAnchor((Entity) Main.npc[(int) this.ai[2]]), time2, new WorldUIAnchor((Entity) this)); + } + this.frame.Y = num1 * (flag ? num147 : num148); + if (this.frameCounter >= 420.0) + { + this.frameCounter = 0.0; + break; + } + break; + default: + if (num146 != 0) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + goto case 1; + } + else + goto case 1; + } + } + else if ((double) this.ai[0] == 16.0 || (double) this.ai[0] == 17.0) + { + ++this.frameCounter; + int num149 = this.frame.Y / num1; + switch (num123 - num149) + { + case 1: + case 2: + case 4: + case 5: + bool flag = (double) this.ai[0] == 16.0; + int num150 = 0; + int time = -1; + if (this.frameCounter < 10.0) + num150 = 0; + else if (this.frameCounter < 16.0) + num150 = num123 - 5; + else if (this.frameCounter < 22.0) + num150 = num123 - 4; + else if (this.frameCounter < 28.0) + num150 = num123 - 5; + else if (this.frameCounter < 34.0) + num150 = num123 - 4; + else if (this.frameCounter < 40.0) + num150 = num123 - 5; + else if (this.frameCounter == 40.0 && Main.netMode != 1) + time = 45; + else if (this.frameCounter < 70.0) + num150 = num123 - 4; + else if (this.frameCounter < 76.0) + num150 = num123 - 5; + else if (this.frameCounter < 82.0) + num150 = num123 - 4; + else if (this.frameCounter < 88.0) + num150 = num123 - 5; + else if (this.frameCounter < 94.0) + num150 = num123 - 4; + else if (this.frameCounter < 100.0) + num150 = num123 - 5; + else if (this.frameCounter == 100.0 && Main.netMode != 1) + time = 45; + else if (this.frameCounter < 130.0) + num150 = num123 - 4; + else if (this.frameCounter < 136.0) + num150 = num123 - 5; + else if (this.frameCounter < 142.0) + num150 = num123 - 4; + else if (this.frameCounter < 148.0) + num150 = num123 - 5; + else if (this.frameCounter < 154.0) + num150 = num123 - 4; + else if (this.frameCounter < 160.0) + num150 = num123 - 5; + else if (this.frameCounter == 160.0 && Main.netMode != 1) + time = 75; + else + num150 = this.frameCounter >= 220.0 ? (this.frameCounter >= 226.0 ? 0 : num123 - 5) : num123 - 4; + if (flag && time != -1) + { + int num151 = (int) this.localAI[2]; + int num152 = (int) this.localAI[3]; + int num153 = (int) Main.npc[(int) this.ai[2]].localAI[3]; + int num154 = (int) Main.npc[(int) this.ai[2]].localAI[2]; + int num155 = 3 - num151 - num152; + int num156 = 0; + if (this.frameCounter == 40.0) + num156 = 1; + if (this.frameCounter == 100.0) + num156 = 2; + if (this.frameCounter == 160.0) + num156 = 3; + int num157 = 3 - num156; + int num158 = -1; + int num159 = 0; + while (num158 < 0 && ++num159 < 100) + { + num158 = Main.rand.Next(2); + if (num158 == 0 && num154 >= num152) + num158 = -1; + if (num158 == 1 && num153 >= num151) + num158 = -1; + if (num158 == -1 && num157 <= num155) + num158 = 2; + } + if (num158 == 0) + { + ++Main.npc[(int) this.ai[2]].localAI[3]; + ++num153; + } + if (num158 == 1) + { + ++Main.npc[(int) this.ai[2]].localAI[2]; + ++num154; + } + int emoticon1 = Utils.SelectRandom(Main.rand, 38, 37, 36); + int emoticon2 = emoticon1; + if (num158 == 0) + { + switch (emoticon1) + { + case 36: + emoticon2 = 38; + break; + case 37: + emoticon2 = 36; + break; + case 38: + emoticon2 = 37; + break; + } + } + else if (num158 == 1) + { + switch (emoticon1) + { + case 36: + emoticon2 = 37; + break; + case 37: + emoticon2 = 38; + break; + case 38: + emoticon2 = 36; + break; + } + } + if (num157 == 0) + { + if (num153 >= 2) + emoticon1 -= 3; + if (num154 >= 2) + emoticon2 -= 3; + } + EmoteBubble.NewBubble(emoticon1, new WorldUIAnchor((Entity) this), time); + EmoteBubble.NewBubble(emoticon2, new WorldUIAnchor((Entity) Main.npc[(int) this.ai[2]]), time); + } + this.frame.Y = num1 * (flag ? num150 : num150); + if (this.frameCounter >= 420.0) + { + this.frameCounter = 0.0; + break; + } + break; + default: + if (num149 != 0) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + goto case 1; + } + else + goto case 1; + } + } + else if ((double) this.velocity.X == 0.0) + { + if (this.type == 140 || this.type == 287 || this.type == 489) { this.frame.Y = num1; this.frameCounter = 0.0; } else { - this.frameCounter += (double) Math.Abs(this.velocity.X * 5f); - if (this.frameCounter > 10.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y > num1 * 3) - this.frame.Y = 0; - } + this.frame.Y = 0; + this.frameCounter = 0.0; } } else { - this.rotation += (float) this.direction * 0.1f; - this.frame.Y = num1; - } - int i2 = (int) this.Center.X / 16; - int j3 = (int) this.position.Y / 16; - Tile tileSafely2 = Framing.GetTileSafely(i2, j3); - if (tileSafely2 != null) - { - if (tileSafely2.slope() == (byte) 0) + int num160 = 6; + if (this.type == 534) + num160 = 12; + if (this.type == 489) { - int j4 = j3 + 1; - tileSafely2 = Framing.GetTileSafely(i2, j4); + num160 = 8; + this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.0; + this.frameCounter += 0.5; } - if (tileSafely2.slope() == (byte) 1) + else { - this.rotation = 0.785f; - this.localAI[0] = 0.0f; - break; + this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; + ++this.frameCounter; } - if (tileSafely2.slope() == (byte) 2) + if (this.type == 462) + num160 = 9; + if (this.frameCounter > (double) num160) { - this.rotation = -0.785f; - this.localAI[0] = 0.0f; - break; + this.frame.Y += num1; + this.frameCounter = 0.0; } - break; + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type] - num122) + this.frame.Y = num1 * 2; } - break; - case 488: - int num102 = (int) this.localAI[1]; - if (Framing.GetTileSafely((int) this.ai[0], (int) this.ai[1]).frameX >= (short) 36) - num102 *= -1; - if ((double) this.localAI[0] > 24.0) - this.localAI[0] = 24f; - if ((double) this.localAI[0] > 0.0) - --this.localAI[0]; - if ((double) this.localAI[0] < 0.0) - this.localAI[0] = 0.0f; - int num103 = num102 == -1 ? 4 : 6; - int num104 = (int) this.localAI[0] / num103; - if ((double) this.localAI[0] % (double) num103 != 0.0) - ++num104; - if (num104 != 0 && num102 == 1) - num104 += 5; - this.frame.Y = num104 * num1; - break; - case 490: - this.rotation = this.velocity.X * 0.15f; - ++this.frameCounter; - if (this.frameCounter > 6.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - } - if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) - { + } + else if (this.type == 462) + { + this.frameCounter = 0.0; + this.frame.Y = (double) this.velocity.Y >= 0.0 ? num1 * 2 : num1; + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num1; + if (this.type == 489 || this.type == 21 || this.type == 31 || this.type == 294 || this.type == 326 || this.type == 295 || this.type == 296 || this.type == 44 || this.type == 77 || this.type == 78 || this.type == 79 || this.type == 80 || this.type == 120 || this.type == 140 || this.type == 159 || this.type == 167 || this.type == 197 || this.type == 201 || this.type == 202 || this.type == 203 || this.type == 287 || this.type >= 322 && this.type <= 324) this.frame.Y = 0; - break; - } - break; - case 492: - this.frame.Y = num1 * (int) this.ai[2]; - break; - case 494: - case 495: - if ((double) this.ai[2] > 0.0) - { - if ((double) this.ai[2] < 7.0) - { - this.frame.Y = num1 * 5; - break; - } - if ((double) this.ai[2] < 14.0) - { - this.frame.Y = num1 * 6; - break; - } - if ((double) this.ai[2] < 20.0) - { - this.frame.Y = num1 * 7; - break; - } - break; - } + if (this.type == 181) + this.frame.Y = num1 * 14; + } + } + if (this.type >= 494 && this.type <= 495) + { + if ((double) this.ai[2] > 0.0) + { + if ((double) this.ai[2] < 7.0) + this.frame.Y = num1 * 5; + else if ((double) this.ai[2] < 14.0) + this.frame.Y = num1 * 6; + else if ((double) this.ai[2] < 20.0) + this.frame.Y = num1 * 7; + } + else + { if ((double) this.velocity.Y == 0.0) { if (this.direction == 1) @@ -35484,118 +24526,74 @@ label_422: { this.frameCounter = 0.0; this.frame.Y = (double) this.velocity.Y >= 0.0 ? num1 * 3 : num1 * 2; - break; } - if ((double) this.velocity.X == 0.0) + else if ((double) this.velocity.X == 0.0) { this.frameCounter = 0.0; this.frame.Y = 0; - break; } - this.frameCounter += (double) Math.Abs(this.velocity.X); - if (this.frameCounter < 8.0) + else { - this.frame.Y = 0; - break; - } - if (this.frameCounter < 16.0) - { - this.frame.Y = num1; - break; - } - if (this.frameCounter < 24.0) - { - this.frame.Y = num1 * 2; - break; - } - if (this.frameCounter < 32.0) - { - this.frame.Y = num1 * 3; - break; - } - if (this.frameCounter < 39.0) - { - this.frame.Y = num1 * 4; - break; - } - this.frame.Y = num1 * 4; - this.frameCounter = 0.0; - break; - case 496: - case 497: - if ((double) this.ai[0] == 0.0) - { - this.rotation = 0.0f; - if ((double) this.velocity.Y == 0.0) - this.spriteDirection = this.direction; - else if ((double) this.velocity.Y < 0.0) - this.frameCounter = 0.0; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.10000002384186; - if (this.frameCounter < 6.0) - { + this.frameCounter += (double) Math.Abs(this.velocity.X); + if (this.frameCounter < 8.0) this.frame.Y = 0; - break; - } - if (this.frameCounter < 12.0) - { + else if (this.frameCounter < 16.0) this.frame.Y = num1; - break; - } - if (this.frameCounter < 18.0) - { + else if (this.frameCounter < 24.0) this.frame.Y = num1 * 2; - break; - } - if (this.frameCounter < 24.0) - { + else if (this.frameCounter < 32.0) this.frame.Y = num1 * 3; - break; - } - this.frameCounter = 0.0; - break; - } - if ((double) this.ai[0] == 1.0) - { - this.frameCounter = 0.0; - this.frame.Y = (double) this.ai[1] >= 10.0 ? ((double) this.ai[1] >= 20.0 ? num1 * 6 : num1 * 5) : num1 * 4; - break; - } - if ((double) this.ai[0] == 5.0) - { - this.frameCounter = 0.0; - this.frame.Y = (double) this.ai[1] >= 10.0 ? ((double) this.ai[1] >= 20.0 ? num1 * 3 : num1 * 11) : num1 * 10; - break; - } - this.frameCounter = 0.0; - this.frame.Y = num1 * 7; - break; - case 498: - case 499: - case 500: - case 501: - case 502: - case 503: - case 504: - case 505: - case 506: - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - if ((double) this.ai[2] > 0.0) + else if (this.frameCounter < 39.0) { - this.spriteDirection = this.direction; - this.frame.Y = (double) this.ai[1] >= 12.0 ? ((double) this.ai[1] >= 34.0 ? num1 * 8 : num1 * 9) : num1 * 8; + this.frame.Y = num1 * 4; + } + else + { + this.frame.Y = num1 * 4; this.frameCounter = 0.0; - break; - } - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = 0; - break; } + } + } + } + if (this.type == 541) + { + if ((double) this.ai[0] > 0.0) + { + float num161 = this.ai[0]; + this.frame.Y = (double) num161 >= 6.0 ? ((double) num161 >= 105.0 ? ((double) num161 >= 114.0 ? ((double) num161 >= 135.0 ? num1 : num1 * (int) (((double) num161 - 99.0 - 15.0) / 7.0 + 10.0)) : num1 * 9) : num1 * (int) ((double) num161 / 8.0 % 4.0 + 5.0)) : num1 * 4; + } + else + { + this.frameCounter = this.frameCounter + (double) this.velocity.Length() * 0.100000001490116 + 1.0; + if (this.frameCounter >= 8.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num1 * 4) + this.frame.Y = 0; + } + } + if (this.type >= 498 && this.type <= 506) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + if ((double) this.ai[2] > 0.0) + { + this.spriteDirection = this.direction; + this.frame.Y = (double) this.ai[1] >= 12.0 ? ((double) this.ai[1] >= 34.0 ? num1 * 8 : num1 * 9) : num1 * 8; + this.frameCounter = 0.0; + } + else if ((double) this.velocity.X == 0.0) + { + this.frame.Y = 0; + } + else + { this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.0; if (this.frameCounter > 4.0) { @@ -35603,192 +24601,28 @@ label_422: this.frameCounter = 0.0; } if (this.frame.Y > num1 * 7) - { this.frame.Y = 0; - break; - } - break; } + } + else + { this.frameCounter = 0.0; this.frame.Y = num1 * 10; - break; - case 508: - case 532: - case 580: - case 582: - if ((double) this.velocity.Y != 0.0) - { - this.frame.Y = num1; - break; - } + } + } + else if (this.type >= 524 && this.type <= 527) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction != 0) + this.spriteDirection = this.direction; if ((double) this.velocity.X == 0.0) { this.frame.Y = 0; - break; - } - if (this.direction < 0 && (double) this.velocity.X < 0.0) - this.spriteDirection = -1; - if (this.direction > 0 && (double) this.velocity.X > 0.0) - this.spriteDirection = 1; - if (this.frame.Y / num1 < 2) - this.frame.Y = num1 * 2; - this.frameCounter += 1.0 + (double) Math.Abs(this.velocity.X) / 2.0; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; this.frameCounter = 0.0; } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = num1 * 2; - break; - } - break; - case 509: - case 581: - if ((double) this.velocity.X > 0.0 && this.direction > 0 || (double) this.velocity.X < 0.0 && this.direction < 0) - this.spriteDirection = this.direction; - if (++this.frameCounter >= 3.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 516: - if ((double) this.localAI[1] == 0.0) - { - this.localAI[1] = 1f; - this.frame.Y = num1 * Main.rand.Next(3); - this.frameCounter += (double) Main.rand.Next(3); - } - ++this.frameCounter; - if (this.frameCounter > 3.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y > num1 * 3) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 518: - if ((double) this.velocity.Y == 0.0) - { - if (this.direction != 0) - this.spriteDirection = this.direction; - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - break; - } - if (this.frame.Y < num1 * 2) - this.frame.Y = num1 * 2; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.0; - ++this.frameCounter; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = num1 * 2; - break; - } - break; - } - this.frame.Y = num1; - this.frameCounter = 0.0; - break; - case 520: - if ((double) this.velocity.Y == 0.0) - { - this.spriteDirection = this.direction; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.0; - if (this.frameCounter > 6.0) - { - if ((double) Math.Abs(this.velocity.X) < 0.200000002980232) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - } - else - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - this.frame.Y = num1; - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = 0; - break; - } - break; - } - this.frameCounter = 0.0; - this.frame.Y = num1; - break; - case 521: - if ((double) this.velocity.X < 0.0) - this.direction = -1; else - this.direction = 1; - if (this.direction != 0) - this.spriteDirection = this.direction; - this.rotation = (float) Math.Atan2((double) this.velocity.Y * (double) this.spriteDirection, (double) this.velocity.X * (double) this.spriteDirection) + this.velocity.X * 0.1f; - if (++this.frameCounter >= 5.0) { - this.frame.Y += num1; - this.frameCounter = 0.0; - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 523: - if (++this.frameCounter >= 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 524: - case 525: - case 526: - case 527: - if ((double) this.velocity.Y == 0.0) - { - if (this.direction != 0) - this.spriteDirection = this.direction; - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - break; - } - if (this.frame.Y <= num1) - this.frame.Y = num1 * 2; this.frameCounter += (double) Math.Abs(this.velocity.X); ++this.frameCounter; if (this.frameCounter > 9.0) @@ -35797,27 +24631,28 @@ label_422: this.frameCounter = 0.0; } if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { this.frame.Y = num1 * 2; - break; - } - break; } + } + else + { this.frame.Y = num1; this.frameCounter = 0.0; - break; - case 528: - case 529: - if ((double) this.velocity.Y == 0.0) + } + } + else if (this.type >= 528 && this.type <= 529) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction != 0) + this.spriteDirection = this.direction; + if ((double) this.velocity.X == 0.0) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + else { - if (this.direction != 0) - this.spriteDirection = this.direction; - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - break; - } this.frameCounter += (double) Math.Abs(this.velocity.X); ++this.frameCounter; if (this.frameCounter > 9.0) @@ -35826,2057 +24661,64 @@ label_422: this.frameCounter = 0.0; } if (this.frame.Y / num1 >= Main.npcFrameCount[this.type] - 1) - { this.frame.Y = num1; - break; - } - break; } + } + else + { this.frame.Y = num1 * (Main.npcFrameCount[this.type] - 1); this.frameCounter = 0.0; - break; - case 533: - if ((double) this.velocity.Y == 0.0 && this.direction != 0) - this.spriteDirection = this.direction; - ++this.frameCounter; - if (this.frameCounter >= 48.0) - this.frameCounter = 0.0; - this.frame.Y = (int) (this.frameCounter / 6.0) * num1; - if ((double) this.ai[1] > 0.0) - { - this.frame.Y += num1 * 8; - break; - } - break; - case 541: - if ((double) this.ai[0] > 0.0) - { - float num105 = this.ai[0]; - this.frame.Y = (double) num105 >= 6.0 ? ((double) num105 >= 105.0 ? ((double) num105 >= 114.0 ? ((double) num105 >= 135.0 ? num1 : num1 * (int) (((double) num105 - 99.0 - 15.0) / 7.0 + 10.0)) : num1 * 9) : num1 * (int) ((double) num105 / 8.0 % 4.0 + 5.0)) : num1 * 4; - break; - } - this.frameCounter = this.frameCounter + (double) this.velocity.Length() * 0.100000001490116 + 1.0; - if (this.frameCounter >= 8.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y >= num1 * 4) - { - this.frame.Y = 0; - break; - } - break; - case 542: - case 543: - case 544: - case 545: - this.spriteDirection = this.direction; - ++this.frameCounter; - if (this.frameCounter >= 16.0) - this.frameCounter = 0.0; - this.frame.Y = num1 * (int) (this.frameCounter / 4.0); - break; - case 549: - this.spriteDirection = 1; - this.rotation = 0.0f; - if (++this.frameCounter >= 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 551: - int num106 = this.frame.Y / num1; - int num107; - if ((double) this.ai[0] == 4.0) - { - float num108 = 60f; - int num109 = 6 * 10; - if (num106 < 5) - this.frameCounter = 0.0; - num107 = 5; - this.frameCounter = (double) (int) this.ai[1]; - int num110 = 0; - int num111; - if (this.frameCounter >= (double) (5 * (num111 = num110 + 1))) - num107 = 6; - num111 = 0; - if (this.frameCounter >= (double) num108 - 6.0) - num107 = 7; - if (this.frameCounter >= (double) num108 - 3.0) - num107 = 8; - if (this.frameCounter >= (double) num108) - num107 = 9 + (int) this.frameCounter / 3 % 2; - int num112 = 0; - if (this.frameCounter >= (double) num108 + (double) num109 + 3.0) - num107 = 8; - int num113; - if (this.frameCounter >= (double) num108 + (double) num109 + 3.0 + (double) (5 * (num113 = num112 + 1))) - num107 = 7; - if (this.frameCounter >= (double) num108 + (double) num109 + 3.0 + (double) (5 * (num111 = num113 + 1))) - num107 = 0; - } - else if ((double) this.ai[0] == 3.0) - { - float num114 = 40f; - float num115 = 80f; - float num116 = num114 + num115; - float num117 = 25f; - if (num106 < 5) - this.frameCounter = 0.0; - num107 = 5; - this.frameCounter = (double) (int) this.ai[1]; - int num118 = 0; - int num119; - if (this.frameCounter >= (double) (5 * (num119 = num118 + 1))) - num107 = 6; - num119 = 0; - if (this.frameCounter >= (double) num114 - 6.0) - num107 = 7; - if (this.frameCounter >= (double) num114 - 3.0) - num107 = 8; - if (this.frameCounter >= (double) num114) - num107 = 9 + (int) this.frameCounter / 3 % 2; - int num120 = 0; - if (this.frameCounter >= (double) num116 - (double) num117 + 3.0) - num107 = 8; - int num121; - if (this.frameCounter >= (double) num116 - (double) num117 + 3.0 + (double) (5 * (num121 = num120 + 1))) - num107 = 7; - if (this.frameCounter >= (double) num116 - (double) num117 + 3.0 + (double) (5 * (num119 = num121 + 1))) - num107 = 0; - } - else if ((double) this.ai[0] == 5.0) - num107 = 3; - else if ((double) this.ai[0] == 6.0) - { - if (num106 > 4) - this.frameCounter = 0.0; - num107 = 1; - this.frameCounter = (double) (int) this.ai[1]; - int num122 = 0; - int num123; - if (this.frameCounter >= (double) (8 * (num123 = num122 + 1))) - num107 = 2; - int num124; - if (this.frameCounter >= (double) (8 * (num124 = num123 + 1))) - num107 = 3; - int num125; - if (this.frameCounter >= (double) (8 * (num125 = num124 + 1))) - num107 = 4; - int num126; - if (this.frameCounter >= (double) (8 * (num126 = num125 + 1))) - num107 = 3; - int num127; - if (this.frameCounter >= (double) (8 * (num127 = num126 + 1))) - num107 = 4; - int num128; - if (this.frameCounter >= (double) (8 * (num128 = num127 + 1))) - num107 = 3; - int num129; - if (this.frameCounter >= (double) (8 * (num129 = num128 + 1))) - num107 = 2; - int num130; - if (this.frameCounter >= (double) (8 * (num130 = num129 + 1))) - num107 = 1; - int num131; - if (this.frameCounter >= (double) (8 * (num131 = num130 + 1))) - num107 = 0; - } - else - num107 = 0; - this.frame.Y = num1 * num107; - break; - case 552: - case 553: - case 554: - if ((double) this.ai[0] > 0.0) - { - this.spriteDirection = this.direction; - if (this.frame.Y < num1 * 10 || this.frame.Y > num1 * 13 || (double) this.ai[1] == 29.0) - { - this.frame.Y = num1 * 10; - this.frameCounter = 0.0; - } - if (++this.frameCounter >= 6.0 && this.frame.Y < num1 * 13) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - break; - } - break; - } - if ((double) this.velocity.Y == 0.0) - this.spriteDirection = this.direction; - if ((double) this.velocity.Y != 0.0 || this.direction == -1 && (double) this.velocity.X > 0.0 || this.direction == 1 && (double) this.velocity.X < 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = num1 * 8; - break; - } - if ((double) this.velocity.X == 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = num1 * 9; - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X); - if (this.frameCounter >= 64.0 || this.frameCounter < 0.0) - this.frameCounter = 0.0; - this.frame.Y = num1 * (int) (this.frameCounter / 8.0); - break; - case 555: - case 556: - case 557: - if ((double) this.ai[1] > 0.0 && (double) this.ai[0] > 0.0) - { - this.spriteDirection = this.direction; - if (this.frame.Y < num1 * 10 || this.frame.Y > num1 * 16 || (double) this.ai[1] == 41.0) - { - this.frame.Y = num1 * 10; - this.frameCounter = 0.0; - } - if (++this.frameCounter >= 6.0 && this.frame.Y < num1 * 16) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - break; - } - break; - } - if ((double) this.velocity.Y == 0.0) - this.spriteDirection = this.direction; - if ((double) this.velocity.Y != 0.0 || this.direction == -1 && (double) this.velocity.X > 0.0 || this.direction == 1 && (double) this.velocity.X < 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = num1; - break; - } - if ((double) this.velocity.X == 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = 0; - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X); - if (this.frameCounter >= 64.0 || this.frameCounter < 0.0) - this.frameCounter = 0.0; - this.frame.Y = num1 * ((int) (this.frameCounter / 8.0) + 2); - break; - case 558: - case 559: - case 560: - if ((double) this.velocity.X > 0.0) - this.spriteDirection = 1; - if ((double) this.velocity.X < 0.0) - this.spriteDirection = -1; - float num132 = this.velocity.ToRotation(); - if ((double) this.velocity.X < 0.0) - num132 += 3.141593f; - if ((double) this.ai[0] != 2.0) - num132 = this.velocity.X * 0.1f; - this.rotation = num132; - if ((double) this.ai[0] == 2.0) - { - this.frame.Y = num1 * 4; - break; - } - if (++this.frameCounter >= 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - if (this.frame.Y >= num1 * 4) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 561: - case 562: - case 563: - if ((double) this.ai[1] > 0.0 && (double) this.ai[0] > 0.0) - { - this.spriteDirection = this.direction; - if (this.frame.Y < num1 * 10 || this.frame.Y > num1 * 13 || (double) this.ai[1] == 89.0) - { - this.frame.Y = num1 * 10; - this.frameCounter = 0.0; - } - if (++this.frameCounter >= 6.0 && this.frame.Y < num1 * 13) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - break; - } - break; - } - if ((double) this.velocity.Y == 0.0) - this.spriteDirection = this.direction; - if ((double) this.velocity.Y != 0.0 || this.direction == -1 && (double) this.velocity.X > 0.0 || this.direction == 1 && (double) this.velocity.X < 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = num1 * 8; - break; - } - if ((double) this.velocity.X == 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = num1 * 9; - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X); - if (this.frameCounter >= 64.0 || this.frameCounter < 0.0) - this.frameCounter = 0.0; - this.frame.Y = num1 * (int) (this.frameCounter / 8.0); - break; - case 564: - case 565: - int y = this.frame.Y; - this.frame.Width = 80; - this.frame.Height = 80; - int num133; - if ((double) this.ai[0] > 0.0 && (double) this.ai[1] == 0.0) - { - this.spriteDirection = this.direction; - if (y < 5 || y > 13) - this.frameCounter = 0.0; - num133 = 5; - ++this.frameCounter; - int num134 = 0; - int num135; - if (this.frameCounter >= (double) (7 * (num135 = num134 + 1))) - num133 = 6; - int num136; - if (this.frameCounter >= (double) (7 * (num136 = num135 + 1))) - num133 = 7; - int num137; - if (this.frameCounter >= (double) (7 * (num137 = num136 + 1))) - num133 = 5; - int num138; - if (this.frameCounter >= (double) (7 * (num138 = num137 + 1))) - num133 = 6; - int num139; - if (this.frameCounter >= (double) (7 * (num139 = num138 + 1))) - num133 = 7; - int num140; - if (this.frameCounter >= (double) (7 * (num140 = num139 + 1))) - num133 = 5; - int num141; - if (this.frameCounter >= (double) (7 * (num141 = num140 + 1))) - num133 = 6; - int num142; - if (this.frameCounter >= (double) (7 * (num142 = num141 + 1))) - num133 = 7; - int num143; - if (this.frameCounter >= (double) (7 * (num143 = num142 + 1))) - num133 = 8; - int num144; - if (this.frameCounter >= (double) (7 * (num144 = num143 + 1))) - num133 = 9; - double frameCounter1 = this.frameCounter; - int num145 = num144 + 1; - int num146 = num145; - double num147 = (double) (7 * num145); - if (frameCounter1 >= num147) - num133 = 10; - double frameCounter2 = this.frameCounter; - int num148 = num146 + 1; - int num149 = num148; - double num150 = (double) (7 * num148); - if (frameCounter2 >= num150) - num133 = 11; - double frameCounter3 = this.frameCounter; - int num151 = num149 + 1; - int num152 = num151; - double num153 = (double) (7 * num151); - if (frameCounter3 >= num153) - num133 = 12; - if (this.frameCounter >= (double) (7 * (num152 + 1))) - { - num133 = 5; - this.frameCounter = 0.0; - } - } - else if ((double) this.ai[0] > 0.0 && (double) this.ai[1] == 1.0) - { - this.spriteDirection = this.direction; - if (y < 13 || y > 25) - this.frameCounter = 0.0; - num133 = 13; - ++this.frameCounter; - int num154 = 0; - double frameCounter4 = this.frameCounter; - int num155 = num154 + 1; - int num156 = num155; - double num157 = (double) (8 * num155); - if (frameCounter4 >= num157) - num133 = 14; - double frameCounter5 = this.frameCounter; - int num158 = num156 + 1; - int num159 = num158; - double num160 = (double) (8 * num158); - if (frameCounter5 >= num160) - num133 = 15; - double frameCounter6 = this.frameCounter; - int num161 = num159 + 1; - int num162 = num161; - double num163 = (double) (8 * num161); - if (frameCounter6 >= num163) - num133 = 16; - double frameCounter7 = this.frameCounter; - int num164 = num162 + 1; - int num165 = num164; - double num166 = (double) (8 * num164); - if (frameCounter7 >= num166) - num133 = 17; - double frameCounter8 = this.frameCounter; - int num167 = num165 + 1; - int num168 = num167; - double num169 = (double) (8 * num167); - if (frameCounter8 >= num169) - num133 = 18; - double frameCounter9 = this.frameCounter; - int num170 = num168 + 1; - int num171 = num170; - double num172 = (double) (8 * num170); - if (frameCounter9 >= num172) - num133 = 19; - double frameCounter10 = this.frameCounter; - int num173 = num171 + 1; - int num174 = num173; - double num175 = (double) (8 * num173); - if (frameCounter10 >= num175) - num133 = 20; - double frameCounter11 = this.frameCounter; - int num176 = num174 + 1; - int num177 = num176; - double num178 = (double) (8 * num176); - if (frameCounter11 >= num178) - num133 = 18; - double frameCounter12 = this.frameCounter; - int num179 = num177 + 1; - int num180 = num179; - double num181 = (double) (8 * num179); - if (frameCounter12 >= num181) - num133 = 19; - double frameCounter13 = this.frameCounter; - int num182 = num180 + 1; - int num183 = num182; - double num184 = (double) (8 * num182); - if (frameCounter13 >= num184) - num133 = 20; - double frameCounter14 = this.frameCounter; - int num185 = num183 + 1; - int num186 = num185; - double num187 = (double) (8 * num185); - if (frameCounter14 >= num187) - num133 = 21; - double frameCounter15 = this.frameCounter; - int num188 = num186 + 1; - int num189 = num188; - double num190 = (double) (8 * num188); - if (frameCounter15 >= num190) - num133 = 22; - double frameCounter16 = this.frameCounter; - int num191 = num189 + 1; - int num192 = num191; - double num193 = (double) (8 * num191); - if (frameCounter16 >= num193) - num133 = 23; - double frameCounter17 = this.frameCounter; - int num194 = num192 + 1; - int num195 = num194; - double num196 = (double) (8 * num194); - if (frameCounter17 >= num196) - num133 = 24; - double frameCounter18 = this.frameCounter; - int num197 = num195 + 1; - int num198 = num197; - double num199 = (double) (8 * num197); - if (frameCounter18 >= num199) - num133 = 25; - if (this.frameCounter >= (double) (8 * (num198 + 1))) - { - num133 = 14; - this.frameCounter = 0.0; - } - } - else if ((double) this.ai[0] > 0.0 && (double) this.ai[1] == 2.0) - { - this.spriteDirection = this.direction; - if (y < 26 || y > 40) - this.frameCounter = 0.0; - num133 = 26; - ++this.frameCounter; - int num200 = 0; - double frameCounter19 = this.frameCounter; - int num201 = num200 + 1; - int num202 = num201; - double num203 = (double) (8 * num201); - if (frameCounter19 >= num203) - num133 = 27; - double frameCounter20 = this.frameCounter; - int num204 = num202 + 1; - int num205 = num204; - double num206 = (double) (8 * num204); - if (frameCounter20 >= num206) - num133 = 28; - double frameCounter21 = this.frameCounter; - int num207 = num205 + 1; - int num208 = num207; - double num209 = (double) (8 * num207); - if (frameCounter21 >= num209) - num133 = 29; - double frameCounter22 = this.frameCounter; - int num210 = num208 + 1; - int num211 = num210; - double num212 = (double) (8 * num210); - if (frameCounter22 >= num212) - num133 = 26; - double frameCounter23 = this.frameCounter; - int num213 = num211 + 1; - int num214 = num213; - double num215 = (double) (8 * num213); - if (frameCounter23 >= num215) - num133 = 27; - double frameCounter24 = this.frameCounter; - int num216 = num214 + 1; - int num217 = num216; - double num218 = (double) (8 * num216); - if (frameCounter24 >= num218) - num133 = 28; - double frameCounter25 = this.frameCounter; - int num219 = num217 + 1; - int num220 = num219; - double num221 = (double) (8 * num219); - if (frameCounter25 >= num221) - num133 = 29; - double frameCounter26 = this.frameCounter; - int num222 = num220 + 1; - int num223 = num222; - double num224 = (double) (8 * num222); - if (frameCounter26 >= num224) - num133 = 26; - double frameCounter27 = this.frameCounter; - int num225 = num223 + 1; - int num226 = num225; - double num227 = (double) (8 * num225); - if (frameCounter27 >= num227) - num133 = 27; - double frameCounter28 = this.frameCounter; - int num228 = num226 + 1; - int num229 = num228; - double num230 = (double) (8 * num228); - if (frameCounter28 >= num230) - num133 = 28; - double frameCounter29 = this.frameCounter; - int num231 = num229 + 1; - int num232 = num231; - double num233 = (double) (8 * num231); - if (frameCounter29 >= num233) - num133 = 29; - double frameCounter30 = this.frameCounter; - int num234 = num232 + 1; - int num235 = num234; - double num236 = (double) (8 * num234); - if (frameCounter30 >= num236) - num133 = 30; - double frameCounter31 = this.frameCounter; - int num237 = num235 + 1; - int num238 = num237; - double num239 = (double) (8 * num237); - if (frameCounter31 >= num239) - num133 = 31; - double frameCounter32 = this.frameCounter; - int num240 = num238 + 1; - int num241 = num240; - double num242 = (double) (8 * num240); - if (frameCounter32 >= num242) - num133 = 32; - double frameCounter33 = this.frameCounter; - int num243 = num241 + 1; - int num244 = num243; - double num245 = (double) (8 * num243); - if (frameCounter33 >= num245) - num133 = 33; - double frameCounter34 = this.frameCounter; - int num246 = num244 + 1; - int num247 = num246; - double num248 = (double) (8 * num246); - if (frameCounter34 >= num248) - num133 = 34; - double frameCounter35 = this.frameCounter; - int num249 = num247 + 1; - int num250 = num249; - double num251 = (double) (8 * num249); - if (frameCounter35 >= num251) - num133 = 35; - double frameCounter36 = this.frameCounter; - int num252 = num250 + 1; - int num253 = num252; - double num254 = (double) (8 * num252); - if (frameCounter36 >= num254) - num133 = 36; - double frameCounter37 = this.frameCounter; - int num255 = num253 + 1; - int num256 = num255; - double num257 = (double) (8 * num255); - if (frameCounter37 >= num257) - num133 = 37; - double frameCounter38 = this.frameCounter; - int num258 = num256 + 1; - int num259 = num258; - double num260 = (double) (8 * num258); - if (frameCounter38 >= num260) - num133 = 38; - double frameCounter39 = this.frameCounter; - int num261 = num259 + 1; - int num262 = num261; - double num263 = (double) (8 * num261); - if (frameCounter39 >= num263) - num133 = 39; - double frameCounter40 = this.frameCounter; - int num264 = num262 + 1; - int num265 = num264; - double num266 = (double) (8 * num264); - if (frameCounter40 >= num266) - num133 = 40; - if (this.frameCounter >= (double) (8 * (num265 + 1))) - { - num133 = 26; - this.frameCounter = 0.0; - } - } - else - { - this.frameCounter = this.frameCounter + (double) this.velocity.Length() * 0.100000001490116 + 1.0; - if (this.frameCounter >= 40.0 || this.frameCounter < 0.0) - this.frameCounter = 0.0; - num133 = (int) (this.frameCounter / 8.0); - } - this.frame.Y = num133; - break; - case 566: - case 567: - if ((double) this.velocity.Y == 0.0) - this.spriteDirection = this.direction; - if ((double) this.velocity.Y != 0.0 || this.direction == -1 && (double) this.velocity.X > 0.0 || this.direction == 1 && (double) this.velocity.X < 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = num1 * 8; - break; - } - if ((double) this.velocity.X == 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = 0; - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X); - if (this.frameCounter >= 64.0 || this.frameCounter < 0.0) - this.frameCounter = 0.0; - this.frame.Y = num1 * (int) (this.frameCounter / 8.0); - break; - case 568: - case 569: - if ((double) this.ai[0] > 0.0) - { - int num267 = this.frame.Y / num1; - this.spriteDirection = this.direction; - if (num267 < 5 || num267 > 16) - this.frameCounter = 0.0; - int num268 = 7; - ++this.frameCounter; - int num269 = 0; - int num270; - if (this.frameCounter >= (double) (5 * (num270 = num269 + 1))) - num268 = 8; - int num271; - if (this.frameCounter >= (double) (5 * (num271 = num270 + 1))) - num268 = 9; - int num272; - if (this.frameCounter >= (double) (5 * (num272 = num271 + 1))) - num268 = 10; - int num273; - if (this.frameCounter >= (double) (5 * (num273 = num272 + 1))) - num268 = 7; - int num274; - if (this.frameCounter >= (double) (5 * (num274 = num273 + 1))) - num268 = 8; - int num275; - if (this.frameCounter >= (double) (5 * (num275 = num274 + 1))) - num268 = 9; - int num276; - if (this.frameCounter >= (double) (5 * (num276 = num275 + 1))) - num268 = 10; - int num277; - if (this.frameCounter >= (double) (5 * (num277 = num276 + 1))) - num268 = 7; - int num278; - if (this.frameCounter >= (double) (5 * (num278 = num277 + 1))) - num268 = 8; - int num279; - if (this.frameCounter >= (double) (5 * (num279 = num278 + 1))) - num268 = 9; - int num280; - if (this.frameCounter >= (double) (5 * (num280 = num279 + 1))) - num268 = 10; - int num281; - if (this.frameCounter >= (double) (5 * (num281 = num280 + 1))) - num268 = 7; - int num282; - if (this.frameCounter >= (double) (5 * (num282 = num281 + 1))) - num268 = 8; - int num283; - if (this.frameCounter >= (double) (5 * (num283 = num282 + 1))) - num268 = 9; - int num284; - if (this.frameCounter >= (double) (5 * (num284 = num283 + 1))) - num268 = 10; - int num285; - if (this.frameCounter >= (double) (5 * (num285 = num284 + 1))) - num268 = 7; - int num286; - if (this.frameCounter >= (double) (5 * (num286 = num285 + 1))) - num268 = 8; - int num287; - if (this.frameCounter >= (double) (5 * (num287 = num286 + 1))) - num268 = 9; - int num288; - if (this.frameCounter >= (double) (5 * (num288 = num287 + 1))) - num268 = 10; - int num289; - if (this.frameCounter >= (double) (5 * (num289 = num288 + 1))) - num268 = 7; - int num290; - if (this.frameCounter >= (double) (5 * (num290 = num289 + 1))) - num268 = 8; - int num291; - if (this.frameCounter >= (double) (5 * (num291 = num290 + 1))) - num268 = 9; - int num292; - if (this.frameCounter >= (double) (5 * (num292 = num291 + 1))) - num268 = 10; - int num293; - if (this.frameCounter >= (double) (5 * (num293 = num292 + 1))) - num268 = 11; - int num294; - if (this.frameCounter >= (double) (5 * (num294 = num293 + 1))) - num268 = 12; - int num295; - if (this.frameCounter >= (double) (5 * (num295 = num294 + 1))) - num268 = 13; - int num296; - if (this.frameCounter >= (double) (5 * (num296 = num295 + 1))) - num268 = 14; - if (this.frameCounter >= 270.0) - { - num268 = 14; - this.frameCounter -= 10.0; - } - this.frame.Y = num1 * num268; - break; - } - if ((double) this.velocity.Y == 0.0) - this.spriteDirection = this.direction; - if ((double) this.velocity.Y != 0.0 || this.direction == -1 && (double) this.velocity.X > 0.0 || this.direction == 1 && (double) this.velocity.X < 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = num1 * 4; - break; - } - if ((double) this.velocity.X == 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = num1 * 6; - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X); - if (this.frameCounter >= 56.0 || this.frameCounter < 0.0) - this.frameCounter = 0.0; - this.frame.Y = num1 * (int) (this.frameCounter / 8.0); - break; - case 570: - case 571: - if ((double) this.ai[1] > 0.0 && (double) this.ai[0] > 0.0) - { - this.spriteDirection = this.direction; - if (this.frame.Y < num1 * 10 || this.frame.Y > num1 * 15 || (double) this.ai[1] == 59.0) - { - this.frame.Y = num1 * 10; - this.frameCounter = 0.0; - } - int num297 = 5; - if (this.frame.Y == num1 * 14) - num297 = 35; - if (++this.frameCounter >= (double) num297 && this.frame.Y < num1 * 15) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - break; - } - break; - } - if ((double) this.velocity.Y == 0.0) - this.spriteDirection = this.direction; - if ((double) this.velocity.Y != 0.0 || this.direction == -1 && (double) this.velocity.X > 0.0 || this.direction == 1 && (double) this.velocity.X < 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = num1; - break; - } - if ((double) this.velocity.X == 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = num1 * 9; - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X); - if (this.frameCounter >= 64.0 || this.frameCounter < 0.0) - this.frameCounter = 0.0; - this.frame.Y = num1 * (int) (this.frameCounter / 8.0 + 2.0); - break; - case 572: - case 573: - if ((double) this.ai[0] > 0.0 && (double) this.ai[1] == 0.0) - { - this.spriteDirection = this.direction; - if (this.frame.Y != num1 * 8 || this.frameCounter > 2.0) - { - this.frame.Y = num1 * 8; - this.frameCounter = 0.0; - } - if (this.frameCounter == 0.0) - { - this.frameCounter = 1.0; - EmoteBubble.NewBubble(3, new WorldUIAnchor((Entity) this), 60); - break; - } - break; - } - if ((double) this.ai[1] == 1.0) - { - if ((double) this.velocity.Y == 0.0) - this.spriteDirection = this.direction; - if ((double) this.velocity.Y != 0.0 || this.direction == -1 && (double) this.velocity.X > 0.0 || this.direction == 1 && (double) this.velocity.X < 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = num1 * 17; - break; - } - if ((double) this.velocity.X == 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = num1 * 8; - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X); - if (this.frameCounter >= 64.0 || this.frameCounter < 0.0) - this.frameCounter = 0.0; - this.frame.Y = num1 * ((int) (this.frameCounter / 8.0) + 8); - break; - } - if ((double) this.velocity.Y == 0.0) - this.spriteDirection = this.direction; - if ((double) this.velocity.Y != 0.0 || this.direction == -1 && (double) this.velocity.X > 0.0 || this.direction == 1 && (double) this.velocity.X < 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = num1 * 16; - break; - } - if ((double) this.velocity.X == 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = 0; - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X); - if (this.frameCounter >= 64.0 || this.frameCounter < 0.0) - this.frameCounter = 0.0; - this.frame.Y = num1 * (int) (this.frameCounter / 8.0); - break; - case 574: - case 575: - if ((double) this.velocity.X > 0.0) - this.spriteDirection = 1; - if ((double) this.velocity.X < 0.0) - this.spriteDirection = -1; - float rotation = this.velocity.ToRotation(); - if ((double) this.velocity.X < 0.0) - rotation += 3.141593f; - this.rotation = this.rotation.AngleTowards(rotation, 0.02f); - if ((double) this.ai[0] != 0.0) - { - if (this.frame.Y < num1 * 2) - { - this.frame.Y = num1 * 2; - this.frameCounter = 0.0; - } - int num298 = 4; - if (this.frame.Y >= num1 * 5) - num298 = 8; - Vector2 Position = this.Center + new Vector2((float) (56 * this.spriteDirection), -30f).RotatedBy((double) this.rotation); - if (++this.frameCounter >= (double) num298 && this.frame.Y < num1 * 9) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y == num1 * 9) - { - for (int index = 0; index < 8; ++index) - { - Dust dust = Dust.NewDustDirect(Position, 0, 0, 6, Alpha: 100); - dust.velocity *= 3f; - dust.scale = 0.6f; - dust.fadeIn = 1.2f; - dust.noGravity = true; - dust.noLight = true; - } - } - } - if (this.frame.Y >= num1 * 9 && (double) this.ai[0] < 3.0) - { - Vector2 vector2_1 = Position; - Vector2 vector2_2 = Position + (this.oldPos[3] - this.position); - int maxValue = 5; - if (this.frameCounter > 60.0) - maxValue = 4; - if (this.frameCounter > 180.0) - maxValue = 3; - if (this.frameCounter > 300.0) - maxValue = 2; - if (this.frameCounter > 600.0) - maxValue = 1; - for (int index = 0; index < 2; ++index) - { - if (Main.rand.Next(maxValue) == 0) - { - Dust dust = Dust.NewDustDirect(Vector2.Lerp(vector2_2, vector2_1, (float) ((double) index / 10.0 + 0.100000001490116)), 0, 0, 6, Alpha: 50); - dust.scale = 0.3f; - dust.fadeIn = 1.5f; - dust.noGravity = true; - dust.noLight = true; - } - } - break; - } - break; - } - if (++this.frameCounter >= 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - if (this.frame.Y >= num1 * 2) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 576: - case 577: - int num299 = this.frame.Y; - this.frame.Width = 80; - if ((double) this.ai[0] > 0.0 && (double) this.ai[1] == 0.0) - { - this.spriteDirection = this.direction; - if (num299 < 11 || num299 > 20) - { - num299 = 11; - this.frameCounter = 0.0; - } - int num300 = 4; - if (num299 == 13 || num299 == 19) - num300 = 8; - if (num299 == 14 || num299 == 18) - num300 = 2; - if (++this.frameCounter >= (double) num300 && num299 < 20) - { - this.frameCounter = 0.0; - ++num299; - } - } - else if ((double) this.ai[0] > 0.0 && (double) this.ai[1] == 2.0) - { - this.spriteDirection = this.direction; - if (num299 < 37 || num299 > 47) - { - num299 = 39; - this.frameCounter = 0.0; - } - int num301 = 5; - if (num299 == 42) - num301 = 6; - if (num299 == 45) - num301 = 8; - if (num299 == 46) - num301 = 4; - if (num299 == 47) - num301 = 26; - if (num299 == 37 || num299 == 38) - num301 = 7; - bool flag4 = true; - if (num299 == 46 && (double) this.velocity.Y != 0.0) - flag4 = false; - if (num299 == 38) - flag4 = false; - if (flag4) - ++this.frameCounter; - if (this.frameCounter >= (double) num301) - { - if (num299 < 47) - { - this.frameCounter = 0.0; - ++num299; - } - else - { - num299 = 37; - this.frameCounter = 0.0; - } - } - } - else if ((double) this.ai[0] > 0.0 && (double) this.ai[1] == 1.0) - { - this.spriteDirection = this.direction; - if (num299 < 21 || num299 > 38) - { - num299 = 21; - this.frameCounter = 0.0; - } - if (++this.frameCounter >= 5.0 && num299 < 38) - { - this.frameCounter = 0.0; - ++num299; - } - } - else - { - if ((double) this.velocity.Y == 0.0) - this.spriteDirection = this.direction; - if ((double) this.velocity.Y != 0.0) - { - this.frameCounter = 0.0; - num299 = 43; - } - else if ((double) this.velocity.X == 0.0) - { - this.frameCounter = 0.0; - num299 = 0; - } - else - { - this.frameCounter += (double) Math.Abs(this.velocity.X); - if (this.frameCounter >= 60.0 || this.frameCounter < 0.0) - this.frameCounter = 0.0; - num299 = 1 + (int) (this.frameCounter / 6.0); - } - } - this.frame.Y = num299; - break; - case 578: - this.rotation = this.velocity.X * 0.1f; - if (++this.frameCounter >= 4.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - if (this.frame.Y >= num1 * 4) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 583: - case 584: - case 585: - this.rotation = this.velocity.X * 0.1f; - if (++this.frameCounter >= 4.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - if (this.frame.Y >= num1 * 4) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 586: - if (this.wet) - { - if ((double) this.velocity.X < 0.0) - this.direction = -1; - if ((double) this.velocity.X > 0.0) - this.direction = 1; - this.spriteDirection = this.direction; - this.frameCounter += (double) Math.Abs(this.velocity.Length()); - ++this.frameCounter; - if (this.frameCounter > 60.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 > 1) - { - this.frame.Y = 0; - break; - } - if (this.frame.Y / num1 < 0) - { - this.frame.Y = 0; - break; - } - break; - } - if ((double) this.velocity.Y == 0.0) - this.spriteDirection = this.direction; - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = num1; - this.frameCounter = 0.0; - break; - } - int num302 = 8; - this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.0; - this.frameCounter += 0.5; - if (this.frameCounter > (double) num302) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - case 589: - int num303 = this.frame.Y / num1; - ++this.frameCounter; - if ((double) this.velocity.Y != 0.0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - } - if (num303 >= 12) - { - if (this.frameCounter > 6.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - } - break; - } - if (num303 >= 11) - { - if (this.frameCounter > (double) Main.rand.Next(40, 140)) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - break; - } - break; - } - if (num303 >= 8) - { - if (this.frameCounter > 3.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y == num1 * 9) - { - Vector2 position = this.position; - position.Y += (float) (this.height - 6); - if (this.direction == 1) - position.X += 30f; - else - position.X -= 22f; - for (int index = 0; index < 4; ++index) - Dust.NewDust(position, 1, 1, 32); - break; - } - break; - } - break; - } - if (num303 >= 7) - { - if (this.frameCounter > (double) Main.rand.Next(30, 90)) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - break; - } - break; - } - if (num303 >= 4) - { - if (this.frameCounter > 4.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - break; - } - break; - } - if (num303 >= 1) - { - if (this.frameCounter > 4.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y >= num1 * 4 && Main.rand.Next(3) != 0) - { - this.frame.Y = 0; - break; - } - break; - } - break; - } - if (this.frameCounter > (double) Main.rand.Next(90, 450)) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - break; - } - break; - case 593: - if ((double) this.velocity.Y == 0.0) - { - this.rotation = 0.0f; - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; - ++this.frameCounter; - if (this.frameCounter > 10.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - } - this.frameCounter = 0.0; - this.frame.Y = 0; - if ((double) this.velocity.Y > 4.0) - { - this.rotation -= this.velocity.Y * 0.01f; - break; - } - break; - case 594: - this.spriteDirection = 1; - this.frame.Y = (int) this.ai[2]; - this.frame.Width = 32; - break; - case 595: - case 596: - case 597: - case 598: - case 599: - case 600: - case 601: - this.spriteDirection = this.direction; - int num304 = 3; - if (++this.frameCounter >= (double) (Main.npcFrameCount[this.type] * num304)) - this.frameCounter = 0.0; - this.frame.Y = num1 * ((int) this.frameCounter / num304); - break; - case 602: - this.spriteDirection = this.direction; - if ((double) this.velocity.X == 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = 0; - break; - } - ++this.frameCounter; - if (this.frameCounter >= 4.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y >= num1 * 10) - this.frame.Y = num1 * 3; - if (this.frame.Y < num1 * 3) - { - this.frame.Y = num1 * 3; - break; - } - break; - case 603: - this.spriteDirection = this.direction; - if (this.wet) - { - ++this.frameCounter; - if (this.frameCounter >= 8.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y > num1 * 2) - this.frame.Y = num1; - if (this.frame.Y < num1) - this.frame.Y = num1; - this.rotation = 0.0f; - break; - } - if ((double) this.velocity.X == 0.0 && (double) this.velocity.Y == 0.0) - { - this.frame.Y = num1; - this.frameCounter = 0.0; - this.rotation = 0.0f; - break; - } - this.rotation = this.velocity.X * 0.1f; - ++this.frameCounter; - if (this.frameCounter >= 4.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) - this.frame.Y = num1 * 11; - if (this.frame.Y < num1 * 11) - { - this.frame.Y = num1 * 11; - break; - } - break; - case 604: - case 605: - this.spriteDirection = this.direction; - int num305 = 2; - if (++this.frameCounter >= (double) (4 * num305)) - this.frameCounter = 0.0; - this.frame.Y = (double) this.velocity.Y != 0.0 ? num1 * (4 + (int) this.frameCounter / num305) : num1 * ((int) this.frameCounter / num305); - break; - case 610: - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - if ((double) this.velocity.X == 0.0) - { - ++this.frameCounter; - if (this.frameCounter > 8.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 > 1) - { - this.frame.Y = 0; - break; - } - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X) * 0.5; - ++this.frameCounter; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = num1 * 2; - break; - } - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X) * 0.5; - ++this.frameCounter; - if (this.frameCounter > 6.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = num1 * 2; - break; - } - break; - case 611: - this.spriteDirection = -this.direction; - this.rotation = this.velocity.X * 0.1f; - if ((double) this.velocity.X == 0.0 && (double) this.velocity.Y == 0.0) - { - switch (this.frame.Y / num1) - { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - if ((int) this.frameCounter % 40 != 0 || Main.rand.Next(80) == 0) - ++this.frameCounter; - if ((this.frameCounter + 1.0) % 40.0 == 39.0) - this.frameCounter = (double) (40 * Main.rand.Next(3)); - int num306 = (int) this.frameCounter % 40 / 10; - int num307 = (int) this.frameCounter / 40; - int num308 = 0; - switch (num307) - { - case 0: - if (num306 == 3) - num306 = 1; - num308 = num306; - break; - case 1: - if (num306 == 3) - num306 = 1; - num308 = 0; - if (num306 != 0) - { - num308 = 2 + num306; - break; - } - break; - case 2: - num308 = 0; - if (num306 != 0) - { - num308 = 4 + num306; - break; - } - break; - } - this.frame.Y = num1 * num308; - break; - default: - this.frame.Y = 0; - goto case 0; - } - } - else - { - ++this.frameCounter; - if (this.frameCounter >= 5.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y >= num1 * Main.npcFrameCount[this.type] || this.frame.Y < num1 * 8) - { - this.frame.Y = num1 * 8; - break; - } - break; - } - break; - case 612: - case 613: - if (this.IsABestiaryIconDummy) - { - ++this.frameCounter; - if (this.frameCounter > 50.0) - { - this.frameCounter = 0.0; - this.frame.Y = 0; - } - this.frame.Y = (int) Utils.WrappedLerp(0.0f, 4f, (float) this.frameCounter / 50f) * num1; - break; - } - bool flag5 = true; - if (this.frame.Y == 0 && Main.rand.Next(180) != 0) - flag5 = false; - if (flag5) - ++this.frameCounter; - if ((double) this.velocity.X != 0.0) - this.spriteDirection = Math.Sign(this.velocity.X); - int num309 = 10; - bool flag6 = (double) Math.Abs(this.velocity.X) > 1.0; - if ((double) this.ai[1] == 1.0) - { - this.frameCounter = 0.0; - this.frame.Y = num1 * 4; - } - if ((double) Math.Abs(this.velocity.Y) > 0.100000001490116 | flag6) - { - this.frameCounter = 0.0; - this.frame.Y = num1 * 4; - } - else if (this.frame.Y == 0) - num309 = 2; - if (this.frame.Y == num1 * 4) - { - num309 = 60; - if (!flag6) - num309 = 2; - } - if (this.frameCounter >= (double) num309) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y / num1 >= 5) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 615: - this.spriteDirection = this.direction; - if (!this.wet && (double) this.ai[2] == 1.0) - { - this.frame.Y = 4 * num1; - break; - } - if (!this.wet) - ++this.frameCounter; - if (++this.frameCounter >= (double) (7 * (Main.npcFrameCount[this.type] - 1))) - this.frameCounter = 0.0; - this.frame.Y = (int) (this.frameCounter / 7.0) * num1; - break; - case 616: - case 617: - int num310 = 8; - int num311 = 5; - if ((double) this.velocity.X == 0.0) - num311 = 10; - this.spriteDirection = this.direction; - if (this.wet) - { - ++this.frameCounter; - if (this.frameCounter > (double) num311) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y > num1 * 13) - { - this.frame.Y = num1 * 8; - break; - } - break; - } - break; - } - ++this.frameCounter; - if (this.frameCounter > (double) num310) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y > num1 * 7) - this.frame.Y = 0; - } - if ((double) this.velocity.X == 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = 0; - } - if ((double) this.velocity.Y != 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = num1 * 8; - break; - } - break; - case 618: - if (++this.frameCounter >= 5.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 619: - if (++this.frameCounter >= 6.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) - { - this.frame.Y = 0; - break; - } - break; - } - break; - case 620: - if ((double) this.ai[1] > 0.0 && (double) this.ai[0] > 0.0) - { - this.spriteDirection = this.direction; - if (this.frame.Y < num1 * 14 || this.frame.Y > num1 * 20 || (double) this.ai[1] == 59.0) - { - this.frame.Y = num1 * 14; - this.frameCounter = 0.0; - } - int num312 = 5; - if (this.frame.Y == num1 * 17 || this.frame.Y == num1 * 16) - num312 = 3; - if (++this.frameCounter >= (double) num312 && this.frame.Y < num1 * 20) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if ((double) this.ai[1] > 0.0 && this.frame.Y == num1 * 18) - { - this.frame.Y = num1 * 16; - break; - } - break; - } - break; - } - if (this.wet) - { - if ((double) this.velocity.X < 0.0) - this.direction = -1; - if ((double) this.velocity.X > 0.0) - this.direction = 1; - if (this.spriteDirection != this.direction) - { - this.rotation *= -1f; - this.spriteDirection = this.direction; - } - float num313 = (float) Math.Atan2((double) this.velocity.Y * (double) this.direction, (double) this.velocity.X * (double) this.direction); - if ((double) Math.Abs(this.rotation - num313) >= 3.14159274101257) - { - if ((double) num313 < (double) this.rotation) - this.rotation -= 6.283185f; - else - this.rotation += 6.283185f; - } - this.rotation = (float) (((double) this.rotation * 4.0 + (double) num313) / 5.0); - this.frameCounter += (double) Math.Abs(this.velocity.Length()); - ++this.frameCounter; - if (this.frameCounter > 8.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 > 13) - { - this.frame.Y = num1 * 8; - break; - } - if (this.frame.Y / num1 < 8) - { - this.frame.Y = num1 * 13; - break; - } - break; - } - if ((double) this.rotation > 3.14) - this.rotation -= 6.28f; - if ((double) this.rotation > -0.01 && (double) this.rotation < 0.01) - this.rotation = 0.0f; - else - this.rotation *= 0.9f; - if ((double) this.velocity.Y == 0.0) - { - if (this.direction == 1) - this.spriteDirection = 1; - if (this.direction == -1) - this.spriteDirection = -1; - if ((double) this.velocity.X == 0.0) - { - this.frame.Y = 0; - this.frameCounter = 0.0; - break; - } - if (this.frame.Y < num1 * 2) - this.frame.Y = num1 * 2; - this.frameCounter += (double) Math.Abs(this.velocity.X); - ++this.frameCounter; - if (this.frameCounter > 9.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y / num1 > 7) - { - this.frame.Y = num1 * 2; - break; - } - break; - } - this.frameCounter = 0.0; - this.frame.Y = num1; - break; - case 624: - if ((double) this.velocity.Y == 0.0) - this.spriteDirection = this.direction; - if ((double) this.velocity.X == 0.0 && (double) this.velocity.Y == 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = 0; - break; - } - if ((double) this.velocity.Y < 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = 9 * num1; - break; - } - if ((double) this.velocity.Y > 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = 10 * num1; - break; - } - this.frameCounter += (double) Math.Abs(this.velocity.X); - if (this.frameCounter > 8.0) - { - int num314 = this.frame.Y / num1; - this.frameCounter -= 8.0; - int num315 = num314 + 1; - if (num315 > 8) - num315 = 1; - this.frame.Y = num315 * num1; - break; - } - break; - case 625: - int num316 = 7; - int num317 = 4; - if ((double) this.velocity.X == 0.0) - num317 = 8; - this.spriteDirection = this.direction; - if (this.wet) - { - if (this.frame.Y < num1 * 6) - this.frame.Y = num1 * 6; - ++this.frameCounter; - if (this.frameCounter > (double) num317) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y > num1 * 11) - { - this.frame.Y = num1 * 6; - break; - } - break; - } - break; - } - if (this.frame.Y > num1 * 5) - this.frame.Y = 0; - ++this.frameCounter; - if (this.frameCounter > (double) num316) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - if (this.frame.Y > num1 * 5) - this.frame.Y = 0; - } - if ((double) this.velocity.X == 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = 0; - break; - } - break; - case 626: - case 627: - if ((double) this.velocity.X != 0.0) - this.spriteDirection = (double) this.velocity.X < 0.0 ? -1 : 1; - if (this.IsABestiaryIconDummy) - { - ++this.frameCounter; - if (this.frameCounter > 5.0) - { - this.frameCounter = 0.0; - this.frame.Y += num1; - } - if (this.frame.Y > num1 * 5) - { - this.frame.Y = 0; - break; - } - break; - } - this.frame.Y = this.wet ? ((double) this.velocity.Length() <= 0.150000005960464 ? ((double) this.velocity.Length() <= 0.0500000007450581 ? ((double) this.velocity.Length() <= 0.025000000372529 ? 0 : num1) : num1 * 2) : num1 * 3) : 0; - break; - case 628: - this.spriteDirection = (double) Main.WindForVisuals > 0.0 ? -1 : 1; - if (this.IsABestiaryIconDummy) - { - int num318 = this.frame.Y / num1; - int num319 = 5; - this.spriteDirection = 1; - ++this.frameCounter; - if (this.frameCounter > (double) num319) - { - this.frameCounter -= (double) num319; - int num320 = num318 + 1; - if (num320 > 5) - num320 = 0; - this.frame.Y = num320 * num1; - break; - } - break; - } - if ((double) this.ai[0] == 0.0) - { - int num321 = this.frame.Y / num1; - int num322 = 8; - if (num321 == 6) - { - this.frameCounter += 1.0 + 0.5 * (double) Math.Abs(Main.WindForVisuals); - if (this.frameCounter > (double) num322) - { - this.frameCounter -= (double) num322; - this.frame.Y = 0 * num1; - break; - } - break; - } - if (num321 > 5) - { - int num323 = 6; - this.frameCounter = 0.0; - this.frame.Y = num323 * num1; - break; - } - this.frameCounter += 1.0 + 0.5 * (double) Math.Abs(Main.WindForVisuals); - if (this.frameCounter > (double) num322) - { - this.frameCounter -= (double) num322; - int num324 = num321 + 1; - if (num324 > 5) - num324 = 0; - this.frame.Y = num324 * num1; - break; - } - break; - } - if ((double) this.localAI[0] == 0.0) - { - ++this.frameCounter; - if (this.frameCounter > 4.0) - { - this.frameCounter = 0.0; - int num325 = this.frame.Y / num1; - int num326; - if (num325 == 6) - num326 = 7; - else if (num325 < 7) - { - num326 = 6; - } - else - { - num326 = num325 + 1; - if (num326 > 10) - num326 = 7; - } - this.frame.Y = num326 * num1; - break; - } - break; - } - if ((double) this.localAI[0] == 1.0) - { - int num327 = this.frame.Y / num1; - int num328 = (int) MathHelper.Lerp(7f, 20f, (float) this.frameCounter / 80f); - if (num328 > 19) - num328 = 19; - if (num328 > 16) - num328 -= 9; - ++this.frameCounter; - if (this.frameCounter > 80.0) - this.frameCounter = 0.0; - this.frame.Y = num328 * num1; - break; - } - break; - case 631: - int num329 = 8; - if ((double) this.velocity.Y == 0.0) - { - this.spriteDirection = this.direction; - if ((double) this.ai[2] != 0.0 && (double) this.ai[2] < 100.0) - { - float amount = (this.ai[2] - 76f) / 24f; - Player player = Main.player[this.target]; - bool flag7 = player != null && ((double) player.Center.X < (double) this.Center.X ? this.direction == -1 : this.direction == 1); - bool flag8 = player != null && player.Hitbox.Intersects(this.Hitbox); - this.frame.Y = !(player != null & flag7) || flag8 || !Collision.CanHit((Entity) player, (Entity) this) ? (!(flag7 & flag8) ? 0 : (int) MathHelper.Lerp(10f, 15f, amount) * num1) : (int) MathHelper.Lerp(15f, (float) Main.npcFrameCount[this.type], amount) * num1; - break; - } - if ((double) this.velocity.X == 0.0) - { - this.frameCounter = 0.0; - this.frame.Y = 0; - break; - } - this.frameCounter += 0.200000002980232 + (double) Math.Abs(this.velocity.X); - if (this.frameCounter > 8.0) - { - this.frame.Y += num1; - this.frameCounter = 0.0; - } - if (this.frame.Y >= num329 * num1) - { - this.frame.Y = num1; - break; - } - if (this.frame.Y / num1 < 1) - { - this.frame.Y = num1; - break; - } - break; - } - this.frameCounter = 0.0; - this.frame.Y = 0; - break; - case 636: - this.frame.Y = this.AI_120_HallowBoss_IsInPhase2() ? num1 : 0; - break; - case 657: - bool flag9 = this.life <= this.lifeMax / 2; - this.frame.Width = 180; - int num330 = this.frame.Y / num1; - if (flag9 && this.noGravity || (double) this.velocity.Y < 0.0) - { - if (num330 < 20 || num330 > 23) - { - if (num330 < 4 || num330 > 7) - { - num330 = 4; - this.frameCounter = -1.0; - } - if (++this.frameCounter >= 4.0) - { - this.frameCounter = 0.0; - ++num330; - if (num330 >= 7) - num330 = !flag9 ? 7 : 22; - } - } - else if (++this.frameCounter >= 5.0) - { - this.frameCounter = 0.0; - ++num330; - if (num330 >= 24) - num330 = 20; - } - this.frame.Y = num330 * num1; - break; - } - if ((double) this.velocity.Y > 0.0) - { - if (num330 < 8 || num330 > 10) - { - num330 = 8; - this.frameCounter = -1.0; - } - if (++this.frameCounter >= 8.0) - { - this.frameCounter = 0.0; - ++num330; - if (num330 >= 10) - num330 = 10; - } - this.frame.Y = num330 * num1; - break; - } - if ((double) this.velocity.Y == 0.0) - { - if ((double) this.ai[0] == 5.0) - { - this.frameCounter = 0.0; - switch ((int) this.ai[1] / 3 % 3) - { - case 1: - num330 = 14; - break; - case 2: - num330 = 15; - break; - default: - num330 = 13; - break; - } - } - else if ((double) this.ai[0] == 4.0) - { - this.frameCounter = 0.0; - switch ((int) this.ai[1] / 15) - { - case 1: - num330 = 11; - break; - case 2: - case 3: - num330 = 10; - break; - default: - num330 = 12; - break; - } - } - else - { - bool flag10 = num330 >= 10 && num330 <= 12; - int num331 = 10; - if (flag10) - num331 = 6; - if (!flag10 && num330 >= 4) - { - num330 = 0; - this.frameCounter = -1.0; - } - if (++this.frameCounter >= (double) num331) - { - this.frameCounter = 0.0; - ++num330; - if ((!flag10 || num330 == 13) && num330 >= 4) - num330 = 0; - } - } - this.frame.Y = num330 * num1; - break; - } - break; + } } - if (this.aiStyle == 39 && this.type != 417) + else if (this.type == 533) + { + if ((double) this.velocity.Y == 0.0 && this.direction != 0) + this.spriteDirection = this.direction; + ++this.frameCounter; + if (this.frameCounter >= 48.0) + this.frameCounter = 0.0; + this.frame.Y = (int) (this.frameCounter / 6.0) * num1; + if ((double) this.ai[1] > 0.0) + this.frame.Y += num1 * 8; + } + if (this.type >= 496 && this.type <= 497) + { + if ((double) this.ai[0] == 0.0) + { + this.rotation = 0.0f; + if ((double) this.velocity.Y == 0.0) + this.spriteDirection = this.direction; + else if ((double) this.velocity.Y < 0.0) + this.frameCounter = 0.0; + this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.10000002384186; + if (this.frameCounter < 6.0) + this.frame.Y = 0; + else if (this.frameCounter < 12.0) + this.frame.Y = num1; + else if (this.frameCounter < 18.0) + this.frame.Y = num1 * 2; + else if (this.frameCounter < 24.0) + this.frame.Y = num1 * 3; + else + this.frameCounter = 0.0; + } + else if ((double) this.ai[0] == 1.0) + { + this.frameCounter = 0.0; + this.frame.Y = (double) this.ai[1] >= 10.0 ? ((double) this.ai[1] >= 20.0 ? num1 * 6 : num1 * 5) : num1 * 4; + } + else if ((double) this.ai[0] == 5.0) + { + this.frameCounter = 0.0; + this.frame.Y = (double) this.ai[1] >= 10.0 ? ((double) this.ai[1] >= 20.0 ? num1 * 3 : num1 * 11) : num1 * 10; + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num1 * 7; + } + } + else if (this.aiStyle == 39 && this.type != 417) { if ((double) this.ai[0] == 0.0) { @@ -37915,7 +24757,4638 @@ label_422: this.frame.Y = num1 * 7; } } - this.position = this.position - this.netOffset; + else if (this.type == 508 || this.type == 532) + { + if ((double) this.velocity.Y != 0.0) + this.frame.Y = num1; + else if ((double) this.velocity.X == 0.0) + { + this.frame.Y = 0; + } + else + { + if (this.direction < 0 && (double) this.velocity.X < 0.0) + this.spriteDirection = -1; + if (this.direction > 0 && (double) this.velocity.X > 0.0) + this.spriteDirection = 1; + if (this.frame.Y / num1 < 2) + this.frame.Y = num1 * 2; + this.frameCounter += 1.0 + (double) Math.Abs(this.velocity.X) / 2.0; + if (this.frameCounter > 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) + this.frame.Y = num1 * 2; + } + } + else if (this.type == 509) + { + if ((double) this.velocity.X > 0.0 && this.direction > 0 || (double) this.velocity.X < 0.0 && this.direction < 0) + this.spriteDirection = this.direction; + if (++this.frameCounter >= 3.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) + this.frame.Y = 0; + } + } + if (this.type == 415) + { + if ((double) this.ai[2] < 0.0) + { + if (this.frame.Y / num1 != 8 && this.frame.Y / num1 != 9 && this.frame.Y / num1 != 0) + this.frameCounter = 0.0; + ++this.frameCounter; + int num162 = 0; + int num163 = 18; + int num164 = 4; + if (this.frameCounter > (double) (num163 - num164 * 2)) + num162 = 8 + (int) this.frameCounter / 4 % 2; + if (this.frameCounter > (double) (num163 + num164 * 6)) + { + num162 = 0; + this.frameCounter = 0.0; + } + this.frame.Y = num1 * num162; + } + else if ((double) this.velocity.Y == 0.0) + { + if (this.direction != 0) + this.spriteDirection = this.direction; + if (this.frame.Y < num1 * 2) + this.frame.Y = num1 * 2; + this.frameCounter += (double) Math.Abs(this.velocity.X) * 0.5; + if (this.frameCounter >= 8.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type] - 2) + this.frame.Y = num1 * 2; + if ((double) this.velocity.X == 0.0) + this.frame.Y = 0; + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num1; + } + } + if (this.type == 416) + { + int index = (int) this.ai[0]; + if (Main.npc[index].active && Main.npc[index].type == 415 && Main.npcTexture[415] != null) + this.frame.Y = Main.npc[index].frame.Y / (Main.npcTexture[415].Height / Main.npcFrameCount[415]) * num1; + } + else if (this.type == 417) + { + if ((double) this.ai[0] == 0.0) + { + this.rotation = 0.0f; + if ((double) this.velocity.Y == 0.0) + this.spriteDirection = this.direction; + else if ((double) this.velocity.Y < 0.0) + this.frameCounter = 0.0; + this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.10000002384186; + this.frame.Y = (int) (this.frameCounter / 6.0) * num1; + if (this.frameCounter >= 48.0) + this.frameCounter = 0.0; + } + else if ((double) this.ai[0] == 1.0) + { + this.frameCounter = 0.0; + this.frame.Y = num1 * (9 + (int) ((double) this.ai[1] / 6.0)); + } + else if ((double) this.ai[0] == 5.0) + { + this.frameCounter = 0.0; + this.frame.Y = num1 * (13 - (int) ((double) this.ai[1] / 6.0)); + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num1 * 14; + } + } + else if (this.type == 518) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction != 0) + this.spriteDirection = this.direction; + if ((double) this.velocity.X == 0.0) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.0; + ++this.frameCounter; + if (this.frameCounter > 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) + this.frame.Y = num1 * 2; + } + } + else + { + this.frame.Y = num1; + this.frameCounter = 0.0; + } + } + else if (this.type == 419) + { + if ((double) this.ai[2] < 0.0) + { + int num165 = 1; + if (this.direction != 0) + this.spriteDirection = this.direction; + if (this.frame.Y / num1 >= 9) + { + this.frame.Y = num1 * 2; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 < 2) + { + this.frame.Y = num1 * 2; + this.frameCounter = 0.0; + } + ++this.frameCounter; + if (this.frameCounter >= (double) (num165 * 4 + 6)) + this.frameCounter = 8.0; + this.frame.Y = this.frameCounter >= 6.0 ? num1 * (int) (4.0 + (this.frameCounter - 6.0) / (double) num165) : num1 * (int) (2.0 + this.frameCounter / 3.0); + } + else if ((double) this.velocity.Y == 0.0) + { + if (this.direction != 0) + this.spriteDirection = this.direction; + if ((double) this.velocity.X == 0.0) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.0; + ++this.frameCounter; + if (this.frameCounter > 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) + this.frame.Y = num1 * 9; + if (this.frame.Y / num1 < 9) + this.frame.Y = num1 * 9; + } + } + else + { + this.frame.Y = num1; + this.frameCounter = 0.0; + } + } + else if (this.type == 425) + { + if (this.direction != 0) + this.spriteDirection = -this.direction; + if ((double) this.ai[2] == 1.0) + { + ++this.frameCounter; + if (this.frameCounter >= 3.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y > num1 * 12 || this.frame.Y < num1 * 10) + this.frame.Y = num1 * 10; + } + else if ((double) this.velocity.Y != 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = num1; + } + else if ((double) this.velocity.X == 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X); + if (this.frameCounter >= 8.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y > num1 * 9 || this.frame.Y < num1 * 2) + this.frame.Y = num1 * 2; + } + } + else if (this.type == 427) + { + if (this.direction != 0) + this.spriteDirection = this.direction; + if ((double) this.velocity.Y != 0.0) + { + ++this.frameCounter; + if (this.frameCounter >= 2.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num1 * 9 || this.frame.Y < num1 * 6) + this.frame.Y = num1 * 6; + } + else if ((double) this.velocity.X == 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X); + if (this.frameCounter >= 8.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y > num1 * 5 || this.frame.Y < num1) + this.frame.Y = num1; + } + } + else if (this.type == 426) + { + if (this.direction != 0) + this.spriteDirection = this.direction; + if ((double) this.ai[1] >= 45.0) + { + if ((double) this.velocity.Y == 0.0) + { + this.frame.Y = num1 * 8; + } + else + { + ++this.frameCounter; + if (this.frameCounter >= 2.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num1 * 15 || this.frame.Y < num1 * 12) + this.frame.Y = num1 * 12; + } + } + else if ((double) this.velocity.Y != 0.0) + { + ++this.frameCounter; + if (this.frameCounter >= 2.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num1 * 12 || this.frame.Y < num1 * 9) + this.frame.Y = num1 * 9; + } + else if ((double) this.velocity.X == 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X); + if (this.frameCounter >= 10.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y > num1 * 7 || this.frame.Y < num1) + this.frame.Y = num1; + } + } + else if (this.type == 429) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction != 0) + this.spriteDirection = this.direction; + if ((double) this.velocity.X == 0.0) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.0; + ++this.frameCounter; + if (this.frameCounter > 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) + this.frame.Y = num1 * 2; + } + } + else + { + this.frame.Y = num1; + this.frameCounter = 0.0; + } + } + else if (this.type == 428) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction != 0) + this.spriteDirection = this.direction; + if ((double) this.velocity.X == 0.0) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.0; + if (++this.frameCounter > 10.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type] - 1) + this.frame.Y = 0; + } + } + else if (this.frame.Y / num1 != 4) + { + if (this.frameCounter > 0.0) + this.frameCounter = 0.0; + if (--this.frameCounter < -10.0 || (double) this.velocity.Y > 0.600000023841858) + { + this.frame.Y = num1 * 4; + this.frameCounter = 0.0; + } + } + } + else if (this.type == 423) + { + if ((double) this.ai[2] == 1.0) + { + int num166 = 2; + if ((double) this.ai[1] >= 30.0 && (double) this.ai[1] < 45.0) + num166 = 3; + this.frame.Y = num166 * num1; + } + else if ((double) this.velocity.Y != 0.0) + this.frame.Y = num1; + else if ((double) this.velocity.X == 0.0) + { + this.frame.Y = 0; + } + else + { + if ((double) this.velocity.X != 0.0) + this.spriteDirection = Math.Sign(-this.velocity.X); + if (this.frame.Y / num1 < 4) + this.frame.Y = num1 * 4; + this.frameCounter += 1.0 + (double) Math.Abs(this.velocity.X) / 2.0; + if (this.frameCounter > 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) + this.frame.Y = num1 * 4; + } + } + else if (this.type == 421) + { + if ((double) this.ai[0] == 5.0) + ++this.frameCounter; + if (++this.frameCounter >= 5.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) + this.frame.Y = 0; + } + } + if (this.type == 424) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction != 0) + this.spriteDirection = -this.direction; + if ((double) this.ai[2] > 0.0) + { + this.frame.Y = num1 * ((double) this.ai[1] > 90.0 ? Main.npcFrameCount[this.type] - 2 : Main.npcFrameCount[this.type] - 1); + this.frameCounter = 0.0; + } + else if ((double) this.velocity.X == 0.0) + { + this.frame.Y = 0; + } + else + { + if (this.frame.Y < num1 * 2) + this.frame.Y = num1 * 2; + this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; + this.frameCounter += (double) this.velocity.X * 1.29999995231628; + if (this.frameCounter > 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type] - 2) + this.frame.Y = num1 * 2; + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num1; + } + } + else if (this.type == 420 && ++this.frameCounter >= 5.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) + this.frame.Y = 0; + } + if (this.type == 411) + { + if ((double) this.ai[1] >= 90.0 && (double) this.ai[1] < 180.0) + { + this.spriteDirection = -this.direction; + this.frame.Y = num1 * (Main.npcFrameCount[this.type] - 1); + this.frameCounter = 0.0; + } + else if ((double) this.velocity.Y == 0.0) + { + if (this.direction != 0) + this.spriteDirection = -this.direction; + if ((double) this.velocity.X == 0.0) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.0; + ++this.frameCounter; + if (this.frameCounter > 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type] - 1) + this.frame.Y = num1 * 2; + } + } + else + { + this.frame.Y = num1; + this.frameCounter = 0.0; + } + } + else if (this.type == 409) + { + if ((double) this.velocity.Y == 0.0 && (double) this.ai[1] <= 30.0 && (double) this.ai[1] > 0.0) + { + this.frame.Y = num1 * (Main.npcFrameCount[this.type] - 1); + this.frameCounter = 0.0; + } + else + { + if ((double) this.velocity.Y == 0.0) + this.spriteDirection = this.direction; + if (++this.frameCounter >= 6.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type] - 2) + this.frame.Y = 0; + } + } + } + else if (this.type == 410) + { + this.frameCounter += (double) Math.Abs(this.velocity.X); + if (this.frameCounter >= 10.0) + { + this.frameCounter -= 10.0; + this.frame.Y += num1; + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) + this.frame.Y = 0; + } + } + else if (this.type == 407) + { + if (++this.frameCounter >= 6.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) + this.frame.Y = 0; + } + } + else if ((this.type == 405 || this.type == 406) && ++this.frameCounter >= 4.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) + this.frame.Y = 0; + } + if (this.type == 516) + { + if ((double) this.localAI[1] == 0.0) + { + this.localAI[1] = 1f; + this.frame.Y = num1 * Main.rand.Next(3); + this.frameCounter += (double) Main.rand.Next(3); + } + ++this.frameCounter; + if (this.frameCounter > 3.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y > num1 * 3) + this.frame.Y = 0; + } + } + if (this.type == 418) + { + if ((double) this.ai[0] == 0.0 || (double) this.ai[0] == 1.0 || (double) this.ai[0] == -1.0) + { + ++this.frameCounter; + if (this.frameCounter > 6.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + } + if (this.frame.Y > num1 * 4) + this.frame.Y = 0; + } + else if ((double) this.ai[0] == 2.0) + this.frame.Y = (double) this.ai[1] >= 10.0 ? ((double) this.ai[1] >= 20.0 ? num1 * 7 : num1 * 6) : num1 * 5; + else if ((double) this.ai[0] == -2.0) + { + ++this.frameCounter; + if (this.frameCounter > 12.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + } + if (this.frame.Y > num1 * 7) + this.frame.Y = num1 * 5; + } + } + if (this.type == 1 || this.type == 537 || this.type == 16 || this.type == 59 || this.type == 71 || this.type == 81 || this.type == 138 || this.type == 147 || this.type == 183 || this.type == 184 || this.type == 204 || this.type == 225 || this.type == 302 || this.type == 304 || this.type >= 333 && this.type <= 336 || this.type == 535) + { + if (this.type == 302 || this.type == 304) + this.spriteDirection = this.direction; + ++this.frameCounter; + if (num2 > 0) + ++this.frameCounter; + if (num2 == 4) + ++this.frameCounter; + if (this.frameCounter >= 8.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) + this.frame.Y = 0; + } + if (this.type == 488) + { + int num167 = (int) this.localAI[1]; + if (Framing.GetTileSafely((int) this.ai[0], (int) this.ai[1]).frameX >= (short) 36) + num167 *= -1; + if ((double) this.localAI[0] > 24.0) + this.localAI[0] = 24f; + if ((double) this.localAI[0] > 0.0) + --this.localAI[0]; + if ((double) this.localAI[0] < 0.0) + this.localAI[0] = 0.0f; + int num168 = num167 == -1 ? 4 : 6; + int num169 = (int) this.localAI[0] / num168; + if ((double) this.localAI[0] % (double) num168 != 0.0) + ++num169; + if (num169 != 0 && num167 == 1) + num169 += 5; + this.frame.Y = num169 * num1; + } + if (this.type >= 430 && this.type <= 436) + { + if ((double) this.ai[2] > 0.0) + { + this.frame.Y = (double) this.ai[2] >= 5.0 ? ((double) this.ai[2] >= 10.0 ? ((double) this.ai[2] >= 15.0 ? num1 * 6 : num1 * 5) : num1 * 4) : num1 * 3; + } + else + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + } + if ((double) this.velocity.Y != 0.0 || this.direction == -1 && (double) this.velocity.X > 0.0 || this.direction == 1 && (double) this.velocity.X < 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = num1 * 2; + } + else if ((double) this.velocity.X == 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X); + if (this.frameCounter < 8.0) + this.frame.Y = 0; + else if (this.frameCounter < 16.0) + this.frame.Y = num1; + else if (this.frameCounter < 24.0) + this.frame.Y = num1 * 2; + else if (this.frameCounter < 32.0) + this.frame.Y = num1; + else + this.frameCounter = 0.0; + } + } + } + if (this.type == 454) + { + int num170 = (int) (this.frameCounter / 2.0); + this.frame.Y = num1 * num170; + } + if (this.type == 377 || this.type == 446) + { + this.frame.Y = (double) this.velocity.Y == 0.0 ? 0 : num1; + this.spriteDirection = this.direction; + } + if (this.type == 378) + { + if ((double) this.velocity.Y != 0.0 && this.frame.Y < num1 * 2) + this.frame.Y += num1 * 2; + if ((double) this.velocity.Y == 0.0 && this.frame.Y > num1 * 2) + this.frame.Y -= num1 * 2; + ++this.frameCounter; + if (this.frameCounter >= 6.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if ((double) this.velocity.Y != 0.0 && this.frame.Y >= num1 * 4) + this.frame.Y = num1 * 2; + if ((double) this.velocity.Y == 0.0 && this.frame.Y >= num1 * 2) + this.frame.Y = 0; + } + } + if (this.type == 376) + { + ++this.frameCounter; + if (this.frameCounter > 30.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y >= num1 * 2) + this.frame.Y = 0; + } + } + if (this.type == 375) + { + ++this.frameCounter; + if (this.frameCounter > 4.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y >= num1 * 4) + this.frame.Y = 0; + } + } + if (this.type == 374) + { + this.localAI[0] = -2f; + if ((double) this.velocity.Y == 0.0) + { + this.rotation = 0.0f; + if ((double) this.velocity.X == 0.0) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + else + { + ++this.frameCounter; + if (this.frameCounter > 6.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y >= num1 * 4) + this.frame.Y = num1; + } + } + } + else + { + this.rotation += (float) this.direction * 0.1f; + ++this.frameCounter; + if (this.frameCounter > 3.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y >= num1 * 4) + this.frame.Y = num1; + } + } + } + if (this.type == 492) + this.frame.Y = num1 * (int) this.ai[2]; + if (this.type == 473 || this.type == 474 || this.type == 475 || this.type == 476) + { + if ((double) this.velocity.Y == 0.0) + this.spriteDirection = this.direction; + if ((double) this.ai[0] == 0.0 || (double) this.ai[0] == 7.0) + { + this.rotation = 0.0f; + this.frameCounter = 0.0; + this.frame.Y = 0; + } + else if ((double) this.ai[0] == 1.0) + { + this.rotation = 0.0f; + this.frameCounter = 0.0; + int num171 = 6; + this.frame.Y = (double) this.ai[1] >= (double) num171 ? ((double) this.ai[1] >= (double) (num171 * 2) ? ((double) this.ai[1] >= (double) (num171 * 3) ? ((double) this.ai[1] >= (double) (num171 * 4) ? ((double) this.ai[1] >= (double) (num171 * 5) ? num1 * 6 : num1 * 5) : num1 * 4) : num1 * 3) : num1 * 2) : num1; + } + else if ((double) this.ai[0] == 2.0 || (double) this.ai[0] == 6.0) + { + this.rotation = 0.0f; + if ((double) this.velocity.Y == 0.0) + { + int num172 = 6; + ++this.frameCounter; + if (this.frame.Y < num1 * 7) + this.frame.Y = num1 * 12; + if (this.frame.Y < num1 * 10) + { + if (this.frameCounter > 8.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + if (this.frame.Y == num1 * 10) + this.frameCounter = (double) (num172 * 2); + } + } + else if (this.frameCounter < (double) num172) + this.frame.Y = num1 * 12; + else if (this.frameCounter < (double) (num172 * 2)) + this.frame.Y = num1 * 11; + else if (this.frameCounter < (double) (num172 * 3)) + { + this.frame.Y = num1 * 10; + } + else + { + this.frame.Y = num1 * 11; + if (this.frameCounter >= (double) (num172 * 4 - 1)) + this.frameCounter = 0.0; + } + } + else + { + this.frame.Y = num1 * 13; + this.frameCounter = 0.0; + } + } + else if ((double) this.ai[0] == 3.0) + { + this.rotation = 0.0f; + ++this.frameCounter; + if (this.frameCounter > 6.0) + { + this.frameCounter = 0.0; + if (this.frame.Y > num1 * 7) + this.frame.Y -= num1; + } + } + else if ((double) this.ai[0] == 4.0 || (double) this.ai[0] == 5.0) + { + if ((double) this.ai[0] == 4.0 && (double) this.ai[2] == 1.0) + this.rotation = 0.0f; + this.frame.Y = num1 * 13; + this.frameCounter = 0.0; + } + else if ((double) this.ai[0] == 4.09999990463257) + { + this.rotation = 0.0f; + if (this.frame.Y > num1 * 6) + this.frameCounter = 0.0; + ++this.frameCounter; + int num173 = 4; + if (this.frameCounter < (double) num173) + this.frame.Y = num1 * 6; + else if (this.frameCounter < (double) (num173 * 2)) + this.frame.Y = num1 * 5; + else if (this.frameCounter < (double) (num173 * 3)) + this.frame.Y = num1 * 4; + else if (this.frameCounter < (double) (num173 * 4)) + this.frame.Y = num1 * 3; + else if (this.frameCounter < (double) (num173 * 5)) + { + this.frame.Y = num1 * 4; + } + else + { + this.frame.Y = num1 * 5; + if (this.frameCounter >= (double) (num173 * 6 - 1)) + this.frameCounter = 0.0; + } + } + } + if (this.type == 477) + { + this.frameCounter += (double) this.velocity.Length() / 4.0; + ++this.frameCounter; + if (this.frameCounter >= 6.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + } + if (this.frame.Y / num1 > 5) + this.frame.Y = 0; + } + if (this.type == 479) + { + ++this.frameCounter; + int num174 = 4; + if (this.frameCounter < (double) num174) + this.frame.Y = 0; + else if (this.frameCounter < (double) (num174 * 2)) + this.frame.Y = num1; + else if (this.frameCounter < (double) (num174 * 3)) + this.frame.Y = num1 * 2; + else if (this.frameCounter < (double) (num174 * 4 - 1)) + this.frame.Y = num1; + else + this.frameCounter = 0.0; + } + if (this.type == 472) + { + if ((double) this.velocity.X < 0.0) + this.direction = -1; + else + this.direction = 1; + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + this.rotation = (float) Math.Atan2((double) this.velocity.Y * (double) this.direction, (double) this.velocity.X * (double) this.direction); + ++this.frameCounter; + if (this.frameCounter > 4.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 >= 6) + this.frame.Y = 0; + } + if (this.type >= 449 && this.type <= 452) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + if ((double) this.ai[2] > 0.0) + { + this.spriteDirection = this.direction; + int num175 = 0; + if ((double) this.ai[1] < 22.0) + num175 = -14; + else if ((double) this.ai[1] < 28.0) + num175 = 3; + else if ((double) this.ai[1] < 34.0) + num175 = 2; + else if ((double) this.ai[1] < 40.0) + num175 = 1; + this.frame.Y = num1 * (15 + num175); + this.frameCounter = 0.0; + } + else if ((double) this.velocity.X == 0.0) + { + this.frame.Y = num1; + } + else + { + if (this.frame.Y < num1 * 2) + this.frame.Y = num1 * 2; + this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; + if (this.frameCounter > 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 >= 15) + this.frame.Y = num1 * 2; + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + } + if (this.type == 481) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + if ((double) this.ai[2] > 0.0) + { + this.spriteDirection = this.direction; + int num176 = 0; + if ((double) this.ai[1] < 22.0) + num176 = -14; + else if ((double) this.ai[1] < 28.0) + num176 = 3; + else if ((double) this.ai[1] < 34.0) + num176 = 2; + else if ((double) this.ai[1] < 40.0) + num176 = 1; + this.frame.Y = num1 * (15 + num176); + this.frameCounter = 0.0; + } + else if ((double) this.velocity.X == 0.0) + { + this.frame.Y = num1; + } + else + { + if (this.frame.Y < num1 * 2) + this.frame.Y = num1 * 2; + this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; + if (this.frameCounter > 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 >= 15) + this.frame.Y = num1 * 2; + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + } + if (this.type == 468) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + if ((double) this.ai[2] > 0.0) + { + this.spriteDirection = this.direction; + int num177 = 0; + if ((double) this.ai[1] < 22.0) + num177 = -15; + else if ((double) this.ai[1] < 28.0) + num177 = 3; + else if ((double) this.ai[1] < 34.0) + num177 = 2; + else if ((double) this.ai[1] < 40.0) + num177 = 1; + this.frame.Y = num1 * (15 + num177); + this.frameCounter = 0.0; + } + else if ((double) this.velocity.X == 0.0) + { + this.frame.Y = 0; + } + else + { + if (this.frame.Y < num1 * 2) + this.frame.Y = num1 * 2; + this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; + if (this.frameCounter > 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 >= 15) + this.frame.Y = num1 * 2; + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num1; + } + } + if (this.type == 379 || this.type == 380) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + if ((double) this.ai[2] > 0.0) + { + this.spriteDirection = this.direction; + this.frame.Y = num1 * ((int) this.ai[2] - 1 + 2); + this.frameCounter = 0.0; + } + else if ((double) this.velocity.X == 0.0) + { + this.frame.Y = 0; + } + else + { + if (this.frame.Y < num1 * 7) + this.frame.Y = num1 * 7; + this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; + if (this.frameCounter > 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) + this.frame.Y = num1 * 7; + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num1; + } + } + if (this.type == 381 || this.type == 382 || this.type == 383 || this.type == 385 || this.type == 389) + { + if ((double) this.velocity.Y == 0.0) + { + this.spriteDirection = this.direction; + if (this.frame.Y < num1 * 2) + this.frame.Y = num1 * 2; + if (this.type == 389 || this.type == 385) + this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.2; + else + this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; + if (this.frameCounter > 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) + this.frame.Y = num1 * 2; + if ((double) this.velocity.X == 0.0) + this.frame.Y = 0; + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num1; + } + } + if (this.type == 387) + { + if ((double) this.ai[0] > 0.0) + { + ++this.frameCounter; + if ((double) this.ai[0] >= 20.0) + ++this.frameCounter; + if ((double) this.ai[0] >= 40.0) + ++this.frameCounter; + if (this.frameCounter >= 10.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y >= num1 * 2) + this.frame.Y = 0; + } + } + else + { + ++this.frameCounter; + if (this.frameCounter >= 15.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y >= num1 * 2) + this.frame.Y = 0; + } + } + } + if (this.type == 386) + { + if ((double) this.ai[2] > 0.0) + { + int num178 = (int) this.ai[2] / 12; + this.frame.Y = num1 * (9 + num178 % 2); + } + else if ((double) this.velocity.Y == 0.0) + { + this.spriteDirection = this.direction; + if (this.frame.Y < num1 * 2) + this.frame.Y = num1 * 2; + this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; + if (this.frameCounter > 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 >= 9) + this.frame.Y = num1 * 2; + if ((double) this.velocity.X == 0.0) + this.frame.Y = 0; + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num1; + } + } + if (this.type == 388) + { + ++this.frameCounter; + if (this.frameCounter >= 6.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y >= num1 * 2) + this.frame.Y = 0; + } + } + if (this.type == 391) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = -1; + if (this.direction == -1) + this.spriteDirection = 1; + if (this.frame.Y < num1) + this.frame.Y = num1; + this.frameCounter += (double) Math.Abs(this.velocity.X) * 0.5; + if (this.frameCounter > 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) + this.frame.Y = num1; + if ((double) this.velocity.X == 0.0) + this.frame.Y = 0; + } + else + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + } + if (this.type == 390) + { + if (this.direction != 0) + this.spriteDirection = -this.direction; + this.frame.Y = (double) this.ai[2] <= 0.0 ? num1 * 2 : num1 * ((int) this.ai[2] - 1); + } + if (this.type == 393) + { + Vector2 rotationVector2 = this.ai[2].ToRotationVector2(); + int num179 = (double) rotationVector2.Y <= (double) Math.Abs(rotationVector2.X) * 2.0 ? ((double) rotationVector2.Y <= (double) Math.Abs(rotationVector2.X) * 1.5 ? ((double) Math.Abs(rotationVector2.X) <= (double) rotationVector2.Y * 2.0 ? ((double) Math.Abs(rotationVector2.X) <= (double) rotationVector2.Y * 1.5 ? ((double) rotationVector2.X > 0.0 ? 6 : 2) : ((double) rotationVector2.X > 0.0 ? 7 : 1)) : ((double) rotationVector2.X > 0.0 ? 8 : 0)) : ((double) rotationVector2.X > 0.0 ? 5 : 3)) : 4; + this.frame.Y = num1 * num179; + float num180 = 280f; + float num181 = 140f; + if (((double) this.ai[3] < (double) num180 ? 0 : ((double) this.ai[3] < (double) num180 + (double) num181 ? 1 : 0)) != 0 && (int) this.ai[3] % 6 <= 2) + this.frame.Y += num1 * 9; + } + if (this.type == 394) + { + int num182 = (int) this.ai[3] - 300; + if (num182 >= 120) + { + int num183 = num182 - 120; + this.frame.Y = num183 < 160 ? (num183 < 20 ? num1 * (4 + num183 / 5) : num1 * (num183 / 4 % 4)) : num1 * (7 - (num183 - 160) / 5); + } + else + this.frame.Y = num1 * 4; + } + if (this.type == 395) + { + float num184 = 20f; + float num185 = 240f; + int num186 = (double) this.ai[3] < (double) num184 ? 0 : ((double) this.ai[3] < (double) num184 + (double) num185 ? 1 : 0); + ++this.frameCounter; + if (this.frameCounter >= 66.0) + this.frameCounter = 0.0; + if (num186 != 0) + { + ++this.frameCounter; + if (this.frameCounter >= 54.0 || this.frameCounter < 36.0) + this.frameCounter = 36.0; + } + int num187 = (int) this.frameCounter % 66 / 6; + this.frame.Y = num1 * num187; + } + if (this.type == 392) + { + float num188 = 20f; + float num189 = 240f; + int num190 = (double) this.ai[3] < (double) num188 ? 0 : ((double) this.ai[3] < (double) num188 + (double) num189 ? 1 : 0); + ++this.frameCounter; + if (num190 != 0) + ++this.frameCounter; + if (this.frameCounter >= 12.0) + this.frameCounter = 0.0; + int num191 = (int) this.frameCounter % 12 / 3; + this.frame.Y = num1 * num191; + } + if (this.type == 399) + { + this.frameCounter = (this.frameCounter + 0.25) % 4.0 + ((double) this.ai[0] == 0.0 ? 0.0 : 4.0); + this.frame.Y = num1 * (int) this.frameCounter; + } + else if (this.type == 520) + { + if ((double) this.velocity.Y == 0.0) + { + this.spriteDirection = this.direction; + this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.0; + if (this.frameCounter > 6.0) + { + if ((double) Math.Abs(this.velocity.X) < 0.200000002980232) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + else + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + } + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) + this.frame.Y = num1; + if ((double) this.velocity.X == 0.0) + this.frame.Y = 0; + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num1; + } + } + if (this.type == 398) + { + if ((double) this.ai[0] <= 0.0) + { + this.frame.Y = 0; + } + else + { + if (this.frame.Y == 0) + { + Gore.NewGore(this.position + new Vector2(-10f, -15f), this.velocity, 619); + Gore.NewGore(this.position + new Vector2(10f, -15f), this.velocity, 620); + Gore.NewGore(this.position + new Vector2(-10f, 15f), this.velocity, 621); + Gore.NewGore(this.position + new Vector2(10f, 15f), this.velocity, 622); + for (int index = 0; index < 50; ++index) + { + this.frame.Y = num1; + Dust.NewDust(this.position, this.width, this.height, 209); + } + } + ++this.frameCounter; + if (this.frameCounter >= 30.0) + this.frameCounter = 6.0; + int num192 = (int) this.frameCounter % 30 / 6; + this.frame.Y = num1 * num192; + } + } + if (this.type == 397) + { + int num193 = (int) this.frameCounter / 7; + this.frame.Y = num1 * num193; + } + if (this.type == 400) + { + ++this.frameCounter; + if ((double) this.ai[0] == 0.0 || (double) this.ai[0] == 3.0) + ++this.frameCounter; + if (this.frameCounter >= 16.0) + this.frameCounter = 0.0; + int num194 = (int) this.frameCounter % 16 / 4; + this.frame.Y = num1 * num194; + } + if (this.type == 437) + { + ++this.frameCounter; + if (this.frameCounter >= 20.0) + this.frameCounter = 0.0; + int num195 = (int) this.frameCounter % 20 / 5; + this.frame.Y = num1 * num195; + } + if (this.type == 438) + { + ++this.frameCounter; + if ((double) this.ai[1] == 1.0) + ++this.frameCounter; + if (this.frameCounter >= 49.0) + this.frameCounter = 0.0; + int num196 = (int) this.frameCounter % 49 / 7; + if (num196 >= 4) + num196 = 6 - num196; + this.frame.Y = num1 * num196; + } + if (this.type == 439 || this.type == 440) + { + switch ((int) this.localAI[2]) + { + case 0: + if (this.frameCounter >= 15.0) + { + this.frameCounter = 0.0; + this.frame.Y = 0; + break; + } + if (this.frame.Y != 0) + { + this.frame.Y = ((int) this.frameCounter / 5 + 4) * num1; + break; + } + break; + case 1: + if (this.frameCounter >= 15.0) + { + this.frameCounter = 0.0; + this.frame.Y = num1; + break; + } + if (this.frame.Y != num1) + { + this.frame.Y = ((int) this.frameCounter / 5 + 10) * num1; + break; + } + break; + case 2: + if (this.frameCounter >= 15.0) + { + this.frameCounter = 0.0; + this.frame.Y = num1 * 2; + break; + } + if (this.frame.Y != num1 * 2) + { + this.frame.Y = ((int) this.frameCounter / 5 + 7) * num1; + break; + } + break; + case 10: + if (this.frameCounter >= 15.0) + this.frameCounter = 0.0; + this.frame.Y = ((int) this.frameCounter / 5 + 4) * num1; + break; + case 11: + if (this.frameCounter >= 15.0) + this.frameCounter = 0.0; + this.frame.Y = ((int) this.frameCounter / 5 + 10) * num1; + break; + case 12: + if (this.frameCounter >= 15.0) + this.frameCounter = 0.0; + this.frame.Y = ((int) this.frameCounter / 5 + 7) * num1; + break; + case 13: + if (this.frameCounter >= 15.0) + this.frameCounter = 0.0; + this.frame.Y = ((int) this.frameCounter / 5 + 13) * num1; + break; + } + ++this.frameCounter; + } + if (this.type == 521) + { + if ((double) this.velocity.X < 0.0) + this.direction = -1; + else + this.direction = 1; + if (this.direction != 0) + this.spriteDirection = this.direction; + this.rotation = (float) Math.Atan2((double) this.velocity.Y * (double) this.spriteDirection, (double) this.velocity.X * (double) this.spriteDirection) + this.velocity.X * 0.1f; + if (++this.frameCounter >= 5.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) + this.frame.Y = 0; + } + } + if (this.type == 523 && ++this.frameCounter >= 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) + this.frame.Y = 0; + } + if (this.type == 371 || this.type == 372 || this.type == 373) + this.frame.Y = num1; + if (this.type == 370) + { + if ((double) this.ai[0] == 0.0 || (double) this.ai[0] == 5.0) + { + int num197 = 5; + if ((double) this.ai[0] == 5.0) + num197 = 4; + ++this.frameCounter; + if (this.frameCounter > (double) num197) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + } + if (this.frame.Y >= num1 * 6) + this.frame.Y = 0; + } + if ((double) this.ai[0] == 1.0 || (double) this.ai[0] == 6.0) + this.frame.Y = (double) this.ai[2] >= 10.0 ? num1 * 7 : num1 * 6; + if ((double) this.ai[0] == 2.0 || (double) this.ai[0] == 7.0) + this.frame.Y = (double) this.ai[2] >= 10.0 ? num1 * 7 : num1 * 6; + if ((double) this.ai[0] == 3.0 || (double) this.ai[0] == 8.0 || (double) this.ai[0] == -1.0) + { + int num198 = 90; + if ((double) this.ai[2] < (double) (num198 - 30) || (double) this.ai[2] > (double) (num198 - 10)) + { + ++this.frameCounter; + if (this.frameCounter > 5.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + } + if (this.frame.Y >= num1 * 6) + this.frame.Y = 0; + } + else + { + this.frame.Y = num1 * 6; + if ((double) this.ai[2] > (double) (num198 - 20) && (double) this.ai[2] < (double) (num198 - 15)) + this.frame.Y = num1 * 7; + } + } + if ((double) this.ai[0] == 4.0 || (double) this.ai[0] == 9.0) + { + int num199 = 180; + if ((double) this.ai[2] < (double) (num199 - 60) || (double) this.ai[2] > (double) (num199 - 20)) + { + ++this.frameCounter; + if (this.frameCounter > 5.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + } + if (this.frame.Y >= num1 * 6) + this.frame.Y = 0; + } + else + { + this.frame.Y = num1 * 6; + if ((double) this.ai[2] > (double) (num199 - 50) && (double) this.ai[2] < (double) (num199 - 25)) + this.frame.Y = num1 * 7; + } + } + } + if (this.type == 359 || this.type == 360) + { + if ((double) this.velocity.Y > 1.0) + { + ++this.frameCounter; + int num200 = 6; + if (this.frameCounter < (double) num200) + { + this.frame.Y = num1 * 4; + } + else + { + this.frame.Y = num1 * 5; + if (this.frameCounter >= (double) (num200 * 2 - 1)) + this.frameCounter = 0.0; + } + } + else + { + ++this.frameCounter; + int num201 = 10; + if (this.frameCounter < (double) num201) + this.frame.Y = 0; + else if (this.frameCounter < (double) (num201 * 2)) + this.frame.Y = num1; + else if (this.frameCounter < (double) (num201 * 3)) + this.frame.Y = num1 * 2; + else if (this.frameCounter < (double) (num201 * 4)) + this.frame.Y = num1 * 3; + else if (this.frameCounter < (double) (num201 * 5)) + { + this.frame.Y = num1 * 2; + } + else + { + this.frame.Y = num1; + if (this.frameCounter >= (double) (num201 * 6 - 1)) + this.frameCounter = 0.0; + } + } + } + if (this.type == 327) + { + if ((double) this.ai[3] == 0.0) + { + if (this.frame.Y > num1 * 5) + ++this.frameCounter; + else if (this.frame.Y > 0) + --this.frameCounter; + } + else if ((double) this.ai[3] == 1.0) + { + if (this.frame.Y > num1 * 10) + ++this.frameCounter; + else if (this.frame.Y > num1 * 4) + --this.frameCounter; + else if (this.frame.Y < num1 * 4) + ++this.frameCounter; + } + else if ((double) this.ai[3] == 2.0) + { + if (this.frame.Y < num1 * 2) + --this.frameCounter; + else if (this.frame.Y > num1 * 8) + --this.frameCounter; + else if (this.frame.Y < num1 * 8) + ++this.frameCounter; + } + if (this.frameCounter > 6.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y > num1 * 11) + this.frame.Y = 0; + } + if (this.frameCounter < 0.0) + { + this.frameCounter = 6.0; + this.frame.Y -= num1; + if (this.frame.Y < 0) + this.frame.Y = num1 * 11; + } + } + if (this.type == 347) + { + ++this.frameCounter; + if (this.frameCounter > 1.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y > num1 * 3) + this.frame.Y = 0; + } + if (this.type == 346) + { + if ((double) this.ai[0] == 1.0) + { + this.spriteDirection = this.direction; + ++this.frameCounter; + if (this.frameCounter > 2.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y > num1 * 8) + this.frame.Y = num1 * 6; + if (this.frame.Y < num1 * 6) + this.frame.Y = num1 * 6; + } + else if ((double) this.velocity.X == 0.0) + { + ref int local = ref this.frame.Y; + local = local; + this.frameCounter = 0.0; + } + else + { + this.spriteDirection = this.direction; + ++this.frameCounter; + this.frameCounter += (double) Math.Abs(this.velocity.X) / 2.0; + if (this.frameCounter > 4.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y > num1 * 5) + this.frame.Y = num1; + if (this.frame.Y < num1) + this.frame.Y = num1; + } + } + if (this.type == 352) + { + ++this.frameCounter; + if (this.frameCounter > 3.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y > num1 * 5) + this.frame.Y = 0; + } + if (this.type == 345) + { + if ((double) this.ai[0] == 0.0) + this.frame.Y = (double) this.ai[3] < 0.0 ? ((double) this.velocity.X >= 0.0 ? num1 * 2 : num1) : 0; + else if ((double) this.ai[0] == 1.0) + { + ++this.frameCounter; + if (this.frameCounter > 5.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + } + if (this.frame.Y > num1 * 4) + this.frame.Y = num1 * 3; + if (this.frame.Y < num1 * 3) + this.frame.Y = num1 * 3; + } + else if ((double) this.ai[0] == 2.0) + this.frame.Y = num1 * 5; + } + if (this.type == 344) + { + if ((double) this.velocity.X == 0.0) + { + ++this.frameCounter; + if (this.frameCounter > 2.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + } + if (this.frame.Y > num1 * 9) + this.frame.Y = 0; + } + else + { + ++this.frameCounter; + if (this.frameCounter > 3.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + } + if (this.frame.Y > num1 * 9) + this.frame.Y = 0; + } + } + if (this.type == 325) + { + if ((double) this.velocity.X == 0.0) + { + ++this.frameCounter; + if (this.frameCounter > 4.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + } + if (this.frame.Y > num1 * 4) + this.frame.Y = 0; + } + else + { + ++this.frameCounter; + if (this.frameCounter > 4.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + } + if (this.frame.Y < num1 * 5) + this.frame.Y = num1 * 5; + if (this.frame.Y > num1 * 9) + this.frame.Y = num1 * 5; + } + } + if (this.type == 490) + { + this.rotation = this.velocity.X * 0.15f; + ++this.frameCounter; + if (this.frameCounter > 6.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + } + if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) + this.frame.Y = 0; + } + else if (this.type == 266) + { + ++this.frameCounter; + if (this.frameCounter > 6.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + } + if ((double) this.ai[0] >= 0.0) + { + if (this.frame.Y > num1 * 3) + this.frame.Y = 0; + } + else + { + if (this.frame.Y < num1 * 4) + this.frame.Y = num1 * 4; + if (this.frame.Y > num1 * 7) + this.frame.Y = num1 * 4; + } + } + else if (this.type == 262) + { + ++this.frameCounter; + if (this.frameCounter > 6.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + } + if (this.life > this.lifeMax / 2) + { + if (this.frame.Y > num1 * 3) + this.frame.Y = 0; + } + else + { + if (this.frame.Y < num1 * 4) + this.frame.Y = num1 * 4; + if (this.frame.Y > num1 * 7) + this.frame.Y = num1 * 4; + } + } + else if (this.type >= 305 && this.type <= 309) + { + if ((double) this.velocity.Y == 0.0) + this.spriteDirection = this.direction; + this.frame.Y = (double) this.velocity.Y >= -3.0 ? ((double) this.velocity.Y > 0.0 ? ((double) this.velocity.Y >= 2.0 ? num1 : num1 * 3) : 0) : num1 * 5; + this.rotation = this.velocity.X * 0.1f; + } + else if (this.type == 263) + { + if ((double) this.velocity.X == 0.0 && (double) this.velocity.Y == 0.0) + { + if (this.frame.Y > 0) + { + ++this.frameCounter; + if (this.frameCounter > 4.0) + { + this.frameCounter = 0.0; + this.frame.Y -= num1; + } + } + } + else if (this.frame.Y < 2) + { + ++this.frameCounter; + if (this.frameCounter > 4.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + } + } + } + else if (this.type == 244) + { + ++this.frameCounter; + if (num2 > 0) + ++this.frameCounter; + if (num2 == 4) + ++this.frameCounter; + if (this.frameCounter >= 8.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) + this.frame.Y = 0; + } + else if (this.type == 289) + { + ++this.frameCounter; + if (this.frameCounter < 2.0) + this.frame.Y = 0; + else if (this.frameCounter < 3.0) + { + this.frame.Y = num1; + } + else + { + this.frame.Y = num1 * 2; + this.frameCounter = 0.0; + } + if ((double) this.ai[3] == 1.0) + this.frame.Y += num1 * 3; + } + else if (this.type == 288) + { + ++this.frameCounter; + if (this.frameCounter >= 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) + this.frame.Y = 0; + } + else if (this.type == 355 || this.type == 358) + { + this.spriteDirection = this.direction; + ++this.frameCounter; + if (this.frameCounter < 4.0) + { + this.frame.Y = 0; + } + else + { + this.frame.Y = num1; + if (this.frameCounter >= 7.0) + this.frameCounter = 0.0; + } + if ((double) this.localAI[2] <= 0.0) + this.frame.Y += num1 * 2; + } + else if (this.type == 356 || this.type == 444) + { + int num202 = 7; + this.rotation = this.velocity.X * 0.3f; + this.spriteDirection = this.direction; + this.frameCounter = this.frameCounter + 1.0 + ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y)) / 2.0; + if (this.frameCounter < (double) num202) + this.frame.Y = 0; + else if (this.frameCounter < (double) (num202 * 2)) + this.frame.Y = num1; + else if (this.frameCounter < (double) (num202 * 3)) + { + this.frame.Y = num1 * 2; + } + else + { + this.frame.Y = num1; + if (this.frameCounter >= (double) (num202 * 4 - 1)) + this.frameCounter = 0.0; + } + if (this.type != 444) + this.frame.Y += (int) ((double) (num1 * 3) * ((double) this.ai[2] - 1.0)); + } + else if (this.type == 357 || this.type == 448 || this.type == 484) + { + this.localAI[0] = -2f; + if ((double) this.velocity.Y == 0.0) + { + this.rotation = 0.0f; + if ((double) this.velocity.X == 0.0) + { + this.frame.Y = num1; + this.frameCounter = 0.0; + } + else + { + ++this.frameCounter; + if (this.frameCounter > 12.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y > num1) + this.frame.Y = 0; + } + } + } + else + { + this.rotation += (float) this.direction * 0.1f; + this.frame.Y = num1; + } + int x = (int) this.Center.X / 16; + int y = (int) this.position.Y / 16; + if (WorldGen.InWorld(x, y) && Main.tile[x, y] != null) + { + if (Main.tile[x, y].slope() == (byte) 0) + ++y; + if (Main.tile[x, y].slope() == (byte) 1) + { + this.rotation = 0.785f; + this.localAI[0] = 0.0f; + } + else if (Main.tile[x, y].slope() == (byte) 2) + { + this.rotation = -0.785f; + this.localAI[0] = 0.0f; + } + } + } + else if (this.type >= 485 && this.type <= 487) + { + this.spriteDirection = this.direction; + this.localAI[0] = -2f; + if ((double) this.velocity.Y == 0.0) + { + this.rotation = 0.0f; + if ((double) this.velocity.X == 0.0) + { + this.frame.Y = num1; + this.frameCounter = 0.0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X * 5f); + if (this.frameCounter > 10.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y > num1 * 3) + this.frame.Y = 0; + } + } + } + else + { + this.rotation += (float) this.direction * 0.1f; + this.frame.Y = num1; + } + int index5 = (int) this.Center.X / 16; + int index6 = (int) this.position.Y / 16; + if (Main.tile[index5, index6] != null) + { + if (Main.tile[index5, index6].slope() == (byte) 0) + ++index6; + if (Main.tile[index5, index6].slope() == (byte) 1) + { + this.rotation = 0.785f; + this.localAI[0] = 0.0f; + } + else if (Main.tile[index5, index6].slope() == (byte) 2) + { + this.rotation = -0.785f; + this.localAI[0] = 0.0f; + } + } + } + else if (this.type == 250 || this.type == 264 || this.type == 268) + { + ++this.frameCounter; + if (this.frameCounter >= 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) + this.frame.Y = 0; + } + else if (this.type == 245) + { + if ((double) this.ai[0] == 0.0) + this.frame.Y = (double) this.ai[1] >= -16.0 ? ((double) this.ai[1] >= -12.0 ? ((double) this.ai[1] >= -8.0 ? ((double) this.ai[1] >= -4.0 ? ((double) this.ai[1] >= 0.0 ? 0 : num1 * 4) : num1 * 3) : num1 * 2) : num1) : 0; + else if ((double) this.ai[0] == 1.0) + this.frame.Y = 1; + } + else if (this.type == 246) + { + if ((double) this.ai[0] == 0.0) + this.frame.Y = (double) this.localAI[0] != 1.0 ? 0 : num1; + else if ((double) this.ai[0] == 1.0) + { + this.frame.Y = (double) this.localAI[0] != 1.0 ? 0 : num1; + if ((double) this.localAI[1] == -1.0) + this.frame.Y += num1 * 4; + if ((double) this.localAI[1] == 1.0) + this.frame.Y += num1 * 2; + } + } + else if (this.type == 249) + this.frame.Y = (double) this.localAI[0] != 1.0 ? 0 : num1; + else if (this.type == 141) + { + this.spriteDirection = this.direction; + if ((double) this.velocity.Y != 0.0) + { + this.frame.Y = num1 * 2; + } + else + { + ++this.frameCounter; + if (this.frameCounter >= 8.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y > num1) + this.frame.Y = 0; + } + } + else if (this.type == 243) + { + if (this.frameCounter < 0.0) + { + if ((double) this.velocity.Y == 0.0) + { + ++this.frameCounter; + if (this.frameCounter < -12.0) + { + if (this.frame.Y > num1 * 9) + this.frame.Y = num1 * 11; + } + else if (this.frameCounter < -6.0) + { + if (this.frame.Y > num1 * 9) + this.frame.Y = num1 * 12; + } + else if (this.frameCounter < 0.0) + { + this.frameCounter = 0.0; + if (this.frame.Y > num1 * 9) + this.frame.Y = num1 * 11; + } + } + else + { + this.frameCounter = -18.0; + this.frame.Y = (double) this.velocity.Y >= 0.0 ? num1 * 13 : num1 * 14; + } + } + else + { + this.spriteDirection = this.direction; + this.frameCounter += (double) Math.Abs(this.velocity.X * 1.1f); + if (this.frameCounter >= 6.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y > num1 * 9) + this.frame.Y = 0; + } + if ((double) this.velocity.Y < -2.0 || (double) this.velocity.Y > 5.0) + this.frameCounter = -18.0; + } + } + else if (this.type == 222) + { + ++this.frameCounter; + if ((double) this.localAI[0] == 1.0) + { + if (this.frameCounter > 4.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num1 * 4) + this.frame.Y = 0; + } + else + { + if (this.frameCounter > 4.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y < num1 * 4) + this.frame.Y = num1 * 4; + if (this.frame.Y >= num1 * 12) + this.frame.Y = num1 * 4; + } + } + else if (this.type == 164 || this.type == 239 || this.type == 530) + { + if ((double) this.velocity.Y != 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = (double) this.velocity.Y >= 0.0 ? 0 : num1 * 4; + } + else + { + this.spriteDirection = this.direction; + this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.10000002384186; + if (this.frameCounter < 6.0) + this.frame.Y = num1; + else if (this.frameCounter < 12.0) + this.frame.Y = num1 * 2; + else if (this.frameCounter < 18.0) + this.frame.Y = num1 * 3; + else + this.frameCounter = 0.0; + } + } + else if (this.type == 236) + { + if ((double) this.velocity.Y == 0.0) + this.spriteDirection = this.direction; + else + this.frame.Y = 0; + this.frameCounter += (double) Math.Abs(this.velocity.X); + if (this.frameCounter > 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y > num1 || (double) this.velocity.Y != 0.0) + this.frame.Y = 0; + } + else if (this.type == 165 || this.type == 237 || this.type == 238 || this.type == 240 || this.type == 531) + { + float num203 = 0.5f; + if (this.type == 531) + num203 = 0.4f; + this.frameCounter += ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y)) * (double) num203; + if (this.frameCounter < 6.0) + this.frame.Y = 0; + else if (this.frameCounter < 12.0) + this.frame.Y = num1; + else if (this.frameCounter < 18.0) + this.frame.Y = num1 * 2; + else if (this.frameCounter < 24.0) + this.frame.Y = num1 * 3; + else + this.frameCounter = 0.0; + } + else if (this.type == 195) + this.frame.Y = (double) this.ai[0] >= 3.0 ? ((double) this.ai[0] >= 6.0 ? ((double) this.ai[0] >= 9.0 ? ((double) this.ai[0] >= 12.0 ? ((double) this.ai[0] >= 15.0 ? num1 * 5 : num1 * 4) : num1 * 3) : num1 * 2) : num1) : 0; + else if (this.type == 174) + this.frame.Y = (double) this.velocity.Y != 0.0 ? ((double) this.velocity.Y >= -1.5 ? ((double) this.velocity.Y <= 1.5 ? num1 * 2 : num1 * 3) : num1) : 0; + else if (this.type == 177) + { + if ((double) this.velocity.Y == 0.0) + { + ++this.frameCounter; + if (this.frameCounter >= 10.0) + { + this.frameCounter = 30.0; + this.frame.Y = 0; + } + else + this.frame.Y = num1; + } + else if ((double) this.velocity.Y < 0.0) + { + this.frame.Y = num1 * 2; + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num1 * 2; + } + } + else if (this.type == 163) + { + if ((double) this.velocity.Y != 0.0) + { + this.frameCounter = -12.0; + this.frame.Y = (double) this.velocity.Y >= 0.0 ? num1 * 6 : num1 * 5; + } + else + { + this.spriteDirection = this.direction; + this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.10000002384186; + if (this.frameCounter < -6.0) + this.frame.Y = num1 * 6; + else if (this.frameCounter < 0.0) + this.frame.Y = num1 * 7; + else if (this.frameCounter < 6.0) + this.frame.Y = num1; + else if (this.frameCounter < 12.0) + this.frame.Y = num1 * 2; + else if (this.frameCounter < 18.0) + this.frame.Y = num1 * 3; + else + this.frameCounter = 0.0; + } + } + else if (this.type == 143) + { + if ((double) this.velocity.Y > 0.0) + ++this.frameCounter; + else if ((double) this.velocity.Y < 0.0) + --this.frameCounter; + if (this.frameCounter < 6.0) + this.frame.Y = num1; + else if (this.frameCounter < 12.0) + this.frame.Y = num1 * 2; + else if (this.frameCounter < 18.0) + this.frame.Y = num1 * 3; + if (this.frameCounter < 0.0) + this.frameCounter = 0.0; + if (this.frameCounter > 17.0) + this.frameCounter = 17.0; + } + else if (this.type == 144) + { + if ((double) this.velocity.X == 0.0 && (double) this.velocity.Y == 0.0) + { + ++this.localAI[3]; + if ((double) this.localAI[3] < 6.0) + this.frame.Y = 0; + else if ((double) this.localAI[3] < 12.0) + this.frame.Y = num1; + if ((double) this.localAI[3] >= 11.0) + this.localAI[3] = 0.0f; + } + else + { + if ((double) this.velocity.Y > 0.0) + ++this.frameCounter; + else if ((double) this.velocity.Y < 0.0) + --this.frameCounter; + if (this.frameCounter < 6.0) + this.frame.Y = num1 * 2; + else if (this.frameCounter < 12.0) + this.frame.Y = num1 * 3; + else if (this.frameCounter < 18.0) + this.frame.Y = num1 * 4; + if (this.frameCounter < 0.0) + this.frameCounter = 0.0; + if (this.frameCounter > 17.0) + this.frameCounter = 17.0; + } + } + else if (this.type == 145) + { + if ((double) this.velocity.X == 0.0 && (double) this.velocity.Y == 0.0) + { + if ((double) this.ai[2] < 4.0) + this.frame.Y = 0; + else if ((double) this.ai[2] < 8.0) + this.frame.Y = num1; + else if ((double) this.ai[2] < 12.0) + this.frame.Y = num1 * 2; + else if ((double) this.ai[2] < 16.0) + this.frame.Y = num1 * 3; + } + else + { + if ((double) this.velocity.Y > 0.0) + ++this.frameCounter; + else if ((double) this.velocity.Y < 0.0) + --this.frameCounter; + if (this.frameCounter < 6.0) + this.frame.Y = num1 * 4; + else if (this.frameCounter < 12.0) + this.frame.Y = num1 * 5; + else if (this.frameCounter < 18.0) + this.frame.Y = num1 * 6; + if (this.frameCounter < 0.0) + this.frameCounter = 0.0; + if (this.frameCounter > 17.0) + this.frameCounter = 17.0; + } + } + else if (this.type == 50) + { + if ((double) this.velocity.Y != 0.0) + { + if (this.frame.Y < num1 * 4) + { + this.frame.Y = num1 * 4; + this.frameCounter = 0.0; + } + if (++this.frameCounter >= 4.0) + this.frame.Y = num1 * 5; + } + else + { + if (this.frame.Y >= num1 * 5) + { + this.frame.Y = num1 * 4; + this.frameCounter = 0.0; + } + ++this.frameCounter; + if (num2 > 0) + ++this.frameCounter; + if (num2 == 4) + ++this.frameCounter; + if (this.frameCounter >= 8.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + if (this.frame.Y >= num1 * 4) + this.frame.Y = 0; + } + } + } + else if (this.type == 170 || this.type == 171 || this.type == 180) + { + this.spriteDirection = this.direction; + ++this.frameCounter; + if (this.frameCounter >= 4.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num1 * 14) + this.frame.Y = 0; + } + else if (this.type == 135) + this.frame.Y = (double) this.ai[2] != 0.0 ? num1 : 0; + else if (this.type == 85 || this.type == 341) + { + if ((double) this.ai[0] == 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + else + { + int num204 = 3; + if ((double) this.velocity.Y == 0.0) + --this.frameCounter; + else + ++this.frameCounter; + if (this.frameCounter < 0.0) + this.frameCounter = 0.0; + if (this.frameCounter > (double) (num204 * 4)) + this.frameCounter = (double) (num204 * 4); + if (this.frameCounter < (double) num204) + this.frame.Y = num1; + else if (this.frameCounter < (double) (num204 * 2)) + this.frame.Y = num1 * 2; + else if (this.frameCounter < (double) (num204 * 3)) + this.frame.Y = num1 * 3; + else if (this.frameCounter < (double) (num204 * 4)) + this.frame.Y = num1 * 4; + else if (this.frameCounter < (double) (num204 * 5)) + this.frame.Y = num1 * 5; + else if (this.frameCounter < (double) (num204 * 6)) + this.frame.Y = num1 * 4; + else if (this.frameCounter < (double) (num204 * 7)) + { + this.frame.Y = num1 * 3; + } + else + { + this.frame.Y = num1 * 2; + if (this.frameCounter >= (double) (num204 * 8)) + this.frameCounter = (double) num204; + } + } + if ((double) this.ai[3] == 2.0) + this.frame.Y += num1 * 6; + else if ((double) this.ai[3] == 3.0) + this.frame.Y += num1 * 12; + else if ((double) this.ai[3] == 4.0) + this.frame.Y += num1 * 18; + } + else if (this.type == 113 || this.type == 114) + { + if ((double) this.ai[2] == 0.0) + { + ++this.frameCounter; + if (this.frameCounter >= 12.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) + this.frame.Y = 0; + } + else + { + this.frame.Y = 0; + this.frameCounter = -60.0; + } + } + else if (this.type == 61) + { + this.spriteDirection = this.direction; + this.rotation = this.velocity.X * 0.1f; + if ((double) this.velocity.X == 0.0 && (double) this.velocity.Y == 0.0) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + else + { + ++this.frameCounter; + if (this.frameCounter < 4.0) + { + this.frame.Y = num1; + } + else + { + this.frame.Y = num1 * 2; + if (this.frameCounter >= 7.0) + this.frameCounter = 0.0; + } + } + } + else if (this.type == 252 || this.type == 301) + { + if (this.type == 301) + { + if ((double) this.velocity.Y == 0.0) + { + this.spriteDirection = -this.direction; + } + else + { + if ((double) this.velocity.X > 0.5) + this.spriteDirection = -1; + if ((double) this.velocity.X < -0.5) + this.spriteDirection = 1; + } + } + else + { + if ((double) this.velocity.X > 0.5) + this.spriteDirection = 1; + if ((double) this.velocity.X < -0.5) + this.spriteDirection = -1; + } + this.rotation = this.velocity.X * 0.1f; + if ((double) this.velocity.X == 0.0 && (double) this.velocity.Y == 0.0) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + else + { + ++this.frameCounter; + if (this.frameCounter > 4.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + } + if (this.frame.Y > num1 * 4 || this.frame.Y == 0) + this.frame.Y = num1; + } + } + else if (this.type == 122) + { + this.spriteDirection = this.direction; + this.rotation = this.velocity.X * 0.05f; + if ((double) this.ai[3] > 0.0) + { + int num205 = (int) ((double) this.ai[3] / 8.0); + this.frameCounter = 0.0; + this.frame.Y = (num205 + 3) * num1; + } + else + { + ++this.frameCounter; + if (this.frameCounter >= 8.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num1 * 3) + this.frame.Y = 0; + } + } + else if (this.type == 74 || this.type == 297 || this.type == 298 || this.type == 442) + { + this.spriteDirection = this.direction; + this.rotation = this.velocity.X * 0.1f; + if ((double) this.velocity.X == 0.0 && (double) this.velocity.Y == 0.0) + { + this.frame.Y = num1 * 4; + this.frameCounter = 0.0; + } + else + { + ++this.frameCounter; + if (this.frameCounter >= 4.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) + this.frame.Y = 0; + } + } + else if (this.type == 362 || this.type == 364) + { + this.spriteDirection = this.direction; + if ((double) this.velocity.X == 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + else + { + ++this.frameCounter; + if (this.frameCounter >= 4.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num1 * 10) + this.frame.Y = num1 * 3; + if (this.frame.Y < num1 * 3) + this.frame.Y = num1 * 3; + } + } + else if (this.type == 363 || this.type == 365) + { + this.spriteDirection = this.direction; + if (this.wet) + { + ++this.frameCounter; + if (this.frameCounter >= 8.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y > num1 * 2) + this.frame.Y = num1; + if (this.frame.Y < num1) + this.frame.Y = num1; + this.rotation = 0.0f; + } + else if ((double) this.velocity.X == 0.0 && (double) this.velocity.Y == 0.0) + { + this.frame.Y = num1; + this.frameCounter = 0.0; + this.rotation = 0.0f; + } + else + { + this.rotation = this.velocity.X * 0.1f; + ++this.frameCounter; + if (this.frameCounter >= 4.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) + this.frame.Y = num1 * 11; + if (this.frame.Y < num1 * 11) + this.frame.Y = num1 * 11; + } + } + else if (this.type == 62 || this.type == 66) + { + this.spriteDirection = this.direction; + this.rotation = this.velocity.X * 0.1f; + ++this.frameCounter; + if (this.frameCounter < 6.0) + { + this.frame.Y = 0; + } + else + { + this.frame.Y = num1; + if (this.frameCounter >= 11.0) + this.frameCounter = 0.0; + } + } + else if (this.type == 156) + { + this.spriteDirection = this.direction; + this.rotation = this.velocity.X * 0.1f; + ++this.frameCounter; + if (this.frameCounter >= 20.0) + this.frameCounter = 0.0; + this.frame.Y = (int) this.frameCounter / 4 * num1; + } + else if (this.type == 63 || this.type == 64 || this.type == 103 || this.type == 242 || this.type == 256) + { + if ((this.type == 63 || this.type == 64 || this.type == 103 || this.type == 242) && (double) this.ai[1] == 1.0) + { + ++this.frameCounter; + if (this.frameCounter > 4.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + } + if (this.frame.Y > num1 * 6) + this.frame.Y = num1 * 4; + if (this.frame.Y >= num1 * 4) + return; + this.frame.Y = num1 * 4; + return; + } + ++this.frameCounter; + if (this.frameCounter < 6.0) + this.frame.Y = 0; + else if (this.frameCounter < 12.0) + this.frame.Y = num1; + else if (this.frameCounter < 18.0) + { + this.frame.Y = num1 * 2; + } + else + { + this.frame.Y = num1 * 3; + if (this.frameCounter >= 23.0) + this.frameCounter = 0.0; + } + } + else if (this.type == 221) + { + if ((double) this.localAI[2] == 1.0) + { + if ((double) this.localAI[0] == 1.0) + { + this.frame.Y = 0; + this.localAI[0] = 0.0f; + } + ++this.frameCounter; + if (this.frameCounter >= 8.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) + this.frame.Y = num1 * Main.npcFrameCount[this.type] - num1; + } + else + { + ++this.frameCounter; + if (this.frameCounter >= 13.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) + this.frame.Y = 0; + } + } + else if (this.type == 2 || this.type == 23 || this.type == 121 || this.type == 169 || this.type == 190 || this.type == 191 || this.type == 192 || this.type == 193 || this.type == 194 || this.type == 317 || this.type == 318) + { + if (this.type == 2 || this.type == 190 || this.type == 191 || this.type == 192 || this.type == 193 || this.type == 194 || this.type == 317 || this.type == 318) + { + if ((double) this.velocity.X > 0.0) + { + this.spriteDirection = 1; + this.rotation = (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X); + } + if ((double) this.velocity.X < 0.0) + { + this.spriteDirection = -1; + this.rotation = (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X) + 3.14f; + } + } + else if (this.type == 2 || this.type == 121) + { + if ((double) this.velocity.X > 0.0) + this.spriteDirection = 1; + if ((double) this.velocity.X < 0.0) + this.spriteDirection = -1; + this.rotation = this.velocity.X * 0.1f; + } + ++this.frameCounter; + if (this.frameCounter >= 8.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) + this.frame.Y = 0; + } + else if (this.type == 133) + { + if ((double) this.velocity.X > 0.0) + { + this.spriteDirection = 1; + this.rotation = (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X); + } + if ((double) this.velocity.X < 0.0) + { + this.spriteDirection = -1; + this.rotation = (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X) + 3.14f; + } + ++this.frameCounter; + this.frame.Y = this.frameCounter < 8.0 ? 0 : num1; + if (this.frameCounter >= 16.0) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + if ((double) this.life < (double) this.lifeMax * 0.5) + this.frame.Y += num1 * 2; + } + else if (this.type == 116) + { + if ((double) this.velocity.X > 0.0) + { + this.spriteDirection = 1; + this.rotation = (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X); + } + if ((double) this.velocity.X < 0.0) + { + this.spriteDirection = -1; + this.rotation = (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X) + 3.14f; + } + ++this.frameCounter; + if (this.frameCounter >= 5.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) + this.frame.Y = 0; + } + else if (this.type == 75) + { + this.spriteDirection = (double) this.velocity.X <= 0.0 ? -1 : 1; + this.rotation = this.velocity.X * 0.1f; + ++this.frameCounter; + if (this.frameCounter >= 4.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) + this.frame.Y = 0; + } + else if (this.type == 157) + { + this.spriteDirection = this.direction; + ++this.frameCounter; + if (!this.wet) + ++this.frameCounter; + int num206 = 5; + if (this.frameCounter < (double) num206) + this.frame.Y = 0; + else if (this.frameCounter < (double) (num206 * 2)) + this.frame.Y = num1; + else if (this.frameCounter < (double) (num206 * 3)) + this.frame.Y = num1 * 2; + else if (this.frameCounter < (double) (num206 * 4)) + this.frame.Y = num1; + else if (this.frameCounter < (double) (num206 * 5)) + this.frame.Y = num1 * 3; + else if (this.frameCounter < (double) (num206 * 6)) + this.frame.Y = num1 * 4; + else if (this.frameCounter < (double) (num206 * 7)) + this.frame.Y = num1 * 5; + else if (this.frameCounter < (double) (num206 * 8)) + this.frame.Y = num1 * 4; + else + this.frameCounter = 0.0; + } + else if (this.type == 55 || this.type == 57 || this.type == 58 || this.type == 102 || this.type == 241 || this.type == 465) + { + this.spriteDirection = this.direction; + ++this.frameCounter; + if (this.wet) + { + if (this.frameCounter < 6.0) + this.frame.Y = 0; + else if (this.frameCounter < 12.0) + this.frame.Y = num1; + else if (this.frameCounter < 18.0) + this.frame.Y = num1 * 2; + else if (this.frameCounter < 24.0) + this.frame.Y = num1 * 3; + else + this.frameCounter = 0.0; + } + else if (this.frameCounter < 6.0) + this.frame.Y = num1 * 4; + else if (this.frameCounter < 12.0) + this.frame.Y = num1 * 5; + else + this.frameCounter = 0.0; + } + else if (this.type == 69) + { + if ((double) this.ai[0] < 190.0) + { + ++this.frameCounter; + if (this.frameCounter >= 6.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type] - 1) + this.frame.Y = 0; + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num1 * (Main.npcFrameCount[this.type] - 1); + } + } + else if (this.type == 155) + { + if ((double) this.velocity.Y > 0.0) + { + this.frame.Y = num1 * 4; + this.frameCounter = 0.0; + } + else if ((double) this.velocity.Y < 0.0) + { + this.frame.Y = num1 * 6; + this.frameCounter = 0.0; + } + else + { + this.spriteDirection = this.direction; + this.frameCounter += (double) Math.Abs(this.velocity.X) * 0.400000005960464; + if (this.direction > 0 && (double) this.velocity.X < 0.0 || this.direction < 0 && (double) this.velocity.X > 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + else if (this.frameCounter < 8.0) + this.frame.Y = num1 * 3; + else if (this.frameCounter < 16.0) + this.frame.Y = num1 * 6; + else if (this.frameCounter < 24.0) + this.frame.Y = num1 * 4; + else if (this.frameCounter < 32.0) + this.frame.Y = num1 * 5; + else + this.frameCounter = 0.0; + } + } + else if (this.type == 329) + { + if ((double) this.velocity.Y > 0.0) + { + this.frame.Y = num1 * 3; + this.frameCounter = 0.0; + } + else if ((double) this.velocity.Y < 0.0) + { + this.frame.Y = num1 * 2; + this.frameCounter = 0.0; + } + else + { + this.spriteDirection = this.direction; + this.frameCounter += (double) Math.Abs(this.velocity.X) * 0.400000005960464; + if (this.frameCounter > 4.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y < num1 * 2) + this.frame.Y = num1 * 2; + if (this.frame.Y > num1 * 9) + this.frame.Y = num1 * 2; + } + } + } + else if (this.type == 86) + { + if ((double) this.velocity.Y == 0.0 || this.wet) + this.spriteDirection = (double) this.velocity.X >= -2.0 ? ((double) this.velocity.X <= 2.0 ? this.direction : 1) : -1; + if ((double) this.velocity.Y != 0.0) + { + this.frame.Y = num1 * 15; + this.frameCounter = 0.0; + } + else if ((double) this.velocity.X == 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + else if ((double) Math.Abs(this.velocity.X) < 3.0) + { + this.frameCounter += (double) Math.Abs(this.velocity.X); + if (this.frameCounter >= 6.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y / num1 >= 9) + this.frame.Y = num1; + if (this.frame.Y / num1 <= 0) + this.frame.Y = num1; + } + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X); + if (this.frameCounter >= 10.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y / num1 >= 15) + this.frame.Y = num1 * 9; + if (this.frame.Y / num1 <= 8) + this.frame.Y = num1 * 9; + } + } + } + else if (this.type == 315) + { + if ((double) this.velocity.Y == 0.0 || this.wet) + this.spriteDirection = (double) this.velocity.X >= -1.0 ? ((double) this.velocity.X <= 1.0 ? this.direction : 1) : -1; + if ((double) this.velocity.Y != 0.0) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X); + if (this.frameCounter >= 8.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y / num1 > 10) + this.frame.Y = num1; + } + } + } + else if (this.type == (int) sbyte.MaxValue) + { + if ((double) this.ai[1] == 0.0) + { + ++this.frameCounter; + if (this.frameCounter >= 12.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y / num1 >= 2) + this.frame.Y = 0; + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num1 * 2; + } + } + else if (this.type == 129) + { + if ((double) this.velocity.Y == 0.0) + this.spriteDirection = this.direction; + ++this.frameCounter; + if (this.frameCounter >= 2.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) + this.frame.Y = 0; + } + } + else if (this.type == 130) + { + if ((double) this.velocity.Y == 0.0) + this.spriteDirection = this.direction; + ++this.frameCounter; + if (this.frameCounter >= 8.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) + this.frame.Y = 0; + } + } + else if (this.type == 67 || this.type == 217 || this.type == 218 || this.type == 219) + { + if ((double) this.velocity.Y == 0.0) + this.spriteDirection = this.direction; + ++this.frameCounter; + if (this.frameCounter >= 6.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) + this.frame.Y = 0; + } + } + else if (this.type == 220) + { + if ((double) this.velocity.Y == 0.0) + this.spriteDirection = this.direction; + ++this.frameCounter; + if (this.frameCounter >= 10.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) + this.frame.Y = 0; + } + } + else if (this.type == 109) + { + if ((double) this.velocity.Y == 0.0 && ((double) this.velocity.X <= 0.0 && this.direction < 0 || (double) this.velocity.X >= 0.0 && this.direction > 0)) + this.spriteDirection = this.direction; + this.frameCounter += (double) Math.Abs(this.velocity.X); + if (this.frameCounter >= 7.0) + { + this.frameCounter -= 7.0; + this.frame.Y += num1; + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) + this.frame.Y = 0; + } + } + else if (this.type == 83 || this.type == 84 || this.type == 179) + { + if ((double) this.ai[0] == 2.0) + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + else + { + ++this.frameCounter; + if (this.frameCounter >= 4.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) + this.frame.Y = 0; + } + } + } + else if (this.type == 72) + { + ++this.frameCounter; + if (this.frameCounter >= 3.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type]) + this.frame.Y = 0; + } + } + else if (this.type == 65) + { + this.spriteDirection = this.direction; + ++this.frameCounter; + if (this.wet && this.type == 65) + { + if (this.frameCounter < 6.0) + this.frame.Y = 0; + else if (this.frameCounter < 12.0) + this.frame.Y = num1; + else if (this.frameCounter < 18.0) + this.frame.Y = num1 * 2; + else if (this.frameCounter < 24.0) + this.frame.Y = num1 * 3; + else + this.frameCounter = 0.0; + } + } + else if (this.type >= 542 && this.type <= 545) + { + this.spriteDirection = this.direction; + ++this.frameCounter; + if (this.frameCounter >= 16.0) + this.frameCounter = 0.0; + this.frame.Y = num1 * (int) (this.frameCounter / 4.0); + } + else if (this.type == 224) + { + if ((double) this.velocity.X > 0.0) + { + this.spriteDirection = 1; + this.rotation = this.velocity.Y * 0.2f; + } + if ((double) this.velocity.X < 0.0) + { + this.spriteDirection = -1; + this.rotation = (float) (-(double) this.velocity.Y * 0.200000002980232); + } + ++this.frameCounter; + if (this.frameCounter >= 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num1 * 4) + this.frame.Y = 0; + } + else if (this.type == 150 || this.type == 151 || this.type == 152 || this.type == 158 || this.type == 226) + { + if ((double) this.velocity.X > 0.0) + this.spriteDirection = 1; + if ((double) this.velocity.X < 0.0) + this.spriteDirection = -1; + this.rotation = this.velocity.X * 0.1f; + ++this.frameCounter; + if (this.frameCounter >= 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num1 * 4) + this.frame.Y = 0; + } + else if (this.type == 48 || this.type == 49 || this.type == 51 || this.type == 60 || this.type == 82 || this.type == 93 || this.type == 137 || this.type == 182 || this.type == 210 || this.type == 211 || this.type == 253 || this.type == 316) + { + if ((double) this.velocity.X > 0.0) + this.spriteDirection = 1; + if ((double) this.velocity.X < 0.0) + this.spriteDirection = -1; + this.rotation = this.velocity.X * 0.1f; + if (this.type == 210 || this.type == 211) + { + ++this.frameCounter; + this.rotation = this.velocity.X * 0.2f; + } + ++this.frameCounter; + if (this.frameCounter >= 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) + this.frame.Y = 0; + } + else if (this.type == 330) + { + if ((double) this.velocity.X > 0.0) + this.spriteDirection = 1; + if ((double) this.velocity.X < 0.0) + this.spriteDirection = -1; + this.rotation = this.velocity.X * 0.15f; + ++this.frameCounter; + if (this.frameCounter >= 8.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y >= num1 * Main.npcFrameCount[this.type]) + this.frame.Y = 0; + } + else if (this.type == 42 || this.type >= 231 && this.type <= 235) + { + ++this.frameCounter; + if (this.frameCounter < 2.0) + this.frame.Y = 0; + else if (this.frameCounter < 4.0) + this.frame.Y = num1; + else if (this.frameCounter < 6.0) + this.frame.Y = num1 * 2; + else if (this.frameCounter < 8.0) + this.frame.Y = num1; + else + this.frameCounter = 0.0; + } + else if (this.type == 205) + { + this.frameCounter += 0.5; + if (this.frameCounter < 2.0) + this.frame.Y = 0; + else if (this.frameCounter < 4.0) + this.frame.Y = num1; + else if (this.frameCounter < 6.0) + this.frame.Y = num1 * 2; + else if (this.frameCounter < 8.0) + this.frame.Y = num1; + else + this.frameCounter = 0.0; + } + else if (this.type == 176) + { + ++this.frameCounter; + if (this.frameCounter > 4.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y > num1) + this.frame.Y = 0; + } + else if (this.type == 43 || this.type == 56 || this.type == 175) + { + ++this.frameCounter; + if (this.frameCounter < 6.0) + this.frame.Y = 0; + else if (this.frameCounter < 12.0) + this.frame.Y = num1; + else if (this.frameCounter < 18.0) + this.frame.Y = num1 * 2; + else if (this.frameCounter < 24.0) + this.frame.Y = num1; + if (this.frameCounter == 23.0) + this.frameCounter = 0.0; + } + else if (this.type == 115) + { + ++this.frameCounter; + if (this.frameCounter < 3.0) + this.frame.Y = 0; + else if (this.frameCounter < 6.0) + this.frame.Y = num1; + else if (this.frameCounter < 12.0) + this.frame.Y = num1 * 2; + else if (this.frameCounter < 15.0) + this.frame.Y = num1; + if (this.frameCounter == 15.0) + this.frameCounter = 0.0; + } + else if (this.type == 101) + { + ++this.frameCounter; + if (this.frameCounter > 6.0) + { + this.frame.Y += num1 * 2; + this.frameCounter = 0.0; + } + if (this.frame.Y > num1 * 2) + this.frame.Y = 0; + } + if (this.type == 199) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + } + if (this.frame.Y < num1 * 3) + { + ++this.frameCounter; + if (this.frameCounter <= 6.0) + return; + this.frameCounter = 0.0; + this.frame.Y += num1; + } + else + { + if ((double) this.velocity.Y != 0.0) + return; + this.frameCounter += (double) Math.Abs(this.velocity.X); + if (this.frameCounter <= 12.0) + return; + this.frameCounter = 0.0; + this.frame.Y += num1; + if (this.frame.Y <= num1 * 7) + return; + this.frame.Y = num1 * 3; + } + } + else if (this.type == 467) + { + if ((double) this.ai[0] == 1.0) + { + ++this.frameCounter; + if (this.frameCounter <= 4.0) + return; + this.frameCounter = 0.0; + if (this.frame.Y >= num1 * 6) + return; + this.frame.Y += num1; + this.frameCounter = 0.0; + } + else + { + ++this.frameCounter; + if (this.frameCounter <= 4.0) + return; + this.frameCounter = 0.0; + if (this.frame.Y > num1 * 3) + this.frame.Y = num1 * 3; + if (this.frame.Y <= 0) + return; + this.frame.Y -= num1; + this.frameCounter = 0.0; + } + } + else if (this.type == 480) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + if ((double) this.ai[2] < 0.0) + { + ++this.frameCounter; + if (this.frameCounter > 3.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y >= Main.npcFrameCount[this.type] * num1) + { + this.frame.Y = num1 * 21; + } + else + { + if (this.frame.Y >= num1 * 21) + return; + this.frame.Y = num1 * 21; + } + } + else if ((double) this.velocity.X == 0.0) + { + ++this.frameCounter; + if (this.frameCounter > 4.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 <= 7) + return; + this.frame.Y = 0; + } + else + { + this.frameCounter += 1.0 + (double) Math.Abs(this.velocity.X); + if (this.frameCounter > 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type] - 4) + { + this.frame.Y = num1 * 10; + } + else + { + if (this.frame.Y / num1 >= 10) + return; + this.frame.Y = num1 * 10; + } + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num1 * 8; + } + } + else if (this.type == 483) + { + if ((double) this.ai[0] == -1.0) + { + ++this.frameCounter; + if (this.frameCounter > 4.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y > num1 * 21) + this.frame.Y = num1 * 21; + else if (this.frame.Y < num1 * 13) + this.frame.Y = num1 * 13; + this.rotation += this.velocity.X * 0.2f; + } + else + { + ++this.frameCounter; + if (this.frameCounter > 4.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y > num1 * 11) + this.frame.Y = 0; + this.rotation = this.velocity.X * 0.1f; + } + } + else if (this.type == 482) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + if ((double) this.ai[2] < 0.0) + { + ++this.frameCounter; + if (this.frameCounter > 3.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y >= Main.npcFrameCount[this.type] * num1) + { + this.frame.Y = num1 * 11; + } + else + { + if (this.frame.Y >= num1 * 11) + return; + this.frame.Y = num1 * 11; + } + } + else if ((double) this.velocity.X == 0.0) + { + ++this.frameCounter; + this.frame.Y = 0; + } + else + { + this.frameCounter += 0.200000002980232 + (double) Math.Abs(this.velocity.X); + if (this.frameCounter > 8.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 >= Main.npcFrameCount[this.type] - 10) + { + this.frame.Y = num1 * 2; + } + else + { + if (this.frame.Y / num1 >= 2) + return; + this.frame.Y = num1 * 2; + } + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num1; + } + } + else if (this.type == 461) + { + if (this.wet) + { + if ((double) this.velocity.X < 0.0) + this.direction = -1; + if ((double) this.velocity.X > 0.0) + this.direction = 1; + if (this.spriteDirection != this.direction) + { + this.rotation *= -1f; + this.spriteDirection = this.direction; + } + float num207 = (float) Math.Atan2((double) this.velocity.Y * (double) this.direction, (double) this.velocity.X * (double) this.direction); + if ((double) Math.Abs(this.rotation - num207) >= 3.14) + { + if ((double) num207 < (double) this.rotation) + this.rotation -= 6.28f; + else + this.rotation += 6.28f; + } + this.rotation = (float) (((double) this.rotation * 4.0 + (double) num207) / 5.0); + this.frameCounter += (double) Math.Abs(this.velocity.Length()); + ++this.frameCounter; + if (this.frameCounter > 8.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 > 20) + { + this.frame.Y = num1 * 16; + } + else + { + if (this.frame.Y / num1 >= 16) + return; + this.frame.Y = num1 * 19; + } + } + else + { + if ((double) this.rotation > 3.14) + this.rotation -= 6.28f; + if ((double) this.rotation > -0.01 && (double) this.rotation < 0.01) + this.rotation = 0.0f; + else + this.rotation *= 0.9f; + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + if ((double) this.velocity.X == 0.0) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; + ++this.frameCounter; + if (this.frameCounter > 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 <= 15) + return; + this.frame.Y = num1 * 2; + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num1; + } + } + } + else if (this.type == 466) + { + if ((double) this.ai[2] <= 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + if ((double) this.ai[2] == 0.0) + this.frame.Y = 0; + else if ((double) this.ai[2] < -8.0) + this.frame.Y = num1; + else + this.frame.Y = num1 * 2; + } + else if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + if ((double) this.velocity.X == 0.0) + { + this.frame.Y = num1 * 2; + this.frameCounter = 0.0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; + ++this.frameCounter; + if (this.frameCounter > 7.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 > 17) + this.frame.Y = num1 * 4; + if (this.frame.Y / num1 >= 4) + return; + this.frame.Y = num1 * 4; + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num1 * 3; + } + } + else if (this.type == 471) + { + bool flag = false; + if ((double) this.ai[3] < 0.0) + flag = true; + if (flag) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + this.frameCounter += (double) Math.Abs(this.velocity.Length()) * 0.5; + ++this.frameCounter; + if (this.frameCounter < 6.0) + this.frame.Y = num1 * 17; + else if (this.frameCounter < 12.0) + this.frame.Y = num1 * 18; + else if (this.frameCounter < 18.0) + this.frame.Y = num1 * 19; + else if (this.frameCounter < 23.0) + { + this.frame.Y = num1 * 18; + } + else + { + this.frame.Y = num1 * 18; + this.frameCounter = 0.0; + } + } + else if ((double) this.ai[3] == 1.0) + { + this.frame.Y = num1 * 16; + this.frameCounter = 0.0; + } + else if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + if ((double) this.velocity.X == 0.0) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; + ++this.frameCounter; + if (this.frameCounter > 7.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 > 15) + this.frame.Y = num1 * 2; + if (this.frame.Y / num1 >= 2) + return; + this.frame.Y = num1 * 2; + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num1; + } + } + else if (this.type == 166) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + if ((double) this.velocity.X == 0.0) + { + this.frameCounter += 2.0; + if (this.frameCounter > 7.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 <= 5) + return; + this.frame.Y = 0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X); + ++this.frameCounter; + if (this.frameCounter > 9.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 > 12) + this.frame.Y = num1 * 7; + if (this.frame.Y / num1 >= 7) + return; + this.frame.Y = num1 * 7; + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num1 * 6; + } + } + else if (this.type == 469) + { + if ((double) this.ai[2] == 1.0) + { + this.rotation = (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X) + 1.57f; + if ((double) this.velocity.X < 0.0) + this.direction = -1; + if ((double) this.velocity.X > 0.0) + this.direction = 1; + this.spriteDirection = this.direction; + this.frameCounter += (double) Math.Abs(this.velocity.Length()); + if (this.frameCounter > 11.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 > 5) + this.frame.Y = num1 * 2; + if (this.frame.Y / num1 >= 2) + return; + this.frame.Y = num1 * 2; + } + else + { + this.rotation = 0.0f; + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + if ((double) this.velocity.X == 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X); + ++this.frameCounter; + if (this.frameCounter > 9.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 > 11) + this.frame.Y = num1 * 6; + if (this.frame.Y / num1 >= 6) + return; + this.frame.Y = num1 * 6; + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num1; + } + } + } + else if (this.type == 351) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + if ((double) this.velocity.X == 0.0) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.0; + ++this.frameCounter; + if (this.frameCounter > 8.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 < Main.npcFrameCount[this.type]) + return; + this.frame.Y = num1 * 2; + } + } + else + { + this.frame.Y = (double) this.velocity.Y >= 0.0 ? num1 : num1; + this.frameCounter = 0.0; + } + } + else if (this.type == 343) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + if ((double) this.velocity.X == 0.0) + { + this.frame.Y = num1 * 2; + this.frameCounter = 0.0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.0; + ++this.frameCounter; + if (this.frameCounter > 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 < Main.npcFrameCount[this.type]) + return; + this.frame.Y = num1 * 2; + } + } + else + { + this.frame.Y = (double) this.velocity.Y >= 0.0 ? num1 : 0; + this.frameCounter = 0.0; + } + } + else if (this.type >= 269 && this.type <= 280) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + if ((double) this.velocity.X == 0.0) + { + if (this.type == 140) + { + this.frame.Y = num1; + this.frameCounter = 0.0; + } + else + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; + ++this.frameCounter; + if (this.frameCounter > 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 < Main.npcFrameCount[this.type]) + return; + this.frame.Y = num1 * 2; + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + } + else if (this.type == 230) + { + if ((double) this.velocity.Y == 0.0) + { + this.rotation = 0.0f; + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + if ((double) this.velocity.X == 0.0) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; + ++this.frameCounter; + if (this.frameCounter > 10.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 < Main.npcFrameCount[this.type]) + return; + this.frame.Y = 0; + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = 0; + if ((double) this.velocity.Y <= 4.0) + return; + this.rotation -= this.velocity.Y * 0.01f; + } + } + else if (this.type == 290) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + if ((double) this.ai[2] > 0.0) + { + if ((double) this.ai[1] < 10.0) + this.frame.Y = num1 * 11; + else if ((double) this.ai[1] < 20.0) + this.frame.Y = num1 * 10; + else + this.frame.Y = num1 * 9; + } + else if ((double) this.velocity.X == 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + else + { + if (this.frame.Y < num1 * 2) + this.frame.Y = num1 * 2; + this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.0; + if (this.frameCounter > 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y <= num1 * 8) + return; + this.frame.Y = num1 * 2; + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num1; + } + } + else if (this.type == 110 || this.type == 214 || this.type == 215 || this.type == 216 || this.type == 291 || this.type == 292 || this.type == 293) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + if ((double) this.ai[2] > 0.0) + { + this.spriteDirection = this.direction; + this.frame.Y = num1 * (int) this.ai[2]; + this.frameCounter = 0.0; + } + else + { + if (this.frame.Y < num1 * 6) + this.frame.Y = num1 * 6; + this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; + this.frameCounter += (double) this.velocity.X; + if (this.frameCounter > 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 < Main.npcFrameCount[this.type]) + return; + this.frame.Y = num1 * 6; + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + } + else if (this.type == 206) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + if ((double) this.ai[2] > 0.0) + { + this.spriteDirection = this.direction; + this.frame.Y = num1 * (int) this.ai[2]; + this.frameCounter = 0.0; + } + else + { + if (this.frame.Y < num1 * 6) + this.frame.Y = num1 * 6; + this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; + this.frameCounter += (double) this.velocity.X; + if (this.frameCounter > 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 < Main.npcFrameCount[this.type]) + return; + this.frame.Y = num1 * 6; + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + } + else if (this.type == 350) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + if ((double) this.ai[2] > 0.0) + { + this.spriteDirection = this.direction; + this.frame.Y = num1 * ((int) this.ai[2] - 1); + this.frameCounter = 0.0; + } + else + { + if (this.frame.Y < num1 * 7) + this.frame.Y = num1 * 7; + this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; + this.frameCounter += (double) this.velocity.X * 1.29999995231628; + if (this.frameCounter > 4.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 < Main.npcFrameCount[this.type]) + return; + this.frame.Y = num1 * 7; + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num1 * 5; + } + } + else if (this.type == 111) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + if ((double) this.ai[2] > 0.0) + { + this.spriteDirection = this.direction; + this.frame.Y = num1 * ((int) this.ai[2] - 1); + this.frameCounter = 0.0; + } + else + { + if (this.frame.Y < num1 * 7) + this.frame.Y = num1 * 7; + this.frameCounter += (double) Math.Abs(this.velocity.X) * 2.0; + this.frameCounter += (double) this.velocity.X * 1.29999995231628; + if (this.frameCounter > 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 < Main.npcFrameCount[this.type]) + return; + this.frame.Y = num1 * 7; + } + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num1 * 6; + } + } + else if (this.type == 257) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + } + if ((double) this.velocity.Y != 0.0 || this.direction == -1 && (double) this.velocity.X > 0.0 || this.direction == 1 && (double) this.velocity.X < 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = num1 * 4; + } + else if ((double) this.velocity.X == 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X); + if (this.frameCounter < 8.0) + this.frame.Y = 0; + else if (this.frameCounter < 16.0) + this.frame.Y = num1; + else if (this.frameCounter < 24.0) + this.frame.Y = num1 * 2; + else if (this.frameCounter < 32.0) + this.frame.Y = num1 * 3; + else + this.frameCounter = 0.0; + } + } + else if (this.type == 258) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + } + if ((double) this.velocity.Y != 0.0 || this.direction == -1 && (double) this.velocity.X > 0.0 || this.direction == 1 && (double) this.velocity.X < 0.0) + { + ++this.frameCounter; + if (this.frameCounter > 1.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y <= num1 * 5 && this.frame.Y >= num1 * 3) + return; + this.frame.Y = num1 * 3; + } + else if ((double) this.velocity.X == 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X); + if (this.frameCounter < 8.0) + this.frame.Y = 0; + else if (this.frameCounter < 16.0) + this.frame.Y = num1; + else if (this.frameCounter < 24.0) + this.frame.Y = num1 * 2; + else + this.frameCounter = 0.0; + } + } + else if (this.type == 348) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + } + if ((double) this.velocity.Y != 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = num1 * 8; + } + else if ((double) this.velocity.X == 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X); + ++this.frameCounter; + if (this.frameCounter > 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y <= num1 * 7) + return; + this.frame.Y = num1; + } + } + else if (this.type == 349) + { + ++this.frameCounter; + if (this.frameCounter > 3.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y <= num1 * 7) + return; + this.frame.Y = 0; + } + else if (this.type == 3 || this.type == 342 || this.type == 331 || this.type == 332 || this.type == 52 || this.type == 53 || this.type == 536 || this.type == 132 || this.type == 161 || this.type == 162 || this.type == 186 || this.type == 187 || this.type == 188 || this.type == 189 || this.type == 200 || this.type == 223 || this.type == 251 || this.type == 254 || this.type == (int) byte.MaxValue || this.type >= 319 && this.type <= 321) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + } + if ((double) this.velocity.Y != 0.0 || this.direction == -1 && (double) this.velocity.X > 0.0 || this.direction == 1 && (double) this.velocity.X < 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = num1 * 2; + } + else if ((double) this.velocity.X == 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X); + if (this.frameCounter < 8.0) + this.frame.Y = 0; + else if (this.frameCounter < 16.0) + this.frame.Y = num1; + else if (this.frameCounter < 24.0) + this.frame.Y = num1 * 2; + else if (this.frameCounter < 32.0) + this.frame.Y = num1; + else + this.frameCounter = 0.0; + } + } + else if (this.type == 148 || this.type == 149 || this.type == 168 || this.type == 470) + { + int num208 = 0; + if ((double) this.localAI[0] == 2.0) + num208 = 3; + if ((double) this.localAI[0] == 3.0) + num208 = 6; + if ((double) this.localAI[0] == 4.0) + num208 = 9; + int num209 = num208 * num1; + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + if ((double) this.velocity.X == 0.0) + { + this.frame.Y = num209; + this.frameCounter = 0.0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.0; + if (this.frameCounter < 6.0) + this.frame.Y = num209; + else if (this.frameCounter < 12.0) + this.frame.Y = num1 + num209; + else if (this.frameCounter < 15.0) + { + this.frame.Y = num1 * 2 + num209; + } + else + { + this.frameCounter = 0.0; + this.frame.Y = num1 * 2 + num209; + } + } + } + else if ((double) this.velocity.Y < 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = num1 * 2 + num209; + } + else + { + if ((double) this.velocity.Y <= 0.0) + return; + this.frameCounter = 0.0; + this.frame.Y = num1 * 2 + num209; + } + } + else if (this.type == 299 || this.type == 538 || this.type == 539) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + if ((double) this.velocity.X == 0.0) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X) * 0.5; + ++this.frameCounter; + if (this.frameCounter > 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 < Main.npcFrameCount[this.type] - 1) + return; + this.frame.Y = num1; + } + } + else if ((double) this.velocity.Y < 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = num1 * 2; + } + else + { + if ((double) this.velocity.Y <= 0.0) + return; + this.frameCounter = 0.0; + this.frame.Y = num1 * 4; + } + } + else if (this.type == 300 || this.type == 447) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + if ((double) this.velocity.X == 0.0) + { + ++this.frameCounter; + if (this.frameCounter > 8.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 <= 1) + return; + this.frame.Y = 0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X) * 0.5; + ++this.frameCounter; + if (this.frameCounter > 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 < Main.npcFrameCount[this.type]) + return; + this.frame.Y = num1 * 2; + } + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X) * 0.5; + ++this.frameCounter; + if (this.frameCounter > 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 < Main.npcFrameCount[this.type]) + return; + this.frame.Y = num1 * 2; + } + } + else if (this.type == 361 || this.type == 445) + { + this.spriteDirection = this.direction; + if ((double) this.velocity.Y == 0.0) + { + if ((double) this.velocity.X == 0.0) + { + ++this.frameCounter; + if (this.frameCounter > 6.0) + { + this.frameCounter = 0.0; + this.frame.Y += num1; + } + if (this.frame.Y <= num1 * 5) + return; + this.frame.Y = 0; + } + else + { + ++this.frameCounter; + int num210 = 6; + if (this.frameCounter < (double) num210) + this.frame.Y = 0; + else if (this.frameCounter < (double) (num210 * 2)) + this.frame.Y = num1 * 6; + else if (this.frameCounter < (double) (num210 * 3)) + { + this.frame.Y = num1 * 8; + } + else + { + this.frame.Y = num1 * 9; + if (this.frameCounter < (double) (num210 * 4 - 1)) + return; + this.frameCounter = 0.0; + } + } + } + else if ((double) this.velocity.Y > 0.0) + this.frame.Y = num1 * 9; + else + this.frame.Y = num1 * 8; + } + else if (this.type == 366 || this.type == 367) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + } + if ((double) this.velocity.X == 0.0) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.0; + ++this.frameCounter; + if (this.frameCounter > 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 < Main.npcFrameCount[this.type]) + return; + this.frame.Y = 0; + } + } + else if (this.type == 46 || this.type == 47 || this.type == 303 || this.type == 337 || this.type == 443 || this.type == 464 || this.type == 540) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + if ((double) this.velocity.X == 0.0) + { + this.frame.Y = 0; + this.frameCounter = 0.0; + } + else + { + this.frameCounter += (double) Math.Abs(this.velocity.X) * 1.0; + ++this.frameCounter; + if (this.frameCounter > 6.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y / num1 < Main.npcFrameCount[this.type]) + return; + this.frame.Y = 0; + } + } + else if ((double) this.velocity.Y < 0.0) + { + this.frameCounter = 0.0; + this.frame.Y = num1 * 4; + } + else + { + if ((double) this.velocity.Y <= 0.0) + return; + this.frameCounter = 0.0; + this.frame.Y = num1 * 6; + } + } + else if (this.type == 4 || this.type == 125 || this.type == 126) + { + ++this.frameCounter; + if (this.frameCounter < 7.0) + this.frame.Y = 0; + else if (this.frameCounter < 14.0) + this.frame.Y = num1; + else if (this.frameCounter < 21.0) + { + this.frame.Y = num1 * 2; + } + else + { + this.frameCounter = 0.0; + this.frame.Y = 0; + } + if ((double) this.ai[0] <= 1.0) + return; + this.frame.Y += num1 * 3; + } + else if (this.type == 5) + { + ++this.frameCounter; + if (this.frameCounter >= 8.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y < num1 * Main.npcFrameCount[this.type]) + return; + this.frame.Y = 0; + } + else if (this.type == 94) + { + ++this.frameCounter; + if (this.frameCounter < 6.0) + this.frame.Y = 0; + else if (this.frameCounter < 12.0) + this.frame.Y = num1; + else if (this.frameCounter < 18.0) + { + this.frame.Y = num1 * 2; + } + else + { + this.frame.Y = num1; + if (this.frameCounter < 23.0) + return; + this.frameCounter = 0.0; + } + } + else if (this.type == 6 || this.type == 173) + { + ++this.frameCounter; + if (this.frameCounter >= 8.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y < num1 * Main.npcFrameCount[this.type]) + return; + this.frame.Y = 0; + } + else if (this.type == 24) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + } + if ((double) this.ai[1] > 0.0) + { + if (this.frame.Y < 4) + this.frameCounter = 0.0; + ++this.frameCounter; + if (this.frameCounter <= 4.0) + this.frame.Y = num1 * 4; + else if (this.frameCounter <= 8.0) + this.frame.Y = num1 * 5; + else if (this.frameCounter <= 12.0) + this.frame.Y = num1 * 6; + else if (this.frameCounter <= 16.0) + this.frame.Y = num1 * 7; + else if (this.frameCounter <= 20.0) + { + this.frame.Y = num1 * 8; + } + else + { + this.frame.Y = num1 * 9; + this.frameCounter = 100.0; + } + } + else + { + ++this.frameCounter; + if (this.frameCounter <= 4.0) + this.frame.Y = 0; + else if (this.frameCounter <= 8.0) + this.frame.Y = num1; + else if (this.frameCounter <= 12.0) + { + this.frame.Y = num1 * 2; + } + else + { + this.frame.Y = num1 * 3; + if (this.frameCounter < 16.0) + return; + this.frameCounter = 0.0; + } + } + } + else if (this.type == 29 || this.type == 32 || this.type == 45 || this.type == 172 || this.type >= 281 && this.type <= 286) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.direction == 1) + this.spriteDirection = 1; + if (this.direction == -1) + this.spriteDirection = -1; + } + this.frame.Y = 0; + if ((double) this.velocity.Y != 0.0) + { + this.frame.Y += num1; + } + else + { + if ((double) this.ai[1] <= 0.0) + return; + this.frame.Y += num1 * 2; + } + } + else + { + if (this.type != 34) + return; + ++this.frameCounter; + if (this.frameCounter >= 4.0) + { + this.frame.Y += num1; + this.frameCounter = 0.0; + } + if (this.frame.Y < num1 * Main.npcFrameCount[this.type]) + return; + this.frame.Y = 0; + } } public void SimpleFlyMovement(Vector2 desiredVelocity, float moveSpeed) @@ -38068,17 +29541,17 @@ label_422: if ((int) Main.tile[x, y].frameY % 36 != 0) --y; int chest2 = Chest.FindChest(x, y); - for (int index = 0; index < 40; ++index) - Main.chest[chest1].item[index] = new Item(); - Chest.DestroyChest(x, y); for (int index1 = x; index1 <= x + 1; ++index1) { for (int index2 = y; index2 <= y + 1; ++index2) { if (TileID.Sets.BasicChest[(int) Main.tile[index1, index2].type]) - Main.tile[index1, index2].ClearTile(); + Main.tile[index1, index2].active(false); } } + for (int index = 0; index < 40; ++index) + Main.chest[chest1].item[index] = new Item(); + Chest.DestroyChest(x, y); int number = 1; if (Main.tile[x, y].type == (ushort) 467) number = 5; @@ -38268,9 +29741,9 @@ label_422: faceTarget = false; if (faceTarget) { - int aggro = Main.player[this.target].aggro; - int num6 = (Main.player[this.target].height + Main.player[this.target].width + this.height + this.width) / 4; - if (Main.player[this.target].itemAnimation != 0 || Main.player[this.target].aggro >= 0 || this.oldTarget < 0 || this.oldTarget > 254) + float num6 = num2 - (float) Main.player[this.target].aggro; + float num7 = (float) ((Main.player[this.target].height + Main.player[this.target].width + this.height + this.width) / 4 + 750 + 50); + if (Main.player[this.target].itemAnimation != 0 || Main.player[this.target].aggro >= 0 || (double) num6 <= (double) num7 || this.oldTarget < 0 || this.oldTarget > 254) { this.direction = 1; if ((double) (this.targetRect.X + this.targetRect.Width / 2) < (double) this.position.X + (double) (this.width / 2)) @@ -38288,76 +29761,101 @@ label_422: this.netUpdate = true; } - public bool DoesntDespawnToInactivity() + public void CheckActive() { + if (!this.active) + return; switch (this.type) { case 8: + return; case 9: + return; case 11: + return; case 12: + return; case 14: + return; case 15: - case 36: + return; case 40: case 41: + return; case 88: + return; case 89: + return; case 90: + return; case 91: + return; case 92: + return; case 96: + return; case 97: + return; case 99: + return; case 100: + return; case 113: case 114: case 115: + return; case 118: case 119: - case 128: - case 129: - case 130: - case 131: + return; case 134: case 135: case 136: + return; + case 139: + if (NPC.npcsFoundForCheckActive[134]) + return; + break; case 246: case 247: case 248: case 249: + return; case 263: + return; case 267: + return; case 328: + return; case 379: case 380: - case 392: - case 393: - case 394: + return; case 396: case 397: case 398: + return; case 400: + return; case 422: + return; case 437: case 438: case 439: case 440: + return; case 488: - case 492: + return; case 493: + return; case 507: + return; case 517: + return; case 548: + return; case 549: + return; case 551: - case 564: - case 565: - return true; - case 139: - if (NPC.npcsFoundForCheckActive[134]) - return true; - break; + return; case 552: case 553: case 554: @@ -38384,48 +29882,44 @@ label_422: case 577: case 578: if (NPC.npcsFoundForCheckActive[548]) - return true; + return; break; + case 564: + return; + case 565: + return; } - return false; - } - - public void CheckActive() - { - if (!this.active || this.DoesntDespawnToInactivity()) - return; if (this.townNPC) { - this.AddIntoPlayersTownNPCSlots(); + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle((int) ((double) this.position.X + (double) (this.width / 2) - (double) NPC.townRangeX), (int) ((double) this.position.Y + (double) (this.height / 2) - (double) NPC.townRangeY), NPC.townRangeX * 2, NPC.townRangeY * 2); + for (int index = 0; index < (int) byte.MaxValue; ++index) + { + if (Main.player[index].active && rectangle.Intersects(new Microsoft.Xna.Framework.Rectangle((int) Main.player[index].position.X, (int) Main.player[index].position.Y, Main.player[index].width, Main.player[index].height))) + Main.player[index].townNPCs += this.npcSlots; + } } else { bool flag = false; Microsoft.Xna.Framework.Rectangle rectangle1 = new Microsoft.Xna.Framework.Rectangle((int) ((double) this.position.X + (double) (this.width / 2) - (double) NPC.activeRangeX), (int) ((double) this.position.Y + (double) (this.height / 2) - (double) NPC.activeRangeY), NPC.activeRangeX * 2, NPC.activeRangeY * 2); Microsoft.Xna.Framework.Rectangle rectangle2 = new Microsoft.Xna.Framework.Rectangle((int) ((double) this.position.X + (double) (this.width / 2) - (double) NPC.sWidth * 0.5 - (double) this.width), (int) ((double) this.position.Y + (double) (this.height / 2) - (double) NPC.sHeight * 0.5 - (double) this.height), NPC.sWidth + this.width * 2, NPC.sHeight + this.height * 2); - for (int plr = 0; plr < (int) byte.MaxValue; ++plr) + for (int index = 0; index < (int) byte.MaxValue; ++index) { - if (Main.player[plr].active) + if (Main.player[index].active) { - Microsoft.Xna.Framework.Rectangle hitbox = Main.player[plr].Hitbox; - if (rectangle1.Intersects(hitbox)) + if (rectangle1.Intersects(new Microsoft.Xna.Framework.Rectangle((int) Main.player[index].position.X, (int) Main.player[index].position.Y, Main.player[index].width, Main.player[index].height))) { flag = true; if (this.type != 25 && this.type != 30 && this.type != 33 && this.releaseOwner == (short) byte.MaxValue && this.lifeMax > 0) { if (Main.slimeRain && Main.slimeRainNPC[this.type]) - Main.player[plr].nearbyActiveNPCs += this.npcSlots * Main.slimeRainNPCSlots; + Main.player[index].activeNPCs += this.npcSlots * Main.slimeRainNPCSlots; else - Main.player[plr].nearbyActiveNPCs += this.npcSlots; + Main.player[index].activeNPCs += this.npcSlots; } } - if (rectangle2.Intersects(hitbox)) - { + if (rectangle2.Intersects(new Microsoft.Xna.Framework.Rectangle((int) Main.player[index].position.X, (int) Main.player[index].position.Y, Main.player[index].width, Main.player[index].height))) this.timeLeft = NPC.activeTime; - this.despawnEncouraged = false; - if (plr == Main.myPlayer && (this.type == 604 || this.type == 605)) - this.LadyBugLuck(plr, this.type == 605); - } if (this.boss) flag = true; switch (this.type) @@ -38454,16 +29948,6 @@ label_422: this.timeLeft = NPC.activeTime; flag = true; continue; - case 583: - case 584: - case 585: - if (!Main.dayTime && (double) this.ai[2] == 0.0) - { - flag = true; - this.timeLeft = NPC.activeTime; - continue; - } - continue; default: continue; } @@ -38482,8 +29966,6 @@ label_422: this.life = 0; NetMessage.SendData(23, number: this.whoAmI); } - if (this.extraValue > 0) - NPC.RevengeManager.CacheEnemy(this); if (this.aiStyle != 6) return; for (int number = (int) this.ai[0]; number > 0; number = (int) Main.npc[number].ai[0]) @@ -38502,22 +29984,10 @@ label_422: } } - private void AddIntoPlayersTownNPCSlots() - { - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle((int) ((double) this.position.X + (double) (this.width / 2) - (double) NPC.townRangeX), (int) ((double) this.position.Y + (double) (this.height / 2) - (double) NPC.townRangeY), NPC.townRangeX * 2, NPC.townRangeY * 2); - for (int index = 0; index < (int) byte.MaxValue; ++index) - { - if (Main.player[index].active && rectangle.Intersects(Main.player[index].Hitbox)) - Main.player[index].townNPCs += this.npcSlots; - } - } - public void checkDead() { if (!this.active || this.realLife >= 0 && this.realLife != this.whoAmI || this.life > 0) return; - if (this.type == 604 || this.type == 605) - NPC.LadyBugKilled(this.Center, this.type == 605); if (this.type == 397 || this.type == 396) { if ((double) this.ai[0] == -2.0) @@ -38560,38 +30030,15 @@ label_422: NPC.noSpawnCycle = true; if (this.townNPC && this.type != 37 && this.type != 453) { - if (Main.netMode != 2) - this.NPCLuck(); - bool flag = true; NetworkText fullNetName = this.GetFullNetName(); - int index1 = 19; - if (this.type == 369 || NPCID.Sets.IsTownPet[this.type]) - { - index1 = 36; - flag = false; - } - NetworkText networkText = NetworkText.FromKey(Lang.misc[index1].Key, (object) fullNetName); - if (flag) - { - for (int index2 = 0; index2 < (int) byte.MaxValue; ++index2) - { - Player player = Main.player[index2]; - if (player != null && player.active && player.difficulty != (byte) 2) - { - flag = false; - break; - } - } - } - if (flag) - this.DropTombstoneTownNPC(networkText); + NetworkText text = NetworkText.FromKey(Lang.misc[this.type == 369 ? 36 : 19].Key, (object) fullNetName); switch (Main.netMode) { case 0: - Main.NewText(networkText.ToString(), G: (byte) 25, B: (byte) 25); + Main.NewText(text.ToString(), G: (byte) 25, B: (byte) 25); break; case 2: - ChatHelper.BroadcastChatMessage(networkText, new Color((int) byte.MaxValue, 25, 25)); + NetMessage.BroadcastChatMessage(text, new Color((int) byte.MaxValue, 25, 25)); break; } } @@ -38606,12 +30053,29 @@ label_422: } } } - if (this.townNPC && Main.netMode != 1 && this.homeless && WorldGen.prioritizedTownNPCType == this.type) - WorldGen.prioritizedTownNPCType = 0; + if (this.townNPC && Main.netMode != 1 && this.homeless && WorldGen.prioritizedTownNPC == this.type) + WorldGen.prioritizedTownNPC = 0; if (this.DeathSound != null) - SoundEngine.PlaySound(this.DeathSound, this.position); + Main.PlaySound(this.DeathSound, this.position); if (this.type == 13 || this.type == 14 || this.type == 15) - this.DropEoWLoot(); + { + bool flag = true; + for (int index = 0; index < 200; ++index) + { + if (index != this.whoAmI && Main.npc[index].active && (Main.npc[index].type == 13 || Main.npc[index].type == 14 || Main.npc[index].type == 15)) + { + flag = false; + break; + } + } + if (flag) + { + this.boss = true; + this.NPCLoot(); + } + else + this.NPCLoot(); + } else if (this.type == 134) { Vector2 position1 = this.position; @@ -38640,200 +30104,70 @@ label_422: DD2Event.CheckProgress(this.type); this.CheckProgressFrostMoon(); this.CheckProgressPumpkinMoon(); - int npcInvasionGroup = NPC.GetNPCInvasionGroup(this.type); - if (npcInvasionGroup <= 0 || npcInvasionGroup != Main.invasionType) - return; - int num = 1; + int num3 = 0; switch (this.type) { - case 216: - num = 5; - break; - case 387: - num = 0; - break; - case 395: - num = 10; - break; - case 471: - num = 10; - break; - case 472: - num = 0; - break; - case 491: - num = 10; - break; - } - if (num <= 0) - return; - Main.invasionSize -= num; - if (Main.invasionSize < 0) - Main.invasionSize = 0; - if (Main.netMode != 1) - Main.ReportInvasionProgress(Main.invasionSizeStart - Main.invasionSize, Main.invasionSizeStart, npcInvasionGroup + 3, 0); - if (Main.netMode != 2) - return; - NetMessage.SendData(78, number: Main.invasionProgress, number2: ((float) Main.invasionProgressMax), number3: ((float) Main.invasionProgressIcon)); - } - } - - public void DropTombstoneTownNPC(NetworkText deathText) - { - if (Main.netMode == 1) - return; - float num1 = 0.1f; - if (Main.rand.Next(2) == 0) - num1 = -0.1f; - float num2 = (float) Main.rand.Next(-35, 36) * 0.1f; - while ((double) num2 < 2.0 && (double) num2 > -2.0) - num2 += (float) Main.rand.Next(-30, 31) * 0.1f; - int num3 = Main.rand.Next(6); - int Type = this.type == 17 || this.type == 441 ? Main.rand.Next(5) + 527 : (num3 != 0 ? num3 + 200 : 43); - int index = Projectile.NewProjectile(this.position.X + (float) (this.width / 2), this.position.Y + (float) (this.height / 2), (float) Main.rand.Next(10, 30) * num1 + num2, (float) Main.rand.Next(-40, -20) * 0.1f, Type, 0, 0.0f, Main.myPlayer); - Main.projectile[index].miscText = deathText.ToString(); - } - - public static int GetNPCInvasionGroup(int npcID) - { - int num = 0; - if (npcID <= 216) - { - if (npcID <= 111) - { - if ((uint) (npcID - 26) > 3U && npcID != 111) - goto label_18; - } - else if ((uint) (npcID - 143) > 2U) - { - if ((uint) (npcID - 212) <= 4U) - goto label_13; - else - goto label_18; - } - else - { - num = 2; - goto label_18; - } - } - else if (npcID <= 395) - { - switch (npcID - 305) - { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 20: - case 21: - case 22: - case 24: - case 25: - num = -2; - goto label_18; - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - case 19: - case 23: case 26: case 27: case 28: case 29: - case 30: - case 31: - case 32: - goto label_18; - case 33: - case 34: - case 35: - case 36: - case 37: - case 38: - case 39: - case 40: - case 41: - case 42: - case 43: - case 44: - case 45: - num = -1; - goto label_18; - default: - switch (npcID - 381) - { - case 0: - case 1: - case 2: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 14: - num = 4; - goto label_18; - default: - goto label_18; - } + case 111: + case 471: + num3 = 1; + break; + case 143: + case 144: + case 145: + num3 = 2; + break; + case 212: + case 213: + case 214: + case 215: + case 216: + case 491: + num3 = 3; + break; + case 381: + case 382: + case 383: + case 385: + case 386: + case 388: + case 389: + case 390: + case 391: + case 395: + num3 = 4; + break; } - } - else if ((uint) (npcID - 471) > 1U) - { - if (npcID != 491) + if (num3 == 0 || num3 != Main.invasionType) + return; + int num4 = 1; + switch (this.type) { - if ((uint) (npcID - 547) <= 31U) - { - num = -3; - goto label_18; - } - else - goto label_18; + case 216: + num4 = 5; + break; + case 395: + num4 = 10; + break; + case 471: + num4 = 10; + break; + case 491: + num4 = 10; + break; } - else - goto label_13; + Main.invasionSize -= num4; + if (Main.invasionSize < 0) + Main.invasionSize = 0; + if (Main.netMode != 1) + Main.ReportInvasionProgress(Main.invasionSizeStart - Main.invasionSize, Main.invasionSizeStart, num3 + 3, 0); + if (Main.netMode != 2) + return; + NetMessage.SendData(78, number: Main.invasionProgress, number2: ((float) Main.invasionProgressMax), number3: ((float) Main.invasionProgressIcon)); } - num = 1; - goto label_18; -label_13: - num = 3; -label_18: - return num; - } - - private void DropEoWLoot(bool fromCheckDead = true) - { - bool flag = true; - for (int index = 0; index < 200; ++index) - { - if (index != this.whoAmI && Main.npc[index].active && (Main.npc[index].type == 13 || Main.npc[index].type == 14 || Main.npc[index].type == 15)) - { - flag = false; - break; - } - } - if (flag) - { - this.boss = true; - this.NPCLoot(); - } - else - this.NPCLoot(); } private void CheckProgressFrostMoon() @@ -38980,7 +30314,7 @@ label_18: Main.NewText(text.ToString(), (byte) 175, (byte) 75); break; case 2: - ChatHelper.BroadcastChatMessage(text, new Color(175, 75, (int) byte.MaxValue)); + NetMessage.BroadcastChatMessage(text, new Color(175, 75, (int) byte.MaxValue)); break; } if (NPC.waveNumber == 15) @@ -39117,7 +30451,7 @@ label_18: Main.NewText(text.ToString(), (byte) 175, (byte) 75); break; case 2: - ChatHelper.BroadcastChatMessage(text, new Color(175, 75, (int) byte.MaxValue)); + NetMessage.BroadcastChatMessage(text, new Color(175, 75, (int) byte.MaxValue)); break; } if (NPC.waveNumber == 15) @@ -39135,7 +30469,7 @@ label_18: public static void ResetKillCount() { - for (int index = 0; index < 663; ++index) + for (int index = 0; index < 580; ++index) NPC.killCount[index] = 0; } @@ -39157,53 +30491,102 @@ label_18: return false; } - public static void SetEventFlagCleared(ref bool eventFlag, int gameEventId) + public void NPCLoot() { - bool flag = eventFlag; - eventFlag = true; - if (eventFlag == flag) + if (Main.netMode == 1 || this.type >= 580) return; - NPC.OnGameEventClearedForTheFirstTime(gameEventId); - } - - public static void OnGameEventClearedForTheFirstTime(int gameEventId) - { - switch (gameEventId) + bool flag1 = NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3; + switch (this.type) { - case 4: + case 13: + case 14: + case 15: + if (this.boss) + { + AchievementsHelper.NotifyNPCKilled(this); + break; + } break; - case 21: - case 22: + case 125: + case 126: + if (!NPC.AnyNPCs(this.type == 126 ? 125 : 126)) + { + AchievementsHelper.NotifyNPCKilled(this); + AchievementsHelper.CheckMechaMayhem(this.type); + break; + } + break; + case (int) sbyte.MaxValue: + case 134: + AchievementsHelper.CheckMechaMayhem(this.type); + AchievementsHelper.NotifyNPCKilled(this); break; default: - LanternNight.NextNightIsLanternNight = true; + AchievementsHelper.NotifyNPCKilled(this); break; } - } - - public void NPCLootOld() - { - if (Main.netMode == 1 || this.type >= 663) - return; - bool flag1 = false; - bool flag2 = NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3; - Player closestPlayer = Main.player[(int) Player.FindClosest(this.position, this.width, this.height)]; - if (!flag1) + int index1 = Item.NPCtoBanner(this.BannerID()); + if (index1 > 0 && !NPCID.Sets.ExcludedFromDeathTally[this.type]) { - this.CountKillForAchievements(); - if (this.GetWereThereAnyInteractions()) - this.CountKillForBannersAndDropThem(); + if (this.realLife < 0 ? this.AnyInteractions() : Main.npc[this.realLife].AnyInteractions()) + { + ++NPC.killCount[index1]; + if (Main.netMode == 2) + NetMessage.SendData(83, number: index1); + int num = ItemID.Sets.KillsToBanner[Item.BannerToItem(index1)]; + if (NPC.killCount[index1] % num == 0 && index1 > 0) + { + int npc = Item.BannerToNPC(index1); + new NPC().SetDefaults(npc); + int index2 = this.lastInteraction; + if (!Main.player[index2].active || Main.player[index2].dead) + index2 = this.FindClosestPlayer(); + NetworkText text = NetworkText.FromKey("Game.EnemiesDefeatedAnnouncement", (object) NPC.killCount[index1], (object) NetworkText.FromKey(Lang.GetNPCName(npc).Key)); + if (index2 >= 0 && index2 < (int) byte.MaxValue) + text = NetworkText.FromKey("Game.EnemiesDefeatedByAnnouncement", (object) Main.player[index2].name, (object) NPC.killCount[index1], (object) NetworkText.FromKey(Lang.GetNPCName(npc).Key)); + switch (Main.netMode) + { + case 0: + Main.NewText(text.ToString(), (byte) 250, (byte) 250, (byte) 0); + break; + case 2: + NetMessage.BroadcastChatMessage(text, new Color(250, 250, 0)); + break; + } + int Type = Item.BannerToItem(index1); + Vector2 position = this.position; + if (index2 >= 0 && index2 < (int) byte.MaxValue) + position = Main.player[index2].position; + Item.NewItem((int) position.X, (int) position.Y, this.width, this.height, Type); + } + } } if (this.type == 23 && Main.hardMode || this.SpawnedFromStatue && NPCID.Sets.NoEarlymodeLootWhenSpawnedFromStatue[this.type] && !Main.hardMode || this.SpawnedFromStatue && (double) NPCID.Sets.StatueSpawnedDropRarity[this.type] != -1.0 && ((double) Main.rand.NextFloat() >= (double) NPCID.Sets.StatueSpawnedDropRarity[this.type] || !this.AnyInteractions())) return; - this.NPCLoot_DropFood(closestPlayer); - if (this.type == 86) + if ((this.type == 170 || this.type == 180 || this.type == 171) && Main.rand.Next(3) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3532); + switch (this.type) { - int range = Main.expertMode ? 30 : 40; - if (closestPlayer.RollLuck(range) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3260); + case 75: + case 80: + case 84: + case 86: + case 120: + case 122: + case 137: + case 138: + case 171: + case 244: + case 475: + int maxValue1 = Main.expertMode ? 150 : 200; + if (Main.rand.Next(maxValue1) == 0) + { + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3260); + break; + } + break; } - if (Main.slimeRain && Main.slimeRainNPC[this.type] && !flag1 && !NPC.AnyNPCs(50)) + if (Main.slimeRain && Main.slimeRainNPC[this.type] && !NPC.AnyNPCs(50)) { int num = 150; if (NPC.downedSlimeKing) @@ -39211,89 +30594,121 @@ label_18: ++Main.slimeRainKillCount; if (Main.slimeRainKillCount >= num) { - NPC.SpawnOnPlayer(closestPlayer.whoAmI, 50); + NPC.SpawnOnPlayer(this.FindClosestPlayer(), 50); Main.slimeRainKillCount = -num / 2; } } - if (!closestPlayer.ZoneDungeon && !flag1) + if (!Main.player[(int) Player.FindClosest(this.position, this.width, this.height)].ZoneDungeon) { - bool flag3 = false; - if (Main.expertMode && closestPlayer.RollLuck(5) == 0) - flag3 = true; - else if (closestPlayer.RollLuck(5) == 0) - flag3 = true; + bool flag2 = false; + if (Main.expertMode && Main.rand.Next(5) == 0) + flag2 = true; + else if (Main.rand.Next(5) == 0) + flag2 = true; if (this.boss) - flag3 = false; + flag2 = false; switch (this.type) { - case 1: case 13: case 14: case 15: - case 535: - flag3 = false; + flag2 = false; break; } - if (((!Main.hardMode || this.lifeMax <= 1 || this.damage <= 0 || this.friendly ? 0 : ((double) this.position.Y > Main.rockLayer * 16.0 ? 1 : 0)) & (flag3 ? 1 : 0)) != 0 && this.type != 121 && (double) this.value > 0.0) + if (((!Main.hardMode || this.lifeMax <= 1 || this.damage <= 0 || this.friendly ? 0 : ((double) this.position.Y > Main.rockLayer * 16.0 ? 1 : 0)) & (flag2 ? 1 : 0)) != 0 && this.type != 121 && (double) this.value > 0.0) { - if (closestPlayer.ZoneCorrupt || closestPlayer.ZoneCrimson) + if (Main.player[(int) Player.FindClosest(this.position, this.width, this.height)].ZoneCorrupt || Main.player[(int) Player.FindClosest(this.position, this.width, this.height)].ZoneCrimson) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 521); - if (closestPlayer.ZoneHallow) + if (Main.player[(int) Player.FindClosest(this.position, this.width, this.height)].ZoneHoly) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 520); } } if (this.type == 1 && (double) this.ai[1] > 0.0) { int Type = (int) this.ai[1]; - if (Type > 0 && Type < 5045) + if (Type > 0 && Type < 3930) { - int forSlimeItemDrop = NPC.GetStackForSlimeItemDrop(Type); - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, forSlimeItemDrop); + int Stack = 1; + switch (Type) + { + case 8: + Stack = Main.rand.Next(5, 11); + break; + case 166: + Stack = Main.rand.Next(2, 7); + break; + case 965: + Stack = Main.rand.Next(20, 46); + break; + default: + if (Type >= 11 && Type <= 14 || Type >= 699 && Type <= 702) + { + Stack = Main.rand.Next(3, 9); + if (Main.rand.Next(2) == 0) + { + Stack += 5; + break; + } + break; + } + switch (Type) + { + case 71: + Stack = Main.rand.Next(50, 100); + break; + case 72: + Stack = Main.rand.Next(20, 100); + break; + case 73: + Stack = Main.rand.Next(1, 3); + break; + } + break; + } + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, Stack); } } if (this.type == 22 && this.GivenOrTypeName == "Andrew") Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 867); - if (this.type == 178 && this.GivenOrTypeName == "Whitney") - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4372); - if (this.type == 353 && closestPlayer.RollLuck(8) == 0) + if (this.type == 353 && Main.rand.Next(8) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3352); - if (this.type == 441 && closestPlayer.RollLuck(8) == 0) + if (this.type == 441 && Main.rand.Next(8) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3351); - if (this.type == 227 && closestPlayer.RollLuck(10) == 0) + if (this.type == 227 && Main.rand.Next(10) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3350); - if (this.type == 550 && closestPlayer.RollLuck(6) == 0) + if (this.type == 550 && Main.rand.Next(6) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3821); - if (this.type == 208 && closestPlayer.RollLuck(4) == 0) + if (this.type == 208 && Main.rand.Next(4) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3548, Main.rand.Next(30, 61)); - if (this.type == 207 && closestPlayer.RollLuck(8) == 0) + if (this.type == 207 && Main.rand.Next(8) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3349); - if (Main.hardMode && !flag1 && (double) this.value > 0.0) + if (Main.hardMode && (double) this.value > 0.0) { - if (!NPC.downedMechBoss1 && closestPlayer.RollLuck(2500) == 0) + if (!NPC.downedMechBoss1 && Main.rand.Next(2500) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 556); - else if (!NPC.downedMechBoss2 && closestPlayer.RollLuck(2500) == 0) + else if (!NPC.downedMechBoss2 && Main.rand.Next(2500) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 544); - else if (!NPC.downedMechBoss3 && closestPlayer.RollLuck(2500) == 0) + else if (!NPC.downedMechBoss3 && Main.rand.Next(2500) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 557); } - if (Main.halloween && (double) this.value > 0.0 && (double) this.value < 500.0 && this.damage < 40 && this.defense < 20 && !flag1) + if (Main.halloween && (double) this.value > 0.0 && (double) this.value < 500.0 && this.damage < 40 && this.defense < 20) { - if (closestPlayer.RollLuck(2000) == 0) + if (Main.rand.Next(2000) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1825); - else if (closestPlayer.RollLuck(2000) == 0) + else if (Main.rand.Next(2000) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1827); } - if (Main.hardMode && (double) this.value > 0.0 && !flag1) + if (Main.hardMode && (double) this.value > 0.0) { - if (closestPlayer.RollLuck(2500) == 0 && closestPlayer.ZoneJungle) + if (Main.rand.Next(2500) == 0 && Main.player[(int) Player.FindClosest(this.position, this.width, this.height)].ZoneJungle) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1533); - if (closestPlayer.RollLuck(2500) == 0 && closestPlayer.ZoneCorrupt) + if (Main.rand.Next(2500) == 0 && Main.player[(int) Player.FindClosest(this.position, this.width, this.height)].ZoneCorrupt) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1534); - if (closestPlayer.RollLuck(2500) == 0 && closestPlayer.ZoneCrimson) + if (Main.rand.Next(2500) == 0 && Main.player[(int) Player.FindClosest(this.position, this.width, this.height)].ZoneCrimson) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1535); - if (closestPlayer.RollLuck(2500) == 0 && closestPlayer.ZoneHallow) + if (Main.rand.Next(2500) == 0 && Main.player[(int) Player.FindClosest(this.position, this.width, this.height)].ZoneHoly) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1536); - if (closestPlayer.RollLuck(2500) == 0 && closestPlayer.ZoneSnow) + if (Main.rand.Next(2500) == 0 && Main.player[(int) Player.FindClosest(this.position, this.width, this.height)].ZoneSnow) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1537); } if (DD2Event.Ongoing) @@ -39421,33 +30836,33 @@ label_18: int waveNumber = NPC.waveNumber; if (Main.expertMode) waveNumber += 7; - int range = (int) ((double) (30 - waveNumber) / 2.5); + int maxValue2 = (int) ((double) (30 - waveNumber) / 2.5); if (Main.expertMode) - range -= 2; - if (range < 1) - range = 1; + maxValue2 -= 2; + if (maxValue2 < 1) + maxValue2 = 1; if (this.type == 344) - NPC.SetEventFlagCleared(ref NPC.downedChristmasTree, 21); + NPC.downedChristmasTree = true; if (this.type == 345) - NPC.SetEventFlagCleared(ref NPC.downedChristmasIceQueen, 20); + NPC.downedChristmasIceQueen = true; if (this.type == 346) - NPC.SetEventFlagCleared(ref NPC.downedChristmasSantank, 22); - if ((this.type == 344 || this.type == 345 || this.type == 346) && closestPlayer.RollLuck(range) == 0 && waveNumber >= 15) + NPC.downedChristmasSantank = true; + if ((this.type == 344 || this.type == 345 || this.type == 346) && Main.rand.Next(maxValue2) == 0 && waveNumber >= 15) { - int maxValue = 4; + int maxValue3 = 4; if (waveNumber == 16) - maxValue = 4; + maxValue3 = 4; if (waveNumber == 17) - maxValue = 3; + maxValue3 = 3; if (waveNumber == 18) - maxValue = 3; + maxValue3 = 3; if (waveNumber == 19) - maxValue = 2; + maxValue3 = 2; if (waveNumber >= 20) - maxValue = 2; + maxValue3 = 2; if (Main.expertMode && Main.rand.Next(3) == 0) - --maxValue; - if (Main.rand.Next(maxValue) == 0) + --maxValue3; + if (Main.rand.Next(maxValue3) == 0) { if (this.type == 344) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1962); @@ -39457,12 +30872,12 @@ label_18: Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1961); } } - if (closestPlayer.RollLuck(range) == 0) + if (Main.rand.Next(maxValue2) == 0) { if (this.type == 344) { int num = Main.rand.Next(3); - if (closestPlayer.RollLuck(15) == 0) + if (Main.rand.Next(15) == 0) { Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1871, pfix: -1); } @@ -39486,9 +30901,9 @@ label_18: } if (this.type == 345) { - if (NPC.waveNumber >= 15 && closestPlayer.RollLuck(30) == 0) + if (NPC.waveNumber >= 15 && Main.rand.Next(30) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1914); - else if (closestPlayer.RollLuck(15) == 0) + else if (Main.rand.Next(15) == 0) { Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1959); } @@ -39508,31 +30923,31 @@ label_18: if (this.type == 341) { int num = Main.rand.Next(5, 11); - for (int index = 0; index < num; ++index) + for (int index3 = 0; index3 < num; ++index3) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 58); if (Main.xMas) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1869); } - if (this.type >= 338 && this.type <= 340 && closestPlayer.RollLuck(5) == 0) + if (this.type >= 338 && this.type <= 340 && Main.rand.Next(5) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 58); - if (this.type >= 338 && this.type <= 340 && closestPlayer.RollLuck(200) == 0) + if (this.type >= 338 && this.type <= 340 && Main.rand.Next(200) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1943 + Main.rand.Next(3)); if (this.type == 342 && Main.rand.Next(3) != 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 58); if (Main.pumpkinMoon) { if (this.type == 325) - NPC.SetEventFlagCleared(ref NPC.downedHalloweenTree, 4); + NPC.downedHalloweenTree = true; if (this.type == 327) - NPC.SetEventFlagCleared(ref NPC.downedHalloweenKing, 5); + NPC.downedHalloweenKing = true; int waveNumber = NPC.waveNumber; if (Main.expertMode) waveNumber += 6; - int maxValue = (int) ((double) (17 - waveNumber) / 1.25); + int maxValue4 = (int) ((double) (17 - waveNumber) / 1.25); if (Main.expertMode) - --maxValue; - if (maxValue < 1) - maxValue = 1; + --maxValue4; + if (maxValue4 < 1) + maxValue4 = 1; if (waveNumber >= 15) { if (this.type == 325) @@ -39540,7 +30955,7 @@ label_18: if (this.type == 327) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1856); } - if (Main.rand.Next(maxValue) == 0) + if (Main.rand.Next(maxValue4) == 0) { if (this.type == 315 && Main.rand.Next(20) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1857); @@ -39561,8 +30976,6 @@ label_18: Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1837); if (num == 4) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1845, pfix: -1); - if (Main.expertMode && Main.rand.Next(5) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4444); } if (this.type == 327) { @@ -39602,107 +31015,103 @@ label_18: Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 58); if (this.type == 315) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 58); - if (Main.halloween && this.lifeMax > 1 && this.damage > 0 && !this.friendly && this.type != 121 && this.type != 23 && (double) this.value > 0.0 && closestPlayer.RollLuck(80) == 0 && !flag1) + if (Main.halloween && this.lifeMax > 1 && this.damage > 0 && !this.friendly && this.type != 121 && this.type != 23 && (double) this.value > 0.0 && Main.rand.Next(80) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1774); - if (Main.xMas && this.lifeMax > 1 && this.damage > 0 && !this.friendly && this.type != 121 && (double) this.value > 0.0 && closestPlayer.RollLuck(13) == 0 && !flag1) + if (Main.xMas && this.lifeMax > 1 && this.damage > 0 && !this.friendly && this.type != 121 && (double) this.value > 0.0 && Main.rand.Next(13) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1869); - if (this.lifeMax > 5 && (double) this.value > 0.0 && !this.friendly && Main.hardMode && (double) this.position.Y / 16.0 > (double) Main.UnderworldLayer && !flag1 && closestPlayer.RollLuck(50) == 0) + if (this.lifeMax > 5 && (double) this.value > 0.0 && !this.friendly && Main.hardMode && (double) this.position.Y / 16.0 > (double) (Main.maxTilesY - 200) && Main.rand.Next(50) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2701, Main.rand.Next(20, 51)); if (this.type == 325 || this.type == 327 || this.type == 344 || this.type == 345 || this.type == 346) { int num = Main.rand.Next(6) + 6; - for (int index = 0; index < num; ++index) + for (int index4 = 0; index4 < num; ++index4) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 58); } - if (this.type == 156 && closestPlayer.RollLuck(75) == 0) + if (this.type == 156 && Main.rand.Next(75) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1518); - if (this.type == 243 && closestPlayer.RollLuck(3) == 0) + if (this.type == 243 && Main.rand.Next(3) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1519); - if (this.type >= 269 && this.type <= 280 && closestPlayer.RollLuck(450) == 0) + if (this.type >= 269 && this.type <= 280 && Main.rand.Next(450) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1517); - if ((this.type == 158 || this.type == 159) && closestPlayer.RollLuck(40) == 0) + if ((this.type == 158 || this.type == 159) && Main.rand.Next(40) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1520); - if (this.type == 48 && closestPlayer.RollLuck(200) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1516); - if (this.type == 176 && closestPlayer.RollLuck(150) == 0 && NPC.downedMechBossAny) + if (this.type == 176 && Main.rand.Next(150) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1521); - if (this.type == 205 && closestPlayer.RollLuck(2) == 0 && NPC.downedMechBossAny) + if (this.type == 48 && Main.rand.Next(200) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1516); + if (this.type == 205 && Main.rand.Next(2) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1611); if (this.type == 483 || this.type == 482) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3086, Main.rand.Next(5, 11), pfix: -1); - if (!Main.hardMode && closestPlayer.RollLuck(100) == 0 && this.HasPlayerTarget && this.lifeMax > 5 && !this.friendly && !flag1 && closestPlayer.RollLuck(4) == 0 && (double) this.position.Y / 16.0 > (double) (Main.maxTilesY - 350) && NPC.downedBoss3) + if (!Main.hardMode && Main.rand.Next(100) == 0 && this.HasPlayerTarget && this.lifeMax > 5 && !this.friendly && Main.rand.Next(4) == 0 && (double) this.position.Y / 16.0 > (double) (Main.maxTilesY - 350) && NPC.downedBoss3) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3282, pfix: -1); - if (Main.hardMode && this.HasPlayerTarget && Main.player[this.target].ZoneSnow && closestPlayer.RollLuck(300) == 0 && this.HasPlayerTarget && this.lifeMax > 5 && !this.friendly && (double) this.value > 0.0 && !flag1) + if (Main.hardMode && this.HasPlayerTarget && Main.player[this.target].ZoneSnow && Main.rand.Next(300) == 0 && this.HasPlayerTarget && this.lifeMax > 5 && !this.friendly && (double) this.value > 0.0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3289, pfix: -1); - else if (Main.hardMode && closestPlayer.RollLuck(200) == 0 && this.HasPlayerTarget && this.lifeMax > 5 && !this.friendly && (double) this.value > 0.0 && !flag1) + else if (Main.hardMode && Main.rand.Next(200) == 0 && this.HasPlayerTarget && this.lifeMax > 5 && !this.friendly && (double) this.value > 0.0) { if (Main.player[this.target].ZoneJungle && NPC.downedMechBossAny) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3286, pfix: -1); else if (Main.player[this.target].ZoneDungeon && NPC.downedPlantBoss && Main.rand.Next(2) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3291, pfix: -1); - else if ((double) this.position.Y / 16.0 > (Main.rockLayer + (double) (Main.maxTilesY * 2)) / 3.0 && !Main.player[this.target].ZoneDungeon && Main.rand.Next(2) == 0) + else if ((double) this.position.Y / 16.0 > (Main.rockLayer + (double) Main.maxTilesY) / 2.0 && !Main.player[this.target].ZoneDungeon && Main.rand.Next(2) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3290, pfix: -1); } int num1 = 1; if (Main.expertMode && Main.rand.Next(2) == 0) num1 = 2; - for (int index = 0; index < num1; ++index) + for (int index5 = 0; index5 < num1; ++index5) { - if (this.type == 461 && closestPlayer.RollLuck(50) == 0) + if (this.type == 461 && Main.rand.Next(50) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 497, pfix: -1); - if ((this.type == 159 || this.type == 158) && closestPlayer.RollLuck(35) == 0) + if ((this.type == 159 || this.type == 158) && Main.rand.Next(35) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 900, pfix: -1); - if (this.type == 251 && closestPlayer.RollLuck(15) == 0) + if (this.type == 251 && Main.rand.Next(15) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1311, pfix: -1); if (NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3) { if (this.type == 477) { - if (closestPlayer.RollLuck(20) == 0 && NPC.downedPlantBoss) + if (Main.rand.Next(20) == 0 && NPC.downedPlantBoss) { Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2770, pfix: -1); - ++index; + ++index5; } - if (closestPlayer.RollLuck(4) == 0) + if (Main.rand.Next(4) == 0) { Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1570, pfix: -1); - ++index; + ++index5; } - else if (closestPlayer.RollLuck(3) == 0 && NPC.downedPlantBoss) + else if (Main.rand.Next(3) == 0 && NPC.downedPlantBoss) { Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3292, pfix: -1); - ++index; + ++index5; } } - if (this.type == 253 && closestPlayer.RollLuck(40) == 0) + if (this.type == 253 && Main.rand.Next(40) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1327, pfix: -1); } if (NPC.downedPlantBoss) { - if (this.type == 460 && closestPlayer.RollLuck(40) == 0) + if (this.type == 460 && Main.rand.Next(40) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3098, pfix: -1); - if (this.type == 468 && closestPlayer.RollLuck(40) == 0) + if (this.type == 468 && Main.rand.Next(40) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3105, pfix: -1); - if (this.type == 466 && closestPlayer.RollLuck(40) == 0) + if (this.type == 466 && Main.rand.Next(40) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3106, pfix: -1); - if (this.type == 467 && closestPlayer.RollLuck(40) == 0) + if (this.type == 467 && Main.rand.Next(40) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3249, pfix: -1); - if (this.type == 463 && closestPlayer.RollLuck(25) == 0) + if (this.type == 463 && Main.rand.Next(25) == 0) { Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3107, pfix: -1); Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3108, Main.rand.Next(100, 201), pfix: -1); } } } - if (Main.bloodMoon && Main.hardMode && closestPlayer.RollLuck(1000) == 0 && (double) this.value > 0.0 && !flag1) + if (Main.bloodMoon && Main.hardMode && Main.rand.Next(1000) == 0 && (double) this.value > 0.0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1314, pfix: -1); - if (this.type == 77 && closestPlayer.RollLuck(150) == 0) + if (this.type == 77 && Main.rand.Next(150) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 723, pfix: -1); - if (this.type == 47 && closestPlayer.RollLuck(25) == 0 && Main.IsItAHappyWindyDay) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4670, pfix: -1); - if (this.type == 464 && closestPlayer.RollLuck(25) == 0 && Main.IsItAHappyWindyDay) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4671, pfix: -1); - if (closestPlayer.RollLuck(100) == 0 || Main.expertMode && closestPlayer.RollLuck(100) == 0) + if (Main.rand.Next(100) == 0 || Main.expertMode && Main.rand.Next(100) == 0) { int Type1 = -1; int Type2 = -1; @@ -39712,7 +31121,6 @@ label_18: case 83: case 84: case 179: - case 289: Type1 = 891; break; case 42: @@ -39727,7 +31135,7 @@ label_18: break; case 75: Type1 = Main.rand.Next(2) != 0 ? 890 : 889; - if (closestPlayer.RollLuck(100) == 0) + if (Main.rand.Next(100) == 0) { Type2 = Type1 != 889 ? 889 : 890; break; @@ -39746,7 +31154,7 @@ label_18: break; case 79: Type1 = Main.rand.Next(2) != 0 ? 890 : 888; - if (closestPlayer.RollLuck(100) == 0) + if (Main.rand.Next(100) == 0) { Type2 = Type1 != 888 ? 888 : 890; break; @@ -39758,7 +31166,6 @@ label_18: Type1 = 893; break; case 81: - case 183: Type1 = 888; break; case 94: @@ -39788,16 +31195,16 @@ label_18: int num2 = 1; if (Main.expertMode && Main.rand.Next(2) == 0) num2 = 2; - for (int index = 0; index < num2; ++index) + for (int index6 = 0; index6 < num2; ++index6) { if (this.type == 290) { - if (closestPlayer.RollLuck(15) == 0) + if (Main.rand.Next(15) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1513, pfix: -1); - else if (closestPlayer.RollLuck(10) == 0) + else if (Main.rand.Next(10) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 938, pfix: -1); } - if (this.type == 287 && closestPlayer.RollLuck(6) == 0) + if (this.type == 287 && Main.rand.Next(6) == 0) { if (Main.rand.Next(2) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 963, pfix: -1); @@ -39806,49 +31213,49 @@ label_18: } if (this.type == 291) { - if (closestPlayer.RollLuck(12) == 0) + if (Main.rand.Next(12) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1300, pfix: -1); - else if (closestPlayer.RollLuck(12) == 0) + else if (Main.rand.Next(12) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1254, pfix: -1); } if (this.type == 292) { - if (closestPlayer.RollLuck(12) == 0) + if (Main.rand.Next(12) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1514, pfix: -1); - else if (closestPlayer.RollLuck(12) == 0) + else if (Main.rand.Next(12) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 679, pfix: -1); } - if (this.type == 293 && closestPlayer.RollLuck(18) == 0) + if (this.type == 293 && Main.rand.Next(18) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 759, pfix: -1); - if ((this.type == 281 || this.type == 282) && closestPlayer.RollLuck(20) == 0) + if ((this.type == 281 || this.type == 282) && Main.rand.Next(20) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1446, pfix: -1); - if ((this.type == 283 || this.type == 284) && closestPlayer.RollLuck(20) == 0) + if ((this.type == 283 || this.type == 284) && Main.rand.Next(20) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1444, pfix: -1); - if ((this.type == 285 || this.type == 286) && closestPlayer.RollLuck(20) == 0) + if ((this.type == 285 || this.type == 286) && Main.rand.Next(20) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1445, pfix: -1); if (this.type >= 269 && this.type <= 280) { - if (closestPlayer.RollLuck(400) == 0) + if (Main.rand.Next(400) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1183, pfix: -1); - else if (closestPlayer.RollLuck(300) == 0) + else if (Main.rand.Next(300) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1266, pfix: -1); - else if (closestPlayer.RollLuck(200) == 0) + else if (Main.rand.Next(200) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 671, pfix: -1); } } - if (this.lifeMax > 100 && this.type != 288 && (double) this.value > 0.0 && this.HasPlayerTarget && Main.hardMode && NPC.downedPlantBoss && Main.player[this.target].ZoneDungeon && !flag1) + if (this.lifeMax > 100 && this.type != 288 && (double) this.value > 0.0 && this.HasPlayerTarget && Main.hardMode && NPC.downedPlantBoss && Main.player[this.target].ZoneDungeon) { - int range = 13; + int maxValue5 = 13; if (Main.expertMode) - range = 9; - if (closestPlayer.RollLuck(range) == 0 && Main.wallDungeon[(int) Main.tile[(int) this.Center.X / 16, (int) this.Center.Y / 16].wall]) + maxValue5 = 9; + if (Main.rand.Next(maxValue5) == 0 && Main.wallDungeon[(int) Main.tile[(int) this.Center.X / 16, (int) this.Center.Y / 16].wall]) NPC.NewNPC((int) this.Center.X, (int) this.Center.Y, 288); } if (this.type == 288) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1508, Main.rand.Next(1, 3), pfix: -1); - if (this.type == 156 && closestPlayer.RollLuck(30) == 0) + if (this.type == 156 && Main.rand.Next(30) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 683, pfix: -1); - if ((this.type == 195 || this.type == 196) && (Main.expertMode || closestPlayer.RollLuck(2) == 0)) + if ((this.type == 195 || this.type == 196) && (Main.expertMode || Main.rand.Next(2) == 0)) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3102, pfix: -1); if (this.type == 245) { @@ -39858,11 +31265,9 @@ label_18: } else { - if (closestPlayer.RollLuck(7) == 0) + if (Main.rand.Next(7) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2110, pfix: -1); - if (closestPlayer.RollLuck(4) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1294, pfix: -1); - switch (Main.rand.Next(7)) + switch (Main.rand.Next(8)) { case 0: Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1258, pfix: -1); @@ -39878,20 +31283,23 @@ label_18: Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1248, pfix: -1); break; case 4: - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1295, pfix: -1); + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1294, pfix: -1); break; case 5: - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1296, pfix: -1); + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1295, pfix: -1); break; case 6: + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1296, pfix: -1); + break; + case 7: Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1297, pfix: -1); break; } Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2218, Main.rand.Next(4, 9), pfix: -1); } - NPC.SetEventFlagCleared(ref NPC.downedGolemBoss, 6); + NPC.downedGolemBoss = true; } - if (this.type == 471 && (Main.expertMode || closestPlayer.RollLuck(2) == 0)) + if (this.type == 471 && (Main.expertMode || Main.rand.Next(2) == 0)) { if (Main.rand.Next(3) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3052, pfix: -1); @@ -39904,16 +31312,16 @@ label_18: Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1332, Main.rand.Next(2, 6)); if (this.type == 370) { - NPC.SetEventFlagCleared(ref NPC.downedFishron, 7); + NPC.downedFishron = true; if (Main.expertMode) { this.DropBossBags(); } else { - if (closestPlayer.RollLuck(7) == 0) + if (Main.rand.Next(7) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2588, pfix: -1); - if (closestPlayer.RollLuck(15) == 0) + if (Main.rand.Next(15) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2609, pfix: -1); switch (Main.rand.Next(5)) { @@ -39935,47 +31343,37 @@ label_18: } } } - if (this.type == 614) - Projectile.NewProjectile(this.Center.X, this.Center.Y, 0.0f, 0.0f, 281, 175, 0.0f, Main.myPlayer, -2f, (float) ((int) this.releaseOwner + 1)); if (this.type == 109 && !NPC.downedClown) { NPC.downedClown = true; if (Main.netMode == 2) NetMessage.SendData(7); } - if (this.type == 153 && closestPlayer.RollLuck(17) == 0) + if (this.type == 153 && Main.rand.Next(17) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1328, pfix: -1); - if (this.type == 120) - { - if (Main.expertMode) - { - if (closestPlayer.RollLuck(400) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1326, pfix: -1); - } - else if (closestPlayer.RollLuck(500) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1326, pfix: -1); - } - if (this.type == 49 && closestPlayer.RollLuck(250) == 0) + if (this.type == 120 && Main.rand.Next(500) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1326, pfix: -1); + if (this.type == 49 && Main.rand.Next(250) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1325, pfix: -1); - if (this.type == 185 && closestPlayer.RollLuck(150) == 0) + if (this.type == 185 && Main.rand.Next(150) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 951, pfix: -1); - if (this.type == 44 && closestPlayer.RollLuck(50) == 0) + if (this.type == 44 && Main.rand.Next(50) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1320, pfix: -1); - if (this.type == 44 && closestPlayer.RollLuck(20) == 0) + if (this.type == 44 && Main.rand.Next(20) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 88, pfix: -1); - if (this.type == 110 && closestPlayer.RollLuck(80) == 0) + if (this.type == 110 && Main.rand.Next(80) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1321, pfix: -1); - if (this.type == 60 && closestPlayer.RollLuck(150) == 0) + if (this.type == 60 && Main.rand.Next(150) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1322, pfix: -1); - if (this.type == 151 && closestPlayer.RollLuck(50) == 0) + if (this.type == 151 && Main.rand.Next(50) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1322, pfix: -1); - if (this.type == 24 && closestPlayer.RollLuck(50) == 0) + if (this.type == 24 && Main.rand.Next(50) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1323, pfix: -1); - if (this.type == 109 && closestPlayer.RollLuck(30) == 0) + if (this.type == 109 && Main.rand.Next(30) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1324, Main.rand.Next(1, 5), pfix: -1); if (this.type == 163 || this.type == 238) { - if (closestPlayer.RollLuck(40) == 0) + if (Main.rand.Next(40) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1308, pfix: -1); if (Main.expertMode) { @@ -39996,7 +31394,7 @@ label_18: Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2607); } } - if (Main.hardMode && (this.type == 197 || this.type == 206 || this.type == 169 || this.type == 154) && closestPlayer.RollLuck(180) == 0) + if (Main.hardMode && (this.type == 197 || this.type == 206 || this.type == 169 || this.type == 154) && Main.rand.Next(180) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1306, pfix: -1); if (this.type == 244) { @@ -40009,46 +31407,39 @@ label_18: Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 23, Main.rand.Next(1, 6)); Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 662, Main.rand.Next(30, 60)); } - if (this.type == 250 && closestPlayer.RollLuck(15) == 0) + if (this.type == 250 && Main.rand.Next(15) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1244, pfix: -1); if (this.type == 172) { Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 754, pfix: -1); Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 755, pfix: -1); } - if (this.type == 110 && closestPlayer.RollLuck(200) == 0) + if (this.type == 110 && Main.rand.Next(200) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 682, pfix: -1); - if (this.type == 170 || this.type == 180 || this.type == 171) - { - if (closestPlayer.RollLuck(100) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4428, pfix: -1); - else if (closestPlayer.RollLuck(25) == 0 && Main.IsItAHappyWindyDay) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4613); - } - if (this.type == 154 && closestPlayer.RollLuck(100) == 0) + if (this.type == 154 && Main.rand.Next(100) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1253, pfix: -1); - if ((this.type == 169 || this.type == 206) && closestPlayer.RollLuck(50) == 0) + if ((this.type == 169 || this.type == 206) && Main.rand.Next(50) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 726, pfix: -1); if (this.type == 243) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2161, pfix: -1); - if (this.type == 480 && closestPlayer.RollLuck(50) == 0) + if (this.type == 480 && Main.rand.Next(50) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3269, pfix: -1); if (this.type == 198 || this.type == 199 || this.type == 226) { - if (closestPlayer.RollLuck(1000) == 0) + if (Main.rand.Next(1000) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1172, pfix: -1); - if (closestPlayer.RollLuck(50) == 0) + if (Main.rand.Next(50) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1293, pfix: -1); - if (closestPlayer.RollLuck(7) == 0) + if (Main.rand.Next(7) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2766, Main.rand.Next(1, 3), pfix: -1); } if (this.type == 78 || this.type == 79 || this.type == 80) { - if (closestPlayer.RollLuck(75) == 0) + if (Main.rand.Next(75) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 870, pfix: -1); - if (closestPlayer.RollLuck(75) == 0) + if (Main.rand.Next(75) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 871, pfix: -1); - if (closestPlayer.RollLuck(75) == 0) + if (Main.rand.Next(75) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 872, pfix: -1); } if (this.type == 473) @@ -40124,7 +31515,7 @@ label_18: { if ((double) this.ai[3] == 4.0) { - if (closestPlayer.RollLuck(20) == 0) + if (Main.rand.Next(20) == 0) { Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1312, pfix: -1); } @@ -40171,118 +31562,111 @@ label_18: } if (this.type == 87) { - if (closestPlayer.RollLuck(25) == 0 && Main.IsItAHappyWindyDay) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4379); - else if (Main.expertMode) + if (Main.expertMode) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 575, Main.rand.Next(5, 11) * 2); else Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 575, Main.rand.Next(5, 11)); } if (this.type >= 212 && this.type <= 215) { - if (!flag1) - { - if (closestPlayer.RollLuck(8000) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 905, pfix: -1); - if (closestPlayer.RollLuck(4000) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 855, pfix: -1); - if (closestPlayer.RollLuck(2000) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 854, pfix: -1); - if (closestPlayer.RollLuck(2000) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2584, pfix: -1); - if (closestPlayer.RollLuck(1000) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3033, pfix: -1); - if (closestPlayer.RollLuck(200) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 672, pfix: -1); - if (closestPlayer.RollLuck(500) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1277); - if (closestPlayer.RollLuck(500) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1278); - if (closestPlayer.RollLuck(500) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1279); - if (closestPlayer.RollLuck(500) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1280); - if (closestPlayer.RollLuck(300) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1704); - if (closestPlayer.RollLuck(300) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1705); - if (closestPlayer.RollLuck(300) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1710); - if (closestPlayer.RollLuck(300) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1716); - if (closestPlayer.RollLuck(300) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1720); - if (closestPlayer.RollLuck(300) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2379); - if (closestPlayer.RollLuck(300) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2389); - if (closestPlayer.RollLuck(300) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2405); - if (closestPlayer.RollLuck(300) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2843); - if (closestPlayer.RollLuck(300) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3885); - if (closestPlayer.RollLuck(300) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2663); - if (closestPlayer.RollLuck(150) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3904, Main.rand.Next(6, 11) * 5); - if (closestPlayer.RollLuck(300) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3910); - if (closestPlayer.RollLuck(300) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2238); - if (closestPlayer.RollLuck(300) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2133); - if (closestPlayer.RollLuck(300) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2137); - if (closestPlayer.RollLuck(300) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2143); - if (closestPlayer.RollLuck(300) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2147); - if (closestPlayer.RollLuck(300) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2151); - if (closestPlayer.RollLuck(300) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2155); - if (closestPlayer.RollLuck(500) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3263); - if (closestPlayer.RollLuck(500) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3264); - if (closestPlayer.RollLuck(500) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3265); - } + if (Main.rand.Next(8000) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 905, pfix: -1); + if (Main.rand.Next(4000) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 855, pfix: -1); + if (Main.rand.Next(2000) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 854, pfix: -1); + if (Main.rand.Next(2000) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2584, pfix: -1); + if (Main.rand.Next(1000) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3033, pfix: -1); + if (Main.rand.Next(200) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 672, pfix: -1); + if (Main.rand.Next(500) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1277); + if (Main.rand.Next(500) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1278); + if (Main.rand.Next(500) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1279); + if (Main.rand.Next(500) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1280); + if (Main.rand.Next(300) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1704); + if (Main.rand.Next(300) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1705); + if (Main.rand.Next(300) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1710); + if (Main.rand.Next(300) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1716); + if (Main.rand.Next(300) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1720); + if (Main.rand.Next(300) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2379); + if (Main.rand.Next(300) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2389); + if (Main.rand.Next(300) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2405); + if (Main.rand.Next(300) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2843); + if (Main.rand.Next(300) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3885); + if (Main.rand.Next(300) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2663); + if (Main.rand.Next(150) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3904, Main.rand.Next(6, 11) * 5); + if (Main.rand.Next(300) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3910); + if (Main.rand.Next(300) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2238); + if (Main.rand.Next(300) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2133); + if (Main.rand.Next(300) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2137); + if (Main.rand.Next(300) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2143); + if (Main.rand.Next(300) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2147); + if (Main.rand.Next(300) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2151); + if (Main.rand.Next(300) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2155); + if (Main.rand.Next(500) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3263); + if (Main.rand.Next(500) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3264); + if (Main.rand.Next(500) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3265); } else if (this.type == 216) { - if (closestPlayer.RollLuck(2000) == 0) + if (Main.rand.Next(2000) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 905, pfix: -1); - if (closestPlayer.RollLuck(1000) == 0) + if (Main.rand.Next(1000) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 855, pfix: -1); - if (closestPlayer.RollLuck(500) == 0) + if (Main.rand.Next(500) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 854, pfix: -1); - if (closestPlayer.RollLuck(500) == 0) + if (Main.rand.Next(500) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2584, pfix: -1); - if (closestPlayer.RollLuck(250) == 0) + if (Main.rand.Next(250) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3033, pfix: -1); - if (closestPlayer.RollLuck(50) == 0) + if (Main.rand.Next(50) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 672, pfix: -1); } else if (this.type == 491) { - if (closestPlayer.RollLuck(400) == 0) + if (Main.rand.Next(400) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 905, pfix: -1); - else if (closestPlayer.RollLuck(200) == 0) + else if (Main.rand.Next(200) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 855, pfix: -1); - else if (closestPlayer.RollLuck(100) == 0) + else if (Main.rand.Next(100) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 854, pfix: -1); - else if (closestPlayer.RollLuck(100) == 0) + else if (Main.rand.Next(100) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2584, pfix: -1); - else if (closestPlayer.RollLuck(50) == 0) + else if (Main.rand.Next(50) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3033, pfix: -1); - else if (closestPlayer.RollLuck(20) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4471, pfix: -1); - else if (closestPlayer.RollLuck(10) == 0) + else if (Main.rand.Next(10) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 672, pfix: -1); } - if ((this.type == 161 || this.type == 431) && closestPlayer.RollLuck(50) == 0) + if ((this.type == 161 || this.type == 431) && Main.rand.Next(50) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 803 + Main.rand.Next(3)); if (this.type == 217) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1115, pfix: -1); @@ -40294,94 +31678,94 @@ label_18: Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1118, pfix: -1); if (this.type == 221) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1119, pfix: -1); - if (this.type == 167 && closestPlayer.RollLuck(50) == 0) + if (this.type == 167 && Main.rand.Next(50) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 879, pfix: -1); if (this.type == 143 || this.type == 144 || this.type == 145) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 593, Main.rand.Next(5, 11)); if (this.type == 79) { - if (closestPlayer.RollLuck(10) == 0) + if (Main.rand.Next(10) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 527); } - else if (this.type == 80 && closestPlayer.RollLuck(10) == 0) + else if (this.type == 80 && Main.rand.Next(10) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 528); - if (this.type == 524 && closestPlayer.RollLuck(10) == 0) + if (this.type == 524 && Main.rand.Next(10) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3794, Main.rand.Next(1, 4)); if (this.type == 525) { - if (closestPlayer.RollLuck(10) == 0) + if (Main.rand.Next(10) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3794); - if (closestPlayer.RollLuck(3) == 0) + if (Main.rand.Next(3) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 522, Main.rand.Next(1, 4)); - if (closestPlayer.RollLuck(15) == 0) + if (Main.rand.Next(15) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 527); } if (this.type == 526) { - if (closestPlayer.RollLuck(10) == 0) + if (Main.rand.Next(10) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3794); - if (closestPlayer.RollLuck(3) == 0) + if (Main.rand.Next(3) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1332, Main.rand.Next(1, 4)); - if (closestPlayer.RollLuck(15) == 0) + if (Main.rand.Next(15) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 527); } if (this.type == 527) { - if (closestPlayer.RollLuck(10) == 0) + if (Main.rand.Next(10) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3794); - if (closestPlayer.RollLuck(15) == 0) + if (Main.rand.Next(15) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 528); } if (this.type == 532) { - if (closestPlayer.RollLuck(3) == 0) + if (Main.rand.Next(3) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3380); - if (closestPlayer.RollLuck(50) == 0) + if (Main.rand.Next(50) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3771); } if (this.type == 528) { - if (closestPlayer.RollLuck(25) == 0) + if (Main.rand.Next(25) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2802); - if (closestPlayer.RollLuck(60) == 0) + if (Main.rand.Next(60) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3784 + Main.rand.Next(3)); } else if (this.type == 529) { - if (closestPlayer.RollLuck(25) == 0) + if (Main.rand.Next(25) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2801); - if (closestPlayer.RollLuck(40) == 0) + if (Main.rand.Next(40) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3784 + Main.rand.Next(3)); } - if ((this.type == 49 || this.type == 51 || this.type == 150 || this.type == 93) && closestPlayer.RollLuck(100) == 0) + if ((this.type == 49 || this.type == 51 || this.type == 150 || this.type == 93) && Main.rand.Next(100) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 18, pfix: -1); - if ((this.type == 16 || this.type == 185 || this.type == 167 || this.type == 197) && closestPlayer.RollLuck(50) == 0) + if ((this.type == 16 || this.type == 185 || this.type == 167 || this.type == 197) && Main.rand.Next(50) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 393, pfix: -1); - if (this.type == 58 && closestPlayer.RollLuck(75) == 0) + if (this.type == 58 && Main.rand.Next(75) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 393, pfix: -1); if (this.type >= 494 && this.type <= 506) { - if (closestPlayer.RollLuck(80) == 0) + if (Main.rand.Next(80) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 18, pfix: -1); - else if (closestPlayer.RollLuck(80) == 0) + else if (Main.rand.Next(80) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 393, pfix: -1); - else if (closestPlayer.RollLuck(25) == 0) + else if (Main.rand.Next(25) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3285, pfix: -1); } if (this.type == 21 || this.type == 201 || this.type == 202 || this.type == 203 || this.type == 322 || this.type == 323 || this.type == 324 || this.type >= 449 && this.type <= 452) { - if (closestPlayer.RollLuck(100) == 0) + if (Main.rand.Next(100) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 954, pfix: -1); - else if (closestPlayer.RollLuck(200) == 0) + else if (Main.rand.Next(200) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 955, pfix: -1); - else if (closestPlayer.RollLuck(200) == 0) + else if (Main.rand.Next(200) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1166, pfix: -1); - else if (closestPlayer.RollLuck(500) == 0) + else if (Main.rand.Next(500) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1274, pfix: -1); } else if (this.type == 6) { - if (closestPlayer.RollLuck(175) == 0) + if (Main.rand.Next(175) == 0) { switch (Main.rand.Next(3)) { @@ -40399,7 +31783,7 @@ label_18: } else if (this.type == 42 || this.type == 43 || this.type >= 231 && this.type <= 235) { - if (closestPlayer.RollLuck(100) == 0) + if (Main.rand.Next(100) == 0) { switch (Main.rand.Next(3)) { @@ -40417,71 +31801,78 @@ label_18: } else if (this.type == 31 || this.type == 32 || this.type == 294 || this.type == 295 || this.type == 296) { - if (closestPlayer.RollLuck(450) == 0) + if (Main.rand.Next(450) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 959, pfix: -1); - if (closestPlayer.RollLuck(300) == 0) + if (Main.rand.Next(300) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1307, pfix: -1); } - if ((this.type == 174 || this.type == 179 || this.type == 182 || this.type == 183) && closestPlayer.RollLuck(200) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 996); - if ((this.type == 98 || this.type == 83 || this.type == 94 || this.type == 81) && closestPlayer.RollLuck(200) == 0) + if ((this.type == 174 || this.type == 179 || this.type == 182 || this.type == 183) && Main.rand.Next(200) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 996); if (this.type == 101 || this.type == 98) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 522, Main.rand.Next(2, 6)); - if (this.type == 98 && closestPlayer.RollLuck(25) == 0 && Main.IsItAHappyWindyDay) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4611); if (this.type == 86) { Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 526); - if (closestPlayer.RollLuck(100) == 0) + if (Main.rand.Next(100) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 856); } - if (this.type == 224 && closestPlayer.RollLuck(100) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4057); if (this.type == 186 || this.type == 432) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 40, Main.rand.Next(1, 10)); if (this.type == 225) { - if (closestPlayer.RollLuck(45) == 0) + if (Main.rand.Next(45) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1243); else Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 23, Main.rand.Next(2, 7)); } if (this.type == 537) { - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 23, Main.rand.Next(2, 4)); - int range = 8000; + int Stack = Main.rand.Next(1, 3); if (Main.expertMode) - range = (int) ((double) range * 0.7); - if (closestPlayer.RollLuck(range) == 0) + { + if (this.netID == -7) + ++Stack; + if (this.netID == -8 || this.netID == -9) + Stack += Main.rand.Next(2); + } + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 23, Stack); + int maxValue6 = 8000; + if (Main.expertMode) + maxValue6 = (int) ((double) maxValue6 * 0.7); + if (Main.rand.Next(maxValue6) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1309, pfix: -1); } - if (this.type >= 333 && this.type <= 336 && closestPlayer.RollLuck(20) == 0) + if (this.type >= 333 && this.type <= 336 && Main.rand.Next(20) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1906); if (this.netID == -4) { Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3111, Main.rand.Next(25, 51)); - int range = 100; + int maxValue7 = 100; if (Main.expertMode) - range = (int) ((double) range * 0.7); - if (closestPlayer.RollLuck(range) == 0) + maxValue7 = (int) ((double) maxValue7 * 0.7); + if (Main.rand.Next(maxValue7) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1309, pfix: -1); } else if (this.type == 1 || this.type == 16 || this.type == 138 || this.type == 141 || this.type == 147 || this.type == 184 || this.type == 187 || this.type == 204 || this.type == 302 || this.type >= 333 && this.type <= 336 || this.type == 535) { int Stack = Main.rand.Next(1, 3); - if (this.netID == -6 || this.netID == -7 || this.netID == -8 || this.netID == -9) - Stack += Main.rand.Next(1, 4); + if (Main.expertMode) + { + if (this.netID == -7) + ++Stack; + if (this.netID == -8 || this.netID == -9) + Stack += Main.rand.Next(2); + } int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 23, Stack); if (this.netID <= 1 && this.netID != -1 && this.netID != -2 && this.netID != -5 && this.netID != -6) { Main.item[number].color = this.color; NetMessage.SendData(88, number: number, number2: 1f); } - int range = 10000; + int maxValue8 = 10000; if (Main.expertMode) - range = (int) ((double) range * 0.7); - if (closestPlayer.RollLuck(range) == 0) + maxValue8 = (int) ((double) maxValue8 * 0.7); + if (Main.rand.Next(maxValue8) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1309, pfix: -1); } if (this.type == 75) @@ -40494,87 +31885,37 @@ label_18: Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 327); if (this.type == 2 || this.type == 317 || this.type == 318 || this.type == 190 || this.type == 191 || this.type == 192 || this.type == 193 || this.type == 194 || this.type == 133) { - if (closestPlayer.RollLuck(100) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 236); - else if (closestPlayer.RollLuck(3) == 0) + if (Main.rand.Next(3) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 38); + else if (Main.rand.Next(100) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 236); } - if (this.type == 104 && closestPlayer.RollLuck(60) == 0) + if (this.type == 104 && Main.rand.Next(60) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 485, pfix: -1); if (this.type == 58) { - if (closestPlayer.RollLuck(250) == 0) + if (Main.rand.Next(250) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 263); - else if (closestPlayer.RollLuck(30) == 0) + else if (Main.rand.Next(30) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 118); } - if (this.type == 102 && closestPlayer.RollLuck(250) == 0) + if (this.type == 102 && Main.rand.Next(250) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 263); - if (this.type == 3 || this.type == 591 || this.type == 590 || this.type == 331 || this.type == 332 || this.type == 132 || this.type == 161 || this.type == 186 || this.type == 187 || this.type == 188 || this.type == 189 || this.type == 200 || this.type == 223 || this.type == 319 || this.type == 320 || this.type == 321 || this.type >= 430 && this.type <= 436) + if (this.type == 3 || this.type == 331 || this.type == 332 || this.type == 132 || this.type == 161 || this.type == 186 || this.type == 187 || this.type == 188 || this.type == 189 || this.type == 200 || this.type == 223 || this.type == 319 || this.type == 320 || this.type == 321 || this.type >= 430 && this.type <= 436) { - if (closestPlayer.RollLuck(50) == 0) + if (Main.rand.Next(50) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 216, pfix: -1); - if (closestPlayer.RollLuck(250) == 0) + if (Main.rand.Next(250) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1304, pfix: -1); - if (this.type == 590 || this.type == 591) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 8, Main.rand.Next(5, 21)); } - if ((this.type == 587 || this.type == 586) && closestPlayer.RollLuck(3) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4608, Main.rand.Next(5, 7)); - if ((this.type == 620 || this.type == 621) && closestPlayer.RollLuck(2) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4608, Main.rand.Next(7, 11)); - if ((this.type == 587 || this.type == 586) && closestPlayer.RollLuck(15) == 0) + if ((this.type == 489 || this.type == 490) && (Main.expertMode || Main.rand.Next(2) == 0)) { - switch (Main.rand.Next(3)) - { - case 0: - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4273); - break; - case 1: - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4381); - break; - case 2: - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4325); - break; - } - } - if (this.type == 620) - { - if (closestPlayer.RollLuck(15) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4270); - if (closestPlayer.RollLuck(15) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4317); - } - if (this.type == 621) - { - if (closestPlayer.RollLuck(15) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4272); - if (closestPlayer.RollLuck(15) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4317); - } - if (this.type == 618) - { - if (closestPlayer.RollLuck(5) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4269); - if (closestPlayer.RollLuck(10) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4054); - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4608, Main.rand.Next(7, 11)); - } - if (!Main.dayTime && Main.bloodMoon && !this.SpawnedFromStatue && !flag1) - { - if ((this.type == 587 || this.type == 586 || this.type == 489 || this.type == 490 || this.type == 109 || this.type == 621 || this.type == 620 || this.type == 619) && closestPlayer.RollLuck(200) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4271); - if ((this.type == 53 || this.type == 536 || this.type == 618) && closestPlayer.RollLuck(10) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4271); - } - if ((this.type == 489 || this.type == 490) && (Main.expertMode || closestPlayer.RollLuck(2) == 0)) - { - if (closestPlayer.RollLuck(75) == 0) + if (Main.rand.Next(75) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3212, pfix: -1); - if (closestPlayer.RollLuck(100) == 0) + if (Main.rand.Next(100) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3213, pfix: -1); } - if (this.type == 223 && closestPlayer.RollLuck(20) == 0) + if (this.type == 223 && Main.rand.Next(20) == 0) { if (Main.rand.Next(2) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1135, pfix: -1); @@ -40583,9 +31924,9 @@ label_18: } if (this.type == 66) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 267); - if ((this.type == 62 || this.type == 66) && closestPlayer.RollLuck(35) == 0) + if ((this.type == 62 || this.type == 66) && Main.rand.Next(35) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 272, pfix: -1); - if ((double) this.value > 0.0 && Main.hardMode && (double) this.position.Y / 16.0 < Main.worldSurface + 10.0 && ((double) this.Center.X / 16.0 < 380.0 || (double) this.Center.X / 16.0 > (double) (Main.maxTilesX - 380)) && !flag1 && closestPlayer.RollLuck(100) == 0) + if ((double) this.value > 0.0 && Main.hardMode && (double) this.position.Y / 16.0 < Main.worldSurface + 10.0 && ((double) this.Center.X / 16.0 < 380.0 || (double) this.Center.X / 16.0 > (double) (Main.maxTilesX - 380)) && Main.rand.Next(100) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1315); if (this.type == 52) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 251); @@ -40600,42 +31941,35 @@ label_18: Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 260); if (this.type == 368) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2222); - if ((this.type == 69 || this.type == 581 || this.type == 580 || this.type == 508 || this.type == 509) && closestPlayer.RollLuck(3) == 0) + if ((this.type == 69 || this.type == 509 || this.type == 508) && Main.rand.Next(3) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 323, Main.rand.Next(1, 3)); - if (this.type == 582 && closestPlayer.RollLuck(6) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 323); - if ((this.type == 580 || this.type == 508 || this.type == 581 || this.type == 509) && closestPlayer.RollLuck(50) == 0) + if (this.type == 508 && Main.rand.Next(50) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3772); if (this.type == 73) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 362, Main.rand.Next(1, 3)); - if (this.type == 483 || this.type == 482) - { - if (closestPlayer.RollLuck(30) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3109); - if (closestPlayer.RollLuck(20) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4400); - } - if ((this.type == 6 || this.type == 94) && closestPlayer.RollLuck(3) == 0) + if ((this.type == 483 || this.type == 482) && Main.rand.Next(30) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3109); + if ((this.type == 6 || this.type == 94) && Main.rand.Next(3) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 68); - if ((this.type == 181 || this.type == 173 || this.type == 239 || this.type == 182 || this.type == 240) && closestPlayer.RollLuck(3) == 0) + if ((this.type == 181 || this.type == 173 || this.type == 239 || this.type == 182 || this.type == 240) && Main.rand.Next(3) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1330); if (this.type == 7 || this.type == 8 || this.type == 9) { - if (closestPlayer.RollLuck(3) == 0) + if (Main.rand.Next(3) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 68, Main.rand.Next(1, 3)); Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 69, Main.rand.Next(3, 9)); } - if ((this.type == 10 || this.type == 11 || this.type == 12 || this.type == 95 || this.type == 96 || this.type == 97) && (closestPlayer.RollLuck(50) == 0 || Main.expertMode && closestPlayer.RollLuck(50) == 0)) + if ((this.type == 10 || this.type == 11 || this.type == 12 || this.type == 95 || this.type == 96 || this.type == 97) && (Main.rand.Next(50) == 0 || Main.expertMode && Main.rand.Next(50) == 0)) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 215); - if ((this.type == 47 || this.type == 464) && closestPlayer.RollLuck(75) == 0) + if ((this.type == 47 || this.type == 464) && Main.rand.Next(75) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 243); - if ((this.type == 168 || this.type == 470) && closestPlayer.RollLuck(50) == 0) + if ((this.type == 168 || this.type == 470) && Main.rand.Next(50) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, (int) Utils.SelectRandom(Main.rand, (short) 3757, (short) 3758, (short) 3759)); if (this.type == 533) { - if (closestPlayer.RollLuck(40) == 0) + if (Main.rand.Next(40) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3795); - else if (closestPlayer.RollLuck(30) == 0) + else if (Main.rand.Next(30) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3770); } if (this.type == 551) @@ -40675,12 +32009,16 @@ label_18: } else { - if (closestPlayer.RollLuck(7) == 0) + if (Main.rand.Next(7) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2112, pfix: -1); - if (closestPlayer.RollLuck(40) == 0) + if (Main.rand.Next(40) == 0 || Main.expertMode && Main.rand.Next(20) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1299); + if (Main.expertMode) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3097, pfix: -1); int num3 = 1; - for (int index = 0; index < num3; ++index) + if (Main.expertMode) + num3 = 2; + for (int index7 = 0; index7 < num3; ++index7) { if (WorldGen.crimson) { @@ -40710,10 +32048,17 @@ label_18: { Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 880, Main.rand.Next(20, 46)); Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 880, Main.rand.Next(20, 46)); - if (closestPlayer.RollLuck(7) == 0) + if (Main.expertMode) + { + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 880, Main.rand.Next(30, 51)); + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 880, Main.rand.Next(30, 51)); + } + if (Main.rand.Next(7) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2104, pfix: -1); - if (closestPlayer.RollLuck(20) == 0) + if (Main.rand.Next(20) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3060); + if (Main.expertMode) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3223); } } if (this.type == 267 && NPC.AnyNPCs(266)) @@ -40732,7 +32077,7 @@ label_18: Stack2 += Main.rand.Next(6, 14); Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 880, Stack2); } - if (Main.rand.Next(2) == 0 && closestPlayer.statLife < closestPlayer.statLifeMax2) + if (Main.rand.Next(2) == 0 && Main.player[(int) Player.FindClosest(this.position, this.width, this.height)].statLife < Main.player[(int) Player.FindClosest(this.position, this.width, this.height)].statLifeMax2) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 58); } if (this.type == 13 || this.type == 14 || this.type == 15) @@ -40756,13 +32101,20 @@ label_18: { Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 56, Main.rand.Next(10, 30)); Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 56, Main.rand.Next(10, 31)); - if (closestPlayer.RollLuck(20) == 0) + if (Main.expertMode) + { + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 56, Main.rand.Next(10, 30)); + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 56, Main.rand.Next(10, 31)); + } + if (Main.expertMode) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3224); + if (Main.rand.Next(20) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 994); - if (closestPlayer.RollLuck(7) == 0) + if (Main.rand.Next(7) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2111, pfix: -1); } } - if (Main.rand.Next(4) == 0 && closestPlayer.statLife < closestPlayer.statLifeMax2) + if (Main.rand.Next(4) == 0 && Main.player[(int) Player.FindClosest(this.position, this.width, this.height)].statLife < Main.player[(int) Player.FindClosest(this.position, this.width, this.height)].statLifeMax2) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 58); } if (this.type == 222) @@ -40773,37 +32125,85 @@ label_18: } else { - if (closestPlayer.RollLuck(7) == 0) + if (Main.rand.Next(7) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2108, pfix: -1); - int Type = Main.rand.Next(3); - switch (Type) + int Type3 = Main.rand.Next(3); + switch (Type3) { case 0: - Type = 1121; + Type3 = 1121; break; case 1: - Type = 1123; + Type3 = 1123; break; case 2: - Type = 2888; + Type3 = 2888; break; } - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, pfix: -1); - if (closestPlayer.RollLuck(3) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type3, pfix: -1); + if (Main.expertMode) + { + int Type4 = Main.rand.Next(3); + switch (Type4) + { + case 0: + Type4 = 1121; + break; + case 1: + Type4 = 1123; + break; + case 2: + Type4 = 2888; + break; + } + while (Type4 == Type3) + { + Type4 = Main.rand.Next(3); + switch (Type4) + { + case 0: + Type4 = 1121; + continue; + case 1: + Type4 = 1123; + continue; + case 2: + Type4 = 2888; + continue; + default: + continue; + } + } + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type4, pfix: -1); Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1132, pfix: -1); - if (closestPlayer.RollLuck(15) == 0) + } + else if (Main.rand.Next(3) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1132, pfix: -1); + if (Main.expertMode && Main.rand.Next(15) == 0 || Main.rand.Next(15) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1170); - if (closestPlayer.RollLuck(20) == 0) + if (Main.expertMode && Main.rand.Next(20) == 0 || Main.rand.Next(20) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2502); - if (Main.rand.Next(3) == 0) + if (Main.expertMode) + { + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1129); + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Main.rand.Next(842, 845)); + } + else if (Main.rand.Next(3) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1129); else if (Main.rand.Next(2) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Main.rand.Next(842, 845)); - if (Main.rand.Next(4) != 0) + if (Main.rand.Next(4) != 0 || Main.expertMode) + { Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1130, Main.rand.Next(10, 30)); - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2431, Main.rand.Next(16, 27)); + if (Main.expertMode) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1130, Main.rand.Next(10, 30)); + } + if (Main.expertMode) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2431, Main.rand.Next(44, 67)); + else + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2431, Main.rand.Next(16, 27)); } - NPC.SetEventFlagCleared(ref NPC.downedQueenBee, 8); + NPC.downedQueenBee = true; if (Main.netMode == 2) NetMessage.SendData(7); } @@ -40811,11 +32211,11 @@ label_18: { if (Main.expertMode) this.DropBossBags(); - else if (closestPlayer.RollLuck(7) == 0) + else if (Main.rand.Next(7) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1281, pfix: -1); - else if (closestPlayer.RollLuck(7) == 0) + else if (Main.rand.Next(7) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1273, pfix: -1); - else if (closestPlayer.RollLuck(7) == 0) + else if (Main.rand.Next(7) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1313, pfix: -1); } if (this.type == 113) @@ -40826,13 +32226,30 @@ label_18: } else { - if (closestPlayer.RollLuck(7) == 0) + if (Main.rand.Next(7) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2105, pfix: -1); Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 367, pfix: -1); - if (Main.rand.Next(2) == 0) + if (Main.expertMode) { int num4 = Main.rand.Next(4); Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, num4 != 3 ? 489 + num4 : 2998, pfix: -1); + switch (Main.rand.Next(3)) + { + case 0: + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 514, pfix: -1); + break; + case 1: + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 426, pfix: -1); + break; + case 2: + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 434, pfix: -1); + break; + } + } + else if (Main.rand.Next(2) == 0) + { + int num5 = Main.rand.Next(4); + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, num5 != 3 ? 489 + num5 : 2998, pfix: -1); } else { @@ -40850,41 +32267,41 @@ label_18: } } } - if (Main.netMode != 1 && !flag1) + if (Main.netMode != 1) { - int num5 = (int) ((double) this.position.X + (double) (this.width / 2)) / 16; - int num6 = (int) ((double) this.position.Y + (double) (this.height / 2)) / 16; - int num7 = this.width / 2 / 16 + 1; - for (int index1 = num5 - num7; index1 <= num5 + num7; ++index1) + int num6 = (int) ((double) this.position.X + (double) (this.width / 2)) / 16; + int num7 = (int) ((double) this.position.Y + (double) (this.height / 2)) / 16; + int num8 = this.width / 2 / 16 + 1; + for (int index8 = num6 - num8; index8 <= num6 + num8; ++index8) { - for (int index2 = num6 - num7; index2 <= num6 + num7; ++index2) + for (int index9 = num7 - num8; index9 <= num7 + num8; ++index9) { - if ((index1 == num5 - num7 || index1 == num5 + num7 || index2 == num6 - num7 || index2 == num6 + num7) && !Main.tile[index1, index2].active()) + if ((index8 == num6 - num8 || index8 == num6 + num8 || index9 == num7 - num8 || index9 == num7 + num8) && !Main.tile[index8, index9].active()) { - Main.tile[index1, index2].type = WorldGen.crimson ? (ushort) 347 : (ushort) 140; - Main.tile[index1, index2].active(true); + Main.tile[index8, index9].type = WorldGen.crimson ? (ushort) 347 : (ushort) 140; + Main.tile[index8, index9].active(true); } - Main.tile[index1, index2].lava(false); - Main.tile[index1, index2].liquid = (byte) 0; + Main.tile[index8, index9].lava(false); + Main.tile[index8, index9].liquid = (byte) 0; if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, index1, index2, 1); + NetMessage.SendTileSquare(-1, index8, index9, 1); else - WorldGen.SquareTileFrame(index1, index2); + WorldGen.SquareTileFrame(index8, index9); } } } } if (this.type == 439) { - NPC.SetEventFlagCleared(ref NPC.downedAncientCultist, 9); - if (closestPlayer.RollLuck(7) == 0) + NPC.downedAncientCultist = true; + if (Main.rand.Next(7) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3372, pfix: -1); Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3549, pfix: -1); WorldGen.TriggerLunarApocalypse(); } if (this.type == 398) { - NPC.SetEventFlagCleared(ref NPC.downedMoonlord, 10); + NPC.downedMoonlord = true; NPC.LunarApocalypseIsUp = false; if (Main.expertMode) { @@ -40892,13 +32309,11 @@ label_18: } else { - if (closestPlayer.RollLuck(7) == 0) + if (Main.rand.Next(7) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3373, pfix: -1); - if (closestPlayer.RollLuck(10) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4469, pfix: -1); Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3384, pfix: -1); Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3460, Main.rand.Next(70, 91), pfix: -1); - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Utils.SelectRandom(Main.rand, 3063, 3389, 3065, 1553, 3930, 3541, 3570, 3571, 3569), pfix: -1); + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Utils.SelectRandom(Main.rand, 3063, 3389, 3065, 1553, 3546, 3541, 3570, 3571, 3569), pfix: -1); } } switch (this.type) @@ -40940,10 +32355,10 @@ label_18: } break; case 422: - int num8 = Main.rand.Next(25, 41) / 2; + int num9 = Main.rand.Next(25, 41) / 2; if (Main.expertMode) - num8 = (int) ((double) num8 * 1.5); - for (int index = 0; index < num8; ++index) + num9 = (int) ((double) num9 * 1.5); + for (int index10 = 0; index10 < num9; ++index10) Item.NewItem((int) this.position.X + Main.rand.Next(this.width), (int) this.position.Y + Main.rand.Next(this.height), 2, 2, 3456, Main.rand.Next(1, 4)); NPC.downedTowerVortex = true; NPC.TowerActiveVortex = false; @@ -40961,10 +32376,10 @@ label_18: } break; case 493: - int num9 = Main.rand.Next(25, 41) / 2; + int num10 = Main.rand.Next(25, 41) / 2; if (Main.expertMode) - num9 = (int) ((double) num9 * 1.5); - for (int index = 0; index < num9; ++index) + num10 = (int) ((double) num10 * 1.5); + for (int index11 = 0; index11 < num10; ++index11) Item.NewItem((int) this.position.X + Main.rand.Next(this.width), (int) this.position.Y + Main.rand.Next(this.height), 2, 2, 3459, Main.rand.Next(1, 4)); NPC.downedTowerStardust = true; NPC.TowerActiveStardust = false; @@ -40972,10 +32387,10 @@ label_18: WorldGen.MessageLunarApocalypse(); break; case 507: - int num10 = Main.rand.Next(25, 41) / 2; + int num11 = Main.rand.Next(25, 41) / 2; if (Main.expertMode) - num10 = (int) ((double) num10 * 1.5); - for (int index = 0; index < num10; ++index) + num11 = (int) ((double) num11 * 1.5); + for (int index12 = 0; index12 < num11; ++index12) Item.NewItem((int) this.position.X + Main.rand.Next(this.width), (int) this.position.Y + Main.rand.Next(this.height), 2, 2, 3457, Main.rand.Next(1, 4)); NPC.downedTowerNebula = true; NPC.TowerActiveNebula = false; @@ -40983,10 +32398,10 @@ label_18: WorldGen.MessageLunarApocalypse(); break; case 517: - int num11 = Main.rand.Next(25, 41) / 2; + int num12 = Main.rand.Next(25, 41) / 2; if (Main.expertMode) - num11 = (int) ((double) num11 * 1.5); - for (int index = 0; index < num11; ++index) + num12 = (int) ((double) num12 * 1.5); + for (int index13 = 0; index13 < num12; ++index13) Item.NewItem((int) this.position.X + Main.rand.Next(this.width), (int) this.position.Y + Main.rand.Next(this.height), 2, 2, 3458, Main.rand.Next(1, 4)); NPC.downedTowerSolar = true; NPC.TowerActiveSolar = false; @@ -41004,7 +32419,7 @@ label_18: case 389: case 390: case 520: - if (closestPlayer.RollLuck(8) == 0) + if (Main.rand.Next(8) == 0) { Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2860, Main.rand.Next(8, 21)); break; @@ -41012,36 +32427,15 @@ label_18: break; } switch (this.type) - { - case 381: - case 382: - case 383: - case 385: - case 386: - case 389: - case 390: - case 520: - if (closestPlayer.RollLuck(600) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2798); - if (closestPlayer.RollLuck(600) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2800); - if (closestPlayer.RollLuck(600) == 0) - { - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2882); - break; - } - break; - } - switch (this.type) { case 383: case 386: case 389: - if (closestPlayer.RollLuck(200) == 0) + if (Main.rand.Next(200) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2806); - if (closestPlayer.RollLuck(200) == 0) + if (Main.rand.Next(200) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2807); - if (closestPlayer.RollLuck(200) == 0) + if (Main.rand.Next(200) == 0) { Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2808); break; @@ -41054,11 +32448,11 @@ label_18: case 382: case 385: case 390: - if (closestPlayer.RollLuck(200) == 0) + if (Main.rand.Next(200) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2803); - if (closestPlayer.RollLuck(200) == 0) + if (Main.rand.Next(200) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2804); - if (closestPlayer.RollLuck(200) == 0) + if (Main.rand.Next(200) == 0) { Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2805); break; @@ -41066,8 +32460,8 @@ label_18: break; } if (this.type == 395) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Utils.SelectRandom(Main.rand, 2797, 2749, 2795, 2796, 2880, 2769)); - if (this.type == 390 && closestPlayer.RollLuck(100) == 0) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Utils.SelectRandom(Main.rand, 2797, 2749, 2795, 2798, 2796, 2882, 2880, 2769, 2800)); + if (this.type == 390 && Main.rand.Next(100) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2771); if ((this.type == 116 || this.type == 117 || this.type == 118 || this.type == 119) && (!Main.expertMode || Main.rand.Next(5) == 0)) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 58); @@ -41075,27 +32469,21 @@ label_18: Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 58); if (this.type == 63 || this.type == 64 || this.type == 103) { - if (closestPlayer.RollLuck(100) == 0) + if (Main.rand.Next(100) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1303, pfix: -1); Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 282, Main.rand.Next(1, 5)); } - if (this.type == 63 && closestPlayer.RollLuck(50) == 0 && Main.IsItAHappyWindyDay) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4649); - if (this.type == 64 && closestPlayer.RollLuck(50) == 0 && Main.IsItAHappyWindyDay) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4650); if (this.type == 481 && Main.rand.Next(2) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3094, Main.rand.Next(40, 81)); - if (this.type == 481 && closestPlayer.RollLuck(20) == 0) + if (this.type == 481 && Main.rand.Next(20) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3187 + Main.rand.Next(3)); - if (this.type == 481 && closestPlayer.RollLuck(40) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4463); if (this.type == 21 || this.type == 44 || this.type == 167 || this.type == 201 || this.type == 202 || this.type == 481 || this.type == 203 || this.type == 322 || this.type == 323 || this.type == 324 || this.type >= 449 && this.type <= 452) { - if (closestPlayer.RollLuck(25) == 0) + if (Main.rand.Next(25) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 118); else if (this.type == 44) { - if (closestPlayer.RollLuck(20) == 0) + if (Main.rand.Next(20) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Main.rand.Next(410, 412)); else Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 166, Main.rand.Next(1, 4)); @@ -41116,9 +32504,9 @@ label_18: } else { - if (closestPlayer.RollLuck(4) == 0) + if (Main.rand.Next(4) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2430); - if (closestPlayer.RollLuck(7) == 0) + if (Main.rand.Next(7) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2493, pfix: -1); Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Main.rand.Next(256, 259)); Main.rand.Next(2); @@ -41128,21 +32516,21 @@ label_18: Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2610); Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 998); } - NPC.SetEventFlagCleared(ref NPC.downedSlimeKing, 11); + NPC.downedSlimeKing = true; if (Main.netMode == 2) NetMessage.SendData(7); } - if (this.type == 23 && closestPlayer.RollLuck(50) == 0) + if (this.type == 23 && Main.rand.Next(50) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 116); - if (this.type == 24 && closestPlayer.RollLuck(250) == 0) + if (this.type == 24 && Main.rand.Next(250) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 244); - if (this.type == 31 || this.type == 32 || this.type == 34 || this.type >= 294 && this.type <= 296) + if (this.type == 31 || this.type == 32 || this.type == 34) { - if (closestPlayer.RollLuck(250) == 0) + if (Main.rand.Next(250) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 932); - else if (closestPlayer.RollLuck(100) == 0) + else if (Main.rand.Next(100) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3095); - else if (closestPlayer.RollLuck(65) == 0) + else if (Main.rand.Next(65) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 327); else if (!Main.expertMode) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 154, Main.rand.Next(1, 4)); @@ -41151,32 +32539,23 @@ label_18: } if (this.type == 26 || this.type == 27 || this.type == 28 || this.type == 29 || this.type == 111) { - if (closestPlayer.RollLuck(200) == 0) + if (Main.rand.Next(200) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 160); else if (Main.rand.Next(2) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 161, Main.rand.Next(1, 6)); } - if (this.type == 175 && closestPlayer.RollLuck(100) == 0) + if (this.type == 175 && Main.rand.Next(100) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1265, pfix: -1); if ((this.type == 42 || this.type >= 231 && this.type <= 235) && (Main.expertMode || Main.rand.Next(3) != 0)) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 209); if (this.type == 204 && (Main.expertMode || Main.rand.Next(2) == 0)) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 209); - if (this.type == 43) - { - if (closestPlayer.RollLuck(25) == 0 && Main.IsItAHappyWindyDay) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4648); - else if (Main.expertMode || Main.rand.Next(2) == 0) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 210); - } - if (this.type == 39 && closestPlayer.RollLuck(25) == 0 && Main.IsItAHappyWindyDay) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4610); + if (this.type == 43 && (Main.expertMode || Main.rand.Next(2) == 0)) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 210); if (this.type == 65) { - if (closestPlayer.RollLuck(50) == 0) + if (Main.rand.Next(50) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 268); - else if (closestPlayer.RollLuck(25) == 0 && Main.IsItAHappyWindyDay) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4651); else Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 319); } @@ -41184,9 +32563,7 @@ label_18: Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 320); if (this.type == 541) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3783); - if ((this.type == 542 || this.type == 543 || this.type == 544 || this.type == 545) && closestPlayer.RollLuck(10) == 0 && Main.IsItAHappyWindyDay) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4669); - if (this.type == 542 && closestPlayer.RollLuck(8) == 0) + if (this.type == 542 && Main.rand.Next(8) == 0) { int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 319); Main.item[number].color = new Color(189, 148, 96, (int) byte.MaxValue); @@ -41194,9 +32571,9 @@ label_18: } if (this.type == 543 || this.type == 544) { - if (closestPlayer.RollLuck(25) == 0) + if (Main.rand.Next(25) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 527); - if (closestPlayer.RollLuck(8) == 0) + if (Main.rand.Next(8) == 0) { int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 319); Main.item[number].color = this.type != 544 ? new Color(112, 85, 89, (int) byte.MaxValue) : new Color(145, 27, 40, (int) byte.MaxValue); @@ -41205,9 +32582,9 @@ label_18: } if (this.type == 545) { - if (closestPlayer.RollLuck(25) == 0) + if (Main.rand.Next(25) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 528); - if (closestPlayer.RollLuck(8) == 0) + if (Main.rand.Next(8) == 0) { int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 319); Main.item[number].color = new Color(158, 113, 164, (int) byte.MaxValue); @@ -41227,7 +32604,7 @@ label_18: } else { - if (closestPlayer.RollLuck(7) == 0) + if (Main.rand.Next(7) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2106, pfix: -1); Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 549, Main.rand.Next(25, 41)); Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1225, Main.rand.Next(15, 31)); @@ -41246,7 +32623,7 @@ label_18: } else if (this.type == (int) sbyte.MaxValue) { - if (closestPlayer.RollLuck(7) == 0) + if (Main.rand.Next(7) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2107, pfix: -1); Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 547, Main.rand.Next(25, 41)); Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1225, Main.rand.Next(15, 31)); @@ -41266,24 +32643,39 @@ label_18: } else { - if (closestPlayer.RollLuck(7) == 0) + if (Main.rand.Next(7) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2109, pfix: -1); - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1141, pfix: -1); - if (closestPlayer.RollLuck(20) == 0) + if (Main.expertMode) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1141, Main.rand.Next(2, 4), pfix: -1); + else + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1141, pfix: -1); + if (Main.rand.Next(20) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1182, pfix: -1); - if (closestPlayer.RollLuck(50) == 0) + if (Main.rand.Next(50) == 0 || Main.expertMode && Main.rand.Next(50) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1305, pfix: -1); - if (closestPlayer.RollLuck(4) == 0) + if (Main.rand.Next(4) == 0 || Main.expertMode) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1157, pfix: -1); - if (closestPlayer.RollLuck(10) == 0) + if (Main.rand.Next(10) == 0) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3021, pfix: -1); - int num12 = 1; - for (int index = 0; index < num12; ++index) + int num13 = 1; + if (Main.expertMode) + num13 = 2; + int num14 = 0; + for (int index14 = 0; index14 < num13; ++index14) { - int num13 = Main.rand.Next(7); + int num15 = Main.rand.Next(7); if (!NPC.downedPlantBoss) - num13 = 0; - switch (num13) + num15 = 0; + if (index14 == 0) + { + num14 = num15; + } + else + { + while (num14 == num15) + num15 = Main.rand.Next(7); + } + switch (num15) { case 0: Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 758, pfix: -1); @@ -41310,9 +32702,9 @@ label_18: } } } - int num14 = NPC.downedPlantBoss ? 1 : 0; - NPC.SetEventFlagCleared(ref NPC.downedPlantBoss, 12); - if (num14 == 0) + int num16 = NPC.downedPlantBoss ? 1 : 0; + NPC.downedPlantBoss = true; + if (num16 == 0) { switch (Main.netMode) { @@ -41320,12 +32712,12 @@ label_18: Main.NewText(Lang.misc[33].Value, (byte) 50, B: (byte) 130); break; case 2: - ChatHelper.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[33].Key), new Color(50, (int) byte.MaxValue, 130)); + NetMessage.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[33].Key), new Color(50, (int) byte.MaxValue, 130)); break; } } } - if ((this.boss || this.type == 125 || this.type == 126 || this.type == 491 || this.type == 551 || this.type == 576 || this.type == 577 || this.type == 564 || this.type == 565) && closestPlayer.RollLuck(10) == 0) + if ((this.boss || this.type == 125 || this.type == 126 || this.type == 491 || this.type == 551 || this.type == 576 || this.type == 577 || this.type == 564 || this.type == 565) && Main.rand.Next(10) == 0) { if (this.type == 4) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 1360); @@ -41373,21 +32765,21 @@ label_18: if (this.boss) { if (this.type == 4) - NPC.SetEventFlagCleared(ref NPC.downedBoss1, 13); + NPC.downedBoss1 = true; else if (this.type == 13 || this.type == 14 || this.type == 15) - NPC.SetEventFlagCleared(ref NPC.downedBoss2, 14); + NPC.downedBoss2 = true; else if (this.type == 266) - NPC.SetEventFlagCleared(ref NPC.downedBoss2, 14); + NPC.downedBoss2 = true; else if (this.type == 35) - NPC.SetEventFlagCleared(ref NPC.downedBoss3, 15); + NPC.downedBoss3 = true; if (this.type == (int) sbyte.MaxValue) { - NPC.SetEventFlagCleared(ref NPC.downedMechBoss3, 18); + NPC.downedMechBoss3 = true; NPC.downedMechBossAny = true; } if (this.type == 134) { - NPC.SetEventFlagCleared(ref NPC.downedMechBoss1, 16); + NPC.downedMechBoss1 = true; NPC.downedMechBossAny = true; } string typeName = this.TypeName; @@ -41408,14 +32800,14 @@ label_18: else if (this.type == 439) Type = 499; else if (this.type == 398) - Type = 3544; + Type = 499; Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, Stack); - int num15 = Main.rand.Next(5) + 5; - for (int index = 0; index < num15; ++index) + int num17 = Main.rand.Next(5) + 5; + for (int index15 = 0; index15 < num17; ++index15) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 58); if (this.type == 125 || this.type == 126) { - NPC.SetEventFlagCleared(ref NPC.downedMechBoss2, 17); + NPC.downedMechBoss2 = true; NPC.downedMechBossAny = true; switch (Main.netMode) { @@ -41423,7 +32815,7 @@ label_18: Main.NewText(Language.GetTextValue("Announcement.HasBeenDefeated_Plural", (object) Language.GetTextValue("Enemies.TheTwins")), (byte) 175, (byte) 75); break; case 2: - ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasBeenDefeated_Plural", (object) NetworkText.FromKey("Enemies.TheTwins")), new Color(175, 75, (int) byte.MaxValue)); + NetMessage.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasBeenDefeated_Plural", (object) NetworkText.FromKey("Enemies.TheTwins")), new Color(175, 75, (int) byte.MaxValue)); break; } } @@ -41435,7 +32827,7 @@ label_18: Main.NewText(Language.GetTextValue("Announcement.HasBeenDefeated_Single", (object) Language.GetTextValue("Enemies.MoonLord")), (byte) 175, (byte) 75); break; case 2: - ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasBeenDefeated_Single", (object) NetworkText.FromKey("Enemies.MoonLord")), new Color(175, 75, (int) byte.MaxValue)); + NetMessage.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasBeenDefeated_Single", (object) NetworkText.FromKey("Enemies.MoonLord")), new Color(175, 75, (int) byte.MaxValue)); break; } } @@ -41447,33 +32839,26 @@ label_18: Main.NewText(Language.GetTextValue("Announcement.HasBeenDefeated_Single", (object) typeName), (byte) 175, (byte) 75); break; case 2: - ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasBeenDefeated_Single", (object) this.GetTypeNetName()), new Color(175, 75, (int) byte.MaxValue)); + NetMessage.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasBeenDefeated_Single", (object) this.GetTypeNetName()), new Color(175, 75, (int) byte.MaxValue)); break; } } if (this.type == 113 && Main.netMode != 1) { bool hardMode = Main.hardMode; - if (!flag1) - WorldGen.StartHardmode(); + WorldGen.StartHardmode(); if (NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3 && !hardMode) { - switch (Main.netMode) - { - case 0: - Main.NewText(Lang.misc[32].Value, (byte) 50, B: (byte) 130); - break; - case 2: - ChatHelper.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[32].Key), new Color(50, (int) byte.MaxValue, 130)); - break; - } + if (Main.netMode == 0) + Main.NewText(Lang.misc[32].Value, (byte) 50, B: (byte) 130); + else if (Main.netMode == 2) + NetMessage.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[32].Key), new Color(50, (int) byte.MaxValue, 130)); } - NPC.SetEventFlagCleared(ref hardMode, 19); } if (Main.netMode == 2) NetMessage.SendData(7); } - if (!flag2 && NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3 && Main.hardMode) + if (!flag1 && NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3 && Main.hardMode) { switch (Main.netMode) { @@ -41481,1003 +32866,84 @@ label_18: Main.NewText(Lang.misc[32].Value, (byte) 50, B: (byte) 130); break; case 2: - ChatHelper.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[32].Key), new Color(50, (int) byte.MaxValue, 130)); + NetMessage.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[32].Key), new Color(50, (int) byte.MaxValue, 130)); break; } } - this.NPCLoot_DropCommonLifeAndMana(closestPlayer); - this.NPCLoot_DropMoney(closestPlayer); - } - - public void NPCLoot() - { - if (Main.netMode == 1 || this.type >= 663) - return; - Player closestPlayer = Main.player[(int) Player.FindClosest(this.position, this.width, this.height)]; - if (true) + if (this.type != 16 && this.type != 81 && this.type != 121 && Main.rand.Next(6) == 0 && this.lifeMax > 1 && this.damage > 0) { - this.CountKillForAchievements(); - if (this.GetWereThereAnyInteractions()) - { - if (this.IsNPCValidForBestiaryKillCredit()) - Main.BestiaryTracker.Kills.RegisterKill(this); - this.CountKillForBannersAndDropThem(); - } - } - if (this.type == 23 && Main.hardMode || this.SpawnedFromStatue && NPCID.Sets.NoEarlymodeLootWhenSpawnedFromStatue[this.type] && !Main.hardMode || this.SpawnedFromStatue && (double) NPCID.Sets.StatueSpawnedDropRarity[this.type] != -1.0 && ((double) Main.rand.NextFloat() >= (double) NPCID.Sets.StatueSpawnedDropRarity[this.type] || !this.AnyInteractions())) - return; - int num = !NPC.downedMechBoss1 || !NPC.downedMechBoss2 ? 0 : (NPC.downedMechBoss3 ? 1 : 0); - this.DoDeathEvents_BeforeLoot(closestPlayer); - this.NPCLoot_DropItems(closestPlayer); - this.DoDeathEvents(closestPlayer); - if (num == 0 && NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3 && Main.hardMode) - { - switch (Main.netMode) - { - case 0: - Main.NewText(Lang.misc[32].Value, (byte) 50, B: (byte) 130); - break; - case 2: - ChatHelper.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[32].Key), new Color(50, (int) byte.MaxValue, 130)); - break; - } - } - this.NPCLoot_DropMoney(closestPlayer); - this.NPCLoot_DropHeals(closestPlayer); - } - - private bool IsNPCValidForBestiaryKillCredit() - { - switch (this.type) - { - case 13: - case 14: - case 15: - return this.boss; - default: - return true; - } - } - - private void DoDeathEvents_BeforeLoot(Player closestPlayer) - { - switch (this.type) - { - case 125: - case 126: - if (!NPC.AnyNPCs(this.type == 125 ? 126 : 125)) - break; - this.value = 0.0f; - this.boss = false; - break; - } - } - - private void NPCLoot_DropItems(Player closestPlayer) - { - DropAttemptInfo info = new DropAttemptInfo() - { - player = closestPlayer, - npc = this, - IsExpertMode = Main.expertMode, - IsMasterMode = Main.masterMode, - IsInSimulation = false, - rng = Main.rand - }; - Main.ItemDropSolver.TryDropping(info); - } - - public static void ResetBadgerHatTime() - { - NPC.EoCKilledToday = false; - NPC.WoFKilledToday = false; - } - - private void DoDeathEvents_DropBossPotionsAndHearts() - { - int Stack = Main.rand.Next(5, 16); - int Type = 28; - if (this.type == 113) - Type = 188; - else if (this.type == 222) - Type = 1134; - else if (this.type == 657) - Type = 499; - else if (this.type > 113 && this.type < 222) - Type = 499; - else if (this.type == 636) - Type = 499; - else if (this.type == 245 || this.type == 262) - Type = 499; - else if (this.type == 370) - Type = 499; - else if (this.type == 395) - Type = 499; - else if (this.type == 439) - Type = 499; - else if (this.type == 398) - Type = 3544; - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, Stack); - int num = Main.rand.Next(5) + 5; - for (int index = 0; index < num; ++index) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 58); - if (this.type == 4) - NPC.EoCKilledToday = true; - else if (this.type == 113) - NPC.WoFKilledToday = true; - if (!NPC.EoCKilledToday || !NPC.WoFKilledToday) - return; - NPC.ResetBadgerHatTime(); - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 5004); - } - - private void DoDeathEvents_CelebrateBossDeath() - { - if (this.type == 125 || this.type == 126) - { - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue("Announcement.HasBeenDefeated_Plural", (object) Language.GetTextValue("Enemies.TheTwins")), (byte) 175, (byte) 75); - } - else - { - if (Main.netMode != 2) - return; - ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasBeenDefeated_Plural", (object) NetworkText.FromKey("Enemies.TheTwins")), new Color(175, 75, (int) byte.MaxValue)); - } - } - else if (this.type == 398) - { - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue("Announcement.HasBeenDefeated_Single", (object) Language.GetTextValue("Enemies.MoonLord")), (byte) 175, (byte) 75); - } - else - { - if (Main.netMode != 2) - return; - ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasBeenDefeated_Single", (object) NetworkText.FromKey("Enemies.MoonLord")), new Color(175, 75, (int) byte.MaxValue)); - } - } - else if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue("Announcement.HasBeenDefeated_Single", (object) this.TypeName), (byte) 175, (byte) 75); - } - else - { - if (Main.netMode != 2) - return; - ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasBeenDefeated_Single", (object) this.GetTypeNetName()), new Color(175, 75, (int) byte.MaxValue)); - } - } - - private void CreateBrickBoxForWallOfFlesh() - { - int num1 = (int) ((double) this.position.X + (double) (this.width / 2)) / 16; - int num2 = (int) ((double) this.position.Y + (double) (this.height / 2)) / 16; - int num3 = this.width / 2 / 16 + 1; - for (int index1 = num1 - num3; index1 <= num1 + num3; ++index1) - { - for (int index2 = num2 - num3; index2 <= num2 + num3; ++index2) - { - if ((index1 == num1 - num3 || index1 == num1 + num3 || index2 == num2 - num3 || index2 == num2 + num3) && !Main.tile[index1, index2].active()) - { - Main.tile[index1, index2].type = WorldGen.crimson ? (ushort) 347 : (ushort) 140; - Main.tile[index1, index2].active(true); - } - Main.tile[index1, index2].lava(false); - Main.tile[index1, index2].liquid = (byte) 0; - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, index1, index2, 1); - else - WorldGen.SquareTileFrame(index1, index2); - } - } - } - - private void DoDeathEvents_SummonDungeonSpirit(Player closestPlayer) - { - if (this.lifeMax <= 100 || this.type == 288 || (double) this.value <= 0.0 || !this.HasPlayerTarget || !Main.hardMode || !NPC.downedPlantBoss || !Main.player[this.target].ZoneDungeon) - return; - int range = 13; - if (Main.expertMode) - range = 9; - if (closestPlayer.RollLuck(range) != 0 || !Main.wallDungeon[(int) Main.tile[(int) this.Center.X / 16, (int) this.Center.Y / 16].wall]) - return; - NPC.NewNPC((int) this.Center.X, (int) this.Center.Y, 288); - } - - private void DoDeathEvents_AdvanceSlimeRain(Player closestPlayer) - { - if (!Main.slimeRain || !Main.slimeRainNPC[this.type] || NPC.AnyNPCs(50)) - return; - int num = 150; - if (NPC.downedSlimeKing) - num /= 2; - ++Main.slimeRainKillCount; - if (Main.slimeRainKillCount < num) - return; - NPC.SpawnOnPlayer(closestPlayer.whoAmI, 50); - Main.slimeRainKillCount = -num / 2; - } - - private void NPCLoot_DropHeals(Player closestPlayer) - { - this.NPCLoot_DropCommonLifeAndMana(closestPlayer); - switch (this.type) - { - case 13: - case 14: - case 15: - if (Main.rand.Next(4) != 0 || closestPlayer.statLife >= closestPlayer.statLifeMax2) - break; - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 58); - break; - case 116: - case 117: - case 118: - case 119: - if (Main.expertMode && Main.rand.Next(5) != 0) - break; - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 58); - break; - case 139: - if (Main.rand.Next(2) != 0) - break; - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 58); - break; - case 267: - if (Main.rand.Next(2) != 0 || closestPlayer.statLife >= closestPlayer.statLifeMax2) - break; - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 58); - break; - case 305: - case 306: - case 307: - case 308: - case 309: - case 310: - case 311: - case 312: - case 313: - case 314: - case 329: - case 330: - if (closestPlayer.RollLuck(4) != 0) - break; - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 58); - break; - case 315: - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 58); - break; - case 325: - case 327: - case 344: - case 345: - case 346: - int num1 = Main.rand.Next(6) + 6; - for (int index = 0; index < num1; ++index) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 58); - break; - case 326: - if (closestPlayer.RollLuck(6) != 0) - break; - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 58); - break; - case 338: - case 339: - case 340: - if (closestPlayer.RollLuck(5) != 0) - break; - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 58); - break; - case 341: - int num2 = Main.rand.Next(5, 11); - for (int index = 0; index < num2; ++index) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 58); - break; - case 342: - if (Main.rand.Next(3) == 0) - break; - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 58); - break; - } - } - - private void DoDeathEvents(Player closestPlayer) - { - this.DoDeathEvents_AdvanceSlimeRain(closestPlayer); - this.DoDeathEvents_SummonDungeonSpirit(closestPlayer); - switch (this.type) - { - case 4: - NPC.SetEventFlagCleared(ref NPC.downedBoss1, 13); - break; - case 13: - case 14: - case 15: - case 266: - if (this.boss) - { - if (!NPC.downedBoss2 || Main.rand.Next(2) == 0) - WorldGen.spawnMeteor = true; - NPC.SetEventFlagCleared(ref NPC.downedBoss2, 14); - break; - } - break; - case 22: - if (Collision.LavaCollision(this.position, this.width, this.height)) - { - NPC.SpawnWOF(this.position); - break; - } - break; - case 35: - if (this.boss) - { - NPC.SetEventFlagCleared(ref NPC.downedBoss3, 15); - break; - } - break; - case 50: - if (Main.slimeRain) - { - Main.StopSlimeRain(); - AchievementsHelper.NotifyProgressionEvent(16); - } - NPC.SetEventFlagCleared(ref NPC.downedSlimeKing, 11); - if (Main.netMode == 2) - { - NetMessage.SendData(7); - break; - } - break; - case 109: - if (!NPC.downedClown) - { - NPC.downedClown = true; - if (Main.netMode == 2) - { - NetMessage.SendData(7); - break; - } - break; - } - break; - case 113: - if (Main.netMode != 1) - { - this.CreateBrickBoxForWallOfFlesh(); - bool hardMode = Main.hardMode; - WorldGen.StartHardmode(); - if (NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3 && !hardMode) - { - switch (Main.netMode) - { - case 0: - Main.NewText(Lang.misc[32].Value, (byte) 50, B: (byte) 130); - break; - case 2: - ChatHelper.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[32].Key), new Color(50, (int) byte.MaxValue, 130)); - break; - } - } - NPC.SetEventFlagCleared(ref hardMode, 19); - break; - } - break; - case 125: - case 126: - if (this.boss) - { - NPC.SetEventFlagCleared(ref NPC.downedMechBoss2, 17); - NPC.downedMechBossAny = true; - break; - } - break; - case (int) sbyte.MaxValue: - if (this.boss) - { - NPC.SetEventFlagCleared(ref NPC.downedMechBoss3, 18); - NPC.downedMechBossAny = true; - break; - } - break; - case 134: - if (this.boss) - { - NPC.SetEventFlagCleared(ref NPC.downedMechBoss1, 16); - NPC.downedMechBossAny = true; - break; - } - break; - case 216: - NPC.SpawnBoss((int) this.position.X, (int) this.position.Y, 662, this.target); - break; - case 222: - NPC.SetEventFlagCleared(ref NPC.downedQueenBee, 8); - if (Main.netMode == 2) - { - NetMessage.SendData(7); - break; - } - break; - case 245: - NPC.SetEventFlagCleared(ref NPC.downedGolemBoss, 6); - break; - case 262: - int num = NPC.downedPlantBoss ? 1 : 0; - NPC.SetEventFlagCleared(ref NPC.downedPlantBoss, 12); - if (num == 0) - { - switch (Main.netMode) - { - case 0: - Main.NewText(Lang.misc[33].Value, (byte) 50, B: (byte) 130); - break; - case 2: - ChatHelper.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[33].Key), new Color(50, (int) byte.MaxValue, 130)); - break; - } - } - else - break; - break; - case 325: - if (Main.pumpkinMoon) - { - NPC.SetEventFlagCleared(ref NPC.downedHalloweenTree, 4); - break; - } - break; - case 327: - if (Main.pumpkinMoon) - { - NPC.SetEventFlagCleared(ref NPC.downedHalloweenKing, 5); - break; - } - break; - case 344: - if (Main.snowMoon) - { - NPC.SetEventFlagCleared(ref NPC.downedChristmasTree, 21); - break; - } - break; - case 345: - if (Main.snowMoon) - { - NPC.SetEventFlagCleared(ref NPC.downedChristmasIceQueen, 20); - break; - } - break; - case 346: - if (Main.snowMoon) - { - NPC.SetEventFlagCleared(ref NPC.downedChristmasSantank, 22); - break; - } - break; - case 370: - NPC.SetEventFlagCleared(ref NPC.downedFishron, 7); - break; - case 398: - NPC.SetEventFlagCleared(ref NPC.downedMoonlord, 10); - NPC.LunarApocalypseIsUp = false; - break; - case 402: - case 405: - case 407: - case 409: - case 411: - if (NPC.ShieldStrengthTowerStardust > 0) - { - Projectile.NewProjectile(this.Center.X, this.Center.Y, 0.0f, 0.0f, 629, 0, 0.0f, Main.myPlayer, (float) NPC.FindFirstNPC(493)); - break; - } - break; - case 412: - case 413: - case 414: - case 415: - case 416: - case 417: - case 418: - case 419: - case 518: - if (NPC.ShieldStrengthTowerSolar > 0) - { - Projectile.NewProjectile(this.Center.X, this.Center.Y, 0.0f, 0.0f, 629, 0, 0.0f, Main.myPlayer, (float) NPC.FindFirstNPC(517)); - break; - } - break; - case 420: - case 421: - case 423: - case 424: - if (NPC.ShieldStrengthTowerNebula > 0) - { - Projectile.NewProjectile(this.Center.X, this.Center.Y, 0.0f, 0.0f, 629, 0, 0.0f, Main.myPlayer, (float) NPC.FindFirstNPC(507)); - break; - } - break; - case 422: - NPC.downedTowerVortex = true; - NPC.TowerActiveVortex = false; - WorldGen.UpdateLunarApocalypse(); - WorldGen.MessageLunarApocalypse(); - break; - case 425: - case 426: - case 427: - case 429: - if (NPC.ShieldStrengthTowerVortex > 0) - { - Projectile.NewProjectile(this.Center.X, this.Center.Y, 0.0f, 0.0f, 629, 0, 0.0f, Main.myPlayer, (float) NPC.FindFirstNPC(422)); - break; - } - break; - case 439: - NPC.SetEventFlagCleared(ref NPC.downedAncientCultist, 9); - WorldGen.TriggerLunarApocalypse(); - break; - case 493: - NPC.downedTowerStardust = true; - NPC.TowerActiveStardust = false; - WorldGen.UpdateLunarApocalypse(); - WorldGen.MessageLunarApocalypse(); - break; - case 507: - NPC.downedTowerNebula = true; - NPC.TowerActiveNebula = false; - WorldGen.UpdateLunarApocalypse(); - WorldGen.MessageLunarApocalypse(); - break; - case 517: - NPC.downedTowerSolar = true; - NPC.TowerActiveSolar = false; - WorldGen.UpdateLunarApocalypse(); - WorldGen.MessageLunarApocalypse(); - break; - case 552: - case 553: - case 554: - if (DD2Event.Ongoing) - { - DD2Event.AnnounceGoblinDeath(this); - if (DD2Event.ShouldDropCrystals()) - { - Item.NewItem(this.position, this.Size, 3822); - break; - } - break; - } - break; - case 555: - case 556: - case 557: - case 558: - case 559: - case 560: - case 561: - case 562: - case 563: - case 564: - case 565: - case 568: - case 569: - case 570: - case 571: - case 572: - case 573: - case 574: - case 575: - case 576: - case 577: - case 578: - if (DD2Event.ShouldDropCrystals()) - { - Item.NewItem(this.position, this.Size, 3822); - break; - } - break; - case 614: - int Damage = 175; - if (this.SpawnedFromStatue) - Damage = 0; - Projectile.NewProjectile(this.Center.X, this.Center.Y, 0.0f, 0.0f, 281, Damage, 0.0f, Main.myPlayer, -2f, (float) ((int) this.releaseOwner + 1)); - break; - case 636: - NPC.SetEventFlagCleared(ref NPC.downedEmpressOfLight, 23); - break; - case 657: - NPC.SetEventFlagCleared(ref NPC.downedQueenSlime, 24); - break; - case 661: - if (Main.netMode != 1 && this.GetWereThereAnyInteractions()) - { - int Type = 636; - if (!NPC.AnyNPCs(Type)) - { - Vector2 vector2 = this.Center + new Vector2(0.0f, -200f) + Main.rand.NextVector2Circular(50f, 50f); - NPC.SpawnBoss((int) vector2.X, (int) vector2.Y, Type, closestPlayer.whoAmI); - break; - } - break; - } - break; - } - if (!this.boss) - return; - this.DoDeathEvents_DropBossPotionsAndHearts(); - this.DoDeathEvents_CelebrateBossDeath(); - if (Main.netMode != 2) - return; - NetMessage.SendData(7); - } - - private void NPCLoot_DropCommonLifeAndMana(Player closestPlayer) - { - if (this.type != 16 && this.type != 81 && this.type != 121 && closestPlayer.RollLuck(6) == 0 && this.lifeMax > 1 && this.damage > 0) - { - if (Main.rand.Next(2) == 0 && closestPlayer.statMana < closestPlayer.statManaMax2) + int closest = (int) Player.FindClosest(this.position, this.width, this.height); + if (Main.rand.Next(2) == 0 && Main.player[closest].statMana < Main.player[closest].statManaMax2) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 184); - else if (Main.rand.Next(2) == 0 && closestPlayer.statLife < closestPlayer.statLifeMax2) + else if (Main.rand.Next(2) == 0 && Main.player[closest].statLife < Main.player[closest].statLifeMax2) Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 58); } - if (this.type == 16 || this.type == 81 || this.type == 121 || closestPlayer.RollLuck(2) != 0 || this.lifeMax <= 1 || this.damage <= 0 || closestPlayer.statMana >= closestPlayer.statManaMax2) - return; - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 184); - } - - private void NPCLoot_DropMoney(Player closestPlayer) - { - float num1 = 0.0f; - float luck = closestPlayer.luck; - int num2 = 1; - if ((double) Main.rand.NextFloat() < (double) Math.Abs(luck)) - num2 = 2; - for (int index = 0; index < num2; ++index) + if (this.type != 16 && this.type != 81 && this.type != 121 && Main.rand.Next(2) == 0 && this.lifeMax > 1 && this.damage > 0) { - float num3 = this.value; - if (this.midas) - num3 *= (float) (1.0 + (double) Main.rand.Next(10, 51) * 0.00999999977648258); - float num4 = num3 * (float) (1.0 + (double) Main.rand.Next(-20, 76) * 0.00999999977648258); - if (Main.rand.Next(2) == 0) - num4 *= (float) (1.0 + (double) Main.rand.Next(5, 11) * 0.00999999977648258); - if (Main.rand.Next(4) == 0) - num4 *= (float) (1.0 + (double) Main.rand.Next(10, 21) * 0.00999999977648258); - if (Main.rand.Next(8) == 0) - num4 *= (float) (1.0 + (double) Main.rand.Next(15, 31) * 0.00999999977648258); - if (Main.rand.Next(16) == 0) - num4 *= (float) (1.0 + (double) Main.rand.Next(20, 41) * 0.00999999977648258); - if (Main.rand.Next(32) == 0) - num4 *= (float) (1.0 + (double) Main.rand.Next(25, 51) * 0.00999999977648258); - if (Main.rand.Next(64) == 0) - num4 *= (float) (1.0 + (double) Main.rand.Next(50, 101) * 0.00999999977648258); - if (Main.bloodMoon) - num4 *= (float) (1.0 + (double) Main.rand.Next(101) * 0.00999999977648258); - if (index == 0) - num1 = num4; - else if ((double) luck < 0.0) - { - if ((double) num4 < (double) num1) - num1 = num4; - } - else if ((double) num4 > (double) num1) - num1 = num4; + int closest = (int) Player.FindClosest(this.position, this.width, this.height); + if (Main.player[closest].statMana < Main.player[closest].statManaMax2) + Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 184); } - float num5 = num1 + (float) this.extraValue; - while ((int) num5 > 0) + float num18 = this.value; + if (this.midas) + num18 *= (float) (1.0 + (double) Main.rand.Next(10, 50) * 0.00999999977648258); + float num19 = num18 * (float) (1.0 + (double) Main.rand.Next(-20, 21) * 0.00999999977648258); + if (Main.rand.Next(5) == 0) + num19 *= (float) (1.0 + (double) Main.rand.Next(5, 11) * 0.00999999977648258); + if (Main.rand.Next(10) == 0) + num19 *= (float) (1.0 + (double) Main.rand.Next(10, 21) * 0.00999999977648258); + if (Main.rand.Next(15) == 0) + num19 *= (float) (1.0 + (double) Main.rand.Next(15, 31) * 0.00999999977648258); + if (Main.rand.Next(20) == 0) + num19 *= (float) (1.0 + (double) Main.rand.Next(20, 41) * 0.00999999977648258); + float num20 = num19 + this.extraValue; + while ((int) num20 > 0) { - if ((double) num5 > 1000000.0) + if ((double) num20 > 1000000.0) { - int num6 = (int) ((double) num5 / 1000000.0); - if (num6 > 50 && Main.rand.Next(5) == 0) - num6 /= Main.rand.Next(3) + 1; + int Stack = (int) ((double) num20 / 1000000.0); + if (Stack > 50 && Main.rand.Next(5) == 0) + Stack /= Main.rand.Next(3) + 1; if (Main.rand.Next(5) == 0) - num6 /= Main.rand.Next(3) + 1; - int Stack = num6; - while (Stack > 999) - { - Stack -= 999; - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 74, 999); - } - num5 -= (float) (1000000 * num6); + Stack /= Main.rand.Next(3) + 1; + num20 -= (float) (1000000 * Stack); Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 74, Stack); } - else if ((double) num5 > 10000.0) + else if ((double) num20 > 10000.0) { - int Stack = (int) ((double) num5 / 10000.0); + int Stack = (int) ((double) num20 / 10000.0); if (Stack > 50 && Main.rand.Next(5) == 0) Stack /= Main.rand.Next(3) + 1; if (Main.rand.Next(5) == 0) Stack /= Main.rand.Next(3) + 1; - num5 -= (float) (10000 * Stack); + num20 -= (float) (10000 * Stack); Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 73, Stack); } - else if ((double) num5 > 100.0) + else if ((double) num20 > 100.0) { - int Stack = (int) ((double) num5 / 100.0); + int Stack = (int) ((double) num20 / 100.0); if (Stack > 50 && Main.rand.Next(5) == 0) Stack /= Main.rand.Next(3) + 1; if (Main.rand.Next(5) == 0) Stack /= Main.rand.Next(3) + 1; - num5 -= (float) (100 * Stack); + num20 -= (float) (100 * Stack); Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 72, Stack); } else { - int Stack = (int) num5; + int Stack = (int) num20; if (Stack > 50 && Main.rand.Next(5) == 0) Stack /= Main.rand.Next(3) + 1; if (Main.rand.Next(5) == 0) Stack /= Main.rand.Next(4) + 1; if (Stack < 1) Stack = 1; - num5 -= (float) Stack; + num20 -= (float) Stack; Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 71, Stack); } } } - public static int GetStackForSlimeItemDrop(int item) - { - int num = 1; - switch (item) - { - case 8: - num = Main.rand.Next(5, 11); - break; - case 166: - num = Main.rand.Next(2, 7); - break; - case 965: - num = Main.rand.Next(20, 46); - break; - default: - if (item >= 11 && item <= 14 || item >= 699 && item <= 702) - { - num = Main.rand.Next(3, 9); - if (Main.rand.Next(2) == 0) - { - num += 5; - break; - } - break; - } - switch (item) - { - case 71: - num = Main.rand.Next(50, 100); - break; - case 72: - num = Main.rand.Next(20, 100); - break; - case 73: - num = Main.rand.Next(1, 3); - break; - } - break; - } - return num; - } - - public bool ExcludedFromDeathTally() - { - if (this.netID >= 0) - return NPCID.Sets.PositiveNPCTypesExcludedFromDeathTally[this.netID]; - return this.netID == -5 || this.netID == -1; - } - - private void CountKillForBannersAndDropThem() - { - int index1 = Item.NPCtoBanner(this.BannerID()); - if (index1 <= 0 || this.ExcludedFromDeathTally()) - return; - ++NPC.killCount[index1]; - if (Main.netMode == 2) - NetMessage.SendData(83, number: index1); - int num = ItemID.Sets.KillsToBanner[Item.BannerToItem(index1)]; - if (NPC.killCount[index1] % num != 0 || index1 <= 0) - return; - int npc = Item.BannerToNPC(index1); - int index2 = this.lastInteraction; - if (!Main.player[index2].active || Main.player[index2].dead) - index2 = this.FindClosestPlayer(); - NetworkText text = NetworkText.FromKey("Game.EnemiesDefeatedAnnouncement", (object) NPC.killCount[index1], (object) NetworkText.FromKey(Lang.GetNPCName(npc).Key)); - if (index2 >= 0 && index2 < (int) byte.MaxValue) - text = NetworkText.FromKey("Game.EnemiesDefeatedByAnnouncement", (object) Main.player[index2].name, (object) NPC.killCount[index1], (object) NetworkText.FromKey(Lang.GetNPCName(npc).Key)); - switch (Main.netMode) - { - case 0: - Main.NewText(text.ToString(), (byte) 250, (byte) 250, (byte) 0); - break; - case 2: - ChatHelper.BroadcastChatMessage(text, new Color(250, 250, 0)); - break; - } - int Type = Item.BannerToItem(index1); - Vector2 position = this.position; - if (index2 >= 0 && index2 < (int) byte.MaxValue) - position = Main.player[index2].position; - Item.NewItem((int) position.X, (int) position.Y, this.width, this.height, Type); - } - - private bool GetWereThereAnyInteractions() => this.realLife < 0 ? this.AnyInteractions() : Main.npc[this.realLife].AnyInteractions(); - - private void CountKillForAchievements() - { - switch (this.type) - { - case 13: - case 14: - case 15: - if (!this.boss) - break; - AchievementsHelper.NotifyNPCKilled(this); - break; - case 125: - case 126: - if (NPC.AnyNPCs(this.type == 126 ? 125 : 126)) - break; - AchievementsHelper.NotifyNPCKilled(this); - AchievementsHelper.CheckMechaMayhem(this.type); - break; - case (int) sbyte.MaxValue: - case 134: - AchievementsHelper.CheckMechaMayhem(this.type); - AchievementsHelper.NotifyNPCKilled(this); - break; - default: - AchievementsHelper.NotifyNPCKilled(this); - break; - } - } - - private void NPCLoot_DropFood(Player closestPlayer) - { - int Type = 0; - int range = 0; - switch (this.type) - { - case 6: - case 173: - Type = 4015; - range = 100; - break; - case 34: - Type = 4018; - range = 100; - break; - case 39: - case 156: - Type = 4025; - range = 30; - break; - case 44: - Type = 4037; - range = 10; - break; - case 48: - Type = 4016; - range = 50; - break; - case 65: - case 67: - Type = 4035; - range = 50; - break; - case 69: - case 508: - case 509: - case 580: - case 581: - Type = 4012; - range = 15; - break; - case 120: - case 137: - case 138: - Type = 4011; - range = 150; - break; - case 122: - Type = 4017; - range = 75; - break; - case 150: - case 184: - Type = 4026; - range = 150; - break; - case 152: - case 177: - Type = 4023; - range = 15; - break; - case 154: - case 206: - Type = 4027; - range = 75; - break; - case 163: - case 164: - case 165: - case 238: - case 530: - case 531: - Type = 4020; - range = 30; - break; - case 170: - case 171: - case 180: - Type = 3532; - range = 15; - break; - case 224: - Type = 4021; - range = 50; - break; - case 289: - Type = 4018; - range = 50; - break; - case 290: - Type = 4013; - range = 21; - break; - case 291: - case 292: - case 293: - Type = 4013; - range = 7; - break; - case 469: - Type = 4037; - range = 100; - break; - case 480: - case 481: - Type = 4029; - range = 50; - break; - case 482: - case 483: - Type = 4036; - range = 50; - break; - case 494: - case 495: - case 496: - case 497: - case 498: - case 499: - case 500: - case 501: - case 502: - case 503: - case 504: - case 505: - case 506: - Type = 4030; - range = 75; - break; - case 542: - case 543: - case 544: - case 545: - case 546: - Type = 4028; - range = 30; - break; - } - if (this.SpawnedFromStatue || Type == 0 || range == 0 || closestPlayer.RollLuck(range) != 0) - return; - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type); - } - public static void CatchNPC(int i, int who = -1) { if (!Main.npc[i].active) @@ -42563,10 +33029,10 @@ label_18: break; case 2: int number = Item.NewItem((int) Position.X, (int) Position.Y, (int) HitboxSize.X, (int) HitboxSize.Y, itemType, itemStack, true); - Main.timeItemSlotCannotBeReusedFor[number] = 54000; + Main.itemLockoutTime[number] = 54000; for (int remoteClient = 0; remoteClient < (int) byte.MaxValue; ++remoteClient) { - if (Main.player[remoteClient].active && (this.playerInteraction[remoteClient] || !interactionRequired)) + if ((this.playerInteraction[remoteClient] || !interactionRequired) && Main.player[remoteClient].active) NetMessage.SendData(90, remoteClient, number: number); } Main.item[number].active = false; @@ -42684,51 +33150,20 @@ label_18: } else { - if (Type < 0 || Type >= 663 || !Main.npcCatchable[Type] || !NPC.CanReleaseNPCs(who)) + if (Type < 0 || Type >= 580 || !Main.npcCatchable[Type] || !NPC.CanReleaseNPCs(who)) return; - switch (Type) + if (Type == 148) { - case 148: - int Type1 = Type + Main.rand.Next(2); - int index1 = NPC.NewNPC(x, y, Type1); - Main.npc[index1].releaseOwner = (short) who; - break; - case 356: - int index2 = NPC.NewNPC(x, y, Type); - Main.npc[index2].ai[2] = (float) Style; - Main.npc[index2].releaseOwner = (short) who; - break; - case 583: - case 584: - case 585: - int index3 = NPC.NewNPC(x, y, Type); - Main.npc[index3].releaseOwner = (short) who; - Main.npc[index3].ai[2] = 2f; - Main.npc[index3].TargetClosest(); - Main.npc[index3].ai[3] = 0.0f; - Main.npc[index3].netUpdate = true; - break; - case 614: - int index4 = NPC.NewNPC(x, y, Type); - Main.npc[index4].releaseOwner = (short) who; - int num = Main.player[who].direction; - if (Style > 2) - { - Style -= 2; - Main.npc[index4].SpawnedFromStatue = true; - } - if (Style == 1) - num = 1; - if (Style == 2) - num = -1; - Main.npc[index4].direction = num; - Main.npc[index4].spriteDirection = num; - Main.npc[index4].netUpdate = true; - break; - default: - int index5 = NPC.NewNPC(x, y, Type); - Main.npc[index5].releaseOwner = (short) who; - break; + int Type1 = Type + Main.rand.Next(2); + int index = NPC.NewNPC(x, y, Type1); + Main.npc[index].releaseOwner = (short) who; + } + else + { + int index = NPC.NewNPC(x, y, Type); + if (Type == 356) + Main.npc[index].ai[2] = (float) Style; + Main.npc[index].releaseOwner = (short) who; } } } @@ -42739,9 +33174,9 @@ label_18: int checkScreenWidth = Main.LogicCheckScreenWidth; float num1 = 15f; Player player = Main.player[plr]; - if ((double) player.position.Y > Main.worldSurface * 16.0 + (double) (checkScreenHeight / 2) || (double) player.nearbyActiveNPCs > (double) num1) + if ((double) player.position.Y > Main.worldSurface * 16.0 + (double) (checkScreenHeight / 2) || (double) player.activeNPCs > (double) num1) return; - int maxValue1 = 45 + (int) (450.0 * (double) (player.nearbyActiveNPCs / num1)); + int maxValue1 = 45 + (int) (450.0 * (double) (player.activeNPCs / num1)); if (Main.expertMode) maxValue1 = (int) ((double) maxValue1 * 0.85); if (Main.rand.Next(maxValue1) != 0) @@ -42818,21 +33253,6 @@ label_18: return num >= 40; } - public static bool Spawning_FlyingAntlionCheck(int x, int y) - { - if (!WorldGen.InWorld(x, y, 10)) - return false; - for (int index = 0; index < 50 && y - index >= 10; ++index) - { - Tile tile = Main.tile[x, y - index]; - if (!WallID.Sets.Conversion.HardenedSand[(int) tile.wall] && !WallID.Sets.Conversion.Sandstone[(int) tile.wall]) - return false; - } - return true; - } - - private static int RollDragonflyType(int tileType = 2) => tileType == 53 ? (int) Main.rand.NextFromList((short) 595, (short) 598, (short) 600) : (int) Main.rand.NextFromList((short) 596, (short) 597, (short) 599); - public static void SpawnNPC() { if (NPC.noSpawnCycle) @@ -42841,2055 +33261,1469 @@ label_18: } else { - bool windyForButterflies = NPC.TooWindyForButterflies; - bool flag1 = (double) Main.windSpeedTarget < -0.2 || (double) Main.windSpeedTarget > 0.2; - NPC.RevengeManager.CheckRespawns(); + bool flag1 = false; bool flag2 = false; int index1 = 0; - int index2 = 0; + int y = 0; int num1 = 0; int num2 = 0; - for (int index3 = 0; index3 < (int) byte.MaxValue; ++index3) + for (int index2 = 0; index2 < (int) byte.MaxValue; ++index2) { - if (Main.player[index3].active) + if (Main.player[index2].active) ++num2; } - float num3 = 0.0f; - for (int index4 = 0; index4 < 200; ++index4) + for (int plr = 0; plr < (int) byte.MaxValue; ++plr) { - if (Main.npc[index4].active) - { - switch (Main.npc[index4].type) - { - case 315: - case 325: - case 327: - case 328: - case 344: - case 345: - case 346: - num3 += Main.npc[index4].npcSlots; - continue; - default: - continue; - } - } - } - float num4 = (float) (int) ((double) NPC.defaultMaxSpawns * (2.0 + 0.300000011920929 * (double) num2)); - for (int index5 = 0; index5 < (int) byte.MaxValue; ++index5) - { - if (Main.player[index5].active && !Main.player[index5].dead) + if (Main.player[plr].active && !Main.player[plr].dead) { + if (Main.slimeRain) + NPC.SlimeRainSpawns(plr); bool flag3 = false; - if (!Main.player[index5].isNearNPC(398, (float) NPC.MoonLordFightingDistance)) + bool flag4 = false; + bool flag5 = false; + bool flag6 = false; + bool flag7 = false; + bool flag8 = false; + bool flag9 = false; + bool flag10 = false; + bool flag11 = false; + bool flag12 = false; + bool flag13 = NPC.downedPlantBoss && Main.hardMode; + if (Main.player[plr].active && Main.invasionType > 0 && Main.invasionDelay == 0 && Main.invasionSize > 0 && (double) Main.player[plr].position.Y < Main.worldSurface * 16.0 + (double) NPC.sHeight) { - if (Main.slimeRain) - NPC.SlimeRainSpawns(index5); - bool flag4 = false; - bool flag5 = false; - bool flag6 = false; - bool flag7 = false; - bool flag8 = false; - bool flag9 = false; - bool flag10 = false; - bool flag11 = false; - bool flag12 = false; - bool flag13 = false; - bool flag14 = NPC.downedPlantBoss && Main.hardMode; - bool itAhappyWindyDay = Main.IsItAHappyWindyDay; - if (Main.player[index5].active && Main.invasionType > 0 && Main.invasionDelay == 0 && Main.invasionSize > 0 && (double) Main.player[index5].position.Y < Main.worldSurface * 16.0 + (double) NPC.sHeight) + int num3 = 3000; + if ((double) Main.player[plr].position.X > Main.invasionX * 16.0 - (double) num3 && (double) Main.player[plr].position.X < Main.invasionX * 16.0 + (double) num3) + flag5 = true; + else if (Main.invasionX >= (double) (Main.maxTilesX / 2 - 5) && Main.invasionX <= (double) (Main.maxTilesX / 2 + 5)) { - int num5 = 3000; - if ((double) Main.player[index5].position.X > Main.invasionX * 16.0 - (double) num5 && (double) Main.player[index5].position.X < Main.invasionX * 16.0 + (double) num5) - flag6 = true; - else if (Main.invasionX >= (double) (Main.maxTilesX / 2 - 5) && Main.invasionX <= (double) (Main.maxTilesX / 2 + 5)) + for (int index3 = 0; index3 < 200; ++index3) { - for (int index6 = 0; index6 < 200; ++index6) + if (Main.npc[index3].townNPC && (double) Math.Abs(Main.player[plr].position.X - Main.npc[index3].Center.X) < (double) num3) { - if (Main.npc[index6].townNPC && (double) Math.Abs(Main.player[index5].position.X - Main.npc[index6].Center.X) < (double) num5) + if (Main.rand.Next(3) == 0) { - if (Main.rand.Next(3) != 0) - { - flag6 = true; - break; - } + flag5 = true; break; } + break; } } } - if (Main.player[index5].ZoneTowerSolar || Main.player[index5].ZoneTowerNebula || Main.player[index5].ZoneTowerVortex || Main.player[index5].ZoneTowerStardust) - flag6 = true; - int index7 = (int) ((double) Main.player[index5].position.X + (double) (Main.player[index5].width / 2)) / 16; - int index8 = (int) ((double) Main.player[index5].position.Y + (double) (Main.player[index5].height / 2)) / 16; - if (Main.wallHouse[(int) Main.tile[index7, index8].wall]) - flag5 = true; - if (Main.tile[index7, index8].wall == (ushort) 87) - flag4 = true; - bool flag15 = false; - NPC.spawnRate = NPC.defaultSpawnRate; - NPC.maxSpawns = NPC.defaultMaxSpawns; + } + if (Main.player[plr].ZoneTowerSolar || Main.player[plr].ZoneTowerNebula || Main.player[plr].ZoneTowerVortex || Main.player[plr].ZoneTowerStardust) + flag5 = true; + bool flag14 = false; + NPC.spawnRate = NPC.defaultSpawnRate; + NPC.maxSpawns = NPC.defaultMaxSpawns; + if (Main.hardMode) + { + NPC.spawnRate = (int) ((double) NPC.defaultSpawnRate * 0.9); + NPC.maxSpawns = NPC.defaultMaxSpawns + 1; + } + if ((double) Main.player[plr].position.Y > (double) ((Main.maxTilesY - 200) * 16)) + NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 2.0); + else if ((double) Main.player[plr].position.Y > Main.rockLayer * 16.0 + (double) NPC.sHeight) + { + NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.4); + NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 1.89999997615814); + } + else if ((double) Main.player[plr].position.Y > Main.worldSurface * 16.0 + (double) NPC.sHeight) + { if (Main.hardMode) { - NPC.spawnRate = (int) ((double) NPC.defaultSpawnRate * 0.9); - NPC.maxSpawns = NPC.defaultMaxSpawns + 1; + NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.45); + NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 1.79999995231628); } - if ((double) Main.player[index5].position.Y > (double) (Main.UnderworldLayer * 16)) - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 2.0); - else if ((double) Main.player[index5].position.Y > Main.rockLayer * 16.0 + (double) NPC.sHeight) + else { - NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.4); - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 1.89999997615814); + NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.5); + NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 1.70000004768372); } - else if ((double) Main.player[index5].position.Y > Main.worldSurface * 16.0 + (double) NPC.sHeight) + } + else if (!Main.dayTime) + { + NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.6); + NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 1.29999995231628); + if (Main.bloodMoon) { - if (Main.hardMode) - { - NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.45); - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 1.79999995231628); - } - else - { - NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.5); - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 1.70000004768372); - } + NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.3); + NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 1.79999995231628); } - else if (!Main.dayTime) - { - NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.6); - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 1.29999995231628); - if (Main.bloodMoon) - { - NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.3); - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 1.79999995231628); - } - if ((Main.pumpkinMoon || Main.snowMoon) && (double) Main.player[index5].position.Y < Main.worldSurface * 16.0) - { - NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.2); - NPC.maxSpawns *= 2; - } - } - else if (Main.dayTime && Main.eclipse) + if ((Main.pumpkinMoon || Main.snowMoon) && (double) Main.player[plr].position.Y < Main.worldSurface * 16.0) { NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.2); - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 1.89999997615814); + NPC.maxSpawns *= 2; } - if (Main.player[index5].ZoneSnow && (double) Main.player[index5].position.Y / 16.0 < Main.worldSurface) + } + else if (Main.dayTime && Main.eclipse) + { + NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.2); + NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 1.89999997615814); + } + if (Main.player[plr].ZoneSnow && (double) Main.player[plr].position.Y / 16.0 < Main.worldSurface) + { + NPC.maxSpawns = (int) ((double) NPC.maxSpawns + (double) NPC.maxSpawns * (double) Main.cloudAlpha); + NPC.spawnRate = (int) ((double) NPC.spawnRate * (1.0 - (double) Main.cloudAlpha + 1.0) / 2.0); + } + if (Main.player[plr].ZoneDungeon) + { + NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.4); + NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 1.70000004768372); + } + else if (Main.player[plr].ZoneSandstorm) + { + NPC.spawnRate = (int) ((double) NPC.spawnRate * (Main.hardMode ? 0.400000005960464 : 0.899999976158142)); + NPC.maxSpawns = (int) ((double) NPC.maxSpawns * (Main.hardMode ? 1.5 : 1.20000004768372)); + } + else if (Main.player[plr].ZoneUndergroundDesert) + { + NPC.spawnRate = (int) ((double) NPC.spawnRate * (Main.hardMode ? 0.200000002980232 : 0.300000011920929)); + NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 2.0); + } + else if (Main.player[plr].ZoneJungle) + { + NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.4); + NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 1.5); + } + else if (Main.player[plr].ZoneCorrupt || Main.player[plr].ZoneCrimson) + { + NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.65); + NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 1.29999995231628); + } + else if (Main.player[plr].ZoneMeteor) + { + NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.4); + NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 1.10000002384186); + } + if (Main.player[plr].ZoneHoly && (double) Main.player[plr].position.Y > Main.rockLayer * 16.0 + (double) NPC.sHeight) + { + NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.65); + NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 1.29999995231628); + } + if (Main.wof >= 0 && (double) Main.player[plr].position.Y > (double) ((Main.maxTilesY - 200) * 16)) + { + NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 0.300000011920929); + NPC.spawnRate *= 3; + } + if ((double) Main.player[plr].activeNPCs < (double) NPC.maxSpawns * 0.2) + NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.600000023841858); + else if ((double) Main.player[plr].activeNPCs < (double) NPC.maxSpawns * 0.4) + NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.699999988079071); + else if ((double) Main.player[plr].activeNPCs < (double) NPC.maxSpawns * 0.6) + NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.800000011920929); + else if ((double) Main.player[plr].activeNPCs < (double) NPC.maxSpawns * 0.8) + NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.899999976158142); + if ((double) Main.player[plr].position.Y / 16.0 > (Main.worldSurface + Main.rockLayer) / 2.0 || Main.player[plr].ZoneCorrupt || Main.player[plr].ZoneCrimson) + { + if ((double) Main.player[plr].activeNPCs < (double) NPC.maxSpawns * 0.2) + NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.699999988079071); + else if ((double) Main.player[plr].activeNPCs < (double) NPC.maxSpawns * 0.4) + NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.899999976158142); + } + if (Main.player[plr].calmed) + { + NPC.spawnRate = (int) ((double) NPC.spawnRate * 1.29999995231628); + NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 0.699999988079071); + } + if (Main.player[plr].sunflower) + { + NPC.spawnRate = (int) ((double) NPC.spawnRate * 1.20000004768372); + NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 0.800000011920929); + } + if (Main.player[plr].enemySpawns) + { + NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.5); + NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 2.0); + } + if (Main.player[plr].ZoneWaterCandle || Main.player[plr].inventory[Main.player[plr].selectedItem].type == 148) + { + if (!Main.player[plr].ZonePeaceCandle && Main.player[plr].inventory[Main.player[plr].selectedItem].type != 3117) { - NPC.maxSpawns = (int) ((double) NPC.maxSpawns + (double) NPC.maxSpawns * (double) Main.cloudAlpha); - NPC.spawnRate = (int) ((double) NPC.spawnRate * (1.0 - (double) Main.cloudAlpha + 1.0) / 2.0); - } - if (Main.drunkWorld && Main.tile[index7, index8].wall == (ushort) 86) - { - NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.3); - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 1.79999995231628); - } - if (Main.player[index5].ZoneDungeon) - { - NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.3); - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 1.79999995231628); - } - else if (Main.player[index5].ZoneSandstorm) - { - NPC.spawnRate = (int) ((double) NPC.spawnRate * (Main.hardMode ? 0.400000005960464 : 0.899999976158142)); - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * (Main.hardMode ? 1.5 : 1.20000004768372)); - } - else if (Main.player[index5].ZoneUndergroundDesert) - { - NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.200000002980232); - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 3.0); - } - else if (Main.player[index5].ZoneJungle) - { - NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.4); + NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.75); NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 1.5); } - else if (Main.player[index5].ZoneCorrupt || Main.player[index5].ZoneCrimson) + } + else if (Main.player[plr].ZonePeaceCandle || Main.player[plr].inventory[Main.player[plr].selectedItem].type == 3117) + { + NPC.spawnRate = (int) ((double) NPC.spawnRate * 1.3); + NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 0.699999988079071); + } + if (Main.player[plr].ZoneWaterCandle && (double) Main.player[plr].position.Y / 16.0 < Main.worldSurface * 0.349999994039536) + NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.5); + if ((double) NPC.spawnRate < (double) NPC.defaultSpawnRate * 0.1) + NPC.spawnRate = (int) ((double) NPC.defaultSpawnRate * 0.1); + if (NPC.maxSpawns > NPC.defaultMaxSpawns * 3) + NPC.maxSpawns = NPC.defaultMaxSpawns * 3; + if ((Main.pumpkinMoon || Main.snowMoon) && (double) Main.player[plr].position.Y < Main.worldSurface * 16.0) + { + NPC.maxSpawns = (int) ((double) NPC.defaultMaxSpawns * (2.0 + 0.3 * (double) num2)); + NPC.spawnRate = 20; + } + if (DD2Event.Ongoing && Main.player[plr].ZoneOldOneArmy) + { + NPC.maxSpawns = NPC.defaultMaxSpawns; + NPC.spawnRate = NPC.defaultSpawnRate; + } + if (flag5) + { + NPC.maxSpawns = (int) ((double) NPC.defaultMaxSpawns * (2.0 + 0.3 * (double) num2)); + NPC.spawnRate = 20; + } + if (Main.player[plr].ZoneDungeon && !NPC.downedBoss3) + NPC.spawnRate = 10; + if (!flag5 && (!Main.bloodMoon && !Main.pumpkinMoon && !Main.snowMoon || Main.dayTime) && (!Main.eclipse || !Main.dayTime) && !Main.player[plr].ZoneDungeon && !Main.player[plr].ZoneCorrupt && !Main.player[plr].ZoneCrimson && !Main.player[plr].ZoneMeteor && !Main.player[plr].ZoneOldOneArmy) + { + if ((double) Main.player[plr].Center.Y / 16.0 > (double) (Main.maxTilesY - 200)) { - NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.65); - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 1.29999995231628); - } - else if (Main.player[index5].ZoneMeteor) - { - NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.4); - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 1.10000002384186); - } - if (Main.player[index5].ZoneHallow && (double) Main.player[index5].position.Y > Main.rockLayer * 16.0 + (double) NPC.sHeight) - { - NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.65); - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 1.29999995231628); - } - if (Main.wofNPCIndex >= 0 && (double) Main.player[index5].position.Y > (double) (Main.UnderworldLayer * 16)) - { - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 0.300000011920929); - NPC.spawnRate *= 3; - } - if ((double) Main.player[index5].nearbyActiveNPCs < (double) NPC.maxSpawns * 0.2) - NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.600000023841858); - else if ((double) Main.player[index5].nearbyActiveNPCs < (double) NPC.maxSpawns * 0.4) - NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.699999988079071); - else if ((double) Main.player[index5].nearbyActiveNPCs < (double) NPC.maxSpawns * 0.6) - NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.800000011920929); - else if ((double) Main.player[index5].nearbyActiveNPCs < (double) NPC.maxSpawns * 0.8) - NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.899999976158142); - if ((double) Main.player[index5].position.Y / 16.0 > (Main.worldSurface + Main.rockLayer) / 2.0 || Main.player[index5].ZoneCorrupt || Main.player[index5].ZoneCrimson) - { - if ((double) Main.player[index5].nearbyActiveNPCs < (double) NPC.maxSpawns * 0.2) - NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.699999988079071); - else if ((double) Main.player[index5].nearbyActiveNPCs < (double) NPC.maxSpawns * 0.4) - NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.899999976158142); - } - if (Main.player[index5].invis) - { - NPC.spawnRate = (int) ((double) NPC.spawnRate * 1.20000004768372); - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 0.800000011920929); - } - if (Main.player[index5].calmed) - { - NPC.spawnRate = (int) ((double) NPC.spawnRate * 1.29999995231628); - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 0.699999988079071); - } - if (Main.player[index5].sunflower) - { - NPC.spawnRate = (int) ((double) NPC.spawnRate * 1.20000004768372); - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 0.800000011920929); - } - if (Main.player[index5].enemySpawns) - { - NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.5); - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 2.0); - } - if (Main.player[index5].ZoneWaterCandle || Main.player[index5].inventory[Main.player[index5].selectedItem].type == 148) - { - if (!Main.player[index5].ZonePeaceCandle && Main.player[index5].inventory[Main.player[index5].selectedItem].type != 3117) + if ((double) Main.player[plr].townNPCs == 1.0) { - NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.75); - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 1.5); + if (Main.rand.Next(2) == 0) + flag4 = true; + if (Main.rand.Next(10) == 0) + { + flag11 = true; + NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 0.5); + } + else + NPC.spawnRate = (int) ((double) NPC.spawnRate * 1.25); + } + else if ((double) Main.player[plr].townNPCs == 2.0) + { + if (Main.rand.Next(4) != 0) + flag4 = true; + if (Main.rand.Next(5) == 0) + { + flag11 = true; + NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 0.5); + } + else + NPC.spawnRate = (int) ((double) NPC.spawnRate * 1.5); + } + else if ((double) Main.player[plr].townNPCs >= 3.0) + { + if (Main.rand.Next(10) != 0) + flag4 = true; + if (Main.rand.Next(3) == 0) + { + flag11 = true; + NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 0.5); + } + else + NPC.spawnRate = (int) ((double) NPC.spawnRate * 2.0); } } - else if (Main.player[index5].ZonePeaceCandle || Main.player[index5].inventory[Main.player[index5].selectedItem].type == 3117) + else if ((double) Main.player[plr].townNPCs == 1.0) { - NPC.spawnRate = (int) ((double) NPC.spawnRate * 1.3); - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 0.699999988079071); - } - if (Main.player[index5].ZoneWaterCandle && (double) Main.player[index5].position.Y / 16.0 < Main.worldSurface * 0.349999994039536) - NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.5); - if (Main.player[index5].isNearFairy()) - { - NPC.spawnRate = (int) ((double) NPC.spawnRate * 1.20000004768372); - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 0.800000011920929); - } - if ((double) NPC.spawnRate < (double) NPC.defaultSpawnRate * 0.1) - NPC.spawnRate = (int) ((double) NPC.defaultSpawnRate * 0.1); - if (NPC.maxSpawns > NPC.defaultMaxSpawns * 3) - NPC.maxSpawns = NPC.defaultMaxSpawns * 3; - if (Main.getGoodWorld) - { - NPC.spawnRate = (int) ((double) NPC.spawnRate * 0.800000011920929); - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 1.20000004768372); - } - if (Main.GameModeInfo.IsJourneyMode) - { - CreativePowers.SpawnRateSliderPerPlayerPower power = CreativePowerManager.Instance.GetPower(); - if (power != null && power.GetIsUnlocked()) + flag4 = true; + if (Main.rand.Next(3) == 1) { - if (!power.GetShouldDisableSpawnsFor(index5)) + flag11 = true; + NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 0.6); + } + else + NPC.spawnRate = (int) ((double) NPC.spawnRate * 2.0); + } + else if ((double) Main.player[plr].townNPCs == 2.0) + { + flag4 = true; + if (Main.rand.Next(3) != 0) + { + flag11 = true; + NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 0.6); + } + else + NPC.spawnRate = (int) ((double) NPC.spawnRate * 3.0); + } + else if ((double) Main.player[plr].townNPCs >= 3.0) + { + flag4 = true; + if (!Main.expertMode || Main.rand.Next(30) != 0) + flag11 = true; + NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 0.6); + } + } + int index4 = (int) ((double) Main.player[plr].position.X + (double) (Main.player[plr].width / 2)) / 16; + int index5 = (int) ((double) Main.player[plr].position.Y + (double) (Main.player[plr].height / 2)) / 16; + if (Main.wallHouse[(int) Main.tile[index4, index5].wall]) + flag4 = true; + if (Main.tile[index4, index5].wall == (byte) 87) + flag3 = true; + bool flag15 = false; + if (Main.player[plr].active && !Main.player[plr].dead && (double) Main.player[plr].activeNPCs < (double) NPC.maxSpawns && Main.rand.Next(NPC.spawnRate) == 0) + { + NPC.spawnRangeX = (int) ((double) (NPC.sWidth / 16) * 0.7); + NPC.spawnRangeY = (int) ((double) (NPC.sHeight / 16) * 0.7); + NPC.safeRangeX = (int) ((double) (NPC.sWidth / 16) * 0.52); + NPC.safeRangeY = (int) ((double) (NPC.sHeight / 16) * 0.52); + if (Main.player[plr].inventory[Main.player[plr].selectedItem].type == 1254 || Main.player[plr].inventory[Main.player[plr].selectedItem].type == 1299 || Main.player[plr].scope) + { + float num4 = 1.5f; + if (Main.player[plr].inventory[Main.player[plr].selectedItem].type == 1254 && Main.player[plr].scope) + num4 = 1.25f; + else if (Main.player[plr].inventory[Main.player[plr].selectedItem].type == 1254) + num4 = 1.5f; + else if (Main.player[plr].inventory[Main.player[plr].selectedItem].type == 1299) + num4 = 1.5f; + else if (Main.player[plr].scope) + num4 = 2f; + NPC.spawnRangeX += (int) ((double) (NPC.sWidth / 16) * 0.5 / (double) num4); + NPC.spawnRangeY += (int) ((double) (NPC.sHeight / 16) * 0.5 / (double) num4); + NPC.safeRangeX += (int) ((double) (NPC.sWidth / 16) * 0.5 / (double) num4); + NPC.safeRangeY += (int) ((double) (NPC.sHeight / 16) * 0.5 / (double) num4); + } + int minValue1 = (int) ((double) Main.player[plr].position.X / 16.0) - NPC.spawnRangeX; + int maxValue1 = (int) ((double) Main.player[plr].position.X / 16.0) + NPC.spawnRangeX; + int minValue2 = (int) ((double) Main.player[plr].position.Y / 16.0) - NPC.spawnRangeY; + int maxValue2 = (int) ((double) Main.player[plr].position.Y / 16.0) + NPC.spawnRangeY; + int num5 = (int) ((double) Main.player[plr].position.X / 16.0) - NPC.safeRangeX; + int num6 = (int) ((double) Main.player[plr].position.X / 16.0) + NPC.safeRangeX; + int num7 = (int) ((double) Main.player[plr].position.Y / 16.0) - NPC.safeRangeY; + int num8 = (int) ((double) Main.player[plr].position.Y / 16.0) + NPC.safeRangeY; + if (minValue1 < 0) + minValue1 = 0; + if (maxValue1 > Main.maxTilesX) + maxValue1 = Main.maxTilesX; + if (minValue2 < 0) + minValue2 = 0; + if (maxValue2 > Main.maxTilesY) + maxValue2 = Main.maxTilesY; + for (int index6 = 0; index6 < 50; ++index6) + { + int index7 = Main.rand.Next(minValue1, maxValue1); + int index8 = Main.rand.Next(minValue2, maxValue2); + if (!Main.tile[index7, index8].nactive() || !Main.tileSolid[(int) Main.tile[index7, index8].type]) + { + if (!Main.wallHouse[(int) Main.tile[index7, index8].wall]) { - float num6; - if (power.GetRemappedSliderValueFor(index5, out num6)) + if (!flag5 && (double) index8 < Main.worldSurface * 0.349999994039536 && !flag11 && ((double) index7 < (double) Main.maxTilesX * 0.45 || (double) index7 > (double) Main.maxTilesX * 0.55 || Main.hardMode)) { - NPC.spawnRate = (int) ((double) NPC.spawnRate / (double) num6); - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * (double) num6); + num1 = (int) Main.tile[index7, index8].type; + index1 = index7; + y = index8; + flag14 = true; + flag2 = true; + } + else if (!flag5 && (double) index8 < Main.worldSurface * 0.449999988079071 && !flag11 && Main.hardMode && Main.rand.Next(10) == 0) + { + num1 = (int) Main.tile[index7, index8].type; + index1 = index7; + y = index8; + flag14 = true; + flag2 = true; + } + else + { + for (int index9 = index8; index9 < Main.maxTilesY; ++index9) + { + if (Main.tile[index7, index9].nactive() && Main.tileSolid[(int) Main.tile[index7, index9].type]) + { + if (index7 < num5 || index7 > num6 || index9 < num7 || index9 > num8) + { + num1 = (int) Main.tile[index7, index9].type; + index1 = index7; + y = index9; + flag14 = true; + break; + } + break; + } + } + } + if (flag14) + { + int num9 = index1 - NPC.spawnSpaceX / 2; + int num10 = index1 + NPC.spawnSpaceX / 2; + int num11 = y - NPC.spawnSpaceY; + int num12 = y; + if (num9 < 0) + flag14 = false; + if (num10 > Main.maxTilesX) + flag14 = false; + if (num11 < 0) + flag14 = false; + if (num12 > Main.maxTilesY) + flag14 = false; + if (flag14) + { + for (int index10 = num9; index10 < num10; ++index10) + { + for (int index11 = num11; index11 < num12; ++index11) + { + if (Main.tile[index10, index11].nactive() && Main.tileSolid[(int) Main.tile[index10, index11].type]) + { + flag14 = false; + break; + } + if (Main.tile[index10, index11].lava()) + { + flag14 = false; + break; + } + } + } + } + if (index1 >= num5 && index1 <= num6) + flag15 = true; } } else continue; } + if (flag14 || flag14) + break; } - if ((Main.pumpkinMoon || Main.snowMoon) && (double) Main.player[index5].position.Y < Main.worldSurface * 16.0) + } + if (flag14) + { + Microsoft.Xna.Framework.Rectangle rectangle1 = new Microsoft.Xna.Framework.Rectangle(index1 * 16, y * 16, 16, 16); + for (int index12 = 0; index12 < (int) byte.MaxValue; ++index12) { - NPC.maxSpawns = (int) ((double) NPC.defaultMaxSpawns * (2.0 + 0.3 * (double) num2)); - NPC.spawnRate = 20; - } - if (DD2Event.Ongoing && Main.player[index5].ZoneOldOneArmy) - { - NPC.maxSpawns = NPC.defaultMaxSpawns; - NPC.spawnRate = NPC.defaultSpawnRate; - } - if (flag6) - { - NPC.maxSpawns = (int) ((double) NPC.defaultMaxSpawns * (2.0 + 0.3 * (double) num2)); - NPC.spawnRate = 20; - } - if (Main.player[index5].ZoneDungeon && !NPC.downedBoss3) - NPC.spawnRate = 10; - if (!flag6 && (!Main.bloodMoon && !Main.pumpkinMoon && !Main.snowMoon || Main.dayTime) && (!Main.eclipse || !Main.dayTime) && !Main.player[index5].ZoneDungeon && !Main.player[index5].ZoneCorrupt && !Main.player[index5].ZoneCrimson && !Main.player[index5].ZoneMeteor && !Main.player[index5].ZoneOldOneArmy) - { - if ((double) Main.player[index5].Center.Y / 16.0 > (double) Main.UnderworldLayer) + if (Main.player[index12].active) { - if ((double) Main.player[index5].townNPCs == 1.0) + Microsoft.Xna.Framework.Rectangle rectangle2 = new Microsoft.Xna.Framework.Rectangle((int) ((double) Main.player[index12].position.X + (double) (Main.player[index12].width / 2) - (double) (NPC.sWidth / 2) - (double) NPC.safeRangeX), (int) ((double) Main.player[index12].position.Y + (double) (Main.player[index12].height / 2) - (double) (NPC.sHeight / 2) - (double) NPC.safeRangeY), NPC.sWidth + NPC.safeRangeX * 2, NPC.sHeight + NPC.safeRangeY * 2); + if (rectangle1.Intersects(rectangle2)) + flag14 = false; + } + } + } + if (flag14) + { + if (Main.player[plr].ZoneDungeon && (!Main.tileDungeon[(int) Main.tile[index1, y].type] || Main.tile[index1, y - 1].wall == (byte) 0)) + flag14 = false; + if (Main.tile[index1, y - 1].liquid > (byte) 0 && Main.tile[index1, y - 2].liquid > (byte) 0 && !Main.tile[index1, y - 1].lava()) + { + if (Main.tile[index1, y - 1].honey()) + flag7 = true; + else + flag6 = true; + } + int index13 = (int) Main.player[plr].Center.X / 16; + int index14 = (int) ((double) Main.player[plr].Bottom.Y + 8.0) / 16; + if (Main.tile[index1, y].type == (ushort) 367) + flag9 = true; + else if (Main.tile[index1, y].type == (ushort) 368) + flag8 = true; + else if (Main.tile[index13, index14].type == (ushort) 367) + flag9 = true; + else if (Main.tile[index13, index14].type == (ushort) 368) + { + flag8 = true; + } + else + { + int num13 = Main.rand.Next(20, 31); + int num14 = Main.rand.Next(1, 4); + if (index1 - num13 < 0) + num13 = index1; + if (y - num13 < 0) + num13 = y; + if (index1 + num13 >= Main.maxTilesX) + num13 = Main.maxTilesX - index1 - 1; + if (y + num13 >= Main.maxTilesY) + num13 = Main.maxTilesY - y - 1; + for (int index15 = index1 - num13; index15 <= index1 + num13; index15 += num14) + { + int num15 = Main.rand.Next(1, 4); + for (int index16 = y - num13; index16 <= y + num13; index16 += num15) { - if (Main.rand.Next(2) == 0) - flag5 = true; - if (Main.rand.Next(10) == 0) - { - flag12 = true; - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 0.5); - } - else - NPC.spawnRate = (int) ((double) NPC.spawnRate * 1.25); - } - else if ((double) Main.player[index5].townNPCs == 2.0) - { - if (Main.rand.Next(4) != 0) - flag5 = true; - if (Main.rand.Next(5) == 0) - { - flag12 = true; - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 0.5); - } - else - NPC.spawnRate = (int) ((double) NPC.spawnRate * 1.5); - } - else if ((double) Main.player[index5].townNPCs >= 3.0) - { - if (Main.rand.Next(10) != 0) - flag5 = true; - if (Main.rand.Next(3) == 0) - { - flag12 = true; - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 0.5); - } - else - NPC.spawnRate = (int) ((double) NPC.spawnRate * 2.0); + if (Main.tile[index15, index16].type == (ushort) 367) + flag9 = true; + if (Main.tile[index15, index16].type == (ushort) 368) + flag8 = true; } } - else if ((double) Main.player[index5].townNPCs == 1.0) + int num16 = Main.rand.Next(30, 61); + int num17 = Main.rand.Next(3, 7); + if (index13 - num16 < 0) + num16 = index13; + if (index14 - num16 < 0) + num16 = index14; + if (index13 + num16 >= Main.maxTilesX) + num16 = Main.maxTilesX - index13 - 2; + if (index14 + num16 >= Main.maxTilesY) + num16 = Main.maxTilesY - index14 - 2; + for (int index17 = index13 - num16; index17 <= index13 + num16; index17 += num17) { - flag5 = true; - if (Main.player[index5].ZoneGraveyard) + int num18 = Main.rand.Next(3, 7); + for (int index18 = index14 - num16; index18 <= index14 + num16; index18 += num18) { - NPC.spawnRate = (int) ((double) NPC.spawnRate * 1.66); - if (Main.rand.Next(9) == 1) - { - flag12 = true; - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 0.6); - } - } - else if (Main.rand.Next(3) == 1) - { - flag12 = true; - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 0.6); - } - else - NPC.spawnRate = (int) ((double) NPC.spawnRate * 2.0); - } - else if ((double) Main.player[index5].townNPCs == 2.0) - { - flag5 = true; - if (Main.player[index5].ZoneGraveyard) - { - NPC.spawnRate = (int) ((double) NPC.spawnRate * 2.33); - if (Main.rand.Next(6) == 1) - { - flag12 = true; - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 0.6); - } - } - else if (Main.rand.Next(3) != 0) - { - flag12 = true; - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 0.6); - } - else - NPC.spawnRate = (int) ((double) NPC.spawnRate * 3.0); - } - else if ((double) Main.player[index5].townNPCs >= 3.0) - { - flag5 = true; - if (Main.player[index5].ZoneGraveyard) - { - NPC.spawnRate = (int) ((double) NPC.spawnRate * 3.0); - if (Main.rand.Next(3) == 1) - { - flag12 = true; - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 0.6); - } - } - else - { - if (!Main.expertMode || Main.rand.Next(30) != 0) - flag12 = true; - NPC.maxSpawns = (int) ((double) NPC.maxSpawns * 0.6); + if (Main.tile[index17, index18].type == (ushort) 367) + flag9 = true; + if (Main.tile[index17, index18].type == (ushort) 368) + flag8 = true; } } } - bool flag16 = false; - if (Main.player[index5].active && !Main.player[index5].dead && (double) Main.player[index5].nearbyActiveNPCs < (double) NPC.maxSpawns && Main.rand.Next(NPC.spawnRate) == 0) + } + if (flag7) + flag14 = false; + if (flag14) + { + if ((double) y > Main.rockLayer && y < Main.maxTilesY - 200 && !Main.player[plr].ZoneDungeon && !flag5) { - bool flag17 = Main.player[index5].ZoneTowerNebula || Main.player[index5].ZoneTowerSolar || Main.player[index5].ZoneTowerStardust || Main.player[index5].ZoneTowerVortex; - NPC.spawnRangeX = (int) ((double) (NPC.sWidth / 16) * 0.7); - NPC.spawnRangeY = (int) ((double) (NPC.sHeight / 16) * 0.7); - NPC.safeRangeX = (int) ((double) (NPC.sWidth / 16) * 0.52); - NPC.safeRangeY = (int) ((double) (NPC.sHeight / 16) * 0.52); - if (Main.player[index5].inventory[Main.player[index5].selectedItem].type == 1254 || Main.player[index5].inventory[Main.player[index5].selectedItem].type == 1299 || Main.player[index5].scope) + if (Main.rand.Next(3) == 0) { - float num7 = 1.5f; - if (Main.player[index5].inventory[Main.player[index5].selectedItem].type == 1254 && Main.player[index5].scope) - num7 = 1.25f; - else if (Main.player[index5].inventory[Main.player[index5].selectedItem].type == 1254) - num7 = 1.5f; - else if (Main.player[index5].inventory[Main.player[index5].selectedItem].type == 1299) - num7 = 1.5f; - else if (Main.player[index5].scope) - num7 = 2f; - NPC.spawnRangeX += (int) ((double) (NPC.sWidth / 16) * 0.5 / (double) num7); - NPC.spawnRangeY += (int) ((double) (NPC.sHeight / 16) * 0.5 / (double) num7); - NPC.safeRangeX += (int) ((double) (NPC.sWidth / 16) * 0.5 / (double) num7); - NPC.safeRangeY += (int) ((double) (NPC.sHeight / 16) * 0.5 / (double) num7); - } - int minValue1 = (int) ((double) Main.player[index5].position.X / 16.0) - NPC.spawnRangeX; - int maxValue1 = (int) ((double) Main.player[index5].position.X / 16.0) + NPC.spawnRangeX; - int minValue2 = (int) ((double) Main.player[index5].position.Y / 16.0) - NPC.spawnRangeY; - int maxValue2 = (int) ((double) Main.player[index5].position.Y / 16.0) + NPC.spawnRangeY; - int num8 = (int) ((double) Main.player[index5].position.X / 16.0) - NPC.safeRangeX; - int num9 = (int) ((double) Main.player[index5].position.X / 16.0) + NPC.safeRangeX; - int num10 = (int) ((double) Main.player[index5].position.Y / 16.0) - NPC.safeRangeY; - int num11 = (int) ((double) Main.player[index5].position.Y / 16.0) + NPC.safeRangeY; - if (minValue1 < 0) - minValue1 = 0; - if (maxValue1 > Main.maxTilesX) - maxValue1 = Main.maxTilesX; - if (minValue2 < 0) - minValue2 = 0; - if (maxValue2 > Main.maxTilesY) - maxValue2 = Main.maxTilesY; - for (int index9 = 0; index9 < 50; ++index9) - { - int index10 = Main.rand.Next(minValue1, maxValue1); - int index11 = Main.rand.Next(minValue2, maxValue2); - if (!Main.tile[index10, index11].nactive() || !Main.tileSolid[(int) Main.tile[index10, index11].type]) + int num19 = Main.rand.Next(5, 15); + if (index1 - num19 >= 0 && index1 + num19 < Main.maxTilesX) { - if (flag17 || !Main.wallHouse[(int) Main.tile[index10, index11].wall]) + for (int index19 = index1 - num19; index19 < index1 + num19; ++index19) { - if (!flag6 && (double) index11 < Main.worldSurface * 0.349999994039536 && !flag12 && ((double) index10 < (double) Main.maxTilesX * 0.45 || (double) index10 > (double) Main.maxTilesX * 0.55 || Main.hardMode)) + for (int index20 = y - num19; index20 < y + num19; ++index20) { - num1 = (int) Main.tile[index10, index11].type; - index1 = index10; - index2 = index11; - flag15 = true; - flag3 = true; - } - else if (!flag6 && (double) index11 < Main.worldSurface * 0.449999988079071 && !flag12 && Main.hardMode && Main.rand.Next(10) == 0) - { - num1 = (int) Main.tile[index10, index11].type; - index1 = index10; - index2 = index11; - flag15 = true; - flag3 = true; - } - else - { - for (int index12 = index11; index12 < Main.maxTilesY && index12 < maxValue2; ++index12) - { - if (Main.tile[index10, index12].nactive() && Main.tileSolid[(int) Main.tile[index10, index12].type]) - { - if (index10 < num8 || index10 > num9 || index12 < num10 || index12 > num11) - { - num1 = (int) Main.tile[index10, index12].type; - index1 = index10; - index2 = index12; - flag15 = true; - break; - } - break; - } - } - } - if (!flag3 && Main.player[index5].afkCounter >= NPC.AFKTimeNeededForNoWorms) - flag5 = true; - if (flag15) - { - int num12 = index1 - NPC.spawnSpaceX / 2; - int num13 = index1 + NPC.spawnSpaceX / 2; - int num14 = index2 - NPC.spawnSpaceY; - int num15 = index2; - if (num12 < 0) - flag15 = false; - if (num13 > Main.maxTilesX) - flag15 = false; - if (num14 < 0) - flag15 = false; - if (num15 > Main.maxTilesY) - flag15 = false; - if (flag15) - { - for (int index13 = num12; index13 < num13; ++index13) - { - for (int index14 = num14; index14 < num15; ++index14) - { - if (Main.tile[index13, index14].nactive() && Main.tileSolid[(int) Main.tile[index13, index14].type]) - { - flag15 = false; - break; - } - if (Main.tile[index13, index14].lava()) - { - flag15 = false; - break; - } - } - } - } - if (index1 >= num8 && index1 <= num9) - flag16 = true; + if (Main.tile[index19, index20].wall == (byte) 62) + flag10 = true; } } - else - continue; } - if (flag15 || flag15) - break; - } - } - if (flag15) - { - Microsoft.Xna.Framework.Rectangle rectangle1 = new Microsoft.Xna.Framework.Rectangle(index1 * 16, index2 * 16, 16, 16); - for (int index15 = 0; index15 < (int) byte.MaxValue; ++index15) - { - if (Main.player[index15].active) - { - Microsoft.Xna.Framework.Rectangle rectangle2 = new Microsoft.Xna.Framework.Rectangle((int) ((double) Main.player[index15].position.X + (double) (Main.player[index15].width / 2) - (double) (NPC.sWidth / 2) - (double) NPC.safeRangeX), (int) ((double) Main.player[index15].position.Y + (double) (Main.player[index15].height / 2) - (double) (NPC.sHeight / 2) - (double) NPC.safeRangeY), NPC.sWidth + NPC.safeRangeX * 2, NPC.sHeight + NPC.safeRangeY * 2); - if (rectangle1.Intersects(rectangle2)) - flag15 = false; - } - } - } - if (flag15) - { - if (Main.player[index5].ZoneDungeon && (!Main.tileDungeon[(int) Main.tile[index1, index2].type] || Main.tile[index1, index2 - 1].wall == (ushort) 0)) - flag15 = false; - if (Main.tile[index1, index2 - 1].liquid > (byte) 0 && Main.tile[index1, index2 - 2].liquid > (byte) 0 && !Main.tile[index1, index2 - 1].lava()) - { - if (Main.tile[index1, index2 - 1].honey()) - flag8 = true; - else - flag7 = true; - } - int index16 = (int) Main.player[index5].Center.X / 16; - int index17 = (int) ((double) Main.player[index5].Bottom.Y + 8.0) / 16; - if (Main.tile[index1, index2].type == (ushort) 367) - flag10 = true; - else if (Main.tile[index1, index2].type == (ushort) 368) - flag9 = true; - else if (Main.tile[index16, index17].type == (ushort) 367) - flag10 = true; - else if (Main.tile[index16, index17].type == (ushort) 368) - { - flag9 = true; } else { - int num16 = Main.rand.Next(20, 31); - int num17 = Main.rand.Next(1, 4); - if (index1 - num16 < 0) - num16 = index1; - if (index2 - num16 < 0) - num16 = index2; - if (index1 + num16 >= Main.maxTilesX) - num16 = Main.maxTilesX - index1 - 1; - if (index2 + num16 >= Main.maxTilesY) - num16 = Main.maxTilesY - index2 - 1; - for (int index18 = index1 - num16; index18 <= index1 + num16; index18 += num17) - { - int num18 = Main.rand.Next(1, 4); - for (int index19 = index2 - num16; index19 <= index2 + num16; index19 += num18) - { - if (Main.tile[index18, index19].type == (ushort) 367) - flag10 = true; - if (Main.tile[index18, index19].type == (ushort) 368) - flag9 = true; - } - } - int num19 = Main.rand.Next(30, 61); - int num20 = Main.rand.Next(3, 7); - if (index16 - num19 < 0) - num19 = index16; - if (index17 - num19 < 0) - num19 = index17; - if (index16 + num19 >= Main.maxTilesX) - num19 = Main.maxTilesX - index16 - 2; - if (index17 + num19 >= Main.maxTilesY) - num19 = Main.maxTilesY - index17 - 2; - for (int index20 = index16 - num19; index20 <= index16 + num19; index20 += num20) - { - int num21 = Main.rand.Next(3, 7); - for (int index21 = index17 - num19; index21 <= index17 + num19; index21 += num21) - { - if (Main.tile[index20, index21].type == (ushort) 367) - flag10 = true; - if (Main.tile[index20, index21].type == (ushort) 368) - flag9 = true; - } - } + int index21 = (int) Main.player[plr].position.X / 16; + int index22 = (int) Main.player[plr].position.Y / 16; + if (Main.tile[index21, index22].wall == (byte) 62) + flag10 = true; } - if (flag8) - flag15 = false; - if ((num1 == 477 || num1 == 492) && !Main.bloodMoon && !Main.eclipse && Main.invasionType <= 0 && !Main.pumpkinMoon && !Main.snowMoon && !Main.slimeRain && Main.rand.Next(100) < 10) - flag15 = false; } - if (flag15) + if ((double) y < Main.rockLayer && y > 200 && !Main.player[plr].ZoneDungeon && !flag5) { - if ((double) index2 > Main.rockLayer && index2 < Main.UnderworldLayer && !Main.player[index5].ZoneDungeon && !flag6) + if (Main.rand.Next(3) == 0) { - if (Main.rand.Next(3) == 0) + int num20 = Main.rand.Next(5, 15); + if (index1 - num20 >= 0 && index1 + num20 < Main.maxTilesX) { - int num22 = Main.rand.Next(5, 15); - if (index1 - num22 >= 0 && index1 + num22 < Main.maxTilesX) + for (int index23 = index1 - num20; index23 < index1 + num20; ++index23) { - for (int index22 = index1 - num22; index22 < index1 + num22; ++index22) + for (int index24 = y - num20; index24 < y + num20; ++index24) { - for (int index23 = index2 - num22; index23 < index2 + num22; ++index23) - { - if (Main.tile[index22, index23].wall == (ushort) 62) - flag11 = true; - } + if (WallID.Sets.Conversion.Sandstone[(int) Main.tile[index23, index24].wall] || WallID.Sets.Conversion.HardenedSand[(int) Main.tile[index23, index24].wall]) + flag12 = true; } } } - else - { - int index24 = (int) Main.player[index5].position.X / 16; - int index25 = (int) Main.player[index5].position.Y / 16; - if (Main.tile[index24, index25].wall == (ushort) 62) - flag11 = true; - } } - if ((double) index2 < Main.rockLayer && index2 > 200 && !Main.player[index5].ZoneDungeon && !flag6) + else { - if (Main.rand.Next(3) == 0) - { - int num23 = Main.rand.Next(5, 15); - if (index1 - num23 >= 0 && index1 + num23 < Main.maxTilesX) + int index25 = (int) Main.player[plr].position.X / 16; + int index26 = (int) Main.player[plr].position.Y / 16; + if (WallID.Sets.Conversion.Sandstone[(int) Main.tile[index25, index26].wall] || WallID.Sets.Conversion.HardenedSand[(int) Main.tile[index25, index26].wall]) + flag12 = true; + } + } + flag1 = false; + int type = (int) Main.tile[index1, y].type; + int newNPC = 200; + if (Main.player[plr].ZoneTowerNebula) + { + bool flag16 = true; + int Type = 0; + while (flag16) + { + Type = Utils.SelectRandom(Main.rand, 424, 424, 424, 423, 423, 423, 421, 421, 421, 421, 421, 420); + flag16 = false; + if (Type == 424 && NPC.CountNPCS(Type) >= 2) + flag16 = true; + if (Type == 423 && NPC.CountNPCS(Type) >= 3) + flag16 = true; + if (Type == 420 && NPC.CountNPCS(Type) >= 2) + flag16 = true; + } + if (Type != 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, Type, 1); + } + else if (Main.player[plr].ZoneTowerVortex) + { + bool flag17 = true; + int Type = 0; + while (flag17) + { + Type = Utils.SelectRandom(Main.rand, 429, 429, 429, 429, 427, 427, 425, 425, 426); + flag17 = false; + if (Type == 425 && NPC.CountNPCS(Type) >= 3) + flag17 = true; + if (Type == 426 && NPC.CountNPCS(Type) >= 3) + flag17 = true; + if (Type == 429 && NPC.CountNPCS(Type) >= 4) + flag17 = true; + } + if (Type != 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, Type, 1); + } + else if (Main.player[plr].ZoneTowerStardust) + { + int Type = Utils.SelectRandom(Main.rand, 411, 411, 411, 409, 409, 407, 402, 405); + if (Type != 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, Type, 1); + } + else if (Main.player[plr].ZoneTowerSolar) + { + bool flag18 = true; + int Type = 0; + while (flag18) + { + Type = Utils.SelectRandom(Main.rand, 518, 419, 418, 412, 417, 416, 415); + flag18 = false; + if (Type == 415 && NPC.CountNPCS(Type) >= 2) + flag18 = true; + if (Type == 416 && NPC.CountNPCS(Type) >= 1) + flag18 = true; + if (Type == 518 && NPC.CountNPCS(Type) >= 2) + flag18 = true; + if (Type == 412 && NPC.CountNPCS(Type) >= 1) + flag18 = true; + } + if (Type != 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, Type, 1); + } + else if (flag2) + { + int maxValue3 = 8; + int maxValue4 = 30; + bool flag19 = (double) Math.Abs(index1 - Main.maxTilesX / 2) / (double) (Main.maxTilesX / 2) > 0.330000013113022 && (Main.wallLight[(int) Main.tile[index4, index5].wall] || Main.tile[index4, index5].wall == (byte) 73); + if (flag19 && NPC.AnyDanger()) + flag19 = false; + if (Main.player[plr].ZoneWaterCandle) + { + maxValue3 = 3; + maxValue4 = 10; + } + if (flag5 && Main.invasionType == 4) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 388); + else if (flag19 && Main.hardMode && NPC.downedGolemBoss && (!NPC.downedMartians && Main.rand.Next(maxValue3) == 0 || Main.rand.Next(maxValue4) == 0) && !NPC.AnyNPCs(399)) + NPC.NewNPC(index1 * 16 + 8, y * 16, 399); + else if (flag19 && Main.hardMode && NPC.downedGolemBoss && (!NPC.downedMartians && Main.rand.Next(maxValue3) == 0 || Main.rand.Next(maxValue4) == 0) && !NPC.AnyNPCs(399) && (Main.player[plr].inventory[Main.player[plr].selectedItem].type == 148 || Main.player[plr].ZoneWaterCandle)) + NPC.NewNPC(index1 * 16 + 8, y * 16, 399); + else if (Main.hardMode && !NPC.AnyNPCs(87) && !flag4 && Main.rand.Next(10) == 0) + NPC.NewNPC(index1 * 16 + 8, y * 16, 87, 1); + else if (Main.hardMode && !NPC.AnyNPCs(87) && !flag4 && Main.rand.Next(10) == 0 && (Main.player[plr].inventory[Main.player[plr].selectedItem].type == 148 || Main.player[plr].ZoneWaterCandle)) + NPC.NewNPC(index1 * 16 + 8, y * 16, 87, 1); + else + NPC.NewNPC(index1 * 16 + 8, y * 16, 48); + } + else if (flag5) + { + switch (Main.invasionType) + { + case 1: + if (Main.hardMode && !NPC.AnyNPCs(471) && Main.rand.Next(30) == 0) { - for (int index26 = index1 - num23; index26 < index1 + num23; ++index26) + NPC.NewNPC(index1 * 16 + 8, y * 16, 471); + break; + } + if (Main.rand.Next(9) == 0) + { + NPC.NewNPC(index1 * 16 + 8, y * 16, 29); + break; + } + if (Main.rand.Next(5) == 0) + { + NPC.NewNPC(index1 * 16 + 8, y * 16, 26); + break; + } + if (Main.rand.Next(3) == 0) + { + NPC.NewNPC(index1 * 16 + 8, y * 16, 111); + break; + } + if (Main.rand.Next(3) == 0) + { + NPC.NewNPC(index1 * 16 + 8, y * 16, 27); + break; + } + NPC.NewNPC(index1 * 16 + 8, y * 16, 28); + break; + case 2: + if (Main.rand.Next(7) == 0) + { + NPC.NewNPC(index1 * 16 + 8, y * 16, 145); + break; + } + if (Main.rand.Next(3) == 0) + { + NPC.NewNPC(index1 * 16 + 8, y * 16, 143); + break; + } + NPC.NewNPC(index1 * 16 + 8, y * 16, 144); + break; + case 3: + if (Main.invasionSize < Main.invasionSizeStart / 2 && Main.rand.Next(20) == 0 && !NPC.AnyNPCs(491) && !Collision.SolidTiles(index1 - 20, index1 + 20, y - 40, y - 10)) + { + NPC.NewNPC(index1 * 16 + 8, (y - 10) * 16, 491); + break; + } + if (Main.rand.Next(30) == 0 && !NPC.AnyNPCs(216)) + { + NPC.NewNPC(index1 * 16 + 8, y * 16, 216); + break; + } + if (Main.rand.Next(11) == 0) + { + NPC.NewNPC(index1 * 16 + 8, y * 16, 215); + break; + } + if (Main.rand.Next(9) == 0) + { + NPC.NewNPC(index1 * 16 + 8, y * 16, 252); + break; + } + if (Main.rand.Next(7) == 0) + { + NPC.NewNPC(index1 * 16 + 8, y * 16, 214); + break; + } + if (Main.rand.Next(3) == 0) + { + NPC.NewNPC(index1 * 16 + 8, y * 16, 213); + break; + } + NPC.NewNPC(index1 * 16 + 8, y * 16, 212); + break; + case 4: + int Type1 = 0; + int num21 = Main.rand.Next(7); + if (Main.invasionSize <= 100 && Main.rand.Next(10) == 0 && !NPC.AnyNPCs(395)) + Type1 = 395; + else if (num21 >= 6) + { + if (Main.rand.Next(10) == 0 && !NPC.AnyNPCs(395)) { - for (int index27 = index2 - num23; index27 < index2 + num23; ++index27) - { - if (WallID.Sets.Conversion.Sandstone[(int) Main.tile[index26, index27].wall] || WallID.Sets.Conversion.HardenedSand[(int) Main.tile[index26, index27].wall]) - flag13 = true; - } + Type1 = 395; + } + else + { + int num22 = Main.rand.Next(2); + if (num22 == 0) + Type1 = 390; + if (num22 == 1) + Type1 = 386; } } - } - else - { - int index28 = (int) Main.player[index5].position.X / 16; - int index29 = (int) Main.player[index5].position.Y / 16; - if (WallID.Sets.Conversion.Sandstone[(int) Main.tile[index28, index29].wall] || WallID.Sets.Conversion.HardenedSand[(int) Main.tile[index28, index29].wall]) - flag13 = true; - } - } - flag2 = false; - int type = (int) Main.tile[index1, index2].type; - int num24 = (int) Main.tile[index1, index2 - 1].wall; - if (Main.tile[index1, index2 - 2].wall == (ushort) 244 || Main.tile[index1, index2].wall == (ushort) 244) - num24 = 244; - bool flag18 = (double) new Point(index7 - index1, index8 - index2).X * (double) Main.windSpeedTarget > 0.0; - int tileType = NPC.SpawnNPC_TryFindingProperGroundTileType(type, index1, index2); - int newNPC = 200; - if (Main.player[index5].ZoneTowerNebula) - { - bool flag19 = true; - int Type = 0; - while (flag19) - { - Type = Utils.SelectRandom(Main.rand, 424, 424, 424, 423, 423, 423, 421, 421, 421, 421, 421, 420); - flag19 = false; - if (Type == 424 && NPC.CountNPCS(Type) >= 2) - flag19 = true; - if (Type == 423 && NPC.CountNPCS(Type) >= 3) - flag19 = true; - if (Type == 420 && NPC.CountNPCS(Type) >= 2) - flag19 = true; - } - if (Type != 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, Type, 1); - } - else if (Main.player[index5].ZoneTowerVortex) - { - bool flag20 = true; - int Type = 0; - while (flag20) - { - Type = Utils.SelectRandom(Main.rand, 429, 429, 429, 429, 427, 427, 425, 425, 426); - flag20 = false; - if (Type == 425 && NPC.CountNPCS(Type) >= 3) - flag20 = true; - if (Type == 426 && NPC.CountNPCS(Type) >= 3) - flag20 = true; - if (Type == 429 && NPC.CountNPCS(Type) >= 4) - flag20 = true; - } - if (Type != 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, Type, 1); - } - else if (Main.player[index5].ZoneTowerStardust) - { - int Type = Utils.SelectRandom(Main.rand, 411, 411, 411, 409, 409, 407, 402, 405); - if (Type != 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, Type, 1); - } - else if (Main.player[index5].ZoneTowerSolar) - { - bool flag21 = true; - int Type = 0; - while (flag21) - { - Type = Utils.SelectRandom(Main.rand, 518, 419, 418, 412, 417, 416, 415); - flag21 = false; - if (Type == 415 && NPC.CountNPCS(Type) >= 2) - flag21 = true; - if (Type == 416 && NPC.CountNPCS(Type) >= 1) - flag21 = true; - if (Type == 518 && NPC.CountNPCS(Type) >= 2) - flag21 = true; - if (Type == 412 && NPC.CountNPCS(Type) >= 1) - flag21 = true; - } - if (Type != 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, Type, 1); - } - else if (flag3) - { - int maxValue3 = 8; - int maxValue4 = 30; - bool flag22 = (double) Math.Abs(index1 - Main.maxTilesX / 2) / (double) (Main.maxTilesX / 2) > 0.330000013113022 && (Main.wallLight[(int) Main.tile[index7, index8].wall] || Main.tile[index7, index8].wall == (ushort) 73); - if (flag22 && NPC.AnyDanger()) - flag22 = false; - if (Main.player[index5].ZoneWaterCandle) - { - maxValue3 = 3; - maxValue4 = 10; - } - if (flag6 && Main.invasionType == 4) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 388); - else if (flag22 && Main.hardMode && NPC.downedGolemBoss && (!NPC.downedMartians && Main.rand.Next(maxValue3) == 0 || Main.rand.Next(maxValue4) == 0) && !NPC.AnyNPCs(399)) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 399); - else if (flag22 && Main.hardMode && NPC.downedGolemBoss && (!NPC.downedMartians && Main.rand.Next(maxValue3) == 0 || Main.rand.Next(maxValue4) == 0) && !NPC.AnyNPCs(399) && (Main.player[index5].inventory[Main.player[index5].selectedItem].type == 148 || Main.player[index5].ZoneWaterCandle)) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 399); - else if (Main.hardMode && !NPC.AnyNPCs(87) && !flag5 && Main.rand.Next(10) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 87, 1); - else if (Main.hardMode && !NPC.AnyNPCs(87) && !flag5 && Main.rand.Next(10) == 0 && (Main.player[index5].inventory[Main.player[index5].selectedItem].type == 148 || Main.player[index5].ZoneWaterCandle)) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 87, 1); - else - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 48); - } - else if (flag6) - { - switch (Main.invasionType) - { - case 1: - if (Main.hardMode && !NPC.AnyNPCs(471) && Main.rand.Next(30) == 0) + else if (num21 >= 4) + { + int num23 = Main.rand.Next(5); + Type1 = num23 >= 2 ? (num23 >= 4 ? 388 : 381) : 382; + } + else + { + int num24 = Main.rand.Next(4); + if (num24 == 3) { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 471); + if (!NPC.AnyNPCs(520)) + Type1 = 520; + else + num24 = Main.rand.Next(3); + } + if (num24 == 0) + Type1 = 385; + if (num24 == 1) + Type1 = 389; + if (num24 == 2) + Type1 = 383; + } + if (Type1 != 0) + { + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, Type1, 1); + break; + } + break; + } + } + else if (!NPC.savedBartender && DD2Event.ReadyToFindBartender && !NPC.AnyNPCs(579) && Main.rand.Next(80) == 0 && !flag6) + NPC.NewNPC(index1 * 16 + 8, y * 16, 579); + else if (Main.tile[index1, y].wall == (byte) 62 | flag10) + { + if (Main.tile[index1, y].wall == (byte) 62 && Main.rand.Next(8) == 0 && !flag6 && (double) y >= Main.rockLayer && y < Main.maxTilesY - 210 && !NPC.savedStylist && !NPC.AnyNPCs(354)) + NPC.NewNPC(index1 * 16 + 8, y * 16, 354); + else if (Main.hardMode) + NPC.NewNPC(index1 * 16 + 8, y * 16, 163); + else + NPC.NewNPC(index1 * 16 + 8, y * 16, 164); + } + else if (((WallID.Sets.Conversion.HardenedSand[(int) Main.tile[index1, y].wall] ? 1 : (WallID.Sets.Conversion.Sandstone[(int) Main.tile[index1, y].wall] ? 1 : 0)) | (flag12 ? 1 : 0)) != 0 && WorldGen.checkUnderground(index1, y)) + { + if (Main.hardMode && Main.rand.Next(33) == 0 && !flag4 && (double) y > Main.worldSurface + 100.0) + NPC.NewNPC(index1 * 16 + 8, y * 16, 510); + else if (Main.rand.Next(22) == 0 && !flag4 && (double) y > Main.worldSurface + 100.0) + NPC.NewNPC(index1 * 16 + 8, y * 16, 513); + else if (Main.hardMode && Main.rand.Next(5) != 0) + { + List intList = new List(); + if (Main.player[plr].ZoneCorrupt) + { + intList.Add(525); + intList.Add(525); + } + if (Main.player[plr].ZoneCrimson) + { + intList.Add(526); + intList.Add(526); + } + if (Main.player[plr].ZoneHoly) + { + intList.Add(527); + intList.Add(527); + } + if (intList.Count == 0) + { + intList.Add(524); + intList.Add(524); + } + if (Main.player[plr].ZoneCorrupt || Main.player[plr].ZoneCrimson) + { + intList.Add(533); + intList.Add(529); + } + else + { + intList.Add(530); + intList.Add(528); + } + intList.Add(532); + int Type2 = Utils.SelectRandom(Main.rand, intList.ToArray()); + NPC.NewNPC(index1 * 16 + 8, y * 16, Type2); + intList.Clear(); + } + else + { + int Type3 = Utils.SelectRandom(Main.rand, 69, 508, 508, 508, 509); + NPC.NewNPC(index1 * 16 + 8, y * 16, Type3); + } + } + else if (Main.hardMode & flag6 && Main.player[plr].ZoneJungle && Main.rand.Next(3) != 0) + NPC.NewNPC(index1 * 16 + 8, y * 16, 157); + else if (Main.hardMode & flag6 && Main.player[plr].ZoneCrimson && Main.rand.Next(3) != 0) + NPC.NewNPC(index1 * 16 + 8, y * 16, 242); + else if (Main.hardMode & flag6 && Main.player[plr].ZoneCrimson && Main.rand.Next(3) != 0) + NPC.NewNPC(index1 * 16 + 8, y * 16, 241); + else if (flag6 && (index1 < 250 || index1 > Main.maxTilesX - 250) && Main.tileSand[type] && (double) y < Main.rockLayer) + { + bool flag20 = false; + if (!NPC.savedAngler && !NPC.AnyNPCs(376)) + { + int num25 = -1; + for (int j = y - 1; j > y - 50; --j) + { + if (Main.tile[index1, j].liquid == (byte) 0 && !WorldGen.SolidTile(index1, j) && !WorldGen.SolidTile(index1, j + 1) && !WorldGen.SolidTile(index1, j + 2)) + { + num25 = j + 2; + break; + } + } + if (num25 > y) + num25 = y; + if (num25 > 0 && !flag15) + { + NPC.NewNPC(index1 * 16 + 8, num25 * 16, 376); + flag20 = true; + } + } + if (!flag20) + { + if (Main.rand.Next(60) == 0) + NPC.NewNPC(index1 * 16 + 8, y * 16, 220); + else if (Main.rand.Next(25) == 0) + NPC.NewNPC(index1 * 16 + 8, y * 16, 221); + else if (Main.rand.Next(8) == 0) + NPC.NewNPC(index1 * 16 + 8, y * 16, 65); + else if (Main.rand.Next(3) == 0) + NPC.NewNPC(index1 * 16 + 8, y * 16, 67); + else + NPC.NewNPC(index1 * 16 + 8, y * 16, 64); + } + } + else if (!flag6 && !NPC.savedAngler && !NPC.AnyNPCs(376) && (index1 < 340 || index1 > Main.maxTilesX - 340) && Main.tileSand[type] && (double) y < Main.worldSurface) + NPC.NewNPC(index1 * 16 + 8, y * 16, 376); + else if (flag6 && ((double) y > Main.rockLayer && Main.rand.Next(2) == 0 || type == 60)) + { + if (Main.hardMode && Main.rand.Next(3) > 0) + NPC.NewNPC(index1 * 16 + 8, y * 16, 102); + else + NPC.NewNPC(index1 * 16 + 8, y * 16, 58); + } + else if (flag6 && (double) y > Main.worldSurface && Main.rand.Next(3) == 0) + { + if (Main.hardMode) + NPC.NewNPC(index1 * 16 + 8, y * 16, 103); + else + NPC.NewNPC(index1 * 16 + 8, y * 16, 63); + } + else if (flag6 && Main.rand.Next(4) == 0) + { + if (Main.player[plr].ZoneCorrupt) + NPC.NewNPC(index1 * 16 + 8, y * 16, 57); + else if ((double) y < Main.worldSurface && y > 50 && Main.rand.Next(3) != 0 && Main.dayTime) + { + int num26 = -1; + for (int j = y - 1; j > y - 50; --j) + { + if (Main.tile[index1, j].liquid == (byte) 0 && !WorldGen.SolidTile(index1, j) && !WorldGen.SolidTile(index1, j + 1) && !WorldGen.SolidTile(index1, j + 2)) + { + num26 = j + 2; + break; + } + } + if (num26 > y) + num26 = y; + if (num26 > 0 && !flag15) + { + if (Main.rand.Next(2) == 0) + NPC.NewNPC(index1 * 16 + 8, num26 * 16, 362); + else + NPC.NewNPC(index1 * 16 + 8, num26 * 16, 364); + } + else + NPC.NewNPC(index1 * 16 + 8, y * 16, 55); + } + else + NPC.NewNPC(index1 * 16 + 8, y * 16, 55); + } + else if (NPC.downedGoblins && Main.rand.Next(20) == 0 && !flag6 && (double) y >= Main.rockLayer && y < Main.maxTilesY - 210 && !NPC.savedGoblin && !NPC.AnyNPCs(105)) + NPC.NewNPC(index1 * 16 + 8, y * 16, 105); + else if (Main.hardMode && Main.rand.Next(20) == 0 && !flag6 && (double) y >= Main.rockLayer && y < Main.maxTilesY - 210 && !NPC.savedWizard && !NPC.AnyNPCs(106)) + NPC.NewNPC(index1 * 16 + 8, y * 16, 106); + else if (flag11) + { + if (flag6) + { + if ((double) y < Main.worldSurface && y > 50 && Main.rand.Next(3) != 0 && Main.dayTime) + { + int num27 = -1; + for (int j = y - 1; j > y - 50; --j) + { + if (Main.tile[index1, j].liquid == (byte) 0 && !WorldGen.SolidTile(index1, j) && !WorldGen.SolidTile(index1, j + 1) && !WorldGen.SolidTile(index1, j + 2)) + { + num27 = j + 2; break; } - if (Main.rand.Next(9) == 0) + } + if (num27 > y) + num27 = y; + if (num27 > 0 && !flag15) + { + if (Main.rand.Next(2) == 0) + NPC.NewNPC(index1 * 16 + 8, num27 * 16, 362); + else + NPC.NewNPC(index1 * 16 + 8, num27 * 16, 364); + } + else + NPC.NewNPC(index1 * 16 + 8, y * 16, 55); + } + else + NPC.NewNPC(index1 * 16 + 8, y * 16, 55); + } + else + { + switch (type) + { + case 2: + case 109: + if (Main.raining) { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 29); + if (Main.rand.Next(NPC.goldCritterChance) == 0) + { + NPC.NewNPC(index1 * 16 + 8, y * 16, 448); + break; + } + if (Main.rand.Next(3) != 0) + { + NPC.NewNPC(index1 * 16 + 8, y * 16, 357); + break; + } + NPC.NewNPC(index1 * 16 + 8, y * 16, 230); + break; + } + if (!Main.dayTime && Main.rand.Next(NPC.fireFlyFriendly) == 0 && (double) y <= Main.worldSurface) + { + int Type4 = 355; + if (type == 109) + Type4 = 358; + NPC.NewNPC(index1 * 16 + 8, y * 16, Type4); + if (Main.rand.Next(NPC.fireFlyMultiple) == 0) + NPC.NewNPC(index1 * 16 + 8 - 16, y * 16, Type4); + if (Main.rand.Next(NPC.fireFlyMultiple) == 0) + NPC.NewNPC(index1 * 16 + 8 + 16, y * 16, Type4); + if (Main.rand.Next(NPC.fireFlyMultiple) == 0) + NPC.NewNPC(index1 * 16 + 8, y * 16 - 16, Type4); + if (Main.rand.Next(NPC.fireFlyMultiple) == 0) + { + NPC.NewNPC(index1 * 16 + 8, y * 16 + 16, Type4); + break; + } + break; + } + if (Main.dayTime && Main.time < 18000.0 && Main.rand.Next(3) != 0 && (double) y <= Main.worldSurface) + { + int num28 = Main.rand.Next(4); + if (Main.rand.Next(NPC.goldCritterChance) == 0) + { + NPC.NewNPC(index1 * 16 + 8, y * 16, 442); + break; + } + switch (num28) + { + case 0: + NPC.NewNPC(index1 * 16 + 8, y * 16, 297); + break; + case 1: + NPC.NewNPC(index1 * 16 + 8, y * 16, 298); + break; + default: + NPC.NewNPC(index1 * 16 + 8, y * 16, 74); + break; + } + } + else + { + if (Main.dayTime && Main.rand.Next(NPC.butterflyChance) == 0 && (double) y <= Main.worldSurface) + { + if (Main.rand.Next(NPC.goldCritterChance) == 0) + NPC.NewNPC(index1 * 16 + 8, y * 16, 444); + else + NPC.NewNPC(index1 * 16 + 8, y * 16, 356); + if (Main.rand.Next(4) == 0) + NPC.NewNPC(index1 * 16 + 8 - 16, y * 16, 356); + if (Main.rand.Next(4) == 0) + { + NPC.NewNPC(index1 * 16 + 8 + 16, y * 16, 356); + break; + } + break; + } + if (Main.rand.Next(2) == 0 && (double) y <= Main.worldSurface) + { + int num29 = Main.rand.Next(4); + if (Main.rand.Next(NPC.goldCritterChance) == 0) + { + NPC.NewNPC(index1 * 16 + 8, y * 16, 442); + break; + } + switch (num29) + { + case 0: + NPC.NewNPC(index1 * 16 + 8, y * 16, 297); + break; + case 1: + NPC.NewNPC(index1 * 16 + 8, y * 16, 298); + break; + default: + NPC.NewNPC(index1 * 16 + 8, y * 16, 74); + break; + } + } + else + { + if (type == 53) + { + NPC.NewNPC(index1 * 16 + 8, y * 16, Main.rand.Next(366, 368)); + break; + } + if (Main.rand.Next(NPC.goldCritterChance) == 0) + { + NPC.NewNPC(index1 * 16 + 8, y * 16, 443); + break; + } + if (Main.rand.Next(NPC.goldCritterChance) == 0 && (double) y <= Main.worldSurface) + { + NPC.NewNPC(index1 * 16 + 8, y * 16, 539); + break; + } + if (Main.halloween && Main.rand.Next(3) != 0) + { + NPC.NewNPC(index1 * 16 + 8, y * 16, 303); + break; + } + if (Main.xMas && Main.rand.Next(3) != 0) + { + NPC.NewNPC(index1 * 16 + 8, y * 16, 337); + break; + } + if (BirthdayParty.PartyIsUp && Main.rand.Next(3) != 0) + { + NPC.NewNPC(index1 * 16 + 8, y * 16, 540); + break; + } + if (Main.rand.Next(3) == 0 && (double) y <= Main.worldSurface) + { + NPC.NewNPC(index1 * 16 + 8, y * 16, (int) Utils.SelectRandom(Main.rand, (short) 299, (short) 538)); + break; + } + NPC.NewNPC(index1 * 16 + 8, y * 16, 46); + break; + } + } + break; + case 60: + if (Main.rand.Next(NPC.goldCritterChance) == 0) + { + NPC.NewNPC(index1 * 16 + 8, y * 16, 445); + break; + } + NPC.NewNPC(index1 * 16 + 8, y * 16, 361); + break; + case 147: + case 161: + if (Main.rand.Next(2) == 0) + { + NPC.NewNPC(index1 * 16 + 8, y * 16, 148); + break; + } + NPC.NewNPC(index1 * 16 + 8, y * 16, 149); + break; + default: + if ((double) y <= Main.worldSurface) + return; + goto case 2; + } + } + } + else if (Main.player[plr].ZoneDungeon) + { + int num30 = 0; + if (Main.tile[index1, y].wall == (byte) 94 || Main.tile[index1, y].wall == (byte) 96 || Main.tile[index1, y].wall == (byte) 98) + num30 = 1; + if (Main.tile[index1, y].wall == (byte) 95 || Main.tile[index1, y].wall == (byte) 97 || Main.tile[index1, y].wall == (byte) 99) + num30 = 2; + if (Main.rand.Next(7) == 0) + num30 = Main.rand.Next(3); + if (!NPC.downedBoss3) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 68); + else if (!NPC.savedMech && Main.rand.Next(5) == 0 && !flag6 && !NPC.AnyNPCs(123) && (double) y > Main.rockLayer) + NPC.NewNPC(index1 * 16 + 8, y * 16, 123); + else if (flag13 && Main.rand.Next(30) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 287); + else if (flag13 && num30 == 0 && Main.rand.Next(15) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 293); + else if (flag13 && num30 == 1 && Main.rand.Next(15) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 291); + else if (flag13 && num30 == 2 && Main.rand.Next(15) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 292); + else if (flag13 && !NPC.AnyNPCs(290) && num30 == 0 && Main.rand.Next(35) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 290); + else if (flag13 && (num30 == 1 || num30 == 2) && Main.rand.Next(30) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 289); + else if (flag13 && Main.rand.Next(20) == 0) + { + int num31 = 281; + if (num30 == 0) + num31 += 2; + if (num30 == 2) + num31 += 4; + int Type5 = num31 + Main.rand.Next(2); + if (!NPC.AnyNPCs(Type5)) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, Type5); + } + else if (flag13 && Main.rand.Next(3) != 0) + { + int num32 = 269; + if (num30 == 0) + num32 += 4; + if (num30 == 2) + num32 += 8; + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, num32 + Main.rand.Next(4)); + } + else if (Main.rand.Next(37) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 71); + else if (num30 == 1 && Main.rand.Next(4) == 0 && !NPC.NearSpikeBall(index1, y)) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 70); + else if (num30 == 2 && Main.rand.Next(15) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 72); + else if (num30 == 0 && Main.rand.Next(9) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 34); + else if (Main.rand.Next(7) == 0) + { + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 32); + } + else + { + switch (Main.rand.Next(5)) + { + case 0: + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 294); + break; + case 1: + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 295); + break; + case 2: + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 296); + break; + default: + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 31); + if (Main.rand.Next(4) == 0) + { + Main.npc[newNPC].SetDefaults(-14); break; } if (Main.rand.Next(5) == 0) { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 26); + Main.npc[newNPC].SetDefaults(-13); break; } - if (Main.rand.Next(3) == 0) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 111); - break; - } - if (Main.rand.Next(3) == 0) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 27); - break; - } - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 28); break; + } + } + } + else if (Main.player[plr].ZoneMeteor) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 23); + else if (DD2Event.Ongoing && Main.player[plr].ZoneOldOneArmy) + DD2Event.SpawnNPC(ref newNPC); + else if ((double) y <= Main.worldSurface && !Main.dayTime && Main.snowMoon) + { + int waveNumber = NPC.waveNumber; + if (Main.rand.Next(30) == 0 && NPC.CountNPCS(341) < 4) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 341); + else if (waveNumber >= 20) + { + switch (Main.rand.Next(3)) + { + case 0: + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 345); + break; + case 1: + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 346); + break; + default: + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 344); + break; + } + } + else if (waveNumber >= 19) + newNPC = Main.rand.Next(10) != 0 || NPC.CountNPCS(345) >= 4 ? (Main.rand.Next(10) != 0 || NPC.CountNPCS(346) >= 5 ? (Main.rand.Next(10) != 0 || NPC.CountNPCS(344) >= 7 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 343) : NPC.NewNPC(index1 * 16 + 8, y * 16, 344)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 346)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 345); + else if (waveNumber >= 18) + newNPC = Main.rand.Next(10) != 0 || NPC.CountNPCS(345) >= 3 ? (Main.rand.Next(10) != 0 || NPC.CountNPCS(346) >= 4 ? (Main.rand.Next(10) != 0 || NPC.CountNPCS(344) >= 6 ? (Main.rand.Next(3) != 0 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 343) : NPC.NewNPC(index1 * 16 + 8, y * 16, 351)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 348)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 344)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 346)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 345); + else if (waveNumber >= 17) + newNPC = Main.rand.Next(10) != 0 || NPC.CountNPCS(345) >= 2 ? (Main.rand.Next(10) != 0 || NPC.CountNPCS(346) >= 3 ? (Main.rand.Next(10) != 0 || NPC.CountNPCS(344) >= 5 ? (Main.rand.Next(4) != 0 ? (Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 343) : NPC.NewNPC(index1 * 16 + 8, y * 16, 351)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 347)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 344)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 346)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 345); + else if (waveNumber >= 16) + newNPC = Main.rand.Next(10) != 0 || NPC.CountNPCS(345) >= 2 ? (Main.rand.Next(10) != 0 || NPC.CountNPCS(346) >= 2 ? (Main.rand.Next(10) != 0 || NPC.CountNPCS(344) >= 4 ? (Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 343) : NPC.NewNPC(index1 * 16 + 8, y * 16, 352)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 344)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 346)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 345); + else if (waveNumber >= 15) + newNPC = Main.rand.Next(10) != 0 || NPC.AnyNPCs(345) ? (Main.rand.Next(10) != 0 || NPC.CountNPCS(346) >= 2 ? (Main.rand.Next(10) != 0 || NPC.CountNPCS(344) >= 3 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 343) : NPC.NewNPC(index1 * 16 + 8, y * 16, 347)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 344)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 346)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 345); + else if (waveNumber == 14) + { + if (Main.rand.Next(10) == 0 && !NPC.AnyNPCs(345)) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 345); + else if (Main.rand.Next(10) == 0 && !NPC.AnyNPCs(346)) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 346); + else if (Main.rand.Next(10) == 0 && !NPC.AnyNPCs(344)) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 344); + else if (Main.rand.Next(3) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 343); + } + else + newNPC = waveNumber != 13 ? (waveNumber != 12 ? (waveNumber != 11 ? (waveNumber != 10 ? (waveNumber != 9 ? (waveNumber != 8 ? (waveNumber != 7 ? (waveNumber != 6 ? (waveNumber != 5 ? (waveNumber != 4 ? (waveNumber != 3 ? (waveNumber != 2 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, Main.rand.Next(338, 341)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 342)) : (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, Main.rand.Next(338, 341)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 350))) : (Main.rand.Next(8) != 0 ? (Main.rand.Next(4) != 0 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, Main.rand.Next(338, 341)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 342)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 350)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 348))) : (Main.rand.Next(10) != 0 || NPC.AnyNPCs(344) ? (Main.rand.Next(4) != 0 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, Main.rand.Next(338, 341)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 342)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 350)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 344))) : (Main.rand.Next(10) != 0 || NPC.AnyNPCs(344) ? (Main.rand.Next(4) != 0 ? (Main.rand.Next(8) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, Main.rand.Next(338, 341)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 348)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 350)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 344))) : (Main.rand.Next(10) != 0 || NPC.CountNPCS(344) >= 2 ? (Main.rand.Next(4) != 0 ? (Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 350) : NPC.NewNPC(index1 * 16 + 8, y * 16, 348)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 347)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 344))) : (Main.rand.Next(10) != 0 || NPC.AnyNPCs(346) ? (Main.rand.Next(3) != 0 ? (Main.rand.Next(4) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, Main.rand.Next(338, 341)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 350)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 342)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 346))) : (Main.rand.Next(10) != 0 || NPC.AnyNPCs(346) ? (Main.rand.Next(8) != 0 ? (Main.rand.Next(3) != 0 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 350) : NPC.NewNPC(index1 * 16 + 8, y * 16, 347)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 348)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 351)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 346))) : (Main.rand.Next(10) != 0 || NPC.AnyNPCs(346) ? (Main.rand.Next(10) != 0 || NPC.AnyNPCs(344) ? (Main.rand.Next(2) != 0 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 342) : NPC.NewNPC(index1 * 16 + 8, y * 16, 347)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 348)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 344)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 346))) : (Main.rand.Next(10) != 0 || NPC.AnyNPCs(346) ? (Main.rand.Next(10) != 0 || NPC.CountNPCS(344) >= 2 ? (Main.rand.Next(6) != 0 ? (Main.rand.Next(3) != 0 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, Main.rand.Next(338, 341)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 347)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 348)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 351)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 344)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 346))) : (Main.rand.Next(10) != 0 || NPC.AnyNPCs(345) ? (Main.rand.Next(6) != 0 ? (Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, Main.rand.Next(338, 341)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 342)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 352)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 345))) : (Main.rand.Next(10) != 0 || NPC.AnyNPCs(345) ? (Main.rand.Next(10) != 0 || NPC.AnyNPCs(344) ? (Main.rand.Next(8) != 0 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, Main.rand.Next(338, 341)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 342)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 343)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 344)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 345))) : (Main.rand.Next(10) != 0 || NPC.AnyNPCs(345) ? (Main.rand.Next(10) != 0 || NPC.AnyNPCs(346) ? (Main.rand.Next(3) != 0 ? (Main.rand.Next(6) != 0 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 347) : NPC.NewNPC(index1 * 16 + 8, y * 16, 342)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 343)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 352)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 346)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 345)); + } + else if ((double) y <= Main.worldSurface && !Main.dayTime && Main.pumpkinMoon) + { + int waveNumber = NPC.waveNumber; + int num33; + if (NPC.waveNumber >= 15) + { + newNPC = Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 325) : NPC.NewNPC(index1 * 16 + 8, y * 16, 327); + } + else + { + switch (waveNumber) + { case 2: - if (Main.rand.Next(7) == 0) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 145); - break; - } - if (Main.rand.Next(3) == 0) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 143); - break; - } - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 144); + newNPC = Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, Main.rand.Next(305, 315)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 326); break; case 3: - if (Main.invasionSize < Main.invasionSizeStart / 2 && Main.rand.Next(20) == 0 && !NPC.AnyNPCs(491) && !Collision.SolidTiles(index1 - 20, index1 + 20, index2 - 40, index2 - 10)) - { - NPC.NewNPC(index1 * 16 + 8, (index2 - 10) * 16, 491); - break; - } - if (Main.rand.Next(30) == 0 && !NPC.AnyNPCs(216)) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 216); - break; - } - if (Main.rand.Next(11) == 0) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 215); - break; - } - if (Main.rand.Next(9) == 0) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 252); - break; - } - if (Main.rand.Next(7) == 0) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 214); - break; - } - if (Main.rand.Next(3) == 0) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 213); - break; - } - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 212); + newNPC = Main.rand.Next(6) != 0 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, Main.rand.Next(305, 315)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 326)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 329); break; case 4: - int Type1 = 0; - int num25 = Main.rand.Next(7); - bool flag23 = (double) (Main.invasionSizeStart - Main.invasionSize) / (double) Main.invasionSizeStart >= 0.300000011920929 && !NPC.AnyNPCs(395); - if (Main.rand.Next(45) == 0 & flag23) - Type1 = 395; - else if (num25 >= 6) - { - if (Main.rand.Next(20) == 0 & flag23) - { - Type1 = 395; - } - else - { - int num26 = Main.rand.Next(2); - if (num26 == 0) - Type1 = 390; - if (num26 == 1) - Type1 = 386; - } - } - else if (num25 >= 4) - { - int num27 = Main.rand.Next(5); - Type1 = num27 >= 2 ? (num27 >= 4 ? 388 : 381) : 382; - } - else - { - int num28 = Main.rand.Next(4); - if (num28 == 3) - { - if (!NPC.AnyNPCs(520)) - Type1 = 520; - else - num28 = Main.rand.Next(3); - } - if (num28 == 0) - Type1 = 385; - if (num28 == 1) - Type1 = 389; - if (num28 == 2) - Type1 = 383; - } - if (Type1 != 0) - { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, Type1, 1); - break; - } + newNPC = Main.rand.Next(10) != 0 || NPC.AnyNPCs(325) ? (Main.rand.Next(10) != 0 ? (Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, Main.rand.Next(305, 315)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 326)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 329)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 325); + break; + case 5: + newNPC = Main.rand.Next(10) != 0 || NPC.AnyNPCs(325) ? (Main.rand.Next(8) != 0 ? (Main.rand.Next(5) != 0 ? (Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, Main.rand.Next(305, 315)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 326)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 329)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 330)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 325); + break; + case 6: + newNPC = Main.rand.Next(7) != 0 || NPC.CountNPCS(325) >= 2 ? (Main.rand.Next(6) != 0 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 326) : NPC.NewNPC(index1 * 16 + 8, y * 16, 329)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 330)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 325); + break; + case 7: + newNPC = Main.rand.Next(10) != 0 || NPC.AnyNPCs(327) ? (Main.rand.Next(8) != 0 ? (Main.rand.Next(5) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, Main.rand.Next(305, 315)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 329)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 330)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 327); + break; + case 8: + newNPC = Main.rand.Next(10) != 0 || NPC.AnyNPCs(327) ? (Main.rand.Next(5) != 0 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 326) : NPC.NewNPC(index1 * 16 + 8, y * 16, 329)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 330)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 327); + break; + case 9: + newNPC = Main.rand.Next(8) != 0 || NPC.AnyNPCs(327) ? (Main.rand.Next(8) != 0 || NPC.AnyNPCs(325) ? (Main.rand.Next(10) != 0 || NPC.AnyNPCs(315) ? NPC.NewNPC(index1 * 16 + 8, y * 16, Main.rand.Next(305, 315)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 315)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 325)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 327); + break; + case 10: + newNPC = Main.rand.Next(10) != 0 || NPC.AnyNPCs(327) ? (Main.rand.Next(10) != 0 || NPC.AnyNPCs(325) ? (Main.rand.Next(10) != 0 || NPC.AnyNPCs(315) ? (Main.rand.Next(8) != 0 ? (Main.rand.Next(5) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 326) : NPC.NewNPC(index1 * 16 + 8, y * 16, 329)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 330)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 315)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 325)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 327); + break; + case 11: + if (Main.rand.Next(10) == 0 && !NPC.AnyNPCs(327)) + num33 = NPC.NewNPC(index1 * 16 + 8, y * 16, 327); + newNPC = Main.rand.Next(7) != 0 || NPC.CountNPCS(325) >= 2 ? (Main.rand.Next(10) != 0 || NPC.AnyNPCs(315) ? (Main.rand.Next(10) != 0 ? (Main.rand.Next(7) != 0 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, Main.rand.Next(305, 315)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 326)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 329)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 330)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 315)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 325); + break; + case 12: + if (Main.rand.Next(7) == 0 && NPC.CountNPCS(327) < 2) + num33 = NPC.NewNPC(index1 * 16 + 8, y * 16, 327); + newNPC = Main.rand.Next(7) != 0 || NPC.CountNPCS(325) >= 2 ? (Main.rand.Next(7) != 0 || NPC.CountNPCS(315) >= 2 ? (Main.rand.Next(7) != 0 ? (Main.rand.Next(5) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 326) : NPC.NewNPC(index1 * 16 + 8, y * 16, 329)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 330)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 315)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 325); + break; + case 13: + if (Main.rand.Next(7) == 0 && NPC.CountNPCS(327) < 2) + num33 = NPC.NewNPC(index1 * 16 + 8, y * 16, 327); + newNPC = Main.rand.Next(5) != 0 || NPC.CountNPCS(325) >= 3 ? (Main.rand.Next(5) != 0 || NPC.CountNPCS(315) >= 3 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 329) : NPC.NewNPC(index1 * 16 + 8, y * 16, 330)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 315)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 325); + break; + case 14: + newNPC = Main.rand.Next(5) != 0 || NPC.CountNPCS(327) >= 3 ? (Main.rand.Next(5) != 0 || NPC.CountNPCS(325) >= 3 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 315) : NPC.NewNPC(index1 * 16 + 8, y * 16, 325)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 327); + break; + default: + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, Main.rand.Next(305, 315)); break; } } - else if (num24 == 244) + } + else if ((double) y <= Main.worldSurface && Main.dayTime && Main.eclipse) + { + bool flag21 = false; + if (NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3) + flag21 = true; + newNPC = !flag21 || Main.rand.Next(80) != 0 || NPC.AnyNPCs(477) ? (Main.rand.Next(50) != 0 || NPC.AnyNPCs(251) ? (!NPC.downedPlantBoss || Main.rand.Next(5) != 0 || NPC.AnyNPCs(466) ? (!NPC.downedPlantBoss || Main.rand.Next(20) != 0 || NPC.AnyNPCs(463) ? (!NPC.downedPlantBoss || Main.rand.Next(20) != 0 || NPC.CountNPCS(467) >= 2 ? (Main.rand.Next(15) != 0 ? (!flag21 || Main.rand.Next(13) != 0 ? (Main.rand.Next(8) != 0 ? (!NPC.downedPlantBoss || Main.rand.Next(7) != 0 ? (!NPC.downedPlantBoss || Main.rand.Next(5) != 0 ? (Main.rand.Next(4) != 0 ? (Main.rand.Next(3) != 0 ? (Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 166) : NPC.NewNPC(index1 * 16 + 8, y * 16, 462)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 461)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 162)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 460)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 468)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 469)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 253)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 159)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 467)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 463)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 466)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 251)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 477); + } + else if (((!Main.hardMode ? 0 : (num1 == 70 ? 1 : 0)) & (flag6 ? 1 : 0)) != 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 256); + else if (num1 == 70 && (double) y <= Main.worldSurface && Main.rand.Next(3) != 0) + { + if (!Main.hardMode && Main.rand.Next(6) == 0 || Main.rand.Next(12) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 360); + else if (Main.rand.Next(3) == 0) { - if (flag7) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 55); - else if ((double) index2 > Main.worldSurface) - { - if (Main.rand.Next(3) == 0) - { - if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 447); - else - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 300); - } - else if (Main.rand.Next(2) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 359); - else if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 448); - else if (Main.rand.Next(3) != 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 357); - } - else if (Main.player[index5].RollLuck(2) == 0) - { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 624); - Main.npc[newNPC].timeLeft *= 10; - } - else if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 443); - else if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 539); - else if (Main.halloween && Main.rand.Next(3) != 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 303); - else if (Main.xMas && Main.rand.Next(3) != 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 337); - else if (BirthdayParty.PartyIsUp && Main.rand.Next(3) != 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 540); - else if (Main.rand.Next(3) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, (int) Utils.SelectRandom(Main.rand, (short) 299, (short) 538)); - else - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 46); - } - else if (!NPC.savedBartender && DD2Event.ReadyToFindBartender && !NPC.AnyNPCs(579) && Main.rand.Next(80) == 0 && !flag7) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 579); - else if (Main.tile[index1, index2].wall == (ushort) 62 | flag11) - { - if (Main.tile[index1, index2].wall == (ushort) 62 && Main.rand.Next(8) == 0 && !flag7 && (double) index2 >= Main.rockLayer && index2 < Main.maxTilesY - 210 && !NPC.savedStylist && !NPC.AnyNPCs(354)) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 354); - else if (Main.hardMode && Main.rand.Next(10) != 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 163); - else - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 164); - } - else if (((WallID.Sets.Conversion.HardenedSand[(int) Main.tile[index1, index2].wall] ? 1 : (WallID.Sets.Conversion.Sandstone[(int) Main.tile[index1, index2].wall] ? 1 : 0)) | (flag13 ? 1 : 0)) != 0 && WorldGen.checkUnderground(index1, index2) && NPC.Spawning_FlyingAntlionCheck(index1, index2)) - { - float num29 = 1f; - if ((double) index2 > (Main.rockLayer * 2.0 + (double) Main.maxTilesY) / 3.0) - num29 *= 0.5f; - else if ((double) index2 > Main.rockLayer) - num29 *= 0.75f; - if (Main.rand.Next(20) == 0 && !flag7 && !NPC.savedGolfer && !NPC.AnyNPCs(589)) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 589); - else if (Main.hardMode && Main.rand.Next((int) (33.0 * (double) num29)) == 0 && !flag5 && (double) index2 > Main.worldSurface + 100.0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 510); - else if (Main.rand.Next((int) (33.0 * (double) num29)) == 0 && !flag5 && (double) index2 > Main.worldSurface + 100.0 && NPC.CountNPCS(513) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 513); - else if (Main.hardMode && Main.rand.Next(5) != 0) - { - List intList = new List(); - if (Main.player[index5].ZoneCorrupt) - { - intList.Add(525); - intList.Add(525); - } - if (Main.player[index5].ZoneCrimson) - { - intList.Add(526); - intList.Add(526); - } - if (Main.player[index5].ZoneHallow) - { - intList.Add(527); - intList.Add(527); - } - if (intList.Count == 0) - { - intList.Add(524); - intList.Add(524); - } - if (Main.player[index5].ZoneCorrupt || Main.player[index5].ZoneCrimson) - { - intList.Add(533); - intList.Add(529); - } - else - { - intList.Add(530); - intList.Add(528); - } - intList.Add(532); - int Type2 = Utils.SelectRandom(Main.rand, intList.ToArray()); - NPC.NewNPC(index1 * 16 + 8, index2 * 16, Type2); - intList.Clear(); - } - else - { - int Type3 = Utils.SelectRandom(Main.rand, 69, 580, 580, 580, 581); - if (Main.rand.Next(15) == 0) - Type3 = 537; - else if (Main.rand.Next(10) == 0) - { - switch (Type3) - { - case 580: - Type3 = 508; - break; - case 581: - Type3 = 509; - break; - } - } - NPC.NewNPC(index1 * 16 + 8, index2 * 16, Type3); - } - } - else if (Main.hardMode & flag7 && Main.player[index5].ZoneJungle && Main.rand.Next(3) != 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 157); - else if (Main.hardMode & flag7 && Main.player[index5].ZoneCrimson && Main.rand.Next(3) != 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 242); - else if (Main.hardMode & flag7 && Main.player[index5].ZoneCrimson && Main.rand.Next(3) != 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 241); - else if (((!flag12 ? 1 : (NPC.savedAngler ? 0 : (!NPC.AnyNPCs(376) ? 1 : 0))) & (flag7 ? 1 : 0)) != 0 && ((index1 < WorldGen.oceanDistance || index1 > Main.maxTilesX - WorldGen.oceanDistance) && Main.tileSand[tileType] && (double) index2 < Main.rockLayer || num1 == 53 && WorldGen.oceanDepths(index1, index2))) - { - bool flag24 = false; - if (!NPC.savedAngler && !NPC.AnyNPCs(376) && (double) index2 < Main.worldSurface - 10.0) - { - int num30 = -1; - for (int j = index2 - 1; j > index2 - 50; --j) - { - if (Main.tile[index1, j].liquid == (byte) 0 && !WorldGen.SolidTile(index1, j) && !WorldGen.SolidTile(index1, j + 1) && !WorldGen.SolidTile(index1, j + 2)) - { - num30 = j + 2; - break; - } - } - if (num30 > index2) - num30 = index2; - if (num30 > 0 && !flag16) - { - NPC.NewNPC(index1 * 16 + 8, num30 * 16, 376); - flag24 = true; - } - } - if (!flag24) - { - int num31 = -1; - int num32 = -1; - if ((double) index2 < Main.worldSurface && index2 > 50) - { - for (int j = index2 - 1; j > index2 - 50; --j) - { - if (Main.tile[index1, j].liquid == (byte) 0 && !WorldGen.SolidTile(index1, j) && !WorldGen.SolidTile(index1, j + 1) && !WorldGen.SolidTile(index1, j + 2)) - { - num31 = j + 2; - if (!WorldGen.SolidTile(index1, num31 + 1) && !WorldGen.SolidTile(index1, num31 + 2)) - { - num32 = num31 + 2; - break; - } - break; - } - } - if (num31 > index2) - num31 = index2; - if (num32 > index2) - num32 = index2; - } - if (num31 > 0 && !flag16 && Main.rand.Next(10) == 0) - NPC.NewNPC(index1 * 16 + 8, num31 * 16, 602); - else if (Main.rand.Next(10) == 0) - { - int num33 = Main.rand.Next(3); - if (num33 == 0 && num31 > 0) - NPC.NewNPC(index1 * 16 + 8, num31 * 16, 625); - else if (num33 == 1 && num32 > 0) - NPC.NewNPC(index1 * 16 + 8, num32 * 16, 615); - else if (num33 == 2 && num32 > 0) - { - if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - NPC.NewNPC(index1 * 16 + 8, num32 * 16, 627); - else - NPC.NewNPC(index1 * 16 + 8, num32 * 16, 626); - } - } - else if (Main.rand.Next(40) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 220); - else if (Main.rand.Next(18) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 221); - else if (Main.rand.Next(8) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 65); - else if (Main.rand.Next(3) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 67); - else - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 64); - } - } - else if (!flag7 && !NPC.savedAngler && !NPC.AnyNPCs(376) && (index1 < WorldGen.beachDistance || index1 > Main.maxTilesX - WorldGen.beachDistance) && Main.tileSand[tileType] && (double) index2 < Main.worldSurface) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 376); - else if (!flag12 & flag7 && ((double) index2 > Main.rockLayer && Main.rand.Next(2) == 0 || tileType == 60)) - { - bool flag25 = false; - if (tileType == 60 && (double) index2 < Main.worldSurface && index2 > 50 && Main.rand.Next(3) == 0 && Main.dayTime) - { - int num34 = -1; - for (int j = index2 - 1; j > index2 - 50; --j) - { - if (Main.tile[index1, j].liquid == (byte) 0 && !WorldGen.SolidTile(index1, j) && !WorldGen.SolidTile(index1, j + 1) && !WorldGen.SolidTile(index1, j + 2)) - { - num34 = j + 2; - break; - } - } - if (num34 > index2) - num34 = index2; - if (num34 > 0 && !flag16) - { - flag25 = true; - if (Main.rand.Next(4) == 0) - { - flag25 = true; - NPC.NewNPC(index1 * 16 + 8, num34 * 16, 617); - } - else if (!flag1 && (double) Main.cloudAlpha == 0.0) - { - flag25 = true; - int num35 = Main.rand.Next(1, 4); - for (int index30 = 0; index30 < num35; ++index30) - { - if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - NPC.NewNPC(index1 * 16 + 8 + Main.rand.Next(-16, 17), num34 * 16 - 16, 613); - else - NPC.NewNPC(index1 * 16 + 8 + Main.rand.Next(-16, 17), num34 * 16 - 16, 612); - } - } - } - } - if (!flag25) - { - if (Main.hardMode && Main.rand.Next(3) > 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 102); - else - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 58); - } - } - else if (!flag12 & flag7 && (double) index2 > Main.worldSurface && Main.rand.Next(3) == 0) - { - if (Main.hardMode && Main.rand.Next(3) > 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 103); - else - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 63); - } - else if (flag7 && Main.rand.Next(4) == 0 && (index1 > WorldGen.oceanDistance && index1 < Main.maxTilesX - WorldGen.oceanDistance || (double) index2 > Main.worldSurface + 50.0)) - { - if (Main.player[index5].ZoneCorrupt) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 57); - else if ((double) index2 < Main.worldSurface && index2 > 50 && Main.rand.Next(3) != 0 && Main.dayTime) - { - int num36 = -1; - for (int j = index2 - 1; j > index2 - 50; --j) - { - if (Main.tile[index1, j].liquid == (byte) 0 && !WorldGen.SolidTile(index1, j) && !WorldGen.SolidTile(index1, j + 1) && !WorldGen.SolidTile(index1, j + 2)) - { - num36 = j + 2; - break; - } - } - if (num36 > index2) - num36 = index2; - if (num36 > 0 && !flag16) - { - if (Main.rand.Next(5) == 0 && (num1 == 2 || num1 == 477)) - NPC.NewNPC(index1 * 16 + 8, num36 * 16, 616); - else if (num1 == 53) - { - if (Main.rand.Next(2) == 0 && !flag1 && (double) Main.cloudAlpha == 0.0) - { - int num37 = Main.rand.Next(1, 4); - for (int index31 = 0; index31 < num37; ++index31) - { - if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - NPC.NewNPC(index1 * 16 + 8 + Main.rand.Next(-16, 17), num36 * 16 - 16, 613); - else - NPC.NewNPC(index1 * 16 + 8 + Main.rand.Next(-16, 17), num36 * 16 - 16, 612); - } - } - else - NPC.NewNPC(index1 * 16 + 8, num36 * 16, 608); - } - else if (Main.rand.Next(2) == 0) - NPC.NewNPC(index1 * 16 + 8, num36 * 16, 362); - else - NPC.NewNPC(index1 * 16 + 8, num36 * 16, 364); - } - else if (num1 == 53) - NPC.NewNPC(index1 * 16 + 8, num36 * 16, 607); - else if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 592); - else - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 55); - } - else if (num1 == 53) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 607); - else if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 592); - else - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 55); - } - else if (NPC.downedGoblins && Main.player[index5].RollLuck(20) == 0 && !flag7 && (double) index2 >= Main.rockLayer && index2 < Main.maxTilesY - 210 && !NPC.savedGoblin && !NPC.AnyNPCs(105)) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 105); - else if (Main.hardMode && Main.player[index5].RollLuck(20) == 0 && !flag7 && (double) index2 >= Main.rockLayer && index2 < Main.maxTilesY - 210 && !NPC.savedWizard && !NPC.AnyNPCs(106)) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 106); - else if (flag12) - { - if (Main.player[index5].ZoneGraveyard) - { - if (!flag7) - { - if (Main.rand.Next(2) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 606); - else - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 610); - } - } - else if ((double) index2 <= Main.worldSurface && (index1 < WorldGen.beachDistance || index1 > Main.maxTilesX - WorldGen.beachDistance)) - { - if (flag7) - { - int num38 = -1; - int num39 = -1; - if ((double) index2 < Main.worldSurface && index2 > 50) - { - for (int j = index2 - 1; j > index2 - 50; --j) - { - if (Main.tile[index1, j].liquid == (byte) 0 && !WorldGen.SolidTile(index1, j) && !WorldGen.SolidTile(index1, j + 1) && !WorldGen.SolidTile(index1, j + 2)) - { - num38 = j + 2; - if (!WorldGen.SolidTile(index1, num38 + 1) && !WorldGen.SolidTile(index1, num38 + 2)) - { - num39 = num38 + 2; - break; - } - break; - } - } - if (num38 > index2) - num38 = index2; - if (num39 > index2) - num39 = index2; - } - if (Main.rand.Next(2) == 0) - { - int num40 = Main.rand.Next(3); - if (num40 == 0 && num38 > 0) - NPC.NewNPC(index1 * 16 + 8, num38 * 16, 625); - else if (num40 == 1 && num39 > 0) - NPC.NewNPC(index1 * 16 + 8, num39 * 16, 615); - else if (num40 == 2 && num39 > 0) - { - if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - NPC.NewNPC(index1 * 16 + 8, num39 * 16, 627); - else - NPC.NewNPC(index1 * 16 + 8, num39 * 16, 626); - } - } - else if (num38 > 0 && !flag16) - NPC.NewNPC(index1 * 16 + 8, num38 * 16, 602); - } - else - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 602); - } - else - { - int cattailX; - int cattailY; - if ((tileType == 2 || tileType == 477 || tileType == 53) && !windyForButterflies && !Main.raining && Main.dayTime && Main.rand.Next(2) == 0 && (double) index2 <= Main.worldSurface && NPC.FindCattailTop(index1, index2, out cattailX, out cattailY)) - { - if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - NPC.NewNPC(cattailX * 16 + 8, cattailY * 16, 601); - else - NPC.NewNPC(cattailX * 16 + 8, cattailY * 16, NPC.RollDragonflyType(tileType)); - if (Main.rand.Next(3) == 0) - NPC.NewNPC(cattailX * 16 + 8 - 16, cattailY * 16, NPC.RollDragonflyType(tileType)); - if (Main.rand.Next(3) == 0) - NPC.NewNPC(cattailX * 16 + 8 + 16, cattailY * 16, NPC.RollDragonflyType(tileType)); - } - else if (flag7) - { - if ((double) index2 < Main.worldSurface && index2 > 50 && Main.rand.Next(3) != 0 && Main.dayTime) - { - int num41 = -1; - for (int j = index2 - 1; j > index2 - 50; --j) - { - if (Main.tile[index1, j].liquid == (byte) 0 && !WorldGen.SolidTile(index1, j) && !WorldGen.SolidTile(index1, j + 1) && !WorldGen.SolidTile(index1, j + 2)) - { - num41 = j + 2; - break; - } - } - if (num41 > index2) - num41 = index2; - if (num41 > 0 && !flag16) - { - switch (num1) - { - case 53: - if (Main.rand.Next(2) == 0 && !flag1 && (double) Main.cloudAlpha == 0.0) - { - int num42 = Main.rand.Next(1, 4); - for (int index32 = 0; index32 < num42; ++index32) - { - if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - NPC.NewNPC(index1 * 16 + 8 + Main.rand.Next(-16, 17), num41 * 16 - 16, 613); - else - NPC.NewNPC(index1 * 16 + 8 + Main.rand.Next(-16, 17), num41 * 16 - 16, 612); - } - break; - } - NPC.NewNPC(index1 * 16 + 8, num41 * 16, 608); - break; - case 60: - if (Main.rand.Next(2) == 0 && !flag1 && (double) Main.cloudAlpha == 0.0) - { - int num43 = Main.rand.Next(1, 4); - for (int index33 = 0; index33 < num43; ++index33) - { - if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - NPC.NewNPC(index1 * 16 + 8 + Main.rand.Next(-16, 17), num41 * 16 - 16, 613); - else - NPC.NewNPC(index1 * 16 + 8 + Main.rand.Next(-16, 17), num41 * 16 - 16, 612); - } - break; - } - NPC.NewNPC(index1 * 16 + 8, num41 * 16, 617); - break; - default: - if (Main.rand.Next(5) == 0 && (num1 == 2 || num1 == 477)) - { - NPC.NewNPC(index1 * 16 + 8, num41 * 16, 616); - break; - } - if (Main.rand.Next(2) == 0) - { - NPC.NewNPC(index1 * 16 + 8, num41 * 16, 362); - break; - } - NPC.NewNPC(index1 * 16 + 8, num41 * 16, 364); - break; - } - } - else if (num1 == 53) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 607); - else if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 592); - else - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 55); - } - else if (num1 == 53) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 607); - else if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 592); - else - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 55); - } - else - { - switch (tileType) - { - case 2: - case 109: - case 477: - case 492: - bool flag26 = (double) index2 <= Main.worldSurface; - if (Main.raining && index2 <= Main.UnderworldLayer) - { - if ((double) index2 >= Main.rockLayer && Main.rand.Next(5) == 0) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, Main.rand.Next(639, 646)); - break; - } - if ((double) index2 >= Main.rockLayer && Main.rand.Next(5) == 0) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, Main.rand.Next(646, 653)); - break; - } - if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 448); - break; - } - if (Main.rand.Next(3) != 0) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 357); - break; - } - if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 593); - break; - } - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 230); - break; - } - if (((Main.dayTime || Main.numClouds > 55 || (double) Main.cloudBGActive != 0.0 ? 0 : ((double) Star.starfallBoost > 3.0 ? 1 : 0)) & (flag26 ? 1 : 0)) != 0 && Main.player[index5].RollLuck(2) == 0) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 484); - break; - } - if (((windyForButterflies || Main.dayTime ? 0 : (Main.rand.Next(NPC.fireFlyFriendly) == 0 ? 1 : 0)) & (flag26 ? 1 : 0)) != 0) - { - int Type4 = 355; - if (tileType == 109) - Type4 = 358; - NPC.NewNPC(index1 * 16 + 8, index2 * 16, Type4); - if (Main.rand.Next(NPC.fireFlyMultiple) == 0) - NPC.NewNPC(index1 * 16 + 8 - 16, index2 * 16, Type4); - if (Main.rand.Next(NPC.fireFlyMultiple) == 0) - NPC.NewNPC(index1 * 16 + 8 + 16, index2 * 16, Type4); - if (Main.rand.Next(NPC.fireFlyMultiple) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16 - 16, Type4); - if (Main.rand.Next(NPC.fireFlyMultiple) == 0) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16 + 16, Type4); - break; - } - break; - } - if ((((double) Main.cloudAlpha != 0.0 || Main.dayTime ? 0 : (Main.rand.Next(5) == 0 ? 1 : 0)) & (flag26 ? 1 : 0)) != 0) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 611); - break; - } - if (((!Main.dayTime || Main.time >= 18000.0 ? 0 : ((uint) Main.rand.Next(3) > 0U ? 1 : 0)) & (flag26 ? 1 : 0)) != 0) - { - int num44 = Main.rand.Next(4); - if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 442); - break; - } - switch (num44) - { - case 0: - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 297); - break; - case 1: - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 298); - break; - default: - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 74); - break; - } - } - else - { - if (((windyForButterflies || Main.raining || !Main.dayTime ? 0 : (Main.rand.Next(NPC.butterflyChance) == 0 ? 1 : 0)) & (flag26 ? 1 : 0)) != 0) - { - if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 444); - else - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 356); - if (Main.rand.Next(4) == 0) - NPC.NewNPC(index1 * 16 + 8 - 16, index2 * 16, 356); - if (Main.rand.Next(4) == 0) - { - NPC.NewNPC(index1 * 16 + 8 + 16, index2 * 16, 356); - break; - } - break; - } - if (((!windyForButterflies || Main.raining || !Main.dayTime ? 0 : (Main.rand.Next(NPC.butterflyChance / 2) == 0 ? 1 : 0)) & (flag26 ? 1 : 0)) != 0) - { - if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 605); - else - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 604); - if (Main.rand.Next(3) != 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 604); - if (Main.rand.Next(2) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 604); - if (Main.rand.Next(3) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 604); - if (Main.rand.Next(4) == 0) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 604); - break; - } - break; - } - if (Main.rand.Next(2) == 0 & flag26) - { - int num45 = Main.rand.Next(4); - if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 442); - break; - } - switch (num45) - { - case 0: - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 297); - break; - case 1: - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 298); - break; - default: - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 74); - break; - } - } - else - { - if (index2 > Main.UnderworldLayer) - { - newNPC = NPC.SpawnNPC_SpawnLavaBaitCritters(index1, index2); - break; - } - if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 443); - break; - } - if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0 & flag26) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 539); - break; - } - if (Main.halloween && Main.rand.Next(3) != 0) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 303); - break; - } - if (Main.xMas && Main.rand.Next(3) != 0) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 337); - break; - } - if (BirthdayParty.PartyIsUp && Main.rand.Next(3) != 0) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 540); - break; - } - if (Main.rand.Next(3) == 0) - { - if ((double) index2 >= Main.rockLayer && index2 <= Main.UnderworldLayer) - { - if (Main.rand.Next(5) == 0) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, Main.rand.Next(639, 646)); - break; - } - break; - } - if (flag26) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, (int) Utils.SelectRandom(Main.rand, (short) 299, (short) 538)); - break; - } - break; - } - if ((double) index2 >= Main.rockLayer && index2 <= Main.UnderworldLayer) - { - if (Main.rand.Next(5) == 0) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, Main.rand.Next(646, 653)); - break; - } - break; - } - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 46); - break; - } - } - break; - case 53: - NPC.NewNPC(index1 * 16 + 8, index2 * 16, Main.rand.Next(366, 368)); - break; - case 60: - if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 445); - break; - } - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 361); - break; - case 147: - case 161: - if (Main.rand.Next(2) == 0) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 148); - break; - } - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 149); - break; - default: - if ((double) index2 <= Main.worldSurface) - return; - goto case 2; - } - } - } - } - else if (Main.player[index5].ZoneDungeon) - { - int num46 = 0; - if (Main.tile[index1, index2].wall == (ushort) 94 || Main.tile[index1, index2].wall == (ushort) 96 || Main.tile[index1, index2].wall == (ushort) 98) - num46 = 1; - if (Main.tile[index1, index2].wall == (ushort) 95 || Main.tile[index1, index2].wall == (ushort) 97 || Main.tile[index1, index2].wall == (ushort) 99) - num46 = 2; - if (Main.player[index5].RollLuck(7) == 0) - num46 = Main.rand.Next(3); - bool flag27 = !NPC.downedBoss3; - if (Main.drunkWorld && (double) Main.player[index5].position.Y / 16.0 < (double) (Main.dungeonY + 40)) - flag27 = false; - if (flag27) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 68); - else if (!NPC.savedMech && Main.rand.Next(5) == 0 && !flag7 && !NPC.AnyNPCs(123) && (double) index2 > Main.rockLayer) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 123); - else if (flag14 && Main.rand.Next(30) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 287); - else if (flag14 && num46 == 0 && Main.rand.Next(15) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 293); - else if (flag14 && num46 == 1 && Main.rand.Next(15) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 291); - else if (flag14 && num46 == 2 && Main.rand.Next(15) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 292); - else if (flag14 && !NPC.AnyNPCs(290) && num46 == 0 && Main.rand.Next(35) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 290); - else if (flag14 && (num46 == 1 || num46 == 2) && Main.rand.Next(30) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 289); - else if (flag14 && Main.rand.Next(20) == 0) - { - int num47 = 281; - if (num46 == 0) - num47 += 2; - if (num46 == 2) - num47 += 4; - int Type5 = num47 + Main.rand.Next(2); - if (!NPC.AnyNPCs(Type5)) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, Type5); - } - else if (flag14 && Main.rand.Next(3) != 0) - { - int num48 = 269; - if (num46 == 0) - num48 += 4; - if (num46 == 2) - num48 += 8; - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, num48 + Main.rand.Next(4)); - } - else if (Main.player[index5].RollLuck(35) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 71); - else if (num46 == 1 && Main.rand.Next(3) == 0 && !NPC.NearSpikeBall(index1, index2)) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 70); - else if (num46 == 2 && Main.rand.Next(5) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 72); - else if (num46 == 0 && Main.rand.Next(7) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 34); - else if (Main.rand.Next(7) == 0) - { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 32); - } - else - { - switch (Main.rand.Next(5)) - { - case 0: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 294); - break; - case 1: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 295); - break; - case 2: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 296); - break; - default: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 31); - if (Main.rand.Next(4) == 0) - { - Main.npc[newNPC].SetDefaults(-14); - break; - } - if (Main.rand.Next(5) == 0) - { - Main.npc[newNPC].SetDefaults(-13); - break; - } - break; - } - } - } - else if (Main.player[index5].ZoneMeteor) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 23); - else if (DD2Event.Ongoing && Main.player[index5].ZoneOldOneArmy) - DD2Event.SpawnNPC(ref newNPC); - else if ((double) index2 <= Main.worldSurface && !Main.dayTime && Main.snowMoon) - { - int waveNumber = NPC.waveNumber; - if (Main.rand.Next(30) == 0 && NPC.CountNPCS(341) < 4) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 341); - else if (waveNumber >= 20) - { - int num49 = Main.rand.Next(3); - if ((double) num3 < (double) num2 * (double) num4) - { - switch (num49) - { - case 0: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 345); - break; - case 1: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 346); - break; - default: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 344); - break; - } - } - } - else if (waveNumber >= 19) - newNPC = Main.rand.Next(10) != 0 || NPC.CountNPCS(345) >= 4 ? (Main.rand.Next(10) != 0 || NPC.CountNPCS(346) >= 5 ? (Main.rand.Next(10) != 0 || NPC.CountNPCS(344) >= 7 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 343) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 344)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 346)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 345); - else if (waveNumber >= 18) - newNPC = Main.rand.Next(10) != 0 || NPC.CountNPCS(345) >= 3 ? (Main.rand.Next(10) != 0 || NPC.CountNPCS(346) >= 4 ? (Main.rand.Next(10) != 0 || NPC.CountNPCS(344) >= 6 ? (Main.rand.Next(3) != 0 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 343) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 351)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 348)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 344)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 346)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 345); - else if (waveNumber >= 17) - newNPC = Main.rand.Next(10) != 0 || NPC.CountNPCS(345) >= 2 ? (Main.rand.Next(10) != 0 || NPC.CountNPCS(346) >= 3 ? (Main.rand.Next(10) != 0 || NPC.CountNPCS(344) >= 5 ? (Main.rand.Next(4) != 0 ? (Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 343) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 351)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 347)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 344)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 346)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 345); - else if (waveNumber >= 16) - newNPC = Main.rand.Next(10) != 0 || NPC.CountNPCS(345) >= 2 ? (Main.rand.Next(10) != 0 || NPC.CountNPCS(346) >= 2 ? (Main.rand.Next(10) != 0 || NPC.CountNPCS(344) >= 4 ? (Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 343) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 352)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 344)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 346)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 345); - else if (waveNumber >= 15) - newNPC = Main.rand.Next(10) != 0 || NPC.AnyNPCs(345) ? (Main.rand.Next(10) != 0 || NPC.CountNPCS(346) >= 2 ? (Main.rand.Next(10) != 0 || NPC.CountNPCS(344) >= 3 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 343) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 347)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 344)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 346)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 345); - else if (waveNumber == 14) - { - if (Main.rand.Next(10) == 0 && !NPC.AnyNPCs(345)) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 345); - else if (Main.rand.Next(10) == 0 && !NPC.AnyNPCs(346)) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 346); - else if (Main.rand.Next(10) == 0 && !NPC.AnyNPCs(344)) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 344); - else if (Main.rand.Next(3) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 343); - } - else - newNPC = waveNumber != 13 ? (waveNumber != 12 ? (waveNumber != 11 ? (waveNumber != 10 ? (waveNumber != 9 ? (waveNumber != 8 ? (waveNumber != 7 ? (waveNumber != 6 ? (waveNumber != 5 ? (waveNumber != 4 ? (waveNumber != 3 ? (waveNumber != 2 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, Main.rand.Next(338, 341)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 342)) : (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, Main.rand.Next(338, 341)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 350))) : (Main.rand.Next(8) != 0 ? (Main.rand.Next(4) != 0 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, Main.rand.Next(338, 341)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 342)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 350)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 348))) : (Main.rand.Next(10) != 0 || NPC.AnyNPCs(344) ? (Main.rand.Next(4) != 0 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, Main.rand.Next(338, 341)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 342)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 350)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 344))) : (Main.rand.Next(10) != 0 || NPC.AnyNPCs(344) ? (Main.rand.Next(4) != 0 ? (Main.rand.Next(8) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, Main.rand.Next(338, 341)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 348)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 350)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 344))) : (Main.rand.Next(10) != 0 || NPC.CountNPCS(344) >= 2 ? (Main.rand.Next(4) != 0 ? (Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 350) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 348)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 347)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 344))) : (Main.rand.Next(10) != 0 || NPC.AnyNPCs(346) ? (Main.rand.Next(3) != 0 ? (Main.rand.Next(4) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, Main.rand.Next(338, 341)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 350)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 342)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 346))) : (Main.rand.Next(10) != 0 || NPC.AnyNPCs(346) ? (Main.rand.Next(8) != 0 ? (Main.rand.Next(3) != 0 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 350) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 347)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 348)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 351)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 346))) : (Main.rand.Next(10) != 0 || NPC.AnyNPCs(346) ? (Main.rand.Next(10) != 0 || NPC.AnyNPCs(344) ? (Main.rand.Next(2) != 0 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 342) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 347)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 348)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 344)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 346))) : (Main.rand.Next(10) != 0 || NPC.AnyNPCs(346) ? (Main.rand.Next(10) != 0 || NPC.CountNPCS(344) >= 2 ? (Main.rand.Next(6) != 0 ? (Main.rand.Next(3) != 0 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, Main.rand.Next(338, 341)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 347)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 348)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 351)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 344)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 346))) : (Main.rand.Next(10) != 0 || NPC.AnyNPCs(345) ? (Main.rand.Next(6) != 0 ? (Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, Main.rand.Next(338, 341)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 342)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 352)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 345))) : (Main.rand.Next(10) != 0 || NPC.AnyNPCs(345) ? (Main.rand.Next(10) != 0 || NPC.AnyNPCs(344) ? (Main.rand.Next(8) != 0 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, Main.rand.Next(338, 341)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 342)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 343)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 344)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 345))) : (Main.rand.Next(10) != 0 || NPC.AnyNPCs(345) ? (Main.rand.Next(10) != 0 || NPC.AnyNPCs(346) ? (Main.rand.Next(3) != 0 ? (Main.rand.Next(6) != 0 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 347) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 342)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 343)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 352)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 346)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 345)); - } - else if ((double) index2 <= Main.worldSurface && !Main.dayTime && Main.pumpkinMoon) - { - int waveNumber = NPC.waveNumber; - int num50; - if (NPC.waveNumber >= 15) - { - if ((double) num3 < (double) num2 * (double) num4) - newNPC = Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 325) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 327); - } - else - { - switch (waveNumber) - { - case 2: - newNPC = Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, Main.rand.Next(305, 315)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 326); - break; - case 3: - newNPC = Main.rand.Next(6) != 0 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, Main.rand.Next(305, 315)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 326)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 329); - break; - case 4: - newNPC = Main.rand.Next(10) != 0 || NPC.AnyNPCs(325) ? (Main.rand.Next(10) != 0 ? (Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, Main.rand.Next(305, 315)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 326)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 329)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 325); - break; - case 5: - newNPC = Main.rand.Next(10) != 0 || NPC.AnyNPCs(325) ? (Main.rand.Next(8) != 0 ? (Main.rand.Next(5) != 0 ? (Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, Main.rand.Next(305, 315)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 326)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 329)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 330)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 325); - break; - case 6: - newNPC = Main.rand.Next(7) != 0 || NPC.CountNPCS(325) >= 2 ? (Main.rand.Next(6) != 0 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 326) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 329)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 330)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 325); - break; - case 7: - newNPC = Main.rand.Next(10) != 0 || NPC.AnyNPCs(327) ? (Main.rand.Next(8) != 0 ? (Main.rand.Next(5) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, Main.rand.Next(305, 315)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 329)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 330)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 327); - break; - case 8: - newNPC = Main.rand.Next(10) != 0 || NPC.AnyNPCs(327) ? (Main.rand.Next(5) != 0 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 326) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 329)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 330)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 327); - break; - case 9: - newNPC = Main.rand.Next(8) != 0 || NPC.AnyNPCs(327) ? (Main.rand.Next(8) != 0 || NPC.AnyNPCs(325) ? (Main.rand.Next(10) != 0 || NPC.AnyNPCs(315) ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, Main.rand.Next(305, 315)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 315)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 325)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 327); - break; - case 10: - newNPC = Main.rand.Next(10) != 0 || NPC.AnyNPCs(327) ? (Main.rand.Next(10) != 0 || NPC.AnyNPCs(325) ? (Main.rand.Next(10) != 0 || NPC.AnyNPCs(315) ? (Main.rand.Next(8) != 0 ? (Main.rand.Next(5) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 326) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 329)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 330)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 315)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 325)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 327); - break; - case 11: - if (Main.rand.Next(10) == 0 && !NPC.AnyNPCs(327)) - num50 = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 327); - newNPC = Main.rand.Next(7) != 0 || NPC.CountNPCS(325) >= 2 ? (Main.rand.Next(10) != 0 || NPC.AnyNPCs(315) ? (Main.rand.Next(10) != 0 ? (Main.rand.Next(7) != 0 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, Main.rand.Next(305, 315)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 326)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 329)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 330)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 315)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 325); - break; - case 12: - if (Main.rand.Next(7) == 0 && NPC.CountNPCS(327) < 2) - num50 = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 327); - newNPC = Main.rand.Next(7) != 0 || NPC.CountNPCS(325) >= 2 ? (Main.rand.Next(7) != 0 || NPC.CountNPCS(315) >= 2 ? (Main.rand.Next(7) != 0 ? (Main.rand.Next(5) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 326) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 329)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 330)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 315)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 325); - break; - case 13: - if (Main.rand.Next(7) == 0 && NPC.CountNPCS(327) < 2) - num50 = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 327); - newNPC = Main.rand.Next(5) != 0 || NPC.CountNPCS(325) >= 3 ? (Main.rand.Next(5) != 0 || NPC.CountNPCS(315) >= 3 ? (Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 329) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 330)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 315)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 325); - break; - case 14: - if (Main.rand.Next(5) == 0 && NPC.CountNPCS(327) < 3) - { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 327); - break; - } - if (Main.rand.Next(5) == 0 && NPC.CountNPCS(325) < 3) - { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 325); - break; - } - if ((double) num3 < (double) num2 * (double) num4) - { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 315); - break; - } - break; - default: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, Main.rand.Next(305, 315)); - break; - } - } - } - else if ((double) index2 <= Main.worldSurface && Main.dayTime && Main.eclipse) - { - bool flag28 = false; - if (NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3) - flag28 = true; - newNPC = !flag28 || Main.rand.Next(80) != 0 || NPC.AnyNPCs(477) ? (Main.rand.Next(50) != 0 || NPC.AnyNPCs(251) ? (!NPC.downedPlantBoss || Main.rand.Next(5) != 0 || NPC.AnyNPCs(466) ? (!NPC.downedPlantBoss || Main.rand.Next(20) != 0 || NPC.AnyNPCs(463) ? (!NPC.downedPlantBoss || Main.rand.Next(20) != 0 || NPC.CountNPCS(467) >= 2 ? (Main.rand.Next(15) != 0 ? (!flag28 || Main.rand.Next(13) != 0 ? (Main.rand.Next(8) != 0 ? (!NPC.downedPlantBoss || Main.rand.Next(7) != 0 ? (!NPC.downedPlantBoss || Main.rand.Next(5) != 0 ? (Main.rand.Next(4) != 0 ? (Main.rand.Next(3) != 0 ? (Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 166) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 462)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 461)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 162)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 460)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 468)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 469)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 253)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 159)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 467)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 463)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 466)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 251)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 477); - } - else if (NPC.fairyLog && Main.player[index5].RollLuck(500) == 0 && !NPC.AnyHelpfulFairies() && (double) index2 >= (Main.worldSurface + Main.rockLayer) / 2.0 && index2 < Main.maxTilesY - 300) - { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, Main.rand.Next(583, 586)); - Main.npc[newNPC].ai[2] = 2f; - Main.npc[newNPC].TargetClosest(); - Main.npc[newNPC].ai[3] = 0.0f; - } - else if (!flag7 && (!Main.dayTime || Main.tile[index1, index2].wall > (ushort) 0) && Main.tile[index7, index8].wall == (ushort) 244 && !Main.eclipse && !Main.bloodMoon && Main.player[index5].RollLuck(30) == 0 && NPC.CountNPCS(624) <= Main.rand.Next(3)) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 624); - else if (!flag7 && !Main.eclipse && !Main.bloodMoon && Main.player[index5].RollLuck(10) == 0 && (double) index2 >= Main.worldSurface * 0.800000011920929 && (double) index2 < Main.worldSurface * 1.10000002384186 && NPC.CountNPCS(624) <= Main.rand.Next(3) && (!Main.dayTime || Main.tile[index1, index2].wall > (ushort) 0) && (Main.tile[index1, index2].wall == (ushort) 2 || Main.tile[index1, index2].wall == (ushort) 196 || Main.tile[index1, index2].wall == (ushort) 197 || Main.tile[index1, index2].wall == (ushort) 198 || Main.tile[index1, index2].wall == (ushort) 199)) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 624); - else if (((!Main.hardMode ? 0 : (num1 == 70 ? 1 : 0)) & (flag7 ? 1 : 0)) != 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 256); - else if (num1 == 70 && (double) index2 <= Main.worldSurface && Main.rand.Next(3) != 0) - { - if (!Main.hardMode && Main.rand.Next(6) == 0 || Main.rand.Next(12) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 360); - else if (Main.rand.Next(3) == 0) - { - if (Main.rand.Next(4) == 0) - { - if (Main.hardMode && Main.rand.Next(3) != 0) - { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 260); - Main.npc[newNPC].ai[0] = (float) index1; - Main.npc[newNPC].ai[1] = (float) index2; - Main.npc[newNPC].netUpdate = true; - } - else - { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 259); - Main.npc[newNPC].ai[0] = (float) index1; - Main.npc[newNPC].ai[1] = (float) index2; - Main.npc[newNPC].netUpdate = true; - } - } - else - newNPC = Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 258) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 257); - } - else - newNPC = Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, (int) byte.MaxValue) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 254); - } - else if (num1 == 70 && Main.hardMode && (double) index2 >= Main.worldSurface && Main.rand.Next(3) != 0) - { - if (Main.hardMode && Main.rand.Next(5) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 374); - else if (!Main.hardMode && Main.rand.Next(4) == 0 || Main.rand.Next(8) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 360); - else if (Main.rand.Next(4) == 0) + if (Main.rand.Next(4) == 0) { if (Main.hardMode && Main.rand.Next(3) != 0) { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 260); + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 260); Main.npc[newNPC].ai[0] = (float) index1; - Main.npc[newNPC].ai[1] = (float) index2; + Main.npc[newNPC].ai[1] = (float) y; Main.npc[newNPC].netUpdate = true; } else { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 259); + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 259); Main.npc[newNPC].ai[0] = (float) index1; - Main.npc[newNPC].ai[1] = (float) index2; + Main.npc[newNPC].ai[1] = (float) y; Main.npc[newNPC].netUpdate = true; } } else - newNPC = Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 258) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 257); + newNPC = Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 258) : NPC.NewNPC(index1 * 16 + 8, y * 16, 257); } - else if (Main.player[index5].ZoneCorrupt && Main.rand.Next(65) == 0 && !flag5) - newNPC = !Main.hardMode || Main.rand.Next(4) == 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 7, 1) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 98, 1); - else if (Main.hardMode && (double) index2 > Main.worldSurface && Main.player[index5].RollLuck(75) == 0) - newNPC = Main.rand.Next(2) != 0 || !Main.player[index5].ZoneCorrupt || NPC.AnyNPCs(473) ? (Main.rand.Next(2) != 0 || !Main.player[index5].ZoneCrimson || NPC.AnyNPCs(474) ? (Main.rand.Next(2) != 0 || !Main.player[index5].ZoneHallow || NPC.AnyNPCs(475) ? (!Main.player[index5].ZoneSnow ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 85) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 629)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 475)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 474)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 473); - else if (Main.hardMode && (double) index2 <= Main.worldSurface && !Main.dayTime && (Main.rand.Next(20) == 0 || Main.rand.Next(5) == 0 && Main.moonPhase == 4)) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 82); - else if (Main.hardMode && Main.halloween && (double) index2 <= Main.worldSurface && !Main.dayTime && Main.rand.Next(10) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 304); - else if (tileType == 60 && Main.player[index5].RollLuck(500) == 0 && !Main.dayTime) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 52); - else if (tileType == 60 && (double) index2 > Main.worldSurface && Main.rand.Next(60) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 219); - else if ((double) index2 > Main.worldSurface && index2 < Main.maxTilesY - 210 && !Main.player[index5].ZoneSnow && !Main.player[index5].ZoneCrimson && !Main.player[index5].ZoneCorrupt && !Main.player[index5].ZoneJungle && !Main.player[index5].ZoneHallow && Main.rand.Next(8) == 0) + else + newNPC = Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, (int) byte.MaxValue) : NPC.NewNPC(index1 * 16 + 8, y * 16, 254); + } + else if (num1 == 70 && Main.hardMode && (double) y >= Main.worldSurface && Main.rand.Next(3) != 0) + { + if (Main.hardMode && Main.rand.Next(5) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 374); + else if (!Main.hardMode && Main.rand.Next(4) == 0 || Main.rand.Next(8) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 360); + else if (Main.rand.Next(4) == 0) { - if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 448); - else - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 357); - } - else if ((double) index2 > Main.worldSurface && index2 < Main.maxTilesY - 210 && !Main.player[index5].ZoneSnow && !Main.player[index5].ZoneCrimson && !Main.player[index5].ZoneCorrupt && !Main.player[index5].ZoneJungle && !Main.player[index5].ZoneHallow && Main.rand.Next(13) == 0) - { - if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 447); - else - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 300); - } - else if ((double) index2 > Main.worldSurface && (double) index2 < (Main.rockLayer + (double) Main.maxTilesY) / 2.0 && !Main.player[index5].ZoneSnow && !Main.player[index5].ZoneCrimson && !Main.player[index5].ZoneCorrupt && !Main.player[index5].ZoneHallow && Main.rand.Next(13) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 359); - else if ((double) index2 < Main.worldSurface && Main.player[index5].ZoneJungle && Main.rand.Next(7) == 0) - { - if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 445); - else - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 361); - } - else if (tileType == 225 && Main.rand.Next(2) == 0) - { - if (Main.hardMode && Main.rand.Next(4) != 0) + if (Main.hardMode && Main.rand.Next(3) != 0) { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 176); - if (Main.rand.Next(10) == 0) - Main.npc[newNPC].SetDefaults(-18); - if (Main.rand.Next(10) == 0) - Main.npc[newNPC].SetDefaults(-19); - if (Main.rand.Next(10) == 0) - Main.npc[newNPC].SetDefaults(-20); - if (Main.rand.Next(10) == 0) - Main.npc[newNPC].SetDefaults(-21); - } - else - { - switch (Main.rand.Next(8)) - { - case 0: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 231); - if (Main.rand.Next(4) == 0) - { - Main.npc[newNPC].SetDefaults(-56); - break; - } - if (Main.rand.Next(4) == 0) - { - Main.npc[newNPC].SetDefaults(-57); - break; - } - break; - case 1: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 232); - if (Main.rand.Next(4) == 0) - { - Main.npc[newNPC].SetDefaults(-58); - break; - } - if (Main.rand.Next(4) == 0) - { - Main.npc[newNPC].SetDefaults(-59); - break; - } - break; - case 2: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 233); - if (Main.rand.Next(4) == 0) - { - Main.npc[newNPC].SetDefaults(-60); - break; - } - if (Main.rand.Next(4) == 0) - { - Main.npc[newNPC].SetDefaults(-61); - break; - } - break; - case 3: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 234); - if (Main.rand.Next(4) == 0) - { - Main.npc[newNPC].SetDefaults(-62); - break; - } - if (Main.rand.Next(4) == 0) - { - Main.npc[newNPC].SetDefaults(-63); - break; - } - break; - case 4: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 235); - if (Main.rand.Next(4) == 0) - { - Main.npc[newNPC].SetDefaults(-64); - break; - } - if (Main.rand.Next(4) == 0) - { - Main.npc[newNPC].SetDefaults(-65); - break; - } - break; - default: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 42); - if (Main.rand.Next(4) == 0) - { - Main.npc[newNPC].SetDefaults(-16); - break; - } - if (Main.rand.Next(4) == 0) - { - Main.npc[newNPC].SetDefaults(-17); - break; - } - break; - } - } - } - else if (tileType == 60 && Main.hardMode && Main.rand.Next(3) != 0) - { - if ((double) index2 < Main.worldSurface && !Main.dayTime && Main.rand.Next(3) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 152); - else if ((double) index2 < Main.worldSurface && Main.dayTime && Main.rand.Next(4) != 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 177); - else if ((double) index2 > Main.worldSurface && Main.rand.Next(100) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 205); - else if ((double) index2 > Main.worldSurface && Main.rand.Next(5) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 236); - else if ((double) index2 > Main.worldSurface && Main.rand.Next(4) != 0) - { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 176); - if (Main.rand.Next(10) == 0) - Main.npc[newNPC].SetDefaults(-18); - if (Main.rand.Next(10) == 0) - Main.npc[newNPC].SetDefaults(-19); - if (Main.rand.Next(10) == 0) - Main.npc[newNPC].SetDefaults(-20); - if (Main.rand.Next(10) == 0) - Main.npc[newNPC].SetDefaults(-21); - } - else if (Main.rand.Next(3) == 0) - { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 175); + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 260); Main.npc[newNPC].ai[0] = (float) index1; - Main.npc[newNPC].ai[1] = (float) index2; + Main.npc[newNPC].ai[1] = (float) y; Main.npc[newNPC].netUpdate = true; } else - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 153); + { + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 259); + Main.npc[newNPC].ai[0] = (float) index1; + Main.npc[newNPC].ai[1] = (float) y; + Main.npc[newNPC].netUpdate = true; + } } - else if (tileType == 226 & flag4) - newNPC = Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 198) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 226); - else if (num24 == 86 && Main.rand.Next(8) != 0) + else + newNPC = Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 258) : NPC.NewNPC(index1 * 16 + 8, y * 16, 257); + } + else if (Main.player[plr].ZoneCorrupt && Main.rand.Next(65) == 0 && !flag4) + newNPC = !Main.hardMode || Main.rand.Next(4) == 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 7, 1) : NPC.NewNPC(index1 * 16 + 8, y * 16, 98, 1); + else if (Main.hardMode && (double) y > Main.worldSurface && Main.rand.Next(75) == 0) + newNPC = Main.rand.Next(2) != 0 || !Main.player[plr].ZoneCorrupt || NPC.AnyNPCs(473) ? (Main.rand.Next(2) != 0 || !Main.player[plr].ZoneCrimson || NPC.AnyNPCs(474) ? (Main.rand.Next(2) != 0 || !Main.player[plr].ZoneHoly || NPC.AnyNPCs(475) ? NPC.NewNPC(index1 * 16 + 8, y * 16, 85) : NPC.NewNPC(index1 * 16 + 8, y * 16, 475)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 474)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 473); + else if (Main.hardMode && Main.tile[index1, y - 1].wall == (byte) 2 && Main.rand.Next(20) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 85); + else if (Main.hardMode && (double) y <= Main.worldSurface && !Main.dayTime && (Main.rand.Next(20) == 0 || Main.rand.Next(5) == 0 && Main.moonPhase == 4)) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 82); + else if (Main.hardMode && Main.halloween && (double) y <= Main.worldSurface && !Main.dayTime && Main.rand.Next(10) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 304); + else if (type == 60 && Main.rand.Next(500) == 0 && !Main.dayTime) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 52); + else if (type == 60 && (double) y > Main.worldSurface && Main.rand.Next(60) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 219); + else if ((double) y > Main.worldSurface && y < Main.maxTilesY - 210 && !Main.player[plr].ZoneSnow && !Main.player[plr].ZoneCrimson && !Main.player[plr].ZoneCorrupt && !Main.player[plr].ZoneJungle && !Main.player[plr].ZoneHoly && Main.rand.Next(8) == 0) + { + if (Main.rand.Next(NPC.goldCritterChance) == 0) + NPC.NewNPC(index1 * 16 + 8, y * 16, 448); + else + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 357); + } + else if ((double) y > Main.worldSurface && y < Main.maxTilesY - 210 && !Main.player[plr].ZoneSnow && !Main.player[plr].ZoneCrimson && !Main.player[plr].ZoneCorrupt && !Main.player[plr].ZoneJungle && !Main.player[plr].ZoneHoly && Main.rand.Next(13) == 0) + { + if (Main.rand.Next(NPC.goldCritterChance) == 0) + NPC.NewNPC(index1 * 16 + 8, y * 16, 447); + else + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 300); + } + else if ((double) y > Main.worldSurface && (double) y < (Main.rockLayer + (double) Main.maxTilesY) / 2.0 && !Main.player[plr].ZoneSnow && !Main.player[plr].ZoneCrimson && !Main.player[plr].ZoneCorrupt && !Main.player[plr].ZoneHoly && Main.rand.Next(13) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 359); + else if ((double) y < Main.worldSurface && Main.player[plr].ZoneJungle && Main.rand.Next(9) == 0) + { + if (Main.rand.Next(NPC.goldCritterChance) == 0) + NPC.NewNPC(index1 * 16 + 8, y * 16, 445); + else + NPC.NewNPC(index1 * 16 + 8, y * 16, 361); + } + else if (type == 60 && Main.hardMode && Main.rand.Next(3) != 0) + { + if ((double) y < Main.worldSurface && !Main.dayTime && Main.rand.Next(3) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 152); + else if ((double) y < Main.worldSurface && Main.dayTime && Main.rand.Next(4) != 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 177); + else if ((double) y > Main.worldSurface && Main.rand.Next(100) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 205); + else if ((double) y > Main.worldSurface && Main.rand.Next(5) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 236); + else if ((double) y > Main.worldSurface && Main.rand.Next(4) != 0) + { + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 176); + if (Main.rand.Next(10) == 0) + Main.npc[newNPC].SetDefaults(-18); + if (Main.rand.Next(10) == 0) + Main.npc[newNPC].SetDefaults(-19); + if (Main.rand.Next(10) == 0) + Main.npc[newNPC].SetDefaults(-20); + if (Main.rand.Next(10) == 0) + Main.npc[newNPC].SetDefaults(-21); + } + else if (Main.rand.Next(3) == 0) + { + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 175); + Main.npc[newNPC].ai[0] = (float) index1; + Main.npc[newNPC].ai[1] = (float) y; + Main.npc[newNPC].netUpdate = true; + } + else + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 153); + } + else if (type == 226 & flag3) + newNPC = Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 198) : NPC.NewNPC(index1 * 16 + 8, y * 16, 226); + else if (type == 60 && (double) y > (Main.worldSurface + Main.rockLayer) / 2.0) + { + if (Main.rand.Next(4) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 204); + else if (Main.rand.Next(4) == 0) + { + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 43); + Main.npc[newNPC].ai[0] = (float) index1; + Main.npc[newNPC].ai[1] = (float) y; + Main.npc[newNPC].netUpdate = true; + } + else { switch (Main.rand.Next(8)) { case 0: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 231); + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 231); if (Main.rand.Next(4) == 0) { Main.npc[newNPC].SetDefaults(-56); @@ -44902,7 +34736,7 @@ label_18: } break; case 1: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 232); + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 232); if (Main.rand.Next(4) == 0) { Main.npc[newNPC].SetDefaults(-58); @@ -44915,7 +34749,7 @@ label_18: } break; case 2: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 233); + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 233); if (Main.rand.Next(4) == 0) { Main.npc[newNPC].SetDefaults(-60); @@ -44928,7 +34762,7 @@ label_18: } break; case 3: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 234); + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 234); if (Main.rand.Next(4) == 0) { Main.npc[newNPC].SetDefaults(-62); @@ -44941,7 +34775,7 @@ label_18: } break; case 4: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 235); + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 235); if (Main.rand.Next(4) == 0) { Main.npc[newNPC].SetDefaults(-64); @@ -44954,7 +34788,7 @@ label_18: } break; default: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 42); + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 42); if (Main.rand.Next(4) == 0) { Main.npc[newNPC].SetDefaults(-16); @@ -44968,998 +34802,673 @@ label_18: break; } } - else if (tileType == 60 && (double) index2 > (Main.worldSurface + Main.rockLayer) / 2.0) + } + else if (type == 60 && Main.rand.Next(4) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 51); + else if (type == 60 && Main.rand.Next(8) == 0) + { + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 56); + Main.npc[newNPC].ai[0] = (float) index1; + Main.npc[newNPC].ai[1] = (float) y; + Main.npc[newNPC].netUpdate = true; + } + else if (Sandstorm.Happening && Main.player[plr].ZoneSandstorm && TileID.Sets.Conversion.Sand[type] && NPC.Spawning_SandstoneCheck(index1, y)) + { + if (!NPC.downedBoss1 && !Main.hardMode) + newNPC = Main.rand.Next(2) != 0 ? (Main.rand.Next(2) != 0 ? (Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 69) : NPC.NewNPC(index1 * 16 + 8, y * 16, 61)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 508)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 546); + else if (Main.hardMode && Main.rand.Next(20) == 0 && !NPC.AnyNPCs(541)) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 541); + else if (Main.hardMode && !flag4 && Main.rand.Next(3) == 0 && NPC.CountNPCS(510) < 4) + newNPC = NPC.NewNPC(index1 * 16 + 8, (y + 10) * 16, 510); + else if (Main.hardMode && !flag4 && Main.rand.Next(2) == 0) { - if (Main.rand.Next(4) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 204); - else if (Main.rand.Next(4) == 0) + int Type6 = 542; + if (TileID.Sets.Corrupt[type]) + Type6 = 543; + if (TileID.Sets.Crimson[type]) + Type6 = 544; + if (TileID.Sets.Hallow[type]) + Type6 = 545; + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, Type6); + } + else + newNPC = !Main.hardMode || type != 53 || Main.rand.Next(3) != 0 ? (!Main.hardMode || type != 112 && type != 234 || Main.rand.Next(3) != 0 ? (!Main.hardMode || type != 116 || Main.rand.Next(3) != 0 ? (Main.rand.Next(2) != 0 ? (Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 509) : NPC.NewNPC(index1 * 16 + 8, y * 16, 508)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 546)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 80)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 79)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 78); + } + else if (Main.hardMode && type == 53 && Main.rand.Next(3) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 78); + else if (Main.hardMode && (type == 112 || type == 234) && Main.rand.Next(2) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 79); + else if (Main.hardMode && type == 116 && Main.rand.Next(2) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 80); + else if (Main.hardMode && !flag6 && (double) y < Main.rockLayer && (type == 116 || type == 117 || type == 109 || type == 164)) + newNPC = Main.dayTime || Main.rand.Next(2) != 0 ? (Main.rand.Next(10) == 0 || Main.player[plr].ZoneWaterCandle && Main.rand.Next(10) == 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 86) : NPC.NewNPC(index1 * 16 + 8, y * 16, 75)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 122); + else if (!flag4 && Main.hardMode && Main.rand.Next(50) == 0 && !flag6 && (double) y >= Main.rockLayer && (type == 116 || type == 117 || type == 109 || type == 164)) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 84); + else if (type == 204 && Main.player[plr].ZoneCrimson || type == 199 || type == 200 || type == 203 || type == 234) + { + if (Main.hardMode && (double) y >= Main.rockLayer && Main.rand.Next(5) == 0 && !flag4) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 182); + else if (Main.hardMode && (double) y >= Main.rockLayer && Main.rand.Next(2) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 268); + else if (Main.hardMode && Main.rand.Next(3) == 0) + { + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 183); + if (Main.rand.Next(3) == 0) + Main.npc[newNPC].SetDefaults(-24); + else if (Main.rand.Next(3) == 0) + Main.npc[newNPC].SetDefaults(-25); + } + else if (Main.hardMode && (double) y >= Main.rockLayer && Main.rand.Next(40) == 0 && !flag4) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 179); + else if (Main.hardMode && (Main.rand.Next(2) == 0 || (double) y > Main.worldSurface)) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 174); + else if (Main.tile[index1, y].wall > (byte) 0 && Main.rand.Next(4) != 0 || Main.rand.Next(8) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 239); + else if (Main.rand.Next(2) == 0) + { + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 181); + } + else + { + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 173); + if (Main.rand.Next(3) == 0) + Main.npc[newNPC].SetDefaults(-22); + else if (Main.rand.Next(3) == 0) + Main.npc[newNPC].SetDefaults(-23); + } + } + else if (type == 22 && Main.player[plr].ZoneCorrupt || type == 23 || type == 25 || type == 112 || type == 163) + { + if (Main.hardMode && (double) y >= Main.rockLayer && Main.rand.Next(3) == 0) + { + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 101); + Main.npc[newNPC].ai[0] = (float) index1; + Main.npc[newNPC].ai[1] = (float) y; + Main.npc[newNPC].netUpdate = true; + } + else if (Main.hardMode && Main.rand.Next(3) == 0) + newNPC = Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 81) : NPC.NewNPC(index1 * 16 + 8, y * 16, 121); + else if (Main.hardMode && (double) y >= Main.rockLayer && Main.rand.Next(40) == 0 && !flag4) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 83); + else if (Main.hardMode && (Main.rand.Next(2) == 0 || (double) y > Main.rockLayer)) + { + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 94); + } + else + { + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 6); + if (Main.rand.Next(3) == 0) + Main.npc[newNPC].SetDefaults(-11); + else if (Main.rand.Next(3) == 0) + Main.npc[newNPC].SetDefaults(-12); + } + } + else if ((double) y <= Main.worldSurface) + { + bool flag22 = (double) Math.Abs(index1 - Main.maxTilesX / 2) / (double) (Main.maxTilesX / 2) > 0.330000013113022; + if (flag22 && NPC.AnyDanger()) + flag22 = false; + if (Main.player[plr].ZoneSnow && Main.hardMode && (double) Main.cloudAlpha > 0.0 && !NPC.AnyNPCs(243) && Main.rand.Next(20) == 0) + NPC.NewNPC(index1 * 16 + 8, y * 16, 243); + else if (Main.player[plr].ZoneHoly && Main.hardMode && (double) Main.cloudAlpha > 0.0 && !NPC.AnyNPCs(244) && Main.rand.Next(20) == 0) + NPC.NewNPC(index1 * 16 + 8, y * 16, 244); + else if (!Main.player[plr].ZoneSnow && Main.hardMode && (double) Main.cloudAlpha > 0.0 && NPC.CountNPCS(250) < 2 && Main.rand.Next(10) == 0) + NPC.NewNPC(index1 * 16 + 8, y * 16, 250); + else if (flag22 && Main.hardMode && NPC.downedGolemBoss && (!NPC.downedMartians && Main.rand.Next(100) == 0 || Main.rand.Next(400) == 0) && !NPC.AnyNPCs(399)) + NPC.NewNPC(index1 * 16 + 8, y * 16, 399); + else if (Main.dayTime) + { + int num34 = Math.Abs(index1 - Main.spawnTileX); + if (num34 < Main.maxTilesX / 3 && Main.rand.Next(15) == 0 && (type == 2 || type == 109 || type == 147 || type == 161)) { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 43); - Main.npc[newNPC].ai[0] = (float) index1; - Main.npc[newNPC].ai[1] = (float) index2; - Main.npc[newNPC].netUpdate = true; + if (type == 147 || type == 161) + { + if (Main.rand.Next(2) == 0) + NPC.NewNPC(index1 * 16 + 8, y * 16, 148); + else + NPC.NewNPC(index1 * 16 + 8, y * 16, 149); + } + else if (Main.dayTime && Main.rand.Next(NPC.butterflyChance) == 0 && (double) y <= Main.worldSurface) + { + if (Main.rand.Next(NPC.goldCritterChance) == 0) + NPC.NewNPC(index1 * 16 + 8, y * 16, 444); + else + NPC.NewNPC(index1 * 16 + 8, y * 16, 356); + if (Main.rand.Next(4) == 0) + NPC.NewNPC(index1 * 16 + 8 - 16, y * 16, 356); + if (Main.rand.Next(4) == 0) + NPC.NewNPC(index1 * 16 + 8 + 16, y * 16, 356); + } + else if (Main.rand.Next(NPC.goldCritterChance) == 0) + NPC.NewNPC(index1 * 16 + 8, y * 16, 443); + else if (Main.rand.Next(NPC.goldCritterChance) == 0 && (double) y <= Main.worldSurface) + NPC.NewNPC(index1 * 16 + 8, y * 16, 539); + else if (Main.halloween && Main.rand.Next(3) != 0) + NPC.NewNPC(index1 * 16 + 8, y * 16, 303); + else if (Main.xMas && Main.rand.Next(3) != 0) + NPC.NewNPC(index1 * 16 + 8, y * 16, 337); + else if (BirthdayParty.PartyIsUp && Main.rand.Next(3) != 0) + NPC.NewNPC(index1 * 16 + 8, y * 16, 540); + else if (Main.rand.Next(3) == 0 && (double) y <= Main.worldSurface) + NPC.NewNPC(index1 * 16 + 8, y * 16, (int) Utils.SelectRandom(Main.rand, (short) 299, (short) 538)); + else + NPC.NewNPC(index1 * 16 + 8, y * 16, 46); + } + else if (num34 < Main.maxTilesX / 3 && Main.rand.Next(15) == 0 && type == 53) + NPC.NewNPC(index1 * 16 + 8, y * 16, Main.rand.Next(366, 368)); + else if (num34 < Main.maxTilesX / 3 && Main.dayTime && Main.time < 18000.0 && (type == 2 || type == 109) && Main.rand.Next(4) == 0 && (double) y <= Main.worldSurface && NPC.CountNPCS(74) + NPC.CountNPCS(297) + NPC.CountNPCS(298) < 6) + { + int num35 = Main.rand.Next(4); + if (Main.rand.Next(NPC.goldCritterChance) == 0) + { + NPC.NewNPC(index1 * 16 + 8, y * 16, 442); + } + else + { + switch (num35) + { + case 0: + NPC.NewNPC(index1 * 16 + 8, y * 16, 297); + break; + case 1: + NPC.NewNPC(index1 * 16 + 8, y * 16, 298); + break; + default: + NPC.NewNPC(index1 * 16 + 8, y * 16, 74); + break; + } + } + } + else if (num34 < Main.maxTilesX / 3 && Main.rand.Next(15) == 0 && (type == 2 || type == 109 || type == 147)) + { + int num36 = Main.rand.Next(4); + if (Main.rand.Next(NPC.goldCritterChance) == 0) + { + NPC.NewNPC(index1 * 16 + 8, y * 16, 442); + } + else + { + switch (num36) + { + case 0: + NPC.NewNPC(index1 * 16 + 8, y * 16, 297); + break; + case 1: + NPC.NewNPC(index1 * 16 + 8, y * 16, 298); + break; + default: + NPC.NewNPC(index1 * 16 + 8, y * 16, 74); + break; + } + } + } + else if (num34 > Main.maxTilesX / 3 && type == 2 && Main.rand.Next(300) == 0 && !NPC.AnyNPCs(50)) + NPC.SpawnOnPlayer(plr, 50); + else if (type == 53 && Main.rand.Next(5) == 0 && NPC.Spawning_SandstoneCheck(index1, y) && !flag6) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 69); + else if (type == 53 && Main.rand.Next(3) == 0 && !flag6) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 537); + else if (type == 53 && !flag6) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 61); + else if (num34 > Main.maxTilesX / 3 && (Main.rand.Next(15) == 0 || !NPC.downedGoblins && WorldGen.shadowOrbSmashed && Main.rand.Next(7) == 0)) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 73); + else if (Main.raining && Main.rand.Next(3) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 224); + else if (Main.raining && Main.rand.Next(2) == 0) + { + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 225); } else { - switch (Main.rand.Next(8)) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 1); + switch (type) { - case 0: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 231); - if (Main.rand.Next(4) == 0) + case 60: + Main.npc[newNPC].SetDefaults(-10); + break; + case 147: + case 161: + Main.npc[newNPC].SetDefaults(147); + break; + default: + if (Main.halloween && Main.rand.Next(3) != 0) { - Main.npc[newNPC].SetDefaults(-56); + Main.npc[newNPC].SetDefaults(302); break; } - if (Main.rand.Next(4) == 0) + if (Main.xMas && Main.rand.Next(3) != 0) { - Main.npc[newNPC].SetDefaults(-57); + Main.npc[newNPC].SetDefaults(Main.rand.Next(333, 337)); + break; + } + if (Main.rand.Next(3) == 0 || num34 < 200 && !Main.expertMode) + { + Main.npc[newNPC].SetDefaults(-3); + break; + } + if (Main.rand.Next(10) == 0 && (num34 > 400 || Main.expertMode)) + { + Main.npc[newNPC].SetDefaults(-7); + break; + } + break; + } + } + } + else if ((num1 == 2 || num1 == 109) && Main.rand.Next(NPC.fireFlyChance) == 0 && (double) y <= Main.worldSurface) + { + int Type7 = 355; + if (type == 109) + Type7 = 358; + NPC.NewNPC(index1 * 16 + 8, y * 16, Type7); + if (Main.rand.Next(NPC.fireFlyMultiple) == 0) + NPC.NewNPC(index1 * 16 + 8 - 16, y * 16, Type7); + if (Main.rand.Next(NPC.fireFlyMultiple) == 0) + NPC.NewNPC(index1 * 16 + 8 + 16, y * 16, Type7); + if (Main.rand.Next(NPC.fireFlyMultiple) == 0) + NPC.NewNPC(index1 * 16 + 8, y * 16 - 16, Type7); + if (Main.rand.Next(NPC.fireFlyMultiple) == 0) + NPC.NewNPC(index1 * 16 + 8, y * 16 + 16, Type7); + } + else if (Main.rand.Next(10) == 0 && Main.halloween) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 301); + else if (Main.rand.Next(6) == 0 || Main.moonPhase == 4 && Main.rand.Next(2) == 0) + { + if (Main.hardMode && Main.rand.Next(3) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 133); + else if (Main.halloween && Main.rand.Next(2) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, Main.rand.Next(317, 319)); + else if (Main.rand.Next(2) == 0) + { + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 2); + if (Main.rand.Next(4) == 0) + Main.npc[newNPC].SetDefaults(-43); + } + else + { + switch (Main.rand.Next(5)) + { + case 0: + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 190); + if (Main.rand.Next(3) == 0) + { + Main.npc[newNPC].SetDefaults(-38); break; } break; case 1: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 232); - if (Main.rand.Next(4) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 191); + if (Main.rand.Next(3) == 0) { - Main.npc[newNPC].SetDefaults(-58); - break; - } - if (Main.rand.Next(4) == 0) - { - Main.npc[newNPC].SetDefaults(-59); + Main.npc[newNPC].SetDefaults(-39); break; } break; case 2: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 233); - if (Main.rand.Next(4) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 192); + if (Main.rand.Next(3) == 0) { - Main.npc[newNPC].SetDefaults(-60); - break; - } - if (Main.rand.Next(4) == 0) - { - Main.npc[newNPC].SetDefaults(-61); + Main.npc[newNPC].SetDefaults(-40); break; } break; case 3: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 234); - if (Main.rand.Next(4) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 193); + if (Main.rand.Next(3) == 0) { - Main.npc[newNPC].SetDefaults(-62); - break; - } - if (Main.rand.Next(4) == 0) - { - Main.npc[newNPC].SetDefaults(-63); + Main.npc[newNPC].SetDefaults(-41); break; } break; case 4: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 235); - if (Main.rand.Next(4) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 194); + if (Main.rand.Next(3) == 0) { - Main.npc[newNPC].SetDefaults(-64); - break; - } - if (Main.rand.Next(4) == 0) - { - Main.npc[newNPC].SetDefaults(-65); - break; - } - break; - default: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 42); - if (Main.rand.Next(4) == 0) - { - Main.npc[newNPC].SetDefaults(-16); - break; - } - if (Main.rand.Next(4) == 0) - { - Main.npc[newNPC].SetDefaults(-17); + Main.npc[newNPC].SetDefaults(-42); break; } break; } } } - else if (tileType == 60 && Main.rand.Next(4) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 51); - else if (tileType == 60 && Main.rand.Next(8) == 0) + else if (Main.hardMode && Main.rand.Next(50) == 0 && Main.bloodMoon && !NPC.AnyNPCs(109)) + NPC.NewNPC(index1 * 16 + 8, y * 16, 109); + else if (Main.rand.Next(250) == 0 && Main.bloodMoon) + NPC.NewNPC(index1 * 16 + 8, y * 16, 53); + else if (Main.rand.Next(250) == 0 && Main.bloodMoon) + NPC.NewNPC(index1 * 16 + 8, y * 16, 536); + else if (Main.moonPhase == 0 && Main.hardMode && Main.rand.Next(3) != 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 104); + else if (Main.hardMode && Main.rand.Next(3) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 140); + else if (Main.bloodMoon && Main.rand.Next(5) < 2) + newNPC = Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 490) : NPC.NewNPC(index1 * 16 + 8, y * 16, 489); + else if (num1 == 147 || num1 == 161 || num1 == 163 || num1 == 164 || num1 == 162) + newNPC = !Main.hardMode || Main.rand.Next(4) != 0 ? (!Main.hardMode || Main.rand.Next(3) != 0 ? (!Main.expertMode || Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 161) : NPC.NewNPC(index1 * 16 + 8, y * 16, 431)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 155)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 169); + else if (Main.raining && Main.rand.Next(2) == 0) { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 56); - Main.npc[newNPC].ai[0] = (float) index1; - Main.npc[newNPC].ai[1] = (float) index2; - Main.npc[newNPC].netUpdate = true; - } - else if (Sandstorm.Happening && Main.player[index5].ZoneSandstorm && TileID.Sets.Conversion.Sand[tileType] && NPC.Spawning_SandstoneCheck(index1, index2)) - { - if (!NPC.downedBoss1 && !Main.hardMode) - newNPC = Main.rand.Next(2) != 0 ? (Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 69) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 61)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 546); - else if (Main.hardMode && Main.rand.Next(20) == 0 && !NPC.AnyNPCs(541)) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 541); - else if (Main.hardMode && !flag5 && Main.rand.Next(3) == 0 && NPC.CountNPCS(510) < 4) - newNPC = NPC.NewNPC(index1 * 16 + 8, (index2 + 10) * 16, 510); - else if (Main.hardMode && !flag5 && Main.rand.Next(2) == 0) - { - int Type6 = 542; - if (TileID.Sets.Corrupt[tileType]) - Type6 = 543; - if (TileID.Sets.Crimson[tileType]) - Type6 = 544; - if (TileID.Sets.Hallow[tileType]) - Type6 = 545; - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, Type6); - } - else - newNPC = !Main.hardMode || tileType != 53 || Main.rand.Next(3) != 0 ? (!Main.hardMode || tileType != 112 || Main.rand.Next(3) != 0 ? (!Main.hardMode || tileType != 234 || Main.rand.Next(3) != 0 ? (!Main.hardMode || tileType != 116 || Main.rand.Next(3) != 0 ? (Main.rand.Next(2) != 0 ? (Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 581) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 580)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 546)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 80)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 630)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 79)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 78); - } - else if (Main.hardMode && tileType == 53 && Main.rand.Next(3) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 78); - else if (Main.hardMode && tileType == 112 && Main.rand.Next(2) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 79); - else if (Main.hardMode && tileType == 234 && Main.rand.Next(2) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 630); - else if (Main.hardMode && tileType == 116 && Main.rand.Next(2) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 80); - else if (Main.hardMode && !flag7 && (double) index2 < Main.rockLayer && (tileType == 116 || tileType == 117 || tileType == 109 || tileType == 164)) - { - if (NPC.downedPlantBoss && !Main.dayTime && Main.time < 16200.0 && (double) index2 < Main.worldSurface && Main.rand.Next(10) == 0 && !NPC.AnyNPCs(661)) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 661); - else if ((double) Main.cloudAlpha > 0.0 && !NPC.AnyNPCs(244) && Main.rand.Next(12) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 244); - else - newNPC = Main.dayTime || Main.rand.Next(2) != 0 ? (Main.rand.Next(10) == 0 || Main.player[index5].ZoneWaterCandle && Main.rand.Next(10) == 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 86) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 75)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 122); - } - else if (!flag5 && Main.hardMode && Main.rand.Next(50) == 0 && !flag7 && (double) index2 >= Main.rockLayer && (tileType == 116 || tileType == 117 || tileType == 109 || tileType == 164)) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 84); - else if (tileType == 204 && Main.player[index5].ZoneCrimson || tileType == 199 || tileType == 200 || tileType == 203 || tileType == 234) - { - if (Main.hardMode && (double) index2 >= Main.rockLayer && Main.rand.Next(5) == 0 && !flag5) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 182); - else if (Main.hardMode && (double) index2 >= Main.rockLayer && Main.rand.Next(2) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 268); - else if (Main.hardMode && Main.rand.Next(3) == 0) - { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 183); - if (Main.rand.Next(3) == 0) - Main.npc[newNPC].SetDefaults(-24); - else if (Main.rand.Next(3) == 0) - Main.npc[newNPC].SetDefaults(-25); - } - else if (Main.hardMode && (double) index2 >= Main.rockLayer && Main.rand.Next(40) == 0 && !flag5) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 179); - else if (Main.hardMode && (Main.rand.Next(2) == 0 || (double) index2 > Main.worldSurface)) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 174); - else if (Main.tile[index1, index2].wall > (ushort) 0 && Main.rand.Next(4) != 0 || Main.rand.Next(8) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 239); - else if (Main.rand.Next(2) == 0) - { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 181); - } - else - { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 173); - if (Main.rand.Next(3) == 0) - Main.npc[newNPC].SetDefaults(-22); - else if (Main.rand.Next(3) == 0) - Main.npc[newNPC].SetDefaults(-23); - } - } - else if (tileType == 22 && Main.player[index5].ZoneCorrupt || tileType == 23 || tileType == 25 || tileType == 112 || tileType == 163) - { - if (Main.hardMode && (double) index2 >= Main.rockLayer && Main.rand.Next(3) == 0) - { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 101); - Main.npc[newNPC].ai[0] = (float) index1; - Main.npc[newNPC].ai[1] = (float) index2; - Main.npc[newNPC].netUpdate = true; - } - else if (Main.hardMode && Main.rand.Next(3) == 0) - newNPC = Main.rand.Next(3) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 81) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 121); - else if (Main.hardMode && (double) index2 >= Main.rockLayer && Main.rand.Next(40) == 0 && !flag5) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 83); - else if (Main.hardMode && (Main.rand.Next(2) == 0 || (double) index2 > Main.rockLayer)) - { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 94); - } - else - { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 6); - if (Main.rand.Next(3) == 0) - Main.npc[newNPC].SetDefaults(-11); - else if (Main.rand.Next(3) == 0) - Main.npc[newNPC].SetDefaults(-12); - } - } - else if ((double) index2 <= Main.worldSurface) - { - bool flag29 = (double) Math.Abs(index1 - Main.maxTilesX / 2) / (double) (Main.maxTilesX / 2) > 0.330000013113022; - if (flag29 && NPC.AnyDanger()) - flag29 = false; - if (Main.player[index5].ZoneGraveyard && !flag7 && (num1 == 2 || num1 == 477) && Main.rand.Next(10) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 223); + if (Main.rand.Next(3) == 0) { if (Main.rand.Next(2) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 606); + Main.npc[newNPC].SetDefaults(-54); else - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 610); - } - else if (Main.player[index5].ZoneSnow && Main.hardMode && (double) Main.cloudAlpha > 0.0 && !NPC.AnyNPCs(243) && Main.player[index5].RollLuck(20) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 243); - else if (!Main.player[index5].ZoneSnow && Main.hardMode && (double) Main.cloudAlpha > 0.0 && NPC.CountNPCS(250) < 2 && Main.rand.Next(10) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 250); - else if (flag29 && Main.hardMode && NPC.downedGolemBoss && (!NPC.downedMartians && Main.rand.Next(100) == 0 || Main.rand.Next(400) == 0) && !NPC.AnyNPCs(399)) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 399); - else if (!Main.player[index5].ZoneGraveyard && Main.dayTime) - { - int num51 = Math.Abs(index1 - Main.spawnTileX); - if (!flag7 && num51 < Main.maxTilesX / 2 && Main.rand.Next(15) == 0 && (tileType == 2 || tileType == 477 || tileType == 109 || tileType == 492 || tileType == 147 || tileType == 161)) - { - if (tileType == 147 || tileType == 161) - { - if (Main.rand.Next(2) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 148); - else - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 149); - } - else if (!windyForButterflies && !Main.raining && Main.dayTime && Main.rand.Next(NPC.butterflyChance / 2) == 0 && (double) index2 <= Main.worldSurface) - { - if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 444); - else - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 356); - if (Main.rand.Next(4) == 0) - NPC.NewNPC(index1 * 16 + 8 - 16, index2 * 16, 356); - if (Main.rand.Next(4) == 0) - NPC.NewNPC(index1 * 16 + 8 + 16, index2 * 16, 356); - } - else if (windyForButterflies && !Main.raining && Main.dayTime && Main.rand.Next(NPC.butterflyChance) == 0 && (double) index2 <= Main.worldSurface) - { - if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 605); - else - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 604); - if (Main.rand.Next(3) != 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 604); - if (Main.rand.Next(2) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 604); - if (Main.rand.Next(3) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 604); - if (Main.rand.Next(4) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 604); - } - else if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 443); - else if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0 && (double) index2 <= Main.worldSurface) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 539); - else if (Main.halloween && Main.rand.Next(3) != 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 303); - else if (Main.xMas && Main.rand.Next(3) != 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 337); - else if (BirthdayParty.PartyIsUp && Main.rand.Next(3) != 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 540); - else if (Main.rand.Next(3) == 0 && (double) index2 <= Main.worldSurface) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, (int) Utils.SelectRandom(Main.rand, (short) 299, (short) 538)); - else - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 46); - } - else if (!flag7 && index1 > WorldGen.beachDistance && index1 < Main.maxTilesX - WorldGen.beachDistance && Main.rand.Next(12) == 0 && tileType == 53) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, Main.rand.Next(366, 368)); - } - else - { - int cattailX; - int cattailY; - if ((tileType == 2 || tileType == 477 || tileType == 53) && !windyForButterflies && !Main.raining && Main.dayTime && Main.rand.Next(3) != 0 && (double) index2 <= Main.worldSurface && NPC.FindCattailTop(index1, index2, out cattailX, out cattailY)) - { - if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - NPC.NewNPC(cattailX * 16 + 8, cattailY * 16, 601); - else - NPC.NewNPC(cattailX * 16 + 8, cattailY * 16, NPC.RollDragonflyType(tileType)); - if (Main.rand.Next(3) == 0) - NPC.NewNPC(cattailX * 16 + 8 - 16, cattailY * 16, NPC.RollDragonflyType(tileType)); - if (Main.rand.Next(3) == 0) - NPC.NewNPC(cattailX * 16 + 8 + 16, cattailY * 16, NPC.RollDragonflyType(tileType)); - } - else if (!flag7 && num51 < Main.maxTilesX / 3 && Main.dayTime && Main.time < 18000.0 && (tileType == 2 || tileType == 477 || tileType == 109 || tileType == 492) && Main.rand.Next(4) == 0 && (double) index2 <= Main.worldSurface && NPC.CountNPCS(74) + NPC.CountNPCS(297) + NPC.CountNPCS(298) < 6) - { - int num52 = Main.rand.Next(4); - if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 442); - } - else - { - switch (num52) - { - case 0: - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 297); - break; - case 1: - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 298); - break; - default: - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 74); - break; - } - } - } - else if (!flag7 && num51 < Main.maxTilesX / 3 && Main.rand.Next(15) == 0 && (tileType == 2 || tileType == 477 || tileType == 109 || tileType == 492 || tileType == 147)) - { - int num53 = Main.rand.Next(4); - if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - { - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 442); - } - else - { - switch (num53) - { - case 0: - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 297); - break; - case 1: - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 298); - break; - default: - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 74); - break; - } - } - } - else if (!flag7 && num51 > Main.maxTilesX / 3 && tileType == 2 && Main.rand.Next(300) == 0 && !NPC.AnyNPCs(50)) - NPC.SpawnOnPlayer(index5, 50); - else if (tileType == 53 && (index1 < WorldGen.beachDistance || index1 > Main.maxTilesX - WorldGen.beachDistance)) - { - if (!flag7 && Main.rand.Next(10) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 602); - else if (flag7) - { - int num54 = -1; - int num55 = -1; - if ((double) index2 < Main.worldSurface && index2 > 50) - { - for (int j = index2 - 1; j > index2 - 50; --j) - { - if (Main.tile[index1, j].liquid == (byte) 0 && !WorldGen.SolidTile(index1, j) && !WorldGen.SolidTile(index1, j + 1) && !WorldGen.SolidTile(index1, j + 2)) - { - num54 = j + 2; - if (!WorldGen.SolidTile(index1, num54 + 1) && !WorldGen.SolidTile(index1, num54 + 2)) - { - num55 = num54 + 2; - break; - } - break; - } - } - if (num54 > index2) - num54 = index2; - if (num55 > index2) - num55 = index2; - } - if (Main.rand.Next(10) == 0) - { - int num56 = Main.rand.Next(3); - if (num56 == 0 && num54 > 0) - NPC.NewNPC(index1 * 16 + 8, num54 * 16, 625); - else if (num56 == 1 && num55 > 0) - NPC.NewNPC(index1 * 16 + 8, num55 * 16, 615); - else if (num56 == 2 && num55 > 0) - { - if (Main.player[index5].RollLuck(NPC.goldCritterChance) == 0) - NPC.NewNPC(index1 * 16 + 8, num55 * 16, 627); - else - NPC.NewNPC(index1 * 16 + 8, num55 * 16, 626); - } - } - } - } - else if (!flag7 && tileType == 53 && Main.rand.Next(5) == 0 && NPC.Spawning_SandstoneCheck(index1, index2) && !flag7) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 69); - else if (tileType == 53 && !flag7) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 61); - else if (!flag7 && num51 > Main.maxTilesX / 3 && (Main.rand.Next(15) == 0 || !NPC.downedGoblins && WorldGen.shadowOrbSmashed && Main.rand.Next(7) == 0)) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 73); - else if (Main.raining && Main.rand.Next(4) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 224); - else if (!flag7 && Main.raining && Main.rand.Next(2) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 225); - else if (((flag7 ? 0 : (num24 == 0 ? 1 : 0)) & (itAhappyWindyDay ? 1 : 0) & (flag18 ? 1 : 0)) != 0 && Main.rand.Next(3) != 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 594); - else if (((flag7 || num24 != 0 ? 0 : (num1 == 2 ? 1 : (num1 == 477 ? 1 : 0))) & (itAhappyWindyDay ? 1 : 0) & (flag18 ? 1 : 0)) != 0 && Main.rand.Next(10) != 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 628); - else if (!flag7) - { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 1); - switch (tileType) - { - case 60: - Main.npc[newNPC].SetDefaults(-10); - break; - case 147: - case 161: - Main.npc[newNPC].SetDefaults(147); - break; - default: - if (Main.halloween && Main.rand.Next(3) != 0) - { - Main.npc[newNPC].SetDefaults(302); - break; - } - if (Main.xMas && Main.rand.Next(3) != 0) - { - Main.npc[newNPC].SetDefaults(Main.rand.Next(333, 337)); - break; - } - if (Main.rand.Next(3) == 0 || num51 < 200 && !Main.expertMode) - { - Main.npc[newNPC].SetDefaults(-3); - break; - } - if (Main.rand.Next(10) == 0 && (num51 > 400 || Main.expertMode)) - { - Main.npc[newNPC].SetDefaults(-7); - break; - } - break; - } - } - } - } - else - { - if (!Main.player[index5].ZoneGraveyard && !windyForButterflies && (tileType == 2 || tileType == 477 || tileType == 109 || tileType == 492) && !Main.raining && Main.rand.Next(NPC.fireFlyChance) == 0 && (double) index2 <= Main.worldSurface) - { - int Type7 = 355; - if (tileType == 109) - Type7 = 358; - NPC.NewNPC(index1 * 16 + 8, index2 * 16, Type7); - if (Main.rand.Next(NPC.fireFlyMultiple) == 0) - NPC.NewNPC(index1 * 16 + 8 - 16, index2 * 16, Type7); - if (Main.rand.Next(NPC.fireFlyMultiple) == 0) - NPC.NewNPC(index1 * 16 + 8 + 16, index2 * 16, Type7); - if (Main.rand.Next(NPC.fireFlyMultiple) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16 - 16, Type7); - if (Main.rand.Next(NPC.fireFlyMultiple) == 0) - NPC.NewNPC(index1 * 16 + 8, index2 * 16 + 16, Type7); - } - else if ((Main.halloween || Main.player[index5].ZoneGraveyard) && Main.rand.Next(12) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 301); - else if (Main.player[index5].ZoneGraveyard && Main.rand.Next(30) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 316); - else if (Main.rand.Next(6) == 0 || Main.moonPhase == 4 && Main.rand.Next(2) == 0) - { - if (Main.hardMode && Main.rand.Next(3) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 133); - else if (Main.halloween && Main.rand.Next(2) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, Main.rand.Next(317, 319)); - else if (Main.rand.Next(2) == 0) - { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 2); - if (Main.rand.Next(4) == 0) - Main.npc[newNPC].SetDefaults(-43); - } - else - { - switch (Main.rand.Next(5)) - { - case 0: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 190); - if (Main.rand.Next(3) == 0) - { - Main.npc[newNPC].SetDefaults(-38); - break; - } - break; - case 1: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 191); - if (Main.rand.Next(3) == 0) - { - Main.npc[newNPC].SetDefaults(-39); - break; - } - break; - case 2: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 192); - if (Main.rand.Next(3) == 0) - { - Main.npc[newNPC].SetDefaults(-40); - break; - } - break; - case 3: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 193); - if (Main.rand.Next(3) == 0) - { - Main.npc[newNPC].SetDefaults(-41); - break; - } - break; - case 4: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 194); - if (Main.rand.Next(3) == 0) - { - Main.npc[newNPC].SetDefaults(-42); - break; - } - break; - } - } - } - else if (Main.hardMode && Main.rand.Next(50) == 0 && Main.bloodMoon && !NPC.AnyNPCs(109)) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 109); - else if (Main.rand.Next(250) == 0 && (Main.bloodMoon || Main.player[index5].ZoneGraveyard)) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 53); - else if (Main.rand.Next(250) == 0 && (Main.bloodMoon || Main.player[index5].ZoneGraveyard)) - NPC.NewNPC(index1 * 16 + 8, index2 * 16, 536); - else if (!Main.dayTime && Main.moonPhase == 0 && Main.hardMode && Main.rand.Next(3) != 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 104); - else if (!Main.dayTime && Main.hardMode && Main.rand.Next(3) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 140); - else if (Main.bloodMoon && Main.rand.Next(5) < 2) - newNPC = Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 490) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 489); - else if (num1 == 147 || num1 == 161 || num1 == 163 || num1 == 164 || num1 == 162) - newNPC = Main.player[index5].ZoneGraveyard || !Main.hardMode || Main.rand.Next(4) != 0 ? (Main.player[index5].ZoneGraveyard || !Main.hardMode || Main.rand.Next(3) != 0 ? (!Main.expertMode || Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 161) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 431)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 155)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 169); - else if (Main.raining && Main.rand.Next(2) == 0) - { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 223); - if (Main.rand.Next(3) == 0) - { - if (Main.rand.Next(2) == 0) - Main.npc[newNPC].SetDefaults(-54); - else - Main.npc[newNPC].SetDefaults(-55); - } - } - else - { - int num57 = Main.rand.Next(7); - int maxValue5 = 12; - int maxValue6 = 20; - if (Main.player[index5].statLifeMax <= 100) - { - maxValue5 = 5 - Main.CurrentFrameFlags.ActivePlayersCount / 2; - if (maxValue5 < 2) - maxValue5 = 2; - } - if (Main.player[index5].ZoneGraveyard && Main.rand.Next(maxValue6) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 632); - else if (Main.rand.Next(maxValue5) == 0) - newNPC = !Main.expertMode || Main.rand.Next(2) != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 590) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 591); - else if (Main.halloween && Main.rand.Next(2) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, Main.rand.Next(319, 322)); - else if (Main.xMas && Main.rand.Next(2) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, Main.rand.Next(331, 333)); - else if (num57 == 0 && Main.expertMode && Main.rand.Next(3) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 430); - else if (num57 == 2 && Main.expertMode && Main.rand.Next(3) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 432); - else if (num57 == 3 && Main.expertMode && Main.rand.Next(3) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 433); - else if (num57 == 4 && Main.expertMode && Main.rand.Next(3) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 434); - else if (num57 == 5 && Main.expertMode && Main.rand.Next(3) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 435); - else if (num57 == 6 && Main.expertMode && Main.rand.Next(3) == 0) - { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 436); - } - else - { - switch (num57) - { - case 0: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 3); - if (Main.rand.Next(3) == 0) - { - if (Main.rand.Next(2) == 0) - { - Main.npc[newNPC].SetDefaults(-26); - break; - } - Main.npc[newNPC].SetDefaults(-27); - break; - } - break; - case 1: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 132); - if (Main.rand.Next(3) == 0) - { - if (Main.rand.Next(2) == 0) - { - Main.npc[newNPC].SetDefaults(-28); - break; - } - Main.npc[newNPC].SetDefaults(-29); - break; - } - break; - case 2: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 186); - if (Main.rand.Next(3) == 0) - { - if (Main.rand.Next(2) == 0) - { - Main.npc[newNPC].SetDefaults(-30); - break; - } - Main.npc[newNPC].SetDefaults(-31); - break; - } - break; - case 3: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 187); - if (Main.rand.Next(3) == 0) - { - if (Main.rand.Next(2) == 0) - { - Main.npc[newNPC].SetDefaults(-32); - break; - } - Main.npc[newNPC].SetDefaults(-33); - break; - } - break; - case 4: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 188); - if (Main.rand.Next(3) == 0) - { - if (Main.rand.Next(2) == 0) - { - Main.npc[newNPC].SetDefaults(-34); - break; - } - Main.npc[newNPC].SetDefaults(-35); - break; - } - break; - case 5: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 189); - if (Main.rand.Next(3) == 0) - { - if (Main.rand.Next(2) == 0) - { - Main.npc[newNPC].SetDefaults(-36); - break; - } - Main.npc[newNPC].SetDefaults(-37); - break; - } - break; - case 6: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 200); - if (Main.rand.Next(3) == 0) - { - if (Main.rand.Next(2) == 0) - { - Main.npc[newNPC].SetDefaults(-44); - break; - } - Main.npc[newNPC].SetDefaults(-45); - break; - } - break; - } - } - } - if (Main.player[index5].ZoneGraveyard) - Main.npc[newNPC].target = index5; + Main.npc[newNPC].SetDefaults(-55); } } - else if ((double) index2 <= Main.rockLayer) + else { - if (!flag5 && Main.rand.Next(50) == 0 && !Main.player[index5].ZoneSnow) - newNPC = !Main.hardMode ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 10, 1) : (Main.rand.Next(3) == 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 10, 1) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 95, 1)); - else if (Main.hardMode && Main.rand.Next(3) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 140); - else if (Main.hardMode && Main.rand.Next(4) != 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 141); - else if (tileType == 147 || tileType == 161 || Main.player[index5].ZoneSnow) + int num37 = Main.rand.Next(7); + if (Main.halloween && Main.rand.Next(2) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, Main.rand.Next(319, 322)); + else if (Main.xMas && Main.rand.Next(2) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, Main.rand.Next(331, 333)); + else if (num37 == 0 && Main.expertMode && Main.rand.Next(3) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 430); + else if (num37 == 2 && Main.expertMode && Main.rand.Next(3) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 432); + else if (num37 == 3 && Main.expertMode && Main.rand.Next(3) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 433); + else if (num37 == 4 && Main.expertMode && Main.rand.Next(3) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 434); + else if (num37 == 5 && Main.expertMode && Main.rand.Next(3) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 435); + else if (num37 == 6 && Main.expertMode && Main.rand.Next(3) == 0) { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 147); + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 436); } else { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 1); - if (Main.rand.Next(5) == 0) - Main.npc[newNPC].SetDefaults(-9); - else if (Main.rand.Next(2) == 0) - Main.npc[newNPC].SetDefaults(1); - else - Main.npc[newNPC].SetDefaults(-8); - } - } - else if (index2 > Main.maxTilesY - 190) - newNPC = !Main.hardMode || NPC.savedTaxCollector || Main.rand.Next(20) != 0 || NPC.AnyNPCs(534) ? (Main.rand.Next(8) != 0 ? (Main.rand.Next(40) != 0 || NPC.AnyNPCs(39) ? (Main.rand.Next(14) != 0 ? (Main.rand.Next(7) != 0 ? (Main.rand.Next(3) != 0 ? (!Main.hardMode || !NPC.downedMechBossAny || Main.rand.Next(5) == 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 60) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 151)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 59)) : (Main.rand.Next(10) != 0 ? (!Main.hardMode || !NPC.downedMechBossAny || Main.rand.Next(5) == 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 62) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 156)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 66))) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 24)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 39, 1)) : NPC.SpawnNPC_SpawnLavaBaitCritters(index1, index2)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 534); - else if (NPC.SpawnNPC_CheckToSpawnRockGolem(index1, index2, tileType, index5)) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 631); - else if (Main.rand.Next(60) == 0) - newNPC = !Main.player[index5].ZoneSnow ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 217) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 218); - else if ((tileType == 116 || tileType == 117 || tileType == 164) && Main.hardMode && !flag5 && Main.rand.Next(8) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 120); - else if ((num1 == 147 || num1 == 161 || num1 == 162 || num1 == 163 || num1 == 164 || num1 == 200) && !flag5 && Main.hardMode && Main.player[index5].ZoneCorrupt && Main.rand.Next(30) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 170); - else if ((num1 == 147 || num1 == 161 || num1 == 162 || num1 == 163 || num1 == 164 || num1 == 200) && !flag5 && Main.hardMode && Main.player[index5].ZoneHallow && Main.rand.Next(30) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 171); - else if ((num1 == 147 || num1 == 161 || num1 == 162 || num1 == 163 || num1 == 164 || num1 == 200) && !flag5 && Main.hardMode && Main.player[index5].ZoneCrimson && Main.rand.Next(30) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 180); - else if (Main.hardMode && Main.player[index5].ZoneSnow && Main.rand.Next(10) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 154); - else if (!flag5 && Main.rand.Next(100) == 0 && !Main.player[index5].ZoneHallow) - newNPC = !Main.hardMode ? (!Main.player[index5].ZoneSnow ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 10, 1) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 185)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 95, 1); - else if (Main.player[index5].ZoneSnow && Main.rand.Next(20) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 185); - else if (!Main.hardMode && Main.rand.Next(10) == 0 || Main.hardMode && Main.rand.Next(20) == 0) - { - if (Main.player[index5].ZoneSnow) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 184); - else if (Main.rand.Next(3) == 0) - { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 1); - Main.npc[newNPC].SetDefaults(-6); - } - else - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 16); - } - else if (!Main.hardMode && Main.rand.Next(4) == 0) - { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 1); - if (Main.player[index5].ZoneJungle) - Main.npc[newNPC].SetDefaults(-10); - else if (Main.player[index5].ZoneSnow) - Main.npc[newNPC].SetDefaults(184); - else - Main.npc[newNPC].SetDefaults(-6); - } - else if (Main.rand.Next(2) == 0) - { - if (Main.rand.Next(35) == 0 && NPC.CountNPCS(453) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 453); - else if (!Main.hardMode && Main.rand.Next(80) == 0 || Main.rand.Next(200) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 195); - else if (Main.hardMode && (double) index2 > (Main.rockLayer + (double) Main.maxTilesY) / 2.0 && Main.rand.Next(300) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 172); - else if ((double) index2 > (Main.rockLayer + (double) Main.maxTilesY) / 2.0 && (Main.rand.Next(200) == 0 || Main.rand.Next(50) == 0 && (Main.player[index5].armor[1].type == 4256 || Main.player[index5].armor[1].type >= 1282 && Main.player[index5].armor[1].type <= 1287) && Main.player[index5].armor[0].type != 238)) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 45); - else if (flag10 && Main.rand.Next(4) != 0) - newNPC = Main.rand.Next(6) == 0 || NPC.AnyNPCs(480) || !Main.hardMode ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 481) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 480); - else if (flag9 && Main.rand.Next(5) != 0) - newNPC = Main.rand.Next(6) == 0 || NPC.AnyNPCs(483) ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 482) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 483); - else if (Main.hardMode && Main.rand.Next(10) != 0) - { - if (Main.rand.Next(2) == 0) - { - if (Main.player[index5].ZoneSnow) - { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 197); - } - else - { - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 77); - if ((double) index2 > (Main.rockLayer + (double) Main.maxTilesY) / 2.0 && Main.rand.Next(5) == 0) - Main.npc[newNPC].SetDefaults(-15); - } - } - else - newNPC = !Main.player[index5].ZoneSnow ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 110) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 206); - } - else if (!flag5 && (Main.halloween || Main.player[index5].ZoneGraveyard) && Main.rand.Next(30) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 316); - else if (Main.rand.Next(20) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 44); - else if (num1 == 147 || num1 == 161 || num1 == 162) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 167); - else if (Main.player[index5].ZoneSnow) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 185); - else if (Main.rand.Next(3) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, NPC.cavernMonsterType[Main.rand.Next(2), Main.rand.Next(3)]); - else if (Main.player[index5].ZoneGlowshroom && (num1 == 70 || num1 == 190)) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 635); - else if (Main.halloween && Main.rand.Next(2) == 0) - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, Main.rand.Next(322, 325)); - else if (Main.expertMode && Main.rand.Next(3) == 0) - { - int num58 = Main.rand.Next(4); - newNPC = num58 != 0 ? (num58 != 0 ? (num58 != 0 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 452) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 451)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 450)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 449); - } - else - { - switch (Main.rand.Next(4)) + switch (num37) { case 0: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 21); + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 3); if (Main.rand.Next(3) == 0) { if (Main.rand.Next(2) == 0) { - Main.npc[newNPC].SetDefaults(-47); + Main.npc[newNPC].SetDefaults(-26); break; } - Main.npc[newNPC].SetDefaults(-46); + Main.npc[newNPC].SetDefaults(-27); break; } break; case 1: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 201); + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 132); if (Main.rand.Next(3) == 0) { if (Main.rand.Next(2) == 0) { - Main.npc[newNPC].SetDefaults(-49); + Main.npc[newNPC].SetDefaults(-28); break; } - Main.npc[newNPC].SetDefaults(-48); + Main.npc[newNPC].SetDefaults(-29); break; } break; case 2: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 202); + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 186); if (Main.rand.Next(3) == 0) { if (Main.rand.Next(2) == 0) { - Main.npc[newNPC].SetDefaults(-51); + Main.npc[newNPC].SetDefaults(-30); break; } - Main.npc[newNPC].SetDefaults(-50); + Main.npc[newNPC].SetDefaults(-31); break; } break; case 3: - newNPC = NPC.NewNPC(index1 * 16 + 8, index2 * 16, 203); + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 187); if (Main.rand.Next(3) == 0) { if (Main.rand.Next(2) == 0) { - Main.npc[newNPC].SetDefaults(-53); + Main.npc[newNPC].SetDefaults(-32); break; } - Main.npc[newNPC].SetDefaults(-52); + Main.npc[newNPC].SetDefaults(-33); + break; + } + break; + case 4: + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 188); + if (Main.rand.Next(3) == 0) + { + if (Main.rand.Next(2) == 0) + { + Main.npc[newNPC].SetDefaults(-34); + break; + } + Main.npc[newNPC].SetDefaults(-35); + break; + } + break; + case 5: + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 189); + if (Main.rand.Next(3) == 0) + { + if (Main.rand.Next(2) == 0) + { + Main.npc[newNPC].SetDefaults(-36); + break; + } + Main.npc[newNPC].SetDefaults(-37); + break; + } + break; + case 6: + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 200); + if (Main.rand.Next(3) == 0) + { + if (Main.rand.Next(2) == 0) + { + Main.npc[newNPC].SetDefaults(-44); + break; + } + Main.npc[newNPC].SetDefaults(-45); break; } break; } } } - else - newNPC = !Main.hardMode || !(Main.player[index5].ZoneHallow & Main.rand.Next(2) == 0) ? (!Main.player[index5].ZoneJungle ? (!Main.player[index5].ZoneGlowshroom || num1 != 70 && num1 != 190 ? (!Main.hardMode || !Main.player[index5].ZoneHallow ? (!Main.hardMode || Main.rand.Next(6) <= 0 ? (num1 == 147 || num1 == 161 || num1 == 162 ? (!Main.hardMode ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 150) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 169)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 49)) : (Main.rand.Next(3) != 0 || num1 != 147 && num1 != 161 && num1 != 162 ? NPC.NewNPC(index1 * 16 + 8, index2 * 16, 93) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 150))) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 137)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 634)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 51)) : NPC.NewNPC(index1 * 16 + 8, index2 * 16, 138); - if (Main.npc[newNPC].type == 1 && Main.player[index5].RollLuck(180) == 0) - Main.npc[newNPC].SetDefaults(-4); - if (Main.netMode != 2 || newNPC >= 200) - break; - NetMessage.SendData(23, number: newNPC); - break; } + else if ((double) y <= Main.rockLayer) + { + if (!flag4 && Main.rand.Next(50) == 0 && !Main.player[plr].ZoneSnow) + newNPC = !Main.hardMode ? (!Main.player[plr].ZoneSnow ? NPC.NewNPC(index1 * 16 + 8, y * 16, 10, 1) : NPC.NewNPC(index1 * 16 + 8, y * 16, 185)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 95, 1); + else if (Main.hardMode && Main.rand.Next(3) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 140); + else if (Main.hardMode && Main.rand.Next(4) != 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 141); + else if (type == 147 || type == 161 || Main.player[plr].ZoneSnow) + { + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 147); + } + else + { + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 1); + if (Main.rand.Next(5) == 0) + Main.npc[newNPC].SetDefaults(-9); + else if (Main.rand.Next(2) == 0) + Main.npc[newNPC].SetDefaults(1); + else + Main.npc[newNPC].SetDefaults(-8); + } + } + else if (y > Main.maxTilesY - 190) + newNPC = !Main.hardMode || NPC.savedTaxCollector || Main.rand.Next(20) != 0 || NPC.AnyNPCs(534) ? (Main.rand.Next(40) != 0 || NPC.AnyNPCs(39) ? (Main.rand.Next(14) != 0 ? (Main.rand.Next(7) != 0 ? (Main.rand.Next(3) != 0 ? (!Main.hardMode || !NPC.downedMechBossAny || Main.rand.Next(5) == 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 60) : NPC.NewNPC(index1 * 16 + 8, y * 16, 151)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 59)) : (Main.rand.Next(7) != 0 ? (!Main.hardMode || !NPC.downedMechBossAny || Main.rand.Next(5) == 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 62) : NPC.NewNPC(index1 * 16 + 8, y * 16, 156)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 66))) : NPC.NewNPC(index1 * 16 + 8, y * 16, 24)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 39, 1)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 534); + else if (Main.rand.Next(60) == 0) + newNPC = !Main.player[plr].ZoneSnow ? NPC.NewNPC(index1 * 16 + 8, y * 16, 217) : NPC.NewNPC(index1 * 16 + 8, y * 16, 218); + else if ((type == 116 || type == 117 || type == 164) && Main.hardMode && !flag4 && Main.rand.Next(8) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 120); + else if ((num1 == 147 || num1 == 161 || num1 == 162 || num1 == 163 || num1 == 164) && !flag4 && Main.hardMode && Main.player[plr].ZoneCorrupt && Main.rand.Next(30) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 170); + else if ((num1 == 147 || num1 == 161 || num1 == 162 || num1 == 163 || num1 == 164) && !flag4 && Main.hardMode && Main.player[plr].ZoneHoly && Main.rand.Next(30) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 171); + else if ((num1 == 147 || num1 == 161 || num1 == 162 || num1 == 163 || num1 == 164) && !flag4 && Main.hardMode && Main.player[plr].ZoneCrimson && Main.rand.Next(30) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 180); + else if (Main.hardMode && Main.player[plr].ZoneSnow && Main.rand.Next(10) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 154); + else if (!flag4 && Main.rand.Next(100) == 0 && !Main.player[plr].ZoneHoly) + newNPC = !Main.hardMode ? (!Main.player[plr].ZoneSnow ? NPC.NewNPC(index1 * 16 + 8, y * 16, 10, 1) : NPC.NewNPC(index1 * 16 + 8, y * 16, 185)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 95, 1); + else if (Main.player[plr].ZoneSnow && Main.rand.Next(20) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 185); + else if (!Main.hardMode && Main.rand.Next(10) == 0) + { + if (Main.player[plr].ZoneSnow) + Main.npc[newNPC].SetDefaults(184); + else + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 16); + } + else if (!Main.hardMode && Main.rand.Next(4) == 0) + { + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 1); + if (Main.player[plr].ZoneJungle) + Main.npc[newNPC].SetDefaults(-10); + else if (Main.player[plr].ZoneSnow) + Main.npc[newNPC].SetDefaults(184); + else + Main.npc[newNPC].SetDefaults(-6); + } + else if (Main.rand.Next(2) == 0) + { + if (Main.rand.Next(35) == 0 && NPC.CountNPCS(453) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 453); + else if (!Main.hardMode && Main.rand.Next(80) == 0 || Main.rand.Next(200) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 195); + else if (Main.hardMode && (double) y > (Main.rockLayer + (double) Main.maxTilesY) / 2.0 && Main.rand.Next(300) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 172); + else if ((double) y > (Main.rockLayer + (double) Main.maxTilesY) / 2.0 && (Main.rand.Next(200) == 0 || Main.rand.Next(50) == 0 && Main.player[plr].armor[1].type >= 1282 && Main.player[plr].armor[1].type <= 1287 && Main.player[plr].armor[0].type != 238)) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 45); + else if (flag9 && Main.rand.Next(4) != 0) + newNPC = Main.rand.Next(6) == 0 || NPC.AnyNPCs(480) || !Main.hardMode ? NPC.NewNPC(index1 * 16 + 8, y * 16, 481) : NPC.NewNPC(index1 * 16 + 8, y * 16, 480); + else if (flag8 && Main.rand.Next(5) != 0) + newNPC = Main.rand.Next(6) == 0 || NPC.AnyNPCs(483) ? NPC.NewNPC(index1 * 16 + 8, y * 16, 482) : NPC.NewNPC(index1 * 16 + 8, y * 16, 483); + else if (Main.hardMode && Main.rand.Next(10) != 0) + { + if (Main.rand.Next(2) == 0) + { + if (Main.player[plr].ZoneSnow) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 197); + else if (Main.halloween && Main.rand.Next(5) == 0) + { + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 316); + } + else + { + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 77); + if ((double) y > (Main.rockLayer + (double) Main.maxTilesY) / 2.0 && Main.rand.Next(5) == 0) + Main.npc[newNPC].SetDefaults(-15); + } + } + else + newNPC = !Main.player[plr].ZoneSnow ? NPC.NewNPC(index1 * 16 + 8, y * 16, 110) : NPC.NewNPC(index1 * 16 + 8, y * 16, 206); + } + else if (Main.rand.Next(20) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 44); + else if (num1 == 147 || num1 == 161 || num1 == 162) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 167); + else if (Main.player[plr].ZoneSnow) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 185); + else if (Main.rand.Next(3) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, NPC.cavernMonsterType[Main.rand.Next(2), Main.rand.Next(3)]); + else if (Main.halloween && Main.rand.Next(2) == 0) + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, Main.rand.Next(322, 325)); + else if (Main.expertMode && Main.rand.Next(3) == 0) + { + int num38 = Main.rand.Next(4); + newNPC = num38 != 0 ? (num38 != 0 ? (num38 != 0 ? NPC.NewNPC(index1 * 16 + 8, y * 16, 452) : NPC.NewNPC(index1 * 16 + 8, y * 16, 451)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 450)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 449); + } + else + { + switch (Main.rand.Next(4)) + { + case 0: + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 21); + if (Main.rand.Next(3) == 0) + { + if (Main.rand.Next(2) == 0) + { + Main.npc[newNPC].SetDefaults(-47); + break; + } + Main.npc[newNPC].SetDefaults(-46); + break; + } + break; + case 1: + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 201); + if (Main.rand.Next(3) == 0) + { + if (Main.rand.Next(2) == 0) + { + Main.npc[newNPC].SetDefaults(-49); + break; + } + Main.npc[newNPC].SetDefaults(-48); + break; + } + break; + case 2: + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 202); + if (Main.rand.Next(3) == 0) + { + if (Main.rand.Next(2) == 0) + { + Main.npc[newNPC].SetDefaults(-51); + break; + } + Main.npc[newNPC].SetDefaults(-50); + break; + } + break; + case 3: + newNPC = NPC.NewNPC(index1 * 16 + 8, y * 16, 203); + if (Main.rand.Next(3) == 0) + { + if (Main.rand.Next(2) == 0) + { + Main.npc[newNPC].SetDefaults(-53); + break; + } + Main.npc[newNPC].SetDefaults(-52); + break; + } + break; + } + } + } + else + newNPC = !Main.hardMode || !(Main.player[plr].ZoneHoly & Main.rand.Next(2) == 0) ? (!Main.player[plr].ZoneJungle ? (!Main.hardMode || !Main.player[plr].ZoneHoly ? (!Main.hardMode || Main.rand.Next(6) <= 0 ? (num1 == 147 || num1 == 161 || num1 == 162 ? (!Main.hardMode ? NPC.NewNPC(index1 * 16 + 8, y * 16, 150) : NPC.NewNPC(index1 * 16 + 8, y * 16, 169)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 49)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 93)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 137)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 51)) : NPC.NewNPC(index1 * 16 + 8, y * 16, 138); + if (Main.npc[newNPC].type == 1 && Main.rand.Next(180) == 0) + Main.npc[newNPC].SetDefaults(-4); + if (Main.netMode != 2 || newNPC >= 200) + break; + NetMessage.SendData(23, number: newNPC); + break; } } } } } - private static bool SpawnNPC_CheckToSpawnRockGolem( - int spawnTileX, - int spawnTileY, - int tileType, - int plr) - { - return Main.hardMode && (tileType == 1 || TileID.Sets.Conversion.Moss[tileType]) && !Main.player[plr].ZoneSnow && Main.rand.Next(30) == 0 && !WorldGen.SolidTile(spawnTileX - 1, spawnTileY - 4) && !WorldGen.SolidTile(spawnTileX, spawnTileY - 4) && !WorldGen.SolidTile(spawnTileX + 1, spawnTileY - 4); - } - - private static int SpawnNPC_SpawnLavaBaitCritters(int spawnTileX, int spawnTileY) - { - if (Main.rand.Next(3) == 0) - return NPC.NewNPC(spawnTileX * 16 + 8, spawnTileY * 16, 655); - if (Main.dayTime) - return NPC.NewNPC(spawnTileX * 16 + 8, spawnTileY * 16, 653); - if (Main.rand.Next(NPC.fireFlyMultiple) == 0) - NPC.NewNPC(spawnTileX * 16 + 8 - 16, spawnTileY * 16, 654); - if (Main.rand.Next(NPC.fireFlyMultiple) == 0) - NPC.NewNPC(spawnTileX * 16 + 8 + 16, spawnTileY * 16, 654); - if (Main.rand.Next(NPC.fireFlyMultiple) == 0) - NPC.NewNPC(spawnTileX * 16 + 8, spawnTileY * 16 - 16, 654); - if (Main.rand.Next(NPC.fireFlyMultiple) == 0) - NPC.NewNPC(spawnTileX * 16 + 8, spawnTileY * 16 + 16, 654); - return NPC.NewNPC(spawnTileX * 16 + 8, spawnTileY * 16, 654); - } - - private static int SpawnNPC_TryFindingProperGroundTileType(int spawnTileType, int x, int y) - { - if (!NPC.IsValidSpawningGroundTile(x, y)) - { - for (int y1 = y + 1; y1 < y + 30; ++y1) - { - if (NPC.IsValidSpawningGroundTile(x, y1)) - return (int) Main.tile[x, y1].type; - } - } - return spawnTileType; - } - - private static bool IsValidSpawningGroundTile(int x, int y) - { - Tile tile = Main.tile[x, y]; - return tile.nactive() && Main.tileSolid[(int) tile.type] && !Main.tileSolidTop[(int) tile.type] && !TileID.Sets.IsSkippedForNPCSpawningGroundTypeCheck[(int) tile.type]; - } - - public static bool FindCattailTop(int landX, int landY, out int cattailX, out int cattailY) - { - cattailX = landX; - cattailY = landY; - if (!WorldGen.InWorld(landX, landY, 31)) - return false; - int maxValue = 1; - for (int index1 = landX - 30; index1 <= landX + 30; ++index1) - { - for (int index2 = landY - 20; index2 <= landY + 20; ++index2) - { - Tile tile = Main.tile[index1, index2]; - if (tile != null && tile.active() && tile.type == (ushort) 519 && tile.frameX >= (short) 180 && Main.rand.Next(maxValue) == 0) - { - cattailX = index1; - cattailY = index2; - ++maxValue; - } - } - } - return cattailX != landX || cattailY != landY; - } - - public static bool FindTreeBranch( - int landX, - int landY, - out int treeBranchX, - out int treeBranchY) - { - treeBranchX = landX; - treeBranchY = landY; - if (!WorldGen.InWorld(landX, landY, 11)) - return false; - int maxValue = 1; - for (int index1 = landX - 10; index1 <= landX + 10; ++index1) - { - for (int index2 = landY - 30; index2 <= landY + 30; ++index2) - { - Tile tile = Main.tile[index1, index2]; - if (tile != null && tile.active() && TileID.Sets.IsATreeTrunk[(int) tile.type]) - { - int num1 = (int) tile.frameX / 22; - int num2 = (int) tile.frameY / 66; - if ((num1 == 3 && num2 == 0 || num1 == 3 && num2 == 3 || num1 == 4 && num2 == 1 || num1 == 4 && num2 == 3 || num1 == 2 && num2 == 3) && Main.rand.Next(maxValue) == 0) - { - treeBranchX = index1; - treeBranchY = index2; - ++maxValue; - } - } - } - } - return treeBranchX != landX || treeBranchY != landY; - } - - public static bool AnyDanger(bool quickBossNPCCheck = false) + public static bool AnyDanger() { bool flag = false; if (NPC.MoonLordCountdown > 0) flag = true; if (Main.invasionType > 0) flag = true; - if (Main.snowMoon || Main.pumpkinMoon || DD2Event.Ongoing) - flag = true; if (!flag) { - if (quickBossNPCCheck) + for (int index = 0; index < 200; ++index) { - flag |= Main.CurrentFrameFlags.AnyActiveBossNPC; - } - else - { - for (int index = 0; index < 200; ++index) - { - if (Main.npc[index].active && (Main.npc[index].boss || NPCID.Sets.DangerThatPreventsOtherDangers[Main.npc[index].type])) - flag = true; - } + if (Main.npc[index].active && (Main.npc[index].boss || NPCID.Sets.TechnicallyABoss[Main.npc[index].type])) + flag = true; } } return flag; @@ -45988,7 +35497,7 @@ label_18: public static void SpawnWOF(Vector2 pos) { - if ((double) pos.Y / 16.0 < (double) (Main.maxTilesY - 205) || Main.wofNPCIndex >= 0 || Main.netMode == 1 || NPC.AnyNPCs(113)) + if ((double) pos.Y / 16.0 < (double) (Main.maxTilesY - 205) || Main.wof >= 0 || Main.netMode == 1) return; int closest = (int) Player.FindClosest(pos, 16, 16); int num1 = 1; @@ -46047,7 +35556,7 @@ label_18: { if (Main.netMode != 2) return; - ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", (object) Main.npc[index1].GetTypeNetName()), new Color(175, 75, (int) byte.MaxValue)); + NetMessage.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", (object) Main.npc[index1].GetTypeNetName()), new Color(175, 75, (int) byte.MaxValue)); } } @@ -46102,7 +35611,7 @@ label_18: { if (Main.netMode != 2) return; - ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", (object) Lang.GetNPCName(35).ToNetworkText()), new Color(175, 75, (int) byte.MaxValue)); + NetMessage.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", (object) Lang.GetNPCName(35).ToNetworkText()), new Color(175, 75, (int) byte.MaxValue)); } } @@ -46136,7 +35645,7 @@ label_18: break; int num4 = num3 - 15; int num5 = num3 - 15; - for (int j = num3; j > num3 - 50; --j) + for (int j = num3; j > num3 - 100; --j) { if (WorldGen.SolidTile(i, j)) { @@ -46144,7 +35653,7 @@ label_18: break; } } - for (int j = num3; j < num3 + 50; ++j) + for (int j = num3; j < num3 + 100; ++j) { if (WorldGen.SolidTile(i, j)) { @@ -46163,7 +35672,7 @@ label_18: } if (Main.netMode != 2) break; - ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", (object) Main.npc[index].GetTypeNetName()), new Color(175, 75, (int) byte.MaxValue)); + NetMessage.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", (object) Main.npc[index].GetTypeNetName()), new Color(175, 75, (int) byte.MaxValue)); break; } catch @@ -46188,7 +35697,7 @@ label_18: } if (Main.netMode != 2) break; - ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", (object) Main.npc[index4].GetTypeNetName()), new Color(175, 75, (int) byte.MaxValue)); + NetMessage.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", (object) Main.npc[index4].GetTypeNetName()), new Color(175, 75, (int) byte.MaxValue)); break; } } @@ -46205,7 +35714,7 @@ label_18: } if (Main.netMode != 2) break; - ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", (object) NetworkText.FromKey("Enemies.MoonLord")), new Color(175, 75, (int) byte.MaxValue)); + NetMessage.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", (object) NetworkText.FromKey("Enemies.MoonLord")), new Color(175, 75, (int) byte.MaxValue)); break; default: bool flag = false; @@ -46235,7 +35744,7 @@ label_18: int index8 = Main.rand.Next(minValue2, maxValue2); if (!Main.tile[index7, index8].nactive() || !Main.tileSolid[(int) Main.tile[index7, index8].type]) { - if ((!Main.wallHouse[(int) Main.tile[index7, index8].wall] || index5 >= 999) && (Type != 50 || index5 >= 500 || Main.tile[index8, index8].wall <= (ushort) 0)) + if ((!Main.wallHouse[(int) Main.tile[index7, index8].wall] || index5 >= 999) && (Type != 50 || index5 >= 500 || Main.tile[index8, index8].wall <= (byte) 0)) { for (int index9 = index8; index9 < Main.maxTilesY; ++index9) { @@ -46316,57 +35825,42 @@ label_18: } if (!flag) break; - NPC.SpawnBoss(num7 * 16 + 8, num8 * 16, Type, plr); + int number = NPC.NewNPC(num7 * 16 + 8, num8 * 16, Type, 1); + if (number == 200) + break; + Main.npc[number].target = plr; + Main.npc[number].timeLeft *= 20; + string typeName1 = Main.npc[number].TypeName; + if (Main.netMode == 2 && number < 200) + NetMessage.SendData(23, number: number); + if (Type == 134 || Type == (int) sbyte.MaxValue || Type == 126 || Type == 125) + AchievementsHelper.CheckMechaMayhem(); + if (Type == 125) + { + if (Main.netMode == 0) + { + Main.NewText(Lang.misc[48].Value, (byte) 175, (byte) 75); + break; + } + if (Main.netMode != 2) + break; + NetMessage.BroadcastChatMessage(Lang.misc[48].ToNetworkText(), new Color(175, 75, (int) byte.MaxValue)); + break; + } + if (Type == 82 || Type == 126 || Type == 50 || Type == 398 || Type == 551) + break; + if (Main.netMode == 0) + { + Main.NewText(Language.GetTextValue("Announcement.HasAwoken", (object) typeName1), (byte) 175, (byte) 75); + break; + } + if (Main.netMode != 2) + break; + NetMessage.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", (object) Main.npc[number].GetTypeNetName()), new Color(175, 75, (int) byte.MaxValue)); break; } } - public static void SpawnBoss( - int spawnPositionX, - int spawnPositionY, - int Type, - int targetPlayerIndex) - { - int number = NPC.NewNPC(spawnPositionX, spawnPositionY, Type, 1); - if (number == 200) - return; - Main.npc[number].target = targetPlayerIndex; - Main.npc[number].timeLeft *= 20; - string typeName = Main.npc[number].TypeName; - if (Main.netMode == 2 && number < 200) - NetMessage.SendData(23, number: number); - if (Type == 134 || Type == (int) sbyte.MaxValue || Type == 126 || Type == 125) - AchievementsHelper.CheckMechaMayhem(); - if (Type == 125) - { - if (Main.netMode == 0) - { - Main.NewText(Lang.misc[48].Value, (byte) 175, (byte) 75); - } - else - { - if (Main.netMode != 2) - return; - ChatHelper.BroadcastChatMessage(Lang.misc[48].ToNetworkText(), new Color(175, 75, (int) byte.MaxValue)); - } - } - else - { - if (Type == 316 || Type == 662 || Type == 82 || Type == 126 || Type == 50 || Type == 398 || Type == 551) - return; - if (Main.netMode == 0) - { - Main.NewText(Language.GetTextValue("Announcement.HasAwoken", (object) typeName), (byte) 175, (byte) 75); - } - else - { - if (Main.netMode != 2) - return; - ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", (object) Main.npc[number].GetTypeNetName()), new Color(175, 75, (int) byte.MaxValue)); - } - } - } - public static int NewNPC( int X, int Y, @@ -46378,87 +35872,65 @@ label_18: float ai3 = 0.0f, int Target = 255) { - if (Main.getGoodWorld) - { - if (Type == 46) - Type = 614; - if (Type == 62) - Type = 66; - } - int nextNPC = -1; + int index1 = -1; if (Type == 222) { - for (int index = 199; index >= 0; --index) + for (int index2 = 199; index2 >= 0; --index2) { - if (!Main.npc[index].active) + if (!Main.npc[index2].active) { - nextNPC = index; + index1 = index2; break; } } } else { - for (int index = Start; index < 200; ++index) + for (int index3 = Start; index3 < 200; ++index3) { - if (!Main.npc[index].active) + if (!Main.npc[index3].active) { - nextNPC = index; + index1 = index3; break; } } } - if (nextNPC < 0) + if (index1 < 0) return 200; - Main.npc[nextNPC] = new NPC(); - Main.npc[nextNPC].SetDefaults(Type); - Main.npc[nextNPC].whoAmI = nextNPC; - NPC.GiveTownUniqueDataToNPCsThatNeedIt(Type, nextNPC); - Main.npc[nextNPC].position.X = (float) (X - Main.npc[nextNPC].width / 2); - Main.npc[nextNPC].position.Y = (float) (Y - Main.npc[nextNPC].height); - Main.npc[nextNPC].active = true; - Main.npc[nextNPC].timeLeft = (int) ((double) NPC.activeTime * 1.25); - Main.npc[nextNPC].wet = Collision.WetCollision(Main.npc[nextNPC].position, Main.npc[nextNPC].width, Main.npc[nextNPC].height); - Main.npc[nextNPC].ai[0] = ai0; - Main.npc[nextNPC].ai[1] = ai1; - Main.npc[nextNPC].ai[2] = ai2; - Main.npc[nextNPC].ai[3] = ai3; - Main.npc[nextNPC].target = Target; + Main.npc[index1] = new NPC(); + Main.npc[index1].SetDefaults(Type); + if (NPC.TypeToHeadIndex(Type) != -1 || Type == 453) + Main.npc[index1].GivenName = NPC.getNewNPCName(Type); + Main.npc[index1].position.X = (float) (X - Main.npc[index1].width / 2); + Main.npc[index1].position.Y = (float) (Y - Main.npc[index1].height); + Main.npc[index1].active = true; + Main.npc[index1].timeLeft = (int) ((double) NPC.activeTime * 1.25); + Main.npc[index1].wet = Collision.WetCollision(Main.npc[index1].position, Main.npc[index1].width, Main.npc[index1].height); + Main.npc[index1].ai[0] = ai0; + Main.npc[index1].ai[1] = ai1; + Main.npc[index1].ai[2] = ai2; + Main.npc[index1].ai[3] = ai3; + Main.npc[index1].target = Target; if (Type == 50) { switch (Main.netMode) { case 0: - Main.NewText(Language.GetTextValue("Announcement.HasAwoken", (object) Main.npc[nextNPC].TypeName), (byte) 175, (byte) 75); + Main.NewText(Language.GetTextValue("Announcement.HasAwoken", (object) Main.npc[index1].TypeName), (byte) 175, (byte) 75); break; case 2: - ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", (object) Main.npc[nextNPC].GetTypeNetName()), new Color(175, 75, (int) byte.MaxValue)); + NetMessage.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", (object) Main.npc[index1].GetTypeNetName()), new Color(175, 75, (int) byte.MaxValue)); break; } } - return nextNPC; - } - - private static void GiveTownUniqueDataToNPCsThatNeedIt(int Type, int nextNPC) - { - if (NPC.TypeToDefaultHeadIndex(Type) == -1 && Type != 453) - return; - Main.npc[nextNPC].GivenName = NPC.getNewNPCName(Type); - ITownNPCProfile profile; - if (TownNPCProfiles.Instance.GetProfile(Type, out profile)) - { - Main.npc[nextNPC].townNpcVariationIndex = profile.RollVariation(); - Main.npc[nextNPC].GivenName = profile.GetNameForVariant(Main.npc[nextNPC]); - } - Main.npc[nextNPC].needsUniqueInfoUpdate = true; + return index1; } public void TransformVisuals(int oldType, int newType) { - this.position = this.position + this.netOffset; if (oldType == 158 && newType == 159 || oldType == 159 && newType == 158) { - SoundEngine.PlaySound(SoundID.Item8, this.position); + Main.PlaySound(SoundID.Item8, this.position); int index1 = Gore.NewGore(new Vector2(this.position.X, this.position.Y - 10f), this.velocity, 99, this.scale); Main.gore[index1].velocity *= 0.3f; int index2 = Gore.NewGore(new Vector2(this.position.X, (float) ((double) this.position.Y + (double) (this.height / 2) - 10.0)), this.velocity, 99, this.scale); @@ -46508,19 +35980,17 @@ label_18: dust.velocity *= dust.scale / 2f; } } - if (oldType == 427 && newType == 426) + if (oldType != 427 || newType != 426) + return; + for (int index = 0; index < 30; ++index) { - for (int index = 0; index < 30; ++index) - { - int Type = Utils.SelectRandom(Main.rand, 229, 240, 240); - Dust dust = Main.dust[Dust.NewDust(this.position, this.width, this.height, Type)]; - dust.noGravity = true; - dust.scale = (float) (0.600000023841858 + (double) Main.rand.NextFloat() * 1.79999995231628); - dust.fadeIn = 0.25f; - dust.velocity *= dust.scale * 0.75f; - } + int Type = Utils.SelectRandom(Main.rand, 229, 240, 240); + Dust dust = Main.dust[Dust.NewDust(this.position, this.width, this.height, Type)]; + dust.noGravity = true; + dust.scale = (float) (0.600000023841858 + (double) Main.rand.NextFloat() * 1.79999995231628); + dust.fadeIn = 0.25f; + dust.velocity *= dust.scale * 0.75f; } - this.position = this.position - this.netOffset; } public void Teleport(Vector2 newPos, int Style = 0, int extraInfo = 0) @@ -46529,15 +35999,14 @@ label_18: if (Style == 4) extraInfo1 = this.lastPortalColorIndex; float dustCountMult = (double) this.teleportTime > 0.0 ? 0.3f : 1f; - Vector2 position = this.position; - Main.TeleportEffect(this.getRect(), Style, extraInfo1, dustCountMult, otherPosition: newPos); + Main.TeleportEffect(this.getRect(), Style, extraInfo1, dustCountMult); this.position = newPos; if (Style == 4) { this.lastPortalColorIndex = extraInfo; extraInfo1 = this.lastPortalColorIndex; } - Main.TeleportEffect(this.getRect(), Style, extraInfo1, dustCountMult, TeleportationSide.Exit, position); + Main.TeleportEffect(this.getRect(), Style, extraInfo1, dustCountMult); this.teleportTime = 1f; this.teleportStyle = Style; if (Main.netMode != 2 || Style == 4) @@ -46549,7 +36018,6 @@ label_18: { if (Main.netMode == 1) return; - int extraValue = this.extraValue; bool flag = false; if ((double) this.value == 0.0) flag = true; @@ -46574,11 +36042,6 @@ label_18: this.TargetClosest(); this.velocity = velocity; this.position.Y -= (float) this.height; - for (int index = 0; index < 5; ++index) - { - this.buffType[index] = numArray1[index]; - this.buffTime[index] = numArray2[index]; - } if (flag) this.value = 0.0f; if (this.lifeMax == lifeMax) @@ -46589,7 +36052,11 @@ label_18: this.homeTileY = (int) ((double) this.position.Y + (double) this.height) / 16; this.homeless = true; } - this.extraValue = extraValue; + for (int index = 0; index < 5; ++index) + { + this.buffType[index] = numArray1[index]; + this.buffTime[index] = numArray2[index]; + } if (Main.netMode == 2) { this.netUpdate = true; @@ -46597,12 +36064,11 @@ label_18: NetMessage.SendData(54, number: this.whoAmI); } this.TransformVisuals(type, newType); - NPC.GiveTownUniqueDataToNPCsThatNeedIt(this.type, this.whoAmI); + if (NPC.TypeToHeadIndex(this.type) != -1) + Main.npc[this.whoAmI].GivenName = NPC.getNewNPCName(this.type); + this.npcNameLookup = (byte) 0; if (this.townNPC) - { this.homeless = true; - WorldGen.CheckAchievement_RealEstate(); - } this.altTexture = 0; } @@ -46650,7 +36116,7 @@ label_18: Defense -= 40; if (Defense < 0) Defense = 0; - double dmg = Main.CalculateDamageNPCsTake((int) num1, Defense); + double dmg = Main.CalculateDamage((int) num1, Defense); if (crit) dmg *= 2.0; if ((double) this.takenDamageMultiplier > 1.0) @@ -46674,12 +36140,6 @@ label_18: if (flag) this.PlayerInteraction(Main.myPlayer); this.justHit = true; - if ((this.type == 438 || this.type == 379) && Main.netMode != 1) - { - int index = (int) (-(double) this.ai[3] - 1.0); - if (index > -1 && (double) Main.npc[index].localAI[0] == 0.0) - Main.npc[index].localAI[0] = 1f; - } if (this.townNPC) { if ((this.aiStyle != 7 ? 0 : ((double) this.ai[0] == 3.0 || (double) this.ai[0] == 4.0 || (double) this.ai[0] == 16.0 ? 1 : ((double) this.ai[0] == 17.0 ? 1 : 0))) != 0) @@ -46760,8 +36220,6 @@ label_18: if ((double) knockBack > 0.0 && (double) this.knockBackResist > 0.0) { float num2 = knockBack * this.knockBackResist; - if (this.onFire2) - num2 *= 1.1f; if ((double) num2 > 8.0) num2 = 8f + (num2 - 8f) * 0.9f; if ((double) num2 > 10.0) @@ -46825,7 +36283,7 @@ label_18: else this.HitEffect(hitDirection, dmg); if (this.HitSound != null) - SoundEngine.PlaySound(this.HitSound, this.position); + Main.PlaySound(this.HitSound, this.position); if (this.realLife >= 0) Main.npc[this.realLife].checkDead(); else @@ -46833,76 +36291,9 @@ label_18: return dmg; } - public static void LadyBugKilled(Vector2 Position, bool GoldLadyBug = false) - { - Main.ladyBugRainBoost += NPC.ladyBugRainTime; - int player = Main.myPlayer; - if (!Main.player[player].active || Main.player[player].dead) - return; - Vector2 vector2 = Position - Main.player[player].Center; - int num1 = 400; - if ((double) vector2.Length() >= (double) num1) - return; - if ((double) vector2.Length() < 100.0) - vector2 = new Vector2(); - double num2 = 1.0 - (double) vector2.Length() / (double) num1; - int num3 = (int) ((double) NPC.ladyBugBadLuckTime * num2); - if (GoldLadyBug) - num3 *= 2; - if (num3 >= Main.player[player].ladyBugLuckTimeLeft) - return; - Main.player[player].ladyBugLuckTimeLeft = num3; - Main.player[player].luckNeedsSync = true; - } - - private void LadyBugLuck(int plr, bool GoldLadyBug = false) - { - if (this.releaseOwner != (short) byte.MaxValue || Main.player[plr].ladyBugLuckTimeLeft < 0) - return; - Vector2 vector2 = this.Center - Main.player[plr].Center; - int num1 = 800; - if ((double) vector2.Length() >= (double) num1) - return; - if ((double) vector2.Length() < 30.0) - vector2 = new Vector2(); - double num2 = Math.Pow(1.0 - (double) vector2.Length() / (double) num1, 6.0); - int num3 = (int) ((double) NPC.ladyBugGoodLuckTime * num2); - if (GoldLadyBug) - num3 *= 2; - if (num3 <= Main.player[plr].ladyBugLuckTimeLeft) - return; - Main.player[plr].ladyBugLuckTimeLeft = num3; - Main.player[plr].luckNeedsSync = true; - } - - private void NPCLuck() - { - int player = Main.myPlayer; - if (this.type == 22) - { - if (Main.player[player].ladyBugLuckTimeLeft < 0 || !Main.player[player].active || Main.player[player].dead) - return; - int num = NPC.ladyBugGoodLuckTime / 3; - if (num <= Main.player[player].ladyBugLuckTimeLeft) - return; - Main.player[player].ladyBugLuckTimeLeft = num; - Main.player[player].luckNeedsSync = true; - } - else - { - if (this.type == 54 || !Main.player[player].active || Main.player[player].dead) - return; - int num = NPC.ladyBugBadLuckTime / 3; - if (num >= Main.player[player].ladyBugLuckTimeLeft) - return; - Main.player[player].ladyBugLuckTimeLeft = num; - Main.player[player].luckNeedsSync = true; - } - } - public void HitEffect(int hitDirection = 0, double dmg = 10.0) { - // ISSUE: The method is too long to display (53918 instructions) + // ISSUE: unable to decompile the method. } public static int CountNPCS(int Type) @@ -46916,16 +36307,6 @@ label_18: return num; } - public static bool AnyHelpfulFairies() - { - for (int index = 0; index < 200; ++index) - { - if (Main.npc[index].active && (Main.npc[index].type == 583 || Main.npc[index].type == 584 || Main.npc[index].type == 585) && (double) Main.npc[index].ai[2] > 1.0) - return true; - } - return false; - } - public static bool AnyNPCs(int Type) { for (int index = 0; index < 200; ++index) @@ -47002,18 +36383,18 @@ label_18: } while (index1 == -1) { - int buffIndex = -1; + int b = -1; for (int index3 = 0; index3 < 5; ++index3) { if (!Main.debuff[this.buffType[index3]]) { - buffIndex = index3; + b = index3; break; } } - if (buffIndex == -1) + if (b == -1) return; - for (int index4 = buffIndex; index4 < 5; ++index4) + for (int index4 = b; index4 < 5; ++index4) { if (this.buffType[index4] == 0) { @@ -47022,29 +36403,16 @@ label_18: } } if (index1 == -1) - this.DelBuff(buffIndex); + this.DelBuff(b); } this.buffType[index1] = type; this.buffTime[index1] = time; } - public void RequestBuffRemoval(int buffTypeToRemove) + public void DelBuff(int b) { - if (buffTypeToRemove < 0 || buffTypeToRemove >= 323 || !BuffID.Sets.CanBeRemovedByNetMessage[buffTypeToRemove]) - return; - int buffIndex = this.FindBuffIndex(buffTypeToRemove); - if (buffIndex == -1) - return; - this.DelBuff(buffIndex); - if (Main.netMode != 1) - return; - NetMessage.SendData(137, number: this.whoAmI, number2: ((float) buffTypeToRemove)); - } - - public void DelBuff(int buffIndex) - { - this.buffTime[buffIndex] = 0; - this.buffType[buffIndex] = 0; + this.buffTime[b] = 0; + this.buffType[b] = 0; for (int index1 = 0; index1 < 4; ++index1) { if (this.buffTime[index1] == 0 || this.buffType[index1] == 0) @@ -47067,17 +36435,15 @@ label_18: public bool CanBeChasedBy(object attacker = null, bool ignoreDontTakeDamage = false) => this.active && this.chaseable && this.lifeMax > 5 && !this.dontTakeDamage | ignoreDontTakeDamage && !this.friendly && !this.immortal; - public bool CountsAsACritter => this.lifeMax <= 5 && this.damage == 0 && this.type != 594; - public void moneyPing(Vector2 pos) { - SoundEngine.PlaySound(38, pos); + Main.PlaySound(38, pos); int Type = 244; - if (this.extraValue >= 1000000) + if ((double) this.extraValue >= 1000000.0) Type = 247; - else if (this.extraValue >= 10000) + else if ((double) this.extraValue >= 10000.0) Type = 246; - else if (this.extraValue >= 100) + else if ((double) this.extraValue >= 100.0) Type = 245; for (int index1 = 0; index1 < 20; ++index1) { @@ -47089,122 +36455,88 @@ label_18: public void IdleSounds() { if ((this.type == 239 || this.type == 240) && Main.rand.Next(900) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(24, 26)); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(24, 26)); else if ((this.type == 62 || this.type == 156) && Main.rand.Next(700) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(26, 30)); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(26, 30)); else if (this.type == 177 && Main.rand.Next(600) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(30, 32)); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(30, 32)); else if (this.type == 226 && Main.rand.Next(800) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, 32); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, 32); else if (this.type == 153 && Main.rand.Next(1000) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, 33); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, 33); else if (this.wet && (this.type == 63 || this.type == 64 || this.type == 103) && Main.rand.Next(1000) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(34, 36)); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(34, 36)); else if ((this.type == 198 || this.type == 199) && Main.rand.Next(1000) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(36, 38)); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(36, 38)); else if ((this.type == 170 || this.type == 180 || this.type == 171) && Main.rand.Next(600) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(38, 41)); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(38, 41)); else if (this.type == 250 && Main.rand.Next(700) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(41, 44)); - else if (this.type == 580 && Main.rand.Next(800) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, 44); - else if (this.type == 582 && Main.rand.Next(800) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, 44); - else if (this.type == 581 && Main.rand.Next(800) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(44, 47)); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(41, 44)); else if (this.type == 508 && Main.rand.Next(800) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, 44); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, 44); else if (this.type == 509 && Main.rand.Next(800) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(44, 47)); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(44, 47)); else if (this.type == 494 && Main.rand.Next(600) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, 47); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, 47); else if (this.type == 467 && Main.rand.Next(700) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(48, 50)); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(48, 50)); else if (this.type == 468 && Main.rand.Next(700) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(50, 53)); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(50, 53)); else if (this.type == 288 && Main.rand.Next(400) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(53, 55)); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(53, 55)); else if ((this.type == 524 || this.type == 525 || this.type == 526 || this.type == 527) && Main.rand.Next(700) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(55, 57)); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(55, 57)); else if ((this.type == 496 || this.type == 497) && Main.rand.Next(600) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(57, 59)); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(57, 59)); else if (this.type == 389 && Main.rand.Next(800) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(59, 61)); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(59, 61)); else if (this.type == 471 && Main.rand.Next(600) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(61, 63)); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(61, 63)); else if (this.type == 482 && Main.rand.Next(600) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(63, 66)); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(63, 66)); else if (this.type == 388 && Main.rand.Next(700) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(66, 69)); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(66, 69)); else if (this.type == 520 && Main.rand.Next(800) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(69, 73)); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(69, 73)); else if (this.type == 477 && Main.rand.Next(600) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, 73); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, 73); else if (this.type == 258 && Main.rand.Next(700) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(74, 78)); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(74, 78)); else if (this.type == 252 && Main.rand.Next(700) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, 78); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, 78); else if (this.type == 469 && Main.rand.Next(700) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(79, 81)); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(79, 81)); else if ((this.type == 253 || this.type == 82) && Main.rand.Next(700) == 0) - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(81, 84)); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(81, 84)); else if (this.type >= 498 && this.type <= 506 && Main.rand.Next(600) == 0) { - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(84, 86)); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(84, 86)); } else { if (this.type != 391 || Main.rand.Next(700) != 0) return; - SoundEngine.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(86, 87)); + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, Main.rand.Next(86, 87)); } } - public void UpdateAltTexture() + private void UpdateAltTexture() { if (!this.townNPC) return; int altTexture = this.altTexture; - bool flag = BirthdayParty.PartyIsUp || this.ForcePartyHatOn; - if (this.type == 441 || this.type == 453 || this.type == 633) - flag = false; - this.altTexture = 0; - if (flag) - this.altTexture = 1; - if (this.type == 633 && this.ShouldBestiaryGirlBeLycantrope()) - this.altTexture = 2; - if (this.ForcePartyHatOn) - return; - this.MakeTransitionEffectsForTextureChanges(altTexture, this.altTexture); - } - - private void MakeTransitionEffectsForTextureChanges(int oldAltTexture, int currentAltTexture) - { - if (oldAltTexture == 0 && currentAltTexture == 1) + this.altTexture = !BirthdayParty.PartyIsUp ? 0 : 1; + if (this.type == 441 || this.type == 453) + this.altTexture = 0; + if (altTexture == 0 && this.altTexture == 1) { for (int index = 0; index < 20; ++index) Dust.NewDust(this.position, this.width, this.height / 4, 139 + Main.rand.Next(4), SpeedY: -2f); } - if (oldAltTexture == 1 && currentAltTexture == 0) + if (altTexture != 1 || this.altTexture != 0) + return; + for (int index = 0; index < 4; ++index) Utils.PoofOfSmoke(this.position); - if (this.type != 633) - return; - int num = 2; - if ((oldAltTexture != 0 || currentAltTexture != num ? (oldAltTexture != num ? 0 : (currentAltTexture == 0 ? 1 : 0)) : 1) == 0) - return; - for (int index = 0; index < 20; ++index) - { - Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 262, SpeedY: -2f); - dust.noGravity = true; - dust.scale = 2f; - } - } - - public static void ResetNetOffsets() - { - NPC.offSetDelayTime = 180; - for (int index = 0; index < 200; ++index) - Main.npc[index].netOffset *= 0.0f; } public void UpdateNPC(int i) @@ -47212,54 +36544,25 @@ label_18: this.whoAmI = i; if (!this.active) return; - if (NPC.offSetDelayTime > 0) - this.netOffset *= 0.0f; - else if (Main.netMode == 2) - this.netOffset *= 0.0f; - else if (Main.multiplayerNPCSmoothingRange <= 0) - this.netOffset *= 0.0f; - else if (this.netOffset != new Vector2(0.0f, 0.0f)) - { - if (NPCID.Sets.NoMultiplayerSmoothingByType[this.type]) - this.netOffset *= 0.0f; - else if (NPCID.Sets.NoMultiplayerSmoothingByAI[this.aiStyle]) - { - this.netOffset *= 0.0f; - } - else - { - float num1 = 2f; - float npcSmoothingRange = (float) Main.multiplayerNPCSmoothingRange; - float num2 = this.netOffset.Length(); - if ((double) num2 > (double) npcSmoothingRange) - { - this.netOffset.Normalize(); - this.netOffset *= npcSmoothingRange; - num2 = this.netOffset.Length(); - } - float num3 = num1 + num2 / npcSmoothingRange * num1; - Vector2 netOffset = this.netOffset; - netOffset.Normalize(); - this.netOffset -= netOffset * num3; - if ((double) this.netOffset.Length() < (double) num3) - this.netOffset *= 0.0f; - if (this.townNPC && (double) Vector2.Distance(this.position, new Vector2((float) (this.homeTileX * 16 + 8 - this.width / 2), (float) (this.homeTileY * 16 - this.height) - 0.1f)) < 1.0) - this.netOffset *= 0.0f; - } - } this.UpdateAltTexture(); if (this.type == 368) NPC.travelNPC = true; - if (Main.netMode != 2) - this.UpdateNPC_CastLights(); + this.UpdateNPC_CastLights(); this.UpdateNPC_TeleportVisuals(); this.UpdateNPC_CritterSounds(); - this.TrySyncingUniqueTownNPCData(i); - if (this.aiStyle == 7 && (double) this.position.Y > (double) Main.bottomWorld - 640.0 + (double) this.height && Main.netMode != 1 && !Main.xMas) + if (Main.netMode == 1 && (this.townNPC || this.type == 453) && this.type != 37 && this.npcNameLookup == (byte) 0) { - this.StrikeNPCNoInteraction(9999, 0.0f, 0); - if (Main.netMode == 2) - NetMessage.SendData(28, number: this.whoAmI, number2: 9999f); + this.npcNameLookup = (byte) 1; + int number = -1; + for (int index = 0; index < 200; ++index) + { + if (Main.npc[index] == this) + { + number = index; + break; + } + } + NetMessage.SendData(56, number: number); } if (Main.netMode == 1) { @@ -47303,220 +36606,195 @@ label_18: this.UpdateNPC_SoulDrainDebuff(); this.UpdateNPC_BuffClearExpiredBuffs(); this.UpdateNPC_BuffApplyDOTs(); - this.UpdateNPC_BuffApplyVFX(); this.UpdateNPC_BloodMoonTransformations(); float maxFallSpeed; this.UpdateNPC_UpdateGravity(out maxFallSpeed); if (this.soundDelay > 0) --this.soundDelay; if (this.life <= 0) - { this.active = false; - this.UpdateNetworkCode(i); - this.netUpdate = false; - this.justHit = false; + this.oldTarget = this.target; + this.oldDirection = this.direction; + this.oldDirectionY = this.directionY; + float num1 = (float) (1.0 + (double) Math.Abs(this.velocity.X) / 3.0); + if ((double) this.gfxOffY > 0.0) + { + this.gfxOffY -= num1 * this.stepSpeed; + if ((double) this.gfxOffY < 0.0) + this.gfxOffY = 0.0f; + } + else if ((double) this.gfxOffY < 0.0) + { + this.gfxOffY += num1 * this.stepSpeed; + if ((double) this.gfxOffY > 0.0) + this.gfxOffY = 0.0f; + } + if ((double) this.gfxOffY > 16.0) + this.gfxOffY = 16f; + if ((double) this.gfxOffY < -16.0) + this.gfxOffY = -16f; + this.TryPortalJumping(); + this.IdleSounds(); + this.AI(); + if (Main.netMode != 2 && (double) this.extraValue > 0.0) + { + int Type = 244; + float num2 = 30f; + if ((double) this.extraValue >= 1000000.0) + { + Type = 247; + num2 *= 0.25f; + } + else if ((double) this.extraValue >= 10000.0) + { + Type = 246; + num2 *= 0.5f; + } + else if ((double) this.extraValue >= 100.0) + { + Type = 245; + num2 *= 0.75f; + } + if (Main.rand.Next((int) num2) == 0) + { + int index = Dust.NewDust(this.position, this.width, this.height, Type, Alpha: 254, Scale: 0.25f); + Main.dust[index].velocity *= 0.1f; + } + } + for (int index = 0; index < 256; ++index) + { + if (this.immune[index] > 0) + --this.immune[index]; + } + if (!this.noGravity && !this.noTileCollide) + { + int x = (int) ((double) this.position.X + (double) (this.width / 2)) / 16; + int y = (int) ((double) this.position.Y + (double) (this.height / 2)) / 16; + if (WorldGen.InWorld(x, y) && Main.tile[x, y] == null) + { + NPC.gravity = 0.0f; + this.velocity.X = 0.0f; + this.velocity.Y = 0.0f; + } + } + if (!this.noGravity) + { + this.velocity.Y += NPC.gravity; + if ((double) this.velocity.Y > (double) maxFallSpeed) + this.velocity.Y = maxFallSpeed; + } + if ((double) this.velocity.X < 0.005 && (double) this.velocity.X > -0.005) + this.velocity.X = 0.0f; + if (Main.netMode != 1 && this.type != 37 && (this.friendly || this.type == 46 || this.type == 55 || this.type == 74 || this.type == 148 || this.type == 149 || this.type == 230 || this.type == 297 || this.type == 298 || this.type == 299 || this.type == 303 || this.type == 355 || this.type == 356 || this.type == 358 || this.type == 359 || this.type == 360 || this.type == 361 || this.type == 362 || this.type == 363 || this.type == 364 || this.type == 365 || this.type == 366 || this.type == 367 || this.type == 377 || this.type == 357 || this.type == 374 || this.type >= 442 && this.type <= 448 && this.type != 447) || this.type == 538 || this.type == 539 || this.type == 337 || this.type == 540 || this.type >= 484 && this.type <= 487) + { + if (this.townNPC) + this.CheckDrowning(); + this.CheckLifeRegen(); + this.CheckMeleeCollision(); + } + if (!this.noTileCollide) + { + this.UpdateCollision(); } else { - this.oldTarget = this.target; + this.oldPosition = this.position; this.oldDirection = this.direction; - this.oldDirectionY = this.directionY; - float num4 = (float) (1.0 + (double) Math.Abs(this.velocity.X) / 3.0); - if ((double) this.gfxOffY > 0.0) + this.position = this.position + this.velocity; + if (this.onFire && this.boss && Main.netMode != 1 && Collision.WetCollision(this.position, this.width, this.height)) { - this.gfxOffY -= num4 * this.stepSpeed; - if ((double) this.gfxOffY < 0.0) - this.gfxOffY = 0.0f; - } - else if ((double) this.gfxOffY < 0.0) - { - this.gfxOffY += num4 * this.stepSpeed; - if ((double) this.gfxOffY > 0.0) - this.gfxOffY = 0.0f; - } - if ((double) this.gfxOffY > 16.0) - this.gfxOffY = 16f; - if ((double) this.gfxOffY < -16.0) - this.gfxOffY = -16f; - this.TryPortalJumping(); - this.IdleSounds(); - this.AI(); - if (Main.netMode != 2 && this.extraValue > 0) - { - int Type = 244; - float num5 = 30f; - if (this.extraValue >= 1000000) + for (int b = 0; b < 5; ++b) { - Type = 247; - num5 *= 0.25f; - } - else if (this.extraValue >= 10000) - { - Type = 246; - num5 *= 0.5f; - } - else if (this.extraValue >= 100) - { - Type = 245; - num5 *= 0.75f; - } - if (Main.rand.Next((int) num5) == 0) - { - this.position = this.position + this.netOffset; - int index = Dust.NewDust(this.position, this.width, this.height, Type, Alpha: 254, Scale: 0.25f); - Main.dust[index].velocity *= 0.1f; - this.position = this.position - this.netOffset; + if (this.buffType[b] == 24) + this.DelBuff(b); } } - for (int index = 0; index < 256; ++index) - { - if (this.immune[index] > 0) - --this.immune[index]; - } - if (!this.noGravity && !this.noTileCollide) - { - int x = (int) ((double) this.position.X + (double) (this.width / 2)) / 16; - int y = (int) ((double) this.position.Y + (double) (this.height / 2)) / 16; - if (WorldGen.InWorld(x, y) && Main.tile[x, y] == null) - { - NPC.gravity = 0.0f; - this.velocity.X = 0.0f; - this.velocity.Y = 0.0f; - } - } - if (!this.noGravity) - { - this.velocity.Y += NPC.gravity; - if ((double) this.velocity.Y > (double) maxFallSpeed) - this.velocity.Y = maxFallSpeed; - } - if ((double) this.velocity.X < 0.005 && (double) this.velocity.X > -0.005) - this.velocity.X = 0.0f; - if (Main.netMode != 1 && this.type != 37 && (this.friendly || NPCID.Sets.TakesDamageFromHostilesWithoutBeingFriendly[this.type])) - { - if (this.townNPC) - this.CheckDrowning(); - this.CheckLifeRegen(); - this.GetHurtByOtherNPCs(NPCID.Sets.AllNPCs); - } - if (Main.netMode != 1 && (NPC.npcsFoundForCheckActive[210] || NPC.npcsFoundForCheckActive[211]) && !NPCID.Sets.HurtingBees[this.type]) - this.GetHurtByOtherNPCs(NPCID.Sets.HurtingBees); - if (!this.noTileCollide) - { - this.UpdateCollision(); - } - else - { - this.oldPosition = this.position; - this.oldDirection = this.direction; - this.position = this.position + this.velocity; - if (this.onFire && this.boss && Main.netMode != 1 && Collision.WetCollision(this.position, this.width, this.height)) - { - for (int buffIndex = 0; buffIndex < 5; ++buffIndex) - { - if (this.buffType[buffIndex] == 24) - this.DelBuff(buffIndex); - } - } - } - if (Main.netMode != 1 && !this.noTileCollide && this.lifeMax > 1 && Collision.SwitchTiles(this.position, this.width, this.height, this.oldPosition, 2) && (this.type == 46 || this.type == 148 || this.type == 149 || this.type == 303 || this.type == 361 || this.type == 362 || this.type == 364 || this.type == 366 || this.type == 367 || this.type >= 442 && this.type <= 448 || this.type == 602 || this.type == 608 || this.type == 614)) - { - this.ai[0] = 1f; - this.ai[1] = 400f; - this.ai[2] = 0.0f; - } - this.FindFrame(); - this.UpdateNPC_UpdateTrails(); - this.UpdateNetworkCode(i); - this.CheckActive(); - this.netUpdate = false; - this.justHit = false; } - } - - private void TrySyncingUniqueTownNPCData(int npcIndex) - { - if (Main.netMode != 1 || !this.needsUniqueInfoUpdate || !this.townNPC && this.type != 453 || this.type == 37) - return; - this.needsUniqueInfoUpdate = false; - NetMessage.SendData(56, number: npcIndex); - } - - private void UpdateNetworkCode(int i) - { + if (Main.netMode != 1 && !this.noTileCollide && this.lifeMax > 1 && Collision.SwitchTiles(this.position, this.width, this.height, this.oldPosition, 2) && (this.type == 46 || this.type == 148 || this.type == 149 || this.type == 303 || this.type == 361 || this.type == 362 || this.type == 364 || this.type == 366 || this.type == 367 || this.type >= 442 && this.type <= 448)) + { + this.ai[0] = 1f; + this.ai[1] = 400f; + this.ai[2] = 0.0f; + } + this.FindFrame(); + this.UpdateNPC_UpdateTrails(); if (!this.active) this.netUpdate = true; - if (Main.netMode != 2) - return; - if (Main.npcStreamSpeed > 0 && !this.townNPC && (double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) > 1.0) + if (Main.netMode == 2) { - ++this.netStream; - if ((int) this.netStream > Main.npcStreamSpeed) + if (Main.npcStreamSpeed > 0 && !this.townNPC && (double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) > 1.0) { - for (int remoteClient = 0; remoteClient < (int) byte.MaxValue; ++remoteClient) + ++this.netStream; + if ((int) this.netStream > Main.npcStreamSpeed) { - if (Main.player[remoteClient].active) + for (int remoteClient = 0; remoteClient < (int) byte.MaxValue; ++remoteClient) { - this.netStream = (byte) 0; - float num = Math.Abs(this.Center.X - Main.player[remoteClient].Center.X) + Math.Abs(this.Center.Y - Main.player[remoteClient].Center.Y); - if ((double) num < 250.0) - this.streamPlayer[remoteClient] -= (byte) 8; - else if ((double) num < 500.0) - this.streamPlayer[remoteClient] -= (byte) 4; - else if ((double) num < 1000.0) - this.streamPlayer[remoteClient] -= (byte) 2; - else if ((double) num < 1500.0) - --this.streamPlayer[remoteClient]; - if (this.streamPlayer[remoteClient] <= (byte) 0) + if (Main.player[remoteClient].active) { - this.streamPlayer[remoteClient] = (byte) 8; - NetMessage.SendData(23, remoteClient, number: i); + float num3 = Math.Abs(this.Center.X - Main.player[remoteClient].Center.X) + Math.Abs(this.Center.Y - Main.player[remoteClient].Center.Y); + if ((double) num3 < 250.0) + this.streamPlayer[remoteClient] -= (byte) 8; + else if ((double) num3 < 500.0) + this.streamPlayer[remoteClient] -= (byte) 4; + else if ((double) num3 < 1000.0) + this.streamPlayer[remoteClient] -= (byte) 2; + else if ((double) num3 < 1500.0) + --this.streamPlayer[remoteClient]; + if (this.streamPlayer[remoteClient] <= (byte) 0) + { + this.streamPlayer[remoteClient] = (byte) 8; + NetMessage.SendData(23, remoteClient, number: i); + } } } } } - } - if (this.townNPC) - this.netSpam = 0; - if (this.netUpdate2) - this.netUpdate = true; - if (!this.active) - this.netSpam = 0; - if (this.netUpdate) - { - if (this.boss) + if (this.townNPC) + this.netSpam = 0; + if (this.netUpdate2) + this.netUpdate = true; + if (!this.active) + this.netSpam = 0; + if (this.netUpdate) { - Vector2 vector2 = this.oldPosition - this.position; - if (this.netSpam <= 15) + if (this.boss) { - this.netSpam += 5; + Vector2 vector2 = this.oldPosition - this.position; + if (this.netSpam <= 15) + { + this.netSpam += 5; + NetMessage.SendData(23, number: i); + this.netUpdate2 = false; + } + else + this.netUpdate2 = true; + } + else if (this.netSpam <= 90) + { + this.netSpam += 30; NetMessage.SendData(23, number: i); this.netUpdate2 = false; } else this.netUpdate2 = true; } - else if (this.netSpam <= 90) + if (this.netSpam > 0) + --this.netSpam; + if (this.active && this.townNPC && NPC.TypeToHeadIndex(this.type) != -1) { - this.netSpam += 30; - NetMessage.SendData(23, number: i); - this.netUpdate2 = false; + if (this.homeless != this.oldHomeless || this.homeTileX != this.oldHomeTileX || this.homeTileY != this.oldHomeTileY) + { + byte householdStatus = WorldGen.TownManager.GetHouseholdStatus(this); + NetMessage.SendData(60, number: i, number2: ((float) Main.npc[i].homeTileX), number3: ((float) Main.npc[i].homeTileY), number4: ((float) householdStatus)); + } + this.oldHomeless = this.homeless; + this.oldHomeTileX = this.homeTileX; + this.oldHomeTileY = this.homeTileY; } - else - this.netUpdate2 = true; } - if (this.netSpam > 0) - --this.netSpam; - if (!this.active || !this.townNPC || NPC.TypeToDefaultHeadIndex(this.type) <= 0) - return; - if (this.homeless != this.oldHomeless || this.homeTileX != this.oldHomeTileX || this.homeTileY != this.oldHomeTileY) - { - byte householdStatus = WorldGen.TownManager.GetHouseholdStatus(this); - NetMessage.SendData(60, number: i, number2: ((float) Main.npc[i].homeTileX), number3: ((float) Main.npc[i].homeTileY), number4: ((float) householdStatus)); - } - this.oldHomeless = this.homeless; - this.oldHomeTileX = this.homeTileX; - this.oldHomeTileY = this.homeTileY; + this.CheckActive(); + this.netUpdate = false; + this.justHit = false; } private void UpdateNPC_UpdateTrails() @@ -47529,7 +36807,7 @@ label_18: this.localAI[3] = 2f; for (int index = this.oldPos.Length - 1; index > 0; --index) this.oldPos[index] = this.oldPos[index - 1]; - this.oldPos[0] = this.position + this.netOffset; + this.oldPos[0] = this.position; } --this.localAI[3]; } @@ -47537,7 +36815,7 @@ label_18: { for (int index = this.oldPos.Length - 1; index > 0; --index) this.oldPos[index] = this.oldPos[index - 1]; - this.oldPos[0] = this.position + this.netOffset; + this.oldPos[0] = this.position; } if (num == 2) { @@ -47548,14 +36826,14 @@ label_18: this.oldPos[index] = this.oldPos[index - 1]; this.oldRot[index] = this.oldRot[index - 1]; } - this.oldPos[0] = this.position + this.netOffset; + this.oldPos[0] = this.position; this.oldRot[0] = this.rotation; } else { for (int index = this.oldPos.Length - 1; index >= 0; --index) { - this.oldPos[index] = this.position + this.netOffset; + this.oldPos[index] = this.position; this.oldRot[index] = this.rotation; } } @@ -47567,7 +36845,7 @@ label_18: this.oldPos[index] = this.oldPos[index - 1]; this.oldRot[index] = this.oldRot[index - 1]; } - this.oldPos[0] = this.position + this.netOffset; + this.oldPos[0] = this.position; this.oldRot[0] = this.rotation; } if (num == 4) @@ -47577,19 +36855,19 @@ label_18: this.oldPos[index] = this.oldPos[index - 1]; Lighting.AddLight((int) this.position.X / 16, (int) this.position.Y / 16, 0.3f, 0.0f, 0.2f); } - this.oldPos[0] = this.position + this.netOffset; + this.oldPos[0] = this.position; } else if (num == 5) { for (int index = this.oldPos.Length - 1; index > 0; --index) this.oldPos[index] = this.oldPos[index - 1]; - this.oldPos[0] = this.position + this.netOffset; + this.oldPos[0] = this.position; } else if (num == 6) { for (int index = this.oldPos.Length - 1; index > 0; --index) this.oldPos[index] = this.oldPos[index - 1]; - this.oldPos[0] = this.position + this.netOffset; + this.oldPos[0] = this.position; } else { @@ -47600,7 +36878,7 @@ label_18: this.oldPos[index] = this.oldPos[index - 1]; this.oldRot[index] = this.oldRot[index - 1]; } - this.oldPos[0] = this.position + this.netOffset; + this.oldPos[0] = this.position; this.oldRot[0] = this.rotation; } } @@ -47687,340 +36965,6 @@ label_18: } } - public static Color buffColor(Color newColor, float R, float G, float B, float A) - { - newColor.R = (byte) ((double) newColor.R * (double) R); - newColor.G = (byte) ((double) newColor.G * (double) G); - newColor.B = (byte) ((double) newColor.B * (double) B); - newColor.A = (byte) ((double) newColor.A * (double) A); - return newColor; - } - - public Color GetNPCColorTintedByBuffs(Color npcColor) - { - float R = 1f; - float G1 = 1f; - float B1 = 1f; - float A = 1f; - if (this.poisoned) - { - R *= 0.65f; - B1 *= 0.75f; - npcColor = NPC.buffColor(npcColor, R, G1, B1, A); - } - if (this.venom) - { - G1 *= 0.45f; - R *= 0.75f; - npcColor = NPC.buffColor(npcColor, R, G1, B1, A); - } - if (this.midas) - { - B1 *= 0.3f; - R *= 0.85f; - npcColor = NPC.buffColor(npcColor, R, G1, B1, A); - } - if (this.betsysCurse) - { - R *= 0.8f; - G1 *= 0.6f; - npcColor = NPC.buffColor(npcColor, R, G1, B1, A); - } - if (this.oiled) - { - R *= 0.7f; - G1 *= 0.7f; - B1 *= 0.7f; - npcColor = NPC.buffColor(npcColor, R, G1, B1, A); - } - if (this.stinky) - { - R *= 0.7f; - B1 *= 0.55f; - npcColor = NPC.buffColor(npcColor, R, G1, B1, A); - } - if (this.drippingSlime) - { - R *= 0.8f; - G1 *= 0.8f; - npcColor = NPC.buffColor(npcColor, R, G1, B1, A); - } - if (this.drippingSparkleSlime) - { - float B2 = B1 * 0.85f; - float G2 = G1 * 0.75f; - npcColor = NPC.buffColor(npcColor, R, G2, B2, A); - } - if (this.ichor) - npcColor = new Color((int) byte.MaxValue, (int) byte.MaxValue, 0, (int) byte.MaxValue); - if (Main.player[Main.myPlayer].detectCreature && this.lifeMax > 1) - { - byte num1; - byte num2; - byte num3; - if (this.friendly || this.catchItem > (short) 0 || this.damage == 0 && this.lifeMax == 5) - { - num1 = (byte) 50; - num2 = byte.MaxValue; - num3 = (byte) 50; - } - else - { - num1 = byte.MaxValue; - num2 = (byte) 50; - num3 = (byte) 50; - } - if ((int) npcColor.R < (int) num1) - npcColor.R = num1; - if ((int) npcColor.G < (int) num2) - npcColor.G = num2; - if ((int) npcColor.B < (int) num3) - npcColor.B = num3; - } - return npcColor; - } - - private void UpdateNPC_BuffApplyVFX() - { - this.position = this.position + this.netOffset; - if (this.markedByScytheWhip && Main.rand.Next(3) == 0) - ParticleOrchestrator.RequestParticleSpawn(true, ParticleOrchestraType.BlackLightningSmall, new ParticleOrchestraSettings() - { - MovementVector = Main.rand.NextVector2Circular(1f, 1f), - PositionInWorld = Main.rand.NextVector2FromRectangle(this.Hitbox) - }); - if (this.poisoned && Main.rand.Next(30) == 0) - { - Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 46, Alpha: 120, Scale: 0.2f); - dust.noGravity = true; - dust.fadeIn = 1.9f; - } - if (this.venom && Main.rand.Next(10) == 0) - { - Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 171, Alpha: 100, Scale: 0.5f); - dust.noGravity = true; - dust.fadeIn = 1.5f; - } - if (this.shadowFlame && Main.rand.Next(5) < 4) - { - Dust dust = Dust.NewDustDirect(new Vector2(this.position.X - 2f, this.position.Y - 2f), this.width + 4, this.height + 4, 27, this.velocity.X * 0.4f, this.velocity.Y * 0.4f, 180, Scale: 1.95f); - dust.noGravity = true; - dust.velocity *= 0.75f; - dust.velocity.X *= 0.75f; - --dust.velocity.Y; - if (Main.rand.Next(4) == 0) - { - dust.noGravity = false; - dust.scale *= 0.5f; - } - } - if (this.onFire) - { - if (Main.rand.Next(4) < 3) - { - Dust dust = Dust.NewDustDirect(new Vector2(this.position.X - 2f, this.position.Y - 2f), this.width + 4, this.height + 4, 6, this.velocity.X * 0.4f, this.velocity.Y * 0.4f, 100, Scale: 3.5f); - dust.noGravity = true; - dust.velocity *= 1.8f; - dust.velocity.Y -= 0.5f; - if (Main.rand.Next(4) == 0) - { - dust.noGravity = false; - dust.scale *= 0.5f; - } - } - Lighting.AddLight((int) ((double) this.position.X / 16.0), (int) ((double) this.position.Y / 16.0 + 1.0), 1f, 0.3f, 0.1f); - } - if (this.daybreak) - { - if (Main.rand.Next(4) < 3) - { - Dust dust = Dust.NewDustDirect(new Vector2(this.position.X - 2f, this.position.Y - 2f), this.width + 4, this.height + 4, 158, this.velocity.X * 0.4f, this.velocity.Y * 0.4f, 100, Scale: 3.5f); - dust.noGravity = true; - dust.velocity *= 2.8f; - dust.velocity.Y -= 0.5f; - if (Main.rand.Next(4) == 0) - { - dust.noGravity = false; - dust.scale *= 0.5f; - } - } - Lighting.AddLight((int) ((double) this.position.X / 16.0), (int) ((double) this.position.Y / 16.0 + 1.0), 1f, 0.3f, 0.1f); - } - if (this.betsysCurse) - { - if (Main.rand.Next(4) < 3) - { - Dust dust = Dust.NewDustDirect(new Vector2(this.position.X - 2f, this.position.Y - 2f), this.width + 4, this.height + 4, 55, this.velocity.X * 0.4f, this.velocity.Y * 0.4f, 100, Scale: 3.5f); - dust.noGravity = true; - dust.velocity *= 2.8f; - dust.velocity.Y -= 1.5f; - dust.noGravity = false; - dust.scale = 0.9f; - dust.color = new Color(0, 0, 180, (int) byte.MaxValue); - dust.velocity *= 0.2f; - } - Lighting.AddLight((int) ((double) this.position.X / 16.0), (int) ((double) this.position.Y / 16.0 + 1.0), 0.6f, 0.1f, 0.9f); - } - if (this.oiled && Main.rand.Next(3) != 0) - { - int Alpha = 175; - Color newColor = new Color(0, 0, 0, 140); - Vector2 position = this.position; - position.X -= 2f; - position.Y -= 2f; - if (Main.rand.Next(2) == 0) - { - Dust dust = Dust.NewDustDirect(position, this.width + 4, this.height + 2, 4, Alpha: Alpha, newColor: newColor, Scale: 1.4f); - if (Main.rand.Next(2) == 0) - dust.alpha += 25; - if (Main.rand.Next(2) == 0) - dust.alpha += 25; - dust.noLight = true; - dust.velocity *= 0.2f; - dust.velocity.Y += 0.2f; - dust.velocity += this.velocity; - } - } - if (this.dryadWard && (double) this.velocity.X != 0.0 && Main.rand.Next(4) == 0) - { - Dust dust = Dust.NewDustDirect(new Vector2(this.position.X - 2f, (float) ((double) this.position.Y + (double) this.height - 2.0)), this.width + 4, 4, 163, this.velocity.X * 0.4f, this.velocity.Y * 0.4f, 100, Scale: 1.5f); - dust.noGravity = true; - dust.noLight = true; - dust.velocity *= 0.0f; - } - if (this.dryadBane && Main.rand.Next(4) == 0) - { - Dust dust = Dust.NewDustDirect(new Vector2(this.position.X - 2f, this.position.Y), this.width + 4, this.height, 163, this.velocity.X * 0.4f, this.velocity.Y * 0.4f, 100, Scale: 1.5f); - dust.noGravity = true; - dust.velocity *= new Vector2((float) ((double) Main.rand.NextFloat() * 4.0 - 2.0), 0.0f); - dust.noLight = true; - } - if (this.loveStruck && Main.rand.Next(5) == 0) - { - Vector2 vector2 = new Vector2((float) Main.rand.Next(-10, 11), (float) Main.rand.Next(-10, 11)); - vector2.Normalize(); - vector2.X *= 0.66f; - int index = Gore.NewGore(this.position + new Vector2((float) Main.rand.Next(this.width + 1), (float) Main.rand.Next(this.height + 1)), vector2 * (float) Main.rand.Next(3, 6) * 0.33f, 331, (float) Main.rand.Next(40, 121) * 0.01f); - Main.gore[index].sticky = false; - Main.gore[index].velocity *= 0.4f; - Main.gore[index].velocity.Y -= 0.6f; - } - if (this.stinky && Main.rand.Next(5) == 0) - { - Vector2 vector2_1 = new Vector2((float) Main.rand.Next(-10, 11), (float) Main.rand.Next(-10, 11)); - vector2_1.Normalize(); - vector2_1.X *= 0.66f; - vector2_1.Y = Math.Abs(vector2_1.Y); - Vector2 vector2_2 = vector2_1 * (float) Main.rand.Next(3, 5) * 0.25f; - Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 188, vector2_2.X, vector2_2.Y * 0.5f, 100, Scale: 1.5f); - dust.velocity *= 0.1f; - dust.velocity.Y -= 0.5f; - } - if (this.dripping && Main.rand.Next(4) != 0) - { - Vector2 position = this.position; - position.X -= 2f; - position.Y -= 2f; - if (Main.rand.Next(2) == 0) - { - Dust dust = Dust.NewDustDirect(position, this.width + 4, this.height + 2, 211, Alpha: 50, Scale: 0.8f); - if (Main.rand.Next(2) == 0) - dust.alpha += 25; - if (Main.rand.Next(2) == 0) - dust.alpha += 25; - dust.noLight = true; - dust.velocity *= 0.2f; - dust.velocity.Y += 0.2f; - dust.velocity += this.velocity; - } - else - { - Dust dust = Dust.NewDustDirect(position, this.width + 8, this.height + 8, 211, Alpha: 50, Scale: 1.1f); - if (Main.rand.Next(2) == 0) - dust.alpha += 25; - if (Main.rand.Next(2) == 0) - dust.alpha += 25; - dust.noLight = true; - dust.noGravity = true; - dust.velocity *= 0.2f; - ++dust.velocity.Y; - dust.velocity += this.velocity; - } - } - if (this.drippingSlime && Main.rand.Next(4) != 0) - { - int Alpha = 175; - Color newColor = new Color(0, 80, (int) byte.MaxValue, 100); - Vector2 position = this.position; - position.X -= 2f; - position.Y -= 2f; - if (Main.rand.Next(2) == 0) - { - Dust dust = Dust.NewDustDirect(position, this.width + 4, this.height + 2, 4, Alpha: Alpha, newColor: newColor, Scale: 1.4f); - if (Main.rand.Next(2) == 0) - dust.alpha += 25; - if (Main.rand.Next(2) == 0) - dust.alpha += 25; - dust.noLight = true; - dust.velocity *= 0.2f; - dust.velocity.Y += 0.2f; - dust.velocity += this.velocity; - } - } - if (this.drippingSparkleSlime && Main.rand.Next(4) != 0) - { - int Alpha = 150; - Vector2 position = this.position; - position.X -= 2f; - position.Y -= 2f; - if (Main.rand.Next(2) == 0) - { - Dust dust = Dust.NewDustDirect(position, this.width + 4, this.height + 2, 243, Alpha: Alpha); - if (Main.rand.Next(2) == 0) - dust.alpha += 25; - if (Main.rand.Next(2) == 0) - dust.alpha += 25; - dust.noLight = true; - dust.velocity *= 0.2f; - dust.velocity.Y += 0.2f; - dust.velocity += this.velocity; - } - } - if (this.onFrostBurn) - { - if (Main.rand.Next(4) < 3) - { - Dust dust = Dust.NewDustDirect(new Vector2(this.position.X - 2f, this.position.Y - 2f), this.width + 4, this.height + 4, 135, this.velocity.X * 0.4f, this.velocity.Y * 0.4f, 100, Scale: 3.5f); - dust.noGravity = true; - dust.velocity *= 1.8f; - dust.velocity.Y -= 0.5f; - if (Main.rand.Next(4) == 0) - { - dust.noGravity = false; - dust.scale *= 0.5f; - } - } - Lighting.AddLight((int) ((double) this.position.X / 16.0), (int) ((double) this.position.Y / 16.0 + 1.0), 0.1f, 0.6f, 1f); - } - if (this.onFire2) - { - if (Main.rand.Next(4) < 3) - { - Dust dust = Dust.NewDustDirect(new Vector2(this.position.X - 2f, this.position.Y - 2f), this.width + 4, this.height + 4, 75, this.velocity.X * 0.4f, this.velocity.Y * 0.4f, 100, Scale: 3.5f); - dust.noGravity = true; - dust.velocity *= 1.8f; - dust.velocity.Y -= 0.5f; - if (Main.rand.Next(4) == 0) - { - dust.noGravity = false; - dust.scale *= 0.5f; - } - } - Lighting.AddLight((int) ((double) this.position.X / 16.0), (int) ((double) this.position.Y / 16.0 + 1.0), 1f, 0.3f, 0.1f); - } - this.position = this.position - this.netOffset; - } - private void UpdateNPC_BuffApplyDOTs() { if (this.dontTakeDamage) @@ -48050,17 +36994,15 @@ label_18: { if (this.lifeRegen > 0) this.lifeRegen = 0; - this.lifeRegen -= 24; - if (amount < 4) - amount = 4; + this.lifeRegen -= 12; } if (this.venom) { if (this.lifeRegen > 0) this.lifeRegen = 0; - this.lifeRegen -= 30; - if (amount < 5) - amount = 5; + this.lifeRegen -= 12; + if (amount < 2) + amount = 2; } if (this.shadowFlame) { @@ -48157,7 +37099,7 @@ label_18: if (NPC.downedAncientCultist) num9 += 0.15f; if (Main.expertMode) - num9 *= Main.GameModeInfo.TownNPCDamageMultiplier; + num9 *= Main.expertNPCDamage; int num10 = (int) ((double) num8 * (double) num9); this.lifeRegen -= 2 * num10; if (amount < num10) @@ -48237,11 +37179,11 @@ label_18: { if (Main.netMode == 1) return; - for (int buffIndex = 0; buffIndex < 5; ++buffIndex) + for (int b = 0; b < 5; ++b) { - if (this.buffType[buffIndex] > 0 && this.buffTime[buffIndex] <= 0) + if (this.buffType[b] > 0 && this.buffTime[b] <= 0) { - this.DelBuff(buffIndex); + this.DelBuff(b); if (Main.netMode == 2) NetMessage.SendData(54, number: this.whoAmI); } @@ -48262,7 +37204,7 @@ label_18: else this.Transform(47); } - else if (this.type == 55 || this.type == 230 || this.type == 592 || this.type == 593) + else if (this.type == 55 || this.type == 230) { if (WorldGen.crimson) this.Transform(465); @@ -48281,14 +37223,13 @@ label_18: this.value = 0.0f; } - public void UpdateNPC_BuffSetFlags(bool lowerBuffTime = true) + private void UpdateNPC_BuffSetFlags() { for (int index = 0; index < 5; ++index) { if (this.buffType[index] > 0 && this.buffTime[index] > 0) { - if (lowerBuffTime) - --this.buffTime[index]; + --this.buffTime[index]; if (this.buffType[index] == 20) this.poisoned = true; if (this.buffType[index] == 70) @@ -48309,8 +37250,6 @@ label_18: this.dripping = true; if (this.buffType[index] == 137) this.drippingSlime = true; - if (this.buffType[index] == 320) - this.drippingSparkleSlime = true; if (this.buffType[index] == 119) this.loveStruck = true; if (this.buffType[index] == 120) @@ -48333,20 +37272,6 @@ label_18: this.betsysCurse = true; if (this.buffType[index] == 204) this.oiled = true; - if (this.buffType[index] == 310) - this.markedByScytheWhip = true; - if (this.buffType[index] == 313) - this.markedByFireWhip = true; - if (this.buffType[index] == 309) - this.markedBySwordWhip = true; - if (this.buffType[index] == 315) - this.markedByThornWhip = true; - if (this.buffType[index] == 307) - this.markedByBlandWhip = true; - if (this.buffType[index] == 319) - this.markedByMaceWhip = true; - if (this.buffType[index] == 316) - this.markedByRainbowWhip = true; } } } @@ -48369,20 +37294,12 @@ label_18: this.stinky = false; this.dripping = false; this.drippingSlime = false; - this.drippingSparkleSlime = false; this.daybreak = false; this.javelined = false; this.celled = false; this.dryadBane = false; this.betsysCurse = false; this.oiled = false; - this.markedByScytheWhip = false; - this.markedByThornWhip = false; - this.markedByFireWhip = false; - this.markedByRainbowWhip = false; - this.markedByBlandWhip = false; - this.markedBySwordWhip = false; - this.markedByMaceWhip = false; this.lifeRegenExpectedLossPerSecond = -1; } @@ -48420,21 +37337,17 @@ label_18: { if (Main.netMode == 2) return; - if (this.type == 611 && !Main.dayTime && Main.rand.Next(700) == 0) - SoundEngine.PlaySound(46, (int) this.position.X, (int) this.position.Y); - if (this.type >= 602 && this.type <= 603 && Main.dayTime && Main.rand.Next(1200) == 0) - SoundEngine.PlaySound(44, (int) this.position.X, (int) this.position.Y); if (this.type >= 362 && this.type <= 365) { if (!Main.dayTime || Main.rand.Next(200) != 0) return; - SoundEngine.PlaySound(30, (int) this.position.X, (int) this.position.Y); + Main.PlaySound(30, (int) this.position.X, (int) this.position.Y); } else if (this.type == 361 || this.type == 445) { if ((double) Math.Abs(this.velocity.X) >= 0.5 || Main.dayTime && (double) this.position.Y <= Main.worldSurface * 16.0 || Main.rand.Next(200) != 0) return; - SoundEngine.PlaySound(31, (int) this.position.X, (int) this.position.Y); + Main.PlaySound(31, (int) this.position.X, (int) this.position.Y); } else if (this.type == 74 || this.type == 297 || this.type == 298 || this.type == 442) { @@ -48443,53 +37356,52 @@ label_18: if (this.type == 74) { if (Main.rand.Next(3) != 0) - SoundEngine.PlaySound(32, (int) this.position.X, (int) this.position.Y, 14); + Main.PlaySound(32, (int) this.position.X, (int) this.position.Y, 14); else - SoundEngine.PlaySound(32, (int) this.position.X, (int) this.position.Y, 18); + Main.PlaySound(32, (int) this.position.X, (int) this.position.Y, 18); } if (this.type == 297) - SoundEngine.PlaySound(32, (int) this.position.X, (int) this.position.Y, 16); + Main.PlaySound(32, (int) this.position.X, (int) this.position.Y, 16); if (this.type == 298) { if (Main.rand.Next(3) != 0) - SoundEngine.PlaySound(32, (int) this.position.X, (int) this.position.Y, 17); + Main.PlaySound(32, (int) this.position.X, (int) this.position.Y, 17); else - SoundEngine.PlaySound(32, (int) this.position.X, (int) this.position.Y, 19); + Main.PlaySound(32, (int) this.position.X, (int) this.position.Y, 19); } if (this.type != 442) return; switch (Main.rand.Next(5)) { case 0: - SoundEngine.PlaySound(32, (int) this.position.X, (int) this.position.Y, 16); + Main.PlaySound(32, (int) this.position.X, (int) this.position.Y, 16); break; case 1: - SoundEngine.PlaySound(32, (int) this.position.X, (int) this.position.Y, 17); + Main.PlaySound(32, (int) this.position.X, (int) this.position.Y, 17); break; case 2: - SoundEngine.PlaySound(32, (int) this.position.X, (int) this.position.Y, 19); + Main.PlaySound(32, (int) this.position.X, (int) this.position.Y, 19); break; case 3: - SoundEngine.PlaySound(32, (int) this.position.X, (int) this.position.Y, 14); + Main.PlaySound(32, (int) this.position.X, (int) this.position.Y, 14); break; default: - SoundEngine.PlaySound(32, (int) this.position.X, (int) this.position.Y, 18); + Main.PlaySound(32, (int) this.position.X, (int) this.position.Y, 18); break; } } else { - if (this.type != 300 && this.type != 447 && this.type != 610 || Main.rand.Next(1800) != 0) + if (this.type != 300 && this.type != 447 || Main.rand.Next(1800) != 0) return; - SoundEngine.PlaySound(33, (int) this.position.X, (int) this.position.Y); + Main.PlaySound(33, (int) this.position.X, (int) this.position.Y); } } private void UpdateNPC_CastLights() { - if (this.type >= 442 && this.type <= 448 || this.type == 539 || this.type == 592 || this.type == 593 || this.type == 601 || this.type == 605 || this.type == 627) + if (this.type >= 442 && this.type <= 448 || this.type == 539) { - this.position = this.position + this.netOffset; Color color = Lighting.GetColor((int) this.Center.X / 16, (int) this.Center.Y / 16); if (color.R > (byte) 20 || color.B > (byte) 20 || color.G > (byte) 20) { @@ -48505,17 +37417,14 @@ label_18: Main.dust[index].velocity *= 0.0f; } } - this.position = this.position - this.netOffset; } - if (this.type >= 254 && this.type <= 261 || this.type == 160 || this.type == 634 || this.type == 635) + if (this.type >= 254 && this.type <= 261 || this.type == 160) { float num3 = (float) Main.rand.Next(28, 42) * 0.005f + (float) (270 - (int) Main.mouseTextColor) / 500f; float num4 = 0.1f; float num5 = (float) (0.300000011920929 + (double) num3 / 2.0); float num6 = 0.6f + num3; float num7 = 0.35f; - if (this.type == 634) - num7 = 0.65f; Lighting.AddLight((int) this.Center.X / 16, (int) this.Center.Y / 16, num4 * num7, num5 * num7, num6 * num7); } if (this.type == 209) @@ -48534,62 +37443,51 @@ label_18: Lighting.AddLight((int) ((double) this.position.X + (double) (this.width / 2)) / 16, (int) ((double) this.position.Y + 4.0) / 16, 0.9f, 0.75f, 0.5f); } - private void GetHurtByOtherNPCs(bool[] acceptableNPCIDs) + private void CheckMeleeCollision() { if (this.dontTakeDamageFromHostiles) return; int specialHitSetter = 1; - float damageMultiplier = 1f; if (this.immune[(int) byte.MaxValue] != 0) return; - Microsoft.Xna.Framework.Rectangle hitbox1 = this.Hitbox; - for (int index = 0; index < 200; ++index) - { - NPC thatNPC = Main.npc[index]; - if (acceptableNPCIDs[thatNPC.type] && thatNPC.active && !thatNPC.friendly && thatNPC.damage > 0) - { - Microsoft.Xna.Framework.Rectangle hitbox2 = thatNPC.Hitbox; - NPC.GetMeleeCollisionData(hitbox1, index, ref specialHitSetter, ref damageMultiplier, ref hitbox2); - if (hitbox1.Intersects(hitbox2) && (this.type != 453 || !NPCID.Sets.Skeletons[thatNPC.type]) && thatNPC.type != 624) - this.BeHurtByOtherNPC(index, thatNPC); - } - } - } - - private void BeHurtByOtherNPC(int npcIndex, NPC thatNPC) - { int num1 = 30; if (this.type == 548) num1 = 20; - int Damage1 = Main.DamageVar((float) thatNPC.damage); - int num2 = 6; - int hitDirection1 = (double) thatNPC.Center.X > (double) this.Center.X ? -1 : 1; - double num3 = this.StrikeNPCNoInteraction(Damage1, (float) num2, hitDirection1); - if (Main.netMode != 0) - NetMessage.SendData(28, number: this.whoAmI, number2: ((float) Damage1), number3: ((float) num2), number4: ((float) hitDirection1)); - this.netUpdate = true; - this.immune[(int) byte.MaxValue] = num1; - if (this.dryadWard) + Microsoft.Xna.Framework.Rectangle hitbox1 = this.Hitbox; + for (int index = 0; index < 200; ++index) { - int Damage2 = (int) num3 / 3; - int num4 = 6; - hitDirection1 *= -1; - thatNPC.StrikeNPCNoInteraction(Damage2, (float) num4, hitDirection1); - if (Main.netMode != 0) - NetMessage.SendData(28, number: npcIndex, number2: ((float) Damage2), number3: ((float) num4), number4: ((float) hitDirection1)); - thatNPC.netUpdate = true; - thatNPC.immune[(int) byte.MaxValue] = num1; + NPC npc = Main.npc[index]; + if (npc.active && !npc.friendly && npc.damage > 0) + { + Microsoft.Xna.Framework.Rectangle hitbox2 = npc.Hitbox; + float damageMultiplier = 1f; + NPC.GetMeleeCollisionData(hitbox1, index, ref specialHitSetter, ref damageMultiplier, ref hitbox2); + if (hitbox1.Intersects(hitbox2) && (this.type != 453 || !NPCID.Sets.Skeletons.Contains(npc.netID))) + { + int damage = npc.damage; + int num2 = 6; + int hitDirection1 = 1; + if ((double) npc.position.X + (double) (npc.width / 2) > (double) this.position.X + (double) (this.width / 2)) + hitDirection1 = -1; + double num3 = this.StrikeNPCNoInteraction(damage, (float) num2, hitDirection1); + if (Main.netMode != 0) + NetMessage.SendData(28, number: this.whoAmI, number2: ((float) damage), number3: ((float) num2), number4: ((float) hitDirection1)); + this.netUpdate = true; + this.immune[(int) byte.MaxValue] = num1; + if (this.dryadWard) + { + int Damage = (int) num3 / 3; + int num4 = 6; + int hitDirection2 = hitDirection1 * -1; + npc.StrikeNPCNoInteraction(Damage, (float) num4, hitDirection2); + if (Main.netMode != 0) + NetMessage.SendData(28, number: index, number2: ((float) Damage), number3: ((float) num4), number4: ((float) hitDirection2)); + npc.netUpdate = true; + npc.immune[(int) byte.MaxValue] = num1; + } + } + } } - if (!NPCID.Sets.HurtingBees[thatNPC.type]) - return; - int damage = this.damage; - int num5 = 6; - int hitDirection2 = hitDirection1 * -1; - thatNPC.StrikeNPCNoInteraction(damage, (float) num5, hitDirection2); - if (Main.netMode != 0) - NetMessage.SendData(28, number: npcIndex, number2: ((float) damage), number3: ((float) num5), number4: ((float) hitDirection2)); - thatNPC.netUpdate = true; - thatNPC.immune[(int) byte.MaxValue] = num1; } private void CheckLifeRegen() @@ -48606,21 +37504,6 @@ label_18: this.netUpdate = true; } - public void GetImmuneTime(int fromWho, int time) - { - if (fromWho == -1) - { - for (int index = 0; index < this.immune.Length; ++index) - this.immune[index] = time; - } - else - { - if (fromWho < 0 || fromWho >= this.immune.Length) - return; - this.immune[fromWho] = time; - } - } - private void UpdateCollision() { this.Collision_WalkDownSlopes(); @@ -48710,8 +37593,6 @@ label_18: bool flag = false; if (Main.tile[x, y] != null && Main.tile[x, y].active() && Main.tileSolid[(int) Main.tile[x, y].type]) flag = true; - if (!this.townNPC) - flag = false; if (!Main.dayTime || Main.eclipse) flag = true; else if (this.homeTileY - (int) ((double) this.position.Y + (double) this.height) / 16 > num) @@ -48804,6 +37685,54 @@ label_18: this.velocity = Collision.noSlopeCollision(Position, this.velocity, Width, Height, true, true); } + private void Collision_MoveWaterOrLavaOld( + bool fall, + Vector2 cPosition, + int cWidth, + int cHeight) + { + Vector2 velocity = this.velocity; + this.velocity = Collision.TileCollision(cPosition, this.velocity, cWidth, cHeight, fall, fall); + if (Collision.up) + this.velocity.Y = 0.01f; + Vector2 vector2 = this.velocity * 0.5f; + if ((double) this.velocity.X != (double) velocity.X) + { + vector2.X = this.velocity.X; + this.collideX = true; + } + if ((double) this.velocity.Y != (double) velocity.Y) + { + vector2.Y = this.velocity.Y; + this.collideY = true; + } + this.oldPosition = this.position; + this.oldDirection = this.direction; + this.position = this.position + vector2; + } + + private void Collision_MoveHoneyOld(bool fall, Vector2 cPosition, int cWidth, int cHeight) + { + Vector2 velocity = this.velocity; + this.velocity = Collision.TileCollision(cPosition, this.velocity, cWidth, cHeight, fall, fall); + if (Collision.up) + this.velocity.Y = 0.01f; + Vector2 vector2 = this.velocity * 0.25f; + if ((double) this.velocity.X != (double) velocity.X) + { + vector2.X = this.velocity.X; + this.collideX = true; + } + if ((double) this.velocity.Y != (double) velocity.Y) + { + vector2.Y = this.velocity.Y; + this.collideY = true; + } + this.oldPosition = this.position; + this.oldDirection = this.direction; + this.position = this.position + vector2; + } + private void Collision_MoveWhileWet(Vector2 oldDryVelocity, float Slowdown = 0.5f) { if (Collision.up) @@ -48824,20 +37753,11 @@ label_18: this.position = this.position + vector2; } - public void GetTileCollisionParameters(out Vector2 cPosition, out int cWidth, out int cHeight) + private void GetTileCollisionParameters(out Vector2 cPosition, out int cWidth, out int cHeight) { cPosition = this.position; cWidth = this.width; cHeight = this.height; - if (this.type == 594) - { - int num = (int) (44.0 + 20.0 * (double) this.ai[1]); - cPosition.Y += (float) num; - cHeight += num; - cPosition.X += (float) (cWidth / 2); - cWidth = (int) (6.0 + 26.0 * (double) this.ai[1]); - cPosition.X -= (float) (cWidth / 2); - } if (this.type == 243) cHeight = 90; if (this.type == 290) @@ -48896,8 +37816,10 @@ label_18: return; this.velocity.Y = 0.0f; } - else if (this.type == 55 && !this.wet && Main.raining) + else { + if (this.type != 55 || this.wet || !Main.raining) + return; int direction = this.direction; Vector2 velocity = this.velocity; this.Transform(230); @@ -48905,44 +37827,17 @@ label_18: this.velocity = velocity; this.homeTileX = (int) ((double) this.position.X / 16.0) + 10 * this.direction; } - else if (this.type == 593 && this.wet) - { - int direction = this.direction; - Vector2 velocity = this.velocity; - this.Transform(592); - this.direction = direction; - this.velocity = velocity; - this.wet = true; - if ((double) this.velocity.Y >= 0.0) - return; - this.velocity.Y = 0.0f; - } - else - { - if (this.type != 592 || this.wet || !Main.raining) - return; - int direction = this.direction; - Vector2 velocity = this.velocity; - this.Transform(593); - this.direction = direction; - this.velocity = velocity; - this.homeTileX = (int) ((double) this.position.X / 16.0) + 10 * this.direction; - } } private bool Collision_DecideFallThroughPlatforms() { bool flag1 = false; - if (this.type == 2 || this.type == -43 || this.type == 190 || this.type == 191 || this.type == 192 || this.type == 193 || this.type == 194 || this.type == 317 || this.type == 318 || this.type == 133) + if (this.type == 2 || this.type == -43 || this.type == 317 || this.type == 318 || this.type == 133) flag1 = true; if (this.aiStyle == 10) flag1 = true; - if (this.aiStyle == 5) - flag1 = true; if (this.aiStyle == 40) flag1 = true; - if (this.aiStyle == 44) - flag1 = true; if (this.type == 467) flag1 = true; if (this.type == 477) @@ -48959,8 +37854,6 @@ label_18: flag1 = true; if (this.type == 50 && this.target >= 0 && (double) Main.player[this.target].position.Y > (double) this.position.Y + (double) this.height) flag1 = true; - if (this.type == 657 && this.target >= 0 && (double) Main.player[this.target].position.Y > (double) this.Bottom.Y) - flag1 = true; if (this.type == 247 || this.type == 248) flag1 = true; if (this.type == 245 && this.target >= 0 && (double) Main.player[this.target].position.Y > (double) this.position.Y + (double) this.height) @@ -48973,17 +37866,11 @@ label_18: flag1 = true; if (this.aiStyle == 87 && (double) Main.player[this.target].position.Y > (double) this.position.Y + (double) this.height) flag1 = true; - if (this.type == 405 || this.type == 406) - flag1 = true; - if (this.type == 490) - flag1 = true; - if (this.type == 301) - flag1 = true; if (this.aiStyle == 7) { int num = 16; bool flag2 = false; - if (this.townNPC && (!Main.dayTime || Main.invasionType > 0 || Main.eclipse)) + if (!Main.dayTime || Main.invasionType > 0 || Main.eclipse) flag2 = true; else if (this.homeTileY - (int) ((double) this.position.Y + (double) this.height) / 16 > num) flag1 = true; @@ -49008,16 +37895,14 @@ label_18: if (Collision.honey) this.honeyWet = true; } - if (this.aiStyle == 116) - this.wetCount = (byte) 10; if (flag) { if (this.onFire && !this.lavaWet && Main.netMode != 1) { - for (int buffIndex = 0; buffIndex < 5; ++buffIndex) + for (int b = 0; b < 5; ++b) { - if (this.buffType[buffIndex] == 24) - this.DelBuff(buffIndex); + if (this.buffType[b] == 24) + this.DelBuff(b); } } if (!this.wet && this.wetCount == (byte) 0) @@ -49037,9 +37922,9 @@ label_18: Main.dust[index2].noGravity = true; } if (this.aiStyle != 1 && this.type != 1 && this.type != 16 && this.type != 147 && this.type != 59 && this.type != 300 && this.aiStyle != 39 && !this.noGravity) - SoundEngine.PlaySound(19, (int) this.position.X, (int) this.position.Y); + Main.PlaySound(19, (int) this.position.X, (int) this.position.Y); } - else if (this.type != 617 && this.type != 616 && this.type != 625) + else { for (int index3 = 0; index3 < 30; ++index3) { @@ -49050,8 +37935,8 @@ label_18: Main.dust[index4].alpha = 100; Main.dust[index4].noGravity = true; } - if (this.type != 376 && this.type != 579 && this.aiStyle != 1 && this.type != 1 && this.type != 16 && this.type != 147 && this.type != 59 && this.type != 300 && this.aiStyle != 39 && this.aiStyle != 68 && this.type != 362 && this.type != 364 && this.type != 361 && this.type != 445 && !this.noGravity || this.type == 615) - SoundEngine.PlaySound(19, (int) this.position.X, (int) this.position.Y, 0); + if (this.type != 376 && this.type != 579 && this.aiStyle != 1 && this.type != 1 && this.type != 16 && this.type != 147 && this.type != 59 && this.type != 300 && this.aiStyle != 39 && this.aiStyle != 68 && this.type != 362 && this.type != 364 && this.type != 361 && this.type != 445 && !this.noGravity) + Main.PlaySound(19, (int) this.position.X, (int) this.position.Y, 0); } } else @@ -49066,7 +37951,7 @@ label_18: Main.dust[index6].noGravity = true; } if (this.aiStyle != 1 && this.type != 1 && this.type != 16 && this.type != 147 && this.type != 59 && this.type != 300 && this.aiStyle != 39 && !this.noGravity) - SoundEngine.PlaySound(19, (int) this.position.X, (int) this.position.Y); + Main.PlaySound(19, (int) this.position.X, (int) this.position.Y); } } this.wet = true; @@ -49075,8 +37960,6 @@ label_18: { this.velocity.X *= 0.5f; this.wet = false; - if (this.type == 620 && (double) this.GetTargetData().Center.Y < (double) this.Center.Y) - this.velocity.Y -= 8f; if (this.wetCount == (byte) 0) { this.wetCount = (byte) 10; @@ -49094,9 +37977,9 @@ label_18: Main.dust[index8].noGravity = true; } if (this.aiStyle != 1 && this.type != 1 && this.type != 16 && this.type != 147 && this.type != 300 && this.type != 59 && this.aiStyle != 39 && !this.noGravity) - SoundEngine.PlaySound(19, (int) this.position.X, (int) this.position.Y); + Main.PlaySound(19, (int) this.position.X, (int) this.position.Y); } - else if (this.type != 617 && this.type != 616 && this.type != 625) + else { for (int index9 = 0; index9 < 30; ++index9) { @@ -49107,8 +37990,8 @@ label_18: Main.dust[index10].alpha = 100; Main.dust[index10].noGravity = true; } - if (this.type != 376 && this.type != 579 && this.aiStyle != 1 && this.type != 1 && this.type != 16 && this.type != 59 && this.type != 300 && this.aiStyle != 39 && this.aiStyle != 68 && this.type != 362 && this.type != 364 && this.type != 361 && this.type != 445 && !this.noGravity || this.type == 615) - SoundEngine.PlaySound(19, (int) this.position.X, (int) this.position.Y, 0); + if (this.type != 376 && this.type != 579 && this.aiStyle != 1 && this.type != 1 && this.type != 16 && this.type != 59 && this.type != 300 && this.aiStyle != 39 && this.aiStyle != 68 && this.type != 362 && this.type != 364 && this.type != 361 && this.type != 445 && !this.noGravity) + Main.PlaySound(19, (int) this.position.X, (int) this.position.Y, 0); } } else @@ -49123,7 +38006,7 @@ label_18: Main.dust[index12].noGravity = true; } if (this.aiStyle != 1 && this.type != 1 && this.type != 16 && this.type != 59 && this.type != 300 && this.aiStyle != 39 && !this.noGravity) - SoundEngine.PlaySound(19, (int) this.position.X, (int) this.position.Y); + Main.PlaySound(19, (int) this.position.X, (int) this.position.Y); } } } @@ -49188,17 +38071,13 @@ label_18: NPC.fireFlyMultiple = Main.rand.Next(6, 30); } NPC.butterflyChance = Main.rand.Next(1, 25); - if (WorldGen.genRand.Next(4) != 0) + if (WorldGen.genRand.Next(3) != 0) return; NPC.butterflyChance = 999999; } - public Color GetBestiaryEntryColor() => Color.White; - public Color GetAlpha(Color newColor) { - if (this.IsABestiaryIconDummy) - newColor = Color.White; float num1 = (float) ((int) byte.MaxValue - this.alpha) / (float) byte.MaxValue; int r1 = (int) ((double) newColor.R * (double) num1); int g1 = (int) ((double) newColor.G * (double) num1); @@ -49220,12 +38099,6 @@ label_18: if (b1 > (int) byte.MaxValue) b1 = (int) byte.MaxValue; } - if (this.type == 662) - { - Color color = Color.Lerp(Color.White, Color.Cyan, 0.5f); - color.A /= (byte) 4; - return color * this.Opacity; - } if (this.type >= 454 && this.type <= 459 || this.type == 521) { newColor = Color.Lerp(newColor, Color.White, 0.4f); @@ -49233,11 +38106,6 @@ label_18: newColor *= (float) a / (float) byte.MaxValue; return newColor; } - if (this.type == 636) - { - newColor = Color.Lerp(newColor, Color.White, 0.25f); - return newColor * this.Opacity; - } if (this.type == 440) { byte num2 = 180; @@ -49246,11 +38114,6 @@ label_18: byte num3 = (byte) ((double) num2 * (double) num1); return new Color((int) num3, (int) num3, (int) num3, (int) num3); } - if (this.type == 583 || this.type == 584 || this.type == 585) - { - newColor = Color.Lerp(newColor, Color.White, 0.5f); - return newColor; - } if (this.type == 516) return new Color(this.alpha, this.alpha, this.alpha, this.alpha); if (this.type == 522) @@ -49271,7 +38134,7 @@ label_18: } if (this.type == 30) return new Color(250, 250, 250, 100); - if (!this.IsABestiaryIconDummy && (this.type == 25 || this.type == 30 || this.type == 59 || this.type == 60)) + if (this.type == 25 || this.type == 30 || this.type == 59 || this.type == 60) return new Color(200, 200, 200, 0); if (this.type == 360) { @@ -49286,19 +38149,6 @@ label_18: b2 = (int) byte.MaxValue; return new Color(r2, g2, b2, (int) byte.MaxValue); } - if (this.type == 655) - { - int r3 = (int) newColor.R; - int g3 = (int) newColor.G; - int b3 = (int) newColor.B; - if (r3 < (int) byte.MaxValue) - r3 = (int) byte.MaxValue; - if (g3 < 100) - g3 = 100; - if (b3 < 50) - b3 = 50; - return new Color(r3, g3, b3, (int) byte.MaxValue); - } if (this.type == 352) return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 200); if (this.type == 72) @@ -49321,7 +38171,7 @@ label_18: if (g1 < 150) g1 = 150; } - else if (this.type == 374 || this.type == 634 || this.type == 635) + else if (this.type == 374) { b1 = (int) byte.MaxValue; if (r1 < 100) @@ -49360,8 +38210,6 @@ label_18: public Color GetColor(Color newColor) { - if (this.IsABestiaryIconDummy) - newColor = this.GetBestiaryEntryColor(); int r = (int) this.color.R - ((int) byte.MaxValue - (int) newColor.R); int g = (int) this.color.G - ((int) byte.MaxValue - (int) newColor.G); int b = (int) this.color.B - ((int) byte.MaxValue - (int) newColor.B); @@ -49385,11 +38233,59 @@ label_18: return new Color(r, g, b, a); } - public bool ShouldBestiaryGirlBeLycantrope() + private string GetBirthdayDialog() { - if (Main.bloodMoon && !Main.dayTime) - return true; - return Main.moonPhase == 0 && !Main.dayTime; + switch (this.type) + { + case 17: + return Language.SelectRandom(Lang.CreateDialogFilter("MerchantSpecialText.Party")).Value; + case 18: + return Language.SelectRandom(Lang.CreateDialogFilter("NurseSpecialText.Party")).Value; + case 19: + return Language.SelectRandom(Lang.CreateDialogFilter("ArmsDealerSpecialText.Party")).Value; + case 20: + return Language.SelectRandom(Lang.CreateDialogFilter("DryadSpecialText.Party")).Value; + case 22: + return Language.SelectRandom(Lang.CreateDialogFilter("GuideSpecialText.Party")).Value; + case 38: + return Language.SelectRandom(Lang.CreateDialogFilter("DemolitionistSpecialText.Party")).Value; + case 54: + return Language.SelectRandom(Lang.CreateDialogFilter("ClothierSpecialText.Party")).Value; + case 107: + return Language.SelectRandom(Lang.CreateDialogFilter("GoblinTinkererSpecialText.Party")).Value; + case 108: + return Language.SelectRandom(Lang.CreateDialogFilter("WizardSpecialText.Party")).Value; + case 124: + return Language.SelectRandom(Lang.CreateDialogFilter("MechanicSpecialText.Party")).Value; + case 142: + return Language.SelectRandom(Lang.CreateDialogFilter("SantaClausSpecialText.Party")).Value; + case 160: + return Language.SelectRandom(Lang.CreateDialogFilter("TruffleSpecialText.Party")).Value; + case 178: + return Language.SelectRandom(Lang.CreateDialogFilter("SteampunkerSpecialText.Party")).Value; + case 207: + return Language.SelectRandom(Lang.CreateDialogFilter("DyeTraderSpecialText.Party")).Value; + case 208: + return Language.SelectRandom(Lang.CreateDialogFilter("PartyGirlSpecialText.Party")).Value; + case 209: + return Language.SelectRandom(Lang.CreateDialogFilter("CyborgSpecialText.Party")).Value; + case 227: + return Language.SelectRandom(Lang.CreateDialogFilter("PainterSpecialText.Party")).Value; + case 228: + return Language.SelectRandom(Lang.CreateDialogFilter("WitchDoctorSpecialText.Party")).Value; + case 229: + return Language.SelectRandom(Lang.CreateDialogFilter("PirateSpecialText.Party")).Value; + case 353: + return Language.SelectRandom(Lang.CreateDialogFilter("StylistSpecialText.Party")).Value; + case 368: + return Language.SelectRandom(Lang.CreateDialogFilter("TravellingMerchantSpecialText.Party")).Value; + case 369: + return Language.SelectRandom(Lang.CreateDialogFilter("AnglerSpecialText.Party")).Value; + case 550: + return Language.SelectRandom(Lang.CreateDialogFilter("DD2BartenderSpecialText.Party")).Value; + default: + return ""; + } } public string GetChat() @@ -49411,8 +38307,8 @@ label_18: bool flag14 = false; bool flag15 = false; bool flag16 = false; - bool flag17 = false; object substitutionObject = Lang.CreateDialogSubstitutionObject(this); + bool flag17 = false; for (int index = 0; index < 200; ++index) { if (Main.npc[index].active) @@ -49449,16 +38345,21 @@ label_18: flag15 = true; else if (Main.npc[index].type == 22) flag16 = true; - else if (Main.npc[index].type == 441) + else if (Main.npc[index].type == 2) + { flag17 = true; + } + else + { + int type = Main.npc[index].type; + } } } string str = ""; - string specialEventText = ""; if (this.type == 17) { - if (this.HasSpecialEventText("Merchant", out specialEventText)) - str = specialEventText; + if (BirthdayParty.PartyIsUp && Main.rand.Next(3) == 0) + str = this.GetBirthdayDialog(); else if (!NPC.downedBoss1 && Main.rand.Next(3) == 0) str = Main.player[Main.myPlayer].statLifeMax >= 200 ? (Main.player[Main.myPlayer].statDefense > 10 ? Lang.dialog(3) : Lang.dialog(2)) : Lang.dialog(1); else if (Main.dayTime) @@ -49558,8 +38459,8 @@ label_18: } else if (this.type == 18) { - if (this.HasSpecialEventText("Nurse", out specialEventText)) - str = specialEventText; + if (BirthdayParty.PartyIsUp && Main.rand.Next(3) == 0) + str = this.GetBirthdayDialog(); else if (Main.bloodMoon) { if ((double) Main.player[Main.myPlayer].statLife < (double) Main.player[Main.myPlayer].statLifeMax2 * 0.66) @@ -49602,7 +38503,7 @@ label_18: str = Lang.dialog(33); else if (flag3 && Main.rand.Next(4) == 0) str = Lang.dialog(34); - else if (flag16 && Main.rand.Next(4) == 0) + else if (flag17 && Main.rand.Next(4) == 0) str = Lang.dialog(35); else if ((double) Main.player[Main.myPlayer].statLife < (double) Main.player[Main.myPlayer].statLifeMax2 * 0.33) { @@ -49661,9 +38562,9 @@ label_18: } else if (this.type == 19) { - if (this.HasSpecialEventText("ArmsDealer", out specialEventText)) - str = specialEventText; - else if (flag16 && NPC.downedBoss3 && !Main.hardMode) + if (BirthdayParty.PartyIsUp && Main.rand.Next(3) == 0) + str = this.GetBirthdayDialog(); + else if (NPC.downedBoss3 && !Main.hardMode) str = Lang.dialog(58); else if (flag2 && Main.rand.Next(5) == 0) str = Lang.dialog(59); @@ -49697,8 +38598,8 @@ label_18: } else if (this.type == 20) { - if (this.HasSpecialEventText("Dryad", out specialEventText)) - str = specialEventText; + if (BirthdayParty.PartyIsUp && Main.rand.Next(3) == 0) + str = this.GetBirthdayDialog(); else if (DD2Event.DownedInvasionT1 && Main.rand.Next(6) == 0) str = !DD2Event.DownedInvasionT2 ? Language.GetTextValueWith("DryadSpecialText.AfterDD2Tier1", substitutionObject) : Language.GetTextValueWith("DryadSpecialText.AfterDD2Tier2", substitutionObject); else if (!NPC.downedBoss2 && Main.rand.Next(3) == 0) @@ -49807,8 +38708,8 @@ label_18: } else if (this.type == 38) { - if (this.HasSpecialEventText("Demolitionist", out specialEventText)) - str = specialEventText; + if (BirthdayParty.PartyIsUp && Main.rand.Next(3) == 0) + str = this.GetBirthdayDialog(); else if (!NPC.downedBoss2 && Main.rand.Next(3) == 0) str = Lang.dialog(93); else if (Main.bloodMoon) @@ -49878,8 +38779,8 @@ label_18: } else if (this.type == 54) { - if (this.HasSpecialEventText("Clothier", out specialEventText)) - str = specialEventText; + if (BirthdayParty.PartyIsUp && Main.rand.Next(3) == 0) + str = this.GetBirthdayDialog(); else if (!flag7 && Main.rand.Next(2) == 0) str = Lang.dialog(110); else if (flag10 && Main.rand.Next(6) == 0) @@ -49942,8 +38843,8 @@ label_18: break; } } - else if (this.HasSpecialEventText("GoblinTinkerer", out specialEventText)) - str = specialEventText; + else if (BirthdayParty.PartyIsUp && Main.rand.Next(3) == 0) + str = this.GetBirthdayDialog(); else if (flag7 && Main.rand.Next(5) == 0) str = Lang.dialog(126); else if (flag15 && Main.rand.Next(5) == 0) @@ -50026,13 +38927,11 @@ label_18: } } } - else if (this.HasLuckTextForWizard(out specialEventText)) - str = specialEventText; - else if (this.HasSpecialEventText("Wizard", out specialEventText)) - str = specialEventText; + else if (BirthdayParty.PartyIsUp && Main.rand.Next(3) == 0) + str = this.GetBirthdayDialog(); else if (DD2Event.DownedInvasionT1 && Main.rand.Next(6) == 0) str = Language.GetTextValueWith("WizardSpecialText.AfterDD2Tier1", substitutionObject); - else if (Main.player[Main.myPlayer].Male & flag16 && Main.rand.Next(6) == 0) + else if (Main.player[Main.myPlayer].Male & flag17 && Main.rand.Next(6) == 0) str = Lang.dialog(142); else if (Main.player[Main.myPlayer].Male & flag6 && Main.rand.Next(6) == 0) str = Lang.dialog(143); @@ -50103,8 +39002,8 @@ label_18: break; } } - else if (this.HasSpecialEventText("Mechanic", out specialEventText)) - str = specialEventText; + else if (BirthdayParty.PartyIsUp && Main.rand.Next(3) == 0) + str = this.GetBirthdayDialog(); else if (Main.bloodMoon) { switch (Main.rand.Next(4)) @@ -50138,8 +39037,8 @@ label_18: } else if (this.type == 22) { - if (this.HasSpecialEventText("Guide", out specialEventText)) - str = specialEventText; + if (BirthdayParty.PartyIsUp && Main.rand.Next(3) == 0) + str = this.GetBirthdayDialog(); else if (Main.bloodMoon) { switch (Main.rand.Next(3)) @@ -50155,21 +39054,9 @@ label_18: break; } } - else if (LanternNight.LanternsUp && !NPC.downedMoonlord) - str = Language.GetTextValue("GuideSpecialText.Lantern1"); - else if (LanternNight.LanternsUp && NPC.downedMoonlord) - str = Language.GetTextValue("GuideSpecialText.Lantern2"); - else if (Main.eclipse) - str = Language.GetTextValue("GuideSpecialText.Eclipse"); - else if (Main.slimeRain) - str = Language.GetTextValue("GuideSpecialText.SlimeRain"); else if (!Main.dayTime) - str = Lang.dialog(173); - else if (Main.hardMode & flag17 && Main.rand.Next(8) == 0) - str = Language.GetTextValueWith("GuideChatter.Chatter_1", substitutionObject); - else if (Main.hardMode && Main.rand.Next(8) == 0) { - str = Language.GetTextValue("GuideChatter.Chatter_2"); + str = Lang.dialog(173); } else { @@ -50190,9 +39077,9 @@ label_18: else if (this.type == 142) { int num = Main.rand.Next(3); - if (this.HasSpecialEventText("Santa", out specialEventText)) + if (BirthdayParty.PartyIsUp && Main.rand.Next(3) == 0) { - str = specialEventText; + str = this.GetBirthdayDialog(); } else { @@ -50213,8 +39100,8 @@ label_18: else if (this.type == 160) { int num = Main.rand.Next(6); - if (this.HasSpecialEventText("Truffle", out specialEventText)) - str = specialEventText; + if (BirthdayParty.PartyIsUp && Main.rand.Next(3) == 0) + str = this.GetBirthdayDialog(); else if (flag4 && Main.rand.Next(6) == 0) str = Lang.dialog(232); else if (flag9 && Main.rand.Next(6) == 0) @@ -50249,8 +39136,8 @@ label_18: else if (this.type == 178) { int num = Main.rand.Next(5); - if (this.HasSpecialEventText("Steampunker", out specialEventText)) - str = specialEventText; + if (BirthdayParty.PartyIsUp && Main.rand.Next(3) == 0) + str = this.GetBirthdayDialog(); else if (Main.bloodMoon && Main.rand.Next(3) == 0) str = Lang.dialog(245); else if (flag13 && Main.rand.Next(6) == 0) @@ -50284,8 +39171,8 @@ label_18: else if (this.type == 207) { int num = Main.rand.Next(3); - if (this.HasSpecialEventText("DyeTrader", out specialEventText)) - str = specialEventText; + if (BirthdayParty.PartyIsUp && Main.rand.Next(3) == 0) + str = this.GetBirthdayDialog(); else if (flag12 && Main.rand.Next(6) == 0) { str = Lang.dialog(260); @@ -50308,56 +39195,49 @@ label_18: } else if (this.type == 208) { - if (NPC.freeCake) + int num = Main.rand.Next(7); + if (BirthdayParty.PartyIsUp && Main.rand.Next(3) == 0) + str = this.GetBirthdayDialog(); + else if (DD2Event.DownedInvasionT1 && Main.rand.Next(5) == 0) + str = Language.GetTextValueWith("PartyGirlSpecialText.AfterDD2Tier1", substitutionObject); + else if (Main.player[Main.myPlayer].Male && Main.rand.Next(5) == 0) + str = Lang.dialog(268); + else if (flag15 && Main.rand.Next(5) == 0) { - str = Language.GetTextValueWith("PartyGirlSpecialText.Cake" + (object) Main.rand.Next(1, 4), substitutionObject); + str = Lang.dialog(310); } else { - int num = Main.rand.Next(7); - if (this.HasSpecialEventText("PartyGirl", out specialEventText)) - str = specialEventText; - else if (DD2Event.DownedInvasionT1 && Main.rand.Next(5) == 0) - str = Language.GetTextValueWith("PartyGirlSpecialText.AfterDD2Tier1", substitutionObject); - else if (Main.player[Main.myPlayer].Male && Main.rand.Next(5) == 0) - str = Lang.dialog(268); - else if (flag15 && Main.rand.Next(5) == 0) + switch (num) { - str = Lang.dialog(310); - } - else - { - switch (num) - { - case 0: - str = Lang.dialog(265); - break; - case 1: - str = Lang.dialog(266); - break; - case 2: - str = Lang.dialog(267); - break; - case 3: - str = Lang.dialog(269); - break; - case 4: - str = Lang.dialog(270); - break; - case 5: - str = Lang.dialog(271); - break; - case 6: - str = Lang.dialog(272); - break; - } + case 0: + str = Lang.dialog(265); + break; + case 1: + str = Lang.dialog(266); + break; + case 2: + str = Lang.dialog(267); + break; + case 3: + str = Lang.dialog(269); + break; + case 4: + str = Lang.dialog(270); + break; + case 5: + str = Lang.dialog(271); + break; + case 6: + str = Lang.dialog(272); + break; } } } else if (this.type == 209) { - if (this.HasSpecialEventText("Cyborg", out specialEventText)) - str = specialEventText; + if (BirthdayParty.PartyIsUp && Main.rand.Next(3) == 0) + str = this.GetBirthdayDialog(); else if (flag12 && Main.rand.Next(6) == 0) str = Lang.dialog(284); else if (flag11 && Main.rand.Next(6) == 0) @@ -50385,8 +39265,8 @@ label_18: else if (this.type == 227) { int num = Main.rand.Next(5); - if (this.HasSpecialEventText("Painter", out specialEventText)) - str = specialEventText; + if (BirthdayParty.PartyIsUp && Main.rand.Next(3) == 0) + str = this.GetBirthdayDialog(); else if (Main.hardMode && Main.rand.Next(7) == 0) str = Lang.dialog(250); else if (flag14 && Main.rand.Next(6) == 0) @@ -50418,9 +39298,9 @@ label_18: else if (this.type == 228) { int num = Main.rand.Next(4); - if (this.HasSpecialEventText("WitchDoctor", out specialEventText)) - str = specialEventText; - else if (flag2 && Main.rand.Next(4) == 0) + if (BirthdayParty.PartyIsUp && Main.rand.Next(3) == 0) + str = this.GetBirthdayDialog(); + else if (flag2 && Main.rand.Next(6) == 0) { str = Lang.dialog(263); } @@ -50449,8 +39329,8 @@ label_18: int num = Main.rand.Next(6 + all.Length); if (num >= 6) str = all[num - 6].FormatWith(substitutionObject); - else if (this.HasSpecialEventText("Pirate", out specialEventText)) - str = specialEventText; + else if (BirthdayParty.PartyIsUp && Main.rand.Next(3) == 0) + str = this.GetBirthdayDialog(); else if (!Main.player[Main.myPlayer].Male && Main.rand.Next(5) == 0) { str = Lang.dialog(276); @@ -50484,8 +39364,8 @@ label_18: str = Lang.dialog(Main.rand.Next(315, 319)); else if (this.type == 353) { - if (this.HasSpecialEventText("Stylist", out specialEventText)) - str = specialEventText; + if (BirthdayParty.PartyIsUp && Main.rand.Next(3) == 0) + str = this.GetBirthdayDialog(); else if (Main.bloodMoon) { switch (Main.rand.Next(3)) @@ -50607,69 +39487,41 @@ label_18: } } else if (this.type == 368) - str = !this.HasSpecialEventText("TravellingMerchant", out specialEventText) ? (!flag16 || Main.rand.Next(5) != 0 ? (!flag1 || Main.rand.Next(5) != 0 ? (!flag9 || Main.rand.Next(5) != 0 ? Lang.dialog(Main.rand.Next(322, 331)) : Lang.dialog(321)) : Lang.dialog(320)) : Lang.dialog(319)) : specialEventText; + str = !BirthdayParty.PartyIsUp || Main.rand.Next(3) != 0 ? (!flag16 || Main.rand.Next(5) != 0 ? (!flag1 || Main.rand.Next(5) != 0 ? (!flag9 || Main.rand.Next(5) != 0 ? Lang.dialog(Main.rand.Next(322, 331)) : Lang.dialog(321)) : Lang.dialog(320)) : Lang.dialog(319)) : this.GetBirthdayDialog(); else if (this.type == 376) str = Lang.dialog(Main.rand.Next(353, 356)); else if (this.type == 369) - str = Main.rand.Next(5) != 0 || Main.LocalPlayer.anglerQuestsFinished <= 1 ? (!this.HasSpecialEventText("Angler", out specialEventText) ? (!Main.bloodMoon ? (Main.anglerQuestFinished ? (!flag4 || Main.rand.Next(5) != 0 ? Language.SelectRandom(Lang.CreateDialogFilter("AnglerChatter.", substitutionObject)).FormatWith(substitutionObject) : Lang.dialog(347)) : Lang.dialog(Main.rand.Next(334, 338))) : (Main.rand.Next(3) != 0 ? (Main.anglerQuestFinished ? Lang.dialog(Main.rand.Next(350, 353)) : Lang.dialog(Main.rand.Next(348, 350))) : Language.SelectRandom(Lang.CreateDialogFilter("AnglerSpecialText.BloodMoonFishing")).FormatWith(substitutionObject))) : specialEventText) : Lang.AnglerQuestCountChat(this); + { + if (BirthdayParty.PartyIsUp && Main.rand.Next(3) == 0) + str = this.GetBirthdayDialog(); + else if (Main.bloodMoon) + str = Main.anglerQuestFinished ? Lang.dialog(Main.rand.Next(350, 353)) : Lang.dialog(Main.rand.Next(348, 350)); + else if (!Main.anglerQuestFinished) + str = Lang.dialog(Main.rand.Next(334, 338)); + else if (flag4 && Main.rand.Next(5) == 0) + { + str = Lang.dialog(347); + } + else + { + LocalizedText[] all = Language.FindAll(Lang.CreateDialogFilter("AnglerChatter.", substitutionObject)); + int num = Main.rand.Next(all.Length + 9); + str = num < 9 ? Lang.dialog(338 + num) : all[num - 9].FormatWith(substitutionObject); + } + } else if (this.type == 453) - str = !this.HasSpecialEventText("SkeletonMerchant", out specialEventText) ? Lang.dialog(Main.rand.Next(356, 364)) : specialEventText; + str = Lang.dialog(Main.rand.Next(356, 364)); else if (this.type == 441) - str = !this.HasSpecialEventText("TaxCollector", out specialEventText) ? (!(Main.rand.Next(6) == 0 & flag4) ? (!(Main.rand.Next(6) == 0 & flag3) ? (!(Main.rand.Next(6) == 0 & flag6) ? (!(Main.rand.Next(6) == 0 & flag1) ? Lang.dialog(Main.rand.Next(364, 370)) : Lang.dialog(374)) : Lang.dialog(373)) : Lang.dialog(372)) : Lang.dialog(371)) : specialEventText; + str = !(Main.rand.Next(6) == 0 & flag4) ? (!(Main.rand.Next(6) == 0 & flag3) ? (!(Main.rand.Next(6) == 0 & flag6) ? (!(Main.rand.Next(6) == 0 & flag1) ? Lang.dialog(Main.rand.Next(364, 370)) : Lang.dialog(374)) : Lang.dialog(373)) : Lang.dialog(372)) : Lang.dialog(371); else if (this.type == 579) str = Language.GetTextValue("BartenderSpecialText.FirstMeeting"); else if (this.type == 550) - str = !this.HasSpecialEventText("Bartender", out specialEventText) ? Lang.BartenderChat(this) : specialEventText; - else if (this.type == 589) - str = Main.rand.Next(2) != 0 ? Language.GetTextValue("GolferSpecialText.FirstMeeting2") : Language.GetTextValue("GolferSpecialText.FirstMeeting1"); - else if (this.type == 588) - str = Main.rand.Next(3) == 0 || !this.HasSpecialEventText("Golfer", out specialEventText) ? (Main.rand.Next(3) != 0 ? Lang.GolferChat(this) : Language.SelectRandom(Lang.CreateDialogFilter((Main.LocalPlayer.golferScoreAccumulated < 2000 ? (Main.LocalPlayer.golferScoreAccumulated < 1000 ? (Main.LocalPlayer.golferScoreAccumulated < 500 ? "GolferQuestsChatterBeginner" : "GolferQuestsChatterApprentice") : "GolferQuestsChatterJourneyman") : "GolferQuestsChatterMaster") + ".")).FormatWith(substitutionObject)) : specialEventText; - else if (this.type == 633) - str = this.ShouldBestiaryGirlBeLycantrope() || !this.HasSpecialEventText("BestiaryGirl", out specialEventText) ? Lang.BestiaryGirlChat(this) : specialEventText; - else if (this.type == 637) - str = !this.HasSpecialEventText("Cat", out specialEventText) ? Lang.CatChat(this) : specialEventText; - else if (this.type == 638) - str = !this.HasSpecialEventText("Dog", out specialEventText) ? Lang.DogChat(this) : specialEventText; - else if (this.type == 656) - str = !this.HasSpecialEventText("Bunny", out specialEventText) ? Lang.BunnyChat(this) : specialEventText; + str = Lang.BartenderChat(this); return str; } public object Clone() => this.MemberwiseClone(); - public bool HasLuckTextForWizard(out string specialEventText) - { - specialEventText = (string) null; - object substitutionObject = Lang.CreateDialogSubstitutionObject(this); - if (Main.rand.Next(3) != 0) - return false; - float normalizedLuck = Main.player[Main.myPlayer].NormalizedLuck; - if ((double) normalizedLuck == 0.0) - return false; - string startsWith = (double) normalizedLuck >= -0.600000023841858 ? ((double) normalizedLuck >= -0.400000005960464 ? ((double) normalizedLuck >= -0.200000002980232 ? ((double) normalizedLuck >= 0.0 ? ((double) normalizedLuck >= 0.25 ? ((double) normalizedLuck >= 0.5 ? ((double) normalizedLuck >= 0.75 ? "WizardSpecialText.LuckIsGodly" : "WizardSpecialText.LuckIsAmazing") : "WizardSpecialText.LuckIsGreat") : "WizardSpecialText.LuckIsGood") : "WizardSpecialText.LuckIsBad") : "WizardSpecialText.LuckIsPoor") : "WizardSpecialText.LuckIsTerrible") : "WizardSpecialText.LuckIsCursed"; - specialEventText = Language.SelectRandom(Lang.CreateDialogFilter(startsWith)).FormatWith(substitutionObject); - return true; - } - - public bool HasSpecialEventText(string specialTextCategoryKey, out string specialEventText) - { - specialEventText = (string) null; - object substitutionObject = Lang.CreateDialogSubstitutionObject(this); - return Main.LocalPlayer.ZoneGraveyard && Main.rand.Next(3) == 0 && this.GetSpecialEventTextIfNotEmpty(specialTextCategoryKey + "SpecialText.Graveyard", substitutionObject, ref specialEventText) || BirthdayParty.PartyIsUp && Main.rand.Next(3) == 0 && !NPCID.Sets.HasNoPartyText[this.type] && this.GetSpecialEventTextIfNotEmpty(specialTextCategoryKey + "SpecialText.Party", substitutionObject, ref specialEventText) || Main.raining && !Main.IsItStorming && Main.rand.Next(3) == 0 && this.GetSpecialEventTextIfNotEmpty(specialTextCategoryKey + "SpecialText.Rain", substitutionObject, ref specialEventText) || Main.IsItAHappyWindyDay && Main.rand.Next(3) == 0 && this.GetSpecialEventTextIfNotEmpty(specialTextCategoryKey + "SpecialText.Windy", substitutionObject, ref specialEventText) || Main.IsItStorming && Main.rand.Next(3) == 0 && this.GetSpecialEventTextIfNotEmpty(specialTextCategoryKey + "SpecialText.Storm", substitutionObject, ref specialEventText); - } - - public bool GetSpecialEventTextIfNotEmpty( - string specialTextKey, - object substitutes, - ref string specialEventText) - { - LocalizedText localizedText = Language.SelectRandom(Lang.CreateDialogFilter(specialTextKey)); - if (localizedText == LocalizedText.Empty) - return false; - specialEventText = localizedText.FormatWith(substitutes); - return true; - } - public void CheckDrowning() { bool flag = Collision.DrownCollision(this.position, this.width, this.height, 1f); @@ -50730,7 +39582,7 @@ label_18: ref Microsoft.Xna.Framework.Rectangle npcRect) { NPC npc1 = Main.npc[enemyIndex]; - if ((npc1.type >= 430 && npc1.type <= 436 || npc1.type == 591) && (double) npc1.ai[2] > 5.0) + if (npc1.type >= 430 && npc1.type <= 436 && (double) npc1.ai[2] > 5.0) { int num = 34; if (npc1.spriteDirection < 0) @@ -50852,8 +39704,6 @@ label_18: } } - public string GetBestiaryCreditId() => ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[this.netID]; - public override string ToString() => "name:" + this.TypeName + ", active:" + this.active.ToString() + ", whoAmI:" + (object) this.whoAmI; } } diff --git a/NPCSpawnParams.cs b/NPCSpawnParams.cs deleted file mode 100644 index 21a1389..0000000 --- a/NPCSpawnParams.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.NPCSpawnParams -// 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 Terraria.DataStructures; - -namespace Terraria -{ - public struct NPCSpawnParams - { - public float? sizeScaleOverride; - public int? playerCountForMultiplayerDifficultyOverride; - public GameModeData gameModeData; - public float? strengthMultiplierOverride; - - public NPCSpawnParams WithScale(float scaleOverride) => new NPCSpawnParams() - { - sizeScaleOverride = new float?(scaleOverride), - playerCountForMultiplayerDifficultyOverride = this.playerCountForMultiplayerDifficultyOverride, - gameModeData = this.gameModeData, - strengthMultiplierOverride = this.strengthMultiplierOverride - }; - } -} diff --git a/Net/AddressType.cs b/Net/AddressType.cs index b2480b5..62936e1 100644 --- a/Net/AddressType.cs +++ b/Net/AddressType.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Net.AddressType -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Net @@ -10,6 +10,5 @@ namespace Terraria.Net { Tcp, Steam, - WeGame, } } diff --git a/Net/LegacyNetBufferPool.cs b/Net/LegacyNetBufferPool.cs index 85d1f35..75344b8 100644 --- a/Net/LegacyNetBufferPool.cs +++ b/Net/LegacyNetBufferPool.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Net.LegacyNetBufferPool -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; @@ -18,10 +18,10 @@ namespace Terraria.Net private static Queue _smallBufferQueue = new Queue(); private static Queue _mediumBufferQueue = new Queue(); private static Queue _largeBufferQueue = new Queue(); - private static int _smallBufferCount; - private static int _mediumBufferCount; - private static int _largeBufferCount; - private static int _customBufferCount; + private static int _smallBufferCount = 0; + private static int _mediumBufferCount = 0; + private static int _largeBufferCount = 0; + private static int _customBufferCount = 0; public static byte[] RequestBuffer(int size) { diff --git a/Net/NetGroupInfo.cs b/Net/NetGroupInfo.cs deleted file mode 100644 index a6e8400..0000000 --- a/Net/NetGroupInfo.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Net.NetGroupInfo -// 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; - -namespace Terraria.Net -{ - public class NetGroupInfo - { - private readonly string[] _separatorBetweenInfos = new string[1] - { - ", " - }; - private readonly string[] _separatorBetweenIdAndInfo = new string[1] - { - ":" - }; - private List _infoProviders; - - public NetGroupInfo() - { - this._infoProviders = new List(); - this._infoProviders.Add((NetGroupInfo.INetGroupInfoProvider) new NetGroupInfo.IPAddressInfoProvider()); - this._infoProviders.Add((NetGroupInfo.INetGroupInfoProvider) new NetGroupInfo.SteamLobbyInfoProvider()); - } - - public string ComposeInfo() - { - List stringList = new List(); - foreach (NetGroupInfo.INetGroupInfoProvider infoProvider in this._infoProviders) - { - if (infoProvider.HasValidInfo) - { - string safeInfo = this.ConvertToSafeInfo(((int) infoProvider.Id).ToString() + this._separatorBetweenIdAndInfo[0] + infoProvider.ProvideInfoNeededToJoin()); - stringList.Add(safeInfo); - } - } - return string.Join(this._separatorBetweenInfos[0], stringList.ToArray()); - } - - public Dictionary DecomposeInfo( - string info) - { - Dictionary dictionary = new Dictionary(); - foreach (string text in info.Split(this._separatorBetweenInfos, StringSplitOptions.RemoveEmptyEntries)) - { - string[] strArray = this.ConvertFromSafeInfo(text).Split(this._separatorBetweenIdAndInfo, StringSplitOptions.RemoveEmptyEntries); - int result; - if (strArray.Length == 2 && int.TryParse(strArray[0], out result)) - dictionary[(NetGroupInfo.InfoProviderId) result] = strArray[1]; - } - return dictionary; - } - - private string ConvertToSafeInfo(string text) => Uri.EscapeDataString(text); - - private string ConvertFromSafeInfo(string text) => Uri.UnescapeDataString(text); - - public enum InfoProviderId - { - IPAddress, - Steam, - } - - private interface INetGroupInfoProvider - { - NetGroupInfo.InfoProviderId Id { get; } - - bool HasValidInfo { get; } - - string ProvideInfoNeededToJoin(); - } - - private class IPAddressInfoProvider : NetGroupInfo.INetGroupInfoProvider - { - public NetGroupInfo.InfoProviderId Id => NetGroupInfo.InfoProviderId.IPAddress; - - public bool HasValidInfo => false; - - public string ProvideInfoNeededToJoin() => ""; - } - - private class SteamLobbyInfoProvider : NetGroupInfo.INetGroupInfoProvider - { - public NetGroupInfo.InfoProviderId Id => NetGroupInfo.InfoProviderId.Steam; - - public bool HasValidInfo => Main.LobbyId > 0UL; - - public string ProvideInfoNeededToJoin() => Main.LobbyId.ToString(); - } - } -} diff --git a/Net/NetManager.cs b/Net/NetManager.cs index 77c6eb1..e4d3132 100644 --- a/Net/NetManager.cs +++ b/Net/NetManager.cs @@ -1,11 +1,13 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Net.NetManager -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe +using System; using System.Collections.Generic; using System.IO; +using Terraria.Localization; using Terraria.Net.Sockets; namespace Terraria.Net @@ -33,12 +35,12 @@ namespace Terraria.Net public ushort GetId() where T : NetModule => NetManager.PacketTypeStorage.Id; - public void Read(BinaryReader reader, int userId, int readLength) + public void Read(BinaryReader reader, int userId) { ushort key = reader.ReadUInt16(); - if (this._modules.ContainsKey(key)) - this._modules[key].Deserialize(reader, userId); - Main.ActiveNetDiagnosticsUI.CountReadModuleMessage((int) key, readLength); + if (!this._modules.ContainsKey(key)) + return; + this._modules[key].Deserialize(reader, userId); } public void Broadcast(NetPacket packet, int ignoreClient = -1) @@ -50,54 +52,6 @@ namespace Terraria.Net } } - public void Broadcast( - NetPacket packet, - NetManager.BroadcastCondition conditionToBroadcast, - int ignoreClient = -1) - { - for (int clientIndex = 0; clientIndex < 256; ++clientIndex) - { - if (clientIndex != ignoreClient && Netplay.Clients[clientIndex].IsConnected() && conditionToBroadcast(clientIndex)) - this.SendData(Netplay.Clients[clientIndex].Socket, packet); - } - } - - public void SendToSelf(NetPacket packet) - { - packet.Reader.BaseStream.Position = 3L; - this.Read(packet.Reader, Main.myPlayer, packet.Length); - NetManager.SendCallback((object) packet); - Main.ActiveNetDiagnosticsUI.CountSentModuleMessage((int) packet.Id, packet.Length); - } - - public void BroadcastOrLoopback(NetPacket packet) - { - if (Main.netMode == 2) - { - this.Broadcast(packet); - } - else - { - if (Main.netMode != 0) - return; - this.SendToSelf(packet); - } - } - - public void SendToServerOrLoopback(NetPacket packet) - { - if (Main.netMode == 1) - { - this.SendToServer(packet); - } - else - { - if (Main.netMode != 0) - return; - this.SendToSelf(packet); - } - } - public void SendToServer(NetPacket packet) => this.SendData(Netplay.Connection.Socket, packet); public void SendToClient(NetPacket packet, int playerId) => this.SendData(Netplay.Clients[playerId].Socket, packet); @@ -113,8 +67,8 @@ namespace Terraria.Net } catch { + Console.WriteLine(Language.GetTextValue("Error.ExceptionNormal", (object) Language.GetTextValue("Error.DataSentAfterConnectionLost"))); } - Main.ActiveNetDiagnosticsUI.CountSentModuleMessage((int) packet.Id, packet.Length); } public static void SendCallback(object state) => ((NetPacket) state).Recycle(); @@ -124,7 +78,5 @@ namespace Terraria.Net public static ushort Id; public static T Module; } - - public delegate bool BroadcastCondition(int clientIndex); } } diff --git a/Net/NetModule.cs b/Net/NetModule.cs index 403eb99..947f5d3 100644 --- a/Net/NetModule.cs +++ b/Net/NetModule.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Net.NetModule -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System.IO; diff --git a/Net/NetPacket.cs b/Net/NetPacket.cs index 1d12fd7..22a5f56 100644 --- a/Net/NetPacket.cs +++ b/Net/NetPacket.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Net.NetPacket -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System.IO; diff --git a/Net/RemoteAddress.cs b/Net/RemoteAddress.cs index e3adbad..1a8a09e 100644 --- a/Net/RemoteAddress.cs +++ b/Net/RemoteAddress.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Net.RemoteAddress -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Net diff --git a/Net/ServerMode.cs b/Net/ServerMode.cs index cc29c0d..47a8a39 100644 --- a/Net/ServerMode.cs +++ b/Net/ServerMode.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Net.ServerMode -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; diff --git a/Net/Sockets/ISocket.cs b/Net/Sockets/ISocket.cs index dac7ed0..a718df3 100644 --- a/Net/Sockets/ISocket.cs +++ b/Net/Sockets/ISocket.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Net.Sockets.ISocket -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Net.Sockets diff --git a/Net/Sockets/SocialSocket.cs b/Net/Sockets/SocialSocket.cs index cd28178..02bde70 100644 --- a/Net/Sockets/SocialSocket.cs +++ b/Net/Sockets/SocialSocket.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Net.Sockets.SocialSocket -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; diff --git a/Net/Sockets/SocketConnectionAccepted.cs b/Net/Sockets/SocketConnectionAccepted.cs index c3d813d..d120e00 100644 --- a/Net/Sockets/SocketConnectionAccepted.cs +++ b/Net/Sockets/SocketConnectionAccepted.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Net.Sockets.SocketConnectionAccepted -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Net.Sockets diff --git a/Net/Sockets/SocketReceiveCallback.cs b/Net/Sockets/SocketReceiveCallback.cs index cee6417..ed06975 100644 --- a/Net/Sockets/SocketReceiveCallback.cs +++ b/Net/Sockets/SocketReceiveCallback.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Net.Sockets.SocketReceiveCallback -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Net.Sockets diff --git a/Net/Sockets/SocketSendCallback.cs b/Net/Sockets/SocketSendCallback.cs index e799155..c33de18 100644 --- a/Net/Sockets/SocketSendCallback.cs +++ b/Net/Sockets/SocketSendCallback.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Net.Sockets.SocketSendCallback -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Net.Sockets diff --git a/Net/Sockets/TcpSocket.cs b/Net/Sockets/TcpSocket.cs index 3390282..76c0ce4 100644 --- a/Net/Sockets/TcpSocket.cs +++ b/Net/Sockets/TcpSocket.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Net.Sockets.TcpSocket -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; @@ -16,6 +16,7 @@ namespace Terraria.Net.Sockets public class TcpSocket : ISocket { private byte[] _packetBuffer = new byte[1024]; + private int _packetBufferLength; private List _callbackBuffer = new List(); private int _messagesInQueue; private TcpClient _connection; @@ -26,10 +27,11 @@ namespace Terraria.Net.Sockets public int MessagesInQueue => this._messagesInQueue; - public TcpSocket() => this._connection = new TcpClient() + public TcpSocket() { - NoDelay = true - }; + this._connection = new TcpClient(); + this._connection.NoDelay = true; + } public TcpSocket(TcpClient tcpClient) { @@ -98,7 +100,7 @@ namespace Terraria.Net.Sockets this._connection.GetStream().BeginRead(data, offset, size, new AsyncCallback(this.ReadCallback), (object) new Tuple(callback, state)); } - bool ISocket.IsDataAvailable() => this._connection.Connected && this._connection.GetStream().DataAvailable; + bool ISocket.IsDataAvailable() => this._connection.GetStream().DataAvailable; RemoteAddress ISocket.GetRemoteAddress() => this._remoteAddress; @@ -120,21 +122,17 @@ namespace Terraria.Net.Sockets { return false; } - new Thread(new ThreadStart(this.ListenLoop)) - { - IsBackground = true, - Name = "TCP Listen Thread" - }.Start(); + ThreadPool.QueueUserWorkItem(new WaitCallback(this.ListenLoop)); return true; } void ISocket.StopListening() => this._isListening = false; - private void ListenLoop() + private void ListenLoop(object unused) { while (this._isListening) { - if (!Netplay.Disconnect) + if (!Netplay.disconnect) { try { diff --git a/Net/SteamAddress.cs b/Net/SteamAddress.cs index ca9e624..7a00940 100644 --- a/Net/SteamAddress.cs +++ b/Net/SteamAddress.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Net.SteamAddress -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Steamworks; diff --git a/Net/TcpAddress.cs b/Net/TcpAddress.cs index dacb88c..77945e3 100644 --- a/Net/TcpAddress.cs +++ b/Net/TcpAddress.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Net.TcpAddress -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System.Net; diff --git a/Net/WeGameAddress.cs b/Net/WeGameAddress.cs deleted file mode 100644 index 114c9fd..0000000 --- a/Net/WeGameAddress.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Net.WeGameAddress -// 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 rail; - -namespace Terraria.Net -{ - public class WeGameAddress : RemoteAddress - { - public readonly RailID rail_id; - private string nickname; - - public WeGameAddress(RailID id, string name) - { - this.Type = AddressType.WeGame; - this.rail_id = id; - this.nickname = name; - } - - public override string ToString() => "WEGAME_0:" + __nonvirtual (((RailComparableID) this.rail_id).id_.ToString()); - - public override string GetIdentifier() => this.ToString(); - - public override bool IsLocalHost() => Program.LaunchParameters.ContainsKey("-localwegameid") && Program.LaunchParameters["-localwegameid"].Equals(__nonvirtual (((RailComparableID) this.rail_id).id_.ToString())); - - public override string GetFriendlyName() => this.nickname; - } -} diff --git a/NetMessage.cs b/NetMessage.cs index 9d347a4..33c8b5d 100644 --- a/NetMessage.cs +++ b/NetMessage.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.NetMessage -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Ionic.Zlib; @@ -11,12 +11,13 @@ using System; using System.IO; using Terraria.Chat; using Terraria.DataStructures; -using Terraria.GameContent; using Terraria.GameContent.Events; +using Terraria.GameContent.NetModules; using Terraria.GameContent.Tile_Entities; using Terraria.ID; using Terraria.IO; using Terraria.Localization; +using Terraria.Net; using Terraria.Net.Sockets; using Terraria.Social; @@ -26,31 +27,23 @@ namespace Terraria { public static MessageBuffer[] buffer = new MessageBuffer[257]; private static PlayerDeathReason _currentPlayerDeathReason; - private static NetMessage.NetSoundInfo _currentNetSoundInfo; - private static CoinLossRevengeSystem.RevengeMarker _currentRevengeMarker; - public static bool TrySendData( - int msgType, - int remoteClient = -1, - int ignoreClient = -1, - NetworkText text = null, - int number = 0, - float number2 = 0.0f, - float number3 = 0.0f, - float number4 = 0.0f, - int number5 = 0, - int number6 = 0, - int number7 = 0) + public static void SendChatMessageToClient(NetworkText text, Color color, int playerId) { - try - { - NetMessage.SendData(msgType, remoteClient, ignoreClient, text, number, number2, number3, number4, number5, number6, number7); - } - catch (Exception ex) - { - return false; - } - return true; + NetPacket packet = NetTextModule.SerializeServerMessage(text, color, byte.MaxValue); + NetManager.Instance.SendToClient(packet, playerId); + } + + public static void BroadcastChatMessage(NetworkText text, Color color, int excludedPlayer = -1) + { + NetPacket packet = NetTextModule.SerializeServerMessage(text, color, byte.MaxValue); + NetManager.Instance.Broadcast(packet, excludedPlayer); + } + + public static void SendChatMessageFromClient(ChatMessage text) + { + NetPacket packet = NetTextModule.SerializeClientMessage(text); + NetManager.Instance.SendToServer(packet); } public static void SendData( @@ -88,7 +81,7 @@ namespace Terraria switch (msgType) { case 1: - writer.Write("Terraria" + (object) 230); + writer.Write("Terraria" + (object) 194); break; case 2: text.Serialize(writer); @@ -110,11 +103,11 @@ namespace Terraria writer.Write(player1.hairDye); BitsByte bitsByte1 = (BitsByte) (byte) 0; for (int key = 0; key < 8; ++key) - bitsByte1[key] = player1.hideVisibleAccessory[key]; + bitsByte1[key] = player1.hideVisual[key]; writer.Write((byte) bitsByte1); BitsByte bitsByte2 = (BitsByte) (byte) 0; for (int key = 0; key < 2; ++key) - bitsByte2[key] = player1.hideVisibleAccessory[key + 8]; + bitsByte2[key] = player1.hideVisual[key + 8]; writer.Write((byte) bitsByte2); writer.Write((byte) player1.hideMisc); writer.WriteRGB(player1.hairColor); @@ -129,22 +122,16 @@ namespace Terraria bitsByte3[0] = true; else if (player1.difficulty == (byte) 2) bitsByte3[1] = true; - else if (player1.difficulty == (byte) 3) - bitsByte3[3] = true; bitsByte3[2] = player1.extraAccessory; writer.Write((byte) bitsByte3); - BitsByte bitsByte4 = (BitsByte) (byte) 0; - bitsByte4[0] = player1.UsingBiomeTorches; - bitsByte4[1] = player1.happyFunTorchTime; - writer.Write((byte) bitsByte4); break; case 5: writer.Write((byte) number); - writer.Write((short) number2); + writer.Write((byte) number2); Player player2 = Main.player[number]; - Item obj1 = (double) number2 <= (double) (58 + player2.armor.Length + player2.dye.Length + player2.miscEquips.Length + player2.miscDyes.Length + player2.bank.item.Length + player2.bank2.item.Length + player2.bank3.item.Length + 1) ? ((double) number2 <= (double) (58 + player2.armor.Length + player2.dye.Length + player2.miscEquips.Length + player2.miscDyes.Length + player2.bank.item.Length + player2.bank2.item.Length + 1) ? ((double) number2 <= (double) (58 + player2.armor.Length + player2.dye.Length + player2.miscEquips.Length + player2.miscDyes.Length + player2.bank.item.Length + player2.bank2.item.Length) ? ((double) number2 <= (double) (58 + player2.armor.Length + player2.dye.Length + player2.miscEquips.Length + player2.miscDyes.Length + player2.bank.item.Length) ? ((double) number2 <= (double) (58 + player2.armor.Length + player2.dye.Length + player2.miscEquips.Length + player2.miscDyes.Length) ? ((double) number2 <= (double) (58 + player2.armor.Length + player2.dye.Length + player2.miscEquips.Length) ? ((double) number2 <= (double) (58 + player2.armor.Length + player2.dye.Length) ? ((double) number2 <= (double) (58 + player2.armor.Length) ? ((double) number2 <= 58.0 ? player2.inventory[(int) number2] : player2.armor[(int) number2 - 58 - 1]) : player2.dye[(int) number2 - 58 - player2.armor.Length - 1]) : player2.miscEquips[(int) number2 - 58 - (player2.armor.Length + player2.dye.Length) - 1]) : player2.miscDyes[(int) number2 - 58 - (player2.armor.Length + player2.dye.Length + player2.miscEquips.Length) - 1]) : player2.bank.item[(int) number2 - 58 - (player2.armor.Length + player2.dye.Length + player2.miscEquips.Length + player2.miscDyes.Length) - 1]) : player2.bank2.item[(int) number2 - 58 - (player2.armor.Length + player2.dye.Length + player2.miscEquips.Length + player2.miscDyes.Length + player2.bank.item.Length) - 1]) : player2.trashItem) : player2.bank3.item[(int) number2 - 58 - (player2.armor.Length + player2.dye.Length + player2.miscEquips.Length + player2.miscDyes.Length + player2.bank.item.Length + player2.bank2.item.Length + 1) - 1]) : player2.bank4.item[(int) number2 - 58 - (player2.armor.Length + player2.dye.Length + player2.miscEquips.Length + player2.miscDyes.Length + player2.bank.item.Length + player2.bank2.item.Length + player2.bank3.item.Length + 1) - 1]; + Item obj1 = (double) number2 <= (double) (58 + player2.armor.Length + player2.dye.Length + player2.miscEquips.Length + player2.miscDyes.Length + player2.bank.item.Length + player2.bank2.item.Length + 1) ? ((double) number2 <= (double) (58 + player2.armor.Length + player2.dye.Length + player2.miscEquips.Length + player2.miscDyes.Length + player2.bank.item.Length + player2.bank2.item.Length) ? ((double) number2 <= (double) (58 + player2.armor.Length + player2.dye.Length + player2.miscEquips.Length + player2.miscDyes.Length + player2.bank.item.Length) ? ((double) number2 <= (double) (58 + player2.armor.Length + player2.dye.Length + player2.miscEquips.Length + player2.miscDyes.Length) ? ((double) number2 <= (double) (58 + player2.armor.Length + player2.dye.Length + player2.miscEquips.Length) ? ((double) number2 <= (double) (58 + player2.armor.Length + player2.dye.Length) ? ((double) number2 <= (double) (58 + player2.armor.Length) ? ((double) number2 <= 58.0 ? player2.inventory[(int) number2] : player2.armor[(int) number2 - 58 - 1]) : player2.dye[(int) number2 - 58 - player2.armor.Length - 1]) : player2.miscEquips[(int) number2 - 58 - (player2.armor.Length + player2.dye.Length) - 1]) : player2.miscDyes[(int) number2 - 58 - (player2.armor.Length + player2.dye.Length + player2.miscEquips.Length) - 1]) : player2.bank.item[(int) number2 - 58 - (player2.armor.Length + player2.dye.Length + player2.miscEquips.Length + player2.miscDyes.Length) - 1]) : player2.bank2.item[(int) number2 - 58 - (player2.armor.Length + player2.dye.Length + player2.miscEquips.Length + player2.miscDyes.Length + player2.bank.item.Length) - 1]) : player2.trashItem) : player2.bank3.item[(int) number2 - 58 - (player2.armor.Length + player2.dye.Length + player2.miscEquips.Length + player2.miscDyes.Length + player2.bank.item.Length + player2.bank2.item.Length + 1) - 1]; if (obj1.Name == "" || obj1.stack == 0 || obj1.type == 0) - obj1.SetDefaults(0, true); + obj1.SetDefaults(); int num1 = obj1.stack; int netId1 = obj1.netID; if (num1 < 0) @@ -155,11 +142,11 @@ namespace Terraria break; case 7: writer.Write((int) Main.time); - BitsByte bitsByte5 = (BitsByte) (byte) 0; - bitsByte5[0] = Main.dayTime; - bitsByte5[1] = Main.bloodMoon; - bitsByte5[2] = Main.eclipse; - writer.Write((byte) bitsByte5); + BitsByte bitsByte4 = (BitsByte) (byte) 0; + bitsByte4[0] = Main.dayTime; + bitsByte4[1] = Main.bloodMoon; + bitsByte4[2] = Main.eclipse; + writer.Write((byte) bitsByte4); writer.Write((byte) Main.moonPhase); writer.Write((short) Main.maxTilesX); writer.Write((short) Main.maxTilesY); @@ -169,14 +156,10 @@ namespace Terraria writer.Write((short) Main.rockLayer); writer.Write(Main.worldID); writer.Write(Main.worldName); - writer.Write((byte) Main.GameMode); writer.Write(Main.ActiveWorldFileData.UniqueId.ToByteArray()); writer.Write(Main.ActiveWorldFileData.WorldGeneratorVersion); writer.Write((byte) Main.moonType); - writer.Write((byte) WorldGen.treeBG1); - writer.Write((byte) WorldGen.treeBG2); - writer.Write((byte) WorldGen.treeBG3); - writer.Write((byte) WorldGen.treeBG4); + writer.Write((byte) WorldGen.treeBG); writer.Write((byte) WorldGen.corruptBG); writer.Write((byte) WorldGen.jungleBG); writer.Write((byte) WorldGen.snowBG); @@ -184,12 +167,10 @@ namespace Terraria writer.Write((byte) WorldGen.crimsonBG); writer.Write((byte) WorldGen.desertBG); writer.Write((byte) WorldGen.oceanBG); - writer.Write((byte) WorldGen.mushroomBG); - writer.Write((byte) WorldGen.underworldBG); writer.Write((byte) Main.iceBackStyle); writer.Write((byte) Main.jungleBackStyle); writer.Write((byte) Main.hellBackStyle); - writer.Write(Main.windSpeedTarget); + writer.Write(Main.windSpeedSet); writer.Write((byte) Main.numClouds); for (int index = 0; index < 3; ++index) writer.Write(Main.treeX[index]); @@ -199,85 +180,58 @@ namespace Terraria writer.Write(Main.caveBackX[index]); for (int index = 0; index < 4; ++index) writer.Write((byte) Main.caveBackStyle[index]); - WorldGen.TreeTops.SyncSend(writer); if (!Main.raining) Main.maxRaining = 0.0f; writer.Write(Main.maxRaining); + BitsByte bitsByte5 = (BitsByte) (byte) 0; + bitsByte5[0] = WorldGen.shadowOrbSmashed; + bitsByte5[1] = NPC.downedBoss1; + bitsByte5[2] = NPC.downedBoss2; + bitsByte5[3] = NPC.downedBoss3; + bitsByte5[4] = Main.hardMode; + bitsByte5[5] = NPC.downedClown; + bitsByte5[7] = NPC.downedPlantBoss; + writer.Write((byte) bitsByte5); BitsByte bitsByte6 = (BitsByte) (byte) 0; - bitsByte6[0] = WorldGen.shadowOrbSmashed; - bitsByte6[1] = NPC.downedBoss1; - bitsByte6[2] = NPC.downedBoss2; - bitsByte6[3] = NPC.downedBoss3; - bitsByte6[4] = Main.hardMode; - bitsByte6[5] = NPC.downedClown; - bitsByte6[7] = NPC.downedPlantBoss; + bitsByte6[0] = NPC.downedMechBoss1; + bitsByte6[1] = NPC.downedMechBoss2; + bitsByte6[2] = NPC.downedMechBoss3; + bitsByte6[3] = NPC.downedMechBossAny; + bitsByte6[4] = (double) Main.cloudBGActive >= 1.0; + bitsByte6[5] = WorldGen.crimson; + bitsByte6[6] = Main.pumpkinMoon; + bitsByte6[7] = Main.snowMoon; writer.Write((byte) bitsByte6); BitsByte bitsByte7 = (BitsByte) (byte) 0; - bitsByte7[0] = NPC.downedMechBoss1; - bitsByte7[1] = NPC.downedMechBoss2; - bitsByte7[2] = NPC.downedMechBoss3; - bitsByte7[3] = NPC.downedMechBossAny; - bitsByte7[4] = (double) Main.cloudBGActive >= 1.0; - bitsByte7[5] = WorldGen.crimson; - bitsByte7[6] = Main.pumpkinMoon; - bitsByte7[7] = Main.snowMoon; + bitsByte7[0] = Main.expertMode; + bitsByte7[1] = Main.fastForwardTime; + bitsByte7[2] = Main.slimeRain; + bitsByte7[3] = NPC.downedSlimeKing; + bitsByte7[4] = NPC.downedQueenBee; + bitsByte7[5] = NPC.downedFishron; + bitsByte7[6] = NPC.downedMartians; + bitsByte7[7] = NPC.downedAncientCultist; writer.Write((byte) bitsByte7); BitsByte bitsByte8 = (BitsByte) (byte) 0; - bitsByte8[1] = Main.fastForwardTime; - bitsByte8[2] = Main.slimeRain; - bitsByte8[3] = NPC.downedSlimeKing; - bitsByte8[4] = NPC.downedQueenBee; - bitsByte8[5] = NPC.downedFishron; - bitsByte8[6] = NPC.downedMartians; - bitsByte8[7] = NPC.downedAncientCultist; + bitsByte8[0] = NPC.downedMoonlord; + bitsByte8[1] = NPC.downedHalloweenKing; + bitsByte8[2] = NPC.downedHalloweenTree; + bitsByte8[3] = NPC.downedChristmasIceQueen; + bitsByte8[4] = NPC.downedChristmasSantank; + bitsByte8[5] = NPC.downedChristmasTree; + bitsByte8[6] = NPC.downedGolemBoss; + bitsByte8[7] = BirthdayParty.PartyIsUp; writer.Write((byte) bitsByte8); BitsByte bitsByte9 = (BitsByte) (byte) 0; - bitsByte9[0] = NPC.downedMoonlord; - bitsByte9[1] = NPC.downedHalloweenKing; - bitsByte9[2] = NPC.downedHalloweenTree; - bitsByte9[3] = NPC.downedChristmasIceQueen; - bitsByte9[4] = NPC.downedChristmasSantank; - bitsByte9[5] = NPC.downedChristmasTree; - bitsByte9[6] = NPC.downedGolemBoss; - bitsByte9[7] = BirthdayParty.PartyIsUp; + bitsByte9[0] = NPC.downedPirates; + bitsByte9[1] = NPC.downedFrost; + bitsByte9[2] = NPC.downedGoblins; + bitsByte9[3] = Sandstorm.Happening; + bitsByte9[4] = DD2Event.Ongoing; + bitsByte9[5] = DD2Event.DownedInvasionT1; + bitsByte9[6] = DD2Event.DownedInvasionT2; + bitsByte9[7] = DD2Event.DownedInvasionT3; writer.Write((byte) bitsByte9); - BitsByte bitsByte10 = (BitsByte) (byte) 0; - bitsByte10[0] = NPC.downedPirates; - bitsByte10[1] = NPC.downedFrost; - bitsByte10[2] = NPC.downedGoblins; - bitsByte10[3] = Sandstorm.Happening; - bitsByte10[4] = DD2Event.Ongoing; - bitsByte10[5] = DD2Event.DownedInvasionT1; - bitsByte10[6] = DD2Event.DownedInvasionT2; - bitsByte10[7] = DD2Event.DownedInvasionT3; - writer.Write((byte) bitsByte10); - BitsByte bitsByte11 = (BitsByte) (byte) 0; - bitsByte11[0] = NPC.combatBookWasUsed; - bitsByte11[1] = LanternNight.LanternsUp; - bitsByte11[2] = NPC.downedTowerSolar; - bitsByte11[3] = NPC.downedTowerVortex; - bitsByte11[4] = NPC.downedTowerNebula; - bitsByte11[5] = NPC.downedTowerStardust; - bitsByte11[6] = Main.forceHalloweenForToday; - bitsByte11[7] = Main.forceXMasForToday; - writer.Write((byte) bitsByte11); - BitsByte bitsByte12 = (BitsByte) (byte) 0; - bitsByte12[0] = NPC.boughtCat; - bitsByte12[1] = NPC.boughtDog; - bitsByte12[2] = NPC.boughtBunny; - bitsByte12[3] = NPC.freeCake; - bitsByte12[4] = Main.drunkWorld; - bitsByte12[5] = NPC.downedEmpressOfLight; - bitsByte12[6] = NPC.downedQueenSlime; - bitsByte12[7] = Main.getGoodWorld; - writer.Write((byte) bitsByte12); - writer.Write((short) WorldGen.SavedOreTiers.Copper); - writer.Write((short) WorldGen.SavedOreTiers.Iron); - writer.Write((short) WorldGen.SavedOreTiers.Silver); - writer.Write((short) WorldGen.SavedOreTiers.Gold); - writer.Write((short) WorldGen.SavedOreTiers.Cobalt); - writer.Write((short) WorldGen.SavedOreTiers.Mythril); - writer.Write((short) WorldGen.SavedOreTiers.Adamantite); writer.Write((sbyte) Main.invasionType); if (SocialAPI.Network != null) writer.Write(SocialAPI.Network.GetLobbyId()); @@ -292,8 +246,6 @@ namespace Terraria case 9: writer.Write(number); text.Serialize(writer); - BitsByte bitsByte13 = (BitsByte) (byte) number2; - writer.Write((byte) bitsByte13); break; case 10: int num2 = NetMessage.CompressTileBlock(number, (int) number2, (short) number3, (short) number4, NetMessage.buffer[whoAmi].writeBuffer, (int) writer.BaseStream.Position); @@ -306,55 +258,35 @@ namespace Terraria writer.Write((short) number4); break; case 12: - Player player3 = Main.player[number]; writer.Write((byte) number); - writer.Write((short) player3.SpawnX); - writer.Write((short) player3.SpawnY); - writer.Write(player3.respawnTimer); - writer.Write((byte) number2); + writer.Write((short) Main.player[number].SpawnX); + writer.Write((short) Main.player[number].SpawnY); break; case 13: - Player player4 = Main.player[number]; + Player player3 = Main.player[number]; writer.Write((byte) number); - BitsByte bitsByte14 = (BitsByte) (byte) 0; - bitsByte14[0] = player4.controlUp; - bitsByte14[1] = player4.controlDown; - bitsByte14[2] = player4.controlLeft; - bitsByte14[3] = player4.controlRight; - bitsByte14[4] = player4.controlJump; - bitsByte14[5] = player4.controlUseItem; - bitsByte14[6] = player4.direction == 1; - writer.Write((byte) bitsByte14); - BitsByte bitsByte15 = (BitsByte) (byte) 0; - bitsByte15[0] = player4.pulley; - bitsByte15[1] = player4.pulley && player4.pulleyDir == (byte) 2; - bitsByte15[2] = player4.velocity != Vector2.Zero; - bitsByte15[3] = player4.vortexStealthActive; - bitsByte15[4] = (double) player4.gravDir == 1.0; - bitsByte15[5] = player4.shieldRaised; - bitsByte15[6] = player4.ghost; - writer.Write((byte) bitsByte15); - BitsByte bitsByte16 = (BitsByte) (byte) 0; - bitsByte16[0] = player4.tryKeepingHoveringUp; - bitsByte16[1] = player4.IsVoidVaultEnabled; - bitsByte16[2] = player4.sitting.isSitting; - bitsByte16[3] = player4.downedDD2EventAnyDifficulty; - bitsByte16[4] = player4.isPettingAnimal; - bitsByte16[5] = player4.isTheAnimalBeingPetSmall; - bitsByte16[6] = player4.PotionOfReturnOriginalUsePosition.HasValue; - bitsByte16[7] = player4.tryKeepingHoveringDown; - writer.Write((byte) bitsByte16); - BitsByte bitsByte17 = (BitsByte) (byte) 0; - bitsByte17[0] = player4.sleeping.isSleeping; - writer.Write((byte) bitsByte17); - writer.Write((byte) player4.selectedItem); - writer.WriteVector2(player4.position); - if (bitsByte15[2]) - writer.WriteVector2(player4.velocity); - if (bitsByte16[6]) + BitsByte bitsByte10 = (BitsByte) (byte) 0; + bitsByte10[0] = player3.controlUp; + bitsByte10[1] = player3.controlDown; + bitsByte10[2] = player3.controlLeft; + bitsByte10[3] = player3.controlRight; + bitsByte10[4] = player3.controlJump; + bitsByte10[5] = player3.controlUseItem; + bitsByte10[6] = player3.direction == 1; + writer.Write((byte) bitsByte10); + BitsByte bitsByte11 = (BitsByte) (byte) 0; + bitsByte11[0] = player3.pulley; + bitsByte11[1] = player3.pulley && player3.pulleyDir == (byte) 2; + bitsByte11[2] = player3.velocity != Vector2.Zero; + bitsByte11[3] = player3.vortexStealthActive; + bitsByte11[4] = (double) player3.gravDir == 1.0; + bitsByte11[5] = player3.shieldRaised; + writer.Write((byte) bitsByte11); + writer.Write((byte) player3.selectedItem); + writer.WriteVector2(player3.position); + if (bitsByte11[2]) { - writer.WriteVector2(player4.PotionOfReturnOriginalUsePosition.Value); - writer.WriteVector2(player4.PotionOfReturnHomePosition.Value); + writer.WriteVector2(player3.velocity); break; } break; @@ -415,34 +347,34 @@ namespace Terraria { for (int index2 = num5; index2 < num5 + num3; ++index2) { - BitsByte bitsByte18 = (BitsByte) (byte) 0; - BitsByte bitsByte19 = (BitsByte) (byte) 0; + BitsByte bitsByte12 = (BitsByte) (byte) 0; + BitsByte bitsByte13 = (BitsByte) (byte) 0; byte num6 = 0; byte num7 = 0; Tile tile = Main.tile[index1, index2]; - bitsByte18[0] = tile.active(); - bitsByte18[2] = tile.wall > (ushort) 0; - bitsByte18[3] = tile.liquid > (byte) 0 && Main.netMode == 2; - bitsByte18[4] = tile.wire(); - bitsByte18[5] = tile.halfBrick(); - bitsByte18[6] = tile.actuator(); - bitsByte18[7] = tile.inActive(); - bitsByte19[0] = tile.wire2(); - bitsByte19[1] = tile.wire3(); + bitsByte12[0] = tile.active(); + bitsByte12[2] = tile.wall > (byte) 0; + bitsByte12[3] = tile.liquid > (byte) 0 && Main.netMode == 2; + bitsByte12[4] = tile.wire(); + bitsByte12[5] = tile.halfBrick(); + bitsByte12[6] = tile.actuator(); + bitsByte12[7] = tile.inActive(); + bitsByte13[0] = tile.wire2(); + bitsByte13[1] = tile.wire3(); if (tile.active() && tile.color() > (byte) 0) { - bitsByte19[2] = true; + bitsByte13[2] = true; num6 = tile.color(); } - if (tile.wall > (ushort) 0 && tile.wallColor() > (byte) 0) + if (tile.wall > (byte) 0 && tile.wallColor() > (byte) 0) { - bitsByte19[3] = true; + bitsByte13[3] = true; num7 = tile.wallColor(); } - bitsByte19 = (BitsByte) (byte) ((uint) (byte) bitsByte19 + (uint) (byte) ((uint) tile.slope() << 4)); - bitsByte19[7] = tile.wire4(); - writer.Write((byte) bitsByte18); - writer.Write((byte) bitsByte19); + bitsByte13 = (BitsByte) (byte) ((uint) (byte) bitsByte13 + (uint) (byte) ((uint) tile.slope() << 4)); + bitsByte13[7] = tile.wire4(); + writer.Write((byte) bitsByte12); + writer.Write((byte) bitsByte13); if (num6 > (byte) 0) writer.Write(num6); if (num7 > (byte) 0) @@ -456,7 +388,7 @@ namespace Terraria writer.Write(tile.frameY); } } - if (tile.wall > (ushort) 0) + if (tile.wall > (byte) 0) writer.Write(tile.wall); if (tile.liquid > (byte) 0 && Main.netMode == 2) { @@ -482,7 +414,7 @@ namespace Terraria break; case 22: writer.Write((short) number); - writer.Write((byte) Main.item[number].playerIndexTheItemIsReservedFor); + writer.Write((byte) Main.item[number].owner); break; case 23: NPC npc1 = Main.npc[number]; @@ -497,40 +429,27 @@ namespace Terraria npc1.netSkip = 0; short netId2 = (short) npc1.netID; bool[] flagArray = new bool[4]; - BitsByte bitsByte20 = (BitsByte) (byte) 0; - bitsByte20[0] = npc1.direction > 0; - bitsByte20[1] = npc1.directionY > 0; - bitsByte20[2] = flagArray[0] = (double) npc1.ai[0] != 0.0; - bitsByte20[3] = flagArray[1] = (double) npc1.ai[1] != 0.0; - bitsByte20[4] = flagArray[2] = (double) npc1.ai[2] != 0.0; - bitsByte20[5] = flagArray[3] = (double) npc1.ai[3] != 0.0; - bitsByte20[6] = npc1.spriteDirection > 0; - bitsByte20[7] = num9 == npc1.lifeMax; - writer.Write((byte) bitsByte20); - BitsByte bitsByte21 = (BitsByte) (byte) 0; - bitsByte21[0] = npc1.statsAreScaledForThisManyPlayers > 1; - bitsByte21[1] = npc1.SpawnedFromStatue; - bitsByte21[2] = (double) npc1.strengthMultiplier != 1.0; - writer.Write((byte) bitsByte21); + BitsByte bitsByte14 = (BitsByte) (byte) 0; + bitsByte14[0] = npc1.direction > 0; + bitsByte14[1] = npc1.directionY > 0; + bitsByte14[2] = flagArray[0] = (double) npc1.ai[0] != 0.0; + bitsByte14[3] = flagArray[1] = (double) npc1.ai[1] != 0.0; + bitsByte14[4] = flagArray[2] = (double) npc1.ai[2] != 0.0; + bitsByte14[5] = flagArray[3] = (double) npc1.ai[3] != 0.0; + bitsByte14[6] = npc1.spriteDirection > 0; + bitsByte14[7] = num9 == npc1.lifeMax; + writer.Write((byte) bitsByte14); for (int index = 0; index < NPC.maxAI; ++index) { if (flagArray[index]) writer.Write(npc1.ai[index]); } writer.Write(netId2); - if (bitsByte21[0]) - writer.Write((byte) npc1.statsAreScaledForThisManyPlayers); - if (bitsByte21[2]) - writer.Write(npc1.strengthMultiplier); - if (!bitsByte20[7]) + if (!bitsByte14[7]) { - byte num10 = 1; - if (npc1.lifeMax > (int) short.MaxValue) - num10 = (byte) 4; - else if (npc1.lifeMax > (int) sbyte.MaxValue) - num10 = (byte) 2; - writer.Write(num10); - switch (num10) + byte npcLifeByte = Main.npcLifeBytes[npc1.netID]; + writer.Write(npcLifeByte); + switch (npcLifeByte) { case 2: writer.Write((short) num9); @@ -543,7 +462,7 @@ namespace Terraria break; } } - if (npc1.type >= 0 && npc1.type < 663 && Main.npcCatchable[npc1.type]) + if (npc1.type >= 0 && npc1.type < 580 && Main.npcCatchable[npc1.type]) { writer.Write((byte) npc1.releaseOwner); break; @@ -558,35 +477,25 @@ namespace Terraria writer.Write((short) projectile1.identity); writer.WriteVector2(projectile1.position); writer.WriteVector2(projectile1.velocity); + writer.Write(projectile1.knockBack); + writer.Write((short) projectile1.damage); writer.Write((byte) projectile1.owner); writer.Write((short) projectile1.type); - BitsByte bitsByte22 = (BitsByte) (byte) 0; + BitsByte bitsByte15 = (BitsByte) (byte) 0; for (int key = 0; key < Projectile.maxAI; ++key) { if ((double) projectile1.ai[key] != 0.0) - bitsByte22[key] = true; + bitsByte15[key] = true; } - if (projectile1.damage != 0) - bitsByte22[4] = true; - if ((double) projectile1.knockBack != 0.0) - bitsByte22[5] = true; - if (projectile1.type > 0 && projectile1.type < 950 && ProjectileID.Sets.NeedsUUID[projectile1.type]) - bitsByte22[7] = true; - if (projectile1.originalDamage != 0) - bitsByte22[6] = true; - writer.Write((byte) bitsByte22); + if (projectile1.type > 0 && projectile1.type < 714 && ProjectileID.Sets.NeedsUUID[projectile1.type]) + bitsByte15[Projectile.maxAI] = true; + writer.Write((byte) bitsByte15); for (int key = 0; key < Projectile.maxAI; ++key) { - if (bitsByte22[key]) + if (bitsByte15[key]) writer.Write(projectile1.ai[key]); } - if (bitsByte22[4]) - writer.Write((short) projectile1.damage); - if (bitsByte22[5]) - writer.Write(projectile1.knockBack); - if (bitsByte22[6]) - writer.Write((short) projectile1.originalDamage); - if (bitsByte22[7]) + if (bitsByte15[Projectile.maxAI]) { writer.Write((short) projectile1.projUUID); break; @@ -615,36 +524,36 @@ namespace Terraria Item obj3 = Main.chest[number].item[(int) (byte) number2]; writer.Write((short) number); writer.Write((byte) number2); - short num11 = (short) obj3.netID; + short num10 = (short) obj3.netID; if (obj3.Name == null) - num11 = (short) 0; + num10 = (short) 0; writer.Write((short) obj3.stack); writer.Write(obj3.prefix); - writer.Write(num11); + writer.Write(num10); break; case 33: + int num11 = 0; int num12 = 0; int num13 = 0; - int num14 = 0; string str1 = (string) null; if (number > -1) { - num12 = Main.chest[number].x; - num13 = Main.chest[number].y; + num11 = Main.chest[number].x; + num12 = Main.chest[number].y; } if ((double) number2 == 1.0) { string str2 = text.ToString(); - num14 = (int) (byte) str2.Length; - if (num14 == 0 || num14 > 20) - num14 = (int) byte.MaxValue; + num13 = (int) (byte) str2.Length; + if (num13 == 0 || num13 > 20) + num13 = (int) byte.MaxValue; else str1 = str2; } writer.Write((short) number); + writer.Write((short) num11); writer.Write((short) num12); - writer.Write((short) num13); - writer.Write((byte) num14); + writer.Write((byte) num13); if (str1 != null) { writer.Write(str1); @@ -666,16 +575,17 @@ namespace Terraria writer.Write((short) 0); break; case 35: + case 66: writer.Write((byte) number); writer.Write((short) number2); break; case 36: - Player player5 = Main.player[number]; + Player player4 = Main.player[number]; writer.Write((byte) number); - writer.Write((byte) player5.zone1); - writer.Write((byte) player5.zone2); - writer.Write((byte) player5.zone3); - writer.Write((byte) player5.zone4); + writer.Write((byte) player4.zone1); + writer.Write((byte) player4.zone2); + writer.Write((byte) player4.zone3); + writer.Write((byte) player4.zone4); break; case 38: writer.Write(Netplay.ServerPassword); @@ -715,7 +625,6 @@ namespace Terraria writer.Write((short) Main.sign[number].y); writer.Write(Main.sign[number].text); writer.Write((byte) number2); - writer.Write((byte) number3); break; case 48: Tile tile1 = Main.tile[number, (int) number2]; @@ -727,7 +636,7 @@ namespace Terraria case 50: writer.Write((byte) number); for (int index = 0; index < 22; ++index) - writer.Write((ushort) Main.player[number].buffType[index]); + writer.Write((byte) Main.player[number].buffType[index]); break; case 51: writer.Write((byte) number); @@ -740,20 +649,20 @@ namespace Terraria break; case 53: writer.Write((short) number); - writer.Write((ushort) number2); + writer.Write((byte) number2); writer.Write((short) number3); break; case 54: writer.Write((short) number); for (int index = 0; index < 5; ++index) { - writer.Write((ushort) Main.npc[number].buffType[index]); + writer.Write((byte) Main.npc[number].buffType[index]); writer.Write((short) Main.npc[number].buffTime[index]); } break; case 55: writer.Write((byte) number); - writer.Write((ushort) number2); + writer.Write((byte) number2); writer.Write((int) number3); break; case 56: @@ -762,7 +671,6 @@ namespace Terraria { string givenName = Main.npc[number].GivenName; writer.Write(givenName); - writer.Write(Main.npc[number].townNpcVariationIndex); break; } break; @@ -800,25 +708,15 @@ namespace Terraria writer.Write((byte) number3); break; case 65: - BitsByte bitsByte23 = (BitsByte) (byte) 0; - bitsByte23[0] = (number & 1) == 1; - bitsByte23[1] = (number & 2) == 2; - bitsByte23[2] = number6 == 1; - bitsByte23[3] = (uint) number7 > 0U; - writer.Write((byte) bitsByte23); + BitsByte bitsByte16 = (BitsByte) (byte) 0; + bitsByte16[0] = (number & 1) == 1; + bitsByte16[1] = (number & 2) == 2; + bitsByte16[2] = (number5 & 1) == 1; + bitsByte16[3] = (number5 & 2) == 2; + writer.Write((byte) bitsByte16); writer.Write((short) number2); writer.Write(number3); writer.Write(number4); - writer.Write((byte) number5); - if (bitsByte23[3]) - { - writer.Write(number7); - break; - } - break; - case 66: - writer.Write((byte) number); - writer.Write((short) number2); break; case 68: writer.Write(Main.clientUUID); @@ -845,9 +743,6 @@ namespace Terraria for (int index = 0; index < 40; ++index) writer.Write((short) Main.travelShop[index]); break; - case 73: - writer.Write((byte) number); - break; case 74: writer.Write((byte) Main.anglerQuest); bool flag1 = Main.anglerWhoFinishedToday.Contains(text.ToString()); @@ -856,7 +751,6 @@ namespace Terraria case 76: writer.Write((byte) number); writer.Write(Main.player[number].anglerQuestsFinished); - writer.Write(Main.player[number].golferScoreAccumulated); break; case 77: if (Main.netMode != 2) @@ -896,21 +790,21 @@ namespace Terraria break; case 83: int index3 = number; - if (index3 < 0 && index3 >= 289) + if (index3 < 0 && index3 >= 267) index3 = 1; - int num15 = NPC.killCount[index3]; + int num14 = NPC.killCount[index3]; writer.Write((short) index3); - writer.Write(num15); + writer.Write(num14); break; case 84: - byte num16 = (byte) number; - float stealth = Main.player[(int) num16].stealth; - writer.Write(num16); + byte num15 = (byte) number; + float stealth = Main.player[(int) num15].stealth; + writer.Write(num15); writer.Write(stealth); break; case 85: - byte num17 = (byte) number; - writer.Write(num17); + byte num16 = (byte) number; + writer.Write(num16); break; case 86: writer.Write(number); @@ -928,39 +822,39 @@ namespace Terraria writer.Write((byte) number3); break; case 88: - BitsByte bitsByte24 = (BitsByte) (byte) number2; - BitsByte bitsByte25 = (BitsByte) (byte) number3; + BitsByte bitsByte17 = (BitsByte) (byte) number2; + BitsByte bitsByte18 = (BitsByte) (byte) number3; writer.Write((short) number); - writer.Write((byte) bitsByte24); + writer.Write((byte) bitsByte17); Item obj4 = Main.item[number]; - if (bitsByte24[0]) + if (bitsByte17[0]) writer.Write(obj4.color.PackedValue); - if (bitsByte24[1]) + if (bitsByte17[1]) writer.Write((ushort) obj4.damage); - if (bitsByte24[2]) + if (bitsByte17[2]) writer.Write(obj4.knockBack); - if (bitsByte24[3]) + if (bitsByte17[3]) writer.Write((ushort) obj4.useAnimation); - if (bitsByte24[4]) + if (bitsByte17[4]) writer.Write((ushort) obj4.useTime); - if (bitsByte24[5]) + if (bitsByte17[5]) writer.Write((short) obj4.shoot); - if (bitsByte24[6]) + if (bitsByte17[6]) writer.Write(obj4.shootSpeed); - if (bitsByte24[7]) + if (bitsByte17[7]) { - writer.Write((byte) bitsByte25); - if (bitsByte25[0]) + writer.Write((byte) bitsByte18); + if (bitsByte18[0]) writer.Write((ushort) obj4.width); - if (bitsByte25[1]) + if (bitsByte18[1]) writer.Write((ushort) obj4.height); - if (bitsByte25[2]) + if (bitsByte18[2]) writer.Write(obj4.scale); - if (bitsByte25[3]) + if (bitsByte18[3]) writer.Write((short) obj4.ammo); - if (bitsByte25[4]) + if (bitsByte18[4]) writer.Write((short) obj4.useAmmo); - if (bitsByte25[5]) + if (bitsByte18[5]) { writer.Write(obj4.notAmmo); break; @@ -974,7 +868,7 @@ namespace Terraria Item obj5 = Main.player[(int) number4].inventory[(int) number3]; writer.Write((short) obj5.netID); writer.Write(obj5.prefix); - writer.Write((short) number5); + writer.Write((short) obj5.stack); break; case 91: writer.Write(number); @@ -982,7 +876,7 @@ namespace Terraria if ((double) number2 != (double) byte.MaxValue) { writer.Write((ushort) number3); - writer.Write((ushort) number4); + writer.Write((byte) number4); writer.Write((byte) number5); if (number5 < 0) { @@ -994,21 +888,20 @@ namespace Terraria break; case 92: writer.Write((short) number); - writer.Write((int) number2); + writer.Write(number2); writer.Write(number3); writer.Write(number4); break; case 95: writer.Write((ushort) number); - writer.Write((byte) number2); break; case 96: writer.Write((byte) number); - Player player6 = Main.player[number]; + Player player5 = Main.player[number]; writer.Write((short) number4); writer.Write(number2); writer.Write(number3); - writer.WriteVector2(player6.velocity); + writer.WriteVector2(player5.velocity); break; case 97: writer.Write((short) number); @@ -1036,7 +929,7 @@ namespace Terraria break; case 102: writer.Write((byte) number); - writer.Write((ushort) number2); + writer.Write((byte) number2); writer.Write(number3); writer.Write(number4); break; @@ -1090,8 +983,8 @@ namespace Terraria break; case 112: writer.Write((byte) number); - writer.Write((int) number2); - writer.Write((int) number3); + writer.Write((short) number2); + writer.Write((short) number3); writer.Write((byte) number4); writer.Write((short) number5); break; @@ -1130,126 +1023,6 @@ namespace Terraria }); text.Serialize(writer); break; - case 120: - writer.Write((byte) number); - writer.Write((byte) number2); - break; - case 121: - int num18 = (int) number3; - bool dye1 = (double) number4 == 1.0; - if (dye1) - num18 += 8; - writer.Write((byte) number); - writer.Write((int) number2); - writer.Write((byte) num18); - if (TileEntity.ByID[(int) number2] is TEDisplayDoll teDisplayDoll3) - { - teDisplayDoll3.WriteItem((int) number3, writer, dye1); - break; - } - writer.Write(0); - writer.Write((byte) 0); - break; - case 122: - writer.Write(number); - writer.Write((byte) number2); - break; - case 123: - writer.Write((short) number); - writer.Write((short) number2); - Item obj6 = Main.player[(int) number4].inventory[(int) number3]; - writer.Write((short) obj6.netID); - writer.Write(obj6.prefix); - writer.Write((short) number5); - break; - case 124: - int num19 = (int) number3; - bool dye2 = (double) number4 == 1.0; - if (dye2) - num19 += 2; - writer.Write((byte) number); - writer.Write((int) number2); - writer.Write((byte) num19); - if (TileEntity.ByID[(int) number2] is TEHatRack teHatRack3) - { - teHatRack3.WriteItem((int) number3, writer, dye2); - break; - } - writer.Write(0); - writer.Write((byte) 0); - break; - case 125: - writer.Write((byte) number); - writer.Write((short) number2); - writer.Write((short) number3); - writer.Write((byte) number4); - break; - case 126: - NetMessage._currentRevengeMarker.WriteSelfTo(writer); - break; - case (int) sbyte.MaxValue: - writer.Write(number); - break; - case 128: - writer.Write((byte) number); - writer.Write((ushort) number5); - writer.Write((ushort) number6); - writer.Write((ushort) number2); - writer.Write((ushort) number3); - break; - case 130: - writer.Write((ushort) number); - writer.Write((ushort) number2); - writer.Write((short) number3); - break; - case 131: - writer.Write((ushort) number); - writer.Write((byte) number2); - if ((byte) number2 == (byte) 1) - { - writer.Write((int) number3); - writer.Write((short) number4); - break; - } - break; - case 132: - NetMessage._currentNetSoundInfo.WriteSelfTo(writer); - break; - case 133: - writer.Write((short) number); - writer.Write((short) number2); - Item obj7 = Main.player[(int) number4].inventory[(int) number3]; - writer.Write((short) obj7.netID); - writer.Write(obj7.prefix); - writer.Write((short) number5); - break; - case 134: - writer.Write((byte) number); - Player player7 = Main.player[number]; - writer.Write(player7.ladyBugLuckTimeLeft); - writer.Write(player7.torchLuck); - writer.Write(player7.luckPotion); - writer.Write(player7.HasGardenGnomeNearby); - break; - case 135: - writer.Write((byte) number); - break; - case 136: - for (int index4 = 0; index4 < 2; ++index4) - { - for (int index5 = 0; index5 < 3; ++index5) - writer.Write((ushort) NPC.cavernMonsterType[index4, index5]); - } - break; - case 137: - writer.Write((short) number); - writer.Write((ushort) number2); - break; - case 139: - writer.Write((byte) number); - bool flag3 = (double) number2 == 1.0; - writer.Write(flag3); - break; } int position2 = (int) writer.BaseStream.Position; writer.BaseStream.Position = position1; @@ -1262,7 +1035,10 @@ namespace Terraria try { ++NetMessage.buffer[whoAmi].spamCount; - Main.ActiveNetDiagnosticsUI.CountSentMessage(msgType, position2); + ++Main.txMsg; + Main.txData += position2; + ++Main.txMsgType[msgType]; + Main.txDataType[msgType] += position2; Netplay.Connection.Socket.AsyncSend(NetMessage.buffer[whoAmi].writeBuffer, 0, position2, new SocketSendCallback(Netplay.Connection.ClientWriteCallBack)); } catch @@ -1275,17 +1051,20 @@ namespace Terraria switch (msgType) { case 13: - for (int index6 = 0; index6 < 256; ++index6) + for (int index4 = 0; index4 < 256; ++index4) { - if (index6 != ignoreClient && NetMessage.buffer[index6].broadcast) + if (index4 != ignoreClient && NetMessage.buffer[index4].broadcast) { - if (Netplay.Clients[index6].IsConnected()) + if (Netplay.Clients[index4].IsConnected()) { try { - ++NetMessage.buffer[index6].spamCount; - Main.ActiveNetDiagnosticsUI.CountSentMessage(msgType, position2); - Netplay.Clients[index6].Socket.AsyncSend(NetMessage.buffer[whoAmi].writeBuffer, 0, position2, new SocketSendCallback(Netplay.Clients[index6].ServerWriteCallBack)); + ++NetMessage.buffer[index4].spamCount; + ++Main.txMsg; + Main.txData += position2; + ++Main.txMsgType[msgType]; + Main.txDataType[msgType] += position2; + Netplay.Clients[index4].Socket.AsyncSend(NetMessage.buffer[whoAmi].writeBuffer, 0, position2, new SocketSendCallback(Netplay.Clients[index4].ServerWriteCallBack)); } catch { @@ -1301,17 +1080,20 @@ namespace Terraria } break; case 20: - for (int index7 = 0; index7 < 256; ++index7) + for (int index5 = 0; index5 < 256; ++index5) { - if (index7 != ignoreClient && NetMessage.buffer[index7].broadcast && Netplay.Clients[index7].IsConnected()) + if (index5 != ignoreClient && NetMessage.buffer[index5].broadcast && Netplay.Clients[index5].IsConnected()) { - if (Netplay.Clients[index7].SectionRange(number, (int) number2, (int) number3)) + if (Netplay.Clients[index5].SectionRange(number, (int) number2, (int) number3)) { try { - ++NetMessage.buffer[index7].spamCount; - Main.ActiveNetDiagnosticsUI.CountSentMessage(msgType, position2); - Netplay.Clients[index7].Socket.AsyncSend(NetMessage.buffer[whoAmi].writeBuffer, 0, position2, new SocketSendCallback(Netplay.Clients[index7].ServerWriteCallBack)); + ++NetMessage.buffer[index5].spamCount; + ++Main.txMsg; + Main.txData += position2; + ++Main.txMsgType[msgType]; + Main.txDataType[msgType] += position2; + Netplay.Clients[index5].Socket.AsyncSend(NetMessage.buffer[whoAmi].writeBuffer, 0, position2, new SocketSendCallback(Netplay.Clients[index5].ServerWriteCallBack)); } catch { @@ -1322,33 +1104,36 @@ namespace Terraria break; case 23: NPC npc3 = Main.npc[number]; - for (int index8 = 0; index8 < 256; ++index8) + for (int index6 = 0; index6 < 256; ++index6) { - if (index8 != ignoreClient && NetMessage.buffer[index8].broadcast && Netplay.Clients[index8].IsConnected()) + if (index6 != ignoreClient && NetMessage.buffer[index6].broadcast && Netplay.Clients[index6].IsConnected()) { - bool flag4 = false; + bool flag3 = false; if (npc3.boss || npc3.netAlways || npc3.townNPC || !npc3.active) - flag4 = true; + flag3 = true; else if (npc3.netSkip <= 0) { - Rectangle rect1 = Main.player[index8].getRect(); + Rectangle rect1 = Main.player[index6].getRect(); Rectangle rect2 = npc3.getRect(); rect2.X -= 2500; rect2.Y -= 2500; rect2.Width += 5000; rect2.Height += 5000; if (rect1.Intersects(rect2)) - flag4 = true; + flag3 = true; } else - flag4 = true; - if (flag4) + flag3 = true; + if (flag3) { try { - ++NetMessage.buffer[index8].spamCount; - Main.ActiveNetDiagnosticsUI.CountSentMessage(msgType, position2); - Netplay.Clients[index8].Socket.AsyncSend(NetMessage.buffer[whoAmi].writeBuffer, 0, position2, new SocketSendCallback(Netplay.Clients[index8].ServerWriteCallBack)); + ++NetMessage.buffer[index6].spamCount; + ++Main.txMsg; + Main.txData += position2; + ++Main.txMsgType[msgType]; + Main.txDataType[msgType] += position2; + Netplay.Clients[index6].Socket.AsyncSend(NetMessage.buffer[whoAmi].writeBuffer, 0, position2, new SocketSendCallback(Netplay.Clients[index6].ServerWriteCallBack)); } catch { @@ -1365,33 +1150,36 @@ namespace Terraria break; case 27: Projectile projectile2 = Main.projectile[number]; - for (int index9 = 0; index9 < 256; ++index9) + for (int index7 = 0; index7 < 256; ++index7) { - if (index9 != ignoreClient && NetMessage.buffer[index9].broadcast && Netplay.Clients[index9].IsConnected()) + if (index7 != ignoreClient && NetMessage.buffer[index7].broadcast && Netplay.Clients[index7].IsConnected()) { - bool flag5 = false; + bool flag4 = false; if (projectile2.type == 12 || Main.projPet[projectile2.type] || projectile2.aiStyle == 11 || projectile2.netImportant) { - flag5 = true; + flag4 = true; } else { - Rectangle rect3 = Main.player[index9].getRect(); + Rectangle rect3 = Main.player[index7].getRect(); Rectangle rect4 = projectile2.getRect(); rect4.X -= 5000; rect4.Y -= 5000; rect4.Width += 10000; rect4.Height += 10000; if (rect3.Intersects(rect4)) - flag5 = true; + flag4 = true; } - if (flag5) + if (flag4) { try { - ++NetMessage.buffer[index9].spamCount; - Main.ActiveNetDiagnosticsUI.CountSentMessage(msgType, position2); - Netplay.Clients[index9].Socket.AsyncSend(NetMessage.buffer[whoAmi].writeBuffer, 0, position2, new SocketSendCallback(Netplay.Clients[index9].ServerWriteCallBack)); + ++NetMessage.buffer[index7].spamCount; + ++Main.txMsg; + Main.txData += position2; + ++Main.txMsgType[msgType]; + Main.txDataType[msgType] += position2; + Netplay.Clients[index7].Socket.AsyncSend(NetMessage.buffer[whoAmi].writeBuffer, 0, position2, new SocketSendCallback(Netplay.Clients[index7].ServerWriteCallBack)); } catch { @@ -1402,33 +1190,36 @@ namespace Terraria break; case 28: NPC npc4 = Main.npc[number]; - for (int index10 = 0; index10 < 256; ++index10) + for (int index8 = 0; index8 < 256; ++index8) { - if (index10 != ignoreClient && NetMessage.buffer[index10].broadcast && Netplay.Clients[index10].IsConnected()) + if (index8 != ignoreClient && NetMessage.buffer[index8].broadcast && Netplay.Clients[index8].IsConnected()) { - bool flag6 = false; + bool flag5 = false; if (npc4.life <= 0) { - flag6 = true; + flag5 = true; } else { - Rectangle rect5 = Main.player[index10].getRect(); + Rectangle rect5 = Main.player[index8].getRect(); Rectangle rect6 = npc4.getRect(); rect6.X -= 3000; rect6.Y -= 3000; rect6.Width += 6000; rect6.Height += 6000; if (rect5.Intersects(rect6)) - flag6 = true; + flag5 = true; } - if (flag6) + if (flag5) { try { - ++NetMessage.buffer[index10].spamCount; - Main.ActiveNetDiagnosticsUI.CountSentMessage(msgType, position2); - Netplay.Clients[index10].Socket.AsyncSend(NetMessage.buffer[whoAmi].writeBuffer, 0, position2, new SocketSendCallback(Netplay.Clients[index10].ServerWriteCallBack)); + ++NetMessage.buffer[index8].spamCount; + ++Main.txMsg; + Main.txData += position2; + ++Main.txMsgType[msgType]; + Main.txDataType[msgType] += position2; + Netplay.Clients[index8].Socket.AsyncSend(NetMessage.buffer[whoAmi].writeBuffer, 0, position2, new SocketSendCallback(Netplay.Clients[index8].ServerWriteCallBack)); } catch { @@ -1439,17 +1230,20 @@ namespace Terraria break; case 34: case 69: - for (int index11 = 0; index11 < 256; ++index11) + for (int index9 = 0; index9 < 256; ++index9) { - if (index11 != ignoreClient && NetMessage.buffer[index11].broadcast) + if (index9 != ignoreClient && NetMessage.buffer[index9].broadcast) { - if (Netplay.Clients[index11].IsConnected()) + if (Netplay.Clients[index9].IsConnected()) { try { - ++NetMessage.buffer[index11].spamCount; - Main.ActiveNetDiagnosticsUI.CountSentMessage(msgType, position2); - Netplay.Clients[index11].Socket.AsyncSend(NetMessage.buffer[whoAmi].writeBuffer, 0, position2, new SocketSendCallback(Netplay.Clients[index11].ServerWriteCallBack)); + ++NetMessage.buffer[index9].spamCount; + ++Main.txMsg; + Main.txData += position2; + ++Main.txMsgType[msgType]; + Main.txDataType[msgType] += position2; + Netplay.Clients[index9].Socket.AsyncSend(NetMessage.buffer[whoAmi].writeBuffer, 0, position2, new SocketSendCallback(Netplay.Clients[index9].ServerWriteCallBack)); } catch { @@ -1459,17 +1253,20 @@ namespace Terraria } break; default: - for (int index12 = 0; index12 < 256; ++index12) + for (int index10 = 0; index10 < 256; ++index10) { - if (index12 != ignoreClient && (NetMessage.buffer[index12].broadcast || Netplay.Clients[index12].State >= 3 && msgType == 10)) + if (index10 != ignoreClient && (NetMessage.buffer[index10].broadcast || Netplay.Clients[index10].State >= 3 && msgType == 10)) { - if (Netplay.Clients[index12].IsConnected()) + if (Netplay.Clients[index10].IsConnected()) { try { - ++NetMessage.buffer[index12].spamCount; - Main.ActiveNetDiagnosticsUI.CountSentMessage(msgType, position2); - Netplay.Clients[index12].Socket.AsyncSend(NetMessage.buffer[whoAmi].writeBuffer, 0, position2, new SocketSendCallback(Netplay.Clients[index12].ServerWriteCallBack)); + ++NetMessage.buffer[index10].spamCount; + ++Main.txMsg; + Main.txData += position2; + ++Main.txMsgType[msgType]; + Main.txDataType[msgType] += position2; + Netplay.Clients[index10].Socket.AsyncSend(NetMessage.buffer[whoAmi].writeBuffer, 0, position2, new SocketSendCallback(Netplay.Clients[index10].ServerWriteCallBack)); } catch { @@ -1485,7 +1282,10 @@ namespace Terraria try { ++NetMessage.buffer[remoteClient].spamCount; - Main.ActiveNetDiagnosticsUI.CountSentMessage(msgType, position2); + ++Main.txMsg; + Main.txData += position2; + ++Main.txMsgType[msgType]; + Main.txDataType[msgType] += position2; Netplay.Clients[remoteClient].Socket.AsyncSend(NetMessage.buffer[whoAmi].writeBuffer, 0, position2, new SocketSendCallback(Netplay.Clients[remoteClient].ServerWriteCallBack)); } catch @@ -1494,12 +1294,12 @@ namespace Terraria } if (Main.verboseNetplay) { - int num20 = 0; - while (num20 < position2) - ++num20; - for (int index13 = 0; index13 < position2; ++index13) + int num17 = 0; + while (num17 < position2) + ++num17; + for (int index11 = 0; index11 < position2; ++index11) { - int num21 = (int) NetMessage.buffer[whoAmi].writeBuffer[index13]; + int num18 = (int) NetMessage.buffer[whoAmi].writeBuffer[index11]; } } NetMessage.buffer[whoAmi].writeLocked = false; @@ -1508,7 +1308,6 @@ namespace Terraria if (msgType != 2 || Main.netMode != 2) return; Netplay.Clients[whoAmi].PendingTermination = true; - Netplay.Clients[whoAmi].PendingTerminationApproved = true; } } @@ -1565,7 +1364,7 @@ namespace Terraria int width, int height) { - short[] numArray1 = new short[8000]; + short[] numArray1 = new short[1000]; short[] numArray2 = new short[1000]; short[] numArray3 = new short[1000]; short num1 = 0; @@ -1575,7 +1374,7 @@ namespace Terraria int index1 = 0; int index2 = 0; byte num5 = 0; - byte[] buffer = new byte[15]; + byte[] buffer = new byte[13]; Tile compTile = (Tile) null; for (int index3 = yStart; index3 < yStart + height; ++index3) { @@ -1659,53 +1458,17 @@ namespace Terraria if (num11 != (short) -1) numArray2[(int) num2++] = num11; } - if (tile.type == (ushort) 573 && (int) tile.frameX % 36 == 0 && (int) tile.frameY % 36 == 0) - { - short num12 = (short) Sign.ReadSign(index4, index3); - if (num12 != (short) -1) - numArray2[(int) num2++] = num12; - } if (tile.type == (ushort) 378 && (int) tile.frameX % 36 == 0 && tile.frameY == (short) 0) { - int num13 = TETrainingDummy.Find(index4, index3); - if (num13 != -1) - numArray3[(int) num3++] = (short) num13; + int num12 = TETrainingDummy.Find(index4, index3); + if (num12 != -1) + numArray3[(int) num3++] = (short) num12; } if (tile.type == (ushort) 395 && (int) tile.frameX % 36 == 0 && tile.frameY == (short) 0) { - int num14 = TEItemFrame.Find(index4, index3); - if (num14 != -1) - numArray3[(int) num3++] = (short) num14; - } - if (tile.type == (ushort) 520 && (int) tile.frameX % 18 == 0 && tile.frameY == (short) 0) - { - int num15 = TEFoodPlatter.Find(index4, index3); - if (num15 != -1) - numArray3[(int) num3++] = (short) num15; - } - if (tile.type == (ushort) 471 && (int) tile.frameX % 54 == 0 && tile.frameY == (short) 0) - { - int num16 = TEWeaponsRack.Find(index4, index3); - if (num16 != -1) - numArray3[(int) num3++] = (short) num16; - } - if (tile.type == (ushort) 470 && (int) tile.frameX % 36 == 0 && tile.frameY == (short) 0) - { - int num17 = TEDisplayDoll.Find(index4, index3); - if (num17 != -1) - numArray3[(int) num3++] = (short) num17; - } - if (tile.type == (ushort) 475 && (int) tile.frameX % 54 == 0 && tile.frameY == (short) 0) - { - int num18 = TEHatRack.Find(index4, index3); - if (num18 != -1) - numArray3[(int) num3++] = (short) num18; - } - if (tile.type == (ushort) 597 && (int) tile.frameX % 54 == 0 && (int) tile.frameY % 72 == 0) - { - int num19 = TETeleportationPylon.Find(index4, index3); - if (num19 != -1) - numArray3[(int) num3++] = (short) num19; + int num13 = TEItemFrame.Find(index4, index3); + if (num13 != -1) + numArray3[(int) num3++] = (short) num13; } if (Main.tileFrameImportant[(int) tile.type]) { @@ -1725,10 +1488,10 @@ namespace Terraria ++index1; } } - if (tile.wall != (ushort) 0) + if (tile.wall != (byte) 0) { num5 |= (byte) 4; - buffer[index1] = (byte) tile.wall; + buffer[index1] = tile.wall; ++index1; if (tile.wallColor() != (byte) 0) { @@ -1754,31 +1517,25 @@ namespace Terraria num8 |= (byte) 4; if (tile.wire3()) num8 |= (byte) 8; - int num20 = !tile.halfBrick() ? (tile.slope() == (byte) 0 ? 0 : (int) tile.slope() + 1 << 4) : 16; - byte num21 = (byte) ((uint) num8 | (uint) (byte) num20); + int num14 = !tile.halfBrick() ? (tile.slope() == (byte) 0 ? 0 : (int) tile.slope() + 1 << 4) : 16; + byte num15 = (byte) ((uint) num8 | (uint) (byte) num14); if (tile.actuator()) num7 |= (byte) 2; if (tile.inActive()) num7 |= (byte) 4; if (tile.wire4()) num7 |= (byte) 32; - if (tile.wall > (ushort) byte.MaxValue) - { - buffer[index1] = (byte) ((uint) tile.wall >> 8); - ++index1; - num7 |= (byte) 64; - } index2 = 2; if (num7 != (byte) 0) { - num21 |= (byte) 1; + num15 |= (byte) 1; buffer[index2] = num7; --index2; } - if (num21 != (byte) 0) + if (num15 != (byte) 0) { num5 |= (byte) 1; - buffer[index2] = num21; + buffer[index2] = num15; --index2; } compTile = tile; @@ -1926,7 +1683,7 @@ namespace Terraria } if (((int) num4 & 4) == 4) { - tile.wall = (ushort) reader.ReadByte(); + tile.wall = reader.ReadByte(); if (((int) num2 & 16) == 16) tile.wallColor(reader.ReadByte()); } @@ -1967,11 +1724,6 @@ namespace Terraria tile.inActive(true); if (((int) num2 & 32) == 32) tile.wire4(true); - if (((int) num2 & 64) == 64) - { - byte num8 = reader.ReadByte(); - tile.wall = (ushort) ((uint) num8 << 8 | (uint) tile.wall); - } } switch ((byte) (((int) num4 & 192) >> 6)) { @@ -1988,40 +1740,40 @@ namespace Terraria } } } - short num9 = reader.ReadInt16(); - for (int index = 0; index < (int) num9; ++index) + short num8 = reader.ReadInt16(); + for (int index = 0; index < (int) num8; ++index) { + short num9 = reader.ReadInt16(); short num10 = reader.ReadInt16(); short num11 = reader.ReadInt16(); - short num12 = reader.ReadInt16(); string str = reader.ReadString(); - if (num10 >= (short) 0 && num10 < (short) 8000) + if (num9 >= (short) 0 && num9 < (short) 1000) { - if (Main.chest[(int) num10] == null) - Main.chest[(int) num10] = new Chest(); - Main.chest[(int) num10].name = str; - Main.chest[(int) num10].x = (int) num11; - Main.chest[(int) num10].y = (int) num12; + if (Main.chest[(int) num9] == null) + Main.chest[(int) num9] = new Chest(); + Main.chest[(int) num9].name = str; + Main.chest[(int) num9].x = (int) num10; + Main.chest[(int) num9].y = (int) num11; } } - short num13 = reader.ReadInt16(); - for (int index = 0; index < (int) num13; ++index) + short num12 = reader.ReadInt16(); + for (int index = 0; index < (int) num12; ++index) { + short num13 = reader.ReadInt16(); short num14 = reader.ReadInt16(); short num15 = reader.ReadInt16(); - short num16 = reader.ReadInt16(); string str = reader.ReadString(); - if (num14 >= (short) 0 && num14 < (short) 1000) + if (num13 >= (short) 0 && num13 < (short) 1000) { - if (Main.sign[(int) num14] == null) - Main.sign[(int) num14] = new Sign(); - Main.sign[(int) num14].text = str; - Main.sign[(int) num14].x = (int) num15; - Main.sign[(int) num14].y = (int) num16; + if (Main.sign[(int) num13] == null) + Main.sign[(int) num13] = new Sign(); + Main.sign[(int) num13].text = str; + Main.sign[(int) num13].x = (int) num14; + Main.sign[(int) num13].y = (int) num15; } } - short num17 = reader.ReadInt16(); - for (int index = 0; index < (int) num17; ++index) + short num16 = reader.ReadInt16(); + for (int index = 0; index < (int) num16; ++index) { TileEntity tileEntity = TileEntity.Read(reader); TileEntity.ByID[tileEntity.ID] = tileEntity; @@ -2045,7 +1797,7 @@ namespace Terraria { Main.menuMode = 15; Main.statusText = Language.GetTextValue("Error.BadHeaderBufferOverflow"); - Netplay.Disconnect = true; + Netplay.disconnect = true; } else Netplay.Clients[i].PendingTermination = true; @@ -2076,7 +1828,7 @@ namespace Terraria break; } } - catch (Exception ex) + catch { num = 0; startIndex = 0; @@ -2161,24 +1913,6 @@ namespace Terraria NetMessage.SendData(118, remoteClient, ignoreClient, number: playerTargetIndex, number2: ((float) damage), number3: ((float) direction), number4: ((float) (byte) bitsByte)); } - public static void PlayNetSound( - NetMessage.NetSoundInfo info, - int remoteClient = -1, - int ignoreClient = -1) - { - NetMessage._currentNetSoundInfo = info; - NetMessage.SendData(132, remoteClient, ignoreClient); - } - - public static void SendCoinLossRevengeMarker( - CoinLossRevengeSystem.RevengeMarker marker, - int remoteClient = -1, - int ignoreClient = -1) - { - NetMessage._currentRevengeMarker = marker; - NetMessage.SendData(126, remoteClient, ignoreClient); - } - public static void SendTileRange( int whoAmi, int tileX, @@ -2200,7 +1934,6 @@ namespace Terraria { int num = (size - 1) / 2; NetMessage.SendData(20, whoAmi, number: size, number2: ((float) (tileX - num)), number3: ((float) (tileY - num)), number5: ((int) changeType)); - WorldGen.RangeFrame(tileX - num, tileY - num, tileX - num + size, tileY - num + size); } public static void SendTravelShop(int remoteClient) @@ -2264,16 +1997,16 @@ namespace Terraria public static void greetPlayer(int plr) { if (Main.motd == "") - ChatHelper.SendChatMessageToClient(NetworkText.FromFormattable("{0} {1}!", (object) Lang.mp[18].ToNetworkText(), (object) Main.worldName), new Color((int) byte.MaxValue, 240, 20), plr); + NetMessage.SendChatMessageToClient(NetworkText.FromFormattable("{0} {1}!", (object) Lang.mp[18].ToNetworkText(), (object) Main.worldName), new Color((int) byte.MaxValue, 240, 20), plr); else - ChatHelper.SendChatMessageToClient(NetworkText.FromLiteral(Main.motd), new Color((int) byte.MaxValue, 240, 20), plr); + NetMessage.SendChatMessageToClient(NetworkText.FromLiteral(Main.motd), new Color((int) byte.MaxValue, 240, 20), plr); string str = ""; for (int index = 0; index < (int) byte.MaxValue; ++index) { if (Main.player[index].active) str = !(str == "") ? str + ", " + Main.player[index].name : str + Main.player[index].name; } - ChatHelper.SendChatMessageToClient(NetworkText.FromKey("Game.JoinGreeting", (object) str), new Color((int) byte.MaxValue, 240, 20), plr); + NetMessage.SendChatMessageToClient(NetworkText.FromKey("Game.JoinGreeting", (object) str), new Color((int) byte.MaxValue, 240, 20), plr); } public static void sendWater(int x, int y) @@ -2313,7 +2046,6 @@ namespace Terraria } NetMessage.SendNPCHousesAndTravelShop(plr); NetMessage.SendAnglerQuest(plr); - NPC.RevengeManager.SendAllMarkersToPlayer(plr); NetMessage.EnsureLocalPlayerIsPresent(); } @@ -2322,7 +2054,7 @@ namespace Terraria bool flag = false; for (int number = 0; number < 200; ++number) { - if (Main.npc[number].active && Main.npc[number].townNPC && NPC.TypeToDefaultHeadIndex(Main.npc[number].type) > 0) + if (Main.npc[number].active && Main.npc[number].townNPC && NPC.TypeToHeadIndex(Main.npc[number].type) != -1) { if (!flag && Main.npc[number].type == 368) flag = true; @@ -2340,9 +2072,9 @@ namespace Terraria if (!Main.autoShutdown) return; bool flag = false; - for (int plr = 0; plr < (int) byte.MaxValue; ++plr) + for (int index = 0; index < (int) byte.MaxValue; ++index) { - if (NetMessage.DoesPlayerSlotCountAsAHost(plr)) + if (Netplay.Clients[index].State == 10 && Netplay.Clients[index].Socket.GetRemoteAddress().IsLocalHost()) { flag = true; break; @@ -2351,12 +2083,10 @@ namespace Terraria if (flag) return; Console.WriteLine(Language.GetTextValue("Net.ServerAutoShutdown")); - WorldFile.SaveWorld(); - Netplay.Disconnect = true; + WorldFile.saveWorld(); + Netplay.disconnect = true; } - public static bool DoesPlayerSlotCountAsAHost(int plr) => Netplay.Clients[plr].State == 10 && Netplay.Clients[plr].Socket.GetRemoteAddress().IsLocalHost(); - private static void SyncOnePlayer(int plr, int toWho, int fromWho) { int num1 = 0; @@ -2367,14 +2097,11 @@ namespace Terraria NetMessage.SendData(14, toWho, fromWho, number: plr, number2: ((float) num1)); NetMessage.SendData(4, toWho, fromWho, number: plr); NetMessage.SendData(13, toWho, fromWho, number: plr); - if (Main.player[plr].statLife <= 0) - NetMessage.SendData(135, toWho, fromWho, number: plr); NetMessage.SendData(16, toWho, fromWho, number: plr); NetMessage.SendData(30, toWho, fromWho, number: plr); NetMessage.SendData(45, toWho, fromWho, number: plr); NetMessage.SendData(42, toWho, fromWho, number: plr); NetMessage.SendData(50, toWho, fromWho, number: plr); - NetMessage.SendData(80, toWho, fromWho, number: plr, number2: ((float) Main.player[plr].chest)); for (int index = 0; index < 59; ++index) NetMessage.SendData(5, toWho, fromWho, number: plr, number2: ((float) index), number3: ((float) Main.player[plr].inventory[index].prefix)); for (int index = 0; index < Main.player[plr].armor.Length; ++index) @@ -2388,7 +2115,7 @@ namespace Terraria if (Netplay.Clients[plr].IsAnnouncementCompleted) return; Netplay.Clients[plr].IsAnnouncementCompleted = true; - ChatHelper.BroadcastChatMessage(NetworkText.FromKey(Lang.mp[19].Key, (object) Main.player[plr].name), new Color((int) byte.MaxValue, 240, 20), plr); + NetMessage.BroadcastChatMessage(NetworkText.FromKey(Lang.mp[19].Key, (object) Main.player[plr].name), new Color((int) byte.MaxValue, 240, 20), plr); if (!Main.dedServ) return; Console.WriteLine(Lang.mp[19].Format((object) Main.player[plr].name)); @@ -2397,53 +2124,13 @@ namespace Terraria { int num2 = 0; NetMessage.SendData(14, ignoreClient: plr, number: plr, number2: ((float) num2)); - if (Netplay.Clients[plr].IsAnnouncementCompleted) - { - Netplay.Clients[plr].IsAnnouncementCompleted = false; - ChatHelper.BroadcastChatMessage(NetworkText.FromKey(Lang.mp[20].Key, (object) Netplay.Clients[plr].Name), new Color((int) byte.MaxValue, 240, 20), plr); - if (Main.dedServ) - Console.WriteLine(Lang.mp[20].Format((object) Netplay.Clients[plr].Name)); - Netplay.Clients[plr].Name = "Anonymous"; - } - Player.Hooks.PlayerDisconnect(plr); - } - } - - public struct NetSoundInfo - { - public Vector2 position; - public ushort soundIndex; - public int style; - public float volume; - public float pitchOffset; - - public NetSoundInfo( - Vector2 position, - ushort soundIndex, - int style = -1, - float volume = -1f, - float pitchOffset = -1f) - { - this.position = position; - this.soundIndex = soundIndex; - this.style = style; - this.volume = volume; - this.pitchOffset = pitchOffset; - } - - public void WriteSelfTo(BinaryWriter writer) - { - writer.WriteVector2(this.position); - writer.Write(this.soundIndex); - BitsByte bitsByte = new BitsByte(this.style != -1, (double) this.volume != -1.0, (double) this.pitchOffset != -1.0); - writer.Write((byte) bitsByte); - if (bitsByte[0]) - writer.Write(this.style); - if (bitsByte[1]) - writer.Write(this.volume); - if (!bitsByte[2]) + if (!Netplay.Clients[plr].IsAnnouncementCompleted) return; - writer.Write(this.pitchOffset); + Netplay.Clients[plr].IsAnnouncementCompleted = false; + NetMessage.BroadcastChatMessage(NetworkText.FromKey(Lang.mp[20].Key, (object) Netplay.Clients[plr].Name), new Color((int) byte.MaxValue, 240, 20), plr); + if (Main.dedServ) + Console.WriteLine(Lang.mp[20].Format((object) Netplay.Clients[plr].Name)); + Netplay.Clients[plr].Name = "Anonymous"; } } } diff --git a/Netplay.cs b/Netplay.cs index 002b2f9..446d7c8 100644 --- a/Netplay.cs +++ b/Netplay.cs @@ -1,20 +1,16 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Netplay -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; -using System.Collections.Generic; using System.IO; -using System.Linq; using System.Net; using System.Net.Sockets; using System.Threading; -using Terraria.Audio; using Terraria.IO; using Terraria.Localization; -using Terraria.Map; using Terraria.Net; using Terraria.Net.Sockets; using Terraria.Social; @@ -34,29 +30,30 @@ namespace Terraria public static string ServerIPText = ""; public static ISocket TcpListener; public static int ListenPort = 7777; + public static bool IsServerRunning = false; public static bool IsListening = true; public static bool UseUPNP = true; - public static bool Disconnect; - public static bool SpamCheck = false; - public static bool HasClients; - private static Thread _serverThread; - public static MessageBuffer fullBuffer = new MessageBuffer(); - private static int _currentRequestId; - private static UdpClient BroadcastClient = (UdpClient) null; - private static Thread broadcastThread = (Thread) null; + public static bool disconnect = false; + public static bool spamCheck = false; + public static bool anyClients = false; + private static Thread ServerThread; + public static string portForwardIP; + public static int portForwardPort; + public static bool portForwardOpen; public static event Action OnDisconnect; - private static void UpdateServer() + private static void OpenPort() { - for (int bufferIndex = 0; bufferIndex < 256; ++bufferIndex) - { - if (NetMessage.buffer[bufferIndex].checkBytes) - NetMessage.CheckBytes(bufferIndex); - } + Netplay.portForwardIP = Netplay.GetLocalIPAddress(); + Netplay.portForwardPort = Netplay.ListenPort; } - private static string GetLocalIPAddress() + public static void closePort() + { + } + + public static string GetLocalIPAddress() { string str = ""; foreach (IPAddress address in Dns.GetHostEntry(Dns.GetHostName()).AddressList) @@ -70,7 +67,20 @@ namespace Terraria return str; } - private static void ResetNetDiag() => Main.ActiveNetDiagnosticsUI.Reset(); + public static void ResetNetDiag() + { + Main.rxMsg = 0; + Main.rxData = 0; + Main.txMsg = 0; + Main.txData = 0; + for (int index = 0; index < Main.maxMsg; ++index) + { + Main.rxMsgType[index] = 0; + Main.rxDataType[index] = 0; + Main.txMsgType[index] = 0; + Main.txDataType[index] = 0; + } + } public static void ResetSections() { @@ -118,230 +128,7 @@ namespace Terraria return false; } - private static void OpenPort(int port) - { - } - - private static void ClosePort(int port) - { - } - - private static void ServerFullWriteCallBack(object state) - { - } - - private static void OnConnectionAccepted(ISocket client) - { - int nextOpenClientSlot = Netplay.FindNextOpenClientSlot(); - if (nextOpenClientSlot != -1) - { - Netplay.Clients[nextOpenClientSlot].Reset(); - Netplay.Clients[nextOpenClientSlot].Socket = client; - } - else - { - lock (Netplay.fullBuffer) - Netplay.KickClient(client, NetworkText.FromKey("CLI.ServerIsFull")); - } - if (Netplay.FindNextOpenClientSlot() != -1) - return; - Netplay.StopListening(); - Netplay.IsListening = false; - } - - private static void KickClient(ISocket client, NetworkText kickMessage) - { - BinaryWriter writer = Netplay.fullBuffer.writer; - if (writer == null) - { - Netplay.fullBuffer.ResetWriter(); - writer = Netplay.fullBuffer.writer; - } - writer.BaseStream.Position = 0L; - long position1 = writer.BaseStream.Position; - writer.BaseStream.Position += 2L; - writer.Write((byte) 2); - kickMessage.Serialize(writer); - if (Main.dedServ) - Console.WriteLine(Language.GetTextValue("CLI.ClientWasBooted", (object) client.GetRemoteAddress().ToString(), (object) kickMessage)); - int position2 = (int) writer.BaseStream.Position; - writer.BaseStream.Position = position1; - writer.Write((short) position2); - writer.BaseStream.Position = (long) position2; - client.AsyncSend(Netplay.fullBuffer.writeBuffer, 0, position2, new SocketSendCallback(Netplay.ServerFullWriteCallBack), (object) client); - } - - public static void OnConnectedToSocialServer(ISocket client) => Netplay.StartSocialClient(client); - - private static bool StartListening() - { - if (SocialAPI.Network != null) - SocialAPI.Network.StartListening(new SocketConnectionAccepted(Netplay.OnConnectionAccepted)); - return Netplay.TcpListener.StartListening(new SocketConnectionAccepted(Netplay.OnConnectionAccepted)); - } - - private static void StopListening() - { - if (SocialAPI.Network != null) - SocialAPI.Network.StopListening(); - Netplay.TcpListener.StopListening(); - } - - public static void StartServer() - { - Netplay.InitializeServer(); - Netplay._serverThread = new Thread(new ThreadStart(Netplay.ServerLoop)) - { - IsBackground = true, - Name = "Server Loop Thread" - }; - Netplay._serverThread.Start(); - } - - private static void InitializeServer() - { - Netplay.ResetNetDiag(); - if (Main.rand == null) - Main.rand = new UnifiedRandom((int) DateTime.Now.Ticks); - Main.myPlayer = (int) byte.MaxValue; - Netplay.ServerIP = IPAddress.Any; - Main.menuMode = 14; - Main.statusText = Lang.menu[8].Value; - Main.netMode = 2; - Netplay.Disconnect = false; - for (int index = 0; index < 256; ++index) - { - Netplay.Clients[index] = new RemoteClient(); - Netplay.Clients[index].Reset(); - Netplay.Clients[index].Id = index; - Netplay.Clients[index].ReadBuffer = new byte[1024]; - } - Netplay.TcpListener = (ISocket) new TcpSocket(); - if (!Netplay.Disconnect) - { - if (!Netplay.StartListening()) - { - Main.menuMode = 15; - Main.statusText = Language.GetTextValue("Error.TriedToRunServerTwice"); - Netplay.Disconnect = true; - } - Main.statusText = Language.GetTextValue("CLI.ServerStarted"); - } - if (!Netplay.UseUPNP) - return; - try - { - Netplay.OpenPort(Netplay.ListenPort); - } - catch (Exception ex) - { - } - } - - private static void CleanupServer() - { - Netplay.StopListening(); - try - { - Netplay.ClosePort(Netplay.ListenPort); - } - catch - { - } - for (int index = 0; index < 256; ++index) - Netplay.Clients[index].Reset(); - if (Main.menuMode != 15) - { - Main.netMode = 0; - Main.menuMode = 10; - WorldFile.SaveWorld(); - Main.menuMode = 0; - } - else - Main.netMode = 0; - Main.myPlayer = 0; - } - - private static void ServerLoop() - { - int num = 0; - Netplay.StartBroadCasting(); - while (!Netplay.Disconnect) - { - Netplay.StartListeningIfNeeded(); - Netplay.UpdateConnectedClients(); - num = (num + 1) % 10; - Thread.Sleep(num == 0 ? 1 : 0); - } - Netplay.StopBroadCasting(); - Netplay.CleanupServer(); - } - - private static void UpdateConnectedClients() - { - int num1 = 0; - for (int index = 0; index < 256; ++index) - { - if (Netplay.Clients[index].PendingTermination) - { - if (Netplay.Clients[index].PendingTerminationApproved) - { - Netplay.Clients[index].Reset(); - NetMessage.SyncDisconnectedPlayer(index); - } - } - else if (Netplay.Clients[index].IsConnected()) - { - Netplay.Clients[index].Update(); - ++num1; - } - else if (Netplay.Clients[index].IsActive) - { - Netplay.Clients[index].PendingTermination = true; - Netplay.Clients[index].PendingTerminationApproved = true; - } - else - { - Netplay.Clients[index].StatusText2 = ""; - if (index < (int) byte.MaxValue) - { - int num2 = Main.player[index].active ? 1 : 0; - Main.player[index].active = false; - if (num2 != 0) - Player.Hooks.PlayerDisconnect(index); - } - } - } - Netplay.HasClients = (uint) num1 > 0U; - } - - private static void StartListeningIfNeeded() - { - if (Netplay.IsListening) - return; - if (!((IEnumerable) Netplay.Clients).Any((Func) (client => !client.IsConnected()))) - return; - try - { - Netplay.StartListening(); - Netplay.IsListening = true; - } - catch - { - if (Main.ignoreErrors) - return; - throw; - } - } - - private static void UpdateClient() - { - if (Main.netMode != 1 || !Netplay.Connection.Socket.IsConnected() || !NetMessage.buffer[256].checkBytes) - return; - NetMessage.CheckBytes(); - } - - public static void AddCurrentServerToRecentList() + public static void newRecent() { if (Netplay.Connection.Socket.GetRemoteAddress().Type != AddressType.Tcp) return; @@ -377,7 +164,7 @@ namespace Terraria Netplay.InnerClientLoop(); } - public static void TcpClientLoop() + public static void TcpClientLoop(object threadContext) { Netplay.ClientLoopSetup((RemoteAddress) new TcpAddress(Netplay.ServerIP, Netplay.ListenPort)); Main.menuMode = 14; @@ -392,7 +179,7 @@ namespace Terraria } catch { - if (!Netplay.Disconnect) + if (!Netplay.disconnect) { if (Main.gameMenu) flag = true; @@ -419,7 +206,7 @@ namespace Terraria Main.menuMode = 14; if (!Main.autoPass) Main.statusText = Language.GetTextValue("Net.ConnectingTo", (object) address.GetFriendlyName()); - Netplay.Disconnect = false; + Netplay.disconnect = false; Netplay.Connection = new RemoteServer(); Netplay.Connection.ReadBuffer = new byte[1024]; } @@ -430,10 +217,12 @@ namespace Terraria { NetMessage.buffer[256].Reset(); int num1 = -1; - while (!Netplay.Disconnect) + while (!Netplay.disconnect) { if (Netplay.Connection.Socket.IsConnected()) { + if (NetMessage.buffer[256].checkBytes) + NetMessage.CheckBytes(); Netplay.Connection.IsActive = true; if (Netplay.Connection.State == 0) { @@ -450,7 +239,7 @@ namespace Terraria WorldGen.worldCleared = false; Netplay.Connection.State = 5; Main.cloudBGAlpha = (double) Main.cloudBGActive < 1.0 ? 0.0f : 1f; - Main.windSpeedCurrent = Main.windSpeedTarget; + Main.windSpeed = Main.windSpeedSet; Cloud.resetClouds(); Main.cloudAlpha = Main.maxRaining; WorldGen.clearWorld(); @@ -470,7 +259,7 @@ namespace Terraria } if (Netplay.Connection.State == 6 && num1 != Netplay.Connection.State) Main.statusText = Language.GetTextValue("Net.RequestingTileData"); - if (!Netplay.Connection.IsReading && !Netplay.Disconnect && Netplay.Connection.Socket.IsDataAvailable()) + if (!Netplay.Connection.IsReading && !Netplay.disconnect && Netplay.Connection.Socket.IsDataAvailable()) { Netplay.Connection.IsReading = true; Netplay.Connection.Socket.AsyncReceive(Netplay.Connection.ReadBuffer, 0, Netplay.Connection.ReadBuffer.Length, new SocketReceiveCallback(Netplay.Connection.ClientReadCallBack)); @@ -492,7 +281,7 @@ namespace Terraria else if (Netplay.Connection.IsActive) { Main.statusText = Language.GetTextValue("Net.LostConnection"); - Netplay.Disconnect = true; + Netplay.disconnect = true; } num1 = Netplay.Connection.State; } @@ -505,14 +294,11 @@ namespace Terraria } if (!Main.gameMenu) { - Main.gameMenu = true; Main.SwitchNetMode(0); - MapHelper.noStatusText = true; Player.SavePlayer(Main.ActivePlayerFileData); - Player.ClearPlayerTempInfo(); Main.ActivePlayerFileData.StopPlayTimer(); - SoundEngine.StopTrackedSounds(); - MapHelper.noStatusText = false; + Main.gameMenu = true; + Main.StopTrackedSounds(); Main.menuMode = 14; } NetMessage.buffer[256].Reset(); @@ -539,7 +325,7 @@ namespace Terraria catch { } - Netplay.Disconnect = true; + Netplay.disconnect = true; } if (Netplay.OnDisconnect == null) return; @@ -556,21 +342,238 @@ namespace Terraria return -1; } - public static void StartSocialClient(ISocket socket) => new Thread(new ParameterizedThreadStart(Netplay.SocialClientLoop)) + private static void OnConnectionAccepted(ISocket client) { - Name = "Social Client Thread", - IsBackground = true - }.Start((object) socket); + int nextOpenClientSlot = Netplay.FindNextOpenClientSlot(); + if (nextOpenClientSlot != -1) + { + Netplay.Clients[nextOpenClientSlot].Reset(); + Netplay.Clients[nextOpenClientSlot].Socket = client; + Console.WriteLine(Language.GetTextValue("Net.ClientConnecting", (object) client.GetRemoteAddress())); + } + if (Netplay.FindNextOpenClientSlot() != -1) + return; + Netplay.StopListening(); + } - public static void StartTcpClient() => new Thread(new ThreadStart(Netplay.TcpClientLoop)) + public static void OnConnectedToSocialServer(ISocket client) => Netplay.StartSocialClient(client); + + private static bool StartListening() { - Name = "TCP Client Thread", - IsBackground = true - }.Start(); + if (SocialAPI.Network != null) + SocialAPI.Network.StartListening(new SocketConnectionAccepted(Netplay.OnConnectionAccepted)); + return Netplay.TcpListener.StartListening(new SocketConnectionAccepted(Netplay.OnConnectionAccepted)); + } - public static bool SetRemoteIP(string remoteAddress) => Netplay.SetRemoteIPOld(remoteAddress); + private static void StopListening() + { + if (SocialAPI.Network != null) + SocialAPI.Network.StopListening(); + Netplay.TcpListener.StopListening(); + } - public static bool SetRemoteIPOld(string remoteAddress) + public static void ServerLoop(object threadContext) + { + Netplay.ResetNetDiag(); + if (Main.rand == null) + Main.rand = new UnifiedRandom((int) DateTime.Now.Ticks); + Main.myPlayer = (int) byte.MaxValue; + Netplay.ServerIP = IPAddress.Any; + Main.menuMode = 14; + Main.statusText = Lang.menu[8].Value; + Main.netMode = 2; + Netplay.disconnect = false; + for (int index = 0; index < 256; ++index) + { + Netplay.Clients[index] = new RemoteClient(); + Netplay.Clients[index].Reset(); + Netplay.Clients[index].Id = index; + Netplay.Clients[index].ReadBuffer = new byte[1024]; + } + Netplay.TcpListener = (ISocket) new TcpSocket(); + if (!Netplay.disconnect) + { + if (!Netplay.StartListening()) + { + Main.menuMode = 15; + Main.statusText = Language.GetTextValue("Error.TriedToRunServerTwice"); + Netplay.disconnect = true; + } + Main.statusText = Language.GetTextValue("CLI.ServerStarted"); + } + if (Netplay.UseUPNP) + { + try + { + Netplay.OpenPort(); + } + catch + { + } + } + int num1 = 0; + while (!Netplay.disconnect) + { + if (!Netplay.IsListening) + { + int num2 = -1; + for (int index = 0; index < Main.maxNetPlayers; ++index) + { + if (!Netplay.Clients[index].IsConnected()) + { + num2 = index; + break; + } + } + if (num2 >= 0) + { + if (Main.ignoreErrors) + { + try + { + Netplay.StartListening(); + Netplay.IsListening = true; + } + catch + { + } + } + else + { + Netplay.StartListening(); + Netplay.IsListening = true; + } + } + } + int num3 = 0; + for (int index = 0; index < 256; ++index) + { + if (NetMessage.buffer[index].checkBytes) + NetMessage.CheckBytes(index); + if (Netplay.Clients[index].PendingTermination) + { + Netplay.Clients[index].Reset(); + NetMessage.SyncDisconnectedPlayer(index); + } + else if (Netplay.Clients[index].IsConnected()) + { + if (!Netplay.Clients[index].IsActive) + Netplay.Clients[index].State = 0; + Netplay.Clients[index].IsActive = true; + ++num3; + if (!Netplay.Clients[index].IsReading) + { + try + { + if (Netplay.Clients[index].Socket.IsDataAvailable()) + { + Netplay.Clients[index].IsReading = true; + Netplay.Clients[index].Socket.AsyncReceive(Netplay.Clients[index].ReadBuffer, 0, Netplay.Clients[index].ReadBuffer.Length, new SocketReceiveCallback(Netplay.Clients[index].ServerReadCallBack)); + } + } + catch + { + Netplay.Clients[index].PendingTermination = true; + } + } + if (Netplay.Clients[index].StatusMax > 0 && Netplay.Clients[index].StatusText2 != "") + { + if (Netplay.Clients[index].StatusCount >= Netplay.Clients[index].StatusMax) + { + Netplay.Clients[index].StatusText = Language.GetTextValue("Net.ClientStatusComplete", (object) Netplay.Clients[index].Socket.GetRemoteAddress(), (object) Netplay.Clients[index].Name, (object) Netplay.Clients[index].StatusText2); + Netplay.Clients[index].StatusText2 = ""; + Netplay.Clients[index].StatusMax = 0; + Netplay.Clients[index].StatusCount = 0; + } + else + Netplay.Clients[index].StatusText = "(" + (object) Netplay.Clients[index].Socket.GetRemoteAddress() + ") " + Netplay.Clients[index].Name + " " + Netplay.Clients[index].StatusText2 + ": " + (object) (int) ((double) Netplay.Clients[index].StatusCount / (double) Netplay.Clients[index].StatusMax * 100.0) + "%"; + } + else if (Netplay.Clients[index].State == 0) + Netplay.Clients[index].StatusText = Language.GetTextValue("Net.ClientConnecting", (object) string.Format("({0}) {1}", (object) Netplay.Clients[index].Socket.GetRemoteAddress(), (object) Netplay.Clients[index].Name)); + else if (Netplay.Clients[index].State == 1) + Netplay.Clients[index].StatusText = Language.GetTextValue("Net.ClientSendingData", (object) Netplay.Clients[index].Socket.GetRemoteAddress(), (object) Netplay.Clients[index].Name); + else if (Netplay.Clients[index].State == 2) + Netplay.Clients[index].StatusText = Language.GetTextValue("Net.ClientRequestedWorldInfo", (object) Netplay.Clients[index].Socket.GetRemoteAddress(), (object) Netplay.Clients[index].Name); + else if (Netplay.Clients[index].State != 3) + { + if (Netplay.Clients[index].State == 10) + { + try + { + Netplay.Clients[index].StatusText = Language.GetTextValue("Net.ClientPlaying", (object) Netplay.Clients[index].Socket.GetRemoteAddress(), (object) Netplay.Clients[index].Name); + } + catch (Exception ex) + { + Netplay.Clients[index].PendingTermination = true; + } + } + } + } + else if (Netplay.Clients[index].IsActive) + { + Netplay.Clients[index].PendingTermination = true; + } + else + { + Netplay.Clients[index].StatusText2 = ""; + if (index < (int) byte.MaxValue) + { + int num4 = Main.player[index].active ? 1 : 0; + Main.player[index].active = false; + if (num4 != 0) + Player.Hooks.PlayerDisconnect(index); + } + } + } + ++num1; + if (num1 > 10) + { + Thread.Sleep(1); + num1 = 0; + } + else + Thread.Sleep(0); + if (!WorldGen.saveLock && !Main.dedServ) + Main.statusText = num3 != 0 ? Language.GetTextValue("Net.ClientsConnected", (object) num3) : Language.GetTextValue("Net.WaitingForClients"); + Netplay.anyClients = num3 != 0; + Netplay.IsServerRunning = true; + } + Netplay.StopListening(); + try + { + Netplay.closePort(); + } + catch + { + } + for (int index = 0; index < 256; ++index) + Netplay.Clients[index].Reset(); + if (Main.menuMode != 15) + { + Main.netMode = 0; + Main.menuMode = 10; + WorldFile.saveWorld(); + do + ; + while (WorldGen.saveLock); + Main.menuMode = 0; + } + else + Main.netMode = 0; + Main.myPlayer = 0; + } + + public static void StartSocialClient(ISocket socket) => ThreadPool.QueueUserWorkItem(new WaitCallback(Netplay.SocialClientLoop), (object) socket); + + public static void StartTcpClient() => ThreadPool.QueueUserWorkItem(new WaitCallback(Netplay.TcpClientLoop), (object) 1); + + public static void StartServer() + { + Netplay.ServerThread = new Thread(new ParameterizedThreadStart(Netplay.ServerLoop)); + Netplay.ServerThread.Start(); + } + + public static bool SetRemoteIP(string remoteAddress) { try { @@ -598,149 +601,14 @@ namespace Terraria return false; } - public static void SetRemoteIPAsync(string remoteAddress, Action successCallBack) - { - try - { - IPAddress address; - if (IPAddress.TryParse(remoteAddress, out address)) - { - Netplay.ServerIP = address; - Netplay.ServerIPText = address.ToString(); - successCallBack(); - } - else - { - Netplay.InvalidateAllOngoingIPSetAttempts(); - Dns.BeginGetHostAddresses(remoteAddress, new AsyncCallback(Netplay.SetRemoteIPAsyncCallback), (object) new Netplay.SetRemoteIPRequestInfo() - { - RequestId = Netplay._currentRequestId, - SuccessCallback = successCallBack, - RemoteAddress = remoteAddress - }); - } - } - catch (Exception ex) - { - } - } - - public static void InvalidateAllOngoingIPSetAttempts() => ++Netplay._currentRequestId; - - private static void SetRemoteIPAsyncCallback(IAsyncResult ar) - { - Netplay.SetRemoteIPRequestInfo asyncState = (Netplay.SetRemoteIPRequestInfo) ar.AsyncState; - if (asyncState.RequestId != Netplay._currentRequestId) - return; - try - { - bool flag = false; - IPAddress[] hostAddresses = Dns.EndGetHostAddresses(ar); - for (int index = 0; index < hostAddresses.Length; ++index) - { - if (hostAddresses[index].AddressFamily == AddressFamily.InterNetwork) - { - Netplay.ServerIP = hostAddresses[index]; - Netplay.ServerIPText = asyncState.RemoteAddress; - flag = true; - break; - } - } - if (!flag) - return; - asyncState.SuccessCallback(); - } - catch (Exception ex) - { - } - } - public static void Initialize() { NetMessage.buffer[256] = new MessageBuffer(); NetMessage.buffer[256].whoAmI = 256; } - public static void Update() => Netplay.UpdateClient(); - public static int GetSectionX(int x) => x / 200; public static int GetSectionY(int y) => y / 150; - - private static void BroadcastThread() - { - Netplay.BroadcastClient = new UdpClient(); - IPEndPoint ipEndPoint = new IPEndPoint(IPAddress.Any, 0); - Netplay.BroadcastClient.EnableBroadcast = true; - DateTime dateTime = new DateTime(0L); - byte[] array; - using (MemoryStream memoryStream = new MemoryStream()) - { - using (BinaryWriter binaryWriter = new BinaryWriter((Stream) memoryStream)) - { - int num = 1010; - binaryWriter.Write(num); - binaryWriter.Write(Netplay.ListenPort); - binaryWriter.Write(Main.worldName); - binaryWriter.Write(Dns.GetHostName()); - binaryWriter.Write((ushort) Main.maxTilesX); - binaryWriter.Write(Main.ActiveWorldFileData.HasCrimson); - binaryWriter.Write(Main.ActiveWorldFileData.GameMode); - binaryWriter.Write((byte) Main.maxNetPlayers); - binaryWriter.Write((byte) 0); - binaryWriter.Flush(); - array = memoryStream.ToArray(); - } - } - while (true) - { - int num = 0; - for (int index = 0; index < (int) byte.MaxValue; ++index) - { - if (Main.player[index].active) - ++num; - } - if (num > 0) - { - array[array.Length - 1] = (byte) num; - try - { - Netplay.BroadcastClient.Send(array, array.Length, new IPEndPoint(IPAddress.Broadcast, 8888)); - } - catch - { - } - } - Thread.Sleep(1000); - } - } - - public static void StartBroadCasting() - { - if (Netplay.broadcastThread != null) - Netplay.StopBroadCasting(); - Netplay.broadcastThread = new Thread(new ThreadStart(Netplay.BroadcastThread)); - Netplay.broadcastThread.Start(); - } - - public static void StopBroadCasting() - { - if (Netplay.broadcastThread != null) - { - Netplay.broadcastThread.Abort(); - Netplay.broadcastThread = (Thread) null; - } - if (Netplay.BroadcastClient == null) - return; - Netplay.BroadcastClient.Close(); - Netplay.BroadcastClient = (UdpClient) null; - } - - private class SetRemoteIPRequestInfo - { - public int RequestId; - public Action SuccessCallback; - public string RemoteAddress; - } } } diff --git a/ObjectData/TileObjectData.cs b/ObjectData/TileObjectData.cs index ceca490..33621a2 100644 --- a/ObjectData/TileObjectData.cs +++ b/ObjectData/TileObjectData.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ObjectData.TileObjectData -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; @@ -9,7 +9,6 @@ using System.Collections.Generic; using Terraria.DataStructures; using Terraria.Enums; using Terraria.GameContent.Tile_Entities; -using Terraria.ID; using Terraria.Modules; namespace Terraria.ObjectData @@ -156,11 +155,11 @@ namespace Terraria.ObjectData this.LavaPlacement = LiquidPlacement.NotAllowed; this._placementHooks = new TilePlacementHooksModule(); this._hasOwnPlacementHooks = true; - this.HookCheckIfCanPlace = new PlacementHook(); + this.HookCheck = new PlacementHook(); this.HookPostPlaceEveryone = new PlacementHook(); this.HookPostPlaceMyPlayer = new PlacementHook(); this.HookPlaceOverride = new PlacementHook(); - this.SubTiles = new List(623); + this.SubTiles = new List(470); this._tileObjectBase = new TileObjectBaseModule(); this._hasOwnTileObjectBase = true; this.Width = 1; @@ -215,8 +214,6 @@ namespace Terraria.ObjectData throw new FieldAccessException("Tile data is locked and only accessible during startup."); } - private void LockWrites() => TileObjectData.readOnlyData = true; - private bool LinkedAlternates { get => this._linkedAlternates; @@ -547,9 +544,9 @@ namespace Terraria.ObjectData } } - public PlacementHook HookCheckIfCanPlace + public PlacementHook HookCheck { - get => this._placementHooks == null ? TileObjectData._baseObject.HookCheckIfCanPlace : this._placementHooks.check; + get => this._placementHooks == null ? TileObjectData._baseObject.HookCheck : this._placementHooks.check; set { this.WriteCheck(); @@ -645,27 +642,6 @@ namespace Terraria.ObjectData } } - public int DrawXOffset - { - get => this._tileObjectDraw == null ? this.DrawXOffset : this._tileObjectDraw.xOffset; - set - { - this.WriteCheck(); - if (!this._hasOwnTileObjectDraw) - { - if (this._tileObjectDraw.xOffset == value) - return; - this._hasOwnTileObjectDraw = true; - this._tileObjectDraw = new TileObjectDrawModule(this._tileObjectDraw); - } - this._tileObjectDraw.xOffset = value; - if (!this._linkedAlternates) - return; - for (int index = 0; index < this._alternates.data.Count; ++index) - this._alternates.data[index].DrawXOffset = value; - } - } - public bool DrawFlipHorizontal { get => this._tileObjectDraw == null ? this.DrawFlipHorizontal : this._tileObjectDraw.flipHorizontal; @@ -792,52 +768,6 @@ namespace Terraria.ObjectData } } - public int? StyleWrapLimitVisualOverride - { - get => this._tileObjectStyle == null ? TileObjectData._baseObject.StyleWrapLimitVisualOverride : this._tileObjectStyle.styleWrapLimitVisualOverride; - set - { - this.WriteCheck(); - if (!this._hasOwnTileObjectStyle) - { - int? limitVisualOverride = this._tileObjectStyle.styleWrapLimitVisualOverride; - int? nullable = value; - if (limitVisualOverride.GetValueOrDefault() == nullable.GetValueOrDefault() & limitVisualOverride.HasValue == nullable.HasValue) - return; - this._hasOwnTileObjectStyle = true; - this._tileObjectStyle = new TileObjectStyleModule(this._tileObjectStyle); - } - this._tileObjectStyle.styleWrapLimitVisualOverride = value; - if (!this._linkedAlternates) - return; - for (int index = 0; index < this._alternates.data.Count; ++index) - this._alternates.data[index].StyleWrapLimitVisualOverride = value; - } - } - - public int? styleLineSkipVisualOverride - { - get => this._tileObjectStyle == null ? TileObjectData._baseObject.styleLineSkipVisualOverride : this._tileObjectStyle.styleLineSkipVisualoverride; - set - { - this.WriteCheck(); - if (!this._hasOwnTileObjectStyle) - { - int? skipVisualoverride = this._tileObjectStyle.styleLineSkipVisualoverride; - int? nullable = value; - if (skipVisualoverride.GetValueOrDefault() == nullable.GetValueOrDefault() & skipVisualoverride.HasValue == nullable.HasValue) - return; - this._hasOwnTileObjectStyle = true; - this._tileObjectStyle = new TileObjectStyleModule(this._tileObjectStyle); - } - this._tileObjectStyle.styleLineSkipVisualoverride = value; - if (!this._linkedAlternates) - return; - for (int index = 0; index < this._alternates.data.Count; ++index) - this._alternates.data[index].styleLineSkipVisualOverride = value; - } - } - public int StyleLineSkip { get => this._tileObjectStyle == null ? TileObjectData._baseObject.StyleLineSkip : this._tileObjectStyle.styleLineSkip; @@ -1136,28 +1066,6 @@ namespace Terraria.ObjectData } } - public int DrawStyleOffset - { - get => this._tileObjectCoords == null ? TileObjectData._baseObject.DrawStyleOffset : this._tileObjectCoords.drawStyleOffset; - set - { - this.WriteCheck(); - if (!this._hasOwnTileObjectCoords) - { - if (this._tileObjectCoords.drawStyleOffset == value) - return; - this._hasOwnTileObjectCoords = true; - this._tileObjectCoords = new TileObjectCoordinatesModule(this._tileObjectCoords); - } - this._tileObjectCoords.drawStyleOffset = value; - this._tileObjectCoords.calculated = false; - if (!this._linkedAlternates) - return; - for (int index = 0; index < this._alternates.data.Count; ++index) - this._alternates.data[index].DrawStyleOffset = value; - } - } - public bool LiquidPlace(Tile checkTile) { if (checkTile == null) @@ -1316,8 +1224,8 @@ namespace Terraria.ObjectData { TileObjectData._baseObject = new TileObjectData(); TileObjectData._baseObject.SetupBaseObject(); - TileObjectData._data = new List(623); - for (int index = 0; index < 623; ++index) + TileObjectData._data = new List(470); + for (int index = 0; index < 470; ++index) TileObjectData._data.Add((TileObjectData) null); TileObjectData.newTile = new TileObjectData(TileObjectData._baseObject); TileObjectData.newSubTile = new TileObjectData(TileObjectData._baseObject); @@ -1370,7 +1278,7 @@ namespace Terraria.ObjectData TileObjectData.newTile.Origin = new Point16(1, 7); TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, TileObjectData.newTile.Width, 0); TileObjectData.newTile.UsesCustomCanPlace = true; - TileObjectData.newTile.HookPlaceOverride = new PlacementHook(new Func(WorldGen.PlaceXmasTree_Direct), -1, 0, true); + TileObjectData.newTile.HookPlaceOverride = new PlacementHook(new Func(WorldGen.PlaceXmasTree_Direct), -1, 0, true); TileObjectData.newTile.CoordinateHeights = new int[8] { 16, @@ -1428,23 +1336,6 @@ namespace Terraria.ObjectData TileObjectData.newSubTile.AnchorBottom = new AnchorData(AnchorType.EmptyTile, TileObjectData.newSubTile.Width, 0); TileObjectData.addSubTile(7); TileObjectData.addTile(227); - TileObjectData.newTile.CopyFrom(TileObjectData.StyleDye); - TileObjectData.newTile.CoordinateHeights = new int[1] - { - 20 - }; - TileObjectData.newTile.CoordinateWidth = 20; - TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.DrawYOffset = -2; - TileObjectData.newTile.AnchorTop = AnchorData.Empty; - TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.Table, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.newTile.DrawFlipHorizontal = false; - TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; - TileObjectData.addAlternate(1); - TileObjectData.addTile(579); TileObjectData.newTile.Width = 1; TileObjectData.newTile.Height = 3; TileObjectData.newTile.Origin = new Point16(0, 0); @@ -1596,20 +1487,6 @@ namespace Terraria.ObjectData TileObjectData.addTile(49); TileObjectData.newTile.CopyFrom(TileObjectData.StyleOnTable1x1); TileObjectData.newTile.CoordinateHeights = new int[1] - { - 16 - }; - TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.Table, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(TEFoodPlatter.Hook_AfterPlacement), -1, 0, true); - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; - TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; - TileObjectData.addAlternate(1); - TileObjectData.addTile(520); - TileObjectData.newTile.CopyFrom(TileObjectData.StyleOnTable1x1); - TileObjectData.newTile.CoordinateHeights = new int[1] { 20 }; @@ -1620,10 +1497,6 @@ namespace Terraria.ObjectData TileObjectData.newTile.RandomStyleRange = 5; TileObjectData.addTile(50); TileObjectData.newTile.CopyFrom(TileObjectData.StyleOnTable1x1); - TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.Table, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.addTile(494); - TileObjectData.newTile.CopyFrom(TileObjectData.StyleOnTable1x1); TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.Table | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); TileObjectData.newTile.DrawYOffset = 2; TileObjectData.newTile.LavaDeath = false; @@ -1651,9 +1524,6 @@ namespace Terraria.ObjectData TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.addBaseTile(out TileObjectData.Style1xX); TileObjectData.newTile.CopyFrom(TileObjectData.Style1xX); - TileObjectData.newTile.StyleWrapLimitVisualOverride = new int?(37); - TileObjectData.newTile.StyleLineSkip = 2; - TileObjectData.newTile.DrawYOffset = 2; TileObjectData.newTile.WaterDeath = true; TileObjectData.newTile.WaterPlacement = LiquidPlacement.NotAllowed; TileObjectData.newTile.LavaPlacement = LiquidPlacement.NotAllowed; @@ -1698,20 +1568,10 @@ namespace Terraria.ObjectData TileObjectData.newTile.LavaDeath = true; TileObjectData.addBaseTile(out TileObjectData.Style1x2Top); TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2Top); - TileObjectData.newTile.DrawYOffset = -2; TileObjectData.addTile(270); TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2Top); - TileObjectData.newTile.DrawYOffset = -2; TileObjectData.addTile(271); TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2Top); - TileObjectData.newTile.DrawYOffset = -2; - TileObjectData.addTile(581); - TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2Top); - TileObjectData.newTile.DrawYOffset = -2; - TileObjectData.newTile.StyleWrapLimit = 6; - TileObjectData.addTile(572); - TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2Top); - TileObjectData.newTile.DrawYOffset = -2; TileObjectData.newSubTile.CopyFrom(TileObjectData.newTile); TileObjectData.newSubTile.LavaDeath = false; TileObjectData.newSubTile.LavaPlacement = LiquidPlacement.Allowed; @@ -1728,7 +1588,6 @@ namespace Terraria.ObjectData TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.SolidBottom, TileObjectData.newTile.Width, 0); TileObjectData.newTile.StyleWrapLimit = 111; - TileObjectData.newTile.DrawYOffset = -2; TileObjectData.addTile(91); TileObjectData.newTile.Width = 4; TileObjectData.newTile.Height = 2; @@ -1736,21 +1595,6 @@ namespace Terraria.ObjectData TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); TileObjectData.newTile.UsesCustomCanPlace = true; TileObjectData.newTile.CoordinateHeights = new int[2] - { - 16, - 18 - }; - TileObjectData.newTile.CoordinateWidth = 16; - TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.newTile.LavaDeath = false; - TileObjectData.addTile(487); - TileObjectData.newTile.Width = 4; - TileObjectData.newTile.Height = 2; - TileObjectData.newTile.Origin = new Point16(1, 1); - TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.UsesCustomCanPlace = true; - TileObjectData.newTile.CoordinateHeights = new int[2] { 16, 16 @@ -1822,27 +1666,13 @@ namespace Terraria.ObjectData TileObjectData.newTile.CopyFrom(TileObjectData.StyleSmallCage); TileObjectData.addTile(286); TileObjectData.newTile.CopyFrom(TileObjectData.StyleSmallCage); - TileObjectData.addTile(582); - TileObjectData.newTile.CopyFrom(TileObjectData.StyleSmallCage); - TileObjectData.addTile(619); - TileObjectData.newTile.CopyFrom(TileObjectData.StyleSmallCage); TileObjectData.addTile(298); TileObjectData.newTile.CopyFrom(TileObjectData.StyleSmallCage); TileObjectData.addTile(299); TileObjectData.newTile.CopyFrom(TileObjectData.StyleSmallCage); TileObjectData.addTile(310); TileObjectData.newTile.CopyFrom(TileObjectData.StyleSmallCage); - TileObjectData.addTile(532); - TileObjectData.newTile.CopyFrom(TileObjectData.StyleSmallCage); - TileObjectData.addTile(533); - TileObjectData.newTile.CopyFrom(TileObjectData.StyleSmallCage); TileObjectData.addTile(339); - TileObjectData.newTile.CopyFrom(TileObjectData.StyleSmallCage); - TileObjectData.addTile(538); - TileObjectData.newTile.CopyFrom(TileObjectData.StyleSmallCage); - TileObjectData.addTile(555); - TileObjectData.newTile.CopyFrom(TileObjectData.StyleSmallCage); - TileObjectData.addTile(556); TileObjectData.newTile.Width = 6; TileObjectData.newTile.Height = 3; TileObjectData.newTile.Origin = new Point16(3, 2); @@ -1883,46 +1713,6 @@ namespace Terraria.ObjectData TileObjectData.addTile(297); TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3); TileObjectData.addTile(309); - TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3); - TileObjectData.addTile(550); - TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3); - TileObjectData.addTile(551); - TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3); - TileObjectData.addTile(553); - TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3); - TileObjectData.addTile(554); - TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3); - TileObjectData.addTile(558); - TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3); - TileObjectData.addTile(559); - TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3); - TileObjectData.addTile(599); - TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3); - TileObjectData.addTile(600); - TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3); - TileObjectData.addTile(601); - TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3); - TileObjectData.addTile(602); - TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3); - TileObjectData.addTile(603); - TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3); - TileObjectData.addTile(604); - TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3); - TileObjectData.addTile(605); - TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3); - TileObjectData.addTile(606); - TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3); - TileObjectData.addTile(607); - TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3); - TileObjectData.addTile(608); - TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3); - TileObjectData.addTile(609); - TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3); - TileObjectData.addTile(610); - TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3); - TileObjectData.addTile(611); - TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3); - TileObjectData.addTile(612); TileObjectData.newTile.Width = 5; TileObjectData.newTile.Height = 4; TileObjectData.newTile.Origin = new Point16(2, 3); @@ -1993,6 +1783,7 @@ namespace Terraria.ObjectData TileObjectData.newTile.AnchorRight = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Height, 0); TileObjectData.addTile(387); TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); + TileObjectData.newTile.DrawYOffset = 2; TileObjectData.newTile.LavaDeath = false; TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; @@ -2023,20 +1814,6 @@ namespace Terraria.ObjectData TileObjectData.newTile.StyleHorizontal = true; TileObjectData.addBaseTile(out TileObjectData.Style2xX); TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); - TileObjectData.newTile.Height = 5; - TileObjectData.newTile.Origin = new Point16(1, 4); - TileObjectData.newTile.CoordinateHeights = new int[5] - { - 16, - 16, - 16, - 16, - 16 - }; - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.newTile.LavaDeath = true; - TileObjectData.addTile(547); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); TileObjectData.newTile.Height = 4; TileObjectData.newTile.Origin = new Point16(1, 3); TileObjectData.newTile.CoordinateHeights = new int[4] @@ -2059,70 +1836,23 @@ namespace Terraria.ObjectData }; TileObjectData.addTile(410); TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); - TileObjectData.newTile.Height = 3; - TileObjectData.newTile.Origin = new Point16(1, 2); - TileObjectData.newTile.CoordinateHeights = new int[3] - { - 16, - 16, - 16 - }; - TileObjectData.addTile(480); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); - TileObjectData.newTile.Height = 3; - TileObjectData.newTile.Origin = new Point16(1, 2); - TileObjectData.newTile.CoordinateHeights = new int[3] - { - 16, - 16, - 16 - }; - TileObjectData.addTile(509); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); - TileObjectData.newTile.Height = 3; - TileObjectData.newTile.Origin = new Point16(1, 2); - TileObjectData.newTile.CoordinateHeights = new int[3] - { - 16, - 16, - 16 - }; - TileObjectData.addTile(489); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.newTile.StyleWrapLimit = 7; - TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; - TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; - TileObjectData.addAlternate(7); TileObjectData.addTile(349); TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); TileObjectData.addTile(337); TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); - TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.Table | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.addTile(560); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); TileObjectData.newTile.Height = 3; TileObjectData.newTile.Origin = new Point16(0, 0); TileObjectData.newTile.AnchorBottom = new AnchorData(); TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.SolidBottom, TileObjectData.newTile.Width, 0); TileObjectData.newTile.LavaDeath = true; - TileObjectData.newTile.DrawYOffset = -2; TileObjectData.addTile(465); TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); - TileObjectData.newTile.Height = 3; - TileObjectData.newTile.Origin = new Point16(0, 0); - TileObjectData.newTile.AnchorBottom = new AnchorData(); - TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.SolidBottom, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.LavaDeath = true; - TileObjectData.addTile(531); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); TileObjectData.addTile(320); TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); TileObjectData.addTile(456); TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(TETrainingDummy.Hook_AfterPlacement), -1, 0, false); + TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(TETrainingDummy.Hook_AfterPlacement), -1, 0, false); TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; TileObjectData.newTile.StyleMultiplier = 2; TileObjectData.newTile.StyleWrapLimit = 2; @@ -2134,23 +1864,8 @@ namespace Terraria.ObjectData TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); TileObjectData.newTile.DrawYOffset = 2; TileObjectData.newTile.StyleWrapLimit = 55; - TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; - TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; - TileObjectData.addAlternate(165); TileObjectData.addTile(105); TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); - TileObjectData.newTile.Origin = new Point16(0, 2); - TileObjectData.newTile.RandomStyleRange = 2; - TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; - TileObjectData.newTile.StyleWrapLimit = 2; - TileObjectData.newTile.StyleMultiplier = 2; - TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; - TileObjectData.addAlternate(2); - TileObjectData.addTile(545); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); - TileObjectData.newTile.DrawYOffset = 2; TileObjectData.newTile.Height = 5; TileObjectData.newTile.Origin = new Point16(0, 4); TileObjectData.newTile.CoordinateHeights = new int[5] @@ -2178,53 +1893,11 @@ namespace Terraria.ObjectData TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); TileObjectData.newTile.Origin = new Point16(0, 2); TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; - TileObjectData.newTile.LavaDeath = true; - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; - TileObjectData.addAlternate(1); - TileObjectData.addTile(506); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); - TileObjectData.newTile.Origin = new Point16(0, 2); - TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; TileObjectData.addAlternate(1); TileObjectData.newTile.LavaDeath = true; TileObjectData.addTile(269); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); - TileObjectData.newTile.LavaDeath = false; - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.newTile.Origin = new Point16(0, 2); - TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; - TileObjectData.newTile.DrawStyleOffset = 4; - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(TEDisplayDoll.Hook_AfterPlacement), -1, 0, false); - TileObjectData.newTile.AnchorInvalidTiles = new int[3] - { - (int) sbyte.MaxValue, - 138, - 484 - }; - TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; - TileObjectData.addAlternate(1); - TileObjectData.addTile(470); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); - TileObjectData.newTile.Height = 3; - TileObjectData.newTile.Origin = new Point16(0, 0); - TileObjectData.newTile.AnchorBottom = new AnchorData(); - TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.SolidBottom, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.LavaDeath = true; - TileObjectData.newTile.DrawYOffset = -2; - TileObjectData.addTile(591); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); - TileObjectData.newTile.Height = 3; - TileObjectData.newTile.Origin = new Point16(0, 0); - TileObjectData.newTile.AnchorBottom = new AnchorData(); - TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.SolidBottom, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.LavaDeath = true; - TileObjectData.newTile.DrawYOffset = -2; - TileObjectData.addTile(592); TileObjectData.newTile.Width = 3; TileObjectData.newTile.Height = 3; TileObjectData.newTile.Origin = new Point16(1, 2); @@ -2240,66 +1913,6 @@ namespace Terraria.ObjectData TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.addBaseTile(out TileObjectData.Style3x3); TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); - TileObjectData.newTile.Height = 6; - TileObjectData.newTile.Origin = new Point16(1, 5); - TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.CoordinateHeights = new int[6] - { - 16, - 16, - 16, - 16, - 16, - 16 - }; - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.newTile.LavaDeath = true; - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.newSubTile.CopyFrom(TileObjectData.newTile); - TileObjectData.newSubTile.LavaDeath = false; - TileObjectData.newSubTile.LavaPlacement = LiquidPlacement.Allowed; - TileObjectData.addSubTile(7); - TileObjectData.newSubTile.CopyFrom(TileObjectData.newTile); - TileObjectData.newSubTile.LavaDeath = false; - TileObjectData.newSubTile.LavaPlacement = LiquidPlacement.Allowed; - TileObjectData.addSubTile(8); - TileObjectData.addTile(548); - TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); - TileObjectData.newTile.Height = 5; - TileObjectData.newTile.Origin = new Point16(1, 4); - TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.CoordinateHeights = new int[5] - { - 16, - 16, - 16, - 16, - 16 - }; - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.newTile.LavaDeath = false; - TileObjectData.newTile.LavaPlacement = LiquidPlacement.Allowed; - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.addTile(613); - TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); - TileObjectData.newTile.Height = 6; - TileObjectData.newTile.Origin = new Point16(1, 5); - TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.CoordinateHeights = new int[6] - { - 16, - 16, - 16, - 16, - 16, - 16 - }; - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.newTile.LavaDeath = false; - TileObjectData.newTile.LavaPlacement = LiquidPlacement.Allowed; - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.addTile(614); - TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); TileObjectData.newTile.Origin = new Point16(1, 0); TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide, 1, 1); TileObjectData.newTile.AnchorBottom = AnchorData.Empty; @@ -2307,7 +1920,6 @@ namespace Terraria.ObjectData TileObjectData.newTile.StyleWrapLimit = 37; TileObjectData.newTile.StyleHorizontal = false; TileObjectData.newTile.StyleLineSkip = 2; - TileObjectData.newTile.DrawYOffset = -2; TileObjectData.newSubTile.CopyFrom(TileObjectData.newTile); TileObjectData.newSubTile.LavaDeath = false; TileObjectData.newSubTile.LavaPlacement = LiquidPlacement.Allowed; @@ -2319,7 +1931,6 @@ namespace Terraria.ObjectData TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide, 1, 1); TileObjectData.newTile.AnchorBottom = AnchorData.Empty; TileObjectData.newTile.LavaDeath = true; - TileObjectData.newTile.DrawYOffset = -2; TileObjectData.addTile(454); TileObjectData.newTile.Width = 3; TileObjectData.newTile.Height = 2; @@ -2363,14 +1974,11 @@ namespace Terraria.ObjectData }; TileObjectData.addTile(469); TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.StyleWrapLimitVisualOverride = new int?(37); - TileObjectData.newTile.HookCheckIfCanPlace = new PlacementHook(new Func(Chest.FindEmptyChest), -1, 0, true); - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(Chest.AfterPlacement_Hook), -1, 0, false); - TileObjectData.newTile.AnchorInvalidTiles = new int[3] + TileObjectData.newTile.HookCheck = new PlacementHook(new Func(Chest.FindEmptyChest), -1, 0, true); + TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(Chest.AfterPlacement_Hook), -1, 0, false); + TileObjectData.newTile.AnchorInvalidTiles = new int[1] { - (int) sbyte.MaxValue, - 138, - 484 + (int) sbyte.MaxValue }; TileObjectData.newTile.LavaDeath = false; TileObjectData.newSubTile.CopyFrom(TileObjectData.newTile); @@ -2399,26 +2007,12 @@ namespace Terraria.ObjectData TileObjectData.newTile.DrawYOffset = 2; TileObjectData.addTile(377); TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.StyleWrapLimitVisualOverride = new int?(37); TileObjectData.newSubTile.CopyFrom(TileObjectData.newTile); TileObjectData.newSubTile.LavaDeath = false; TileObjectData.newSubTile.LavaPlacement = LiquidPlacement.Allowed; TileObjectData.addSubTile(15); TileObjectData.addTile(87); TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.LavaDeath = false; - TileObjectData.newTile.CoordinateHeights = new int[2] - { - 16, - 18 - }; - TileObjectData.addTile(486); - TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.LavaDeath = false; - TileObjectData.addTile(488); - TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.newTile.StyleWrapLimitVisualOverride = new int?(37); TileObjectData.newSubTile.CopyFrom(TileObjectData.newTile); TileObjectData.newSubTile.LavaDeath = false; TileObjectData.newSubTile.LavaPlacement = LiquidPlacement.Allowed; @@ -2432,27 +2026,10 @@ namespace Terraria.ObjectData TileObjectData.newTile.DrawYOffset = 2; TileObjectData.addTile(186); TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.StyleWrapLimit = 35; TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.DrawYOffset = 2; TileObjectData.addTile(187); TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.AnchorValidTiles = new int[4] - { - 53, - 112, - 234, - 116 - }; - TileObjectData.newTile.WaterDeath = true; - TileObjectData.newTile.LavaDeath = true; - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.newTile.WaterPlacement = LiquidPlacement.NotAllowed; - TileObjectData.newTile.LavaPlacement = LiquidPlacement.NotAllowed; - TileObjectData.newTile.RandomStyleRange = 4; - TileObjectData.addTile(552); - TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.StyleWrapLimit = 14; TileObjectData.newTile.WaterPlacement = LiquidPlacement.NotAllowed; TileObjectData.newTile.LavaPlacement = LiquidPlacement.NotAllowed; TileObjectData.newTile.WaterDeath = true; @@ -2466,22 +2043,6 @@ namespace Terraria.ObjectData TileObjectData.newSubTile.WaterDeath = false; TileObjectData.newSubTile.WaterPlacement = LiquidPlacement.Allowed; TileObjectData.addSubTile(4); - TileObjectData.newSubTile.CopyFrom(TileObjectData.newTile); - TileObjectData.newSubTile.WaterDeath = false; - TileObjectData.newSubTile.WaterPlacement = LiquidPlacement.Allowed; - TileObjectData.addSubTile(9); - TileObjectData.newSubTile.CopyFrom(TileObjectData.newTile); - TileObjectData.newSubTile.WaterDeath = false; - TileObjectData.newSubTile.WaterPlacement = LiquidPlacement.Allowed; - TileObjectData.addSubTile(1 + TileObjectData.newTile.StyleWrapLimit); - TileObjectData.newSubTile.CopyFrom(TileObjectData.newTile); - TileObjectData.newSubTile.WaterDeath = false; - TileObjectData.newSubTile.WaterPlacement = LiquidPlacement.Allowed; - TileObjectData.addSubTile(4 + TileObjectData.newTile.StyleWrapLimit); - TileObjectData.newSubTile.CopyFrom(TileObjectData.newTile); - TileObjectData.newSubTile.WaterDeath = false; - TileObjectData.newSubTile.WaterPlacement = LiquidPlacement.Allowed; - TileObjectData.addSubTile(9 + TileObjectData.newTile.StyleWrapLimit); TileObjectData.addTile(215); TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); TileObjectData.newTile.DrawYOffset = 2; @@ -2546,56 +2107,19 @@ namespace Terraria.ObjectData TileObjectData.newTile.LavaDeath = true; TileObjectData.addBaseTile(out TileObjectData.Style3x4); TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); - TileObjectData.newTile.StyleWrapLimitVisualOverride = new int?(37); TileObjectData.newSubTile.CopyFrom(TileObjectData.newTile); TileObjectData.newSubTile.LavaDeath = false; TileObjectData.newSubTile.LavaPlacement = LiquidPlacement.Allowed; TileObjectData.addSubTile(4); TileObjectData.addTile(101); TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); - TileObjectData.newTile.DrawYOffset = 2; TileObjectData.addTile(102); TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); TileObjectData.newTile.DrawYOffset = 2; TileObjectData.addTile(463); - TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); - TileObjectData.newTile.LavaDeath = false; - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(TEHatRack.Hook_AfterPlacement), -1, 0, false); - TileObjectData.newTile.AnchorInvalidTiles = new int[3] - { - (int) sbyte.MaxValue, - 138, - 484 - }; - TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; - TileObjectData.addAlternate(1); - TileObjectData.addTile(475); - TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); - TileObjectData.newTile.LavaDeath = false; - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.newTile.HookCheckIfCanPlace = new PlacementHook(new Func(TETeleportationPylon.PlacementPreviewHook_CheckIfCanPlace), 1, 0, true); - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(TETeleportationPylon.PlacementPreviewHook_AfterPlacement), -1, 0, false); - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.addTile(597); - TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); - TileObjectData.newTile.LavaDeath = false; - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; - TileObjectData.newTile.StyleHorizontal = false; - TileObjectData.newTile.StyleWrapLimitVisualOverride = new int?(2); - TileObjectData.newTile.StyleMultiplier = 2; - TileObjectData.newTile.StyleWrapLimit = 2; - TileObjectData.newTile.styleLineSkipVisualOverride = new int?(0); - TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; - TileObjectData.addAlternate(1); - TileObjectData.addTile(617); TileObjectData.newTile.Width = 2; TileObjectData.newTile.Height = 2; - TileObjectData.newTile.Origin = new Point16(0, 1); + TileObjectData.newTile.Origin = new Point16(1, 1); TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.Table | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); TileObjectData.newTile.UsesCustomCanPlace = true; TileObjectData.newTile.CoordinateHeights = new int[2] @@ -2614,13 +2138,11 @@ namespace Terraria.ObjectData 16, 18 }; - TileObjectData.newTile.HookCheckIfCanPlace = new PlacementHook(new Func(Chest.FindEmptyChest), -1, 0, true); - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(Chest.AfterPlacement_Hook), -1, 0, false); - TileObjectData.newTile.AnchorInvalidTiles = new int[3] + TileObjectData.newTile.HookCheck = new PlacementHook(new Func(Chest.FindEmptyChest), -1, 0, true); + TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(Chest.AfterPlacement_Hook), -1, 0, false); + TileObjectData.newTile.AnchorInvalidTiles = new int[1] { - (int) sbyte.MaxValue, - 138, - 484 + (int) sbyte.MaxValue }; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.LavaDeath = false; @@ -2633,13 +2155,11 @@ namespace Terraria.ObjectData 16, 18 }; - TileObjectData.newTile.HookCheckIfCanPlace = new PlacementHook(new Func(Chest.FindEmptyChest), -1, 0, true); - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(Chest.AfterPlacement_Hook), -1, 0, false); - TileObjectData.newTile.AnchorInvalidTiles = new int[3] + TileObjectData.newTile.HookCheck = new PlacementHook(new Func(Chest.FindEmptyChest), -1, 0, true); + TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(Chest.AfterPlacement_Hook), -1, 0, false); + TileObjectData.newTile.AnchorInvalidTiles = new int[1] { - (int) sbyte.MaxValue, - 138, - 484 + (int) sbyte.MaxValue }; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.LavaDeath = false; @@ -2652,11 +2172,9 @@ namespace Terraria.ObjectData 16, 18 }; - TileObjectData.newTile.AnchorInvalidTiles = new int[3] + TileObjectData.newTile.AnchorInvalidTiles = new int[1] { - (int) sbyte.MaxValue, - 138, - 484 + (int) sbyte.MaxValue }; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.LavaDeath = false; @@ -2669,11 +2187,9 @@ namespace Terraria.ObjectData 16, 18 }; - TileObjectData.newTile.AnchorInvalidTiles = new int[3] + TileObjectData.newTile.AnchorInvalidTiles = new int[1] { - (int) sbyte.MaxValue, - 138, - 484 + (int) sbyte.MaxValue }; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.LavaDeath = false; @@ -2685,12 +2201,10 @@ namespace Terraria.ObjectData TileObjectData.newTile.StyleWrapLimit = 6; TileObjectData.newTile.StyleMultiplier = 6; TileObjectData.newTile.RandomStyleRange = 6; - TileObjectData.newTile.AnchorValidTiles = new int[4] + TileObjectData.newTile.AnchorValidTiles = new int[2] { 2, - 477, - 109, - 492 + 109 }; TileObjectData.addTile(254); TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); @@ -2698,14 +2212,6 @@ namespace Terraria.ObjectData TileObjectData.newTile.StyleHorizontal = true; TileObjectData.addTile(96); TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.StyleWrapLimit = 4; - TileObjectData.newTile.StyleMultiplier = 1; - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.newTile.AnchorValidTiles = Utils.GetTrueIndexes(TileID.Sets.Conversion.Sand, TileID.Sets.Conversion.Sandstone, TileID.Sets.Conversion.HardenedSand).ToArray(); - TileObjectData.addTile(485); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.Origin = new Point16(0, 1); TileObjectData.newTile.DrawYOffset = 2; TileObjectData.newTile.RandomStyleRange = 5; @@ -2713,15 +2219,8 @@ namespace Terraria.ObjectData TileObjectData.addTile(457); TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.Origin = new Point16(0, 1); - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.addTile(490); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.Origin = new Point16(0, 1); TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.newTile.StyleWrapLimitVisualOverride = new int?(56); - TileObjectData.newTile.styleLineSkipVisualOverride = new int?(2); TileObjectData.addTile(139); TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.Origin = new Point16(0, 1); @@ -2731,19 +2230,16 @@ namespace Terraria.ObjectData TileObjectData.newTile.Origin = new Point16(1, 0); TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide, 2, 0); TileObjectData.newTile.AnchorBottom = AnchorData.Empty; - TileObjectData.newTile.DrawYOffset = -2; TileObjectData.addTile(95); TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.Origin = new Point16(1, 0); TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide, 2, 0); TileObjectData.newTile.AnchorBottom = AnchorData.Empty; - TileObjectData.newTile.DrawYOffset = -2; TileObjectData.addTile(126); TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.Origin = new Point16(1, 0); TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide, 2, 0); TileObjectData.newTile.AnchorBottom = AnchorData.Empty; - TileObjectData.newTile.DrawYOffset = -2; TileObjectData.addTile(444); TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.WaterDeath = true; @@ -2762,7 +2258,6 @@ namespace Terraria.ObjectData TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.addTile(94); TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.LavaDeath = false; TileObjectData.addTile(411); TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.addTile(97); @@ -2779,12 +2274,6 @@ namespace Terraria.ObjectData TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.addTile(125); TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.addTile(621); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.addTile(622); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.addTile(173); TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.addTile(287); @@ -2809,14 +2298,6 @@ namespace Terraria.ObjectData TileObjectData.newTile.LavaDeath = false; TileObjectData.addTile(138); TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.CoordinateHeights = new int[2] - { - 16, - 16 - }; - TileObjectData.newTile.LavaDeath = true; - TileObjectData.addTile(484); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.DrawYOffset = 2; TileObjectData.addTile(142); @@ -2825,24 +2306,8 @@ namespace Terraria.ObjectData TileObjectData.newTile.DrawYOffset = 2; TileObjectData.addTile(143); TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.DrawYOffset = 2; TileObjectData.addTile(282); TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.addTile(543); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.addTile(598); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.addTile(568); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.addTile(569); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.addTile(570); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.addTile(288); TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.addTile(289); @@ -2866,43 +2331,10 @@ namespace Terraria.ObjectData TileObjectData.addTile(318); TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.addTile(360); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.addTile(580); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.addTile(620); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.addTile(565); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.addTile(521); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.addTile(522); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.addTile(523); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.addTile(524); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.addTile(525); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.addTile(526); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.addTile(527); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.addTile(505); TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3); TileObjectData.addTile(358); TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3); TileObjectData.addTile(359); - TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3); - TileObjectData.addTile(542); TileObjectData.newTile.CopyFrom(TileObjectData.StyleSmallCage); TileObjectData.addTile(361); TileObjectData.newTile.CopyFrom(TileObjectData.StyleSmallCage); @@ -2912,8 +2344,6 @@ namespace Terraria.ObjectData TileObjectData.newTile.CopyFrom(TileObjectData.StyleSmallCage); TileObjectData.addTile(364); TileObjectData.newTile.CopyFrom(TileObjectData.StyleSmallCage); - TileObjectData.addTile(544); - TileObjectData.newTile.CopyFrom(TileObjectData.StyleSmallCage); TileObjectData.addTile(391); TileObjectData.newTile.CopyFrom(TileObjectData.StyleSmallCage); TileObjectData.addTile(392); @@ -2925,21 +2355,12 @@ namespace Terraria.ObjectData TileObjectData.addTile(287); TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.addTile(335); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.addTile(564); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.addTile(594); TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); TileObjectData.newTile.DrawYOffset = 2; TileObjectData.addTile(354); TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); TileObjectData.newTile.DrawYOffset = 2; TileObjectData.addTile(355); - TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.addTile(491); TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); TileObjectData.addTile(356); TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); @@ -3010,80 +2431,8 @@ namespace Terraria.ObjectData TileObjectData.newAlternate.AnchorWall = true; TileObjectData.newAlternate.AnchorBottom = AnchorData.Empty; TileObjectData.addAlternate(4); - TileObjectData.addTile(573); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.Origin = Point16.Zero; - TileObjectData.newAlternate.AnchorTop = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide, 2, 0); - TileObjectData.newAlternate.AnchorBottom = AnchorData.Empty; - TileObjectData.addAlternate(1); - TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.Origin = new Point16(0, 0); - TileObjectData.newAlternate.AnchorLeft = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide, 2, 0); - TileObjectData.newAlternate.AnchorBottom = AnchorData.Empty; - TileObjectData.addAlternate(2); - TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.Origin = new Point16(1, 0); - TileObjectData.newAlternate.AnchorRight = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide, 2, 0); - TileObjectData.newAlternate.AnchorBottom = AnchorData.Empty; - TileObjectData.addAlternate(3); - TileObjectData.newTile.Origin = new Point16(0, 1); - TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.Origin = Point16.Zero; - TileObjectData.newAlternate.AnchorWall = true; - TileObjectData.newAlternate.AnchorBottom = AnchorData.Empty; - TileObjectData.addAlternate(4); TileObjectData.addTile(425); TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.Origin = Point16.Zero; - TileObjectData.newAlternate.AnchorTop = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide, 2, 0); - TileObjectData.newAlternate.AnchorBottom = AnchorData.Empty; - TileObjectData.addAlternate(1); - TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.Origin = new Point16(0, 0); - TileObjectData.newAlternate.AnchorLeft = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide, 2, 0); - TileObjectData.newAlternate.AnchorBottom = AnchorData.Empty; - TileObjectData.addAlternate(2); - TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.Origin = new Point16(1, 0); - TileObjectData.newAlternate.AnchorRight = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide, 2, 0); - TileObjectData.newAlternate.AnchorBottom = AnchorData.Empty; - TileObjectData.addAlternate(3); - TileObjectData.newTile.Origin = new Point16(0, 1); - TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.Origin = Point16.Zero; - TileObjectData.newAlternate.AnchorWall = true; - TileObjectData.newAlternate.AnchorBottom = AnchorData.Empty; - TileObjectData.addAlternate(4); - TileObjectData.addTile(510); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.Origin = Point16.Zero; - TileObjectData.newAlternate.AnchorTop = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide, 2, 0); - TileObjectData.newAlternate.AnchorBottom = AnchorData.Empty; - TileObjectData.addAlternate(1); - TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.Origin = new Point16(0, 0); - TileObjectData.newAlternate.AnchorLeft = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide, 2, 0); - TileObjectData.newAlternate.AnchorBottom = AnchorData.Empty; - TileObjectData.addAlternate(2); - TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.Origin = new Point16(1, 0); - TileObjectData.newAlternate.AnchorRight = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide, 2, 0); - TileObjectData.newAlternate.AnchorBottom = AnchorData.Empty; - TileObjectData.addAlternate(3); - TileObjectData.newTile.Origin = new Point16(0, 1); - TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.Origin = Point16.Zero; - TileObjectData.newAlternate.AnchorWall = true; - TileObjectData.newAlternate.AnchorBottom = AnchorData.Empty; - TileObjectData.addAlternate(4); - TileObjectData.addTile(511); - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.Origin = new Point16(0, 1); TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.DrawYOffset = 2; @@ -3091,7 +2440,7 @@ namespace Terraria.ObjectData TileObjectData.addTile(85); TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(TEItemFrame.Hook_AfterPlacement), -1, 0, true); + TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(TEItemFrame.Hook_AfterPlacement), -1, 0, true); TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); TileObjectData.newAlternate.Origin = Point16.Zero; TileObjectData.newAlternate.AnchorTop = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide, 2, 0); @@ -3197,9 +2546,6 @@ namespace Terraria.ObjectData TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); TileObjectData.newTile.DrawYOffset = 2; TileObjectData.addTile(455); - TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.addTile(499); TileObjectData.newTile.Width = 1; TileObjectData.newTile.Height = 2; TileObjectData.newTile.Origin = new Point16(0, 1); @@ -3236,54 +2582,15 @@ namespace Terraria.ObjectData TileObjectData.addTile(15); TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); TileObjectData.newTile.CoordinateHeights = new int[2] - { - 16, - 18 - }; - TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; - TileObjectData.newTile.StyleWrapLimit = 2; - TileObjectData.newTile.StyleMultiplier = 2; - TileObjectData.newTile.CoordinatePaddingFix = new Point16(0, 2); - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; - TileObjectData.addAlternate(1); - TileObjectData.newSubTile.CopyFrom(TileObjectData.newTile); - TileObjectData.newSubTile.LinkedAlternates = true; - TileObjectData.newSubTile.LavaDeath = false; - TileObjectData.newSubTile.LavaPlacement = LiquidPlacement.Allowed; - TileObjectData.addSubTile(14); - TileObjectData.addTile(497); - TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); - TileObjectData.newTile.CoordinateHeights = new int[2] { 16, 20 }; TileObjectData.addTile(216); TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); - TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.Table | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); TileObjectData.addTile(390); TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); TileObjectData.addTile(338); - TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.newTile.StyleWrapLimit = 6; - TileObjectData.newTile.DrawStyleOffset = 13 * TileObjectData.newTile.StyleWrapLimit; - TileObjectData.addTile(493); - TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); - TileObjectData.newTile.RandomStyleRange = 5; - TileObjectData.newTile.CoordinateHeights = new int[2] - { - 18, - 18 - }; - TileObjectData.newTile.CoordinateWidth = 26; - TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.newTile.DrawFlipHorizontal = true; - TileObjectData.addTile(567); TileObjectData.newTile.Width = 1; TileObjectData.newTile.Height = 1; TileObjectData.newTile.Origin = new Point16(0, 0); @@ -3302,15 +2609,6 @@ namespace Terraria.ObjectData TileObjectData.newTile.LavaDeath = false; TileObjectData.addTile(420); TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); - TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.Table, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.CoordinateHeights = new int[1] - { - 18 - }; - TileObjectData.newTile.CoordinateWidth = 20; - TileObjectData.newTile.LavaDeath = false; - TileObjectData.addTile(476); - TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.AlternateTile, TileObjectData.newTile.Width, 0); TileObjectData.newTile.AnchorAlternateTiles = new int[2] @@ -3318,6 +2616,7 @@ namespace Terraria.ObjectData 420, 419 }; + TileObjectData.newAlternate.UsesCustomCanPlace = true; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); TileObjectData.newAlternate.Origin = new Point16(0, 1); @@ -3329,7 +2628,7 @@ namespace Terraria.ObjectData TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.None, 0, 0); TileObjectData.newTile.LavaDeath = false; - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(TELogicSensor.Hook_AfterPlacement), -1, 0, true); + TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(TELogicSensor.Hook_AfterPlacement), -1, 0, true); TileObjectData.addTile(423); TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.None, 0, 0); @@ -3346,8 +2645,6 @@ namespace Terraria.ObjectData TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.EmptyTile, TileObjectData.newTile.Width, 0); TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.UsesCustomCanPlace = true; - TileObjectData.newTile.DrawFlipHorizontal = true; TileObjectData.newTile.CoordinateHeights = new int[1] { 26 @@ -3395,8 +2692,6 @@ namespace Terraria.ObjectData TileObjectData.newTile.RandomStyleRange = 7; TileObjectData.addTile(36); TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); - TileObjectData.newTile.UsesCustomCanPlace = true; - TileObjectData.newTile.DrawFlipHorizontal = true; TileObjectData.newTile.RandomStyleRange = 3; TileObjectData.newTile.StyleMultiplier = 3; TileObjectData.newTile.StyleWrapLimit = 3; @@ -3409,15 +2704,6 @@ namespace Terraria.ObjectData TileObjectData.newTile.DrawYOffset = -2; TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.Table | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); TileObjectData.addTile(324); - TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); - TileObjectData.newTile.CoordinateHeights = new int[1] - { - 16 - }; - TileObjectData.newTile.CoordinateWidth = 16; - TileObjectData.newTile.DrawYOffset = 2; - TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.Table | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); - TileObjectData.addTile(593); TileObjectData.newTile.Width = 1; TileObjectData.newTile.Height = 1; TileObjectData.newTile.Origin = new Point16(0, 0); @@ -3435,36 +2721,21 @@ namespace Terraria.ObjectData TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); TileObjectData.newAlternate.CopyFrom(TileObjectData.StyleSwitch); TileObjectData.newAlternate.AnchorLeft = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.Tree | AnchorType.AlternateTile, TileObjectData.newTile.Height, 0); - TileObjectData.newAlternate.AnchorAlternateTiles = new int[7] + TileObjectData.newAlternate.AnchorAlternateTiles = new int[1] { - 124, - 561, - 574, - 575, - 576, - 577, - 578 + 124 }; - TileObjectData.newAlternate.DrawXOffset = -2; TileObjectData.addAlternate(1); TileObjectData.newAlternate.CopyFrom(TileObjectData.StyleSwitch); TileObjectData.newAlternate.AnchorRight = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.Tree | AnchorType.AlternateTile, TileObjectData.newTile.Height, 0); - TileObjectData.newAlternate.AnchorAlternateTiles = new int[7] + TileObjectData.newAlternate.AnchorAlternateTiles = new int[1] { - 124, - 561, - 574, - 575, - 576, - 577, - 578 + 124 }; - TileObjectData.newAlternate.DrawXOffset = 2; TileObjectData.addAlternate(2); TileObjectData.newAlternate.CopyFrom(TileObjectData.StyleSwitch); TileObjectData.newAlternate.AnchorWall = true; TileObjectData.addAlternate(3); - TileObjectData.newTile.DrawYOffset = 2; TileObjectData.addTile(136); TileObjectData.newTile.Width = 1; TileObjectData.newTile.Height = 1; @@ -3490,28 +2761,16 @@ namespace Terraria.ObjectData TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); TileObjectData.newAlternate.CopyFrom(TileObjectData.StyleTorch); TileObjectData.newAlternate.AnchorLeft = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.Tree | AnchorType.AlternateTile, TileObjectData.newTile.Height, 0); - TileObjectData.newAlternate.AnchorAlternateTiles = new int[7] + TileObjectData.newAlternate.AnchorAlternateTiles = new int[1] { - 124, - 561, - 574, - 575, - 576, - 577, - 578 + 124 }; TileObjectData.addAlternate(1); TileObjectData.newAlternate.CopyFrom(TileObjectData.StyleTorch); TileObjectData.newAlternate.AnchorRight = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.Tree | AnchorType.AlternateTile, TileObjectData.newTile.Height, 0); - TileObjectData.newAlternate.AnchorAlternateTiles = new int[7] + TileObjectData.newAlternate.AnchorAlternateTiles = new int[1] { - 124, - 561, - 574, - 575, - 576, - 577, - 578 + 124 }; TileObjectData.addAlternate(2); TileObjectData.newAlternate.CopyFrom(TileObjectData.StyleTorch); @@ -3531,13 +2790,6 @@ namespace Terraria.ObjectData TileObjectData.newSubTile.WaterPlacement = LiquidPlacement.Allowed; TileObjectData.newSubTile.LavaPlacement = LiquidPlacement.Allowed; TileObjectData.addSubTile(11); - TileObjectData.newSubTile.CopyFrom(TileObjectData.newTile); - TileObjectData.newSubTile.LinkedAlternates = true; - TileObjectData.newSubTile.WaterDeath = false; - TileObjectData.newSubTile.LavaDeath = false; - TileObjectData.newSubTile.WaterPlacement = LiquidPlacement.Allowed; - TileObjectData.newSubTile.LavaPlacement = LiquidPlacement.Allowed; - TileObjectData.addSubTile(17); TileObjectData.addTile(4); TileObjectData.newTile.Width = 1; TileObjectData.newTile.Height = 1; @@ -3556,43 +2808,25 @@ namespace Terraria.ObjectData TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.StyleWrapLimit = 4; TileObjectData.newTile.StyleMultiplier = 4; - TileObjectData.newTile.HookCheckIfCanPlace = new PlacementHook(new Func(WorldGen.CanPlaceProjectilePressurePad), -1, 0, true); TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.AnchorTop = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.Table | AnchorType.SolidSide | AnchorType.Tree | AnchorType.AlternateTile | AnchorType.EmptyTile | AnchorType.SolidBottom, TileObjectData.newTile.Width, 0); - TileObjectData.newAlternate.DrawStepDown = 0; - TileObjectData.newAlternate.DrawYOffset = -4; + TileObjectData.newAlternate.AnchorTop = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.SolidBottom, TileObjectData.newTile.Width, 0); + TileObjectData.newAlternate.DrawStepDown = -4; TileObjectData.addAlternate(1); TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.AnchorLeft = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.Table | AnchorType.SolidSide | AnchorType.Tree | AnchorType.AlternateTile | AnchorType.EmptyTile | AnchorType.SolidBottom, TileObjectData.newTile.Height, 0); - TileObjectData.newAlternate.AnchorAlternateTiles = new int[7] + TileObjectData.newAlternate.AnchorLeft = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.Tree | AnchorType.AlternateTile, TileObjectData.newTile.Height, 0); + TileObjectData.newAlternate.AnchorAlternateTiles = new int[1] { - 124, - 561, - 574, - 575, - 576, - 577, - 578 + 124 }; - TileObjectData.newAlternate.DrawXOffset = -2; - TileObjectData.newAlternate.DrawYOffset = -2; TileObjectData.addAlternate(2); TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.AnchorRight = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.Table | AnchorType.SolidSide | AnchorType.Tree | AnchorType.AlternateTile | AnchorType.EmptyTile | AnchorType.SolidBottom, TileObjectData.newTile.Height, 0); - TileObjectData.newAlternate.AnchorAlternateTiles = new int[7] + TileObjectData.newAlternate.AnchorRight = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.Tree | AnchorType.AlternateTile, TileObjectData.newTile.Height, 0); + TileObjectData.newAlternate.AnchorAlternateTiles = new int[1] { - 124, - 561, - 574, - 575, - 576, - 577, - 578 + 124 }; - TileObjectData.newAlternate.DrawXOffset = 2; - TileObjectData.newAlternate.DrawYOffset = -2; TileObjectData.addAlternate(3); - TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.Table | AnchorType.SolidSide | AnchorType.Tree | AnchorType.AlternateTile | AnchorType.EmptyTile | AnchorType.SolidBottom, TileObjectData.newTile.Width, 0); + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); TileObjectData.addTile(442); TileObjectData.newTile.Width = 1; TileObjectData.newTile.Height = 1; @@ -3612,12 +2846,10 @@ namespace Terraria.ObjectData TileObjectData.newTile.LavaPlacement = LiquidPlacement.NotAllowed; TileObjectData.addBaseTile(out TileObjectData.StyleAlch); TileObjectData.newTile.CopyFrom(TileObjectData.StyleAlch); - TileObjectData.newTile.AnchorValidTiles = new int[4] + TileObjectData.newTile.AnchorValidTiles = new int[2] { 2, - 477, - 109, - 492 + 109 }; TileObjectData.newTile.AnchorAlternateTiles = new int[1] { @@ -3733,15 +2965,6 @@ namespace Terraria.ObjectData TileObjectData.addAlternate(1); TileObjectData.addTile(334); TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3Wall); - TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.newTile.LavaDeath = false; - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(TEWeaponsRack.Hook_AfterPlacement), -1, 0, true); - TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; - TileObjectData.addAlternate(1); - TileObjectData.addTile(471); - TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3Wall); TileObjectData.newTile.Width = 2; TileObjectData.newTile.Height = 3; TileObjectData.newTile.Origin = new Point16(0, 1); @@ -3779,6 +3002,7 @@ namespace Terraria.ObjectData TileObjectData.newTile.Width = 2; TileObjectData.newTile.Height = 4; TileObjectData.newTile.Origin = new Point16(0, 3); + TileObjectData.newTile.AnchorWall = true; TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0); TileObjectData.newTile.UsesCustomCanPlace = true; TileObjectData.newTile.CoordinateHeights = new int[4] @@ -3790,18 +3014,15 @@ namespace Terraria.ObjectData }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.AnchorValidTiles = new int[5] + TileObjectData.newTile.AnchorValidWalls = new int[1]; + TileObjectData.newTile.AnchorValidTiles = new int[2] { 2, - 477, - 109, - 60, - 492 + 109 }; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.RandomStyleRange = 3; TileObjectData.newTile.LavaDeath = true; - TileObjectData.newTile.WaterPlacement = LiquidPlacement.NotAllowed; TileObjectData.addTile(27); TileObjectData.newTile.Width = 1; TileObjectData.newTile.Height = 2; @@ -3815,10 +3036,9 @@ namespace Terraria.ObjectData }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.AnchorValidTiles = new int[2] + TileObjectData.newTile.AnchorValidTiles = new int[1] { - 2, - 477 + 2 }; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.DrawFlipHorizontal = true; @@ -3850,10 +3070,9 @@ namespace Terraria.ObjectData }; TileObjectData.addAlternate(12); TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.AnchorValidTiles = new int[2] + TileObjectData.newAlternate.AnchorValidTiles = new int[1] { - 109, - 492 + 109 }; TileObjectData.addAlternate(15); TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); @@ -3881,103 +3100,6 @@ namespace Terraria.ObjectData }; TileObjectData.addAlternate(27); TileObjectData.addTile(20); - TileObjectData.newTile.Width = 1; - TileObjectData.newTile.Height = 2; - TileObjectData.newTile.Origin = new Point16(0, 1); - TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.UsesCustomCanPlace = true; - TileObjectData.newTile.CoordinateHeights = new int[2] - { - 16, - 18 - }; - TileObjectData.newTile.CoordinateWidth = 16; - TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.AnchorValidTiles = new int[14] - { - 1, - 25, - 117, - 203, - 539, - 182, - 180, - 179, - 381, - 183, - 181, - 534, - 536, - 539 - }; - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.newTile.DrawFlipHorizontal = true; - TileObjectData.newTile.WaterPlacement = LiquidPlacement.NotAllowed; - TileObjectData.newTile.LavaDeath = false; - TileObjectData.newTile.RandomStyleRange = 3; - TileObjectData.newTile.StyleMultiplier = 3; - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.addTile(590); - TileObjectData.newTile.Width = 1; - TileObjectData.newTile.Height = 2; - TileObjectData.newTile.Origin = new Point16(0, 1); - TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.UsesCustomCanPlace = true; - TileObjectData.newTile.CoordinateHeights = new int[2] - { - 16, - 18 - }; - TileObjectData.newTile.CoordinateWidth = 16; - TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.AnchorValidTiles = new int[7] - { - 2, - 477, - 492, - 60, - 109, - 199, - 23 - }; - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.newTile.DrawFlipHorizontal = true; - TileObjectData.newTile.WaterPlacement = LiquidPlacement.NotAllowed; - TileObjectData.newTile.LavaDeath = false; - TileObjectData.newTile.RandomStyleRange = 3; - TileObjectData.newTile.StyleMultiplier = 3; - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.addTile(595); - TileObjectData.newTile.Width = 1; - TileObjectData.newTile.Height = 2; - TileObjectData.newTile.Origin = new Point16(0, 1); - TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.UsesCustomCanPlace = true; - TileObjectData.newTile.CoordinateHeights = new int[2] - { - 16, - 18 - }; - TileObjectData.newTile.CoordinateWidth = 16; - TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.AnchorValidTiles = new int[7] - { - 2, - 477, - 492, - 60, - 109, - 199, - 23 - }; - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.newTile.DrawFlipHorizontal = true; - TileObjectData.newTile.WaterPlacement = LiquidPlacement.NotAllowed; - TileObjectData.newTile.LavaDeath = false; - TileObjectData.newTile.RandomStyleRange = 3; - TileObjectData.newTile.StyleMultiplier = 3; - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.addTile(615); TileObjectData.readOnlyData = true; } @@ -4131,7 +3253,6 @@ namespace Terraria.ObjectData int type, int style, int dir, - int alternate, TileObject data) { TileObjectData tileData = TileObjectData.GetTileData(type, style, data.alternate); @@ -4143,7 +3264,7 @@ namespace Terraria.ObjectData tileX -= (int) tileData.Origin.X; tileY -= (int) tileData.Origin.Y; } - return postPlaceMyPlayer.hook(tileX, tileY, type, style, dir, data.alternate) == postPlaceMyPlayer.badReturn; + return postPlaceMyPlayer.hook(tileX, tileY, type, style, dir) == postPlaceMyPlayer.badReturn; } public static void OriginToTopLeft(int type, int style, ref Point16 baseCoords) diff --git a/PartyHatColor.cs b/PartyHatColor.cs index eba4de5..4a32fe3 100644 --- a/PartyHatColor.cs +++ b/PartyHatColor.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.PartyHatColor -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria diff --git a/Physics/BallCollision.cs b/Physics/BallCollision.cs deleted file mode 100644 index 6bbaafe..0000000 --- a/Physics/BallCollision.cs +++ /dev/null @@ -1,371 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Physics.BallCollision -// 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; -using System; -using System.Diagnostics; -using Terraria.DataStructures; - -namespace Terraria.Physics -{ - public static class BallCollision - { - public static BallStepResult Step( - PhysicsProperties physicsProperties, - Entity entity, - ref float entityAngularVelocity, - IBallContactListener listener) - { - Vector2 position = entity.position; - Vector2 velocity1 = entity.velocity; - Vector2 size = entity.Size; - float num1 = entityAngularVelocity; - float num2 = size.X * 0.5f; - float num3 = num1 * physicsProperties.Drag; - Vector2 vector2_1 = velocity1 * physicsProperties.Drag; - float num4 = vector2_1.Length(); - if ((double) num4 > 1000.0) - { - vector2_1 = 1000f * Vector2.Normalize(vector2_1); - num4 = 1000f; - } - int num5 = Math.Max(1, (int) Math.Ceiling((double) num4 / 2.0)); - float timeScale = 1f / (float) num5; - Vector2 velocity2 = vector2_1 * timeScale; - float angularVelocity = num3 * timeScale; - float num6 = physicsProperties.Gravity / (float) (num5 * num5); - bool flag = false; - for (int index = 0; index < num5; ++index) - { - velocity2.Y += num6; - BallPassThroughType type; - Tile tile; - if (BallCollision.CheckForPassThrough(position + size * 0.5f, out type, out tile)) - { - if (type == BallPassThroughType.Tile && Main.tileSolid[(int) tile.type] && !Main.tileSolidTop[(int) tile.type]) - { - velocity2 *= 0.0f; - angularVelocity *= 0.0f; - flag = true; - } - else - { - BallPassThroughEvent passThrough = new BallPassThroughEvent(timeScale, tile, entity, type); - listener.OnPassThrough(physicsProperties, ref position, ref velocity2, ref angularVelocity, ref passThrough); - } - } - position += velocity2; - if (!BallCollision.IsBallInWorld(position, size)) - return BallStepResult.OutOfBounds(); - Vector2 collisionPoint; - if (BallCollision.GetClosestEdgeToCircle(position, size, velocity2, out collisionPoint, out tile)) - { - Vector2 normal = Vector2.Normalize(position + size * 0.5f - collisionPoint); - position = collisionPoint + normal * (num2 + 0.0001f) - size * 0.5f; - BallCollisionEvent collision = new BallCollisionEvent(timeScale, normal, collisionPoint, tile, entity); - flag = true; - velocity2 = Vector2.Reflect(velocity2, collision.Normal); - listener.OnCollision(physicsProperties, ref position, ref velocity2, ref collision); - angularVelocity = (float) ((double) collision.Normal.X * (double) velocity2.Y - (double) collision.Normal.Y * (double) velocity2.X) / num2; - } - } - Vector2 vector2_2 = velocity2 / timeScale; - float num7 = angularVelocity / timeScale; - BallStepResult ballStepResult = BallStepResult.Moving(); - if (flag && (double) vector2_2.X > -0.00999999977648258 && (double) vector2_2.X < 0.00999999977648258 && (double) vector2_2.Y <= 0.0 && (double) vector2_2.Y > -(double) physicsProperties.Gravity) - ballStepResult = BallStepResult.Resting(); - entity.position = position; - entity.velocity = vector2_2; - entityAngularVelocity = num7; - return ballStepResult; - } - - private static bool CheckForPassThrough( - Vector2 center, - out BallPassThroughType type, - out Tile contactTile) - { - Point tileCoordinates = center.ToTileCoordinates(); - Tile tile = Main.tile[tileCoordinates.X, tileCoordinates.Y]; - contactTile = tile; - type = BallPassThroughType.None; - if (tile == null) - return false; - if (tile.nactive()) - { - type = BallPassThroughType.Tile; - return BallCollision.IsPositionInsideTile(center, tileCoordinates, tile); - } - if (tile.liquid <= (byte) 0) - return false; - float num = (float) ((double) (tileCoordinates.Y + 1) * 16.0 - (double) tile.liquid / (double) byte.MaxValue * 16.0); - switch (tile.liquidType()) - { - case 1: - type = BallPassThroughType.Lava; - break; - case 2: - type = BallPassThroughType.Honey; - break; - default: - type = BallPassThroughType.Water; - break; - } - return (double) num < (double) center.Y; - } - - private static bool IsPositionInsideTile(Vector2 position, Point tileCoordinates, Tile tile) - { - if (tile.slope() == (byte) 0 && !tile.halfBrick()) - return true; - Vector2 vector2 = position / 16f - new Vector2((float) tileCoordinates.X, (float) tileCoordinates.Y); - switch (tile.slope()) - { - case 0: - return (double) vector2.Y > 0.5; - case 1: - return (double) vector2.Y > (double) vector2.X; - case 2: - return (double) vector2.Y > 1.0 - (double) vector2.X; - case 3: - return (double) vector2.Y < 1.0 - (double) vector2.X; - case 4: - return (double) vector2.Y < (double) vector2.X; - default: - return false; - } - } - - private static bool IsBallInWorld(Vector2 position, Vector2 size) => (double) position.X > 32.0 && (double) position.Y > 32.0 && (double) position.X + (double) size.X < (double) Main.maxTilesX * 16.0 - 32.0 && (double) position.Y + (double) size.Y < (double) Main.maxTilesY * 16.0 - 32.0; - - private static bool GetClosestEdgeToCircle( - Vector2 position, - Vector2 size, - Vector2 velocity, - out Vector2 collisionPoint, - out Tile collisionTile) - { - Rectangle tileBounds = BallCollision.GetTileBounds(position, size); - Vector2 center = position + size * 0.5f; - BallCollision.TileEdges tileEdges1 = BallCollision.TileEdges.None; - BallCollision.TileEdges tileEdges2 = (double) velocity.Y >= 0.0 ? tileEdges1 | BallCollision.TileEdges.Top : tileEdges1 | BallCollision.TileEdges.Bottom; - BallCollision.TileEdges tileEdges3 = (double) velocity.X >= 0.0 ? tileEdges2 | BallCollision.TileEdges.Left : tileEdges2 | BallCollision.TileEdges.Right; - BallCollision.TileEdges tileEdges4 = (double) velocity.Y <= (double) velocity.X ? tileEdges3 | BallCollision.TileEdges.TopRightSlope : tileEdges3 | BallCollision.TileEdges.BottomLeftSlope; - BallCollision.TileEdges edgesToTest = (double) velocity.Y <= -(double) velocity.X ? tileEdges4 | BallCollision.TileEdges.TopLeftSlope : tileEdges4 | BallCollision.TileEdges.BottomRightSlope; - collisionPoint = Vector2.Zero; - collisionTile = (Tile) null; - float num1 = float.MaxValue; - Vector2 closestPointOut = new Vector2(); - float distanceSquaredOut = 0.0f; - for (int left = tileBounds.Left; left < tileBounds.Right; ++left) - { - for (int top = tileBounds.Top; top < tileBounds.Bottom; ++top) - { - if (BallCollision.GetCollisionPointForTile(edgesToTest, left, top, center, ref closestPointOut, ref distanceSquaredOut) && (double) distanceSquaredOut < (double) num1 && (double) Vector2.Dot(velocity, center - closestPointOut) <= 0.0) - { - num1 = distanceSquaredOut; - collisionPoint = closestPointOut; - collisionTile = Main.tile[left, top]; - } - } - } - float num2 = size.X / 2f; - return (double) num1 < (double) num2 * (double) num2; - } - - private static bool GetCollisionPointForTile( - BallCollision.TileEdges edgesToTest, - int x, - int y, - Vector2 center, - ref Vector2 closestPointOut, - ref float distanceSquaredOut) - { - Tile tile = Main.tile[x, y]; - if (tile == null || !tile.nactive() || !Main.tileSolid[(int) tile.type] && !Main.tileSolidTop[(int) tile.type] || !Main.tileSolid[(int) tile.type] && Main.tileSolidTop[(int) tile.type] && tile.frameY != (short) 0) - return false; - if (Main.tileSolidTop[(int) tile.type]) - edgesToTest &= BallCollision.TileEdges.Top | BallCollision.TileEdges.BottomLeftSlope | BallCollision.TileEdges.BottomRightSlope; - Vector2 tilePosition = new Vector2((float) x * 16f, (float) y * 16f); - bool flag = false; - LineSegment edge = new LineSegment(); - if (BallCollision.GetSlopeEdge(ref edgesToTest, tile, tilePosition, ref edge)) - { - closestPointOut = BallCollision.ClosestPointOnLineSegment(center, edge); - distanceSquaredOut = Vector2.DistanceSquared(closestPointOut, center); - flag = true; - } - if (BallCollision.GetTopOrBottomEdge(edgesToTest, x, y, tilePosition, ref edge)) - { - Vector2 vector2 = BallCollision.ClosestPointOnLineSegment(center, edge); - float num = Vector2.DistanceSquared(vector2, center); - if (!flag || (double) num < (double) distanceSquaredOut) - { - distanceSquaredOut = num; - closestPointOut = vector2; - } - flag = true; - } - if (BallCollision.GetLeftOrRightEdge(edgesToTest, x, y, tilePosition, ref edge)) - { - Vector2 vector2 = BallCollision.ClosestPointOnLineSegment(center, edge); - float num = Vector2.DistanceSquared(vector2, center); - if (!flag || (double) num < (double) distanceSquaredOut) - { - distanceSquaredOut = num; - closestPointOut = vector2; - } - flag = true; - } - return flag; - } - - private static bool GetSlopeEdge( - ref BallCollision.TileEdges edgesToTest, - Tile tile, - Vector2 tilePosition, - ref LineSegment edge) - { - switch (tile.slope()) - { - case 0: - return false; - case 1: - edgesToTest &= BallCollision.TileEdges.Bottom | BallCollision.TileEdges.Left | BallCollision.TileEdges.BottomLeftSlope; - if ((edgesToTest & BallCollision.TileEdges.BottomLeftSlope) == BallCollision.TileEdges.None) - return false; - edge.Start = tilePosition; - edge.End = new Vector2(tilePosition.X + 16f, tilePosition.Y + 16f); - return true; - case 2: - edgesToTest &= BallCollision.TileEdges.Bottom | BallCollision.TileEdges.Right | BallCollision.TileEdges.BottomRightSlope; - if ((edgesToTest & BallCollision.TileEdges.BottomRightSlope) == BallCollision.TileEdges.None) - return false; - edge.Start = new Vector2(tilePosition.X, tilePosition.Y + 16f); - edge.End = new Vector2(tilePosition.X + 16f, tilePosition.Y); - return true; - case 3: - edgesToTest &= BallCollision.TileEdges.Top | BallCollision.TileEdges.Left | BallCollision.TileEdges.TopLeftSlope; - if ((edgesToTest & BallCollision.TileEdges.TopLeftSlope) == BallCollision.TileEdges.None) - return false; - edge.Start = new Vector2(tilePosition.X, tilePosition.Y + 16f); - edge.End = new Vector2(tilePosition.X + 16f, tilePosition.Y); - return true; - case 4: - edgesToTest &= BallCollision.TileEdges.Top | BallCollision.TileEdges.Right | BallCollision.TileEdges.TopRightSlope; - if ((edgesToTest & BallCollision.TileEdges.TopRightSlope) == BallCollision.TileEdges.None) - return false; - edge.Start = tilePosition; - edge.End = new Vector2(tilePosition.X + 16f, tilePosition.Y + 16f); - return true; - default: - return false; - } - } - - private static bool GetTopOrBottomEdge( - BallCollision.TileEdges edgesToTest, - int x, - int y, - Vector2 tilePosition, - ref LineSegment edge) - { - if ((edgesToTest & BallCollision.TileEdges.Bottom) != BallCollision.TileEdges.None) - { - Tile tile = Main.tile[x, y + 1]; - if ((!BallCollision.IsNeighborSolid(tile) || tile.slope() == (byte) 1 || tile.slope() == (byte) 2 ? 1 : (tile.halfBrick() ? 1 : 0)) == 0) - return false; - edge.Start = new Vector2(tilePosition.X, tilePosition.Y + 16f); - edge.End = new Vector2(tilePosition.X + 16f, tilePosition.Y + 16f); - return true; - } - if ((edgesToTest & BallCollision.TileEdges.Top) == BallCollision.TileEdges.None) - return false; - Tile tile1 = Main.tile[x, y - 1]; - if ((Main.tile[x, y].halfBrick() || !BallCollision.IsNeighborSolid(tile1) || tile1.slope() == (byte) 3 ? 1 : (tile1.slope() == (byte) 4 ? 1 : 0)) == 0) - return false; - if (Main.tile[x, y].halfBrick()) - tilePosition.Y += 8f; - edge.Start = new Vector2(tilePosition.X, tilePosition.Y); - edge.End = new Vector2(tilePosition.X + 16f, tilePosition.Y); - return true; - } - - private static bool GetLeftOrRightEdge( - BallCollision.TileEdges edgesToTest, - int x, - int y, - Vector2 tilePosition, - ref LineSegment edge) - { - if ((edgesToTest & BallCollision.TileEdges.Left) != BallCollision.TileEdges.None) - { - Tile tile1 = Main.tile[x, y]; - Tile tile2 = Main.tile[x - 1, y]; - if ((!BallCollision.IsNeighborSolid(tile2) || tile2.slope() == (byte) 1 || tile2.slope() == (byte) 3 ? 1 : (!tile2.halfBrick() ? 0 : (!tile1.halfBrick() ? 1 : 0))) == 0) - return false; - edge.Start = new Vector2(tilePosition.X, tilePosition.Y); - edge.End = new Vector2(tilePosition.X, tilePosition.Y + 16f); - if (tile1.halfBrick()) - edge.Start.Y += 8f; - return true; - } - if ((edgesToTest & BallCollision.TileEdges.Right) == BallCollision.TileEdges.None) - return false; - Tile tile3 = Main.tile[x, y]; - Tile tile4 = Main.tile[x + 1, y]; - if ((!BallCollision.IsNeighborSolid(tile4) || tile4.slope() == (byte) 2 || tile4.slope() == (byte) 4 ? 1 : (!tile4.halfBrick() ? 0 : (!tile3.halfBrick() ? 1 : 0))) == 0) - return false; - edge.Start = new Vector2(tilePosition.X + 16f, tilePosition.Y); - edge.End = new Vector2(tilePosition.X + 16f, tilePosition.Y + 16f); - if (tile3.halfBrick()) - edge.Start.Y += 8f; - return true; - } - - private static Rectangle GetTileBounds(Vector2 position, Vector2 size) - { - int x = (int) Math.Floor((double) position.X / 16.0); - int y = (int) Math.Floor((double) position.Y / 16.0); - int num1 = (int) Math.Floor(((double) position.X + (double) size.X) / 16.0); - int num2 = (int) Math.Floor(((double) position.Y + (double) size.Y) / 16.0); - return new Rectangle(x, y, num1 - x + 1, num2 - y + 1); - } - - private static bool IsNeighborSolid(Tile tile) => tile != null && tile.nactive() && Main.tileSolid[(int) tile.type] && !Main.tileSolidTop[(int) tile.type]; - - private static Vector2 ClosestPointOnLineSegment(Vector2 point, LineSegment lineSegment) - { - Vector2 vector2_1 = point - lineSegment.Start; - Vector2 vector2_2 = lineSegment.End - lineSegment.Start; - float num1 = vector2_2.LengthSquared(); - Vector2 vector2_3 = vector2_2; - float num2 = Vector2.Dot(vector2_1, vector2_3) / num1; - if ((double) num2 < 0.0) - return lineSegment.Start; - return (double) num2 > 1.0 ? lineSegment.End : lineSegment.Start + vector2_2 * num2; - } - - [Conditional("DEBUG")] - private static void DrawEdge(LineSegment edge) - { - } - - [Flags] - private enum TileEdges : uint - { - None = 0, - Top = 1, - Bottom = 2, - Left = 4, - Right = 8, - TopLeftSlope = 16, // 0x00000010 - TopRightSlope = 32, // 0x00000020 - BottomLeftSlope = 64, // 0x00000040 - BottomRightSlope = 128, // 0x00000080 - } - } -} diff --git a/Physics/BallCollisionEvent.cs b/Physics/BallCollisionEvent.cs deleted file mode 100644 index c2bf2db..0000000 --- a/Physics/BallCollisionEvent.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Physics.BallCollisionEvent -// 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.Physics -{ - public struct BallCollisionEvent - { - public readonly Vector2 Normal; - public readonly Vector2 ImpactPoint; - public readonly Tile Tile; - public readonly Entity Entity; - public readonly float TimeScale; - - public BallCollisionEvent( - float timeScale, - Vector2 normal, - Vector2 impactPoint, - Tile tile, - Entity entity) - { - this.Normal = normal; - this.ImpactPoint = impactPoint; - this.Tile = tile; - this.Entity = entity; - this.TimeScale = timeScale; - } - } -} diff --git a/Physics/BallPassThroughEvent.cs b/Physics/BallPassThroughEvent.cs deleted file mode 100644 index 323f214..0000000 --- a/Physics/BallPassThroughEvent.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Physics.BallPassThroughEvent -// 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.Physics -{ - public struct BallPassThroughEvent - { - public readonly Tile Tile; - public readonly Entity Entity; - public readonly BallPassThroughType Type; - public readonly float TimeScale; - - public BallPassThroughEvent( - float timeScale, - Tile tile, - Entity entity, - BallPassThroughType type) - { - this.Tile = tile; - this.Entity = entity; - this.Type = type; - this.TimeScale = timeScale; - } - } -} diff --git a/Physics/BallPassThroughType.cs b/Physics/BallPassThroughType.cs deleted file mode 100644 index 944e3ec..0000000 --- a/Physics/BallPassThroughType.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Physics.BallPassThroughType -// 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.Physics -{ - public enum BallPassThroughType - { - None, - Water, - Honey, - Lava, - Tile, - } -} diff --git a/Physics/BallState.cs b/Physics/BallState.cs deleted file mode 100644 index ada02f7..0000000 --- a/Physics/BallState.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Physics.BallState -// 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.Physics -{ - public enum BallState - { - Resting, - Moving, - OutOfBounds, - } -} diff --git a/Physics/BallStepResult.cs b/Physics/BallStepResult.cs deleted file mode 100644 index 1bc1932..0000000 --- a/Physics/BallStepResult.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Physics.BallStepResult -// 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.Physics -{ - public struct BallStepResult - { - public readonly BallState State; - - private BallStepResult(BallState state) => this.State = state; - - public static BallStepResult OutOfBounds() => new BallStepResult(BallState.OutOfBounds); - - public static BallStepResult Moving() => new BallStepResult(BallState.Moving); - - public static BallStepResult Resting() => new BallStepResult(BallState.Resting); - } -} diff --git a/Physics/IBallContactListener.cs b/Physics/IBallContactListener.cs deleted file mode 100644 index b6c80e8..0000000 --- a/Physics/IBallContactListener.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Physics.IBallContactListener -// 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.Physics -{ - public interface IBallContactListener - { - void OnCollision( - PhysicsProperties properties, - ref Vector2 position, - ref Vector2 velocity, - ref BallCollisionEvent collision); - - void OnPassThrough( - PhysicsProperties properties, - ref Vector2 position, - ref Vector2 velocity, - ref float angularVelocity, - ref BallPassThroughEvent passThrough); - } -} diff --git a/Physics/PhysicsProperties.cs b/Physics/PhysicsProperties.cs deleted file mode 100644 index 7c32999..0000000 --- a/Physics/PhysicsProperties.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Physics.PhysicsProperties -// 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.Physics -{ - public class PhysicsProperties - { - public readonly float Gravity; - public readonly float Drag; - - public PhysicsProperties(float gravity, float drag) - { - this.Gravity = gravity; - this.Drag = drag; - } - } -} diff --git a/Player.cs b/Player.cs index 15ef49e..1c923a7 100644 --- a/Player.cs +++ b/Player.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Player -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -13,20 +13,14 @@ using System.IO; using System.Security.Cryptography; using System.Text; using Terraria.Audio; -using Terraria.Chat; using Terraria.DataStructures; using Terraria.Enums; using Terraria.GameContent; using Terraria.GameContent.Achievements; -using Terraria.GameContent.Creative; -using Terraria.GameContent.Drawing; using Terraria.GameContent.Events; -using Terraria.GameContent.Golf; -using Terraria.GameContent.ObjectInteractions; using Terraria.GameContent.Tile_Entities; using Terraria.GameContent.UI; using Terraria.GameInput; -using Terraria.Graphics; using Terraria.Graphics.Capture; using Terraria.Graphics.Effects; using Terraria.Graphics.Shaders; @@ -39,14 +33,12 @@ using Terraria.UI; using Terraria.UI.Chat; using Terraria.UI.Gamepad; using Terraria.Utilities; -using Terraria.WorldBuilding; +using Terraria.World.Generation; namespace Terraria { public class Player : Entity { - public int emoteTime; - public CreativeUnlocksTracker creativeTracker; private static byte[] ENCRYPTION_KEY = new UnicodeEncoding().GetBytes("h3y_gUyZ"); public Player.OverheadMessage chatOverhead; public Player.SelectionRadial DpadRadial = new Player.SelectionRadial(); @@ -57,30 +49,15 @@ namespace Terraria public bool GoingDownWithGrapple; public byte spelunkerTimer; public bool[] hideInfo = new bool[13]; - public int[] builderAccStatus = new int[12] - { - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - }; + public int[] builderAccStatus = new int[10]; public int lostCoins; public string lostCoinString = ""; public int soulDrain; public float drainBoost; public bool dd2Accessory; - private static bool disabledBlizzardGraphic = false; - private static bool disabledBlizzardSound = false; - private static float _blizzardSoundVolume; + private static float _blizzardSoundVolume = 0.0f; private static SlotId _strongBlizzardSound = (SlotId) SlotId.Invalid; + private static SlotId _weakBlizzardSound = (SlotId) SlotId.Invalid; private static SlotId _insideBlizzardSound = (SlotId) SlotId.Invalid; public string name = ""; public int taxMoney; @@ -89,12 +66,13 @@ namespace Terraria public static int crystalLeafDamage = 100; public static int crystalLeafKB = 10; public float basiliskCharge; + public bool[] NPCBannerBuff = new bool[267]; + public bool hasBanner; public Vector2 lastDeathPostion; public DateTime lastDeathTime; public bool showLastDeath; public int extraAccessorySlots = 2; public bool extraAccessory; - private bool dontConsumeWand; public int tankPet = -1; public bool tankPetReset; public int stringColor; @@ -121,7 +99,6 @@ namespace Terraria public int nebulaLevelDamage; public bool manaMagnet; public bool lifeMagnet; - public bool treasureMagnet; public bool lifeForce; public bool calmed; public bool inferno; @@ -142,7 +119,6 @@ namespace Terraria public static float manaSickLessDmg = 0.25f; public float manaSickReduction; public bool manaSick; - public int afkCounter; public bool stairFall; public int loadStatus; public Vector2[] itemFlamePos = new Vector2[7]; @@ -161,12 +137,10 @@ namespace Terraria public bool lastStoned; public bool ichor; public bool webbed; - public bool tipsy; public bool noBuilding; public int ropeCount; public int manaRegenBonus; public int manaRegenDelayBonus; - public int dashType; public int dash; public int dashTime; public int dashDelay; @@ -195,7 +169,6 @@ namespace Terraria public int carpetTime; public int miscCounter; public int infernoCounter; - public int starCloakCooldown; public bool sandStorm; public bool crimsonRegen; public bool ghostHeal; @@ -204,12 +177,9 @@ namespace Terraria public bool slippy; public bool slippy2; public bool powerrun; - public bool runningOnSand; public bool flapSound; public bool iceBarrier; public bool dangerSense; - public byte luckPotion; - public byte oldLuckPotion; public float endurance; public bool loveStruck; public bool stinky; @@ -218,7 +188,6 @@ namespace Terraria public bool dryadWard; public bool panic; public bool brainOfConfusion; - public int brainOfConfusionDodgeAnimationCounter; public byte iceBarrierFrame; public byte iceBarrierFrameCounter; public bool shadowDodge; @@ -227,8 +196,6 @@ namespace Terraria public bool onHitDodge; public bool onHitRegen; public bool onHitPetal; - public bool onHitTitaniumStorm; - public bool hasTitaniumStormBuff; public int petalTimer; public int shadowDodgeTimer; public int phantomPhoneixCounter; @@ -237,7 +204,6 @@ namespace Terraria public bool sonarPotion; public bool accFishingLine; public bool accTackleBox; - public bool accLavaFishing; public int maxMinions = 1; public int numMinions; public float slotsMinions; @@ -255,13 +221,6 @@ namespace Terraria public bool stardustMinion; public bool stardustGuardian; public bool stardustDragon; - public bool batsOfLight; - public bool babyBird; - public bool vampireFrog; - public bool stormTiger; - public int highestStormTigerGemOriginalDamage; - public bool smolstar; - public bool empressBlade; public float wingTime; public int wings; public int wingsLogic; @@ -282,9 +241,6 @@ namespace Terraria public bool frostArmor; public bool honey; public bool crystalLeaf; - public PortableStoolUsage portableStoolInfo; - public bool preventAllItemPickups; - public bool dontHurtCritters; public int[] doubleTapCardinalTimer = new int[4]; public int[] holdDownCardinalTimer = new int[4]; public bool defendedByPaladin; @@ -302,8 +258,6 @@ namespace Terraria public int immuneAlphaDirection; public int immuneAlpha; public int team; - private int _timeSinceLastImmuneGet; - private int _immuneStrikes; public bool hbLocked; public static int nameLen = 20; public float maxRegenDelay; @@ -311,8 +265,7 @@ namespace Terraria public bool editedChestName; public int reuseDelay; public int aggro; - public float nearbyActiveNPCs; - public bool creativeInterface; + public float activeNPCs; public bool mouseInterface; public bool lastMouseInterface; public int noThrow; @@ -332,6 +285,10 @@ namespace Terraria public Item[] miscEquips = new Item[5]; public Item[] miscDyes = new Item[5]; public Item trashItem = new Item(); + public int itemAnimation; + public int itemAnimationMax; + public int itemTime; + public int toolTime; public float itemRotation; public int itemWidth; public int itemHeight; @@ -342,7 +299,7 @@ namespace Terraria public const int maxBuffs = 22; public int[] buffType = new int[22]; public int[] buffTime = new int[22]; - public bool[] buffImmune = new bool[323]; + public bool[] buffImmune = new bool[206]; public int heldProj = -1; public int breathCD; public int breathMax = 200; @@ -364,19 +321,12 @@ namespace Terraria public bool socialIgnoreLight; public int stealthTimer; public float stealth = 1f; - public bool isDisplayDollOrInanimate; - public bool isHatRackDoll; - public bool isFirstFractalAfterImage; - public float firstFractalAfterImageOpacity; public string setBonus = ""; public Item[] inventory = new Item[59]; public bool[] inventoryChestStack = new bool[59]; - public Item lastVisualizedSelectedItem; public Chest bank = new Chest(true); public Chest bank2 = new Chest(true); public Chest bank3 = new Chest(true); - public Chest bank4 = new Chest(true); - public BitsByte voidVaultInfo; public float headRotation; public float bodyRotation; public float legRotation; @@ -394,14 +344,11 @@ namespace Terraria public static bool deadForGood = false; public bool dead; public int respawnTimer; - public const int respawnTimerMax = 1800; - public long lastTimePlayerWasSaved; public int attackCD; public int potionDelay; public byte difficulty; public byte wetSlime; public HitTile hitTile; - public HitTile hitReplace; public int jump; public int head = -1; public int body = -1; @@ -416,7 +363,7 @@ namespace Terraria public sbyte neck = -1; public sbyte face = -1; public sbyte balloon = -1; - public bool[] hideVisibleAccessory = new bool[10]; + public bool[] hideVisual = new bool[10]; public BitsByte hideMisc = (BitsByte) (byte) 0; public Microsoft.Xna.Framework.Rectangle headFrame; public Microsoft.Xna.Framework.Rectangle bodyFrame; @@ -452,12 +399,8 @@ namespace Terraria public bool releaseDown; public bool controlQuickMana; public bool controlQuickHeal; - public bool controlCreativeMenu; - public bool releaseCreativeMenu; public bool tileInteractionHappened; public bool tileInteractAttempted; - public bool tryKeepingHoveringDown; - public bool tryKeepingHoveringUp; public int altFunctionUse; public bool mapZoomIn; public bool mapZoomOut; @@ -472,10 +415,10 @@ namespace Terraria public bool delayUseItem; public const int defaultWidth = 20; public const int defaultHeight = 42; - public bool cursorItemIconEnabled; - public bool cursorItemIconReversed; - public int cursorItemIconID; - public string cursorItemIconText = ""; + public bool showItemIcon; + public bool showItemIconR; + public int showItemIcon2; + public string showItemIconText = ""; public int runSoundDelay; public float shadow; public const int shadowMax = 3; @@ -488,17 +431,7 @@ namespace Terraria public bool fireWalk; public bool channel; public int step = -1; - public bool skipAnimatingValuesInPlayerFrame; - public Player.RabbitOrderFrameHelper rabbitOrderFrame; - public bool creativeGodMode; - private const int MaxAdvancedShadows = 60; - public int availableAdvancedShadowsCount; - private EntityShadowInfo[] _advancedShadows = new EntityShadowInfo[60]; - private int _lastAddedAvancedShadow; - public Player.CompositeArmData compositeFrontArm; - public Player.CompositeArmData compositeBackArm; public int anglerQuestsFinished; - public int golferScoreAccumulated; public int bartenderQuestLog; public bool downedDD2EventAnyDifficulty; public int armorPenetration; @@ -519,14 +452,12 @@ namespace Terraria public bool noKnockback; public bool spaceGun; public float gravDir = 1f; - public bool chloroAmmoCost80; public bool ammoCost80; public bool ammoCost75; public int stickyBreak; public bool magicQuiver; public bool magmaStone; public bool lavaRose; - public bool hasMoltenQuiver; public int phantasmTime; public bool ammoBox; public bool ammoPotion; @@ -534,14 +465,9 @@ namespace Terraria public bool strongBees; public bool sporeSac; public bool shinyStone; - public bool empressBrooch; - public bool volatileGelatin; - public int volatileGelatinCounter; public int yoraiz0rEye; public bool yoraiz0rDarkness; - public bool hasUnicornHorn; public bool leinforsHair; - public bool unlockedBiomeTorches; public bool suspiciouslookingTentacle; public bool crimsonHeart; public bool lightOrb; @@ -552,7 +478,6 @@ namespace Terraria public bool turtle; public bool eater; public bool penguin; - public bool HasGardenGnomeNearby; public bool magicLantern; public bool rabid; public bool sunflower; @@ -560,11 +485,7 @@ namespace Terraria public bool puppy; public bool grinch; public bool miniMinotaur; - public bool flowerBoots; - public bool fairyBoots; - public bool moonLordLegs; public bool arcticDivingGear; - public bool coolWhipBuff; public bool wearsRobe; public bool minecartLeft; public bool onWrongGround; @@ -580,47 +501,11 @@ namespace Terraria public bool petFlagDD2Gato; public bool petFlagDD2Ghost; public bool petFlagDD2Dragon; - public bool petFlagUpbeatStar; - public bool petFlagSugarGlider; - public bool petFlagBabyShark; - public bool petFlagLilHarpy; - public bool petFlagFennecFox; - public bool petFlagGlitteryButterfly; - public bool petFlagBabyImp; - public bool petFlagBabyRedPanda; - public bool petFlagPlantero; - public bool petFlagDynamiteKitten; - public bool petFlagBabyWerewolf; - public bool petFlagShadowMimic; - public bool petFlagVoltBunny; - public bool petFlagKingSlimePet; - public bool petFlagEyeOfCthulhuPet; - public bool petFlagEaterOfWorldsPet; - public bool petFlagBrainOfCthulhuPet; - public bool petFlagSkeletronPet; - public bool petFlagQueenBeePet; - public bool petFlagDestroyerPet; - public bool petFlagTwinsPet; - public bool petFlagSkeletronPrimePet; - public bool petFlagPlanteraPet; - public bool petFlagGolemPet; - public bool petFlagDukeFishronPet; - public bool petFlagLunaticCultistPet; - public bool petFlagMoonLordPet; - public bool petFlagFairyQueenPet; - public bool petFlagPumpkingPet; - public bool petFlagEverscreamPet; - public bool petFlagIceQueenPet; - public bool petFlagMartianPet; - public bool petFlagDD2OgrePet; - public bool petFlagDD2BetsyPet; - public bool petFlagQueenSlimePet; public bool companionCube; public bool babyFaceMonster; public bool magicCuffs; public bool coldDash; public bool sailDash; - public bool desertDash; public bool eyeSpring; public bool snowman; public bool scope; @@ -648,11 +533,9 @@ namespace Terraria public byte suffocateDelay; public bool dripping; public bool drippingSlime; - public bool drippingSparkleSlime; public bool onFire; public bool onFire2; public bool noItems; - public bool cursed; public bool windPushed; public bool wereWolf; public bool wolfAcc; @@ -666,7 +549,6 @@ namespace Terraria public bool confused; public bool accMerman; public bool merman; - public bool trident; public bool brokenArmor; public bool silence; public bool slow; @@ -675,9 +557,6 @@ namespace Terraria public bool kbGlove; public bool kbBuff; public bool starCloak; - public bool starCloakIsManaCloak; - public bool starCloakIsStarVeil; - public bool starCloakIsBeeCloak; public bool longInvince; public bool pStone; public bool manaFlower; @@ -689,19 +568,23 @@ namespace Terraria public bool slowOgreSpit; public bool parryDamageBuff; public bool ballistaPanic; - public bool JustDroppedAnItem; public int meleeCrit = 4; - public int magicCrit = 4; public int rangedCrit = 4; + public int magicCrit = 4; + public int thrownCrit = 4; public float meleeDamage = 1f; - public float magicDamage = 1f; public float rangedDamage = 1f; + public float thrownDamage = 1f; public float bulletDamage = 1f; public float arrowDamage = 1f; public float rocketDamage = 1f; + public float magicDamage = 1f; public float minionDamage = 1f; public float minionKB; public float meleeSpeed = 1f; + public float thrownVelocity = 1f; + public bool thrownCost50; + public bool thrownCost33; public float moveSpeed = 1f; public float pickSpeed = 1f; public float wallSpeed = 1f; @@ -710,8 +593,6 @@ namespace Terraria public bool autoActuator; public int SpawnX = -1; public int SpawnY = -1; - public Vector2? PotionOfReturnOriginalUsePosition; - public Vector2? PotionOfReturnHomePosition; public int[] spX = new int[200]; public int[] spY = new int[200]; public string[] spN = new string[200]; @@ -736,15 +617,14 @@ namespace Terraria public bool oldAdjWater; public bool oldAdjHoney; public bool oldAdjLava; - public bool[] adjTile = new bool[623]; - public bool[] oldAdjTile = new bool[623]; - public static int defaultItemGrabRange = 42; + public bool[] adjTile = new bool[470]; + public bool[] oldAdjTile = new bool[470]; + public static int defaultItemGrabRange = 38; private static float itemGrabSpeed = 0.45f; private static float itemGrabSpeedMax = 4f; public byte hairDye; public Color hairDyeColor = Color.Transparent; public float hairDyeVar; - public int skinDyePacked; public Color hairColor = new Color(215, 90, 55); public Color skinColor = new Color((int) byte.MaxValue, 125, 90); public Color eyeColor = new Color(105, 90, 75); @@ -755,7 +635,6 @@ namespace Terraria public int hair; public bool hostile; public SoundPlaySet hermesStepSound = new SoundPlaySet(); - public Vector2 instantMovementAccumulatedThisFrame; public int accCompass; public int accWatch; public int accDepthMeter; @@ -769,12 +648,11 @@ namespace Terraria public byte accThirdEyeNumber; public bool accStopwatch; public bool accOreFinder; + public int bestOre = -1; public bool accCritterGuide; public byte accCritterGuideCounter; public byte accCritterGuideNumber; public bool accDreamCatcher; - public bool hasFootball; - public bool drawingFootball; public bool ActuationRodLock; public bool ActuationRodLockSetting; public bool InfoAccMechShowWires; @@ -789,42 +667,28 @@ namespace Terraria public bool goldRing; public bool accDivingHelm; public bool accFlipper; - public bool hasJumpOption_Cloud; - public bool canJumpAgain_Cloud; - public bool isPerformingJump_Cloud; - public bool hasJumpOption_Sandstorm; - public bool canJumpAgain_Sandstorm; - public bool isPerformingJump_Sandstorm; - public bool hasJumpOption_Blizzard; - public bool canJumpAgain_Blizzard; - public bool isPerformingJump_Blizzard; - public bool hasJumpOption_Fart; - public bool canJumpAgain_Fart; - public bool isPerformingJump_Fart; - public bool hasJumpOption_Sail; - public bool canJumpAgain_Sail; - public bool isPerformingJump_Sail; - public bool hasJumpOption_Unicorn; - public bool canJumpAgain_Unicorn; - public bool isPerformingJump_Unicorn; - public bool hasJumpOption_Santank; - public bool canJumpAgain_Santank; - public bool isPerformingJump_Santank; - public bool hasJumpOption_WallOfFleshGoat; - public bool canJumpAgain_WallOfFleshGoat; - public bool isPerformingJump_WallOfFleshGoat; - public bool hasJumpOption_Basilisk; - public bool canJumpAgain_Basilisk; - public bool isPerformingJump_Basilisk; - public bool isPerformingPogostickTricks; + public bool doubleJumpCloud; + public bool jumpAgainCloud; + public bool dJumpEffectCloud; + public bool doubleJumpSandstorm; + public bool jumpAgainSandstorm; + public bool dJumpEffectSandstorm; + public bool doubleJumpBlizzard; + public bool jumpAgainBlizzard; + public bool dJumpEffectBlizzard; + public bool doubleJumpFart; + public bool jumpAgainFart; + public bool dJumpEffectFart; + public bool doubleJumpSail; + public bool jumpAgainSail; + public bool dJumpEffectSail; + public bool doubleJumpUnicorn; + public bool jumpAgainUnicorn; + public bool dJumpEffectUnicorn; public bool autoJump; public bool justJumped; public float jumpSpeedBoost; public int extraFall; - public bool canFloatInWater; - public bool hasFloatingTube; - public bool frogLegJumpBoost; - public bool skyStoneEffects; public bool spawnMax; public int blockRange; public int[] grappling = new int[20]; @@ -854,7 +718,6 @@ namespace Terraria public bool turtleArmor; public bool turtleThorns; public bool spiderArmor; - public bool CanSeeInvisibleBlocks; public bool setSolar; public bool setVortex; public bool setNebula; @@ -877,26 +740,18 @@ namespace Terraria public bool waterWalk2; public bool gravControl; public bool gravControl2; - public bool releaseBeesWhenHurt; + public bool bee; public int wireOperationsCooldown; public int lastChest; public int flyingPigChest = -1; - public int voidLensChest = -1; public int chest = -1; public int chestX; public int chestY; + public int talkNPC = -1; public int fallStart; public int fallStart2; public int potionDelayTime = Item.potionDelay; public int restorationDelayTime = Item.restorationDelay; - public bool isPettingAnimal; - public bool isTheAnimalBeingPetSmall; - public PlayerSittingHelper sitting; - public PlayerSleepingHelper sleeping; - public PlayerEyeHelper eyeHelper; - public PlayerInteractionAnchor tileEntityAnchor; - public DoorOpeningHelper doorHelper; - public ShoppingSettings currentShoppingSettings = ShoppingSettings.NotInShop; public int cHead; public int cBody; public int cLegs; @@ -912,69 +767,28 @@ namespace Terraria public int cBalloon; public int cWings; public int cCarpet; - public int cFloatingTube; public int cGrapple; public int cMount; public int cMinecart; public int cPet; public int cLight; public int cYorai; - public int cPortalbeStool; - public int cUnicornHorn; - public int cMinion; - public int cLeinShampoo; - public int[] ownedProjectileCounts = new int[950]; - public bool[] npcTypeNoAggro = new bool[663]; + public int[] ownedProjectileCounts = new int[714]; + public bool[] npcTypeNoAggro = new bool[580]; public int lastPortalColorIndex; public int _portalPhysicsTime; public bool portalPhysicsFlag; - public int lastTeleportPylonStyleUsed; public float MountFishronSpecialCounter; public Vector2 MinionRestTargetPoint = Vector2.Zero; public int MinionAttackTargetNPC = -1; public List TouchedTiles = new List(); - public int itemAnimation; - public int itemAnimationMax; - public int itemTime; - public int itemTimeMax; - public int toolTime; - public static int BlockInteractionWithProjectiles = 3; - private HashSet _blackListedTileCoordsForGrappling = new HashSet(); + public static int StopMoneyTroughFromWorking = 3; private bool makeStrongBee; - public bool equippedAnyTileRangeAcc; - public bool equippedAnyTileSpeedAcc; - public bool equippedAnyWallSpeedAcc; public bool behindBackWall; - public int _funkytownAchievementCheckCooldown; + public int _funkytownCheckCD; private float _stormShaderObstruction = 1f; private float _shaderObstructionInternalValue = 1f; - private int graveImmediateTime; - public const int ChairSittingMaxDistance = 40; - private static SmartInteractSystem _smartInteractSys = new SmartInteractSystem(); - private int _lastSmartCursorToolStrategy = -1; - private bool[] nearbyTorch = new bool[22]; - private bool dryCoralTorch; - private int luckyTorchCounter; - private int nearbyTorches; - public float torchLuck; - public bool happyFunTorchTime; - private int torchFunTimer; - private int torchGodCooldown; - private int numberOfTorchAttacks; - private static int maxTorchAttacks = 200; - private int[] unlitTorchX = new int[Player.maxTorchAttacks]; - private int[] unlitTorchY = new int[Player.maxTorchAttacks]; - private static int[] _torchAttackPosX = new int[400]; - private static int[] _torchAttackPosY = new int[400]; - public int ladyBugLuckTimeLeft; - public float luck; - public float luckMinimumCap = -0.7f; - public float luckMaximumCap = 1f; - public bool luckNeedsSync; private int _quickGrappleCooldown; - public PlayerMovementAccsCache movementAbilitiesCache; - public float wingAccRunSpeed = -1f; - public float wingRunAccelerationMult = 1f; public const int SHIELD_PARRY_DURATION = 20; public const int SHIELD_PARRY_DURATION_DRAWING_TWEAKER = 20; public const int SHIELD_PARRY_DAMAGE_BUFF_MULTIPLIER = 5; @@ -982,72 +796,15 @@ namespace Terraria public bool shieldRaised; public int shieldParryTimeLeft; public int shield_parry_cooldown; - private bool _forceForwardCursor; - private Point _inputMouseCoordsForward; - private Point _mainMouseCoordsForward; - private bool _forceSmartSelectCursor; - private Point _inputMouseCoordsSmartSelect; - private Point _mainMouseCoordsSmartSelect; - private Point _tileTargetSmartSelect; - private bool botherWithUnaimedMinecartTracks = true; - private List _projectilesToInteractWith = new List(); - private int _lockTileInteractionsTimer; - public int[] hurtCooldowns = new int[4]; + public int[] hurtCooldowns = new int[2]; public static bool lastPound = true; - public static int musicNotes = 6; - private static List _oldestProjCheckList = new List(); - public Player.SavedPlayerDataWithAnnoyingRules savedPerPlayerFieldsThatArentInThePlayerClass; - private const int SaveSlotIndex_MouseItem = 0; - private const int SaveSlotIndex_CreativeSacrifice = 1; - private const int SaveSlotIndexCount = 2; - private Item[] _temporaryItemSlots = new Item[2]; public Vector2 BlehOldPositionFixer => -Vector2.UnitY; - public float HeightOffsetVisual - { - get - { - if (this.mount.Active) - return (float) this.mount.PlayerOffset; - return this.portableStoolInfo.IsInUse ? (float) this.portableStoolInfo.VisualYOffset : 0.0f; - } - } - - public float HeightOffsetHitboxCenter - { - get - { - if (this.mount.Active) - return (float) this.mount.PlayerOffsetHitbox; - return this.portableStoolInfo.IsInUse ? (float) (this.portableStoolInfo.HeightBoost - this.portableStoolInfo.VisualYOffset) : 0.0f; - } - } - - public int HeightOffsetBoost - { - get - { - if (this.mount.Active) - return this.mount.HeightBoost; - return this.portableStoolInfo.IsInUse ? this.portableStoolInfo.HeightBoost : 0; - } - } - - public int HeightMapOffset - { - get - { - if (this.mount.Active) - return this.mount.PlayerHeadOffset; - return this.portableStoolInfo.IsInUse ? this.portableStoolInfo.HeightBoost : 0; - } - } - public Vector2 MountedCenter { - get => new Vector2(this.position.X + (float) (this.width / 2), this.position.Y + 21f + this.HeightOffsetHitboxCenter); - set => this.position = new Vector2(value.X - (float) (this.width / 2), value.Y - 21f - this.HeightOffsetHitboxCenter); + get => new Vector2(this.position.X + (float) (this.width / 2), this.position.Y + 21f + (float) this.mount.PlayerOffsetHitbox); + set => this.position = new Vector2(value.X - (float) (this.width / 2), value.Y - 21f - (float) this.mount.PlayerOffsetHitbox); } public void RotateRelativePoint(ref float x, ref float y) @@ -1057,7 +814,7 @@ namespace Terraria y = vector2.Y; } - public Vector2 RotatedRelativePointOld(Vector2 pos, bool rotateForward = true) + public Vector2 RotatedRelativePoint(Vector2 pos, bool rotateForward = true) { Vector2 vector2 = this.position + this.fullRotationOrigin; Matrix rotationZ = Matrix.CreateRotationZ(this.fullRotation * (float) rotateForward.ToInt()); @@ -1066,54 +823,9 @@ namespace Terraria return pos + vector2; } - public Vector2 RotatedRelativePoint(Vector2 pos, bool reverseRotation = false, bool addGfxOffY = true) - { - float num1 = reverseRotation ? -this.fullRotation : this.fullRotation; - if (this.sleeping.isSleeping) - num1 = 0.0f; - Vector2 vector2_1 = this.Bottom + new Vector2(0.0f, this.gfxOffY); - int num2 = this.mount.PlayerOffset / 2 + 4; - Vector2 vector2_2 = new Vector2(0.0f, (float) -num2) + new Vector2(0.0f, (float) num2).RotatedBy((double) num1); - if (addGfxOffY) - pos.Y += this.gfxOffY; - pos = vector2_1 + (pos - vector2_1).RotatedBy((double) num1) + vector2_2; - if (this.sleeping.isSleeping) - { - Vector2 posOffset; - this.sleeping.GetSleepingOffsetInfo(this, out posOffset); - pos += posOffset; - } - if (this.sitting.isSitting) - { - Vector2 posOffset; - float seatAdjustment; - this.sitting.GetSittingOffsetInfo(this, out posOffset, out seatAdjustment); - pos += posOffset + new Vector2(0.0f, seatAdjustment); - } - return pos; - } - - public bool TileReplacementEnabled => this.builderAccStatus[10] == 0; - - public override Vector2 VisualPosition => this.position + new Vector2(0.0f, this.gfxOffY); - public bool CCed => this.frozen || this.webbed || this.stoned; - public bool CanDemonHeartAccessoryBeShown() => this.IsAValidEquipmentSlotForIteration(8) || this.armor[8].type > 0 || this.armor[18].type > 0 || this.dye[8].type > 0; - - public bool CanMasterModeAccessoryBeShown() => this.IsAValidEquipmentSlotForIteration(9) || this.armor[9].type > 0 || this.armor[19].type > 0 || this.dye[9].type > 0; - - public int GetAmountOfExtraAccessorySlotsToShow() - { - int num = 0; - if (this.CanDemonHeartAccessoryBeShown()) - ++num; - if (this.CanMasterModeAccessoryBeShown()) - ++num; - return num; - } - - public float miscCounterNormalized => (float) this.miscCounter / 300f; + public bool ExtraAccessorySlotsShouldShow => this.extraAccessorySlots > 0 || this.armor[8].type > 0 || this.armor[18].type > 0 || this.dye[8].type > 0; public bool Male { @@ -1147,7 +859,7 @@ namespace Terraria set => this.zone1[1] = value; } - public bool ZoneHallow + public bool ZoneHoly { get => this.zone1[2]; set => this.zone1[2] = value; @@ -1285,220 +997,20 @@ namespace Terraria set => this.zone4[0] = value; } - public bool ZoneGranite - { - get => this.zone4[1]; - set => this.zone4[1] = value; - } - - public bool ZoneMarble - { - get => this.zone4[2]; - set => this.zone4[2] = value; - } - - public bool ZoneHive - { - get => this.zone4[3]; - set => this.zone4[3] = value; - } - - public bool ZoneGemCave - { - get => this.zone4[4]; - set => this.zone4[4] = value; - } - - public bool ZoneLihzhardTemple - { - get => this.zone4[5]; - set => this.zone4[5] = value; - } - - public bool ZoneGraveyard - { - get => this.zone4[6]; - set => this.zone4[6] = value; - } - public Vector2 Directions => new Vector2((float) this.direction, this.gravDir); public Item HeldItem => this.inventory[this.selectedItem]; - public int breathCDMax - { - get - { - int num = 7; - if (this.inventory[this.selectedItem].type == 186 && this.itemAnimation == 0) - num *= 2; - if (this.accDivingHelm) - num *= 4; - return num; - } - } - - public bool ShouldFloatInWater - { - get - { - if (!this.canFloatInWater || this.controlDown) - return false; - return !this.mount.Active || this.mount.Type == 37; - } - } - - public bool CanBeTalkedTo => this.active && !this.dead && !this.ShouldNotDraw && (double) this.stealth == 1.0; - - public bool IsVoidVaultEnabled - { - get => this.voidVaultInfo[0]; - set => this.voidVaultInfo[0] = value; - } - - public bool DeadOrGhost => this.dead || this.ghost; - - public bool TryingToHoverUp => this.controlUp || this.tryKeepingHoveringUp; - - public bool TryingToHoverDown => this.controlDown || this.tryKeepingHoveringDown; - public Vector2 DefaultSize => new Vector2(20f, 42f); - public EntityShadowInfo GetAdvancedShadow(int shadowIndex) - { - if (shadowIndex > this.availableAdvancedShadowsCount) - shadowIndex = this.availableAdvancedShadowsCount; - return this._advancedShadows[(this._lastAddedAvancedShadow - shadowIndex).ModulusPositive(60)]; - } - - public void UpdateAdvancedShadows() - { - ++this.availableAdvancedShadowsCount; - if (this.availableAdvancedShadowsCount > 60) - this.availableAdvancedShadowsCount = 60; - if (++this._lastAddedAvancedShadow >= 60) - this._lastAddedAvancedShadow = 0; - this._advancedShadows[this._lastAddedAvancedShadow].CopyPlayer(this); - } - - public void ResetAdvancedShadows() => this.availableAdvancedShadowsCount = 0; - - public void SetCompositeArmFront( - bool enabled, - Player.CompositeArmStretchAmount stretch, - float rotation) - { - if ((double) this.gravDir == -1.0) - rotation = -rotation; - this.compositeFrontArm = new Player.CompositeArmData(enabled, stretch, rotation); - } - - public void SetCompositeArmBack( - bool enabled, - Player.CompositeArmStretchAmount stretch, - float rotation) - { - if ((double) this.gravDir == -1.0) - rotation = -rotation; - this.compositeBackArm = new Player.CompositeArmData(enabled, stretch, rotation); - } - - public bool UsingBiomeTorches - { - get => this.unlockedBiomeTorches && this.builderAccStatus[11] == 0; - set => this.builderAccStatus[11] = value ? 0 : 1; - } - - public bool ShouldNotDraw => this.invis && this.itemAnimation == 0 && !this.isDisplayDollOrInanimate && !this.isHatRackDoll; - - public int talkNPC { get; private set; } - - public bool isLockedToATile => this.sitting.isSitting || this.sleeping.isSleeping; - - public void SetTalkNPC(int npcIndex, bool fromNet = false) - { - this.talkNPC = npcIndex; - if (Main.netMode != 1 && npcIndex >= 0 && npcIndex < 200) - Main.BestiaryTracker.Chats.RegisterChatStartWith(Main.npc[npcIndex]); - if (this.talkNPC == -1) - this.currentShoppingSettings = ShoppingSettings.NotInShop; - else - this.currentShoppingSettings = Main.ShopHelper.GetShoppingSettings(this, Main.npc[this.talkNPC]); - } - public bool PortalPhysicsEnabled => this._portalPhysicsTime > 0 && !this.mount.Active; - public bool MountFishronSpecial - { - get - { - if (this.statLife < this.statLifeMax2 / 2 || this.wet && !this.lavaWet && !this.honeyWet || this.dripping || (double) this.MountFishronSpecialCounter > 0.0) - return true; - return Main.raining && WorldGen.InAPlaceWithWind(this.position, this.width, this.height); - } - } + public bool MountFishronSpecial => this.statLife < this.statLifeMax2 / 2 || this.wet && !this.lavaWet && !this.honeyWet || this.dripping || (double) this.MountFishronSpecialCounter > 0.0; public bool HasMinionRestTarget => this.MinionRestTargetPoint != Vector2.Zero; public bool HasMinionAttackTargetNPC => this.MinionAttackTargetNPC != -1; - public bool ItemTimeIsZero => this.itemTime == 0; - - public void SetItemTime(int frames) - { - this.itemTime = frames; - this.itemTimeMax = frames; - } - - public void ApplyItemTime(Item sItem) => this.SetItemTime(sItem.useTime); - - public void ApplyItemTime(Item sItem, float multiplier) => this.SetItemTime((int) ((double) sItem.useTime * (double) multiplier)); - - public void SetDummyItemTime(int frames) - { - this.itemAnimation = frames; - this.itemTime = frames; - this.itemTimeMax = frames + 1; - } - - private void SetItemAnimation(int frames) - { - this.itemAnimation = frames; - this.itemAnimationMax = frames; - } - - private void ApplyItemAnimation(Item sItem, float multiplier, int itemReuseDelay = 0) - { - this.SetItemAnimation((int) ((double) sItem.useAnimation * (double) multiplier)); - this.reuseDelay = itemReuseDelay; - } - - private void ApplyItemAnimation(Item sItem) - { - if (sItem.melee) - this.SetItemAnimation((int) ((double) sItem.useAnimation * (double) this.meleeSpeed)); - else if (sItem.summon && ItemID.Sets.SummonerWeaponThatScalesWithAttackSpeed[sItem.type]) - this.SetItemAnimation((int) ((double) sItem.useAnimation * (double) this.meleeSpeed)); - else if (sItem.createTile >= 0) - this.SetItemAnimation((int) ((double) sItem.useAnimation * (double) this.tileSpeed)); - else if (sItem.createWall >= 0) - { - this.SetItemAnimation((int) ((double) sItem.useAnimation * (double) this.wallSpeed)); - } - else - { - this.SetItemAnimation(sItem.useAnimation); - this.reuseDelay = sItem.reuseDelay; - } - } - - public bool InOpposingTeam(Player otherPlayer) - { - if (!this.hostile || !otherPlayer.hostile) - return false; - return otherPlayer.team == 0 || otherPlayer.team != this.team; - } - public bool TeamChangeAllowed() => true; public void HealEffect(int healAmount, bool broadcast = true) @@ -1517,30 +1029,6 @@ namespace Terraria NetMessage.SendData(43, number: this.whoAmI, number2: ((float) manaAmount)); } - public void InterruptItemUsageIfOverTile(int tileTypeToBeOver) - { - Tile tile = Main.tile[Player.tileTargetX, Player.tileTargetY]; - if (tile == null || !tile.active() || (int) tile.type != tileTypeToBeOver) - return; - Main.blockMouse = true; - } - - public Vector2 GetHelmetDrawOffset() - { - Vector2 vector2 = Vector2.Zero; - if ((this.hair == 15 || this.hair == 76 || this.hair == 108) && this.head == 222) - vector2 = new Vector2(0.0f, 4f) * this.Directions; - return vector2; - } - - public void AccumulateGolfingScore(int score) - { - int num = score; - if (this.golferScoreAccumulated + num > 1000000000) - num = 1000000000 - this.golferScoreAccumulated; - this.golferScoreAccumulated += num; - } - public static byte FindClosest(Vector2 Position, int Width, int Height) { byte num1 = 0; @@ -1575,10 +1063,13 @@ namespace Terraria { Main.mapFullscreen = false; this.releaseInventory = false; - SoundEngine.PlaySound(11); + Main.PlaySound(11); } else if (PlayerInput.InBuildingMode) + { PlayerInput.ExitBuildingMode(); + Main.PlaySound(11); + } else if (Main.ingameOptionsWindow) { if (PlayerInput.UsingGamepadUI && UILinkPointNavigator.CurrentPage == 1002) @@ -1592,10 +1083,10 @@ namespace Terraria CaptureManager.Instance.Active = false; else if (this.talkNPC >= 0) { - this.SetTalkNPC(-1); + this.talkNPC = -1; Main.npcChatCornerItem = 0; Main.npcChatText = ""; - SoundEngine.PlaySound(11); + Main.PlaySound(11); if (PlayerInput.UsingGamepad) Main.npcChatRelease = false; } @@ -1604,20 +1095,20 @@ namespace Terraria this.sign = -1; Main.editSign = false; Main.npcChatText = ""; - SoundEngine.PlaySound(11); + Main.PlaySound(11); } else if (Main.clothesWindow) Main.CancelClothesWindow(); else if (!Main.playerInventory) { - Player.OpenInventory(); + Recipe.FindRecipes(); + Main.playerInventory = true; + Main.EquipPageSelected = 0; + Main.PlaySound(10); } else { Main.playerInventory = false; - if (this.channel && Main.mouseItem != null && !Main.mouseItem.IsAir) - this.channel = false; - this.tileEntityAnchor.Clear(); if (!PlayerInput.UsingGamepad) { Main.EquipPageSelected = 0; @@ -1626,97 +1117,30 @@ namespace Terraria { PlayerInput.NavigatorUnCachePosition(); Main.GamepadCursorAlpha = 0.0f; - Player.BlockInteractionWithProjectiles = 3; - if (PlayerInput.GrappleAndInteractAreShared) - this.LockGamepadTileInteractions(); + Player.StopMoneyTroughFromWorking = 3; } - SoundEngine.PlaySound(11); + Main.PlaySound(11); if (ItemSlot.Options.HighlightNewItems) { foreach (Item obj in this.inventory) obj.newAndShiny = false; } - if (PlayerInput.UsingGamepad) - { - Main.npcChatRelease = false; - this.tileInteractionHappened = true; - this.releaseInventory = false; - Main.mouseRight = true; - } } if (!interactAreShared) return; this.GamepadEnableGrappleCooldown(); } - private static void OpenInventory() - { - Recipe.FindRecipes(); - Main.playerInventory = true; - Main.EquipPageSelected = 0; - SoundEngine.PlaySound(10); - } - - public void ToggleCreativeMenu() - { - if (this.dead || this.difficulty != (byte) 3) - return; - bool flag = false; - if (Main.mapFullscreen) - { - Main.mapFullscreen = false; - flag = true; - } - if (PlayerInput.InBuildingMode) - PlayerInput.ExitBuildingMode(); - if (Main.ingameOptionsWindow) - IngameOptions.Close(); - if (Main.inFancyUI) - IngameFancyUI.Close(); - if (CaptureManager.Instance.Active) - CaptureManager.Instance.Active = false; - if (this.talkNPC >= 0) - { - this.SetTalkNPC(-1); - Main.npcChatCornerItem = 0; - Main.npcChatText = ""; - flag = true; - if (PlayerInput.UsingGamepad) - Main.npcChatRelease = false; - } - if (this.sign >= 0) - { - this.sign = -1; - Main.editSign = false; - Main.npcChatText = ""; - flag = true; - } - else if (Main.clothesWindow) - Main.CancelClothesWindow(); - if (this.tileEntityAnchor.InUse) - { - Recipe.FindRecipes(); - this.tileEntityAnchor.Clear(); - flag = true; - } - if (flag) - SoundEngine.PlaySound(11); - if (!Main.playerInventory) - Player.OpenInventory(); - Main.CreativeMenu.ToggleMenu(); - } - public void dropItemCheck() { if (!Main.playerInventory) this.noThrow = 0; if (this.noThrow > 0) --this.noThrow; - GetItemSettings itemInDropItemCheck = GetItemSettings.GetItemInDropItemCheck; if (!Main.InGuideCraftMenu && Main.guideItem.type > 0) { Main.guideItem.position = this.Center; - Item obj = this.GetItem(this.whoAmI, Main.guideItem, itemInDropItemCheck); + Item obj = this.GetItem(this.whoAmI, Main.guideItem, noText: true); if (obj.stack > 0) { int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, obj.type, obj.stack, pfix: ((int) Main.guideItem.prefix), noGrabDelay: true); @@ -1729,7 +1153,7 @@ namespace Terraria if (!Main.InReforgeMenu && Main.reforgeItem.type > 0) { Main.reforgeItem.position = this.Center; - Item obj = this.GetItem(this.whoAmI, Main.reforgeItem, itemInDropItemCheck); + Item obj = this.GetItem(this.whoAmI, Main.reforgeItem, noText: true); if (obj.stack > 0) { int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, obj.type, obj.stack, pfix: ((int) Main.reforgeItem.prefix), noGrabDelay: true); @@ -1756,15 +1180,19 @@ namespace Terraria this.selectedItem = 58; flag = false; } - if (flag && this.selectedItem == 58 && this.ItemTimeIsZero && this.itemAnimation == 0) + if (flag && this.selectedItem == 58 && this.itemTime == 0 && this.itemAnimation == 0) this.selectedItem = this.oldSelectItem; + if (WorldGen.InWorld(Player.tileTargetX, Player.tileTargetY) && Main.tile[Player.tileTargetX, Player.tileTargetY] != null && Main.tile[Player.tileTargetX, Player.tileTargetY].type == (ushort) 334 && this.ItemFitsWeaponRack(this.inventory[this.selectedItem])) + this.noThrow = 2; + if (WorldGen.InWorld(Player.tileTargetX, Player.tileTargetY) && Main.tile[Player.tileTargetX, Player.tileTargetY] != null && Main.tile[Player.tileTargetX, Player.tileTargetY].type == (ushort) 395 && this.ItemFitsItemFrame(this.inventory[this.selectedItem])) + this.noThrow = 2; if (Main.mouseItem.type > 0 && !Main.playerInventory) { Main.mouseItem.position = this.Center; - Item obj = this.GetItem(this.whoAmI, Main.mouseItem, itemInDropItemCheck); + Item obj = this.GetItem(this.whoAmI, Main.mouseItem, noText: true); if (obj.stack > 0) { - int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, obj.type, obj.stack, pfix: ((int) Main.mouseItem.prefix), noGrabDelay: true); + int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, obj.type, obj.stack, noGrabDelay: true); Main.item[number].newAndShiny = false; if (Main.netMode == 1) NetMessage.SendData(21, number: number, number2: 1f); @@ -1782,32 +1210,41 @@ namespace Terraria public void DropSelectedItem() { - bool flag = false; + bool flag1 = false; if (this.inventory[this.selectedItem].favorited) { - this.inventory[this.selectedItem] = this.GetItem(this.whoAmI, this.inventory[this.selectedItem], GetItemSettings.GetItemInDropItemCheck); + this.inventory[this.selectedItem] = this.GetItem(this.whoAmI, this.inventory[this.selectedItem], noText: true); if (this.selectedItem == 58) Main.mouseItem = this.inventory[this.selectedItem]; Recipe.FindRecipes(); if (this.inventory[this.selectedItem].type == 0) - flag = true; + flag1 = true; } - if (flag) + if (flag1) return; Item obj = new Item(); + bool flag2 = false; if ((Main.mouseRight && !this.mouseInterface && Main.mouseRightRelease || !Main.playerInventory) && Main.mouseItem.type > 0 && Main.mouseItem.stack > 0) { obj = this.inventory[this.selectedItem]; this.inventory[this.selectedItem] = Main.mouseItem; this.delayUseItem = true; this.controlUseItem = false; + flag2 = true; } int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, this.inventory[this.selectedItem].type); - this.inventory[this.selectedItem].position = Main.item[number].position; - Main.item[number] = this.inventory[this.selectedItem]; - this.inventory[this.selectedItem] = new Item(); - if (this.selectedItem == 58) - Main.mouseItem = new Item(); + if (!flag2 && this.inventory[this.selectedItem].type == 8 && this.inventory[this.selectedItem].stack > 1) + { + --this.inventory[this.selectedItem].stack; + } + else + { + this.inventory[this.selectedItem].position = Main.item[number].position; + Main.item[number] = this.inventory[this.selectedItem]; + this.inventory[this.selectedItem] = new Item(); + if (this.selectedItem == 58) + Main.mouseItem = new Item(); + } if (Main.netMode == 0) Main.item[number].noGrabDelay = 100; Main.item[number].velocity.Y = -2f; @@ -1821,9 +1258,8 @@ namespace Terraria } else { - this.SetItemAnimation(10); - this.JustDroppedAnItem = true; - this.DropSelectedItem_InterruptActionsThatUseAnimations(); + this.itemAnimation = 10; + this.itemAnimationMax = 10; } Recipe.FindRecipes(); if (Main.netMode != 1) @@ -1831,22 +1267,6 @@ namespace Terraria NetMessage.SendData(21, number: number); } - private void DropSelectedItem_InterruptActionsThatUseAnimations() - { - if (this.heldProj >= 0) - { - Projectile projectile = Main.projectile[this.heldProj]; - if (projectile.active && projectile.owner == this.whoAmI) - projectile.Kill(); - } - for (int index = 0; index < 1000; ++index) - { - Projectile projectile = Main.projectile[index]; - if (projectile.active && projectile.owner == this.whoAmI && (projectile.aiStyle == 61 || projectile.aiStyle == 160)) - projectile.Kill(); - } - } - public int FindBuffIndex(int type) { if (this.buffImmune[type]) @@ -1859,49 +1279,74 @@ namespace Terraria return -1; } - public void AddBuff(int type, int timeToAdd, bool quiet = true, bool foodHack = false) + public void AddBuff(int type, int time1, bool quiet = true) { if (this.buffImmune[type]) return; - if (BuffID.Sets.IsWellFed[type]) + int num = time1; + if (Main.expertMode && this.whoAmI == Main.myPlayer && (type == 20 || type == 22 || type == 23 || type == 24 || type == 30 || type == 31 || type == 32 || type == 33 || type == 35 || type == 36 || type == 39 || type == 44 || type == 46 || type == 47 || type == 69 || type == 70 || type == 80)) + num = (int) ((double) Main.expertDebuffTime * (double) num); + if (!quiet && Main.netMode == 1) + { + bool flag = true; + for (int index = 0; index < 22; ++index) + { + if (this.buffType[index] == type) + { + flag = false; + break; + } + } + if (flag) + NetMessage.SendData(55, number: this.whoAmI, number2: ((float) type), number3: ((float) num)); + } + int index1 = -1; + for (int index2 = 0; index2 < 22; ++index2) + { + if (this.buffType[index2] == type) + { + if (type == 94) + { + this.buffTime[index2] += num; + if (this.buffTime[index2] <= Player.manaSickTimeMax) + return; + this.buffTime[index2] = Player.manaSickTimeMax; + return; + } + if (this.buffTime[index2] >= num) + return; + this.buffTime[index2] = num; + return; + } + } + if (Main.vanityPet[type] || Main.lightPet[type]) { for (int b = 0; b < 22; ++b) { - if (BuffID.Sets.IsWellFed[this.buffType[b]]) + if (Main.vanityPet[type] && Main.vanityPet[this.buffType[b]]) + this.DelBuff(b); + if (Main.lightPet[type] && Main.lightPet[this.buffType[b]]) this.DelBuff(b); } } - int buffTimeToAdd = this.AddBuff_DetermineBuffTimeToAdd(type, timeToAdd); - if (this.AddBuff_TryUpdatingExistingBuffTime(type, buffTimeToAdd)) - return; - if (!quiet && Main.netMode == 1) - NetMessage.SendData(55, number: this.whoAmI, number2: ((float) type), number3: ((float) buffTimeToAdd)); - this.AddBuff_RemoveOldPetBuffsOfMatchingType(type); - this.AddBuff_RemoveOldMeleeBuffsOfMatchingType(type); - this.AddBuff_ActuallyTryToAddTheBuff(type, buffTimeToAdd); - } - - private bool AddBuff_ActuallyTryToAddTheBuff(int type, int time) - { - int index1 = -1; while (index1 == -1) { int b = -1; - for (int index2 = 0; index2 < 22; ++index2) + for (int index3 = 0; index3 < 22; ++index3) { - if (!Main.debuff[this.buffType[index2]]) + if (!Main.debuff[this.buffType[index3]]) { - b = index2; + b = index3; break; } } if (b == -1) - return false; - for (int index3 = b; index3 < 22; ++index3) + return; + for (int index4 = b; index4 < 22; ++index4) { - if (this.buffType[index3] == 0) + if (this.buffType[index4] == 0) { - index1 = index3; + index1 = index4; break; } } @@ -1909,73 +1354,16 @@ namespace Terraria this.DelBuff(b); } this.buffType[index1] = type; - this.buffTime[index1] = time; - return true; - } - - private void AddBuff_RemoveOldMeleeBuffsOfMatchingType(int type) - { + this.buffTime[index1] = num; if (!Main.meleeBuff[type]) return; for (int b = 0; b < 22; ++b) { - if (this.buffType[b] != type && Main.meleeBuff[this.buffType[b]]) - { - this.DelBuff(b); - --b; - } - } - } - - private void AddBuff_RemoveOldPetBuffsOfMatchingType(int type) - { - if (Main.lightPet[type]) - { - for (int b = 0; b < 22; ++b) - { - if (Main.lightPet[this.buffType[b]]) - this.DelBuff(b); - } - } - if (!Main.vanityPet[type]) - return; - for (int b = 0; b < 22; ++b) - { - if (Main.vanityPet[this.buffType[b]]) + if (b != index1 && Main.meleeBuff[this.buffType[b]]) this.DelBuff(b); } } - private bool AddBuff_TryUpdatingExistingBuffTime(int type, int time) - { - bool flag = false; - for (int index = 0; index < 22; ++index) - { - if (this.buffType[index] == type) - { - if (type == 94) - { - this.buffTime[index] += time; - if (this.buffTime[index] > Player.manaSickTimeMax) - this.buffTime[index] = Player.manaSickTimeMax; - } - else if (this.buffTime[index] < time) - this.buffTime[index] = time; - flag = true; - break; - } - } - return flag; - } - - private int AddBuff_DetermineBuffTimeToAdd(int type, int time1) - { - int num = time1; - if (Main.expertMode && this.whoAmI == Main.myPlayer && (type == 20 || type == 22 || type == 23 || type == 24 || type == 30 || type == 31 || type == 32 || type == 33 || type == 35 || type == 36 || type == 39 || type == 44 || type == 46 || type == 47 || type == 69 || type == 70 || type == 80)) - num = (int) ((double) Main.GameModeInfo.DebuffTimeMultiplier * (double) num); - return num; - } - public void DelBuff(int b) { this.buffTime[b] = 0; @@ -1986,14 +1374,10 @@ namespace Terraria { for (int index2 = index1 + 1; index2 < 22; ++index2) { - if (this.buffTime[index2] > 0 && this.buffType[index2] > 0) - { - this.buffTime[index1] = this.buffTime[index2]; - this.buffType[index1] = this.buffType[index2]; - this.buffTime[index2] = 0; - this.buffType[index2] = 0; - break; - } + this.buffTime[index2 - 1] = this.buffTime[index2]; + this.buffType[index2 - 1] = this.buffType[index2]; + this.buffTime[index2] = 0; + this.buffType[index2] = 0; } } } @@ -2021,12 +1405,12 @@ namespace Terraria public void QuickHeal() { - if (this.cursed || this.CCed || this.dead || this.statLife == this.statLifeMax2 || this.potionDelay > 0) + if (this.noItems || this.statLife == this.statLifeMax2 || this.potionDelay > 0) return; Item itemToUse = this.QuickHeal_GetItemToUse(); if (itemToUse == null) return; - SoundEngine.PlaySound(itemToUse.UseSound, this.position); + Main.PlaySound(itemToUse.UseSound, this.position); if (itemToUse.potion) { if (itemToUse.type == 227) @@ -2071,12 +1455,6 @@ namespace Terraria if (obj2.stack > 0 && obj2.type > 0 && obj2.potion && obj2.healLife > 0) { int num3 = obj2.healLife - num1; - if (obj2.type == 227 && num3 < 0) - { - num3 += 30; - if (num3 > 0) - num3 = 0; - } if (num2 < 0) { if (num3 > num2) @@ -2097,13 +1475,13 @@ namespace Terraria public void QuickMana() { - if (this.cursed || this.CCed || this.dead || this.statMana == this.statManaMax2) + if (this.noItems || this.statMana == this.statManaMax2) return; for (int index = 0; index < 58; ++index) { if (this.inventory[index].stack > 0 && this.inventory[index].type > 0 && this.inventory[index].healMana > 0 && (this.potionDelay == 0 || !this.inventory[index].potion)) { - SoundEngine.PlaySound(this.inventory[index].UseSound, this.position); + Main.PlaySound(this.inventory[index].UseSound, this.position); if (this.inventory[index].potion) { if (this.inventory[index].type == 227) @@ -2152,163 +1530,87 @@ namespace Terraria public void QuickBuff() { - if (this.cursed || this.CCed || this.dead) + if (this.noItems) return; - LegacySoundStyle type = (LegacySoundStyle) null; - if (this.CountBuffs() == 22) - return; - Item obj1 = this.QuickBuff_PickBestFoodItem(); - if (obj1 != null) + LegacySoundStyle type1 = (LegacySoundStyle) null; + for (int index1 = 0; index1 < 58; ++index1) { - type = obj1.UseSound; - int timeToAdd = obj1.buffTime; - if (timeToAdd == 0) - timeToAdd = 3600; - this.AddBuff(obj1.buffType, timeToAdd); - if (obj1.consumable) + if (this.CountBuffs() == 22) + return; + if (this.inventory[index1].stack > 0 && this.inventory[index1].type > 0 && this.inventory[index1].buffType > 0 && !this.inventory[index1].summon && this.inventory[index1].buffType != 90) { - --obj1.stack; - if (obj1.stack <= 0) - obj1.TurnToAir(); - } - } - if (this.CountBuffs() != 22) - { - for (int index = 0; index < 58; ++index) - { - Item obj2 = this.inventory[index]; - if (obj2.stack > 0 && obj2.type > 0 && obj2.buffType > 0 && !obj2.summon) + int type2 = this.inventory[index1].buffType; + bool flag = true; + for (int index2 = 0; index2 < 22; ++index2) { - int num = obj2.buffType; - bool flag = this.QuickBuff_ShouldBotherUsingThisBuff(num); - if (obj2.mana > 0 & flag) + if (type2 == 27 && (this.buffType[index2] == type2 || this.buffType[index2] == 101 || this.buffType[index2] == 102)) { - if (this.statMana >= (int) ((double) obj2.mana * (double) this.manaCost)) - { - this.manaRegenDelay = (int) this.maxRegenDelay; - this.statMana -= (int) ((double) obj2.mana * (double) this.manaCost); - } - else + flag = false; + break; + } + if (this.buffType[index2] == type2) + { + flag = false; + break; + } + if (Main.meleeBuff[type2] && Main.meleeBuff[this.buffType[index2]]) + { + flag = false; + break; + } + } + if (Main.lightPet[this.inventory[index1].buffType] || Main.vanityPet[this.inventory[index1].buffType]) + { + for (int index3 = 0; index3 < 22; ++index3) + { + if (Main.lightPet[this.buffType[index3]] && Main.lightPet[this.inventory[index1].buffType]) + flag = false; + if (Main.vanityPet[this.buffType[index3]] && Main.vanityPet[this.inventory[index1].buffType]) flag = false; } - if (this.whoAmI == Main.myPlayer && obj2.type == 603 && !Main.runningCollectorsEdition) - flag = false; - if (num == 27) - { - num = Main.rand.Next(3); - if (num == 0) - num = 27; - if (num == 1) - num = 101; - if (num == 2) - num = 102; - } - if (flag) - { - type = obj2.UseSound; - int timeToAdd = obj2.buffTime; - if (timeToAdd == 0) - timeToAdd = 3600; - this.AddBuff(num, timeToAdd); - if (obj2.consumable) - { - --obj2.stack; - if (obj2.stack <= 0) - obj2.TurnToAir(); - } - if (this.CountBuffs() == 22) - break; - } } - } - } - if (type == null) - return; - SoundEngine.PlaySound(type, this.position); - Recipe.FindRecipes(); - } - - private Item QuickBuff_PickBestFoodItem() - { - int num = 0; - Item obj1 = (Item) null; - for (int index = 0; index < 22; ++index) - { - if (this.buffTime[index] >= 1) - { - int foodPriority = this.QuickBuff_FindFoodPriority(this.buffType[index]); - if (num <= foodPriority) - num = foodPriority + 1; - } - } - for (int index = 0; index < 58; ++index) - { - Item obj2 = this.inventory[index]; - if (!obj2.IsAir) - { - int foodPriority = this.QuickBuff_FindFoodPriority(obj2.buffType); - if (foodPriority >= num && (obj1 == null || obj1.buffTime < obj2.buffTime || foodPriority > num)) + if (this.inventory[index1].mana > 0 & flag) { - obj1 = obj2; - num = foodPriority; + if (this.statMana >= (int) ((double) this.inventory[index1].mana * (double) this.manaCost)) + { + this.manaRegenDelay = (int) this.maxRegenDelay; + this.statMana -= (int) ((double) this.inventory[index1].mana * (double) this.manaCost); + } + else + flag = false; + } + if (this.whoAmI == Main.myPlayer && this.inventory[index1].type == 603 && !Main.cEd) + flag = false; + if (type2 == 27) + { + type2 = Main.rand.Next(3); + if (type2 == 0) + type2 = 27; + if (type2 == 1) + type2 = 101; + if (type2 == 2) + type2 = 102; + } + if (flag) + { + type1 = this.inventory[index1].UseSound; + int time1 = this.inventory[index1].buffTime; + if (time1 == 0) + time1 = 3600; + this.AddBuff(type2, time1); + if (this.inventory[index1].consumable) + { + --this.inventory[index1].stack; + if (this.inventory[index1].stack <= 0) + this.inventory[index1].TurnToAir(); + } } } } - return obj1; - } - - private int QuickBuff_FindFoodPriority(int buffType) - { - switch (buffType) - { - case 26: - return 1; - case 206: - return 2; - case 207: - return 3; - default: - return 0; - } - } - - private bool QuickBuff_ShouldBotherUsingThisBuff(int attemptedType) - { - bool flag = true; - for (int index = 0; index < 22; ++index) - { - if (attemptedType == 27 && (this.buffType[index] == 27 || this.buffType[index] == 101 || this.buffType[index] == 102)) - { - flag = false; - break; - } - if (BuffID.Sets.IsWellFed[attemptedType] && BuffID.Sets.IsWellFed[this.buffType[index]]) - { - flag = false; - break; - } - if (this.buffType[index] == attemptedType) - { - flag = false; - break; - } - if (Main.meleeBuff[attemptedType] && Main.meleeBuff[this.buffType[index]]) - { - flag = false; - break; - } - } - if (Main.lightPet[attemptedType] || Main.vanityPet[attemptedType]) - { - for (int index = 0; index < 22; ++index) - { - if (Main.lightPet[this.buffType[index]] && Main.lightPet[attemptedType]) - flag = false; - if (Main.vanityPet[this.buffType[index]] && Main.vanityPet[attemptedType]) - flag = false; - } - } - return flag; + if (type1 == null) + return; + Main.PlaySound(type1, this.position); + Recipe.FindRecipes(); } public void QuickMount() @@ -2319,88 +1621,74 @@ namespace Terraria } else { - if (this.frozen || this.tongued || this.webbed || this.stoned || (double) this.gravDir == -1.0 || this.dead || this.noItems) + if (this.frozen || this.tongued || this.webbed || this.stoned || (double) this.gravDir == -1.0 || this.noItems) return; Item itemToUse = this.QuickMount_GetItemToUse(); if (itemToUse != null && itemToUse.mountType != -1 && this.mount.CanMount(itemToUse.mountType, this)) { - if (this.QuickMinecartSnap()) + bool flag = false; + List tilesIn = Collision.GetTilesIn(this.TopLeft - new Vector2(24f), this.BottomRight + new Vector2(24f)); + if (tilesIn.Count > 0) + { + Point? nullable = new Point?(); + Microsoft.Xna.Framework.Rectangle hitbox = this.Hitbox; + for (int index = 0; index < tilesIn.Count; ++index) + { + Point point = tilesIn[index]; + Tile tileSafely = Framing.GetTileSafely(point.X, point.Y); + if (tileSafely.active() && tileSafely.type == (ushort) 314) + { + Vector2 vector2 = tilesIn[index].ToVector2() * 16f + new Vector2(8f); + if (!nullable.HasValue || (double) this.Distance(vector2) < (double) this.Distance(nullable.Value.ToVector2() * 16f + new Vector2(8f)) && Collision.CanHitLine(this.Center, 0, 0, vector2, 0, 0)) + nullable = new Point?(tilesIn[index]); + } + } + if (nullable.HasValue) + { + this.LaunchMinecartHook(nullable.Value.X, nullable.Value.Y); + flag = true; + } + } + if (flag) return; this.mount.SetMount(itemToUse.mountType, this); if (itemToUse.UseSound == null) return; - SoundEngine.PlaySound(itemToUse.UseSound, this.Center); + Main.PlaySound(itemToUse.UseSound, this.Center); } else - this.QuickMinecart(); - } - } - - public bool CanFitSpace(int heightBoost) - { - int Height = 42 + heightBoost; - return Collision.IsClearSpotTest(this.position + new Vector2(0.0f, (float) (this.height - Height)) + this.velocity, 16f, this.width, Height, true, true); - } - - private void QuickMinecart() - { - int num1 = 0; - int num2 = (int) ((double) this.position.X / 16.0) - Player.tileRangeX - num1 + 1; - int num3 = (int) (((double) this.position.X + (double) this.width) / 16.0) + Player.tileRangeX + num1 - 1; - int num4 = (int) ((double) this.position.Y / 16.0) - Player.tileRangeY - num1 + 1; - int num5 = (int) (((double) this.position.Y + (double) this.height) / 16.0) + Player.tileRangeY + num1 - 2; - int max = Main.maxTilesX - 10; - int num6 = Utils.Clamp(num2, 10, max); - int num7 = Utils.Clamp(num3, 10, Main.maxTilesX - 10); - int num8 = Utils.Clamp(num4, 10, Main.maxTilesY - 10); - int num9 = Utils.Clamp(num5, 10, Main.maxTilesY - 10); - List tilesIn = Collision.GetTilesIn(new Vector2((float) num6, (float) num8) * 16f, new Vector2((float) (num7 + 1), (float) (num9 + 1)) * 16f); - if (tilesIn.Count <= 0) - return; - Point? nullable = new Point?(); - Microsoft.Xna.Framework.Rectangle hitbox = this.Hitbox; - for (int index = 0; index < tilesIn.Count; ++index) - { - Point point = tilesIn[index]; - Tile tileSafely = Framing.GetTileSafely(point.X, point.Y); - if (tileSafely.active() && tileSafely.type == (ushort) 314) { - Vector2 vector2 = tilesIn[index].ToVector2() * 16f + new Vector2(8f); - if (!nullable.HasValue || (double) this.Distance(vector2) < (double) this.Distance(nullable.Value.ToVector2() * 16f + new Vector2(8f)) && Collision.CanHitLine(this.Center, 0, 0, vector2, 0, 0)) - nullable = new Point?(tilesIn[index]); - } - } - if (!nullable.HasValue) - return; - this.LaunchMinecartHook(nullable.Value.X, nullable.Value.Y); - } - - private bool QuickMinecartSnap() - { - bool flag = false; - List tilesIn = Collision.GetTilesIn(this.TopLeft - new Vector2(24f), this.BottomRight + new Vector2(24f)); - if (tilesIn.Count > 0) - { - Point? nullable = new Point?(); - Microsoft.Xna.Framework.Rectangle hitbox = this.Hitbox; - for (int index = 0; index < tilesIn.Count; ++index) - { - Point point = tilesIn[index]; - Tile tileSafely = Framing.GetTileSafely(point.X, point.Y); - if (tileSafely.active() && tileSafely.type == (ushort) 314) + int num1 = 0; + int num2 = (int) ((double) this.position.X / 16.0) - Player.tileRangeX - num1 + 1; + int num3 = (int) (((double) this.position.X + (double) this.width) / 16.0) + Player.tileRangeX + num1 - 1; + int num4 = (int) ((double) this.position.Y / 16.0) - Player.tileRangeY - num1 + 1; + int num5 = (int) (((double) this.position.Y + (double) this.height) / 16.0) + Player.tileRangeY + num1 - 2; + int max = Main.maxTilesX - 10; + int num6 = Utils.Clamp(num2, 10, max); + int num7 = Utils.Clamp(num3, 10, Main.maxTilesX - 10); + int num8 = Utils.Clamp(num4, 10, Main.maxTilesY - 10); + int num9 = Utils.Clamp(num5, 10, Main.maxTilesY - 10); + List tilesIn = Collision.GetTilesIn(new Vector2((float) num6, (float) num8) * 16f, new Vector2((float) (num7 + 1), (float) (num9 + 1)) * 16f); + if (tilesIn.Count <= 0) + return; + Point? nullable = new Point?(); + Microsoft.Xna.Framework.Rectangle hitbox = this.Hitbox; + for (int index = 0; index < tilesIn.Count; ++index) { - Vector2 vector2 = tilesIn[index].ToVector2() * 16f + new Vector2(8f); - if (!nullable.HasValue || (double) this.Distance(vector2) < (double) this.Distance(nullable.Value.ToVector2() * 16f + new Vector2(8f)) && Collision.CanHitLine(this.Center, 0, 0, vector2, 0, 0)) - nullable = new Point?(tilesIn[index]); + Point point = tilesIn[index]; + Tile tileSafely = Framing.GetTileSafely(point.X, point.Y); + if (tileSafely.active() && tileSafely.type == (ushort) 314) + { + Vector2 vector2 = tilesIn[index].ToVector2() * 16f + new Vector2(8f); + if (!nullable.HasValue || (double) this.Distance(vector2) < (double) this.Distance(nullable.Value.ToVector2() * 16f + new Vector2(8f)) && Collision.CanHitLine(this.Center, 0, 0, vector2, 0, 0)) + nullable = new Point?(tilesIn[index]); + } } - } - if (nullable.HasValue) - { + if (!nullable.HasValue) + return; this.LaunchMinecartHook(nullable.Value.X, nullable.Value.Y); - flag = true; } } - return flag; } public Item QuickMount_GetItemToUse() @@ -2422,33 +1710,9 @@ namespace Terraria return obj; } - public void ClearGrapplingBlacklist() => this._blackListedTileCoordsForGrappling.Clear(); - - public bool IsBlacklistedForGrappling(Point p) => this._blackListedTileCoordsForGrappling.Contains(p); - - public void UpdateBlacklistedTilesForGrappling() - { - this.ClearGrapplingBlacklist(); - for (int index1 = 0; index1 < 1000; ++index1) - { - if (Main.projectile[index1].active && Main.projectile[index1].owner == this.whoAmI && Main.projectile[index1].aiStyle == 7 && (double) Main.projectile[index1].ai[0] == 2.0) - { - Point tileCoordinates = Main.projectile[index1].Center.ToTileCoordinates(); - for (int index2 = -1; index2 <= 1; ++index2) - { - for (int index3 = -1; index3 <= 1; ++index3) - { - if (!WorldGen.SolidTile(tileCoordinates.X + index2, tileCoordinates.Y + index3)) - this._blackListedTileCoordsForGrappling.Add(new Point(tileCoordinates.X + index2, tileCoordinates.Y + index3)); - } - } - } - } - } - public void QuickGrapple() { - if (this.frozen || this.tongued || this.webbed || this.stoned || this.dead) + if (this.frozen || this.tongued || this.webbed || this.stoned) return; if (PlayerInput.GrappleAndInteractAreShared) { @@ -2462,11 +1726,24 @@ namespace Terraria if (tileSafely.active() && (tileSafely.type == (ushort) 4 || tileSafely.type == (ushort) 33 || tileSafely.type == (ushort) 372 || tileSafely.type == (ushort) 174 || tileSafely.type == (ushort) 49) || this.inventory[this.selectedItem].type == 3384) return; } - if (this.noItems) - return; if (this.mount.Active) this.mount.Dismount(this); - Item obj = this.QuickGrapple_GetItemToUse(); + if (this.noItems) + return; + Item obj = (Item) null; + if (obj == null && Main.projHook[this.miscEquips[4].shoot]) + obj = this.miscEquips[4]; + if (obj == null) + { + for (int index = 0; index < 58; ++index) + { + if (Main.projHook[this.inventory[index].shoot]) + { + obj = this.inventory[index]; + break; + } + } + } if (obj == null) return; if (obj.shoot == 73) @@ -2542,15 +1819,14 @@ namespace Terraria } if (obj == null) return; - this.UpdateBlacklistedTilesForGrappling(); - SoundEngine.PlaySound(obj.UseSound, this.position); + Main.PlaySound(obj.UseSound, this.position); if (Main.netMode == 1 && this.whoAmI == Main.myPlayer) NetMessage.SendData(51, number: this.whoAmI, number2: 2f); int Type = obj.shoot; float shootSpeed = obj.shootSpeed; int damage = obj.damage; float knockBack = obj.knockBack; - if (Type == 13 || Type == 32 || Type == 315 || Type >= 230 && Type <= 235 || Type == 331 || Type == 753 || Type == 865 || Type == 935) + if (Type == 13 || Type == 32 || Type == 315 || Type >= 230 && Type <= 235 || Type == 331) { this.grappling[0] = -1; this.grapCount = 0; @@ -2558,25 +1834,14 @@ namespace Terraria { if (Main.projectile[index].active && Main.projectile[index].owner == this.whoAmI) { - switch (Main.projectile[index].type) - { - case 13: - case 230: - case 231: - case 232: - case 233: - case 234: - case 235: - case 315: - case 331: - case 753: - case 865: - case 935: - Main.projectile[index].Kill(); - continue; - default: - continue; - } + if (Main.projectile[index].type == 13) + Main.projectile[index].Kill(); + if (Main.projectile[index].type == 331) + Main.projectile[index].Kill(); + if (Main.projectile[index].type == 315) + Main.projectile[index].Kill(); + if (Main.projectile[index].type >= 230 && Main.projectile[index].type <= 235) + Main.projectile[index].Kill(); } } } @@ -2678,26 +1943,7 @@ namespace Terraria Projectile.NewProjectile(vector2.X, vector2.Y, SpeedX, SpeedY, Type, damage, knockBack, this.whoAmI); } - public Item QuickGrapple_GetItemToUse() - { - Item obj = (Item) null; - if (Main.projHook[this.miscEquips[4].shoot]) - obj = this.miscEquips[4]; - if (obj == null) - { - for (int index = 0; index < 58; ++index) - { - if (Main.projHook[this.inventory[index].shoot]) - { - obj = this.inventory[index]; - break; - } - } - } - return obj; - } - - public void StatusToNPC(int type, int i) + public void StatusNPC(int type, int i) { if (this.meleeEnchant > (byte) 0) { @@ -2767,7 +2013,7 @@ namespace Terraria } } - public void StatusToPlayerPvP(int type, int i) + public void StatusPvP(int type, int i) { if (this.meleeEnchant > (byte) 0) { @@ -2834,38 +2080,13 @@ namespace Terraria { this.immune = false; this.immuneAlpha = 0; - if (Main.hasFocus && this.whoAmI == Main.myPlayer) - { - this.controlUp = false; - this.controlLeft = false; - this.controlDown = false; - this.controlRight = false; - this.controlJump = false; - if (!Main.drawingPlayerChat && !Main.editSign && !Main.editChest && !Main.blockInput) - { - PlayerInput.Triggers.Current.CopyInto(this); - if (Main.netMode == 1) - { - bool flag = false; - if (this.controlUp != Main.clientPlayer.controlUp) - flag = true; - if (this.controlDown != Main.clientPlayer.controlDown) - flag = true; - if (this.controlLeft != Main.clientPlayer.controlLeft) - flag = true; - if (this.controlRight != Main.clientPlayer.controlRight) - flag = true; - if (this.controlJump != Main.clientPlayer.controlJump) - flag = true; - if (this.controlUseItem != Main.clientPlayer.controlUseItem) - flag = true; - if (this.selectedItem != Main.clientPlayer.selectedItem) - flag = true; - if (flag) - NetMessage.SendData(13, number: Main.myPlayer); - } - } - } + this.controlUp = false; + this.controlLeft = false; + this.controlDown = false; + this.controlRight = false; + this.controlJump = false; + if (Main.hasFocus && !Main.drawingPlayerChat && !Main.editSign && !Main.editChest && !Main.blockInput) + PlayerInput.Triggers.Current.CopyInto(this); if (this.controlUp || this.controlJump) { if ((double) this.velocity.Y > 0.0) @@ -2919,44 +2140,65 @@ namespace Terraria if (this.ghostFrame >= 4) this.ghostFrame = 0; } - if ((double) this.position.X < (double) Main.leftWorld + (double) (Lighting.OffScreenTiles * 16) + 16.0) + if ((double) this.position.X < (double) Main.leftWorld + (double) (Lighting.offScreenTiles * 16) + 16.0) { - this.position.X = (float) ((double) Main.leftWorld + (double) (Lighting.OffScreenTiles * 16) + 16.0); + this.position.X = (float) ((double) Main.leftWorld + (double) (Lighting.offScreenTiles * 16) + 16.0); this.velocity.X = 0.0f; } - if ((double) this.position.X + (double) this.width > (double) Main.rightWorld - (double) (Lighting.OffScreenTiles * 16) - 32.0) + if ((double) this.position.X + (double) this.width > (double) Main.rightWorld - (double) (Lighting.offScreenTiles * 16) - 32.0) { - this.position.X = (float) ((double) Main.rightWorld - (double) (Lighting.OffScreenTiles * 16) - 32.0) - (float) this.width; + this.position.X = (float) ((double) Main.rightWorld - (double) (Lighting.offScreenTiles * 16) - 32.0) - (float) this.width; this.velocity.X = 0.0f; } - if ((double) this.position.Y < (double) Main.topWorld + (double) (Lighting.OffScreenTiles * 16) + 16.0) + if ((double) this.position.Y < (double) Main.topWorld + (double) (Lighting.offScreenTiles * 16) + 16.0) { - this.position.Y = (float) ((double) Main.topWorld + (double) (Lighting.OffScreenTiles * 16) + 16.0); + this.position.Y = (float) ((double) Main.topWorld + (double) (Lighting.offScreenTiles * 16) + 16.0); if ((double) this.velocity.Y < -0.1) this.velocity.Y = -0.1f; } - if ((double) this.position.Y <= (double) Main.bottomWorld - (double) (Lighting.OffScreenTiles * 16) - 32.0 - (double) this.height) + if ((double) this.position.Y <= (double) Main.bottomWorld - (double) (Lighting.offScreenTiles * 16) - 32.0 - (double) this.height) return; - this.position.Y = (float) ((double) Main.bottomWorld - (double) (Lighting.OffScreenTiles * 16) - 32.0) - (float) this.height; + this.position.Y = (float) ((double) Main.bottomWorld - (double) (Lighting.offScreenTiles * 16) - 32.0) - (float) this.height; this.velocity.Y = 0.0f; } + private void OldInputGhost() + { + Keys[] pressedKeys = Main.keyState.GetPressedKeys(); + if (Main.blockKey != Keys.None.ToString()) + { + bool flag = false; + for (int index = 0; index < pressedKeys.Length; ++index) + { + if (pressedKeys[index].ToString() == Main.blockKey) + { + pressedKeys[index] = Keys.None; + flag = true; + } + } + if (!flag) + Main.blockKey = Keys.None.ToString(); + } + for (int index = 0; index < pressedKeys.Length; ++index) + { + string str = string.Concat((object) pressedKeys[index]); + if (str == Main.cUp) + this.controlUp = true; + if (str == Main.cLeft) + this.controlLeft = true; + if (str == Main.cDown) + this.controlDown = true; + if (str == Main.cRight) + this.controlRight = true; + if (str == Main.cJump) + this.controlJump = true; + } + } + public void OnHit(float x, float y, Entity victim) { if (Main.myPlayer != this.whoAmI) return; - bool flag = victim is NPC && ((NPC) victim).type == 488; - if (victim is NPC) - Main.BigBossProgressBar.TryTracking(victim.whoAmI); - if (this.onHitTitaniumStorm && !flag) - { - this.AddBuff(306, 600); - if (this.ownedProjectileCounts[908] < 7) - { - ++this.ownedProjectileCounts[908]; - Projectile.NewProjectile(this.Center, Vector2.Zero, 908, 50, 15f, this.whoAmI); - } - } if (this.onHitDodge && this.shadowDodgeTimer == 0 && Main.rand.Next(4) == 0) { if (!this.shadowDodge) @@ -3248,6 +2490,8 @@ namespace Terraria this.QuickSpawnItem(3090); break; case 3319: + if (this.difficulty == (byte) 2) + this.QuickSpawnItem(3763); if (Main.rand.Next(7) == 0) this.QuickSpawnItem(2112); if (Main.rand.Next(30) == 0) @@ -3335,7 +2579,7 @@ namespace Terraria this.QuickSpawnItem(3335); int num4 = Main.rand.Next(4); this.QuickSpawnItem(num4 != 3 ? 489 + num4 : 2998); - switch (Main.rand.Next(4)) + switch (Main.rand.Next(3)) { case 0: this.QuickSpawnItem(514); @@ -3346,9 +2590,6 @@ namespace Terraria case 2: this.QuickSpawnItem(434); break; - case 3: - this.QuickSpawnItem(4912); - break; } break; case 3325: @@ -3420,9 +2661,7 @@ namespace Terraria this.QuickSpawnItem(3337); if (Main.rand.Next(7) == 0) this.QuickSpawnItem(2110); - if (Main.rand.Next(3) == 0) - this.QuickSpawnItem(1294); - switch (Main.rand.Next(7)) + switch (Main.rand.Next(8)) { case 0: this.QuickSpawnItem(1258); @@ -3438,12 +2677,15 @@ namespace Terraria this.QuickSpawnItem(1248); break; case 4: - this.QuickSpawnItem(1295); + this.QuickSpawnItem(1294); break; case 5: + this.QuickSpawnItem(1295); + break; + case 6: this.QuickSpawnItem(1296); break; - default: + case 7: this.QuickSpawnItem(1297); break; } @@ -3487,15 +2729,12 @@ namespace Terraria this.TryGettingDevArmor(); if (Main.rand.Next(7) == 0) this.QuickSpawnItem(3373); - if (Main.rand.Next(10) == 0) - this.QuickSpawnItem(4469); if (!this.HasItem(3384)) this.QuickSpawnItem(3384); this.QuickSpawnItem(3460, Main.rand.Next(90, 111)); this.QuickSpawnItem(1131); this.QuickSpawnItem(3577); - this.QuickSpawnItem(4954); - this.QuickSpawnItem(Utils.SelectRandom(Main.rand, 3063, 3389, 3065, 1553, 3930, 3541, 3570, 3571, 3569)); + this.QuickSpawnItem(Utils.SelectRandom(Main.rand, 3063, 3389, 3065, 1553, 3546, 3541, 3570, 3571, 3569)); break; case 3860: this.TryGettingDevArmor(); @@ -3520,49 +2759,6 @@ namespace Terraria this.QuickSpawnItem(3883); this.QuickSpawnItem(3817, Main.rand.Next(30, 50)); break; - case 4782: - this.TryGettingDevArmor(); - this.QuickSpawnItem(4989); - if (Main.rand.Next(7) == 0) - this.QuickSpawnItem(4784); - if (Main.rand.Next(10) == 0) - this.QuickSpawnItem(4823); - if (Main.rand.Next(20) == 0) - this.QuickSpawnItem(4715); - if (Main.rand.Next(4) == 0) - this.QuickSpawnItem(4778); - switch (Main.rand.Next(4)) - { - case 0: - this.QuickSpawnItem(4923); - break; - case 1: - this.QuickSpawnItem(4952); - break; - case 2: - this.QuickSpawnItem(4953); - break; - case 3: - this.QuickSpawnItem(4914); - break; - } - break; - case 4957: - this.QuickSpawnItem(4987); - this.QuickSpawnItem(4986, Main.rand.Next(25, 75)); - if (Main.rand.Next(7) == 0) - this.QuickSpawnItem(4959); - if (Main.rand.Next(2) == 0) - this.QuickSpawnItem(4981); - if (Main.rand.Next(2) == 0) - this.QuickSpawnItem(4980); - int num5 = Main.rand.Next(4982, 4985); - int num6 = Main.rand.Next(4982, 4985); - while (num6 == num5) - num5 = Main.rand.Next(4982, 4985); - this.QuickSpawnItem(num5); - this.QuickSpawnItem(num6); - break; } int Type = -1; if (type == 3318) @@ -3601,49 +2797,45 @@ namespace Terraria Type = 576; if (type == 3862) Type = 564; - if (type == 4782) - Type = 636; - if (type == 4957) - Type = 657; if (Type <= 0) return; NPC npc = new NPC(); npc.SetDefaults(Type); - float num7 = npc.value * (float) (1.0 + (double) Main.rand.Next(-20, 21) * 0.00999999977648258); + float num5 = npc.value * (float) (1.0 + (double) Main.rand.Next(-20, 21) * 0.00999999977648258); if (Main.rand.Next(5) == 0) - num7 *= (float) (1.0 + (double) Main.rand.Next(5, 11) * 0.00999999977648258); + num5 *= (float) (1.0 + (double) Main.rand.Next(5, 11) * 0.00999999977648258); if (Main.rand.Next(10) == 0) - num7 *= (float) (1.0 + (double) Main.rand.Next(10, 21) * 0.00999999977648258); + num5 *= (float) (1.0 + (double) Main.rand.Next(10, 21) * 0.00999999977648258); if (Main.rand.Next(15) == 0) - num7 *= (float) (1.0 + (double) Main.rand.Next(15, 31) * 0.00999999977648258); + num5 *= (float) (1.0 + (double) Main.rand.Next(15, 31) * 0.00999999977648258); if (Main.rand.Next(20) == 0) - num7 *= (float) (1.0 + (double) Main.rand.Next(20, 41) * 0.00999999977648258); - while ((int) num7 > 0) + num5 *= (float) (1.0 + (double) Main.rand.Next(20, 41) * 0.00999999977648258); + while ((int) num5 > 0) { - if ((double) num7 > 1000000.0) + if ((double) num5 > 1000000.0) { - int stack = (int) ((double) num7 / 1000000.0); - num7 -= (float) (1000000 * stack); + int stack = (int) ((double) num5 / 1000000.0); + num5 -= (float) (1000000 * stack); this.QuickSpawnItem(74, stack); } - else if ((double) num7 > 10000.0) + else if ((double) num5 > 10000.0) { - int stack = (int) ((double) num7 / 10000.0); - num7 -= (float) (10000 * stack); + int stack = (int) ((double) num5 / 10000.0); + num5 -= (float) (10000 * stack); this.QuickSpawnItem(73, stack); } - else if ((double) num7 > 100.0) + else if ((double) num5 > 100.0) { - int stack = (int) ((double) num7 / 100.0); - num7 -= (float) (100 * stack); + int stack = (int) ((double) num5 / 100.0); + num5 -= (float) (100 * stack); this.QuickSpawnItem(72, stack); } else { - int stack = (int) num7; + int stack = (int) num5; if (stack < 1) stack = 1; - num7 -= (float) stack; + num5 -= (float) stack; this.QuickSpawnItem(71, stack); } } @@ -3653,7 +2845,7 @@ namespace Terraria { if (Main.rand.Next(20) != 0) return; - switch (Main.rand.Next(18)) + switch (Main.rand.Next(14)) { case 0: this.QuickSpawnItem(666); @@ -3669,7 +2861,6 @@ namespace Terraria this.QuickSpawnItem(1586); break; case 2: - this.QuickSpawnItem(1554); this.QuickSpawnItem(1587); this.QuickSpawnItem(1588); this.QuickSpawnItem(1586); @@ -3731,7 +2922,6 @@ namespace Terraria this.QuickSpawnItem(3599, 4); break; case 12: - this.QuickSpawnItem(3368); this.QuickSpawnItem(3921); this.QuickSpawnItem(3922); this.QuickSpawnItem(3923); @@ -3744,70 +2934,47 @@ namespace Terraria this.QuickSpawnItem(3928); this.QuickSpawnItem(3929); break; - case 14: - this.QuickSpawnItem(4732); - this.QuickSpawnItem(4733); - this.QuickSpawnItem(4734); - this.QuickSpawnItem(4730); - break; - case 15: - this.QuickSpawnItem(4747); - this.QuickSpawnItem(4748); - this.QuickSpawnItem(4749); - this.QuickSpawnItem(4746); - break; - case 16: - this.QuickSpawnItem(4751); - this.QuickSpawnItem(4752); - this.QuickSpawnItem(4753); - this.QuickSpawnItem(4750); - break; - case 17: - this.QuickSpawnItem(4755); - this.QuickSpawnItem(4756); - this.QuickSpawnItem(4757); - this.QuickSpawnItem(4754); - break; } } - public void OpenFishingCrate(int crateItemID) + public void openCrate(int type) { - bool flag1 = ItemID.Sets.IsFishingCrateHardmode[crateItemID]; - switch (crateItemID) + int num = type - 2334; + if (type >= 3203) + num = type - 3203 + 3; + switch (num) { - case 2334: - case 3979: - bool flag2 = true; - while (flag2) + case 0: + bool flag1 = true; + while (flag1) { - if (flag1 & flag2 && Main.rand.Next(200) == 0) + if (Main.hardMode & flag1 && Main.rand.Next(200) == 0) { int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3064); if (Main.netMode == 1) NetMessage.SendData(21, number: number, number2: 1f); - flag2 = false; + flag1 = false; } - if (flag2 && Main.rand.Next(40) == 0) + if (flag1 && Main.rand.Next(40) == 0) { int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3200, pfix: -1); if (Main.netMode == 1) NetMessage.SendData(21, number: number, number2: 1f); - flag2 = false; + flag1 = false; } - if (flag2 && Main.rand.Next(40) == 0) + if (flag1 && Main.rand.Next(40) == 0) { int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3201, pfix: -1); if (Main.netMode == 1) NetMessage.SendData(21, number: number, number2: 1f); - flag2 = false; + flag1 = false; } - if (flag1 & flag2 && Main.rand.Next(25) == 0) + if (Main.hardMode & flag1 && Main.rand.Next(25) == 0) { int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2424, pfix: -1); if (Main.netMode == 1) NetMessage.SendData(21, number: number, number2: 1f); - flag2 = false; + flag1 = false; } if (Main.rand.Next(45) == 0) { @@ -3833,14 +3000,14 @@ namespace Terraria int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, pfix: -1); if (Main.netMode == 1) NetMessage.SendData(21, number: number, number2: 1f); - flag2 = false; + flag1 = false; } - if (!flag1 & flag2 && Main.rand.Next(50) == 0) + if (!Main.hardMode & flag1 && Main.rand.Next(50) == 0) { int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 997); if (Main.netMode == 1) NetMessage.SendData(21, number: number, number2: 1f); - flag2 = false; + flag1 = false; } if (Main.rand.Next(7) == 0) { @@ -3859,106 +3026,130 @@ namespace Terraria int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, Stack); if (Main.netMode == 1) NetMessage.SendData(21, number: number, number2: 1f); - flag2 = false; + flag1 = false; } if (Main.rand.Next(7) == 0) { - int Type = Main.rand.Next(4); + int Type = Main.rand.Next(8); switch (Type) { case 0: Type = 12; break; case 1: - Type = 699; - break; - case 2: Type = 11; break; + case 2: + Type = 14; + break; case 3: + Type = 13; + break; + case 4: + Type = 699; + break; + case 5: Type = 700; break; + case 6: + Type = 701; + break; + case 7: + Type = 702; + break; } - if (Main.rand.Next(2) == 0 & flag1) + if (Main.hardMode && Main.rand.Next(2) == 0) { - Type = Main.rand.Next(2); + Type = Main.rand.Next(6); switch (Type) { case 0: Type = 364; break; case 1: + Type = 365; + break; + case 2: + Type = 366; + break; + case 3: Type = 1104; break; + case 4: + Type = 1105; + break; + case 5: + Type = 1106; + break; } } - int Stack = Main.rand.Next(6, 24); + int Stack = Main.rand.Next(8, 21); int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, Stack); if (Main.netMode == 1) NetMessage.SendData(21, number: number, number2: 1f); - flag2 = false; + flag1 = false; } - else if (Main.rand.Next(8) == 0) + if (Main.rand.Next(8) == 0) { - int Type = Main.rand.Next(4); + int Type = Main.rand.Next(8); switch (Type) { case 0: Type = 20; break; case 1: - Type = 703; - break; - case 2: Type = 22; break; - case 3: - Type = 704; - break; - case 4: + case 2: Type = 21; break; + case 3: + Type = 19; + break; + case 4: + Type = 703; + break; case 5: - Type = 705; + Type = 704; break; case 6: - Type = 19; + Type = 705; break; case 7: Type = 706; break; } int Stack = Main.rand.Next(2, 8); - if (Main.rand.Next(2) == 0 & flag1) + if (Main.hardMode && Main.rand.Next(2) == 0) { - Type = Main.rand.Next(2); + Type = Main.rand.Next(6); switch (Type) { case 0: Type = 381; break; case 1: - Type = 1184; - break; - case 2: Type = 382; break; + case 2: + Type = 391; + break; case 3: - Type = 1191; + Type = 1184; break; case 4: - Type = 391; + Type = 1191; break; case 5: Type = 1198; break; } - Stack = Main.rand.Next(2, 6); + Stack -= Main.rand.Next(2); } int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, Stack); if (Main.netMode == 1) NetMessage.SendData(21, number: number, number2: 1f); - flag2 = false; + flag1 = false; } if (Main.rand.Next(7) == 0) { @@ -4000,7 +3191,7 @@ namespace Terraria int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, Stack); if (Main.netMode == 1) NetMessage.SendData(21, number: number, number2: 1f); - flag2 = false; + flag1 = false; } } if (Main.rand.Next(3) == 0) @@ -4027,158 +3218,120 @@ namespace Terraria break; NetMessage.SendData(21, number: number1, number2: 1f); break; - case 2335: - case 3980: - bool flag3 = true; - while (flag3) + case 1: + bool flag2 = true; + while (flag2) { - if (flag1 & flag3 && Main.rand.Next(60) == 0) + if (Main.hardMode & flag2 && Main.rand.Next(60) == 0) { int number2 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3064); if (Main.netMode == 1) NetMessage.SendData(21, number: number2, number2: 1f); - flag3 = false; + flag2 = false; } - if (flag3 && Main.rand.Next(25) == 0) + if (flag2 && Main.rand.Next(25) == 0) { int number3 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2501); if (Main.netMode == 1) NetMessage.SendData(21, number: number3, number2: 1f); - flag3 = false; + flag2 = false; } - if (flag3 && Main.rand.Next(20) == 0) + if (flag2 && Main.rand.Next(20) == 0) { int number4 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2587); if (Main.netMode == 1) NetMessage.SendData(21, number: number4, number2: 1f); - flag3 = false; + flag2 = false; } - if (flag3 && Main.rand.Next(15) == 0) + if (flag2 && Main.rand.Next(15) == 0) { int number5 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2608, pfix: -1); if (Main.netMode == 1) NetMessage.SendData(21, number: number5, number2: 1f); - flag3 = false; + flag2 = false; } - if (flag3 && Main.rand.Next(20) == 0) + if (flag2 && Main.rand.Next(20) == 0) { int number6 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3200, pfix: -1); if (Main.netMode == 1) NetMessage.SendData(21, number: number6, number2: 1f); - flag3 = false; + flag2 = false; } - if (flag3 && Main.rand.Next(20) == 0) + if (flag2 && Main.rand.Next(20) == 0) { int number7 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3201, pfix: -1); if (Main.netMode == 1) NetMessage.SendData(21, number: number7, number2: 1f); - flag3 = false; + flag2 = false; } if (Main.rand.Next(4) == 0) { int number8 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 73, Main.rand.Next(5, 11)); if (Main.netMode == 1) NetMessage.SendData(21, number: number8, number2: 1f); - flag3 = false; + flag2 = false; } - if (Main.rand.Next(6) == 0) + if (Main.rand.Next(4) == 0) { - int Type = Main.rand.Next(6); - switch (Type) - { - case 0: - Type = 12; - break; - case 1: - Type = 699; - break; - case 2: - Type = 11; - break; - case 3: - Type = 700; - break; - case 4: - Type = 14; - break; - case 5: - Type = 701; - break; - } - if (Main.rand.Next(2) == 0 & flag1) - { - Type = Main.rand.Next(4); - switch (Type) - { - case 0: - Type = 364; - break; - case 1: - Type = 1104; - break; - case 2: - Type = 365; - break; - case 3: - Type = 1105; - break; - } - } - int Stack = Main.rand.Next(18, 30); - int number9 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, Stack); - if (Main.netMode == 1) - NetMessage.SendData(21, number: number9, number2: 1f); - flag3 = false; - } - else if (Main.rand.Next(4) == 0) - { - int Type = Main.rand.Next(6); + int Type = Main.rand.Next(8); switch (Type) { case 0: Type = 20; break; case 1: - Type = 703; - break; - case 2: Type = 22; break; - case 3: - Type = 704; - break; - case 4: + case 2: Type = 21; break; + case 3: + Type = 19; + break; + case 4: + Type = 703; + break; case 5: + Type = 704; + break; + case 6: Type = 705; break; + case 7: + Type = 706; + break; } - int Stack = Main.rand.Next(6, 10); - if ((uint) Main.rand.Next(3) > 0U & flag1) + int Stack = Main.rand.Next(6, 15); + if (Main.hardMode && Main.rand.Next(3) != 0) { - Type = Main.rand.Next(4); + Type = Main.rand.Next(6); switch (Type) { case 0: Type = 381; break; case 1: - Type = 1184; - break; - case 2: Type = 382; break; + case 2: + Type = 391; + break; case 3: + Type = 1184; + break; + case 4: Type = 1191; break; + case 5: + Type = 1198; + break; } Stack -= Main.rand.Next(2); } - int number10 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, Stack); + int number9 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, Stack); if (Main.netMode == 1) - NetMessage.SendData(21, number: number10, number2: 1f); - flag3 = false; + NetMessage.SendData(21, number: number9, number2: 1f); + flag2 = false; } if (Main.rand.Next(4) == 0) { @@ -4211,102 +3364,51 @@ namespace Terraria break; } int Stack = Main.rand.Next(2, 5); - int number11 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, Stack); + int number10 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, Stack); if (Main.netMode == 1) - NetMessage.SendData(21, number: number11, number2: 1f); - flag3 = false; + NetMessage.SendData(21, number: number10, number2: 1f); + flag2 = false; } } if (Main.rand.Next(2) == 0) { - int number12 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Main.rand.Next(188, 190), Main.rand.Next(5, 16)); + int number11 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Main.rand.Next(188, 190), Main.rand.Next(5, 16)); if (Main.netMode == 1) - NetMessage.SendData(21, number: number12, number2: 1f); + NetMessage.SendData(21, number: number11, number2: 1f); } if (Main.rand.Next(2) != 0) break; - int number13 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Main.rand.Next(3) != 0 ? 2675 : 2676, Main.rand.Next(2, 5)); + int number12 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Main.rand.Next(3) != 0 ? 2675 : 2676, Main.rand.Next(2, 5)); if (Main.netMode != 1) break; - NetMessage.SendData(21, number: number13, number2: 1f); + NetMessage.SendData(21, number: number12, number2: 1f); break; - case 2336: - case 3981: - bool flag4 = true; - while (flag4) + case 2: + bool flag3 = true; + while (flag3) { - if (flag1 & flag4 && Main.rand.Next(20) == 0) + if (Main.hardMode & flag3 && Main.rand.Next(20) == 0) { - int number14 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3064); + int number13 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3064); + if (Main.netMode == 1) + NetMessage.SendData(21, number: number13, number2: 1f); + flag3 = false; + } + if (flag3 && Main.rand.Next(10) == 0) + { + int number14 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2491); if (Main.netMode == 1) NetMessage.SendData(21, number: number14, number2: 1f); - flag4 = false; - } - if (flag4 && Main.rand.Next(15) == 0) - { - int number15 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 29); - if (Main.netMode == 1) - NetMessage.SendData(21, number: number15, number2: 1f); - flag4 = false; - } - if (flag4 && Main.rand.Next(10) == 0) - { - int number16 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2491); - if (Main.netMode == 1) - NetMessage.SendData(21, number: number16, number2: 1f); - flag4 = false; + flag3 = false; } if (Main.rand.Next(3) == 0) { - int number17 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 73, Main.rand.Next(8, 21)); + int number15 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 73, Main.rand.Next(8, 21)); if (Main.netMode == 1) - NetMessage.SendData(21, number: number17, number2: 1f); - flag4 = false; + NetMessage.SendData(21, number: number15, number2: 1f); + flag3 = false; } - if (Main.rand.Next(5) == 0) - { - int Type = Main.rand.Next(4); - switch (Type) - { - case 0: - Type = 14; - break; - case 1: - Type = 701; - break; - case 2: - Type = 13; - break; - case 3: - Type = 702; - break; - } - if (Main.rand.Next(2) == 0 & flag1) - { - Type = Main.rand.Next(4); - switch (Type) - { - case 0: - Type = 365; - break; - case 1: - Type = 1105; - break; - case 2: - Type = 366; - break; - case 3: - Type = 1106; - break; - } - } - int Stack = Main.rand.Next(30, 45); - int number18 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, Stack); - if (Main.netMode == 1) - NetMessage.SendData(21, number: number18, number2: 1f); - flag4 = false; - } - else if (Main.rand.Next(3) == 0) + if (Main.rand.Next(3) == 0) { int Type = Main.rand.Next(4); switch (Type) @@ -4324,7 +3426,7 @@ namespace Terraria Type = 706; break; } - if ((uint) Main.rand.Next(3) > 0U & flag1) + if (Main.hardMode && Main.rand.Next(3) != 0) { Type = Main.rand.Next(4); switch (Type) @@ -4343,11 +3445,11 @@ namespace Terraria break; } } - int Stack = Main.rand.Next(10, 15); - int number19 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, Stack); + int Stack = Main.rand.Next(15, 31); + int number16 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, Stack); if (Main.netMode == 1) - NetMessage.SendData(21, number: number19, number2: 1f); - flag4 = false; + NetMessage.SendData(21, number: number16, number2: 1f); + flag3 = false; } } if (Main.rand.Next(3) == 0) @@ -4372,69 +3474,29 @@ namespace Terraria break; } int Stack = Main.rand.Next(2, 6); - int number20 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, Stack); + int number17 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, Stack); if (Main.netMode == 1) - NetMessage.SendData(21, number: number20, number2: 1f); + NetMessage.SendData(21, number: number17, number2: 1f); } if (Main.rand.Next(2) == 0) { - int number21 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Main.rand.Next(188, 190), Main.rand.Next(5, 21)); + int number18 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Main.rand.Next(499, 501), Main.rand.Next(5, 21)); if (Main.netMode == 1) - NetMessage.SendData(21, number: number21, number2: 1f); + NetMessage.SendData(21, number: number18, number2: 1f); } - if (Main.rand.Next(3) != 0) - { - int number22 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2676, Main.rand.Next(3, 8)); - if (Main.netMode == 1) - NetMessage.SendData(21, number: number22, number2: 1f); - } - if (Main.rand.Next(50) != 0) + if (Main.rand.Next(3) == 0) break; - int number23 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 989); + int number19 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2676, Main.rand.Next(3, 8)); if (Main.netMode != 1) break; - NetMessage.SendData(21, number: number23, number2: 1f); + NetMessage.SendData(21, number: number19, number2: 1f); break; default: - int maxValue = 1; - bool flag5 = true; - bool flag6; - while (flag5) + int maxValue = 6; + bool flag4 = true; + while (flag4) { - if ((crateItemID == 5002 || crateItemID == 5003) && flag5 && Main.rand.Next(maxValue) == 0) - { - int num = Main.rand.Next(4); - int Type; - if (Main.rand.Next(10) == 0) - Type = 4425; - else if (Main.rand.Next(10) == 0) - { - Type = 863; - } - else - { - switch (num) - { - case 0: - Type = 186; - break; - case 1: - Type = 4404; - break; - case 2: - Type = 277; - break; - default: - Type = 187; - break; - } - } - int number24 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, pfix: -1); - if (Main.netMode == 1) - NetMessage.SendData(21, number: number24, number2: 1f); - flag5 = false; - } - if ((crateItemID == 3203 || crateItemID == 3982) && flag5 && Main.rand.Next(maxValue) == 0) + if (num == 3 && flag4 && Main.rand.Next(maxValue) == 0) { int Type; switch (Main.rand.Next(5)) @@ -4455,12 +3517,12 @@ namespace Terraria Type = 64; break; } - int number25 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, pfix: -1); + int number20 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, pfix: -1); if (Main.netMode == 1) - NetMessage.SendData(21, number: number25, number2: 1f); - flag5 = false; + NetMessage.SendData(21, number: number20, number2: 1f); + flag4 = false; } - if ((crateItemID == 3204 || crateItemID == 3983) && flag5 && Main.rand.Next(maxValue) == 0) + if (num == 4 && flag4 && Main.rand.Next(maxValue) == 0) { int Type; switch (Main.rand.Next(5)) @@ -4481,25 +3543,19 @@ namespace Terraria Type = 3062; break; } - int number26 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, pfix: -1); + int number21 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, pfix: -1); if (Main.netMode == 1) - NetMessage.SendData(21, number: number26, number2: 1f); - flag5 = false; + NetMessage.SendData(21, number: number21, number2: 1f); + flag4 = false; } - if ((crateItemID == 3205 || crateItemID == 3984) && flag5 && Main.rand.Next(maxValue) == 0) + if (num == 5 && flag4 && Main.rand.Next(maxValue) == 0) { - int number27 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3085, pfix: -1); + int number22 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3085, pfix: -1); if (Main.netMode == 1) - NetMessage.SendData(21, number: number27, number2: 1f); - flag5 = false; - if (Main.rand.Next(2) == 0) - { - int number28 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 149, Main.rand.Next(5, 16), pfix: -1); - if (Main.netMode == 1) - NetMessage.SendData(21, number: number28, number2: 1f); - } + NetMessage.SendData(21, number: number22, number2: 1f); + flag4 = false; } - if ((crateItemID == 3206 || crateItemID == 3985) && flag5 && Main.rand.Next(maxValue) == 0) + if (num == 6 && flag4 && Main.rand.Next(maxValue) == 0) { int Type; switch (Main.rand.Next(3)) @@ -4514,273 +3570,43 @@ namespace Terraria Type = 159; break; } - int number29 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, pfix: -1); + int number23 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, pfix: -1); if (Main.netMode == 1) - NetMessage.SendData(21, number: number29, number2: 1f); - flag5 = false; + NetMessage.SendData(21, number: number23, number2: 1f); + flag4 = false; } - if ((crateItemID == 3208 || crateItemID == 3987) && flag5 && Main.rand.Next(maxValue) == 0) - { - if (Main.rand.Next(20) == 0) - { - Main.rand.Next(5); - int number30 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3017, pfix: -1); - if (Main.netMode == 1) - NetMessage.SendData(21, number: number30, number2: 1f); - flag5 = false; - } - else - { - int Type; - switch (Main.rand.Next(5)) - { - case 0: - Type = 212; - break; - case 1: - Type = 964; - break; - case 2: - Type = 211; - break; - case 3: - Type = 213; - break; - default: - Type = 2292; - break; - } - int number31 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, pfix: -1); - if (Main.netMode == 1) - NetMessage.SendData(21, number: number31, number2: 1f); - flag5 = false; - } - } - if ((crateItemID == 4405 || crateItemID == 4406) && flag5 && Main.rand.Next(maxValue) == 0) + if (num == 8 && flag4 && Main.rand.Next(maxValue) == 0) { int Type; - switch (Main.rand.Next(6)) + switch (Main.rand.Next(5)) { case 0: - Type = 670; + Type = 212; break; case 1: - Type = 724; + Type = 964; break; case 2: - Type = 950; + Type = 211; break; case 3: - Type = 1319; - break; - case 4: - Type = 987; + Type = 213; break; default: - Type = 1579; + Type = 2292; break; } - int number32 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, pfix: -1); + int number24 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, pfix: -1); if (Main.netMode == 1) - NetMessage.SendData(21, number: number32, number2: 1f); - flag5 = false; - } - if (crateItemID == 4407 || crateItemID == 4408) - { - if (flag5 && Main.rand.Next(maxValue) == 0) - { - int Type; - switch (Main.rand.Next(8)) - { - case 0: - Type = 4056; - break; - case 1: - Type = 4442; - break; - case 2: - Type = 4055; - break; - case 3: - Type = 4061; - break; - case 4: - Type = 4062; - break; - case 5: - Type = 4276; - break; - case 6: - Type = 4262; - break; - default: - Type = 4263; - break; - } - int number33 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, pfix: -1); - if (Main.netMode == 1) - NetMessage.SendData(21, number: number33, number2: 1f); - flag5 = false; - } - if (Main.rand.Next(4) == 0) - { - int number34 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4423, Main.rand.Next(4, 7)); - if (Main.netMode == 1) - NetMessage.SendData(21, number: number34, number2: 1f); - flag5 = false; - } - } - if (crateItemID == 4877 || crateItemID == 4878) - { - if (flag5 && Main.rand.Next(maxValue) == 0) - { - if (Main.rand.Next(40) == 0) - { - Main.rand.Next(5); - int number35 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 906, pfix: -1); - if (Main.netMode == 1) - NetMessage.SendData(21, number: number35, number2: 1f); - flag6 = false; - } - else - { - int Type; - switch (Main.rand.Next(5)) - { - case 0: - Type = 4822; - break; - case 1: - Type = 4828; - break; - case 2: - Type = 4880; - break; - case 3: - Type = 4881; - break; - default: - Type = 4868; - break; - } - int number36 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, pfix: -1); - if (Main.netMode == 1) - NetMessage.SendData(21, number: number36, number2: 1f); - flag6 = false; - } - if (Main.rand.Next(4) == 0) - { - int number37 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4858, 2); - if (Main.netMode == 1) - NetMessage.SendData(21, number: number37, number2: 1f); - flag6 = false; - } - } - int number38 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4879, pfix: -1); - if (Main.netMode == 1) - NetMessage.SendData(21, number: number38, number2: 1f); - flag5 = false; - if (Main.rand.Next(3) == 0) - { - int number39 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4824, Main.rand.Next(7, 11)); - if (Main.netMode == 1) - NetMessage.SendData(21, number: number39, number2: 1f); - flag5 = false; - } - if (Main.rand.Next(2) == 0) - { - int Type = Main.rand.Next(5); - switch (Type) - { - case 0: - Type = 4902; - break; - case 1: - Type = 4903; - break; - case 2: - Type = 4904; - break; - case 3: - Type = 4905; - break; - case 4: - Type = 4906; - break; - } - int number40 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, pfix: -1); - if (Main.netMode == 1) - NetMessage.SendData(21, number: number40, number2: 1f); - flag5 = false; - } + NetMessage.SendData(21, number: number24, number2: 1f); + flag4 = false; } if (Main.rand.Next(4) == 0) { - int number41 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 73, Main.rand.Next(5, 13)); + int number25 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 73, Main.rand.Next(5, 13)); if (Main.netMode == 1) - NetMessage.SendData(21, number: number41, number2: 1f); - flag5 = false; - } - if (Main.rand.Next(7) == 0) - { - int Type = Main.rand.Next(8); - switch (Type) - { - case 0: - Type = 12; - break; - case 1: - Type = 699; - break; - case 2: - Type = 11; - break; - case 3: - Type = 700; - break; - case 4: - Type = 14; - break; - case 5: - Type = 701; - break; - case 6: - Type = 13; - break; - case 7: - Type = 702; - break; - } - if (Main.rand.Next(2) == 0 & flag1) - { - Type = Main.rand.Next(6); - switch (Type) - { - case 0: - Type = 364; - break; - case 1: - Type = 1104; - break; - case 2: - Type = 365; - break; - case 3: - Type = 1105; - break; - case 4: - Type = 366; - break; - case 5: - Type = 1106; - break; - } - } - int Stack = Main.rand.Next(30, 50); - int number42 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, Stack); - if (Main.netMode == 1) - NetMessage.SendData(21, number: number42, number2: 1f); - flag5 = false; + NetMessage.SendData(21, number: number25, number2: 1f); + flag4 = false; } if (Main.rand.Next(4) == 0) { @@ -4807,7 +3633,7 @@ namespace Terraria break; } int Stack = Main.rand.Next(10, 21); - if ((uint) Main.rand.Next(3) > 0U & flag1) + if (Main.hardMode && Main.rand.Next(3) != 0) { Type = Main.rand.Next(6); switch (Type) @@ -4833,10 +3659,10 @@ namespace Terraria } Stack -= Main.rand.Next(3); } - int number43 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, Stack); + int number26 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, Stack); if (Main.netMode == 1) - NetMessage.SendData(21, number: number43, number2: 1f); - flag5 = false; + NetMessage.SendData(21, number: number26, number2: 1f); + flag4 = false; } } if (Main.rand.Next(4) == 0) @@ -4864,104 +3690,52 @@ namespace Terraria break; } int Stack = Main.rand.Next(2, 5); - int number44 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, Stack); + int number27 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, Stack); if (Main.netMode == 1) - NetMessage.SendData(21, number: number44, number2: 1f); - flag6 = false; + NetMessage.SendData(21, number: number27, number2: 1f); } if (Main.rand.Next(2) == 0) { - int number45 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Main.rand.Next(188, 190), Main.rand.Next(5, 18)); + int number28 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Main.rand.Next(188, 190), Main.rand.Next(5, 18)); if (Main.netMode == 1) - NetMessage.SendData(21, number: number45, number2: 1f); + NetMessage.SendData(21, number: number28, number2: 1f); } if (Main.rand.Next(2) == 0) { - int number46 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Main.rand.Next(2) != 0 ? 2675 : 2676, Main.rand.Next(2, 7)); + int number29 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Main.rand.Next(2) != 0 ? 2675 : 2676, Main.rand.Next(2, 7)); if (Main.netMode == 1) - NetMessage.SendData(21, number: number46, number2: 1f); + NetMessage.SendData(21, number: number29, number2: 1f); } - if (crateItemID == 5002 || crateItemID == 5003) - { - if (Main.rand.Next(3) == 0) - { - int number47 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4090, Main.rand.Next(20, 51)); - if (Main.netMode == 1) - NetMessage.SendData(21, number: number47, number2: 1f); - } - if (Main.rand.Next(10) == 0) - { - int number48 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4460); - if (Main.netMode == 1) - NetMessage.SendData(21, number: number48, number2: 1f); - } - } - if (crateItemID == 3208 || crateItemID == 3987) - { - if (Main.rand.Next(3) == 0) - { - int number49 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4564, Main.rand.Next(20, 51)); - if (Main.netMode == 1) - NetMessage.SendData(21, number: number49, number2: 1f); - } - if (Main.rand.Next(20) == 0) - { - int number50 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 753); - if (Main.netMode == 1) - NetMessage.SendData(21, number: number50, number2: 1f); - } - } - if ((crateItemID == 4405 || crateItemID == 4406) && Main.rand.Next(20) == 0) - { - int number51 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 669); - if (Main.netMode == 1) - NetMessage.SendData(21, number: number51, number2: 1f); - } - if (crateItemID == 4877 || crateItemID == 4878) - { - if (Main.rand.Next(20) == 0) - { - int number52 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4737); - if (Main.netMode == 1) - NetMessage.SendData(21, number: number52, number2: 1f); - } - if (Main.rand.Next(20) == 0) - { - int number53 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 4551); - if (Main.netMode == 1) - NetMessage.SendData(21, number: number53, number2: 1f); - } - } - if (!flag1 || crateItemID != 3982 && crateItemID != 3986 && crateItemID != 3983) + if (num != 3 && num != 4 && num != 7) break; - if (Main.rand.Next(2) == 0) + if (Main.hardMode && Main.rand.Next(2) == 0) { int Type = 521; - if (crateItemID == 3986) + if (num == 7) Type = 520; int Stack = Main.rand.Next(2, 6); - int number54 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, Stack); + int number30 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, Stack); if (Main.netMode == 1) - NetMessage.SendData(21, number: number54, number2: 1f); + NetMessage.SendData(21, number: number30, number2: 1f); } - if (Main.rand.Next(2) != 0) + if (!Main.hardMode || Main.rand.Next(2) != 0) break; int Type1 = 522; int Stack1 = Main.rand.Next(2, 6); - switch (crateItemID) + switch (num) { - case 3983: + case 4: Type1 = 1332; break; - case 3986: + case 7: Type1 = 502; Stack1 = Main.rand.Next(4, 11); break; } - int number55 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type1, Stack1); + int number31 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type1, Stack1); if (Main.netMode != 1) break; - NetMessage.SendData(21, number: number55, number2: 1f); + NetMessage.SendData(21, number: number31, number2: 1f); break; } } @@ -5005,62 +3779,109 @@ namespace Terraria return false; } - public void OpenShadowLockbox() + public void openLockBox() { bool flag = true; while (flag) { flag = false; - int Type; - switch (Main.rand.Next(6)) + int Type1; + switch (Main.rand.Next(7)) { case 1: - Type = 274; + Type1 = 329; break; case 2: - Type = 220; + Type1 = 155; break; case 3: - Type = 112; + Type1 = 156; break; case 4: - Type = 218; + Type1 = 157; break; case 5: - Type = 3019; + Type1 = 163; + break; + case 6: + Type1 = 113; break; default: - Type = 5010; + Type1 = 164; break; } - int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, pfix: -1); - if (Main.netMode == 1) - NetMessage.SendData(21, number: number, number2: 1f); - } - } - - public void OpenLockBox() - { - bool flag = true; - while (flag) - { - flag = false; - int num = Main.rand.Next(7); - if (num == 1) - num = 2; - int number1 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, num != 2 ? (num != 3 ? (num != 4 ? (num != 5 ? (num != 6 ? 164 : 113) : 163) : 157) : 156) : 155, pfix: -1); + int number1 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type1, pfix: -1); if (Main.netMode == 1) NetMessage.SendData(21, number: number1, number2: 1f); if (Main.rand.Next(3) == 0) { - int number2 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 329, pfix: -1); + flag = false; + int Stack = Main.rand.Next(1, 4); + if (Main.rand.Next(2) == 0) + Stack += Main.rand.Next(2); + if (Main.rand.Next(3) == 0) + Stack += Main.rand.Next(3); + if (Main.rand.Next(4) == 0) + Stack += Main.rand.Next(3); + if (Main.rand.Next(5) == 0) + Stack += Main.rand.Next(1, 3); + int number2 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 73, Stack); if (Main.netMode == 1) NetMessage.SendData(21, number: number2, number2: 1f); } + if (Main.rand.Next(2) == 0) + { + flag = false; + int number3 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 72, Main.rand.Next(10, 100)); + if (Main.netMode == 1) + NetMessage.SendData(21, number: number3, number2: 1f); + } + if (Main.rand.Next(3) == 0) + { + flag = false; + int number4 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 188, Main.rand.Next(2, 6)); + if (Main.netMode == 1) + NetMessage.SendData(21, number: number4, number2: 1f); + } + if (Main.rand.Next(3) == 0) + { + flag = false; + int Type2; + switch (Main.rand.Next(9)) + { + case 0: + Type2 = 296; + break; + case 1: + Type2 = 2346; + break; + case 2: + Type2 = 305; + break; + case 3: + Type2 = 2323; + break; + case 4: + Type2 = 292; + break; + case 5: + Type2 = 294; + break; + case 6: + Type2 = 288; + break; + default: + Type2 = Main.netMode != 1 ? 2350 : 2997; + break; + } + int number5 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type2, Main.rand.Next(1, 4)); + if (Main.netMode == 1) + NetMessage.SendData(21, number: number5, number2: 1f); + } } } - public void OpenHerbBag() + public void openHerbBag() { int num = Main.rand.Next(2, 5); if (Main.rand.Next(3) == 0) @@ -5105,31 +3926,7 @@ namespace Terraria } } - public void OpenCanofWorms() - { - this.QuickSpawnItem(2002, Main.rand.Next(5, 9)); - if (Main.rand.Next(10) < 3) - this.QuickSpawnItem(3191, Main.rand.Next(1, 3)); - if (Main.rand.Next(20) != 0) - return; - this.QuickSpawnItem(2895); - } - - public void OpenOyster() - { - if (Main.rand.Next(5) == 0) - { - if (Main.rand.Next(25) == 0) - this.QuickSpawnItem(4414); - else if (Main.rand.Next(5) == 0) - this.QuickSpawnItem(4413); - else - this.QuickSpawnItem(4412); - } - this.QuickSpawnItem(4411); - } - - public void OpenGoodieBag() + public void openGoodieBag() { if (Main.rand.Next(150) == 0) { @@ -5371,7 +4168,7 @@ namespace Terraria } } - public void UpdateDyes() + public void UpdateDyes(int plr) { this.cHead = 0; this.cBody = 0; @@ -5388,75 +4185,59 @@ namespace Terraria this.cBalloon = 0; this.cWings = 0; this.cCarpet = 0; - this.cFloatingTube = 0; - this.cGrapple = this.cMount = this.cMinecart = this.cPet = this.cLight = this.cYorai = this.cPortalbeStool = this.cUnicornHorn = this.cMinion = this.cLeinShampoo = 0; - this.skinDyePacked = 0; - this.cHead = (int) this.dye[0].dye; - this.cBody = (int) this.dye[1].dye; - this.cLegs = (int) this.dye[2].dye; + this.cGrapple = this.cMount = this.cMinecart = this.cPet = this.cLight = this.cYorai = 0; + if (this.dye[0] != null) + this.cHead = (int) this.dye[0].dye; + if (this.dye[1] != null) + this.cBody = (int) this.dye[1].dye; + if (this.dye[2] != null) + this.cLegs = (int) this.dye[2].dye; if (this.wearsRobe) this.cLegs = this.cBody; - this.cPet = (int) this.miscDyes[0].dye; - this.cLight = (int) this.miscDyes[1].dye; - this.cMinecart = (int) this.miscDyes[2].dye; - this.cMount = (int) this.miscDyes[3].dye; - this.cGrapple = (int) this.miscDyes[4].dye; - for (int slot = 0; slot < 20; ++slot) + if (this.miscDyes[0] != null) + this.cPet = (int) this.miscDyes[0].dye; + if (this.miscDyes[1] != null) + this.cLight = (int) this.miscDyes[1].dye; + if (this.miscDyes[2] != null) + this.cMinecart = (int) this.miscDyes[2].dye; + if (this.miscDyes[3] != null) + this.cMount = (int) this.miscDyes[3].dye; + if (this.miscDyes[4] != null) + this.cGrapple = (int) this.miscDyes[4].dye; + for (int index1 = 0; index1 < 20; ++index1) { - if (this.IsAValidEquipmentSlotForIteration(slot)) + int index2 = index1 % 10; + if (this.dye[index2] != null && this.armor[index1].type > 0 && this.armor[index1].stack > 0 && (index1 / 10 >= 1 || !this.hideVisual[index2] || this.armor[index1].wingSlot > (sbyte) 0 || this.armor[index1].type == 934)) { - int index = slot % 10; - this.UpdateItemDye(slot < 10, this.hideVisibleAccessory[index], this.armor[slot], this.dye[index]); + if (this.armor[index1].handOnSlot > (sbyte) 0 && this.armor[index1].handOnSlot < (sbyte) 20) + this.cHandOn = (int) this.dye[index2].dye; + if (this.armor[index1].handOffSlot > (sbyte) 0 && this.armor[index1].handOffSlot < (sbyte) 12) + this.cHandOff = (int) this.dye[index2].dye; + if (this.armor[index1].backSlot > (sbyte) 0 && this.armor[index1].backSlot < (sbyte) 14) + this.cBack = (int) this.dye[index2].dye; + if (this.armor[index1].frontSlot > (sbyte) 0 && this.armor[index1].frontSlot < (sbyte) 5) + this.cFront = (int) this.dye[index2].dye; + if (this.armor[index1].shoeSlot > (sbyte) 0 && this.armor[index1].shoeSlot < (sbyte) 18) + this.cShoe = (int) this.dye[index2].dye; + if (this.armor[index1].waistSlot > (sbyte) 0 && this.armor[index1].waistSlot < (sbyte) 13) + this.cWaist = (int) this.dye[index2].dye; + if (this.armor[index1].shieldSlot > (sbyte) 0 && this.armor[index1].shieldSlot < (sbyte) 7) + this.cShield = (int) this.dye[index2].dye; + if (this.armor[index1].neckSlot > (sbyte) 0 && this.armor[index1].neckSlot < (sbyte) 10) + this.cNeck = (int) this.dye[index2].dye; + if (this.armor[index1].faceSlot > (sbyte) 0 && this.armor[index1].faceSlot < (sbyte) 9) + this.cFace = (int) this.dye[index2].dye; + if (this.armor[index1].balloonSlot > (sbyte) 0 && this.armor[index1].balloonSlot < (sbyte) 18) + this.cBalloon = (int) this.dye[index2].dye; + if (this.armor[index1].wingSlot > (sbyte) 0 && this.armor[index1].wingSlot < (sbyte) 40) + this.cWings = (int) this.dye[index2].dye; + if (this.armor[index1].type == 934) + this.cCarpet = (int) this.dye[index2].dye; } } this.cYorai = this.cPet; } - private void UpdateItemDye( - bool effectiveEquipmentSlot, - bool armorHidden, - Item armorItem, - Item dyeItem) - { - if (armorItem.IsAir || effectiveEquipmentSlot & armorHidden && armorItem.wingSlot <= (sbyte) 0 && armorItem.type != 934 && armorItem.type != 4341 && armorItem.type != 4563) - return; - if (armorItem.handOnSlot > (sbyte) 0 && armorItem.handOnSlot < (sbyte) 22) - this.cHandOn = (int) dyeItem.dye; - if (armorItem.handOffSlot > (sbyte) 0 && armorItem.handOffSlot < (sbyte) 14) - this.cHandOff = (int) dyeItem.dye; - if (armorItem.backSlot > (sbyte) 0 && armorItem.backSlot < (sbyte) 30) - this.cBack = (int) dyeItem.dye; - if (armorItem.frontSlot > (sbyte) 0 && armorItem.frontSlot < (sbyte) 9) - this.cFront = (int) dyeItem.dye; - if (armorItem.shoeSlot > (sbyte) 0 && armorItem.shoeSlot < (sbyte) 25) - this.cShoe = (int) dyeItem.dye; - if (armorItem.waistSlot > (sbyte) 0 && armorItem.waistSlot < (sbyte) 17) - this.cWaist = (int) dyeItem.dye; - if (armorItem.shieldSlot > (sbyte) 0 && armorItem.shieldSlot < (sbyte) 10) - this.cShield = (int) dyeItem.dye; - if (armorItem.neckSlot > (sbyte) 0 && armorItem.neckSlot < (sbyte) 11) - this.cNeck = (int) dyeItem.dye; - if (armorItem.faceSlot > (sbyte) 0 && armorItem.faceSlot < (sbyte) 16) - this.cFace = (int) dyeItem.dye; - if (armorItem.balloonSlot > (sbyte) 0 && armorItem.balloonSlot < (sbyte) 18) - this.cBalloon = (int) dyeItem.dye; - if (armorItem.wingSlot > (sbyte) 0 && armorItem.wingSlot < (sbyte) 47) - this.cWings = (int) dyeItem.dye; - if (armorItem.type == 934) - this.cCarpet = (int) dyeItem.dye; - if (armorItem.type == 4404) - this.cFloatingTube = (int) dyeItem.dye; - if (armorItem.type == 4341) - this.cPortalbeStool = (int) dyeItem.dye; - if (armorItem.type == 4563) - this.cUnicornHorn = (int) dyeItem.dye; - if (armorItem.type == 4762) - this.cMinion = (int) dyeItem.dye; - if (armorItem.type != 3929) - return; - this.cLeinShampoo = (int) dyeItem.dye; - } - public int ArmorSetDye() { switch (Main.rand.Next(3)) @@ -5476,11 +4257,16 @@ namespace Terraria { if (this.soulDrain > 0 && this.whoAmI == Main.myPlayer) this.AddBuff(151, 2); + for (int index = 0; index < 1000; ++index) + { + if (Main.projectile[index].active && Main.projectile[index].owner == i) + ++this.ownedProjectileCounts[Main.projectile[index].type]; + } for (int index1 = 0; index1 < 22; ++index1) { if (this.buffType[index1] > 0 && this.buffTime[index1] > 0) { - if (this.whoAmI == Main.myPlayer && !BuffID.Sets.TimeLeftDoesNotDecrease[this.buffType[index1]]) + if (this.whoAmI == Main.myPlayer && this.buffType[index1] != 28) --this.buffTime[index1]; if (this.buffType[index1] == 1) { @@ -5488,29 +4274,10 @@ namespace Terraria this.fireWalk = true; this.buffImmune[24] = true; } - else if (BuffID.Sets.BasicMountData[this.buffType[index1]] != null) - { - BuffID.Sets.BuffMountData buffMountData = BuffID.Sets.BasicMountData[this.buffType[index1]]; - this.mount.SetMount(buffMountData.mountID, this, buffMountData.faceLeft); - this.buffTime[index1] = 10; - } else if (this.buffType[index1] == 158) this.manaRegenBonus += 2; else if (this.buffType[index1] == 159 && this.inventory[this.selectedItem].melee) - this.armorPenetration = 12; - else if (this.buffType[index1] == 192) - { - this.pickSpeed -= 0.2f; - this.moveSpeed += 0.2f; - } - else if (this.buffType[index1] == 321) - { - int num = 20; - this.meleeCrit += num; - this.rangedCrit += num; - this.magicCrit += num; - this.minionDamage += (float) num / 100f; - } + this.armorPenetration = 4; else if (this.buffType[index1] == 2) this.lifeRegen += 4; else if (this.buffType[index1] == 3) @@ -5579,20 +4346,8 @@ namespace Terraria this.ammoBox = true; else if (this.buffType[index1] == 58) this.palladiumRegen = true; - else if (this.buffType[index1] == 306) - this.hasTitaniumStormBuff = true; else if (this.buffType[index1] == 88) this.chaosState = true; - else if (this.buffType[index1] == 215) - this.statDefense += 5; - else if (this.buffType[index1] == 311) - this.meleeSpeed += 0.5f; - else if (this.buffType[index1] == 308) - this.meleeSpeed += 0.35f; - else if (this.buffType[index1] == 314) - this.meleeSpeed += 0.2f; - else if (this.buffType[index1] == 312) - this.coolWhipBuff = true; else if (this.buffType[index1] == 63) ++this.moveSpeed; else if (this.buffType[index1] == 104) @@ -5640,6 +4395,7 @@ namespace Terraria this.meleeCrit += 10; this.rangedCrit += 10; this.magicCrit += 10; + this.thrownCrit += 10; } else if (this.buffType[index1] == 116) { @@ -5654,7 +4410,7 @@ namespace Terraria for (int index2 = 0; index2 < 200; ++index2) { NPC npc = Main.npc[index2]; - if (npc.active && !npc.friendly && npc.damage > 0 && !npc.dontTakeDamage && !npc.buffImmune[type] && this.CanNPCBeHitByPlayerOrPlayerProjectile(npc) && (double) Vector2.Distance(this.Center, npc.Center) <= (double) num1) + if (npc.active && !npc.friendly && npc.damage > 0 && !npc.dontTakeDamage && !npc.buffImmune[type] && (double) Vector2.Distance(this.Center, npc.Center) <= (double) num1) { if (npc.FindBuffIndex(type) == -1) npc.AddBuff(type, 120); @@ -5676,8 +4432,8 @@ namespace Terraria player.Hurt(PlayerDeathReason.LegacyEmpty(), num2, 0, true); if (Main.netMode != 0) { - PlayerDeathReason reason = PlayerDeathReason.ByOther(16); - NetMessage.SendPlayerHurt(playerTargetIndex, reason, num2, 0, false, true, -1); + PlayerDeathReason reason = PlayerDeathReason.ByPlayer(this.whoAmI); + NetMessage.SendPlayerHurt(playerTargetIndex, reason, num2, 0, false, true, 0); } } } @@ -5687,6 +4443,7 @@ namespace Terraria } else if (this.buffType[index1] == 117) { + this.thrownDamage += 0.1f; this.meleeDamage += 0.1f; this.rangedDamage += 0.1f; this.magicDamage += 0.1f; @@ -5698,11 +4455,6 @@ namespace Terraria this.stinky = true; else if (this.buffType[index1] == 124) this.resistCold = true; - else if (this.buffType[index1] == 257) - { - if (Main.myPlayer == this.whoAmI) - this.luckPotion = this.buffTime[index1] <= 18000 ? (this.buffTime[index1] <= 10800 ? (byte) 1 : (byte) 2) : (byte) 3; - } else if (this.buffType[index1] == 165) { this.lifeRegen += 6; @@ -5880,7 +4632,7 @@ namespace Terraria --this.buffType[index1]; this.buffTime[index1] = 480; } - this.lifeRegen += 6 * this.nebulaLevelLife; + this.lifeRegen += 10 * this.nebulaLevelLife; } else if (this.buffType[index1] >= 179 && this.buffType[index1] <= 181) { @@ -5917,6 +4669,7 @@ namespace Terraria this.rangedDamage += num4; this.magicDamage += num4; this.minionDamage += num4; + this.thrownDamage += num4; } else if (this.buffType[index1] == 62) { @@ -6039,18 +4792,6 @@ namespace Terraria else this.buffTime[index1] = 18000; } - else if (this.buffType[index1] == 214) - { - if (this.ownedProjectileCounts[758] > 0) - this.vampireFrog = true; - if (!this.vampireFrog) - { - this.DelBuff(index1); - --index1; - } - else - this.buffTime[index1] = 18000; - } else if (this.buffType[index1] == 139) { if (this.ownedProjectileCounts[407] > 0) @@ -6087,79 +4828,6 @@ namespace Terraria else this.buffTime[index1] = 18000; } - else if (this.buffType[index1] == 213) - { - if (this.ownedProjectileCounts[755] > 0) - this.batsOfLight = true; - if (!this.batsOfLight) - { - this.DelBuff(index1); - --index1; - } - else - this.buffTime[index1] = 18000; - } - else if (this.buffType[index1] == 216) - { - if (this.ownedProjectileCounts[759] > 0) - this.babyBird = true; - else if (this.whoAmI == Main.myPlayer && this.numMinions < this.maxMinions) - { - int index4 = this.FindItem(4281); - if (index4 != -1) - { - Item obj = this.inventory[index4]; - int index5 = Projectile.NewProjectile(this.Top, Vector2.Zero, obj.shoot, obj.damage, obj.knockBack, this.whoAmI); - Main.projectile[index5].originalDamage = obj.damage; - this.babyBird = true; - } - } - if (!this.babyBird) - { - this.DelBuff(index1); - --index1; - } - else - this.buffTime[index1] = 18000; - } - else if (this.buffType[index1] == 263) - { - if (this.ownedProjectileCounts[831] > 0) - this.stormTiger = true; - if (!this.stormTiger) - { - this.DelBuff(index1); - --index1; - } - else - this.buffTime[index1] = 18000; - if (this.whoAmI == Main.myPlayer) - this.UpdateStormTigerStatus(); - } - else if (this.buffType[index1] == 271) - { - if (this.ownedProjectileCounts[864] > 0) - this.smolstar = true; - if (!this.smolstar) - { - this.DelBuff(index1); - --index1; - } - else - this.buffTime[index1] = 18000; - } - else if (this.buffType[index1] == 322) - { - if (this.ownedProjectileCounts[946] > 0) - this.empressBlade = true; - if (!this.empressBlade) - { - this.DelBuff(index1); - --index1; - } - else - this.buffTime[index1] = 18000; - } else if (this.buffType[index1] == 187) { if (this.ownedProjectileCounts[623] > 0) @@ -6216,6 +4884,36 @@ namespace Terraria this.mount.SetMount(3, this); this.buffTime[index1] = 10; } + else if (this.buffType[index1] == 118) + { + this.mount.SetMount(6, this, true); + this.buffTime[index1] = 10; + } + else if (this.buffType[index1] == 138) + { + this.mount.SetMount(6, this); + this.buffTime[index1] = 10; + } + else if (this.buffType[index1] == 167) + { + this.mount.SetMount(11, this, true); + this.buffTime[index1] = 10; + } + else if (this.buffType[index1] == 166) + { + this.mount.SetMount(11, this); + this.buffTime[index1] = 10; + } + else if (this.buffType[index1] == 184) + { + this.mount.SetMount(13, this, true); + this.buffTime[index1] = 10; + } + else if (this.buffType[index1] == 185) + { + this.mount.SetMount(13, this); + this.buffTime[index1] = 10; + } else if (this.buffType[index1] == 131) { this.ignoreWater = true; @@ -6260,86 +4958,9 @@ namespace Terraria this.mount.SetMount(14, this); this.buffTime[index1] = 10; } - else if (this.buffType[index1] == 212) - { - this.mount.SetMount(17, this); - this.buffTime[index1] = 10; - } - else if (this.buffType[index1] == 230) - { - this.mount.SetMount(23, this); - this.buffTime[index1] = 10; - } - else if (this.buffType[index1] == 265) - { - this.canFloatInWater = true; - this.accFlipper = true; - this.mount.SetMount(37, this); - this.buffTime[index1] = 10; - } - else if (this.buffType[index1] == 275) - { - this.mount.SetMount(40, this); - this.buffTime[index1] = 10; - } - else if (this.buffType[index1] == 276) - { - this.mount.SetMount(41, this); - this.buffTime[index1] = 10; - } - else if (this.buffType[index1] == 277) - { - this.mount.SetMount(42, this); - this.buffTime[index1] = 10; - } - else if (this.buffType[index1] == 278) - { - this.mount.SetMount(43, this); - this.buffTime[index1] = 10; - } - else if (this.buffType[index1] == 279) - { - this.ignoreWater = true; - this.accFlipper = true; - this.mount.SetMount(44, this); - this.buffTime[index1] = 10; - } - else if (this.buffType[index1] == 280) - { - this.mount.SetMount(45, this); - this.buffTime[index1] = 10; - } - else if (this.buffType[index1] == 281) - { - this.mount.SetMount(46, this); - this.buffTime[index1] = 10; - } - else if (this.buffType[index1] == 282) - { - this.mount.SetMount(47, this); - this.buffTime[index1] = 10; - } - else if (this.buffType[index1] == 283) - { - this.mount.SetMount(48, this); - this.buffTime[index1] = 10; - } - else if (this.buffType[index1] == 305) - { - this.ignoreWater = true; - this.accFlipper = true; - this.lavaImmune = true; - this.mount.SetMount(49, this); - this.buffTime[index1] = 10; - } - else if (this.buffType[index1] == 318) - { - this.mount.SetMount(50, this); - this.buffTime[index1] = 10; - } else if (this.buffType[index1] == 37) { - if (Main.wofNPCIndex >= 0 && Main.npc[Main.wofNPCIndex].type == 113) + if (Main.wof >= 0 && Main.npc[Main.wof].type == 113) { this.gross = true; this.buffTime[index1] = 10; @@ -6382,83 +5003,13 @@ namespace Terraria Projectile.NewProjectile(this.position.X + (float) (this.width / 2), this.position.Y + (float) (this.height / 2), 0.0f, 0.0f, 500, 0, 0.0f, this.whoAmI); } else if (this.buffType[index1] == 191) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.companionCube, 653); + this.CommonPetBuffHandle(index1, ref this.companionCube, 653); else if (this.buffType[index1] == 202) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagDD2Dragon, 701); - else if (this.buffType[index1] == 217) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagUpbeatStar, 764); - else if (this.buffType[index1] == 219) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagBabyShark, 774); - else if (this.buffType[index1] == 258) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagLilHarpy, 815); - else if (this.buffType[index1] == 259) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagFennecFox, 816); - else if (this.buffType[index1] == 260) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagGlitteryButterfly, 817); - else if (this.buffType[index1] == 261) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagBabyImp, 821); - else if (this.buffType[index1] == 262) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagBabyRedPanda, 825); - else if (this.buffType[index1] == 264) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagPlantero, 854); - else if (this.buffType[index1] == 266) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagDynamiteKitten, 858); - else if (this.buffType[index1] == 267) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagBabyWerewolf, 859); - else if (this.buffType[index1] == 268) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagShadowMimic, 860); - else if (this.buffType[index1] == 274) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagVoltBunny, 875); - else if (this.buffType[index1] == 284) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagKingSlimePet, 881); - else if (this.buffType[index1] == 285) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagEyeOfCthulhuPet, 882); - else if (this.buffType[index1] == 286) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagEaterOfWorldsPet, 883); - else if (this.buffType[index1] == 287) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagBrainOfCthulhuPet, 884); - else if (this.buffType[index1] == 288) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagSkeletronPet, 885); - else if (this.buffType[index1] == 289) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagQueenBeePet, 886); - else if (this.buffType[index1] == 290) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagDestroyerPet, 887); - else if (this.buffType[index1] == 291) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagTwinsPet, 888); - else if (this.buffType[index1] == 292) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagSkeletronPrimePet, 889); - else if (this.buffType[index1] == 293) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagPlanteraPet, 890); - else if (this.buffType[index1] == 294) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagGolemPet, 891); - else if (this.buffType[index1] == 295) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagDukeFishronPet, 892); - else if (this.buffType[index1] == 296) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagLunaticCultistPet, 893); - else if (this.buffType[index1] == 297) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagMoonLordPet, 894); - else if (this.buffType[index1] == 298) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagFairyQueenPet, 895); - else if (this.buffType[index1] == 299) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagPumpkingPet, 896); - else if (this.buffType[index1] == 300) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagEverscreamPet, 897); - else if (this.buffType[index1] == 301) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagIceQueenPet, 898); - else if (this.buffType[index1] == 302) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagMartianPet, 899); - else if (this.buffType[index1] == 303) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagDD2OgrePet, 900); - else if (this.buffType[index1] == 304) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagDD2BetsyPet, 901); - else if (this.buffType[index1] == 317) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagQueenSlimePet, 934); + this.CommonPetBuffHandle(index1, ref this.petFlagDD2Dragon, 701); else if (this.buffType[index1] == 200) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagDD2Gato, 703); + this.CommonPetBuffHandle(index1, ref this.petFlagDD2Gato, 703); else if (this.buffType[index1] == 201) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagDD2Ghost, 702); - else if (this.buffType[index1] == 218) - this.BuffHandle_SpawnPetIfNeededAndSetTime(index1, ref this.petFlagSugarGlider, 765); + this.CommonPetBuffHandle(index1, ref this.petFlagDD2Ghost, 702); else if (this.buffType[index1] == 190) { this.buffTime[index1] = 18000; @@ -6535,6 +5086,7 @@ namespace Terraria this.meleeDamage += 0.2f; this.magicDamage += 0.2f; this.rangedDamage += 0.2f; + this.thrownDamage += 0.2f; this.minionDamage += 0.2f; } else if (this.buffType[index1] == 41) @@ -6759,12 +5311,12 @@ namespace Terraria this.buffTime[index1] = 18000; this.crystalLeaf = true; bool flag = true; - for (int index6 = 0; index6 < 1000; ++index6) + for (int index4 = 0; index4 < 1000; ++index4) { - if (Main.projectile[index6].active && Main.projectile[index6].owner == this.whoAmI && Main.projectile[index6].type == 226) + if (Main.projectile[index4].active && Main.projectile[index4].owner == this.whoAmI && Main.projectile[index4].type == 226) { if (!flag) - Main.projectile[index6].Kill(); + Main.projectile[index4].Kill(); flag = false; } } @@ -6802,18 +5354,13 @@ namespace Terraria else if (this.buffType[index1] == 80) this.blackout = true; else if (this.buffType[index1] == 23) - { this.noItems = true; - this.cursed = true; - } else if (this.buffType[index1] == 24) this.onFire = true; else if (this.buffType[index1] == 103) this.dripping = true; else if (this.buffType[index1] == 137) this.drippingSlime = true; - else if (this.buffType[index1] == 320) - this.drippingSparkleSlime = true; else if (this.buffType[index1] == 67) this.burned = true; else if (this.buffType[index1] == 68) @@ -6854,9 +5401,14 @@ namespace Terraria this.gravity = 0.0f; this.moveSpeed = 0.0f; this.dash = 0; - this.dashType = 0; this.noKnockback = true; - this.RemoveAllGrapplingHooks(); + this.grappling[0] = -1; + this.grapCount = 0; + for (int index5 = 0; index5 < 1000; ++index5) + { + if (Main.projectile[index5].active && Main.projectile[index5].owner == this.whoAmI && Main.projectile[index5].aiStyle == 7) + Main.projectile[index5].Kill(); + } } else if (this.buffType[index1] == 43) this.defendedByPaladin = true; @@ -6894,7 +5446,6 @@ namespace Terraria } else if (this.buffType[index1] == 25) { - this.tipsy = true; this.statDefense -= 4; this.meleeCrit += 2; this.meleeDamage += 0.1f; @@ -6911,42 +5462,11 @@ namespace Terraria this.magicDamage += 0.05f; this.rangedCrit += 2; this.rangedDamage += 0.05f; + this.thrownCrit += 2; + this.thrownDamage += 0.05f; this.minionDamage += 0.05f; this.minionKB += 0.5f; this.moveSpeed += 0.2f; - this.pickSpeed -= 0.05f; - } - else if (this.buffType[index1] == 206) - { - this.wellFed = true; - this.statDefense += 3; - this.meleeCrit += 3; - this.meleeDamage += 0.075f; - this.meleeSpeed += 0.075f; - this.magicCrit += 3; - this.magicDamage += 0.075f; - this.rangedCrit += 3; - this.rangedDamage += 0.075f; - this.minionDamage += 0.075f; - this.minionKB += 0.75f; - this.moveSpeed += 0.3f; - this.pickSpeed -= 0.1f; - } - else if (this.buffType[index1] == 207) - { - this.wellFed = true; - this.statDefense += 4; - this.meleeCrit += 4; - this.meleeDamage += 0.1f; - this.meleeSpeed += 0.1f; - this.magicCrit += 4; - this.magicDamage += 0.1f; - this.rangedCrit += 4; - this.rangedDamage += 0.1f; - this.minionDamage += 0.1f; - ++this.minionKB; - this.moveSpeed += 0.4f; - this.pickSpeed -= 0.15f; } else if (this.buffType[index1] == 71) this.meleeEnchant = (byte) 1; @@ -6966,48 +5486,11 @@ namespace Terraria this.meleeEnchant = (byte) 8; } } - if (this.whoAmI != Main.myPlayer || (int) this.luckPotion == (int) this.oldLuckPotion) - return; - this.luckNeedsSync = true; - this.oldLuckPotion = this.luckPotion; } - private void UpdateProjectileCaches(int i) - { - for (int index = 0; index < 1000; ++index) - { - if (Main.projectile[index].active && Main.projectile[index].owner == i) - { - ++this.ownedProjectileCounts[Main.projectile[index].type]; - if (Main.projectile[index].type == 831) - { - int originalDamage = Main.projectile[index].originalDamage; - if (this.highestStormTigerGemOriginalDamage < originalDamage) - this.highestStormTigerGemOriginalDamage = originalDamage; - } - } - } - } - - private void ResetProjectileCaches() - { - this.highestStormTigerGemOriginalDamage = 0; - for (int index = 0; index < this.ownedProjectileCounts.Length; ++index) - this.ownedProjectileCounts[index] = 0; - } - - private void BuffHandle_SpawnPetIfNeededAndSetTime( - int buffIndex, - ref bool petBool, - int petProjID, - int buffTimeToGive = 18000) - { - this.buffTime[buffIndex] = buffTimeToGive; - this.BuffHandle_SpawnPetIfNeeded(ref petBool, petProjID); - } - - private void BuffHandle_SpawnPetIfNeeded(ref bool petBool, int petProjID) + private void CommonPetBuffHandle(int buffIndex, ref bool petBool, int petProjID) { + this.buffTime[buffIndex] = 18000; petBool = true; bool flag = true; if (this.ownedProjectileCounts[petProjID] > 0) @@ -7017,66 +5500,6 @@ namespace Terraria Projectile.NewProjectile(this.position.X + (float) (this.width / 2), this.position.Y + (float) (this.height / 2), 0.0f, 0.0f, petProjID, 0, 0.0f, this.whoAmI); } - private void UpdateStormTigerStatus() - { - int Type; - switch (this.GetDesiredStormTigerMinionRank()) - { - case 1: - Type = 833; - break; - case 2: - Type = 834; - break; - case 3: - Type = 835; - break; - default: - Type = -1; - break; - } - bool flag = false; - if (Type == -1) - flag = true; - for (int index = 0; index < ProjectileID.Sets.StormTigerIds.Length; ++index) - { - int stormTigerId = ProjectileID.Sets.StormTigerIds[index]; - if (stormTigerId != Type && this.ownedProjectileCounts[stormTigerId] >= 1) - { - flag = true; - break; - } - } - if (flag) - { - for (int index = 0; index < 1000; ++index) - { - Projectile projectile = Main.projectile[index]; - if (projectile.active && projectile.owner == this.whoAmI && projectile.type != Type && ProjectileID.Sets.StormTiger[projectile.type]) - projectile.Kill(); - } - } - else - { - if (this.ownedProjectileCounts[Type] >= 1) - return; - Projectile.NewProjectile(this.Center, Vector2.Zero, Type, 0, 0.0f, this.whoAmI); - } - } - - private int GetDesiredStormTigerMinionRank() - { - int num = 0; - int ownedProjectileCount = this.ownedProjectileCounts[831]; - if (ownedProjectileCount > 0) - num = 1; - if (ownedProjectileCount > 3) - num = 2; - if (ownedProjectileCount > 6) - num = 3; - return num; - } - public void Counterweight(Vector2 hitPos, int dmg, float kb) { if (!this.yoyoGlove && this.counterWeight <= 0) @@ -7141,25 +5564,17 @@ namespace Terraria int index = 0 + this.bodyFrame.Y / 56; if (index >= Main.OffsetsPlayerHeadgear.Length) index = 0; - Vector2 vector2_1 = new Vector2((float) (this.width / 2), (float) (this.height / 2)) + Main.OffsetsPlayerHeadgear[index] + (this.MountedCenter - this.Center); - Vector2 posOffset; - float seatAdjustment; - this.sitting.GetSittingOffsetInfo(this, out posOffset, out seatAdjustment); - Vector2 vector2_2 = vector2_1 + (posOffset + new Vector2(0.0f, seatAdjustment)); - float y = -11.5f * this.gravDir; - if ((double) this.gravDir == -1.0) - y -= 4f; - Vector2 spinningpoint1 = new Vector2((float) (3 * this.direction - (this.direction == 1 ? 1 : 0)), y) + Vector2.UnitY * this.gfxOffY + vector2_2; - Vector2 spinningpoint2 = new Vector2((float) (3 * this.shadowDirection[1] - (this.direction == 1 ? 1 : 0)), y) + vector2_2; - Vector2 vector2_3 = Vector2.Zero; + Vector2 spinningpoint1 = new Vector2((float) (3 * this.direction - (this.direction == 1 ? 1 : 0)), -11.5f * this.gravDir) + Vector2.UnitY * this.gfxOffY + this.Size / 2f + Main.OffsetsPlayerHeadgear[index]; + Vector2 spinningpoint2 = new Vector2((float) (3 * this.shadowDirection[1] - (this.direction == 1 ? 1 : 0)), -11.5f * this.gravDir) + this.Size / 2f + Main.OffsetsPlayerHeadgear[index]; + Vector2 vector2_1 = Vector2.Zero; if (this.mount.Active && this.mount.Cart) { int num = Math.Sign(this.velocity.X); if (num == 0) num = this.direction; - vector2_3 = new Vector2(MathHelper.Lerp(0.0f, -8f, this.fullRotation / 0.7853982f), MathHelper.Lerp(0.0f, 2f, Math.Abs(this.fullRotation / 0.7853982f))).RotatedBy((double) this.fullRotation); + vector2_1 = new Vector2(MathHelper.Lerp(0.0f, -8f, this.fullRotation / 0.7853982f), MathHelper.Lerp(0.0f, 2f, Math.Abs(this.fullRotation / 0.7853982f))).RotatedBy((double) this.fullRotation); if (num == Math.Sign(this.fullRotation)) - vector2_3 *= MathHelper.Lerp(1f, 0.6f, Math.Abs(this.fullRotation / 0.7853982f)); + vector2_1 *= MathHelper.Lerp(1f, 0.6f, Math.Abs(this.fullRotation / 0.7853982f)); } if ((double) this.fullRotation != 0.0) { @@ -7167,10 +5582,12 @@ namespace Terraria spinningpoint2 = spinningpoint2.RotatedBy((double) this.fullRotation, this.fullRotationOrigin); } float num1 = 0.0f; - Vector2 vector2_4 = this.position + spinningpoint1 + vector2_3; - Vector2 vector2_5 = this.oldPosition + spinningpoint2 + vector2_3; - vector2_5.Y -= num1 / 2f; - vector2_4.Y -= num1 / 2f; + if (this.mount.Active) + num1 = (float) this.mount.PlayerOffset; + Vector2 vector2_2 = this.position + spinningpoint1 + vector2_1; + Vector2 vector2_3 = this.oldPosition + spinningpoint2 + vector2_1; + vector2_3.Y -= num1 / 2f; + vector2_2.Y -= num1 / 2f; float num2 = 1f; switch (this.yoraiz0rEye % 10) { @@ -7199,17 +5616,17 @@ namespace Terraria { DelegateMethods.v3_1 = Main.hslToRgb(Main.rgbToHsl(this.eyeColor).X, 1f, 0.5f).ToVector3() * 0.5f * num2; if (this.velocity != Vector2.Zero) - Utils.PlotTileLine(this.Center, this.Center + this.velocity * 2f, 4f, new Utils.TileActionAttempt(DelegateMethods.CastLightOpen)); + Utils.PlotTileLine(this.Center, this.Center + this.velocity * 2f, 4f, new Utils.PerLinePoint(DelegateMethods.CastLightOpen)); else - Utils.PlotTileLine(this.Left, this.Right, 4f, new Utils.TileActionAttempt(DelegateMethods.CastLightOpen)); + Utils.PlotTileLine(this.Left, this.Right, 4f, new Utils.PerLinePoint(DelegateMethods.CastLightOpen)); } - int num3 = (int) Vector2.Distance(vector2_4, vector2_5) / 3 + 1; - if ((double) Vector2.Distance(vector2_4, vector2_5) % 3.0 != 0.0) + int num3 = (int) Vector2.Distance(vector2_2, vector2_3) / 3 + 1; + if ((double) Vector2.Distance(vector2_2, vector2_3) % 3.0 != 0.0) ++num3; for (float num4 = 1f; (double) num4 <= (double) num3; ++num4) { Dust dust = Main.dust[Dust.NewDust(this.Center, 0, 0, 182)]; - dust.position = Vector2.Lerp(vector2_5, vector2_4, num4 / (float) num3); + dust.position = Vector2.Lerp(vector2_3, vector2_2, num4 / (float) num3); dust.noGravity = true; dust.velocity = Vector2.Zero; dust.customData = (object) this; @@ -7218,31 +5635,8 @@ namespace Terraria } } - public bool IsAValidEquipmentSlotForIteration(int slot) - { - switch (slot) - { - case 8: - case 18: - bool flag1 = this.extraAccessory; - if ((Main.expertMode ? 1 : (Main.gameMenu ? 1 : 0)) == 0) - flag1 = false; - return flag1; - case 9: - case 19: - bool flag2 = true; - if ((Main.masterMode ? 1 : (Main.gameMenu ? 1 : 0)) == 0) - flag2 = false; - return flag2; - default: - return true; - } - } - public void UpdateEquips(int i) { - if (this.inventory[this.selectedItem].type == 277 && (!this.mount.Active || !this.mount.Cart)) - this.trident = true; for (int index = 0; index < 58; ++index) { int type = this.inventory[index].type; @@ -7290,20 +5684,12 @@ namespace Terraria this.autoPaint = true; if (type == 3624) this.autoActuator = true; - if (type == 4346) - this.preventAllItemPickups = true; - if (type == 4767) - this.dontHurtCritters = true; - if (type == 4743) - this.hasFootball = true; } - if (this.inventory[58].type == 4743) - this.hasFootball = true; - for (int slot = 0; slot < 10; ++slot) + for (int index1 = 0; index1 < 8 + this.extraAccessorySlots; ++index1) { - if (this.IsAValidEquipmentSlotForIteration(slot) && (!this.armor[slot].expertOnly || Main.expertMode)) + if (!this.armor[index1].expertOnly || Main.expertMode) { - int type = this.armor[slot].type; + int type = this.armor[index1].type; if ((type == 15 || type == 707) && this.accWatch < 1) this.accWatch = 1; if ((type == 16 || type == 708) && this.accWatch < 2) @@ -7340,24 +5726,74 @@ namespace Terraria this.accDreamCatcher = true; if (type == 3619) this.InfoAccMechShowWires = true; - if (this.armor[slot].type == 3017 || this.armor[slot].type == 3993) + if (this.armor[index1].type == 3017 && this.whoAmI == Main.myPlayer && (double) this.velocity.Y == 0.0 && this.grappling[0] == -1) { - this.flowerBoots = true; - if (this.armor[slot].type == 3993) - this.fairyBoots = true; - if (this.whoAmI == Main.myPlayer) - this.DoBootsEffect(new Utils.TileActionAttempt(this.DoBootsEffect_PlaceFlowersOnTile)); + int index2 = (int) this.Center.X / 16; + int tileY = (int) ((double) this.position.Y + (double) this.height - 1.0) / 16; + if (Main.tile[index2, tileY] == null) + Main.tile[index2, tileY] = new Tile(); + if (!Main.tile[index2, tileY].active() && Main.tile[index2, tileY].liquid == (byte) 0 && Main.tile[index2, tileY + 1] != null && WorldGen.SolidTile(index2, tileY + 1)) + { + Main.tile[index2, tileY].frameY = (short) 0; + Main.tile[index2, tileY].slope((byte) 0); + Main.tile[index2, tileY].halfBrick(false); + if (Main.tile[index2, tileY + 1].type == (ushort) 2) + { + if (Main.rand.Next(2) == 0) + { + Main.tile[index2, tileY].active(true); + Main.tile[index2, tileY].type = (ushort) 3; + Main.tile[index2, tileY].frameX = (short) (18 * Main.rand.Next(6, 11)); + while (Main.tile[index2, tileY].frameX == (short) 144) + Main.tile[index2, tileY].frameX = (short) (18 * Main.rand.Next(6, 11)); + } + else + { + Main.tile[index2, tileY].active(true); + Main.tile[index2, tileY].type = (ushort) 73; + Main.tile[index2, tileY].frameX = (short) (18 * Main.rand.Next(6, 21)); + while (Main.tile[index2, tileY].frameX == (short) 144) + Main.tile[index2, tileY].frameX = (short) (18 * Main.rand.Next(6, 21)); + } + if (Main.netMode == 1) + NetMessage.SendTileSquare(-1, index2, tileY, 1); + } + else if (Main.tile[index2, tileY + 1].type == (ushort) 109) + { + if (Main.rand.Next(2) == 0) + { + Main.tile[index2, tileY].active(true); + Main.tile[index2, tileY].type = (ushort) 110; + Main.tile[index2, tileY].frameX = (short) (18 * Main.rand.Next(4, 7)); + while (Main.tile[index2, tileY].frameX == (short) 90) + Main.tile[index2, tileY].frameX = (short) (18 * Main.rand.Next(4, 7)); + } + else + { + Main.tile[index2, tileY].active(true); + Main.tile[index2, tileY].type = (ushort) 113; + Main.tile[index2, tileY].frameX = (short) (18 * Main.rand.Next(2, 8)); + while (Main.tile[index2, tileY].frameX == (short) 90) + Main.tile[index2, tileY].frameX = (short) (18 * Main.rand.Next(2, 8)); + } + if (Main.netMode == 1) + NetMessage.SendTileSquare(-1, index2, tileY, 1); + } + else if (Main.tile[index2, tileY + 1].type == (ushort) 60) + { + Main.tile[index2, tileY].active(true); + Main.tile[index2, tileY].type = (ushort) 74; + Main.tile[index2, tileY].frameX = (short) (18 * Main.rand.Next(9, 17)); + if (Main.netMode == 1) + NetMessage.SendTileSquare(-1, index2, tileY, 1); + } + } } - if (this.armor[slot].type == 5001) - { - this.moveSpeed += 0.25f; - this.moonLordLegs = true; - } - this.statDefense += this.armor[slot].defense; - this.lifeRegen += this.armor[slot].lifeRegen; - if (this.armor[slot].shieldSlot > (sbyte) 0) + this.statDefense += this.armor[index1].defense; + this.lifeRegen += this.armor[index1].lifeRegen; + if (this.armor[index1].shieldSlot > (sbyte) 0) this.hasRaisableShield = true; - switch (this.armor[slot].type) + switch (this.armor[index1].type) { case 3797: ++this.maxTurrets; @@ -7373,7 +5809,7 @@ namespace Terraria break; case 3800: ++this.maxTurrets; - this.lifeRegen += 4; + this.lifeRegen += 8; break; case 3801: this.meleeDamage += 0.15f; @@ -7415,7 +5851,7 @@ namespace Terraria break; case 3872: this.minionDamage += 0.3f; - this.lifeRegen += 8; + this.lifeRegen += 16; break; case 3873: this.minionDamage += 0.2f; @@ -7463,695 +5899,1486 @@ namespace Terraria this.moveSpeed += 0.2f; break; } - if (this.armor[slot].type == 268) + if (this.armor[index1].type == 268) this.accDivingHelm = true; - if (this.armor[slot].type == 238) + if (this.armor[index1].type == 238) this.magicDamage += 0.15f; - if (this.armor[slot].type == 3770) + if (this.armor[index1].type == 3770) this.slowFall = true; - if (this.armor[slot].type == 4404) - this.canFloatInWater = true; - if (this.armor[slot].type == 3776) + if (this.armor[index1].type == 3776) { this.magicDamage += 0.15f; this.minionDamage += 0.15f; } - if (this.armor[slot].type == 3777) - { - this.statManaMax2 += 40; - ++this.maxMinions; - } - if (this.armor[slot].type == 3778) - { - this.statManaMax2 += 40; - ++this.maxMinions; - } - if (this.armor[slot].type == 3212) + if (this.armor[index1].type == 3777) + this.statManaMax2 += 80; + if (this.armor[index1].type == 3778) + this.maxMinions += 2; + if (this.armor[index1].type == 3212) this.armorPenetration += 5; - if (this.armor[slot].type == 2277) + if (this.armor[index1].type == 2277) { this.magicDamage += 0.05f; this.meleeDamage += 0.05f; this.rangedDamage += 0.05f; - this.minionDamage += 0.05f; + this.thrownDamage += 0.05f; this.magicCrit += 5; this.rangedCrit += 5; this.meleeCrit += 5; + this.thrownCrit += 5; this.meleeSpeed += 0.1f; this.moveSpeed += 0.1f; } - if (this.armor[slot].type == 2279) + if (this.armor[index1].type == 2279) { this.magicDamage += 0.06f; this.magicCrit += 6; this.manaCost -= 0.1f; } - if (this.armor[slot].type == 3109 || this.armor[slot].type == 4008) + if (this.armor[index1].type == 3109) this.nightVision = true; - if (this.armor[slot].type == 256 || this.armor[slot].type == 257 || this.armor[slot].type == 258) - { - this.rangedCrit += 3; - this.meleeCrit += 3; - this.magicCrit += 3; - } - if (this.armor[slot].type == 3374 || this.armor[slot].type == 3375 || this.armor[slot].type == 3376) - this.rangedCrit += 3; - if (this.armor[slot].type == 151 || this.armor[slot].type == 959 || this.armor[slot].type == 152 || this.armor[slot].type == 153) - this.rangedDamage += 0.05f; - if (this.armor[slot].type == 2275) + if (this.armor[index1].type == 256) + this.thrownVelocity += 0.15f; + if (this.armor[index1].type == 257) + this.thrownDamage += 0.15f; + if (this.armor[index1].type == 258) + this.thrownCrit += 10; + if (this.armor[index1].type == 3374) + this.thrownVelocity += 0.2f; + if (this.armor[index1].type == 3375) + this.thrownDamage += 0.2f; + if (this.armor[index1].type == 3376) + this.thrownCrit += 15; + if (this.armor[index1].type == 2275) { this.magicDamage += 0.07f; this.magicCrit += 7; } - if (this.armor[slot].type == 123 || this.armor[slot].type == 124 || this.armor[slot].type == 125) + if (this.armor[index1].type == 123 || this.armor[index1].type == 124 || this.armor[index1].type == 125) this.magicDamage += 0.07f; - if (this.armor[slot].type == 111 || this.armor[slot].type == 228 || this.armor[slot].type == 229 || this.armor[slot].type == 230 || this.armor[slot].type == 960 || this.armor[slot].type == 961 || this.armor[slot].type == 962) + if (this.armor[index1].type == 151 || this.armor[index1].type == 152 || this.armor[index1].type == 153 || this.armor[index1].type == 959) + this.rangedDamage += 0.05f; + if (this.armor[index1].type == 111 || this.armor[index1].type == 228 || this.armor[index1].type == 229 || this.armor[index1].type == 230 || this.armor[index1].type == 960 || this.armor[index1].type == 961 || this.armor[index1].type == 962) this.statManaMax2 += 20; - if (this.armor[slot].type == 228 || this.armor[slot].type == 960) + if (this.armor[index1].type == 228 || this.armor[index1].type == 960) this.statManaMax2 += 20; - if (this.armor[slot].type == 228 || this.armor[slot].type == 229 || this.armor[slot].type == 230 || this.armor[slot].type == 960 || this.armor[slot].type == 961 || this.armor[slot].type == 962) + if (this.armor[index1].type == 228 || this.armor[index1].type == 229 || this.armor[index1].type == 230 || this.armor[index1].type == 960 || this.armor[index1].type == 961 || this.armor[index1].type == 962) this.magicCrit += 4; - if (this.armor[slot].type == 100 || this.armor[slot].type == 101 || this.armor[slot].type == 102) + if (this.armor[index1].type == 100 || this.armor[index1].type == 101 || this.armor[index1].type == 102) this.meleeSpeed += 0.07f; - if (this.armor[slot].type == 956 || this.armor[slot].type == 957 || this.armor[slot].type == 958) + if (this.armor[index1].type == 956 || this.armor[index1].type == 957 || this.armor[index1].type == 958) this.meleeSpeed += 0.07f; - if (this.armor[slot].type == 792 || this.armor[slot].type == 793 || this.armor[slot].type == 794) + if (this.armor[index1].type == 792 || this.armor[index1].type == 793 || this.armor[index1].type == 794) { this.meleeDamage += 0.02f; this.rangedDamage += 0.02f; this.magicDamage += 0.02f; - this.minionDamage += 0.02f; + this.thrownDamage += 0.02f; } - if (this.armor[slot].type == 371) + if (this.armor[index1].type == 371) { this.magicCrit += 9; this.statManaMax2 += 40; } - if (this.armor[slot].type == 372) + if (this.armor[index1].type == 372) { this.moveSpeed += 0.07f; this.meleeSpeed += 0.12f; } - if (this.armor[slot].type == 373) + if (this.armor[index1].type == 373) { this.rangedDamage += 0.1f; this.rangedCrit += 6; } - if (this.armor[slot].type == 374) + if (this.armor[index1].type == 374) { this.magicCrit += 3; this.meleeCrit += 3; this.rangedCrit += 3; } - if (this.armor[slot].type == 375) + if (this.armor[index1].type == 375) this.moveSpeed += 0.1f; - if (this.armor[slot].type == 376) + if (this.armor[index1].type == 376) { this.magicDamage += 0.15f; this.statManaMax2 += 60; } - if (this.armor[slot].type == 377) + if (this.armor[index1].type == 377) { this.meleeCrit += 5; this.meleeDamage += 0.1f; } - if (this.armor[slot].type == 378) + if (this.armor[index1].type == 378) { this.rangedDamage += 0.12f; this.rangedCrit += 7; } - if (this.armor[slot].type == 379) + if (this.armor[index1].type == 379) { this.rangedDamage += 0.05f; this.meleeDamage += 0.05f; this.magicDamage += 0.05f; - this.minionDamage += 0.05f; } - if (this.armor[slot].type == 380) + if (this.armor[index1].type == 380) { this.magicCrit += 3; this.meleeCrit += 3; this.rangedCrit += 3; } - if (this.armor[slot].type >= 2367 && this.armor[slot].type <= 2369) + if (this.armor[index1].type >= 2367 && this.armor[index1].type <= 2369) this.fishingSkill += 5; - if (this.armor[slot].type == 400) + if (this.armor[index1].type == 400) { this.magicDamage += 0.11f; this.magicCrit += 11; this.statManaMax2 += 80; } - if (this.armor[slot].type == 401) + if (this.armor[index1].type == 401) { this.meleeCrit += 7; this.meleeDamage += 0.14f; } - if (this.armor[slot].type == 402) + if (this.armor[index1].type == 402) { this.rangedDamage += 0.14f; this.rangedCrit += 8; } - if (this.armor[slot].type == 403) + if (this.armor[index1].type == 403) { this.rangedDamage += 0.06f; this.meleeDamage += 0.06f; this.magicDamage += 0.06f; - this.minionDamage += 0.06f; } - if (this.armor[slot].type == 404) + if (this.armor[index1].type == 404) { this.magicCrit += 4; this.meleeCrit += 4; this.rangedCrit += 4; this.moveSpeed += 0.05f; } - if (this.armor[slot].type == 1205) + if (this.armor[index1].type == 1205) { this.meleeDamage += 0.08f; this.meleeSpeed += 0.12f; } - if (this.armor[slot].type == 1206) + if (this.armor[index1].type == 1206) { this.rangedDamage += 0.09f; this.rangedCrit += 9; } - if (this.armor[slot].type == 1207) + if (this.armor[index1].type == 1207) { this.magicDamage += 0.07f; this.magicCrit += 7; this.statManaMax2 += 60; } - if (this.armor[slot].type == 1208) + if (this.armor[index1].type == 1208) { this.meleeDamage += 0.03f; this.rangedDamage += 0.03f; this.magicDamage += 0.03f; - this.minionDamage += 0.03f; this.magicCrit += 2; this.meleeCrit += 2; this.rangedCrit += 2; } - if (this.armor[slot].type == 1209) + if (this.armor[index1].type == 1209) { this.meleeDamage += 0.02f; this.rangedDamage += 0.02f; this.magicDamage += 0.02f; - this.minionDamage += 0.02f; ++this.magicCrit; ++this.meleeCrit; ++this.rangedCrit; } - if (this.armor[slot].type == 1210) + if (this.armor[index1].type == 1210) { this.meleeDamage += 0.07f; this.meleeSpeed += 0.07f; this.moveSpeed += 0.07f; } - if (this.armor[slot].type == 1211) + if (this.armor[index1].type == 1211) { this.rangedCrit += 15; this.moveSpeed += 0.08f; } - if (this.armor[slot].type == 1212) + if (this.armor[index1].type == 1212) { this.magicCrit += 18; this.statManaMax2 += 80; } - if (this.armor[slot].type == 1213) + if (this.armor[index1].type == 1213) { this.magicCrit += 6; this.meleeCrit += 6; this.rangedCrit += 6; } - if (this.armor[slot].type == 1214) + if (this.armor[index1].type == 1214) this.moveSpeed += 0.11f; - if (this.armor[slot].type == 1215) + if (this.armor[index1].type == 1215) { this.meleeDamage += 0.08f; this.meleeCrit += 8; this.meleeSpeed += 0.08f; } - if (this.armor[slot].type == 1216) + if (this.armor[index1].type == 1216) { this.rangedDamage += 0.16f; this.rangedCrit += 7; } - if (this.armor[slot].type == 1217) + if (this.armor[index1].type == 1217) { this.magicDamage += 0.16f; this.magicCrit += 7; this.statManaMax2 += 100; } - if (this.armor[slot].type == 1218) + if (this.armor[index1].type == 1218) { this.meleeDamage += 0.04f; this.rangedDamage += 0.04f; this.magicDamage += 0.04f; - this.minionDamage += 0.04f; this.magicCrit += 3; this.meleeCrit += 3; this.rangedCrit += 3; } - if (this.armor[slot].type == 1219) + if (this.armor[index1].type == 1219) { this.meleeDamage += 0.03f; this.rangedDamage += 0.03f; this.magicDamage += 0.03f; - this.minionDamage += 0.03f; this.magicCrit += 3; this.meleeCrit += 3; this.rangedCrit += 3; this.moveSpeed += 0.06f; } - if (this.armor[slot].type == 558 || this.armor[slot].type == 4898) + if (this.armor[index1].type == 558) { this.magicDamage += 0.12f; this.magicCrit += 12; this.statManaMax2 += 100; } - if (this.armor[slot].type == 559 || this.armor[slot].type == 4896) + if (this.armor[index1].type == 559) { this.meleeCrit += 10; this.meleeDamage += 0.1f; this.meleeSpeed += 0.1f; } - if (this.armor[slot].type == 553 || this.armor[slot].type == 4897) + if (this.armor[index1].type == 553) { this.rangedDamage += 0.15f; this.rangedCrit += 8; } - if (this.armor[slot].type == 4873 || this.armor[slot].type == 4899) - { - this.minionDamage += 0.1f; - ++this.maxMinions; - } - if (this.armor[slot].type == 551 || this.armor[slot].type == 4900) + if (this.armor[index1].type == 551) { this.magicCrit += 7; this.meleeCrit += 7; this.rangedCrit += 7; } - if (this.armor[slot].type == 552 || this.armor[slot].type == 4901) + if (this.armor[index1].type == 552) { this.rangedDamage += 0.07f; this.meleeDamage += 0.07f; this.magicDamage += 0.07f; - this.minionDamage += 0.07f; this.moveSpeed += 0.08f; } - if (this.armor[slot].type == 4982) - { - this.rangedCrit += 5; - this.meleeCrit += 5; - this.magicCrit += 5; - } - if (this.armor[slot].type == 4983) - { - this.rangedDamage += 0.05f; - this.meleeDamage += 0.05f; - this.magicDamage += 0.05f; - this.minionDamage += 0.05f; - } - if (this.armor[slot].type == 4984) - this.moveSpeed += 0.1f; - if (this.armor[slot].type == 1001) + if (this.armor[index1].type == 1001) { this.meleeDamage += 0.16f; this.meleeCrit += 6; } - if (this.armor[slot].type == 1002) + if (this.armor[index1].type == 1002) { this.rangedDamage += 0.16f; - this.chloroAmmoCost80 = true; + this.ammoCost80 = true; } - if (this.armor[slot].type == 1003) + if (this.armor[index1].type == 1003) { this.statManaMax2 += 80; this.manaCost -= 0.17f; this.magicDamage += 0.16f; } - if (this.armor[slot].type == 1004) + if (this.armor[index1].type == 1004) { this.meleeDamage += 0.05f; this.magicDamage += 0.05f; this.rangedDamage += 0.05f; - this.minionDamage += 0.05f; this.magicCrit += 7; this.meleeCrit += 7; this.rangedCrit += 7; } - if (this.armor[slot].type == 1005) + if (this.armor[index1].type == 1005) { this.magicCrit += 8; this.meleeCrit += 8; this.rangedCrit += 8; this.moveSpeed += 0.05f; } - if (this.armor[slot].type == 2189) + if (this.armor[index1].type == 2189) { this.statManaMax2 += 60; this.manaCost -= 0.13f; this.magicDamage += 0.05f; this.magicCrit += 5; } - if (this.armor[slot].type == 1503) + if (this.armor[index1].type == 1503) this.magicDamage -= 0.4f; - if (this.armor[slot].type == 1504) + if (this.armor[index1].type == 1504) { this.magicDamage += 0.07f; this.magicCrit += 7; } - if (this.armor[slot].type == 1505) + if (this.armor[index1].type == 1505) { this.magicDamage += 0.08f; this.moveSpeed += 0.08f; } - if (this.armor[slot].type == 1546) + if (this.armor[index1].type == 1546) { this.rangedCrit += 5; this.arrowDamage += 0.15f; } - if (this.armor[slot].type == 1547) + if (this.armor[index1].type == 1547) { this.rangedCrit += 5; this.bulletDamage += 0.15f; } - if (this.armor[slot].type == 1548) + if (this.armor[index1].type == 1548) { this.rangedCrit += 5; this.rocketDamage += 0.15f; } - if (this.armor[slot].type == 1549) + if (this.armor[index1].type == 1549) { this.rangedCrit += 13; this.rangedDamage += 0.13f; this.ammoCost80 = true; } - if (this.armor[slot].type == 1550) + if (this.armor[index1].type == 1550) { this.rangedCrit += 7; this.moveSpeed += 0.12f; } - if (this.armor[slot].type == 1282) + if (this.armor[index1].type == 1282) { this.statManaMax2 += 20; this.manaCost -= 0.05f; } - if (this.armor[slot].type == 1283) + if (this.armor[index1].type == 1283) { this.statManaMax2 += 40; this.manaCost -= 0.07f; } - if (this.armor[slot].type == 1284) + if (this.armor[index1].type == 1284) { this.statManaMax2 += 40; this.manaCost -= 0.09f; } - if (this.armor[slot].type == 1285) + if (this.armor[index1].type == 1285) { this.statManaMax2 += 60; this.manaCost -= 0.11f; } - if (this.armor[slot].type == 1286 || this.armor[slot].type == 4256) + if (this.armor[index1].type == 1286) { this.statManaMax2 += 60; this.manaCost -= 0.13f; } - if (this.armor[slot].type == 1287) + if (this.armor[index1].type == 1287) { this.statManaMax2 += 80; this.manaCost -= 0.15f; } - if (this.armor[slot].type == 1316 || this.armor[slot].type == 1317 || this.armor[slot].type == 1318) + if (this.armor[index1].type == 1316 || this.armor[index1].type == 1317 || this.armor[index1].type == 1318) this.aggro += 250; - if (this.armor[slot].type == 1316) + if (this.armor[index1].type == 1316) this.meleeDamage += 0.06f; - if (this.armor[slot].type == 1317) + if (this.armor[index1].type == 1317) { this.meleeDamage += 0.08f; this.meleeCrit += 8; } - if (this.armor[slot].type == 1318) + if (this.armor[index1].type == 1318) this.meleeCrit += 4; - if (this.armor[slot].type == 2199 || this.armor[slot].type == 2202) + if (this.armor[index1].type == 2199 || this.armor[index1].type == 2202) this.aggro += 250; - if (this.armor[slot].type == 2201) + if (this.armor[index1].type == 2201) this.aggro += 400; - if (this.armor[slot].type == 2199) + if (this.armor[index1].type == 2199) this.meleeDamage += 0.06f; - if (this.armor[slot].type == 2200) + if (this.armor[index1].type == 2200) { this.meleeDamage += 0.08f; this.meleeCrit += 8; this.meleeSpeed += 0.06f; this.moveSpeed += 0.06f; } - if (this.armor[slot].type == 2201) + if (this.armor[index1].type == 2201) { this.meleeDamage += 0.05f; this.meleeCrit += 5; } - if (this.armor[slot].type == 2202) + if (this.armor[index1].type == 2202) { this.meleeSpeed += 0.06f; this.moveSpeed += 0.06f; } - if (this.armor[slot].type == 684) + if (this.armor[index1].type == 684) { this.rangedDamage += 0.16f; this.meleeDamage += 0.16f; } - if (this.armor[slot].type == 685) + if (this.armor[index1].type == 685) { this.meleeCrit += 11; this.rangedCrit += 11; } - if (this.armor[slot].type == 686) + if (this.armor[index1].type == 686) { this.moveSpeed += 0.08f; this.meleeSpeed += 0.07f; } - if (this.armor[slot].type == 2361) + if (this.armor[index1].type == 2361) { ++this.maxMinions; this.minionDamage += 0.04f; } - if (this.armor[slot].type == 2362) + if (this.armor[index1].type == 2362) { ++this.maxMinions; this.minionDamage += 0.04f; } - if (this.armor[slot].type == 2363) + if (this.armor[index1].type == 2363) this.minionDamage += 0.05f; - if (this.armor[slot].type >= 1158 && this.armor[slot].type <= 1161) + if (this.armor[index1].type >= 1158 && this.armor[index1].type <= 1161) ++this.maxMinions; - if (this.armor[slot].type >= 1159 && this.armor[slot].type <= 1161) + if (this.armor[index1].type >= 1159 && this.armor[index1].type <= 1161) this.minionDamage += 0.1f; - if (this.armor[slot].type >= 2370 && this.armor[slot].type <= 2371) + if (this.armor[index1].type >= 2370 && this.armor[index1].type <= 2371) { this.minionDamage += 0.05f; ++this.maxMinions; } - if (this.armor[slot].type == 2372) + if (this.armor[index1].type == 2372) { this.minionDamage += 0.06f; ++this.maxMinions; } - if (this.armor[slot].type == 3381 || this.armor[slot].type == 3382 || this.armor[slot].type == 3383) + if (this.armor[index1].type == 3381 || this.armor[index1].type == 3382 || this.armor[index1].type == 3383) { - if (this.armor[slot].type != 3381) + if (this.armor[index1].type != 3381) ++this.maxMinions; ++this.maxMinions; this.minionDamage += 0.22f; } - if (this.armor[slot].type == 2763) + if (this.armor[index1].type == 2763) { this.aggro += 300; - this.meleeCrit += 26; - this.lifeRegen += 2; + this.meleeCrit += 17; } - if (this.armor[slot].type == 2764) + if (this.armor[index1].type == 2764) { this.aggro += 300; - this.meleeDamage += 0.29f; - this.lifeRegen += 2; + this.meleeDamage += 0.22f; } - if (this.armor[slot].type == 2765) + if (this.armor[index1].type == 2765) { this.aggro += 300; this.meleeSpeed += 0.15f; this.moveSpeed += 0.15f; - this.lifeRegen += 2; } - if (this.armor[slot].type == 2757) + if (this.armor[index1].type == 2757) { this.rangedCrit += 7; this.rangedDamage += 0.16f; } - if (this.armor[slot].type == 2758) + if (this.armor[index1].type == 2758) { this.ammoCost75 = true; this.rangedCrit += 12; this.rangedDamage += 0.12f; } - if (this.armor[slot].type == 2759) + if (this.armor[index1].type == 2759) { this.rangedCrit += 8; this.rangedDamage += 0.08f; this.moveSpeed += 0.1f; } - if (this.armor[slot].type == 2760) + if (this.armor[index1].type == 2760) { this.statManaMax2 += 60; this.manaCost -= 0.15f; this.magicCrit += 7; this.magicDamage += 0.07f; } - if (this.armor[slot].type == 2761) + if (this.armor[index1].type == 2761) { this.magicDamage += 0.09f; this.magicCrit += 9; } - if (this.armor[slot].type == 2762) + if (this.armor[index1].type == 2762) { this.moveSpeed += 0.1f; this.magicDamage += 0.1f; } - if (this.armor[slot].type == 1832) - { + if (this.armor[index1].type >= 1832 && this.armor[index1].type <= 1834) ++this.maxMinions; + if (this.armor[index1].type >= 1832 && this.armor[index1].type <= 1834) this.minionDamage += 0.11f; - } - if (this.armor[slot].type == 1833) - { - this.maxMinions += 2; - this.minionDamage += 0.11f; - } - if (this.armor[slot].type == 1834) - { - this.moveSpeed += 0.2f; - ++this.maxMinions; - this.minionDamage += 0.11f; - } - if (this.armor[slot].prefix == (byte) 62) + if (this.armor[index1].prefix == (byte) 62) ++this.statDefense; - if (this.armor[slot].prefix == (byte) 63) + if (this.armor[index1].prefix == (byte) 63) this.statDefense += 2; - if (this.armor[slot].prefix == (byte) 64) + if (this.armor[index1].prefix == (byte) 64) this.statDefense += 3; - if (this.armor[slot].prefix == (byte) 65) + if (this.armor[index1].prefix == (byte) 65) this.statDefense += 4; - if (this.armor[slot].prefix == (byte) 66) + if (this.armor[index1].prefix == (byte) 66) this.statManaMax2 += 20; - if (this.armor[slot].prefix == (byte) 67) + if (this.armor[index1].prefix == (byte) 67) { this.meleeCrit += 2; this.rangedCrit += 2; this.magicCrit += 2; + this.thrownCrit += 2; } - if (this.armor[slot].prefix == (byte) 68) + if (this.armor[index1].prefix == (byte) 68) { this.meleeCrit += 4; this.rangedCrit += 4; this.magicCrit += 4; + this.thrownCrit += 4; } - if (this.armor[slot].prefix == (byte) 69) + if (this.armor[index1].prefix == (byte) 69) { this.meleeDamage += 0.01f; this.rangedDamage += 0.01f; this.magicDamage += 0.01f; this.minionDamage += 0.01f; + this.thrownDamage += 0.01f; } - if (this.armor[slot].prefix == (byte) 70) + if (this.armor[index1].prefix == (byte) 70) { this.meleeDamage += 0.02f; this.rangedDamage += 0.02f; this.magicDamage += 0.02f; this.minionDamage += 0.02f; + this.thrownDamage += 0.02f; } - if (this.armor[slot].prefix == (byte) 71) + if (this.armor[index1].prefix == (byte) 71) { this.meleeDamage += 0.03f; this.rangedDamage += 0.03f; this.magicDamage += 0.03f; this.minionDamage += 0.03f; + this.thrownDamage += 0.03f; } - if (this.armor[slot].prefix == (byte) 72) + if (this.armor[index1].prefix == (byte) 72) { this.meleeDamage += 0.04f; this.rangedDamage += 0.04f; this.magicDamage += 0.04f; this.minionDamage += 0.04f; + this.thrownDamage += 0.04f; } - if (this.armor[slot].prefix == (byte) 73) + if (this.armor[index1].prefix == (byte) 73) this.moveSpeed += 0.01f; - if (this.armor[slot].prefix == (byte) 74) + if (this.armor[index1].prefix == (byte) 74) this.moveSpeed += 0.02f; - if (this.armor[slot].prefix == (byte) 75) + if (this.armor[index1].prefix == (byte) 75) this.moveSpeed += 0.03f; - if (this.armor[slot].prefix == (byte) 76) + if (this.armor[index1].prefix == (byte) 76) this.moveSpeed += 0.04f; - if (this.armor[slot].prefix == (byte) 77) + if (this.armor[index1].prefix == (byte) 77) this.meleeSpeed += 0.01f; - if (this.armor[slot].prefix == (byte) 78) + if (this.armor[index1].prefix == (byte) 78) this.meleeSpeed += 0.02f; - if (this.armor[slot].prefix == (byte) 79) + if (this.armor[index1].prefix == (byte) 79) this.meleeSpeed += 0.03f; - if (this.armor[slot].prefix == (byte) 80) + if (this.armor[index1].prefix == (byte) 80) this.meleeSpeed += 0.04f; } } - this.equippedAnyWallSpeedAcc = false; - this.equippedAnyTileSpeedAcc = false; - this.equippedAnyTileRangeAcc = false; - for (int index = 3; index < 10; ++index) + bool flag1 = false; + bool flag2 = false; + bool flag3 = false; + for (int index = 3; index < 8 + this.extraAccessorySlots; ++index) { - if (this.IsAValidEquipmentSlotForIteration(index)) - this.ApplyEquipFunctional(index, this.armor[index]); - } - if (this.skyStoneEffects) - { - this.lifeRegen += 2; - this.statDefense += 4; - this.meleeSpeed += 0.1f; - this.meleeDamage += 0.1f; - this.meleeCrit += 2; - this.rangedDamage += 0.1f; - this.rangedCrit += 2; - this.magicDamage += 0.1f; - this.magicCrit += 2; - this.pickSpeed -= 0.15f; - this.minionDamage += 0.1f; - this.minionKB += 0.5f; + if (!this.armor[index].expertOnly || Main.expertMode) + { + if (this.armor[index].type == 3810 || this.armor[index].type == 3809 || this.armor[index].type == 3812 || this.armor[index].type == 3811) + this.dd2Accessory = true; + if (this.armor[index].type == 3015) + { + this.aggro -= 400; + this.meleeCrit += 5; + this.magicCrit += 5; + this.rangedCrit += 5; + this.thrownCrit += 5; + this.meleeDamage += 0.05f; + this.magicDamage += 0.05f; + this.rangedDamage += 0.05f; + this.thrownDamage += 0.05f; + this.minionDamage += 0.05f; + } + if (this.armor[index].type == 3016) + this.aggro += 400; + if (this.armor[index].type == 2373) + this.accFishingLine = true; + if (this.armor[index].type == 2374) + this.fishingSkill += 10; + if (this.armor[index].type == 2375) + this.accTackleBox = true; + if (this.armor[index].type == 3721) + { + this.accFishingLine = true; + this.accTackleBox = true; + this.fishingSkill += 10; + } + if (this.armor[index].type == 3090) + { + this.npcTypeNoAggro[1] = true; + this.npcTypeNoAggro[16] = true; + this.npcTypeNoAggro[59] = true; + this.npcTypeNoAggro[71] = true; + this.npcTypeNoAggro[81] = true; + this.npcTypeNoAggro[138] = true; + this.npcTypeNoAggro[121] = true; + this.npcTypeNoAggro[122] = true; + this.npcTypeNoAggro[141] = true; + this.npcTypeNoAggro[147] = true; + this.npcTypeNoAggro[183] = true; + this.npcTypeNoAggro[184] = true; + this.npcTypeNoAggro[204] = true; + this.npcTypeNoAggro[225] = true; + this.npcTypeNoAggro[244] = true; + this.npcTypeNoAggro[302] = true; + this.npcTypeNoAggro[333] = true; + this.npcTypeNoAggro[335] = true; + this.npcTypeNoAggro[334] = true; + this.npcTypeNoAggro[336] = true; + this.npcTypeNoAggro[537] = true; + } + if (this.armor[index].stringColor > 0) + this.yoyoString = true; + if (this.armor[index].type == 3366) + { + this.counterWeight = 556 + Main.rand.Next(6); + this.yoyoGlove = true; + this.yoyoString = true; + } + if (this.armor[index].type >= 3309 && this.armor[index].type <= 3314) + this.counterWeight = 556 + this.armor[index].type - 3309; + if (this.armor[index].type == 3334) + this.yoyoGlove = true; + if (this.armor[index].type == 3337) + this.shinyStone = true; + if (this.armor[index].type == 3336) + { + this.SporeSac(); + this.sporeSac = true; + } + if (this.armor[index].type == 2423) + { + this.autoJump = true; + this.jumpSpeedBoost += 2.4f; + this.extraFall += 15; + } + if (this.armor[index].type == 857) + this.doubleJumpSandstorm = true; + if (this.armor[index].type == 983) + { + this.doubleJumpSandstorm = true; + this.jumpBoost = true; + } + if (this.armor[index].type == 987) + this.doubleJumpBlizzard = true; + if (this.armor[index].type == 1163) + { + this.doubleJumpBlizzard = true; + this.jumpBoost = true; + } + if (this.armor[index].type == 1724) + this.doubleJumpFart = true; + if (this.armor[index].type == 1863) + { + this.doubleJumpFart = true; + this.jumpBoost = true; + } + if (this.armor[index].type == 1164) + { + this.doubleJumpCloud = true; + this.doubleJumpSandstorm = true; + this.doubleJumpBlizzard = true; + this.jumpBoost = true; + } + if (this.armor[index].type == 1250) + { + this.jumpBoost = true; + this.doubleJumpCloud = true; + this.noFallDmg = true; + } + if (this.armor[index].type == 1252) + { + this.doubleJumpSandstorm = true; + this.jumpBoost = true; + this.noFallDmg = true; + } + if (this.armor[index].type == 1251) + { + this.doubleJumpBlizzard = true; + this.jumpBoost = true; + this.noFallDmg = true; + } + if (this.armor[index].type == 3250) + { + this.doubleJumpFart = true; + this.jumpBoost = true; + this.noFallDmg = true; + } + if (this.armor[index].type == 3252) + { + this.doubleJumpSail = true; + this.jumpBoost = true; + this.noFallDmg = true; + } + if (this.armor[index].type == 3251) + { + this.jumpBoost = true; + this.bee = true; + this.noFallDmg = true; + } + if (this.armor[index].type == 1249) + { + this.jumpBoost = true; + this.bee = true; + } + if (this.armor[index].type == 3241) + { + this.jumpBoost = true; + this.doubleJumpSail = true; + } + if (this.armor[index].type == 1253 && (double) this.statLife <= (double) this.statLifeMax2 * 0.5) + this.AddBuff(62, 5); + if (this.armor[index].type == 1290) + this.panic = true; + if ((this.armor[index].type == 1300 || this.armor[index].type == 1858) && (this.inventory[this.selectedItem].useAmmo == AmmoID.Bullet || this.inventory[this.selectedItem].useAmmo == AmmoID.CandyCorn || this.inventory[this.selectedItem].useAmmo == AmmoID.Stake || this.inventory[this.selectedItem].useAmmo == 23)) + this.scope = true; + if (this.armor[index].type == 1858) + { + this.rangedCrit += 10; + this.rangedDamage += 0.1f; + } + if (this.armor[index].type == 1303 && this.wet) + Lighting.AddLight((int) this.Center.X / 16, (int) this.Center.Y / 16, 0.9f, 0.2f, 0.6f); + if (this.armor[index].type == 1301) + { + this.meleeCrit += 8; + this.rangedCrit += 8; + this.magicCrit += 8; + this.thrownCrit += 8; + this.meleeDamage += 0.1f; + this.rangedDamage += 0.1f; + this.magicDamage += 0.1f; + this.minionDamage += 0.1f; + this.thrownDamage += 0.1f; + } + if (this.armor[index].type == 982) + { + this.statManaMax2 += 20; + ++this.manaRegenDelayBonus; + this.manaRegenBonus += 25; + } + if (this.armor[index].type == 1595) + { + this.statManaMax2 += 20; + this.magicCuffs = true; + } + if (this.armor[index].type == 2219) + this.manaMagnet = true; + if (this.armor[index].type == 2220) + { + this.manaMagnet = true; + this.magicDamage += 0.15f; + } + if (this.armor[index].type == 2221) + { + this.manaMagnet = true; + this.magicCuffs = true; + } + if (this.whoAmI == Main.myPlayer && this.armor[index].type == 1923) + { + ++Player.tileRangeX; + ++Player.tileRangeY; + } + if (this.armor[index].type == 1247) + { + this.starCloak = true; + this.bee = true; + } + if (this.armor[index].type == 1248) + { + this.meleeCrit += 10; + this.rangedCrit += 10; + this.magicCrit += 10; + this.thrownCrit += 10; + } + if (this.armor[index].type == 854) + this.discount = true; + if (this.armor[index].type == 855) + this.coins = true; + if (this.armor[index].type == 3033) + this.goldRing = true; + if (this.armor[index].type == 3034) + { + this.goldRing = true; + this.coins = true; + } + if (this.armor[index].type == 3035) + { + this.goldRing = true; + this.coins = true; + this.discount = true; + } + if (this.armor[index].type == 53) + this.doubleJumpCloud = true; + if (this.armor[index].type == 3201) + this.doubleJumpSail = true; + if (this.armor[index].type == 54) + this.accRunSpeed = 6f; + if (this.armor[index].type == 3068) + this.cordage = true; + if (this.armor[index].type == 1579) + { + this.accRunSpeed = 6f; + this.coldDash = true; + } + if (this.armor[index].type == 3200) + { + this.accRunSpeed = 6f; + this.sailDash = true; + } + if (this.armor[index].type == 128) + this.rocketBoots = 1; + if (this.armor[index].type == 156) + this.noKnockback = true; + if (this.armor[index].type == 158) + this.noFallDmg = true; + if (this.armor[index].type == 934) + this.carpet = true; + if (this.armor[index].type == 953) + ++this.spikedBoots; + if (this.armor[index].type == 975) + ++this.spikedBoots; + if (this.armor[index].type == 976) + this.spikedBoots += 2; + if (this.armor[index].type == 977) + this.dash = 1; + if (this.armor[index].type == 3097) + this.dash = 2; + if (this.armor[index].type == 963) + this.blackBelt = true; + if (this.armor[index].type == 984) + { + this.blackBelt = true; + this.dash = 1; + this.spikedBoots = 2; + } + if (this.armor[index].type == 1131) + this.gravControl2 = true; + if (this.armor[index].type == 1132) + this.bee = true; + if (this.armor[index].type == 1578) + { + this.bee = true; + this.panic = true; + } + if (this.armor[index].type == 3224) + this.endurance += 0.17f; + if (this.armor[index].type == 3223) + this.brainOfConfusion = true; + if (this.armor[index].type == 950) + this.iceSkate = true; + if (this.armor[index].type == 159) + this.jumpBoost = true; + if (this.armor[index].type == 3225) + this.jumpBoost = true; + if (this.armor[index].type == 187) + this.accFlipper = true; + if (this.armor[index].type == 211) + this.meleeSpeed += 0.12f; + if (this.armor[index].type == 223) + this.manaCost -= 0.06f; + if (this.armor[index].type == 285) + this.moveSpeed += 0.05f; + if (this.armor[index].type == 212) + this.moveSpeed += 0.1f; + if (this.armor[index].type == 267) + this.killGuide = true; + if (this.armor[index].type == 1307) + this.killClothier = true; + if (this.armor[index].type == 193) + this.fireWalk = true; + if (this.armor[index].type == 861) + { + this.accMerman = true; + this.wolfAcc = true; + if (this.hideVisual[index]) + { + this.hideMerman = true; + this.hideWolf = true; + } + } + if (this.armor[index].type == 862) + { + this.starCloak = true; + this.longInvince = true; + } + if (this.armor[index].type == 860) + this.pStone = true; + if (this.armor[index].type == 863) + this.waterWalk2 = true; + if (this.armor[index].type == 907) + { + this.waterWalk2 = true; + this.fireWalk = true; + } + if (this.armor[index].type == 908) + { + this.waterWalk = true; + this.fireWalk = true; + this.lavaMax += 420; + } + if (this.armor[index].type == 906) + this.lavaMax += 420; + if (this.armor[index].type == 485) + { + this.wolfAcc = true; + if (this.hideVisual[index]) + this.hideWolf = true; + } + if (this.armor[index].type == 486) + this.rulerLine = true; + if (this.armor[index].type == 2799) + this.rulerGrid = true; + if (this.armor[index].type == 394) + { + this.accFlipper = true; + this.accDivingHelm = true; + } + if (this.armor[index].type == 396) + { + this.noFallDmg = true; + this.fireWalk = true; + } + if (this.armor[index].type == 397) + { + this.noKnockback = true; + this.fireWalk = true; + } + if (this.armor[index].type == 399) + { + this.jumpBoost = true; + this.doubleJumpCloud = true; + } + if (this.armor[index].type == 405) + { + this.accRunSpeed = 6f; + this.rocketBoots = 2; + } + if (this.armor[index].type == 1860) + { + this.accFlipper = true; + this.accDivingHelm = true; + if (this.wet) + Lighting.AddLight((int) this.Center.X / 16, (int) this.Center.Y / 16, 0.9f, 0.2f, 0.6f); + } + if (this.armor[index].type == 1861) + { + this.arcticDivingGear = true; + this.accFlipper = true; + this.accDivingHelm = true; + this.iceSkate = true; + if (this.wet) + Lighting.AddLight((int) this.Center.X / 16, (int) this.Center.Y / 16, 0.2f, 0.8f, 0.9f); + } + if (this.armor[index].type == 2214) + flag2 = true; + if (this.armor[index].type == 2215) + flag3 = true; + if (this.armor[index].type == 2216) + this.autoPaint = true; + if (this.armor[index].type == 2217) + flag1 = true; + if (this.armor[index].type == 3061) + { + flag1 = true; + flag2 = true; + this.autoPaint = true; + flag3 = true; + } + if (this.armor[index].type == 3624) + this.autoActuator = true; + if (this.armor[index].type == 897) + { + this.kbGlove = true; + this.meleeSpeed += 0.12f; + } + if (this.armor[index].type == 1343) + { + this.kbGlove = true; + this.meleeSpeed += 0.1f; + this.meleeDamage += 0.1f; + this.magmaStone = true; + } + if (this.armor[index].type == 1167) + { + this.minionKB += 2f; + this.minionDamage += 0.15f; + } + if (this.armor[index].type == 1864) + { + this.minionKB += 2f; + this.minionDamage += 0.15f; + ++this.maxMinions; + } + if (this.armor[index].type == 1845) + { + this.minionDamage += 0.1f; + ++this.maxMinions; + } + if (this.armor[index].type == 1321) + { + this.magicQuiver = true; + this.arrowDamage += 0.1f; + } + if (this.armor[index].type == 1322) + this.magmaStone = true; + if (this.armor[index].type == 1323) + this.lavaRose = true; + if (this.armor[index].type == 3333) + this.strongBees = true; + if (this.armor[index].type == 938) + { + this.noKnockback = true; + if ((double) this.statLife > (double) this.statLifeMax2 * 0.25) + { + this.hasPaladinShield = true; + if (i != Main.myPlayer && this.miscCounter % 10 == 0) + { + int player = Main.myPlayer; + if (Main.player[player].team == this.team && this.team != 0) + { + double num1 = (double) this.position.X - (double) Main.player[player].position.X; + float num2 = this.position.Y - Main.player[player].position.Y; + if (Math.Sqrt(num1 * num1 + (double) num2 * (double) num2) < 800.0) + Main.player[player].AddBuff(43, 20); + } + } + } + } + if (this.armor[index].type == 936) + { + this.kbGlove = true; + this.meleeSpeed += 0.12f; + this.meleeDamage += 0.12f; + } + if (this.armor[index].type == 898) + { + this.accRunSpeed = 6.75f; + this.rocketBoots = 2; + this.moveSpeed += 0.08f; + } + if (this.armor[index].type == 1862) + { + this.accRunSpeed = 6.75f; + this.rocketBoots = 3; + this.moveSpeed += 0.08f; + this.iceSkate = true; + } + if (this.armor[index].type == 3110) + { + this.accMerman = true; + this.wolfAcc = true; + if (this.hideVisual[index]) + { + this.hideMerman = true; + this.hideWolf = true; + } + } + if (this.armor[index].type == 1865 || this.armor[index].type == 3110) + { + this.lifeRegen += 2; + this.statDefense += 4; + this.meleeSpeed += 0.1f; + this.meleeDamage += 0.1f; + this.meleeCrit += 2; + this.rangedDamage += 0.1f; + this.rangedCrit += 2; + this.magicDamage += 0.1f; + this.magicCrit += 2; + this.pickSpeed -= 0.15f; + this.minionDamage += 0.1f; + this.minionKB += 0.5f; + this.thrownDamage += 0.1f; + this.thrownCrit += 2; + } + if (this.armor[index].type == 899 && Main.dayTime) + { + this.lifeRegen += 2; + this.statDefense += 4; + this.meleeSpeed += 0.1f; + this.meleeDamage += 0.1f; + this.meleeCrit += 2; + this.rangedDamage += 0.1f; + this.rangedCrit += 2; + this.magicDamage += 0.1f; + this.magicCrit += 2; + this.pickSpeed -= 0.15f; + this.minionDamage += 0.1f; + this.minionKB += 0.5f; + this.thrownDamage += 0.1f; + this.thrownCrit += 2; + } + if (this.armor[index].type == 900 && (!Main.dayTime || Main.eclipse)) + { + this.lifeRegen += 2; + this.statDefense += 4; + this.meleeSpeed += 0.1f; + this.meleeDamage += 0.1f; + this.meleeCrit += 2; + this.rangedDamage += 0.1f; + this.rangedCrit += 2; + this.magicDamage += 0.1f; + this.magicCrit += 2; + this.pickSpeed -= 0.15f; + this.minionDamage += 0.1f; + this.minionKB += 0.5f; + this.thrownDamage += 0.1f; + this.thrownCrit += 2; + } + if (this.armor[index].type == 407) + this.blockRange = 1; + if (this.armor[index].type == 489) + this.magicDamage += 0.15f; + if (this.armor[index].type == 490) + this.meleeDamage += 0.15f; + if (this.armor[index].type == 491) + this.rangedDamage += 0.15f; + if (this.armor[index].type == 2998) + this.minionDamage += 0.15f; + if (this.armor[index].type == 935) + { + this.magicDamage += 0.12f; + this.meleeDamage += 0.12f; + this.rangedDamage += 0.12f; + this.minionDamage += 0.12f; + this.thrownDamage += 0.12f; + } + if (this.armor[index].type == 492) + this.wingTimeMax = 100; + if (this.armor[index].type == 493) + this.wingTimeMax = 100; + if (this.armor[index].type == 748) + this.wingTimeMax = 115; + if (this.armor[index].type == 749) + this.wingTimeMax = 130; + if (this.armor[index].type == 761) + this.wingTimeMax = 130; + if (this.armor[index].type == 785) + this.wingTimeMax = 140; + if (this.armor[index].type == 786) + this.wingTimeMax = 140; + if (this.armor[index].type == 821) + this.wingTimeMax = 160; + if (this.armor[index].type == 822) + this.wingTimeMax = 160; + if (this.armor[index].type == 823) + this.wingTimeMax = 160; + if (this.armor[index].type == 2280) + this.wingTimeMax = 160; + if (this.armor[index].type == 2494) + this.wingTimeMax = 100; + if (this.armor[index].type == 2609) + { + this.wingTimeMax = 180; + this.ignoreWater = true; + } + if (this.armor[index].type == 948) + this.wingTimeMax = 180; + if (this.armor[index].type == 1162) + this.wingTimeMax = 160; + if (this.armor[index].type == 1165) + this.wingTimeMax = 140; + if (this.armor[index].type == 1515) + this.wingTimeMax = 130; + if (this.armor[index].type == 665) + this.wingTimeMax = 150; + if (this.armor[index].type == 1583) + this.wingTimeMax = 150; + if (this.armor[index].type == 1584) + this.wingTimeMax = 150; + if (this.armor[index].type == 1585) + this.wingTimeMax = 150; + if (this.armor[index].type == 1586) + this.wingTimeMax = 150; + if (this.armor[index].type == 3228) + this.wingTimeMax = 150; + if (this.armor[index].type == 3580) + this.wingTimeMax = 150; + if (this.armor[index].type == 3582) + this.wingTimeMax = 150; + if (this.armor[index].type == 3588) + this.wingTimeMax = 150; + if (this.armor[index].type == 3592) + this.wingTimeMax = 150; + if (this.armor[index].type == 3924) + this.wingTimeMax = 150; + if (this.armor[index].type == 3928) + this.wingTimeMax = 150; + if (this.armor[index].type == 1797) + this.wingTimeMax = 180; + if (this.armor[index].type == 1830) + this.wingTimeMax = 180; + if (this.armor[index].type == 1866) + this.wingTimeMax = 170; + if (this.armor[index].type == 1871) + this.wingTimeMax = 170; + if (this.armor[index].type == 2770) + this.wingTimeMax = 160; + if (this.armor[index].type == 3468) + this.wingTimeMax = 180; + if (this.armor[index].type == 3469) + this.wingTimeMax = 160; + if (this.armor[index].type == 3470) + this.wingTimeMax = 160; + if (this.armor[index].type == 3471) + this.wingTimeMax = 180; + if (this.armor[index].type == 3883) + this.wingTimeMax = 150; + if (this.armor[index].type == 885) + this.buffImmune[30] = true; + if (this.armor[index].type == 886) + this.buffImmune[36] = true; + if (this.armor[index].type == 887) + this.buffImmune[20] = true; + if (this.armor[index].type == 888) + this.buffImmune[22] = true; + if (this.armor[index].type == 889) + this.buffImmune[32] = true; + if (this.armor[index].type == 890) + this.buffImmune[35] = true; + if (this.armor[index].type == 891) + this.buffImmune[23] = true; + if (this.armor[index].type == 892) + this.buffImmune[33] = true; + if (this.armor[index].type == 893) + this.buffImmune[31] = true; + if (this.armor[index].type == 3781) + this.buffImmune[156] = true; + if (this.armor[index].type == 901) + { + this.buffImmune[33] = true; + this.buffImmune[36] = true; + } + if (this.armor[index].type == 902) + { + this.buffImmune[30] = true; + this.buffImmune[20] = true; + } + if (this.armor[index].type == 903) + { + this.buffImmune[32] = true; + this.buffImmune[31] = true; + } + if (this.armor[index].type == 904) + { + this.buffImmune[35] = true; + this.buffImmune[23] = true; + } + if (this.armor[index].type == 1921) + { + this.buffImmune[46] = true; + this.buffImmune[47] = true; + } + if (this.armor[index].type == 1612) + { + this.buffImmune[33] = true; + this.buffImmune[36] = true; + this.buffImmune[30] = true; + this.buffImmune[20] = true; + this.buffImmune[32] = true; + this.buffImmune[31] = true; + this.buffImmune[35] = true; + this.buffImmune[23] = true; + this.buffImmune[22] = true; + } + if (this.armor[index].type == 1613) + { + this.buffImmune[46] = true; + this.noKnockback = true; + this.fireWalk = true; + this.buffImmune[33] = true; + this.buffImmune[36] = true; + this.buffImmune[30] = true; + this.buffImmune[20] = true; + this.buffImmune[32] = true; + this.buffImmune[31] = true; + this.buffImmune[35] = true; + this.buffImmune[23] = true; + this.buffImmune[22] = true; + } + if (this.armor[index].type == 497) + { + this.accMerman = true; + if (this.hideVisual[index]) + this.hideMerman = true; + } + if (this.armor[index].type == 535) + this.pStone = true; + if (this.armor[index].type == 536) + this.kbGlove = true; + if (this.armor[index].type == 532) + this.starCloak = true; + if (this.armor[index].type == 554) + this.longInvince = true; + if (this.armor[index].type == 555) + { + this.manaFlower = true; + this.manaCost -= 0.08f; + } + if (Main.myPlayer == this.whoAmI) + { + if (this.armor[index].type == 576 && Main.rand.Next(10800) == 0 && Main.curMusic > 0 && Main.curMusic <= 41) + { + int num = 0; + if (Main.curMusic == 1) + num = 0; + if (Main.curMusic == 2) + num = 1; + if (Main.curMusic == 3) + num = 2; + if (Main.curMusic == 4) + num = 4; + if (Main.curMusic == 5) + num = 5; + if (Main.curMusic == 6) + num = 3; + if (Main.curMusic == 7) + num = 6; + if (Main.curMusic == 8) + num = 7; + if (Main.curMusic == 9) + num = 9; + if (Main.curMusic == 10) + num = 8; + if (Main.curMusic == 11) + num = 11; + if (Main.curMusic == 12) + num = 10; + if (Main.curMusic == 13) + num = 12; + if (Main.curMusic == 28) + this.armor[index].SetDefaults(1963); + else if (Main.curMusic == 29) + this.armor[index].SetDefaults(1610); + else if (Main.curMusic == 30) + this.armor[index].SetDefaults(1963); + else if (Main.curMusic == 31) + this.armor[index].SetDefaults(1964); + else if (Main.curMusic == 32) + this.armor[index].SetDefaults(1965); + else if (Main.curMusic == 33) + this.armor[index].SetDefaults(2742); + else if (Main.curMusic == 34) + this.armor[index].SetDefaults(3370); + else if (Main.curMusic == 35) + this.armor[index].SetDefaults(3236); + else if (Main.curMusic == 36) + this.armor[index].SetDefaults(3237); + else if (Main.curMusic == 37) + this.armor[index].SetDefaults(3235); + else if (Main.curMusic == 38) + this.armor[index].SetDefaults(3044); + else if (Main.curMusic == 39) + this.armor[index].SetDefaults(3371); + else if (Main.curMusic == 40) + this.armor[index].SetDefaults(3796); + else if (Main.curMusic == 41) + this.armor[index].SetDefaults(3869); + else if (Main.curMusic > 13) + this.armor[index].SetDefaults(1596 + Main.curMusic - 14); + else + this.armor[index].SetDefaults(num + 562); + } + if (this.armor[index].type >= 562 && this.armor[index].type <= 574) + Main.musicBox2 = this.armor[index].type - 562; + if (this.armor[index].type >= 1596 && this.armor[index].type <= 1609) + Main.musicBox2 = this.armor[index].type - 1596 + 13; + if (this.armor[index].type == 1610) + Main.musicBox2 = 27; + if (this.armor[index].type == 1963) + Main.musicBox2 = 28; + if (this.armor[index].type == 1964) + Main.musicBox2 = 29; + if (this.armor[index].type == 1965) + Main.musicBox2 = 30; + if (this.armor[index].type == 2742) + Main.musicBox2 = 31; + if (this.armor[index].type == 3044) + Main.musicBox2 = 32; + if (this.armor[index].type == 3235) + Main.musicBox2 = 33; + if (this.armor[index].type == 3236) + Main.musicBox2 = 34; + if (this.armor[index].type == 3237) + Main.musicBox2 = 35; + if (this.armor[index].type == 3370) + Main.musicBox2 = 36; + if (this.armor[index].type == 3371) + Main.musicBox2 = 37; + if (this.armor[index].type == 3796) + Main.musicBox2 = 38; + if (this.armor[index].type == 3869) + Main.musicBox2 = 39; + } + } } if (this.dd2Accessory) { this.minionDamage += 0.1f; ++this.maxTurrets; } - for (int slot = 3; slot < 10; ++slot) + for (int index = 3; index < 8 + this.extraAccessorySlots; ++index) { - if (this.armor[slot].wingSlot > (sbyte) 0 && this.IsAValidEquipmentSlotForIteration(slot)) + if (this.armor[index].wingSlot > (sbyte) 0) { - if (!this.hideVisibleAccessory[slot] || (double) this.velocity.Y != 0.0 && !this.mount.Active) - this.wings = (int) this.armor[slot].wingSlot; - this.wingsLogic = (int) this.armor[slot].wingSlot; + if (!this.hideVisual[index] || (double) this.velocity.Y != 0.0 && !this.mount.Active) + this.wings = (int) this.armor[index].wingSlot; + this.wingsLogic = (int) this.armor[index].wingSlot; } } - for (int index = 13; index < 20; ++index) + for (int index = 13; index < 18 + this.extraAccessorySlots; ++index) { - if (this.IsAValidEquipmentSlotForIteration(index)) - this.ApplyEquipVanity(index, this.armor[index]); + int type = this.armor[index].type; + if (this.armor[index].wingSlot > (sbyte) 0) + this.wings = (int) this.armor[index].wingSlot; + if (type == 861 || type == 3110 || type == 485) + { + this.hideWolf = false; + this.forceWerewolf = true; + } + if (((!this.wet || this.lavaWet ? 0 : (!this.mount.Active ? 1 : (this.mount.Type != 3 ? 1 : 0))) != 0 || !this.forceWerewolf) && (type == 861 || type == 3110 || type == 497)) + { + this.hideMerman = false; + this.forceMerman = true; + } } - if (this.wet && this.ShouldFloatInWater) - this.accFlipper = true; - if (this.whoAmI == Main.myPlayer && Main.SceneMetrics.HasClock && this.accWatch < 3) + if (this.whoAmI == Main.myPlayer && Main.clock && this.accWatch < 3) ++this.accWatch; - if (this.equippedAnyTileSpeedAcc && this.inventory[this.selectedItem].createTile != 4) + if (flag2) this.tileSpeed += 0.5f; - if (this.equippedAnyWallSpeedAcc) + if (flag1) this.wallSpeed += 0.5f; - if (this.equippedAnyTileRangeAcc && this.whoAmI == Main.myPlayer) + if (flag3 && this.whoAmI == Main.myPlayer) { Player.tileRangeX += 3; Player.tileRangeY += 2; @@ -8195,1154 +7422,10 @@ namespace Terraria } } } - if (!this.accDreamCatcher && this.dpsStarted) - { - this.dpsStarted = false; - this.dpsEnd = DateTime.Now; - } - if (this.HeldItem.type != 4760 || this.ownedProjectileCounts[866] >= 1) + if (this.accDreamCatcher || !this.dpsStarted) return; - this.hasRaisableShield = true; - } - - private void DoBootsEffect(Utils.TileActionAttempt theEffectMethod) - { - if (this.miscCounter % 2 != 0 || (double) this.velocity.Y != 0.0 || this.grappling[0] != -1 || (double) this.velocity.X == 0.0) - return; - int x = (int) this.Center.X / 16; - int y = (int) ((double) this.position.Y + (double) this.height - 1.0) / 16; - int num = theEffectMethod(x, y) ? 1 : 0; - } - - private bool DoBootsEffect_PlaceFlamesOnTile(int X, int Y) - { - Tile tile = Main.tile[X, Y + 1]; - if (tile == null || !tile.active() || tile.liquid > (byte) 0 || !WorldGen.SolidTileAllowBottomSlope(X, Y + 1)) - return false; - ParticleOrchestrator.RequestParticleSpawn(true, ParticleOrchestraType.FlameWaders, new ParticleOrchestraSettings() - { - PositionInWorld = new Vector2((float) (X * 16 + 8), (float) (Y * 16 + 16)) - }, new int?(this.whoAmI)); - return true; - } - - private bool DoBootsEffect_PlaceFlowersOnTile(int X, int Y) - { - Tile tile = Main.tile[X, Y]; - if (tile == null || tile.active() || tile.liquid != (byte) 0 || Main.tile[X, Y + 1] == null || !WorldGen.SolidTile(X, Y + 1)) - return false; - tile.frameY = (short) 0; - tile.slope((byte) 0); - tile.halfBrick(false); - if (Main.tile[X, Y + 1].type == (ushort) 2 || Main.tile[X, Y + 1].type == (ushort) 477) - { - int num = Main.rand.NextFromList(6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 24, 27, 30, 33, 36, 39, 42); - switch (num) - { - case 21: - case 24: - case 27: - case 30: - case 33: - case 36: - case 39: - case 42: - num += Main.rand.Next(3); - break; - } - tile.active(true); - tile.type = (ushort) 3; - tile.frameX = (short) (num * 18); - tile.color(Main.tile[X, Y + 1].color()); - if (Main.netMode == 1) - NetMessage.SendTileSquare(-1, X, Y, 1); - return true; - } - if (Main.tile[X, Y + 1].type == (ushort) 109 || Main.tile[X, Y + 1].type == (ushort) 492) - { - if (Main.rand.Next(2) == 0) - { - tile.active(true); - tile.type = (ushort) 110; - tile.frameX = (short) (18 * Main.rand.Next(4, 7)); - tile.color(Main.tile[X, Y + 1].color()); - while (tile.frameX == (short) 90) - tile.frameX = (short) (18 * Main.rand.Next(4, 7)); - } - else - { - tile.active(true); - tile.type = (ushort) 113; - tile.frameX = (short) (18 * Main.rand.Next(2, 8)); - tile.color(Main.tile[X, Y + 1].color()); - while (tile.frameX == (short) 90) - tile.frameX = (short) (18 * Main.rand.Next(2, 8)); - } - if (Main.netMode == 1) - NetMessage.SendTileSquare(-1, X, Y, 1); - return true; - } - if (Main.tile[X, Y + 1].type != (ushort) 60) - return false; - tile.active(true); - tile.type = (ushort) 74; - tile.frameX = (short) (18 * Main.rand.Next(9, 17)); - tile.color(Main.tile[X, Y + 1].color()); - if (Main.netMode == 1) - NetMessage.SendTileSquare(-1, X, Y, 1); - return true; - } - - private void ApplyEquipVanity(int itemSlot, Item currentItem) - { - int type = currentItem.type; - if (currentItem.wingSlot > (sbyte) 0) - this.wings = (int) currentItem.wingSlot; - if (type == 861 || type == 3110 || type == 485) - { - this.hideWolf = false; - this.forceWerewolf = true; - } - if (((!this.wet || this.lavaWet ? 0 : (!this.mount.Active ? 1 : (!this.mount.IsConsideredASlimeMount ? 1 : 0))) != 0 || !this.forceWerewolf) && (type == 861 || type == 3110 || type == 497)) - { - this.hideMerman = false; - this.forceMerman = true; - } - if ((!this.mount.Active || this.mount.Type != 47) && (type == 4822 || type == 4874)) - this.DoBootsEffect(new Utils.TileActionAttempt(this.DoBootsEffect_PlaceFlamesOnTile)); - if (Main.myPlayer != this.whoAmI) - return; - this.ApplyMusicBox(currentItem); - } - - private WingStats GetWingStats(int wingID) => wingID <= 0 || wingID >= ArmorIDs.Wing.Sets.Stats.Length ? new WingStats() : ArmorIDs.Wing.Sets.Stats[wingID]; - - private void ApplyEquipFunctional(int itemSlot, Item currentItem) - { - if (currentItem.expertOnly && !Main.expertMode) - return; - if (currentItem.type == 3810 || currentItem.type == 3809 || currentItem.type == 3812 || currentItem.type == 3811) - this.dd2Accessory = true; - switch (currentItem.type) - { - case 3990: - this.accRunSpeed = 6f; - this.sailDash = true; - this.autoJump = true; - this.jumpSpeedBoost += 2.4f; - this.extraFall += 15; - break; - case 3991: - this.manaFlower = true; - this.manaCost -= 0.08f; - this.aggro -= 400; - break; - case 3992: - this.kbGlove = true; - this.meleeSpeed += 0.12f; - this.aggro += 400; - break; - case 3993: - this.accRunSpeed = 6f; - this.rocketBoots = 2; - break; - case 3994: - this.autoJump = true; - this.frogLegJumpBoost = true; - this.accFlipper = true; - break; - case 3995: - this.autoJump = true; - this.frogLegJumpBoost = true; - this.accFlipper = true; - this.spikedBoots += 2; - break; - case 3996: - this.autoJump = true; - this.frogLegJumpBoost = true; - this.spikedBoots += 2; - break; - case 3999: - this.fireWalk = true; - this.magmaStone = true; - break; - case 4000: - this.manaFlower = true; - this.manaCost -= 0.08f; - this.manaMagnet = true; - break; - case 4001: - this.manaFlower = true; - this.manaCost -= 0.08f; - this.starCloak = true; - this.starCloakIsManaCloak = true; - break; - case 4002: - this.magicQuiver = true; - this.arrowDamage += 0.1f; - this.hasMoltenQuiver = true; - break; - case 4003: - this.fireWalk = true; - this.lavaRose = true; - this.magmaStone = true; - break; - case 4004: - this.fireWalk = true; - this.lavaRose = true; - break; - case 4005: - this.rangedCrit += 10; - this.rangedDamage += 0.1f; - this.aggro -= 400; - break; - case 4006: - this.aggro -= 400; - this.magicQuiver = true; - this.arrowDamage += 0.1f; - break; - case 4007: - this.releaseBeesWhenHurt = true; - this.armorPenetration += 5; - break; - case 4038: - this.fireWalk = true; - break; - case 4055: - this.accRunSpeed = 6f; - this.desertDash = true; - break; - case 4056: - this.pickSpeed -= 0.25f; - break; - case 4341: - this.portableStoolInfo.SetStats(26, 26, 26); - break; - case 4409: - this.CanSeeInvisibleBlocks = true; - break; - case 5010: - this.treasureMagnet = true; - break; - } - if (currentItem.type == 3015) - { - this.aggro -= 400; - this.meleeCrit += 5; - this.magicCrit += 5; - this.rangedCrit += 5; - this.meleeDamage += 0.05f; - this.magicDamage += 0.05f; - this.rangedDamage += 0.05f; - this.minionDamage += 0.05f; - } - if (currentItem.type == 3016) - this.aggro += 400; - if (currentItem.type == 2373) - this.accFishingLine = true; - if (currentItem.type == 2374) - this.fishingSkill += 10; - if (currentItem.type == 2375) - this.accTackleBox = true; - if (currentItem.type == 4881) - this.accLavaFishing = true; - if (currentItem.type == 3721) - { - this.accFishingLine = true; - this.accTackleBox = true; - this.fishingSkill += 10; - } - if (currentItem.type == 3090) - { - this.npcTypeNoAggro[1] = true; - this.npcTypeNoAggro[16] = true; - this.npcTypeNoAggro[59] = true; - this.npcTypeNoAggro[71] = true; - this.npcTypeNoAggro[81] = true; - this.npcTypeNoAggro[138] = true; - this.npcTypeNoAggro[121] = true; - this.npcTypeNoAggro[122] = true; - this.npcTypeNoAggro[141] = true; - this.npcTypeNoAggro[147] = true; - this.npcTypeNoAggro[183] = true; - this.npcTypeNoAggro[184] = true; - this.npcTypeNoAggro[204] = true; - this.npcTypeNoAggro[225] = true; - this.npcTypeNoAggro[244] = true; - this.npcTypeNoAggro[302] = true; - this.npcTypeNoAggro[333] = true; - this.npcTypeNoAggro[335] = true; - this.npcTypeNoAggro[334] = true; - this.npcTypeNoAggro[336] = true; - this.npcTypeNoAggro[537] = true; - } - if (currentItem.stringColor > 0) - this.yoyoString = true; - if (currentItem.type == 3366) - { - this.counterWeight = 556 + Main.rand.Next(6); - this.yoyoGlove = true; - this.yoyoString = true; - } - if (currentItem.type >= 3309 && currentItem.type <= 3314) - this.counterWeight = 556 + currentItem.type - 3309; - if (currentItem.type == 3334) - this.yoyoGlove = true; - if (currentItem.type == 3337) - this.shinyStone = true; - if (currentItem.type == 4989) - { - this.empressBrooch = true; - this.moveSpeed += 0.1f; - } - if (currentItem.type == 3336) - { - this.SporeSac(); - this.sporeSac = true; - } - if (currentItem.type == 4987) - { - this.VolatileGelatin(); - this.volatileGelatin = true; - } - if (currentItem.type == 2423) - { - this.autoJump = true; - this.frogLegJumpBoost = true; - } - if (currentItem.type == 857) - this.hasJumpOption_Sandstorm = true; - if (currentItem.type == 983) - { - this.hasJumpOption_Sandstorm = true; - this.jumpBoost = true; - } - if (currentItem.type == 987) - this.hasJumpOption_Blizzard = true; - if (currentItem.type == 1163) - { - this.hasJumpOption_Blizzard = true; - this.jumpBoost = true; - } - if (currentItem.type == 1724) - this.hasJumpOption_Fart = true; - if (currentItem.type == 1863) - { - this.hasJumpOption_Fart = true; - this.jumpBoost = true; - } - if (currentItem.type == 1164) - { - this.hasJumpOption_Cloud = true; - this.hasJumpOption_Sandstorm = true; - this.hasJumpOption_Blizzard = true; - this.jumpBoost = true; - } - if (currentItem.type == 1250) - { - this.jumpBoost = true; - this.hasJumpOption_Cloud = true; - this.noFallDmg = true; - } - if (currentItem.type == 1252) - { - this.hasJumpOption_Sandstorm = true; - this.jumpBoost = true; - this.noFallDmg = true; - } - if (currentItem.type == 1251) - { - this.hasJumpOption_Blizzard = true; - this.jumpBoost = true; - this.noFallDmg = true; - } - if (currentItem.type == 3250) - { - this.hasJumpOption_Fart = true; - this.jumpBoost = true; - this.noFallDmg = true; - } - if (currentItem.type == 3252) - { - this.hasJumpOption_Sail = true; - this.jumpBoost = true; - this.noFallDmg = true; - } - if (currentItem.type == 3251) - { - this.jumpBoost = true; - this.releaseBeesWhenHurt = true; - this.noFallDmg = true; - } - if (currentItem.type == 1249) - { - this.jumpBoost = true; - this.releaseBeesWhenHurt = true; - } - if (currentItem.type == 3241) - { - this.jumpBoost = true; - this.hasJumpOption_Sail = true; - } - if ((currentItem.type == 1253 || currentItem.type == 3997) && (double) this.statLife <= (double) this.statLifeMax2 * 0.5) - this.AddBuff(62, 5); - if (currentItem.type == 1290) - this.panic = true; - if ((currentItem.type == 1300 || currentItem.type == 1858 || currentItem.type == 4005) && (this.inventory[this.selectedItem].useAmmo == AmmoID.Bullet || this.inventory[this.selectedItem].useAmmo == AmmoID.CandyCorn || this.inventory[this.selectedItem].useAmmo == AmmoID.Stake || this.inventory[this.selectedItem].useAmmo == 23)) - this.scope = true; - if (currentItem.type == 1858) - { - this.rangedCrit += 10; - this.rangedDamage += 0.1f; - } - if (currentItem.type == 1303 && this.wet) - Lighting.AddLight((int) this.Center.X / 16, (int) this.Center.Y / 16, 0.9f, 0.2f, 0.6f); - if (currentItem.type == 1301) - { - this.meleeCrit += 8; - this.rangedCrit += 8; - this.magicCrit += 8; - this.meleeDamage += 0.1f; - this.rangedDamage += 0.1f; - this.magicDamage += 0.1f; - this.minionDamage += 0.1f; - } - if (currentItem.type == 982) - { - this.statManaMax2 += 20; - ++this.manaRegenDelayBonus; - this.manaRegenBonus += 25; - } - if (currentItem.type == 1595) - { - this.statManaMax2 += 20; - this.magicCuffs = true; - } - if (currentItem.type == 2219) - this.manaMagnet = true; - if (currentItem.type == 2220) - { - this.manaMagnet = true; - this.magicDamage += 0.15f; - } - if (currentItem.type == 2221) - { - this.manaMagnet = true; - this.magicCuffs = true; - } - if (this.whoAmI == Main.myPlayer && currentItem.type == 1923) - { - ++Player.tileRangeX; - ++Player.tileRangeY; - } - if (currentItem.type == 1247) - { - this.starCloak = true; - this.releaseBeesWhenHurt = true; - this.starCloakIsBeeCloak = true; - } - if (currentItem.type == 1248) - { - this.meleeCrit += 10; - this.rangedCrit += 10; - this.magicCrit += 10; - } - if (currentItem.type == 854) - this.discount = true; - if (currentItem.type == 855) - this.coins = true; - if (currentItem.type == 3033) - this.goldRing = true; - if (currentItem.type == 3034) - { - this.goldRing = true; - this.coins = true; - } - if (currentItem.type == 3035) - { - this.goldRing = true; - this.coins = true; - this.discount = true; - } - if (currentItem.type == 53) - this.hasJumpOption_Cloud = true; - if (currentItem.type == 3201) - this.hasJumpOption_Sail = true; - if (currentItem.type == 54) - this.accRunSpeed = 6f; - if (currentItem.type == 3068) - this.cordage = true; - if (currentItem.type == 1579) - { - this.accRunSpeed = 6f; - this.coldDash = true; - } - if (currentItem.type == 3200) - { - this.accRunSpeed = 6f; - this.sailDash = true; - } - if (currentItem.type == 128) - this.rocketBoots = 1; - if (currentItem.type == 156) - this.noKnockback = true; - if (currentItem.type == 158) - this.noFallDmg = true; - if (currentItem.type == 934) - this.carpet = true; - if (currentItem.type == 953) - ++this.spikedBoots; - if (currentItem.type == 975) - ++this.spikedBoots; - if (currentItem.type == 976) - this.spikedBoots += 2; - if (currentItem.type == 977) - this.dashType = 1; - if (currentItem.type == 3097) - this.dashType = 2; - if (currentItem.type == 963) - this.blackBelt = true; - if (currentItem.type == 984) - { - this.blackBelt = true; - this.dashType = 1; - this.spikedBoots = 2; - } - if (currentItem.type == 1131) - this.gravControl2 = true; - if (currentItem.type == 1132) - this.releaseBeesWhenHurt = true; - if (currentItem.type == 1578) - { - this.releaseBeesWhenHurt = true; - this.panic = true; - } - if (currentItem.type == 3224) - this.endurance += 0.17f; - if (currentItem.type == 3223) - this.brainOfConfusion = true; - if (currentItem.type == 950) - this.iceSkate = true; - if (currentItem.type == 159) - this.jumpBoost = true; - if (currentItem.type == 3225) - this.jumpBoost = true; - if (currentItem.type == 187) - this.accFlipper = true; - if (currentItem.type == 211) - this.meleeSpeed += 0.12f; - if (currentItem.type == 223) - this.manaCost -= 0.06f; - if (currentItem.type == 285) - this.moveSpeed += 0.05f; - if (currentItem.type == 212) - this.moveSpeed += 0.1f; - if (currentItem.type == 267) - this.killGuide = true; - if (currentItem.type == 1307) - this.killClothier = true; - if (currentItem.type == 193) - this.fireWalk = true; - if (currentItem.type == 861) - { - this.accMerman = true; - this.wolfAcc = true; - if (this.hideVisibleAccessory[itemSlot]) - { - this.hideMerman = true; - this.hideWolf = true; - } - } - if (currentItem.type == 862) - { - this.starCloak = true; - this.longInvince = true; - this.starCloakIsStarVeil = true; - } - if (currentItem.type == 860) - this.pStone = true; - if (currentItem.type == 863) - this.waterWalk2 = true; - if (currentItem.type == 907) - { - this.waterWalk2 = true; - this.fireWalk = true; - } - if (currentItem.type == 908 || currentItem.type == 4874 || currentItem.type == 5000) - { - this.waterWalk = true; - this.fireWalk = true; - this.lavaMax += 420; - } - if ((!this.mount.Active || this.mount.Type != 47) && !this.hideVisibleAccessory[itemSlot] && (currentItem.type == 4822 || currentItem.type == 4874)) - this.DoBootsEffect(new Utils.TileActionAttempt(this.DoBootsEffect_PlaceFlamesOnTile)); - if (currentItem.type == 906 || currentItem.type == 4038) - this.lavaMax += 420; - if (currentItem.type == 485) - { - this.wolfAcc = true; - if (this.hideVisibleAccessory[itemSlot]) - this.hideWolf = true; - } - if (currentItem.type == 486) - this.rulerLine = true; - if (currentItem.type == 2799) - this.rulerGrid = true; - if (currentItem.type == 394) - { - this.accFlipper = true; - this.accDivingHelm = true; - } - if (currentItem.type == 396) - { - this.noFallDmg = true; - this.fireWalk = true; - } - if (currentItem.type == 397) - { - this.noKnockback = true; - this.fireWalk = true; - } - if (currentItem.type == 399) - { - this.jumpBoost = true; - this.hasJumpOption_Cloud = true; - } - if (currentItem.type == 405) - { - this.accRunSpeed = 6f; - this.rocketBoots = 2; - } - if (currentItem.type == 1860) - { - this.accFlipper = true; - this.accDivingHelm = true; - if (this.wet) - Lighting.AddLight((int) this.Center.X / 16, (int) this.Center.Y / 16, 0.9f, 0.2f, 0.6f); - } - if (currentItem.type == 1861) - { - this.arcticDivingGear = true; - this.accFlipper = true; - this.accDivingHelm = true; - this.iceSkate = true; - if (this.wet) - Lighting.AddLight((int) this.Center.X / 16, (int) this.Center.Y / 16, 0.2f, 0.8f, 0.9f); - } - if (currentItem.type == 2214) - this.equippedAnyTileSpeedAcc = true; - if (currentItem.type == 2215) - this.equippedAnyTileRangeAcc = true; - if (currentItem.type == 2216) - this.autoPaint = true; - if (currentItem.type == 2217) - this.equippedAnyWallSpeedAcc = true; - if (currentItem.type == 3061) - { - this.equippedAnyWallSpeedAcc = true; - this.equippedAnyTileSpeedAcc = true; - this.autoPaint = true; - this.equippedAnyTileRangeAcc = true; - } - if (currentItem.type == 3624) - this.autoActuator = true; - if (currentItem.type == 897) - { - this.kbGlove = true; - this.meleeSpeed += 0.12f; - } - if (currentItem.type == 1343) - { - this.kbGlove = true; - this.meleeSpeed += 0.1f; - this.meleeDamage += 0.1f; - this.magmaStone = true; - } - if (currentItem.type == 1167) - { - this.minionKB += 2f; - this.minionDamage += 0.15f; - } - if (currentItem.type == 1864) - { - this.minionKB += 2f; - this.minionDamage += 0.15f; - ++this.maxMinions; - } - if (currentItem.type == 1845) - { - this.minionDamage += 0.1f; - ++this.maxMinions; - } - if (currentItem.type == 1321) - { - this.magicQuiver = true; - this.arrowDamage += 0.1f; - } - if (currentItem.type == 1322) - this.magmaStone = true; - if (currentItem.type == 1323) - this.lavaRose = true; - if (currentItem.type == 3333) - this.strongBees = true; - if (currentItem.type == 938 || currentItem.type == 3997 || currentItem.type == 3998) - { - this.noKnockback = true; - if ((double) this.statLife > (double) this.statLifeMax2 * 0.25) - { - this.hasPaladinShield = true; - if (this.whoAmI != Main.myPlayer && this.miscCounter % 10 == 0) - { - int player = Main.myPlayer; - if (Main.player[player].team == this.team && this.team != 0) - { - double num1 = (double) this.position.X - (double) Main.player[player].position.X; - float num2 = this.position.Y - Main.player[player].position.Y; - if (Math.Sqrt(num1 * num1 + (double) num2 * (double) num2) < 800.0) - Main.player[player].AddBuff(43, 20); - } - } - } - } - if (currentItem.type == 936) - { - this.kbGlove = true; - this.meleeSpeed += 0.12f; - this.meleeDamage += 0.12f; - } - if (currentItem.type == 898) - { - this.accRunSpeed = 6.75f; - this.rocketBoots = 2; - this.moveSpeed += 0.08f; - } - if (currentItem.type == 1862) - { - this.accRunSpeed = 6.75f; - this.rocketBoots = 3; - this.moveSpeed += 0.08f; - this.iceSkate = true; - } - if (currentItem.type == 5000) - { - this.accRunSpeed = 6.75f; - this.rocketBoots = 4; - this.moveSpeed += 0.08f; - this.iceSkate = true; - } - if (currentItem.type == 3110) - { - this.accMerman = true; - this.wolfAcc = true; - if (this.hideVisibleAccessory[itemSlot]) - { - this.hideMerman = true; - this.hideWolf = true; - } - } - if (currentItem.type == 1865 || currentItem.type == 3110) - this.skyStoneEffects = true; - if (currentItem.type == 899 && Main.dayTime) - this.skyStoneEffects = true; - if (currentItem.type == 900 && (!Main.dayTime || Main.eclipse)) - this.skyStoneEffects = true; - if (currentItem.type == 407) - ++this.blockRange; - if (currentItem.type == 489) - this.magicDamage += 0.15f; - if (currentItem.type == 490) - this.meleeDamage += 0.15f; - if (currentItem.type == 491) - this.rangedDamage += 0.15f; - if (currentItem.type == 2998) - this.minionDamage += 0.15f; - if (currentItem.type == 935) - { - this.magicDamage += 0.12f; - this.meleeDamage += 0.12f; - this.rangedDamage += 0.12f; - this.minionDamage += 0.12f; - } - if (currentItem.wingSlot != (sbyte) -1) - this.wingTimeMax = this.GetWingStats((int) currentItem.wingSlot).FlyTime; - if (currentItem.wingSlot == (sbyte) 26) - this.ignoreWater = true; - if (currentItem.type == 885) - this.buffImmune[30] = true; - if (currentItem.type == 886) - this.buffImmune[36] = true; - if (currentItem.type == 887) - this.buffImmune[20] = true; - if (currentItem.type == 888) - this.buffImmune[22] = true; - if (currentItem.type == 889) - this.buffImmune[32] = true; - if (currentItem.type == 890) - this.buffImmune[35] = true; - if (currentItem.type == 891) - this.buffImmune[23] = true; - if (currentItem.type == 892) - this.buffImmune[33] = true; - if (currentItem.type == 893) - this.buffImmune[31] = true; - if (currentItem.type == 3781) - this.buffImmune[156] = true; - if (currentItem.type == 901) - { - this.buffImmune[33] = true; - this.buffImmune[36] = true; - } - if (currentItem.type == 902) - { - this.buffImmune[30] = true; - this.buffImmune[20] = true; - } - if (currentItem.type == 903) - { - this.buffImmune[32] = true; - this.buffImmune[31] = true; - } - if (currentItem.type == 904) - { - this.buffImmune[35] = true; - this.buffImmune[23] = true; - } - if (currentItem.type == 1921) - { - this.buffImmune[46] = true; - this.buffImmune[47] = true; - } - if (currentItem.type == 1612) - { - this.buffImmune[33] = true; - this.buffImmune[36] = true; - this.buffImmune[30] = true; - this.buffImmune[20] = true; - this.buffImmune[32] = true; - this.buffImmune[31] = true; - this.buffImmune[35] = true; - this.buffImmune[23] = true; - this.buffImmune[22] = true; - } - if (currentItem.type == 1613) - { - this.buffImmune[46] = true; - this.noKnockback = true; - this.fireWalk = true; - this.buffImmune[33] = true; - this.buffImmune[36] = true; - this.buffImmune[30] = true; - this.buffImmune[20] = true; - this.buffImmune[32] = true; - this.buffImmune[31] = true; - this.buffImmune[35] = true; - this.buffImmune[23] = true; - this.buffImmune[22] = true; - } - if (currentItem.type == 497) - { - this.accMerman = true; - if (this.hideVisibleAccessory[itemSlot]) - this.hideMerman = true; - } - if (currentItem.type == 535) - this.pStone = true; - if (currentItem.type == 536) - this.kbGlove = true; - if (currentItem.type == 532) - this.starCloak = true; - if (currentItem.type == 554) - this.longInvince = true; - if (currentItem.type == 555) - { - this.manaFlower = true; - this.manaCost -= 0.08f; - } - if (Main.myPlayer != this.whoAmI) - return; - if (currentItem.type == 576 && Main.rand.Next(540) == 0 && Main.curMusic > 0 && Main.curMusic <= 89) - { - SoundEngine.PlaySound(SoundID.Item166, this.Center); - int num = -1; - if (Main.curMusic == 1) - num = 0; - if (Main.curMusic == 2) - num = 1; - if (Main.curMusic == 3) - num = 2; - if (Main.curMusic == 4) - num = 4; - if (Main.curMusic == 5) - num = 5; - if (Main.curMusic == 6) - num = 3; - if (Main.curMusic == 7) - num = 6; - if (Main.curMusic == 8) - num = 7; - if (Main.curMusic == 9) - num = 9; - if (Main.curMusic == 10) - num = 8; - if (Main.curMusic == 11) - num = 11; - if (Main.curMusic == 12) - num = 10; - if (Main.curMusic == 13) - num = 12; - if (Main.curMusic == 28) - currentItem.SetDefaults(1963); - else if (Main.curMusic == 29) - currentItem.SetDefaults(1610); - else if (Main.curMusic == 30) - currentItem.SetDefaults(1963); - else if (Main.curMusic == 31) - currentItem.SetDefaults(1964); - else if (Main.curMusic == 32) - currentItem.SetDefaults(1965); - else if (Main.curMusic == 33) - currentItem.SetDefaults(2742); - else if (Main.curMusic == 34) - currentItem.SetDefaults(3370); - else if (Main.curMusic == 35) - currentItem.SetDefaults(3236); - else if (Main.curMusic == 36) - currentItem.SetDefaults(3237); - else if (Main.curMusic == 37) - currentItem.SetDefaults(3235); - else if (Main.curMusic == 38) - currentItem.SetDefaults(3044); - else if (Main.curMusic == 39) - currentItem.SetDefaults(3371); - else if (Main.curMusic == 40) - currentItem.SetDefaults(3796); - else if (Main.curMusic == 41) - currentItem.SetDefaults(3869); - else if (Main.curMusic == 42) - currentItem.SetDefaults(4079); - else if (Main.curMusic == 43) - currentItem.SetDefaults(4077); - else if (Main.curMusic == 44) - currentItem.SetDefaults(4082); - else if (Main.curMusic == 46) - currentItem.SetDefaults(4080); - else if (Main.curMusic == 47) - currentItem.SetDefaults(4081); - else if (Main.curMusic == 48) - currentItem.SetDefaults(4078); - else if (Main.curMusic == 49) - currentItem.SetDefaults(4237); - else if (Main.curMusic == 51) - currentItem.SetDefaults(4356); - else if (Main.curMusic == 52) - currentItem.SetDefaults(4357); - else if (Main.curMusic == 53) - currentItem.SetDefaults(4358); - else if (Main.curMusic == 54) - currentItem.SetDefaults(4421); - else if (Main.curMusic == 55) - currentItem.SetDefaults(4606); - else if (Main.curMusic == 56) - currentItem.SetDefaults(4979); - else if (Main.curMusic == 57) - currentItem.SetDefaults(4985); - else if (Main.curMusic == 58) - currentItem.SetDefaults(4990); - else if (Main.curMusic == 59) - currentItem.SetDefaults(4991); - else if (Main.curMusic == 60) - currentItem.SetDefaults(4992); - else if (Main.curMusic == 61) - currentItem.SetDefaults(5006); - else if (Main.curMusic == 62) - currentItem.SetDefaults(5014); - else if (Main.curMusic == 63) - currentItem.SetDefaults(5015); - else if (Main.curMusic == 64) - currentItem.SetDefaults(5016); - else if (Main.curMusic == 65) - currentItem.SetDefaults(5017); - else if (Main.curMusic == 66) - currentItem.SetDefaults(5018); - else if (Main.curMusic == 67) - currentItem.SetDefaults(5019); - else if (Main.curMusic == 68) - currentItem.SetDefaults(5020); - else if (Main.curMusic == 69) - currentItem.SetDefaults(5021); - else if (Main.curMusic == 70) - currentItem.SetDefaults(5022); - else if (Main.curMusic == 71) - currentItem.SetDefaults(5023); - else if (Main.curMusic == 72) - currentItem.SetDefaults(5024); - else if (Main.curMusic == 73) - currentItem.SetDefaults(5025); - else if (Main.curMusic == 74) - currentItem.SetDefaults(5026); - else if (Main.curMusic == 75) - currentItem.SetDefaults(5027); - else if (Main.curMusic == 76) - currentItem.SetDefaults(5028); - else if (Main.curMusic == 77) - currentItem.SetDefaults(5029); - else if (Main.curMusic == 78) - currentItem.SetDefaults(5030); - else if (Main.curMusic == 79) - currentItem.SetDefaults(5031); - else if (Main.curMusic == 80) - currentItem.SetDefaults(5032); - else if (Main.curMusic == 81) - currentItem.SetDefaults(5033); - else if (Main.curMusic == 82) - currentItem.SetDefaults(5034); - else if (Main.curMusic == 83) - currentItem.SetDefaults(5035); - else if (Main.curMusic == 84) - currentItem.SetDefaults(5036); - else if (Main.curMusic == 85) - currentItem.SetDefaults(5037); - else if (Main.curMusic == 86) - currentItem.SetDefaults(5038); - else if (Main.curMusic == 87) - currentItem.SetDefaults(5039); - else if (Main.curMusic == 88) - currentItem.SetDefaults(5040); - else if (Main.curMusic == 89) - currentItem.SetDefaults(5044); - else if (Main.curMusic > 13) - currentItem.SetDefaults(1596 + Main.curMusic - 14); - else if (num != -1) - currentItem.SetDefaults(num + 562); - } - this.ApplyMusicBox(currentItem); - } - - private void ApplyMusicBox(Item currentItem) - { - if (currentItem.type >= 562 && currentItem.type <= 574) - Main.musicBox2 = currentItem.type - 562; - if (currentItem.type >= 1596 && currentItem.type <= 1609) - Main.musicBox2 = currentItem.type - 1596 + 13; - if (currentItem.type == 1610) - Main.musicBox2 = 27; - if (currentItem.type == 1963) - Main.musicBox2 = 28; - if (currentItem.type == 1964) - Main.musicBox2 = 29; - if (currentItem.type == 1965) - Main.musicBox2 = 30; - if (currentItem.type == 2742) - Main.musicBox2 = 31; - if (currentItem.type == 3044) - Main.musicBox2 = 32; - if (currentItem.type == 3235) - Main.musicBox2 = 33; - if (currentItem.type == 3236) - Main.musicBox2 = 34; - if (currentItem.type == 3237) - Main.musicBox2 = 35; - if (currentItem.type == 3370) - Main.musicBox2 = 36; - if (currentItem.type == 3371) - Main.musicBox2 = 37; - if (currentItem.type == 3796) - Main.musicBox2 = 38; - if (currentItem.type == 3869) - Main.musicBox2 = 39; - if (currentItem.type == 4082) - Main.musicBox2 = 40; - if (currentItem.type == 4078) - Main.musicBox2 = 41; - if (currentItem.type == 4079) - Main.musicBox2 = 42; - if (currentItem.type == 4077) - Main.musicBox2 = 43; - if (currentItem.type == 4080) - Main.musicBox2 = 44; - if (currentItem.type == 4081) - Main.musicBox2 = 45; - if (currentItem.type == 4237) - Main.musicBox2 = 46; - if (currentItem.type == 4356) - Main.musicBox2 = 47; - if (currentItem.type == 4357) - Main.musicBox2 = 48; - if (currentItem.type == 4358) - Main.musicBox2 = 49; - if (currentItem.type == 4421) - Main.musicBox2 = 50; - if (currentItem.type == 4606) - Main.musicBox2 = 51; - if (currentItem.type == 4979) - Main.musicBox2 = 52; - if (currentItem.type == 4985) - Main.musicBox2 = 53; - if (currentItem.type == 4990) - Main.musicBox2 = 54; - if (currentItem.type == 4991) - Main.musicBox2 = 55; - if (currentItem.type == 4992) - Main.musicBox2 = 56; - if (currentItem.type == 5006) - Main.musicBox2 = 57; - if (currentItem.type == 5014) - Main.musicBox2 = 58; - if (currentItem.type == 5015) - Main.musicBox2 = 59; - if (currentItem.type == 5016) - Main.musicBox2 = 60; - if (currentItem.type == 5017) - Main.musicBox2 = 61; - if (currentItem.type == 5018) - Main.musicBox2 = 62; - if (currentItem.type == 5019) - Main.musicBox2 = 63; - if (currentItem.type == 5020) - Main.musicBox2 = 64; - if (currentItem.type == 5021) - Main.musicBox2 = 65; - if (currentItem.type == 5022) - Main.musicBox2 = 66; - if (currentItem.type == 5023) - Main.musicBox2 = 67; - if (currentItem.type == 5024) - Main.musicBox2 = 68; - if (currentItem.type == 5025) - Main.musicBox2 = 69; - if (currentItem.type == 5026) - Main.musicBox2 = 70; - if (currentItem.type == 5027) - Main.musicBox2 = 71; - if (currentItem.type == 5028) - Main.musicBox2 = 72; - if (currentItem.type == 5029) - Main.musicBox2 = 73; - if (currentItem.type == 5030) - Main.musicBox2 = 74; - if (currentItem.type == 5031) - Main.musicBox2 = 75; - if (currentItem.type == 5032) - Main.musicBox2 = 76; - if (currentItem.type == 5033) - Main.musicBox2 = 77; - if (currentItem.type == 5034) - Main.musicBox2 = 78; - if (currentItem.type == 5035) - Main.musicBox2 = 79; - if (currentItem.type == 5036) - Main.musicBox2 = 80; - if (currentItem.type == 5037) - Main.musicBox2 = 81; - if (currentItem.type == 5038) - Main.musicBox2 = 82; - if (currentItem.type == 5039) - Main.musicBox2 = 83; - if (currentItem.type == 5040) - Main.musicBox2 = 84; - if (currentItem.type != 5044) - return; - Main.musicBox2 = 85; + this.dpsStarted = false; + this.dpsEnd = DateTime.Now; } public void UpdateArmorSets(int i) @@ -9368,6 +7451,11 @@ namespace Terraria this.setBonus = Language.GetTextValue("ArmorSetBonus.MetalTier2"); this.statDefense += 3; } + if (this.head == 188 && this.body == 189 && this.legs == 129) + { + this.setBonus = Language.GetTextValue("ArmorSetBonus.Fossil"); + this.thrownCost50 = true; + } if (this.head == 50 && this.body == 31 && this.legs == 30) { this.setBonus = Language.GetTextValue("ArmorSetBonus.Platinum"); @@ -9379,22 +7467,12 @@ namespace Terraria this.meleeDamage += 0.1f; this.magicDamage += 0.1f; this.rangedDamage += 0.1f; - this.minionDamage += 0.1f; + this.thrownDamage += 0.1f; } if (this.head == 22 && this.body == 14 && this.legs == 14) { + this.thrownCost33 = true; this.setBonus = Language.GetTextValue("ArmorSetBonus.Ninja"); - this.moveSpeed += 0.2f; - } - if (this.head == 188 && this.body == 189 && this.legs == 129) - { - this.setBonus = Language.GetTextValue("ArmorSetBonus.Fossil"); - this.ammoCost80 = true; - } - if ((this.head == 75 || this.head == 7) && this.body == 7 && this.legs == 7) - { - this.setBonus = Language.GetTextValue("ArmorSetBonus.Bone"); - this.rangedCrit += 15; } if (this.head == 157 && this.body == 105 && this.legs == 98) { @@ -9516,12 +7594,12 @@ namespace Terraria this.beetlePos[index] -= this.velocity * 0.25f; } } - if (this.head == 14 && (this.body >= 58 && this.body <= 63 || this.body == 167 || this.body == 213)) + if (this.head == 14 && (this.body >= 58 && this.body <= 63 || this.body == 167)) { this.setBonus = Language.GetTextValue("ArmorSetBonus.Wizard"); this.magicCrit += 10; } - if (this.head == 159 && (this.body >= 58 && this.body <= 63 || this.body == 167 || this.body == 213)) + if (this.head == 159 && (this.body >= 58 && this.body <= 63 || this.body == 167)) { this.setBonus = Language.GetTextValue("ArmorSetBonus.MagicHat"); this.statManaMax2 += 60; @@ -9553,9 +7631,16 @@ namespace Terraria } if (this.head == 46 && this.body == 27 && this.legs == 26) { + this.frostArmor = true; this.setBonus = Language.GetTextValue("ArmorSetBonus.Frost"); this.frostBurn = true; } + if ((this.head == 75 || this.head == 7) && this.body == 7 && this.legs == 7) + { + this.boneArmor = true; + this.setBonus = Language.GetTextValue("ArmorSetBonus.Bone"); + this.ammoCost80 = true; + } if ((this.head == 76 || this.head == 8) && (this.body == 49 || this.body == 8) && (this.legs == 45 || this.legs == 8)) { this.setBonus = Language.GetTextValue("ArmorSetBonus.Jungle"); @@ -9571,18 +7656,7 @@ namespace Terraria this.setBonus = Language.GetTextValue("ArmorSetBonus.Mining"); this.pickSpeed -= 0.3f; } - if (this.head == 216 && this.body == 20 && this.legs == 19) - { - this.setBonus = Language.GetTextValue("ArmorSetBonus.Mining"); - this.pickSpeed -= 0.3f; - } - if (this.head == 78 && this.body == 51 && this.legs == 47) - { - this.setBonus = Language.GetTextValue("ArmorSetBonus.ChlorophyteMelee"); - this.AddBuff(60, 18000); - this.endurance += 0.05f; - } - else if ((this.head == 80 || this.head == 79) && this.body == 51 && this.legs == 47) + if ((this.head == 78 || this.head == 79 || this.head == 80) && this.body == 51 && this.legs == 47) { this.setBonus = Language.GetTextValue("ArmorSetBonus.Chlorophyte"); this.AddBuff(60, 18000); @@ -9598,7 +7672,6 @@ namespace Terraria if (this.head == 99 && this.body == 65 && this.legs == 54) { this.setBonus = Language.GetTextValue("ArmorSetBonus.Turtle"); - this.endurance += 0.15f; this.thorns = 1f; this.turtleThorns = true; } @@ -9667,53 +7740,29 @@ namespace Terraria this.setBonus = Language.GetTextValue("ArmorSetBonus.Orichalcum"); this.onHitPetal = true; } - if (this.body == 56 && this.legs == 51) + if (this.body == 56 && this.legs == 51 && (this.head == 89 || this.head == 90 || this.head == 91)) { - bool flag = false; - if (this.head == 91) - { - this.setBonus = Language.GetTextValue("ArmorSetBonus.Titanium"); - this.manaCost -= 0.19f; - flag = true; - } - else if (this.head == 89) - { - this.setBonus = Language.GetTextValue("ArmorSetBonus.Titanium"); - this.meleeSpeed += 0.18f; - this.moveSpeed += 0.18f; - flag = true; - } - else if (this.head == 90) - { - this.setBonus = Language.GetTextValue("ArmorSetBonus.Titanium"); - this.ammoCost75 = true; - flag = true; - } - if (flag) - this.onHitTitaniumStorm = true; - } - if ((this.body == 24 || this.body == 229) && (this.legs == 23 || this.legs == 212) && (this.head == 42 || this.head == 41 || this.head == 43 || this.head == 254 || this.head == 257 || this.head == 256 || this.head == (int) byte.MaxValue || this.head == 258)) - { - if (this.head == 254 || this.head == 258) - { - this.setBonus = Language.GetTextValue("ArmorSetBonus.HallowedSummoner"); - this.maxMinions += 2; - } - else - this.setBonus = Language.GetTextValue("ArmorSetBonus.Hallowed"); + this.setBonus = Language.GetTextValue("ArmorSetBonus.Titanium"); this.onHitDodge = true; } - if (this.head == 261 && this.body == 230 && this.legs == 213) + if (this.body == 24 && this.legs == 23) { - this.setBonus = Language.GetTextValue("ArmorSetBonus.CrystalNinja"); - this.moveSpeed += 0.15f; - this.rangedDamage += 0.1f; - this.meleeDamage += 0.1f; - this.magicDamage += 0.1f; - this.minionDamage += 0.1f; - this.rangedCrit += 10; - this.meleeCrit += 10; - this.magicCrit += 10; + if (this.head == 42) + { + this.setBonus = Language.GetTextValue("ArmorSetBonus.HallowCaster"); + this.manaCost -= 0.2f; + } + else if (this.head == 43) + { + this.setBonus = Language.GetTextValue("ArmorSetBonus.HallowMelee"); + this.meleeSpeed += 0.19f; + this.moveSpeed += 0.19f; + } + else if (this.head == 41) + { + this.setBonus = Language.GetTextValue("ArmorSetBonus.HallowRanged"); + this.ammoCost75 = true; + } } if (this.head == 82 && this.body == 53 && this.legs == 48) { @@ -9739,11 +7788,10 @@ namespace Terraria } if (this.head == 171 && this.body == 177 && this.legs == 112) { - this.endurance += 0.12f; this.setSolar = true; this.setBonus = Language.GetTextValue("ArmorSetBonus.Solar"); ++this.solarCounter; - int num = 180; + int num = 240; if (this.solarCounter >= num) { if (this.solarShields > 0 && this.solarShields < 3) @@ -9786,7 +7834,7 @@ namespace Terraria this.solarDashConsumedFlare = false; } if (this.solarShields > 0 | (this.solarDashing && this.dashDelay < 0)) - this.dashType = 3; + this.dash = 3; } else this.solarCounter = 0; @@ -9813,12 +7861,7 @@ namespace Terraria if (this.FindBuffIndex(187) == -1) this.AddBuff(187, 3600); if (this.ownedProjectileCounts[623] < 1) - { - int num = 10; - int Damage = 30; - int index = Projectile.NewProjectile(this.Center.X, this.Center.Y, 0.0f, -1f, 623, Damage, (float) num, Main.myPlayer); - Main.projectile[index].originalDamage = Damage; - } + Projectile.NewProjectile(this.Center.X, this.Center.Y, 0.0f, -1f, 623, 0, 0.0f, Main.myPlayer); } } else if (this.FindBuffIndex(187) != -1) @@ -9875,14 +7918,12 @@ namespace Terraria this.setHuntressT2 = true; ++this.maxTurrets; } - if (this.head == 213 && this.body == 207 && this.legs == 156) - { - this.setBonus = Language.GetTextValue("ArmorSetBonus.MonkTier3"); - this.setMonkT3 = true; - this.setMonkT2 = true; - ++this.maxTurrets; - } - this.ApplyArmorSoundAndDustChanges(); + if (this.head != 213 || this.body != 207 || this.legs != 156) + return; + this.setBonus = Language.GetTextValue("ArmorSetBonus.MonkTier3"); + this.setMonkT3 = true; + this.setMonkT2 = true; + ++this.maxTurrets; } public void UpdateSocialShadow() @@ -9956,115 +7997,46 @@ namespace Terraria dust.fadeIn = 0.4f; } } - else if (this.teleportStyle == 9) - { - Microsoft.Xna.Framework.Rectangle hitbox = this.Hitbox; - hitbox.Inflate(5, 5); - if ((double) Main.rand.Next(100) <= 100.0 * (double) this.teleportTime) - TeleportPylonsSystem.SpawnInWorldDust(this.lastTeleportPylonStyleUsed, hitbox); - } this.teleportTime -= 0.005f; } - private void UpdateGraveyard(bool now = false) - { - float lerpValue = Utils.GetLerpValue((float) SceneMetrics.GraveyardTileMin, (float) SceneMetrics.GraveyardTileMax, (float) Main.SceneMetrics.GraveyardTileCount, true); - if (now) - this.graveImmediateTime = 30; - if (this.graveImmediateTime > 0) - { - --this.graveImmediateTime; - Main.GraveyardVisualIntensity = lerpValue; - } - else if ((double) Main.GraveyardVisualIntensity < (double) lerpValue) - { - Main.GraveyardVisualIntensity += 0.02f; - if ((double) Main.GraveyardVisualIntensity <= (double) lerpValue) - return; - Main.GraveyardVisualIntensity = lerpValue; - } - else - { - if ((double) Main.GraveyardVisualIntensity <= (double) lerpValue) - return; - Main.GraveyardVisualIntensity -= 0.01f; - if ((double) Main.GraveyardVisualIntensity >= (double) lerpValue) - return; - Main.GraveyardVisualIntensity = lerpValue; - } - } - - public int GetPrimaryBiome() - { - if (this.ZoneDungeon) - return 8; - if (this.ZoneCorrupt) - return 9; - if (this.ZoneCrimson) - return 10; - if (this.ZoneGlowshroom) - return 7; - if (this.ZoneHallow) - return 6; - if (this.ZoneJungle) - return 4; - if (this.ZoneSnow) - return 2; - if (this.ZoneBeach) - return 5; - if (this.ZoneDesert) - return 3; - return (double) this.position.Y > Main.worldSurface * 16.0 ? 1 : 0; - } - public void UpdateBiomes() { Point tileCoordinates1 = this.Center.ToTileCoordinates(); this.ZoneDungeon = false; - if (Main.SceneMetrics.DungeonTileCount >= 250 && (double) this.Center.Y > Main.worldSurface * 16.0) + if (Main.dungeonTiles >= 250 && (double) this.Center.Y > Main.worldSurface * 16.0) { int index1 = (int) this.Center.X / 16; int index2 = (int) this.Center.Y / 16; - if (Main.tile[index1, index2] != null && Main.wallDungeon[(int) Main.tile[index1, index2].wall]) + if (Main.wallDungeon[(int) Main.tile[index1, index2].wall]) this.ZoneDungeon = true; } Tile tileSafely = Framing.GetTileSafely(this.Center); if (tileSafely != null) - this.behindBackWall = tileSafely.wall > (ushort) 0; - if (this.behindBackWall && this.ZoneDesert && (double) this.Center.Y > Main.worldSurface) + this.behindBackWall = tileSafely.wall > (byte) 0; + if (Main.sandTiles > 1000 && (double) this.Center.Y > 3200.0) { if (WallID.Sets.Conversion.Sandstone[(int) tileSafely.wall] || WallID.Sets.Conversion.HardenedSand[(int) tileSafely.wall]) this.ZoneUndergroundDesert = true; } else this.ZoneUndergroundDesert = false; - this.ZoneGranite = this.behindBackWall && (tileSafely.wall == (ushort) 184 || tileSafely.wall == (ushort) 180); - this.ZoneMarble = this.behindBackWall && (tileSafely.wall == (ushort) 183 || tileSafely.wall == (ushort) 178); - this.ZoneHive = this.behindBackWall && (tileSafely.wall == (ushort) 108 || tileSafely.wall == (ushort) 86); - this.ZoneGemCave = this.behindBackWall && tileSafely.wall >= (ushort) 48 && tileSafely.wall <= (ushort) 53; - this.ZoneCorrupt = Main.SceneMetrics.EnoughTilesForCorruption; - this.ZoneCrimson = Main.SceneMetrics.EnoughTilesForCrimson; - this.ZoneHallow = Main.SceneMetrics.EnoughTilesForHallow; - this.ZoneJungle = Main.SceneMetrics.EnoughTilesForJungle && (double) this.position.Y / 16.0 < (double) Main.UnderworldLayer; - this.ZoneSnow = Main.SceneMetrics.EnoughTilesForSnow; - this.ZoneDesert = Main.SceneMetrics.EnoughTilesForDesert; - this.ZoneGlowshroom = Main.SceneMetrics.EnoughTilesForGlowingMushroom; - this.ZoneMeteor = Main.SceneMetrics.EnoughTilesForMeteor; - this.ZoneWaterCandle = Main.SceneMetrics.WaterCandleCount > 0; - this.ZonePeaceCandle = Main.SceneMetrics.PeaceCandleCount > 0; - this.ZoneGraveyard = Main.SceneMetrics.EnoughTilesForGraveyard; - this.UpdateGraveyard(); - if (this.HasGardenGnomeNearby != Main.SceneMetrics.HasGardenGnome) - { - this.luckNeedsSync = true; - this.HasGardenGnomeNearby = Main.SceneMetrics.HasGardenGnome; - } - this.ZoneUnderworldHeight = tileCoordinates1.Y > Main.UnderworldLayer; - this.ZoneRockLayerHeight = tileCoordinates1.Y <= Main.UnderworldLayer && (double) tileCoordinates1.Y > Main.rockLayer; + this.ZoneCorrupt = Main.evilTiles >= 200; + this.ZoneHoly = Main.holyTiles >= 100; + this.ZoneMeteor = Main.meteorTiles >= 50; + this.ZoneJungle = Main.jungleTiles >= 80; + this.ZoneSnow = Main.snowTiles >= 300; + this.ZoneCrimson = Main.bloodTiles >= 200; + this.ZoneWaterCandle = Main.waterCandles > 0; + this.ZonePeaceCandle = Main.peaceCandles > 0; + this.ZoneDesert = Main.sandTiles > 1000; + this.ZoneGlowshroom = Main.shroomTiles > 100; + this.ZoneUnderworldHeight = tileCoordinates1.Y > Main.maxTilesY - 200; + this.ZoneRockLayerHeight = tileCoordinates1.Y <= Main.maxTilesY - 200 && (double) tileCoordinates1.Y > Main.rockLayer; this.ZoneDirtLayerHeight = (double) tileCoordinates1.Y <= Main.rockLayer && (double) tileCoordinates1.Y > Main.worldSurface; this.ZoneOverworldHeight = (double) tileCoordinates1.Y <= Main.worldSurface && (double) tileCoordinates1.Y > Main.worldSurface * 0.349999994039536; this.ZoneSkyHeight = (double) tileCoordinates1.Y <= Main.worldSurface * 0.349999994039536; - this.ZoneBeach = WorldGen.oceanDepths(tileCoordinates1.X, tileCoordinates1.Y); + this.ZoneBeach = this.ZoneOverworldHeight && (tileCoordinates1.X < 380 || tileCoordinates1.X > Main.maxTilesX - 380); this.ZoneRain = Main.raining && (double) tileCoordinates1.Y <= Main.worldSurface; this.ZoneSandstorm = (double) tileCoordinates1.Y <= Main.worldSurface && this.ZoneDesert && !this.ZoneBeach && Sandstorm.Happening; this.ZoneTowerSolar = this.ZoneTowerVortex = this.ZoneTowerNebula = this.ZoneTowerStardust = false; @@ -10125,25 +8097,9 @@ namespace Terraria this.ManageSpecialBiomeVisuals("Vortex", this.ZoneTowerVortex, vector2_2 - new Vector2(0.0f, 10f)); this.ManageSpecialBiomeVisuals("Solar", this.ZoneTowerSolar, vector2_1 - new Vector2(0.0f, 10f)); this.ManageSpecialBiomeVisuals("MoonLord", NPC.AnyNPCs(398)); - this.ManageSpecialBiomeVisuals("BloodMoon", Main.bloodMoon || Main.SceneMetrics.BloodMoonMonolith); + this.ManageSpecialBiomeVisuals("BloodMoon", Main.bloodMoon); this.ManageSpecialBiomeVisuals("Blizzard", Main.UseStormEffects & flag1); this.ManageSpecialBiomeVisuals("HeatDistortion", Main.UseHeatDistortion && (flag2 || (double) tileCoordinates1.Y < Main.worldSurface && this.ZoneDesert && !flag3 && !Main.raining && !Filters.Scene["Sandstorm"].IsActive())); - if ((double) Main.GraveyardVisualIntensity > 0.0) - { - if (!Filters.Scene["Graveyard"].IsActive()) - { - Filters.Scene.Activate("Graveyard", new Vector2()); - } - else - { - Filters.Scene["Graveyard"].GetShader().UseTargetPosition(this.Center); - float progress = MathHelper.Lerp(0.0f, 0.75f, Main.GraveyardVisualIntensity); - Filters.Scene["Graveyard"].GetShader().UseProgress(progress); - Filters.Scene["Graveyard"].GetShader().UseIntensity(1.2f); - } - } - else if (Filters.Scene["Graveyard"].IsActive()) - Filters.Scene.Deactivate("Graveyard"); if (!Filters.Scene["WaterDistortion"].IsActive() && Main.WaveQuality > 0) Filters.Scene.Activate("WaterDistortion", new Vector2()); else if (Filters.Scene["WaterDistortion"].IsActive() && Main.WaveQuality == 0) @@ -10151,7 +8107,7 @@ namespace Terraria if (Filters.Scene["WaterDistortion"].IsActive()) { double num1 = (double) Main.maxTilesX * 0.5 - (double) Math.Abs((float) tileCoordinates1.X - (float) Main.maxTilesX * 0.5f); - float num2 = 1f + Math.Abs(Main.windSpeedCurrent) * 1.25f + MathHelper.Clamp(Main.maxRaining, 0.0f, 1f) * 1.25f + (float) -((double) MathHelper.Clamp((float) ((num1 - 380.0) / 100.0), 0.0f, 1f) * 0.5 - 0.25); + float num2 = 1f + Math.Abs(Main.windSpeed) * 1f + MathHelper.Clamp(Main.maxRaining, 0.0f, 1f) * 1.5f + (float) -((double) MathHelper.Clamp((float) ((num1 - 380.0) / 100.0), 0.0f, 1f) * 0.5 - 0.25); float num3 = 1f - MathHelper.Clamp((float) (3.0 * ((double) ((float) tileCoordinates1.Y - (float) Main.worldSurface) / (Main.rockLayer - Main.worldSurface))), 0.0f, 1f); float intensity = MathHelper.Clamp(num2 * num3 + (float) (0.899999976158142 - (double) MathHelper.Clamp((float) (Main.maxTilesY - tileCoordinates1.Y - 200) / 300f, 0.0f, 1f) * 0.899999976158142) + (float) ((1.0 - (double) num3) * 0.75), 0.0f, 2.5f); Filters.Scene["WaterDistortion"].GetShader().UseIntensity(intensity); @@ -10180,83 +8136,60 @@ namespace Terraria else Filters.Scene["HeatDistortion"].IsHidden = false; } - if (!Player.disabledBlizzardGraphic) + if (flag1) { - try - { - if (flag1) - { - float opacity = Math.Min(1f, Main.cloudAlpha * 2f) * this._stormShaderObstruction; - Filters.Scene["Blizzard"].GetShader().UseIntensity((float) ((double) this._stormShaderObstruction * 0.400000005960464 * (double) Math.Min(1f, Main.cloudAlpha * 2f) * 0.899999976158142 + 0.100000001490116)); - Filters.Scene["Blizzard"].GetShader().UseOpacity(opacity); - ((SimpleOverlay) Overlays.Scene["Blizzard"]).GetShader().UseOpacity(1f - opacity); - } - } - catch - { - Player.disabledBlizzardGraphic = true; - } + ActiveSound activeSound1 = Main.GetActiveSound(Player._strongBlizzardSound); + ActiveSound activeSound2 = Main.GetActiveSound(Player._insideBlizzardSound); + if (activeSound1 == null) + Player._strongBlizzardSound = Main.PlayTrackedSound((SoundStyle) SoundID.BlizzardStrongLoop); + if (activeSound2 == null) + Player._insideBlizzardSound = Main.PlayTrackedSound((SoundStyle) SoundID.BlizzardInsideBuildingLoop); + Main.GetActiveSound(Player._strongBlizzardSound); + Main.GetActiveSound(Player._insideBlizzardSound); + float opacity = Math.Min(1f, Main.cloudAlpha * 2f) * this._stormShaderObstruction; + Filters.Scene["Blizzard"].GetShader().UseIntensity((float) ((double) this._stormShaderObstruction * 0.400000005960464 * (double) Math.Min(1f, Main.cloudAlpha * 2f) * 0.899999976158142 + 0.100000001490116)); + Filters.Scene["Blizzard"].GetShader().UseOpacity(opacity); + ((SimpleOverlay) Overlays.Scene["Blizzard"]).GetShader().UseOpacity(1f - opacity); } - if (!Player.disabledBlizzardSound) + Player._blizzardSoundVolume = !flag1 ? Math.Max(Player._blizzardSoundVolume - 0.01f, 0.0f) : Math.Min(Player._blizzardSoundVolume + 0.01f, 1f); + float num4 = Math.Min(1f, Main.cloudAlpha * 2f) * this._stormShaderObstruction; + ActiveSound activeSound3 = Main.GetActiveSound(Player._strongBlizzardSound); + ActiveSound activeSound4 = Main.GetActiveSound(Player._insideBlizzardSound); + if ((double) Player._blizzardSoundVolume > 0.0) { - try + if (activeSound3 == null) { - if (flag1) - { - ActiveSound activeSound1 = SoundEngine.GetActiveSound(Player._strongBlizzardSound); - ActiveSound activeSound2 = SoundEngine.GetActiveSound(Player._insideBlizzardSound); - if (activeSound1 == null) - Player._strongBlizzardSound = SoundEngine.PlayTrackedSound((SoundStyle) SoundID.BlizzardStrongLoop); - if (activeSound2 == null) - Player._insideBlizzardSound = SoundEngine.PlayTrackedSound((SoundStyle) SoundID.BlizzardInsideBuildingLoop); - SoundEngine.GetActiveSound(Player._strongBlizzardSound); - SoundEngine.GetActiveSound(Player._insideBlizzardSound); - } - Player._blizzardSoundVolume = !flag1 ? Math.Max(Player._blizzardSoundVolume - 0.01f, 0.0f) : Math.Min(Player._blizzardSoundVolume + 0.01f, 1f); - float num = Math.Min(1f, Main.cloudAlpha * 2f) * this._stormShaderObstruction; - ActiveSound activeSound3 = SoundEngine.GetActiveSound(Player._strongBlizzardSound); - ActiveSound activeSound4 = SoundEngine.GetActiveSound(Player._insideBlizzardSound); - if ((double) Player._blizzardSoundVolume > 0.0) - { - if (activeSound3 == null) - { - Player._strongBlizzardSound = SoundEngine.PlayTrackedSound((SoundStyle) SoundID.BlizzardStrongLoop); - activeSound3 = SoundEngine.GetActiveSound(Player._strongBlizzardSound); - } - activeSound3.Volume = num * Player._blizzardSoundVolume; - if (activeSound4 == null) - { - Player._insideBlizzardSound = SoundEngine.PlayTrackedSound((SoundStyle) SoundID.BlizzardInsideBuildingLoop); - activeSound4 = SoundEngine.GetActiveSound(Player._insideBlizzardSound); - } - activeSound4.Volume = (1f - num) * Player._blizzardSoundVolume; - } - else - { - if (activeSound3 != null) - activeSound3.Volume = 0.0f; - else - Player._strongBlizzardSound = (SlotId) SlotId.Invalid; - if (activeSound4 != null) - activeSound4.Volume = 0.0f; - else - Player._insideBlizzardSound = (SlotId) SlotId.Invalid; - } + Player._strongBlizzardSound = Main.PlayTrackedSound((SoundStyle) SoundID.BlizzardStrongLoop); + activeSound3 = Main.GetActiveSound(Player._strongBlizzardSound); } - catch + activeSound3.Volume = num4 * Player._blizzardSoundVolume; + if (activeSound4 == null) { - Player.disabledBlizzardSound = true; + Player._insideBlizzardSound = Main.PlayTrackedSound((SoundStyle) SoundID.BlizzardInsideBuildingLoop); + activeSound4 = Main.GetActiveSound(Player._insideBlizzardSound); } + activeSound4.Volume = (1f - num4) * Player._blizzardSoundVolume; + } + else + { + if (activeSound3 != null) + activeSound3.Volume = 0.0f; + else + Player._strongBlizzardSound = (SlotId) SlotId.Invalid; + if (activeSound4 != null) + activeSound4.Volume = 0.0f; + else + Player._insideBlizzardSound = (SlotId) SlotId.Invalid; } if (!this.dead) { Point tileCoordinates2 = this.Center.ToTileCoordinates(); if (WorldGen.InWorld(tileCoordinates2.X, tileCoordinates2.Y, 1)) { - int num = 0; + int num5 = 0; if (Main.tile[tileCoordinates2.X, tileCoordinates2.Y] != null) - num = (int) Main.tile[tileCoordinates2.X, tileCoordinates2.Y].wall; - switch (num) + num5 = (int) Main.tile[tileCoordinates2.X, tileCoordinates2.Y].wall; + switch (num5) { case 62: AchievementsHelper.HandleSpecialEvent(this, 13); @@ -10266,21 +8199,21 @@ namespace Terraria break; } } - if (this._funkytownAchievementCheckCooldown > 0) - --this._funkytownAchievementCheckCooldown; - if ((double) this.position.Y / 16.0 > (double) Main.UnderworldLayer) + if (this._funkytownCheckCD > 0) + --this._funkytownCheckCD; + if ((double) this.position.Y / 16.0 > (double) (Main.maxTilesY - 200)) { AchievementsHelper.HandleSpecialEvent(this, 14); } else { - if (this._funkytownAchievementCheckCooldown != 0 || (double) this.position.Y / 16.0 >= Main.worldSurface || !this.ZoneGlowshroom) + if (this._funkytownCheckCD != 0 || (double) this.position.Y / 16.0 >= Main.worldSurface || Main.shroomTiles < 200) return; AchievementsHelper.HandleSpecialEvent(this, 15); } } else - this._funkytownAchievementCheckCooldown = 100; + this._funkytownCheckCD = 100; } public void ManageSpecialBiomeVisuals(string biomeName, bool inZone, Vector2 activationSource = default (Vector2)) @@ -10309,131 +8242,15 @@ namespace Terraria Overlays.Scene[biomeName].Deactivate(); } - public void GetHairSettings( - out bool fullHair, - out bool hatHair, - out bool hideHair, - out bool backHairDraw, - out bool drawsBackHairWithoutHeadgear) - { - fullHair = hatHair = hideHair = drawsBackHairWithoutHeadgear = false; - switch (this.head) - { - case 0: - case 23: - case 259: - drawsBackHairWithoutHeadgear = true; - break; - case 10: - case 12: - case 28: - case 42: - case 62: - case 97: - case 106: - case 113: - case 116: - case 119: - case 133: - case 138: - case 139: - case 163: - case 178: - case 181: - case 191: - case 198: - case 217: - case 218: - case 220: - case 222: - case 224: - case 225: - case 228: - case 229: - case 230: - case 232: - case 235: - case 238: - case 242: - case 243: - case 244: - case 245: - fullHair = true; - break; - case 13: - case 14: - case 15: - case 16: - case 18: - case 21: - case 24: - case 25: - case 26: - case 29: - case 40: - case 44: - case 51: - case 56: - case 59: - case 60: - case 63: - case 64: - case 65: - case 67: - case 68: - case 69: - case 81: - case 92: - case 94: - case 95: - case 100: - case 114: - case 121: - case 126: - case 130: - case 136: - case 140: - case 143: - case 145: - case 158: - case 159: - case 161: - case 182: - case 184: - case 190: - case 195: - case 215: - case 219: - case 223: - case 226: - case 227: - case 231: - case 233: - case 234: - case 262: - case 263: - case 264: - case 265: - hatHair = true; - break; - } - if (this.face > (sbyte) -1 && ArmorIDs.Face.Sets.PreventHairDraw[(int) this.face]) - hideHair = true; - int hair = this.hair; - backHairDraw = hair > 50 && (hair < 56 || hair > 63) && (hair < 74 || hair > 77) && (hair < 88 || hair > 89) && hair != 94 && hair != 100 && hair != 104 && hair != 112 && hair < 116; - if (hair != 133) - return; - backHairDraw = true; - } - public void UpdateDead() { this._portalPhysicsTime = 0; this.MountFishronSpecialCounter = 0.0f; this.gem = -1; this.ownedLargeGems = (BitsByte) (byte) 0; - this.brainOfConfusionDodgeAnimationCounter = 0; - this.ResetFloorFlags(); + this.slippy = false; + this.slippy2 = false; + this.powerrun = false; this.wings = 0; this.wingsLogic = 0; this.face = this.neck = this.back = this.front = this.handoff = this.handon = this.shoe = this.waist = this.balloon = this.shield = (sbyte) 0; @@ -10442,7 +8259,6 @@ namespace Terraria this.onFire = false; this.dripping = false; this.drippingSlime = false; - this.drippingSparkleSlime = false; this.burned = false; this.suffocating = false; this.onFire2 = false; @@ -10469,8 +8285,6 @@ namespace Terraria this.trapDebuffSource = false; this.yoraiz0rEye = 0; this.yoraiz0rDarkness = false; - this.hasFloatingTube = false; - this.hasUnicornHorn = false; this.leinforsHair = false; this.gravDir = 1f; for (int index = 0; index < 22; ++index) @@ -10485,19 +8299,17 @@ namespace Terraria { Main.npcChatText = ""; Main.editSign = false; - Main.npcChatCornerItem = 0; } - this.numMinions = 0; this.grappling[0] = -1; this.grappling[1] = -1; this.grappling[2] = -1; this.sign = -1; - this.SetTalkNPC(-1); + this.talkNPC = -1; + Main.npcChatCornerItem = 0; this.statLife = 0; this.channel = false; this.potionDelay = 0; this.chest = -1; - this.tileEntityAnchor.Clear(); this.changeItem = -1; this.itemAnimation = 0; this.immuneAlpha += 2; @@ -10520,35 +8332,25 @@ namespace Terraria if (this.difficulty == (byte) 2) { if (this.respawnTimer > 0) - this.respawnTimer = Utils.Clamp(this.respawnTimer - 1, 0, 1800); - else if (this.whoAmI == Main.myPlayer || Main.netMode == 2) - this.ghost = true; - } - else - { - this.respawnTimer = Utils.Clamp(this.respawnTimer - 1, 0, 1800); - if (this.respawnTimer <= 0 && Main.myPlayer == this.whoAmI) { - if (Main.mouseItem.type > 0) - Main.playerInventory = true; - this.Spawn(PlayerSpawnContext.ReviveFromDeath); + --this.respawnTimer; + } + else + { + if (this.whoAmI != Main.myPlayer && Main.netMode != 2) + return; + this.ghost = true; } } - if (this.whoAmI != Main.myPlayer || Main.drawingPlayerChat || Main.editSign || Main.editChest || Main.blockInput) - return; - PlayerInput.Triggers.Current.CopyInto(this); - if (this.controlInv) - { - if (!this.releaseInventory) - return; - this.releaseInventory = false; - if (Main.ingameOptionsWindow) - IngameOptions.Close(); - else - IngameOptions.Open(); - } else - this.releaseInventory = true; + { + --this.respawnTimer; + if (this.respawnTimer > 0 || Main.myPlayer != this.whoAmI) + return; + if (Main.mouseItem.type > 0) + Main.playerInventory = true; + this.Spawn(); + } } public void UpdatePet(int i) @@ -10556,10 +8358,10 @@ namespace Terraria if (i != Main.myPlayer || this.miscEquips[0].buffType < 1 || this.miscEquips[0].stack < 1) return; int buffType = this.miscEquips[0].buffType; - if (!Main.vanityPet[buffType] && !Main.lightPet[buffType] || this.hideMisc[0] || this.miscEquips[0].type == 603 && !Main.runningCollectorsEdition || this.FindBuffIndex(buffType) != -1) + if (!Main.vanityPet[buffType] && !Main.lightPet[buffType] || this.hideMisc[0] || this.miscEquips[0].type == 603 && !Main.cEd || this.FindBuffIndex(buffType) != -1) return; this.AddBuff(buffType, 3600); - SoundEngine.PlaySound(this.miscEquips[0].UseSound, this.position); + Main.PlaySound(this.miscEquips[0].UseSound, this.position); } public void UpdatePetLight(int i) @@ -10567,7 +8369,7 @@ namespace Terraria if (i != Main.myPlayer || this.miscEquips[1].buffType < 1 || this.miscEquips[1].stack < 1) return; int type = this.miscEquips[1].buffType; - if (!Main.vanityPet[type] && !Main.lightPet[type] || this.hideMisc[1] || this.miscEquips[1].type == 603 && !Main.runningCollectorsEdition) + if (!Main.vanityPet[type] && !Main.lightPet[type] || this.hideMisc[1] || this.miscEquips[1].type == 603 && !Main.cEd) return; int buffIndex = this.FindBuffIndex(type); if (type == 27 && buffIndex == -1) @@ -10579,7 +8381,7 @@ namespace Terraria if (type == 27) type = Utils.SelectRandom(Main.rand, 27, 102, 101); this.AddBuff(type, 3600); - SoundEngine.PlaySound(this.miscEquips[1].UseSound, this.position); + Main.PlaySound(this.miscEquips[1].UseSound, this.position); } public void TogglePet() @@ -10602,91 +8404,2579 @@ namespace Terraria this.ClearBuff(101); } - public bool IsWithinSnappngRangeToTile(int x, int y, int distanceInPixels) => (double) (new Vector2((float) (x * 16 + 8), (float) (y * 16 + 8)) - new Vector2(this.Center.X, this.Bottom.Y - 16f)).Length() <= (double) distanceInPixels; + public void SmartCursorLookup() + { + if (this.whoAmI != Main.myPlayer) + return; + Main.SmartCursorShowing = false; + if (!Main.SmartCursorEnabled) + return; + Item obj = this.inventory[this.selectedItem]; + Vector2 mouse = Main.screenPosition + new Vector2((float) Main.mouseX, (float) Main.mouseY); + if ((double) this.gravDir == -1.0) + mouse.Y = Main.screenPosition.Y + (float) Main.screenHeight - (float) Main.mouseY; + int index1 = Player.tileTargetX; + int index2 = Player.tileTargetY; + if (index1 < 10) + index1 = 10; + if (index1 > Main.maxTilesX - 10) + index1 = Main.maxTilesX - 10; + if (index2 < 10) + index2 = 10; + if (index2 > Main.maxTilesY - 10) + index2 = Main.maxTilesY - 10; + bool flag1 = false; + if (Main.tile[index1, index2] == null) + return; + if (Main.tile[index1, index2].active()) + { + switch (Main.tile[index1, index2].type) + { + case 4: + case 10: + case 11: + case 13: + case 21: + case 29: + case 33: + case 49: + case 50: + case 55: + case 79: + case 85: + case 88: + case 97: + case 104: + case 125: + case 132: + case 136: + case 139: + case 144: + case 174: + case 207: + case 209: + case 212: + case 216: + case 219: + case 237: + case 287: + case 334: + case 335: + case 338: + case 354: + case 386: + case 387: + case 388: + case 389: + case 411: + case 425: + case 441: + case 463: + case 467: + case 468: + flag1 = true; + break; + case 314: + if ((double) this.gravDir == 1.0) + { + flag1 = true; + break; + } + break; + } + } + int tileBoost = obj.tileBoost; + int num1 = 0; + if (obj.type == 1071 || obj.type == 1543 || obj.type == 1072 || obj.type == 1544) + { + for (int index3 = 0; index3 < 58; ++index3) + { + if (this.inventory[index3].stack > 0 && this.inventory[index3].paint > (byte) 0) + { + num1 = (int) this.inventory[index3].paint; + break; + } + } + } + int num2 = (int) ((double) this.position.X / 16.0) - Player.tileRangeX - tileBoost + 1; + int num3 = (int) (((double) this.position.X + (double) this.width) / 16.0) + Player.tileRangeX + tileBoost - 1; + int num4 = (int) ((double) this.position.Y / 16.0) - Player.tileRangeY - tileBoost + 1; + int num5 = (int) (((double) this.position.Y + (double) this.height) / 16.0) + Player.tileRangeY + tileBoost - 2; + int num6 = Utils.Clamp(num2, 10, Main.maxTilesX - 10); + int num7 = Utils.Clamp(num3, 10, Main.maxTilesX - 10); + int num8 = Utils.Clamp(num4, 10, Main.maxTilesY - 10); + int num9 = Utils.Clamp(num5, 10, Main.maxTilesY - 10); + if (flag1 && index1 >= num6 && index1 <= num7 && index2 >= num8 && index2 <= num9) + return; + List> ignoreTargets = new List>(); + for (int index4 = 0; index4 < this.grapCount; ++index4) + { + Projectile projectile = Main.projectile[this.grappling[index4]]; + int num10 = (int) projectile.Center.X / 16; + int num11 = (int) projectile.Center.Y / 16; + ignoreTargets.Add(new Tuple(num10, num11)); + } + int fX = -1; + int fY = -1; + if (!Player.SmartCursorSettings.SmartAxeAfterPickaxe) + Player.SmartCursor_Axe(obj, ref mouse, num6, num7, num8, num9, ref fX, ref fY); + if (obj.pick > 0 && fX == -1 && fY == -1) + { + if (PlayerInput.UsingGamepad) + { + Vector2 navigatorDirections = PlayerInput.Triggers.Current.GetNavigatorDirections(); + Vector2 gamepadThumbstickLeft = PlayerInput.GamepadThumbstickLeft; + Vector2 gamepadThumbstickRight = PlayerInput.GamepadThumbstickRight; + Vector2 zero = Vector2.Zero; + if (navigatorDirections == zero && (double) gamepadThumbstickLeft.Length() < 0.0500000007450581 && (double) gamepadThumbstickRight.Length() < 0.0500000007450581) + mouse = this.Center + new Vector2((float) (this.direction * 1000), 0.0f); + } + Vector2 vector2 = mouse - this.Center; + int num12 = Math.Sign(vector2.X); + int num13 = Math.Sign(vector2.Y); + if ((double) Math.Abs(vector2.X) > (double) Math.Abs(vector2.Y) * 3.0) + { + num13 = 0; + mouse.Y = this.Center.Y; + } + if ((double) Math.Abs(vector2.Y) > (double) Math.Abs(vector2.X) * 3.0) + { + num12 = 0; + mouse.X = this.Center.X; + } + int num14 = (int) this.Center.X / 16; + int num15 = (int) this.Center.Y / 16; + List> tupleList1 = new List>(); + List> tupleList2 = new List>(); + int num16 = 1; + if (num13 == -1 && num12 != 0) + num16 = -1; + int index5 = (int) (((double) this.position.X + (double) (this.width / 2) + (double) ((this.width / 2 - 1) * num12)) / 16.0); + int index6 = (int) (((double) this.position.Y + 0.1) / 16.0); + if (num16 == -1) + index6 = (int) (((double) this.position.Y + (double) this.height - 1.0) / 16.0); + int num17 = this.width / 16 + (this.width % 16 == 0 ? 0 : 1); + int num18 = this.height / 16 + (this.height % 16 == 0 ? 0 : 1); + if (num12 != 0) + { + for (int index7 = 0; index7 < num18; ++index7) + { + if (Main.tile[index5, index6 + index7 * num16] == null) + return; + tupleList1.Add(new Tuple(index5, index6 + index7 * num16)); + } + } + if (num13 != 0) + { + for (int index8 = 0; index8 < num17; ++index8) + { + if (Main.tile[(int) ((double) this.position.X / 16.0) + index8, index6] == null) + return; + tupleList1.Add(new Tuple((int) ((double) this.position.X / 16.0) + index8, index6)); + } + } + int index9 = (int) (((double) mouse.X + (double) ((this.width / 2 - 1) * num12)) / 16.0); + int index10 = (int) (((double) mouse.Y + 0.1 - (double) (this.height / 2 + 1)) / 16.0); + if (num16 == -1) + index10 = (int) (((double) mouse.Y + (double) (this.height / 2) - 1.0) / 16.0); + if ((double) this.gravDir == -1.0 && num13 == 0) + ++index10; + if (index10 < 10) + index10 = 10; + if (index10 > Main.maxTilesY - 10) + index10 = Main.maxTilesY - 10; + int num19 = this.width / 16 + (this.width % 16 == 0 ? 0 : 1); + int num20 = this.height / 16 + (this.height % 16 == 0 ? 0 : 1); + if (num12 != 0) + { + for (int index11 = 0; index11 < num20; ++index11) + { + if (Main.tile[index9, index10 + index11 * num16] == null) + return; + tupleList2.Add(new Tuple(index9, index10 + index11 * num16)); + } + } + if (num13 != 0) + { + for (int index12 = 0; index12 < num19; ++index12) + { + if (Main.tile[(int) (((double) mouse.X - (double) (this.width / 2)) / 16.0) + index12, index10] == null) + return; + tupleList2.Add(new Tuple((int) (((double) mouse.X - (double) (this.width / 2)) / 16.0) + index12, index10)); + } + } + List> tupleList3 = new List>(); + while (tupleList1.Count > 0) + { + Tuple tuple1 = tupleList1[0]; + Tuple tuple2 = tupleList2[0]; + Tuple col; + if (!Collision.TupleHitLine(tuple1.Item1, tuple1.Item2, tuple2.Item1, tuple2.Item2, num12 * (int) this.gravDir, -num13 * (int) this.gravDir, ignoreTargets, out col)) + { + tupleList1.Remove(tuple1); + tupleList2.Remove(tuple2); + } + else + { + if (col.Item1 != tuple2.Item1 || col.Item2 != tuple2.Item2) + tupleList3.Add(col); + Tile tile = Main.tile[col.Item1, col.Item2]; + if (!tile.inActive() && tile.active() && Main.tileSolid[(int) tile.type] && !Main.tileSolidTop[(int) tile.type] && !ignoreTargets.Contains(col)) + tupleList3.Add(col); + tupleList1.Remove(tuple1); + tupleList2.Remove(tuple2); + } + } + List> tupleList4 = new List>(); + for (int index13 = 0; index13 < tupleList3.Count; ++index13) + { + if (!WorldGen.CanKillTile(tupleList3[index13].Item1, tupleList3[index13].Item2)) + tupleList4.Add(tupleList3[index13]); + } + for (int index14 = 0; index14 < tupleList4.Count; ++index14) + tupleList3.Remove(tupleList4[index14]); + tupleList4.Clear(); + if (tupleList3.Count > 0) + { + float num21 = -1f; + Tuple tuple = tupleList3[0]; + for (int index15 = 0; index15 < tupleList3.Count; ++index15) + { + float num22 = Vector2.Distance(new Vector2((float) tupleList3[index15].Item1, (float) tupleList3[index15].Item2) * 16f + Vector2.One * 8f, this.Center); + if ((double) num21 == -1.0 || (double) num22 < (double) num21) + { + num21 = num22; + tuple = tupleList3[index15]; + } + } + if (Collision.InTileBounds(tuple.Item1, tuple.Item2, num6, num8, num7, num9)) + { + fX = tuple.Item1; + fY = tuple.Item2; + } + } + tupleList1.Clear(); + tupleList2.Clear(); + tupleList3.Clear(); + } + if (Player.SmartCursorSettings.SmartAxeAfterPickaxe) + Player.SmartCursor_Axe(obj, ref mouse, num6, num7, num8, num9, ref fX, ref fY); + if ((obj.type == 509 || obj.type == 850 || obj.type == 851 || obj.type == 3612) && fX == -1 && fY == -1) + { + List> tupleList = new List>(); + int num23 = 0; + if (obj.type == 509) + num23 = 1; + if (obj.type == 850) + num23 = 2; + if (obj.type == 851) + num23 = 3; + if (obj.type == 3612) + num23 = 4; + bool flag2 = false; + if (Main.tile[index1, index2].wire() && num23 == 1) + flag2 = true; + if (Main.tile[index1, index2].wire2() && num23 == 2) + flag2 = true; + if (Main.tile[index1, index2].wire3() && num23 == 3) + flag2 = true; + if (Main.tile[index1, index2].wire4() && num23 == 4) + flag2 = true; + if (!flag2) + { + for (int index16 = num6; index16 <= num7; ++index16) + { + for (int index17 = num8; index17 <= num9; ++index17) + { + Tile tile = Main.tile[index16, index17]; + if (tile.wire() && num23 == 1 || tile.wire2() && num23 == 2 || tile.wire3() && num23 == 3 || tile.wire4() && num23 == 4) + { + if (num23 == 1) + { + if (!Main.tile[index16 - 1, index17].wire()) + tupleList.Add(new Tuple(index16 - 1, index17)); + if (!Main.tile[index16 + 1, index17].wire()) + tupleList.Add(new Tuple(index16 + 1, index17)); + if (!Main.tile[index16, index17 - 1].wire()) + tupleList.Add(new Tuple(index16, index17 - 1)); + if (!Main.tile[index16, index17 + 1].wire()) + tupleList.Add(new Tuple(index16, index17 + 1)); + } + if (num23 == 2) + { + if (!Main.tile[index16 - 1, index17].wire2()) + tupleList.Add(new Tuple(index16 - 1, index17)); + if (!Main.tile[index16 + 1, index17].wire2()) + tupleList.Add(new Tuple(index16 + 1, index17)); + if (!Main.tile[index16, index17 - 1].wire2()) + tupleList.Add(new Tuple(index16, index17 - 1)); + if (!Main.tile[index16, index17 + 1].wire2()) + tupleList.Add(new Tuple(index16, index17 + 1)); + } + if (num23 == 3) + { + if (!Main.tile[index16 - 1, index17].wire3()) + tupleList.Add(new Tuple(index16 - 1, index17)); + if (!Main.tile[index16 + 1, index17].wire3()) + tupleList.Add(new Tuple(index16 + 1, index17)); + if (!Main.tile[index16, index17 - 1].wire3()) + tupleList.Add(new Tuple(index16, index17 - 1)); + if (!Main.tile[index16, index17 + 1].wire3()) + tupleList.Add(new Tuple(index16, index17 + 1)); + } + if (num23 == 4) + { + if (!Main.tile[index16 - 1, index17].wire4()) + tupleList.Add(new Tuple(index16 - 1, index17)); + if (!Main.tile[index16 + 1, index17].wire4()) + tupleList.Add(new Tuple(index16 + 1, index17)); + if (!Main.tile[index16, index17 - 1].wire4()) + tupleList.Add(new Tuple(index16, index17 - 1)); + if (!Main.tile[index16, index17 + 1].wire4()) + tupleList.Add(new Tuple(index16, index17 + 1)); + } + } + } + } + } + if (tupleList.Count > 0) + { + float num24 = -1f; + Tuple tuple = tupleList[0]; + for (int index18 = 0; index18 < tupleList.Count; ++index18) + { + float num25 = Vector2.Distance(new Vector2((float) tupleList[index18].Item1, (float) tupleList[index18].Item2) * 16f + Vector2.One * 8f, mouse); + if ((double) num24 == -1.0 || (double) num25 < (double) num24) + { + num24 = num25; + tuple = tupleList[index18]; + } + } + if (Collision.InTileBounds(tuple.Item1, tuple.Item2, num6, num8, num7, num9)) + { + fX = tuple.Item1; + fY = tuple.Item2; + } + } + tupleList.Clear(); + } + if (obj.type == 3625 && fX == -1 && fY == -1) + { + List> tupleList = new List>(); + WiresUI.Settings.MultiToolMode toolMode1 = WiresUI.Settings.ToolMode; + WiresUI.Settings.MultiToolMode multiToolMode = (WiresUI.Settings.MultiToolMode) 0; + if (Main.tile[index1, index2].wire()) + multiToolMode |= WiresUI.Settings.MultiToolMode.Red; + if (Main.tile[index1, index2].wire2()) + multiToolMode |= WiresUI.Settings.MultiToolMode.Blue; + if (Main.tile[index1, index2].wire3()) + multiToolMode |= WiresUI.Settings.MultiToolMode.Green; + if (Main.tile[index1, index2].wire4()) + multiToolMode |= WiresUI.Settings.MultiToolMode.Yellow; + int num26 = (toolMode1 & ~WiresUI.Settings.MultiToolMode.Cutter) == multiToolMode ? 1 : 0; + WiresUI.Settings.MultiToolMode toolMode2 = WiresUI.Settings.ToolMode; + if (num26 == 0) + { + bool flag3 = toolMode2.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Red); + bool flag4 = toolMode2.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Blue); + bool flag5 = toolMode2.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Green); + bool flag6 = toolMode2.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Yellow); + bool flag7 = toolMode2.HasFlag((Enum) WiresUI.Settings.MultiToolMode.Cutter); + for (int index19 = num6; index19 <= num7; ++index19) + { + for (int index20 = num8; index20 <= num9; ++index20) + { + Tile tile = Main.tile[index19, index20]; + if (flag7) + { + if (tile.wire() & flag3 || tile.wire2() & flag4 || tile.wire3() & flag5 || tile.wire4() & flag6) + tupleList.Add(new Tuple(index19, index20)); + } + else if (tile.wire() & flag3 || tile.wire2() & flag4 || tile.wire3() & flag5 || tile.wire4() & flag6) + { + if (flag3) + { + if (!Main.tile[index19 - 1, index20].wire()) + tupleList.Add(new Tuple(index19 - 1, index20)); + if (!Main.tile[index19 + 1, index20].wire()) + tupleList.Add(new Tuple(index19 + 1, index20)); + if (!Main.tile[index19, index20 - 1].wire()) + tupleList.Add(new Tuple(index19, index20 - 1)); + if (!Main.tile[index19, index20 + 1].wire()) + tupleList.Add(new Tuple(index19, index20 + 1)); + } + if (flag4) + { + if (!Main.tile[index19 - 1, index20].wire2()) + tupleList.Add(new Tuple(index19 - 1, index20)); + if (!Main.tile[index19 + 1, index20].wire2()) + tupleList.Add(new Tuple(index19 + 1, index20)); + if (!Main.tile[index19, index20 - 1].wire2()) + tupleList.Add(new Tuple(index19, index20 - 1)); + if (!Main.tile[index19, index20 + 1].wire2()) + tupleList.Add(new Tuple(index19, index20 + 1)); + } + if (flag5) + { + if (!Main.tile[index19 - 1, index20].wire3()) + tupleList.Add(new Tuple(index19 - 1, index20)); + if (!Main.tile[index19 + 1, index20].wire3()) + tupleList.Add(new Tuple(index19 + 1, index20)); + if (!Main.tile[index19, index20 - 1].wire3()) + tupleList.Add(new Tuple(index19, index20 - 1)); + if (!Main.tile[index19, index20 + 1].wire3()) + tupleList.Add(new Tuple(index19, index20 + 1)); + } + if (flag6) + { + if (!Main.tile[index19 - 1, index20].wire4()) + tupleList.Add(new Tuple(index19 - 1, index20)); + if (!Main.tile[index19 + 1, index20].wire4()) + tupleList.Add(new Tuple(index19 + 1, index20)); + if (!Main.tile[index19, index20 - 1].wire4()) + tupleList.Add(new Tuple(index19, index20 - 1)); + if (!Main.tile[index19, index20 + 1].wire4()) + tupleList.Add(new Tuple(index19, index20 + 1)); + } + } + } + } + } + if (tupleList.Count > 0) + { + float num27 = -1f; + Tuple tuple = tupleList[0]; + for (int index21 = 0; index21 < tupleList.Count; ++index21) + { + float num28 = Vector2.Distance(new Vector2((float) tupleList[index21].Item1, (float) tupleList[index21].Item2) * 16f + Vector2.One * 8f, mouse); + if ((double) num27 == -1.0 || (double) num28 < (double) num27) + { + num27 = num28; + tuple = tupleList[index21]; + } + } + if (Collision.InTileBounds(tuple.Item1, tuple.Item2, num6, num8, num7, num9)) + { + fX = tuple.Item1; + fY = tuple.Item2; + } + } + tupleList.Clear(); + } + if (obj.hammer > 0 && fX == -1 && fY == -1) + { + Vector2 vector2 = mouse - this.Center; + int num29 = Math.Sign(vector2.X); + int num30 = Math.Sign(vector2.Y); + if ((double) Math.Abs(vector2.X) > (double) Math.Abs(vector2.Y) * 3.0) + { + num30 = 0; + mouse.Y = this.Center.Y; + } + if ((double) Math.Abs(vector2.Y) > (double) Math.Abs(vector2.X) * 3.0) + { + num29 = 0; + mouse.X = this.Center.X; + } + int num31 = (int) this.Center.X / 16; + int num32 = (int) this.Center.Y / 16; + List> tupleList5 = new List>(); + List> tupleList6 = new List>(); + int num33 = 1; + if (num30 == -1 && num29 != 0) + num33 = -1; + int index22 = (int) (((double) this.position.X + (double) (this.width / 2) + (double) ((this.width / 2 - 1) * num29)) / 16.0); + int index23 = (int) (((double) this.position.Y + 0.1) / 16.0); + if (num33 == -1) + index23 = (int) (((double) this.position.Y + (double) this.height - 1.0) / 16.0); + int num34 = this.width / 16 + (this.width % 16 == 0 ? 0 : 1); + int num35 = this.height / 16 + (this.height % 16 == 0 ? 0 : 1); + if (num29 != 0) + { + for (int index24 = 0; index24 < num35; ++index24) + { + if (Main.tile[index22, index23 + index24 * num33] == null) + return; + tupleList5.Add(new Tuple(index22, index23 + index24 * num33)); + } + } + if (num30 != 0) + { + for (int index25 = 0; index25 < num34; ++index25) + { + if (Main.tile[(int) ((double) this.position.X / 16.0) + index25, index23] == null) + return; + tupleList5.Add(new Tuple((int) ((double) this.position.X / 16.0) + index25, index23)); + } + } + int index26 = (int) (((double) mouse.X + (double) ((this.width / 2 - 1) * num29)) / 16.0); + int index27 = (int) (((double) mouse.Y + 0.1 - (double) (this.height / 2 + 1)) / 16.0); + if (num33 == -1) + index27 = (int) (((double) mouse.Y + (double) (this.height / 2) - 1.0) / 16.0); + if ((double) this.gravDir == -1.0 && num30 == 0) + ++index27; + if (index27 < 10) + index27 = 10; + if (index27 > Main.maxTilesY - 10) + index27 = Main.maxTilesY - 10; + int num36 = this.width / 16 + (this.width % 16 == 0 ? 0 : 1); + int num37 = this.height / 16 + (this.height % 16 == 0 ? 0 : 1); + if (num29 != 0) + { + for (int index28 = 0; index28 < num37; ++index28) + { + if (Main.tile[index26, index27 + index28 * num33] == null) + return; + tupleList6.Add(new Tuple(index26, index27 + index28 * num33)); + } + } + if (num30 != 0) + { + for (int index29 = 0; index29 < num36; ++index29) + { + if (Main.tile[(int) (((double) mouse.X - (double) (this.width / 2)) / 16.0) + index29, index27] == null) + return; + tupleList6.Add(new Tuple((int) (((double) mouse.X - (double) (this.width / 2)) / 16.0) + index29, index27)); + } + } + List> tupleList7 = new List>(); + while (tupleList5.Count > 0) + { + Tuple tuple3 = tupleList5[0]; + Tuple tuple4 = tupleList6[0]; + Tuple tuple5 = Collision.TupleHitLineWall(tuple3.Item1, tuple3.Item2, tuple4.Item1, tuple4.Item2); + if (tuple5.Item1 == -1 || tuple5.Item2 == -1) + { + tupleList5.Remove(tuple3); + tupleList6.Remove(tuple4); + } + else + { + if (tuple5.Item1 != tuple4.Item1 || tuple5.Item2 != tuple4.Item2) + tupleList7.Add(tuple5); + Tile tile = Main.tile[tuple5.Item1, tuple5.Item2]; + if (Collision.HitWallSubstep(tuple5.Item1, tuple5.Item2)) + tupleList7.Add(tuple5); + tupleList5.Remove(tuple3); + tupleList6.Remove(tuple4); + } + } + if (tupleList7.Count > 0) + { + float num38 = -1f; + Tuple tuple = tupleList7[0]; + for (int index30 = 0; index30 < tupleList7.Count; ++index30) + { + float num39 = Vector2.Distance(new Vector2((float) tupleList7[index30].Item1, (float) tupleList7[index30].Item2) * 16f + Vector2.One * 8f, this.Center); + if ((double) num38 == -1.0 || (double) num39 < (double) num38) + { + num38 = num39; + tuple = tupleList7[index30]; + } + } + if (Collision.InTileBounds(tuple.Item1, tuple.Item2, num6, num8, num7, num9)) + { + this.poundRelease = false; + fX = tuple.Item1; + fY = tuple.Item2; + } + } + tupleList7.Clear(); + tupleList5.Clear(); + tupleList6.Clear(); + } + if (obj.hammer > 0 && fX == -1 && fY == -1) + { + List> tupleList = new List>(); + for (int x = num6; x <= num7; ++x) + { + for (int y = num8; y <= num9; ++y) + { + if (Main.tile[x, y].wall > (byte) 0 && Collision.HitWallSubstep(x, y)) + tupleList.Add(new Tuple(x, y)); + } + } + if (tupleList.Count > 0) + { + float num40 = -1f; + Tuple tuple = tupleList[0]; + for (int index31 = 0; index31 < tupleList.Count; ++index31) + { + float num41 = Vector2.Distance(new Vector2((float) tupleList[index31].Item1, (float) tupleList[index31].Item2) * 16f + Vector2.One * 8f, mouse); + if ((double) num40 == -1.0 || (double) num41 < (double) num40) + { + num40 = num41; + tuple = tupleList[index31]; + } + } + if (Collision.InTileBounds(tuple.Item1, tuple.Item2, num6, num8, num7, num9)) + { + this.poundRelease = false; + fX = tuple.Item1; + fY = tuple.Item2; + } + } + tupleList.Clear(); + } + if (obj.type == 3620 && fX == -1 && fY == -1) + { + List> tupleList = new List>(); + for (int index32 = num6; index32 <= num7; ++index32) + { + for (int index33 = num8; index33 <= num9; ++index33) + { + Tile tile = Main.tile[index32, index33]; + if (tile.active() && tile.actuator() && (!this.ActuationRodLock || this.ActuationRodLockSetting == tile.inActive())) + tupleList.Add(new Tuple(index32, index33)); + } + } + if (tupleList.Count > 0) + { + float num42 = -1f; + Tuple tuple = tupleList[0]; + for (int index34 = 0; index34 < tupleList.Count; ++index34) + { + float num43 = Vector2.Distance(new Vector2((float) tupleList[index34].Item1, (float) tupleList[index34].Item2) * 16f + Vector2.One * 8f, mouse); + if ((double) num42 == -1.0 || (double) num43 < (double) num42) + { + num42 = num43; + tuple = tupleList[index34]; + } + } + if (Collision.InTileBounds(tuple.Item1, tuple.Item2, num6, num8, num7, num9)) + { + fX = tuple.Item1; + fY = tuple.Item2; + } + } + tupleList.Clear(); + } + if (obj.type == 510 && fX == -1 && fY == -1) + { + List> tupleList = new List>(); + for (int index35 = num6; index35 <= num7; ++index35) + { + for (int index36 = num8; index36 <= num9; ++index36) + { + Tile tile = Main.tile[index35, index36]; + if (tile.wire() || tile.wire2() || tile.wire3() || tile.wire4() || tile.actuator()) + tupleList.Add(new Tuple(index35, index36)); + } + } + if (tupleList.Count > 0) + { + float num44 = -1f; + Tuple tuple = tupleList[0]; + for (int index37 = 0; index37 < tupleList.Count; ++index37) + { + float num45 = Vector2.Distance(new Vector2((float) tupleList[index37].Item1, (float) tupleList[index37].Item2) * 16f + Vector2.One * 8f, mouse); + if ((double) num44 == -1.0 || (double) num45 < (double) num44) + { + num44 = num45; + tuple = tupleList[index37]; + } + } + if (Collision.InTileBounds(tuple.Item1, tuple.Item2, num6, num8, num7, num9)) + { + fX = tuple.Item1; + fY = tuple.Item2; + } + } + tupleList.Clear(); + } + if (obj.createTile >= 0 && TileID.Sets.Platforms[obj.createTile] && fX == -1 && fY == -1) + { + List> tupleList = new List>(); + bool flag8 = false; + if (Main.tile[index1, index2].active() && TileID.Sets.Platforms[(int) Main.tile[index1, index2].type]) + flag8 = true; + if (!flag8) + { + for (int index38 = num6; index38 <= num7; ++index38) + { + for (int index39 = num8; index39 <= num9; ++index39) + { + Tile tile1 = Main.tile[index38, index39]; + if (tile1.active() && TileID.Sets.Platforms[(int) tile1.type]) + { + int num46 = (int) tile1.slope(); + if (num46 != 2 && !Main.tile[index38 - 1, index39 - 1].active()) + tupleList.Add(new Tuple(index38 - 1, index39 - 1)); + if (!Main.tile[index38 - 1, index39].active()) + tupleList.Add(new Tuple(index38 - 1, index39)); + if (num46 != 1 && !Main.tile[index38 - 1, index39 + 1].active()) + tupleList.Add(new Tuple(index38 - 1, index39 + 1)); + if (num46 != 1 && !Main.tile[index38 + 1, index39 - 1].active()) + tupleList.Add(new Tuple(index38 + 1, index39 - 1)); + if (!Main.tile[index38 + 1, index39].active()) + tupleList.Add(new Tuple(index38 + 1, index39)); + if (num46 != 2 && !Main.tile[index38 + 1, index39 + 1].active()) + tupleList.Add(new Tuple(index38 + 1, index39 + 1)); + } + if (!tile1.active()) + { + int num47 = 0; + int num48 = 1; + Tile tile2 = Main.tile[index38 + num47, index39 + num48]; + if (tile2.active() && Main.tileSolid[(int) tile2.type] && !Main.tileSolidTop[(int) tile2.type]) + tupleList.Add(new Tuple(index38, index39)); + int num49 = -1; + int num50 = 0; + Tile tile3 = Main.tile[index38 + num49, index39 + num50]; + if (tile3.active() && Main.tileSolid[(int) tile3.type] && !Main.tileSolidTop[(int) tile3.type]) + tupleList.Add(new Tuple(index38, index39)); + int num51 = 1; + int num52 = 0; + Tile tile4 = Main.tile[index38 + num51, index39 + num52]; + if (tile4.active() && Main.tileSolid[(int) tile4.type] && !Main.tileSolidTop[(int) tile4.type]) + tupleList.Add(new Tuple(index38, index39)); + } + } + } + } + if (tupleList.Count > 0) + { + float num53 = -1f; + Tuple tuple = tupleList[0]; + for (int index40 = 0; index40 < tupleList.Count; ++index40) + { + float num54 = Vector2.Distance(new Vector2((float) tupleList[index40].Item1, (float) tupleList[index40].Item2) * 16f + Vector2.One * 8f, mouse); + if ((double) num53 == -1.0 || (double) num54 < (double) num53) + { + num53 = num54; + tuple = tupleList[index40]; + } + } + if (Collision.InTileBounds(tuple.Item1, tuple.Item2, num6, num8, num7, num9)) + { + fX = tuple.Item1; + fY = tuple.Item2; + } + } + tupleList.Clear(); + } + if ((obj.type == 2340 || obj.type == 2739) && fX == -1 && fY == -1) + { + List> tupleList = new List>(); + bool flag9 = false; + if (Main.tile[index1, index2].active() && Main.tile[index1, index2].type == (ushort) 314) + flag9 = true; + if (!flag9) + { + for (int index41 = num6; index41 <= num7; ++index41) + { + for (int index42 = num8; index42 <= num9; ++index42) + { + Tile tile = Main.tile[index41, index42]; + if (tile.active() && tile.type == (ushort) 314) + { + bool flag10 = Main.tile[index41 + 1, index42 + 1].active() && Main.tile[index41 + 1, index42 + 1].type == (ushort) 314; + bool flag11 = Main.tile[index41 + 1, index42 - 1].active() && Main.tile[index41 + 1, index42 - 1].type == (ushort) 314; + bool flag12 = Main.tile[index41 - 1, index42 + 1].active() && Main.tile[index41 - 1, index42 + 1].type == (ushort) 314; + bool flag13 = Main.tile[index41 - 1, index42 - 1].active() && Main.tile[index41 - 1, index42 - 1].type == (ushort) 314; + if ((!Main.tile[index41 - 1, index42 - 1].active() || Main.tileCut[(int) Main.tile[index41 - 1, index42 - 1].type] || TileID.Sets.BreakableWhenPlacing[(int) Main.tile[index41 - 1, index42 - 1].type]) && !(!flag10 & flag11)) + tupleList.Add(new Tuple(index41 - 1, index42 - 1)); + if (!Main.tile[index41 - 1, index42].active() || Main.tileCut[(int) Main.tile[index41 - 1, index42].type] || TileID.Sets.BreakableWhenPlacing[(int) Main.tile[index41 - 1, index42].type]) + tupleList.Add(new Tuple(index41 - 1, index42)); + if ((!Main.tile[index41 - 1, index42 + 1].active() || Main.tileCut[(int) Main.tile[index41 - 1, index42 + 1].type] || TileID.Sets.BreakableWhenPlacing[(int) Main.tile[index41 - 1, index42 + 1].type]) && !(!flag11 & flag10)) + tupleList.Add(new Tuple(index41 - 1, index42 + 1)); + if ((!Main.tile[index41 + 1, index42 - 1].active() || Main.tileCut[(int) Main.tile[index41 + 1, index42 - 1].type] || TileID.Sets.BreakableWhenPlacing[(int) Main.tile[index41 + 1, index42 - 1].type]) && !(!flag12 & flag13)) + tupleList.Add(new Tuple(index41 + 1, index42 - 1)); + if (!Main.tile[index41 + 1, index42].active() || Main.tileCut[(int) Main.tile[index41 + 1, index42].type] || TileID.Sets.BreakableWhenPlacing[(int) Main.tile[index41 + 1, index42].type]) + tupleList.Add(new Tuple(index41 + 1, index42)); + if ((!Main.tile[index41 + 1, index42 + 1].active() || Main.tileCut[(int) Main.tile[index41 + 1, index42 + 1].type] || TileID.Sets.BreakableWhenPlacing[(int) Main.tile[index41 + 1, index42 + 1].type]) && !(!flag13 & flag12)) + tupleList.Add(new Tuple(index41 + 1, index42 + 1)); + } + } + } + } + if (tupleList.Count > 0) + { + float num55 = -1f; + Tuple tuple = tupleList[0]; + for (int index43 = 0; index43 < tupleList.Count; ++index43) + { + if ((!Main.tile[tupleList[index43].Item1, tupleList[index43].Item2 - 1].active() || Main.tile[tupleList[index43].Item1, tupleList[index43].Item2 - 1].type != (ushort) 314) && (!Main.tile[tupleList[index43].Item1, tupleList[index43].Item2 + 1].active() || Main.tile[tupleList[index43].Item1, tupleList[index43].Item2 + 1].type != (ushort) 314)) + { + float num56 = Vector2.Distance(new Vector2((float) tupleList[index43].Item1, (float) tupleList[index43].Item2) * 16f + Vector2.One * 8f, mouse); + if ((double) num55 == -1.0 || (double) num56 < (double) num55) + { + num55 = num56; + tuple = tupleList[index43]; + } + } + } + if (Collision.InTileBounds(tuple.Item1, tuple.Item2, num6, num8, num7, num9) && (double) num55 != -1.0) + { + fX = tuple.Item1; + fY = tuple.Item2; + } + } + tupleList.Clear(); + } + if (obj.type == 2492 && fX == -1 && fY == -1) + { + List> tupleList = new List>(); + bool flag14 = false; + if (Main.tile[index1, index2].active() && Main.tile[index1, index2].type == (ushort) 314) + flag14 = true; + if (!flag14) + { + for (int index44 = num6; index44 <= num7; ++index44) + { + for (int index45 = num8; index45 <= num9; ++index45) + { + Tile tile = Main.tile[index44, index45]; + if (tile.active() && tile.type == (ushort) 314) + { + if (!Main.tile[index44 - 1, index45].active() || Main.tileCut[(int) Main.tile[index44 - 1, index45].type] || TileID.Sets.BreakableWhenPlacing[(int) Main.tile[index44 - 1, index45].type]) + tupleList.Add(new Tuple(index44 - 1, index45)); + if (!Main.tile[index44 + 1, index45].active() || Main.tileCut[(int) Main.tile[index44 + 1, index45].type] || TileID.Sets.BreakableWhenPlacing[(int) Main.tile[index44 + 1, index45].type]) + tupleList.Add(new Tuple(index44 + 1, index45)); + } + } + } + } + if (tupleList.Count > 0) + { + float num57 = -1f; + Tuple tuple = tupleList[0]; + for (int index46 = 0; index46 < tupleList.Count; ++index46) + { + if ((!Main.tile[tupleList[index46].Item1, tupleList[index46].Item2 - 1].active() || Main.tile[tupleList[index46].Item1, tupleList[index46].Item2 - 1].type != (ushort) 314) && (!Main.tile[tupleList[index46].Item1, tupleList[index46].Item2 + 1].active() || Main.tile[tupleList[index46].Item1, tupleList[index46].Item2 + 1].type != (ushort) 314)) + { + float num58 = Vector2.Distance(new Vector2((float) tupleList[index46].Item1, (float) tupleList[index46].Item2) * 16f + Vector2.One * 8f, mouse); + if ((double) num57 == -1.0 || (double) num58 < (double) num57) + { + num57 = num58; + tuple = tupleList[index46]; + } + } + } + if (Collision.InTileBounds(tuple.Item1, tuple.Item2, num6, num8, num7, num9) && (double) num57 != -1.0) + { + fX = tuple.Item1; + fY = tuple.Item2; + } + } + tupleList.Clear(); + } + if (obj.createWall > 0 && fX == -1 && fY == -1) + { + List> tupleList = new List>(); + for (int x = num6; x <= num7; ++x) + { + for (int y = num8; y <= num9; ++y) + { + Tile tile = Main.tile[x, y]; + if (tile.wall == (byte) 0 && (!tile.active() || !Main.tileSolid[(int) tile.type] || Main.tileSolidTop[(int) tile.type]) && Collision.CanHitWithCheck(this.position, this.width, this.height, new Vector2((float) x, (float) y) * 16f, 16, 16, new Utils.PerLinePoint(DelegateMethods.NotDoorStand))) + { + bool flag15 = false; + if (Main.tile[x - 1, y].active() || Main.tile[x - 1, y].wall > (byte) 0) + flag15 = true; + if (Main.tile[x + 1, y].active() || Main.tile[x + 1, y].wall > (byte) 0) + flag15 = true; + if (Main.tile[x, y - 1].active() || Main.tile[x, y - 1].wall > (byte) 0) + flag15 = true; + if (Main.tile[x, y + 1].active() || Main.tile[x, y + 1].wall > (byte) 0) + flag15 = true; + if (WorldGen.IsOpenDoorAnchorFrame(x, y)) + flag15 = false; + if (flag15) + tupleList.Add(new Tuple(x, y)); + } + } + } + if (tupleList.Count > 0) + { + float num59 = -1f; + Tuple tuple = tupleList[0]; + for (int index47 = 0; index47 < tupleList.Count; ++index47) + { + float num60 = Vector2.Distance(new Vector2((float) tupleList[index47].Item1, (float) tupleList[index47].Item2) * 16f + Vector2.One * 8f, mouse); + if ((double) num59 == -1.0 || (double) num60 < (double) num59) + { + num59 = num60; + tuple = tupleList[index47]; + } + } + if (Collision.InTileBounds(tuple.Item1, tuple.Item2, num6, num8, num7, num9)) + { + fX = tuple.Item1; + fY = tuple.Item2; + } + } + tupleList.Clear(); + } + if (obj.createTile == 254 && fX == -1 && fY == -1) + { + List> tupleList = new List>(); + for (int index48 = num6; index48 <= num7; ++index48) + { + for (int index49 = num8; index49 <= num9; ++index49) + { + Tile tile5 = Main.tile[index48, index49 + 1]; + Tile tile6 = Main.tile[index48 - 1, index49 + 1]; + if ((double) index49 <= Main.worldSurface - 2.0) + { + bool flag16 = true; + if (!tile6.active() || !tile5.active()) + flag16 = false; + if (tile6.slope() > (byte) 0 || tile5.slope() > (byte) 0 || tile6.halfBrick() || tile5.halfBrick()) + flag16 = false; + if (tile6.type != (ushort) 2 && tile6.type != (ushort) 109) + flag16 = false; + if (tile5.type != (ushort) 2 && tile5.type != (ushort) 109) + flag16 = false; + for (int x = index48 - 1; x <= index48; ++x) + { + for (int y = index49 - 1; y <= index49; ++y) + { + if (Main.tile[x, y].active() && !WorldGen.CanCutTile(x, y, TileCuttingContext.AttackMelee)) + flag16 = false; + } + } + if (flag16) + tupleList.Add(new Tuple(index48, index49)); + } + else + break; + } + } + if (tupleList.Count > 0) + { + float num61 = -1f; + Tuple tuple = tupleList[0]; + for (int index50 = 0; index50 < tupleList.Count; ++index50) + { + float num62 = Vector2.Distance(new Vector2((float) tupleList[index50].Item1, (float) tupleList[index50].Item2) * 16f + Vector2.One * 8f, mouse); + if ((double) num61 == -1.0 || (double) num62 < (double) num61) + { + num61 = num62; + tuple = tupleList[index50]; + } + } + if (Collision.InTileBounds(tuple.Item1, tuple.Item2, num6, num8, num7, num9)) + { + fX = tuple.Item1; + fY = tuple.Item2; + } + } + tupleList.Clear(); + } + if (obj.createTile == 454 && fX == -1 && fY == -1) + { + List> tupleList = new List>(); + for (int index51 = num6; index51 <= num7; ++index51) + { + for (int index52 = num8; index52 <= num9 && (double) index52 <= Main.worldSurface - 2.0; ++index52) + { + bool flag17 = true; + for (int index53 = index51 - 2; index53 <= index51 + 1; ++index53) + { + for (int index54 = index52 - 1; index54 <= index52 + 2; ++index54) + { + Tile testTile = Main.tile[index53, index54]; + if (index54 == index52 - 1) + { + if (!WorldGen.SolidTile(testTile)) + flag17 = false; + } + else if (testTile.active() && (!Main.tileCut[(int) testTile.type] || testTile.type == (ushort) 454)) + flag17 = false; + } + } + if (flag17) + tupleList.Add(new Tuple(index51, index52)); + } + } + if (tupleList.Count > 0) + { + float num63 = -1f; + Tuple tuple = tupleList[0]; + for (int index55 = 0; index55 < tupleList.Count; ++index55) + { + float num64 = Vector2.Distance(new Vector2((float) tupleList[index55].Item1, (float) tupleList[index55].Item2) * 16f + Vector2.One * 8f, mouse); + if ((double) num63 == -1.0 || (double) num64 < (double) num63) + { + num63 = num64; + tuple = tupleList[index55]; + } + } + if (Collision.InTileBounds(tuple.Item1, tuple.Item2, num6, num8, num7, num9)) + { + fX = tuple.Item1; + fY = tuple.Item2; + } + } + tupleList.Clear(); + } + if (obj.createTile == 138 && fX == -1 && fY == -1) + { + List> tupleList = new List>(); + for (int index56 = num6; index56 <= num7; ++index56) + { + for (int index57 = num8; index57 <= num9; ++index57) + { + Tile tile7 = Main.tile[index56, index57 + 1]; + Tile tile8 = Main.tile[index56 - 1, index57 + 1]; + bool flag18 = true; + if (!tile8.nactive() || !tile7.nactive()) + flag18 = false; + if (tile8.slope() > (byte) 0 || tile7.slope() > (byte) 0 || tile8.halfBrick() || tile7.halfBrick()) + flag18 = false; + if (Main.tileNoAttach[(int) tile8.type] || Main.tileNoAttach[(int) tile7.type]) + flag18 = false; + for (int index58 = index56 - 1; index58 <= index56; ++index58) + { + for (int index59 = index57 - 1; index59 <= index57; ++index59) + { + Tile tile9 = Main.tile[index58, index59]; + if (tile9.active() && !Main.tileCut[(int) tile9.type]) + flag18 = false; + } + } + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(index56 * 16 - 16, index57 * 16 - 16, 32, 32); + for (int index60 = 0; index60 < (int) byte.MaxValue; ++index60) + { + Player player = Main.player[index60]; + if (player.active && !player.dead && player.Hitbox.Intersects(rectangle)) + { + flag18 = false; + break; + } + } + if (flag18) + tupleList.Add(new Tuple(index56, index57)); + } + } + if (tupleList.Count > 0) + { + float num65 = -1f; + Tuple tuple = tupleList[0]; + for (int index61 = 0; index61 < tupleList.Count; ++index61) + { + float num66 = Vector2.Distance(new Vector2((float) tupleList[index61].Item1, (float) tupleList[index61].Item2) * 16f + Vector2.One * 8f, mouse); + if ((double) num65 == -1.0 || (double) num66 < (double) num65) + { + num65 = num66; + tuple = tupleList[index61]; + } + } + if (Collision.InTileBounds(tuple.Item1, tuple.Item2, num6, num8, num7, num9)) + { + fX = tuple.Item1; + fY = tuple.Item2; + } + } + tupleList.Clear(); + } + Player.SmartCursor_Torch(obj, ref mouse, num6, num7, num8, num9, ref fX, ref fY, index1, index2); + Player.SmartCursor_Filling(obj, ref mouse, num6, num7, num8, num9, ref fX, ref fY, index1, index2); + if (Player.SmartCursorSettings.SmartBlocksEnabled && obj.createTile > -1 && obj.type != 213 && Main.tileSolid[obj.createTile] && !Main.tileSolidTop[obj.createTile] && !Main.tileFrameImportant[obj.createTile] && fX == -1 && fY == -1) + { + List> tupleList = new List>(); + bool flag19 = false; + if (Main.tile[index1, index2].active()) + flag19 = true; + if (!Collision.InTileBounds(index1, index2, num6, num8, num7, num9)) + flag19 = true; + if (!flag19) + { + for (int index62 = num6; index62 <= num7; ++index62) + { + for (int index63 = num8; index63 <= num9; ++index63) + { + Tile tile = Main.tile[index62, index63]; + if (!tile.active() || Main.tileCut[(int) tile.type] || TileID.Sets.BreakableWhenPlacing[(int) tile.type]) + { + bool flag20 = false; + if (Main.tile[index62 - 1, index63].active() && Main.tileSolid[(int) Main.tile[index62 - 1, index63].type] && !Main.tileSolidTop[(int) Main.tile[index62 - 1, index63].type]) + flag20 = true; + if (Main.tile[index62 + 1, index63].active() && Main.tileSolid[(int) Main.tile[index62 + 1, index63].type] && !Main.tileSolidTop[(int) Main.tile[index62 + 1, index63].type]) + flag20 = true; + if (Main.tile[index62, index63 - 1].active() && Main.tileSolid[(int) Main.tile[index62, index63 - 1].type] && !Main.tileSolidTop[(int) Main.tile[index62, index63 - 1].type]) + flag20 = true; + if (Main.tile[index62, index63 + 1].active() && Main.tileSolid[(int) Main.tile[index62, index63 + 1].type] && !Main.tileSolidTop[(int) Main.tile[index62, index63 + 1].type]) + flag20 = true; + if (flag20) + tupleList.Add(new Tuple(index62, index63)); + } + } + } + } + if (tupleList.Count > 0) + { + float num67 = -1f; + Tuple tuple = tupleList[0]; + for (int index64 = 0; index64 < tupleList.Count; ++index64) + { + if (Collision.EmptyTile(tupleList[index64].Item1, tupleList[index64].Item2)) + { + float num68 = Vector2.Distance(new Vector2((float) tupleList[index64].Item1, (float) tupleList[index64].Item2) * 16f + Vector2.One * 8f, mouse); + if ((double) num67 == -1.0 || (double) num68 < (double) num67) + { + num67 = num68; + tuple = tupleList[index64]; + } + } + } + if (Collision.InTileBounds(tuple.Item1, tuple.Item2, num6, num8, num7, num9) && (double) num67 != -1.0) + { + fX = tuple.Item1; + fY = tuple.Item2; + } + } + tupleList.Clear(); + } + if ((obj.type == 1072 || obj.type == 1544) && num1 != 0 && fX == -1 && fY == -1) + { + List> tupleList = new List>(); + for (int index65 = num6; index65 <= num7; ++index65) + { + for (int index66 = num8; index66 <= num9; ++index66) + { + Tile tile = Main.tile[index65, index66]; + if (tile.wall > (byte) 0 && (int) tile.wallColor() != num1 && (!tile.active() || !Main.tileSolid[(int) tile.type] || Main.tileSolidTop[(int) tile.type])) + tupleList.Add(new Tuple(index65, index66)); + } + } + if (tupleList.Count > 0) + { + float num69 = -1f; + Tuple tuple = tupleList[0]; + for (int index67 = 0; index67 < tupleList.Count; ++index67) + { + float num70 = Vector2.Distance(new Vector2((float) tupleList[index67].Item1, (float) tupleList[index67].Item2) * 16f + Vector2.One * 8f, mouse); + if ((double) num69 == -1.0 || (double) num70 < (double) num69) + { + num69 = num70; + tuple = tupleList[index67]; + } + } + if (Collision.InTileBounds(tuple.Item1, tuple.Item2, num6, num8, num7, num9)) + { + fX = tuple.Item1; + fY = tuple.Item2; + } + } + tupleList.Clear(); + } + if ((obj.type == 1071 || obj.type == 1543) && num1 != 0 && fX == -1 && fY == -1) + { + List> tupleList = new List>(); + for (int index68 = num6; index68 <= num7; ++index68) + { + for (int index69 = num8; index69 <= num9; ++index69) + { + Tile tile = Main.tile[index68, index69]; + if (tile.active() && (int) tile.color() != num1) + tupleList.Add(new Tuple(index68, index69)); + } + } + if (tupleList.Count > 0) + { + float num71 = -1f; + Tuple tuple = tupleList[0]; + for (int index70 = 0; index70 < tupleList.Count; ++index70) + { + float num72 = Vector2.Distance(new Vector2((float) tupleList[index70].Item1, (float) tupleList[index70].Item2) * 16f + Vector2.One * 8f, mouse); + if ((double) num71 == -1.0 || (double) num72 < (double) num71) + { + num71 = num72; + tuple = tupleList[index70]; + } + } + if (Collision.InTileBounds(tuple.Item1, tuple.Item2, num6, num8, num7, num9)) + { + fX = tuple.Item1; + fY = tuple.Item2; + } + } + tupleList.Clear(); + } + if ((obj.type == 1100 || obj.type == 1545) && fX == -1 && fY == -1) + { + List> tupleList = new List>(); + for (int index71 = num6; index71 <= num7; ++index71) + { + for (int index72 = num8; index72 <= num9; ++index72) + { + Tile tile = Main.tile[index71, index72]; + if (tile.active() && tile.color() > (byte) 0 || tile.wall > (byte) 0 && tile.wallColor() > (byte) 0) + tupleList.Add(new Tuple(index71, index72)); + } + } + if (tupleList.Count > 0) + { + float num73 = -1f; + Tuple tuple = tupleList[0]; + for (int index73 = 0; index73 < tupleList.Count; ++index73) + { + float num74 = Vector2.Distance(new Vector2((float) tupleList[index73].Item1, (float) tupleList[index73].Item2) * 16f + Vector2.One * 8f, mouse); + if ((double) num73 == -1.0 || (double) num74 < (double) num73) + { + num73 = num74; + tuple = tupleList[index73]; + } + } + if (Collision.InTileBounds(tuple.Item1, tuple.Item2, num6, num8, num7, num9)) + { + fX = tuple.Item1; + fY = tuple.Item2; + } + } + tupleList.Clear(); + } + if (obj.type == 27 && fX == -1 && fY == -1 && num8 > 20) + { + List> tupleList8 = new List>(); + for (int index74 = num6; index74 <= num7; ++index74) + { + for (int endY = num8; endY <= num9; ++endY) + { + Tile tile10 = Main.tile[index74, endY]; + Tile tile11 = Main.tile[index74, endY - 1]; + Tile testTile = Main.tile[index74, endY + 1]; + Tile tile12 = Main.tile[index74 - 1, endY]; + Tile tile13 = Main.tile[index74 + 1, endY]; + Tile tile14 = Main.tile[index74 - 2, endY]; + Tile tile15 = Main.tile[index74 + 2, endY]; + Tile tile16 = Main.tile[index74 - 3, endY]; + Tile tile17 = Main.tile[index74 + 3, endY]; + if ((!tile10.active() || Main.tileCut[(int) tile10.type] || TileID.Sets.BreakableWhenPlacing[(int) tile10.type]) && (!tile11.active() || Main.tileCut[(int) tile11.type] || TileID.Sets.BreakableWhenPlacing[(int) tile11.type]) && (!tile12.active() || tile12.type != (ushort) 20) && (!tile13.active() || tile13.type != (ushort) 20) && (!tile14.active() || tile14.type != (ushort) 20) && (!tile15.active() || tile15.type != (ushort) 20) && (!tile16.active() || tile16.type != (ushort) 20) && (!tile17.active() || tile17.type != (ushort) 20) && testTile.active() && WorldGen.SolidTile2(testTile)) + { + switch (testTile.type) + { + case 2: + case 23: + case 53: + case 109: + case 112: + case 116: + case 147: + case 199: + case 234: + if (tile12.liquid == (byte) 0 && tile10.liquid == (byte) 0 && tile13.liquid == (byte) 0 && WorldGen.EmptyTileCheck(index74 - 2, index74 + 2, endY - 20, endY, 20)) + { + tupleList8.Add(new Tuple(index74, endY)); + continue; + } + continue; + case 60: + if (WorldGen.EmptyTileCheck(index74 - 2, index74 + 2, endY - 20, endY, 20)) + { + tupleList8.Add(new Tuple(index74, endY)); + continue; + } + continue; + default: + continue; + } + } + } + } + List> tupleList9 = new List>(); + for (int index75 = 0; index75 < tupleList8.Count; ++index75) + { + bool flag21 = false; + for (int index76 = -1; index76 < 2; index76 += 2) + { + Tile tile = Main.tile[tupleList8[index75].Item1 + index76, tupleList8[index75].Item2 + 1]; + if (tile.active()) + { + switch (tile.type) + { + case 2: + case 23: + case 53: + case 60: + case 109: + case 112: + case 116: + case 147: + case 199: + case 234: + flag21 = true; + continue; + default: + continue; + } + } + } + if (!flag21) + tupleList9.Add(tupleList8[index75]); + } + for (int index77 = 0; index77 < tupleList9.Count; ++index77) + tupleList8.Remove(tupleList9[index77]); + tupleList9.Clear(); + if (tupleList8.Count > 0) + { + float num75 = -1f; + Tuple tuple = tupleList8[0]; + for (int index78 = 0; index78 < tupleList8.Count; ++index78) + { + float num76 = Vector2.Distance(new Vector2((float) tupleList8[index78].Item1, (float) tupleList8[index78].Item2) * 16f + Vector2.One * 8f, mouse); + if ((double) num75 == -1.0 || (double) num76 < (double) num75) + { + num75 = num76; + tuple = tupleList8[index78]; + } + } + if (Collision.InTileBounds(tuple.Item1, tuple.Item2, num6, num8, num7, num9)) + { + fX = tuple.Item1; + fY = tuple.Item2; + } + } + tupleList8.Clear(); + } + if (obj.type == 205 && fX == -1 && fY == -1) + { + List> tupleList = new List>(); + for (int index79 = num6; index79 <= num7; ++index79) + { + for (int index80 = num8; index80 <= num9; ++index80) + { + Tile tile = Main.tile[index79, index80]; + if (tile.liquid > (byte) 0) + { + int num77 = (int) tile.liquidType(); + int num78 = 0; + for (int index81 = index79 - 1; index81 <= index79 + 1; ++index81) + { + for (int index82 = index80 - 1; index82 <= index80 + 1; ++index82) + { + if ((int) Main.tile[index81, index82].liquidType() == num77) + num78 += (int) Main.tile[index81, index82].liquid; + } + } + if (num78 > 100) + tupleList.Add(new Tuple(index79, index80)); + } + } + } + if (tupleList.Count > 0) + { + float num79 = -1f; + Tuple tuple = tupleList[0]; + for (int index83 = 0; index83 < tupleList.Count; ++index83) + { + float num80 = Vector2.Distance(new Vector2((float) tupleList[index83].Item1, (float) tupleList[index83].Item2) * 16f + Vector2.One * 8f, mouse); + if ((double) num79 == -1.0 || (double) num80 < (double) num79) + { + num79 = num80; + tuple = tupleList[index83]; + } + } + if (Collision.InTileBounds(tuple.Item1, tuple.Item2, num6, num8, num7, num9)) + { + fX = tuple.Item1; + fY = tuple.Item2; + } + } + tupleList.Clear(); + } + if (obj.type == 849 && fX == -1 && fY == -1) + { + List> tupleList = new List>(); + for (int index84 = num6; index84 <= num7; ++index84) + { + for (int index85 = num8; index85 <= num9; ++index85) + { + Tile tile = Main.tile[index84, index85]; + if ((tile.wire() || tile.wire2() || tile.wire3() || tile.wire4()) && !tile.actuator() && tile.active()) + tupleList.Add(new Tuple(index84, index85)); + } + } + if (tupleList.Count > 0) + { + float num81 = -1f; + Tuple tuple = tupleList[0]; + for (int index86 = 0; index86 < tupleList.Count; ++index86) + { + float num82 = Vector2.Distance(new Vector2((float) tupleList[index86].Item1, (float) tupleList[index86].Item2) * 16f + Vector2.One * 8f, mouse); + if ((double) num81 == -1.0 || (double) num82 < (double) num81) + { + num81 = num82; + tuple = tupleList[index86]; + } + } + if (Collision.InTileBounds(tuple.Item1, tuple.Item2, num6, num8, num7, num9)) + { + fX = tuple.Item1; + fY = tuple.Item2; + } + } + tupleList.Clear(); + } + if (obj.createTile == 82 && fX == -1 && fY == -1) + { + int placeStyle = obj.placeStyle; + List> tupleList = new List>(); + for (int index87 = num6; index87 <= num7; ++index87) + { + for (int index88 = num8; index88 <= num9; ++index88) + { + Tile tile18 = Main.tile[index87, index88]; + Tile tile19 = Main.tile[index87, index88 + 1]; + if ((!tile18.active() || TileID.Sets.BreakableWhenPlacing[(int) tile18.type] || Main.tileCut[(int) tile18.type] && tile18.type != (ushort) 82 && tile18.type != (ushort) 83) && tile19.nactive() && !tile19.halfBrick() && tile19.slope() == (byte) 0) + { + switch (placeStyle) + { + case 0: + if (tile19.type != (ushort) 78 && tile19.type != (ushort) 380 && tile19.type != (ushort) 2 && tile19.type != (ushort) 109 || tile18.liquid > (byte) 0) + continue; + break; + case 1: + if (tile19.type != (ushort) 78 && tile19.type != (ushort) 380 && tile19.type != (ushort) 60 || tile18.liquid > (byte) 0) + continue; + break; + case 2: + if (tile19.type != (ushort) 78 && tile19.type != (ushort) 380 && tile19.type != (ushort) 0 && tile19.type != (ushort) 59 || tile18.liquid > (byte) 0) + continue; + break; + case 3: + if (tile19.type != (ushort) 78 && tile19.type != (ushort) 380 && tile19.type != (ushort) 203 && tile19.type != (ushort) 199 && tile19.type != (ushort) 23 && tile19.type != (ushort) 25 || tile18.liquid > (byte) 0) + continue; + break; + case 4: + if (tile19.type != (ushort) 78 && tile19.type != (ushort) 380 && tile19.type != (ushort) 53 && tile19.type != (ushort) 116 || tile18.liquid > (byte) 0 && tile18.lava()) + continue; + break; + case 5: + if (tile19.type != (ushort) 78 && tile19.type != (ushort) 380 && tile19.type != (ushort) 57 || tile18.liquid > (byte) 0 && !tile18.lava()) + continue; + break; + case 6: + if (tile19.type != (ushort) 78 && tile19.type != (ushort) 380 && tile19.type != (ushort) 147 && tile19.type != (ushort) 161 && tile19.type != (ushort) 163 && tile19.type != (ushort) 164 && tile19.type != (ushort) 200 || tile18.liquid > (byte) 0 && tile18.lava()) + continue; + break; + } + tupleList.Add(new Tuple(index87, index88)); + } + } + } + if (tupleList.Count > 0) + { + float num83 = -1f; + Tuple tuple = tupleList[0]; + for (int index89 = 0; index89 < tupleList.Count; ++index89) + { + float num84 = Vector2.Distance(new Vector2((float) tupleList[index89].Item1, (float) tupleList[index89].Item2) * 16f + Vector2.One * 8f, mouse); + if ((double) num83 == -1.0 || (double) num84 < (double) num83) + { + num83 = num84; + tuple = tupleList[index89]; + } + } + if (Collision.InTileBounds(tuple.Item1, tuple.Item2, num6, num8, num7, num9)) + { + fX = tuple.Item1; + fY = tuple.Item2; + } + } + tupleList.Clear(); + } + if (obj.createTile == 380 && fX == -1 && fY == -1) + { + List> tupleList = new List>(); + bool flag22 = false; + if (Main.tile[index1, index2].active() && Main.tile[index1, index2].type == (ushort) 380) + flag22 = true; + if (!flag22) + { + for (int index90 = num6; index90 <= num7; ++index90) + { + for (int index91 = num8; index91 <= num9; ++index91) + { + Tile tile = Main.tile[index90, index91]; + if (tile.active() && tile.type == (ushort) 380) + { + if (!Main.tile[index90 - 1, index91].active() || Main.tileCut[(int) Main.tile[index90 - 1, index91].type] || TileID.Sets.BreakableWhenPlacing[(int) Main.tile[index90 - 1, index91].type]) + tupleList.Add(new Tuple(index90 - 1, index91)); + if (!Main.tile[index90 + 1, index91].active() || Main.tileCut[(int) Main.tile[index90 + 1, index91].type] || TileID.Sets.BreakableWhenPlacing[(int) Main.tile[index90 + 1, index91].type]) + tupleList.Add(new Tuple(index90 + 1, index91)); + } + } + } + } + if (tupleList.Count > 0) + { + float num85 = -1f; + Tuple tuple = tupleList[0]; + for (int index92 = 0; index92 < tupleList.Count; ++index92) + { + float num86 = Vector2.Distance(new Vector2((float) tupleList[index92].Item1, (float) tupleList[index92].Item2) * 16f + Vector2.One * 8f, mouse); + if ((double) num85 == -1.0 || (double) num86 < (double) num85) + { + num85 = num86; + tuple = tupleList[index92]; + } + } + if (Collision.InTileBounds(tuple.Item1, tuple.Item2, num6, num8, num7, num9) && (double) num85 != -1.0) + { + fX = tuple.Item1; + fY = tuple.Item2; + } + } + tupleList.Clear(); + } + if (obj.createTile == 78 && fX == -1 && fY == -1) + { + List> tupleList = new List>(); + bool flag23 = false; + if (Main.tile[index1, index2].active()) + flag23 = true; + if (!Collision.InTileBounds(index1, index2, num6, num8, num7, num9)) + flag23 = true; + if (!flag23) + { + for (int index93 = num6; index93 <= num7; ++index93) + { + for (int index94 = num8; index94 <= num9; ++index94) + { + Tile tile20 = Main.tile[index93, index94]; + Tile tile21 = Main.tile[index93, index94 + 1]; + if ((!tile20.active() || Main.tileCut[(int) tile20.type] || TileID.Sets.BreakableWhenPlacing[(int) tile20.type]) && tile21.nactive() && !tile21.halfBrick() && tile21.slope() == (byte) 0 && Main.tileSolid[(int) tile21.type]) + tupleList.Add(new Tuple(index93, index94)); + } + } + } + if (tupleList.Count > 0) + { + float num87 = -1f; + Tuple tuple = tupleList[0]; + for (int index95 = 0; index95 < tupleList.Count; ++index95) + { + if (Collision.EmptyTile(tupleList[index95].Item1, tupleList[index95].Item2, true)) + { + float num88 = Vector2.Distance(new Vector2((float) tupleList[index95].Item1, (float) tupleList[index95].Item2) * 16f + Vector2.One * 8f, mouse); + if ((double) num87 == -1.0 || (double) num88 < (double) num87) + { + num87 = num88; + tuple = tupleList[index95]; + } + } + } + if (Collision.InTileBounds(tuple.Item1, tuple.Item2, num6, num8, num7, num9) && (double) num87 != -1.0) + { + fX = tuple.Item1; + fY = tuple.Item2; + } + } + tupleList.Clear(); + } + if (obj.type == 213 && fX == -1 && fY == -1) + { + List> tupleList = new List>(); + for (int index96 = num6; index96 <= num7; ++index96) + { + for (int index97 = num8; index97 <= num9; ++index97) + { + Tile tile = Main.tile[index96, index97]; + bool flag24 = !Main.tile[index96 - 1, index97].active() || !Main.tile[index96, index97 + 1].active() || !Main.tile[index96 + 1, index97].active() || !Main.tile[index96, index97 - 1].active(); + bool flag25 = !Main.tile[index96 - 1, index97 - 1].active() || !Main.tile[index96 - 1, index97 + 1].active() || !Main.tile[index96 + 1, index97 + 1].active() || !Main.tile[index96 + 1, index97 - 1].active(); + if (tile.active() && !tile.inActive() && (tile.type == (ushort) 0 || tile.type == (ushort) 1) && (flag24 || tile.type == (ushort) 0 & flag25)) + tupleList.Add(new Tuple(index96, index97)); + } + } + if (tupleList.Count > 0) + { + float num89 = -1f; + Tuple tuple = tupleList[0]; + for (int index98 = 0; index98 < tupleList.Count; ++index98) + { + float num90 = Vector2.Distance(new Vector2((float) tupleList[index98].Item1, (float) tupleList[index98].Item2) * 16f + Vector2.One * 8f, mouse); + if ((double) num89 == -1.0 || (double) num90 < (double) num89) + { + num89 = num90; + tuple = tupleList[index98]; + } + } + if (Collision.InTileBounds(tuple.Item1, tuple.Item2, num6, num8, num7, num9)) + { + fX = tuple.Item1; + fY = tuple.Item2; + } + } + tupleList.Clear(); + } + if (fX != -1 && fY != -1) + { + Main.SmartCursorX = Player.tileTargetX = fX; + Main.SmartCursorY = Player.tileTargetY = fY; + Main.SmartCursorShowing = true; + } + ignoreTargets.Clear(); + } public void SmartInteractLookup() { - Main.ClearSmartInteract(); + if (this.whoAmI != Main.myPlayer) + return; + Main.SmartInteractShowingGenuine = false; + Main.SmartInteractShowingFake = false; + Main.SmartInteractNPC = -1; + Main.SmartInteractNPCsNearby.Clear(); + Main.SmartInteractTileCoords.Clear(); + Main.SmartInteractTileCoordsSelected.Clear(); + int num1; + Main.TileInteractionHY = num1 = -1; + Main.TileInteractionLY = num1; + Main.TileInteractionHX = num1; + Main.TileInteractionLX = num1; + bool smartCursorEnabled = Main.SmartCursorEnabled; + if (!smartCursorEnabled && !PlayerInput.UsingGamepad) + return; + Item obj = this.inventory[this.selectedItem]; + Vector2 vector2 = Main.screenPosition + new Vector2((float) Main.mouseX, (float) Main.mouseY); + if ((double) this.gravDir == -1.0) + vector2.Y = Main.screenPosition.Y + (float) Main.screenHeight - (float) Main.mouseY; + int index1 = Player.tileTargetX; + int index2 = Player.tileTargetY; + if (index1 < 10) + index1 = 10; + if (index1 > Main.maxTilesX - 10) + index1 = Main.maxTilesX - 10; + if (index2 < 10) + index2 = 10; + if (index2 > Main.maxTilesY - 10) + index2 = Main.maxTilesY - 10; + bool flag1 = false; + if (Main.tile[index1, index2] == null) + return; + if (Main.tile[index1, index2].active()) + { + switch (Main.tile[index1, index2].type) + { + case 4: + case 33: + case 334: + case 395: + case 410: + case 455: + flag1 = true; + break; + } + } + if (flag1) + return; + int num2 = 0; + int num3 = (int) ((double) this.position.X / 16.0) - Player.tileRangeX - num2 + 1; + int num4 = (int) (((double) this.position.X + (double) this.width) / 16.0) + Player.tileRangeX + num2 - 1; + int num5 = (int) ((double) this.position.Y / 16.0) - Player.tileRangeY - num2 + 1; + int num6 = (int) (((double) this.position.Y + (double) this.height) / 16.0) + Player.tileRangeY + num2 - 2; + int lx1 = Utils.Clamp(num3, 10, Main.maxTilesX - 10); + int hx = Utils.Clamp(num4, 10, Main.maxTilesX - 10); + int ly1 = Utils.Clamp(num5, 10, Main.maxTilesY - 10); + int hy = Utils.Clamp(num6, 10, Main.maxTilesY - 10); + List> tupleList1 = new List>(); + for (int index3 = 0; index3 < this.grapCount; ++index3) + { + Projectile projectile = Main.projectile[this.grappling[index3]]; + int num7 = (int) projectile.Center.X / 16; + int num8 = (int) projectile.Center.Y / 16; + tupleList1.Add(new Tuple(num7, num8)); + } + int x1 = -1; + int y1 = -1; + int index4 = -1; + Vector2 point1 = Main.ReverseGravitySupport(Main.MouseScreen) + Main.screenPosition; + if (x1 == -1 && y1 == -1) + { + List> tupleList2 = new List>(); + for (int index5 = lx1; index5 <= hx; ++index5) + { + for (int index6 = ly1; index6 <= hy; ++index6) + { + Tile tile = Main.tile[index5, index6]; + if (tile.active()) + { + ushort type = tile.type; + if (type <= (ushort) 209) + { + if (type <= (ushort) 97) + { + if (type <= (ushort) 55) + { + if (type <= (ushort) 21) + { + if ((uint) type - 10U > 1U && type != (ushort) 21) + continue; + } + else if (type != (ushort) 29 && type != (ushort) 55) + continue; + } + else if (type <= (ushort) 85) + { + if (type != (ushort) 79 && type != (ushort) 85) + continue; + } + else if (type != (ushort) 88 && type != (ushort) 97) + continue; + } + else if (type <= (ushort) 136) + { + if (type <= (ushort) 125) + { + if (type != (ushort) 104 && type != (ushort) 125) + continue; + } + else if (type != (ushort) 132 && type != (ushort) 136) + continue; + } + else if (type <= (ushort) 144) + { + if (type != (ushort) 139 && type != (ushort) 144) + continue; + } + else if (type != (ushort) 207 && type != (ushort) 209) + continue; + } + else if (type <= (ushort) 356) + { + if (type <= (ushort) 287) + { + if (type <= (ushort) 216) + { + if (type != (ushort) 212) + { + if ((uint) type - 215U > 1U) + continue; + } + else + { + if (this.HasItem(949)) + { + tupleList2.Add(new Tuple(index5, index6)); + continue; + } + continue; + } + } + else if (type != (ushort) 237) + { + if (type != (ushort) 287) + continue; + } + else + { + if (this.HasItem(1293)) + { + tupleList2.Add(new Tuple(index5, index6)); + continue; + } + continue; + } + } + else if (type <= (ushort) 338) + { + if (type != (ushort) 335 && type != (ushort) 338) + continue; + } + else if (type != (ushort) 354) + { + if (type == (ushort) 356 && !Main.fastForwardTime && (Main.netMode == 1 || Main.sundialCooldown == 0)) + { + tupleList2.Add(new Tuple(index5, index6)); + continue; + } + continue; + } + } + else if (type <= (ushort) 425) + { + if (type <= (ushort) 389) + { + if (type != (ushort) 377 && (uint) type - 386U > 3U) + continue; + } + else if ((uint) type - 410U > 1U && type != (ushort) 425) + continue; + } + else if (type <= (ushort) 455) + { + if (type != (ushort) 441 && type != (ushort) 455) + continue; + } + else if (type != (ushort) 463 && (uint) type - 467U > 1U) + continue; + tupleList2.Add(new Tuple(index5, index6)); + } + } + } + if (tupleList2.Count > 0) + { + float num9 = -1f; + Tuple tuple = tupleList2[0]; + for (int index7 = 0; index7 < tupleList2.Count; ++index7) + { + float num10 = Vector2.Distance(new Vector2((float) tupleList2[index7].Item1, (float) tupleList2[index7].Item2) * 16f + Vector2.One * 8f, vector2); + if ((double) num9 == -1.0 || (double) num10 < (double) num9) + { + num9 = num10; + tuple = tupleList2[index7]; + } + } + if (Collision.InTileBounds(tuple.Item1, tuple.Item2, lx1, ly1, hx, hy)) + { + x1 = tuple.Item1; + y1 = tuple.Item2; + } + } + bool flag2 = false; + for (int index8 = 0; index8 < tupleList2.Count; ++index8) + { + int index9 = tupleList2[index8].Item1; + int index10 = tupleList2[index8].Item2; + Tile tile = Main.tile[index9, index10]; + int num11 = 0; + int num12 = 0; + int num13 = 18; + int num14 = 18; + int num15 = 0; + int num16 = 2; + switch (tile.type) + { + case 10: + num11 = 1; + num12 = 3; + num16 = 0; + break; + case 11: + case 356: + case 410: + num11 = 2; + num12 = 3; + num16 = 0; + break; + case 21: + case 55: + case 85: + case 97: + case 125: + case 132: + case 287: + case 335: + case 386: + case 411: + case 425: + case 441: + case 467: + case 468: + num11 = 2; + num12 = 2; + break; + case 29: + case 387: + num11 = 2; + num12 = 1; + break; + case 79: + num11 = 4; + num12 = 2; + num16 = 0; + break; + case 88: + num11 = 3; + num12 = 1; + num16 = 0; + break; + case 104: + num11 = 2; + num12 = 5; + break; + case 136: + case 144: + num11 = 1; + num12 = 1; + num16 = 0; + break; + case 139: + num11 = 2; + num12 = 2; + num16 = 0; + break; + case 207: + num11 = 2; + num12 = 4; + num16 = 0; + break; + case 209: + num11 = 4; + num12 = 3; + num16 = 0; + break; + case 212: + num11 = 4; + num12 = 3; + break; + case 215: + case 237: + case 377: + num11 = 3; + num12 = 2; + break; + case 216: + case 338: + num11 = 1; + num12 = 2; + break; + case 354: + case 455: + num11 = 3; + num12 = 3; + num16 = 0; + break; + case 388: + case 389: + num11 = 1; + num12 = 5; + break; + case 463: + num11 = 3; + num12 = 4; + break; + } + if (num11 != 0 && num12 != 0) + { + int lx2 = index9 - (int) tile.frameX % (num13 * num11 + num15) / num13; + int ly2 = index10 - (int) tile.frameY % (num14 * num12 + num16) / num14; + bool flag3 = Collision.InTileBounds(x1, y1, lx2, ly2, lx2 + num11 - 1, ly2 + num12 - 1); + if (!smartCursorEnabled) + flag3 = flag3 && Collision.InTileBounds((int) vector2.X / 16, (int) vector2.Y / 16, lx2, ly2, lx2 + num11 - 1, ly2 + num12 - 1); + if (flag2) + flag3 = false; + if (!flag2 & flag3) + flag2 = true; + for (int x2 = lx2; x2 < lx2 + num11; ++x2) + { + for (int y2 = ly2; y2 < ly2 + num12; ++y2) + { + Point point2 = new Point(x2, y2); + if (!Main.SmartInteractTileCoords.Contains(point2)) + { + if (flag3) + Main.SmartInteractTileCoordsSelected.Add(point2); + if (flag3 | smartCursorEnabled) + Main.SmartInteractTileCoords.Add(point2); + } + } + } + } + } + tupleList2.Clear(); + } + if (index4 == -1 & smartCursorEnabled) + { + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(lx1 * 16, ly1 * 16, (hx - lx1) * 16 + 16, (hy - ly1) * 16 + 16); + bool flag4 = false; + for (int index11 = 0; index11 < 200; ++index11) + { + NPC npc = Main.npc[index11]; + if (npc.active && npc.townNPC && npc.Hitbox.Intersects(rectangle)) + { + Main.SmartInteractNPCsNearby.Add(index11); + if (!flag4) + { + float num17 = npc.Hitbox.Distance(point1); + if ((index4 == -1 ? 1 : ((double) Main.npc[index4].Hitbox.Distance(point1) > (double) num17 ? 1 : 0)) != 0) + index4 = index11; + if ((double) num17 == 0.0) + { + flag4 = true; + index4 = index11; + break; + } + } + } + } + if (flag4) + { + x1 = y1 = -1; + Main.SmartInteractTileCoordsSelected.Clear(); + } + } + if (x1 != -1 && y1 != -1 && index4 != -1) + { + Microsoft.Xna.Framework.Rectangle r = new Microsoft.Xna.Framework.Rectangle(x1 * 16, y1 * 16, 16, 16); + Microsoft.Xna.Framework.Rectangle hitbox = Main.npc[index4].Hitbox; + Vector2 point3 = point1; + if ((double) r.Distance(point3) < (double) hitbox.Distance(point1)) + { + index4 = -1; + } + else + { + x1 = y1 = -1; + Main.SmartInteractTileCoordsSelected.Clear(); + } + } if (UILinkPointNavigator.InUse || PlayerInput.UsingGamepad && Main.HoveringOverAnNPC) Main.SmartInteractTileCoordsSelected.Clear(); - bool flag = PlayerInput.UsingGamepad || Main.SmartCursorEnabled; - if (!flag && !PlayerInput.UsingGamepad) - return; - Vector2 mousevec; - int LX; - int HX; - int LY; - int HY; - this.SmartInteractLookup_PrepareCommonlyUsedInfo(out mousevec, out LX, out HX, out LY, out HY); - Player._smartInteractSys.RunQuery(new SmartInteractScanSettings() + if (PlayerInput.UsingGamepad && !Main.SmartCursorEnabled) { - DemandOnlyZeroDistanceTargets = PlayerInput.UsingGamepad && !Main.SmartCursorEnabled, - FullInteraction = flag, - HX = HX, - HY = HY, - LX = LX, - LY = LY, - mousevec = mousevec, - player = this - }); + if (x1 != -1 && y1 != -1) + { + Main.TileInteractionLX = lx1 - 10; + Main.TileInteractionLY = ly1 - 10; + Main.TileInteractionHX = hx + 10; + Main.TileInteractionHY = hy + 10; + Main.SmartInteractShowingFake = Main.SmartInteractTileCoords.Count > 0; + } + } + else + { + if (x1 != -1 && y1 != -1) + { + Main.SmartInteractX = x1; + Main.SmartInteractY = y1; + Main.SmartInteractShowingGenuine = true; + Main.TileInteractionLX = lx1 - 10; + Main.TileInteractionLY = ly1 - 10; + Main.TileInteractionHX = hx + 10; + Main.TileInteractionHY = hy + 10; + } + if (index4 != -1) + { + Main.SmartInteractNPC = index4; + Main.SmartInteractShowingGenuine = true; + } + } + tupleList1.Clear(); } - private void SmartInteractLookup_PrepareCommonlyUsedInfo( - out Vector2 mousevec, - out int LX, - out int HX, - out int LY, - out int HY) + private static void SmartCursor_Axe( + Item item, + ref Vector2 mouse, + int LX, + int HX, + int LY, + int HY, + ref int fX, + ref int fY) { - mousevec = Main.ReverseGravitySupport(Main.MouseScreen) + Main.screenPosition; - int num = 0; - LX = (int) ((double) this.position.X / 16.0) - Player.tileRangeX - num + 1; - HX = (int) (((double) this.position.X + (double) this.width) / 16.0) + Player.tileRangeX + num - 1; - LY = (int) ((double) this.position.Y / 16.0) - Player.tileRangeY - num + 1; - HY = (int) (((double) this.position.Y + (double) this.height) / 16.0) + Player.tileRangeY + num - 2; - LX = Utils.Clamp(LX, 10, Main.maxTilesX - 10); - HX = Utils.Clamp(HX, 10, Main.maxTilesX - 10); - LY = Utils.Clamp(LY, 10, Main.maxTilesY - 10); - HY = Utils.Clamp(HY, 10, Main.maxTilesY - 10); + if (item.axe <= 0 || fX != -1 || fY != -1) + return; + float num1 = -1f; + for (int index1 = LX; index1 <= HX; ++index1) + { + for (int index2 = LY; index2 <= HY; ++index2) + { + if (Main.tile[index1, index2].active()) + { + Tile tile = Main.tile[index1, index2]; + if (Main.tileAxe[(int) tile.type]) + { + int x = index1; + int y = index2; + if (tile.type == (ushort) 5) + { + if (Collision.InTileBounds(x + 1, y, LX, LY, HX, HY)) + { + if (Main.tile[x, y].frameY >= (short) 198 && Main.tile[x, y].frameX == (short) 44) + ++x; + if (Main.tile[x, y].frameX == (short) 66 && Main.tile[x, y].frameY <= (short) 44) + ++x; + if (Main.tile[x, y].frameX == (short) 44 && Main.tile[x, y].frameY >= (short) 132 && Main.tile[x, y].frameY <= (short) 176) + ++x; + } + if (Collision.InTileBounds(x - 1, y, LX, LY, HX, HY)) + { + if (Main.tile[x, y].frameY >= (short) 198 && Main.tile[x, y].frameX == (short) 66) + --x; + if (Main.tile[x, y].frameX == (short) 88 && Main.tile[x, y].frameY >= (short) 66 && Main.tile[x, y].frameY <= (short) 110) + --x; + if (Main.tile[x, y].frameX == (short) 22 && Main.tile[x, y].frameY >= (short) 132 && Main.tile[x, y].frameY <= (short) 176) + --x; + } + while (Main.tile[x, y].active() && Main.tile[x, y].type == (ushort) 5 && Main.tile[x, y + 1].type == (ushort) 5 && Collision.InTileBounds(x, y + 1, LX, LY, HX, HY)) + ++y; + } + if (tile.type == (ushort) 80) + { + if (Collision.InTileBounds(x + 1, y, LX, LY, HX, HY)) + { + if (Main.tile[x, y].frameX == (short) 54) + ++x; + if (Main.tile[x, y].frameX == (short) 108 && Main.tile[x, y].frameY == (short) 36) + ++x; + } + if (Collision.InTileBounds(x - 1, y, LX, LY, HX, HY)) + { + if (Main.tile[x, y].frameX == (short) 36) + --x; + if (Main.tile[x, y].frameX == (short) 108 && Main.tile[x, y].frameY == (short) 18) + --x; + } + while (Main.tile[x, y].active() && Main.tile[x, y].type == (ushort) 80 && Main.tile[x, y + 1].type == (ushort) 80 && Collision.InTileBounds(x, y + 1, LX, LY, HX, HY)) + ++y; + } + if (tile.type == (ushort) 323 || tile.type == (ushort) 72) + { + while (Main.tile[x, y].active() && (Main.tile[x, y].type == (ushort) 323 && Main.tile[x, y + 1].type == (ushort) 323 || Main.tile[x, y].type == (ushort) 72 && Main.tile[x, y + 1].type == (ushort) 72) && Collision.InTileBounds(x, y + 1, LX, LY, HX, HY)) + ++y; + } + float num2 = Vector2.Distance(new Vector2((float) x, (float) y) * 16f + Vector2.One * 8f, mouse); + if ((double) num1 == -1.0 || (double) num2 < (double) num1) + { + num1 = num2; + fX = x; + fY = y; + } + } + } + } + } + } + + private static void SmartCursor_Filling( + Item item, + ref Vector2 mouse, + int LX, + int HX, + int LY, + int HY, + ref int fX, + ref int fY, + int tX, + int tY) + { + if (Player.SmartCursorSettings.SmartBlocksEnabled || item.createTile <= -1 || item.type == 213 || !Main.tileSolid[item.createTile] || Main.tileSolidTop[item.createTile] || Main.tileFrameImportant[item.createTile] || fX != -1 || fY != -1) + return; + List> tupleList = new List>(); + bool flag1 = false; + if (Main.tile[tX, tY].active()) + flag1 = true; + if (!Collision.InTileBounds(tX, tY, LX, LY, HX, HY)) + flag1 = true; + if (!flag1) + { + for (int index1 = LX; index1 <= HX; ++index1) + { + for (int index2 = LY; index2 <= HY; ++index2) + { + Tile tile = Main.tile[index1, index2]; + if (!tile.active() || Main.tileCut[(int) tile.type] || TileID.Sets.BreakableWhenPlacing[(int) tile.type]) + { + int num = 0; + if (Main.tile[index1 - 1, index2].active() && Main.tileSolid[(int) Main.tile[index1 - 1, index2].type] && !Main.tileSolidTop[(int) Main.tile[index1 - 1, index2].type]) + ++num; + if (Main.tile[index1 + 1, index2].active() && Main.tileSolid[(int) Main.tile[index1 + 1, index2].type] && !Main.tileSolidTop[(int) Main.tile[index1 + 1, index2].type]) + ++num; + if (Main.tile[index1, index2 - 1].active() && Main.tileSolid[(int) Main.tile[index1, index2 - 1].type] && !Main.tileSolidTop[(int) Main.tile[index1, index2 - 1].type]) + ++num; + if (Main.tile[index1, index2 + 1].active() && Main.tileSolid[(int) Main.tile[index1, index2 + 1].type] && !Main.tileSolidTop[(int) Main.tile[index1, index2 + 1].type]) + ++num; + if (num >= 2) + tupleList.Add(new Tuple(index1, index2)); + } + } + } + } + if (tupleList.Count > 0) + { + float num1 = -1f; + float num2 = float.PositiveInfinity; + Tuple tuple = tupleList[0]; + for (int index = 0; index < tupleList.Count; ++index) + { + if (Collision.EmptyTile(tupleList[index].Item1, tupleList[index].Item2, true)) + { + Vector2 vector2 = new Vector2((float) tupleList[index].Item1, (float) tupleList[index].Item2) * 16f + Vector2.One * 8f - mouse; + bool flag2 = false; + float num3 = Math.Abs(vector2.X); + float num4 = vector2.Length(); + if ((double) num3 < (double) num2) + flag2 = true; + if ((double) num3 == (double) num2 && ((double) num1 == -1.0 || (double) num4 < (double) num1)) + flag2 = true; + if (flag2) + { + num1 = num4; + num2 = num3; + tuple = tupleList[index]; + } + } + } + if (Collision.InTileBounds(tuple.Item1, tuple.Item2, LX, LY, HX, HY) && (double) num1 != -1.0) + { + fX = tuple.Item1; + fY = tuple.Item2; + } + } + tupleList.Clear(); + } + + private static void SmartCursor_Torch( + Item item, + ref Vector2 mouse, + int LX, + int HX, + int LY, + int HY, + ref int fX, + ref int fY, + int tX, + int tY) + { + if (item.createTile != 4 || fX != -1 || fY != -1) + return; + List> tupleList = new List>(); + bool flag1 = item.type != 1333 && item.type != 523; + for (int index1 = LX; index1 <= HX; ++index1) + { + for (int index2 = LY; index2 <= HY; ++index2) + { + Tile tile1 = Main.tile[index1, index2]; + Tile tile2 = Main.tile[index1 - 1, index2]; + Tile tile3 = Main.tile[index1 + 1, index2]; + Tile tile4 = Main.tile[index1, index2 + 1]; + if (!tile1.active() || TileID.Sets.BreakableWhenPlacing[(int) tile1.type] || Main.tileCut[(int) tile1.type] && tile1.type != (ushort) 82 && tile1.type != (ushort) 83) + { + bool flag2 = false; + for (int index3 = index1 - 7; index3 <= index1 + 7; ++index3) + { + for (int index4 = index2 - 7; index4 <= index2 + 7; ++index4) + { + if (Main.tile[index3, index4] != null && Main.tile[index3, index4].type == (ushort) 4) + { + flag2 = true; + break; + } + } + if (flag2) + break; + } + if (!flag2 && (!flag1 || tile1.liquid <= (byte) 0) && (tile1.wall > (byte) 0 || tile2.active() && (tile2.slope() == (byte) 0 || (int) tile2.slope() % 2 != 1) && (Main.tileSolid[(int) tile2.type] && !Main.tileNoAttach[(int) tile2.type] && !Main.tileSolidTop[(int) tile2.type] && !TileID.Sets.NotReallySolid[(int) tile2.type] || tile2.type == (ushort) 124 || tile2.type == (ushort) 5 && Main.tile[index1 - 1, index2 - 1].type == (ushort) 5 && Main.tile[index1 - 1, index2 + 1].type == (ushort) 5) || tile3.active() && (tile3.slope() == (byte) 0 || (int) tile3.slope() % 2 != 0) && (Main.tileSolid[(int) tile3.type] && !Main.tileNoAttach[(int) tile3.type] && !Main.tileSolidTop[(int) tile3.type] && !TileID.Sets.NotReallySolid[(int) tile3.type] || tile3.type == (ushort) 124 || tile3.type == (ushort) 5 && Main.tile[index1 + 1, index2 - 1].type == (ushort) 5 && Main.tile[index1 + 1, index2 + 1].type == (ushort) 5) || tile4.active() && Main.tileSolid[(int) tile4.type] && !Main.tileNoAttach[(int) tile4.type] && (!Main.tileSolidTop[(int) tile4.type] || TileID.Sets.Platforms[(int) tile4.type] && tile4.slope() == (byte) 0) && !TileID.Sets.NotReallySolid[(int) tile4.type] && !tile4.halfBrick() && tile4.slope() == (byte) 0) && tile1.type != (ushort) 4) + tupleList.Add(new Tuple(index1, index2)); + } + } + } + if (tupleList.Count > 0) + { + float num1 = -1f; + Tuple tuple = tupleList[0]; + for (int index = 0; index < tupleList.Count; ++index) + { + float num2 = Vector2.Distance(new Vector2((float) tupleList[index].Item1, (float) tupleList[index].Item2) * 16f + Vector2.One * 8f, mouse); + if ((double) num1 == -1.0 || (double) num2 < (double) num1) + { + num1 = num2; + tuple = tupleList[index]; + } + } + if (Collision.InTileBounds(tuple.Item1, tuple.Item2, LX, LY, HX, HY)) + { + fX = tuple.Item1; + fY = tuple.Item2; + } + } + tupleList.Clear(); } public void SmartSelectLookup() { - if (this.mouseInterface) - this.controlTorch = false; if (this.controlTorch && this.itemAnimation == 0) { - int tX; - int tY; - PlayerInput.smartSelectPointer.SmartSelectLookup_GetTargetTile(this, out tX, out tY); - int toolStrategy; - bool wetTile; - this.SmartSelect_GetToolStrategy(tX, tY, out toolStrategy, out wetTile); - if (PlayerInput.UsingGamepad && this._lastSmartCursorToolStrategy != -1) - toolStrategy = this._lastSmartCursorToolStrategy; - if (toolStrategy == 0 || toolStrategy == 4) + int num1 = 0; + int index1 = (int) (((double) Main.mouseX + (double) Main.screenPosition.X) / 16.0); + int index2 = (int) (((double) Main.mouseY + (double) Main.screenPosition.Y) / 16.0); + if ((double) this.gravDir == -1.0) + index2 = (int) (((double) Main.screenPosition.Y + (double) Main.screenHeight - (double) Main.mouseY) / 16.0); + int num2 = -10; + int num3 = -10; + int num4 = -10; + int num5 = -10; + int num6 = -10; + for (int index3 = 0; index3 < 50; ++index3) { - double num1 = (double) Math.Abs((float) ((double) Main.mouseX + (double) Main.screenPosition.X - ((double) this.position.X + (double) (this.width / 2)))); - float num2 = Math.Abs((float) ((double) Main.mouseY + (double) Main.screenPosition.Y - ((double) this.position.Y + (double) (this.height / 2)))) * 1.3f; - if (Math.Sqrt(num1 * num1 + (double) num2 * (double) num2) > 200.0) - toolStrategy = 5; + if (this.inventory[index3].pick > 0 && num2 == -10) + num2 = this.inventory[index3].tileBoost; + if (this.inventory[index3].axe > 0 && num3 == -10) + num3 = this.inventory[index3].tileBoost; + if (this.inventory[index3].hammer > 0 && num4 == -10) + num4 = this.inventory[index3].tileBoost; + if ((this.inventory[index3].type == 929 || this.inventory[index3].type == 1338 || this.inventory[index3].type == 1345) && num5 == -10) + num5 = this.inventory[index3].tileBoost; + if ((this.inventory[index3].type == 424 || this.inventory[index3].type == 1103) && num6 == -10) + num6 = this.inventory[index3].tileBoost; + } + int num7 = 0; + int num8 = 0; + if ((double) this.position.X / 16.0 >= (double) index1) + num7 = (int) ((double) this.position.X / 16.0) - index1; + if (((double) this.position.X + (double) this.width) / 16.0 <= (double) index1) + num7 = index1 - (int) (((double) this.position.X + (double) this.width) / 16.0); + if ((double) this.position.Y / 16.0 >= (double) index2) + num8 = (int) ((double) this.position.Y / 16.0) - index2; + if (((double) this.position.Y + (double) this.height) / 16.0 <= (double) index2) + num8 = index2 - (int) (((double) this.position.Y + (double) this.height) / 16.0); + bool flag1 = false; + bool flag2 = false; + try + { + flag2 = Main.tile[index1, index2].liquid > (byte) 0; + if (Main.tile[index1, index2].active()) + { + int type = (int) Main.tile[index1, index2].type; + if (type == 219 && num7 <= num6 + Player.tileRangeX && num8 <= num6 + Player.tileRangeY) + { + num1 = 7; + flag1 = true; + } + else if (type == 209 && num7 <= num5 + Player.tileRangeX && num8 <= num5 + Player.tileRangeY) + { + num1 = 6; + flag1 = true; + } + else if (Main.tileHammer[type] && num7 <= num4 + Player.tileRangeX && num8 <= num4 + Player.tileRangeY) + { + num1 = 1; + flag1 = true; + } + else if (Main.tileAxe[type] && num7 <= num3 + Player.tileRangeX && num8 <= num3 + Player.tileRangeY) + { + num1 = 2; + flag1 = true; + } + else if (num7 <= num2 + Player.tileRangeX) + { + if (num8 <= num2 + Player.tileRangeY) + { + num1 = 3; + flag1 = true; + } + } + } + else if (flag2) + { + if (this.wet) + { + num1 = 4; + flag1 = true; + } + } + } + catch + { + } + if (!flag1 && this.wet) + num1 = 4; + if (num1 == 0 || num1 == 4) + { + double num9 = (double) Math.Abs((float) ((double) Main.mouseX + (double) Main.screenPosition.X - ((double) this.position.X + (double) (this.width / 2)))); + float num10 = Math.Abs((float) ((double) Main.mouseY + (double) Main.screenPosition.Y - ((double) this.position.Y + (double) (this.height / 2)))) * 1.3f; + if (Math.Sqrt(num9 * num9 + (double) num10 * (double) num10) > 200.0) + num1 = 5; + } + for (int index4 = 0; index4 < 50; ++index4) + { + int type = this.inventory[index4].type; + switch (num1) + { + case 0: + switch (type) + { + case 8: + case 427: + case 428: + case 429: + case 430: + case 431: + case 432: + case 433: + case 523: + case 974: + case 1245: + case 1333: + case 2274: + case 3004: + case 3045: + case 3114: + if (this.nonTorch == -1) + this.nonTorch = this.selectedItem; + this.selectedItem = index4; + return; + case 282: + case 286: + case 3002: + case 3112: + if (this.nonTorch == -1) + this.nonTorch = this.selectedItem; + this.selectedItem = index4; + continue; + default: + continue; + } + case 1: + if (this.inventory[index4].hammer > 0) + { + if (this.nonTorch == -1) + this.nonTorch = this.selectedItem; + this.selectedItem = index4; + return; + } + break; + case 2: + if (this.inventory[index4].axe > 0) + { + if (this.nonTorch == -1) + this.nonTorch = this.selectedItem; + this.selectedItem = index4; + return; + } + break; + case 3: + if (this.inventory[index4].pick > 0) + { + if (this.nonTorch == -1) + this.nonTorch = this.selectedItem; + this.selectedItem = index4; + return; + } + break; + case 4: + if (this.inventory[index4].type != 282 && this.inventory[index4].type != 286 && this.inventory[index4].type != 3002 && this.inventory[index4].type != 3112 && this.inventory[index4].type != 930 && (type == 8 || type == 427 || type == 428 || type == 429 || type == 430 || type == 431 || type == 432 || type == 433 || type == 974 || type == 1245 || type == 2274 || type == 3004 || type == 3045 || type == 3114)) + { + if (this.nonTorch == -1) + this.nonTorch = this.selectedItem; + if (this.inventory[this.selectedItem].createTile != 4) + { + this.selectedItem = index4; + break; + } + break; + } + if (((type == 282 || type == 286 || type == 3002 ? 1 : (type == 3112 ? 1 : 0)) & (flag2 ? 1 : 0)) != 0) + { + if (this.nonTorch == -1) + this.nonTorch = this.selectedItem; + this.selectedItem = index4; + return; + } + if (type == 930 & flag2) + { + bool flag3 = false; + for (int index5 = 57; index5 >= 0; --index5) + { + if (this.inventory[index5].ammo == this.inventory[index4].useAmmo) + { + flag3 = true; + break; + } + } + if (flag3) + { + if (this.nonTorch == -1) + this.nonTorch = this.selectedItem; + this.selectedItem = index4; + return; + } + break; + } + if (type == 1333 || type == 523) + { + if (this.nonTorch == -1) + this.nonTorch = this.selectedItem; + this.selectedItem = index4; + return; + } + break; + case 5: + switch (type) + { + case 8: + case 427: + case 428: + case 429: + case 430: + case 431: + case 432: + case 433: + case 523: + case 974: + case 1245: + case 1333: + case 2274: + case 3004: + case 3045: + case 3114: + if (this.nonTorch == -1) + this.nonTorch = this.selectedItem; + if (this.inventory[this.selectedItem].createTile != 4) + { + this.selectedItem = index4; + continue; + } + continue; + case 282: + case 286: + case 3002: + case 3112: + if (this.nonTorch == -1) + this.nonTorch = this.selectedItem; + this.selectedItem = index4; + return; + case 930: + bool flag4 = false; + for (int index6 = 57; index6 >= 0; --index6) + { + if (this.inventory[index6].ammo == this.inventory[index4].useAmmo) + { + flag4 = true; + break; + } + } + if (flag4) + { + if (this.nonTorch == -1) + this.nonTorch = this.selectedItem; + this.selectedItem = index4; + return; + } + continue; + default: + continue; + } + case 6: + int num11 = 929; + if (Main.tile[index1, index2].frameX >= (short) 144) + num11 = 1345; + else if (Main.tile[index1, index2].frameX >= (short) 72) + num11 = 1338; + if (type == num11) + { + if (this.nonTorch == -1) + this.nonTorch = this.selectedItem; + this.selectedItem = index4; + return; + } + break; + case 7: + if (ItemID.Sets.ExtractinatorMode[type] >= 0) + { + if (this.nonTorch == -1) + this.nonTorch = this.selectedItem; + this.selectedItem = index4; + return; + } + break; + } } - this.SmartSelect_PickToolForStrategy(tX, tY, toolStrategy, wetTile); - this._lastSmartCursorToolStrategy = toolStrategy; } else if (this.itemAnimation == 0 && this.DpadRadial.SelectedItem != -1 && this.inventory[this.DpadRadial.SelectedItem].stack > 0) { if (this.nonTorch == -1) this.nonTorch = this.selectedItem; this.selectedItem = this.DpadRadial.SelectedItem; - this._lastSmartCursorToolStrategy = -1; } else if (this.itemAnimation == 0 && this.CircularRadial.SelectedItem != -1 && this.inventory[this.CircularRadial.SelectedItem].stack > 0) { if (this.nonTorch == -1) this.nonTorch = this.selectedItem; this.selectedItem = this.CircularRadial.SelectedItem; - this._lastSmartCursorToolStrategy = -1; } else { @@ -10694,657 +10984,12 @@ namespace Terraria return; this.selectedItem = this.nonTorch; this.nonTorch = -1; - this._lastSmartCursorToolStrategy = -1; } } - private void SmartSelectLookup_GetTargetTile(out int tX, out int tY) - { - tX = (int) (((double) Main.mouseX + (double) Main.screenPosition.X) / 16.0); - tY = (int) (((double) Main.mouseY + (double) Main.screenPosition.Y) / 16.0); - if ((double) this.gravDir != -1.0) - return; - tY = (int) (((double) Main.screenPosition.Y + (double) Main.screenHeight - (double) Main.mouseY) / 16.0); - } - - private void SmartSelect_PickToolForStrategy(int tX, int tY, int toolStrategy, bool wetTile) - { - for (int t = 0; t < 50; ++t) - { - int type = this.inventory[t].type; - switch (toolStrategy) - { - case 0: - if (ItemID.Sets.Torches[type]) - { - this.SmartSelect_SelectItem(t); - return; - } - if (type == 282 || type == 286 || type == 3002 || type == 3112 || type == 4776) - { - this.SmartSelect_SelectItem(t); - break; - } - break; - case 1: - if (this.inventory[t].hammer > 0) - { - this.SmartSelect_SelectItem(t); - return; - } - break; - case 2: - if (this.inventory[t].axe > 0) - { - this.SmartSelect_SelectItem(t); - return; - } - break; - case 3: - if (this.inventory[t].pick > 0) - { - this.SmartSelect_SelectItem(t); - return; - } - break; - case 4: - if (this.inventory[t].type != 282 && this.inventory[t].type != 286 && this.inventory[t].type != 3002 && this.inventory[t].type != 3112 && this.inventory[t].type != 4776 && this.inventory[t].type != 930 && ItemID.Sets.Torches[type] && !ItemID.Sets.WaterTorches[type]) - { - if (this.nonTorch == -1) - this.nonTorch = this.selectedItem; - if (this.inventory[this.selectedItem].createTile != 4) - { - this.selectedItem = t; - break; - } - break; - } - if (((type == 282 || type == 286 || type == 3002 || type == 3112 ? 1 : (type == 4776 ? 1 : 0)) & (wetTile ? 1 : 0)) != 0) - { - this.SmartSelect_SelectItem(t); - return; - } - if (type == 930 & wetTile) - { - bool flag = false; - for (int index = 57; index >= 0; --index) - { - if (this.inventory[index].ammo == this.inventory[t].useAmmo && this.inventory[index].stack > 0) - { - flag = true; - break; - } - } - if (flag) - { - this.SmartSelect_SelectItem(t); - return; - } - break; - } - if (ItemID.Sets.WaterTorches[type]) - { - this.SmartSelect_SelectItem(t); - return; - } - break; - case 5: - if (ItemID.Sets.Torches[type]) - { - if (this.nonTorch == -1) - this.nonTorch = this.selectedItem; - if (this.inventory[this.selectedItem].createTile != 4) - { - this.selectedItem = t; - break; - } - break; - } - switch (type) - { - case 282: - case 286: - case 3002: - case 3112: - case 4776: - this.SmartSelect_SelectItem(t); - return; - case 930: - bool flag1 = false; - for (int index = 57; index >= 0; --index) - { - if (this.inventory[index].ammo == this.inventory[t].useAmmo && this.inventory[index].stack > 0) - { - flag1 = true; - break; - } - } - if (flag1) - { - this.SmartSelect_SelectItem(t); - return; - } - continue; - default: - continue; - } - case 6: - int num = 929; - if (Main.tile[tX, tY].frameX >= (short) 144) - num = 1345; - else if (Main.tile[tX, tY].frameX >= (short) 72) - num = 1338; - if (type == num) - { - this.SmartSelect_SelectItem(t); - return; - } - break; - case 7: - if (ItemID.Sets.ExtractinatorMode[type] >= 0) - { - this.SmartSelect_SelectItem(t); - return; - } - break; - case 8: - if (ItemID.Sets.IsPaintScraper[type]) - { - this.SmartSelect_SelectItem(t); - return; - } - break; - } - } - } - - private void SmartSelect_SelectItem(int t) - { - if (this.nonTorch == -1) - this.nonTorch = this.selectedItem; - this.selectedItem = t; - } - - private void SmartSelect_GetToolStrategy( - int tX, - int tY, - out int toolStrategy, - out bool wetTile) - { - toolStrategy = 0; - bool flag = false; - wetTile = false; - try - { - int num1 = 0; - int num2 = 0; - if ((double) this.position.X / 16.0 >= (double) tX) - num1 = (int) ((double) this.position.X / 16.0) - tX; - if (((double) this.position.X + (double) this.width) / 16.0 <= (double) tX) - num1 = tX - (int) (((double) this.position.X + (double) this.width) / 16.0); - if ((double) this.position.Y / 16.0 >= (double) tY) - num2 = (int) ((double) this.position.Y / 16.0) - tY; - if (((double) this.position.Y + (double) this.height) / 16.0 <= (double) tY) - num2 = tY - (int) (((double) this.position.Y + (double) this.height) / 16.0); - int pickRange; - int axeRange; - int hammerRange; - int cannonRange; - int extractItemRange; - int paintScraperRange; - this.SmartSelect_GetAvailableToolRanges(out pickRange, out axeRange, out hammerRange, out cannonRange, out extractItemRange, out paintScraperRange); - wetTile = Main.tile[tX, tY].liquid > (byte) 0; - if (Main.tile[tX, tY].active()) - { - int type = (int) Main.tile[tX, tY].type; - if (type == 219 && num1 <= extractItemRange + Player.tileRangeX && num2 <= extractItemRange + Player.tileRangeY) - { - toolStrategy = 7; - flag = true; - } - else if (type == 209 && num1 <= cannonRange + Player.tileRangeX && num2 <= cannonRange + Player.tileRangeY) - { - toolStrategy = 6; - flag = true; - } - else if (Main.tileHammer[type] && num1 <= hammerRange + Player.tileRangeX && num2 <= hammerRange + Player.tileRangeY) - { - toolStrategy = 1; - flag = true; - } - else if (Main.tileAxe[type] && num1 <= axeRange + Player.tileRangeX && num2 <= axeRange + Player.tileRangeY) - { - toolStrategy = 2; - flag = true; - } - else if (type == 184 && num1 <= paintScraperRange + Player.tileRangeX && num2 <= paintScraperRange + Player.tileRangeY) - { - toolStrategy = 8; - flag = true; - } - else if (num1 <= pickRange + Player.tileRangeX) - { - if (num2 <= pickRange + Player.tileRangeY) - { - toolStrategy = 3; - flag = true; - } - } - } - else if (wetTile) - { - if (this.wet) - { - toolStrategy = 4; - flag = true; - } - } - } - catch - { - } - if (flag || !this.wet) - return; - toolStrategy = 4; - } - - private void SmartSelect_GetAvailableToolRanges( - out int pickRange, - out int axeRange, - out int hammerRange, - out int cannonRange, - out int extractItemRange, - out int paintScraperRange) - { - pickRange = -10; - axeRange = -10; - hammerRange = -10; - cannonRange = -10; - extractItemRange = -10; - paintScraperRange = -10; - for (int index = 0; index < 50; ++index) - { - if (this.inventory[index].pick > 0 && pickRange == -10) - pickRange = this.inventory[index].tileBoost; - if (this.inventory[index].axe > 0 && axeRange == -10) - axeRange = this.inventory[index].tileBoost; - if (this.inventory[index].hammer > 0 && hammerRange == -10) - hammerRange = this.inventory[index].tileBoost; - if ((this.inventory[index].type == 929 || this.inventory[index].type == 1338 || this.inventory[index].type == 1345) && cannonRange == -10) - cannonRange = this.inventory[index].tileBoost; - if (ItemID.Sets.IsPaintScraper[this.inventory[index].type] && paintScraperRange == -10) - paintScraperRange = this.inventory[index].tileBoost; - if (ItemID.Sets.ExtractinatorMode[this.inventory[index].type] != -1 && extractItemRange == -10) - extractItemRange = this.inventory[index].tileBoost; - } - } - - private void TryRecalculatingTorchLuck() - { - if (this.happyFunTorchTime) - { - this.luckyTorchCounter = 0; - this.TorchAttack(); - } - else - { - if (this.torchGodCooldown > 0) - --this.torchGodCooldown; - if ((double) this.Center.Y < Main.worldSurface * 16.0) - { - this.UpdateTorchLuck_ConsumeCountersAndCalculate(); - } - else - { - int num1 = 1; - int num2 = 40; - int num3 = (int) this.Center.Y / 16 - num2; - int num4 = (int) this.Center.X / 16 - num2; - int num5 = (int) this.Center.X / 16 + num2; - int num6 = Utils.Clamp(num4, 10, Main.maxTilesX - 10); - int num7 = Utils.Clamp(num5, 10, Main.maxTilesX - 10); - for (int index1 = 0; index1 < num1; ++index1) - { - int index2 = num3 + index1 + this.luckyTorchCounter * num1; - if (index2 >= 10 && index2 <= Main.maxTilesY - 10) - { - for (int index3 = num6; index3 <= num7; ++index3) - { - Tile tile = Main.tile[index3, index2]; - if (tile == null) - return; - if (tile.active() && tile.type == (ushort) 4) - { - if (tile.frameX < (short) 66) - ++this.nearbyTorches; - int index4 = (int) tile.frameY / 22; - if (index4 < 22) - { - this.nearbyTorch[index4] = true; - if (index4 == 17 && (tile.liquid == (byte) 0 || tile.liquidType() != (byte) 0)) - this.dryCoralTorch = true; - } - } - } - if (index2 >= (int) this.Center.Y / 16 + num2) - { - this.UpdateTorchLuck_ConsumeCountersAndCalculate(); - return; - } - } - } - ++this.luckyTorchCounter; - } - } - } - - private void RelightTorches() - { - this.torchGodCooldown = 3600; - for (int index = 0; index < this.numberOfTorchAttacks; ++index) - { - int tileX = this.unlitTorchX[index]; - int tileY = this.unlitTorchY[index]; - if (Main.tile[tileX, tileY].type == (ushort) 4 && Main.tile[tileX, tileY].frameX >= (short) 66) - { - Main.tile[tileX, tileY].frameX -= (short) 66; - NetMessage.SendTileSquare(-1, tileX, tileY, 1); - } - } - } - - private void TorchAttack() - { - if (this.whoAmI != Main.myPlayer) - return; - if ((double) this.position.Y < Main.worldSurface * 16.0) - { - this.RelightTorches(); - this.happyFunTorchTime = false; - if (Main.netMode != 1) - return; - NetMessage.SendData(4, number: this.whoAmI); - } - else - { - this.AddBuff(80, 2); - ++this.torchFunTimer; - if (this.torchFunTimer <= 20) - return; - this.torchFunTimer = 0; - int maxValue = 0; - int num1 = 100; - int num2 = (int) this.Center.X / 16 - num1; - int num3 = (int) this.Center.X / 16 + num1; - int num4 = (int) this.Center.Y / 16 - num1; - int num5 = (int) this.Center.Y / 16 + num1; - int max = Main.maxTilesX - 10; - int num6 = Utils.Clamp(num2, 10, max); - int num7 = Utils.Clamp(num3, 10, Main.maxTilesX - 10); - int num8 = Utils.Clamp(num4, 10, Main.maxTilesY - 10); - int num9 = Utils.Clamp(num5, 10, Main.maxTilesY - 10); - for (int index1 = num6; index1 <= num7; ++index1) - { - for (int index2 = num8; index2 <= num9; ++index2) - { - Tile tile = Main.tile[index1, index2]; - if (tile != null && tile.active() & tile.type == (ushort) 4 && tile.frameX < (short) 66) - { - Player._torchAttackPosX[maxValue] = index1; - Player._torchAttackPosY[maxValue] = index2; - ++maxValue; - if (maxValue >= Player._torchAttackPosX.Length) - break; - } - } - if (maxValue >= Player._torchAttackPosX.Length) - break; - } - if (this.dead) - { - this.RelightTorches(); - this.happyFunTorchTime = false; - if (Main.netMode != 1) - return; - NetMessage.SendData(4, number: this.whoAmI); - } - else if (maxValue == 0 || this.numberOfTorchAttacks >= Player.maxTorchAttacks) - { - this.RelightTorches(); - this.happyFunTorchTime = false; - if (Main.netMode == 1) - NetMessage.SendData(4, number: this.whoAmI); - if (this.numberOfTorchAttacks < 95) - return; - int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 5043); - if (Main.netMode != 1) - return; - NetMessage.SendData(21, number: number, number2: 1f); - } - else - { - if (maxValue <= 0) - return; - int index3 = Main.rand.Next(maxValue); - int tileX = Player._torchAttackPosX[index3]; - int tileY = Player._torchAttackPosY[index3]; - if (Main.tile[tileX, tileY].type != (ushort) 4 || Main.tile[tileX, tileY].frameX >= (short) 66) - return; - float num10 = 8f; - int Damage = 20; - if (Damage < 10) - Damage = 10; - int num11 = (int) Main.tile[tileX, tileY].frameY / 22; - int num12; - switch (num11) - { - case 0: - num12 = 6; - break; - case 8: - num12 = 75; - break; - case 9: - num12 = 135; - break; - case 10: - num12 = 158; - break; - case 11: - num12 = 169; - break; - case 12: - num12 = 156; - break; - case 13: - num12 = 234; - break; - case 14: - num12 = 66; - break; - case 15: - num12 = 242; - break; - case 16: - num12 = 293; - break; - case 17: - num12 = 294; - break; - default: - num12 = 58 + num11; - break; - } - Main.tile[tileX, tileY].frameX += (short) 66; - this.unlitTorchX[this.numberOfTorchAttacks] = tileX; - this.unlitTorchY[this.numberOfTorchAttacks] = tileY; - ++this.numberOfTorchAttacks; - NetMessage.SendTileSquare(-1, tileX, tileY, 1); - Vector2 position = new Vector2((float) (tileX * 16 + 8), (float) (tileY * 16)); - Vector2 velocity = this.Center - position; - float ai1 = velocity.Length(); - velocity.Normalize(); - velocity *= num10; - int index4 = Projectile.NewProjectile(position, velocity, 949, Damage, 1f, this.whoAmI, (float) num12, ai1); - Main.projectile[index4].ai[0] = (float) num12; - Main.projectile[index4].ai[1] = ai1; - Main.projectile[index4].netUpdate = true; - if ((maxValue != 1 || this.numberOfTorchAttacks < 95) && this.numberOfTorchAttacks < Player.maxTorchAttacks) - return; - this.torchFunTimer = -180; - } - } - } - - private void UpdateTorchLuck_ConsumeCountersAndCalculate() - { - this.luckyTorchCounter = 0; - this.torchLuck = 0.0f; - if (this.inventory[this.selectedItem].createTile == 4 && this.inventory[this.selectedItem].placeStyle < 22) - this.nearbyTorch[this.inventory[this.selectedItem].placeStyle] = true; - float num1 = 0.0f; - float num2 = 0.0f; - if (!this.ZoneDungeon && !this.ZoneLihzhardTemple) - { - if (this.nearbyTorch[9]) - { - if (this.ZoneSnow) - ++num2; - else - ++num1; - } - if (this.nearbyTorch[16]) - { - if (this.ZoneDesert) - ++num2; - else - ++num1; - } - if (this.nearbyTorch[17]) - { - if (WorldGen.oceanDepths((int) this.Center.X / 16, (int) this.Center.Y / 16)) - ++num2; - else if (this.dryCoralTorch) - ++num1; - } - if (this.nearbyTorch[21]) - { - if (this.ZoneJungle) - ++num2; - else - ++num1; - } - if (this.nearbyTorch[18]) - { - if (this.ZoneCorrupt) - ++num2; - else - ++num1; - } - if (this.nearbyTorch[8] && this.ZoneCorrupt) - ++num2; - if (this.nearbyTorch[19]) - { - if (this.ZoneCrimson) - ++num2; - else - ++num1; - } - if (this.nearbyTorch[11] && this.ZoneCrimson) - ++num2; - if (this.nearbyTorch[20]) - { - if (this.ZoneHallow) - ++num2; - else - ++num1; - } - if (this.nearbyTorch[13] && !this.ZoneSnow && !this.ZoneDesert && !this.ZoneCorrupt && !this.ZoneCrimson && !this.ZoneHallow && !this.ZoneJungle) - num2 += 0.5f; - if (this.nearbyTorch[0]) - { - if (this.ZoneSnow) - num1 += 2f; - else if (this.ZoneDesert || this.ZoneCorrupt || this.ZoneCrimson || this.ZoneHallow) - num1 += 0.5f; - } - } - if ((double) num2 >= 1.0) - ++this.torchLuck; - else if ((double) num2 > 0.0) - this.torchLuck += 0.5f; - if ((double) num1 >= 2.0) - this.torchLuck += -1.5f; - else if ((double) num1 >= 1.0) - this.torchLuck += -1f; - else if ((double) num1 > 0.0) - this.torchLuck += -0.5f; - this.dryCoralTorch = false; - for (int index = 0; index < 22; ++index) - this.nearbyTorch[index] = false; - if ((double) this.torchLuck < 0.0) - this.torchLuck = 0.0f; - if (this.torchGodCooldown <= 0 && !this.unlockedBiomeTorches && this.nearbyTorches > 100 && !this.happyFunTorchTime && (double) this.position.Y > Main.worldSurface * 16.0) - { - bool flag = false; - for (int index = 0; index < this.inventory.Length; ++index) - { - if (this.inventory[index].type == 5043) - { - flag = true; - break; - } - } - if (!flag) - { - this.happyFunTorchTime = true; - this.numberOfTorchAttacks = 0; - } - } - this.nearbyTorches = 0; - } - - public float NormalizedLuck - { - get - { - float num = 0.0f; - if ((double) this.luck > 0.0) - num = this.luck / this.luckMaximumCap; - else if ((double) this.luck < 0.0) - num = (float) -((double) this.luck / (double) this.luckMinimumCap); - return MathHelper.Clamp(num, -1f, 1f); - } - } - - private float GetLadyBugLuck() - { - if (this.ladyBugLuckTimeLeft > 0) - return (float) this.ladyBugLuckTimeLeft / (float) NPC.ladyBugGoodLuckTime; - return this.ladyBugLuckTimeLeft < 0 ? (float) -(double) this.ladyBugLuckTimeLeft / (float) NPC.ladyBugBadLuckTime : 0.0f; - } - - public static float GetClosestPlayersLuck(Point Position) => Main.player[(int) Player.FindClosest(new Vector2((float) (Position.X * 16), (float) (Position.Y * 16)), 1, 1)].luck; - - public static float GetClosestPlayersLuck(Vector2 Position) => Main.player[(int) Player.FindClosest(Position, 1, 1)].luck; - - public int RollLuck(int range) - { - if ((double) this.luck > 0.0 && (double) Main.rand.NextFloat() < (double) this.luck) - return Main.rand.Next(Main.rand.Next(range / 2, range)); - return (double) this.luck < 0.0 && (double) Main.rand.NextFloat() < -(double) this.luck ? Main.rand.Next(Main.rand.Next(range, range * 2)) : Main.rand.Next(range); - } - - public static float GetClosestRollLuck(Vector2 position, int range) => (float) Main.player[(int) Player.FindClosest(position, 1, 1)].RollLuck(range); - - public static float GetClosestRollLuck(int x, int y, int range) => (float) Main.player[(int) Player.FindClosest(new Vector2((float) (x * 16), (float) (y * 16)), 1, 1)].RollLuck(range); - public void ResetEffects() { this.extraAccessorySlots = !this.extraAccessory || !Main.expertMode && !Main.gameMenu ? 0 : 1; - this.fairyBoots = false; - this.moonLordLegs = false; - this.flowerBoots = false; this.arcticDivingGear = false; this.noBuilding = false; this.strongBees = false; @@ -11355,19 +11000,19 @@ namespace Terraria this.accCompass = 0; this.accDepthMeter = 0; this.accDivingHelm = false; - this.canFloatInWater = false; this.lifeRegen = 0; this.manaCost = 1f; this.meleeSpeed = 1f; this.meleeDamage = 1f; this.rangedDamage = 1f; + this.thrownDamage = 1f; this.magicDamage = 1f; this.minionDamage = 1f; this.meleeCrit = 4; this.rangedCrit = 4; this.magicCrit = 4; - this.hasFootball = false; - this.drawingFootball = false; + this.thrownCrit = 4; + this.thrownVelocity = 1f; this.minionKB = 0.0f; this.moveSpeed = 1f; this.boneArmor = false; @@ -11377,8 +11022,6 @@ namespace Terraria this.fireWalk = false; this.noKnockback = false; this.jumpBoost = false; - this.frogLegJumpBoost = false; - this.skyStoneEffects = false; this.noFallDmg = false; this.accFlipper = false; this.spawnMax = false; @@ -11392,29 +11035,26 @@ namespace Terraria this.invis = false; this.nightVision = false; this.enemySpawns = false; - this.hasTitaniumStormBuff = false; this.thorns = 0.0f; this.aggro = 0; this.waterWalk = false; this.waterWalk2 = false; this.detectCreature = false; this.gravControl = false; - this.releaseBeesWhenHurt = false; + this.bee = false; this.gravControl2 = false; this.statLifeMax2 = this.statLifeMax; this.statManaMax2 = this.statManaMax; - this.chloroAmmoCost80 = false; this.ammoCost80 = false; this.ammoCost75 = false; + this.thrownCost50 = false; + this.thrownCost33 = false; this.manaRegenBuff = false; this.arrowDamage = 1f; this.bulletDamage = 1f; this.rocketDamage = 1f; - this.coolWhipBuff = false; this.yoraiz0rEye = 0; this.yoraiz0rDarkness = false; - this.hasFloatingTube = false; - this.hasUnicornHorn = false; this.leinforsHair = false; this.suspiciouslookingTentacle = false; this.crimsonHeart = false; @@ -11426,7 +11066,6 @@ namespace Terraria this.bunny = false; this.turtle = false; this.eater = false; - this.trident = false; this.skeletron = false; this.hornet = false; this.zephyrfish = false; @@ -11447,7 +11086,6 @@ namespace Terraria this.onHitRegen = false; this.onHitPetal = false; this.iceBarrier = false; - this.onHitTitaniumStorm = false; this.maxMinions = 1; this.maxTurrets = 1; this.ammoBox = false; @@ -11455,8 +11093,6 @@ namespace Terraria this.penguin = false; this.sporeSac = false; this.shinyStone = false; - this.empressBrooch = false; - this.volatileGelatin = false; this.dd2Accessory = false; this.magicLantern = false; this.rabid = false; @@ -11465,11 +11101,8 @@ namespace Terraria this.inferno = false; this.manaMagnet = false; this.lifeMagnet = false; - this.treasureMagnet = false; this.lifeForce = false; this.dangerSense = false; - if (Main.myPlayer == this.whoAmI) - this.luckPotion = (byte) 0; this.endurance = 0.0f; this.calmed = false; this.beetleOrbs = 0; @@ -11483,7 +11116,6 @@ namespace Terraria this.sonarPotion = false; this.accTackleBox = false; this.accFishingLine = false; - this.accLavaFishing = false; this.accFishFinder = false; this.accWeatherRadio = false; this.accThirdEye = false; @@ -11498,45 +11130,10 @@ namespace Terraria this.tileSpeed = 1f; this.autoPaint = false; this.autoActuator = false; - this.petFlagKingSlimePet = false; - this.petFlagEyeOfCthulhuPet = false; - this.petFlagEaterOfWorldsPet = false; - this.petFlagBrainOfCthulhuPet = false; - this.petFlagSkeletronPet = false; - this.petFlagQueenBeePet = false; - this.petFlagDestroyerPet = false; - this.petFlagTwinsPet = false; - this.petFlagSkeletronPrimePet = false; - this.petFlagPlanteraPet = false; - this.petFlagGolemPet = false; - this.petFlagDukeFishronPet = false; - this.petFlagLunaticCultistPet = false; - this.petFlagMoonLordPet = false; - this.petFlagFairyQueenPet = false; - this.petFlagPumpkingPet = false; - this.petFlagEverscreamPet = false; - this.petFlagIceQueenPet = false; - this.petFlagMartianPet = false; - this.petFlagDD2OgrePet = false; - this.petFlagDD2BetsyPet = false; - this.petFlagQueenSlimePet = false; - this.petFlagVoltBunny = false; - this.petFlagShadowMimic = false; - this.petFlagBabyWerewolf = false; - this.petFlagDynamiteKitten = false; - this.petFlagPlantero = false; - this.petFlagBabyRedPanda = false; - this.petFlagLilHarpy = false; - this.petFlagFennecFox = false; - this.petFlagGlitteryButterfly = false; - this.petFlagBabyImp = false; - this.petFlagBabyShark = false; - this.petFlagUpbeatStar = false; this.petFlagDD2Gato = false; this.petFlagDD2Dragon = false; this.petFlagDD2Ghost = false; this.companionCube = false; - this.petFlagSugarGlider = false; this.babyFaceMonster = false; this.manaSick = false; this.puppy = false; @@ -11546,11 +11143,9 @@ namespace Terraria this.squashling = false; this.magicCuffs = false; this.coldDash = false; - this.desertDash = false; this.sailDash = false; this.cordage = false; this.magicQuiver = false; - this.hasMoltenQuiver = false; this.magmaStone = false; this.hasRaisableShield = false; this.lavaRose = false; @@ -11571,17 +11166,11 @@ namespace Terraria this.pirateMinion = false; this.sharknadoMinion = false; this.stardustMinion = false; - this.batsOfLight = false; - this.babyBird = false; - this.stormTiger = false; - this.smolstar = false; - this.empressBlade = false; this.stardustGuardian = false; this.stardustDragon = false; this.UFOMinion = false; this.DeadlySphereMinion = false; this.chilled = false; - this.tipsy = false; this.dazed = false; this.frozen = false; this.stoned = false; @@ -11591,7 +11180,7 @@ namespace Terraria this.manaRegenDelayBonus = 0; this.carpet = false; this.iceSkate = false; - this.dashType = 0; + this.dash = 0; this.spikedBoots = 0; this.blackBelt = false; this.lavaMax = 0; @@ -11603,19 +11192,17 @@ namespace Terraria this.onFire = false; this.dripping = false; this.drippingSlime = false; - this.drippingSparkleSlime = false; this.burned = false; this.suffocating = false; this.onFire2 = false; this.onFrostBurn = false; this.frostBurn = false; this.noItems = false; - this.cursed = false; this.blockRange = 0; this.pickSpeed = 1f; this.wereWolf = false; this.rulerGrid = false; - this.rulerLine = true; + this.rulerLine = false; this.bleed = false; this.confused = false; this.witheredArmor = false; @@ -11633,9 +11220,6 @@ namespace Terraria this.kbGlove = false; this.kbBuff = false; this.starCloak = false; - this.starCloakIsManaCloak = false; - this.starCloakIsStarVeil = false; - this.starCloakIsBeeCloak = false; this.longInvince = false; this.pStone = false; this.manaFlower = false; @@ -11655,8 +11239,6 @@ namespace Terraria this.vortexDebuff = false; this.windPushed = false; this.ballistaPanic = false; - this.vampireFrog = false; - this.CanSeeInvisibleBlocks = false; this.setVortex = this.setNebula = this.setStardust = false; this.setForbidden = false; this.setHuntressT3 = false; @@ -11673,76 +11255,35 @@ namespace Terraria this.meleeEnchant = (byte) 0; this.discount = false; this.coins = false; - this.hasJumpOption_Cloud = false; - this.hasJumpOption_Sail = false; - this.hasJumpOption_Sandstorm = false; - this.hasJumpOption_Blizzard = false; - this.hasJumpOption_Fart = false; - this.hasJumpOption_Unicorn = false; - this.hasJumpOption_Santank = false; - this.hasJumpOption_WallOfFleshGoat = false; - this.hasJumpOption_Basilisk = false; + this.doubleJumpSail = false; + this.doubleJumpSandstorm = false; + this.doubleJumpBlizzard = false; + this.doubleJumpFart = false; + this.doubleJumpUnicorn = false; this.defendedByPaladin = false; this.hasPaladinShield = false; - this.preventAllItemPickups = false; - this.dontHurtCritters = false; - this.portableStoolInfo.Reset(); - this.ResizeHitbox(); this.autoJump = false; this.justJumped = false; this.jumpSpeedBoost = 0.0f; this.extraFall = 0; - this.creativeGodMode = false; if (this.phantasmTime > 0) --this.phantasmTime; - if (this.brainOfConfusionDodgeAnimationCounter > 0) - --this.brainOfConfusionDodgeAnimationCounter; if (this.wireOperationsCooldown > 0) --this.wireOperationsCooldown; if (this.releaseUseItem) this.ActuationRodLock = false; for (int index = 0; index < this.npcTypeNoAggro.Length; ++index) this.npcTypeNoAggro[index] = false; - this.ResetProjectileCaches(); + for (int index = 0; index < this.ownedProjectileCounts.Length; ++index) + this.ownedProjectileCounts[index] = 0; if (this.whoAmI == Main.myPlayer) { Player.tileRangeX = 5; Player.tileRangeY = 4; - if (Main.GameModeInfo.IsJourneyMode) - { - CreativePowers.FarPlacementRangePower power = CreativePowerManager.Instance.GetPower(); - if (power.GetIsUnlocked() && power.IsEnabledForPlayer(this.whoAmI)) - { - Player.tileRangeX *= 2; - Player.tileRangeY *= 2; - Player.tileRangeX += 8; - Player.tileRangeY += 8; - } - } } this.mount.CheckMountBuff(this); } - private void UpdateLadyBugLuckTime() - { - if (this.ladyBugLuckTimeLeft > 0) - { - this.ladyBugLuckTimeLeft -= Main.dayRate; - if (this.ladyBugLuckTimeLeft >= 0) - return; - this.ladyBugLuckTimeLeft = 0; - } - else - { - if (this.ladyBugLuckTimeLeft >= 0) - return; - this.ladyBugLuckTimeLeft += Main.dayRate; - if (this.ladyBugLuckTimeLeft <= 0) - return; - this.ladyBugLuckTimeLeft = 0; - } - } - public void UpdateImmunity() { if (this.immune) @@ -11792,7 +11333,7 @@ namespace Terraria if (this.lifeRegen > 0) this.lifeRegen = 0; this.lifeRegenTime = 0; - this.lifeRegen -= 30; + this.lifeRegen -= 12; } if (this.onFire) { @@ -11813,7 +11354,7 @@ namespace Terraria if (this.lifeRegen > 0) this.lifeRegen = 0; this.lifeRegenTime = 0; - this.lifeRegen -= 24; + this.lifeRegen -= 12; } if (this.burned) { @@ -11879,9 +11420,9 @@ namespace Terraria this.lifeRegenTime += num; this.lifeRegen += num; } - if (this.whoAmI == Main.myPlayer && Main.SceneMetrics.HasCampfire) + if (this.whoAmI == Main.myPlayer && Main.campfire) ++this.lifeRegen; - if (this.whoAmI == Main.myPlayer && Main.SceneMetrics.HasHeartLantern) + if (this.whoAmI == Main.myPlayer && Main.heartLantern) this.lifeRegen += 2; if (this.bleed) this.lifeRegenTime = 0; @@ -11917,17 +11458,12 @@ namespace Terraria ++num1; this.lifeRegenTime = 3600; } - if (this.sitting.isSitting || this.sleeping.isSleeping) - { - this.lifeRegenTime += 10; - num1 *= 1.5f; - } float num3 = (double) this.velocity.X == 0.0 || this.grappling[0] > 0 ? num1 * 1.25f : num1 * 0.5f; if (this.crimsonRegen) num3 *= 1.5f; if (this.shinyStone) num3 *= 1.1f; - if (this.whoAmI == Main.myPlayer && Main.SceneMetrics.HasCampfire) + if (this.whoAmI == Main.myPlayer && Main.campfire) num3 *= 1.1f; if (Main.expertMode && !this.wellFed) { @@ -12100,7 +11636,7 @@ namespace Terraria { if (this.whoAmI == Main.myPlayer & flag) { - SoundEngine.PlaySound(25); + Main.PlaySound(25); for (int index1 = 0; index1 < 5; ++index1) { int index2 = Dust.NewDust(this.position, this.width, this.height, 45, Alpha: ((int) byte.MaxValue), Scale: ((float) Main.rand.Next(20, 26) * 0.1f)); @@ -12128,26 +11664,11 @@ namespace Terraria Player.jumpHeight = 20; Player.jumpSpeed = 6.51f; } - if (this.empressBrooch) - this.jumpSpeedBoost += 2.4f; - if (this.frogLegJumpBoost) - { - this.jumpSpeedBoost += 2.4f; - this.extraFall += 15; - } - if (this.moonLordLegs) - { - this.jumpSpeedBoost += 1.8f; - this.extraFall += 10; - ++Player.jumpHeight; - } if (this.wereWolf) { Player.jumpHeight += 2; Player.jumpSpeed += 0.2f; } - if (this.portableStoolInfo.IsInUse) - Player.jumpHeight += 5; Player.jumpSpeed += this.jumpSpeedBoost; } if (this.sticky) @@ -12163,7 +11684,7 @@ namespace Terraria public void FindPulley() { - if (this.portableStoolInfo.IsInUse || !this.controlUp && !this.controlDown) + if (!this.controlUp && !this.controlDown) return; int index1 = (int) ((double) this.position.X + (double) (this.width / 2)) / 16; int index2 = (int) ((double) this.position.Y - 8.0) / 16; @@ -12264,487 +11785,367 @@ namespace Terraria float num1 = (float) (((double) this.accRunSpeed + (double) this.maxRunSpeed) / 2.0); float num2 = 0.0f; bool flag3 = false; - if (flag2 && this.mount.Active && this.mount.Type == 43 && (double) this.velocity.Y == 0.0 && !this.controlJump) + if (this.windPushed && ((!this.mount.Active ? 0 : ((double) this.velocity.Y == 0.0 ? 1 : 0)) & (flag2 ? 1 : 0)) == 0) { - SoundEngine.PlaySound(SoundID.Item168, this.Center); - float num3 = (float) ((double) Player.jumpSpeed * (double) this.gravDir * 0.5); - if ((double) num3 < 2.0) - num3 = 2f; - this.velocity.Y = -(num3 + 0.01f); - this.jump = Player.jumpHeight; - this.fullRotation = 0.0f; + num2 = (float) Math.Sign(Main.windSpeed) * 0.07f; + if ((double) Math.Abs(Main.windSpeed) > 0.5) + num2 *= 1.37f; + if ((double) this.velocity.Y != 0.0) + num2 *= 1.5f; + if (flag2) + num2 *= 0.8f; + flag3 = true; + if (Math.Sign(this.direction) != Math.Sign(num2)) + num1 -= Math.Abs(num2) * 40f; } - else + if ((double) this.trackBoost != 0.0) { - if (this.windPushed && !this.isLockedToATile && ((!this.mount.Active ? 0 : ((double) this.velocity.Y == 0.0 ? 1 : 0)) & (flag2 ? 1 : 0)) == 0) + this.velocity.X += this.trackBoost; + this.trackBoost = 0.0f; + if ((double) this.velocity.X < 0.0) { - num2 = (float) Math.Sign(Main.windSpeedCurrent) * 0.06f; - if ((double) Math.Abs(Main.windSpeedCurrent) > 0.5) - num2 *= 1.37f; - if ((double) this.velocity.Y != 0.0) - num2 *= 1.5f; - if (flag2) - { - float num4 = num2 * 0.8f; - float max = 0.072f; - num2 = MathHelper.Clamp(num4, -max, max); - } - flag3 = true; - if (Math.Sign(this.direction) != Math.Sign(num2)) - num1 -= Math.Abs(num2) * 40f; - } - if ((double) this.trackBoost != 0.0) - { - this.velocity.X += this.trackBoost; - this.trackBoost = 0.0f; - if ((double) this.velocity.X < 0.0) - { - if ((double) this.velocity.X < -(double) this.maxRunSpeed) - this.velocity.X = -this.maxRunSpeed; - } - else if ((double) this.velocity.X > (double) this.maxRunSpeed) - this.velocity.X = this.maxRunSpeed; - } - if (this.controlLeft && (double) this.velocity.X > -(double) this.maxRunSpeed) - { - if (!this.mount.Active || !this.mount.Cart || (double) this.velocity.Y == 0.0) - { - if ((double) this.velocity.X > (double) this.runSlowdown) - this.velocity.X -= this.runSlowdown; - this.velocity.X -= this.runAcceleration; - } - if (this.onWrongGround) - { - if ((double) this.velocity.X < -(double) this.runSlowdown) - this.velocity.X += this.runSlowdown; - else - this.velocity.X = 0.0f; - } - if (this.mount.Active && this.mount.Cart && !this.onWrongGround) - { - if ((double) this.velocity.X < 0.0 & flag1) - this.direction = -1; - else if (this.itemAnimation <= 0 && (double) this.velocity.Y == 0.0) - { - SoundEngine.PlaySound(SoundID.Item55, (int) this.position.X + this.width / 2, (int) this.position.Y + this.height / 2); - DelegateMethods.Minecart.rotation = this.fullRotation; - DelegateMethods.Minecart.rotationOrigin = this.fullRotationOrigin; - if ((double) Math.Abs(this.velocity.X) > (double) this.maxRunSpeed * 0.66) - { - if (Main.rand.Next(2) == 0) - Minecart.WheelSparks(this.mount.Delegations.MinecartDust, this.position + this.velocity * 0.66f, this.width, this.height, 1); - if (Main.rand.Next(2) == 0) - Minecart.WheelSparks(this.mount.Delegations.MinecartDust, this.position + this.velocity * 0.33f, this.width, this.height, 1); - if (Main.rand.Next(2) == 0) - Minecart.WheelSparks(this.mount.Delegations.MinecartDust, this.position, this.width, this.height, 1); - } - else if ((double) Math.Abs(this.velocity.X) > (double) this.maxRunSpeed * 0.33) - { - if (Main.rand.Next(3) != 0) - Minecart.WheelSparks(this.mount.Delegations.MinecartDust, this.position + this.velocity * 0.5f, this.width, this.height, 1); - if (Main.rand.Next(3) != 0) - Minecart.WheelSparks(this.mount.Delegations.MinecartDust, this.position, this.width, this.height, 1); - } - else - Minecart.WheelSparks(this.mount.Delegations.MinecartDust, this.position, this.width, this.height, 1); - } - } - else if (!this.sandStorm && (this.itemAnimation == 0 || this.inventory[this.selectedItem].useTurn) && this.mount.AllowDirectionChange) - this.direction = -1; - } - else if (this.controlRight && (double) this.velocity.X < (double) this.maxRunSpeed) - { - if (!this.mount.Active || !this.mount.Cart || (double) this.velocity.Y == 0.0) - { - if ((double) this.velocity.X < -(double) this.runSlowdown) - this.velocity.X += this.runSlowdown; - this.velocity.X += this.runAcceleration; - } - if (this.onWrongGround) - { - if ((double) this.velocity.X > (double) this.runSlowdown) - this.velocity.X -= this.runSlowdown; - else - this.velocity.X = 0.0f; - } - if (this.mount.Active && this.mount.Cart && !this.onWrongGround) - { - if ((double) this.velocity.X > 0.0 & flag1) - this.direction = 1; - else if (this.itemAnimation <= 0 && (double) this.velocity.Y == 0.0) - { - SoundEngine.PlaySound(SoundID.Item55, (int) this.position.X + this.width / 2, (int) this.position.Y + this.height / 2); - DelegateMethods.Minecart.rotation = this.fullRotation; - DelegateMethods.Minecart.rotationOrigin = this.fullRotationOrigin; - if ((double) Math.Abs(this.velocity.X) > (double) this.maxRunSpeed * 0.66) - { - if (Main.rand.Next(2) == 0) - Minecart.WheelSparks(this.mount.Delegations.MinecartDust, this.position + this.velocity * 0.66f, this.width, this.height, 1); - if (Main.rand.Next(2) == 0) - Minecart.WheelSparks(this.mount.Delegations.MinecartDust, this.position + this.velocity * 0.33f, this.width, this.height, 1); - if (Main.rand.Next(2) == 0) - Minecart.WheelSparks(this.mount.Delegations.MinecartDust, this.position, this.width, this.height, 1); - } - else if ((double) Math.Abs(this.velocity.X) > (double) this.maxRunSpeed * 0.33) - { - if (Main.rand.Next(3) != 0) - Minecart.WheelSparks(this.mount.Delegations.MinecartDust, this.position + this.velocity * 0.5f, this.width, this.height, 1); - if (Main.rand.Next(3) != 0) - Minecart.WheelSparks(this.mount.Delegations.MinecartDust, this.position, this.width, this.height, 1); - } - else - Minecart.WheelSparks(this.mount.Delegations.MinecartDust, this.position, this.width, this.height, 1); - } - } - else if (!this.sandStorm && (this.itemAnimation == 0 || this.inventory[this.selectedItem].useTurn) && this.mount.AllowDirectionChange) - this.direction = 1; - } - else if (this.controlLeft && (double) this.velocity.X > -(double) this.accRunSpeed && this.dashDelay >= 0) - { - if (this.mount.Active && this.mount.Cart) - { - if ((double) this.velocity.X < 0.0) - this.direction = -1; - } - else if ((this.itemAnimation == 0 || this.inventory[this.selectedItem].useTurn) && this.mount.AllowDirectionChange) - this.direction = -1; - if ((double) this.velocity.Y == 0.0 || this.wingsLogic > 0 || this.mount.CanFly()) - { - if ((double) this.velocity.X > (double) this.runSlowdown) - this.velocity.X -= this.runSlowdown; - this.velocity.X -= this.runAcceleration * 0.2f; - if (this.wingsLogic > 0) - this.velocity.X -= this.runAcceleration * 0.2f; - } - if (this.onWrongGround) - { - if ((double) this.velocity.X < (double) this.runSlowdown) - this.velocity.X += this.runSlowdown; - else - this.velocity.X = 0.0f; - } - if ((double) this.velocity.X < -(double) num1 && (double) this.velocity.Y == 0.0 && !this.mount.Active) - this.SpawnFastRunParticles(); - } - else if (this.controlRight && (double) this.velocity.X < (double) this.accRunSpeed && this.dashDelay >= 0) - { - if (this.mount.Active && this.mount.Cart) - { - if ((double) this.velocity.X > 0.0) - this.direction = -1; - } - else if ((this.itemAnimation == 0 || this.inventory[this.selectedItem].useTurn) && this.mount.AllowDirectionChange) - this.direction = 1; - if ((double) this.velocity.Y == 0.0 || this.wingsLogic > 0 || this.mount.CanFly()) - { - if ((double) this.velocity.X < -(double) this.runSlowdown) - this.velocity.X += this.runSlowdown; - this.velocity.X += this.runAcceleration * 0.2f; - if (this.wingsLogic > 0) - this.velocity.X += this.runAcceleration * 0.2f; - } - if (this.onWrongGround) - { - if ((double) this.velocity.X > (double) this.runSlowdown) - this.velocity.X -= this.runSlowdown; - else - this.velocity.X = 0.0f; - } - if ((double) this.velocity.X > (double) num1 && (double) this.velocity.Y == 0.0 && !this.mount.Active) - this.SpawnFastRunParticles(); - } - else if (this.mount.Active && this.mount.Cart && (double) Math.Abs(this.velocity.X) >= 1.0) - { - if (this.onWrongGround) - { - if ((double) this.velocity.X > 0.0) - { - if ((double) this.velocity.X > (double) this.runSlowdown) - this.velocity.X -= this.runSlowdown; - else - this.velocity.X = 0.0f; - } - else if ((double) this.velocity.X < 0.0) - { - if ((double) this.velocity.X < -(double) this.runSlowdown) - this.velocity.X += this.runSlowdown; - else - this.velocity.X = 0.0f; - } - } - if ((double) this.velocity.X > (double) this.maxRunSpeed) - this.velocity.X = this.maxRunSpeed; if ((double) this.velocity.X < -(double) this.maxRunSpeed) this.velocity.X = -this.maxRunSpeed; } - else if ((double) this.velocity.Y == 0.0) + else if ((double) this.velocity.X > (double) this.maxRunSpeed) + this.velocity.X = this.maxRunSpeed; + } + if (this.controlLeft && (double) this.velocity.X > -(double) this.maxRunSpeed) + { + if (!this.mount.Active || !this.mount.Cart || (double) this.velocity.Y == 0.0) { if ((double) this.velocity.X > (double) this.runSlowdown) this.velocity.X -= this.runSlowdown; - else if ((double) this.velocity.X < -(double) this.runSlowdown) + this.velocity.X -= this.runAcceleration; + } + if (this.onWrongGround) + { + if ((double) this.velocity.X < -(double) this.runSlowdown) this.velocity.X += this.runSlowdown; else this.velocity.X = 0.0f; } - else if (!this.PortalPhysicsEnabled) + if (this.mount.Active && this.mount.Cart && !this.onWrongGround) { - if ((double) this.velocity.X > (double) this.runSlowdown * 0.5) - this.velocity.X -= this.runSlowdown * 0.5f; - else if ((double) this.velocity.X < -(double) this.runSlowdown * 0.5) - this.velocity.X += this.runSlowdown * 0.5f; + if ((double) this.velocity.X < 0.0 & flag1) + this.direction = -1; + else if (this.itemAnimation <= 0 && (double) this.velocity.Y == 0.0) + { + Main.PlaySound(SoundID.Item55, (int) this.position.X + this.width / 2, (int) this.position.Y + this.height / 2); + DelegateMethods.Minecart.rotation = this.fullRotation; + DelegateMethods.Minecart.rotationOrigin = this.fullRotationOrigin; + if ((double) Math.Abs(this.velocity.X) > (double) this.maxRunSpeed * 0.66) + { + if (Main.rand.Next(2) == 0) + Minecart.WheelSparks(this.mount.MinecartDust, this.position + this.velocity * 0.66f, this.width, this.height, 1); + if (Main.rand.Next(2) == 0) + Minecart.WheelSparks(this.mount.MinecartDust, this.position + this.velocity * 0.33f, this.width, this.height, 1); + if (Main.rand.Next(2) == 0) + Minecart.WheelSparks(this.mount.MinecartDust, this.position, this.width, this.height, 1); + } + else if ((double) Math.Abs(this.velocity.X) > (double) this.maxRunSpeed * 0.33) + { + if (Main.rand.Next(3) != 0) + Minecart.WheelSparks(this.mount.MinecartDust, this.position + this.velocity * 0.5f, this.width, this.height, 1); + if (Main.rand.Next(3) != 0) + Minecart.WheelSparks(this.mount.MinecartDust, this.position, this.width, this.height, 1); + } + else + Minecart.WheelSparks(this.mount.MinecartDust, this.position, this.width, this.height, 1); + } + } + else if (!this.sandStorm && (this.itemAnimation == 0 || this.inventory[this.selectedItem].useTurn) && this.mount.AllowDirectionChange) + this.direction = -1; + } + else if (this.controlRight && (double) this.velocity.X < (double) this.maxRunSpeed) + { + if (!this.mount.Active || !this.mount.Cart || (double) this.velocity.Y == 0.0) + { + if ((double) this.velocity.X < -(double) this.runSlowdown) + this.velocity.X += this.runSlowdown; + this.velocity.X += this.runAcceleration; + } + if (this.onWrongGround) + { + if ((double) this.velocity.X > (double) this.runSlowdown) + this.velocity.X -= this.runSlowdown; else this.velocity.X = 0.0f; } - if (flag3) + if (this.mount.Active && this.mount.Cart && !this.onWrongGround) { - if ((double) num2 < 0.0 && (double) this.velocity.X > (double) num2) + if ((double) this.velocity.X > 0.0 & flag1) + this.direction = 1; + else if (this.itemAnimation <= 0 && (double) this.velocity.Y == 0.0) { - this.velocity.X += num2; - if ((double) this.velocity.X < (double) num2) - this.velocity.X = num2; - } - if ((double) num2 > 0.0 && (double) this.velocity.X < (double) num2) - { - this.velocity.X += num2; - if ((double) this.velocity.X > (double) num2) - this.velocity.X = num2; + Main.PlaySound(SoundID.Item55, (int) this.position.X + this.width / 2, (int) this.position.Y + this.height / 2); + DelegateMethods.Minecart.rotation = this.fullRotation; + DelegateMethods.Minecart.rotationOrigin = this.fullRotationOrigin; + if ((double) Math.Abs(this.velocity.X) > (double) this.maxRunSpeed * 0.66) + { + if (Main.rand.Next(2) == 0) + Minecart.WheelSparks(this.mount.MinecartDust, this.position + this.velocity * 0.66f, this.width, this.height, 1); + if (Main.rand.Next(2) == 0) + Minecart.WheelSparks(this.mount.MinecartDust, this.position + this.velocity * 0.33f, this.width, this.height, 1); + if (Main.rand.Next(2) == 0) + Minecart.WheelSparks(this.mount.MinecartDust, this.position, this.width, this.height, 1); + } + else if ((double) Math.Abs(this.velocity.X) > (double) this.maxRunSpeed * 0.33) + { + if (Main.rand.Next(3) != 0) + Minecart.WheelSparks(this.mount.MinecartDust, this.position + this.velocity * 0.5f, this.width, this.height, 1); + if (Main.rand.Next(3) != 0) + Minecart.WheelSparks(this.mount.MinecartDust, this.position, this.width, this.height, 1); + } + else + Minecart.WheelSparks(this.mount.MinecartDust, this.position, this.width, this.height, 1); } } - bool flag4 = this.mount.Type == 40 || this.mount.Type == 41 || this.mount.Type == 42; - if (this.mount.Active && ((this.mount.Type == 10 ? 1 : (this.mount.Type == 47 ? 1 : 0)) | (flag4 ? 1 : 0)) != 0 && (double) Math.Abs(this.velocity.X) > (double) this.mount.DashSpeed - (double) this.mount.RunSpeed / 2.0) - { - Microsoft.Xna.Framework.Rectangle rect = this.getRect(); - if (this.direction == 1) - rect.Offset(this.width - 1, 0); - rect.Width = 2; - rect.Inflate(6, 12); - int num5 = 60; - if (flag4) - num5 = 30; - float Damage = (float) num5 * this.meleeDamage; - float Knockback = 10f; - if (flag4) - Knockback = 7f; - int NPCImmuneTime = 30; - int PlayerImmuneTime = 6; - this.CollideWithNPCs(rect, Damage, Knockback, NPCImmuneTime, PlayerImmuneTime); - } - if (this.mount.Active && this.mount.Type == 44 && (double) Math.Abs(this.velocity.X) > (double) this.mount.DashSpeed - (double) this.mount.RunSpeed / 4.0) - { - Microsoft.Xna.Framework.Rectangle rect = this.getRect(); - if (this.direction == 1) - rect.Offset(this.width - 1, 0); - rect.Width = 2; - rect.Inflate(6, 12); - float Damage = 100f * this.minionDamage; - float Knockback = 12f; - int NPCImmuneTime = 30; - int PlayerImmuneTime = 6; - this.CollideWithNPCs(rect, Damage, Knockback, NPCImmuneTime, PlayerImmuneTime); - } - if (this.mount.Active && this.mount.Type == 45 && (double) Math.Abs(this.velocity.X) > (double) this.mount.DashSpeed * 0.899999976158142) - { - Microsoft.Xna.Framework.Rectangle rect = this.getRect(); - if (this.direction == 1) - rect.Offset(this.width - 1, 0); - rect.Width = 2; - rect.Inflate(6, 12); - float Damage = 120f * this.minionDamage; - float Knockback = 12f; - int NPCImmuneTime = 30; - int PlayerImmuneTime = 6; - this.CollideWithNPCs(rect, Damage, Knockback, NPCImmuneTime, PlayerImmuneTime); - } - if (this.mount.Active && this.mount.Type == 14 && (double) Math.Abs(this.velocity.X) > (double) this.mount.RunSpeed / 2.0) - { - Microsoft.Xna.Framework.Rectangle rect = this.getRect(); - if (this.direction == 1) - rect.Offset(this.width - 1, 0); - rect.Width = 2; - rect.Inflate(6, 12); - float Damage = 90f * this.minionDamage; - float Knockback = 10f; - int NPCImmuneTime = 30; - int PlayerImmuneTime = 6; - this.CollideWithNPCs(rect, Damage, Knockback, NPCImmuneTime, PlayerImmuneTime); - } - if (this.mount.Active && this.mount.Type == 17 && (double) Math.Abs(this.velocity.X) > (double) this.mount.RunSpeed / 2.0) - { - Microsoft.Xna.Framework.Rectangle rect = this.getRect(); - if (this.direction == 1) - rect.Offset(this.width - 1, 0); - rect.Width = 2; - rect.Inflate(6, 12); - float Damage = 40f; - float Knockback = 10f; - int NPCImmuneTime = 30; - int PlayerImmuneTime = 12; - this.CollideWithNPCs(rect, Damage, Knockback, NPCImmuneTime, PlayerImmuneTime); - } - this.TryUsingDiggerCart(); - if (this.HeldItem.type != 4049 || this.whoAmI != Main.myPlayer) - return; - this.MowTheLawn(); + else if (!this.sandStorm && (this.itemAnimation == 0 || this.inventory[this.selectedItem].useTurn) && this.mount.AllowDirectionChange) + this.direction = 1; } - } - - private void TryUsingDiggerCart() - { - if (this.whoAmI != Main.myPlayer || !this.mount.Active || this.mount.Type != 39 || (double) this.velocity.Y != 0.0) - return; - int num1 = 12; - int num2 = 20; - Vector2 vector2_1 = new Vector2(0.0f, this.gravDir * 10f); - Vector2 vector2_2 = this.RotatedRelativePoint(this.Center + new Vector2((float) (num1 * this.direction), this.gravDir * (float) num2)) + vector2_1; - Tile tileSafely = Framing.GetTileSafely(vector2_2); - if (!tileSafely.active() || tileSafely.type != (ushort) 314) - vector2_2 = this.RotatedRelativePoint(this.Center + new Vector2((float) (num1 * this.direction) * 0.5f, this.gravDir * (float) num2)) + vector2_1; - int digDirectionY = this.controlDown.ToInt() - this.controlUp.ToInt(); - if (this.controlUp.ToInt() + this.controlDown.ToInt() + this.controlLeft.ToInt() + this.controlRight.ToInt() <= 0) - return; - MinecartDiggerHelper.Instance.TryDigging(this, vector2_2, this.direction, digDirectionY); - } - - private void SpawnFastRunParticles() - { - int num = 0; - if ((double) this.gravDir == -1.0) - num -= this.height; - if (this.runSoundDelay == 0 && (double) this.velocity.Y == 0.0) + else if (this.controlLeft && (double) this.velocity.X > -(double) this.accRunSpeed && this.dashDelay >= 0) { - SoundEngine.PlaySound(this.hermesStepSound.SoundType, (int) this.position.X, (int) this.position.Y, this.hermesStepSound.SoundStyle); - this.runSoundDelay = this.hermesStepSound.IntendedCooldown; - } - if (this.wings == 3) - { - int index1 = Dust.NewDust(new Vector2(this.position.X - 4f, this.position.Y + (float) this.height + (float) num), this.width + 8, 4, 186, (float) (-(double) this.velocity.X * 0.5), this.velocity.Y * 0.5f, 50, Scale: 1.5f); - Main.dust[index1].velocity *= 0.025f; - Main.dust[index1].shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - int index2 = Dust.NewDust(new Vector2(this.position.X - 4f, this.position.Y + (float) this.height + (float) num), this.width + 8, 4, 186, (float) (-(double) this.velocity.X * 0.5), this.velocity.Y * 0.5f, 50, Scale: 1.5f); - Main.dust[index2].velocity *= 0.2f; - Main.dust[index2].shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - } - else if (this.sailDash) - { - for (int index3 = 0; index3 < 4; ++index3) + if (this.mount.Active && this.mount.Cart) { - int index4 = Dust.NewDust(new Vector2(this.position.X - 4f, this.position.Y), this.width + 8, this.height, 253, (float) (-(double) this.velocity.X * 0.5), this.velocity.Y * 0.5f, 100, Scale: 1.5f); - Main.dust[index4].noGravity = true; - Main.dust[index4].velocity.X *= 0.2f; - Main.dust[index4].velocity.Y *= 0.2f; - Main.dust[index4].shader = GameShaders.Armor.GetSecondaryShader(this.cShoe, this); - Main.dust[index4].scale += (float) Main.rand.Next(-5, 3) * 0.1f; - Vector2 vector2 = new Vector2((float) Main.rand.Next(-100, 101), (float) Main.rand.Next(-100, 101)); - vector2.Normalize(); - vector2 *= (float) Main.rand.Next(81) * 0.1f; + if ((double) this.velocity.X < 0.0) + this.direction = -1; + } + else if ((this.itemAnimation == 0 || this.inventory[this.selectedItem].useTurn) && this.mount.AllowDirectionChange) + this.direction = -1; + if ((double) this.velocity.Y == 0.0 || this.wingsLogic > 0 || this.mount.CanFly) + { + if ((double) this.velocity.X > (double) this.runSlowdown) + this.velocity.X -= this.runSlowdown; + this.velocity.X -= this.runAcceleration * 0.2f; + if (this.wingsLogic > 0) + this.velocity.X -= this.runAcceleration * 0.2f; + } + if (this.onWrongGround) + { + if ((double) this.velocity.X < (double) this.runSlowdown) + this.velocity.X += this.runSlowdown; + else + this.velocity.X = 0.0f; + } + if ((double) this.velocity.X < -(double) num1 && (double) this.velocity.Y == 0.0 && !this.mount.Active) + { + int num3 = 0; + if ((double) this.gravDir == -1.0) + num3 -= this.height; + if (this.runSoundDelay == 0 && (double) this.velocity.Y == 0.0) + { + Main.PlaySound(this.hermesStepSound.SoundType, (int) this.position.X, (int) this.position.Y, this.hermesStepSound.SoundStyle); + this.runSoundDelay = this.hermesStepSound.IntendedCooldown; + } + if (this.wings == 3) + { + int index1 = Dust.NewDust(new Vector2(this.position.X - 4f, this.position.Y + (float) this.height + (float) num3), this.width + 8, 4, 186, (float) (-(double) this.velocity.X * 0.5), this.velocity.Y * 0.5f, 50, Scale: 1.5f); + Main.dust[index1].velocity *= 0.025f; + Main.dust[index1].shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); + int index2 = Dust.NewDust(new Vector2(this.position.X - 4f, this.position.Y + (float) this.height + (float) num3), this.width + 8, 4, 186, (float) (-(double) this.velocity.X * 0.5), this.velocity.Y * 0.5f, 50, Scale: 1.5f); + Main.dust[index2].velocity *= 0.2f; + Main.dust[index2].shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); + } + else if (this.sailDash) + { + for (int index3 = 0; index3 < 4; ++index3) + { + int index4 = Dust.NewDust(new Vector2(this.position.X - 4f, this.position.Y), this.width + 8, this.height, 253, (float) (-(double) this.velocity.X * 0.5), this.velocity.Y * 0.5f, 100, Scale: 1.5f); + Main.dust[index4].noGravity = true; + Main.dust[index4].velocity.X *= 0.2f; + Main.dust[index4].velocity.Y *= 0.2f; + Main.dust[index4].shader = GameShaders.Armor.GetSecondaryShader(this.cShoe, this); + Main.dust[index4].scale += (float) Main.rand.Next(-5, 3) * 0.1f; + Vector2 vector2 = new Vector2((float) Main.rand.Next(-100, 101), (float) Main.rand.Next(-100, 101)); + vector2.Normalize(); + vector2 *= (float) Main.rand.Next(81) * 0.1f; + } + } + else if (this.coldDash) + { + for (int index5 = 0; index5 < 2; ++index5) + { + int index6 = index5 != 0 ? Dust.NewDust(new Vector2(this.position.X + (float) (this.width / 2), this.position.Y + (float) this.height + this.gfxOffY), this.width / 2, 6, 76, Scale: 1.35f) : Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float) this.height + this.gfxOffY), this.width / 2, 6, 76, Scale: 1.35f); + Main.dust[index6].scale *= (float) (1.0 + (double) Main.rand.Next(20, 40) * 0.00999999977648258); + Main.dust[index6].noGravity = true; + Main.dust[index6].noLight = true; + Main.dust[index6].velocity *= 1f / 1000f; + Main.dust[index6].velocity.Y -= 3f / 1000f; + Main.dust[index6].shader = GameShaders.Armor.GetSecondaryShader(this.cShoe, this); + } + } + else + { + int index = Dust.NewDust(new Vector2(this.position.X - 4f, this.position.Y + (float) this.height + (float) num3), this.width + 8, 4, 16, (float) (-(double) this.velocity.X * 0.5), this.velocity.Y * 0.5f, 50, Scale: 1.5f); + Main.dust[index].velocity.X *= 0.2f; + Main.dust[index].velocity.Y *= 0.2f; + Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.cShoe, this); + } } } - else if (this.desertDash) + else if (this.controlRight && (double) this.velocity.X < (double) this.accRunSpeed && this.dashDelay >= 0) { - Dust dust = Dust.NewDustDirect(new Vector2(this.position.X - 4f, this.position.Y + (float) this.height + (float) num), this.width + 8, 4, 32, (float) (-(double) this.velocity.X * 0.5), this.velocity.Y * 0.5f); - dust.velocity *= 0.2f; - dust.velocity.Y -= this.gravDir * 2f; - dust.shader = GameShaders.Armor.GetSecondaryShader(this.cShoe, this); - } - else if (this.coldDash) - { - for (int index5 = 0; index5 < 2; ++index5) + if (this.mount.Active && this.mount.Cart) { - int index6 = index5 != 0 ? Dust.NewDust(new Vector2(this.position.X + (float) (this.width / 2), this.position.Y + (float) this.height + this.gfxOffY), this.width / 2, 6, 76, Scale: 1.35f) : Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float) this.height + this.gfxOffY), this.width / 2, 6, 76, Scale: 1.35f); - Main.dust[index6].scale *= (float) (1.0 + (double) Main.rand.Next(20, 40) * 0.00999999977648258); - Main.dust[index6].noGravity = true; - Main.dust[index6].noLight = true; - Main.dust[index6].velocity *= 1f / 1000f; - Main.dust[index6].velocity.Y -= 3f / 1000f; - Main.dust[index6].shader = GameShaders.Armor.GetSecondaryShader(this.cShoe, this); + if ((double) this.velocity.X > 0.0) + this.direction = -1; + } + else if ((this.itemAnimation == 0 || this.inventory[this.selectedItem].useTurn) && this.mount.AllowDirectionChange) + this.direction = 1; + if ((double) this.velocity.Y == 0.0 || this.wingsLogic > 0 || this.mount.CanFly) + { + if ((double) this.velocity.X < -(double) this.runSlowdown) + this.velocity.X += this.runSlowdown; + this.velocity.X += this.runAcceleration * 0.2f; + if (this.wingsLogic > 0) + this.velocity.X += this.runAcceleration * 0.2f; + } + if (this.onWrongGround) + { + if ((double) this.velocity.X > (double) this.runSlowdown) + this.velocity.X -= this.runSlowdown; + else + this.velocity.X = 0.0f; + } + if ((double) this.velocity.X > (double) num1 && (double) this.velocity.Y == 0.0 && !this.mount.Active) + { + int num4 = 0; + if ((double) this.gravDir == -1.0) + num4 -= this.height; + if (this.runSoundDelay == 0 && (double) this.velocity.Y == 0.0) + { + Main.PlaySound(this.hermesStepSound.SoundType, (int) this.position.X, (int) this.position.Y, this.hermesStepSound.SoundStyle); + this.runSoundDelay = this.hermesStepSound.IntendedCooldown; + } + if (this.wings == 3) + { + int index7 = Dust.NewDust(new Vector2(this.position.X - 4f, this.position.Y + (float) this.height + (float) num4), this.width + 8, 4, 186, (float) (-(double) this.velocity.X * 0.5), this.velocity.Y * 0.5f, 50, Scale: 1.5f); + Main.dust[index7].velocity *= 0.025f; + Main.dust[index7].shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); + int index8 = Dust.NewDust(new Vector2(this.position.X - 4f, this.position.Y + (float) this.height + (float) num4), this.width + 8, 4, 186, (float) (-(double) this.velocity.X * 0.5), this.velocity.Y * 0.5f, 50, Scale: 1.5f); + Main.dust[index8].velocity *= 0.2f; + Main.dust[index8].shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); + } + else if (this.sailDash) + { + for (int index9 = 0; index9 < 4; ++index9) + { + int index10 = Dust.NewDust(new Vector2(this.position.X - 4f, this.position.Y), this.width + 8, this.height, 253, (float) (-(double) this.velocity.X * 0.5), this.velocity.Y * 0.5f, 100, Scale: 1.5f); + Main.dust[index10].noGravity = true; + Main.dust[index10].velocity.X *= 0.2f; + Main.dust[index10].velocity.Y *= 0.2f; + Main.dust[index10].shader = GameShaders.Armor.GetSecondaryShader(this.cShoe, this); + Main.dust[index10].scale += (float) Main.rand.Next(-5, 3) * 0.1f; + Vector2 vector2 = new Vector2((float) Main.rand.Next(-100, 101), (float) Main.rand.Next(-100, 101)); + vector2.Normalize(); + vector2 *= (float) Main.rand.Next(81) * 0.1f; + } + } + else if (this.coldDash) + { + for (int index11 = 0; index11 < 2; ++index11) + { + int index12 = index11 != 0 ? Dust.NewDust(new Vector2(this.position.X + (float) (this.width / 2), this.position.Y + (float) this.height + this.gfxOffY), this.width / 2, 6, 76, Scale: 1.35f) : Dust.NewDust(new Vector2(this.position.X, this.position.Y + (float) this.height + this.gfxOffY), this.width / 2, 6, 76, Scale: 1.35f); + Main.dust[index12].scale *= (float) (1.0 + (double) Main.rand.Next(20, 40) * 0.00999999977648258); + Main.dust[index12].noGravity = true; + Main.dust[index12].noLight = true; + Main.dust[index12].velocity *= 1f / 1000f; + Main.dust[index12].velocity.Y -= 3f / 1000f; + Main.dust[index12].shader = GameShaders.Armor.GetSecondaryShader(this.cShoe, this); + } + } + else + { + int index = Dust.NewDust(new Vector2(this.position.X - 4f, this.position.Y + (float) this.height + (float) num4), this.width + 8, 4, 16, (float) (-(double) this.velocity.X * 0.5), this.velocity.Y * 0.5f, 50, Scale: 1.5f); + Main.dust[index].velocity.X *= 0.2f; + Main.dust[index].velocity.Y *= 0.2f; + Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.cShoe, this); + } } } - else if (this.fairyBoots) + else if (this.mount.Active && this.mount.Cart && (double) Math.Abs(this.velocity.X) >= 1.0) { - int Type = (int) Main.rand.NextFromList((short) 61, (short) 61, (short) 61, (short) 242, (short) 64, (short) 63); - int Alpha = 0; - for (int index7 = 1; index7 < 3; ++index7) + if (this.onWrongGround) { - float Scale = 1.5f; - if (index7 == 2) - Scale = 1f; - int index8 = Dust.NewDust(new Vector2(this.position.X - 4f, this.position.Y + (float) this.height + (float) num), this.width + 8, 4, Type, (float) (-(double) this.velocity.X * 0.5), this.velocity.Y * 0.5f, Alpha, Scale: Scale); - Main.dust[index8].velocity *= 1.5f; - if (index7 == 2) - Main.dust[index8].position += Main.dust[index8].velocity; - Main.dust[index8].noGravity = true; - Main.dust[index8].noLightEmittence = true; - Main.dust[index8].shader = GameShaders.Armor.GetSecondaryShader(this.cShoe, this); + if ((double) this.velocity.X > 0.0) + { + if ((double) this.velocity.X > (double) this.runSlowdown) + this.velocity.X -= this.runSlowdown; + else + this.velocity.X = 0.0f; + } + else if ((double) this.velocity.X < 0.0) + { + if ((double) this.velocity.X < -(double) this.runSlowdown) + this.velocity.X += this.runSlowdown; + else + this.velocity.X = 0.0f; + } + } + if ((double) this.velocity.X > (double) this.maxRunSpeed) + this.velocity.X = this.maxRunSpeed; + if ((double) this.velocity.X < -(double) this.maxRunSpeed) + this.velocity.X = -this.maxRunSpeed; + } + else if ((double) this.velocity.Y == 0.0) + { + if ((double) this.velocity.X > (double) this.runSlowdown) + this.velocity.X -= this.runSlowdown; + else if ((double) this.velocity.X < -(double) this.runSlowdown) + this.velocity.X += this.runSlowdown; + else + this.velocity.X = 0.0f; + } + else if (!this.PortalPhysicsEnabled) + { + if ((double) this.velocity.X > (double) this.runSlowdown * 0.5) + this.velocity.X -= this.runSlowdown * 0.5f; + else if ((double) this.velocity.X < -(double) this.runSlowdown * 0.5) + this.velocity.X += this.runSlowdown * 0.5f; + else + this.velocity.X = 0.0f; + } + if (flag3) + { + if ((double) num2 < 0.0 && (double) this.velocity.X > (double) num2) + { + this.velocity.X += num2; + if ((double) this.velocity.X < (double) num2) + this.velocity.X = num2; + } + if ((double) num2 > 0.0 && (double) this.velocity.X < (double) num2) + { + this.velocity.X += num2; + if ((double) this.velocity.X > (double) num2) + this.velocity.X = num2; } } - else + if (this.mount.Active && this.mount.Type == 10 && (double) Math.Abs(this.velocity.X) > (double) this.mount.DashSpeed - (double) this.mount.RunSpeed / 2.0) { - int index = Dust.NewDust(new Vector2(this.position.X - 4f, this.position.Y + (float) this.height + (float) num), this.width + 8, 4, 16, (float) (-(double) this.velocity.X * 0.5), this.velocity.Y * 0.5f, 50, Scale: 1.5f); - Main.dust[index].velocity.X *= 0.2f; - Main.dust[index].velocity.Y *= 0.2f; - Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.cShoe, this); - } - } - - private void MowTheLawn() - { - if (this.miscCounter % 2 != 0 || (double) this.velocity.Y != 0.0 || this.grappling[0] != -1 || this.itemAnimation < 1) - return; - Vector2 vector2 = this.Center + new Vector2((float) (this.direction * 38), (float) (this.height / 2 + 4) * this.gravDir); - float num = (float) (1.0 - (double) this.itemAnimation / (double) this.itemAnimationMax) * 2f; - float amount = (double) num >= 1.0 ? num - 1f : 1f - num; - Dust dust = Dust.NewDustDirect(Vector2.Lerp(vector2 + new Vector2((float) (this.direction * -16), this.gravDir * -4f), vector2 + new Vector2((float) (this.direction * -6), this.gravDir * -4f), amount), 0, 0, 31, SpeedY: ((float) (-(double) this.gravDir * 0.25)), Alpha: ((int) sbyte.MaxValue)); - dust.scale = 0.9f; - dust.position -= new Vector2(4f); - if ((double) dust.velocity.Y > 0.0) - dust.velocity.Y *= -1f; - dust.velocity *= 0.25f; - Microsoft.Xna.Framework.Rectangle itemRectangle = Utils.CenteredRectangle(vector2, new Vector2(8f, 20f)); - if ((double) this.velocity.X * (double) this.direction > 0.0 || (double) this.velocity.Y * (double) this.gravDir > 0.0) - { - Microsoft.Xna.Framework.Rectangle myRect = itemRectangle; - myRect.Height -= 4; - myRect.Y += 2; - float Damage = 8f; - float Knockback = 2f; - int NPCImmuneTime = 12; + Microsoft.Xna.Framework.Rectangle rect = this.getRect(); + if (this.direction == 1) + rect.Offset(this.width - 1, 0); + rect.Width = 2; + rect.Inflate(6, 12); + float Damage = 80f * this.minionDamage; + float Knockback = 10f; + int NPCImmuneTime = 30; int PlayerImmuneTime = 6; - this.CollideWithNPCs(myRect, Damage, Knockback, NPCImmuneTime, PlayerImmuneTime); + this.CollideWithNPCs(rect, Damage, Knockback, NPCImmuneTime, PlayerImmuneTime); } - itemRectangle.X -= this.direction * 10; - List tileCutIgnoreList = Player.ItemCheck_GetTileCutIgnoreList(this.HeldItem); - Player.ItemCheck_CutTiles(this.HeldItem, itemRectangle, tileCutIgnoreList); - this.MowGrassTile(vector2); - if (WorldGen.SolidTile(Framing.GetTileSafely(vector2.ToTileCoordinates()))) + if (!this.mount.Active || this.mount.Type != 14 || (double) Math.Abs(this.velocity.X) <= (double) this.mount.RunSpeed / 2.0) return; - this.MowGrassTile(vector2 + new Vector2(0.0f, 16f * this.gravDir)); - } - - private void MowGrassTile(Vector2 thePos) - { - Point tileCoordinates = thePos.ToTileCoordinates(); - Tile tileCache = Main.tile[tileCoordinates.X, tileCoordinates.Y]; - if (tileCache == null || !WorldGen.CanKillTile(tileCoordinates.X, tileCoordinates.Y, WorldGen.SpecialKillTileContext.MowingTheGrass)) - return; - ushort num = 0; - switch (tileCache.type) - { - case 2: - num = (ushort) 477; - break; - case 109: - num = (ushort) 492; - break; - } - if (num == (ushort) 0) - return; - int tileDustAmount = WorldGen.KillTile_GetTileDustAmount(true, tileCache); - for (int index = 0; index < tileDustAmount; ++index) - WorldGen.KillTile_MakeTileDust(tileCoordinates.X, tileCoordinates.Y, tileCache); - tileCache.type = num; - if (Main.netMode != 1) - return; - NetMessage.SendTileSquare(-1, tileCoordinates.X, tileCoordinates.Y, 1); + Microsoft.Xna.Framework.Rectangle rect1 = this.getRect(); + if (this.direction == 1) + rect1.Offset(this.width - 1, 0); + rect1.Width = 2; + rect1.Inflate(6, 12); + float Damage1 = 90f * this.minionDamage; + float Knockback1 = 10f; + int NPCImmuneTime1 = 30; + int PlayerImmuneTime1 = 6; + this.CollideWithNPCs(rect1, Damage1, Knockback1, NPCImmuneTime1, PlayerImmuneTime1); } private int CollideWithNPCs( @@ -12758,7 +12159,7 @@ namespace Terraria for (int index = 0; index < 200; ++index) { NPC npc = Main.npc[index]; - if (npc.active && !npc.dontTakeDamage && !npc.friendly && npc.immune[this.whoAmI] == 0 && this.CanNPCBeHitByPlayerOrPlayerProjectile(npc)) + if (npc.active && !npc.dontTakeDamage && !npc.friendly && npc.immune[this.whoAmI] == 0) { Microsoft.Xna.Framework.Rectangle rect = npc.getRect(); if (myRect.Intersects(rect) && (npc.noTileCollide || Collision.CanHit(this.position, this.width, this.height, npc.position, npc.width, npc.height))) @@ -12771,7 +12172,9 @@ namespace Terraria if (this.whoAmI == Main.myPlayer) this.ApplyDamageToNPC(npc, (int) Damage, Knockback, direction, false); npc.immune[this.whoAmI] = NPCImmuneTime; - this.GiveImmuneTimeForCollisionAttack(PlayerImmuneTime); + this.immune = true; + this.immuneNoBlink = true; + this.immuneTime = PlayerImmuneTime; ++num; break; } @@ -12782,44 +12185,20 @@ namespace Terraria public void ApplyDamageToNPC(NPC npc, int damage, float knockback, int direction, bool crit) { - int num1 = Item.NPCtoBanner(npc.BannerID()); - if (num1 > 0 && this.HasNPCBannerBuff(num1)) - damage = !Main.expertMode ? (int) ((double) damage * (double) ItemID.Sets.BannerStrength[Item.BannerToItem(num1)].NormalDamageDealt) : (int) ((double) damage * (double) ItemID.Sets.BannerStrength[Item.BannerToItem(num1)].ExpertDamageDealt); - this.OnHit(npc.Center.X, npc.Center.Y, (Entity) npc); - if (this.armorPenetration > 0) - damage += npc.checkArmorPenetration(this.armorPenetration); - int dmg = (int) npc.StrikeNPC(damage, knockback, direction, crit); - if (this.accDreamCatcher) - this.addDPS(dmg); + npc.StrikeNPC(damage, knockback, direction, crit); if (Main.netMode != 0) NetMessage.SendData(28, number: npc.whoAmI, number2: ((float) damage), number3: knockback, number4: ((float) direction), number5: crit.ToInt()); - int num2 = Item.NPCtoBanner(npc.BannerID()); - if (num2 < 0) + int num = Item.NPCtoBanner(npc.BannerID()); + if (num < 0) return; - this.lastCreatureHit = num2; + this.lastCreatureHit = num; } - public bool SlimeDontHyperJump => this.mount.Active && this.mount.IsConsideredASlimeMount && this.wetSlime > (byte) 0 && !this.controlJump; - - public void GiveImmuneTimeForCollisionAttack(int time) - { - if (this._timeSinceLastImmuneGet <= 20) - ++this._immuneStrikes; - else - this._immuneStrikes = 1; - this._timeSinceLastImmuneGet = 0; - if (this._immuneStrikes >= 3 || this.immune && this.immuneTime > time) - return; - this.immune = true; - this.immuneNoBlink = true; - this.immuneTime = time; - } - - public bool CanNPCBeHitByPlayerOrPlayerProjectile(NPC npc) => !this.dontHurtCritters || !NPCID.Sets.CountsAsCritter[npc.type]; + public bool SlimeDontHyperJump => this.mount.Active && this.mount.Type == 3 && this.wetSlime > (byte) 0 && !this.controlJump; public void JumpMovement() { - if (this.mount.Active && this.mount.IsConsideredASlimeMount && this.wetSlime == (byte) 0 && (double) this.velocity.Y > 0.0) + if (this.mount.Active && this.mount.Type == 3 && this.wetSlime == (byte) 0 && (double) this.velocity.Y > 0.0) { Microsoft.Xna.Framework.Rectangle rect1 = this.getRect(); rect1.Offset(0, this.height - 1); @@ -12828,7 +12207,7 @@ namespace Terraria for (int index = 0; index < 200; ++index) { NPC npc = Main.npc[index]; - if (npc.active && !npc.dontTakeDamage && !npc.friendly && npc.immune[this.whoAmI] == 0 && this.CanNPCBeHitByPlayerOrPlayerProjectile(npc)) + if (npc.active && !npc.dontTakeDamage && !npc.friendly && npc.immune[this.whoAmI] == 0) { Microsoft.Xna.Framework.Rectangle rect2 = npc.getRect(); if (rect1.Intersects(rect2) && (npc.noTileCollide || Collision.CanHit(this.position, this.width, this.height, npc.position, npc.width, npc.height))) @@ -12844,37 +12223,9 @@ namespace Terraria this.ApplyDamageToNPC(npc, (int) num, knockback, direction, false); npc.immune[this.whoAmI] = 10; this.velocity.Y = -10f; - this.GiveImmuneTimeForCollisionAttack(6); - break; - } - } - } - } - if (this.mount.Active && this.mount.Type == 17 && (double) this.velocity.Y > 0.0) - { - Microsoft.Xna.Framework.Rectangle rect3 = this.getRect(); - rect3.Offset(0, this.height - 1); - rect3.Height = 2; - rect3.Inflate(12, 6); - for (int index = 0; index < 200; ++index) - { - NPC npc = Main.npc[index]; - if (npc.active && !npc.dontTakeDamage && !npc.friendly && npc.immune[this.whoAmI] == 0 && this.CanNPCBeHitByPlayerOrPlayerProjectile(npc)) - { - Microsoft.Xna.Framework.Rectangle rect4 = npc.getRect(); - if (rect3.Intersects(rect4) && (npc.noTileCollide || Collision.CanHit(this.position, this.width, this.height, npc.position, npc.width, npc.height))) - { - float num = 40f; - float knockback = 5f; - int direction = this.direction; - if ((double) this.velocity.X < 0.0) - direction = -1; - if ((double) this.velocity.X > 0.0) - direction = 1; - if (this.whoAmI == Main.myPlayer) - this.ApplyDamageToNPC(npc, (int) num, knockback, direction, false); - npc.immune[this.whoAmI] = 12; - this.GiveImmuneTimeForCollisionAttack(12); + this.immune = true; + this.immuneNoBlink = true; + this.immuneTime = 6; break; } } @@ -12882,18 +12233,9 @@ namespace Terraria } if (this.controlJump) { - if (this.sliding) - this.autoJump = false; bool flag1 = false; - bool flag2 = this.wet && this.accFlipper; - bool flag3 = !this.mount.Active || !this.mount.Cart; - if (this.mount.Active && this.mount.IsConsideredASlimeMount && this.wetSlime > (byte) 0) - { - this.wetSlime = (byte) 0; + if (this.mount.Active && this.mount.Type == 3 && this.wetSlime > (byte) 0) flag1 = true; - } - if (this.mount.Active && this.mount.Type == 43 && this.releaseJump && (double) this.velocity.Y != 0.0) - this.isPerformingPogostickTricks = true; if (this.jump > 0) { if ((double) this.velocity.Y == 0.0) @@ -12912,115 +12254,98 @@ namespace Terraria --this.jump; } } - else if ((((this.sliding ? 1 : ((double) this.velocity.Y == 0.0 ? 1 : 0)) | (flag1 ? 1 : 0)) != 0 || this.canJumpAgain_Cloud || this.canJumpAgain_Sandstorm || this.canJumpAgain_Blizzard || this.canJumpAgain_Fart || this.canJumpAgain_Sail || this.canJumpAgain_Unicorn || this.canJumpAgain_Santank || this.canJumpAgain_WallOfFleshGoat || this.canJumpAgain_Basilisk || flag2 & flag3) && (this.releaseJump || this.autoJump && ((double) this.velocity.Y == 0.0 || this.sliding))) + else if ((((this.sliding ? 1 : ((double) this.velocity.Y == 0.0 ? 1 : 0)) | (flag1 ? 1 : 0)) != 0 || this.jumpAgainCloud || this.jumpAgainSandstorm || this.jumpAgainBlizzard || this.jumpAgainFart || this.jumpAgainSail || this.jumpAgainUnicorn || this.wet && this.accFlipper && (!this.mount.Active || !this.mount.Cart)) && (this.releaseJump || this.autoJump && ((double) this.velocity.Y == 0.0 || this.sliding))) { - if (this.mount.Active && MountID.Sets.Cart[this.mount.Type]) - this.position.Y -= 1f / 1000f; if (this.sliding || (double) this.velocity.Y == 0.0) this.justJumped = true; - bool flag4 = false; + bool flag2 = false; if (this.wet && this.accFlipper) { if (this.swimTime == 0) this.swimTime = 30; - flag4 = true; + flag2 = true; } + bool flag3 = false; + bool flag4 = false; bool flag5 = false; bool flag6 = false; bool flag7 = false; - bool flag8 = false; - bool flag9 = false; - bool flag10 = false; - bool flag11 = false; - bool flag12 = false; - if (!flag2 && !flag1) + if (!flag1) { - if (this.canJumpAgain_Basilisk) + if (this.jumpAgainUnicorn) { - flag12 = true; - this.canJumpAgain_Basilisk = false; - } - if (this.canJumpAgain_WallOfFleshGoat) - { - flag11 = true; - this.canJumpAgain_WallOfFleshGoat = false; - } - else if (this.canJumpAgain_Santank) - { - flag10 = true; - this.canJumpAgain_Santank = false; - } - else if (this.canJumpAgain_Unicorn) - { - flag9 = true; - this.canJumpAgain_Unicorn = false; - } - else if (this.canJumpAgain_Sandstorm) - { - flag5 = true; - this.canJumpAgain_Sandstorm = false; - } - else if (this.canJumpAgain_Blizzard) - { - flag6 = true; - this.canJumpAgain_Blizzard = false; - } - else if (this.canJumpAgain_Fart) - { - this.canJumpAgain_Fart = false; flag7 = true; + this.jumpAgainUnicorn = false; } - else if (this.canJumpAgain_Sail) + else if (this.jumpAgainSandstorm) { - this.canJumpAgain_Sail = false; - flag8 = true; + flag3 = true; + this.jumpAgainSandstorm = false; + } + else if (this.jumpAgainBlizzard) + { + flag4 = true; + this.jumpAgainBlizzard = false; + } + else if (this.jumpAgainFart) + { + this.jumpAgainFart = false; + flag5 = true; + } + else if (this.jumpAgainSail) + { + this.jumpAgainSail = false; + flag6 = true; } else - this.canJumpAgain_Cloud = false; + this.jumpAgainCloud = false; } this.canRocket = false; this.rocketRelease = false; - if (((double) this.velocity.Y == 0.0 || this.sliding ? 1 : (!this.autoJump ? 0 : (this.justJumped ? 1 : 0))) != 0) - this.RefreshDoubleJumps(); - if ((((double) this.velocity.Y == 0.0 | flag4 ? 1 : (this.sliding ? 1 : 0)) | (flag1 ? 1 : 0)) != 0) + if (((double) this.velocity.Y == 0.0 || this.sliding || this.autoJump && this.justJumped) && this.doubleJumpCloud) + this.jumpAgainCloud = true; + if (((double) this.velocity.Y == 0.0 || this.sliding || this.autoJump && this.justJumped) && this.doubleJumpSandstorm) + this.jumpAgainSandstorm = true; + if (((double) this.velocity.Y == 0.0 || this.sliding || this.autoJump && this.justJumped) && this.doubleJumpBlizzard) + this.jumpAgainBlizzard = true; + if (((double) this.velocity.Y == 0.0 || this.sliding || this.autoJump && this.justJumped) && this.doubleJumpFart) + this.jumpAgainFart = true; + if (((double) this.velocity.Y == 0.0 || this.sliding || this.autoJump && this.justJumped) && this.doubleJumpSail) + this.jumpAgainSail = true; + if (((double) this.velocity.Y == 0.0 || this.sliding || this.autoJump && this.justJumped) && this.doubleJumpUnicorn) + this.jumpAgainUnicorn = true; + if ((((double) this.velocity.Y == 0.0 | flag2 ? 1 : (this.sliding ? 1 : 0)) | (flag1 ? 1 : 0)) != 0) { - if (this.mount.Active && this.mount.Type == 43) - SoundEngine.PlaySound(SoundID.Item168, this.Center); this.velocity.Y = -Player.jumpSpeed * this.gravDir; this.jump = Player.jumpHeight; - if (this.portableStoolInfo.IsInUse) - { - this.position.Y -= (float) this.portableStoolInfo.HeightBoost; - this.gfxOffY += (float) this.portableStoolInfo.HeightBoost; - } if (this.sliding) this.velocity.X = (float) (3 * -this.slideDir); } - else if (flag5) + else if (flag3) { - this.isPerformingJump_Sandstorm = true; + this.dJumpEffectSandstorm = true; int height = this.height; double gravDir = (double) this.gravDir; - SoundEngine.PlaySound(16, (int) this.position.X, (int) this.position.Y); + Main.PlaySound(16, (int) this.position.X, (int) this.position.Y); this.velocity.Y = -Player.jumpSpeed * this.gravDir; this.jump = Player.jumpHeight * 3; } - else if (flag6) + else if (flag4) { - this.isPerformingJump_Blizzard = true; + this.dJumpEffectBlizzard = true; int height = this.height; double gravDir = (double) this.gravDir; - SoundEngine.PlaySound(16, (int) this.position.X, (int) this.position.Y); + Main.PlaySound(16, (int) this.position.X, (int) this.position.Y); this.velocity.Y = -Player.jumpSpeed * this.gravDir; this.jump = (int) ((double) Player.jumpHeight * 1.5); } - else if (flag8) + else if (flag6) { - this.isPerformingJump_Sail = true; + this.dJumpEffectSail = true; int num = this.height; if ((double) this.gravDir == -1.0) num = 0; - SoundEngine.PlaySound(16, (int) this.position.X, (int) this.position.Y); + Main.PlaySound(16, (int) this.position.X, (int) this.position.Y); this.velocity.Y = -Player.jumpSpeed * this.gravDir; this.jump = (int) ((double) Player.jumpHeight * 1.25); for (int index1 = 0; index1 < 30; ++index1) @@ -13039,13 +12364,13 @@ namespace Terraria vector2 *= (float) Main.rand.Next(81) * 0.1f; } } - else if (flag7) + else if (flag5) { - this.isPerformingJump_Fart = true; + this.dJumpEffectFart = true; int num = this.height; if ((double) this.gravDir == -1.0) num = 0; - SoundEngine.PlaySound(SoundID.Item16, this.position); + Main.PlaySound(SoundID.Item16, this.position); this.velocity.Y = -Player.jumpSpeed * this.gravDir; this.jump = Player.jumpHeight * 2; for (int index3 = 0; index3 < 10; ++index3) @@ -13064,12 +12389,12 @@ namespace Terraria Main.gore[index7].velocity.X = (float) ((double) Main.gore[index7].velocity.X * 0.100000001490116 - (double) this.velocity.X * 0.100000001490116); Main.gore[index7].velocity.Y = (float) ((double) Main.gore[index7].velocity.Y * 0.100000001490116 - (double) this.velocity.Y * 0.0500000007450581); } - else if (flag9) + else if (flag7) { - this.isPerformingJump_Unicorn = true; + this.dJumpEffectUnicorn = true; int height = this.height; double gravDir = (double) this.gravDir; - SoundEngine.PlaySound(16, (int) this.position.X, (int) this.position.Y); + Main.PlaySound(16, (int) this.position.X, (int) this.position.Y); this.velocity.Y = -Player.jumpSpeed * this.gravDir; this.jump = Player.jumpHeight * 2; Vector2 center = this.Center; @@ -13090,125 +12415,30 @@ namespace Terraria } } } - else if (flag11) - { - this.isPerformingJump_WallOfFleshGoat = true; - int height = this.height; - double gravDir = (double) this.gravDir; - SoundEngine.PlaySound(16, (int) this.position.X, (int) this.position.Y); - this.velocity.Y = -Player.jumpSpeed * this.gravDir; - this.jump = Player.jumpHeight * 2; - Vector2 center = this.Center; - Vector2 vector2_3 = new Vector2(50f, 20f); - float num3 = 6.283185f * Main.rand.NextFloat(); - for (int index = 0; index < 5; ++index) - { - for (float num4 = 0.0f; (double) num4 < 14.0; ++num4) - { - Dust dust = Main.dust[Dust.NewDust(center, 0, 0, 6)]; - Vector2 vector2_4 = Vector2.UnitY.RotatedBy((double) num4 * 6.28318548202515 / 14.0 + (double) num3) * (0.2f * (float) index); - dust.position = center + vector2_4 * vector2_3; - dust.velocity = vector2_4 + new Vector2(0.0f, this.gravDir * 4f); - dust.noGravity = true; - dust.scale = (float) (1.0 + (double) Main.rand.NextFloat() * 0.800000011920929); - dust.fadeIn = Main.rand.NextFloat() * 2f; - dust.shader = GameShaders.Armor.GetSecondaryShader(this.cMount, this); - } - } - } - else if (flag12) - { - this.isPerformingJump_Basilisk = true; - int height = this.height; - double gravDir = (double) this.gravDir; - SoundEngine.PlaySound(16, (int) this.position.X, (int) this.position.Y); - this.velocity.Y = -Player.jumpSpeed * this.gravDir; - this.jump = (int) ((double) Player.jumpHeight * 0.75); - Vector2 center = this.Center; - Vector2 vector2_5 = new Vector2(50f, 20f); - float num5 = 6.283185f * Main.rand.NextFloat(); - for (int index = 0; index < 5; ++index) - { - for (float num6 = 0.0f; (double) num6 < 14.0; ++num6) - { - Dust dust = Main.dust[Dust.NewDust(center, 0, 0, 31)]; - Vector2 vector2_6 = Vector2.UnitY.RotatedBy((double) num6 * 6.28318548202515 / 14.0 + (double) num5) * (0.2f * (float) index); - dust.position = center + vector2_6 * vector2_5; - dust.velocity = vector2_6 + new Vector2(0.0f, this.gravDir * 4f); - dust.noGravity = true; - dust.scale = (float) (1.0 + (double) Main.rand.NextFloat() * 0.800000011920929); - dust.fadeIn = Main.rand.NextFloat() * 2f; - dust.shader = GameShaders.Armor.GetSecondaryShader(this.cMount, this); - } - } - } - else if (flag10) - { - this.isPerformingJump_Santank = true; - int num = this.height; - if ((double) this.gravDir == -1.0) - num = 0; - SoundEngine.PlaySound(16, (int) this.position.X, (int) this.position.Y); - this.velocity.Y = -Player.jumpSpeed * this.gravDir; - this.jump = Player.jumpHeight * 2; - for (int index8 = 0; index8 < 15; ++index8) - { - int index9 = Dust.NewDust(new Vector2(this.position.X - 34f, (float) ((double) this.position.Y + (double) num - 16.0)), 102, 32, 4, (float) (-(double) this.velocity.X * 0.5), this.velocity.Y * 0.5f, 100, new Color(250, 230, 230, 150), 1.5f); - Main.dust[index9].velocity.X = (float) ((double) Main.dust[index9].velocity.X * 0.5 - (double) this.velocity.X * 0.100000001490116); - Main.dust[index9].velocity.Y = (float) ((double) Main.dust[index9].velocity.Y * 0.5 - (double) this.velocity.Y * 0.300000011920929); - Main.dust[index9].noGravity = true; - int index10 = Dust.NewDust(new Vector2(this.position.X - 34f, (float) ((double) this.position.Y + (double) num - 16.0)), 102, 32, 6, (float) (-(double) this.velocity.X * 0.5), this.velocity.Y * 0.5f, 20, Scale: 1.5f); - --Main.dust[index10].velocity.Y; - if (index8 % 2 == 0) - Main.dust[index10].fadeIn = Main.rand.NextFloat() * 2f; - } - float y = this.Bottom.Y - 22f; - for (int index11 = 0; index11 < 3; ++index11) - { - Vector2 Position = this.Center; - switch (index11) - { - case 0: - Position = new Vector2(this.Center.X - 16f, y); - break; - case 1: - Position = new Vector2(this.position.X - 36f, y); - break; - case 2: - Position = new Vector2(this.Right.X + 4f, y); - break; - } - int index12 = Gore.NewGore(Position, new Vector2(-this.velocity.X, -this.velocity.Y), Main.rand.Next(61, 63)); - Main.gore[index12].velocity *= 0.1f; - Main.gore[index12].velocity.X -= this.velocity.X * 0.1f; - Main.gore[index12].velocity.Y -= this.velocity.Y * 0.05f; - Main.gore[index12].velocity += Main.rand.NextVector2Circular(1f, 1f) * 0.5f; - } - } else { - this.isPerformingJump_Cloud = true; + this.dJumpEffectCloud = true; int num = this.height; if ((double) this.gravDir == -1.0) num = 0; - SoundEngine.PlaySound(16, (int) this.position.X, (int) this.position.Y); + Main.PlaySound(16, (int) this.position.X, (int) this.position.Y); this.velocity.Y = -Player.jumpSpeed * this.gravDir; this.jump = (int) ((double) Player.jumpHeight * 0.75); - for (int index13 = 0; index13 < 10; ++index13) + for (int index8 = 0; index8 < 10; ++index8) { - int index14 = Dust.NewDust(new Vector2(this.position.X - 34f, (float) ((double) this.position.Y + (double) num - 16.0)), 102, 32, 16, (float) (-(double) this.velocity.X * 0.5), this.velocity.Y * 0.5f, 100, Scale: 1.5f); - Main.dust[index14].velocity.X = (float) ((double) Main.dust[index14].velocity.X * 0.5 - (double) this.velocity.X * 0.100000001490116); - Main.dust[index14].velocity.Y = (float) ((double) Main.dust[index14].velocity.Y * 0.5 - (double) this.velocity.Y * 0.300000011920929); + int index9 = Dust.NewDust(new Vector2(this.position.X - 34f, (float) ((double) this.position.Y + (double) num - 16.0)), 102, 32, 16, (float) (-(double) this.velocity.X * 0.5), this.velocity.Y * 0.5f, 100, Scale: 1.5f); + Main.dust[index9].velocity.X = (float) ((double) Main.dust[index9].velocity.X * 0.5 - (double) this.velocity.X * 0.100000001490116); + Main.dust[index9].velocity.Y = (float) ((double) Main.dust[index9].velocity.Y * 0.5 - (double) this.velocity.Y * 0.300000011920929); } - int index15 = Gore.NewGore(new Vector2((float) ((double) this.position.X + (double) (this.width / 2) - 16.0), (float) ((double) this.position.Y + (double) num - 16.0)), new Vector2(-this.velocity.X, -this.velocity.Y), Main.rand.Next(11, 14)); - Main.gore[index15].velocity.X = (float) ((double) Main.gore[index15].velocity.X * 0.100000001490116 - (double) this.velocity.X * 0.100000001490116); - Main.gore[index15].velocity.Y = (float) ((double) Main.gore[index15].velocity.Y * 0.100000001490116 - (double) this.velocity.Y * 0.0500000007450581); - int index16 = Gore.NewGore(new Vector2(this.position.X - 36f, (float) ((double) this.position.Y + (double) num - 16.0)), new Vector2(-this.velocity.X, -this.velocity.Y), Main.rand.Next(11, 14)); - Main.gore[index16].velocity.X = (float) ((double) Main.gore[index16].velocity.X * 0.100000001490116 - (double) this.velocity.X * 0.100000001490116); - Main.gore[index16].velocity.Y = (float) ((double) Main.gore[index16].velocity.Y * 0.100000001490116 - (double) this.velocity.Y * 0.0500000007450581); - int index17 = Gore.NewGore(new Vector2((float) ((double) this.position.X + (double) this.width + 4.0), (float) ((double) this.position.Y + (double) num - 16.0)), new Vector2(-this.velocity.X, -this.velocity.Y), Main.rand.Next(11, 14)); - Main.gore[index17].velocity.X = (float) ((double) Main.gore[index17].velocity.X * 0.100000001490116 - (double) this.velocity.X * 0.100000001490116); - Main.gore[index17].velocity.Y = (float) ((double) Main.gore[index17].velocity.Y * 0.100000001490116 - (double) this.velocity.Y * 0.0500000007450581); + int index10 = Gore.NewGore(new Vector2((float) ((double) this.position.X + (double) (this.width / 2) - 16.0), (float) ((double) this.position.Y + (double) num - 16.0)), new Vector2(-this.velocity.X, -this.velocity.Y), Main.rand.Next(11, 14)); + Main.gore[index10].velocity.X = (float) ((double) Main.gore[index10].velocity.X * 0.100000001490116 - (double) this.velocity.X * 0.100000001490116); + Main.gore[index10].velocity.Y = (float) ((double) Main.gore[index10].velocity.Y * 0.100000001490116 - (double) this.velocity.Y * 0.0500000007450581); + int index11 = Gore.NewGore(new Vector2(this.position.X - 36f, (float) ((double) this.position.Y + (double) num - 16.0)), new Vector2(-this.velocity.X, -this.velocity.Y), Main.rand.Next(11, 14)); + Main.gore[index11].velocity.X = (float) ((double) Main.gore[index11].velocity.X * 0.100000001490116 - (double) this.velocity.X * 0.100000001490116); + Main.gore[index11].velocity.Y = (float) ((double) Main.gore[index11].velocity.Y * 0.100000001490116 - (double) this.velocity.Y * 0.0500000007450581); + int index12 = Gore.NewGore(new Vector2((float) ((double) this.position.X + (double) this.width + 4.0), (float) ((double) this.position.Y + (double) num - 16.0)), new Vector2(-this.velocity.X, -this.velocity.Y), Main.rand.Next(11, 14)); + Main.gore[index12].velocity.X = (float) ((double) Main.gore[index12].velocity.X * 0.100000001490116 - (double) this.velocity.X * 0.100000001490116); + Main.gore[index12].velocity.Y = (float) ((double) Main.gore[index12].velocity.Y * 0.100000001490116 - (double) this.velocity.Y * 0.0500000007450581); } } this.releaseJump = false; @@ -13223,13 +12453,6 @@ namespace Terraria public void DashMovement() { - if (this.dashDelay == 0) - this.dash = this.dashType; - if (this.dash == 0) - { - this.dashTime = 0; - this.dashDelay = 0; - } if (this.dash == 2 && this.eocDash > 0) { if (this.eocHit < 0) @@ -13237,9 +12460,9 @@ namespace Terraria Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle((int) ((double) this.position.X + (double) this.velocity.X * 0.5 - 4.0), (int) ((double) this.position.Y + (double) this.velocity.Y * 0.5 - 4.0), this.width + 8, this.height + 8); for (int index = 0; index < 200; ++index) { - NPC npc = Main.npc[index]; - if (npc.active && !npc.dontTakeDamage && !npc.friendly && (npc.aiStyle != 112 || (double) npc.ai[2] <= 1.0) && this.CanNPCBeHitByPlayerOrPlayerProjectile(npc)) + if (Main.npc[index].active && !Main.npc[index].dontTakeDamage && !Main.npc[index].friendly) { + NPC npc = Main.npc[index]; Microsoft.Xna.Framework.Rectangle rect = npc.getRect(); if (rectangle.Intersects(rect) && (npc.noTileCollide || this.CanHit((Entity) npc))) { @@ -13263,7 +12486,9 @@ namespace Terraria this.dashDelay = 30; this.velocity.X = (float) (-direction * 9); this.velocity.Y = -4f; - this.GiveImmuneTimeForCollisionAttack(4); + this.immune = true; + this.immuneNoBlink = true; + this.immuneTime = 4; this.eocHit = index; } } @@ -13277,9 +12502,9 @@ namespace Terraria Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle((int) ((double) this.position.X + (double) this.velocity.X * 0.5 - 4.0), (int) ((double) this.position.Y + (double) this.velocity.Y * 0.5 - 4.0), this.width + 8, this.height + 8); for (int index1 = 0; index1 < 200; ++index1) { - NPC npc = Main.npc[index1]; - if (npc.active && !npc.dontTakeDamage && !npc.friendly && npc.immune[this.whoAmI] <= 0 && (npc.aiStyle != 112 || (double) npc.ai[2] <= 1.0) && this.CanNPCBeHitByPlayerOrPlayerProjectile(npc)) + if (Main.npc[index1].active && !Main.npc[index1].dontTakeDamage && !Main.npc[index1].friendly && Main.npc[index1].immune[this.whoAmI] <= 0) { + NPC npc = Main.npc[index1]; Microsoft.Xna.Framework.Rectangle rect = npc.getRect(); if (rectangle.Intersects(rect) && (npc.noTileCollide || this.CanHit((Entity) npc))) { @@ -13309,7 +12534,9 @@ namespace Terraria Main.projectile[index2].Kill(); } npc.immune[this.whoAmI] = 6; - this.GiveImmuneTimeForCollisionAttack(4); + this.immune = true; + this.immuneNoBlink = true; + this.immuneTime = 4; } } } @@ -13324,7 +12551,6 @@ namespace Terraria } else if (this.dashDelay < 0) { - this.StopVanityActions(); float num1 = 12f; float num2 = 0.992f; float num3 = Math.Max(this.accRunSpeed, this.maxRunSpeed); @@ -13337,6 +12563,7 @@ namespace Terraria int index4 = (double) this.velocity.Y != 0.0 ? Dust.NewDust(new Vector2(this.position.X, (float) ((double) this.position.Y + (double) (this.height / 2) - 8.0)), this.width, 16, 31, Alpha: 100, Scale: 1.4f) : Dust.NewDust(new Vector2(this.position.X, (float) ((double) this.position.Y + (double) this.height - 4.0)), this.width, 8, 31, Alpha: 100, Scale: 1.4f); Main.dust[index4].velocity *= 0.1f; Main.dust[index4].scale *= (float) (1.0 + (double) Main.rand.Next(20) * 0.00999999977648258); + Main.dust[index4].shader = GameShaders.Armor.GetSecondaryShader(this.cShoe, this); } } else if (this.dash == 2) @@ -13346,6 +12573,7 @@ namespace Terraria int index6 = (double) this.velocity.Y != 0.0 ? Dust.NewDust(new Vector2(this.position.X, (float) ((double) this.position.Y + (double) (this.height / 2) - 8.0)), this.width, 16, 31, Alpha: 100, Scale: 1.4f) : Dust.NewDust(new Vector2(this.position.X, (float) ((double) this.position.Y + (double) this.height - 4.0)), this.width, 8, 31, Alpha: 100, Scale: 1.4f); Main.dust[index6].velocity *= 0.1f; Main.dust[index6].scale *= (float) (1.0 + (double) Main.rand.Next(20) * 0.00999999977648258); + Main.dust[index6].shader = GameShaders.Armor.GetSecondaryShader(this.cShoe, this); } num2 = 0.985f; num4 = 0.94f; @@ -13375,6 +12603,7 @@ namespace Terraria int index10 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + 4f), this.width, this.height - 8, 229, Alpha: 100, Scale: 1.2f); Main.dust[index10].velocity *= 0.1f; Main.dust[index10].scale *= (float) (1.0 + (double) Main.rand.Next(20) * 0.00999999977648258); + Main.dust[index10].shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); Main.dust[index10].noGravity = true; if (Main.rand.Next(2) == 0) Main.dust[index10].fadeIn = 0.3f; @@ -13385,7 +12614,6 @@ namespace Terraria } if (this.dash <= 0) return; - this.doorHelper.AllowOpeningDoorsByVelocityAloneForATime(num5 * 3); this.vortexStealthActive = false; if ((double) this.velocity.X > (double) num1 || (double) this.velocity.X < -(double) num1) this.velocity.X *= num2; @@ -13457,6 +12685,7 @@ namespace Terraria Main.dust[index12].position.Y += (float) Main.rand.Next(-5, 6); Main.dust[index12].velocity *= 0.2f; Main.dust[index12].scale *= (float) (1.0 + (double) Main.rand.Next(20) * 0.00999999977648258); + Main.dust[index12].shader = GameShaders.Armor.GetSecondaryShader(this.cShoe, this); } int index13 = Gore.NewGore(new Vector2((float) ((double) this.position.X + (double) (this.width / 2) - 24.0), (float) ((double) this.position.Y + (double) (this.height / 2) - 34.0)), new Vector2(), Main.rand.Next(61, 64)); Main.gore[index13].velocity.X = (float) Main.rand.Next(-50, 51) * 0.01f; @@ -13513,6 +12742,7 @@ namespace Terraria Main.dust[index16].position.Y += (float) Main.rand.Next(-5, 6); Main.dust[index16].velocity *= 0.2f; Main.dust[index16].scale *= (float) (1.0 + (double) Main.rand.Next(20) * 0.00999999977648258); + Main.dust[index16].shader = GameShaders.Armor.GetSecondaryShader(this.cShield, this); } } else @@ -13597,7 +12827,7 @@ namespace Terraria return; float num5 = this.gravity; if (this.slowFall) - num5 = !this.TryingToHoverUp ? this.gravity / 3f * this.gravDir : this.gravity / 10f * this.gravDir; + num5 = !this.controlUp ? this.gravity / 3f * this.gravDir : this.gravity / 10f * this.gravDir; this.fallStart = (int) ((double) this.position.Y / 16.0); if (this.controlDown && (double) this.gravDir == 1.0 || this.controlUp && (double) this.gravDir == -1.0) { @@ -13643,7 +12873,7 @@ namespace Terraria public void CarpetMovement() { bool flag = false; - if (this.grappling[0] == -1 && this.carpet && !this.canJumpAgain_Cloud && !this.canJumpAgain_Sandstorm && !this.canJumpAgain_Blizzard && !this.canJumpAgain_Fart && !this.canJumpAgain_Sail && !this.canJumpAgain_Unicorn && !this.canJumpAgain_Santank && !this.canJumpAgain_WallOfFleshGoat && !this.canJumpAgain_Basilisk && this.jump == 0 && (double) this.velocity.Y != 0.0 && this.rocketTime == 0 && (double) this.wingTime == 0.0 && !this.mount.Active) + if (this.grappling[0] == -1 && this.carpet && !this.jumpAgainCloud && !this.jumpAgainSandstorm && !this.jumpAgainBlizzard && !this.jumpAgainFart && !this.jumpAgainSail && !this.jumpAgainUnicorn && this.jump == 0 && (double) this.velocity.Y != 0.0 && this.rocketTime == 0 && (double) this.wingTime == 0.0 && !this.mount.Active) { if (this.controlJump && this.canCarpet) { @@ -13680,7 +12910,7 @@ namespace Terraria public void DoubleJumpVisuals() { - if (this.isPerformingJump_Cloud && this.hasJumpOption_Cloud && !this.canJumpAgain_Cloud && (this.canJumpAgain_Sandstorm || !this.hasJumpOption_Sandstorm) && ((double) this.gravDir == 1.0 && (double) this.velocity.Y < 0.0 || (double) this.gravDir == -1.0 && (double) this.velocity.Y > 0.0)) + if (this.dJumpEffectCloud && this.doubleJumpCloud && !this.jumpAgainCloud && (this.jumpAgainSandstorm || !this.doubleJumpSandstorm) && ((double) this.gravDir == 1.0 && (double) this.velocity.Y < 0.0 || (double) this.gravDir == -1.0 && (double) this.velocity.Y > 0.0)) { int num = this.height; if ((double) this.gravDir == -1.0) @@ -13689,7 +12919,7 @@ namespace Terraria Main.dust[index].velocity.X = (float) ((double) Main.dust[index].velocity.X * 0.5 - (double) this.velocity.X * 0.100000001490116); Main.dust[index].velocity.Y = (float) ((double) Main.dust[index].velocity.Y * 0.5 - (double) this.velocity.Y * 0.300000011920929); } - if (this.isPerformingJump_Sandstorm && this.hasJumpOption_Sandstorm && !this.canJumpAgain_Sandstorm && ((double) this.gravDir == 1.0 && (double) this.velocity.Y < 0.0 || (double) this.gravDir == -1.0 && (double) this.velocity.Y > 0.0)) + if (this.dJumpEffectSandstorm && this.doubleJumpSandstorm && !this.jumpAgainSandstorm && ((double) this.gravDir == 1.0 && (double) this.velocity.Y < 0.0 || (double) this.gravDir == -1.0 && (double) this.velocity.Y > 0.0)) { int num = this.height; if ((double) this.gravDir == -1.0) @@ -13709,7 +12939,7 @@ namespace Terraria Main.gore[index].alpha = 100; } } - if (this.isPerformingJump_Fart && this.hasJumpOption_Fart && !this.canJumpAgain_Fart && ((double) this.gravDir == 1.0 && (double) this.velocity.Y < 0.0 || (double) this.gravDir == -1.0 && (double) this.velocity.Y > 0.0)) + if (this.dJumpEffectFart && this.doubleJumpFart && !this.jumpAgainFart && ((double) this.gravDir == 1.0 && (double) this.velocity.Y < 0.0 || (double) this.gravDir == -1.0 && (double) this.velocity.Y > 0.0)) { int num = this.height; if ((double) this.gravDir == -1.0) @@ -13719,7 +12949,7 @@ namespace Terraria Main.dust[index].velocity.Y = (float) ((double) Main.dust[index].velocity.Y * 0.5 - (double) this.velocity.Y * 0.300000011920929); Main.dust[index].velocity *= 0.5f; } - if (this.isPerformingJump_Unicorn && this.hasJumpOption_Unicorn && !this.canJumpAgain_Unicorn && ((double) this.gravDir == 1.0 && (double) this.velocity.Y < 0.0 || (double) this.gravDir == -1.0 && (double) this.velocity.Y > 0.0)) + if (this.dJumpEffectUnicorn && this.doubleJumpUnicorn && !this.jumpAgainUnicorn && ((double) this.gravDir == 1.0 && (double) this.velocity.Y < 0.0 || (double) this.gravDir == -1.0 && (double) this.velocity.Y > 0.0)) { Dust dust = Main.dust[Dust.NewDust(this.position, this.width, this.height, Utils.SelectRandom(Main.rand, 176, 177, 179))]; dust.velocity = Vector2.Zero; @@ -13728,7 +12958,7 @@ namespace Terraria dust.fadeIn = (float) (1.0 + (double) Main.rand.NextFloat() * 2.0); dust.shader = GameShaders.Armor.GetSecondaryShader(this.cMount, this); } - if (this.isPerformingJump_Sail && this.hasJumpOption_Sail && !this.canJumpAgain_Sail && ((double) this.gravDir == 1.0 && (double) this.velocity.Y < 1.0 || (double) this.gravDir == -1.0 && (double) this.velocity.Y > 1.0)) + if (this.dJumpEffectSail && this.doubleJumpSail && !this.jumpAgainSail && ((double) this.gravDir == 1.0 && (double) this.velocity.Y < 1.0 || (double) this.gravDir == -1.0 && (double) this.velocity.Y > 1.0)) { int num1 = 1; if (this.jump > 0) @@ -13750,7 +12980,7 @@ namespace Terraria vector2 *= (float) Main.rand.Next(81) * 0.1f; } } - if (!this.isPerformingJump_Blizzard || !this.hasJumpOption_Blizzard || this.canJumpAgain_Blizzard || ((double) this.gravDir != 1.0 || (double) this.velocity.Y >= 0.0) && ((double) this.gravDir != -1.0 || (double) this.velocity.Y <= 0.0)) + if (!this.dJumpEffectBlizzard || !this.doubleJumpBlizzard || this.jumpAgainBlizzard || ((double) this.gravDir != 1.0 || (double) this.velocity.Y >= 0.0) && ((double) this.gravDir != -1.0 || (double) this.velocity.Y <= 0.0)) return; int num3 = this.height - 6; if ((double) this.gravDir == -1.0) @@ -13789,7 +13019,7 @@ namespace Terraria public void WingMovement() { - if (this.wingsLogic == 4 && this.TryingToHoverUp) + if (this.wingsLogic == 4 && this.controlUp) { this.velocity.Y -= 0.2f * this.gravDir; if ((double) this.gravDir == 1.0) @@ -13827,10 +13057,6 @@ namespace Terraria num3 = 2.5f; num1 = 0.125f; } - if (this.wingsLogic == 8 || this.wingsLogic == 11 || this.wingsLogic == 24 || this.wingsLogic == 27 || this.wingsLogic == 22) - num3 = 1.66f; - if (this.wingsLogic == 21 || this.wingsLogic == 12 || this.wingsLogic == 20 || this.wingsLogic == 23) - num3 = 1.805f; if (this.wingsLogic == 37) { num2 = 0.75f; @@ -13839,69 +13065,6 @@ namespace Terraria num3 = 2.5f; num1 = 0.125f; } - if (this.wingsLogic == 44) - { - num2 = 0.85f; - num5 = 0.15f; - num4 = 1f; - num3 = 2.75f; - num1 = 0.125f; - if (this.TryingToHoverUp) - { - this.velocity.Y -= 0.4f * this.gravDir; - if ((double) this.gravDir == 1.0) - { - if ((double) this.velocity.Y > 0.0) - --this.velocity.Y; - else if ((double) this.velocity.Y > -(double) Player.jumpSpeed) - this.velocity.Y -= 0.2f; - if ((double) this.velocity.Y < -(double) Player.jumpSpeed * 3.0) - this.velocity.Y = (float) (-(double) Player.jumpSpeed * 3.0); - } - else - { - if ((double) this.velocity.Y < 0.0) - ++this.velocity.Y; - else if ((double) this.velocity.Y < (double) Player.jumpSpeed) - this.velocity.Y += 0.2f; - if ((double) this.velocity.Y > (double) Player.jumpSpeed * 3.0) - this.velocity.Y = Player.jumpSpeed * 3f; - } - } - if (this.TryingToHoverDown && !this.controlJump && (double) this.velocity.Y != 0.0) - this.velocity.Y += 0.4f; - } - if (this.wingsLogic == 45) - { - num2 = 0.95f; - num5 = 0.15f; - num4 = 1f; - num3 = 4.5f; - if (this.TryingToHoverUp) - { - this.velocity.Y -= 0.4f * this.gravDir; - if ((double) this.gravDir == 1.0) - { - if ((double) this.velocity.Y > 0.0) - --this.velocity.Y; - else if ((double) this.velocity.Y > -(double) Player.jumpSpeed) - this.velocity.Y -= 0.2f; - if ((double) this.velocity.Y < -(double) Player.jumpSpeed * 3.0) - this.velocity.Y = (float) (-(double) Player.jumpSpeed * 3.0); - } - else - { - if ((double) this.velocity.Y < 0.0) - ++this.velocity.Y; - else if ((double) this.velocity.Y < (double) Player.jumpSpeed) - this.velocity.Y += 0.2f; - if ((double) this.velocity.Y > (double) Player.jumpSpeed * 3.0) - this.velocity.Y = Player.jumpSpeed * 3f; - } - } - if (this.TryingToHoverDown && !this.controlJump && (double) this.velocity.Y != 0.0) - this.velocity.Y += 0.4f; - } if (this.wingsLogic == 29 || this.wingsLogic == 32) { num2 = 0.85f; @@ -13913,9 +13076,8 @@ namespace Terraria if (this.wingsLogic == 30 || this.wingsLogic == 31) { num4 = 1f; - num3 = 2.45f; - if (!this.TryingToHoverDown) - num1 = 0.15f; + num3 = 2f; + num1 = 0.15f; } this.velocity.Y -= num1 * this.gravDir; if ((double) this.gravDir == 1.0) @@ -13936,14 +13098,11 @@ namespace Terraria if ((double) this.velocity.Y > (double) Player.jumpSpeed * (double) num3) this.velocity.Y = Player.jumpSpeed * num3; } - if ((this.wingsLogic == 22 || this.wingsLogic == 28 || this.wingsLogic == 30 || this.wingsLogic == 31 || this.wingsLogic == 37 || this.wingsLogic == 45) && this.TryingToHoverDown && !this.controlLeft && !this.controlRight) + if ((this.wingsLogic == 22 || this.wingsLogic == 28 || this.wingsLogic == 30 || this.wingsLogic == 31 || this.wingsLogic == 37) && this.controlDown && !this.controlLeft && !this.controlRight) this.wingTime -= 0.5f; else --this.wingTime; } - if (!this.empressBrooch || (double) this.wingTime == 0.0) - return; - this.wingTime = (float) this.wingTimeMax; } public void MoonLeechRope() @@ -13969,32 +13128,31 @@ namespace Terraria public void WOFTongue() { - if (Main.wofNPCIndex < 0 || !Main.npc[Main.wofNPCIndex].active) + if (Main.wof < 0 || !Main.npc[Main.wof].active) return; - float num1 = Main.npc[Main.wofNPCIndex].position.X + 40f; - if (Main.npc[Main.wofNPCIndex].direction > 0) + float num1 = Main.npc[Main.wof].position.X + 40f; + if (Main.npc[Main.wof].direction > 0) num1 -= 96f; if ((double) this.position.X + (double) this.width > (double) num1 && (double) this.position.X < (double) num1 + 140.0 && this.gross) { this.noKnockback = false; - int scaledByStrength = Main.npc[Main.wofNPCIndex].GetAttackDamage_ScaledByStrength(50f); - this.Hurt(PlayerDeathReason.LegacyDefault(), scaledByStrength, Main.npc[Main.wofNPCIndex].direction); + this.Hurt(PlayerDeathReason.LegacyDefault(), 50, Main.npc[Main.wof].direction); } if (!this.gross && (double) this.position.Y > (double) ((Main.maxTilesY - 250) * 16) && (double) this.position.X > (double) num1 - 1920.0 && (double) this.position.X < (double) num1 + 1920.0) { this.AddBuff(37, 10); - SoundEngine.PlaySound(4, (int) Main.npc[Main.wofNPCIndex].position.X, (int) Main.npc[Main.wofNPCIndex].position.Y, 10); + Main.PlaySound(4, (int) Main.npc[Main.wof].position.X, (int) Main.npc[Main.wof].position.Y, 10); } if (this.gross) { - if ((double) this.position.Y < (double) (Main.UnderworldLayer * 16)) + if ((double) this.position.Y < (double) ((Main.maxTilesY - 200) * 16)) this.AddBuff(38, 10); - if (Main.npc[Main.wofNPCIndex].direction < 0) + if (Main.npc[Main.wof].direction < 0) { - if ((double) this.position.X + (double) (this.width / 2) > (double) Main.npc[Main.wofNPCIndex].position.X + (double) (Main.npc[Main.wofNPCIndex].width / 2) + 40.0) + if ((double) this.position.X + (double) (this.width / 2) > (double) Main.npc[Main.wof].position.X + (double) (Main.npc[Main.wof].width / 2) + 40.0) this.AddBuff(38, 10); } - else if ((double) this.position.X + (double) (this.width / 2) < (double) Main.npc[Main.wofNPCIndex].position.X + (double) (Main.npc[Main.wofNPCIndex].width / 2) - 40.0) + else if ((double) this.position.X + (double) (this.width / 2) < (double) Main.npc[Main.wof].position.X + (double) (Main.npc[Main.wof].width / 2) - 40.0) this.AddBuff(38, 10); } if (!this.tongued) @@ -14007,21 +13165,21 @@ namespace Terraria Main.projectile[index].Kill(); } Vector2 center = this.Center; - double num2 = (double) Main.npc[Main.wofNPCIndex].position.X + (double) (Main.npc[Main.wofNPCIndex].width / 2) - (double) center.X; - float num3 = Main.npc[Main.wofNPCIndex].position.Y + (float) (Main.npc[Main.wofNPCIndex].height / 2) - center.Y; + double num2 = (double) Main.npc[Main.wof].position.X + (double) (Main.npc[Main.wof].width / 2) - (double) center.X; + float num3 = Main.npc[Main.wof].position.Y + (float) (Main.npc[Main.wof].height / 2) - center.Y; if (Math.Sqrt(num2 * num2 + (double) num3 * (double) num3) > 3000.0) { this.KillMe(PlayerDeathReason.ByOther(11), 1000.0, 0); } else { - if ((double) Main.npc[Main.wofNPCIndex].position.X >= 608.0 && (double) Main.npc[Main.wofNPCIndex].position.X <= (double) ((Main.maxTilesX - 38) * 16)) + if ((double) Main.npc[Main.wof].position.X >= 608.0 && (double) Main.npc[Main.wof].position.X <= (double) ((Main.maxTilesX - 38) * 16)) return; this.KillMe(PlayerDeathReason.ByOther(12), 1000.0, 0); } } - public void StatusFromNPC(NPC npc) + public void StatusPlayer(NPC npc) { if (Main.expertMode && (npc.type == 266 && Main.rand.Next(3) == 0 || npc.type == 267)) { @@ -14054,16 +13212,16 @@ namespace Terraria this.AddBuff(36, (int) (60.0 * (double) num2 * 6.5)); } if (npc.type == 530 || npc.type == 531) - this.AddBuff(70, Main.rand.Next(240, 241)); + this.AddBuff(70, Main.rand.Next(240, 481)); if (npc.type == 159 || npc.type == 158) this.AddBuff(30, Main.rand.Next(300, 600)); if (npc.type == 525) - this.AddBuff(39, 240); + this.AddBuff(39, 420); if (npc.type == 526) this.AddBuff(69, 420); if (npc.type == 527) this.AddBuff(31, 840); - if (Main.expertMode && (npc.type == 49 || npc.type == 93 || npc.type == 51 || npc.type == 152 || npc.type == 634) && Main.rand.Next(10) == 0) + if (Main.expertMode && (npc.type == 49 || npc.type == 93 || npc.type == 51 || npc.type == 152) && Main.rand.Next(10) == 0) this.AddBuff(148, Main.rand.Next(1800, 5400)); if (Main.expertMode && npc.type == 222) this.AddBuff(20, Main.rand.Next(60, 240)); @@ -14092,19 +13250,19 @@ namespace Terraria if (type != 0) this.AddBuff(type, 60 * Main.rand.Next(3, 11)); } - if ((npc.type == 1 && npc.netID == -6 || npc.type == 81 || npc.type == 79 || npc.type == 183 || npc.type == 630) && Main.rand.Next(4) == 0) + if ((npc.type == 1 && npc.netID == -6 || npc.type == 81 || npc.type == 79) && Main.rand.Next(4) == 0) this.AddBuff(22, 900); if ((npc.type == 23 || npc.type == 25) && Main.rand.Next(3) == 0) this.AddBuff(24, 420); - if ((npc.type == 34 || npc.type == 83 || npc.type == 84 || npc.type == 179 || npc.type == 289) && Main.rand.Next(3) == 0) + if ((npc.type == 34 || npc.type == 83 || npc.type == 84) && Main.rand.Next(3) == 0) this.AddBuff(23, 240); if ((npc.type == 104 || npc.type == 102) && Main.rand.Next(8) == 0) this.AddBuff(30, 2700); if (npc.type == 75 && Main.rand.Next(10) == 0) this.AddBuff(35, 420); if ((npc.type == 163 || npc.type == 238) && Main.rand.Next(10) == 0) - this.AddBuff(70, 240); - if ((npc.type == 79 || npc.type == 103 || npc.type == 630) && Main.rand.Next(5) == 0) + this.AddBuff(70, 480); + if ((npc.type == 79 || npc.type == 103) && Main.rand.Next(5) == 0) this.AddBuff(35, 420); if ((npc.type == 75 || npc.type == 78 || npc.type == 82) && Main.rand.Next(8) == 0) this.AddBuff(32, 900); @@ -14150,7 +13308,6 @@ namespace Terraria { if (this.grappling[0] < 0) return; - this.StopVanityActions(); if (Main.myPlayer == this.whoAmI && this.mount.Active) this.mount.Dismount(this); this.canCarpet = true; @@ -14162,25 +13319,73 @@ namespace Terraria this.wingFrame = 3; if (this.wings == 30) this.wingFrame = 0; - this.RefreshMovementAbilities(); + this.wingTime = (float) this.wingTimeMax; + this.rocketTime = this.rocketTimeMax; + this.rocketDelay = 0; this.rocketFrame = false; this.canRocket = false; this.rocketRelease = false; this.fallStart = (int) ((double) this.position.Y / 16.0); int index1 = -1; + float num1 = 0.0f; + float num2 = 0.0f; for (int index2 = 0; index2 < this.grapCount; ++index2) { - if (Main.projectile[this.grappling[index2]].type == 403) + Projectile projectile = Main.projectile[this.grappling[index2]]; + num1 += projectile.position.X + (float) (projectile.width / 2); + num2 += projectile.position.Y + (float) (projectile.height / 2); + if (projectile.type == 403) index1 = index2; + else if (projectile.type == 446) + { + Vector2 vector2_1 = new Vector2((float) (this.controlRight.ToInt() - this.controlLeft.ToInt()), (float) (this.controlDown.ToInt() - this.controlUp.ToInt()) * this.gravDir); + if (vector2_1 != Vector2.Zero) + vector2_1.Normalize(); + vector2_1 *= 100f; + Vector2 vector2_2 = Vector2.Normalize(this.Center - projectile.Center + vector2_1); + if (float.IsNaN(vector2_2.X) || float.IsNaN(vector2_2.Y)) + vector2_2 = -Vector2.UnitY; + float num3 = 200f; + num1 += vector2_2.X * num3; + num2 += vector2_2.Y * num3; + } + else if (projectile.type == 652) + { + Vector2 vector2_3 = new Vector2((float) (this.controlRight.ToInt() - this.controlLeft.ToInt()), (float) (this.controlDown.ToInt() - this.controlUp.ToInt()) * this.gravDir); + if (vector2_3 != Vector2.Zero) + vector2_3.Normalize(); + Vector2 vector2_4 = projectile.Center - this.Center; + Vector2 vector2_5 = vector2_4; + if (vector2_5 != Vector2.Zero) + vector2_5.Normalize(); + Vector2 vector2_6 = Vector2.Zero; + if (vector2_3 != Vector2.Zero) + vector2_6 = vector2_5 * Vector2.Dot(vector2_5, vector2_3); + float num4 = 6f; + if ((double) Vector2.Dot(vector2_6, vector2_4) < 0.0 && (double) vector2_4.Length() >= 600.0) + num4 = 0.0f; + num1 += (float) (-(double) vector2_4.X + (double) vector2_6.X * (double) num4); + num2 += (float) (-(double) vector2_4.Y + (double) vector2_6.Y * (double) num4); + } } - int? preferredPlayerDirectionToSet; - float preferedPlayerVelocityX; - float preferedPlayerVelocityY; - this.GetGrapplingForces(this.Center, out preferredPlayerDirectionToSet, out preferedPlayerVelocityX, out preferedPlayerVelocityY); - if ((double) preferedPlayerVelocityY > 0.0) + float num5 = num1 / (float) this.grapCount; + float num6 = num2 / (float) this.grapCount; + Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); + float num7 = num5 - vector2.X; + float num8 = num6 - vector2.Y; + float num9 = (float) Math.Sqrt((double) num7 * (double) num7 + (double) num8 * (double) num8); + float num10 = 11f; + if (Main.projectile[this.grappling[0]].type == 315) + num10 = 16f; + if (Main.projectile[this.grappling[0]].type >= 646 && Main.projectile[this.grappling[0]].type <= 649) + num10 = 13f; + float num11 = (double) num9 <= (double) num10 ? 1f : num10 / num9; + float num12 = num7 * num11; + float num13 = num8 * num11; + if ((double) num13 > 0.0) this.GoingDownWithGrapple = true; - this.velocity.X = preferedPlayerVelocityX; - this.velocity.Y = preferedPlayerVelocityY; + this.velocity.X = num12; + this.velocity.Y = num13; if (index1 != -1) { Projectile projectile = Main.projectile[this.grappling[index1]]; @@ -14194,26 +13399,30 @@ namespace Terraria Vector2 Position; Position.X = projectile.position.X + (float) (projectile.width / 2) - (float) (this.width / 2); Position.Y = projectile.position.Y + (float) (projectile.height / 2) - (float) (this.height / 2); - this.RemoveAllGrapplingHooks(); - int num = 13; + this.grappling[0] = -1; + this.grapCount = 0; + for (int index3 = 0; index3 < 1000; ++index3) + { + if (Main.projectile[index3].active && Main.projectile[index3].owner == this.whoAmI && Main.projectile[index3].aiStyle == 7) + Main.projectile[index3].Kill(); + } + int num14 = 13; if (this.miscEquips[2].stack > 0 && this.miscEquips[2].mountType >= 0 && MountID.Sets.Cart[this.miscEquips[2].mountType] && (!this.miscEquips[2].expertOnly || Main.expertMode)) - num = this.miscEquips[2].mountType; - int Height = this.height + Mount.GetHeightBoost(num); + num14 = this.miscEquips[2].mountType; + int Height = this.height + Mount.GetHeightBoost(num14); if (Minecart.GetOnTrack(tileX, tileY, ref Position, this.width, Height) && !Collision.SolidCollision(Position, this.width, Height - 20)) { this.position = Position; DelegateMethods.Minecart.rotation = this.fullRotation; DelegateMethods.Minecart.rotationOrigin = this.fullRotationOrigin; - this.mount.SetMount(num, this, this.minecartLeft); - Minecart.WheelSparks(this.mount.Delegations.MinecartDust, this.position, this.width, this.height, 25); + this.mount.SetMount(num14, this, this.minecartLeft); + Minecart.WheelSparks(this.mount.MinecartDust, this.position, this.width, this.height, 25); } } } } if (this.itemAnimation == 0) { - if ((double) this.velocity.X == 0.0 && preferredPlayerDirectionToSet.HasValue) - this.ChangeDir(preferredPlayerDirectionToSet.Value); if ((double) this.velocity.X > 0.0) this.ChangeDir(1); if ((double) this.velocity.X < 0.0) @@ -14234,149 +13443,38 @@ namespace Terraria this.velocity.Y += 0.01f; this.releaseJump = false; } - this.RefreshDoubleJumps(); - this.RemoveAllGrapplingHooks(); + if (this.doubleJumpCloud) + this.jumpAgainCloud = true; + if (this.doubleJumpSandstorm) + this.jumpAgainSandstorm = true; + if (this.doubleJumpBlizzard) + this.jumpAgainBlizzard = true; + if (this.doubleJumpFart) + this.jumpAgainFart = true; + if (this.doubleJumpSail) + this.jumpAgainSail = true; + if (this.doubleJumpUnicorn) + this.jumpAgainUnicorn = true; + this.grappling[0] = 0; + this.grapCount = 0; + for (int index4 = 0; index4 < 1000; ++index4) + { + if (Main.projectile[index4].active && Main.projectile[index4].owner == this.whoAmI && Main.projectile[index4].aiStyle == 7) + Main.projectile[index4].Kill(); + } } else this.releaseJump = true; } - public void DoQueenSlimeHookTeleport(Vector2 targetPosition) - { - int num1 = 150; - Vector2 position = this.position; - Vector2 velocity = this.velocity; - for (int index = 0; index < num1; ++index) - { - Vector2 Velocity = (position + this.Size / 2f).DirectionTo(targetPosition).SafeNormalize(Vector2.Zero) * 12f; - Vector2 vector2 = Collision.TileCollision(position, Velocity, this.width, this.height, true, true, (int) this.gravDir); - position += vector2; - } - int num2 = 10; - Vector2 vector2_1 = position - this.position; - this.Teleport(position, num2); - NetMessage.SendData(65, number2: ((float) this.whoAmI), number3: position.X, number4: position.Y, number5: num2); - } - - private void GetGrapplingForces( - Vector2 fromPosition, - out int? preferredPlayerDirectionToSet, - out float preferedPlayerVelocityX, - out float preferedPlayerVelocityY) - { - float num1 = 0.0f; - float num2 = 0.0f; - preferredPlayerDirectionToSet = new int?(); - int num3 = 0; - for (int index = 0; index < this.grapCount; ++index) - { - Projectile projectile = Main.projectile[this.grappling[index]]; - if ((double) projectile.ai[0] == 2.0 && !projectile.position.HasNaNs()) - { - num1 += projectile.position.X + (float) (projectile.width / 2); - num2 += projectile.position.Y + (float) (projectile.height / 2); - ++num3; - if (projectile.type == 446) - { - Vector2 vector2 = new Vector2((float) (this.controlRight.ToInt() - this.controlLeft.ToInt()), (float) (this.controlDown.ToInt() - this.controlUp.ToInt()) * this.gravDir); - if (vector2 != Vector2.Zero) - vector2.Normalize(); - vector2 *= 100f; - Vector2 vec = Vector2.Normalize(this.Center - projectile.Center + vector2); - if (vec.HasNaNs()) - vec = -Vector2.UnitY; - float num4 = 200f; - num1 += vec.X * num4; - num2 += vec.Y * num4; - } - else if (projectile.type == 652) - { - Vector2 vector2_1 = new Vector2((float) (this.controlRight.ToInt() - this.controlLeft.ToInt()), (float) (this.controlDown.ToInt() - this.controlUp.ToInt()) * this.gravDir).SafeNormalize(Vector2.Zero); - Vector2 v = projectile.Center - this.Center; - Vector2 vector2_2 = v.SafeNormalize(Vector2.Zero); - Vector2 vector2_3 = Vector2.Zero; - if (vector2_1 != Vector2.Zero) - vector2_3 = vector2_2 * Vector2.Dot(vector2_2, vector2_1); - float num5 = 6f; - if ((double) Vector2.Dot(vector2_3, v) < 0.0 && (double) v.Length() >= 600.0) - num5 = 0.0f; - num1 += (float) (-(double) v.X + (double) vector2_3.X * (double) num5); - num2 += (float) (-(double) v.Y + (double) vector2_3.Y * (double) num5); - } - else if (projectile.type == 865) - { - Vector2 vector2_4 = (projectile.rotation - 1.570796f).ToRotationVector2().SafeNormalize(Vector2.UnitY); - Vector2 vector2_5 = -vector2_4 * 28f; - num1 += vector2_5.X; - num2 += vector2_5.Y; - if ((double) vector2_4.X != 0.0) - preferredPlayerDirectionToSet = new int?(Math.Sign(vector2_4.X)); - } - } - } - if (num3 == 0) - { - preferedPlayerVelocityX = this.velocity.X; - preferedPlayerVelocityY = this.velocity.Y; - } - else - { - float num6 = num1 / (float) num3; - float num7 = num2 / (float) num3; - Vector2 vector2 = fromPosition; - preferedPlayerVelocityX = num6 - vector2.X; - preferedPlayerVelocityY = num7 - vector2.Y; - float num8 = (float) Math.Sqrt((double) preferedPlayerVelocityX * (double) preferedPlayerVelocityX + (double) preferedPlayerVelocityY * (double) preferedPlayerVelocityY); - float num9 = 11f; - if (Main.projectile[this.grappling[0]].type == 315) - num9 = 14f; - if (Main.projectile[this.grappling[0]].type == 487) - num9 = 12f; - if (Main.projectile[this.grappling[0]].type >= 646 && Main.projectile[this.grappling[0]].type <= 649) - num9 = 16f; - float num10 = (double) num8 <= (double) num9 ? 1f : num9 / num8; - preferedPlayerVelocityX *= num10; - preferedPlayerVelocityY *= num10; - } - } - - private void RefreshMovementAbilities(bool doubleJumps = true) - { - this.wingTime = (float) this.wingTimeMax; - this.rocketTime = this.rocketTimeMax; - this.rocketDelay = 0; - if (!doubleJumps) - return; - this.RefreshDoubleJumps(); - } - - private void RefreshDoubleJumps() - { - if (this.hasJumpOption_Cloud) - this.canJumpAgain_Cloud = true; - if (this.hasJumpOption_Sandstorm) - this.canJumpAgain_Sandstorm = true; - if (this.hasJumpOption_Blizzard) - this.canJumpAgain_Blizzard = true; - if (this.hasJumpOption_Fart) - this.canJumpAgain_Fart = true; - if (this.hasJumpOption_Sail) - this.canJumpAgain_Sail = true; - if (this.hasJumpOption_Unicorn) - this.canJumpAgain_Unicorn = true; - if (this.hasJumpOption_Santank) - this.canJumpAgain_Santank = true; - if (this.hasJumpOption_WallOfFleshGoat) - this.canJumpAgain_WallOfFleshGoat = true; - if (!this.hasJumpOption_Basilisk) - return; - this.canJumpAgain_Basilisk = true; - } - public void StickyMovement() { bool flag = false; - if (this.mount.Type > 0 && MountID.Sets.Cart[this.mount.Type] && (double) Math.Abs(this.velocity.X) > 5.0) + if (this.mount.Type == 6 && (double) Math.Abs(this.velocity.X) > 5.0) + flag = true; + if (this.mount.Type == 13 && (double) Math.Abs(this.velocity.X) > 5.0) + flag = true; + if (this.mount.Type == 11 && (double) Math.Abs(this.velocity.X) > 5.0) flag = true; Vector2 vector2_1 = new Vector2(this.position.X + (float) (this.width / 2) - (float) (this.width / 2 / 2), this.position.Y + (float) (this.height / 2) - (float) (this.height / 2 / 2)); Vector2 vector2_2 = Collision.StickyTiles(this.position, this.velocity, this.width, this.height); @@ -14405,32 +13503,18 @@ namespace Terraria this.velocity.X = 1f; if ((double) this.velocity.X < -1.0) this.velocity.X = -1f; + if ((double) this.velocity.Y > 1.0) + this.velocity.Y = 1f; + if ((double) this.velocity.Y < -5.0) + this.velocity.Y = -5f; if ((double) this.velocity.X > 0.75 || (double) this.velocity.X < -0.75) this.velocity.X *= 0.85f; else this.velocity.X *= 0.6f; - if ((double) this.gravDir == -1.0) - { - if ((double) this.velocity.Y < -1.0) - this.velocity.Y = -1f; - if ((double) this.velocity.Y > 5.0) - this.velocity.Y = 5f; - if ((double) this.velocity.Y > 0.0) - this.velocity.Y *= 0.96f; - else - this.velocity.Y *= 0.3f; - } + if ((double) this.velocity.Y < 0.0) + this.velocity.Y *= 0.96f; else - { - if ((double) this.velocity.Y > 1.0) - this.velocity.Y = 1f; - if ((double) this.velocity.Y < -5.0) - this.velocity.Y = -5f; - if ((double) this.velocity.Y < 0.0) - this.velocity.Y *= 0.96f; - else - this.velocity.Y *= 0.3f; - } + this.velocity.Y *= 0.3f; if (type != 229 || Main.rand.Next(5) != 0 || (double) this.velocity.Y <= 0.15 && (double) this.velocity.Y >= 0.0) return; if ((double) (x * 16) < (double) this.position.X + (double) (this.width / 2)) @@ -14485,8 +13569,6 @@ namespace Terraria this.stickyBreak = 0; } - public bool HasLockedInventory() => this.IsStackingItems(); - public bool IsStackingItems() { for (int index = 0; index < this.inventoryChestStack.Length; ++index) @@ -14501,103 +13583,15 @@ namespace Terraria return false; } - public List GetNearbyContainerProjectilesList() - { - List intList = new List(); - Vector2 center = this.Center; - for (int index = 0; index < 1000; ++index) - { - Projectile projectile = Main.projectile[index]; - if (projectile.active) - { - int containerIndex = -1; - if (projectile.TryGetContainerIndex(out containerIndex)) - { - Point tileCoordinates = projectile.Hitbox.ClosestPointInRect(center).ToTileCoordinates(); - if (this.IsInTileInteractionRange(tileCoordinates.X, tileCoordinates.Y)) - intList.Add(index); - } - } - } - return intList; - } - - public void UpdateNearbyInteractibleProjectilesList() - { - List projectilesToInteractWith = this._projectilesToInteractWith; - projectilesToInteractWith.Clear(); - if (!Main.CurrentFrameFlags.HadAnActiveInteractibleProjectile) - return; - Vector2 center = this.Center; - for (int index = 0; index < 1000; ++index) - { - if (this.IsProjectileInteractibleAndInInteractionRange(Main.projectile[index], ref center)) - projectilesToInteractWith.Add(index); - } - } - - public bool IsProjectileInteractibleAndInInteractionRange( - Projectile proj, - ref Vector2 compareSpot) - { - if (!proj.active || !proj.IsInteractible()) - return false; - Point tileCoordinates = proj.Hitbox.ClosestPointInRect(compareSpot).ToTileCoordinates(); - return this.IsInTileInteractionRange(tileCoordinates.X, tileCoordinates.Y); - } - public void QuickStackAllChests() { - if (this.HasLockedInventory()) + if (this.IsStackingItems()) return; - List containerProjectilesList = this.GetNearbyContainerProjectilesList(); - for (int index = 0; index < containerProjectilesList.Count; ++index) - { - int containerIndex; - if (Main.projectile[containerProjectilesList[index]].TryGetContainerIndex(out containerIndex)) - { - int chest = this.chest; - this.chest = containerIndex; - ChestUI.QuickStack(); - this.chest = chest; - } - } - int num1 = 17; - int num2 = (int) ((double) this.Center.X / 16.0); - int num3 = (int) ((double) this.Center.Y / 16.0); - for (int index1 = num2 - num1; index1 <= num2 + num1; ++index1) - { - if (index1 >= 0 && index1 < Main.maxTilesX) - { - for (int index2 = num3 - num1; index2 <= num3 + num1; ++index2) - { - if (index2 >= 0 && index2 < Main.maxTilesY) - { - int num4 = 0; - if (Main.tile[index1, index2].type == (ushort) 29) - num4 = -2; - else if (Main.tile[index1, index2].type == (ushort) 97) - num4 = -3; - else if (Main.tile[index1, index2].type == (ushort) 463) - num4 = -4; - else if (Main.tile[index1, index2].type == (ushort) 491) - num4 = -5; - if (num4 < 0 && (double) (new Vector2((float) (index1 * 16 + 8), (float) (index2 * 16 + 8)) - this.Center).Length() < 250.0) - { - int chest = this.chest; - this.chest = num4; - ChestUI.QuickStack(); - this.chest = chest; - } - } - } - } - } if (Main.netMode == 1) { for (int number = 10; number < 50; ++number) { - if (this.inventory[number].type > 0 && this.inventory[number].stack > 0 && !this.inventory[number].favorited && !this.inventory[number].IsACoin) + if (this.inventory[number].type > 0 && this.inventory[number].stack > 0 && !this.inventory[number].favorited && (this.inventory[number].type < 71 || this.inventory[number].type > 74)) { NetMessage.SendData(5, number: this.whoAmI, number2: ((float) number), number3: ((float) this.inventory[number].prefix)); NetMessage.SendData(85, number: number); @@ -14610,7 +13604,7 @@ namespace Terraria bool flag = false; for (int index = 10; index < 50; ++index) { - if (this.inventory[index].type > 0 && this.inventory[index].stack > 0 && !this.inventory[index].favorited && !this.inventory[index].IsACoin) + if (this.inventory[index].type > 0 && this.inventory[index].stack > 0 && !this.inventory[index].favorited) { int type = this.inventory[index].type; int stack = this.inventory[index].stack; @@ -14621,66 +13615,61 @@ namespace Terraria } if (!flag) return; - SoundEngine.PlaySound(7); + Main.PlaySound(7); } } public void CheckDrowning() { bool flag = Collision.DrownCollision(this.position, this.width, this.height, this.gravDir); - if (this.armor[0].type == 250 || this.armor[0].type == 4275) + if (this.armor[0].type == 250) flag = true; if (this.inventory[this.selectedItem].type == 186) { - if (this.itemAnimation == 0) + try { - try + int index1 = (int) (((double) this.position.X + (double) (this.width / 2) + (double) (6 * this.direction)) / 16.0); + int num = 0; + if ((double) this.gravDir == -1.0) + num = this.height; + int index2 = (int) (((double) this.position.Y + (double) num - 44.0 * (double) this.gravDir) / 16.0); + if (Main.tile[index1, index2].liquid < (byte) 128) { - int index1 = (int) (((double) this.position.X + (double) (this.width / 2) + (double) (6 * this.direction)) / 16.0); - int num = 0; - if ((double) this.gravDir == -1.0) - num = this.height; - int index2 = (int) (((double) this.position.Y + (double) num - 44.0 * (double) this.gravDir) / 16.0); - if (Main.tile[index1, index2] != null) + if (Main.tile[index1, index2] == null) + Main.tile[index1, index2] = new Tile(); + if (Main.tile[index1, index2].active() && Main.tileSolid[(int) Main.tile[index1, index2].type]) { - if (Main.tile[index1, index2].liquid < (byte) 128) - { - if (Main.tile[index1, index2] == null) - Main.tile[index1, index2] = new Tile(); - if (Main.tile[index1, index2].active() && Main.tileSolid[(int) Main.tile[index1, index2].type]) - { - if (!Main.tileSolidTop[(int) Main.tile[index1, index2].type]) - goto label_15; - } - flag = false; - } + if (!Main.tileSolidTop[(int) Main.tile[index1, index2].type]) + goto label_13; } - } - catch - { + flag = false; } } + catch + { + } } -label_15: +label_13: if (this.gills) flag = false; if (Main.myPlayer == this.whoAmI) { - if (this.accMerman) - { - if (flag) - this.merman = true; + if (this.merman) flag = false; - } if (flag) { ++this.breathCD; - if (this.breathCD >= this.breathCDMax) + int num = 7; + if (this.inventory[this.selectedItem].type == 186) + num *= 2; + if (this.accDivingHelm) + num *= 4; + if (this.breathCD >= num) { this.breathCD = 0; --this.breath; if (this.breath == 0) - SoundEngine.PlaySound(23); + Main.PlaySound(23); if (this.breath <= 0) { this.lifeRegenTime = 0; @@ -14713,61 +13702,6 @@ label_15: Dust.NewDust(new Vector2(this.position.X + (float) (12 * this.direction), (float) ((double) this.position.Y + (double) num1 + 4.0 * (double) this.gravDir)), this.width - 8, 8, 34, Scale: 1.2f); } - public void CheckCrackedBrickBreak() - { - bool flag1 = false; - if ((double) Main.rand.Next(2, 12) < (double) Math.Abs(this.velocity.X)) - flag1 = true; - if ((double) Main.rand.Next(2, 12) < (double) this.velocity.Y) - flag1 = true; - if (flag1 && (double) this.velocity.Y < 1.0) - { - Point tileCoordinates1 = (this.Bottom + Vector2.UnitY).ToTileCoordinates(); - Point tileCoordinates2 = (this.BottomLeft + Vector2.UnitY).ToTileCoordinates(); - Point tileCoordinates3 = (this.BottomRight + Vector2.UnitY).ToTileCoordinates(); - if (WorldGen.SolidTileAllowBottomSlope(tileCoordinates1.X, tileCoordinates1.Y) && !TileID.Sets.CrackedBricks[(int) Main.tile[tileCoordinates1.X, tileCoordinates1.Y].type] || WorldGen.SolidTileAllowBottomSlope(tileCoordinates2.X, tileCoordinates2.Y) && !TileID.Sets.CrackedBricks[(int) Main.tile[tileCoordinates2.X, tileCoordinates2.Y].type] || WorldGen.SolidTileAllowBottomSlope(tileCoordinates3.X, tileCoordinates3.Y) && !TileID.Sets.CrackedBricks[(int) Main.tile[tileCoordinates3.X, tileCoordinates3.Y].type]) - flag1 = false; - } - if (!flag1) - return; - Vector2 vector2 = this.position + this.velocity; - bool flag2 = false; - int num1 = (int) ((double) vector2.X / 16.0); - int num2 = (int) (((double) vector2.X + (double) this.width) / 16.0); - int num3 = (int) (((double) this.position.Y + (double) this.height + 1.0) / 16.0); - Microsoft.Xna.Framework.Rectangle rect = this.getRect(); - rect.Inflate(1, 1); - for (int i = num1; i <= num2; ++i) - { - for (int index = num3; index <= num3 + 1 && Main.tile[i, index] != null; ++index) - { - if (Main.tile[i, index].nactive() && !WorldGen.SolidTile(i, index - 1) && Main.tile[i, index].type >= (ushort) 481 && Main.tile[i, index].type <= (ushort) 483 && new Microsoft.Xna.Framework.Rectangle(i * 16, index * 16, 16, 16).Intersects(rect)) - { - flag2 = true; - if ((double) this.velocity.Y > 1.0) - this.velocity.Y = 1f; - NetMessage.SendData(13, number: this.whoAmI); - } - } - } - if (!flag2) - return; - int num4 = (int) (((double) vector2.X - 16.0 - 8.0) / 16.0); - int num5 = (int) (((double) vector2.X + (double) this.width + 16.0 + 8.0) / 16.0); - for (int i = num4; i <= num5; ++i) - { - for (int j = num3; j <= num3 + 2; ++j) - { - if (Main.tile[i, j].nactive() && !WorldGen.SolidTile(i, j - 1) && Main.tile[i, j].type >= (ushort) 481 && Main.tile[i, j].type <= (ushort) 483) - { - WorldGen.KillTile(i, j); - if (Main.netMode == 1) - NetMessage.SendData(17, number2: ((float) i), number3: ((float) j)); - } - } - } - } - public void CheckIceBreak() { if ((double) this.velocity.Y <= 7.0) @@ -14778,7 +13712,7 @@ label_15: int num3 = (int) (((double) this.position.Y + (double) this.height + 1.0) / 16.0); for (int i = num1; i <= num2; ++i) { - for (int j = num3; j <= num3 + 1 && Main.tile[i, j] != null; ++j) + for (int j = num3; j <= num3 + 1; ++j) { if (Main.tile[i, j].nactive() && Main.tile[i, j].type == (ushort) 162 && !WorldGen.SolidTile(i, j - 1)) { @@ -14828,41 +13762,6 @@ label_15: if ((double) this.velocity.Y != (double) velocity.Y) vector2.Y = this.velocity.Y; this.position = this.position + vector2; - this.TryFloatingInWater(); - } - - private void TryFloatingInWater() - { - if (!this.ShouldFloatInWater) - return; - float waterLineHeight; - if (Collision.GetWaterLine(this.Center.ToTileCoordinates(), out waterLineHeight)) - { - float y = this.Center.Y; - if (this.mount.Active && this.mount.Type == 37) - y -= 6f; - float num = y + 8f; - if ((double) num + (double) this.velocity.Y < (double) waterLineHeight) - return; - if ((double) y > (double) waterLineHeight) - { - this.velocity.Y -= 0.4f; - if ((double) this.velocity.Y >= -6.0) - return; - this.velocity.Y = -6f; - } - else - { - this.velocity.Y = waterLineHeight - num; - if ((double) this.velocity.Y < -3.0) - this.velocity.Y = -3f; - if ((double) this.velocity.Y != 0.0) - return; - this.velocity.Y = float.Epsilon; - } - } - else - this.velocity.Y -= 0.4f; } public void DryCollision(bool fallThrough, bool ignorePlats) @@ -14876,7 +13775,7 @@ label_15: if ((double) vector2_1.Y == 0.0) vector2_2.Y = 0.0f; Vector2 zero1 = Vector2.Zero; - bool flag = this.mount.Type == 7 || this.mount.Type == 8 || this.mount.Type == 12 || this.mount.Type == 44 || this.mount.Type == 48 || this.mount.Type == 49; + bool flag = this.mount.Type == 7 || this.mount.Type == 8 || this.mount.Type == 12; Vector2 zero2 = Vector2.Zero; while ((double) num1 > 0.0) { @@ -14918,7 +13817,7 @@ label_15: this.UpdateTouchingTiles(); this.TryBouncingBlocks(Falling); this.TryLandingOnDetonator(); - this.SlopingCollision(fallThrough, ignorePlats); + this.SlopingCollision(fallThrough); Collision.StepConveyorBelt((Entity) this, this.gravDir); Vector2 velocity4 = this.velocity; zero1 += velocity4; @@ -14942,9 +13841,9 @@ label_15: } } - public void SlopingCollision(bool fallThrough, bool ignorePlats) + public void SlopingCollision(bool fallThrough) { - if (ignorePlats || this.controlDown || this.grappling[0] >= 0 || (double) this.gravDir == -1.0) + if (this.controlDown || this.grappling[0] >= 0 || (double) this.gravDir == -1.0) this.stairFall = true; Vector4 vector4 = Collision.SlopeCollision(this.position, this.velocity, this.width, this.height, this.gravity, this.stairFall); if (Collision.stairFall) @@ -14968,14 +13867,29 @@ label_15: public void FloorVisuals(bool Falling) { - int x = (int) (((double) this.position.X + (double) (this.width / 2)) / 16.0); - int y = (int) (((double) this.position.Y + (double) this.height) / 16.0); + int index1 = (int) (((double) this.position.X + (double) (this.width / 2)) / 16.0); + int index2 = (int) (((double) this.position.Y + (double) this.height) / 16.0); if ((double) this.gravDir == -1.0) - y = (int) ((double) this.position.Y - 0.100000001490116) / 16; - int type = Player.GetFloorTileType(x, y); + index2 = (int) ((double) this.position.Y - 0.100000001490116) / 16; + int type = -1; + if (Main.tile[index1 - 1, index2] == null) + Main.tile[index1 - 1, index2] = new Tile(); + if (Main.tile[index1 + 1, index2] == null) + Main.tile[index1 + 1, index2] = new Tile(); + if (Main.tile[index1, index2] == null) + Main.tile[index1, index2] = new Tile(); + if (Main.tile[index1, index2].nactive() && Main.tileSolid[(int) Main.tile[index1, index2].type]) + type = (int) Main.tile[index1, index2].type; + else if (Main.tile[index1 - 1, index2].nactive() && Main.tileSolid[(int) Main.tile[index1 - 1, index2].type]) + type = (int) Main.tile[index1 - 1, index2].type; + else if (Main.tile[index1 + 1, index2].nactive() && Main.tileSolid[(int) Main.tile[index1 + 1, index2].type]) + type = (int) Main.tile[index1 + 1, index2].type; if (type <= -1) { - this.ResetFloorFlags(); + this.slippy = false; + this.slippy2 = false; + this.sticky = false; + this.powerrun = false; } else { @@ -14983,8 +13897,7 @@ label_15: this.slippy = type == 161 || type == 162 || type == 163 || type == 164 || type == 200 || type == (int) sbyte.MaxValue; this.slippy2 = type == 197; this.powerrun = type == 198; - this.runningOnSand = TileID.Sets.Conversion.Sand[type] || TileID.Sets.Conversion.Sandstone[type] || TileID.Sets.Conversion.HardenedSand[type]; - if (Main.tile[x - 1, y].slope() != (byte) 0 || Main.tile[x, y].slope() != (byte) 0 || Main.tile[x + 1, y].slope() != (byte) 0) + if (Main.tile[index1 - 1, index2].slope() != (byte) 0 || Main.tile[index1, index2].slope() != (byte) 0 || Main.tile[index1 + 1, index2].slope() != (byte) 0) type = -1; if ((this.wet ? 0 : (!this.mount.Cart ? 1 : 0)) == 0) return; @@ -14992,36 +13905,9 @@ label_15: } } - private void ResetFloorFlags() - { - this.slippy = false; - this.slippy2 = false; - this.sticky = false; - this.powerrun = false; - this.runningOnSand = false; - } - - private static int GetFloorTileType(int x, int y) - { - int num = -1; - if (Main.tile[x - 1, y] == null) - Main.tile[x - 1, y] = new Tile(); - if (Main.tile[x + 1, y] == null) - Main.tile[x + 1, y] = new Tile(); - if (Main.tile[x, y] == null) - Main.tile[x, y] = new Tile(); - if (Main.tile[x, y].nactive() && Main.tileSolid[(int) Main.tile[x, y].type]) - num = (int) Main.tile[x, y].type; - else if (Main.tile[x - 1, y].nactive() && Main.tileSolid[(int) Main.tile[x - 1, y].type]) - num = (int) Main.tile[x - 1, y].type; - else if (Main.tile[x + 1, y].nactive() && Main.tileSolid[(int) Main.tile[x + 1, y].type]) - num = (int) Main.tile[x + 1, y].type; - return num; - } - private void MakeFloorDust(bool Falling, int type) { - if (type != 147 && type != 25 && type != 53 && type != 189 && type != 0 && type != 123 && type != 57 && type != 112 && type != 116 && type != 196 && type != 193 && type != 195 && type != 197 && type != 199 && type != 229 && type != 371 && type != 460) + if (type != 147 && type != 25 && type != 53 && type != 189 && type != 0 && type != 123 && type != 57 && type != 112 && type != 116 && type != 196 && type != 193 && type != 195 && type != 197 && type != 199 && type != 229 && type != 371) return; int num1 = 1; if (Falling) @@ -15056,8 +13942,6 @@ label_15: Type = 153; if (type == 371) Type = 243; - if (type == 460) - Type = 108; if (type == 25) Type = 37; if (Type == 32 && Main.rand.Next(2) == 0) @@ -15136,13 +14020,11 @@ label_15: { if ((double) this.position.X < (double) Main.leftWorld + 640.0 + 16.0) { - Main.cameraX = 0.0f; this.position.X = (float) ((double) Main.leftWorld + 640.0 + 16.0); this.velocity.X = 0.0f; } if ((double) this.position.X + (double) this.width > (double) Main.rightWorld - 640.0 - 32.0) { - Main.cameraX = 0.0f; this.position.X = (float) ((double) Main.rightWorld - 640.0 - 32.0) - (float) this.width; this.velocity.X = 0.0f; } @@ -15173,7 +14055,7 @@ label_15: int num3 = 0; for (int index = 0; index < 200; ++index) { - if (Main.npc[index].active && !Main.npc[index].homeless && !NPCID.Sets.IsTownPet[Main.npc[index].type] && NPC.TypeToDefaultHeadIndex(Main.npc[index].type) > 0) + if (Main.npc[index].active && !Main.npc[index].homeless && NPC.TypeToHeadIndex(Main.npc[index].type) > 0) ++num3; } this.taxMoney += num1 * num3; @@ -15184,4101 +14066,12 @@ label_15: public void GamepadEnableGrappleCooldown() => this._quickGrappleCooldown = 3; - public void TryInterruptingItemUsage() - { - bool flag1 = false; - if (this.heldProj > -1 && Main.projectile[this.heldProj].IsInterruptible(this)) - flag1 = true; - if (!flag1) - return; - bool flag2 = false; - if (PlayerInput.Triggers.Current.Hotbar1) - flag2 = true; - if (PlayerInput.Triggers.Current.Hotbar2) - flag2 = true; - if (PlayerInput.Triggers.Current.Hotbar3) - flag2 = true; - if (PlayerInput.Triggers.Current.Hotbar4) - flag2 = true; - if (PlayerInput.Triggers.Current.Hotbar5) - flag2 = true; - if (PlayerInput.Triggers.Current.Hotbar6) - flag2 = true; - if (PlayerInput.Triggers.Current.Hotbar7) - flag2 = true; - if (PlayerInput.Triggers.Current.Hotbar8) - flag2 = true; - if (PlayerInput.Triggers.Current.Hotbar9) - flag2 = true; - if (PlayerInput.Triggers.Current.Hotbar10) - flag2 = true; - bool flag3 = Main.hairWindow; - if (flag3) - { - int y = Main.screenHeight / 2 + 60; - flag3 = new Microsoft.Xna.Framework.Rectangle(Main.screenWidth / 2 - TextureAssets.HairStyleBack.Width() / 2, y, TextureAssets.HairStyleBack.Width(), TextureAssets.HairStyleBack.Height()).Contains(Main.MouseScreen.ToPoint()); - } - if ((Main.mapFullscreen || CaptureManager.Instance.Active || flag3 ? 0 : (!Main.playerInventory ? 1 : 0)) != 0) - { - int Offset = PlayerInput.Triggers.Current.HotbarPlus.ToInt() - PlayerInput.Triggers.Current.HotbarMinus.ToInt(); - if (PlayerInput.CurrentProfile.HotbarRadialHoldTimeRequired != -1) - Offset = PlayerInput.Triggers.JustReleased.HotbarPlus.ToInt() - PlayerInput.Triggers.JustReleased.HotbarMinus.ToInt(); - if (PlayerInput.Triggers.Current.HotbarScrollCD != 0) - Offset = 0; - if (!Main.inFancyUI && !Main.ingameOptionsWindow) - Offset += PlayerInput.ScrollWheelDelta / -120; - if (Offset != 0) - { - int num = this.selectedItem + Player.ClampHotbarOffset(Offset); - flag2 = true; - } - } - if (!flag2 || this.heldProj <= -1) - return; - Main.projectile[this.heldProj].Interrupt(this); - } - - private bool CanMoveForwardOnRope(int dir, int x, int y) - { - int index = x + dir; - if (Main.tile[index, y] == null || !Main.tile[index, y].active() || !Main.tileRope[(int) Main.tile[index, y].type]) - return false; - int num = index * 16 + 8 - this.width / 2; - float y1 = this.position.Y; - float y2 = (float) (y * 16 + 22); - if ((!Main.tile[index, y - 1].active() || !Main.tileRope[(int) Main.tile[index, y - 1].type]) && (!Main.tile[index, y + 1].active() || !Main.tileRope[(int) Main.tile[index, y + 1].type])) - y2 = (float) (y * 16 + 22); - return !Collision.SolidCollision(new Vector2((float) num, y2), this.width, this.height); - } - - public void UpdateHairDyeDust() - { - if (Main.netMode == 2 || Main.gamePaused || this.dead || this.ghost || this.stoned || this.frozen || (int) this.hairDye != ContentSamples.CommonlyUsedContentSamples.TeamDyeShaderIndex) - return; - if (Main.rand.Next(45) == 0) - { - int index = Dust.NewDust(this.position, this.width, 8, Main.rand.Next(139, 143), Scale: 1.2f); - Main.dust[index].velocity.X *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); - Main.dust[index].velocity.Y *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); - Main.dust[index].velocity.X += (float) Main.rand.Next(-50, 51) * 0.01f; - Main.dust[index].velocity.Y += (float) Main.rand.Next(-50, 51) * 0.01f; - --Main.dust[index].velocity.Y; - Main.dust[index].scale *= (float) (0.699999988079071 + (double) Main.rand.Next(-30, 31) * 0.00999999977648258); - Main.dust[index].velocity += this.velocity * 0.2f; - } - if (Main.rand.Next(225) != 0) - return; - int Type = Main.rand.Next(276, 283); - int index1 = Gore.NewGore(new Vector2(this.position.X + (float) Main.rand.Next(this.width), this.position.Y + (float) Main.rand.Next(8)), this.velocity, Type); - Main.gore[index1].velocity.X *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); - Main.gore[index1].velocity.Y *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); - Main.gore[index1].scale *= (float) (1.0 + (double) Main.rand.Next(-20, 21) * 0.00999999977648258); - Main.gore[index1].velocity.X += (float) Main.rand.Next(-50, 51) * 0.01f; - Main.gore[index1].velocity.Y += (float) Main.rand.Next(-50, 51) * 0.01f; - --Main.gore[index1].velocity.Y; - Main.gore[index1].velocity += this.velocity * 0.2f; - } - public void Update(int i) { - this.UpdateHairDyeDust(); - if (i == Main.myPlayer && Main.netMode != 2) - LockOnHelper.Update(); - if (this.launcherWait > 0) - --this.launcherWait; - this.maxFallSpeed = 10f; - this.gravity = Player.defaultGravity; - Player.jumpHeight = 15; - Player.jumpSpeed = 5.01f; - this.maxRunSpeed = 3f; - this.runAcceleration = 0.08f; - this.runSlowdown = 0.2f; - this.accRunSpeed = this.maxRunSpeed; - if (!this.mount.Active || !this.mount.Cart) - this.onWrongGround = false; - this.heldProj = -1; - this.instantMovementAccumulatedThisFrame = Vector2.Zero; - if (this.PortalPhysicsEnabled) - this.maxFallSpeed = 35f; - if (this.wet) - { - if (this.honeyWet) - { - this.gravity = 0.1f; - this.maxFallSpeed = 3f; - } - else if (this.merman) - { - this.gravity = 0.3f; - this.maxFallSpeed = 7f; - } - else if (this.trident && !this.lavaWet) - { - this.gravity = 0.25f; - this.maxFallSpeed = 6f; - Player.jumpHeight = 25; - Player.jumpSpeed = 5.51f; - if (this.controlUp) - { - this.gravity = 0.1f; - this.maxFallSpeed = 2f; - } - } - else - { - this.gravity = 0.2f; - this.maxFallSpeed = 5f; - Player.jumpHeight = 30; - Player.jumpSpeed = 6.01f; - } - } - if (this.vortexDebuff) - this.gravity = 0.0f; - this.maxFallSpeed += 0.01f; - bool flag1 = false; - if (Main.mapFullscreen) - this.GamepadEnableGrappleCooldown(); - else if (this._quickGrappleCooldown > 0) - --this._quickGrappleCooldown; - if (Main.myPlayer == i) - { - TileObject.objectPreview.Reset(); - if (DD2Event.DownedInvasionAnyDifficulty) - this.downedDD2EventAnyDifficulty = true; - } - if (this.active) - { - if (NPC.freeCake && this.talkNPC >= 0 && Main.npc[this.talkNPC].type == 208) - { - NPC.freeCake = false; - if (Main.netMode != 1) - Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3750); - } - if (this.emoteTime > 0) - --this.emoteTime; - if ((double) this.ghostDmg > 0.0) - this.ghostDmg -= 4.166667f; - if ((double) this.ghostDmg < 0.0) - this.ghostDmg = 0.0f; - if (Main.expertMode) - { - if ((double) this.lifeSteal < 70.0) - this.lifeSteal += 0.5f; - if ((double) this.lifeSteal > 70.0) - this.lifeSteal = 70f; - } - else - { - if ((double) this.lifeSteal < 80.0) - this.lifeSteal += 0.6f; - if ((double) this.lifeSteal > 80.0) - this.lifeSteal = 80f; - } - this.ResizeHitbox(); - if (this.mount.Active && this.mount.Type == 0) - { - int i1 = (int) ((double) this.position.X + (double) (this.width / 2)) / 16; - int j = (int) ((double) this.position.Y + (double) (this.height / 2) - 14.0) / 16; - Lighting.AddLight(i1, j, 0.5f, 0.2f, 0.05f); - Lighting.AddLight(i1 + this.direction, j, 0.5f, 0.2f, 0.05f); - Lighting.AddLight(i1 + this.direction * 2, j, 0.5f, 0.2f, 0.05f); - } - this.outOfRange = false; - if (this.whoAmI != Main.myPlayer) - { - int x = (int) ((double) this.position.X + (double) (this.width / 2)) / 16; - int y = (int) ((double) this.position.Y + (double) (this.height / 2)) / 16; - if (!WorldGen.InWorld(x, y, 4)) - flag1 = true; - else if (Main.tile[x, y] == null) - flag1 = true; - else if (Main.tile[x - 3, y] == null) - flag1 = true; - else if (Main.tile[x + 3, y] == null) - flag1 = true; - else if (Main.tile[x, y - 3] == null) - flag1 = true; - else if (Main.tile[x, y + 3] == null) - flag1 = true; - if (flag1) - { - this.outOfRange = true; - this.numMinions = 0; - this.slotsMinions = 0.0f; - this.itemAnimation = 0; - this.UpdateBuffs(i); - this.PlayerFrame(); - } - } - if (this.tankPet >= 0) - { - if (!this.tankPetReset) - this.tankPetReset = true; - else - this.tankPet = -1; - } - if (i == Main.myPlayer) - this.IsVoidVaultEnabled = this.HasItem(4131); - } - if (this.chatOverhead.timeLeft > 0) - --this.chatOverhead.timeLeft; - if (!this.active | flag1) - return; - this.UpdateMiscCounter(); - ++this.infernoCounter; - if (this.infernoCounter >= 180) - this.infernoCounter = 0; - if (this.starCloakCooldown > 0) - { - --this.starCloakCooldown; - if (Main.rand.Next(5) == 0) - { - for (int index = 0; index < 2; ++index) - { - Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 45, Alpha: ((int) byte.MaxValue), Scale: ((float) Main.rand.Next(20, 26) * 0.1f)); - dust.noLight = true; - dust.noGravity = true; - dust.velocity *= 0.5f; - dust.velocity.X = 0.0f; - dust.velocity.Y -= 0.5f; - } - } - if (this.starCloakCooldown == 0) - SoundEngine.PlaySound(25); - } - ++this._timeSinceLastImmuneGet; - if (this._timeSinceLastImmuneGet >= 10000) - this._timeSinceLastImmuneGet = 10000; - float num1 = (float) (Main.maxTilesX / 4200); - float num2 = (float) (((double) this.position.Y / 16.0 - (60.0 + 10.0 * (double) (num1 * num1))) / (Main.worldSurface / 6.0)); - if ((double) num2 < 0.25) - num2 = 0.25f; - if ((double) num2 > 1.0) - num2 = 1f; - this.gravity *= num2; - this.maxRegenDelay = (float) ((1.0 - (double) this.statMana / (double) this.statManaMax2) * 60.0 * 4.0 + 45.0); - this.maxRegenDelay *= 0.7f; - this.UpdateSocialShadow(); - this.UpdateTeleportVisuals(); - this.whoAmI = i; - if (this.whoAmI == Main.myPlayer) - { - if (!DD2Event.Ongoing) - this.PurgeDD2EnergyCrystals(); - this.TryPortalJumping(); - if (this.whoAmI == Main.myPlayer) - this.doorHelper.Update(this); - } - if (this.runSoundDelay > 0) - --this.runSoundDelay; - if (this.attackCD > 0) - --this.attackCD; - if (this.itemAnimation == 0) - this.attackCD = 0; - if (this.potionDelay > 0) - --this.potionDelay; - if (i == Main.myPlayer) - { - if (this.trashItem.type >= 1522 && this.trashItem.type <= 1527) - this.trashItem.SetDefaults(); - if (this.trashItem.type == 3643) - this.trashItem.SetDefaults(); - this.UpdateBiomes(); - this.UpdateMinionTarget(); - } - if (this.ghost) - this.Ghost(); - else if (this.dead) - { - this.UpdateDead(); - this.ResetProjectileCaches(); - this.UpdateProjectileCaches(i); - } - else - { - if ((double) this.velocity.Y == 0.0) - this.mount.FatigueRecovery(); - if (i == Main.myPlayer) - { - this.controlUp = false; - this.controlLeft = false; - this.controlDown = false; - this.controlRight = false; - this.controlJump = false; - this.controlUseItem = false; - this.controlUseTile = false; - this.controlThrow = false; - this.controlInv = false; - this.controlHook = false; - this.controlTorch = false; - this.controlSmart = false; - this.controlMount = false; - this.controlQuickHeal = false; - this.controlQuickMana = false; - this.controlCreativeMenu = false; - this.mapStyle = false; - this.mapAlphaDown = false; - this.mapAlphaUp = false; - this.mapFullScreen = false; - this.mapZoomIn = false; - this.mapZoomOut = false; - if (Main.hasFocus) - { - if (!Main.drawingPlayerChat && !Main.editSign && !Main.editChest && !Main.blockInput) - { - PlayerInput.Triggers.Current.CopyInto(this); - if (Main.mapFullscreen) - { - if (this.controlUp) - Main.mapFullscreenPos.Y -= (float) (1.0 * (16.0 / (double) Main.mapFullscreenScale)); - if (this.controlDown) - Main.mapFullscreenPos.Y += (float) (1.0 * (16.0 / (double) Main.mapFullscreenScale)); - if (this.controlLeft) - Main.mapFullscreenPos.X -= (float) (1.0 * (16.0 / (double) Main.mapFullscreenScale)); - if (this.controlRight) - Main.mapFullscreenPos.X += (float) (1.0 * (16.0 / (double) Main.mapFullscreenScale)); - this.controlUp = false; - this.controlLeft = false; - this.controlDown = false; - this.controlRight = false; - this.controlJump = false; - this.controlUseItem = false; - this.controlUseTile = false; - this.controlThrow = false; - this.controlHook = false; - this.controlTorch = false; - this.controlSmart = false; - this.controlMount = false; - } - if (this.controlQuickHeal) - { - if (this.releaseQuickHeal) - this.QuickHeal(); - this.releaseQuickHeal = false; - } - else - this.releaseQuickHeal = true; - if (this.controlQuickMana) - { - if (this.releaseQuickMana) - this.QuickMana(); - this.releaseQuickMana = false; - } - else - this.releaseQuickMana = true; - if (this.controlCreativeMenu) - { - if (this.releaseCreativeMenu) - this.ToggleCreativeMenu(); - this.releaseCreativeMenu = false; - } - else - this.releaseCreativeMenu = true; - if (this.controlLeft && this.controlRight) - { - this.controlLeft = false; - this.controlRight = false; - } - if (PlayerInput.UsingGamepad || !this.mouseInterface || !ItemSlot.Options.DisableLeftShiftTrashCan) - { - if (Main.cSmartCursorModeIsToggleAndNotHold) - { - if (this.controlSmart && this.releaseSmart) - { - SoundEngine.PlaySound(12); - Main.SmartCursorEnabled = !Main.SmartCursorEnabled; - } - } - else - { - if (this.controlSmart && this.releaseSmart) - SoundEngine.PlaySound(12); - if (Main.SmartCursorEnabled) - { - if (!this.controlSmart && !this.controlUseItem) - Main.SmartCursorEnabled = false; - } - else - Main.SmartCursorEnabled = this.controlSmart; - } - } - this.releaseSmart = !this.controlSmart; - if (this.controlMount) - { - if (this.releaseMount) - this.QuickMount(); - this.releaseMount = false; - } - else - this.releaseMount = true; - if (Main.mapFullscreen) - { - if (this.mapZoomIn) - Main.mapFullscreenScale *= 1.05f; - if (this.mapZoomOut) - Main.mapFullscreenScale *= 0.95f; - } - else - { - switch (Main.mapStyle) - { - case 1: - if (this.mapZoomIn) - Main.mapMinimapScale *= 1.025f; - if (this.mapZoomOut) - Main.mapMinimapScale *= 0.975f; - if (this.mapAlphaUp) - Main.mapMinimapAlpha += 0.015f; - if (this.mapAlphaDown) - { - Main.mapMinimapAlpha -= 0.015f; - break; - } - break; - case 2: - if (this.mapZoomIn) - Main.mapOverlayScale *= 1.05f; - if (this.mapZoomOut) - Main.mapOverlayScale *= 0.95f; - if (this.mapAlphaUp) - Main.mapOverlayAlpha += 0.015f; - if (this.mapAlphaDown) - { - Main.mapOverlayAlpha -= 0.015f; - break; - } - break; - } - if (this.mapStyle) - { - if (this.releaseMapStyle) - { - SoundEngine.PlaySound(12); - ++Main.mapStyle; - if (Main.mapStyle > 2) - Main.mapStyle = 0; - } - this.releaseMapStyle = false; - } - else - this.releaseMapStyle = true; - } - if (this.mapFullScreen) - { - if (this.releaseMapFullscreen) - { - if (Main.mapFullscreen) - { - SoundEngine.PlaySound(11); - Main.mapFullscreen = false; - } - else - this.TryOpeningFullscreenMap(); - } - this.releaseMapFullscreen = false; - } - else - this.releaseMapFullscreen = true; - } - else if (!PlayerInput.UsingGamepad && !Main.editSign && !Main.editChest && !Main.blockInput) - PlayerInput.Triggers.Current.CopyIntoDuringChat(this); - if (this.confused) - { - bool controlLeft = this.controlLeft; - bool controlUp = this.controlUp; - this.controlLeft = this.controlRight; - this.controlRight = controlLeft; - this.controlUp = this.controlRight; - this.controlDown = controlUp; - } - else if (this.cartFlip) - { - if (this.controlRight || this.controlLeft) - { - bool controlLeft = this.controlLeft; - this.controlLeft = this.controlRight; - this.controlRight = controlLeft; - } - else - this.cartFlip = false; - } - for (int index = 0; index < this.doubleTapCardinalTimer.Length; ++index) - { - --this.doubleTapCardinalTimer[index]; - if (this.doubleTapCardinalTimer[index] < 0) - this.doubleTapCardinalTimer[index] = 0; - } - for (int keyDir = 0; keyDir < 4; ++keyDir) - { - bool flag2 = false; - bool flag3 = false; - switch (keyDir) - { - case 0: - flag2 = this.controlDown && this.releaseDown; - flag3 = this.controlDown; - break; - case 1: - flag2 = this.controlUp && this.releaseUp; - flag3 = this.controlUp; - break; - case 2: - flag2 = this.controlRight && this.releaseRight; - flag3 = this.controlRight; - break; - case 3: - flag2 = this.controlLeft && this.releaseLeft; - flag3 = this.controlLeft; - break; - } - if (flag2) - { - if (this.doubleTapCardinalTimer[keyDir] > 0) - this.KeyDoubleTap(keyDir); - else - this.doubleTapCardinalTimer[keyDir] = 15; - } - if (flag3) - { - ++this.holdDownCardinalTimer[keyDir]; - this.KeyHoldDown(keyDir, this.holdDownCardinalTimer[keyDir]); - } - else - this.holdDownCardinalTimer[keyDir] = 0; - } - if (this.controlInv) - { - if (this.releaseInventory) - this.ToggleInv(); - this.releaseInventory = false; - } - else - this.releaseInventory = true; - if (this.delayUseItem) - { - if (!this.controlUseItem) - this.delayUseItem = false; - this.controlUseItem = false; - } - if (this.itemAnimation == 0 && this.ItemTimeIsZero && this.reuseDelay == 0) - { - this.dropItemCheck(); - int selectedItem = this.selectedItem; - bool flag4 = false; - if (!Main.drawingPlayerChat && this.selectedItem != 58 && !Main.editSign && !Main.editChest) - { - if (PlayerInput.Triggers.Current.Hotbar1) - { - this.selectedItem = 0; - flag4 = true; - } - if (PlayerInput.Triggers.Current.Hotbar2) - { - this.selectedItem = 1; - flag4 = true; - } - if (PlayerInput.Triggers.Current.Hotbar3) - { - this.selectedItem = 2; - flag4 = true; - } - if (PlayerInput.Triggers.Current.Hotbar4) - { - this.selectedItem = 3; - flag4 = true; - } - if (PlayerInput.Triggers.Current.Hotbar5) - { - this.selectedItem = 4; - flag4 = true; - } - if (PlayerInput.Triggers.Current.Hotbar6) - { - this.selectedItem = 5; - flag4 = true; - } - if (PlayerInput.Triggers.Current.Hotbar7) - { - this.selectedItem = 6; - flag4 = true; - } - if (PlayerInput.Triggers.Current.Hotbar8) - { - this.selectedItem = 7; - flag4 = true; - } - if (PlayerInput.Triggers.Current.Hotbar9) - { - this.selectedItem = 8; - flag4 = true; - } - if (PlayerInput.Triggers.Current.Hotbar10) - { - this.selectedItem = 9; - flag4 = true; - } - int selectedBinding1 = this.DpadRadial.SelectedBinding; - int selectedBinding2 = this.CircularRadial.SelectedBinding; - int selectedBinding3 = this.QuicksRadial.SelectedBinding; - this.DpadRadial.Update(); - this.CircularRadial.Update(); - this.QuicksRadial.Update(); - if (this.CircularRadial.SelectedBinding >= 0 && selectedBinding2 != this.CircularRadial.SelectedBinding) - this.DpadRadial.ChangeSelection(-1); - if (this.DpadRadial.SelectedBinding >= 0 && selectedBinding1 != this.DpadRadial.SelectedBinding) - this.CircularRadial.ChangeSelection(-1); - if (this.QuicksRadial.SelectedBinding != -1 && PlayerInput.Triggers.JustReleased.RadialQuickbar && !PlayerInput.MiscSettingsTEMP.HotbarRadialShouldBeUsed) - { - switch (this.QuicksRadial.SelectedBinding) - { - case 0: - this.QuickMount(); - break; - case 1: - this.QuickHeal(); - break; - case 2: - this.QuickBuff(); - break; - case 3: - this.QuickMana(); - break; - } - } - if (this.controlTorch | flag4) - { - this.DpadRadial.ChangeSelection(-1); - this.CircularRadial.ChangeSelection(-1); - } - if (this.controlTorch & flag4) - { - if (this.selectedItem != this.nonTorch) - SoundEngine.PlaySound(12); - this.nonTorch = this.selectedItem; - this.selectedItem = selectedItem; - flag4 = false; - } - } - bool flag5 = Main.hairWindow; - Microsoft.Xna.Framework.Rectangle rectangle; - if (flag5) - { - int y = Main.screenHeight / 2 + 60; - rectangle = new Microsoft.Xna.Framework.Rectangle(Main.screenWidth / 2 - TextureAssets.HairStyleBack.Width() / 2, y, TextureAssets.HairStyleBack.Width(), TextureAssets.HairStyleBack.Height()); - flag5 = rectangle.Contains(Main.MouseScreen.ToPoint()); - } - if (flag4 && CaptureManager.Instance.Active) - CaptureManager.Instance.Active = false; - if (selectedItem != this.selectedItem) - SoundEngine.PlaySound(12); - if (Main.mapFullscreen) - { - float num3 = (float) (PlayerInput.ScrollWheelDelta / 120); - if (PlayerInput.UsingGamepad) - num3 += (float) (PlayerInput.Triggers.Current.HotbarPlus.ToInt() - PlayerInput.Triggers.Current.HotbarMinus.ToInt()) * 0.1f; - Main.mapFullscreenScale *= (float) (1.0 + (double) num3 * 0.300000011920929); - } - else if (CaptureManager.Instance.Active) - CaptureManager.Instance.Scrolling(); - else if (!flag5) - { - if (!Main.playerInventory) - { - this.HandleHotbar(); - } - else - { - int mouseScrollDelta = Player.GetMouseScrollDelta(); - bool flag6 = true; - if (Main.recBigList) - { - int num4 = 42; - int y = 340; - int x = 310; - PlayerInput.SetZoom_UI(); - int num5 = (Main.screenWidth - x - 280) / num4; - int num6 = (Main.screenHeight - y - 20) / num4; - rectangle = new Microsoft.Xna.Framework.Rectangle(x, y, num5 * num4, num6 * num4); - if (rectangle.Contains(Main.MouseScreen.ToPoint())) - { - mouseScrollDelta *= -1; - int num7 = Math.Sign(mouseScrollDelta); - for (; mouseScrollDelta != 0; mouseScrollDelta -= num7) - { - if (mouseScrollDelta < 0) - { - Main.recStart -= num5; - if (Main.recStart < 0) - Main.recStart = 0; - } - else - { - Main.recStart += num5; - if (Main.recStart > Main.numAvailableRecipes - num5) - Main.recStart = Main.numAvailableRecipes - num5; - } - } - } - PlayerInput.SetZoom_World(); - } - if (flag6) - { - Main.focusRecipe += mouseScrollDelta; - if (Main.focusRecipe > Main.numAvailableRecipes - 1) - Main.focusRecipe = Main.numAvailableRecipes - 1; - if (Main.focusRecipe < 0) - Main.focusRecipe = 0; - } - } - } - } - else - { - bool flag7 = false; - if (!Main.drawingPlayerChat && this.selectedItem != 58 && !Main.editSign && !Main.editChest) - { - int num8 = -1; - if (Main.keyState.IsKeyDown(Keys.D1)) - { - num8 = 0; - flag7 = true; - } - if (Main.keyState.IsKeyDown(Keys.D2)) - { - num8 = 1; - flag7 = true; - } - if (Main.keyState.IsKeyDown(Keys.D3)) - { - num8 = 2; - flag7 = true; - } - if (Main.keyState.IsKeyDown(Keys.D4)) - { - num8 = 3; - flag7 = true; - } - if (Main.keyState.IsKeyDown(Keys.D5)) - { - num8 = 4; - flag7 = true; - } - if (Main.keyState.IsKeyDown(Keys.D6)) - { - num8 = 5; - flag7 = true; - } - if (Main.keyState.IsKeyDown(Keys.D7)) - { - num8 = 6; - flag7 = true; - } - if (Main.keyState.IsKeyDown(Keys.D8)) - { - num8 = 7; - flag7 = true; - } - if (Main.keyState.IsKeyDown(Keys.D9)) - { - num8 = 8; - flag7 = true; - } - if (Main.keyState.IsKeyDown(Keys.D0)) - { - num8 = 9; - flag7 = true; - } - if (flag7) - { - if (num8 != this.nonTorch) - SoundEngine.PlaySound(12); - this.nonTorch = num8; - } - } - } - } - if (this.selectedItem != 58) - this.SmartSelectLookup(); - if (this.stoned != this.lastStoned) - { - if (this.whoAmI == Main.myPlayer && this.stoned) - { - int Damage = (int) (20.0 * (double) Main.GameModeInfo.EnemyDamageMultiplier); - this.Hurt(PlayerDeathReason.ByOther(5), Damage, 0); - } - SoundEngine.PlaySound(0, (int) this.position.X, (int) this.position.Y); - for (int index1 = 0; index1 < 20; ++index1) - { - int index2 = Dust.NewDust(this.position, this.width, this.height, 1); - if (Main.rand.Next(2) == 0) - Main.dust[index2].noGravity = true; - } - } - this.lastStoned = this.stoned; - if (this.frozen || this.webbed || this.stoned) - { - this.controlJump = false; - this.controlDown = false; - this.controlLeft = false; - this.controlRight = false; - this.controlUp = false; - this.controlUseItem = false; - this.controlUseTile = false; - this.controlThrow = false; - this.gravDir = 1f; - } - this.releaseThrow = !this.controlThrow; - if (this.controlDown && this.releaseDown) - { - if (this.tryKeepingHoveringUp) - this.tryKeepingHoveringUp = false; - else - this.tryKeepingHoveringDown = true; - } - if (this.controlUp && this.releaseUp) - { - if (this.tryKeepingHoveringDown) - this.tryKeepingHoveringDown = false; - else - this.tryKeepingHoveringUp = true; - } - if ((double) this.velocity.Y == 0.0) - { - this.tryKeepingHoveringUp = false; - this.tryKeepingHoveringDown = false; - } - if (Player.Settings.HoverControl == Player.Settings.HoverControlMode.Hold) - { - this.tryKeepingHoveringUp = false; - this.tryKeepingHoveringDown = false; - } - if (Main.netMode == 1) - { - bool flag8 = false; - if (this.controlUp != Main.clientPlayer.controlUp) - flag8 = true; - if (this.controlDown != Main.clientPlayer.controlDown) - flag8 = true; - if (this.controlLeft != Main.clientPlayer.controlLeft) - flag8 = true; - if (this.controlRight != Main.clientPlayer.controlRight) - flag8 = true; - if (this.controlJump != Main.clientPlayer.controlJump) - flag8 = true; - if (this.controlUseItem != Main.clientPlayer.controlUseItem) - flag8 = true; - if (this.selectedItem != Main.clientPlayer.selectedItem) - flag8 = true; - if (flag8) - NetMessage.SendData(13, number: Main.myPlayer); - } - if (Main.playerInventory) - this.AdjTiles(); - this.HandleBeingInChestRange(); - this.tileEntityAnchor.GetTileEntity()?.OnPlayerUpdate(this); - if ((double) this.velocity.Y <= 0.0) - this.fallStart2 = (int) ((double) this.position.Y / 16.0); - if ((double) this.velocity.Y == 0.0) - { - int num9 = 25 + this.extraFall; - int num10 = (int) ((double) this.position.Y / 16.0) - this.fallStart; - if (this.mount.CanFly()) - num10 = 0; - if (this.mount.Cart && Minecart.OnTrack(this.position, this.width, this.height)) - num10 = 0; - if (this.mount.Type == 1) - num10 = 0; - if (num10 > 0 || (double) this.gravDir == -1.0 && num10 < 0) - { - int num11 = (int) ((double) this.position.X / 16.0); - int num12 = (int) (((double) this.position.X + (double) this.width) / 16.0); - int index3 = (int) (((double) this.position.Y + (double) this.height + 1.0) / 16.0); - if ((double) this.gravDir == -1.0) - index3 = (int) (((double) this.position.Y - 1.0) / 16.0); - for (int index4 = num11; index4 <= num12; ++index4) - { - if (Main.tile[index4, index3] != null && Main.tile[index4, index3].active() && (Main.tile[index4, index3].type == (ushort) 189 || Main.tile[index4, index3].type == (ushort) 196 || Main.tile[index4, index3].type == (ushort) 460)) - { - num10 = 0; - break; - } - } - } - bool flag9 = false; - for (int index = 3; index < 10; ++index) - { - if (this.armor[index].stack > 0 && this.armor[index].wingSlot > (sbyte) -1) - flag9 = true; - } - if (this.stoned) - { - int Damage = (int) (((double) num10 * (double) this.gravDir - 2.0) * 20.0); - if (Damage > 0) - { - this.Hurt(PlayerDeathReason.ByOther(5), Damage, 0); - this.immune = false; - } - } - else if (((double) this.gravDir == 1.0 && num10 > num9 || (double) this.gravDir == -1.0 && num10 < -num9) && !this.noFallDmg && !flag9) - { - this.immune = false; - int Damage = (int) ((double) num10 * (double) this.gravDir - (double) num9) * 10; - if (this.mount.Active) - Damage = (int) ((double) Damage * (double) this.mount.FallDamage); - this.Hurt(PlayerDeathReason.ByOther(0), Damage, 0); - if (!this.dead && this.statLife <= this.statLifeMax2 / 10) - AchievementsHelper.HandleSpecialEvent(this, 8); - } - this.fallStart = (int) ((double) this.position.Y / 16.0); - } - if (this.jump > 0 || this.rocketDelay > 0 || this.wet || this.slowFall || (double) num2 < 0.8 || this.tongued) - this.fallStart = (int) ((double) this.position.Y / 16.0); - } - if (Main.netMode != 1) - { - if (this.chest == -1 && this.lastChest >= 0 && Main.chest[this.lastChest] != null && Main.chest[this.lastChest] != null) - NPC.BigMimicSummonCheck(Main.chest[this.lastChest].x, Main.chest[this.lastChest].y); - this.lastChest = this.chest; - } - if (this.mouseInterface) - this.delayUseItem = true; - Player.tileTargetX = (int) (((double) Main.mouseX + (double) Main.screenPosition.X) / 16.0); - Player.tileTargetY = (int) (((double) Main.mouseY + (double) Main.screenPosition.Y) / 16.0); - if ((double) this.gravDir == -1.0) - Player.tileTargetY = (int) (((double) Main.screenPosition.Y + (double) Main.screenHeight - (double) Main.mouseY) / 16.0); - if (Player.tileTargetX >= Main.maxTilesX - 5) - Player.tileTargetX = Main.maxTilesX - 5; - if (Player.tileTargetY >= Main.maxTilesY - 5) - Player.tileTargetY = Main.maxTilesY - 5; - if (Player.tileTargetX < 5) - Player.tileTargetX = 5; - if (Player.tileTargetY < 5) - Player.tileTargetY = 5; - if (Main.tile[Player.tileTargetX - 1, Player.tileTargetY] == null) - Main.tile[Player.tileTargetX - 1, Player.tileTargetY] = new Tile(); - if (Main.tile[Player.tileTargetX + 1, Player.tileTargetY] == null) - Main.tile[Player.tileTargetX + 1, Player.tileTargetY] = new Tile(); - if (Main.tile[Player.tileTargetX, Player.tileTargetY] == null) - Main.tile[Player.tileTargetX, Player.tileTargetY] = new Tile(); - if (this.inventory[this.selectedItem].axe > 0 && !Main.tile[Player.tileTargetX, Player.tileTargetY].active() && this.inventory[this.selectedItem].createWall <= 0 && (this.inventory[this.selectedItem].hammer <= 0 || this.inventory[this.selectedItem].axe != 0)) - { - if (Main.tile[Player.tileTargetX - 1, Player.tileTargetY].active() && Main.tile[Player.tileTargetX - 1, Player.tileTargetY].type == (ushort) 323) - { - if (Main.tile[Player.tileTargetX - 1, Player.tileTargetY].frameY > (short) 4) - --Player.tileTargetX; - } - else if (Main.tile[Player.tileTargetX + 1, Player.tileTargetY].active() && Main.tile[Player.tileTargetX + 1, Player.tileTargetY].type == (ushort) 323 && Main.tile[Player.tileTargetX + 1, Player.tileTargetY].frameY < (short) -4) - ++Player.tileTargetX; - } - if (i == Main.myPlayer) - this.UpdateNearbyInteractibleProjectilesList(); - try - { - if (this.whoAmI == Main.myPlayer) - { - if (Main.instance.IsActive) - { - SmartCursorHelper.SmartCursorLookup(this); - this.SmartInteractLookup(); - } - } - } - catch - { - Main.SmartCursorEnabled = false; - } - this.UpdateImmunity(); - if (this.petalTimer > 0) - --this.petalTimer; - if (this.shadowDodgeTimer > 0) - --this.shadowDodgeTimer; - if (this.jump > 0 || (double) this.velocity.Y != 0.0) - this.ResetFloorFlags(); - this.potionDelayTime = Item.potionDelay; - this.restorationDelayTime = Item.restorationDelay; - if (this.pStone) - { - this.potionDelayTime = (int) ((double) this.potionDelayTime * 0.75); - this.restorationDelayTime = (int) ((double) this.restorationDelayTime * 0.75); - } - if (this.yoraiz0rEye > 0) - this.Yoraiz0rEye(); - this.ResetEffects(); - this.UpdateDyes(); - if (CreativePowerManager.Instance.GetPower().IsEnabledForPlayer(this.whoAmI)) - this.creativeGodMode = true; - if (this.velocity == Vector2.Zero && this.itemAnimation == 0) - ++this.afkCounter; - else - this.afkCounter = 0; - this.meleeCrit += this.inventory[this.selectedItem].crit; - this.magicCrit += this.inventory[this.selectedItem].crit; - this.rangedCrit += this.inventory[this.selectedItem].crit; - if (this.whoAmI == Main.myPlayer) - { - Main.musicBox2 = -1; - if (Main.SceneMetrics.WaterCandleCount > 0) - this.AddBuff(86, 2, false); - if (Main.SceneMetrics.PeaceCandleCount > 0) - this.AddBuff(157, 2, false); - if (Main.SceneMetrics.HasCampfire) - this.AddBuff(87, 2, false); - if (Main.SceneMetrics.HasCatBast) - this.AddBuff(215, 2, false); - if (Main.SceneMetrics.HasStarInBottle) - this.AddBuff(158, 2, false); - if (Main.SceneMetrics.HasHeartLantern) - this.AddBuff(89, 2, false); - if (Main.SceneMetrics.HasSunflower) - this.AddBuff(146, 2, false); - if (Main.SceneMetrics.hasBanner) - this.AddBuff(147, 2, false); - if (!this.behindBackWall && this.ZoneSandstorm) - this.AddBuff(194, 2, false); - } - for (int index = 0; index < 323; ++index) - this.buffImmune[index] = false; - this.UpdateProjectileCaches(i); - this.UpdateBuffs(i); - if (this.whoAmI == Main.myPlayer) - { - if (!this.onFire && !this.poisoned) - this.trapDebuffSource = false; - this.UpdatePet(i); - this.UpdatePetLight(i); - } - this.UpdateLuckFactors(); - this.RecalculateLuck(); - if (this.luckNeedsSync && this.whoAmI == Main.myPlayer) - { - this.luckNeedsSync = false; - NetMessage.SendData(134, number: this.whoAmI); - } - bool flag10 = this.wet && !this.lavaWet && (!this.mount.Active || !this.mount.IsConsideredASlimeMount); - if (this.accMerman & flag10) - { - this.releaseJump = true; - this.wings = 0; - this.merman = true; - this.accFlipper = true; - this.AddBuff(34, 2); - } - else - this.merman = false; - if (!flag10 && this.forceWerewolf) - this.forceMerman = false; - if (this.forceMerman & flag10) - this.wings = 0; - this.accMerman = false; - this.hideMerman = false; - this.forceMerman = false; - if (this.wolfAcc && !this.merman && !Main.dayTime && !this.wereWolf) - this.AddBuff(28, 60); - this.wolfAcc = false; - this.hideWolf = false; - this.forceWerewolf = false; - if (this.whoAmI == Main.myPlayer) - { - for (int b = 0; b < 22; ++b) - { - if (this.buffType[b] > 0 && this.buffTime[b] <= 0) - this.DelBuff(b); - } - } - this.beetleDefense = false; - this.beetleOffense = false; - this.setSolar = false; - this.head = this.armor[0].headSlot; - this.body = this.armor[1].bodySlot; - this.legs = this.armor[2].legSlot; - this.ResetVisibleAccessories(); - if ((double) this.MountFishronSpecialCounter > 0.0) - --this.MountFishronSpecialCounter; - if (this._portalPhysicsTime > 0) - --this._portalPhysicsTime; - this.UpdateEquips(i); - this.UpdatePortableStoolUsage(); - if ((double) this.velocity.Y == 0.0 || this.controlJump) - this.portalPhysicsFlag = false; - if (this.inventory[this.selectedItem].type == 3384 || this.portalPhysicsFlag) - this._portalPhysicsTime = 30; - if (this.mount.Active) - this.mount.UpdateEffects(this); - ++this.gemCount; - if (this.gemCount >= 10) - { - this.gem = -1; - this.ownedLargeGems = (BitsByte) (byte) 0; - this.gemCount = 0; - for (int index = 0; index <= 58; ++index) - { - if (this.inventory[index].type == 0 || this.inventory[index].stack == 0) - this.inventory[index].TurnToAir(); - if (this.inventory[index].type >= 1522 && this.inventory[index].type <= 1527) - { - this.gem = this.inventory[index].type - 1522; - this.ownedLargeGems[this.gem] = true; - } - if (this.inventory[index].type == 3643) - { - this.gem = 6; - this.ownedLargeGems[this.gem] = true; - } - } - } - this.UpdateArmorLights(); - this.UpdateArmorSets(i); - if (this.maxTurretsOld != this.maxTurrets) - { - this.UpdateMaxTurrets(); - this.maxTurretsOld = this.maxTurrets; - } - if (this.shieldRaised) - this.statDefense += 20; - if (((this.merman ? 1 : (this.forceMerman ? 1 : 0)) & (flag10 ? 1 : 0)) != 0) - this.wings = 0; - if (this.invis) - { - if (this.itemAnimation == 0 && this.aggro > -750) - this.aggro = -750; - else if (this.aggro > -250) - this.aggro = -250; - } - if (this.inventory[this.selectedItem].type == 3106) - { - if (this.itemAnimation > 0) - { - this.stealthTimer = 15; - if ((double) this.stealth > 0.0) - this.stealth += 0.1f; - } - else if ((double) this.velocity.X > -0.1 && (double) this.velocity.X < 0.1 && (double) this.velocity.Y > -0.1 && (double) this.velocity.Y < 0.1 && !this.mount.Active) - { - if (this.stealthTimer == 0 && (double) this.stealth > 0.0) - { - this.stealth -= 0.02f; - if ((double) this.stealth <= 0.0) - { - this.stealth = 0.0f; - if (Main.netMode == 1) - NetMessage.SendData(84, number: this.whoAmI); - } - } - } - else - { - if ((double) this.stealth > 0.0) - this.stealth += 0.1f; - if (this.mount.Active) - this.stealth = 1f; - } - if ((double) this.stealth > 1.0) - this.stealth = 1f; - this.meleeDamage += (float) ((1.0 - (double) this.stealth) * 3.0); - this.meleeCrit += (int) ((1.0 - (double) this.stealth) * 30.0); - if (this.meleeCrit > 100) - this.meleeCrit = 100; - this.aggro -= (int) ((1.0 - (double) this.stealth) * 750.0); - if (this.stealthTimer > 0) - --this.stealthTimer; - } - else if (this.shroomiteStealth) - { - if (this.itemAnimation > 0) - this.stealthTimer = 5; - if ((double) this.velocity.X > -0.1 && (double) this.velocity.X < 0.1 && (double) this.velocity.Y > -0.1 && (double) this.velocity.Y < 0.1 && !this.mount.Active) - { - if (this.stealthTimer == 0 && (double) this.stealth > 0.0) - { - this.stealth -= 0.015f; - if ((double) this.stealth <= 0.0) - { - this.stealth = 0.0f; - if (Main.netMode == 1) - NetMessage.SendData(84, number: this.whoAmI); - } - } - } - else - { - this.stealth += (Math.Abs(this.velocity.X) + Math.Abs(this.velocity.Y)) * 0.0075f; - if ((double) this.stealth > 1.0) - this.stealth = 1f; - if (this.mount.Active) - this.stealth = 1f; - } - this.rangedDamage += (float) ((1.0 - (double) this.stealth) * 0.600000023841858); - this.rangedCrit += (int) ((1.0 - (double) this.stealth) * 10.0); - this.aggro -= (int) ((1.0 - (double) this.stealth) * 750.0); - if (this.stealthTimer > 0) - --this.stealthTimer; - } - else if (this.setVortex) - { - bool flag11 = false; - if (this.vortexStealthActive) - { - float stealth = this.stealth; - this.stealth -= 0.04f; - if ((double) this.stealth < 0.0) - this.stealth = 0.0f; - else - flag11 = true; - if ((double) this.stealth == 0.0 && (double) stealth != (double) this.stealth && Main.netMode == 1) - NetMessage.SendData(84, number: this.whoAmI); - this.rangedDamage += (float) ((1.0 - (double) this.stealth) * 0.800000011920929); - this.rangedCrit += (int) ((1.0 - (double) this.stealth) * 20.0); - this.aggro -= (int) ((1.0 - (double) this.stealth) * 1200.0); - this.accRunSpeed *= 0.3f; - this.maxRunSpeed *= 0.3f; - if (this.mount.Active) - this.vortexStealthActive = false; - } - else - { - float stealth = this.stealth; - this.stealth += 0.04f; - if ((double) this.stealth > 1.0) - this.stealth = 1f; - else - flag11 = true; - if ((double) this.stealth == 1.0 && (double) stealth != (double) this.stealth && Main.netMode == 1) - NetMessage.SendData(84, number: this.whoAmI); - } - if (flag11) - { - if (Main.rand.Next(2) == 0) - { - Vector2 spinningpoint = Vector2.UnitY.RotatedByRandom(6.28318548202515); - Dust dust = Main.dust[Dust.NewDust(this.Center - spinningpoint * 30f, 0, 0, 229)]; - dust.noGravity = true; - dust.position = this.Center - spinningpoint * (float) Main.rand.Next(5, 11); - dust.velocity = spinningpoint.RotatedBy(1.57079637050629) * 4f; - dust.scale = 0.5f + Main.rand.NextFloat(); - dust.fadeIn = 0.5f; - } - if (Main.rand.Next(2) == 0) - { - Vector2 spinningpoint = Vector2.UnitY.RotatedByRandom(6.28318548202515); - Dust dust = Main.dust[Dust.NewDust(this.Center - spinningpoint * 30f, 0, 0, 240)]; - dust.noGravity = true; - dust.position = this.Center - spinningpoint * 12f; - dust.velocity = spinningpoint.RotatedBy(-1.57079637050629) * 2f; - dust.scale = 0.5f + Main.rand.NextFloat(); - dust.fadeIn = 0.5f; - } - } - } - else - this.stealth = 1f; - if (this.manaSick) - this.magicDamage *= 1f - this.manaSickReduction; - this.meleeSpeed = 1f + (this.meleeSpeed - 1f) * ItemID.Sets.BonusMeleeSpeedMultiplier[this.inventory[this.selectedItem].type]; - if ((double) this.pickSpeed < 0.3) - this.pickSpeed = 0.3f; - if ((double) this.meleeSpeed > 3.0) - this.meleeSpeed = 3f; - if ((double) this.tileSpeed > 3.0) - this.tileSpeed = 3f; - this.tileSpeed = 1f / this.tileSpeed; - if ((double) this.wallSpeed > 3.0) - this.wallSpeed = 3f; - this.wallSpeed = 1f / this.wallSpeed; - if (this.statManaMax2 > 400) - this.statManaMax2 = 400; - if (this.statDefense < 0) - this.statDefense = 0; - if (this.slowOgreSpit) - { - this.moveSpeed /= 3f; - if ((double) this.velocity.Y == 0.0 && (double) Math.Abs(this.velocity.X) > 1.0) - this.velocity.X /= 2f; - } - else if (this.dazed) - this.moveSpeed /= 3f; - else if (this.slow) - this.moveSpeed /= 2f; - else if (this.chilled) - this.moveSpeed *= 0.75f; - if (this.shieldRaised) - { - this.moveSpeed /= 3f; - if ((double) this.velocity.Y == 0.0 && (double) Math.Abs(this.velocity.X) > 3.0) - this.velocity.X /= 2f; - } - if (DD2Event.Ongoing) - { - DD2Event.FindArenaHitbox(); - if (DD2Event.ShouldBlockBuilding(this.Center)) - { - this.noBuilding = true; - this.AddBuff(199, 3); - } - } - this.meleeSpeed = 1f / this.meleeSpeed; - this.UpdateLifeRegen(); - this.soulDrain = 0; - this.UpdateManaRegen(); - if (this.manaRegenCount < 0) - this.manaRegenCount = 0; - if (this.statMana > this.statManaMax2) - this.statMana = this.statManaMax2; - this.runAcceleration *= this.moveSpeed; - this.maxRunSpeed *= this.moveSpeed; - this.UpdateJumpHeight(); - for (int b = 0; b < 22; ++b) - { - if (this.buffType[b] > 0 && this.buffTime[b] > 0 && this.buffImmune[this.buffType[b]]) - this.DelBuff(b); - } - if (this.brokenArmor) - this.statDefense /= 2; - if (this.witheredArmor) - this.statDefense /= 2; - if (this.witheredWeapon) - { - this.meleeDamage *= 0.5f; - this.rangedDamage *= 0.5f; - this.magicDamage *= 0.5f; - this.minionDamage *= 0.5f; - } - this.lastTileRangeX = Player.tileRangeX; - this.lastTileRangeY = Player.tileRangeY; - if (this.mount.Active) - this.movementAbilitiesCache.CopyFrom(this); - else - this.movementAbilitiesCache.PasteInto(this); - if (this.mount.Active && this.mount.BlockExtraJumps) - { - this.canJumpAgain_Cloud = false; - this.canJumpAgain_Sandstorm = false; - this.canJumpAgain_Blizzard = false; - this.canJumpAgain_Fart = false; - this.canJumpAgain_Sail = false; - this.canJumpAgain_Unicorn = false; - this.canJumpAgain_Santank = false; - this.canJumpAgain_WallOfFleshGoat = false; - this.canJumpAgain_Basilisk = false; - } - else if (((double) this.velocity.Y == 0.0 ? 1 : (this.sliding ? 1 : 0)) != 0) - { - this.RefreshDoubleJumps(); - } - else - { - if (!this.hasJumpOption_Cloud) - this.canJumpAgain_Cloud = false; - if (!this.hasJumpOption_Sandstorm) - this.canJumpAgain_Sandstorm = false; - if (!this.hasJumpOption_Blizzard) - this.canJumpAgain_Blizzard = false; - if (!this.hasJumpOption_Fart) - this.canJumpAgain_Fart = false; - if (!this.hasJumpOption_Sail) - this.canJumpAgain_Sail = false; - if (!this.hasJumpOption_Unicorn) - this.canJumpAgain_Unicorn = false; - if (!this.hasJumpOption_Santank) - this.canJumpAgain_Santank = false; - if (!this.hasJumpOption_WallOfFleshGoat) - this.canJumpAgain_WallOfFleshGoat = false; - if (!this.hasJumpOption_Basilisk) - this.canJumpAgain_Basilisk = false; - } - if (!this.carpet) - { - this.canCarpet = false; - this.carpetFrame = -1; - } - else if ((double) this.velocity.Y == 0.0 || this.sliding) - { - this.canCarpet = true; - this.carpetTime = 0; - this.carpetFrame = -1; - this.carpetFrameCounter = 0.0f; - } - if ((double) this.gravDir == -1.0) - this.canCarpet = false; - if (this.ropeCount > 0) - --this.ropeCount; - if (!this.pulley && !this.frozen && !this.webbed && !this.stoned && !this.controlJump && (double) this.gravDir == 1.0 && this.ropeCount == 0 && this.grappling[0] == -1 && !this.tongued && !this.mount.Active) - this.FindPulley(); - this.UpdatePettingAnimal(); - this.sitting.UpdateSitting(this); - this.sleeping.UpdateState(this); - this.eyeHelper.Update(this); - if (this.pulley) - { - if (this.mount.Active) - this.pulley = false; - this.sandStorm = false; - this.CancelAllJumpVisualEffects(); - int x = (int) ((double) this.position.X + (double) (this.width / 2)) / 16; - int y1 = (int) ((double) this.position.Y - 8.0) / 16; - bool flag12 = false; - if (this.pulleyDir == (byte) 0) - this.pulleyDir = (byte) 1; - if (this.pulleyDir == (byte) 1) - { - if (this.direction == -1 && this.controlLeft && (this.releaseLeft || this.leftTimer == 0)) - { - this.pulleyDir = (byte) 2; - flag12 = true; - } - else if (this.direction == 1 && this.controlRight && this.releaseRight || this.rightTimer == 0) - { - this.pulleyDir = (byte) 2; - flag12 = true; - } - else - { - if (this.direction == 1 && this.controlLeft) - { - this.direction = -1; - flag12 = true; - } - if (this.direction == -1 && this.controlRight) - { - this.direction = 1; - flag12 = true; - } - } - } - else if (this.pulleyDir == (byte) 2) - { - if (this.direction == 1 && this.controlLeft) - { - flag12 = true; - if (!Collision.SolidCollision(new Vector2((float) (x * 16 + 8 - this.width / 2), this.position.Y), this.width, this.height)) - { - this.pulleyDir = (byte) 1; - this.direction = -1; - flag12 = true; - } - } - if (this.direction == -1 && this.controlRight) - { - flag12 = true; - if (!Collision.SolidCollision(new Vector2((float) (x * 16 + 8 - this.width / 2), this.position.Y), this.width, this.height)) - { - this.pulleyDir = (byte) 1; - this.direction = 1; - flag12 = true; - } - } - } - int dir = 1; - if (this.controlLeft) - dir = -1; - bool flag13 = this.CanMoveForwardOnRope(dir, x, y1); - if (((!this.controlLeft ? 0 : (this.direction == -1 ? 1 : 0)) & (flag13 ? 1 : 0)) != 0) - this.instantMovementAccumulatedThisFrame.X += -1f; - if (((!this.controlRight ? 0 : (this.direction == 1 ? 1 : 0)) & (flag13 ? 1 : 0)) != 0) - ++this.instantMovementAccumulatedThisFrame.X; - bool flag14 = false; - if (!flag12 && (this.controlLeft && (this.releaseLeft || this.leftTimer == 0) || this.controlRight && (this.releaseRight || this.rightTimer == 0))) - { - int index = x + dir; - if (Main.tile[index, y1] != null && Main.tile[index, y1].active() && Main.tileRope[(int) Main.tile[index, y1].type]) - { - this.pulleyDir = (byte) 1; - this.direction = dir; - int num13 = index * 16 + 8 - this.width / 2; - float y2 = this.position.Y; - float y3 = (float) (y1 * 16 + 22); - if (Main.tile[index, y1 - 1] == null) - Main.tile[index, y1 - 1] = new Tile(); - if (Main.tile[index, y1 + 1] == null) - Main.tile[index, y1 + 1] = new Tile(); - if ((!Main.tile[index, y1 - 1].active() || !Main.tileRope[(int) Main.tile[index, y1 - 1].type]) && (!Main.tile[index, y1 + 1].active() || !Main.tileRope[(int) Main.tile[index, y1 + 1].type])) - y3 = (float) (y1 * 16 + 22); - if (Collision.SolidCollision(new Vector2((float) num13, y3), this.width, this.height)) - { - this.pulleyDir = (byte) 2; - this.direction = -dir; - num13 = this.direction != 1 ? index * 16 + 8 - this.width / 2 - 6 : index * 16 + 8 - this.width / 2 + 6; - } - if (i == Main.myPlayer) - Main.cameraX = Main.cameraX + this.position.X - (float) num13; - this.position.X = (float) num13; - this.gfxOffY = this.position.Y - y3; - this.position.Y = y3; - flag14 = true; - } - } - if (!flag14 && !flag12 && !this.controlUp && (this.controlLeft && this.releaseLeft || this.controlRight && this.releaseRight)) - { - this.pulley = false; - if (this.controlLeft && (double) this.velocity.X == 0.0) - this.velocity.X = -1f; - if (this.controlRight && (double) this.velocity.X == 0.0) - this.velocity.X = 1f; - } - if ((double) this.velocity.X != 0.0) - this.pulley = false; - if (Main.tile[x, y1] == null) - Main.tile[x, y1] = new Tile(); - if (!Main.tile[x, y1].active() || !Main.tileRope[(int) Main.tile[x, y1].type]) - this.pulley = false; - if ((double) this.gravDir != 1.0) - this.pulley = false; - if (this.frozen || this.webbed || this.stoned) - this.pulley = false; - if (!this.pulley) - this.velocity.Y -= this.gravity; - if (this.controlJump) - { - this.pulley = false; - this.jump = Player.jumpHeight; - this.velocity.Y = -Player.jumpSpeed; - } - } - if (this.grapCount > 0) - this.pulley = false; - if (this.pulley) - { - this.fallStart = (int) this.position.Y / 16; - this.wingFrame = 0; - if (this.wings == 4) - this.wingFrame = 3; - int index5 = (int) ((double) this.position.X + (double) (this.width / 2)) / 16; - int index6 = (int) ((double) this.position.Y - 16.0) / 16; - int num14 = (int) ((double) this.position.Y - 8.0) / 16; - bool flag15 = true; - bool flag16 = false; - if (Main.tile[index5, num14 - 1].active() && Main.tileRope[(int) Main.tile[index5, num14 - 1].type] || Main.tile[index5, num14 + 1].active() && Main.tileRope[(int) Main.tile[index5, num14 + 1].type]) - flag16 = true; - if (Main.tile[index5, index6] == null) - Main.tile[index5, index6] = new Tile(); - if (!Main.tile[index5, index6].active() || !Main.tileRope[(int) Main.tile[index5, index6].type]) - { - flag15 = false; - if ((double) this.velocity.Y < 0.0) - this.velocity.Y = 0.0f; - } - if (flag16) - { - if (this.controlUp & flag15) - { - float x1 = this.position.X; - float y = (float) ((double) this.position.Y - (double) Math.Abs(this.velocity.Y) - 2.0); - if (Collision.SolidCollision(new Vector2(x1, y), this.width, this.height)) - { - float x2 = (float) (index5 * 16 + 8 - this.width / 2 + 6); - if (!Collision.SolidCollision(new Vector2(x2, y), this.width, (int) ((double) this.height + (double) Math.Abs(this.velocity.Y) + 2.0))) - { - if (i == Main.myPlayer) - Main.cameraX = Main.cameraX + this.position.X - x2; - this.pulleyDir = (byte) 2; - this.direction = 1; - this.position.X = x2; - this.velocity.X = 0.0f; - } - else - { - float x3 = (float) (index5 * 16 + 8 - this.width / 2 - 6); - if (!Collision.SolidCollision(new Vector2(x3, y), this.width, (int) ((double) this.height + (double) Math.Abs(this.velocity.Y) + 2.0))) - { - if (i == Main.myPlayer) - Main.cameraX = Main.cameraX + this.position.X - x3; - this.pulleyDir = (byte) 2; - this.direction = -1; - this.position.X = x3; - this.velocity.X = 0.0f; - } - } - } - if ((double) this.velocity.Y > 0.0) - this.velocity.Y *= 0.7f; - if ((double) this.velocity.Y > -3.0) - this.velocity.Y -= 0.2f; - else - this.velocity.Y -= 0.02f; - if ((double) this.velocity.Y < -8.0) - this.velocity.Y = -8f; - } - else if (this.controlDown) - { - float x4 = this.position.X; - float y = this.position.Y; - if (Collision.SolidCollision(new Vector2(x4, y), this.width, (int) ((double) this.height + (double) Math.Abs(this.velocity.Y) + 2.0))) - { - float x5 = (float) (index5 * 16 + 8 - this.width / 2 + 6); - if (!Collision.SolidCollision(new Vector2(x5, y), this.width, (int) ((double) this.height + (double) Math.Abs(this.velocity.Y) + 2.0))) - { - if (i == Main.myPlayer) - Main.cameraX = Main.cameraX + this.position.X - x5; - this.pulleyDir = (byte) 2; - this.direction = 1; - this.position.X = x5; - this.velocity.X = 0.0f; - } - else - { - float x6 = (float) (index5 * 16 + 8 - this.width / 2 - 6); - if (!Collision.SolidCollision(new Vector2(x6, y), this.width, (int) ((double) this.height + (double) Math.Abs(this.velocity.Y) + 2.0))) - { - if (i == Main.myPlayer) - Main.cameraX = Main.cameraX + this.position.X - x6; - this.pulleyDir = (byte) 2; - this.direction = -1; - this.position.X = x6; - this.velocity.X = 0.0f; - } - } - } - if ((double) this.velocity.Y < 0.0) - this.velocity.Y *= 0.7f; - if ((double) this.velocity.Y < 3.0) - this.velocity.Y += 0.2f; - else - this.velocity.Y += 0.1f; - if ((double) this.velocity.Y > (double) this.maxFallSpeed) - this.velocity.Y = this.maxFallSpeed; - } - else - { - this.velocity.Y *= 0.7f; - if ((double) this.velocity.Y > -0.1 && (double) this.velocity.Y < 0.1) - this.velocity.Y = 0.0f; - } - } - else if (this.controlDown) - { - this.ropeCount = 10; - this.pulley = false; - this.velocity.Y = 1f; - } - else - { - this.velocity.Y = 0.0f; - this.position.Y = (float) (index6 * 16 + 22); - } - float num15 = (float) (index5 * 16 + 8 - this.width / 2); - if (this.pulleyDir == (byte) 1) - num15 = (float) (index5 * 16 + 8 - this.width / 2); - if (this.pulleyDir == (byte) 2) - num15 = (float) (index5 * 16 + 8 - this.width / 2 + 6 * this.direction); - if (i == Main.myPlayer) - { - Main.cameraX += this.position.X - num15; - Main.cameraX = MathHelper.Clamp(Main.cameraX, -32f, 32f); - } - this.position.X = num15; - this.pulleyFrameCounter += Math.Abs(this.velocity.Y * 0.75f); - if ((double) this.velocity.Y != 0.0) - this.pulleyFrameCounter += 0.75f; - if ((double) this.pulleyFrameCounter > 10.0) - { - ++this.pulleyFrame; - this.pulleyFrameCounter = 0.0f; - } - if (this.pulleyFrame > 1) - this.pulleyFrame = 0; - this.canCarpet = true; - this.carpetFrame = -1; - this.wingTime = (float) this.wingTimeMax; - this.rocketTime = this.rocketTimeMax; - this.rocketDelay = 0; - this.rocketFrame = false; - this.canRocket = false; - this.rocketRelease = false; - this.DashMovement(); - this.UpdateControlHolds(); - } - else if (this.grappling[0] == -1 && !this.tongued) - { - if (this.wingsLogic > 0 && (double) this.velocity.Y != 0.0 && !this.merman && !this.mount.Active) - this.WingAirLogicTweaks(); - if (this.empressBrooch) - this.runAcceleration *= 2f; - if (this.mount.Active && this.mount.Type == 43 && (double) this.velocity.Y != 0.0) - this.runSlowdown = 0.0f; - if (this.sticky) - { - this.maxRunSpeed *= 0.25f; - this.runAcceleration *= 0.25f; - this.runSlowdown *= 2f; - if ((double) this.velocity.X > (double) this.maxRunSpeed) - this.velocity.X = this.maxRunSpeed; - if ((double) this.velocity.X < -(double) this.maxRunSpeed) - this.velocity.X = -this.maxRunSpeed; - } - else if (this.powerrun) - { - this.maxRunSpeed *= 3.5f; - this.runAcceleration *= 1f; - this.runSlowdown *= 2f; - } - else if (this.runningOnSand && this.desertDash) - { - float num16 = 1.75f; - this.maxRunSpeed *= num16; - this.accRunSpeed *= num16; - this.runAcceleration *= num16; - this.runSlowdown *= num16; - } - else if (this.slippy2) - { - this.runAcceleration *= 0.6f; - this.runSlowdown = 0.0f; - if (this.iceSkate) - { - this.runAcceleration *= 3.5f; - this.maxRunSpeed *= 1.25f; - } - } - else if (this.slippy) - { - this.runAcceleration *= 0.7f; - if (this.iceSkate) - { - this.runAcceleration *= 3.5f; - this.maxRunSpeed *= 1.25f; - } - else - this.runSlowdown *= 0.1f; - } - if (this.sandStorm) - { - this.runAcceleration *= 1.5f; - this.maxRunSpeed *= 2f; - } - if (this.isPerformingJump_Blizzard && this.hasJumpOption_Blizzard) - { - this.runAcceleration *= 3f; - this.maxRunSpeed *= 1.5f; - } - if (this.isPerformingJump_Fart && this.hasJumpOption_Fart) - { - this.runAcceleration *= 3f; - this.maxRunSpeed *= 1.75f; - } - if (this.isPerformingJump_Unicorn && this.hasJumpOption_Unicorn) - { - this.runAcceleration *= 3f; - this.maxRunSpeed *= 1.5f; - } - if (this.isPerformingJump_Santank && this.hasJumpOption_Santank) - { - this.runAcceleration *= 3f; - this.maxRunSpeed *= 1.5f; - } - if (this.isPerformingJump_WallOfFleshGoat && this.hasJumpOption_WallOfFleshGoat) - { - this.runAcceleration *= 3f; - this.maxRunSpeed *= 1.5f; - } - if (this.isPerformingJump_Basilisk && this.hasJumpOption_Basilisk) - { - this.runAcceleration *= 3f; - this.maxRunSpeed *= 1.5f; - } - if (this.isPerformingJump_Sail && this.hasJumpOption_Sail) - { - this.runAcceleration *= 1.5f; - this.maxRunSpeed *= 1.25f; - } - if (this.carpetFrame != -1) - { - this.runAcceleration *= 1.25f; - this.maxRunSpeed *= 1.5f; - } - if (this.inventory[this.selectedItem].type == 3106 && (double) this.stealth < 1.0) - { - this.maxRunSpeed -= (float) ((double) this.maxRunSpeed / 2.0 * (1.0 - (double) this.stealth)); - this.accRunSpeed = this.maxRunSpeed; - } - if (this.mount.Active) - { - this.rocketBoots = 0; - this.wings = 0; - this.wingsLogic = 0; - this.maxRunSpeed = this.mount.RunSpeed; - this.accRunSpeed = this.mount.DashSpeed; - this.runAcceleration = this.mount.Acceleration; - if (this.mount.Type == 12 && !this.MountFishronSpecial) - { - this.runAcceleration /= 2f; - this.maxRunSpeed /= 2f; - } - this.mount.AbilityRecovery(); - if (this.mount.Cart && (double) this.velocity.Y == 0.0) - { - if (!Minecart.OnTrack(this.position, this.width, this.height)) - { - this.fullRotation = 0.0f; - this.onWrongGround = true; - this.runSlowdown = 0.2f; - if (this.controlLeft && this.releaseLeft || this.controlRight && this.releaseRight) - this.mount.Dismount(this); - } - else - { - this.runSlowdown = this.runAcceleration; - this.onWrongGround = false; - } - } - if (this.mount.Type == 8) - this.mount.UpdateDrill(this, this.controlUp, this.controlDown); - } - this.HorizontalMovement(); - if (this.gravControl) - { - if (this.controlUp && this.releaseUp) - { - if ((double) this.gravDir == 1.0) - { - this.gravDir = -1f; - this.fallStart = (int) ((double) this.position.Y / 16.0); - this.jump = 0; - SoundEngine.PlaySound(SoundID.Item8, this.position); - } - else - { - this.gravDir = 1f; - this.fallStart = (int) ((double) this.position.Y / 16.0); - this.jump = 0; - SoundEngine.PlaySound(SoundID.Item8, this.position); - } - } - } - else if (this.gravControl2) - { - if (this.controlUp && this.releaseUp) - { - if ((double) this.gravDir == 1.0) - { - this.gravDir = -1f; - this.fallStart = (int) ((double) this.position.Y / 16.0); - this.jump = 0; - SoundEngine.PlaySound(SoundID.Item8, this.position); - } - else - { - this.gravDir = 1f; - this.fallStart = (int) ((double) this.position.Y / 16.0); - this.jump = 0; - SoundEngine.PlaySound(SoundID.Item8, this.position); - } - } - } - else - this.gravDir = 1f; - if ((double) this.velocity.Y == 0.0 && this.mount.Active && this.mount.CanHover() && this.controlUp && this.releaseUp) - this.velocity.Y = (float) -((double) this.mount.Acceleration + (double) this.gravity + 1.0 / 1000.0); - this.UpdateControlHolds(); - this.sandStorm = false; - this.JumpMovement(); - if (this.wingsLogic == 0) - this.wingTime = 0.0f; - if (this.rocketBoots == 0) - this.rocketTime = 0; - if (this.jump == 0) - this.CancelAllJumpVisualEffects(); - this.DashMovement(); - this.WallslideMovement(); - this.CarpetMovement(); - this.DoubleJumpVisuals(); - if (this.wingsLogic > 0 || this.mount.Active) - this.sandStorm = false; - if (((double) this.gravDir == 1.0 && (double) this.velocity.Y > -(double) Player.jumpSpeed || (double) this.gravDir == -1.0 && (double) this.velocity.Y < (double) Player.jumpSpeed) && (double) this.velocity.Y != 0.0) - this.canRocket = true; - bool wingFlap = false; - if (((double) this.velocity.Y == 0.0 || this.sliding) && this.releaseJump || this.autoJump && this.justJumped) - { - this.mount.ResetFlightTime(this.velocity.X); - this.wingTime = (float) this.wingTimeMax; - } - if (this.wingsLogic > 0 && this.controlJump && (double) this.wingTime > 0.0 && this.jump == 0 && (double) this.velocity.Y != 0.0) - wingFlap = true; - if ((this.wingsLogic == 22 || this.wingsLogic == 28 || this.wingsLogic == 30 || this.wingsLogic == 32 || this.wingsLogic == 29 || this.wingsLogic == 33 || this.wingsLogic == 35 || this.wingsLogic == 37 || this.wingsLogic == 45) && this.controlJump && this.TryingToHoverDown && (double) this.wingTime > 0.0) - wingFlap = true; - if (this.frozen || this.webbed || this.stoned) - { - if (this.mount.Active) - this.mount.Dismount(this); - this.velocity.Y += this.gravity; - if ((double) this.velocity.Y > (double) this.maxFallSpeed) - this.velocity.Y = this.maxFallSpeed; - this.sandStorm = false; - this.CancelAllJumpVisualEffects(); - } - else - { - if (wingFlap) - { - this.WingAirVisuals(); - this.WingMovement(); - } - this.WingFrame(wingFlap); - if (this.wingsLogic > 0 && this.rocketBoots != 0 && (double) this.velocity.Y != 0.0 && this.rocketTime != 0) - { - int num17 = this.rocketTime * 6; - this.wingTime += (float) num17; - if ((double) this.wingTime > (double) (this.wingTimeMax + num17)) - this.wingTime = (float) (this.wingTimeMax + num17); - this.rocketTime = 0; - } - if (wingFlap && this.wings != 4 && this.wings != 22 && this.wings != 0 && this.wings != 24 && this.wings != 28 && this.wings != 30 && this.wings != 33 && this.wings != 45) - { - bool flag17 = this.wingFrame == 3; - if (this.wings == 43 || this.wings == 44) - flag17 = this.wingFrame == 4; - if (flag17) - { - if (!this.flapSound) - SoundEngine.PlaySound(SoundID.Item32, this.position); - this.flapSound = true; - } - else - this.flapSound = false; - } - if ((double) this.velocity.Y == 0.0 || this.sliding || this.autoJump && this.justJumped) - this.rocketTime = this.rocketTimeMax; - if (this.empressBrooch) - this.rocketTime = this.rocketTimeMax; - if (((double) this.wingTime == 0.0 || this.wingsLogic == 0) && this.rocketBoots != 0 && this.controlJump && this.rocketDelay == 0 && this.canRocket && this.rocketRelease && !this.canJumpAgain_Cloud) - { - if (this.rocketTime > 0) - { - --this.rocketTime; - this.rocketDelay = 10; - if (this.rocketDelay2 <= 0) - { - if (this.rocketBoots == 1) - { - SoundEngine.PlaySound(SoundID.Item13, this.position); - this.rocketDelay2 = 30; - } - else if (this.rocketBoots == 2 || this.rocketBoots == 3 || this.rocketBoots == 4) - { - SoundEngine.PlaySound(SoundID.Item24, this.position); - this.rocketDelay2 = 15; - } - } - } - else - this.canRocket = false; - } - if (this.rocketDelay2 > 0) - --this.rocketDelay2; - if (this.rocketDelay == 0) - this.rocketFrame = false; - if (this.rocketDelay > 0) - { - this.rocketFrame = true; - this.RocketBootVisuals(); - if (this.rocketDelay == 0) - this.releaseJump = true; - --this.rocketDelay; - this.velocity.Y -= 0.1f * this.gravDir; - if ((double) this.gravDir == 1.0) - { - if ((double) this.velocity.Y > 0.0) - this.velocity.Y -= 0.5f; - else if ((double) this.velocity.Y > -(double) Player.jumpSpeed * 0.5) - this.velocity.Y -= 0.1f; - if ((double) this.velocity.Y < -(double) Player.jumpSpeed * 1.5) - this.velocity.Y = (float) (-(double) Player.jumpSpeed * 1.5); - } - else - { - if ((double) this.velocity.Y < 0.0) - this.velocity.Y += 0.5f; - else if ((double) this.velocity.Y < (double) Player.jumpSpeed * 0.5) - this.velocity.Y += 0.1f; - if ((double) this.velocity.Y > (double) Player.jumpSpeed * 1.5) - this.velocity.Y = Player.jumpSpeed * 1.5f; - } - } - else if (!wingFlap) - { - if (this.mount.CanHover()) - this.mount.Hover(this); - else if (this.mount.CanFly() && this.controlJump && this.jump == 0) - { - if (this.mount.Flight()) - { - if (this.TryingToHoverDown) - { - this.velocity.Y *= 0.9f; - if ((double) this.velocity.Y > -1.0 && (double) this.velocity.Y < 0.5) - this.velocity.Y = 1E-05f; - } - else - { - float jumpSpeed = Player.jumpSpeed; - if (this.mount.Type == 50) - jumpSpeed *= 0.5f; - if ((double) this.velocity.Y > 0.0) - this.velocity.Y -= 0.5f; - else if ((double) this.velocity.Y > -(double) jumpSpeed * 1.5) - this.velocity.Y -= 0.1f; - if ((double) this.velocity.Y < -(double) jumpSpeed * 1.5) - this.velocity.Y = (float) (-(double) jumpSpeed * 1.5); - } - } - else - { - this.velocity.Y += this.gravity / 3f * this.gravDir; - if ((double) this.gravDir == 1.0) - { - if ((double) this.velocity.Y > (double) this.maxFallSpeed / 3.0 && !this.TryingToHoverDown) - this.velocity.Y = this.maxFallSpeed / 3f; - } - else if ((double) this.velocity.Y < -(double) this.maxFallSpeed / 3.0 && !this.TryingToHoverUp) - this.velocity.Y = (float) (-(double) this.maxFallSpeed / 3.0); - } - } - else if (this.slowFall && !this.TryingToHoverDown) - { - this.gravity = !this.TryingToHoverUp ? this.gravity / 3f * this.gravDir : this.gravity / 10f * this.gravDir; - this.velocity.Y += this.gravity; - } - else if (this.wingsLogic > 0 && this.controlJump && (double) this.velocity.Y > 0.0) - { - bool flag18 = this.wingsLogic != this.wings; - this.fallStart = (int) ((double) this.position.Y / 16.0); - if ((double) this.velocity.Y > 0.0) - { - if (this.wings == 10 && Main.rand.Next(3) == 0) - { - int num18 = 4; - if (this.direction == 1) - num18 = -40; - int index = Dust.NewDust(new Vector2(this.position.X + (float) (this.width / 2) + (float) num18, (float) ((double) this.position.Y + (double) (this.height / 2) - 15.0)), 30, 30, 76, Alpha: 50, Scale: 0.6f); - Main.dust[index].fadeIn = 1.1f; - Main.dust[index].noGravity = true; - Main.dust[index].noLight = true; - Main.dust[index].velocity *= 0.3f; - Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - } - if (this.wings == 34 && this.ShouldDrawWingsThatAreAlwaysAnimated() && Main.rand.Next(3) == 0) - { - int num19 = 4; - if (this.direction == 1) - num19 = -40; - int index = Dust.NewDust(new Vector2(this.position.X + (float) (this.width / 2) + (float) num19, (float) ((double) this.position.Y + (double) (this.height / 2) - 15.0)), 30, 30, 261, Alpha: 50, Scale: 0.6f); - Main.dust[index].fadeIn = 1.1f; - Main.dust[index].noGravity = true; - Main.dust[index].noLight = true; - Main.dust[index].noLightEmittence = flag18; - Main.dust[index].velocity *= 0.3f; - Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - } - if (this.wings == 40) - this.ShouldDrawWingsThatAreAlwaysAnimated(); - if (this.wings == 44) - this.ShouldDrawWingsThatAreAlwaysAnimated(); - if (this.wings == 9 && Main.rand.Next(3) == 0) - { - int num20 = 8; - if (this.direction == 1) - num20 = -40; - int index = Dust.NewDust(new Vector2(this.position.X + (float) (this.width / 2) + (float) num20, (float) ((double) this.position.Y + (double) (this.height / 2) - 15.0)), 30, 30, 6, Alpha: 200, Scale: 2f); - Main.dust[index].noGravity = true; - Main.dust[index].velocity *= 0.3f; - Main.dust[index].noLightEmittence = flag18; - Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - } - if (this.wings == 29 && Main.rand.Next(3) == 0) - { - int num21 = 8; - if (this.direction == 1) - num21 = -40; - int index = Dust.NewDust(new Vector2(this.position.X + (float) (this.width / 2) + (float) num21, (float) ((double) this.position.Y + (double) (this.height / 2) - 15.0)), 30, 30, 6, Alpha: 100, Scale: 2.4f); - Main.dust[index].noGravity = true; - Main.dust[index].velocity *= 0.3f; - Main.dust[index].noLightEmittence = flag18; - if (Main.rand.Next(10) == 0) - Main.dust[index].fadeIn = 2f; - Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - } - if (this.wings == 6) - { - if (Main.rand.Next(10) == 0) - { - int num22 = 4; - if (this.direction == 1) - num22 = -40; - int index = Dust.NewDust(new Vector2(this.position.X + (float) (this.width / 2) + (float) num22, (float) ((double) this.position.Y + (double) (this.height / 2) - 12.0)), 30, 20, 55, Alpha: 200); - Main.dust[index].noLightEmittence = flag18; - Main.dust[index].velocity *= 0.3f; - Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - } - } - else if (this.wings == 5 && Main.rand.Next(6) == 0) - { - int num23 = 6; - if (this.direction == 1) - num23 = -30; - int index = Dust.NewDust(new Vector2(this.position.X + (float) (this.width / 2) + (float) num23, this.position.Y), 18, this.height, 58, Alpha: ((int) byte.MaxValue), Scale: 1.2f); - Main.dust[index].velocity *= 0.3f; - Main.dust[index].noLightEmittence = flag18; - Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - } - if (this.wings == 4) - { - --this.rocketDelay2; - if (this.rocketDelay2 <= 0) - { - SoundEngine.PlaySound(SoundID.Item13, this.position); - this.rocketDelay2 = 60; - } - int Type = 6; - float Scale = 1.5f; - int Alpha = 100; - float x = (float) ((double) this.position.X + (double) (this.width / 2) + 16.0); - if (this.direction > 0) - x = (float) ((double) this.position.X + (double) (this.width / 2) - 26.0); - float y = (float) ((double) this.position.Y + (double) this.height - 18.0); - if (Main.rand.Next(2) == 1) - { - x = (float) ((double) this.position.X + (double) (this.width / 2) + 8.0); - if (this.direction > 0) - x = (float) ((double) this.position.X + (double) (this.width / 2) - 20.0); - y += 6f; - } - int index = Dust.NewDust(new Vector2(x, y), 8, 8, Type, Alpha: Alpha, Scale: Scale); - Main.dust[index].velocity.X *= 0.3f; - Main.dust[index].velocity.Y += 10f; - Main.dust[index].noGravity = true; - Main.dust[index].noLightEmittence = flag18; - Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - ++this.wingFrameCounter; - if (this.wingFrameCounter > 4) - { - ++this.wingFrame; - this.wingFrameCounter = 0; - if (this.wingFrame >= 3) - this.wingFrame = 0; - } - } - else if (this.wings != 22 && this.wings != 28) - { - if (this.wings == 30) - { - ++this.wingFrameCounter; - int num24 = 5; - if (this.wingFrameCounter >= num24 * 3) - this.wingFrameCounter = 0; - this.wingFrame = 1 + this.wingFrameCounter / num24; - } - else if (this.wings == 34) - { - ++this.wingFrameCounter; - int num25 = 7; - if (this.wingFrameCounter >= num25 * 6) - this.wingFrameCounter = 0; - this.wingFrame = this.wingFrameCounter / num25; - } - else if (this.wings != 45) - { - if (this.wings == 40) - this.wingFrame = 0; - else if (this.wings == 44) - this.wingFrame = 2; - else if (this.wings == 39) - { - ++this.wingFrameCounter; - int num26 = 12; - if (this.wingFrameCounter >= num26 * 6) - this.wingFrameCounter = 0; - this.wingFrame = this.wingFrameCounter / num26; - } - else if (this.wings == 26) - { - int num27 = 6; - if (this.direction == 1) - num27 = -30; - int index7 = Dust.NewDust(new Vector2(this.position.X + (float) (this.width / 2) + (float) num27, this.position.Y), 18, this.height, 217, Alpha: 100, Scale: 1.4f); - Main.dust[index7].noGravity = true; - Main.dust[index7].noLight = true; - Main.dust[index7].velocity /= 4f; - Main.dust[index7].velocity -= this.velocity; - Main.dust[index7].shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - if (Main.rand.Next(2) == 0) - { - int num28 = -24; - if (this.direction == 1) - num28 = 12; - float y = this.position.Y; - if ((double) this.gravDir == -1.0) - y += (float) (this.height / 2); - int index8 = Dust.NewDust(new Vector2(this.position.X + (float) (this.width / 2) + (float) num28, y), 12, this.height / 2, 217, Alpha: 100, Scale: 1.4f); - Main.dust[index8].noGravity = true; - Main.dust[index8].noLight = true; - Main.dust[index8].velocity /= 4f; - Main.dust[index8].velocity -= this.velocity; - Main.dust[index8].shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - } - this.wingFrame = 2; - } - else if (this.wings == 37) - { - Color color = Color.Lerp(Color.Black, Color.White, Main.rand.NextFloat()); - int num29 = 6; - if (this.direction == 1) - num29 = -30; - int index9 = Dust.NewDust(new Vector2(this.position.X + (float) (this.width / 2) + (float) num29, this.position.Y), 24, this.height, Utils.SelectRandom(Main.rand, 31, 31, 31), Alpha: 100, Scale: 0.7f); - Main.dust[index9].noGravity = true; - Main.dust[index9].noLight = true; - Main.dust[index9].velocity /= 4f; - Main.dust[index9].velocity -= this.velocity; - Main.dust[index9].shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - if (Main.dust[index9].type == 55) - Main.dust[index9].color = color; - if (Main.rand.Next(3) == 0) - { - int num30 = -24; - if (this.direction == 1) - num30 = 12; - float y = this.position.Y; - if ((double) this.gravDir == -1.0) - y += (float) (this.height / 2); - int index10 = Dust.NewDust(new Vector2(this.position.X + (float) (this.width / 2) + (float) num30, y), 12, this.height / 2, Utils.SelectRandom(Main.rand, 31, 31, 31), Alpha: 140, Scale: 0.7f); - Main.dust[index10].noGravity = true; - Main.dust[index10].noLight = true; - Main.dust[index10].velocity /= 4f; - Main.dust[index10].velocity -= this.velocity; - Main.dust[index10].shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - if (Main.dust[index10].type == 55) - Main.dust[index10].color = color; - } - this.wingFrame = 2; - } - else if (this.wings != 24) - this.wingFrame = this.wings != 43 ? (this.wings != 12 ? 2 : 3) : 1; - } - } - } - this.velocity.Y += this.gravity / 3f * this.gravDir; - if ((double) this.gravDir == 1.0) - { - if ((double) this.velocity.Y > (double) this.maxFallSpeed / 3.0 && !this.TryingToHoverDown) - this.velocity.Y = this.maxFallSpeed / 3f; - } - else if ((double) this.velocity.Y < -(double) this.maxFallSpeed / 3.0 && !this.TryingToHoverUp) - this.velocity.Y = (float) (-(double) this.maxFallSpeed / 3.0); - } - else if (this.cartRampTime <= 0) - this.velocity.Y += this.gravity * this.gravDir; - else - --this.cartRampTime; - } - if (!this.mount.Active || this.mount.Type != 5) - { - if ((double) this.gravDir == 1.0) - { - if ((double) this.velocity.Y > (double) this.maxFallSpeed) - this.velocity.Y = this.maxFallSpeed; - if (this.slowFall && (double) this.velocity.Y > (double) this.maxFallSpeed / 3.0 && !this.TryingToHoverDown) - this.velocity.Y = this.maxFallSpeed / 3f; - if (this.slowFall && (double) this.velocity.Y > (double) this.maxFallSpeed / 5.0 && this.TryingToHoverUp) - this.velocity.Y = this.maxFallSpeed / 10f; - } - else - { - if ((double) this.velocity.Y < -(double) this.maxFallSpeed) - this.velocity.Y = -this.maxFallSpeed; - if (this.slowFall && (double) this.velocity.Y < -(double) this.maxFallSpeed / 3.0 && !this.TryingToHoverDown) - this.velocity.Y = (float) (-(double) this.maxFallSpeed / 3.0); - if (this.slowFall && (double) this.velocity.Y < -(double) this.maxFallSpeed / 5.0 && this.TryingToHoverUp) - this.velocity.Y = (float) (-(double) this.maxFallSpeed / 10.0); - } - } - } - } - else - this.UpdateControlHolds(); - if (this.mount.Active) - this.wingFrame = 0; - if ((this.wingsLogic == 22 || this.wingsLogic == 28 || this.wingsLogic == 30 || this.wingsLogic == 31 || this.wingsLogic == 33 || this.wingsLogic == 35 || this.wingsLogic == 37 || this.wingsLogic == 45) && this.TryingToHoverDown && this.controlJump && (double) this.wingTime > 0.0 && !this.merman) - { - float num31 = 0.9f; - if (this.wingsLogic == 45) - num31 = 0.8f; - this.velocity.Y *= num31; - if ((double) this.velocity.Y > -2.0 && (double) this.velocity.Y < 1.0) - this.velocity.Y = 1E-05f; - } - if (this.wingsLogic == 37 && this.TryingToHoverDown && this.controlJump && (double) this.wingTime > 0.0 && !this.merman) - { - this.velocity.Y *= 0.92f; - if ((double) this.velocity.Y > -2.0 && (double) this.velocity.Y < 1.0) - this.velocity.Y = 1E-05f; - } - this.GrabItems(i); - this.LookForTileInteractions(); - if (this.tongued) - { - this.StopVanityActions(); - bool flag19 = false; - if (Main.wofNPCIndex >= 0) - { - float num32 = Main.npc[Main.wofNPCIndex].position.X + (float) (Main.npc[Main.wofNPCIndex].width / 2) + (float) (Main.npc[Main.wofNPCIndex].direction * 200); - double num33 = (double) Main.npc[Main.wofNPCIndex].position.Y + (double) (Main.npc[Main.wofNPCIndex].height / 2); - Vector2 center = this.Center; - float num34 = num32 - center.X; - double y = (double) center.Y; - float num35 = (float) (num33 - y); - float num36 = (float) Math.Sqrt((double) num34 * (double) num34 + (double) num35 * (double) num35); - float num37 = 11f; - float num38; - if ((double) num36 > (double) num37) - { - num38 = num37 / num36; - } - else - { - num38 = 1f; - flag19 = true; - } - float num39 = num34 * num38; - float num40 = num35 * num38; - this.velocity.X = num39; - this.velocity.Y = num40; - } - else - flag19 = true; - if (flag19 && Main.myPlayer == this.whoAmI) - { - for (int b = 0; b < 22; ++b) - { - if (this.buffType[b] == 38) - this.DelBuff(b); - } - } - } - if (Main.myPlayer == this.whoAmI) - { - this.WOFTongue(); - if (this.controlHook) - { - if (this.releaseHook) - this.QuickGrapple(); - this.releaseHook = false; - } - else - this.releaseHook = true; - if (this.talkNPC >= 0 && (!new Microsoft.Xna.Framework.Rectangle((int) ((double) this.position.X + (double) (this.width / 2) - (double) (Player.tileRangeX * 16)), (int) ((double) this.position.Y + (double) (this.height / 2) - (double) (Player.tileRangeY * 16)), Player.tileRangeX * 16 * 2, Player.tileRangeY * 16 * 2).Intersects(new Microsoft.Xna.Framework.Rectangle((int) Main.npc[this.talkNPC].position.X, (int) Main.npc[this.talkNPC].position.Y, Main.npc[this.talkNPC].width, Main.npc[this.talkNPC].height)) || this.chest != -1 || !Main.npc[this.talkNPC].active || this.tileEntityAnchor.InUse)) - { - if (this.chest == -1) - SoundEngine.PlaySound(11); - this.SetTalkNPC(-1); - Main.npcChatCornerItem = 0; - Main.npcChatText = ""; - } - if (this.sign >= 0) - { - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle((int) ((double) this.position.X + (double) (this.width / 2) - (double) (Player.tileRangeX * 16)), (int) ((double) this.position.Y + (double) (this.height / 2) - (double) (Player.tileRangeY * 16)), Player.tileRangeX * 16 * 2, Player.tileRangeY * 16 * 2); - try - { - bool flag20 = false; - if (Main.sign[this.sign] == null) - flag20 = true; - if (!flag20 && !new Microsoft.Xna.Framework.Rectangle(Main.sign[this.sign].x * 16, Main.sign[this.sign].y * 16, 32, 32).Intersects(rectangle)) - flag20 = true; - if (flag20) - { - SoundEngine.PlaySound(11); - this.sign = -1; - Main.editSign = false; - Main.npcChatText = ""; - } - } - catch - { - SoundEngine.PlaySound(11); - this.sign = -1; - Main.editSign = false; - Main.npcChatText = ""; - } - } - if (Main.editSign) - { - if (this.sign == -1) - Main.editSign = false; - else - Main.InputTextSign(); - } - else if (Main.editChest) - { - Main.InputTextChest(); - if (Main.player[Main.myPlayer].chest == -1) - Main.editChest = false; - } - if (this.mount.Active && this.mount.Cart && (double) Math.Abs(this.velocity.X) > 4.0) - { - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle((int) this.position.X, (int) this.position.Y, this.width, this.height); - for (int index = 0; index < 200; ++index) - { - if (Main.npc[index].active && !Main.npc[index].dontTakeDamage && !Main.npc[index].friendly && Main.npc[index].immune[i] == 0 && this.CanNPCBeHitByPlayerOrPlayerProjectile(Main.npc[index]) && rectangle.Intersects(new Microsoft.Xna.Framework.Rectangle((int) Main.npc[index].position.X, (int) Main.npc[index].position.Y, Main.npc[index].width, Main.npc[index].height))) - { - float num41 = (float) this.meleeCrit; - if ((double) num41 < (double) this.rangedCrit) - num41 = (float) this.rangedCrit; - if ((double) num41 < (double) this.magicCrit) - num41 = (float) this.magicCrit; - bool crit = false; - if ((double) Main.rand.Next(1, 101) <= (double) num41) - crit = true; - int damage; - float knockback; - this.GetMinecartDamage(Math.Abs(this.velocity.X) / this.maxRunSpeed, out damage, out knockback); - int direction = 1; - if ((double) this.velocity.X < 0.0) - direction = -1; - if (this.whoAmI == Main.myPlayer) - this.ApplyDamageToNPC(Main.npc[index], damage, knockback, direction, crit); - Main.npc[index].immune[i] = 30; - if (!Main.npc[index].active) - AchievementsHelper.HandleSpecialEvent(this, 9); - } - } - } - this.Update_NPCCollision(); - Vector2 vector2 = !this.mount.Active || !this.mount.Cart ? Collision.HurtTiles(this.position, this.velocity, this.width, this.height, this.fireWalk) : Collision.HurtTiles(this.position, this.velocity, this.width, this.height - 16, this.fireWalk); - if ((double) vector2.Y == 0.0 && !this.fireWalk) - { - foreach (Point touchedTile in this.TouchedTiles) - { - Tile tile = Main.tile[touchedTile.X, touchedTile.Y]; - if (tile != null && tile.active() && tile.nactive() && !this.fireWalk && TileID.Sets.TouchDamageHot[(int) tile.type] != 0) - { - vector2.Y = (float) TileID.Sets.TouchDamageHot[(int) tile.type]; - vector2.X = (double) this.Center.X / 16.0 < (double) touchedTile.X + 0.5 ? -1f : 1f; - break; - } - } - } - if ((double) vector2.Y == 20.0) - this.AddBuff(67, 20); - else if ((double) vector2.Y == 15.0) - { - if (this.suffocateDelay < (byte) 5) - ++this.suffocateDelay; - else - this.AddBuff(68, 1); - } - else if ((double) vector2.Y != 0.0) - { - int Damage = Main.DamageVar(vector2.Y, -this.luck); - this.Hurt(PlayerDeathReason.ByOther(3), Damage, 0, cooldownCounter: 0); - if ((double) vector2.Y == 60.0 || (double) vector2.Y == 80.0) - this.AddBuff(30, Main.rand.Next(240, 600)); - } - else - this.suffocateDelay = (byte) 0; - } - if (this.controlRight) - { - this.releaseRight = false; - } - else - { - this.releaseRight = true; - this.rightTimer = 7; - } - if (this.controlLeft) - { - this.releaseLeft = false; - } - else - { - this.releaseLeft = true; - this.leftTimer = 7; - } - this.releaseDown = !this.controlDown; - if (this.rightTimer > 0) - --this.rightTimer; - else if (this.controlRight) - this.rightTimer = 7; - if (this.leftTimer > 0) - --this.leftTimer; - else if (this.controlLeft) - this.leftTimer = 7; - this.GrappleMovement(); - this.StickyMovement(); - this.CheckDrowning(); - if ((double) this.gravDir == -1.0) - { - this.waterWalk = false; - this.waterWalk2 = false; - } - int height = this.height; - if (this.waterWalk) - height -= 6; - bool flag21 = Collision.LavaCollision(this.position, this.width, height); - if (flag21) - { - if (!this.lavaImmune && Main.myPlayer == i && !this.immune) - { - if (this.lavaTime > 0) - --this.lavaTime; - else if (this.lavaRose) - { - this.Hurt(PlayerDeathReason.ByOther(2), 50, 0); - this.AddBuff(24, 210); - } - else - { - this.Hurt(PlayerDeathReason.ByOther(2), 80, 0); - this.AddBuff(24, 420); - } - } - this.lavaWet = true; - } - else - { - this.lavaWet = false; - if (this.lavaTime < this.lavaMax) - ++this.lavaTime; - } - if (this.lavaTime > this.lavaMax) - this.lavaTime = this.lavaMax; - if (this.waterWalk2 && !this.waterWalk) - { - int num42 = height - 6; - } - int num43 = Collision.WetCollision(this.position, this.width, this.height) ? 1 : 0; - bool honey = Collision.honey; - if (honey) - { - this.AddBuff(48, 1800); - this.honeyWet = true; - } - if (num43 != 0) - { - if (this.onFire && !this.lavaWet) - { - for (int b = 0; b < 22; ++b) - { - if (this.buffType[b] == 24) - this.DelBuff(b); - } - } - if (!this.wet) - { - if (this.wetCount == (byte) 0) - { - this.wetCount = (byte) 10; - if (!flag21) - { - if (this.honeyWet) - { - for (int index11 = 0; index11 < 20; ++index11) - { - int index12 = Dust.NewDust(new Vector2(this.position.X - 6f, (float) ((double) this.position.Y + (double) (this.height / 2) - 8.0)), this.width + 12, 24, 152); - --Main.dust[index12].velocity.Y; - Main.dust[index12].velocity.X *= 2.5f; - Main.dust[index12].scale = 1.3f; - Main.dust[index12].alpha = 100; - Main.dust[index12].noGravity = true; - } - SoundEngine.PlaySound(19, (int) this.position.X, (int) this.position.Y); - } - else - { - for (int index13 = 0; index13 < 50; ++index13) - { - int index14 = Dust.NewDust(new Vector2(this.position.X - 6f, (float) ((double) this.position.Y + (double) (this.height / 2) - 8.0)), this.width + 12, 24, Dust.dustWater()); - Main.dust[index14].velocity.Y -= 3f; - Main.dust[index14].velocity.X *= 2.5f; - Main.dust[index14].scale = 0.8f; - Main.dust[index14].alpha = 100; - Main.dust[index14].noGravity = true; - } - SoundEngine.PlaySound(19, (int) this.position.X, (int) this.position.Y, 0); - } - } - else - { - for (int index15 = 0; index15 < 20; ++index15) - { - int index16 = Dust.NewDust(new Vector2(this.position.X - 6f, (float) ((double) this.position.Y + (double) (this.height / 2) - 8.0)), this.width + 12, 24, 35); - Main.dust[index16].velocity.Y -= 1.5f; - Main.dust[index16].velocity.X *= 2.5f; - Main.dust[index16].scale = 1.3f; - Main.dust[index16].alpha = 100; - Main.dust[index16].noGravity = true; - } - SoundEngine.PlaySound(19, (int) this.position.X, (int) this.position.Y); - } - } - this.wet = true; - if (this.ShouldFloatInWater) - { - this.velocity.Y /= 2f; - if ((double) this.velocity.Y > 3.0) - this.velocity.Y = 3f; - } - } - } - else if (this.wet) - { - this.wet = false; - if (this.jump > Player.jumpHeight / 5 && this.wetSlime == (byte) 0) - this.jump = Player.jumpHeight / 5; - if (this.wetCount == (byte) 0) - { - this.wetCount = (byte) 10; - if (!this.lavaWet) - { - if (this.honeyWet) - { - for (int index17 = 0; index17 < 20; ++index17) - { - int index18 = Dust.NewDust(new Vector2(this.position.X - 6f, (float) ((double) this.position.Y + (double) (this.height / 2) - 8.0)), this.width + 12, 24, 152); - --Main.dust[index18].velocity.Y; - Main.dust[index18].velocity.X *= 2.5f; - Main.dust[index18].scale = 1.3f; - Main.dust[index18].alpha = 100; - Main.dust[index18].noGravity = true; - } - SoundEngine.PlaySound(19, (int) this.position.X, (int) this.position.Y); - } - else - { - for (int index19 = 0; index19 < 50; ++index19) - { - int index20 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float) (this.height / 2)), this.width + 12, 24, Dust.dustWater()); - Main.dust[index20].velocity.Y -= 4f; - Main.dust[index20].velocity.X *= 2.5f; - Main.dust[index20].scale = 0.8f; - Main.dust[index20].alpha = 100; - Main.dust[index20].noGravity = true; - } - SoundEngine.PlaySound(19, (int) this.position.X, (int) this.position.Y, 0); - } - } - else - { - for (int index21 = 0; index21 < 20; ++index21) - { - int index22 = Dust.NewDust(new Vector2(this.position.X - 6f, (float) ((double) this.position.Y + (double) (this.height / 2) - 8.0)), this.width + 12, 24, 35); - Main.dust[index22].velocity.Y -= 1.5f; - Main.dust[index22].velocity.X *= 2.5f; - Main.dust[index22].scale = 1.3f; - Main.dust[index22].alpha = 100; - Main.dust[index22].noGravity = true; - } - SoundEngine.PlaySound(19, (int) this.position.X, (int) this.position.Y); - } - } - } - if (!honey) - this.honeyWet = false; - if (!this.wet) - { - this.lavaWet = false; - this.honeyWet = false; - } - if (this.wetCount > (byte) 0) - --this.wetCount; - if (this.wetSlime > (byte) 0) - --this.wetSlime; - if (this.wet && this.mount.Active) - { - switch (this.mount.Type) - { - case 3: - case 50: - this.wetSlime = (byte) 30; - if ((double) this.velocity.Y > 2.0) - this.velocity.Y *= 0.9f; - this.velocity.Y -= 0.5f; - if ((double) this.velocity.Y < -4.0) - { - this.velocity.Y = -4f; - break; - } - break; - case 5: - case 7: - if (this.whoAmI == Main.myPlayer) - { - this.mount.Dismount(this); - break; - } - break; - } - } - if (Main.expertMode && this.ZoneSnow && this.wet && !this.lavaWet && !this.honeyWet && !this.arcticDivingGear) - this.AddBuff(46, 150); - float num44 = (float) (1.0 + (double) Math.Abs(this.velocity.X) / 3.0); - if ((double) this.gfxOffY > 0.0) - { - this.gfxOffY -= num44 * this.stepSpeed; - if ((double) this.gfxOffY < 0.0) - this.gfxOffY = 0.0f; - } - else if ((double) this.gfxOffY < 0.0) - { - this.gfxOffY += num44 * this.stepSpeed; - if ((double) this.gfxOffY > 0.0) - this.gfxOffY = 0.0f; - } - if ((double) this.gfxOffY > 32.0) - this.gfxOffY = 32f; - if ((double) this.gfxOffY < -32.0) - this.gfxOffY = -32f; - if (Main.myPlayer == i) - { - if (!this.iceSkate) - this.CheckIceBreak(); - this.CheckCrackedBrickBreak(); - } - this.SlopeDownMovement(); - bool flag22 = this.mount.Type == 7 || this.mount.Type == 8 || this.mount.Type == 12 || this.mount.Type == 44 || this.mount.Type == 48 || this.mount.Type == 49; - if ((double) this.velocity.Y == (double) this.gravity && (!this.mount.Active || !this.mount.Cart && !flag22)) - Collision.StepDown(ref this.position, ref this.velocity, this.width, this.height, ref this.stepSpeed, ref this.gfxOffY, (int) this.gravDir, this.waterWalk || this.waterWalk2); - if ((double) this.gravDir == -1.0) - { - if ((this.carpetFrame != -1 || (double) this.velocity.Y <= (double) this.gravity) && !this.controlUp) - Collision.StepUp(ref this.position, ref this.velocity, this.width, this.height, ref this.stepSpeed, ref this.gfxOffY, (int) this.gravDir, this.controlUp); - } - else if ((this.carpetFrame != -1 || (double) this.velocity.Y >= (double) this.gravity) && !this.controlDown && !this.mount.Cart && !flag22 && this.grappling[0] == -1) - Collision.StepUp(ref this.position, ref this.velocity, this.width, this.height, ref this.stepSpeed, ref this.gfxOffY, (int) this.gravDir, this.controlUp); - this.oldPosition = this.position; - this.oldDirection = this.direction; - bool Falling = false; - if ((double) this.velocity.Y > (double) this.gravity) - Falling = true; - if ((double) this.velocity.Y < -(double) this.gravity) - Falling = true; - Vector2 velocity1 = this.velocity; - this.slideDir = 0; - bool ignorePlats = false; - bool fallThrough = this.controlDown; - if ((((double) this.gravDir == -1.0 ? 1 : 0) | (!this.mount.Active ? 0 : (this.mount.Cart || this.mount.Type == 12 || this.mount.Type == 7 || this.mount.Type == 8 || this.mount.Type == 23 || this.mount.Type == 44 ? 1 : (this.mount.Type == 48 ? 1 : 0))) | (this.GoingDownWithGrapple ? 1 : 0)) != 0) - { - ignorePlats = true; - fallThrough = true; - } - this.onTrack = false; - bool flag23 = false; - if (this.mount.Active && this.mount.Cart) - { - float num45 = this.ignoreWater || this.merman ? 1f : (!this.honeyWet ? (!this.wet ? 1f : 0.5f) : 0.25f); - this.velocity = this.velocity * num45; - DelegateMethods.Minecart.rotation = this.fullRotation; - DelegateMethods.Minecart.rotationOrigin = this.fullRotationOrigin; - BitsByte bitsByte = Minecart.TrackCollision(ref this.position, ref this.velocity, ref this.lastBoost, this.width, this.height, this.controlDown, this.controlUp, this.fallStart2, false, this.mount.Delegations); - if (bitsByte[0]) - { - this.onTrack = true; - this.gfxOffY = Minecart.TrackRotation(ref this.fullRotation, this.position + this.velocity, this.width, this.height, this.controlDown, this.controlUp, this.mount.Delegations); - this.fullRotationOrigin = new Vector2((float) (this.width / 2), (float) this.height); - } - if (bitsByte[1]) - { - if (this.controlLeft || this.controlRight) - this.cartFlip = !this.cartFlip; - if ((double) this.velocity.X > 0.0) - this.direction = 1; - else if ((double) this.velocity.X < 0.0) - this.direction = -1; - this.mount.Delegations.MinecartBumperSound(this.position, this.width, this.height); - } - this.velocity = this.velocity / num45; - if (bitsByte[3] && this.whoAmI == Main.myPlayer) - flag23 = true; - if (bitsByte[2]) - this.cartRampTime = (int) ((double) Math.Abs(this.velocity.X) / (double) this.mount.RunSpeed * 20.0); - if (bitsByte[4]) - this.trackBoost -= 4f; - if (bitsByte[5]) - this.trackBoost += 4f; - } - bool flag24 = this.whoAmI == Main.myPlayer && !this.mount.Active; - Vector2 position = this.position; - if (this.vortexDebuff) - this.velocity.Y = (float) ((double) this.velocity.Y * 0.800000011920929 + Math.Cos((double) this.Center.X % 120.0 / 120.0 * 6.28318548202515) * 5.0 * 0.200000002980232); - if (this.tongued) - { - this.position = this.position + this.velocity; - flag24 = false; - } - else if (this.honeyWet && !this.ignoreWater) - this.HoneyCollision(fallThrough, ignorePlats); - else if (this.wet && !this.merman && !this.ignoreWater && !this.trident) - { - this.WaterCollision(fallThrough, ignorePlats); - } - else - { - this.DryCollision(fallThrough, ignorePlats); - if (this.mount.Active && this.mount.IsConsideredASlimeMount && (double) this.velocity.Y != 0.0 && !this.SlimeDontHyperJump) - { - Vector2 velocity2 = this.velocity; - this.velocity.X = 0.0f; - this.DryCollision(fallThrough, ignorePlats); - this.velocity.X = velocity2.X; - } - if (this.mount.Active && this.mount.Type == 43 && (double) this.velocity.Y != 0.0) - { - Vector2 velocity3 = this.velocity; - this.velocity.X = 0.0f; - this.DryCollision(fallThrough, ignorePlats); - this.velocity.X = velocity3.X; - } - } - this.UpdateTouchingTiles(); - this.TryBouncingBlocks(Falling); - this.TryLandingOnDetonator(); - if (!this.tongued) - { - this.SlopingCollision(fallThrough, ignorePlats); - if (!this.isLockedToATile) - Collision.StepConveyorBelt((Entity) this, this.gravDir); - } - if (flag24 && (double) this.velocity.Y == 0.0) - AchievementsHelper.HandleRunning(Math.Abs(this.position.X - position.X)); - if (flag23) - { - NetMessage.SendData(13, number: this.whoAmI); - Minecart.HitTrackSwitch(new Vector2(this.position.X, this.position.Y), this.width, this.height); - } - if ((double) velocity1.X != (double) this.velocity.X) - { - if ((double) velocity1.X < 0.0) - this.slideDir = -1; - else if ((double) velocity1.X > 0.0) - this.slideDir = 1; - } - if ((double) this.gravDir == 1.0 && Collision.up) - { - this.velocity.Y = 0.01f; - if (!this.merman) - this.jump = 0; - } - else if ((double) this.gravDir == -1.0 && Collision.down) - { - this.velocity.Y = -0.01f; - if (!this.merman) - this.jump = 0; - } - if ((double) this.velocity.Y == 0.0 && this.grappling[0] == -1) - this.FloorVisuals(Falling); - if (this.whoAmI == Main.myPlayer) - Collision.SwitchTiles(this.position, this.width, this.height, this.oldPosition, 1); - PressurePlateHelper.UpdatePlayerPosition(this); - this.BordersMovement(); - this.numMinions = 0; - this.slotsMinions = 0.0f; - if (this.mount.Type != 8) - this.ItemCheck_ManageRightClickFeatures(); - this.ItemCheckWrapped(i); - this.PlayerFrame(); - if (this.mount.Type == 8) - this.mount.UseDrill(this); - if (this.statLife > this.statLifeMax2) - this.statLife = this.statLifeMax2; - if (this.statMana > this.statManaMax2) - this.statMana = this.statManaMax2; - this.grappling[0] = -1; - this.grapCount = 0; - this.UpdateReleaseUseTile(); - this.UpdateAdvancedShadows(); - } + // ISSUE: unable to decompile the method. } - private void UpdateControlHolds() - { - if (this.controlUp) - this.releaseUp = false; - else - this.releaseUp = true; - } - - public void TryOpeningFullscreenMap() - { - if (!Main.mapEnabled) - return; - Main.playerInventory = false; - this.sign = -1; - Main.editSign = false; - this.SetTalkNPC(-1); - Main.npcChatCornerItem = 0; - SoundEngine.PlaySound(10); - Main.mapFullscreenScale = 2.5f; - Main.mapFullscreen = true; - Main.resetMapFull = true; - Main.buffString = string.Empty; - } - - public void UpdateLuckFactors() - { - this.UpdateLadyBugLuckTime(); - if (this.whoAmI != Main.myPlayer) - return; - float torchLuck = this.torchLuck; - this.TryRecalculatingTorchLuck(); - if ((double) this.torchLuck == (double) torchLuck) - return; - this.luckNeedsSync = true; - } - - public void RecalculateLuck() - { - this.luck = (float) ((double) this.GetLadyBugLuck() * 0.200000002980232 + (double) this.torchLuck * 0.200000002980232); - this.luck += (float) this.luckPotion * 0.1f; - if (LanternNight.LanternsUp) - this.luck += 0.3f; - if (!this.HasGardenGnomeNearby) - return; - this.luck += 0.2f; - } - - private static int GetMouseScrollDelta() => PlayerInput.ScrollWheelDelta / 120; - - private void UpdatePortableStoolUsage() - { - bool flag = this.portableStoolInfo.HasAStool && this.controlUp && !this.gravControl && !this.mount.Active && (double) this.velocity.X == 0.0 && (double) this.velocity.Y == 0.0 && !this.pulley && this.grappling[0] == -1; - if (flag) - flag = this.CanFitSpace(this.portableStoolInfo.HeightBoost); - if (!flag) - return; - this.portableStoolInfo.IsInUse = true; - this.ResizeHitbox(); - } - - private void ResizeHitbox() - { - this.position.Y += (float) this.height; - this.height = 42 + this.HeightOffsetBoost; - this.position.Y -= (float) this.height; - } - - private void UpdateReleaseUseTile() - { - bool flag = !this.tileInteractAttempted; - if (this._lockTileInteractionsTimer > 0 && !this.releaseUseTile) - flag = false; - this.releaseUseTile = flag; - if (this._lockTileInteractionsTimer <= 0) - return; - --this._lockTileInteractionsTimer; - } - - private void GetMinecartDamage(float currentSpeed, out int damage, out float knockback) - { - switch (this.mount.Type) - { - case 11: - damage = Main.DamageVar((float) (50.0 + 100.0 * (double) currentSpeed), this.luck); - break; - case 13: - damage = Main.DamageVar((float) (15.0 + 30.0 * (double) currentSpeed), this.luck); - break; - case 15: - case 16: - case 18: - case 19: - case 20: - case 21: - case 22: - case 24: - case 25: - case 26: - case 27: - case 28: - case 29: - case 30: - case 31: - case 32: - case 33: - case 34: - case 35: - case 36: - case 38: - case 39: - damage = Main.DamageVar((float) (25.0 + 55.0 * (double) currentSpeed), this.luck); - break; - default: - damage = Main.DamageVar((float) (25.0 + 55.0 * (double) currentSpeed), this.luck); - break; - } - knockback = (float) (5.0 + 25.0 * (double) currentSpeed); - } - - public void UpdateMiscCounter() - { - ++this.miscCounter; - if (this.miscCounter < 300) - return; - this.miscCounter = 0; - } - - private void WingAirLogicTweaks() - { - if (this.wingsLogic < 1) - return; - WingStats wingStats = this.GetWingStats(this.wingsLogic); - bool flag = this.TryingToHoverDown && this.controlJump && (double) this.wingTime > 0.0; - if (wingStats.HasDownHoverStats & flag) - { - if ((double) wingStats.DownHoverSpeedOverride != -1.0) - this.accRunSpeed = wingStats.DownHoverSpeedOverride; - this.runAcceleration *= wingStats.DownHoverAccelerationMult; - } - else - { - if ((double) wingStats.AccRunSpeedOverride != -1.0 && (double) wingStats.AccRunSpeedOverride > (double) this.accRunSpeed) - this.accRunSpeed = wingStats.AccRunSpeedOverride; - this.runAcceleration *= wingStats.AccRunAccelerationMult; - } - if (this.wingsLogic != 45) - return; - this.runSlowdown *= 6f; - } - - private void RocketBootVisuals() - { - int num1 = this.height; - if ((double) this.gravDir == -1.0) - num1 = 4; - for (int index = 0; index < 2; ++index) - { - int num2 = index == 0 ? 2 : -2; - Microsoft.Xna.Framework.Rectangle r = index != 0 ? new Microsoft.Xna.Framework.Rectangle((int) this.position.X + this.width - 4, (int) this.position.Y + num1 - 10, 8, 8) : new Microsoft.Xna.Framework.Rectangle((int) this.position.X - 4, (int) this.position.Y + num1 - 10, 8, 8); - if (this.direction == -1) - r.X -= 4; - int Type = 6; - float Scale = 2.5f; - int Alpha = 100; - float num3 = 1f; - Vector2 vector2 = new Vector2((float) -num2 - this.velocity.X * 0.3f, (float) (2.0 * (double) this.gravDir - (double) this.velocity.Y * 0.300000011920929)); - switch (this.rocketBoots) - { - case 1: - if (this.socialShadowRocketBoots) - { - Type = 27; - Scale = 1.5f; - goto default; - } - else - goto default; - case 2: - if (this.fairyBoots) - { - Type = (int) Main.rand.NextFromList((short) 61, (short) 61, (short) 61, (short) 242, (short) 64, (short) 63); - Scale = 2f; - Alpha = 120; - goto default; - } - else - { - Type = 16; - Scale = 1.5f; - Alpha = 20; - goto default; - } - case 3: - Type = 76; - Scale = 1f; - Alpha = 20; - goto default; - case 4: - int num4 = Main.rand.Next(6); - r.Y += 2 * (int) this.gravDir; - if (num4 == 0 || num4 == 1) - { - Dust dust = Dust.NewDustDirect(r.TopLeft(), r.Width, r.Height, 278, Alpha: 100, newColor: Color.Lerp(Color.LimeGreen, Color.White, Main.rand.NextFloat() * 0.3f)); - dust.shader = GameShaders.Armor.GetSecondaryShader(this.cShoe, this); - dust.scale = 0.66f; - dust.noGravity = true; - dust.velocity *= 0.25f; - dust.velocity -= this.velocity * 0.5f; - dust.velocity += vector2 * 0.5f; - dust.position += dust.velocity * 4f; - if (Main.rand.Next(5) == 0) - { - dust.fadeIn = 0.8f; - break; - } - break; - } - Type = 107; - Alpha = 100; - Scale = 0.7f; - num3 = 0.5f; - goto default; - default: - Dust dust1 = Dust.NewDustDirect(r.TopLeft(), r.Width, r.Height, Type, Alpha: Alpha, Scale: Scale); - dust1.shader = GameShaders.Armor.GetSecondaryShader(this.cShoe, this); - dust1.velocity += vector2; - dust1.velocity *= num3; - switch (this.rocketBoots) - { - case 1: - dust1.noGravity = true; - break; - case 2: - dust1.velocity *= 0.1f; - break; - case 3: - dust1.velocity *= 0.05f; - dust1.velocity.Y += 0.15f; - dust1.noLight = true; - if (Main.rand.Next(2) == 0) - { - dust1.noGravity = true; - dust1.scale = 1.75f; - break; - } - break; - } - if (this.fairyBoots) - { - dust1.noGravity = true; - dust1.noLightEmittence = true; - break; - } - break; - } - } - } - - public void WingFrame(bool wingFlap) - { - bool flag1 = this.wingsLogic != this.wings; - if (this.wings == 4) - { - if (wingFlap || this.jump > 0) - { - --this.rocketDelay2; - if (this.rocketDelay2 <= 0) - { - SoundEngine.PlaySound(SoundID.Item13, this.position); - this.rocketDelay2 = 60; - } - int num = 2; - if (this.TryingToHoverUp) - num = 4; - for (int index1 = 0; index1 < num; ++index1) - { - int Type = 6; - if (this.head == 41) - { - int body = this.body; - } - float Scale = 1.75f; - int Alpha = 100; - float x = (float) ((double) this.position.X + (double) (this.width / 2) + 16.0); - if (this.direction > 0) - x = (float) ((double) this.position.X + (double) (this.width / 2) - 26.0); - float y = (float) ((double) this.position.Y + (double) this.height - 18.0); - if (index1 == 1 || index1 == 3) - { - x = (float) ((double) this.position.X + (double) (this.width / 2) + 8.0); - if (this.direction > 0) - x = (float) ((double) this.position.X + (double) (this.width / 2) - 20.0); - y += 6f; - } - if (index1 > 1) - y += this.velocity.Y; - int index2 = Dust.NewDust(new Vector2(x, y), 8, 8, Type, Alpha: Alpha, Scale: Scale); - Main.dust[index2].velocity.X *= 0.1f; - Main.dust[index2].velocity.Y = (float) ((double) Main.dust[index2].velocity.Y * 1.0 + 2.0 * (double) this.gravDir - (double) this.velocity.Y * 0.300000011920929); - Main.dust[index2].noGravity = true; - Main.dust[index2].noLightEmittence = flag1; - Main.dust[index2].shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - if (num == 4) - Main.dust[index2].velocity.Y += 6f; - } - ++this.wingFrameCounter; - if (this.wingFrameCounter <= 4) - return; - ++this.wingFrame; - this.wingFrameCounter = 0; - if (this.wingFrame < 3) - return; - this.wingFrame = 0; - } - else - { - if (this.controlJump && (double) this.velocity.Y != 0.0) - return; - this.wingFrame = 3; - } - } - else if (this.wings == 28 && this.ShouldDrawWingsThatAreAlwaysAnimated()) - { - if (flag1 || (double) this.velocity.Y == 0.0) - return; - Lighting.AddLight(this.Bottom, 0.3f, 0.1f, 0.4f); - } - else if (this.wings == 22) - { - if (!this.controlJump) - { - this.wingFrame = 0; - this.wingFrameCounter = 0; - } - else if ((double) this.wingTime > 0.0) - { - if (this.TryingToHoverDown) - { - if ((double) this.velocity.X != 0.0) - { - ++this.wingFrameCounter; - int num = 2; - if (this.wingFrameCounter < num) - this.wingFrame = 1; - else if (this.wingFrameCounter < num * 2) - this.wingFrame = 2; - else if (this.wingFrameCounter < num * 3) - this.wingFrame = 3; - else if (this.wingFrameCounter < num * 4 - 1) - { - this.wingFrame = 2; - } - else - { - this.wingFrame = 2; - this.wingFrameCounter = 0; - } - } - else - { - ++this.wingFrameCounter; - int num = 6; - if (this.wingFrameCounter < num) - this.wingFrame = 4; - else if (this.wingFrameCounter < num * 2) - this.wingFrame = 5; - else if (this.wingFrameCounter < num * 3 - 1) - { - this.wingFrame = 4; - } - else - { - this.wingFrame = 4; - this.wingFrameCounter = 0; - } - } - } - else - { - ++this.wingFrameCounter; - int num = 2; - if (this.wingFrameCounter < num) - this.wingFrame = 4; - else if (this.wingFrameCounter < num * 2) - this.wingFrame = 5; - else if (this.wingFrameCounter < num * 3) - this.wingFrame = 6; - else if (this.wingFrameCounter < num * 4 - 1) - { - this.wingFrame = 5; - } - else - { - this.wingFrame = 5; - this.wingFrameCounter = 0; - } - } - } - else - { - ++this.wingFrameCounter; - int num = 6; - if (this.wingFrameCounter < num) - this.wingFrame = 4; - else if (this.wingFrameCounter < num * 2) - this.wingFrame = 5; - else if (this.wingFrameCounter < num * 3 - 1) - { - this.wingFrame = 4; - } - else - { - this.wingFrame = 4; - this.wingFrameCounter = 0; - } - } - } - else if (this.wings == 12) - { - if (wingFlap || this.jump > 0) - { - ++this.wingFrameCounter; - int num = 5; - if (this.wingFrameCounter < num) - this.wingFrame = 1; - else if (this.wingFrameCounter < num * 2) - this.wingFrame = 2; - else if (this.wingFrameCounter < num * 3) - this.wingFrame = 3; - else if (this.wingFrameCounter < num * 4 - 1) - { - this.wingFrame = 2; - } - else - { - this.wingFrame = 2; - this.wingFrameCounter = 0; - } - } - else if ((double) this.velocity.Y != 0.0) - this.wingFrame = 2; - else - this.wingFrame = 0; - } - else if (this.wings == 24) - { - if (wingFlap || this.jump > 0) - { - ++this.wingFrameCounter; - int num = 1; - if (this.wingFrameCounter < num) - this.wingFrame = 1; - else if (this.wingFrameCounter < num * 2) - this.wingFrame = 2; - else if (this.wingFrameCounter < num * 3) - { - this.wingFrame = 3; - } - else - { - this.wingFrame = 2; - if (this.wingFrameCounter < num * 4 - 1) - return; - this.wingFrameCounter = 0; - } - } - else if ((double) this.velocity.Y != 0.0) - { - if (this.controlJump) - { - ++this.wingFrameCounter; - int num = 3; - if (this.wingFrameCounter < num) - this.wingFrame = 1; - else if (this.wingFrameCounter < num * 2) - this.wingFrame = 2; - else if (this.wingFrameCounter < num * 3) - { - this.wingFrame = 3; - } - else - { - this.wingFrame = 2; - if (this.wingFrameCounter < num * 4 - 1) - return; - this.wingFrameCounter = 0; - } - } - else if ((double) this.wingTime == 0.0) - this.wingFrame = 0; - else - this.wingFrame = 1; - } - else - this.wingFrame = 0; - } - else if (this.wings == 30) - { - bool flag2 = false; - if (wingFlap || this.jump > 0) - { - ++this.wingFrameCounter; - int num = 2; - if (this.wingFrameCounter >= num * 3) - this.wingFrameCounter = 0; - this.wingFrame = 1 + this.wingFrameCounter / num; - flag2 = true; - } - else if ((double) this.velocity.Y != 0.0) - { - if (this.controlJump) - { - ++this.wingFrameCounter; - int num = 2; - if (this.wingFrameCounter >= num * 3) - this.wingFrameCounter = 0; - this.wingFrame = 1 + this.wingFrameCounter / num; - flag2 = true; - } - else - this.wingFrame = (double) this.wingTime != 0.0 ? 0 : 0; - } - else - this.wingFrame = 0; - if (!flag2) - return; - for (int index = 0; index < 4; ++index) - { - if (Main.rand.Next(4) == 0) - { - Vector2 vector2 = ((float) (0.392699092626572 * (double) index - 0.745398163795471 + 0.0299999993294477 * (double) index)).ToRotationVector2() * new Vector2((float) (-this.direction * 20), 20f); - Dust dust = Main.dust[Dust.NewDust(this.Center, 0, 0, 229, Alpha: 100, newColor: Color.White, Scale: 0.8f)]; - dust.noGravity = true; - dust.noLightEmittence = flag1; - dust.position = this.Center + vector2; - dust.velocity = this.DirectionTo(dust.position) * 2f; - if (Main.rand.Next(10) != 0) - dust.customData = (object) this; - else - dust.fadeIn = 0.5f; - dust.shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - } - } - for (int index = 0; index < 4; ++index) - { - if (Main.rand.Next(8) == 0) - { - Vector2 vector2 = ((float) (0.392699092626572 * (double) index - 0.705398201942444 + 0.0299999993294477 * (double) index)).ToRotationVector2() * new Vector2((float) (this.direction * 20), 24f) + new Vector2((float) -this.direction * 16f, 0.0f); - Dust dust = Main.dust[Dust.NewDust(this.Center, 0, 0, 229, Alpha: 100, newColor: Color.White, Scale: 0.5f)]; - dust.noGravity = true; - dust.noLightEmittence = flag1; - dust.position = this.Center + vector2; - dust.velocity = Vector2.Normalize(dust.position - this.Center - new Vector2((float) -this.direction * 16f, 0.0f)) * 2f; - dust.position += dust.velocity * 5f; - if (Main.rand.Next(10) != 0) - dust.customData = (object) this; - else - dust.fadeIn = 0.5f; - dust.shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - } - } - } - else if (this.wings == 34 && this.ShouldDrawWingsThatAreAlwaysAnimated()) - { - if (wingFlap || this.jump > 0) - { - ++this.wingFrameCounter; - int num = 4; - if (this.wingFrameCounter >= num * 6) - this.wingFrameCounter = 0; - this.wingFrame = this.wingFrameCounter / num; - } - else if ((double) this.velocity.Y != 0.0) - { - if (this.controlJump) - { - ++this.wingFrameCounter; - int num = 9; - if (this.wingFrameCounter >= num * 6) - this.wingFrameCounter = 0; - this.wingFrame = this.wingFrameCounter / num; - } - else - { - ++this.wingFrameCounter; - int num = 6; - if (this.wingFrameCounter >= num * 6) - this.wingFrameCounter = 0; - this.wingFrame = this.wingFrameCounter / num; - } - } - else - { - ++this.wingFrameCounter; - int num = 4; - if (this.wingFrameCounter >= num * 6) - this.wingFrameCounter = 0; - this.wingFrame = this.wingFrameCounter / num; - } - } - else if (this.wings == 45 && this.ShouldDrawWingsThatAreAlwaysAnimated()) - { - if ((double) this.wingTime > 0.0) - { - --this.rocketDelay2; - if (this.rocketDelay2 <= 0) - { - SoundEngine.PlaySound(SoundID.Item24, this.position); - this.rocketDelay2 = 30; - } - } - if ((double) this.velocity.Y == 0.0) - { - this.wingFrameCounter = 0; - this.wingFrame = 0; - } - else - { - ++this.wingFrameCounter; - int num = 3; - if ((double) this.wingTime == 0.0) - num = 5; - if (this.wingFrameCounter >= num * 6) - this.wingFrameCounter = 0; - this.wingFrame = this.wingFrameCounter / num; - } - if (Main.rand.Next(8) != 0) - return; - Microsoft.Xna.Framework.Rectangle r = Utils.CenteredRectangle(Main.ReverseGravitySupport(this.Bottom), new Vector2(40f, 24f)); - Dust dust = Dust.NewDustDirect(r.TopLeft(), r.Width, r.Height, 43, newColor: (Color.White * 0.5f), Scale: 0.2f); - dust.fadeIn = 0.4f; - dust.velocity += this.velocity; - dust.velocity *= 0.35f; - dust.shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - } - else if (this.wings == 44 && this.ShouldDrawWingsThatAreAlwaysAnimated()) - { - int num = 5; - if (wingFlap || this.jump > 0) - { - ++this.wingFrameCounter; - if (this.wingFrameCounter >= num * 6) - this.wingFrameCounter = 0; - this.wingFrame = 1 + this.wingFrameCounter / num; - } - else if ((double) this.velocity.Y != 0.0) - { - if (this.controlJump) - this.wingFrame = 2; - else if (this.ShouldFloatInWater && this.wet) - this.wingFrame = 0; - else - this.wingFrame = 3; - } - else - { - ++this.wingFrameCounter; - if (this.wingFrameCounter >= num * 6) - this.wingFrameCounter = 0; - this.wingFrame = 1 + this.wingFrameCounter / num; - } - } - else if (this.wings == 39 && this.ShouldDrawWingsThatAreAlwaysAnimated()) - { - if (wingFlap || this.jump > 0) - { - ++this.wingFrameCounter; - int num = 4; - if (this.wingFrameCounter >= num * 6) - this.wingFrameCounter = 0; - this.wingFrame = this.wingFrameCounter / num; - } - else if ((double) this.velocity.Y != 0.0) - { - if (this.controlJump) - { - ++this.wingFrameCounter; - int num = 9; - if (this.wingFrameCounter >= num * 6) - this.wingFrameCounter = 0; - this.wingFrame = this.wingFrameCounter / num; - } - else - { - ++this.wingFrameCounter; - int num = 6; - if (this.wingFrameCounter >= num * 6) - this.wingFrameCounter = 0; - this.wingFrame = this.wingFrameCounter / num; - } - } - else - { - ++this.wingFrameCounter; - int num = 4; - if (this.wingFrameCounter >= num * 6) - this.wingFrameCounter = 0; - this.wingFrame = this.wingFrameCounter / num; - } - int num1 = 1; - if (this.wingFrame == 3) - num1 = 5; - if ((double) this.velocity.Y == 0.0) - num1 = 0; - Microsoft.Xna.Framework.Rectangle r = Utils.CenteredRectangle((double) this.gravDir == 1.0 ? this.Bottom + new Vector2(0.0f, -10f) : this.Top + new Vector2(0.0f, 10f), new Vector2(50f, 20f)); - for (int index = 0; index < num1; ++index) - { - Dust dust = Dust.NewDustDirect(r.TopLeft(), r.Width, r.Height, 31, newColor: Color.Black); - dust.scale = 0.7f; - dust.velocity *= 0.4f; - dust.velocity.Y += this.gravDir * 0.5f; - dust.shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - } - } - else if (this.wings == 33) - { - bool flag3 = false; - if (wingFlap || this.jump > 0) - flag3 = true; - else if ((double) this.velocity.Y != 0.0 && this.controlJump) - flag3 = true; - if (!flag3) - return; - Color rgb = Main.hslToRgb(Main.rgbToHsl(this.eyeColor).X, 1f, 0.5f); - int num2 = this.direction == 1 ? 0 : -4; - int num3 = (double) this.gravDir == 1.0 ? this.height : 0; - for (int index = 0; index < 2; ++index) - { - Dust rf = Main.dust[Dust.NewDust(this.position, this.width, this.height, 182, this.velocity.X, this.velocity.Y, (int) sbyte.MaxValue, rgb)]; - rf.noGravity = true; - rf.fadeIn = 1f; - rf.scale = 1f; - rf.noLight = true; - rf.noLightEmittence = flag1; - rf.shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - if (index == 0) - { - rf.position = new Vector2(this.position.X + (float) num2, this.position.Y + (float) num3); - rf.velocity.X = (float) ((double) rf.velocity.X * 1.0 - 2.0 - (double) this.velocity.X * 0.300000011920929); - rf.velocity.Y = (float) ((double) rf.velocity.Y * 1.0 + 2.0 * (double) this.gravDir - (double) this.velocity.Y * 0.300000011920929); - } - else if (index == 1) - { - rf.position = new Vector2(this.position.X + (float) this.width + (float) num2, this.position.Y + (float) num3); - rf.velocity.X = (float) ((double) rf.velocity.X * 1.0 + 2.0 - (double) this.velocity.X * 0.300000011920929); - rf.velocity.Y = (float) ((double) rf.velocity.Y * 1.0 + 2.0 * (double) this.gravDir - (double) this.velocity.Y * 0.300000011920929); - } - if (rf.dustIndex != 6000) - { - Dust dust = Dust.CloneDust(rf); - dust.scale *= 0.65f; - dust.fadeIn *= 0.65f; - dust.color = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); - rf.noLight = true; - rf.noLightEmittence = flag1; - rf.shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - } - } - } - else if (this.wings == 38) - { - bool flag4 = false; - if (wingFlap || this.jump > 0) - { - ++this.wingFrameCounter; - if (this.wingFrameCounter >= 32) - this.wingFrameCounter = 0; - this.wingFrame = 1 + this.wingFrameCounter / 8; - if (this.wingFrame == 4) - this.wingFrame = 2; - flag4 = true; - } - else if ((double) this.velocity.Y != 0.0) - { - if (this.controlJump) - { - ++this.wingFrameCounter; - if (this.wingFrameCounter >= 32) - this.wingFrameCounter = 0; - this.wingFrame = 1 + this.wingFrameCounter / 8; - if (this.wingFrame == 4) - this.wingFrame = 2; - flag4 = true; - } - else - this.wingFrame = 0; - } - else - this.wingFrame = 0; - if (!flag4) - return; - Vector2 vector2_1 = new Vector2((float) this.direction, this.gravDir); - Vector2 vector2_2 = this.velocity * 0.5f; - int Type = 267; - int num = this.miscCounter * this.direction; - for (int index = 0; index < 3; ++index) - { - Vector2 vector2_3 = Vector2.Zero; - if (index != 1) - { - if (index == 2) - vector2_3 = this.velocity * -0.66f; - } - else - vector2_3 = this.velocity * -0.33f; - Dust dust1 = Dust.NewDustPerfect(this.Center + (new Vector2(-39f, 6f) * vector2_1 + new Vector2(2f, 0.0f).RotatedBy((double) num / -15.0 * 6.28318548202515)) + vector2_3, Type, new Vector2?(vector2_2), newColor: this.underShirtColor); - dust1.noGravity = true; - dust1.noLight = true; - dust1.noLightEmittence = flag1; - dust1.scale = 0.47f; - dust1.shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - Dust dust2 = Dust.NewDustPerfect(this.Center + (new Vector2(-23f, 2f) * vector2_1 + new Vector2(2f, 0.0f).RotatedBy((double) num / -15.0 * 6.28318548202515)) + vector2_3, Type, new Vector2?(vector2_2), newColor: this.underShirtColor); - dust2.noGravity = true; - dust2.noLight = true; - dust2.noLightEmittence = flag1; - dust2.scale = 0.35f; - dust2.shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - Dust dust3 = Dust.NewDustPerfect(this.Center + (new Vector2(-31f, -6f) * vector2_1 + new Vector2(2f, 0.0f).RotatedBy((double) num / -20.0 * 6.28318548202515)) + vector2_3, Type, new Vector2?(vector2_2), newColor: this.underShirtColor); - dust3.noGravity = true; - dust3.noLight = true; - dust3.noLightEmittence = flag1; - dust3.scale = 0.49f; - dust3.shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - } - } - else - { - int num4 = 4; - int num5 = 4; - int num6 = 0; - if (this.wings == 43) - { - num5 = 7; - num6 = 1; - num4 = 3; - } - if (this.wings == 32) - num4 = 3; - if (wingFlap || this.jump > 0) - { - ++this.wingFrameCounter; - if (this.wingFrameCounter <= num4) - return; - ++this.wingFrame; - this.wingFrameCounter = 0; - if (this.wingFrame < num5) - return; - this.wingFrame = num6; - } - else if ((double) this.velocity.Y != 0.0) - { - this.wingFrame = 1; - if (this.wings == 32) - this.wingFrame = 3; - if (this.wings == 43) - { - this.wingFrame = 2; - if (this.ShouldFloatInWater && this.wet) - this.wingFrame = 0; - } - if (this.wings != 29 || Main.rand.Next(5) != 0) - return; - int num7 = 4; - if (this.direction == 1) - num7 = -40; - int index = Dust.NewDust(new Vector2(this.position.X + (float) (this.width / 2) + (float) num7, (float) ((double) this.position.Y + (double) (this.height / 2) - 15.0)), 30, 30, 6, Alpha: 100, Scale: 2.4f); - Main.dust[index].noGravity = true; - Main.dust[index].noLightEmittence = flag1; - Main.dust[index].velocity *= 0.3f; - if (Main.rand.Next(10) == 0) - Main.dust[index].fadeIn = 2f; - Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - } - else - this.wingFrame = 0; - } - } - - public bool ShouldDrawWingsThatAreAlwaysAnimated() => ((double) this.velocity.Y != 0.0 || this.grappling[0] != -1) && (!this.wet || !this.ShouldFloatInWater) && !this.mount.Active; - - private void WingAirVisuals() - { - bool flag = this.wingsLogic != this.wings; - if (this.wings == 10 && Main.rand.Next(2) == 0) - { - int num = 4; - if (this.direction == 1) - num = -40; - int index = Dust.NewDust(new Vector2(this.position.X + (float) (this.width / 2) + (float) num, (float) ((double) this.position.Y + (double) (this.height / 2) - 15.0)), 30, 30, 76, Alpha: 50, Scale: 0.6f); - Main.dust[index].fadeIn = 1.1f; - Main.dust[index].noGravity = true; - Main.dust[index].noLight = true; - Main.dust[index].velocity *= 0.3f; - Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - } - if (this.wings == 34 && Main.rand.Next(2) == 0) - { - int num = 4; - if (this.direction == 1) - num = -40; - int index = Dust.NewDust(new Vector2(this.position.X + (float) (this.width / 2) + (float) num, (float) ((double) this.position.Y + (double) (this.height / 2) - 15.0)), 30, 30, 261, Alpha: 50, Scale: 0.6f); - Main.dust[index].fadeIn = 1.1f; - Main.dust[index].noGravity = true; - Main.dust[index].noLight = true; - Main.dust[index].noLightEmittence = flag; - Main.dust[index].velocity *= 0.3f; - Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - } - int wings1 = this.wings; - int wings2 = this.wings; - if (this.wings == 9 && Main.rand.Next(2) == 0) - { - int num = 4; - if (this.direction == 1) - num = -40; - int index = Dust.NewDust(new Vector2(this.position.X + (float) (this.width / 2) + (float) num, (float) ((double) this.position.Y + (double) (this.height / 2) - 15.0)), 30, 30, 6, Alpha: 200, Scale: 2f); - Main.dust[index].noGravity = true; - Main.dust[index].noLightEmittence = flag; - Main.dust[index].velocity *= 0.3f; - Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - } - if (this.wings == 6 && Main.rand.Next(4) == 0) - { - int num = 4; - if (this.direction == 1) - num = -40; - int index = Dust.NewDust(new Vector2(this.position.X + (float) (this.width / 2) + (float) num, (float) ((double) this.position.Y + (double) (this.height / 2) - 15.0)), 30, 30, 55, Alpha: 200); - Main.dust[index].velocity *= 0.3f; - Main.dust[index].noLightEmittence = flag; - Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - } - if (this.wings == 5 && Main.rand.Next(3) == 0) - { - int num = 6; - if (this.direction == 1) - num = -30; - int index = Dust.NewDust(new Vector2(this.position.X + (float) (this.width / 2) + (float) num, this.position.Y), 18, this.height, 58, Alpha: ((int) byte.MaxValue), Scale: 1.2f); - Main.dust[index].noLightEmittence = flag; - Main.dust[index].velocity *= 0.3f; - Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - } - if (this.wings == 26) - { - int num1 = 6; - if (this.direction == 1) - num1 = -30; - int index1 = Dust.NewDust(new Vector2(this.position.X + (float) (this.width / 2) + (float) num1, this.position.Y), 18, this.height, 217, Alpha: 100, Scale: 1.4f); - Main.dust[index1].noGravity = true; - Main.dust[index1].noLight = true; - Main.dust[index1].velocity /= 4f; - Main.dust[index1].velocity -= this.velocity; - Main.dust[index1].shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - if (Main.rand.Next(2) == 0) - { - int num2 = -24; - if (this.direction == 1) - num2 = 12; - float y = this.position.Y; - if ((double) this.gravDir == -1.0) - y += (float) (this.height / 2); - int index2 = Dust.NewDust(new Vector2(this.position.X + (float) (this.width / 2) + (float) num2, y), 12, this.height / 2, 217, Alpha: 100, Scale: 1.4f); - Main.dust[index2].noGravity = true; - Main.dust[index2].noLight = true; - Main.dust[index2].velocity /= 4f; - Main.dust[index2].velocity -= this.velocity; - Main.dust[index2].shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - } - } - if (this.wings == 37) - { - int num3 = 6; - if (this.direction == 1) - num3 = -30; - Dust dust1 = Dust.NewDustDirect(new Vector2(this.position.X + (float) (this.width / 2) + (float) num3, this.position.Y), 24, this.height, Utils.SelectRandom(Main.rand, 31, 31, 31), Alpha: 100); - dust1.noGravity = true; - dust1.noLight = true; - dust1.velocity /= 4f; - dust1.velocity -= this.velocity / 2f; - dust1.shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - if (dust1.type == 55) - { - dust1.noGravity = true; - dust1.velocity *= 2f; - dust1.color = Color.Red; - } - if (Main.rand.Next(3) == 0) - { - int num4 = -24; - if (this.direction == 1) - num4 = 12; - float y = this.position.Y; - if ((double) this.gravDir == -1.0) - y += (float) (this.height / 2); - Dust dust2 = Dust.NewDustDirect(new Vector2(this.position.X + (float) (this.width / 2) + (float) num4, y), 16, this.height / 2, Utils.SelectRandom(Main.rand, 31, 31, 31), Alpha: 100); - dust2.noGravity = true; - dust2.noLight = true; - dust2.velocity /= 4f; - dust2.velocity -= this.velocity / 2f; - dust2.shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - if (dust2.type == 55) - { - dust2.noGravity = true; - dust2.velocity *= 2f; - dust2.color = Color.Red; - } - } - } - if (this.wings == 29 && Main.rand.Next(3) == 0) - { - int num = 4; - if (this.direction == 1) - num = -40; - int index = Dust.NewDust(new Vector2(this.position.X + (float) (this.width / 2) + (float) num, (float) ((double) this.position.Y + (double) (this.height / 2) - 15.0)), 30, 30, 6, Alpha: 100, Scale: 2.4f); - Main.dust[index].noGravity = true; - Main.dust[index].velocity *= 0.3f; - Main.dust[index].noLightEmittence = flag; - if (Main.rand.Next(10) == 0) - Main.dust[index].fadeIn = 2f; - Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - } - if (this.wings != 31) - return; - if (Main.rand.Next(6) == 0) - { - int num = 4; - if (this.direction == 1) - num = -40; - Dust dust = Main.dust[Dust.NewDust(new Vector2(this.position.X + (float) (this.width / 2) + (float) num, (float) ((double) this.position.Y + (double) (this.height / 2) - 15.0)), 30, 30, 86)]; - dust.noGravity = true; - dust.scale = 1f; - dust.fadeIn = 1.2f; - dust.velocity *= 0.2f; - dust.noLight = true; - dust.shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - } - if (Main.rand.Next(3) == 0) - { - int num = 4; - if (this.direction == 1) - num = -40; - Dust dust = Main.dust[Dust.NewDust(new Vector2(this.position.X + (float) (this.width / 2) + (float) num, (float) ((double) this.position.Y + (double) (this.height / 2) - 15.0)), 30, 30, 240)]; - dust.noGravity = true; - dust.scale = 1.2f; - dust.velocity *= 0.2f; - dust.alpha = 200; - dust.shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - } - if (Main.rand.Next(2) != 0) - return; - if (Main.rand.Next(6) == 0) - { - int num = -24; - if (this.direction == 1) - num = 12; - float y = this.position.Y; - if ((double) this.gravDir == -1.0) - y += (float) (this.height / 2); - Dust dust = Main.dust[Dust.NewDust(new Vector2(this.position.X + (float) (this.width / 2) + (float) num, y), 12, this.height / 2, 86)]; - dust.noGravity = true; - dust.scale = 1f; - dust.fadeIn = 1.2f; - dust.velocity *= 0.2f; - dust.noLight = true; - dust.shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - } - if (Main.rand.Next(3) != 0) - return; - int num5 = -24; - if (this.direction == 1) - num5 = 12; - float y1 = this.position.Y; - if ((double) this.gravDir == -1.0) - y1 += (float) (this.height / 2); - Dust dust3 = Main.dust[Dust.NewDust(new Vector2(this.position.X + (float) (this.width / 2) + (float) num5, y1), 12, this.height / 2, 240)]; - dust3.noGravity = true; - dust3.scale = 1.2f; - dust3.velocity *= 0.2f; - dust3.alpha = 200; - dust3.shader = GameShaders.Armor.GetSecondaryShader(this.cWings, this); - } - - private void HandleBeingInChestRange() - { - if (this.chest != -1) - { - if (this.chest != -2) - this.flyingPigChest = -1; - if (this.chest != -5) - this.voidLensChest = -1; - if (this.flyingPigChest >= 0) - { - if (!Main.projectile[this.flyingPigChest].active || Main.projectile[this.flyingPigChest].type != 525) - { - SoundEngine.PlaySound(SoundID.Item59); - this.chest = -1; - Recipe.FindRecipes(); - } - else - { - int num1 = (int) (((double) this.position.X + (double) this.width * 0.5) / 16.0); - int num2 = (int) (((double) this.position.Y + (double) this.height * 0.5) / 16.0); - Vector2 vector2 = Main.projectile[this.flyingPigChest].Hitbox.ClosestPointInRect(this.Center); - this.chestX = (int) vector2.X / 16; - this.chestY = (int) vector2.Y / 16; - if (num1 >= this.chestX - Player.tileRangeX && num1 <= this.chestX + Player.tileRangeX + 1 && num2 >= this.chestY - Player.tileRangeY && num2 <= this.chestY + Player.tileRangeY + 1) - return; - if (this.chest != -1) - SoundEngine.PlaySound(SoundID.Item59); - this.chest = -1; - Recipe.FindRecipes(); - } - } - else if (this.voidLensChest >= 0) - { - if (!Main.projectile[this.voidLensChest].active || Main.projectile[this.voidLensChest].type != 734) - { - SoundEngine.PlaySound(SoundID.Item130); - this.chest = -1; - Recipe.FindRecipes(); - } - else - { - int num3 = (int) (((double) this.position.X + (double) this.width * 0.5) / 16.0); - int num4 = (int) (((double) this.position.Y + (double) this.height * 0.5) / 16.0); - Vector2 vector2 = Main.projectile[this.voidLensChest].Hitbox.ClosestPointInRect(this.Center); - this.chestX = (int) vector2.X / 16; - this.chestY = (int) vector2.Y / 16; - if (num3 >= this.chestX - Player.tileRangeX && num3 <= this.chestX + Player.tileRangeX + 1 && num4 >= this.chestY - Player.tileRangeY && num4 <= this.chestY + Player.tileRangeY + 1) - return; - if (this.chest != -1) - SoundEngine.PlaySound(SoundID.Item130); - this.chest = -1; - Recipe.FindRecipes(); - } - } - else if (!this.IsInInteractionRangeToMultiTileHitbox(this.chestX, this.chestY)) - { - if (this.chest != -1) - SoundEngine.PlaySound(11); - this.chest = -1; - Recipe.FindRecipes(); - } - else - { - if (Main.tile[this.chestX, this.chestY].active()) - return; - SoundEngine.PlaySound(11); - this.chest = -1; - Recipe.FindRecipes(); - } - } - else - { - this.flyingPigChest = -1; - this.voidLensChest = -1; - } - } - - public bool IsInInteractionRangeToMultiTileHitbox(int chestPointX, int chestPointY) - { - int num1 = (int) (((double) this.position.X + (double) this.width * 0.5) / 16.0); - int num2 = (int) (((double) this.position.Y + (double) this.height * 0.5) / 16.0); - Microsoft.Xna.Framework.Rectangle r = Microsoft.Xna.Framework.Rectangle.Empty; - Tile tile = Main.tile[chestPointX, chestPointY]; - if (tile.type == (ushort) 463 || tile.type == (ushort) 491) - r = new Microsoft.Xna.Framework.Rectangle(chestPointX * 16 - 16, chestPointY * 16 - 32, 48, 64); - if (TileID.Sets.BasicChest[(int) tile.type] || tile.type == (ushort) 97) - r = new Microsoft.Xna.Framework.Rectangle(chestPointX * 16, chestPointY * 16, 32, 32); - if (tile.type == (ushort) 88) - r = new Microsoft.Xna.Framework.Rectangle(chestPointX * 16, chestPointY * 16, 48, 32); - if (tile.type == (ushort) 29) - r = new Microsoft.Xna.Framework.Rectangle(chestPointX * 16, chestPointY * 16, 32, 16); - r.Inflate(-1, -1); - Point tileCoordinates = r.ClosestPointInRect(this.Center).ToTileCoordinates(); - chestPointX = tileCoordinates.X; - chestPointY = tileCoordinates.Y; - return (num1 < chestPointX - Player.tileRangeX || num1 > chestPointX + Player.tileRangeX + 1 || num2 < chestPointY - Player.tileRangeY ? 1 : (num2 > chestPointY + Player.tileRangeY + 1 ? 1 : 0)) == 0; - } - - public void ResetVisibleAccessories() - { - this.handon = (sbyte) -1; - this.handoff = (sbyte) -1; - this.back = (sbyte) -1; - this.front = (sbyte) -1; - this.shoe = (sbyte) -1; - this.waist = (sbyte) -1; - this.shield = (sbyte) -1; - this.neck = (sbyte) -1; - this.face = (sbyte) -1; - this.balloon = (sbyte) -1; - } - - public void UpdateArmorLights() + private void UpdateArmorLights() { if (this.vortexStealthActive) return; @@ -19322,11 +14115,6 @@ label_15: num2 = 0.4f; num3 = 0.8f; break; - case 216: - num1 = 0.7f; - num2 = 0.95f; - num3 = 0.82f; - break; } float num4 = 0.0f; float num5 = 0.0f; @@ -19422,10 +14210,8 @@ label_15: Lighting.AddLight((int) ((double) this.position.X + (double) spinningpoint1.X) / 16, (int) ((double) this.position.Y + (double) spinningpoint1.Y) / 16, num7 * num12, num8 * num12, num9 * num12); } - public void Update_NPCCollision() + private void Update_NPCCollision() { - if (this.creativeGodMode) - return; Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle((int) this.position.X, (int) this.position.Y, this.width, this.height); for (int index = 0; index < 200; ++index) { @@ -19441,66 +14227,56 @@ label_15: case 401: specialHitSetter = 1; break; - case 636: - specialHitSetter = 1; - break; } if ((specialHitSetter != -1 || !this.immune) && (this.dash != 2 || index != this.eocHit || this.eocDash <= 0) && !this.npcTypeNoAggro[Main.npc[index].type]) { float damageMultiplier = 1f; - NPC npc1 = Main.npc[index]; - npc1.position = npc1.position + Main.npc[index].netOffset; Microsoft.Xna.Framework.Rectangle npcRect = new Microsoft.Xna.Framework.Rectangle((int) Main.npc[index].position.X, (int) Main.npc[index].position.Y, Main.npc[index].width, Main.npc[index].height); NPC.GetMeleeCollisionData(rectangle, index, ref specialHitSetter, ref damageMultiplier, ref npcRect); - if (rectangle.Intersects(npcRect)) + if (rectangle.Intersects(npcRect) && !this.npcTypeNoAggro[Main.npc[index].type]) { - if (!this.npcTypeNoAggro[Main.npc[index].type]) + bool flag1 = true; + bool flag2 = false; + int num1 = this.CanParryAgainst(rectangle, npcRect, Main.npc[index].velocity) ? 1 : 0; + float num2 = this.thorns; + float knockback = 10f; + if (this.turtleThorns) + num2 = 1f; + if (num1 != 0) { - bool flag1 = true; - bool flag2 = false; - int num1 = this.CanParryAgainst(rectangle, npcRect, Main.npc[index].velocity) ? 1 : 0; - float num2 = this.thorns; - float knockback = 10f; - if (this.turtleThorns) - num2 = 2f; - if (num1 != 0) - { - num2 = 2f; - knockback = 5f; - flag1 = false; - flag2 = true; - } - int hitDirection = -1; - if ((double) Main.npc[index].position.X + (double) (Main.npc[index].width / 2) < (double) this.position.X + (double) (this.width / 2)) - hitDirection = 1; - int Damage = Main.DamageVar((float) Main.npc[index].damage * damageMultiplier, -this.luck); - int num3 = Item.NPCtoBanner(Main.npc[index].BannerID()); - if (num3 > 0 && this.HasNPCBannerBuff(num3)) - Damage = !Main.expertMode ? (int) ((double) Damage * (double) ItemID.Sets.BannerStrength[Item.BannerToItem(num3)].NormalDamageReceived) : (int) ((double) Damage * (double) ItemID.Sets.BannerStrength[Item.BannerToItem(num3)].ExpertDamageReceived); - if (this.whoAmI == Main.myPlayer && (double) num2 > 0.0 && !this.immune && !Main.npc[index].dontTakeDamage) - { - int damage = (int) ((double) Damage * (double) num2); - if (damage > 1000) - damage = 1000; - this.ApplyDamageToNPC(Main.npc[index], damage, knockback, -hitDirection, false); - } - if (this.resistCold && Main.npc[index].coldDamage) - Damage = (int) ((double) Damage * 0.699999988079071); - if (!this.immune && !flag2) - this.StatusFromNPC(Main.npc[index]); - if (flag1) - this.Hurt(PlayerDeathReason.ByNPC(index), Damage, hitDirection, cooldownCounter: specialHitSetter); - if (num1 != 0) - { - this.GiveImmuneTimeForCollisionAttack(this.longInvince ? 60 : 30); - this.AddBuff(198, 300, false); - } + num2 = 2f; + knockback = 5f; + flag1 = false; + flag2 = true; + } + int hitDirection = -1; + if ((double) Main.npc[index].position.X + (double) (Main.npc[index].width / 2) < (double) this.position.X + (double) (this.width / 2)) + hitDirection = 1; + int Damage = Main.DamageVar((float) Main.npc[index].damage * damageMultiplier); + int banner = Item.NPCtoBanner(Main.npc[index].BannerID()); + if (banner > 0 && this.NPCBannerBuff[banner]) + Damage = !Main.expertMode ? (int) ((double) Damage * (double) ItemID.Sets.BannerStrength[Item.BannerToItem(banner)].NormalDamageReceived) : (int) ((double) Damage * (double) ItemID.Sets.BannerStrength[Item.BannerToItem(banner)].ExpertDamageReceived); + if (this.whoAmI == Main.myPlayer && (double) num2 > 0.0 && !this.immune && !Main.npc[index].dontTakeDamage) + { + int damage = (int) ((double) Damage * (double) num2); + this.ApplyDamageToNPC(Main.npc[index], damage, knockback, -hitDirection, false); + } + if (this.resistCold && Main.npc[index].coldDamage) + Damage = (int) ((double) Damage * 0.699999988079071); + if (!this.immune && !flag2) + this.StatusPlayer(Main.npc[index]); + if (flag1) + this.Hurt(PlayerDeathReason.ByNPC(index), Damage, hitDirection, cooldownCounter: specialHitSetter); + if (num1 != 0) + { + this.immune = true; + this.immuneNoBlink = true; + this.immuneTime = 30; + if (this.longInvince) + this.immuneTime = 60; + this.AddBuff(198, 300, false); } - else - continue; } - NPC npc2 = Main.npc[index]; - npc2.position = npc2.position - Main.npc[index].netOffset; } } } @@ -19542,15 +14318,6 @@ label_15: bank3.item[index].TurnToAir(); } } - if (this.chest == -5) - { - Chest bank4 = this.bank4; - for (int index = 0; index < 40; ++index) - { - if (bank4.item[index].stack > 0 && bank4.item[index].type == 3822) - bank4.item[index].TurnToAir(); - } - } if (this.chest == -3) { Chest bank2 = this.bank2; @@ -19577,48 +14344,27 @@ label_15: public void ItemCheck_ManageRightClickFeatures() { bool theGeneralCheck = this.selectedItem != 58 && this.controlUseTile && !this.tileInteractionHappened && this.releaseUseItem && !this.controlUseItem && !this.mouseInterface && !CaptureManager.Instance.Active && !Main.HoveringOverAnNPC && !Main.SmartInteractShowingGenuine; - bool flag = theGeneralCheck; - if (!ItemID.Sets.ItemsThatAllowRepeatedRightClick[this.inventory[this.selectedItem].type] && !Main.mouseRightRelease) - flag = false; - if (flag && this.altFunctionUse == 0) - { - for (int index = 0; index < this._projectilesToInteractWith.Count; ++index) - { - Projectile projectile = Main.projectile[this._projectilesToInteractWith[index]]; - if (projectile.Hitbox.Contains(Main.MouseWorld.ToPoint()) || Main.SmartInteractProj == projectile.whoAmI) - { - theGeneralCheck = false; - flag = false; - break; - } - } - } - if (flag && this.altFunctionUse == 0 && this.inventory[this.selectedItem].type == 3384) + if (theGeneralCheck && this.altFunctionUse == 0 && this.inventory[this.selectedItem].type == 3384) { this.altFunctionUse = 1; this.controlUseItem = true; } - if (flag && this.altFunctionUse == 0 && this.inventory[this.selectedItem].type == 3858) + if (theGeneralCheck && this.altFunctionUse == 0 && this.inventory[this.selectedItem].type == 3858) { this.altFunctionUse = 1; this.controlUseItem = true; } - if (flag && this.altFunctionUse == 0 && this.inventory[this.selectedItem].type == 4673) + if (theGeneralCheck && this.altFunctionUse == 0 && this.inventory[this.selectedItem].type == 3852 && this.itemAnimation == 0 && this.CheckMana(20, true)) { this.altFunctionUse = 1; this.controlUseItem = true; } - if (flag && this.altFunctionUse == 0 && this.inventory[this.selectedItem].type == 3852 && this.itemAnimation == 0) + if (theGeneralCheck && this.altFunctionUse == 0 && this.inventory[this.selectedItem].shoot > 0 && ProjectileID.Sets.TurretFeature[this.inventory[this.selectedItem].shoot]) { this.altFunctionUse = 1; this.controlUseItem = true; } - if (flag && this.altFunctionUse == 0 && this.inventory[this.selectedItem].shoot > 0 && ProjectileID.Sets.TurretFeature[this.inventory[this.selectedItem].shoot]) - { - this.altFunctionUse = 1; - this.controlUseItem = true; - } - if (flag && this.altFunctionUse == 0 && this.inventory[this.selectedItem].shoot > 0 && ProjectileID.Sets.MinionTargettingFeature[this.inventory[this.selectedItem].shoot]) + if (theGeneralCheck && this.altFunctionUse == 0 && this.inventory[this.selectedItem].shoot > 0 && ProjectileID.Sets.MinionTargettingFeature[this.inventory[this.selectedItem].shoot]) { this.altFunctionUse = 1; this.controlUseItem = true; @@ -19630,22 +14376,15 @@ label_15: public void ItemCheck_ManageRightClickFeatures_ShieldRaise(bool theGeneralCheck) { - bool flag1 = PlayerInput.Triggers.JustPressed.MouseRight; - if (this.whoAmI != Main.myPlayer) - { - flag1 = this.shieldRaised; - theGeneralCheck = this.shieldRaised; - } - bool shouldGuard = false; - bool flag2 = this.inventory[this.selectedItem].type == 3823 || this.inventory[this.selectedItem].type == 4760; - if (theGeneralCheck & flag2 && this.hasRaisableShield && !this.mount.Active && this.itemAnimation == 0 | flag1) - shouldGuard = true; + bool flag = false; + if (theGeneralCheck && this.inventory[this.selectedItem].type == 3823 && this.hasRaisableShield && !this.mount.Active && (this.itemAnimation == 0 || PlayerInput.Triggers.JustPressed.MouseRight)) + flag = true; if (this.shield_parry_cooldown > 0) { --this.shield_parry_cooldown; if (this.shield_parry_cooldown == 0) { - SoundEngine.PlaySound(25, this.Center); + Main.PlaySound(25); for (int index1 = 0; index1 < 10; ++index1) { int index2 = Dust.NewDust(this.Center + new Vector2((float) (this.direction * 6 + (this.direction == -1 ? -10 : 0)), -14f), 10, 16, 45, Alpha: ((int) byte.MaxValue), newColor: new Color((int) byte.MaxValue, 100, 0, (int) sbyte.MaxValue), Scale: ((float) Main.rand.Next(10, 16) * 0.1f)); @@ -19657,30 +14396,26 @@ label_15: } if (this.shieldParryTimeLeft > 0 && ++this.shieldParryTimeLeft > 20) this.shieldParryTimeLeft = 0; - this.TryTogglingShield(shouldGuard); - } - - public void TryTogglingShield(bool shouldGuard) - { - if (shouldGuard == this.shieldRaised) - return; - this.shieldRaised = shouldGuard; - if (this.shieldRaised) + if (flag != this.shieldRaised) { - if (this.shield_parry_cooldown == 0) - this.shieldParryTimeLeft = 1; - this.itemAnimation = 0; - this.itemTime = 0; - this.reuseDelay = 0; - } - else - { - this.shield_parry_cooldown = 15; - this.shieldParryTimeLeft = 0; - if (this.attackCD >= 20) - return; - this.attackCD = 20; + this.shieldRaised = flag; + if (this.shieldRaised) + { + if (this.shield_parry_cooldown == 0) + this.shieldParryTimeLeft = 1; + this.itemAnimation = 0; + this.itemTime = 0; + this.reuseDelay = 0; + } + else + { + this.shield_parry_cooldown = 15; + this.shieldParryTimeLeft = 0; + if (this.attackCD < 20) + this.attackCD = 20; + } } + int num = this.shieldRaised ? 1 : 0; } private void HandleHotbar() @@ -19710,88 +14445,35 @@ label_15: private void ItemCheckWrapped(int i) { - int num1 = this.controlLeft || this.controlRight || this.controlUp || this.controlDown || !PlayerInput.UsingGamepad || !Main.SmartCursorEnabled ? 0 : ((double) PlayerInput.GamepadThumbstickRight.Length() < 0.0500000007450581 ? 1 : 0); - if (num1 != 0) - this.ForceForwardCursor(true); - int num2 = !PlayerInput.smartSelectPointer.ShouldBeUsed() ? 0 : (!Main.SmartCursorEnabled ? 1 : 0); - if (num2 != 0) - this.ForceSmartSelectCursor(true); LockOnHelper.SetUP(); - int stack1 = this.inventory[this.selectedItem].stack; + int stack = this.inventory[this.selectedItem].stack; if (Main.ignoreErrors) - this.ItemCheck(i); + { + try + { + this.ItemCheck(i); + } + catch + { + } + } else this.ItemCheck(i); - int stack2 = this.inventory[this.selectedItem].stack; - if (stack1 != stack2) + if (stack != this.inventory[this.selectedItem].stack) Recipe.FindRecipes(); LockOnHelper.SetDOWN(); - if (num2 != 0) - this.ForceSmartSelectCursor(false); - if (num1 != 0) - this.ForceForwardCursor(false); - if (this.itemAnimation != 0) - return; - this.lastVisualizedSelectedItem = this.HeldItem.Clone(); - } - - private void ForceForwardCursor(bool state) - { - if (state == this._forceForwardCursor) - return; - this._forceForwardCursor = state; - if (state) - { - this._inputMouseCoordsForward = new Point(PlayerInput.MouseX, PlayerInput.MouseY); - this._mainMouseCoordsForward = new Point(Main.mouseX, Main.mouseY); - Point point = (this.Center - Main.screenPosition + new Vector2((float) (this.direction * 200), 0.0f)).ToPoint(); - Main.mouseX = PlayerInput.MouseX = point.X; - Main.mouseY = PlayerInput.MouseY = point.Y; - } - else - { - PlayerInput.MouseX = this._inputMouseCoordsForward.X; - PlayerInput.MouseY = this._inputMouseCoordsForward.Y; - Main.mouseX = this._mainMouseCoordsForward.X; - Main.mouseY = this._mainMouseCoordsForward.Y; - } - } - - private void ForceSmartSelectCursor(bool state) - { - if (state == this._forceSmartSelectCursor) - return; - this._forceSmartSelectCursor = state; - if (state) - { - this._inputMouseCoordsSmartSelect = new Point(PlayerInput.MouseX, PlayerInput.MouseY); - this._mainMouseCoordsSmartSelect = new Point(Main.mouseX, Main.mouseY); - this._tileTargetSmartSelect = new Point(Player.tileTargetX, Player.tileTargetY); - Point point = PlayerInput.smartSelectPointer.GetPointerPosition().ToPoint(); - Main.mouseX = PlayerInput.MouseX = point.X; - Main.mouseY = PlayerInput.MouseY = point.Y; - Point tileCoordinates = (point.ToVector2() + Main.screenPosition).ToTileCoordinates(); - Player.tileTargetX = tileCoordinates.X; - Player.tileTargetY = tileCoordinates.Y; - } - else - { - PlayerInput.MouseX = this._inputMouseCoordsSmartSelect.X; - PlayerInput.MouseY = this._inputMouseCoordsSmartSelect.Y; - Main.mouseX = this._mainMouseCoordsSmartSelect.X; - Main.mouseY = this._mainMouseCoordsSmartSelect.Y; - Player.tileTargetX = this._tileTargetSmartSelect.X; - Player.tileTargetY = this._tileTargetSmartSelect.Y; - } } public void ScrollHotbar(int Offset) { - Offset = Player.ClampHotbarOffset(Offset); + while (Offset > 9) + Offset -= 10; + while (Offset < 0) + Offset += 10; this.selectedItem += Offset; if (Offset != 0) { - SoundEngine.PlaySound(12); + Main.PlaySound(12); int num = this.selectedItem - Offset; this.DpadRadial.ChangeSelection(-1); this.CircularRadial.ChangeSelection(-1); @@ -19801,7 +14483,7 @@ label_15: if (this.changeItem >= 0) { if (this.selectedItem != this.changeItem) - SoundEngine.PlaySound(12); + Main.PlaySound(12); this.selectedItem = this.changeItem; this.changeItem = -1; } @@ -19813,111 +14495,152 @@ label_15: this.selectedItem += 10; } - private static int ClampHotbarOffset(int Offset) + private void OldInput() { - while (Offset > 9) - Offset -= 10; - while (Offset < 0) - Offset += 10; - return Offset; - } - - public List GetListOfProjectilesToInteractWithHack() => this._projectilesToInteractWith; - - public void LockGamepadTileInteractions() - { - this.releaseUseTile = false; - this._lockTileInteractionsTimer = 3; - PlayerInput.LockGamepadTileUseButton = true; - } - - public void LookForTileInteractions() - { - if (Main.mapFullscreen || Main.InGameUI.CurrentState == Main.BestiaryUI) - return; - int num1 = Player.tileTargetX; - int num2 = Player.tileTargetY; - if (Main.SmartInteractShowingGenuine && Main.SmartInteractNPC == -1 && Main.SmartInteractProj == -1) + bool flag1 = false; + bool flag2 = false; + Keys[] pressedKeys = Main.keyState.GetPressedKeys(); + for (int index = 0; index < pressedKeys.Length; ++index) { - num1 = Main.SmartInteractX; - num2 = Main.SmartInteractY; + if (pressedKeys[index] == Keys.LeftShift || pressedKeys[index] == Keys.RightShift) + flag1 = true; + else if (pressedKeys[index] == Keys.LeftAlt || pressedKeys[index] == Keys.RightAlt) + flag2 = true; + } + string blockKey = Main.blockKey; + Keys keys = Keys.None; + string str1 = keys.ToString(); + if (blockKey != str1) + { + bool flag3 = false; + for (int index = 0; index < pressedKeys.Length; ++index) + { + if (pressedKeys[index].ToString() == Main.blockKey) + { + pressedKeys[index] = Keys.None; + flag3 = true; + } + } + if (!flag3) + { + keys = Keys.None; + Main.blockKey = keys.ToString(); + } + } + for (int index = 0; index < pressedKeys.Length; ++index) + { + string str2 = string.Concat((object) pressedKeys[index]); + if (pressedKeys[index] != Keys.Tab || ((!flag1 ? 0 : (SocialAPI.Mode == SocialMode.Steam ? 1 : 0)) | (flag2 ? 1 : 0)) == 0) + { + if (str2 == Main.cUp) + this.controlUp = true; + if (str2 == Main.cLeft) + this.controlLeft = true; + if (str2 == Main.cDown) + this.controlDown = true; + if (str2 == Main.cRight) + this.controlRight = true; + if (str2 == Main.cJump) + this.controlJump = true; + if (str2 == Main.cThrowItem) + this.controlThrow = true; + if (str2 == Main.cInv) + this.controlInv = true; + if (str2 == Main.cBuff) + this.QuickBuff(); + if (str2 == Main.cHeal) + this.controlQuickHeal = true; + if (str2 == Main.cMana) + this.controlQuickMana = true; + if (str2 == Main.cHook) + this.controlHook = true; + if (str2 == Main.cTorch) + this.controlTorch = true; + if (str2 == Main.cSmart) + this.controlSmart = true; + if (str2 == Main.cMount) + this.controlMount = true; + if (Main.mapEnabled) + { + if (str2 == Main.cMapZoomIn) + this.mapZoomIn = true; + if (str2 == Main.cMapZoomOut) + this.mapZoomOut = true; + if (str2 == Main.cMapAlphaUp) + this.mapAlphaUp = true; + if (str2 == Main.cMapAlphaDown) + this.mapAlphaDown = true; + if (str2 == Main.cMapFull) + this.mapFullScreen = true; + if (str2 == Main.cMapStyle) + this.mapStyle = true; + } + } + } + if (Main.gamePad) + { + GamePadState state = GamePad.GetState(PlayerIndex.One); + GamePadDPad dpad = state.DPad; + if (dpad.Up == ButtonState.Pressed) + this.controlUp = true; + dpad = state.DPad; + if (dpad.Down == ButtonState.Pressed) + this.controlDown = true; + dpad = state.DPad; + if (dpad.Left == ButtonState.Pressed) + this.controlLeft = true; + dpad = state.DPad; + if (dpad.Right == ButtonState.Pressed) + this.controlRight = true; + GamePadTriggers triggers = state.Triggers; + if ((double) triggers.Left > 0.0) + this.controlJump = true; + triggers = state.Triggers; + if ((double) triggers.Right > 0.0) + this.controlUseItem = true; + Main.mouseX = (int) ((double) (Main.screenWidth / 2) + (double) state.ThumbSticks.Right.X * (double) Player.tileRangeX * 16.0); + Main.mouseY = (int) ((double) (Main.screenHeight / 2) - (double) state.ThumbSticks.Right.Y * (double) Player.tileRangeX * 16.0); + if ((double) state.ThumbSticks.Right.X == 0.0) + Main.mouseX = Main.screenWidth / 2 + this.direction * 2; + } + if (Main.mouseLeft) + { + if (!Main.blockMouse && !this.mouseInterface) + this.controlUseItem = true; + } + else + Main.blockMouse = false; + if (!Main.mouseRight || this.mouseInterface || Main.blockMouse) + return; + this.controlUseTile = true; + } + + private void LookForTileInteractions() + { + if (Main.mapFullscreen) + return; + int myX = Player.tileTargetX; + int myY = Player.tileTargetY; + if (Main.SmartInteractShowingGenuine && Main.SmartInteractNPC == -1) + { + myX = Main.SmartInteractX; + myY = Main.SmartInteractY; } bool flag = this.controlUseTile; if (PlayerInput.UsingGamepad && Main.HoveringOverAnNPC) flag = false; - if (Main.gamePaused) - flag = false; if (this.releaseUseTile) this.tileInteractionHappened = false; this.tileInteractAttempted = flag; - if (this.tileInteractAttempted && this.releaseUseTile) - { - if (Main.instance.currentNPCShowingChatBubble > -1 && (this.talkNPC == -1 || !Main.npcChatRelease)) - { - this.tileInteractAttempted = true; - this.releaseUseTile = false; - } - if (Main.HasInteractibleObjectThatIsNotATile) - { - this.tileInteractAttempted = true; - this.releaseUseTile = false; - } - } - if (this.IsInTileInteractionRange(num1, num2)) + if ((double) this.position.X / 16.0 - (double) Player.tileRangeX <= (double) myX && ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX - 1.0 >= (double) myX && (double) this.position.Y / 16.0 - (double) Player.tileRangeY <= (double) myY && ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY - 2.0 >= (double) myY) { this.TileInteractionsCheckLongDistance(Player.tileTargetX, Player.tileTargetY); - this.TileInteractionsCheck(num1, num2); + this.TileInteractionsCheck(myX, myY); } else - this.TileInteractionsCheckLongDistance(num1, num2); - this.TryInteractingWithMinecartTrackInNearbyArea(num1, num2); + this.TileInteractionsCheckLongDistance(myX, myY); } - private void TryInteractingWithMinecartTrackInNearbyArea( - int selectedTargetX, - int selectedTargetY) - { - if (this.mount.Active && MountID.Sets.Cart[this.mount.Type] || !this.botherWithUnaimedMinecartTracks || this.tileInteractionHappened || Main.SmartInteractShowingGenuine || Main.SmartInteractNPC != -1 || Main.SmartInteractProj != -1 || !WorldGen.InWorld(selectedTargetX, selectedTargetY, 10) || (double) this.gravDir != 1.0) - return; - int num = 2; - for (int index1 = selectedTargetX - num; index1 <= selectedTargetX + num; ++index1) - { - for (int index2 = selectedTargetY - num; index2 <= selectedTargetY + num; ++index2) - { - if (this.IsInTileInteractionRange(index1, index2)) - { - Tile tile = Main.tile[index1, index2]; - if (tile != null) - { - if (tile.active() && tile.type == (ushort) 314) - { - if (!this.cursorItemIconEnabled) - { - this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 2343; - } - if (this.tileInteractAttempted) - this.TileInteractionsCheck(index1, index2); - } - if (this.tileInteractionHappened) - return; - } - } - } - } - } - - public bool InInteractionRange(int interactX, int interactY) - { - int num1 = (int) (((double) this.position.X + (double) this.width * 0.5) / 16.0); - int num2 = (int) (((double) this.position.Y + (double) this.height * 0.5) / 16.0); - Tile tile = Main.tile[interactX, interactY]; - return tile.type == (ushort) 475 || tile.type == (ushort) 597 ? num1 >= interactX - Player.tileRangeX - 1 && num1 <= interactX + Player.tileRangeX + 2 && num2 >= interactY - Player.tileRangeY - 1 && num2 <= interactY + Player.tileRangeY + 2 : (tile.type == (ushort) 470 ? num1 >= interactX - Player.tileRangeX - 1 && num1 <= interactX + Player.tileRangeX + 1 && num2 >= interactY - Player.tileRangeY - 1 && num2 <= interactY + Player.tileRangeY + 2 : num1 >= interactX - Player.tileRangeX && num1 <= interactX + Player.tileRangeX + 1 && num2 >= interactY - Player.tileRangeY && num2 <= interactY + Player.tileRangeY + 1); - } - - public bool IsInTileInteractionRange(int targetX, int targetY) => (double) this.position.X / 16.0 - (double) Player.tileRangeX <= (double) targetX && ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX - 1.0 >= (double) targetX && (double) this.position.Y / 16.0 - (double) Player.tileRangeY <= (double) targetY && ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY - 2.0 >= (double) targetY; - public void TileInteractionsCheck(int myX, int myY) { if (Main.tile[myX, myY] == null) @@ -19930,15 +14653,15 @@ label_15: private void TileInteractionsCheckLongDistance(int myX, int myY) { - if (!WorldGen.InWorld(myX, myY, 10) || Main.tile[myX, myY] == null || !Main.tile[myX, myY].active()) - return; - if (TileID.Sets.BasicChest[(int) Main.tile[myX, myY].type]) + if (Main.tile[myX, myY] == null) + Main.tile[myX, myY] = new Tile(); + if (Main.tile[myX, myY].type == (ushort) 21) { this.TileInteractionsMouseOver_Containers(myX, myY); - if (this.cursorItemIconText == "") + if (this.showItemIconText == "") { - this.cursorItemIconEnabled = false; - this.cursorItemIconID = 0; + this.showItemIcon = false; + this.showItemIcon2 = 0; } } if (Main.tile[myX, myY].type == (ushort) 88) @@ -19952,26 +14675,26 @@ label_15: --num2; int Y = num2; int chest = Chest.FindChest(X, Y); - this.cursorItemIconID = -1; + this.showItemIcon2 = -1; if (chest < 0) { - this.cursorItemIconText = Lang.dresserType[0].Value; + this.showItemIconText = Lang.dresserType[0].Value; } else { - this.cursorItemIconText = !(Main.chest[chest].name != "") ? Lang.dresserType[(int) tile.frameX / 54].Value : Main.chest[chest].name; - if (this.cursorItemIconText == Lang.dresserType[(int) tile.frameX / 54].Value) + this.showItemIconText = !(Main.chest[chest].name != "") ? Lang.dresserType[(int) tile.frameX / 54].Value : Main.chest[chest].name; + if (this.showItemIconText == Lang.dresserType[(int) tile.frameX / 54].Value) { - this.cursorItemIconID = Chest.dresserTypeToIcon[(int) tile.frameX / 54]; - this.cursorItemIconText = ""; + this.showItemIcon2 = Chest.dresserTypeToIcon[(int) tile.frameX / 54]; + this.showItemIconText = ""; } } this.noThrow = 2; - this.cursorItemIconEnabled = true; - if (this.cursorItemIconText == "") + this.showItemIcon = true; + if (this.showItemIconText == "") { - this.cursorItemIconEnabled = false; - this.cursorItemIconID = 0; + this.showItemIcon = false; + this.showItemIcon2 = 0; } } if (!Main.tileSign[(int) Main.tile[myX, myY].type]) @@ -19985,12 +14708,12 @@ label_15: Main.signBubble = true; Main.signX = i * 16 + 16; Main.signY = j * 16; - int num7 = Sign.ReadSign(i, j, false); - if (num7 == -1 || Player.tileTargetX < i || Player.tileTargetY < j || Player.tileTargetX > i + 1 || Player.tileTargetY > j + 1) + int num7 = Sign.ReadSign(i, j); + if (num7 == -1) return; Main.signHover = num7; - this.cursorItemIconEnabled = false; - this.cursorItemIconID = -1; + this.showItemIcon = false; + this.showItemIcon2 = -1; } private void TileInteractionsUse(int myX, int myY) @@ -20021,7 +14744,7 @@ label_15: { flag1 = true; this.launcherWait = 10; - SoundEngine.PlaySound(SoundID.Item11, this.position); + Main.PlaySound(SoundID.Item11, this.position); int num1 = (int) Main.tile[index1, index2].frameX / 18; int num2 = 0; for (; num1 >= 3; num1 -= 3) @@ -20051,8 +14774,7 @@ label_15: float num12 = (float) (num6 / num11); float SpeedX = num9 * num12; float SpeedY = num10 * num12; - int index4 = Projectile.NewProjectile(vector2.X, vector2.Y, SpeedX, SpeedY, Type, Damage, KnockBack, Main.myPlayer); - Main.projectile[index4].originatedFromActivableTile = true; + Projectile.NewProjectile(vector2.X, vector2.Y, SpeedX, SpeedY, Type, Damage, KnockBack, Main.myPlayer); } } if (releaseUseTile) @@ -20063,11 +14785,6 @@ label_15: Wiring.HitSwitch(myX, myY); NetMessage.SendData(59, number: myX, number2: ((float) myY)); } - else if (Main.tile[myX, myY].type == (ushort) 597) - { - flag1 = true; - this.TryOpeningFullscreenMap(); - } else if (Main.tile[myX, myY].type == (ushort) 441 || Main.tile[myX, myY].type == (ushort) 468) { flag1 = true; @@ -20084,44 +14801,44 @@ label_15: else if (Main.tile[myX, myY].type == (ushort) 139) { flag1 = true; - SoundEngine.PlaySound(28, myX * 16, myY * 16, 0); + Main.PlaySound(28, myX * 16, myY * 16, 0); WorldGen.SwitchMB(myX, myY); } else if (Main.tile[myX, myY].type == (ushort) 215) { flag1 = true; - SoundEngine.PlaySound(28, myX * 16, myY * 16, 0); + Main.PlaySound(28, myX * 16, myY * 16, 0); int num16 = (int) Main.tile[myX, myY].frameX % 54 / 18; int num17 = (int) Main.tile[myX, myY].frameY % 36 / 18; - int index5 = myX - num16; - int index6 = myY - num17; + int index4 = myX - num16; + int index5 = myY - num17; int num18 = 36; - if (Main.tile[index5, index6].frameY >= (short) 36) + if (Main.tile[index4, index5].frameY >= (short) 36) num18 = -36; - for (int index7 = index5; index7 < index5 + 3; ++index7) + for (int index6 = index4; index6 < index4 + 3; ++index6) { - for (int index8 = index6; index8 < index6 + 2; ++index8) - Main.tile[index7, index8].frameY += (short) num18; + for (int index7 = index5; index7 < index5 + 2; ++index7) + Main.tile[index6, index7].frameY += (short) num18; } - NetMessage.SendTileSquare(-1, index5 + 1, index6 + 1, 3); + NetMessage.SendTileSquare(-1, index4 + 1, index5 + 1, 3); } else if (Main.tile[myX, myY].type == (ushort) 207) { flag1 = true; - SoundEngine.PlaySound(28, myX * 16, myY * 16, 0); + Main.PlaySound(28, myX * 16, myY * 16, 0); WorldGen.SwitchFountain(myX, myY); } - else if (Main.tile[myX, myY].type == (ushort) 410 || Main.tile[myX, myY].type == (ushort) 480 || Main.tile[myX, myY].type == (ushort) 509) + else if (Main.tile[myX, myY].type == (ushort) 410) { flag1 = true; - SoundEngine.PlaySound(28, myX * 16, myY * 16, 0); + Main.PlaySound(28, myX * 16, myY * 16, 0); this.GamepadEnableGrappleCooldown(); WorldGen.SwitchMonolith(myX, myY); } else if (Main.tile[myX, myY].type == (ushort) 455) { flag1 = true; - SoundEngine.PlaySound(28, myX * 16, myY * 16, 0); + Main.PlaySound(28, myX * 16, myY * 16, 0); this.GamepadEnableGrappleCooldown(); BirthdayParty.ToggleManualParty(); } @@ -20144,26 +14861,8 @@ label_15: { flag1 = true; bool closing = Main.tile[myX, myY].type == (ushort) 389; - if (WorldGen.ShiftTallGate(myX, myY, closing)) - NetMessage.SendData(19, number: (4 + closing.ToInt()), number2: ((float) myX), number3: ((float) myY)); - } - else if (Main.tile[myX, myY].type == (ushort) 15 || Main.tile[myX, myY].type == (ushort) 497) - { - if (this.IsWithinSnappngRangeToTile(myX, myY, 40)) - { - flag1 = true; - this.GamepadEnableGrappleCooldown(); - this.sitting.SitDown(this, myX, myY); - } - } - else if (Main.tile[myX, myY].type == (ushort) 89 || Main.tile[myX, myY].type == (ushort) 102 || Main.tile[myX, myY].type == (ushort) 487) - { - if (this.IsWithinSnappngRangeToTile(myX, myY, 40)) - { - flag1 = true; - this.GamepadEnableGrappleCooldown(); - this.sitting.SitDown(this, myX, myY); - } + WorldGen.ShiftTallGate(myX, myY, closing); + NetMessage.SendData(19, number: (4 + closing.ToInt()), number2: ((float) myX), number3: ((float) myY)); } else if (Main.tile[myX, myY].type == (ushort) 335) { @@ -20176,58 +14875,32 @@ label_15: Wiring.HitSwitch(myX, myY); NetMessage.SendData(59, number: myX, number2: ((float) myY)); } - else if (Main.tile[myX, myY].type == (ushort) 494) - { - flag1 = true; - for (int index = 0; index < 1000; ++index) - { - if (ProjectileID.Sets.IsAGolfBall[Main.projectile[index].type] && Main.projectile[index].owner == this.whoAmI) - Main.projectile[index].Kill(); - } - int projType; - this.GetPreferredGolfBallToUse(out projType); - Projectile.NewProjectile((float) (myX * 16) + 8.5f, (float) (myY * 16 + 6), 0.0f, 0.0f, projType, 0, 0.0f, this.whoAmI, ai1: -1f); - } else if (Main.tile[myX, myY].type == (ushort) 338) { flag1 = true; - int index9 = myX; - int index10 = myY; - if (Main.tile[index9, index10].frameY == (short) 18) - --index10; + int index8 = myX; + int index9 = myY; + if (Main.tile[index8, index9].frameY == (short) 18) + --index9; bool flag4 = false; - for (int index11 = 0; index11 < 1000; ++index11) + for (int index10 = 0; index10 < 1000; ++index10) { - if (Main.projectile[index11].active && Main.projectile[index11].aiStyle == 73 && (double) Main.projectile[index11].ai[0] == (double) index9 && (double) Main.projectile[index11].ai[1] == (double) index10) + if (Main.projectile[index10].active && Main.projectile[index10].aiStyle == 73 && (double) Main.projectile[index10].ai[0] == (double) index8 && (double) Main.projectile[index10].ai[1] == (double) index9) { flag4 = true; break; } } if (!flag4) - { - int index12 = Projectile.NewProjectile((float) (index9 * 16 + 8), (float) (index10 * 16 + 2), 0.0f, 0.0f, 419 + Main.rand.Next(4), 0, 0.0f, this.whoAmI, (float) index9, (float) index10); - Main.projectile[index12].originatedFromActivableTile = true; - } + Projectile.NewProjectile((float) (index8 * 16 + 8), (float) (index9 * 16 + 2), 0.0f, 0.0f, 419 + Main.rand.Next(4), 0, 0.0f, this.whoAmI, (float) index8, (float) index9); } - else if (Main.tile[myX, myY].type == (ushort) 33 || Main.tile[myX, myY].type == (ushort) 49 || Main.tile[myX, myY].type == (ushort) 372 || Main.tile[myX, myY].type == (ushort) 174) + else if (Main.tile[myX, myY].type == (ushort) 4 || Main.tile[myX, myY].type == (ushort) 13 || Main.tile[myX, myY].type == (ushort) 33 || Main.tile[myX, myY].type == (ushort) 49 || Main.tile[myX, myY].type == (ushort) 50 && Main.tile[myX, myY].frameX == (short) 90 || Main.tile[myX, myY].type == (ushort) 174) { - short num = 18; - Tile tile = Main.tile[myX, myY]; - if (tile.frameX > (short) 0) - num = (short) -18; - tile.frameX += num; - NetMessage.SendTileSquare(-1, myX, myY, 1); flag1 = true; - this.GamepadEnableGrappleCooldown(); - } - else if (Main.tile[myX, myY].type == (ushort) 4 || Main.tile[myX, myY].type == (ushort) 13 || Main.tile[myX, myY].type == (ushort) 50 && Main.tile[myX, myY].frameX == (short) 90) - { WorldGen.KillTile(myX, myY); + this.GamepadEnableGrappleCooldown(); if (Main.netMode == 1) NetMessage.SendData(17, number2: ((float) myX), number3: ((float) myY)); - flag1 = true; - this.GamepadEnableGrappleCooldown(); } else if (Main.tile[myX, myY].type == (ushort) 466) { @@ -20364,57 +15037,52 @@ label_15: else if (Main.tile[myX, myY].type == (ushort) 395) { flag1 = true; - TEItemFrame.OnPlayerInteraction(this, myX, myY); - } - else if (Main.tile[myX, myY].type == (ushort) 520) - { - flag1 = true; - TEFoodPlatter.OnPlayerInteraction(this, myX, myY); - } - else if (Main.tile[myX, myY].type == (ushort) 471) - { - flag1 = true; - TEWeaponsRack.OnPlayerInteraction(this, myX, myY); - } - else if (Main.tile[myX, myY].type == (ushort) 470) - { - flag1 = true; - TEDisplayDoll.OnPlayerInteraction(this, myX, myY); - } - else if (Main.tile[myX, myY].type == (ushort) 475) - { - flag1 = true; - TEHatRack.OnPlayerInteraction(this, myX, myY); + if (this.ItemFitsItemFrame(this.inventory[this.selectedItem]) && !this.inventory[this.selectedItem].favorited) + { + this.GamepadEnableGrappleCooldown(); + this.PlaceItemInFrame(myX, myY); + } + else + { + int x = myX; + int index = myY; + if ((int) Main.tile[x, index].frameX % 36 != 0) + --x; + if ((int) Main.tile[x, index].frameY % 36 != 0) + --index; + int key = TEItemFrame.Find(x, index); + if (key != -1 && ((TEItemFrame) TileEntity.ByID[key]).item.stack > 0) + { + this.GamepadEnableGrappleCooldown(); + WorldGen.KillTile(myX, index, true); + if (Main.netMode == 1) + NetMessage.SendData(17, number2: ((float) myX), number3: ((float) index), number4: 1f); + } + } } else if (Main.tile[myX, myY].type == (ushort) 125) { flag1 = true; this.AddBuff(29, 36000); - SoundEngine.PlaySound(SoundID.Item4, this.position); - } - else if (Main.tile[myX, myY].type == (ushort) 621) - { - flag1 = true; - this.AddBuff(192, 7200); - SoundEngine.PlaySound(SoundID.Item2, this.position); + Main.PlaySound(SoundID.Item4, this.position); } else if (Main.tile[myX, myY].type == (ushort) 377) { flag1 = true; this.AddBuff(159, 36000); - SoundEngine.PlaySound(SoundID.Item37, this.position); + Main.PlaySound(SoundID.Item37, this.position); } else if (Main.tile[myX, myY].type == (ushort) 354) { flag1 = true; this.AddBuff(150, 36000); - SoundEngine.PlaySound(SoundID.Item4, this.position); + Main.PlaySound(SoundID.Item4, this.position); } else if (Main.tile[myX, myY].type == (ushort) 287) { flag1 = true; this.AddBuff(93, 36000); - SoundEngine.PlaySound(SoundID.Item149, this.position); + Main.PlaySound(7, (int) this.position.X, (int) this.position.Y); } else if (Main.tile[myX, myY].type == (ushort) 356) { @@ -20422,7 +15090,7 @@ label_15: if (!Main.fastForwardTime && (Main.netMode == 1 || Main.sundialCooldown == 0)) { Main.Sundialing(); - SoundEngine.PlaySound(SoundID.Item4, this.position); + Main.PlaySound(SoundID.Item4, this.position); } } else if (Main.tile[myX, myY].type == (ushort) 79) @@ -20440,54 +15108,40 @@ label_15: ++num32; } int y = num29 - num31 + 2; - if (!Player.IsHoveringOverABottomSideOfABed(myX, myY)) + this.FindSpawn(); + if (this.SpawnX == x && this.SpawnY == y) { - if (this.IsWithinSnappngRangeToTile(myX, myY, 96)) - { - flag1 = true; - this.GamepadEnableGrappleCooldown(); - this.sleeping.StartSleeping(this, myX, myY); - } + this.RemoveSpawn(); + Main.NewText(Language.GetTextValue("Game.SpawnPointRemoved"), G: (byte) 240, B: (byte) 20); } - else + else if (Player.CheckSpawn(x, y)) { - this.FindSpawn(); - if (this.SpawnX == x && this.SpawnY == y) - { - this.RemoveSpawn(); - Main.NewText(Language.GetTextValue("Game.SpawnPointRemoved"), G: (byte) 240, B: (byte) 20); - } - else if (Player.CheckSpawn(x, y)) - { - this.ChangeSpawn(x, y); - Main.NewText(Language.GetTextValue("Game.SpawnPointSet"), G: (byte) 240, B: (byte) 20); - } + this.ChangeSpawn(x, y); + Main.NewText(Language.GetTextValue("Game.SpawnPointSet"), G: (byte) 240, B: (byte) 20); } } else if (Main.tileSign[(int) Main.tile[myX, myY].type]) { flag1 = true; bool flag6 = true; - if (this.sign >= 0 && Sign.ReadSign(myX, myY, false) == this.sign) + if (this.sign >= 0 && Sign.ReadSign(myX, myY) == this.sign) { this.sign = -1; Main.npcChatText = ""; Main.editSign = false; - SoundEngine.PlaySound(11); + Main.PlaySound(11); flag6 = false; } if (flag6) { if (Main.netMode == 0) { - this.SetTalkNPC(-1); + this.talkNPC = -1; Main.npcChatCornerItem = 0; Main.playerInventory = false; Main.editSign = false; + Main.PlaySound(10); int index = Sign.ReadSign(myX, myY); - if (index < 0) - return; - SoundEngine.PlaySound(10); this.sign = index; Main.npcChatText = Main.sign[index].text; } @@ -20507,7 +15161,7 @@ label_15: else if (Main.tile[myX, myY].type == (ushort) 104) { flag1 = true; - string textValue = Language.GetTextValue("GameUI.TimeAtMorning"); + string str1 = "AM"; double time = Main.time; if (!Main.dayTime) time += 54000.0; @@ -20515,17 +15169,17 @@ label_15: if (num35 < 0.0) num35 += 24.0; if (num35 >= 12.0) - textValue = Language.GetTextValue("GameUI.TimePastMorning"); + str1 = "PM"; int num36 = (int) num35; double num37 = (double) (int) ((num35 - (double) num36) * 60.0); - string str = string.Concat((object) num37); + string str2 = string.Concat((object) num37); if (num37 < 10.0) - str = "0" + str; + str2 = "0" + str2; if (num36 > 12) num36 -= 12; if (num36 == 0) num36 = 12; - Main.NewText(Language.GetTextValue("Game.Time", (object) (num36.ToString() + ":" + str + " " + textValue)), G: (byte) 240, B: (byte) 20); + Main.NewText(Language.GetTextValue("Game.Time", (object) (num36.ToString() + ":" + str2 + " " + str1)), G: (byte) 240, B: (byte) 20); } else if (Main.tile[myX, myY].type == (ushort) 237) { @@ -20547,7 +15201,7 @@ label_15: } if (flag7) { - SoundEngine.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); + Main.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); if (Main.netMode != 1) NPC.SpawnOnPlayer(this.whoAmI, 245); else @@ -20578,16 +15232,7 @@ label_15: else { WorldGen.OpenDoor(myX, myY, this.direction); - if (Main.tile[myX, myY].type != (ushort) 10) - { - NetMessage.SendData(19, number2: ((float) myX), number3: ((float) myY), number4: ((float) this.direction)); - } - else - { - WorldGen.OpenDoor(myX, myY, -this.direction); - if (Main.tile[myX, myY].type != (ushort) 10) - NetMessage.SendData(19, number2: ((float) myX), number3: ((float) myY), number4: ((float) -this.direction)); - } + NetMessage.SendData(19, number2: ((float) myX), number3: ((float) myY), number4: ((float) this.direction)); } } else if (Main.tile[myX, myY].type == (ushort) 11) @@ -20599,20 +15244,23 @@ label_15: else if (Main.tile[myX, myY].type == (ushort) 88) { flag1 = true; - int num41 = (int) Main.tile[myX, myY].frameX / 18 % 3; - int num42 = myX - num41; - int num43 = myY - (int) Main.tile[myX, myY].frameY / 18; if (Main.tile[myX, myY].frameY == (short) 0) { Main.CancelClothesWindow(true); Main.mouseRightRelease = false; - this.CloseSign(); - this.SetTalkNPC(-1); - Main.npcChatCornerItem = 0; - Main.npcChatText = ""; + int num41 = (int) Main.tile[myX, myY].frameX / 18 % 3; + int num42 = myX - num41; + int Y = myY - (int) Main.tile[myX, myY].frameY / 18; + if (this.sign > -1) + { + Main.PlaySound(11); + this.sign = -1; + Main.editSign = false; + Main.npcChatText = string.Empty; + } if (Main.editChest) { - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.editChest = false; Main.npcChatText = string.Empty; } @@ -20623,23 +15271,22 @@ label_15: } if (Main.netMode == 1) { - if (num42 == this.chestX && num43 == this.chestY && this.chest != -1) + if (num42 == this.chestX && Y == this.chestY && this.chest != -1) { this.chest = -1; Recipe.FindRecipes(); - SoundEngine.PlaySound(11); + Main.PlaySound(11); } else { - NetMessage.SendData(31, number: num42, number2: ((float) num43)); + NetMessage.SendData(31, number: num42, number2: ((float) Y)); Main.stackSplit = 600; } } else { this.flyingPigChest = -1; - this.voidLensChest = -1; - int chest = Chest.FindChest(num42, num43); + int chest = Chest.FindChest(num42, Y); if (chest != -1) { Main.stackSplit = 600; @@ -20647,17 +15294,29 @@ label_15: { this.chest = -1; Recipe.FindRecipes(); - SoundEngine.PlaySound(11); + Main.PlaySound(11); } else if (chest != this.chest && this.chest == -1) { - this.OpenChest(num42, num43, chest); - SoundEngine.PlaySound(10); + this.chest = chest; + Main.playerInventory = true; + if (PlayerInput.GrappleAndInteractAreShared) + PlayerInput.Triggers.JustPressed.Grapple = false; + Main.recBigList = false; + Main.PlaySound(10); + this.chestX = num42; + this.chestY = Y; } else { - this.OpenChest(num42, num43, chest); - SoundEngine.PlaySound(12); + this.chest = chest; + Main.playerInventory = true; + if (PlayerInput.GrappleAndInteractAreShared) + PlayerInput.Triggers.JustPressed.Grapple = false; + Main.recBigList = false; + Main.PlaySound(12); + this.chestX = num42; + this.chestY = Y; } Recipe.FindRecipes(); } @@ -20668,11 +15327,8 @@ label_15: Main.playerInventory = false; this.chest = -1; Recipe.FindRecipes(); - this.SetTalkNPC(-1); - Main.npcChatCornerItem = 0; - Main.npcChatText = ""; - Main.interactedDresserTopLeftX = num42; - Main.interactedDresserTopLeftY = num43; + Main.dresserX = myX; + Main.dresserY = myY; Main.OpenClothesWindow(); } } @@ -20680,126 +15336,88 @@ label_15: { flag1 = true; Tile tile = Main.tile[myX, myY]; - int num44 = (int) tile.frameX % 72 / 18; - int num45 = (int) tile.frameY % 54 / 18; - int x = myX - num44; - int y = myY - num45; + int num43 = (int) tile.frameX % 72 / 18; + int num44 = (int) tile.frameY % 54 / 18; + int x = myX - num43; + int y = myY - num44; int angle = (int) tile.frameY / 54; - int num46 = (int) tile.frameX / 72; - int num47 = -1; - if (num44 == 1 || num44 == 2) - num47 = num45; - int num48 = 0; - if (num44 == 3 || num44 == 2 && num46 != 3 && num46 != 4) - num48 = -54; - if (num44 == 0 || num44 == 1 && num46 != 3 && num46 != 4) - num48 = 54; - if (angle >= 8 && num48 > 0) - num48 = 0; - if (angle == 0 && num48 < 0) - num48 = 0; + int num45 = (int) tile.frameX / 72; + int num46 = -1; + if (num43 == 1 || num43 == 2) + num46 = num44; + int num47 = 0; + if (num43 == 3 || num43 == 2 && num45 != 3 && num45 != 4) + num47 = -54; + if (num43 == 0 || num43 == 1 && num45 != 3 && num45 != 4) + num47 = 54; + if (angle >= 8 && num47 > 0) + num47 = 0; + if (angle == 0 && num47 < 0) + num47 = 0; bool flag8 = false; - if (num48 != 0) + if (num47 != 0) { - for (int index13 = x; index13 < x + 4; ++index13) + for (int index11 = x; index11 < x + 4; ++index11) { - for (int index14 = y; index14 < y + 3; ++index14) - Main.tile[index13, index14].frameY += (short) num48; + for (int index12 = y; index12 < y + 3; ++index12) + Main.tile[index11, index12].frameY += (short) num47; } flag8 = true; } - if ((num46 == 3 || num46 == 4) && (num47 == 1 || num47 == 0)) + if ((num45 == 3 || num45 == 4) && (num46 == 1 || num46 == 0)) { - int num49 = num46 == 3 ? 72 : -72; - for (int index15 = x; index15 < x + 4; ++index15) + int num48 = num45 == 3 ? 72 : -72; + for (int index13 = x; index13 < x + 4; ++index13) { - for (int index16 = y; index16 < y + 3; ++index16) - Main.tile[index15, index16].frameX += (short) num49; + for (int index14 = y; index14 < y + 3; ++index14) + Main.tile[index13, index14].frameX += (short) num48; } flag8 = true; } if (flag8) NetMessage.SendTileSquare(-1, x + 1, y + 1, 4); - if (num47 != -1) + if (num46 != -1) { bool flag9 = false; - if ((num46 == 3 || num46 == 4) && num47 == 2) + if ((num45 == 3 || num45 == 4) && num46 == 2) flag9 = true; if (flag9) - WorldGen.ShootFromCannon(x, y, angle, num46 + 1, 0, 0.0f, this.whoAmI); + WorldGen.ShootFromCannon(x, y, angle, num45 + 1, 0, 0.0f, this.whoAmI); } } - else if (Main.tile[myX, myY].type == (ushort) 510 || Main.tile[myX, myY].type == (ushort) 511) - { - flag1 = true; - Tile tile = Main.tile[myX, myY]; - int num50 = (int) tile.frameX % 36 / 18; - int num51 = (int) tile.frameY % 36 / 18; - int tileX = myX - num50; - int tileY = myY - num51; - int num52 = (int) tile.frameY / 36; - int num53 = (int) tile.frameX / 36; - int num54 = 0; - if (num50 == 0) - num54 = -36; - if (num50 == 1) - num54 = 36; - if (num52 >= 7 && num54 > 0) - num54 = -252; - if (num52 == 0 && num54 < 0) - num54 = 252; - bool flag10 = false; - if (num54 != 0) - { - for (int index17 = tileX; index17 < tileX + 2; ++index17) - { - for (int index18 = tileY; index18 < tileY + 2; ++index18) - Main.tile[index17, index18].frameY += (short) num54; - } - flag10 = true; - } - if (flag10) - NetMessage.SendTileSquare(-1, tileX, tileY, 3); - } - else if (TileID.Sets.BasicChest[(int) Main.tile[myX, myY].type] || Main.tile[myX, myY].type == (ushort) 29 || Main.tile[myX, myY].type == (ushort) 97 || Main.tile[myX, myY].type == (ushort) 463 || Main.tile[myX, myY].type == (ushort) 491) + else if ((TileID.Sets.BasicChest[(int) Main.tile[myX, myY].type] || Main.tile[myX, myY].type == (ushort) 29 || Main.tile[myX, myY].type == (ushort) 97 || Main.tile[myX, myY].type == (ushort) 463) && this.talkNPC == -1) { flag1 = true; Main.mouseRightRelease = false; - int num55 = 0; - int num56 = (int) Main.tile[myX, myY].frameX / 18; - while (num56 > 1) - num56 -= 2; - int index19 = myX - num56; - int index20 = myY - (int) Main.tile[myX, myY].frameY / 18; + int num49 = 0; + int num50 = (int) Main.tile[myX, myY].frameX / 18; + while (num50 > 1) + num50 -= 2; + int index15 = myX - num50; + int index16 = myY - (int) Main.tile[myX, myY].frameY / 18; if (Main.tile[myX, myY].type == (ushort) 29) - num55 = 1; + num49 = 1; else if (Main.tile[myX, myY].type == (ushort) 97) - num55 = 2; + num49 = 2; else if (Main.tile[myX, myY].type == (ushort) 463) { - num55 = 3; + num49 = 3; if (Main.tile[myX, myY].frameX == (short) 36) - --index19; + --index15; else - ++index19; - index20 += 2; + ++index15; + index16 += 2; } - else if (Main.tile[myX, myY].type == (ushort) 491) + if (this.sign > -1) { - num55 = 4; - if (Main.tile[myX, myY].frameX == (short) 36) - --index19; - else - ++index19; - index20 += 2; + Main.PlaySound(11); + this.sign = -1; + Main.editSign = false; + Main.npcChatText = string.Empty; } - this.CloseSign(); - this.SetTalkNPC(-1); - Main.npcChatCornerItem = 0; - Main.npcChatText = ""; if (Main.editChest) { - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.editChest = false; Main.npcChatText = string.Empty; } @@ -20808,118 +15426,106 @@ label_15: NetMessage.SendData(33, text: NetworkText.FromLiteral(Main.chest[this.chest].name), number: this.chest, number2: 1f); this.editedChestName = false; } - bool flag11 = Chest.IsLocked(Main.tile[index19, index20]); - if (Main.netMode == 1 && num55 == 0 && !flag11) + if (Main.netMode == 1 && num49 == 0 && (Main.tile[index15, index16].frameX < (short) 72 || Main.tile[index15, index16].frameX > (short) 106) && (Main.tile[index15, index16].frameX < (short) 144 || Main.tile[index15, index16].frameX > (short) 178) && (Main.tile[index15, index16].frameX < (short) 828 || Main.tile[index15, index16].frameX > (short) 1006) && (Main.tile[index15, index16].frameX < (short) 1296 || Main.tile[index15, index16].frameX > (short) 1330) && (Main.tile[index15, index16].frameX < (short) 1368 || Main.tile[index15, index16].frameX > (short) 1402) && (Main.tile[index15, index16].frameX < (short) 1440 || Main.tile[index15, index16].frameX > (short) 1474)) { - if (index19 == this.chestX && index20 == this.chestY && this.chest != -1) + if (index15 == this.chestX && index16 == this.chestY && this.chest != -1) { this.chest = -1; Recipe.FindRecipes(); - SoundEngine.PlaySound(11); + Main.PlaySound(11); } else { - NetMessage.SendData(31, number: index19, number2: ((float) index20)); + NetMessage.SendData(31, number: index15, number2: ((float) index16)); Main.stackSplit = 600; } } else { - int newChest = -1; - switch (num55) + int num51 = -1; + switch (num49) { case 1: - newChest = -2; + num51 = -2; break; case 2: - newChest = -3; + num51 = -3; break; case 3: - newChest = -4; - break; - case 4: - newChest = -5; + num51 = -4; break; default: - bool flag12 = false; - if (Chest.IsLocked(index19, index20)) + bool flag10 = false; + if (Chest.isLocked(index15, index16)) { - int type = (int) Main.tile[index19, index20].type; - int num57 = 327; - switch (type) + int num52 = 327; + if (Main.tile[index15, index16].frameX >= (short) 144 && Main.tile[index15, index16].frameX <= (short) 178) + num52 = 329; + if (Main.tile[index15, index16].frameX >= (short) 828 && Main.tile[index15, index16].frameX <= (short) 1006) { - case 21: - if (Main.tile[index19, index20].frameX >= (short) 144 && Main.tile[index19, index20].frameX <= (short) 178) - num57 = 329; - if (Main.tile[index19, index20].frameX >= (short) 828 && Main.tile[index19, index20].frameX <= (short) 1006) - { - int num58 = (int) Main.tile[index19, index20].frameX / 18; - int num59 = 0; - while (num58 >= 2) - { - num58 -= 2; - ++num59; - } - num57 = 1533 + (num59 - 23); - break; - } - break; - case 467: - if ((int) Main.tile[index19, index20].frameX / 36 == 13) - { - num57 = 4714; - break; - } - break; - } - flag12 = true; - for (int index21 = 0; index21 < 58; ++index21) - { - if (this.inventory[index21].type == num57 && this.inventory[index21].stack > 0 && Chest.Unlock(index19, index20)) + int num53 = (int) Main.tile[index15, index16].frameX / 18; + int num54 = 0; + while (num53 >= 2) { - if (num57 != 329) + num53 -= 2; + ++num54; + } + num52 = 1533 + (num54 - 23); + } + flag10 = true; + for (int index17 = 0; index17 < 58; ++index17) + { + if (this.inventory[index17].type == num52 && this.inventory[index17].stack > 0 && Chest.Unlock(index15, index16)) + { + if (num52 != 329) { - --this.inventory[index21].stack; - if (this.inventory[index21].stack <= 0) - this.inventory[index21] = new Item(); + --this.inventory[index17].stack; + if (this.inventory[index17].stack <= 0) + this.inventory[index17] = new Item(); } if (Main.netMode == 1) - NetMessage.SendData(52, number: this.whoAmI, number2: 1f, number3: ((float) index19), number4: ((float) index20)); + NetMessage.SendData(52, number: this.whoAmI, number2: 1f, number3: ((float) index15), number4: ((float) index16)); } } } - if (!flag12) + if (!flag10) { - newChest = Chest.FindChest(index19, index20); + num51 = Chest.FindChest(index15, index16); break; } break; } - if (newChest != -1) + if (num51 != -1) { Main.stackSplit = 600; - int num60 = WorldGen.IsChestRigged(index19, index20) ? 1 : 0; - if (newChest == this.chest) + if (num51 == this.chest) { this.chest = -1; - SoundEngine.PlaySound(11); + Main.PlaySound(11); } - else if (newChest != this.chest && this.chest == -1) + else if (num51 != this.chest && this.chest == -1) { - this.OpenChest(index19, index20, newChest); - SoundEngine.PlaySound(10); - if (Main.tile[index19, index20].frameX >= (short) 36 && Main.tile[index19, index20].frameX < (short) 72) + this.chest = num51; + Main.playerInventory = true; + if (PlayerInput.GrappleAndInteractAreShared) + PlayerInput.Triggers.JustPressed.Grapple = false; + Main.recBigList = false; + Main.PlaySound(10); + this.chestX = index15; + this.chestY = index16; + if (Main.tile[index15, index16].frameX >= (short) 36 && Main.tile[index15, index16].frameX < (short) 72) AchievementsHelper.HandleSpecialEvent(this, 16); } else { - this.OpenChest(index19, index20, newChest); - SoundEngine.PlaySound(12); - } - if (num60 != 0) - { - Wiring.HitSwitch(myX, myY); - NetMessage.SendData(59, number: myX, number2: ((float) myY)); + this.chest = num51; + Main.playerInventory = true; + if (PlayerInput.GrappleAndInteractAreShared) + PlayerInput.Triggers.JustPressed.Grapple = false; + Main.recBigList = false; + Main.PlaySound(12); + this.chestX = index15; + this.chestY = index16; } Recipe.FindRecipes(); } @@ -20928,15 +15534,15 @@ label_15: else if (Main.tile[myX, myY].type == (ushort) 314 && (double) this.gravDir == 1.0) { flag1 = true; - bool flag13 = true; + bool flag11 = true; if (this.mount.Active) { if (this.mount.Cart) - flag13 = false; + flag11 = false; else this.mount.Dismount(this); } - if (flag13) + if (flag11) this.LaunchMinecartHook(myX, myY); } } @@ -20945,186 +15551,11 @@ label_15: this.tileInteractionHappened = true; } - private static bool IsHoveringOverABottomSideOfABed(int myX, int myY) - { - int frameX = (int) Main.tile[myX, myY].frameX; - bool flag1 = frameX / 72 == 1; - bool flag2 = frameX % 72 < 36; - if (flag1) - flag2 = !flag2; - return flag2; - } - - public void PetAnimal(int animalNpcIndex) - { - int targetDirection; - Vector2 playerPositionWhenPetting; - bool isPetSmall; - this.GetPettingInfo(animalNpcIndex, out targetDirection, out playerPositionWhenPetting, out isPetSmall); - Vector2 vector2 = playerPositionWhenPetting.Floor(); - bool flag = this.CanSnapToPosition(vector2 - this.Bottom); - if (flag && !WorldGen.SolidTileAllowBottomSlope((int) vector2.X / 16, (int) vector2.Y / 16)) - flag = false; - if (!flag) - return; - if (this.isPettingAnimal && this.Bottom == vector2) - { - this.StopPettingAnimal(); - } - else - { - this.StopVanityActions(); - this.RemoveAllGrapplingHooks(); - if (this.mount.Active) - this.mount.Dismount(this); - this.Bottom = vector2; - this.ChangeDir(targetDirection); - this.isPettingAnimal = true; - this.isTheAnimalBeingPetSmall = isPetSmall; - this.velocity = Vector2.Zero; - this.gravDir = 1f; - } - } - - private void GetPettingInfo( - int animalNpcIndex, - out int targetDirection, - out Vector2 playerPositionWhenPetting, - out bool isPetSmall) - { - NPC npc = Main.npc[animalNpcIndex]; - targetDirection = (double) npc.Center.X > (double) this.Center.X ? 1 : -1; - isPetSmall = npc.type == 637 || npc.type == 656; - int num = 36; - switch (npc.type) - { - case 637: - num = 28; - break; - case 656: - num = 24; - break; - } - playerPositionWhenPetting = npc.Bottom + new Vector2((float) (-targetDirection * num), 0.0f); - } - - public bool CanSnapToPosition(Vector2 offset) - { - if (Collision.SolidCollision(this.position + offset, this.width, this.height)) - return false; - bool canSnapToPosition = Collision.CanHit(this.position, this.width, this.height, this.position + offset, this.width, this.height); - if (!canSnapToPosition) - { - this.TryAllowingSnappingToPosition(ref canSnapToPosition, this.position, this.position + offset); - if (!canSnapToPosition) - { - int num = Math.Sign(offset.X); - if (num != 0) - { - Vector2 Velocity = new Vector2((float) (num * this.width), 0.0f); - if (Collision.TileCollision(this.position, Velocity, this.width, this.height, true, true, (int) this.gravDir) == Velocity) - this.TryAllowingSnappingToPosition(ref canSnapToPosition, this.position + Velocity, this.position + offset); - } - } - } - return canSnapToPosition; - } - - private void TryAllowingSnappingToPosition( - ref bool canSnapToPosition, - Vector2 pos1, - Vector2 pos2) - { - Vector2 vector2 = new Vector2((float) (this.width - 2), 0.0f); - canSnapToPosition = Collision.CanHit(pos1 + vector2, 2, this.height, pos2, 2, this.height); - if (!canSnapToPosition) - canSnapToPosition = Collision.CanHit(pos1 + vector2, 2, this.height, pos2 + vector2, 2, this.height); - if (!canSnapToPosition) - canSnapToPosition = Collision.CanHit(pos1, 2, this.height, pos2, 2, this.height); - if (canSnapToPosition) - return; - canSnapToPosition = Collision.CanHit(pos1, 2, this.height, pos2 + vector2, 2, this.height); - } - - public void StopVanityActions(bool multiplayerBroadcast = true) - { - this.StopPettingAnimal(); - this.sitting.SitUp(this, multiplayerBroadcast); - this.sleeping.StopSleeping(this, multiplayerBroadcast); - } - - private void StopPettingAnimal() - { - this.isPettingAnimal = false; - this.isTheAnimalBeingPetSmall = false; - } - - private void UpdatePettingAnimal() - { - if (!this.isPettingAnimal) - return; - if (this.talkNPC == -1) - { - this.StopPettingAnimal(); - } - else - { - int num = Math.Sign(Main.npc[this.talkNPC].Center.X - this.Center.X); - if (this.controlLeft || this.controlRight || this.controlUp || this.controlDown || this.controlJump || this.pulley || this.mount.Active || num != this.direction) - { - this.StopPettingAnimal(); - } - else - { - Vector2 playerPositionWhenPetting; - this.GetPettingInfo(this.talkNPC, out int _, out playerPositionWhenPetting, out bool _); - if ((double) this.Bottom.Distance(playerPositionWhenPetting) <= 2.0) - return; - this.StopPettingAnimal(); - } - } - } - - private void OpenChest(int x, int y, int newChest) - { - if (this.chest != -1 && Main.myPlayer == this.whoAmI) - { - for (int index = 0; index < 40; ++index) - ItemSlot.SetGlow(index, -1f, true); - } - this.chest = newChest; - Main.playerInventory = true; - UILinkPointNavigator.ForceMovementCooldown(120); - if (PlayerInput.GrappleAndInteractAreShared) - PlayerInput.Triggers.JustPressed.Grapple = false; - Main.recBigList = false; - this.chestX = x; - this.chestY = y; - } - - public void CloseSign() - { - if (this.sign <= -1) - return; - SoundEngine.PlaySound(11); - this.sign = -1; - Main.editSign = false; - Main.npcChatText = string.Empty; - } - private void LaunchMinecartHook(int myX, int myY) { Vector2 vector2 = new Vector2((float) Main.mouseX + Main.screenPosition.X, (float) Main.mouseY + Main.screenPosition.Y); vector2 = new Vector2((float) (myX * 16 + 8), (float) (myY * 16 + 8)); this.minecartLeft = this.direction <= 0; - this.RemoveAllGrapplingHooks(); - Projectile.NewProjectile(vector2.X, vector2.Y, 0.0f, 0.0f, 403, 0, 0.0f, this.whoAmI); - this.releaseHook = false; - } - - public void RemoveAllGrapplingHooks() - { - this.ClearGrapplingBlacklist(); this.grappling[0] = -1; this.grapCount = 0; for (int index = 0; index < 1000; ++index) @@ -21132,15 +15563,7 @@ label_15: if (Main.projectile[index].active && Main.projectile[index].owner == this.whoAmI && Main.projectile[index].aiStyle == 7) Main.projectile[index].Kill(); } - } - - public void RemoveAllFishingBobbers() - { - for (int index = 0; index < 1000; ++index) - { - if (Main.projectile[index].active && Main.projectile[index].owner == this.whoAmI && Main.projectile[index].bobber) - Main.projectile[index].Kill(); - } + Projectile.NewProjectile(vector2.X, vector2.Y, 0.0f, 0.0f, 403, 0, 0.0f, this.whoAmI); } private void TileInteractionsMouseOver(int myX, int myY) @@ -21149,113 +15572,55 @@ label_15: return; if (Main.tile[myX, myY].type == (ushort) 79) { - if (!Player.IsHoveringOverABottomSideOfABed(myX, myY)) - { - if (this.IsWithinSnappngRangeToTile(myX, myY, 96)) - { - this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 5013; - } - } - else - { - this.noThrow = 2; - this.cursorItemIconEnabled = true; - int num = (int) Main.tile[myX, myY].frameY / 36; - this.cursorItemIconID = num != 0 ? (num != 1 ? (num != 2 ? (num != 3 ? (num != 4 ? (num != 5 ? (num != 6 ? (num != 7 ? (num != 8 ? (num != 9 ? (num != 10 ? (num != 11 ? (num != 12 ? (num < 13 || num > 18 ? (num < 19 || num > 20 ? (num != 21 ? (num != 22 ? (num != 23 ? (num != 24 ? (num != 25 ? (num != 26 ? (num != 27 ? (num != 28 ? (num != 29 ? (num != 30 ? (num != 31 ? (num != 32 ? (num != 33 ? (num != 34 ? (num != 35 ? (num != 36 ? (num != 37 ? (num != 38 ? (num != 39 ? 646 : 4567) : 4299) : 4209) : 4188) : 4167) : 4146) : 3959) : 3932) : 3897) : 3163) : 3164) : 3162) : 2811) : 2669) : 2568) : 2553) : 2538) : 2520) : 2231) : 2139 + num - 19) : 2066 + num - 13) : 1722) : 1721) : 1720) : 1719) : 1473) : 1472) : 1471) : 1470) : 920) : 646) : 645) : 644) : 224; - } - } - if (Main.tile[myX, myY].type == (ushort) 597) - { - int pylonStyleFromTile = TETeleportationPylon.GetPylonStyleFromTile(Main.tile[myX, myY]); - int typeFromTileStyle = TETeleportationPylon.GetPylonItemTypeFromTileStyle(pylonStyleFromTile); this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = typeFromTileStyle; - if (pylonStyleFromTile == 1) - this.cursorItemIconID = 4875; - if (pylonStyleFromTile == 2) - this.cursorItemIconID = 4916; - if (pylonStyleFromTile == 3) - this.cursorItemIconID = 4917; - if (pylonStyleFromTile == 4) - this.cursorItemIconID = 4918; - if (pylonStyleFromTile == 5) - this.cursorItemIconID = 4919; - if (pylonStyleFromTile == 6) - this.cursorItemIconID = 4920; - if (pylonStyleFromTile == 7) - this.cursorItemIconID = 4921; - if (pylonStyleFromTile == 8) - this.cursorItemIconID = 4951; - } - if (Main.tile[myX, myY].type == (ushort) 621) - { - this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 3750; + this.showItemIcon = true; + int num = (int) Main.tile[myX, myY].frameY / 36; + this.showItemIcon2 = num != 0 ? (num != 1 ? (num != 2 ? (num != 3 ? (num != 4 ? (num != 5 ? (num != 6 ? (num != 7 ? (num != 8 ? (num != 9 ? (num != 10 ? (num != 11 ? (num != 12 ? (num < 13 || num > 18 ? (num < 19 || num > 20 ? (num != 21 ? (num != 22 ? (num != 23 ? (num != 24 ? (num != 25 ? (num != 26 ? (num != 27 ? (num != 28 ? (num != 29 ? (num != 30 ? (num != 31 ? 646 : 3897) : 3163) : 3164) : 3162) : 2811) : 2669) : 2568) : 2553) : 2538) : 2520) : 2231) : 2139 + num - 19) : 2066 + num - 13) : 1722) : 1721) : 1720) : 1719) : 1473) : 1472) : 1471) : 1470) : 920) : 646) : 645) : 644) : 224; } if (Main.tile[myX, myY].type == (ushort) 33) { this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 105; + this.showItemIcon = true; + this.showItemIcon2 = 105; int num = (int) Main.tile[myX, myY].frameY / 22; if (num == 1) - this.cursorItemIconID = 1405; + this.showItemIcon2 = 1405; if (num == 2) - this.cursorItemIconID = 1406; + this.showItemIcon2 = 1406; if (num == 3) - this.cursorItemIconID = 1407; + this.showItemIcon2 = 1407; if (num >= 4 && num <= 13) - this.cursorItemIconID = 2045 + num - 4; + this.showItemIcon2 = 2045 + num - 4; if (num >= 14 && num <= 16) - this.cursorItemIconID = 2153 + num - 14; + this.showItemIcon2 = 2153 + num - 14; if (num == 17) - this.cursorItemIconID = 2236; + this.showItemIcon2 = 2236; if (num == 18) - this.cursorItemIconID = 2523; + this.showItemIcon2 = 2523; if (num == 19) - this.cursorItemIconID = 2542; + this.showItemIcon2 = 2542; if (num == 20) - this.cursorItemIconID = 2556; + this.showItemIcon2 = 2556; if (num == 21) - this.cursorItemIconID = 2571; + this.showItemIcon2 = 2571; if (num == 22) - this.cursorItemIconID = 2648; + this.showItemIcon2 = 2648; if (num == 23) - this.cursorItemIconID = 2649; + this.showItemIcon2 = 2649; if (num == 24) - this.cursorItemIconID = 2650; + this.showItemIcon2 = 2650; if (num == 25) - this.cursorItemIconID = 2651; + this.showItemIcon2 = 2651; else if (num == 26) - this.cursorItemIconID = 2818; + this.showItemIcon2 = 2818; else if (num == 27) - this.cursorItemIconID = 3171; + this.showItemIcon2 = 3171; else if (num == 28) - this.cursorItemIconID = 3173; + this.showItemIcon2 = 3173; else if (num == 29) - this.cursorItemIconID = 3172; + this.showItemIcon2 = 3172; else if (num == 30) - this.cursorItemIconID = 3890; - else if (num == 31) - this.cursorItemIconID = 3936; - else if (num == 32) - this.cursorItemIconID = 3962; - else if (num == 33) - this.cursorItemIconID = 4150; - else if (num == 34) - this.cursorItemIconID = 4171; - else if (num == 35) - this.cursorItemIconID = 4192; - else if (num == 36) - this.cursorItemIconID = 4213; - else if (num == 37) - this.cursorItemIconID = 4303; - else if (num == 38) - this.cursorItemIconID = 4571; + this.showItemIcon2 = 3890; } if (Main.tile[myX, myY].type == (ushort) 21) this.TileInteractionsMouseOver_Containers(myX, myY); @@ -21274,10 +15639,10 @@ label_15: { int num4 = num2 - 1; } - this.cursorItemIconID = -1; - this.cursorItemIconID = Chest.chestTypeToIcon[(int) tile.frameX / 36]; + this.showItemIcon2 = -1; + this.showItemIcon2 = Chest.chestTypeToIcon[(int) tile.frameX / 36]; this.noThrow = 2; - this.cursorItemIconEnabled = true; + this.showItemIcon = true; } if (Main.tile[myX, myY].type == (ushort) 468) { @@ -21292,10 +15657,10 @@ label_15: { int num8 = num6 - 1; } - this.cursorItemIconID = -1; - this.cursorItemIconID = Chest.chestTypeToIcon2[(int) tile.frameX / 36]; + this.showItemIcon2 = -1; + this.showItemIcon2 = Chest.chestTypeToIcon2[(int) tile.frameX / 36]; this.noThrow = 2; - this.cursorItemIconEnabled = true; + this.showItemIcon = true; } if (Main.tile[myX, myY].type == (ushort) 88) { @@ -21308,33 +15673,30 @@ label_15: --num10; int Y = num10; int chest = Chest.FindChest(X, Y); - this.cursorItemIconID = -1; + this.showItemIcon2 = -1; if (chest < 0) { - this.cursorItemIconText = Lang.dresserType[0].Value; + this.showItemIconText = Lang.dresserType[0].Value; } else { - this.cursorItemIconText = !(Main.chest[chest].name != "") ? Lang.dresserType[(int) tile.frameX / 54].Value : Main.chest[chest].name; - if (this.cursorItemIconText == Lang.dresserType[(int) tile.frameX / 54].Value) + this.showItemIconText = !(Main.chest[chest].name != "") ? Lang.dresserType[(int) tile.frameX / 54].Value : Main.chest[chest].name; + if (this.showItemIconText == Lang.dresserType[(int) tile.frameX / 54].Value) { - this.cursorItemIconID = Chest.dresserTypeToIcon[(int) tile.frameX / 54]; - this.cursorItemIconText = ""; + this.showItemIcon2 = Chest.dresserTypeToIcon[(int) tile.frameX / 54]; + this.showItemIconText = ""; } } this.noThrow = 2; - this.cursorItemIconEnabled = true; + this.showItemIcon = true; if (Main.tile[myX, myY].frameY > (short) 0) - { - this.cursorItemIconID = 269; - this.cursorItemIconText = ""; - } + this.showItemIcon2 = 269; } if (Main.tile[myX, myY].type == (ushort) 10 || Main.tile[myX, myY].type == (ushort) 11) { Tile tile = Main.tile[myX, myY]; this.noThrow = 2; - this.cursorItemIconEnabled = true; + this.showItemIcon = true; int frameY = (int) tile.frameY; int num = 0; while (frameY >= 54) @@ -21346,172 +15708,148 @@ label_15: num += 36 * ((int) tile.frameX / 54); if (tile.type == (ushort) 11) num += 36 * ((int) tile.frameX / 72); - this.cursorItemIconID = num != 0 ? (num != 9 ? (num != 10 ? (num != 11 ? (num != 12 ? (num != 13 ? (num != 14 ? (num != 15 ? (num != 16 ? (num != 17 ? (num != 18 ? (num != 19 ? (num < 20 || num > 23 ? (num != 24 ? (num != 25 ? (num != 26 ? (num != 27 ? (num != 28 ? (num != 29 ? (num != 30 ? (num != 31 ? (num != 32 ? (num != 33 ? (num != 34 ? (num != 35 ? (num != 36 ? (num != 37 ? (num != 38 ? (num != 39 ? (num != 40 ? (num != 41 ? (num != 42 ? (num != 43 ? (num != 44 ? (num != 45 ? (num < 4 || num > 8 ? 649 + num : 812 + num) : 4576) : 4415) : 4307) : 4218) : 4197) : 4176) : 4155) : 3967) : 3941) : 3888) : 3130) : 3131) : 3129) : 2815) : 2576) : 2561) : 2528) : 2265) : 2044) : 1924) : 1815) : 1793) : 1709 + num - 20) : 1458) : 1413) : 1412) : 1411) : 1140) : 1139) : 1138) : 1137) : 1141) : 912) : 837) : 25; + this.showItemIcon2 = num != 0 ? (num != 9 ? (num != 10 ? (num != 11 ? (num != 12 ? (num != 13 ? (num != 14 ? (num != 15 ? (num != 16 ? (num != 17 ? (num != 18 ? (num != 19 ? (num < 20 || num > 23 ? (num != 24 ? (num != 25 ? (num != 26 ? (num != 27 ? (num != 28 ? (num != 29 ? (num != 30 ? (num != 31 ? (num != 32 ? (num != 33 ? (num != 34 ? (num != 35 ? (num != 36 ? (num < 4 || num > 8 ? 649 + num : 812 + num) : 3888) : 3130) : 3131) : 3129) : 2815) : 2576) : 2561) : 2528) : 2265) : 2044) : 1924) : 1815) : 1793) : 1709 + num - 20) : 1458) : 1413) : 1412) : 1411) : 1140) : 1139) : 1138) : 1137) : 1141) : 912) : 837) : 25; } if (Main.tile[myX, myY].type == (ushort) 104) { this.noThrow = 2; - this.cursorItemIconEnabled = true; + this.showItemIcon = true; switch ((int) Main.tile[myX, myY].frameX / 36) { case 0: - this.cursorItemIconID = 359; + this.showItemIcon2 = 359; break; case 1: - this.cursorItemIconID = 2237; + this.showItemIcon2 = 2237; break; case 2: - this.cursorItemIconID = 2238; + this.showItemIcon2 = 2238; break; case 3: - this.cursorItemIconID = 2239; + this.showItemIcon2 = 2239; break; case 4: - this.cursorItemIconID = 2240; + this.showItemIcon2 = 2240; break; case 5: - this.cursorItemIconID = 2241; + this.showItemIcon2 = 2241; break; case 6: - this.cursorItemIconID = 2560; + this.showItemIcon2 = 2560; break; case 7: - this.cursorItemIconID = 2575; + this.showItemIcon2 = 2575; break; case 8: - this.cursorItemIconID = 2591; + this.showItemIcon2 = 2591; break; case 9: - this.cursorItemIconID = 2592; + this.showItemIcon2 = 2592; break; case 10: - this.cursorItemIconID = 2593; + this.showItemIcon2 = 2593; break; case 11: - this.cursorItemIconID = 2594; + this.showItemIcon2 = 2594; break; case 12: - this.cursorItemIconID = 2595; + this.showItemIcon2 = 2595; break; case 13: - this.cursorItemIconID = 2596; + this.showItemIcon2 = 2596; break; case 14: - this.cursorItemIconID = 2597; + this.showItemIcon2 = 2597; break; case 15: - this.cursorItemIconID = 2598; + this.showItemIcon2 = 2598; break; case 16: - this.cursorItemIconID = 2599; + this.showItemIcon2 = 2599; break; case 17: - this.cursorItemIconID = 2600; + this.showItemIcon2 = 2600; break; case 18: - this.cursorItemIconID = 2601; + this.showItemIcon2 = 2601; break; case 19: - this.cursorItemIconID = 2602; + this.showItemIcon2 = 2602; break; case 20: - this.cursorItemIconID = 2603; + this.showItemIcon2 = 2603; break; case 21: - this.cursorItemIconID = 2604; + this.showItemIcon2 = 2604; break; case 22: - this.cursorItemIconID = 2605; + this.showItemIcon2 = 2605; break; case 23: - this.cursorItemIconID = 2606; + this.showItemIcon2 = 2606; break; case 24: - this.cursorItemIconID = 2809; + this.showItemIcon2 = 2809; break; case 25: - this.cursorItemIconID = 3126; + this.showItemIcon2 = 3126; break; case 26: - this.cursorItemIconID = 3128; + this.showItemIcon2 = 3128; break; case 27: - this.cursorItemIconID = 3127; + this.showItemIcon2 = 3127; break; case 28: - this.cursorItemIconID = 3898; + this.showItemIcon2 = 3898; break; case 29: - this.cursorItemIconID = 3899; + this.showItemIcon2 = 3899; break; case 30: - this.cursorItemIconID = 3900; + this.showItemIcon2 = 3900; break; case 31: - this.cursorItemIconID = 3901; + this.showItemIcon2 = 3901; break; case 32: - this.cursorItemIconID = 3902; - break; - case 33: - this.cursorItemIconID = 3940; - break; - case 34: - this.cursorItemIconID = 3966; - break; - case 35: - this.cursorItemIconID = 4154; - break; - case 36: - this.cursorItemIconID = 4175; - break; - case 37: - this.cursorItemIconID = 4196; - break; - case 38: - this.cursorItemIconID = 4217; - break; - case 39: - this.cursorItemIconID = 4306; - break; - case 40: - this.cursorItemIconID = 4575; + this.showItemIcon2 = 3902; break; } } if (Main.tile[myX, myY].type == (ushort) 356) { this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 3064; + this.showItemIcon = true; + this.showItemIcon2 = 3064; } if (Main.tile[myX, myY].type == (ushort) 377) { this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 3198; + this.showItemIcon = true; + this.showItemIcon2 = 3198; } if (Main.tile[myX, myY].type == (ushort) 209) { this.noThrow = 2; - this.cursorItemIconEnabled = true; + this.showItemIcon = true; if (Main.tile[myX, myY].frameX < (short) 72) - this.cursorItemIconID = 928; + this.showItemIcon2 = 928; else if (Main.tile[myX, myY].frameX < (short) 144) - this.cursorItemIconID = 1337; + this.showItemIcon2 = 1337; else if (Main.tile[myX, myY].frameX < (short) 216) - this.cursorItemIconID = 3369; + this.showItemIcon2 = 3369; else if (Main.tile[myX, myY].frameX < (short) 360) - this.cursorItemIconID = 3664; + this.showItemIcon2 = 3664; int num = (int) Main.tile[myX, myY].frameX / 18; while (num >= 4) num -= 4; - this.cursorItemIconReversed = num < 2; + this.showItemIconR = num < 2; } if (Main.tile[myX, myY].type == (ushort) 216) { this.noThrow = 2; - this.cursorItemIconEnabled = true; + this.showItemIcon = true; int frameY = (int) Main.tile[myX, myY].frameY; int num = 0; while (frameY >= 40) @@ -21519,285 +15857,206 @@ label_15: frameY -= 40; ++num; } - this.cursorItemIconID = 970 + num; + this.showItemIcon2 = 970 + num; } if (Main.tile[myX, myY].type == (ushort) 387 || Main.tile[myX, myY].type == (ushort) 386) { this.noThrow = 2; - this.cursorItemIconEnabled = true; + this.showItemIcon = true; int x = 0; int y = 0; WorldGen.GetTopLeftAndStyles(ref x, ref y, 2, 1 + (Main.tile[myX, myY].type == (ushort) 386).ToInt(), 18, 18); - this.cursorItemIconID = 3239; + this.showItemIcon2 = 3239; } if (Main.tile[myX, myY].type == (ushort) 389 || Main.tile[myX, myY].type == (ushort) 388) { this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 3240; + this.showItemIcon = true; + this.showItemIcon2 = 3240; } if (Main.tile[myX, myY].type == (ushort) 335) { this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 2700; - } - if (Main.tile[myX, myY].type == (ushort) 15 && this.IsWithinSnappngRangeToTile(myX, myY, 40)) - { - this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = WorldGen.GetItemDrop_Chair((int) Main.tile[myX, myY].frameY / 40); - if ((int) Main.tile[myX, myY].frameX / 18 < 1) - this.cursorItemIconReversed = true; - } - if (Main.tile[myX, myY].type == (ushort) 102 && this.IsWithinSnappngRangeToTile(myX, myY, 40)) - { - this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 355; - } - if (Main.tile[myX, myY].type == (ushort) 89 && this.IsWithinSnappngRangeToTile(myX, myY, 40)) - { - this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = WorldGen.GetItemDrop_Benches((int) Main.tile[myX, myY].frameX / 54); - } - if (Main.tile[myX, myY].type == (ushort) 487 && this.IsWithinSnappngRangeToTile(myX, myY, 40)) - { - this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = WorldGen.GetItemDrop_PicnicTables((int) Main.tile[myX, myY].frameX / 72); - } - if (Main.tile[myX, myY].type == (ushort) 497 && this.IsWithinSnappngRangeToTile(myX, myY, 40)) - { - this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = WorldGen.GetItemDrop_Toilet((int) Main.tile[myX, myY].frameY / 40); - if ((int) Main.tile[myX, myY].frameX / 18 < 1) - this.cursorItemIconReversed = true; + this.showItemIcon = true; + this.showItemIcon2 = 2700; } if (Main.tile[myX, myY].type == (ushort) 410) { this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 3536 + Math.Min((int) Main.tile[myX, myY].frameX / 36, 3); - } - if (Main.tile[myX, myY].type == (ushort) 480) - { - this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 4054; - } - if (Main.tile[myX, myY].type == (ushort) 509) - { - this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 4318; + this.showItemIcon = true; + this.showItemIcon2 = 3536 + Math.Min((int) Main.tile[myX, myY].frameX / 36, 3); } if (Main.tile[myX, myY].type == (ushort) 463) { this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 3813; - } - if (Main.tile[myX, myY].type == (ushort) 491) - { - this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 4076; - } - if (Main.tile[myX, myY].type == (ushort) 494) - { - this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 4089; + this.showItemIcon = true; + this.showItemIcon2 = 3813; } if (Main.tile[myX, myY].type == (ushort) 411 && Main.tile[myX, myY].frameX < (short) 36) { this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 3545; + this.showItemIcon = true; + this.showItemIcon2 = 3545; } if (Main.tile[myX, myY].type == (ushort) 338) { this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 2738; + this.showItemIcon = true; + this.showItemIcon2 = 2738; } if (Main.tile[myX, myY].type == (ushort) 455) { this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 3747; + this.showItemIcon = true; + this.showItemIcon2 = 3747; } if (Main.tile[myX, myY].type == (ushort) 219 && (this.inventory[this.selectedItem].type == 424 || this.inventory[this.selectedItem].type == 1103)) { this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = this.inventory[this.selectedItem].type; + this.showItemIcon = true; + this.showItemIcon2 = this.inventory[this.selectedItem].type; } if (Main.tile[myX, myY].type == (ushort) 212) { this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 949; + this.showItemIcon = true; + this.showItemIcon2 = 949; } if (Main.tile[myX, myY].type == (ushort) 314 && (double) this.gravDir == 1.0) { this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 2343; + this.showItemIcon = true; + this.showItemIcon2 = 2343; } if (Main.tile[myX, myY].type == (ushort) 215) { this.noThrow = 2; - this.cursorItemIconEnabled = true; + this.showItemIcon = true; int num = (int) Main.tile[myX, myY].frameX / 54; - this.cursorItemIconID = num != 0 ? (num < 8 || num > 13 ? (num != 7 ? (num != 6 ? (num != 5 ? 3046 + num - 1 : 3050) : 3723) : 3724) : 4689 + num - 8) : 966; + switch (num) + { + case 0: + this.showItemIcon2 = 966; + break; + case 5: + this.showItemIcon2 = 3050; + break; + case 6: + this.showItemIcon2 = 3723; + break; + case 7: + this.showItemIcon2 = 3724; + break; + default: + this.showItemIcon2 = 3046 + num - 1; + break; + } } if (Main.tile[myX, myY].type == (ushort) 4) { this.noThrow = 2; - this.cursorItemIconEnabled = true; + this.showItemIcon = true; int num = (int) Main.tile[myX, myY].frameY / 22; switch (num) { case 0: - this.cursorItemIconID = 8; + this.showItemIcon2 = 8; break; case 8: - this.cursorItemIconID = 523; + this.showItemIcon2 = 523; break; case 9: - this.cursorItemIconID = 974; + this.showItemIcon2 = 974; break; case 10: - this.cursorItemIconID = 1245; + this.showItemIcon2 = 1245; break; case 11: - this.cursorItemIconID = 1333; + this.showItemIcon2 = 1333; break; case 12: - this.cursorItemIconID = 2274; + this.showItemIcon2 = 2274; break; case 13: - this.cursorItemIconID = 3004; + this.showItemIcon2 = 3004; break; case 14: - this.cursorItemIconID = 3045; + this.showItemIcon2 = 3045; break; case 15: - this.cursorItemIconID = 3114; - break; - case 16: - this.cursorItemIconID = 4383; - break; - case 17: - this.cursorItemIconID = 4384; - break; - case 18: - this.cursorItemIconID = 4385; - break; - case 19: - this.cursorItemIconID = 4386; - break; - case 20: - this.cursorItemIconID = 4387; - break; - case 21: - this.cursorItemIconID = 4388; + this.showItemIcon2 = 3114; break; default: - this.cursorItemIconID = 426 + num; + this.showItemIcon2 = 426 + num; break; } } if (Main.tile[myX, myY].type == (ushort) 13) { this.noThrow = 2; - this.cursorItemIconEnabled = true; + this.showItemIcon = true; switch ((int) Main.tile[myX, myY].frameX / 18) { case 1: - this.cursorItemIconID = 28; + this.showItemIcon2 = 28; break; case 2: - this.cursorItemIconID = 110; + this.showItemIcon2 = 110; break; case 3: - this.cursorItemIconID = 350; + this.showItemIcon2 = 350; break; case 4: - this.cursorItemIconID = 351; + this.showItemIcon2 = 351; break; case 5: - this.cursorItemIconID = 2234; + this.showItemIcon2 = 2234; break; case 6: - this.cursorItemIconID = 2244; + this.showItemIcon2 = 2244; break; case 7: - this.cursorItemIconID = 2257; + this.showItemIcon2 = 2257; break; case 8: - this.cursorItemIconID = 2258; + this.showItemIcon2 = 2258; break; default: - this.cursorItemIconID = 31; + this.showItemIcon2 = 31; break; } } if (Main.tile[myX, myY].type == (ushort) 29) { this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 87; + this.showItemIcon = true; + this.showItemIcon2 = 87; } if (Main.tile[myX, myY].type == (ushort) 97) { this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 346; - } - if (Main.tile[myX, myY].type == (ushort) 510) - { - this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 4319; - int num = (int) Main.tile[myX, myY].frameX / 18; - while (num >= 2) - num -= 2; - this.cursorItemIconReversed = num == 0; - } - if (Main.tile[myX, myY].type == (ushort) 511) - { - this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 4320; - int num = (int) Main.tile[myX, myY].frameX / 18; - while (num >= 2) - num -= 2; - this.cursorItemIconReversed = num == 0; + this.showItemIcon = true; + this.showItemIcon2 = 346; } if (Main.tile[myX, myY].type == (ushort) 49) { this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 148; + this.showItemIcon = true; + this.showItemIcon2 = 148; } if (Main.tile[myX, myY].type == (ushort) 174) { this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 713; + this.showItemIcon = true; + this.showItemIcon2 = 713; } if (Main.tile[myX, myY].type == (ushort) 50) { this.noThrow = 2; if (Main.tile[myX, myY].frameX == (short) 90) { - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 165; + this.showItemIcon = true; + this.showItemIcon2 = 165; } } if (Main.tile[myX, myY].type == (ushort) 139) @@ -21808,8 +16067,8 @@ label_15: int num = 0; for (int index3 = (int) Main.tile[index1, index2].frameY / 18; index3 >= 2; index3 -= 2) ++num; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = num != 28 ? (num != 29 ? (num != 30 ? (num != 31 ? (num != 32 ? (num != 33 ? (num != 34 ? (num != 35 ? (num != 36 ? (num != 37 ? (num != 38 ? (num != 39 ? (num != 40 ? (num != 41 ? (num != 42 ? (num != 43 ? (num != 44 ? (num != 45 ? (num != 46 ? (num != 47 ? (num != 48 ? (num != 49 ? (num != 50 ? (num != 51 ? (num != 52 ? (num != 53 ? (num != 54 ? (num != 55 ? (num != 56 ? (num != 57 ? (num != 58 ? (num != 59 ? (num != 60 ? (num != 61 ? (num != 62 ? (num != 63 ? (num != 64 ? (num != 65 ? (num != 66 ? (num != 67 ? (num != 68 ? (num != 69 ? (num != 70 ? (num != 71 ? (num != 72 ? (num != 73 ? (num != 74 ? (num != 75 ? (num != 76 ? (num != 77 ? (num != 78 ? (num != 79 ? (num != 80 ? (num != 81 ? (num != 82 ? (num != 83 ? (num != 84 ? (num != 85 ? (num < 13 ? 562 + num : 1596 + num - 13) : 5044) : 5040) : 5039) : 5038) : 5037) : 5036) : 5035) : 5034) : 5033) : 5032) : 5031) : 5030) : 5029) : 5028) : 5027) : 5026) : 5025) : 5024) : 5023) : 5022) : 5021) : 5020) : 5019) : 5018) : 5017) : 5016) : 5015) : 5014) : 5006) : 4992) : 4991) : 4990) : 4985) : 4979) : 4606) : 4421) : 4358) : 4357) : 4356) : 4237) : 4081) : 4080) : 4077) : 4079) : 4078) : 4082) : 3869) : 3796) : 3371) : 3370) : 3237) : 3236) : 3235) : 3044) : 2742) : 1965) : 1964) : 1963; + this.showItemIcon = true; + this.showItemIcon2 = num != 28 ? (num != 29 ? (num != 30 ? (num != 31 ? (num != 32 ? (num != 33 ? (num != 34 ? (num != 35 ? (num != 36 ? (num != 37 ? (num != 38 ? (num != 39 ? (num < 13 ? 562 + num : 1596 + num - 13) : 3869) : 3796) : 3371) : 3370) : 3237) : 3236) : 3235) : 3044) : 2742) : 1965) : 1964) : 1963; } if (Main.tile[myX, myY].type == (ushort) 207) { @@ -21819,38 +16078,32 @@ label_15: int num = 0; for (int index6 = (int) Main.tile[index4, index5].frameX / 18; index6 >= 2; index6 -= 2) ++num; - this.cursorItemIconEnabled = true; + this.showItemIcon = true; switch (num) { case 0: - this.cursorItemIconID = 909; + this.showItemIcon2 = 909; break; case 1: - this.cursorItemIconID = 910; + this.showItemIcon2 = 910; break; case 2: - this.cursorItemIconID = 940; + this.showItemIcon2 = 940; break; case 3: - this.cursorItemIconID = 941; + this.showItemIcon2 = 941; break; case 4: - this.cursorItemIconID = 942; + this.showItemIcon2 = 942; break; case 5: - this.cursorItemIconID = 943; + this.showItemIcon2 = 943; break; case 6: - this.cursorItemIconID = 944; + this.showItemIcon2 = 944; break; case 7: - this.cursorItemIconID = 945; - break; - case 8: - this.cursorItemIconID = 4922; - break; - case 9: - this.cursorItemIconID = 4417; + this.showItemIcon2 = 945; break; } } @@ -21871,185 +16124,93 @@ label_15: if (num15 != -1) { Main.signHover = num15; - this.cursorItemIconEnabled = false; - this.cursorItemIconID = -1; + this.showItemIcon = false; + this.showItemIcon2 = -1; } } if (Main.tile[myX, myY].type == (ushort) 237) { this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 1293; + this.showItemIcon = true; + this.showItemIcon2 = 1293; } if (Main.tile[myX, myY].type == (ushort) 466) { this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 3828; + this.showItemIcon = true; + this.showItemIcon2 = 3828; } if (Main.tile[myX, myY].type == (ushort) 125) { this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 487; + this.showItemIcon = true; + this.showItemIcon2 = 487; } if (Main.tile[myX, myY].type == (ushort) 354) { this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 2999; + this.showItemIcon = true; + this.showItemIcon2 = 2999; } if (Main.tile[myX, myY].type == (ushort) 287) { this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 2177; + this.showItemIcon = true; + this.showItemIcon2 = 2177; } if (Main.tile[myX, myY].type == (ushort) 132) { this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 513; + this.showItemIcon = true; + this.showItemIcon2 = 513; } if (Main.tile[myX, myY].type == (ushort) 136) { this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 538; + this.showItemIcon = true; + this.showItemIcon2 = 538; } if (Main.tile[myX, myY].type == (ushort) 144) { this.noThrow = 2; - this.cursorItemIconEnabled = true; - int num = (int) Main.tile[myX, myY].frameX / 18; - this.cursorItemIconID = num >= 3 ? 4484 + (num - 3) : 583 + num; + this.showItemIcon = true; + this.showItemIcon2 = 583 + (int) Main.tile[myX, myY].frameX / 18; } - if (Main.tile[myX, myY].type == (ushort) 440) - { - int index = myY; - int num16 = (int) Main.tile[myX, index].frameX / 54; - int num17 = (int) Main.tile[myX, index].frameY / 54; - int type = -1; - switch (num16) - { - case 0: - type = 1526; - break; - case 1: - type = 1524; - break; - case 2: - type = 1525; - break; - case 3: - type = 1523; - break; - case 4: - type = 1522; - break; - case 5: - type = 1527; - break; - case 6: - type = 3643; - break; - } - if (type != -1 && (num17 == 1 || this.HasItem(type))) - { - this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = type; - } - } - else if (Main.tile[myX, myY].type == (ushort) 470) - { - this.noThrow = 2; - int num = (int) Main.tile[myX, myY].frameX % 136 / 34; - if (num < 2) - { - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 498; - } - else if (num < 4) - { - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 1989; - } - } - else if (Main.tile[myX, myY].type == (ushort) 475) - { - this.noThrow = 2; - this.cursorItemIconEnabled = true; - this.cursorItemIconID = 3977; - } - else if (Main.tile[myX, myY].type == (ushort) 520) - { - this.noThrow = 2; - int key = TEFoodPlatter.Find(myX, myY); - if (key != -1) - { - this.cursorItemIconEnabled = true; - this.cursorItemIconID = ((TEFoodPlatter) TileEntity.ByID[key]).item.type; - } - } - else if (Main.tile[myX, myY].type == (ushort) 395) - { - this.noThrow = 2; - int x = myX; - int y = myY; - int frameX = (int) Main.tile[myX, myY].frameX; - int frameY = (int) Main.tile[myX, myY].frameY; - while (frameY > 0) - { - frameY -= 18; - --y; - } - while (frameX >= 36) - frameX -= 36; - while (frameX > 0) - { - frameX -= 18; - --x; - } - int key = TEItemFrame.Find(x, y); - if (key != -1) - { - this.cursorItemIconEnabled = true; - this.cursorItemIconID = ((TEItemFrame) TileEntity.ByID[key]).item.type; - } - } - else if (Main.tile[myX, myY].type == (ushort) 471) - { - this.noThrow = 2; - int x = myX; - int y = myY; - int frameX = (int) Main.tile[myX, myY].frameX; - int frameY = (int) Main.tile[myX, myY].frameY; - while (frameY > 0) - { - frameY -= 18; - --y; - } - while (frameX >= 54) - frameX -= 54; - while (frameX > 0) - { - frameX -= 18; - --x; - } - int key = TEWeaponsRack.Find(x, y); - if (key != -1) - { - this.cursorItemIconEnabled = true; - this.cursorItemIconID = ((TEWeaponsRack) TileEntity.ByID[key]).item.type; - } - } - else if (Main.tile[myX, myY].type == (ushort) 334) - this.noThrow = 2; - if (!PlayerInput.UsingGamepad || this.cursorItemIconText.Length != 0) + if (Main.tile[myX, myY].type != (ushort) 440) return; - this.cursorItemIconEnabled = false; - this.cursorItemIconID = 0; + int index = myY; + int num16 = (int) Main.tile[myX, index].frameX / 54; + int num17 = (int) Main.tile[myX, index].frameY / 54; + int type = -1; + switch (num16) + { + case 0: + type = 1526; + break; + case 1: + type = 1524; + break; + case 2: + type = 1525; + break; + case 3: + type = 1523; + break; + case 4: + type = 1522; + break; + case 5: + type = 1527; + break; + case 6: + type = 3643; + break; + } + if (type == -1 || num17 != 1 && !this.HasItem(type)) + return; + this.noThrow = 2; + this.showItemIcon = true; + this.showItemIcon2 = type; } public Color ChatColor() @@ -22082,24 +16243,22 @@ label_15: if ((int) tile.frameY % 36 != 0) --Y; int chest = Chest.FindChest(X, Y); - this.cursorItemIconID = -1; + this.showItemIcon2 = -1; if (chest < 0) { - this.cursorItemIconText = localizedTextArray[0].Value; + this.showItemIconText = localizedTextArray[0].Value; } else { - this.cursorItemIconText = !(Main.chest[chest].name != "") ? localizedTextArray[(int) tile.frameX / 36].Value : Main.chest[chest].name; - if (this.cursorItemIconText == localizedTextArray[(int) tile.frameX / 36].Value) + this.showItemIconText = !(Main.chest[chest].name != "") ? localizedTextArray[(int) tile.frameX / 36].Value : Main.chest[chest].name; + if (this.showItemIconText == localizedTextArray[(int) tile.frameX / 36].Value) { - this.cursorItemIconID = numArray[(int) tile.frameX / 36]; - this.cursorItemIconText = ""; + this.showItemIcon2 = numArray[(int) tile.frameX / 36]; + this.showItemIconText = ""; } } - if (this.cursorItemIconID == 3988) - this.cursorItemIconID = 306; this.noThrow = 2; - this.cursorItemIconEnabled = true; + this.showItemIcon = true; } private void TryLandingOnDetonator() @@ -22116,257 +16275,218 @@ label_15: private void TryBouncingBlocks(bool Falling) { - int num1 = (double) this.velocity.Y >= 5.0 || (double) this.velocity.Y <= -5.0 ? (!this.wet ? 1 : 0) : 0; - bool flag1 = false; - bool flag2 = false; - float num2 = 1f; - if (num1 == 0) + if ((double) this.velocity.Y < 5.0 && (double) this.velocity.Y > -5.0 || this.wet) return; - bool flag3 = false; - int num3 = 0; + int num = 0; + bool flag = false; foreach (Point touchedTile in this.TouchedTiles) { Tile tile = Main.tile[touchedTile.X, touchedTile.Y]; - if (tile != null && tile.active() && tile.nactive() && (flag1 || Main.tileBouncy[(int) tile.type])) + if (tile != null && tile.active() && tile.nactive() && Main.tileBouncy[(int) tile.type]) { - flag3 = true; - num3 = touchedTile.Y; + flag = true; + num = touchedTile.Y; break; } } - if (!flag3) + if (!flag) return; this.velocity.Y *= -0.8f; if (this.controlJump) this.velocity.Y = MathHelper.Clamp(this.velocity.Y, -13f, 13f); - this.position.Y = (float) (num3 * 16 - ((double) this.velocity.Y < 0.0 ? this.height : -16)); + this.position.Y = (float) (num * 16 - ((double) this.velocity.Y < 0.0 ? this.height : -16)); this.FloorVisuals(Falling); - if (flag2) - { - Vector2 rotationVector2 = (this.fullRotation - 1.570796f).ToRotationVector2(); - if ((double) rotationVector2.Y > 0.0) - rotationVector2.Y *= -1f; - rotationVector2.Y = (float) ((double) rotationVector2.Y * 0.5 - 0.5); - float num4 = -rotationVector2.Y; - if ((double) num4 < 0.0) - num4 = 0.0f; - float num5 = (float) ((double) num4 * 1.5 + 1.0); - float num6 = MathHelper.Clamp(Math.Abs(this.velocity.Y) * num5 * num2, 2f, 16f); - this.velocity = rotationVector2 * num6; - float num7 = 20f; - Vector2 vector2 = this.Center + (this.fullRotation + 1.570796f).ToRotationVector2() * num7; - Vector2 bottom = this.Bottom; - ParticleOrchestrator.RequestParticleSpawn(true, ParticleOrchestraType.Keybrand, new ParticleOrchestraSettings() - { - PositionInWorld = bottom - }, new int?(this.whoAmI)); - } this.velocity.Y = MathHelper.Clamp(this.velocity.Y, -20f, 20f); if ((double) this.velocity.Y * (double) this.gravDir >= 0.0) return; this.fallStart = (int) this.position.Y / 16; } - private bool CanAcceptItemIntoInventory(Item item) => !this.preventAllItemPickups || ItemID.Sets.IgnoresEncumberingStone[item.type]; - private void GrabItems(int i) { - for (int worldItemArrayIndex = 0; worldItemArrayIndex < 400; ++worldItemArrayIndex) + for (int number = 0; number < 400; ++number) { - Item obj = Main.item[worldItemArrayIndex]; - if (obj.active && obj.noGrabDelay == 0 && obj.playerIndexTheItemIsReservedFor == i && this.CanAcceptItemIntoInventory(obj)) + if (Main.item[number].active && Main.item[number].noGrabDelay == 0 && Main.item[number].owner == i) { - int itemGrabRange = this.GetItemGrabRange(obj); - Microsoft.Xna.Framework.Rectangle hitbox = obj.Hitbox; - if (this.Hitbox.Intersects(hitbox)) + int defaultItemGrabRange = Player.defaultItemGrabRange; + if (this.goldRing && Main.item[number].type >= 71 && Main.item[number].type <= 74) + defaultItemGrabRange += Item.coinGrabRange; + if (this.manaMagnet && (Main.item[number].type == 184 || Main.item[number].type == 1735 || Main.item[number].type == 1868)) + defaultItemGrabRange += Item.manaGrabRange; + if (this.lifeMagnet && (Main.item[number].type == 58 || Main.item[number].type == 1734 || Main.item[number].type == 1867)) + defaultItemGrabRange += Item.lifeGrabRange; + if (Main.item[number].type == 3822) + defaultItemGrabRange += 50; + if (ItemID.Sets.NebulaPickup[Main.item[number].type]) + defaultItemGrabRange += 100; + if (new Microsoft.Xna.Framework.Rectangle((int) this.position.X, (int) this.position.Y, this.width, this.height).Intersects(new Microsoft.Xna.Framework.Rectangle((int) Main.item[number].position.X, (int) Main.item[number].position.Y, Main.item[number].width, Main.item[number].height))) { - if (i == Main.myPlayer && (this.inventory[this.selectedItem].type != 0 ? 0 : (this.itemAnimation > 0 ? 1 : 0)) == 0) - this.PickupItem(i, worldItemArrayIndex, obj); - } - else if (new Microsoft.Xna.Framework.Rectangle((int) this.position.X - itemGrabRange, (int) this.position.Y - itemGrabRange, this.width + itemGrabRange * 2, this.height + itemGrabRange * 2).Intersects(hitbox)) - { - Player.ItemSpaceStatus status = this.ItemSpace(obj); - if (this.CanPullItem(obj, status)) + if (i == Main.myPlayer && (this.inventory[this.selectedItem].type != 0 || this.itemAnimation <= 0)) { - obj.beingGrabbed = true; - if (this.manaMagnet && (obj.type == 184 || obj.type == 1735 || obj.type == 1868)) - this.PullItem_Pickup(obj, 12f, 5); - else if (this.lifeMagnet && (obj.type == 58 || obj.type == 1734 || obj.type == 1867)) - this.PullItem_Pickup(obj, 15f, 5); - else if (ItemID.Sets.NebulaPickup[obj.type]) - this.PullItem_Pickup(obj, 12f, 5); - else if (status.ItemIsGoingToVoidVault) - this.PullItem_ToVoidVault(obj); - else if (this.goldRing && obj.IsACoin) - this.PullItem_Pickup(obj, 12f, 5); + if (ItemID.Sets.NebulaPickup[Main.item[number].type]) + { + Main.PlaySound(7, (int) this.position.X, (int) this.position.Y); + int buffType = Main.item[number].buffType; + Main.item[number] = new Item(); + if (Main.netMode == 1) + { + NetMessage.SendData(102, number: i, number2: ((float) buffType), number3: this.Center.X, number4: this.Center.Y); + NetMessage.SendData(21, number: number); + } + else + this.NebulaLevelup(buffType); + } + if (Main.item[number].type == 58 || Main.item[number].type == 1734 || Main.item[number].type == 1867) + { + Main.PlaySound(7, (int) this.position.X, (int) this.position.Y); + this.statLife += 20; + if (Main.myPlayer == this.whoAmI) + this.HealEffect(20); + if (this.statLife > this.statLifeMax2) + this.statLife = this.statLifeMax2; + Main.item[number] = new Item(); + if (Main.netMode == 1) + NetMessage.SendData(21, number: number); + } + else if (Main.item[number].type == 184 || Main.item[number].type == 1735 || Main.item[number].type == 1868) + { + Main.PlaySound(7, (int) this.position.X, (int) this.position.Y); + this.statMana += 100; + if (Main.myPlayer == this.whoAmI) + this.ManaEffect(100); + if (this.statMana > this.statManaMax2) + this.statMana = this.statManaMax2; + Main.item[number] = new Item(); + if (Main.netMode == 1) + NetMessage.SendData(21, number: number); + } else - this.PullItem_Common(obj, 0.75f); + { + Main.item[number] = this.GetItem(i, Main.item[number]); + if (Main.netMode == 1) + NetMessage.SendData(21, number: number); + } + } + } + else if (new Microsoft.Xna.Framework.Rectangle((int) this.position.X - defaultItemGrabRange, (int) this.position.Y - defaultItemGrabRange, this.width + defaultItemGrabRange * 2, this.height + defaultItemGrabRange * 2).Intersects(new Microsoft.Xna.Framework.Rectangle((int) Main.item[number].position.X, (int) Main.item[number].position.Y, Main.item[number].width, Main.item[number].height)) && this.ItemSpace(Main.item[number])) + { + Main.item[number].beingGrabbed = true; + if (this.manaMagnet && (Main.item[number].type == 184 || Main.item[number].type == 1735 || Main.item[number].type == 1868)) + { + Vector2 vector2 = new Vector2(Main.item[number].position.X + (float) (Main.item[number].width / 2), Main.item[number].position.Y + (float) (Main.item[number].height / 2)); + float num1 = this.Center.X - vector2.X; + float num2 = this.Center.Y - vector2.Y; + float num3 = (float) (12.0 / Math.Sqrt((double) num1 * (double) num1 + (double) num2 * (double) num2)); + float num4 = num1 * num3; + float num5 = num2 * num3; + int num6 = 5; + Main.item[number].velocity.X = (Main.item[number].velocity.X * (float) (num6 - 1) + num4) / (float) num6; + Main.item[number].velocity.Y = (Main.item[number].velocity.Y * (float) (num6 - 1) + num5) / (float) num6; + } + else if (this.lifeMagnet && (Main.item[number].type == 58 || Main.item[number].type == 1734 || Main.item[number].type == 1867)) + { + Vector2 vector2 = new Vector2(Main.item[number].position.X + (float) (Main.item[number].width / 2), Main.item[number].position.Y + (float) (Main.item[number].height / 2)); + float num7 = this.Center.X - vector2.X; + float num8 = this.Center.Y - vector2.Y; + float num9 = (float) (15.0 / Math.Sqrt((double) num7 * (double) num7 + (double) num8 * (double) num8)); + float num10 = num7 * num9; + float num11 = num8 * num9; + int num12 = 5; + Main.item[number].velocity.X = (Main.item[number].velocity.X * (float) (num12 - 1) + num10) / (float) num12; + Main.item[number].velocity.Y = (Main.item[number].velocity.Y * (float) (num12 - 1) + num11) / (float) num12; + } + else if (this.goldRing && Main.item[number].type >= 71 && Main.item[number].type <= 74) + { + Vector2 vector2 = new Vector2(Main.item[number].position.X + (float) (Main.item[number].width / 2), Main.item[number].position.Y + (float) (Main.item[number].height / 2)); + float num13 = this.Center.X - vector2.X; + float num14 = this.Center.Y - vector2.Y; + float num15 = (float) (12.0 / Math.Sqrt((double) num13 * (double) num13 + (double) num14 * (double) num14)); + float num16 = num13 * num15; + float num17 = num14 * num15; + int num18 = 5; + Main.item[number].velocity.X = (Main.item[number].velocity.X * (float) (num18 - 1) + num16) / (float) num18; + Main.item[number].velocity.Y = (Main.item[number].velocity.Y * (float) (num18 - 1) + num17) / (float) num18; + } + else if (ItemID.Sets.NebulaPickup[Main.item[number].type]) + { + Vector2 vector2 = new Vector2(Main.item[number].position.X + (float) (Main.item[number].width / 2), Main.item[number].position.Y + (float) (Main.item[number].height / 2)); + float num19 = this.Center.X - vector2.X; + float num20 = this.Center.Y - vector2.Y; + float num21 = (float) (12.0 / Math.Sqrt((double) num19 * (double) num19 + (double) num20 * (double) num20)); + float num22 = num19 * num21; + float num23 = num20 * num21; + int num24 = 5; + Main.item[number].velocity.X = (Main.item[number].velocity.X * (float) (num24 - 1) + num22) / (float) num24; + Main.item[number].velocity.Y = (Main.item[number].velocity.Y * (float) (num24 - 1) + num23) / (float) num24; + } + else + { + if ((double) this.position.X + (double) this.width * 0.5 > (double) Main.item[number].position.X + (double) Main.item[number].width * 0.5) + { + if ((double) Main.item[number].velocity.X < (double) Player.itemGrabSpeedMax + (double) this.velocity.X) + Main.item[number].velocity.X += Player.itemGrabSpeed; + if ((double) Main.item[number].velocity.X < 0.0) + Main.item[number].velocity.X += Player.itemGrabSpeed * 0.75f; + } + else + { + if ((double) Main.item[number].velocity.X > -(double) Player.itemGrabSpeedMax + (double) this.velocity.X) + Main.item[number].velocity.X -= Player.itemGrabSpeed; + if ((double) Main.item[number].velocity.X > 0.0) + Main.item[number].velocity.X -= Player.itemGrabSpeed * 0.75f; + } + if ((double) this.position.Y + (double) this.height * 0.5 > (double) Main.item[number].position.Y + (double) Main.item[number].height * 0.5) + { + if ((double) Main.item[number].velocity.Y < (double) Player.itemGrabSpeedMax) + Main.item[number].velocity.Y += Player.itemGrabSpeed; + if ((double) Main.item[number].velocity.Y < 0.0) + Main.item[number].velocity.Y += Player.itemGrabSpeed * 0.75f; + } + else + { + if ((double) Main.item[number].velocity.Y > -(double) Player.itemGrabSpeedMax) + Main.item[number].velocity.Y -= Player.itemGrabSpeed; + if ((double) Main.item[number].velocity.Y > 0.0) + Main.item[number].velocity.Y -= Player.itemGrabSpeed * 0.75f; + } } } } } } - private void PullItem_ToVoidVault(Item itemToPickUp) => this.PullItem_Pickup(itemToPickUp, 12f, 5); - - private void PullItem_Common(Item itemToPickUp, float xPullSpeed) + public bool SellItem(int price, int stack) { - if ((double) this.position.X + (double) this.width * 0.5 > (double) itemToPickUp.position.X + (double) itemToPickUp.width * 0.5) - { - if ((double) itemToPickUp.velocity.X < (double) Player.itemGrabSpeedMax + (double) this.velocity.X) - itemToPickUp.velocity.X += Player.itemGrabSpeed; - if ((double) itemToPickUp.velocity.X < 0.0) - itemToPickUp.velocity.X += Player.itemGrabSpeed * xPullSpeed; - } - else - { - if ((double) itemToPickUp.velocity.X > -(double) Player.itemGrabSpeedMax + (double) this.velocity.X) - itemToPickUp.velocity.X -= Player.itemGrabSpeed; - if ((double) itemToPickUp.velocity.X > 0.0) - itemToPickUp.velocity.X -= Player.itemGrabSpeed * xPullSpeed; - } - if ((double) this.position.Y + (double) this.height * 0.5 > (double) itemToPickUp.position.Y + (double) itemToPickUp.height * 0.5) - { - if ((double) itemToPickUp.velocity.Y < (double) Player.itemGrabSpeedMax) - itemToPickUp.velocity.Y += Player.itemGrabSpeed; - if ((double) itemToPickUp.velocity.Y >= 0.0) - return; - itemToPickUp.velocity.Y += Player.itemGrabSpeed * xPullSpeed; - } - else - { - if ((double) itemToPickUp.velocity.Y > -(double) Player.itemGrabSpeedMax) - itemToPickUp.velocity.Y -= Player.itemGrabSpeed; - if ((double) itemToPickUp.velocity.Y <= 0.0) - return; - itemToPickUp.velocity.Y -= Player.itemGrabSpeed * xPullSpeed; - } - } - - private void PullItem_Pickup(Item itemToPickUp, float speed, int acc) - { - Vector2 vector2 = new Vector2(itemToPickUp.position.X + (float) (itemToPickUp.width / 2), itemToPickUp.position.Y + (float) (itemToPickUp.height / 2)); - float num1 = this.Center.X - vector2.X; - float num2 = this.Center.Y - vector2.Y; - float num3 = (float) Math.Sqrt((double) num1 * (double) num1 + (double) num2 * (double) num2); - float num4 = speed / num3; - float num5 = num1 * num4; - float num6 = num2 * num4; - itemToPickUp.velocity.X = (itemToPickUp.velocity.X * (float) (acc - 1) + num5) / (float) acc; - itemToPickUp.velocity.Y = (itemToPickUp.velocity.Y * (float) (acc - 1) + num6) / (float) acc; - } - - private Item PickupItem(int playerIndex, int worldItemArrayIndex, Item itemToPickUp) - { - if (ItemID.Sets.NebulaPickup[itemToPickUp.type]) - { - SoundEngine.PlaySound(7, (int) this.position.X, (int) this.position.Y); - int buffType = itemToPickUp.buffType; - itemToPickUp = new Item(); - if (Main.netMode == 1) - NetMessage.SendData(102, number: playerIndex, number2: ((float) buffType), number3: this.Center.X, number4: this.Center.Y); - else - this.NebulaLevelup(buffType); - } - if (itemToPickUp.type == 58 || itemToPickUp.type == 1734 || itemToPickUp.type == 1867) - { - SoundEngine.PlaySound(7, (int) this.position.X, (int) this.position.Y); - this.statLife += 20; - if (Main.myPlayer == this.whoAmI) - this.HealEffect(20); - if (this.statLife > this.statLifeMax2) - this.statLife = this.statLifeMax2; - itemToPickUp = new Item(); - } - else if (itemToPickUp.type == 184 || itemToPickUp.type == 1735 || itemToPickUp.type == 1868) - { - SoundEngine.PlaySound(7, (int) this.position.X, (int) this.position.Y); - this.statMana += 100; - if (Main.myPlayer == this.whoAmI) - this.ManaEffect(100); - if (this.statMana > this.statManaMax2) - this.statMana = this.statManaMax2; - itemToPickUp = new Item(); - } - else if (itemToPickUp.type == 4143) - { - SoundEngine.PlaySound(7, (int) this.position.X, (int) this.position.Y); - this.statMana += 50; - if (Main.myPlayer == this.whoAmI) - this.ManaEffect(50); - if (this.statMana > this.statManaMax2) - this.statMana = this.statManaMax2; - itemToPickUp = new Item(); - } - else - itemToPickUp = this.GetItem(playerIndex, itemToPickUp, GetItemSettings.PickupItemFromWorld); - Main.item[worldItemArrayIndex] = itemToPickUp; - if (Main.netMode == 1) - NetMessage.SendData(21, number: worldItemArrayIndex); - return itemToPickUp; - } - - private int GetItemGrabRange(Item item) - { - int defaultItemGrabRange = Player.defaultItemGrabRange; - if (this.goldRing && item.IsACoin) - defaultItemGrabRange += Item.coinGrabRange; - if (this.manaMagnet && (item.type == 184 || item.type == 1735 || item.type == 1868)) - defaultItemGrabRange += Item.manaGrabRange; - if (item.type == 4143) - defaultItemGrabRange += Item.manaGrabRange; - if (this.lifeMagnet && (item.type == 58 || item.type == 1734 || item.type == 1867)) - defaultItemGrabRange += Item.lifeGrabRange; - if (this.treasureMagnet) - defaultItemGrabRange += Item.treasureGrabRange; - if (item.type == 3822) - defaultItemGrabRange += 50; - if (ItemID.Sets.NebulaPickup[item.type]) - defaultItemGrabRange += 100; - return defaultItemGrabRange; - } - - public bool SellItem(Item item, int stack = -1) - { - int calcForSelling; - int calcForBuying; - this.GetItemExpectedPrice(item, out calcForSelling, out calcForBuying); - if (calcForSelling <= 0) + if (price <= 0) return false; - if (stack == -1) - stack = item.stack; Item[] objArray = new Item[58]; for (int index = 0; index < 58; ++index) { objArray[index] = new Item(); objArray[index] = this.inventory[index].Clone(); } - int num1 = calcForSelling / 5; + int num1 = price / 5; if (num1 < 1) num1 = 1; - int num2 = num1; - int num3 = num1 * stack; - int amount = Main.shopSellbackHelper.GetAmount(item); - if (amount > 0) - num3 += (-num2 + calcForBuying) * Math.Min(amount, item.stack); + int num2 = num1 * stack; bool flag = false; - while (num3 >= 1000000 && !flag) + while (num2 >= 1000000 && !flag) { int index = -1; for (int i = 53; i >= 0; --i) { if (index == -1 && (this.inventory[i].type == 0 || this.inventory[i].stack == 0)) index = i; - while (this.inventory[i].type == 74 && this.inventory[i].stack < this.inventory[i].maxStack && num3 >= 1000000) + while (this.inventory[i].type == 74 && this.inventory[i].stack < this.inventory[i].maxStack && num2 >= 1000000) { ++this.inventory[i].stack; - num3 -= 1000000; + num2 -= 1000000; this.DoCoins(i); if (this.inventory[i].stack == 0 && index == -1) index = i; } } - if (num3 >= 1000000) + if (num2 >= 1000000) { if (index == -1) { @@ -22375,27 +16495,27 @@ label_15: else { this.inventory[index].SetDefaults(74); - num3 -= 1000000; + num2 -= 1000000; } } } - while (num3 >= 10000 && !flag) + while (num2 >= 10000 && !flag) { int index = -1; for (int i = 53; i >= 0; --i) { if (index == -1 && (this.inventory[i].type == 0 || this.inventory[i].stack == 0)) index = i; - while (this.inventory[i].type == 73 && this.inventory[i].stack < this.inventory[i].maxStack && num3 >= 10000) + while (this.inventory[i].type == 73 && this.inventory[i].stack < this.inventory[i].maxStack && num2 >= 10000) { ++this.inventory[i].stack; - num3 -= 10000; + num2 -= 10000; this.DoCoins(i); if (this.inventory[i].stack == 0 && index == -1) index = i; } } - if (num3 >= 10000) + if (num2 >= 10000) { if (index == -1) { @@ -22404,27 +16524,27 @@ label_15: else { this.inventory[index].SetDefaults(73); - num3 -= 10000; + num2 -= 10000; } } } - while (num3 >= 100 && !flag) + while (num2 >= 100 && !flag) { int index = -1; for (int i = 53; i >= 0; --i) { if (index == -1 && (this.inventory[i].type == 0 || this.inventory[i].stack == 0)) index = i; - while (this.inventory[i].type == 72 && this.inventory[i].stack < this.inventory[i].maxStack && num3 >= 100) + while (this.inventory[i].type == 72 && this.inventory[i].stack < this.inventory[i].maxStack && num2 >= 100) { ++this.inventory[i].stack; - num3 -= 100; + num2 -= 100; this.DoCoins(i); if (this.inventory[i].stack == 0 && index == -1) index = i; } } - if (num3 >= 100) + if (num2 >= 100) { if (index == -1) { @@ -22433,27 +16553,27 @@ label_15: else { this.inventory[index].SetDefaults(72); - num3 -= 100; + num2 -= 100; } } } - while (num3 >= 1 && !flag) + while (num2 >= 1 && !flag) { int index = -1; for (int i = 53; i >= 0; --i) { if (index == -1 && (this.inventory[i].type == 0 || this.inventory[i].stack == 0)) index = i; - while (this.inventory[i].type == 71 && this.inventory[i].stack < this.inventory[i].maxStack && num3 >= 1) + while (this.inventory[i].type == 71 && this.inventory[i].stack < this.inventory[i].maxStack && num2 >= 1) { ++this.inventory[i].stack; - --num3; + --num2; this.DoCoins(i); if (this.inventory[i].stack == 0 && index == -1) index = i; } } - if (num3 >= 1) + if (num2 >= 1) { if (index == -1) { @@ -22462,7 +16582,7 @@ label_15: else { this.inventory[index].SetDefaults(71); - --num3; + --num2; } } } @@ -22473,65 +16593,6 @@ label_15: return false; } - public void RefreshItems() - { - this.RefreshItemArray(this.inventory); - this.RefreshItemArray(this.armor); - this.RefreshItemArray(this.dye); - this.RefreshItemArray(this.miscEquips); - this.RefreshItemArray(this.miscDyes); - this.RefreshItemArray(this.bank.item); - this.RefreshItemArray(this.bank2.item); - this.RefreshItemArray(this.bank3.item); - this.RefreshItemArray(this.bank4.item); - } - - private void RefreshItemArray(Item[] array) - { - for (int index = 0; index < array.Length; ++index) - { - if (!array[index].IsAir) - array[index].Refresh(); - } - } - - public void GetItemExpectedPrice(Item item, out int calcForSelling, out int calcForBuying) - { - if (item.shopSpecialCurrency != -1) - { - CustomCurrencyManager.GetPrices(item, out calcForSelling, out calcForBuying); - } - else - { - int storeValue = item.GetStoreValue(); - calcForSelling = storeValue; - calcForBuying = storeValue; - if (this.discount) - { - if (!item.buyOnce) - calcForBuying = (int) ((double) calcForBuying * 0.800000011920929); - if (item.isAShopItem) - calcForSelling = calcForBuying; - } - if (item.buyOnce) - { - calcForBuying = (int) Math.Round((double) calcForBuying / this.currentShoppingSettings.PriceAdjustment); - calcForSelling = (int) Math.Round((double) calcForSelling / this.currentShoppingSettings.PriceAdjustment); - } - else - { - calcForBuying = (int) Math.Round((double) calcForBuying * this.currentShoppingSettings.PriceAdjustment); - calcForSelling = (int) Math.Round((double) calcForSelling / this.currentShoppingSettings.PriceAdjustment); - } - if (!item.buyOnce) - return; - calcForBuying /= 5; - if (storeValue == 0 || calcForBuying >= 1) - return; - calcForBuying = 1; - } - } - public bool BuyItem(int price, int customCurrency = -1) { if (customCurrency != -1) @@ -22541,8 +16602,7 @@ label_15: long num2 = Utils.CoinsCount(out overFlowing, this.bank.item); long num3 = Utils.CoinsCount(out overFlowing, this.bank2.item); long num4 = Utils.CoinsCount(out overFlowing, this.bank3.item); - long num5 = Utils.CoinsCount(out overFlowing, this.bank4.item); - if (Utils.CoinsCombineStacks(out overFlowing, num1, num2, num3, num4, num5) < (long) price) + if (Utils.CoinsCombineStacks(out overFlowing, num1, num2, num3, num4) < (long) price) return false; List inv = new List(); Dictionary> dictionary = new Dictionary>(); @@ -22551,12 +16611,10 @@ label_15: List slotEmptyBank = new List(); List slotEmptyBank2 = new List(); List slotEmptyBank3 = new List(); - List slotEmptyBank4 = new List(); inv.Add(this.inventory); inv.Add(this.bank.item); inv.Add(this.bank2.item); inv.Add(this.bank3.item); - inv.Add(this.bank4.item); for (int key = 0; key < inv.Count; ++key) dictionary[key] = new List(); dictionary[0] = new List() { 58, 57, 56, 55, 54 }; @@ -22564,41 +16622,35 @@ label_15: { for (int y = 0; y < inv[index].Length; ++y) { - if (!dictionary[index].Contains(y) && inv[index][y].IsACoin) + if (!dictionary[index].Contains(y) && inv[index][y].type >= 71 && inv[index][y].type <= 74) slotCoins.Add(new Point(index, y)); } } - int num6 = 0; + int num5 = 0; + for (int y = inv[num5].Length - 1; y >= 0; --y) + { + if (!dictionary[num5].Contains(y) && (inv[num5][y].type == 0 || inv[num5][y].stack == 0)) + slotsEmpty.Add(new Point(num5, y)); + } + int num6 = 1; for (int y = inv[num6].Length - 1; y >= 0; --y) { if (!dictionary[num6].Contains(y) && (inv[num6][y].type == 0 || inv[num6][y].stack == 0)) - slotsEmpty.Add(new Point(num6, y)); + slotEmptyBank.Add(new Point(num6, y)); } - int num7 = 1; + int num7 = 2; for (int y = inv[num7].Length - 1; y >= 0; --y) { if (!dictionary[num7].Contains(y) && (inv[num7][y].type == 0 || inv[num7][y].stack == 0)) - slotEmptyBank.Add(new Point(num7, y)); + slotEmptyBank2.Add(new Point(num7, y)); } - int num8 = 2; + int num8 = 3; for (int y = inv[num8].Length - 1; y >= 0; --y) { if (!dictionary[num8].Contains(y) && (inv[num8][y].type == 0 || inv[num8][y].stack == 0)) - slotEmptyBank2.Add(new Point(num8, y)); + slotEmptyBank3.Add(new Point(num8, y)); } - int num9 = 3; - for (int y = inv[num9].Length - 1; y >= 0; --y) - { - if (!dictionary[num9].Contains(y) && (inv[num9][y].type == 0 || inv[num9][y].stack == 0)) - slotEmptyBank3.Add(new Point(num9, y)); - } - int num10 = 4; - for (int y = inv[num10].Length - 1; y >= 0; --y) - { - if (!dictionary[num10].Contains(y) && (inv[num10][y].type == 0 || inv[num10][y].stack == 0)) - slotEmptyBank4.Add(new Point(num10, y)); - } - return !Player.TryPurchasing(price, inv, slotCoins, slotsEmpty, slotEmptyBank, slotEmptyBank2, slotEmptyBank3, slotEmptyBank4); + return !Player.TryPurchasing(price, inv, slotCoins, slotsEmpty, slotEmptyBank, slotEmptyBank2, slotEmptyBank3); } private static bool TryPurchasing( @@ -22608,8 +16660,7 @@ label_15: List slotsEmpty, List slotEmptyBank, List slotEmptyBank2, - List slotEmptyBank3, - List slotEmptyBank4) + List slotEmptyBank3) { long num1 = (long) price; Dictionary dictionary = new Dictionary(); @@ -22664,10 +16715,6 @@ label_15: pointList = slotEmptyBank; if (index1 == 2 && slotEmptyBank2.Count > 0) pointList = slotEmptyBank2; - if (index1 == 3 && slotEmptyBank3.Count > 0) - pointList = slotEmptyBank3; - if (index1 == 4 && slotEmptyBank4.Count > 0) - pointList = slotEmptyBank4; if (--inv[slotCoin.X][slotCoin.Y].stack <= 0) { inv[slotCoin.X][slotCoin.Y].SetDefaults(); @@ -22702,8 +16749,6 @@ label_15: pointList = slotEmptyBank2; if (index1 == 3 && slotEmptyBank3.Count > 0) pointList = slotEmptyBank3; - if (index1 == 4 && slotEmptyBank4.Count > 0) - pointList = slotEmptyBank4; if (--inv[slotCoin.X][slotCoin.Y].stack <= 0) { inv[slotCoin.X][slotCoin.Y].SetDefaults(); @@ -22729,7 +16774,6 @@ label_15: slotEmptyBank.Sort(new Comparison(DelegateMethods.CompareYReverse)); slotEmptyBank2.Sort(new Comparison(DelegateMethods.CompareYReverse)); slotEmptyBank3.Sort(new Comparison(DelegateMethods.CompareYReverse)); - slotEmptyBank4.Sort(new Comparison(DelegateMethods.CompareYReverse)); } else { @@ -22743,11 +16787,207 @@ label_15: return flag; } + public bool BuyItemOld(int price) + { + if (price == 0) + return true; + long num1 = 0; + Item[] objArray = new Item[54]; + for (int index = 0; index < 54; ++index) + { + objArray[index] = new Item(); + objArray[index] = this.inventory[index].Clone(); + if (this.inventory[index].type == 71) + num1 += (long) this.inventory[index].stack; + if (this.inventory[index].type == 72) + num1 += (long) (this.inventory[index].stack * 100); + if (this.inventory[index].type == 73) + num1 += (long) (this.inventory[index].stack * 10000); + if (this.inventory[index].type == 74) + num1 += (long) (this.inventory[index].stack * 1000000); + } + if (num1 < (long) price) + return false; + int num2 = price; + while (num2 > 0) + { + if (num2 >= 1000000) + { + for (int index = 0; index < 54; ++index) + { + if (this.inventory[index].type == 74) + { + while (this.inventory[index].stack > 0 && num2 >= 1000000) + { + num2 -= 1000000; + --this.inventory[index].stack; + if (this.inventory[index].stack == 0) + this.inventory[index].type = 0; + } + } + } + } + if (num2 >= 10000) + { + for (int index = 0; index < 54; ++index) + { + if (this.inventory[index].type == 73) + { + while (this.inventory[index].stack > 0 && num2 >= 10000) + { + num2 -= 10000; + --this.inventory[index].stack; + if (this.inventory[index].stack == 0) + this.inventory[index].type = 0; + } + } + } + } + if (num2 >= 100) + { + for (int index = 0; index < 54; ++index) + { + if (this.inventory[index].type == 72) + { + while (this.inventory[index].stack > 0 && num2 >= 100) + { + num2 -= 100; + --this.inventory[index].stack; + if (this.inventory[index].stack == 0) + this.inventory[index].type = 0; + } + } + } + } + if (num2 >= 1) + { + for (int index = 0; index < 54; ++index) + { + if (this.inventory[index].type == 71) + { + while (this.inventory[index].stack > 0 && num2 >= 1) + { + --num2; + --this.inventory[index].stack; + if (this.inventory[index].stack == 0) + this.inventory[index].type = 0; + } + } + } + } + if (num2 > 0) + { + int index1 = -1; + for (int index2 = 53; index2 >= 0; --index2) + { + if (this.inventory[index2].type == 0 || this.inventory[index2].stack == 0) + { + index1 = index2; + break; + } + } + if (index1 >= 0) + { + bool flag = true; + if (num2 >= 10000) + { + for (int index3 = 0; index3 < 58; ++index3) + { + if (this.inventory[index3].type == 74 && this.inventory[index3].stack >= 1) + { + --this.inventory[index3].stack; + if (this.inventory[index3].stack == 0) + this.inventory[index3].type = 0; + this.inventory[index1].SetDefaults(73); + this.inventory[index1].stack = 100; + flag = false; + break; + } + } + } + else if (num2 >= 100) + { + for (int index4 = 0; index4 < 54; ++index4) + { + if (this.inventory[index4].type == 73 && this.inventory[index4].stack >= 1) + { + --this.inventory[index4].stack; + if (this.inventory[index4].stack == 0) + this.inventory[index4].type = 0; + this.inventory[index1].SetDefaults(72); + this.inventory[index1].stack = 100; + flag = false; + break; + } + } + } + else if (num2 >= 1) + { + for (int index5 = 0; index5 < 54; ++index5) + { + if (this.inventory[index5].type == 72 && this.inventory[index5].stack >= 1) + { + --this.inventory[index5].stack; + if (this.inventory[index5].stack == 0) + this.inventory[index5].type = 0; + this.inventory[index1].SetDefaults(71); + this.inventory[index1].stack = 100; + flag = false; + break; + } + } + } + if (flag) + { + if (num2 < 10000) + { + for (int index6 = 0; index6 < 54; ++index6) + { + if (this.inventory[index6].type == 73 && this.inventory[index6].stack >= 1) + { + --this.inventory[index6].stack; + if (this.inventory[index6].stack == 0) + this.inventory[index6].type = 0; + this.inventory[index1].SetDefaults(72); + this.inventory[index1].stack = 100; + flag = false; + break; + } + } + } + if (flag && num2 < 1000000) + { + for (int index7 = 0; index7 < 54; ++index7) + { + if (this.inventory[index7].type == 74 && this.inventory[index7].stack >= 1) + { + --this.inventory[index7].stack; + if (this.inventory[index7].stack == 0) + this.inventory[index7].type = 0; + this.inventory[index1].SetDefaults(73); + this.inventory[index1].stack = 100; + break; + } + } + } + } + } + else + { + for (int index8 = 0; index8 < 54; ++index8) + this.inventory[index8] = objArray[index8].Clone(); + return false; + } + } + } + return true; + } + public void AdjTiles() { int num1 = 4; int num2 = 3; - for (int index = 0; index < 623; ++index) + for (int index = 0; index < 470; ++index) { this.oldAdjTile[index] = this.adjTile[index]; this.adjTile[index] = false; @@ -22768,29 +17008,24 @@ label_15: if (Main.tile[index1, index2].active()) { this.adjTile[(int) Main.tile[index1, index2].type] = true; - switch (Main.tile[index1, index2].type) + if (Main.tile[index1, index2].type == (ushort) 302) + this.adjTile[17] = true; + if (Main.tile[index1, index2].type == (ushort) 77) + this.adjTile[17] = true; + if (Main.tile[index1, index2].type == (ushort) 133) { - case 77: - case 302: - this.adjTile[17] = true; - break; - case 133: - this.adjTile[17] = true; - this.adjTile[77] = true; - break; - case 134: - this.adjTile[16] = true; - break; - case 354: - case 469: - case 487: - this.adjTile[14] = true; - break; - case 355: - this.adjTile[13] = true; - this.adjTile[14] = true; - this.alchemyTable = true; - break; + this.adjTile[17] = true; + this.adjTile[77] = true; + } + if (Main.tile[index1, index2].type == (ushort) 134) + this.adjTile[16] = true; + if (Main.tile[index1, index2].type == (ushort) 354 || Main.tile[index1, index2].type == (ushort) 469) + this.adjTile[14] = true; + if (Main.tile[index1, index2].type == (ushort) 355) + { + this.adjTile[13] = true; + this.adjTile[14] = true; + this.alchemyTable = true; } } if (Main.tile[index1, index2].liquid > (byte) 200 && Main.tile[index1, index2].liquidType() == (byte) 0) @@ -22804,7 +17039,7 @@ label_15: if (!Main.playerInventory) return; bool flag = false; - for (int index = 0; index < 623; ++index) + for (int index = 0; index < 470; ++index) { if (this.oldAdjTile[index] != this.adjTile[index]) { @@ -22823,52 +17058,6 @@ label_15: Recipe.FindRecipes(); } - public bool IsTileTypeInInteractionRange(int targetTileType) - { - int num1 = (int) (((double) this.position.X + (double) (this.width / 2)) / 16.0); - int num2 = (int) (((double) this.position.Y + (double) this.height) / 16.0); - int num3 = Player.tileRangeX; - int num4 = Player.tileRangeY; - if (num3 > 20) - num3 = 20; - if (num4 > 20) - num4 = 20; - int num5 = Utils.Clamp(num1 - num3, 0, Main.maxTilesX - 1); - int num6 = Utils.Clamp(num1 + num3, 0, Main.maxTilesX - 1); - int num7 = Utils.Clamp(num2 - num4, 0, Main.maxTilesY - 1); - int num8 = Utils.Clamp(num2 + num4, 0, Main.maxTilesY - 1); - for (int index1 = num5; index1 <= num6; ++index1) - { - for (int index2 = num7; index2 < num8; ++index2) - { - Tile tile = Main.tile[index1, index2]; - if (tile != null && tile.active() && (int) tile.type == targetTileType) - return true; - } - } - return false; - } - - public void DisplayDollUpdate() - { - if (Main.gamePaused) - return; - ++this.miscCounter; - if (this.miscCounter < 300) - return; - this.miscCounter = 0; - } - - public bool IsColorfulDye(int dye) => dye > 0 && ItemID.Sets.ColorfulDyeValues[dye]; - - public bool ShouldDrawFootball() - { - bool flag = this.hasFootball && !this.pulley && !this.compositeBackArm.enabled; - if (this.HeldItem.type == 4743 && this.itemAnimation > 0) - flag = false; - return flag; - } - public void PlayerFrame() { if (this.swimTime > 0) @@ -22880,13 +17069,99 @@ label_15: this.head = this.armor[0].headSlot; this.body = this.armor[1].bodySlot; this.legs = this.armor[2].legSlot; + for (int index = 3; index < 8 + this.extraAccessorySlots; ++index) + { + if (this.armor[index].shieldSlot == (sbyte) 5 && this.eocDash > 0 && this.shield == (sbyte) -1) + this.shield = this.armor[index].shieldSlot; + if (this.shieldRaised && this.shield == (sbyte) -1 && this.armor[index].shieldSlot != (sbyte) -1) + this.shield = this.armor[index].shieldSlot; + if ((this.shield <= (sbyte) 0 || this.armor[index].frontSlot < (sbyte) 1 || this.armor[index].frontSlot > (sbyte) 4) && (this.front < (sbyte) 1 || this.front > (sbyte) 4 || this.armor[index].shieldSlot <= (sbyte) 0)) + { + if (this.armor[index].wingSlot > (sbyte) 0) + { + if (!this.hideVisual[index] || (double) this.velocity.Y != 0.0 && !this.mount.Active) + this.wings = (int) this.armor[index].wingSlot; + else + continue; + } + if (!this.hideVisual[index]) + { + if (this.armor[index].stringColor > 0) + this.stringColor = this.armor[index].stringColor; + if (this.armor[index].handOnSlot > (sbyte) 0) + this.handon = this.armor[index].handOnSlot; + if (this.armor[index].handOffSlot > (sbyte) 0) + this.handoff = this.armor[index].handOffSlot; + if (this.armor[index].backSlot > (sbyte) 0) + { + this.back = this.armor[index].backSlot; + this.front = (sbyte) -1; + } + if (this.armor[index].frontSlot > (sbyte) 0) + this.front = this.armor[index].frontSlot; + if (this.armor[index].shoeSlot > (sbyte) 0) + this.shoe = this.armor[index].shoeSlot; + if (this.armor[index].waistSlot > (sbyte) 0) + this.waist = this.armor[index].waistSlot; + if (this.armor[index].shieldSlot > (sbyte) 0) + this.shield = this.armor[index].shieldSlot; + if (this.armor[index].neckSlot > (sbyte) 0) + this.neck = this.armor[index].neckSlot; + if (this.armor[index].faceSlot > (sbyte) 0) + this.face = this.armor[index].faceSlot; + if (this.armor[index].balloonSlot > (sbyte) 0) + this.balloon = this.armor[index].balloonSlot; + if (this.armor[index].type == 3580) + this.yoraiz0rEye = index - 2; + if (this.armor[index].type == 3581) + this.yoraiz0rDarkness = true; + if (this.armor[index].type == 3929) + this.leinforsHair = true; + } + } + } + for (int index = 13; index < 18 + this.extraAccessorySlots; ++index) + { + if (this.armor[index].stringColor > 0) + this.stringColor = this.armor[index].stringColor; + if (this.armor[index].handOnSlot > (sbyte) 0) + this.handon = this.armor[index].handOnSlot; + if (this.armor[index].handOffSlot > (sbyte) 0) + this.handoff = this.armor[index].handOffSlot; + if (this.armor[index].backSlot > (sbyte) 0) + { + this.back = this.armor[index].backSlot; + this.front = (sbyte) -1; + } + if (this.armor[index].frontSlot > (sbyte) 0) + this.front = this.armor[index].frontSlot; + if (this.armor[index].shoeSlot > (sbyte) 0) + this.shoe = this.armor[index].shoeSlot; + if (this.armor[index].waistSlot > (sbyte) 0) + this.waist = this.armor[index].waistSlot; + if (this.armor[index].shieldSlot > (sbyte) 0) + this.shield = this.armor[index].shieldSlot; + if (this.armor[index].neckSlot > (sbyte) 0) + this.neck = this.armor[index].neckSlot; + if (this.armor[index].faceSlot > (sbyte) 0) + this.face = this.armor[index].faceSlot; + if (this.armor[index].balloonSlot > (sbyte) 0) + this.balloon = this.armor[index].balloonSlot; + if (this.armor[index].wingSlot > (sbyte) 0) + this.wings = (int) this.armor[index].wingSlot; + if (this.armor[index].type == 3580) + this.yoraiz0rEye = index - 2; + if (this.armor[index].type == 3581) + this.yoraiz0rDarkness = true; + if (this.armor[index].type == 3929) + this.leinforsHair = true; + } if (this.armor[10].headSlot >= 0) this.head = this.armor[10].headSlot; if (this.armor[11].bodySlot >= 0) this.body = this.armor[11].bodySlot; if (this.armor[12].legSlot >= 0) this.legs = this.armor[12].legSlot; - this.UpdateVisibleAccessories(); this.wearsRobe = false; bool somethingSpecial = false; int num1 = Player.SetMatch(1, this.body, this.Male, ref this.wearsRobe); @@ -22903,29 +17178,12 @@ label_15: this.shield = (sbyte) 0; this.handoff = (sbyte) 0; } - if (this.body >= 0) - { - sbyte num4 = (sbyte) (this.Male ? ArmorIDs.Body.Sets.IncludedCapeBack : ArmorIDs.Body.Sets.IncludedCapeBackFemale)[this.body]; - if (num4 != (sbyte) -1 && this.back == (sbyte) -1 && !this.sitting.isSitting) - { - this.back = num4; - this.cBack = this.cBody; - } - sbyte num5 = (sbyte) ArmorIDs.Body.Sets.IncludedCapeFront[this.body]; - if (num5 != (sbyte) -1 && this.front == (sbyte) -1) - { - this.front = num5; - this.cFront = this.cBody; - } - ArmorIDs.Body.Sets.IncludeCapeFrontAndBackInfo frontAndBackInfo = ArmorIDs.Body.Sets.IncludeCapeFrontAndBack[this.body]; - if (!frontAndBackInfo.Invalid && this.back == (sbyte) -1 && this.front == (sbyte) -1 && !this.sitting.isSitting) - { - this.front = frontAndBackInfo.frontCape; - this.back = frontAndBackInfo.backCape; - this.cFront = this.cBody; - this.cBack = this.cBody; - } - } + if (this.body == 206 && this.back == (sbyte) -1) + this.back = (sbyte) 12; + if (this.body == 207 && this.back == (sbyte) -1) + this.back = (sbyte) 13; + if (this.body == 205 && this.back == (sbyte) -1) + this.back = (sbyte) 11; if (this.legs == 67) this.shoe = (sbyte) 0; if (this.legs == 140) @@ -22936,7 +17194,7 @@ label_15: this.body = 21; this.head = 38; } - bool flag1 = this.wet && !this.lavaWet && (!this.mount.Active || !this.mount.IsConsideredASlimeMount); + bool flag = this.wet && !this.lavaWet && (!this.mount.Active || this.mount.Type != 3); if (this.merman || this.forceMerman) { if (!this.hideMerman) @@ -22945,7 +17203,7 @@ label_15: this.legs = 21; this.body = 22; } - if (flag1) + if (flag) this.wings = 0; } this.socialShadowRocketBoots = false; @@ -22958,14 +17216,11 @@ label_15: this.armorEffectDrawShadowBasilisk = false; this.armorEffectDrawOutlinesForbidden = false; this.armorEffectDrawShadowEOCShield = false; - if (!this.isDisplayDollOrInanimate) - { - if (this.head == 101 && this.body == 66 && this.legs == 55) - this.socialGhost = true; - if (this.head == 156 && this.body == 66 && this.legs == 55) - this.socialGhost = true; - this.SetArmorEffectVisuals(this); - } + if (this.head == 101 && this.body == 66 && this.legs == 55) + this.socialGhost = true; + if (this.head == 156 && this.body == 66 && this.legs == 55) + this.socialGhost = true; + this.SetArmorEffectVisuals(this); this.hermesStepSound.SoundType = 17; this.hermesStepSound.SoundStyle = -1; this.hermesStepSound.IntendedCooldown = 9; @@ -22973,14 +17228,15 @@ label_15: this.turtleArmor = true; if (this.head == 162 && this.body == 170 && this.legs == 105) this.spiderArmor = true; - this.ApplyArmorSoundAndDustChanges(); + if ((this.head == 75 || this.head == 7) && this.body == 7 && this.legs == 7) + this.boneArmor = true; if (this.legs == 140) { this.hermesStepSound.SoundType = 2; this.hermesStepSound.SoundStyle = 24; this.hermesStepSound.IntendedCooldown = 6; } - if (this.wings > 0 && this.wings != 33) + if (this.wings > 0) { this.back = (sbyte) -1; this.front = (sbyte) -1; @@ -22989,110 +17245,111 @@ label_15: this.face = (sbyte) -1; if (this.webbed || this.frozen || this.stoned || Main.gamePaused && !Main.gameMenu) return; - if (!this.isDisplayDollOrInanimate) + if ((this.body == 68 && this.legs == 57 && this.head == 106 || this.body == 74 && this.legs == 63 && this.head == 106) && Main.rand.Next(10) == 0) { - if ((this.body == 68 && this.legs == 57 && this.head == 106 || this.body == 74 && this.legs == 63 && this.head == 106) && Main.rand.Next(10) == 0) + int index = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 2f, (float) ((double) this.position.Y - 2.0 - (double) this.velocity.Y * 2.0)), this.width, this.height, 43, Alpha: 100, newColor: new Color((int) byte.MaxValue, 0, (int) byte.MaxValue), Scale: 0.3f); + Main.dust[index].fadeIn = 0.8f; + Main.dust[index].noGravity = true; + Main.dust[index].velocity *= 2f; + Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.ArmorSetDye(), this); + } + if (this.wings == 27) + { + float R = 0.4f * this.stealth; + Lighting.AddLight((int) this.Center.X / 16, (int) this.Center.Y / 16, R, R * 0.9f, R * 0.2f); + } + if (this.head == 5 && this.body == 5 && this.legs == 5) + this.socialShadowRocketBoots = true; + if (this.head == 5 && this.body == 5 && this.legs == 5 && Main.rand.Next(10) == 0) + { + int index = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 14, Alpha: 200, Scale: 1.2f); + Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.ArmorSetDye(), this); + } + if (this.head == 76 && this.body == 49 && this.legs == 45) + this.socialShadowRocketBoots = true; + if (this.head == 74 && this.body == 48 && this.legs == 44) + this.socialShadowRocketBoots = true; + if (this.head == 74 && this.body == 48 && this.legs == 44 && Main.rand.Next(10) == 0) + { + int index = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 14, Alpha: 200, Scale: 1.2f); + Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.ArmorSetDye(), this); + } + if (this.head == 57 && this.body == 37 && this.legs == 35) + { + int maxValue = 10; + if ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) > 1.0) + maxValue = 2; + if (Main.rand.Next(maxValue) == 0) { - int index = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 2f, (float) ((double) this.position.Y - 2.0 - (double) this.velocity.Y * 2.0)), this.width, this.height, 43, Alpha: 100, newColor: new Color((int) byte.MaxValue, 0, (int) byte.MaxValue), Scale: 0.3f); - Main.dust[index].fadeIn = 0.8f; + int index = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 115, Alpha: 140, Scale: 0.75f); Main.dust[index].noGravity = true; - Main.dust[index].velocity *= 2f; + Main.dust[index].fadeIn = 1.5f; + Main.dust[index].velocity *= 0.3f; + Main.dust[index].velocity += this.velocity * 0.2f; Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.ArmorSetDye(), this); } - if (this.wings == 27 && this.wingsLogic == this.wings) + } + if (this.head == 6 && this.body == 6 && this.legs == 6 && (double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) > 1.0 && !this.rocketFrame) + { + for (int index1 = 0; index1 < 2; ++index1) { - float r = 0.4f * this.stealth; - Lighting.AddLight((int) this.Center.X / 16, (int) this.Center.Y / 16, r, r * 0.9f, r * 0.2f); + int index2 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 2f, (float) ((double) this.position.Y - 2.0 - (double) this.velocity.Y * 2.0)), this.width, this.height, 6, Alpha: 100, Scale: 2f); + Main.dust[index2].noGravity = true; + Main.dust[index2].noLight = true; + Main.dust[index2].velocity.X -= this.velocity.X * 0.5f; + Main.dust[index2].velocity.Y -= this.velocity.Y * 0.5f; + Main.dust[index2].shader = GameShaders.Armor.GetSecondaryShader(this.ArmorSetDye(), this); } - if (this.head == 5 && this.body == 5 && this.legs == 5) - this.socialShadowRocketBoots = true; - if (this.head == 5 && this.body == 5 && this.legs == 5 && Main.rand.Next(10) == 0) + } + if (this.head == 8 && this.body == 8 && this.legs == 8 && (double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) > 1.0) + { + int index = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 2f, (float) ((double) this.position.Y - 2.0 - (double) this.velocity.Y * 2.0)), this.width, this.height, 40, Alpha: 50, Scale: 1.4f); + Main.dust[index].noGravity = true; + Main.dust[index].velocity.X = this.velocity.X * 0.25f; + Main.dust[index].velocity.Y = this.velocity.Y * 0.25f; + Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.ArmorSetDye(), this); + } + if (this.head == 9 && this.body == 9 && this.legs == 9 && (double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) > 1.0 && !this.rocketFrame) + { + for (int index3 = 0; index3 < 2; ++index3) { - int index = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 14, Alpha: 200, Scale: 1.2f); - Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.ArmorSetDye(), this); + int index4 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 2f, (float) ((double) this.position.Y - 2.0 - (double) this.velocity.Y * 2.0)), this.width, this.height, 6, Alpha: 100, Scale: 2f); + Main.dust[index4].noGravity = true; + Main.dust[index4].noLight = true; + Main.dust[index4].velocity.X -= this.velocity.X * 0.5f; + Main.dust[index4].velocity.Y -= this.velocity.Y * 0.5f; + Main.dust[index4].shader = GameShaders.Armor.GetSecondaryShader(this.ArmorSetDye(), this); } - if (this.head == 76 && this.body == 49 && this.legs == 45) - this.socialShadowRocketBoots = true; - if (this.head == 74 && this.body == 48 && this.legs == 44) - this.socialShadowRocketBoots = true; - if (this.head == 74 && this.body == 48 && this.legs == 44 && Main.rand.Next(10) == 0) + } + if (this.body == 18 && this.legs == 17 && (this.head == 32 || this.head == 33 || this.head == 34) && Main.rand.Next(10) == 0) + { + int index = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 2f, (float) ((double) this.position.Y - 2.0 - (double) this.velocity.Y * 2.0)), this.width, this.height, 43, Alpha: 100, Scale: 0.3f); + Main.dust[index].fadeIn = 0.8f; + Main.dust[index].velocity *= 0.0f; + Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.ArmorSetDye(), this); + } + if (this.body == 24 && this.legs == 23 && (this.head == 42 || this.head == 43 || this.head == 41) && (double) this.velocity.X != 0.0 && (double) this.velocity.Y != 0.0 && Main.rand.Next(10) == 0) + { + int index = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 2f, (float) ((double) this.position.Y - 2.0 - (double) this.velocity.Y * 2.0)), this.width, this.height, 43, Alpha: 100, Scale: 0.3f); + Main.dust[index].fadeIn = 0.8f; + Main.dust[index].velocity *= 0.0f; + Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.ArmorSetDye(), this); + } + if (this.body == 36 && this.head == 56 && (double) this.velocity.X != 0.0 && (double) this.velocity.Y == 0.0) + { + for (int index5 = 0; index5 < 2; ++index5) { - int index = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 14, Alpha: 200, Scale: 1.2f); - Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.ArmorSetDye(), this); + int index6 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + ((double) this.gravDir == 1.0 ? (float) (this.height - 2) : -4f)), this.width, 6, 106, Alpha: 100, Scale: 0.1f); + Main.dust[index6].fadeIn = 1f; + Main.dust[index6].noGravity = true; + Main.dust[index6].velocity *= 0.2f; + Main.dust[index6].shader = GameShaders.Armor.GetSecondaryShader(this.ArmorSetDye(), this); } - if (this.head == 57 && this.body == 37 && this.legs == 35) - { - int maxValue = 10; - if ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) > 1.0) - maxValue = 2; - if (Main.rand.Next(maxValue) == 0) - { - int index = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 115, Alpha: 140, Scale: 0.75f); - Main.dust[index].noGravity = true; - Main.dust[index].fadeIn = 1.5f; - Main.dust[index].velocity *= 0.3f; - Main.dust[index].velocity += this.velocity * 0.2f; - Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.ArmorSetDye(), this); - } - } - if (this.head == 6 && this.body == 6 && this.legs == 6 && (double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) > 1.0 && !this.rocketFrame) - { - for (int index1 = 0; index1 < 2; ++index1) - { - int index2 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 2f, (float) ((double) this.position.Y - 2.0 - (double) this.velocity.Y * 2.0)), this.width, this.height, 6, Alpha: 100, Scale: 2f); - Main.dust[index2].noGravity = true; - Main.dust[index2].noLight = true; - Main.dust[index2].velocity.X -= this.velocity.X * 0.5f; - Main.dust[index2].velocity.Y -= this.velocity.Y * 0.5f; - Main.dust[index2].shader = GameShaders.Armor.GetSecondaryShader(this.ArmorSetDye(), this); - } - } - if (this.head == 8 && this.body == 8 && this.legs == 8 && (double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) > 1.0) - { - int index = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 2f, (float) ((double) this.position.Y - 2.0 - (double) this.velocity.Y * 2.0)), this.width, this.height, 40, Alpha: 50, Scale: 1.4f); - Main.dust[index].noGravity = true; - Main.dust[index].velocity.X = this.velocity.X * 0.25f; - Main.dust[index].velocity.Y = this.velocity.Y * 0.25f; - Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.ArmorSetDye(), this); - } - if (this.head == 9 && this.body == 9 && this.legs == 9 && (double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) > 1.0 && !this.rocketFrame) - { - for (int index3 = 0; index3 < 2; ++index3) - { - int index4 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 2f, (float) ((double) this.position.Y - 2.0 - (double) this.velocity.Y * 2.0)), this.width, this.height, 6, Alpha: 100, Scale: 2f); - Main.dust[index4].noGravity = true; - Main.dust[index4].noLight = true; - Main.dust[index4].velocity.X -= this.velocity.X * 0.5f; - Main.dust[index4].velocity.Y -= this.velocity.Y * 0.5f; - Main.dust[index4].shader = GameShaders.Armor.GetSecondaryShader(this.ArmorSetDye(), this); - } - } - if (this.body == 18 && this.legs == 17 && (this.head == 32 || this.head == 33 || this.head == 34) && Main.rand.Next(10) == 0) - { - int index = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 2f, (float) ((double) this.position.Y - 2.0 - (double) this.velocity.Y * 2.0)), this.width, this.height, 43, Alpha: 100, Scale: 0.3f); - Main.dust[index].fadeIn = 0.8f; - Main.dust[index].velocity *= 0.0f; - Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.ArmorSetDye(), this); - } - if ((this.body == 24 || this.body == 229) && (this.legs == 23 || this.legs == 212) && (this.head == 43 || this.head == 41 || this.head == 42 || this.head == 254 || this.head == (int) byte.MaxValue || this.head == 256 || this.head == 257 || this.head == 258) && (double) this.velocity.X != 0.0 && (double) this.velocity.Y != 0.0 && Main.rand.Next(10) == 0) - { - int index = Dust.NewDust(new Vector2(this.position.X - this.velocity.X * 2f, (float) ((double) this.position.Y - 2.0 - (double) this.velocity.Y * 2.0)), this.width, this.height, 43, Alpha: 100, Scale: 0.3f); - Main.dust[index].fadeIn = 0.8f; - Main.dust[index].velocity *= 0.0f; - Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(this.ArmorSetDye(), this); - } - if (this.body == 36 && this.head == 56 && (double) this.velocity.X != 0.0 && (double) this.velocity.Y == 0.0) - { - for (int index5 = 0; index5 < 2; ++index5) - { - int index6 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + ((double) this.gravDir == 1.0 ? (float) (this.height - 2) : -4f)), this.width, 6, 106, Alpha: 100, Scale: 0.1f); - Main.dust[index6].fadeIn = 1f; - Main.dust[index6].noGravity = true; - Main.dust[index6].velocity *= 0.2f; - Main.dust[index6].shader = GameShaders.Armor.GetSecondaryShader(this.ArmorSetDye(), this); - } - } - if (this.body == 27 && this.head == 46 && this.legs == 26 && (double) this.velocity.X != 0.0 && (double) this.velocity.Y == 0.0 && this.miscCounter % 2 == 0) + } + if (this.body == 27 && this.head == 46 && this.legs == 26) + { + this.frostArmor = true; + if ((double) this.velocity.X != 0.0 && (double) this.velocity.Y == 0.0 && this.miscCounter % 2 == 0) { for (int index7 = 0; index7 < 2; ++index7) { @@ -23106,28 +17363,13 @@ label_15: } } } - this.drawingFootball = false; - if (this.ShouldDrawFootball()) - { - this.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Full, (float) (0.314159274101257 * (double) this.direction * -1.0)); - this.drawingFootball = true; - } - Item.GetDrawHitbox(this.HeldItem.type, this); - bool flag2 = this.CanVisuallyHoldItem(this.HeldItem); - bool flag3 = this.HeldItem.type != 4952; if (this.mount.Active) { this.legFrameCounter = 0.0; this.legFrame.Y = this.legFrame.Height * 6; - if (this.mount.Type == 23 || this.mount.Type == 45 || this.mount.Type == 48) - { - ref Microsoft.Xna.Framework.Rectangle local = ref this.legFrame; - Microsoft.Xna.Framework.Rectangle legFrame = this.legFrame; - local.Y = 0; - } if ((double) this.velocity.Y != 0.0) { - if (this.mount.FlyTime > 0 && this.jump == 0 && this.controlJump && !this.mount.CanHover()) + if (this.mount.FlyTime > 0 && this.jump == 0 && this.controlJump && !this.mount.CanHover) { if (this.mount.Type == 0) { @@ -23162,29 +17404,57 @@ label_15: } } } - this.mount.TryBeginningFlight(this, 3); this.mount.UpdateFrame(this, 3, this.velocity); - this.mount.TryLanding(this); } else if (this.wet) - { this.mount.UpdateFrame(this, 4, this.velocity); - } else - { - this.mount.TryBeginningFlight(this, 2); this.mount.UpdateFrame(this, 2, this.velocity); - this.mount.TryLanding(this); - } + } + else if ((double) this.velocity.X == 0.0 || (this.slippy || this.slippy2 || this.windPushed) && !this.controlLeft && !this.controlRight) + this.mount.UpdateFrame(this, 0, this.velocity); + else + this.mount.UpdateFrame(this, 1, this.velocity); + } + else if (this.legs == 140) + { + this.legFrameCounter = 0.0; + this.legFrame.Y = this.legFrame.Height * ((double) this.velocity.Y != 0.0).ToInt(); + if (this.wings == 22 || this.wings == 28) + this.legFrame.Y = 0; + } + else if (this.swimTime > 0) + { + this.legFrameCounter += 2.0; + while (this.legFrameCounter > 8.0) + { + this.legFrameCounter -= 8.0; + this.legFrame.Y += this.legFrame.Height; + } + if (this.legFrame.Y < this.legFrame.Height * 7) + this.legFrame.Y = this.legFrame.Height * 19; + else if (this.legFrame.Y > this.legFrame.Height * 19) + this.legFrame.Y = this.legFrame.Height * 7; + } + else if ((double) this.velocity.Y != 0.0 || this.grappling[0] > -1) + { + this.legFrameCounter = 0.0; + this.legFrame.Y = this.legFrame.Height * 5; + if (this.wings == 22 || this.wings == 28) + this.legFrame.Y = 0; + } + else if ((double) this.velocity.X != 0.0) + { + if ((this.slippy || this.slippy2 || this.windPushed) && !this.controlLeft && !this.controlRight) + { + this.legFrameCounter = 0.0; + ref Microsoft.Xna.Framework.Rectangle local = ref this.legFrame; + Microsoft.Xna.Framework.Rectangle legFrame = this.legFrame; + local.Y = 0; } else - this.mount.UpdateFrame(this, this.mount.GetIntendedGroundedFrame(this), this.velocity); - } - else if (this.legs != 140) - { - if (this.swimTime > 0) { - this.legFrameCounter += 2.0; + this.legFrameCounter += (double) Math.Abs(this.velocity.X) * 1.3; while (this.legFrameCounter > 8.0) { this.legFrameCounter -= 8.0; @@ -23195,43 +17465,13 @@ label_15: else if (this.legFrame.Y > this.legFrame.Height * 19) this.legFrame.Y = this.legFrame.Height * 7; } - else if ((double) this.velocity.Y != 0.0 || this.grappling[0] > -1) - { - this.legFrameCounter = 0.0; - this.legFrame.Y = this.legFrame.Height * 5; - if ((this.wings == 22 || this.wings == 28 || this.wings == 45) && this.ShouldDrawWingsThatAreAlwaysAnimated()) - this.legFrame.Y = 0; - } - else if ((double) this.velocity.X != 0.0) - { - if ((this.slippy || this.slippy2 || this.windPushed) && !this.controlLeft && !this.controlRight) - { - this.legFrameCounter = 0.0; - ref Microsoft.Xna.Framework.Rectangle local = ref this.legFrame; - Microsoft.Xna.Framework.Rectangle legFrame = this.legFrame; - local.Y = 0; - } - else - { - this.legFrameCounter += (double) Math.Abs(this.velocity.X) * 1.3; - while (this.legFrameCounter > 8.0) - { - this.legFrameCounter -= 8.0; - this.legFrame.Y += this.legFrame.Height; - } - if (this.legFrame.Y < this.legFrame.Height * 7) - this.legFrame.Y = this.legFrame.Height * 19; - else if (this.legFrame.Y > this.legFrame.Height * 19) - this.legFrame.Y = this.legFrame.Height * 7; - } - } - else - { - this.legFrameCounter = 0.0; - ref Microsoft.Xna.Framework.Rectangle local = ref this.legFrame; - Microsoft.Xna.Framework.Rectangle legFrame = this.legFrame; - local.Y = 0; - } + } + else + { + this.legFrameCounter = 0.0; + ref Microsoft.Xna.Framework.Rectangle local = ref this.legFrame; + Microsoft.Xna.Framework.Rectangle legFrame = this.legFrame; + local.Y = 0; } if (this.carpetFrame >= 0) { @@ -23242,14 +17482,12 @@ label_15: } if (this.sandStorm) { - if (this.grappling[0] >= 0) - this.sandStorm = false; if (this.miscCounter % 4 == 0 && this.itemAnimation == 0) { this.ChangeDir(this.direction * -1); if (this.inventory[this.selectedItem].holdStyle == 2) { - if (this.inventory[this.selectedItem].type == 946 || this.inventory[this.selectedItem].type == 4707) + if (this.inventory[this.selectedItem].type == 946) this.itemLocation.X = this.position.X + (float) this.width * 0.5f - (float) (16 * this.direction); if (this.inventory[this.selectedItem].type == 186) { @@ -23263,116 +17501,120 @@ label_15: Microsoft.Xna.Framework.Rectangle legFrame = this.legFrame; local.Y = 0; } - else if (((this.itemAnimation <= 0 ? 0 : (this.inventory[this.selectedItem].useStyle != 10 ? 1 : 0)) & (flag3 ? 1 : 0)) != 0) + if (this.itemAnimation > 0 && this.inventory[this.selectedItem].useStyle != 10) { if (this.inventory[this.selectedItem].useStyle == 1 || this.inventory[this.selectedItem].type == 0) - this.bodyFrame.Y = (double) this.itemAnimation >= (double) this.itemAnimationMax * 0.333 ? ((double) this.itemAnimation >= (double) this.itemAnimationMax * 0.666 ? this.bodyFrame.Height : this.bodyFrame.Height * 2) : this.bodyFrame.Height * 3; - else if (this.inventory[this.selectedItem].useStyle == 7) - this.bodyFrame.Y = (double) this.itemAnimation <= (double) this.itemAnimationMax * 0.5 ? this.bodyFrame.Height * 2 : this.bodyFrame.Height * 3; - else if (this.inventory[this.selectedItem].useStyle == 2) - this.bodyFrame.Y = this.bodyFrame.Height * 3; - else if (this.inventory[this.selectedItem].useStyle == 11) - this.bodyFrame.Y = (double) this.itemAnimation <= (double) this.itemAnimationMax * 0.5 ? ((double) this.itemAnimation <= (double) this.itemAnimationMax * 0.15 ? this.bodyFrame.Height * 2 : this.bodyFrame.Height * 3) : this.bodyFrame.Height * 4; - else if (this.inventory[this.selectedItem].useStyle == 9) - this.bodyFrame.Y = 0; - else if (this.inventory[this.selectedItem].useStyle == 6) { - float num6 = (float) (1.0 - (double) this.itemAnimation / (double) this.itemAnimationMax) * 6f; - if ((double) num6 > 1.0) - num6 = 1f; - this.bodyFrame.Y = (double) num6 < 0.5 ? this.bodyFrame.Height * 2 : this.bodyFrame.Height * 3; + if ((double) this.itemAnimation < (double) this.itemAnimationMax * 0.333) + this.bodyFrame.Y = this.bodyFrame.Height * 3; + else if ((double) this.itemAnimation < (double) this.itemAnimationMax * 0.666) + this.bodyFrame.Y = this.bodyFrame.Height * 2; + else + this.bodyFrame.Y = this.bodyFrame.Height; + } + else if (this.inventory[this.selectedItem].useStyle == 2) + { + if ((double) this.itemAnimation > (double) this.itemAnimationMax * 0.5) + this.bodyFrame.Y = this.bodyFrame.Height * 3; + else + this.bodyFrame.Y = this.bodyFrame.Height * 2; } else if (this.inventory[this.selectedItem].useStyle == 3) - this.bodyFrame.Y = (double) this.itemAnimation <= (double) this.itemAnimationMax * 0.666 ? this.bodyFrame.Height * 3 : this.bodyFrame.Height * 3; - else if (this.inventory[this.selectedItem].useStyle == 4) - this.bodyFrame.Y = this.bodyFrame.Height * 2; - else if (this.inventory[this.selectedItem].useStyle == 8) - this.bodyFrame.Y = 0; - else if (this.inventory[this.selectedItem].useStyle == 12) - this.bodyFrame.Y = this.bodyFrame.Height * 3; - else if (this.inventory[this.selectedItem].useStyle == 13) - this.bodyFrame.Y = (double) this.itemAnimation >= (double) this.itemAnimationMax * 0.333 ? ((double) this.itemAnimation >= (double) this.itemAnimationMax * 0.666 ? this.bodyFrame.Height : this.bodyFrame.Height * 2) : this.bodyFrame.Height * 3; - else if (this.inventory[this.selectedItem].useStyle == 5) { + if ((double) this.itemAnimation > (double) this.itemAnimationMax * 0.666) + this.bodyFrame.Y = this.bodyFrame.Height * 3; + else + this.bodyFrame.Y = this.bodyFrame.Height * 3; + } + else if (this.inventory[this.selectedItem].useStyle == 4) + { + this.bodyFrame.Y = this.bodyFrame.Height * 2; + } + else + { + if (this.inventory[this.selectedItem].useStyle != 5) + return; if (this.inventory[this.selectedItem].type == 281 || this.inventory[this.selectedItem].type == 986) { this.bodyFrame.Y = this.bodyFrame.Height * 2; } else { - double num7 = (double) this.itemRotation * (double) this.direction; + double num4 = (double) this.itemRotation * (double) this.direction; this.bodyFrame.Y = this.bodyFrame.Height * 3; - if (num7 < -0.75) + if (num4 < -0.75) { this.bodyFrame.Y = this.bodyFrame.Height * 2; if ((double) this.gravDir == -1.0) this.bodyFrame.Y = this.bodyFrame.Height * 4; } - if (num7 > 0.6) - { - this.bodyFrame.Y = this.bodyFrame.Height * 4; - if ((double) this.gravDir == -1.0) - this.bodyFrame.Y = this.bodyFrame.Height * 2; - } + if (num4 <= 0.6) + return; + this.bodyFrame.Y = this.bodyFrame.Height * 4; + if ((double) this.gravDir != -1.0) + return; + this.bodyFrame.Y = this.bodyFrame.Height * 2; } } } - else if (this.pulley) - this.bodyFrame.Y = this.pulleyDir != (byte) 2 ? this.bodyFrame.Height * 2 : this.bodyFrame.Height; - else if (flag2 && this.inventory[this.selectedItem].holdStyle == 1 && (!this.wet || !this.inventory[this.selectedItem].noWet) && (!this.happyFunTorchTime || this.inventory[this.selectedItem].createTile != 4)) - this.bodyFrame.Y = this.bodyFrame.Height * 3; - else if (flag2 && this.inventory[this.selectedItem].holdStyle == 2 && (!this.wet || !this.inventory[this.selectedItem].noWet)) - this.bodyFrame.Y = this.bodyFrame.Height * 2; - else if (flag2 && this.inventory[this.selectedItem].holdStyle == 3) - this.bodyFrame.Y = this.bodyFrame.Height * 3; - else if (flag2 && this.inventory[this.selectedItem].holdStyle == 5) - this.bodyFrame.Y = this.bodyFrame.Height * 3; - else if (flag2 && this.inventory[this.selectedItem].holdStyle == 4 && (double) this.velocity.Y == 0.0 && (double) this.gravDir == 1.0) - { - ref Microsoft.Xna.Framework.Rectangle local = ref this.bodyFrame; - Microsoft.Xna.Framework.Rectangle bodyFrame = this.bodyFrame; - local.Y = 0; - } - else if (this.shieldRaised) - this.bodyFrame.Y = this.bodyFrame.Height * 10; else if (this.mount.Active) { this.bodyFrameCounter = 0.0; this.bodyFrame.Y = this.bodyFrame.Height * this.mount.BodyFrame; } + else if (this.pulley) + { + if (this.pulleyDir == (byte) 2) + this.bodyFrame.Y = this.bodyFrame.Height; + else + this.bodyFrame.Y = this.bodyFrame.Height * 2; + } + else if (this.inventory[this.selectedItem].holdStyle == 1 && (!this.wet || !this.inventory[this.selectedItem].noWet)) + this.bodyFrame.Y = this.bodyFrame.Height * 3; + else if (this.inventory[this.selectedItem].holdStyle == 2 && (!this.wet || !this.inventory[this.selectedItem].noWet)) + this.bodyFrame.Y = this.bodyFrame.Height * 2; + else if (this.inventory[this.selectedItem].holdStyle == 3) + this.bodyFrame.Y = this.bodyFrame.Height * 3; + else if (this.shieldRaised) + this.bodyFrame.Y = this.bodyFrame.Height * 10; else if (this.grappling[0] >= 0) { this.sandStorm = false; - this.CancelAllJumpVisualEffects(); + this.dJumpEffectCloud = false; + this.dJumpEffectSandstorm = false; + this.dJumpEffectBlizzard = false; + this.dJumpEffectFart = false; + this.dJumpEffectSail = false; + this.dJumpEffectUnicorn = false; Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); - float num8 = 0.0f; - float num9 = 0.0f; + float num5 = 0.0f; + float num6 = 0.0f; for (int index = 0; index < this.grapCount; ++index) { - num8 += Main.projectile[this.grappling[index]].position.X + (float) (Main.projectile[this.grappling[index]].width / 2); - num9 += Main.projectile[this.grappling[index]].position.Y + (float) (Main.projectile[this.grappling[index]].height / 2); + num5 += Main.projectile[this.grappling[index]].position.X + (float) (Main.projectile[this.grappling[index]].width / 2); + num6 += Main.projectile[this.grappling[index]].position.Y + (float) (Main.projectile[this.grappling[index]].height / 2); } - float num10 = num8 / (float) this.grapCount; - float num11 = num9 / (float) this.grapCount; - float num12 = num10 - vector2.X; - float num13 = num11 - vector2.Y; - if ((double) num13 < 0.0 && (double) Math.Abs(num13) > (double) Math.Abs(num12)) + float num7 = num5 / (float) this.grapCount; + float num8 = num6 / (float) this.grapCount; + float num9 = num7 - vector2.X; + float num10 = num8 - vector2.Y; + if ((double) num10 < 0.0 && (double) Math.Abs(num10) > (double) Math.Abs(num9)) { this.bodyFrame.Y = this.bodyFrame.Height * 2; - if ((double) this.gravDir == -1.0) - this.bodyFrame.Y = this.bodyFrame.Height * 4; + if ((double) this.gravDir != -1.0) + return; + this.bodyFrame.Y = this.bodyFrame.Height * 4; } - else if ((double) num13 > 0.0 && (double) Math.Abs(num13) > (double) Math.Abs(num12)) + else if ((double) num10 > 0.0 && (double) Math.Abs(num10) > (double) Math.Abs(num9)) { this.bodyFrame.Y = this.bodyFrame.Height * 4; - if ((double) this.gravDir == -1.0) - this.bodyFrame.Y = this.bodyFrame.Height * 2; + if ((double) this.gravDir != -1.0) + return; + this.bodyFrame.Y = this.bodyFrame.Height * 2; } else this.bodyFrame.Y = this.bodyFrame.Height * 3; } - else if (this.wet && this.ShouldFloatInWater) - this.bodyFrame.Y = this.bodyFrame.Height * 9; else if (this.swimTime > 0) { if (this.swimTime > 20) @@ -23394,7 +17636,7 @@ label_15: } else if ((double) this.velocity.Y != 0.0) { - this.bodyFrame.Y = !this.sliding ? (this.sandStorm || this.carpetFrame >= 0 ? this.bodyFrame.Height * 6 : (this.eocDash <= 0 ? (this.wings <= 0 ? this.bodyFrame.Height * 5 : (this.wings == 22 || this.wings == 28 || this.wings == 45 ? 0 : ((double) this.velocity.Y <= 0.0 ? this.bodyFrame.Height * 6 : (!this.controlJump ? this.bodyFrame.Height * 5 : this.bodyFrame.Height * 6)))) : this.bodyFrame.Height * 6)) : this.bodyFrame.Height * 3; + this.bodyFrame.Y = !this.sliding ? (this.sandStorm || this.carpetFrame >= 0 ? this.bodyFrame.Height * 6 : (this.eocDash <= 0 ? (this.wings <= 0 ? this.bodyFrame.Height * 5 : (this.wings == 22 || this.wings == 28 ? 0 : ((double) this.velocity.Y <= 0.0 ? this.bodyFrame.Height * 6 : (!this.controlJump ? this.bodyFrame.Height * 5 : this.bodyFrame.Height * 6)))) : this.bodyFrame.Height * 6)) : this.bodyFrame.Height * 3; this.bodyFrameCounter = 0.0; } else if ((double) this.velocity.X != 0.0) @@ -23408,9 +17650,15 @@ label_15: this.bodyFrame.Y += this.bodyFrame.Height; } if (this.bodyFrame.Y < this.bodyFrame.Height * 7) + { this.bodyFrame.Y = this.bodyFrame.Height * 19; - else if (this.bodyFrame.Y > this.bodyFrame.Height * 19) + } + else + { + if (this.bodyFrame.Y <= this.bodyFrame.Height * 19) + return; this.bodyFrame.Y = this.bodyFrame.Height * 7; + } } else { @@ -23425,135 +17673,6 @@ label_15: Microsoft.Xna.Framework.Rectangle bodyFrame = this.bodyFrame; local.Y = 0; } - if (this.legs == 140) - { - this.legFrameCounter = 0.0; - this.legFrame.Y = this.legFrame.Height * ((double) this.velocity.Y != 0.0).ToInt(); - int index = this.bodyFrame.Y / this.bodyFrame.Height; - if ((double) Main.OffsetsPlayerHeadgear[index].Y == 0.0) - this.legFrame.Y = this.legFrame.Height * 7; - if (this.wings == 22 || this.wings == 28) - this.legFrame.Y = 0; - } - if (this.legs == 217 && (this.sitting.isSitting || this.sleeping.isSleeping)) - { - this.legFrameCounter = 0.0; - this.legFrame.Y = this.legFrame.Height * 5; - } - if (this.head != 259 || this.skipAnimatingValuesInPlayerFrame) - return; - this.rabbitOrderFrame.Update(); - } - - private void CancelAllJumpVisualEffects() - { - this.isPerformingJump_Cloud = false; - this.isPerformingJump_Sandstorm = false; - this.isPerformingJump_Blizzard = false; - this.isPerformingJump_Fart = false; - this.isPerformingJump_Sail = false; - this.isPerformingJump_Unicorn = false; - this.isPerformingJump_Santank = false; - } - - private void UpdateVisibleAccessories() - { - for (int index = 3; index < 10; ++index) - { - if (this.IsAValidEquipmentSlotForIteration(index)) - { - Item obj = this.armor[index]; - if (obj.shieldSlot == (sbyte) 5 && this.eocDash > 0 && this.shield == (sbyte) -1) - this.shield = obj.shieldSlot; - if (this.shieldRaised && this.shield == (sbyte) -1 && obj.shieldSlot != (sbyte) -1) - this.shield = obj.shieldSlot; - if (!this.ItemIsVisuallyIncompatible(obj)) - { - if (obj.wingSlot > (sbyte) 0) - { - if (!this.hideVisibleAccessory[index] || (double) this.velocity.Y != 0.0 && !this.mount.Active) - this.wings = (int) obj.wingSlot; - else - continue; - } - if (!this.hideVisibleAccessory[index]) - this.UpdateVisibleAccessory(index, obj); - } - } - } - for (int index = 13; index < 20; ++index) - { - if (this.IsAValidEquipmentSlotForIteration(index)) - { - Item obj = this.armor[index]; - if (!this.ItemIsVisuallyIncompatible(obj)) - this.UpdateVisibleAccessory(index, obj); - } - } - if (this.HeldItem.type != 4760 || this.ownedProjectileCounts[866] >= 1) - return; - this.shield = (sbyte) 9; - this.cShield = 0; - } - - private bool ItemIsVisuallyIncompatible(Item item) => this.shield > (sbyte) 0 && this.IsVisibleCapeBad((int) item.frontSlot) || this.compositeBackArm.enabled && item.shieldSlot > (sbyte) 0 || item.shieldSlot > (sbyte) 0 && ItemID.Sets.IsFood[this.HeldItem.type] || this.IsVisibleCapeBad((int) this.front) && item.shieldSlot > (sbyte) 0 || (this.legs == 106 || this.legs == 143 || this.legs == 217) && item.shoeSlot == (sbyte) 15; - - private bool IsVisibleCapeBad(int accFrontSlot) - { - switch (accFrontSlot) - { - case 1: - case 2: - case 3: - case 4: - case 5: - case 8: - return true; - default: - return false; - } - } - - private void UpdateVisibleAccessory(int itemSlot, Item item) - { - if (item.stringColor > 0) - this.stringColor = item.stringColor; - if (item.handOnSlot > (sbyte) 0) - this.handon = item.handOnSlot; - if (item.handOffSlot > (sbyte) 0) - this.handoff = item.handOffSlot; - if (item.backSlot > (sbyte) 0 && !this.sitting.isSitting) - { - this.back = item.backSlot; - this.front = (sbyte) -1; - } - if (item.frontSlot > (sbyte) 0) - this.front = item.frontSlot; - if (item.shoeSlot > (sbyte) 0) - this.shoe = item.shoeSlot; - if (item.waistSlot > (sbyte) 0) - this.waist = item.waistSlot; - if (item.shieldSlot > (sbyte) 0) - this.shield = item.shieldSlot; - if (item.neckSlot > (sbyte) 0) - this.neck = item.neckSlot; - if (item.faceSlot > (sbyte) 0) - this.face = item.faceSlot; - if (item.balloonSlot > (sbyte) 0) - this.balloon = item.balloonSlot; - if (item.wingSlot > (sbyte) 0) - this.wings = (int) item.wingSlot; - if (item.type == 3580) - this.yoraiz0rEye = itemSlot - 2; - if (item.type == 3581) - this.yoraiz0rDarkness = true; - if (item.type == 3929) - this.leinforsHair = true; - if (item.type == 4404) - this.hasFloatingTube = true; - if (item.type != 4563) - return; - this.hasUnicornHorn = true; } public void SetArmorEffectVisuals(Player drawPlayer) @@ -23598,17 +17717,8 @@ label_15: this.armorEffectDrawShadow = true; if (drawPlayer.mount.Active && drawPlayer.mount.Type == 10 && (double) Math.Abs(drawPlayer.velocity.X) > (double) drawPlayer.mount.DashSpeed - (double) drawPlayer.mount.RunSpeed / 2.0) this.armorEffectDrawShadow = true; - if (drawPlayer.mount.Active && drawPlayer.mount.Type == 44 && (double) Math.Abs(drawPlayer.velocity.X) > (double) drawPlayer.mount.DashSpeed - (double) drawPlayer.mount.RunSpeed / 4.0) - this.armorEffectDrawShadow = true; - if (drawPlayer.mount.Active && drawPlayer.mount.Type == 45 && (double) Math.Abs(drawPlayer.velocity.X) > (double) drawPlayer.mount.DashSpeed * 0.899999976158142) - this.armorEffectDrawShadow = true; if (drawPlayer.mount.Active && drawPlayer.mount.Type == 14 && (double) Math.Abs(drawPlayer.velocity.X) > (double) drawPlayer.mount.RunSpeed / 2.0) this.armorEffectDrawShadowBasilisk = true; - if (drawPlayer.mount.Active && drawPlayer.mount.Type == 48) - { - this.armorEffectDrawOutlines = true; - this.armorEffectDrawShadow = true; - } if (drawPlayer.body == 67 && drawPlayer.legs == 56 && drawPlayer.head >= 103 && drawPlayer.head <= 105) this.armorEffectDrawShadow = true; if ((drawPlayer.head == 78 || drawPlayer.head == 79 || drawPlayer.head == 80) && drawPlayer.body == 51 && drawPlayer.legs == 47) @@ -23657,7 +17767,7 @@ label_15: this.armorEffectDrawShadow = true; if (drawPlayer.body == 19 && drawPlayer.legs == 18 && (drawPlayer.head == 35 || drawPlayer.head == 36 || drawPlayer.head == 37)) this.armorEffectDrawOutlines = true; - if ((drawPlayer.body == 24 || drawPlayer.body == 229) && (drawPlayer.legs == 23 || drawPlayer.legs == 212) && (drawPlayer.head == 43 || drawPlayer.head == 41 || drawPlayer.head == 42 || drawPlayer.head == 254 || drawPlayer.head == (int) byte.MaxValue || drawPlayer.head == 256 || drawPlayer.head == 257 || drawPlayer.head == 258)) + if (drawPlayer.body == 24 && drawPlayer.legs == 23 && (drawPlayer.head == 41 || drawPlayer.head == 42 || drawPlayer.head == 43)) { this.armorEffectDrawOutlines = true; this.armorEffectDrawShadow = true; @@ -23717,21 +17827,6 @@ label_15: case 77: num = 121; break; - case 81: - num = 169; - break; - case 88: - num = 168; - break; - case 89: - num = 186; - break; - case 90: - num = 166; - break; - case 93: - num = 165; - break; case 165: num = !male ? 99 : 118; break; @@ -23753,30 +17848,6 @@ label_15: case 191: num = 131; break; - case 213: - num = 187; - break; - case 215: - num = 189; - break; - case 219: - num = 196; - break; - case 221: - num = 199; - break; - case 223: - num = 204; - break; - case 231: - num = 214; - break; - case 232: - num = 215; - break; - case 233: - num = 216; - break; } if (num != -1) somethingSpecial = true; @@ -23826,55 +17897,6 @@ label_15: break; } break; - case 180: - if (!male) - { - num = 179; - break; - } - break; - case 184: - if (!male) - { - num = 183; - break; - } - break; - case 191: - if (!male) - { - num = 192; - break; - } - break; - case 193: - if (!male) - { - num = 194; - break; - } - break; - case 197: - if (!male) - { - num = 198; - break; - } - break; - case 203: - if (!male) - { - num = 202; - break; - } - break; - case 208: - if (!male) - { - num = 207; - break; - } - break; } } return num; @@ -23884,29 +17906,21 @@ label_15: { try { - this._funkytownAchievementCheckCooldown = 100; - if (Style != 10) - this.RemoveAllGrapplingHooks(); - this.StopVanityActions(); + this.grappling[0] = -1; + this.grapCount = 0; + for (int index = 0; index < 1000; ++index) + { + if (Main.projectile[index].active && Main.projectile[index].owner == this.whoAmI && Main.projectile[index].aiStyle == 7) + Main.projectile[index].Kill(); + } int extraInfo1 = 0; if (Style == 4) extraInfo1 = this.lastPortalColorIndex; - if (Style == 9) - { - this.lastTeleportPylonStyleUsed = extraInfo; - extraInfo1 = this.lastTeleportPylonStyleUsed; - } float dustCountMult = MathHelper.Clamp((float) (1.0 - (double) this.teleportTime * 0.990000009536743), 0.01f, 1f); - Vector2 position = this.position; - Main.TeleportEffect(this.getRect(), Style, extraInfo1, dustCountMult, otherPosition: newPos); + Main.TeleportEffect(this.getRect(), Style, extraInfo1, dustCountMult); float num = Vector2.Distance(this.position, newPos); PressurePlateHelper.UpdatePlayerPosition(this); this.position = newPos; - if (Style == 8) - { - SoundEngine.PlaySound(SoundID.Item6, position); - SoundEngine.PlaySound(SoundID.Item6, newPos); - } this.fallStart = (int) ((double) this.position.Y / 16.0); if (this.whoAmI == Main.myPlayer) { @@ -23921,13 +17935,12 @@ label_15: } else { - NPC.ResetNetOffsets(); Main.BlackFadeIn = (int) byte.MaxValue; - Lighting.Clear(); + Lighting.BlackOut(); Main.screenLastPosition = Main.screenPosition; Main.screenPosition.X = this.position.X + (float) (this.width / 2) - (float) (Main.screenWidth / 2); Main.screenPosition.Y = this.position.Y + (float) (this.height / 2) - (float) (Main.screenHeight / 2); - Main.instantBGTransitionCounter = 10; + Main.quickBG = 10; } if ((double) dustCountMult > 0.100000001490116 || !flag || Style != 0) { @@ -23945,11 +17958,10 @@ label_15: this.gravity = 0.0f; } PressurePlateHelper.UpdatePlayerPosition(this); - this.ResetAdvancedShadows(); for (int index = 0; index < 3; ++index) this.UpdateSocialShadow(); this.oldPosition = this.position + this.BlehOldPositionFixer; - Main.TeleportEffect(this.getRect(), Style, extraInfo1, dustCountMult, TeleportationSide.Exit, position); + Main.TeleportEffect(this.getRect(), Style, extraInfo1, dustCountMult); this.teleportTime = 1f; this.teleportStyle = Style; } @@ -23958,59 +17970,14 @@ label_15: } } - public void DoPotionOfReturnTeleportationAndSetTheComebackPoint() + public void Spawn() { - this.RemoveAllGrapplingHooks(); - this.PotionOfReturnOriginalUsePosition = new Vector2?(this.Bottom); - bool immune = this.immune; - int immuneTime = this.immuneTime; - this.StopVanityActions(false); - this.Spawn(PlayerSpawnContext.RecallFromItem); - this.PotionOfReturnHomePosition = new Vector2?(this.Bottom); - NetMessage.SendData(13, number: this.whoAmI); - this.immune = immune; - this.immuneTime = immuneTime; - } - - public void DoPotionOfReturnReturnToOriginalUsePosition() - { - if (!this.PotionOfReturnOriginalUsePosition.HasValue) - return; - Vector2 newPos = this.PotionOfReturnOriginalUsePosition.Value + this.Size * new Vector2(-0.5f, -1f); - int num = 8; - this.Teleport(newPos, num); - NetMessage.SendData(65, number2: ((float) this.whoAmI), number3: newPos.X, number4: newPos.Y, number5: num); - this.PotionOfReturnOriginalUsePosition = new Vector2?(); - this.PotionOfReturnHomePosition = new Vector2?(); - } - - public void AutoFinchStaff() - { - int index = this.FindItem(4281); - if (index == -1) - return; - this.AddBuff(this.inventory[index].buffType, 3600); - } - - public void Spawn(PlayerSpawnContext context) - { - Main.LocalPlayer.creativeInterface = false; - this._funkytownAchievementCheckCooldown = 100; - bool flag1 = false; - if (context == PlayerSpawnContext.SpawningIntoWorld && this.dead) - { - Player.AdjustRespawnTimerForWorldJoining(this); - if (this.dead) - flag1 = true; - } - this.StopVanityActions(); - if (this.whoAmI == Main.myPlayer) - Main.NotifyOfEvent(GameNotificationType.SpawnOrDeath); + Main.InitLifeBytes(); if (this.whoAmI == Main.myPlayer) { if (Main.mapTime < 5) Main.mapTime = 5; - Main.instantBGTransitionCounter = 10; + Main.quickBG = 10; this.FindSpawn(); if (!Player.CheckSpawn(this.SpawnX, this.SpawnY)) { @@ -24018,14 +17985,11 @@ label_15: this.SpawnY = -1; } Main.maxQ = true; - NPC.ResetNetOffsets(); } if (Main.netMode == 1 && this.whoAmI == Main.myPlayer) - NetMessage.SendData(12, number: Main.myPlayer, number2: ((float) (byte) context)); - if (this.whoAmI == Main.myPlayer && context == PlayerSpawnContext.SpawningIntoWorld) { - this.SetPlayerDataToOutOfClassFields(); - Main.ReleaseHostAndPlayProcess(); + NetMessage.SendData(12, number: Main.myPlayer); + Main.gameMenu = false; } this.headPosition = Vector2.Zero; this.bodyPosition = Vector2.Zero; @@ -24033,37 +17997,51 @@ label_15: this.headRotation = 0.0f; this.bodyRotation = 0.0f; this.legRotation = 0.0f; - this.rabbitOrderFrame.Reset(); this.lavaTime = this.lavaMax; - if (!flag1) + if (this.statLife <= 0) { - if (this.statLife <= 0) + int num = this.statLifeMax2 / 2; + this.statLife = 100; + if (num > this.statLife) + this.statLife = num; + this.breath = this.breathMax; + if (this.spawnMax) { - int num = this.statLifeMax2 / 2; - this.statLife = 100; - if (num > this.statLife) - this.statLife = num; - this.breath = this.breathMax; - if (this.spawnMax) - { - this.statLife = this.statLifeMax2; - this.statMana = this.statManaMax2; - } + this.statLife = this.statLifeMax2; + this.statMana = this.statManaMax2; } - this.immune = true; - this.dead = false; - this.immuneTime = 0; } + this.immune = true; + this.dead = false; + this.immuneTime = 0; this.active = true; - Vector2 position = this.position; if (this.SpawnX >= 0 && this.SpawnY >= 0) { - int spawnX = this.SpawnX; - int spawnY = this.SpawnY; - this.Spawn_SetPosition(this.SpawnX, this.SpawnY); + this.position.X = (float) (this.SpawnX * 16 + 8 - this.width / 2); + this.position.Y = (float) (this.SpawnY * 16 - this.height); } else - this.Spawn_SetPositionAtWorldSpawn(); + { + this.position.X = (float) (Main.spawnTileX * 16 + 8 - this.width / 2); + this.position.Y = (float) (Main.spawnTileY * 16 - this.height); + for (int i = Main.spawnTileX - 1; i < Main.spawnTileX + 2; ++i) + { + for (int j = Main.spawnTileY - 3; j < Main.spawnTileY; ++j) + { + if (Main.tile[i, j] != null) + { + if (Main.tileSolid[(int) Main.tile[i, j].type] && !Main.tileSolidTop[(int) Main.tile[i, j].type]) + WorldGen.KillTile(i, j); + if (Main.tile[i, j].liquid > (byte) 0) + { + Main.tile[i, j].lava(false); + Main.tile[i, j].liquid = (byte) 0; + WorldGen.SquareTileFrame(i, j); + } + } + } + } + } this.wet = false; this.wetCount = (byte) 0; this.lavaWet = false; @@ -24071,188 +18049,38 @@ label_15: this.fallStart2 = this.fallStart; this.velocity.X = 0.0f; this.velocity.Y = 0.0f; - this.ResetAdvancedShadows(); for (int index = 0; index < 3; ++index) this.UpdateSocialShadow(); this.oldPosition = this.position + this.BlehOldPositionFixer; - this.SetTalkNPC(-1); + this.talkNPC = -1; if (this.whoAmI == Main.myPlayer) Main.npcChatCornerItem = 0; - if (!flag1) + if (this.pvpDeath) { - if (this.pvpDeath) - { - this.pvpDeath = false; - this.immuneTime = 300; - this.statLife = this.statLifeMax; - } - else - this.immuneTime = 60; - if (this.immuneTime > 0 && !this.hostile) - this.immuneNoBlink = true; - } - if (this.whoAmI == Main.myPlayer) - { - if (context == PlayerSpawnContext.SpawningIntoWorld) - Main.LocalGolfState.SetScoreTime(); - bool flag2 = (double) Vector2.Distance(position, this.position) < (double) new Vector2((float) Main.screenWidth, (float) Main.screenHeight).Length() / 2.0 + 100.0; - if (flag2) - { - Main.SetCameraLerp(0.1f, 0); - flag2 = true; - } - else - { - Main.BlackFadeIn = (int) byte.MaxValue; - Lighting.Clear(); - Main.screenLastPosition = Main.screenPosition; - Main.instantBGTransitionCounter = 10; - } - if (!flag2) - Main.renderNow = true; - if (Main.netMode == 1) - Netplay.AddCurrentServerToRecentList(); - if (!flag2) - { - Main.screenPosition.X = this.position.X + (float) (this.width / 2) - (float) (Main.screenWidth / 2); - Main.screenPosition.Y = this.position.Y + (float) (this.height / 2) - (float) (Main.screenHeight / 2); - } - } - if (flag1) - this.immuneAlpha = (int) byte.MaxValue; - this.UpdateGraveyard(true); - if (this.whoAmI != Main.myPlayer || context != PlayerSpawnContext.ReviveFromDeath || this.difficulty != (byte) 3) - return; - this.AutoFinchStaff(); - } - - private void Spawn_SetPositionAtWorldSpawn() - { - int spawnTileX = Main.spawnTileX; - int spawnTileY = Main.spawnTileY; - if (!this.Spawn_IsAreaAValidWorldSpawn(spawnTileX, spawnTileY)) - { - bool flag = false; - if (!flag) - { - for (int index = 0; index < 30; ++index) - { - if (this.Spawn_IsAreaAValidWorldSpawn(spawnTileX, spawnTileY - index)) - { - spawnTileY -= index; - flag = true; - break; - } - } - } - if (!flag) - { - for (int index = 0; index < 30; ++index) - { - if (this.Spawn_IsAreaAValidWorldSpawn(spawnTileX, spawnTileY - index)) - { - spawnTileY -= index; - flag = true; - break; - } - } - } - if (flag) - { - this.Spawn_SetPosition(spawnTileX, spawnTileY); - } - else - { - this.Spawn_SetPosition(Main.spawnTileX, Main.spawnTileY); - if (this.Spawn_IsAreaAValidWorldSpawn(Main.spawnTileX, Main.spawnTileY)) - return; - Player.Spawn_ForceClearArea(Main.spawnTileX, Main.spawnTileY); - } + this.pvpDeath = false; + this.immuneTime = 300; + this.statLife = this.statLifeMax; } else - { - int floorY = Player.Spawn_DescendFromDefaultSpace(spawnTileX, spawnTileY); - this.Spawn_SetPosition(spawnTileX, floorY); - if (this.Spawn_IsAreaAValidWorldSpawn(spawnTileX, floorY)) - return; - Player.Spawn_ForceClearArea(spawnTileX, floorY); - } - } - - private static int Spawn_DescendFromDefaultSpace(int x, int y) - { - for (int index1 = 0; index1 < 50; ++index1) - { - bool flag = false; - for (int index2 = -1; index2 <= 1; ++index2) - { - Tile tile = Main.tile[x + index2, y + index1]; - if (tile.nactive() && (Main.tileSolid[(int) tile.type] || !Main.tileSolidTop[(int) tile.type])) - { - flag = true; - break; - } - } - if (flag) - { - y += index1; - break; - } - } - return y; - } - - private static void Spawn_ForceClearArea(int floorX, int floorY) - { - for (int i = floorX - 1; i < floorX + 2; ++i) - { - for (int j = floorY - 3; j < floorY; ++j) - { - if (Main.tile[i, j] != null) - { - if (Main.tile[i, j].nactive() && Main.tileSolid[(int) Main.tile[i, j].type] && !Main.tileSolidTop[(int) Main.tile[i, j].type]) - WorldGen.KillTile(i, j); - if (Main.tile[i, j].liquid > (byte) 0) - { - Main.tile[i, j].lava(false); - Main.tile[i, j].liquid = (byte) 0; - WorldGen.SquareTileFrame(i, j); - } - } - } - } - } - - private bool Spawn_IsAreaAValidWorldSpawn(int floorX, int floorY) - { - for (int index1 = floorX - 1; index1 < floorX + 2; ++index1) - { - for (int index2 = floorY - 3; index2 < floorY; ++index2) - { - if (Main.tile[index1, index2] != null && (Main.tile[index1, index2].nactive() && Main.tileSolid[(int) Main.tile[index1, index2].type] && !Main.tileSolidTop[(int) Main.tile[index1, index2].type] || Main.tile[index1, index2].liquid > (byte) 0)) - return false; - } - } - return true; - } - - private void Spawn_SetPosition(int floorX, int floorY) - { - this.position.X = (float) (floorX * 16 + 8 - this.width / 2); - this.position.Y = (float) (floorY * 16 - this.height); - } - - public void SetImmuneTimeForAllTypes(int time) - { - this.immune = true; - this.immuneTime = time; - for (int index = 0; index < this.hurtCooldowns.Length; ++index) - this.hurtCooldowns[index] = time; + this.immuneTime = 60; + if (this.whoAmI != Main.myPlayer) + return; + Main.BlackFadeIn = (int) byte.MaxValue; + Main.renderNow = true; + if (Main.netMode == 1) + Netplay.newRecent(); + Main.screenPosition.X = this.position.X + (float) (this.width / 2) - (float) (Main.screenWidth / 2); + Main.screenPosition.Y = this.position.Y + (float) (this.height / 2) - (float) (Main.screenHeight / 2); } public void ShadowDodge() { - this.SetImmuneTimeForAllTypes(this.longInvince ? 120 : 80); + this.immune = true; + this.immuneTime = 80; + if (this.longInvince) + this.immuneTime += 40; + for (int index = 0; index < this.hurtCooldowns.Length; ++index) + this.hurtCooldowns[index] = this.immuneTime; if (this.whoAmI != Main.myPlayer) return; for (int b = 0; b < 22; ++b) @@ -24263,19 +18091,14 @@ label_15: NetMessage.SendData(62, number: this.whoAmI, number2: 2f); } - public void BrainOfConfusionDodge() - { - this.SetImmuneTimeForAllTypes(this.longInvince ? 120 : 80); - this.brainOfConfusionDodgeAnimationCounter = 300; - if (this.whoAmI != Main.myPlayer) - return; - this.AddBuff(321, 300, false); - NetMessage.SendData(62, number: this.whoAmI, number2: 4f); - } - public void NinjaDodge() { - this.SetImmuneTimeForAllTypes(this.longInvince ? 120 : 80); + this.immune = true; + this.immuneTime = 80; + if (this.longInvince) + this.immuneTime += 40; + for (int index = 0; index < this.hurtCooldowns.Length; ++index) + this.hurtCooldowns[index] = this.immuneTime; for (int index1 = 0; index1 < 100; ++index1) { int index2 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 2f); @@ -24320,28 +18143,16 @@ label_15: NetMessage.SendData(62, number: this.whoAmI, number2: 1f); } - public void ApplyArmorSoundAndDustChanges() + public double HurtOld( + int Damage, + int hitDirection, + bool pvp = false, + bool quiet = false, + string deathText = " was slain...", + bool Crit = false, + int cooldownCounter = -1) { - int num1 = this.armor[0].headSlot; - int num2 = this.armor[1].bodySlot; - int num3 = this.armor[2].legSlot; - if (this.armor[10].headSlot >= 0) - num1 = this.armor[10].headSlot; - if (this.armor[11].bodySlot >= 0) - num2 = this.armor[11].bodySlot; - if (this.armor[12].legSlot >= 0) - num3 = this.armor[12].legSlot; - if ((this.wereWolf || this.forceWerewolf) && !this.hideWolf) - { - num3 = 20; - num2 = 21; - num1 = 38; - } - if ((num1 == 75 || num1 == 7) && num2 == 7 && num3 == 7) - this.boneArmor = true; - if (num2 != 27 || num1 != 46 || num3 != 26) - return; - this.frostArmor = true; + return 0.0; } public double Hurt( @@ -24353,8 +18164,6 @@ label_15: bool Crit = false, int cooldownCounter = -1) { - if (this.creativeGodMode) - return 0.0; bool flag1 = !this.immune; bool flag2 = false; int hitContext = cooldownCounter; @@ -24367,8 +18176,6 @@ label_15: flag2 = true; cooldownCounter = -1; } - if (cooldownCounter == 3) - flag1 = this.hurtCooldowns[cooldownCounter] <= 0; if (!flag1) return 0.0; if (this.whoAmI == Main.myPlayer && this.blackBelt && Main.rand.Next(10) == 0) @@ -24376,11 +18183,6 @@ label_15: this.NinjaDodge(); return 0.0; } - if (this.whoAmI == Main.myPlayer && this.brainOfConfusion && Main.rand.Next(6) == 0 && this.FindBuffIndex(321) == -1) - { - this.BrainOfConfusionDodge(); - return 0.0; - } if (this.whoAmI == Main.myPlayer && this.shadowDodge) { this.ShadowDodge(); @@ -24394,36 +18196,11 @@ label_15: if (Main.netMode == 1) NetMessage.SendData(84, number: this.whoAmI); int Damage1 = Damage; - double dmg = Main.CalculateDamagePlayersTake(Damage1, this.statDefense); + double dmg = Main.CalculatePlayerDamage(Damage1, this.statDefense); if (Crit) Damage1 *= 2; if (dmg >= 1.0) { - if (this.whoAmI == Main.myPlayer) - { - Main.NotifyOfEvent(GameNotificationType.Damage); - if (this.hasFootball) - { - for (int index = 0; index < 59; ++index) - { - if ((this.inventory[index].stack <= 0 ? 0 : (this.inventory[index].type == 4743 ? 1 : 0)) != 0) - { - Projectile.NewProjectile(this.Center, new Vector2((float) (-hitDirection * 4), -6f), 861, 0, 0.0f, this.whoAmI, ai1: 1f); - this.inventory[index].SetDefaults(); - if (index == 58) - Main.mouseItem = new Item(); - } - } - } - } - if (this.inventory[this.selectedItem].type == 4790 || this.inventory[this.selectedItem].type == 4788 || this.inventory[this.selectedItem].type == 4789) - { - for (int index = 0; index < 1000; ++index) - { - if (Main.projectile[index].active && Main.projectile[index].owner == this.whoAmI && (Main.projectile[index].type == 879 || Main.projectile[index].type == 877 || Main.projectile[index].type == 878)) - Main.projectile[index].active = false; - } - } if (this.invis) { for (int b = 0; b < 22; ++b) @@ -24437,13 +18214,12 @@ label_15: dmg = 1.0; if (this.ConsumeSolarFlare()) { - dmg = (double) (int) ((1.0 - 0.200000002980232) * dmg); + dmg = (double) (int) ((1.0 - 0.300000011920929) * dmg); if (dmg < 1.0) dmg = 1.0; if (this.whoAmI == Main.myPlayer) { int index = Projectile.NewProjectile(this.Center.X, this.Center.Y, 0.0f, 0.0f, 608, 150, 15f, Main.myPlayer); - Main.projectile[index].netUpdate = true; Main.projectile[index].Kill(); } } @@ -24550,8 +18326,7 @@ label_15: } if (Main.netMode == 1 && this.whoAmI == Main.myPlayer && !quiet) { - if (!this.noKnockback && hitDirection != 0 && (!this.mount.Active || !this.mount.Cart)) - NetMessage.SendData(13, number: this.whoAmI); + NetMessage.SendData(13, number: this.whoAmI); NetMessage.SendData(16, number: this.whoAmI); NetMessage.SendPlayerHurt(this.whoAmI, damageSource, Damage, hitDirection, Crit, pvp, hitContext); } @@ -24561,20 +18336,32 @@ label_15: { case -1: this.immune = true; - this.immuneTime = !pvp ? (dmg != 1.0 ? (this.longInvince ? 80 : 40) : (this.longInvince ? 40 : 20)) : 8; + if (dmg == 1.0) + { + this.immuneTime = 20; + if (this.longInvince) + this.immuneTime += 20; + } + else + { + this.immuneTime = 40; + if (this.longInvince) + this.immuneTime += 40; + } + if (pvp) + { + this.immuneTime = 8; + break; + } break; case 0: this.hurtCooldowns[cooldownCounter] = dmg != 1.0 ? (this.longInvince ? 80 : 40) : (this.longInvince ? 40 : 20); break; case 1: - case 3: this.hurtCooldowns[cooldownCounter] = dmg != 1.0 ? (this.longInvince ? 80 : 40) : (this.longInvince ? 40 : 20); break; } this.lifeRegenTime = 0; - int? sourceProjectileType = damageSource.SourceProjectileType; - if (sourceProjectileType.HasValue && (!ProjectileID.Sets.DismountsPlayersOnHit.IndexInRange(sourceProjectileType.Value) ? 0 : (ProjectileID.Sets.DismountsPlayersOnHit[sourceProjectileType.Value] ? 1 : 0)) != 0) - this.mount.Dismount(this); if (this.whoAmI == Main.myPlayer) { if (this.starCloak) @@ -24590,18 +18377,11 @@ label_15: float num13 = 23f / (float) Math.Sqrt((double) num12 * (double) num12 + (double) num11 * (double) num11); float SpeedX = num12 * num13; float SpeedY = num11 * num13; - int Type = 726; - if (this.starCloakIsStarVeil) - Type = 725; - if (this.starCloakIsBeeCloak) - Type = 724; - if (this.starCloakIsManaCloak) - Type = 723; - int index2 = Projectile.NewProjectile(num8, num9, SpeedX, SpeedY, Type, 30, 5f, this.whoAmI); + int index2 = Projectile.NewProjectile(num8, num9, SpeedX, SpeedY, 92, 30, 5f, this.whoAmI); Main.projectile[index2].ai[1] = this.position.Y; } } - if (this.releaseBeesWhenHurt) + if (this.bee) { int num = 1; if (Main.rand.Next(3) == 0) @@ -24625,32 +18405,27 @@ label_15: num14 = 2.5f; num15 = -1.5f; } - this.StopVanityActions(); this.velocity.X = num14 * (float) hitDirection; this.velocity.Y = num15; - this.fallStart = (int) ((double) this.position.Y / 16.0); } } else if (!this.noKnockback && hitDirection != 0 && (!this.mount.Active || !this.mount.Cart)) { - this.StopVanityActions(); this.velocity.X = 4.5f * (float) hitDirection; this.velocity.Y = -3.5f; - this.fallStart = (int) ((double) this.position.Y / 16.0); } if (this.stoned) - SoundEngine.PlaySound(0, (int) this.position.X, (int) this.position.Y); - else if ((this.wereWolf || this.forceWerewolf) && !this.hideWolf) - SoundEngine.PlaySound(3, (int) this.position.X, (int) this.position.Y, 6); + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); else if (this.frostArmor) - SoundEngine.PlaySound(SoundID.Item27, this.position); + Main.PlaySound(SoundID.Item27, this.position); + else if ((this.wereWolf || this.forceWerewolf) && !this.hideWolf) + Main.PlaySound(3, (int) this.position.X, (int) this.position.Y, 6); else if (this.boneArmor) - SoundEngine.PlaySound(3, (int) this.position.X, (int) this.position.Y, 2); + Main.PlaySound(3, (int) this.position.X, (int) this.position.Y, 2); else if (!this.Male) - SoundEngine.PlaySound(20, (int) this.position.X, (int) this.position.Y); + Main.PlaySound(20, (int) this.position.X, (int) this.position.Y); else - SoundEngine.PlaySound(1, (int) this.position.X, (int) this.position.Y); - this.eyeHelper.BlinkBecausePlayerGotHurt(); + Main.PlaySound(1, (int) this.position.X, (int) this.position.Y); if (this.statLife > 0) { double num16 = dmg / (double) this.statLifeMax2 * 100.0; @@ -24687,7 +18462,7 @@ label_15: } } if (pvp) - dmg = Main.CalculateDamagePlayersTakeInPVP(Damage1, this.statDefense); + dmg = Main.CalculateDamage(Damage1, this.statDefense); return dmg; } @@ -24701,17 +18476,18 @@ label_15: Main.ActivePlayerFileData = new PlayerFileData(); } + public void KillMeOld(double dmg, int hitDirection, bool pvp = false, string deathText = " was slain...") + { + } + public void KillMe(PlayerDeathReason damageSource, double dmg, int hitDirection, bool pvp = false) { - if (this.creativeGodMode || this.dead) + if (this.dead) return; - this.StopVanityActions(); if (pvp) this.pvpDeath = true; if (this.trapDebuffSource) AchievementsHelper.HandleSpecialEvent(this, 4); - if (this.whoAmI == Main.myPlayer) - Main.NotifyOfEvent(GameNotificationType.SpawnOrDeath); this.lastDeathPostion = this.Center; this.lastDeathTime = DateTime.Now; this.showLastDeath = true; @@ -24726,7 +18502,7 @@ label_15: if (Main.myPlayer == this.whoAmI) { this.trashItem.SetDefaults(); - if (this.difficulty == (byte) 0 || this.difficulty == (byte) 3) + if (this.difficulty == (byte) 0) { for (int index = 0; index < 59; ++index) { @@ -24755,7 +18531,7 @@ label_15: this.KillMeForGood(); } } - SoundEngine.PlaySound(5, (int) this.position.X, (int) this.position.Y); + Main.PlaySound(5, (int) this.position.X, (int) this.position.Y); this.headVelocity.Y = (float) Main.rand.Next(-40, -10) * 0.1f; this.bodyVelocity.Y = (float) Main.rand.Next(-40, -10) * 0.1f; this.legVelocity.Y = (float) Main.rand.Next(-40, -10) * 0.1f; @@ -24805,8 +18581,6 @@ label_15: if (Main.expertMode) this.respawnTimer = (int) ((double) this.respawnTimer * 1.5); this.immuneAlpha = 0; - if (!ChildSafety.Disabled) - this.immuneAlpha = (int) byte.MaxValue; this.palladiumRegen = false; this.iceBarrier = false; this.crystalLeaf = false; @@ -24817,12 +18591,12 @@ label_15: Main.NewText(deathText.ToString(), (byte) 225, (byte) 25, (byte) 25); break; case 2: - ChatHelper.BroadcastChatMessage(deathText, new Color(225, 25, 25)); + NetMessage.BroadcastChatMessage(deathText, new Color(225, 25, 25)); break; } if (Main.netMode == 1 && this.whoAmI == Main.myPlayer) NetMessage.SendPlayerDeath(this.whoAmI, damageSource, (int) dmg, hitDirection, pvp); - if (this.whoAmI == Main.myPlayer && (this.difficulty == (byte) 0 || this.difficulty == (byte) 3)) + if (this.whoAmI == Main.myPlayer && this.difficulty == (byte) 0) { if (!pvp) { @@ -24856,62 +18630,52 @@ label_15: int num2 = Main.rand.Next(6); int Type = coinsOwned <= 100000 ? (num2 != 0 ? 200 + num2 : 43) : Main.rand.Next(5) + 527; int index = Projectile.NewProjectile(this.position.X + (float) (this.width / 2), this.position.Y + (float) (this.height / 2), (float) Main.rand.Next(10, 30) * 0.1f * (float) hitDirection + num1, (float) Main.rand.Next(-40, -20) * 0.1f, Type, 0, 0.0f, Main.myPlayer); - DateTime now = DateTime.Now; - string str1 = now.ToString("D"); - if (GameCulture.FromCultureName(GameCulture.CultureName.English).IsActive) - str1 = now.ToString("MMMM d, yyy"); - string str2 = deathText.ToString() + "\n" + str1; - Main.projectile[index].miscText = str2; + Main.projectile[index].miscText = deathText.ToString(); } - public bool CanPullItem(Item item, Player.ItemSpaceStatus status) => status.CanTakeItem && this.CanAcceptItemIntoInventory(item); - - public Player.ItemSpaceStatus ItemSpace(Item newItem) + public bool ItemSpace(Item newItem) { - if (ItemID.Sets.IsAPickup[newItem.type]) - return new Player.ItemSpaceStatus(true); if (newItem.uniqueStack && this.HasItem(newItem.type)) - return new Player.ItemSpaceStatus(false); + return false; + if (newItem.type == 58 || newItem.type == 184 || newItem.type == 1734 || newItem.type == 1735 || newItem.type == 1867 || newItem.type == 1868 || ItemID.Sets.NebulaPickup[newItem.type]) + return true; int num = 50; - if (newItem.IsACoin) + if (newItem.type == 71 || newItem.type == 72 || newItem.type == 73 || newItem.type == 74) num = 54; for (int index = 0; index < num; ++index) { - if (this.CanItemSlotAccept(this.inventory[index], newItem)) - return new Player.ItemSpaceStatus(true); + if (this.inventory[index].type == 0) + return true; + } + for (int index = 0; index < num; ++index) + { + if (this.inventory[index].type > 0 && this.inventory[index].stack < this.inventory[index].maxStack && newItem.IsTheSameAs(this.inventory[index])) + return true; } if (newItem.ammo > 0 && !newItem.notAmmo) { + if (newItem.type != 75 && newItem.type != 169 && newItem.type != 23 && newItem.type != 408 && newItem.type != 370 && newItem.type != 1246) + { + for (int index = 54; index < 58; ++index) + { + if (this.inventory[index].type == 0) + return true; + } + } for (int index = 54; index < 58; ++index) { - if (this.CanGoIntoAmmoOnPickup(this.inventory[index], newItem)) - return new Player.ItemSpaceStatus(true); + if (this.inventory[index].type > 0 && this.inventory[index].stack < this.inventory[index].maxStack && newItem.IsTheSameAs(this.inventory[index])) + return true; } } for (int index = 54; index < 58; ++index) { if (this.inventory[index].type > 0 && this.inventory[index].stack < this.inventory[index].maxStack && newItem.IsTheSameAs(this.inventory[index])) - return new Player.ItemSpaceStatus(true); - } - return this.ItemSpaceForCofveve(newItem) ? new Player.ItemSpaceStatus(true, true) : new Player.ItemSpaceStatus(false); - } - - public bool ItemSpaceForCofveve(Item newItem) - { - if (!this.IsVoidVaultEnabled || !this.CanVoidVaultAccept(newItem)) - return false; - foreach (Item theSlot in this.bank4.item) - { - if (this.CanItemSlotAccept(theSlot, newItem)) return true; } return false; } - public bool CanItemSlotAccept(Item theSlot, Item theItemToAccept) => theSlot.type == 0 || theSlot.stack < theSlot.maxStack && theItemToAccept.IsTheSameAs(theSlot); - - public bool CanGoIntoAmmoOnPickup(Item theSlot, Item theItemToAccept) => (theItemToAccept.CanFillEmptyAmmoSlot() || theSlot.type != 0) && this.CanItemSlotAccept(theSlot, theItemToAccept); - public void DoCoins(int i) { if (this.inventory[i].stack != 100 || this.inventory[i].type != 71 && this.inventory[i].type != 72 && this.inventory[i].type != 73) @@ -24930,49 +18694,46 @@ label_15: } } - public Item FillAmmo(int plr, Item newItem, GetItemSettings settings) + public Item FillAmmo(int plr, Item newItem, bool noText = false) { Item obj = newItem; for (int i = 54; i < 58; ++i) { if (this.inventory[i].type > 0 && this.inventory[i].stack < this.inventory[i].maxStack && obj.IsTheSameAs(this.inventory[i])) { - SoundEngine.PlaySound(7, (int) this.position.X, (int) this.position.Y); + Main.PlaySound(7, (int) this.position.X, (int) this.position.Y); if (obj.stack + this.inventory[i].stack <= this.inventory[i].maxStack) { this.inventory[i].stack += obj.stack; - if (!settings.NoText) - PopupText.NewText(PopupTextContext.RegularItemPickup, newItem, obj.stack); + if (!noText) + ItemText.NewText(newItem, obj.stack); this.DoCoins(i); if (plr == Main.myPlayer) Recipe.FindRecipes(); - settings.HandlePostAction(this.inventory[i]); return new Item(); } obj.stack -= this.inventory[i].maxStack - this.inventory[i].stack; - if (!settings.NoText) - PopupText.NewText(PopupTextContext.RegularItemPickup, newItem, this.inventory[i].maxStack - this.inventory[i].stack); + if (!noText) + ItemText.NewText(newItem, this.inventory[i].maxStack - this.inventory[i].stack); this.inventory[i].stack = this.inventory[i].maxStack; this.DoCoins(i); if (plr == Main.myPlayer) Recipe.FindRecipes(); - settings.HandlePostAction(this.inventory[i]); } } - if (obj.CanFillEmptyAmmoSlot()) + if (obj.bait <= 0 && obj.type != 169 && obj.type != 75 && obj.type != 23 && obj.type != 408 && obj.type != 370 && obj.type != 1246 && obj.type != 154 && !obj.notAmmo) { for (int i = 54; i < 58; ++i) { if (this.inventory[i].type == 0) { this.inventory[i] = obj; - if (!settings.NoText) - PopupText.NewText(PopupTextContext.RegularItemPickup, newItem, newItem.stack); + if (!noText) + ItemText.NewText(newItem, newItem.stack); this.DoCoins(i); - SoundEngine.PlaySound(7, (int) this.position.X, (int) this.position.Y); + Main.PlaySound(7, (int) this.position.X, (int) this.position.Y); if (plr == Main.myPlayer) Recipe.FindRecipes(); - settings.HandlePostAction(this.inventory[i]); return new Item(); } } @@ -24980,25 +18741,25 @@ label_15: return obj; } - public Item GetItem(int plr, Item newItem, GetItemSettings settings) + public Item GetItem(int plr, Item newItem, bool longText = false, bool noText = false) { - bool isAcoin = newItem.IsACoin; - Item obj = newItem; + bool flag = newItem.type >= 71 && newItem.type <= 74; + Item newItem1 = newItem; int num1 = 50; if (newItem.noGrabDelay > 0) - return obj; + return newItem1; int num2 = 0; if (newItem.uniqueStack && this.HasItem(newItem.type)) - return obj; - if (isAcoin) + return newItem1; + if (newItem.type == 71 || newItem.type == 72 || newItem.type == 73 || newItem.type == 74) { num2 = -4; num1 = 54; } - if (obj.FitsAmmoSlot()) + if ((newItem1.ammo > 0 || newItem1.bait > 0) && !newItem1.notAmmo || newItem1.type == 530) { - obj = this.FillAmmo(plr, obj, settings); - if (obj.type == 0 || obj.stack == 0) + newItem1 = this.FillAmmo(plr, newItem1, noText); + if (newItem1.type == 0 || newItem1.stack == 0) return new Item(); } for (int index = num2; index < 50; ++index) @@ -25006,1634 +18767,1098 @@ label_15: int i = index; if (i < 0) i = 54 + index; - if (this.GetItem_FillIntoOccupiedSlot(plr, newItem, settings, obj, i)) - return new Item(); + if (this.inventory[i].type > 0 && this.inventory[i].stack < this.inventory[i].maxStack && newItem1.IsTheSameAs(this.inventory[i])) + { + if (flag) + Main.PlaySound(38, (int) this.position.X, (int) this.position.Y); + else + Main.PlaySound(7, (int) this.position.X, (int) this.position.Y); + if (newItem1.stack + this.inventory[i].stack <= this.inventory[i].maxStack) + { + this.inventory[i].stack += newItem1.stack; + if (!noText) + ItemText.NewText(newItem, newItem1.stack, longText: longText); + this.DoCoins(i); + if (plr == Main.myPlayer) + Recipe.FindRecipes(); + AchievementsHelper.NotifyItemPickup(this, newItem1); + return new Item(); + } + AchievementsHelper.NotifyItemPickup(this, newItem1, this.inventory[i].maxStack - this.inventory[i].stack); + newItem1.stack -= this.inventory[i].maxStack - this.inventory[i].stack; + if (!noText) + ItemText.NewText(newItem, this.inventory[i].maxStack - this.inventory[i].stack, longText: longText); + this.inventory[i].stack = this.inventory[i].maxStack; + this.DoCoins(i); + if (plr == Main.myPlayer) + Recipe.FindRecipes(); + } } - if (!isAcoin && newItem.useStyle != 0) + if (newItem.type != 71 && newItem.type != 72 && newItem.type != 73 && newItem.type != 74 && newItem.useStyle > 0) { for (int i = 0; i < 10; ++i) { - if (this.GetItem_FillEmptyInventorySlot(plr, newItem, settings, obj, i)) + if (this.inventory[i].type == 0) + { + this.inventory[i] = newItem1; + if (!noText) + ItemText.NewText(newItem, newItem.stack, longText: longText); + this.DoCoins(i); + if (flag) + Main.PlaySound(38, (int) this.position.X, (int) this.position.Y); + else + Main.PlaySound(7, (int) this.position.X, (int) this.position.Y); + if (plr == Main.myPlayer) + Recipe.FindRecipes(); + AchievementsHelper.NotifyItemPickup(this, newItem1); return new Item(); + } } } if (newItem.favorited) { for (int i = 0; i < num1; ++i) { - if (this.GetItem_FillEmptyInventorySlot(plr, newItem, settings, obj, i)) + if (this.inventory[i].type == 0) + { + this.inventory[i] = newItem1; + if (!noText) + ItemText.NewText(newItem, newItem.stack, longText: longText); + this.DoCoins(i); + if (flag) + Main.PlaySound(38, (int) this.position.X, (int) this.position.Y); + else + Main.PlaySound(7, (int) this.position.X, (int) this.position.Y); + if (plr == Main.myPlayer) + Recipe.FindRecipes(); + AchievementsHelper.NotifyItemPickup(this, newItem1); return new Item(); + } } } else { for (int i = num1 - 1; i >= 0; --i) { - if (this.GetItem_FillEmptyInventorySlot(plr, newItem, settings, obj, i)) + if (this.inventory[i].type == 0) + { + this.inventory[i] = newItem1; + if (!noText) + ItemText.NewText(newItem, newItem.stack, longText: longText); + this.DoCoins(i); + if (flag) + Main.PlaySound(38, (int) this.position.X, (int) this.position.Y); + else + Main.PlaySound(7, (int) this.position.X, (int) this.position.Y); + if (plr == Main.myPlayer) + Recipe.FindRecipes(); + AchievementsHelper.NotifyItemPickup(this, newItem1); return new Item(); + } } } - return settings.CanGoIntoVoidVault && this.IsVoidVaultEnabled && this.CanVoidVaultAccept(newItem) && this.GetItem_VoidVault(plr, this.bank4.item, newItem, settings, obj) ? new Item() : obj; - } - - private bool GetItem_VoidVault( - int plr, - Item[] inventory, - Item newItem, - GetItemSettings settings, - Item returnItem) - { - if (!this.CanVoidVaultAccept(newItem)) - return false; - for (int i = 0; i < inventory.Length; ++i) - { - if (this.GetItem_FillIntoOccupiedSlot_VoidBag(plr, inventory, newItem, settings, returnItem, i)) - return true; - } - for (int i = 0; i < inventory.Length; ++i) - { - if (this.GetItem_FillEmptyInventorySlot_VoidBag(plr, inventory, newItem, settings, returnItem, i)) - return true; - } - return false; - } - - private bool CanVoidVaultAccept(Item item) => !item.questItem && item.type != 3822; - - private bool GetItem_FillIntoOccupiedSlot_VoidBag( - int plr, - Item[] inv, - Item newItem, - GetItemSettings settings, - Item returnItem, - int i) - { - if (inv[i].type > 0 && inv[i].stack < inv[i].maxStack && returnItem.IsTheSameAs(inv[i])) - { - if (newItem.IsACoin) - SoundEngine.PlaySound(38, (int) this.position.X, (int) this.position.Y); - else - SoundEngine.PlaySound(7, (int) this.position.X, (int) this.position.Y); - if (returnItem.stack + inv[i].stack <= inv[i].maxStack) - { - inv[i].stack += returnItem.stack; - if (!settings.NoText) - PopupText.NewText(PopupTextContext.ItemPickupToVoidContainer, newItem, returnItem.stack, longText: settings.LongText); - AchievementsHelper.NotifyItemPickup(this, returnItem); - settings.HandlePostAction(inv[i]); - return true; - } - AchievementsHelper.NotifyItemPickup(this, returnItem, inv[i].maxStack - inv[i].stack); - returnItem.stack -= inv[i].maxStack - inv[i].stack; - if (!settings.NoText) - PopupText.NewText(PopupTextContext.ItemPickupToVoidContainer, newItem, inv[i].maxStack - inv[i].stack, longText: settings.LongText); - inv[i].stack = inv[i].maxStack; - settings.HandlePostAction(inv[i]); - } - return false; - } - - private bool GetItem_FillIntoOccupiedSlot( - int plr, - Item newItem, - GetItemSettings settings, - Item returnItem, - int i) - { - if (this.inventory[i].type > 0 && this.inventory[i].stack < this.inventory[i].maxStack && returnItem.IsTheSameAs(this.inventory[i])) - { - if (newItem.IsACoin) - SoundEngine.PlaySound(38, (int) this.position.X, (int) this.position.Y); - else - SoundEngine.PlaySound(7, (int) this.position.X, (int) this.position.Y); - if (returnItem.stack + this.inventory[i].stack <= this.inventory[i].maxStack) - { - this.inventory[i].stack += returnItem.stack; - if (!settings.NoText) - PopupText.NewText(PopupTextContext.RegularItemPickup, newItem, returnItem.stack, longText: settings.LongText); - this.DoCoins(i); - if (plr == Main.myPlayer) - Recipe.FindRecipes(); - AchievementsHelper.NotifyItemPickup(this, returnItem); - settings.HandlePostAction(this.inventory[i]); - return true; - } - AchievementsHelper.NotifyItemPickup(this, returnItem, this.inventory[i].maxStack - this.inventory[i].stack); - returnItem.stack -= this.inventory[i].maxStack - this.inventory[i].stack; - if (!settings.NoText) - PopupText.NewText(PopupTextContext.RegularItemPickup, newItem, this.inventory[i].maxStack - this.inventory[i].stack, longText: settings.LongText); - this.inventory[i].stack = this.inventory[i].maxStack; - this.DoCoins(i); - if (plr == Main.myPlayer) - Recipe.FindRecipes(); - settings.HandlePostAction(this.inventory[i]); - } - return false; - } - - private bool GetItem_FillEmptyInventorySlot_VoidBag( - int plr, - Item[] inv, - Item newItem, - GetItemSettings settings, - Item returnItem, - int i) - { - if (inv[i].type != 0) - return false; - if (newItem.IsACoin) - SoundEngine.PlaySound(38, (int) this.position.X, (int) this.position.Y); - else - SoundEngine.PlaySound(7, (int) this.position.X, (int) this.position.Y); - inv[i] = returnItem; - if (!settings.NoText) - PopupText.NewText(PopupTextContext.ItemPickupToVoidContainer, newItem, newItem.stack, longText: settings.LongText); - this.DoCoins(i); - if (plr == Main.myPlayer) - Recipe.FindRecipes(); - AchievementsHelper.NotifyItemPickup(this, returnItem); - settings.HandlePostAction(inv[i]); - return true; - } - - private bool GetItem_FillEmptyInventorySlot( - int plr, - Item newItem, - GetItemSettings settings, - Item returnItem, - int i) - { - if (this.inventory[i].type != 0) - return false; - if (newItem.IsACoin) - SoundEngine.PlaySound(38, (int) this.position.X, (int) this.position.Y); - else - SoundEngine.PlaySound(7, (int) this.position.X, (int) this.position.Y); - this.inventory[i] = returnItem; - if (!settings.NoText) - PopupText.NewText(PopupTextContext.RegularItemPickup, newItem, newItem.stack, longText: settings.LongText); - this.DoCoins(i); - if (plr == Main.myPlayer) - Recipe.FindRecipes(); - AchievementsHelper.NotifyItemPickup(this, returnItem); - settings.HandlePostAction(this.inventory[i]); - return true; + return newItem1; } public void PlaceThing() { - if (this.itemTime == 0) - this.dontConsumeWand = false; - this.PlaceThing_Paintbrush(); - this.PlaceThing_PaintRoller(); - this.PlaceThing_PaintScrapper(); - this.PlaceThing_CannonBall(); - this.PlaceThing_XMasTreeTops(); - this.PlaceThing_ItemInExtractinator(); - if (this.noBuilding) - return; - this.PlaceThing_Tiles(); - this.PlaceThing_Walls(); - } - - private void PlaceThing_Walls() - { - if (this.inventory[this.selectedItem].createWall < 0 || (double) this.position.X / 16.0 - (double) Player.tileRangeX - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange > (double) Player.tileTargetX || ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX + (double) this.inventory[this.selectedItem].tileBoost - 1.0 + (double) this.blockRange < (double) Player.tileTargetX || (double) this.position.Y / 16.0 - (double) Player.tileRangeY - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange > (double) Player.tileTargetY || ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY + (double) this.inventory[this.selectedItem].tileBoost - 2.0 + (double) this.blockRange < (double) Player.tileTargetY) - return; - this.cursorItemIconEnabled = true; - if (!this.ItemTimeIsZero || this.itemAnimation <= 0 || !this.controlUseItem || !Main.tile[Player.tileTargetX + 1, Player.tileTargetY].active() && Main.tile[Player.tileTargetX + 1, Player.tileTargetY].wall <= (ushort) 0 && !Main.tile[Player.tileTargetX - 1, Player.tileTargetY].active() && Main.tile[Player.tileTargetX - 1, Player.tileTargetY].wall <= (ushort) 0 && !Main.tile[Player.tileTargetX, Player.tileTargetY + 1].active() && Main.tile[Player.tileTargetX, Player.tileTargetY + 1].wall <= (ushort) 0 && !Main.tile[Player.tileTargetX, Player.tileTargetY - 1].active() && Main.tile[Player.tileTargetX, Player.tileTargetY - 1].wall <= (ushort) 0 || (int) Main.tile[Player.tileTargetX, Player.tileTargetY].wall == this.inventory[this.selectedItem].createWall) - return; - bool canUse = true; - if (this.TileReplacementEnabled) - canUse = this.PlaceThing_TryReplacingWalls(canUse); - if (!canUse) - return; - WorldGen.PlaceWall(Player.tileTargetX, Player.tileTargetY, this.inventory[this.selectedItem].createWall); - if ((int) Main.tile[Player.tileTargetX, Player.tileTargetY].wall != this.inventory[this.selectedItem].createWall) - return; - this.ApplyItemTime(this.inventory[this.selectedItem], this.wallSpeed); - if (Main.netMode == 1) - NetMessage.SendData(17, number: 3, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY), number4: ((float) this.inventory[this.selectedItem].createWall)); - this.PlaceThing_Walls_FillEmptySpace(); - if (!this.autoPaint || this.builderAccStatus[3] != 0) - return; - this.TryPainting(Player.tileTargetX, Player.tileTargetY, true, false); - } - - private void PlaceThing_Walls_FillEmptySpace() - { - if (this.inventory[this.selectedItem].stack <= 1) - return; - int createWall = this.inventory[this.selectedItem].createWall; - for (int index1 = 0; index1 < 4; ++index1) + if ((this.inventory[this.selectedItem].type == 1071 || this.inventory[this.selectedItem].type == 1543) && (double) this.position.X / 16.0 - (double) Player.tileRangeX - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange <= (double) Player.tileTargetX && ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX + (double) this.inventory[this.selectedItem].tileBoost - 1.0 + (double) this.blockRange >= (double) Player.tileTargetX && (double) this.position.Y / 16.0 - (double) Player.tileRangeY - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange <= (double) Player.tileTargetY && ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY + (double) this.inventory[this.selectedItem].tileBoost - 2.0 + (double) this.blockRange >= (double) Player.tileTargetY) { int tileTargetX = Player.tileTargetX; int tileTargetY = Player.tileTargetY; - if (index1 == 0) - --tileTargetX; - if (index1 == 1) - ++tileTargetX; - if (index1 == 2) - --tileTargetY; - if (index1 == 3) - ++tileTargetY; - if (Main.tile[tileTargetX, tileTargetY].wall == (ushort) 0) + if (Main.tile[tileTargetX, tileTargetY] != null && Main.tile[tileTargetX, tileTargetY].active()) { - int num = 0; - for (int index2 = 0; index2 < 4; ++index2) + this.showItemIcon = true; + if (this.itemTime == 0 && this.itemAnimation > 0 && this.controlUseItem) { - int index3 = tileTargetX; - int index4 = tileTargetY; - if (index2 == 0) - --index3; - if (index2 == 1) - ++index3; - if (index2 == 2) - --index4; - if (index2 == 3) - ++index4; - if ((int) Main.tile[index3, index4].wall == createWall) - ++num; - } - if (num == 4) - { - WorldGen.PlaceWall(tileTargetX, tileTargetY, createWall); - if ((int) Main.tile[tileTargetX, tileTargetY].wall == createWall) + int num1 = -1; + int num2 = -1; + for (int index = 0; index < 58; ++index) { - --this.inventory[this.selectedItem].stack; - if (this.inventory[this.selectedItem].stack == 0) - this.inventory[this.selectedItem].SetDefaults(); - if (Main.netMode == 1) - NetMessage.SendData(17, number: 3, number2: ((float) tileTargetX), number3: ((float) tileTargetY), number4: ((float) createWall)); - if (this.autoPaint && this.builderAccStatus[3] == 0) - this.TryPainting(tileTargetX, tileTargetY, true, false); + if (this.inventory[index].stack > 0 && this.inventory[index].paint > (byte) 0) + { + num1 = (int) this.inventory[index].paint; + num2 = index; + break; + } + } + if (num1 > 0 && (int) Main.tile[tileTargetX, tileTargetY].color() != num1 && WorldGen.paintTile(tileTargetX, tileTargetY, (byte) num1, true)) + { + int index = num2; + --this.inventory[index].stack; + if (this.inventory[index].stack <= 0) + this.inventory[index].SetDefaults(); + this.itemTime = this.inventory[this.selectedItem].useTime; } } } } - } - - private void PlaceThing_Tiles() - { - int createTile = this.inventory[this.selectedItem].createTile; - if (createTile < 0 || (double) this.position.X / 16.0 - (double) Player.tileRangeX - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange > (double) Player.tileTargetX || ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX + (double) this.inventory[this.selectedItem].tileBoost - 1.0 + (double) this.blockRange < (double) Player.tileTargetX || (double) this.position.Y / 16.0 - (double) Player.tileRangeY - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange > (double) Player.tileTargetY || ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY + (double) this.inventory[this.selectedItem].tileBoost - 2.0 + (double) this.blockRange < (double) Player.tileTargetY) - return; - this.cursorItemIconEnabled = true; - bool flag = this.PlaceThing_Tiles_CheckLavaBlocking(); - bool canUse = this.PlaceThing_Tiles_CheckRopeUsability(this.PlaceThing_Tiles_CheckWandUsability(this.PlaceThing_Tiles_CheckGamepadTorchUsability(true))); - if (this.TileReplacementEnabled) - canUse = this.PlaceThing_TryReplacingTiles(canUse); - Tile tile = Main.tile[Player.tileTargetX, Player.tileTargetY]; - if (!canUse || (tile.active() || flag) && (!Main.tileCut[(int) tile.type] || tile.type == (ushort) 484) && (tile.type < (ushort) 373 || tile.type > (ushort) 375) && tile.type != (ushort) 461 && createTile != 199 && createTile != 23 && createTile != 2 && createTile != 109 && createTile != 60 && createTile != 70 && !Main.tileMoss[createTile] && !TileID.Sets.BreakableWhenPlacing[(int) tile.type] || !this.ItemTimeIsZero || this.itemAnimation <= 0 || !this.controlUseItem) - return; - bool canPlace1 = false; - bool newObjectType = false; - TileObject objectData = new TileObject(); - bool canPlace2; - if (TileObjectData.CustomPlace(createTile, this.inventory[this.selectedItem].placeStyle) && createTile != 82 && createTile != 227) + if ((this.inventory[this.selectedItem].type == 1072 || this.inventory[this.selectedItem].type == 1544) && (double) this.position.X / 16.0 - (double) Player.tileRangeX - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange <= (double) Player.tileTargetX && ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX + (double) this.inventory[this.selectedItem].tileBoost - 1.0 + (double) this.blockRange >= (double) Player.tileTargetX && (double) this.position.Y / 16.0 - (double) Player.tileRangeY - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange <= (double) Player.tileTargetY && ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY + (double) this.inventory[this.selectedItem].tileBoost - 2.0 + (double) this.blockRange >= (double) Player.tileTargetY) { - newObjectType = true; - canPlace2 = TileObject.CanPlace(Player.tileTargetX, Player.tileTargetY, (int) (ushort) this.inventory[this.selectedItem].createTile, this.inventory[this.selectedItem].placeStyle, this.direction, out objectData); - Player.PlaceThing_Tiles_BlockPlacementIfOverPlayers(ref canPlace2, ref objectData); - Player.PlaceThing_Tiles_BlockPlacementForRepeatedPigronatas(ref canPlace2, ref objectData); - Player.PlaceThing_Tiles_BlockPlacementForRepeatedPumpkins(ref canPlace2, ref objectData); - Player.PlaceThing_Tiles_BlockPlacementForRepeatedCoralAndBeachPiles(ref canPlace2, ref objectData); - } - else - canPlace2 = this.PlaceThing_Tiles_BlockPlacementForAssortedThings(canPlace1); - if (!canPlace2) - return; - this.PlaceThing_Tiles_PlaceIt(newObjectType, objectData); - } - - private bool PlaceThing_TryReplacingWalls(bool canUse) - { - if (canUse && this.itemAnimation > 0 && this.ItemTimeIsZero && this.controlUseItem && this.PlaceThing_ValidWallForReplacement() && WorldGen.NearFriendlyWall(Player.tileTargetX, Player.tileTargetY) && WorldGen.ReplaceWall(Player.tileTargetX, Player.tileTargetY, (ushort) this.HeldItem.createWall)) - { - canUse = false; - this.ApplyItemTime(this.HeldItem, this.wallSpeed); - NetMessage.SendData(17, number: 22, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY), number4: ((float) this.HeldItem.createWall)); - if (this.autoPaint && this.builderAccStatus[3] == 0) - this.TryPainting(Player.tileTargetX, Player.tileTargetY, true, false); - } - return canUse; - } - - private bool PlaceThing_ValidWallForReplacement() - { - Tile tile = Main.tile[Player.tileTargetX, Player.tileTargetY]; - return Main.tile[Player.tileTargetX, Player.tileTargetY].wall > (ushort) 0; - } - - private bool PlaceThing_TryReplacingTiles(bool canUse) - { - bool flag = this.PlaceThing_ValidTileForReplacement(); - if (flag) - TileObject.objectPreview.Reset(); - if (this.controlUseItem && ((!canUse || !Main.tile[Player.tileTargetX, Player.tileTargetY].active() || this.itemAnimation <= 0 ? 0 : (this.ItemTimeIsZero ? 1 : 0)) & (flag ? 1 : 0)) != 0) - { - Item bestPickaxe = this.GetBestPickaxe(); - if (bestPickaxe == null) - return false; - Tile tile = Main.tile[Player.tileTargetX, Player.tileTargetY]; - int type = (int) tile.type; - int pickaxeDamage = this.GetPickaxeDamage(Player.tileTargetX, Player.tileTargetY, bestPickaxe.pick, type, tile); - if (pickaxeDamage == 0 || !WorldGen.IsTileReplacable(Player.tileTargetX, Player.tileTargetY)) - return false; - if (true) + int tileTargetX = Player.tileTargetX; + int tileTargetY = Player.tileTargetY; + if (Main.tile[tileTargetX, tileTargetY] != null && Main.tile[tileTargetX, tileTargetY].wall > (byte) 0) { - if (this.hitReplace.AddDamage(this.hitReplace.HitObject(Player.tileTargetX, Player.tileTargetY, 1), pickaxeDamage) >= 100) + this.showItemIcon = true; + if (this.itemTime == 0 && this.itemAnimation > 0 && this.controlUseItem) { - this.ClearMiningCacheAt(Player.tileTargetX, Player.tileTargetY, 1); + int num3 = -1; + int num4 = -1; + for (int index = 0; index < 58; ++index) + { + if (this.inventory[index].stack > 0 && this.inventory[index].paint > (byte) 0) + { + num3 = (int) this.inventory[index].paint; + num4 = index; + break; + } + } + if (num3 > 0 && (int) Main.tile[tileTargetX, tileTargetY].wallColor() != num3 && WorldGen.paintWall(tileTargetX, tileTargetY, (byte) num3, true)) + { + int index = num4; + --this.inventory[index].stack; + if (this.inventory[index].stack <= 0) + this.inventory[index].SetDefaults(); + this.itemTime = this.inventory[this.selectedItem].useTime; + } + } + } + } + if ((this.inventory[this.selectedItem].type == 1100 || this.inventory[this.selectedItem].type == 1545) && (double) this.position.X / 16.0 - (double) Player.tileRangeX - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange <= (double) Player.tileTargetX && ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX + (double) this.inventory[this.selectedItem].tileBoost - 1.0 + (double) this.blockRange >= (double) Player.tileTargetX && (double) this.position.Y / 16.0 - (double) Player.tileRangeY - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange <= (double) Player.tileTargetY && ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY + (double) this.inventory[this.selectedItem].tileBoost - 2.0 + (double) this.blockRange >= (double) Player.tileTargetY) + { + int tileTargetX = Player.tileTargetX; + int tileTargetY = Player.tileTargetY; + if (Main.tile[tileTargetX, tileTargetY] != null && (Main.tile[tileTargetX, tileTargetY].wallColor() > (byte) 0 && Main.tile[tileTargetX, tileTargetY].wall > (byte) 0 || Main.tile[tileTargetX, tileTargetY].color() > (byte) 0 && Main.tile[tileTargetX, tileTargetY].active())) + { + this.showItemIcon = true; + if (this.itemTime == 0 && this.itemAnimation > 0 && this.controlUseItem) + { + if (Main.tile[tileTargetX, tileTargetY].color() > (byte) 0 && Main.tile[tileTargetX, tileTargetY].active() && WorldGen.paintTile(tileTargetX, tileTargetY, (byte) 0, true)) + this.itemTime = this.inventory[this.selectedItem].useTime; + else if (Main.tile[tileTargetX, tileTargetY].wallColor() > (byte) 0 && Main.tile[tileTargetX, tileTargetY].wall > (byte) 0 && WorldGen.paintWall(tileTargetX, tileTargetY, (byte) 0, true)) + this.itemTime = this.inventory[this.selectedItem].useTime; + } + } + } + if ((this.inventory[this.selectedItem].type == 929 || this.inventory[this.selectedItem].type == 1338 || this.inventory[this.selectedItem].type == 1345) && (double) this.position.X / 16.0 - (double) Player.tileRangeX - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange <= (double) Player.tileTargetX && ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX + (double) this.inventory[this.selectedItem].tileBoost - 1.0 + (double) this.blockRange >= (double) Player.tileTargetX && (double) this.position.Y / 16.0 - (double) Player.tileRangeY - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange <= (double) Player.tileTargetY && ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY + (double) this.inventory[this.selectedItem].tileBoost - 2.0 + (double) this.blockRange >= (double) Player.tileTargetY) + { + int tileTargetX = Player.tileTargetX; + int tileTargetY = Player.tileTargetY; + if (Main.tile[tileTargetX, tileTargetY].active() && Main.tile[tileTargetX, tileTargetY].type == (ushort) 209) + this.ShootFromCannon(tileTargetX, tileTargetY); + } + if (this.inventory[this.selectedItem].type >= 1874 && this.inventory[this.selectedItem].type <= 1905 && Main.tile[Player.tileTargetX, Player.tileTargetY].active() && Main.tile[Player.tileTargetX, Player.tileTargetY].type == (ushort) 171 && (double) this.position.X / 16.0 - (double) Player.tileRangeX - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange <= (double) Player.tileTargetX && ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX + (double) this.inventory[this.selectedItem].tileBoost - 1.0 + (double) this.blockRange >= (double) Player.tileTargetX && (double) this.position.Y / 16.0 - (double) Player.tileRangeY - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange <= (double) Player.tileTargetY && ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY + (double) this.inventory[this.selectedItem].tileBoost - 2.0 + (double) this.blockRange >= (double) Player.tileTargetY && this.itemTime == 0 && this.itemAnimation > 0 && this.controlUseItem) + { + int type = this.inventory[this.selectedItem].type; + if (type >= 1874 && type <= 1877) + { + int style = type - 1873; + if (WorldGen.checkXmasTreeDrop(Player.tileTargetX, Player.tileTargetY, 0) != style) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + WorldGen.dropXmasTree(Player.tileTargetX, Player.tileTargetY, 0); + WorldGen.setXmasTree(Player.tileTargetX, Player.tileTargetY, 0, style); + int tileTargetX = Player.tileTargetX; + int tileTargetY = Player.tileTargetY; + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX < (short) 10) + { + tileTargetX -= (int) Main.tile[Player.tileTargetX, Player.tileTargetY].frameX; + tileTargetY -= (int) Main.tile[Player.tileTargetX, Player.tileTargetY].frameY; + } + NetMessage.SendTileSquare(-1, tileTargetX, tileTargetY, 1); + } + } + else if (type >= 1878 && type <= 1883) + { + int style = type - 1877; + if (WorldGen.checkXmasTreeDrop(Player.tileTargetX, Player.tileTargetY, 1) != style) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + WorldGen.dropXmasTree(Player.tileTargetX, Player.tileTargetY, 1); + WorldGen.setXmasTree(Player.tileTargetX, Player.tileTargetY, 1, style); + int tileTargetX = Player.tileTargetX; + int tileTargetY = Player.tileTargetY; + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX < (short) 10) + { + tileTargetX -= (int) Main.tile[Player.tileTargetX, Player.tileTargetY].frameX; + tileTargetY -= (int) Main.tile[Player.tileTargetX, Player.tileTargetY].frameY; + } + NetMessage.SendTileSquare(-1, tileTargetX, tileTargetY, 1); + } + } + else if (type >= 1884 && type <= 1894) + { + int style = type - 1883; + if (WorldGen.checkXmasTreeDrop(Player.tileTargetX, Player.tileTargetY, 2) != style) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + WorldGen.dropXmasTree(Player.tileTargetX, Player.tileTargetY, 2); + WorldGen.setXmasTree(Player.tileTargetX, Player.tileTargetY, 2, style); + int tileTargetX = Player.tileTargetX; + int tileTargetY = Player.tileTargetY; + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX < (short) 10) + { + tileTargetX -= (int) Main.tile[Player.tileTargetX, Player.tileTargetY].frameX; + tileTargetY -= (int) Main.tile[Player.tileTargetX, Player.tileTargetY].frameY; + } + NetMessage.SendTileSquare(-1, tileTargetX, tileTargetY, 1); + } + } + else if (type >= 1895 && type <= 1905) + { + int style = type - 1894; + if (WorldGen.checkXmasTreeDrop(Player.tileTargetX, Player.tileTargetY, 3) != style) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + WorldGen.dropXmasTree(Player.tileTargetX, Player.tileTargetY, 3); + WorldGen.setXmasTree(Player.tileTargetX, Player.tileTargetY, 3, style); + int tileTargetX = Player.tileTargetX; + int tileTargetY = Player.tileTargetY; + if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX < (short) 10) + { + tileTargetX -= (int) Main.tile[Player.tileTargetX, Player.tileTargetY].frameX; + tileTargetY -= (int) Main.tile[Player.tileTargetX, Player.tileTargetY].frameY; + } + NetMessage.SendTileSquare(-1, tileTargetX, tileTargetY, 1); + } + } + } + if (ItemID.Sets.ExtractinatorMode[this.inventory[this.selectedItem].type] >= 0 && Main.tile[Player.tileTargetX, Player.tileTargetY].active() && Main.tile[Player.tileTargetX, Player.tileTargetY].type == (ushort) 219) + { + if ((double) this.position.X / 16.0 - (double) Player.tileRangeX - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange <= (double) Player.tileTargetX && ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX + (double) this.inventory[this.selectedItem].tileBoost - 1.0 + (double) this.blockRange >= (double) Player.tileTargetX && (double) this.position.Y / 16.0 - (double) Player.tileRangeY - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange <= (double) Player.tileTargetY && ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY + (double) this.inventory[this.selectedItem].tileBoost - 2.0 + (double) this.blockRange >= (double) Player.tileTargetY && this.itemTime == 0 && this.itemAnimation > 0 && this.controlUseItem) + { + this.itemTime = this.inventory[this.selectedItem].useTime; + Main.PlaySound(7); + Player.ExtractinatorUse(ItemID.Sets.ExtractinatorMode[this.inventory[this.selectedItem].type]); + } + } + else if (!this.noBuilding && this.inventory[this.selectedItem].createTile >= 0 && (double) this.position.X / 16.0 - (double) Player.tileRangeX - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange <= (double) Player.tileTargetX && ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX + (double) this.inventory[this.selectedItem].tileBoost - 1.0 + (double) this.blockRange >= (double) Player.tileTargetX && (double) this.position.Y / 16.0 - (double) Player.tileRangeY - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange <= (double) Player.tileTargetY && ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY + (double) this.inventory[this.selectedItem].tileBoost - 2.0 + (double) this.blockRange >= (double) Player.tileTargetY) + { + this.showItemIcon = true; + bool flag1 = false; + if (Main.tile[Player.tileTargetX, Player.tileTargetY].liquid > (byte) 0 && Main.tile[Player.tileTargetX, Player.tileTargetY].lava()) + { + if (Main.tileSolid[this.inventory[this.selectedItem].createTile]) + flag1 = true; + else if (!TileObjectData.CheckLiquidPlacement(this.inventory[this.selectedItem].createTile, this.inventory[this.selectedItem].placeStyle, Main.tile[Player.tileTargetX, Player.tileTargetY])) + flag1 = true; + } + bool flag2 = true; + if (PlayerInput.UsingGamepad && this.inventory[this.selectedItem].createTile == 4 && Main.SmartCursorEnabled && !Main.SmartCursorShowing) + flag2 = false; + if (this.inventory[this.selectedItem].tileWand > 0) + { + int tileWand = this.inventory[this.selectedItem].tileWand; + flag2 = false; + for (int index = 0; index < 58; ++index) + { + if (tileWand == this.inventory[index].type && this.inventory[index].stack > 0) + { + flag2 = true; + break; + } + } + } + if (Main.tileRope[this.inventory[this.selectedItem].createTile] && flag2 && Main.tile[Player.tileTargetX, Player.tileTargetY].active() && Main.tileRope[(int) Main.tile[Player.tileTargetX, Player.tileTargetY].type]) + { + int tileTargetY = Player.tileTargetY; + int tileTargetX = Player.tileTargetX; + int createTile = this.inventory[this.selectedItem].createTile; + while (Main.tile[tileTargetX, tileTargetY].active() && Main.tileRope[(int) Main.tile[tileTargetX, tileTargetY].type] && tileTargetY < Main.maxTilesX - 5 && Main.tile[tileTargetX, tileTargetY + 2] != null && !Main.tile[tileTargetX, tileTargetY + 1].lava()) + { + ++tileTargetY; + if (Main.tile[tileTargetX, tileTargetY] == null) + { + flag2 = false; + tileTargetY = Player.tileTargetY; + } + } + if (!Main.tile[tileTargetX, tileTargetY].active()) + Player.tileTargetY = tileTargetY; + } + if (flag2 && (!Main.tile[Player.tileTargetX, Player.tileTargetY].active() && !flag1 || Main.tileCut[(int) Main.tile[Player.tileTargetX, Player.tileTargetY].type] || Main.tile[Player.tileTargetX, Player.tileTargetY].type >= (ushort) 373 && Main.tile[Player.tileTargetX, Player.tileTargetY].type <= (ushort) 375 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == (ushort) 461 || this.inventory[this.selectedItem].createTile == 199 || this.inventory[this.selectedItem].createTile == 23 || this.inventory[this.selectedItem].createTile == 2 || this.inventory[this.selectedItem].createTile == 109 || this.inventory[this.selectedItem].createTile == 60 || this.inventory[this.selectedItem].createTile == 70 || TileID.Sets.BreakableWhenPlacing[(int) Main.tile[Player.tileTargetX, Player.tileTargetY].type]) && this.itemTime == 0 && this.itemAnimation > 0 && this.controlUseItem) + { + bool flag3 = false; + bool flag4 = false; + TileObject objectData = new TileObject(); + if (TileObjectData.CustomPlace(this.inventory[this.selectedItem].createTile, this.inventory[this.selectedItem].placeStyle) && this.inventory[this.selectedItem].createTile != 82) + { + flag4 = true; + flag3 = TileObject.CanPlace(Player.tileTargetX, Player.tileTargetY, (int) (ushort) this.inventory[this.selectedItem].createTile, this.inventory[this.selectedItem].placeStyle, this.direction, out objectData); + int width = 0; + int height = 0; + int x = 0; + int y = 0; + switch (objectData.type) + { + case 138: + width = 32; + height = 32; + x = objectData.xCoord * 16; + y = objectData.yCoord * 16; + break; + case 235: + width = 48; + height = 16; + x = objectData.xCoord * 16; + y = objectData.yCoord * 16; + break; + } + if (width != 0 && height != 0) + { + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(x, y, width, height); + for (int index = 0; index < (int) byte.MaxValue; ++index) + { + Player player = Main.player[index]; + if (player.active && !player.dead && player.Hitbox.Intersects(rectangle)) + { + flag3 = false; + break; + } + } + } + if (objectData.type == 454) + { + for (int index = -2; index < 2; ++index) + { + Tile tile = Main.tile[Player.tileTargetX + index, Player.tileTargetY]; + if (tile.active() && tile.type == (ushort) 454) + flag3 = false; + } + } + if (objectData.type == 254) + { + for (int index1 = -1; index1 < 1; ++index1) + { + for (int index2 = -1; index2 < 1; ++index2) + { + if (!WorldGen.CanCutTile(Player.tileTargetX + index2, Player.tileTargetY + index1, TileCuttingContext.TilePlacement)) + flag3 = false; + } + } + } } else { - int tileDustAmount = WorldGen.KillTile_GetTileDustAmount(true, tile); - for (int index = 0; index < tileDustAmount; ++index) - WorldGen.KillTile_MakeTileDust(Player.tileTargetX, Player.tileTargetY, tile); - WorldGen.KillTile_PlaySounds(Player.tileTargetX, Player.tileTargetY, true, tile); - if (this.HeldItem.consumable) - ++this.HeldItem.stack; - this.dontConsumeWand = true; - this.ApplyItemTime(bestPickaxe, this.pickSpeed); - this.SetItemAnimation((int) ((double) bestPickaxe.useTime * (double) this.pickSpeed)); - return false; + if (this.inventory[this.selectedItem].type == 213) + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == (ushort) 0 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == (ushort) 1) + flag3 = true; + } + else if (this.inventory[this.selectedItem].createTile == 23 || this.inventory[this.selectedItem].createTile == 2 || this.inventory[this.selectedItem].createTile == 109 || this.inventory[this.selectedItem].createTile == 199) + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].nactive() && Main.tile[Player.tileTargetX, Player.tileTargetY].type == (ushort) 0) + flag3 = true; + } + else if (this.inventory[this.selectedItem].createTile == 227) + flag3 = true; + else if (this.inventory[this.selectedItem].createTile >= 373 && this.inventory[this.selectedItem].createTile <= 375) + { + int tileTargetX = Player.tileTargetX; + int index = Player.tileTargetY - 1; + if (Main.tile[tileTargetX, index].nactive() && Main.tileSolid[(int) Main.tile[tileTargetX, index].type] && !Main.tileSolidTop[(int) Main.tile[tileTargetX, index].type]) + flag3 = true; + } + else if (this.inventory[this.selectedItem].createTile == 461) + { + int tileTargetX = Player.tileTargetX; + int index = Player.tileTargetY - 1; + if (Main.tile[tileTargetX, index].nactive() && Main.tileSolid[(int) Main.tile[tileTargetX, index].type] && !Main.tileSolidTop[(int) Main.tile[tileTargetX, index].type]) + flag3 = true; + } + else if (this.inventory[this.selectedItem].createTile == 60 || this.inventory[this.selectedItem].createTile == 70) + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].nactive() && Main.tile[Player.tileTargetX, Player.tileTargetY].type == (ushort) 59) + flag3 = true; + } + else if (this.inventory[this.selectedItem].createTile == 4 || this.inventory[this.selectedItem].createTile == 136) + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].wall > (byte) 0) + { + flag3 = true; + } + else + { + if (!WorldGen.SolidTileNoAttach(Player.tileTargetX, Player.tileTargetY + 1) && !WorldGen.SolidTileNoAttach(Player.tileTargetX - 1, Player.tileTargetY) && !WorldGen.SolidTileNoAttach(Player.tileTargetX + 1, Player.tileTargetY)) + { + if (!WorldGen.SolidTileNoAttach(Player.tileTargetX, Player.tileTargetY + 1) && (Main.tile[Player.tileTargetX, Player.tileTargetY + 1].halfBrick() || Main.tile[Player.tileTargetX, Player.tileTargetY + 1].slope() != (byte) 0)) + { + if (!TileID.Sets.Platforms[(int) Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type]) + { + WorldGen.SlopeTile(Player.tileTargetX, Player.tileTargetY + 1); + if (Main.netMode == 1) + NetMessage.SendData(17, number: 14, number2: ((float) Player.tileTargetX), number3: ((float) (Player.tileTargetY + 1))); + } + } + else if (!WorldGen.SolidTileNoAttach(Player.tileTargetX, Player.tileTargetY + 1) && !WorldGen.SolidTileNoAttach(Player.tileTargetX - 1, Player.tileTargetY) && (Main.tile[Player.tileTargetX - 1, Player.tileTargetY].halfBrick() || Main.tile[Player.tileTargetX - 1, Player.tileTargetY].slope() != (byte) 0)) + { + if (!TileID.Sets.Platforms[(int) Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type]) + { + WorldGen.SlopeTile(Player.tileTargetX - 1, Player.tileTargetY); + if (Main.netMode == 1) + NetMessage.SendData(17, number: 14, number2: ((float) (Player.tileTargetX - 1)), number3: ((float) Player.tileTargetY)); + } + } + else if (!WorldGen.SolidTileNoAttach(Player.tileTargetX, Player.tileTargetY + 1) && !WorldGen.SolidTileNoAttach(Player.tileTargetX - 1, Player.tileTargetY) && !WorldGen.SolidTileNoAttach(Player.tileTargetX + 1, Player.tileTargetY) && (Main.tile[Player.tileTargetX + 1, Player.tileTargetY].halfBrick() || Main.tile[Player.tileTargetX + 1, Player.tileTargetY].slope() != (byte) 0) && TileID.Sets.Platforms[(int) Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type]) + { + WorldGen.SlopeTile(Player.tileTargetX + 1, Player.tileTargetY); + if (Main.netMode == 1) + NetMessage.SendData(17, number: 14, number2: ((float) (Player.tileTargetX + 1)), number3: ((float) Player.tileTargetY)); + } + } + int index3 = (int) Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type; + if (Main.tile[Player.tileTargetX, Player.tileTargetY].halfBrick()) + index3 = -1; + int index4 = (int) Main.tile[Player.tileTargetX - 1, Player.tileTargetY].type; + int index5 = (int) Main.tile[Player.tileTargetX + 1, Player.tileTargetY].type; + int num5 = (int) Main.tile[Player.tileTargetX - 1, Player.tileTargetY - 1].type; + int num6 = (int) Main.tile[Player.tileTargetX + 1, Player.tileTargetY - 1].type; + int num7 = (int) Main.tile[Player.tileTargetX - 1, Player.tileTargetY - 1].type; + int num8 = (int) Main.tile[Player.tileTargetX + 1, Player.tileTargetY + 1].type; + if (!Main.tile[Player.tileTargetX, Player.tileTargetY + 1].nactive()) + index3 = -1; + if (!Main.tile[Player.tileTargetX - 1, Player.tileTargetY].nactive()) + index4 = -1; + if (!Main.tile[Player.tileTargetX + 1, Player.tileTargetY].nactive()) + index5 = -1; + if (!Main.tile[Player.tileTargetX - 1, Player.tileTargetY - 1].nactive()) + num5 = -1; + if (!Main.tile[Player.tileTargetX + 1, Player.tileTargetY - 1].nactive()) + num6 = -1; + if (!Main.tile[Player.tileTargetX - 1, Player.tileTargetY + 1].nactive()) + num7 = -1; + if (!Main.tile[Player.tileTargetX + 1, Player.tileTargetY + 1].nactive()) + num8 = -1; + if (index3 >= 0 && Main.tileSolid[index3] && (!Main.tileNoAttach[index3] || index3 >= 0 && TileID.Sets.Platforms[index3])) + flag3 = true; + else if (index4 >= 0 && Main.tileSolid[index4] && !Main.tileNoAttach[index4] || index4 == 5 && num5 == 5 && num7 == 5 || index4 == 124) + flag3 = true; + else if (index5 >= 0 && Main.tileSolid[index5] && !Main.tileNoAttach[index5] || index5 == 5 && num6 == 5 && num8 == 5 || index5 == 124) + flag3 = true; + } + } + else if (this.inventory[this.selectedItem].createTile == 78 || this.inventory[this.selectedItem].createTile == 98 || this.inventory[this.selectedItem].createTile == 100 || this.inventory[this.selectedItem].createTile == 173 || this.inventory[this.selectedItem].createTile == 174 || this.inventory[this.selectedItem].createTile == 324) + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY + 1].nactive() && (Main.tileSolid[(int) Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type] || Main.tileTable[(int) Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type])) + flag3 = true; + } + else if (this.inventory[this.selectedItem].createTile == 419) + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY + 1].active() && (Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type == (ushort) 419 || this.inventory[this.selectedItem].placeStyle != 2 && Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type == (ushort) 420)) + flag3 = true; + } + else if (this.inventory[this.selectedItem].createTile == 13 || this.inventory[this.selectedItem].createTile == 29 || this.inventory[this.selectedItem].createTile == 33 || this.inventory[this.selectedItem].createTile == 49 || this.inventory[this.selectedItem].createTile == 50 || this.inventory[this.selectedItem].createTile == 103) + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY + 1].nactive() && Main.tileTable[(int) Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type]) + flag3 = true; + } + else if (this.inventory[this.selectedItem].createTile == 275 || this.inventory[this.selectedItem].createTile == 276 || this.inventory[this.selectedItem].createTile == 277) + flag3 = true; + else if (this.inventory[this.selectedItem].createTile == 51 || this.inventory[this.selectedItem].createTile == 330 || this.inventory[this.selectedItem].createTile == 331 || this.inventory[this.selectedItem].createTile == 332 || this.inventory[this.selectedItem].createTile == 333 || this.inventory[this.selectedItem].createTile == 336 || this.inventory[this.selectedItem].createTile == 340 || this.inventory[this.selectedItem].createTile == 342 || this.inventory[this.selectedItem].createTile == 341 || this.inventory[this.selectedItem].createTile == 343 || this.inventory[this.selectedItem].createTile == 344 || this.inventory[this.selectedItem].createTile == 379 || this.inventory[this.selectedItem].createTile == 351) + { + if (Main.tile[Player.tileTargetX + 1, Player.tileTargetY].active() || Main.tile[Player.tileTargetX + 1, Player.tileTargetY].wall > (byte) 0 || Main.tile[Player.tileTargetX - 1, Player.tileTargetY].active() || Main.tile[Player.tileTargetX - 1, Player.tileTargetY].wall > (byte) 0 || Main.tile[Player.tileTargetX, Player.tileTargetY + 1].active() || Main.tile[Player.tileTargetX, Player.tileTargetY + 1].wall > (byte) 0 || Main.tile[Player.tileTargetX, Player.tileTargetY - 1].active() || Main.tile[Player.tileTargetX, Player.tileTargetY - 1].wall > (byte) 0) + flag3 = true; + } + else if (this.inventory[this.selectedItem].createTile == 314) + { + for (int index6 = Player.tileTargetX - 1; index6 <= Player.tileTargetX + 1; ++index6) + { + for (int index7 = Player.tileTargetY - 1; index7 <= Player.tileTargetY + 1; ++index7) + { + Tile tile = Main.tile[index6, index7]; + if (tile.active() || tile.wall > (byte) 0) + { + flag3 = true; + break; + } + } + } + } + else + { + Tile tile1 = Main.tile[Player.tileTargetX - 1, Player.tileTargetY]; + Tile tile2 = Main.tile[Player.tileTargetX + 1, Player.tileTargetY]; + Tile tile3 = Main.tile[Player.tileTargetX, Player.tileTargetY - 1]; + Tile tile4 = Main.tile[Player.tileTargetX, Player.tileTargetY + 1]; + if (tile2.active() && (Main.tileSolid[(int) tile2.type] || Main.tileRope[(int) tile2.type] || tile2.type == (ushort) 314) || tile2.wall > (byte) 0 || tile1.active() && (Main.tileSolid[(int) tile1.type] || Main.tileRope[(int) tile1.type] || tile1.type == (ushort) 314) || tile1.wall > (byte) 0 || tile4.active() && (Main.tileSolid[(int) tile4.type] || tile4.type == (ushort) 124 || Main.tileRope[(int) tile4.type] || tile4.type == (ushort) 314) || tile4.wall > (byte) 0 || tile3.active() && (Main.tileSolid[(int) tile3.type] || tile3.type == (ushort) 124 || Main.tileRope[(int) tile3.type] || tile3.type == (ushort) 314) || tile3.wall > (byte) 0) + flag3 = true; + } + if (this.inventory[this.selectedItem].type == 213 && Main.tile[Player.tileTargetX, Player.tileTargetY].active()) + { + int tileTargetX = Player.tileTargetX; + int tileTargetY = Player.tileTargetY; + if (Main.tile[tileTargetX, tileTargetY].type == (ushort) 3 || Main.tile[tileTargetX, tileTargetY].type == (ushort) 73 || Main.tile[tileTargetX, tileTargetY].type == (ushort) 84) + { + WorldGen.KillTile(Player.tileTargetX, Player.tileTargetY); + if (!Main.tile[Player.tileTargetX, Player.tileTargetY].active() && Main.netMode == 1) + NetMessage.SendData(17, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); + } + else if (Main.tile[tileTargetX, tileTargetY].type == (ushort) 83) + { + bool flag5 = false; + int num = (int) Main.tile[tileTargetX, tileTargetY].frameX / 18; + if (num == 0 && Main.dayTime) + flag5 = true; + if (num == 1 && !Main.dayTime) + flag5 = true; + if (num == 3 && !Main.dayTime && (Main.bloodMoon || Main.moonPhase == 0)) + flag5 = true; + if (num == 4 && (Main.raining || (double) Main.cloudAlpha > 0.0)) + flag5 = true; + if (num == 5 && !Main.raining && Main.dayTime && Main.time > 40500.0) + flag5 = true; + if (flag5) + { + WorldGen.KillTile(Player.tileTargetX, Player.tileTargetY); + NetMessage.SendData(17, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); + } + } + } + if (Main.tileAlch[this.inventory[this.selectedItem].createTile]) + flag3 = true; + if (Main.tile[Player.tileTargetX, Player.tileTargetY].active() && (Main.tileCut[(int) Main.tile[Player.tileTargetX, Player.tileTargetY].type] || TileID.Sets.BreakableWhenPlacing[(int) Main.tile[Player.tileTargetX, Player.tileTargetY].type] || Main.tile[Player.tileTargetX, Player.tileTargetY].type >= (ushort) 373 && Main.tile[Player.tileTargetX, Player.tileTargetY].type <= (ushort) 375 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == (ushort) 461)) + { + if ((int) Main.tile[Player.tileTargetX, Player.tileTargetY].type != this.inventory[this.selectedItem].createTile) + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type != (ushort) 78 && Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type != (ushort) 380 || (Main.tile[Player.tileTargetX, Player.tileTargetY].type == (ushort) 3 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == (ushort) 73) && Main.tileAlch[this.inventory[this.selectedItem].createTile]) + { + WorldGen.KillTile(Player.tileTargetX, Player.tileTargetY); + if (!Main.tile[Player.tileTargetX, Player.tileTargetY].active() && Main.netMode == 1) + NetMessage.SendData(17, number: 4, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); + } + else + flag3 = false; + } + else + flag3 = false; + } + if (!flag3 && this.inventory[this.selectedItem].createTile >= 0 && TileID.Sets.Platforms[this.inventory[this.selectedItem].createTile]) + { + for (int index8 = Player.tileTargetX - 1; index8 <= Player.tileTargetX + 1; ++index8) + { + for (int index9 = Player.tileTargetY - 1; index9 <= Player.tileTargetY + 1; ++index9) + { + if (Main.tile[index8, index9].active()) + { + flag3 = true; + break; + } + } + } + } + } + if (flag3) + { + int num9 = this.inventory[this.selectedItem].placeStyle; + if (!flag4) + { + if (this.inventory[this.selectedItem].createTile == 36) + num9 = Main.rand.Next(7); + if (this.inventory[this.selectedItem].createTile == 212 && this.direction > 0) + num9 = 1; + if (this.inventory[this.selectedItem].createTile == 141) + num9 = Main.rand.Next(2); + if (this.inventory[this.selectedItem].createTile == 128 || this.inventory[this.selectedItem].createTile == 269 || this.inventory[this.selectedItem].createTile == 334) + num9 = this.direction >= 0 ? 1 : -1; + if (this.inventory[this.selectedItem].createTile == 241 && this.inventory[this.selectedItem].placeStyle == 0) + num9 = Main.rand.Next(0, 9); + if (this.inventory[this.selectedItem].createTile == 35 && this.inventory[this.selectedItem].placeStyle == 0) + num9 = Main.rand.Next(9); + } + if (this.inventory[this.selectedItem].createTile == 314 && num9 == 2 && this.direction == 1) + ++num9; + int[,] numArray = (int[,]) null; + if (this.autoPaint || this.autoActuator) + { + numArray = new int[11, 11]; + for (int index10 = 0; index10 < 11; ++index10) + { + for (int index11 = 0; index11 < 11; ++index11) + { + int index12 = Player.tileTargetX - 5 + index10; + int index13 = Player.tileTargetY - 5 + index11; + numArray[index10, index11] = !Main.tile[index12, index13].active() ? -1 : (int) Main.tile[index12, index13].type; + } + } + } + bool forced = false; + bool flag6; + if (flag4) + { + flag6 = TileObject.Place(objectData); + WorldGen.SquareTileFrame(Player.tileTargetX, Player.tileTargetY); + Main.PlaySound(0, Player.tileTargetX * 16, Player.tileTargetY * 16); + } + else + flag6 = WorldGen.PlaceTile(Player.tileTargetX, Player.tileTargetY, this.inventory[this.selectedItem].createTile, forced: forced, plr: this.whoAmI, style: num9); + if (this.inventory[this.selectedItem].type == 213 && !flag6 && Main.tile[Player.tileTargetX, Player.tileTargetY].type == (ushort) 1 && Main.tile[Player.tileTargetX, Player.tileTargetY].active()) + { + int num10 = 0; + int num11 = 0; + Point tileCoordinates = this.Center.ToTileCoordinates(); + Dictionary resultsOutput = new Dictionary(); + WorldUtils.Gen(new Point(tileCoordinates.X - 25, tileCoordinates.Y - 25), (GenShape) new Shapes.Rectangle(50, 50), (GenAction) new Actions.TileScanner(new ushort[6] + { + (ushort) 182, + (ushort) 180, + (ushort) 179, + (ushort) 183, + (ushort) 181, + (ushort) 381 + }).Output(resultsOutput)); + foreach (KeyValuePair keyValuePair in resultsOutput) + { + if (keyValuePair.Value > num11) + { + num11 = keyValuePair.Value; + num10 = (int) keyValuePair.Key; + } + } + if (num11 == 0) + num10 = Utils.SelectRandom(Main.rand, 182, 180, 179, 183, 181); + if (num10 != 0) + { + Main.tile[Player.tileTargetX, Player.tileTargetY].type = (ushort) num10; + WorldGen.SquareTileFrame(Player.tileTargetX, Player.tileTargetY); + NetMessage.SendTileSquare(-1, Player.tileTargetX, Player.tileTargetY, 1); + flag6 = true; + } + } + if (flag6) + { + this.itemTime = (int) ((double) this.inventory[this.selectedItem].useTime * (double) this.tileSpeed); + if (flag4) + { + TileObjectData.CallPostPlacementPlayerHook(Player.tileTargetX, Player.tileTargetY, this.inventory[this.selectedItem].createTile, num9, this.direction, objectData); + if (Main.netMode == 1 && !Main.tileContainer[this.inventory[this.selectedItem].createTile] && this.inventory[this.selectedItem].createTile != 423) + NetMessage.SendObjectPlacment(-1, Player.tileTargetX, Player.tileTargetY, objectData.type, objectData.style, objectData.alternate, objectData.random, this.direction); + } + else + { + NetMessage.SendData(17, number: 1, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY), number4: ((float) this.inventory[this.selectedItem].createTile), number5: num9); + if (this.inventory[this.selectedItem].createTile == 15) + { + if (this.direction == 1) + { + Main.tile[Player.tileTargetX, Player.tileTargetY].frameX += (short) 18; + Main.tile[Player.tileTargetX, Player.tileTargetY - 1].frameX += (short) 18; + } + if (Main.netMode == 1) + NetMessage.SendTileSquare(-1, Player.tileTargetX - 1, Player.tileTargetY - 1, 3); + } + else if ((this.inventory[this.selectedItem].createTile == 79 || this.inventory[this.selectedItem].createTile == 90) && Main.netMode == 1) + NetMessage.SendTileSquare(-1, Player.tileTargetX, Player.tileTargetY, 5); + } + if (this.inventory[this.selectedItem].createTile == 137) + { + if (this.direction == 1) + Main.tile[Player.tileTargetX, Player.tileTargetY].frameX += (short) 18; + if (Main.netMode == 1) + NetMessage.SendTileSquare(-1, Player.tileTargetX, Player.tileTargetY, 1); + } + if (this.inventory[this.selectedItem].createTile == 419) + { + if (Main.netMode == 1) + NetMessage.SendData(17, number: 18, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); + else + Wiring.PokeLogicGate(Player.tileTargetX, Player.tileTargetY); + } + if (this.inventory[this.selectedItem].createTile >= 0 && TileID.Sets.Platforms[this.inventory[this.selectedItem].createTile] && Main.SmartCursorEnabled) + { + int tileTargetX = Player.tileTargetX; + int tileTargetY = Player.tileTargetY; + int slope1 = -1; + int num12 = 0; + int num13 = 0; + bool flag7 = true; + for (int index14 = -1; index14 < 2; ++index14) + { + for (int index15 = -1; index15 < 2; ++index15) + { + if ((index14 != 0 || index15 != 0) && TileID.Sets.Platforms[(int) Main.tile[tileTargetX + index14, tileTargetY + index15].type]) + flag7 = false; + } + } + if (!flag7) + { + Tile tile5 = Main.tile[tileTargetX - 1, tileTargetY - 1]; + if (tile5.active() && TileID.Sets.Platforms[(int) tile5.type] && tile5.slope() != (byte) 2) + ++num12; + Tile tile6 = Main.tile[tileTargetX - 1, tileTargetY + 1]; + if (tile6.active() && TileID.Sets.Platforms[(int) tile6.type] && tile6.slope() != (byte) 1) + ++num13; + Tile tile7 = Main.tile[tileTargetX + 1, tileTargetY - 1]; + if (tile7.active() && TileID.Sets.Platforms[(int) tile7.type] && tile7.slope() != (byte) 1) + ++num13; + Tile tile8 = Main.tile[tileTargetX + 1, tileTargetY + 1]; + if (tile8.active() && TileID.Sets.Platforms[(int) tile8.type] && tile8.slope() != (byte) 2) + ++num12; + Tile testTile1 = Main.tile[tileTargetX - 1, tileTargetY]; + if (WorldGen.SolidTile(testTile1)) + { + ++num12; + if (TileID.Sets.Platforms[(int) testTile1.type] && testTile1.slope() == (byte) 0) + ++num12; + } + Tile testTile2 = Main.tile[tileTargetX + 1, tileTargetY]; + if (WorldGen.SolidTile(testTile2)) + { + ++num13; + if (TileID.Sets.Platforms[(int) testTile2.type] && testTile2.slope() == (byte) 0) + ++num13; + } + if (num12 > num13) + slope1 = 1; + else if (num13 > num12) + slope1 = 2; + Tile tile9 = Main.tile[tileTargetX - 1, tileTargetY]; + if (tile9.active() && TileID.Sets.Platforms[(int) tile9.type]) + slope1 = 0; + Tile tile10 = Main.tile[tileTargetX + 1, tileTargetY]; + if (tile10.active() && TileID.Sets.Platforms[(int) tile10.type]) + slope1 = 0; + if (slope1 != -1) + { + WorldGen.SlopeTile(tileTargetX, tileTargetY, slope1); + int num14 = (int) Main.tile[tileTargetX, tileTargetY].slope(); + if (Main.netMode == 1) + NetMessage.SendData(17, number: 14, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY), number4: ((float) num14)); + int num15; + int num16; + if (slope1 == 1) + { + num15 = -1; + num16 = -1; + } + else + { + num15 = 1; + num16 = -1; + } + Tile tile11 = Main.tile[tileTargetX + num15, tileTargetY + num16]; + if (tile11.active() && TileID.Sets.Platforms[(int) tile11.type] && tile11.slope() == (byte) 0 && (!Main.tile[tileTargetX + num15 + num15, tileTargetY + num16].active() || !TileID.Sets.Platforms[(int) Main.tile[tileTargetX + num15 + num15, tileTargetY + num16].type] || !Main.tile[tileTargetX + num15 + num15, tileTargetY + num16].halfBrick())) + { + WorldGen.SlopeTile(tileTargetX + num15, tileTargetY + num16, slope1); + int num17 = (int) tile11.slope(); + if (Main.netMode == 1) + NetMessage.SendData(17, number: 14, number2: ((float) (tileTargetX + num15)), number3: ((float) (tileTargetY + num16)), number4: ((float) num17)); + } + int num18; + int num19; + if (slope1 == 1) + { + num18 = 1; + num19 = 1; + } + else + { + num18 = -1; + num19 = 1; + } + Tile tile12 = Main.tile[tileTargetX + num18, tileTargetY + num19]; + if (tile12.active() && TileID.Sets.Platforms[(int) tile12.type] && tile12.slope() == (byte) 0 && WorldGen.PlatformProperSides(tileTargetX + num18, tileTargetY + num19, true) <= 0) + { + WorldGen.SlopeTile(tileTargetX + num18, tileTargetY + num19, slope1); + int num20 = (int) tile12.slope(); + if (Main.netMode == 1) + NetMessage.SendData(17, number: 14, number2: ((float) (tileTargetX + num18)), number3: ((float) (tileTargetY + num19)), number4: ((float) num20)); + } + } + else + { + int num21 = -1; + Tile tile13 = Main.tile[tileTargetX + num21, tileTargetY]; + if (tile13.active() && TileID.Sets.Platforms[(int) tile13.type] && tile13.slope() != (byte) 0) + { + int num22 = (tile13.slope() == (byte) 1).ToDirectionInt() * num21; + int slope2 = num22 == -1 ? 0 : (int) tile13.slope(); + bool flag8 = true; + if (Main.tile[tileTargetX + num21 * 2, tileTargetY + num22].active() && TileID.Sets.Platforms[(int) Main.tile[tileTargetX + num21 * 2, tileTargetY].type] && slope2 == (int) Main.tile[tileTargetX + num21 * 2, tileTargetY + num22].slope()) + flag8 = false; + if (Main.tile[tileTargetX, tileTargetY - num22].active() && TileID.Sets.Platforms[(int) Main.tile[tileTargetX, tileTargetY - num22].type] && (int) tile13.slope() == (int) Main.tile[tileTargetX, tileTargetY - num22].slope()) + flag8 = false; + if (flag8) + { + WorldGen.SlopeTile(tileTargetX + num21, tileTargetY, slope2); + int num23 = (int) tile13.slope(); + if (Main.netMode == 1) + NetMessage.SendData(17, number: 14, number2: ((float) (tileTargetX + num21)), number3: ((float) tileTargetY), number4: ((float) num23)); + } + } + int num24 = 1; + int num25 = 0; + Tile tile14 = Main.tile[tileTargetX + num24, tileTargetY + num25]; + if (tile14.active() && TileID.Sets.Platforms[(int) tile14.type] && tile14.slope() != (byte) 0) + { + int num26 = (tile14.slope() == (byte) 1).ToDirectionInt() * num24; + int slope3 = num26 == -1 ? 0 : (int) tile14.slope(); + bool flag9 = true; + if (Main.tile[tileTargetX + num24 * 2, tileTargetY + num26].active() && TileID.Sets.Platforms[(int) Main.tile[tileTargetX + num24 * 2, tileTargetY].type] && slope3 == (int) Main.tile[tileTargetX + num24 * 2, tileTargetY + num26].slope()) + flag9 = false; + if (Main.tile[tileTargetX, tileTargetY - num26].active() && TileID.Sets.Platforms[(int) Main.tile[tileTargetX, tileTargetY - num26].type] && (int) tile14.slope() == (int) Main.tile[tileTargetX, tileTargetY - num26].slope()) + flag9 = false; + if (flag9) + { + WorldGen.SlopeTile(tileTargetX + num24, tileTargetY, slope3); + int num27 = (int) tile14.slope(); + if (Main.netMode == 1) + NetMessage.SendData(17, number: 14, number2: ((float) (tileTargetX + num24)), number3: ((float) tileTargetY), number4: ((float) num27)); + } + } + if (num12 == num13 && WorldGen.PlatformProperSides(tileTargetX, tileTargetY) == 0) + { + Tile tile15 = Main.tile[tileTargetX, tileTargetY + 1]; + if (tile15.active() && !tile15.halfBrick() && tile15.slope() == (byte) 0 && Main.tileSolid[(int) tile15.type]) + { + int slope4 = this.direction == 1 ? 2 : 1; + WorldGen.SlopeTile(tileTargetX, tileTargetY, slope4); + int num28 = (int) Main.tile[tileTargetX, tileTargetY].slope(); + if (Main.netMode == 1) + NetMessage.SendData(17, number: 14, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY), number4: ((float) num28)); + } + } + } + } + } + if (Main.tileSolid[this.inventory[this.selectedItem].createTile] && (this.inventory[this.selectedItem].createTile < 0 || !TileID.Sets.Platforms[this.inventory[this.selectedItem].createTile])) + { + int tileTargetX1 = Player.tileTargetX; + int j1 = Player.tileTargetY + 1; + if (Main.tile[tileTargetX1, j1] != null && !TileID.Sets.Platforms[(int) Main.tile[tileTargetX1, j1].type] && (Main.tile[tileTargetX1, j1].topSlope() || Main.tile[tileTargetX1, j1].halfBrick())) + { + WorldGen.SlopeTile(tileTargetX1, j1); + if (Main.netMode == 1) + NetMessage.SendData(17, number: 14, number2: ((float) tileTargetX1), number3: ((float) j1)); + } + int tileTargetX2 = Player.tileTargetX; + int j2 = Player.tileTargetY - 1; + if (Main.tile[tileTargetX2, j2] != null && !TileID.Sets.Platforms[(int) Main.tile[tileTargetX2, j2].type] && Main.tile[tileTargetX2, j2].bottomSlope()) + { + WorldGen.SlopeTile(tileTargetX2, j2); + if (Main.netMode == 1) + NetMessage.SendData(17, number: 14, number2: ((float) tileTargetX2), number3: ((float) j2)); + } + } + if (Main.tileSolid[this.inventory[this.selectedItem].createTile]) + { + for (int i1 = Player.tileTargetX - 1; i1 <= Player.tileTargetX + 1; ++i1) + { + for (int j3 = Player.tileTargetY - 1; j3 <= Player.tileTargetY + 1; ++j3) + { + if (Main.tile[i1, j3].active() && this.inventory[this.selectedItem].createTile != (int) Main.tile[i1, j3].type && (Main.tile[i1, j3].type == (ushort) 2 || Main.tile[i1, j3].type == (ushort) 23 || Main.tile[i1, j3].type == (ushort) 60 || Main.tile[i1, j3].type == (ushort) 70 || Main.tile[i1, j3].type == (ushort) 109 || Main.tile[i1, j3].type == (ushort) 199)) + { + bool flag10 = true; + for (int i2 = i1 - 1; i2 <= i1 + 1; ++i2) + { + for (int j4 = j3 - 1; j4 <= j3 + 1; ++j4) + { + if (!WorldGen.SolidTile(i2, j4)) + flag10 = false; + } + } + if (flag10) + { + WorldGen.KillTile(i1, j3, true); + if (Main.netMode == 1) + NetMessage.SendData(17, number2: ((float) i1), number3: ((float) j3), number4: 1f); + } + } + } + } + } + if (this.autoPaint || this.autoActuator) + { + int num29 = 0; + int num30 = 0; + int num31 = 11; + int num32 = 11; + if (!Main.tileFrameImportant[(int) Main.tile[Player.tileTargetX, Player.tileTargetY].type]) + { + num29 = num30 = 5; + num31 = num32 = 6; + } + for (int index16 = num29; index16 < num31; ++index16) + { + for (int index17 = num30; index17 < num32; ++index17) + { + int index18 = Player.tileTargetX - 5 + index16; + int index19 = Player.tileTargetY - 5 + index17; + if ((Main.tile[index18, index19].active() || numArray[index16, index17] != -1) && (!Main.tile[index18, index19].active() || numArray[index16, index17] != (int) Main.tile[index18, index19].type && (int) Main.tile[index18, index19].type == this.inventory[this.selectedItem].createTile)) + { + if (this.autoPaint && this.builderAccStatus[3] == 0) + { + int num33 = -1; + int num34 = -1; + for (int index20 = 0; index20 < 58; ++index20) + { + if (this.inventory[index20].stack > 0 && this.inventory[index20].paint > (byte) 0) + { + num33 = (int) this.inventory[index20].paint; + num34 = index20; + break; + } + } + if (num33 > 0 && (int) Main.tile[index18, index19].color() != num33 && WorldGen.paintTile(index18, index19, (byte) num33, true)) + { + int index21 = num34; + --this.inventory[index21].stack; + if (this.inventory[index21].stack <= 0) + this.inventory[index21].SetDefaults(); + this.itemTime = (int) ((double) this.inventory[this.selectedItem].useTime * (double) this.tileSpeed); + } + } + if (this.autoActuator && this.builderAccStatus[2] == 0) + { + bool flag11 = Main.tileSolid[(int) Main.tile[index18, index19].type] && !TileID.Sets.NotReallySolid[(int) Main.tile[index18, index19].type]; + switch (Main.tile[index18, index19].type) + { + case 314: + case 386: + case 387: + case 388: + case 389: + flag11 = false; + break; + } + if (flag11) + { + int index22 = this.FindItem(849); + if (index22 > -1 && WorldGen.PlaceActuator(index18, index19)) + { + NetMessage.SendData(17, number: 8, number2: ((float) index18), number3: ((float) index19)); + --this.inventory[index22].stack; + if (this.inventory[index22].stack <= 0) + this.inventory[index22].SetDefaults(); + this.itemTime = (int) ((double) this.inventory[this.selectedItem].useTime * (double) this.tileSpeed); + } + } + } + } + } + } + } + if (PlayerInput.UsingGamepad && ItemID.Sets.SingleUseInGamepad[this.inventory[this.selectedItem].type] && Main.myPlayer == this.whoAmI && !Main.SmartCursorEnabled) + Main.blockMouse = true; + } } } - int[,] autoAccessoryCache = this.PlaceThing_Tiles_GetAutoAccessoryCache(); - if (WorldGen.ReplaceTile(Player.tileTargetX, Player.tileTargetY, (ushort) this.HeldItem.createTile, this.HeldItem.placeStyle)) - { - canUse = false; - NetMessage.SendData(17, number: 21, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY), number4: ((float) this.HeldItem.createTile), number5: this.HeldItem.placeStyle); - this.ApplyItemTime(this.HeldItem); - this.SetItemAnimation(this.HeldItem.useAnimation); - this.PlaceThing_Tiles_PlaceIt_AutoPaintAndActuate(autoAccessoryCache); - } } - return canUse; - } - - private bool PlaceThing_ValidTileForReplacement() - { - int createTile = this.HeldItem.createTile; - Tile tileCache = Main.tile[Player.tileTargetX, Player.tileTargetY]; - if (WorldGen.WouldTileReplacementBeBlockedByLiquid(Player.tileTargetX, Player.tileTargetY, 1) || ItemID.Sets.SortingPriorityRopes[this.HeldItem.type] != -1 || Main.tileMoss[createTile] || TileID.Sets.DoesntPlaceWithTileReplacement[createTile] || TileID.Sets.DoesntGetReplacedWithTileReplacement[(int) tileCache.type] || !this.PlaceThing_CheckSpecificValidtyCaseForBlockSwap(createTile, (int) tileCache.type) || Main.tileCut[(int) tileCache.type]) - return false; - if (TileID.Sets.Platforms[(int) tileCache.type] && (int) tileCache.type == createTile) - return (int) tileCache.frameY != this.HeldItem.placeStyle * 18; - if (TileID.Sets.BasicChest[(int) tileCache.type] && TileID.Sets.BasicChest[createTile]) - return (int) tileCache.frameX / 36 != this.HeldItem.placeStyle || (int) tileCache.type != createTile; - if (TileID.Sets.BasicDresser[(int) tileCache.type] && TileID.Sets.BasicDresser[createTile]) - return (int) tileCache.frameX / 54 != this.HeldItem.placeStyle || (int) tileCache.type != createTile; - if (Main.tileFrameImportant[createTile] && !TileID.Sets.Platforms[createTile] || (int) Main.tile[Player.tileTargetX, Player.tileTargetY].type == createTile) - return false; - if (!TileID.Sets.IgnoresTileReplacementDropCheckWhenBeingPlaced[createTile]) + if (this.inventory[this.selectedItem].createWall < 0 || (double) this.position.X / 16.0 - (double) Player.tileRangeX - (double) this.inventory[this.selectedItem].tileBoost > (double) Player.tileTargetX || ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX + (double) this.inventory[this.selectedItem].tileBoost - 1.0 < (double) Player.tileTargetX || (double) this.position.Y / 16.0 - (double) Player.tileRangeY - (double) this.inventory[this.selectedItem].tileBoost > (double) Player.tileTargetY || ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY + (double) this.inventory[this.selectedItem].tileBoost - 2.0 < (double) Player.tileTargetY) + return; + this.showItemIcon = true; + if (this.itemTime != 0 || this.itemAnimation <= 0 || !this.controlUseItem || !Main.tile[Player.tileTargetX + 1, Player.tileTargetY].active() && Main.tile[Player.tileTargetX + 1, Player.tileTargetY].wall <= (byte) 0 && !Main.tile[Player.tileTargetX - 1, Player.tileTargetY].active() && Main.tile[Player.tileTargetX - 1, Player.tileTargetY].wall <= (byte) 0 && !Main.tile[Player.tileTargetX, Player.tileTargetY + 1].active() && Main.tile[Player.tileTargetX, Player.tileTargetY + 1].wall <= (byte) 0 && !Main.tile[Player.tileTargetX, Player.tileTargetY - 1].active() && Main.tile[Player.tileTargetX, Player.tileTargetY - 1].wall <= (byte) 0 || (int) Main.tile[Player.tileTargetX, Player.tileTargetY].wall == this.inventory[this.selectedItem].createWall) + return; + if (Player.SmartCursorSettings.SmartWallReplacement && Main.tile[Player.tileTargetX, Player.tileTargetY].wall != (byte) 0 && WorldGen.NearFriendlyWall(Player.tileTargetX, Player.tileTargetY)) { - int dropItem; - WorldGen.KillTile_GetItemDrops(Player.tileTargetX, Player.tileTargetY, tileCache, out dropItem, out int _, out int _, out int _); - if (dropItem == this.HeldItem.type) - return false; - } - return WorldGen.WouldTileReplacementWork((ushort) createTile, Player.tileTargetX, Player.tileTargetY); - } - - private bool PlaceThing_CheckSpecificValidtyCaseForBlockSwap( - int tileTypeBeingPlaced, - int tileTypeCurrentlyPlaced) - { - return !((TileID.Sets.Falling[tileTypeBeingPlaced] ? 1 : 0) == 0 & TileID.Sets.Falling[tileTypeCurrentlyPlaced]); - } - - private Item GetBestPickaxe() - { - Item obj = (Item) null; - for (int index = 0; index < 50; ++index) - { - if (this.inventory[index].stack > 0 && this.inventory[index].pick > 0 && (obj == null || this.inventory[index].pick > obj.pick)) - obj = this.inventory[index]; - } - return obj; - } - - private TileObject PlaceThing_Tiles_PlaceIt(bool newObjectType, TileObject data) - { - int num = this.inventory[this.selectedItem].placeStyle; - if (!newObjectType) - num = this.PlaceThing_Tiles_PlaceIt_GetLegacyTileStyle(num); - int[,] autoAccessoryCache = this.PlaceThing_Tiles_GetAutoAccessoryCache(); - bool forced = false; - bool flag; - if (newObjectType) - { - flag = TileObject.Place(data); - WorldGen.SquareTileFrame(Player.tileTargetX, Player.tileTargetY); - if (Main.netMode != 1 || !TileID.Sets.IsAContainer[this.inventory[this.selectedItem].createTile]) - SoundEngine.PlaySound(0, Player.tileTargetX * 16, Player.tileTargetY * 16); + WorldGen.KillWall(Player.tileTargetX, Player.tileTargetY); + if (Main.tile[Player.tileTargetX, Player.tileTargetY].wall == (byte) 0 && Main.netMode == 1) + NetMessage.SendData(17, number: 2, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); + if (this.inventory[this.selectedItem].consumable) + ++this.inventory[this.selectedItem].stack; + this.itemTime = (int) ((double) this.inventory[this.selectedItem].useTime * (double) this.wallSpeed); } else { - if (this.UsingBiomeTorches && this.inventory[this.selectedItem].createTile == 4 && num == 0) - num = this.BiomeTorchPlaceStyle(num); - flag = WorldGen.PlaceTile(Player.tileTargetX, Player.tileTargetY, this.inventory[this.selectedItem].createTile, forced: forced, plr: this.whoAmI, style: num); - } - if (flag) - { - this.ApplyItemTime(this.inventory[this.selectedItem], this.tileSpeed); - if (newObjectType) - { - TileObjectData.CallPostPlacementPlayerHook(Player.tileTargetX, Player.tileTargetY, this.inventory[this.selectedItem].createTile, num, this.direction, data.alternate, data); - if (Main.netMode == 1 && !Main.tileContainer[this.inventory[this.selectedItem].createTile] && this.inventory[this.selectedItem].createTile != 423) - NetMessage.SendObjectPlacment(-1, Player.tileTargetX, Player.tileTargetY, data.type, data.style, data.alternate, data.random, this.direction); - } - else - { - NetMessage.SendData(17, number: 1, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY), number4: ((float) this.inventory[this.selectedItem].createTile), number5: num); - this.PlaceThing_Tiles_PlaceIt_SpinChairs(); - this.PlaceThing_Tiles_PlaceIt_SpinBedsAndBaths(); - } - this.PlaceThing_Tiles_PlaceIt_AdjustPlants(); - this.PlaceThing_Tiles_PlaceIt_SpinTraps(); - this.PlaceThing_Tiles_PlaceIt_TriggerLogicLamp(); - this.PlaceThing_Tiles_PlaceIt_SpinSmartPlatform(); - this.PlaceThing_Tiles_PlaceIt_UnslopeForSolids(); - this.PlaceThing_Tiles_PlaceIt_KillGrassForSolids(); - this.PlaceThing_Tiles_PlaceIt_AutoPaintAndActuate(autoAccessoryCache); - if (PlayerInput.UsingGamepad && ItemID.Sets.SingleUseInGamepad[this.inventory[this.selectedItem].type] && Main.myPlayer == this.whoAmI && !Main.SmartCursorEnabled) - Main.blockMouse = true; - } - return data; - } - - public int BiomeTorchPlaceStyle(int style) - { - if (!this.UsingBiomeTorches || style != 0) - return style; - if (this.ZoneDungeon) - style = 13; - else if ((double) this.position.Y > (double) (Main.UnderworldLayer * 16)) - style = 7; - else if (this.ZoneHallow) - style = 20; - else if (this.ZoneCorrupt) - style = 18; - else if (this.ZoneCrimson) - style = 19; - else if (this.ZoneSnow) - style = 9; - else if (this.ZoneJungle) - style = 21; - else if (this.ZoneDesert && (double) this.position.Y < Main.worldSurface * 16.0 || this.ZoneUndergroundDesert) - style = 16; - return style; - } - - public int BiomeTorchHoldStyle(int style) - { - if (!this.UsingBiomeTorches || style != 8) - return style; - if (this.ZoneDungeon) - style = 3004; - else if ((double) this.position.Y > (double) (Main.UnderworldLayer * 16)) - style = 433; - else if (this.ZoneHallow) - style = 4387; - else if (this.ZoneCorrupt) - style = 4385; - else if (this.ZoneCrimson) - style = 4386; - else if (this.ZoneSnow) - style = 974; - else if (this.ZoneJungle) - style = 4388; - else if (this.ZoneDesert && (double) this.position.Y < Main.worldSurface * 16.0 || this.ZoneUndergroundDesert) - style = 4383; - return style; - } - - private int[,] PlaceThing_Tiles_GetAutoAccessoryCache() - { - int[,] numArray = (int[,]) null; - if (this.autoPaint || this.autoActuator) - { - numArray = new int[11, 11]; - for (int index1 = 0; index1 < 11; ++index1) - { - for (int index2 = 0; index2 < 11; ++index2) - { - int index3 = Player.tileTargetX - 5 + index1; - int index4 = Player.tileTargetY - 5 + index2; - numArray[index1, index2] = !Main.tile[index3, index4].active() ? -1 : (int) Main.tile[index3, index4].type; - } - } - } - return numArray; - } - - private int PlaceThing_Tiles_PlaceIt_GetLegacyTileStyle(int style) - { - int createTile = this.inventory[this.selectedItem].createTile; - if (createTile == 36) - style = Main.rand.Next(7); - if (createTile == 212 && this.direction > 0) - style = 1; - if (createTile == 141) - style = Main.rand.Next(2); - if (createTile == 128 || createTile == 269 || createTile == 334) - style = this.direction >= 0 ? 1 : -1; - if (createTile == 241 && this.inventory[this.selectedItem].placeStyle == 0) - style = Main.rand.Next(0, 9); - if (createTile == 35 && this.inventory[this.selectedItem].placeStyle == 0) - style = Main.rand.Next(9); - if (createTile == 314 && style == 2 && this.direction == 1) - ++style; - return style; - } - - private void PlaceThing_Tiles_PlaceIt_UnslopeForSolids() - { - if (!Main.tileSolid[this.inventory[this.selectedItem].createTile] || this.inventory[this.selectedItem].createTile >= 0 && TileID.Sets.Platforms[this.inventory[this.selectedItem].createTile]) - return; - int tileTargetX1 = Player.tileTargetX; - int j1 = Player.tileTargetY + 1; - if (Main.tile[tileTargetX1, j1] != null && !TileID.Sets.Platforms[(int) Main.tile[tileTargetX1, j1].type] && (Main.tile[tileTargetX1, j1].topSlope() || Main.tile[tileTargetX1, j1].halfBrick())) - { - WorldGen.SlopeTile(tileTargetX1, j1); + WorldGen.PlaceWall(Player.tileTargetX, Player.tileTargetY, this.inventory[this.selectedItem].createWall); + if ((int) Main.tile[Player.tileTargetX, Player.tileTargetY].wall != this.inventory[this.selectedItem].createWall) + return; + this.itemTime = (int) ((double) this.inventory[this.selectedItem].useTime * (double) this.wallSpeed); if (Main.netMode == 1) - NetMessage.SendData(17, number: 14, number2: ((float) tileTargetX1), number3: ((float) j1)); - } - int tileTargetX2 = Player.tileTargetX; - int j2 = Player.tileTargetY - 1; - if (Main.tile[tileTargetX2, j2] == null || TileID.Sets.Platforms[(int) Main.tile[tileTargetX2, j2].type] || !Main.tile[tileTargetX2, j2].bottomSlope()) - return; - WorldGen.SlopeTile(tileTargetX2, j2); - if (Main.netMode != 1) - return; - NetMessage.SendData(17, number: 14, number2: ((float) tileTargetX2), number3: ((float) j2)); - } - - private void PlaceThing_Tiles_PlaceIt_KillGrassForSolids() - { - if (!Main.tileSolid[this.inventory[this.selectedItem].createTile]) - return; - for (int i1 = Player.tileTargetX - 1; i1 <= Player.tileTargetX + 1; ++i1) - { - for (int j1 = Player.tileTargetY - 1; j1 <= Player.tileTargetY + 1; ++j1) + NetMessage.SendData(17, number: 3, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY), number4: ((float) this.inventory[this.selectedItem].createWall)); + if (this.inventory[this.selectedItem].stack > 1) { - if (Main.tile[i1, j1].active() && this.inventory[this.selectedItem].createTile != (int) Main.tile[i1, j1].type && (Main.tile[i1, j1].type == (ushort) 2 || Main.tile[i1, j1].type == (ushort) 23 || Main.tile[i1, j1].type == (ushort) 60 || Main.tile[i1, j1].type == (ushort) 70 || Main.tile[i1, j1].type == (ushort) 109 || Main.tile[i1, j1].type == (ushort) 199 || Main.tile[i1, j1].type == (ushort) 477 || Main.tile[i1, j1].type == (ushort) 492)) + int createWall = this.inventory[this.selectedItem].createWall; + for (int index23 = 0; index23 < 4; ++index23) { - bool flag = true; - for (int i2 = i1 - 1; i2 <= i1 + 1; ++i2) + int tileTargetX = Player.tileTargetX; + int tileTargetY = Player.tileTargetY; + if (index23 == 0) + --tileTargetX; + if (index23 == 1) + ++tileTargetX; + if (index23 == 2) + --tileTargetY; + if (index23 == 3) + ++tileTargetY; + if (Main.tile[tileTargetX, tileTargetY].wall == (byte) 0) { - for (int j2 = j1 - 1; j2 <= j1 + 1; ++j2) + int num35 = 0; + for (int index24 = 0; index24 < 4; ++index24) { - if (!WorldGen.SolidTile(i2, j2)) - flag = false; + int index25 = tileTargetX; + int index26 = tileTargetY; + if (index24 == 0) + --index25; + if (index24 == 1) + ++index25; + if (index24 == 2) + --index26; + if (index24 == 3) + ++index26; + if ((int) Main.tile[index25, index26].wall == createWall) + ++num35; } - } - if (flag) - { - WorldGen.KillTile(i1, j1, true); - if (Main.netMode == 1) - NetMessage.SendData(17, number2: ((float) i1), number3: ((float) j1), number4: 1f); - } - } - } - } - } - - private void PlaceThing_Tiles_PlaceIt_AutoPaintAndActuate(int[,] typeCaches) - { - if (!this.autoPaint && !this.autoActuator) - return; - int num1 = 0; - int num2 = 0; - int num3 = 11; - int num4 = 11; - bool platform = TileID.Sets.Platforms[(int) Main.tile[Player.tileTargetX, Player.tileTargetY].type]; - bool flag1 = TileID.Sets.Platforms[(int) Main.tile[Player.tileTargetX, Player.tileTargetY].type] && TileID.Sets.Platforms[this.inventory[this.selectedItem].createTile]; - if (!Main.tileFrameImportant[(int) Main.tile[Player.tileTargetX, Player.tileTargetY].type] | platform) - { - num1 = num2 = 5; - num3 = num4 = 6; - } - for (int index1 = num1; index1 < num3; ++index1) - { - for (int index2 = num2; index2 < num4; ++index2) - { - int index3 = Player.tileTargetX - 5 + index1; - int index4 = Player.tileTargetY - 5 + index2; - if ((Main.tile[index3, index4].active() || typeCaches[index1, index2] != -1) && (!Main.tile[index3, index4].active() || flag1 || typeCaches[index1, index2] != (int) Main.tile[index3, index4].type && (int) Main.tile[index3, index4].type == this.inventory[this.selectedItem].createTile)) - { - if (this.autoPaint && this.builderAccStatus[3] == 0) - this.TryPainting(index3, index4, applyItemAnimation: false); - if (this.autoActuator && this.builderAccStatus[2] == 0) - { - bool flag2 = Main.tileSolid[(int) Main.tile[index3, index4].type] && !TileID.Sets.NotReallySolid[(int) Main.tile[index3, index4].type]; - switch (Main.tile[index3, index4].type) + if (num35 == 4) { - case 314: - case 386: - case 387: - case 388: - case 389: - flag2 = false; - break; - } - if (flag2) - { - int index5 = this.FindItem(849); - if (index5 > -1 && WorldGen.PlaceActuator(index3, index4)) + WorldGen.PlaceWall(tileTargetX, tileTargetY, createWall); + if ((int) Main.tile[tileTargetX, tileTargetY].wall == createWall) { - NetMessage.SendData(17, number: 8, number2: ((float) index3), number3: ((float) index4)); - --this.inventory[index5].stack; - if (this.inventory[index5].stack <= 0) - this.inventory[index5].SetDefaults(); + --this.inventory[this.selectedItem].stack; + if (this.inventory[this.selectedItem].stack == 0) + this.inventory[this.selectedItem].SetDefaults(); + if (Main.netMode == 1) + NetMessage.SendData(17, number: 3, number2: ((float) tileTargetX), number3: ((float) tileTargetY), number4: ((float) createWall)); + if (this.autoPaint && this.builderAccStatus[3] == 0) + { + int x = tileTargetX; + int y = tileTargetY; + int num36 = -1; + int num37 = -1; + for (int index27 = 0; index27 < 58; ++index27) + { + if (this.inventory[index27].stack > 0 && this.inventory[index27].paint > (byte) 0) + { + num36 = (int) this.inventory[index27].paint; + num37 = index27; + break; + } + } + if (num36 > 0 && (int) Main.tile[x, y].wallColor() != num36 && WorldGen.paintWall(x, y, (byte) num36, true)) + { + int index28 = num37; + --this.inventory[index28].stack; + if (this.inventory[index28].stack <= 0) + this.inventory[index28].SetDefaults(); + this.itemTime = (int) ((double) this.inventory[this.selectedItem].useTime * (double) this.wallSpeed); + } + } } } } } } - } - } - - private void PlaceThing_Tiles_PlaceIt_SpinSmartPlatform() - { - if (this.inventory[this.selectedItem].createTile < 0 || !TileID.Sets.Platforms[this.inventory[this.selectedItem].createTile] || !Main.SmartCursorEnabled) - return; - int tileTargetX = Player.tileTargetX; - int tileTargetY = Player.tileTargetY; - int slope1 = -1; - int num1 = 0; - int num2 = 0; - bool flag1 = true; - for (int index1 = -1; index1 < 2; ++index1) - { - for (int index2 = -1; index2 < 2; ++index2) - { - if ((index1 != 0 || index2 != 0) && TileID.Sets.Platforms[(int) Main.tile[tileTargetX + index1, tileTargetY + index2].type]) - flag1 = false; - } - } - if (flag1) - return; - Tile tile1 = Main.tile[tileTargetX - 1, tileTargetY - 1]; - if (tile1.active() && TileID.Sets.Platforms[(int) tile1.type] && tile1.slope() != (byte) 2) - ++num1; - Tile tile2 = Main.tile[tileTargetX - 1, tileTargetY + 1]; - if (tile2.active() && TileID.Sets.Platforms[(int) tile2.type] && tile2.slope() != (byte) 1) - ++num2; - Tile tile3 = Main.tile[tileTargetX + 1, tileTargetY - 1]; - if (tile3.active() && TileID.Sets.Platforms[(int) tile3.type] && tile3.slope() != (byte) 1) - ++num2; - Tile tile4 = Main.tile[tileTargetX + 1, tileTargetY + 1]; - if (tile4.active() && TileID.Sets.Platforms[(int) tile4.type] && tile4.slope() != (byte) 2) - ++num1; - Tile testTile1 = Main.tile[tileTargetX - 1, tileTargetY]; - if (WorldGen.SolidTile(testTile1)) - { - ++num1; - if (TileID.Sets.Platforms[(int) testTile1.type] && testTile1.slope() == (byte) 0) - ++num1; - } - Tile testTile2 = Main.tile[tileTargetX + 1, tileTargetY]; - if (WorldGen.SolidTile(testTile2)) - { - ++num2; - if (TileID.Sets.Platforms[(int) testTile2.type] && testTile2.slope() == (byte) 0) - ++num2; - } - if (num1 > num2) - slope1 = 1; - else if (num2 > num1) - slope1 = 2; - Tile tile5 = Main.tile[tileTargetX - 1, tileTargetY]; - if (tile5.active() && TileID.Sets.Platforms[(int) tile5.type]) - slope1 = 0; - Tile tile6 = Main.tile[tileTargetX + 1, tileTargetY]; - if (tile6.active() && TileID.Sets.Platforms[(int) tile6.type]) - slope1 = 0; - if (slope1 != -1) - { - WorldGen.SlopeTile(tileTargetX, tileTargetY, slope1, true); - int num3 = (int) Main.tile[tileTargetX, tileTargetY].slope(); - if (Main.netMode == 1) - NetMessage.SendData(17, number: 14, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY), number4: ((float) num3)); - int num4; - int num5; - if (slope1 == 1) - { - num4 = -1; - num5 = -1; - } - else - { - num4 = 1; - num5 = -1; - } - Tile tile7 = Main.tile[tileTargetX + num4, tileTargetY + num5]; - if (tile7.active() && TileID.Sets.Platforms[(int) tile7.type] && tile7.slope() == (byte) 0 && (!Main.tile[tileTargetX + num4 + num4, tileTargetY + num5].active() || !TileID.Sets.Platforms[(int) Main.tile[tileTargetX + num4 + num4, tileTargetY + num5].type] || !Main.tile[tileTargetX + num4 + num4, tileTargetY + num5].halfBrick())) - { - WorldGen.SlopeTile(tileTargetX + num4, tileTargetY + num5, slope1); - int num6 = (int) tile7.slope(); - if (Main.netMode == 1) - NetMessage.SendData(17, number: 14, number2: ((float) (tileTargetX + num4)), number3: ((float) (tileTargetY + num5)), number4: ((float) num6)); - } - int num7; - int num8; - if (slope1 == 1) - { - num7 = 1; - num8 = 1; - } - else - { - num7 = -1; - num8 = 1; - } - Tile tile8 = Main.tile[tileTargetX + num7, tileTargetY + num8]; - if (!tile8.active() || !TileID.Sets.Platforms[(int) tile8.type] || tile8.slope() != (byte) 0 || WorldGen.PlatformProperSides(tileTargetX + num7, tileTargetY + num8, true) > 0) + if (!this.autoPaint || this.builderAccStatus[3] != 0) return; - WorldGen.SlopeTile(tileTargetX + num7, tileTargetY + num8, slope1); - int num9 = (int) tile8.slope(); - if (Main.netMode != 1) - return; - NetMessage.SendData(17, number: 14, number2: ((float) (tileTargetX + num7)), number3: ((float) (tileTargetY + num8)), number4: ((float) num9)); - } - else - { - int num10 = -1; - Tile tile9 = Main.tile[tileTargetX + num10, tileTargetY]; - if (tile9.active() && TileID.Sets.Platforms[(int) tile9.type] && tile9.slope() != (byte) 0) - { - int num11 = (tile9.slope() == (byte) 1).ToDirectionInt() * num10; - int slope2 = num11 == -1 ? 0 : (int) tile9.slope(); - bool flag2 = true; - if (Main.tile[tileTargetX + num10 * 2, tileTargetY + num11].active() && TileID.Sets.Platforms[(int) Main.tile[tileTargetX + num10 * 2, tileTargetY].type] && slope2 == (int) Main.tile[tileTargetX + num10 * 2, tileTargetY + num11].slope()) - flag2 = false; - if (Main.tile[tileTargetX, tileTargetY - num11].active() && TileID.Sets.Platforms[(int) Main.tile[tileTargetX, tileTargetY - num11].type] && (int) tile9.slope() == (int) Main.tile[tileTargetX, tileTargetY - num11].slope()) - flag2 = false; - if (flag2) - { - WorldGen.SlopeTile(tileTargetX + num10, tileTargetY, slope2); - int num12 = (int) tile9.slope(); - if (Main.netMode == 1) - NetMessage.SendData(17, number: 14, number2: ((float) (tileTargetX + num10)), number3: ((float) tileTargetY), number4: ((float) num12)); - } - } - int num13 = 1; - int num14 = 0; - Tile tile10 = Main.tile[tileTargetX + num13, tileTargetY + num14]; - if (tile10.active() && TileID.Sets.Platforms[(int) tile10.type] && tile10.slope() != (byte) 0) - { - int num15 = (tile10.slope() == (byte) 1).ToDirectionInt() * num13; - int slope3 = num15 == -1 ? 0 : (int) tile10.slope(); - bool flag3 = true; - if (Main.tile[tileTargetX + num13 * 2, tileTargetY + num15].active() && TileID.Sets.Platforms[(int) Main.tile[tileTargetX + num13 * 2, tileTargetY].type] && slope3 == (int) Main.tile[tileTargetX + num13 * 2, tileTargetY + num15].slope()) - flag3 = false; - if (Main.tile[tileTargetX, tileTargetY - num15].active() && TileID.Sets.Platforms[(int) Main.tile[tileTargetX, tileTargetY - num15].type] && (int) tile10.slope() == (int) Main.tile[tileTargetX, tileTargetY - num15].slope()) - flag3 = false; - if (flag3) - { - WorldGen.SlopeTile(tileTargetX + num13, tileTargetY, slope3); - int num16 = (int) tile10.slope(); - if (Main.netMode == 1) - NetMessage.SendData(17, number: 14, number2: ((float) (tileTargetX + num13)), number3: ((float) tileTargetY), number4: ((float) num16)); - } - } - if (num1 != num2 || WorldGen.PlatformProperSides(tileTargetX, tileTargetY) != 0) - return; - Tile tile11 = Main.tile[tileTargetX, tileTargetY + 1]; - if (!tile11.active() || tile11.halfBrick() || tile11.slope() != (byte) 0 || !Main.tileSolid[(int) tile11.type]) - return; - int slope4 = this.direction == 1 ? 2 : 1; - WorldGen.SlopeTile(tileTargetX, tileTargetY, slope4); - int num17 = (int) Main.tile[tileTargetX, tileTargetY].slope(); - if (Main.netMode != 1) - return; - NetMessage.SendData(17, number: 14, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY), number4: ((float) num17)); - } - } - - private void PlaceThing_Tiles_PlaceIt_TriggerLogicLamp() - { - if (this.inventory[this.selectedItem].createTile != 419) - return; - if (Main.netMode == 1) - NetMessage.SendData(17, number: 18, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); - else - Wiring.PokeLogicGate(Player.tileTargetX, Player.tileTargetY); - } - - private void PlaceThing_Tiles_PlaceIt_SpinBedsAndBaths() - { - if (this.inventory[this.selectedItem].createTile != 79 && this.inventory[this.selectedItem].createTile != 90 || Main.netMode != 1) - return; - NetMessage.SendTileSquare(-1, Player.tileTargetX, Player.tileTargetY, 5); - } - - private void PlaceThing_Tiles_PlaceIt_SpinChairs() - { - if (this.inventory[this.selectedItem].createTile != 15) - return; - if (this.direction == 1) - { - Main.tile[Player.tileTargetX, Player.tileTargetY].frameX += (short) 18; - Main.tile[Player.tileTargetX, Player.tileTargetY - 1].frameX += (short) 18; - } - if (Main.netMode != 1) - return; - NetMessage.SendTileSquare(-1, Player.tileTargetX - 1, Player.tileTargetY - 1, 3); - } - - private void PlaceThing_Tiles_PlaceIt_SpinTraps() - { - if (this.inventory[this.selectedItem].createTile != 137) - return; - if (this.direction == 1) - Main.tile[Player.tileTargetX, Player.tileTargetY].frameX += (short) 18; - if (Main.netMode != 1) - return; - NetMessage.SendTileSquare(-1, Player.tileTargetX, Player.tileTargetY, 1); - } - - private void PlaceThing_Tiles_PlaceIt_AdjustPlants() - { - if (this.inventory[this.selectedItem].createTile != 3) - return; - FlowerPacketInfo flowerPacketInfo = ItemID.Sets.flowerPacketInfo[this.inventory[this.selectedItem].type]; - if (flowerPacketInfo == null) - return; - List stylesOnPurity = flowerPacketInfo.stylesOnPurity; - if (stylesOnPurity.Count == 0) - return; - int num = stylesOnPurity[Main.rand.Next(stylesOnPurity.Count)]; - Main.tile[Player.tileTargetX, Player.tileTargetY].frameX = (short) (num * 18); - if (Main.netMode != 1) - return; - NetMessage.SendTileSquare(-1, Player.tileTargetX, Player.tileTargetY, 1); - } - - private bool PlaceThing_Tiles_PlaceIt_StaffOfRegrowthCheck(bool placed) - { - if (this.inventory[this.selectedItem].type == 213 && !placed && Main.tile[Player.tileTargetX, Player.tileTargetY].type == (ushort) 1 && Main.tile[Player.tileTargetX, Player.tileTargetY].active()) - { - int num1 = 0; - int num2 = 0; - Point tileCoordinates = this.Center.ToTileCoordinates(); - Dictionary resultsOutput = new Dictionary(); - WorldUtils.Gen(new Point(tileCoordinates.X - 25, tileCoordinates.Y - 25), (GenShape) new Shapes.Rectangle(50, 50), (GenAction) new Actions.TileScanner(new ushort[18] - { - (ushort) 182, - (ushort) 515, - (ushort) 180, - (ushort) 513, - (ushort) 179, - (ushort) 512, - (ushort) 183, - (ushort) 516, - (ushort) 181, - (ushort) 514, - (ushort) 381, - (ushort) 517, - (ushort) 534, - (ushort) 535, - (ushort) 536, - (ushort) 537, - (ushort) 539, - (ushort) 540 - }).Output(resultsOutput)); - foreach (KeyValuePair keyValuePair in resultsOutput) - { - if (keyValuePair.Value > num2) - { - num2 = keyValuePair.Value; - num1 = (int) keyValuePair.Key; - } - } - switch (num1) - { - case 512: - num1 = 179; - break; - case 513: - num1 = 180; - break; - case 514: - num1 = 181; - break; - case 515: - num1 = 182; - break; - case 516: - num1 = 183; - break; - case 517: - num1 = 381; - break; - case 535: - num1 = 534; - break; - case 537: - num1 = 536; - break; - case 540: - num1 = 539; - break; - } - if (num2 == 0) - num1 = Utils.SelectRandom(Main.rand, 182, 180, 179, 183, 181); - if (num1 != 0) - { - Main.tile[Player.tileTargetX, Player.tileTargetY].type = (ushort) num1; - WorldGen.SquareTileFrame(Player.tileTargetX, Player.tileTargetY); - NetMessage.SendTileSquare(-1, Player.tileTargetX, Player.tileTargetY, 1); - placed = true; - } - } - if (this.inventory[this.selectedItem].type == 213 && !placed && Main.tile[Player.tileTargetX, Player.tileTargetY].type == (ushort) 38 && Main.tile[Player.tileTargetX, Player.tileTargetY].active()) - { - int num3 = 0; - int num4 = 0; - Point tileCoordinates = this.Center.ToTileCoordinates(); - Dictionary resultsOutput = new Dictionary(); - WorldUtils.Gen(new Point(tileCoordinates.X - 25, tileCoordinates.Y - 25), (GenShape) new Shapes.Rectangle(50, 50), (GenAction) new Actions.TileScanner(new ushort[18] - { - (ushort) 182, - (ushort) 515, - (ushort) 180, - (ushort) 513, - (ushort) 179, - (ushort) 512, - (ushort) 183, - (ushort) 516, - (ushort) 181, - (ushort) 514, - (ushort) 381, - (ushort) 517, - (ushort) 534, - (ushort) 535, - (ushort) 536, - (ushort) 537, - (ushort) 539, - (ushort) 540 - }).Output(resultsOutput)); - foreach (KeyValuePair keyValuePair in resultsOutput) - { - if (keyValuePair.Value > num4) - { - num4 = keyValuePair.Value; - num3 = (int) keyValuePair.Key; - } - } - switch (num3) - { - case 179: - num3 = 512; - break; - case 180: - num3 = 513; - break; - case 181: - num3 = 514; - break; - case 182: - num3 = 515; - break; - case 183: - num3 = 516; - break; - case 381: - num3 = 517; - break; - case 534: - num3 = 535; - break; - case 536: - num3 = 537; - break; - case 539: - num3 = 540; - break; - } - if (num4 == 0) - num3 = Utils.SelectRandom(Main.rand, 515, 513, 512, 516, 514); - if (num3 != 0) - { - Main.tile[Player.tileTargetX, Player.tileTargetY].type = (ushort) num3; - WorldGen.SquareTileFrame(Player.tileTargetX, Player.tileTargetY); - NetMessage.SendTileSquare(-1, Player.tileTargetX, Player.tileTargetY, 1); - placed = true; - } - } - return placed; - } - - private bool PlaceThing_Tiles_BlockPlacementForAssortedThings(bool canPlace) - { - if (this.inventory[this.selectedItem].type == 213) - { - if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == (ushort) 0 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == (ushort) 1 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == (ushort) 38) - canPlace = true; - } - else if (this.inventory[this.selectedItem].createTile == 23 || this.inventory[this.selectedItem].createTile == 2 || this.inventory[this.selectedItem].createTile == 109 || this.inventory[this.selectedItem].createTile == 199) - { - if (Main.tile[Player.tileTargetX, Player.tileTargetY].nactive() && Main.tile[Player.tileTargetX, Player.tileTargetY].type == (ushort) 0) - canPlace = true; - } - else if (this.inventory[this.selectedItem].createTile == 227) - canPlace = true; - else if (this.inventory[this.selectedItem].createTile >= 373 && this.inventory[this.selectedItem].createTile <= 375) - { - int tileTargetX = Player.tileTargetX; - int index = Player.tileTargetY - 1; - if (Main.tile[tileTargetX, index].nactive() && Main.tileSolid[(int) Main.tile[tileTargetX, index].type] && !Main.tileSolidTop[(int) Main.tile[tileTargetX, index].type]) - canPlace = true; - } - else if (this.inventory[this.selectedItem].createTile == 461) - { - int tileTargetX = Player.tileTargetX; - int index = Player.tileTargetY - 1; - if (Main.tile[tileTargetX, index].nactive() && Main.tileSolid[(int) Main.tile[tileTargetX, index].type] && !Main.tileSolidTop[(int) Main.tile[tileTargetX, index].type]) - canPlace = true; - } - else if (this.inventory[this.selectedItem].createTile == 60 || this.inventory[this.selectedItem].createTile == 70) - { - if (Main.tile[Player.tileTargetX, Player.tileTargetY].nactive() && Main.tile[Player.tileTargetX, Player.tileTargetY].type == (ushort) 59) - canPlace = true; - } - else if (this.inventory[this.selectedItem].createTile == 4 || this.inventory[this.selectedItem].createTile == 136) - { - if (Main.tile[Player.tileTargetX, Player.tileTargetY].wall > (ushort) 0) - { - canPlace = true; - } - else - { - if (!WorldGen.SolidTileNoAttach(Player.tileTargetX, Player.tileTargetY + 1) && !WorldGen.SolidTileNoAttach(Player.tileTargetX - 1, Player.tileTargetY) && !WorldGen.SolidTileNoAttach(Player.tileTargetX + 1, Player.tileTargetY)) - { - if (!WorldGen.SolidTileNoAttach(Player.tileTargetX, Player.tileTargetY + 1) && (Main.tile[Player.tileTargetX, Player.tileTargetY + 1].halfBrick() || Main.tile[Player.tileTargetX, Player.tileTargetY + 1].slope() != (byte) 0)) - { - if (!TileID.Sets.Platforms[(int) Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type]) - { - WorldGen.SlopeTile(Player.tileTargetX, Player.tileTargetY + 1); - if (Main.netMode == 1) - NetMessage.SendData(17, number: 14, number2: ((float) Player.tileTargetX), number3: ((float) (Player.tileTargetY + 1))); - } - } - else if (!WorldGen.SolidTileNoAttach(Player.tileTargetX, Player.tileTargetY + 1) && !WorldGen.SolidTileNoAttach(Player.tileTargetX - 1, Player.tileTargetY) && (Main.tile[Player.tileTargetX - 1, Player.tileTargetY].halfBrick() || Main.tile[Player.tileTargetX - 1, Player.tileTargetY].slope() != (byte) 0)) - { - if (!TileID.Sets.Platforms[(int) Main.tile[Player.tileTargetX - 1, Player.tileTargetY].type]) - { - WorldGen.SlopeTile(Player.tileTargetX - 1, Player.tileTargetY); - if (Main.netMode == 1) - NetMessage.SendData(17, number: 14, number2: ((float) (Player.tileTargetX - 1)), number3: ((float) Player.tileTargetY)); - } - } - else if (!WorldGen.SolidTileNoAttach(Player.tileTargetX, Player.tileTargetY + 1) && !WorldGen.SolidTileNoAttach(Player.tileTargetX + 1, Player.tileTargetY) && (Main.tile[Player.tileTargetX + 1, Player.tileTargetY].halfBrick() || Main.tile[Player.tileTargetX + 1, Player.tileTargetY].slope() != (byte) 0) && !TileID.Sets.Platforms[(int) Main.tile[Player.tileTargetX + 1, Player.tileTargetY].type]) - { - WorldGen.SlopeTile(Player.tileTargetX + 1, Player.tileTargetY); - if (Main.netMode == 1) - NetMessage.SendData(17, number: 14, number2: ((float) (Player.tileTargetX + 1)), number3: ((float) Player.tileTargetY)); - } - } - int index = (int) Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type; - if (Main.tile[Player.tileTargetX, Player.tileTargetY].halfBrick()) - index = -1; - int tree1 = (int) Main.tile[Player.tileTargetX - 1, Player.tileTargetY].type; - int tree2 = (int) Main.tile[Player.tileTargetX + 1, Player.tileTargetY].type; - int tree3 = (int) Main.tile[Player.tileTargetX - 1, Player.tileTargetY - 1].type; - int tree4 = (int) Main.tile[Player.tileTargetX + 1, Player.tileTargetY - 1].type; - int tree5 = (int) Main.tile[Player.tileTargetX - 1, Player.tileTargetY - 1].type; - int tree6 = (int) Main.tile[Player.tileTargetX + 1, Player.tileTargetY + 1].type; - if (!Main.tile[Player.tileTargetX, Player.tileTargetY + 1].nactive()) - index = -1; - if (!Main.tile[Player.tileTargetX - 1, Player.tileTargetY].nactive()) - tree1 = -1; - if (!Main.tile[Player.tileTargetX + 1, Player.tileTargetY].nactive()) - tree2 = -1; - if (!Main.tile[Player.tileTargetX - 1, Player.tileTargetY - 1].nactive()) - tree3 = -1; - if (!Main.tile[Player.tileTargetX + 1, Player.tileTargetY - 1].nactive()) - tree4 = -1; - if (!Main.tile[Player.tileTargetX - 1, Player.tileTargetY + 1].nactive()) - tree5 = -1; - if (!Main.tile[Player.tileTargetX + 1, Player.tileTargetY + 1].nactive()) - tree6 = -1; - if (index >= 0 && Main.tileSolid[index] && (!Main.tileNoAttach[index] || index >= 0 && TileID.Sets.Platforms[index])) - canPlace = true; - else if (tree1 >= 0 && Main.tileSolid[tree1] && !Main.tileNoAttach[tree1] || WorldGen.IsTreeType(tree1) && WorldGen.IsTreeType(tree3) && WorldGen.IsTreeType(tree5) || tree1 >= 0 && TileID.Sets.IsBeam[tree1]) - canPlace = true; - else if (tree2 >= 0 && Main.tileSolid[tree2] && !Main.tileNoAttach[tree2] || WorldGen.IsTreeType(tree2) && WorldGen.IsTreeType(tree4) && WorldGen.IsTreeType(tree6) || tree2 >= 0 && TileID.Sets.IsBeam[tree2]) - canPlace = true; - } - } - else if (this.inventory[this.selectedItem].createTile == 78 || this.inventory[this.selectedItem].createTile == 98 || this.inventory[this.selectedItem].createTile == 100 || this.inventory[this.selectedItem].createTile == 173 || this.inventory[this.selectedItem].createTile == 174 || this.inventory[this.selectedItem].createTile == 324) - { - if (Main.tile[Player.tileTargetX, Player.tileTargetY + 1].nactive() && (Main.tileSolid[(int) Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type] || Main.tileTable[(int) Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type])) - canPlace = true; - } - else if (this.inventory[this.selectedItem].createTile == 419) - { - if (Main.tile[Player.tileTargetX, Player.tileTargetY + 1].active() && (Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type == (ushort) 419 || this.inventory[this.selectedItem].placeStyle != 2 && Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type == (ushort) 420)) - canPlace = true; - } - else if (this.inventory[this.selectedItem].createTile == 13 || this.inventory[this.selectedItem].createTile == 29 || this.inventory[this.selectedItem].createTile == 33 || this.inventory[this.selectedItem].createTile == 49 || this.inventory[this.selectedItem].createTile == 50 || this.inventory[this.selectedItem].createTile == 103) - { - if (Main.tile[Player.tileTargetX, Player.tileTargetY + 1].nactive() && Main.tileTable[(int) Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type]) - canPlace = true; - } - else if (this.inventory[this.selectedItem].createTile == 275 || this.inventory[this.selectedItem].createTile == 276 || this.inventory[this.selectedItem].createTile == 277) - canPlace = true; - else if (this.inventory[this.selectedItem].createTile == 51 || this.inventory[this.selectedItem].createTile == 330 || this.inventory[this.selectedItem].createTile == 331 || this.inventory[this.selectedItem].createTile == 332 || this.inventory[this.selectedItem].createTile == 333 || this.inventory[this.selectedItem].createTile == 336 || this.inventory[this.selectedItem].createTile == 340 || this.inventory[this.selectedItem].createTile == 342 || this.inventory[this.selectedItem].createTile == 341 || this.inventory[this.selectedItem].createTile == 343 || this.inventory[this.selectedItem].createTile == 344 || this.inventory[this.selectedItem].createTile == 379 || this.inventory[this.selectedItem].createTile == 351) - { - if (Main.tile[Player.tileTargetX + 1, Player.tileTargetY].active() || Main.tile[Player.tileTargetX + 1, Player.tileTargetY].wall > (ushort) 0 || Main.tile[Player.tileTargetX - 1, Player.tileTargetY].active() || Main.tile[Player.tileTargetX - 1, Player.tileTargetY].wall > (ushort) 0 || Main.tile[Player.tileTargetX, Player.tileTargetY + 1].active() || Main.tile[Player.tileTargetX, Player.tileTargetY + 1].wall > (ushort) 0 || Main.tile[Player.tileTargetX, Player.tileTargetY - 1].active() || Main.tile[Player.tileTargetX, Player.tileTargetY - 1].wall > (ushort) 0) - canPlace = true; - } - else if (this.inventory[this.selectedItem].createTile == 314) - { - for (int index1 = Player.tileTargetX - 1; index1 <= Player.tileTargetX + 1; ++index1) - { - for (int index2 = Player.tileTargetY - 1; index2 <= Player.tileTargetY + 1; ++index2) - { - Tile tile = Main.tile[index1, index2]; - if (tile.active() || tile.wall > (ushort) 0) - { - canPlace = true; - break; - } - } - } - } - else - { - Tile tile1 = Main.tile[Player.tileTargetX - 1, Player.tileTargetY]; - Tile tile2 = Main.tile[Player.tileTargetX + 1, Player.tileTargetY]; - Tile tile3 = Main.tile[Player.tileTargetX, Player.tileTargetY - 1]; - Tile tile4 = Main.tile[Player.tileTargetX, Player.tileTargetY + 1]; - if (tile2.active() && (Main.tileSolid[(int) tile2.type] || Main.tileRope[(int) tile2.type] || tile2.type == (ushort) 314) || tile2.wall > (ushort) 0 || tile1.active() && (Main.tileSolid[(int) tile1.type] || Main.tileRope[(int) tile1.type] || tile1.type == (ushort) 314) || tile1.wall > (ushort) 0 || tile4.active() && (Main.tileSolid[(int) tile4.type] || TileID.Sets.IsBeam[(int) tile4.type] || Main.tileRope[(int) tile4.type] || tile4.type == (ushort) 314) || tile4.wall > (ushort) 0 || tile3.active() && (Main.tileSolid[(int) tile3.type] || TileID.Sets.IsBeam[(int) tile3.type] || Main.tileRope[(int) tile3.type] || tile3.type == (ushort) 314) || tile3.wall > (ushort) 0) - canPlace = true; - else if (Main.tile[Player.tileTargetX, Player.tileTargetY].wall > (ushort) 0) - canPlace = true; - } - if (this.inventory[this.selectedItem].type == 213 && Main.tile[Player.tileTargetX, Player.tileTargetY].active()) - { - int tileTargetX = Player.tileTargetX; - int tileTargetY = Player.tileTargetY; - if (Main.tile[tileTargetX, tileTargetY].type == (ushort) 3 || Main.tile[tileTargetX, tileTargetY].type == (ushort) 73 || Main.tile[tileTargetX, tileTargetY].type == (ushort) 84) - { - WorldGen.KillTile(Player.tileTargetX, Player.tileTargetY); - if (!Main.tile[Player.tileTargetX, Player.tileTargetY].active() && Main.netMode == 1) - NetMessage.SendData(17, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); - } - else if (Main.tile[tileTargetX, tileTargetY].type == (ushort) 83) - { - bool flag = false; - int num = (int) Main.tile[tileTargetX, tileTargetY].frameX / 18; - if (num == 0 && Main.dayTime) - flag = true; - if (num == 1 && !Main.dayTime) - flag = true; - if (num == 3 && !Main.dayTime && (Main.bloodMoon || Main.moonPhase == 0)) - flag = true; - if (num == 4 && (Main.raining || (double) Main.cloudAlpha > 0.0)) - flag = true; - if (num == 5 && !Main.raining && Main.dayTime && Main.time > 40500.0) - flag = true; - if (flag) - { - WorldGen.KillTile(Player.tileTargetX, Player.tileTargetY); - NetMessage.SendData(17, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); - } - } - } - if (Main.tileAlch[this.inventory[this.selectedItem].createTile]) - canPlace = true; - if (Main.tile[Player.tileTargetX, Player.tileTargetY].active() && (Main.tileCut[(int) Main.tile[Player.tileTargetX, Player.tileTargetY].type] || TileID.Sets.BreakableWhenPlacing[(int) Main.tile[Player.tileTargetX, Player.tileTargetY].type] || Main.tile[Player.tileTargetX, Player.tileTargetY].type >= (ushort) 373 && Main.tile[Player.tileTargetX, Player.tileTargetY].type <= (ushort) 375 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == (ushort) 461)) - { - if ((int) Main.tile[Player.tileTargetX, Player.tileTargetY].type != this.inventory[this.selectedItem].createTile) - { - int num = Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type == (ushort) 78 || Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type == (ushort) 380 ? 0 : (Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type != (ushort) 579 ? 1 : 0); - bool flag1 = Main.tile[Player.tileTargetX, Player.tileTargetY].type == (ushort) 3 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == (ushort) 73; - bool flag2 = Main.tileAlch[(int) Main.tile[Player.tileTargetX, Player.tileTargetY].type] && WorldGen.IsHarvestableHerbWithSeed((int) Main.tile[Player.tileTargetX, Player.tileTargetY].type, (int) Main.tile[Player.tileTargetX, Player.tileTargetY].frameX / 18); - bool flag3 = Main.tileAlch[this.inventory[this.selectedItem].createTile]; - if (num != 0 || (flag1 | flag2) & flag3) - { - WorldGen.KillTile(Player.tileTargetX, Player.tileTargetY); - if (!Main.tile[Player.tileTargetX, Player.tileTargetY].active() && Main.netMode == 1) - NetMessage.SendData(17, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); - } - else - canPlace = false; - } - else - canPlace = false; - } - if (!canPlace && this.inventory[this.selectedItem].createTile >= 0 && TileID.Sets.Platforms[this.inventory[this.selectedItem].createTile]) - { - for (int index3 = Player.tileTargetX - 1; index3 <= Player.tileTargetX + 1; ++index3) - { - for (int index4 = Player.tileTargetY - 1; index4 <= Player.tileTargetY + 1; ++index4) - { - if (Main.tile[index3, index4].active()) - { - canPlace = true; - break; - } - } - } - } - if (this.inventory[this.selectedItem].createTile == 3) - { - canPlace = WorldGen.IsFitToPlaceFlowerIn(Player.tileTargetX, Player.tileTargetY, 3); - if (canPlace) - { - WorldGen.KillTile(Player.tileTargetX, Player.tileTargetY); - if (Main.netMode == 1 && !Main.tile[Player.tileTargetX, Player.tileTargetY].active()) - NetMessage.SendData(17, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); - } - } - return canPlace; - } - - private static void PlaceThing_Tiles_BlockPlacementForRepeatedPumpkins( - ref bool canPlace, - ref TileObject data) - { - if (data.type != 254) - return; - for (int index1 = -1; index1 < 1; ++index1) - { - for (int index2 = -1; index2 < 1; ++index2) - { - if (!WorldGen.CanCutTile(Player.tileTargetX + index2, Player.tileTargetY + index1, TileCuttingContext.TilePlacement)) - canPlace = false; - } - } - } - - private static void PlaceThing_Tiles_BlockPlacementForRepeatedCoralAndBeachPiles( - ref bool canPlace, - ref TileObject data) - { - if (data.type != 81 && data.type != 324) - return; - Tile tile = Main.tile[Player.tileTargetX, Player.tileTargetY]; - if (!tile.active() || !Main.tileCut[(int) tile.type] && !TileID.Sets.BreakableWhenPlacing[(int) tile.type] && (tile.type < (ushort) 373 || tile.type > (ushort) 375) && tile.type != (ushort) 461) - return; - canPlace = false; - } - - private static void PlaceThing_Tiles_BlockPlacementForRepeatedPigronatas( - ref bool canPlace, - ref TileObject data) - { - if (data.type != 454) - return; - for (int index = -2; index < 2; ++index) - { - Tile tile = Main.tile[Player.tileTargetX + index, Player.tileTargetY]; - if (tile.active() && tile.type == (ushort) 454) - canPlace = false; - } - } - - private static void PlaceThing_Tiles_BlockPlacementIfOverPlayers( - ref bool canPlace, - ref TileObject data) - { - int width = 0; - int height = 0; - int x = 0; - int y = 0; - switch (data.type) - { - case 138: - width = 32; - height = 32; - x = data.xCoord * 16; - y = data.yCoord * 16; - break; - case 235: - width = 48; - height = 16; - x = data.xCoord * 16; - y = data.yCoord * 16; - break; - case 387: - width = 32; - height = 16; - x = data.xCoord * 16; - y = data.yCoord * 16; - break; - case 476: - width = 16; - height = 16; - x = data.xCoord * 16; - y = data.yCoord * 16; - break; - case 484: - width = 32; - height = 32; - x = data.xCoord * 16; - y = data.yCoord * 16; - break; - } - if (width == 0 || height == 0) - return; - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(x, y, width, height); - for (int index = 0; index < (int) byte.MaxValue; ++index) - { - Player player = Main.player[index]; - if (player.active && !player.dead && player.Hitbox.Intersects(rectangle)) - { - canPlace = false; - break; - } - } - } - - private bool PlaceThing_Tiles_CheckLavaBlocking() - { - bool flag = false; - if (Main.tile[Player.tileTargetX, Player.tileTargetY].liquid > (byte) 0 && Main.tile[Player.tileTargetX, Player.tileTargetY].lava()) - { - if (Main.tileSolid[this.inventory[this.selectedItem].createTile]) - flag = true; - else if (!TileObjectData.CheckLiquidPlacement(this.inventory[this.selectedItem].createTile, this.inventory[this.selectedItem].placeStyle, Main.tile[Player.tileTargetX, Player.tileTargetY])) - flag = true; - } - return flag; - } - - private bool PlaceThing_Tiles_CheckRopeUsability(bool canUse) - { - if (Main.tileRope[this.inventory[this.selectedItem].createTile] && canUse && Main.tile[Player.tileTargetX, Player.tileTargetY].active() && Main.tileRope[(int) Main.tile[Player.tileTargetX, Player.tileTargetY].type]) - { - int tileTargetY = Player.tileTargetY; - int tileTargetX = Player.tileTargetX; - int createTile = this.inventory[this.selectedItem].createTile; - while (Main.tile[tileTargetX, tileTargetY].active() && Main.tileRope[(int) Main.tile[tileTargetX, tileTargetY].type] && tileTargetY < Main.maxTilesX - 5 && Main.tile[tileTargetX, tileTargetY + 2] != null && !Main.tile[tileTargetX, tileTargetY + 1].lava()) - { - ++tileTargetY; - if (Main.tile[tileTargetX, tileTargetY] == null) - { - canUse = false; - tileTargetY = Player.tileTargetY; - break; - } - } - if (!Main.tile[tileTargetX, tileTargetY].active()) - Player.tileTargetY = tileTargetY; - } - return canUse; - } - - private bool PlaceThing_Tiles_CheckWandUsability(bool canUse) - { - if (this.inventory[this.selectedItem].tileWand > 0) - { - int tileWand = this.inventory[this.selectedItem].tileWand; - canUse = false; - for (int index = 0; index < 58; ++index) - { - if (tileWand == this.inventory[index].type && this.inventory[index].stack > 0) - { - canUse = true; - break; - } - } - } - return canUse; - } - - private bool PlaceThing_Tiles_CheckGamepadTorchUsability(bool canUse) - { - if (PlayerInput.UsingGamepad && this.inventory[this.selectedItem].createTile == 4 && Main.SmartCursorEnabled && !Main.SmartCursorShowing) - canUse = false; - return canUse; - } - - private void PlaceThing_ItemInExtractinator() - { - if (ItemID.Sets.ExtractinatorMode[this.inventory[this.selectedItem].type] < 0 || !Main.tile[Player.tileTargetX, Player.tileTargetY].active() || Main.tile[Player.tileTargetX, Player.tileTargetY].type != (ushort) 219 || (double) this.position.X / 16.0 - (double) Player.tileRangeX - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange > (double) Player.tileTargetX || ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX + (double) this.inventory[this.selectedItem].tileBoost - 1.0 + (double) this.blockRange < (double) Player.tileTargetX || (double) this.position.Y / 16.0 - (double) Player.tileRangeY - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange > (double) Player.tileTargetY || ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY + (double) this.inventory[this.selectedItem].tileBoost - 2.0 + (double) this.blockRange < (double) Player.tileTargetY || !this.ItemTimeIsZero || this.itemAnimation <= 0 || !this.controlUseItem) - return; - this.ApplyItemTime(this.inventory[this.selectedItem]); - SoundEngine.PlaySound(7); - this.ExtractinatorUse(ItemID.Sets.ExtractinatorMode[this.inventory[this.selectedItem].type]); - } - - private void PlaceThing_XMasTreeTops() - { - if (this.inventory[this.selectedItem].type < 1874 || this.inventory[this.selectedItem].type > 1905 || !Main.tile[Player.tileTargetX, Player.tileTargetY].active() || Main.tile[Player.tileTargetX, Player.tileTargetY].type != (ushort) 171 || (double) this.position.X / 16.0 - (double) Player.tileRangeX - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange > (double) Player.tileTargetX || ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX + (double) this.inventory[this.selectedItem].tileBoost - 1.0 + (double) this.blockRange < (double) Player.tileTargetX || (double) this.position.Y / 16.0 - (double) Player.tileRangeY - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange > (double) Player.tileTargetY || ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY + (double) this.inventory[this.selectedItem].tileBoost - 2.0 + (double) this.blockRange < (double) Player.tileTargetY || !this.ItemTimeIsZero || this.itemAnimation <= 0 || !this.controlUseItem) - return; - int type = this.inventory[this.selectedItem].type; - if (type >= 1874 && type <= 1877) - { - int style = type - 1873; - if (WorldGen.checkXmasTreeDrop(Player.tileTargetX, Player.tileTargetY, 0) == style) - return; - this.ApplyItemTime(this.inventory[this.selectedItem]); - WorldGen.dropXmasTree(Player.tileTargetX, Player.tileTargetY, 0); - WorldGen.setXmasTree(Player.tileTargetX, Player.tileTargetY, 0, style); - int tileTargetX = Player.tileTargetX; - int tileTargetY = Player.tileTargetY; - if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX < (short) 10) - { - tileTargetX -= (int) Main.tile[Player.tileTargetX, Player.tileTargetY].frameX; - tileTargetY -= (int) Main.tile[Player.tileTargetX, Player.tileTargetY].frameY; - } - NetMessage.SendTileSquare(-1, tileTargetX, tileTargetY, 1); - } - else if (type >= 1878 && type <= 1883) - { - int style = type - 1877; - if (WorldGen.checkXmasTreeDrop(Player.tileTargetX, Player.tileTargetY, 1) == style) - return; - this.ApplyItemTime(this.inventory[this.selectedItem]); - WorldGen.dropXmasTree(Player.tileTargetX, Player.tileTargetY, 1); - WorldGen.setXmasTree(Player.tileTargetX, Player.tileTargetY, 1, style); - int tileTargetX = Player.tileTargetX; - int tileTargetY = Player.tileTargetY; - if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX < (short) 10) - { - tileTargetX -= (int) Main.tile[Player.tileTargetX, Player.tileTargetY].frameX; - tileTargetY -= (int) Main.tile[Player.tileTargetX, Player.tileTargetY].frameY; - } - NetMessage.SendTileSquare(-1, tileTargetX, tileTargetY, 1); - } - else if (type >= 1884 && type <= 1894) - { - int style = type - 1883; - if (WorldGen.checkXmasTreeDrop(Player.tileTargetX, Player.tileTargetY, 2) == style) - return; - this.ApplyItemTime(this.inventory[this.selectedItem]); - WorldGen.dropXmasTree(Player.tileTargetX, Player.tileTargetY, 2); - WorldGen.setXmasTree(Player.tileTargetX, Player.tileTargetY, 2, style); - int tileTargetX = Player.tileTargetX; - int tileTargetY = Player.tileTargetY; - if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX < (short) 10) - { - tileTargetX -= (int) Main.tile[Player.tileTargetX, Player.tileTargetY].frameX; - tileTargetY -= (int) Main.tile[Player.tileTargetX, Player.tileTargetY].frameY; - } - NetMessage.SendTileSquare(-1, tileTargetX, tileTargetY, 1); - } - else - { - if (type < 1895 || type > 1905) - return; - int style = type - 1894; - if (WorldGen.checkXmasTreeDrop(Player.tileTargetX, Player.tileTargetY, 3) == style) - return; - this.ApplyItemTime(this.inventory[this.selectedItem]); - WorldGen.dropXmasTree(Player.tileTargetX, Player.tileTargetY, 3); - WorldGen.setXmasTree(Player.tileTargetX, Player.tileTargetY, 3, style); - int tileTargetX = Player.tileTargetX; - int tileTargetY = Player.tileTargetY; - if (Main.tile[Player.tileTargetX, Player.tileTargetY].frameX < (short) 10) - { - tileTargetX -= (int) Main.tile[Player.tileTargetX, Player.tileTargetY].frameX; - tileTargetY -= (int) Main.tile[Player.tileTargetX, Player.tileTargetY].frameY; - } - NetMessage.SendTileSquare(-1, tileTargetX, tileTargetY, 1); - } - } - - private void PlaceThing_CannonBall() - { - if (this.inventory[this.selectedItem].type != 929 && this.inventory[this.selectedItem].type != 1338 && this.inventory[this.selectedItem].type != 1345 || (double) this.position.X / 16.0 - (double) Player.tileRangeX - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange > (double) Player.tileTargetX || ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX + (double) this.inventory[this.selectedItem].tileBoost - 1.0 + (double) this.blockRange < (double) Player.tileTargetX || (double) this.position.Y / 16.0 - (double) Player.tileRangeY - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange > (double) Player.tileTargetY || ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY + (double) this.inventory[this.selectedItem].tileBoost - 2.0 + (double) this.blockRange < (double) Player.tileTargetY) - return; - int tileTargetX = Player.tileTargetX; - int tileTargetY = Player.tileTargetY; - if (!Main.tile[tileTargetX, tileTargetY].active() || Main.tile[tileTargetX, tileTargetY].type != (ushort) 209) - return; - this.ShootFromCannon(tileTargetX, tileTargetY); - } - - private void PlaceThing_PaintScrapper() - { - if (!ItemID.Sets.IsPaintScraper[this.inventory[this.selectedItem].type] || (double) this.position.X / 16.0 - (double) Player.tileRangeX - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange > (double) Player.tileTargetX || ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX + (double) this.inventory[this.selectedItem].tileBoost - 1.0 + (double) this.blockRange < (double) Player.tileTargetX || (double) this.position.Y / 16.0 - (double) Player.tileRangeY - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange > (double) Player.tileTargetY || ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY + (double) this.inventory[this.selectedItem].tileBoost - 2.0 + (double) this.blockRange < (double) Player.tileTargetY) - return; - int tileTargetX = Player.tileTargetX; - int tileTargetY = Player.tileTargetY; - if (Main.tile[tileTargetX, tileTargetY] == null) - return; - if (Main.tile[tileTargetX, tileTargetY].wallColor() > (byte) 0 && Main.tile[tileTargetX, tileTargetY].wall > (ushort) 0 || Main.tile[tileTargetX, tileTargetY].color() > (byte) 0 && Main.tile[tileTargetX, tileTargetY].active()) - { - this.cursorItemIconEnabled = true; - if (this.ItemTimeIsZero && this.itemAnimation > 0 && this.controlUseItem) - { - if (Main.tile[tileTargetX, tileTargetY].color() > (byte) 0 && Main.tile[tileTargetX, tileTargetY].active() && WorldGen.paintTile(tileTargetX, tileTargetY, (byte) 0, true)) - this.ApplyItemTime(this.inventory[this.selectedItem], this.tileSpeed); - else if (Main.tile[tileTargetX, tileTargetY].wallColor() > (byte) 0 && Main.tile[tileTargetX, tileTargetY].wall > (ushort) 0 && WorldGen.paintWall(tileTargetX, tileTargetY, (byte) 0, true)) - this.ApplyItemTime(this.inventory[this.selectedItem], this.wallSpeed); - } - } - if (Main.tile[tileTargetX, tileTargetY].type != (ushort) 184) - return; - this.cursorItemIconEnabled = true; - if (!this.ItemTimeIsZero || this.itemAnimation <= 0 || !this.controlUseItem) - return; - int type = (int) Main.tile[tileTargetX, tileTargetY].type; - int frameX = (int) Main.tile[tileTargetX, tileTargetY].frameX; - WorldGen.KillTile(tileTargetX, tileTargetY); - if (Main.tile[tileTargetX, tileTargetY].active()) - return; - this.ApplyItemTime(this.inventory[this.selectedItem]); - if (Main.netMode == 1) - NetMessage.SendData(17, number2: ((float) tileTargetX), number3: ((float) tileTargetY)); - if (Main.rand.Next(9) != 0) - return; - int Type = 4349 + frameX / 22; - switch (frameX / 22) - { - case 6: - Type = 4377; - break; - case 7: - Type = 4378; - break; - case 8: - Type = 4389; - break; - } - NetMessage.SendData(21, number: Item.NewItem(tileTargetX * 16, tileTargetY * 16, 16, 16, Type), number2: 1f); - } - - private void PlaceThing_PaintRoller() - { - if (this.inventory[this.selectedItem].type != 1072 && this.inventory[this.selectedItem].type != 1544 || (double) this.position.X / 16.0 - (double) Player.tileRangeX - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange > (double) Player.tileTargetX || ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX + (double) this.inventory[this.selectedItem].tileBoost - 1.0 + (double) this.blockRange < (double) Player.tileTargetX || (double) this.position.Y / 16.0 - (double) Player.tileRangeY - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange > (double) Player.tileTargetY || ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY + (double) this.inventory[this.selectedItem].tileBoost - 2.0 + (double) this.blockRange < (double) Player.tileTargetY) - return; - int tileTargetX = Player.tileTargetX; - int tileTargetY = Player.tileTargetY; - if (Main.tile[tileTargetX, tileTargetY] == null || Main.tile[tileTargetX, tileTargetY].wall <= (ushort) 0) - return; - this.cursorItemIconEnabled = true; - if (!this.ItemTimeIsZero || this.itemAnimation <= 0 || !this.controlUseItem) - return; - this.TryPainting(tileTargetX, tileTargetY, true); - } - - private void PlaceThing_Paintbrush() - { - if (this.inventory[this.selectedItem].type != 1071 && this.inventory[this.selectedItem].type != 1543 || (double) this.position.X / 16.0 - (double) Player.tileRangeX - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange > (double) Player.tileTargetX || ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX + (double) this.inventory[this.selectedItem].tileBoost - 1.0 + (double) this.blockRange < (double) Player.tileTargetX || (double) this.position.Y / 16.0 - (double) Player.tileRangeY - (double) this.inventory[this.selectedItem].tileBoost - (double) this.blockRange > (double) Player.tileTargetY || ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY + (double) this.inventory[this.selectedItem].tileBoost - 2.0 + (double) this.blockRange < (double) Player.tileTargetY) - return; - int tileTargetX = Player.tileTargetX; - int tileTargetY = Player.tileTargetY; - if (Main.tile[tileTargetX, tileTargetY] == null || !Main.tile[tileTargetX, tileTargetY].active()) - return; - this.cursorItemIconEnabled = true; - if (!this.ItemTimeIsZero || this.itemAnimation <= 0 || !this.controlUseItem) - return; - this.TryPainting(tileTargetX, tileTargetY); - } - - private void TryPainting(int x, int y, bool paintingAWall = false, bool applyItemAnimation = true) - { - byte color = byte.MaxValue; - Item obj = (Item) null; - for (int index = 54; index < 58; ++index) - { - if (this.inventory[index].stack > 0 && this.inventory[index].paint > (byte) 0) - { - obj = this.inventory[index]; - color = obj.paint; - break; - } - } - if (color == byte.MaxValue) - { + int tileTargetX3 = Player.tileTargetX; + int tileTargetY1 = Player.tileTargetY; + int num38 = -1; + int num39 = -1; for (int index = 0; index < 58; ++index) { if (this.inventory[index].stack > 0 && this.inventory[index].paint > (byte) 0) { - obj = this.inventory[index]; - color = obj.paint; + num38 = (int) this.inventory[index].paint; + num39 = index; break; } } - } - if (paintingAWall) - { - if (color == byte.MaxValue || (int) Main.tile[x, y].wallColor() == (int) color || !WorldGen.paintWall(x, y, color, true)) + if (num38 <= 0 || (int) Main.tile[tileTargetX3, tileTargetY1].wallColor() == num38 || !WorldGen.paintWall(tileTargetX3, tileTargetY1, (byte) num38, true)) return; - --obj.stack; - if (obj.stack <= 0) - obj.SetDefaults(); - if (!applyItemAnimation) - return; - this.ApplyItemTime(this.inventory[this.selectedItem], this.wallSpeed); - } - else - { - if (color == byte.MaxValue || (int) Main.tile[x, y].color() == (int) color || !WorldGen.paintTile(x, y, color, true)) - return; - --obj.stack; - if (obj.stack <= 0) - obj.SetDefaults(); - if (!applyItemAnimation) - return; - this.ApplyItemTime(this.inventory[this.selectedItem], this.tileSpeed); + int index29 = num39; + --this.inventory[index29].stack; + if (this.inventory[index29].stack <= 0) + this.inventory[index29].SetDefaults(); + this.itemTime = (int) ((double) this.inventory[this.selectedItem].useTime * (double) this.wallSpeed); } } @@ -26654,8 +19879,8 @@ label_15: ammo = 3; if (ammo <= 0) return; - this.cursorItemIconEnabled = true; - if (!this.ItemTimeIsZero || this.itemAnimation <= 0 || !this.controlUseItem) + this.showItemIcon = true; + if (this.itemTime != 0 || this.itemAnimation <= 0 || !this.controlUseItem) return; int num1 = (int) Main.tile[x, y].frameX / 18; int num2 = 0; @@ -26667,11 +19892,11 @@ label_15: for (num3 = (int) Main.tile[x, y].frameY / 18; num3 >= 3; num3 -= 3) ++angle; int y1 = y - num3; - this.ApplyItemTime(this.inventory[this.selectedItem]); + this.itemTime = this.inventory[this.selectedItem].useTime; WorldGen.ShootFromCannon(x1, y1, angle, ammo, this.inventory[this.selectedItem].damage, 8f, Main.myPlayer); } - private void ExtractinatorUse(int extractType) + private static void ExtractinatorUse(int extractType) { int maxValue1 = 5000; int maxValue2 = 25; @@ -26681,7 +19906,7 @@ label_15: { maxValue1 /= 3; maxValue2 *= 2; - maxValue3 = 20; + maxValue3 /= 2; maxValue4 = 10; } int Stack = 1; @@ -26895,8 +20120,6 @@ label_15: if (Type <= 0) return; Vector2 vector2 = Main.ReverseGravitySupport(Main.MouseScreen) + Main.screenPosition; - if (Main.SmartCursorEnabled || PlayerInput.UsingGamepad) - vector2 = this.Center; int number = Item.NewItem((int) vector2.X, (int) vector2.Y, 1, 1, Type, Stack, pfix: -1); if (Main.netMode != 1) return; @@ -26945,7 +20168,7 @@ label_15: Projectile.NewProjectile((float) num5, (float) num6, SpeedX, SpeedY, 321, dmg, kb, this.whoAmI, (float) i); } - public void PutItemInInventoryFromItemUsage(int type, int selItem = -1) + public void PutItemInInventory(int type, int selItem = -1) { for (int index = 0; index < 58; ++index) { @@ -26964,7 +20187,7 @@ label_15: { Item newItem = new Item(); newItem.SetDefaults(type); - if (this.GetItem(this.whoAmI, newItem, GetItemSettings.ItemCreatedFromItemUsage).stack > 0) + if (this.GetItem(this.whoAmI, newItem).stack > 0) { int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, type, noGrabDelay: true); if (Main.netMode != 1) @@ -26976,102 +20199,65 @@ label_15: newItem.position.X = this.Center.X - (float) (newItem.width / 2); newItem.position.Y = this.Center.Y - (float) (newItem.height / 2); newItem.active = true; - PopupText.NewText(PopupTextContext.RegularItemPickup, newItem, 0); + ItemText.NewText(newItem, 0); } } } public bool SummonItemCheck() { - int type = this.inventory[this.selectedItem].type; for (int index = 0; index < 200; ++index) { - NPC npc = Main.npc[index]; - if (npc.active && (type == 43 && npc.type == 4 || type == 70 && npc.type == 13 || type == 560 & npc.type == 50 || type == 544 && npc.type == 125 || type == 544 && npc.type == 126 || type == 556 && npc.type == 134 || type == 557 && npc.type == (int) sbyte.MaxValue || type == 1133 && npc.type == 222 || type == 1331 && npc.type == 266 || type == 4988 && npc.type == 657)) + if (Main.npc[index].active && (this.inventory[this.selectedItem].type == 43 && Main.npc[index].type == 4 || this.inventory[this.selectedItem].type == 70 && Main.npc[index].type == 13 || this.inventory[this.selectedItem].type == 560 & Main.npc[index].type == 50 || this.inventory[this.selectedItem].type == 544 && Main.npc[index].type == 125 || this.inventory[this.selectedItem].type == 544 && Main.npc[index].type == 126 || this.inventory[this.selectedItem].type == 556 && Main.npc[index].type == 134 || this.inventory[this.selectedItem].type == 557 && Main.npc[index].type == (int) sbyte.MaxValue || this.inventory[this.selectedItem].type == 1133 && Main.npc[index].type == 222 || this.inventory[this.selectedItem].type == 1331 && Main.npc[index].type == 266)) return false; } return true; } - public PlayerFishingConditions GetFishingConditions() + public int FishingLevel() { - PlayerFishingConditions fishingConditions = new PlayerFishingConditions(); - this.Fishing_GetBestFishingPole(out fishingConditions.PolePower, out fishingConditions.PoleItemType); - this.Fishing_GetBait(out fishingConditions.BaitPower, out fishingConditions.BaitItemType); - if (fishingConditions.BaitItemType == 2673 || fishingConditions.BaitPower == 0 || fishingConditions.PolePower == 0) - return fishingConditions; - int num = fishingConditions.BaitPower + fishingConditions.PolePower + this.fishingSkill; - fishingConditions.LevelMultipliers = Player.Fishing_GetPowerMultiplier(); - fishingConditions.FinalFishingLevel = (int) ((double) num * (double) fishingConditions.LevelMultipliers); - return fishingConditions; - } - - private static float Fishing_GetPowerMultiplier() - { - float num = 1f; - if (Main.raining) - num *= 1.2f; - if ((double) Main.cloudBGAlpha > 0.0) - num *= 1.1f; - if (Main.dayTime && (Main.time < 5400.0 || Main.time > 48600.0)) - num *= 1.3f; - if (Main.dayTime && Main.time > 16200.0 && Main.time < 37800.0) - num *= 0.8f; - if (!Main.dayTime && Main.time > 6480.0 && Main.time < 25920.0) - num *= 0.8f; - if (Main.moonPhase == 0) - num *= 1.1f; - if (Main.moonPhase == 1 || Main.moonPhase == 7) - num *= 1.05f; - if (Main.moonPhase == 3 || Main.moonPhase == 5) - num *= 0.95f; - if (Main.moonPhase == 4) - num *= 0.9f; - if (Main.bloodMoon) - num *= 1.1f; - return num; - } - - private void Fishing_GetBait(out int baitPower, out int baitType) - { - baitPower = 0; - baitType = 0; - for (int index = 54; index < 58; ++index) + int num1 = 0; + int fishingPole = this.inventory[this.selectedItem].fishingPole; + if (fishingPole == 0) { - if (this.inventory[index].stack > 0 && this.inventory[index].bait > 0) + for (int index = 0; index < 58; ++index) { - baitPower = this.inventory[index].bait; - baitType = this.inventory[index].type; - break; + if (this.inventory[index].fishingPole > fishingPole) + fishingPole = this.inventory[index].fishingPole; } } - if (baitPower != 0 || baitType != 0) - return; - for (int index = 0; index < 50; ++index) - { - if (this.inventory[index].stack > 0 && this.inventory[index].bait > 0) - { - baitPower = this.inventory[index].bait; - baitType = this.inventory[index].type; - break; - } - } - } - - private void Fishing_GetBestFishingPole(out int fishingPolePower, out int fishingPoleType) - { - fishingPolePower = this.inventory[this.selectedItem].fishingPole; - fishingPoleType = this.inventory[this.selectedItem].type; - if (fishingPolePower != 0) - return; for (int index = 0; index < 58; ++index) { - if (this.inventory[index].fishingPole > fishingPolePower) + if (this.inventory[index].stack > 0 && this.inventory[index].bait > 0) { - fishingPolePower = this.inventory[index].fishingPole; - fishingPoleType = this.inventory[index].type; + if (this.inventory[index].type == 2673) + return -1; + num1 = this.inventory[index].bait; + break; } } + if (num1 == 0 || fishingPole == 0) + return 0; + int num2 = num1 + fishingPole + this.fishingSkill; + if (Main.raining) + num2 = (int) ((double) num2 * 1.20000004768372); + if ((double) Main.cloudBGAlpha > 0.0) + num2 = (int) ((double) num2 * 1.10000002384186); + if (Main.dayTime && (Main.time < 5400.0 || Main.time > 48600.0)) + num2 = (int) ((double) num2 * 1.29999995231628); + if (Main.dayTime && Main.time > 16200.0 && Main.time < 37800.0) + num2 = (int) ((double) num2 * 0.800000011920929); + if (!Main.dayTime && Main.time > 6480.0 && Main.time < 25920.0) + num2 = (int) ((double) num2 * 0.800000011920929); + if (Main.moonPhase == 0) + num2 = (int) ((double) num2 * 1.10000002384186); + if (Main.moonPhase == 1 || Main.moonPhase == 7) + num2 = (int) ((double) num2 * 1.04999995231628); + if (Main.moonPhase == 3 || Main.moonPhase == 5) + num2 = (int) ((double) num2 * 0.949999988079071); + if (Main.moonPhase == 4) + num2 = (int) ((double) num2 * 0.899999976158142); + return num2; } public bool HasUnityPotion() @@ -27180,7 +20366,7 @@ label_15: int index2 = (int) center.X / 16; int index3 = (int) center.Y / 16; bool flag = false; - if (Main.rand.Next(3) == 0 && Main.tile[index2, index3] != null && Main.tile[index2, index3].wall > (ushort) 0) + if (Main.rand.Next(3) == 0 && Main.tile[index2, index3] != null && Main.tile[index2, index3].wall > (byte) 0) { flag = true; } @@ -27194,8 +20380,6 @@ label_15: center.Y += (float) (num4 / 2); flag = true; } - else if (Main.tile[index2, index3] != null && Main.tile[index2, index3].active() && Main.tile[index2, index3].type == (ushort) 19) - flag = true; } if (flag) { @@ -27218,4525 +20402,1078 @@ label_15: } } - public void VolatileGelatin() - { - if (Main.myPlayer != this.whoAmI) - return; - ++this.volatileGelatinCounter; - if (this.volatileGelatinCounter <= 50) - return; - this.volatileGelatinCounter = 0; - int Damage = 65; - float KnockBack = 7f; - float num1 = 640f; - NPC npc1 = (NPC) null; - for (int index = 0; index < 200; ++index) - { - NPC npc2 = Main.npc[index]; - if (npc2 != null && npc2.active && npc2.CanBeChasedBy((object) this) && Collision.CanHit((Entity) this, (Entity) npc2)) - { - float num2 = Vector2.Distance(npc2.Center, this.Center); - if ((double) num2 < (double) num1) - { - num1 = num2; - npc1 = npc2; - } - } - } - if (npc1 == null) - return; - Vector2 vector2 = (npc1.Center - this.Center).SafeNormalize(Vector2.Zero) * 6f; - vector2.Y -= 2f; - Projectile.NewProjectile(this.Center.X, this.Center.Y, vector2.X, vector2.Y, 937, Damage, KnockBack, this.whoAmI); - } - public bool CanHit(Entity ent) => Collision.CanHit(this.position, this.width, this.height, ent.position, ent.width, ent.height) || Collision.CanHitLine(this.Center + new Vector2((float) (this.direction * this.width / 2), (float) ((double) this.gravDir * (double) -this.height / 3.0)), 0, 0, ent.Center + new Vector2(0.0f, (float) (-ent.height / 3)), 0, 0) || Collision.CanHitLine(this.Center + new Vector2((float) (this.direction * this.width / 2), (float) ((double) this.gravDir * (double) -this.height / 3.0)), 0, 0, ent.Center, 0, 0) || Collision.CanHitLine(this.Center + new Vector2((float) (this.direction * this.width / 2), 0.0f), 0, 0, ent.Center + new Vector2(0.0f, (float) (ent.height / 3)), 0, 0); - public Microsoft.Xna.Framework.Rectangle GetItemDrawFrame(int type) - { - Main.instance.LoadItem(type); - return type == 75 ? TextureAssets.Item[type].Frame(verticalFrames: 8) : TextureAssets.Item[type].Frame(); - } - public void ItemCheck(int i) { - if (this.CCed) + if (this.webbed || this.frozen || this.stoned) + return; + bool flag1 = false; + float playerOffsetHitbox = (float) this.mount.PlayerOffsetHitbox; + Item sItem = this.inventory[this.selectedItem]; + if (this.mount.Active) { - this.channel = false; - this.itemAnimation = this.itemAnimationMax = 0; - } - else - { - bool consumptionFailed = false; - float offsetHitboxCenter = this.HeightOffsetHitboxCenter; - Item sItem1 = this.inventory[this.selectedItem]; - if (Main.myPlayer == i && PlayerInput.ShouldFastUseItem) - this.controlUseItem = true; - this.ItemCheck_HandleMount(); - int weaponDamage = this.GetWeaponDamage(sItem1); - this.ItemCheck_HandleMPItemAnimation(sItem1); - this.ItemCheck_HackHoldStyles(sItem1); - if (this.itemAnimation < 0) - this.itemAnimation = 0; - if (this.itemTime < 0) - this.itemTime = 0; - if (this.itemAnimation == 0 && this.reuseDelay > 0) - this.ApplyReuseDelay(); - if (Main.myPlayer == i && this.itemAnimation == 0 && TileObjectData.CustomPlace(sItem1.createTile, sItem1.placeStyle)) - TileObject.CanPlace(Player.tileTargetX, Player.tileTargetY, sItem1.createTile, sItem1.placeStyle, this.direction, out TileObject _, true); - if (this.itemAnimation == 0 && this.altFunctionUse == 2) - this.altFunctionUse = 0; - bool flag1 = true; - if ((double) this.gravDir == -1.0 && GolfHelper.IsPlayerHoldingClub(this)) - flag1 = false; - if (flag1 && this.controlUseItem && this.releaseUseItem && this.itemAnimation == 0 && sItem1.useStyle != 0) + if (this.mount.Type == 8) { - if (this.altFunctionUse == 1) - this.altFunctionUse = 2; - if (sItem1.shoot == 0) - this.itemRotation = 0.0f; - bool flag2 = this.ItemCheck_CheckCanUse(sItem1); - if (sItem1.potion & flag2) - this.ApplyPotionDelay(sItem1); - if (sItem1.mana > 0 & flag2 && this.whoAmI == Main.myPlayer && sItem1.buffType != 0 && sItem1.buffTime != 0) - this.AddBuff(sItem1.buffType, sItem1.buffTime); - if ((sItem1.shoot <= 0 || !ProjectileID.Sets.MinionTargettingFeature[sItem1.shoot] ? 0 : (this.altFunctionUse == 2 ? 1 : 0)) == 0) - this.ItemCheck_ApplyPetBuffs(sItem1); - if (this.whoAmI == Main.myPlayer && (double) this.gravDir == 1.0 && sItem1.mountType != -1 && this.mount.CanMount(sItem1.mountType, this)) - this.mount.SetMount(sItem1.mountType, this); - if ((sItem1.shoot <= 0 || !ProjectileID.Sets.MinionTargettingFeature[sItem1.shoot] ? 0 : (this.altFunctionUse == 2 ? 1 : 0)) == 0 & flag2 && this.whoAmI == Main.myPlayer && sItem1.shoot >= 0 && sItem1.shoot < 950 && (ProjectileID.Sets.LightPet[sItem1.shoot] || Main.projPet[sItem1.shoot])) - this.FreeUpPetsAndMinions(sItem1); - if (flag2) - this.ItemCheck_StartActualUse(sItem1); - } - if (!this.controlUseItem) - this.channel = false; - Item sItem2 = this.itemAnimation > 0 ? this.lastVisualizedSelectedItem : sItem1; - Microsoft.Xna.Framework.Rectangle drawHitbox = Item.GetDrawHitbox(sItem2.type, this); - this.compositeFrontArm.enabled = false; - this.compositeBackArm.enabled = false; - if (this.itemAnimation > 0) - { - if (sItem1.mana > 0) - this.ItemCheck_ApplyManaRegenDelay(sItem1); - if (Main.dedServ) + this.noItems = true; + if (this.controlUseItem) { - this.itemHeight = sItem1.height; - this.itemWidth = sItem1.width; + this.channel = true; + if (this.releaseUseItem) + this.mount.UseAbility(this, Vector2.Zero, true); + this.releaseUseItem = false; + } + } + if (this.whoAmI == Main.myPlayer && (double) this.gravDir == -1.0) + this.mount.Dismount(this); + } + int weaponDamage = this.GetWeaponDamage(sItem); + if (sItem.autoReuse && !this.noItems) + { + this.releaseUseItem = true; + if (this.itemAnimation == 1 && sItem.stack > 0) + { + if (sItem.shoot > 0 && this.whoAmI != Main.myPlayer && this.controlUseItem && sItem.useStyle == 5) + { + this.ApplyAnimation(sItem); + if (sItem.UseSound != null) + Main.PlaySound(sItem.UseSound, this.Center); } else - { - this.itemHeight = drawHitbox.Height; - this.itemWidth = drawHitbox.Width; - } - --this.itemAnimation; - } - if (this.itemAnimation > 0) - this.ItemCheck_ApplyUseStyle(offsetHitboxCenter, sItem2, drawHitbox); - else - this.ItemCheck_ApplyHoldStyle(offsetHitboxCenter, sItem2, drawHitbox); - this.releaseUseItem = !this.controlUseItem; - if (this.itemTime > 0) - { - --this.itemTime; - if (this.ItemTimeIsZero && this.whoAmI == Main.myPlayer) - { - if (!this.JustDroppedAnItem) - { - switch (sItem1.type) - { - case 65: - case 676: - case 723: - case 724: - case 989: - case 1226: - case 1227: - this.EmitMaxManaEffect(); - break; - } - } - PlayerInput.TryEndingFastUse(); - } - } - if (!this.JustDroppedAnItem) - { - this.ItemCheck_EmitHeldItemLight(sItem1); - this.ItemCheck_EmitFoodParticles(sItem1); - this.ItemCheck_EmitDrinkParticles(sItem1); - if (this.whoAmI == Main.myPlayer) - { - bool cShoot = true; - int type = sItem1.type; - if ((type == 65 || type == 676 || type == 723 || type == 724 || type == 757 || type == 674 || type == 675 || type == 989 || type == 1226 || type == 1227) && this.itemAnimation != this.itemAnimationMax - 1) - cShoot = false; - if (type == 3852) - { - if (this.itemAnimation < this.itemAnimationMax - 12) - cShoot = false; - if (this.altFunctionUse == 2 && this.itemAnimation != this.itemAnimationMax - 1) - cShoot = false; - } - if (type == 4956 && this.itemAnimation < this.itemAnimationMax - 3 * sItem1.useTime) - cShoot = false; - if (type == 4952 && this.itemAnimation < this.itemAnimationMax - 8) - cShoot = false; - if (type == 4953 && this.itemAnimation < this.itemAnimationMax - 10) - cShoot = false; - this.ItemCheck_TurretAltFeatureUse(sItem1, cShoot); - this.ItemCheck_MinionAltFeatureUse(sItem1, cShoot); - if (((sItem1.shoot <= 0 || this.itemAnimation <= 0 ? 0 : (this.ItemTimeIsZero ? 1 : 0)) & (cShoot ? 1 : 0)) != 0) - this.ItemCheck_Shoot(i, sItem1, weaponDamage); - this.ItemCheck_UseWiringTools(sItem1); - this.ItemCheck_UseLawnMower(sItem1); - this.ItemCheck_PlayInstruments(sItem1); - this.ItemCheck_UseBuckets(sItem1); - if (!this.channel) - { - this.toolTime = this.itemTime; - } - else - { - --this.toolTime; - if (this.toolTime < 0) - this.toolTime = sItem1.useTime; - } - this.ItemCheck_UseMiningTools(sItem1); - this.ItemCheck_UseRodOfDiscord(sItem1); - this.ItemCheck_UseLifeCrystal(sItem1); - this.ItemCheck_UseLifeFruit(sItem1); - this.ItemCheck_UseManaCrystal(sItem1); - this.ItemCheck_UseDemonHeart(sItem1); - this.ItemCheck_UseTorchGodsFavor(sItem1); - this.ItemCheck_UseEventItems(sItem1); - this.ItemCheck_UseBossSpawners(this.whoAmI, sItem1); - this.ItemCheck_UseCombatBook(sItem1); - this.ItemCheck_UsePetLicenses(sItem1); - if (sItem1.type == 4095 && this.itemAnimation == 2) - Main.LocalGolfState.ResetGolfBall(); - this.PlaceThing(); - if (sItem1.makeNPC > (short) 0) - { - if (!Main.GamepadDisableCursorItemIcon && (double) this.position.X / 16.0 - (double) Player.tileRangeX - (double) sItem1.tileBoost <= (double) Player.tileTargetX && ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX + (double) sItem1.tileBoost - 1.0 >= (double) Player.tileTargetX && (double) this.position.Y / 16.0 - (double) Player.tileRangeY - (double) sItem1.tileBoost <= (double) Player.tileTargetY && ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY + (double) sItem1.tileBoost - 2.0 >= (double) Player.tileTargetY) - { - this.cursorItemIconEnabled = true; - Main.ItemIconCacheUpdate(sItem1.type); - } - if (this.ItemTimeIsZero && this.itemAnimation > 0 && this.controlUseItem) - consumptionFailed = this.ItemCheck_ReleaseCritter(consumptionFailed, sItem1); - } - } - if ((sItem1.damage >= 0 && sItem1.type > 0 && !sItem1.noMelee || sItem1.type == 1450 || sItem1.type == 1991 || sItem1.type == 3183 || sItem1.type == 4821 || sItem1.type == 3542 || sItem1.type == 3779) && this.itemAnimation > 0) - { - bool dontAttack; - Microsoft.Xna.Framework.Rectangle itemRectangle1; - this.ItemCheck_GetMeleeHitbox(sItem1, drawHitbox, out dontAttack, out itemRectangle1); - if (!dontAttack) - { - Microsoft.Xna.Framework.Rectangle itemRectangle2 = this.ItemCheck_EmitUseVisuals(sItem1, itemRectangle1); - if (Main.myPlayer == this.whoAmI && (sItem1.type == 1991 || sItem1.type == 3183 || sItem1.type == 4821)) - itemRectangle2 = this.ItemCheck_CatchCritters(sItem1, itemRectangle2); - if (sItem1.type == 3183 || sItem1.type == 4821) - { - List tileCutIgnoreList = Player.ItemCheck_GetTileCutIgnoreList(sItem1); - Player.ItemCheck_CutTiles(sItem1, itemRectangle2, tileCutIgnoreList); - } - if (Main.myPlayer == i && sItem1.damage > 0) - { - int num1 = weaponDamage; - float knockBack1 = sItem1.knockBack; - float num2 = 1f; - if (this.kbGlove) - ++num2; - if (this.kbBuff) - num2 += 0.5f; - float knockBack2 = knockBack1 * num2; - if (this.inventory[this.selectedItem].type == 3106) - knockBack2 += knockBack2 * (1f - this.stealth); - List tileCutIgnoreList = Player.ItemCheck_GetTileCutIgnoreList(sItem1); - Player.ItemCheck_CutTiles(sItem1, itemRectangle2, tileCutIgnoreList); - this.ItemCheck_MeleeHitNPCs(sItem1, itemRectangle2, num1, knockBack2); - this.ItemCheck_MeleeHitPVP(sItem1, itemRectangle2, num1, knockBack2); - this.ItemCheck_EmitHammushProjectiles(i, sItem1, itemRectangle2, num1); - } - } - } - if (this.ItemTimeIsZero && this.itemAnimation > 0) - { - if (sItem1.hairDye >= (short) 0) - { - this.ApplyItemTime(sItem1); - if (this.whoAmI == Main.myPlayer) - { - this.hairDye = (byte) sItem1.hairDye; - NetMessage.SendData(4, number: this.whoAmI); - } - } - if (sItem1.healLife > 0) - { - this.statLife += sItem1.healLife; - this.ApplyItemTime(sItem1); - if (Main.myPlayer == this.whoAmI) - this.HealEffect(sItem1.healLife); - } - if (sItem1.healMana > 0) - { - this.statMana += sItem1.healMana; - this.ApplyItemTime(sItem1); - if (Main.myPlayer == this.whoAmI) - { - this.AddBuff(94, Player.manaSickTime); - this.ManaEffect(sItem1.healMana); - } - } - if (sItem1.buffType > 0) - { - if (this.whoAmI == Main.myPlayer && sItem1.buffType != 90 && sItem1.buffType != 27) - this.AddBuff(sItem1.buffType, sItem1.buffTime); - this.ApplyItemTime(sItem1); - } - if (sItem1.type == 678) - { - if (Main.getGoodWorld) - { - this.ApplyItemTime(sItem1); - if (this.whoAmI == Main.myPlayer) - { - for (int index = 0; index < 3; ++index) - { - int type = 0; - int timeToAdd = 108000; - switch (Main.rand.Next(18)) - { - case 0: - type = 16; - break; - case 1: - type = 111; - break; - case 2: - type = 114; - break; - case 3: - type = 8; - break; - case 4: - type = 105; - break; - case 5: - type = 17; - break; - case 6: - type = 116; - break; - case 7: - type = 5; - break; - case 8: - type = 113; - break; - case 9: - type = 7; - break; - case 10: - type = 6; - break; - case 11: - type = 104; - break; - case 12: - type = 115; - break; - case 13: - type = 2; - break; - case 14: - type = 9; - break; - case 15: - type = 3; - break; - case 16: - type = 117; - break; - case 17: - type = 1; - break; - } - this.AddBuff(type, timeToAdd); - } - } - } - else - { - this.ApplyItemTime(sItem1); - if (this.whoAmI == Main.myPlayer) - { - this.AddBuff(20, 216000); - this.AddBuff(22, 216000); - this.AddBuff(23, 216000); - this.AddBuff(24, 216000); - this.AddBuff(30, 216000); - this.AddBuff(31, 216000); - this.AddBuff(32, 216000); - this.AddBuff(33, 216000); - this.AddBuff(35, 216000); - this.AddBuff(36, 216000); - this.AddBuff(68, 216000); - } - } - } - } - if ((sItem1.type == 50 || sItem1.type == 3124 || sItem1.type == 3199) && this.itemAnimation > 0) - { - if (Main.rand.Next(2) == 0) - Dust.NewDust(this.position, this.width, this.height, 15, Alpha: 150, Scale: 1.1f); - if (this.ItemTimeIsZero) - this.ApplyItemTime(sItem1); - else if (this.itemTime == sItem1.useTime / 2) - { - for (int index = 0; index < 70; ++index) - Dust.NewDust(this.position, this.width, this.height, 15, this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 150, Scale: 1.5f); - this.RemoveAllGrapplingHooks(); - this.Spawn(PlayerSpawnContext.RecallFromItem); - for (int index = 0; index < 70; ++index) - Dust.NewDust(this.position, this.width, this.height, 15, Alpha: 150, Scale: 1.5f); - } - } - if (sItem1.type == 4263 && this.itemAnimation > 0) - { - Vector2 vector2 = Vector2.UnitY.RotatedBy((double) this.itemAnimation * 6.28318548202515 / 30.0) * new Vector2(15f, 0.0f); - for (int index = 0; index < 2; ++index) - { - if (Main.rand.Next(3) == 0) - { - Dust dust = Dust.NewDustPerfect(this.Bottom + vector2, Dust.dustWater()); - dust.velocity.Y *= 0.0f; - dust.velocity.Y -= 4.5f; - dust.velocity.X *= 1.5f; - dust.scale = 0.8f; - dust.alpha = 130; - dust.noGravity = true; - dust.fadeIn = 1.1f; - } - } - if (this.ItemTimeIsZero) - this.ApplyItemTime(sItem1); - else if (this.itemTime == 2) - { - switch (Main.netMode) - { - case 0: - this.MagicConch(); - break; - case 1: - if (this.whoAmI == Main.myPlayer) - { - NetMessage.SendData(73, number: 1); - break; - } - break; - } - } - } - if (sItem1.type == 4819 && this.itemAnimation > 0) - { - Vector2 vector2 = Vector2.UnitY.RotatedBy((double) this.itemAnimation * 6.28318548202515 / 30.0) * new Vector2(15f, 0.0f); - for (int index = 0; index < 2; ++index) - { - if (Main.rand.Next(3) == 0) - { - Dust dust = Dust.NewDustPerfect(this.Bottom + vector2, 35); - dust.velocity.Y *= 0.0f; - dust.velocity.Y -= 4.5f; - dust.velocity.X *= 1.5f; - dust.scale = 0.8f; - dust.alpha = 130; - dust.noGravity = true; - dust.fadeIn = 1.1f; - } - } - if (this.ItemTimeIsZero) - this.ApplyItemTime(sItem1); - else if (this.itemTime == 2) - { - switch (Main.netMode) - { - case 0: - this.DemonConch(); - break; - case 1: - if (this.whoAmI == Main.myPlayer) - { - NetMessage.SendData(73, number: 2); - break; - } - break; - } - } - } - if (sItem1.type == 2350 && this.itemAnimation > 0) - { - if (this.ItemTimeIsZero) - { - this.ApplyItemTime(sItem1); - SoundEngine.PlaySound(SoundID.Item3, this.position); - for (int index = 0; index < 10; ++index) - Main.dust[Dust.NewDust(this.position, this.width, this.height, 15, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 150, Color.Cyan, 1.2f)].velocity *= 0.5f; - } - else if (this.itemTime == 20) - { - SoundEngine.PlaySound(this.HeldItem.UseSound, this.position); - for (int index = 0; index < 70; ++index) - Main.dust[Dust.NewDust(this.position, this.width, this.height, 15, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 150, Color.Cyan, 1.2f)].velocity *= 0.5f; - this.RemoveAllGrapplingHooks(); - bool immune = this.immune; - int immuneTime = this.immuneTime; - this.Spawn(PlayerSpawnContext.RecallFromItem); - this.immune = immune; - this.immuneTime = immuneTime; - for (int index = 0; index < 70; ++index) - Main.dust[Dust.NewDust(this.position, this.width, this.height, 15, Alpha: 150, newColor: Color.Cyan, Scale: 1.2f)].velocity *= 0.5f; - if (sItem1.stack > 0) - --sItem1.stack; - } - } - if (sItem1.type == 4870 && this.itemAnimation > 0) - { - if (this.ItemTimeIsZero) - { - this.ApplyItemTime(sItem1); - SoundEngine.PlaySound(SoundID.Item3, this.position); - for (int index = 0; index < 10; ++index) - Main.dust[Dust.NewDust(this.position, this.width, this.height, 15, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 150, Color.Cyan, 1.2f)].velocity *= 0.5f; - } - else if (this.itemTime == 20) - { - SoundEngine.PlaySound(this.HeldItem.UseSound, this.position); - for (int index = 0; index < 70; ++index) - Main.dust[Dust.NewDust(this.position, this.width, this.height, 15, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 150, Color.Cyan, 1.2f)].velocity *= 0.5f; - this.DoPotionOfReturnTeleportationAndSetTheComebackPoint(); - for (int index = 0; index < 70; ++index) - Main.dust[Dust.NewDust(this.position, this.width, this.height, 15, Alpha: 150, newColor: Color.Cyan, Scale: 1.2f)].velocity *= 0.5f; - if (sItem1.stack > 0) - --sItem1.stack; - } - } - if (sItem1.type == 2351 && this.itemAnimation > 0) - { - if (this.ItemTimeIsZero) - this.ApplyItemTime(sItem1); - else if (this.itemTime == 2) - { - switch (Main.netMode) - { - case 0: - this.TeleportationPotion(); - break; - case 1: - if (this.whoAmI == Main.myPlayer) - { - NetMessage.SendData(73); - break; - } - break; - } - if (sItem1.stack > 0) - --sItem1.stack; - } - } - if (sItem1.type == 2756 && this.itemAnimation > 0) - { - if (this.ItemTimeIsZero) - this.ApplyItemTime(sItem1); - else if (this.itemTime == 2) - { - if (this.whoAmI == Main.myPlayer) - { - this.Male = !this.Male; - if (Main.netMode == 1) - NetMessage.SendData(4, number: this.whoAmI); - } - if (sItem1.stack > 0) - --sItem1.stack; - } - else - { - float useTime = (float) sItem1.useTime; - float num3 = (useTime - (float) this.itemTime) / useTime; - float num4 = 44f; - Vector2 vector2 = new Vector2(15f, 0.0f).RotatedBy(9.42477798461914 * (double) num3); - vector2.X *= (float) this.direction; - for (int index1 = 0; index1 < 2; ++index1) - { - int Type = 221; - if (index1 == 1) - { - vector2.X *= -1f; - Type = 219; - } - Vector2 Position = new Vector2(vector2.X, num4 * (1f - num3) - num4 + (float) (this.height / 2)); - Position += this.Center; - int index2 = Dust.NewDust(Position, 0, 0, Type, Alpha: 100); - Main.dust[index2].position = Position; - Main.dust[index2].noGravity = true; - Main.dust[index2].velocity = Vector2.Zero; - Main.dust[index2].scale = 1.3f; - Main.dust[index2].customData = (object) this; - } - } - } - if (i == Main.myPlayer) - { - if (((this.itemTimeMax == 0 ? 0 : (this.itemTime == this.itemTimeMax ? 1 : 0)) | (sItem1.IsAir ? 0 : (sItem1.IsNotTheSameAs(this.lastVisualizedSelectedItem) ? 1 : 0))) != 0) - this.lastVisualizedSelectedItem = sItem1.Clone(); - } - else - this.lastVisualizedSelectedItem = sItem1.Clone(); - if (i == Main.myPlayer) - { - if (!this.dontConsumeWand && this.itemTime == (int) ((double) sItem1.useTime * (double) this.tileSpeed) && sItem1.tileWand > 0) - { - int tileWand = sItem1.tileWand; - for (int index = 0; index < 58; ++index) - { - if (tileWand == this.inventory[index].type && this.inventory[index].stack > 0) - { - --this.inventory[index].stack; - if (this.inventory[index].stack <= 0) - { - this.inventory[index] = new Item(); - break; - } - break; - } - } - } - if (this.itemTimeMax != 0 && this.itemTime == this.itemTimeMax && sItem1.consumable && !consumptionFailed) - { - bool flag3 = true; - if (sItem1.ranged) - { - if (this.chloroAmmoCost80 && Main.rand.Next(5) == 0) - flag3 = false; - if (this.ammoCost80 && Main.rand.Next(5) == 0) - flag3 = false; - if (this.ammoCost75 && Main.rand.Next(4) == 0) - flag3 = false; - } - if (sItem1.IsACoin) - flag3 = true; - bool? nullable = ItemID.Sets.ForceConsumption[sItem1.type]; - if (nullable.HasValue) - flag3 = nullable.Value; - if (flag3) - { - if (sItem1.stack > 0) - --sItem1.stack; - if (sItem1.stack <= 0) - { - this.itemTime = this.itemAnimation; - Main.blockMouse = true; - } - } - } - if (sItem1.stack <= 0 && this.itemAnimation == 0) - this.inventory[this.selectedItem] = new Item(); - if (this.selectedItem == 58 && this.itemAnimation != 0) - Main.mouseItem = sItem1.Clone(); - } - } - if (this.itemAnimation != 0) - return; - this.JustDroppedAnItem = false; - } - } - - private void ItemCheck_EmitFoodParticles(Item sItem) - { - if (this.itemAnimation < 1) - return; - Color[] foodParticleColor = ItemID.Sets.FoodParticleColors[sItem.type]; - if (foodParticleColor == null || foodParticleColor.Length == 0 || Main.rand.Next(2) == 0) - return; - Dust.NewDustPerfect(this.RotatedRelativePoint(this.MountedCenter, addGfxOffY: false) + new Vector2((float) (this.direction * 8), this.gravDir * -4f).RotatedBy((double) this.fullRotation) + Main.rand.NextVector2Square(-4f, 4f), 284, new Vector2?(1.3f * new Vector2((float) this.direction, (float) (-(double) this.gravDir * 0.800000011920929)).RotatedBy(0.628318548202515 * (double) Main.rand.NextFloatDirection())), newColor: foodParticleColor[Main.rand.Next(foodParticleColor.Length)], Scale: ((float) (0.800000011920929 + 0.200000002980232 * (double) Main.rand.NextFloat()))).fadeIn = 0.0f; - } - - private void ItemCheck_EmitDrinkParticles(Item sItem) - { - if (this.itemAnimation < 1) - return; - Color[] drinkParticleColor = ItemID.Sets.DrinkParticleColors[sItem.type]; - if (drinkParticleColor == null || drinkParticleColor.Length == 0) - return; - Dust.NewDustPerfect(this.RotatedRelativePoint(this.MountedCenter, addGfxOffY: false) + new Vector2((float) (this.direction * 8), this.gravDir * -4f).RotatedBy((double) this.fullRotation) + Main.rand.NextVector2Square(-4f, 4f), 284, new Vector2?(1.3f * new Vector2((float) this.direction * 0.1f, (float) (-(double) this.gravDir * 0.100000001490116)).RotatedBy(-0.628318548202515 * (double) Main.rand.NextFloatDirection())), newColor: (drinkParticleColor[Main.rand.Next(drinkParticleColor.Length)] * 0.7f), Scale: ((float) (0.800000011920929 + 0.200000002980232 * (double) Main.rand.NextFloat()))).fadeIn = 0.0f; - } - - private void ItemCheck_UseBossSpawners(int onWhichPlayer, Item sItem) - { - if (!this.ItemTimeIsZero || this.itemAnimation <= 0 || sItem.type != 43 && sItem.type != 70 && sItem.type != 544 && sItem.type != 556 && sItem.type != 557 && sItem.type != 560 && sItem.type != 1133 && sItem.type != 1331 && sItem.type != 4988 || !this.SummonItemCheck()) - return; - if (sItem.type == 560) - { - this.ApplyItemTime(sItem); - SoundEngine.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); - if (Main.netMode != 1) - NPC.SpawnOnPlayer(onWhichPlayer, 50); - else - NetMessage.SendData(61, number: this.whoAmI, number2: 50f); - } - else if (sItem.type == 43) - { - if (Main.dayTime) - return; - this.ApplyItemTime(sItem); - SoundEngine.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); - if (Main.netMode != 1) - NPC.SpawnOnPlayer(onWhichPlayer, 4); - else - NetMessage.SendData(61, number: this.whoAmI, number2: 4f); - } - else if (sItem.type == 70) - { - if (!this.ZoneCorrupt) - return; - this.ApplyItemTime(sItem); - SoundEngine.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); - if (Main.netMode != 1) - NPC.SpawnOnPlayer(onWhichPlayer, 13); - else - NetMessage.SendData(61, number: this.whoAmI, number2: 13f); - } - else if (sItem.type == 544) - { - if (Main.dayTime) - return; - this.ApplyItemTime(sItem); - SoundEngine.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); - if (Main.netMode != 1) - { - NPC.SpawnOnPlayer(onWhichPlayer, 125); - NPC.SpawnOnPlayer(onWhichPlayer, 126); - } - else - { - NetMessage.SendData(61, number: this.whoAmI, number2: 125f); - NetMessage.SendData(61, number: this.whoAmI, number2: 126f); + this.itemAnimation = 0; } } - else if (sItem.type == 556) + if (sItem.fishingPole > 0) { - if (Main.dayTime) - return; - this.ApplyItemTime(sItem); - SoundEngine.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); - if (Main.netMode != 1) - NPC.SpawnOnPlayer(onWhichPlayer, 134); - else - NetMessage.SendData(61, number: this.whoAmI, number2: 134f); - } - else if (sItem.type == 557) - { - if (Main.dayTime) - return; - this.ApplyItemTime(sItem); - SoundEngine.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); - if (Main.netMode != 1) - NPC.SpawnOnPlayer(onWhichPlayer, (int) sbyte.MaxValue); - else - NetMessage.SendData(61, number: this.whoAmI, number2: ((float) sbyte.MaxValue)); - } - else if (sItem.type == 1133) - { - this.ApplyItemTime(sItem); - SoundEngine.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); - if (Main.netMode != 1) - NPC.SpawnOnPlayer(onWhichPlayer, 222); - else - NetMessage.SendData(61, number: this.whoAmI, number2: 222f); - } - else if (sItem.type == 1331) - { - if (!this.ZoneCrimson) - return; - this.ApplyItemTime(sItem); - SoundEngine.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); - if (Main.netMode != 1) - NPC.SpawnOnPlayer(onWhichPlayer, 266); - else - NetMessage.SendData(61, number: this.whoAmI, number2: 266f); - } - else - { - if (sItem.type != 4988 || !this.ZoneHallow) - return; - this.ApplyItemTime(sItem); - SoundEngine.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); - if (Main.netMode != 1) - NPC.SpawnOnPlayer(onWhichPlayer, 657); - else - NetMessage.SendData(61, number: this.whoAmI, number2: 657f); - } - } - - private void ItemCheck_UseEventItems(Item sItem) - { - if (this.ItemTimeIsZero && this.itemAnimation > 0 && sItem.type == 361 && Main.CanStartInvasion(ignoreDelay: true)) - { - this.ApplyItemTime(sItem); - SoundEngine.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); - if (Main.netMode != 1) + sItem.holdStyle = 0; + if (this.itemTime == 0 && this.itemAnimation == 0) { - if (Main.invasionType == 0) + for (int index = 0; index < 1000; ++index) { - Main.invasionDelay = 0; - Main.StartInvasion(); + if (Main.projectile[index].active && Main.projectile[index].owner == this.whoAmI && Main.projectile[index].bobber) + sItem.holdStyle = 1; } } - else - NetMessage.SendData(61, number: this.whoAmI, number2: -1f); } - if (this.ItemTimeIsZero && this.itemAnimation > 0 && sItem.type == 602 && Main.CanStartInvasion(2, true)) + if (this.itemAnimation == 0 && this.reuseDelay > 0) { - this.ApplyItemTime(sItem); - SoundEngine.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); - if (Main.netMode != 1) + this.itemAnimation = this.reuseDelay; + this.itemTime = this.reuseDelay; + this.reuseDelay = 0; + } + if (this.controlUseItem && this.releaseUseItem && (sItem.headSlot > 0 || sItem.bodySlot > 0 || sItem.legSlot > 0)) + { + if (sItem.useStyle == 0) + this.releaseUseItem = false; + if ((double) this.position.X / 16.0 - (double) Player.tileRangeX - (double) sItem.tileBoost <= (double) Player.tileTargetX && ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX + (double) sItem.tileBoost - 1.0 >= (double) Player.tileTargetX && (double) this.position.Y / 16.0 - (double) Player.tileRangeY - (double) sItem.tileBoost <= (double) Player.tileTargetY && ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY + (double) sItem.tileBoost - 2.0 >= (double) Player.tileTargetY) { - if (Main.invasionType == 0) + int tileTargetX = Player.tileTargetX; + int tileTargetY = Player.tileTargetY; + if (Main.tile[tileTargetX, tileTargetY].active() && (Main.tile[tileTargetX, tileTargetY].type == (ushort) 128 || Main.tile[tileTargetX, tileTargetY].type == (ushort) 269)) { - Main.invasionDelay = 0; - Main.StartInvasion(2); - } - } - else - NetMessage.SendData(61, number: this.whoAmI, number2: -2f); - } - if (this.ItemTimeIsZero && this.itemAnimation > 0 && sItem.type == 1315 && Main.CanStartInvasion(3, true)) - { - this.ApplyItemTime(sItem); - SoundEngine.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); - if (Main.netMode != 1) - { - if (Main.invasionType == 0) - { - Main.invasionDelay = 0; - Main.StartInvasion(3); - } - } - else - NetMessage.SendData(61, number: this.whoAmI, number2: -3f); - } - if (this.ItemTimeIsZero && this.itemAnimation > 0 && sItem.type == 1844 && !Main.dayTime && !Main.pumpkinMoon && !Main.snowMoon && !DD2Event.Ongoing) - { - this.ApplyItemTime(sItem); - SoundEngine.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); - if (Main.netMode != 1) - { - Main.NewText(Lang.misc[31].Value, (byte) 50, B: (byte) 130); - Main.startPumpkinMoon(); - } - else - NetMessage.SendData(61, number: this.whoAmI, number2: -4f); - } - if (this.ItemTimeIsZero && this.itemAnimation > 0 && sItem.type == 2767 && Main.dayTime && !Main.eclipse) - { - SoundEngine.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); - this.ApplyItemTime(sItem); - if (Main.netMode == 0) - { - Main.eclipse = true; - Main.NewText(Lang.misc[20].Value, (byte) 50, B: (byte) 130); - } - else - NetMessage.SendData(61, number: this.whoAmI, number2: -6f); - } - if (this.ItemTimeIsZero && this.itemAnimation > 0 && sItem.type == 4271 && !Main.dayTime && !Main.bloodMoon) - { - SoundEngine.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); - this.ApplyItemTime(sItem); - if (Main.netMode == 0) - { - AchievementsHelper.NotifyProgressionEvent(4); - Main.bloodMoon = true; - if (Main.GetMoonPhase() == MoonPhase.Empty) - Main.moonPhase = 5; - Main.NewText(Lang.misc[8].Value, (byte) 50, B: (byte) 130); - } - else - NetMessage.SendData(61, number: this.whoAmI, number2: -10f); - } - if (this.ItemTimeIsZero && this.itemAnimation > 0 && sItem.type == 3601 && NPC.downedGolemBoss && Main.hardMode && !NPC.AnyDanger() && !NPC.AnyoneNearCultists()) - { - SoundEngine.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); - this.ApplyItemTime(sItem); - if (Main.netMode == 0) - WorldGen.StartImpendingDoom(); - else - NetMessage.SendData(61, number: this.whoAmI, number2: -8f); - } - if (!this.ItemTimeIsZero || this.itemAnimation <= 0 || sItem.type != 1958 || Main.dayTime || Main.pumpkinMoon || Main.snowMoon || DD2Event.Ongoing) - return; - this.ApplyItemTime(sItem); - SoundEngine.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); - if (Main.netMode != 1) - { - Main.NewText(Lang.misc[34].Value, (byte) 50, B: (byte) 130); - Main.startSnowMoon(); - } - else - NetMessage.SendData(61, number: this.whoAmI, number2: -5f); - } - - private bool ItemCheck_ReleaseCritter(bool consumptionFailed, Item sItem) - { - if (sItem.makeNPC == (short) 614) - { - this.ApplyItemTime(sItem); - NPC.ReleaseNPC((int) this.Center.X, (int) this.Bottom.Y, (int) sItem.makeNPC, sItem.placeStyle, this.whoAmI); - } - else if ((double) this.position.X / 16.0 - (double) Player.tileRangeX - (double) sItem.tileBoost <= (double) Player.tileTargetX && ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX + (double) sItem.tileBoost - 1.0 >= (double) Player.tileTargetX && (double) this.position.Y / 16.0 - (double) Player.tileRangeY - (double) sItem.tileBoost <= (double) Player.tileTargetY && ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY + (double) sItem.tileBoost - 2.0 >= (double) Player.tileTargetY) - { - int x = Main.mouseX + (int) Main.screenPosition.X; - int y = Main.mouseY + (int) Main.screenPosition.Y; - this.ApplyItemTime(sItem); - if (!WorldGen.SolidTile(x / 16, y / 16)) - NPC.ReleaseNPC(x, y, (int) sItem.makeNPC, sItem.placeStyle, this.whoAmI); - else - consumptionFailed = true; - } - return consumptionFailed; - } - - private void ItemCheck_MeleeHitPVP( - Item sItem, - Microsoft.Xna.Framework.Rectangle itemRectangle, - int damage, - float knockBack) - { - if (!this.hostile) - return; - for (int index1 = 0; index1 < (int) byte.MaxValue; ++index1) - { - Player player = Main.player[index1]; - if ((index1 == this.whoAmI || !player.active || !player.hostile || player.immune ? 0 : (!player.dead ? 1 : 0)) != 0 && (this.team == 0 ? 1 : (this.team != player.team ? 1 : 0)) != 0 && itemRectangle.Intersects(player.Hitbox) && this.CanHit((Entity) player)) - { - bool flag = false; - if (Main.rand.Next(1, 101) <= 10) - flag = true; - int num1 = Main.DamageVar((float) damage, this.luck); - this.StatusToPlayerPvP(sItem.type, index1); - this.OnHit(player.Center.X, player.Center.Y, (Entity) player); - PlayerDeathReason playerDeathReason = PlayerDeathReason.ByPlayer(this.whoAmI); - int num2 = (int) player.Hurt(playerDeathReason, num1, this.direction, true, Crit: flag); - if (this.inventory[this.selectedItem].type == 3211) - { - Vector2 vector2_1 = new Vector2((float) (this.direction * 100 + Main.rand.Next(-25, 26)), (float) Main.rand.Next(-75, 76)); - vector2_1.Normalize(); - vector2_1 *= (float) Main.rand.Next(30, 41) * 0.1f; - Vector2 vector2_2 = new Vector2((float) (itemRectangle.X + Main.rand.Next(itemRectangle.Width)), (float) (itemRectangle.Y + Main.rand.Next(itemRectangle.Height))); - vector2_2 = (vector2_2 + player.Center * 2f) / 3f; - Projectile.NewProjectile(vector2_2.X, vector2_2.Y, vector2_1.X, vector2_1.Y, 524, (int) ((double) damage * 0.7), knockBack * 0.7f, this.whoAmI); - } - if (this.beetleOffense) - { - this.beetleCounter += (float) num2; - this.beetleCountdown = 0; - } - if (this.meleeEnchant == (byte) 7) - Projectile.NewProjectile(player.Center.X, player.Center.Y, player.velocity.X, player.velocity.Y, 289, 0, 0.0f, this.whoAmI); - if (sItem.type == 1123) - { - int num3 = Main.rand.Next(1, 4); - if (this.strongBees && Main.rand.Next(3) == 0) - ++num3; - for (int index2 = 0; index2 < num3; ++index2) - { - float num4 = (float) (this.direction * 2) + (float) Main.rand.Next(-35, 36) * 0.02f; - float num5 = (float) Main.rand.Next(-35, 36) * 0.02f; - float SpeedX = num4 * 0.2f; - float SpeedY = num5 * 0.2f; - Projectile.NewProjectile((float) (itemRectangle.X + itemRectangle.Width / 2), (float) (itemRectangle.Y + itemRectangle.Height / 2), SpeedX, SpeedY, this.beeType(), this.beeDamage(num1 / 3), this.beeKB(0.0f), this.whoAmI); - } - } - if (this.inventory[this.selectedItem].type == 3106) - { - this.stealth = 1f; + int frameY = (int) Main.tile[tileTargetX, tileTargetY].frameY; + int num1 = 0; + if (sItem.bodySlot >= 0) + num1 = 1; + if (sItem.legSlot >= 0) + num1 = 2; + int num2; + for (num2 = frameY / 18; num1 > num2; num2 = (int) Main.tile[tileTargetX, tileTargetY].frameY / 18) + ++tileTargetY; + for (; num1 < num2; num2 = (int) Main.tile[tileTargetX, tileTargetY].frameY / 18) + --tileTargetY; + int frameX1 = (int) Main.tile[tileTargetX, tileTargetY].frameX; + while (frameX1 >= 100) + frameX1 -= 100; + if (frameX1 >= 36) + frameX1 -= 36; + int index = tileTargetX - frameX1 / 18; + int frameX2 = (int) Main.tile[index, tileTargetY].frameX; + WorldGen.KillTile(index, tileTargetY, true); if (Main.netMode == 1) - NetMessage.SendData(84, number: this.whoAmI); - } - if (sItem.type == 1826 && (double) Main.npc[index1].value > 0.0) - this.pumpkinSword(index1, (int) ((double) damage * 1.5), knockBack); - if (Main.netMode != 0) - NetMessage.SendPlayerHurt(index1, playerDeathReason, num1, this.direction, flag, true, -1); - this.attackCD = (int) ((double) this.itemAnimationMax * 0.33); - } - } - } - - public bool HasNPCBannerBuff(int bannerType) => Main.SceneMetrics.NPCBannerBuff[bannerType]; - - private void ItemCheck_MeleeHitNPCs( - Item sItem, - Microsoft.Xna.Framework.Rectangle itemRectangle, - int originalDamage, - float knockBack) - { - for (int index = 0; index < 200; ++index) - { - if (Main.npc[index].active && Main.npc[index].immune[this.whoAmI] == 0 && this.attackCD == 0) - { - NPC npc1 = Main.npc[index]; - npc1.position = npc1.position + Main.npc[index].netOffset; - if (!Main.npc[index].dontTakeDamage && this.CanNPCBeHitByPlayerOrPlayerProjectile(Main.npc[index])) - { - if (!Main.npc[index].friendly || Main.npc[index].type == 22 && this.killGuide || Main.npc[index].type == 54 && this.killClothier) + NetMessage.SendData(17, number2: ((float) index), number3: ((float) tileTargetY), number4: 1f); + while (frameX2 >= 100) + frameX2 -= 100; + if (num2 == 0 && sItem.headSlot >= 0) { - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle((int) Main.npc[index].position.X, (int) Main.npc[index].position.Y, Main.npc[index].width, Main.npc[index].height); - if (itemRectangle.Intersects(rectangle) && (Main.npc[index].noTileCollide || this.CanHit((Entity) Main.npc[index]))) - { - int damage = originalDamage; - bool crit = false; - int weaponCrit = this.GetWeaponCrit(sItem); - if (Main.rand.Next(1, 101) <= weaponCrit) - crit = true; - int num1 = Item.NPCtoBanner(Main.npc[index].BannerID()); - if (num1 > 0 && this.HasNPCBannerBuff(num1)) - damage = !Main.expertMode ? (int) ((double) damage * (double) ItemID.Sets.BannerStrength[Item.BannerToItem(num1)].NormalDamageDealt) : (int) ((double) damage * (double) ItemID.Sets.BannerStrength[Item.BannerToItem(num1)].ExpertDamageDealt); - if (this.parryDamageBuff && sItem.melee) - { - damage *= 5; - this.parryDamageBuff = false; - this.ClearBuff(198); - } - if (sItem.type == 426 && (double) Main.npc[index].life >= (double) Main.npc[index].lifeMax * 0.899999976158142) - damage = (int) ((double) damage * 2.0); - if (sItem.type == 671) - { - float num2 = 1.5f * Utils.GetLerpValue(1f, 0.1f, (float) Main.npc[index].life / (float) Main.npc[index].lifeMax, true); - damage = (int) ((double) damage * (1.0 + (double) num2)); - Vector2 vector2_1 = itemRectangle.Center.ToVector2(); - Vector2 vector2_2 = Main.npc[index].Hitbox.ClosestPointInRect(vector2_1); - ParticleOrchestrator.RequestParticleSpawn(false, ParticleOrchestraType.Keybrand, new ParticleOrchestraSettings() - { - PositionInWorld = vector2_2 - }, new int?(this.whoAmI)); - } - int num3 = Main.DamageVar((float) damage, this.luck); - this.StatusToNPC(sItem.type, index); - if (Main.npc[index].life > 5) - this.OnHit(Main.npc[index].Center.X, Main.npc[index].Center.Y, (Entity) Main.npc[index]); - if (this.armorPenetration > 0) - num3 += Main.npc[index].checkArmorPenetration(this.armorPenetration); - int dmgDone = (int) Main.npc[index].StrikeNPC(num3, knockBack, this.direction, crit); - this.ApplyNPCOnHitEffects(sItem, itemRectangle, damage, knockBack, index, num3, dmgDone); - int num4 = Item.NPCtoBanner(Main.npc[index].BannerID()); - if (num4 >= 0) - this.lastCreatureHit = num4; - if (Main.netMode != 0) - { - if (crit) - NetMessage.SendData(28, number: index, number2: ((float) num3), number3: knockBack, number4: ((float) this.direction), number5: 1); - else - NetMessage.SendData(28, number: index, number2: ((float) num3), number3: knockBack, number4: ((float) this.direction)); - } - if (this.accDreamCatcher) - this.addDPS(num3); - Main.npc[index].immune[this.whoAmI] = this.itemAnimation; - this.attackCD = Math.Max(1, (int) ((double) this.itemAnimationMax * 0.33)); - } - } - } - else if (Main.npc[index].type == 63 || Main.npc[index].type == 64 || Main.npc[index].type == 103 || Main.npc[index].type == 242) - { - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle((int) Main.npc[index].position.X, (int) Main.npc[index].position.Y, Main.npc[index].width, Main.npc[index].height); - if (itemRectangle.Intersects(rectangle) && (Main.npc[index].noTileCollide || this.CanHit((Entity) Main.npc[index]))) - { - this.Hurt(PlayerDeathReason.LegacyDefault(), (int) ((double) Main.npc[index].damage * 1.3), -this.direction); - Main.npc[index].immune[this.whoAmI] = this.itemAnimation; - this.attackCD = (int) ((double) this.itemAnimationMax * 0.33); - } - } - NPC npc2 = Main.npc[index]; - npc2.position = npc2.position - Main.npc[index].netOffset; - } - } - } - - private void ApplyNPCOnHitEffects( - Item sItem, - Microsoft.Xna.Framework.Rectangle itemRectangle, - int damage, - float knockBack, - int npcIndex, - int dmgRandomized, - int dmgDone) - { - bool flag = !Main.npc[npcIndex].immortal; - if (this.inventory[this.selectedItem].type == 3211) - { - Vector2 vector2_1 = new Vector2((float) (this.direction * 100 + Main.rand.Next(-25, 26)), (float) Main.rand.Next(-75, 76)); - vector2_1.Normalize(); - vector2_1 *= (float) Main.rand.Next(30, 41) * 0.1f; - Vector2 vector2_2 = (new Vector2((float) (itemRectangle.X + Main.rand.Next(itemRectangle.Width)), (float) (itemRectangle.Y + Main.rand.Next(itemRectangle.Height))) + Main.npc[npcIndex].Center * 2f) / 3f; - Projectile.NewProjectile(vector2_2.X, vector2_2.Y, vector2_1.X, vector2_1.Y, 524, (int) ((double) damage * 0.7), knockBack * 0.7f, this.whoAmI); - } - if (this.beetleOffense & flag) - { - this.beetleCounter += (float) dmgDone; - this.beetleCountdown = 0; - } - if (sItem.type == 1826 && ((double) Main.npc[npcIndex].value > 0.0 || Main.npc[npcIndex].damage > 0 && !Main.npc[npcIndex].friendly)) - this.pumpkinSword(npcIndex, (int) ((double) damage * 1.5), knockBack); - if (this.meleeEnchant == (byte) 7) - Projectile.NewProjectile(Main.npc[npcIndex].Center.X, Main.npc[npcIndex].Center.Y, Main.npc[npcIndex].velocity.X, Main.npc[npcIndex].velocity.Y, 289, 0, 0.0f, this.whoAmI); - if (this.inventory[this.selectedItem].type == 3106) - { - this.stealth = 1f; - if (Main.netMode == 1) - NetMessage.SendData(84, number: this.whoAmI); - } - if (sItem.type == 1123 & flag) - { - int num1 = Main.rand.Next(1, 4); - if (this.strongBees && Main.rand.Next(3) == 0) - ++num1; - for (int index = 0; index < num1; ++index) - { - float num2 = (float) (this.direction * 2) + (float) Main.rand.Next(-35, 36) * 0.02f; - float num3 = (float) Main.rand.Next(-35, 36) * 0.02f; - float SpeedX = num2 * 0.2f; - float SpeedY = num3 * 0.2f; - Projectile.NewProjectile((float) (itemRectangle.X + itemRectangle.Width / 2), (float) (itemRectangle.Y + itemRectangle.Height / 2), SpeedX, SpeedY, this.beeType(), this.beeDamage(dmgRandomized / 3), this.beeKB(0.0f), this.whoAmI); - } - } - if ((double) Main.npc[npcIndex].value <= 0.0 || !this.coins || Main.rand.Next(5) != 0) - return; - int Type = 71; - if (Main.rand.Next(10) == 0) - Type = 72; - if (Main.rand.Next(100) == 0) - Type = 73; - int number = Item.NewItem((int) Main.npc[npcIndex].position.X, (int) Main.npc[npcIndex].position.Y, Main.npc[npcIndex].width, Main.npc[npcIndex].height, Type); - Main.item[number].stack = Main.rand.Next(1, 11); - Main.item[number].velocity.Y = (float) Main.rand.Next(-20, 1) * 0.2f; - Main.item[number].velocity.X = (float) Main.rand.Next(10, 31) * 0.2f * (float) this.direction; - if (Main.netMode != 1) - return; - NetMessage.SendData(21, number: number); - } - - private void ItemCheck_EmitHammushProjectiles( - int i, - Item sItem, - Microsoft.Xna.Framework.Rectangle itemRectangle, - int damage) - { - if (sItem.type != 787) - return; - int itemAnimationMax = this.itemAnimationMax; - if (this.itemAnimation != (int) ((double) itemAnimationMax * 0.1) && this.itemAnimation != (int) ((double) itemAnimationMax * 0.3) && this.itemAnimation != (int) ((double) itemAnimationMax * 0.5) && this.itemAnimation != (int) ((double) itemAnimationMax * 0.7) && this.itemAnimation != (int) ((double) itemAnimationMax * 0.9)) - return; - float num1 = 0.0f; - float num2 = 0.0f; - float num3 = 0.0f; - float num4 = 0.0f; - if (this.itemAnimation == (int) ((double) itemAnimationMax * 0.9)) - num1 = -7f; - if (this.itemAnimation == (int) ((double) itemAnimationMax * 0.7)) - { - num1 = -6f; - num2 = 2f; - } - if (this.itemAnimation == (int) ((double) itemAnimationMax * 0.5)) - { - num1 = -4f; - num2 = 4f; - } - if (this.itemAnimation == (int) ((double) itemAnimationMax * 0.3)) - { - num1 = -2f; - num2 = 6f; - } - if (this.itemAnimation == (int) ((double) itemAnimationMax * 0.1)) - num2 = 7f; - if (this.itemAnimation == (int) ((double) itemAnimationMax * 0.7)) - num4 = 26f; - if (this.itemAnimation == (int) ((double) itemAnimationMax * 0.3)) - { - num4 -= 4f; - num3 -= 20f; - } - if (this.itemAnimation == (int) ((double) itemAnimationMax * 0.1)) - num3 += 6f; - if (this.direction == -1) - { - if (this.itemAnimation == (int) ((double) itemAnimationMax * 0.9)) - num4 -= 8f; - if (this.itemAnimation == (int) ((double) itemAnimationMax * 0.7)) - num4 -= 6f; - } - float num5 = num1 * 1.5f; - float num6 = num2 * 1.5f; - float num7 = num4 * (float) this.direction; - float num8 = num3 * this.gravDir; - Projectile.NewProjectile((float) (itemRectangle.X + itemRectangle.Width / 2) + num7, (float) (itemRectangle.Y + itemRectangle.Height / 2) + num8, (float) this.direction * num6, num5 * this.gravDir, 131, damage / 2, 0.0f, i); - } - - private static List ItemCheck_GetTileCutIgnoreList(Item sItem) - { - List ushortList = (List) null; - if (sItem.type == 213) - ushortList = new List((IEnumerable) new ushort[23] - { - (ushort) 3, - (ushort) 24, - (ushort) 52, - (ushort) 61, - (ushort) 62, - (ushort) 71, - (ushort) 73, - (ushort) 74, - (ushort) 82, - (ushort) 83, - (ushort) 84, - (ushort) 110, - (ushort) 113, - (ushort) 115, - (ushort) 184, - (ushort) 205, - (ushort) 201, - (ushort) 519, - (ushort) 518, - (ushort) 528, - (ushort) 529, - (ushort) 530, - (ushort) 549 - }); - return ushortList; - } - - private static void ItemCheck_CutTiles( - Item sItem, - Microsoft.Xna.Framework.Rectangle itemRectangle, - List ignoreList) - { - int minX = itemRectangle.X / 16; - int maxX = (itemRectangle.X + itemRectangle.Width) / 16 + 1; - int minY = itemRectangle.Y / 16; - int maxY = (itemRectangle.Y + itemRectangle.Height) / 16 + 1; - Utils.ClampWithinWorld(ref minX, ref minY, ref maxX, ref maxY); - for (int index1 = minX; index1 < maxX; ++index1) - { - for (int index2 = minY; index2 < maxY; ++index2) - { - if (Main.tile[index1, index2] != null && Main.tileCut[(int) Main.tile[index1, index2].type] && (ignoreList == null || !ignoreList.Contains(Main.tile[index1, index2].type)) && WorldGen.CanCutTile(index1, index2, TileCuttingContext.AttackMelee)) - { - if (sItem.type == 1786) - { - int type = (int) Main.tile[index1, index2].type; - WorldGen.KillTile(index1, index2); - if (!Main.tile[index1, index2].active()) - { - int Stack = 0; - if (type == 3 || type == 24 || type == 61 || type == 110 || type == 201) - Stack = Main.rand.Next(1, 3); - if (type == 73 || type == 74 || type == 113) - Stack = Main.rand.Next(2, 5); - if (Stack > 0) - { - int number = Item.NewItem(index1 * 16, index2 * 16, 16, 16, 1727, Stack); - if (Main.netMode == 1) - NetMessage.SendData(21, number: number, number2: 1f); - } - } + Main.blockMouse = true; + Main.tile[index, tileTargetY].frameX = (short) (frameX2 + sItem.headSlot * 100); if (Main.netMode == 1) - NetMessage.SendData(17, number2: ((float) index1), number3: ((float) index2)); + NetMessage.SendTileSquare(-1, index, tileTargetY, 1); + --sItem.stack; + if (sItem.stack <= 0) + { + sItem.SetDefaults(); + Main.mouseItem.SetDefaults(); + } + if (this.selectedItem == 58) + Main.mouseItem = sItem.Clone(); + this.releaseUseItem = false; + this.mouseInterface = true; } - else + else if (num2 == 1 && sItem.bodySlot >= 0) { - WorldGen.KillTile(index1, index2); + Main.blockMouse = true; + Main.tile[index, tileTargetY].frameX = (short) (frameX2 + sItem.bodySlot * 100); if (Main.netMode == 1) - NetMessage.SendData(17, number2: ((float) index1), number3: ((float) index2)); - } - } - } - } - } - - private Microsoft.Xna.Framework.Rectangle ItemCheck_CatchCritters( - Item sItem, - Microsoft.Xna.Framework.Rectangle itemRectangle) - { - bool flag = sItem.type == 3183 || sItem.type == 4821; - for (int index = 0; index < 200; ++index) - { - if (Main.npc[index].active && Main.npc[index].catchItem > (short) 0) - { - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle((int) Main.npc[index].position.X, (int) Main.npc[index].position.Y, Main.npc[index].width, Main.npc[index].height); - if (itemRectangle.Intersects(rectangle)) - { - if (!flag && ItemID.Sets.IsLavaBait[(int) Main.npc[index].catchItem]) - { - if (Main.myPlayer == this.whoAmI) + NetMessage.SendTileSquare(-1, index, tileTargetY, 1); + --sItem.stack; + if (sItem.stack <= 0) { - this.Hurt(PlayerDeathReason.ByNPC(index), 1, (double) Main.npc[index].Center.X < (double) this.Center.X ? 1 : -1, cooldownCounter: 3); - this.AddBuff(24, 300, false); + sItem.SetDefaults(); + Main.mouseItem.SetDefaults(); } + if (this.selectedItem == 58) + Main.mouseItem = sItem.Clone(); + this.releaseUseItem = false; + this.mouseInterface = true; } - else if (Main.npc[index].type == 585 || Main.npc[index].type == 583 || Main.npc[index].type == 584) + else if (num2 == 2 && sItem.legSlot >= 0 && !ArmorIDs.Legs.Sets.MannequinIncompatible.Contains(sItem.legSlot)) { - if ((double) Main.npc[index].ai[2] <= 1.0) - NPC.CatchNPC(index, this.whoAmI); - } - else - NPC.CatchNPC(index, this.whoAmI); - } - } - } - return itemRectangle; - } - - private Microsoft.Xna.Framework.Rectangle ItemCheck_EmitUseVisuals( - Item sItem, - Microsoft.Xna.Framework.Rectangle itemRectangle) - { - if (sItem.type == 989 && Main.rand.Next(5) == 0) - { - int Type; - switch (Main.rand.Next(3)) - { - case 0: - Type = 15; - break; - case 1: - Type = 57; - break; - default: - Type = 58; - break; - } - int index = Dust.NewDust(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), itemRectangle.Width, itemRectangle.Height, Type, (float) (this.direction * 2), Alpha: 150, Scale: 1.3f); - Main.dust[index].velocity *= 0.2f; - } - if (sItem.type == 2880 && Main.rand.Next(2) == 0) - { - int Type = Utils.SelectRandom(Main.rand, 226, 229); - int index = Dust.NewDust(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), itemRectangle.Width, itemRectangle.Height, Type, (float) (this.direction * 2), Alpha: 150); - Main.dust[index].velocity *= 0.2f; - Main.dust[index].noGravity = true; - } - if ((sItem.type == 44 || sItem.type == 45 || sItem.type == 46 || sItem.type == 103 || sItem.type == 104) && Main.rand.Next(15) == 0) - Dust.NewDust(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), itemRectangle.Width, itemRectangle.Height, 14, (float) (this.direction * 2), Alpha: 150, Scale: 1.3f); - if (sItem.type == 273 || sItem.type == 675) - { - if (Main.rand.Next(5) == 0) - Dust.NewDust(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), itemRectangle.Width, itemRectangle.Height, 14, (float) (this.direction * 2), Alpha: 150, Scale: 1.4f); - int index = Dust.NewDust(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), itemRectangle.Width, itemRectangle.Height, 27, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 1.2f); - Main.dust[index].noGravity = true; - Main.dust[index].velocity.X /= 2f; - Main.dust[index].velocity.Y /= 2f; - } - if (sItem.type == 723 && Main.rand.Next(2) == 0) - { - int index = Dust.NewDust(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), itemRectangle.Width, itemRectangle.Height, 64, Alpha: 150, Scale: 1.2f); - Main.dust[index].noGravity = true; - } - if (sItem.type == 65) - { - if (Main.rand.Next(5) == 0) - Dust.NewDust(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), itemRectangle.Width, itemRectangle.Height, 58, Alpha: 150, Scale: 1.2f); - if (Main.rand.Next(10) == 0) - Gore.NewGore(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), new Vector2(), Main.rand.Next(16, 18)); - } - if (sItem.type == 3065) - { - int index1 = Dust.NewDust(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), itemRectangle.Width, itemRectangle.Height, 58, Alpha: 150, Scale: 1.2f); - Main.dust[index1].velocity *= 0.5f; - if (Main.rand.Next(8) == 0) - { - int index2 = Gore.NewGore(new Vector2((float) itemRectangle.Center.X, (float) itemRectangle.Center.Y), new Vector2(), 16); - Main.gore[index2].velocity *= 0.5f; - Main.gore[index2].velocity += new Vector2((float) this.direction, 0.0f); - } - } - if (sItem.type == 190) - { - int index = Dust.NewDust(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), itemRectangle.Width, itemRectangle.Height, 40, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, Scale: 1.2f); - Main.dust[index].noGravity = true; - } - else if (sItem.type == 213) - { - int index = Dust.NewDust(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), itemRectangle.Width, itemRectangle.Height, 3, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, Scale: 1.2f); - Main.dust[index].noGravity = true; - } - if (sItem.type == 121) - { - for (int index3 = 0; index3 < 2; ++index3) - { - int index4 = Dust.NewDust(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), itemRectangle.Width, itemRectangle.Height, 6, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 2.5f); - Main.dust[index4].noGravity = true; - Main.dust[index4].velocity.X *= 2f; - Main.dust[index4].velocity.Y *= 2f; - } - } - if (sItem.type == 122 || sItem.type == 217) - { - int index = Dust.NewDust(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), itemRectangle.Width, itemRectangle.Height, 6, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 1.9f); - Main.dust[index].noGravity = true; - } - if (sItem.type == 155) - { - int index = Dust.NewDust(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), itemRectangle.Width, itemRectangle.Height, 172, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 0.9f); - Main.dust[index].noGravity = true; - Main.dust[index].velocity *= 0.1f; - } - if (sItem.type == 676 && Main.rand.Next(3) == 0) - { - int index = Dust.NewDust(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), itemRectangle.Width, itemRectangle.Height, 67, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 90, Scale: 1.5f); - Main.dust[index].noGravity = true; - Main.dust[index].velocity *= 0.2f; - } - if (sItem.type == 3063) - { - int index = Dust.NewDust(itemRectangle.TopLeft(), itemRectangle.Width, itemRectangle.Height, 66, Alpha: 150, newColor: Color.Transparent, Scale: 0.85f); - Main.dust[index].color = Main.hslToRgb(Main.rand.NextFloat(), 1f, 0.5f); - Main.dust[index].noGravity = true; - Main.dust[index].velocity /= 2f; - } - if (sItem.type == 3823) - { - Dust dust = Dust.NewDustDirect(itemRectangle.TopLeft(), itemRectangle.Width, itemRectangle.Height, 6, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Color.Transparent, 0.7f); - dust.noGravity = true; - dust.velocity *= 2f; - dust.fadeIn = 0.9f; - } - if (sItem.type == 724 && Main.rand.Next(5) == 0) - { - int index = Dust.NewDust(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), itemRectangle.Width, itemRectangle.Height, 67, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 90, Scale: 1.5f); - Main.dust[index].noGravity = true; - Main.dust[index].velocity *= 0.2f; - } - if (sItem.type >= 795 && sItem.type <= 802 && Main.rand.Next(3) == 0) - { - int index = Dust.NewDust(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), itemRectangle.Width, itemRectangle.Height, 115, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 140, Scale: 1.5f); - Main.dust[index].noGravity = true; - Main.dust[index].velocity *= 0.25f; - } - if (sItem.type == 367 || sItem.type == 368 || sItem.type == 674) - { - if (Main.rand.Next(3) == 0) - { - int index = Dust.NewDust(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), itemRectangle.Width, itemRectangle.Height, 57, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 1.1f); - Main.dust[index].noGravity = true; - Main.dust[index].velocity.X /= 2f; - Main.dust[index].velocity.Y /= 2f; - Main.dust[index].velocity.X += (float) (this.direction * 2); - } - if (Main.rand.Next(4) == 0) - { - int index = Dust.NewDust(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), itemRectangle.Width, itemRectangle.Height, 43, Alpha: 254, Scale: 0.3f); - Main.dust[index].velocity *= 0.0f; - } - } - if (sItem.type == 4258 || sItem.type == 4259 || sItem.type >= 198 && sItem.type <= 203 || sItem.type >= 3764 && sItem.type <= 3769) - { - float r = 0.5f; - float g = 0.5f; - float b = 0.5f; - if (sItem.type == 198 || sItem.type == 3764) - { - r *= 0.1f; - g *= 0.5f; - b *= 1.2f; - } - else if (sItem.type == 199 || sItem.type == 3765) - { - r *= 1f; - g *= 0.2f; - b *= 0.1f; - } - else if (sItem.type == 200 || sItem.type == 3766) - { - r *= 0.1f; - g *= 1f; - b *= 0.2f; - } - else if (sItem.type == 201 || sItem.type == 3767) - { - r *= 0.8f; - g *= 0.1f; - b *= 1f; - } - else if (sItem.type == 202 || sItem.type == 3768) - { - r *= 0.8f; - g *= 0.9f; - b *= 1f; - } - else if (sItem.type == 203 || sItem.type == 3769) - { - r *= 0.8f; - g *= 0.8f; - b *= 0.0f; - } - else if (sItem.type == 4258 || sItem.type == 4259) - { - r *= 0.9f; - g *= 0.5f; - b *= 0.0f; - } - Lighting.AddLight((int) (((double) this.itemLocation.X + 6.0 + (double) this.velocity.X) / 16.0), (int) (((double) this.itemLocation.Y - 14.0) / 16.0), r, g, b); - } - if (this.frostBurn && sItem.melee && !sItem.noMelee && !sItem.noUseGraphic && Main.rand.Next(2) == 0) - { - int index = Dust.NewDust(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), itemRectangle.Width, itemRectangle.Height, 135, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 2.5f); - Main.dust[index].noGravity = true; - Main.dust[index].velocity *= 0.7f; - Main.dust[index].velocity.Y -= 0.5f; - } - if (sItem.melee && !sItem.noMelee && !sItem.noUseGraphic && this.meleeEnchant > (byte) 0) - { - if (this.meleeEnchant == (byte) 1) - { - if (Main.rand.Next(3) == 0) - { - int index = Dust.NewDust(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), itemRectangle.Width, itemRectangle.Height, 171, Alpha: 100); - Main.dust[index].noGravity = true; - Main.dust[index].fadeIn = 1.5f; - Main.dust[index].velocity *= 0.25f; - } - } - else if (this.meleeEnchant == (byte) 2) - { - if (Main.rand.Next(2) == 0) - { - int index = Dust.NewDust(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), itemRectangle.Width, itemRectangle.Height, 75, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 2.5f); - Main.dust[index].noGravity = true; - Main.dust[index].velocity *= 0.7f; - Main.dust[index].velocity.Y -= 0.5f; - } - } - else if (this.meleeEnchant == (byte) 3) - { - if (Main.rand.Next(2) == 0) - { - int index = Dust.NewDust(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), itemRectangle.Width, itemRectangle.Height, 6, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 2.5f); - Main.dust[index].noGravity = true; - Main.dust[index].velocity *= 0.7f; - Main.dust[index].velocity.Y -= 0.5f; - } - } - else if (this.meleeEnchant == (byte) 4) - { - if (Main.rand.Next(2) == 0) - { - int index = Dust.NewDust(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), itemRectangle.Width, itemRectangle.Height, 57, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 1.1f); - Main.dust[index].noGravity = true; - Main.dust[index].velocity.X /= 2f; - Main.dust[index].velocity.Y /= 2f; - } - } - else if (this.meleeEnchant == (byte) 5) - { - if (Main.rand.Next(2) == 0) - { - int index = Dust.NewDust(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), itemRectangle.Width, itemRectangle.Height, 169, Alpha: 100); - Main.dust[index].velocity.X += (float) this.direction; - Main.dust[index].velocity.Y += 0.2f; - Main.dust[index].noGravity = true; - } - } - else if (this.meleeEnchant == (byte) 6) - { - if (Main.rand.Next(2) == 0) - { - int index = Dust.NewDust(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), itemRectangle.Width, itemRectangle.Height, 135, Alpha: 100); - Main.dust[index].velocity.X += (float) this.direction; - Main.dust[index].velocity.Y += 0.2f; - Main.dust[index].noGravity = true; - } - } - else if (this.meleeEnchant == (byte) 7) - { - if (Main.rand.Next(20) == 0) - { - int Type = Main.rand.Next(139, 143); - int index = Dust.NewDust(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), itemRectangle.Width, itemRectangle.Height, Type, this.velocity.X, this.velocity.Y, Scale: 1.2f); - Main.dust[index].velocity.X *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); - Main.dust[index].velocity.Y *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); - Main.dust[index].velocity.X += (float) Main.rand.Next(-50, 51) * 0.05f; - Main.dust[index].velocity.Y += (float) Main.rand.Next(-50, 51) * 0.05f; - Main.dust[index].scale *= (float) (1.0 + (double) Main.rand.Next(-30, 31) * 0.00999999977648258); - } - if (Main.rand.Next(40) == 0) - { - int Type = Main.rand.Next(276, 283); - int index = Gore.NewGore(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), this.velocity, Type); - Main.gore[index].velocity.X *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); - Main.gore[index].velocity.Y *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); - Main.gore[index].scale *= (float) (1.0 + (double) Main.rand.Next(-20, 21) * 0.00999999977648258); - Main.gore[index].velocity.X += (float) Main.rand.Next(-50, 51) * 0.05f; - Main.gore[index].velocity.Y += (float) Main.rand.Next(-50, 51) * 0.05f; - } - } - else if (this.meleeEnchant == (byte) 8 && Main.rand.Next(4) == 0) - { - int index = Dust.NewDust(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), itemRectangle.Width, itemRectangle.Height, 46, Alpha: 100); - Main.dust[index].noGravity = true; - Main.dust[index].fadeIn = 1.5f; - Main.dust[index].velocity *= 0.25f; - } - } - if (this.magmaStone && sItem.melee && !sItem.noMelee && !sItem.noUseGraphic && Main.rand.Next(3) != 0) - { - int index = Dust.NewDust(new Vector2((float) itemRectangle.X, (float) itemRectangle.Y), itemRectangle.Width, itemRectangle.Height, 6, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 2.5f); - Main.dust[index].noGravity = true; - Main.dust[index].velocity.X *= 2f; - Main.dust[index].velocity.Y *= 2f; - } - return itemRectangle; - } - - private void ItemCheck_GetMeleeHitbox( - Item sItem, - Microsoft.Xna.Framework.Rectangle heldItemFrame, - out bool dontAttack, - out Microsoft.Xna.Framework.Rectangle itemRectangle) - { - dontAttack = false; - itemRectangle = new Microsoft.Xna.Framework.Rectangle((int) this.itemLocation.X, (int) this.itemLocation.Y, 32, 32); - if (!Main.dedServ) - itemRectangle = new Microsoft.Xna.Framework.Rectangle((int) this.itemLocation.X, (int) this.itemLocation.Y, heldItemFrame.Width, heldItemFrame.Height); - itemRectangle.Width = (int) ((double) itemRectangle.Width * (double) sItem.scale); - itemRectangle.Height = (int) ((double) itemRectangle.Height * (double) sItem.scale); - if (this.direction == -1) - itemRectangle.X -= itemRectangle.Width; - if ((double) this.gravDir == 1.0) - itemRectangle.Y -= itemRectangle.Height; - if (sItem.useStyle == 1) - { - if ((double) this.itemAnimation < (double) this.itemAnimationMax * 0.333) - { - if (this.direction == -1) - itemRectangle.X -= (int) ((double) itemRectangle.Width * 1.4 - (double) itemRectangle.Width); - itemRectangle.Width = (int) ((double) itemRectangle.Width * 1.4); - itemRectangle.Y += (int) ((double) itemRectangle.Height * 0.5 * (double) this.gravDir); - itemRectangle.Height = (int) ((double) itemRectangle.Height * 1.1); - } - else if ((double) this.itemAnimation >= (double) this.itemAnimationMax * 0.666) - { - if (this.direction == 1) - itemRectangle.X -= (int) ((double) itemRectangle.Width * 1.2); - itemRectangle.Width *= 2; - itemRectangle.Y -= (int) (((double) itemRectangle.Height * 1.4 - (double) itemRectangle.Height) * (double) this.gravDir); - itemRectangle.Height = (int) ((double) itemRectangle.Height * 1.4); - } - } - else if (sItem.useStyle == 3) - { - if ((double) this.itemAnimation > (double) this.itemAnimationMax * 0.666) - { - dontAttack = true; - } - else - { - if (this.direction == -1) - itemRectangle.X -= (int) ((double) itemRectangle.Width * 1.4 - (double) itemRectangle.Width); - itemRectangle.Width = (int) ((double) itemRectangle.Width * 1.4); - itemRectangle.Y += (int) ((double) itemRectangle.Height * 0.6); - itemRectangle.Height = (int) ((double) itemRectangle.Height * 0.6); - if (sItem.type == 946 || sItem.type == 4707) - { - itemRectangle.Height += 14; - itemRectangle.Width -= 10; - if (this.direction == -1) - itemRectangle.X += 10; - } - } - } - if (sItem.type == 1450 && Main.rand.Next(3) == 0) - { - int index = -1; - float x = (float) (itemRectangle.X + Main.rand.Next(itemRectangle.Width)); - float y = (float) (itemRectangle.Y + Main.rand.Next(itemRectangle.Height)); - if (Main.rand.Next(500) == 0) - index = Gore.NewGore(new Vector2(x, y), new Vector2(), 415, (float) Main.rand.Next(51, 101) * 0.01f); - else if (Main.rand.Next(250) == 0) - index = Gore.NewGore(new Vector2(x, y), new Vector2(), 414, (float) Main.rand.Next(51, 101) * 0.01f); - else if (Main.rand.Next(80) == 0) - index = Gore.NewGore(new Vector2(x, y), new Vector2(), 413, (float) Main.rand.Next(51, 101) * 0.01f); - else if (Main.rand.Next(10) == 0) - index = Gore.NewGore(new Vector2(x, y), new Vector2(), 412, (float) Main.rand.Next(51, 101) * 0.01f); - else if (Main.rand.Next(3) == 0) - index = Gore.NewGore(new Vector2(x, y), new Vector2(), 411, (float) Main.rand.Next(51, 101) * 0.01f); - if (index >= 0) - { - Main.gore[index].velocity.X += (float) (this.direction * 2); - Main.gore[index].velocity.Y *= 0.3f; - } - } - if (sItem.type == 3542) - dontAttack = true; - if (sItem.type != 3779) - return; - dontAttack = true; - Vector2 vector2_1 = this.itemLocation + new Vector2((float) (this.direction * 30), -8f); - Vector2 vector2_2 = vector2_1 - this.position; - for (float amount = 0.0f; (double) amount < 1.0; amount += 0.2f) - { - Vector2 vector2_3 = Vector2.Lerp(this.oldPosition + vector2_2 + new Vector2(0.0f, this.gfxOffY), vector2_1, amount); - Dust dust = Main.dust[Dust.NewDust(vector2_1 - Vector2.One * 8f, 16, 16, 27, SpeedY: -2f)]; - dust.noGravity = true; - dust.position = vector2_3; - dust.velocity = new Vector2(0.0f, (float) (-(double) this.gravDir * 2.0)); - dust.scale = 1.2f; - dust.alpha = 200; - } - } - - private void ItemCheck_UseDemonHeart(Item sItem) - { - if (sItem.type != 3335 || this.itemAnimation <= 0 || this.extraAccessory || !Main.expertMode || !this.ItemTimeIsZero) - return; - this.ApplyItemTime(sItem); - this.extraAccessory = true; - NetMessage.SendData(4, number: this.whoAmI); - } - - private void ItemCheck_UseTorchGodsFavor(Item sItem) - { - if (sItem.type != 5043 || this.itemAnimation <= 0 || this.unlockedBiomeTorches || !this.ItemTimeIsZero) - return; - this.ApplyItemTime(sItem); - this.unlockedBiomeTorches = true; - this.UsingBiomeTorches = true; - NetMessage.SendData(4, number: this.whoAmI); - } - - private void ItemCheck_UseManaCrystal(Item sItem) - { - if (sItem.type != 109 || this.itemAnimation <= 0 || this.statManaMax >= 200 || !this.ItemTimeIsZero) - return; - this.ApplyItemTime(sItem); - this.statManaMax += 20; - this.statManaMax2 += 20; - this.statMana += 20; - if (Main.myPlayer == this.whoAmI) - this.ManaEffect(20); - AchievementsHelper.HandleSpecialEvent(this, 1); - } - - private void ItemCheck_UseLifeFruit(Item sItem) - { - if (sItem.type != 1291 || this.itemAnimation <= 0 || this.statLifeMax < 400 || this.statLifeMax >= 500 || !this.ItemTimeIsZero) - return; - this.ApplyItemTime(sItem); - this.statLifeMax += 5; - this.statLifeMax2 += 5; - this.statLife += 5; - if (Main.myPlayer == this.whoAmI) - this.HealEffect(5); - AchievementsHelper.HandleSpecialEvent(this, 2); - } - - private void ItemCheck_UseLifeCrystal(Item sItem) - { - if (sItem.type != 29 || this.itemAnimation <= 0 || this.statLifeMax >= 400 || !this.ItemTimeIsZero) - return; - this.ApplyItemTime(sItem); - this.statLifeMax += 20; - this.statLifeMax2 += 20; - this.statLife += 20; - if (Main.myPlayer == this.whoAmI) - this.HealEffect(20); - AchievementsHelper.HandleSpecialEvent(this, 0); - } - - private void ItemCheck_UseCombatBook(Item sItem) - { - if (NPC.combatBookWasUsed || sItem.type != 4382 || this.itemAnimation <= 0 || !this.ItemTimeIsZero) - return; - this.ApplyItemTime(sItem); - if (Main.netMode == 0) - { - NPC.combatBookWasUsed = true; - Main.NewText(Language.GetTextValue("Misc.CombatBookUsed"), (byte) 50, B: (byte) 130); - } - else - NetMessage.SendData(61, number: this.whoAmI, number2: -11f); - } - - private void ItemCheck_UsePetLicenses(Item sItem) - { - if (sItem.type == 4829 && !NPC.boughtCat && this.itemAnimation > 0 && this.ItemTimeIsZero) - { - this.ApplyItemTime(sItem); - if (Main.netMode == 0) - { - NPC.boughtCat = true; - Main.NewText(Language.GetTextValue("Misc.LicenseCatUsed"), (byte) 50, B: (byte) 130); - } - else - NetMessage.SendData(61, number: this.whoAmI, number2: -12f); - } - if (sItem.type == 4830 && !NPC.boughtDog && this.itemAnimation > 0 && this.ItemTimeIsZero) - { - this.ApplyItemTime(sItem); - if (Main.netMode == 0) - { - NPC.boughtDog = true; - Main.NewText(Language.GetTextValue("Misc.LicenseDogUsed"), (byte) 50, B: (byte) 130); - } - else - NetMessage.SendData(61, number: this.whoAmI, number2: -13f); - } - if (sItem.type != 4910 || NPC.boughtBunny || this.itemAnimation <= 0 || !this.ItemTimeIsZero) - return; - this.ApplyItemTime(sItem); - if (Main.netMode == 0) - { - NPC.boughtBunny = true; - Main.NewText(Language.GetTextValue("Misc.LicenseBunnyUsed"), (byte) 50, B: (byte) 130); - } - else - NetMessage.SendData(61, number: this.whoAmI, number2: -14f); - } - - private void ItemCheck_UseRodOfDiscord(Item sItem) - { - if (Main.myPlayer != this.whoAmI || sItem.type != 1326 || this.itemAnimation <= 0 || !this.ItemTimeIsZero) - return; - this.ApplyItemTime(sItem); - Vector2 vector2; - vector2.X = (float) Main.mouseX + Main.screenPosition.X; - vector2.Y = (double) this.gravDir != 1.0 ? Main.screenPosition.Y + (float) Main.screenHeight - (float) Main.mouseY : (float) Main.mouseY + Main.screenPosition.Y - (float) this.height; - vector2.X -= (float) (this.width / 2); - if ((double) vector2.X <= 50.0 || (double) vector2.X >= (double) (Main.maxTilesX * 16 - 50) || (double) vector2.Y <= 50.0 || (double) vector2.Y >= (double) (Main.maxTilesY * 16 - 50)) - return; - int index1 = (int) ((double) vector2.X / 16.0); - int index2 = (int) ((double) vector2.Y / 16.0); - if (Main.tile[index1, index2].wall == (ushort) 87 && (double) index2 > Main.worldSurface && !NPC.downedPlantBoss || Collision.SolidCollision(vector2, this.width, this.height)) - return; - this.Teleport(vector2, 1); - NetMessage.SendData(65, number2: ((float) this.whoAmI), number3: vector2.X, number4: vector2.Y, number5: 1); - if (this.chaosState) - { - this.statLife -= this.statLifeMax2 / 7; - PlayerDeathReason damageSource = PlayerDeathReason.ByOther(13); - if (Main.rand.Next(2) == 0) - damageSource = PlayerDeathReason.ByOther(this.Male ? 14 : 15); - if (this.statLife <= 0) - this.KillMe(damageSource, 1.0, 0); - this.lifeRegenCount = 0; - this.lifeRegenTime = 0; - } - this.AddBuff(88, 360); - } - - private bool IsTilePoundable(Tile targetTile) => !Main.tileHammer[(int) targetTile.type] && !Main.tileSolid[(int) targetTile.type] && targetTile.type != (ushort) 314 && targetTile.type != (ushort) 424 && targetTile.type != (ushort) 442 && targetTile.type != (ushort) 351; - - private void UseShovel(Player user, Item item, int sX, int sY) - { - for (int x = sX - 1; x <= sX + 1; ++x) - { - for (int y = sY - 1; y <= sY + 1; ++y) - this.DamageTileWithShovel(user, item, x, y); - } - this.itemTime = (int) ((double) item.useTime * (double) this.pickSpeed); - } - - private void DamageTileWithShovel(Player user, Item item, int x, int y) - { - Tile tileSafely = Framing.GetTileSafely(x, y); - if (!TileID.Sets.CanBeDugByShovel[(int) tileSafely.type]) - return; - int pickPower = 30; - if (tileSafely.active() && TileID.Sets.Conversion.Grass[(int) tileSafely.type]) - this.PickTile(x, y, 100); - this.PickTile(x, y, pickPower); - } - - private void ItemCheck_UseMiningTools(Item sItem) - { - Player.SpecialToolUsageSettings toolUsageSettings = new Player.SpecialToolUsageSettings(); - if (sItem.type == 4711) - toolUsageSettings = new Player.SpecialToolUsageSettings() - { - IsAValidTool = true, - UsageAction = new Player.SpecialToolUsageSettings.UseToolAction(this.UseShovel) - }; - if ((sItem.pick > 0 || sItem.axe > 0 || sItem.hammer > 0 ? 1 : (toolUsageSettings.IsAValidTool ? 1 : 0)) == 0) - return; - bool flag = this.IsTargetTileInItemRange(sItem); - if (this.noBuilding) - flag = false; - if (flag && toolUsageSettings.UsageCondition != null) - flag = toolUsageSettings.UsageCondition(this, sItem, Player.tileTargetX, Player.tileTargetY); - if (this.toolTime == 0 && this.itemAnimation > 0 && this.controlUseItem) - { - Tile targetTile = Main.tile[Player.tileTargetX, Player.tileTargetY]; - if (!targetTile.active() || this.IsTilePoundable(targetTile)) - this.poundRelease = false; - } - if (!flag) - return; - if (!Main.GamepadDisableCursorItemIcon) - { - this.cursorItemIconEnabled = true; - Main.ItemIconCacheUpdate(sItem.type); - } - bool canHitWalls = false; - if (this.toolTime == 0 && this.itemAnimation > 0 && this.controlUseItem) - { - if (toolUsageSettings.UsageAction != null) - { - toolUsageSettings.UsageAction(this, sItem, Player.tileTargetX, Player.tileTargetY); - return; - } - this.ItemCheck_UseMiningTools_ActuallyUseMiningTool(sItem, out canHitWalls, Player.tileTargetX, Player.tileTargetY); - } - if (this.releaseUseItem) - this.poundRelease = true; - if (this.toolTime != 0 || this.itemAnimation <= 0 || !this.controlUseItem || !canHitWalls) - return; - int wX; - int wY; - Player.ItemCheck_UseMiningTools_TryFindingWallToHammer(out wX, out wY); - this.ItemCheck_UseMiningTools_TryHittingWall(sItem, wX, wY); - } - - private void ItemCheck_UseMiningTools_ActuallyUseMiningTool( - Item sItem, - out bool canHitWalls, - int x, - int y) - { - int num1 = 0; - canHitWalls = true; - Tile tile = Main.tile[x, y]; - if (!tile.active()) - return; - if (sItem.pick > 0 && !Main.tileAxe[(int) tile.type] && !Main.tileHammer[(int) tile.type] || sItem.axe > 0 && Main.tileAxe[(int) tile.type] || sItem.hammer > 0 && Main.tileHammer[(int) tile.type]) - canHitWalls = false; - int num2 = this.hitTile.HitObject(x, y, 1); - if (Main.tileNoFail[(int) tile.type]) - num1 = 100; - if (Main.tileHammer[(int) tile.type]) - { - canHitWalls = false; - if (sItem.hammer > 0) - { - int damageAmount = num1 + sItem.hammer; - if (!WorldGen.CanKillTile(x, y)) - damageAmount = 0; - if (tile.type == (ushort) 26 && (sItem.hammer < 80 || !Main.hardMode)) - { - damageAmount = 0; - this.Hurt(PlayerDeathReason.ByOther(4), this.statLife / 2, -this.direction); - } - AchievementsHelper.CurrentlyMining = true; - if (this.hitTile.AddDamage(num2, damageAmount) >= 100) - { - this.ClearMiningCacheAt(x, y, 1); - WorldGen.KillTile(x, y); - if (Main.netMode == 1) - NetMessage.SendData(17, number2: ((float) x), number3: ((float) y)); - } - else - { - WorldGen.KillTile(x, y, true); - if (Main.netMode == 1) - NetMessage.SendData(17, number2: ((float) x), number3: ((float) y), number4: 1f); - } - if (damageAmount != 0) - this.hitTile.Prune(); - this.ApplyItemTime(sItem); - AchievementsHelper.CurrentlyMining = false; - } - } - else if (Main.tileAxe[(int) tile.type]) - { - int damageAmount = tile.type != (ushort) 80 ? num1 + (int) ((double) sItem.axe * 1.20000004768372) : num1 + (int) ((double) (sItem.axe * 3) * 1.20000004768372); - if (sItem.axe > 0) - { - AchievementsHelper.CurrentlyMining = true; - if (!WorldGen.CanKillTile(x, y)) - damageAmount = 0; - if (this.hitTile.AddDamage(num2, damageAmount) >= 100) - { - this.ClearMiningCacheAt(x, y, 1); - WorldGen.KillTile(x, y); - if (Main.netMode == 1) - NetMessage.SendData(17, number2: ((float) x), number3: ((float) y)); - } - else - { - WorldGen.KillTile(x, y, true); - if (Main.netMode == 1) - NetMessage.SendData(17, number2: ((float) x), number3: ((float) y), number4: 1f); - } - if (damageAmount != 0) - this.hitTile.Prune(); - this.ApplyItemTime(sItem); - AchievementsHelper.CurrentlyMining = false; - } - } - else if (sItem.pick > 0) - this.PickTile(x, y, sItem.pick); - if (sItem.pick > 0) - this.itemTime = (int) ((double) sItem.useTime * (double) this.pickSpeed); - this.ItemCheck_UseMiningTools_TryPoundingTile(sItem, num2, ref canHitWalls, x, y); - } - - private static void ItemCheck_UseMiningTools_TryFindingWallToHammer(out int wX, out int wY) - { - wX = Player.tileTargetX; - wY = Player.tileTargetY; - bool flag = true; - if (Main.tile[wX, wY].wall > (ushort) 0) - { - if (!Main.wallHouse[(int) Main.tile[wX, wY].wall]) - { - for (int index1 = wX - 1; index1 < wX + 2; ++index1) - { - for (int index2 = wY - 1; index2 < wY + 2; ++index2) - { - if ((int) Main.tile[index1, index2].wall != (int) Main.tile[wX, wY].wall) + Main.blockMouse = true; + Main.tile[index, tileTargetY].frameX = (short) (frameX2 + sItem.legSlot * 100); + if (Main.netMode == 1) + NetMessage.SendTileSquare(-1, index, tileTargetY, 1); + --sItem.stack; + if (sItem.stack <= 0) { - flag = false; - break; + sItem.SetDefaults(); + Main.mouseItem.SetDefaults(); } - } - } - } - else - flag = false; - } - if (!flag || Main.tile[wX, wY].active()) - return; - int num1 = -1; - if (((double) Main.mouseX + (double) Main.screenPosition.X) / 16.0 < Math.Round(((double) Main.mouseX + (double) Main.screenPosition.X) / 16.0)) - num1 = 0; - int num2 = -1; - if (((double) Main.mouseY + (double) Main.screenPosition.Y) / 16.0 < Math.Round(((double) Main.mouseY + (double) Main.screenPosition.Y) / 16.0)) - num2 = 0; - for (int index3 = Player.tileTargetX + num1; index3 <= Player.tileTargetX + num1 + 1; ++index3) - { - for (int index4 = Player.tileTargetY + num2; index4 <= Player.tileTargetY + num2 + 1; ++index4) - { - if (flag) - { - wX = index3; - wY = index4; - if (Main.tile[wX, wY].wall > (ushort) 0) - { - if (!Main.wallHouse[(int) Main.tile[wX, wY].wall]) - { - for (int index5 = wX - 1; index5 < wX + 2; ++index5) - { - for (int index6 = wY - 1; index6 < wY + 2; ++index6) - { - if ((int) Main.tile[index5, index6].wall != (int) Main.tile[wX, wY].wall) - { - flag = false; - break; - } - } - } - } - else - flag = false; + if (this.selectedItem == 58) + Main.mouseItem = sItem.Clone(); + this.releaseUseItem = false; + this.mouseInterface = true; } } } } - } - - private void ItemCheck_UseMiningTools_TryHittingWall(Item sItem, int wX, int wY) - { - if (Main.tile[wX, wY].wall <= (ushort) 0 || Main.tile[wX, wY].active() && wX == Player.tileTargetX && wY == Player.tileTargetY && (Main.tileHammer[(int) Main.tile[wX, wY].type] || this.poundRelease) || this.toolTime != 0 || this.itemAnimation <= 0 || !this.controlUseItem || sItem.hammer <= 0) - return; - bool flag = true; - if (!Main.wallHouse[(int) Main.tile[wX, wY].wall]) + if (Main.myPlayer == i && this.itemAnimation == 0 && TileObjectData.CustomPlace(sItem.createTile, sItem.placeStyle)) + TileObject.CanPlace(Player.tileTargetX, Player.tileTargetY, sItem.createTile, sItem.placeStyle, this.direction, out TileObject _, true); + if (this.itemAnimation == 0 && this.altFunctionUse == 2) + this.altFunctionUse = 0; + if (this.controlUseItem && this.itemAnimation == 0 && this.releaseUseItem && sItem.useStyle > 0) { - flag = false; - for (int index1 = wX - 1; index1 < wX + 2; ++index1) + if (this.altFunctionUse == 1) + this.altFunctionUse = 2; + bool canUse = true; + if (sItem.shoot == 0) + this.itemRotation = 0.0f; + if (sItem.type == 3335 && (this.extraAccessory || !Main.expertMode)) + canUse = false; + if (this.pulley && sItem.fishingPole > 0) + canUse = false; + if (sItem.type == 3611 && (WiresUI.Settings.ToolMode & (WiresUI.Settings.MultiToolMode.Red | WiresUI.Settings.MultiToolMode.Green | WiresUI.Settings.MultiToolMode.Blue | WiresUI.Settings.MultiToolMode.Yellow | WiresUI.Settings.MultiToolMode.Actuator)) == (WiresUI.Settings.MultiToolMode) 0) + canUse = false; + if ((sItem.type == 3611 || sItem.type == 3625) && this.wireOperationsCooldown > 0) + canUse = false; + if (!this.CheckDD2CrystalPaymentLock(sItem)) + canUse = false; + if (this.whoAmI == Main.myPlayer && sItem.shoot > -1 && ProjectileID.Sets.IsADD2Turret[sItem.shoot] && !this.downedDD2EventAnyDifficulty && !DD2Event.Ongoing) + canUse = false; + if (sItem.shoot > -1 && ProjectileID.Sets.IsADD2Turret[sItem.shoot] && DD2Event.Ongoing && i == Main.myPlayer) { - for (int index2 = wY - 1; index2 < wY + 2; ++index2) + int worldX; + int worldY; + this.FindSentryRestingSpot(sItem.shoot, out worldX, out worldY, out int _); + if (Player.WouldSpotOverlapWithSentry(worldX, worldY)) + canUse = false; + } + if (sItem.shoot > -1 && ProjectileID.Sets.IsADD2Turret[sItem.shoot] && i == Main.myPlayer) + { + int worldX; + int worldY; + this.FindSentryRestingSpot(sItem.shoot, out worldX, out worldY, out int _); + if (WorldGen.SolidTile(worldX / 16, worldY / 16 - 1)) + canUse = false; + } + if (this.wet && (sItem.shoot == 85 || sItem.shoot == 15 || sItem.shoot == 34)) + canUse = false; + if (sItem.makeNPC > (short) 0 && !NPC.CanReleaseNPCs(this.whoAmI)) + canUse = false; + if (this.whoAmI == Main.myPlayer && sItem.type == 603 && !Main.cEd) + canUse = false; + if (sItem.type == 1071 || sItem.type == 1072) + { + bool flag2 = false; + for (int index = 0; index < 58; ++index) { - if (Main.tile[index1, index2].wall == (ushort) 0 || Main.wallHouse[(int) Main.tile[index1, index2].wall]) + if (this.inventory[index].paint > (byte) 0) { - flag = true; + flag2 = true; + break; + } + } + if (!flag2) + canUse = false; + } + if (this.noItems) + canUse = false; + if (sItem.tileWand > 0) + { + int tileWand = sItem.tileWand; + canUse = false; + for (int index = 0; index < 58; ++index) + { + if (tileWand == this.inventory[index].type && this.inventory[index].stack > 0) + { + canUse = true; break; } } } - } - if (!flag) - return; - int tileId = this.hitTile.HitObject(wX, wY, 2); - int damageAmount = (int) ((double) sItem.hammer * 1.5); - if (this.hitTile.AddDamage(tileId, damageAmount) >= 100) - { - this.hitTile.Clear(tileId); - this.ClearMiningCacheAt(wX, wY, 2); - WorldGen.KillWall(wX, wY); - if (Main.netMode == 1) - NetMessage.SendData(17, number: 2, number2: ((float) wX), number3: ((float) wY)); - } - else - { - WorldGen.KillWall(wX, wY, true); - if (Main.netMode == 1) - NetMessage.SendData(17, number: 2, number2: ((float) wX), number3: ((float) wY), number4: 1f); - } - if (damageAmount != 0) - this.hitTile.Prune(); - this.itemTime = sItem.useTime / 2; - } - - private void ItemCheck_UseMiningTools_TryPoundingTile( - Item sItem, - int tileHitId, - ref bool hitWall, - int x, - int y) - { - Tile tile1 = Main.tile[x, y]; - if (sItem.hammer > 0 && tile1.active() && (Main.tileSolid[(int) tile1.type] || tile1.type == (ushort) 314 || tile1.type == (ushort) 351 || tile1.type == (ushort) 424 || tile1.type == (ushort) 442) && this.poundRelease) - { - hitWall = false; - this.ApplyItemTime(sItem); - int damageAmount = 100; - if (WorldGen.IsLockedDoor(x, y - 1) || WorldGen.IsLockedDoor(x, y + 1)) - damageAmount = 0; - if (this.hitTile.AddDamage(tileHitId, damageAmount) >= 100) + if (sItem.fishingPole > 0) { - this.ClearMiningCacheAt(x, y, 1); - if (!this.poundRelease) - return; - if (TileID.Sets.Platforms[(int) Main.tile[x, y].type]) + for (int index1 = 0; index1 < 1000; ++index1) { - if (tile1.halfBrick()) + if (Main.projectile[index1].active && Main.projectile[index1].owner == this.whoAmI && Main.projectile[index1].bobber) { - WorldGen.PoundTile(x, y); - if (Main.netMode == 1) - NetMessage.SendData(17, number: 7, number2: ((float) x), number3: ((float) y), number4: 1f); - } - else - { - int slope1 = 1; - int slope2 = 2; - if (TileID.Sets.Platforms[(int) Main.tile[x + 1, y - 1].type] || TileID.Sets.Platforms[(int) Main.tile[x - 1, y + 1].type] || WorldGen.SolidTile(x + 1, y) && !WorldGen.SolidTile(x - 1, y)) + canUse = false; + if (this.whoAmI == Main.myPlayer && (double) Main.projectile[index1].ai[0] == 0.0) { - slope1 = 2; - slope2 = 1; - } - if (Main.tile[x, y].slope() == (byte) 0) - { - WorldGen.SlopeTile(x, y, slope1); - int num = (int) Main.tile[x, y].slope(); - if (Main.netMode == 1) - NetMessage.SendData(17, number: 14, number2: ((float) x), number3: ((float) y), number4: ((float) num)); - } - else if ((int) Main.tile[x, y].slope() == slope1) - { - WorldGen.SlopeTile(x, y, slope2); - int num = (int) Main.tile[x, y].slope(); - if (Main.netMode == 1) - NetMessage.SendData(17, number: 14, number2: ((float) x), number3: ((float) y), number4: ((float) num)); - } - else - { - WorldGen.SlopeTile(x, y); - int num = (int) Main.tile[x, y].slope(); - if (Main.netMode == 1) - NetMessage.SendData(17, number: 14, number2: ((float) x), number3: ((float) y), number4: ((float) num)); - WorldGen.PoundTile(x, y); - if (Main.netMode == 1) - NetMessage.SendData(17, number: 7, number2: ((float) x), number3: ((float) y), number4: 1f); - } - } - } - else if (Main.tile[x, y].type == (ushort) 314) - { - if (Minecart.FrameTrack(x, y, true) && Main.netMode == 1) - NetMessage.SendData(17, number: 15, number2: ((float) x), number3: ((float) y), number4: 1f); - } - else if (Main.tile[x, y].type == (ushort) 137) - { - int num = 0; - switch ((int) Main.tile[x, y].frameY / 18) - { - case 0: - case 1: - case 2: - switch ((int) Main.tile[x, y].frameX / 18) + Main.projectile[index1].ai[0] = 1f; + float num3 = -10f; + if (Main.projectile[index1].wet && (double) Main.projectile[index1].velocity.Y > (double) num3) + Main.projectile[index1].velocity.Y = num3; + Main.projectile[index1].netUpdate2 = true; + if ((double) Main.projectile[index1].ai[1] < 0.0 && (double) Main.projectile[index1].localAI[1] != 0.0) { - case 0: - num = 2; - break; - case 1: - num = 3; - break; - case 2: - num = 4; - break; - case 3: - num = 5; - break; - case 4: - num = 1; - break; - case 5: - num = 0; - break; + bool flag3 = false; + int num4 = 0; + for (int index2 = 0; index2 < 58; ++index2) + { + if (this.inventory[index2].stack > 0 && this.inventory[index2].bait > 0) + { + bool flag4 = false; + int maxValue = 1 + this.inventory[index2].bait / 5; + if (maxValue < 1) + maxValue = 1; + if (this.accTackleBox) + ++maxValue; + if (Main.rand.Next(maxValue) == 0) + flag4 = true; + if ((double) Main.projectile[index1].localAI[1] < 0.0) + flag4 = true; + if ((double) Main.projectile[index1].localAI[1] > 0.0) + { + Item obj = new Item(); + obj.SetDefaults((int) Main.projectile[index1].localAI[1]); + if (obj.rare < 0) + flag4 = false; + } + if (flag4) + { + num4 = this.inventory[index2].type; + --this.inventory[index2].stack; + if (this.inventory[index2].stack <= 0) + this.inventory[index2].SetDefaults(); + } + flag3 = true; + break; + } + } + if (flag3) + { + if (num4 == 2673) + { + if (Main.netMode != 1) + NPC.SpawnOnPlayer(this.whoAmI, 370); + else + NetMessage.SendData(61, number: this.whoAmI, number2: 370f); + Main.projectile[index1].ai[0] = 2f; + } + else if (Main.rand.Next(7) == 0 && !this.accFishingLine) + Main.projectile[index1].ai[0] = 2f; + else + Main.projectile[index1].ai[1] = Main.projectile[index1].localAI[1]; + Main.projectile[index1].netUpdate = true; + } } - break; - case 3: - case 4: - switch ((int) Main.tile[x, y].frameX / 18) - { - case 0: - case 1: - num = 3; - break; - case 2: - num = 4; - break; - case 3: - num = 2; - break; - case 4: - num = 0; - break; - } - break; - } - Main.tile[x, y].frameX = (short) (num * 18); - if (Main.netMode == 1) - NetMessage.SendTileSquare(-1, x, y, 1); - } - else if (Main.tile[x, y].type == (ushort) 424) - { - Main.tile[x, y].frameX = Main.tile[x, y].frameX != (short) 0 ? (Main.tile[x, y].frameX != (short) 18 ? (short) 0 : (short) 36) : (short) 18; - if (Main.netMode == 1) - NetMessage.SendTileSquare(-1, x, y, 1); - } - else if (Main.tile[x, y].type == (ushort) 442) - { - Tile tile2 = Main.tile[x, y - 1]; - Tile tile3 = Main.tile[x, y + 1]; - Tile tile4 = Main.tile[x - 1, y]; - Tile tile5 = Main.tile[x + 1, y]; - Tile tile6 = Main.tile[x - 1, y + 1]; - Tile tile7 = Main.tile[x + 1, y + 1]; - Tile tile8 = Main.tile[x - 1, y - 1]; - Tile tile9 = Main.tile[x + 1, y - 1]; - int index1 = -1; - int index2 = -1; - int tree1 = -1; - int tree2 = -1; - int tree3 = -1; - int tree4 = -1; - int tree5 = -1; - int tree6 = -1; - if (tile2 != null && tile2.nactive() && !tile2.bottomSlope()) - index2 = (int) tile2.type; - if (tile3 != null && tile3.nactive() && !tile3.halfBrick() && !tile3.topSlope()) - index1 = (int) tile3.type; - if (tile4 != null && tile4.nactive() && (tile4.slope() == (byte) 0 || (int) tile4.slope() % 2 != 1)) - tree1 = (int) tile4.type; - if (tile5 != null && tile5.nactive() && (tile5.slope() == (byte) 0 || (int) tile5.slope() % 2 != 0)) - tree2 = (int) tile5.type; - if (tile6 != null && tile6.nactive()) - tree3 = (int) tile6.type; - if (tile7 != null && tile7.nactive()) - tree4 = (int) tile7.type; - if (tile8 != null && tile8.nactive()) - tree5 = (int) tile8.type; - if (tile9 != null && tile9.nactive()) - tree6 = (int) tile9.type; - bool flag1 = false; - bool flag2 = false; - bool flag3 = false; - bool flag4 = false; - if (index1 >= 0 && Main.tileSolid[index1] && (!Main.tileNoAttach[index1] || TileID.Sets.Platforms[index1]) && (tile3.bottomSlope() || tile3.slope() == (byte) 0) && !tile3.halfBrick()) - flag4 = true; - if (index2 >= 0 && Main.tileSolid[index2] && (!Main.tileNoAttach[index2] || TileID.Sets.Platforms[index2] && tile2.halfBrick()) && (tile2.topSlope() || tile2.slope() == (byte) 0 || tile2.halfBrick())) - flag1 = true; - if (tree1 >= 0 && Main.tileSolid[tree1] && !Main.tileNoAttach[tree1] && (tile4.leftSlope() || tile4.slope() == (byte) 0) && !tile4.halfBrick() || tree1 >= 0 && TileID.Sets.IsBeam[tree1] || WorldGen.IsTreeType(tree1) && WorldGen.IsTreeType(tree5) && WorldGen.IsTreeType(tree3)) - flag2 = true; - if (tree2 >= 0 && Main.tileSolid[tree2] && !Main.tileNoAttach[tree2] && (tile5.rightSlope() || tile5.slope() == (byte) 0) && !tile5.halfBrick() || tree2 >= 0 && TileID.Sets.IsBeam[tree2] || WorldGen.IsTreeType(tree2) && WorldGen.IsTreeType(tree6) && WorldGen.IsTreeType(tree4)) - flag3 = true; - int num1 = (int) Main.tile[x, y].frameX / 22; - short num2 = -2; - switch (num1) - { - case 0: - num2 = !flag2 ? (!flag1 ? (!flag3 ? (short) -1 : (short) 3) : (short) 1) : (short) 2; - break; - case 1: - num2 = !flag3 ? (!flag4 ? (!flag2 ? (short) -1 : (short) 2) : (short) 0) : (short) 3; - break; - case 2: - num2 = !flag1 ? (!flag3 ? (!flag4 ? (short) -1 : (short) 0) : (short) 3) : (short) 1; - break; - case 3: - num2 = !flag4 ? (!flag2 ? (!flag1 ? (short) -1 : (short) 1) : (short) 2) : (short) 0; - break; - } - switch (num2) - { - case -2: - num2 = (short) 0; - break; - case -1: - goto label_106; - } - Main.tile[x, y].frameX = (short) (22 * (int) num2); - if (Main.netMode == 1) - NetMessage.SendTileSquare(-1, x, y, 1); - } - else if ((Main.tile[x, y].halfBrick() || Main.tile[x, y].slope() != (byte) 0) && !Main.tileSolidTop[(int) Main.tile[x, y].type]) - { - int num3 = 1; - int slope3 = 1; - int slope4 = 2; - if ((WorldGen.SolidTile(x + 1, y) || Main.tile[x + 1, y].slope() == (byte) 1 || Main.tile[x + 1, y].slope() == (byte) 3) && !WorldGen.SolidTile(x - 1, y)) - { - slope3 = 2; - slope4 = 1; - } - if (WorldGen.SolidTile(x, y - 1) && !WorldGen.SolidTile(x, y + 1)) - num3 = -1; - if (num3 == 1) - { - if (Main.tile[x, y].slope() == (byte) 0) - WorldGen.SlopeTile(x, y, slope3); - else if ((int) Main.tile[x, y].slope() == slope3) - WorldGen.SlopeTile(x, y, slope4); - else if ((int) Main.tile[x, y].slope() == slope4) - WorldGen.SlopeTile(x, y, slope3 + 2); - else if ((int) Main.tile[x, y].slope() == slope3 + 2) - WorldGen.SlopeTile(x, y, slope4 + 2); - else - WorldGen.SlopeTile(x, y); - } - else if (Main.tile[x, y].slope() == (byte) 0) - WorldGen.SlopeTile(x, y, slope3 + 2); - else if ((int) Main.tile[x, y].slope() == slope3 + 2) - WorldGen.SlopeTile(x, y, slope4 + 2); - else if ((int) Main.tile[x, y].slope() == slope4 + 2) - WorldGen.SlopeTile(x, y, slope3); - else if ((int) Main.tile[x, y].slope() == slope3) - WorldGen.SlopeTile(x, y, slope4); - else - WorldGen.SlopeTile(x, y); - int num4 = (int) Main.tile[x, y].slope(); - if (Main.netMode == 1) - NetMessage.SendData(17, number: 14, number2: ((float) x), number3: ((float) y), number4: ((float) num4)); - } - else - { - WorldGen.PoundTile(x, y); - if (Main.netMode == 1) - NetMessage.SendData(17, number: 7, number2: ((float) x), number3: ((float) y), number4: 1f); - } -label_106: - this.poundRelease = false; - } - else - { - WorldGen.KillTile(x, y, true, true); - SoundEngine.PlaySound(0, x * 16, y * 16); - } - } - else - this.poundRelease = false; - } - - private bool IsTargetTileInItemRange(Item sItem) => (double) this.position.X / 16.0 - (double) Player.tileRangeX - (double) sItem.tileBoost <= (double) Player.tileTargetX && ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX + (double) sItem.tileBoost - 1.0 >= (double) Player.tileTargetX && (double) this.position.Y / 16.0 - (double) Player.tileRangeY - (double) sItem.tileBoost <= (double) Player.tileTargetY && ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY + (double) sItem.tileBoost - 2.0 >= (double) Player.tileTargetY; - - private void ItemCheck_UseBuckets(Item sItem) - { - if ((sItem.type < 205 || sItem.type > 207) && sItem.type != 1128 && sItem.type != 3031 && sItem.type != 3032 && sItem.type != 4820 && sItem.type != 4872 || this.noBuilding || (double) this.position.X / 16.0 - (double) Player.tileRangeX - (double) sItem.tileBoost > (double) Player.tileTargetX || ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX + (double) sItem.tileBoost - 1.0 < (double) Player.tileTargetX || (double) this.position.Y / 16.0 - (double) Player.tileRangeY - (double) sItem.tileBoost > (double) Player.tileTargetY || ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY + (double) sItem.tileBoost - 2.0 < (double) Player.tileTargetY) - return; - if (!Main.GamepadDisableCursorItemIcon) - { - this.cursorItemIconEnabled = true; - Main.ItemIconCacheUpdate(sItem.type); - } - if (!this.ItemTimeIsZero || this.itemAnimation <= 0 || !this.controlUseItem) - return; - if (sItem.type == 205 || sItem.type == 3032 && Main.tile[Player.tileTargetX, Player.tileTargetY].liquidType() == (byte) 0 || sItem.type == 4872 && Main.tile[Player.tileTargetX, Player.tileTargetY].lava()) - { - int num1 = (int) Main.tile[Player.tileTargetX, Player.tileTargetY].liquidType(); - int num2 = 0; - for (int index1 = Player.tileTargetX - 1; index1 <= Player.tileTargetX + 1; ++index1) - { - for (int index2 = Player.tileTargetY - 1; index2 <= Player.tileTargetY + 1; ++index2) - { - if ((int) Main.tile[index1, index2].liquidType() == num1) - num2 += (int) Main.tile[index1, index2].liquid; - } - } - if (Main.tile[Player.tileTargetX, Player.tileTargetY].liquid <= (byte) 0 || num2 <= 100 && sItem.type != 3032 && sItem.type != 4872) - return; - int liquidType = (int) Main.tile[Player.tileTargetX, Player.tileTargetY].liquidType(); - if (sItem.type != 3032 && sItem.type != 4872) - { - if (!Main.tile[Player.tileTargetX, Player.tileTargetY].lava()) - { - if (Main.tile[Player.tileTargetX, Player.tileTargetY].honey()) - { - --sItem.stack; - this.PutItemInInventoryFromItemUsage(1128, this.selectedItem); - } - else - { - --sItem.stack; - this.PutItemInInventoryFromItemUsage(206, this.selectedItem); - } - } - else - { - --sItem.stack; - this.PutItemInInventoryFromItemUsage(207, this.selectedItem); - } - } - SoundEngine.PlaySound(19, (int) this.position.X, (int) this.position.Y); - this.ApplyItemTime(sItem); - int liquid = (int) Main.tile[Player.tileTargetX, Player.tileTargetY].liquid; - Main.tile[Player.tileTargetX, Player.tileTargetY].liquid = (byte) 0; - Main.tile[Player.tileTargetX, Player.tileTargetY].lava(false); - Main.tile[Player.tileTargetX, Player.tileTargetY].honey(false); - WorldGen.SquareTileFrame(Player.tileTargetX, Player.tileTargetY, false); - if (Main.netMode == 1) - NetMessage.sendWater(Player.tileTargetX, Player.tileTargetY); - else - Liquid.AddWater(Player.tileTargetX, Player.tileTargetY); - for (int index3 = Player.tileTargetX - 1; index3 <= Player.tileTargetX + 1; ++index3) - { - for (int index4 = Player.tileTargetY - 1; index4 <= Player.tileTargetY + 1; ++index4) - { - if (liquid < 256 && (int) Main.tile[index3, index4].liquidType() == num1) - { - int num3 = (int) Main.tile[index3, index4].liquid; - if (num3 + liquid > (int) byte.MaxValue) - num3 = (int) byte.MaxValue - liquid; - liquid += num3; - Main.tile[index3, index4].liquid -= (byte) num3; - Main.tile[index3, index4].liquidType(liquidType); - if (Main.tile[index3, index4].liquid == (byte) 0) - { - Main.tile[index3, index4].lava(false); - Main.tile[index3, index4].honey(false); } - WorldGen.SquareTileFrame(index3, index4, false); - if (Main.netMode == 1) - NetMessage.sendWater(index3, index4); - else - Liquid.AddWater(index3, index4); } } } - } - else - { - if (Main.tile[Player.tileTargetX, Player.tileTargetY].liquid >= (byte) 200 || Main.tile[Player.tileTargetX, Player.tileTargetY].nactive() && Main.tileSolid[(int) Main.tile[Player.tileTargetX, Player.tileTargetY].type] && !Main.tileSolidTop[(int) Main.tile[Player.tileTargetX, Player.tileTargetY].type] && Main.tile[Player.tileTargetX, Player.tileTargetY].type != (ushort) 546) - return; - if (sItem.type == 207 || sItem.type == 4820) - { - if (Main.tile[Player.tileTargetX, Player.tileTargetY].liquid != (byte) 0 && Main.tile[Player.tileTargetX, Player.tileTargetY].liquidType() != (byte) 1) - return; - SoundEngine.PlaySound(19, (int) this.position.X, (int) this.position.Y); - Main.tile[Player.tileTargetX, Player.tileTargetY].liquidType(1); - Main.tile[Player.tileTargetX, Player.tileTargetY].liquid = byte.MaxValue; - WorldGen.SquareTileFrame(Player.tileTargetX, Player.tileTargetY); - if (sItem.type != 4820) - { - --sItem.stack; - this.PutItemInInventoryFromItemUsage(205, this.selectedItem); - } - this.ApplyItemTime(sItem); - if (Main.netMode != 1) - return; - NetMessage.sendWater(Player.tileTargetX, Player.tileTargetY); - } - else if (sItem.type == 206 || sItem.type == 3031) - { - if (Main.tile[Player.tileTargetX, Player.tileTargetY].liquid != (byte) 0 && Main.tile[Player.tileTargetX, Player.tileTargetY].liquidType() != (byte) 0) - return; - SoundEngine.PlaySound(19, (int) this.position.X, (int) this.position.Y); - Main.tile[Player.tileTargetX, Player.tileTargetY].liquidType(0); - Main.tile[Player.tileTargetX, Player.tileTargetY].liquid = byte.MaxValue; - WorldGen.SquareTileFrame(Player.tileTargetX, Player.tileTargetY); - if (sItem.type != 3031) - { - --sItem.stack; - this.PutItemInInventoryFromItemUsage(205, this.selectedItem); - } - this.ApplyItemTime(sItem); - if (Main.netMode != 1) - return; - NetMessage.sendWater(Player.tileTargetX, Player.tileTargetY); - } - else - { - if (sItem.type != 1128 || Main.tile[Player.tileTargetX, Player.tileTargetY].liquid != (byte) 0 && Main.tile[Player.tileTargetX, Player.tileTargetY].liquidType() != (byte) 2) - return; - SoundEngine.PlaySound(19, (int) this.position.X, (int) this.position.Y); - Main.tile[Player.tileTargetX, Player.tileTargetY].liquidType(2); - Main.tile[Player.tileTargetX, Player.tileTargetY].liquid = byte.MaxValue; - WorldGen.SquareTileFrame(Player.tileTargetX, Player.tileTargetY); - --sItem.stack; - this.PutItemInInventoryFromItemUsage(205, this.selectedItem); - this.ApplyItemTime(sItem); - if (Main.netMode != 1) - return; - NetMessage.sendWater(Player.tileTargetX, Player.tileTargetY); - } - } - } - - private void ItemCheck_PlayInstruments(Item sItem) - { - if (this.itemAnimation > 0 && this.ItemTimeIsZero && (sItem.type == 508 || sItem.type == 507)) - { - this.ApplyItemTime(sItem); - Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); - double num1 = (double) Main.mouseX + (double) Main.screenPosition.X - (double) vector2.X; - float num2 = (float) Main.mouseY + Main.screenPosition.Y - vector2.Y; - float num3 = (float) Math.Sqrt(num1 * num1 + (double) num2 * (double) num2) / ((float) Main.screenHeight / Main.GameViewMatrix.Zoom.Y / 2f); - if ((double) num3 > 1.0) - num3 = 1f; - float num4 = (float) ((double) num3 * 2.0 - 1.0); - if ((double) num4 < -1.0) - num4 = -1f; - if ((double) num4 > 1.0) - num4 = 1f; - float number2 = (float) Math.Round((double) num4 * (double) Player.musicNotes) / (float) Player.musicNotes; - Main.musicPitch = number2; - LegacySoundStyle type = SoundID.Item26; - if (sItem.type == 507) - type = SoundID.Item35; - SoundEngine.PlaySound(type, this.position); - NetMessage.SendData(58, number: this.whoAmI, number2: number2); - } - if (this.itemAnimation <= 0 || this.mouseInterface) - return; - if (Main.mouseLeft && Main.mouseLeftRelease) - { - if (sItem.type == 1305) - { - Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); - double num5 = (double) Main.mouseX + (double) Main.screenPosition.X - (double) vector2.X; - float num6 = (float) Main.mouseY + Main.screenPosition.Y - vector2.Y; - float num7 = (float) Math.Sqrt(num5 * num5 + (double) num6 * (double) num6) / ((float) Main.screenHeight / Main.GameViewMatrix.Zoom.Y / 2f); - if ((double) num7 > 1.0) - num7 = 1f; - float num8 = (float) ((double) num7 * 2.0 - 1.0); - if ((double) num8 < -1.0) - num8 = -1f; - if ((double) num8 > 1.0) - num8 = 1f; - float number2 = (float) Math.Round((double) num8 * (double) Player.musicNotes) / (float) Player.musicNotes; - Main.musicPitch = number2; - SoundEngine.PlaySound(SoundID.Item47, this.position); - NetMessage.SendData(58, number: this.whoAmI, number2: number2); - } - else if (sItem.type == 4057 || sItem.type == 4372) - { - Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); - double num9 = (double) Main.mouseX + (double) Main.screenPosition.X - (double) vector2.X; - float num10 = (float) Main.mouseY + Main.screenPosition.Y - vector2.Y; - float num11 = (float) Math.Sqrt(num9 * num9 + (double) num10 * (double) num10) / ((float) Main.screenHeight / Main.GameViewMatrix.Zoom.Y / 2f); - if ((double) num11 > 1.0) - num11 = 1f; - this.PlayGuitarChord(num11); - NetMessage.SendData(58, number: this.whoAmI, number2: num11); - } - } - if (sItem.type == 4715 && ((!Main.mouseLeft ? 0 : (Main.mouseLeftRelease ? 1 : 0)) | (this.itemAnimation == this.itemAnimationMax - 1 ? 1 : 0)) != 0) - { - Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); - double num12 = (double) Main.mouseX + (double) Main.screenPosition.X - (double) vector2.X; - float num13 = (float) Main.mouseY + Main.screenPosition.Y - vector2.Y; - float num14 = (float) Math.Sqrt(num12 * num12 + (double) num13 * (double) num13) / ((float) Main.screenHeight / Main.GameViewMatrix.Zoom.Y / 2f); - if ((double) num14 > 1.0) - num14 = 1f; - this.PlayGuitarChord(num14); - NetMessage.SendData(58, number: this.whoAmI, number2: num14); - } - if (sItem.type != 4673) - return; - int x = (int) this.Center.X / 16; - int y = (int) this.Center.Y / 16; - if (!WorldGen.InWorld(x, y) || Main.tile[x, y] == null || Main.tile[x, y].type != (ushort) 486 || (!Main.mouseLeft || !Main.mouseLeftRelease) && (!Main.mouseRight || !Main.mouseRightRelease)) - return; - Vector2 vector2_1 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); - double num15 = (double) Main.mouseX + (double) Main.screenPosition.X - (double) vector2_1.X; - float num16 = (float) Main.mouseY + Main.screenPosition.Y - vector2_1.Y; - float num17 = (float) Math.Sqrt(num15 * num15 + (double) num16 * (double) num16) / ((float) Main.screenHeight / Main.GameViewMatrix.Zoom.Y / 2f); - if ((double) num17 > 1.0) - num17 = 1f; - this.PlayDrums(num17); - NetMessage.SendData(58, number: this.whoAmI, number2: num17); - } - - private bool GetSparkleGuitarTarget(out List validTargets) - { - validTargets = new List(); - Microsoft.Xna.Framework.Rectangle rectangle = Utils.CenteredRectangle(this.Center, new Vector2(1000f, 800f)); - for (int index = 0; index < 200; ++index) - { - NPC npc = Main.npc[index]; - if (npc.CanBeChasedBy((object) this) && npc.Hitbox.Intersects(rectangle)) - validTargets.Add(npc); - } - return validTargets.Count != 0; - } - - private bool GetZenithTarget(Vector2 searchCenter, float maxDistance, out int npcTargetIndex) - { - npcTargetIndex = 0; - int? nullable = new int?(); - float num1 = maxDistance; - for (int index = 0; index < 200; ++index) - { - NPC npc = Main.npc[index]; - if (npc.CanBeChasedBy((object) this)) - { - float num2 = searchCenter.Distance(npc.Center); - if ((double) num1 > (double) num2) - { - nullable = new int?(index); - num1 = num2; - } - } - } - if (!nullable.HasValue) - return false; - npcTargetIndex = nullable.Value; - return true; - } - - public void PlayGuitarChord(float range) - { - float num = 1f / 6f; - if ((double) range > (double) num * 5.0) - SoundEngine.PlaySound(51, this.Center); - else if ((double) range > (double) num * 4.0) - SoundEngine.PlaySound(47, this.Center); - else if ((double) range > (double) num * 3.0) - SoundEngine.PlaySound(48, this.Center); - else if ((double) range > (double) num * 2.0) - SoundEngine.PlaySound(49, this.Center); - else if ((double) range > (double) num * 1.0) - SoundEngine.PlaySound(50, this.Center); - else - SoundEngine.PlaySound(52, this.Center); - } - - public void PlayDrums(float range) - { - float num = 1f / 10f; - if ((double) range > (double) num * 9.0) - SoundEngine.PlaySound(59, this.Center); - else if ((double) range > (double) num * 8.0) - SoundEngine.PlaySound(58, this.Center); - else if ((double) range > (double) num * 7.0) - SoundEngine.PlaySound(53, this.Center); - else if ((double) range > (double) num * 6.0) - SoundEngine.PlaySound(57, this.Center); - else if ((double) range > (double) num * 5.0) - SoundEngine.PlaySound(62, this.Center); - else if ((double) range > (double) num * 4.0) - SoundEngine.PlaySound(61, this.Center); - else if ((double) range > (double) num * 3.0) - SoundEngine.PlaySound(54, this.Center); - else if ((double) range > (double) num * 2.0) - SoundEngine.PlaySound(56, this.Center); - else if ((double) range > (double) num * 1.0) - SoundEngine.PlaySound(55, this.Center); - else - SoundEngine.PlaySound(60, this.Center); - } - - private void ItemCheck_UseWiringTools(Item sItem) - { - if (sItem.type != 509 && sItem.type != 510 && sItem.type != 849 && sItem.type != 850 && sItem.type != 851 && sItem.type != 3612 && sItem.type != 3620 && sItem.type != 3625 || (double) this.position.X / 16.0 - (double) Player.tileRangeX - (double) sItem.tileBoost - (double) this.blockRange > (double) Player.tileTargetX || ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX + (double) sItem.tileBoost - 1.0 + (double) this.blockRange < (double) Player.tileTargetX || (double) this.position.Y / 16.0 - (double) Player.tileRangeY - (double) sItem.tileBoost - (double) this.blockRange > (double) Player.tileTargetY || ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY + (double) sItem.tileBoost - 2.0 + (double) this.blockRange < (double) Player.tileTargetY) - return; - if (!Main.GamepadDisableCursorItemIcon) - { - this.cursorItemIconEnabled = true; - Main.ItemIconCacheUpdate(sItem.type); - } - if (this.itemAnimation <= 0 || !this.ItemTimeIsZero || !this.controlUseItem) - return; - int tileTargetX = Player.tileTargetX; - int tileTargetY = Player.tileTargetY; - if (sItem.type == 509) - { - int index1 = -1; - for (int index2 = 0; index2 < 58; ++index2) - { - if (this.inventory[index2].stack > 0 && this.inventory[index2].type == 530) - { - index1 = index2; - break; - } - } - if (index1 >= 0 && WorldGen.PlaceWire(tileTargetX, tileTargetY)) - { - --this.inventory[index1].stack; - if (this.inventory[index1].stack <= 0) - this.inventory[index1].SetDefaults(); - this.ApplyItemTime(sItem); - NetMessage.SendData(17, number: 5, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); - } - } - else if (sItem.type == 850) - { - int index3 = -1; - for (int index4 = 0; index4 < 58; ++index4) - { - if (this.inventory[index4].stack > 0 && this.inventory[index4].type == 530) - { - index3 = index4; - break; - } - } - if (index3 >= 0 && WorldGen.PlaceWire2(tileTargetX, tileTargetY)) - { - --this.inventory[index3].stack; - if (this.inventory[index3].stack <= 0) - this.inventory[index3].SetDefaults(); - this.ApplyItemTime(sItem); - NetMessage.SendData(17, number: 10, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); - } - } - if (sItem.type == 851) - { - int index5 = -1; - for (int index6 = 0; index6 < 58; ++index6) - { - if (this.inventory[index6].stack > 0 && this.inventory[index6].type == 530) - { - index5 = index6; - break; - } - } - if (index5 >= 0 && WorldGen.PlaceWire3(tileTargetX, tileTargetY)) - { - --this.inventory[index5].stack; - if (this.inventory[index5].stack <= 0) - this.inventory[index5].SetDefaults(); - this.ApplyItemTime(sItem); - NetMessage.SendData(17, number: 12, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); - } - } - if (sItem.type == 3612) - { - int index7 = -1; - for (int index8 = 0; index8 < 58; ++index8) - { - if (this.inventory[index8].stack > 0 && this.inventory[index8].type == 530) - { - index7 = index8; - break; - } - } - if (index7 >= 0 && WorldGen.PlaceWire4(tileTargetX, tileTargetY)) - { - --this.inventory[index7].stack; - if (this.inventory[index7].stack <= 0) - this.inventory[index7].SetDefaults(); - this.ApplyItemTime(sItem); - NetMessage.SendData(17, number: 16, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); - } - } - else if (sItem.type == 510) - { - if (WorldGen.KillActuator(tileTargetX, tileTargetY)) - { - this.ApplyItemTime(sItem); - NetMessage.SendData(17, number: 9, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); - } - else if (WorldGen.KillWire4(tileTargetX, tileTargetY)) - { - this.ApplyItemTime(sItem); - NetMessage.SendData(17, number: 17, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); - } - else if (WorldGen.KillWire3(tileTargetX, tileTargetY)) - { - this.ApplyItemTime(sItem); - NetMessage.SendData(17, number: 13, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); - } - else if (WorldGen.KillWire2(tileTargetX, tileTargetY)) - { - this.ApplyItemTime(sItem); - NetMessage.SendData(17, number: 11, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); - } - else if (WorldGen.KillWire(tileTargetX, tileTargetY)) - { - this.ApplyItemTime(sItem); - NetMessage.SendData(17, number: 6, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); - } - } - else if (sItem.type == 849 && sItem.stack > 0 && WorldGen.PlaceActuator(tileTargetX, tileTargetY)) - { - this.ApplyItemTime(sItem); - NetMessage.SendData(17, number: 8, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); - --sItem.stack; - if (sItem.stack <= 0) - sItem.SetDefaults(); - } - if (sItem.type == 3620) - { - Tile tile = Main.tile[tileTargetX, tileTargetY]; - if (tile != null && tile.actuator()) - { - bool flag = tile.inActive(); - if ((!this.ActuationRodLock || this.ActuationRodLockSetting == tile.inActive()) && Wiring.Actuate(tileTargetX, tileTargetY) && flag != tile.inActive()) - { - this.ActuationRodLock = true; - this.ActuationRodLockSetting = !tile.inActive(); - this.ApplyItemTime(sItem); - NetMessage.SendData(17, number: 19, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); - } - } - } - if (sItem.type != 3625) - return; - Point point = new Point(Player.tileTargetX, Player.tileTargetY); - this.ApplyItemTime(sItem); - int toolMode = (int) WiresUI.Settings.ToolMode; - WiresUI.Settings.ToolMode &= ~WiresUI.Settings.MultiToolMode.Actuator; - if (Main.netMode == 1) - NetMessage.SendData(109, number: point.X, number2: ((float) point.Y), number3: ((float) point.X), number4: ((float) point.Y), number5: ((int) WiresUI.Settings.ToolMode)); - else - Wiring.MassWireOperation(point, point, this); - WiresUI.Settings.ToolMode = (WiresUI.Settings.MultiToolMode) toolMode; - } - - private void ItemCheck_UseLawnMower(Item sItem) - { - if (sItem.type != 4049 || (double) this.position.X / 16.0 - (double) Player.tileRangeX - (double) sItem.tileBoost - (double) this.blockRange > (double) Player.tileTargetX || ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX + (double) sItem.tileBoost - 1.0 + (double) this.blockRange < (double) Player.tileTargetX || (double) this.position.Y / 16.0 - (double) Player.tileRangeY - (double) sItem.tileBoost - (double) this.blockRange > (double) Player.tileTargetY || ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY + (double) sItem.tileBoost - 2.0 + (double) this.blockRange < (double) Player.tileTargetY || this.itemAnimation <= 0 || !this.ItemTimeIsZero || !this.controlUseItem) - return; - this.MowGrassTile(new Point(Player.tileTargetX, Player.tileTargetY).ToWorldCoordinates()); - this.ApplyItemTime(sItem); - } - - private void DestroyOldestProximityMinesOverMinesCap(int minesCap) - { - Player._oldestProjCheckList.Clear(); - for (int index = 0; index < 1000; ++index) - { - Projectile projectile = Main.projectile[index]; - if (projectile.active && projectile.owner == this.whoAmI) - { - switch (projectile.type) - { - case 135: - case 138: - case 141: - case 144: - case 778: - case 782: - case 786: - case 789: - case 792: - case 795: - case 798: - case 801: - Player._oldestProjCheckList.Add(projectile); - continue; - default: - continue; - } - } - } - while (Player._oldestProjCheckList.Count > minesCap) - { - Projectile oldestProjCheck = Player._oldestProjCheckList[0]; - for (int index = 1; index < Player._oldestProjCheckList.Count; ++index) - { - if (Player._oldestProjCheckList[index].timeLeft < oldestProjCheck.timeLeft) - oldestProjCheck = Player._oldestProjCheckList[index]; - } - oldestProjCheck.Kill(); - Player._oldestProjCheckList.Remove(oldestProjCheck); - } - Player._oldestProjCheckList.Clear(); - } - - private void ItemCheck_Shoot(int i, Item sItem, int weaponDamage) - { - int projToShoot = sItem.shoot; - float shootSpeed = sItem.shootSpeed; - int damage = sItem.damage; - if (sItem.melee && projToShoot != 699 && projToShoot != 707) - shootSpeed /= this.meleeSpeed; - bool canShoot = false; - int Damage1 = weaponDamage; - float knockBack = sItem.knockBack; - if (projToShoot == 13 || projToShoot == 32 || projToShoot == 315 || projToShoot >= 230 && projToShoot <= 235 || projToShoot == 331) - { - this.grappling[0] = -1; - this.grapCount = 0; - for (int index = 0; index < 1000; ++index) - { - if (Main.projectile[index].active && Main.projectile[index].owner == i) - { - if (Main.projectile[index].type == 13) - Main.projectile[index].Kill(); - if (Main.projectile[index].type == 331) - Main.projectile[index].Kill(); - if (Main.projectile[index].type == 315) - Main.projectile[index].Kill(); - if (Main.projectile[index].type >= 230 && Main.projectile[index].type <= 235) - Main.projectile[index].Kill(); - } - } - } - if (sItem.useAmmo > 0) - this.PickAmmo(sItem, ref projToShoot, ref shootSpeed, ref canShoot, ref Damage1, ref knockBack, ItemID.Sets.gunProj[sItem.type]); - else - canShoot = true; - if (ItemID.Sets.gunProj[sItem.type]) - { - knockBack = sItem.knockBack; - Damage1 = weaponDamage; - shootSpeed = sItem.shootSpeed; - } - if (sItem.IsACoin) - canShoot = false; - if (sItem.type == 1254 && projToShoot == 14) - projToShoot = 242; - if (sItem.type == 1255 && projToShoot == 14) - projToShoot = 242; - if (sItem.type == 1265 && projToShoot == 14) - projToShoot = 242; - if (sItem.type == 3542) - { - if (Main.rand.Next(100) < 20) - { - ++projToShoot; - Damage1 *= 3; - } - else - --shootSpeed; - } - if (sItem.type == 1928) - Damage1 /= 2; - if (projToShoot == 73) - { - for (int index = 0; index < 1000; ++index) - { - if (Main.projectile[index].active && Main.projectile[index].owner == i) - { - if (Main.projectile[index].type == 73) - projToShoot = 74; - if (projToShoot == 74 && Main.projectile[index].type == 74) - canShoot = false; - } - } - } - if (canShoot) - { - float num1 = this.GetWeaponKnockback(sItem, knockBack); - if (projToShoot == 228) - num1 = 0.0f; - if (projToShoot == 1 && sItem.type == 120) - projToShoot = 2; - if (sItem.type == 682) - projToShoot = 117; - if (sItem.type == 725) - projToShoot = 120; - if (sItem.type == 2796) - projToShoot = 442; - if (sItem.type == 2223) - projToShoot = 357; - this.ApplyItemTime(sItem); - Vector2 vector2_1 = this.RotatedRelativePoint(this.MountedCenter, true); - bool flag1 = true; - if (sItem.type == 3611) - flag1 = false; - Vector2 vector2_2 = Vector2.UnitX.RotatedBy((double) this.fullRotation); - Vector2 v1 = Main.MouseWorld - vector2_1; - Vector2 v2 = this.itemRotation.ToRotationVector2() * (float) this.direction; - if (sItem.type == 3852 && this.itemAnimation != this.itemAnimationMax - 1) - v1 = (v2.ToRotation() + this.fullRotation).ToRotationVector2(); - if (v1 != Vector2.Zero) - v1.Normalize(); - Vector2 vector2_3 = v1; - float num2 = Vector2.Dot(vector2_2, vector2_3); - if (flag1) - { - if ((double) num2 > 0.0) - this.ChangeDir(1); - else - this.ChangeDir(-1); - } - if (sItem.type == 3094 || sItem.type == 3378 || sItem.type == 3543) - vector2_1.Y = this.position.Y + (float) (this.height / 3); - if (sItem.type == 2611) - { - Vector2 vector2_4 = v1; - if (vector2_4 != Vector2.Zero) - vector2_4.Normalize(); - vector2_1 += vector2_4; - } - if (sItem.type == 3827) - vector2_1 += v1.SafeNormalize(Vector2.Zero).RotatedBy((double) this.direction * -1.57079637050629) * 24f; - if (projToShoot == 9) - { - vector2_1 = new Vector2((float) ((double) this.position.X + (double) this.width * 0.5 + (double) (Main.rand.Next(201) * -this.direction) + ((double) Main.mouseX + (double) Main.screenPosition.X - (double) this.position.X)), this.MountedCenter.Y - 600f); - num1 = 0.0f; - Damage1 *= 2; - } - if (sItem.type == 986 || sItem.type == 281) - { - vector2_1.X += (float) (6 * this.direction); - vector2_1.Y -= 6f * this.gravDir; - } - if (sItem.type == 3007) - { - vector2_1.X -= (float) (4 * this.direction); - vector2_1.Y -= 2f * this.gravDir; - } - float f1 = (float) Main.mouseX + Main.screenPosition.X - vector2_1.X; - float f2 = (float) Main.mouseY + Main.screenPosition.Y - vector2_1.Y; - if (sItem.type == 3852 && this.itemAnimation != this.itemAnimationMax - 1) - { - Vector2 vector2_5 = v1; - f1 = vector2_5.X; - f2 = vector2_5.Y; - } - if ((double) this.gravDir == -1.0) - f2 = Main.screenPosition.Y + (float) Main.screenHeight - (float) Main.mouseY - vector2_1.Y; - float num3 = (float) Math.Sqrt((double) f1 * (double) f1 + (double) f2 * (double) f2); - float num4 = num3; - float num5; - if (float.IsNaN(f1) && float.IsNaN(f2) || (double) f1 == 0.0 && (double) f2 == 0.0) - { - f1 = (float) this.direction; - f2 = 0.0f; - num5 = shootSpeed; - } - else - num5 = shootSpeed / num3; - if (sItem.type == 1929 || sItem.type == 2270) - { - f1 += (float) Main.rand.Next(-50, 51) * 0.03f / num5; - f2 += (float) Main.rand.Next(-50, 51) * 0.03f / num5; - } - float num6 = f1 * num5; - float num7 = f2 * num5; - if (sItem.type == 757) - Damage1 = (int) ((double) Damage1 * 1.25); - if (projToShoot == 250) + if (sItem.shoot == 6 || sItem.shoot == 19 || sItem.shoot == 33 || sItem.shoot == 52 || sItem.shoot == 113 || sItem.shoot == 320 || sItem.shoot == 333 || sItem.shoot == 383 || sItem.shoot == 491) { for (int index = 0; index < 1000; ++index) { - if (Main.projectile[index].active && Main.projectile[index].owner == this.whoAmI && (Main.projectile[index].type == 250 || Main.projectile[index].type == 251)) - Main.projectile[index].Kill(); + if (Main.projectile[index].active && Main.projectile[index].owner == Main.myPlayer && Main.projectile[index].type == sItem.shoot) + canUse = false; } } - if (projToShoot == 12 && Collision.CanHitLine(this.Center, 0, 0, vector2_1 + new Vector2(num6, num7) * 4f, 0, 0)) - vector2_1 += new Vector2(num6, num7) * 3f; - if (projToShoot == 728 && !Collision.CanHitLine(this.Center, 0, 0, vector2_1 + new Vector2(num6, num7) * 2f, 0, 0)) + if (sItem.shoot == 106) { - vector2_1 = this.Center - new Vector2(num6, num7); - num6 *= 0.5f; - num7 *= 0.5f; + int num = 0; + for (int index = 0; index < 1000; ++index) + { + if (Main.projectile[index].active && Main.projectile[index].owner == Main.myPlayer && Main.projectile[index].type == sItem.shoot) + ++num; + } + if (num >= sItem.stack) + canUse = false; } - if (projToShoot == 802 || projToShoot == 842) + if (sItem.shoot == 272) { - Vector2 v3 = new Vector2(num6, num7); - float num8 = 0.7853982f; - Vector2 vector2_6 = v3.SafeNormalize(Vector2.Zero).RotatedBy((double) num8 * ((double) Main.rand.NextFloat() - 0.5)) * (v3.Length() - Main.rand.NextFloatDirection() * 0.7f); - num6 = vector2_6.X; - num7 = vector2_6.Y; + int num = 0; + for (int index = 0; index < 1000; ++index) + { + if (Main.projectile[index].active && Main.projectile[index].owner == Main.myPlayer && Main.projectile[index].type == sItem.shoot) + ++num; + } + if (num >= sItem.stack) + canUse = false; } - if (sItem.useStyle == 5) + if (sItem.shoot == 13 || sItem.shoot == 32 || sItem.shoot >= 230 && sItem.shoot <= 235 || sItem.shoot == 315 || sItem.shoot == 331 || sItem.shoot == 372) { - if (sItem.type == 3029) + for (int index = 0; index < 1000; ++index) { - Vector2 vector2_7 = new Vector2(num6, num7); - vector2_7.X = (float) Main.mouseX + Main.screenPosition.X - vector2_1.X; - vector2_7.Y = (float) ((double) Main.mouseY + (double) Main.screenPosition.Y - (double) vector2_1.Y - 1000.0); - this.itemRotation = (float) Math.Atan2((double) vector2_7.Y * (double) this.direction, (double) vector2_7.X * (double) this.direction); - NetMessage.SendData(13, number: this.whoAmI); - NetMessage.SendData(41, number: this.whoAmI); - } - if (sItem.type == 4381) - { - Vector2 vector2_8 = new Vector2(num6, num7); - vector2_8.X = (float) Main.mouseX + Main.screenPosition.X - vector2_1.X; - vector2_8.Y = (float) ((double) Main.mouseY + (double) Main.screenPosition.Y - (double) vector2_1.Y - 1000.0); - this.itemRotation = (float) Math.Atan2((double) vector2_8.Y * (double) this.direction, (double) vector2_8.X * (double) this.direction); - NetMessage.SendData(13, number: this.whoAmI); - NetMessage.SendData(41, number: this.whoAmI); - } - else if (sItem.type == 3779) - { - this.itemRotation = 0.0f; - NetMessage.SendData(13, number: this.whoAmI); - NetMessage.SendData(41, number: this.whoAmI); - } - else - { - this.itemRotation = (float) Math.Atan2((double) num7 * (double) this.direction, (double) num6 * (double) this.direction) - this.fullRotation; - NetMessage.SendData(13, number: this.whoAmI); - NetMessage.SendData(41, number: this.whoAmI); + if (Main.projectile[index].active && Main.projectile[index].owner == Main.myPlayer && Main.projectile[index].type == sItem.shoot && (double) Main.projectile[index].ai[0] != 2.0) + canUse = false; } } - if (sItem.useStyle == 13) + if (sItem.shoot == 332) { - this.itemRotation = (float) Math.Atan2((double) num7 * (double) this.direction, (double) num6 * (double) this.direction) - this.fullRotation; - NetMessage.SendData(13, number: this.whoAmI); - NetMessage.SendData(41, number: this.whoAmI); - } - if (projToShoot == 17) - { - vector2_1.X = (float) Main.mouseX + Main.screenPosition.X; - vector2_1.Y = (float) Main.mouseY + Main.screenPosition.Y; - if ((double) this.gravDir == -1.0) - vector2_1.Y = Main.screenPosition.Y + (float) Main.screenHeight - (float) Main.mouseY; - } - if (projToShoot == 76) - { - projToShoot += Main.rand.Next(3); - float num9 = (float) Main.screenHeight / Main.GameViewMatrix.Zoom.Y; - float num10 = num4 / (num9 / 2f); - if ((double) num10 > 1.0) - num10 = 1f; - float num11 = num6 + (float) Main.rand.Next(-40, 41) * 0.01f; - float num12 = num7 + (float) Main.rand.Next(-40, 41) * 0.01f; - float SpeedX = num11 * (num10 + 0.25f); - float SpeedY = num12 * (num10 + 0.25f); - int number = Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot, Damage1, num1, i); - Main.projectile[number].ai[1] = 1f; - float num13 = (float) ((double) num10 * 2.0 - 1.0); - if ((double) num13 < -1.0) - num13 = -1f; - if ((double) num13 > 1.0) - num13 = 1f; - float num14 = (float) Math.Round((double) num13 * (double) Player.musicNotes) / (float) Player.musicNotes; - Main.projectile[number].ai[0] = num14; - NetMessage.SendData(27, number: number); - } - else if (sItem.type == 3029) - { - int num15 = 3; - if (projToShoot == 91 || projToShoot == 4 || projToShoot == 5 || projToShoot == 41) + int num = 0; + for (int index = 0; index < 1000; ++index) { - if (Main.rand.Next(3) == 0) - --num15; + if (Main.projectile[index].active && Main.projectile[index].owner == Main.myPlayer && Main.projectile[index].type == sItem.shoot && (double) Main.projectile[index].ai[0] != 2.0) + ++num; } - else if (Main.rand.Next(3) == 0) - ++num15; - for (int index1 = 0; index1 < num15; ++index1) + if (num >= 3) + canUse = false; + } + if (sItem.potion & canUse) + { + if (this.potionDelay <= 0) { - vector2_1 = new Vector2((float) ((double) this.position.X + (double) this.width * 0.5 + (double) (Main.rand.Next(201) * -this.direction) + ((double) Main.mouseX + (double) Main.screenPosition.X - (double) this.position.X)), this.MountedCenter.Y - 600f); - vector2_1.X = (float) (((double) vector2_1.X * 10.0 + (double) this.Center.X) / 11.0) + (float) Main.rand.Next(-100, 101); - vector2_1.Y -= (float) (150 * index1); - float num16 = (float) Main.mouseX + Main.screenPosition.X - vector2_1.X; - float num17 = (float) Main.mouseY + Main.screenPosition.Y - vector2_1.Y; - if ((double) num17 < 0.0) - num17 *= -1f; - if ((double) num17 < 20.0) - num17 = 20f; - float num18 = (float) Math.Sqrt((double) num16 * (double) num16 + (double) num17 * (double) num17); - float num19 = shootSpeed / num18; - float num20 = num16 * num19; - float num21 = num17 * num19; - float num22 = num20 + (float) Main.rand.Next(-40, 41) * 0.03f; - float SpeedY = num21 + (float) Main.rand.Next(-40, 41) * 0.03f; - float SpeedX = num22 * ((float) Main.rand.Next(75, 150) * 0.01f); - vector2_1.X += (float) Main.rand.Next(-50, 51); - int index2 = Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot, Damage1, num1, i); - Main.projectile[index2].noDropItem = true; - } - } - else if (sItem.type == 4381) - { - int num23 = Main.rand.Next(1, 3); - if (Main.rand.Next(3) == 0) - ++num23; - for (int index3 = 0; index3 < num23; ++index3) - { - vector2_1 = new Vector2((float) ((double) this.position.X + (double) this.width * 0.5 + (double) (Main.rand.Next(61) * -this.direction) + ((double) Main.mouseX + (double) Main.screenPosition.X - (double) this.position.X)), this.MountedCenter.Y - 600f); - vector2_1.X = (float) (((double) vector2_1.X * 10.0 + (double) this.Center.X) / 11.0) + (float) Main.rand.Next(-30, 31); - vector2_1.Y -= 150f * Main.rand.NextFloat(); - float num24 = (float) Main.mouseX + Main.screenPosition.X - vector2_1.X; - float num25 = (float) Main.mouseY + Main.screenPosition.Y - vector2_1.Y; - if ((double) num25 < 0.0) - num25 *= -1f; - if ((double) num25 < 20.0) - num25 = 20f; - float num26 = (float) Math.Sqrt((double) num24 * (double) num24 + (double) num25 * (double) num25); - float num27 = shootSpeed / num26; - float num28 = num24 * num27; - float num29 = num25 * num27; - float num30 = num28 + (float) Main.rand.Next(-20, 21) * 0.03f; - float SpeedY = num29 + (float) Main.rand.Next(-40, 41) * 0.03f; - float SpeedX = num30 * ((float) Main.rand.Next(55, 80) * 0.01f); - vector2_1.X += (float) Main.rand.Next(-50, 51); - int index4 = Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot, Damage1, num1, i); - Main.projectile[index4].noDropItem = true; - } - } - else if (sItem.type == 98 || sItem.type == 533) - { - float SpeedX = num6 + (float) Main.rand.Next(-40, 41) * 0.01f; - float SpeedY = num7 + (float) Main.rand.Next(-40, 41) * 0.01f; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot, Damage1, num1, i); - } - else if (sItem.type == 1319) - { - float SpeedX = num6 + (float) Main.rand.Next(-40, 41) * 0.02f; - float SpeedY = num7 + (float) Main.rand.Next(-40, 41) * 0.02f; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot, Damage1, num1, i); - } - else if (sItem.type == 3107) - { - float SpeedX = num6 + (float) Main.rand.Next(-40, 41) * 0.02f; - float SpeedY = num7 + (float) Main.rand.Next(-40, 41) * 0.02f; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot, Damage1, num1, i); - } - else if (ProjectileID.Sets.IsAGolfBall[projToShoot]) - { - Vector2 vector2_9 = new Vector2((float) Main.mouseX + Main.screenPosition.X, (float) Main.mouseY + Main.screenPosition.Y); - Vector2 vector2_10 = vector2_9 - this.Center; - bool flag2 = false; - if ((double) vector2_10.Length() < 100.0) - flag2 = this.TryPlacingAGolfBallNearANearbyTee(vector2_9); - if (flag2) - return; - if ((double) vector2_10.Length() > 100.0 || !Collision.CanHit(this.Center, 1, 1, vector2_9, 1, 1)) - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, num6, num7, projToShoot, Damage1, num1, i); - else - Projectile.NewProjectile(vector2_9.X, vector2_9.Y, 0.0f, 0.0f, projToShoot, Damage1, num1, i); - } - else if (sItem.type == 3053) - { - Vector2 vector2_11 = new Vector2(num6, num7); - vector2_11.Normalize(); - Vector2 vector2_12 = new Vector2((float) Main.rand.Next(-100, 101), (float) Main.rand.Next(-100, 101)); - vector2_12.Normalize(); - Vector2 vector2_13 = vector2_11 * 4f + vector2_12; - vector2_13.Normalize(); - vector2_13 *= sItem.shootSpeed; - float ai1 = (float) Main.rand.Next(10, 80) * (1f / 1000f); - if (Main.rand.Next(2) == 0) - ai1 *= -1f; - float ai0 = (float) Main.rand.Next(10, 80) * (1f / 1000f); - if (Main.rand.Next(2) == 0) - ai0 *= -1f; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, vector2_13.X, vector2_13.Y, projToShoot, Damage1, num1, i, ai0, ai1); - } - else if (sItem.type == 3019) - { - Vector2 vector2_14 = new Vector2(num6, num7); - float num31 = vector2_14.Length(); - vector2_14.X += (float) ((double) Main.rand.Next(-100, 101) * 0.00999999977648258 * (double) num31 * 0.150000005960464); - vector2_14.Y += (float) ((double) Main.rand.Next(-100, 101) * 0.00999999977648258 * (double) num31 * 0.150000005960464); - float num32 = num6 + (float) Main.rand.Next(-40, 41) * 0.03f; - float num33 = num7 + (float) Main.rand.Next(-40, 41) * 0.03f; - vector2_14.Normalize(); - vector2_14 *= num31; - Vector2 vector2_15 = new Vector2(num32 * ((float) Main.rand.Next(50, 150) * 0.01f), num33 * ((float) Main.rand.Next(50, 150) * 0.01f)); - vector2_15.X += (float) Main.rand.Next(-100, 101) * 0.025f; - vector2_15.Y += (float) Main.rand.Next(-100, 101) * 0.025f; - vector2_15.Normalize(); - Vector2 vector2_16 = vector2_15 * num31; - float x = vector2_16.X; - float y = vector2_16.Y; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, x, y, projToShoot, Damage1, num1, i, vector2_14.X, vector2_14.Y); - } - else if (sItem.type == 2797) - { - Vector2 vector2_17 = Vector2.Normalize(new Vector2(num6, num7)) * 40f * sItem.scale; - if (Collision.CanHit(vector2_1, 0, 0, vector2_1 + vector2_17, 0, 0)) - vector2_1 += vector2_17; - float rotation = new Vector2(num6, num7).ToRotation(); - float num34 = 2.094395f; - int num35 = Main.rand.Next(4, 5); - if (Main.rand.Next(4) == 0) - ++num35; - for (int index5 = 0; index5 < num35; ++index5) - { - float num36 = (float) (Main.rand.NextDouble() * 0.200000002980232 + 0.0500000007450581); - Vector2 vector2_18 = new Vector2(num6, num7).RotatedBy((double) num34 * Main.rand.NextDouble() - (double) num34 / 2.0) * num36; - int index6 = Projectile.NewProjectile(vector2_1.X, vector2_1.Y, vector2_18.X, vector2_18.Y, 444, Damage1, num1, i, rotation); - Main.projectile[index6].localAI[0] = (float) projToShoot; - Main.projectile[index6].localAI[1] = shootSpeed; - } - } - else if (sItem.type == 2270) - { - float SpeedX = num6 + (float) Main.rand.Next(-40, 41) * 0.05f; - float SpeedY = num7 + (float) Main.rand.Next(-40, 41) * 0.05f; - if (Main.rand.Next(3) == 0) - { - SpeedX *= (float) (1.0 + (double) Main.rand.Next(-30, 31) * 0.0199999995529652); - SpeedY *= (float) (1.0 + (double) Main.rand.Next(-30, 31) * 0.0199999995529652); - } - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot, Damage1, num1, i); - } - else if (sItem.type == 1930) - { - int num37 = 2 + Main.rand.Next(3); - for (int index = 0; index < num37; ++index) - { - float num38 = num6; - float num39 = num7; - float num40 = 0.025f * (float) index; - float num41 = num38 + (float) Main.rand.Next(-35, 36) * num40; - float num42 = num39 + (float) Main.rand.Next(-35, 36) * num40; - float num43 = (float) Math.Sqrt((double) num41 * (double) num41 + (double) num42 * (double) num42); - float num44 = shootSpeed / num43; - float SpeedX = num41 * num44; - float SpeedY = num42 * num44; - Projectile.NewProjectile(vector2_1.X + (float) ((double) num6 * (double) (num37 - index) * 1.75), vector2_1.Y + (float) ((double) num7 * (double) (num37 - index) * 1.75), SpeedX, SpeedY, projToShoot, Damage1, num1, i, (float) Main.rand.Next(0, 10 * (index + 1))); - } - } - else if (sItem.type == 1931) - { - int num45 = 2; - for (int index = 0; index < num45; ++index) - { - vector2_1 = new Vector2((float) ((double) this.position.X + (double) this.width * 0.5 + (double) (Main.rand.Next(201) * -this.direction) + ((double) Main.mouseX + (double) Main.screenPosition.X - (double) this.position.X)), this.MountedCenter.Y - 600f); - vector2_1.X = (float) (((double) vector2_1.X + (double) this.Center.X) / 2.0) + (float) Main.rand.Next(-200, 201); - vector2_1.Y -= (float) (100 * index); - float num46 = (float) Main.mouseX + Main.screenPosition.X - vector2_1.X; - float num47 = (float) Main.mouseY + Main.screenPosition.Y - vector2_1.Y; - if ((double) this.gravDir == -1.0) - num47 = Main.screenPosition.Y + (float) Main.screenHeight - (float) Main.mouseY - vector2_1.Y; - if ((double) num47 < 0.0) - num47 *= -1f; - if ((double) num47 < 20.0) - num47 = 20f; - float num48 = (float) Math.Sqrt((double) num46 * (double) num46 + (double) num47 * (double) num47); - float num49 = shootSpeed / num48; - float num50 = num46 * num49; - float num51 = num47 * num49; - float SpeedX = num50 + (float) Main.rand.Next(-40, 41) * 0.02f; - float SpeedY = num51 + (float) Main.rand.Next(-40, 41) * 0.02f; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot, Damage1, num1, i, ai1: ((float) Main.rand.Next(5))); - } - } - else if (sItem.type == 2750) - { - int num52 = 1; - for (int index = 0; index < num52; ++index) - { - vector2_1 = new Vector2((float) ((double) this.position.X + (double) this.width * 0.5 + (double) (Main.rand.Next(201) * -this.direction) + ((double) Main.mouseX + (double) Main.screenPosition.X - (double) this.position.X)), this.MountedCenter.Y - 600f); - vector2_1.X = (float) (((double) vector2_1.X + (double) this.Center.X) / 2.0) + (float) Main.rand.Next(-200, 201); - vector2_1.Y -= (float) (100 * index); - float num53 = (float) ((double) Main.mouseX + (double) Main.screenPosition.X - (double) vector2_1.X + (double) Main.rand.Next(-40, 41) * 0.0299999993294477); - float num54 = (float) Main.mouseY + Main.screenPosition.Y - vector2_1.Y; - if ((double) this.gravDir == -1.0) - num54 = Main.screenPosition.Y + (float) Main.screenHeight - (float) Main.mouseY - vector2_1.Y; - if ((double) num54 < 0.0) - num54 *= -1f; - if ((double) num54 < 20.0) - num54 = 20f; - float num55 = (float) Math.Sqrt((double) num53 * (double) num53 + (double) num54 * (double) num54); - float num56 = shootSpeed / num55; - float num57 = num53 * num56; - float num58 = num54 * num56; - float num59 = num57; - float num60 = num58 + (float) Main.rand.Next(-40, 41) * 0.02f; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, num59 * 0.75f, num60 * 0.75f, projToShoot + Main.rand.Next(3), Damage1, num1, i, ai1: ((float) (0.5 + Main.rand.NextDouble() * 0.300000011920929))); - } - } - else if (sItem.type == 3570) - { - int num61 = 3; - for (int index = 0; index < num61; ++index) - { - vector2_1 = new Vector2((float) ((double) this.position.X + (double) this.width * 0.5 + (double) (Main.rand.Next(201) * -this.direction) + ((double) Main.mouseX + (double) Main.screenPosition.X - (double) this.position.X)), this.MountedCenter.Y - 600f); - vector2_1.X = (float) (((double) vector2_1.X + (double) this.Center.X) / 2.0) + (float) Main.rand.Next(-200, 201); - vector2_1.Y -= (float) (100 * index); - float num62 = (float) Main.mouseX + Main.screenPosition.X - vector2_1.X; - float num63 = (float) Main.mouseY + Main.screenPosition.Y - vector2_1.Y; - float ai1 = num63 + vector2_1.Y; - if ((double) num63 < 0.0) - num63 *= -1f; - if ((double) num63 < 20.0) - num63 = 20f; - float num64 = (float) Math.Sqrt((double) num62 * (double) num62 + (double) num63 * (double) num63); - float num65 = shootSpeed / num64; - Vector2 vector2_19 = new Vector2(num62 * num65, num63 * num65) / 2f; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, vector2_19.X, vector2_19.Y, projToShoot, Damage1, num1, i, ai1: ai1); - } - } - else if (sItem.type == 3065) - { - Vector2 vector2_20 = Main.screenPosition + new Vector2((float) Main.mouseX, (float) Main.mouseY); - float ai1 = vector2_20.Y; - if ((double) ai1 > (double) this.Center.Y - 200.0) - ai1 = this.Center.Y - 200f; - for (int index = 0; index < 3; ++index) - { - vector2_1 = this.Center + new Vector2((float) (-Main.rand.Next(0, 401) * this.direction), -600f); - vector2_1.Y -= (float) (100 * index); - Vector2 vector2_21 = vector2_20 - vector2_1; - if ((double) vector2_21.Y < 0.0) - vector2_21.Y *= -1f; - if ((double) vector2_21.Y < 20.0) - vector2_21.Y = 20f; - vector2_21.Normalize(); - Vector2 vector2_22 = vector2_21 * shootSpeed; - float x = vector2_22.X; - float y = vector2_22.Y; - float SpeedX = x; - float SpeedY = y + (float) Main.rand.Next(-40, 41) * 0.02f; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot, Damage1 * 2, num1, i, ai1: ai1); - } - } - else if (sItem.type == 2624) - { - float num66 = 0.3141593f; - int num67 = 5; - Vector2 spinningpoint = new Vector2(num6, num7); - spinningpoint.Normalize(); - spinningpoint *= 40f; - bool flag3 = Collision.CanHit(vector2_1, 0, 0, vector2_1 + spinningpoint, 0, 0); - for (int index7 = 0; index7 < num67; ++index7) - { - float num68 = (float) index7 - (float) (((double) num67 - 1.0) / 2.0); - Vector2 vector2_23 = spinningpoint.RotatedBy((double) num66 * (double) num68); - if (!flag3) - vector2_23 -= spinningpoint; - int index8 = Projectile.NewProjectile(vector2_1.X + vector2_23.X, vector2_1.Y + vector2_23.Y, num6, num7, projToShoot, Damage1, num1, i); - Main.projectile[index8].noDropItem = true; - } - } - else if (sItem.type == 1929) - { - float SpeedX = num6 + (float) Main.rand.Next(-40, 41) * 0.03f; - float SpeedY = num7 + (float) Main.rand.Next(-40, 41) * 0.03f; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot, Damage1, num1, i); - } - else if (sItem.type == 1553) - { - float SpeedX = num6 + (float) Main.rand.Next(-40, 41) * 0.005f; - float SpeedY = num7 + (float) Main.rand.Next(-40, 41) * 0.005f; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot, Damage1, num1, i); - } - else if (sItem.type == 518) - { - float num69 = num6; - float num70 = num7; - float SpeedX = num69 + (float) Main.rand.Next(-40, 41) * 0.04f; - float SpeedY = num70 + (float) Main.rand.Next(-40, 41) * 0.04f; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot, Damage1, num1, i); - } - else if (sItem.type == 1265) - { - float num71 = num6; - float num72 = num7; - float SpeedX = num71 + (float) Main.rand.Next(-30, 31) * 0.03f; - float SpeedY = num72 + (float) Main.rand.Next(-30, 31) * 0.03f; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot, Damage1, num1, i); - } - else if (sItem.type == 4262) - { - float num73 = 2.666667f; - Vector2 bottom = this.Bottom; - int num74 = (int) this.Bottom.X / 16; - float num75 = Math.Abs((float) Main.mouseX + Main.screenPosition.X - this.position.X) / 16f; - if (this.direction < 0) - ++num75; - int num76 = (int) num75; - if (num76 > 15) - num76 = 15; - Point tileCoordinates = this.Center.ToTileCoordinates(); - int maxDistance = 31; - for (int index9 = num76; index9 >= 0; --index9) - { - if (Collision.CanHitLine(this.Center, 1, 1, this.Center + new Vector2((float) (16 * index9 * this.direction), 0.0f), 1, 1)) + if (sItem.type == 227) { - Point result; - if (WorldUtils.Find(new Point(tileCoordinates.X + this.direction * index9, tileCoordinates.Y), Searches.Chain((GenSearch) new Searches.Down(maxDistance), (GenCondition) new Conditions.MysticSnake()), out result)) + this.potionDelay = this.restorationDelayTime; + this.AddBuff(21, this.potionDelay); + } + else + { + this.potionDelay = this.potionDelayTime; + this.AddBuff(21, this.potionDelay); + } + } + else + canUse = false; + } + if (sItem.mana > 0 && this.silence) + canUse = false; + if (sItem.mana > 0 & canUse) + { + bool flag5 = false; + if (sItem.type == 2795) + flag5 = true; + if (sItem.shoot > 0 && ProjectileID.Sets.TurretFeature[sItem.shoot] && this.altFunctionUse == 2) + flag5 = true; + if (sItem.shoot > 0 && ProjectileID.Sets.MinionTargettingFeature[sItem.shoot] && this.altFunctionUse == 2) + flag5 = true; + if (sItem.type != (int) sbyte.MaxValue || !this.spaceGun) + { + if (this.statMana >= (int) ((double) sItem.mana * (double) this.manaCost)) + { + if (!flag5) + this.statMana -= (int) ((double) sItem.mana * (double) this.manaCost); + } + else if (this.manaFlower) + { + this.QuickMana(); + if (this.statMana >= (int) ((double) sItem.mana * (double) this.manaCost)) { - int num77 = result.Y; - while (Main.tile[result.X, num77 - 1].active()) - { - --num77; - if (Main.tile[result.X, num77 - 1] == null || num77 < 10 || result.Y - num77 > 7) - { - num77 = -1; - break; - } - } - if (num77 >= 10) - { - result.Y = num77; - for (int index10 = 0; index10 < 1000; ++index10) - { - Projectile projectile = Main.projectile[index10]; - if (projectile.active && projectile.owner == this.whoAmI && projectile.type == projToShoot) - { - if ((double) projectile.ai[1] == 2.0) - projectile.timeLeft = 4; - else - projectile.Kill(); - } - } - Projectile.NewProjectile((float) (result.X * 16 + 8), (float) (result.Y * 16 + 8 - 16), 0.0f, -num73, projToShoot, Damage1, num1, i, (float) (result.Y * 16 + 8 - 16)); - break; - } + if (!flag5) + this.statMana -= (int) ((double) sItem.mana * (double) this.manaCost); } + else + canUse = false; } + else + canUse = false; } + if (((this.whoAmI != Main.myPlayer || sItem.buffType == 0 ? 0 : ((uint) sItem.buffTime > 0U ? 1 : 0)) & (canUse ? 1 : 0)) != 0) + this.AddBuff(sItem.buffType, sItem.buffTime); } - else if (sItem.type == 4952) + if ((sItem.shoot <= 0 || !ProjectileID.Sets.MinionTargettingFeature[sItem.shoot] ? 0 : (this.altFunctionUse == 2 ? 1 : 0)) == 0) + this.ItemCheck_ApplyPetBuffs(sItem); + if (this.whoAmI == Main.myPlayer && (double) this.gravDir == 1.0 && sItem.mountType != -1 && this.mount.CanMount(sItem.mountType, this)) + this.mount.SetMount(sItem.mountType, this); + if (sItem.type == 43 && Main.dayTime) + canUse = false; + if (sItem.type == 544 && Main.dayTime) + canUse = false; + if (sItem.type == 556 && Main.dayTime) + canUse = false; + if (sItem.type == 557 && Main.dayTime) + canUse = false; + if (sItem.type == 70 && !this.ZoneCorrupt) + canUse = false; + if (sItem.type == 1133 && !this.ZoneJungle) + canUse = false; + if (sItem.type == 1844 && (Main.dayTime || Main.pumpkinMoon || Main.snowMoon || DD2Event.Ongoing)) + canUse = false; + if (sItem.type == 1958 && (Main.dayTime || Main.pumpkinMoon || Main.snowMoon || DD2Event.Ongoing)) + canUse = false; + if (sItem.type == 2767 && (!Main.dayTime || Main.eclipse || !Main.hardMode)) + canUse = false; + if (sItem.type == 3601 && (!NPC.downedGolemBoss || !Main.hardMode || NPC.AnyDanger() || NPC.AnyoneNearCultists())) + canUse = false; + if (!this.SummonItemCheck()) + canUse = false; + if (sItem.shoot == 17 & canUse && i == Main.myPlayer) { - Vector2 vector2_24 = Main.rand.NextVector2Circular(1f, 1f) + Main.rand.NextVector2CircularEdge(3f, 3f); - if ((double) vector2_24.Y > 0.0) - vector2_24.Y *= -1f; - float num78 = (float) ((double) this.itemAnimation / (double) this.itemAnimationMax * 0.660000026226044) + this.miscCounterNormalized; - vector2_1 = this.MountedCenter + new Vector2((float) (this.direction * 15), this.gravDir * 3f); - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, vector2_24.X, vector2_24.Y, projToShoot, Damage1, num1, i, -1f, num78 % 1f); - } - else if (sItem.type == 4953) - { - float num79 = 0.3141593f; - int num80 = 5; - Vector2 spinningpoint = new Vector2(num6, num7); - spinningpoint.Normalize(); - spinningpoint *= 40f; - int num81 = Collision.CanHit(vector2_1, 0, 0, vector2_1 + spinningpoint, 0, 0) ? 1 : 0; - int num82 = (this.itemAnimationMax - this.itemAnimation) / 2; - int num83 = num82; - if (this.direction == 1) - num83 = 4 - num82; - float num84 = (float) num83 - (float) (((double) num80 - 1.0) / 2.0); - Vector2 vector2_25 = spinningpoint.RotatedBy((double) num79 * (double) num84); - if (num81 == 0) - vector2_25 -= spinningpoint; - Vector2 mouseWorld = Main.MouseWorld; - Vector2 vector2_26 = vector2_1 + vector2_25; - Vector2 vector2_27 = vector2_26.DirectionTo(mouseWorld).SafeNormalize(-Vector2.UnitY); - Vector2 vector2_28 = this.Center.DirectionTo(this.Center + new Vector2(num6, num7)).SafeNormalize(-Vector2.UnitY); - float lerpValue = Utils.GetLerpValue(100f, 40f, mouseWorld.Distance(this.Center), true); - if ((double) lerpValue > 0.0) - vector2_27 = Vector2.Lerp(vector2_27, vector2_28, lerpValue).SafeNormalize(new Vector2(num6, num7).SafeNormalize(-Vector2.UnitY)); - Vector2 vector2_29 = vector2_27 * shootSpeed; - if (num82 == 2) - { - projToShoot = 932; - Damage1 *= 2; - } - if (projToShoot == 932) - { - float ai1 = (float) ((double) this.miscCounterNormalized * 12.0 % 1.0); - Vector2 velocity = vector2_29.SafeNormalize(Vector2.Zero) * (shootSpeed * 2f); - Projectile.NewProjectile(vector2_26, velocity, projToShoot, Damage1, num1, i, ai1: ai1); - } - else - { - int index = Projectile.NewProjectile(vector2_26, vector2_29, projToShoot, Damage1, num1, i); - Main.projectile[index].noDropItem = true; - } - } - else if (sItem.type == 534) - { - int num85 = Main.rand.Next(4, 6); - for (int index = 0; index < num85; ++index) - { - float num86 = num6; - float num87 = num7; - float SpeedX = num86 + (float) Main.rand.Next(-40, 41) * 0.05f; - float SpeedY = num87 + (float) Main.rand.Next(-40, 41) * 0.05f; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot, Damage1, num1, i); - } - } - else if (sItem.type == 4703) - { - float num88 = 1.570796f; - for (int index = 0; index < 4; ++index) - { - Vector2 v4 = new Vector2(num6, num7); - float num89 = v4.Length(); - v4 = (v4 + v4.SafeNormalize(Vector2.Zero).RotatedBy((double) num88 * (double) Main.rand.NextFloat()) * Main.rand.NextFloatDirection() * 6f).SafeNormalize(Vector2.Zero) * num89; - float x = v4.X; - float y = v4.Y; - float SpeedX = x + (float) Main.rand.Next(-40, 41) * 0.05f; - float SpeedY = y + (float) Main.rand.Next(-40, 41) * 0.05f; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot, Damage1, num1, i); - } - } - else if (sItem.type == 4270) - { - Vector2 targetSpot = Main.MouseWorld + Main.rand.NextVector2Circular(8f, 8f); - Vector2 worldCoordinates = this.FindSharpTearsSpot(targetSpot).ToWorldCoordinates((float) Main.rand.Next(17), (float) Main.rand.Next(17)); - Vector2 vector2_30 = (targetSpot - worldCoordinates).SafeNormalize(-Vector2.UnitY) * 16f; - Projectile.NewProjectile(worldCoordinates.X, worldCoordinates.Y, vector2_30.X, vector2_30.Y, projToShoot, Damage1, num1, i, ai1: ((float) ((double) Main.rand.NextFloat() * 0.5 + 0.5))); - } - else if (sItem.type == 4715) - { - Vector2 vector2_31 = Main.MouseWorld; - List validTargets; - int num90 = this.GetSparkleGuitarTarget(out validTargets) ? 1 : 0; - if (num90 != 0) - { - NPC npc = validTargets[Main.rand.Next(validTargets.Count)]; - vector2_31 = npc.Center + npc.velocity * 20f; - } - Vector2 vector2_32 = vector2_31 - this.Center; - if (num90 == 0) - { - vector2_31 += Main.rand.NextVector2Circular(24f, 24f); - if ((double) vector2_32.Length() > 700.0) - { - vector2_32 *= 700f / vector2_32.Length(); - vector2_31 = this.Center + vector2_32; - } - } - Vector2 vector2_33 = Main.rand.NextVector2CircularEdge(1f, 1f); - if ((double) vector2_33.Y > 0.0) - vector2_33 *= -1f; - if ((double) Math.Abs(vector2_33.Y) < 0.5) - vector2_33.Y = (float) (-(double) Main.rand.NextFloat() * 0.5 - 0.5); - Vector2 vector2_34 = vector2_33 * (vector2_32.Length() * 2f); - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, vector2_34.X, vector2_34.Y, projToShoot, Damage1, num1, i, vector2_31.X, vector2_31.Y); - } - else if (sItem.type == 4722) - { - Vector2 vector2_35 = Main.MouseWorld; - List validTargets; - bool sparkleGuitarTarget = this.GetSparkleGuitarTarget(out validTargets); - if (sparkleGuitarTarget) - { - NPC npc = validTargets[Main.rand.Next(validTargets.Count)]; - vector2_35 = npc.Center + npc.velocity * 20f; - } - Vector2 vector2_36 = vector2_35 - this.Center; - Vector2 vector2_37 = Main.rand.NextVector2CircularEdge(1f, 1f); - float num91 = 1f; - int num92 = 1; - for (int index11 = 0; index11 < num92; ++index11) - { - if (!sparkleGuitarTarget) - { - vector2_35 += Main.rand.NextVector2Circular(24f, 24f); - if ((double) vector2_36.Length() > 700.0) - { - vector2_36 *= 700f / vector2_36.Length(); - vector2_35 = this.Center + vector2_36; - } - float num93 = Utils.GetLerpValue(0.0f, 6f, this.velocity.Length(), true) * 0.8f; - vector2_37 = (vector2_37 * (1f - num93) + this.velocity * num93).SafeNormalize(Vector2.UnitX); - } - float num94 = 60f; - float num95 = (float) ((double) Main.rand.NextFloatDirection() * 3.14159274101257 * (1.0 / (double) num94) * 0.5) * num91; - float num96 = num94 / 2f; - float num97 = (float) (12.0 + (double) Main.rand.NextFloat() * 2.0); - Vector2 vector2_38 = vector2_37 * num97; - Vector2 vector2_39 = new Vector2(0.0f, 0.0f); - Vector2 spinningpoint = vector2_38; - for (int index12 = 0; (double) index12 < (double) num96; ++index12) - { - vector2_39 += spinningpoint; - spinningpoint = spinningpoint.RotatedBy((double) num95); - } - Vector2 vector2_40 = -vector2_39; - Vector2 position = vector2_35 + vector2_40; - float lerpValue = Utils.GetLerpValue((float) this.itemAnimationMax, 0.0f, (float) this.itemAnimation, true); - Vector2 velocity = vector2_38; - int Type = projToShoot; - int Damage2 = Damage1; - double num98 = (double) num1; - int Owner = i; - double num99 = (double) num95; - double num100 = (double) lerpValue; - Projectile.NewProjectile(position, velocity, Type, Damage2, (float) num98, Owner, (float) num99, (float) num100); - } - } - else if (sItem.type == 4607) - Player.SpawnMinionOnCursor(i, projToShoot, damage, num1); - else if (sItem.type == 2188) - { - int num101 = 4; - if (Main.rand.Next(3) == 0) - ++num101; - if (Main.rand.Next(4) == 0) - ++num101; - if (Main.rand.Next(5) == 0) - ++num101; - for (int index = 0; index < num101; ++index) - { - float num102 = num6; - float num103 = num7; - float num104 = 0.05f * (float) index; - float num105 = num102 + (float) Main.rand.Next(-35, 36) * num104; - float num106 = num103 + (float) Main.rand.Next(-35, 36) * num104; - float num107 = (float) Math.Sqrt((double) num105 * (double) num105 + (double) num106 * (double) num106); - float num108 = shootSpeed / num107; - float SpeedX = num105 * num108; - float SpeedY = num106 * num108; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot, Damage1, num1, i); - } - } - else if (sItem.type == 1308) - { - int num109 = 3; - if (Main.rand.Next(3) == 0) - ++num109; - for (int index = 0; index < num109; ++index) - { - float num110 = num6; - float num111 = num7; - float num112 = 0.05f * (float) index; - float num113 = num110 + (float) Main.rand.Next(-35, 36) * num112; - float num114 = num111 + (float) Main.rand.Next(-35, 36) * num112; - float num115 = (float) Math.Sqrt((double) num113 * (double) num113 + (double) num114 * (double) num114); - float num116 = shootSpeed / num115; - float SpeedX = num113 * num116; - float SpeedY = num114 * num116; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot, Damage1, num1, i); - } - } - else if (sItem.type == 1258) - { - float num117 = num6; - float num118 = num7; - float SpeedX = num117 + (float) Main.rand.Next(-40, 41) * 0.01f; - float SpeedY = num118 + (float) Main.rand.Next(-40, 41) * 0.01f; - vector2_1.X += (float) Main.rand.Next(-40, 41) * 0.05f; - vector2_1.Y += (float) Main.rand.Next(-45, 36) * 0.05f; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot, Damage1, num1, i); - } - else if (sItem.type == 964) - { - int num119 = Main.rand.Next(3, 5); - for (int index = 0; index < num119; ++index) - { - float num120 = num6; - float num121 = num7; - float SpeedX = num120 + (float) Main.rand.Next(-35, 36) * 0.04f; - float SpeedY = num121 + (float) Main.rand.Next(-35, 36) * 0.04f; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot, Damage1, num1, i); - } - } - else if (sItem.type == 1569) - { - int num122 = 4; - if (Main.rand.Next(2) == 0) - ++num122; - if (Main.rand.Next(4) == 0) - ++num122; - if (Main.rand.Next(8) == 0) - ++num122; - if (Main.rand.Next(16) == 0) - ++num122; - for (int index = 0; index < num122; ++index) - { - float num123 = num6; - float num124 = num7; - float num125 = 0.05f * (float) index; - float num126 = num123 + (float) Main.rand.Next(-35, 36) * num125; - float num127 = num124 + (float) Main.rand.Next(-35, 36) * num125; - float num128 = (float) Math.Sqrt((double) num126 * (double) num126 + (double) num127 * (double) num127); - float num129 = shootSpeed / num128; - float SpeedX = num126 * num129; - float SpeedY = num127 * num129; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot, Damage1, num1, i); - } - } - else if (sItem.type == 1572 || sItem.type == 2366 || sItem.type == 3571 || sItem.type == 3569) - { - int num130 = sItem.type == 3571 ? 1 : (sItem.type == 3569 ? 1 : 0); int i1 = (int) ((double) Main.mouseX + (double) Main.screenPosition.X) / 16; int j = (int) ((double) Main.mouseY + (double) Main.screenPosition.Y) / 16; if ((double) this.gravDir == -1.0) j = (int) ((double) Main.screenPosition.Y + (double) Main.screenHeight - (double) Main.mouseY) / 16; - if (num130 == 0) + Tile tile = Main.tile[i1, j]; + if (tile.active() && (tile.type == (ushort) 0 || tile.type == (ushort) 2 || tile.type == (ushort) 23 || tile.type == (ushort) 109 || tile.type == (ushort) 199)) { - while (j < Main.maxTilesY - 10 && Main.tile[i1, j] != null && !WorldGen.SolidTile2(i1, j) && Main.tile[i1 - 1, j] != null && !WorldGen.SolidTile2(i1 - 1, j) && Main.tile[i1 + 1, j] != null && !WorldGen.SolidTile2(i1 + 1, j)) - ++j; - --j; - } - int index = Projectile.NewProjectile((float) Main.mouseX + Main.screenPosition.X, (float) (j * 16 - 24), 0.0f, 15f, projToShoot, Damage1, num1, i); - Main.projectile[index].originalDamage = damage; - this.UpdateMaxTurrets(); - } - else if (sItem.type == 1244 || sItem.type == 1256) - { - int index = Projectile.NewProjectile(vector2_1.X, vector2_1.Y, num6, num7, projToShoot, Damage1, num1, i); - Main.projectile[index].ai[0] = (float) Main.mouseX + Main.screenPosition.X; - Main.projectile[index].ai[1] = (float) Main.mouseY + Main.screenPosition.Y; - } - else if (sItem.type == 1229) - { - int num131 = 2; - if (Main.rand.Next(3) == 0) - ++num131; - for (int index13 = 0; index13 < num131; ++index13) - { - float SpeedX = num6; - float SpeedY = num7; - if (index13 > 0) + WorldGen.KillTile(i1, j, noItem: true); + if (!Main.tile[i1, j].active()) { - SpeedX += (float) Main.rand.Next(-35, 36) * 0.04f; - SpeedY += (float) Main.rand.Next(-35, 36) * 0.04f; + if (Main.netMode == 1) + NetMessage.SendData(17, number: 4, number2: ((float) i1), number3: ((float) j)); } - if (index13 > 1) + else + canUse = false; + } + else + canUse = false; + } + if (canUse) + canUse = this.HasAmmo(sItem, canUse); + if (canUse) + { + if (sItem.pick > 0 || sItem.axe > 0 || sItem.hammer > 0) + this.toolTime = 1; + if (this.grappling[0] > -1) + { + this.pulley = false; + this.pulleyDir = (byte) 1; + if (this.controlRight) + this.direction = 1; + else if (this.controlLeft) + this.direction = -1; + } + this.channel = sItem.channel; + this.attackCD = 0; + this.ApplyAnimation(sItem); + if (sItem.UseSound != null) + Main.PlaySound(sItem.UseSound, this.Center); + } + if ((sItem.shoot <= 0 || !ProjectileID.Sets.MinionTargettingFeature[sItem.shoot] ? 0 : (this.altFunctionUse == 2 ? 1 : 0)) == 0 & canUse && this.whoAmI == Main.myPlayer && sItem.shoot >= 0 && sItem.shoot < 714 && (ProjectileID.Sets.LightPet[sItem.shoot] || Main.projPet[sItem.shoot])) + { + if (ProjectileID.Sets.MinionSacrificable[sItem.shoot]) + { + List intList = new List(); + float num5 = 0.0f; + for (int index3 = 0; index3 < 1000; ++index3) { - SpeedX += (float) Main.rand.Next(-35, 36) * 0.04f; - SpeedY += (float) Main.rand.Next(-35, 36) * 0.04f; + if (Main.projectile[index3].active && Main.projectile[index3].owner == i && Main.projectile[index3].minion) + { + int index4; + for (index4 = 0; index4 < intList.Count; ++index4) + { + if ((double) Main.projectile[intList[index4]].minionSlots > (double) Main.projectile[index3].minionSlots) + { + intList.Insert(index4, index3); + break; + } + } + if (index4 == intList.Count) + intList.Add(index3); + num5 += Main.projectile[index3].minionSlots; + } } - if (index13 > 2) + float num6 = (float) ItemID.Sets.StaffMinionSlotsRequired[sItem.type]; + float num7 = 0.0f; + int num8 = 388; + int index5 = -1; + for (int index6 = 0; index6 < intList.Count; ++index6) { - SpeedX += (float) Main.rand.Next(-35, 36) * 0.04f; - SpeedY += (float) Main.rand.Next(-35, 36) * 0.04f; + int type = Main.projectile[intList[index6]].type; + if (type == 626) + { + intList.RemoveAt(index6); + --index6; + } + if (type == 627) + { + if (Main.projectile[(int) Main.projectile[intList[index6]].localAI[1]].type == 628) + index5 = intList[index6]; + intList.RemoveAt(index6); + --index6; + } } - int index14 = Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot, Damage1, num1, i); - Main.projectile[index14].noDropItem = true; - } - } - else if (sItem.type == 1121) - { - int num132 = Main.rand.Next(1, 4); - if (Main.rand.Next(6) == 0) - ++num132; - if (Main.rand.Next(6) == 0) - ++num132; - if (this.strongBees && Main.rand.Next(3) == 0) - ++num132; - for (int index15 = 0; index15 < num132; ++index15) - { - float num133 = num6; - float num134 = num7; - float SpeedX = num133 + (float) Main.rand.Next(-35, 36) * 0.02f; - float SpeedY = num134 + (float) Main.rand.Next(-35, 36) * 0.02f; - int index16 = Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, this.beeType(), this.beeDamage(Damage1), this.beeKB(num1), i); - Main.projectile[index16].magic = true; - } - } - else if (sItem.type == 1155) - { - int num135 = Main.rand.Next(2, 5); - for (int index = 0; index < num135; ++index) - { - float num136 = num6; - float num137 = num7; - float SpeedX = num136 + (float) Main.rand.Next(-35, 36) * 0.02f; - float SpeedY = num137 + (float) Main.rand.Next(-35, 36) * 0.02f; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot, Damage1, num1, i); - } - } - else if (sItem.type == 1801) - { - int num138 = Main.rand.Next(2, 4); - for (int index = 0; index < num138; ++index) - { - float num139 = num6; - float num140 = num7; - float SpeedX = num139 + (float) Main.rand.Next(-35, 36) * 0.05f; - float SpeedY = num140 + (float) Main.rand.Next(-35, 36) * 0.05f; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot, Damage1, num1, i); - } - } - else if (sItem.type == 679) - { - for (int index = 0; index < 6; ++index) - { - float num141 = num6; - float num142 = num7; - float SpeedX = num141 + (float) Main.rand.Next(-40, 41) * 0.05f; - float SpeedY = num142 + (float) Main.rand.Next(-40, 41) * 0.05f; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot, Damage1, num1, i); - } - } - else if (sItem.type == 1156) - { - for (int index = 0; index < 3; ++index) - { - float num143 = num6; - float num144 = num7; - float SpeedX = num143 + (float) Main.rand.Next(-40, 41) * 0.05f; - float SpeedY = num144 + (float) Main.rand.Next(-40, 41) * 0.05f; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot, Damage1, num1, i); - } - } - else if (sItem.type == 4682) - { - for (int index = 0; index < 3; ++index) - { - float num145 = num6; - float num146 = num7; - float SpeedX = num145 + (float) Main.rand.Next(-20, 21) * 0.1f; - float SpeedY = num146 + (float) Main.rand.Next(-20, 21) * 0.1f; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot, Damage1, num1, i); - } - } - else if (sItem.type == 2623) - { - for (int index = 0; index < 3; ++index) - { - float num147 = num6; - float num148 = num7; - float SpeedX = num147 + (float) Main.rand.Next(-40, 41) * 0.1f; - float SpeedY = num148 + (float) Main.rand.Next(-40, 41) * 0.1f; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot, Damage1, num1, i); - } - } - else if (sItem.type == 3210) - { - Vector2 vector2_41 = new Vector2(num6, num7); - vector2_41.X += (float) Main.rand.Next(-30, 31) * 0.04f; - vector2_41.Y += (float) Main.rand.Next(-30, 31) * 0.03f; - vector2_41.Normalize(); - vector2_41 *= (float) Main.rand.Next(70, 91) * 0.1f; - vector2_41.X += (float) Main.rand.Next(-30, 31) * 0.04f; - vector2_41.Y += (float) Main.rand.Next(-30, 31) * 0.03f; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, vector2_41.X, vector2_41.Y, projToShoot, Damage1, num1, i, (float) Main.rand.Next(20)); - } - else if (sItem.type == 434) - { - float SpeedX = num6; - float SpeedY = num7; - if (this.itemAnimation < 5) - { - float num149 = SpeedX + (float) Main.rand.Next(-40, 41) * 0.01f; - float num150 = SpeedY + (float) Main.rand.Next(-40, 41) * 0.01f; - SpeedX = num149 * 1.1f; - SpeedY = num150 * 1.1f; - } - else if (this.itemAnimation < 10) - { - float num151 = SpeedX + (float) Main.rand.Next(-20, 21) * 0.01f; - float num152 = SpeedY + (float) Main.rand.Next(-20, 21) * 0.01f; - SpeedX = num151 * 1.05f; - SpeedY = num152 * 1.05f; - } - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot, Damage1, num1, i); - } - else if (sItem.type == 1157) - { - projToShoot = Main.rand.Next(191, 195); - int index = Player.SpawnMinionOnCursor(i, projToShoot, damage, num1); - Main.projectile[index].localAI[0] = 30f; - } - else if (sItem.type == 1802) - Player.SpawnMinionOnCursor(i, projToShoot, damage, num1); - else if (sItem.type == 2364 || sItem.type == 2365) - Player.SpawnMinionOnCursor(i, projToShoot, damage, num1); - else if (sItem.type == 2535) - { - Vector2 vector2_42 = new Vector2(0.0f, 0.0f).RotatedBy(1.57079637050629); - Player.SpawnMinionOnCursor(i, projToShoot, damage, num1, vector2_42, vector2_42); - Vector2 vector2_43 = vector2_42.RotatedBy(-3.14159274101257); - Player.SpawnMinionOnCursor(i, projToShoot + 1, damage, num1, vector2_43, vector2_43); - } - else if (sItem.type == 2551) - Player.SpawnMinionOnCursor(i, projToShoot + Main.rand.Next(3), damage, num1); - else if (sItem.type == 2584) - Player.SpawnMinionOnCursor(i, projToShoot + Main.rand.Next(3), damage, num1); - else if (sItem.type == 2621) - Player.SpawnMinionOnCursor(i, projToShoot, damage, num1); - else if (sItem.type == 2749 || sItem.type == 3249 || sItem.type == 3474 || sItem.type == 4273 || sItem.type == 4281) - Player.SpawnMinionOnCursor(i, projToShoot, damage, num1); - else if (sItem.type == 3531) - { - int num153 = -1; - int index17 = -1; - for (int index18 = 0; index18 < 1000; ++index18) - { - if (Main.projectile[index18].active && Main.projectile[index18].owner == Main.myPlayer) + if (index5 != -1) { - if (num153 == -1 && Main.projectile[index18].type == 625) - num153 = index18; - if (index17 == -1 && Main.projectile[index18].type == 628) - index17 = index18; - if (num153 != -1 && index17 != -1) - break; + intList.Add(index5); + intList.Add(Projectile.GetByUUID(Main.projectile[index5].owner, Main.projectile[index5].ai[0])); } - } - if (num153 == -1 && index17 == -1) - { - float SpeedX = 0.0f; - float SpeedY = 0.0f; - vector2_1.X = (float) Main.mouseX + Main.screenPosition.X; - vector2_1.Y = (float) Main.mouseY + Main.screenPosition.Y; - int index19 = Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot, Damage1, num1, i); - int index20 = Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot + 1, Damage1, num1, i, (float) index19); - int index21 = Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot + 2, Damage1, num1, i, (float) index20); - int index22 = Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, projToShoot + 3, Damage1, num1, i, (float) index21); - Main.projectile[index20].localAI[1] = (float) index21; - Main.projectile[index21].localAI[1] = (float) index22; - Main.projectile[index19].originalDamage = damage; - Main.projectile[index20].originalDamage = damage; - Main.projectile[index21].originalDamage = damage; - Main.projectile[index22].originalDamage = damage; + for (int index7 = 0; index7 < intList.Count && (double) num5 - (double) num7 > (double) this.maxMinions - (double) num6; ++index7) + { + int type = Main.projectile[intList[index7]].type; + if (type != num8 && type != 625 && type != 628 && type != 623) + { + if (type == 388 && num8 == 387) + num8 = 388; + if (type == 387 && num8 == 388) + num8 = 387; + num7 += Main.projectile[intList[index7]].minionSlots; + if (type == 626 || type == 627) + { + int byUuid = Projectile.GetByUUID(Main.projectile[intList[index7]].owner, Main.projectile[intList[index7]].ai[0]); + if (byUuid >= 0) + { + Projectile projectile1 = Main.projectile[byUuid]; + if (projectile1.type != 625) + projectile1.localAI[1] = Main.projectile[intList[index7]].localAI[1]; + Projectile projectile2 = Main.projectile[(int) Main.projectile[intList[index7]].localAI[1]]; + projectile2.ai[0] = Main.projectile[intList[index7]].ai[0]; + projectile2.ai[1] = 1f; + projectile2.netUpdate = true; + } + } + Main.projectile[intList[index7]].Kill(); + } + } + intList.Clear(); + if ((double) num5 + (double) num6 >= 9.0) + AchievementsHelper.HandleSpecialEvent(this, 6); } else { - if (num153 == -1 || index17 == -1) - return; - int num154 = (int) Main.projectile[index17].ai[0]; - int index23 = Projectile.NewProjectile(vector2_1.X, vector2_1.Y, num6, num7, projToShoot + 1, Damage1, num1, i, (float) num154); - int index24 = Projectile.NewProjectile(vector2_1.X, vector2_1.Y, num6, num7, projToShoot + 2, Damage1, num1, i, (float) index23); - Main.projectile[index23].localAI[1] = (float) index24; - Main.projectile[index23].netUpdate = true; - Main.projectile[index23].ai[1] = 1f; - Main.projectile[index24].localAI[1] = (float) index17; - Main.projectile[index24].netUpdate = true; - Main.projectile[index24].ai[1] = 1f; - Main.projectile[index17].ai[0] = (float) index24; - Main.projectile[index17].netUpdate = true; - Main.projectile[index17].ai[1] = 1f; - Main.projectile[index23].originalDamage = damage; - Main.projectile[index24].originalDamage = damage; - Main.projectile[index17].originalDamage = damage; - } - } - else if (sItem.type == 1309 || sItem.type == 4758 || sItem.type == 4269 || sItem.type == 5005) - Player.SpawnMinionOnCursor(i, projToShoot, damage, num1); - else if (sItem.shoot > 0 && (Main.projPet[sItem.shoot] || sItem.shoot == 72 || sItem.shoot == 18 || sItem.shoot == 500 || sItem.shoot == 650) && !sItem.summon) - { - for (int index = 0; index < 1000; ++index) - { - if (Main.projectile[index].active && Main.projectile[index].owner == this.whoAmI) + for (int index = 0; index < 1000; ++index) { + if (Main.projectile[index].active && Main.projectile[index].owner == i && Main.projectile[index].type == sItem.shoot) + Main.projectile[index].Kill(); if (sItem.shoot == 72) { - if (Main.projectile[index].type == 72 || Main.projectile[index].type == 86 || Main.projectile[index].type == 87) + if (Main.projectile[index].active && Main.projectile[index].owner == i && Main.projectile[index].type == 86) + Main.projectile[index].Kill(); + if (Main.projectile[index].active && Main.projectile[index].owner == i && Main.projectile[index].type == 87) Main.projectile[index].Kill(); } - else if (sItem.shoot == Main.projectile[index].type) - Main.projectile[index].Kill(); } } - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, num6, num7, projToShoot, 0, 0.0f, i); } - else if (sItem.type == 3006) + } + if (!this.controlUseItem) + { + int num = this.channel ? 1 : 0; + this.channel = false; + } + if (this.itemAnimation > 0) + { + this.itemAnimationMax = !sItem.melee ? sItem.useAnimation : (int) ((double) sItem.useAnimation * (double) this.meleeSpeed); + if (sItem.mana > 0 && !flag1 && (sItem.type != (int) sbyte.MaxValue || !this.spaceGun)) + this.manaRegenDelay = (int) this.maxRegenDelay; + if (Main.dedServ) { - Vector2 vector2_44 = Main.ReverseGravitySupport(Main.MouseScreen) + Main.screenPosition; - int num155 = 0; - float num156 = new Vector2(num6, num7).Length(); - float num157 = (vector2_44 - vector2_1).Length(); - while (Collision.CanHitLine(this.position, this.width, this.height, vector2_1, 1, 1)) - { - ++num155; - vector2_1.X += num6; - vector2_1.Y += num7; - if ((double) (vector2_1 - vector2_44).Length() < 20.0 + (double) Math.Abs(num6) + (double) Math.Abs(num7)) - { - vector2_1 = vector2_44; - break; - } - if ((double) num156 * (double) num155 >= (double) num157) - { - vector2_1 = vector2_44; - break; - } - } - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, 0.0f, 0.0f, projToShoot, Damage1, num1, i); - } - else if (sItem.type == 3014) - { - Vector2 vector2_45; - vector2_45.X = (float) Main.mouseX + Main.screenPosition.X; - vector2_45.Y = (float) Main.mouseY + Main.screenPosition.Y; - while (Collision.CanHitLine(this.position, this.width, this.height, vector2_1, 1, 1)) - { - vector2_1.X += num6; - vector2_1.Y += num7; - if ((double) (vector2_1 - vector2_45).Length() < 20.0 + (double) Math.Abs(num6) + (double) Math.Abs(num7)) - { - vector2_1 = vector2_45; - break; - } - } - bool flag4 = false; - int j1 = (int) vector2_1.Y / 16; - int i2 = (int) vector2_1.X / 16; - int num158 = j1; - while (j1 < Main.maxTilesY - 10 && j1 - num158 < 30 && !WorldGen.SolidTile(i2, j1) && !TileID.Sets.Platforms[(int) Main.tile[i2, j1].type]) - ++j1; - if (!WorldGen.SolidTile(i2, j1) && !TileID.Sets.Platforms[(int) Main.tile[i2, j1].type]) - flag4 = true; - float num159 = (float) (j1 * 16); - int j2 = num158; - while (j2 > 10 && num158 - j2 < 30 && !WorldGen.SolidTile(i2, j2)) - --j2; - float num160 = (float) (j2 * 16 + 16); - float ai1 = num159 - num160; - int num161 = 15; - if ((double) ai1 > (double) (16 * num161)) - ai1 = (float) (16 * num161); - float ai0 = num159 - ai1; - vector2_1.X = (float) ((int) ((double) vector2_1.X / 16.0) * 16); - if (flag4) - return; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, 0.0f, 0.0f, projToShoot, Damage1, num1, i, ai0, ai1); - } - else if (sItem.type == 3384) - { - int num162 = this.altFunctionUse == 2 ? 1 : 0; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, num6, num7, projToShoot, Damage1, num1, i, ai1: ((float) num162)); - } - else if (sItem.type == 3473) - { - float ai1 = (float) (((double) Main.rand.NextFloat() - 0.5) * 0.785398185253143); - Vector2 vector2_46 = new Vector2(num6, num7); - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, vector2_46.X, vector2_46.Y, projToShoot, Damage1, num1, i, ai1: ai1); - } - else if (sItem.type == 4956) - { - int num163 = (this.itemAnimationMax - this.itemAnimation) / this.itemTime; - Vector2 velocity = new Vector2(num6, num7); - int num164 = FinalFractalHelper.GetRandomProfileIndex(); - if (num163 == 0) - num164 = 4956; - Vector2 vector2_47 = Main.MouseWorld - this.MountedCenter; - if (num163 == 1 || num163 == 2) - { - int npcTargetIndex; - bool zenithTarget = this.GetZenithTarget(Main.MouseWorld, 400f, out npcTargetIndex); - if (zenithTarget) - vector2_47 = Main.npc[npcTargetIndex].Center - this.MountedCenter; - bool flag5 = num163 == 2; - if (num163 == 1 && !zenithTarget) - flag5 = true; - if (flag5) - vector2_47 += Main.rand.NextVector2Circular(150f, 150f); - } - velocity = vector2_47 / 2f; - float ai0 = (float) Main.rand.Next(-100, 101); - Projectile.NewProjectile(vector2_1, velocity, projToShoot, Damage1, num1, i, ai0, (float) num164); - } - else if (sItem.type == 3836) - { - float ai0 = (float) ((double) Main.rand.NextFloat() * (double) shootSpeed * 0.75) * (float) this.direction; - Vector2 velocity = new Vector2(num6, num7); - Projectile.NewProjectile(vector2_1, velocity, projToShoot, Damage1, num1, i, ai0); - } - else if (sItem.type == 3858) - { - int num165 = this.altFunctionUse == 2 ? 1 : 0; - Vector2 velocity1 = new Vector2(num6, num7); - if (num165 != 0) - { - Vector2 velocity2 = velocity1 * 1.5f; - float ai0 = (float) ((0.300000011920929 + 0.699999988079071 * (double) Main.rand.NextFloat()) * (double) shootSpeed * 1.75) * (float) this.direction; - Projectile.NewProjectile(vector2_1, velocity2, 708, (int) ((double) Damage1 * 0.75), num1 + 4f, i, ai0); - } - else - Projectile.NewProjectile(vector2_1, velocity1, projToShoot, Damage1, num1, i); - } - else if (sItem.type == 3859) - { - Vector2 vector2_48 = new Vector2(num6, num7); - projToShoot = 710; - Damage1 = (int) ((double) Damage1 * 0.699999988079071); - Vector2 v5 = vector2_48 * 0.8f; - Vector2 vector2_49 = v5.SafeNormalize(-Vector2.UnitY); - float num166 = (float) Math.PI / 180f * (float) -this.direction; - for (float num167 = -2.5f; (double) num167 < 3.0; ++num167) - Projectile.NewProjectile(vector2_1, (v5 + vector2_49 * num167 * 0.5f).RotatedBy((double) num167 * (double) num166), projToShoot, Damage1, num1, i); - } - else if (sItem.type == 3870) - { - Vector2 vector2_50 = Vector2.Normalize(new Vector2(num6, num7)) * 40f * sItem.scale; - if (Collision.CanHit(vector2_1, 0, 0, vector2_1 + vector2_50, 0, 0)) - vector2_1 += vector2_50; - Vector2 v6 = new Vector2(num6, num7) * 0.8f; - Vector2 vector2_51 = v6.SafeNormalize(-Vector2.UnitY); - float num168 = (float) Math.PI / 180f * (float) -this.direction; - for (int index = 0; index <= 2; ++index) - Projectile.NewProjectile(vector2_1, (v6 + vector2_51 * (float) index * 1f).RotatedBy((double) index * (double) num168), projToShoot, Damage1, num1, i); - } - else if (sItem.type == 3542) - { - float num169 = (float) (((double) Main.rand.NextFloat() - 0.5) * 0.785398185253143 * 0.699999988079071); - for (int index = 0; index < 10 && !Collision.CanHit(vector2_1, 0, 0, vector2_1 + new Vector2(num6, num7).RotatedBy((double) num169) * 100f, 0, 0); ++index) - num169 = (float) (((double) Main.rand.NextFloat() - 0.5) * 0.785398185253143 * 0.699999988079071); - Vector2 vector2_52 = new Vector2(num6, num7).RotatedBy((double) num169) * (float) (0.949999988079071 + (double) Main.rand.NextFloat() * 0.300000011920929); - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, vector2_52.X, vector2_52.Y, projToShoot, Damage1, num1, i); - } - else if (sItem.type == 3779) - { - float num170 = Main.rand.NextFloat() * 6.283185f; - for (int index = 0; index < 10 && !Collision.CanHit(vector2_1, 0, 0, vector2_1 + new Vector2(num6, num7).RotatedBy((double) num170) * 100f, 0, 0); ++index) - num170 = Main.rand.NextFloat() * 6.283185f; - Vector2 vector2_53 = new Vector2(num6, num7).RotatedBy((double) num170) * (float) (0.949999988079071 + (double) Main.rand.NextFloat() * 0.300000011920929); - Projectile.NewProjectile(vector2_1 + vector2_53 * 30f, Vector2.Zero, projToShoot, Damage1, num1, i, -2f); - } - else if (sItem.type == 3787) - { - float f3 = Main.rand.NextFloat() * 6.283185f; - float num171 = 20f; - float num172 = 60f; - Vector2 position = vector2_1 + f3.ToRotationVector2() * MathHelper.Lerp(num171, num172, Main.rand.NextFloat()); - for (int index = 0; index < 50; ++index) - { - position = vector2_1 + f3.ToRotationVector2() * MathHelper.Lerp(num171, num172, Main.rand.NextFloat()); - if (!Collision.CanHit(vector2_1, 0, 0, position + (position - vector2_1).SafeNormalize(Vector2.UnitX) * 8f, 0, 0)) - f3 = Main.rand.NextFloat() * 6.283185f; - else - break; - } - Vector2 v7 = Main.MouseWorld - position; - Vector2 defaultValue = new Vector2(num6, num7).SafeNormalize(Vector2.UnitY) * shootSpeed; - Vector2 velocity = Vector2.Lerp(v7.SafeNormalize(defaultValue) * shootSpeed, defaultValue, 0.25f); - Projectile.NewProjectile(position, velocity, projToShoot, Damage1, num1, i); - } - else if (sItem.type == 3788) - { - Vector2 v8 = new Vector2(num6, num7); - float num173 = 0.7853982f; - for (int index = 0; index < 2; ++index) - { - Projectile.NewProjectile(vector2_1, v8 + v8.SafeNormalize(Vector2.Zero).RotatedBy((double) num173 * ((double) Main.rand.NextFloat() * 0.5 + 0.5)) * Main.rand.NextFloatDirection() * 2f, projToShoot, Damage1, num1, i); - Projectile.NewProjectile(vector2_1, v8 + v8.SafeNormalize(Vector2.Zero).RotatedBy(-(double) num173 * ((double) Main.rand.NextFloat() * 0.5 + 0.5)) * Main.rand.NextFloatDirection() * 2f, projToShoot, Damage1, num1, i); - } - Projectile.NewProjectile(vector2_1, v8.SafeNormalize(Vector2.UnitX * (float) this.direction) * (shootSpeed * 1.3f), 661, Damage1 * 2, num1, i); - } - else if (sItem.type == 4463 || sItem.type == 486) - Projectile.NewProjectile(vector2_1, new Vector2(num6, num7), projToShoot, Damage1, num1, i); - else if (sItem.type == 3475) - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, num6, num7, 615, Damage1, num1, i, (float) (5 * Main.rand.Next(0, 20))); - else if (sItem.type == 3930) - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, num6, num7, 714, Damage1, num1, i, (float) (5 * Main.rand.Next(0, 20))); - else if (sItem.type == 3540) - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, num6, num7, 630, Damage1, num1, i); - else if (sItem.type == 3854) - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, num6, num7, 705, Damage1, num1, i); - else if (sItem.type == 3546) - { - for (int index = 0; index < 2; ++index) - { - float num174 = num6; - float num175 = num7; - float num176 = num174 + (float) Main.rand.Next(-40, 41) * 0.05f; - float num177 = num175 + (float) Main.rand.Next(-40, 41) * 0.05f; - Vector2 vector2_54 = vector2_1 + Vector2.Normalize(new Vector2(num176, num177).RotatedBy(-1.57079637050629 * (double) this.direction)) * 6f; - Projectile.NewProjectile(vector2_54.X, vector2_54.Y, num176, num177, 167 + Main.rand.Next(4), Damage1, num1, i, ai1: 1f); - } - } - else if (sItem.type == 3350) - { - float num178 = num6; - float num179 = num7; - float num180 = num178 + (float) Main.rand.Next(-1, 2) * 0.5f; - float num181 = num179 + (float) Main.rand.Next(-1, 2) * 0.5f; - if (Collision.CanHitLine(this.Center, 0, 0, vector2_1 + new Vector2(num180, num181) * 2f, 0, 0)) - vector2_1 += new Vector2(num180, num181); - Projectile.NewProjectile(vector2_1.X, vector2_1.Y - this.gravDir * 4f, num180, num181, projToShoot, Damage1, num1, i, ai1: ((float) Main.rand.Next(12) / 6f)); - } - else if (sItem.type == 3852) - { - if (this.altFunctionUse == 2) - Projectile.NewProjectile(vector2_1.X, this.Bottom.Y - 100f, (float) this.direction * shootSpeed, 0.0f, 704, Damage1 * 2, num1, i); - else - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, num6, num7, projToShoot, Damage1, num1, i); - } - else if (sItem.type == 3818 || sItem.type == 3819 || sItem.type == 3820 || sItem.type == 3824 || sItem.type == 3825 || sItem.type == 3826 || sItem.type == 3829 || sItem.type == 3830 || sItem.type == 3831 || sItem.type == 3832 || sItem.type == 3833 || sItem.type == 3834) - { - this.PayDD2CrystalsBeforeUse(sItem); - int worldX; - int worldY; - int pushYUp; - this.FindSentryRestingSpot(sItem.shoot, out worldX, out worldY, out pushYUp); - int index = Projectile.NewProjectile((float) worldX, (float) (worldY - pushYUp), 0.0f, 0.0f, projToShoot, Damage1, num1, i); - Main.projectile[index].originalDamage = damage; - this.UpdateMaxTurrets(); + this.itemHeight = sItem.height; + this.itemWidth = sItem.width; } else { - int index = Projectile.NewProjectile(vector2_1.X, vector2_1.Y, num6, num7, projToShoot, Damage1, num1, i); - if (sItem.type == 726) - Main.projectile[index].magic = true; - if (sItem.type == 724 || sItem.type == 676) - Main.projectile[index].melee = true; - if (projToShoot == 80) - { - Main.projectile[index].ai[0] = (float) Player.tileTargetX; - Main.projectile[index].ai[1] = (float) Player.tileTargetY; - } - if (sItem.type == 760) - this.DestroyOldestProximityMinesOverMinesCap(20); - if (projToShoot == 442) - { - Main.projectile[index].ai[0] = (float) Player.tileTargetX; - Main.projectile[index].ai[1] = (float) Player.tileTargetY; - } - if (projToShoot == 826) - Main.projectile[index].ai[1] = (float) Main.rand.Next(3); - if (sItem.type == 949) - Main.projectile[index].ai[1] = 1f; - if (Main.projectile[index].aiStyle != 99) - return; - AchievementsHelper.HandleSpecialEvent(this, 7); + this.itemHeight = Main.itemTexture[sItem.type].Height; + this.itemWidth = Main.itemTexture[sItem.type].Width; } - } - else - { - if (sItem.useStyle != 5 && sItem.useStyle != 13) - return; - this.itemRotation = 0.0f; - NetMessage.SendData(41, number: this.whoAmI); - } - } - - private static int SpawnMinionOnCursor( - int ownerIndex, - int minionProjectileId, - int originalDamageNotScaledByMinionDamage, - float KnockBack, - Vector2 offsetFromCursor = default (Vector2), - Vector2 velocityOnSpawn = default (Vector2)) - { - int index = Projectile.NewProjectile(Main.MouseWorld + offsetFromCursor, velocityOnSpawn, minionProjectileId, originalDamageNotScaledByMinionDamage, KnockBack, ownerIndex); - Main.projectile[index].originalDamage = originalDamageNotScaledByMinionDamage; - return index; - } - - private Point FindSharpTearsSpot(Vector2 targetSpot) - { - targetSpot.ToTileCoordinates(); - Vector2 center = this.Center; - Vector2 endPoint = targetSpot; - int samplesToTake = 3; - float samplingWidth = 4f; - Vector2 vectorTowardsTarget; - float[] samples; - Collision.AimingLaserScan(center, endPoint, samplingWidth, samplesToTake, out vectorTowardsTarget, out samples); - float num = float.PositiveInfinity; - for (int index = 0; index < samples.Length; ++index) - { - if ((double) samples[index] < (double) num) - num = samples[index]; - } - targetSpot = center + vectorTowardsTarget.SafeNormalize(Vector2.Zero) * num; - Point tileCoordinates = targetSpot.ToTileCoordinates(); - Microsoft.Xna.Framework.Rectangle rectangle1 = new Microsoft.Xna.Framework.Rectangle(tileCoordinates.X, tileCoordinates.Y, 1, 1); - rectangle1.Inflate(6, 16); - Microsoft.Xna.Framework.Rectangle rectangle2 = new Microsoft.Xna.Framework.Rectangle(0, 0, Main.maxTilesX, Main.maxTilesY); - rectangle2.Inflate(-Main.Map.BlackEdgeWidth, -Main.Map.BlackEdgeWidth); - rectangle1 = Microsoft.Xna.Framework.Rectangle.Intersect(rectangle1, rectangle2); - List pointList1 = new List(); - List pointList2 = new List(); - for (int left = rectangle1.Left; left <= rectangle1.Right; ++left) - { - for (int top = rectangle1.Top; top <= rectangle1.Bottom; ++top) + --this.itemAnimation; + if (!Main.dedServ) { - if (WorldGen.SolidTile(left, top)) + if (sItem.useStyle == 1) { - Vector2 vector2 = new Vector2((float) (left * 16 + 8), (float) (top * 16 + 8)); - if ((double) Vector2.Distance(targetSpot, vector2) <= 200.0) + if (sItem.type > -1 && Item.claw[sItem.type]) { - if (this.FindSharpTearsOpening(left, top, left > tileCoordinates.X, left < tileCoordinates.X, top > tileCoordinates.Y, top < tileCoordinates.Y)) - pointList1.Add(new Point(left, top)); + if ((double) this.itemAnimation < (double) this.itemAnimationMax * 0.333) + { + float num = 10f; + this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 + ((double) Main.itemTexture[sItem.type].Width * 0.5 - (double) num) * (double) this.direction); + this.itemLocation.Y = this.position.Y + 26f + playerOffsetHitbox; + } + else if ((double) this.itemAnimation < (double) this.itemAnimationMax * 0.666) + { + float num = 8f; + this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 + ((double) Main.itemTexture[sItem.type].Width * 0.5 - (double) num) * (double) this.direction); + this.itemLocation.Y = this.position.Y + 24f + playerOffsetHitbox; + } else - pointList2.Add(new Point(left, top)); + { + float num = 6f; + this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 - ((double) Main.itemTexture[sItem.type].Width * 0.5 - (double) num) * (double) this.direction); + this.itemLocation.Y = this.position.Y + 20f + playerOffsetHitbox; + } + this.itemRotation = (float) (((double) this.itemAnimation / (double) this.itemAnimationMax - 0.5) * (double) -this.direction * 3.5 - (double) this.direction * 0.300000011920929); + } + else + { + if ((double) this.itemAnimation < (double) this.itemAnimationMax * 0.333) + { + float num = 10f; + if (Main.itemTexture[sItem.type].Width > 32) + num = 14f; + if (Main.itemTexture[sItem.type].Width >= 52) + num = 24f; + if (Main.itemTexture[sItem.type].Width >= 64) + num = 28f; + if (Main.itemTexture[sItem.type].Width >= 92) + num = 38f; + if (sItem.type == 2330 || sItem.type == 2320 || sItem.type == 2341) + num += 8f; + this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 + ((double) Main.itemTexture[sItem.type].Width * 0.5 - (double) num) * (double) this.direction); + this.itemLocation.Y = this.position.Y + 24f + playerOffsetHitbox; + } + else if ((double) this.itemAnimation < (double) this.itemAnimationMax * 0.666) + { + float num9 = 10f; + if (Main.itemTexture[sItem.type].Width > 32) + num9 = 18f; + if (Main.itemTexture[sItem.type].Width >= 52) + num9 = 24f; + if (Main.itemTexture[sItem.type].Width >= 64) + num9 = 28f; + if (Main.itemTexture[sItem.type].Width >= 92) + num9 = 38f; + if (sItem.type == 2330 || sItem.type == 2320 || sItem.type == 2341) + num9 += 4f; + this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 + ((double) Main.itemTexture[sItem.type].Width * 0.5 - (double) num9) * (double) this.direction); + float num10 = 10f; + if (Main.itemTexture[sItem.type].Height > 32) + num10 = 8f; + if (Main.itemTexture[sItem.type].Height > 52) + num10 = 12f; + if (Main.itemTexture[sItem.type].Height > 64) + num10 = 14f; + if (sItem.type == 2330 || sItem.type == 2320 || sItem.type == 2341) + num10 += 4f; + this.itemLocation.Y = this.position.Y + num10 + playerOffsetHitbox; + } + else + { + float num11 = 6f; + if (Main.itemTexture[sItem.type].Width > 32) + num11 = 14f; + if (Main.itemTexture[sItem.type].Width >= 48) + num11 = 18f; + if (Main.itemTexture[sItem.type].Width >= 52) + num11 = 24f; + if (Main.itemTexture[sItem.type].Width >= 64) + num11 = 28f; + if (Main.itemTexture[sItem.type].Width >= 92) + num11 = 38f; + if (sItem.type == 2330 || sItem.type == 2320 || sItem.type == 2341) + num11 += 4f; + this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 - ((double) Main.itemTexture[sItem.type].Width * 0.5 - (double) num11) * (double) this.direction); + float num12 = 10f; + if (Main.itemTexture[sItem.type].Height > 32) + num12 = 10f; + if (Main.itemTexture[sItem.type].Height > 52) + num12 = 12f; + if (Main.itemTexture[sItem.type].Height > 64) + num12 = 14f; + if (sItem.type == 2330 || sItem.type == 2320 || sItem.type == 2341) + num12 += 4f; + this.itemLocation.Y = this.position.Y + num12 + playerOffsetHitbox; + } + this.itemRotation = (float) (((double) this.itemAnimation / (double) this.itemAnimationMax - 0.5) * (double) -this.direction * 3.5 - (double) this.direction * 0.300000011920929); + } + if ((double) this.gravDir == -1.0) + { + this.itemRotation = -this.itemRotation; + this.itemLocation.Y = (float) ((double) this.position.Y + (double) this.height + ((double) this.position.Y - (double) this.itemLocation.Y)); + } + } + else if (sItem.useStyle == 2) + { + this.itemRotation = (float) ((double) this.itemAnimation / (double) this.itemAnimationMax * (double) this.direction * 2.0 + -1.39999997615814 * (double) this.direction); + if ((double) this.itemAnimation < (double) this.itemAnimationMax * 0.5) + { + this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 + ((double) Main.itemTexture[sItem.type].Width * 0.5 - 9.0 - (double) this.itemRotation * 12.0 * (double) this.direction) * (double) this.direction); + this.itemLocation.Y = (float) ((double) this.position.Y + 38.0 + (double) this.itemRotation * (double) this.direction * 4.0) + playerOffsetHitbox; + } + else + { + this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 + ((double) Main.itemTexture[sItem.type].Width * 0.5 - 9.0 - (double) this.itemRotation * 16.0 * (double) this.direction) * (double) this.direction); + this.itemLocation.Y = (float) ((double) this.position.Y + 38.0 + (double) this.itemRotation * (double) this.direction) + playerOffsetHitbox; + } + if ((double) this.gravDir == -1.0) + { + this.itemRotation = -this.itemRotation; + this.itemLocation.Y = (float) ((double) this.position.Y + (double) this.height + ((double) this.position.Y - (double) this.itemLocation.Y)); + } + } + else if (sItem.useStyle == 3) + { + if ((double) this.itemAnimation > (double) this.itemAnimationMax * 0.666) + { + this.itemLocation.X = -1000f; + this.itemLocation.Y = -1000f; + this.itemRotation = -1.3f * (float) this.direction; + } + else + { + this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 + ((double) Main.itemTexture[sItem.type].Width * 0.5 - 4.0) * (double) this.direction); + this.itemLocation.Y = this.position.Y + 24f + playerOffsetHitbox; + float num = (float) ((double) this.itemAnimation / (double) this.itemAnimationMax * (double) Main.itemTexture[sItem.type].Width * (double) this.direction * (double) sItem.scale * 1.20000004768372) - (float) (10 * this.direction); + if ((double) num > -4.0 && this.direction == -1) + num = -8f; + if ((double) num < 4.0 && this.direction == 1) + num = 8f; + this.itemLocation.X -= num; + this.itemRotation = 0.8f * (float) this.direction; + } + if ((double) this.gravDir == -1.0) + { + this.itemRotation = -this.itemRotation; + this.itemLocation.Y = (float) ((double) this.position.Y + (double) this.height + ((double) this.position.Y - (double) this.itemLocation.Y)); + } + } + else if (sItem.useStyle == 4) + { + int num = 0; + if (sItem.type == 3601) + num = 10; + this.itemRotation = 0.0f; + this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 + ((double) Main.itemTexture[sItem.type].Width * 0.5 - 9.0 - (double) this.itemRotation * 14.0 * (double) this.direction - 4.0 - (double) num) * (double) this.direction); + this.itemLocation.Y = (float) ((double) this.position.Y + (double) Main.itemTexture[sItem.type].Height * 0.5 + 4.0) + playerOffsetHitbox; + if ((double) this.gravDir == -1.0) + { + this.itemRotation = -this.itemRotation; + this.itemLocation.Y = (float) ((double) this.position.Y + (double) this.height + ((double) this.position.Y - (double) this.itemLocation.Y)); + } + } + else if (sItem.useStyle == 5) + { + if (sItem.type == 3779) + { + this.itemRotation = 0.0f; + this.itemLocation.X = this.Center.X + (float) (6 * this.direction); + this.itemLocation.Y = this.MountedCenter.Y + 6f; + } + else if (Item.staff[sItem.type]) + { + float num = 6f; + if (sItem.type == 3476) + num = 14f; + this.itemLocation = this.MountedCenter; + this.itemLocation += this.itemRotation.ToRotationVector2() * num * (float) this.direction; + } + else + { + this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 - (double) Main.itemTexture[sItem.type].Width * 0.5) - (float) (this.direction * 2); + this.itemLocation.Y = this.MountedCenter.Y - (float) Main.itemTexture[sItem.type].Height * 0.5f; } } } } - if (pointList1.Count == 0 && pointList2.Count == 0) - pointList1.Add((this.Center.ToTileCoordinates().ToVector2() + Main.rand.NextVector2Square(-2f, 2f)).ToPoint()); - List pointList3 = pointList1; - if (pointList3.Count == 0) - pointList3 = pointList2; - int index1 = Main.rand.Next(pointList3.Count); - return pointList3[index1]; - } - - private bool FindSharpTearsOpening( - int x, - int y, - bool acceptLeft, - bool acceptRight, - bool acceptUp, - bool acceptDown) - { - return acceptLeft && !WorldGen.SolidTile(x - 1, y) || acceptRight && !WorldGen.SolidTile(x + 1, y) || acceptUp && !WorldGen.SolidTile(x, y - 1) || acceptDown && !WorldGen.SolidTile(x, y + 1); - } - - public bool TryPlacingAGolfBallNearANearbyTee(Vector2 placePosition) - { - int num1 = 0; - int num2 = (int) ((double) placePosition.X / 16.0) - Player.tileRangeX - num1 + 1; - int num3 = (int) ((double) placePosition.X / 16.0) + Player.tileRangeX + num1 - 1; - int num4 = (int) ((double) placePosition.Y / 16.0) - Player.tileRangeY - num1 + 1; - int num5 = (int) ((double) placePosition.Y / 16.0) + Player.tileRangeY + num1 - 2; - int lx = Utils.Clamp(num2, 10, Main.maxTilesX - 10); - int hx = Utils.Clamp(num3, 10, Main.maxTilesX - 10); - int ly = Utils.Clamp(num4, 10, Main.maxTilesY - 10); - int hy = Utils.Clamp(num5, 10, Main.maxTilesY - 10); - Vector2 vector2 = Main.screenPosition + new Vector2((float) Main.mouseX, (float) Main.mouseY); - if ((double) this.gravDir == -1.0) - vector2.Y = Main.screenPosition.Y + (float) Main.screenHeight - (float) Main.mouseY; - Point tileCoordinates = placePosition.ToTileCoordinates(); - List> tupleList = new List>(); - for (int index1 = -2; index1 <= 2; ++index1) + else if (sItem.holdStyle == 1 && !this.pulley) { - for (int index2 = -2; index2 <= 2; ++index2) + if (Main.dedServ) + this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 + 20.0 * (double) this.direction); + else if (sItem.type == 930) { - int num6 = tileCoordinates.X + index1; - int num7 = tileCoordinates.Y + index2; - if (WorldGen.InWorld(num6, num7, 1)) + this.itemLocation.X = (float) ((double) this.position.X + (double) (this.width / 2) * 0.5 - 12.0) - (float) (2 * this.direction); + float x = this.position.X + (float) (this.width / 2) + (float) (38 * this.direction); + if (this.direction == 1) + x -= 10f; + float y = this.MountedCenter.Y - 4f * this.gravDir; + if ((double) this.gravDir == -1.0) + y -= 8f; + this.RotateRelativePoint(ref x, ref y); + int Type = 0; + for (int index = 54; index < 58; ++index) { - Tile tileSafely = Framing.GetTileSafely(num6, num7); - if (tileSafely.active() && tileSafely.type == (ushort) 494) + if (this.inventory[index].stack > 0 && this.inventory[index].ammo == 931) { - tupleList.Add(new Tuple(num6, num7)); + Type = this.inventory[index].type; break; } } - } - } - bool flag = false; - if (tupleList.Count > 0) - { - float num8 = -1f; - Tuple tuple = tupleList[0]; - for (int index = 0; index < tupleList.Count; ++index) - { - float num9 = Vector2.Distance(new Vector2((float) tupleList[index].Item1, (float) tupleList[index].Item2) * 16f + Vector2.One * 8f, vector2); - if ((double) num8 == -1.0 || (double) num9 < (double) num8) + if (Type == 0) { - num8 = num9; - tuple = tupleList[index]; - } - } - if (Collision.InTileBounds(tuple.Item1, tuple.Item2, lx, ly, hx, hy)) - { - flag = true; - for (int index = 0; index < 1000; ++index) - { - if (ProjectileID.Sets.IsAGolfBall[Main.projectile[index].type] && Main.projectile[index].owner == this.whoAmI) - Main.projectile[index].Kill(); - } - int projType; - this.GetPreferredGolfBallToUse(out projType); - Projectile.NewProjectile((float) (tuple.Item1 * 16) + 8.5f, (float) (tuple.Item2 * 16 + 6), 0.0f, 0.0f, projType, 0, 0.0f, this.whoAmI, ai1: -1f); - } - } - return flag; - } - - public void GetPreferredGolfBallToUse(out int projType) - { - projType = 721; - Item obj1 = this.inventory[this.selectedItem]; - if (!obj1.IsAir && obj1.shoot > 0 && ProjectileID.Sets.IsAGolfBall[obj1.shoot]) - { - projType = obj1.shoot; - } - else - { - for (int slot = 19; slot >= 0; --slot) - { - if (this.IsAValidEquipmentSlotForIteration(slot)) - { - int num = slot % 10; - Item obj2 = this.armor[slot]; - if (!obj2.IsAir && obj2.shoot > 0 && ProjectileID.Sets.IsAGolfBall[obj2.shoot]) + for (int index = 0; index < 54; ++index) { - projType = obj2.shoot; - return; + if (this.inventory[index].stack > 0 && this.inventory[index].ammo == 931) + { + Type = this.inventory[index].type; + break; + } } } - } - for (int index = 0; index < 50; ++index) - { - Item obj3 = this.inventory[index]; - if (!obj3.IsAir && obj3.shoot > 0 && ProjectileID.Sets.IsAGolfBall[obj3.shoot]) + if (Type == 931) + Type = (int) sbyte.MaxValue; + else if (Type == 1614) + Type = 187; + if (Type > 0) { - projType = obj3.shoot; - break; + int index = Dust.NewDust(new Vector2(x, y + this.gfxOffY), 6, 6, Type, Alpha: 100, Scale: 1.6f); + Main.dust[index].noGravity = true; + Main.dust[index].velocity.Y -= 4f * this.gravDir; + } + } + else if (sItem.type == 968) + { + this.itemLocation.X = this.position.X + (float) this.width * 0.5f + (float) (8 * this.direction); + if (this.whoAmI == Main.myPlayer) + { + int index8 = (int) ((double) this.itemLocation.X + (double) Main.itemTexture[sItem.type].Width * 0.800000011920929 * (double) this.direction) / 16; + int index9 = (int) ((double) this.itemLocation.Y + (double) playerOffsetHitbox + (double) (Main.itemTexture[sItem.type].Height / 2)) / 16; + if (Main.tile[index8, index9] == null) + Main.tile[index8, index9] = new Tile(); + if (Main.tile[index8, index9].active() && Main.tile[index8, index9].type == (ushort) 215 && Main.tile[index8, index9].frameY < (short) 54) + { + ++this.miscTimer; + if (Main.rand.Next(5) == 0) + ++this.miscTimer; + if (this.miscTimer > 900) + { + this.miscTimer = 0; + sItem.SetDefaults(969); + if (this.selectedItem == 58) + Main.mouseItem.SetDefaults(969); + for (int index10 = 0; index10 < 58; ++index10) + { + if (this.inventory[index10].type == sItem.type && index10 != this.selectedItem && this.inventory[index10].stack < this.inventory[index10].maxStack) + { + Main.PlaySound(7); + ++this.inventory[index10].stack; + sItem.SetDefaults(); + if (this.selectedItem == 58) + Main.mouseItem.SetDefaults(); + } + } + } + } + else + this.miscTimer = 0; + } + } + else if (sItem.type == 856) + this.itemLocation.X = this.position.X + (float) this.width * 0.5f + (float) (4 * this.direction); + else if (sItem.fishingPole > 0) + { + this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 + (double) Main.itemTexture[sItem.type].Width * 0.180000007152557 * (double) this.direction); + } + else + { + this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 + ((double) Main.itemTexture[sItem.type].Width * 0.5 + 2.0) * (double) this.direction); + if (sItem.type == 282 || sItem.type == 286 || sItem.type == 3112) + { + this.itemLocation.X -= (float) (this.direction * 2); + this.itemLocation.Y += 4f; + } + else if (sItem.type == 3002) + { + this.itemLocation.X -= (float) (4 * this.direction); + this.itemLocation.Y += 2f; + } + } + this.itemLocation.Y = this.position.Y + 24f + playerOffsetHitbox; + if (sItem.type == 856) + this.itemLocation.Y = this.position.Y + 34f + playerOffsetHitbox; + if (sItem.type == 930) + this.itemLocation.Y = this.position.Y + 9f + playerOffsetHitbox; + if (sItem.fishingPole > 0) + this.itemLocation.Y += 4f; + else if (sItem.type == 3476) + { + this.itemLocation.X = this.Center.X + (float) (14 * this.direction); + this.itemLocation.Y = this.MountedCenter.Y; + } + else if (sItem.type == 3779) + { + this.itemLocation.X = this.Center.X + (float) (6 * this.direction); + this.itemLocation.Y = this.MountedCenter.Y + 6f; + } + else if (sItem.type == 353) + { + this.itemLocation.X = this.Center.X + (float) (8 * this.direction); + this.itemLocation.Y = this.MountedCenter.Y + 11f; + } + this.itemRotation = 0.0f; + if ((double) this.gravDir == -1.0) + { + this.itemRotation = -this.itemRotation; + this.itemLocation.Y = (float) ((double) this.position.Y + (double) this.height + ((double) this.position.Y - (double) this.itemLocation.Y)) + playerOffsetHitbox; + if (sItem.type == 930) + this.itemLocation.Y -= 24f; + } + } + else if (sItem.holdStyle == 2 && !this.pulley) + { + if (sItem.type == 946) + { + this.itemRotation = 0.0f; + this.itemLocation.X = this.position.X + (float) this.width * 0.5f - (float) (16 * this.direction); + this.itemLocation.Y = this.position.Y + 22f + playerOffsetHitbox; + this.fallStart = (int) ((double) this.position.Y / 16.0); + if ((double) this.gravDir == -1.0) + { + this.itemRotation = -this.itemRotation; + this.itemLocation.Y = (float) ((double) this.position.Y + (double) this.height + ((double) this.position.Y - (double) this.itemLocation.Y)); + if ((double) this.velocity.Y < -2.0) + this.velocity.Y = -2f; + } + else if ((double) this.velocity.Y > 2.0) + this.velocity.Y = 2f; + } + else + { + this.itemLocation.X = this.position.X + (float) this.width * 0.5f + (float) (6 * this.direction); + this.itemLocation.Y = this.position.Y + 16f + playerOffsetHitbox; + this.itemRotation = 0.79f * (float) -this.direction; + if ((double) this.gravDir == -1.0) + { + this.itemRotation = -this.itemRotation; + this.itemLocation.Y = (float) ((double) this.position.Y + (double) this.height + ((double) this.position.Y - (double) this.itemLocation.Y)); } } } - } - - private void ItemCheck_MinionAltFeatureUse(Item sItem, bool cShoot) - { - if (sItem.shoot <= 0 || !ProjectileID.Sets.MinionTargettingFeature[sItem.shoot] || this.altFunctionUse != 2 || !cShoot || !this.ItemTimeIsZero) - return; - this.ApplyItemTime(sItem); - this.MinionNPCTargetAim(false); - } - - private void ItemCheck_TurretAltFeatureUse(Item sItem, bool cShoot) - { - if (sItem.shoot <= 0 || !ProjectileID.Sets.TurretFeature[sItem.shoot] || this.altFunctionUse != 2 || !cShoot || !this.ItemTimeIsZero) - return; - this.ApplyItemTime(sItem); - for (int index = 0; index < 1000; ++index) + else if (sItem.holdStyle == 3 && !this.pulley && !Main.dedServ) { - Projectile projectile = Main.projectile[index]; - if (projectile.active && projectile.owner == Main.myPlayer && ProjectileID.Sets.TurretFeature[projectile.type]) - projectile.Kill(); + this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 - (double) Main.itemTexture[sItem.type].Width * 0.5) - (float) (this.direction * 2); + this.itemLocation.Y = this.MountedCenter.Y - (float) Main.itemTexture[sItem.type].Height * 0.5f; + this.itemRotation = 0.0f; } - } - - private void EmitMaxManaEffect() - { - SoundEngine.PlaySound(25); - for (int index1 = 0; index1 < 5; ++index1) - { - int index2 = Dust.NewDust(this.position, this.width, this.height, 45, Alpha: ((int) byte.MaxValue), Scale: ((float) Main.rand.Next(20, 26) * 0.1f)); - Main.dust[index2].noLight = true; - Main.dust[index2].noGravity = true; - Main.dust[index2].velocity *= 0.5f; - } - } - - private void ItemCheck_EmitHeldItemLight(Item sItem) - { - if ((ItemID.Sets.Torches[sItem.type] && !this.wet || ItemID.Sets.WaterTorches[sItem.type]) && !this.pulley && !this.happyFunTorchTime) + if (((sItem.type == 974 || sItem.type == 8 || sItem.type == 1245 || sItem.type == 2274 || sItem.type == 3004 || sItem.type == 3045 || sItem.type == 3114 || sItem.type >= 427 && sItem.type <= 433) && !this.wet || sItem.type == 523 || sItem.type == 1333) && !this.pulley) { float R = 1f; float G = 0.95f; float B = 0.8f; - int torchID = 0; - int num = this.BiomeTorchHoldStyle(sItem.type); - if (num == 523) - torchID = 8; - else if (num == 974) - torchID = 9; - else if (num == 1245) - torchID = 10; - else if (num == 1333) - torchID = 11; - else if (num == 2274) - torchID = 12; - else if (num == 3004) - torchID = 13; - else if (num == 3045) - torchID = 14; - else if (num == 3114) - torchID = 15; - else if (num == 4383) - torchID = 16; - else if (num == 4384) - torchID = 17; - else if (num == 4385) - torchID = 18; - else if (num == 4386) - torchID = 19; - else if (num == 4387) - torchID = 20; - else if (num == 4388) - torchID = 21; - else if (num >= 427) - torchID = num - 426; - TorchID.TorchColor(torchID, out R, out G, out B); - int Type = TorchID.Dust[torchID]; + int num13 = 0; + if (sItem.type == 523) + num13 = 8; + else if (sItem.type == 974) + num13 = 9; + else if (sItem.type == 1245) + num13 = 10; + else if (sItem.type == 1333) + num13 = 11; + else if (sItem.type == 2274) + num13 = 12; + else if (sItem.type == 3004) + num13 = 13; + else if (sItem.type == 3045) + num13 = 14; + else if (sItem.type == 3114) + num13 = 15; + else if (sItem.type >= 427) + num13 = sItem.type - 426; + switch (num13) + { + case 1: + R = 0.0f; + G = 0.1f; + B = 1.3f; + break; + case 2: + R = 1f; + G = 0.1f; + B = 0.1f; + break; + case 3: + R = 0.0f; + G = 1f; + B = 0.1f; + break; + case 4: + R = 0.9f; + G = 0.0f; + B = 0.9f; + break; + case 5: + R = 1.3f; + G = 1.3f; + B = 1.3f; + break; + case 6: + R = 0.9f; + G = 0.9f; + B = 0.0f; + break; + case 7: + R = (float) (0.5 * (double) Main.demonTorch + 1.0 * (1.0 - (double) Main.demonTorch)); + G = 0.3f; + B = (float) (1.0 * (double) Main.demonTorch + 0.5 * (1.0 - (double) Main.demonTorch)); + break; + case 8: + B = 0.7f; + R = 0.85f; + G = 1f; + break; + case 9: + B = 1f; + R = 0.7f; + G = 0.85f; + break; + case 10: + B = 0.0f; + R = 1f; + G = 0.5f; + break; + case 11: + B = 0.8f; + R = 1.25f; + G = 1.25f; + break; + case 12: + R *= 0.75f; + G *= 1.35f; + B *= 1.5f; + break; + case 13: + R = 0.95f; + G = 0.65f; + B = 1.3f; + break; + case 14: + R = (float) Main.DiscoR / (float) byte.MaxValue; + G = (float) Main.DiscoG / (float) byte.MaxValue; + B = (float) Main.DiscoB / (float) byte.MaxValue; + break; + case 15: + R = 1f; + G = 0.0f; + B = 1f; + break; + } + int num14 = num13; + int Type; + switch (num14) + { + case 0: + Type = 6; + break; + case 8: + Type = 75; + break; + case 9: + Type = 135; + break; + case 10: + Type = 158; + break; + case 11: + Type = 169; + break; + case 12: + Type = 156; + break; + case 13: + Type = 234; + break; + case 14: + Type = 66; + break; + case 15: + Type = 242; + break; + default: + Type = 58 + num14; + break; + } int maxValue = 30; if (this.itemAnimation > 0) maxValue = 7; @@ -31883,18 +21620,44 @@ label_106: } if (sItem.type == 3002 && !this.pulley) { - float r = 1.05f; - float g = 0.95f; - float b = 0.55f; + float R = 1.05f; + float G = 0.95f; + float B = 0.55f; if (this.direction == -1) - Lighting.AddLight(this.RotatedRelativePoint(new Vector2(this.itemLocation.X - 16f + this.velocity.X, this.itemLocation.Y - 14f)), r, g, b); + Lighting.AddLight(this.RotatedRelativePoint(new Vector2(this.itemLocation.X - 16f + this.velocity.X, this.itemLocation.Y - 14f)), R, G, B); else - Lighting.AddLight(this.RotatedRelativePoint(new Vector2(this.itemLocation.X + 6f + this.velocity.X, this.itemLocation.Y - 14f)), r, g, b); + Lighting.AddLight(this.RotatedRelativePoint(new Vector2(this.itemLocation.X + 6f + this.velocity.X, this.itemLocation.Y - 14f)), R, G, B); ++this.spelunkerTimer; if (this.spelunkerTimer >= (byte) 10) { this.spelunkerTimer = (byte) 0; - Main.instance.SpelunkerProjectileHelper.AddSpotToCheck(this.Center); + int num15 = 30; + int num16 = (int) this.Center.X / 16; + int num17 = (int) this.Center.Y / 16; + for (int index11 = num16 - num15; index11 <= num16 + num15; ++index11) + { + for (int index12 = num17 - num15; index12 <= num17 + num15; ++index12) + { + if (Main.rand.Next(4) == 0 && (double) new Vector2((float) (num16 - index11), (float) (num17 - index12)).Length() < (double) num15 && index11 > 0 && index11 < Main.maxTilesX - 1 && index12 > 0 && index12 < Main.maxTilesY - 1 && Main.tile[index11, index12] != null && Main.tile[index11, index12].active()) + { + bool flag6 = false; + if (Main.tile[index11, index12].type == (ushort) 185 && Main.tile[index11, index12].frameY == (short) 18) + { + if (Main.tile[index11, index12].frameX >= (short) 576 && Main.tile[index11, index12].frameX <= (short) 882) + flag6 = true; + } + else if (Main.tile[index11, index12].type == (ushort) 186 && Main.tile[index11, index12].frameX >= (short) 864 && Main.tile[index11, index12].frameX <= (short) 1170) + flag6 = true; + if (flag6 || Main.tileSpelunker[(int) Main.tile[index11, index12].type] || Main.tileAlch[(int) Main.tile[index11, index12].type] && Main.tile[index11, index12].type != (ushort) 82) + { + int index13 = Dust.NewDust(new Vector2((float) (index11 * 16), (float) (index12 * 16)), 16, 16, 204, Alpha: 150, Scale: 0.3f); + Main.dust[index13].fadeIn = 0.75f; + Main.dust[index13].velocity *= 0.1f; + Main.dust[index13].noLight = true; + } + } + } + } } } if (sItem.type == 286 && !this.pulley) @@ -31911,25 +21674,2044 @@ label_106: else Lighting.AddLight(this.RotatedRelativePoint(new Vector2(this.itemLocation.X + 6f + this.velocity.X, this.itemLocation.Y - 14f)), 1f, 0.6f, 0.85f); } - if (sItem.type == 4776 && !this.pulley) + this.releaseUseItem = !this.controlUseItem; + if (this.itemTime > 0) { - if (this.direction == -1) - Lighting.AddLight(this.RotatedRelativePoint(new Vector2(this.itemLocation.X - 16f + this.velocity.X, this.itemLocation.Y - 14f)), 0.7f, 0.0f, 1f); + --this.itemTime; + if (this.itemTime == 0 && this.whoAmI == Main.myPlayer) + { + switch (sItem.type) + { + case 65: + case 676: + case 723: + case 724: + case 989: + case 1226: + case 1227: + Main.PlaySound(25); + for (int index14 = 0; index14 < 5; ++index14) + { + int index15 = Dust.NewDust(this.position, this.width, this.height, 45, Alpha: ((int) byte.MaxValue), Scale: ((float) Main.rand.Next(20, 26) * 0.1f)); + Main.dust[index15].noLight = true; + Main.dust[index15].noGravity = true; + Main.dust[index15].velocity *= 0.5f; + } + break; + } + } + } + if (i == Main.myPlayer) + { + bool flag7 = true; + int type1 = sItem.type; + if ((type1 == 65 || type1 == 676 || type1 == 723 || type1 == 724 || type1 == 757 || type1 == 674 || type1 == 675 || type1 == 989 || type1 == 1226 || type1 == 1227) && this.itemAnimation != this.itemAnimationMax - 1) + flag7 = false; + if (type1 == 3852) + { + if (this.itemAnimation < this.itemAnimationMax - 12) + flag7 = false; + if (this.altFunctionUse == 2 && this.itemAnimation != this.itemAnimationMax - 1) + flag7 = false; + } + if (sItem.shoot > 0 && ProjectileID.Sets.TurretFeature[sItem.shoot] && this.altFunctionUse == 2 && flag7 && this.itemTime == 0) + { + this.itemTime = sItem.useTime; + for (int index = 0; index < 1000; ++index) + { + Projectile projectile = Main.projectile[index]; + if (projectile.active && projectile.owner == Main.myPlayer && ProjectileID.Sets.TurretFeature[projectile.type]) + projectile.Kill(); + } + } + if (sItem.shoot > 0 && ProjectileID.Sets.MinionTargettingFeature[sItem.shoot] && this.altFunctionUse == 2 && flag7 && this.itemTime == 0) + { + this.itemTime = sItem.useTime; + this.MinionNPCTargetAim(); + } + if (((sItem.shoot <= 0 || this.itemAnimation <= 0 ? 0 : (this.itemTime == 0 ? 1 : 0)) & (flag7 ? 1 : 0)) != 0) + { + int shoot = sItem.shoot; + float speed = sItem.shootSpeed; + if (this.inventory[this.selectedItem].thrown && (double) speed < 16.0) + { + speed *= this.thrownVelocity; + if ((double) speed > 16.0) + speed = 16f; + } + if (sItem.melee && shoot != 25 && shoot != 26 && shoot != 35) + speed /= this.meleeSpeed; + bool canShoot = false; + int Damage = weaponDamage; + float knockBack = sItem.knockBack; + if (shoot == 13 || shoot == 32 || shoot == 315 || shoot >= 230 && shoot <= 235 || shoot == 331) + { + this.grappling[0] = -1; + this.grapCount = 0; + for (int index = 0; index < 1000; ++index) + { + if (Main.projectile[index].active && Main.projectile[index].owner == i) + { + if (Main.projectile[index].type == 13) + Main.projectile[index].Kill(); + if (Main.projectile[index].type == 331) + Main.projectile[index].Kill(); + if (Main.projectile[index].type == 315) + Main.projectile[index].Kill(); + if (Main.projectile[index].type >= 230 && Main.projectile[index].type <= 235) + Main.projectile[index].Kill(); + } + } + } + if (sItem.useAmmo > 0) + this.PickAmmo(sItem, ref shoot, ref speed, ref canShoot, ref Damage, ref knockBack, ItemID.Sets.gunProj[sItem.type]); + else + canShoot = true; + if (ItemID.Sets.gunProj[sItem.type]) + { + knockBack = sItem.knockBack; + Damage = weaponDamage; + speed = sItem.shootSpeed; + } + if (sItem.type == 71) + canShoot = false; + if (sItem.type == 72) + canShoot = false; + if (sItem.type == 73) + canShoot = false; + if (sItem.type == 74) + canShoot = false; + if (sItem.type == 1254 && shoot == 14) + shoot = 242; + if (sItem.type == 1255 && shoot == 14) + shoot = 242; + if (sItem.type == 1265 && shoot == 14) + shoot = 242; + if (sItem.type == 3542) + { + if (Main.rand.Next(100) < 20) + { + ++shoot; + Damage *= 3; + } + else + --speed; + } + if (shoot == 73) + { + for (int index = 0; index < 1000; ++index) + { + if (Main.projectile[index].active && Main.projectile[index].owner == i) + { + if (Main.projectile[index].type == 73) + shoot = 74; + if (shoot == 74 && Main.projectile[index].type == 74) + canShoot = false; + } + } + } + if (canShoot) + { + float num18 = this.GetWeaponKnockback(sItem, knockBack); + if (shoot == 228) + num18 = 0.0f; + if (shoot == 1 && sItem.type == 120) + shoot = 2; + if (sItem.type == 682) + shoot = 117; + if (sItem.type == 725) + shoot = 120; + if (sItem.type == 2796) + shoot = 442; + if (sItem.type == 2223) + shoot = 357; + this.itemTime = sItem.useTime; + Vector2 vector2_1 = this.RotatedRelativePoint(this.MountedCenter); + bool flag8 = true; + if (sItem.type == 3611) + flag8 = false; + Vector2 vector2_2 = Vector2.UnitX.RotatedBy((double) this.fullRotation); + Vector2 v1 = Main.MouseWorld - vector2_1; + Vector2 vector2_3 = this.itemRotation.ToRotationVector2() * (float) this.direction; + if (sItem.type == 3852 && this.itemAnimation != this.itemAnimationMax - 1) + v1 = vector2_3; + if (v1 != Vector2.Zero) + v1.Normalize(); + Vector2 vector2_4 = v1; + float num19 = Vector2.Dot(vector2_2, vector2_4); + if (flag8) + { + if ((double) num19 > 0.0) + this.ChangeDir(1); + else + this.ChangeDir(-1); + } + if (sItem.type == 3094 || sItem.type == 3378 || sItem.type == 3543) + vector2_1.Y = this.position.Y + (float) (this.height / 3); + if (sItem.type == 2611) + { + Vector2 vector2_5 = v1; + if (vector2_5 != Vector2.Zero) + vector2_5.Normalize(); + vector2_1 += vector2_5; + } + if (sItem.type == 3827) + vector2_1 += v1.SafeNormalize(Vector2.Zero).RotatedBy((double) this.direction * -1.57079637050629) * 24f; + if (shoot == 9) + { + vector2_1 = new Vector2((float) ((double) this.position.X + (double) this.width * 0.5 + (double) (Main.rand.Next(201) * -this.direction) + ((double) Main.mouseX + (double) Main.screenPosition.X - (double) this.position.X)), this.MountedCenter.Y - 600f); + num18 = 0.0f; + Damage *= 2; + } + if (sItem.type == 986 || sItem.type == 281) + { + vector2_1.X += (float) (6 * this.direction); + vector2_1.Y -= 6f * this.gravDir; + } + if (sItem.type == 3007) + { + vector2_1.X -= (float) (4 * this.direction); + vector2_1.Y -= 1f * this.gravDir; + } + float f1 = (float) Main.mouseX + Main.screenPosition.X - vector2_1.X; + float f2 = (float) Main.mouseY + Main.screenPosition.Y - vector2_1.Y; + if (sItem.type == 3852 && this.itemAnimation != this.itemAnimationMax - 1) + { + Vector2 vector2_6 = vector2_3; + f1 = vector2_6.X; + f2 = vector2_6.Y; + } + if ((double) this.gravDir == -1.0) + f2 = Main.screenPosition.Y + (float) Main.screenHeight - (float) Main.mouseY - vector2_1.Y; + float num20 = (float) Math.Sqrt((double) f1 * (double) f1 + (double) f2 * (double) f2); + float num21 = num20; + float num22; + if (float.IsNaN(f1) && float.IsNaN(f2) || (double) f1 == 0.0 && (double) f2 == 0.0) + { + f1 = (float) this.direction; + f2 = 0.0f; + num22 = speed; + } + else + num22 = speed / num20; + if (sItem.type == 1929 || sItem.type == 2270) + { + f1 += (float) Main.rand.Next(-50, 51) * 0.03f / num22; + f2 += (float) Main.rand.Next(-50, 51) * 0.03f / num22; + } + float num23 = f1 * num22; + float num24 = f2 * num22; + if (sItem.type == 757) + Damage = (int) ((double) Damage * 1.25); + if (shoot == 250) + { + for (int index = 0; index < 1000; ++index) + { + if (Main.projectile[index].active && Main.projectile[index].owner == this.whoAmI && (Main.projectile[index].type == 250 || Main.projectile[index].type == 251)) + Main.projectile[index].Kill(); + } + } + if (shoot == 12) + { + vector2_1.X += num23 * 3f; + vector2_1.Y += num24 * 3f; + } + if (sItem.useStyle == 5) + { + if (sItem.type == 3029) + { + Vector2 vector2_7 = new Vector2(num23, num24); + vector2_7.X = (float) Main.mouseX + Main.screenPosition.X - vector2_1.X; + vector2_7.Y = (float) ((double) Main.mouseY + (double) Main.screenPosition.Y - (double) vector2_1.Y - 1000.0); + this.itemRotation = (float) Math.Atan2((double) vector2_7.Y * (double) this.direction, (double) vector2_7.X * (double) this.direction); + NetMessage.SendData(13, number: this.whoAmI); + NetMessage.SendData(41, number: this.whoAmI); + } + else if (sItem.type == 3779) + { + this.itemRotation = 0.0f; + NetMessage.SendData(13, number: this.whoAmI); + NetMessage.SendData(41, number: this.whoAmI); + } + else + { + this.itemRotation = (float) Math.Atan2((double) num24 * (double) this.direction, (double) num23 * (double) this.direction) - this.fullRotation; + NetMessage.SendData(13, number: this.whoAmI); + NetMessage.SendData(41, number: this.whoAmI); + } + } + if (shoot == 17) + { + vector2_1.X = (float) Main.mouseX + Main.screenPosition.X; + vector2_1.Y = (float) Main.mouseY + Main.screenPosition.Y; + if ((double) this.gravDir == -1.0) + vector2_1.Y = Main.screenPosition.Y + (float) Main.screenHeight - (float) Main.mouseY; + } + if (shoot == 76) + { + shoot += Main.rand.Next(3); + float num25 = num21 / (float) (Main.screenHeight / 2); + if ((double) num25 > 1.0) + num25 = 1f; + float num26 = num23 + (float) Main.rand.Next(-40, 41) * 0.01f; + float num27 = num24 + (float) Main.rand.Next(-40, 41) * 0.01f; + float SpeedX = num26 * (num25 + 0.25f); + float SpeedY = num27 * (num25 + 0.25f); + int number = Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i); + Main.projectile[number].ai[1] = 1f; + float num28 = (float) ((double) num25 * 2.0 - 1.0); + if ((double) num28 < -1.0) + num28 = -1f; + if ((double) num28 > 1.0) + num28 = 1f; + Main.projectile[number].ai[0] = num28; + NetMessage.SendData(27, number: number); + } + else if (sItem.type == 3029) + { + int num29 = 3; + if (Main.rand.Next(3) == 0) + ++num29; + for (int index16 = 0; index16 < num29; ++index16) + { + vector2_1 = new Vector2((float) ((double) this.position.X + (double) this.width * 0.5 + (double) (Main.rand.Next(201) * -this.direction) + ((double) Main.mouseX + (double) Main.screenPosition.X - (double) this.position.X)), this.MountedCenter.Y - 600f); + vector2_1.X = (float) (((double) vector2_1.X * 10.0 + (double) this.Center.X) / 11.0) + (float) Main.rand.Next(-100, 101); + vector2_1.Y -= (float) (150 * index16); + float num30 = (float) Main.mouseX + Main.screenPosition.X - vector2_1.X; + float num31 = (float) Main.mouseY + Main.screenPosition.Y - vector2_1.Y; + if ((double) num31 < 0.0) + num31 *= -1f; + if ((double) num31 < 20.0) + num31 = 20f; + float num32 = (float) Math.Sqrt((double) num30 * (double) num30 + (double) num31 * (double) num31); + float num33 = speed / num32; + float num34 = num30 * num33; + float num35 = num31 * num33; + float num36 = num34 + (float) Main.rand.Next(-40, 41) * 0.03f; + float SpeedY = num35 + (float) Main.rand.Next(-40, 41) * 0.03f; + float SpeedX = num36 * ((float) Main.rand.Next(75, 150) * 0.01f); + vector2_1.X += (float) Main.rand.Next(-50, 51); + int index17 = Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i); + Main.projectile[index17].noDropItem = true; + } + } + else if (sItem.type == 98 || sItem.type == 533) + { + float SpeedX = num23 + (float) Main.rand.Next(-40, 41) * 0.01f; + float SpeedY = num24 + (float) Main.rand.Next(-40, 41) * 0.01f; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i); + } + else if (sItem.type == 1319) + { + float SpeedX = num23 + (float) Main.rand.Next(-40, 41) * 0.02f; + float SpeedY = num24 + (float) Main.rand.Next(-40, 41) * 0.02f; + int index = Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i); + Main.projectile[index].ranged = true; + Main.projectile[index].thrown = false; + } + else if (sItem.type == 3107) + { + float SpeedX = num23 + (float) Main.rand.Next(-40, 41) * 0.02f; + float SpeedY = num24 + (float) Main.rand.Next(-40, 41) * 0.02f; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i); + } + else if (sItem.type == 3053) + { + Vector2 vector2_8 = new Vector2(num23, num24); + vector2_8.Normalize(); + Vector2 vector2_9 = new Vector2((float) Main.rand.Next(-100, 101), (float) Main.rand.Next(-100, 101)); + vector2_9.Normalize(); + Vector2 vector2_10 = vector2_8 * 4f + vector2_9; + vector2_10.Normalize(); + vector2_10 *= sItem.shootSpeed; + float ai1 = (float) Main.rand.Next(10, 80) * (1f / 1000f); + if (Main.rand.Next(2) == 0) + ai1 *= -1f; + float ai0 = (float) Main.rand.Next(10, 80) * (1f / 1000f); + if (Main.rand.Next(2) == 0) + ai0 *= -1f; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, vector2_10.X, vector2_10.Y, shoot, Damage, num18, i, ai0, ai1); + } + else if (sItem.type == 3019) + { + Vector2 vector2_11 = new Vector2(num23, num24); + float num37 = vector2_11.Length(); + vector2_11.X += (float) ((double) Main.rand.Next(-100, 101) * 0.00999999977648258 * (double) num37 * 0.150000005960464); + vector2_11.Y += (float) ((double) Main.rand.Next(-100, 101) * 0.00999999977648258 * (double) num37 * 0.150000005960464); + float num38 = num23 + (float) Main.rand.Next(-40, 41) * 0.03f; + float num39 = num24 + (float) Main.rand.Next(-40, 41) * 0.03f; + vector2_11.Normalize(); + Vector2 vector2_12 = vector2_11 * num37; + Vector2 vector2_13 = new Vector2(num38 * ((float) Main.rand.Next(50, 150) * 0.01f), num39 * ((float) Main.rand.Next(50, 150) * 0.01f)); + vector2_13.X += (float) Main.rand.Next(-100, 101) * 0.025f; + vector2_13.Y += (float) Main.rand.Next(-100, 101) * 0.025f; + vector2_13.Normalize(); + Vector2 vector2_14 = vector2_13 * num37; + float x = vector2_14.X; + float y = vector2_14.Y; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, x, y, shoot, Damage, num18, i, vector2_12.X, vector2_12.Y); + } + else if (sItem.type == 2797) + { + Vector2 vector2_15 = Vector2.Normalize(new Vector2(num23, num24)) * 40f * sItem.scale; + if (Collision.CanHit(vector2_1, 0, 0, vector2_1 + vector2_15, 0, 0)) + vector2_1 += vector2_15; + float rotation = new Vector2(num23, num24).ToRotation(); + float num40 = 2.094395f; + int num41 = Main.rand.Next(4, 5); + if (Main.rand.Next(4) == 0) + ++num41; + for (int index18 = 0; index18 < num41; ++index18) + { + float num42 = (float) (Main.rand.NextDouble() * 0.200000002980232 + 0.0500000007450581); + Vector2 vector2_16 = new Vector2(num23, num24).RotatedBy((double) num40 * Main.rand.NextDouble() - (double) num40 / 2.0) * num42; + int index19 = Projectile.NewProjectile(vector2_1.X, vector2_1.Y, vector2_16.X, vector2_16.Y, 444, Damage, num18, i, rotation); + Main.projectile[index19].localAI[0] = (float) shoot; + Main.projectile[index19].localAI[1] = speed; + } + } + else if (sItem.type == 2270) + { + float SpeedX = num23 + (float) Main.rand.Next(-40, 41) * 0.05f; + float SpeedY = num24 + (float) Main.rand.Next(-40, 41) * 0.05f; + if (Main.rand.Next(3) == 0) + { + SpeedX *= (float) (1.0 + (double) Main.rand.Next(-30, 31) * 0.0199999995529652); + SpeedY *= (float) (1.0 + (double) Main.rand.Next(-30, 31) * 0.0199999995529652); + } + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i); + } + else if (sItem.type == 1930) + { + int num43 = 2 + Main.rand.Next(3); + for (int index = 0; index < num43; ++index) + { + float num44 = num23; + float num45 = num24; + float num46 = 0.025f * (float) index; + float num47 = num44 + (float) Main.rand.Next(-35, 36) * num46; + float num48 = num45 + (float) Main.rand.Next(-35, 36) * num46; + float num49 = (float) Math.Sqrt((double) num47 * (double) num47 + (double) num48 * (double) num48); + float num50 = speed / num49; + float SpeedX = num47 * num50; + float SpeedY = num48 * num50; + Projectile.NewProjectile(vector2_1.X + (float) ((double) num23 * (double) (num43 - index) * 1.75), vector2_1.Y + (float) ((double) num24 * (double) (num43 - index) * 1.75), SpeedX, SpeedY, shoot, Damage, num18, i, (float) Main.rand.Next(0, 10 * (index + 1))); + } + } + else if (sItem.type == 1931) + { + int num51 = 2; + for (int index = 0; index < num51; ++index) + { + vector2_1 = new Vector2((float) ((double) this.position.X + (double) this.width * 0.5 + (double) (Main.rand.Next(201) * -this.direction) + ((double) Main.mouseX + (double) Main.screenPosition.X - (double) this.position.X)), this.MountedCenter.Y - 600f); + vector2_1.X = (float) (((double) vector2_1.X + (double) this.Center.X) / 2.0) + (float) Main.rand.Next(-200, 201); + vector2_1.Y -= (float) (100 * index); + float num52 = (float) Main.mouseX + Main.screenPosition.X - vector2_1.X; + float num53 = (float) Main.mouseY + Main.screenPosition.Y - vector2_1.Y; + if ((double) num53 < 0.0) + num53 *= -1f; + if ((double) num53 < 20.0) + num53 = 20f; + float num54 = (float) Math.Sqrt((double) num52 * (double) num52 + (double) num53 * (double) num53); + float num55 = speed / num54; + float num56 = num52 * num55; + float num57 = num53 * num55; + float SpeedX = num56 + (float) Main.rand.Next(-40, 41) * 0.02f; + float SpeedY = num57 + (float) Main.rand.Next(-40, 41) * 0.02f; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i, ai1: ((float) Main.rand.Next(5))); + } + } + else if (sItem.type == 2750) + { + int num58 = 1; + for (int index = 0; index < num58; ++index) + { + vector2_1 = new Vector2((float) ((double) this.position.X + (double) this.width * 0.5 + (double) (Main.rand.Next(201) * -this.direction) + ((double) Main.mouseX + (double) Main.screenPosition.X - (double) this.position.X)), this.MountedCenter.Y - 600f); + vector2_1.X = (float) (((double) vector2_1.X + (double) this.Center.X) / 2.0) + (float) Main.rand.Next(-200, 201); + vector2_1.Y -= (float) (100 * index); + float num59 = (float) ((double) Main.mouseX + (double) Main.screenPosition.X - (double) vector2_1.X + (double) Main.rand.Next(-40, 41) * 0.0299999993294477); + float num60 = (float) Main.mouseY + Main.screenPosition.Y - vector2_1.Y; + if ((double) num60 < 0.0) + num60 *= -1f; + if ((double) num60 < 20.0) + num60 = 20f; + float num61 = (float) Math.Sqrt((double) num59 * (double) num59 + (double) num60 * (double) num60); + float num62 = speed / num61; + float num63 = num59 * num62; + float num64 = num60 * num62; + float num65 = num63; + float num66 = num64 + (float) Main.rand.Next(-40, 41) * 0.02f; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, num65 * 0.75f, num66 * 0.75f, shoot + Main.rand.Next(3), Damage, num18, i, ai1: ((float) (0.5 + Main.rand.NextDouble() * 0.300000011920929))); + } + } + else if (sItem.type == 3570) + { + int num67 = 3; + for (int index = 0; index < num67; ++index) + { + vector2_1 = new Vector2((float) ((double) this.position.X + (double) this.width * 0.5 + (double) (Main.rand.Next(201) * -this.direction) + ((double) Main.mouseX + (double) Main.screenPosition.X - (double) this.position.X)), this.MountedCenter.Y - 600f); + vector2_1.X = (float) (((double) vector2_1.X + (double) this.Center.X) / 2.0) + (float) Main.rand.Next(-200, 201); + vector2_1.Y -= (float) (100 * index); + float num68 = (float) Main.mouseX + Main.screenPosition.X - vector2_1.X; + float num69 = (float) Main.mouseY + Main.screenPosition.Y - vector2_1.Y; + float ai1 = num69 + vector2_1.Y; + if ((double) num69 < 0.0) + num69 *= -1f; + if ((double) num69 < 20.0) + num69 = 20f; + float num70 = (float) Math.Sqrt((double) num68 * (double) num68 + (double) num69 * (double) num69); + float num71 = speed / num70; + Vector2 vector2_17 = new Vector2(num68 * num71, num69 * num71) / 2f; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, vector2_17.X, vector2_17.Y, shoot, Damage, num18, i, ai1: ai1); + } + } + else if (sItem.type == 3065) + { + Vector2 vector2_18 = Main.screenPosition + new Vector2((float) Main.mouseX, (float) Main.mouseY); + float ai1 = vector2_18.Y; + if ((double) ai1 > (double) this.Center.Y - 200.0) + ai1 = this.Center.Y - 200f; + for (int index = 0; index < 3; ++index) + { + vector2_1 = this.Center + new Vector2((float) (-Main.rand.Next(0, 401) * this.direction), -600f); + vector2_1.Y -= (float) (100 * index); + Vector2 vector2_19 = vector2_18 - vector2_1; + if ((double) vector2_19.Y < 0.0) + vector2_19.Y *= -1f; + if ((double) vector2_19.Y < 20.0) + vector2_19.Y = 20f; + vector2_19.Normalize(); + Vector2 vector2_20 = vector2_19 * speed; + float x = vector2_20.X; + float y = vector2_20.Y; + float SpeedX = x; + float SpeedY = y + (float) Main.rand.Next(-40, 41) * 0.02f; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage * 2, num18, i, ai1: ai1); + } + } + else if (sItem.type == 2624) + { + float num72 = 0.3141593f; + int num73 = 5; + Vector2 spinningpoint = new Vector2(num23, num24); + spinningpoint.Normalize(); + spinningpoint *= 40f; + bool flag9 = Collision.CanHit(vector2_1, 0, 0, vector2_1 + spinningpoint, 0, 0); + for (int index20 = 0; index20 < num73; ++index20) + { + float num74 = (float) index20 - (float) (((double) num73 - 1.0) / 2.0); + Vector2 vector2_21 = spinningpoint.RotatedBy((double) num72 * (double) num74); + if (!flag9) + vector2_21 -= spinningpoint; + int index21 = Projectile.NewProjectile(vector2_1.X + vector2_21.X, vector2_1.Y + vector2_21.Y, num23, num24, shoot, Damage, num18, i); + Main.projectile[index21].noDropItem = true; + } + } + else if (sItem.type == 1929) + { + float SpeedX = num23 + (float) Main.rand.Next(-40, 41) * 0.03f; + float SpeedY = num24 + (float) Main.rand.Next(-40, 41) * 0.03f; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i); + } + else if (sItem.type == 1553) + { + float SpeedX = num23 + (float) Main.rand.Next(-40, 41) * 0.005f; + float SpeedY = num24 + (float) Main.rand.Next(-40, 41) * 0.005f; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i); + } + else if (sItem.type == 518) + { + float num75 = num23; + float num76 = num24; + float SpeedX = num75 + (float) Main.rand.Next(-40, 41) * 0.04f; + float SpeedY = num76 + (float) Main.rand.Next(-40, 41) * 0.04f; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i); + } + else if (sItem.type == 1265) + { + float num77 = num23; + float num78 = num24; + float SpeedX = num77 + (float) Main.rand.Next(-30, 31) * 0.03f; + float SpeedY = num78 + (float) Main.rand.Next(-30, 31) * 0.03f; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i); + } + else if (sItem.type == 534) + { + int num79 = Main.rand.Next(4, 6); + for (int index = 0; index < num79; ++index) + { + float num80 = num23; + float num81 = num24; + float SpeedX = num80 + (float) Main.rand.Next(-40, 41) * 0.05f; + float SpeedY = num81 + (float) Main.rand.Next(-40, 41) * 0.05f; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i); + } + } + else if (sItem.type == 2188) + { + int num82 = 4; + if (Main.rand.Next(3) == 0) + ++num82; + if (Main.rand.Next(4) == 0) + ++num82; + if (Main.rand.Next(5) == 0) + ++num82; + for (int index = 0; index < num82; ++index) + { + float num83 = num23; + float num84 = num24; + float num85 = 0.05f * (float) index; + float num86 = num83 + (float) Main.rand.Next(-35, 36) * num85; + float num87 = num84 + (float) Main.rand.Next(-35, 36) * num85; + float num88 = (float) Math.Sqrt((double) num86 * (double) num86 + (double) num87 * (double) num87); + float num89 = speed / num88; + float SpeedX = num86 * num89; + float SpeedY = num87 * num89; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i); + } + } + else if (sItem.type == 1308) + { + int num90 = 3; + if (Main.rand.Next(3) == 0) + ++num90; + for (int index = 0; index < num90; ++index) + { + float num91 = num23; + float num92 = num24; + float num93 = 0.05f * (float) index; + float num94 = num91 + (float) Main.rand.Next(-35, 36) * num93; + float num95 = num92 + (float) Main.rand.Next(-35, 36) * num93; + float num96 = (float) Math.Sqrt((double) num94 * (double) num94 + (double) num95 * (double) num95); + float num97 = speed / num96; + float SpeedX = num94 * num97; + float SpeedY = num95 * num97; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i); + } + } + else if (sItem.type == 1258) + { + float num98 = num23; + float num99 = num24; + float SpeedX = num98 + (float) Main.rand.Next(-40, 41) * 0.01f; + float SpeedY = num99 + (float) Main.rand.Next(-40, 41) * 0.01f; + vector2_1.X += (float) Main.rand.Next(-40, 41) * 0.05f; + vector2_1.Y += (float) Main.rand.Next(-45, 36) * 0.05f; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i); + } + else if (sItem.type == 964) + { + int num100 = Main.rand.Next(3, 5); + for (int index = 0; index < num100; ++index) + { + float num101 = num23; + float num102 = num24; + float SpeedX = num101 + (float) Main.rand.Next(-35, 36) * 0.04f; + float SpeedY = num102 + (float) Main.rand.Next(-35, 36) * 0.04f; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i); + } + } + else if (sItem.type == 1569) + { + int num103 = 4; + if (Main.rand.Next(2) == 0) + ++num103; + if (Main.rand.Next(4) == 0) + ++num103; + if (Main.rand.Next(8) == 0) + ++num103; + if (Main.rand.Next(16) == 0) + ++num103; + for (int index = 0; index < num103; ++index) + { + float num104 = num23; + float num105 = num24; + float num106 = 0.05f * (float) index; + float num107 = num104 + (float) Main.rand.Next(-35, 36) * num106; + float num108 = num105 + (float) Main.rand.Next(-35, 36) * num106; + float num109 = (float) Math.Sqrt((double) num107 * (double) num107 + (double) num108 * (double) num108); + float num110 = speed / num109; + float SpeedX = num107 * num110; + float SpeedY = num108 * num110; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i); + } + } + else if (sItem.type == 1572 || sItem.type == 2366 || sItem.type == 3571 || sItem.type == 3569) + { + int num111 = sItem.type == 3571 ? 1 : (sItem.type == 3569 ? 1 : 0); + int i2 = (int) ((double) Main.mouseX + (double) Main.screenPosition.X) / 16; + int j = (int) ((double) Main.mouseY + (double) Main.screenPosition.Y) / 16; + if ((double) this.gravDir == -1.0) + j = (int) ((double) Main.screenPosition.Y + (double) Main.screenHeight - (double) Main.mouseY) / 16; + if (num111 == 0) + { + while (j < Main.maxTilesY - 10 && Main.tile[i2, j] != null && !WorldGen.SolidTile2(i2, j) && Main.tile[i2 - 1, j] != null && !WorldGen.SolidTile2(i2 - 1, j) && Main.tile[i2 + 1, j] != null && !WorldGen.SolidTile2(i2 + 1, j)) + ++j; + --j; + } + Projectile.NewProjectile((float) Main.mouseX + Main.screenPosition.X, (float) (j * 16 - 24), 0.0f, 15f, shoot, Damage, num18, i); + this.UpdateMaxTurrets(); + } + else if (sItem.type == 1244 || sItem.type == 1256) + { + int index = Projectile.NewProjectile(vector2_1.X, vector2_1.Y, num23, num24, shoot, Damage, num18, i); + Main.projectile[index].ai[0] = (float) Main.mouseX + Main.screenPosition.X; + Main.projectile[index].ai[1] = (float) Main.mouseY + Main.screenPosition.Y; + } + else if (sItem.type == 1229) + { + int num112 = Main.rand.Next(2, 4); + if (Main.rand.Next(5) == 0) + ++num112; + for (int index22 = 0; index22 < num112; ++index22) + { + float SpeedX = num23; + float SpeedY = num24; + if (index22 > 0) + { + SpeedX += (float) Main.rand.Next(-35, 36) * 0.04f; + SpeedY += (float) Main.rand.Next(-35, 36) * 0.04f; + } + if (index22 > 1) + { + SpeedX += (float) Main.rand.Next(-35, 36) * 0.04f; + SpeedY += (float) Main.rand.Next(-35, 36) * 0.04f; + } + if (index22 > 2) + { + SpeedX += (float) Main.rand.Next(-35, 36) * 0.04f; + SpeedY += (float) Main.rand.Next(-35, 36) * 0.04f; + } + int index23 = Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i); + Main.projectile[index23].noDropItem = true; + } + } + else if (sItem.type == 1121) + { + int num113 = Main.rand.Next(1, 4); + if (Main.rand.Next(6) == 0) + ++num113; + if (Main.rand.Next(6) == 0) + ++num113; + if (this.strongBees && Main.rand.Next(3) == 0) + ++num113; + for (int index24 = 0; index24 < num113; ++index24) + { + float num114 = num23; + float num115 = num24; + float SpeedX = num114 + (float) Main.rand.Next(-35, 36) * 0.02f; + float SpeedY = num115 + (float) Main.rand.Next(-35, 36) * 0.02f; + int index25 = Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, this.beeType(), this.beeDamage(Damage), this.beeKB(num18), i); + Main.projectile[index25].magic = true; + } + } + else if (sItem.type == 1155) + { + int num116 = Main.rand.Next(2, 5); + if (Main.rand.Next(5) == 0) + ++num116; + if (Main.rand.Next(5) == 0) + ++num116; + for (int index = 0; index < num116; ++index) + { + float num117 = num23; + float num118 = num24; + float SpeedX = num117 + (float) Main.rand.Next(-35, 36) * 0.02f; + float SpeedY = num118 + (float) Main.rand.Next(-35, 36) * 0.02f; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i); + } + } + else if (sItem.type == 1801) + { + int num119 = Main.rand.Next(1, 4); + for (int index = 0; index < num119; ++index) + { + float num120 = num23; + float num121 = num24; + float SpeedX = num120 + (float) Main.rand.Next(-35, 36) * 0.05f; + float SpeedY = num121 + (float) Main.rand.Next(-35, 36) * 0.05f; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i); + } + } + else if (sItem.type == 679) + { + for (int index = 0; index < 6; ++index) + { + float num122 = num23; + float num123 = num24; + float SpeedX = num122 + (float) Main.rand.Next(-40, 41) * 0.05f; + float SpeedY = num123 + (float) Main.rand.Next(-40, 41) * 0.05f; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i); + } + } + else if (sItem.type == 2623) + { + for (int index = 0; index < 3; ++index) + { + float num124 = num23; + float num125 = num24; + float SpeedX = num124 + (float) Main.rand.Next(-40, 41) * 0.1f; + float SpeedY = num125 + (float) Main.rand.Next(-40, 41) * 0.1f; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i); + } + } + else if (sItem.type == 3210) + { + Vector2 vector2_22 = new Vector2(num23, num24); + vector2_22.X += (float) Main.rand.Next(-30, 31) * 0.04f; + vector2_22.Y += (float) Main.rand.Next(-30, 31) * 0.03f; + vector2_22.Normalize(); + Vector2 vector2_23 = vector2_22 * ((float) Main.rand.Next(70, 91) * 0.1f); + vector2_23.X += (float) Main.rand.Next(-30, 31) * 0.04f; + vector2_23.Y += (float) Main.rand.Next(-30, 31) * 0.03f; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, vector2_23.X, vector2_23.Y, shoot, Damage, num18, i, (float) Main.rand.Next(20)); + } + else if (sItem.type == 434) + { + float SpeedX = num23; + float SpeedY = num24; + if (this.itemAnimation < 5) + { + float num126 = SpeedX + (float) Main.rand.Next(-40, 41) * 0.01f; + float num127 = SpeedY + (float) Main.rand.Next(-40, 41) * 0.01f; + SpeedX = num126 * 1.1f; + SpeedY = num127 * 1.1f; + } + else if (this.itemAnimation < 10) + { + float num128 = SpeedX + (float) Main.rand.Next(-20, 21) * 0.01f; + float num129 = SpeedY + (float) Main.rand.Next(-20, 21) * 0.01f; + SpeedX = num128 * 1.05f; + SpeedY = num129 * 1.05f; + } + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i); + } + else if (sItem.type == 1157) + { + shoot = Main.rand.Next(191, 195); + float SpeedX = 0.0f; + float SpeedY = 0.0f; + vector2_1.X = (float) Main.mouseX + Main.screenPosition.X; + vector2_1.Y = (float) Main.mouseY + Main.screenPosition.Y; + int index = Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i); + Main.projectile[index].localAI[0] = 30f; + } + else if (sItem.type == 1802) + { + float SpeedX = 0.0f; + float SpeedY = 0.0f; + vector2_1.X = (float) Main.mouseX + Main.screenPosition.X; + vector2_1.Y = (float) Main.mouseY + Main.screenPosition.Y; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i); + } + else if (sItem.type == 2364 || sItem.type == 2365) + { + float SpeedX = 0.0f; + float SpeedY = 0.0f; + vector2_1.X = (float) Main.mouseX + Main.screenPosition.X; + vector2_1.Y = (float) Main.mouseY + Main.screenPosition.Y; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i); + } + else if (sItem.type == 2535) + { + float x = 0.0f; + float y = 0.0f; + vector2_1.X = (float) Main.mouseX + Main.screenPosition.X; + vector2_1.Y = (float) Main.mouseY + Main.screenPosition.Y; + Vector2 spinningpoint = new Vector2(x, y).RotatedBy(1.57079637050629); + Projectile.NewProjectile(vector2_1.X + spinningpoint.X, vector2_1.Y + spinningpoint.Y, spinningpoint.X, spinningpoint.Y, shoot, Damage, num18, i); + Vector2 vector2_24 = spinningpoint.RotatedBy(-3.14159274101257); + Projectile.NewProjectile(vector2_1.X + vector2_24.X, vector2_1.Y + vector2_24.Y, vector2_24.X, vector2_24.Y, shoot + 1, Damage, num18, i); + } + else if (sItem.type == 2551) + { + float SpeedX = 0.0f; + float SpeedY = 0.0f; + vector2_1.X = (float) Main.mouseX + Main.screenPosition.X; + vector2_1.Y = (float) Main.mouseY + Main.screenPosition.Y; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot + Main.rand.Next(3), Damage, num18, i); + } + else if (sItem.type == 2584) + { + float SpeedX = 0.0f; + float SpeedY = 0.0f; + vector2_1.X = (float) Main.mouseX + Main.screenPosition.X; + vector2_1.Y = (float) Main.mouseY + Main.screenPosition.Y; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot + Main.rand.Next(3), Damage, num18, i); + } + else if (sItem.type == 2621) + { + float SpeedX = 0.0f; + float SpeedY = 0.0f; + vector2_1.X = (float) Main.mouseX + Main.screenPosition.X; + vector2_1.Y = (float) Main.mouseY + Main.screenPosition.Y; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i); + } + else if (sItem.type == 2749 || sItem.type == 3249 || sItem.type == 3474) + { + float SpeedX = 0.0f; + float SpeedY = 0.0f; + vector2_1.X = (float) Main.mouseX + Main.screenPosition.X; + vector2_1.Y = (float) Main.mouseY + Main.screenPosition.Y; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i); + } + else if (sItem.type == 3531) + { + int num130 = -1; + int index26 = -1; + for (int index27 = 0; index27 < 1000; ++index27) + { + if (Main.projectile[index27].active && Main.projectile[index27].owner == Main.myPlayer) + { + if (num130 == -1 && Main.projectile[index27].type == 625) + num130 = index27; + if (index26 == -1 && Main.projectile[index27].type == 628) + index26 = index27; + if (num130 != -1 && index26 != -1) + break; + } + } + if (num130 == -1 && index26 == -1) + { + float SpeedX = 0.0f; + float SpeedY = 0.0f; + vector2_1.X = (float) Main.mouseX + Main.screenPosition.X; + vector2_1.Y = (float) Main.mouseY + Main.screenPosition.Y; + int num131 = Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i); + int num132 = Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot + 1, Damage, num18, i, (float) num131); + int index28 = num132; + int num133 = Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot + 2, Damage, num18, i, (float) num132); + Main.projectile[index28].localAI[1] = (float) num133; + int index29 = num133; + int num134 = Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot + 3, Damage, num18, i, (float) num133); + Main.projectile[index29].localAI[1] = (float) num134; + } + else if (num130 != -1 && index26 != -1) + { + int num135 = Projectile.NewProjectile(vector2_1.X, vector2_1.Y, num23, num24, shoot + 1, Damage, num18, i, (float) Projectile.GetByUUID(Main.myPlayer, Main.projectile[index26].ai[0])); + int index30 = num135; + int index31 = Projectile.NewProjectile(vector2_1.X, vector2_1.Y, num23, num24, shoot + 2, Damage, num18, i, (float) num135); + Main.projectile[index30].localAI[1] = (float) index31; + Main.projectile[index30].netUpdate = true; + Main.projectile[index30].ai[1] = 1f; + Main.projectile[index31].localAI[1] = (float) index26; + Main.projectile[index31].netUpdate = true; + Main.projectile[index31].ai[1] = 1f; + Main.projectile[index26].ai[0] = (float) Main.projectile[index31].projUUID; + Main.projectile[index26].netUpdate = true; + Main.projectile[index26].ai[1] = 1f; + } + } + else if (sItem.type == 1309) + { + float SpeedX = 0.0f; + float SpeedY = 0.0f; + vector2_1.X = (float) Main.mouseX + Main.screenPosition.X; + vector2_1.Y = (float) Main.mouseY + Main.screenPosition.Y; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, shoot, Damage, num18, i); + } + else if (sItem.shoot > 0 && (Main.projPet[sItem.shoot] || sItem.shoot == 72 || sItem.shoot == 18 || sItem.shoot == 500 || sItem.shoot == 650) && !sItem.summon) + { + for (int index = 0; index < 1000; ++index) + { + if (Main.projectile[index].active && Main.projectile[index].owner == this.whoAmI) + { + if (sItem.shoot == 72) + { + if (Main.projectile[index].type == 72 || Main.projectile[index].type == 86 || Main.projectile[index].type == 87) + Main.projectile[index].Kill(); + } + else if (sItem.shoot == Main.projectile[index].type) + Main.projectile[index].Kill(); + } + } + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, num23, num24, shoot, Damage, num18, i); + } + else if (sItem.type == 3006) + { + Vector2 vector2_25; + vector2_25.X = (float) Main.mouseX + Main.screenPosition.X; + vector2_25.Y = (float) Main.mouseY + Main.screenPosition.Y; + while (Collision.CanHitLine(this.position, this.width, this.height, vector2_1, 1, 1)) + { + vector2_1.X += num23; + vector2_1.Y += num24; + if ((double) (vector2_1 - vector2_25).Length() < 20.0 + (double) Math.Abs(num23) + (double) Math.Abs(num24)) + { + vector2_1 = vector2_25; + break; + } + } + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, 0.0f, 0.0f, shoot, Damage, num18, i); + } + else if (sItem.type == 3014) + { + Vector2 vector2_26; + vector2_26.X = (float) Main.mouseX + Main.screenPosition.X; + vector2_26.Y = (float) Main.mouseY + Main.screenPosition.Y; + while (Collision.CanHitLine(this.position, this.width, this.height, vector2_1, 1, 1)) + { + vector2_1.X += num23; + vector2_1.Y += num24; + if ((double) (vector2_1 - vector2_26).Length() < 20.0 + (double) Math.Abs(num23) + (double) Math.Abs(num24)) + { + vector2_1 = vector2_26; + break; + } + } + bool flag10 = false; + int j1 = (int) vector2_1.Y / 16; + int i3 = (int) vector2_1.X / 16; + int num136 = j1; + while (j1 < Main.maxTilesY - 10 && j1 - num136 < 30 && !WorldGen.SolidTile(i3, j1) && !TileID.Sets.Platforms[(int) Main.tile[i3, j1].type]) + ++j1; + if (!WorldGen.SolidTile(i3, j1) && !TileID.Sets.Platforms[(int) Main.tile[i3, j1].type]) + flag10 = true; + float num137 = (float) (j1 * 16); + int j2 = num136; + while (j2 > 10 && num136 - j2 < 30 && !WorldGen.SolidTile(i3, j2)) + --j2; + float num138 = (float) (j2 * 16 + 16); + float ai1 = num137 - num138; + int num139 = 10; + if ((double) ai1 > (double) (16 * num139)) + ai1 = (float) (16 * num139); + float ai0 = num137 - ai1; + vector2_1.X = (float) ((int) ((double) vector2_1.X / 16.0) * 16); + if (!flag10) + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, 0.0f, 0.0f, shoot, Damage, num18, i, ai0, ai1); + } + else if (sItem.type == 3384) + { + int num140 = this.altFunctionUse == 2 ? 1 : 0; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, num23, num24, shoot, Damage, num18, i, ai1: ((float) num140)); + } + else if (sItem.type == 3473) + { + float ai1 = (float) (((double) Main.rand.NextFloat() - 0.5) * 0.785398185253143); + Vector2 vector2_27 = new Vector2(num23, num24); + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, vector2_27.X, vector2_27.Y, shoot, Damage, num18, i, ai1: ai1); + } + else if (sItem.type == 3836) + { + float ai0 = (float) ((double) Main.rand.NextFloat() * (double) speed * 0.75) * (float) this.direction; + Vector2 velocity = new Vector2(num23, num24); + Projectile.NewProjectile(vector2_1, velocity, shoot, Damage, num18, i, ai0); + } + else if (sItem.type == 3858) + { + int num141 = this.altFunctionUse == 2 ? 1 : 0; + Vector2 velocity1 = new Vector2(num23, num24); + if (num141 != 0) + { + Vector2 velocity2 = velocity1 * 1.5f; + float ai0 = (float) ((0.300000011920929 + 0.699999988079071 * (double) Main.rand.NextFloat()) * (double) speed * 1.75) * (float) this.direction; + Projectile.NewProjectile(vector2_1, velocity2, 708, (int) ((double) Damage * 0.75), num18 + 4f, i, ai0); + } + else + Projectile.NewProjectile(vector2_1, velocity1, shoot, Damage, num18, i); + } + else if (sItem.type == 3859) + { + Vector2 vector2_28 = new Vector2(num23, num24); + shoot = 710; + Damage = (int) ((double) Damage * 0.699999988079071); + Vector2 v2 = vector2_28 * 0.8f; + Vector2 vector2_29 = v2.SafeNormalize(-Vector2.UnitY); + float num142 = (float) Math.PI / 180f * (float) -this.direction; + for (float num143 = -2.5f; (double) num143 < 3.0; ++num143) + Projectile.NewProjectile(vector2_1, (v2 + vector2_29 * num143 * 0.5f).RotatedBy((double) num143 * (double) num142), shoot, Damage, num18, i); + } + else if (sItem.type == 3870) + { + Vector2 vector2_30 = Vector2.Normalize(new Vector2(num23, num24)) * 40f * sItem.scale; + if (Collision.CanHit(vector2_1, 0, 0, vector2_1 + vector2_30, 0, 0)) + vector2_1 += vector2_30; + Vector2 v3 = new Vector2(num23, num24) * 0.8f; + Vector2 vector2_31 = v3.SafeNormalize(-Vector2.UnitY); + float num144 = (float) Math.PI / 180f * (float) -this.direction; + for (int index = 0; index <= 2; ++index) + Projectile.NewProjectile(vector2_1, (v3 + vector2_31 * (float) index * 1f).RotatedBy((double) index * (double) num144), shoot, Damage, num18, i); + } + else if (sItem.type == 3542) + { + float num145 = (float) (((double) Main.rand.NextFloat() - 0.5) * 0.785398185253143 * 0.699999988079071); + for (int index = 0; index < 10 && !Collision.CanHit(vector2_1, 0, 0, vector2_1 + new Vector2(num23, num24).RotatedBy((double) num145) * 100f, 0, 0); ++index) + num145 = (float) (((double) Main.rand.NextFloat() - 0.5) * 0.785398185253143 * 0.699999988079071); + Vector2 vector2_32 = new Vector2(num23, num24).RotatedBy((double) num145) * (float) (0.949999988079071 + (double) Main.rand.NextFloat() * 0.300000011920929); + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, vector2_32.X, vector2_32.Y, shoot, Damage, num18, i); + } + else if (sItem.type == 3779) + { + float num146 = Main.rand.NextFloat() * 6.283185f; + for (int index = 0; index < 10 && !Collision.CanHit(vector2_1, 0, 0, vector2_1 + new Vector2(num23, num24).RotatedBy((double) num146) * 100f, 0, 0); ++index) + num146 = Main.rand.NextFloat() * 6.283185f; + Vector2 vector2_33 = new Vector2(num23, num24).RotatedBy((double) num146) * (float) (0.949999988079071 + (double) Main.rand.NextFloat() * 0.300000011920929); + Projectile.NewProjectile(vector2_1 + vector2_33 * 30f, Vector2.Zero, shoot, Damage, num18, i, -2f); + } + else if (sItem.type == 3787) + { + float f3 = Main.rand.NextFloat() * 6.283185f; + float num147 = 20f; + float num148 = 60f; + Vector2 position = vector2_1 + f3.ToRotationVector2() * MathHelper.Lerp(num147, num148, Main.rand.NextFloat()); + for (int index = 0; index < 50; ++index) + { + position = vector2_1 + f3.ToRotationVector2() * MathHelper.Lerp(num147, num148, Main.rand.NextFloat()); + if (!Collision.CanHit(vector2_1, 0, 0, position + (position - vector2_1).SafeNormalize(Vector2.UnitX) * 8f, 0, 0)) + f3 = Main.rand.NextFloat() * 6.283185f; + else + break; + } + Vector2 v4 = Main.MouseWorld - position; + Vector2 defaultValue = new Vector2(num23, num24).SafeNormalize(Vector2.UnitY) * speed; + Vector2 velocity = Vector2.Lerp(v4.SafeNormalize(defaultValue) * speed, defaultValue, 0.25f); + Projectile.NewProjectile(position, velocity, shoot, Damage, num18, i); + } + else if (sItem.type == 3788) + { + Vector2 v5 = new Vector2(num23, num24); + float num149 = 0.7853982f; + for (int index = 0; index < 2; ++index) + { + Projectile.NewProjectile(vector2_1, v5 + v5.SafeNormalize(Vector2.Zero).RotatedBy((double) num149 * ((double) Main.rand.NextFloat() * 0.5 + 0.5)) * Main.rand.NextFloatDirection() * 2f, shoot, Damage, num18, i); + Projectile.NewProjectile(vector2_1, v5 + v5.SafeNormalize(Vector2.Zero).RotatedBy(-(double) num149 * ((double) Main.rand.NextFloat() * 0.5 + 0.5)) * Main.rand.NextFloatDirection() * 2f, shoot, Damage, num18, i); + } + Projectile.NewProjectile(vector2_1, v5.SafeNormalize(Vector2.UnitX * (float) this.direction) * (speed * 1.3f), 661, Damage * 2, num18, i); + } + else if (sItem.type == 3475) + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, num23, num24, 615, Damage, num18, i, (float) (5 * Main.rand.Next(0, 20))); + else if (sItem.type == 3540) + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, num23, num24, 630, Damage, num18, i); + else if (sItem.type == 3854) + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, num23, num24, 705, Damage, num18, i); + else if (sItem.type == 3546) + { + for (int index = 0; index < 2; ++index) + { + float num150 = num23; + float num151 = num24; + float num152 = num150 + (float) Main.rand.Next(-40, 41) * 0.05f; + float num153 = num151 + (float) Main.rand.Next(-40, 41) * 0.05f; + Vector2 vector2_34 = vector2_1 + Vector2.Normalize(new Vector2(num152, num153).RotatedBy(-1.57079637050629 * (double) this.direction)) * 6f; + Projectile.NewProjectile(vector2_34.X, vector2_34.Y, num152, num153, 167 + Main.rand.Next(4), Damage, num18, i, ai1: 1f); + } + } + else if (sItem.type == 3350) + { + float num154 = num23; + float num155 = num24; + float num156 = num154 + (float) Main.rand.Next(-1, 2) * 0.5f; + float num157 = num155 + (float) Main.rand.Next(-1, 2) * 0.5f; + if (Collision.CanHitLine(this.Center, 0, 0, vector2_1 + new Vector2(num156, num157) * 2f, 0, 0)) + vector2_1 += new Vector2(num156, num157); + Projectile.NewProjectile(vector2_1.X, vector2_1.Y - this.gravDir * 4f, num156, num157, shoot, Damage, num18, i, ai1: ((float) Main.rand.Next(12) / 6f)); + } + else if (sItem.type == 3852) + { + if (this.altFunctionUse == 2) + Projectile.NewProjectile(vector2_1.X, this.Bottom.Y - 100f, (float) this.direction * speed, 0.0f, 704, Damage * 2, num18, i); + else + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, num23, num24, shoot, Damage, num18, i); + } + else if (sItem.type == 3818 || sItem.type == 3819 || sItem.type == 3820 || sItem.type == 3824 || sItem.type == 3825 || sItem.type == 3826 || sItem.type == 3829 || sItem.type == 3830 || sItem.type == 3831 || sItem.type == 3832 || sItem.type == 3833 || sItem.type == 3834) + { + this.PayDD2CrystalsBeforeUse(sItem); + int worldX; + int worldY; + int pushYUp; + this.FindSentryRestingSpot(sItem.shoot, out worldX, out worldY, out pushYUp); + Projectile.NewProjectile((float) worldX, (float) (worldY - pushYUp), 0.0f, 0.0f, shoot, Damage, num18, i); + this.UpdateMaxTurrets(); + } + else + { + int index = Projectile.NewProjectile(vector2_1.X, vector2_1.Y, num23, num24, shoot, Damage, num18, i); + if (sItem.type == 726) + Main.projectile[index].magic = true; + if (sItem.type == 724 || sItem.type == 676) + Main.projectile[index].melee = true; + if (shoot == 80) + { + Main.projectile[index].ai[0] = (float) Player.tileTargetX; + Main.projectile[index].ai[1] = (float) Player.tileTargetY; + } + if (shoot == 442) + { + Main.projectile[index].ai[0] = (float) Player.tileTargetX; + Main.projectile[index].ai[1] = (float) Player.tileTargetY; + } + if ((this.thrownCost50 || this.thrownCost33) && this.inventory[this.selectedItem].thrown) + Main.projectile[index].noDropItem = true; + if (Main.projectile[index].aiStyle == 99) + AchievementsHelper.HandleSpecialEvent(this, 7); + } + } + else if (sItem.useStyle == 5) + { + this.itemRotation = 0.0f; + NetMessage.SendData(41, number: this.whoAmI); + } + } + if (this.whoAmI == Main.myPlayer && (sItem.type == 509 || sItem.type == 510 || sItem.type == 849 || sItem.type == 850 || sItem.type == 851 || sItem.type == 3612 || sItem.type == 3620 || sItem.type == 3625) && (double) this.position.X / 16.0 - (double) Player.tileRangeX - (double) sItem.tileBoost - (double) this.blockRange <= (double) Player.tileTargetX && ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX + (double) sItem.tileBoost - 1.0 + (double) this.blockRange >= (double) Player.tileTargetX && (double) this.position.Y / 16.0 - (double) Player.tileRangeY - (double) sItem.tileBoost - (double) this.blockRange <= (double) Player.tileTargetY && ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY + (double) sItem.tileBoost - 2.0 + (double) this.blockRange >= (double) Player.tileTargetY) + { + if (!Main.GamepadDisableCursorItemIcon) + { + this.showItemIcon = true; + Main.ItemIconCacheUpdate(sItem.type); + } + if (this.itemAnimation > 0 && this.itemTime == 0 && this.controlUseItem) + { + int tileTargetX = Player.tileTargetX; + int tileTargetY = Player.tileTargetY; + if (sItem.type == 509) + { + int index32 = -1; + for (int index33 = 0; index33 < 58; ++index33) + { + if (this.inventory[index33].stack > 0 && this.inventory[index33].type == 530) + { + index32 = index33; + break; + } + } + if (index32 >= 0 && WorldGen.PlaceWire(tileTargetX, tileTargetY)) + { + --this.inventory[index32].stack; + if (this.inventory[index32].stack <= 0) + this.inventory[index32].SetDefaults(); + this.itemTime = sItem.useTime; + NetMessage.SendData(17, number: 5, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); + } + } + else if (sItem.type == 850) + { + int index34 = -1; + for (int index35 = 0; index35 < 58; ++index35) + { + if (this.inventory[index35].stack > 0 && this.inventory[index35].type == 530) + { + index34 = index35; + break; + } + } + if (index34 >= 0 && WorldGen.PlaceWire2(tileTargetX, tileTargetY)) + { + --this.inventory[index34].stack; + if (this.inventory[index34].stack <= 0) + this.inventory[index34].SetDefaults(); + this.itemTime = sItem.useTime; + NetMessage.SendData(17, number: 10, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); + } + } + if (sItem.type == 851) + { + int index36 = -1; + for (int index37 = 0; index37 < 58; ++index37) + { + if (this.inventory[index37].stack > 0 && this.inventory[index37].type == 530) + { + index36 = index37; + break; + } + } + if (index36 >= 0 && WorldGen.PlaceWire3(tileTargetX, tileTargetY)) + { + --this.inventory[index36].stack; + if (this.inventory[index36].stack <= 0) + this.inventory[index36].SetDefaults(); + this.itemTime = sItem.useTime; + NetMessage.SendData(17, number: 12, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); + } + } + if (sItem.type == 3612) + { + int index38 = -1; + for (int index39 = 0; index39 < 58; ++index39) + { + if (this.inventory[index39].stack > 0 && this.inventory[index39].type == 530) + { + index38 = index39; + break; + } + } + if (index38 >= 0 && WorldGen.PlaceWire4(tileTargetX, tileTargetY)) + { + --this.inventory[index38].stack; + if (this.inventory[index38].stack <= 0) + this.inventory[index38].SetDefaults(); + this.itemTime = sItem.useTime; + NetMessage.SendData(17, number: 16, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); + } + } + else if (sItem.type == 510) + { + if (WorldGen.KillActuator(tileTargetX, tileTargetY)) + { + this.itemTime = sItem.useTime; + NetMessage.SendData(17, number: 9, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); + } + else if (WorldGen.KillWire4(tileTargetX, tileTargetY)) + { + this.itemTime = sItem.useTime; + NetMessage.SendData(17, number: 17, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); + } + else if (WorldGen.KillWire3(tileTargetX, tileTargetY)) + { + this.itemTime = sItem.useTime; + NetMessage.SendData(17, number: 13, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); + } + else if (WorldGen.KillWire2(tileTargetX, tileTargetY)) + { + this.itemTime = sItem.useTime; + NetMessage.SendData(17, number: 11, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); + } + else if (WorldGen.KillWire(tileTargetX, tileTargetY)) + { + this.itemTime = sItem.useTime; + NetMessage.SendData(17, number: 6, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); + } + } + else if (sItem.type == 849 && sItem.stack > 0 && WorldGen.PlaceActuator(tileTargetX, tileTargetY)) + { + this.itemTime = sItem.useTime; + NetMessage.SendData(17, number: 8, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); + --sItem.stack; + if (sItem.stack <= 0) + sItem.SetDefaults(); + } + if (sItem.type == 3620) + { + Tile tile = Main.tile[tileTargetX, tileTargetY]; + if (tile != null && tile.actuator()) + { + bool flag11 = tile.inActive(); + if ((!this.ActuationRodLock || this.ActuationRodLockSetting == tile.inActive()) && Wiring.Actuate(tileTargetX, tileTargetY) && flag11 != tile.inActive()) + { + this.ActuationRodLock = true; + this.ActuationRodLockSetting = !tile.inActive(); + this.itemTime = sItem.useTime; + NetMessage.SendData(17, number: 19, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); + } + } + } + if (sItem.type == 3625) + { + Point point = new Point(Player.tileTargetX, Player.tileTargetY); + this.itemTime = sItem.useTime; + int toolMode = (int) WiresUI.Settings.ToolMode; + WiresUI.Settings.ToolMode &= ~WiresUI.Settings.MultiToolMode.Actuator; + if (Main.netMode == 1) + NetMessage.SendData(109, number: point.X, number2: ((float) point.Y), number3: ((float) point.X), number4: ((float) point.Y), number5: ((int) WiresUI.Settings.ToolMode)); + else + Wiring.MassWireOperation(point, point, this); + WiresUI.Settings.ToolMode = (WiresUI.Settings.MultiToolMode) toolMode; + } + } + } + if (this.itemAnimation > 0 && this.itemTime == 0 && (sItem.type == 507 || sItem.type == 508)) + { + this.itemTime = sItem.useTime; + Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); + double num158 = (double) Main.mouseX + (double) Main.screenPosition.X - (double) vector2.X; + float num159 = (float) Main.mouseY + Main.screenPosition.Y - vector2.Y; + float num160 = (float) Math.Sqrt(num158 * num158 + (double) num159 * (double) num159) / (float) (Main.screenHeight / 2); + if ((double) num160 > 1.0) + num160 = 1f; + float number2 = (float) ((double) num160 * 2.0 - 1.0); + if ((double) number2 < -1.0) + number2 = -1f; + if ((double) number2 > 1.0) + number2 = 1f; + Main.harpNote = number2; + LegacySoundStyle type2 = SoundID.Item26; + if (sItem.type == 507) + type2 = SoundID.Item35; + Main.PlaySound(type2, this.position); + NetMessage.SendData(58, number: this.whoAmI, number2: number2); + } + if ((sItem.type >= 205 && sItem.type <= 207 || sItem.type == 1128 || sItem.type == 3031 || sItem.type == 3032) && !this.noBuilding && (double) this.position.X / 16.0 - (double) Player.tileRangeX - (double) sItem.tileBoost <= (double) Player.tileTargetX && ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX + (double) sItem.tileBoost - 1.0 >= (double) Player.tileTargetX && (double) this.position.Y / 16.0 - (double) Player.tileRangeY - (double) sItem.tileBoost <= (double) Player.tileTargetY && ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY + (double) sItem.tileBoost - 2.0 >= (double) Player.tileTargetY) + { + if (!Main.GamepadDisableCursorItemIcon) + { + this.showItemIcon = true; + Main.ItemIconCacheUpdate(sItem.type); + } + if (this.itemTime == 0 && this.itemAnimation > 0 && this.controlUseItem) + { + if (sItem.type == 205 || sItem.type == 3032 && Main.tile[Player.tileTargetX, Player.tileTargetY].liquidType() == (byte) 0) + { + int num161 = (int) Main.tile[Player.tileTargetX, Player.tileTargetY].liquidType(); + int num162 = 0; + for (int index40 = Player.tileTargetX - 1; index40 <= Player.tileTargetX + 1; ++index40) + { + for (int index41 = Player.tileTargetY - 1; index41 <= Player.tileTargetY + 1; ++index41) + { + if ((int) Main.tile[index40, index41].liquidType() == num161) + num162 += (int) Main.tile[index40, index41].liquid; + } + } + if (Main.tile[Player.tileTargetX, Player.tileTargetY].liquid > (byte) 0 && (num162 > 100 || sItem.type == 3032)) + { + int liquidType = (int) Main.tile[Player.tileTargetX, Player.tileTargetY].liquidType(); + if (sItem.type != 3032) + { + if (!Main.tile[Player.tileTargetX, Player.tileTargetY].lava()) + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].honey()) + { + --sItem.stack; + this.PutItemInInventory(1128, this.selectedItem); + } + else + { + --sItem.stack; + this.PutItemInInventory(206, this.selectedItem); + } + } + else + { + --sItem.stack; + this.PutItemInInventory(207, this.selectedItem); + } + } + Main.PlaySound(19, (int) this.position.X, (int) this.position.Y); + this.itemTime = sItem.useTime; + int liquid = (int) Main.tile[Player.tileTargetX, Player.tileTargetY].liquid; + Main.tile[Player.tileTargetX, Player.tileTargetY].liquid = (byte) 0; + Main.tile[Player.tileTargetX, Player.tileTargetY].lava(false); + Main.tile[Player.tileTargetX, Player.tileTargetY].honey(false); + WorldGen.SquareTileFrame(Player.tileTargetX, Player.tileTargetY, false); + if (Main.netMode == 1) + NetMessage.sendWater(Player.tileTargetX, Player.tileTargetY); + else + Liquid.AddWater(Player.tileTargetX, Player.tileTargetY); + for (int index42 = Player.tileTargetX - 1; index42 <= Player.tileTargetX + 1; ++index42) + { + for (int index43 = Player.tileTargetY - 1; index43 <= Player.tileTargetY + 1; ++index43) + { + if (liquid < 256 && (int) Main.tile[index42, index43].liquidType() == num161) + { + int num163 = (int) Main.tile[index42, index43].liquid; + if (num163 + liquid > (int) byte.MaxValue) + num163 = (int) byte.MaxValue - liquid; + liquid += num163; + Main.tile[index42, index43].liquid -= (byte) num163; + Main.tile[index42, index43].liquidType(liquidType); + if (Main.tile[index42, index43].liquid == (byte) 0) + { + Main.tile[index42, index43].lava(false); + Main.tile[index42, index43].honey(false); + } + WorldGen.SquareTileFrame(index42, index43, false); + if (Main.netMode == 1) + NetMessage.sendWater(index42, index43); + else + Liquid.AddWater(index42, index43); + } + } + } + } + } + else if (Main.tile[Player.tileTargetX, Player.tileTargetY].liquid < (byte) 200 && (!Main.tile[Player.tileTargetX, Player.tileTargetY].nactive() || !Main.tileSolid[(int) Main.tile[Player.tileTargetX, Player.tileTargetY].type] || Main.tileSolidTop[(int) Main.tile[Player.tileTargetX, Player.tileTargetY].type])) + { + if (sItem.type == 207) + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].liquid == (byte) 0 || Main.tile[Player.tileTargetX, Player.tileTargetY].liquidType() == (byte) 1) + { + Main.PlaySound(19, (int) this.position.X, (int) this.position.Y); + Main.tile[Player.tileTargetX, Player.tileTargetY].liquidType(1); + Main.tile[Player.tileTargetX, Player.tileTargetY].liquid = byte.MaxValue; + WorldGen.SquareTileFrame(Player.tileTargetX, Player.tileTargetY); + --sItem.stack; + this.PutItemInInventory(205, this.selectedItem); + this.itemTime = sItem.useTime; + if (Main.netMode == 1) + NetMessage.sendWater(Player.tileTargetX, Player.tileTargetY); + } + } + else if (sItem.type == 206 || sItem.type == 3031) + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].liquid == (byte) 0 || Main.tile[Player.tileTargetX, Player.tileTargetY].liquidType() == (byte) 0) + { + Main.PlaySound(19, (int) this.position.X, (int) this.position.Y); + Main.tile[Player.tileTargetX, Player.tileTargetY].liquidType(0); + Main.tile[Player.tileTargetX, Player.tileTargetY].liquid = byte.MaxValue; + WorldGen.SquareTileFrame(Player.tileTargetX, Player.tileTargetY); + if (sItem.type != 3031) + { + --sItem.stack; + this.PutItemInInventory(205, this.selectedItem); + } + this.itemTime = sItem.useTime; + if (Main.netMode == 1) + NetMessage.sendWater(Player.tileTargetX, Player.tileTargetY); + } + } + else if (sItem.type == 1128 && (Main.tile[Player.tileTargetX, Player.tileTargetY].liquid == (byte) 0 || Main.tile[Player.tileTargetX, Player.tileTargetY].liquidType() == (byte) 2)) + { + Main.PlaySound(19, (int) this.position.X, (int) this.position.Y); + Main.tile[Player.tileTargetX, Player.tileTargetY].liquidType(2); + Main.tile[Player.tileTargetX, Player.tileTargetY].liquid = byte.MaxValue; + WorldGen.SquareTileFrame(Player.tileTargetX, Player.tileTargetY); + --sItem.stack; + this.PutItemInInventory(205, this.selectedItem); + this.itemTime = sItem.useTime; + if (Main.netMode == 1) + NetMessage.sendWater(Player.tileTargetX, Player.tileTargetY); + } + } + } + } + if (!this.channel) + { + this.toolTime = this.itemTime; + } else - Lighting.AddLight(this.RotatedRelativePoint(new Vector2(this.itemLocation.X + 6f + this.velocity.X, this.itemLocation.Y - 14f)), 0.7f, 0.0f, 1f); + { + --this.toolTime; + if (this.toolTime < 0) + this.toolTime = sItem.pick <= 0 ? (int) ((double) sItem.useTime * (double) this.pickSpeed) : sItem.useTime; + } + if (sItem.pick > 0 || sItem.axe > 0 || sItem.hammer > 0) + { + bool flag12 = (double) this.position.X / 16.0 - (double) Player.tileRangeX - (double) sItem.tileBoost <= (double) Player.tileTargetX && ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX + (double) sItem.tileBoost - 1.0 >= (double) Player.tileTargetX && (double) this.position.Y / 16.0 - (double) Player.tileRangeY - (double) sItem.tileBoost <= (double) Player.tileTargetY && ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY + (double) sItem.tileBoost - 2.0 >= (double) Player.tileTargetY; + if (this.noBuilding) + flag12 = false; + if (flag12) + { + int damageAmount1 = 0; + bool flag13 = true; + if (!Main.GamepadDisableCursorItemIcon) + { + this.showItemIcon = true; + Main.ItemIconCacheUpdate(sItem.type); + } + if (this.toolTime == 0 && this.itemAnimation > 0 && this.controlUseItem && (!Main.tile[Player.tileTargetX, Player.tileTargetY].active() || !Main.tileHammer[(int) Main.tile[Player.tileTargetX, Player.tileTargetY].type] && !Main.tileSolid[(int) Main.tile[Player.tileTargetX, Player.tileTargetY].type] && Main.tile[Player.tileTargetX, Player.tileTargetY].type != (ushort) 314 && Main.tile[Player.tileTargetX, Player.tileTargetY].type != (ushort) 424 && Main.tile[Player.tileTargetX, Player.tileTargetY].type != (ushort) 442 && Main.tile[Player.tileTargetX, Player.tileTargetY].type != (ushort) 351)) + this.poundRelease = false; + if (Main.tile[Player.tileTargetX, Player.tileTargetY].active()) + { + if (sItem.pick > 0 && !Main.tileAxe[(int) Main.tile[Player.tileTargetX, Player.tileTargetY].type] && !Main.tileHammer[(int) Main.tile[Player.tileTargetX, Player.tileTargetY].type] || sItem.axe > 0 && Main.tileAxe[(int) Main.tile[Player.tileTargetX, Player.tileTargetY].type] || sItem.hammer > 0 && Main.tileHammer[(int) Main.tile[Player.tileTargetX, Player.tileTargetY].type]) + flag13 = false; + if (this.toolTime == 0 && this.itemAnimation > 0 && this.controlUseItem) + { + int tileId = this.hitTile.HitObject(Player.tileTargetX, Player.tileTargetY, 1); + if (Main.tileNoFail[(int) Main.tile[Player.tileTargetX, Player.tileTargetY].type]) + damageAmount1 = 100; + if (Main.tileHammer[(int) Main.tile[Player.tileTargetX, Player.tileTargetY].type]) + { + flag13 = false; + if (sItem.hammer > 0) + { + damageAmount1 += sItem.hammer; + if (!WorldGen.CanKillTile(Player.tileTargetX, Player.tileTargetY)) + damageAmount1 = 0; + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == (ushort) 26 && (sItem.hammer < 80 || !Main.hardMode)) + { + damageAmount1 = 0; + this.Hurt(PlayerDeathReason.ByOther(4), this.statLife / 2, -this.direction); + } + AchievementsHelper.CurrentlyMining = true; + if (this.hitTile.AddDamage(tileId, damageAmount1) >= 100) + { + this.hitTile.Clear(tileId); + WorldGen.KillTile(Player.tileTargetX, Player.tileTargetY); + if (Main.netMode == 1) + NetMessage.SendData(17, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); + } + else + { + WorldGen.KillTile(Player.tileTargetX, Player.tileTargetY, true); + if (Main.netMode == 1) + NetMessage.SendData(17, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY), number4: 1f); + } + if (damageAmount1 != 0) + this.hitTile.Prune(); + this.itemTime = sItem.useTime; + AchievementsHelper.CurrentlyMining = false; + } + } + else if (Main.tileAxe[(int) Main.tile[Player.tileTargetX, Player.tileTargetY].type]) + { + if (Main.tile[Player.tileTargetX, Player.tileTargetY].type == (ushort) 80) + damageAmount1 += sItem.axe * 3; + else + damageAmount1 += sItem.axe; + if (sItem.axe > 0) + { + AchievementsHelper.CurrentlyMining = true; + if (!WorldGen.CanKillTile(Player.tileTargetX, Player.tileTargetY)) + damageAmount1 = 0; + if (this.hitTile.AddDamage(tileId, damageAmount1) >= 100) + { + this.hitTile.Clear(tileId); + WorldGen.KillTile(Player.tileTargetX, Player.tileTargetY); + if (Main.netMode == 1) + NetMessage.SendData(17, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY)); + } + else + { + WorldGen.KillTile(Player.tileTargetX, Player.tileTargetY, true); + if (Main.netMode == 1) + NetMessage.SendData(17, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY), number4: 1f); + } + if (damageAmount1 != 0) + this.hitTile.Prune(); + this.itemTime = sItem.useTime; + AchievementsHelper.CurrentlyMining = false; + } + } + else if (sItem.pick > 0) + { + this.PickTile(Player.tileTargetX, Player.tileTargetY, sItem.pick); + this.itemTime = (int) ((double) sItem.useTime * (double) this.pickSpeed); + } + if (sItem.pick > 0) + this.itemTime = (int) ((double) sItem.useTime * (double) this.pickSpeed); + if (sItem.hammer > 0 && Main.tile[Player.tileTargetX, Player.tileTargetY].active() && (Main.tileSolid[(int) Main.tile[Player.tileTargetX, Player.tileTargetY].type] && Main.tile[Player.tileTargetX, Player.tileTargetY].type != (ushort) 10 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == (ushort) 314 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == (ushort) 351 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == (ushort) 424 || Main.tile[Player.tileTargetX, Player.tileTargetY].type == (ushort) 442) && this.poundRelease) + { + flag13 = false; + this.itemTime = sItem.useTime; + int num164 = damageAmount1 + (int) ((double) sItem.hammer * 1.25); + int damageAmount2 = 100; + if (Main.tile[Player.tileTargetX, Player.tileTargetY - 1].active() && Main.tile[Player.tileTargetX, Player.tileTargetY - 1].type == (ushort) 10) + damageAmount2 = 0; + if (Main.tile[Player.tileTargetX, Player.tileTargetY + 1].active() && Main.tile[Player.tileTargetX, Player.tileTargetY + 1].type == (ushort) 10) + damageAmount2 = 0; + if (this.hitTile.AddDamage(tileId, damageAmount2) >= 100) + { + this.hitTile.Clear(tileId); + if (this.poundRelease) + { + int tileTargetX = Player.tileTargetX; + int tileTargetY = Player.tileTargetY; + if (TileID.Sets.Platforms[(int) Main.tile[tileTargetX, tileTargetY].type]) + { + if (Main.tile[tileTargetX, tileTargetY].halfBrick()) + { + WorldGen.PoundTile(tileTargetX, tileTargetY); + if (Main.netMode == 1) + NetMessage.SendData(17, number: 7, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY), number4: 1f); + } + else + { + int slope1 = 1; + int slope2 = 2; + if (TileID.Sets.Platforms[(int) Main.tile[tileTargetX + 1, tileTargetY - 1].type] || TileID.Sets.Platforms[(int) Main.tile[tileTargetX - 1, tileTargetY + 1].type] || WorldGen.SolidTile(tileTargetX + 1, tileTargetY) && !WorldGen.SolidTile(tileTargetX - 1, tileTargetY)) + { + slope1 = 2; + slope2 = 1; + } + if (Main.tile[tileTargetX, tileTargetY].slope() == (byte) 0) + { + WorldGen.SlopeTile(tileTargetX, tileTargetY, slope1); + int num165 = (int) Main.tile[tileTargetX, tileTargetY].slope(); + if (Main.netMode == 1) + NetMessage.SendData(17, number: 14, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY), number4: ((float) num165)); + } + else if ((int) Main.tile[tileTargetX, tileTargetY].slope() == slope1) + { + WorldGen.SlopeTile(tileTargetX, tileTargetY, slope2); + int num166 = (int) Main.tile[tileTargetX, tileTargetY].slope(); + if (Main.netMode == 1) + NetMessage.SendData(17, number: 14, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY), number4: ((float) num166)); + } + else + { + WorldGen.SlopeTile(tileTargetX, tileTargetY); + int num167 = (int) Main.tile[tileTargetX, tileTargetY].slope(); + if (Main.netMode == 1) + NetMessage.SendData(17, number: 14, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY), number4: ((float) num167)); + WorldGen.PoundTile(tileTargetX, tileTargetY); + if (Main.netMode == 1) + NetMessage.SendData(17, number: 7, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY), number4: 1f); + } + } + } + else if (Main.tile[tileTargetX, tileTargetY].type == (ushort) 314) + { + if (Minecart.FrameTrack(tileTargetX, tileTargetY, true) && Main.netMode == 1) + NetMessage.SendData(17, number: 15, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY), number4: 1f); + } + else if (Main.tile[tileTargetX, tileTargetY].type == (ushort) 137) + { + int num168 = 0; + switch ((int) Main.tile[tileTargetX, tileTargetY].frameY / 18) + { + case 0: + case 1: + case 2: + switch ((int) Main.tile[tileTargetX, tileTargetY].frameX / 18) + { + case 0: + num168 = 2; + break; + case 1: + num168 = 3; + break; + case 2: + num168 = 4; + break; + case 3: + num168 = 5; + break; + case 4: + num168 = 1; + break; + case 5: + num168 = 0; + break; + } + break; + case 3: + case 4: + switch ((int) Main.tile[tileTargetX, tileTargetY].frameX / 18) + { + case 0: + case 1: + num168 = 3; + break; + case 2: + num168 = 4; + break; + case 3: + num168 = 2; + break; + case 4: + num168 = 0; + break; + } + break; + } + Main.tile[tileTargetX, tileTargetY].frameX = (short) (num168 * 18); + if (Main.netMode == 1) + NetMessage.SendTileSquare(-1, Player.tileTargetX, Player.tileTargetY, 1); + } + else if (Main.tile[tileTargetX, tileTargetY].type == (ushort) 424) + { + Main.tile[tileTargetX, tileTargetY].frameX = Main.tile[tileTargetX, tileTargetY].frameX != (short) 0 ? (Main.tile[tileTargetX, tileTargetY].frameX != (short) 18 ? (short) 0 : (short) 36) : (short) 18; + if (Main.netMode == 1) + NetMessage.SendTileSquare(-1, Player.tileTargetX, Player.tileTargetY, 1); + } + else if (Main.tile[tileTargetX, tileTargetY].type == (ushort) 442) + { + Tile tile1 = Main.tile[tileTargetX, tileTargetY - 1]; + Tile tile2 = Main.tile[tileTargetX, tileTargetY + 1]; + Tile tile3 = Main.tile[tileTargetX - 1, tileTargetY]; + Tile tile4 = Main.tile[tileTargetX + 1, tileTargetY]; + Tile tile5 = Main.tile[tileTargetX - 1, tileTargetY + 1]; + Tile tile6 = Main.tile[tileTargetX + 1, tileTargetY + 1]; + Tile tile7 = Main.tile[tileTargetX - 1, tileTargetY - 1]; + Tile tile8 = Main.tile[tileTargetX + 1, tileTargetY - 1]; + int index44 = -1; + int index45 = -1; + int index46 = -1; + int index47 = -1; + int num169 = -1; + int num170 = -1; + int num171 = -1; + int num172 = -1; + if (tile1 != null && tile1.nactive() && !tile1.bottomSlope()) + index45 = (int) tile1.type; + if (tile2 != null && tile2.nactive() && !tile2.halfBrick() && !tile2.topSlope()) + index44 = (int) tile2.type; + if (tile3 != null && tile3.nactive() && (tile3.slope() == (byte) 0 || (int) tile3.slope() % 2 != 1)) + index46 = (int) tile3.type; + if (tile4 != null && tile4.nactive() && (tile4.slope() == (byte) 0 || (int) tile4.slope() % 2 != 0)) + index47 = (int) tile4.type; + if (tile5 != null && tile5.nactive()) + num169 = (int) tile5.type; + if (tile6 != null && tile6.nactive()) + num170 = (int) tile6.type; + if (tile7 != null && tile7.nactive()) + num171 = (int) tile7.type; + if (tile8 != null && tile8.nactive()) + num172 = (int) tile8.type; + bool flag14 = false; + bool flag15 = false; + bool flag16 = false; + bool flag17 = false; + if (index44 >= 0 && Main.tileSolid[index44] && (!Main.tileNoAttach[index44] || TileID.Sets.Platforms[index44]) && (tile2.bottomSlope() || tile2.slope() == (byte) 0) && !tile2.halfBrick()) + flag17 = true; + if (index45 >= 0 && Main.tileSolid[index45] && (!Main.tileNoAttach[index45] || TileID.Sets.Platforms[index45] && tile1.halfBrick()) && (tile1.topSlope() || tile1.slope() == (byte) 0 || tile1.halfBrick())) + flag14 = true; + if (index46 >= 0 && Main.tileSolid[index46] && !Main.tileNoAttach[index46] && (tile3.leftSlope() || tile3.slope() == (byte) 0) && !tile3.halfBrick() || index46 == 124 || index46 == 5 && num171 == 5 && num169 == 5) + flag15 = true; + if (index47 >= 0 && Main.tileSolid[index47] && !Main.tileNoAttach[index47] && (tile4.rightSlope() || tile4.slope() == (byte) 0) && !tile4.halfBrick() || index47 == 124 || index47 == 5 && num172 == 5 && num170 == 5) + flag16 = true; + int num173 = (int) Main.tile[tileTargetX, tileTargetY].frameX / 22; + short num174 = -2; + switch (num173) + { + case 0: + num174 = !flag15 ? (!flag14 ? (!flag16 ? (short) -1 : (short) 3) : (short) 1) : (short) 2; + break; + case 1: + num174 = !flag16 ? (!flag17 ? (!flag15 ? (short) -1 : (short) 2) : (short) 0) : (short) 3; + break; + case 2: + num174 = !flag14 ? (!flag16 ? (!flag17 ? (short) -1 : (short) 0) : (short) 3) : (short) 1; + break; + case 3: + num174 = !flag17 ? (!flag15 ? (!flag14 ? (short) -1 : (short) 1) : (short) 2) : (short) 0; + break; + } + switch (num174) + { + case -2: + num174 = (short) 0; + break; + case -1: + goto label_1392; + } + Main.tile[tileTargetX, tileTargetY].frameX = (short) (22 * (int) num174); + if (Main.netMode == 1) + NetMessage.SendTileSquare(-1, Player.tileTargetX, Player.tileTargetY, 1); + } + else if ((Main.tile[tileTargetX, tileTargetY].halfBrick() || Main.tile[tileTargetX, tileTargetY].slope() != (byte) 0) && !Main.tileSolidTop[(int) Main.tile[Player.tileTargetX, Player.tileTargetY].type]) + { + int num175 = 1; + int slope3 = 1; + int slope4 = 2; + if ((WorldGen.SolidTile(tileTargetX + 1, tileTargetY) || Main.tile[tileTargetX + 1, tileTargetY].slope() == (byte) 1 || Main.tile[tileTargetX + 1, tileTargetY].slope() == (byte) 3) && !WorldGen.SolidTile(tileTargetX - 1, tileTargetY)) + { + slope3 = 2; + slope4 = 1; + } + if (WorldGen.SolidTile(tileTargetX, tileTargetY - 1) && !WorldGen.SolidTile(tileTargetX, tileTargetY + 1)) + num175 = -1; + if (num175 == 1) + { + if (Main.tile[tileTargetX, tileTargetY].slope() == (byte) 0) + WorldGen.SlopeTile(tileTargetX, tileTargetY, slope3); + else if ((int) Main.tile[tileTargetX, tileTargetY].slope() == slope3) + WorldGen.SlopeTile(tileTargetX, tileTargetY, slope4); + else if ((int) Main.tile[tileTargetX, tileTargetY].slope() == slope4) + WorldGen.SlopeTile(tileTargetX, tileTargetY, slope3 + 2); + else if ((int) Main.tile[tileTargetX, tileTargetY].slope() == slope3 + 2) + WorldGen.SlopeTile(tileTargetX, tileTargetY, slope4 + 2); + else + WorldGen.SlopeTile(tileTargetX, tileTargetY); + } + else if (Main.tile[tileTargetX, tileTargetY].slope() == (byte) 0) + WorldGen.SlopeTile(tileTargetX, tileTargetY, slope3 + 2); + else if ((int) Main.tile[tileTargetX, tileTargetY].slope() == slope3 + 2) + WorldGen.SlopeTile(tileTargetX, tileTargetY, slope4 + 2); + else if ((int) Main.tile[tileTargetX, tileTargetY].slope() == slope4 + 2) + WorldGen.SlopeTile(tileTargetX, tileTargetY, slope3); + else if ((int) Main.tile[tileTargetX, tileTargetY].slope() == slope3) + WorldGen.SlopeTile(tileTargetX, tileTargetY, slope4); + else + WorldGen.SlopeTile(tileTargetX, tileTargetY); + int num176 = (int) Main.tile[tileTargetX, tileTargetY].slope(); + if (Main.netMode == 1) + NetMessage.SendData(17, number: 14, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY), number4: ((float) num176)); + } + else + { + WorldGen.PoundTile(tileTargetX, tileTargetY); + if (Main.netMode == 1) + NetMessage.SendData(17, number: 7, number2: ((float) Player.tileTargetX), number3: ((float) Player.tileTargetY), number4: 1f); + } +label_1392: + this.poundRelease = false; + } + } + else + { + WorldGen.KillTile(Player.tileTargetX, Player.tileTargetY, true, true); + Main.PlaySound(0, Player.tileTargetX * 16, Player.tileTargetY * 16); + } + } + else + this.poundRelease = false; + } + } + if (this.releaseUseItem) + this.poundRelease = true; + int index48 = Player.tileTargetX; + int index49 = Player.tileTargetY; + bool flag18 = true; + if (Main.tile[index48, index49].wall > (byte) 0) + { + if (!Main.wallHouse[(int) Main.tile[index48, index49].wall]) + { + for (int index50 = index48 - 1; index50 < index48 + 2; ++index50) + { + for (int index51 = index49 - 1; index51 < index49 + 2; ++index51) + { + if ((int) Main.tile[index50, index51].wall != (int) Main.tile[index48, index49].wall) + { + flag18 = false; + break; + } + } + } + } + else + flag18 = false; + } + if (flag18 && !Main.tile[index48, index49].active()) + { + int num177 = -1; + if (((double) Main.mouseX + (double) Main.screenPosition.X) / 16.0 < Math.Round(((double) Main.mouseX + (double) Main.screenPosition.X) / 16.0)) + num177 = 0; + int num178 = -1; + if (((double) Main.mouseY + (double) Main.screenPosition.Y) / 16.0 < Math.Round(((double) Main.mouseY + (double) Main.screenPosition.Y) / 16.0)) + num178 = 0; + for (int index52 = Player.tileTargetX + num177; index52 <= Player.tileTargetX + num177 + 1; ++index52) + { + for (int index53 = Player.tileTargetY + num178; index53 <= Player.tileTargetY + num178 + 1; ++index53) + { + if (flag18) + { + index48 = index52; + index49 = index53; + if (Main.tile[index48, index49].wall > (byte) 0) + { + if (!Main.wallHouse[(int) Main.tile[index48, index49].wall]) + { + for (int index54 = index48 - 1; index54 < index48 + 2; ++index54) + { + for (int index55 = index49 - 1; index55 < index49 + 2; ++index55) + { + if ((int) Main.tile[index54, index55].wall != (int) Main.tile[index48, index49].wall) + { + flag18 = false; + break; + } + } + } + } + else + flag18 = false; + } + } + } + } + } + if (flag13 && Main.tile[index48, index49].wall > (byte) 0 && (!Main.tile[index48, index49].active() || index48 != Player.tileTargetX || index49 != Player.tileTargetY || !Main.tileHammer[(int) Main.tile[index48, index49].type] && !this.poundRelease) && this.toolTime == 0 && this.itemAnimation > 0 && this.controlUseItem && sItem.hammer > 0) + { + bool flag19 = true; + if (!Main.wallHouse[(int) Main.tile[index48, index49].wall]) + { + flag19 = false; + for (int index56 = index48 - 1; index56 < index48 + 2; ++index56) + { + for (int index57 = index49 - 1; index57 < index49 + 2; ++index57) + { + if (Main.tile[index56, index57].wall == (byte) 0 || Main.wallHouse[(int) Main.tile[index56, index57].wall]) + { + flag19 = true; + break; + } + } + } + } + if (flag19) + { + int tileId = this.hitTile.HitObject(index48, index49, 2); + int damageAmount3 = (int) ((double) sItem.hammer * 1.5); + if (this.hitTile.AddDamage(tileId, damageAmount3) >= 100) + { + this.hitTile.Clear(tileId); + WorldGen.KillWall(index48, index49); + if (Main.netMode == 1) + NetMessage.SendData(17, number: 2, number2: ((float) index48), number3: ((float) index49)); + } + else + { + WorldGen.KillWall(index48, index49, true); + if (Main.netMode == 1) + NetMessage.SendData(17, number: 2, number2: ((float) index48), number3: ((float) index49), number4: 1f); + } + if (damageAmount3 != 0) + this.hitTile.Prune(); + this.itemTime = sItem.useTime / 2; + } + } + } + } + if (Main.myPlayer == this.whoAmI && sItem.type == 1326 && this.itemAnimation > 0 && this.itemTime == 0) + { + this.itemTime = sItem.useTime; + Vector2 vector2; + vector2.X = (float) Main.mouseX + Main.screenPosition.X; + vector2.Y = (double) this.gravDir != 1.0 ? Main.screenPosition.Y + (float) Main.screenHeight - (float) Main.mouseY : (float) Main.mouseY + Main.screenPosition.Y - (float) this.height; + vector2.X -= (float) (this.width / 2); + if ((double) vector2.X > 50.0 && (double) vector2.X < (double) (Main.maxTilesX * 16 - 50) && (double) vector2.Y > 50.0 && (double) vector2.Y < (double) (Main.maxTilesY * 16 - 50)) + { + int index58 = (int) ((double) vector2.X / 16.0); + int index59 = (int) ((double) vector2.Y / 16.0); + if ((Main.tile[index58, index59].wall != (byte) 87 || (double) index59 <= Main.worldSurface || NPC.downedPlantBoss) && !Collision.SolidCollision(vector2, this.width, this.height)) + { + this.Teleport(vector2, 1); + NetMessage.SendData(65, number2: ((float) this.whoAmI), number3: vector2.X, number4: vector2.Y, number5: 1); + if (this.chaosState) + { + this.statLife -= this.statLifeMax2 / 7; + PlayerDeathReason damageSource = PlayerDeathReason.ByOther(13); + if (Main.rand.Next(2) == 0) + damageSource = PlayerDeathReason.ByOther(this.Male ? 14 : 15); + if (this.statLife <= 0) + this.KillMe(damageSource, 1.0, 0); + this.lifeRegenCount = 0; + this.lifeRegenTime = 0; + } + this.AddBuff(88, 360); + } + } + } + if (sItem.type == 29 && this.itemAnimation > 0 && this.statLifeMax < 400 && this.itemTime == 0) + { + this.itemTime = sItem.useTime; + this.statLifeMax += 20; + this.statLifeMax2 += 20; + this.statLife += 20; + if (Main.myPlayer == this.whoAmI) + this.HealEffect(20); + AchievementsHelper.HandleSpecialEvent(this, 0); + } + if (sItem.type == 1291 && this.itemAnimation > 0 && this.statLifeMax >= 400 && this.statLifeMax < 500 && this.itemTime == 0) + { + this.itemTime = sItem.useTime; + this.statLifeMax += 5; + this.statLifeMax2 += 5; + this.statLife += 5; + if (Main.myPlayer == this.whoAmI) + this.HealEffect(5); + AchievementsHelper.HandleSpecialEvent(this, 2); + } + if (sItem.type == 109 && this.itemAnimation > 0 && this.statManaMax < 200 && this.itemTime == 0) + { + this.itemTime = sItem.useTime; + this.statManaMax += 20; + this.statManaMax2 += 20; + this.statMana += 20; + if (Main.myPlayer == this.whoAmI) + this.ManaEffect(20); + AchievementsHelper.HandleSpecialEvent(this, 1); + } + if (sItem.type == 3335 && this.itemAnimation > 0 && !this.extraAccessory && Main.expertMode && this.itemTime == 0) + { + this.itemTime = sItem.useTime; + this.extraAccessory = true; + NetMessage.SendData(4, number: this.whoAmI); + } + this.PlaceThing(); } if (sItem.type == 3542) { - Vector2 vector2_1 = Main.OffsetsPlayerOnhand[this.bodyFrame.Y / 56] * 2f; + Vector2 vector2_35 = Main.OffsetsPlayerOnhand[this.bodyFrame.Y / 56] * 2f; if (this.direction != 1) - vector2_1.X = (float) this.bodyFrame.Width - vector2_1.X; + vector2_35.X = (float) this.bodyFrame.Width - vector2_35.X; if ((double) this.gravDir != 1.0) - vector2_1.Y = (float) this.bodyFrame.Height - vector2_1.Y; - Vector2 vector2_2 = this.RotatedRelativePoint(this.MountedCenter - new Vector2(20f, 42f) / 2f + (vector2_1 - new Vector2((float) (this.bodyFrame.Width - this.width), (float) (this.bodyFrame.Height - 42)) / 2f)) - this.velocity; + vector2_35.Y = (float) this.bodyFrame.Height - vector2_35.Y; + Vector2 vector2_36 = this.RotatedRelativePoint(this.position + (vector2_35 - new Vector2((float) (this.bodyFrame.Width - this.width), (float) (this.bodyFrame.Height - 42)) / 2f)) - this.velocity; for (int index = 0; index < 4; ++index) { Dust dust = Main.dust[Dust.NewDust(this.Center, 0, 0, 242, (float) (this.direction * 2), Alpha: 150, Scale: 1.3f)]; - dust.position = vector2_2; + dust.position = vector2_36; dust.velocity *= 0.0f; dust.noGravity = true; dust.fadeIn = 1f; @@ -31943,1516 +23725,1135 @@ label_106: } } } - if (sItem.type != 4952 || this.pulley) - return; - Vector2 pos = this.itemLocation + new Vector2((float) (8 * this.direction), -10f * this.gravDir); - Vector3 rgb = new Vector3(1f, 0.7f, 0.8f) * 1.3f; - Vector2 vector2_3 = this.RotatedRelativePoint(pos); - Lighting.AddLight(vector2_3, rgb); - if (Main.rand.Next(40) != 0) - return; - Vector2 vector2_4 = Main.rand.NextVector2Circular(4f, 4f); - Dust dust1 = Dust.NewDustPerfect(vector2_3 + vector2_4, 43, new Vector2?(Vector2.Zero), 254, new Color((int) byte.MaxValue, (int) byte.MaxValue, 0, (int) byte.MaxValue), 0.3f); - if (vector2_4 != Vector2.Zero) - dust1.velocity = vector2_3.DirectionTo(dust1.position) * 0.2f; - dust1.fadeIn = 0.3f; - dust1.noLightEmittence = true; - dust1.customData = (object) this; - } - - public bool CanVisuallyHoldItem(Item item) => item.holdStyle != 4 || !this.pulley && (double) this.gravDir != -1.0 && (double) this.velocity.Y == 0.0 && !this.mount.Active; - - private void ItemCheck_ApplyHoldStyle(float mountOffset, Item sItem, Microsoft.Xna.Framework.Rectangle heldItemFrame) - { - if (!this.CanVisuallyHoldItem(sItem)) - return; - if (this.isPettingAnimal) + if ((sItem.damage >= 0 && sItem.type > 0 && !sItem.noMelee || sItem.type == 1450 || sItem.type == 1991 || sItem.type == 3183 || sItem.type == 3542 || sItem.type == 3779) && this.itemAnimation > 0) { - int num1 = this.miscCounter % 14 / 7; - Player.CompositeArmStretchAmount stretch = Player.CompositeArmStretchAmount.ThreeQuarters; - if (num1 == 1) - stretch = Player.CompositeArmStretchAmount.Full; - float num2 = 0.3f; - if (this.isTheAnimalBeingPetSmall) - num2 = 0.2f; - this.SetCompositeArmBack(true, stretch, -6.283185f * num2 * (float) this.direction); - } - else if (sItem.holdStyle == 1 && !this.pulley) - { - if (Main.dedServ) - this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 + 20.0 * (double) this.direction); - else if (sItem.type == 930) + bool flag20 = false; + Microsoft.Xna.Framework.Rectangle r = new Microsoft.Xna.Framework.Rectangle((int) this.itemLocation.X, (int) this.itemLocation.Y, 32, 32); + if (!Main.dedServ) + r = new Microsoft.Xna.Framework.Rectangle((int) this.itemLocation.X, (int) this.itemLocation.Y, Main.itemTexture[sItem.type].Width, Main.itemTexture[sItem.type].Height); + r.Width = (int) ((double) r.Width * (double) sItem.scale); + r.Height = (int) ((double) r.Height * (double) sItem.scale); + if (this.direction == -1) + r.X -= r.Width; + if ((double) this.gravDir == 1.0) + r.Y -= r.Height; + if (sItem.useStyle == 1) { - this.itemLocation.X = (float) ((double) this.position.X + (double) (this.width / 2) * 0.5 - 12.0) - (float) (2 * this.direction); - float x = this.position.X + (float) (this.width / 2) + (float) (38 * this.direction); - if (this.direction == 1) - x -= 10f; - float y = this.MountedCenter.Y - 4f * this.gravDir; - if ((double) this.gravDir == -1.0) - y -= 8f; - this.RotateRelativePoint(ref x, ref y); - int Type = 0; - for (int index = 54; index < 58; ++index) + if ((double) this.itemAnimation < (double) this.itemAnimationMax * 0.333) { - if (this.inventory[index].stack > 0 && this.inventory[index].ammo == 931) + if (this.direction == -1) + r.X -= (int) ((double) r.Width * 1.4 - (double) r.Width); + r.Width = (int) ((double) r.Width * 1.4); + r.Y += (int) ((double) r.Height * 0.5 * (double) this.gravDir); + r.Height = (int) ((double) r.Height * 1.1); + } + else if ((double) this.itemAnimation >= (double) this.itemAnimationMax * 0.666) + { + if (this.direction == 1) + r.X -= (int) ((double) r.Width * 1.2); + r.Width *= 2; + r.Y -= (int) (((double) r.Height * 1.4 - (double) r.Height) * (double) this.gravDir); + r.Height = (int) ((double) r.Height * 1.4); + } + } + else if (sItem.useStyle == 3) + { + if ((double) this.itemAnimation > (double) this.itemAnimationMax * 0.666) + { + flag20 = true; + } + else + { + if (this.direction == -1) + r.X -= (int) ((double) r.Width * 1.4 - (double) r.Width); + r.Width = (int) ((double) r.Width * 1.4); + r.Y += (int) ((double) r.Height * 0.6); + r.Height = (int) ((double) r.Height * 0.6); + } + } + double gravDir = (double) this.gravDir; + if (sItem.type == 1450 && Main.rand.Next(3) == 0) + { + int index = -1; + float x = (float) (r.X + Main.rand.Next(r.Width)); + float y = (float) (r.Y + Main.rand.Next(r.Height)); + if (Main.rand.Next(500) == 0) + index = Gore.NewGore(new Vector2(x, y), new Vector2(), 415, (float) Main.rand.Next(51, 101) * 0.01f); + else if (Main.rand.Next(250) == 0) + index = Gore.NewGore(new Vector2(x, y), new Vector2(), 414, (float) Main.rand.Next(51, 101) * 0.01f); + else if (Main.rand.Next(80) == 0) + index = Gore.NewGore(new Vector2(x, y), new Vector2(), 413, (float) Main.rand.Next(51, 101) * 0.01f); + else if (Main.rand.Next(10) == 0) + index = Gore.NewGore(new Vector2(x, y), new Vector2(), 412, (float) Main.rand.Next(51, 101) * 0.01f); + else if (Main.rand.Next(3) == 0) + index = Gore.NewGore(new Vector2(x, y), new Vector2(), 411, (float) Main.rand.Next(51, 101) * 0.01f); + if (index >= 0) + { + Main.gore[index].velocity.X += (float) (this.direction * 2); + Main.gore[index].velocity.Y *= 0.3f; + } + } + if (sItem.type == 3542) + flag20 = true; + if (sItem.type == 3779) + { + flag20 = true; + Vector2 vector2_37 = this.itemLocation + new Vector2((float) (this.direction * 30), -8f); + int itemAnimation = this.itemAnimation; + int num = this.itemAnimationMax - 2; + Vector2 vector2_38 = vector2_37 - this.position; + for (float amount = 0.0f; (double) amount < 1.0; amount += 0.2f) + { + Vector2 vector2_39 = Vector2.Lerp(this.oldPosition + vector2_38 + new Vector2(0.0f, this.gfxOffY), vector2_37, amount); + Dust dust = Main.dust[Dust.NewDust(vector2_37 - Vector2.One * 8f, 16, 16, 27, SpeedY: -2f)]; + dust.noGravity = true; + dust.position = vector2_39; + dust.velocity = new Vector2(0.0f, (float) (-(double) this.gravDir * 2.0)); + dust.scale = 1.2f; + dust.alpha = 200; + } + } + if (!flag20) + { + if (sItem.type == 989 && Main.rand.Next(5) == 0) + { + int Type; + switch (Main.rand.Next(3)) { - Type = this.inventory[index].type; - break; + case 0: + Type = 15; + break; + case 1: + Type = 57; + break; + default: + Type = 58; + break; + } + int index = Dust.NewDust(new Vector2((float) r.X, (float) r.Y), r.Width, r.Height, Type, (float) (this.direction * 2), Alpha: 150, Scale: 1.3f); + Main.dust[index].velocity *= 0.2f; + } + if (sItem.type == 2880 && Main.rand.Next(2) == 0) + { + int Type = Utils.SelectRandom(Main.rand, 226, 229); + int index = Dust.NewDust(new Vector2((float) r.X, (float) r.Y), r.Width, r.Height, Type, (float) (this.direction * 2), Alpha: 150); + Main.dust[index].velocity *= 0.2f; + Main.dust[index].noGravity = true; + } + if ((sItem.type == 44 || sItem.type == 45 || sItem.type == 46 || sItem.type == 103 || sItem.type == 104) && Main.rand.Next(15) == 0) + Dust.NewDust(new Vector2((float) r.X, (float) r.Y), r.Width, r.Height, 14, (float) (this.direction * 2), Alpha: 150, Scale: 1.3f); + if (sItem.type == 273 || sItem.type == 675) + { + if (Main.rand.Next(5) == 0) + Dust.NewDust(new Vector2((float) r.X, (float) r.Y), r.Width, r.Height, 14, (float) (this.direction * 2), Alpha: 150, Scale: 1.4f); + int index = Dust.NewDust(new Vector2((float) r.X, (float) r.Y), r.Width, r.Height, 27, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 1.2f); + Main.dust[index].noGravity = true; + Main.dust[index].velocity.X /= 2f; + Main.dust[index].velocity.Y /= 2f; + } + if (sItem.type == 723 && Main.rand.Next(2) == 0) + { + int index = Dust.NewDust(new Vector2((float) r.X, (float) r.Y), r.Width, r.Height, 64, Alpha: 150, Scale: 1.2f); + Main.dust[index].noGravity = true; + } + if (sItem.type == 65) + { + if (Main.rand.Next(5) == 0) + Dust.NewDust(new Vector2((float) r.X, (float) r.Y), r.Width, r.Height, 58, Alpha: 150, Scale: 1.2f); + if (Main.rand.Next(10) == 0) + Gore.NewGore(new Vector2((float) r.X, (float) r.Y), new Vector2(), Main.rand.Next(16, 18)); + } + if (sItem.type == 3065) + { + int index60 = Dust.NewDust(new Vector2((float) r.X, (float) r.Y), r.Width, r.Height, 58, Alpha: 150, Scale: 1.2f); + Main.dust[index60].velocity *= 0.5f; + if (Main.rand.Next(8) == 0) + { + int index61 = Gore.NewGore(new Vector2((float) r.Center.X, (float) r.Center.Y), new Vector2(), 16); + Main.gore[index61].velocity *= 0.5f; + Main.gore[index61].velocity += new Vector2((float) this.direction, 0.0f); } } - if (Type == 0) + if (sItem.type == 190) { - for (int index = 0; index < 54; ++index) + int index = Dust.NewDust(new Vector2((float) r.X, (float) r.Y), r.Width, r.Height, 40, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, Scale: 1.2f); + Main.dust[index].noGravity = true; + } + else if (sItem.type == 213) + { + int index = Dust.NewDust(new Vector2((float) r.X, (float) r.Y), r.Width, r.Height, 3, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, Scale: 1.2f); + Main.dust[index].noGravity = true; + } + if (sItem.type == 121) + { + for (int index62 = 0; index62 < 2; ++index62) { - if (this.inventory[index].stack > 0 && this.inventory[index].ammo == 931) + int index63 = Dust.NewDust(new Vector2((float) r.X, (float) r.Y), r.Width, r.Height, 6, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 2.5f); + Main.dust[index63].noGravity = true; + Main.dust[index63].velocity.X *= 2f; + Main.dust[index63].velocity.Y *= 2f; + } + } + if (sItem.type == 122 || sItem.type == 217) + { + int index = Dust.NewDust(new Vector2((float) r.X, (float) r.Y), r.Width, r.Height, 6, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 1.9f); + Main.dust[index].noGravity = true; + } + if (sItem.type == 155) + { + int index = Dust.NewDust(new Vector2((float) r.X, (float) r.Y), r.Width, r.Height, 172, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 0.9f); + Main.dust[index].noGravity = true; + Main.dust[index].velocity *= 0.1f; + } + if (sItem.type == 676 && Main.rand.Next(3) == 0) + { + int index = Dust.NewDust(new Vector2((float) r.X, (float) r.Y), r.Width, r.Height, 67, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 90, Scale: 1.5f); + Main.dust[index].noGravity = true; + Main.dust[index].velocity *= 0.2f; + } + if (sItem.type == 3063) + { + int index = Dust.NewDust(r.TopLeft(), r.Width, r.Height, 66, Alpha: 150, newColor: Color.Transparent, Scale: 0.85f); + Main.dust[index].color = Main.hslToRgb(Main.rand.NextFloat(), 1f, 0.5f); + Main.dust[index].noGravity = true; + Main.dust[index].velocity /= 2f; + } + if (sItem.type == 3823) + { + Dust dust = Dust.NewDustDirect(r.TopLeft(), r.Width, r.Height, 6, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Color.Transparent, 0.7f); + dust.noGravity = true; + dust.velocity *= 2f; + dust.fadeIn = 0.9f; + } + if (sItem.type == 724 && Main.rand.Next(5) == 0) + { + int index = Dust.NewDust(new Vector2((float) r.X, (float) r.Y), r.Width, r.Height, 67, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 90, Scale: 1.5f); + Main.dust[index].noGravity = true; + Main.dust[index].velocity *= 0.2f; + } + if (sItem.type >= 795 && sItem.type <= 802 && Main.rand.Next(3) == 0) + { + int index = Dust.NewDust(new Vector2((float) r.X, (float) r.Y), r.Width, r.Height, 115, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 140, Scale: 1.5f); + Main.dust[index].noGravity = true; + Main.dust[index].velocity *= 0.25f; + } + if (sItem.type == 367 || sItem.type == 368 || sItem.type == 674) + { + if (Main.rand.Next(3) == 0) + { + int index = Dust.NewDust(new Vector2((float) r.X, (float) r.Y), r.Width, r.Height, 57, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 1.1f); + Main.dust[index].noGravity = true; + Main.dust[index].velocity.X /= 2f; + Main.dust[index].velocity.Y /= 2f; + Main.dust[index].velocity.X += (float) (this.direction * 2); + } + if (Main.rand.Next(4) == 0) + { + int index = Dust.NewDust(new Vector2((float) r.X, (float) r.Y), r.Width, r.Height, 43, Alpha: 254, Scale: 0.3f); + Main.dust[index].velocity *= 0.0f; + } + } + if (sItem.type >= 198 && sItem.type <= 203 || sItem.type >= 3764 && sItem.type <= 3769) + { + float R = 0.5f; + float G = 0.5f; + float B = 0.5f; + if (sItem.type == 198 || sItem.type == 3764) + { + R *= 0.1f; + G *= 0.5f; + B *= 1.2f; + } + else if (sItem.type == 199 || sItem.type == 3765) + { + R *= 1f; + G *= 0.2f; + B *= 0.1f; + } + else if (sItem.type == 200 || sItem.type == 3766) + { + R *= 0.1f; + G *= 1f; + B *= 0.2f; + } + else if (sItem.type == 201 || sItem.type == 3767) + { + R *= 0.8f; + G *= 0.1f; + B *= 1f; + } + else if (sItem.type == 202 || sItem.type == 3768) + { + R *= 0.8f; + G *= 0.9f; + B *= 1f; + } + else if (sItem.type == 203 || sItem.type == 3769) + { + R *= 0.9f; + G *= 0.9f; + B *= 0.1f; + } + Lighting.AddLight((int) (((double) this.itemLocation.X + 6.0 + (double) this.velocity.X) / 16.0), (int) (((double) this.itemLocation.Y - 14.0) / 16.0), R, G, B); + } + if (this.frostBurn && sItem.melee && !sItem.noMelee && !sItem.noUseGraphic && Main.rand.Next(2) == 0) + { + int index = Dust.NewDust(new Vector2((float) r.X, (float) r.Y), r.Width, r.Height, 135, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 2.5f); + Main.dust[index].noGravity = true; + Main.dust[index].velocity *= 0.7f; + Main.dust[index].velocity.Y -= 0.5f; + } + if (sItem.melee && !sItem.noMelee && !sItem.noUseGraphic && this.meleeEnchant > (byte) 0) + { + if (this.meleeEnchant == (byte) 1) + { + if (Main.rand.Next(3) == 0) { - Type = this.inventory[index].type; - break; + int index = Dust.NewDust(new Vector2((float) r.X, (float) r.Y), r.Width, r.Height, 171, Alpha: 100); + Main.dust[index].noGravity = true; + Main.dust[index].fadeIn = 1.5f; + Main.dust[index].velocity *= 0.25f; + } + } + else if (this.meleeEnchant == (byte) 2) + { + if (Main.rand.Next(2) == 0) + { + int index = Dust.NewDust(new Vector2((float) r.X, (float) r.Y), r.Width, r.Height, 75, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 2.5f); + Main.dust[index].noGravity = true; + Main.dust[index].velocity *= 0.7f; + Main.dust[index].velocity.Y -= 0.5f; + } + } + else if (this.meleeEnchant == (byte) 3) + { + if (Main.rand.Next(2) == 0) + { + int index = Dust.NewDust(new Vector2((float) r.X, (float) r.Y), r.Width, r.Height, 6, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 2.5f); + Main.dust[index].noGravity = true; + Main.dust[index].velocity *= 0.7f; + Main.dust[index].velocity.Y -= 0.5f; + } + } + else if (this.meleeEnchant == (byte) 4) + { + if (Main.rand.Next(2) == 0) + { + int index = Dust.NewDust(new Vector2((float) r.X, (float) r.Y), r.Width, r.Height, 57, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 1.1f); + Main.dust[index].noGravity = true; + Main.dust[index].velocity.X /= 2f; + Main.dust[index].velocity.Y /= 2f; + } + } + else if (this.meleeEnchant == (byte) 5) + { + if (Main.rand.Next(2) == 0) + { + int index = Dust.NewDust(new Vector2((float) r.X, (float) r.Y), r.Width, r.Height, 169, Alpha: 100); + Main.dust[index].velocity.X += (float) this.direction; + Main.dust[index].velocity.Y += 0.2f; + Main.dust[index].noGravity = true; + } + } + else if (this.meleeEnchant == (byte) 6) + { + if (Main.rand.Next(2) == 0) + { + int index = Dust.NewDust(new Vector2((float) r.X, (float) r.Y), r.Width, r.Height, 135, Alpha: 100); + Main.dust[index].velocity.X += (float) this.direction; + Main.dust[index].velocity.Y += 0.2f; + Main.dust[index].noGravity = true; + } + } + else if (this.meleeEnchant == (byte) 7) + { + if (Main.rand.Next(20) == 0) + { + int Type = Main.rand.Next(139, 143); + int index = Dust.NewDust(new Vector2((float) r.X, (float) r.Y), r.Width, r.Height, Type, this.velocity.X, this.velocity.Y, Scale: 1.2f); + Main.dust[index].velocity.X *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); + Main.dust[index].velocity.Y *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); + Main.dust[index].velocity.X += (float) Main.rand.Next(-50, 51) * 0.05f; + Main.dust[index].velocity.Y += (float) Main.rand.Next(-50, 51) * 0.05f; + Main.dust[index].scale *= (float) (1.0 + (double) Main.rand.Next(-30, 31) * 0.00999999977648258); + } + if (Main.rand.Next(40) == 0) + { + int Type = Main.rand.Next(276, 283); + int index = Gore.NewGore(new Vector2((float) r.X, (float) r.Y), this.velocity, Type); + Main.gore[index].velocity.X *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); + Main.gore[index].velocity.Y *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); + Main.gore[index].scale *= (float) (1.0 + (double) Main.rand.Next(-20, 21) * 0.00999999977648258); + Main.gore[index].velocity.X += (float) Main.rand.Next(-50, 51) * 0.05f; + Main.gore[index].velocity.Y += (float) Main.rand.Next(-50, 51) * 0.05f; + } + } + else if (this.meleeEnchant == (byte) 8 && Main.rand.Next(4) == 0) + { + int index = Dust.NewDust(new Vector2((float) r.X, (float) r.Y), r.Width, r.Height, 46, Alpha: 100); + Main.dust[index].noGravity = true; + Main.dust[index].fadeIn = 1.5f; + Main.dust[index].velocity *= 0.25f; + } + } + if (this.magmaStone && sItem.melee && !sItem.noMelee && !sItem.noUseGraphic && Main.rand.Next(3) != 0) + { + int index = Dust.NewDust(new Vector2((float) r.X, (float) r.Y), r.Width, r.Height, 6, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 2.5f); + Main.dust[index].noGravity = true; + Main.dust[index].velocity.X *= 2f; + Main.dust[index].velocity.Y *= 2f; + } + if (Main.myPlayer == i && (sItem.type == 1991 || sItem.type == 3183)) + { + for (int i4 = 0; i4 < 200; ++i4) + { + if (Main.npc[i4].active && Main.npc[i4].catchItem > (short) 0) + { + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle((int) Main.npc[i4].position.X, (int) Main.npc[i4].position.Y, Main.npc[i4].width, Main.npc[i4].height); + if (r.Intersects(rectangle) && (sItem.type == 3183 || Main.npc[i4].noTileCollide || this.CanHit((Entity) Main.npc[i4]))) + NPC.CatchNPC(i4, i); } } } - if (Type == 931) - Type = (int) sbyte.MaxValue; - else if (Type == 1614) - Type = 187; - if (Type > 0) + if (Main.myPlayer == i && (sItem.damage > 0 || sItem.type == 3183)) { - int index = Dust.NewDust(new Vector2(x, y + this.gfxOffY), 6, 6, Type, Alpha: 100, Scale: 1.6f); - Main.dust[index].noGravity = true; - Main.dust[index].velocity.Y -= 4f * this.gravDir; - } - } - else if (sItem.type == 968) - { - this.itemLocation.X = this.position.X + (float) this.width * 0.5f + (float) (8 * this.direction); - if (this.whoAmI == Main.myPlayer) - { - int index1 = (int) ((double) this.itemLocation.X + (double) heldItemFrame.Width * 0.800000011920929 * (double) this.direction) / 16; - int index2 = (int) ((double) this.itemLocation.Y + (double) mountOffset + (double) (heldItemFrame.Height / 2)) / 16; - if (Main.tile[index1, index2] == null) - Main.tile[index1, index2] = new Tile(); - if (Main.tile[index1, index2].active() && Main.tile[index1, index2].type == (ushort) 215 && Main.tile[index1, index2].frameY < (short) 54) - { - ++this.miscTimer; - if (Main.rand.Next(5) == 0) - ++this.miscTimer; - if (this.miscTimer > 900) + int num179 = sItem.damage; + if (sItem.melee) + num179 = (int) ((double) sItem.damage * (double) this.meleeDamage); + if (sItem.ranged) + num179 = (int) ((double) sItem.damage * (double) this.rangedDamage); + if (sItem.magic) + num179 = (int) ((double) sItem.damage * (double) this.magicDamage); + if (sItem.summon) + num179 = (int) ((double) sItem.damage * (double) this.minionDamage); + if (sItem.thrown) + num179 = (int) ((double) sItem.damage * (double) this.thrownDamage); + float knockBack = sItem.knockBack; + float num180 = 1f; + if (this.kbGlove) + ++num180; + if (this.kbBuff) + num180 += 0.5f; + float num181 = knockBack * num180; + if (this.inventory[this.selectedItem].type == 3106) + num181 += num181 * (1f - this.stealth); + List ushortList = (List) null; + if (sItem.type == 213) + ushortList = new List((IEnumerable) new ushort[17] { - this.miscTimer = 0; - sItem.SetDefaults(969); - if (this.selectedItem == 58) - Main.mouseItem.SetDefaults(969); - for (int index3 = 0; index3 < 58; ++index3) + (ushort) 3, + (ushort) 24, + (ushort) 52, + (ushort) 61, + (ushort) 62, + (ushort) 71, + (ushort) 73, + (ushort) 74, + (ushort) 82, + (ushort) 83, + (ushort) 84, + (ushort) 110, + (ushort) 113, + (ushort) 115, + (ushort) 184, + (ushort) 205, + (ushort) 201 + }); + int num182 = r.X / 16; + int num183 = (r.X + r.Width) / 16 + 1; + int num184 = r.Y / 16; + int num185 = (r.Y + r.Height) / 16 + 1; + for (int index64 = num182; index64 < num183; ++index64) + { + for (int index65 = num184; index65 < num185; ++index65) + { + if (Main.tile[index64, index65] != null && Main.tileCut[(int) Main.tile[index64, index65].type] && (ushortList == null || !ushortList.Contains(Main.tile[index64, index65].type)) && WorldGen.CanCutTile(index64, index65, TileCuttingContext.AttackMelee)) { - if (this.inventory[index3].type == sItem.type && index3 != this.selectedItem && this.inventory[index3].stack < this.inventory[index3].maxStack) + if (sItem.type == 1786) { - SoundEngine.PlaySound(7); - ++this.inventory[index3].stack; - sItem.SetDefaults(); - if (this.selectedItem == 58) - Main.mouseItem.SetDefaults(); + int type = (int) Main.tile[index64, index65].type; + WorldGen.KillTile(index64, index65); + if (!Main.tile[index64, index65].active()) + { + int Stack = 0; + if (type == 3 || type == 24 || type == 61 || type == 110 || type == 201) + Stack = Main.rand.Next(1, 3); + if (type == 73 || type == 74 || type == 113) + Stack = Main.rand.Next(2, 5); + if (Stack > 0) + { + int number = Item.NewItem(index64 * 16, index65 * 16, 16, 16, 1727, Stack); + if (Main.netMode == 1) + NetMessage.SendData(21, number: number, number2: 1f); + } + } + if (Main.netMode == 1) + NetMessage.SendData(17, number2: ((float) index64), number3: ((float) index65)); + } + else + { + WorldGen.KillTile(index64, index65); + if (Main.netMode == 1) + NetMessage.SendData(17, number2: ((float) index64), number3: ((float) index65)); } } } } + if (sItem.type != 3183) + { + for (int index66 = 0; index66 < 200; ++index66) + { + if (Main.npc[index66].active && Main.npc[index66].immune[i] == 0 && this.attackCD == 0) + { + if (!Main.npc[index66].dontTakeDamage) + { + if (!Main.npc[index66].friendly || Main.npc[index66].type == 22 && this.killGuide || Main.npc[index66].type == 54 && this.killClothier) + { + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle((int) Main.npc[index66].position.X, (int) Main.npc[index66].position.Y, Main.npc[index66].width, Main.npc[index66].height); + if (r.Intersects(rectangle) && (Main.npc[index66].noTileCollide || this.CanHit((Entity) Main.npc[index66]))) + { + bool crit = false; + if (sItem.melee && Main.rand.Next(1, 101) <= this.meleeCrit) + crit = true; + if (sItem.ranged && Main.rand.Next(1, 101) <= this.rangedCrit) + crit = true; + if (sItem.magic && Main.rand.Next(1, 101) <= this.magicCrit) + crit = true; + if (sItem.thrown && Main.rand.Next(1, 101) <= this.thrownCrit) + crit = true; + int banner = Item.NPCtoBanner(Main.npc[index66].BannerID()); + if (banner > 0 && this.NPCBannerBuff[banner]) + num179 = !Main.expertMode ? (int) ((double) num179 * (double) ItemID.Sets.BannerStrength[Item.BannerToItem(banner)].NormalDamageDealt) : (int) ((double) num179 * (double) ItemID.Sets.BannerStrength[Item.BannerToItem(banner)].ExpertDamageDealt); + if (this.parryDamageBuff && sItem.melee) + { + num179 *= 5; + this.parryDamageBuff = false; + this.ClearBuff(198); + } + int num186 = Main.DamageVar((float) num179); + this.StatusNPC(sItem.type, index66); + this.OnHit(Main.npc[index66].Center.X, Main.npc[index66].Center.Y, (Entity) Main.npc[index66]); + if (this.armorPenetration > 0) + num186 += Main.npc[index66].checkArmorPenetration(this.armorPenetration); + int num187 = (int) Main.npc[index66].StrikeNPC(num186, num181, this.direction, crit); + if (this.inventory[this.selectedItem].type == 3211) + { + Vector2 vector2_40 = new Vector2((float) (this.direction * 100 + Main.rand.Next(-25, 26)), (float) Main.rand.Next(-75, 76)); + vector2_40.Normalize(); + vector2_40 *= (float) Main.rand.Next(30, 41) * 0.1f; + Vector2 vector2_41 = new Vector2((float) (r.X + Main.rand.Next(r.Width)), (float) (r.Y + Main.rand.Next(r.Height))); + vector2_41 = (vector2_41 + Main.npc[index66].Center * 2f) / 3f; + Projectile.NewProjectile(vector2_41.X, vector2_41.Y, vector2_40.X, vector2_40.Y, 524, (int) ((double) num179 * 0.7), num181 * 0.7f, this.whoAmI); + } + bool flag21 = !Main.npc[index66].immortal; + if (this.beetleOffense & flag21) + { + this.beetleCounter += (float) num187; + this.beetleCountdown = 0; + } + if (sItem.type == 1826 && ((double) Main.npc[index66].value > 0.0 || Main.npc[index66].damage > 0 && !Main.npc[index66].friendly)) + this.pumpkinSword(index66, (int) ((double) num179 * 1.5), num181); + if (this.meleeEnchant == (byte) 7) + Projectile.NewProjectile(Main.npc[index66].Center.X, Main.npc[index66].Center.Y, Main.npc[index66].velocity.X, Main.npc[index66].velocity.Y, 289, 0, 0.0f, this.whoAmI); + if (this.inventory[this.selectedItem].type == 3106) + { + this.stealth = 1f; + if (Main.netMode == 1) + NetMessage.SendData(84, number: this.whoAmI); + } + if (sItem.type == 1123 & flag21) + { + int num188 = Main.rand.Next(1, 4); + if (this.strongBees && Main.rand.Next(3) == 0) + ++num188; + for (int index67 = 0; index67 < num188; ++index67) + { + float num189 = (float) (this.direction * 2) + (float) Main.rand.Next(-35, 36) * 0.02f; + float num190 = (float) Main.rand.Next(-35, 36) * 0.02f; + float SpeedX = num189 * 0.2f; + float SpeedY = num190 * 0.2f; + Projectile.NewProjectile((float) (r.X + r.Width / 2), (float) (r.Y + r.Height / 2), SpeedX, SpeedY, this.beeType(), this.beeDamage(num186 / 3), this.beeKB(0.0f), i); + } + } + if ((double) Main.npc[index66].value > 0.0 && this.coins && Main.rand.Next(5) == 0) + { + int Type = 71; + if (Main.rand.Next(10) == 0) + Type = 72; + if (Main.rand.Next(100) == 0) + Type = 73; + int number = Item.NewItem((int) Main.npc[index66].position.X, (int) Main.npc[index66].position.Y, Main.npc[index66].width, Main.npc[index66].height, Type); + Main.item[number].stack = Main.rand.Next(1, 11); + Main.item[number].velocity.Y = (float) Main.rand.Next(-20, 1) * 0.2f; + Main.item[number].velocity.X = (float) Main.rand.Next(10, 31) * 0.2f * (float) this.direction; + if (Main.netMode == 1) + NetMessage.SendData(21, number: number); + } + int num191 = Item.NPCtoBanner(Main.npc[index66].BannerID()); + if (num191 >= 0) + this.lastCreatureHit = num191; + if (Main.netMode != 0) + { + if (crit) + NetMessage.SendData(28, number: index66, number2: ((float) num186), number3: num181, number4: ((float) this.direction), number5: 1); + else + NetMessage.SendData(28, number: index66, number2: ((float) num186), number3: num181, number4: ((float) this.direction)); + } + if (this.accDreamCatcher) + this.addDPS(num186); + Main.npc[index66].immune[i] = this.itemAnimation; + this.attackCD = (int) ((double) this.itemAnimationMax * 0.33); + } + } + } + else if (Main.npc[index66].type == 63 || Main.npc[index66].type == 64 || Main.npc[index66].type == 103 || Main.npc[index66].type == 242) + { + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle((int) Main.npc[index66].position.X, (int) Main.npc[index66].position.Y, Main.npc[index66].width, Main.npc[index66].height); + if (r.Intersects(rectangle) && (Main.npc[index66].noTileCollide || this.CanHit((Entity) Main.npc[index66]))) + { + this.Hurt(PlayerDeathReason.LegacyDefault(), (int) ((double) Main.npc[index66].damage * 1.3), -this.direction); + Main.npc[index66].immune[i] = this.itemAnimation; + this.attackCD = (int) ((double) this.itemAnimationMax * 0.33); + } + } + } + } + if (this.hostile) + { + for (int index68 = 0; index68 < (int) byte.MaxValue; ++index68) + { + if ((index68 == i || !Main.player[index68].active || !Main.player[index68].hostile || Main.player[index68].immune ? 0 : (!Main.player[index68].dead ? 1 : 0)) != 0 && (Main.player[i].team == 0 || Main.player[i].team != Main.player[index68].team)) + { + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle((int) Main.player[index68].position.X, (int) Main.player[index68].position.Y, Main.player[index68].width, Main.player[index68].height); + if (r.Intersects(rectangle) && this.CanHit((Entity) Main.player[index68])) + { + bool flag22 = false; + if (Main.rand.Next(1, 101) <= 10) + flag22 = true; + int num192 = Main.DamageVar((float) num179); + this.StatusPvP(sItem.type, index68); + this.OnHit(Main.player[index68].Center.X, Main.player[index68].Center.Y, (Entity) Main.player[index68]); + PlayerDeathReason playerDeathReason = PlayerDeathReason.ByPlayer(this.whoAmI); + int num193 = (int) Main.player[index68].Hurt(playerDeathReason, num192, this.direction, true, Crit: flag22); + if (this.inventory[this.selectedItem].type == 3211) + { + Vector2 vector2_42 = new Vector2((float) (this.direction * 100 + Main.rand.Next(-25, 26)), (float) Main.rand.Next(-75, 76)); + vector2_42.Normalize(); + vector2_42 *= (float) Main.rand.Next(30, 41) * 0.1f; + Vector2 vector2_43 = new Vector2((float) (r.X + Main.rand.Next(r.Width)), (float) (r.Y + Main.rand.Next(r.Height))); + vector2_43 = (vector2_43 + Main.player[index68].Center * 2f) / 3f; + Projectile.NewProjectile(vector2_43.X, vector2_43.Y, vector2_42.X, vector2_42.Y, 524, (int) ((double) num179 * 0.7), num181 * 0.7f, this.whoAmI); + } + if (this.beetleOffense) + { + this.beetleCounter += (float) num193; + this.beetleCountdown = 0; + } + if (this.meleeEnchant == (byte) 7) + Projectile.NewProjectile(Main.player[index68].Center.X, Main.player[index68].Center.Y, Main.player[index68].velocity.X, Main.player[index68].velocity.Y, 289, 0, 0.0f, this.whoAmI); + if (sItem.type == 1123) + { + int num194 = Main.rand.Next(1, 4); + if (this.strongBees && Main.rand.Next(3) == 0) + ++num194; + for (int index69 = 0; index69 < num194; ++index69) + { + float num195 = (float) (this.direction * 2) + (float) Main.rand.Next(-35, 36) * 0.02f; + float num196 = (float) Main.rand.Next(-35, 36) * 0.02f; + float SpeedX = num195 * 0.2f; + float SpeedY = num196 * 0.2f; + Projectile.NewProjectile((float) (r.X + r.Width / 2), (float) (r.Y + r.Height / 2), SpeedX, SpeedY, this.beeType(), this.beeDamage(num192 / 3), this.beeKB(0.0f), i); + } + } + if (this.inventory[this.selectedItem].type == 3106) + { + this.stealth = 1f; + if (Main.netMode == 1) + NetMessage.SendData(84, number: this.whoAmI); + } + if (sItem.type == 1826 && (double) Main.npc[index68].value > 0.0) + this.pumpkinSword(index68, (int) ((double) num179 * 1.5), num181); + if (Main.netMode != 0) + NetMessage.SendPlayerHurt(index68, playerDeathReason, num192, this.direction, flag22, true, -1); + this.attackCD = (int) ((double) this.itemAnimationMax * 0.33); + } + } + } + } + if (sItem.type == 787 && (this.itemAnimation == (int) ((double) this.itemAnimationMax * 0.1) || this.itemAnimation == (int) ((double) this.itemAnimationMax * 0.3) || this.itemAnimation == (int) ((double) this.itemAnimationMax * 0.5) || this.itemAnimation == (int) ((double) this.itemAnimationMax * 0.7) || this.itemAnimation == (int) ((double) this.itemAnimationMax * 0.9))) + { + float num197 = 0.0f; + float num198 = 0.0f; + float num199 = 0.0f; + float num200 = 0.0f; + if (this.itemAnimation == (int) ((double) this.itemAnimationMax * 0.9)) + num197 = -7f; + if (this.itemAnimation == (int) ((double) this.itemAnimationMax * 0.7)) + { + num197 = -6f; + num198 = 2f; + } + if (this.itemAnimation == (int) ((double) this.itemAnimationMax * 0.5)) + { + num197 = -4f; + num198 = 4f; + } + if (this.itemAnimation == (int) ((double) this.itemAnimationMax * 0.3)) + { + num197 = -2f; + num198 = 6f; + } + if (this.itemAnimation == (int) ((double) this.itemAnimationMax * 0.1)) + num198 = 7f; + if (this.itemAnimation == (int) ((double) this.itemAnimationMax * 0.7)) + num200 = 26f; + if (this.itemAnimation == (int) ((double) this.itemAnimationMax * 0.3)) + { + num200 -= 4f; + num199 -= 20f; + } + if (this.itemAnimation == (int) ((double) this.itemAnimationMax * 0.1)) + num199 += 6f; + if (this.direction == -1) + { + if (this.itemAnimation == (int) ((double) this.itemAnimationMax * 0.9)) + num200 -= 8f; + if (this.itemAnimation == (int) ((double) this.itemAnimationMax * 0.7)) + num200 -= 6f; + } + float num201 = num197 * 1.5f; + float num202 = num198 * 1.5f; + float num203 = num200 * (float) this.direction; + float num204 = num199 * this.gravDir; + Projectile.NewProjectile((float) (r.X + r.Width / 2) + num203, (float) (r.Y + r.Height / 2) + num204, (float) this.direction * num202, num201 * this.gravDir, 131, num179 / 2, 0.0f, i); + } + } + } + } + } + if (this.itemTime == 0 && this.itemAnimation > 0) + { + if (sItem.hairDye >= (short) 0) + { + this.itemTime = sItem.useTime; + if (this.whoAmI == Main.myPlayer) + { + this.hairDye = (byte) sItem.hairDye; + NetMessage.SendData(4, number: this.whoAmI); + } + } + if (sItem.healLife > 0) + { + this.statLife += sItem.healLife; + this.itemTime = sItem.useTime; + if (Main.myPlayer == this.whoAmI) + this.HealEffect(sItem.healLife); + } + if (sItem.healMana > 0) + { + this.statMana += sItem.healMana; + this.itemTime = sItem.useTime; + if (Main.myPlayer == this.whoAmI) + { + this.AddBuff(94, Player.manaSickTime); + this.ManaEffect(sItem.healMana); + } + } + if (sItem.buffType > 0) + { + if (this.whoAmI == Main.myPlayer && sItem.buffType != 90 && sItem.buffType != 27) + this.AddBuff(sItem.buffType, sItem.buffTime); + this.itemTime = sItem.useTime; + } + if (sItem.type == 678) + { + this.itemTime = sItem.useTime; + if (this.whoAmI == Main.myPlayer) + { + this.AddBuff(20, 216000); + this.AddBuff(22, 216000); + this.AddBuff(23, 216000); + this.AddBuff(24, 216000); + this.AddBuff(30, 216000); + this.AddBuff(31, 216000); + this.AddBuff(32, 216000); + this.AddBuff(33, 216000); + this.AddBuff(35, 216000); + this.AddBuff(36, 216000); + this.AddBuff(68, 216000); + } + } + } + if (this.whoAmI == Main.myPlayer) + { + if (this.itemTime == 0 && this.itemAnimation > 0 && sItem.type == 361 && Main.CanStartInvasion(ignoreDelay: true)) + { + this.itemTime = sItem.useTime; + Main.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); + if (Main.netMode != 1) + { + if (Main.invasionType == 0) + { + Main.invasionDelay = 0; + Main.StartInvasion(); + } + } + else + NetMessage.SendData(61, number: this.whoAmI, number2: -1f); + } + if (this.itemTime == 0 && this.itemAnimation > 0 && sItem.type == 602 && Main.CanStartInvasion(2, true)) + { + this.itemTime = sItem.useTime; + Main.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); + if (Main.netMode != 1) + { + if (Main.invasionType == 0) + { + Main.invasionDelay = 0; + Main.StartInvasion(2); + } + } + else + NetMessage.SendData(61, number: this.whoAmI, number2: -2f); + } + if (this.itemTime == 0 && this.itemAnimation > 0 && sItem.type == 1315 && Main.CanStartInvasion(3, true)) + { + this.itemTime = sItem.useTime; + Main.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); + if (Main.netMode != 1) + { + if (Main.invasionType == 0) + { + Main.invasionDelay = 0; + Main.StartInvasion(3); + } + } + else + NetMessage.SendData(61, number: this.whoAmI, number2: -3f); + } + if (this.itemTime == 0 && this.itemAnimation > 0 && sItem.type == 1844 && !Main.dayTime && !Main.pumpkinMoon && !Main.snowMoon && !DD2Event.Ongoing) + { + this.itemTime = sItem.useTime; + Main.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); + if (Main.netMode != 1) + { + Main.NewText(Lang.misc[31].Value, (byte) 50, B: (byte) 130); + Main.startPumpkinMoon(); + } + else + NetMessage.SendData(61, number: this.whoAmI, number2: -4f); + } + if (this.itemTime == 0 && this.itemAnimation > 0 && sItem.type == 2767 && Main.dayTime && !Main.eclipse) + { + Main.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); + this.itemTime = sItem.useTime; + if (Main.netMode == 0) + { + Main.eclipse = true; + Main.NewText(Lang.misc[20].Value, (byte) 50, B: (byte) 130); + } + else + NetMessage.SendData(61, number: this.whoAmI, number2: -6f); + } + if (this.itemTime == 0 && this.itemAnimation > 0 && sItem.type == 3601 && NPC.downedGolemBoss && Main.hardMode && !NPC.AnyDanger() && !NPC.AnyoneNearCultists()) + { + Main.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); + this.itemTime = sItem.useTime; + if (Main.netMode == 0) + WorldGen.StartImpendingDoom(); + else + NetMessage.SendData(61, number: this.whoAmI, number2: -8f); + } + if (this.itemTime == 0 && this.itemAnimation > 0 && sItem.type == 1958 && !Main.dayTime && !Main.pumpkinMoon && !Main.snowMoon && !DD2Event.Ongoing) + { + this.itemTime = sItem.useTime; + Main.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); + if (Main.netMode != 1) + { + Main.NewText(Lang.misc[34].Value, (byte) 50, B: (byte) 130); + Main.startSnowMoon(); + } + else + NetMessage.SendData(61, number: this.whoAmI, number2: -5f); + } + if (this.itemTime == 0 && this.itemAnimation > 0 && sItem.makeNPC > (short) 0 && this.controlUseItem && (double) this.position.X / 16.0 - (double) Player.tileRangeX - (double) sItem.tileBoost <= (double) Player.tileTargetX && ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX + (double) sItem.tileBoost - 1.0 >= (double) Player.tileTargetX && (double) this.position.Y / 16.0 - (double) Player.tileRangeY - (double) sItem.tileBoost <= (double) Player.tileTargetY && ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY + (double) sItem.tileBoost - 2.0 >= (double) Player.tileTargetY) + { + int x = Main.mouseX + (int) Main.screenPosition.X; + int y = Main.mouseY + (int) Main.screenPosition.Y; + this.itemTime = sItem.useTime; + if (!WorldGen.SolidTile(x / 16, y / 16)) + NPC.ReleaseNPC(x, y, (int) sItem.makeNPC, sItem.placeStyle, this.whoAmI); + } + if (this.itemTime == 0 && this.itemAnimation > 0 && (sItem.type == 43 || sItem.type == 70 || sItem.type == 544 || sItem.type == 556 || sItem.type == 557 || sItem.type == 560 || sItem.type == 1133 || sItem.type == 1331) && this.SummonItemCheck()) + { + if (sItem.type == 560) + { + this.itemTime = sItem.useTime; + Main.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); + if (Main.netMode != 1) + NPC.SpawnOnPlayer(i, 50); else - this.miscTimer = 0; + NetMessage.SendData(61, number: this.whoAmI, number2: 50f); } - } - else if (sItem.type == 856) - this.itemLocation.X = this.position.X + (float) this.width * 0.5f + (float) (4 * this.direction); - else if (sItem.fishingPole > 0) - { - this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 + (double) heldItemFrame.Width * 0.180000007152557 * (double) this.direction); - } - else - { - this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 + ((double) heldItemFrame.Width * 0.5 + 2.0) * (double) this.direction); - if (sItem.type == 282 || sItem.type == 286 || sItem.type == 3112 || sItem.type == 4776) + else if (sItem.type == 43) { - this.itemLocation.X -= (float) (this.direction * 2); - this.itemLocation.Y += 4f; + if (!Main.dayTime) + { + this.itemTime = sItem.useTime; + Main.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); + if (Main.netMode != 1) + NPC.SpawnOnPlayer(i, 4); + else + NetMessage.SendData(61, number: this.whoAmI, number2: 4f); + } } - else if (sItem.type == 3002) + else if (sItem.type == 70) { - this.itemLocation.X -= (float) (4 * this.direction); - this.itemLocation.Y += 2f; + if (this.ZoneCorrupt) + { + this.itemTime = sItem.useTime; + Main.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); + if (Main.netMode != 1) + NPC.SpawnOnPlayer(i, 13); + else + NetMessage.SendData(61, number: this.whoAmI, number2: 13f); + } } - } - this.itemLocation.Y = this.position.Y + 24f + mountOffset; - if (sItem.type == 856) - this.itemLocation.Y = this.position.Y + 34f + mountOffset; - if (sItem.type == 930) - this.itemLocation.Y = this.position.Y + 9f + mountOffset; - if (sItem.fishingPole > 0) - this.itemLocation.Y += 4f; - else if (sItem.type == 3476) - { - this.itemLocation.X = this.Center.X + (float) (14 * this.direction); - this.itemLocation.Y = this.MountedCenter.Y; - } - else if (sItem.type == 3779) - { - this.itemLocation.X = this.Center.X + (float) (6 * this.direction); - this.itemLocation.Y = this.MountedCenter.Y + 6f; - } - else if (sItem.type == 4952) - { - this.itemLocation.X = this.Center.X + (float) (2 * this.direction); - this.itemLocation.Y = this.MountedCenter.Y + 26f; - } - else if (sItem.type == 353) - { - this.itemLocation.X = this.Center.X + (float) (6 * this.direction); - this.itemLocation.Y = this.MountedCenter.Y + 11f; - } - else if (ItemID.Sets.IsFood[sItem.type]) - { - this.itemLocation.X = this.Center.X + (float) (4 * this.direction); - this.itemLocation.Y = this.MountedCenter.Y + (float) (heldItemFrame.Height / 2); - } - else if (sItem.type == 4049 && Main.rand.Next(4) == 0) - { - Dust dust = Dust.NewDustPerfect(this.Center + new Vector2((float) (this.direction * 23), this.gravDir * 6f), 31, new Vector2?(Vector2.Zero), (int) sbyte.MaxValue, Scale: 0.7f); - dust.noGravity = true; - dust.velocity = Main.rand.NextVector2Circular(1f, 1f) + new Vector2(0.0f, -1f); - } - this.itemRotation = 0.0f; - if ((double) this.gravDir != -1.0) - return; - this.itemRotation = -this.itemRotation; - this.itemLocation.Y = (float) ((double) this.position.Y + (double) this.height + ((double) this.position.Y - (double) this.itemLocation.Y)) + mountOffset; - if (sItem.type != 930) - return; - this.itemLocation.Y -= 24f; - } - else if (sItem.holdStyle == 2 && !this.pulley) - { - if (sItem.type == 946 || sItem.type == 4707) - { - this.itemRotation = 0.0f; - this.itemLocation.X = this.position.X + (float) this.width * 0.5f - (float) (16 * this.direction); - this.itemLocation.Y = this.position.Y + 22f + mountOffset; - this.fallStart = (int) ((double) this.position.Y / 16.0); - if ((double) this.gravDir == -1.0) + else if (sItem.type == 544) { - this.itemRotation = -this.itemRotation; - this.itemLocation.Y = (float) ((double) this.position.Y + (double) this.height + ((double) this.position.Y - (double) this.itemLocation.Y)); - if ((double) this.velocity.Y >= -2.0 || this.controlDown) - return; - this.velocity.Y = -2f; + if (!Main.dayTime) + { + this.itemTime = sItem.useTime; + Main.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); + if (Main.netMode != 1) + { + NPC.SpawnOnPlayer(i, 125); + NPC.SpawnOnPlayer(i, 126); + } + else + { + NetMessage.SendData(61, number: this.whoAmI, number2: 125f); + NetMessage.SendData(61, number: this.whoAmI, number2: 126f); + } + } } - else + else if (sItem.type == 556) { - if ((double) this.velocity.Y <= 2.0 || this.controlDown) - return; - this.velocity.Y = 2f; + if (!Main.dayTime) + { + this.itemTime = sItem.useTime; + Main.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); + if (Main.netMode != 1) + NPC.SpawnOnPlayer(i, 134); + else + NetMessage.SendData(61, number: this.whoAmI, number2: 134f); + } } - } - else - { - this.itemLocation.X = this.position.X + (float) this.width * 0.5f + (float) (6 * this.direction); - this.itemLocation.Y = this.position.Y + 16f + mountOffset; - this.itemRotation = 0.79f * (float) -this.direction; - if ((double) this.gravDir != -1.0) - return; - this.itemRotation = -this.itemRotation; - this.itemLocation.Y = (float) ((double) this.position.Y + (double) this.height + ((double) this.position.Y - (double) this.itemLocation.Y)); - } - } - else if (sItem.holdStyle == 3 && !this.pulley) - { - if (Main.dedServ) - return; - this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 - (double) heldItemFrame.Width * 0.5) - (float) (this.direction * 2); - this.itemLocation.Y = this.MountedCenter.Y - (float) heldItemFrame.Height * 0.5f; - this.itemRotation = 0.0f; - } - else if (sItem.holdStyle == 4) - { - if (Main.dedServ) - return; - this.itemRotation = new Vector2((float) (10 * this.direction), 10f).ToRotation() + 0.7853982f; - if (this.direction == -1) - this.itemRotation += 1.570796f; - Player.CompositeArmStretchAmount stretch1 = Player.CompositeArmStretchAmount.Full; - Player.CompositeArmStretchAmount stretch2 = Player.CompositeArmStretchAmount.ThreeQuarters; - float num3 = -0.3141593f; - if (this.direction == -1) - num3 *= -1f; - float num4 = (float) ((double) this.itemRotation - 0.785398185253143 + 3.14159274101257); - if (this.direction == 1) - num4 += 1.570796f; - float rotation1 = num4 + num3; - float rotation2 = num4 - num3; - Vector2 vector2 = (num4 + 1.570796f).ToRotationVector2() * 2f; - this.itemLocation = this.MountedCenter.Floor() + vector2; - this.SetCompositeArmFront(true, stretch1, rotation1); - this.SetCompositeArmBack(true, stretch2, rotation2); - this.FlipItemLocationAndRotationForGravity(); - } - else if (sItem.holdStyle == 5 && !this.pulley) - { - if (Main.dedServ) - return; - this.itemRotation = 0.0f; - this.itemLocation.X = this.Center.X - (float) (8 * this.direction); - this.itemLocation.Y = this.position.Y + 40f + mountOffset; - this.itemLocation += Main.OffsetsPlayerHeadgear[this.bodyFrame.Y / 56]; - this.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Quarter, -0.7853982f * (float) this.direction); - this.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, -0.3926991f * (float) this.direction); - this.FlipItemLocationAndRotationForGravity(); - } - else - { - if (sItem.holdStyle != 6 || this.pulley || Main.dedServ) - return; - this.itemRotation = 0.0f; - this.itemLocation.X = this.Center.X + (float) (8 * this.direction); - this.itemLocation.Y = (float) ((double) this.position.Y + 40.0 + (double) mountOffset - 2.0); - this.itemLocation += Main.OffsetsPlayerHeadgear[this.bodyFrame.Y / 56]; - this.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.ThreeQuarters, -1.884956f * (float) this.direction); - this.FlipItemLocationAndRotationForGravity(); - } - } - - private void ItemCheck_ApplyManaRegenDelay(Item sItem) - { - if (this.spaceGun && (sItem.type == (int) sbyte.MaxValue || sItem.type == 4347 || sItem.type == 4348)) - return; - this.manaRegenDelay = (int) this.maxRegenDelay; - } - - private Vector2 GetFrontHandPosition( - Player.CompositeArmStretchAmount stretch, - float rotation) - { - float num = rotation + 1.570796f; - Vector2 vector2 = new Vector2((float) Math.Cos((double) num), (float) Math.Sin((double) num)); - switch (stretch) - { - case Player.CompositeArmStretchAmount.Full: - vector2 *= 10f; - break; - case Player.CompositeArmStretchAmount.None: - vector2 *= 4f; - break; - case Player.CompositeArmStretchAmount.Quarter: - vector2 *= 6f; - break; - case Player.CompositeArmStretchAmount.ThreeQuarters: - vector2 *= 8f; - break; - } - return this.MountedCenter + (this.direction != -1 ? vector2 + new Vector2(-4f, -2f) + new Vector2(0.0f, 3f).RotatedBy((double) rotation + 1.57079637050629) : vector2 + new Vector2(4f, -2f) + new Vector2(0.0f, -3f).RotatedBy((double) rotation + 1.57079637050629)); - } - - private Vector2 GetBackHandPosition( - Player.CompositeArmStretchAmount stretch, - float rotation) - { - float num = rotation + 1.570796f; - Vector2 vector2 = new Vector2((float) Math.Cos((double) num), (float) Math.Sin((double) num)); - switch (stretch) - { - case Player.CompositeArmStretchAmount.Full: - vector2 *= new Vector2(10f, 12f); - break; - case Player.CompositeArmStretchAmount.None: - vector2 *= new Vector2(4f, 6f); - break; - case Player.CompositeArmStretchAmount.Quarter: - vector2 *= new Vector2(6f, 8f); - break; - case Player.CompositeArmStretchAmount.ThreeQuarters: - vector2 *= new Vector2(8f, 10f); - break; - } - return this.MountedCenter + (this.direction != -1 ? vector2 + new Vector2(6f, -2f) : vector2 + new Vector2(-6f, -2f)); - } - - public void ItemCheck_ApplyUseStyle(float mountOffset, Item sItem, Microsoft.Xna.Framework.Rectangle heldItemFrame) - { - if (Main.dedServ) - return; - if (sItem.useStyle == 1) - { - if (sItem.type > -1 && Item.claw[sItem.type]) - { - if ((double) this.itemAnimation < (double) this.itemAnimationMax * 0.333) + else if (sItem.type == 557) { - float num = 10f; - this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 + ((double) heldItemFrame.Width * 0.5 - (double) num) * (double) this.direction); - this.itemLocation.Y = this.position.Y + 26f + mountOffset; + if (!Main.dayTime) + { + this.itemTime = sItem.useTime; + Main.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); + if (Main.netMode != 1) + NPC.SpawnOnPlayer(i, (int) sbyte.MaxValue); + else + NetMessage.SendData(61, number: this.whoAmI, number2: ((float) sbyte.MaxValue)); + } } - else if ((double) this.itemAnimation < (double) this.itemAnimationMax * 0.666) + else if (sItem.type == 1133) { - float num = 8f; - this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 + ((double) heldItemFrame.Width * 0.5 - (double) num) * (double) this.direction); - this.itemLocation.Y = this.position.Y + 24f + mountOffset; + this.itemTime = sItem.useTime; + Main.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); + if (Main.netMode != 1) + NPC.SpawnOnPlayer(i, 222); + else + NetMessage.SendData(61, number: this.whoAmI, number2: 222f); } - else + else if (sItem.type == 1331 && this.ZoneCrimson) { - float num = 6f; - this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 - ((double) heldItemFrame.Width * 0.5 - (double) num) * (double) this.direction); - this.itemLocation.Y = this.position.Y + 20f + mountOffset; + this.itemTime = sItem.useTime; + Main.PlaySound(15, (int) this.position.X, (int) this.position.Y, 0); + if (Main.netMode != 1) + NPC.SpawnOnPlayer(i, 266); + else + NetMessage.SendData(61, number: this.whoAmI, number2: 266f); } - this.itemRotation = (float) (((double) this.itemAnimation / (double) this.itemAnimationMax - 0.5) * (double) -this.direction * 3.5 - (double) this.direction * 0.300000011920929); - } - else - { - if ((double) this.itemAnimation < (double) this.itemAnimationMax * 0.333) - { - float num = 10f; - if (heldItemFrame.Width > 32) - num = 14f; - if (heldItemFrame.Width >= 52) - num = 24f; - if (heldItemFrame.Width >= 64) - num = 28f; - if (heldItemFrame.Width >= 92) - num = 38f; - if (sItem.type == 2330 || sItem.type == 2320 || sItem.type == 2341) - num += 8f; - if (sItem.type == 671) - num += 12f; - this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 + ((double) heldItemFrame.Width * 0.5 - (double) num) * (double) this.direction); - this.itemLocation.Y = this.position.Y + 24f + mountOffset; - } - else if ((double) this.itemAnimation < (double) this.itemAnimationMax * 0.666) - { - float num1 = 10f; - if (heldItemFrame.Width > 32) - num1 = 18f; - if (heldItemFrame.Width >= 52) - num1 = 24f; - if (heldItemFrame.Width >= 64) - num1 = 28f; - if (heldItemFrame.Width >= 92) - num1 = 38f; - if (sItem.type == 2330 || sItem.type == 2320 || sItem.type == 2341) - num1 += 4f; - if (sItem.type == 671) - num1 += 6f; - this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 + ((double) heldItemFrame.Width * 0.5 - (double) num1) * (double) this.direction); - float num2 = 10f; - if (heldItemFrame.Height > 32) - num2 = 8f; - if (heldItemFrame.Height > 52) - num2 = 12f; - if (heldItemFrame.Height > 64) - num2 = 14f; - if (sItem.type == 2330 || sItem.type == 2320 || sItem.type == 2341) - num2 += 4f; - if (sItem.type == 671) - num2 += 10f; - this.itemLocation.Y = this.position.Y + num2 + mountOffset; - } - else - { - float num3 = 6f; - if (heldItemFrame.Width > 32) - num3 = 14f; - if (heldItemFrame.Width >= 48) - num3 = 18f; - if (heldItemFrame.Width >= 52) - num3 = 24f; - if (heldItemFrame.Width >= 64) - num3 = 28f; - if (heldItemFrame.Width >= 92) - num3 = 38f; - if (sItem.type == 2330 || sItem.type == 2320 || sItem.type == 2341) - num3 += 4f; - if (sItem.type == 671) - num3 += 8f; - this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 - ((double) heldItemFrame.Width * 0.5 - (double) num3) * (double) this.direction); - float num4 = 10f; - if (heldItemFrame.Height > 32) - num4 = 10f; - if (heldItemFrame.Height > 52) - num4 = 12f; - if (heldItemFrame.Height > 64) - num4 = 14f; - if (sItem.type == 2330 || sItem.type == 2320 || sItem.type == 2341) - num4 += 4f; - if (sItem.type == 671) - num4 += 8f; - this.itemLocation.Y = this.position.Y + num4 + mountOffset; - } - this.itemRotation = (float) (((double) this.itemAnimation / (double) this.itemAnimationMax - 0.5) * (double) -this.direction * 3.5 - (double) this.direction * 0.300000011920929); - } - if ((double) this.gravDir != -1.0) - return; - this.itemRotation = -this.itemRotation; - this.itemLocation.Y = (float) ((double) this.position.Y + (double) this.height + ((double) this.position.Y - (double) this.itemLocation.Y)); - } - else if (sItem.useStyle == 7) - { - this.itemRotation = (float) ((double) this.itemAnimation / (double) this.itemAnimationMax * (double) this.direction * 2.0 + -1.39999997615814 * (double) this.direction); - if ((double) this.itemAnimation < (double) this.itemAnimationMax * 0.5) - { - this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 + ((double) heldItemFrame.Width * 0.5 - 9.0 - (double) this.itemRotation * 12.0 * (double) this.direction) * (double) this.direction); - this.itemLocation.Y = (float) ((double) this.position.Y + 38.0 + (double) this.itemRotation * (double) this.direction * 4.0) + mountOffset; - } - else - { - this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 + ((double) heldItemFrame.Width * 0.5 - 9.0 - (double) this.itemRotation * 16.0 * (double) this.direction) * (double) this.direction); - this.itemLocation.Y = (float) ((double) this.position.Y + 38.0 + (double) this.itemRotation * (double) this.direction) + mountOffset; - } - if ((double) this.gravDir != -1.0) - return; - this.itemRotation = -this.itemRotation; - this.itemLocation.Y = (float) ((double) this.position.Y + (double) this.height + ((double) this.position.Y - (double) this.itemLocation.Y)); - } - else if (sItem.useStyle == 9) - { - float lerpValue = Utils.GetLerpValue(0.0f, 0.7f, 1f - (float) this.itemAnimation / (float) this.itemAnimationMax, true); - this.itemRotation = (float) ((double) lerpValue * (double) -this.direction * 2.0 + 0.699999988079071 * (double) this.direction); - this.itemLocation = this.MountedCenter + new Vector2((float) (this.direction * 10) * ((float) this.itemAnimation / (float) this.itemAnimationMax), 0.0f); - float num5 = 8f; - float num6 = 7f; - float num7 = 1.256637f; - float f = (float) (-(double) num7 * 0.5 + (1.0 - (double) lerpValue) * (double) num7) + 0.3141593f; - this.itemLocation = this.Center + new Vector2((float) this.direction * num5, 0.0f) + f.ToRotationVector2() * num6 * new Vector2((float) this.direction, 1f); - float rotation = f - 1.570796f; - if (this.direction == -1) - rotation = -rotation; - this.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, rotation); - this.itemLocation = this.GetFrontHandPosition(Player.CompositeArmStretchAmount.Full, rotation); - this.itemLocation -= this.MountedCenter; - this.itemLocation *= MathHelper.Lerp(1.5f, 1.2f, lerpValue); - this.itemLocation += this.MountedCenter; - this.itemLocation.X += (float) this.direction * MathHelper.Lerp(8f, 2f, lerpValue); - if ((double) this.gravDir != -1.0) - return; - this.itemRotation = -this.itemRotation; - this.itemLocation.Y = (float) ((double) this.position.Y + (double) this.height + ((double) this.position.Y - (double) this.itemLocation.Y)); - } - else if (sItem.useStyle == 6) - { - float num = (float) (1.0 - (double) this.itemAnimation / (double) this.itemAnimationMax) * 6f; - if ((double) num > 1.0) - num = 1f; - this.itemRotation = (float) ((1.0 - (double) num) * (double) this.direction * 2.0 - 1.39999997615814 * (double) this.direction); - if ((double) num >= 0.5) - { - this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 + ((double) heldItemFrame.Width * 0.5 - 9.0 - (double) this.itemRotation * 12.0 * (double) this.direction) * (double) this.direction); - this.itemLocation.Y = (float) ((double) this.position.Y + 38.0 + (double) this.itemRotation * (double) this.direction * 4.0) + mountOffset; - } - else - { - this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 + ((double) heldItemFrame.Width * 0.5 - 9.0 - (double) this.itemRotation * 16.0 * (double) this.direction) * (double) this.direction); - this.itemLocation.Y = (float) ((double) this.position.Y + 38.0 + (double) this.itemRotation * (double) this.direction) + mountOffset; - } - if ((double) this.gravDir != -1.0) - return; - this.itemRotation = -this.itemRotation; - this.itemLocation.Y = (float) ((double) this.position.Y + (double) this.height + ((double) this.position.Y - (double) this.itemLocation.Y)); - } - else if (sItem.useStyle == 2) - { - this.itemLocation = this.MountedCenter + new Vector2((float) (10 * this.direction), -10f).RotatedBy((double) this.itemRotation + 0.785398185253143 * (double) this.direction); - float num8 = (float) (1.0 - (double) this.itemAnimation / (double) this.itemAnimationMax); - Player.CompositeArmStretchAmount stretch = Player.CompositeArmStretchAmount.Full; - if ((double) num8 > 0.25 && (double) num8 <= 0.5) - stretch = Player.CompositeArmStretchAmount.ThreeQuarters; - if ((double) num8 > 0.5 && (double) num8 <= 0.75) - stretch = Player.CompositeArmStretchAmount.Quarter; - if ((double) num8 > 0.75 && (double) num8 <= 1.0) - stretch = Player.CompositeArmStretchAmount.None; - this.SetCompositeArmFront(true, stretch, -1.570796f * (float) this.direction); - this.SetCompositeArmBack(true, stretch, -1.570796f * (float) this.direction); - int num9 = 8; - switch (stretch) - { - case Player.CompositeArmStretchAmount.Full: - num9 = 8; - break; - case Player.CompositeArmStretchAmount.None: - num9 = 2; - break; - case Player.CompositeArmStretchAmount.Quarter: - num9 = 4; - break; - case Player.CompositeArmStretchAmount.ThreeQuarters: - num9 = 6; - break; - } - this.itemLocation = this.MountedCenter + new Vector2((float) ((num9 + 10 - heldItemFrame.Width / 2) * this.direction), (float) (heldItemFrame.Height / 2 - 4)); - if ((double) this.gravDir != -1.0) - return; - this.itemRotation = -this.itemRotation; - this.itemLocation.Y = (float) ((double) this.position.Y + (double) this.height + ((double) this.position.Y - (double) this.itemLocation.Y)); - } - else if (sItem.useStyle == 11) - { - float num10 = (float) (1.0 - (double) this.itemAnimation / (double) this.itemAnimationMax) * 2f; - Player.CompositeArmStretchAmount stretch = Player.CompositeArmStretchAmount.Full; - if ((double) num10 > 0.25 && (double) num10 <= 0.5) - stretch = Player.CompositeArmStretchAmount.ThreeQuarters; - if ((double) num10 > 0.5 && (double) num10 <= 0.75) - stretch = Player.CompositeArmStretchAmount.Quarter; - if ((double) num10 > 0.75 && (double) num10 <= 1.25) - stretch = Player.CompositeArmStretchAmount.None; - if ((double) num10 > 1.25 && (double) num10 <= 1.5) - stretch = Player.CompositeArmStretchAmount.Quarter; - if ((double) num10 > 1.5 && (double) num10 <= 1.75) - stretch = Player.CompositeArmStretchAmount.ThreeQuarters; - if ((double) num10 > 1.75 && (double) num10 <= 2.0) - stretch = Player.CompositeArmStretchAmount.Full; - this.SetCompositeArmFront(true, stretch, -0.7853982f * (float) this.direction); - this.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Full, -0.1963495f); - int num11 = 8; - switch (stretch) - { - case Player.CompositeArmStretchAmount.Full: - num11 = 8; - break; - case Player.CompositeArmStretchAmount.None: - num11 = 2; - break; - case Player.CompositeArmStretchAmount.Quarter: - num11 = 4; - break; - case Player.CompositeArmStretchAmount.ThreeQuarters: - num11 = 6; - break; - } - this.itemLocation = this.MountedCenter + new Vector2((float) ((num11 + 22 - heldItemFrame.Width / 2) * this.direction), (float) (heldItemFrame.Height / 2 - 8)); - if ((double) this.gravDir != -1.0) - return; - this.itemRotation = -this.itemRotation; - this.itemLocation.Y = (float) ((double) this.position.Y + (double) this.height + ((double) this.position.Y - (double) this.itemLocation.Y)); - } - else if (sItem.useStyle == 3) - { - if ((double) this.itemAnimation > (double) this.itemAnimationMax * 0.666) - { - this.itemLocation.X = -1000f; - this.itemLocation.Y = -1000f; - this.itemRotation = -1.3f * (float) this.direction; - } - else - { - this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 + ((double) heldItemFrame.Width * 0.5 - 4.0) * (double) this.direction); - this.itemLocation.Y = this.position.Y + 24f + mountOffset; - float num = (float) ((double) this.itemAnimation / (double) this.itemAnimationMax * (double) heldItemFrame.Width * (double) this.direction * (double) sItem.scale * 1.20000004768372) - (float) (10 * this.direction); - if ((double) num > -4.0 && this.direction == -1) - num = -8f; - if ((double) num < 4.0 && this.direction == 1) - num = 8f; - this.itemLocation.X -= num; - this.itemRotation = 0.8f * (float) this.direction; - if (sItem.type == 946 || sItem.type == 4707) - this.itemLocation.X -= (float) (6 * this.direction); - } - if ((double) this.gravDir != -1.0) - return; - this.itemRotation = -this.itemRotation; - this.itemLocation.Y = (float) ((double) this.position.Y + (double) this.height + ((double) this.position.Y - (double) this.itemLocation.Y)); - } - else if (sItem.useStyle == 4) - { - int num12 = 0; - int num13 = 0; - if (sItem.type == 3601) - num12 = 10; - this.itemRotation = 0.0f; - this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 + ((double) heldItemFrame.Width * 0.5 - 9.0 - (double) this.itemRotation * 14.0 * (double) this.direction - 4.0 - (double) num12) * (double) this.direction); - this.itemLocation.Y = (float) ((double) this.position.Y + (double) heldItemFrame.Height * 0.5 + 4.0) + mountOffset + (float) num13; - if ((double) this.gravDir != -1.0) - return; - this.itemRotation = -this.itemRotation; - this.itemLocation.Y = (float) ((double) this.position.Y + (double) this.height + ((double) this.position.Y - (double) this.itemLocation.Y)); - } - else if (sItem.useStyle == 5) - { - if (sItem.type == 3779) - { - this.itemRotation = 0.0f; - this.itemLocation.X = this.Center.X + (float) (6 * this.direction); - this.itemLocation.Y = this.MountedCenter.Y + 6f; - } - else if (sItem.type == 4262) - { - this.itemRotation = 0.0f; - this.itemLocation.X = this.Center.X + (float) -heldItemFrame.Width * 0.5f + (float) (this.direction * -6); - this.itemLocation.Y = this.MountedCenter.Y - 6f; - if (Main.rand.Next(20) != 0) - return; - int Type = Main.rand.Next(570, 573); - Vector2 Position = new Vector2((float) ((double) this.Center.X + (double) (this.direction * 30) - 6.0), this.itemLocation.Y - 30f); - Vector2 Velocity = new Vector2((float) ((double) Main.WindForVisuals * 2.0 + (double) this.direction * 0.300000011920929), -0.5f); - Velocity.X *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); - Velocity.Y *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); - if (Type == 572) - Position.X -= 8f; - if (Type == 571) - Position.X -= 4f; - Gore.NewGore(Position, Velocity, Type, 0.8f); - } - else if (Item.staff[sItem.type]) - { - float num = 6f; - if (sItem.type == 3476) - num = 14f; - this.itemLocation = this.MountedCenter; - this.itemLocation += (this.itemRotation.ToRotationVector2() * num * (float) this.direction).Floor(); - } - else - { - this.itemLocation.X = (float) ((double) this.position.X + (double) this.width * 0.5 - (double) heldItemFrame.Width * 0.5) - (float) (this.direction * 2); - this.itemLocation.Y = this.MountedCenter.Y - (float) heldItemFrame.Height * 0.5f; } } - else if (sItem.useStyle == 13) + if ((sItem.type == 50 || sItem.type == 3124 || sItem.type == 3199) && this.itemAnimation > 0) { - int num14 = this.itemAnimationMax; - if (this.itemTimeMax != 0) - num14 = this.itemTimeMax; - if (num14 == 0) - num14 = sItem.useAnimation; - float num15 = (float) (1.0 - (double) (this.itemAnimation % num14) / (double) num14); - Player.CompositeArmStretchAmount stretch = Player.CompositeArmStretchAmount.Quarter; - if ((double) num15 > 0.330000013113022 && (double) num15 <= 0.660000026226044) - stretch = Player.CompositeArmStretchAmount.ThreeQuarters; - if ((double) num15 > 0.660000026226044 && (double) num15 <= 1.0) - stretch = Player.CompositeArmStretchAmount.Full; - float rotation = this.itemRotation - 1.570796f * (float) this.direction; - this.SetCompositeArmFront(true, stretch, rotation); - } - else if (sItem.useStyle == 8) - { - Projectile projectile1 = (Projectile) null; - if (this.ownedProjectileCounts[722] > 0) + if (Main.rand.Next(2) == 0) + Dust.NewDust(this.position, this.width, this.height, 15, Alpha: 150, Scale: 1.1f); + if (this.itemTime == 0) + this.itemTime = sItem.useTime; + else if (this.itemTime == sItem.useTime / 2) { + for (int index = 0; index < 70; ++index) + Dust.NewDust(this.position, this.width, this.height, 15, this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 150, Scale: 1.5f); + this.grappling[0] = -1; + this.grapCount = 0; for (int index = 0; index < 1000; ++index) { - Projectile projectile2 = Main.projectile[index]; - if (projectile2.active && projectile2.owner == this.whoAmI && projectile2.type == 722) - { - projectile1 = projectile2; - break; - } + if (Main.projectile[index].active && Main.projectile[index].owner == i && Main.projectile[index].aiStyle == 7) + Main.projectile[index].Kill(); } + this.Spawn(); + for (int index = 0; index < 70; ++index) + Dust.NewDust(this.position, this.width, this.height, 15, Alpha: 150, Scale: 1.5f); } - float num16 = 1f; - if (projectile1 != null) - num16 = MathHelper.Lerp(0.6f, 1f, Utils.GetLerpValue(0.0f, 800f, Vector2.Distance(this.MountedCenter, projectile1.Center), true)); - float num17 = 1f; - if (this.itemAnimation >= sItem.useAnimation - 1 && this.itemAnimation <= sItem.useAnimation) + } + if (sItem.type == 2350 && this.itemAnimation > 0) + { + if (this.itemTime == 0) + this.itemTime = sItem.useTime; + else if (this.itemTime == 2) { - this.itemRotation = new Vector2((float) (10 * this.direction), 10f).ToRotation() + 0.7853982f; - if (this.direction == -1) - this.itemRotation += 1.570796f; - double num18 = 1.0 - (double) this.itemAnimation / (double) this.itemAnimationMax; - Player.CompositeArmStretchAmount stretch1 = Player.CompositeArmStretchAmount.Full; - Player.CompositeArmStretchAmount stretch2 = Player.CompositeArmStretchAmount.ThreeQuarters; - float num19 = -0.3141593f; - if (this.direction == -1) - num19 *= -1f; - float num20 = (float) ((double) this.itemRotation - 0.785398185253143 + 3.14159274101257); - if (this.direction == 1) - num20 += 1.570796f; - float rotation1 = num20 + num19; - float rotation2 = num20 - num19; - this.itemLocation = (this.MountedCenter + (num20 + 1.570796f).ToRotationVector2() * -2f).Floor(); - this.SetCompositeArmFront(true, stretch1, rotation1); - this.SetCompositeArmBack(true, stretch2, rotation2); + for (int index = 0; index < 70; ++index) + Main.dust[Dust.NewDust(this.position, this.width, this.height, 15, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 150, Color.Cyan, 1.2f)].velocity *= 0.5f; + this.grappling[0] = -1; + this.grapCount = 0; + for (int index = 0; index < 1000; ++index) + { + if (Main.projectile[index].active && Main.projectile[index].owner == i && Main.projectile[index].aiStyle == 7) + Main.projectile[index].Kill(); + } + bool immune = this.immune; + int immuneTime = this.immuneTime; + this.Spawn(); + this.immune = immune; + this.immuneTime = immuneTime; + for (int index = 0; index < 70; ++index) + Main.dust[Dust.NewDust(this.position, this.width, this.height, 15, Alpha: 150, newColor: Color.Cyan, Scale: 1.2f)].velocity *= 0.5f; + if (sItem.stack > 0) + --sItem.stack; } - else if (this.itemAnimation > sItem.useAnimation) + } + if (sItem.type == 2351 && this.itemAnimation > 0) + { + if (this.itemTime == 0) + this.itemTime = sItem.useTime; + else if (this.itemTime == 2) { - float num21 = -Utils.GetLerpValue((float) this.itemAnimationMax, (float) (this.itemAnimationMax * 5), (float) this.itemAnimation, true) * num17; - Player.CompositeArmStretchAmount stretch3 = Player.CompositeArmStretchAmount.Full; - Player.CompositeArmStretchAmount stretch4 = Player.CompositeArmStretchAmount.ThreeQuarters; - float num22 = -0.3141593f * -num21; - this.itemRotation = (float) (1.57079637050629 * (double) -this.direction + 3.14159274101257 + 3.14159274101257 * (double) num21 * (double) -this.direction); - double num23 = -0.628318548202515 * (double) this.direction; - if (this.direction < 1) - num22 *= -1f; - float rotation3 = (float) num23 + num22; - float rotation4 = (float) num23 - num22; - this.itemLocation = (this.MountedCenter + new Vector2((float) (10 * this.direction), num21 * -6f)).Floor(); - this.SetCompositeArmFront(true, stretch3, rotation3); - this.SetCompositeArmBack(true, stretch4, rotation4); + switch (Main.netMode) + { + case 0: + this.TeleportationPotion(); + break; + case 1: + if (this.whoAmI == Main.myPlayer) + { + NetMessage.SendData(73); + break; + } + break; + } + if (sItem.stack > 0) + --sItem.stack; + } + } + if (sItem.type == 2756 && this.itemAnimation > 0) + { + if (this.itemTime == 0) + this.itemTime = sItem.useTime; + else if (this.itemTime == 2) + { + if (this.whoAmI == Main.myPlayer) + { + this.Male = !this.Male; + if (Main.netMode == 1) + NetMessage.SendData(4, number: this.whoAmI); + } + if (sItem.stack > 0) + --sItem.stack; } else { - float num24 = (float) (1.0 - (double) this.itemAnimation / (double) this.itemAnimationMax); - Player.CompositeArmStretchAmount stretch5 = Player.CompositeArmStretchAmount.Full; - Player.CompositeArmStretchAmount stretch6 = Player.CompositeArmStretchAmount.ThreeQuarters; - if ((double) num24 > 0.600000023841858) - stretch6 = Player.CompositeArmStretchAmount.Quarter; - float num25 = -0.3141593f; - if (this.direction == -1) - num25 *= -1f; - float num26 = num25 * (float) (1.0 - (double) num24 * 2.20000004768372); - this.itemRotation = (float) (((double) num24 * 3.14159274101257 * 1.60000002384186 - 1.57079637050629) * (double) num17 * (double) -this.direction + 3.14159274101257); - float num27 = (float) (((double) num24 * 3.14159274101257 * 0.600000023841858 + 1.25663709640503) * (double) -this.direction + 3.14159274101257 - 0.785398185253143 + 3.14159274101257); - if (this.direction == 1) - num27 += 1.570796f; - float rotation5 = num27 + num26; - float rotation6 = num27 - num26; - this.itemLocation = (this.MountedCenter + (num27 + 1.570796f).ToRotationVector2() * (float) (-5.0 * (1.0 - (double) num24))).Floor(); - this.SetCompositeArmFront(true, stretch5, rotation5); - this.SetCompositeArmBack(true, stretch6, rotation6); - } - this.FlipItemLocationAndRotationForGravity(); - } - else if (sItem.useStyle == 12) - { - this.itemRotation = 0.0f; - this.itemLocation.X = this.MountedCenter.X - (float) (8 * this.direction); - this.itemLocation.Y = this.position.Y + 40f + mountOffset; - this.itemLocation += Main.OffsetsPlayerHeadgear[this.bodyFrame.Y / 56]; - float num28 = (float) this.itemAnimationMax; - if ((double) num28 == 0.0) - num28 = (float) sItem.useAnimation; - float num29 = (float) (1.0 - (double) this.itemAnimation / (double) num28) * 2f; - float num30 = (float) Math.Cos((double) num29 * 3.14159274101257) * 0.2f; - Player.CompositeArmStretchAmount stretch = Player.CompositeArmStretchAmount.Full; - if ((double) num29 > 0.25 && (double) num29 <= 0.5) - stretch = Player.CompositeArmStretchAmount.ThreeQuarters; - if ((double) num29 > 0.5 && (double) num29 <= 0.75) - stretch = Player.CompositeArmStretchAmount.Quarter; - if ((double) num29 > 0.75 && (double) num29 <= 1.25) - stretch = Player.CompositeArmStretchAmount.None; - if ((double) num29 > 1.25 && (double) num29 <= 1.5) - stretch = Player.CompositeArmStretchAmount.Quarter; - if ((double) num29 > 1.5 && (double) num29 <= 1.75) - stretch = Player.CompositeArmStretchAmount.ThreeQuarters; - if ((double) num29 > 1.75 && (double) num29 <= 2.0) - stretch = Player.CompositeArmStretchAmount.Full; - this.SetCompositeArmFront(true, stretch, (num30 - 0.7853982f) * (float) this.direction); - this.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Quarter, (float) (-0.785398185253143 - (double) num30 * 0.5) * (float) this.direction); - this.FlipItemLocationAndRotationForGravity(); - if (sItem.type != 4715 || stretch != Player.CompositeArmStretchAmount.ThreeQuarters) - return; - Vector2 Position = this.itemLocation + new Vector2((float) heldItemFrame.Width, (float) -heldItemFrame.Height) * new Vector2((float) this.direction, this.gravDir) * 0.3f; - Dust dust1 = Dust.NewDustPerfect(Position, 228, new Vector2?(Main.rand.NextVector2CircularEdge(1f, 1f))); - dust1.noGravity = true; - dust1.noLight = true; - dust1.velocity *= 2f; - float num31 = 0.5f; - for (float num32 = 0.0f; (double) num32 < 1.0; num32 += 0.5f) - { - if (Main.rand.Next(3) == 0) + float useTime = (float) sItem.useTime; + float num205 = (useTime - (float) this.itemTime) / useTime; + float num206 = 44f; + Vector2 vector2 = new Vector2(15f, 0.0f).RotatedBy(9.42477798461914 * (double) num205); + vector2.X *= (float) this.direction; + for (int index70 = 0; index70 < 2; ++index70) { - Dust dust2 = Dust.NewDustPerfect(Position, 278, new Vector2?(Vector2.UnitY.RotatedBy((double) num32 * 6.28318548202515 + (double) Main.rand.NextFloat() * (double) num31 - (double) num31 * 0.5 + 1.57079637050629) * (float) (2.0 + (double) Main.rand.NextFloat() * 1.0)), 150, Color.Lerp(Color.White, Color.HotPink, (float) ((double) Main.rand.NextFloat() * 0.5 + 0.5)), 0.45f); - dust2.noGravity = true; - dust2.velocity *= 0.5f; - dust2.customData = (object) this; - dust2.position += dust2.velocity * 6f; - } - } - for (float num33 = 0.0f; (double) num33 < 1.0; num33 += 0.5f) - { - if (Main.rand.Next(3) == 0) - { - Dust dust3 = Dust.NewDustPerfect(Position, 278, new Vector2?(Vector2.UnitY.RotatedBy((double) num33 * 6.28318548202515 + (double) Main.rand.NextFloat() * (double) num31 - (double) num31 * 0.5 + 1.57079637050629) * (float) (0.5 + (double) Main.rand.NextFloat() * 1.0)), 150, Color.Lerp(Color.White, Color.Gold, (float) ((double) Main.rand.NextFloat() * 0.5 + 0.5)), 0.45f); - dust3.noGravity = true; - dust3.velocity *= 0.5f; - dust3.customData = (object) this; - dust3.position += dust3.velocity * 6f; - } - } - } - else - { - if (sItem.useStyle != 14 || Main.dedServ) - return; - this.itemRotation = 0.0f; - this.itemLocation.X = this.Center.X + (float) (6 * this.direction); - this.itemLocation.Y = (float) ((double) this.position.Y + 40.0 + (double) mountOffset - 8.0); - this.itemLocation += Main.OffsetsPlayerHeadgear[this.bodyFrame.Y / 56]; - this.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Full, -2.356194f * (float) this.direction); - this.FlipItemLocationAndRotationForGravity(); - } - } - - public void FlipItemLocationAndRotationForGravity() - { - if ((double) this.gravDir != -1.0) - return; - this.itemRotation = -this.itemRotation; - this.itemLocation.Y = this.Bottom.Y + (this.position.Y - this.itemLocation.Y); - } - - private void ItemCheck_StartActualUse(Item sItem) - { - bool flag1 = sItem.type == 4711; - if (((sItem.pick > 0 || sItem.axe > 0 ? 1 : (sItem.hammer > 0 ? 1 : 0)) | (flag1 ? 1 : 0)) != 0) - this.toolTime = 1; - if (this.grappling[0] > -1) - { - this.pulley = false; - this.pulleyDir = (byte) 1; - if (this.controlRight) - this.direction = 1; - else if (this.controlLeft) - this.direction = -1; - } - this.channel = sItem.channel; - this.attackCD = 0; - this.ApplyItemAnimation(sItem); - bool flag2 = ItemID.Sets.SkipsInitialUseSound[sItem.type]; - if (sItem.UseSound == null || flag2) - return; - SoundEngine.PlaySound(sItem.UseSound, this.Center); - } - - private void FreeUpPetsAndMinions(Item sItem) - { - if (ProjectileID.Sets.MinionSacrificable[sItem.shoot]) - { - List intList = new List(); - float num1 = 0.0f; - for (int index1 = 0; index1 < 1000; ++index1) - { - if (Main.projectile[index1].active && Main.projectile[index1].owner == this.whoAmI && Main.projectile[index1].minion) - { - int index2; - for (index2 = 0; index2 < intList.Count; ++index2) + int Type = 221; + if (index70 == 1) { - if ((double) Main.projectile[intList[index2]].minionSlots > (double) Main.projectile[index1].minionSlots) - { - intList.Insert(index2, index1); - break; - } + vector2.X *= -1f; + Type = 219; } - if (index2 == intList.Count) - intList.Add(index1); - num1 += Main.projectile[index1].minionSlots; - } - } - float num2 = (float) ItemID.Sets.StaffMinionSlotsRequired[sItem.type]; - float num3 = 0.0f; - int num4 = 388; - int index3 = -1; - for (int index4 = 0; index4 < intList.Count; ++index4) - { - int type = Main.projectile[intList[index4]].type; - if (type == 626) - { - intList.RemoveAt(index4); - --index4; - } - if (type == 627) - { - if (Main.projectile[(int) Main.projectile[intList[index4]].localAI[1]].type == 628) - index3 = intList[index4]; - intList.RemoveAt(index4); - --index4; - } - } - if (index3 != -1) - { - intList.Add(index3); - intList.Add(Projectile.GetByUUID(Main.projectile[index3].owner, Main.projectile[index3].ai[0])); - } - for (int index5 = 0; index5 < intList.Count && (double) num1 - (double) num3 > (double) this.maxMinions - (double) num2; ++index5) - { - int type = Main.projectile[intList[index5]].type; - if (type != num4 && type != 625 && type != 628 && type != 623) - { - if (type == 388 && num4 == 387) - num4 = 388; - if (type == 387 && num4 == 388) - num4 = 387; - num3 += Main.projectile[intList[index5]].minionSlots; - if (type == 626 || type == 627) - { - Projectile projectile1 = Main.projectile[intList[index5]]; - int byUuid = Projectile.GetByUUID(projectile1.owner, projectile1.ai[0]); - if (Main.projectile.IndexInRange(byUuid)) - { - Projectile projectile2 = Main.projectile[byUuid]; - if (projectile2.type != 625) - projectile2.localAI[1] = projectile1.localAI[1]; - Projectile projectile3 = Main.projectile[(int) projectile1.localAI[1]]; - projectile3.ai[0] = projectile1.ai[0]; - projectile3.ai[1] = 1f; - projectile3.netUpdate = true; - } - } - Main.projectile[intList[index5]].Kill(); - } - } - intList.Clear(); - if ((double) num1 + (double) num2 < 9.0) - return; - AchievementsHelper.HandleSpecialEvent(this, 6); - } - else - { - for (int index = 0; index < 1000; ++index) - { - if (Main.projectile[index].active && Main.projectile[index].owner == this.whoAmI && Main.projectile[index].type == sItem.shoot) - Main.projectile[index].Kill(); - if (sItem.shoot == 72) - { - if (Main.projectile[index].active && Main.projectile[index].owner == this.whoAmI && Main.projectile[index].type == 86) - Main.projectile[index].Kill(); - if (Main.projectile[index].active && Main.projectile[index].owner == this.whoAmI && Main.projectile[index].type == 87) - Main.projectile[index].Kill(); + Vector2 Position = new Vector2(vector2.X, num206 * (1f - num205) - num206 + (float) (this.height / 2)); + Position += this.Center; + int index71 = Dust.NewDust(Position, 0, 0, Type, Alpha: 100); + Main.dust[index71].position = Position; + Main.dust[index71].noGravity = true; + Main.dust[index71].velocity = Vector2.Zero; + Main.dust[index71].scale = 1.3f; + Main.dust[index71].customData = (object) this; } } } - } - - private void ApplyPotionDelay(Item sItem) - { - if (sItem.type == 227) - { - this.potionDelay = this.restorationDelayTime; - this.AddBuff(21, this.potionDelay); - } - else - { - this.potionDelay = this.potionDelayTime; - this.AddBuff(21, this.potionDelay); - } - } - - private bool ItemCheck_CheckCanUse(Item sItem) - { - int whoAmI = this.whoAmI; - bool canUse = true; - int i = (int) ((double) Main.mouseX + (double) Main.screenPosition.X) / 16; - int j = (int) ((double) Main.mouseY + (double) Main.screenPosition.Y) / 16; - if ((double) this.gravDir == -1.0) - j = (int) ((double) Main.screenPosition.Y + (double) Main.screenHeight - (double) Main.mouseY) / 16; - if (sItem.type == 3335 && (this.extraAccessory || !Main.expertMode)) - canUse = false; - if (this.pulley && sItem.fishingPole > 0) - canUse = false; - if (this.pulley && ItemID.Sets.IsAKite[sItem.type]) - canUse = false; - if (sItem.type == 3611 && (WiresUI.Settings.ToolMode & (WiresUI.Settings.MultiToolMode.Red | WiresUI.Settings.MultiToolMode.Green | WiresUI.Settings.MultiToolMode.Blue | WiresUI.Settings.MultiToolMode.Yellow | WiresUI.Settings.MultiToolMode.Actuator)) == (WiresUI.Settings.MultiToolMode) 0) - canUse = false; - if ((sItem.type == 3611 || sItem.type == 3625) && this.wireOperationsCooldown > 0) - canUse = false; - if (!this.CheckDD2CrystalPaymentLock(sItem)) - canUse = false; - if (sItem.shoot > -1 && ProjectileID.Sets.IsADD2Turret[sItem.shoot] && !this.downedDD2EventAnyDifficulty && !DD2Event.Ongoing) - canUse = false; - if (sItem.shoot > -1 && ProjectileID.Sets.IsADD2Turret[sItem.shoot] && DD2Event.Ongoing && whoAmI == Main.myPlayer) - { - int worldX; - int worldY; - this.FindSentryRestingSpot(sItem.shoot, out worldX, out worldY, out int _); - if (Player.WouldSpotOverlapWithSentry(worldX, worldY, sItem.shoot == 688 || sItem.shoot == 689 || sItem.shoot == 690)) - canUse = false; - } - if (sItem.shoot > -1 && ProjectileID.Sets.IsADD2Turret[sItem.shoot] && whoAmI == Main.myPlayer) - { - int worldX; - int worldY; - this.FindSentryRestingSpot(sItem.shoot, out worldX, out worldY, out int _); - int num = worldX / 16; - worldY /= 16; - --worldY; - if (sItem.shoot == 688 || sItem.shoot == 689 || sItem.shoot == 690) - { - if (Collision.SolidTiles(num, num, worldY - 2, worldY)) - canUse = false; - } - else if (WorldGen.SolidTile(num, worldY)) - canUse = false; - } - if (this.wet && (sItem.shoot == 85 || sItem.shoot == 15 || sItem.shoot == 34)) - canUse = false; - if (sItem.makeNPC > (short) 0 && !NPC.CanReleaseNPCs(this.whoAmI)) - canUse = false; - if (this.whoAmI == Main.myPlayer && sItem.type == 603 && !Main.runningCollectorsEdition) - canUse = false; - if (sItem.type == 1071 || sItem.type == 1072) - { - bool flag = false; - for (int index = 0; index < 58; ++index) - { - if (this.inventory[index].paint > (byte) 0) - { - flag = true; - break; - } - } - if (!flag) - canUse = false; - } - if (this.noItems) - canUse = false; - if (sItem.tileWand > 0) + if (i != Main.myPlayer) + return; + if (this.itemTime == (int) ((double) sItem.useTime * (double) this.tileSpeed) && sItem.tileWand > 0) { int tileWand = sItem.tileWand; - canUse = false; for (int index = 0; index < 58; ++index) { if (tileWand == this.inventory[index].type && this.inventory[index].stack > 0) { - canUse = true; - break; - } - } - } - if ((sItem.shoot == 6 || sItem.shoot == 19 || sItem.shoot == 33 || sItem.shoot == 52 || sItem.shoot == 113 || sItem.shoot == 320 || sItem.shoot == 333 || sItem.shoot == 383 || sItem.shoot == 491 || sItem.shoot == 867 || sItem.shoot == 902 ? 1 : (sItem.shoot == 866 ? 1 : 0)) != 0) - { - for (int index = 0; index < 1000; ++index) - { - if (Main.projectile[index].active && Main.projectile[index].owner == Main.myPlayer && Main.projectile[index].type == sItem.shoot) - canUse = false; - } - } - if (sItem.shoot == 106) - { - int num = 0; - for (int index = 0; index < 1000; ++index) - { - if (Main.projectile[index].active && Main.projectile[index].owner == Main.myPlayer && Main.projectile[index].type == sItem.shoot) - ++num; - } - if (num >= sItem.stack) - canUse = false; - } - if (sItem.shoot == 272) - { - int num = 0; - for (int index = 0; index < 1000; ++index) - { - if (Main.projectile[index].active && Main.projectile[index].owner == Main.myPlayer && Main.projectile[index].type == sItem.shoot) - ++num; - } - if (num >= sItem.stack) - canUse = false; - } - if (sItem.shoot == 13 || sItem.shoot == 32 || sItem.shoot >= 230 && sItem.shoot <= 235 || sItem.shoot == 315 || sItem.shoot == 331 || sItem.shoot == 372) - { - for (int index = 0; index < 1000; ++index) - { - if (Main.projectile[index].active && Main.projectile[index].owner == Main.myPlayer && Main.projectile[index].type == sItem.shoot && (double) Main.projectile[index].ai[0] != 2.0) - canUse = false; - } - } - if (sItem.shoot == 332) - { - int num = 0; - for (int index = 0; index < 1000; ++index) - { - if (Main.projectile[index].active && Main.projectile[index].owner == Main.myPlayer && Main.projectile[index].type == sItem.shoot && (double) Main.projectile[index].ai[0] != 2.0) - ++num; - } - if (num >= 3) - canUse = false; - } - if (sItem.potion && this.potionDelay > 0) - canUse = false; - if (sItem.mana > 0 && this.silence) - canUse = false; - if (sItem.mana > 0 & canUse) - canUse = this.ItemCheck_PayMana(sItem, canUse); - if (sItem.type == 43 && Main.dayTime) - canUse = false; - if (sItem.type == 544 && Main.dayTime) - canUse = false; - if (sItem.type == 556 && Main.dayTime) - canUse = false; - if (sItem.type == 557 && Main.dayTime) - canUse = false; - if (sItem.type == 70 && !this.ZoneCorrupt) - canUse = false; - if (sItem.type == 1133 && !this.ZoneJungle) - canUse = false; - if (sItem.type == 1844 && (Main.dayTime || Main.pumpkinMoon || Main.snowMoon || DD2Event.Ongoing)) - canUse = false; - if (sItem.type == 1958 && (Main.dayTime || Main.pumpkinMoon || Main.snowMoon || DD2Event.Ongoing)) - canUse = false; - if (sItem.type == 2767 && (!Main.dayTime || Main.eclipse || !Main.hardMode)) - canUse = false; - if (sItem.type == 4271 && (Main.dayTime || Main.bloodMoon)) - canUse = false; - if (sItem.type == 3601 && (!NPC.downedGolemBoss || !Main.hardMode || NPC.AnyDanger() || NPC.AnyoneNearCultists())) - canUse = false; - if (!this.SummonItemCheck()) - canUse = false; - if (sItem.shoot == 17 & canUse && whoAmI == Main.myPlayer && !Player.ItemCheck_IsValidDirtRodTarget(Main.tile[i, j])) - canUse = false; - if (sItem.fishingPole > 0) - canUse = this.ItemCheck_CheckFishingBobbers(canUse); - if (ItemID.Sets.HasAProjectileThatHasAUsabilityCheck[sItem.type]) - canUse = this.ItemCheck_CheckUsabilityOfProjectiles(canUse); - if (sItem.shoot == 17 & canUse && whoAmI == Main.myPlayer) - { - if (Player.ItemCheck_IsValidDirtRodTarget(Main.tile[i, j])) - { - WorldGen.KillTile(i, j, noItem: true); - if (!Main.tile[i, j].active()) - { - if (Main.netMode == 1) - NetMessage.SendData(17, number: 4, number2: ((float) i), number3: ((float) j)); - } - else - canUse = false; - } - else - canUse = false; - } - if (canUse) - canUse = this.HasAmmo(sItem, canUse); - return canUse; - } - - private bool ItemCheck_CheckUsabilityOfProjectiles(bool canUse) - { - for (int index = 0; index < 1000; ++index) - { - Projectile projectile = Main.projectile[index]; - if (projectile.active && projectile.owner == this.whoAmI) - projectile.CheckUsability(this, ref canUse); - } - return canUse; - } - - private bool ItemCheck_CheckFishingBobbers(bool canUse) - { - for (int index = 0; index < 1000; ++index) - { - Projectile bobber = Main.projectile[index]; - if (bobber.active && bobber.owner == this.whoAmI && bobber.bobber) - { - canUse = false; - if (this.whoAmI == Main.myPlayer && (double) bobber.ai[0] == 0.0) - { - bobber.ai[0] = 1f; - float num = -10f; - if (bobber.wet && (double) bobber.velocity.Y > (double) num) - bobber.velocity.Y = num; - bobber.netUpdate2 = true; - if ((double) bobber.ai[1] < 0.0 && (double) bobber.localAI[1] != 0.0) + --this.inventory[index].stack; + if (this.inventory[index].stack <= 0) { - bool pullTheBobber; - int baitTypeUsed; - this.ItemCheck_CheckFishingBobber_PickAndConsumeBait(bobber, out pullTheBobber, out baitTypeUsed); - if (pullTheBobber) - this.ItemCheck_CheckFishingBobber_PullBobber(bobber, baitTypeUsed); + this.inventory[index] = new Item(); + break; } - } - } - } - return canUse; - } - - private void ItemCheck_CheckFishingBobber_PullBobber(Projectile bobber, int baitTypeUsed) - { - if (baitTypeUsed == 2673) - { - if (Main.netMode != 1) - NPC.SpawnOnPlayer(this.whoAmI, 370); - else - NetMessage.SendData(61, number: this.whoAmI, number2: 370f); - bobber.ai[0] = 2f; - } - else if ((double) bobber.localAI[1] < 0.0) - { - Point point = new Point((int) bobber.position.X, (int) bobber.position.Y); - int Type = (int) -(double) bobber.localAI[1]; - if (Type == 618) - point.Y += 64; - if (Main.netMode == 1) - { - NetMessage.SendData(130, number: (point.X / 16), number2: ((float) (point.Y / 16)), number3: ((float) Type)); - } - else - { - NPC.NewNPC(point.X, point.Y, Type); - bobber.ai[0] = 2f; - } - } - else if (Main.rand.Next(7) == 0 && !this.accFishingLine) - bobber.ai[0] = 2f; - else - bobber.ai[1] = bobber.localAI[1]; - bobber.netUpdate = true; - } - - private void ItemCheck_CheckFishingBobber_PickAndConsumeBait( - Projectile bobber, - out bool pullTheBobber, - out int baitTypeUsed) - { - pullTheBobber = false; - baitTypeUsed = 0; - int index1 = -1; - for (int index2 = 54; index2 < 58; ++index2) - { - if (this.inventory[index2].stack > 0 && this.inventory[index2].bait > 0) - { - index1 = index2; - break; - } - } - if (index1 == -1) - { - for (int index3 = 0; index3 < 50; ++index3) - { - if (this.inventory[index3].stack > 0 && this.inventory[index3].bait > 0) - { - index1 = index3; break; } } } - if (index1 <= -1) - return; - Item obj1 = this.inventory[index1]; - bool flag = false; - float num = (float) (1.0 + (double) obj1.bait / 6.0); - if ((double) num < 1.0) - num = 1f; - if (this.accTackleBox) - ++num; - if ((double) Main.rand.NextFloat() * (double) num < 1.0) - flag = true; - if ((double) bobber.localAI[1] == -1.0) - flag = true; - if ((double) bobber.localAI[1] > 0.0) + if (this.itemTime == (sItem.createTile < 0 ? (sItem.createWall <= 0 ? sItem.useTime : (int) ((double) sItem.useTime * (double) this.wallSpeed)) : (int) ((double) sItem.useTime * (double) this.tileSpeed)) && sItem.consumable) { - Item obj2 = new Item(); - obj2.SetDefaults((int) bobber.localAI[1]); - if (obj2.rare < 0) - flag = false; - } - baitTypeUsed = obj1.type; - if (baitTypeUsed == 2673) - flag = true; - if (flag) - { - if (obj1.type == 4361 || obj1.type == 4362) - NPC.LadyBugKilled(this.Center, obj1.type == 4362); - --obj1.stack; - if (obj1.stack <= 0) - obj1.SetDefaults(); - } - pullTheBobber = true; - } - - private static bool ItemCheck_IsValidDirtRodTarget(Tile t) - { - if (!t.active()) - return false; - return t.type == (ushort) 0 || t.type == (ushort) 2 || t.type == (ushort) 23 || t.type == (ushort) 109 || t.type == (ushort) 199 || t.type == (ushort) 477 || t.type == (ushort) 492; - } - - private bool ItemCheck_PayMana(Item sItem, bool canUse) - { - bool flag1 = this.altFunctionUse == 2; - bool flag2 = false; - int num = (int) ((double) sItem.mana * (double) this.manaCost); - if (sItem.type == 2795) - flag2 = true; - if (sItem.type == 3852 & flag1) - num = (int) ((double) (sItem.mana * 2) * (double) this.manaCost); - if (((sItem.shoot <= 0 ? 0 : (ProjectileID.Sets.TurretFeature[sItem.shoot] ? 1 : 0)) & (flag1 ? 1 : 0)) != 0) - flag2 = true; - if (((sItem.shoot <= 0 ? 0 : (ProjectileID.Sets.MinionTargettingFeature[sItem.shoot] ? 1 : 0)) & (flag1 ? 1 : 0)) != 0) - flag2 = true; - if (sItem.type != 3269 && (!this.spaceGun || sItem.type != (int) sbyte.MaxValue && sItem.type != 4347 && sItem.type != 4348)) - { - if (this.statMana >= num) + bool flag23 = true; + if (sItem.type == 2350 || sItem.type == 2351) + flag23 = false; + if (sItem.type == 2756) + flag23 = false; + if (sItem.ranged) { - if (!flag2) - this.statMana -= num; + if (this.ammoCost80 && Main.rand.Next(5) == 0) + flag23 = false; + if (this.ammoCost75 && Main.rand.Next(4) == 0) + flag23 = false; } - else if (this.manaFlower) + if (sItem.thrown) { - this.QuickMana(); - if (this.statMana >= num) + if (this.thrownCost50 && Main.rand.Next(100) < 50) + flag23 = false; + if (this.thrownCost33 && Main.rand.Next(100) < 33) + flag23 = false; + } + if (sItem.type >= 71 && sItem.type <= 74) + flag23 = true; + if (flag23) + { + if (sItem.stack > 0) + --sItem.stack; + if (sItem.stack <= 0) { - if (!flag2) - this.statMana -= num; - } - else - canUse = false; - } - else - canUse = false; - } - return canUse; - } - - private void ItemCheck_TryPlacingWearablesOnMannequins(Item sItem) - { - if (!this.controlUseItem || !this.releaseUseItem || sItem.headSlot <= 0 && sItem.bodySlot <= 0 && sItem.legSlot <= 0) - return; - if (sItem.useStyle == 0) - this.releaseUseItem = false; - if ((double) this.position.X / 16.0 - (double) Player.tileRangeX - (double) sItem.tileBoost > (double) Player.tileTargetX || ((double) this.position.X + (double) this.width) / 16.0 + (double) Player.tileRangeX + (double) sItem.tileBoost - 1.0 < (double) Player.tileTargetX || (double) this.position.Y / 16.0 - (double) Player.tileRangeY - (double) sItem.tileBoost > (double) Player.tileTargetY || ((double) this.position.Y + (double) this.height) / 16.0 + (double) Player.tileRangeY + (double) sItem.tileBoost - 2.0 < (double) Player.tileTargetY) - return; - int tileTargetX = Player.tileTargetX; - int tileTargetY = Player.tileTargetY; - if (!Main.tile[tileTargetX, tileTargetY].active() || Main.tile[tileTargetX, tileTargetY].type != (ushort) 128 && Main.tile[tileTargetX, tileTargetY].type != (ushort) 269) - return; - int frameY = (int) Main.tile[tileTargetX, tileTargetY].frameY; - int num1 = 0; - if (sItem.bodySlot >= 0) - num1 = 1; - if (sItem.legSlot >= 0) - num1 = 2; - int num2; - for (num2 = frameY / 18; num1 > num2; num2 = (int) Main.tile[tileTargetX, tileTargetY].frameY / 18) - ++tileTargetY; - for (; num1 < num2; num2 = (int) Main.tile[tileTargetX, tileTargetY].frameY / 18) - --tileTargetY; - int frameX1 = (int) Main.tile[tileTargetX, tileTargetY].frameX; - while (frameX1 >= 100) - frameX1 -= 100; - if (frameX1 >= 36) - frameX1 -= 36; - int index = tileTargetX - frameX1 / 18; - int frameX2 = (int) Main.tile[index, tileTargetY].frameX; - WorldGen.KillTile(index, tileTargetY, true); - if (Main.netMode == 1) - NetMessage.SendData(17, number2: ((float) index), number3: ((float) tileTargetY), number4: 1f); - while (frameX2 >= 100) - frameX2 -= 100; - if (num2 == 0 && sItem.headSlot >= 0) - { - Main.blockMouse = true; - Main.tile[index, tileTargetY].frameX = (short) (frameX2 + sItem.headSlot * 100); - if (Main.netMode == 1) - NetMessage.SendTileSquare(-1, index, tileTargetY, 1); - --sItem.stack; - if (sItem.stack <= 0) - { - sItem.SetDefaults(); - Main.mouseItem.SetDefaults(); - } - if (this.selectedItem == 58) - Main.mouseItem = sItem.Clone(); - this.releaseUseItem = false; - this.mouseInterface = true; - } - else if (num2 == 1 && sItem.bodySlot >= 0) - { - Main.blockMouse = true; - Main.tile[index, tileTargetY].frameX = (short) (frameX2 + sItem.bodySlot * 100); - if (Main.netMode == 1) - NetMessage.SendTileSquare(-1, index, tileTargetY, 1); - --sItem.stack; - if (sItem.stack <= 0) - { - sItem.SetDefaults(); - Main.mouseItem.SetDefaults(); - } - if (this.selectedItem == 58) - Main.mouseItem = sItem.Clone(); - this.releaseUseItem = false; - this.mouseInterface = true; - } - else - { - if (num2 != 2 || sItem.legSlot < 0 || ArmorIDs.Legs.Sets.MannequinIncompatible.Contains(sItem.legSlot)) - return; - Main.blockMouse = true; - Main.tile[index, tileTargetY].frameX = (short) (frameX2 + sItem.legSlot * 100); - if (Main.netMode == 1) - NetMessage.SendTileSquare(-1, index, tileTargetY, 1); - --sItem.stack; - if (sItem.stack <= 0) - { - sItem.SetDefaults(); - Main.mouseItem.SetDefaults(); - } - if (this.selectedItem == 58) - Main.mouseItem = sItem.Clone(); - this.releaseUseItem = false; - this.mouseInterface = true; - } - } - - private void ApplyReuseDelay() - { - this.itemAnimation = this.reuseDelay; - this.itemTime = this.reuseDelay; - this.reuseDelay = 0; - } - - private void ItemCheck_HackHoldStyles(Item sItem) - { - if (sItem.fishingPole > 0) - { - sItem.holdStyle = 0; - if (this.ItemTimeIsZero && this.itemAnimation == 0) - { - for (int index = 0; index < 1000; ++index) - { - if (Main.projectile[index].active && Main.projectile[index].owner == this.whoAmI && Main.projectile[index].bobber) - sItem.holdStyle = 1; + this.itemTime = this.itemAnimation; + Main.blockMouse = true; } } } - if (!ItemID.Sets.IsAKite[sItem.type]) + if (sItem.stack <= 0 && this.itemAnimation == 0) + this.inventory[this.selectedItem] = new Item(); + if (this.selectedItem != 58 || this.itemAnimation == 0) return; - sItem.holdStyle = 0; - if (!this.ItemTimeIsZero || this.itemAnimation != 0) - return; - for (int index = 0; index < 1000; ++index) - { - if (Main.projectile[index].active && Main.projectile[index].owner == this.whoAmI && Main.projectile[index].type == sItem.shoot) - sItem.holdStyle = 1; - } + Main.mouseItem = sItem.Clone(); } - private void ItemCheck_HandleMPItemAnimation(Item sItem) - { - if (sItem.autoReuse && !this.noItems) - { - this.releaseUseItem = true; - if (this.itemAnimation == 1 && sItem.stack > 0) - { - if (sItem.shoot > 0 && this.whoAmI != Main.myPlayer && this.controlUseItem && sItem.useStyle == 5 && sItem.reuseDelay == 0) - { - this.ApplyItemAnimation(sItem); - if (sItem.UseSound != null) - SoundEngine.PlaySound(sItem.UseSound, this.Center); - } - else - this.itemAnimation = 0; - } - } - this.TryAllowingItemReuse(sItem); - } - - private void TryAllowingItemReuse(Item sItem) - { - bool flag = false; - if (this.kbGlove) - flag = ((flag | sItem.melee ? 1 : 0) | (!sItem.summon ? 0 : (ItemID.Sets.SummonerWeaponThatScalesWithAttackSpeed[sItem.type] ? 1 : 0))) != 0; - if (!flag) - return; - this.releaseUseItem = true; - } - - private void ItemCheck_HandleMount() - { - if (!this.mount.Active) - return; - if (this.mount.Type == 8) - { - this.noItems = true; - if (this.controlUseItem) - { - this.channel = true; - if (this.releaseUseItem) - this.mount.UseAbility(this, Vector2.Zero, true); - this.releaseUseItem = false; - } - } - if (this.whoAmI != Main.myPlayer || (double) this.gravDir != -1.0) - return; - this.mount.Dismount(this); - } - - public static bool WouldSpotOverlapWithSentry(int worldX, int worldY, bool lightningAura) + public static bool WouldSpotOverlapWithSentry(int worldX, int worldY) { Point point1 = new Point(worldX, worldY - 8); Point point2 = new Point(worldX + 16, worldY - 8); @@ -33464,12 +24865,6 @@ label_106: if (projectile.active && projectile.sentry) { Microsoft.Xna.Framework.Rectangle hitbox = projectile.Hitbox; - if (!lightningAura && hitbox.X > 30) - { - hitbox.X += hitbox.Width / 2; - hitbox.Width = 30; - hitbox.X -= hitbox.Width / 2; - } if (hitbox.Contains(point1) || hitbox.Contains(point2) || hitbox.Contains(point3)) { flag = true; @@ -33572,7 +24967,7 @@ label_106: private void ItemCheck_ApplyPetBuffs(Item sItem) { - if (this.whoAmI == Main.myPlayer && sItem.type == 603 && Main.runningCollectorsEdition) + if (this.whoAmI == Main.myPlayer && sItem.type == 603 && Main.cEd) this.AddBuff(sItem.buffType, 3600); if (this.whoAmI == Main.myPlayer && sItem.type == 669) this.AddBuff(sItem.buffType, 3600); @@ -33657,50 +25052,34 @@ label_106: this.AddBuff(sItem.buffType, 3600); if (this.whoAmI == Main.myPlayer && sItem.type == 2420) this.AddBuff(sItem.buffType, 3600); - if (this.whoAmI == Main.myPlayer) - { - switch (sItem.type) - { - case 2535: - case 2551: - case 2584: - case 2587: - case 2621: - case 2749: - case 3249: - case 3474: - case 3531: - case 4269: - case 4273: - case 4281: - case 4607: - case 4758: - case 5005: - this.AddBuff(sItem.buffType, 3600); - break; - } - } + if (this.whoAmI == Main.myPlayer && sItem.type == 2535) + this.AddBuff(sItem.buffType, 3600); + if (this.whoAmI == Main.myPlayer && sItem.type == 2551) + this.AddBuff(sItem.buffType, 3600); + if (this.whoAmI == Main.myPlayer && sItem.type == 2584) + this.AddBuff(sItem.buffType, 3600); + if (this.whoAmI == Main.myPlayer && sItem.type == 2587) + this.AddBuff(sItem.buffType, 3600); + if (this.whoAmI == Main.myPlayer && sItem.type == 2621) + this.AddBuff(sItem.buffType, 3600); + if (this.whoAmI == Main.myPlayer && sItem.type == 2749) + this.AddBuff(sItem.buffType, 3600); + if (this.whoAmI == Main.myPlayer && sItem.type == 3249) + this.AddBuff(sItem.buffType, 3600); + if (this.whoAmI == Main.myPlayer && sItem.type == 3474) + this.AddBuff(sItem.buffType, 3600); + if (this.whoAmI == Main.myPlayer && sItem.type == 3531) + this.AddBuff(sItem.buffType, 3600); if (this.whoAmI != Main.myPlayer) return; - int type1 = sItem.type; - if (type1 <= 4605) + switch (sItem.type) { - if (type1 <= 4366) - { - if ((uint) (type1 - 3855) > 2U && (uint) (type1 - 4365) > 1U) - return; - } - else if (type1 != 4425 && (uint) (type1 - 4550) > 1U && (uint) (type1 - 4603) > 2U) - return; + case 3855: + case 3856: + case 3857: + this.AddBuff(sItem.buffType, 3600); + break; } - else if (type1 <= 4737) - { - if (type1 != 4701 && (uint) (type1 - 4735) > 2U) - return; - } - else if (type1 != 4777 && (uint) (type1 - 4797) > 20U && type1 != 4960) - return; - this.AddBuff(sItem.buffType, 3600); } public float GetWeaponKnockback(Item sItem, float KnockBack) @@ -33718,15 +25097,6 @@ label_106: return KnockBack; } - public int GetWeaponCrit(Item sItem) - { - if (sItem.melee) - return this.meleeCrit; - if (sItem.ranged) - return this.rangedCrit; - return sItem.magic ? this.magicCrit : 0; - } - public int GetWeaponDamage(Item sItem) { int num = sItem.damage; @@ -33744,6 +25114,8 @@ label_106: if (sItem.useAmmo == AmmoID.Rocket || sItem.useAmmo == AmmoID.StyngerBolt || sItem.useAmmo == AmmoID.JackOLantern || sItem.useAmmo == AmmoID.NailFriendly) num = (int) ((double) num * (double) this.rocketDamage + 4.99999987368938E-06); } + else if (sItem.thrown) + num = (int) ((double) num * (double) this.thrownDamage + 4.99999987368938E-06); else if (sItem.magic) num = (int) ((double) num * (double) this.magicDamage + 4.99999987368938E-06); else if (sItem.summon) @@ -33752,6 +25124,31 @@ label_106: return num; } + private void ApplyAnimation(Item sItem) + { + if (sItem.melee) + { + this.itemAnimation = (int) ((double) sItem.useAnimation * (double) this.meleeSpeed); + this.itemAnimationMax = (int) ((double) sItem.useAnimation * (double) this.meleeSpeed); + } + else if (sItem.createTile >= 0) + { + this.itemAnimation = (int) ((double) sItem.useAnimation * (double) this.tileSpeed); + this.itemAnimationMax = (int) ((double) sItem.useAnimation * (double) this.tileSpeed); + } + else if (sItem.createWall >= 0) + { + this.itemAnimation = (int) ((double) sItem.useAnimation * (double) this.wallSpeed); + this.itemAnimationMax = (int) ((double) sItem.useAnimation * (double) this.wallSpeed); + } + else + { + this.itemAnimation = sItem.useAnimation; + this.itemAnimationMax = sItem.useAnimation; + this.reuseDelay = sItem.reuseDelay; + } + } + public bool HasAmmo(Item sItem, bool canUse) { if (sItem.useAmmo > 0) @@ -33769,19 +25166,9 @@ label_106: return canUse; } - private bool PickAmmo_TryFindingSpecificMatches( - int launcher, - int ammo, - out int pickedProjectileId) - { - pickedProjectileId = 0; - Dictionary dictionary; - return AmmoID.Sets.SpecificLauncherAmmoProjectileMatches.TryGetValue(launcher, out dictionary) && dictionary.TryGetValue(ammo, out pickedProjectileId); - } - public void PickAmmo( Item sItem, - ref int projToShoot, + ref int shoot, ref float speed, ref bool canShoot, ref int Damage, @@ -33814,53 +25201,40 @@ label_106: } if (!canShoot) return; - int pickedProjectileId = -1; - if (this.PickAmmo_TryFindingSpecificMatches(sItem.type, obj.type, out pickedProjectileId)) - projToShoot = pickedProjectileId; - else if (sItem.type == 1946) - projToShoot = 338 + obj.type - 771; - else if (sItem.type == 3930) - projToShoot = 715 + obj.type - AmmoID.Rocket; + if (sItem.type == 1946) + shoot = 338 + obj.type - 771; else if (sItem.useAmmo == AmmoID.Rocket) - projToShoot += obj.shoot; + shoot += obj.shoot; else if (sItem.useAmmo == 780) - projToShoot += obj.shoot; + shoot += obj.shoot; else if (obj.shoot > 0) - projToShoot = obj.shoot; - if (sItem.type == 3019 && projToShoot == 1) - projToShoot = 485; + shoot = obj.shoot; + if (sItem.type == 3019 && shoot == 1) + shoot = 485; if (sItem.type == 3052) - projToShoot = 495; - if (sItem.type == 4953 && projToShoot == 1) - projToShoot = 932; - if (sItem.type == 4381) - projToShoot = 819; - if (sItem.type == 3245 && projToShoot == 21) - projToShoot = 532; - if (sItem.type == 4058 && projToShoot == 474) - projToShoot = 117; - if (projToShoot == 42) + shoot = 495; + if (sItem.type == 3245 && shoot == 21) + shoot = 532; + if (shoot == 42) { if (obj.type == 370) { - projToShoot = 65; + shoot = 65; Damage += 5; } else if (obj.type == 408) { - projToShoot = 68; + shoot = 68; Damage += 5; } else if (obj.type == 1246) { - projToShoot = 354; + shoot = 354; Damage += 5; } } - if (this.inventory[this.selectedItem].type == 2888 && projToShoot == 1) - projToShoot = 469; - if (this.hasMoltenQuiver && projToShoot == 1) - projToShoot = 2; + if (this.inventory[this.selectedItem].type == 2888 && shoot == 1) + shoot = 469; if (this.magicQuiver && (sItem.useAmmo == AmmoID.Arrow || sItem.useAmmo == AmmoID.Stake)) { KnockBack = (float) (int) ((double) KnockBack * 1.1); @@ -33874,7 +25248,7 @@ label_106: } else Damage += obj.damage; - if ((sItem.useAmmo == AmmoID.Arrow || sItem.useAmmo == AmmoID.Stake) && this.archery) + if (sItem.useAmmo == AmmoID.Arrow && this.archery) { if ((double) speed < 20.0) { @@ -33886,15 +25260,20 @@ label_106: } KnockBack += obj.knockBack; bool flag2 = dontConsume; - if (sItem.type == 3245 && Main.rand.Next(3) == 0) - flag2 = true; + if (sItem.type == 3245) + { + if (Main.rand.Next(3) == 0) + flag2 = true; + else if (this.thrownCost33 && Main.rand.Next(100) < 33) + flag2 = true; + else if (this.thrownCost50 && Main.rand.Next(100) < 50) + flag2 = true; + } if (sItem.type == 3475 && Main.rand.Next(3) != 0) flag2 = true; - if (sItem.type == 3930 && Main.rand.Next(2) == 0) - flag2 = true; if (sItem.type == 3540 && Main.rand.Next(3) != 0) flag2 = true; - if (this.magicQuiver && (sItem.useAmmo == AmmoID.Arrow || sItem.useAmmo == AmmoID.Stake) && Main.rand.Next(5) == 0) + if (this.magicQuiver && sItem.useAmmo == AmmoID.Arrow && Main.rand.Next(5) == 0) flag2 = true; if (this.ammoBox && Main.rand.Next(5) == 0) flag2 = true; @@ -33910,21 +25289,17 @@ label_106: flag2 = true; if (sItem.type == 1929 && Main.rand.Next(2) == 0) flag2 = true; - if (sItem.type == 1553 && Main.rand.Next(3) != 0) + if (sItem.type == 1553 && Main.rand.Next(2) == 0) flag2 = true; if (sItem.type == 434 && this.itemAnimation < sItem.useAnimation - 2) flag2 = true; - if (sItem.type == 4953 && this.itemAnimation > sItem.useAnimation - 8) - flag2 = true; - if (this.chloroAmmoCost80 && Main.rand.Next(5) == 0) - flag2 = true; if (this.ammoCost80 && Main.rand.Next(5) == 0) flag2 = true; if (this.ammoCost75 && Main.rand.Next(4) == 0) flag2 = true; - if (projToShoot == 85 && this.itemAnimation < this.itemAnimationMax - 6) + if (shoot == 85 && this.itemAnimation < this.itemAnimationMax - 6) flag2 = true; - if ((projToShoot == 145 || projToShoot == 146 || projToShoot == 147 || projToShoot == 148 || projToShoot == 149) && this.itemAnimation < this.itemAnimationMax - 5) + if ((shoot == 145 || shoot == 146 || shoot == 147 || shoot == 148 || shoot == 149) && this.itemAnimation < this.itemAnimationMax - 5) flag2 = true; if (flag2 || !obj.consumable) return; @@ -33935,36 +25310,122 @@ label_106: obj.TurnToAir(); } - public void GetOtherPlayersPickTile(int x, int y, int pickDamage) => this.hitTile.AddDamage(this.hitTile.HitObject(x, y, 1), pickDamage); - public void PickTile(int x, int y, int pickPower) { + int num1 = 0; int tileId = this.hitTile.HitObject(x, y, 1); - Tile tileTarget = Main.tile[x, y]; - if (tileTarget.type == (ushort) 504) - return; - int num1 = this.GetPickaxeDamage(x, y, pickPower, tileId, tileTarget); + Tile tile = Main.tile[x, y]; + if (Main.tileNoFail[(int) tile.type]) + num1 = 100; + int damageAmount = Main.tileDungeon[(int) tile.type] || tile.type == (ushort) 25 || tile.type == (ushort) 58 || tile.type == (ushort) 117 || tile.type == (ushort) 203 ? num1 + pickPower / 2 : (tile.type == (ushort) 48 || tile.type == (ushort) 232 ? num1 + pickPower / 4 : (tile.type != (ushort) 226 ? (tile.type == (ushort) 107 || tile.type == (ushort) 221 ? num1 + pickPower / 2 : (tile.type == (ushort) 108 || tile.type == (ushort) 222 ? num1 + pickPower / 3 : (tile.type == (ushort) 111 || tile.type == (ushort) 223 ? num1 + pickPower / 4 : (tile.type != (ushort) 211 ? num1 + pickPower : num1 + pickPower / 5)))) : num1 + pickPower / 4)); + if (tile.type == (ushort) 211 && pickPower < 200) + damageAmount = 0; + if ((tile.type == (ushort) 25 || tile.type == (ushort) 203) && pickPower < 65) + damageAmount = 0; + else if (tile.type == (ushort) 117 && pickPower < 65) + damageAmount = 0; + else if (tile.type == (ushort) 37 && pickPower < 50) + damageAmount = 0; + else if (tile.type == (ushort) 404 && pickPower < 65) + damageAmount = 0; + else if ((tile.type == (ushort) 22 || tile.type == (ushort) 204) && (double) y > Main.worldSurface && pickPower < 55) + damageAmount = 0; + else if (tile.type == (ushort) 56 && pickPower < 65) + damageAmount = 0; + else if (tile.type == (ushort) 58 && pickPower < 65) + damageAmount = 0; + else if ((tile.type == (ushort) 226 || tile.type == (ushort) 237) && pickPower < 210) + damageAmount = 0; + else if (Main.tileDungeon[(int) tile.type] && pickPower < 65) + { + if ((double) x < (double) Main.maxTilesX * 0.35 || (double) x > (double) Main.maxTilesX * 0.65) + damageAmount = 0; + } + else if (tile.type == (ushort) 107 && pickPower < 100) + damageAmount = 0; + else if (tile.type == (ushort) 108 && pickPower < 110) + damageAmount = 0; + else if (tile.type == (ushort) 111 && pickPower < 150) + damageAmount = 0; + else if (tile.type == (ushort) 221 && pickPower < 100) + damageAmount = 0; + else if (tile.type == (ushort) 222 && pickPower < 110) + damageAmount = 0; + else if (tile.type == (ushort) 223 && pickPower < 150) + damageAmount = 0; + if (tile.type == (ushort) 147 || tile.type == (ushort) 0 || tile.type == (ushort) 40 || tile.type == (ushort) 53 || tile.type == (ushort) 57 || tile.type == (ushort) 59 || tile.type == (ushort) 123 || tile.type == (ushort) 224 || tile.type == (ushort) 397) + damageAmount += pickPower; + if (tile.type == (ushort) 165 || Main.tileRope[(int) tile.type] || tile.type == (ushort) 199 || Main.tileMoss[(int) tile.type]) + damageAmount = 100; + if (this.hitTile.AddDamage(tileId, damageAmount, false) >= 100 && (tile.type == (ushort) 2 || tile.type == (ushort) 23 || tile.type == (ushort) 60 || tile.type == (ushort) 70 || tile.type == (ushort) 109 || tile.type == (ushort) 199 || Main.tileMoss[(int) tile.type])) + damageAmount = 0; + if (tile.type == (ushort) 128 || tile.type == (ushort) 269) + { + if (tile.frameX == (short) 18 || tile.frameX == (short) 54) + { + --x; + tile = Main.tile[x, y]; + this.hitTile.UpdatePosition(tileId, x, y); + } + if (tile.frameX >= (short) 100) + { + damageAmount = 0; + Main.blockMouse = true; + } + } + if (tile.type == (ushort) 334) + { + if (tile.frameY == (short) 0) + { + ++y; + tile = Main.tile[x, y]; + this.hitTile.UpdatePosition(tileId, x, y); + } + if (tile.frameY == (short) 36) + { + --y; + tile = Main.tile[x, y]; + this.hitTile.UpdatePosition(tileId, x, y); + } + int frameX1 = (int) tile.frameX; + bool flag1 = frameX1 >= 5000; + bool flag2 = false; + if (!flag1) + { + int num2 = frameX1 / 18 % 3; + x -= num2; + tile = Main.tile[x, y]; + if (tile.frameX >= (short) 5000) + flag1 = true; + } + if (flag1) + { + int frameX2 = (int) tile.frameX; + int num3 = 0; + while (frameX2 >= 5000) + { + frameX2 -= 5000; + ++num3; + } + if (num3 != 0) + flag2 = true; + } + if (flag2) + { + damageAmount = 0; + Main.blockMouse = true; + } + } if (!WorldGen.CanKillTile(x, y)) - num1 = 0; - if (Main.getGoodWorld) - num1 *= 2; - if (this.DoesPickTargetTransformOnKill(this.hitTile, num1, x, y, pickPower, tileId, tileTarget)) - num1 = 0; - if (this.hitTile.AddDamage(tileId, num1) >= 100) + damageAmount = 0; + if (this.hitTile.AddDamage(tileId, damageAmount) >= 100) { AchievementsHelper.CurrentlyMining = true; - this.ClearMiningCacheAt(x, y, 1); + this.hitTile.Clear(tileId); if (Main.netMode == 1 && Main.tileContainer[(int) Main.tile[x, y].type]) { - if (Main.tile[x, y].type == (ushort) 470 || Main.tile[x, y].type == (ushort) 475) - { - NetMessage.SendData(17, number: 20, number2: ((float) x), number3: ((float) y)); - } - else - { - WorldGen.KillTile(x, y, true); - NetMessage.SendData(17, number2: ((float) x), number3: ((float) y), number4: 1f); - } + WorldGen.KillTile(x, y, true); + NetMessage.SendData(17, number2: ((float) x), number3: ((float) y), number4: 1f); if (Main.tile[x, y].type == (ushort) 21) NetMessage.SendData(34, number: 1, number2: ((float) x), number3: ((float) y)); if (Main.tile[x, y].type == (ushort) 467) @@ -33975,9 +25436,9 @@ label_106: else { int j = y; - int num2 = Main.tile[x, j].active() ? 1 : 0; + int num4 = Main.tile[x, j].active() ? 1 : 0; WorldGen.KillTile(x, j); - if (num2 != 0 && !Main.tile[x, j].active()) + if (num4 != 0 && !Main.tile[x, j].active()) AchievementsHelper.HandleMining(); if (Main.netMode == 1) NetMessage.SendData(17, number2: ((float) x), number3: ((float) j)); @@ -33988,191 +25449,13 @@ label_106: { WorldGen.KillTile(x, y, true); if (Main.netMode == 1) - { NetMessage.SendData(17, number2: ((float) x), number3: ((float) y), number4: 1f); - NetMessage.SendData(125, number: Main.myPlayer, number2: ((float) x), number3: ((float) y), number4: ((float) num1)); - } } - if (num1 == 0) + if (damageAmount == 0) return; this.hitTile.Prune(); } - private void ClearMiningCacheAt(int x, int y, int hitTileCacheType) - { - this.hitReplace.TryClearingAndPruning(x, y, 1); - this.hitTile.TryClearingAndPruning(x, y, 1); - } - - public bool isNearFairy() - { - if (NPC.npcsFoundForCheckActive[583] || NPC.npcsFoundForCheckActive[584] || NPC.npcsFoundForCheckActive[585]) - { - for (int index = 0; index < 200; ++index) - { - if (Main.npc[index].active && (Main.npc[index].type == 583 || Main.npc[index].type == 584 || Main.npc[index].type == 585) && (double) Vector2.Distance(Main.npc[index].Center, this.Center) < (double) NPC.sWidth) - return true; - } - } - return false; - } - - public bool isNearNPC(int type, float range = -1f) - { - if ((double) range == -1.0) - range = (float) NPC.sWidth; - if (NPC.npcsFoundForCheckActive[type]) - { - for (int index = 0; index < 200; ++index) - { - if (Main.npc[index].active && Main.npc[index].type == type && (double) Vector2.Distance(Main.npc[index].Center, this.Center) < (double) range) - return true; - } - } - return false; - } - - public bool HasEnoughPickPowerToHurtTile(int x, int y) - { - Item bestPickaxe = this.GetBestPickaxe(); - if (bestPickaxe == null) - return false; - Tile tileTarget = Main.tile[x, y]; - int type = (int) tileTarget.type; - return this.GetPickaxeDamage(Player.tileTargetX, Player.tileTargetY, bestPickaxe.pick, type, tileTarget) != 0; - } - - private int GetPickaxeDamage(int x, int y, int pickPower, int tileId, Tile tileTarget) - { - int num1 = 0; - if (Main.tileNoFail[(int) tileTarget.type]) - num1 = 100; - int num2 = Main.tileDungeon[(int) tileTarget.type] || tileTarget.type == (ushort) 25 || tileTarget.type == (ushort) 58 || tileTarget.type == (ushort) 117 || tileTarget.type == (ushort) 203 ? num1 + pickPower / 2 : (tileTarget.type != (ushort) 85 ? (tileTarget.type == (ushort) 48 || tileTarget.type == (ushort) 232 ? num1 + pickPower * 2 : (tileTarget.type != (ushort) 226 ? (tileTarget.type == (ushort) 107 || tileTarget.type == (ushort) 221 ? num1 + pickPower / 2 : (tileTarget.type == (ushort) 108 || tileTarget.type == (ushort) 222 ? num1 + pickPower / 3 : (tileTarget.type == (ushort) 111 || tileTarget.type == (ushort) 223 ? num1 + pickPower / 4 : (tileTarget.type != (ushort) 211 ? num1 + pickPower : num1 + pickPower / 5)))) : num1 + pickPower / 4)) : num1 + pickPower / 3); - if (tileTarget.type == (ushort) 211 && pickPower < 200) - num2 = 0; - if ((tileTarget.type == (ushort) 25 || tileTarget.type == (ushort) 203) && pickPower < 65) - num2 = 0; - else if (tileTarget.type == (ushort) 117 && pickPower < 65) - num2 = 0; - else if (tileTarget.type == (ushort) 37 && pickPower < 50) - num2 = 0; - else if ((tileTarget.type == (ushort) 22 || tileTarget.type == (ushort) 204) && (double) y > Main.worldSurface && pickPower < 55) - num2 = 0; - else if (tileTarget.type == (ushort) 56 && pickPower < 65) - num2 = 0; - else if (tileTarget.type == (ushort) 77 && pickPower < 65 && y >= Main.UnderworldLayer) - num2 = 0; - else if (tileTarget.type == (ushort) 58 && pickPower < 65) - num2 = 0; - else if ((tileTarget.type == (ushort) 226 || tileTarget.type == (ushort) 237) && pickPower < 210) - num2 = 0; - else if (tileTarget.type == (ushort) 137 && pickPower < 210) - { - switch ((int) tileTarget.frameY / 18) - { - case 1: - case 2: - case 3: - case 4: - num2 = 0; - break; - } - } - else if (Main.tileDungeon[(int) tileTarget.type] && pickPower < 100 && (double) y > Main.worldSurface) - { - if ((double) x < (double) Main.maxTilesX * 0.35 || (double) x > (double) Main.maxTilesX * 0.65) - num2 = 0; - } - else if (tileTarget.type == (ushort) 107 && pickPower < 100) - num2 = 0; - else if (tileTarget.type == (ushort) 108 && pickPower < 110) - num2 = 0; - else if (tileTarget.type == (ushort) 111 && pickPower < 150) - num2 = 0; - else if (tileTarget.type == (ushort) 221 && pickPower < 100) - num2 = 0; - else if (tileTarget.type == (ushort) 222 && pickPower < 110) - num2 = 0; - else if (tileTarget.type == (ushort) 223 && pickPower < 150) - num2 = 0; - if (tileTarget.type == (ushort) 147 || tileTarget.type == (ushort) 0 || tileTarget.type == (ushort) 40 || tileTarget.type == (ushort) 53 || tileTarget.type == (ushort) 57 || tileTarget.type == (ushort) 59 || tileTarget.type == (ushort) 123 || tileTarget.type == (ushort) 224 || tileTarget.type == (ushort) 397) - num2 += pickPower; - if (tileTarget.type == (ushort) 404) - num2 += 5; - if (tileTarget.type == (ushort) 165 || Main.tileRope[(int) tileTarget.type] || tileTarget.type == (ushort) 199) - num2 = 100; - if (tileTarget.type == (ushort) 128 || tileTarget.type == (ushort) 269) - { - if (tileTarget.frameX == (short) 18 || tileTarget.frameX == (short) 54) - { - --x; - tileTarget = Main.tile[x, y]; - this.hitTile.UpdatePosition(tileId, x, y); - } - if (tileTarget.frameX >= (short) 100) - { - num2 = 0; - Main.blockMouse = true; - } - } - if (tileTarget.type == (ushort) 334) - { - if (tileTarget.frameY == (short) 0) - { - ++y; - tileTarget = Main.tile[x, y]; - this.hitTile.UpdatePosition(tileId, x, y); - } - if (tileTarget.frameY == (short) 36) - { - --y; - tileTarget = Main.tile[x, y]; - this.hitTile.UpdatePosition(tileId, x, y); - } - int frameX1 = (int) tileTarget.frameX; - bool flag1 = frameX1 >= 5000; - bool flag2 = false; - if (!flag1) - { - int num3 = frameX1 / 18 % 3; - x -= num3; - tileTarget = Main.tile[x, y]; - if (tileTarget.frameX >= (short) 5000) - flag1 = true; - } - if (flag1) - { - int frameX2 = (int) tileTarget.frameX; - int num4 = 0; - while (frameX2 >= 5000) - { - frameX2 -= 5000; - ++num4; - } - if (num4 != 0) - flag2 = true; - } - if (flag2) - { - num2 = 0; - Main.blockMouse = true; - } - } - return num2; - } - - private bool DoesPickTargetTransformOnKill( - HitTile hitCounter, - int damage, - int x, - int y, - int pickPower, - int tileId, - Tile tileTarget) - { - return hitCounter.AddDamage(tileId, damage, false) >= 100 && (tileTarget.type == (ushort) 2 || tileTarget.type == (ushort) 477 || tileTarget.type == (ushort) 492 || tileTarget.type == (ushort) 23 || tileTarget.type == (ushort) 60 || tileTarget.type == (ushort) 70 || tileTarget.type == (ushort) 109 || tileTarget.type == (ushort) 199 || Main.tileMoss[(int) tileTarget.type] || TileID.Sets.tileMossBrick[(int) tileTarget.type]); - } - public bool ItemFitsWeaponRack(Item i) { bool flag = false; @@ -34185,7 +25468,7 @@ label_106: flag = true; break; } - return i.damage > 0 | flag && i.useStyle != 0 && i.stack > 0; + return i.damage > 0 | flag && i.useStyle > 0 && i.stack > 0; } public void PlaceWeapon(int x, int y) @@ -34251,6 +25534,37 @@ label_106: public bool ItemFitsItemFrame(Item i) => i.stack > 0; + public void PlaceItemInFrame(int x, int y) + { + if ((int) Main.tile[x, y].frameX % 36 != 0) + --x; + if ((int) Main.tile[x, y].frameY % 36 != 0) + --y; + int key = TEItemFrame.Find(x, y); + if (key == -1) + return; + if (((TEItemFrame) TileEntity.ByID[key]).item.stack > 0) + { + WorldGen.KillTile(x, y, true); + if (Main.netMode == 1) + NetMessage.SendData(17, number2: ((float) Player.tileTargetX), number3: ((float) y), number4: 1f); + } + if (Main.netMode == 1) + NetMessage.SendData(89, number: x, number2: ((float) y), number3: ((float) this.selectedItem), number4: ((float) this.whoAmI)); + else + TEItemFrame.TryPlacing(x, y, this.inventory[this.selectedItem].netID, (int) this.inventory[this.selectedItem].prefix, this.inventory[this.selectedItem].stack); + --this.inventory[this.selectedItem].stack; + if (this.inventory[this.selectedItem].stack <= 0) + { + this.inventory[this.selectedItem].SetDefaults(); + Main.mouseItem.SetDefaults(); + } + if (this.selectedItem == 58) + Main.mouseItem = this.inventory[this.selectedItem].Clone(); + this.releaseUseItem = false; + this.mouseInterface = true; + } + public Color GetImmuneAlpha(Color newColor, float alphaReduction) { float scale = (float) ((int) byte.MaxValue - this.immuneAlpha) / (float) byte.MaxValue; @@ -34331,14 +25645,12 @@ label_106: int num1 = 0; for (int index = 0; index < 59; ++index) { - if (this.inventory[index].IsACoin) + if (this.inventory[index].type >= 71 && this.inventory[index].type <= 74) { int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, this.inventory[index].type); int num2 = this.inventory[index].stack / 2; if (Main.expertMode) num2 = (int) ((double) this.inventory[index].stack * 0.25); - if (Main.masterMode) - num2 = 0; int num3 = this.inventory[index].stack - num2; this.inventory[index].stack -= num3; if (this.inventory[index].type == 71) @@ -34370,26 +25682,20 @@ label_106: { for (int index = 0; index < 59; ++index) { - if (this.inventory[index].stack > 0) + if (this.inventory[index].stack > 0 && this.inventory[index].Name != "Copper Pickaxe" && this.inventory[index].Name != "Copper Axe" && this.inventory[index].Name != "Copper Shortsword") { - bool flag = true; - if (this.inventory[index].type == 3507 || this.inventory[index].type == 3506 || this.inventory[index].type == 3509) - flag = false; - if (flag) - { - int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, this.inventory[index].type); - Main.item[number].netDefaults(this.inventory[index].netID); - Main.item[number].Prefix((int) this.inventory[index].prefix); - Main.item[number].stack = this.inventory[index].stack; - Main.item[number].velocity.Y = (float) Main.rand.Next(-20, 1) * 0.2f; - Main.item[number].velocity.X = (float) Main.rand.Next(-20, 21) * 0.2f; - Main.item[number].noGrabDelay = 100; - Main.item[number].newAndShiny = false; - if (Main.netMode == 1) - NetMessage.SendData(21, number: number); - } + int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, this.inventory[index].type); + Main.item[number].netDefaults(this.inventory[index].netID); + Main.item[number].Prefix((int) this.inventory[index].prefix); + Main.item[number].stack = this.inventory[index].stack; + Main.item[number].velocity.Y = (float) Main.rand.Next(-20, 1) * 0.2f; + Main.item[number].velocity.X = (float) Main.rand.Next(-20, 21) * 0.2f; + Main.item[number].noGrabDelay = 100; + Main.item[number].newAndShiny = false; + if (Main.netMode == 1) + NetMessage.SendData(21, number: number); } - this.inventory[index].TurnToAir(); + this.inventory[index] = new Item(); if (index < this.armor.Length) { if (this.armor[index].stack > 0) @@ -34422,7 +25728,7 @@ label_106: if (Main.netMode == 1) NetMessage.SendData(21, number: number); } - this.dye[index].TurnToAir(); + this.dye[index] = new Item(); } if (index < this.miscEquips.Length) { @@ -34439,7 +25745,7 @@ label_106: if (Main.netMode == 1) NetMessage.SendData(21, number: number); } - this.miscEquips[index].TurnToAir(); + this.miscEquips[index] = new Item(); } if (index < this.miscDyes.Length) { @@ -34456,7 +25762,7 @@ label_106: if (Main.netMode == 1) NetMessage.SendData(21, number: number); } - this.miscDyes[index].TurnToAir(); + this.miscDyes[index] = new Item(); } } this.inventory[0].SetDefaults(3507); @@ -34465,50 +25771,11 @@ label_106: this.inventory[1].Prefix(-1); this.inventory[2].SetDefaults(3506); this.inventory[2].Prefix(-1); - Main.mouseItem.TurnToAir(); + Main.mouseItem = new Item(); } public object Clone() => this.MemberwiseClone(); - public void CopyVisuals(Player other) - { - this.skinVariant = other.skinVariant; - this.direction = other.direction; - this.selectedItem = other.selectedItem; - this.extraAccessory = other.extraAccessory; - this.skinColor = other.skinColor; - this.eyeColor = other.eyeColor; - this.hair = other.hair; - this.hairColor = other.hairColor; - this.shirtColor = other.shirtColor; - this.underShirtColor = other.underShirtColor; - this.pantsColor = other.pantsColor; - this.shoeColor = other.shoeColor; - this.position = other.position; - this.velocity = other.velocity; - this.statLife = other.statLife; - this.statLifeMax = other.statLifeMax; - this.statLifeMax2 = other.statLifeMax2; - this.statMana = other.statMana; - this.statManaMax = other.statManaMax; - this.statManaMax2 = other.statManaMax2; - this.hideMisc = other.hideMisc; - for (int index = 0; index < 59; ++index) - { - this.inventory[index] = other.inventory[index].Clone(); - if (index < this.armor.Length) - this.armor[index] = other.armor[index].Clone(); - if (index < this.dye.Length) - this.dye[index] = other.dye[index].Clone(); - if (index < this.miscEquips.Length) - this.miscEquips[index] = other.miscEquips[index].Clone(); - if (index < this.miscDyes.Length) - this.miscDyes[index] = other.miscDyes[index].Clone(); - if (index < this.hideVisibleAccessory.Length) - this.hideVisibleAccessory[index] = other.hideVisibleAccessory[index]; - } - } - public object clientClone() { Player player = new Player(); @@ -34516,8 +25783,6 @@ label_106: player.zone2 = this.zone2; player.zone3 = this.zone3; player.zone4 = this.zone4; - player.voidVaultInfo = this.voidVaultInfo; - player.luck = this.luck; player.extraAccessory = this.extraAccessory; player.MinionRestTargetPoint = this.MinionRestTargetPoint; player.MinionAttackTargetNPC = this.MinionAttackTargetNPC; @@ -34534,12 +25799,10 @@ label_106: player.statMana = this.statMana; player.statManaMax = this.statManaMax; player.position.X = this.position.X; - player.tileEntityAnchor = this.tileEntityAnchor; player.chest = this.chest; player.talkNPC = this.talkNPC; - player.hideVisibleAccessory = this.hideVisibleAccessory; + player.hideVisual = this.hideVisual; player.hideMisc = this.hideMisc; - player.shieldRaised = this.shieldRaised; for (int index = 0; index < 59; ++index) { player.inventory[index] = this.inventory[index].Clone(); @@ -34557,8 +25820,6 @@ label_106: player.bank2.item[index] = this.bank2.item[index].Clone(); if (index < this.bank3.item.Length) player.bank3.item[index] = this.bank3.item[index].Clone(); - if (index < this.bank4.item.Length) - player.bank4.item[index] = this.bank4.item[index].Clone(); } player.trashItem = this.trashItem.Clone(); for (int index = 0; index < 22; ++index) @@ -34651,7 +25912,6 @@ label_106: this.spI[0] = Main.worldID; this.spX[0] = x; this.spY[0] = y; - this.FindSpawn(); return; } } @@ -34669,33 +25929,37 @@ label_106: this.spI[0] = Main.worldID; this.spX[0] = x; this.spY[0] = y; - this.FindSpawn(); } public static void SavePlayer(PlayerFileData playerFile, bool skipMapSave = false) { - try - { - Main.Achievements.Save(); - Player.InternalSaveMap(playerFile.IsCloudSave); - if (Main.ServerSideCharacter) - return; - FileUtilities.ProtectedInvoke((Action) (() => Player.InternalSavePlayerFile(playerFile))); - } - catch (Exception ex) - { - string path = playerFile.Path; - FancyErrorPrinter.ShowFileSavingFailError(ex, path); - throw; - } - } - - private static void InternalSavePlayerFile(PlayerFileData playerFile) - { + Main.Achievements.Save(); string path = playerFile.Path; Player player = playerFile.Player; bool isCloudSave = playerFile.IsCloudSave; - if (path == null || path == "") + if (!skipMapSave) + { + if (!string.IsNullOrEmpty(Main.playerPathName)) + { + try + { + if (Main.mapEnabled) + Main.Map.Save(); + } + catch + { + } + try + { + if (!isCloudSave) + Directory.CreateDirectory(Main.PlayerPath); + } + catch + { + } + } + } + if (Main.ServerSideCharacter || path == null || path == "") return; if (FileUtilities.Exists(path, isCloudSave)) FileUtilities.Copy(path, path + ".bak", isCloudSave); @@ -34706,7 +25970,7 @@ label_106: { using (BinaryWriter writer = new BinaryWriter((Stream) cryptoStream)) { - writer.Write(230); + writer.Write(194); playerFile.Metadata.Write(writer); writer.Write(player.name); writer.Write(player.difficulty); @@ -34715,11 +25979,11 @@ label_106: writer.Write(player.hairDye); BitsByte bitsByte1 = (BitsByte) (byte) 0; for (int key = 0; key < 8; ++key) - bitsByte1[key] = player.hideVisibleAccessory[key]; + bitsByte1[key] = player.hideVisual[key]; writer.Write((byte) bitsByte1); BitsByte bitsByte2 = (BitsByte) (byte) 0; for (int key = 0; key < 2; ++key) - bitsByte2[key] = player.hideVisibleAccessory[key + 8]; + bitsByte2[key] = player.hideVisual[key + 8]; writer.Write((byte) bitsByte2); writer.Write((byte) player.hideMisc); writer.Write((byte) player.skinVariant); @@ -34728,8 +25992,6 @@ label_106: writer.Write(player.statMana); writer.Write(player.statManaMax); writer.Write(player.extraAccessory); - writer.Write(player.unlockedBiomeTorches); - writer.Write(player.UsingBiomeTorches); writer.Write(player.downedDD2EventAnyDifficulty); writer.Write(player.taxMoney); writer.Write(player.hairColor.R); @@ -34795,13 +26057,6 @@ label_106: writer.Write(player.bank3.item[index].stack); writer.Write(player.bank3.item[index].prefix); } - for (int index = 0; index < 40; ++index) - { - writer.Write(player.bank4.item[index].netID); - writer.Write(player.bank4.item[index].stack); - writer.Write(player.bank4.item[index].prefix); - } - writer.Write((byte) player.voidVaultInfo); for (int index = 0; index < 22; ++index) { if (Main.buffNoSave[player.buffType[index]]) @@ -34836,15 +26091,6 @@ label_106: for (int index = 0; index < player.builderAccStatus.Length; ++index) writer.Write(player.builderAccStatus[index]); writer.Write(player.bartenderQuestLog); - writer.Write(player.dead); - if (player.dead) - writer.Write(player.respawnTimer); - long binary = DateTime.UtcNow.ToBinary(); - writer.Write(binary); - writer.Write(player.golferScoreAccumulated); - player.creativeTracker.Save(writer); - player.SaveTemporaryItemSlotContents(writer); - CreativePowerManager.Instance.SaveToPlayer(player, writer); writer.Flush(); cryptoStream.FlushFinalBlock(); stream.Flush(); @@ -34856,72 +26102,6 @@ label_106: } } - private void SaveTemporaryItemSlotContents(BinaryWriter writer) - { - Item itemByIndex = Main.CreativeMenu.GetItemByIndex(0); - BitsByte bitsByte = (BitsByte) (byte) 0; - bitsByte[0] = !Main.mouseItem.IsAir; - bitsByte[1] = !itemByIndex.IsAir; - ItemSerializationContext context = ItemSerializationContext.SavingAndLoading; - writer.Write((byte) bitsByte); - if (bitsByte[0]) - Main.mouseItem.Serialize(writer, context); - if (!bitsByte[1]) - return; - itemByIndex.Serialize(writer, context); - } - - private void LoadTemporaryItemSlotContents(BinaryReader reader) - { - BitsByte bitsByte = (BitsByte) reader.ReadByte(); - ItemSerializationContext context = ItemSerializationContext.SavingAndLoading; - if (bitsByte[0]) - { - this._temporaryItemSlots[0] = new Item(); - this._temporaryItemSlots[0].DeserializeFrom(reader, context); - } - if (!bitsByte[1]) - return; - this._temporaryItemSlots[1] = new Item(); - this._temporaryItemSlots[1].DeserializeFrom(reader, context); - } - - public void SetPlayerDataToOutOfClassFields() - { - Item obj1 = new Item(); - if (this._temporaryItemSlots[0] != null) - obj1 = this._temporaryItemSlots[0].Clone(); - Main.mouseItem = obj1; - Item obj2 = new Item(); - if (this._temporaryItemSlots[1] != null) - obj2 = this._temporaryItemSlots[1].Clone(); - Main.CreativeMenu.SetItembyIndex(obj2, 0); - CreativePowerManager.Instance.ApplyLoadedDataToPlayer(this); - } - - public static void ClearPlayerTempInfo() - { - Main.mouseItem.TurnToAir(); - Main.CreativeMenu.GetItemByIndex(0).TurnToAir(); - } - - private static void InternalSaveMap(bool isCloudSave) - { - if (string.IsNullOrEmpty(Main.playerPathName)) - return; - try - { - if (Main.mapEnabled) - Main.Map.Save(); - } - catch - { - } - if (isCloudSave) - return; - Utils.TryCreatingDirectory(Main.PlayerPath); - } - public static PlayerFileData LoadPlayer(string playerPath, bool cloudSave) { PlayerFileData playerFileData = new PlayerFileData(playerPath, cloudSave); @@ -34940,12 +26120,12 @@ label_106: { using (BinaryReader binaryReader = new BinaryReader((Stream) cryptoStream)) { - int num1 = binaryReader.ReadInt32(); - if (num1 >= 135) + int release = binaryReader.ReadInt32(); + if (release >= 135) playerFileData.Metadata = FileMetadata.Read(binaryReader, FileType.Player); else playerFileData.Metadata = FileMetadata.FromCurrentSettings(FileType.Player); - if (num1 > 230) + if (release > 194) { player1.loadStatus = 1; player1.name = binaryReader.ReadString(); @@ -34953,44 +26133,44 @@ label_106: return playerFileData; } player1.name = binaryReader.ReadString(); - if (num1 >= 10) + if (release >= 10) { - if (num1 >= 17) + if (release >= 17) player1.difficulty = binaryReader.ReadByte(); else if (binaryReader.ReadBoolean()) player1.difficulty = (byte) 2; } - if (num1 >= 138) + if (release >= 138) playerFileData.SetPlayTime(new TimeSpan(binaryReader.ReadInt64())); else playerFileData.SetPlayTime(TimeSpan.Zero); player1.hair = binaryReader.ReadInt32(); - if (num1 >= 82) + if (release >= 82) player1.hairDye = binaryReader.ReadByte(); - if (num1 >= 124) + if (release >= 124) { BitsByte bitsByte = (BitsByte) binaryReader.ReadByte(); for (int key = 0; key < 8; ++key) - player1.hideVisibleAccessory[key] = bitsByte[key]; + player1.hideVisual[key] = bitsByte[key]; bitsByte = (BitsByte) binaryReader.ReadByte(); for (int key = 0; key < 2; ++key) - player1.hideVisibleAccessory[key + 8] = bitsByte[key]; + player1.hideVisual[key + 8] = bitsByte[key]; } - else if (num1 >= 83) + else if (release >= 83) { BitsByte bitsByte = (BitsByte) binaryReader.ReadByte(); for (int key = 0; key < 8; ++key) - player1.hideVisibleAccessory[key] = bitsByte[key]; + player1.hideVisual[key] = bitsByte[key]; } - if (num1 >= 119) + if (release >= 119) player1.hideMisc = (BitsByte) binaryReader.ReadByte(); - if (num1 <= 17) + if (release <= 17) player1.Male = player1.hair != 5 && player1.hair != 6 && player1.hair != 9 && player1.hair != 11; - else if (num1 < 107) + else if (release < 107) player1.Male = binaryReader.ReadBoolean(); else player1.skinVariant = (int) binaryReader.ReadByte(); - if (num1 < 161 && player1.skinVariant == 7) + if (release < 161 && player1.skinVariant == 7) player1.skinVariant = 9; player1.statLife = binaryReader.ReadInt32(); player1.statLifeMax = binaryReader.ReadInt32(); @@ -35002,16 +26182,11 @@ label_106: player1.statManaMax = 200; if (player1.statMana > 400) player1.statMana = 400; - if (num1 >= 125) + if (release >= 125) player1.extraAccessory = binaryReader.ReadBoolean(); - if (num1 >= 229) - { - player1.unlockedBiomeTorches = binaryReader.ReadBoolean(); - player1.UsingBiomeTorches = binaryReader.ReadBoolean(); - } - if (num1 >= 182) + if (release >= 182) player1.downedDD2EventAnyDifficulty = binaryReader.ReadBoolean(); - if (num1 >= 128) + if (release >= 128) player1.taxMoney = binaryReader.ReadInt32(); player1.hairColor = binaryReader.ReadRGB(); player1.skinColor = binaryReader.ReadRGB(); @@ -35023,14 +26198,14 @@ label_106: Main.player[Main.myPlayer].shirtColor = player1.shirtColor; Main.player[Main.myPlayer].pantsColor = player1.pantsColor; Main.player[Main.myPlayer].hairColor = player1.hairColor; - if (num1 >= 38) + if (release >= 38) { - if (num1 < 124) + if (release < 124) { - int num2 = 11; - if (num1 >= 81) - num2 = 16; - for (int index1 = 0; index1 < num2; ++index1) + int num = 11; + if (release >= 81) + num = 16; + for (int index1 = 0; index1 < num; ++index1) { int index2 = index1; if (index2 >= 8) @@ -35041,38 +26216,38 @@ label_106: } else { - int num3 = 20; - for (int index = 0; index < num3; ++index) + int num = 20; + for (int index = 0; index < num; ++index) { player1.armor[index].netDefaults(binaryReader.ReadInt32()); player1.armor[index].Prefix((int) binaryReader.ReadByte()); } } - if (num1 >= 47) + if (release >= 47) { - int num4 = 3; - if (num1 >= 81) - num4 = 8; - if (num1 >= 124) - num4 = 10; - for (int index3 = 0; index3 < num4; ++index3) + int num = 3; + if (release >= 81) + num = 8; + if (release >= 124) + num = 10; + for (int index3 = 0; index3 < num; ++index3) { int index4 = index3; player1.dye[index4].netDefaults(binaryReader.ReadInt32()); player1.dye[index4].Prefix((int) binaryReader.ReadByte()); } } - if (num1 >= 58) + if (release >= 58) { for (int index = 0; index < 58; ++index) { int type = binaryReader.ReadInt32(); - if (type >= 5045) + if (type >= 3930) { player1.inventory[index].netDefaults(0); binaryReader.ReadInt32(); - int num5 = (int) binaryReader.ReadByte(); - if (num1 >= 114) + int num = (int) binaryReader.ReadByte(); + if (release >= 114) binaryReader.ReadBoolean(); } else @@ -35080,7 +26255,7 @@ label_106: player1.inventory[index].netDefaults(type); player1.inventory[index].stack = binaryReader.ReadInt32(); player1.inventory[index].Prefix((int) binaryReader.ReadByte()); - if (num1 >= 114) + if (release >= 114) player1.inventory[index].favorited = binaryReader.ReadBoolean(); } } @@ -35090,11 +26265,11 @@ label_106: for (int index = 0; index < 48; ++index) { int type = binaryReader.ReadInt32(); - if (type >= 5045) + if (type >= 3930) { player1.inventory[index].netDefaults(0); binaryReader.ReadInt32(); - int num6 = (int) binaryReader.ReadByte(); + int num = (int) binaryReader.ReadByte(); } else { @@ -35104,19 +26279,19 @@ label_106: } } } - if (num1 >= 117) + if (release >= 117) { - if (num1 < 136) + if (release < 136) { for (int index = 0; index < 5; ++index) { if (index != 1) { int type1 = binaryReader.ReadInt32(); - if (type1 >= 5045) + if (type1 >= 3930) { player1.miscEquips[index].netDefaults(0); - int num7 = (int) binaryReader.ReadByte(); + int num = (int) binaryReader.ReadByte(); } else { @@ -35124,10 +26299,10 @@ label_106: player1.miscEquips[index].Prefix((int) binaryReader.ReadByte()); } int type2 = binaryReader.ReadInt32(); - if (type2 >= 5045) + if (type2 >= 3930) { player1.miscDyes[index].netDefaults(0); - int num8 = (int) binaryReader.ReadByte(); + int num = (int) binaryReader.ReadByte(); } else { @@ -35142,10 +26317,10 @@ label_106: for (int index = 0; index < 5; ++index) { int type3 = binaryReader.ReadInt32(); - if (type3 >= 5045) + if (type3 >= 3930) { player1.miscEquips[index].netDefaults(0); - int num9 = (int) binaryReader.ReadByte(); + int num = (int) binaryReader.ReadByte(); } else { @@ -35153,10 +26328,10 @@ label_106: player1.miscEquips[index].Prefix((int) binaryReader.ReadByte()); } int type4 = binaryReader.ReadInt32(); - if (type4 >= 5045) + if (type4 >= 3930) { player1.miscDyes[index].netDefaults(0); - int num10 = (int) binaryReader.ReadByte(); + int num = (int) binaryReader.ReadByte(); } else { @@ -35166,7 +26341,7 @@ label_106: } } } - if (num1 >= 58) + if (release >= 58) { for (int index = 0; index < 40; ++index) { @@ -35196,7 +26371,7 @@ label_106: player1.bank2.item[index].Prefix((int) binaryReader.ReadByte()); } } - if (num1 >= 182) + if (release >= 182) { for (int index = 0; index < 40; ++index) { @@ -35205,71 +26380,60 @@ label_106: player1.bank3.item[index].Prefix((int) binaryReader.ReadByte()); } } - if (num1 >= 198) - { - for (int index = 0; index < 40; ++index) - { - player1.bank4.item[index].netDefaults(binaryReader.ReadInt32()); - player1.bank4.item[index].stack = binaryReader.ReadInt32(); - player1.bank4.item[index].Prefix((int) binaryReader.ReadByte()); - } - } - if (num1 >= 199) - player1.voidVaultInfo = (BitsByte) binaryReader.ReadByte(); } else { for (int index = 0; index < 8; ++index) { - player1.armor[index].SetDefaults((int) ItemID.FromLegacyName(binaryReader.ReadString(), num1)); - if (num1 >= 36) + player1.armor[index].SetDefaults((int) ItemID.FromLegacyName(binaryReader.ReadString(), release)); + if (release >= 36) player1.armor[index].Prefix((int) binaryReader.ReadByte()); } - if (num1 >= 6) + if (release >= 6) { for (int index = 8; index < 11; ++index) { - player1.armor[index].SetDefaults((int) ItemID.FromLegacyName(binaryReader.ReadString(), num1)); - if (num1 >= 36) + player1.armor[index].SetDefaults((int) ItemID.FromLegacyName(binaryReader.ReadString(), release)); + if (release >= 36) player1.armor[index].Prefix((int) binaryReader.ReadByte()); } } for (int index = 0; index < 44; ++index) { - player1.inventory[index].SetDefaults((int) ItemID.FromLegacyName(binaryReader.ReadString(), num1)); + player1.inventory[index].SetDefaults((int) ItemID.FromLegacyName(binaryReader.ReadString(), release)); player1.inventory[index].stack = binaryReader.ReadInt32(); - if (num1 >= 36) + if (release >= 36) player1.inventory[index].Prefix((int) binaryReader.ReadByte()); } - if (num1 >= 15) + if (release >= 15) { for (int index = 44; index < 48; ++index) { - player1.inventory[index].SetDefaults((int) ItemID.FromLegacyName(binaryReader.ReadString(), num1)); + player1.inventory[index].SetDefaults((int) ItemID.FromLegacyName(binaryReader.ReadString(), release)); player1.inventory[index].stack = binaryReader.ReadInt32(); - if (num1 >= 36) + if (release >= 36) player1.inventory[index].Prefix((int) binaryReader.ReadByte()); } } for (int index = 0; index < 20; ++index) { - player1.bank.item[index].SetDefaults((int) ItemID.FromLegacyName(binaryReader.ReadString(), num1)); + player1.bank.item[index].SetDefaults((int) ItemID.FromLegacyName(binaryReader.ReadString(), release)); player1.bank.item[index].stack = binaryReader.ReadInt32(); - if (num1 >= 36) + if (release >= 36) player1.bank.item[index].Prefix((int) binaryReader.ReadByte()); } - if (num1 >= 20) + if (release >= 20) { for (int index = 0; index < 20; ++index) { - player1.bank2.item[index].SetDefaults((int) ItemID.FromLegacyName(binaryReader.ReadString(), num1)); + player1.bank2.item[index].SetDefaults((int) ItemID.FromLegacyName(binaryReader.ReadString(), release)); player1.bank2.item[index].stack = binaryReader.ReadInt32(); - if (num1 >= 36) + if (release >= 36) player1.bank2.item[index].Prefix((int) binaryReader.ReadByte()); } } } - if (num1 < 58) + if (release < 58) { for (int index = 40; index < 48; ++index) { @@ -35277,28 +26441,28 @@ label_106: player1.inventory[index].SetDefaults(); } } - if (num1 >= 11) + if (release >= 11) { - int num11 = 22; - if (num1 < 74) - num11 = 10; - for (int index = 0; index < num11; ++index) + int num = 22; + if (release < 74) + num = 10; + for (int index = 0; index < num; ++index) { player1.buffType[index] = binaryReader.ReadInt32(); player1.buffTime[index] = binaryReader.ReadInt32(); if (player1.buffType[index] == 0) { --index; - --num11; + --num; } } } for (int index = 0; index < 200; ++index) { - int num12 = binaryReader.ReadInt32(); - if (num12 != -1) + int num = binaryReader.ReadInt32(); + if (num != -1) { - player1.spX[index] = num12; + player1.spX[index] = num; player1.spY[index] = binaryReader.ReadInt32(); player1.spI[index] = binaryReader.ReadInt32(); player1.spN[index] = binaryReader.ReadString(); @@ -35306,56 +26470,45 @@ label_106: else break; } - if (num1 >= 16) + if (release >= 16) player1.hbLocked = binaryReader.ReadBoolean(); - if (num1 >= 115) + if (release >= 115) { - int num13 = 13; - for (int index = 0; index < num13; ++index) + int num = 13; + for (int index = 0; index < num; ++index) player1.hideInfo[index] = binaryReader.ReadBoolean(); } - if (num1 >= 98) + if (release >= 98) player1.anglerQuestsFinished = binaryReader.ReadInt32(); - if (num1 >= 162) + if (release >= 162) { for (int index = 0; index < 4; ++index) player1.DpadRadial.Bindings[index] = binaryReader.ReadInt32(); } - if (num1 >= 164) + if (release >= 164) { - int num14 = 8; - if (num1 >= 167) - num14 = 10; - if (num1 >= 197) - num14 = 11; - if (num1 >= 230) - num14 = 12; - for (int index = 0; index < num14; ++index) + int num = 8; + if (release >= 167) + num = 10; + for (int index = 0; index < num; ++index) player1.builderAccStatus[index] = binaryReader.ReadInt32(); - if (num1 < 210) - player1.builderAccStatus[0] = 1; } - if (num1 >= 181) + if (release >= 181) player1.bartenderQuestLog = binaryReader.ReadInt32(); - if (num1 >= 200) + player1.skinVariant = (int) MathHelper.Clamp((float) player1.skinVariant, 0.0f, 9f); + for (int index = 3; index < 8 + player1.extraAccessorySlots; ++index) { - player1.dead = binaryReader.ReadBoolean(); - if (player1.dead) - player1.respawnTimer = Utils.Clamp(binaryReader.ReadInt32(), 0, 60000); + int type = player1.armor[index].type; + if (type == 908) + player1.lavaMax += 420; + if (type == 906) + player1.lavaMax += 420; + if (player1.wingsLogic == 0 && player1.armor[index].wingSlot >= (sbyte) 0) + player1.wingsLogic = (int) player1.armor[index].wingSlot; + if (type == 158 || type == 396 || type == 1250 || type == 1251 || type == 1252) + player1.noFallDmg = true; + player1.lavaTime = player1.lavaMax; } - player1.lastTimePlayerWasSaved = 0L; - player1.lastTimePlayerWasSaved = num1 < 202 ? DateTime.UtcNow.ToBinary() : binaryReader.ReadInt64(); - if (num1 >= 206) - player1.golferScoreAccumulated = binaryReader.ReadInt32(); - if (num1 >= 218) - player1.creativeTracker.Load(binaryReader, num1); - if (num1 >= 214) - player1.LoadTemporaryItemSlotContents(binaryReader); - player1.savedPerPlayerFieldsThatArentInThePlayerClass = new Player.SavedPlayerDataWithAnnoyingRules(); - CreativePowerManager.Instance.ResetDataForNewPlayer(player1); - if (num1 >= 220) - CreativePowerManager.Instance.LoadToPlayer(player1, binaryReader, num1); - Player.LoadPlayer_LastMinuteFixes(player1); } } } @@ -35382,38 +26535,6 @@ label_106: return playerFileData; } - private static void AdjustRespawnTimerForWorldJoining(Player newPlayer) - { - if (Main.myPlayer != newPlayer.whoAmI || !newPlayer.dead) - return; - long ticks = DateTime.UtcNow.ToBinary() - newPlayer.lastTimePlayerWasSaved; - if (ticks <= 0L) - return; - int num = Utils.Clamp((int) (Utils.Clamp(new TimeSpan(ticks).TotalSeconds, 0.0, 1000.0) * 60.0), 0, newPlayer.respawnTimer); - newPlayer.respawnTimer -= num; - if (newPlayer.respawnTimer != 0) - return; - newPlayer.dead = false; - } - - private static void LoadPlayer_LastMinuteFixes(Player newPlayer) - { - newPlayer.skinVariant = (int) MathHelper.Clamp((float) newPlayer.skinVariant, 0.0f, 11f); - for (int index = 3; index < 10; ++index) - { - int type = newPlayer.armor[index].type; - if (type == 908 || type == 4874 || type == 5000) - newPlayer.lavaMax += 420; - if (type == 906 || type == 4038) - newPlayer.lavaMax += 420; - if (newPlayer.wingsLogic == 0 && newPlayer.armor[index].wingSlot >= (sbyte) 0) - newPlayer.wingsLogic = (int) newPlayer.armor[index].wingSlot; - if (type == 158 || type == 396 || type == 1250 || type == 1251 || type == 1252) - newPlayer.noFallDmg = true; - newPlayer.lavaTime = newPlayer.lavaMax; - } - } - public static PlayerFileData GetFileData(string file, bool cloudSave) { if (file == null || cloudSave && SocialAPI.Cloud == null) @@ -35487,8 +26608,6 @@ label_106: this.bodyFrame.Height = 56; this.legFrame.Width = 40; this.legFrame.Height = 56; - this.tileEntityAnchor.Clear(); - this.doorHelper = new DoorOpeningHelper(); for (int index = 0; index < 59; ++index) { if (index < this.armor.Length) @@ -35500,7 +26619,6 @@ label_106: this.bank.item[index] = new Item(); this.bank2.item[index] = new Item(); this.bank3.item[index] = new Item(); - this.bank4.item[index] = new Item(); } for (int index = 0; index < this.dye.Length; ++index) this.dye[index] = new Item(); @@ -35509,117 +26627,21 @@ label_106: for (int index = 0; index < this.miscDyes.Length; ++index) this.miscDyes[index] = new Item(); this.trashItem = new Item(); - this.lastVisualizedSelectedItem = new Item(); this.grappling[0] = -1; + this.inventory[0].SetDefaults(3507); + this.inventory[1].SetDefaults(3509); + this.inventory[2].SetDefaults(3506); this.statManaMax = 20; this.extraAccessory = false; - for (int index = 0; index < 623; ++index) + if (Main.cEd) + this.inventory[3].SetDefaults(603); + for (int index = 0; index < 470; ++index) { this.adjTile[index] = false; this.oldAdjTile[index] = false; } this.hitTile = new HitTile(); - this.hitReplace = new HitTile(); this.mount = new Mount(); - this.talkNPC = -1; - this.creativeTracker = new CreativeUnlocksTracker(); - } - - public void MagicConch() - { - bool flag1 = (double) this.position.X / 16.0 < (double) (Main.maxTilesX / 2); - int num1 = 50; - int num2 = 50; - int num3 = WorldGen.beachDistance - num1 - num2; - int num4 = !flag1 ? num3 - num2 / 2 : Main.maxTilesX - num3 - 1 - num2; - double num5 = (double) Main.maxTilesY / 1200.0; - double num6 = (double) Main.maxTilesY / 1200.0; - Player.RandomTeleportationAttemptSettings teleportationAttemptSettings = new Player.RandomTeleportationAttemptSettings() - { - avoidAnyLiquid = true, - avoidHurtTiles = true, - attemptsBeforeGivingUp = 1000, - maximumFallDistanceFromOrignalPoint = 300 - }; - Vector2 vector2 = Vector2.Zero; - int directionInt = flag1.ToDirectionInt(); - int startX1 = flag1 ? Main.maxTilesX - 50 : 50; - bool flag2 = true; - Point landingPoint; - if (!TeleportHelpers.RequestMagicConchTeleportPosition(this, -directionInt, startX1, out landingPoint)) - { - flag2 = false; - int startX2 = !flag1 ? Main.maxTilesX - 50 : 50; - if (TeleportHelpers.RequestMagicConchTeleportPosition(this, directionInt, startX2, out landingPoint)) - flag2 = true; - } - if (flag2) - vector2 = landingPoint.ToWorldCoordinates(autoAddY: 16f) - new Vector2((float) (this.width / 2), (float) this.height); - if (flag2) - { - Vector2 newPos = vector2; - this.Teleport(newPos, 5); - this.velocity = Vector2.Zero; - if (Main.netMode != 2) - return; - RemoteClient.CheckSection(this.whoAmI, this.position); - NetMessage.SendData(65, number2: ((float) this.whoAmI), number3: newPos.X, number4: newPos.Y, number5: 5); - } - else - { - Vector2 position = this.position; - this.Teleport(position, 5); - this.velocity = Vector2.Zero; - if (Main.netMode != 2) - return; - RemoteClient.CheckSection(this.whoAmI, this.position); - NetMessage.SendData(65, number2: ((float) this.whoAmI), number3: position.X, number4: position.Y, number5: 5, number6: 1); - } - } - - public void DemonConch() - { - bool canSpawn = false; - int num = Main.maxTilesX / 2; - int teleportRangeX1 = 100; - int teleportRangeX2 = teleportRangeX1 / 2; - int teleportStartY = Main.UnderworldLayer + 20; - int teleportRangeY = 80; - Player.RandomTeleportationAttemptSettings settings = new Player.RandomTeleportationAttemptSettings() - { - mostlySolidFloor = true, - avoidAnyLiquid = true, - avoidLava = true, - avoidHurtTiles = true, - avoidWalls = true, - attemptsBeforeGivingUp = 1000, - maximumFallDistanceFromOrignalPoint = 30 - }; - Vector2 vector2 = this.CheckForGoodTeleportationSpot(ref canSpawn, num - teleportRangeX2, teleportRangeX1, teleportStartY, teleportRangeY, settings); - if (!canSpawn) - vector2 = this.CheckForGoodTeleportationSpot(ref canSpawn, num - teleportRangeX1, teleportRangeX2, teleportStartY, teleportRangeY, settings); - if (!canSpawn) - vector2 = this.CheckForGoodTeleportationSpot(ref canSpawn, num + teleportRangeX2, teleportRangeX2, teleportStartY, teleportRangeY, settings); - if (canSpawn) - { - Vector2 newPos = vector2; - this.Teleport(newPos, 7); - this.velocity = Vector2.Zero; - if (Main.netMode != 2) - return; - RemoteClient.CheckSection(this.whoAmI, this.position); - NetMessage.SendData(65, number2: ((float) this.whoAmI), number3: newPos.X, number4: newPos.Y, number5: 7); - } - else - { - Vector2 position = this.position; - this.Teleport(position, 7); - this.velocity = Vector2.Zero; - if (Main.netMode != 2) - return; - RemoteClient.CheckSection(this.whoAmI, this.position); - NetMessage.SendData(65, number2: ((float) this.whoAmI), number3: position.X, number4: position.Y, number5: 7, number6: 1); - } } public void TeleportationPotion() @@ -35628,96 +26650,64 @@ label_106: int teleportStartX = 100; int teleportRangeX = Main.maxTilesX - 200; int teleportStartY = 100; - int underworldLayer = Main.UnderworldLayer; - Vector2 vector2 = this.CheckForGoodTeleportationSpot(ref canSpawn, teleportStartX, teleportRangeX, teleportStartY, underworldLayer, new Player.RandomTeleportationAttemptSettings() - { - avoidLava = true, - avoidHurtTiles = true, - maximumFallDistanceFromOrignalPoint = 100, - attemptsBeforeGivingUp = 1000 - }); - if (canSpawn) - { - Vector2 newPos = vector2; - this.Teleport(newPos, 2); - this.velocity = Vector2.Zero; - if (Main.netMode != 2) - return; - RemoteClient.CheckSection(this.whoAmI, this.position); - NetMessage.SendData(65, number2: ((float) this.whoAmI), number3: newPos.X, number4: newPos.Y, number5: 2); - } - else - { - Vector2 position = this.position; - this.Teleport(position, 2); - this.velocity = Vector2.Zero; - if (Main.netMode != 2) - return; - RemoteClient.CheckSection(this.whoAmI, this.position); - NetMessage.SendData(65, number2: ((float) this.whoAmI), number3: position.X, number4: position.Y, number5: 2, number6: 1); - } + int teleportRangeY = Main.maxTilesY - 200; + Vector2 vector2 = this.TestTeleport(ref canSpawn, teleportStartX, teleportRangeX, teleportStartY, teleportRangeY); + if (!canSpawn) + return; + Vector2 newPos = vector2; + this.Teleport(newPos, 2); + this.velocity = Vector2.Zero; + if (Main.netMode != 2) + return; + RemoteClient.CheckSection(this.whoAmI, this.position); + NetMessage.SendData(65, number2: ((float) this.whoAmI), number3: newPos.X, number4: newPos.Y, number5: 3); } - private Vector2 CheckForGoodTeleportationSpot( + private Vector2 TestTeleport( ref bool canSpawn, int teleportStartX, int teleportRangeX, int teleportStartY, - int teleportRangeY, - Player.RandomTeleportationAttemptSettings settings) + int teleportRangeY) { int num1 = 0; int num2 = 0; int num3 = 0; int width = this.width; Vector2 Position = new Vector2((float) num2, (float) num3) * 16f + new Vector2((float) (-width / 2 + 8), (float) -this.height); - while (!canSpawn && num1 < settings.attemptsBeforeGivingUp) + while (!canSpawn && num1 < 1000) { ++num1; - int num4 = teleportStartX + Main.rand.Next(teleportRangeX); - int num5 = teleportStartY + Main.rand.Next(teleportRangeY); - int num6 = 5; - int index1 = (int) MathHelper.Clamp((float) num4, (float) num6, (float) (Main.maxTilesX - num6)); - int index2 = (int) MathHelper.Clamp((float) num5, (float) num6, (float) (Main.maxTilesY - num6)); + int index1 = teleportStartX + Main.rand.Next(teleportRangeX); + int index2 = teleportStartY + Main.rand.Next(teleportRangeY); Position = new Vector2((float) index1, (float) index2) * 16f + new Vector2((float) (-width / 2 + 8), (float) -this.height); if (!Collision.SolidCollision(Position, width, this.height)) { if (Main.tile[index1, index2] == null) Main.tile[index1, index2] = new Tile(); - if ((!settings.avoidWalls || Main.tile[index1, index2].wall <= (ushort) 0) && (Main.tile[index1, index2].wall != (ushort) 87 || (double) index2 <= Main.worldSurface || NPC.downedPlantBoss) && (!Main.wallDungeon[(int) Main.tile[index1, index2].wall] || (double) index2 <= Main.worldSurface || NPC.downedBoss3)) + if ((Main.tile[index1, index2].wall != (byte) 87 || (double) index2 <= Main.worldSurface || NPC.downedPlantBoss) && (!Main.wallDungeon[(int) Main.tile[index1, index2].wall] || (double) index2 <= Main.worldSurface || NPC.downedBoss3)) { - int num7 = 0; - while (num7 < settings.maximumFallDistanceFromOrignalPoint) + int num4 = 0; + while (num4 < 100) { - if (Main.tile[index1, index2 + num7] == null) - Main.tile[index1, index2 + num7] = new Tile(); - Tile tile = Main.tile[index1, index2 + num7]; - Position = new Vector2((float) index1, (float) (index2 + num7)) * 16f + new Vector2((float) (-width / 2 + 8), (float) -this.height); - Collision.SlopeCollision(Position, this.velocity, width, this.height, this.gravDir); - if (!Collision.SolidCollision(Position, width, this.height)) - ++num7; + if (Main.tile[index1, index2 + num4] == null) + Main.tile[index1, index2 + num4] = new Tile(); + Tile tile = Main.tile[index1, index2 + num4]; + Position = new Vector2((float) index1, (float) (index2 + num4)) * 16f + new Vector2((float) (-width / 2 + 8), (float) -this.height); + Vector4 vector4 = Collision.SlopeCollision(Position, this.velocity, width, this.height, this.gravDir); + int num5 = !Collision.SolidCollision(Position, width, this.height) ? 1 : 0; + int num6 = (double) vector4.Z != (double) this.velocity.X || (double) vector4.Y != (double) this.velocity.Y || (double) vector4.X != (double) Position.X ? 0 : ((double) vector4.Y == (double) Position.Y ? 1 : 0); + if (num5 != 0) + ++num4; else if (!tile.active() || tile.inActive() || !Main.tileSolid[(int) tile.type]) - ++num7; + ++num4; else break; } - Position.Y -= 16f; - int i1 = (int) Position.X / 16; - int j1 = (int) Position.Y / 16; - int i2 = (int) ((double) Position.X + (double) width * 0.5) / 16; - int j2 = (int) ((double) Position.Y + (double) this.height) / 16; - Tile tileSafely1 = Framing.GetTileSafely(i1, j1); - Tile tileSafely2 = Framing.GetTileSafely(i2, j2); - if (!settings.avoidAnyLiquid || tileSafely2.liquid <= (byte) 0) + if (!Collision.LavaCollision(Position, width, this.height) && (double) Collision.HurtTiles(Position, this.velocity, width, this.height).Y <= 0.0) { - if (settings.mostlySolidFloor) - { - Tile tileSafely3 = Framing.GetTileSafely(i2 - 1, j2); - Tile tileSafely4 = Framing.GetTileSafely(i2 + 1, j2); - if ((!tileSafely3.active() || tileSafely3.inActive() || !Main.tileSolid[(int) tileSafely3.type] || Main.tileSolidTop[(int) tileSafely3.type] || !tileSafely4.active() || tileSafely4.inActive() || !Main.tileSolid[(int) tileSafely4.type] ? 0 : (!Main.tileSolidTop[(int) tileSafely4.type] ? 1 : 0)) == 0) - continue; - } - if ((!settings.avoidWalls || tileSafely1.wall <= (ushort) 0) && (!settings.avoidAnyLiquid || !Collision.WetCollision(Position, width, this.height)) && (!settings.avoidLava || !Collision.LavaCollision(Position, width, this.height)) && (!settings.avoidHurtTiles || (double) Collision.HurtTiles(Position, this.velocity, width, this.height).Y <= 0.0) && !Collision.SolidCollision(Position, width, this.height) && num7 < settings.maximumFallDistanceFromOrignalPoint - 1) + Collision.SlopeCollision(Position, this.velocity, width, this.height, this.gravDir); + if (Collision.SolidCollision(Position, width, this.height) && num4 < 99) { Vector2 Velocity1 = Vector2.UnitX * 16f; if (!(Collision.TileCollision(Position - Velocity1, Velocity1, this.width, this.height, gravDir: ((int) this.gravDir)) != Velocity1)) @@ -35732,7 +26722,7 @@ label_106: if (!(Collision.TileCollision(Position - Velocity4, Velocity4, this.width, this.height, gravDir: ((int) this.gravDir)) != Velocity4)) { canSpawn = true; - int num8 = index2 + num7; + int num7 = index2 + num4; break; } } @@ -35750,194 +26740,120 @@ label_106: { Item newItem1 = new Item(); newItem1.type = 0; - int anglerQuestsFinished = this.anglerQuestsFinished; float num1 = 1f; - float num2 = (anglerQuestsFinished > 50 ? (anglerQuestsFinished > 100 ? (anglerQuestsFinished > 150 ? 0.15f : (float) (0.25 - (double) (anglerQuestsFinished - 100) * (1.0 / 500.0))) : (float) (0.5 - (double) (anglerQuestsFinished - 50) * 0.00499999988824129)) : num1 - (float) anglerQuestsFinished * 0.01f) * 0.9f * ((float) (this.currentShoppingSettings.PriceAdjustment + 1.0) / 2f); - switch (anglerQuestsFinished) + if (this.anglerQuestsFinished <= 50) + num1 -= (float) this.anglerQuestsFinished * 0.01f; + else if (this.anglerQuestsFinished <= 100) + num1 = (float) (0.5 - (double) (this.anglerQuestsFinished - 50) * 0.00499999988824129); + else if (this.anglerQuestsFinished <= 150) + num1 = (float) (0.25 - (double) (this.anglerQuestsFinished - 100) * (1.0 / 500.0)); + if (this.anglerQuestsFinished == 5) + newItem1.SetDefaults(2428); + else if (this.anglerQuestsFinished == 10) + newItem1.SetDefaults(2367); + else if (this.anglerQuestsFinished == 15) + newItem1.SetDefaults(2368); + else if (this.anglerQuestsFinished == 20) + newItem1.SetDefaults(2369); + else if (this.anglerQuestsFinished == 30) + newItem1.SetDefaults(2294); + else if (this.anglerQuestsFinished > 75 && Main.rand.Next((int) (250.0 * (double) num1)) == 0) + newItem1.SetDefaults(2294); + else if (Main.hardMode && this.anglerQuestsFinished > 25 && Main.rand.Next((int) (100.0 * (double) num1)) == 0) + newItem1.SetDefaults(2422); + else if (Main.hardMode && this.anglerQuestsFinished > 10 && Main.rand.Next((int) (70.0 * (double) num1)) == 0) + newItem1.SetDefaults(2494); + else if (Main.hardMode && this.anglerQuestsFinished > 10 && Main.rand.Next((int) (70.0 * (double) num1)) == 0) + newItem1.SetDefaults(3031); + else if (Main.hardMode && this.anglerQuestsFinished > 10 && Main.rand.Next((int) (70.0 * (double) num1)) == 0) + newItem1.SetDefaults(3032); + else if (Main.rand.Next((int) (80.0 * (double) num1)) == 0) + newItem1.SetDefaults(3183); + else if (Main.rand.Next((int) (60.0 * (double) num1)) == 0) + newItem1.SetDefaults(2360); + else if (Main.rand.Next((int) (40.0 * (double) num1)) == 0) + newItem1.SetDefaults(2373); + else if (Main.rand.Next((int) (40.0 * (double) num1)) == 0) + newItem1.SetDefaults(2374); + else if (Main.rand.Next((int) (40.0 * (double) num1)) == 0) + newItem1.SetDefaults(2375); + else if (Main.rand.Next((int) (40.0 * (double) num1)) == 0) + newItem1.SetDefaults(3120); + else if (Main.rand.Next((int) (40.0 * (double) num1)) == 0) + newItem1.SetDefaults(3037); + else if (Main.rand.Next((int) (40.0 * (double) num1)) == 0) + newItem1.SetDefaults(3096); + else if (Main.rand.Next((int) (40.0 * (double) num1)) == 0) + newItem1.SetDefaults(2417); + else if (Main.rand.Next((int) (40.0 * (double) num1)) == 0) { - case 5: - newItem1.SetDefaults(2428); - break; - case 10: - newItem1.SetDefaults(2367); - break; - case 15: - newItem1.SetDefaults(2368); - break; - case 20: - newItem1.SetDefaults(2369); - break; - case 30: - newItem1.SetDefaults(2294); - break; - default: - List itemIdsOfAccsWeWant1 = new List() - { - 2373, - 2374, - 2375 - }; - List itemIdsOfAccsWeWant2 = new List() - { - 3120, - 3037, - 3096 - }; - if (anglerQuestsFinished > 75 && Main.rand.Next((int) (250.0 * (double) num2)) == 0) - { - newItem1.SetDefaults(2294); + newItem1.SetDefaults(2498); + } + else + { + switch (Main.rand.Next(70)) + { + case 0: + newItem1.SetDefaults(2442); break; - } - if (Main.hardMode && anglerQuestsFinished > 25 && Main.rand.Next((int) (100.0 * (double) num2)) == 0) - { - newItem1.SetDefaults(2422); + case 1: + newItem1.SetDefaults(2443); break; - } - if (Main.hardMode && anglerQuestsFinished > 10 && Main.rand.Next((int) (70.0 * (double) num2)) == 0) - { - newItem1.SetDefaults(2494); + case 2: + newItem1.SetDefaults(2444); break; - } - if (Main.hardMode && anglerQuestsFinished > 10 && Main.rand.Next((int) (70.0 * (double) num2)) == 0) - { - newItem1.SetDefaults(3031); + case 3: + newItem1.SetDefaults(2445); break; - } - if (Main.hardMode && anglerQuestsFinished > 10 && Main.rand.Next((int) (70.0 * (double) num2)) == 0) - { - newItem1.SetDefaults(3032); + case 4: + newItem1.SetDefaults(2497); break; - } - if (Main.rand.Next((int) (80.0 * (double) num2)) == 0) - { - newItem1.SetDefaults(3183); + case 5: + newItem1.SetDefaults(2495); break; - } - if (Main.rand.Next((int) (60.0 * (double) num2)) == 0) - { - newItem1.SetDefaults(2360); + case 6: + newItem1.SetDefaults(2446); break; - } - if (Main.rand.Next((int) (60.0 * (double) num2)) == 0) - { - newItem1.SetDefaults(4067); + case 7: + newItem1.SetDefaults(2447); break; - } - bool botheredRollingForADrop1; - int itemIdToDrop1; - if (this.DropAnglerAccByMissing(itemIdsOfAccsWeWant1, (int) (40.0 * (double) num2), out botheredRollingForADrop1, out itemIdToDrop1)) - { - newItem1.SetDefaults(itemIdToDrop1); + case 8: + newItem1.SetDefaults(2448); break; - } - if (!botheredRollingForADrop1 && Main.rand.Next((int) (40.0 * (double) num2)) == 0) - { - newItem1.SetDefaults(2373); + case 9: + newItem1.SetDefaults(2449); break; - } - if (!botheredRollingForADrop1 && Main.rand.Next((int) (40.0 * (double) num2)) == 0) - { - newItem1.SetDefaults(2374); + case 10: + newItem1.SetDefaults(2490); break; - } - if (!botheredRollingForADrop1 && Main.rand.Next((int) (40.0 * (double) num2)) == 0) - { - newItem1.SetDefaults(2375); + case 11: + newItem1.SetDefaults(2435); + newItem1.stack = Main.rand.Next(50, 151); break; - } - bool botheredRollingForADrop2; - int itemIdToDrop2; - if (this.DropAnglerAccByMissing(itemIdsOfAccsWeWant2, (int) (30.0 * (double) num2), out botheredRollingForADrop2, out itemIdToDrop2)) - { - newItem1.SetDefaults(itemIdToDrop2); + case 12: + newItem1.SetDefaults(2496); break; - } - if (!botheredRollingForADrop2 && Main.rand.Next((int) (30.0 * (double) num2)) == 0) - { - newItem1.SetDefaults(3120); + default: + switch (Main.rand.Next(3)) + { + case 0: + newItem1.SetDefaults(2354); + newItem1.stack = Main.rand.Next(2, 6); + break; + case 1: + newItem1.SetDefaults(2355); + newItem1.stack = Main.rand.Next(2, 6); + break; + default: + newItem1.SetDefaults(2356); + newItem1.stack = Main.rand.Next(2, 6); + break; + } break; - } - if (!botheredRollingForADrop2 && Main.rand.Next((int) (30.0 * (double) num2)) == 0) - { - newItem1.SetDefaults(3037); - break; - } - if (!botheredRollingForADrop2 && Main.rand.Next((int) (30.0 * (double) num2)) == 0) - { - newItem1.SetDefaults(3096); - break; - } - if (Main.rand.Next((int) (40.0 * (double) num2)) == 0) - { - newItem1.SetDefaults(2417); - break; - } - if (Main.rand.Next((int) (40.0 * (double) num2)) == 0) - { - newItem1.SetDefaults(2498); - break; - } - switch (Main.rand.Next(70)) - { - case 0: - newItem1.SetDefaults(2442); - break; - case 1: - newItem1.SetDefaults(2443); - break; - case 2: - newItem1.SetDefaults(2444); - break; - case 3: - newItem1.SetDefaults(2445); - break; - case 4: - newItem1.SetDefaults(2497); - break; - case 5: - newItem1.SetDefaults(2495); - break; - case 6: - newItem1.SetDefaults(2446); - break; - case 7: - newItem1.SetDefaults(2447); - break; - case 8: - newItem1.SetDefaults(2448); - break; - case 9: - newItem1.SetDefaults(2449); - break; - case 10: - newItem1.SetDefaults(2490); - break; - case 12: - newItem1.SetDefaults(2496); - break; - default: - switch (Main.rand.Next(3)) - { - case 0: - newItem1.SetDefaults(2354); - newItem1.stack = Main.rand.Next(2, 6); - break; - case 1: - newItem1.SetDefaults(2355); - newItem1.stack = Main.rand.Next(2, 6); - break; - default: - newItem1.SetDefaults(2356); - newItem1.stack = Main.rand.Next(2, 6); - break; - } - break; - } - break; + } } newItem1.position = this.Center; - GetItemSettings inventorySettings = GetItemSettings.NPCEntityToPlayerInventorySettings; - Item obj1 = this.GetItem(this.whoAmI, newItem1, inventorySettings); + Item obj1 = this.GetItem(this.whoAmI, newItem1, true); if (obj1.stack > 0) { int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, obj1.type, obj1.stack, noGrabDelay: true); @@ -35950,7 +26866,7 @@ label_106: Item newItem3 = new Item(); newItem2.SetDefaults(2418); newItem2.position = this.Center; - Item obj2 = this.GetItem(this.whoAmI, newItem2, inventorySettings); + Item obj2 = this.GetItem(this.whoAmI, newItem2, true); if (obj2.stack > 0) { int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, obj2.type, obj2.stack, noGrabDelay: true); @@ -35959,7 +26875,7 @@ label_106: } newItem3.SetDefaults(2419); newItem3.position = this.Center; - Item obj3 = this.GetItem(this.whoAmI, newItem3, inventorySettings); + Item obj3 = this.GetItem(this.whoAmI, newItem3, true); if (obj3.stack > 0) { int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, obj3.type, obj3.stack, noGrabDelay: true); @@ -35973,7 +26889,7 @@ label_106: Item newItem5 = new Item(); newItem4.SetDefaults(2499); newItem4.position = this.Center; - Item obj4 = this.GetItem(this.whoAmI, newItem4, inventorySettings); + Item obj4 = this.GetItem(this.whoAmI, newItem4, true); if (obj4.stack > 0) { int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, obj4.type, obj4.stack, noGrabDelay: true); @@ -35982,7 +26898,7 @@ label_106: } newItem5.SetDefaults(2500); newItem5.position = this.Center; - Item obj5 = this.GetItem(this.whoAmI, newItem5, inventorySettings); + Item obj5 = this.GetItem(this.whoAmI, newItem5, true); if (obj5.stack > 0) { int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, obj5.type, obj5.stack, noGrabDelay: true); @@ -35991,59 +26907,59 @@ label_106: } } Item newItem6 = new Item(); - int num3 = (int) ((double) (int) ((double) ((anglerQuestsFinished + 50) / 2 * Main.rand.Next(50, 201)) * 0.0149999996647239) * 1.5); + int num2 = (int) ((double) (int) ((double) ((this.anglerQuestsFinished + 50) / 2 * Main.rand.Next(50, 201)) * 0.0149999996647239) * 1.5); if (Main.expertMode) - num3 *= 2; - if (num3 > 100) + num2 *= 2; + if (num2 > 100) { - int num4 = num3 / 100; - if (num4 > 10) - num4 = 10; - if (num4 < 1) - num4 = 1; + int num3 = num2 / 100; + if (num3 > 10) + num3 = 10; + if (num3 < 1) + num3 = 1; newItem6.SetDefaults(73); - newItem6.stack = num4; + newItem6.stack = num3; } else { - if (num3 > 99) - num3 = 99; - if (num3 < 1) - num3 = 1; + if (num2 > 99) + num2 = 99; + if (num2 < 1) + num2 = 1; newItem6.SetDefaults(72); - newItem6.stack = num3; + newItem6.stack = num2; } newItem6.position = this.Center; - Item obj6 = this.GetItem(this.whoAmI, newItem6, inventorySettings); + Item obj6 = this.GetItem(this.whoAmI, newItem6, true); if (obj6.stack > 0) { int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, obj6.type, obj6.stack, noGrabDelay: true); if (Main.netMode == 1) NetMessage.SendData(21, number: number, number2: 1f); } - if (Main.rand.Next((int) (100.0 * (double) num2)) > 50) + if (Main.rand.Next((int) (100.0 * (double) num1)) > 50) return; Item newItem7 = new Item(); - if (Main.rand.Next((int) (15.0 * (double) num2)) == 0) + if (Main.rand.Next((int) (15.0 * (double) num1)) == 0) newItem7.SetDefaults(2676); - else if (Main.rand.Next((int) (5.0 * (double) num2)) == 0) + else if (Main.rand.Next((int) (5.0 * (double) num1)) == 0) newItem7.SetDefaults(2675); else newItem7.SetDefaults(2674); - if (Main.rand.Next(25) <= anglerQuestsFinished) + if (Main.rand.Next(25) <= this.anglerQuestsFinished) ++newItem7.stack; - if (Main.rand.Next(50) <= anglerQuestsFinished) + if (Main.rand.Next(50) <= this.anglerQuestsFinished) ++newItem7.stack; - if (Main.rand.Next(100) <= anglerQuestsFinished) + if (Main.rand.Next(100) <= this.anglerQuestsFinished) ++newItem7.stack; - if (Main.rand.Next(150) <= anglerQuestsFinished) + if (Main.rand.Next(150) <= this.anglerQuestsFinished) ++newItem7.stack; - if (Main.rand.Next(200) <= anglerQuestsFinished) + if (Main.rand.Next(200) <= this.anglerQuestsFinished) ++newItem7.stack; - if (Main.rand.Next(250) <= anglerQuestsFinished) + if (Main.rand.Next(250) <= this.anglerQuestsFinished) ++newItem7.stack; newItem7.position = this.Center; - Item obj7 = this.GetItem(this.whoAmI, newItem7, GetItemSettings.NPCEntityToPlayerInventorySettings); + Item obj7 = this.GetItem(this.whoAmI, newItem7, true); if (obj7.stack <= 0) return; int number1 = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, obj7.type, obj7.stack, noGrabDelay: true); @@ -36052,64 +26968,6 @@ label_106: NetMessage.SendData(21, number: number1, number2: 1f); } - public bool DropAnglerAccByMissing( - List itemIdsOfAccsWeWant, - int randomChanceForASingleAcc, - out bool botheredRollingForADrop, - out int itemIdToDrop) - { - botheredRollingForADrop = false; - itemIdToDrop = 0; - foreach (Item itemToTestAgainst in this.inventory) - this.RemoveAnglerAccOptionsFromRewardPool(itemIdsOfAccsWeWant, itemToTestAgainst); - foreach (Item itemToTestAgainst in this.armor) - this.RemoveAnglerAccOptionsFromRewardPool(itemIdsOfAccsWeWant, itemToTestAgainst); - foreach (Item itemToTestAgainst in this.bank.item) - this.RemoveAnglerAccOptionsFromRewardPool(itemIdsOfAccsWeWant, itemToTestAgainst); - foreach (Item itemToTestAgainst in this.bank2.item) - this.RemoveAnglerAccOptionsFromRewardPool(itemIdsOfAccsWeWant, itemToTestAgainst); - foreach (Item itemToTestAgainst in this.bank3.item) - this.RemoveAnglerAccOptionsFromRewardPool(itemIdsOfAccsWeWant, itemToTestAgainst); - foreach (Item itemToTestAgainst in this.bank4.item) - this.RemoveAnglerAccOptionsFromRewardPool(itemIdsOfAccsWeWant, itemToTestAgainst); - if (itemIdsOfAccsWeWant.Count == 0) - return false; - bool flag = false; - for (int index = 0; index < itemIdsOfAccsWeWant.Count; ++index) - flag |= Main.rand.Next(randomChanceForASingleAcc) == 0; - botheredRollingForADrop = true; - if (!flag) - return false; - itemIdToDrop = Main.rand.NextFromList(itemIdsOfAccsWeWant.ToArray()); - return true; - } - - private void RemoveAnglerAccOptionsFromRewardPool( - List itemIdsOfAccsWeWant, - Item itemToTestAgainst) - { - if (itemToTestAgainst.IsAir) - return; - switch (itemToTestAgainst.type) - { - case 3036: - case 3123: - case 3124: - itemIdsOfAccsWeWant.Remove(3120); - itemIdsOfAccsWeWant.Remove(3037); - itemIdsOfAccsWeWant.Remove(3096); - break; - case 3721: - itemIdsOfAccsWeWant.Remove(2373); - itemIdsOfAccsWeWant.Remove(2375); - itemIdsOfAccsWeWant.Remove(2374); - break; - default: - itemIdsOfAccsWeWant.Remove(itemToTestAgainst.type); - break; - } - } - public void GetDyeTraderReward() { List intList = new List() @@ -36166,7 +27024,7 @@ label_106: newItem.SetDefaults(Type); newItem.stack = 3; newItem.position = this.Center; - Item obj = this.GetItem(this.whoAmI, newItem, GetItemSettings.NPCEntityToPlayerInventorySettings); + Item obj = this.GetItem(this.whoAmI, newItem, true); if (obj.stack <= 0) return; int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, obj.type, obj.stack, noGrabDelay: true); @@ -36196,7 +27054,7 @@ label_106: public void TryPortalJumping() { - if (this.mount.Active || this.dead || this.isLockedToATile) + if (this.mount.Active || this.dead) return; PortalHelper.TryGoingThroughPortals((Entity) this); } @@ -36205,13 +27063,15 @@ label_106: { if (!this.setSolar || this.solarShields <= 0) return false; + if (Main.netMode == 1 && this.whoAmI != Main.myPlayer) + return true; --this.solarShields; for (int b = 0; b < 22; ++b) { if (this.buffType[b] >= 170 && this.buffType[b] <= 172) this.DelBuff(b); } - if (this.solarShields > 0 && this.whoAmI == Main.myPlayer) + if (this.solarShields > 0) this.AddBuff(170 + this.solarShields - 1, 5, false); this.solarCounter = 0; return true; @@ -36226,6 +27086,8 @@ label_106: return; if (this.setVortex && !this.mount.Active) this.vortexStealthActive = !this.vortexStealthActive; + if (this.setStardust) + this.MinionRestTargetAim(); if (!this.setForbidden) return; this.MinionRestTargetAim(); @@ -36258,38 +27120,36 @@ label_106: bool flag1 = StrayMethods.CanSpawnSandstormFriendly(this.MinionRestTargetPoint, 30, 30); int num1 = this.MinionRestTargetPoint == Vector2.Zero ? 1 : 0; Vector2 center = this.Center; - Vector2 endPoint = this.MinionRestTargetPoint; + Vector2 vector2_1 = this.MinionRestTargetPoint; if (num1 != 0) - endPoint = center; - int samplesToTake = 10; - float samplingWidth = 60f; - Vector2 vectorTowardsTarget; - float[] samples; - Collision.AimingLaserScan(center, endPoint, samplingWidth, samplesToTake, out vectorTowardsTarget, out samples); + vector2_1 = center; bool flag2 = false; - foreach (float num2 in samples) + float[] samples = new float[10]; + Vector2 v = vector2_1 - center; + Collision.LaserScan(center, v.SafeNormalize(Vector2.Zero), 60f, v.Length(), samples); + float num2 = 0.0f; + for (int index = 0; index < samples.Length; ++index) { - if ((double) Math.Abs(num2 - vectorTowardsTarget.Length()) < 10.0) + if ((double) samples[index] > (double) num2) + num2 = samples[index]; + } + foreach (float num3 in samples) + { + if ((double) Math.Abs(num3 - v.Length()) < 10.0) { flag2 = true; break; } } - float num3 = 0.0f; - for (int index = 0; index < samples.Length; ++index) - { - if ((double) samples[index] > (double) num3) - num3 = samples[index]; - } if (intList.Count <= 1) { - Vector2 Position1 = center + vectorTowardsTarget.SafeNormalize(Vector2.Zero) * num3; - Vector2 vector2 = Position1 - center; - if ((double) vector2.Length() > 0.0) + Vector2 Position1 = center + v.SafeNormalize(Vector2.Zero) * num2; + Vector2 vector2_2 = Position1 - center; + if ((double) vector2_2.Length() > 0.0) { - for (float num4 = 0.0f; (double) num4 < (double) vector2.Length(); num4 += 15f) + for (float num4 = 0.0f; (double) num4 < (double) vector2_2.Length(); num4 += 15f) { - Vector2 Position2 = center + vector2 * (num4 / vector2.Length()); + Vector2 Position2 = center + vector2_2 * (num4 / vector2_2.Length()); Dust dust = Main.dust[Dust.NewDust(Position2, 0, 0, 269)]; dust.position = Position2; dust.fadeIn = 0.5f; @@ -36343,7 +27203,7 @@ label_106: this.MinionRestTargetPoint = Vector2.Zero; } - public void MinionNPCTargetAim(bool doNotDisableIfTheTargetIsTheSame) + public void MinionNPCTargetAim() { Vector2 mouseWorld = Main.MouseWorld; int index1 = -1; @@ -36352,7 +27212,7 @@ label_106: if (Main.npc[index2].CanBeChasedBy((object) this) && (index1 == -1 || (double) Main.npc[index2].Hitbox.Distance(mouseWorld) < (double) Main.npc[index1].Hitbox.Distance(mouseWorld))) index1 = index2; } - if (this.MinionAttackTargetNPC == index1 && !doNotDisableIfTheTargetIsTheSame) + if (this.MinionAttackTargetNPC == index1) this.MinionAttackTargetNPC = -1; else this.MinionAttackTargetNPC = index1; @@ -36427,19 +27287,33 @@ label_106: this.MinionRestTargetPoint = Vector2.Zero; if (this.MinionAttackTargetNPC != -1 && (!Main.npc[this.MinionAttackTargetNPC].CanBeChasedBy((object) this) || (double) Main.npc[this.MinionAttackTargetNPC].Hitbox.Distance(this.Center) > 3000.0)) this.MinionAttackTargetNPC = -1; - if (!this.stardustGuardian || !this.HasMinionRestTarget) - return; - Vector2 minionRestTargetPoint = this.MinionRestTargetPoint; - float num1 = (float) this.miscCounter / 150f; - float num2 = 2.094395f; - for (int index1 = 0; index1 < 3; ++index1) + if (this.stardustGuardian && this.HasMinionRestTarget) { - int index2 = Dust.NewDust(minionRestTargetPoint, 0, 0, 135, Alpha: 100, Scale: 1.5f); - Main.dust[index2].noGravity = true; - Main.dust[index2].velocity = Vector2.Zero; - Main.dust[index2].noLight = true; - Main.dust[index2].position = minionRestTargetPoint + ((float) ((double) num1 * 6.28318548202515 + (double) num2 * (double) index1)).ToRotationVector2() * 4f; - Main.dust[index2].shader = GameShaders.Armor.GetSecondaryShader(this.cPet, this); + Vector2 minionRestTargetPoint = this.MinionRestTargetPoint; + float num1 = (float) this.miscCounter / 150f; + float num2 = 2.094395f; + for (int index1 = 0; index1 < 3; ++index1) + { + int index2 = Dust.NewDust(minionRestTargetPoint, 0, 0, 135, Alpha: 100, Scale: 1.5f); + Main.dust[index2].noGravity = true; + Main.dust[index2].velocity = Vector2.Zero; + Main.dust[index2].noLight = true; + Main.dust[index2].position = minionRestTargetPoint + ((float) ((double) num1 * 6.28318548202515 + (double) num2 * (double) index1)).ToRotationVector2() * 4f; + Main.dust[index2].shader = GameShaders.Armor.GetSecondaryShader(this.cPet, this); + } + } + if (this.MinionAttackTargetNPC == -1) + return; + Vector2 center = Main.npc[this.MinionAttackTargetNPC].Center; + float num3 = (float) this.miscCounter / 60f; + float num4 = 2.094395f; + for (int index3 = 0; index3 < 3; ++index3) + { + int index4 = Dust.NewDust(center, 0, 0, 272, Alpha: 100, Scale: 0.5f); + Main.dust[index4].noGravity = true; + Main.dust[index4].velocity = Vector2.Zero; + Main.dust[index4].noLight = true; + Main.dust[index4].position = center + ((float) ((double) num3 * 6.28318548202515 + (double) num4 * (double) index3)).ToRotationVector2() * 12f; } } @@ -36447,7 +27321,7 @@ label_106: { if (this.whoAmI != Main.myPlayer) return; - int timeToAdd = 480; + int time1 = 480; for (int b = 0; b < 22; ++b) { if (this.buffType[b] >= type && this.buffType[b] < type + 3) @@ -36457,15 +27331,15 @@ label_106: { case 173: this.nebulaLevelLife = (int) MathHelper.Clamp((float) (this.nebulaLevelLife + 1), 0.0f, 3f); - this.AddBuff(type + this.nebulaLevelLife - 1, timeToAdd); + this.AddBuff(type + this.nebulaLevelLife - 1, time1); break; case 176: this.nebulaLevelMana = (int) MathHelper.Clamp((float) (this.nebulaLevelMana + 1), 0.0f, 3f); - this.AddBuff(type + this.nebulaLevelMana - 1, timeToAdd); + this.AddBuff(type + this.nebulaLevelMana - 1, time1); break; case 179: this.nebulaLevelDamage = (int) MathHelper.Clamp((float) (this.nebulaLevelDamage + 1), 0.0f, 3f); - this.AddBuff(type + this.nebulaLevelDamage - 1, timeToAdd); + this.AddBuff(type + this.nebulaLevelDamage - 1, time1); break; } } @@ -36494,148 +27368,6 @@ label_106: this.TouchedTiles = pointList1; } - public static class BuilderAccToggleIDs - { - public const int RulerLine = 0; - public const int RulerGrid = 1; - public const int AutoActuate = 2; - public const int AutoPaint = 3; - public const int WireVisibility_Red = 4; - public const int WireVisibility_Green = 5; - public const int WireVisibility_Blue = 6; - public const int WireVisibility_Yellow = 7; - public const int HideAllWires = 8; - public const int WireVisibility_Actuators = 9; - public const int BlockSwap = 10; - public const int TorchBiome = 11; - public const int Count = 12; - } - - public struct RabbitOrderFrameHelper - { - public int DisplayFrame; - private int _frameCounter; - private int _aiState; - private const int AIState_Idle = 0; - private const int AIState_LookingAtCamera = 1; - private const int AIState_Resting = 2; - private const int AIState_EatingCarrot = 3; - - public void Update() - { - switch (this._aiState) - { - case 0: - this.UpdateFrame(0, 0, Main.rand.Next(1, 4), Main.rand.Next(180, 3600)); - break; - case 1: - this.UpdateFrame(7, 9, 0, 20); - break; - case 2: - int gameFramesPerDisplayFrame = 8; - if (this.DisplayFrame == 13) - gameFramesPerDisplayFrame = 120; - this.UpdateFrame(10, 16, 0, gameFramesPerDisplayFrame); - break; - case 3: - this.UpdateFrame(17, 26, 0, 4); - break; - } - } - - public void Reset() => this.ChangeToAIState(0); - - private void ChangeToAIState(int aiState) - { - this._aiState = aiState; - this._frameCounter = 0; - this.Update(); - } - - private void UpdateFrame( - int displayFrameMin, - int displayFrameMax, - int exitAIState, - int gameFramesPerDisplayFrame) - { - this.DisplayFrame = Utils.Clamp(this.DisplayFrame, displayFrameMin, displayFrameMax); - if (this._frameCounter++ < gameFramesPerDisplayFrame) - return; - this._frameCounter = 0; - if (this.DisplayFrame++ < displayFrameMax) - return; - this.ChangeToAIState(exitAIState); - } - } - - public enum CompositeArmStretchAmount - { - Full, - None, - Quarter, - ThreeQuarters, - } - - public struct CompositeArmData - { - public bool enabled; - public Player.CompositeArmStretchAmount stretch; - public float rotation; - - public CompositeArmData( - bool enabled, - Player.CompositeArmStretchAmount intendedStrech, - float rotation) - { - this.enabled = enabled; - this.stretch = intendedStrech; - this.rotation = rotation; - } - } - - public struct ItemSpaceStatus - { - public readonly bool CanTakeItem; - public readonly bool ItemIsGoingToVoidVault; - - public bool CanTakeItemToPersonalInventory => this.CanTakeItem && !this.ItemIsGoingToVoidVault; - - public ItemSpaceStatus(bool CanTakeItem, bool ItemIsGoingToVoidVault = false) - { - this.CanTakeItem = CanTakeItem; - this.ItemIsGoingToVoidVault = ItemIsGoingToVoidVault; - } - } - - private struct SpecialToolUsageSettings - { - public bool IsAValidTool; - public Player.SpecialToolUsageSettings.CanUseToolCondition UsageCondition; - public Player.SpecialToolUsageSettings.UseToolAction UsageAction; - - public delegate bool CanUseToolCondition(Player user, Item item, int targetX, int targetY); - - public delegate void UseToolAction(Player user, Item item, int targetX, int targetY); - } - - public class SavedPlayerDataWithAnnoyingRules - { - public bool godmodePowerEnabled; - public bool farPlacementRangePowerEnabled; - public float spawnRatePowerSliderValue; - } - - private class RandomTeleportationAttemptSettings - { - public bool mostlySolidFloor; - public bool avoidLava; - public bool avoidAnyLiquid; - public bool avoidHurtTiles; - public bool avoidWalls; - public int attemptsBeforeGivingUp; - public int maximumFallDistanceFromOrignalPoint; - } - public static class Hooks { public static event Action OnEnterWorld; @@ -36654,32 +27386,9 @@ label_106: public class SmartCursorSettings { - public static bool SmartBlocksEnabled; - public static bool SmartAxeAfterPickaxe; - } - - public class Settings - { - public static Player.Settings.HoverControlMode HoverControl; - - public static void CycleHoverControl() - { - switch (Player.Settings.HoverControl) - { - case Player.Settings.HoverControlMode.Hold: - Player.Settings.HoverControl = Player.Settings.HoverControlMode.Click; - break; - case Player.Settings.HoverControlMode.Click: - Player.Settings.HoverControl = Player.Settings.HoverControlMode.Hold; - break; - } - } - - public enum HoverControlMode - { - Hold, - Click, - } + public static bool SmartBlocksEnabled = false; + public static bool SmartWallReplacement = true; + public static bool SmartAxeAfterPickaxe = false; } public class SelectionRadial @@ -36706,7 +27415,7 @@ label_106: num = 10; break; case Player.SelectionRadial.SelectionMode.RadialQuicks: - num = 4; + num = 3; break; } this.RadialCount = num; @@ -36832,13 +27541,12 @@ label_106: public TextSnippet[] snippets; public Vector2 messageSize; public int timeLeft; - public Color color; public void NewMessage(string message, int displayTime) { this.chatText = message; this.snippets = ChatManager.ParseMessage(this.chatText, Color.White).ToArray(); - this.messageSize = ChatManager.GetStringSize(FontAssets.MouseText.Value, this.snippets, Vector2.One); + this.messageSize = ChatManager.GetStringSize(Main.fontMouseText, this.snippets, Vector2.One); this.timeLeft = displayTime; } } diff --git a/PlayerSpawnContext.cs b/PlayerSpawnContext.cs deleted file mode 100644 index 30d1ff4..0000000 --- a/PlayerSpawnContext.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.PlayerSpawnContext -// 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 -{ - public enum PlayerSpawnContext - { - ReviveFromDeath, - SpawningIntoWorld, - RecallFromItem, - } -} diff --git a/PopupText.cs b/PopupText.cs deleted file mode 100644 index 08aa479..0000000 --- a/PopupText.cs +++ /dev/null @@ -1,477 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.PopupText -// 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; -using Terraria.GameContent; -using Terraria.Localization; - -namespace Terraria -{ - public class PopupText - { - public Vector2 position; - public Vector2 velocity; - public float alpha; - public int alphaDir = 1; - public string name; - public int stack; - public float scale = 1f; - public float rotation; - public Color color; - public bool active; - public int lifeTime; - public static int activeTime = 60; - public static int numActive; - public bool NoStack; - public bool coinText; - public int coinValue; - public static int sonarText = -1; - public bool expert; - public bool master; - public bool sonar; - public PopupTextContext context; - public int npcNetID; - - public bool notActuallyAnItem => (uint) this.npcNetID > 0U; - - public static float TargetScale => Main.UIScale / Main.GameViewMatrix.Zoom.X; - - public static void ClearSonarText() - { - if (PopupText.sonarText < 0 || !Main.popupText[PopupText.sonarText].sonar) - return; - Main.popupText[PopupText.sonarText].active = false; - PopupText.sonarText = -1; - } - - public static int NewText( - PopupTextContext context, - int npcNetID, - Vector2 position, - bool stay5TimesLonger) - { - if (!Main.showItemText || npcNetID == 0 || Main.netMode == 2) - return -1; - int nextItemTextSlot = PopupText.FindNextItemTextSlot(); - if (nextItemTextSlot >= 0) - { - NPC npc = new NPC(); - npc.SetDefaults(npcNetID); - string typeName = npc.TypeName; - Vector2 vector2 = FontAssets.MouseText.Value.MeasureString(typeName); - PopupText popupText = Main.popupText[nextItemTextSlot]; - Main.popupText[nextItemTextSlot].alpha = 1f; - popupText.alphaDir = -1; - popupText.active = true; - popupText.scale = 0.0f; - popupText.NoStack = true; - popupText.rotation = 0.0f; - popupText.position = position - vector2 / 2f; - popupText.expert = false; - popupText.master = false; - popupText.name = typeName; - popupText.stack = 1; - popupText.velocity.Y = -7f; - popupText.lifeTime = 60; - popupText.context = context; - if (stay5TimesLonger) - popupText.lifeTime *= 5; - popupText.npcNetID = npcNetID; - popupText.coinValue = 0; - popupText.coinText = false; - popupText.color = Color.White; - if (context == PopupTextContext.SonarAlert) - popupText.color = Color.Lerp(Color.White, Color.Crimson, 0.5f); - } - return nextItemTextSlot; - } - - public static int NewText( - PopupTextContext context, - Item newItem, - int stack, - bool noStack = false, - bool longText = false) - { - if (!Main.showItemText || newItem.Name == null || !newItem.active || Main.netMode == 2) - return -1; - bool flag = newItem.type >= 71 && newItem.type <= 74; - for (int index = 0; index < 20; ++index) - { - if (Main.popupText[index].active && !Main.popupText[index].notActuallyAnItem && (Main.popupText[index].name == newItem.AffixName() || flag && Main.popupText[index].coinText) && !Main.popupText[index].NoStack && !noStack) - { - string str1 = newItem.Name + " (" + (object) (Main.popupText[index].stack + stack) + ")"; - string str2 = newItem.Name; - if (Main.popupText[index].stack > 1) - str2 = str2 + " (" + (object) Main.popupText[index].stack + ")"; - FontAssets.MouseText.Value.MeasureString(str2); - Vector2 vector2 = FontAssets.MouseText.Value.MeasureString(str1); - if (Main.popupText[index].lifeTime < 0) - Main.popupText[index].scale = 1f; - if (Main.popupText[index].lifeTime < 60) - Main.popupText[index].lifeTime = 60; - if (flag && Main.popupText[index].coinText) - { - int num = 0; - if (newItem.type == 71) - num += stack; - else if (newItem.type == 72) - num += 100 * stack; - else if (newItem.type == 73) - num += 10000 * stack; - else if (newItem.type == 74) - num += 1000000 * stack; - Main.popupText[index].coinValue += num; - string name = PopupText.ValueToName(Main.popupText[index].coinValue); - vector2 = FontAssets.MouseText.Value.MeasureString(name); - Main.popupText[index].name = name; - if (Main.popupText[index].coinValue >= 1000000) - { - if (Main.popupText[index].lifeTime < 300) - Main.popupText[index].lifeTime = 300; - Main.popupText[index].color = new Color(220, 220, 198); - } - else if (Main.popupText[index].coinValue >= 10000) - { - if (Main.popupText[index].lifeTime < 240) - Main.popupText[index].lifeTime = 240; - Main.popupText[index].color = new Color(224, 201, 92); - } - else if (Main.popupText[index].coinValue >= 100) - { - if (Main.popupText[index].lifeTime < 180) - Main.popupText[index].lifeTime = 180; - Main.popupText[index].color = new Color(181, 192, 193); - } - else if (Main.popupText[index].coinValue >= 1) - { - if (Main.popupText[index].lifeTime < 120) - Main.popupText[index].lifeTime = 120; - Main.popupText[index].color = new Color(246, 138, 96); - } - } - Main.popupText[index].stack += stack; - Main.popupText[index].scale = 0.0f; - Main.popupText[index].rotation = 0.0f; - Main.popupText[index].position.X = (float) ((double) newItem.position.X + (double) newItem.width * 0.5 - (double) vector2.X * 0.5); - Main.popupText[index].position.Y = (float) ((double) newItem.position.Y + (double) newItem.height * 0.25 - (double) vector2.Y * 0.5); - Main.popupText[index].velocity.Y = -7f; - Main.popupText[index].context = context; - Main.popupText[index].npcNetID = 0; - if (Main.popupText[index].coinText) - Main.popupText[index].stack = 1; - return index; - } - } - int nextItemTextSlot = PopupText.FindNextItemTextSlot(); - if (nextItemTextSlot >= 0) - { - string str = newItem.AffixName(); - if (stack > 1) - str = str + " (" + (object) stack + ")"; - Vector2 vector2 = FontAssets.MouseText.Value.MeasureString(str); - Main.popupText[nextItemTextSlot].alpha = 1f; - Main.popupText[nextItemTextSlot].alphaDir = -1; - Main.popupText[nextItemTextSlot].active = true; - Main.popupText[nextItemTextSlot].scale = 0.0f; - Main.popupText[nextItemTextSlot].NoStack = noStack; - Main.popupText[nextItemTextSlot].rotation = 0.0f; - Main.popupText[nextItemTextSlot].position.X = (float) ((double) newItem.position.X + (double) newItem.width * 0.5 - (double) vector2.X * 0.5); - Main.popupText[nextItemTextSlot].position.Y = (float) ((double) newItem.position.Y + (double) newItem.height * 0.25 - (double) vector2.Y * 0.5); - Main.popupText[nextItemTextSlot].color = Color.White; - Main.popupText[nextItemTextSlot].master = false; - if (newItem.rare == 1) - Main.popupText[nextItemTextSlot].color = new Color(150, 150, (int) byte.MaxValue); - else if (newItem.rare == 2) - Main.popupText[nextItemTextSlot].color = new Color(150, (int) byte.MaxValue, 150); - else if (newItem.rare == 3) - Main.popupText[nextItemTextSlot].color = new Color((int) byte.MaxValue, 200, 150); - else if (newItem.rare == 4) - Main.popupText[nextItemTextSlot].color = new Color((int) byte.MaxValue, 150, 150); - else if (newItem.rare == 5) - Main.popupText[nextItemTextSlot].color = new Color((int) byte.MaxValue, 150, (int) byte.MaxValue); - else if (newItem.rare == -13) - Main.popupText[nextItemTextSlot].master = true; - else if (newItem.rare == -11) - Main.popupText[nextItemTextSlot].color = new Color((int) byte.MaxValue, 175, 0); - else if (newItem.rare == -1) - Main.popupText[nextItemTextSlot].color = new Color(130, 130, 130); - else if (newItem.rare == 6) - Main.popupText[nextItemTextSlot].color = new Color(210, 160, (int) byte.MaxValue); - else if (newItem.rare == 7) - Main.popupText[nextItemTextSlot].color = new Color(150, (int) byte.MaxValue, 10); - else if (newItem.rare == 8) - Main.popupText[nextItemTextSlot].color = new Color((int) byte.MaxValue, (int) byte.MaxValue, 10); - else if (newItem.rare == 9) - Main.popupText[nextItemTextSlot].color = new Color(5, 200, (int) byte.MaxValue); - else if (newItem.rare == 10) - Main.popupText[nextItemTextSlot].color = new Color((int) byte.MaxValue, 40, 100); - else if (newItem.rare >= 11) - Main.popupText[nextItemTextSlot].color = new Color(180, 40, (int) byte.MaxValue); - Main.popupText[nextItemTextSlot].expert = newItem.expert; - Main.popupText[nextItemTextSlot].name = newItem.AffixName(); - Main.popupText[nextItemTextSlot].stack = stack; - Main.popupText[nextItemTextSlot].velocity.Y = -7f; - Main.popupText[nextItemTextSlot].lifeTime = 60; - Main.popupText[nextItemTextSlot].context = context; - Main.popupText[nextItemTextSlot].npcNetID = 0; - if (longText) - Main.popupText[nextItemTextSlot].lifeTime *= 5; - Main.popupText[nextItemTextSlot].coinValue = 0; - Main.popupText[nextItemTextSlot].coinText = newItem.type >= 71 && newItem.type <= 74; - if (Main.popupText[nextItemTextSlot].coinText) - { - if (newItem.type == 71) - Main.popupText[nextItemTextSlot].coinValue += Main.popupText[nextItemTextSlot].stack; - else if (newItem.type == 72) - Main.popupText[nextItemTextSlot].coinValue += 100 * Main.popupText[nextItemTextSlot].stack; - else if (newItem.type == 73) - Main.popupText[nextItemTextSlot].coinValue += 10000 * Main.popupText[nextItemTextSlot].stack; - else if (newItem.type == 74) - Main.popupText[nextItemTextSlot].coinValue += 1000000 * Main.popupText[nextItemTextSlot].stack; - Main.popupText[nextItemTextSlot].ValueToName(); - Main.popupText[nextItemTextSlot].stack = 1; - int index = nextItemTextSlot; - if (Main.popupText[index].coinValue >= 1000000) - { - if (Main.popupText[index].lifeTime < 300) - Main.popupText[index].lifeTime = 300; - Main.popupText[index].color = new Color(220, 220, 198); - } - else if (Main.popupText[index].coinValue >= 10000) - { - if (Main.popupText[index].lifeTime < 240) - Main.popupText[index].lifeTime = 240; - Main.popupText[index].color = new Color(224, 201, 92); - } - else if (Main.popupText[index].coinValue >= 100) - { - if (Main.popupText[index].lifeTime < 180) - Main.popupText[index].lifeTime = 180; - Main.popupText[index].color = new Color(181, 192, 193); - } - else if (Main.popupText[index].coinValue >= 1) - { - if (Main.popupText[index].lifeTime < 120) - Main.popupText[index].lifeTime = 120; - Main.popupText[index].color = new Color(246, 138, 96); - } - } - } - return nextItemTextSlot; - } - - private static int FindNextItemTextSlot() - { - int num1 = -1; - for (int index = 0; index < 20; ++index) - { - if (!Main.popupText[index].active) - { - num1 = index; - break; - } - } - if (num1 == -1) - { - double num2 = (double) Main.bottomWorld; - for (int index = 0; index < 20; ++index) - { - if (num2 > (double) Main.popupText[index].position.Y) - { - num1 = index; - num2 = (double) Main.popupText[index].position.Y; - } - } - } - return num1; - } - - private static string ValueToName(int coinValue) - { - int num1 = 0; - int num2 = 0; - int num3 = 0; - int num4 = 0; - int num5 = coinValue; - while (num5 > 0) - { - if (num5 >= 1000000) - { - num5 -= 1000000; - ++num1; - } - else if (num5 >= 10000) - { - num5 -= 10000; - ++num2; - } - else if (num5 >= 100) - { - num5 -= 100; - ++num3; - } - else if (num5 >= 1) - { - --num5; - ++num4; - } - } - string str = ""; - if (num1 > 0) - str = str + (object) num1 + string.Format(" {0} ", (object) Language.GetTextValue("Currency.Platinum")); - if (num2 > 0) - str = str + (object) num2 + string.Format(" {0} ", (object) Language.GetTextValue("Currency.Gold")); - if (num3 > 0) - str = str + (object) num3 + string.Format(" {0} ", (object) Language.GetTextValue("Currency.Silver")); - if (num4 > 0) - str = str + (object) num4 + string.Format(" {0} ", (object) Language.GetTextValue("Currency.Copper")); - if (str.Length > 1) - str = str.Substring(0, str.Length - 1); - return str; - } - - private void ValueToName() - { - int num1 = 0; - int num2 = 0; - int num3 = 0; - int num4 = 0; - int coinValue = this.coinValue; - while (coinValue > 0) - { - if (coinValue >= 1000000) - { - coinValue -= 1000000; - ++num1; - } - else if (coinValue >= 10000) - { - coinValue -= 10000; - ++num2; - } - else if (coinValue >= 100) - { - coinValue -= 100; - ++num3; - } - else if (coinValue >= 1) - { - --coinValue; - ++num4; - } - } - this.name = ""; - if (num1 > 0) - this.name = this.name + (object) num1 + string.Format(" {0} ", (object) Language.GetTextValue("Currency.Platinum")); - if (num2 > 0) - this.name = this.name + (object) num2 + string.Format(" {0} ", (object) Language.GetTextValue("Currency.Gold")); - if (num3 > 0) - this.name = this.name + (object) num3 + string.Format(" {0} ", (object) Language.GetTextValue("Currency.Silver")); - if (num4 > 0) - this.name = this.name + (object) num4 + string.Format(" {0} ", (object) Language.GetTextValue("Currency.Copper")); - if (this.name.Length <= 1) - return; - this.name = this.name.Substring(0, this.name.Length - 1); - } - - public void Update(int whoAmI) - { - if (!this.active) - return; - float targetScale = PopupText.TargetScale; - this.alpha += (float) this.alphaDir * 0.01f; - if ((double) this.alpha <= 0.7) - { - this.alpha = 0.7f; - this.alphaDir = 1; - } - if ((double) this.alpha >= 1.0) - { - this.alpha = 1f; - this.alphaDir = -1; - } - if (this.expert) - this.color = new Color((int) (byte) Main.DiscoR, (int) (byte) Main.DiscoG, (int) (byte) Main.DiscoB, (int) Main.mouseTextColor); - else if (this.master) - this.color = new Color((int) byte.MaxValue, (int) (byte) ((double) Main.masterColor * 200.0), 0, (int) Main.mouseTextColor); - bool flag = false; - string str1 = this.name; - if (this.stack > 1) - str1 = str1 + " (" + (object) this.stack + ")"; - Vector2 vector2_1 = FontAssets.MouseText.Value.MeasureString(str1) * this.scale; - vector2_1.Y *= 0.8f; - Rectangle rectangle1 = new Rectangle((int) ((double) this.position.X - (double) vector2_1.X / 2.0), (int) ((double) this.position.Y - (double) vector2_1.Y / 2.0), (int) vector2_1.X, (int) vector2_1.Y); - for (int index = 0; index < 20; ++index) - { - if (Main.popupText[index].active && index != whoAmI) - { - string str2 = Main.popupText[index].name; - if (Main.popupText[index].stack > 1) - str2 = str2 + " (" + (object) Main.popupText[index].stack + ")"; - Vector2 vector2_2 = FontAssets.MouseText.Value.MeasureString(str2) * Main.popupText[index].scale; - vector2_2.Y *= 0.8f; - Rectangle rectangle2 = new Rectangle((int) ((double) Main.popupText[index].position.X - (double) vector2_2.X / 2.0), (int) ((double) Main.popupText[index].position.Y - (double) vector2_2.Y / 2.0), (int) vector2_2.X, (int) vector2_2.Y); - if (rectangle1.Intersects(rectangle2) && ((double) this.position.Y < (double) Main.popupText[index].position.Y || (double) this.position.Y == (double) Main.popupText[index].position.Y && whoAmI < index)) - { - flag = true; - int num = PopupText.numActive; - if (num > 3) - num = 3; - Main.popupText[index].lifeTime = PopupText.activeTime + 15 * num; - this.lifeTime = PopupText.activeTime + 15 * num; - } - } - } - if (!flag) - { - this.velocity.Y *= 0.86f; - if ((double) this.scale == (double) targetScale) - this.velocity.Y *= 0.4f; - } - else if ((double) this.velocity.Y > -6.0) - this.velocity.Y -= 0.2f; - else - this.velocity.Y *= 0.86f; - this.velocity.X *= 0.93f; - this.position += this.velocity; - --this.lifeTime; - if (this.lifeTime <= 0) - { - this.scale -= 0.03f * targetScale; - if ((double) this.scale < 0.1 * (double) targetScale) - { - this.active = false; - if (PopupText.sonarText == whoAmI) - PopupText.sonarText = -1; - } - this.lifeTime = 0; - } - else - { - if ((double) this.scale < (double) targetScale) - this.scale += 0.1f * targetScale; - if ((double) this.scale <= (double) targetScale) - return; - this.scale = targetScale; - } - } - - public static void UpdateItemText() - { - int num = 0; - for (int whoAmI = 0; whoAmI < 20; ++whoAmI) - { - if (Main.popupText[whoAmI].active) - { - ++num; - Main.popupText[whoAmI].Update(whoAmI); - } - } - PopupText.numActive = num; - } - } -} diff --git a/PopupTextContext.cs b/PopupTextContext.cs deleted file mode 100644 index bad2f12..0000000 --- a/PopupTextContext.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.PopupTextContext -// 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 -{ - public enum PopupTextContext - { - RegularItemPickup, - ItemPickupToVoidContainer, - SonarAlert, - ItemReforge, - ItemCraft, - } -} diff --git a/Program.cs b/Program.cs index f5baf22..49e44db 100644 --- a/Program.cs +++ b/Program.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Program -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using ReLogic.IO; @@ -12,6 +12,7 @@ using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; +using System.Runtime.ExceptionServices; using System.Text; using System.Threading; using System.Windows.Forms; @@ -25,13 +26,10 @@ namespace Terraria public static class Program { public const bool IsServer = false; - public const bool IsXna = true; - public const bool IsFna = false; - public const bool IsDebug = false; public static Dictionary LaunchParameters = new Dictionary(); - private static int ThingsToLoad; - private static int ThingsLoaded; - public static bool LoadedEverything; + private static int ThingsToLoad = 0; + private static int ThingsLoaded = 0; + public static bool LoadedEverything = false; public static IntPtr JitForcedMethodCache; public static float LoadedPercentage => Program.ThingsToLoad == 0 ? 1f : (float) Program.ThingsLoaded / (float) Program.ThingsToLoad; @@ -39,15 +37,12 @@ namespace Terraria public static void StartForceLoad() { if (!Main.SkipAssemblyLoad) - new Thread(new ParameterizedThreadStart(Program.ForceLoadThread)) - { - IsBackground = true - }.Start(); + ThreadPool.QueueUserWorkItem(new WaitCallback(Program.ForceLoadThread)); else Program.LoadedEverything = true; } - public static void ForceLoadThread(object threadContext) + public static void ForceLoadThread(object ThreadContext) { Program.ForceLoadAssembly(Assembly.GetExecutingAssembly(), true); Program.LoadedEverything = true; @@ -103,18 +98,38 @@ namespace Terraria private static void SetupLogging() { - if (Program.LaunchParameters.ContainsKey("-logfile")) + if ((Program.LaunchParameters.ContainsKey("-logfile") ? 1 : 0) != 0) { string launchParameter = Program.LaunchParameters["-logfile"]; - ConsoleOutputMirror.ToFile(launchParameter == null || launchParameter.Trim() == "" ? Path.Combine(Main.SavePath, "Logs", string.Format("Log_{0:yyyyMMddHHmmssfff}.log", (object) DateTime.Now)) : Path.Combine(launchParameter, string.Format("Log_{0:yyyyMMddHHmmssfff}.log", (object) DateTime.Now))); + ConsoleOutputMirror.ToFile(launchParameter == null || launchParameter.Trim() == "" ? Path.Combine(Main.SavePath, "Logs", string.Format("Log_{0}.log", (object) DateTime.Now.ToString("yyyyMMddHHmmssfff"))) : Path.Combine(launchParameter, string.Format("Log_{0}.log", (object) DateTime.Now.ToString("yyyyMMddHHmmssfff")))); } - CrashWatcher.Inititialize(); - CrashWatcher.DumpOnException = Program.LaunchParameters.ContainsKey("-minidump"); - CrashWatcher.LogAllExceptions = Program.LaunchParameters.ContainsKey("-logerrors"); - if (!Program.LaunchParameters.ContainsKey("-fulldump")) + if (!Program.LaunchParameters.ContainsKey("-logerrors")) return; - Console.WriteLine("Full Dump logs enabled."); - CrashWatcher.EnableCrashDumps(CrashDump.Options.WithFullMemory); + Program.HookAllExceptions(); + } + + private static void HookAllExceptions() + { + bool useMiniDumps = Program.LaunchParameters.ContainsKey("-minidump"); + bool useFullDumps = Program.LaunchParameters.ContainsKey("-fulldump"); + Console.WriteLine("Error Logging Enabled."); + CrashDump.Options dumpOptions = CrashDump.Options.WithFullMemory; + if (useFullDumps) + Console.WriteLine("Full Dump logs enabled."); + AppDomain.CurrentDomain.FirstChanceException += (EventHandler) ((sender, exceptionArgs) => + { + Console.Write("================\r\n" + string.Format("{0}: First-Chance Exception\r\nCulture: {1}\r\nException: {2}\r\n", (object) DateTime.Now, (object) Thread.CurrentThread.CurrentCulture.Name, (object) exceptionArgs.Exception.ToString()) + "================\r\n\r\n"); + if (!useMiniDumps) + return; + CrashDump.WriteException(CrashDump.Options.WithIndirectlyReferencedMemory, Path.Combine(Main.SavePath, "Dumps")); + }); + AppDomain.CurrentDomain.UnhandledException += (UnhandledExceptionEventHandler) ((sender, exceptionArgs) => + { + Console.Write("================\r\n" + string.Format("{0}: Unhandled Exception\r\nCulture: {1}\r\nException: {2}\r\n", (object) DateTime.Now, (object) Thread.CurrentThread.CurrentCulture.Name, (object) exceptionArgs.ExceptionObject.ToString()) + "================\r\n"); + if (!useFullDumps) + return; + CrashDump.WriteException(dumpOptions, Path.Combine(Main.SavePath, "Dumps")); + }); } private static void InitializeConsoleOutput() @@ -136,21 +151,19 @@ namespace Terraria public static void LaunchGame(string[] args, bool monoArgs = false) { - Thread.CurrentThread.Name = "Main Thread"; if (monoArgs) args = Utils.ConvertMonoArgsToDotNet(args); if (Platform.IsOSX) Main.OnEngineLoad += (Action) (() => Main.instance.IsMouseVisible = false); Program.LaunchParameters = Utils.ParseArguements(args); ThreadPool.SetMinThreads(8, 8); - LanguageManager.Instance.SetLanguage(GameCulture.DefaultCulture); - Program.InitializeConsoleOutput(); + LanguageManager.Instance.SetLanguage(GameCulture.English); Program.SetupLogging(); - Platform.Get().SetQuickEditEnabled(false); using (Main game = new Main()) { try { + Program.InitializeConsoleOutput(); Lang.InitializeLegacyLocalization(); SocialAPI.Initialize(); LaunchInitializer.LoadParameters(game); @@ -168,24 +181,13 @@ namespace Terraria { try { - string text = e.ToString(); - if (WorldGen.gen) - { - try - { - text = string.Format("Creating world - Seed: {0} Width: {1}, Height: {2}, Evil: {3}, IsExpert: {4}\n{5}", (object) Main.ActiveWorldFileData.Seed, (object) Main.maxTilesX, (object) Main.maxTilesY, (object) WorldGen.WorldGenParam_Evil, (object) Main.expertMode, (object) text); - } - catch - { - } - } using (StreamWriter streamWriter = new StreamWriter("client-crashlog.txt", true)) { streamWriter.WriteLine((object) DateTime.Now); - streamWriter.WriteLine(text); + streamWriter.WriteLine((object) e); streamWriter.WriteLine(""); } - int num = (int) MessageBox.Show(text, "Terraria: Error"); + int num = (int) MessageBox.Show(e.ToString(), "Terraria: Error"); } catch { diff --git a/Projectile.cs b/Projectile.cs index 8b8d1e7..36ffe70 100644 --- a/Projectile.cs +++ b/Projectile.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Projectile -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -9,29 +9,23 @@ using ReLogic.Utilities; using System; using System.Collections.Generic; using Terraria.Audio; -using Terraria.Chat; using Terraria.DataStructures; using Terraria.Enums; using Terraria.GameContent; using Terraria.GameContent.Achievements; -using Terraria.GameContent.Creative; -using Terraria.GameContent.Drawing; using Terraria.GameContent.Events; -using Terraria.GameContent.Golf; -using Terraria.Graphics; +using Terraria.GameContent.UI; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.Localization; -using Terraria.Physics; -using Terraria.WorldBuilding; +using Terraria.World.Generation; namespace Terraria { public class Projectile : Entity { - public static uint[][] perIDStaticNPCImmunity = new uint[950][]; - public const int SentryLifeTime = 7200; - public const int ArrowLifeTime = 1200; + public static uint[][] perIDStaticNPCImmunity = new uint[714][]; + public static int SentryLifeTime = 7200; public float ownerHitCheckDistance = 1000f; public bool arrow; public int numHits; @@ -55,7 +49,6 @@ namespace Terraria public int timeLeft; public int soundDelay; public int damage; - public int originalDamage; public int spriteDirection = 1; public bool hostile; public float knockBack; @@ -87,37 +80,25 @@ namespace Terraria public string miscText = ""; public bool melee; public bool ranged; + public bool thrown; public bool magic; public bool coldDamage; public bool noEnchantments; - public bool noEnchantmentVisuals; public bool trap; public bool npcProj; - public bool originatedFromActivableTile; public int frameCounter; public int frame; public bool manualDirectionChange; public int projUUID = -1; - public bool decidesManualFallThrough; - public bool shouldFallThrough; public int localNPCHitCooldown = -2; public int idStaticNPCHitCooldown = -1; - private static Conditions.IsSolid _cachedConditions_solid = new Conditions.IsSolid(); - private static Conditions.NotNull _cachedConditions_notNull = new Conditions.NotNull(); - private List _whipPointsForCollision = new List(); - private static Microsoft.Xna.Framework.Rectangle _lanceHitboxBounds = new Microsoft.Xna.Framework.Rectangle(0, 0, 300, 300); - private static List> _medusaHeadTargetList = new List>(); - private static Projectile.NPCDistanceByIndexComparator _medusaTargetComparer = new Projectile.NPCDistanceByIndexComparator(); - private static List _ai164_blacklistedTargets = new List(); - private static List _ai158_blacklistedTargets = new List(); - private static List _ai156_blacklistedTargets = new List(); private static float[] _CompanionCubeScreamCooldown = new float[(int) byte.MaxValue]; public string Name => Lang.GetProjectileName(this.type).Value; public static void InitializeStaticThings() { - Projectile.perIDStaticNPCImmunity = new uint[950][]; + Projectile.perIDStaticNPCImmunity = new uint[714][]; for (int index = 0; index < Projectile.perIDStaticNPCImmunity.Length; ++index) Projectile.perIDStaticNPCImmunity[index] = new uint[200]; WorldGen.Hooks.OnWorldLoad += new Action(Projectile.ResetImmunity); @@ -125,14 +106,14 @@ namespace Terraria public static void ResetImmunity() { - for (int index1 = 0; index1 < 950; ++index1) + for (int index1 = 0; index1 < 714; ++index1) { for (int index2 = 0; index2 < 200; ++index2) Projectile.perIDStaticNPCImmunity[index1][index2] = 0U; } } - public static bool IsNPCIndexImmuneToProjectileType(int projectileType, int npcIndex) => Projectile.perIDStaticNPCImmunity[projectileType][npcIndex] <= Main.GameUpdateCount; + public static bool IsNPCImmune(int projectileType, int npcIndex) => Projectile.perIDStaticNPCImmunity[projectileType][npcIndex] <= Main.GameUpdateCount; public bool WipableTurret => this.owner == Main.myPlayer && this.sentry && !this.TurretShouldPersist(); @@ -182,8 +163,6 @@ namespace Terraria this.numHits = 0; this.netImportant = false; this.manualDirectionChange = false; - this.decidesManualFallThrough = false; - this.shouldFallThrough = false; this.localNPCHitCooldown = -2; this.idStaticNPCHitCooldown = -1; this.usesLocalNPCImmunity = false; @@ -211,7 +190,8 @@ namespace Terraria } for (int index = 0; index < (int) byte.MaxValue; ++index) this.playerImmune[index] = 0; - this.ResetLocalNPCHitImmunity(); + for (int index = 0; index < 200; ++index) + this.localNPCImmunity[index] = 0; this.noDropItem = false; this.minion = false; this.minionSlots = 0.0f; @@ -219,6 +199,7 @@ namespace Terraria this.spriteDirection = 1; this.melee = false; this.ranged = false; + this.thrown = false; this.magic = false; this.ownerHitCheck = false; this.hide = false; @@ -250,15 +231,12 @@ namespace Terraria this.timeLeft = 3600; this.friendly = false; this.damage = 0; - this.originalDamage = 0; this.knockBack = 0.0f; this.miscText = ""; this.coldDamage = false; this.noEnchantments = false; - this.noEnchantmentVisuals = false; this.trap = false; this.npcProj = false; - this.originatedFromActivableTile = false; this.projUUID = -1; this.frame = 0; this.frameCounter = 0; @@ -270,7 +248,6 @@ namespace Terraria this.aiStyle = 1; this.friendly = true; this.ranged = true; - this.timeLeft = 1200; } else if (this.type == 2) { @@ -281,7 +258,6 @@ namespace Terraria this.friendly = true; this.light = 1f; this.ranged = true; - this.timeLeft = 1200; } else if (this.type == 3) { @@ -290,7 +266,7 @@ namespace Terraria this.aiStyle = 2; this.friendly = true; this.penetrate = 4; - this.ranged = true; + this.thrown = true; } else if (this.type == 4) { @@ -302,7 +278,6 @@ namespace Terraria this.light = 0.35f; this.penetrate = 5; this.ranged = true; - this.timeLeft = 1200; } else if (this.type == 5) { @@ -313,11 +288,11 @@ namespace Terraria this.friendly = true; this.light = 0.4f; this.penetrate = -1; + this.timeLeft = 120; this.alpha = 100; this.ignoreWater = true; this.ranged = true; this.extraUpdates = 1; - this.timeLeft = 120; } else if (this.type == 6) { @@ -377,8 +352,8 @@ namespace Terraria } else if (this.type == 12) { - this.width = 18; - this.height = 18; + this.width = 16; + this.height = 16; this.aiStyle = 5; this.friendly = true; this.penetrate = -1; @@ -422,8 +397,8 @@ namespace Terraria } else if (this.type == 16) { - this.width = 32; - this.height = 32; + this.width = 10; + this.height = 10; this.aiStyle = 9; this.friendly = true; this.light = 0.8f; @@ -484,7 +459,7 @@ namespace Terraria this.aiStyle = 2; this.scale = 1.2f; this.friendly = true; - this.ranged = true; + this.thrown = true; } else if (this.type == 22) { @@ -515,24 +490,10 @@ namespace Terraria this.aiStyle = 14; this.friendly = true; this.penetrate = 6; - this.ranged = true; + this.thrown = true; } else if (this.type == 25) { - this.netImportant = true; - this.width = 22; - this.height = 22; - this.aiStyle = 15; - this.friendly = true; - this.penetrate = -1; - this.melee = true; - this.scale = 0.9f; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = 10; - } - else if (this.type == 26) - { - this.netImportant = true; this.width = 22; this.height = 22; this.aiStyle = 15; @@ -540,8 +501,16 @@ namespace Terraria this.penetrate = -1; this.melee = true; this.scale = 0.8f; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = 10; + } + else if (this.type == 26) + { + this.width = 22; + this.height = 22; + this.aiStyle = 15; + this.friendly = true; + this.penetrate = -1; + this.melee = true; + this.scale = 0.8f; } else if (this.type == 27) { @@ -577,7 +546,7 @@ namespace Terraria this.aiStyle = 16; this.friendly = true; this.penetrate = -1; - this.ranged = true; + this.thrown = true; } else if (this.type == 31) { @@ -591,7 +560,6 @@ namespace Terraria } else if (this.type == 32) { - this.netImportant = true; this.width = 18; this.height = 18; this.aiStyle = 7; @@ -612,19 +580,17 @@ namespace Terraria } else if (this.type == 34) { - this.width = 32; - this.height = 32; + this.width = 14; + this.height = 14; this.aiStyle = 9; this.friendly = true; this.light = 0.8f; - this.penetrate = 2; + this.alpha = 100; + this.penetrate = 1; this.magic = true; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = 12; } else if (this.type == 35) { - this.netImportant = true; this.width = 22; this.height = 22; this.aiStyle = 15; @@ -632,8 +598,6 @@ namespace Terraria this.penetrate = -1; this.melee = true; this.scale = 0.8f; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = 10; } else if (this.type == 36) { @@ -705,7 +669,6 @@ namespace Terraria this.width = 10; this.height = 10; this.aiStyle = 10; - this.ranged = true; this.friendly = true; this.extraUpdates = 1; } @@ -775,7 +738,7 @@ namespace Terraria this.aiStyle = 2; this.friendly = true; this.penetrate = 2; - this.ranged = true; + this.thrown = true; } else if (this.type == 49) { @@ -806,7 +769,6 @@ namespace Terraria this.width = 8; this.height = 8; this.aiStyle = 1; - this.ranged = true; this.friendly = true; } else if (this.type == 52) @@ -837,7 +799,7 @@ namespace Terraria this.aiStyle = 2; this.friendly = true; this.penetrate = 2; - this.ranged = true; + this.thrown = true; } else if (this.type == 55) { @@ -938,15 +900,12 @@ namespace Terraria } else if (this.type == 63) { - this.netImportant = true; this.width = 22; this.height = 22; this.aiStyle = 15; this.friendly = true; this.penetrate = -1; this.melee = true; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = 10; } else if (this.type == 64) { @@ -968,7 +927,6 @@ namespace Terraria this.height = 10; this.aiStyle = 10; this.friendly = true; - this.ranged = true; this.penetrate = -1; this.extraUpdates = 1; } @@ -1002,7 +960,6 @@ namespace Terraria this.height = 10; this.aiStyle = 10; this.friendly = true; - this.ranged = true; this.penetrate = -1; this.extraUpdates = 1; } @@ -1093,6 +1050,7 @@ namespace Terraria } this.aiStyle = 21; this.friendly = true; + this.ranged = true; this.alpha = 100; this.light = 0.3f; this.penetrate = -1; @@ -1101,15 +1059,13 @@ namespace Terraria } else if (this.type == 79) { - this.width = 32; - this.height = 32; + this.width = 10; + this.height = 10; this.aiStyle = 9; this.friendly = true; this.light = 0.8f; + this.alpha = (int) byte.MaxValue; this.magic = true; - this.penetrate = 3; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = 12; } else if (this.type == 80) { @@ -1128,6 +1084,7 @@ namespace Terraria this.height = 10; this.aiStyle = 1; this.hostile = true; + this.ranged = true; } else if (this.type == 82) { @@ -1135,6 +1092,7 @@ namespace Terraria this.height = 10; this.aiStyle = 1; this.hostile = true; + this.ranged = true; } else if (this.type == 83) { @@ -1253,7 +1211,6 @@ namespace Terraria this.aiStyle = 1; this.friendly = true; this.ranged = true; - this.timeLeft = 1200; } else if (this.type == 92) { @@ -1261,7 +1218,7 @@ namespace Terraria this.height = 24; this.aiStyle = 5; this.friendly = true; - this.penetrate = 1; + this.penetrate = 2; this.alpha = 50; this.scale = 0.8f; this.tileCollide = false; @@ -1339,7 +1296,7 @@ namespace Terraria this.penetrate = -1; this.trap = true; } - else if (this.type == 99 || this.type == 727) + else if (this.type == 99) { this.width = 31; this.height = 31; @@ -1393,7 +1350,6 @@ namespace Terraria this.friendly = true; this.light = 1f; this.ranged = true; - this.timeLeft = 1200; } else if (this.type == 104) { @@ -1468,7 +1424,7 @@ namespace Terraria this.scale = 0.9f; this.penetrate = -1; this.coldDamage = true; - this.ranged = true; + this.thrown = true; } else if (this.type == 110) { @@ -1557,7 +1513,6 @@ namespace Terraria this.aiStyle = 1; this.friendly = true; this.ranged = true; - this.timeLeft = 1200; } else if (this.type == 118) { @@ -1579,7 +1534,6 @@ namespace Terraria this.melee = true; this.penetrate = 2; this.friendly = true; - this.coldDamage = true; } else if (this.type == 120) { @@ -1591,7 +1545,6 @@ namespace Terraria this.ranged = true; this.coldDamage = true; this.extraUpdates = 1; - this.timeLeft = 1200; } else if (this.type == 121) { @@ -1728,8 +1681,6 @@ namespace Terraria this.friendly = true; this.penetrate = -1; this.ranged = true; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = -1; } else if (this.type == 134) { @@ -1757,8 +1708,6 @@ namespace Terraria this.friendly = true; this.penetrate = -1; this.ranged = true; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = -1; } else if (this.type == 137) { @@ -1786,8 +1735,6 @@ namespace Terraria this.friendly = true; this.penetrate = -1; this.ranged = true; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = -1; } else if (this.type == 140) { @@ -1815,8 +1762,6 @@ namespace Terraria this.friendly = true; this.penetrate = -1; this.ranged = true; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = -1; } else if (this.type == 143) { @@ -1923,7 +1868,6 @@ namespace Terraria } else if (this.type == 154) { - this.netImportant = true; this.width = 22; this.height = 22; this.aiStyle = 15; @@ -1931,8 +1875,6 @@ namespace Terraria this.penetrate = -1; this.melee = true; this.scale = 0.8f; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = 10; } else if (this.type == 155) { @@ -2071,8 +2013,6 @@ namespace Terraria this.friendly = true; this.ranged = true; this.timeLeft = 45; - this.usesIDStaticNPCImmunity = true; - this.idStaticNPCHitCooldown = 3; } else if (this.type == 171 || this.type == 505 || this.type == 506) { @@ -2093,7 +2033,6 @@ namespace Terraria this.light = 1f; this.ranged = true; this.coldDamage = true; - this.timeLeft = 1200; } else if (this.type == 173) { @@ -2175,6 +2114,7 @@ namespace Terraria this.alpha = (int) byte.MaxValue; this.scale = 1.2f; this.timeLeft = 600; + this.ranged = true; this.extraUpdates = 1; } else if (this.type == 181) @@ -2205,8 +2145,9 @@ namespace Terraria this.height = 22; this.aiStyle = 14; this.penetrate = 1; - this.timeLeft = 180; this.ranged = true; + this.timeLeft = 180; + this.thrown = true; this.friendly = true; } else if (this.type == 184) @@ -2272,7 +2213,7 @@ namespace Terraria this.height = 8; this.aiStyle = 36; this.friendly = true; - this.penetrate = 3; + this.penetrate = 4; this.alpha = (int) byte.MaxValue; this.timeLeft = 600; this.magic = true; @@ -2287,8 +2228,6 @@ namespace Terraria this.penetrate = -1; this.alpha = (int) byte.MaxValue; this.ranged = true; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = 14; } else if (this.type >= 191 && this.type <= 194) { @@ -2352,7 +2291,6 @@ namespace Terraria this.friendly = true; this.penetrate = -1; this.timeLeft *= 5; - this.ignoreWater = true; } else if (this.type == 200) { @@ -2642,13 +2580,12 @@ namespace Terraria else if (this.type == 225) { this.arrow = true; + this.penetrate = 2; this.width = 10; this.height = 10; this.aiStyle = 1; this.friendly = true; this.ranged = true; - this.extraUpdates = 1; - this.timeLeft = 1200; } else if (this.type == 226) { @@ -2682,10 +2619,8 @@ namespace Terraria this.height = 30; this.aiStyle = 44; this.friendly = true; - this.melee = true; this.scale = 1.1f; this.penetrate = -1; - this.noEnchantmentVisuals = true; } else if (this.type == 229) { @@ -2693,10 +2628,8 @@ namespace Terraria this.height = 30; this.aiStyle = 44; this.friendly = true; - this.melee = true; this.penetrate = -1; this.light = 0.2f; - this.noEnchantmentVisuals = true; } else if (this.type >= 230 && this.type <= 235) { @@ -2824,15 +2757,12 @@ namespace Terraria } else if (this.type == 247) { - this.netImportant = true; this.width = 34; this.height = 34; this.aiStyle = 15; this.friendly = true; this.penetrate = -1; this.melee = true; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = 10; } else if (this.type == 248) { @@ -2897,7 +2827,6 @@ namespace Terraria this.light = 0.8f; this.alpha = 100; this.magic = true; - this.coldDamage = true; } else if (this.type == 254) { @@ -2979,7 +2908,7 @@ namespace Terraria this.magic = true; this.extraUpdates = 100; this.timeLeft = 200; - this.penetrate = 1; + this.penetrate = -1; } else if (this.type == 261) { @@ -2990,7 +2919,6 @@ namespace Terraria this.penetrate = 6; this.magic = true; this.ignoreWater = true; - this.extraUpdates = 1; } else if (this.type == 262) { @@ -3038,10 +2966,7 @@ namespace Terraria this.alpha = (int) byte.MaxValue; this.friendly = true; this.magic = true; - this.penetrate = 3; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = 6; - this.timeLeft = 30; + this.penetrate = 4; } else if (this.type == 266) { @@ -3054,8 +2979,6 @@ namespace Terraria this.timeLeft *= 5; this.minion = true; this.minionSlots = 1f; - this.usesIDStaticNPCImmunity = true; - this.idStaticNPCHitCooldown = 12; } else if (this.type == 267) { @@ -3092,7 +3015,8 @@ namespace Terraria this.height = 26; this.aiStyle = 1; this.alpha = (int) byte.MaxValue; - this.hostile = true; + this.friendly = true; + this.magic = true; this.penetrate = 3; } else if (this.type == 271) @@ -3174,7 +3098,6 @@ namespace Terraria this.light = 1f; this.ranged = true; this.extraUpdates = 1; - this.timeLeft = 1200; } else if (this.type == 279) { @@ -3221,7 +3144,6 @@ namespace Terraria this.friendly = true; this.ranged = true; this.extraUpdates = 1; - this.timeLeft = 1200; } else if (this.type == 283) { @@ -3400,7 +3322,6 @@ namespace Terraria this.alpha = (int) byte.MaxValue; this.magic = true; this.extraUpdates = 1; - this.penetrate = 3; } else if (this.type == 298) { @@ -3519,7 +3440,7 @@ namespace Terraria this.width = 80; this.height = 74; this.aiStyle = 53; - this.timeLeft = 7200; + this.timeLeft = Projectile.SentryLifeTime; this.light = 0.25f; this.ignoreWater = true; this.coldDamage = true; @@ -3567,7 +3488,6 @@ namespace Terraria this.friendly = true; this.ranged = true; this.timeLeft = 300; - this.glowMask = (short) 257; } else if (this.type == 313) { @@ -3621,8 +3541,6 @@ namespace Terraria this.timeLeft *= 5; this.minion = true; this.minionSlots = 1f; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = 10; } else if (this.type == 318) { @@ -3630,7 +3548,7 @@ namespace Terraria this.height = 14; this.aiStyle = 2; this.friendly = true; - this.ranged = true; + this.thrown = true; } else if (this.type == 319) { @@ -3703,7 +3621,6 @@ namespace Terraria this.aiStyle = 1; this.hostile = true; this.tileCollide = false; - this.timeLeft = 420; } else if (this.type >= 326 && this.type <= 328) { @@ -3745,7 +3662,7 @@ namespace Terraria this.aiStyle = 2; this.friendly = true; this.penetrate = 6; - this.ranged = true; + this.thrown = true; } else if (this.type == 331) { @@ -3794,7 +3711,7 @@ namespace Terraria { this.width = 22; this.height = 22; - this.aiStyle = 30; + this.aiStyle = 2; this.friendly = true; this.penetrate = 1; this.melee = true; @@ -3867,7 +3784,6 @@ namespace Terraria this.melee = true; this.coldDamage = true; this.tileCollide = false; - this.noEnchantmentVisuals = true; } else if (this.type == 345) { @@ -3904,7 +3820,6 @@ namespace Terraria this.tileCollide = false; this.coldDamage = true; this.extraUpdates = 1; - this.timeLeft = 900; } else if (this.type == 349) { @@ -3914,7 +3829,6 @@ namespace Terraria this.hostile = true; this.penetrate = -1; this.coldDamage = true; - this.timeLeft = 900; } else if (this.type == 350) { @@ -3963,7 +3877,6 @@ namespace Terraria this.height = 10; this.aiStyle = 10; this.friendly = true; - this.ranged = true; this.penetrate = -1; this.extraUpdates = 1; } @@ -3975,10 +3888,7 @@ namespace Terraria this.alpha = (int) byte.MaxValue; this.friendly = true; this.magic = true; - this.penetrate = 5; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = 6; - this.timeLeft = 45; + this.penetrate = 7; } else if (this.type == 356) { @@ -4024,13 +3934,12 @@ namespace Terraria this.friendly = true; this.coldDamage = true; } - else if (this.type >= 360 && this.type <= 366 || this.type == 381 || this.type == 382 || this.type == 760 || this.type == 775) + else if (this.type >= 360 && this.type <= 366 || this.type == 381 || this.type == 382) { this.width = 14; this.height = 14; this.aiStyle = 61; this.penetrate = -1; - this.netImportant = true; this.bobber = true; } else if (this.type == 367) @@ -4088,7 +3997,6 @@ namespace Terraria } else if (this.type == 372) { - this.netImportant = true; this.width = 18; this.height = 18; this.aiStyle = 7; @@ -4152,7 +4060,7 @@ namespace Terraria this.width = 66; this.height = 50; this.aiStyle = 53; - this.timeLeft = 7200; + this.timeLeft = Projectile.SentryLifeTime; this.ignoreWater = true; this.sentry = true; } @@ -4241,8 +4149,6 @@ namespace Terraria this.tileCollide = false; this.ignoreWater = true; this.friendly = true; - this.usesIDStaticNPCImmunity = true; - this.idStaticNPCHitCooldown = 18; } else if (this.type == 388) { @@ -4257,8 +4163,6 @@ namespace Terraria this.tileCollide = false; this.ignoreWater = true; this.friendly = true; - this.usesIDStaticNPCImmunity = true; - this.idStaticNPCHitCooldown = 18; } else if (this.type == 389) { @@ -4282,9 +4186,10 @@ namespace Terraria this.netImportant = true; this.timeLeft *= 5; this.minion = true; - this.minionSlots = 1f; - this.usesIDStaticNPCImmunity = true; - this.idStaticNPCHitCooldown = 15; + this.minionSlots = 0.75f; + int type = this.type; + if (this.type != 392) + ; } else if (this.type == 393 || this.type == 394 || this.type == 395) { @@ -4296,13 +4201,12 @@ namespace Terraria this.timeLeft *= 5; this.minion = true; this.minionSlots = 1f; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = 18; - this.decidesManualFallThrough = true; + int type = this.type; + if (this.type != 395) + ; } else if (this.type == 396) { - this.netImportant = true; this.width = 18; this.height = 18; this.aiStyle = 7; @@ -4319,7 +4223,7 @@ namespace Terraria this.aiStyle = 16; this.friendly = true; this.penetrate = -1; - this.ranged = true; + this.thrown = true; this.tileCollide = false; } else if (this.type == 398) @@ -4340,7 +4244,7 @@ namespace Terraria this.friendly = true; this.penetrate = 1; this.alpha = (int) byte.MaxValue; - this.ranged = true; + this.thrown = true; this.noEnchantments = true; } else if (this.type >= 400 && this.type <= 402) @@ -4485,8 +4389,6 @@ namespace Terraria this.height = 4; this.aiStyle = 73; this.friendly = true; - this.usesIDStaticNPCImmunity = true; - this.idStaticNPCHitCooldown = 3; } else if (this.type == 423) { @@ -5015,7 +4917,6 @@ namespace Terraria this.aiStyle = 1; this.friendly = true; this.ranged = true; - this.timeLeft = 1200; } else if (this.type == 470) { @@ -5054,8 +4955,6 @@ namespace Terraria this.aiStyle = 1; this.friendly = true; this.ranged = true; - this.timeLeft = 1200; - this.penetrate = 2; } else if (this.type == 473) { @@ -5088,7 +4987,6 @@ namespace Terraria this.alpha = (int) byte.MaxValue; this.ignoreWater = true; this.timeLeft = 3; - this.magic = true; } else if (this.type == 477) { @@ -5150,14 +5048,14 @@ namespace Terraria this.aiStyle = 87; this.friendly = true; this.tileCollide = false; - this.penetrate = -1; + this.penetrate = 20; this.alpha = (int) byte.MaxValue; this.ignoreWater = true; this.timeLeft = 2700; - this.magic = true; } else if (this.type == 483) { + this.arrow = true; this.width = 14; this.height = 14; this.aiStyle = 14; @@ -5166,6 +5064,7 @@ namespace Terraria } else if (this.type == 484) { + this.arrow = true; this.width = 10; this.height = 10; this.aiStyle = 1; @@ -5182,7 +5081,6 @@ namespace Terraria this.friendly = true; this.ranged = true; this.penetrate = -1; - this.timeLeft = 1200; } else if (this.type >= 486 && this.type <= 489) { @@ -5207,7 +5105,6 @@ namespace Terraria this.width = 20; this.height = 16; } - this.netImportant = true; this.aiStyle = 7; this.friendly = true; this.penetrate = -1; @@ -5258,7 +5155,6 @@ namespace Terraria this.friendly = true; this.ranged = true; this.penetrate = 3; - this.timeLeft = 1200; } else if (this.type == 496) { @@ -5325,10 +5221,9 @@ namespace Terraria this.height = 10; this.aiStyle = 2; this.friendly = true; - this.melee = true; + this.magic = true; this.alpha = (int) byte.MaxValue; this.penetrate = 2; - this.noEnchantmentVisuals = true; } else if (this.type == 507) { @@ -5336,7 +5231,7 @@ namespace Terraria this.height = 16; this.aiStyle = 1; this.friendly = true; - this.ranged = true; + this.melee = true; this.penetrate = 3; } else if (this.type == 508) @@ -5435,7 +5330,7 @@ namespace Terraria this.aiStyle = 16; this.friendly = true; this.penetrate = -1; - this.ranged = true; + this.thrown = true; } else if (this.type == 518) { @@ -5463,8 +5358,7 @@ namespace Terraria this.aiStyle = 2; this.friendly = true; this.penetrate = 3; - this.ranged = true; - this.coldDamage = true; + this.thrown = true; } else if (this.type == 521) { @@ -5515,7 +5409,6 @@ namespace Terraria this.aiStyle = 97; this.tileCollide = false; this.timeLeft = 10800; - this.hide = true; } else if (this.type == 526) { @@ -5541,7 +5434,7 @@ namespace Terraria this.aiStyle = 1; this.scale = 1f; this.friendly = true; - this.ranged = true; + this.thrown = true; this.penetrate = 3; this.extraUpdates = 1; } @@ -5558,8 +5451,6 @@ namespace Terraria this.tileCollide = false; this.ignoreWater = true; this.friendly = true; - this.usesIDStaticNPCImmunity = true; - this.idStaticNPCHitCooldown = 10; } else if (this.type == 534) { @@ -5822,7 +5713,7 @@ namespace Terraria this.scale = 1.2f; this.timeLeft = 600; } - else if (this.type == 578 || this.type == 579 || this.type == 813) + else if (this.type == 578 || this.type == 579) { this.width = 32; this.height = 32; @@ -5923,7 +5814,7 @@ namespace Terraria this.aiStyle = 16; this.friendly = true; this.penetrate = -1; - this.ranged = true; + this.thrown = true; } else if (this.type == 590) { @@ -6014,7 +5905,7 @@ namespace Terraria this.height = 16; this.aiStyle = 113; this.friendly = true; - this.ranged = true; + this.melee = true; this.penetrate = -1; this.alpha = (int) byte.MaxValue; this.hide = true; @@ -6026,7 +5917,7 @@ namespace Terraria this.aiStyle = 2; this.friendly = true; this.penetrate = 6; - this.ranged = true; + this.thrown = true; } else if (this.type == 600) { @@ -6117,7 +6008,6 @@ namespace Terraria this.tileCollide = false; this.ignoreWater = true; this.usesLocalNPCImmunity = true; - this.noEnchantmentVisuals = true; } else if (this.type == 612) { @@ -6245,9 +6135,6 @@ namespace Terraria this.ignoreWater = true; this.tileCollide = false; this.netImportant = true; - this.manualDirectionChange = true; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = 5; } else if (this.type == 624) { @@ -6279,8 +6166,6 @@ namespace Terraria this.alpha = (int) byte.MaxValue; this.hide = true; this.netImportant = true; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = 7; } else if (this.type == 629) { @@ -6319,7 +6204,6 @@ namespace Terraria this.alpha = (int) byte.MaxValue; this.ignoreWater = true; this.extraUpdates = 1; - this.timeLeft = 1200; } else if (this.type == 633) { @@ -6444,7 +6328,7 @@ namespace Terraria this.width = 32; this.height = 32; this.aiStyle = 123; - this.timeLeft = 7200; + this.timeLeft = Projectile.SentryLifeTime; this.ignoreWater = true; this.tileCollide = false; this.alpha = (int) byte.MaxValue; @@ -6456,7 +6340,7 @@ namespace Terraria this.width = 32; this.height = 32; this.aiStyle = 123; - this.timeLeft = 7200; + this.timeLeft = Projectile.SentryLifeTime; this.ignoreWater = true; this.tileCollide = false; this.alpha = (int) byte.MaxValue; @@ -6487,7 +6371,6 @@ namespace Terraria } else if (this.type >= 646 && this.type <= 649) { - this.netImportant = true; this.width = 18; this.height = 18; this.aiStyle = 7; @@ -6521,7 +6404,6 @@ namespace Terraria } else if (this.type == 652) { - this.netImportant = true; this.width = 18; this.height = 18; this.aiStyle = 7; @@ -6650,7 +6532,7 @@ namespace Terraria this.width = 30; this.height = 54; this.aiStyle = 130; - this.timeLeft = 7200; + this.timeLeft = Projectile.SentryLifeTime; this.ignoreWater = true; this.tileCollide = false; this.manualDirectionChange = true; @@ -6666,7 +6548,6 @@ namespace Terraria break; } this.sentry = true; - this.netImportant = true; } else if (this.type == 664 || this.type == 666 || this.type == 668) { @@ -6686,7 +6567,7 @@ namespace Terraria this.friendly = true; this.penetrate = 1; this.alpha = (int) byte.MaxValue; - this.ranged = true; + this.thrown = true; this.noEnchantments = true; } else if (this.type == 670) @@ -6761,12 +6642,11 @@ namespace Terraria this.width = 26; this.height = 54; this.aiStyle = 134; - this.timeLeft = 7200; + this.timeLeft = Projectile.SentryLifeTime; this.ignoreWater = true; this.tileCollide = false; this.manualDirectionChange = true; this.sentry = true; - this.netImportant = true; } else if (this.type == 680) { @@ -6785,7 +6665,7 @@ namespace Terraria this.aiStyle = 16; this.hostile = true; this.penetrate = -1; - this.ranged = true; + this.thrown = true; } else if (this.type == 682) { @@ -6846,31 +6726,29 @@ namespace Terraria this.height = 16; this.aiStyle = 137; this.friendly = true; - this.ignoreWater = true; this.usesLocalNPCImmunity = true; - this.timeLeft = 7200; + this.timeLeft = Projectile.SentryLifeTime; this.localNPCHitCooldown = 3; this.tileCollide = false; this.penetrate = -1; this.sentry = true; - this.netImportant = true; } else if (this.type == 691 || this.type == 692 || this.type == 693) { this.width = 16; this.height = 16; this.aiStyle = 138; - this.ignoreWater = true; this.friendly = true; - this.timeLeft = 7200; + this.timeLeft = Projectile.SentryLifeTime; this.tileCollide = false; this.penetrate = -1; this.hide = true; this.sentry = true; - this.netImportant = true; } else if (this.type == 694 || this.type == 695 || this.type == 696) { + this.width = 16; + this.height = 16; this.aiStyle = 139; this.friendly = true; this.tileCollide = false; @@ -6950,7 +6828,7 @@ namespace Terraria this.penetrate = -1; this.netImportant = true; this.timeLeft *= 5; - this.scale = 1f; + this.scale = 0.85f; this.friendly = true; this.ignoreWater = true; this.tileCollide = false; @@ -7079,1440 +6957,6 @@ namespace Terraria this.hostile = true; this.penetrate = -1; } - else if (this.type == 714) - { - this.width = 22; - this.height = 22; - this.aiStyle = 75; - this.friendly = true; - this.penetrate = -1; - this.tileCollide = false; - this.hide = true; - this.ranged = true; - this.ignoreWater = true; - } - else if (this.type == 715 || this.type == 717) - { - this.width = 14; - this.height = 14; - this.aiStyle = 147; - this.friendly = true; - this.penetrate = 1; - this.alpha = (int) byte.MaxValue; - this.ranged = true; - this.extraUpdates = 2; - this.timeLeft = 360 * this.MaxUpdates; - } - else if (this.type == 716 || this.type == 718) - { - this.width = 14; - this.height = 14; - this.aiStyle = 147; - this.friendly = true; - this.penetrate = 1; - this.alpha = (int) byte.MaxValue; - this.ranged = true; - this.extraUpdates = 2; - this.timeLeft = 360 * this.MaxUpdates; - } - else if (this.type == 719) - { - this.width = 10; - this.height = 10; - this.hostile = true; - this.penetrate = -1; - this.aiStyle = 1; - this.tileCollide = true; - } - else if (this.type == 720) - { - this.width = 16; - this.height = 16; - this.aiStyle = 148; - this.tileCollide = false; - this.penetrate = -1; - this.alpha = (int) byte.MaxValue; - } - else if (this.type == 721 || this.type == 739 || this.type == 740 || this.type == 741 || this.type == 742 || this.type == 743 || this.type == 744 || this.type == 745 || this.type == 746 || this.type == 747 || this.type == 748 || this.type == 749 || this.type == 750 || this.type == 751 || this.type == 752) - { - this.netImportant = true; - this.width = 7; - this.height = 7; - this.friendly = true; - this.penetrate = -1; - this.aiStyle = 149; - this.tileCollide = false; - } - else if (this.type == 722) - { - this.width = 2; - this.height = 2; - this.aiStyle = 150; - this.tileCollide = false; - this.ignoreWater = true; - this.penetrate = -1; - this.alpha = (int) byte.MaxValue; - } - else if (this.type == 723 || this.type == 724 || this.type == 725 || this.type == 726) - { - this.width = 24; - this.height = 24; - this.aiStyle = 5; - this.friendly = true; - this.penetrate = 2; - this.alpha = 50; - this.tileCollide = false; - } - else if (this.type == 728) - { - this.width = 24; - this.height = 24; - this.aiStyle = 151; - this.alpha = (int) byte.MaxValue; - this.tileCollide = true; - this.ranged = true; - this.friendly = true; - this.penetrate = -1; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = -1; - } - else if (this.type == 729) - { - this.width = 20; - this.height = 20; - this.aiStyle = 152; - this.friendly = true; - this.tileCollide = false; - this.ignoreWater = true; - this.ranged = true; - this.penetrate = -1; - this.scale = (float) (1.0 + (double) Main.rand.Next(30) * 0.00999999977648258); - this.extraUpdates = 2; - this.timeLeft = 10 * this.MaxUpdates; - } - else if (this.type == 730) - { - this.width = 18; - this.height = 18; - this.aiStyle = 19; - this.friendly = true; - this.penetrate = -1; - this.tileCollide = false; - this.scale = 1f; - this.hide = true; - this.ownerHitCheck = true; - this.melee = true; - } - else if (this.type == 731) - { - this.width = 10; - this.height = 10; - this.aiStyle = 29; - this.alpha = (int) byte.MaxValue; - this.magic = true; - this.friendly = true; - this.extraUpdates = 1; - this.timeLeft = 90; - } - else if (this.type == 732) - { - this.tileCollide = true; - this.width = 15; - this.height = 15; - this.aiStyle = 44; - this.friendly = true; - this.penetrate = 1; - this.melee = true; - this.noEnchantmentVisuals = true; - } - else if (this.type == 733) - { - this.width = 2; - this.height = 2; - this.aiStyle = 153; - this.tileCollide = false; - this.ignoreWater = true; - this.penetrate = -1; - this.alpha = (int) byte.MaxValue; - } - else if (this.type == 734) - { - this.width = 30; - this.height = 24; - this.aiStyle = 154; - this.tileCollide = false; - this.timeLeft = 10800; - this.alpha = (int) byte.MaxValue; - this.hide = true; - } - else if (this.type == 735) - { - this.width = 68; - this.height = 64; - this.aiStyle = 75; - this.friendly = true; - this.tileCollide = false; - this.melee = true; - this.penetrate = -1; - this.ownerHitCheck = true; - } - else if (this.type == 736 || this.type == 737 || this.type == 738) - { - this.knockBack = 6f; - this.width = 10; - this.height = 10; - this.aiStyle = 10; - this.penetrate = -1; - } - else if (this.type == 753) - { - this.netImportant = true; - this.width = 18; - this.height = 18; - this.aiStyle = 7; - this.friendly = true; - this.penetrate = -1; - this.tileCollide = false; - this.timeLeft *= 10; - } - else if (this.type == 754) - { - this.width = 16; - this.height = 16; - this.aiStyle = 155; - this.tileCollide = false; - this.ignoreWater = true; - this.penetrate = -1; - this.alpha = (int) byte.MaxValue; - } - else if (this.type == 755) - { - this.netImportant = true; - this.width = 10; - this.height = 10; - this.penetrate = -1; - this.ignoreWater = true; - this.tileCollide = false; - this.friendly = true; - this.minion = true; - this.minionSlots = 1f; - this.timeLeft *= 5; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = 15; - this.aiStyle = 156; - } - else if (this.type == 756) - { - this.width = 32; - this.height = 32; - this.aiStyle = 157; - this.friendly = true; - this.alpha = (int) byte.MaxValue; - this.magic = true; - this.tileCollide = false; - this.ignoreWater = true; - this.penetrate = 2; - } - else if (this.type == 757) - { - this.netImportant = true; - this.width = 34; - this.height = 34; - this.aiStyle = 15; - this.friendly = true; - this.penetrate = -1; - this.melee = true; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = 10; - } - else if (this.type == 758) - { - this.width = 20; - this.height = 30; - this.aiStyle = 67; - this.penetrate = -1; - this.netImportant = true; - this.timeLeft *= 5; - this.minion = true; - this.minionSlots = 1f; - this.decidesManualFallThrough = true; - } - else if (this.type == 759) - { - this.netImportant = true; - this.width = 10; - this.height = 10; - this.penetrate = -1; - this.ignoreWater = true; - this.tileCollide = true; - this.friendly = true; - this.minion = true; - this.minionSlots = 1f; - this.timeLeft *= 5; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = 15; - this.aiStyle = 158; - this.hide = true; - } - else if (this.type == 761 || this.type == 762) - { - this.width = 10; - this.height = 10; - this.aiStyle = 159; - this.friendly = true; - this.manualDirectionChange = true; - } - else if (this.type == 763) - { - this.width = 10; - this.height = 10; - this.hostile = true; - this.friendly = true; - this.penetrate = -1; - this.aiStyle = 1; - this.tileCollide = true; - this.extraUpdates = 1; - } - else if (this.type == 764) - { - this.width = 20; - this.height = 20; - this.aiStyle = 144; - this.penetrate = -1; - this.netImportant = true; - this.timeLeft *= 5; - this.friendly = true; - this.ignoreWater = true; - this.tileCollide = false; - this.manualDirectionChange = true; - } - else if (this.type == 765) - { - this.netImportant = true; - this.width = 18; - this.height = 18; - this.aiStyle = 26; - this.friendly = true; - this.penetrate = -1; - this.timeLeft *= 5; - } - else if (this.type >= 766 && this.type <= 770 || this.type == 771) - { - this.width = 4; - this.height = 4; - this.aiStyle = 160; - this.penetrate = -1; - this.extraUpdates = 60; - } - else if (this.type == 772) - { - this.width = 22; - this.height = 22; - this.friendly = true; - this.aiStyle = 1; - this.tileCollide = true; - this.extraUpdates = 1; - } - else if (this.type == 773) - { - this.width = 22; - this.height = 22; - this.aiStyle = 16; - this.friendly = true; - this.penetrate = -1; - this.tileCollide = false; - } - else if (this.type == 774) - { - this.netImportant = true; - this.width = 26; - this.height = 26; - this.aiStyle = 26; - this.friendly = true; - this.penetrate = -1; - this.timeLeft *= 5; - } - else if (this.type == 802) - { - this.width = 18; - this.height = 18; - this.aiStyle = 161; - this.friendly = true; - this.penetrate = -1; - this.tileCollide = false; - this.scale = 1f; - this.ownerHitCheck = true; - this.melee = true; - this.extraUpdates = 1; - this.hide = true; - } - else if (this.type == 811 || this.type == 814) - { - this.width = 10; - this.height = 10; - this.aiStyle = 1; - this.alpha = (int) byte.MaxValue; - this.penetrate = -1; - this.friendly = false; - this.hostile = true; - } - else if (this.type >= 776 && this.type <= 801 || this.type >= 803 && this.type <= 810) - { - this.width = 14; - this.height = 14; - this.aiStyle = 16; - this.friendly = true; - this.penetrate = -1; - this.ranged = true; - if (this.type == 777 || this.type == 781 || this.type == 794 || this.type == 797 || this.type == 800 || this.type == 785 || this.type == 788 || this.type == 800) - { - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = -1; - } - } - else if (this.type == 812) - { - this.knockBack = 6f; - this.width = 10; - this.height = 10; - this.aiStyle = 10; - this.friendly = true; - this.hostile = true; - this.penetrate = -1; - } - else if (this.type == 815) - { - this.netImportant = true; - this.width = 26; - this.height = 26; - this.aiStyle = 26; - this.friendly = true; - this.penetrate = -1; - this.timeLeft *= 5; - } - else if (this.type == 816) - { - this.netImportant = true; - this.width = 26; - this.height = 32; - this.aiStyle = 26; - this.friendly = true; - this.penetrate = -1; - this.timeLeft *= 5; - } - else if (this.type == 817) - { - this.netImportant = true; - this.width = 26; - this.height = 26; - this.aiStyle = 26; - this.friendly = true; - this.penetrate = -1; - this.timeLeft *= 5; - } - else if (this.type == 819) - { - this.arrow = true; - this.width = 10; - this.height = 10; - this.aiStyle = 1; - this.alpha = (int) byte.MaxValue; - this.extraUpdates = 1; - this.hide = true; - this.friendly = true; - } - else if (this.type == 818) - { - this.width = 32; - this.height = 32; - this.aiStyle = 162; - this.friendly = true; - this.alpha = (int) byte.MaxValue; - this.magic = true; - this.tileCollide = false; - this.ignoreWater = true; - this.penetrate = -1; - this.extraUpdates = 3; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = 10; - } - else if (this.type == 820) - { - this.width = 12; - this.height = 12; - this.friendly = true; - this.aiStyle = 163; - this.tileCollide = true; - this.netImportant = true; - this.penetrate = -1; - this.timeLeft = 86400; - } - else if (this.type == 821) - { - this.netImportant = true; - this.width = 20; - this.height = 36; - this.aiStyle = 26; - this.friendly = true; - this.penetrate = -1; - this.timeLeft *= 5; - } - else if (this.type >= 822 && this.type <= 824) - { - this.netImportant = true; - this.width = 4; - this.height = 4; - this.aiStyle = 160; - this.penetrate = -1; - this.extraUpdates = 60; - } - else if (this.type == 825) - { - this.netImportant = true; - this.width = 26; - this.height = 32; - this.aiStyle = 26; - this.friendly = true; - this.penetrate = -1; - this.timeLeft *= 5; - } - else if (this.type >= 826 && this.type <= 830) - { - this.netImportant = true; - this.width = 4; - this.height = 4; - this.aiStyle = 160; - this.penetrate = -1; - this.extraUpdates = 60; - } - else if (this.type == 836) - { - this.width = 4; - this.height = 4; - this.aiStyle = 112; - this.hostile = true; - } - else if (this.type == 831) - { - this.netImportant = true; - this.width = 10; - this.height = 10; - this.penetrate = -1; - this.ignoreWater = true; - this.tileCollide = false; - this.friendly = true; - this.minion = true; - this.minionSlots = 1f; - this.timeLeft = 60; - this.aiStyle = 164; - this.hide = true; - } - else if (this.type == 833) - { - this.width = 26; - this.height = 20; - this.aiStyle = 67; - this.penetrate = -1; - this.netImportant = true; - this.timeLeft *= 5; - this.minion = true; - this.minionSlots = 0.0f; - this.decidesManualFallThrough = true; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = 10; - } - else if (this.type == 834) - { - this.width = 20; - this.height = 30; - this.aiStyle = 67; - this.penetrate = -1; - this.netImportant = true; - this.timeLeft *= 5; - this.minion = true; - this.minionSlots = 0.0f; - this.decidesManualFallThrough = true; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = 10; - } - else if (this.type == 835) - { - this.width = 20; - this.height = 30; - this.aiStyle = 67; - this.penetrate = -1; - this.netImportant = true; - this.timeLeft *= 5; - this.minion = true; - this.minionSlots = 0.0f; - this.decidesManualFallThrough = true; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = 10; - } - else if (this.type == 837) - { - this.width = 26; - this.height = 26; - this.aiStyle = 1; - this.alpha = (int) byte.MaxValue; - this.friendly = true; - this.magic = true; - this.penetrate = 3; - } - else if (this.type >= 838 && this.type <= 840) - { - this.netImportant = true; - this.width = 4; - this.height = 4; - this.aiStyle = 160; - this.penetrate = -1; - this.extraUpdates = 60; - } - else if (this.type == 841) - this.DefaultToWhip(); - else if (this.type == 842) - { - this.width = 18; - this.height = 18; - this.aiStyle = 161; - this.friendly = true; - this.penetrate = -1; - this.tileCollide = false; - this.scale = 1f; - this.ownerHitCheck = true; - this.melee = true; - this.extraUpdates = 1; - this.hide = true; - } - else if (this.type >= 843 && this.type <= 846) - { - this.netImportant = true; - this.width = 4; - this.height = 4; - this.aiStyle = 160; - this.penetrate = -1; - this.extraUpdates = 60; - } - else if (this.type == 847) - { - this.DefaultToWhip(); - this.extraUpdates = 2; - } - else if (this.type == 848) - this.DefaultToWhip(); - else if (this.type == 849) - { - this.DefaultToWhip(); - this.extraUpdates = 2; - } - else if (this.type == 850) - { - this.netImportant = true; - this.width = 4; - this.height = 4; - this.aiStyle = 160; - this.penetrate = -1; - this.extraUpdates = 60; - } - else if (this.type == 851) - { - this.netImportant = true; - this.width = 4; - this.height = 4; - this.aiStyle = 166; - this.penetrate = -1; - this.timeLeft = 300; - } - else if (this.type >= 852 && this.type <= 853) - { - this.netImportant = true; - this.width = 4; - this.height = 4; - this.aiStyle = 160; - this.penetrate = -1; - this.extraUpdates = 60; - } - else if (this.type == 854) - { - this.netImportant = true; - this.width = 26; - this.height = 32; - this.aiStyle = 26; - this.friendly = true; - this.penetrate = -1; - this.timeLeft *= 5; - } - else if (this.type == 855) - { - this.netImportant = true; - this.width = 12; - this.height = 12; - this.aiStyle = 166; - this.penetrate = -1; - this.timeLeft = 1000; - } - else if (this.type == 856) - { - this.width = 32; - this.height = 32; - this.aiStyle = 167; - this.friendly = true; - this.alpha = (int) byte.MaxValue; - this.magic = true; - this.tileCollide = false; - this.ignoreWater = true; - this.extraUpdates = 2; - this.usesLocalNPCImmunity = true; - } - else if (this.type == 857) - { - this.width = 32; - this.height = 32; - this.aiStyle = 168; - this.friendly = true; - this.alpha = (int) byte.MaxValue; - this.melee = true; - this.tileCollide = false; - this.ignoreWater = true; - this.extraUpdates = 1; - this.usesLocalNPCImmunity = true; - this.manualDirectionChange = true; - this.penetrate = -1; - this.hide = true; - } - else if (this.type == 858) - { - this.netImportant = true; - this.width = 26; - this.height = 20; - this.aiStyle = 26; - this.friendly = true; - this.penetrate = -1; - this.timeLeft *= 5; - } - else if (this.type == 859) - { - this.netImportant = true; - this.width = 20; - this.height = 32; - this.aiStyle = 26; - this.friendly = true; - this.penetrate = -1; - this.timeLeft *= 5; - } - else if (this.type == 860) - { - this.netImportant = true; - this.width = 20; - this.height = 20; - this.aiStyle = 26; - this.friendly = true; - this.penetrate = -1; - this.timeLeft *= 5; - } - else if (this.type == 861) - { - this.netImportant = true; - this.width = 10; - this.height = 10; - this.aiStyle = 2; - this.friendly = true; - } - else if (this.type == 862 || this.type == 863) - { - this.width = 14; - this.height = 14; - this.aiStyle = 16; - this.friendly = true; - this.penetrate = -1; - this.ranged = true; - } - else if (this.type == 864) - { - this.netImportant = true; - this.width = 10; - this.height = 10; - this.penetrate = -1; - this.usesLocalNPCImmunity = true; - this.ignoreWater = true; - this.tileCollide = false; - this.friendly = true; - this.minion = true; - this.minionSlots = 1f; - this.timeLeft = 60; - this.aiStyle = 169; - this.localNPCHitCooldown = 40; - } - else if (this.type == 865) - { - this.netImportant = true; - this.width = 18; - this.height = 18; - this.aiStyle = 7; - this.friendly = true; - this.penetrate = -1; - this.tileCollide = false; - this.timeLeft *= 10; - } - else if (this.type == 866) - { - this.light = 0.15f; - this.width = 30; - this.height = 30; - this.aiStyle = 3; - this.friendly = true; - this.penetrate = 5; - this.melee = true; - this.extraUpdates = 1; - this.usesLocalNPCImmunity = true; - } - else if (this.type == 867) - { - this.width = 22; - this.height = 22; - this.aiStyle = 3; - this.friendly = true; - this.penetrate = -1; - this.melee = true; - this.light = 0.6f; - } - else if (this.type == 868 || this.type == 869) - { - this.width = 18; - this.height = 18; - this.aiStyle = 2; - this.friendly = true; - this.penetrate = 1; - } - else if (this.type == 870) - { - this.netImportant = true; - this.width = 6; - this.height = 6; - this.aiStyle = 14; - this.penetrate = -1; - this.alpha = 75; - this.light = 1f; - this.timeLeft *= 5; - } - else if (this.type == 873) - { - this.width = 30; - this.height = 30; - this.aiStyle = 171; - this.alpha = (int) byte.MaxValue; - this.penetrate = -1; - this.friendly = false; - this.hostile = true; - this.timeLeft = 200; - this.tileCollide = false; - this.ignoreWater = true; - } - else if (this.type == 874) - { - this.width = 30; - this.height = 30; - this.aiStyle = 0; - this.alpha = (int) byte.MaxValue; - this.penetrate = -1; - this.friendly = false; - this.hostile = true; - this.timeLeft = 210; - this.tileCollide = false; - this.ignoreWater = true; - } - else if (this.type == 871) - { - this.width = 30; - this.height = 30; - this.aiStyle = 172; - this.alpha = (int) byte.MaxValue; - this.penetrate = -1; - this.friendly = false; - this.hostile = true; - this.timeLeft = 240; - this.tileCollide = false; - this.ignoreWater = true; - } - else if (this.type == 875) - { - this.netImportant = true; - this.width = 20; - this.height = 20; - this.aiStyle = 26; - this.friendly = true; - this.penetrate = -1; - this.timeLeft *= 5; - } - else if (this.type == 872) - { - this.width = 30; - this.height = 30; - this.aiStyle = 173; - this.alpha = (int) byte.MaxValue; - this.penetrate = -1; - this.friendly = false; - this.hostile = true; - this.timeLeft = 660; - this.tileCollide = false; - this.ignoreWater = true; - } - else if (this.type == 876) - { - this.width = 4; - this.height = 4; - this.aiStyle = 1; - this.friendly = true; - this.penetrate = 8; - this.light = 0.75f; - this.alpha = (int) byte.MaxValue; - this.extraUpdates = 3; - this.scale = 1.4f; - this.timeLeft = 3600; - this.magic = true; - } - else if (this.type >= 877 && this.type <= 879) - { - this.netImportant = true; - this.width = 25; - this.height = 25; - this.aiStyle = 19; - this.alpha = (int) byte.MaxValue; - this.friendly = true; - this.penetrate = -1; - this.tileCollide = false; - this.scale = 1f; - this.hide = true; - this.ownerHitCheck = true; - this.melee = true; - } - else if (this.type == 880) - { - this.width = 32; - this.height = 32; - this.aiStyle = 183; - this.penetrate = -1; - this.timeLeft = 18; - this.ignoreWater = true; - this.tileCollide = false; - this.friendly = true; - this.hostile = false; - this.manualDirectionChange = true; - } - else if (this.type == 881) - { - this.netImportant = true; - this.width = 20; - this.height = 20; - this.aiStyle = 26; - this.friendly = true; - this.penetrate = -1; - this.timeLeft *= 5; - } - else if (this.type == 882) - { - this.width = 20; - this.height = 20; - this.aiStyle = 124; - this.penetrate = -1; - this.netImportant = true; - this.timeLeft *= 5; - this.friendly = true; - this.ignoreWater = true; - this.tileCollide = false; - this.manualDirectionChange = true; - } - else if (this.type == 883) - { - this.width = 20; - this.height = 20; - this.aiStyle = 174; - this.penetrate = -1; - this.timeLeft *= 5; - this.friendly = true; - this.ignoreWater = true; - this.tileCollide = false; - this.netImportant = true; - } - else if (this.type >= 884 && this.type <= 886) - { - this.netImportant = true; - this.width = 20; - this.height = 20; - this.aiStyle = 26; - this.friendly = true; - this.penetrate = -1; - this.timeLeft *= 5; - } - else if (this.type == 887) - { - this.width = 20; - this.height = 20; - this.aiStyle = 174; - this.penetrate = -1; - this.timeLeft *= 5; - this.friendly = true; - this.ignoreWater = true; - this.tileCollide = false; - this.netImportant = true; - } - else if (this.type == 888) - { - this.width = 20; - this.height = 20; - this.aiStyle = 124; - this.penetrate = -1; - this.netImportant = true; - this.timeLeft *= 5; - this.friendly = true; - this.ignoreWater = true; - this.tileCollide = false; - this.manualDirectionChange = true; - } - else if (this.type >= 889 && this.type <= 892) - { - this.netImportant = true; - this.width = 20; - this.height = 20; - this.aiStyle = 26; - this.friendly = true; - this.penetrate = -1; - this.timeLeft *= 5; - } - else if (this.type == 893) - { - this.width = 20; - this.height = 20; - this.aiStyle = 174; - this.penetrate = -1; - this.timeLeft *= 5; - this.friendly = true; - this.ignoreWater = true; - this.tileCollide = false; - this.netImportant = true; - } - else if (this.type == 894) - { - this.netImportant = true; - this.width = 20; - this.height = 20; - this.aiStyle = 26; - this.friendly = true; - this.penetrate = -1; - this.timeLeft *= 5; - } - else if (this.type >= 895 && this.type <= 896) - { - this.width = 20; - this.height = 20; - this.aiStyle = 124; - this.penetrate = -1; - this.netImportant = true; - this.timeLeft *= 5; - this.friendly = true; - this.ignoreWater = true; - this.tileCollide = false; - this.manualDirectionChange = true; - } - else if (this.type == 897) - { - this.netImportant = true; - this.width = 20; - this.height = 20; - this.aiStyle = 26; - this.friendly = true; - this.penetrate = -1; - this.timeLeft *= 5; - } - else if (this.type == 898) - { - this.width = 20; - this.height = 20; - this.aiStyle = 124; - this.penetrate = -1; - this.netImportant = true; - this.timeLeft *= 5; - this.friendly = true; - this.ignoreWater = true; - this.tileCollide = false; - this.manualDirectionChange = true; - } - else if (this.type >= 899 && this.type <= 901) - { - this.netImportant = true; - this.width = 20; - this.height = 20; - this.aiStyle = 26; - this.friendly = true; - this.penetrate = -1; - this.timeLeft *= 5; - } - else if (this.type == 902) - { - this.width = 20; - this.height = 20; - this.aiStyle = 3; - this.friendly = true; - this.penetrate = -1; - this.melee = true; - this.MaxUpdates = 2; - } - else if (this.type >= 903 && this.type <= 906) - { - this.width = 22; - this.height = 22; - this.aiStyle = 16; - this.friendly = true; - this.penetrate = -1; - } - else if (this.type == 907) - { - this.width = 22; - this.height = 22; - this.aiStyle = 30; - this.friendly = true; - this.penetrate = 2; - this.melee = true; - } - else if (this.type == 908) - { - this.tileCollide = false; - this.ignoreWater = true; - this.width = 14; - this.height = 14; - this.aiStyle = 175; - this.friendly = true; - this.penetrate = 1; - this.timeLeft = 3600; - this.hide = true; - } - else if (this.type == 909) - { - this.width = 12; - this.height = 12; - this.aiStyle = 2; - this.friendly = false; - this.hostile = true; - this.penetrate = 1; - } - else if (this.type == 910) - { - this.width = 22; - this.height = 22; - this.aiStyle = 16; - this.friendly = true; - this.penetrate = -1; - } - else if (this.type == 911) - { - this.width = 22; - this.height = 22; - this.aiStyle = 16; - this.friendly = true; - this.penetrate = -1; - this.tileCollide = false; - } - else if (this.type >= 912 && this.type <= 915) - { - this.DefaultToWhip(); - if (this.type == 915) - this.extraUpdates = 2; - } - else if (this.type == 916) - { - this.width = 18; - this.height = 18; - this.aiStyle = 176; - this.friendly = true; - this.tileCollide = false; - this.penetrate = 2; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = -1; - this.extraUpdates = 2; - } - else if (this.type == 918) - { - this.aiStyle = 178; - this.friendly = true; - this.tileCollide = false; - this.penetrate = -1; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = -1; - this.alpha = (int) byte.MaxValue; - this.width = 96; - this.height = 96; - } - else if (this.type == 917) - { - this.width = 30; - this.height = 30; - this.aiStyle = 177; - this.friendly = true; - this.tileCollide = false; - this.penetrate = -1; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = 20; - } - else if (this.type == 919) - { - this.width = 8; - this.height = 8; - this.aiStyle = 179; - this.alpha = (int) byte.MaxValue; - this.penetrate = -1; - this.friendly = false; - this.hostile = true; - this.timeLeft = 240; - this.tileCollide = false; - this.ignoreWater = true; - } - else if (this.type == 920) - { - this.alpha = (int) byte.MaxValue; - this.width = 6; - this.height = 6; - this.aiStyle = 1; - this.hostile = true; - this.penetrate = 1; - } - else if (this.type == 921) - { - this.alpha = (int) byte.MaxValue; - this.width = 6; - this.height = 6; - this.aiStyle = 1; - this.hostile = true; - this.penetrate = 3; - } - else if (this.type == 922) - { - this.width = 30; - this.height = 30; - this.aiStyle = 135; - this.alpha = (int) byte.MaxValue; - this.tileCollide = false; - this.ignoreWater = true; - this.timeLeft = 120; - this.hostile = true; - this.penetrate = -1; - } - else if (this.type == 923) - { - this.width = 30; - this.height = 30; - this.aiStyle = 180; - this.alpha = (int) byte.MaxValue; - this.penetrate = -1; - this.friendly = false; - this.hostile = true; - this.timeLeft = 180; - this.tileCollide = false; - this.ignoreWater = true; - this.hide = true; - } - else if (this.type == 926) - { - this.alpha = (int) byte.MaxValue; - this.width = 12; - this.height = 12; - this.scale = 1f; - this.aiStyle = 1; - this.hostile = true; - this.penetrate = 2; - } - else if (this.type == 927) - { - this.width = 40; - this.height = 40; - this.aiStyle = 75; - this.friendly = true; - this.tileCollide = false; - this.melee = true; - this.penetrate = -1; - this.ownerHitCheck = true; - } - else if (this.type == 928) - { - this.netImportant = true; - this.width = 34; - this.height = 34; - this.aiStyle = 14; - this.friendly = true; - this.penetrate = 2; - this.melee = true; - this.timeLeft = 250; - } - else if (this.type == 929) - { - this.width = 32; - this.height = 32; - this.aiStyle = 183; - this.penetrate = -1; - this.timeLeft = 18; - this.ignoreWater = true; - this.tileCollide = false; - this.friendly = true; - this.hostile = false; - this.manualDirectionChange = true; - } - else if (this.type == 930) - { - this.width = 14; - this.height = 14; - this.aiStyle = 16; - this.friendly = true; - this.penetrate = -1; - this.ranged = true; - } - else if (this.type == 931) - { - this.width = 30; - this.height = 30; - this.aiStyle = 171; - this.alpha = (int) byte.MaxValue; - this.penetrate = 3; - this.friendly = true; - this.timeLeft = 240; - this.magic = true; - this.tileCollide = true; - this.ignoreWater = true; - this.extraUpdates = 1; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = 60; - } - else if (this.type == 932) - { - this.ranged = true; - this.arrow = true; - this.width = 10; - this.height = 10; - this.aiStyle = 181; - this.penetrate = 5; - this.friendly = true; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = -1; - this.timeLeft = 120; - this.alpha = 0; - this.ignoreWater = true; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = 60; - } - else if (this.type == 933) - { - this.width = 32; - this.height = 32; - this.aiStyle = 182; - this.friendly = true; - this.melee = true; - this.tileCollide = false; - this.ignoreWater = true; - this.alpha = (int) byte.MaxValue; - this.extraUpdates = 1; - this.usesLocalNPCImmunity = true; - this.manualDirectionChange = true; - this.localNPCHitCooldown = 15; - this.penetrate = -1; - this.noEnchantmentVisuals = true; - } - else if (this.type == 934) - { - this.netImportant = true; - this.width = 20; - this.height = 20; - this.aiStyle = 26; - this.friendly = true; - this.penetrate = -1; - this.timeLeft *= 5; - } - else if (this.type == 935) - { - this.netImportant = true; - this.width = 18; - this.height = 18; - this.aiStyle = 7; - this.friendly = true; - this.penetrate = -1; - this.tileCollide = false; - this.timeLeft *= 10; - this.extraUpdates = 3; - } - else if (this.type == 936) - { - this.width = 14; - this.height = 14; - this.aiStyle = 2; - this.friendly = true; - this.penetrate = 1; - this.Opacity = 0.6f; - } - else if (this.type == 937) - { - this.alpha = (int) byte.MaxValue; - this.width = 10; - this.height = 10; - this.aiStyle = 1; - this.hostile = false; - this.friendly = true; - this.penetrate = 3; - this.usesIDStaticNPCImmunity = true; - this.idStaticNPCHitCooldown = 10; - } - else if (this.type >= 938 && this.type <= 945) - { - this.width = 18; - this.height = 18; - this.aiStyle = 161; - this.friendly = true; - this.penetrate = -1; - this.tileCollide = false; - this.scale = 1f; - this.ownerHitCheck = true; - this.melee = true; - this.extraUpdates = 1; - this.timeLeft = 360; - this.hide = true; - } - else if (this.type == 946) - { - this.netImportant = true; - this.width = 10; - this.height = 10; - this.penetrate = -1; - this.ignoreWater = true; - this.tileCollide = false; - this.friendly = true; - this.minion = true; - this.minionSlots = 1f; - this.timeLeft *= 5; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = 15; - this.aiStyle = 156; - this.scale = 0.75f; - this.manualDirectionChange = true; - this.hide = true; - } - else if (this.type == 947 || this.type == 948) - { - this.netImportant = true; - this.width = 20; - this.height = 20; - this.aiStyle = 15; - this.friendly = true; - this.penetrate = -1; - this.melee = true; - this.scale = 1f; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = 10; - } - else if (this.type == 949) - { - this.width = 4; - this.height = 4; - this.aiStyle = 184; - this.penetrate = -1; - this.hostile = true; - this.tileCollide = false; - } else this.active = false; this.width = (int) ((double) this.width * (double) this.scale); @@ -8520,21 +6964,6 @@ namespace Terraria this.maxPenetrate = this.penetrate; } - private void DefaultToWhip() - { - this.width = 18; - this.height = 18; - this.aiStyle = 165; - this.friendly = true; - this.penetrate = -1; - this.tileCollide = false; - this.scale = 1f; - this.ownerHitCheck = true; - this.extraUpdates = 1; - this.usesLocalNPCImmunity = true; - this.localNPCHitCooldown = -1; - } - public static int GetNextSlot() { int num = 1000; @@ -8562,21 +6991,6 @@ namespace Terraria return Projectile.NewProjectile(position.X, position.Y, velocity.X, velocity.Y, Type, Damage, KnockBack, Owner, ai0, ai1); } - public static int FindOldestProjectile() - { - int num1 = 1000; - int num2 = 9999999; - for (int index = 0; index < 1000; ++index) - { - if (!Main.projectile[index].netImportant && Main.projectile[index].timeLeft < num2) - { - num1 = index; - num2 = Main.projectile[index].timeLeft; - } - } - return num1; - } - public static int NewProjectile( float X, float Y, @@ -8599,7 +7013,7 @@ namespace Terraria } } if (number == 1000) - number = Projectile.FindOldestProjectile(); + return number; Projectile projectile = Main.projectile[number]; projectile.SetDefaults(Type); projectile.position.X = X - (float) projectile.width * 0.5f; @@ -8650,7 +7064,7 @@ namespace Terraria projectile.ai[0] = projectile.position.X; projectile.ai[1] = projectile.position.Y; } - if (Type > 0 && Type < 950) + if (Type > 0 && Type < 714) { if (ProjectileID.Sets.NeedsUUID[Type]) projectile.projUUID = projectile.identity; @@ -8665,26 +7079,6 @@ namespace Terraria NetMessage.SendData(27, number: number); if (Owner == Main.myPlayer) { - if (ProjectileID.Sets.IsAGolfBall[Type] && Damage <= 0) - { - int num1 = 0; - int index1 = 0; - int num2 = 99999999; - for (int index2 = 0; index2 < 1000; ++index2) - { - if (Main.projectile[index2].active && ProjectileID.Sets.IsAGolfBall[Main.projectile[index2].type] && Main.projectile[index2].owner == Owner && Main.projectile[index2].damage <= 0) - { - ++num1; - if (num2 > Main.projectile[index2].timeLeft) - { - index1 = index2; - num2 = Main.projectile[index2].timeLeft; - } - } - } - if (num1 > 10) - Main.projectile[index1].Kill(); - } if (Type == 28) projectile.timeLeft = 180; if (Type == 516) @@ -8703,8 +7097,6 @@ namespace Terraria projectile.timeLeft = 180; if (Type == 37) projectile.timeLeft = 180; - if (Type == 773) - projectile.timeLeft = 180; if (Type == 75) projectile.timeLeft = 180; if (Type == 133) @@ -8727,12 +7119,6 @@ namespace Terraria projectile.timeLeft = 600; if (Type == 588) projectile.timeLeft = 180; - if (Type == 779) - projectile.timeLeft = 60; - if (Type == 783) - projectile.timeLeft = 60; - if (Type == 862 || Type == 863) - projectile.timeLeft = 60; if (Type == 443) projectile.timeLeft = 300; if (Type == 681) @@ -8743,279 +7129,210 @@ namespace Terraria projectile.timeLeft = 120; if (Type == 680 && Main.player[projectile.owner].setSquireT2) projectile.penetrate = 7; - if (Type == 777 || Type == 781 || Type == 794 || Type == 797 || Type == 800 || Type == 785 || Type == 788 || Type == 791 || Type == 903 || Type == 904 || Type == 905 || Type == 906 || Type == 910 || Type == 911) - projectile.timeLeft = 180; } if (Type == 249) projectile.frame = Main.rand.Next(5); return number; } - public static Color GetGolfTrailColor(Projectile proj) - { - switch (proj.type) - { - case 739: - return new Color(50, 50, 50, 80); - case 740: - return new Color(30, 50, (int) byte.MaxValue, 40); - case 741: - return new Color(150, 90, 60, 90); - case 742: - return new Color(30, (int) byte.MaxValue, 170, 30); - case 743: - return new Color(30, (int) byte.MaxValue, 30, 40); - case 744: - return new Color(190, (int) byte.MaxValue, 30, 50); - case 745: - return new Color((int) byte.MaxValue, 130, 30, 50); - case 746: - return new Color((int) byte.MaxValue, 50, 110, 50); - case 747: - return new Color(130, 10, 200, 40); - case 748: - return new Color((int) byte.MaxValue, 30, 50, 50); - case 749: - return new Color(100, 180, (int) byte.MaxValue, 30); - case 750: - return new Color(50, 240, 160, 30); - case 751: - return new Color(220, 80, 220, 70); - case 752: - return new Color((int) byte.MaxValue, 180, 50, 30); - default: - return new Color(160, 160, (int) byte.MaxValue, 50); - } - } - public void StatusNPC(int i) { - NPC npc = Main.npc[i]; if (this.melee && Main.player[this.owner].meleeEnchant > (byte) 0 && !this.noEnchantments) { int meleeEnchant = (int) Main.player[this.owner].meleeEnchant; if (meleeEnchant == 1) - npc.AddBuff(70, 60 * Main.rand.Next(5, 10)); + Main.npc[i].AddBuff(70, 60 * Main.rand.Next(5, 10)); if (meleeEnchant == 2) - npc.AddBuff(39, 60 * Main.rand.Next(3, 7)); + Main.npc[i].AddBuff(39, 60 * Main.rand.Next(3, 7)); if (meleeEnchant == 3) - npc.AddBuff(24, 60 * Main.rand.Next(3, 7)); + Main.npc[i].AddBuff(24, 60 * Main.rand.Next(3, 7)); if (meleeEnchant == 5) - npc.AddBuff(69, 60 * Main.rand.Next(10, 20)); + Main.npc[i].AddBuff(69, 60 * Main.rand.Next(10, 20)); if (meleeEnchant == 6) - npc.AddBuff(31, 60 * Main.rand.Next(1, 4)); + Main.npc[i].AddBuff(31, 60 * Main.rand.Next(1, 4)); if (meleeEnchant == 8) - npc.AddBuff(20, 60 * Main.rand.Next(5, 10)); + Main.npc[i].AddBuff(20, 60 * Main.rand.Next(5, 10)); if (meleeEnchant == 4) - npc.AddBuff(72, 120); + Main.npc[i].AddBuff(72, 120); } if (this.type == 195) { if (Main.rand.Next(3) == 0) - npc.AddBuff(70, 60 * Main.rand.Next(5, 11)); + Main.npc[i].AddBuff(70, 60 * Main.rand.Next(10, 21)); else - npc.AddBuff(20, 60 * Main.rand.Next(10, 21)); - } - switch (this.type) - { - case 841: - npc.AddBuff(307, 240); - break; - case 847: - npc.AddBuff(309, 240); - break; - case 848: - npc.AddBuff(319, 240); - break; - case 849: - npc.AddBuff(310, 240); - break; - case 913: - if ((double) this.localAI[0] == 0.0) - npc.AddBuff(313, 240); - npc.AddBuff(24, 240); - break; - case 914: - npc.AddBuff(20, 240); - npc.AddBuff(315, 240); - break; - case 915: - npc.AddBuff(316, 240); - break; + Main.npc[i].AddBuff(20, 60 * Main.rand.Next(10, 21)); } if (this.type == 664 && Main.rand.Next(3) == 0) - npc.AddBuff(24, 60 * Main.rand.Next(3, 6)); + Main.npc[i].AddBuff(24, 60 * Main.rand.Next(3, 6)); if (this.type == 666 && Main.rand.Next(2) == 0) - npc.AddBuff(24, 60 * Main.rand.Next(3, 9)); + Main.npc[i].AddBuff(24, 60 * Main.rand.Next(3, 9)); if (this.type == 668 && Main.rand.Next(3) != 0) - npc.AddBuff(24, 60 * Main.rand.Next(6, 9)); + Main.npc[i].AddBuff(24, 60 * Main.rand.Next(6, 9)); if (this.type == 567 || this.type == 568) - npc.AddBuff(20, 60 * Main.rand.Next(5, 11)); - if (this.type == 598 && (double) this.ai[1] == (double) i) - npc.AddBuff(169, 900); - if (this.type == 636 && (double) this.ai[1] == (double) i) - npc.AddBuff(189, 300); + Main.npc[i].AddBuff(20, 60 * Main.rand.Next(5, 11)); + if (this.type == 598) + Main.npc[i].AddBuff(169, 900); + if (this.type == 636) + Main.npc[i].AddBuff(189, 300); if (this.type == 611) - npc.AddBuff(189, 300); + Main.npc[i].AddBuff(189, 300); if (this.type == 612) - npc.AddBuff(189, 300); + Main.npc[i].AddBuff(189, 300); if (this.type == 711) - npc.AddBuff(203, 600); + Main.npc[i].AddBuff(203, 600); if (this.type == 706) - npc.AddBuff(24, 480); - if (this.type == 614 && (double) this.ai[1] == (double) i) - npc.AddBuff(183, 900); + Main.npc[i].AddBuff(24, 480); + if (this.type == 614) + Main.npc[i].AddBuff(183, 900); if (this.type == 585) - npc.AddBuff(153, 60 * Main.rand.Next(5, 11)); + Main.npc[i].AddBuff(153, 60 * Main.rand.Next(5, 11)); if (this.type == 583) - npc.AddBuff(20, 60 * Main.rand.Next(3, 6)); + Main.npc[i].AddBuff(20, 60 * Main.rand.Next(3, 6)); if (this.type == 524) - npc.AddBuff(69, 60 * Main.rand.Next(3, 8)); - if (this.type == 504 && Main.rand.Next(2) == 0) + Main.npc[i].AddBuff(69, 60 * Main.rand.Next(3, 8)); + if (this.type == 504 && Main.rand.Next(3) == 0) { if (Main.rand.Next(3) == 0) - npc.AddBuff(24, Main.rand.Next(60, 180)); + Main.npc[i].AddBuff(24, Main.rand.Next(60, 180)); else - npc.AddBuff(24, Main.rand.Next(30, 120)); + Main.npc[i].AddBuff(24, Main.rand.Next(30, 120)); } if ((this.type == 694 || this.type == 695 || this.type == 696) && Main.player[this.owner].setHuntressT2 && Main.rand.Next(2) == 0) - npc.AddBuff(204, Main.rand.Next(8, 18) * 30); + Main.npc[i].AddBuff(204, Main.rand.Next(8, 18) * 30); if (this.type == 545 && Main.rand.Next(3) == 0) - npc.AddBuff(24, Main.rand.Next(60, 240)); + Main.npc[i].AddBuff(24, Main.rand.Next(60, 240)); if (this.type == 553) - npc.AddBuff(24, Main.rand.Next(180, 480)); + Main.npc[i].AddBuff(24, Main.rand.Next(180, 480)); if (this.type == 552 && Main.rand.Next(3) != 0) - npc.AddBuff(44, Main.rand.Next(120, 320)); + Main.npc[i].AddBuff(44, Main.rand.Next(120, 320)); if (this.type == 495) - npc.AddBuff(153, Main.rand.Next(120, 300)); + Main.npc[i].AddBuff(153, Main.rand.Next(120, 300)); if (this.type == 497) - npc.AddBuff(153, Main.rand.Next(60, 180)); + Main.npc[i].AddBuff(153, Main.rand.Next(60, 180)); if (this.type == 496) - npc.AddBuff(153, Main.rand.Next(240, 480)); + Main.npc[i].AddBuff(153, Main.rand.Next(240, 480)); if (this.type == 476) - npc.AddBuff(151, 30); + Main.npc[i].AddBuff(151, 30); if (this.type == 523) - npc.AddBuff(20, 60 * Main.rand.Next(10, 30)); + Main.npc[i].AddBuff(20, 60 * Main.rand.Next(10, 30)); if (this.type == 478 || this.type == 480) - npc.AddBuff(39, 60 * Main.rand.Next(3, 7)); + Main.npc[i].AddBuff(39, 60 * Main.rand.Next(3, 7)); if (this.type == 479) - npc.AddBuff(69, 60 * Main.rand.Next(7, 15)); + Main.npc[i].AddBuff(69, 60 * Main.rand.Next(7, 15)); if (this.type == 379) - npc.AddBuff(70, 60 * Main.rand.Next(2, 5)); + Main.npc[i].AddBuff(70, 60 * Main.rand.Next(4, 7)); if (this.type >= 390 && this.type <= 392) - npc.AddBuff(70, 60 * Main.rand.Next(2, 5)); + Main.npc[i].AddBuff(70, 60 * Main.rand.Next(2, 5)); if (this.type == 374) - npc.AddBuff(20, 60 * Main.rand.Next(4, 7)); + Main.npc[i].AddBuff(20, 60 * Main.rand.Next(4, 7)); if (this.type == 376) - npc.AddBuff(24, 60 * Main.rand.Next(3, 7)); + Main.npc[i].AddBuff(24, 60 * Main.rand.Next(3, 7)); if (this.type >= 399 && this.type <= 402) - npc.AddBuff(24, 60 * Main.rand.Next(3, 7)); + Main.npc[i].AddBuff(24, 60 * Main.rand.Next(3, 7)); if (this.type == 295 || this.type == 296) - npc.AddBuff(24, 60 * Main.rand.Next(8, 16)); - if ((this.melee || this.ranged) && !this.npcProj && Main.player[this.owner].frostBurn && !this.noEnchantments) - npc.AddBuff(44, 60 * Main.rand.Next(5, 15)); + Main.npc[i].AddBuff(24, 60 * Main.rand.Next(8, 16)); + if ((this.melee || this.ranged) && Main.player[this.owner].frostBurn && !this.noEnchantments) + Main.npc[i].AddBuff(44, 60 * Main.rand.Next(5, 15)); if (this.melee && Main.player[this.owner].magmaStone && !this.noEnchantments) { if (Main.rand.Next(7) == 0) - npc.AddBuff(24, 360); + Main.npc[i].AddBuff(24, 360); else if (Main.rand.Next(3) == 0) - npc.AddBuff(24, 120); + Main.npc[i].AddBuff(24, 120); else - npc.AddBuff(24, 60); + Main.npc[i].AddBuff(24, 60); } if (this.type == 287) - npc.AddBuff(72, 120); + Main.npc[i].AddBuff(72, 120); if (this.type == 285) { if (Main.rand.Next(3) == 0) - npc.AddBuff(31, 180); + Main.npc[i].AddBuff(31, 180); else - npc.AddBuff(31, 60); + Main.npc[i].AddBuff(31, 60); } if (this.type == 2 && Main.rand.Next(3) == 0) - npc.AddBuff(24, 180); + Main.npc[i].AddBuff(24, 180); if (this.type == 172) { if (Main.rand.Next(3) == 0) - npc.AddBuff(44, 180); + Main.npc[i].AddBuff(44, 180); } else if (this.type == 15) { if (Main.rand.Next(2) == 0) - npc.AddBuff(24, 300); + Main.npc[i].AddBuff(24, 300); } else if (this.type == 253) - npc.AddBuff(44, 480); + { + if (Main.rand.Next(2) == 0) + Main.npc[i].AddBuff(44, 480); + } else if (this.type == 19) { if (Main.rand.Next(5) == 0) - npc.AddBuff(24, 180); + Main.npc[i].AddBuff(24, 180); } else if (this.type == 33) { if (Main.rand.Next(5) == 0) - npc.AddBuff(20, 420); + Main.npc[i].AddBuff(20, 420); } else if (this.type == 34) { if (Main.rand.Next(2) == 0) - npc.AddBuff(24, Main.rand.Next(240, 480)); - } - else if (this.type == 948) - { - if (Main.rand.Next(6) == 0) - npc.AddBuff(24, 60 * Main.rand.Next(2, 4)); + Main.npc[i].AddBuff(24, Main.rand.Next(240, 480)); } else if (this.type == 35) { - if (Main.rand.Next(2) == 0) - npc.AddBuff(24, 300); + if (Main.rand.Next(4) == 0) + Main.npc[i].AddBuff(24, 180); } else if (this.type == 54) { if (Main.rand.Next(2) == 0) - npc.AddBuff(20, 600); + Main.npc[i].AddBuff(20, 600); } else if (this.type == 267) { if (Main.rand.Next(3) == 0) - npc.AddBuff(20, 3600); + Main.npc[i].AddBuff(20, 3600); else - npc.AddBuff(20, 1800); + Main.npc[i].AddBuff(20, 1800); } else if (this.type == 63) { if (Main.rand.Next(5) != 0) - npc.AddBuff(31, 60 * Main.rand.Next(2, 5)); + Main.npc[i].AddBuff(31, 60 * Main.rand.Next(2, 5)); } else if (this.type == 85 || this.type == 188) - npc.AddBuff(24, 1200); - else if (this.type == 95 || this.type == 103 || this.type == 104 || this.type == 482) - npc.AddBuff(39, 420); + Main.npc[i].AddBuff(24, 1200); + else if (this.type == 95 || this.type == 103 || this.type == 104) + Main.npc[i].AddBuff(39, 420); else if (this.type == 278 || this.type == 279 || this.type == 280) - npc.AddBuff(69, 600); + Main.npc[i].AddBuff(69, 600); else if (this.type == 282 || this.type == 283) - npc.AddBuff(70, 600); + Main.npc[i].AddBuff(70, 600); if (this.type == 163 || this.type == 310) { if (Main.rand.Next(3) == 0) - npc.AddBuff(24, 600); + Main.npc[i].AddBuff(24, 600); else - npc.AddBuff(24, 300); + Main.npc[i].AddBuff(24, 300); } else if (this.type == 98) - npc.AddBuff(20, 600); + Main.npc[i].AddBuff(20, 600); else if (this.type == 184) - npc.AddBuff(20, 900); + Main.npc[i].AddBuff(20, 900); else if (this.type == 265) { - npc.AddBuff(20, 1800); + Main.npc[i].AddBuff(20, 1800); } else { if (this.type != 355) return; - npc.AddBuff(70, 1800); + Main.npc[i].AddBuff(70, 1800); } } @@ -9025,34 +7342,32 @@ namespace Terraria { int meleeEnchant = (int) Main.player[this.owner].meleeEnchant; if (meleeEnchant == 1) - Main.player[i].AddBuff(70, 60 * Main.rand.Next(5, 10), false); + Main.player[i].AddBuff(70, 60 * Main.rand.Next(5, 10)); if (meleeEnchant == 2) - Main.player[i].AddBuff(39, 60 * Main.rand.Next(3, 7), false); + Main.player[i].AddBuff(39, 60 * Main.rand.Next(3, 7)); if (meleeEnchant == 3) - Main.player[i].AddBuff(24, 60 * Main.rand.Next(3, 7), false); + Main.player[i].AddBuff(24, 60 * Main.rand.Next(3, 7)); if (meleeEnchant == 5) - Main.player[i].AddBuff(69, 60 * Main.rand.Next(10, 20), false); + Main.player[i].AddBuff(69, 60 * Main.rand.Next(10, 20)); if (meleeEnchant == 6) - Main.player[i].AddBuff(31, 60 * Main.rand.Next(1, 4), false); + Main.player[i].AddBuff(31, 60 * Main.rand.Next(1, 4)); if (meleeEnchant == 8) - Main.player[i].AddBuff(20, 60 * Main.rand.Next(5, 10), false); + Main.player[i].AddBuff(20, 60 * Main.rand.Next(5, 10)); } if (this.type == 295 || this.type == 296) - Main.player[i].AddBuff(24, 60 * Main.rand.Next(8, 16), false); - if (this.type >= 399 && this.type <= 402) - Main.player[i].AddBuff(24, 60 * Main.rand.Next(3, 7), false); + Main.player[i].AddBuff(24, 60 * Main.rand.Next(8, 16)); if (this.type == 478 || this.type == 480) - Main.player[i].AddBuff(39, 60 * Main.rand.Next(3, 7), false); + Main.player[i].AddBuff(39, 60 * Main.rand.Next(3, 7)); if ((this.melee || this.ranged) && Main.player[this.owner].frostBurn && !this.noEnchantments) Main.player[i].AddBuff(44, 60 * Main.rand.Next(1, 8), false); if (this.melee && Main.player[this.owner].magmaStone && !this.noEnchantments) { if (Main.rand.Next(4) == 0) - Main.player[i].AddBuff(24, 360, false); + Main.player[i].AddBuff(24, 360); else if (Main.rand.Next(2) == 0) - Main.player[i].AddBuff(24, 240, false); + Main.player[i].AddBuff(24, 240); else - Main.player[i].AddBuff(24, 120, false); + Main.player[i].AddBuff(24, 120); } if (this.type == 2 && Main.rand.Next(3) == 0) Main.player[i].AddBuff(24, 180, false); @@ -9099,53 +7414,53 @@ namespace Terraria else if (this.type == 267) { if (Main.rand.Next(3) == 0) - Main.player[i].AddBuff(20, 3600, false); + Main.player[i].AddBuff(20, 3600); else - Main.player[i].AddBuff(20, 1800, false); + Main.player[i].AddBuff(20, 1800); } else if (this.type == 63) { if (Main.rand.Next(3) != 0) - Main.player[i].AddBuff(31, 120, false); + Main.player[i].AddBuff(31, 120); } else if (this.type == 85 || this.type == 188) Main.player[i].AddBuff(24, 1200, false); - else if (this.type == 95 || this.type == 103 || this.type == 104 || this.type == 482) - Main.player[i].AddBuff(39, 420, false); + else if (this.type == 95 || this.type == 103 || this.type == 104) + Main.player[i].AddBuff(39, 420); else if (this.type == 278 || this.type == 279 || this.type == 280) - Main.player[i].AddBuff(69, 900, false); + Main.player[i].AddBuff(69, 900); else if (this.type == 282 || this.type == 283) - Main.player[i].AddBuff(70, 600, false); + Main.player[i].AddBuff(70, 600); if (this.type == 163 || this.type == 310) { if (Main.rand.Next(3) == 0) - Main.player[i].AddBuff(24, 600, false); + Main.player[i].AddBuff(24, 600); else - Main.player[i].AddBuff(24, 300, false); + Main.player[i].AddBuff(24, 300); } else if (this.type == 265) { - Main.player[i].AddBuff(20, 1200, false); + Main.player[i].AddBuff(20, 1200); } else { if (this.type != 355) return; - Main.player[i].AddBuff(70, 1800, false); + Main.player[i].AddBuff(70, 1800); } } public void ghostHurt(int dmg, Vector2 Position) { - if (!this.magic || this.damage <= 0) + if (!this.magic) return; - int damage = this.damage; - if (dmg <= 1) + int Damage = this.damage / 2; + if (dmg / 2 <= 1) return; int num1 = 1000; if ((double) Main.player[Main.myPlayer].ghostDmg > (double) num1) return; - Main.player[Main.myPlayer].ghostDmg += (float) damage; + Main.player[Main.myPlayer].ghostDmg += (float) Damage; int[] numArray1 = new int[200]; int maxValue1 = 0; int[] numArray2 = new int[200]; @@ -9178,7 +7493,7 @@ namespace Terraria float num6 = (float) (4.0 / Math.Sqrt((double) num4 * (double) num4 + (double) num5 * (double) num5)); float SpeedX = num4 * num6; float SpeedY = num5 * num6; - Projectile.NewProjectile(Position.X, Position.Y, SpeedX, SpeedY, 356, damage, 0.0f, this.owner, (float) num3); + Projectile.NewProjectile(Position.X, Position.Y, SpeedX, SpeedY, 356, Damage, 0.0f, this.owner, (float) num3); } public void ghostHeal(int dmg, Vector2 Position) @@ -9217,8 +7532,6 @@ namespace Terraria public void StatusPlayer(int i) { - if (Main.player[i].creativeGodMode) - return; if (this.type == 472) Main.player[i].AddBuff(149, Main.rand.Next(30, 150)); if (this.type == 467) @@ -9274,9 +7587,9 @@ namespace Terraria else if (Main.rand.Next(2) == 0) Main.player[i].AddBuff(46, 300); } - if (this.type >= 399 && this.type <= 402 && !this.hostile) - Main.player[i].AddBuff(24, 60 * Main.rand.Next(3, 7)); - if (this.type == 55 || this.type == 719) + if (this.type >= 399 && this.type <= 402) + Main.npc[i].AddBuff(24, 60 * Main.rand.Next(3, 7)); + if (this.type == 55) { if (Main.rand.Next(3) == 0) Main.player[i].AddBuff(20, 600); @@ -9287,11 +7600,9 @@ namespace Terraria Main.player[i].AddBuff(22, 900); if (this.type == 293) Main.player[i].AddBuff(80, 60 * Main.rand.Next(2, 7)); - if (this.type == 299) - Main.player[i].AddBuff(23, 240); if (this.type == 82 && Main.rand.Next(3) == 0) Main.player[i].AddBuff(24, 420); - if (this.type == 285 && !this.hostile) + if (this.type == 285) { if (Main.rand.Next(3) == 0) Main.player[i].AddBuff(31, 180); @@ -9301,15 +7612,15 @@ namespace Terraria if (this.type == 96 || this.type == 101) { if (Main.rand.Next(6) == 0) - Main.player[i].AddBuff(39, 180); + Main.player[i].AddBuff(39, 480); else if (Main.rand.Next(4) == 0) - Main.player[i].AddBuff(39, 180); + Main.player[i].AddBuff(39, 300); else if (Main.rand.Next(2) == 0) - Main.player[i].AddBuff(39, 120); + Main.player[i].AddBuff(39, 180); } else if (this.type == 288) Main.player[i].AddBuff(69, 900); - else if (this.type == 253 && !this.hostile) + else if (this.type == 253 && Main.rand.Next(2) == 0) Main.player[i].AddBuff(44, 600); if (this.type == 291 || this.type == 292) Main.player[i].AddBuff(24, 60 * Main.rand.Next(8, 16)); @@ -9353,40 +7664,16 @@ namespace Terraria } } - public bool CanHitWithMeleeWeapon(Entity ent) + public bool CanHit(Entity ent) { if ((double) this.Distance(ent.Center) > (double) this.ownerHitCheckDistance) return false; return Collision.CanHit(Main.player[this.owner].position, Main.player[this.owner].width, Main.player[this.owner].height, ent.position, ent.width, ent.height) || Collision.CanHitLine(Main.player[this.owner].Center + new Vector2((float) (Main.player[this.owner].direction * Main.player[this.owner].width / 2), (float) ((double) Main.player[this.owner].gravDir * (double) -Main.player[this.owner].height / 3.0)), 0, 0, ent.Center + new Vector2(0.0f, (float) (-ent.height / 3)), 0, 0) || Collision.CanHitLine(Main.player[this.owner].Center + new Vector2((float) (Main.player[this.owner].direction * Main.player[this.owner].width / 2), (float) ((double) Main.player[this.owner].gravDir * (double) -Main.player[this.owner].height / 3.0)), 0, 0, ent.Center, 0, 0) || Collision.CanHitLine(Main.player[this.owner].Center + new Vector2((float) (Main.player[this.owner].direction * Main.player[this.owner].width / 2), 0.0f), 0, 0, ent.Center + new Vector2(0.0f, (float) (ent.height / 3)), 0, 0); } - public bool CanHitWithOwnBody(Entity ent) - { - if ((double) this.Distance(ent.Center) > (double) this.ownerHitCheckDistance) - return false; - bool flag = Collision.CanHit(this.position, this.width, this.height, ent.position, ent.width, ent.height) || Collision.CanHitLine(this.Center + new Vector2((float) (this.direction * this.width / 2), (float) (-this.height / 3)), 0, 0, ent.Center + new Vector2(0.0f, (float) (-ent.height / 3)), 0, 0) || Collision.CanHitLine(this.Center + new Vector2((float) (this.direction * this.width / 2), (float) (-this.height / 3)), 0, 0, ent.Center, 0, 0) || Collision.CanHitLine(this.Center + new Vector2((float) (this.direction * this.width / 2), 0.0f), 0, 0, ent.Center + new Vector2(0.0f, (float) (ent.height / 3)), 0, 0); - float num = ProjectileID.Sets.ExtendedCanHitCheckRange[this.type]; - if ((double) num != 0.0 && !flag) - { - GenSearch search = ProjectileID.Sets.ExtendedCanHitCheckSearch[this.type]; - Vector2 Position1 = this.Top + new Vector2(0.0f, -num); - Vector2 Position2 = ent.Top + new Vector2(0.0f, -num); - if (search != null) - { - Point result; - if (WorldUtils.Find(this.Top.ToTileCoordinates(), Searches.Chain(search, (GenCondition) Projectile._cachedConditions_notNull, (GenCondition) Projectile._cachedConditions_solid), out result)) - Position1 = result.ToWorldCoordinates(); - if (WorldUtils.Find(ent.Top.ToTileCoordinates(), Searches.Chain(search, (GenCondition) Projectile._cachedConditions_notNull, (GenCondition) Projectile._cachedConditions_solid), out result)) - Position2 = result.ToWorldCoordinates(); - } - flag |= Collision.CanHitLine(Position1, 0, 0, Position2, 0, 0); - } - return flag; - } - public void Damage() { - if (this.type == 18 || this.type == 72 || this.type == 86 || this.type == 87 || this.aiStyle == 31 || this.aiStyle == 32 || this.type == 226 || this.type == 378 || this.type == 613 || this.type == 650 || this.type == 882 || this.type == 888 || this.type == 895 || this.type == 896 || this.type == 434 && (double) this.localAI[0] != 0.0 || this.type == 439 || this.type == 444 || this.type == 451 && ((int) ((double) this.ai[0] - 1.0) / this.penetrate == 0 || (double) this.ai[1] < 5.0) && (double) this.ai[0] != 0.0 || this.type == 500 || this.type == 653 || this.type == 460 || this.type == 633 || this.type == 600 || this.type == 601 || this.type == 602 || this.type == 535 || this.type == 631 && (double) this.localAI[1] == 0.0 || this.type == 651 || this.type == 188 && (double) this.localAI[0] < 5.0 || this.aiStyle == 137 && (double) this.ai[0] != 0.0 || this.aiStyle == 138 || this.type == 261 && (double) this.velocity.Length() < 1.5 || this.type == 818 && (double) this.ai[0] < 1.0 || this.type == 831 || this.type == 833 && (double) this.ai[0] == 4.0 || this.type == 834 && (double) this.ai[0] == 4.0 || this.type == 835 && (double) this.ai[0] == 4.0 || this.type == 281 && (double) this.ai[0] == -3.0 || this.type == 923 && (double) this.localAI[0] <= 60.0 || this.type == 919 && (double) this.localAI[0] <= 60.0 || this.aiStyle == 15 && (double) this.ai[0] == 0.0 && (double) this.localAI[1] <= 12.0 || this.type == 861 || this.aiStyle == 93 && (double) this.ai[0] != 0.0 && (double) this.ai[0] != 2.0 || this.aiStyle == 10 && (double) this.localAI[1] == -1.0 || Main.projPet[this.type] && this.type != 266 && this.type != 407 && this.type != 317 && (this.type != 388 || (double) this.ai[0] != 2.0) && (this.type < 390 || this.type > 392) && (this.type < 393 || this.type > 395) && (this.type != 533 || (double) this.ai[0] < 6.0 || (double) this.ai[0] > 8.0) && (this.type < 625 || this.type > 628) && (this.type != 755 || (double) this.ai[0] == 0.0) && (this.type != 946 || (double) this.ai[0] == 0.0) && this.type != 758 && (this.type != 759 || this.frame == Main.projFrames[this.type] - 1) && this.type != 833 && this.type != 834 && this.type != 835 && this.type != 864 && (this.type != 623 || (double) this.ai[0] != 2.0)) + if (this.type == 18 || this.type == 72 || this.type == 86 || this.type == 87 || this.aiStyle == 31 || this.aiStyle == 32 || this.type == 226 || this.type == 378 || this.type == 613 || this.type == 650 || this.type == 434 && (double) this.localAI[0] != 0.0 || this.type == 439 || this.type == 444 || this.type == 451 && ((int) ((double) this.ai[0] - 1.0) / this.penetrate == 0 || (double) this.ai[1] < 5.0) && (double) this.ai[0] != 0.0 || this.type == 500 || this.type == 653 || this.type == 460 || this.type == 633 || this.type == 600 || this.type == 601 || this.type == 602 || this.type == 535 || this.type == 631 && (double) this.localAI[1] == 0.0 || this.type == 651 || this.aiStyle == 137 && (double) this.ai[0] != 0.0 || this.aiStyle == 138 || this.aiStyle == 93 && (double) this.ai[0] != 0.0 && (double) this.ai[0] != 2.0 || this.aiStyle == 10 && (double) this.localAI[1] == -1.0 || Main.projPet[this.type] && this.type != 266 && this.type != 407 && this.type != 317 && (this.type != 388 || (double) this.ai[0] != 2.0) && (this.type < 390 || this.type > 392) && (this.type < 393 || this.type > 395) && (this.type != 533 || (double) this.ai[0] < 6.0 || (double) this.ai[0] > 8.0) && (this.type < 625 || this.type > 628)) return; Microsoft.Xna.Framework.Rectangle myRect = new Microsoft.Xna.Framework.Rectangle((int) this.position.X, (int) this.position.Y, this.width, this.height); if (this.type == 85 || this.type == 101) @@ -9415,10 +7702,10 @@ namespace Terraria } if (this.friendly && this.owner == Main.myPlayer && !this.npcProj) { - if (this.aiStyle == 16 && !ProjectileID.Sets.RocketsSkipDamageForPlayers[this.type] && (this.timeLeft <= 1 || this.type == 108 || this.type == 164) || this.type == 286 && (double) this.localAI[1] == -1.0) + if (this.aiStyle == 16 && this.type != 338 && this.type != 339 && this.type != 340 && this.type != 341 && (this.timeLeft <= 1 || this.type == 108 || this.type == 164) || this.type == 286 && (double) this.localAI[1] == -1.0) { int player = Main.myPlayer; - if (Main.player[player].active && !Main.player[player].dead && !Main.player[player].immune && (!this.ownerHitCheck || this.CanHitWithMeleeWeapon((Entity) Main.player[player]))) + if (Main.player[player].active && !Main.player[player].dead && !Main.player[player].immune && (!this.ownerHitCheck || this.CanHit((Entity) Main.player[player]))) { Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle((int) Main.player[player].position.X, (int) Main.player[player].position.Y, Main.player[player].width, Main.player[player].height); if (myRect.Intersects(rectangle)) @@ -9427,16 +7714,9 @@ namespace Terraria this.direction = -1; else this.direction = 1; - int Damage = Main.DamageVar((float) this.damage, -Main.player[player].luck); + int Damage = Main.DamageVar((float) this.damage); this.StatusPlayer(player); - int playerIndex = this.owner; - bool pvp = true; - if (this.type == 108) - { - playerIndex = -1; - pvp = false; - } - Main.player[player].Hurt(PlayerDeathReason.ByProjectile(playerIndex, this.whoAmI), Damage, this.direction, pvp); + Main.player[player].Hurt(PlayerDeathReason.ByProjectile(this.owner, this.whoAmI), Damage, this.direction, true); if (this.trap) { Main.player[player].trapDebuffSource = true; @@ -9446,993 +7726,79 @@ namespace Terraria } } } - if (!this.minion) - this.CutTiles(); + this.CutTiles(); } if (this.owner == Main.myPlayer) { - float num1 = 1f; - if (ProjectileID.Sets.IsARocketThatDealsDoubleDamageToPrimaryEnemy[this.type] && this.timeLeft > 3) - num1 *= 2f; - if (ProjectileID.Sets.IsAMineThatDealsTripleDamageWhenStationary[this.type] && (double) this.velocity.Length() < 0.5) - num1 *= 3f; - if (this.type == 34 && this.penetrate == 1) - num1 *= 1f; - if (this.aiStyle == 15 && (double) this.ai[0] == 0.0) - num1 *= 1.2f; - if (this.aiStyle == 15 && ((double) this.ai[0] == 1.0 || (double) this.ai[0] == 2.0)) - num1 *= 2f; - if (this.type == 877 || this.type == 879 || this.type == 878) - num1 = (float) (0.100000001490116 + (double) Main.player[this.owner].velocity.Length() / 7.0 * 0.899999976158142); if (this.damage > 0) { - int[] localNpcImmunity = this.localNPCImmunity; - if (this.type == 626 || this.type == 627 || this.type == 628) - { - Projectile dragonHeadOfOwner = this.FindStardustDragonHeadOfOwner(); - if (dragonHeadOfOwner != null) - localNpcImmunity = dragonHeadOfOwner.localNPCImmunity; - } for (int index1 = 0; index1 < 200; ++index1) { - bool flag1 = !this.usesLocalNPCImmunity && !this.usesIDStaticNPCImmunity || this.usesLocalNPCImmunity && localNpcImmunity[index1] == 0 || this.usesIDStaticNPCImmunity && Projectile.IsNPCIndexImmuneToProjectileType(this.type, index1); - if (((!Main.npc[index1].active ? 0 : (!Main.npc[index1].dontTakeDamage ? 1 : 0)) & (flag1 ? 1 : 0)) != 0 && (Main.npc[index1].aiStyle != 112 || (double) Main.npc[index1].ai[2] <= 1.0)) + bool flag1 = !this.usesLocalNPCImmunity && !this.usesIDStaticNPCImmunity || this.usesLocalNPCImmunity && this.localNPCImmunity[index1] == 0 || this.usesIDStaticNPCImmunity && Projectile.IsNPCImmune(this.type, index1); + if (((!Main.npc[index1].active ? 0 : (!Main.npc[index1].dontTakeDamage ? 1 : 0)) & (flag1 ? 1 : 0)) != 0 && (this.friendly && (!Main.npc[index1].friendly || this.type == 318 || Main.npc[index1].type == 22 && this.owner < (int) byte.MaxValue && Main.player[this.owner].killGuide || Main.npc[index1].type == 54 && this.owner < (int) byte.MaxValue && Main.player[this.owner].killClothier) || this.hostile && Main.npc[index1].friendly && !Main.npc[index1].dontTakeDamageFromHostiles) && (this.owner < 0 || Main.npc[index1].immune[this.owner] == 0 || this.maxPenetrate == 1)) { - NPC npc1 = Main.npc[index1]; - npc1.position = npc1.position + Main.npc[index1].netOffset; - bool flag2 = ((((!Main.npc[index1].friendly | this.type == 318 ? 1 : 0) | (Main.npc[index1].type != 22 || this.owner >= (int) byte.MaxValue ? 0 : (Main.player[this.owner].killGuide ? 1 : 0))) != 0 ? 1 : 0) | (Main.npc[index1].type != 54 || this.owner >= (int) byte.MaxValue ? 0 : (Main.player[this.owner].killClothier ? 1 : 0))) != 0; - if (this.owner < (int) byte.MaxValue && !Main.player[this.owner].CanNPCBeHitByPlayerOrPlayerProjectile(Main.npc[index1])) - flag2 = false; - bool flag3 = Main.npc[index1].friendly && !Main.npc[index1].dontTakeDamageFromHostiles; - if ((this.friendly & flag2 || this.hostile & flag3) && (this.owner < 0 || Main.npc[index1].immune[this.owner] == 0 || this.maxPenetrate == 1)) + bool flag2 = false; + if (this.type == 11 && (Main.npc[index1].type == 47 || Main.npc[index1].type == 57)) + flag2 = true; + else if (this.type == 31 && Main.npc[index1].type == 69) + flag2 = true; + else if (Main.npc[index1].trapImmune && this.trap) + flag2 = true; + else if (Main.npc[index1].immortal && this.npcProj) + flag2 = true; + if (!flag2 && (Main.npc[index1].noTileCollide || !this.ownerHitCheck || this.CanHit((Entity) Main.npc[index1]))) { - bool flag4 = false; - if (this.type == 11 && (Main.npc[index1].type == 47 || Main.npc[index1].type == 57)) - flag4 = true; - else if (this.type == 31 && Main.npc[index1].type == 69) - flag4 = true; - else if (Main.npc[index1].trapImmune && this.trap) - flag4 = true; - else if (Main.npc[index1].immortal && this.npcProj) - flag4 = true; - if (!flag4 && (Main.npc[index1].noTileCollide || !this.ownerHitCheck || this.CanHitWithMeleeWeapon((Entity) Main.npc[index1]))) + bool flag3; + if (Main.npc[index1].type == 414) { - bool flag5; - if (Main.npc[index1].type == 414) - { - Microsoft.Xna.Framework.Rectangle rect = Main.npc[index1].getRect(); - int num2 = 8; - rect.X -= num2; - rect.Y -= num2; - rect.Width += num2 * 2; - rect.Height += num2 * 2; - flag5 = this.Colliding(myRect, rect); - } - else - flag5 = this.Colliding(myRect, Main.npc[index1].getRect()); - if (flag5) - { - if (this.type == 876) - { - Vector2 position1 = this.position; - if (Main.rand.Next(20) == 0) - { - this.tileCollide = false; - this.position.X += (float) Main.rand.Next(-256, 257); - } - if (Main.rand.Next(20) == 0) - { - this.tileCollide = false; - this.position.Y += (float) Main.rand.Next(-256, 257); - } - if (Main.rand.Next(2) == 0) - this.tileCollide = false; - if (Main.rand.Next(3) != 0) - { - Vector2 position2 = this.position; - this.position = this.position - this.velocity * (float) Main.rand.Next(0, 40); - if (this.tileCollide && Collision.SolidTiles(this.position, this.width, this.height)) - { - this.position = position2; - this.position = this.position - this.velocity * (float) Main.rand.Next(0, 40); - if (this.tileCollide && Collision.SolidTiles(this.position, this.width, this.height)) - this.position = position2; - } - } - this.velocity = this.velocity * 0.6f; - if (Main.rand.Next(7) == 0) - this.velocity.X += (float) Main.rand.Next(30, 31) * 0.01f; - if (Main.rand.Next(7) == 0) - this.velocity.Y += (float) Main.rand.Next(30, 31) * 0.01f; - this.damage = (int) ((double) this.damage * 0.9); - this.knockBack *= 0.9f; - if (Main.rand.Next(20) == 0) - this.knockBack *= 10f; - if (Main.rand.Next(50) == 0) - this.damage *= 10; - if (Main.rand.Next(7) == 0) - { - Vector2 position3 = this.position; - this.position.X += (float) Main.rand.Next(-64, 65); - if (this.tileCollide && Collision.SolidTiles(this.position, this.width, this.height)) - this.position = position3; - } - if (Main.rand.Next(7) == 0) - { - Vector2 position4 = this.position; - this.position.Y += (float) Main.rand.Next(-64, 65); - if (this.tileCollide && Collision.SolidTiles(this.position, this.width, this.height)) - this.position = position4; - } - if (Main.rand.Next(14) == 0) - this.velocity.X *= -1f; - if (Main.rand.Next(14) == 0) - this.velocity.Y *= -1f; - if (Main.rand.Next(10) == 0) - this.velocity = this.velocity * ((float) Main.rand.Next(1, 201) * 0.0005f); - this.ai[1] = !this.tileCollide ? 1f : 0.0f; - this.netUpdate = true; - } - NPC targetNPC = Main.npc[index1]; - if (targetNPC.reflectsProjectiles && this.CanBeReflected() && targetNPC.CanReflectProjectile(this)) - { - targetNPC.ReflectProjectile(this); - NPC npc2 = Main.npc[index1]; - npc2.position = npc2.position - Main.npc[index1].netOffset; - return; - } - if (this.type == 604) - Main.player[this.owner].Counterweight(targetNPC.Center, this.damage, this.knockBack); - float knockBack = this.knockBack; - bool crit = false; - int armorPenetration = Main.player[this.owner].armorPenetration; - bool flag6 = !this.npcProj && !this.trap; - switch (this.type) - { - case 864: - armorPenetration += 25; - break; - case 877: - case 878: - case 879: - knockBack *= Main.player[this.owner].velocity.Length() / 7f; - break; - case 916: - armorPenetration += 50; - break; - case 917: - armorPenetration += 30; - break; - } - int num3 = (int) ((double) this.damage * (double) num1); - if (this.type > 0 && this.type < 950 && ProjectileID.Sets.StardustDragon[this.type]) - { - float num4 = Utils.Clamp((float) (((double) this.scale - 1.0) * 100.0), 0.0f, 50f); - num3 = (int) ((double) num3 * (1.0 + (double) num4 * 0.230000004172325)); - } - if (this.type > 0 && this.type < 950 && ProjectileID.Sets.StormTiger[this.type]) - { - int num5 = Math.Max(0, Main.player[this.owner].ownedProjectileCounts[831] - 1); - num3 = (int) ((double) num3 * (1.0 + (double) num5 * 0.333333343267441)); - } - if (this.type == 818) - { - int num6 = Math.Max(0, Main.player[this.owner].ownedProjectileCounts[831] - 1); - num3 = (int) ((double) num3 * (1.5 + (double) num6 * 0.333333343267441)); - } - if (flag6) - { - if (this.melee && Main.rand.Next(1, 101) <= Main.player[this.owner].meleeCrit) - crit = true; - if (this.ranged && Main.rand.Next(1, 101) <= Main.player[this.owner].rangedCrit) - crit = true; - if (this.magic && Main.rand.Next(1, 101) <= Main.player[this.owner].magicCrit) - crit = true; - switch (this.type) - { - case 688: - case 689: - case 690: - if (Main.player[this.owner].setMonkT3) - { - if (Main.rand.Next(4) == 0) - { - crit = true; - break; - } - break; - } - if (Main.player[this.owner].setMonkT2 && Main.rand.Next(6) == 0) - { - crit = true; - break; - } - break; - } - } - if (flag6 && (this.minion || ProjectileID.Sets.MinionShot[this.type])) - { - bool flag7 = false; - bool flag8 = false; - bool flag9 = false; - bool flag10 = false; - bool flag11 = false; - bool flag12 = false; - bool flag13 = false; - for (int index2 = 0; index2 < 5; ++index2) - { - if (targetNPC.buffTime[index2] >= 1) - { - switch (targetNPC.buffType[index2]) - { - case 307: - flag7 = true; - continue; - case 309: - flag8 = true; - continue; - case 310: - flag10 = true; - continue; - case 313: - flag9 = true; - continue; - case 315: - flag11 = true; - continue; - case 316: - flag13 = true; - continue; - case 319: - flag12 = true; - continue; - default: - continue; - } - } - } - if (flag7) - num3 += 4; - if (flag11) - num3 += 6; - if (flag8) - num3 += 9; - if (flag12) - { - num3 += 5; - if (Main.rand.Next(20) == 0) - crit = true; - } - if (flag10) - { - int Damage = 10; - int index3 = Projectile.NewProjectile(targetNPC.Center, Vector2.Zero, 916, Damage, 0.0f, this.owner); - Main.projectile[index3].localNPCImmunity[index1] = -1; - Projectile.EmitBlackLightningParticles(targetNPC); - } - if (flag13) - { - int num7 = 20; - num3 += num7; - if (Main.rand.Next(10) == 0) - crit = true; - ParticleOrchestrator.RequestParticleSpawn(false, ParticleOrchestraType.RainbowRodHit, new ParticleOrchestraSettings() - { - PositionInWorld = this.Center - }); - } - if (flag9) - { - targetNPC.RequestBuffRemoval(313); - int Damage = (int) ((double) num3 * 2.0); - int index4 = Projectile.NewProjectile(targetNPC.Center, Vector2.Zero, 918, Damage, 0.0f, this.owner); - Main.projectile[index4].localNPCImmunity[index1] = -1; - num3 += Damage; - } - } - int Damage1 = !flag6 ? Main.DamageVar((float) num3) : Main.DamageVar((float) num3, Main.player[this.owner].luck); - if (this.trap && NPCID.Sets.BelongsToInvasionOldOnesArmy[targetNPC.type]) - Damage1 /= 2; - if (this.type == 482 && (targetNPC.aiStyle == 6 || targetNPC.aiStyle == 37)) - Damage1 /= 2; - if (this.type == 604) - { - this.friendly = false; - this.ai[1] = 1000f; - } - if ((this.type == 400 || this.type == 401 || this.type == 402) && targetNPC.type >= 13 && targetNPC.type <= 15) - { - Damage1 = (int) ((double) Damage1 * 0.65); - if (this.penetrate > 1) - --this.penetrate; - } - if (this.type == 710) - { - if (!WorldUtils.Find(this.Center.ToTileCoordinates(), Searches.Chain((GenSearch) new Searches.Down(12), (GenCondition) Projectile._cachedConditions_notNull, (GenCondition) Projectile._cachedConditions_solid), out Point _)) - Damage1 = (int) ((double) Damage1 * 1.5); - } - if (this.type == 504) - this.ai[0] += (float) ((60.0 - (double) this.ai[0]) / 2.0); - if (this.aiStyle == 3 && this.type != 301 && this.type != 866 && this.type != 902) - { - if ((double) this.ai[0] == 0.0) - { - this.velocity.X = -this.velocity.X; - this.velocity.Y = -this.velocity.Y; - this.netUpdate = true; - } - this.ai[0] = 1f; - } - else if (this.type == 582 || this.type == 902) - { - if ((double) this.ai[0] != 0.0) - this.direction *= -1; - } - else if (this.type == 612) - this.direction = Main.player[this.owner].direction; - else if (this.type == 624) - { - float num8 = 1f; - if ((double) targetNPC.knockBackResist > 0.0) - num8 = 1f / targetNPC.knockBackResist; - this.knockBack = 4f * num8; - knockBack = this.knockBack; - if ((double) targetNPC.Center.X < (double) this.Center.X) - this.direction = 1; - else - this.direction = -1; - } - else if (this.aiStyle == 16) - { - if (this.timeLeft > 3) - this.timeLeft = 3; - if ((double) targetNPC.position.X + (double) (targetNPC.width / 2) < (double) this.position.X + (double) (this.width / 2)) - this.direction = -1; - else - this.direction = 1; - } - else if (this.aiStyle == 68) - { - if (this.timeLeft > 3) - this.timeLeft = 3; - if ((double) targetNPC.position.X + (double) (targetNPC.width / 2) < (double) this.position.X + (double) (this.width / 2)) - this.direction = -1; - else - this.direction = 1; - } - else if (this.aiStyle == 50) - { - if ((double) targetNPC.position.X + (double) (targetNPC.width / 2) < (double) this.position.X + (double) (this.width / 2)) - this.direction = -1; - else - this.direction = 1; - } - else if (this.type == 908) - { - if ((double) targetNPC.position.X + (double) (targetNPC.width / 2) < (double) this.position.X + (double) (this.width / 2)) - this.direction = -1; - else - this.direction = 1; - } - if (this.type == 509) - { - int num9 = Main.rand.Next(2, 6); - for (int index5 = 0; index5 < num9; ++index5) - { - Vector2 vector2 = new Vector2((float) Main.rand.Next(-100, 101), (float) Main.rand.Next(-100, 101)); - vector2 += this.velocity * 3f; - vector2.Normalize(); - vector2 *= (float) Main.rand.Next(35, 81) * 0.1f; - int Damage2 = (int) ((double) this.damage * 0.5); - Projectile.NewProjectile(this.Center.X, this.Center.Y, vector2.X, vector2.Y, 504, Damage2, this.knockBack * 0.2f, this.owner); - } - } - if (this.type == 598 || this.type == 636 || this.type == 614) - { - this.ai[0] = 1f; - this.ai[1] = (float) index1; - this.velocity = (targetNPC.Center - this.Center) * 0.75f; - this.netUpdate = true; - } - if (this.type >= 511 && this.type <= 513) - this.timeLeft = 0; - if (this.type == 659) - this.timeLeft = 0; - if (this.type == 524) - { - this.netUpdate = true; - this.ai[0] += 50f; - } - if ((this.type == 688 || this.type == 689 || this.type == 690) && targetNPC.type != 68 && targetNPC.defense < 999) - Damage1 += targetNPC.defense / 2; - if (this.aiStyle == 39) - { - if ((double) this.ai[1] == 0.0) - { - this.ai[1] = (float) (index1 + 1); - this.netUpdate = true; - } - if ((double) Main.player[this.owner].position.X + (double) (Main.player[this.owner].width / 2) < (double) this.position.X + (double) (this.width / 2)) - this.direction = 1; - else - this.direction = -1; - } - if (this.type == 41 && this.timeLeft > 1) - this.timeLeft = 1; - if (this.aiStyle == 99) - { - Main.player[this.owner].Counterweight(targetNPC.Center, this.damage, this.knockBack); - if ((double) targetNPC.Center.X < (double) Main.player[this.owner].Center.X) - this.direction = -1; - else - this.direction = 1; - if ((double) this.ai[0] >= 0.0) - { - Vector2 vector2 = this.Center - targetNPC.Center; - vector2.Normalize(); - float num10 = 16f; - this.velocity = this.velocity * -0.5f; - this.velocity = this.velocity + vector2 * num10; - this.netUpdate = true; - this.localAI[0] += 20f; - if (!Collision.CanHit(this.position, this.width, this.height, Main.player[this.owner].position, Main.player[this.owner].width, Main.player[this.owner].height)) - { - this.localAI[0] += 40f; - Damage1 = (int) ((double) Damage1 * 0.75); - } - } - } - if (this.type == 856 && !Collision.CanHit(this.position, this.width, this.height, Main.player[this.owner].position, Main.player[this.owner].width, Main.player[this.owner].height)) - Damage1 = (int) ((double) Damage1 * 0.75); - if (this.aiStyle == 93) - { - if ((double) this.ai[0] == 0.0) - { - this.ai[1] = 0.0f; - this.ai[0] = (float) (-index1 - 1); - this.velocity = targetNPC.Center - this.Center; - } - Damage1 = (double) this.ai[0] != 2.0 ? (int) ((double) Damage1 * 0.15) : (int) ((double) Damage1 * 1.35); - } - if (flag6) - { - int num11 = Item.NPCtoBanner(targetNPC.BannerID()); - if (num11 >= 0) - Main.player[Main.myPlayer].lastCreatureHit = num11; - } - if (Main.netMode != 2 & flag6) - { - int num12 = Item.NPCtoBanner(targetNPC.BannerID()); - if (num12 > 0 && Main.player[this.owner].HasNPCBannerBuff(num12)) - Damage1 = !Main.expertMode ? (int) ((double) Damage1 * (double) ItemID.Sets.BannerStrength[Item.BannerToItem(num12)].NormalDamageDealt) : (int) ((double) Damage1 * (double) ItemID.Sets.BannerStrength[Item.BannerToItem(num12)].ExpertDamageDealt); - } - if (Main.expertMode) - { - if ((this.type == 30 || this.type == 397 || this.type == 517 || this.type == 28 || this.type == 37 || this.type == 516 || this.type == 29 || this.type == 470 || this.type == 637 || this.type == 108 || this.type == 281 || this.type == 588 || this.type == 519 || this.type == 773 || this.type == 183 || this.type == 181 || this.type == 566) && targetNPC.type >= 13 && targetNPC.type <= 15) - Damage1 /= 5; - if (this.type == 280 && (targetNPC.type >= 134 && targetNPC.type <= 136 || targetNPC.type == 139)) - Damage1 = (int) ((double) Damage1 * 0.75); - } - if (Main.netMode != 2 && targetNPC.type == 439 && this.type >= 0 && this.type <= 950 && ProjectileID.Sets.CountsAsHoming[this.type]) - Damage1 = (int) ((double) Damage1 * 0.75); - if (this.type == 497 && this.penetrate != 1) - { - this.ai[0] = 25f; - float num13 = this.velocity.Length(); - Vector2 vector2 = targetNPC.Center - this.Center; - vector2.Normalize(); - vector2 *= num13; - this.velocity = -vector2 * 0.9f; - this.netUpdate = true; - } - if (this.type == 323 && (targetNPC.type == 158 || targetNPC.type == 159)) - Damage1 *= 10; - if (this.type == 294) - this.damage = (int) ((double) this.damage * 0.8); - if (this.type == 265) - this.damage = (int) ((double) this.damage * 0.75); - if (this.type == 355) - this.damage = (int) ((double) this.damage * 0.75); - if (this.type == 85) - this.damage = (int) ((double) this.damage * 0.85); - if (this.type == 866) - this.damage = (int) ((double) this.damage * 0.7); - if (this.type == 841) - this.damage = (int) ((double) this.damage * 0.5); - if (this.type == 914) - this.damage = (int) ((double) this.damage * 0.6); - if (this.type == 913) - this.damage = (int) ((double) this.damage * 0.66); - if (this.type == 912) - this.damage = (int) ((double) this.damage * 0.66); - if (this.type == 847) - this.damage = (int) ((double) this.damage * 0.7); - if (this.type == 848) - this.damage = (int) ((double) this.damage * 0.75); - if (this.type == 849) - this.damage = (int) ((double) this.damage * 0.7); - if (this.type == 915) - this.damage = (int) ((double) this.damage * 0.85); - if (this.type == 931) - this.damage = (int) ((double) this.damage * 0.8); - if (this.type == 477 && this.penetrate > 1) - { - int[] numArray = new int[10]; - int maxValue = 0; - int num14 = 700; - int num15 = 20; - for (int index6 = 0; index6 < 200; ++index6) - { - if (index6 != index1 && Main.npc[index6].CanBeChasedBy((object) this)) - { - float num16 = (this.Center - Main.npc[index6].Center).Length(); - if ((double) num16 > (double) num15 && (double) num16 < (double) num14 && Collision.CanHitLine(this.Center, 1, 1, Main.npc[index6].Center, 1, 1)) - { - numArray[maxValue] = index6; - ++maxValue; - if (maxValue >= 9) - break; - } - } - } - if (maxValue > 0) - { - int index7 = Main.rand.Next(maxValue); - Vector2 vector2 = Main.npc[numArray[index7]].Center - this.Center; - float num17 = this.velocity.Length(); - vector2.Normalize(); - this.velocity = vector2 * num17; - this.netUpdate = true; - } - } - if (this.type == 261 && (double) this.velocity.Length() < 3.5) - { - Damage1 /= 2; - knockBack /= 2f; - } - if (flag6 && this.melee && Main.player[this.owner].parryDamageBuff && !ProjectileID.Sets.DontApplyParryDamageBuff[this.type]) - { - Damage1 *= 5; - Main.player[this.owner].parryDamageBuff = false; - Main.player[this.owner].ClearBuff(198); - } - this.StatusNPC(index1); - if (flag6 && targetNPC.life > 5) - this.TryDoingOnHitEffects((Entity) targetNPC); - if (ProjectileID.Sets.ImmediatelyUpdatesNPCBuffFlags[this.type]) - targetNPC.UpdateNPC_BuffSetFlags(false); - if (this.type == 317) - { - this.ai[1] = -1f; - this.netUpdate = true; - } - int hitDirection = this.direction; - if (this.type == 697 || this.type == 699 || this.type == 707 || this.type == 708) - hitDirection = (double) Main.player[this.owner].Center.X < (double) targetNPC.Center.X ? 1 : -1; - if (this.aiStyle == 15) - { - hitDirection = (double) Main.player[this.owner].Center.X < (double) targetNPC.Center.X ? 1 : -1; - if ((double) this.ai[0] == 0.0) - knockBack *= 0.25f; - if ((double) this.ai[0] == 6.0) - knockBack *= 0.5f; - } - if (flag6 && !this.hostile && armorPenetration > 0) - Damage1 += targetNPC.checkArmorPenetration(armorPenetration); - int dmg = !flag6 ? (int) targetNPC.StrikeNPCNoInteraction(Damage1, knockBack, hitDirection, crit) : (int) targetNPC.StrikeNPC(Damage1, knockBack, hitDirection, crit); - if (flag6 && Main.player[this.owner].accDreamCatcher) - Main.player[this.owner].addDPS(dmg); - if (flag6 && !targetNPC.immortal) - { - if (this.type == 756) - { - if (this.penetrate == 1) - { - this.damage = 0; - this.penetrate = -1; - } - else - this.damage = (int) ((double) this.damage * 0.7); - } - if (this.type == 304 && dmg > 0 && targetNPC.lifeMax > 5 && !Main.player[this.owner].moonLeech) - this.vampireHeal(dmg, new Vector2(targetNPC.Center.X, targetNPC.Center.Y)); - if ((double) targetNPC.value > 0.0 && Main.player[this.owner].coins && Main.rand.Next(5) == 0) - { - int Type = 71; - if (Main.rand.Next(10) == 0) - Type = 72; - if (Main.rand.Next(100) == 0) - Type = 73; - int number = Item.NewItem((int) targetNPC.position.X, (int) targetNPC.position.Y, targetNPC.width, targetNPC.height, Type); - Main.item[number].stack = Main.rand.Next(1, 11); - Main.item[number].velocity.Y = (float) Main.rand.Next(-20, 1) * 0.2f; - Main.item[number].velocity.X = (float) Main.rand.Next(10, 31) * 0.2f * (float) hitDirection; - if (Main.netMode == 1) - NetMessage.SendData(21, number: number); - } - if (dmg > 0 && targetNPC.lifeMax > 5 && this.friendly && !this.hostile && this.aiStyle != 59) - { - if (targetNPC.canGhostHeal) - { - if (Main.player[this.owner].ghostHeal && !Main.player[this.owner].moonLeech) - this.ghostHeal(dmg, new Vector2(targetNPC.Center.X, targetNPC.Center.Y)); - if (Main.player[this.owner].ghostHurt) - this.ghostHurt(dmg, new Vector2(targetNPC.Center.X, targetNPC.Center.Y)); - if (this.magic && Main.player[this.owner].setNebula && Main.player[this.owner].nebulaCD == 0 && Main.rand.Next(3) == 0) - { - Main.player[this.owner].nebulaCD = 30; - int Type = Utils.SelectRandom(Main.rand, 3453, 3454, 3455); - int number = Item.NewItem((int) targetNPC.position.X, (int) targetNPC.position.Y, targetNPC.width, targetNPC.height, Type); - Main.item[number].velocity.Y = (float) Main.rand.Next(-20, 1) * 0.2f; - Main.item[number].velocity.X = (float) Main.rand.Next(10, 31) * 0.2f * (float) hitDirection; - if (Main.netMode == 1) - NetMessage.SendData(21, number: number); - } - } - if (this.melee && Main.player[this.owner].beetleOffense && !targetNPC.immortal) - { - if (Main.player[this.owner].beetleOrbs == 0) - Main.player[this.owner].beetleCounter += (float) (dmg * 3); - else if (Main.player[this.owner].beetleOrbs == 1) - Main.player[this.owner].beetleCounter += (float) (dmg * 2); - else - Main.player[this.owner].beetleCounter += (float) dmg; - Main.player[this.owner].beetleCountdown = 0; - } - if (this.arrow && this.type != 631 && Main.player[this.owner].phantasmTime > 0) - { - Vector2 Source = Main.player[this.owner].position + Main.player[this.owner].Size * Utils.RandomVector2(Main.rand, 0.0f, 1f); - Vector2 vector2 = targetNPC.DirectionFrom(Source) * 6f; - int Damage3 = (int) ((double) this.damage * 0.300000011920929); - Projectile.NewProjectile(Source.X, Source.Y, vector2.X, vector2.Y, 631, Damage3, 0.0f, this.owner, (float) index1); - Projectile.NewProjectile(Source.X, Source.Y, vector2.X, vector2.Y, 631, Damage3, 0.0f, this.owner, (float) index1, 15f); - Projectile.NewProjectile(Source.X, Source.Y, vector2.X, vector2.Y, 631, Damage3, 0.0f, this.owner, (float) index1, 30f); - } - Player player = Main.player[this.owner]; - switch (this.type) - { - case 847: - player.AddBuff(308, 180); - break; - case 849: - player.AddBuff(311, 180); - break; - case 912: - int Damage4 = 10; - if (!player.coolWhipBuff) - { - Projectile.NewProjectile(targetNPC.Center, Vector2.Zero, 917, Damage4, 0.0f, this.owner); - player.coolWhipBuff = true; - } - player.AddBuff(312, 180); - break; - case 914: - player.AddBuff(314, 180); - break; - } - } - } - if (flag6 && this.melee && Main.player[this.owner].meleeEnchant == (byte) 7) - Projectile.NewProjectile(targetNPC.Center.X, targetNPC.Center.Y, targetNPC.velocity.X, targetNPC.velocity.Y, 289, 0, 0.0f, this.owner); - if (flag6 && this.type == 913) - this.localAI[0] = 1f; - if (Main.netMode != 0) - { - if (crit) - NetMessage.SendData(28, number: index1, number2: ((float) Damage1), number3: this.knockBack, number4: ((float) hitDirection), number5: 1); - else - NetMessage.SendData(28, number: index1, number2: ((float) Damage1), number3: this.knockBack, number4: ((float) hitDirection)); - } - if (this.type == 916) - Projectile.EmitBlackLightningParticles(targetNPC); - if (this.type >= 390 && this.type <= 392) - this.localAI[1] = 20f; - if (this.usesIDStaticNPCImmunity) - { - targetNPC.immune[this.owner] = 0; - Projectile.perIDStaticNPCImmunity[this.type][index1] = Main.GameUpdateCount + (uint) this.idStaticNPCHitCooldown; - } - else if (this.type == 434) - this.numUpdates = 0; - else if (this.type == 598 || this.type == 636 || this.type == 614) - { - this.damage = 0; - int length = 6; - if (this.type == 614) - length = 10; - if (this.type == 636) - length = 8; - Point[] pointArray = new Point[length]; - int num18 = 0; - for (int x = 0; x < 1000; ++x) - { - if (x != this.whoAmI && Main.projectile[x].active && Main.projectile[x].owner == Main.myPlayer && Main.projectile[x].type == this.type && (double) Main.projectile[x].ai[0] == 1.0 && (double) Main.projectile[x].ai[1] == (double) index1) - { - pointArray[num18++] = new Point(x, Main.projectile[x].timeLeft); - if (num18 >= pointArray.Length) - break; - } - } - if (num18 >= pointArray.Length) - { - int index8 = 0; - for (int index9 = 1; index9 < pointArray.Length; ++index9) - { - if (pointArray[index9].Y < pointArray[index8].Y) - index8 = index9; - } - Main.projectile[pointArray[index8].X].Kill(); - } - } - else if (this.type == 632) - targetNPC.immune[this.owner] = 5; - else if (this.type == 514) - targetNPC.immune[this.owner] = 1; - else if (this.type == 611) - { - if ((double) this.localAI[1] <= 0.0) - Projectile.NewProjectile(targetNPC.Center.X, targetNPC.Center.Y, 0.0f, 0.0f, 612, this.damage, 10f, this.owner, ai1: ((float) (0.850000023841858 + (double) Main.rand.NextFloat() * 1.14999997615814))); - this.localAI[1] = 4f; - } - else if (this.type == 595 || this.type == 735) - targetNPC.immune[this.owner] = 5; - else if (this.type == 927) - targetNPC.immune[this.owner] = 4; - else if (this.type == 286) - targetNPC.immune[this.owner] = 5; - else if (this.type == 443) - targetNPC.immune[this.owner] = 8; - else if (this.type >= 424 && this.type <= 426) - targetNPC.immune[this.owner] = 5; - else if (this.type == 634 || this.type == 635) - targetNPC.immune[this.owner] = 5; - else if (this.type == 659) - targetNPC.immune[this.owner] = 5; - else if (this.type == 246) - targetNPC.immune[this.owner] = 7; - else if (this.type == 249) - targetNPC.immune[this.owner] = 7; - else if (this.type == 16) - targetNPC.immune[this.owner] = 8; - else if (this.type == 409) - targetNPC.immune[this.owner] = 6; - else if (this.type == 407) - targetNPC.immune[this.owner] = 20; - else if (this.type == 311) - targetNPC.immune[this.owner] = 7; - else if (this.type == 582 || this.type == 902) - { - targetNPC.immune[this.owner] = 7; - if ((double) this.ai[0] != 1.0) - { - this.ai[0] = 1f; - this.netUpdate = true; - } - } - else - { - if (this.type == 451) - { - if ((double) this.ai[0] == 0.0) - this.ai[0] += (float) this.penetrate; - else - this.ai[0] -= (float) (this.penetrate + 1); - this.ai[1] = 0.0f; - this.netUpdate = true; - NPC npc3 = Main.npc[index1]; - npc3.position = npc3.position - Main.npc[index1].netOffset; - break; - } - if (this.type == 864) - { - localNpcImmunity[index1] = 10; - targetNPC.immune[this.owner] = 0; - if ((double) this.ai[0] > 0.0) - { - this.ai[0] = -1f; - this.ai[1] = 0.0f; - this.netUpdate = true; - } - } - else if (this.type == 661 || this.type == 856) - { - localNpcImmunity[index1] = 8; - targetNPC.immune[this.owner] = 0; - } - else if (this.type == 866) - { - localNpcImmunity[index1] = -1; - targetNPC.immune[this.owner] = 0; - --this.penetrate; - if (this.penetrate == 0) - { - this.penetrate = 1; - this.damage = 0; - this.ai[1] = -1f; - this.netUpdate = true; - NPC npc4 = Main.npc[index1]; - npc4.position = npc4.position - Main.npc[index1].netOffset; - break; - } - if (this.owner == Main.myPlayer) - { - int targetWithLineOfSight = this.FindTargetWithLineOfSight(); - float num19 = this.ai[1]; - this.ai[1] = (float) targetWithLineOfSight; - if ((double) this.ai[1] != (double) num19) - this.netUpdate = true; - if (targetWithLineOfSight != -1) - this.velocity = this.velocity.Length() * this.DirectionTo(Main.npc[targetWithLineOfSight].Center); - } - } - else if (this.usesLocalNPCImmunity && this.localNPCHitCooldown != -2) - { - targetNPC.immune[this.owner] = 0; - localNpcImmunity[index1] = this.localNPCHitCooldown; - } - else if (this.penetrate != 1) - targetNPC.immune[this.owner] = 10; - } - if (this.type == 710) - this.BetsySharpnel(index1); - if (this.penetrate > 0 && this.type != 317 && this.type != 866) - { - if (this.type == 357) - this.damage = (int) ((double) this.damage * 0.8); - --this.penetrate; - if (this.penetrate == 0) - { - NPC npc5 = Main.npc[index1]; - npc5.position = npc5.position - Main.npc[index1].netOffset; - break; - } - } - if (this.aiStyle == 7) - { - this.ai[0] = 1f; - this.damage = 0; - this.netUpdate = true; - } - else if (this.aiStyle == 13) - { - this.ai[0] = 1f; - this.netUpdate = true; - } - else if (this.aiStyle == 69) - { - this.ai[0] = 1f; - this.netUpdate = true; - } - else if (this.type == 607) - { - this.ai[0] = 1f; - this.netUpdate = true; - this.friendly = false; - } - else if (this.type == 638 || this.type == 639 || this.type == 640) - { - localNpcImmunity[index1] = -1; - targetNPC.immune[this.owner] = 0; - this.damage = (int) ((double) this.damage * 0.96); - } - else if (this.type == 617) - { - localNpcImmunity[index1] = 8; - targetNPC.immune[this.owner] = 0; - } - else if (this.type == 656) - { - localNpcImmunity[index1] = 8; - targetNPC.immune[this.owner] = 0; - ++this.localAI[0]; - } - else if (this.type == 618) - { - localNpcImmunity[index1] = 20; - targetNPC.immune[this.owner] = 0; - } - else if (this.type == 642) - { - localNpcImmunity[index1] = 10; - targetNPC.immune[this.owner] = 0; - } - else if (this.type == 857) - { - localNpcImmunity[index1] = 10; - targetNPC.immune[this.owner] = 0; - } - else if (this.type == 611 || this.type == 612) - { - localNpcImmunity[index1] = 6; - targetNPC.immune[this.owner] = 4; - } - else if (this.type == 645) - { - localNpcImmunity[index1] = -1; - targetNPC.immune[this.owner] = 0; - if ((double) this.ai[1] != -1.0) - { - this.ai[0] = 0.0f; - this.ai[1] = -1f; - this.netUpdate = true; - } - } - ++this.numHits; - if (this.type == 697) - { - if ((double) this.ai[0] >= 42.0) - this.localAI[1] = 1f; - } - else if (this.type == 699) - this.SummonMonkGhast(); - else if (this.type == 706) - this.damage = (int) ((double) this.damage * 0.949999988079071); - else if (this.type == 728) - this.SummonSuperStarSlash(targetNPC.Center); - else if (this.type == 34) - { - if ((double) this.ai[0] == -1.0) - { - this.ai[1] = -1f; - this.netUpdate = true; - } - } - else if (this.type == 79) - { - if ((double) this.ai[0] == -1.0) - { - this.ai[1] = -1f; - this.netUpdate = true; - } - ParticleOrchestrator.RequestParticleSpawn(false, ParticleOrchestraType.RainbowRodHit, new ParticleOrchestraSettings() - { - PositionInWorld = targetNPC.Center, - MovementVector = this.velocity - }); - } - else if (this.type == 931) - { - int targetWithLineOfSight = this.FindTargetWithLineOfSight(); - if (targetWithLineOfSight != -1) - { - this.ai[0] = (float) targetWithLineOfSight; - this.netUpdate = true; - } - } - else if (this.aiStyle == 165) - { - if (targetNPC.active) - Main.player[this.owner].MinionAttackTargetNPC = index1; - } - else if (this.type == 623) - ParticleOrchestrator.RequestParticleSpawn(false, ParticleOrchestraType.StardustPunch, new ParticleOrchestraSettings() - { - PositionInWorld = Vector2.Lerp(this.Center, targetNPC.Hitbox.ClosestPointInRect(this.Center), 0.5f) + new Vector2(0.0f, Main.rand.NextFloatDirection() * 10f), - MovementVector = new Vector2((float) this.direction, Main.rand.NextFloatDirection() * 0.5f) * (float) (3.0 + 3.0 * (double) Main.rand.NextFloat()) - }); - } + Microsoft.Xna.Framework.Rectangle rect = Main.npc[index1].getRect(); + int num = 8; + rect.X -= num; + rect.Y -= num; + rect.Width += num * 2; + rect.Height += num * 2; + flag3 = this.Colliding(myRect, rect); } - } - NPC npc6 = Main.npc[index1]; - npc6.position = npc6.position - Main.npc[index1].netOffset; - } - } - } - if (this.damage > 0 && Main.player[Main.myPlayer].hostile) - { - for (int index = 0; index < (int) byte.MaxValue; ++index) - { - if (index != this.owner) - { - Player player = Main.player[index]; - if (player.active && !player.dead && !player.immune && player.hostile && this.playerImmune[index] <= 0 && (Main.player[Main.myPlayer].team == 0 ? 1 : (Main.player[Main.myPlayer].team != player.team ? 1 : 0)) != 0) - { - bool flag14 = !this.ownerHitCheck; - if (this.ownerHitCheck) - flag14 |= this.CanHitWithMeleeWeapon((Entity) player); - if (flag14 && this.Colliding(myRect, player.getRect())) + else + flag3 = this.Colliding(myRect, Main.npc[index1].getRect()); + if (flag3) { - if (this.aiStyle == 3) + if (this.type == 604) + Main.player[this.owner].Counterweight(Main.npc[index1].Center, this.damage, this.knockBack); + if (Main.npc[index1].reflectingProjectiles && this.CanReflect()) + { + Main.npc[index1].ReflectProjectile(this.whoAmI); + return; + } + int num1 = this.damage; + if (this.type > 0 && this.type < 714 && ProjectileID.Sets.StardustDragon[this.type]) + { + float num2 = Utils.Clamp((float) (((double) this.scale - 1.0) * 100.0), 0.0f, 50f); + num1 = (int) ((double) num1 * (1.0 + (double) num2 * 0.230000004172325)); + } + int Damage1 = Main.DamageVar((float) num1); + bool flag4 = !this.npcProj && !this.trap; + if (this.trap && NPCID.Sets.BelongsToInvasionOldOnesArmy[Main.npc[index1].type]) + Damage1 /= 2; + if (this.type == 604) + { + this.friendly = false; + this.ai[1] = 1000f; + } + if ((this.type == 400 || this.type == 401 || this.type == 402) && Main.npc[index1].type >= 13 && Main.npc[index1].type <= 15) + { + Damage1 = (int) ((double) Damage1 * 0.65); + if (this.penetrate > 1) + --this.penetrate; + } + if (this.type == 710) + { + if (!WorldUtils.Find(this.Center.ToTileCoordinates(), Searches.Chain((GenSearch) new Searches.Down(12), (GenCondition) new Conditions.IsSolid()), out Point _)) + Damage1 = (int) ((double) Damage1 * 1.5); + } + if (this.type == 504) + this.ai[0] += (float) ((60.0 - (double) this.ai[0]) / 2.0); + if (this.aiStyle == 3 && this.type != 301) { if ((double) this.ai[0] == 0.0) { @@ -10442,11 +7808,29 @@ namespace Terraria } this.ai[0] = 1f; } + else if (this.type == 582) + { + if ((double) this.ai[0] != 0.0) + this.direction *= -1; + } + else if (this.type == 612) + this.direction = Main.player[this.owner].direction; + else if (this.type == 624) + { + float num3 = 1f; + if ((double) Main.npc[index1].knockBackResist > 0.0) + num3 = 1f / Main.npc[index1].knockBackResist; + this.knockBack = 4f * num3; + if ((double) Main.npc[index1].Center.X < (double) this.Center.X) + this.direction = 1; + else + this.direction = -1; + } else if (this.aiStyle == 16) { if (this.timeLeft > 3) this.timeLeft = 3; - if ((double) player.position.X + (double) (player.width / 2) < (double) this.position.X + (double) (this.width / 2)) + if ((double) Main.npc[index1].position.X + (double) (Main.npc[index1].width / 2) < (double) this.position.X + (double) (this.width / 2)) this.direction = -1; else this.direction = 1; @@ -10455,33 +7839,406 @@ namespace Terraria { if (this.timeLeft > 3) this.timeLeft = 3; - if ((double) player.position.X + (double) (player.width / 2) < (double) this.position.X + (double) (this.width / 2)) + if ((double) Main.npc[index1].position.X + (double) (Main.npc[index1].width / 2) < (double) this.position.X + (double) (this.width / 2)) this.direction = -1; else this.direction = 1; } - PlayerDeathReason playerDeathReason = PlayerDeathReason.ByProjectile(this.owner, this.whoAmI); + else if (this.aiStyle == 50) + { + if ((double) Main.npc[index1].position.X + (double) (Main.npc[index1].width / 2) < (double) this.position.X + (double) (this.width / 2)) + this.direction = -1; + else + this.direction = 1; + } + if (this.type == 509) + { + int num4 = Main.rand.Next(2, 6); + for (int index2 = 0; index2 < num4; ++index2) + { + Vector2 vector2 = new Vector2((float) Main.rand.Next(-100, 101), (float) Main.rand.Next(-100, 101)); + vector2 += this.velocity * 3f; + vector2.Normalize(); + vector2 *= (float) Main.rand.Next(35, 81) * 0.1f; + int Damage2 = (int) ((double) this.damage * 0.5); + Projectile.NewProjectile(this.Center.X, this.Center.Y, vector2.X, vector2.Y, 504, Damage2, this.knockBack * 0.2f, this.owner); + } + } + if (this.type == 598 || this.type == 636 || this.type == 614) + { + this.ai[0] = 1f; + this.ai[1] = (float) index1; + this.velocity = (Main.npc[index1].Center - this.Center) * 0.75f; + this.netUpdate = true; + } + if (this.type >= 511 && this.type <= 513) + this.timeLeft = 0; + if (this.type == 659) + this.timeLeft = 0; + if (this.type == 524) + { + this.netUpdate = true; + this.ai[0] += 50f; + } + if ((this.type == 688 || this.type == 689 || this.type == 690) && Main.npc[index1].type != 68 && Main.npc[index1].defense < 999) + Damage1 += Main.npc[index1].defense / 2; + if (this.aiStyle == 39) + { + if ((double) this.ai[1] == 0.0) + { + this.ai[1] = (float) (index1 + 1); + this.netUpdate = true; + } + if ((double) Main.player[this.owner].position.X + (double) (Main.player[this.owner].width / 2) < (double) this.position.X + (double) (this.width / 2)) + this.direction = 1; + else + this.direction = -1; + } if (this.type == 41 && this.timeLeft > 1) this.timeLeft = 1; - bool flag15 = false; - if (this.melee && Main.rand.Next(1, 101) <= Main.player[this.owner].meleeCrit) - flag15 = true; - int num20 = Main.DamageVar((float) (int) ((double) this.damage * (double) num1), Main.player[this.owner].luck); - if (!player.immune) - this.StatusPvP(index); - this.TryDoingOnHitEffects((Entity) player); - int dmg = (int) player.Hurt(playerDeathReason, num20, this.direction, true, Crit: flag15); - if (dmg > 0 && Main.player[this.owner].ghostHeal && this.friendly && !this.hostile) - this.ghostHeal(dmg, new Vector2(player.Center.X, player.Center.Y)); - if (this.type == 304 && dmg > 0) - this.vampireHeal(dmg, new Vector2(player.Center.X, player.Center.Y)); - if (this.melee && Main.player[this.owner].meleeEnchant == (byte) 7) - Projectile.NewProjectile(player.Center.X, player.Center.Y, player.velocity.X, player.velocity.Y, 289, 0, 0.0f, this.owner); - if (Main.netMode != 0) - NetMessage.SendPlayerHurt(index, playerDeathReason, num20, this.direction, flag15, true, -1); - this.playerImmune[index] = 40; - if (this.penetrate > 0) + bool crit = false; + if (flag4) { + if (this.melee && Main.rand.Next(1, 101) <= Main.player[this.owner].meleeCrit) + crit = true; + if (this.ranged && Main.rand.Next(1, 101) <= Main.player[this.owner].rangedCrit) + crit = true; + if (this.magic && Main.rand.Next(1, 101) <= Main.player[this.owner].magicCrit) + crit = true; + if (this.thrown && Main.rand.Next(1, 101) <= Main.player[this.owner].thrownCrit) + crit = true; + switch (this.type) + { + case 688: + case 689: + case 690: + if (Main.player[this.owner].setMonkT3) + { + if (Main.rand.Next(4) == 0) + { + crit = true; + break; + } + break; + } + if (Main.player[this.owner].setMonkT2 && Main.rand.Next(6) == 0) + { + crit = true; + break; + } + break; + } + } + if (this.aiStyle == 99) + { + Main.player[this.owner].Counterweight(Main.npc[index1].Center, this.damage, this.knockBack); + if ((double) Main.npc[index1].Center.X < (double) Main.player[this.owner].Center.X) + this.direction = -1; + else + this.direction = 1; + if ((double) this.ai[0] >= 0.0) + { + Vector2 vector2 = this.Center - Main.npc[index1].Center; + vector2.Normalize(); + float num5 = 16f; + this.velocity = this.velocity * -0.5f; + this.velocity = this.velocity + vector2 * num5; + this.netUpdate = true; + this.localAI[0] += 20f; + if (!Collision.CanHit(this.position, this.width, this.height, Main.player[this.owner].position, Main.player[this.owner].width, Main.player[this.owner].height)) + { + this.localAI[0] += 40f; + Damage1 = (int) ((double) Damage1 * 0.75); + } + } + } + if (this.aiStyle == 93) + { + if ((double) this.ai[0] == 0.0) + { + this.ai[1] = 0.0f; + this.ai[0] = (float) (-index1 - 1); + this.velocity = Main.npc[index1].Center - this.Center; + } + Damage1 = (double) this.ai[0] != 2.0 ? (int) ((double) Damage1 * 0.15) : (int) ((double) Damage1 * 1.35); + } + if (flag4) + { + int num6 = Item.NPCtoBanner(Main.npc[index1].BannerID()); + if (num6 >= 0) + Main.player[Main.myPlayer].lastCreatureHit = num6; + } + if (Main.netMode != 2 & flag4) + { + int banner = Item.NPCtoBanner(Main.npc[index1].BannerID()); + if (banner > 0 && Main.player[this.owner].NPCBannerBuff[banner]) + Damage1 = !Main.expertMode ? (int) ((double) Damage1 * (double) ItemID.Sets.BannerStrength[Item.BannerToItem(banner)].NormalDamageDealt) : (int) ((double) Damage1 * (double) ItemID.Sets.BannerStrength[Item.BannerToItem(banner)].ExpertDamageDealt); + } + if (Main.expertMode) + { + if ((this.type == 30 || this.type == 28 || this.type == 29 || this.type == 470 || this.type == 517 || this.type == 588 || this.type == 637) && Main.npc[index1].type >= 13 && Main.npc[index1].type <= 15) + Damage1 /= 5; + if (this.type == 280 && (Main.npc[index1].type >= 134 && Main.npc[index1].type <= 136 || Main.npc[index1].type == 139)) + Damage1 = (int) ((double) Damage1 * 0.75); + } + if (Main.netMode != 2 && Main.npc[index1].type == 439 && this.type >= 0 && this.type <= 714 && ProjectileID.Sets.Homing[this.type]) + Damage1 = (int) ((double) Damage1 * 0.75); + if (this.type == 497 && this.penetrate != 1) + { + this.ai[0] = 25f; + float num7 = this.velocity.Length(); + Vector2 vector2 = Main.npc[index1].Center - this.Center; + vector2.Normalize(); + this.velocity = -(vector2 * num7) * 0.9f; + this.netUpdate = true; + } + if (this.type == 323 && (Main.npc[index1].type == 158 || Main.npc[index1].type == 159)) + Damage1 *= 10; + if (this.type == 294) + this.damage = (int) ((double) this.damage * 0.8); + if (this.type == 477 && this.penetrate > 1) + { + int[] numArray = new int[10]; + int maxValue = 0; + int num8 = 700; + int num9 = 20; + for (int index3 = 0; index3 < 200; ++index3) + { + if (index3 != index1 && Main.npc[index3].CanBeChasedBy((object) this)) + { + float num10 = (this.Center - Main.npc[index3].Center).Length(); + if ((double) num10 > (double) num9 && (double) num10 < (double) num8 && Collision.CanHitLine(this.Center, 1, 1, Main.npc[index3].Center, 1, 1)) + { + numArray[maxValue] = index3; + ++maxValue; + if (maxValue >= 9) + break; + } + } + } + if (maxValue > 0) + { + int index4 = Main.rand.Next(maxValue); + Vector2 vector2 = Main.npc[numArray[index4]].Center - this.Center; + float num11 = this.velocity.Length(); + vector2.Normalize(); + this.velocity = vector2 * num11; + this.netUpdate = true; + } + } + if (this.type == 261) + { + float num12 = (float) Math.Sqrt((double) this.velocity.X * (double) this.velocity.X + (double) this.velocity.Y * (double) this.velocity.Y); + if ((double) num12 < 1.0) + num12 = 1f; + Damage1 = (int) ((double) Damage1 * (double) num12 / 8.0); + } + if (flag4 && this.melee && Main.player[this.owner].parryDamageBuff) + { + Damage1 *= 5; + Main.player[this.owner].parryDamageBuff = false; + Main.player[this.owner].ClearBuff(198); + } + this.StatusNPC(index1); + if (flag4 && this.type != 221 && this.type != 227 && this.type != 614) + Main.player[this.owner].OnHit(Main.npc[index1].Center.X, Main.npc[index1].Center.Y, (Entity) Main.npc[index1]); + if (this.type == 317) + { + this.ai[1] = -1f; + this.netUpdate = true; + } + int hitDirection = this.direction; + if (this.type == 697 || this.type == 699 || this.type == 707 || this.type == 708) + hitDirection = (double) Main.player[this.owner].Center.X < (double) Main.npc[index1].Center.X ? 1 : -1; + if (flag4 && !this.hostile && Main.player[this.owner].armorPenetration > 0) + Damage1 += Main.npc[index1].checkArmorPenetration(Main.player[this.owner].armorPenetration); + int dmg = !flag4 ? (int) Main.npc[index1].StrikeNPCNoInteraction(Damage1, this.knockBack, hitDirection, crit) : (int) Main.npc[index1].StrikeNPC(Damage1, this.knockBack, hitDirection, crit); + if (flag4 && Main.player[this.owner].accDreamCatcher) + Main.player[this.owner].addDPS(dmg); + if (flag4 && !Main.npc[index1].immortal) + { + if (this.type == 304 && dmg > 0 && Main.npc[index1].lifeMax > 5 && !Main.player[this.owner].moonLeech) + this.vampireHeal(dmg, new Vector2(Main.npc[index1].Center.X, Main.npc[index1].Center.Y)); + if ((double) Main.npc[index1].value > 0.0 && Main.player[this.owner].coins && Main.rand.Next(5) == 0) + { + int Type = 71; + if (Main.rand.Next(10) == 0) + Type = 72; + if (Main.rand.Next(100) == 0) + Type = 73; + int number = Item.NewItem((int) Main.npc[index1].position.X, (int) Main.npc[index1].position.Y, Main.npc[index1].width, Main.npc[index1].height, Type); + Main.item[number].stack = Main.rand.Next(1, 11); + Main.item[number].velocity.Y = (float) Main.rand.Next(-20, 1) * 0.2f; + Main.item[number].velocity.X = (float) Main.rand.Next(10, 31) * 0.2f * (float) this.direction; + if (Main.netMode == 1) + NetMessage.SendData(21, number: number); + } + if (dmg > 0 && Main.npc[index1].lifeMax > 5 && this.friendly && !this.hostile && this.aiStyle != 59) + { + if (Main.npc[index1].canGhostHeal) + { + if (Main.player[this.owner].ghostHeal && !Main.player[this.owner].moonLeech) + this.ghostHeal(dmg, new Vector2(Main.npc[index1].Center.X, Main.npc[index1].Center.Y)); + if (Main.player[this.owner].ghostHurt) + this.ghostHurt(dmg, new Vector2(Main.npc[index1].Center.X, Main.npc[index1].Center.Y)); + if (Main.player[this.owner].setNebula && Main.player[this.owner].nebulaCD == 0 && Main.rand.Next(3) == 0) + { + Main.player[this.owner].nebulaCD = 30; + int Type = Utils.SelectRandom(Main.rand, 3453, 3454, 3455); + int number = Item.NewItem((int) Main.npc[index1].position.X, (int) Main.npc[index1].position.Y, Main.npc[index1].width, Main.npc[index1].height, Type); + Main.item[number].velocity.Y = (float) Main.rand.Next(-20, 1) * 0.2f; + Main.item[number].velocity.X = (float) Main.rand.Next(10, 31) * 0.2f * (float) this.direction; + if (Main.netMode == 1) + NetMessage.SendData(21, number: number); + } + } + if (this.melee && Main.player[this.owner].beetleOffense && !Main.npc[index1].immortal) + { + if (Main.player[this.owner].beetleOrbs == 0) + Main.player[this.owner].beetleCounter += (float) (dmg * 3); + else if (Main.player[this.owner].beetleOrbs == 1) + Main.player[this.owner].beetleCounter += (float) (dmg * 2); + else + Main.player[this.owner].beetleCounter += (float) dmg; + Main.player[this.owner].beetleCountdown = 0; + } + if (this.arrow && this.type != 631 && Main.player[this.owner].phantasmTime > 0) + { + Vector2 Source = Main.player[this.owner].position + Main.player[this.owner].Size * Utils.RandomVector2(Main.rand, 0.0f, 1f); + Vector2 vector2 = Main.npc[index1].DirectionFrom(Source) * 6f; + int Damage3 = (int) ((double) this.damage * 0.300000011920929); + Projectile.NewProjectile(Source.X, Source.Y, vector2.X, vector2.Y, 631, Damage3, 0.0f, this.owner, (float) index1); + Projectile.NewProjectile(Source.X, Source.Y, vector2.X, vector2.Y, 631, Damage3, 0.0f, this.owner, (float) index1, 15f); + Projectile.NewProjectile(Source.X, Source.Y, vector2.X, vector2.Y, 631, Damage3, 0.0f, this.owner, (float) index1, 30f); + } + } + } + if (flag4 && this.melee && Main.player[this.owner].meleeEnchant == (byte) 7) + Projectile.NewProjectile(Main.npc[index1].Center.X, Main.npc[index1].Center.Y, Main.npc[index1].velocity.X, Main.npc[index1].velocity.Y, 289, 0, 0.0f, this.owner); + if (Main.netMode != 0) + { + if (crit) + NetMessage.SendData(28, number: index1, number2: ((float) Damage1), number3: this.knockBack, number4: ((float) this.direction), number5: 1); + else + NetMessage.SendData(28, number: index1, number2: ((float) Damage1), number3: this.knockBack, number4: ((float) this.direction)); + } + if (this.type >= 390 && this.type <= 392) + this.localAI[1] = 20f; + if (this.usesIDStaticNPCImmunity) + { + Main.npc[index1].immune[this.owner] = 0; + Projectile.perIDStaticNPCImmunity[this.type][index1] = Main.GameUpdateCount + (uint) this.idStaticNPCHitCooldown; + } + else if (this.type == 434) + this.numUpdates = 0; + else if (this.type == 598 || this.type == 636 || this.type == 614) + { + this.damage = 0; + int length = 6; + if (this.type == 614) + length = 10; + if (this.type == 636) + length = 8; + Point[] pointArray = new Point[length]; + int num13 = 0; + for (int x = 0; x < 1000; ++x) + { + if (x != this.whoAmI && Main.projectile[x].active && Main.projectile[x].owner == Main.myPlayer && Main.projectile[x].type == this.type && (double) Main.projectile[x].ai[0] == 1.0 && (double) Main.projectile[x].ai[1] == (double) index1) + { + pointArray[num13++] = new Point(x, Main.projectile[x].timeLeft); + if (num13 >= pointArray.Length) + break; + } + } + if (num13 >= pointArray.Length) + { + int index5 = 0; + for (int index6 = 1; index6 < pointArray.Length; ++index6) + { + if (pointArray[index6].Y < pointArray[index5].Y) + index5 = index6; + } + Main.projectile[pointArray[index5].X].Kill(); + } + } + else if (this.type == 632) + Main.npc[index1].immune[this.owner] = 5; + else if (this.type == 514) + Main.npc[index1].immune[this.owner] = 1; + else if (this.type == 611) + { + if ((double) this.localAI[1] <= 0.0) + Projectile.NewProjectile(Main.npc[index1].Center.X, Main.npc[index1].Center.Y, 0.0f, 0.0f, 612, this.damage, 10f, this.owner, ai1: ((float) (0.850000023841858 + (double) Main.rand.NextFloat() * 1.14999997615814))); + this.localAI[1] = 4f; + } + else if (this.type == 595) + Main.npc[index1].immune[this.owner] = 5; + else if (this.type >= 625 && this.type <= 628) + Main.npc[index1].immune[this.owner] = 6; + else if (this.type == 286) + Main.npc[index1].immune[this.owner] = 5; + else if (this.type == 514) + Main.npc[index1].immune[this.owner] = 3; + else if (this.type == 443) + Main.npc[index1].immune[this.owner] = 8; + else if (this.type >= 424 && this.type <= 426) + Main.npc[index1].immune[this.owner] = 5; + else if (this.type == 634 || this.type == 635) + Main.npc[index1].immune[this.owner] = 5; + else if (this.type == 659) + Main.npc[index1].immune[this.owner] = 5; + else if (this.type == 246) + Main.npc[index1].immune[this.owner] = 7; + else if (this.type == 249) + Main.npc[index1].immune[this.owner] = 7; + else if (this.type == 190) + Main.npc[index1].immune[this.owner] = 8; + else if (this.type == 409) + Main.npc[index1].immune[this.owner] = 6; + else if (this.type == 407) + Main.npc[index1].immune[this.owner] = 20; + else if (this.type == 311) + Main.npc[index1].immune[this.owner] = 7; + else if (this.type == 582) + { + Main.npc[index1].immune[this.owner] = 7; + if ((double) this.ai[0] != 1.0) + { + this.ai[0] = 1f; + this.netUpdate = true; + } + } + else + { + if (this.type == 451) + { + if ((double) this.ai[0] == 0.0) + this.ai[0] += (float) this.penetrate; + else + this.ai[0] -= (float) (this.penetrate + 1); + this.ai[1] = 0.0f; + this.netUpdate = true; + break; + } + if (this.type == 661) + { + this.localNPCImmunity[index1] = 8; + Main.npc[index1].immune[this.owner] = 0; + } + else if (this.usesLocalNPCImmunity && this.localNPCHitCooldown != -2) + { + Main.npc[index1].immune[this.owner] = 0; + this.localNPCImmunity[index1] = this.localNPCHitCooldown; + } + else if (this.penetrate != 1) + Main.npc[index1].immune[this.owner] = 10; + } + if (this.type == 710) + this.BetsySharpnel(index1); + if (this.penetrate > 0 && this.type != 317) + { + if (this.type == 357) + this.damage = (int) ((double) this.damage * 0.9); --this.penetrate; if (this.penetrate == 0) break; @@ -10502,11 +8259,150 @@ namespace Terraria this.ai[0] = 1f; this.netUpdate = true; } + else if (this.type == 607) + { + this.ai[0] = 1f; + this.netUpdate = true; + this.friendly = false; + } + else if (this.type == 638 || this.type == 639 || this.type == 640) + { + this.localNPCImmunity[index1] = -1; + Main.npc[index1].immune[this.owner] = 0; + this.damage = (int) ((double) this.damage * 0.96); + } + else if (this.type == 617) + { + this.localNPCImmunity[index1] = 8; + Main.npc[index1].immune[this.owner] = 0; + } + else if (this.type == 656) + { + this.localNPCImmunity[index1] = 8; + Main.npc[index1].immune[this.owner] = 0; + ++this.localAI[0]; + } + else if (this.type == 618) + { + this.localNPCImmunity[index1] = 20; + Main.npc[index1].immune[this.owner] = 0; + } + else if (this.type == 642) + { + this.localNPCImmunity[index1] = 10; + Main.npc[index1].immune[this.owner] = 0; + } + else if (this.type == 611 || this.type == 612) + { + this.localNPCImmunity[index1] = 6; + Main.npc[index1].immune[this.owner] = 4; + } + else if (this.type == 645) + { + this.localNPCImmunity[index1] = -1; + Main.npc[index1].immune[this.owner] = 0; + if ((double) this.ai[1] != -1.0) + { + this.ai[0] = 0.0f; + this.ai[1] = -1f; + this.netUpdate = true; + } + } + ++this.numHits; + if (this.type == 697) + { + if ((double) this.ai[0] >= 42.0) + this.localAI[1] = 1f; + } + else if (this.type == 699) + this.SummonMonkGhast(); + else if (this.type == 706) + this.damage = (int) ((double) this.damage * 0.949999988079071); } } } } } + if (this.damage > 0 && Main.player[Main.myPlayer].hostile) + { + for (int index = 0; index < (int) byte.MaxValue; ++index) + { + if (index != this.owner && Main.player[index].active && !Main.player[index].dead && !Main.player[index].immune && Main.player[index].hostile && this.playerImmune[index] <= 0 && (Main.player[Main.myPlayer].team == 0 || Main.player[Main.myPlayer].team != Main.player[index].team) && (!this.ownerHitCheck || this.CanHit((Entity) Main.player[index])) && this.Colliding(myRect, Main.player[index].getRect())) + { + if (this.aiStyle == 3) + { + if ((double) this.ai[0] == 0.0) + { + this.velocity.X = -this.velocity.X; + this.velocity.Y = -this.velocity.Y; + this.netUpdate = true; + } + this.ai[0] = 1f; + } + else if (this.aiStyle == 16) + { + if (this.timeLeft > 3) + this.timeLeft = 3; + if ((double) Main.player[index].position.X + (double) (Main.player[index].width / 2) < (double) this.position.X + (double) (this.width / 2)) + this.direction = -1; + else + this.direction = 1; + } + else if (this.aiStyle == 68) + { + if (this.timeLeft > 3) + this.timeLeft = 3; + if ((double) Main.player[index].position.X + (double) (Main.player[index].width / 2) < (double) this.position.X + (double) (this.width / 2)) + this.direction = -1; + else + this.direction = 1; + } + PlayerDeathReason playerDeathReason = PlayerDeathReason.ByProjectile(this.owner, this.whoAmI); + if (this.type == 41 && this.timeLeft > 1) + this.timeLeft = 1; + bool flag = false; + if (this.melee && Main.rand.Next(1, 101) <= Main.player[this.owner].meleeCrit) + flag = true; + int num = Main.DamageVar((float) this.damage); + if (!Main.player[index].immune) + this.StatusPvP(index); + if (this.type != 221 && this.type != 227 && this.type != 614) + Main.player[this.owner].OnHit(Main.player[index].Center.X, Main.player[index].Center.Y, (Entity) Main.player[index]); + int dmg = (int) Main.player[index].Hurt(playerDeathReason, num, this.direction, true, Crit: flag); + if (dmg > 0 && Main.player[this.owner].ghostHeal && this.friendly && !this.hostile) + this.ghostHeal(dmg, new Vector2(Main.player[index].Center.X, Main.player[index].Center.Y)); + if (this.type == 304 && dmg > 0) + this.vampireHeal(dmg, new Vector2(Main.player[index].Center.X, Main.player[index].Center.Y)); + if (this.melee && Main.player[this.owner].meleeEnchant == (byte) 7) + Projectile.NewProjectile(Main.player[index].Center.X, Main.player[index].Center.Y, Main.player[index].velocity.X, Main.player[index].velocity.Y, 289, 0, 0.0f, this.owner); + if (Main.netMode != 0) + NetMessage.SendPlayerHurt(index, playerDeathReason, num, this.direction, flag, true, 0); + this.playerImmune[index] = 40; + if (this.penetrate > 0) + { + --this.penetrate; + if (this.penetrate == 0) + break; + } + if (this.aiStyle == 7) + { + this.ai[0] = 1f; + this.damage = 0; + this.netUpdate = true; + } + else if (this.aiStyle == 13) + { + this.ai[0] = 1f; + this.netUpdate = true; + } + else if (this.aiStyle == 69) + { + this.ai[0] = 1f; + this.netUpdate = true; + } + } + } + } } if (this.type == 10 && Main.netMode != 1) { @@ -10577,50 +8473,23 @@ namespace Terraria if (Main.netMode == 2 || !this.hostile || Main.myPlayer >= (int) byte.MaxValue || this.damage <= 0) return; int cooldownCounter = -1; - switch (this.type) - { - case 452: - case 454: - case 455: - case 462: - cooldownCounter = 1; - break; - case 871: - case 872: - case 873: - case 874: - case 919: - case 923: - case 924: - cooldownCounter = 1; - break; - } + if (this.type == 455 || this.type == 452 || this.type == 454 || this.type == 462) + cooldownCounter = 1; int player1 = Main.myPlayer; - bool flag = Main.player[player1].active && !Main.player[player1].dead && (!Main.player[player1].immune || cooldownCounter != -1); - if (flag && this.type == 281) - flag = (double) this.ai[1] - 1.0 == (double) player1; - if (Main.getGoodWorld && this.type == 281) - flag = true; - if (!flag || !this.Colliding(myRect, Main.player[player1].getRect())) + if (!Main.player[player1].active || Main.player[player1].dead || Main.player[player1].immune && cooldownCounter == -1 || !this.Colliding(myRect, Main.player[player1].getRect())) return; int direction = this.direction; int hitDirection1 = (double) Main.player[player1].position.X + (double) (Main.player[player1].width / 2) >= (double) this.position.X + (double) (this.width / 2) ? 1 : -1; if (!Main.player[player1].CanParryAgainst(Main.player[player1].Hitbox, this.Hitbox, this.velocity)) { - int num21 = Main.DamageVar((float) this.damage, -Main.player[this.owner].luck); + int num = Main.DamageVar((float) this.damage); if (!Main.player[player1].immune) this.StatusPlayer(player1); if (Main.player[player1].resistCold && this.coldDamage) - num21 = (int) ((double) num21 * 0.699999988079071); - float num22 = Main.GameModeInfo.EnemyDamageMultiplier; - if (Main.GameModeInfo.IsJourneyMode) - { - CreativePowers.DifficultySliderPower power = CreativePowerManager.Instance.GetPower(); - if (power.GetIsUnlocked()) - num22 = power.StrengthMultiplierToGiveNPCs; - } - int Damage = (int) ((double) num21 * (double) num22) * 2; - Main.player[player1].Hurt(PlayerDeathReason.ByProjectile(-1, this.whoAmI), Damage, hitDirection1, cooldownCounter: cooldownCounter); + num = (int) ((double) num * 0.699999988079071); + if (Main.expertMode) + num = (int) ((double) num * (double) Main.expertDamage); + Main.player[player1].Hurt(PlayerDeathReason.ByProjectile(-1, this.whoAmI), num * 2, hitDirection1, cooldownCounter: cooldownCounter); if (this.trap) { Main.player[player1].trapDebuffSource = true; @@ -10641,41 +8510,6 @@ namespace Terraria --this.penetrate; } - private static void EmitBlackLightningParticles(NPC targetNPC) => ParticleOrchestrator.RequestParticleSpawn(false, ParticleOrchestraType.BlackLightningHit, new ParticleOrchestraSettings() - { - PositionInWorld = targetNPC.Center - }); - - private void TryDoingOnHitEffects(Entity entity) - { - switch (this.type) - { - case 221: - break; - case 227: - break; - case 614: - break; - case 729: - break; - case 908: - break; - default: - Main.player[this.owner].OnHit(entity.Center.X, entity.Center.Y, entity); - break; - } - } - - private void SummonSuperStarSlash(Vector2 target) - { - Vector2 v = Main.rand.NextVector2CircularEdge(200f, 200f); - if ((double) v.Y < 0.0) - v.Y *= -1f; - v.Y += 100f; - Vector2 velocity = v.SafeNormalize(Vector2.UnitY) * 6f; - Projectile.NewProjectile(target - velocity * 20f, velocity, 729, this.damage / 2, 0.0f, this.owner, ai1: target.Y); - } - private void SummonMonkGhast() { if ((double) this.localAI[0] > 0.0) @@ -10707,327 +8541,158 @@ namespace Terraria { if (!this.CanCutTiles()) return; + int num1 = (int) ((double) this.position.X / 16.0); + int num2 = (int) (((double) this.position.X + (double) this.width) / 16.0) + 1; + int num3 = (int) ((double) this.position.Y / 16.0); + int num4 = (int) (((double) this.position.Y + (double) this.height) / 16.0) + 1; + if (num1 < 0) + num1 = 0; + if (num2 > Main.maxTilesX) + num2 = Main.maxTilesX; + if (num3 < 0) + num3 = 0; + if (num4 > Main.maxTilesY) + num4 = Main.maxTilesY; AchievementsHelper.CurrentlyMining = true; - bool flag = true; + for (int index1 = num1; index1 < num2; ++index1) + { + for (int index2 = num3; index2 < num4; ++index2) + { + if (Main.tile[index1, index2] != null && Main.tileCut[(int) Main.tile[index1, index2].type] && WorldGen.CanCutTile(index1, index2, TileCuttingContext.AttackProjectile)) + { + WorldGen.KillTile(index1, index2); + if (Main.netMode != 0) + NetMessage.SendData(17, number2: ((float) index1), number3: ((float) index2)); + } + } + } if (this.type == 461 || this.type == 632 || this.type == 642) { DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile; - Utils.PlotTileLine(this.Center, this.Center + this.velocity * this.localAI[1], (float) this.width * this.scale, new Utils.TileActionAttempt(DelegateMethods.CutTiles)); - } - else if (ProjectileID.Sets.IsAWhip[this.type]) - { - flag = false; - this._whipPointsForCollision.Clear(); - Projectile.FillWhipControlPoints(this, this._whipPointsForCollision); - Vector2 vector2 = new Vector2((float) ((double) this.width * (double) this.scale / 2.0), 0.0f); - for (int index = 0; index < this._whipPointsForCollision.Count; ++index) - { - DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile; - Utils.PlotTileLine(this._whipPointsForCollision[index] - vector2, this._whipPointsForCollision[index] + vector2, (float) this.height * this.scale, new Utils.TileActionAttempt(DelegateMethods.CutTiles)); - } - } - else if (this.type == 756) - { - DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile; - Utils.PlotTileLine(this.Center, this.Center + this.velocity.SafeNormalize(-Vector2.UnitY) * 200f * this.scale, 22f * this.scale, new Utils.TileActionAttempt(DelegateMethods.CutTiles)); - } - else if (this.type == 927) - { - DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile; - Utils.PlotTileLine(this.Center, this.Center + this.velocity.SafeNormalize(Vector2.UnitX) * 220f * this.scale, 80f * this.scale, new Utils.TileActionAttempt(DelegateMethods.CutTiles)); - } - else if (this.type == 802 || this.type == 842 || this.type == 938 || this.type == 939 || this.type == 940 || this.type == 941 || this.type == 942 || this.type == 943 || this.type == 944 || this.type == 945) - { - DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile; - Utils.PlotTileLine(this.Center, this.Center + this.velocity.SafeNormalize(-Vector2.UnitY) * 10f, 10f * this.scale, new Utils.TileActionAttempt(DelegateMethods.CutTiles)); + Utils.PlotTileLine(this.Center, this.Center + this.velocity * this.localAI[1], (float) this.width * this.scale, new Utils.PerLinePoint(DelegateMethods.CutTiles)); } else if (this.type == 611) { DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile; - Utils.PlotTileLine(this.Center, this.Center + this.velocity + this.velocity.SafeNormalize(Vector2.Zero) * 48f, (float) this.width * this.scale, new Utils.TileActionAttempt(DelegateMethods.CutTiles)); + Utils.PlotTileLine(this.Center, this.Center + this.velocity, (float) this.width * this.scale, new Utils.PerLinePoint(DelegateMethods.CutTiles)); } else if (this.type == 697 || this.type == 707) { - float num = 40f; + float num5 = 40f; if (this.type == 707) - num = 60f; + num5 = 60f; float f = this.rotation - 0.7853982f * (float) Math.Sign(this.velocity.X); DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile; - Utils.PlotTileLine(this.Center + f.ToRotationVector2() * -num, this.Center + f.ToRotationVector2() * num, (float) this.width * this.scale, new Utils.TileActionAttempt(DelegateMethods.CutTiles)); - } - if (flag) - { - int num1 = (int) ((double) this.position.X / 16.0); - int num2 = (int) (((double) this.position.X + (double) this.width) / 16.0) + 1; - int num3 = (int) ((double) this.position.Y / 16.0); - int num4 = (int) (((double) this.position.Y + (double) this.height) / 16.0) + 1; - if (num1 < 0) - num1 = 0; - if (num2 > Main.maxTilesX) - num2 = Main.maxTilesX; - if (num3 < 0) - num3 = 0; - if (num4 > Main.maxTilesY) - num4 = Main.maxTilesY; - for (int index1 = num1; index1 < num2; ++index1) - { - for (int index2 = num3; index2 < num4; ++index2) - { - if (Main.tile[index1, index2] != null && Main.tileCut[(int) Main.tile[index1, index2].type] && WorldGen.CanCutTile(index1, index2, TileCuttingContext.AttackProjectile)) - { - WorldGen.KillTile(index1, index2); - if (Main.netMode != 0) - NetMessage.SendData(17, number2: ((float) index1), number3: ((float) index2)); - } - } - } + Utils.PlotTileLine(this.Center + f.ToRotationVector2() * -num5, this.Center + f.ToRotationVector2() * num5, (float) this.width * this.scale, new Utils.PerLinePoint(DelegateMethods.CutTiles)); } AchievementsHelper.CurrentlyMining = false; } - private bool CanCutTiles() => this.aiStyle != 45 && this.aiStyle != 137 && this.aiStyle != 92 && this.aiStyle != 105 && this.aiStyle != 106 && !ProjectileID.Sets.IsAGolfBall[this.type] && this.type != 463 && this.type != 69 && this.type != 70 && this.type != 621 && this.type != 10 && this.type != 11 && this.type != 379 && this.type != 407 && this.type != 476 && this.type != 623 && (this.type < 625 || this.type > 628) && this.type != 833 && this.type != 834 && this.type != 835 && this.type != 818 && this.type != 831 && this.type != 820 && this.type != 864; + private bool CanCutTiles() + { + if (this.aiStyle == 45 || this.aiStyle == 137 || this.aiStyle == 92 || this.aiStyle == 105 || this.aiStyle == 106 || this.type == 463 || this.type == 69 || this.type == 70 || this.type == 621 || this.type == 10 || this.type == 11 || this.type == 379 || this.type == 407 || this.type == 476 || this.type == 623) + return false; + return this.type < 625 || this.type > 628; + } public bool Colliding(Microsoft.Xna.Framework.Rectangle myRect, Microsoft.Xna.Framework.Rectangle targetRect) { - if (this.aiStyle == 15) + if (this.type == 598 && targetRect.Width > 8 && targetRect.Height > 8) + targetRect.Inflate(-targetRect.Width / 8, -targetRect.Height / 8); + else if (this.type == 614 && targetRect.Width > 8 && targetRect.Height > 8) + targetRect.Inflate(-targetRect.Width / 8, -targetRect.Height / 8); + else if (this.type == 636 && targetRect.Width > 8 && targetRect.Height > 8) + targetRect.Inflate(-targetRect.Width / 8, -targetRect.Height / 8); + else if (this.type == 607) { - if ((double) this.ai[0] == 0.0) - { - Vector2 mountedCenter = Main.player[this.owner].MountedCenter; - Vector2 vector2 = targetRect.ClosestPointInRect(mountedCenter) - mountedCenter; - vector2.Y /= 0.8f; - float num = 55f; - return (double) vector2.Length() <= (double) num; - } + myRect.X += (int) this.velocity.X; + myRect.Y += (int) this.velocity.Y; } - else if (this.type == 623) + else if (this.type == 661) { - if ((double) this.ai[0] == 2.0) - { - Microsoft.Xna.Framework.Rectangle rectangle = Utils.CenteredRectangle(this.Center + new Vector2((float) (this.direction * 40), 0.0f), new Vector2(80f, 40f)); - if (targetRect.Intersects(rectangle)) - return true; - } - } - else - { - if (this.type == 933) - { - float collisionPoint = 0.0f; - float num1 = 40f; - for (int index = 14; index < this.oldPos.Length; index += 15) - { - float num2 = this.localAI[0] - (float) index; - if ((double) num2 >= 0.0 && (double) num2 <= 60.0) - { - Vector2 vector2 = this.oldPos[index] + this.Size / 2f; - Vector2 rotationVector2 = (this.oldRot[index] + 1.570796f).ToRotationVector2(); - Projectile._lanceHitboxBounds.X = (int) vector2.X - Projectile._lanceHitboxBounds.Width / 2; - Projectile._lanceHitboxBounds.Y = (int) vector2.Y - Projectile._lanceHitboxBounds.Height / 2; - if (Projectile._lanceHitboxBounds.Intersects(targetRect) && Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), vector2 - rotationVector2 * num1, vector2 + rotationVector2 * num1, 20f, ref collisionPoint)) - return true; - } - } - Vector2 rotationVector2_1 = (this.rotation + 1.570796f).ToRotationVector2(); - Projectile._lanceHitboxBounds.X = (int) this.position.X - Projectile._lanceHitboxBounds.Width / 2; - Projectile._lanceHitboxBounds.Y = (int) this.position.Y - Projectile._lanceHitboxBounds.Height / 2; - return Projectile._lanceHitboxBounds.Intersects(targetRect) && Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), this.Center - rotationVector2_1 * num1, this.Center + rotationVector2_1 * num1, 20f, ref collisionPoint); - } - if (this.type == 927) - { - for (int index = 1; index <= 5; ++index) - { - Microsoft.Xna.Framework.Rectangle rectangle = myRect; - Vector2 vector2 = this.velocity.SafeNormalize(Vector2.Zero) * (float) this.width * (float) index; - rectangle.Offset((int) vector2.X, (int) vector2.Y); - if (rectangle.Intersects(targetRect)) - return true; - } - } - else - { - if (this.type == 877 || this.type == 878 || this.type == 879) - { - float f = (float) ((double) this.rotation - 0.785398185253143 - 1.57079637050629 - (this.spriteDirection == 1 ? 3.14159274101257 : 0.0)); - float collisionPoint = 0.0f; - float num = 95f; - Projectile._lanceHitboxBounds.X = (int) this.position.X - Projectile._lanceHitboxBounds.Width / 2; - Projectile._lanceHitboxBounds.Y = (int) this.position.Y - Projectile._lanceHitboxBounds.Height / 2; - return Projectile._lanceHitboxBounds.Intersects(targetRect) && Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), this.Center, this.Center + f.ToRotationVector2() * num, 23f * this.scale, ref collisionPoint); - } - if (this.type == 919 || this.type == 932) - { - double rotation = (double) this.rotation; - float collisionPoint = 0.0f; - float num = 40f; - Vector2 rotationVector2 = ((float) rotation).ToRotationVector2(); - Projectile._lanceHitboxBounds.X = (int) this.position.X - Projectile._lanceHitboxBounds.Width / 2; - Projectile._lanceHitboxBounds.Y = (int) this.position.Y - Projectile._lanceHitboxBounds.Height / 2; - return Projectile._lanceHitboxBounds.Intersects(targetRect) && Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), this.Center - rotationVector2 * num, this.Center + rotationVector2 * num, 8f, ref collisionPoint); - } - if (this.type == 923) - { - float collisionPoint = 0.0f; - double scale = (double) this.scale; - double rotation = (double) this.rotation; - Vector2 objectPosition = targetRect.TopLeft(); - Vector2 objectDimensions = targetRect.Size(); - Vector2 rotationVector2 = ((float) rotation).ToRotationVector2(); - float num = this.scale * 0.7f; - return Collision.CheckAABBvLineCollision(objectPosition, objectDimensions, this.Center, this.Center + rotationVector2 * this.scale * 510f, num * 100f, ref collisionPoint) || Collision.CheckAABBvLineCollision(objectPosition, objectDimensions, this.Center, this.Center + rotationVector2 * this.scale * 660f, num * 60f, ref collisionPoint) || Collision.CheckAABBvLineCollision(objectPosition, objectDimensions, this.Center, this.Center + rotationVector2 * this.scale * 800f, num * 10f, ref collisionPoint); - } - if (this.type == 598 && targetRect.Width > 8 && targetRect.Height > 8) - { - targetRect.Inflate(-targetRect.Width / 8, -targetRect.Height / 8); - } - else - { - if (this.type == 872) - { - Microsoft.Xna.Framework.Rectangle hitbox = this.Hitbox; - int num = 80; - for (int index = 0; index < num; index += 2) - { - Vector2 oldPo = this.oldPos[index]; - if (!(oldPo == Vector2.Zero)) - { - hitbox.X = (int) oldPo.X; - hitbox.Y = (int) oldPo.Y; - if (hitbox.Intersects(targetRect)) - return true; - } - } - return false; - } - if (this.type == 871) - { - int pelletStormsCount = this.AI_172_GetPelletStormsCount(); - for (int stormIndex = 0; stormIndex < pelletStormsCount; ++stormIndex) - { - Projectile.HallowBossPelletStormInfo pelletStormInfo = this.AI_172_GetPelletStormInfo(stormIndex); - for (int bulletIndex = 0; bulletIndex < pelletStormInfo.BulletsInStorm; ++bulletIndex) - { - if (pelletStormInfo.IsValid(bulletIndex) && pelletStormInfo.GetBulletHitbox(bulletIndex, this.Center).Intersects(targetRect)) - return true; - } - } - return false; - } - if (ProjectileID.Sets.IsAWhip[this.type]) - { - this._whipPointsForCollision.Clear(); - Projectile.FillWhipControlPoints(this, this._whipPointsForCollision); - for (int index = 0; index < this._whipPointsForCollision.Count; ++index) - { - Point point = this._whipPointsForCollision[index].ToPoint(); - myRect.Location = new Point(point.X - myRect.Width / 2, point.Y - myRect.Height / 2); - if (myRect.Intersects(targetRect)) - return true; - } - return false; - } - if (this.type == 614 && targetRect.Width > 8 && targetRect.Height > 8) - targetRect.Inflate(-targetRect.Width / 8, -targetRect.Height / 8); - else if (this.type == 758) - { - if ((double) this.ai[0] == 2.0 && Utils.CenteredRectangle(this.Center + new Vector2((float) (this.spriteDirection * 30), 0.0f), new Vector2(50f, 20f)).Intersects(targetRect)) - return true; - } - else if (this.type == 636 && targetRect.Width > 8 && targetRect.Height > 8) - targetRect.Inflate(-targetRect.Width / 8, -targetRect.Height / 8); - else if (this.type == 607) - { - myRect.X += (int) this.velocity.X; - myRect.Y += (int) this.velocity.Y; - } - else if (this.type == 661) - { - if ((double) Vector2.Distance(myRect.Center.ToVector2(), targetRect.Center.ToVector2()) > 500.0 || !Collision.CanHitLine(myRect.Center.ToVector2(), 0, 0, targetRect.Center.ToVector2(), 0, 0)) - return false; - } - else if (this.aiStyle == 137) - return myRect.Intersects(targetRect) && (double) targetRect.Distance(this.Center) < (double) (this.height / 2 - 20) && (this.AI_137_CanHit(targetRect.Center.ToVector2()) || this.AI_137_CanHit(targetRect.TopLeft() + new Vector2((float) (targetRect.Width / 2), 0.0f))); - } - } + if ((double) Vector2.Distance(myRect.Center.ToVector2(), targetRect.Center.ToVector2()) > 500.0 || !Collision.CanHitLine(myRect.Center.ToVector2(), 0, 0, targetRect.Center.ToVector2(), 0, 0)) + return false; } + else if (this.aiStyle == 137) + return myRect.Intersects(targetRect) && (double) targetRect.Distance(this.Center) < (double) (this.height / 2 - 20) && (this.AI_137_CanHit(targetRect.Center.ToVector2()) || this.AI_137_CanHit(targetRect.TopLeft() + new Vector2((float) (targetRect.Width / 2), 0.0f))); if (myRect.Intersects(targetRect)) return true; if (this.type == 461) { float collisionPoint = 0.0f; - return Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), this.Center, this.Center + this.velocity * this.localAI[1], 22f * this.scale, ref collisionPoint); + if (Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), this.Center, this.Center + this.velocity * this.localAI[1], 22f * this.scale, ref collisionPoint)) + return true; } - if (this.type == 697 || this.type == 707) + else if (this.type == 697 || this.type == 707) { float f = this.rotation - 0.7853982f * (float) Math.Sign(this.velocity.X); float collisionPoint = 0.0f; float num = 50f; if (this.type == 707) num = 110f; - return Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), this.Center + f.ToRotationVector2() * -num, this.Center + f.ToRotationVector2() * num, 23f * this.scale, ref collisionPoint); + if (Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), this.Center + f.ToRotationVector2() * -num, this.Center + f.ToRotationVector2() * num, 23f * this.scale, ref collisionPoint)) + return true; } - if (this.type == 699) + else if (this.type == 699) { float f = (float) ((double) this.rotation - 0.785398185253143 * (double) Math.Sign(this.velocity.X) + (this.spriteDirection == -1 ? 3.14159274101257 : 0.0)); float collisionPoint = 0.0f; float num = -95f; - return Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), this.Center, this.Center + f.ToRotationVector2() * num, 23f * this.scale, ref collisionPoint); + if (Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), this.Center, this.Center + f.ToRotationVector2() * num, 23f * this.scale, ref collisionPoint)) + return true; } - if (this.type == 642) + else if (this.type == 642) { float collisionPoint = 0.0f; - return Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), this.Center, this.Center + this.velocity * this.localAI[1], 30f * this.scale, ref collisionPoint); + if (Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), this.Center, this.Center + this.velocity * this.localAI[1], 30f * this.scale, ref collisionPoint)) + return true; } - if (this.type == 802 || this.type == 842 || this.type == 938 || this.type == 939 || this.type == 940 || this.type == 941 || this.type == 942 || this.type == 943 || this.type == 944 || this.type == 945) + else if (this.type == 632) { float collisionPoint = 0.0f; - return Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), this.Center, this.Center + this.velocity * 6f, 10f * this.scale, ref collisionPoint); + if (Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), this.Center, this.Center + this.velocity * this.localAI[1], 22f * this.scale, ref collisionPoint)) + return true; } - if (this.type == 632) + else if (this.type == 455) { float collisionPoint = 0.0f; - return Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), this.Center, this.Center + this.velocity * this.localAI[1], 22f * this.scale, ref collisionPoint); + if (Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), this.Center, this.Center + this.velocity * this.localAI[1], 36f * this.scale, ref collisionPoint)) + return true; } - if (this.type == 455) + else if (this.type == 611) { float collisionPoint = 0.0f; - return Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), this.Center, this.Center + this.velocity * this.localAI[1], 36f * this.scale, ref collisionPoint); + if (Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), this.Center, this.Center + this.velocity, 16f * this.scale, ref collisionPoint)) + return true; } - if (this.type == 611) - { - float collisionPoint = 0.0f; - return Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), this.Center, this.Center + this.velocity + this.velocity.SafeNormalize(Vector2.Zero) * 48f, 16f * this.scale, ref collisionPoint); - } - if (this.type == 684) + else if (this.type == 684) { float collisionPoint = 0.0f; Vector2 vector2 = this.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(-1.57079637050629) * this.scale; - return Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), this.Center - vector2 * 40f, this.Center + vector2 * 40f, 16f * this.scale, ref collisionPoint); + if (Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), this.Center - vector2 * 40f, this.Center + vector2 * 40f, 16f * this.scale, ref collisionPoint)) + return true; } - if (this.type == 537) + else if (this.type == 537) { float collisionPoint = 0.0f; - return Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), this.Center, this.Center + this.velocity * this.localAI[1], 22f * this.scale, ref collisionPoint); + if (Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), this.Center, this.Center + this.velocity * this.localAI[1], 22f * this.scale, ref collisionPoint)) + return true; } - if (this.type == 756) + else if (this.type == 687) { float collisionPoint = 0.0f; - return Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), this.Center, this.Center + this.velocity.SafeNormalize(-Vector2.UnitY) * 200f * this.scale, 22f * this.scale, ref collisionPoint); + float num1 = this.ai[0] / 25f; + if ((double) num1 > 1.0) + num1 = 1f; + float num2 = (float) (((double) this.ai[0] - 38.0) / 40.0); + if ((double) num2 < 0.0) + num2 = 0.0f; + Vector2 lineStart = this.Center + this.rotation.ToRotationVector2() * 400f * num2; + Vector2 lineEnd = this.Center + this.rotation.ToRotationVector2() * 400f * num1; + if (Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), lineStart, lineEnd, 40f * this.scale, ref collisionPoint)) + return true; } - if (this.type == 687) - { - float collisionPoint = 0.0f; - float num3 = this.ai[0] / 25f; - if ((double) num3 > 1.0) - num3 = 1f; - float num4 = (float) (((double) this.ai[0] - 38.0) / 40.0); - if ((double) num4 < 0.0) - num4 = 0.0f; - Vector2 lineStart = this.Center + this.rotation.ToRotationVector2() * 400f * num4; - Vector2 lineEnd = this.Center + this.rotation.ToRotationVector2() * 400f * num3; - return Collision.CheckAABBvLineCollision(targetRect.TopLeft(), targetRect.Size(), lineStart, lineEnd, 40f * this.scale, ref collisionPoint); - } - if (this.type == 466 || this.type == 580 || this.type == 686) + else if (this.type == 466 || this.type == 580 || this.type == 686) { for (int index = 0; index < this.oldPos.Length && ((double) this.oldPos[index].X != 0.0 || (double) this.oldPos[index].Y != 0.0); ++index) { @@ -11036,9 +8701,8 @@ namespace Terraria if (myRect.Intersects(targetRect)) return true; } - return false; } - if (this.type == 711) + else if (this.type == 711) { if (this.penetrate != -1) { @@ -11068,387 +8732,369 @@ namespace Terraria { if ((double) this.light <= 0.0) return; - float r = this.light; - float g = this.light; - float b = this.light; + float R = this.light; + float G = this.light; + float B = this.light; if (this.type == 446) { - r *= 0.0f; - b *= 0.8f; + R *= 0.0f; + B *= 0.8f; } else if (this.type == 493 || this.type == 494) - g *= 0.3f; - else if (this.type == 876) - { - r *= 0.1f; - g *= 0.7f; - b *= 1f; - } - else if (this.type == 867) - { - float num = (float) Main.rand.Next(28, 42) * 0.005f + (float) (270 - (int) Main.mouseTextColor) / 500f; - r = 0.1f; - g = (float) (0.300000011920929 + (double) num / 2.0); - b = 0.6f + num; - } + G *= 0.3f; else if (this.type == 332) { - b *= 0.1f; - g *= 0.6f; + B *= 0.1f; + G *= 0.6f; } else if (this.type == 259) - b *= 0.1f; + B *= 0.1f; else if (this.type == 329) { - b *= 0.1f; - g *= 0.9f; + B *= 0.1f; + G *= 0.9f; } else if (this.type == 2 || this.type == 82) { - g *= 0.75f; - b *= 0.55f; + G *= 0.75f; + B *= 0.55f; } else if (this.type == 172) { - g *= 0.55f; - r *= 0.35f; + G *= 0.55f; + R *= 0.35f; } else if (this.type == 308) { - g *= 0.7f; - r *= 0.1f; + G *= 0.7f; + R *= 0.1f; } else if (this.type == 304) { - g *= 0.2f; - b *= 0.1f; + G *= 0.2f; + B *= 0.1f; } else if (this.type == 263) { - g *= 0.7f; - r *= 0.1f; + G *= 0.7f; + R *= 0.1f; } else if (this.type == 274) { - g *= 0.1f; - r *= 0.7f; + G *= 0.1f; + R *= 0.7f; } else if (this.type == 254) - r *= 0.1f; + R *= 0.1f; else if (this.type == 94) { - r *= 0.5f; - g *= 0.0f; + R *= 0.5f; + G *= 0.0f; } else if (this.type == 95 || this.type == 96 || this.type == 103 || this.type == 104) { - r *= 0.35f; - g *= 1f; - b *= 0.0f; + R *= 0.35f; + G *= 1f; + B *= 0.0f; } else if (this.type == 4) { - g *= 0.1f; - r *= 0.5f; + G *= 0.1f; + R *= 0.5f; } else if (this.type == 257) { - g *= 0.9f; - r *= 0.1f; + G *= 0.9f; + R *= 0.1f; } else if (this.type == 9) { - g *= 0.1f; - b *= 0.6f; + G *= 0.1f; + B *= 0.6f; } else if (this.type == 488) { - r = 0.3f; - b = 0.25f; - g = 0.0f; + R = 0.3f; + B = 0.25f; + G = 0.0f; } else if (this.type == 92) { - g *= 0.6f; - r *= 0.8f; + G *= 0.6f; + R *= 0.8f; } else if (this.type == 93) { - g *= 1f; - r *= 1f; - b *= 0.01f; + G *= 1f; + R *= 1f; + B *= 0.01f; } else if (this.type == 12) { - r *= 0.9f; - g *= 0.8f; - b *= 0.1f; + R *= 0.9f; + G *= 0.8f; + B *= 0.1f; } else if (this.type == 14 || this.type == 110 || this.type == 180 || this.type == 242 || this.type == 302) { - g *= 0.7f; - b *= 0.1f; + G *= 0.7f; + B *= 0.1f; } else if (this.type == 15) { - g *= 0.4f; - b *= 0.1f; - r = 1f; + G *= 0.4f; + B *= 0.1f; + R = 1f; } else if (this.type == 16) { - r *= 0.1f; - g *= 0.4f; - b = 1f; + R *= 0.1f; + G *= 0.4f; + B = 1f; } else if (this.type == 18) { - g *= 0.1f; - r *= 0.6f; + G *= 0.1f; + R *= 0.6f; } else if (this.type == 19) { - g *= 0.5f; - b *= 0.1f; + G *= 0.5f; + B *= 0.1f; } else if (this.type == 20) { - r *= 0.1f; - b *= 0.3f; + R *= 0.1f; + B *= 0.3f; } else if (this.type == 22) { - r = 0.0f; - g = 0.0f; + R = 0.0f; + G = 0.0f; } else if (this.type == 27) { - r *= 0.0f; - g *= 0.3f; - b = 1f; + R *= 0.0f; + G *= 0.3f; + B = 1f; } else if (this.type == 34) { - g *= 0.1f; - b *= 0.1f; + G *= 0.1f; + B *= 0.1f; } else if (this.type == 36) { - r = 0.8f; - g *= 0.2f; - b *= 0.6f; + R = 0.8f; + G *= 0.2f; + B *= 0.6f; } else if (this.type == 41) { - g *= 0.8f; - b *= 0.6f; + G *= 0.8f; + B *= 0.6f; } else if (this.type == 44 || this.type == 45) { - b = 1f; - r *= 0.6f; - g *= 0.1f; + B = 1f; + R *= 0.6f; + G *= 0.1f; } else if (this.type == 50) { - r *= 0.7f; - b *= 0.8f; + R *= 0.7f; + B *= 0.8f; } else if (this.type == 515) { - g *= 0.6f; - b *= 0.85f; - } - else if (this.type == 870) - { - r *= 0.7f; - g = 0.0f; + G *= 0.6f; + B *= 0.85f; } else if (this.type == 53) { - r *= 0.7f; - g *= 0.8f; + R *= 0.7f; + G *= 0.8f; } else if (this.type == 473) { - r *= 1.05f; - g *= 0.95f; - b *= 0.55f; + R *= 1.05f; + G *= 0.95f; + B *= 0.55f; } else if (this.type == 72) { - r *= 0.45f; - g *= 0.75f; - b = 1f; + R *= 0.45f; + G *= 0.75f; + B = 1f; } else if (this.type == 86) { - r *= 1f; - g *= 0.45f; - b = 0.75f; + R *= 1f; + G *= 0.45f; + B = 0.75f; } else if (this.type == 87) { - r *= 0.45f; - g = 1f; - b *= 0.75f; + R *= 0.45f; + G = 1f; + B *= 0.75f; } else if (this.type == 73) { - r *= 0.4f; - g *= 0.6f; - b *= 1f; + R *= 0.4f; + G *= 0.6f; + B *= 1f; } else if (this.type == 74) { - r *= 1f; - g *= 0.4f; - b *= 0.6f; + R *= 1f; + G *= 0.4f; + B *= 0.6f; } else if (this.type == 284) { - r *= 1f; - g *= 0.1f; - b *= 0.8f; + R *= 1f; + G *= 0.1f; + B *= 0.8f; } else if (this.type == 285) { - r *= 0.1f; - g *= 0.5f; - b *= 1f; + R *= 0.1f; + G *= 0.5f; + B *= 1f; } else if (this.type == 286) { - r *= 1f; - g *= 0.5f; - b *= 0.1f; + R *= 1f; + G *= 0.5f; + B *= 0.1f; } else if (this.type == 287) { - r *= 0.9f; - g *= 1f; - b *= 0.4f; + R *= 0.9f; + G *= 1f; + B *= 0.4f; } else if (this.type == 283) { - r *= 0.8f; - g *= 0.1f; + R *= 0.8f; + G *= 0.1f; } else if (this.type == 76 || this.type == 77 || this.type == 78) { - r *= 1f; - g *= 0.3f; - b *= 0.6f; + R *= 1f; + G *= 0.3f; + B *= 0.6f; } else if (this.type == 79) { - r = (float) Main.DiscoR / (float) byte.MaxValue; - g = (float) Main.DiscoG / (float) byte.MaxValue; - b = (float) Main.DiscoB / (float) byte.MaxValue; + R = (float) Main.DiscoR / (float) byte.MaxValue; + G = (float) Main.DiscoG / (float) byte.MaxValue; + B = (float) Main.DiscoB / (float) byte.MaxValue; } else if (this.type == 80) { - r *= 0.0f; - g *= 0.8f; - b *= 1f; + R *= 0.0f; + G *= 0.8f; + B *= 1f; } else if (this.type == 83 || this.type == 88) { - r *= 0.7f; - g *= 0.0f; - b *= 1f; + R *= 0.7f; + G *= 0.0f; + B *= 1f; } else if (this.type == 100) { - r *= 1f; - g *= 0.5f; - b *= 0.0f; + R *= 1f; + G *= 0.5f; + B *= 0.0f; } else if (this.type == 84 || this.type == 389) { - r *= 0.8f; - g *= 0.0f; - b *= 0.5f; + R *= 0.8f; + G *= 0.0f; + B *= 0.5f; } else if (this.type == 89 || this.type == 90) { - g *= 0.2f; - b *= 1f; - r *= 0.05f; + G *= 0.2f; + B *= 1f; + R *= 0.05f; } else if (this.type == 106) { - r *= 0.0f; - g *= 0.5f; - b *= 1f; + R *= 0.0f; + G *= 0.5f; + B *= 1f; } else if (this.type == 113) { - r *= 0.25f; - g *= 0.75f; - b *= 1f; + R *= 0.25f; + G *= 0.75f; + B *= 1f; } else if (this.type == 114 || this.type == 115) { - r *= 0.5f; - g *= 0.05f; - b *= 1f; + R *= 0.5f; + G *= 0.05f; + B *= 1f; } else if (this.type == 116) - b *= 0.25f; + B *= 0.25f; else if (this.type == 131) { - r *= 0.1f; - g *= 0.4f; + R *= 0.1f; + G *= 0.4f; } else if (this.type == 132 || this.type == 157) { - r *= 0.2f; - b *= 0.6f; + R *= 0.2f; + B *= 0.6f; } else if (this.type == 156) { - r *= 1f; - b *= 0.6f; - g = 0.0f; + R *= 1f; + B *= 0.6f; + G = 0.0f; } else if (this.type == 173) { - r *= 0.3f; - b *= 1f; - g = 0.4f; + R *= 0.3f; + B *= 1f; + G = 0.4f; } else if (this.type == 207) { - r *= 0.4f; - b *= 0.4f; + R *= 0.4f; + B *= 0.4f; } else if (this.type == 253) { - r = 0.0f; - g *= 0.4f; + R = 0.0f; + G *= 0.4f; } else if (this.type == 211) { - r *= 0.5f; - g *= 0.9f; - b *= 1f; + R *= 0.5f; + G *= 0.9f; + B *= 1f; this.light = (double) this.localAI[0] != 0.0 ? 1f : 1.5f; } else if (this.type == 209) { float num1 = (float) (((double) byte.MaxValue - (double) this.alpha) / (double) byte.MaxValue); - float num2 = r * 0.3f; - float num3 = g * 0.4f; - b = b * 1.75f * num1; - r = num2 * num1; - g = num3 * num1; + float num2 = R * 0.3f; + float num3 = G * 0.4f; + B = B * 1.75f * num1; + R = num2 * num1; + G = num3 * num1; } else if (this.type == 226 || this.type == 227 | this.type == 229) { - r *= 0.25f; - g *= 1f; - b *= 0.5f; + R *= 0.25f; + G *= 1f; + B *= 0.5f; } else if (this.type == 251) { @@ -11458,17 +9104,17 @@ namespace Terraria float num7 = (float) (((double) num4 + 1.0) / 2.0); float num8 = (float) (((double) num5 + 1.0) / 2.0); float num9 = (float) (((double) num6 + 1.0) / 2.0); - r = num7 * this.light; - g = num8 * this.light; - b = num9 * this.light; + R = num7 * this.light; + G = num8 * this.light; + B = num9 * this.light; } else if (this.type == 278 || this.type == 279) { - r *= 1f; - g *= 1f; - b *= 0.0f; + R *= 1f; + G *= 1f; + B *= 0.0f; } - Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), r, g, b); + Lighting.AddLight((int) (((double) this.position.X + (double) (this.width / 2)) / 16.0), (int) (((double) this.position.Y + (double) (this.height / 2)) / 16.0), R, G, B); } public Microsoft.Xna.Framework.Rectangle getRect() => new Microsoft.Xna.Framework.Rectangle((int) this.position.X, (int) this.position.Y, this.width, this.height); @@ -11477,13 +9123,6 @@ namespace Terraria { if (!this.active) return; - if (Main.netMode == 1 && (ProjectileID.Sets.IsAGolfBall[this.type] || this.type == 820)) - { - int index1 = (int) ((double) this.position.X + (double) (this.width / 2)) / 16; - int index2 = (int) ((double) this.position.Y + (double) (this.height / 2)) / 16; - if (Main.tile[index1, index2] == null) - return; - } this.numUpdates = this.extraUpdates; while (this.numUpdates >= 0) { @@ -11499,16 +9138,133 @@ namespace Terraria this.active = false; return; } - if (!this.noEnchantmentVisuals) - this.UpdateEnchantmentVisuals(); - if (this.numUpdates == -1 && (this.minion || this.sentry)) - this.damage = (int) ((double) this.originalDamage * (double) Main.player[this.owner].minionDamage); + if (this.type != 344 && !this.npcProj) + { + if (Main.player[this.owner].frostBurn && (this.melee || this.ranged) && this.friendly && !this.hostile && !this.noEnchantments && Main.rand.Next(2 * (1 + this.extraUpdates)) == 0) + { + int index = Dust.NewDust(this.position, this.width, this.height, 135, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 2f); + Main.dust[index].noGravity = true; + Main.dust[index].velocity *= 0.7f; + Main.dust[index].velocity.Y -= 0.5f; + } + if (this.melee && Main.player[this.owner].meleeEnchant > (byte) 0 && !this.noEnchantments) + { + if (Main.player[this.owner].meleeEnchant == (byte) 1 && Main.rand.Next(3) == 0) + { + int index = Dust.NewDust(this.position, this.width, this.height, 171, Alpha: 100); + Main.dust[index].noGravity = true; + Main.dust[index].fadeIn = 1.5f; + Main.dust[index].velocity *= 0.25f; + } + if (Main.player[this.owner].meleeEnchant == (byte) 1) + { + if (Main.rand.Next(3) == 0) + { + int index = Dust.NewDust(this.position, this.width, this.height, 171, Alpha: 100); + Main.dust[index].noGravity = true; + Main.dust[index].fadeIn = 1.5f; + Main.dust[index].velocity *= 0.25f; + } + } + else if (Main.player[this.owner].meleeEnchant == (byte) 2) + { + if (Main.rand.Next(2) == 0) + { + int index = Dust.NewDust(this.position, this.width, this.height, 75, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 2.5f); + Main.dust[index].noGravity = true; + Main.dust[index].velocity *= 0.7f; + Main.dust[index].velocity.Y -= 0.5f; + } + } + else if (Main.player[this.owner].meleeEnchant == (byte) 3) + { + if (Main.rand.Next(2) == 0) + { + int index = Dust.NewDust(this.position, this.width, this.height, 6, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 2.5f); + Main.dust[index].noGravity = true; + Main.dust[index].velocity *= 0.7f; + Main.dust[index].velocity.Y -= 0.5f; + } + } + else if (Main.player[this.owner].meleeEnchant == (byte) 4) + { + if (Main.rand.Next(2) == 0) + { + int index = Dust.NewDust(this.position, this.width, this.height, 57, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 1.1f); + Main.dust[index].noGravity = true; + Main.dust[index].velocity.X /= 2f; + Main.dust[index].velocity.Y /= 2f; + } + } + else if (Main.player[this.owner].meleeEnchant == (byte) 5) + { + if (Main.rand.Next(2) == 0) + { + int index = Dust.NewDust(this.position, this.width, this.height, 169, Alpha: 100); + Main.dust[index].velocity.X += (float) this.direction; + Main.dust[index].velocity.Y += 0.2f; + Main.dust[index].noGravity = true; + } + } + else if (Main.player[this.owner].meleeEnchant == (byte) 6) + { + if (Main.rand.Next(2) == 0) + { + int index = Dust.NewDust(this.position, this.width, this.height, 135, Alpha: 100); + Main.dust[index].velocity.X += (float) this.direction; + Main.dust[index].velocity.Y += 0.2f; + Main.dust[index].noGravity = true; + } + } + else if (Main.player[this.owner].meleeEnchant == (byte) 7) + { + Vector2 velocity = this.velocity; + if ((double) velocity.Length() > 4.0) + velocity *= 4f / velocity.Length(); + if (Main.rand.Next(20) == 0) + { + int index = Dust.NewDust(this.position, this.width, this.height, Main.rand.Next(139, 143), velocity.X, velocity.Y, Scale: 1.2f); + Main.dust[index].velocity.X *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); + Main.dust[index].velocity.Y *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); + Main.dust[index].velocity.X += (float) Main.rand.Next(-50, 51) * 0.05f; + Main.dust[index].velocity.Y += (float) Main.rand.Next(-50, 51) * 0.05f; + Main.dust[index].scale *= (float) (1.0 + (double) Main.rand.Next(-30, 31) * 0.00999999977648258); + } + if (Main.rand.Next(40) == 0) + { + int Type = Main.rand.Next(276, 283); + int index = Gore.NewGore(this.position, velocity, Type); + Main.gore[index].velocity.X *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); + Main.gore[index].velocity.Y *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); + Main.gore[index].scale *= (float) (1.0 + (double) Main.rand.Next(-20, 21) * 0.00999999977648258); + Main.gore[index].velocity.X += (float) Main.rand.Next(-50, 51) * 0.05f; + Main.gore[index].velocity.Y += (float) Main.rand.Next(-50, 51) * 0.05f; + } + } + else if (Main.player[this.owner].meleeEnchant == (byte) 8 && Main.rand.Next(4) == 0) + { + int index = Dust.NewDust(this.position, this.width, this.height, 46, Alpha: 100); + Main.dust[index].noGravity = true; + Main.dust[index].fadeIn = 1.5f; + Main.dust[index].velocity *= 0.25f; + } + } + if (this.melee && Main.player[this.owner].magmaStone && !this.noEnchantments && Main.rand.Next(3) != 0) + { + int index = Dust.NewDust(new Vector2(this.position.X - 4f, this.position.Y - 4f), this.width + 8, this.height + 8, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, Scale: 2f); + if (Main.rand.Next(2) == 0) + Main.dust[index].scale = 1.5f; + Main.dust[index].noGravity = true; + Main.dust[index].velocity.X *= 2f; + Main.dust[index].velocity.Y *= 2f; + } + } if (this.minion && this.numUpdates == -1 && this.type != 625 && this.type != 628) { this.minionPos = Main.player[this.owner].numMinions; if ((double) Main.player[this.owner].slotsMinions + (double) this.minionSlots > (double) Main.player[this.owner].maxMinions && this.owner == Main.myPlayer) { - if ((this.type == 627 || this.type == 626) && this.owner == Main.myPlayer) + if (this.type == 627 || this.type == 626) { int byUuid = Projectile.GetByUUID(this.owner, this.ai[0]); if (byUuid != -1) @@ -11547,7 +9303,7 @@ namespace Terraria this.gfxOffY = 16f; if ((double) this.gfxOffY < -16.0) this.gfxOffY = -16f; - Vector2 velocity = this.velocity; + Vector2 velocity1 = this.velocity; this.oldVelocity = this.velocity; this.whoAmI = i; if (this.soundDelay > 0) @@ -11567,11 +9323,6 @@ namespace Terraria } } this.AI(); - if (this.ShouldUseWindPhysics() && (double) this.Center.Y < Main.worldSurface * 16.0 && Main.tile[(int) this.Center.X / 16, (int) this.Center.Y / 16] != null && Main.tile[(int) this.Center.X / 16, (int) this.Center.Y / 16].wall == (ushort) 0 && ((double) this.velocity.X > 0.0 && (double) Main.windSpeedCurrent < 0.0 || (double) this.velocity.X < 0.0 && (double) Main.windSpeedCurrent > 0.0 || (double) Math.Abs(this.velocity.X) < (double) Math.Abs(Main.windSpeedCurrent * Main.windPhysicsStrength) * 180.0) && (double) Math.Abs(this.velocity.X) < 16.0) - { - this.velocity.X += Main.windSpeedCurrent * Main.windPhysicsStrength; - double num2 = (double) MathHelper.Clamp(this.velocity.X, -16f, 16f); - } if (this.owner < (int) byte.MaxValue && !Main.player[this.owner].active) this.Kill(); if (this.type == 242 || this.type == 302 || this.type == 638) @@ -11618,44 +9369,44 @@ namespace Terraria if (!flag1) { if (this.honeyWet) + { + for (int index1 = 0; index1 < 10; ++index1) + { + int index2 = Dust.NewDust(new Vector2(this.position.X - 6f, (float) ((double) this.position.Y + (double) (this.height / 2) - 8.0)), this.width + 12, 24, 152); + --Main.dust[index2].velocity.Y; + Main.dust[index2].velocity.X *= 2.5f; + Main.dust[index2].scale = 1.3f; + Main.dust[index2].alpha = 100; + Main.dust[index2].noGravity = true; + } + Main.PlaySound(19, (int) this.position.X, (int) this.position.Y); + } + else { for (int index3 = 0; index3 < 10; ++index3) { - int index4 = Dust.NewDust(new Vector2(this.position.X - 6f, (float) ((double) this.position.Y + (double) (this.height / 2) - 8.0)), this.width + 12, 24, 152); - --Main.dust[index4].velocity.Y; + int index4 = Dust.NewDust(new Vector2(this.position.X - 6f, (float) ((double) this.position.Y + (double) (this.height / 2) - 8.0)), this.width + 12, 24, Dust.dustWater()); + Main.dust[index4].velocity.Y -= 4f; Main.dust[index4].velocity.X *= 2.5f; Main.dust[index4].scale = 1.3f; Main.dust[index4].alpha = 100; Main.dust[index4].noGravity = true; } - SoundEngine.PlaySound(19, (int) this.position.X, (int) this.position.Y); - } - else - { - for (int index5 = 0; index5 < 10; ++index5) - { - int index6 = Dust.NewDust(new Vector2(this.position.X - 6f, (float) ((double) this.position.Y + (double) (this.height / 2) - 8.0)), this.width + 12, 24, Dust.dustWater()); - Main.dust[index6].velocity.Y -= 4f; - Main.dust[index6].velocity.X *= 2.5f; - Main.dust[index6].scale = 1.3f; - Main.dust[index6].alpha = 100; - Main.dust[index6].noGravity = true; - } - SoundEngine.PlaySound(19, (int) this.position.X, (int) this.position.Y); + Main.PlaySound(19, (int) this.position.X, (int) this.position.Y); } } else { - for (int index7 = 0; index7 < 10; ++index7) + for (int index5 = 0; index5 < 10; ++index5) { - int index8 = Dust.NewDust(new Vector2(this.position.X - 6f, (float) ((double) this.position.Y + (double) (this.height / 2) - 8.0)), this.width + 12, 24, 35); - Main.dust[index8].velocity.Y -= 1.5f; - Main.dust[index8].velocity.X *= 2.5f; - Main.dust[index8].scale = 1.3f; - Main.dust[index8].alpha = 100; - Main.dust[index8].noGravity = true; + int index6 = Dust.NewDust(new Vector2(this.position.X - 6f, (float) ((double) this.position.Y + (double) (this.height / 2) - 8.0)), this.width + 12, 24, 35); + Main.dust[index6].velocity.Y -= 1.5f; + Main.dust[index6].velocity.X *= 2.5f; + Main.dust[index6].scale = 1.3f; + Main.dust[index6].alpha = 100; + Main.dust[index6].noGravity = true; } - SoundEngine.PlaySound(19, (int) this.position.X, (int) this.position.Y); + Main.PlaySound(19, (int) this.position.X, (int) this.position.Y); } } this.wet = true; @@ -11671,44 +9422,44 @@ namespace Terraria if (!this.lavaWet) { if (this.honeyWet) + { + for (int index7 = 0; index7 < 10; ++index7) + { + int index8 = Dust.NewDust(new Vector2(this.position.X - 6f, (float) ((double) this.position.Y + (double) (this.height / 2) - 8.0)), this.width + 12, 24, 152); + --Main.dust[index8].velocity.Y; + Main.dust[index8].velocity.X *= 2.5f; + Main.dust[index8].scale = 1.3f; + Main.dust[index8].alpha = 100; + Main.dust[index8].noGravity = true; + } + Main.PlaySound(19, (int) this.position.X, (int) this.position.Y); + } + else { for (int index9 = 0; index9 < 10; ++index9) { - int index10 = Dust.NewDust(new Vector2(this.position.X - 6f, (float) ((double) this.position.Y + (double) (this.height / 2) - 8.0)), this.width + 12, 24, 152); - --Main.dust[index10].velocity.Y; + int index10 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float) (this.height / 2)), this.width + 12, 24, Dust.dustWater()); + Main.dust[index10].velocity.Y -= 4f; Main.dust[index10].velocity.X *= 2.5f; Main.dust[index10].scale = 1.3f; Main.dust[index10].alpha = 100; Main.dust[index10].noGravity = true; } - SoundEngine.PlaySound(19, (int) this.position.X, (int) this.position.Y); - } - else - { - for (int index11 = 0; index11 < 10; ++index11) - { - int index12 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y + (float) (this.height / 2)), this.width + 12, 24, Dust.dustWater()); - Main.dust[index12].velocity.Y -= 4f; - Main.dust[index12].velocity.X *= 2.5f; - Main.dust[index12].scale = 1.3f; - Main.dust[index12].alpha = 100; - Main.dust[index12].noGravity = true; - } - SoundEngine.PlaySound(19, (int) this.position.X, (int) this.position.Y); + Main.PlaySound(19, (int) this.position.X, (int) this.position.Y); } } else { - for (int index13 = 0; index13 < 10; ++index13) + for (int index11 = 0; index11 < 10; ++index11) { - int index14 = Dust.NewDust(new Vector2(this.position.X - 6f, (float) ((double) this.position.Y + (double) (this.height / 2) - 8.0)), this.width + 12, 24, 35); - Main.dust[index14].velocity.Y -= 1.5f; - Main.dust[index14].velocity.X *= 2.5f; - Main.dust[index14].scale = 1.3f; - Main.dust[index14].alpha = 100; - Main.dust[index14].noGravity = true; + int index12 = Dust.NewDust(new Vector2(this.position.X - 6f, (float) ((double) this.position.Y + (double) (this.height / 2) - 8.0)), this.width + 12, 24, 35); + Main.dust[index12].velocity.Y -= 1.5f; + Main.dust[index12].velocity.X *= 2.5f; + Main.dust[index12].scale = 1.3f; + Main.dust[index12].alpha = 100; + Main.dust[index12].noGravity = true; } - SoundEngine.PlaySound(19, (int) this.position.X, (int) this.position.Y); + Main.PlaySound(19, (int) this.position.X, (int) this.position.Y); } } } @@ -11722,8 +9473,8 @@ namespace Terraria } this.oldPosition = this.position; this.oldDirection = this.direction; - this.HandleMovement(velocity, out int _, out int _); - if (this.AutomaticallyChangesDirection()) + this.HandleMovement(velocity1, out int _, out int _); + if ((this.aiStyle != 3 || (double) this.ai[0] != 1.0) && (this.aiStyle != 7 || (double) this.ai[0] != 1.0) && (this.aiStyle != 13 || (double) this.ai[0] != 1.0) && this.aiStyle != 65 && this.aiStyle != 69 && this.aiStyle != 114 && this.aiStyle != 123 && this.aiStyle != 112 && !this.manualDirectionChange && this.aiStyle != 67 && this.aiStyle != 26 && this.aiStyle != 15) { if ((double) this.velocity.X < 0.0) this.direction = -1; @@ -11788,7 +9539,7 @@ namespace Terraria this.localAI[1] = 0.9999f; this.netUpdate = true; } - if (Main.netMode != 1 && (this.type == 99 || this.type == 655 || this.type == 727)) + if (Main.netMode != 1 && (this.type == 99 || this.type == 444)) Collision.SwitchTiles(this.position, this.width, this.height, this.oldPosition, 3); if (ProjectileID.Sets.TrailingMode[this.type] == 0) { @@ -11805,18 +9556,18 @@ namespace Terraria this.oldPos[0] = this.position; if (this.velocity == Vector2.Zero && this.type == 466) { - float num3 = (float) ((double) this.rotation + 1.57079637050629 + (Main.rand.Next(2) == 1 ? -1.0 : 1.0) * 1.57079637050629); - float num4 = (float) (Main.rand.NextDouble() * 2.0 + 2.0); - Vector2 vector2 = new Vector2((float) Math.Cos((double) num3) * num4, (float) Math.Sin((double) num3) * num4); + float num2 = (float) ((double) this.rotation + 1.57079637050629 + (Main.rand.Next(2) == 1 ? -1.0 : 1.0) * 1.57079637050629); + float num3 = (float) (Main.rand.NextDouble() * 2.0 + 2.0); + Vector2 vector2 = new Vector2((float) Math.Cos((double) num2) * num3, (float) Math.Sin((double) num2) * num3); int index = Dust.NewDust(this.oldPos[this.oldPos.Length - 1], 0, 0, 229, vector2.X, vector2.Y); Main.dust[index].noGravity = true; Main.dust[index].scale = 1.7f; } if (this.velocity == Vector2.Zero && this.type == 580) { - float num5 = (float) ((double) this.rotation + 1.57079637050629 + (Main.rand.Next(2) == 1 ? -1.0 : 1.0) * 1.57079637050629); - float num6 = (float) (Main.rand.NextDouble() * 2.0 + 2.0); - Vector2 vector2 = new Vector2((float) Math.Cos((double) num5) * num6, (float) Math.Sin((double) num5) * num6); + float num4 = (float) ((double) this.rotation + 1.57079637050629 + (Main.rand.Next(2) == 1 ? -1.0 : 1.0) * 1.57079637050629); + float num5 = (float) (Main.rand.NextDouble() * 2.0 + 2.0); + Vector2 vector2 = new Vector2((float) Math.Cos((double) num4) * num5, (float) Math.Sin((double) num4) * num5); int index = Dust.NewDust(this.oldPos[this.oldPos.Length - 1], 0, 0, 229, vector2.X, vector2.Y); Main.dust[index].noGravity = true; Main.dust[index].scale = 1.7f; @@ -11835,47 +9586,6 @@ namespace Terraria this.oldRot[0] = this.rotation; this.oldSpriteDirection[0] = this.spriteDirection; } - else if (ProjectileID.Sets.TrailingMode[this.type] == 3) - { - for (int index = this.oldPos.Length - 1; index > 0; --index) - { - this.oldPos[index] = this.oldPos[index - 1]; - this.oldRot[index] = this.oldRot[index - 1]; - this.oldSpriteDirection[index] = this.oldSpriteDirection[index - 1]; - } - this.oldPos[0] = this.position; - this.oldRot[0] = this.rotation; - this.oldSpriteDirection[0] = this.spriteDirection; - float amount = 0.65f; - int num7 = 1; - for (int index15 = 0; index15 < num7; ++index15) - { - for (int index16 = this.oldPos.Length - 1; index16 > 0; --index16) - { - if (!(this.oldPos[index16] == Vector2.Zero)) - { - if ((double) this.oldPos[index16].Distance(this.oldPos[index16 - 1]) > 2.0) - this.oldPos[index16] = Vector2.Lerp(this.oldPos[index16], this.oldPos[index16 - 1], amount); - this.oldRot[index16] = (this.oldPos[index16 - 1] - this.oldPos[index16]).SafeNormalize(Vector2.Zero).ToRotation(); - } - } - } - } - else if (ProjectileID.Sets.TrailingMode[this.type] == 4) - { - Vector2 vector2 = Main.player[this.owner].position - Main.player[this.owner].oldPosition; - for (int index = this.oldPos.Length - 1; index > 0; --index) - { - this.oldPos[index] = this.oldPos[index - 1]; - this.oldRot[index] = this.oldRot[index - 1]; - this.oldSpriteDirection[index] = this.oldSpriteDirection[index - 1]; - if (this.numUpdates == 0 && this.oldPos[index] != Vector2.Zero) - this.oldPos[index] += vector2; - } - this.oldPos[0] = this.position; - this.oldRot[0] = this.rotation; - this.oldSpriteDirection[0] = this.spriteDirection; - } if (ProjectileID.Sets.IsADD2Turret[this.type] && DD2Event.Ongoing) ++this.timeLeft; --this.timeLeft; @@ -11908,126 +9618,6 @@ namespace Terraria this.netUpdate = false; } - private bool AutomaticallyChangesDirection() => (this.aiStyle != 3 || (double) this.ai[0] != 1.0) && (this.aiStyle != 7 || (double) this.ai[0] != 1.0) && (this.aiStyle != 13 || (double) this.ai[0] != 1.0) && this.aiStyle != 65 && this.aiStyle != 69 && this.aiStyle != 114 && this.aiStyle != 123 && this.aiStyle != 112 && !this.manualDirectionChange && this.aiStyle != 67 && this.aiStyle != 26 && this.aiStyle != 15 && this.aiStyle != 150; - - private void UpdateEnchantmentVisuals() - { - if (this.npcProj) - return; - if (Main.player[this.owner].frostBurn && (this.melee || this.ranged) && this.friendly && !this.hostile && !this.noEnchantments && Main.rand.Next(2 * (1 + this.extraUpdates)) == 0) - { - int index = Dust.NewDust(this.position, this.width, this.height, 135, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 2f); - Main.dust[index].noGravity = true; - Main.dust[index].velocity *= 0.7f; - Main.dust[index].velocity.Y -= 0.5f; - } - if (this.melee && Main.player[this.owner].magmaStone && !this.noEnchantments && Main.rand.Next(3) != 0) - { - int index = Dust.NewDust(new Vector2(this.position.X - 4f, this.position.Y - 4f), this.width + 8, this.height + 8, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, Scale: 2f); - if (Main.rand.Next(2) == 0) - Main.dust[index].scale = 1.5f; - Main.dust[index].noGravity = true; - Main.dust[index].velocity.X *= 2f; - Main.dust[index].velocity.Y *= 2f; - } - if (!this.melee || Main.player[this.owner].meleeEnchant <= (byte) 0 || this.noEnchantments) - return; - if (Main.player[this.owner].meleeEnchant == (byte) 1 && Main.rand.Next(3) == 0) - { - int index = Dust.NewDust(this.position, this.width, this.height, 171, Alpha: 100); - Main.dust[index].noGravity = true; - Main.dust[index].fadeIn = 1.5f; - Main.dust[index].velocity *= 0.25f; - } - if (Main.player[this.owner].meleeEnchant == (byte) 1) - { - if (Main.rand.Next(3) != 0) - return; - int index = Dust.NewDust(this.position, this.width, this.height, 171, Alpha: 100); - Main.dust[index].noGravity = true; - Main.dust[index].fadeIn = 1.5f; - Main.dust[index].velocity *= 0.25f; - } - else if (Main.player[this.owner].meleeEnchant == (byte) 2) - { - if (Main.rand.Next(2) != 0) - return; - int index = Dust.NewDust(this.position, this.width, this.height, 75, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 2.5f); - Main.dust[index].noGravity = true; - Main.dust[index].velocity *= 0.7f; - Main.dust[index].velocity.Y -= 0.5f; - } - else if (Main.player[this.owner].meleeEnchant == (byte) 3) - { - if (Main.rand.Next(2) != 0) - return; - int index = Dust.NewDust(this.position, this.width, this.height, 6, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 2.5f); - Main.dust[index].noGravity = true; - Main.dust[index].velocity *= 0.7f; - Main.dust[index].velocity.Y -= 0.5f; - } - else if (Main.player[this.owner].meleeEnchant == (byte) 4) - { - if (Main.rand.Next(2) != 0) - return; - int index = Dust.NewDust(this.position, this.width, this.height, 57, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 1.1f); - Main.dust[index].noGravity = true; - Main.dust[index].velocity.X /= 2f; - Main.dust[index].velocity.Y /= 2f; - } - else if (Main.player[this.owner].meleeEnchant == (byte) 5) - { - if (Main.rand.Next(2) != 0) - return; - int index = Dust.NewDust(this.position, this.width, this.height, 169, Alpha: 100); - Main.dust[index].velocity.X += (float) this.direction; - Main.dust[index].velocity.Y += 0.2f; - Main.dust[index].noGravity = true; - } - else if (Main.player[this.owner].meleeEnchant == (byte) 6) - { - if (Main.rand.Next(2) != 0) - return; - int index = Dust.NewDust(this.position, this.width, this.height, 135, Alpha: 100); - Main.dust[index].velocity.X += (float) this.direction; - Main.dust[index].velocity.Y += 0.2f; - Main.dust[index].noGravity = true; - } - else if (Main.player[this.owner].meleeEnchant == (byte) 7) - { - Vector2 velocity = this.velocity; - if ((double) velocity.Length() > 4.0) - velocity *= 4f / velocity.Length(); - if (Main.rand.Next(20) == 0) - { - int index = Dust.NewDust(this.position, this.width, this.height, Main.rand.Next(139, 143), velocity.X, velocity.Y, Scale: 1.2f); - Main.dust[index].velocity.X *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); - Main.dust[index].velocity.Y *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); - Main.dust[index].velocity.X += (float) Main.rand.Next(-50, 51) * 0.05f; - Main.dust[index].velocity.Y += (float) Main.rand.Next(-50, 51) * 0.05f; - Main.dust[index].scale *= (float) (1.0 + (double) Main.rand.Next(-30, 31) * 0.00999999977648258); - } - if (Main.rand.Next(40) != 0) - return; - int Type = Main.rand.Next(276, 283); - int index1 = Gore.NewGore(this.position, velocity, Type); - Main.gore[index1].velocity.X *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); - Main.gore[index1].velocity.Y *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); - Main.gore[index1].scale *= (float) (1.0 + (double) Main.rand.Next(-20, 21) * 0.00999999977648258); - Main.gore[index1].velocity.X += (float) Main.rand.Next(-50, 51) * 0.05f; - Main.gore[index1].velocity.Y += (float) Main.rand.Next(-50, 51) * 0.05f; - } - else - { - if (Main.player[this.owner].meleeEnchant != (byte) 8 || Main.rand.Next(4) != 0) - return; - int index = Dust.NewDust(this.position, this.width, this.height, 46, Alpha: 100); - Main.dust[index].noGravity = true; - Main.dust[index].fadeIn = 1.5f; - Main.dust[index].velocity *= 0.25f; - } - } - private void HandleMovement(Vector2 wetVelocity, out int overrideWidth, out int overrideHeight) { bool flag1 = false; @@ -12090,37 +9680,8 @@ namespace Terraria case 693: flag5 = false; break; - case 759: - flag5 = true; - break; } - if (this.decidesManualFallThrough) - flag5 = this.shouldFallThrough; - if (this.type == 771 || this.type == 822 || this.type == 823 || this.type == 843 || this.type == 846 || this.type == 845 || this.type == 852) - { - overrideWidth = this.width; - overrideHeight = 34; - nullable2 = new Vector2?(new Vector2(0.75f, 0.75f)); - } - if (this.type == 824 || this.type == 839 || this.type == 840 || this.type == 850 || this.type == 853) - { - overrideWidth = this.width; - overrideHeight = 58; - nullable2 = new Vector2?(new Vector2(0.75f, 0.75f)); - } - if (this.type == 826 || this.type == 830 || this.type == 838) - { - overrideWidth = this.width; - overrideHeight = 38; - nullable2 = new Vector2?(new Vector2(0.75f, 0.75f)); - } - if (this.type == 828 || this.type == 829 || this.type == 827 || this.type == 844) - { - overrideWidth = this.width; - overrideHeight = 22; - nullable2 = new Vector2?(new Vector2(0.75f, 0.75f)); - } - if (this.aiStyle == 29 || this.type == 28 || this.aiStyle == 49 || this.type == 906 || this.type == 903 || this.type == 904 || this.type == 910) + if (this.aiStyle == 29 || this.type == 28 || this.aiStyle == 49) { overrideWidth = this.width - 8; overrideHeight = this.height - 8; @@ -12156,7 +9717,7 @@ namespace Terraria overrideWidth = 26; overrideHeight = 26; } - else if (this.type == 481 || this.type == 491 || this.type == 106 || this.type == 262 || this.type == 271 || this.type == 270 || this.type == 272 || this.type == 273 || this.type == 274 || this.type == 280 || this.type == 288 || this.type == 301 || this.type == 320 || this.type == 333 || this.type == 335 || this.type == 343 || this.type == 344 || this.type == 497 || this.type == 496 || this.type == 6 || this.type == 19 || this.type == 113 || this.type == 52 || this.type == 520 || this.type == 523 || this.type == 585 || this.type == 598 || this.type == 599 || this.type == 636 || this.type == 837 || this.type == 861 || this.type == 867) + else if (this.type == 481 || this.type == 491 || this.type == 106 || this.type == 262 || this.type == 271 || this.type == 270 || this.type == 272 || this.type == 273 || this.type == 274 || this.type == 280 || this.type == 288 || this.type == 301 || this.type == 320 || this.type == 333 || this.type == 335 || this.type == 343 || this.type == 344 || this.type == 497 || this.type == 496 || this.type == 6 || this.type == 19 || this.type == 113 || this.type == 52 || this.type == 520 || this.type == 523 || this.type == 585 || this.type == 598 || this.type == 599 || this.type == 636) { overrideWidth = 10; overrideHeight = 10; @@ -12166,7 +9727,7 @@ namespace Terraria overrideWidth = 4; overrideHeight = 4; } - else if (this.type == 248 || this.type == 247 || this.type == 507 || this.type == 508 || this.type == 662 || this.type == 680 || this.type == 685 || this.type == 757 || this.type == 928) + else if (this.type == 248 || this.type == 247 || this.type == 507 || this.type == 508 || this.type == 662 || this.type == 680 || this.type == 685) { overrideWidth = this.width - 12; overrideHeight = this.height - 12; @@ -12176,7 +9737,7 @@ namespace Terraria overrideWidth = this.width - 36; overrideHeight = this.height - 36; } - else if (this.type == 182 || this.type == 190 || this.type == 33 || this.type == 229 || this.type == 237 || this.type == 243 || this.type == 866) + else if (this.type == 182 || this.type == 190 || this.type == 33 || this.type == 229 || this.type == 237 || this.type == 243) { overrideWidth = this.width - 20; overrideHeight = this.height - 20; @@ -12191,19 +9752,7 @@ namespace Terraria overrideWidth = this.width + 6; overrideHeight = this.height + 6; } - else if (this.type == 755 && (double) this.ai[0] >= 0.0) - { - overrideWidth = this.width + 6; - overrideHeight = this.height + 6; - } - else if (this.type == 759) - { - if ((double) this.velocity.X != (double) velocity1.X) - this.velocity.X = -velocity1.X; - if ((double) this.velocity.Y != (double) velocity1.Y) - this.velocity.Y = -velocity1.Y; - } - else if (this.type == 582 || this.type == 634 || this.type == 635 || this.type == 902) + else if (this.type == 582 || this.type == 634 || this.type == 635) { overrideWidth = 8; overrideHeight = 8; @@ -12213,31 +9762,14 @@ namespace Terraria overrideWidth = (int) (20.0 * (double) this.scale); overrideHeight = (int) (20.0 * (double) this.scale); } - else if (this.type == 304) - { - overrideWidth = 4; - overrideHeight = 4; - } - else if (this.aiStyle == 9) - { - overrideWidth = 4; - overrideHeight = 4; - } - else if (this.type == 931) - { - overrideWidth = 4; - overrideHeight = 4; - } if ((this.type != 440 && this.type != 449 && this.type != 606 || (double) this.ai[1] != 1.0) && (this.type != 466 || (double) this.localAI[1] != 1.0) && (this.type != 580 || (double) this.localAI[1] <= 0.0) && (this.type != 640 || (double) this.localAI[1] <= 0.0)) { if (this.aiStyle == 10) { - if (this.type >= 736 && this.type <= 738) - this.velocity = Collision.TileCollision(this.position, this.velocity, this.width, this.height, flag5, flag5); - else if (this.type == 42 || this.type == 65 || this.type == 68 || this.type == 354 || this.type == 31 && (double) this.ai[0] == 2.0) + if (this.type == 42 || this.type == 65 || this.type == 68 || this.type == 354 || this.type == 31 && (double) this.ai[0] == 2.0) this.velocity = Collision.TileCollision(this.position, this.velocity, this.width, this.height, flag5, flag5); else - this.velocity = Collision.TileCollision(this.position, this.velocity, this.width, this.height, flag5, flag5); + this.velocity = Collision.AnyCollision(this.position, this.velocity, this.width, this.height, true); } else { @@ -12268,37 +9800,6 @@ namespace Terraria if ((double) this.velocity.Y != (double) velocity3.Y) wetVelocity.Y = this.velocity.Y; } - if (!Main.projPet[this.type]) - { - Vector4 vector4 = Collision.SlopeCollision(Position, this.velocity, num1, num2, fall: true); - Vector2 vector2 = this.position - Position; - if (this.aiStyle == 137) - { - if ((double) Position.Y != (double) vector4.Y) - flag1 = true; - if ((double) this.velocity.Y != (double) vector4.W) - flag1 = true; - Position.Y = vector4.Y; - this.position.Y = Position.Y + vector2.Y; - this.velocity.Y = vector4.W; - } - else - { - if ((double) Position.X != (double) vector4.X) - flag1 = true; - if ((double) Position.Y != (double) vector4.Y) - flag1 = true; - if ((double) this.velocity.X != (double) vector4.Z) - flag1 = true; - if ((double) this.velocity.Y != (double) vector4.W) - flag1 = true; - Position.X = vector4.X; - Position.Y = vector4.Y; - this.position = Position + vector2; - this.velocity.X = vector4.Z; - this.velocity.Y = vector4.W; - } - } } else { @@ -12337,32 +9838,19 @@ namespace Terraria { Vector4 vector4 = Collision.SlopeCollision(Position, this.velocity, num1, num2, fall: true); Vector2 vector2_4 = this.position - Position; - if (this.aiStyle == 137) - { - if ((double) Position.Y != (double) vector4.Y) - flag1 = true; - if ((double) this.velocity.Y != (double) vector4.W) - flag1 = true; - Position.Y = vector4.Y; - this.position.Y = Position.Y + vector2_4.Y; - this.velocity.Y = vector4.W; - } - else - { - if ((double) Position.X != (double) vector4.X) - flag1 = true; - if ((double) Position.Y != (double) vector4.Y) - flag1 = true; - if ((double) this.velocity.X != (double) vector4.Z) - flag1 = true; - if ((double) this.velocity.Y != (double) vector4.W) - flag1 = true; - Position.X = vector4.X; - Position.Y = vector4.Y; - this.position = Position + vector2_4; - this.velocity.X = vector4.Z; - this.velocity.Y = vector4.W; - } + if ((double) Position.X != (double) vector4.X) + flag1 = true; + if ((double) Position.Y != (double) vector4.Y) + flag1 = true; + if ((double) this.velocity.X != (double) vector4.Z) + flag1 = true; + if ((double) this.velocity.Y != (double) vector4.W) + flag1 = true; + Position.X = vector4.X; + Position.Y = vector4.Y; + zero3 += Position + vector2_4 - this.position; + this.velocity.X = vector4.Z; + this.velocity.Y = vector4.W; } flag2 = true; if (this.owner == Main.myPlayer && Position != oldPosition && !flag3) @@ -12382,32 +9870,19 @@ namespace Terraria { Vector4 vector4 = Collision.SlopeCollision(Position, this.velocity, num1, num2, fall: true); Vector2 vector2_5 = this.position - Position; - if (this.aiStyle == 137) - { - if ((double) Position.Y != (double) vector4.Y) - flag1 = true; - if ((double) this.velocity.Y != (double) vector4.W) - flag1 = true; - Position.Y = vector4.Y; - this.position.Y = Position.Y + vector2_5.Y; - this.velocity.Y = vector4.W; - } - else - { - if ((double) Position.X != (double) vector4.X) - flag1 = true; - if ((double) Position.Y != (double) vector4.Y) - flag1 = true; - if ((double) this.velocity.X != (double) vector4.Z) - flag1 = true; - if ((double) this.velocity.Y != (double) vector4.W) - flag1 = true; - Position.X = vector4.X; - Position.Y = vector4.Y; - this.position = Position + vector2_5; - this.velocity.X = vector4.Z; - this.velocity.Y = vector4.W; - } + if ((double) Position.X != (double) vector4.X) + flag1 = true; + if ((double) Position.Y != (double) vector4.Y) + flag1 = true; + if ((double) this.velocity.X != (double) vector4.Z) + flag1 = true; + if ((double) this.velocity.Y != (double) vector4.W) + flag1 = true; + Position.X = vector4.X; + Position.Y = vector4.Y; + this.position = Position + vector2_5; + this.velocity.X = vector4.Z; + this.velocity.Y = vector4.W; } } else @@ -12417,32 +9892,19 @@ namespace Terraria { Vector4 vector4 = Collision.SlopeCollision(Position, this.velocity, num1, num2, fall: true); Vector2 vector2 = this.position - Position; - if (this.aiStyle == 137) - { - if ((double) Position.Y != (double) vector4.Y) - flag1 = true; - if ((double) this.velocity.Y != (double) vector4.W) - flag1 = true; - Position.Y = vector4.Y; - this.position.Y = Position.Y + vector2.Y; - this.velocity.Y = vector4.W; - } - else - { - if ((double) Position.X != (double) vector4.X) - flag1 = true; - if ((double) Position.Y != (double) vector4.Y) - flag1 = true; - if ((double) this.velocity.X != (double) vector4.Z) - flag1 = true; - if ((double) this.velocity.Y != (double) vector4.W) - flag1 = true; - Position.X = vector4.X; - Position.Y = vector4.Y; - this.position = Position + vector2; - this.velocity.X = vector4.Z; - this.velocity.Y = vector4.W; - } + if ((double) Position.X != (double) vector4.X) + flag1 = true; + if ((double) Position.Y != (double) vector4.Y) + flag1 = true; + if ((double) this.velocity.X != (double) vector4.Z) + flag1 = true; + if ((double) this.velocity.Y != (double) vector4.W) + flag1 = true; + Position.X = vector4.X; + Position.Y = vector4.Y; + this.position = Position + vector2; + this.velocity.X = vector4.Z; + this.velocity.Y = vector4.W; } } } @@ -12452,33 +9914,6 @@ namespace Terraria flag1 = true; if (flag1) { - if (this.owner == Main.myPlayer && this.CanCutTiles() && (this.friendly || this.hostile) && this.damage > 0) - { - int num8 = (int) ((double) this.position.X + (double) this.velocity.X - 1.0) / 16; - int num9 = (int) (((double) this.position.X + (double) this.width + (double) this.velocity.X + 1.0) / 16.0) + 1; - int num10 = (int) ((double) this.position.Y + (double) this.velocity.Y - 1.0) / 16; - int num11 = (int) (((double) this.position.Y + (double) this.height + (double) this.velocity.Y + 1.0) / 16.0) + 1; - if (num8 < 0) - num8 = 0; - if (num9 > Main.maxTilesX) - num9 = Main.maxTilesX; - if (num10 < 0) - num10 = 0; - if (num11 > Main.maxTilesY) - num11 = Main.maxTilesY; - for (int index1 = num8; index1 < num9; ++index1) - { - for (int index2 = num10; index2 < num11; ++index2) - { - if (Main.tile[index1, index2] != null && Main.tile[index1, index2].type == (ushort) 484 && WorldGen.CanCutTile(index1, index2, TileCuttingContext.AttackProjectile)) - { - WorldGen.KillTile(index1, index2); - if (Main.netMode != 0) - NetMessage.SendData(17, number2: ((float) index1), number3: ((float) index2)); - } - } - } - } if (this.type == 663 || this.type == 665 || this.type == 667 || this.type == 677 || this.type == 678 || this.type == 679 || this.type == 691 || this.type == 692 || this.type == 693 || this.type == 688 || this.type == 689 || this.type == 690) { this.position = this.position + this.velocity; @@ -12491,13 +9926,6 @@ namespace Terraria } else if (this.type == 601) { - if (Main.netMode != 2 && this.alpha > 0) - { - if ((double) this.ai[1] != 0.0) - SoundEngine.PlaySound(SoundID.Item114, this.position); - else - SoundEngine.PlaySound(SoundID.Item115, this.position); - } if (this.owner == Main.myPlayer) PortalHelper.TryPlacingPortal(this, velocity1, this.velocity); this.position = this.position + this.velocity; @@ -12563,24 +9991,24 @@ namespace Terraria } else if (this.type == 533) { - float num12 = 1f; + float num8 = 1f; bool flag8 = false; if ((double) this.velocity.X != (double) velocity1.X) { - this.velocity.X = velocity1.X * -num12; + this.velocity.X = velocity1.X * -num8; flag8 = true; } if ((double) this.velocity.Y != (double) velocity1.Y || (double) this.velocity.Y == 0.0) { - this.velocity.Y = (float) ((double) velocity1.Y * -(double) num12 * 0.5); + this.velocity.Y = (float) ((double) velocity1.Y * -(double) num8 * 0.5); flag8 = true; } if (flag8) { - float num13 = velocity1.Length() / this.velocity.Length(); - if ((double) num13 == 0.0) - num13 = 1f; - this.velocity = this.velocity / num13; + float num9 = velocity1.Length() / this.velocity.Length(); + if ((double) num9 == 0.0) + num9 = 1f; + this.velocity = this.velocity / num9; if ((double) this.ai[0] == 7.0 && (double) this.velocity.Y < -0.1) this.velocity.Y += 0.1f; if ((double) this.ai[0] >= 6.0 && (double) this.ai[0] < 9.0) @@ -12590,7 +10018,7 @@ namespace Terraria else if (this.type == 502) { ++this.ai[0]; - SoundEngine.PlaySound(37, (int) this.position.X, (int) this.position.Y, 5 + (int) this.ai[0]); + Main.PlaySound(37, (int) this.position.X, (int) this.position.Y, 5 + (int) this.ai[0]); if ((double) this.ai[0] >= 5.0) { this.position = this.position + this.velocity; @@ -12604,14 +10032,14 @@ namespace Terraria this.velocity.X = -velocity1.X; } Vector2 spinningpoint = new Vector2(0.0f, -3f - this.ai[0]).RotatedByRandom(3.14159274101257); - float num14 = (float) (10.0 + (double) this.ai[0] * 4.0); + float num10 = (float) (10.0 + (double) this.ai[0] * 4.0); Vector2 vector2 = new Vector2(1.05f, 1f); - for (float num15 = 0.0f; (double) num15 < (double) num14; ++num15) + for (float num11 = 0.0f; (double) num11 < (double) num10; ++num11) { int index = Dust.NewDust(this.Center, 0, 0, 66, newColor: Color.Transparent); Main.dust[index].position = this.Center; - Main.dust[index].velocity = spinningpoint.RotatedBy(6.28318548202515 * (double) num15 / (double) num14) * vector2 * (float) (0.800000011920929 + (double) Main.rand.NextFloat() * 0.400000005960464); - Main.dust[index].color = Main.hslToRgb(num15 / num14, 1f, 0.5f); + Main.dust[index].velocity = spinningpoint.RotatedBy(6.28318548202515 * (double) num11 / (double) num10) * vector2 * (float) (0.800000011920929 + (double) Main.rand.NextFloat() * 0.400000005960464); + Main.dust[index].color = Main.hslToRgb(num11 / num10, 1f, 0.5f); Main.dust[index].noGravity = true; Main.dust[index].scale = (float) (1.0 + (double) this.ai[0] / 3.0); } @@ -12632,6 +10060,11 @@ namespace Terraria this.Center = this.position; } } + else if (this.type == 653) + { + if ((double) this.velocity.Y != (double) velocity1.Y && (double) this.velocity.Y == 0.0 && (double) velocity1.Y > 1.0 && (double) velocity1.Y < 4.0) + this.velocity.Y = (float) (-(double) velocity1.Y * 2.0); + } else if (this.type == 444) { if ((double) this.velocity.X != (double) velocity1.X) @@ -12665,24 +10098,6 @@ namespace Terraria this.velocity = Vector2.Zero; } } - else if (this.type == 851) - { - if ((double) this.velocity.X != (double) velocity1.X) - this.velocity.X = (float) (-(double) velocity1.X * 0.800000011920929); - if ((double) this.velocity.Y != (double) velocity1.Y) - this.velocity.Y = (float) (-(double) velocity1.Y * 0.5); - } - else if (this.type == 855) - { - if ((double) this.velocity.X != (double) velocity1.X) - this.velocity.X = -velocity1.X; - if ((double) this.velocity.Y != (double) velocity1.Y) - { - this.velocity.Y = -velocity1.Y; - if ((double) velocity1.Y < 0.0) - this.velocity.Y *= 0.25f; - } - } else if (this.aiStyle == 54) { if ((double) this.velocity.X != (double) velocity1.X) @@ -12690,22 +10105,7 @@ namespace Terraria if ((double) this.velocity.Y != (double) velocity1.Y) this.velocity.Y = velocity1.Y * -0.6f; } - else if (this.type == 861) - { - float num = -1f; - if ((double) this.ai[1] == 1.0) - num = -0.6f; - if ((double) this.velocity.X != (double) velocity1.X) - this.velocity.X = velocity1.X * num; - if ((double) this.velocity.Y != (double) velocity1.Y && (double) velocity1.Y > 0.7) - this.velocity.Y = velocity1.Y * num; - if ((double) Math.Abs(this.velocity.Y) < 0.5) - this.velocity.Y = 0.0f; - if ((double) this.ai[1] != 1.0) - this.netUpdate = true; - this.ai[1] = 1f; - } - else if (!Main.projPet[this.type] && this.type != 500 && this.type != 820 && this.aiStyle != 160 && this.type != 650 && this.type != 882 && this.type != 888 && this.type != 894 && this.type != 895 && this.type != 898 && this.type != 901) + else if (!Main.projPet[this.type] && this.type != 500 && this.type != 650) { if (this.aiStyle == 99) { @@ -12765,14 +10165,6 @@ namespace Terraria if ((double) this.velocity.Y != (double) velocity1.Y && (double) Math.Abs(velocity1.Y) > 1.0) this.velocity.Y = velocity1.Y * -0.9f; } - else if (this.type == 921 || this.type == 926 || this.type == 937) - { - if ((double) this.velocity.X != (double) velocity1.X && (double) Math.Abs(velocity1.X) > 1.0) - this.velocity.X = velocity1.X * -0.95f; - if ((double) this.velocity.Y != (double) velocity1.Y && (double) Math.Abs(velocity1.Y) > 1.0) - this.velocity.Y = velocity1.Y * -0.95f; - --this.penetrate; - } else if (this.type == 681) this.timeLeft = 4; else if (this.type == 409) @@ -12789,27 +10181,11 @@ namespace Terraria if (this.timeLeft > 30) this.timeLeft = 30; } - else if (this.type == 225) + else if (this.type == 225 && this.penetrate > 0) { - ++this.ai[1]; - if ((double) this.ai[1] == 1.0) - this.damage = (int) ((double) this.damage * 0.660000026226044); - if ((double) this.ai[1] >= 4.0) - { - this.Kill(); - return; - } this.velocity.X = -velocity1.X; this.velocity.Y = -velocity1.Y; - int targetWithLineOfSight = this.FindTargetWithLineOfSight(); - if (targetWithLineOfSight != -1) - { - NPC npc = Main.npc[targetWithLineOfSight]; - float t = this.Distance(npc.Center); - Vector2 vector2 = -Vector2.UnitY * MathHelper.Lerp((float) npc.height * 0.1f, (float) npc.height * 0.5f, Utils.GetLerpValue(0.0f, 300f, t, false)); - this.velocity = this.DirectionTo(npc.Center + vector2).SafeNormalize(-Vector2.UnitY) * this.velocity.Length(); - this.netUpdate = true; - } + --this.penetrate; } else if (this.type == 155) { @@ -12822,7 +10198,7 @@ namespace Terraria Main.NewText(text.ToString(), G: (byte) 240, B: (byte) 20); break; case 2: - ChatHelper.BroadcastChatMessage(text, new Color((int) byte.MaxValue, 240, 20)); + NetMessage.BroadcastChatMessage(text, new Color((int) byte.MaxValue, 240, 20)); break; } } @@ -12862,14 +10238,14 @@ namespace Terraria { int[] numArray = new int[10]; int maxValue = 0; - int num16 = 700; - int num17 = 20; + int num12 = 700; + int num13 = 20; for (int index = 0; index < 200; ++index) { if (Main.npc[index].CanBeChasedBy((object) this)) { - float num18 = (this.Center - Main.npc[index].Center).Length(); - if ((double) num18 > (double) num17 && (double) num18 < (double) num16 && Collision.CanHitLine(this.Center, 1, 1, Main.npc[index].Center, 1, 1)) + float num14 = (this.Center - Main.npc[index].Center).Length(); + if ((double) num14 > (double) num13 && (double) num14 < (double) num12 && Collision.CanHitLine(this.Center, 1, 1, Main.npc[index].Center, 1, 1)) { numArray[maxValue] = index; ++maxValue; @@ -12882,9 +10258,9 @@ namespace Terraria { int index = Main.rand.Next(maxValue); Vector2 vector2 = Main.npc[numArray[index]].Center - this.Center; - float num19 = this.velocity.Length(); + float num15 = this.velocity.Length(); vector2.Normalize(); - this.velocity = vector2 * num19; + this.velocity = vector2 * num15; this.netUpdate = true; } } @@ -12972,20 +10348,9 @@ namespace Terraria } else if (this.type == 281) { - bool flag10 = (double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) < 2.0 || (double) this.ai[0] == -1.0; - if ((double) this.ai[0] == -2.0 || (double) this.ai[0] == -3.0) - flag10 = false; - if (flag10) + if ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) < 2.0 || (double) this.ai[1] == 2.0) { - if (Main.myPlayer == this.owner) - { - int Style = (double) this.velocity.X > 0.0 ? 1 : 2; - if (this.damage == 0) - Style += 2; - NPC.ReleaseNPC((int) this.Center.X, (int) this.Bottom.Y - 4, 614, Style, this.owner); - this.ai[0] = -3f; - this.netUpdate = true; - } + this.ai[1] = 2f; } else { @@ -13031,58 +10396,18 @@ namespace Terraria if ((double) this.velocity.Y != (double) velocity1.Y && (double) velocity1.Y > 5.0) { Collision.HitTiles(this.position, this.velocity, this.width, this.height); - SoundEngine.PlaySound(0, (int) this.position.X, (int) this.position.Y); + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); this.velocity.Y = (float) (-(double) velocity1.Y * 0.200000002980232); } if ((double) this.velocity.X != (double) velocity1.X) this.Kill(); } - else if (this.type == 727) - { - int Damage = 20; - float KnockBack = 2f; - float num20 = 2f; - if ((double) this.velocity.Y != (double) velocity1.Y && (double) velocity1.Y > 5.0) - { - Collision.HitTiles(this.position, this.velocity, this.width, this.height); - SoundEngine.PlaySound(0, (int) this.position.X, (int) this.position.Y); - this.velocity.Y = (float) (-(double) velocity1.Y * 0.649999976158142); - if (this.owner == Main.myPlayer) - { - int num21 = Main.rand.Next(3, 6); - float num22 = Main.rand.NextFloat(); - for (float num23 = 0.0f; (double) num23 < 1.0; num23 += 1f / (float) num21) - { - Vector2 velocity5 = ((float) (((double) num22 + (double) num23) * 6.28318548202515)).ToRotationVector2() * num20; - if ((double) velocity5.Y > 0.0) - velocity5 *= -0.7f; - Projectile.NewProjectile(this.Center, velocity5, 763, Damage, KnockBack, Main.myPlayer); - } - } - } - if ((double) this.velocity.X != (double) velocity1.X) - { - this.Kill(); - if (this.owner == Main.myPlayer) - { - int num24 = Main.rand.Next(3, 6); - float num25 = Main.rand.NextFloat(); - for (float num26 = 0.0f; (double) num26 < 1.0; num26 += 1f / (float) num24) - { - Vector2 velocity6 = ((float) (((double) num25 + (double) num26) * 6.28318548202515)).ToRotationVector2() * num20; - if ((double) velocity6.Y > 0.0) - velocity6 *= -0.7f; - Projectile.NewProjectile(this.Center, velocity6, 763, Damage, KnockBack, Main.myPlayer); - } - } - } - } - else if (this.type == 655) + else if (this.type == 444) { if ((double) this.velocity.Y != (double) velocity1.Y && (double) velocity1.Y > 5.0) { Collision.HitTiles(this.position, this.velocity, this.width, this.height); - SoundEngine.PlaySound(0, (int) this.position.X, (int) this.position.Y); + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); this.velocity.Y = (float) (-(double) velocity1.Y * 0.200000002980232); } if ((double) this.velocity.X != (double) velocity1.X) @@ -13093,7 +10418,7 @@ namespace Terraria if (this.penetrate > 1) { Collision.HitTiles(this.position, this.velocity, this.width, this.height); - SoundEngine.PlaySound(SoundID.Item10, this.position); + Main.PlaySound(SoundID.Item10, this.position); --this.penetrate; if ((double) this.velocity.X != (double) velocity1.X) this.velocity.X = -velocity1.X; @@ -13118,24 +10443,31 @@ namespace Terraria this.velocity.Y = velocity1.Y * -0.7f; } else if (this.aiStyle == 15) - this.AI_015_HandleMovementCollision(ref wetVelocity, ref velocity1); - else if (this.aiStyle == 9) { - bool flag11 = this.owner == Main.myPlayer; - if (this.type == 79) + bool flag10 = false; + if ((double) velocity1.X != (double) this.velocity.X) { - bool flag12 = (double) this.ai[0] >= 0.0; - flag11 &= !flag12; - if (flag12) - { - if ((double) this.velocity.X != (double) velocity1.X) - this.velocity.X *= 0.1f; - if ((double) this.velocity.Y != (double) velocity1.Y) - this.velocity.Y *= 0.1f; - } + if ((double) Math.Abs(velocity1.X) > 4.0) + flag10 = true; + this.position.X += this.velocity.X; + this.velocity.X = (float) (-(double) velocity1.X * 0.200000002980232); } - if (flag11) - this.Kill(); + if ((double) velocity1.Y != (double) this.velocity.Y) + { + if ((double) Math.Abs(velocity1.Y) > 4.0) + flag10 = true; + this.position.Y += this.velocity.Y; + this.velocity.Y = (float) (-(double) velocity1.Y * 0.200000002980232); + } + this.ai[0] = 1f; + if (flag10) + { + this.netUpdate = true; + Collision.HitTiles(this.position, this.velocity, this.width, this.height); + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + } + if (this.wet) + wetVelocity = this.velocity; } else if (this.aiStyle == 39) { @@ -13157,12 +10489,12 @@ namespace Terraria } } this.netUpdate = true; - SoundEngine.PlaySound(0, (int) this.position.X, (int) this.position.Y); + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); } else if (this.aiStyle == 3 || this.aiStyle == 13 || this.aiStyle == 69 || this.aiStyle == 109) { Collision.HitTiles(this.position, this.velocity, this.width, this.height); - if (this.type == 33 || this.type == 106 || this.type == 866) + if (this.type == 33 || this.type == 106) { if ((double) this.velocity.X != (double) velocity1.X) this.velocity.X = -velocity1.X; @@ -13179,11 +10511,11 @@ namespace Terraria } } this.netUpdate = true; - SoundEngine.PlaySound(0, (int) this.position.X, (int) this.position.Y); + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); } else if (this.aiStyle == 8 && this.type != 96) { - SoundEngine.PlaySound(SoundID.Item10, this.position); + Main.PlaySound(SoundID.Item10, this.position); ++this.ai[0]; if ((double) this.ai[0] >= 5.0 && this.type != 253 || this.type == 253 && (double) this.ai[0] >= 8.0) { @@ -13212,25 +10544,10 @@ namespace Terraria } else if (this.aiStyle == 14) { - if (this.type == 928) - { - int num = 0; - for (int index = 1000; index >= 0; --index) - { - if (index != this.whoAmI && Main.projectile[index].active && Main.projectile[index].owner == this.owner && Main.projectile[index].type == this.type) - { - ++num; - if (num >= 2 && this.timeLeft > Main.projectile[index].timeLeft && Main.projectile[index].timeLeft > 30) - Main.projectile[index].timeLeft = 2; - } - } - } if (this.type == 261 && ((double) this.velocity.X != (double) velocity1.X && ((double) velocity1.X < -3.0 || (double) velocity1.X > 3.0) || (double) this.velocity.Y != (double) velocity1.Y && ((double) velocity1.Y < -3.0 || (double) velocity1.Y > 3.0))) { - for (int index = 0; index < 10; ++index) - Collision.HitTiles(this.position, this.velocity, this.width, this.height); - SoundEngine.PlaySound(0, (int) this.Center.X, (int) this.Center.Y); - this.MakeBoulderOfEarthExplosion(); + Collision.HitTiles(this.position, this.velocity, this.width, this.height); + Main.PlaySound(0, (int) this.Center.X, (int) this.Center.Y); } if (this.type >= 326 && this.type <= 328 && (double) this.velocity.X != (double) velocity1.X) this.velocity.X = velocity1.X * -0.1f; @@ -13239,14 +10556,6 @@ namespace Terraria if ((double) this.velocity.X != (double) velocity1.X) this.velocity.X = velocity1.X * -0.1f; } - else if (this.type == 870 && (double) this.ai[1] == 0.0) - { - if ((double) this.velocity.X != (double) velocity1.X || (double) this.velocity.Y != (double) velocity1.Y) - { - this.velocity = -velocity1; - this.ai[1] = 1f; - } - } else if (this.type == 50) { if ((double) this.velocity.X != (double) velocity1.X) @@ -13298,7 +10607,7 @@ namespace Terraria if (this.type == 29) this.velocity.Y *= 0.8f; } - if (this.type == 134 || this.type == 137 || this.type == 140 || this.type == 143 || this.type == 303 || this.type >= 338 && this.type <= 341 || this.type == 776 || this.type == 780 || this.type == 793 || this.type == 796 || this.type == 799 || this.type == 784 || this.type == 787 || this.type == 790 || this.type == 803 || this.type == 804 || this.type == 808 || this.type == 809 || this.type == 810 || this.type == 805 || this.type == 806 || this.type == 807 || this.type == 930) + if (this.type == 134 || this.type == 137 || this.type == 140 || this.type == 143 || this.type == 303 || this.type >= 338 && this.type <= 341) { this.velocity = this.velocity * 0.0f; this.alpha = (int) byte.MaxValue; @@ -13310,16 +10619,8 @@ namespace Terraria this.velocity = this.velocity * 0.0f; this.alpha = (int) byte.MaxValue; this.timeLeft = 3; - this.netUpdate = true; } - else if (this.type == 870) - { - if ((double) this.velocity.X != (double) velocity1.X) - this.velocity.X = velocity1.X * -0.2f; - if ((double) this.velocity.Y != (double) velocity1.Y && (double) velocity1.Y > 0.0) - this.velocity.Y = velocity1.Y * -0.2f; - } - else + else if (this.aiStyle != 9 || this.owner == Main.myPlayer) { this.position = this.position + this.velocity; this.Kill(); @@ -13343,86 +10644,9 @@ namespace Terraria Collision.SwitchTiles(Position1, Width, Height, oldPosition1, 4); } - private void AI_149_GolfBall() - { - if (!this.npcProj && this.timeLeft < 10) - this.timeLeft = 10; - if ((double) this.ai[1] == -1.0) - { - Tile tileSafely = Framing.GetTileSafely(this.Bottom.ToTileCoordinates()); - if (tileSafely.active() && tileSafely.type == (ushort) 494) - return; - this.ai[1] = 0.0f; - this.netUpdate = true; - } - else - { - BallStepResult ballStepResult = GolfHelper.StepGolfBall((Entity) this, ref this.localAI[0]); - if (ballStepResult.State == BallState.Resting) - { - this.damage = 0; - if (Main.netMode == 1 && this.owner == Main.myPlayer && (double) this.localAI[1] != (double) ballStepResult.State) - this.netUpdate = true; - } - this.localAI[1] = (float) ballStepResult.State; - this.rotation += this.localAI[0]; - if ((double) this.velocity.Y != 0.0 && ballStepResult.State == BallState.Moving) - this.rotation += (float) ((double) this.velocity.X * 0.100000001490116 + (double) this.velocity.Y * 0.100000001490116); - if (ballStepResult.State == BallState.Moving && this.owner == Main.myPlayer) - { - bool? nullable = ProjectileID.Sets.ForcePlateDetection[135]; - if ((!nullable.HasValue ? 0 : (!nullable.Value ? 1 : 0)) == 0 && (double) this.localAI[1] != 0.0) - Collision.SwitchTiles(this.position, this.width, this.height, this.oldPosition, 4); - } - if (ballStepResult.State != BallState.Moving || Main.netMode != 2 || !Main.player.IndexInRange(this.owner) || !Main.player[this.owner].active) - return; - RemoteClient.CheckSection(this.owner, this.position); - } - } - - private void MakeBoulderOfEarthExplosion() - { - this.localAI[0] = 40f; - float MAX_SPREAD = 20f; - int fluff = 10; - int distFluff = 50; - int layerStart = 1; - int num = 6; - if ((double) this.velocity.Length() < 8.0 || (double) Math.Abs(this.velocity.Y) < 4.0) - { - MAX_SPREAD = 15f; - fluff = 7; - distFluff = 30; - num = 4; - } - if ((double) this.velocity.Length() < 4.0 || (double) Math.Abs(this.velocity.Y) < 2.0) - { - MAX_SPREAD = 15f; - fluff = 7; - distFluff = 30; - num = 2; - layerStart = 0; - } - int layerEnd = num; - int layerJump = num - 2; - if (layerJump < 1) - layerJump = 1; - this.CreateGroundExplosion(MAX_SPREAD, fluff, distFluff, layerStart, layerEnd, layerJump); - for (int index = 0; index < 10; ++index) - { - Dust dust = Dust.NewDustPerfect(this.Center + Main.rand.NextVector2Circular((float) (this.width / 2), (float) (this.height / 2)), 228, new Vector2?(Main.rand.NextVector2Circular(3f, 3f))); - dust.scale = 0.6f; - if (index < 5) - { - dust.noGravity = true; - dust.scale = 1.8f; - } - } - } - private void UpdatePosition(Vector2 wetVelocity) { - if (this.aiStyle == 4 || this.aiStyle == 38 || this.aiStyle == 84 || this.aiStyle == 148 || this.aiStyle == 7 && (double) this.ai[0] == 2.0 || (this.type == 440 || this.type == 449 || this.type == 606) && (double) this.ai[1] == 1.0 || this.aiStyle == 93 && (double) this.ai[0] < 0.0 || this.type == 540 || this.type == 756 || this.type == 818 || this.type == 856 || this.type == 933 || ProjectileID.Sets.IsAGolfBall[this.type]) + if (this.aiStyle == 4 || this.aiStyle == 38 || this.aiStyle == 84 || this.aiStyle == 7 && (double) this.ai[0] == 2.0 || (this.type == 440 || this.type == 449 || this.type == 606) && (double) this.ai[1] == 1.0 || this.aiStyle == 93 && (double) this.ai[0] < 0.0 || this.type == 540) return; if (this.wet) this.position = this.position + wetVelocity; @@ -13439,837 +10663,315 @@ namespace Terraria public void FishingCheck() { - if (Main.player[this.owner].wet) - return; - FishingAttempt fisher = new FishingAttempt(); - fisher.X = (int) ((double) this.Center.X / 16.0); - fisher.Y = (int) ((double) this.Center.Y / 16.0); - fisher.bobberType = this.type; - Projectile.GetFishingPondState(fisher.X, fisher.Y, out fisher.inLava, out fisher.inHoney, out fisher.waterTilesCount, out fisher.chumsInWater); - if (fisher.waterTilesCount < 75) + int index = (int) ((double) this.Center.X / 16.0); + int j1 = (int) ((double) this.Center.Y / 16.0); + if (Main.tile[index, j1].liquid < (byte) 0) + ++j1; + bool flag1 = false; + bool flag2 = false; + int i1 = index; + int i2 = index; + while (i1 > 10 && Main.tile[i1, j1].liquid > (byte) 0 && !WorldGen.SolidTile(i1, j1)) + --i1; + while (i2 < Main.maxTilesX - 10 && Main.tile[i2, j1].liquid > (byte) 0 && !WorldGen.SolidTile(i2, j1)) + ++i2; + int num1 = 0; + for (int i3 = i1; i3 <= i2; ++i3) + { + int j2 = j1; + while (Main.tile[i3, j2].liquid > (byte) 0 && !WorldGen.SolidTile(i3, j2) && j2 < Main.maxTilesY - 10) + { + ++num1; + ++j2; + if (Main.tile[i3, j2].lava()) + flag1 = true; + else if (Main.tile[i3, j2].honey()) + flag2 = true; + } + } + if (flag2) + num1 = (int) ((double) num1 * 1.5); + if (num1 < 75) { Main.player[this.owner].displayedFishingInfo = Language.GetTextValue("GameUI.NotEnoughWater"); } else { - fisher.playerFishingConditions = Main.player[this.owner].GetFishingConditions(); - if (fisher.playerFishingConditions.BaitItemType == 2673) + int num2 = Main.player[this.owner].FishingLevel(); + if (num2 == 0) + return; + Main.player[this.owner].displayedFishingInfo = Language.GetTextValue("GameUI.FishingPower", (object) num2); + if (num2 < 0) { + if (num2 != -1) + return; Main.player[this.owner].displayedFishingInfo = Language.GetTextValue("GameUI.FishingWarning"); - if (fisher.X >= 380 && fisher.X <= Main.maxTilesX - 380 || fisher.waterTilesCount <= 1000 || NPC.AnyNPCs(370)) + if (index >= 380 && index <= Main.maxTilesX - 380 || num1 <= 1000 || NPC.AnyNPCs(370)) return; this.ai[1] = (float) (Main.rand.Next(-180, -60) - 100); - this.localAI[1] = 1f; + this.localAI[1] = (float) num2; this.netUpdate = true; } else { - fisher.fishingLevel = fisher.playerFishingConditions.FinalFishingLevel; - if (fisher.fishingLevel == 0) + int num3 = 300; + float num4 = (float) (Main.maxTilesX / 4200); + float num5 = (float) (((double) this.position.Y / 16.0 - (60.0 + 10.0 * (double) (num4 * num4))) / (Main.worldSurface / 6.0)); + if ((double) num5 < 0.25) + num5 = 0.25f; + if ((double) num5 > 1.0) + num5 = 1f; + int num6 = (int) ((double) num3 * (double) num5); + float num7 = (float) num1 / (float) num6; + if ((double) num7 < 1.0) + num2 = (int) ((double) num2 * (double) num7); + float num8 = 1f - num7; + if (num1 < num6) + Main.player[this.owner].displayedFishingInfo = Language.GetTextValue("GameUI.FullFishingPower", (object) num2, (object) -Math.Round((double) num8 * 100.0)); + int num9 = (num2 + 75) / 2; + if (Main.player[this.owner].wet || Main.rand.Next(100) > num9) return; - fisher.CanFishInLava = ItemID.Sets.CanFishInLava[fisher.playerFishingConditions.PoleItemType] || ItemID.Sets.IsLavaBait[fisher.playerFishingConditions.BaitItemType] || Main.player[this.owner].accLavaFishing; - if (fisher.chumsInWater > 0) - fisher.fishingLevel += 11; - if (fisher.chumsInWater > 1) - fisher.fishingLevel += 6; - if (fisher.chumsInWater > 2) - fisher.fishingLevel += 3; - Main.player[this.owner].displayedFishingInfo = Language.GetTextValue("GameUI.FishingPower", (object) fisher.fishingLevel); - fisher.waterNeededToFish = 300; - float num1 = (float) (Main.maxTilesX / 4200); - float num2 = num1 * num1; - fisher.atmo = (float) (((double) this.position.Y / 16.0 - (60.0 + 10.0 * (double) num2)) / (Main.worldSurface / 6.0)); - if ((double) fisher.atmo < 0.25) - fisher.atmo = 0.25f; - if ((double) fisher.atmo > 1.0) - fisher.atmo = 1f; - fisher.waterNeededToFish = (int) ((double) fisher.waterNeededToFish * (double) fisher.atmo); - fisher.waterQuality = (float) fisher.waterTilesCount / (float) fisher.waterNeededToFish; - if ((double) fisher.waterQuality < 1.0) - fisher.fishingLevel = (int) ((double) fisher.fishingLevel * (double) fisher.waterQuality); - fisher.waterQuality = 1f - fisher.waterQuality; - if (fisher.waterTilesCount < fisher.waterNeededToFish) - Main.player[this.owner].displayedFishingInfo = Language.GetTextValue("GameUI.FullFishingPower", (object) fisher.fishingLevel, (object) -Math.Round((double) fisher.waterQuality * 100.0)); - if ((double) Main.player[this.owner].luck < 0.0) + int Type = 0; + int num10 = (double) j1 >= Main.worldSurface * 0.5 ? ((double) j1 >= Main.worldSurface ? ((double) j1 >= Main.rockLayer ? (j1 >= Main.maxTilesY - 300 ? 4 : 3) : 2) : 1) : 0; + int num11 = 150; + int maxValue1 = num11 / num2; + int maxValue2 = num11 * 2 / num2; + int maxValue3 = num11 * 7 / num2; + int maxValue4 = num11 * 15 / num2; + int maxValue5 = num11 * 30 / num2; + if (maxValue1 < 2) + maxValue1 = 2; + if (maxValue2 < 3) + maxValue2 = 3; + if (maxValue3 < 4) + maxValue3 = 4; + if (maxValue4 < 5) + maxValue4 = 5; + if (maxValue5 < 6) + maxValue5 = 6; + bool flag3 = false; + bool flag4 = false; + bool flag5 = false; + bool flag6 = false; + bool flag7 = false; + if (Main.rand.Next(maxValue1) == 0) + flag3 = true; + if (Main.rand.Next(maxValue2) == 0) + flag4 = true; + if (Main.rand.Next(maxValue3) == 0) + flag5 = true; + if (Main.rand.Next(maxValue4) == 0) + flag6 = true; + if (Main.rand.Next(maxValue5) == 0) + flag7 = true; + int num12 = 10; + if (Main.player[this.owner].cratePotion) + num12 += 10; + int type = Main.anglerQuestItemNetIDs[Main.anglerQuest]; + if (Main.player[this.owner].HasItem(type)) + type = -1; + if (Main.anglerQuestFinished) + type = -1; + if (flag1) { - if ((double) Main.rand.NextFloat() < -(double) Main.player[this.owner].luck) - fisher.fishingLevel = (int) ((double) fisher.fishingLevel * (0.9 - (double) Main.rand.NextFloat() * 0.3)); + if (!ItemID.Sets.CanFishInLava[Main.player[this.owner].HeldItem.type]) + return; + if (flag7) + Type = 2331; + else if (flag6) + Type = 2312; + else if (flag5) + Type = 2315; } - else if ((double) Main.rand.NextFloat() < (double) Main.player[this.owner].luck) - fisher.fishingLevel = (int) ((double) fisher.fishingLevel * (1.1 + (double) Main.rand.NextFloat() * 0.3)); - if (fisher.fishingLevel > 50) - fisher.fishingLevel = (int) (50.0 + (double) (fisher.fishingLevel - 50) * 0.949999988079071); - if (fisher.fishingLevel > 75) - fisher.fishingLevel = (int) (75.0 + (double) (fisher.fishingLevel - 75) * 0.899999976158142); - if (fisher.fishingLevel > 100) - fisher.fishingLevel = (int) (100.0 + (double) (fisher.fishingLevel - 100) * 0.850000023841858); - if (fisher.fishingLevel > 125) - fisher.fishingLevel = (int) (125.0 + (double) (fisher.fishingLevel - 125) * 0.800000011920929); - if (fisher.fishingLevel > 150) - fisher.fishingLevel = (int) (150.0 + (double) (fisher.fishingLevel - 150) * 0.75); - if (fisher.fishingLevel > 175) - fisher.fishingLevel = (int) (175.0 + (double) (fisher.fishingLevel - 175) * 0.699999988079071); - if (fisher.fishingLevel > 200) - fisher.fishingLevel = (int) (200.0 + (double) (fisher.fishingLevel - 200) * 0.649999976158142); - int num3 = (fisher.fishingLevel + 75) / 2; - if (Main.rand.Next(100) > num3) - return; - fisher.heightLevel = 0; - fisher.heightLevel = (double) fisher.Y >= Main.worldSurface * 0.5 ? ((double) fisher.Y >= Main.worldSurface ? ((double) fisher.Y >= Main.rockLayer ? (fisher.Y >= Main.maxTilesY - 300 ? 4 : 3) : 2) : 1) : 0; - this.FishingCheck_RollDropLevels(fisher.fishingLevel, out fisher.common, out fisher.uncommon, out fisher.rare, out fisher.veryrare, out fisher.legendary, out fisher.crate); - this.FishingCheck_ProbeForQuestFish(ref fisher); - this.FishingCheck_RollEnemySpawns(ref fisher); - this.FishingCheck_RollItemDrop(ref fisher); - bool flag = false; - if (fisher.rolledItemDrop > 0) + else if (flag2) { - if (Main.player[this.owner].sonarPotion) - { - Item newItem = new Item(); - newItem.SetDefaults(fisher.rolledItemDrop); - newItem.position = this.position; - PopupText.sonarText = PopupText.NewText(PopupTextContext.SonarAlert, newItem, 1, true); - if (PopupText.sonarText > -1) - Main.popupText[PopupText.sonarText].sonar = true; - } - float fishingLevel = (float) fisher.fishingLevel; - this.ai[1] = (float) Main.rand.Next(-240, -90) - fishingLevel; - this.localAI[1] = (float) fisher.rolledItemDrop; - this.netUpdate = true; - flag = true; + if (flag5 || flag4 && Main.rand.Next(2) == 0) + Type = 2314; + else if (flag4 && type == 2451) + Type = 2451; } - if (fisher.rolledEnemySpawn > 0) + else if (Main.rand.Next(50) > num2 && Main.rand.Next(50) > num2 && num1 < num6) + Type = Main.rand.Next(2337, 2340); + else if (Main.rand.Next(100) < num12) + Type = !(flag6 | flag7) ? (!flag5 || !Main.player[this.owner].ZoneCorrupt ? (!flag5 || !Main.player[this.owner].ZoneCrimson ? (!flag5 || !Main.player[this.owner].ZoneHoly ? (!flag5 || !Main.player[this.owner].ZoneDungeon ? (!flag5 || !Main.player[this.owner].ZoneJungle ? (!flag5 || num10 != 0 ? (!flag4 ? 2334 : 2335) : 3206) : 3208) : 3205) : 3207) : 3204) : 3203) : 2336; + else if (flag7 && Main.rand.Next(5) == 0) + Type = 2423; + else if (flag7 && Main.rand.Next(5) == 0) + Type = 3225; + else if (flag7 && Main.rand.Next(10) == 0) + Type = 2420; + else if (((flag7 ? 0 : (!flag6 ? 1 : 0)) & (flag4 ? 1 : 0)) != 0 && Main.rand.Next(5) == 0) { - if (Main.player[this.owner].sonarPotion) - { - PopupText.sonarText = PopupText.NewText(PopupTextContext.SonarAlert, fisher.rolledEnemySpawn, this.Center, false); - if (PopupText.sonarText > -1) - Main.popupText[PopupText.sonarText].sonar = true; - } - float fishingLevel = (float) fisher.fishingLevel; - this.ai[1] = (float) Main.rand.Next(-240, -90) - fishingLevel; - this.localAI[1] = (float) -fisher.rolledEnemySpawn; - this.netUpdate = true; - flag = true; + Type = 3196; } - if (flag) - return; - int num4 = 0; - if (ItemID.Sets.IsLavaBait[fisher.playerFishingConditions.BaitItemType]) - ++num4; - if (ItemID.Sets.CanFishInLava[fisher.playerFishingConditions.PoleItemType]) - ++num4; - if (Main.player[this.owner].accLavaFishing) - ++num4; - if (num4 < 2) - return; - this.localAI[1] += 240f; - } - } - } - - private void FishingCheck_RollEnemySpawns(ref FishingAttempt fisher) - { - if (fisher.inLava || fisher.inHoney || !Main.bloodMoon || Main.dayTime) - return; - int maxValue = 6; - if (fisher.bobberType == 760) - maxValue = 3; - if (Main.rand.Next(maxValue) != 0) - return; - if (Main.hardMode) - { - fisher.rolledEnemySpawn = (int) Utils.SelectRandom(Main.rand, (short) 620, (short) 621, (short) 586, (short) 587); - if (Main.rand.Next(10) != 0) - return; - fisher.rolledEnemySpawn = 618; - } - else - fisher.rolledEnemySpawn = (int) Utils.SelectRandom(Main.rand, (short) 586, (short) 587); - } - - private void FishingCheck_RollItemDrop(ref FishingAttempt fisher) - { - if (fisher.rolledEnemySpawn > 0) - return; - if (fisher.inLava) - { - if (!fisher.CanFishInLava) - return; - if (fisher.crate && Main.rand.Next(5) == 0) - fisher.rolledItemDrop = Main.hardMode ? 4878 : 4877; - else if (fisher.legendary && Main.hardMode && Main.rand.Next(3) == 0) - fisher.rolledItemDrop = (int) Main.rand.NextFromList((short) 4819, (short) 4820, (short) 4872, (short) 2331); - else if (fisher.legendary && !Main.hardMode && Main.rand.Next(3) == 0) - fisher.rolledItemDrop = (int) Main.rand.NextFromList((short) 4819, (short) 4820, (short) 4872); - else if (fisher.veryrare) - { - fisher.rolledItemDrop = 2312; - } - else - { - if (!fisher.rare) - return; - fisher.rolledItemDrop = 2315; - } - } - else if (fisher.inHoney) - { - if (fisher.rare || fisher.uncommon && Main.rand.Next(2) == 0) - { - fisher.rolledItemDrop = 2314; - } - else - { - if (!fisher.uncommon || fisher.questFish != 2451) - return; - fisher.rolledItemDrop = 2451; - } - } - else if (Main.rand.Next(50) > fisher.fishingLevel && Main.rand.Next(50) > fisher.fishingLevel && fisher.waterTilesCount < fisher.waterNeededToFish) - fisher.rolledItemDrop = Main.rand.Next(2337, 2340); - else if (fisher.crate) - { - bool hardMode = Main.hardMode; - if (fisher.veryrare || fisher.legendary) - fisher.rolledItemDrop = hardMode ? 3981 : 2336; - else if (fisher.rare && Main.player[this.owner].ZoneDungeon) - fisher.rolledItemDrop = hardMode ? 3984 : 3205; - else if (fisher.rare && Main.player[this.owner].ZoneBeach) - fisher.rolledItemDrop = hardMode ? 5003 : 5002; - else if (fisher.rare && Main.player[this.owner].ZoneCorrupt) - fisher.rolledItemDrop = hardMode ? 3982 : 3203; - else if (fisher.rare && Main.player[this.owner].ZoneCrimson) - fisher.rolledItemDrop = hardMode ? 3983 : 3204; - else if (fisher.rare && Main.player[this.owner].ZoneHallow) - fisher.rolledItemDrop = hardMode ? 3986 : 3207; - else if (fisher.rare && Main.player[this.owner].ZoneJungle) - fisher.rolledItemDrop = hardMode ? 3987 : 3208; - else if (fisher.rare && Main.player[this.owner].ZoneSnow) - fisher.rolledItemDrop = hardMode ? 4406 : 4405; - else if (fisher.rare && Main.player[this.owner].ZoneDesert) - fisher.rolledItemDrop = hardMode ? 4408 : 4407; - else if (fisher.rare && fisher.heightLevel == 0) - fisher.rolledItemDrop = hardMode ? 3985 : 3206; - else if (fisher.uncommon) - fisher.rolledItemDrop = hardMode ? 3980 : 2335; - else - fisher.rolledItemDrop = hardMode ? 3979 : 2334; - } - else if (!NPC.combatBookWasUsed && Main.bloodMoon && fisher.legendary && Main.rand.Next(3) == 0) - fisher.rolledItemDrop = 4382; - else if (fisher.legendary && Main.rand.Next(5) == 0) - fisher.rolledItemDrop = 2423; - else if (fisher.legendary && Main.rand.Next(5) == 0) - fisher.rolledItemDrop = 3225; - else if (fisher.legendary && Main.rand.Next(10) == 0) - fisher.rolledItemDrop = 2420; - else if (!fisher.legendary && !fisher.veryrare && fisher.uncommon && Main.rand.Next(5) == 0) - { - fisher.rolledItemDrop = 3196; - } - else - { - bool flag1 = Main.player[this.owner].ZoneDesert; - if (Main.player[this.owner].ZoneDungeon) - { - flag1 = false; - if (fisher.rolledItemDrop == 0 && fisher.veryrare && Main.rand.Next(7) == 0) - fisher.rolledItemDrop = 3000; - } - else - { - bool flag2 = Main.player[this.owner].ZoneCorrupt; - bool flag3 = Main.player[this.owner].ZoneCrimson; - if (flag2 & flag3) - { - if (Main.rand.Next(2) == 0) - flag3 = false; - else - flag2 = false; - } - if (flag2) - { - if (fisher.legendary && Main.hardMode && Main.player[this.owner].ZoneSnow && fisher.heightLevel == 3 && Main.rand.Next(3) != 0) - fisher.rolledItemDrop = 2429; - else if (fisher.legendary && Main.hardMode && Main.rand.Next(2) == 0) - fisher.rolledItemDrop = 3210; - else if (fisher.rare) - fisher.rolledItemDrop = 2330; - else if (fisher.uncommon && fisher.questFish == 2454) - fisher.rolledItemDrop = 2454; - else if (fisher.uncommon && fisher.questFish == 2485) - fisher.rolledItemDrop = 2485; - else if (fisher.uncommon && fisher.questFish == 2457) - fisher.rolledItemDrop = 2457; - else if (fisher.uncommon) - fisher.rolledItemDrop = 2318; - } - else if (flag3) - { - if (fisher.legendary && Main.hardMode && Main.player[this.owner].ZoneSnow && fisher.heightLevel == 3 && Main.rand.Next(3) != 0) - fisher.rolledItemDrop = 2429; - else if (fisher.legendary && Main.hardMode && Main.rand.Next(2) == 0) - fisher.rolledItemDrop = 3211; - else if (fisher.uncommon && fisher.questFish == 2477) - fisher.rolledItemDrop = 2477; - else if (fisher.uncommon && fisher.questFish == 2463) - fisher.rolledItemDrop = 2463; - else if (fisher.uncommon) - fisher.rolledItemDrop = 2319; - else if (fisher.common) - fisher.rolledItemDrop = 2305; - } - else if (Main.player[this.owner].ZoneHallow) - { - if (fisher.legendary && Main.hardMode && Main.player[this.owner].ZoneSnow && fisher.heightLevel == 3 && Main.rand.Next(3) != 0) - fisher.rolledItemDrop = 2429; - else if (fisher.legendary && Main.hardMode && Main.rand.Next(2) == 0) - fisher.rolledItemDrop = 3209; - else if (fisher.heightLevel > 1 && fisher.veryrare) - fisher.rolledItemDrop = 2317; - else if (fisher.heightLevel > 1 && fisher.rare && fisher.questFish == 2465) - fisher.rolledItemDrop = 2465; - else if (fisher.heightLevel < 2 && fisher.rare && fisher.questFish == 2468) - fisher.rolledItemDrop = 2468; - else if (fisher.rare) - fisher.rolledItemDrop = 2310; - else if (fisher.uncommon && fisher.questFish == 2471) - fisher.rolledItemDrop = 2471; - else if (fisher.uncommon) - fisher.rolledItemDrop = 2307; - } - if (fisher.rolledItemDrop == 0 && Main.player[this.owner].ZoneSnow) - { - if (fisher.heightLevel < 2 && fisher.uncommon && fisher.questFish == 2467) - fisher.rolledItemDrop = 2467; - else if (fisher.heightLevel == 1 && fisher.uncommon && fisher.questFish == 2470) - fisher.rolledItemDrop = 2470; - else if (fisher.heightLevel >= 2 && fisher.uncommon && fisher.questFish == 2484) - fisher.rolledItemDrop = 2484; - else if (fisher.heightLevel > 1 && fisher.uncommon && fisher.questFish == 2466) - fisher.rolledItemDrop = 2466; - else if (fisher.common && Main.rand.Next(12) == 0 || fisher.uncommon && Main.rand.Next(6) == 0) - fisher.rolledItemDrop = 3197; - else if (fisher.uncommon) - fisher.rolledItemDrop = 2306; - else if (fisher.common) - fisher.rolledItemDrop = 2299; - else if (fisher.heightLevel > 1 && Main.rand.Next(3) == 0) - fisher.rolledItemDrop = 2309; - } - if (fisher.rolledItemDrop == 0 && Main.player[this.owner].ZoneJungle) - { - if (fisher.heightLevel == 1 && fisher.uncommon && fisher.questFish == 2452) - fisher.rolledItemDrop = 2452; - else if (fisher.heightLevel == 1 && fisher.uncommon && fisher.questFish == 2483) - fisher.rolledItemDrop = 2483; - else if (fisher.heightLevel == 1 && fisher.uncommon && fisher.questFish == 2488) - fisher.rolledItemDrop = 2488; - else if (fisher.heightLevel >= 1 && fisher.uncommon && fisher.questFish == 2486) - fisher.rolledItemDrop = 2486; - else if (fisher.heightLevel > 1 && fisher.uncommon) - fisher.rolledItemDrop = 2311; - else if (fisher.uncommon) - fisher.rolledItemDrop = 2313; - else if (fisher.common) - fisher.rolledItemDrop = 2302; - } - if (fisher.rolledItemDrop == 0 && Main.player[this.owner].ZoneGlowshroom && fisher.uncommon && fisher.questFish == 2475) - fisher.rolledItemDrop = 2475; - } - if (fisher.rolledItemDrop == 0) - { - if (fisher.heightLevel <= 1 && (fisher.X < 380 || fisher.X > Main.maxTilesX - 380) && fisher.waterTilesCount > 1000) - fisher.rolledItemDrop = !fisher.veryrare || Main.rand.Next(2) != 0 ? (!fisher.veryrare ? (!fisher.rare || Main.rand.Next(5) != 0 ? (!fisher.rare || Main.rand.Next(3) != 0 ? (!fisher.uncommon || fisher.questFish != 2480 ? (!fisher.uncommon || fisher.questFish != 2481 ? (!fisher.uncommon ? (!fisher.common || Main.rand.Next(2) != 0 ? (!fisher.common ? 2297 : 2300) : 2301) : 2316) : 2481) : 2480) : 2332) : 2438) : 2342) : 2341; - else if (flag1) - fisher.rolledItemDrop = !fisher.uncommon || fisher.questFish != 4393 ? (!fisher.uncommon || fisher.questFish != 4394 ? (!fisher.uncommon ? (Main.rand.Next(3) != 0 ? 4401 : 4402) : 4410) : 4394) : 4393; - } - if (fisher.rolledItemDrop != 0) - return; - if (fisher.heightLevel < 2 && fisher.uncommon && fisher.questFish == 2461) - fisher.rolledItemDrop = 2461; - else if (fisher.heightLevel == 0 && fisher.uncommon && fisher.questFish == 2453) - fisher.rolledItemDrop = 2453; - else if (fisher.heightLevel == 0 && fisher.uncommon && fisher.questFish == 2473) - fisher.rolledItemDrop = 2473; - else if (fisher.heightLevel == 0 && fisher.uncommon && fisher.questFish == 2476) - fisher.rolledItemDrop = 2476; - else if (fisher.heightLevel < 2 && fisher.uncommon && fisher.questFish == 2458) - fisher.rolledItemDrop = 2458; - else if (fisher.heightLevel < 2 && fisher.uncommon && fisher.questFish == 2459) - fisher.rolledItemDrop = 2459; - else if (fisher.heightLevel == 0 && fisher.uncommon) - fisher.rolledItemDrop = 2304; - else if (fisher.heightLevel > 0 && fisher.heightLevel < 3 && fisher.uncommon && fisher.questFish == 2455) - fisher.rolledItemDrop = 2455; - else if (fisher.heightLevel == 1 && fisher.uncommon && fisher.questFish == 2479) - fisher.rolledItemDrop = 2479; - else if (fisher.heightLevel == 1 && fisher.uncommon && fisher.questFish == 2456) - fisher.rolledItemDrop = 2456; - else if (fisher.heightLevel == 1 && fisher.uncommon && fisher.questFish == 2474) - fisher.rolledItemDrop = 2474; - else if (fisher.heightLevel > 1 && fisher.rare && Main.rand.Next(5) == 0) - { - if (Main.hardMode && Main.rand.Next(2) == 0) - fisher.rolledItemDrop = 2437; else - fisher.rolledItemDrop = 2436; - } - else if (fisher.heightLevel > 1 && fisher.legendary && Main.rand.Next(3) != 0) - fisher.rolledItemDrop = 2308; - else if (fisher.heightLevel > 1 && fisher.veryrare && Main.rand.Next(2) == 0) - fisher.rolledItemDrop = 2320; - else if (fisher.heightLevel > 1 && fisher.rare) - fisher.rolledItemDrop = 2321; - else if (fisher.heightLevel > 1 && fisher.uncommon && fisher.questFish == 2478) - fisher.rolledItemDrop = 2478; - else if (fisher.heightLevel > 1 && fisher.uncommon && fisher.questFish == 2450) - fisher.rolledItemDrop = 2450; - else if (fisher.heightLevel > 1 && fisher.uncommon && fisher.questFish == 2464) - fisher.rolledItemDrop = 2464; - else if (fisher.heightLevel > 1 && fisher.uncommon && fisher.questFish == 2469) - fisher.rolledItemDrop = 2469; - else if (fisher.heightLevel > 2 && fisher.uncommon && fisher.questFish == 2462) - fisher.rolledItemDrop = 2462; - else if (fisher.heightLevel > 2 && fisher.uncommon && fisher.questFish == 2482) - fisher.rolledItemDrop = 2482; - else if (fisher.heightLevel > 2 && fisher.uncommon && fisher.questFish == 2472) - fisher.rolledItemDrop = 2472; - else if (fisher.heightLevel > 2 && fisher.uncommon && fisher.questFish == 2460) - fisher.rolledItemDrop = 2460; - else if (fisher.heightLevel > 1 && fisher.uncommon && Main.rand.Next(4) != 0) - fisher.rolledItemDrop = 2303; - else if (fisher.heightLevel > 1 && (fisher.uncommon || fisher.common || Main.rand.Next(4) == 0)) - { - if (Main.rand.Next(4) == 0) - fisher.rolledItemDrop = 2303; - else - fisher.rolledItemDrop = 2309; - } - else if (fisher.uncommon && fisher.questFish == 2487) - fisher.rolledItemDrop = 2487; - else if (fisher.waterTilesCount > 1000 && fisher.common) - fisher.rolledItemDrop = 2298; - else - fisher.rolledItemDrop = 2290; - } - } - - private void FishingCheck_ProbeForQuestFish(ref FishingAttempt fisher) - { - fisher.questFish = Main.anglerQuestItemNetIDs[Main.anglerQuest]; - if (Main.player[this.owner].HasItem(fisher.questFish)) - fisher.questFish = -1; - if (!NPC.AnyNPCs(369)) - fisher.questFish = -1; - if (!Main.anglerQuestFinished) - return; - fisher.questFish = -1; - } - - private void FishingCheck_RollDropLevels( - int fishingLevel, - out bool common, - out bool uncommon, - out bool rare, - out bool veryrare, - out bool legendary, - out bool crate) - { - int num1 = 150; - int maxValue1 = num1 / fishingLevel; - int maxValue2 = num1 * 2 / fishingLevel; - int maxValue3 = num1 * 7 / fishingLevel; - int maxValue4 = num1 * 15 / fishingLevel; - int maxValue5 = num1 * 30 / fishingLevel; - int num2 = 10; - if (Main.player[this.owner].cratePotion) - num2 += 10; - if (maxValue1 < 2) - maxValue1 = 2; - if (maxValue2 < 3) - maxValue2 = 3; - if (maxValue3 < 4) - maxValue3 = 4; - if (maxValue4 < 5) - maxValue4 = 5; - if (maxValue5 < 6) - maxValue5 = 6; - common = false; - uncommon = false; - rare = false; - veryrare = false; - legendary = false; - crate = false; - if (Main.rand.Next(maxValue1) == 0) - common = true; - if (Main.rand.Next(maxValue2) == 0) - uncommon = true; - if (Main.rand.Next(maxValue3) == 0) - rare = true; - if (Main.rand.Next(maxValue4) == 0) - veryrare = true; - if (Main.rand.Next(maxValue5) == 0) - legendary = true; - if (Main.rand.Next(100) >= num2) - return; - crate = true; - } - - private static void GetFishingPondState( - int x, - int y, - out bool lava, - out bool honey, - out int numWaters, - out int chumCount) - { - lava = false; - honey = false; - numWaters = 0; - chumCount = 0; - Point tileCoords = new Point(0, 0); - int minX; - int maxX; - Projectile.GetFishingPondWidth(x, y, out minX, out maxX); - for (int i = minX; i <= maxX; ++i) - { - int j = y; - while (Main.tile[i, j].liquid > (byte) 0 && !WorldGen.SolidTile(i, j) && j < Main.maxTilesY - 10) - { - ++numWaters; - ++j; - if (Main.tile[i, j].lava()) - lava = true; - else if (Main.tile[i, j].honey()) - honey = true; - tileCoords.X = i; - tileCoords.Y = j; - chumCount += Main.instance.ChumBucketProjectileHelper.GetChumsInLocation(tileCoords); + { + bool flag8 = Main.player[this.owner].ZoneCorrupt; + bool flag9 = Main.player[this.owner].ZoneCrimson; + if (flag8 & flag9) + { + if (Main.rand.Next(2) == 0) + flag9 = false; + else + flag8 = false; + } + if (flag8) + { + if (flag7 && Main.hardMode && Main.player[this.owner].ZoneSnow && num10 == 3 && Main.rand.Next(3) != 0) + Type = 2429; + else if (flag7 && Main.hardMode && Main.rand.Next(2) == 0) + Type = 3210; + else if (flag5) + Type = 2330; + else if (flag4 && type == 2454) + Type = 2454; + else if (flag4 && type == 2485) + Type = 2485; + else if (flag4 && type == 2457) + Type = 2457; + else if (flag4) + Type = 2318; + } + else if (flag9) + { + if (flag7 && Main.hardMode && Main.player[this.owner].ZoneSnow && num10 == 3 && Main.rand.Next(3) != 0) + Type = 2429; + else if (flag7 && Main.hardMode && Main.rand.Next(2) == 0) + Type = 3211; + else if (flag4 && type == 2477) + Type = 2477; + else if (flag4 && type == 2463) + Type = 2463; + else if (flag4) + Type = 2319; + else if (flag3) + Type = 2305; + } + else if (Main.player[this.owner].ZoneHoly) + { + if (flag7 && Main.hardMode && Main.player[this.owner].ZoneSnow && num10 == 3 && Main.rand.Next(3) != 0) + Type = 2429; + else if (flag7 && Main.hardMode && Main.rand.Next(2) == 0) + Type = 3209; + else if (num10 > 1 & flag6) + Type = 2317; + else if (num10 > 1 & flag5 && type == 2465) + Type = 2465; + else if (num10 < 2 & flag5 && type == 2468) + Type = 2468; + else if (flag5) + Type = 2310; + else if (flag4 && type == 2471) + Type = 2471; + else if (flag4) + Type = 2307; + } + if (Type == 0 && Main.player[this.owner].ZoneSnow) + { + if (num10 < 2 & flag4 && type == 2467) + Type = 2467; + else if (num10 == 1 & flag4 && type == 2470) + Type = 2470; + else if (num10 >= 2 & flag4 && type == 2484) + Type = 2484; + else if (num10 > 1 & flag4 && type == 2466) + Type = 2466; + else if (flag3 && Main.rand.Next(12) == 0 || flag4 && Main.rand.Next(6) == 0) + Type = 3197; + else if (flag4) + Type = 2306; + else if (flag3) + Type = 2299; + else if (num10 > 1 && Main.rand.Next(3) == 0) + Type = 2309; + } + if (Type == 0 && Main.player[this.owner].ZoneJungle) + { + if (num10 == 1 & flag4 && type == 2452) + Type = 2452; + else if (num10 == 1 & flag4 && type == 2483) + Type = 2483; + else if (num10 == 1 & flag4 && type == 2488) + Type = 2488; + else if (num10 >= 1 & flag4 && type == 2486) + Type = 2486; + else if (num10 > 1 & flag4) + Type = 2311; + else if (flag4) + Type = 2313; + else if (flag3) + Type = 2302; + } + if (Type == 0 && Main.shroomTiles > 200 && flag4 && type == 2475) + Type = 2475; + if (Type == 0) + { + if (num10 <= 1 && (index < 380 || index > Main.maxTilesX - 380) && num1 > 1000) + { + Type = !flag6 || Main.rand.Next(2) != 0 ? (!flag6 ? (!flag5 || Main.rand.Next(5) != 0 ? (!flag5 || Main.rand.Next(2) != 0 ? (!flag4 || type != 2480 ? (!flag4 || type != 2481 ? (!flag4 ? (!flag3 || Main.rand.Next(2) != 0 ? (!flag3 ? 2297 : 2300) : 2301) : 2316) : 2481) : 2480) : 2332) : 2438) : 2342) : 2341; + } + else + { + int sandTiles = Main.sandTiles; + } + } + if (Type == 0) + Type = !(num10 < 2 & flag4) || type != 2461 ? (!(num10 == 0 & flag4) || type != 2453 ? (!(num10 == 0 & flag4) || type != 2473 ? (!(num10 == 0 & flag4) || type != 2476 ? (!(num10 < 2 & flag4) || type != 2458 ? (!(num10 < 2 & flag4) || type != 2459 ? (!(num10 == 0 & flag4) ? (((num10 <= 0 ? 0 : (num10 < 3 ? 1 : 0)) & (flag4 ? 1 : 0)) == 0 || type != 2455 ? (!(num10 == 1 & flag4) || type != 2479 ? (!(num10 == 1 & flag4) || type != 2456 ? (!(num10 == 1 & flag4) || type != 2474 ? (!(num10 > 1 & flag5) || Main.rand.Next(5) != 0 ? (!(num10 > 1 & flag7) ? (!(num10 > 1 & flag6) || Main.rand.Next(2) != 0 ? (!(num10 > 1 & flag5) ? (!(num10 > 1 & flag4) || type != 2478 ? (!(num10 > 1 & flag4) || type != 2450 ? (!(num10 > 1 & flag4) || type != 2464 ? (!(num10 > 1 & flag4) || type != 2469 ? (!(num10 > 2 & flag4) || type != 2462 ? (!(num10 > 2 & flag4) || type != 2482 ? (!(num10 > 2 & flag4) || type != 2472 ? (!(num10 > 2 & flag4) || type != 2460 ? (!(num10 > 1 & flag4) || Main.rand.Next(4) == 0 ? (num10 <= 1 || !(flag4 | flag3) && Main.rand.Next(4) != 0 ? (!flag4 || type != 2487 ? (!(num1 > 1000 & flag3) ? 2290 : 2298) : 2487) : (Main.rand.Next(4) != 0 ? 2309 : 2303)) : 2303) : 2460) : 2472) : 2482) : 2462) : 2469) : 2464) : 2450) : 2478) : 2321) : 2320) : 2308) : (!Main.hardMode || Main.rand.Next(2) != 0 ? 2436 : 2437)) : 2474) : 2456) : 2479) : 2455) : 2304) : 2459) : 2458) : 2476) : 2473) : 2453) : 2461; + } + if (Type <= 0) + return; + if (Main.player[this.owner].sonarPotion) + { + Item newItem = new Item(); + newItem.SetDefaults(Type); + newItem.position = this.position; + ItemText.NewText(newItem, 1, true); + } + float num13 = (float) num2; + this.ai[1] = (float) Main.rand.Next(-240, -90) - num13; + this.localAI[1] = (float) Type; + this.netUpdate = true; } } - if (!honey) - return; - numWaters = (int) ((double) numWaters * 1.5); } - private static void GetFishingPondWidth(int x, int y, out int minX, out int maxX) - { - minX = x; - maxX = x; - while (minX > 10 && Main.tile[minX, y].liquid > (byte) 0 && !WorldGen.SolidTile(minX, y)) - --minX; - while (maxX < Main.maxTilesX - 10 && Main.tile[maxX, y].liquid > (byte) 0 && !WorldGen.SolidTile(maxX, y)) - ++maxX; - } + public bool CanReflect() => this.active && this.friendly && !this.hostile && this.damage > 0 && (this.aiStyle == 1 || this.aiStyle == 2 || this.aiStyle == 8 || this.aiStyle == 21 || this.aiStyle == 24 || this.aiStyle == 28 || this.aiStyle == 29 || this.aiStyle == 131); - public bool CanBeReflected() => this.active && this.friendly && !this.hostile && this.damage > 0 && (this.aiStyle == 1 || this.aiStyle == 2 || this.aiStyle == 8 || this.aiStyle == 21 || this.aiStyle == 24 || this.aiStyle == 28 || this.aiStyle == 29 || this.aiStyle == 131); - - public Color GetFairyQueenWeaponsColor( - float alphaChannelMultiplier = 1f, - float lerpToWhite = 0.0f, - float? rawHueOverride = null) + public float GetPrismHue(float indexing) { - float num = this.ai[1]; - if (rawHueOverride.HasValue) - num = rawHueOverride.Value; - float Hue = (float) (((double) num + 0.5) % 1.0); - float Saturation = 1f; - float Luminosity = 0.5f; if (Main.player[this.owner].active) { switch (Main.player[this.owner].name) { - case "Acamaeda": - Hue = MathHelper.Lerp(0.06f, 0.28f, Utils.Turn01ToCyclic010(Hue)); - Luminosity = 0.5f; - alphaChannelMultiplier = MathHelper.Lerp(alphaChannelMultiplier, 0.6f, 0.5f); - break; - case "Alchemystics": - Hue = MathHelper.Lerp(0.74f, 0.96f, Utils.Turn01ToCyclic010(Hue)); - Luminosity = 0.6f; - alphaChannelMultiplier = MathHelper.Lerp(alphaChannelMultiplier, 0.6f, 0.5f); - break; - case "Antithesis": - Hue = 0.51f; - Luminosity = MathHelper.Lerp(0.0f, 0.5f, (float) (Math.Cos((double) num * 6.28318548202515) * 0.5 + 0.5)); - break; - case "Aurora3500": - Hue = MathHelper.Lerp(0.33f, 0.8f, Utils.Turn01ToCyclic010(Hue)); - Luminosity = 0.5f; - alphaChannelMultiplier = MathHelper.Lerp(alphaChannelMultiplier, 0.5f, 0.5f); - break; - case "Cenx": - Color color1 = Color.Lerp(new Color(0.3f, 1f, 0.2f), Color.HotPink, MathHelper.SmoothStep(0.0f, 1f, MathHelper.SmoothStep(0.0f, 1f, Utils.PingPongFrom01To010(Hue)))); - if ((double) lerpToWhite != 0.0) - color1 = Color.Lerp(color1, Color.White, lerpToWhite); - color1.A = (byte) ((double) color1.A * (double) alphaChannelMultiplier); - return color1; - case "Criddle": - Hue = MathHelper.Lerp(0.05f, 0.15f, Utils.Turn01ToCyclic010(Hue)); - Luminosity = 0.5f; - alphaChannelMultiplier = MathHelper.Lerp(alphaChannelMultiplier, 0.5f, 0.5f); - break; - case "Crowno": - Luminosity = MathHelper.Lerp(0.25f, 0.4f, Utils.Turn01ToCyclic010(Hue)); - Hue = MathHelper.Lerp(0.7055556f, 0.7833334f, Utils.Turn01ToCyclic010(Hue)); - alphaChannelMultiplier = MathHelper.Lerp(alphaChannelMultiplier, 0.5f, 0.5f); - break; - case "Darthkitten": - Hue = 1f; - Luminosity = MathHelper.Lerp(1f, 0.4f, (float) (Math.Cos((double) num * 6.28318548202515) * 0.5 + 0.5)); - break; - case "Discipile": - Hue = MathHelper.Lerp(0.1f, 0.15f, Utils.Turn01ToCyclic010(Hue)); - Luminosity = 0.5f; - break; - case "Doylee": - Hue = MathHelper.Lerp(0.68f, 1f, Utils.Turn01ToCyclic010(Hue)); - Luminosity = 0.5f; - alphaChannelMultiplier = MathHelper.Lerp(alphaChannelMultiplier, 0.6f, 0.5f); - break; - case "Ghostar": - Hue = 0.66f; - Luminosity = MathHelper.Lerp(0.15f, 0.85f, (float) (Math.Cos((double) num * 6.28318548202515) * 0.5 + 0.5)); - break; - case "Grox The Great": - Hue = MathHelper.Lerp(0.31f, 0.5f, Utils.Turn01ToCyclic010(Hue)); - Luminosity = 0.5f; - alphaChannelMultiplier = MathHelper.Lerp(alphaChannelMultiplier, 1f, 0.8f); - break; - case "Jaxrud": - Hue = MathHelper.Lerp(0.1805556f, 0.4361111f, Utils.Turn01ToCyclic010(Hue)); - Luminosity = 0.5f; - break; - case "Jenosis": - Hue = MathHelper.Lerp(0.9f, 1.13f, Utils.Turn01ToCyclic010(Hue)) % 1f; - Luminosity = 0.5f; - alphaChannelMultiplier = MathHelper.Lerp(alphaChannelMultiplier, 0.5f, 0.5f); - break; - case "Kazzymodus": - Hue = 0.33f; - Luminosity = MathHelper.Lerp(0.15f, 0.4f, (float) (Math.Cos((double) num * 6.28318548202515) * 0.5 + 0.5)); - break; - case "Khaios": - Hue = 0.33f; - Luminosity = MathHelper.Lerp(0.0f, 0.2f, (float) (Math.Cos((double) num * 6.28318548202515) * 0.5 + 0.5)); - break; - case "Lazure": - Hue = MathHelper.Lerp(0.5333334f, 0.9222222f, Utils.Turn01ToCyclic010(Hue)); - Luminosity = 0.5f; - break; - case "Leinfors": - Hue = MathHelper.Lerp(0.7f, 0.77f, Utils.Turn01ToCyclic010(Hue)); - Luminosity = 0.5f; - break; - case "Loki": - Hue = 0.0f; - Luminosity = MathHelper.Lerp(0.0f, 0.25f, (float) (Math.Cos((double) num * 6.28318548202515) * 0.5 + 0.5)); - break; - case "ManaUser": - Hue = MathHelper.Lerp(0.41f, 0.57f, Utils.Turn01ToCyclic010(Hue)); - Luminosity = 0.5f; - break; - case "Mid": - Hue = 0.0f; - Luminosity = MathHelper.Lerp(0.0f, 0.9f, (float) (Math.Cos((double) num * 6.28318548202515) * 0.5 + 0.5)); - break; - case "Nike Leon": - Hue = MathHelper.Lerp(0.04f, 0.1f, Utils.Turn01ToCyclic010(Hue)); - Luminosity = 0.5f; - alphaChannelMultiplier = MathHelper.Lerp(alphaChannelMultiplier, 0.5f, 0.5f); - break; - case "RBrandon": - Hue = 0.03f; - Luminosity = 0.3f; - alphaChannelMultiplier = MathHelper.Lerp(alphaChannelMultiplier, 0.6f, 0.5f); - break; - case "Redigit": - Hue = 0.7f; - Luminosity = 0.5f; - break; - case "Serenity": - Hue = 0.85f; - Luminosity = MathHelper.Lerp(1f, 0.5f, (float) (Math.Cos((double) num * 6.28318548202515) * 0.5 + 0.5)); - break; - case "Sigma": - Hue = MathHelper.Lerp(0.0f, 0.12f, Utils.Turn01ToCyclic010(Hue)); - Luminosity = 0.5f; - alphaChannelMultiplier = MathHelper.Lerp(alphaChannelMultiplier, 0.6f, 0.5f); - break; - case "Unit One": - Color color2 = Color.Lerp(Color.Yellow, Color.Blue, MathHelper.SmoothStep(0.0f, 1f, Utils.PingPongFrom01To010(Hue))); - if ((double) lerpToWhite != 0.0) - color2 = Color.Lerp(color2, Color.White, lerpToWhite); - color2.A = (byte) ((double) color2.A * (double) alphaChannelMultiplier); - return color2; - case "Vulpes Inculta": - Hue = MathHelper.Lerp(0.65f, 0.75f, Utils.Turn01ToCyclic010(Hue)); - Luminosity = 0.5f; - alphaChannelMultiplier = MathHelper.Lerp(alphaChannelMultiplier, 0.5f, 0.5f); - break; - case "Waze3174": - Hue = MathHelper.Lerp(0.33f, 0.0f, Utils.Turn01ToCyclic010(Hue)); - Luminosity = 0.3f; - alphaChannelMultiplier = MathHelper.Lerp(alphaChannelMultiplier, 0.6f, 0.5f); - break; - case "Xman101": - Hue = 0.06f; - Luminosity = MathHelper.Lerp(0.0f, 0.5f, (float) (Math.Cos((double) num * 6.28318548202515) * 0.5 + 0.5)); - break; - case "Yoraiz0r": - Hue = MathHelper.Lerp(0.9f, 0.95f, Utils.Turn01ToCyclic010(Hue)); - Luminosity = 0.5f; - break; - case "Zoomo": - Hue = 0.77f; - Luminosity = 0.5f; - alphaChannelMultiplier = MathHelper.Lerp(alphaChannelMultiplier, 0.6f, 0.5f); - break; - case "darthmorf": - Hue = 0.0f; - Luminosity = MathHelper.Lerp(0.0f, 0.2f, (float) (Math.Cos((double) num * 6.28318548202515) * 0.5 + 0.5)); - break; - case "ppowersteef": - Hue = MathHelper.Lerp(0.0f, 0.15f, Utils.Turn01ToCyclic010(Hue)); - Luminosity = 0.5f; - alphaChannelMultiplier = MathHelper.Lerp(alphaChannelMultiplier, 0.6f, 0.5f); - break; - } - } - Color color3 = Main.hslToRgb(Hue, Saturation, Luminosity) * this.Opacity; - if ((double) lerpToWhite != 0.0) - color3 = Color.Lerp(color3, Color.White, lerpToWhite); - color3.A = (byte) ((double) color3.A * (double) alphaChannelMultiplier); - return color3; - } - - public float GetLastPrismHue( - float laserIndex, - ref float laserLuminance, - ref float laserAlphaMultiplier) - { - if (Main.player[this.owner].active) - { - double forVisualEffects = Main.timeForVisualEffects; - switch (Main.player[this.owner].name) - { - case "Acamaeda": - return (float) (0.180000007152557 + Math.Cos(forVisualEffects / 90.0 * 6.28318548202515) * 0.100000001490116); case "Aeroblop": - return (float) (0.25 + Math.Cos(forVisualEffects / 180.0 * 6.28318548202515) * 0.100000001490116); - case "Alchemystics": - return (float) (0.730000019073486 + Math.Cos(forVisualEffects / 180.0 * 6.28318548202515) * 0.180000007152557); - case "Antithesis": - laserLuminance = 0.25f; - laserAlphaMultiplier = 0.4f; - return (float) (0.699999988079071 + Math.Cos(forVisualEffects / 180.0 * 6.28318548202515) * 0.0500000007450581); + return (float) (0.25 + Math.Cos(Main.time / 180.0 * 6.28318548202515) * 0.100000001490116); case "Arkhalis": case "Darkhalis": - return (float) (0.75 + Math.Cos(forVisualEffects / 180.0 * 6.28318548202515) * 0.0700000002980232); - case "Aurora3500": - laserLuminance = MathHelper.Lerp(0.0f, 0.5f, Utils.GetLerpValue(-1f, 1f, (float) Math.Cos(forVisualEffects / 105.0 * 6.28318548202515), false)); - laserAlphaMultiplier = 0.25f; - return 0.35f; - case "Cenx": - return Main.rgbToHsl(Color.Lerp(new Color(0.3f, 1f, 0.2f), Color.HotPink, MathHelper.SmoothStep(0.0f, 1f, MathHelper.SmoothStep(0.0f, 1f, Utils.PingPongFrom01To010(laserIndex / 6f))))).X; - case "Criddle": - return (float) (0.910000026226044 + Math.Cos(forVisualEffects / 180.0 * 6.28318548202515) * 0.189999997615814); - case "Crowno": - laserLuminance = MathHelper.Lerp(0.25f, 0.4f, Utils.GetLerpValue(-1f, 1f, (float) Math.Cos(forVisualEffects / 105.0 * 6.28318548202515), false)); - laserAlphaMultiplier = 0.5f; - return MathHelper.Lerp(0.7055556f, 0.7833334f, Utils.Turn01ToCyclic010(laserIndex / 6f)); - case "Darthkitten": - laserLuminance = MathHelper.Lerp(0.4f, 0.9f, Utils.GetLerpValue(-1f, 1f, (float) Math.Cos(forVisualEffects / 120.0 * 6.28318548202515), false)); - laserAlphaMultiplier = 0.3f; - return 1f; + return (float) (0.75 + Math.Cos(Main.time / 180.0 * 6.28318548202515) * 0.0700000002980232); case "Devalaous": - return (float) (0.660000026226044 + Math.Cos(forVisualEffects / 180.0 * 6.28318548202515) * 0.100000001490116); - case "Discipile": - laserLuminance = MathHelper.Lerp(0.0f, 0.4f, Utils.GetLerpValue(-1f, 1f, (float) Math.Cos(forVisualEffects / 105.0 * 6.28318548202515), false)); - laserAlphaMultiplier = 0.35f; - return 0.55f; + return (float) (0.660000026226044 + Math.Cos(Main.time / 180.0 * 6.28318548202515) * 0.100000001490116); case "Doylee": - return (float) (0.839999973773956 + Math.Cos(forVisualEffects / 90.0 * 6.28318548202515) * 0.159999996423721); - case "Ghostar": - laserLuminance = MathHelper.Lerp(0.4f, 0.7f, Utils.GetLerpValue(-1f, 1f, (float) Math.Cos(forVisualEffects / 120.0 * 6.28318548202515), false)); - laserAlphaMultiplier = 0.3f; - return 0.66f; - case "Grox The Great": - return (float) (0.409999996423721 + Math.Cos(forVisualEffects / 120.0 * 6.28318548202515) * 0.100000001490116); - case "Jaxrud": - return MathHelper.Lerp(0.1805556f, 0.4361111f, Utils.Turn01ToCyclic010(laserIndex / 6f)); - case "Jenosis": - return (float) (0.660000026226044 + Math.Cos(forVisualEffects / 180.0 * 6.28318548202515) * 0.0799999982118607); - case "Kazzymodus": - laserLuminance = MathHelper.Lerp(0.6f, 0.8f, Utils.GetLerpValue(-1f, 1f, (float) Math.Cos(forVisualEffects / 90.0 * 6.28318548202515), false)); - laserAlphaMultiplier = 0.3f; - return 0.33f; - case "Khaios": - laserLuminance = MathHelper.Lerp(0.0f, 0.1f, Utils.GetLerpValue(-1f, 1f, (float) Math.Cos(forVisualEffects / 105.0 * 6.28318548202515), false)); - laserAlphaMultiplier = 0.25f; - return 0.35f; - case "Lazure": - return MathHelper.Lerp(0.5333334f, 0.9222222f, Utils.Turn01ToCyclic010(laserIndex / 6f)); - case "Leinfors": - return (float) (0.730000019073486 + Math.Cos(forVisualEffects / 3.0 * 6.28318548202515) * 0.0299999993294477); - case "Loki": - laserLuminance = MathHelper.Lerp(0.0f, 0.3f, Utils.GetLerpValue(-1f, 1f, (float) Math.Cos(forVisualEffects / 5.0 * 6.28318548202515), false)); - laserAlphaMultiplier = 0.4f; return 0.0f; - case "ManaUser": - return (float) (0.490000009536743 + Math.Cos(forVisualEffects / 140.0 * 6.28318548202515) * 0.0799999982118607); - case "Mid": - laserLuminance = 0.25f; - laserAlphaMultiplier = 0.4f; - return (float) (0.860000014305115 + Math.Cos(forVisualEffects / 270.0 * 6.28318548202515) * 0.129999995231628); + case "Ghostar": + return 0.33f; + case "Grox The Great": + return (float) (0.310000002384186 + Math.Cos(Main.time / 120.0 * 6.28318548202515) * 0.0299999993294477); + case "Leinfors": + return 0.77f; case "Nike Leon": - return (float) (0.0700000002980232 + Math.Cos(forVisualEffects / 180.0 * 6.28318548202515) * 0.0399999991059303); - case "RBrandon": - laserLuminance = MathHelper.Lerp(0.0f, 0.5f, Utils.GetLerpValue(-1f, 1f, (float) Math.Cos(forVisualEffects / 105.0 * 6.28318548202515), false)); - laserAlphaMultiplier = 0.4f; - return 1f; + return (float) (0.0750000029802322 + Math.Cos(Main.time / 180.0 * 6.28318548202515) * 0.0700000002980232); case "Random": return Main.rand.NextFloat(); - case "Redigit": - return 0.7f; - case "Serenity": - laserLuminance = MathHelper.Lerp(0.9f, 0.65f, Utils.GetLerpValue(-1f, 1f, (float) Math.Cos(forVisualEffects / 120.0 * 6.28318548202515), false)); - laserAlphaMultiplier = 0.3f; - return 0.85f; - case "Sigma": - return (float) (0.0599999986588955 + Math.Cos(forVisualEffects / 180.0 * 6.28318548202515) * 0.0599999986588955); case "Suweeka": - return (float) (0.5 + Math.Cos(forVisualEffects / 180.0 * 6.28318548202515) * 0.180000007152557); + return (float) (0.5 + Math.Cos(Main.time / 180.0 * 6.28318548202515) * 0.180000007152557); case "Tsuki": case "Yoraiz0r": - return 0.92f; - case "Unit One": - return (float) (0.379999995231628 + Math.Cos(forVisualEffects / 90.0 * 6.28318548202515) * 0.239999994635582); - case "Vulpes Inculta": - return (float) (0.699999988079071 + Math.Cos(forVisualEffects / 180.0 * 6.28318548202515) * 0.0500000007450581); + return 0.85f; case "W1K": - return (float) (0.75 + Math.Cos(forVisualEffects / 120.0 * 6.28318548202515) * 0.0500000007450581); - case "Waze3174": - return (float) (0.379999995231628 + Math.Cos(forVisualEffects / 90.0 * 6.28318548202515) * 0.239999994635582); - case "Xman101": - laserLuminance = MathHelper.Lerp(0.9f, 0.55f, Utils.GetLerpValue(-1f, 1f, (float) Math.Cos(forVisualEffects / 120.0 * 6.28318548202515), false)); - laserAlphaMultiplier = 0.2f; - return 0.33f; - case "Zoomo": - return 0.77f; - case "darthmorf": - laserLuminance = MathHelper.Lerp(0.0f, 0.2f, Utils.GetLerpValue(-1f, 1f, (float) Math.Cos(forVisualEffects / 105.0 * 6.28318548202515), false)); - laserAlphaMultiplier = 0.4f; - return 0.0f; - case "ppowersteef": - laserLuminance = MathHelper.Lerp(0.1f, 0.5f, Utils.GetLerpValue(-1f, 1f, (float) Math.Cos(forVisualEffects / 105.0 * 6.28318548202515), false)); - laserAlphaMultiplier = 0.25f; - return 0.6f; + return (float) (0.75 + Math.Cos(Main.time / 120.0 * 6.28318548202515) * 0.0500000007450581); } } - return (float) (int) laserIndex / 6f; + return (float) (int) indexing / 6f; } public static int GetByUUID(int owner, float uuid) => Projectile.GetByUUID(owner, (int) uuid); @@ -14304,7462 +11006,219 @@ namespace Terraria } } - public bool ShouldUseWindPhysics() - { - if (Main.windPhysics) - { - bool? nullable = ProjectileID.Sets.WindPhysicsImmunity[this.type]; - if (nullable.HasValue) - return !nullable.Value; - int aiStyle = this.aiStyle; - if (aiStyle <= 17) - { - if (aiStyle <= 8) - { - if ((uint) (aiStyle - 1) > 1U && aiStyle != 8) - goto label_12; - } - else if (aiStyle != 10 && aiStyle != 14 && (uint) (aiStyle - 16) > 1U) - goto label_12; - } - else if (aiStyle <= 72) - { - switch (aiStyle - 21) - { - case 0: - case 3: - case 7: - case 8: - case 11: - case 12: - case 13: - case 14: - break; - case 1: - case 2: - case 4: - case 5: - case 6: - case 9: - case 10: - goto label_12; - default: - if (aiStyle == 49 || aiStyle == 72) - break; - goto label_12; - } - } - else if (aiStyle != 93 && aiStyle != 96 && aiStyle != 106) - goto label_12; - return true; - } -label_12: - return false; - } - - private void AI_151_SuperStar() - { - this.alpha -= 10; - int num = 100; - if (this.alpha < num) - this.alpha = num; - if (this.soundDelay == 0) - { - this.soundDelay = 20 + Main.rand.Next(40); - SoundEngine.PlaySound(SoundID.Item9, this.position); - } - this.rotation += (float) (((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y)) * 0.00499999988824129) * (float) this.direction; - Vector2 vector2 = new Vector2((float) Main.screenWidth, (float) Main.screenHeight); - if (this.Hitbox.Intersects(Utils.CenteredRectangle(Main.screenPosition + vector2 / 2f, vector2 + new Vector2(400f))) && Main.rand.Next(6) == 0) - Gore.NewGore(this.position, this.velocity * 0.2f, Utils.SelectRandom(Main.rand, 16, 17, 17, 17)); - for (int index = 0; index < 2; ++index) - { - if (Main.rand.Next(8) == 0) - { - Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 228, Alpha: ((int) sbyte.MaxValue)); - dust.velocity *= 0.25f; - dust.scale = 1.3f; - dust.noGravity = true; - dust.velocity += this.velocity.RotatedBy(0.392699092626572 * (1.0 - (double) (2 * index))) * 0.2f; - } - } - } - - public bool IsInterruptible(Player player) => this.aiStyle == 160; - - public void Interrupt(Player player) - { - if (this.aiStyle != 160) - return; - this.Kill(); - player.heldProj = -1; - player.itemAnimation = 0; - player.itemTime = 0; - } - - private void AI_152_SuperStarSlash() - { - this.alpha -= 10; - int num = 100; - if (this.alpha < num) - this.alpha = num; - if (this.soundDelay == 0) - { - this.soundDelay = 20 + Main.rand.Next(40); - SoundEngine.PlaySound(SoundID.Item9, this.position); - } - this.rotation = this.velocity.ToRotation() + 1.570796f; - this.tileCollide = false; - } - - private void Resize(int newWidth, int newHeight) - { - this.position = this.Center; - this.width = newWidth; - this.height = newHeight; - this.Center = this.position; - } - public void AI() { - // ISSUE: The method is too long to display (70257 instructions) - } - - private void AI_184_BadTorchLuck() - { - this.owner = (int) byte.MaxValue; - if (Main.player[Main.myPlayer].unlockedBiomeTorches) - this.damage = 0; - if ((double) this.localAI[0] == 0.0) - { - this.localAI[0] = 1f; - SoundEngine.PlaySound(SoundID.Item8, this.Center); - } - if ((double) this.ai[1] > 0.0) - this.ai[1] -= this.velocity.Length(); - else - this.tileCollide = true; - int Type = (int) this.ai[0]; - float num1 = 4f; - for (float num2 = 0.0f; (double) num2 < (double) num1; ++num2) - { - int index = Dust.NewDust(this.position + this.velocity / num1 * num2, 4, 4, Type, Alpha: 100); - if (Main.rand.Next(3) != 0) - Main.dust[index].noGravity = true; - Main.dust[index].velocity *= 0.3f; - if (Type == 66) - { - Main.dust[index].color = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); - Main.dust[index].noGravity = true; - } - } - } - - private void AI_121_StardustDragon() - { - Player player = Main.player[this.owner]; - if ((int) Main.timeForVisualEffects % 120 == 0) - this.netUpdate = true; - if (!player.active) - { - this.active = false; - } - else - { - int num1 = this.type == 625 ? 1 : 0; - bool flag1 = this.type == 625 || this.type == 626 || this.type == 627 || this.type == 628; - int num2 = 10; - if (flag1) - { - if (player.dead) - player.stardustDragon = false; - if (player.stardustDragon) - this.timeLeft = 2; - num2 = 30; - if (Main.rand.Next(30) == 0) - { - int index = Dust.NewDust(this.position, this.width, this.height, 135, Scale: 2f); - Main.dust[index].noGravity = true; - Main.dust[index].fadeIn = 2f; - Point tileCoordinates = Main.dust[index].position.ToTileCoordinates(); - if (WorldGen.InWorld(tileCoordinates.X, tileCoordinates.Y, 5) && WorldGen.SolidTile(tileCoordinates.X, tileCoordinates.Y)) - Main.dust[index].noLight = true; - } - } - if (num1 != 0) - { - Vector2 center = player.Center; - float num3 = 700f; - float num4 = 1000f; - int index1 = -1; - if ((double) this.Distance(center) > 2000.0) - { - this.Center = center; - this.netUpdate = true; - } - if (true) - { - NPC minionAttackTargetNpc = this.OwnerMinionAttackTargetNPC; - if (minionAttackTargetNpc != null && minionAttackTargetNpc.CanBeChasedBy((object) this) && (double) this.Distance(minionAttackTargetNpc.Center) < (double) num3 * 2.0) - { - index1 = minionAttackTargetNpc.whoAmI; - if (minionAttackTargetNpc.boss) - { - int whoAmI1 = minionAttackTargetNpc.whoAmI; - } - else - { - int whoAmI2 = minionAttackTargetNpc.whoAmI; - } - } - if (index1 < 0) - { - for (int index2 = 0; index2 < 200; ++index2) - { - NPC npc = Main.npc[index2]; - if (npc.CanBeChasedBy((object) this) && (double) player.Distance(npc.Center) < (double) num4 && (double) this.Distance(npc.Center) < (double) num3) - { - index1 = index2; - int num5 = npc.boss ? 1 : 0; - } - } - } - } - if (index1 != -1) - { - NPC npc = Main.npc[index1]; - Vector2 vector2 = npc.Center - this.Center; - ((double) vector2.X > 0.0).ToDirectionInt(); - ((double) vector2.Y > 0.0).ToDirectionInt(); - float num6 = 0.4f; - if ((double) vector2.Length() < 600.0) - num6 = 0.6f; - if ((double) vector2.Length() < 300.0) - num6 = 0.8f; - if ((double) vector2.Length() > (double) npc.Size.Length() * 0.75) - { - this.velocity = this.velocity + Vector2.Normalize(vector2) * num6 * 1.5f; - if ((double) Vector2.Dot(this.velocity, vector2) < 0.25) - this.velocity = this.velocity * 0.8f; - } - float num7 = 30f; - if ((double) this.velocity.Length() > (double) num7) - this.velocity = Vector2.Normalize(this.velocity) * num7; - } - else - { - float num8 = 0.2f; - Vector2 vector2 = center - this.Center; - if ((double) vector2.Length() < 200.0) - num8 = 0.12f; - if ((double) vector2.Length() < 140.0) - num8 = 0.06f; - if ((double) vector2.Length() > 100.0) - { - if ((double) Math.Abs(center.X - this.Center.X) > 20.0) - this.velocity.X += num8 * (float) Math.Sign(center.X - this.Center.X); - if ((double) Math.Abs(center.Y - this.Center.Y) > 10.0) - this.velocity.Y += num8 * (float) Math.Sign(center.Y - this.Center.Y); - } - else if ((double) this.velocity.Length() > 2.0) - this.velocity = this.velocity * 0.96f; - if ((double) Math.Abs(this.velocity.Y) < 1.0) - this.velocity.Y -= 0.1f; - float num9 = 15f; - if ((double) this.velocity.Length() > (double) num9) - this.velocity = Vector2.Normalize(this.velocity) * num9; - } - this.rotation = this.velocity.ToRotation() + 1.570796f; - int direction1 = this.direction; - this.direction = this.spriteDirection = (double) this.velocity.X > 0.0 ? 1 : -1; - int direction2 = this.direction; - if (direction1 != direction2) - this.netUpdate = true; - float num10 = MathHelper.Clamp(this.localAI[0], 0.0f, 50f); - this.position = this.Center; - this.scale = (float) (1.0 + (double) num10 * 0.00999999977648258); - this.width = this.height = (int) ((double) num2 * (double) this.scale); - this.Center = this.position; - if (this.alpha > 0) - { - for (int index3 = 0; index3 < 2; ++index3) - { - int index4 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 135, Alpha: 100, Scale: 2f); - Main.dust[index4].noGravity = true; - Main.dust[index4].noLight = true; - } - this.alpha -= 42; - if (this.alpha < 0) - this.alpha = 0; - } - } - else - { - bool flag2 = false; - Vector2 vector2_1 = Vector2.Zero; - Vector2 zero = Vector2.Zero; - float num11 = 0.0f; - float num12 = 0.0f; - float num13 = 1f; - if ((double) this.ai[1] == 1.0) - { - this.ai[1] = 0.0f; - this.netUpdate = true; - } - int byUuid = Projectile.GetByUUID(this.owner, (int) this.ai[0]); - if (Main.projectile.IndexInRange(byUuid)) - { - Projectile projectile = Main.projectile[byUuid]; - if (flag1 && projectile.active && (projectile.type == 625 || projectile.type == 626 || projectile.type == 627)) - { - flag2 = true; - vector2_1 = projectile.Center; - Vector2 velocity = projectile.velocity; - num11 = projectile.rotation; - num13 = MathHelper.Clamp(projectile.scale, 0.0f, 50f); - num12 = 16f; - int alpha = projectile.alpha; - projectile.localAI[0] = this.localAI[0] + 1f; - if (projectile.type != 625) - projectile.localAI[1] = (float) this.whoAmI; - if (this.owner == Main.myPlayer && this.type == 628 && projectile.type == 625) - { - projectile.Kill(); - this.Kill(); - return; - } - } - } - if (!flag2) - { - for (int index = 0; index < 1000; ++index) - { - Projectile projectile = Main.projectile[index]; - if (projectile.active && projectile.owner == this.owner && ProjectileID.Sets.StardustDragon[projectile.type] && (double) projectile.localAI[1] == (double) this.ai[0]) - { - this.ai[0] = (float) projectile.projUUID; - projectile.localAI[1] = (float) this.whoAmI; - this.netUpdate = true; - } - } - return; - } - if (this.alpha > 0) - { - for (int index5 = 0; index5 < 2; ++index5) - { - int index6 = Dust.NewDust(this.position, this.width, this.height, 135, Alpha: 100, Scale: 2f); - Main.dust[index6].noGravity = true; - Main.dust[index6].noLight = true; - } - } - this.alpha -= 42; - if (this.alpha < 0) - this.alpha = 0; - this.velocity = Vector2.Zero; - Vector2 vector2_2 = vector2_1 - this.Center; - if ((double) num11 != (double) this.rotation) - { - float num14 = MathHelper.WrapAngle(num11 - this.rotation); - vector2_2 = vector2_2.RotatedBy((double) num14 * 0.100000001490116); - } - this.rotation = vector2_2.ToRotation() + 1.570796f; - this.position = this.Center; - this.scale = num13; - this.width = this.height = (int) ((double) num2 * (double) this.scale); - this.Center = this.position; - if (vector2_2 != Vector2.Zero) - this.Center = vector2_1 - Vector2.Normalize(vector2_2) * num12 * num13; - this.spriteDirection = (double) vector2_2.X > 0.0 ? 1 : -1; - } - this.position.X = MathHelper.Clamp(this.position.X, 160f, (float) (Main.maxTilesX * 16 - 160)); - this.position.Y = MathHelper.Clamp(this.position.Y, 160f, (float) (Main.maxTilesY * 16 - 160)); - } - } - - private Projectile FindStardustDragonHeadOfOwner() - { - for (int index = 0; index < 1000; ++index) - { - Projectile projectile = Main.projectile[index]; - if (projectile.active && projectile.owner == this.owner && projectile.type == 625) - return projectile; - } - return (Projectile) null; - } - - private void AI_183_ZoologistStrike() - { - this.velocity.X *= 0.2f; - this.velocity.Y = 0.0f; - this.spriteDirection = this.direction = 1; - if ((double) this.velocity.X < 0.0) - this.spriteDirection = this.direction = -1; - ++this.frame; - if (this.frame < Main.projFrames[this.type]) - return; - this.frame = Main.projFrames[this.type] - 1; - } - - private void AI_182_FinalFractal() - { - Player player = Main.player[this.owner]; - Vector2 mountedCenter = player.MountedCenter; - float lerpValue1 = Utils.GetLerpValue(900f, 0.0f, this.velocity.Length() * 2f, true); - this.localAI[0] += MathHelper.Lerp(0.7f, 2f, lerpValue1); - if ((double) this.localAI[0] >= 120.0) - { - this.Kill(); - } - else - { - float lerpValue2 = Utils.GetLerpValue(0.0f, 1f, this.localAI[0] / 60f, true); - double num1 = (double) this.localAI[0] / 60.0; - float num2 = this.ai[0]; - float rotation = this.velocity.ToRotation(); - float num3 = 3.141593f; - float num4 = (double) this.velocity.X > 0.0 ? 1f : -1f; - float num5 = num3 + (float) ((double) num4 * (double) lerpValue2 * 6.28318548202515); - float x = this.velocity.Length() + Utils.GetLerpValue(0.5f, 1f, lerpValue2, true) * 40f; - float num6 = 60f; - if ((double) x < (double) num6) - x = num6; - Vector2 vector2_1 = mountedCenter + this.velocity + (new Vector2(1f, 0.0f).RotatedBy((double) num5) * new Vector2(x, num2 * MathHelper.Lerp(2f, 1f, lerpValue1))).RotatedBy((double) rotation); - Vector2 vector2_2 = (1f - Utils.GetLerpValue(0.0f, 0.5f, lerpValue2, true)) * new Vector2((float) (((double) this.velocity.X > 0.0 ? 1.0 : -1.0) * -(double) x * 0.100000001490116), (float) (-(double) this.ai[0] * 0.300000011920929)); - this.rotation = num5 + rotation + 1.570796f; - this.Center = vector2_1 + vector2_2; - this.spriteDirection = this.direction = (double) this.velocity.X > 0.0 ? 1 : -1; - if ((double) num2 < 0.0) - { - this.rotation = num3 + (float) ((double) num4 * (double) lerpValue2 * -6.28318548202515) + rotation; - this.rotation += 1.570796f; - this.spriteDirection = this.direction = (double) this.velocity.X > 0.0 ? -1 : 1; - } - if (num1 < 1.0) - { - FinalFractalHelper.FinalFractalProfile finalFractalProfile = FinalFractalHelper.GetFinalFractalProfile((int) this.ai[1]); - Vector2 rotationVector2 = (this.rotation - 1.570796f).ToRotationVector2(); - Vector2 center = this.Center; - int num7 = (int) ((double) (1 + (int) ((double) this.velocity.Length() / 100.0)) * (double) Utils.GetLerpValue(0.0f, 0.5f, lerpValue2, true) * (double) Utils.GetLerpValue(1f, 0.5f, lerpValue2, true)); - if (num7 < 1) - num7 = 1; - for (int index = 0; index < num7; ++index) - finalFractalProfile.dustMethod(center + rotationVector2 * finalFractalProfile.trailWidth * MathHelper.Lerp(0.5f, 1f, Main.rand.NextFloat()), (float) ((double) this.rotation - 1.57079637050629 + 1.57079637050629 * (double) this.spriteDirection), player.velocity); - Vector3 vector3_1 = finalFractalProfile.trailColor.ToVector3(); - Vector3 vector3_2 = Vector3.Lerp(Vector3.One, vector3_1, 0.7f); - Lighting.AddLight(this.Center, vector3_1 * 0.5f * this.Opacity); - Lighting.AddLight(mountedCenter, vector3_2 * this.Opacity * 0.15f); - } - this.Opacity = Utils.GetLerpValue(0.0f, 5f, this.localAI[0], true) * Utils.GetLerpValue(120f, 115f, this.localAI[0], true); - } - } - - private void AI_181_FairyQueenRangedItemShot() - { - ++this.ai[0]; - this.alpha = (int) MathHelper.Lerp((float) byte.MaxValue, 0.0f, Utils.GetLerpValue(0.0f, 10f, this.ai[0], true)); - this.rotation = this.velocity.ToRotation(); - if (Main.rand.Next(6) != 0) - return; - Dust dust = Dust.NewDustPerfect(this.Center, 267); - dust.fadeIn = 1f; - dust.noGravity = true; - dust.alpha = 100; - dust.color = this.GetFairyQueenWeaponsColor(lerpToWhite: (Main.rand.NextFloat() * 0.4f)); - dust.noLightEmittence = true; - dust.scale *= 1.5f; - } - - private void AI_009_MagicMissiles() - { - if (this.type == 491) - { - this.AI_009_MagicMissiles_Old(); - } - else - { - int num1 = 32; - Player player = Main.player[this.owner]; - int num2 = Main.maxTilesY * 16; - int num3 = 0; - if ((double) this.ai[0] >= 0.0) - num3 = (int) ((double) this.ai[1] / (double) num2); - bool flag1 = (double) this.ai[0] == -1.0 || (double) this.ai[0] == -2.0; - if (this.type == 34) - { - if (this.frameCounter++ >= 4) - { - this.frameCounter = 0; - if (++this.frame >= Main.projFrames[this.type]) - this.frame = 0; - } - if (this.penetrate == 1 && (double) this.ai[0] >= 0.0 && num3 == 0) - { - this.ai[1] += (float) num2; - num3 = 1; - this.netUpdate = true; - } - if (this.penetrate == 1 && (double) this.ai[0] == -1.0) - { - this.ai[0] = -2f; - this.netUpdate = true; - } - if (num3 > 0 || (double) this.ai[0] == -2.0) - ++this.localAI[0]; - } - if (this.owner == Main.myPlayer) - { - if ((double) this.ai[0] >= 0.0) - { - if (player.channel) - { - Vector2 mouseWorld = Main.MouseWorld; - if ((double) this.ai[0] != (double) mouseWorld.X || (double) this.ai[1] != (double) mouseWorld.Y) - { - this.netUpdate = true; - this.ai[0] = mouseWorld.X; - this.ai[1] = mouseWorld.Y + (float) (num2 * num3); - } - } - else - { - this.netUpdate = true; - this.ai[0] = -1f; - this.ai[1] = -1f; - int targetWithLineOfSight = this.FindTargetWithLineOfSight(); - if (targetWithLineOfSight != -1) - this.ai[1] = (float) targetWithLineOfSight; - else if ((double) this.velocity.Length() < 2.0) - this.velocity = this.DirectionFrom(player.Center) * (float) num1; - else - this.velocity = this.velocity.SafeNormalize(Vector2.Zero) * (float) num1; - } - } - if (flag1 && (double) this.ai[1] == -1.0) - { - int targetWithLineOfSight = this.FindTargetWithLineOfSight(); - if (targetWithLineOfSight != -1) - { - this.ai[1] = (float) targetWithLineOfSight; - this.netUpdate = true; - } - } - } - Vector2? nullable = new Vector2?(); - float amount = 1f; - if ((double) this.ai[0] > 0.0 && (double) this.ai[1] > 0.0) - nullable = new Vector2?(new Vector2(this.ai[0], this.ai[1] % (float) num2)); - if (flag1 && (double) this.ai[1] >= 0.0) - { - int index = (int) this.ai[1]; - if (Main.npc.IndexInRange(index)) - { - NPC npc = Main.npc[index]; - if (npc.CanBeChasedBy((object) this)) - { - nullable = new Vector2?(npc.Center); - float t = this.Distance(nullable.Value); - amount = MathHelper.Lerp(0.0f, 0.2f, Utils.GetLerpValue(200f, 20f, 1f - Utils.GetLerpValue(0.0f, 100f, t, true) * Utils.GetLerpValue(600f, 400f, t, true), true)); - } - else - { - this.ai[1] = -1f; - this.netUpdate = true; - } - } - } - bool flag2 = false; - if (flag1) - flag2 = true; - if (nullable.HasValue) - { - Vector2 Other = nullable.Value; - if ((double) this.Distance(Other) >= 64.0) - { - flag2 = true; - Vector2 v = Other - this.Center; - Vector2 vector2 = v.SafeNormalize(Vector2.Zero) * Math.Min((float) num1, v.Length()); - if ((double) this.velocity.Length() < 4.0) - this.velocity = this.velocity + this.velocity.SafeNormalize(Vector2.Zero).RotatedBy(0.785398185253143).SafeNormalize(Vector2.Zero) * 4f; - if (this.velocity.HasNaNs()) - this.Kill(); - this.velocity = Vector2.Lerp(this.velocity, vector2, amount); - } - else - { - this.velocity = this.velocity * 0.3f; - this.velocity = this.velocity + (Other - this.Center) * 0.3f; - flag2 = (double) this.velocity.Length() >= 2.0; - } - if (this.timeLeft < 60) - this.timeLeft = 60; - } - if (flag1 && (double) this.ai[1] < 0.0) - { - if ((double) this.velocity.Length() != (double) num1) - this.velocity = this.velocity.MoveTowards(this.velocity.SafeNormalize(Vector2.UnitY) * (float) num1, 4f); - if (this.timeLeft > 300) - this.timeLeft = 300; - } - this.rotation = !flag2 || !(this.velocity != Vector2.Zero) ? this.rotation.AngleLerp(0.0f, 0.2f) : this.rotation.AngleTowards(this.velocity.ToRotation(), 0.7853982f); - bool flag3 = (double) this.velocity.Length() > 0.100000001490116 && (double) Vector2.Dot(this.oldVelocity.SafeNormalize(Vector2.Zero), this.velocity.SafeNormalize(Vector2.Zero)) < 0.200000002980232; - if (this.type == 16) - { - if (this.soundDelay == 0 && (double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) > 2.0) - { - this.soundDelay = 10; - SoundEngine.PlaySound(SoundID.Item9, this.position); - } - if (Main.rand.Next(9) == 0) - { - int index = Dust.NewDust(this.position, this.width, this.height, 15, Alpha: 100, Scale: 2f); - Main.dust[index].velocity *= 0.3f; - Main.dust[index].position.X = (float) ((double) this.position.X + (double) (this.width / 2) + 4.0) + (float) Main.rand.Next(-4, 5); - Main.dust[index].position.Y = this.position.Y + (float) (this.height / 2) + (float) Main.rand.Next(-4, 5); - Main.dust[index].noGravity = true; - Main.dust[index].velocity += Main.rand.NextVector2Circular(2f, 2f); - } - if (flag3) - { - int num4 = Main.rand.Next(2, 5); - for (int index = 0; index < num4; ++index) - { - Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 15, Alpha: 100, Scale: 1.5f); - dust.velocity *= 0.3f; - dust.position = this.Center; - dust.noGravity = true; - dust.velocity += Main.rand.NextVector2Circular(0.5f, 0.5f); - dust.fadeIn = 2.2f; - } - } - } - if (this.type != 34) - return; - float lerpValue = Utils.GetLerpValue(0.0f, 10f, this.localAI[0], true); - Color newColor = Color.Lerp(Color.Transparent, Color.Crimson, lerpValue); - if (Main.rand.Next(6) == 0) - { - Dust dust = Dust.NewDustDirect(this.Center, 0, 0, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, newColor, 3.5f); - dust.noGravity = true; - dust.velocity *= 1.4f; - dust.velocity += Main.rand.NextVector2Circular(1f, 1f); - dust.velocity += this.velocity * 0.15f; - } - if (Main.rand.Next(12) == 0) - { - Dust dust = Dust.NewDustDirect(this.Center, 0, 0, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, newColor, 1.5f); - dust.velocity += Main.rand.NextVector2Circular(1f, 1f); - dust.velocity += this.velocity * 0.15f; - } - if (!flag3) - return; - int num5 = Main.rand.Next(2, 5 + (int) ((double) lerpValue * 4.0)); - for (int index = 0; index < num5; ++index) - { - Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 6, Alpha: 100, newColor: newColor, Scale: 1.5f); - dust.velocity *= 0.3f; - dust.position = this.Center; - dust.noGravity = true; - dust.velocity += Main.rand.NextVector2Circular(0.5f, 0.5f); - dust.fadeIn = 2.2f; - dust.position += (dust.position - this.Center) * lerpValue * 10f; - } - } - } - - private void AI_009_MagicMissiles_Old() - { - if (Main.myPlayer == this.owner && (double) this.ai[0] <= 0.0) - { - if (Main.player[this.owner].channel) - { - float num1 = 12f; - if (this.type == 16) - num1 = 15f; - if (this.type == 491) - num1 = 20f; - Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); - float num2 = (float) Main.mouseX + Main.screenPosition.X - vector2.X; - float num3 = (float) Main.mouseY + Main.screenPosition.Y - vector2.Y; - if ((double) Main.player[this.owner].gravDir == -1.0) - num3 = Main.screenPosition.Y + (float) Main.screenHeight - (float) Main.mouseY - vector2.Y; - float num4 = (float) Math.Sqrt((double) num2 * (double) num2 + (double) num3 * (double) num3); - if ((double) this.ai[0] < 0.0) - ++this.ai[0]; - if (this.type == 491 && (double) num4 < 100.0) - { - if ((double) this.velocity.Length() < (double) num1) - { - this.velocity = this.velocity * 1.1f; - if ((double) this.velocity.Length() > (double) num1) - { - this.velocity.Normalize(); - this.velocity = this.velocity * num1; - } - } - if ((double) this.ai[0] == 0.0) - this.ai[0] = -10f; - } - else if ((double) num4 > (double) num1) - { - float num5 = num1 / num4; - float x = num2 * num5; - float y = num3 * num5; - int num6 = (int) ((double) x * 1000.0); - int num7 = (int) ((double) this.velocity.X * 1000.0); - int num8 = (int) ((double) y * 1000.0); - int num9 = (int) ((double) this.velocity.Y * 1000.0); - int num10 = num7; - if (num6 != num10 || num8 != num9) - this.netUpdate = true; - if (this.type == 491) - { - this.velocity = (this.velocity * 4f + new Vector2(x, y)) / 5f; - } - else - { - this.velocity.X = x; - this.velocity.Y = y; - } - } - else - { - int num11 = (int) ((double) num2 * 1000.0); - int num12 = (int) ((double) this.velocity.X * 1000.0); - int num13 = (int) ((double) num3 * 1000.0); - int num14 = (int) ((double) this.velocity.Y * 1000.0); - int num15 = num12; - if (num11 != num15 || num13 != num14) - this.netUpdate = true; - this.velocity.X = num2; - this.velocity.Y = num3; - } - } - else if ((double) this.ai[0] <= 0.0) - { - this.netUpdate = true; - if (this.type != 491) - { - Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); - float num16 = (float) Main.mouseX + Main.screenPosition.X - vector2.X; - float num17 = (float) Main.mouseY + Main.screenPosition.Y - vector2.Y; - if ((double) Main.player[this.owner].gravDir == -1.0) - num17 = Main.screenPosition.Y + (float) Main.screenHeight - (float) Main.mouseY - vector2.Y; - float num18 = (float) Math.Sqrt((double) num16 * (double) num16 + (double) num17 * (double) num17); - if ((double) num18 == 0.0 || (double) this.ai[0] < 0.0) - { - vector2 = new Vector2(Main.player[this.owner].position.X + (float) (Main.player[this.owner].width / 2), Main.player[this.owner].position.Y + (float) (Main.player[this.owner].height / 2)); - num16 = this.position.X + (float) this.width * 0.5f - vector2.X; - num17 = this.position.Y + (float) this.height * 0.5f - vector2.Y; - num18 = (float) Math.Sqrt((double) num16 * (double) num16 + (double) num17 * (double) num17); - } - float num19 = (float) (12.0 / (double) num18); - float num20 = num16 * num19; - float num21 = num17 * num19; - this.velocity.X = num20; - this.velocity.Y = num21; - if ((double) this.velocity.X == 0.0 && (double) this.velocity.Y == 0.0) - this.Kill(); - } - this.ai[0] = 1f; - } - } - bool flag = false; - if (this.type == 491) - { - ++this.localAI[0]; - if ((double) this.ai[0] > 0.0 && (double) this.localAI[0] > 15.0) - { - this.tileCollide = false; - Vector2 vector2 = Main.player[this.owner].Center - this.Center; - if ((double) vector2.Length() < 20.0) - this.Kill(); - vector2.Normalize(); - this.velocity = (this.velocity * 5f + vector2 * 25f) / 6f; - } - flag = true; - if ((double) this.ai[0] < 0.0 || (double) this.velocity.X == 0.0 && (double) this.velocity.Y == 0.0) - this.rotation += 0.3f; - else if ((double) this.ai[0] > 0.0) - this.rotation += 0.3f * (float) this.direction; - else - this.rotation = (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X) + 1.57f; - if ((double) Vector2.Distance(this.Center, Main.player[this.owner].Center) > 2000.0) - this.Kill(); - if (Main.rand.Next(2) == 0) - { - int Type; - switch (Main.rand.Next(3)) - { - case 0: - Type = 15; - break; - case 1: - Type = 57; - break; - default: - Type = 58; - break; - } - int index = Dust.NewDust(this.position, this.width, this.height, Type, this.velocity.X * 0.25f, this.velocity.Y * 0.25f, (int) byte.MaxValue, Scale: 0.7f); - Main.dust[index].velocity *= 0.25f; - Main.dust[index].position = (Main.dust[index].position + this.position) / 2f; - } - } - if (this.type == 79) - { - if (this.soundDelay == 0 && (double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) > 2.0) - { - this.soundDelay = 10; - SoundEngine.PlaySound(SoundID.Item9, this.position); - } - for (int index1 = 0; index1 < 1; ++index1) - { - int index2 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 66, Alpha: 100, newColor: new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), Scale: 2.5f); - Main.dust[index2].velocity *= 0.1f; - Main.dust[index2].velocity += this.velocity * 0.2f; - Main.dust[index2].position.X = (float) ((double) this.position.X + (double) (this.width / 2) + 4.0) + (float) Main.rand.Next(-2, 3); - Main.dust[index2].position.Y = this.position.Y + (float) (this.height / 2) + (float) Main.rand.Next(-2, 3); - Main.dust[index2].noGravity = true; - } - } - if (this.type == 16) - { - if (this.soundDelay == 0 && (double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) > 2.0) - { - this.soundDelay = 10; - SoundEngine.PlaySound(SoundID.Item9, this.position); - } - if (Main.rand.Next(9) == 0) - { - int index = Dust.NewDust(this.position, this.width, this.height, 15, Alpha: 100, Scale: 2f); - Main.dust[index].velocity *= 0.3f; - Main.dust[index].position.X = (float) ((double) this.position.X + (double) (this.width / 2) + 4.0) + (float) Main.rand.Next(-4, 5); - Main.dust[index].position.Y = this.position.Y + (float) (this.height / 2) + (float) Main.rand.Next(-4, 5); - Main.dust[index].noGravity = true; - Main.dust[index].velocity += Main.rand.NextVector2Circular(2f, 2f); - } - flag = true; - if (this.velocity != Vector2.Zero) - this.rotation = this.velocity.ToRotation(); - } - if (this.type == 34) - { - if (Main.rand.Next(12) == 0) - { - Dust dust = Dust.NewDustDirect(this.Center, 0, 0, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, Scale: 3.5f); - dust.noGravity = true; - dust.velocity *= 1.4f; - dust.velocity += Main.rand.NextVector2Circular(1f, 1f); - dust.velocity += this.velocity * 0.15f; - } - if (Main.rand.Next(24) == 0) - { - Dust dust = Dust.NewDustDirect(this.Center, 0, 0, 6, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 100, Scale: 1.5f); - dust.velocity += Main.rand.NextVector2Circular(1f, 1f); - dust.velocity += this.velocity * 0.15f; - } - flag = true; - if (this.velocity != Vector2.Zero) - this.rotation = this.velocity.ToRotation(); - } - if (!flag && this.velocity != Vector2.Zero) - this.rotation = (float) ((double) this.velocity.ToRotation() - 3.14159274101257 + 0.785398185253143); - if ((double) this.velocity.Y <= 16.0) - return; - this.velocity.Y = 16f; - } - - private void AI_015_HandleMovementCollision(ref Vector2 wetVelocity, ref Vector2 lastVelocity) - { - int num1 = 10; - int num2 = 0; - Vector2 velocity = this.velocity; - float num3 = 0.2f; - if ((double) this.ai[0] == 1.0 || (double) this.ai[0] == 5.0) - num3 = 0.4f; - if ((double) this.ai[0] == 6.0) - num3 = 0.0f; - if ((double) lastVelocity.X != (double) this.velocity.X) - { - if ((double) Math.Abs(lastVelocity.X) > 4.0) - num2 = 1; - this.velocity.X = -lastVelocity.X * num3; - ++this.localAI[0]; - } - if ((double) lastVelocity.Y != (double) this.velocity.Y) - { - if ((double) Math.Abs(lastVelocity.Y) > 4.0) - num2 = 1; - this.velocity.Y = -lastVelocity.Y * num3; - ++this.localAI[0]; - } - if ((double) this.ai[0] == 1.0) - { - this.ai[0] = 5f; - this.localNPCHitCooldown = num1; - this.netUpdate = true; - Point tileCoordinates1 = this.TopLeft.ToTileCoordinates(); - Point tileCoordinates2 = this.BottomRight.ToTileCoordinates(); - num2 = 2; - bool causedShockwaves; - this.CreateImpactExplosion(2, this.Center, ref tileCoordinates1, ref tileCoordinates2, this.width, out causedShockwaves); - this.CreateImpactExplosion2_FlailTileCollision(this.Center, causedShockwaves, velocity); - this.position = this.position - velocity; - } - if (num2 > 0) - { - this.netUpdate = true; - for (int index = 0; index < num2; ++index) - Collision.HitTiles(this.position, velocity, this.width, this.height); - SoundEngine.PlaySound(0, (int) this.position.X, (int) this.position.Y); - } - if (((double) this.ai[0] == 3.0 || (double) this.ai[0] == 0.0 || (double) this.ai[0] == 5.0 ? 1 : ((double) this.ai[0] == 6.0 ? 1 : 0)) == 0 && (double) this.localAI[0] >= 10.0) - { - this.ai[0] = 4f; - this.netUpdate = true; - } - if (!this.wet) - return; - wetVelocity = this.velocity; - } - - private void ResetLocalNPCHitImmunity() - { - for (int index = 0; index < 200; ++index) - this.localNPCImmunity[index] = 0; - } - - private void AI_015_Flails() - { - Player player = Main.player[this.owner]; - if (!player.active || player.dead || player.noItems || player.CCed || (double) Vector2.Distance(this.Center, player.Center) > 900.0) - this.Kill(); - else if (Main.myPlayer == this.owner && Main.mapFullscreen) - { - this.Kill(); - } - else - { - if (this.type == 948 && this.wet && !this.lavaWet) - { - this.type = 947; - this.netUpdate = true; - } - Vector2 mountedCenter = player.MountedCenter; - bool doFastThrowDust = false; - bool flag1 = true; - bool flag2 = false; - int num1 = 10; - float num2 = 24f; - float num3 = 800f; - float num4 = 3f; - float num5 = 16f; - float num6 = 6f; - float num7 = 48f; - float num8 = 1f; - float num9 = 14f; - int num10 = 60; - int num11 = 10; - int num12 = 20; - int num13 = 10; - int num14 = num1 + 5; - switch (this.type) - { - case 25: - num1 = 15; - num2 = 14f; - num5 = 10f; - num7 = 15f; - break; - case 26: - num1 = 15; - num2 = 16f; - num5 = 12f; - num7 = 16f; - break; - case 35: - num1 = 15; - num2 = 17f; - num5 = 14f; - num7 = 18f; - break; - case 63: - num1 = 13; - num2 = 21f; - num5 = 20f; - num7 = 24f; - num12 = 15; - break; - case 154: - num1 = 15; - num2 = 15f; - num5 = 11f; - num7 = 16f; - break; - case 247: - num1 = 13; - num2 = 23f; - num12 = 15; - break; - case 757: - num1 = 13; - num2 = 22f; - num5 = 22f; - num7 = 26f; - num12 = 15; - break; - case 947: - case 948: - num1 = 13; - num2 = 12f; - num5 = 8f; - num7 = 13f; - break; - } - float num15 = 1f / player.meleeSpeed; - float num16 = num2 * num15; - float maxAmountAllowedToMove1 = num8 * num15; - float maxAmountAllowedToMove2 = num9 * num15; - float maxAmountAllowedToMove3 = num4 * num15; - float num17 = num5 * num15; - float maxAmountAllowedToMove4 = num6 * num15; - float num18 = num7 * num15; - float num19 = num16 * (float) num1; - float num20 = num19 + 160f; - this.localNPCHitCooldown = num11; - switch ((int) this.ai[0]) - { - case 0: - flag2 = true; - if (this.owner == Main.myPlayer) - { - Vector2 vector2 = mountedCenter.DirectionTo(Main.MouseWorld).SafeNormalize(Vector2.UnitX * (float) player.direction); - player.ChangeDir((double) vector2.X > 0.0 ? 1 : -1); - if (!player.channel) - { - this.ai[0] = 1f; - this.ai[1] = 0.0f; - this.velocity = vector2 * num16 + player.velocity; - this.Center = mountedCenter; - this.netUpdate = true; - this.ResetLocalNPCHitImmunity(); - this.localNPCHitCooldown = num13; - break; - } - } - ++this.localAI[1]; - Vector2 vector2_1 = new Vector2((float) player.direction).RotatedBy(31.4159278869629 * ((double) this.localAI[1] / 60.0) * (double) player.direction); - vector2_1.Y *= 0.8f; - if ((double) vector2_1.Y * (double) player.gravDir > 0.0) - vector2_1.Y *= 0.5f; - this.Center = mountedCenter + vector2_1 * 30f; - this.velocity = Vector2.Zero; - this.localNPCHitCooldown = num12; - break; - case 1: - doFastThrowDust = true; - bool flag3 = (double) this.ai[1]++ >= (double) num1 | (double) this.Distance(mountedCenter) >= (double) num3; - if (player.controlUseItem) - { - this.ai[0] = 6f; - this.ai[1] = 0.0f; - this.netUpdate = true; - this.velocity = this.velocity * 0.2f; - if (Main.myPlayer == this.owner && this.type == 757) - { - Projectile.NewProjectile(this.Center, this.velocity, 928, this.damage, this.knockBack, Main.myPlayer); - break; - } - break; - } - if (flag3) - { - this.ai[0] = 2f; - this.ai[1] = 0.0f; - this.netUpdate = true; - this.velocity = this.velocity * 0.3f; - if (Main.myPlayer == this.owner && this.type == 757) - Projectile.NewProjectile(this.Center, this.velocity, 928, this.damage, this.knockBack, Main.myPlayer); - } - player.ChangeDir((double) player.Center.X < (double) this.Center.X ? 1 : -1); - this.localNPCHitCooldown = num13; - break; - case 2: - Vector2 vector2_2 = this.DirectionTo(mountedCenter).SafeNormalize(Vector2.Zero); - if ((double) this.Distance(mountedCenter) <= (double) num17) - { - this.Kill(); - return; - } - if (player.controlUseItem) - { - this.ai[0] = 6f; - this.ai[1] = 0.0f; - this.netUpdate = true; - this.velocity = this.velocity * 0.2f; - break; - } - this.velocity = this.velocity * 0.98f; - this.velocity = this.velocity.MoveTowards(vector2_2 * num17, maxAmountAllowedToMove3); - player.ChangeDir((double) player.Center.X < (double) this.Center.X ? 1 : -1); - break; - case 3: - if (!player.controlUseItem) - { - this.ai[0] = 4f; - this.ai[1] = 0.0f; - this.netUpdate = true; - break; - } - float num21 = this.Distance(mountedCenter); - this.tileCollide = (double) this.ai[1] == 1.0; - bool flag4 = (double) num21 <= (double) num19; - if (flag4 != this.tileCollide) - { - this.tileCollide = flag4; - this.ai[1] = this.tileCollide ? 1f : 0.0f; - this.netUpdate = true; - } - if ((double) num21 > (double) num10) - { - if ((double) num21 >= (double) num19) - { - this.velocity = this.velocity * 0.5f; - this.velocity = this.velocity.MoveTowards(this.DirectionTo(mountedCenter).SafeNormalize(Vector2.Zero) * maxAmountAllowedToMove2, maxAmountAllowedToMove2); - } - this.velocity = this.velocity * 0.98f; - this.velocity = this.velocity.MoveTowards(this.DirectionTo(mountedCenter).SafeNormalize(Vector2.Zero) * maxAmountAllowedToMove2, maxAmountAllowedToMove1); - } - else - { - if ((double) this.velocity.Length() < 6.0) - { - this.velocity.X *= 0.96f; - this.velocity.Y += 0.2f; - } - if ((double) player.velocity.X == 0.0) - this.velocity.X *= 0.96f; - } - player.ChangeDir((double) player.Center.X < (double) this.Center.X ? 1 : -1); - break; - case 4: - this.tileCollide = false; - Vector2 vector2_3 = this.DirectionTo(mountedCenter).SafeNormalize(Vector2.Zero); - if ((double) this.Distance(mountedCenter) <= (double) num18) - { - this.Kill(); - return; - } - this.velocity = this.velocity * 0.98f; - this.velocity = this.velocity.MoveTowards(vector2_3 * num18, maxAmountAllowedToMove4); - Vector2 Target = this.Center + this.velocity; - Vector2 vector2_4 = mountedCenter.DirectionFrom(Target).SafeNormalize(Vector2.Zero); - if ((double) Vector2.Dot(vector2_3, vector2_4) < 0.0) - { - this.Kill(); - return; - } - player.ChangeDir((double) player.Center.X < (double) this.Center.X ? 1 : -1); - break; - case 5: - if ((double) this.ai[1]++ >= (double) num14) - { - this.ai[0] = 6f; - this.ai[1] = 0.0f; - this.netUpdate = true; - break; - } - this.localNPCHitCooldown = num13; - this.velocity.Y += 0.6f; - this.velocity.X *= 0.95f; - player.ChangeDir((double) player.Center.X < (double) this.Center.X ? 1 : -1); - break; - case 6: - if (!player.controlUseItem || (double) this.Distance(mountedCenter) > (double) num20) - { - this.ai[0] = 4f; - this.ai[1] = 0.0f; - this.netUpdate = true; - break; - } - this.velocity.Y += 0.8f; - this.velocity.X *= 0.95f; - player.ChangeDir((double) player.Center.X < (double) this.Center.X ? 1 : -1); - break; - } - if (this.type == 247) - { - flag1 = false; - float num22 = (float) (((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y)) * 0.00999999977648258); - this.rotation += (double) this.velocity.X > 0.0 ? num22 : -num22; - if ((double) this.ai[0] == 0.0) - this.rotation += 0.418879f * (float) player.direction; - float num23 = 600f; - NPC npc1 = (NPC) null; - if (this.owner == Main.myPlayer) - { - ++this.localAI[0]; - if ((double) this.localAI[0] >= 20.0) - { - this.localAI[0] = 17f; - for (int index = 0; index < 200; ++index) - { - NPC npc2 = Main.npc[index]; - if (npc2.CanBeChasedBy((object) this)) - { - float num24 = this.Distance(npc2.Center); - if ((double) num24 < (double) num23 && Collision.CanHit(this.position, this.width, this.height, npc2.position, npc2.width, npc2.height)) - { - npc1 = npc2; - num23 = num24; - } - } - } - } - if (npc1 != null) - { - this.localAI[0] = 0.0f; - float num25 = 14f; - Vector2 center = this.Center; - Projectile.NewProjectile(center, center.DirectionTo(npc1.Center) * num25, 248, (int) ((double) this.damage / 1.5), this.knockBack / 2f, Main.myPlayer); - } - } - } - this.direction = (double) this.velocity.X > 0.0 ? 1 : -1; - this.spriteDirection = this.direction; - this.ownerHitCheck = flag2; - if (flag1) - { - if ((double) this.velocity.Length() > 1.0) - this.rotation = this.velocity.ToRotation() + this.velocity.X * 0.1f; - else - this.rotation += this.velocity.X * 0.1f; - } - this.timeLeft = 2; - player.heldProj = this.whoAmI; - player.SetDummyItemTime(2); - player.itemRotation = this.DirectionFrom(mountedCenter).ToRotation(); - if ((double) this.Center.X < (double) mountedCenter.X) - player.itemRotation += 3.141593f; - player.itemRotation = MathHelper.WrapAngle(player.itemRotation); - this.AI_015_Flails_Dust(doFastThrowDust); - } - } - - private void AI_015_HandleMovementCollision_Old( - ref Vector2 wetVelocity, - ref Vector2 lastVelocity) - { - bool flag = false; - if ((double) lastVelocity.X != (double) this.velocity.X) - { - if ((double) Math.Abs(lastVelocity.X) > 4.0) - flag = true; - this.position.X += this.velocity.X; - this.velocity.X = (float) (-(double) lastVelocity.X * 0.200000002980232); - } - if ((double) lastVelocity.Y != (double) this.velocity.Y) - { - if ((double) Math.Abs(lastVelocity.Y) > 4.0) - flag = true; - this.position.Y += this.velocity.Y; - this.velocity.Y = (float) (-(double) lastVelocity.Y * 0.200000002980232); - } - this.ai[0] = 1f; - if (flag) - { - this.netUpdate = true; - Collision.HitTiles(this.position, this.velocity, this.width, this.height); - SoundEngine.PlaySound(0, (int) this.position.X, (int) this.position.Y); - } - if (!this.wet) - return; - wetVelocity = this.velocity; - } - - private void AI_015_Flails_Old() - { - this.AI_015_Flails_Dust(false); - bool flag1 = Main.player[this.owner].dead; - if (!flag1) - flag1 = (double) (Main.player[this.owner].Center - this.Center).Length() > 2000.0; - if (flag1) - { - this.Kill(); - } - else - { - Main.player[this.owner].SetDummyItemTime(10); - if ((double) this.position.X + (double) (this.width / 2) > (double) Main.player[this.owner].position.X + (double) (Main.player[this.owner].width / 2)) - { - Main.player[this.owner].ChangeDir(1); - this.direction = 1; - } - else - { - Main.player[this.owner].ChangeDir(-1); - this.direction = -1; - } - Vector2 mountedCenter = Main.player[this.owner].MountedCenter; - Vector2 vector2_1 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); - float num1 = mountedCenter.X - vector2_1.X; - float num2 = mountedCenter.Y - vector2_1.Y; - float num3 = (float) Math.Sqrt((double) num1 * (double) num1 + (double) num2 * (double) num2); - if ((double) this.ai[0] == 0.0) - { - float num4 = 160f; - if (this.type == 63) - num4 *= 1.5f; - if (this.type == 247) - num4 *= 1.5f; - if (this.type == 757) - num4 *= 1.5f; - this.tileCollide = true; - if ((double) num3 > (double) num4) - { - this.ai[0] = 1f; - this.netUpdate = true; - } - else if (!Main.player[this.owner].channel) - { - if ((double) this.velocity.Y < 0.0) - this.velocity.Y *= 0.9f; - ++this.velocity.Y; - this.velocity.X *= 0.9f; - } - } - else if ((double) this.ai[0] == 1.0) - { - float meleeSpeed = Main.player[this.owner].meleeSpeed; - float num5 = 14f / meleeSpeed; - float num6 = 0.9f / meleeSpeed; - float num7 = 300f / meleeSpeed; - int num8 = 60; - if (this.type == 63) - { - num7 *= 1.5f; - num5 *= 1.5f; - num6 *= 1.5f; - } - if (this.type == 247) - { - num7 *= 1.5f; - num5 = 15.9f; - num6 *= 2f; - num8 = 100; - } - if (this.type == 757) - { - num7 *= 1.5f; - num5 = 15.9f; - num6 *= 2f; - num8 = 100; - } - double num9 = (double) Math.Abs(num1); - double num10 = (double) Math.Abs(num2); - if ((double) this.ai[1] == 1.0) - this.tileCollide = false; - if (!Main.player[this.owner].channel || (double) num3 > (double) num7 || !this.tileCollide) - { - this.ai[1] = 1f; - if (this.tileCollide) - this.netUpdate = true; - this.tileCollide = false; - if ((double) num3 < 20.0) - this.Kill(); - } - if (!this.tileCollide) - num6 *= 2f; - if ((double) num3 > (double) num8 || !this.tileCollide) - { - float num11 = num5 / num3; - num1 *= num11; - num2 *= num11; - Vector2 vector2_2 = new Vector2(this.velocity.X, this.velocity.Y); - float num12 = num1 - this.velocity.X; - float num13 = num2 - this.velocity.Y; - float num14 = (float) Math.Sqrt((double) num12 * (double) num12 + (double) num13 * (double) num13); - float num15 = num6 / num14; - float num16 = num12 * num15; - float num17 = num13 * num15; - this.velocity.X *= 0.98f; - this.velocity.Y *= 0.98f; - this.velocity.X += num16; - this.velocity.Y += num17; - } - else - { - if ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) < 6.0) - { - this.velocity.X *= 0.96f; - this.velocity.Y += 0.2f; - } - if ((double) Main.player[this.owner].velocity.X == 0.0) - this.velocity.X *= 0.96f; - } - } - if (this.type == 247) - { - if ((double) this.velocity.X < 0.0) - this.rotation -= (float) (((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y)) * 0.00999999977648258); - else - this.rotation += (float) (((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y)) * 0.00999999977648258); - float num18 = this.position.X; - float num19 = this.position.Y; - float num20 = 600f; - bool flag2 = false; - if (this.owner == Main.myPlayer) - { - ++this.localAI[1]; - if ((double) this.localAI[1] > 20.0) - { - this.localAI[1] = 20f; - for (int index = 0; index < 200; ++index) - { - if (Main.npc[index].CanBeChasedBy((object) this)) - { - float num21 = Main.npc[index].position.X + (float) (Main.npc[index].width / 2); - float num22 = Main.npc[index].position.Y + (float) (Main.npc[index].height / 2); - float num23 = Math.Abs(this.position.X + (float) (this.width / 2) - num21) + Math.Abs(this.position.Y + (float) (this.height / 2) - num22); - if ((double) num23 < (double) num20 && Collision.CanHit(this.position, this.width, this.height, Main.npc[index].position, Main.npc[index].width, Main.npc[index].height)) - { - num20 = num23; - num18 = num21; - num19 = num22; - flag2 = true; - } - } - } - } - } - if (!flag2) - return; - this.localAI[1] = 0.0f; - vector2_1 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); - float num24 = num18 - vector2_1.X; - float num25 = num19 - vector2_1.Y; - float num26 = (float) (14.0 / Math.Sqrt((double) num24 * (double) num24 + (double) num25 * (double) num25)); - float SpeedX = num24 * num26; - float SpeedY = num25 * num26; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, 248, (int) ((double) this.damage / 1.5), this.knockBack / 2f, Main.myPlayer); - } - else - this.rotation = (float) Math.Atan2((double) num2, (double) num1) - this.velocity.X * 0.1f; - } - } - - private void AI_015_Flails_Dust(bool doFastThrowDust) - { - if (this.type == 25) - { - int maxValue = 15; - if (doFastThrowDust) - maxValue = 1; - if (Main.rand.Next(maxValue) != 0) - return; - Dust.NewDust(this.position, this.width, this.height, 14, Alpha: 150, Scale: 1.3f); - } - else if (this.type == 757) - { - int maxValue1 = 4; - if ((double) this.velocity.Length() < 8.0) - maxValue1 = 10; - if (doFastThrowDust) - maxValue1 /= 2; - for (int index = 0; index < 2; ++index) - { - if (Main.rand.Next(maxValue1) == 0) - { - Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 5, Scale: 0.8f); - dust.velocity += this.velocity / 4f; - dust.fadeIn = 1.3f; - } - } - int maxValue2 = 40; - if (doFastThrowDust) - maxValue2 /= 2; - for (float num = 0.0f; (double) num < 1.0; num += 0.1f) - { - if (Main.rand.Next(maxValue2) == 0) - Dust.NewDustDirect(Vector2.Lerp(Main.player[this.owner].Center, this.Center, Main.rand.NextFloat()) + new Vector2(-8f), 16, 16, 5, Scale: 1.3f).velocity += this.velocity / 4f; - } - } - else if (this.type == 26) - { - int index = Dust.NewDust(this.position, this.width, this.height, 172, this.velocity.X * 0.4f, this.velocity.Y * 0.4f, 100, Scale: 1.5f); - Main.dust[index].noGravity = true; - Main.dust[index].velocity.X /= 2f; - Main.dust[index].velocity.Y /= 2f; - } - else if (this.type == 948 && !this.wet) - { - int index = Dust.NewDust(this.position, this.width, this.height, 6, this.velocity.X * 0.4f, this.velocity.Y * 0.4f, 100, Scale: 1.2f); - Main.dust[index].noGravity = true; - Main.dust[index].velocity.X *= 4f; - Main.dust[index].velocity.Y *= 4f; - Main.dust[index].velocity = (Main.dust[index].velocity + this.velocity) / 2f; - } - else if (this.type == 35) - { - int index = Dust.NewDust(this.position, this.width, this.height, 6, this.velocity.X * 0.4f, this.velocity.Y * 0.4f, 100, Scale: 3f); - Main.dust[index].noGravity = true; - Main.dust[index].velocity.X *= 2f; - Main.dust[index].velocity.Y *= 2f; - } - else - { - if (this.type != 154) - return; - int index = Dust.NewDust(this.position, this.width, this.height, 115, this.velocity.X * 0.4f, this.velocity.Y * 0.4f, 140, Scale: 1.5f); - Main.dust[index].noGravity = true; - Main.dust[index].velocity *= 0.25f; - } - } - - private void AI_100_Medusa() - { - Player player = Main.player[this.owner]; - Vector2 zero1 = Vector2.Zero; - if (this.type == 535) - { - zero1.X = (float) player.direction * 6f; - zero1.Y = player.gravDir * -14f; - bool flag1 = true; - bool flag2 = (double) this.ai[0] > 0.0; - if (!player.dead) - this.timeLeft = 3; - if ((double) this.ai[0] > 0.0) - --this.ai[0]; - if (flag2) - { - if (this.frame < 8) - this.frame = 8; - if (this.frame >= 12) - this.frame = 8; - ++this.frameCounter; - if (++this.frameCounter >= 5) - { - this.frameCounter = 0; - if (++this.frame >= 12) - this.frame = 8; - } - } - else if (++this.frameCounter >= 5) - { - this.frameCounter = 0; - if (++this.frame >= 8) - this.frame = 0; - } - Vector2 center1 = player.Center; - Vector2 vector2_1 = Main.screenPosition + new Vector2((float) Main.mouseX, (float) Main.mouseY) - center1; - if ((double) player.gravDir == -1.0) - vector2_1.Y = (float) (Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - center1.Y; - Vector2 vector2_2 = new Vector2((float) Math.Sign((double) vector2_1.X == 0.0 ? (float) player.direction : vector2_1.X), 0.0f); - if ((double) vector2_2.X != (double) this.velocity.X || (double) vector2_2.Y != (double) this.velocity.Y) - this.netUpdate = true; - this.velocity = vector2_2; - if (flag2 && this.soundDelay == 0) - SoundEngine.PlaySound(4, (int) this.position.X, (int) this.position.Y, 17); - this.soundDelay = flag2 ? 4 : 0; - if (Main.myPlayer == this.owner) - { - Vector2 Position2 = player.Center + new Vector2((float) (player.direction * 4), player.gravDir * 2f); - if (!player.channel) - { - this.Kill(); - return; - } - if ((!flag2 ? 1 : ((double) this.ai[0] % 15.0 == 0.0 ? 1 : 0)) != 0) - { - bool flag3 = false; - for (int index = 0; index < 200; ++index) - { - NPC npc = Main.npc[index]; - if (npc.active && (double) this.Distance(npc.Center) < 250.0 && npc.CanBeChasedBy((object) this) && Collision.CanHitLine(npc.position, npc.width, npc.height, Position2, 0, 0)) - { - flag3 = true; - break; - } - } - if (flag3) - { - if (!flag1 || player.CheckMana(player.inventory[player.selectedItem].mana, true)) - { - int damage = this.damage; - Vector2 center2 = this.Center; - int num1 = 0; - float num2 = 0.0f; - Projectile._medusaHeadTargetList.Clear(); - for (int index = 0; index < 200; ++index) - { - NPC npc = Main.npc[index]; - float num3 = this.Distance(npc.Center); - if (npc.active && (double) num3 < 250.0 && npc.CanBeChasedBy((object) this) && Collision.CanHitLine(npc.position, npc.width, npc.height, center2, 0, 0)) - Projectile._medusaHeadTargetList.Add(Tuple.Create(index, num3)); - } - Projectile._medusaHeadTargetList.Sort((IComparer>) Projectile._medusaTargetComparer); - for (int index1 = 0; index1 < Projectile._medusaHeadTargetList.Count && index1 < 3; ++index1) - { - Tuple medusaHeadTarget = Projectile._medusaHeadTargetList[index1]; - NPC npc = Main.npc[medusaHeadTarget.Item1]; - Vector2 v = npc.Center - center2; - num2 += v.ToRotation(); - ++num1; - int index2 = Projectile.NewProjectile(center2.X, center2.Y, v.X, v.Y, 536, 0, 0.0f, this.owner, (float) this.whoAmI); - Main.projectile[index2].Center = npc.Center; - Main.projectile[index2].damage = damage; - Main.projectile[index2].Damage(); - Main.projectile[index2].damage = 0; - Main.projectile[index2].Center = center2; - this.ai[0] = 180f; - } - float num4 = num1 == 0 ? (player.direction == 1 ? 0.0f : 3.141593f) : num2 / (float) num1; - for (int index = 0; index < 4; ++index) - { - Vector2 zero2 = Vector2.Zero; - Vector2 vector2_3 = Main.rand.Next(4) == 0 ? Vector2.UnitX.RotatedByRandom(6.28318548202515) * new Vector2(200f, 50f) * (float) ((double) Main.rand.NextFloat() * 0.699999988079071 + 0.300000011920929) : Vector2.UnitX.RotatedByRandom(3.14159274101257).RotatedBy((double) num4) * new Vector2(200f, 50f) * (float) ((double) Main.rand.NextFloat() * 0.699999988079071 + 0.300000011920929); - Projectile.NewProjectile(center2.X, center2.Y, vector2_3.X, vector2_3.Y, 536, 0, 0.0f, this.owner, (float) this.whoAmI); - } - this.ai[0] = 60f; - this.netUpdate = true; - } - } - } - } - Lighting.AddLight(this.Center, 0.9f, 0.75f, 0.1f); - } - this.rotation = (double) player.gravDir == 1.0 ? 0.0f : 3.141593f; - this.spriteDirection = this.direction; - this.timeLeft = 2; - Vector2 vector2_4 = Main.OffsetsPlayerOnhand[player.bodyFrame.Y / 56] * 2f; - if (player.direction != 1) - vector2_4.X = (float) player.bodyFrame.Width - vector2_4.X; - Vector2 vector2_5 = vector2_4 - (player.bodyFrame.Size() - new Vector2((float) player.width, 42f)) / 2f; - this.Center = (player.position + vector2_5 + zero1 - this.velocity).Floor(); - player.ChangeDir(this.direction); - player.heldProj = this.whoAmI; - player.SetDummyItemTime(2); - } - - private void AI_120_StardustGuardian() - { - Player player = Main.player[this.owner]; - if (!player.active) - { - this.active = false; - } - else - { - bool flag1 = this.type == 623; - Vector2 Other = player.Center; - float num1 = 100f; - float lookupRange = 500f; - float num2 = 500f; - float num3 = 100f; - bool flag2 = true; - if (flag1) - { - if (player.dead) - player.stardustGuardian = false; - if (player.stardustGuardian) - this.timeLeft = 2; - num1 = 150f; - Other.X -= (float) ((5 + player.width / 2) * player.direction); - Other.Y -= 25f; - Lighting.AddLight(this.Center, 0.9f, 0.9f, 0.7f); - if ((double) this.ai[0] != 3.0 && this.alpha == (int) byte.MaxValue) - { - this.alpha = 0; - for (int index1 = 0; index1 < 30; ++index1) - { - int index2 = Dust.NewDust(this.position, this.width, this.height, 135, Alpha: 200, Scale: 1.7f); - Main.dust[index2].noGravity = true; - Main.dust[index2].velocity *= 3f; - Main.dust[index2].shader = GameShaders.Armor.GetSecondaryShader(Main.player[this.owner].cPet, Main.player[this.owner]); - int index3 = Dust.NewDust(this.position, this.width, this.height, 135, Alpha: 100); - Main.dust[index3].velocity *= 2f; - Main.dust[index3].noGravity = true; - Main.dust[index3].fadeIn = 2.5f; - Main.dust[index3].shader = GameShaders.Armor.GetSecondaryShader(Main.player[this.owner].cPet, Main.player[this.owner]); - } - } - } - if ((double) this.ai[0] != 0.0) - { - Main.player[this.owner].tankPet = this.whoAmI; - Main.player[this.owner].tankPetReset = false; - } - if ((double) this.ai[0] == 0.0) - { - this.Center = Vector2.Lerp(this.Center, Other, 0.05f); - this.velocity = this.velocity * 0.5f; - this.direction = this.spriteDirection = player.direction; - if (flag1 && ++this.frameCounter >= 9) - { - this.frameCounter = 0; - if (++this.frame >= 8) - this.frame = 0; - } - int targetNPCIndex = -1; - float distanceToClosestTarget = lookupRange; - bool flag3 = flag2; - if (flag1 && (double) Math.Abs(this.Center.X - Other.X) > (double) num1 + 20.0) - flag3 = false; - if (flag3) - this.AI_120_StardustGuardian_FindTarget(lookupRange, ref targetNPCIndex, ref distanceToClosestTarget); - if (targetNPCIndex != -1) - { - NPC npc = Main.npc[targetNPCIndex]; - this.direction = this.spriteDirection = ((double) npc.Center.X > (double) this.Center.X).ToDirectionInt(); - float num4 = Math.Abs(Other.X - this.Center.X); - float num5 = Math.Abs(npc.Center.X - this.Center.X); - float num6 = Math.Abs(Other.Y - this.Center.Y); - float num7 = Math.Abs(npc.Center.Y - this.Bottom.Y); - float directionInt = (float) ((double) npc.Center.Y > (double) this.Bottom.Y).ToDirectionInt(); - if (((double) num4 < (double) num1 || ((double) Other.X - (double) this.Center.X) * (double) this.direction < 0.0) && (double) num5 > 20.0 && (double) num5 < (double) num1 - (double) num4 + 100.0) - this.velocity.X += 0.1f * (float) this.direction; - else - this.velocity.X *= 0.7f; - if (((double) num6 < (double) num3 || ((double) Other.Y - (double) this.Bottom.Y) * (double) directionInt < 0.0) && (double) num7 > 10.0 && (double) num7 < (double) num3 - (double) num6 + 10.0) - this.velocity.Y += 0.1f * directionInt; - else - this.velocity.Y *= 0.7f; - if (this.owner == Main.myPlayer && (double) num5 < (double) num2) - { - this.ai[0] = 2f; - this.ai[1] = (float) targetNPCIndex; - this.netUpdate = true; - } - } - } - else if ((double) this.ai[0] == 1.0) - { - if (player.HasMinionRestTarget) - { - Other = player.MinionRestTargetPoint; - } - else - { - this.ai[0] = 0.0f; - this.netUpdate = true; - } - int targetNPCIndex = -1; - float distanceToClosestTarget = lookupRange; - bool flag4 = true; - if (flag1 && (double) Math.Abs(this.Center.X - Other.X) > (double) num1 + 20.0) - flag4 = false; - if (flag4) - this.AI_120_StardustGuardian_FindTarget(lookupRange, ref targetNPCIndex, ref distanceToClosestTarget); - if (targetNPCIndex != -1) - { - NPC npc = Main.npc[targetNPCIndex]; - this.direction = this.spriteDirection = ((double) npc.Center.X > (double) this.Center.X).ToDirectionInt(); - float num8 = Math.Abs(Other.X - this.Center.X); - float num9 = Math.Abs(npc.Center.X - this.Center.X); - float num10 = Math.Abs(Other.Y - this.Center.Y); - float num11 = Math.Abs(npc.Center.Y - this.Bottom.Y); - float directionInt = (float) ((double) npc.Center.Y > (double) this.Bottom.Y).ToDirectionInt(); - if (((double) num8 < (double) num1 || ((double) Other.X - (double) this.Center.X) * (double) this.direction < 0.0) && (double) num9 > 20.0 && (double) num9 < (double) num1 - (double) num8 + 100.0) - this.velocity.X += 0.1f * (float) this.direction; - else - this.velocity.X *= 0.7f; - if (((double) num10 < (double) num3 || ((double) Other.Y - (double) this.Bottom.Y) * (double) directionInt < 0.0) && (double) num11 > 10.0 && (double) num11 < (double) num3 - (double) num10 + 10.0) - this.velocity.Y += 0.1f * directionInt; - else - this.velocity.Y *= 0.7f; - if (this.owner == Main.myPlayer && (double) num9 < (double) num2) - { - this.ai[0] = 2f; - this.ai[1] = (float) targetNPCIndex; - this.netUpdate = true; - } - } - else - { - if ((double) Math.Abs(Other.X - this.Center.X) > (double) num1 + 40.0) - { - this.ai[0] = 3f; - this.netUpdate = true; - } - else if ((double) Math.Abs(Other.X - this.Center.X) > 20.0) - { - this.direction = this.spriteDirection = ((double) Other.X > (double) this.Center.X).ToDirectionInt(); - this.velocity.X += 0.06f * (float) this.direction; - } - else - { - this.velocity.X *= 0.8f; - this.direction = this.spriteDirection = ((double) player.Center.X < (double) this.Center.X).ToDirectionInt(); - } - if ((double) Math.Abs(Other.Y - this.Center.Y) > (double) num3) - { - this.ai[0] = 3f; - this.netUpdate = true; - } - else if ((double) Math.Abs(Other.Y - this.Center.Y) > 10.0) - this.velocity.Y += 0.06f * (float) Math.Sign(Other.Y - this.Center.Y); - else - this.velocity.Y *= 0.8f; - } - if (flag1 && ++this.frameCounter >= 9) - { - this.frameCounter = 0; - if (++this.frame >= Main.projFrames[this.type] - 4) - this.frame = 0; - } - } - else if ((double) this.ai[0] == 2.0) - { - if (flag1) - { - int num12 = 3; - if (this.frame < 12) - this.frame = 12; - if (this.frame == 12 || this.frame == 13) - num12 = 8; - if (++this.frameCounter >= num12) - { - this.frameCounter = 0; - if (++this.frame >= 19) - this.frame = 14; - } - } - bool flag5 = false; - if (flag2) - flag5 = (double) this.Distance(player.Center) < (double) lookupRange; - NPC npc = (NPC) null; - int index = (int) this.ai[1]; - if (Main.npc.IndexInRange(index)) - { - npc = Main.npc[index]; - if (!npc.CanBeChasedBy((object) this) || (double) this.Distance(npc.Center) > (double) num2) - npc = (NPC) null; - } - if (!flag5 || npc == null) - { - this.ai[1] = 0.0f; - this.ai[0] = 0.0f; - this.netUpdate = true; - if (this.frame < 18) - this.frame = 18; - } - else - { - int num13 = (double) (npc.Center - player.Center).X > 1.0 ? 1 : -1; - Vector2 targetPosition = npc.Center + new Vector2((float) -num13 * (float) ((double) npc.width * 0.5 + 70.0), -10f) - this.Center; - float maxAmountAllowedToMove = 6f * Utils.Remap(targetPosition.Length(), 50f, 400f, 1f, 4f); - int num14 = 32; - this.velocity = this.velocity.MoveTowards(Vector2.Zero.MoveTowards(targetPosition, maxAmountAllowedToMove), (float) num14); - this.direction = this.spriteDirection = num13; - if ((double) this.localAI[0]++ >= 3.0) - { - this.localAI[0] = 0.0f; - int targetNPCIndex = -1; - float distanceToClosestTarget = -1f; - this.AI_120_StardustGuardian_FindTarget(lookupRange, ref targetNPCIndex, ref distanceToClosestTarget); - if (targetNPCIndex != -1) - { - this.ai[1] = (float) targetNPCIndex; - this.netUpdate = true; - } - } - } - } - else - { - double num15 = (double) this.ai[0]; - } - if ((double) this.ai[0] != 3.0) - return; - if (player.HasMinionRestTarget) - { - Other = player.MinionRestTargetPoint; - } - else - { - this.ai[0] = 0.0f; - this.netUpdate = true; - } - if (this.alpha == 0) - { - this.alpha = (int) byte.MaxValue; - for (int index4 = 0; index4 < 30; ++index4) - { - int index5 = Dust.NewDust(this.position, this.width, this.height, 135, Alpha: 200, Scale: 1.7f); - Main.dust[index5].noGravity = true; - Main.dust[index5].velocity *= 3f; - Main.dust[index5].shader = GameShaders.Armor.GetSecondaryShader(Main.player[this.owner].cPet, Main.player[this.owner]); - int index6 = Dust.NewDust(this.position, this.width, this.height, 135, Alpha: 100); - Main.dust[index6].velocity *= 2f; - Main.dust[index6].noGravity = true; - Main.dust[index6].fadeIn = 2.5f; - Main.dust[index6].shader = GameShaders.Armor.GetSecondaryShader(Main.player[this.owner].cPet, Main.player[this.owner]); - } - } - else - { - for (int index7 = 0; index7 < 2; ++index7) - { - int index8 = Dust.NewDust(this.position, this.width, this.height, 135, Alpha: 200, Scale: 1.7f); - Main.dust[index8].noGravity = true; - Main.dust[index8].velocity *= 3f; - Main.dust[index8].noLight = true; - Main.dust[index8].shader = GameShaders.Armor.GetSecondaryShader(Main.player[this.owner].cPet, Main.player[this.owner]); - int index9 = Dust.NewDust(this.position, this.width, this.height, 135, Alpha: 100); - Main.dust[index9].velocity *= 2f; - Main.dust[index9].noGravity = true; - Main.dust[index9].fadeIn = 2.5f; - Main.dust[index9].noLight = true; - Main.dust[index9].shader = GameShaders.Armor.GetSecondaryShader(Main.player[this.owner].cPet, Main.player[this.owner]); - } - } - this.velocity = this.velocity * 0.7f; - this.Center = Vector2.Lerp(this.Center, Other, 0.2f); - if ((double) this.Distance(Other) >= 10.0) - return; - this.ai[0] = 1f; - this.netUpdate = true; - } - } - - private void AI_120_StardustGuardian_FindTarget( - float lookupRange, - ref int targetNPCIndex, - ref float distanceToClosestTarget) - { - Vector2 center = Main.player[this.owner].Center; - for (int index = 0; index < 200; ++index) - { - NPC npc = Main.npc[index]; - if (npc.CanBeChasedBy((object) this)) - { - float num = center.Distance(npc.Center); - if ((double) num < (double) lookupRange) - { - targetNPCIndex = index; - distanceToClosestTarget = num; - lookupRange = num; - } - } - } - } - - private void AI_180_FairyQueenSunDance() - { - if ((double) this.localAI[0] == 0.0) - SoundEngine.PlaySound(SoundID.Item159, this.Center); - ++this.localAI[0]; - float num1 = 180f; - double num2 = (double) this.ai[0] / 6.28318548202515; - float num3 = 0.3490659f; - if ((double) this.localAI[0] >= (double) num1) - { - this.Kill(); - } - else - { - this.alpha -= 15; - if (this.alpha < 0) - this.alpha = 0; - this.scale = Utils.GetLerpValue(0.0f, 20f, this.localAI[0], true) * Utils.GetLerpValue(num1, num1 - 60f, this.localAI[0], true); - this.rotation = this.ai[0] + Utils.GetLerpValue(50f, num1, this.localAI[0], true) * num3; - int index = (int) this.ai[1]; - if (Main.npc.IndexInRange(index)) - { - NPC npc = Main.npc[index]; - if (npc.active && npc.type == 636) - this.Center = npc.Center; - this.velocity = Vector2.Zero; - Vector2 rotationVector2 = this.rotation.ToRotationVector2(); - Vector3 vector3 = Main.hslToRgb((float) (((double) this.ai[0] / 6.28318548202515 + (double) this.localAI[0] / (double) num1) % 1.0), 1f, 0.85f).ToVector3() * this.scale; - float num4 = 800f * this.scale; - DelegateMethods.v3_1 = vector3; - for (float num5 = 0.0f; (double) num5 <= 1.0; num5 += 0.08333334f) - { - Point tileCoordinates = (this.Center + rotationVector2 * num4 * num5).ToTileCoordinates(); - DelegateMethods.CastLightOpen(tileCoordinates.X, tileCoordinates.Y); - } - } - else - this.Kill(); - } - } - - private void AI_179_FairyQueenLance() - { - ++this.localAI[0]; - if ((double) this.localAI[0] >= 60.0) - { - this.velocity = this.ai[0].ToRotationVector2() * 40f; - if (Main.rand.Next(3) == 0) - { - Dust dust = Dust.NewDustPerfect(this.Center, 267); - dust.fadeIn = 1f; - dust.noGravity = true; - dust.alpha = 100; - dust.color = Color.Lerp(this.AI_171_GetColor(), Color.White, Main.rand.NextFloat() * 0.4f); - dust.noLightEmittence = true; - dust.scale *= 1.5f; - } - } - if ((double) this.localAI[0] >= 360.0) - { - this.Kill(); - } - else - { - this.alpha = (int) MathHelper.Lerp((float) byte.MaxValue, 0.0f, Utils.GetLerpValue(0.0f, 20f, this.localAI[0], true)); - this.rotation = this.ai[0]; - } - } - - private void AI_176_EdgyLightning() - { - int index = (int) this.ai[0] - 1; - if (index != -1 && (!Main.npc[index].CanBeChasedBy((object) this) || this.localNPCImmunity[index] != 0)) - { - this.ai[0] = 0.0f; - index = -1; - } - if (index == -1) - { - NPC targetWithinRange = this.FindTargetWithinRange(400f); - if (targetWithinRange != null) - { - index = targetWithinRange.whoAmI; - this.ai[0] = (float) (index + 1); - this.netUpdate = true; - } - } - if (index != -1) - { - Vector2 vec = this.DirectionTo(Main.npc[index].Center); - if (vec.HasNaNs()) - { - this.Kill(); - } - else - { - this.velocity = vec * 10f; - this.rotation = this.velocity.ToRotation(); - if (++this.frameCounter < 3) - return; - this.frameCounter = 0; - this.frame = Main.rand.Next(Main.projFrames[this.type]); - } - } - else - this.Kill(); - } - - private NPC FindTargetWithinRange(float maxRange) - { - NPC npc1 = (NPC) null; - float num1 = maxRange; - for (int index = 0; index < 200; ++index) - { - NPC npc2 = Main.npc[index]; - if (npc2.CanBeChasedBy((object) this) && this.localNPCImmunity[index] == 0) - { - float num2 = this.Distance(npc2.Center); - if ((double) num1 > (double) num2) - { - num1 = num2; - npc1 = npc2; - } - } - } - return npc1; - } - - private void AI_177_IceWhipSlicer() - { - Player player = Main.player[this.owner]; - if (!player.active || player.dead) - { - player.coolWhipBuff = false; - this.Kill(); - } - else - { - if (player.coolWhipBuff) - this.timeLeft = 2; - int index = (int) this.ai[0] - 1; - if (index != -1 && (!Main.npc[index].CanBeChasedBy((object) this) || this.localNPCImmunity[index] > 0)) - { - this.ai[0] = 0.0f; - index = -1; - } - if (index == -1) - { - NPC targetWithinRange = this.FindTargetWithinRange(400f); - if (targetWithinRange != null) - { - index = targetWithinRange.whoAmI; - this.ai[0] = (float) (index + 1); - this.netUpdate = true; - } - } - float num1 = 8f; - float amount = 0.3f; - if (index != -1) - { - NPC npc = Main.npc[index]; - float num2 = this.Distance(npc.Center); - if ((double) num1 > (double) num2) - num1 = num2; - Vector2 vec = this.DirectionTo(npc.Center); - if (!vec.HasNaNs()) - this.velocity = Vector2.Lerp(this.velocity, vec * num1, amount); - } - else - this.velocity = this.velocity * 0.92f; - this.rotation += (float) (0.0209439527243376 + (double) Math.Abs(this.velocity.X) * 0.200000002980232); - if (Main.rand.Next(3) != 0) - return; - Dust dust = Dust.NewDustDirect(this.Center, 0, 0, 43, this.velocity.X, this.velocity.Y, 254, Color.White, 0.5f); - Vector2 vector2 = Main.rand.NextVector2Circular(1f, 1f); - dust.position = this.Center + vector2 * 10f; - dust.velocity = vector2; - } - } - - private void AI_178_FireExplosion() - { - if ((double) this.localAI[0] == 0.0) - { - SoundEngine.PlaySound(SoundID.Item14, this.position); - for (int index1 = 0; index1 < 4; ++index1) - { - int index2 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); - Main.dust[index2].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; - } - for (int index3 = 0; index3 < 30; ++index3) - { - int index4 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 200, Scale: 3.7f); - Main.dust[index4].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; - Main.dust[index4].noGravity = true; - Main.dust[index4].velocity *= 3f; - int index5 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 1.5f); - Main.dust[index5].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; - Main.dust[index5].velocity *= 2f; - Main.dust[index5].noGravity = true; - Main.dust[index5].fadeIn = 2.5f; - } - for (int index6 = 0; index6 < 10; ++index6) - { - int index7 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Scale: 2.7f); - Main.dust[index7].position = this.Center + Vector2.UnitX.RotatedByRandom(3.14159274101257).RotatedBy((double) this.velocity.ToRotation()) * (float) this.width / 2f; - Main.dust[index7].noGravity = true; - Main.dust[index7].velocity *= 3f; - } - for (int index8 = 0; index8 < 10; ++index8) - { - int index9 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Scale: 1.5f); - Main.dust[index9].position = this.Center + Vector2.UnitX.RotatedByRandom(3.14159274101257).RotatedBy((double) this.velocity.ToRotation()) * (float) this.width / 2f; - Main.dust[index9].noGravity = true; - Main.dust[index9].velocity *= 3f; - } - for (int index10 = 0; index10 < 2; ++index10) - { - int index11 = Gore.NewGore(this.position + new Vector2((float) (this.width * Main.rand.Next(100)) / 100f, (float) (this.height * Main.rand.Next(100)) / 100f) - Vector2.One * 10f, new Vector2(), Main.rand.Next(61, 64)); - Main.gore[index11].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; - Main.gore[index11].velocity *= 0.3f; - Main.gore[index11].velocity.X += (float) Main.rand.Next(-10, 11) * 0.05f; - Main.gore[index11].velocity.Y += (float) Main.rand.Next(-10, 11) * 0.05f; - } - } - ++this.localAI[0]; - if ((double) this.localAI[0] < 10.0) - return; - this.Kill(); - } - - private void AI_175_TitaniumStormShards() - { - Player player = Main.player[this.owner]; - if (!player.active || player.dead || !player.hasTitaniumStormBuff) - { - this.Kill(); - } - else - { - if (this.frameCounter == 0) - { - this.frameCounter = 1; - this.frame = Main.rand.Next(12); - this.rotation = Main.rand.NextFloat() * 6.283185f; - } - this.rotation += (float) Math.PI / 200f; - int index; - int totalIndexesInGroup; - this.AI_GetMyGroupIndexAndFillBlackList((List) null, out index, out totalIndexesInGroup); - double num1 = ((double) index / (double) totalIndexesInGroup + (double) player.miscCounterNormalized * 6.0) * 6.28318548202515; - float num2 = (float) (24.0 + (double) totalIndexesInGroup * 6.0); - this.Center = this.Center + (player.position - player.oldPosition); - Vector2 rotationVector2 = ((float) num1).ToRotationVector2(); - this.localAI[0] = rotationVector2.Y; - this.Center = Vector2.Lerp(this.Center, player.Center + rotationVector2 * new Vector2(1f, 0.05f) * num2, 0.3f); - } - } - - private void AI_174_MultisegmentPet() - { - Player player = Main.player[this.owner]; - if (!player.active) - { - this.active = false; - } - else - { - if (this.type == 883) - { - if (player.dead) - player.petFlagEaterOfWorldsPet = false; - if (player.petFlagEaterOfWorldsPet) - this.timeLeft = 2; - } - if (this.type == 887) - { - if (player.dead) - player.petFlagDestroyerPet = false; - if (player.petFlagDestroyerPet) - this.timeLeft = 2; - } - if (this.type == 893) - { - if (player.dead) - player.petFlagLunaticCultistPet = false; - if (player.petFlagLunaticCultistPet) - this.timeLeft = 2; - } - Vector2 center = player.Center; - if ((double) this.Distance(center) > 2000.0) - { - this.Center = center; - this.velocity = Vector2.Zero; - this.netUpdate = true; - } - float num1 = (center - this.Center).Length(); - float num2 = Math.Min(12f, Math.Max(4f, player.velocity.Length())); - double num3 = (double) this.velocity.Length(); - if (this.velocity == Vector2.Zero) - { - this.velocity.X = 2f * (float) player.direction; - Vector2 position = this.position; - for (int index = 0; index < this.oldPos.Length; ++index) - { - position -= this.velocity; - this.oldPos[index] = position; - } - } - if ((double) num1 >= 120.0) - { - float targetAngle = this.AngleTo(center); - this.velocity = this.velocity.ToRotation().AngleTowards(targetAngle, MathHelper.ToRadians(5f)).ToRotationVector2() * num2; - } - if ((double) this.velocity.Length() > (double) num2) - this.velocity = this.velocity.SafeNormalize(Vector2.Zero) * num2; - if ((double) Math.Abs(this.velocity.Y) < 1.0) - this.velocity.Y -= 0.1f; - this.rotation = this.velocity.ToRotation() + 1.570796f; - int direction1 = this.direction; - this.direction = this.spriteDirection = (double) this.velocity.X > 0.0 ? 1 : -1; - int direction2 = this.direction; - if (direction1 != direction2) - this.netUpdate = true; - this.position.X = MathHelper.Clamp(this.position.X, 160f, (float) (Main.maxTilesX * 16 - 160)); - this.position.Y = MathHelper.Clamp(this.position.Y, 160f, (float) (Main.maxTilesY * 16 - 160)); - } - } - - private void AI_173_HallowBossRainbowTrail() - { - this.Opacity = Utils.GetLerpValue(0.0f, 60f, (float) this.timeLeft, true) * Utils.GetLerpValue(660f, 600f, (float) this.timeLeft, true); - float num1 = (float) Math.PI / 360f; - float num2 = 30f; - this.velocity = this.velocity.RotatedBy((double) this.ai[0]); - if ((double) this.ai[0] < (double) num1) - this.ai[0] += num1 / num2; - this.rotation = this.velocity.ToRotation() + 1.570796f; - } - - public Color AI_173_GetColor() - { - if (!NPC.ShouldEmpressBeEnraged()) - return Main.hslToRgb((float) (((double) this.ai[1] + 0.0) % 1.0), 1f, 0.5f) * this.Opacity; - float lerpValue = Utils.GetLerpValue(0.0f, 60f, (float) (int) Main.time, true); - return Color.Lerp(Color.White, Main.OurFavoriteColor, lerpValue) * this.Opacity; - } - - private void AI_171_HallowBossRainbowStreak() - { - bool flag1 = false; - bool flag2 = false; - float from = 140f; - float num1 = 30f; - float num2 = 0.98f; - float num3 = 0.05f; - float num4 = 0.1f; - float num5 = 30f; - if (this.type == 931) - { - from = 180f; - num1 = 20f; - num5 = 30f; - num2 = 0.97f; - num3 = 0.075f; - num4 = 0.125f; - if (this.timeLeft == 238) - { - int alpha = this.alpha; - this.alpha = 0; - Color queenWeaponsColor = this.GetFairyQueenWeaponsColor(); - this.alpha = alpha; - for (int index = 0; index < 3; ++index) - { - Dust dust = Dust.NewDustPerfect(this.Center, 267, new Vector2?(Main.rand.NextVector2CircularEdge(3f, 3f) * (float) ((double) Main.rand.NextFloat() * 0.5 + 0.5)), newColor: queenWeaponsColor); - dust.scale *= 1.2f; - dust.noGravity = true; - } - } - } - if ((double) this.timeLeft > (double) from) - flag1 = true; - else if ((double) this.timeLeft > (double) num1) - flag2 = true; - if (flag1) - { - float num6 = (float) Math.Cos((double) this.whoAmI % 6.0 / 6.0 + (double) this.position.X / 320.0 + (double) this.position.Y / 160.0); - this.velocity = this.velocity * num2; - this.velocity = this.velocity.RotatedBy((double) num6 * 6.28318548202515 * 0.125 * 1.0 / 30.0); - } - if (this.friendly) - { - int index = (int) this.ai[0]; - if (Main.npc.IndexInRange(index) && !Main.npc[index].CanBeChasedBy((object) this)) - { - index = -1; - this.ai[0] = -1f; - this.netUpdate = true; - } - if (index == -1) - { - int targetWithLineOfSight = this.FindTargetWithLineOfSight(); - if (targetWithLineOfSight != -1) - { - this.ai[0] = (float) targetWithLineOfSight; - this.netUpdate = true; - } - } - } - if (flag2) - { - int index = (int) this.ai[0]; - Vector2 vector2 = this.velocity; - if (this.hostile && Main.player.IndexInRange(index)) - vector2 = this.DirectionTo(Main.player[index].Center) * num5; - if (this.friendly) - { - if (Main.npc.IndexInRange(index)) - vector2 = this.DirectionTo(Main.npc[index].Center) * num5; - else - this.timeLeft -= 2; - } - float amount = MathHelper.Lerp(num3, num4, Utils.GetLerpValue(from, 30f, (float) this.timeLeft, true)); - this.velocity = Vector2.SmoothStep(this.velocity, vector2, amount); - if (this.type == 931) - this.velocity = this.velocity * MathHelper.Lerp(0.85f, 1f, Utils.GetLerpValue(0.0f, 90f, (float) this.timeLeft, true)); - } - this.Opacity = Utils.GetLerpValue(240f, 220f, (float) this.timeLeft, true); - this.rotation = this.velocity.ToRotation() + 1.570796f; - } - - public Color AI_171_GetColor() - { - if (!NPC.ShouldEmpressBeEnraged()) - return Main.hslToRgb((float) (((double) this.ai[1] + 0.5) % 1.0), 1f, 0.5f) * this.Opacity; - float lerpValue = Utils.GetLerpValue(0.0f, 60f, (float) (int) Main.time, true); - return Color.Lerp(Color.White, Main.OurFavoriteColor, lerpValue) * this.Opacity; - } - - private void AI_172_HallowBossRainbowPelletStorm() - { - if ((double) this.localAI[1] <= 90.0) - { - ++this.localAI[1]; - this.scale = 0.5f; - this.Opacity = 0.5f; - float lerpValue = Utils.GetLerpValue(0.0f, 90f, this.localAI[1], false); - this.scale = MathHelper.Lerp(5f, 1f, lerpValue); - this.Opacity = (float) (1.0 - (1.0 - (double) lerpValue * (double) lerpValue)); - } - else - { - this.scale = 1f; - this.Opacity = 1f; - float num = (float) (150.0 + 10.0 * (double) this.AI_172_GetPelletStormsCount()); - ++this.localAI[0]; - if ((double) this.localAI[0] >= (double) num) - { - this.Kill(); - } - else - { - this.velocity = Vector2.Zero; - this.rotation = 0.0f; - int pelletStormsCount = this.AI_172_GetPelletStormsCount(); - for (int stormIndex = 0; stormIndex < pelletStormsCount; ++stormIndex) - { - Projectile.HallowBossPelletStormInfo pelletStormInfo = this.AI_172_GetPelletStormInfo(stormIndex); - for (int bulletIndex = 0; bulletIndex < pelletStormInfo.BulletsInStorm; ++bulletIndex) - { - if (pelletStormInfo.IsValid(bulletIndex)) - pelletStormInfo.GetBulletPosition(bulletIndex, this.Center); - } - } - } - } - } - - public int AI_172_GetPelletStormsCount() => 6; - - public Projectile.HallowBossPelletStormInfo AI_172_GetPelletStormInfo(int stormIndex) - { - float from = (float) (0.0 + (double) stormIndex * 10.0); - float to = (float) (90.0 + (double) stormIndex * 10.0); - return new Projectile.HallowBossPelletStormInfo() - { - StartAngle = (float) ((double) stormIndex * 1.04719758033752 - 1.57079637050629 + (double) stormIndex * 0.628318548202515), - AnglePerBullet = 2.094395f, - BulletsInStorm = 3, - BulletsProgressInStormStartNormalized = Utils.GetLerpValue(from, to, this.localAI[0], false), - BulletsProgressInStormBonusByIndexNormalized = 0.0f, - StormTotalRange = 500f, - BulletSize = new Vector2(16f, 16f) - }; - } - - private int FindTargetWithLineOfSight(float maxRange = 800f) - { - float num1 = maxRange; - int num2 = -1; - for (int index = 0; index < 200; ++index) - { - NPC npc = Main.npc[index]; - bool flag = npc.CanBeChasedBy((object) this); - if (this.localNPCImmunity[index] != 0) - flag = false; - if (flag) - { - float num3 = this.Distance(Main.npc[index].Center); - if ((double) num3 < (double) num1 && Collision.CanHit(this.position, this.width, this.height, npc.position, npc.width, npc.height)) - { - num1 = num3; - num2 = index; - } - } - } - return num2; - } - - private void AI_170_FairyGlowstick() - { - Point tileCoordinates = this.Center.ToTileCoordinates(); - Vector2 vector2_1 = tileCoordinates.ToVector2(); - int num1 = 10; - Vector2 zero = Vector2.Zero; - int num2 = 0; - float num3 = 3f; - if ((double) this.ai[1] == 1.0) - { - SoundEngine.PlaySound(SoundID.Item28, this.position); - this.rotation = 0.0f; - this.velocity.X = 0.0f; - this.ai[1] = 2f; - } - ++this.frameCounter; - if (this.frameCounter > 4) - { - this.frameCounter = 0; - ++this.frame; - if (this.frame >= Main.projFrames[this.type]) - this.frame = 0; - } - if ((double) this.velocity.Length() > 1.0 && this.timeLeft % 10 == 0) - { - for (int i = tileCoordinates.X - num1; i < tileCoordinates.X + num1 + 1; ++i) - { - for (int j = tileCoordinates.Y - num1; j < tileCoordinates.Y + num1 + 1; ++j) - { - if (WorldGen.SolidTile(i, j)) - { - Vector2 v = vector2_1 - new Vector2((float) i, (float) j); - Vector2 vector2_2 = v.SafeNormalize(Vector2.Zero) * Math.Max((float) num1 - v.Length(), 0.0f) * num3; - zero += vector2_2; - ++num2; - } - } - } - if (num2 > 0) - zero /= (float) num2; - if ((double) zero.Length() > 1.0) - this.velocity = zero; - } - this.velocity = this.velocity * 0.95f; - if ((double) this.velocity.Length() >= 1.0) - return; - this.velocity = Vector2.Zero; - this.netUpdate = true; - } - - private void AI_169_Smolstars() - { - Player player = Main.player[this.owner]; - int num1 = this.type == 864 ? 1 : 0; - Vector2 vector2_1 = player.Top + new Vector2(0.0f, -30f); - if (num1 != 0) - { - if (player.dead) - player.smolstar = false; - if (player.smolstar) - this.timeLeft = 2; - if ((double) this.ai[0] == 0.0) - { - int index; - int totalIndexesInGroup; - this.AI_GetMyGroupIndexAndFillBlackList((List) null, out index, out totalIndexesInGroup); - float num2 = 6.283185f / (float) totalIndexesInGroup; - float num3 = (float) totalIndexesInGroup * 0.66f; - Vector2 vector2_2 = new Vector2(30f, 6f) / 5f * (float) (totalIndexesInGroup - 1); - Vector2 vector2_3 = Vector2.UnitY.RotatedBy((double) num2 * (double) index + (double) Main.GlobalTimeWrappedHourly % (double) num3 / (double) num3 * 6.28318548202515); - Vector2 vec = vector2_1 + vector2_3 * vector2_2; - vec.Y += player.gfxOffY; - vector2_1 = vec.Floor(); - } - } - if ((double) this.ai[0] == 0.0) - { - Vector2 vector2_4 = vector2_1 - this.Center; - float num4 = 10f + Utils.GetLerpValue(200f, 600f, vector2_4.Length(), true) * 30f; - if ((double) vector2_4.Length() >= 3000.0) - this.Center = vector2_1; - this.velocity = vector2_4; - if ((double) this.velocity.Length() > (double) num4) - this.velocity = this.velocity * (num4 / this.velocity.Length()); - int startAttackRange = 800; - int attackTarget = -1; - this.Minion_FindTargetInRange(startAttackRange, ref attackTarget, false); - if (attackTarget != -1) - { - this.ai[0] = 60f; - this.ai[1] = (float) attackTarget; - this.netUpdate = true; - } - float targetAngle = this.velocity.SafeNormalize(Vector2.UnitY).ToRotation() + 1.570796f; - if ((double) vector2_4.Length() < 40.0) - targetAngle = Vector2.UnitY.ToRotation() + 1.570796f; - this.rotation = this.rotation.AngleLerp(targetAngle, 0.2f); - } - else if ((double) this.ai[0] == -1.0) - { - if ((double) this.ai[1] == 0.0) - { - SoundEngine.PlaySound(0, (int) this.position.X, (int) this.position.Y); - for (int index = 0; index < 2; ++index) - { - Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 15, this.oldVelocity.X * 0.2f, this.oldVelocity.Y * 0.2f, Scale: 1.4f); - if (Main.rand.Next(3) != 0) - { - dust.scale *= 1.3f; - dust.velocity *= 1.1f; - } - dust.noGravity = true; - dust.fadeIn = 0.0f; - } - this.velocity = this.velocity + Main.rand.NextVector2CircularEdge(4f, 4f); - } - ++this.ai[1]; - this.rotation += (float) ((double) this.velocity.X * 0.100000001490116 + (double) this.velocity.Y * 0.0500000007450581); - this.velocity = this.velocity * 0.92f; - if ((double) this.ai[1] < 9.0) - return; - this.ai[0] = 0.0f; - this.ai[1] = 0.0f; - } - else - { - NPC npc = (NPC) null; - int index1 = (int) this.ai[1]; - if (Main.npc.IndexInRange(index1) && Main.npc[index1].CanBeChasedBy((object) this)) - npc = Main.npc[index1]; - if (npc == null) - { - this.ai[0] = -1f; - this.ai[1] = 0.0f; - this.netUpdate = true; - } - else if ((double) player.Distance(npc.Center) >= 900.0) - { - this.ai[0] = 0.0f; - this.ai[1] = 0.0f; - this.netUpdate = true; - } - else - { - Vector2 vector2_5 = npc.Center - this.Center; - float num5 = 16f; - this.velocity = vector2_5; - if ((double) this.velocity.Length() > (double) num5) - this.velocity = this.velocity * (num5 / this.velocity.Length()); - this.rotation = this.rotation.AngleLerp(this.velocity.SafeNormalize(Vector2.UnitY).ToRotation() + 1.570796f, 0.4f); - } - float num6 = 0.1f; - float num7 = (float) (this.width * 5); - for (int index2 = 0; index2 < 1000; ++index2) - { - if (index2 != this.whoAmI && Main.projectile[index2].active && Main.projectile[index2].owner == this.owner && Main.projectile[index2].type == this.type && (double) Math.Abs(this.position.X - Main.projectile[index2].position.X) + (double) Math.Abs(this.position.Y - Main.projectile[index2].position.Y) < (double) num7) - { - if ((double) this.position.X < (double) Main.projectile[index2].position.X) - this.velocity.X -= num6; - else - this.velocity.X += num6; - if ((double) this.position.Y < (double) Main.projectile[index2].position.Y) - this.velocity.Y -= num6; - else - this.velocity.Y += num6; - } - } - } - } - - private void AI_019_Spears() - { - Player player = Main.player[this.owner]; - Vector2 vector2_1 = player.RotatedRelativePoint(player.MountedCenter); - this.direction = player.direction; - player.heldProj = this.whoAmI; - player.itemTime = player.itemAnimation; - this.Center = vector2_1; - bool flag1 = Main.player[this.owner].itemAnimation < Main.player[this.owner].itemAnimationMax / 3; - int itemAnimationMax = player.itemAnimationMax; - int itemAnimation = player.itemAnimation; - int frames = Main.player[this.owner].itemAnimationMax / 3; - float num1 = MathHelper.Min((float) itemAnimation, (float) frames); - float num2 = (float) itemAnimation - num1; - float num3 = 0.0f; - float num4 = 0.0f; - float num5 = 0.0f; - bool flag2 = false; - switch (this.type) - { - case 46: - num3 = 3f; - num5 = 1.6f; - num4 = 1.4f; - break; - case 47: - num3 = 4f; - num5 = 1.2f; - num4 = 0.9f; - break; - case 49: - this.spriteDirection = -this.direction; - num3 = 4f; - num5 = 1.1f; - num4 = 0.85f; - break; - case 64: - case 215: - this.spriteDirection = -this.direction; - num3 = 3f; - num5 = 1.9f; - num4 = 1.7f; - break; - case 66: - case 97: - case 212: - case 218: - this.spriteDirection = -this.direction; - num3 = 3f; - num5 = 2.1f; - num4 = 1.9f; - break; - case 105: - num3 = 3f; - num5 = 2.4f; - num4 = 2.1f; - break; - case 130: - this.spriteDirection = -this.direction; - num3 = 3f; - num5 = 1.3f; - num4 = 1f; - break; - case 153: - this.spriteDirection = -this.direction; - num3 = 4f; - num5 = 1.5f; - num4 = 1.3f; - break; - case 222: - num3 = 3f; - num5 = 2.4f; - num4 = 2.1f; - break; - case 342: - num3 = 3f; - num5 = 2.4f; - num4 = 2.1f; - break; - case 367: - this.spriteDirection = -this.direction; - num3 = 3f; - num5 = 1.6f; - num4 = 1.5f; - break; - case 368: - this.spriteDirection = -this.direction; - num3 = 3f; - num5 = 1.5f; - num4 = 1.4f; - break; - case 730: - this.spriteDirection = -this.direction; - num3 = 8f; - num5 = 1.5f; - num4 = 1.2f; - break; - case 877: - case 878: - case 879: - this.alpha -= 40; - if (this.alpha < 0) - this.alpha = 0; - num3 = 28f; - num5 = 0.4f; - num4 = 0.4f; - flag2 = true; - break; - } - float num6 = (float) (itemAnimationMax - frames) - num2; - float num7 = (float) frames - num1; - this.position = this.position + this.velocity * (float) ((double) num3 + (double) num4 * (double) num6 - (double) num5 * (double) num7); - switch (this.type) - { - case 130: - if (((double) this.localAI[0] == 0.0 || (double) this.localAI[0] == 4.0 || (double) this.localAI[0] == 8.0 || (double) this.localAI[0] == 12.0 || (double) this.localAI[0] == 16.0 || (double) this.localAI[0] == 20.0 || (double) this.localAI[0] == 24.0) && this.owner == Main.myPlayer) - Projectile.NewProjectile(this.Center.X, this.Center.Y, this.velocity.X, this.velocity.Y, 131, this.damage / 3, 0.0f, this.owner); - ++this.localAI[0]; - break; - case 222: - if (flag1 && (double) this.localAI[0] == 0.0 && Main.myPlayer == this.owner) - { - this.localAI[0] = 1f; - Projectile.NewProjectile(this.Center.X, this.Center.Y, this.velocity.X, this.velocity.Y, 228, this.damage, this.knockBack, this.owner); - break; - } - break; - case 342: - if (flag1 && (double) this.localAI[0] == 0.0 && Main.myPlayer == this.owner) - { - this.localAI[0] = 1f; - if (Collision.CanHit(player.position, player.width, player.height, this.position, this.width, this.height)) - { - Projectile.NewProjectile(this.Center.X, this.Center.Y, this.velocity.X * 2.4f, this.velocity.Y * 2.4f, 343, (int) ((double) this.damage * 0.8), this.knockBack * 0.85f, this.owner); - break; - } - break; - } - break; - case 730: - if ((double) this.localAI[0] == 0.0 && Main.myPlayer == this.owner) - { - this.localAI[0] = 1f; - Vector2 vector2_2 = this.velocity * 4f; - Projectile.NewProjectile(this.Center.X, this.Center.Y, vector2_2.X, vector2_2.Y, 732, (int) ((double) this.damage * 1.25), this.knockBack * 0.5f, this.owner); - break; - } - break; - } - if (flag2 && player.channel && player.itemAnimation < frames) - player.SetDummyItemTime(frames); - if (player.itemAnimation == 0) - this.Kill(); - this.rotation = (float) (Math.Atan2((double) this.velocity.Y, (double) this.velocity.X) + 1.57079637050629 + 0.785398185253143); - if (this.spriteDirection == -1) - this.rotation -= 1.570796f; - if (this.type == 878 || this.type == 879) - { - float num8 = 6f; - float num9 = 0.8f; - float num10 = Vector2.Dot(this.velocity.SafeNormalize(Vector2.UnitX * (float) player.direction), player.velocity.SafeNormalize(Vector2.UnitX * (float) player.direction)); - float num11 = player.velocity.Length(); - if ((double) num11 > (double) num8 && (double) num10 > (double) num9) - { - int maxValue = 8; - if ((double) num11 > (double) num8 + 1.0) - maxValue = 5; - if ((double) num11 > (double) num8 + 2.0) - maxValue = 2; - int Type1 = 14; - int Type2 = 27; - int num12 = 4; - if (this.type == 879) - { - Type1 = 43; - Type2 = 57; - } - if (Main.rand.Next(maxValue + 3) == 0) - Dust.NewDust(this.Center - new Vector2((float) num12, (float) num12), num12 * 2, num12 * 2, Type1, Alpha: 150, Scale: 1.4f); - if (Main.rand.Next(maxValue) == 0) - { - int index1 = Dust.NewDust(this.Center - new Vector2((float) num12, (float) num12), num12 * 2, num12 * 2, Type2, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 1.2f); - Main.dust[index1].noGravity = true; - Main.dust[index1].velocity *= 0.25f; - int index2 = Dust.NewDust(this.Center - new Vector2((float) num12, (float) num12), num12 * 2, num12 * 2, Type2, Alpha: 150, Scale: 1.4f); - Main.dust[index2].velocity *= 0.25f; - } - } - } - if (this.type == 46) - { - if (Main.rand.Next(5) == 0) - Dust.NewDust(this.position, this.width, this.height, 14, Alpha: 150, Scale: 1.4f); - int index3 = Dust.NewDust(this.position, this.width, this.height, 27, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 1.2f); - Main.dust[index3].noGravity = true; - Main.dust[index3].velocity /= 2f; - int index4 = Dust.NewDust(this.position - this.velocity * 2f, this.width, this.height, 27, Alpha: 150, Scale: 1.4f); - Main.dust[index4].velocity /= 5f; - } - if (this.type == 730) - { - if (Main.rand.Next(5) == 0) - { - Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 226, Alpha: 150, Scale: 0.7f); - dust.noGravity = true; - dust.velocity *= 1.4f; - } - if (Main.rand.Next(5) != 0) - return; - Dust.NewDustDirect(this.position, this.width, this.height, 226, Alpha: 150, Scale: 0.5f).velocity.Y -= 0.5f; - } - else if (this.type == 105) - { - if (Main.rand.Next(3) == 0) - { - int index = Dust.NewDust(this.position, this.width, this.height, 57, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 200, Scale: 1.2f); - Main.dust[index].velocity += this.velocity * 0.3f; - Main.dust[index].velocity *= 0.2f; - } - if (Main.rand.Next(4) != 0) - return; - int index5 = Dust.NewDust(this.position, this.width, this.height, 43, Alpha: 254, Scale: 0.3f); - Main.dust[index5].velocity += this.velocity * 0.5f; - Main.dust[index5].velocity *= 0.5f; - } - else - { - if (this.type != 153) - return; - int index = Dust.NewDust(this.position - this.velocity * 3f, this.width, this.height, 115, this.velocity.X * 0.4f, this.velocity.Y * 0.4f, 140); - Main.dust[index].noGravity = true; - Main.dust[index].fadeIn = 1.25f; - Main.dust[index].velocity *= 0.25f; - } - } - - private void AI_019_Spears_Old() - { - Vector2 vector2_1 = Main.player[this.owner].RotatedRelativePoint(Main.player[this.owner].MountedCenter); - this.direction = Main.player[this.owner].direction; - Main.player[this.owner].heldProj = this.whoAmI; - Main.player[this.owner].itemTime = Main.player[this.owner].itemAnimation; - this.position.X = vector2_1.X - (float) (this.width / 2); - this.position.Y = vector2_1.Y - (float) (this.height / 2); - bool flag = Main.player[this.owner].itemAnimation < Main.player[this.owner].itemAnimationMax / 3; - if (!Main.player[this.owner].frozen) - { - if (this.type == 46) - { - if ((double) this.ai[0] == 0.0) - { - this.ai[0] = 3f; - this.netUpdate = true; - } - if (flag) - this.ai[0] -= 1.6f; - else - this.ai[0] += 1.4f; - } - else if (this.type == 105) - { - if ((double) this.ai[0] == 0.0) - { - this.ai[0] = 3f; - this.netUpdate = true; - } - if (flag) - this.ai[0] -= 2.4f; - else - this.ai[0] += 2.1f; - } - else if (this.type == 367) - { - this.spriteDirection = -this.direction; - if ((double) this.ai[0] == 0.0) - { - this.ai[0] = 3f; - this.netUpdate = true; - } - if (flag) - this.ai[0] -= 1.6f; - else - this.ai[0] += 1.5f; - } - else if (this.type == 368) - { - this.spriteDirection = -this.direction; - if ((double) this.ai[0] == 0.0) - { - this.ai[0] = 3f; - this.netUpdate = true; - } - if (flag) - this.ai[0] -= 1.5f; - else - this.ai[0] += 1.4f; - } - else if (this.type == 222) - { - if ((double) this.ai[0] == 0.0) - { - this.ai[0] = 3f; - this.netUpdate = true; - } - if (flag) - { - this.ai[0] -= 2.4f; - if ((double) this.localAI[0] == 0.0 && Main.myPlayer == this.owner) - { - this.localAI[0] = 1f; - Projectile.NewProjectile(this.Center.X + this.velocity.X * this.ai[0], this.Center.Y + this.velocity.Y * this.ai[0], this.velocity.X, this.velocity.Y, 228, this.damage, this.knockBack, this.owner); - } - } - else - this.ai[0] += 2.1f; - } - else if (this.type == 342) - { - if ((double) this.ai[0] == 0.0) - { - this.ai[0] = 3f; - this.netUpdate = true; - } - if (flag) - { - this.ai[0] -= 2.4f; - if ((double) this.localAI[0] == 0.0 && Main.myPlayer == this.owner) - { - this.localAI[0] = 1f; - if (Collision.CanHit(Main.player[this.owner].position, Main.player[this.owner].width, Main.player[this.owner].height, new Vector2(this.Center.X + this.velocity.X * this.ai[0], this.Center.Y + this.velocity.Y * this.ai[0]), this.width, this.height)) - Projectile.NewProjectile(this.Center.X + this.velocity.X * this.ai[0], this.Center.Y + this.velocity.Y * this.ai[0], this.velocity.X * 2.4f, this.velocity.Y * 2.4f, 343, (int) ((double) this.damage * 0.8), this.knockBack * 0.85f, this.owner); - } - } - else - this.ai[0] += 2.1f; - } - else if (this.type == 47) - { - if ((double) this.ai[0] == 0.0) - { - this.ai[0] = 4f; - this.netUpdate = true; - } - if (flag) - this.ai[0] -= 1.2f; - else - this.ai[0] += 0.9f; - } - else if (this.type == 153) - { - this.spriteDirection = -this.direction; - if ((double) this.ai[0] == 0.0) - { - this.ai[0] = 4f; - this.netUpdate = true; - } - if (flag) - this.ai[0] -= 1.5f; - else - this.ai[0] += 1.3f; - } - else if (this.type == 49) - { - if ((double) this.ai[0] == 0.0) - { - this.ai[0] = 4f; - this.netUpdate = true; - } - if (flag) - this.ai[0] -= 1.1f; - else - this.ai[0] += 0.85f; - } - else if (this.type == 730) - { - this.spriteDirection = -this.direction; - if ((double) this.ai[0] == 0.0) - { - this.ai[0] = 8f; - this.netUpdate = true; - if ((double) this.localAI[0] == 0.0 && Main.myPlayer == this.owner) - { - this.localAI[0] = 1f; - Vector2 vector2_2 = this.velocity * 4f; - Projectile.NewProjectile(this.Center.X + this.velocity.X * this.ai[0], this.Center.Y + this.velocity.Y * this.ai[0], vector2_2.X, vector2_2.Y, 732, (int) ((double) this.damage * 1.25), this.knockBack * 0.5f, this.owner); - } - } - if (flag) - this.ai[0] -= 1.5f; - else - this.ai[0] += 1.2f; - } - else if (this.type == 64 || this.type == 215) - { - this.spriteDirection = -this.direction; - if ((double) this.ai[0] == 0.0) - { - this.ai[0] = 3f; - this.netUpdate = true; - } - if (flag) - this.ai[0] -= 1.9f; - else - this.ai[0] += 1.7f; - } - else if (this.type == 66 || this.type == 97 || this.type == 212 || this.type == 218) - { - this.spriteDirection = -this.direction; - if ((double) this.ai[0] == 0.0) - { - this.ai[0] = 3f; - this.netUpdate = true; - } - if (flag) - this.ai[0] -= 2.1f; - else - this.ai[0] += 1.9f; - } - else if (this.type == 130) - { - this.spriteDirection = -this.direction; - if ((double) this.ai[0] == 0.0) - { - this.ai[0] = 3f; - this.netUpdate = true; - } - if (flag) - this.ai[0] -= 1.3f; - else - ++this.ai[0]; - } - } - this.position = this.position + this.velocity * this.ai[0]; - if (this.type == 130) - { - if ((double) this.ai[1] == 0.0 || (double) this.ai[1] == 4.0 || (double) this.ai[1] == 8.0 || (double) this.ai[1] == 12.0 || (double) this.ai[1] == 16.0 || (double) this.ai[1] == 20.0 || (double) this.ai[1] == 24.0) - Projectile.NewProjectile(this.position.X + (float) (this.width / 2), this.position.Y + (float) (this.height / 2), this.velocity.X, this.velocity.Y, 131, this.damage / 3, 0.0f, this.owner); - ++this.ai[1]; - } - if (Main.player[this.owner].itemAnimation == 0) - this.Kill(); - this.rotation = (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X) + 2.355f; - if (this.spriteDirection == -1) - this.rotation -= 1.57f; - if (this.type == 46) - { - if (Main.rand.Next(5) == 0) - Dust.NewDust(this.position, this.width, this.height, 14, Alpha: 150, Scale: 1.4f); - int index1 = Dust.NewDust(this.position, this.width, this.height, 27, this.velocity.X * 0.2f + (float) (this.direction * 3), this.velocity.Y * 0.2f, 100, Scale: 1.2f); - Main.dust[index1].noGravity = true; - Main.dust[index1].velocity.X /= 2f; - Main.dust[index1].velocity.Y /= 2f; - int index2 = Dust.NewDust(this.position - this.velocity * 2f, this.width, this.height, 27, Alpha: 150, Scale: 1.4f); - Main.dust[index2].velocity.X /= 5f; - Main.dust[index2].velocity.Y /= 5f; - } - if (this.type == 730) - { - if (Main.rand.Next(5) == 0) - { - Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 226, Alpha: 150, Scale: 0.7f); - dust.noGravity = true; - dust.velocity *= 1.4f; - } - if (Main.rand.Next(5) != 0) - return; - Dust.NewDustDirect(this.position, this.width, this.height, 226, Alpha: 150, Scale: 0.5f).velocity.Y -= 0.5f; - } - else if (this.type == 105) - { - if (Main.rand.Next(3) == 0) - { - int index = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 57, this.velocity.X * 0.2f, this.velocity.Y * 0.2f, 200, Scale: 1.2f); - Main.dust[index].velocity += this.velocity * 0.3f; - Main.dust[index].velocity *= 0.2f; - } - if (Main.rand.Next(4) != 0) - return; - int index3 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 43, Alpha: 254, Scale: 0.3f); - Main.dust[index3].velocity += this.velocity * 0.5f; - Main.dust[index3].velocity *= 0.5f; - } - else - { - if (this.type != 153) - return; - int index = Dust.NewDust(this.position - this.velocity * 3f, this.width, this.height, 115, this.velocity.X * 0.4f, this.velocity.Y * 0.4f, 140); - Main.dust[index].noGravity = true; - Main.dust[index].fadeIn = 1.25f; - Main.dust[index].velocity *= 0.25f; - } - } - - private void AI_168_FirstFractal() - { - float from = 60f; - if ((double) ++this.localAI[0] >= (double) from - 1.0) - { - this.Kill(); - } - else - { - if (this.frameCounter == 0) - { - this.frameCounter = 1; - this.frame = Main.rand.Next(15); - } - this.velocity = this.velocity.RotatedBy((double) this.ai[0]); - this.Opacity = Utils.GetLerpValue(0.0f, 12f, this.localAI[0], true) * Utils.GetLerpValue(from, from - 12f, this.localAI[0], true); - this.direction = (double) this.velocity.X > 0.0 ? 1 : -1; - this.spriteDirection = this.direction; - this.rotation = 0.7853982f * (float) this.spriteDirection + this.velocity.ToRotation(); - if (this.spriteDirection == -1) - this.rotation += 3.141593f; - if ((double) this.localAI[0] <= 7.0) - return; - Vector2 vector2 = this.Center - new Vector2(5f); - if (Main.rand.Next(15) != 0) - return; - Dust dust = Dust.NewDustPerfect(this.Center, 278, Alpha: 100, newColor: Color.Lerp(this.GetFirstFractalColor(), Color.White, Main.rand.NextFloat() * 0.3f)); - dust.scale = 0.7f; - dust.noGravity = true; - dust.velocity *= 0.5f; - dust.velocity += this.velocity * 2f; - } - } - - private void AI_167_SparkleGuitar() - { - float num = 90f; - if ((double) ++this.localAI[0] >= (double) num - 1.0) - { - this.Kill(); - } - else - { - float amount = this.localAI[0] / num; - Vector2 center = Main.player[this.owner].Center; - Vector2 vector2_1 = new Vector2(this.ai[0], this.ai[1]); - Vector2 vector2_2 = -this.velocity; - Vector2 vector2_3 = center + vector2_2 * 2f; - Vector2 vector2_4 = vector2_1 + vector2_2 * (float) (1.0 - (double) amount * 3.0); - this.Center = Vector2.CatmullRom(vector2_3, center, vector2_1, vector2_4, amount); - if (this.type != 856) - return; - Lighting.AddLight(this.Center, Color.HotPink.ToVector3() * 0.3f); - this.rotation = (float) (6.28318548202515 * (double) amount * 1.0); - } - } - - private void AI_164_StormTigerGem() - { - Player master = Main.player[this.owner]; - if (this.type == 831) - { - if (master.dead) - master.stormTiger = false; - if (master.stormTiger) - this.timeLeft = 2; - if (++this.frameCounter >= 4) - { - this.frameCounter = 0; - if (++this.frame >= 6) - this.frame = 0; - } - } - List blacklistedTargets = Projectile._ai164_blacklistedTargets; - blacklistedTargets.Clear(); - int index; - int totalIndexesInGroup; - this.AI_GetMyGroupIndexAndFillBlackList(blacklistedTargets, out index, out totalIndexesInGroup); - this.Center = Projectile.AI_164_GetHomeLocation(master, index, totalIndexesInGroup); - } - - public static Vector2 AI_164_GetHomeLocation( - Player master, - int stackedIndex, - int totalIndexes) - { - int num1 = master.bodyFrame.Height; - if (num1 == 0) - num1 = 1; - Vector2 vector2_1 = Main.OffsetsPlayerHeadgear[master.bodyFrame.Y / num1]; - vector2_1.Y -= 2f; - float num2 = master.miscCounterNormalized * 2f; - int num3 = stackedIndex / 4; - int num4 = totalIndexes / 4; - if (totalIndexes % 4 > 0) - ++num4; - int num5 = (totalIndexes - num3 * 4) % 4; - if (num5 == 0) - num5 = 4; - if (num4 - 1 != num3) - num5 = 4; - int num6 = stackedIndex % num5; - float num7 = (float) num6 / (float) num5; - float num8 = num2 + (float) num3 / 8f; - if (stackedIndex >= (num4 - 1) * 4 && num3 > 0) - { - num8 = 0.0f; - switch (num5) - { - case 1: - num7 = 0.0f; - break; - case 2: - num7 = (float) (0.25 + (double) num6 * 0.5); - break; - case 3: - num7 = (float) (num6 - 1) / 6f; - break; - case 4: - num7 = (float) (((double) num6 - 1.5) / 6.0); - break; - } - } - Vector2 vector2_2 = new Vector2(0.0f, (float) (-8 - 12 * num3)).RotatedBy(((double) num8 + (double) num7) * 6.28318548202515); - Vector2 vector2_3 = vector2_1 + (vector2_2 + new Vector2(0.0f, master.gravDir * -40f)); - Vector2 mountedCenter = master.MountedCenter; - int direction = master.direction; - Vector2 vector2_4 = new Vector2(0.0f, master.gravDir * -21f); - Vector2 vec = mountedCenter + vector2_4 + vector2_3; - vec.Y += master.gfxOffY; - return vec.Floor(); - } - - private void AI_162_TigerPounce() - { - if ((double) this.ai[0] < 0.0) - { - this.Opacity = 0.0f; - ++this.ai[0]; - } - else - { - bool flag = true; - if (this.frameCounter == 0) - { - this.frameCounter = 1; - this.localAI[0] = this.Center.X; - this.localAI[1] = this.Center.Y; - flag = true; - } - Vector2 vector2_1 = new Vector2(this.localAI[0], this.localAI[1]); - Vector2 vector2_2 = vector2_1 + this.velocity; - float y = Vector2.Distance(vector2_1, vector2_2) * 1.5f; - float num1 = 0.1f; - Vector2 vector2_3 = Vector2.Lerp(vector2_1, vector2_2, 0.0f - num1) + new Vector2(0.0f, y); - Vector2 vector2_4 = Vector2.Lerp(vector2_1, vector2_2, 1f + num1) + new Vector2(0.0f, y); - if ((double) this.Opacity < 1.0) - this.Opacity += 0.1f; - int num2 = Math.Sign(vector2_2.X - vector2_1.X); - this.rotation += (float) num2 * -0.2f; - this.spriteDirection = num2; - if ((double) this.ai[1] < 1.0) - this.ai[1] = 60f; - this.ai[0] += 1f / this.ai[1]; - float num3 = Utils.Clamp(this.ai[0], 0.0f, 1f); - Vector2 vector2_5 = vector2_1; - Vector2 vector2_6 = vector2_2; - Vector2 vector2_7 = vector2_4; - double num4 = (double) num3; - Vector2 Destination = Vector2.CatmullRom(vector2_3, vector2_5, vector2_6, vector2_7, (float) num4); - if (flag) - { - for (float num5 = 0.0f; (double) num5 < 1.0; num5 += 0.5f) - { - if (Main.rand.Next(19) == 0) - { - Vector2 vector2_8 = this.Center + this.DirectionTo(Destination).SafeNormalize(Vector2.UnitY) * 100f; - Dust dust = Dust.NewDustPerfect(this.Center + this.Size * Main.rand.NextVector2Square(0.0f, 1f), 278, new Vector2?(Main.rand.NextVector2Circular(3f, 3f)), 100, Color.White * 0.4f); - dust.velocity.Y += -0.6f; - dust.velocity += this.velocity * 0.1f; - Main.rand.Next(5); - dust.velocity = (vector2_8 - this.Center) * 0.05f; - dust.fadeIn = 0.0f; - dust.scale = 0.7f; - dust.noGravity = true; - } - } - if (Main.rand.Next(2) == 0) - { - Dust dust = Main.dust[Dust.NewDust(this.position, this.width, this.height, 269)]; - dust.fadeIn = 0.7f; - dust.scale = 0.4f; - dust.velocity += this.velocity * (1f / 1000f); - dust.noLight = true; - } - } - this.Center = Destination; - if ((double) this.ai[0] < 1.0) - return; - this.Kill(); - } - } - - private void AI_016() - { - if (this.wet && (this.type == 799 || this.type == 800 || this.type == 801 || this.type == 810 || this.type == 906 || this.type == 784 || this.type == 785 || this.type == 786 || this.type == 805 || this.type == 903 || this.type == 787 || this.type == 788 || this.type == 789 || this.type == 806 || this.type == 904 || this.type == 790 || this.type == 791 || this.type == 792 || this.type == 807 || this.type == 905)) - this.timeLeft = 1; - if (this.type == 108 || this.type == 164) - { - ++this.ai[0]; - if ((double) this.ai[0] > 3.0) - this.Kill(); - } - if (this.type == 102) - { - int x = (int) ((double) this.Center.X / 16.0); - int y = (int) ((double) this.Center.Y / 16.0); - if (WorldGen.InWorld(x, y) && Main.tile[x, y].active() && TileID.Sets.Platforms[(int) Main.tile[x, y].type]) - { - this.Kill(); - return; - } - } - if (this.type == 75) - { - for (int index = 0; index < (int) byte.MaxValue; ++index) - { - if (Main.player[index].active && !Main.player[index].dead && !Main.player[index].ghost && (double) (this.Center - Main.player[index].Center).Length() < 40.0) - { - this.Kill(); - return; - } - } - } - bool flag1 = false; - if (this.type == 37 || this.type == 397 || this.type == 470 || this.type == 519 || this.type == 773 || this.type == 911) - { - try - { - int num1 = (int) ((double) this.position.X / 16.0) - 1; - int num2 = (int) (((double) this.position.X + (double) this.width) / 16.0) + 2; - int num3 = (int) ((double) this.position.Y / 16.0) - 1; - int num4 = (int) (((double) this.position.Y + (double) this.height) / 16.0) + 2; - if (num1 < 0) - num1 = 0; - if (num2 > Main.maxTilesX) - num2 = Main.maxTilesX; - if (num3 < 0) - num3 = 0; - if (num4 > Main.maxTilesY) - num4 = Main.maxTilesY; - for (int index1 = num1; index1 < num2; ++index1) - { - for (int index2 = num3; index2 < num4; ++index2) - { - if (Main.tile[index1, index2] != null && Main.tile[index1, index2].nactive() && Main.tileSolid[(int) Main.tile[index1, index2].type] && !Main.tileSolidTop[(int) Main.tile[index1, index2].type]) - { - Vector2 vector2; - vector2.X = (float) (index1 * 16); - vector2.Y = (float) (index2 * 16); - if ((double) this.position.X + (double) this.width - 4.0 > (double) vector2.X && (double) this.position.X + 4.0 < (double) vector2.X + 16.0 && (double) this.position.Y + (double) this.height - 4.0 > (double) vector2.Y && (double) this.position.Y + 4.0 < (double) vector2.Y + 16.0) - { - if (this.type == 911 && this.owner == Main.myPlayer && (double) this.localAI[0] == 0.0) - { - float num5 = 12f; - if ((double) Vector2.Distance(this.Center, vector2 + new Vector2(8f, 8f)) < (double) num5) - this.Center = this.Center + this.velocity.SafeNormalize(Vector2.Zero) * -4f; - this.localAI[0] = 1f; - this.netUpdate = true; - } - this.velocity.X = 0.0f; - this.velocity.Y = -0.2f; - flag1 = true; - } - } - } - } - } - catch - { - } - } - if (flag1 && this.type == 911) - { - Point tileCoordinates = this.Center.ToTileCoordinates(); - if (WorldGen.SolidOrSlopedTile(Framing.GetTileSafely(tileCoordinates.X, tileCoordinates.Y))) - this.Center = this.Center + (tileCoordinates.ToWorldCoordinates() - this.Center).SafeNormalize(Vector2.Zero) * -4f; - } - if (flag1 && this.type == 773) - { - Player player = Main.player[this.owner]; - Vector2 v = this.DirectionTo(player.Center).SafeNormalize(Vector2.UnitX * (float) player.direction); - float rotation = this.rotation; - float targetAngle = v.ToRotation() + 1.570796f; - this.rotation = this.rotation.AngleLerp(targetAngle, 0.2f); - this.rotation = this.rotation.AngleTowards(targetAngle, 0.05f); - Vector2 rotationVector2 = (this.rotation - 1.570796f).ToRotationVector2(); - if (Main.rand.Next(3) == 0) - { - Dust dust = Dust.NewDustPerfect(this.Center + rotationVector2 * 10f, 59, new Vector2?(rotationVector2 * 2f + Main.rand.NextVector2Circular(0.25f, 0.25f)), Scale: 2f); - dust.noGravity = true; - if (Main.rand.Next(3) == 0) - { - dust.velocity *= 1.5f; - dust.noGravity = false; - dust.scale /= 2f; - } - } - if (Main.rand.Next(3) == 0) - { - Point digDirectionSnap8 = this.GetScarabBombDigDirectionSnap8(); - Dust.NewDustPerfect(this.Center + rotationVector2 * -10f, 59, new Vector2?(digDirectionSnap8.ToVector2() * 1.5f), Scale: 2f).noGravity = true; - } - if (Main.rand.Next(15) == 0) - { - Dust dust = Dust.NewDustPerfect(this.Center + rotationVector2 * 10f, 88, new Vector2?(rotationVector2 * 3f + Main.rand.NextVector2Circular(0.25f, 0.25f)), Scale: 2f); - dust.noGravity = true; - if (Main.rand.Next(3) == 0) - dust.velocity *= 1.5f; - } - bool flag2 = Main.rand.Next(30) == 0; - if ((double) rotation != (double) this.rotation && Main.rand.Next(40) == 0) - flag2 = true; - if (flag2) - { - float num6 = 6.283185f * Main.rand.NextFloat(); - for (float num7 = 0.0f; (double) num7 < 1.0; num7 += 0.1428571f) - { - Vector2 vector2 = ((num7 * 6.283185f + num6).ToRotationVector2() * new Vector2(1f, 0.3f)).RotatedBy((double) targetAngle); - Dust dust = Dust.NewDustPerfect(this.Center + vector2 + rotationVector2 * 8f, 59, new Vector2?(rotationVector2 * 3f + vector2)); - dust.noGravity = true; - dust.fadeIn = 1.6f; - } - } - if (++this.frameCounter >= 3) - { - this.frameCounter = 0; - if (++this.frame >= 4) - this.frame = 0; - } - } - if (this.type == 519) - { - ++this.localAI[1]; - float num = 180f - this.localAI[1]; - if ((double) num < 0.0) - num = 0.0f; - ++this.frameCounter; - if ((double) num < 15.0) - ++this.frameCounter; - if ((double) this.frameCounter >= ((double) num / 10.0 + 6.0) / 2.0) - { - ++this.frame; - this.frameCounter = 0; - if (this.frame >= Main.projFrames[this.type]) - this.frame = 0; - } - } - if (this.type == 681 && (double) this.localAI[1] == 0.0) - this.localAI[1] = 1f; - int Type1 = 6; - if (this.type == 776 || this.type == 780 || this.type == 803 || this.type == 804) - Type1 = 228; - else if (this.type == 784 || this.type == 805) - Type1 = Main.rand.Next(3) == 0 ? 6 : Dust.dustWater(); - else if (this.type == 787 || this.type == 806) - Type1 = Main.rand.Next(3) == 0 ? 6 : 35; - else if (this.type == 790 || this.type == 807) - Type1 = Main.rand.Next(3) == 0 ? 6 : 152; - if (this.type == 102) - { - if ((double) this.velocity.Y > 10.0) - this.velocity.Y = 10f; - if ((double) this.localAI[0] == 0.0) - { - this.localAI[0] = 1f; - SoundEngine.PlaySound(SoundID.Item10, this.position); - } - ++this.frameCounter; - if (this.frameCounter > 3) - { - ++this.frame; - this.frameCounter = 0; - } - if (this.frame > 1) - this.frame = 0; - if ((double) this.velocity.Y == 0.0) - { - this.position.X += (float) (this.width / 2); - this.position.Y += (float) (this.height / 2); - this.width = 128; - this.height = 128; - this.position.X -= (float) (this.width / 2); - this.position.Y -= (float) (this.height / 2); - this.damage = 40; - this.knockBack = 8f; - this.timeLeft = 3; - this.netUpdate = true; - } - } - if (this.type == 303 && this.timeLeft <= 3 && this.hostile) - { - this.position.X += (float) (this.width / 2); - this.position.Y += (float) (this.height / 2); - this.width = 128; - this.height = 128; - this.position.X -= (float) (this.width / 2); - this.position.Y -= (float) (this.height / 2); - } - if (this.owner == Main.myPlayer && this.timeLeft <= 3) - { - this.tileCollide = false; - this.ai[1] = 0.0f; - this.alpha = (int) byte.MaxValue; - if (this.type == 28 || this.type == 37 || this.type == 516 || this.type == 519) - { - this.Resize(128, 128); - this.damage = 100; - this.knockBack = 8f; - } - else if (this.type == 773) - { - this.Resize(48, 96); - this.damage = 100; - this.knockBack = 8f; - } - else if (this.type == 29 || this.type == 470 || this.type == 637) - { - this.Resize(250, 250); - this.damage = 250; - this.knockBack = 10f; - } - else if (this.type == 30 || this.type == 397 || this.type == 517 || this.type == 588) - { - this.Resize(128, 128); - this.knockBack = 8f; - } - else if (this.type == 681) - { - this.Resize(80, 80); - this.knockBack = 8f; - } - else if (this.type == 779 || this.type == 783 || this.type == 862 || this.type == 863) - { - this.Resize(48, 48); - this.knockBack = 8f; - } - else if (this.type == 133 || this.type == 134 || this.type == 135 || this.type == 136 || this.type == 137 || this.type == 138 || this.type == 338 || this.type == 339 || this.type == 930) - { - this.Resize(128, 128); - this.knockBack = 8f; - } - else if (this.type == 794 || this.type == 797 || this.type == 795 || this.type == 798 || this.type == 793 || this.type == 796 || this.type == 808 || this.type == 808) - { - this.Resize(250, 250); - this.knockBack = 12f; - } - else if (this.type == 776 || this.type == 780 || this.type == 777 || this.type == 781 || this.type == 778 || this.type == 782 || this.type == 803 || this.type == 804) - { - this.Resize(128, 128); - this.knockBack = 12f; - } - else if (this.type == 784 || this.type == 785 || this.type == 786 || this.type == 805 || this.type == 903 || this.type == 787 || this.type == 788 || this.type == 789 || this.type == 806 || this.type == 904 || this.type == 790 || this.type == 791 || this.type == 792 || this.type == 807 || this.type == 905 || this.type == 799 || this.type == 800 || this.type == 801 || this.type == 810 || this.type == 906 || this.type == 910 || this.type == 911) - { - if (this.type == 903 || this.type == 904 || this.type == 905 || this.type == 906 || this.type == 910 || this.type == 911) - this.damage = 100; - this.Resize(48, 48); - this.knockBack = 12f; - } - else if (this.type == 139 || this.type == 140 || this.type == 141 || this.type == 142 || this.type == 143 || this.type == 144 || this.type == 340 || this.type == 341) - { - this.Resize(200, 200); - this.knockBack = 10f; - } - } - else - { - if (this.type != 30 && this.type != 75 && this.type != 517 && this.type != 681 && this.type != 588 && this.type != 397 && this.type != 108 && this.type != 133 && this.type != 134 && this.type != 135 && this.type != 136 && this.type != 137 && this.type != 138 && this.type != 139 && this.type != 140 && this.type != 141 && this.type != 142 && this.type != 143 && this.type != 144 && this.type != 164 && this.type != 303 && this.type != 338 && this.type != 339 && this.type != 340 && this.type != 341 && (this.type < 776 || this.type > 801) && (this.type < 803 || this.type > 810) && this.type != 930) - this.damage = 0; - if (this.type == 338 || this.type == 339 || this.type == 340 || this.type == 341 || this.type == 803 || this.type == 804 || this.type == 808 || this.type == 809 || this.type == 810 || this.type == 805 || this.type == 806 || this.type == 807 || this.type == 930) - { - ++this.localAI[1]; - if ((double) this.localAI[1] > 6.0) - { - this.alpha = 0; - } - else - { - this.alpha = (int) ((double) byte.MaxValue - 42.0 * (double) this.localAI[1]) + 100; - if (this.alpha > (int) byte.MaxValue) - this.alpha = (int) byte.MaxValue; - } - for (int index3 = 0; index3 < 2; ++index3) - { - float num8 = 0.0f; - float num9 = 0.0f; - if (index3 == 1) - { - num8 = this.velocity.X * 0.5f; - num9 = this.velocity.Y * 0.5f; - } - if ((double) this.localAI[1] > 9.0) - { - if (Main.rand.Next(2) == 0) - { - int index4 = Dust.NewDust(new Vector2(this.position.X + 3f + num8, this.position.Y + 3f + num9) - this.velocity * 0.5f, this.width - 8, this.height - 8, Type1, Alpha: 100); - Main.dust[index4].scale *= (float) (1.39999997615814 + (double) Main.rand.Next(10) * 0.100000001490116); - Main.dust[index4].velocity *= 0.2f; - Main.dust[index4].noGravity = true; - if (Main.dust[index4].type == 152) - { - Main.dust[index4].scale *= 0.5f; - Main.dust[index4].velocity += this.velocity * 0.1f; - } - else if (Main.dust[index4].type == 35) - { - Main.dust[index4].scale *= 0.5f; - Main.dust[index4].velocity += this.velocity * 0.1f; - } - else if (Main.dust[index4].type == Dust.dustWater()) - { - Main.dust[index4].scale *= 0.65f; - Main.dust[index4].velocity += this.velocity * 0.1f; - } - if (this.type == 808 || this.type == 809) - { - Dust dust1 = Main.dust[index4]; - if (dust1.dustIndex != 6000) - { - dust1 = Dust.NewDustPerfect(dust1.position, dust1.type, new Vector2?(dust1.velocity), dust1.alpha, dust1.color, dust1.scale + 0.5f); - dust1.velocity = Main.rand.NextVector2Circular(3f, 3f); - dust1.noGravity = true; - } - if (dust1.dustIndex != 6000) - { - Dust dust2 = Dust.NewDustPerfect(dust1.position, dust1.type, new Vector2?(dust1.velocity), dust1.alpha, dust1.color, dust1.scale + 0.5f); - dust2.velocity = ((float) (6.28318548202515 * ((double) this.timeLeft / 20.0))).ToRotationVector2() * 3f; - dust2.noGravity = true; - } - } - } - if (Main.rand.Next(2) == 0) - { - int index5 = Dust.NewDust(new Vector2(this.position.X + 3f + num8, this.position.Y + 3f + num9) - this.velocity * 0.5f, this.width - 8, this.height - 8, 31, Alpha: 100, Scale: 0.5f); - Main.dust[index5].fadeIn = (float) (0.5 + (double) Main.rand.Next(5) * 0.100000001490116); - Main.dust[index5].velocity *= 0.05f; - } - } - } - float num10 = this.position.X; - float num11 = this.position.Y; - float num12 = 600f; - if (this.type == 930) - num12 = 650f; - bool flag3 = false; - ++this.ai[0]; - if ((double) this.ai[0] > 30.0) - { - this.ai[0] = 30f; - for (int index = 0; index < 200; ++index) - { - if (Main.npc[index].CanBeChasedBy((object) this)) - { - float num13 = Main.npc[index].position.X + (float) (Main.npc[index].width / 2); - float num14 = Main.npc[index].position.Y + (float) (Main.npc[index].height / 2); - float num15 = Math.Abs(this.position.X + (float) (this.width / 2) - num13) + Math.Abs(this.position.Y + (float) (this.height / 2) - num14); - if ((double) num15 < (double) num12 && Collision.CanHit(this.position, this.width, this.height, Main.npc[index].position, Main.npc[index].width, Main.npc[index].height)) - { - num12 = num15; - num10 = num13; - num11 = num14; - flag3 = true; - } - } - } - } - if (!flag3) - { - num10 = (float) ((double) this.position.X + (double) (this.width / 2) + (double) this.velocity.X * 100.0); - num11 = (float) ((double) this.position.Y + (double) (this.height / 2) + (double) this.velocity.Y * 100.0); - } - float num16 = 16f; - if (this.type == 930) - num16 = 12f; - Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); - float num17 = num10 - vector2.X; - float num18 = num11 - vector2.Y; - float num19 = (float) Math.Sqrt((double) num17 * (double) num17 + (double) num18 * (double) num18); - float num20 = num16 / num19; - float num21 = num17 * num20; - float num22 = num18 * num20; - this.velocity.X = (float) (((double) this.velocity.X * 11.0 + (double) num21) / 12.0); - this.velocity.Y = (float) (((double) this.velocity.Y * 11.0 + (double) num22) / 12.0); - } - else if (this.type == 134 || this.type == 137 || this.type == 140 || this.type == 143 || this.type == 303 || this.type == 776 || this.type == 780 || this.type == 793 || this.type == 796 || this.type == 799 || this.type == 784 || this.type == 787 || this.type == 790) - { - if ((double) Math.Abs(this.velocity.X) >= 8.0 || (double) Math.Abs(this.velocity.Y) >= 8.0) - { - for (int index6 = 0; index6 < 2; ++index6) - { - float num23 = 0.0f; - float num24 = 0.0f; - if (index6 == 1) - { - num23 = this.velocity.X * 0.5f; - num24 = this.velocity.Y * 0.5f; - } - int index7 = Dust.NewDust(new Vector2(this.position.X + 3f + num23, this.position.Y + 3f + num24) - this.velocity * 0.5f, this.width - 8, this.height - 8, Type1, Alpha: 100); - Main.dust[index7].scale *= (float) (2.0 + (double) Main.rand.Next(10) * 0.100000001490116); - Main.dust[index7].velocity *= 0.2f; - Main.dust[index7].noGravity = true; - if (Main.dust[index7].type == 152) - { - Main.dust[index7].scale *= 0.5f; - Main.dust[index7].velocity += this.velocity * 0.1f; - } - else if (Main.dust[index7].type == 35) - { - Main.dust[index7].scale *= 0.5f; - Main.dust[index7].velocity += this.velocity * 0.1f; - } - else if (Main.dust[index7].type == Dust.dustWater()) - { - Main.dust[index7].scale *= 0.65f; - Main.dust[index7].velocity += this.velocity * 0.1f; - } - if (this.type == 793 || this.type == 796) - { - Dust dust3 = Main.dust[index7]; - if (dust3.dustIndex != 6000) - { - dust3 = Dust.NewDustPerfect(dust3.position, dust3.type, new Vector2?(dust3.velocity), dust3.alpha, dust3.color, dust3.scale); - dust3.velocity = Main.rand.NextVector2Circular(3f, 3f); - dust3.noGravity = true; - } - if (dust3.dustIndex != 6000) - { - Dust dust4 = Dust.NewDustPerfect(dust3.position, dust3.type, new Vector2?(dust3.velocity), dust3.alpha, dust3.color, dust3.scale); - dust4.velocity = ((float) (6.28318548202515 * ((double) this.timeLeft / 20.0))).ToRotationVector2() * 3f; - dust4.noGravity = true; - } - } - int index8 = Dust.NewDust(new Vector2(this.position.X + 3f + num23, this.position.Y + 3f + num24) - this.velocity * 0.5f, this.width - 8, this.height - 8, 31, Alpha: 100, Scale: 0.5f); - Main.dust[index8].fadeIn = (float) (1.0 + (double) Main.rand.Next(5) * 0.100000001490116); - Main.dust[index8].velocity *= 0.05f; - } - } - if ((double) Math.Abs(this.velocity.X) < 15.0 && (double) Math.Abs(this.velocity.Y) < 15.0) - this.velocity = this.velocity * 1.1f; - } - else if (this.type == 133 || this.type == 136 || this.type == 139 || this.type == 142 || this.type == 777 || this.type == 781 || this.type == 794 || this.type == 797 || this.type == 800 || this.type == 785 || this.type == 788 || this.type == 791) - { - int index = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100); - Main.dust[index].scale *= (float) (1.0 + (double) Main.rand.Next(10) * 0.100000001490116); - Main.dust[index].velocity *= 0.2f; - Main.dust[index].noGravity = true; - } - else if (this.type == 135 || this.type == 138 || this.type == 141 || this.type == 144 || this.type == 778 || this.type == 782 || this.type == 795 || this.type == 798 || this.type == 801 || this.type == 786 || this.type == 789 || this.type == 792) - { - if ((double) this.velocity.X > -0.2 && (double) this.velocity.X < 0.2 && (double) this.velocity.Y > -0.2 && (double) this.velocity.Y < 0.2) - { - this.alpha += 2; - if (this.alpha > 200) - this.alpha = 200; - } - else - { - this.alpha = 0; - int index = Dust.NewDust(new Vector2(this.position.X + 3f, this.position.Y + 3f) - this.velocity * 0.5f, this.width - 8, this.height - 8, 31, Alpha: 100); - Main.dust[index].scale *= (float) (1.60000002384186 + (double) Main.rand.Next(5) * 0.100000001490116); - Main.dust[index].velocity *= 0.05f; - Main.dust[index].noGravity = true; - } - } - else if (this.type == 779 || this.type == 783 || this.type == 862 || this.type == 863) - { - if (Main.rand.Next(25) == 0) - { - Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 228, (float) (-(double) this.velocity.X / 10.0), (float) (-(double) this.velocity.Y / 10.0), 100); - dust.noGravity = true; - dust.velocity *= 0.0f; - dust.scale = 1.3f; - } - if (Main.rand.Next(5) == 0) - { - Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 31, (float) (-(double) this.velocity.X / 10.0), (float) (-(double) this.velocity.Y / 10.0), 100); - dust.noGravity = true; - dust.velocity *= 0.0f; - dust.scale = 1.3f; - } - if (this.frameCounter == 0) - { - this.frameCounter = 1; - this.frame = Main.rand.Next(4); - } - } - else if (this.type != 30 && this.type != 517 && this.type != 681 && this.type != 397 && this.type != 519 && this.type != 588 && this.type != 779 && this.type != 783 && this.type != 862 && this.type != 863 && Main.rand.Next(2) == 0) - { - int index = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100); - Main.dust[index].scale = (float) (0.100000001490116 + (double) Main.rand.Next(5) * 0.100000001490116); - Main.dust[index].fadeIn = (float) (1.5 + (double) Main.rand.Next(5) * 0.100000001490116); - Main.dust[index].noGravity = true; - Main.dust[index].position = this.Center + new Vector2(0.0f, (float) (-this.height / 2)).RotatedBy((double) this.rotation) * 1.1f; - int Type2 = 6; - if (this.type == 773) - Type2 = 59; - if (this.type == 903) - Type2 = Dust.dustWater(); - if (this.type == 904) - Type2 = 35; - if (this.type == 905) - Type2 = 152; - if (this.type == 910 || this.type == 911) - Type2 = 0; - Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, Type2, Alpha: 100); - dust.scale = (float) (1.0 + (double) Main.rand.Next(5) * 0.100000001490116); - dust.noGravity = true; - dust.position = this.Center + new Vector2(0.0f, (float) (-this.height / 2 - 6)).RotatedBy((double) this.rotation) * 1.1f; - } - else if (this.type == 681) - { - Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 6, Alpha: 100); - dust.scale = (float) (1.0 + (double) Main.rand.Next(5) * 0.100000001490116); - dust.noGravity = true; - dust.position = this.Center + new Vector2((float) (6 * Math.Sign(this.velocity.X)), (float) (-this.height / 2 - 6)).RotatedBy((double) this.rotation) * 1.1f; - } - } - ++this.ai[0]; - if (this.type == 338 || this.type == 339 || this.type == 340 || this.type == 341 || this.type == 803 || this.type == 804 || this.type == 808 || this.type == 809 || this.type == 810 || this.type == 805 || this.type == 806 || this.type == 807 || this.type == 930) - { - if ((double) this.velocity.X < 0.0) - { - this.spriteDirection = -1; - this.rotation = (float) Math.Atan2(-(double) this.velocity.Y, -(double) this.velocity.X) - 1.57f; - } - else - { - this.spriteDirection = 1; - this.rotation = (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X) + 1.57f; - } - } - else if (this.type == 134 || this.type == 137 || this.type == 140 || this.type == 143 || this.type == 303 || this.type == 776 || this.type == 780 || this.type == 793 || this.type == 796 || this.type == 799 || this.type == 784 || this.type == 787 || this.type == 790) - { - if (this.velocity != Vector2.Zero) - this.rotation = (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X) + 1.57f; - } - else if (this.type == 135 || this.type == 138 || this.type == 141 || this.type == 144 || this.type == 778 || this.type == 782 || this.type == 795 || this.type == 798 || this.type == 801 || this.type == 786 || this.type == 789 || this.type == 792) - { - this.velocity.Y += 0.2f; - this.velocity = this.velocity * 0.97f; - if ((double) this.velocity.X > -0.1 && (double) this.velocity.X < 0.1) - this.velocity.X = 0.0f; - if ((double) this.velocity.Y > -0.1 && (double) this.velocity.Y < 0.1) - this.velocity.Y = 0.0f; - } - else if (this.type == 133 || this.type == 136 || this.type == 139 || this.type == 142 || this.type == 777 || this.type == 781 || this.type == 794 || this.type == 797 || this.type == 800 || this.type == 785 || this.type == 788 || this.type == 791) - { - if ((double) this.ai[0] > 15.0) - { - if ((double) this.velocity.Y == 0.0) - this.velocity.X *= 0.95f; - this.velocity.Y += 0.2f; - } - } - else if ((this.type == 30 || this.type == 397 || this.type == 517 || this.type == 681 || this.type == 588 || this.type == 779 || this.type == 783 || this.type == 862 || this.type == 863) && (double) this.ai[0] > 10.0 || this.type != 30 && this.type != 397 && this.type != 517 && this.type != 588 && this.type != 779 && this.type != 783 && this.type != 862 && this.type != 863 && (double) this.ai[0] > 5.0) - { - this.ai[0] = 10f; - if ((double) this.velocity.Y == 0.0 && (double) this.velocity.X != 0.0) - { - this.velocity.X *= 0.97f; - if (this.type == 29 || this.type == 470 || this.type == 637) - this.velocity.X *= 0.99f; - if ((double) this.velocity.X > -0.01 && (double) this.velocity.X < 0.01) - { - this.velocity.X = 0.0f; - this.netUpdate = true; - } - } - this.velocity.Y += 0.2f; - if (this.type == 911) - { - this.velocity.X = MathHelper.Clamp(this.velocity.X, -8f, 8f); - this.velocity.Y = MathHelper.Clamp(this.velocity.Y, -8f, 8f); - } - } - if (this.type == 519) - { - this.rotation += this.velocity.X * 0.06f; - } - else - { - if (this.type == 134 || this.type == 137 || this.type == 140 || this.type == 143 || this.type == 303 || this.type >= 338 && this.type <= 341 || this.type == 776 || this.type == 780 || this.type == 793 || this.type == 796 || this.type == 799 || this.type == 784 || this.type == 787 || this.type == 790 || this.type == 803 || this.type == 804 || this.type == 808 || this.type == 809 || this.type == 810 || this.type == 805 || this.type == 806 || this.type == 807 || this.type == 930) - return; - this.rotation += this.velocity.X * 0.1f; - } - } - - private void AI_166_Dove() - { - int num1 = this.type == 855 ? 1 : 0; - if ((double) this.localAI[0] == 0.0) - { - this.localAI[0] = 1f; - this.frame = Main.rand.Next(4); - } - int num2 = 4; - if (num1 != 0) - num2 = 6; - if (++this.frameCounter > num2) - { - this.frameCounter = 0; - if (++this.frame > 3) - this.frame = 0; - } - this.spriteDirection = -1; - if ((double) this.velocity.X > 0.0) - this.spriteDirection = 1; - if (num1 != 0) - { - Lighting.AddLight(this.Center, new Vector3(1f, 0.6f, 0.1f) * (float) (1.0 - (double) this.alpha / (double) byte.MaxValue)); - this.rotation = this.velocity.X * 0.2f; - if ((double) this.velocity.Y < -1.0) - { - this.velocity.Y *= 0.99f; - } - else - { - this.velocity.Y += (float) Math.Sin((double) (this.timeLeft % 200) / 200.0 * 6.28318548202515) * 0.25f; - if ((double) this.velocity.Y > 0.5) - this.velocity.Y *= 0.8f; - this.velocity.Y = MathHelper.Clamp(this.velocity.Y, -1.5f, 1.5f); - } - float num3 = Main.WindForVisuals; - if ((double) num3 == 0.0) - num3 = 0.1f; - this.velocity.X += 0.0525f * num3; - this.velocity.X = MathHelper.Clamp(this.velocity.X, -2f, 2f); - } - else - { - this.rotation = this.velocity.X * 0.15f; - this.velocity.Y -= 0.025f; - if ((double) this.velocity.Y < -3.0) - this.velocity.Y = -3f; - this.velocity.X = MathHelper.Clamp(this.velocity.X, -5f, 5f); - } - if (this.timeLeft < 90) - this.alpha += 3; - if (this.alpha < (int) byte.MaxValue) - return; - this.Kill(); - } - - private void AI_161_RapierStabs() - { - Player player = Main.player[this.owner]; - this.rotation = this.velocity.ToRotation() + 1.570796f; - ++this.ai[0]; - this.Opacity = Utils.GetLerpValue(0.0f, 7f, this.ai[0], true) * Utils.GetLerpValue(16f, 12f, this.ai[0], true); - this.Center = player.RotatedRelativePoint(player.MountedCenter, addGfxOffY: false) + this.velocity * (this.ai[0] - 1f); - this.spriteDirection = (double) Vector2.Dot(this.velocity, Vector2.UnitX) < 0.0 ? -1 : 1; - if ((double) this.ai[0] >= 16.0) - this.Kill(); - else - player.heldProj = this.whoAmI; - } - - private void AI_165_Whip() - { - Player player = Main.player[this.owner]; - this.rotation = this.velocity.ToRotation() + 1.570796f; - ++this.ai[0]; - float timeToFlyOut; - Projectile.GetWhipSettings(this, out timeToFlyOut, out int _, out float _); - this.Center = Main.GetPlayerArmPosition(this) + this.velocity * (this.ai[0] - 1f); - this.spriteDirection = (double) Vector2.Dot(this.velocity, Vector2.UnitX) < 0.0 ? -1 : 1; - if ((double) this.ai[0] >= (double) timeToFlyOut || player.itemAnimation == 0) - { - this.Kill(); - } - else - { - player.heldProj = this.whoAmI; - player.itemAnimation = player.itemAnimationMax - (int) ((double) this.ai[0] / (double) this.MaxUpdates); - player.itemTime = player.itemAnimation; - if ((double) this.ai[0] == (double) (int) ((double) timeToFlyOut / 2.0)) - { - this._whipPointsForCollision.Clear(); - Projectile.FillWhipControlPoints(this, this._whipPointsForCollision); - Vector2 position = this._whipPointsForCollision[this._whipPointsForCollision.Count - 1]; - SoundEngine.PlaySound(SoundID.Item153, position); - } - switch (this.type) - { - case 847: - float t1 = this.ai[0] / timeToFlyOut; - if ((double) Utils.GetLerpValue(0.1f, 0.7f, t1, true) * (double) Utils.GetLerpValue(0.9f, 0.7f, t1, true) <= 0.5 || Main.rand.Next(3) == 0) - break; - this._whipPointsForCollision.Clear(); - Projectile.FillWhipControlPoints(this, this._whipPointsForCollision); - int index1 = Main.rand.Next(this._whipPointsForCollision.Count - 10, this._whipPointsForCollision.Count); - Microsoft.Xna.Framework.Rectangle r1 = Utils.CenteredRectangle(this._whipPointsForCollision[index1], new Vector2(30f, 30f)); - int Type = 57; - if (Main.rand.Next(3) == 0) - Type = 43; - Dust dust1 = Dust.NewDustDirect(r1.TopLeft(), r1.Width, r1.Height, Type, Alpha: 100, newColor: Color.White); - dust1.position = this._whipPointsForCollision[index1]; - dust1.fadeIn = 0.3f; - Vector2 spinningpoint = this._whipPointsForCollision[index1] - this._whipPointsForCollision[index1 - 1]; - dust1.noGravity = true; - dust1.velocity *= 0.5f; - dust1.velocity += spinningpoint.RotatedBy((double) player.direction * 1.57079637050629); - dust1.velocity *= 0.5f; - break; - case 848: - float t2 = this.ai[0] / timeToFlyOut; - float num1 = Utils.GetLerpValue(0.1f, 0.7f, t2, true) * Utils.GetLerpValue(0.9f, 0.7f, t2, true); - if ((double) num1 <= 0.100000001490116 || (double) Main.rand.NextFloat() >= (double) num1 / 2.0) - break; - this._whipPointsForCollision.Clear(); - Projectile.FillWhipControlPoints(this, this._whipPointsForCollision); - Microsoft.Xna.Framework.Rectangle r2 = Utils.CenteredRectangle(this._whipPointsForCollision[this._whipPointsForCollision.Count - 1], new Vector2(30f, 30f)); - int index2 = Dust.NewDust(r2.TopLeft(), r2.Width, r2.Height, 172, Alpha: 100, Scale: 1.5f); - Main.dust[index2].noGravity = true; - Main.dust[index2].velocity.X /= 2f; - Main.dust[index2].velocity.Y /= 2f; - break; - case 849: - float t3 = this.ai[0] / timeToFlyOut; - double lerpValue1 = (double) Utils.GetLerpValue(0.1f, 0.7f, t3, true); - double lerpValue2 = (double) Utils.GetLerpValue(0.9f, 0.7f, t3, true); - if ((double) t3 <= 0.400000005960464 || Main.rand.Next(9) == 0) - break; - this._whipPointsForCollision.Clear(); - Projectile.FillWhipControlPoints(this, this._whipPointsForCollision); - Microsoft.Xna.Framework.Rectangle r3 = Utils.CenteredRectangle(this._whipPointsForCollision[this._whipPointsForCollision.Count - 1], new Vector2(30f, 30f)); - Vector2 vector2_1 = this._whipPointsForCollision[this._whipPointsForCollision.Count - 2].DirectionTo(this._whipPointsForCollision[this._whipPointsForCollision.Count - 1]).SafeNormalize(Vector2.Zero); - Dust dust2 = Dust.NewDustDirect(r3.TopLeft(), r3.Width, r3.Height, 191, Scale: 1.3f); - dust2.noGravity = true; - dust2.velocity += vector2_1 * 2f; - if (Main.rand.Next(2) == 0) - ParticleOrchestrator.RequestParticleSpawn(true, ParticleOrchestraType.BlackLightningSmall, new ParticleOrchestraSettings() - { - MovementVector = vector2_1, - PositionInWorld = r3.Center.ToVector2() - }, new int?(this.owner)); - Lighting.AddLight(r3.Center.ToVector2(), new Vector3(0.2f, 0.0f, 0.4f)); - break; - case 912: - float t4 = this.ai[0] / timeToFlyOut; - float num2 = Utils.GetLerpValue(0.1f, 0.7f, t4, true) * Utils.GetLerpValue(0.9f, 0.7f, t4, true); - if ((double) num2 <= 0.100000001490116 || (double) Main.rand.NextFloat() >= (double) num2 / 2.0) - break; - this._whipPointsForCollision.Clear(); - Projectile.FillWhipControlPoints(this, this._whipPointsForCollision); - Microsoft.Xna.Framework.Rectangle r4 = Utils.CenteredRectangle(this._whipPointsForCollision[this._whipPointsForCollision.Count - 1], new Vector2(30f, 30f)); - Vector2 vector2_2 = this._whipPointsForCollision[this._whipPointsForCollision.Count - 2].DirectionTo(this._whipPointsForCollision[this._whipPointsForCollision.Count - 1]).SafeNormalize(Vector2.Zero); - for (int index3 = 0; index3 < 3; ++index3) - { - Dust dust3 = Dust.NewDustDirect(r4.TopLeft(), r4.Width, r4.Height, 16, Scale: 1.2f); - dust3.noGravity = true; - dust3.velocity += vector2_2 * 2f; - } - for (int index4 = 0; index4 < 1; ++index4) - Dust.NewDustDirect(r4.TopLeft(), r4.Width, r4.Height, 13, Scale: 0.8f).velocity += vector2_2 * 2f; - for (int index5 = 0; index5 < 3; ++index5) - { - if (Main.rand.Next(2) != 0) - { - Dust dust4 = Dust.NewDustDirect(r4.TopLeft(), r4.Width, r4.Height, 261, newColor: Color.Transparent, Scale: 0.8f); - dust4.velocity += vector2_2 * 2f; - dust4.velocity *= 0.3f; - dust4.noGravity = true; - } - } - Lighting.AddLight(r4.Center.ToVector2(), new Vector3(0.1f, 0.1f, 0.2f)); - break; - case 913: - float t5 = this.ai[0] / timeToFlyOut; - float num3 = Utils.GetLerpValue(0.1f, 0.7f, t5, true) * Utils.GetLerpValue(0.9f, 0.7f, t5, true); - if ((double) num3 <= 0.100000001490116 || (double) Main.rand.NextFloat() >= (double) num3) - break; - this._whipPointsForCollision.Clear(); - Projectile.FillWhipControlPoints(this, this._whipPointsForCollision); - Microsoft.Xna.Framework.Rectangle r5 = Utils.CenteredRectangle(this._whipPointsForCollision[this._whipPointsForCollision.Count - 1], new Vector2(20f, 20f)); - Vector2 vector2_3 = this._whipPointsForCollision[this._whipPointsForCollision.Count - 2].DirectionTo(this._whipPointsForCollision[this._whipPointsForCollision.Count - 1]).SafeNormalize(Vector2.Zero); - for (int index6 = 0; index6 < 3; ++index6) - { - if (Main.rand.Next(3) == 0) - { - if (Main.rand.Next(7) == 0) - { - Dust dust5 = Dust.NewDustDirect(r5.TopLeft(), r5.Width, r5.Height, 31); - dust5.velocity.X /= 2f; - dust5.velocity.Y /= 2f; - dust5.velocity += vector2_3 * 2f; - dust5.fadeIn = (float) (1.0 + (double) Main.rand.NextFloat() * 0.600000023841858); - dust5.noGravity = true; - } - else - { - Dust dust6 = Dust.NewDustDirect(r5.TopLeft(), r5.Width, r5.Height, 6, Scale: 1.2f); - dust6.velocity += vector2_3 * 2f; - if (Main.rand.Next(3) != 0) - { - dust6.fadeIn = (float) (0.699999988079071 + (double) Main.rand.NextFloat() * 0.899999976158142); - dust6.scale = 0.6f; - dust6.noGravity = true; - } - } - } - } - break; - case 914: - float t6 = this.ai[0] / timeToFlyOut; - float num4 = Utils.GetLerpValue(0.1f, 0.7f, t6, true) * Utils.GetLerpValue(0.9f, 0.7f, t6, true); - if ((double) num4 <= 0.100000001490116 || (double) Main.rand.NextFloat() >= (double) num4 / 2.0) - break; - this._whipPointsForCollision.Clear(); - Projectile.FillWhipControlPoints(this, this._whipPointsForCollision); - Microsoft.Xna.Framework.Rectangle r6 = Utils.CenteredRectangle(this._whipPointsForCollision[this._whipPointsForCollision.Count - 1], new Vector2(30f, 30f)); - Vector2 vector2_4 = this._whipPointsForCollision[this._whipPointsForCollision.Count - 2].DirectionTo(this._whipPointsForCollision[this._whipPointsForCollision.Count - 1]).SafeNormalize(Vector2.Zero); - Dust dust7 = Dust.NewDustDirect(r6.TopLeft(), r6.Width, r6.Height, 39, Scale: 1.2f); - dust7.noGravity = Main.rand.Next(3) == 0; - dust7.velocity += vector2_4 * 2f; - break; - case 915: - float t7 = this.ai[0] / timeToFlyOut; - if ((double) Utils.GetLerpValue(0.1f, 0.7f, t7, true) * (double) Utils.GetLerpValue(0.9f, 0.7f, t7, true) <= 0.100000001490116) - break; - this._whipPointsForCollision.Clear(); - Projectile.FillWhipControlPoints(this, this._whipPointsForCollision); - Microsoft.Xna.Framework.Rectangle r7 = Utils.CenteredRectangle(this._whipPointsForCollision[this._whipPointsForCollision.Count - 1], new Vector2(30f, 30f)); - Vector2 vector2_5 = this._whipPointsForCollision[this._whipPointsForCollision.Count - 2].DirectionTo(this._whipPointsForCollision[this._whipPointsForCollision.Count - 1]).SafeNormalize(Vector2.Zero); - Dust rf = Dust.NewDustDirect(r7.TopLeft(), r7.Width, r7.Height, 267, newColor: Main.hslToRgb((float) ((double) player.miscCounterNormalized * 9.0 % 1.0), 1f, 0.5f), Scale: 1.3f); - rf.velocity *= Main.rand.NextFloat() * 0.8f; - rf.noGravity = true; - rf.scale = (float) (0.899999976158142 + (double) Main.rand.NextFloat() * 0.899999976158142); - rf.fadeIn = Main.rand.NextFloat() * 0.9f; - rf.velocity += vector2_5 * 2f; - if (rf.dustIndex == 6000) - break; - Dust dust8 = Dust.CloneDust(rf); - dust8.scale /= 2f; - dust8.fadeIn *= 0.85f; - dust8.color = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); - break; - } - } - } - - public static void FillWhipControlPoints(Projectile proj, List controlPoints) - { - float timeToFlyOut; - int segments; - float rangeMultiplier; - Projectile.GetWhipSettings(proj, out timeToFlyOut, out segments, out rangeMultiplier); - float num1 = proj.ai[0] / timeToFlyOut; - float num2 = 0.5f; - float y = 1f + num2; - float num3 = (float) (31.4159278869629 * (1.0 - (double) num1 * (double) y)) * (float) -proj.spriteDirection / (float) segments; - float num4 = num1 * y; - float amount = 0.0f; - if ((double) num4 > 1.0) - { - amount = (num4 - 1f) / num2; - num4 = MathHelper.Lerp(1f, 0.0f, amount); - } - float num5 = proj.ai[0] - 1f; - float num6 = (float) (Main.player[proj.owner].HeldItem.useAnimation * 2) * num1; - float num7 = proj.velocity.Length() * num6 * num4 * rangeMultiplier / (float) segments; - float num8 = 1f; - Vector2 playerArmPosition = Main.GetPlayerArmPosition(proj); - Vector2 vector2_1 = playerArmPosition; - double num9 = 0.0; - float f1 = (float) (num9 - 1.57079637050629); - Vector2 vector2_2 = vector2_1; - float f2 = (float) (num9 + 1.57079637050629 + 1.57079637050629 * (double) proj.spriteDirection); - Vector2 vector2_3 = vector2_1; - float f3 = (float) (num9 + 1.57079637050629); - controlPoints.Add(playerArmPosition); - for (int index = 0; index < segments; ++index) - { - float num10 = (float) index / (float) segments; - float num11 = num3 * num10 * num8; - Vector2 vector2_4 = vector2_1 + f1.ToRotationVector2() * num7; - Vector2 vector2_5 = vector2_3 + f3.ToRotationVector2() * (num7 * 2f); - Vector2 vector2_6 = vector2_2 + f2.ToRotationVector2() * (num7 * 2f); - float num12 = 1f - num4; - float num13 = (float) (1.0 - (double) num12 * (double) num12); - Vector2 vector2_7 = Vector2.Lerp(vector2_6, Vector2.Lerp(vector2_5, vector2_4, (float) ((double) num13 * 0.899999976158142 + 0.100000001490116)), (float) ((double) num13 * 0.699999988079071 + 0.300000011920929)); - Vector2 spinningpoint = playerArmPosition + (vector2_7 - playerArmPosition) * new Vector2(1f, y); - float num14 = amount; - float num15 = num14 * num14; - double radians = (double) proj.rotation + 4.71238899230957 * (double) num15 * (double) proj.spriteDirection; - Vector2 center = playerArmPosition; - Vector2 vector2_8 = spinningpoint.RotatedBy(radians, center); - controlPoints.Add(vector2_8); - f1 += num11; - f3 += num11; - f2 += num11; - vector2_1 = vector2_4; - vector2_3 = vector2_5; - vector2_2 = vector2_6; - } - } - - public static void GetWhipSettings( - Projectile proj, - out float timeToFlyOut, - out int segments, - out float rangeMultiplier) - { - timeToFlyOut = (float) (Main.player[proj.owner].itemAnimationMax * proj.MaxUpdates); - segments = 20; - rangeMultiplier = 1f; - switch (proj.type) - { - case 841: - rangeMultiplier *= 0.75f; - break; - case 847: - segments = 20; - rangeMultiplier *= 1.2f; - break; - case 848: - rangeMultiplier = 0.7f; - break; - case 849: - segments = 30; - rangeMultiplier = 1.2f; - break; - case 912: - rangeMultiplier *= 1.3f; - break; - case 913: - rangeMultiplier *= 1.2f; - break; - case 914: - rangeMultiplier *= 0.9f; - break; - case 915: - segments = 40; - rangeMultiplier = 1.5f; - break; - } - } - - private void AI_160_Kites() - { - Player player = Main.player[this.owner]; - Vector2 vector2_1 = player.RotatedRelativePoint(player.MountedCenter); - this.timeLeft = 60; - bool flag = false; - if (player.CCed || player.noItems) - flag = true; - else if (player.inventory[player.selectedItem].shoot != this.type) - flag = true; - else if (player.pulley) - flag = true; - else if (player.dead) - flag = true; - if (!flag) - flag = (double) (player.Center - this.Center).Length() > 2000.0; - if (flag) - { - this.Kill(); - } - else - { - float min = 4f; - float max = 500f; - float num1 = max / 2f; - if (this.owner == Main.myPlayer && this.extraUpdates == 0) - { - double num2 = (double) this.ai[0]; - if ((double) this.ai[0] == 0.0) - this.ai[0] = num1; - float num3 = this.ai[0]; - if (Main.mouseRight) - num3 -= 5f; - if (Main.mouseLeft) - num3 += 5f; - this.ai[0] = MathHelper.Clamp(num3, min, max); - double num4 = (double) num3; - if (num2 != num4) - this.netUpdate = true; - } - if (this.numUpdates == 1) - this.extraUpdates = 0; - int num5 = 0; - float cloudAlpha = Main.cloudAlpha; - float x = 0.0f; - if (WorldGen.InAPlaceWithWind(this.position, this.width, this.height)) - x = Main.WindForVisuals; - float num6 = Utils.GetLerpValue(0.2f, 0.5f, Math.Abs(x), true) * 0.5f; - switch (num5) - { - case 0: - Vector2 mouseWorld = Main.MouseWorld; - Vector2 Other = this.Center + new Vector2(x, (float) Math.Sin((double) Main.GlobalTimeWrappedHourly) + cloudAlpha * 5f) * 25f; - Vector2 vector2_2 = (Other - this.Center).SafeNormalize(Vector2.Zero) * (float) (3.0 + (double) cloudAlpha * 7.0); - if ((double) num6 == 0.0) - vector2_2 = this.velocity; - float t = this.Distance(Other); - float lerpValue = Utils.GetLerpValue(5f, 10f, t, true); - float y = this.velocity.Y; - if ((double) t > 10.0) - this.velocity = Vector2.Lerp(this.velocity, vector2_2, 0.075f * lerpValue); - this.velocity.Y = y; - this.velocity.Y -= num6; - this.velocity.Y += (float) (0.0199999995529652 + (double) num6 * 0.25); - this.velocity.Y = MathHelper.Clamp(this.velocity.Y, -2f, 2f); - if ((double) this.Center.Y + (double) this.velocity.Y < (double) Other.Y) - this.velocity.Y = MathHelper.Lerp(this.velocity.Y, (float) ((double) this.velocity.Y + (double) num6 + 0.00999999977648258), 0.75f); - this.velocity.X *= 0.98f; - float num7 = this.Distance(vector2_1); - float num8 = this.ai[0]; - if ((double) num7 > (double) num8) - { - Vector2 vector2_3 = this.DirectionTo(vector2_1); - float num9 = num7 - num8; - this.Center = this.Center + vector2_3 * num9; - int num10 = (double) Vector2.Dot(vector2_3, Vector2.UnitY) < 0.800000011920929 ? 1 : ((double) num6 > 0.0 ? 1 : 0); - this.velocity.Y += vector2_3.Y * 0.05f; - if (num10 != 0) - this.velocity.Y -= 0.15f; - this.velocity.X += vector2_3.X * 0.2f; - if ((double) num8 == (double) min && this.owner == Main.myPlayer) - { - this.Kill(); - return; - } - break; - } - break; - case 1: - this.velocity = Vector2.Lerp(this.velocity, this.DirectionTo(vector2_1) * 16f, 1f); - if ((double) this.Distance(vector2_1) < 10.0 && this.owner == Main.myPlayer) - { - this.Kill(); - return; - } - break; - } - this.timeLeft = 2; - Vector2 vector2_4 = this.Center - vector2_1; - int dir = (double) vector2_4.X > 0.0 ? 1 : -1; - if ((double) Math.Abs(vector2_4.X) > (double) Math.Abs(vector2_4.Y) / 2.0) - player.ChangeDir(dir); - Vector2 vector2_5 = this.DirectionTo(vector2_1).SafeNormalize(Vector2.Zero); - if (((double) num6 != 0.0 ? 0 : ((double) this.velocity.Y > -0.0199999995529652 ? 1 : 0)) != 0) - { - this.rotation *= 0.95f; - } - else - { - float num11 = (-vector2_5).ToRotation() + 0.7853982f; - if (this.spriteDirection == -1) - num11 -= 1.570796f * (float) player.direction; - this.rotation = num11 + this.velocity.X * 0.05f; - } - float num12 = this.velocity.Length(); - switch (this.type) - { - case 771: - case 822: - case 823: - case 827: - case 830: - case 838: - case 843: - case 844: - case 845: - case 846: - case 850: - case 852: - this.frame = 0; - break; - case 824: - case 839: - case 840: - case 853: - if ((double) num6 < 0.150000005960464) - { - this.frame = 0; - break; - } - ++this.frameCounter; - if ((double) this.frameCounter > (1.0 - (double) num6) * 10.0) - { - this.frameCounter = 0; - this.frame = Main.rand.Next(4); - break; - } - break; - case 826: - this.frame = (int) this.ai[1]; - break; - case 828: - case 829: - this.frame = (double) num12 >= 6.0 ? 0 : 1; - break; - default: - this.frame = (double) num12 >= 3.0 ? ((double) num12 >= 5.0 ? ((double) num12 >= 7.0 ? 3 : 2) : 1) : 0; - break; - } - this.spriteDirection = player.direction; - } - } - - private void AI_159_PaperAirplanes() - { - if ((double) this.ai[1] == 0.0) - { - this.direction = (double) this.velocity.X > 0.0 ? 1 : -1; - this.rotation = this.velocity.ToRotation(); - this.ai[1] = 1f; - this.ai[0] = (float) -Main.rand.Next(30, 80); - this.netUpdate = true; - } - if (this.wet && this.owner == Main.myPlayer) - this.Kill(); - ++this.ai[0]; - Vector2 spinningpoint = this.rotation.ToRotationVector2() * 8f; - float y = (float) Math.Sin(6.28318548202515 * (Main.timeForVisualEffects % 90.0 / 90.0)) * (float) this.direction * Main.WindForVisuals; - Vector2 v = spinningpoint + new Vector2(Main.WindForVisuals, y); - Vector2 vector2 = Vector2.UnitX * (float) this.direction; - bool flag = this.direction == Math.Sign(Main.WindForVisuals) && (double) this.velocity.Length() > 3.0; - int num1 = (double) this.ai[0] < 20.0 ? 0 : ((double) this.ai[0] <= 69.0 ? 1 : 0); - if ((double) this.ai[0] == 70.0) - this.ai[0] = (float) -Main.rand.Next(120, 600); - int num2 = flag ? 1 : 0; - int num3 = num1 & num2; - if (num3 != 0) - { - float lerpValue = Utils.GetLerpValue(0.0f, 30f, this.ai[0], true); - v = spinningpoint.RotatedBy((double) -this.direction * 6.28318548202515 * 0.0199999995529652 * (double) lerpValue); - } - this.velocity = v.SafeNormalize(Vector2.UnitY) * this.velocity.Length(); - if (num3 == 0) - { - float num4 = MathHelper.Lerp(0.15f, 0.05f, Math.Abs(Main.WindForVisuals)); - if (this.timeLeft % 40 < 20) - this.velocity.Y -= num4; - else - this.velocity.Y += num4; - if ((double) this.velocity.Y < -2.0) - this.velocity.Y = -2f; - if ((double) this.velocity.Y > 2.0) - this.velocity.Y = 2f; - this.velocity.X = MathHelper.Clamp(this.velocity.X + Main.WindForVisuals * (3f / 500f), -6f, 6f); - if ((double) this.velocity.X * (double) this.oldVelocity.X < 0.0) - { - this.direction *= -1; - this.ai[0] = (float) -Main.rand.Next(120, 300); - this.netUpdate = true; - } - } - this.rotation = this.velocity.ToRotation(); - this.spriteDirection = this.direction; - } - - private void AI_158_BabyBird() - { - Player master = Main.player[this.owner]; - if (this.type == 759) - { - if (master.dead) - master.babyBird = false; - if (master.babyBird) - this.timeLeft = 2; - if (++this.frameCounter >= 6) - { - this.frameCounter = 0; - if (++this.frame >= Main.projFrames[this.type] - 1) - this.frame = 0; - } - } - float num1 = 6f; - float num2 = 8f; - int startAttackRange = 800; - float num3 = 150f; - int attackTarget = -1; - this.Minion_FindTargetInRange(startAttackRange, ref attackTarget, false); - if (attackTarget != -1) - { - NPC npc = Main.npc[attackTarget]; - if ((double) master.Distance(npc.Center) > (double) startAttackRange) - attackTarget = -1; - } - if (attackTarget != -1) - { - if (!Collision.SolidCollision(this.position, this.width, this.height)) - this.tileCollide = true; - NPC npc = Main.npc[attackTarget]; - float num4 = this.Distance(npc.Center); - if (new Microsoft.Xna.Framework.Rectangle((int) this.position.X, (int) this.position.Y, this.width, this.height).Intersects(new Microsoft.Xna.Framework.Rectangle((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height))) - { - this.tileCollide = false; - if ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) < (double) num2) - this.velocity = this.velocity * 1.1f; - if ((double) this.velocity.Length() > (double) num2) - this.velocity = this.velocity * (num1 / this.velocity.Length()); - } - else if ((double) num4 > (double) num3) - { - this.velocity = Vector2.Lerp(this.velocity, this.DirectionTo(npc.Center) * num1, 0.075f); - } - else - { - this.tileCollide = false; - Vector2 vector2 = this.DirectionTo(npc.Center); - this.velocity = this.velocity + new Vector2((float) Math.Sign(vector2.X), (float) Math.Sign(vector2.Y)) * 0.3f; - if ((double) this.velocity.Length() > (double) num2) - this.velocity = this.velocity * (num2 / this.velocity.Length()); - } - float num5 = 0.025f; - float num6 = (float) (this.width * 3); - for (int index = 0; index < 1000; ++index) - { - if (index != this.whoAmI && Main.projectile[index].active && Main.projectile[index].owner == this.owner && Main.projectile[index].type == this.type && (double) Math.Abs(this.position.X - Main.projectile[index].position.X) + (double) Math.Abs(this.position.Y - Main.projectile[index].position.Y) < (double) num6) - { - if ((double) this.position.X < (double) Main.projectile[index].position.X) - this.velocity.X -= num5; - else - this.velocity.X += num5; - if ((double) this.position.Y < (double) Main.projectile[index].position.Y) - this.velocity.Y -= num5; - else - this.velocity.Y += num5; - } - } - this.rotation = this.velocity.X * 0.1f; - this.direction = (double) this.velocity.X > 0.0 ? 1 : -1; - this.spriteDirection = (double) this.velocity.X > 0.0 ? 1 : -1; - } - else - { - this.tileCollide = false; - List blacklistedTargets = Projectile._ai158_blacklistedTargets; - blacklistedTargets.Clear(); - int index1; - this.AI_GetMyGroupIndexAndFillBlackList(blacklistedTargets, out index1, out int _); - this.localAI[0] = (float) index1; - Vector2 homeLocation = Projectile.AI_158_GetHomeLocation(master, index1); - float t = this.Distance(homeLocation); - bool flag = (double) master.gravDir > 0.0 && (double) master.fullRotation == 0.0 && (double) master.headRotation == 0.0; - if ((double) t > 2000.0) - { - this.Center = homeLocation; - this.frame = Main.projFrames[this.type] - 1; - this.frameCounter = 0; - this.velocity = Vector2.Zero; - this.direction = this.spriteDirection = master.direction; - this.rotation = 0.0f; - } - else if ((double) t > 40.0) - { - float num7 = num1 + t * (3f / 500f); - this.velocity = Vector2.Lerp(this.velocity, this.DirectionTo(homeLocation) * MathHelper.Lerp(1f, 5f, Utils.GetLerpValue(40f, 800f, t, true)) * num7, 0.025f); - if ((double) this.velocity.Length() > (double) num7) - this.velocity = this.velocity * (num7 / this.velocity.Length()); - float num8 = 0.05f; - float width = (float) this.width; - for (int index2 = 0; index2 < 1000; ++index2) - { - if (index2 != this.whoAmI && Main.projectile[index2].active && Main.projectile[index2].owner == this.owner && Main.projectile[index2].type == this.type && (double) Math.Abs(this.position.X - Main.projectile[index2].position.X) + (double) Math.Abs(this.position.Y - Main.projectile[index2].position.Y) < (double) width) - { - if ((double) this.position.X < (double) Main.projectile[index2].position.X) - this.velocity.X -= num8; - else - this.velocity.X += num8; - if ((double) this.position.Y < (double) Main.projectile[index2].position.Y) - this.velocity.Y -= num8; - else - this.velocity.Y += num8; - } - } - this.rotation = this.velocity.X * 0.04f; - this.direction = (double) this.velocity.X > 0.0 ? 1 : -1; - this.spriteDirection = (double) this.velocity.X > 0.0 ? 1 : -1; - } - else if ((double) t > 8.0 + (double) master.velocity.Length()) - { - Vector2 vector2 = this.DirectionTo(homeLocation); - this.velocity = this.velocity + new Vector2((float) Math.Sign(vector2.X), (float) Math.Sign(vector2.Y)) * 0.05f; - if ((double) this.velocity.Length() > (double) num1) - this.velocity = this.velocity * (num1 / this.velocity.Length()); - this.rotation = this.velocity.X * 0.1f; - this.direction = (double) this.velocity.X > 0.0 ? 1 : -1; - this.spriteDirection = (double) this.velocity.X > 0.0 ? 1 : -1; - } - else - { - if (!flag) - return; - this.Center = homeLocation; - this.frame = Main.projFrames[this.type] - 1; - this.frameCounter = 0; - this.velocity = Vector2.Zero; - this.direction = this.spriteDirection = master.direction; - this.rotation = 0.0f; - } - } - } - - public static Vector2 AI_158_GetHomeLocation(Player master, int stackedIndex) - { - int num = master.bodyFrame.Height; - if (num == 0) - num = 1; - Vector2 vector2_1 = Main.OffsetsPlayerHeadgear[master.bodyFrame.Y / num]; - vector2_1.Y -= 2f; - switch (stackedIndex % 6) - { - case 1: - vector2_1 += new Vector2((float) (master.direction * 8), master.gravDir * -2f); - break; - case 2: - vector2_1 += new Vector2((float) (master.direction * -10), master.gravDir * -2f); - break; - case 3: - Vector2 vector2_2 = vector2_1; - int direction1 = master.direction; - Vector2 vector2_3 = new Vector2(0.0f, master.gravDir * -10f); - vector2_1 = vector2_2 + vector2_3; - break; - case 4: - vector2_1 += new Vector2((float) (master.direction * 10), master.gravDir * -10f); - break; - case 5: - vector2_1 += new Vector2((float) (master.direction * -12), master.gravDir * -10f); - break; - } - Vector2 vector2_4 = vector2_1 + new Vector2(0.0f, master.gravDir * -16f) * (float) (stackedIndex / 6); - Vector2 vector2_5 = master.RotatedRelativePoint(master.MountedCenter); - int direction2 = master.direction; - Vector2 vector2_6 = new Vector2(0.0f, master.gravDir * -21f); - return (vector2_5 + vector2_6 + vector2_4).Floor(); - } - - private void Minion_FindTargetInRange( - int startAttackRange, - ref int attackTarget, - bool skipIfCannotHitWithOwnBody, - Func customEliminationCheck = null) - { - float maxDistance = (float) startAttackRange; - float val1 = maxDistance; - float val2 = maxDistance; - NPC minionAttackTargetNpc = this.OwnerMinionAttackTargetNPC; - if (minionAttackTargetNpc != null && minionAttackTargetNpc.CanBeChasedBy((object) this) && this.IsInRangeOfMeOrMyOwner((Entity) minionAttackTargetNpc, maxDistance, out float _, out float _, out bool _)) - { - attackTarget = minionAttackTargetNpc.whoAmI; - } - else - { - if (attackTarget >= 0) - return; - for (int index = 0; index < 200; ++index) - { - NPC npc = Main.npc[index]; - float myDistance; - float playerDistance; - bool closerIsMe; - if (npc.CanBeChasedBy((object) this) && this.IsInRangeOfMeOrMyOwner((Entity) npc, maxDistance, out myDistance, out playerDistance, out closerIsMe) && (!skipIfCannotHitWithOwnBody || this.CanHitWithOwnBody((Entity) npc)) && (customEliminationCheck == null || customEliminationCheck((Entity) npc, attackTarget))) - { - attackTarget = index; - float num = closerIsMe ? myDistance : playerDistance; - if ((double) val1 > (double) myDistance) - val1 = myDistance; - if ((double) val2 > (double) playerDistance) - val2 = playerDistance; - maxDistance = Math.Max(val1, val2); - } - } - } - } - - private bool AI_067_CustomEliminationCheck_Pirates(Entity otherEntity, int currentTarget) => true; - - private bool AI_067_TigerSpecialAttack() - { - List npcList = new List(); - Vector2 center = Main.player[this.owner].Center; - Microsoft.Xna.Framework.Rectangle rectangle = Utils.CenteredRectangle(center, new Vector2(1600f, 800f)); - int num1 = Main.player[this.owner].ownedProjectileCounts[831] + 1; - for (int index = 0; index < 200; ++index) - { - NPC npc = Main.npc[index]; - if (npc.CanBeChasedBy((object) this) && npc.Hitbox.Intersects(rectangle)) - npcList.Add(npc); - } - if (npcList.Count == 0) - return false; - NPC npc1 = npcList[0]; - for (int index = 1; index < npcList.Count; ++index) - { - if ((double) Vector2.Distance(npc1.Center, center) > (double) Vector2.Distance(npcList[index].Center, center)) - npc1 = npcList[index]; - } - npcList.Remove(npc1); - NPC npc2 = (NPC) null; - if (npcList.Count > 0) - { - npc2 = npcList[0]; - for (int index = 1; index < npcList.Count; ++index) - { - if ((double) this.Distance(npc2.Center) > (double) this.Distance(npcList[index].Center)) - npc2 = npcList[index]; - } - npcList.Remove(npc2); - } - List vector2List = new List(); - if (npc2 != null) - vector2List.Add(npc2.Center); - int num2 = 0; - while (npcList.Count > 0 && vector2List.Count < num1 - 1) - { - int index = Main.rand.Next(npcList.Count); - Vector2 vector2 = npcList[index].velocity * 4f * (float) (num2 + 1); - vector2List.Add(npcList[index].Center + vector2); - npcList.RemoveAt(index); - ++num2; - } - if (npc1 != null) - vector2List.Add(npc1.Center); - Vector2 position = this.Center; - float num3 = (float) Math.Min(20, 30 / vector2List.Count); - float num4 = 0.0f; - for (int index = 0; index < vector2List.Count; ++index) - { - float num5 = 20f; - Vector2 vector2 = vector2List[index]; - vector2.X += (double) position.X < (double) vector2.X ? num5 : -num5; - Vector2 velocity = vector2 - position; - int num6 = (int) Math.Min((double) num3, 4.0 + Math.Ceiling((double) velocity.Length() / 50.0)); - if (num6 < 5) - num6 = 5; - Projectile.NewProjectile(position, velocity, 818, this.damage, 0.0f, this.owner, (float) (-(double) num4 * 4.0), (float) (num6 * 4)); - position = vector2; - num4 += (float) num6; - } - this.Center = position; - this.ai[0] = 4f; - this.ai[1] = num4; - this.netUpdate = true; - return true; - } - - private void AI_067_FreakingPirates() - { - Player player = Main.player[this.owner]; - if (!player.active) - { - this.active = false; - } - else - { - bool flag1 = this.type == 393 || this.type == 394 || this.type == 395; - bool flag2 = this.type == 758; - bool flag3 = this.type == 833 || this.type == 834 || this.type == 835; - bool flag4 = this.type == 834 || this.type == 835; - int startAttackRange = 450; - float num1 = 500f; - float num2 = 300f; - if (flag1) - { - if (player.dead) - player.pirateMinion = false; - if (player.pirateMinion) - this.timeLeft = 2; - startAttackRange = 800; - } - Color color; - if (flag3) - { - if (player.dead) - player.stormTiger = false; - if (player.stormTiger) - this.timeLeft = 2; - startAttackRange = 800; - if ((double) this.ai[0] != 4.0) - { - if (this.velocity != Vector2.Zero && Main.rand.Next(18) == 0) - { - Dust dust = Main.dust[Dust.NewDust(this.position, this.width, this.height, 269)]; - dust.fadeIn = 0.5f; - dust.scale = 0.3f; - dust.noLight = true; - dust.velocity += this.velocity * 0.005f; - } - if (this.type == 833) - Lighting.AddLight(this.Center, Vector3.One * 0.5f); - if (this.type == 834) - Lighting.AddLight(this.Center, Vector3.One * 0.8f); - if (this.type == 835) - { - Vector2 center = this.Center; - color = Color.Lerp(Main.OurFavoriteColor, Color.White, 0.8f); - Vector3 rgb = color.ToVector3() * 1f; - Lighting.AddLight(center, rgb); - } - } - if (this.owner == Main.myPlayer) - { - if ((double) this.localAI[0] <= 0.0) - { - int num3; - switch (this.type) - { - case 834: - num3 = 300; - break; - case 835: - num3 = 240; - break; - default: - num3 = 360; - break; - } - if (this.damage != 0) - this.localAI[0] = this.AI_067_TigerSpecialAttack() ? (float) num3 : 10f; - } - else - --this.localAI[0]; - } - } - if (flag2) - { - if (player.dead) - player.vampireFrog = false; - if (player.vampireFrog) - this.timeLeft = 2; - startAttackRange = 800; - } - if (this.type == 500) - { - num1 = 200f; - if (player.dead) - player.crimsonHeart = false; - if (player.crimsonHeart) - this.timeLeft = 2; - } - if (this.type == 653) - { - num1 = 300f; - if (player.dead) - player.companionCube = false; - if (player.companionCube) - this.timeLeft = 2; - } - if (flag3 && (double) this.ai[0] == 4.0) - { - this.velocity = Vector2.Zero; - this.frame = 9; - if (flag4) - this.frame = 11; - --this.ai[1]; - if ((double) this.ai[1] > 0.0) - return; - this.ai[0] = 0.0f; - this.ai[1] = 0.0f; - this.netUpdate = true; - } - Vector2 vector2_1 = player.Center; - if (flag1) - { - vector2_1.X -= (float) ((15 + player.width / 2) * player.direction); - vector2_1.X -= (float) (this.minionPos * 20 * player.direction); - } - else if (flag3) - { - vector2_1.X -= (float) ((15 + player.width / 2) * player.direction); - vector2_1.X -= (float) (this.minionPos * 40 * player.direction); - } - else if (flag2) - { - vector2_1.X -= (float) ((35 + player.width / 2) * player.direction); - vector2_1.X -= (float) (this.minionPos * 40 * player.direction); - } - else if (this.type == 500) - { - vector2_1.X -= (float) ((15 + player.width / 2) * player.direction); - vector2_1.X -= (float) (40 * player.direction); - } - else if (this.type == 653) - vector2_1.X = player.Center.X; - if (this.type == 500) - { - Lighting.AddLight(this.Center, 0.9f, 0.1f, 0.3f); - int num4 = 6; - if (this.frame == 0 || this.frame == 2) - num4 = 12; - if (++this.frameCounter >= num4) - { - this.frameCounter = 0; - if (++this.frame >= Main.projFrames[this.type]) - this.frame = 0; - } - this.rotation += this.velocity.X / 20f; - Vector2 spinninpoint = (-Vector2.UnitY).RotatedBy((double) this.rotation).RotatedBy((double) this.direction * 0.200000002980232); - int index = Dust.NewDust(this.Center + spinninpoint * 10f - new Vector2(4f), 0, 0, 5, spinninpoint.X, spinninpoint.Y, newColor: Color.Transparent); - Main.dust[index].scale = 1f; - Main.dust[index].velocity = spinninpoint.RotatedByRandom(0.785398185253143) * 3.5f; - Main.dust[index].noGravity = true; - Main.dust[index].shader = GameShaders.Armor.GetSecondaryShader(Main.player[this.owner].cLight, Main.player[this.owner]); - } - if (this.type == 653) - { - this.rotation += this.velocity.X / 20f; - if (this.owner >= 0 && this.owner < (int) byte.MaxValue) - { - --Projectile._CompanionCubeScreamCooldown[this.owner]; - if ((double) Projectile._CompanionCubeScreamCooldown[this.owner] < 0.0) - Projectile._CompanionCubeScreamCooldown[this.owner] = 0.0f; - } - Tile tileSafely = Framing.GetTileSafely(this.Center); - if (tileSafely.liquid > (byte) 0 && tileSafely.lava()) - ++this.localAI[0]; - else - --this.localAI[0]; - this.localAI[0] = MathHelper.Clamp(this.localAI[0], 0.0f, 20f); - if ((double) this.localAI[0] >= 20.0) - { - if ((double) Projectile._CompanionCubeScreamCooldown[this.owner] == 0.0) - { - Projectile._CompanionCubeScreamCooldown[this.owner] = 3600f; - SoundEngine.PlaySound(Main.rand.Next(10) == 0 ? SoundID.NPCDeath61 : SoundID.NPCDeath59, this.position); - } - this.Kill(); - } - color = Lighting.GetColor((int) this.Center.X / 16, (int) this.Center.Y / 16); - Vector3 vector3_1 = color.ToVector3(); - color = Lighting.GetColor((int) player.Center.X / 16, (int) player.Center.Y / 16); - Vector3 vector3_2 = color.ToVector3(); - if ((double) vector3_1.Length() < 0.150000005960464 && (double) vector3_2.Length() < 0.150000005960464) - ++this.localAI[1]; - else if ((double) this.localAI[1] > 0.0) - --this.localAI[1]; - this.localAI[1] = MathHelper.Clamp(this.localAI[1], -3600f, 120f); - if ((double) this.localAI[1] > (double) Main.rand.Next(30, 120) && !player.immune && player.velocity == Vector2.Zero) - { - if (Main.rand.Next(5) == 0) - { - SoundEngine.PlaySound(SoundID.Item16, this.Center); - this.localAI[1] = -600f; - } - else - { - SoundEngine.PlaySound(SoundID.Item1, this.Center); - player.Hurt(PlayerDeathReason.ByOther(6), 3, 0); - player.immune = false; - player.immuneTime = 0; - this.localAI[1] = (float) (Main.rand.Next(30) * -10 - 300); - } - } - } - bool flag5 = true; - if (this.type == 500 || this.type == 653) - flag5 = false; - this.shouldFallThrough = (double) player.position.Y + (double) player.height - 12.0 > (double) this.position.Y + (double) this.height; - this.friendly = false; - int num5 = 0; - int num6 = 15; - int attackTarget = -1; - bool flag6 = true; - if (flag2) - { - num6 = 20; - num5 = 60; - } - if (flag3) - { - flag6 = false; - this.friendly = true; - this.originalDamage = player.highestStormTigerGemOriginalDamage; - } - if ((double) this.ai[0] == 0.0 & flag5) - this.Minion_FindTargetInRange(startAttackRange, ref attackTarget, true, new Func(this.AI_067_CustomEliminationCheck_Pirates)); - if ((double) this.ai[0] == 1.0) - { - this.tileCollide = false; - float num7 = 0.2f; - float num8 = 10f; - int num9 = 200; - if ((double) num8 < (double) Math.Abs(player.velocity.X) + (double) Math.Abs(player.velocity.Y)) - num8 = Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y); - Vector2 vector2_2 = player.Center - this.Center; - double num10 = (double) vector2_2.Length(); - if (num10 > 2000.0) - this.position = player.Center - new Vector2((float) this.width, (float) this.height) / 2f; - if (num10 < (double) num9 && (double) player.velocity.Y == 0.0 && (double) this.position.Y + (double) this.height <= (double) player.position.Y + (double) player.height && !Collision.SolidCollision(this.position, this.width, this.height)) - { - this.ai[0] = 0.0f; - this.netUpdate = true; - if ((double) this.velocity.Y < -6.0) - this.velocity.Y = -6f; - } - if (num10 >= 60.0) - { - vector2_2.Normalize(); - Vector2 vector2_3 = vector2_2 * num8; - if ((double) this.velocity.X < (double) vector2_3.X) - { - this.velocity.X += num7; - if ((double) this.velocity.X < 0.0) - this.velocity.X += num7 * 1.5f; - } - if ((double) this.velocity.X > (double) vector2_3.X) - { - this.velocity.X -= num7; - if ((double) this.velocity.X > 0.0) - this.velocity.X -= num7 * 1.5f; - } - if ((double) this.velocity.Y < (double) vector2_3.Y) - { - this.velocity.Y += num7; - if ((double) this.velocity.Y < 0.0) - this.velocity.Y += num7 * 1.5f; - } - if ((double) this.velocity.Y > (double) vector2_3.Y) - { - this.velocity.Y -= num7; - if ((double) this.velocity.Y > 0.0) - this.velocity.Y -= num7 * 1.5f; - } - } - if ((double) this.velocity.X != 0.0) - this.spriteDirection = Math.Sign(this.velocity.X); - if (flag1) - { - ++this.frameCounter; - if (this.frameCounter > 3) - { - ++this.frame; - this.frameCounter = 0; - } - if (this.frame < 10 | this.frame > 13) - this.frame = 10; - this.rotation = this.velocity.X * 0.1f; - } - if (flag2) - { - int num11 = 3; - if (++this.frameCounter >= num11 * 4) - this.frameCounter = 0; - this.frame = 14 + this.frameCounter / num11; - this.rotation = this.velocity.X * 0.15f; - } - if (flag3) - { - this.frame = 8; - if (flag4) - this.frame = 10; - this.rotation += 0.6f * (float) this.spriteDirection; - } - } - if ((double) this.ai[0] == 2.0 && (double) this.ai[1] < 0.0) - { - this.friendly = false; - ++this.ai[1]; - if (num6 >= 0) - { - this.ai[1] = 0.0f; - this.ai[0] = 0.0f; - this.netUpdate = true; - return; - } - } - else if ((double) this.ai[0] == 2.0) - { - this.spriteDirection = this.direction; - this.rotation = 0.0f; - if (flag1) - { - this.friendly = true; - this.frame = 4 + (int) ((double) num6 - (double) this.ai[1]) / (num6 / 3); - if ((double) this.velocity.Y != 0.0) - this.frame += 3; - } - if (flag2) - { - float num12 = ((float) num6 - this.ai[1]) / (float) num6; - if ((double) num12 > 0.25 && (double) num12 < 0.75) - this.friendly = true; - int num13 = (int) ((double) num12 * 5.0); - if (num13 > 2) - num13 = 4 - num13; - this.frame = (double) this.velocity.Y == 0.0 ? 18 + num13 : 21 + num13; - if ((double) this.velocity.Y == 0.0) - this.velocity.X *= 0.8f; - } - this.velocity.Y += 0.4f; - if ((double) this.velocity.Y > 10.0) - this.velocity.Y = 10f; - --this.ai[1]; - if ((double) this.ai[1] <= 0.0) - { - if (num5 > 0) - { - this.ai[1] = (float) -num5; - } - else - { - this.ai[1] = 0.0f; - this.ai[0] = 0.0f; - this.netUpdate = true; - return; - } - } - } - if (attackTarget >= 0) - { - float maxDistance = (float) startAttackRange; - float num14 = 20f; - if (flag2) - num14 = 50f; - NPC npc = Main.npc[attackTarget]; - Vector2 center = npc.Center; - vector2_1 = center; - if (this.IsInRangeOfMeOrMyOwner((Entity) npc, maxDistance, out float _, out float _, out bool _)) - { - this.shouldFallThrough = (double) npc.Center.Y > (double) this.Bottom.Y; - bool flag7 = (double) this.velocity.Y == 0.0; - if (this.wet && (double) this.velocity.Y > 0.0 && !this.shouldFallThrough) - flag7 = true; - if ((double) center.Y < (double) this.Center.Y - 30.0 & flag7) - { - float num15 = (float) Math.Sqrt(((double) center.Y - (double) this.Center.Y) * -1.0 * 2.0 * 0.400000005960464); - if ((double) num15 > 26.0) - num15 = 26f; - this.velocity.Y = -num15; - } - if (flag6 && (double) Vector2.Distance(this.Center, vector2_1) < (double) num14) - { - if ((double) this.velocity.Length() > 10.0) - this.velocity = this.velocity / (this.velocity.Length() / 10f); - this.ai[0] = 2f; - this.ai[1] = (float) num6; - this.netUpdate = true; - this.direction = (double) center.X - (double) this.Center.X > 0.0 ? 1 : -1; - } - if (flag3 && this.Hitbox.Intersects(npc.Hitbox) && (double) this.velocity.Y >= 0.0) - { - this.velocity.Y = -4f; - this.velocity.X = (float) (this.direction * 10); - } - } - if (flag2) - { - int num16 = 1; - if ((double) center.X - (double) this.Center.X < 0.0) - num16 = -1; - vector2_1.X += (float) (20 * -num16); - } - } - if ((double) this.ai[0] == 0.0 && attackTarget < 0) - { - if (Main.player[this.owner].rocketDelay2 > 0) - { - this.ai[0] = 1f; - this.netUpdate = true; - } - Vector2 vector2_4 = player.Center - this.Center; - if ((double) vector2_4.Length() > 2000.0) - this.position = player.Center - new Vector2((float) this.width, (float) this.height) / 2f; - else if ((double) vector2_4.Length() > (double) num1 || (double) Math.Abs(vector2_4.Y) > (double) num2) - { - this.ai[0] = 1f; - this.netUpdate = true; - if ((double) this.velocity.Y > 0.0 && (double) vector2_4.Y < 0.0) - this.velocity.Y = 0.0f; - if ((double) this.velocity.Y < 0.0 && (double) vector2_4.Y > 0.0) - this.velocity.Y = 0.0f; - } - } - if ((double) this.ai[0] == 0.0) - { - if (attackTarget < 0) - { - if ((double) this.Distance(player.Center) > 60.0 && (double) this.Distance(vector2_1) > 60.0 && Math.Sign(vector2_1.X - player.Center.X) != Math.Sign(this.Center.X - player.Center.X)) - vector2_1 = player.Center; - Microsoft.Xna.Framework.Rectangle r1 = Utils.CenteredRectangle(vector2_1, this.Size); - for (int index = 0; index < 20 && !Collision.SolidCollision(r1.TopLeft(), r1.Width, r1.Height); ++index) - { - r1.Y += 16; - vector2_1.Y += 16f; - } - Vector2 vector2_5 = Collision.TileCollision(player.Center - this.Size / 2f, vector2_1 - player.Center, this.width, this.height); - vector2_1 = player.Center - this.Size / 2f + vector2_5; - if ((double) this.Distance(vector2_1) < 32.0) - { - float num17 = player.Center.Distance(vector2_1); - if ((double) player.Center.Distance(this.Center) < (double) num17) - vector2_1 = this.Center; - } - Vector2 vector2_6 = player.Center - vector2_1; - if ((double) vector2_6.Length() > (double) num1 || (double) Math.Abs(vector2_6.Y) > (double) num2) - { - Microsoft.Xna.Framework.Rectangle r2 = Utils.CenteredRectangle(player.Center, this.Size); - Vector2 vector2_7 = vector2_1 - player.Center; - Vector2 vector2_8 = r2.TopLeft(); - for (float num18 = 0.0f; (double) num18 < 1.0; num18 += 0.05f) - { - Vector2 vector2_9 = r2.TopLeft() + vector2_7 * num18; - if (!Collision.SolidCollision(r2.TopLeft() + vector2_7 * num18, r1.Width, r1.Height)) - vector2_8 = vector2_9; - else - break; - } - vector2_1 = vector2_8 + this.Size / 2f; - } - } - this.tileCollide = true; - float num19 = 0.5f; - float num20 = 4f; - float num21 = 4f; - float num22 = 0.1f; - if (flag1 && attackTarget != -1) - { - num19 = 1f; - num20 = 8f; - num21 = 8f; - } - if (flag2 && attackTarget != -1) - { - num19 = 0.7f; - num20 = 6f; - num21 = 6f; - } - if (flag3 && attackTarget != -1) - { - num19 = 0.7f; - num20 = 6f; - num21 = 6f; - } - if ((double) num21 < (double) Math.Abs(player.velocity.X) + (double) Math.Abs(player.velocity.Y)) - { - num21 = Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y); - num19 = 0.7f; - } - int num23 = 0; - bool flag8 = false; - float num24 = vector2_1.X - this.Center.X; - Vector2 vector2_10 = vector2_1 - this.Center; - if (this.type == 653 && (double) Math.Abs(num24) < 150.0) - { - this.rotation = this.rotation.AngleTowards(0.0f, 0.2f); - this.velocity.X *= 0.9f; - if ((double) Math.Abs(this.velocity.X) < 0.1) - this.velocity.X = 0.0f; - } - else if ((double) Math.Abs(num24) > 5.0) - { - if ((double) num24 < 0.0) - { - num23 = -1; - if ((double) this.velocity.X > -(double) num20) - this.velocity.X -= num19; - else - this.velocity.X -= num22; - } - else - { - num23 = 1; - if ((double) this.velocity.X < (double) num20) - this.velocity.X += num19; - else - this.velocity.X += num22; - } - bool flag9 = true; - if (flag1) - flag9 = false; - if (this.type == 653) - flag9 = false; - if (flag2 && attackTarget == -1) - flag9 = false; - if (flag3) - flag9 = (double) vector2_10.Y < -80.0; - if (flag9) - flag8 = true; - } - else - { - this.velocity.X *= 0.9f; - if ((double) Math.Abs(this.velocity.X) < (double) num19 * 2.0) - this.velocity.X = 0.0f; - } - bool flag10 = (double) Math.Abs(vector2_10.X) >= 64.0 || (double) vector2_10.Y <= -48.0 && (double) Math.Abs(vector2_10.X) >= 8.0; - if ((uint) num23 > 0U & flag10) - { - int num25 = (int) ((double) this.position.X + (double) (this.width / 2)) / 16; - int num26 = (int) this.position.Y / 16; - int i = num25 + num23 + (int) this.velocity.X; - for (int j = num26; j < num26 + this.height / 16 + 1; ++j) - { - if (WorldGen.SolidTile(i, j)) - flag8 = true; - } - } - if (this.type == 500 && (double) this.velocity.X != 0.0) - flag8 = true; - if (this.type == 653 && (double) Math.Abs(this.velocity.X) > 3.0) - flag8 = true; - Collision.StepUp(ref this.position, ref this.velocity, this.width, this.height, ref this.stepSpeed, ref this.gfxOffY); - float num27 = Utils.GetLerpValue(0.0f, 100f, vector2_10.Y, true) * Utils.GetLerpValue(-2f, -6f, this.velocity.Y, true); - if ((double) this.velocity.Y == 0.0 && flag8) - { - for (int index = 0; index < 3; ++index) - { - int i1 = (int) ((double) this.position.X + (double) (this.width / 2)) / 16; - if (index == 0) - i1 = (int) this.position.X / 16; - if (index == 2) - i1 = (int) ((double) this.position.X + (double) this.width) / 16; - int j = (int) ((double) this.position.Y + (double) this.height) / 16; - if (WorldGen.SolidTile(i1, j) || Main.tile[i1, j].halfBrick() || Main.tile[i1, j].slope() > (byte) 0 || TileID.Sets.Platforms[(int) Main.tile[i1, j].type] && Main.tile[i1, j].active() && !Main.tile[i1, j].inActive()) - { - try - { - int num28 = (int) ((double) this.position.X + (double) (this.width / 2)) / 16; - int num29 = (int) ((double) this.position.Y + (double) (this.height / 2)) / 16; - int i2 = num28 + num23 + (int) this.velocity.X; - if (!WorldGen.SolidTile(i2, num29 - 1) && !WorldGen.SolidTile(i2, num29 - 2)) - this.velocity.Y = -5.1f; - else if (!WorldGen.SolidTile(i2, num29 - 2)) - this.velocity.Y = -7.1f; - else if (WorldGen.SolidTile(i2, num29 - 5)) - this.velocity.Y = -11.1f; - else if (WorldGen.SolidTile(i2, num29 - 4)) - this.velocity.Y = -10.1f; - else - this.velocity.Y = -9.1f; - } - catch - { - this.velocity.Y = -9.1f; - } - } - } - if ((double) vector2_1.Y - (double) this.Center.Y < -48.0) - { - float num30 = (vector2_1.Y - this.Center.Y) * -1f; - if ((double) num30 < 60.0) - this.velocity.Y = -6f; - else if ((double) num30 < 80.0) - this.velocity.Y = -7f; - else if ((double) num30 < 100.0) - this.velocity.Y = -8f; - else if ((double) num30 < 120.0) - this.velocity.Y = -9f; - else if ((double) num30 < 140.0) - this.velocity.Y = -10f; - else if ((double) num30 < 160.0) - this.velocity.Y = -11f; - else if ((double) num30 < 190.0) - this.velocity.Y = -12f; - else if ((double) num30 < 210.0) - this.velocity.Y = -13f; - else if ((double) num30 < 270.0) - this.velocity.Y = -14f; - else if ((double) num30 < 310.0) - this.velocity.Y = -15f; - else - this.velocity.Y = -16f; - } - if (this.wet && (double) num27 == 0.0) - this.velocity.Y *= 2f; - } - if ((double) this.velocity.X > (double) num21) - this.velocity.X = num21; - if ((double) this.velocity.X < -(double) num21) - this.velocity.X = -num21; - if ((double) this.velocity.X < 0.0) - this.direction = -1; - if ((double) this.velocity.X > 0.0) - this.direction = 1; - if ((double) this.velocity.X == 0.0) - this.direction = (double) player.Center.X > (double) this.Center.X ? 1 : -1; - if ((double) this.velocity.X > (double) num19 && num23 == 1) - this.direction = 1; - if ((double) this.velocity.X < -(double) num19 && num23 == -1) - this.direction = -1; - this.spriteDirection = this.direction; - if (flag1) - { - this.rotation = 0.0f; - if ((double) this.velocity.Y == 0.0) - { - if ((double) this.velocity.X == 0.0) - { - this.frame = 0; - this.frameCounter = 0; - } - else if ((double) Math.Abs(this.velocity.X) >= 0.5) - { - this.frameCounter += (int) Math.Abs(this.velocity.X); - ++this.frameCounter; - if (this.frameCounter > 10) - { - ++this.frame; - this.frameCounter = 0; - } - if (this.frame >= 4) - this.frame = 0; - } - else - { - this.frame = 0; - this.frameCounter = 0; - } - } - else if ((double) this.velocity.Y != 0.0) - { - this.frameCounter = 0; - this.frame = 14; - } - } - if (flag2) - { - this.rotation = 0.0f; - if ((double) this.velocity.Y == 0.0) - { - if ((double) this.velocity.X == 0.0) - { - int num31 = 4; - if (++this.frameCounter >= 7 * num31 && Main.rand.Next(50) == 0) - this.frameCounter = 0; - int num32 = this.frameCounter / num31; - if (num32 >= 4) - num32 = 6 - num32; - if (num32 < 0) - num32 = 0; - this.frame = 1 + num32; - } - else if ((double) Math.Abs(this.velocity.X) >= 0.5) - { - this.frameCounter += (int) Math.Abs(this.velocity.X); - ++this.frameCounter; - int num33 = 15; - if (this.frameCounter >= 8 * num33) - this.frameCounter = 0; - this.frame = this.frameCounter / num33 + 5; - } - else - { - this.frame = 0; - this.frameCounter = 0; - } - } - else if ((double) this.velocity.Y != 0.0) - { - if ((double) this.velocity.Y < 0.0) - { - if (this.frame > 9 || this.frame < 5) - { - this.frame = 5; - this.frameCounter = 0; - } - if (++this.frameCounter >= 1 && this.frame < 9) - { - ++this.frame; - this.frameCounter = 0; - } - } - else - { - if (this.frame > 13 || this.frame < 9) - { - this.frame = 9; - this.frameCounter = 0; - } - if (++this.frameCounter >= 2 && this.frame < 11) - { - ++this.frame; - this.frameCounter = 0; - } - } - } - } - if (flag3) - { - int num34 = 8; - if (flag4) - num34 = 10; - this.rotation = 0.0f; - if ((double) this.velocity.Y == 0.0) - { - if ((double) this.velocity.X == 0.0) - { - this.frame = 0; - this.frameCounter = 0; - } - else if ((double) Math.Abs(this.velocity.X) >= 0.5) - { - this.frameCounter += (int) Math.Abs(this.velocity.X); - ++this.frameCounter; - if (this.frameCounter > 10) - { - ++this.frame; - this.frameCounter = 0; - } - if (this.frame >= num34 || this.frame < 2) - this.frame = 2; - } - else - { - this.frame = 0; - this.frameCounter = 0; - } - } - else if ((double) this.velocity.Y != 0.0) - { - this.frameCounter = 0; - this.frame = 1; - if (flag4) - this.frame = 9; - } - } - this.velocity.Y += (float) (0.400000005960464 + (double) num27 * 1.0); - if ((double) this.velocity.Y > 10.0) - this.velocity.Y = 10f; - } - if (!flag1) - return; - ++this.localAI[0]; - if ((double) this.velocity.X == 0.0) - ++this.localAI[0]; - if ((double) this.localAI[0] < (double) Main.rand.Next(900, 1200)) - return; - this.localAI[0] = 0.0f; - for (int index1 = 0; index1 < 6; ++index1) - { - Vector2 Position = this.Center + Vector2.UnitX * (float) -this.direction * 8f - Vector2.One * 5f + Vector2.UnitY * 8f; - double num35 = (double) -this.direction; - color = new Color(); - Color newColor = color; - int index2 = Dust.NewDust(Position, 3, 6, 216, (float) num35, 1f, newColor: newColor); - Main.dust[index2].velocity /= 2f; - Main.dust[index2].scale = 0.8f; - } - int index3 = Gore.NewGore(this.Center + Vector2.UnitX * (float) -this.direction * 8f, Vector2.Zero, Main.rand.Next(580, 583)); - Main.gore[index3].velocity /= 2f; - Main.gore[index3].velocity.Y = Math.Abs(Main.gore[index3].velocity.Y); - Main.gore[index3].velocity.X = -Math.Abs(Main.gore[index3].velocity.X) * (float) this.direction; - } - } - - private void AI_157_SharpTears() - { - bool flag1 = (double) this.ai[0] < 20.0; - bool flag2 = (double) this.ai[0] > 20.0; - bool flag3 = (double) this.ai[0] >= 30.0; - ++this.ai[0]; - if ((double) this.localAI[0] == 0.0) - { - this.localAI[0] = 1f; - this.rotation = this.velocity.ToRotation(); - this.frame = Main.rand.Next(6); - for (int index = 0; index < 30; ++index) - { - Dust dust = Dust.NewDustPerfect(this.Center + Main.rand.NextVector2Circular(24f, 24f), 5, new Vector2?(this.velocity * MathHelper.Lerp(0.2f, 0.7f, Main.rand.NextFloat()))); - dust.velocity += Main.rand.NextVector2Circular(0.5f, 0.5f); - dust.scale = (float) (0.800000011920929 + (double) Main.rand.NextFloat() * 0.5); - } - for (int index = 0; index < 30; ++index) - { - Dust dust = Dust.NewDustPerfect(this.Center + Main.rand.NextVector2Circular(24f, 24f), 5, new Vector2?(Main.rand.NextVector2Circular(2f, 2f) + this.velocity * MathHelper.Lerp(0.2f, 0.5f, Main.rand.NextFloat()))); - dust.velocity += Main.rand.NextVector2Circular(0.5f, 0.5f); - dust.scale = (float) (0.800000011920929 + (double) Main.rand.NextFloat() * 0.5); - dust.fadeIn = 1f; - } - SoundEngine.PlaySound(SoundID.Item113, this.Center); - } - if (flag1) - { - this.Opacity += 0.1f; - this.scale = this.Opacity * this.ai[1]; - for (int index = 0; index < 2; ++index) - { - Dust dust = Dust.NewDustPerfect(this.Center + Main.rand.NextVector2Circular(16f, 16f), 5, new Vector2?(this.velocity * MathHelper.Lerp(0.2f, 0.5f, Main.rand.NextFloat()))); - dust.velocity += Main.rand.NextVector2Circular(0.5f, 0.5f); - dust.velocity *= 0.5f; - dust.scale = (float) (0.800000011920929 + (double) Main.rand.NextFloat() * 0.5); - } - } - if (flag2) - { - this.Opacity -= 0.2f; - for (int index = 0; index < 2; ++index) - { - Dust dust = Dust.NewDustPerfect(this.Center + Main.rand.NextVector2Circular(16f, 16f), 5, new Vector2?(this.velocity * MathHelper.Lerp(0.2f, 0.5f, Main.rand.NextFloat()))); - dust.velocity += Main.rand.NextVector2Circular(0.5f, 0.5f); - dust.velocity *= 0.5f; - dust.scale = (float) (0.800000011920929 + (double) Main.rand.NextFloat() * 0.5); - } - } - if (flag3) - this.Kill(); - Lighting.AddLight(this.Center, new Vector3(0.5f, 0.1f, 0.1f) * this.scale); - } - - private bool IsInRangeOfMeOrMyOwner( - Entity entity, - float maxDistance, - out float myDistance, - out float playerDistance, - out bool closerIsMe) - { - myDistance = Vector2.Distance(entity.Center, this.Center); - if ((double) myDistance < (double) maxDistance && !this.CanHitWithOwnBody(entity)) - myDistance = float.PositiveInfinity; - playerDistance = Vector2.Distance(entity.Center, Main.player[this.owner].Center); - if ((double) playerDistance < (double) maxDistance && !this.CanHitWithMeleeWeapon(entity)) - playerDistance = float.PositiveInfinity; - closerIsMe = (double) myDistance < (double) playerDistance; - return closerIsMe ? (double) myDistance <= (double) maxDistance : (double) playerDistance <= (double) maxDistance; - } - - private void AI_156_BatOfLight() - { - List blacklistedTargets = Projectile._ai156_blacklistedTargets; - Player player = Main.player[this.owner]; - int num1 = this.type == 755 ? 1 : 0; - bool flag = this.type == 946; - if (num1 != 0) - { - if (player.dead) - player.batsOfLight = false; - if (player.batsOfLight) - this.timeLeft = 2; - DelegateMethods.v3_1 = this.AI_156_GetColor().ToVector3(); - Point tileCoordinates = this.Center.ToTileCoordinates(); - DelegateMethods.CastLightOpen(tileCoordinates.X, tileCoordinates.Y); - if (++this.frameCounter >= 6) - { - this.frameCounter = 0; - if (++this.frame >= Main.projFrames[this.type] - 1) - this.frame = 0; - } - int num2 = player.direction; - if ((double) this.velocity.X != 0.0) - num2 = Math.Sign(this.velocity.X); - this.spriteDirection = num2; - } - if (flag) - { - if (player.dead) - player.empressBlade = false; - if (player.empressBlade) - this.timeLeft = 2; - DelegateMethods.v3_1 = this.AI_156_GetColor().ToVector3(); - Point tileCoordinates = this.Center.ToTileCoordinates(); - DelegateMethods.CastLightOpen(tileCoordinates.X, tileCoordinates.Y); - } - blacklistedTargets.Clear(); - this.AI_156_Think(blacklistedTargets); - } - - public Color AI_156_GetColor() - { - if (this.aiStyle != 156) - return Color.Transparent; - int num = this.type == 755 ? 1 : 0; - int type = this.type; - return num != 0 ? Color.Crimson : Color.Transparent; - } - - private void AI_156_Think(List blacklist) - { - bool flag1 = this.type == 755; - bool flag2 = this.type == 946; - int num1 = 60; - int num2 = num1 - 1; - int num3 = num1 + 60; - int num4 = num3 - 1; - int num5 = num1 + 1; - if (flag2) - { - num1 = 40; - num2 = num1 - 1; - num3 = num1 + 40; - num4 = num3 - 1; - num5 = num1 + 1; - } - if ((double) this.ai[0] == -1.0) - { - int index; - int totalIndexesInGroup; - this.AI_GetMyGroupIndexAndFillBlackList(blacklist, out index, out totalIndexesInGroup); - Vector2 idleSpot; - float idleRotation; - this.AI_156_GetIdlePosition(index, totalIndexesInGroup, out idleSpot, out idleRotation); - this.velocity = Vector2.Zero; - this.Center = this.Center.MoveTowards(idleSpot, 32f); - this.rotation = this.rotation.AngleLerp(idleRotation, 0.2f); - if ((double) this.Distance(idleSpot) >= 2.0) - return; - this.ai[0] = 0.0f; - this.netUpdate = true; - } - else if ((double) this.ai[0] == 0.0) - { - if (flag1) - { - int index; - int totalIndexesInGroup; - this.AI_GetMyGroupIndexAndFillBlackList(blacklist, out index, out totalIndexesInGroup); - Vector2 idleSpot; - this.AI_156_GetIdlePosition(index, totalIndexesInGroup, out idleSpot, out float _); - this.velocity = Vector2.Zero; - this.Center = Vector2.SmoothStep(this.Center, idleSpot, 0.45f); - if (Main.rand.Next(20) == 0) - { - int num6 = this.AI_156_TryAttackingNPCs(blacklist); - if (num6 != -1) - { - this.ai[0] = (float) num1; - this.ai[1] = (float) num6; - this.netUpdate = true; - return; - } - } - } - if (!flag2) - return; - int index1; - int totalIndexesInGroup1; - this.AI_GetMyGroupIndexAndFillBlackList(blacklist, out index1, out totalIndexesInGroup1); - Vector2 idleSpot1; - float idleRotation; - this.AI_156_GetIdlePosition(index1, totalIndexesInGroup1, out idleSpot1, out idleRotation); - this.velocity = Vector2.Zero; - this.Center = Vector2.SmoothStep(this.Center, idleSpot1, 0.45f); - this.rotation = this.rotation.AngleLerp(idleRotation, 0.45f); - if (Main.rand.Next(20) != 0) - return; - int num7 = this.AI_156_TryAttackingNPCs(blacklist); - if (num7 == -1) - return; - this.ai[0] = (float) Main.rand.NextFromList(num1, num3); - this.ai[0] = (float) num3; - this.ai[1] = (float) num7; - this.netUpdate = true; - } - else - { - Vector2 vector2_1; - if (flag1) - { - int index = (int) this.ai[1]; - if (!Main.npc.IndexInRange(index)) - { - this.ai[0] = 0.0f; - this.netUpdate = true; - return; - } - NPC npc = Main.npc[index]; - if (!npc.CanBeChasedBy((object) this)) - { - this.ai[0] = 0.0f; - this.netUpdate = true; - return; - } - --this.ai[0]; - if ((double) this.ai[0] >= (double) num2) - { - this.velocity = this.velocity * 0.8f; - if ((double) this.ai[0] != (double) num2) - return; - this.localAI[0] = this.Center.X; - this.localAI[1] = this.Center.Y; - return; - } - float lerpValue = Utils.GetLerpValue((float) num2, 0.0f, this.ai[0], true); - Vector2 vector2_2 = new Vector2(this.localAI[0], this.localAI[1]); - if ((double) lerpValue >= 0.5) - vector2_2 = Main.player[this.owner].Center; - Vector2 center = npc.Center; - float rotation = (center - vector2_2).ToRotation(); - double num8 = (double) center.X > (double) vector2_2.X ? -3.14159274101257 : 3.14159274101257; - float f = (float) (num8 + -num8 * (double) lerpValue * 2.0); - Vector2 spinningpoint = f.ToRotationVector2(); - spinningpoint.Y *= (float) Math.Sin((double) this.identity * 2.29999995231628) * 0.5f; - spinningpoint = spinningpoint.RotatedBy((double) rotation); - vector2_1 = center - vector2_2; - float num9 = vector2_1.Length() / 2f; - this.Center = Vector2.Lerp(vector2_2, center, 0.5f) + spinningpoint * num9; - this.velocity = MathHelper.WrapAngle((float) ((double) rotation + (double) f + 0.0)).ToRotationVector2() * 10f; - this.position = this.position - this.velocity; - if ((double) this.ai[0] == 0.0) - { - int num10 = this.AI_156_TryAttackingNPCs(blacklist); - if (num10 != -1) - { - this.ai[0] = (float) num1; - this.ai[1] = (float) num10; - this.netUpdate = true; - return; - } - this.ai[1] = 0.0f; - this.netUpdate = true; - } - } - if (!flag2) - return; - bool skipBodyCheck = true; - int num11 = 0; - int num12 = num2; - int num13 = 0; - if ((double) this.ai[0] >= (double) num5) - { - num11 = 1; - num12 = num4; - num13 = num5; - } - int index2 = (int) this.ai[1]; - if (!Main.npc.IndexInRange(index2)) - { - int num14 = this.AI_156_TryAttackingNPCs(blacklist, skipBodyCheck); - if (num14 != -1) - { - this.ai[0] = (float) Main.rand.NextFromList(num1, num3); - this.ai[1] = (float) num14; - this.netUpdate = true; - } - else - { - this.ai[0] = -1f; - this.ai[1] = 0.0f; - this.netUpdate = true; - } - } - else - { - NPC npc = Main.npc[index2]; - if (!npc.CanBeChasedBy((object) this)) - { - int num15 = this.AI_156_TryAttackingNPCs(blacklist, skipBodyCheck); - if (num15 != -1) - { - this.ai[0] = (float) Main.rand.NextFromList(num1, num3); - this.ai[1] = (float) num15; - this.netUpdate = true; - } - else - { - this.ai[0] = -1f; - this.ai[1] = 0.0f; - this.netUpdate = true; - } - } - else - { - --this.ai[0]; - if ((double) this.ai[0] >= (double) num12) - { - this.direction = (double) this.Center.X < (double) npc.Center.X ? 1 : -1; - if ((double) this.ai[0] == (double) num12) - { - this.localAI[0] = this.Center.X; - this.localAI[1] = this.Center.Y; - } - } - float lerpValue1 = Utils.GetLerpValue((float) num12, (float) num13, this.ai[0], true); - if (num11 == 0) - { - Vector2 vector2_3 = new Vector2(this.localAI[0], this.localAI[1]); - if ((double) lerpValue1 >= 0.5) - vector2_3 = Vector2.Lerp(npc.Center, Main.player[this.owner].Center, 0.5f); - Vector2 center1 = npc.Center; - float rotation = (center1 - vector2_3).ToRotation(); - double num16 = this.direction == 1 ? -3.14159274101257 : 3.14159274101257; - float f1 = (float) (num16 + -num16 * (double) lerpValue1 * 2.0); - Vector2 vector2_4 = f1.ToRotationVector2(); - vector2_4.Y *= 0.5f; - vector2_4.Y *= (float) (0.800000011920929 + Math.Sin((double) this.identity * 2.29999995231628) * 0.200000002980232); - Vector2 spinningpoint = vector2_4; - double radians = (double) rotation; - vector2_1 = new Vector2(); - Vector2 center2 = vector2_1; - vector2_4 = spinningpoint.RotatedBy(radians, center2); - vector2_1 = center1 - vector2_3; - float num17 = vector2_1.Length() / 2f; - this.Center = Vector2.Lerp(vector2_3, center1, 0.5f) + vector2_4 * num17; - float f2 = MathHelper.WrapAngle((float) ((double) rotation + (double) f1 + 0.0)); - this.rotation = f2 + 1.570796f; - this.velocity = f2.ToRotationVector2() * 10f; - this.position = this.position - this.velocity; - } - if (num11 == 1) - { - Vector2 vector2_5 = new Vector2(this.localAI[0], this.localAI[1]) + new Vector2(0.0f, Utils.GetLerpValue(0.0f, 0.4f, lerpValue1, true) * -100f); - Vector2 v = npc.Center - vector2_5; - Vector2 vector2_6 = v.SafeNormalize(Vector2.Zero) * MathHelper.Clamp(v.Length(), 60f, 150f); - Vector2 vector2_7 = npc.Center + vector2_6; - float lerpValue2 = Utils.GetLerpValue(0.4f, 0.6f, lerpValue1, true); - float lerpValue3 = Utils.GetLerpValue(0.6f, 1f, lerpValue1, true); - this.rotation = this.rotation.AngleTowards(v.SafeNormalize(Vector2.Zero).ToRotation() + 1.570796f, 0.6283185f); - this.Center = Vector2.Lerp(vector2_5, npc.Center, lerpValue2); - if ((double) lerpValue3 > 0.0) - this.Center = Vector2.Lerp(npc.Center, vector2_7, lerpValue3); - } - if ((double) this.ai[0] != (double) num13) - return; - int num18 = this.AI_156_TryAttackingNPCs(blacklist, skipBodyCheck); - if (num18 != -1) - { - this.ai[0] = (float) Main.rand.NextFromList(num1, num3); - this.ai[1] = (float) num18; - this.netUpdate = true; - } - else - { - this.ai[0] = -1f; - this.ai[1] = 0.0f; - this.netUpdate = true; - } - } - } - } - } - - private int AI_156_TryAttackingNPCs(List blackListedTargets, bool skipBodyCheck = false) - { - Vector2 center = Main.player[this.owner].Center; - int num1 = -1; - float num2 = -1f; - for (int index = 0; index < 200; ++index) - { - NPC npc = Main.npc[index]; - if (npc.CanBeChasedBy((object) this) && (npc.boss || !blackListedTargets.Contains(index))) - { - float num3 = npc.Distance(center); - if ((double) num3 <= 1000.0 && ((double) num3 <= (double) num2 || (double) num2 == -1.0) && (skipBodyCheck || this.CanHitWithOwnBody((Entity) npc))) - { - num2 = num3; - num1 = index; - } - } - } - return num1; - } - - private void AI_GetMyGroupIndexAndFillBlackList( - List blackListedTargets, - out int index, - out int totalIndexesInGroup) - { - index = 0; - totalIndexesInGroup = 0; - for (int index1 = 0; index1 < 1000; ++index1) - { - Projectile projectile = Main.projectile[index1]; - if (projectile.active && projectile.owner == this.owner && projectile.type == this.type && (projectile.type != 759 || projectile.frame == Main.projFrames[projectile.type] - 1)) - { - if (this.whoAmI > index1) - ++index; - ++totalIndexesInGroup; - } - } - } - - private void AI_156_GetIdlePosition( - int stackedIndex, - int totalIndexes, - out Vector2 idleSpot, - out float idleRotation) - { - Player player = Main.player[this.owner]; - int num1 = this.type == 755 ? 1 : 0; - bool flag = this.type == 946; - idleRotation = 0.0f; - idleSpot = Vector2.Zero; - if (num1 != 0) - { - float num2 = (float) (((double) totalIndexes - 1.0) / 2.0); - idleSpot = player.Center + -Vector2.UnitY.RotatedBy(4.39822959899902 / (double) totalIndexes * ((double) stackedIndex - (double) num2)) * 40f; - idleRotation = 0.0f; - } - if (!flag) - return; - int num3 = stackedIndex + 1; - idleRotation = (float) ((double) num3 * 6.28318548202515 * 0.0166666675359011 * (double) player.direction + 1.57079637050629); - idleRotation = MathHelper.WrapAngle(idleRotation); - int num4 = num3 % totalIndexes; - Vector2 vector2 = new Vector2(0.0f, 0.5f).RotatedBy(((double) player.miscCounterNormalized * (2.0 + (double) num4) + (double) num4 * 0.5 + (double) player.direction * 1.29999995231628) * 6.28318548202515) * 4f; - idleSpot = idleRotation.ToRotationVector2() * 10f + player.MountedCenter + new Vector2((float) (player.direction * (num3 * -6 - 16)), player.gravDir * -15f); - idleSpot += vector2; - idleRotation += 1.570796f; - } - - private void AI_155_MysticSnakeCoil() - { - if (Main.netMode != 1 && !Main.player[this.owner].active) - { - float num = this.ai[0]; - float y = this.position.Y; - Point tileCoordinates = this.Center.ToTileCoordinates(); - Point end = new Point(tileCoordinates.X, (int) y / 16); - this.AI_155_RemoveRope(new Point(tileCoordinates.X, (int) num / 16), end); - this.Kill(); - } - else - { - int num1 = 80; - int num2 = 1800; - if ((double) this.ai[1] == 0.0) - { - this.spriteDirection = (double) Main.player[this.owner].Center.X > (double) this.Center.X ? -1 : 1; - this.ai[1] = 1f; - this.velocity.Y = -5f; - } - if ((double) this.ai[1] == 1.0) - { - if (Main.rand.Next(6) == 0) - { - Dust dust = Dust.NewDustDirect(this.TopLeft + new Vector2(-6f, 0.0f), 24, 16, 27, Alpha: 150, newColor: Color.Transparent, Scale: 0.6f); - dust.velocity *= 1f; - dust.velocity.X *= 0.5f; - dust.velocity.Y = -3f; - dust.fadeIn = 1.2f; - dust.noGravity = true; - } - this.alpha = Utils.Clamp(this.alpha - 5, 0, (int) byte.MaxValue); - if (++this.frameCounter >= 12) - { - this.frameCounter = 0; - if (++this.frame >= 4) - this.frame = 0; - } - if (Main.myPlayer == this.owner) - { - float num3 = this.ai[0]; - float y1 = this.position.Y; - Point tileCoordinates = this.Center.ToTileCoordinates(); - Point point1 = new Point(tileCoordinates.X, (int) y1 / 16); - Point point2 = new Point(tileCoordinates.X, (int) num3 / 16); - bool flag = point2.Y - point1.Y >= num1; - int x = point2.X; - if (!WorldGen.InWorld(x, point1.Y, 40) || !WorldGen.InWorld(x, point2.Y, 40)) - flag = true; - if (!flag) - { - for (int y2 = point2.Y; y2 >= point1.Y; --y2) - { - if (Main.tile[x, y2].active() && !Main.tileCut[(int) Main.tile[x, y2].type] && Main.tile[x, y2].type != (ushort) 504) - { - flag = true; - break; - } - } - } - if (flag) - { - int num4 = 0; - for (int y3 = point2.Y; y3 > point1.Y; --y3) - { - if ((WorldGen.TileEmpty(x, y3) || Main.tileCut[(int) Main.tile[x, y3].type]) && WorldGen.PlaceTile(x, y3, 504, plr: this.owner)) - { - ++num4; - if (Main.netMode == 1) - NetMessage.SendData(17, number: 1, number2: ((float) x), number3: ((float) y3), number4: 504f); - } - } - this.timeLeft = num2; - this.ai[1] = 2f; - this.netUpdate = true; - this.Top = new Vector2((float) (x * 16 + 8), (float) (point1.Y * 16 + 16)); - this.velocity = Vector2.Zero; - } - } - } - if ((double) this.ai[1] != 2.0) - return; - this.alpha = 0; - int timeLeft = this.timeLeft; - float num5 = this.ai[0]; - float y4 = this.position.Y; - Point tileCoordinates1 = this.Center.ToTileCoordinates(); - Point end = new Point(tileCoordinates1.X, (int) y4 / 16); - Point start = new Point(tileCoordinates1.X, (int) num5 / 16); - int x1 = start.X; - if ((double) this.localAI[0] == 0.0) - { - this.localAI[0] = 1f; - for (int y5 = start.Y; y5 >= end.Y; --y5) - { - Tile tile = Main.tile[x1, y5]; - if (tile.active() && tile.type == (ushort) 504) - this.AI_155_SpawnRopeIn(x1, y5); - } - } - else - { - for (int y6 = start.Y; y6 >= end.Y; --y6) - { - Tile tile = Main.tile[x1, y6]; - if (tile.active() && tile.type == (ushort) 504 && Main.rand.Next(80) == 0) - { - Dust dust = Dust.NewDustDirect(new Vector2((float) (x1 * 16 - 6), (float) (y6 * 16)), 28, 16, 27, Alpha: 150, newColor: Color.Transparent, Scale: 0.6f); - dust.velocity *= 1f; - dust.velocity.X = 0.0f; - dust.fadeIn = 1.2f; - dust.noGravity = true; - } - } - } - if (this.timeLeft == 4) - { - for (int y7 = start.Y; y7 >= end.Y; --y7) - { - Tile tile = Main.tile[x1, y7]; - if (tile.active() && tile.type == (ushort) 504) - this.AI_155_SpawnRopeIn(x1, y7); - } - } - if (this.timeLeft > 4) - return; - if (!WorldGen.InWorld(x1, end.Y, 20) || !WorldGen.InWorld(x1, start.Y, 20)) - { - this.Kill(); - } - else - { - if (Main.myPlayer == this.owner) - this.AI_155_RemoveRope(start, end); - this.Kill(); - } - } - } - - private void AI_155_RemoveRope(Point start, Point end) - { - int x = start.X; - for (int y = start.Y; y >= end.Y; --y) - { - Tile tile = Main.tile[x, y]; - if (tile.active() && tile.type == (ushort) 504) - { - WorldGen.KillTile(x, y); - if (Main.netMode != 0) - NetMessage.SendData(17, number2: ((float) x), number3: ((float) y)); - } - } - } - - private void AI_155_SpawnRopeIn(int x, int y) - { - Vector2 Position = new Vector2((float) (x * 16 + 8), (float) (y * 16 + 8)); - if (Main.rand.Next(4) != 0) - { - Gore gore = Gore.NewGoreDirect(Position, Vector2.Zero, Main.rand.Next(61, 64)); - gore.velocity = Main.rand.NextVector2Circular(1.5f, 0.8f); - gore.velocity.X += (float) (0.100000001490116 * ((double) gore.velocity.X > 0.0 ? 1.0 : -1.0)); - gore.position = Position - new Vector2(16f, 16f); - gore.alpha = 170; - } - for (int index = 0; index < 5; ++index) - { - if (Main.rand.Next(8) == 0) - Dust.NewDustDirect(Position + new Vector2(-8f), 16, 16, 31, Alpha: 100, newColor: Color.Transparent).velocity *= 0.4f; - Dust dust = Dust.NewDustDirect(Position + new Vector2(-8f), 16, 16, 27, Alpha: 100, newColor: Color.Transparent, Scale: 1.7f); - dust.velocity *= 2f; - dust.noGravity = true; - } - } - - private void AI_154_VoidLens() - { - Main.CurrentFrameFlags.HadAnActiveInteractibleProjectile = true; - if (this.owner == Main.myPlayer) - { - for (int index = 0; index < 1000; ++index) - { - if (index != this.whoAmI) - { - Projectile projectile = Main.projectile[index]; - if (projectile.active && projectile.owner == this.owner && projectile.type == this.type) - { - if (this.timeLeft >= Main.projectile[index].timeLeft) - { - Main.projectile[index].Kill(); - } - else - { - this.Kill(); - return; - } - } - } - } - } - this.velocity = this.velocity * 0.94f; - this.direction = 1; - if (++this.frameCounter >= 5) - { - this.frameCounter = 0; - if (++this.frame >= Main.projFrames[this.type]) - this.frame = 0; - } - if ((double) this.Opacity < 1.0) - { - this.Opacity += 0.03f; - if ((double) this.Opacity > 1.0) - this.Opacity = 1f; - } - new VoidLensHelper(this).Update(); - } - - private void AI_153_ToiletPop() - { - Vector2 center = this.Center; - float SpeedY = -2f; - int num1 = 0; - int num2; - if ((double) this.ai[0] == 0.0) - { - num2 = 6; - num1 = 1; - } - else if ((double) this.ai[0] <= 10.0) - { - if (Main.rand.Next(5) == 0) - num1 = 1; - num2 = 2; - } - else - { - this.Kill(); - return; - } - ++this.ai[0]; - for (int index = 0; index < num2; ++index) - { - Dust dust = Dust.NewDustDirect(center, 3, 6, 216, SpeedY: SpeedY); - dust.velocity.X *= 0.5f; - dust.velocity.Y = -Math.Abs(dust.velocity.Y); - dust.position -= dust.velocity; - dust.scale = 0.8f; - } - for (int index = 0; index < num1; ++index) - { - Gore gore = Gore.NewGoreDirect(center, Vector2.UnitY * -3f + Main.rand.NextVector2Circular(1f, 1f), Main.rand.Next(580, 583)); - gore.velocity.Y = -Math.Abs(gore.velocity.Y); - } - } - - private void AI_150_GolfClubHelper() - { - Player player = Main.player[this.owner]; - if (!player.active) - this.Kill(); - else if ((double) player.gravDir == -1.0) - { - player.SetDummyItemTime(0); - this.Kill(); - } - else - { - bool flag = false; - Microsoft.Xna.Framework.Rectangle rectangle = Utils.CenteredRectangle(player.Center, new Vector2(500f, 500f)); - for (int index = 0; index < 1000; ++index) - { - Projectile projectile = Main.projectile[index]; - if (projectile.active && projectile.owner == Main.myPlayer && ProjectileID.Sets.IsAGolfBall[projectile.type] && rectangle.Contains(projectile.Center.ToPoint())) - { - flag = true; - break; - } - } - if (!flag && this.owner == Main.myPlayer && (double) this.ai[0] == 0.0) - player.TryPlacingAGolfBallNearANearbyTee(Main.player[this.owner].Center); - if (!player.channel && (double) this.ai[0] == 0.0) - { - SoundEngine.PlaySound(SoundID.Item1, player.Center); - for (int number = 0; number < 1000; ++number) - { - Projectile projectile = Main.projectile[number]; - Vector2 shotVector = Main.MouseWorld - projectile.Center; - if (projectile.active && ProjectileID.Sets.IsAGolfBall[projectile.type] && projectile.owner == this.owner && GolfHelper.ValidateShot((Entity) projectile, player, ref shotVector)) - { - float num1 = Main.rand.NextFloatDirection(); - for (float num2 = 0.0f; (double) num2 < 1.0; num2 += 0.1f) - { - Dust dust = Dust.NewDustPerfect(projectile.Center, 31, new Vector2?((6.283185f * num2 + num1).ToRotationVector2() * 0.8f), (int) sbyte.MaxValue); - dust.fadeIn = 0.0f; - if ((double) num2 % 0.200000002980232 == 0.0) - dust.velocity *= 0.4f; - } - SoundEngine.PlaySound(SoundID.Item126, projectile.Center); - if (this.owner == Main.myPlayer) - { - GolfHelper.ShotStrength shotStrength = GolfHelper.CalculateShotStrength(this, (Entity) projectile); - Vector2 velocity = Vector2.Normalize(shotVector) * shotStrength.AbsoluteStrength; - GolfHelper.HitGolfBall((Entity) projectile, velocity, shotStrength.RoughLandResistance); - NetMessage.SendData(27, number: number); - } - } - } - this.ai[0] = 1f; - this.ai[1] = 0.0f; - this.netUpdate = true; - } - if ((double) this.ai[0] == 1.0) - { - ++this.ai[1]; - if ((double) this.ai[1] >= (double) (player.HeldItem.useAnimation + 30)) - { - this.Kill(); - return; - } - this.velocity = Vector2.Zero; - player.ChangeDir(this.direction); - player.heldProj = this.whoAmI; - int frames = player.HeldItem.useAnimation - (int) this.ai[1]; - if (frames < 2) - frames = 2; - player.SetDummyItemTime(frames); - } - if ((double) this.ai[0] != 0.0) - return; - if (this.owner == Main.myPlayer) - { - Vector2 mouseWorld = Main.MouseWorld; - if (mouseWorld != this.Center) - { - this.netUpdate = true; - this.Center = mouseWorld; - } - if (Main.mouseRight && Main.mouseRightRelease) - { - this.Kill(); - player.mouseInterface = true; - Main.blockMouse = true; - player.SetItemTime(0); - player.itemAnimation = 0; - player.itemAnimationMax = 0; - player.reuseDelay = 0; - return; - } - } - if (this.position != this.oldPosition) - { - if ((double) this.Center.X - (double) player.Center.X > 0.0) - this.direction = 1; - else - this.direction = -1; - } - this.velocity = Vector2.Zero; - player.ChangeDir(this.direction); - player.heldProj = this.whoAmI; - ++this.ai[1]; - int val1 = player.HeldItem.useAnimation * 4; - if ((double) this.ai[1] > (double) (val1 * 3)) - this.ai[1] = (float) val1; - int frames1 = player.HeldItem.useAnimation + Math.Min(val1, (int) this.ai[1]); - if (frames1 < 2) - frames1 = 2; - player.SetDummyItemTime(frames1); - } - } - - public Color GetCeleb2Color() - { - switch ((int) this.ai[0]) - { - case 0: - return Color.Red; - case 1: - return Color.DarkOrange; - case 2: - return Color.Gold; - case 3: - return Color.LimeGreen; - case 4: - return Color.RoyalBlue; - case 5: - return new Color(80, 20, 180); - case 6: - return Color.HotPink; - default: - return Color.Transparent; - } - } - - private void AI_007_GrapplingHooks() - { - if (Main.player[this.owner].dead || Main.player[this.owner].stoned || Main.player[this.owner].webbed || Main.player[this.owner].frozen) - { - this.Kill(); - } - else - { - Vector2 mountedCenter = Main.player[this.owner].MountedCenter; - Vector2 vector2_1 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); - float num1 = mountedCenter.X - vector2_1.X; - float num2 = mountedCenter.Y - vector2_1.Y; - float num3 = (float) Math.Sqrt((double) num1 * (double) num1 + (double) num2 * (double) num2); - this.rotation = (float) Math.Atan2((double) num2, (double) num1) - 1.57f; - if ((double) this.ai[0] == 2.0 && this.type == 865) - { - float num4 = 1.570796f; - this.rotation = (float) (int) Math.Round((double) this.rotation / (double) num4) * num4; - } - if (Main.myPlayer == this.owner) - { - int i = (int) ((double) this.Center.X / 16.0); - int j = (int) ((double) this.Center.Y / 16.0); - if (i > 0 && j > 0 && i < Main.maxTilesX && j < Main.maxTilesY && Main.tile[i, j].nactive() && Main.tile[i, j].type >= (ushort) 481 && Main.tile[i, j].type <= (ushort) 483 && Main.rand.Next(16) == 0) - { - WorldGen.KillTile(i, j); - if (Main.netMode != 0) - NetMessage.SendData(17, number2: ((float) i), number3: ((float) j)); - } - } - if ((double) num3 > 2500.0) - this.Kill(); - if (this.type == 256) - this.rotation = (float) Math.Atan2((double) num2, (double) num1) + 3.925f; - if (this.type == 446) - { - Lighting.AddLight(mountedCenter, 0.0f, 0.4f, 0.3f); - ++this.localAI[0]; - if ((double) this.localAI[0] >= 28.0) - this.localAI[0] = 0.0f; - DelegateMethods.v3_1 = new Vector3(0.0f, 0.4f, 0.3f); - Utils.PlotTileLine(this.Center, mountedCenter, 8f, new Utils.TileActionAttempt(DelegateMethods.CastLightOpen)); - } - if (this.type == 652 && ++this.frameCounter >= 7) - { - this.frameCounter = 0; - if (++this.frame >= Main.projFrames[this.type]) - this.frame = 0; - } - if (this.type >= 646 && this.type <= 649) - { - Vector3 rgb = Vector3.Zero; - switch (this.type) - { - case 646: - rgb = new Vector3(0.7f, 0.5f, 0.1f); - break; - case 647: - rgb = new Vector3(0.0f, 0.6f, 0.7f); - break; - case 648: - rgb = new Vector3(0.6f, 0.2f, 0.6f); - break; - case 649: - rgb = new Vector3(0.6f, 0.6f, 0.9f); - break; - } - Lighting.AddLight(mountedCenter, rgb); - Lighting.AddLight(this.Center, rgb); - DelegateMethods.v3_1 = rgb; - Utils.PlotTileLine(this.Center, mountedCenter, 8f, new Utils.TileActionAttempt(DelegateMethods.CastLightOpen)); - } - if ((double) this.ai[0] == 0.0) - { - if ((double) num3 > 300.0 && this.type == 13 || (double) num3 > 400.0 && this.type == 32 || (double) num3 > 440.0 && this.type == 73 || (double) num3 > 440.0 && this.type == 74 || (double) num3 > 300.0 && this.type == 165 || (double) num3 > 350.0 && this.type == 256 || (double) num3 > 500.0 && this.type == 315 || (double) num3 > 550.0 && this.type == 322 || (double) num3 > 400.0 && this.type == 331 || (double) num3 > 550.0 && this.type == 332 || (double) num3 > 400.0 && this.type == 372 || (double) num3 > 300.0 && this.type == 396 || (double) num3 > 550.0 && this.type >= 646 && this.type <= 649 || (double) num3 > 600.0 && this.type == 652 || (double) num3 > 300.0 && this.type == 865 || (double) num3 > 500.0 && this.type == 935 || (double) num3 > 480.0 && this.type >= 486 && this.type <= 489 || (double) num3 > 500.0 && this.type == 446) - this.ai[0] = 1f; - else if (this.type >= 230 && this.type <= 235) - { - int num5 = 300 + (this.type - 230) * 30; - if ((double) num3 > (double) num5) - this.ai[0] = 1f; - } - else if (this.type == 753) - { - int num6 = 420; - if ((double) num3 > (double) num6) - this.ai[0] = 1f; - } - Vector2 vector2_2 = this.Center - new Vector2(5f); - Vector2 vector2_3 = this.Center + new Vector2(5f); - Point tileCoordinates1 = (vector2_2 - new Vector2(16f)).ToTileCoordinates(); - Vector2 vector2_4 = new Vector2(32f); - Point tileCoordinates2 = (vector2_3 + vector2_4).ToTileCoordinates(); - int num7 = tileCoordinates1.X; - int num8 = tileCoordinates2.X; - int num9 = tileCoordinates1.Y; - int num10 = tileCoordinates2.Y; - if (num7 < 0) - num7 = 0; - if (num8 > Main.maxTilesX) - num8 = Main.maxTilesX; - if (num9 < 0) - num9 = 0; - if (num10 > Main.maxTilesY) - num10 = Main.maxTilesY; - Player player = Main.player[this.owner]; - List pointList = new List(); - for (int index1 = 0; index1 < player.grapCount; ++index1) - { - Projectile projectile = Main.projectile[player.grappling[index1]]; - if (projectile.aiStyle == 7 && (double) projectile.ai[0] == 2.0) - { - Point tileCoordinates3 = projectile.Center.ToTileCoordinates(); - Tile tileSafely1 = Framing.GetTileSafely(tileCoordinates3); - if (tileSafely1.type == (ushort) 314 || TileID.Sets.Platforms[(int) tileSafely1.type]) - { - for (int index2 = -2; index2 <= 2; ++index2) - { - for (int index3 = -2; index3 <= 2; ++index3) - { - Point pt = new Point(tileCoordinates3.X + index2, tileCoordinates3.Y + index3); - Tile tileSafely2 = Framing.GetTileSafely(pt); - if (tileSafely2.type == (ushort) 314 || TileID.Sets.Platforms[(int) tileSafely2.type]) - pointList.Add(pt); - } - } - } - } - } - for (int index4 = num7; index4 < num8; ++index4) - { - for (int index5 = num9; index5 < num10; ++index5) - { - if (Main.tile[index4, index5] == null) - Main.tile[index4, index5] = new Tile(); - Vector2 vector2_5; - vector2_5.X = (float) (index4 * 16); - vector2_5.Y = (float) (index5 * 16); - if ((double) vector2_2.X + 10.0 > (double) vector2_5.X && (double) vector2_2.X < (double) vector2_5.X + 16.0 && (double) vector2_2.Y + 10.0 > (double) vector2_5.Y && (double) vector2_2.Y < (double) vector2_5.Y + 16.0) - { - Tile theTile = Main.tile[index4, index5]; - if (theTile.nactive() && this.AI_007_GrapplingHooks_CanTileBeLatchedOnTo(theTile) && !pointList.Contains(new Point(index4, index5)) && (this.type != 403 || theTile.type == (ushort) 314) && !Main.player[this.owner].IsBlacklistedForGrappling(new Point(index4, index5))) - { - if (Main.player[this.owner].grapCount < 10) - { - Main.player[this.owner].grappling[Main.player[this.owner].grapCount] = this.whoAmI; - ++Main.player[this.owner].grapCount; - } - if (Main.myPlayer == this.owner) - { - int num11 = 0; - int index6 = -1; - int num12 = 100000; - if (this.type == 73 || this.type == 74) - { - for (int index7 = 0; index7 < 1000; ++index7) - { - if (index7 != this.whoAmI && Main.projectile[index7].active && Main.projectile[index7].owner == this.owner && Main.projectile[index7].aiStyle == 7 && (double) Main.projectile[index7].ai[0] == 2.0) - Main.projectile[index7].Kill(); - } - } - else - { - int num13 = 3; - if (this.type == 165) - num13 = 8; - if (this.type == 256) - num13 = 2; - if (this.type == 372) - num13 = 2; - if (this.type == 652) - num13 = 1; - if (this.type >= 646 && this.type <= 649) - num13 = 4; - for (int index8 = 0; index8 < 1000; ++index8) - { - if (Main.projectile[index8].active && Main.projectile[index8].owner == this.owner && Main.projectile[index8].aiStyle == 7) - { - if (Main.projectile[index8].timeLeft < num12) - { - index6 = index8; - num12 = Main.projectile[index8].timeLeft; - } - ++num11; - } - } - if (num11 > num13) - Main.projectile[index6].Kill(); - } - WorldGen.KillTile(index4, index5, true, true); - SoundEngine.PlaySound(0, index4 * 16, index5 * 16); - this.velocity.X = 0.0f; - this.velocity.Y = 0.0f; - this.ai[0] = 2f; - this.position.X = (float) (index4 * 16 + 8 - this.width / 2); - this.position.Y = (float) (index5 * 16 + 8 - this.height / 2); - Microsoft.Xna.Framework.Rectangle? tileVisualHitbox = WorldGen.GetTileVisualHitbox(index4, index5); - if (tileVisualHitbox.HasValue) - this.Center = tileVisualHitbox.Value.Center.ToVector2(); - this.damage = 0; - this.netUpdate = true; - if (Main.myPlayer == this.owner) - { - if (this.type == 935) - Main.player[this.owner].DoQueenSlimeHookTeleport(this.Center); - NetMessage.SendData(13, number: this.owner); - break; - } - break; - } - } - } - } - if ((double) this.ai[0] == 2.0) - break; - } - } - else if ((double) this.ai[0] == 1.0) - { - float num14 = 11f; - if (this.type == 32) - num14 = 15f; - if (this.type == 73 || this.type == 74) - num14 = 17f; - if (this.type == 315) - num14 = 20f; - if (this.type == 322) - num14 = 22f; - if (this.type >= 230 && this.type <= 235) - num14 = (float) (11.0 + (double) (this.type - 230) * 0.75); - if (this.type == 753) - num14 = 15f; - if (this.type == 446) - num14 = 20f; - if (this.type >= 486 && this.type <= 489) - num14 = 18f; - if (this.type >= 646 && this.type <= 649) - num14 = 24f; - if (this.type == 652) - num14 = 24f; - if (this.type == 332) - num14 = 17f; - if ((double) num3 < 24.0) - this.Kill(); - float num15 = num14 / num3; - float num16 = num1 * num15; - float num17 = num2 * num15; - this.velocity.X = num16; - this.velocity.Y = num17; - } - else - { - if ((double) this.ai[0] != 2.0) - return; - Point tileCoordinates = this.Center.ToTileCoordinates(); - if (Main.tile[tileCoordinates.X, tileCoordinates.Y] == null) - Main.tile[tileCoordinates.X, tileCoordinates.Y] = new Tile(); - bool flag = true; - if ((!Main.tile[tileCoordinates.X, tileCoordinates.Y].nactive() ? 0 : (this.AI_007_GrapplingHooks_CanTileBeLatchedOnTo(Main.tile[tileCoordinates.X, tileCoordinates.Y]) ? 1 : 0)) != 0) - flag = false; - if (flag) - { - this.ai[0] = 1f; - } - else - { - if (Main.player[this.owner].grapCount >= 10) - return; - Main.player[this.owner].grappling[Main.player[this.owner].grapCount] = this.whoAmI; - ++Main.player[this.owner].grapCount; - } - } - } - } - - private bool AI_007_GrapplingHooks_CanTileBeLatchedOnTo(Tile theTile) => ((Main.tileSolid[(int) theTile.type] | theTile.type == (ushort) 314 ? 1 : 0) | (this.type != 865 ? 0 : (TileID.Sets.IsATreeTrunk[(int) theTile.type] ? 1 : 0)) | (this.type != 865 ? 0 : (theTile.type == (ushort) 323 ? 1 : 0))) != 0; - - private void AI_147_Celeb2Rocket() - { - int index1 = 0; - int index2 = 1; - int index3 = 1; - ++this.localAI[index1]; - this.alpha = 0; - this.rotation = this.velocity.ToRotation() + 1.570796f; - int num1 = (int) this.ai[0]; - Lighting.AddLight(this.Center, this.GetCeleb2Color().ToVector3() * 0.5f); - switch (num1) - { - case 0: - if ((double) this.localAI[index1] >= 20.0) - { - this.velocity.Y += 0.12f; - this.penetrate = -1; - } - if ((double) this.velocity.Y > 16.0) - this.velocity.Y = 16f; - if ((double) this.localAI[index1] <= 20.0 || (double) this.localAI[index1] % 20.0 != 0.0) - break; - this.AI_147_Explosion(); - break; - case 1: - if ((double) this.localAI[index1] == 10.0) - this.velocity.Y -= 10f; - if ((double) this.localAI[index1] >= 10.0) - this.velocity.Y += 0.25f; - if ((double) this.velocity.Y > 16.0) - this.velocity.Y = 16f; - if ((double) this.localAI[index1] < 10.0) - break; - this.scale += 0.015f; - if ((double) this.scale > 2.5) - this.scale = 2.5f; - if ((double) this.localAI[index1] % 10.0 != 0.0) - break; - double y = (double) this.velocity.Y; - for (float num2 = 0.0f; (double) num2 < 1.0; num2 += 0.12f) - { - Vector2 spinningpoint = (Vector2.UnitX * -8f + -Vector2.UnitY.RotatedBy((double) num2 * 6.28318548202515) * new Vector2(2f, 4f)).RotatedBy((double) this.rotation - 1.57079637050629); - int index4 = Dust.NewDust(this.Center, 0, 0, 267, newColor: Color.Lerp(this.GetCeleb2Color(), Color.White, Main.rand.NextFloat() * 0.3f)); - Main.dust[index4].scale = 0.9f; - Main.dust[index4].fadeIn = 1.1f; - Main.dust[index4].noGravity = true; - Main.dust[index4].position = this.Center + spinningpoint; - Main.dust[index4].velocity = -this.velocity * 0.35f + spinningpoint * 0.35f; - Main.dust[index4].velocity *= this.scale; - if ((double) this.localAI[index1] == 10.0) - Main.dust[index4].velocity = spinningpoint.RotatedBy((double) this.velocity.ToRotation()) * 0.3f; - } - break; - case 2: - if ((double) this.localAI[index1] >= 60.0) - this.velocity.Y += 0.15f; - if ((double) this.velocity.Y <= 16.0) - break; - this.velocity.Y = 16f; - break; - case 3: - float num3 = this.localAI[index2]; - if ((double) num3 == 0.0) - { - float num4 = this.velocity.Length(); - this.localAI[index2] = num4; - num3 = num4; - } - if ((double) this.localAI[index1] >= 25.0 && (double) this.ai[index3] == 0.0) - { - if ((double) this.localAI[index1] >= 20.0) - this.velocity.Y += 0.15f; - if ((double) this.velocity.Y > 16.0) - this.velocity.Y = 16f; - } - if ((double) this.localAI[index1] < 20.0) - break; - float num5 = this.position.X; - float num6 = this.position.Y; - float num7 = 800f; - bool flag = false; - int num8 = 0; - if ((double) this.ai[index3] == 0.0) - { - for (int index5 = 0; index5 < 200; ++index5) - { - if (Main.npc[index5].CanBeChasedBy((object) this) && ((double) this.ai[index3] == 0.0 || (double) this.ai[index3] == (double) (index5 + 1))) - { - float num9 = Main.npc[index5].position.X + (float) (Main.npc[index5].width / 2); - float num10 = Main.npc[index5].position.Y + (float) (Main.npc[index5].height / 2); - float num11 = Math.Abs(this.position.X + (float) (this.width / 2) - num9) + Math.Abs(this.position.Y + (float) (this.height / 2) - num10); - if ((double) num11 < (double) num7 && Collision.CanHit(new Vector2(this.position.X + (float) (this.width / 2), this.position.Y + (float) (this.height / 2)), 1, 1, Main.npc[index5].position, Main.npc[index5].width, Main.npc[index5].height)) - { - num7 = num11; - num5 = num9; - num6 = num10; - flag = true; - num8 = index5; - } - } - } - if (flag) - this.ai[1] = (float) (num8 + 1); - flag = false; - } - if ((double) this.ai[index3] != 0.0) - { - int index6 = (int) ((double) this.ai[index3] - 1.0); - if (Main.npc[index6].active && Main.npc[index6].CanBeChasedBy((object) this, true)) - { - float num12 = Main.npc[index6].position.X + (float) (Main.npc[index6].width / 2); - float num13 = Main.npc[index6].position.Y + (float) (Main.npc[index6].height / 2); - if ((double) Math.Abs(this.position.X + (float) (this.width / 2) - num12) + (double) Math.Abs(this.position.Y + (float) (this.height / 2) - num13) < 1000.0) - { - flag = true; - num5 = Main.npc[index6].position.X + (float) (Main.npc[index6].width / 2); - num6 = Main.npc[index6].position.Y + (float) (Main.npc[index6].height / 2); - } - } - } - if (!this.friendly) - flag = false; - if (!flag) - break; - double num14 = (double) num3; - Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); - float num15 = num5 - vector2.X; - float num16 = num6 - vector2.Y; - double num17 = Math.Sqrt((double) num15 * (double) num15 + (double) num16 * (double) num16); - float num18 = (float) (num14 / num17); - float num19 = num15 * num18; - float num20 = num16 * num18; - int num21 = 8; - this.velocity.X = (this.velocity.X * (float) (num21 - 1) + num19) / (float) num21; - this.velocity.Y = (this.velocity.Y * (float) (num21 - 1) + num20) / (float) num21; - break; - case 4: - if ((double) this.localAI[index1] == 1.0 && (double) this.ai[1] == 1.0) - this.localAI[index1] += 45f; - float x = this.velocity.SafeNormalize(Vector2.Zero).RotatedBy((double) this.localAI[index1] * 0.0698131695389748).X; - this.position = this.position + this.velocity.SafeNormalize(Vector2.Zero).RotatedBy(1.57079637050629) * x * 3f; - this.scale = 2f; - if ((double) this.localAI[index1] >= 10.0) - this.velocity.Y += 0.04f; - if ((double) this.velocity.Y <= 16.0) - break; - this.velocity.Y = 16f; - break; - case 5: - if ((double) this.localAI[index1] >= 40.0) - this.velocity.Y += 0.08f; - if ((double) this.velocity.Y <= 16.0) - break; - this.velocity.Y = 16f; - break; - case 6: - if ((double) this.localAI[index1] >= 30.0) - this.velocity.Y += 0.1f; - if ((double) this.velocity.Y <= 16.0) - break; - this.velocity.Y = 16f; - break; - } - } - - private void AI_148_StarSpawner() - { - if (Main.dayTime) - { - this.Kill(); - } - else - { - this.ai[0] += (float) Main.dayRate; - if ((double) this.localAI[0] == 0.0 && Main.netMode != 2) - { - this.localAI[0] = 1f; - if ((double) Main.LocalPlayer.position.Y < Main.worldSurface * 16.0) - Star.StarFall(this.position.X); - } - if (this.owner != Main.myPlayer || (double) this.ai[0] < 180.0) - return; - if ((double) this.ai[1] > -1.0) - { - this.velocity.X *= 0.35f; - if ((double) this.Center.X < (double) Main.player[(int) this.ai[1]].Center.X) - this.velocity.X = Math.Abs(this.velocity.X); - else - this.velocity.X = -Math.Abs(this.velocity.X); - } - Projectile.NewProjectile(this.position.X, this.position.Y, this.velocity.X, this.velocity.Y, 12, 1000, 10f, Main.myPlayer); - this.Kill(); - } - } - - private void AI_147_Explosion() - { - switch ((int) this.ai[0]) - { - case 0: - for (int index = 0; index < 4; ++index) - Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); - for (int index1 = 0; index1 < 20; ++index1) - { - int index2 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 130, Alpha: 200, Scale: 1.2f); - Main.dust[index2].noGravity = true; - Main.dust[index2].velocity *= 3f; - int index3 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 130, Alpha: 200, Scale: 0.5f); - Main.dust[index3].velocity *= 1.2f; - Main.dust[index3].noGravity = true; - } - for (int index4 = 0; index4 < 1; ++index4) - { - int index5 = Gore.NewGore(this.position + new Vector2((float) (this.width * Main.rand.Next(100)) / 100f, (float) (this.height * Main.rand.Next(100)) / 100f) - Vector2.One * 10f, new Vector2(), Main.rand.Next(61, 64)); - Main.gore[index5].velocity *= 0.3f; - Main.gore[index5].velocity.X += (float) Main.rand.Next(-10, 11) * 0.05f; - Main.gore[index5].velocity.Y += (float) Main.rand.Next(-10, 11) * 0.05f; - } - break; - case 1: - Color celeb2Color1 = this.GetCeleb2Color(); - Vector2 center1 = this.Center; - double num1 = (double) Main.rand.NextFloat(); - for (float num2 = 0.0f; (double) num2 < 1.0; num2 += 0.0125f) - { - Dust dust = Dust.NewDustPerfect(center1, 278, Alpha: 200, newColor: Color.Lerp(celeb2Color1, Color.White, Main.rand.NextFloat() * 0.6f)); - dust.scale = 1.1f; - dust.fadeIn = 1.3f; - dust.velocity *= (float) ((double) Main.rand.NextFloat() * 2.0 + 2.0); - if ((double) dust.velocity.Y > 0.0) - dust.velocity *= 0.3f; - dust.velocity *= 2f; - } - for (int index6 = 0; index6 < 3; ++index6) - { - int index7 = Gore.NewGore(this.position + new Vector2((float) (this.width * Main.rand.Next(100)) / 100f, (float) (this.height * Main.rand.Next(100)) / 100f) - Vector2.One * 10f, new Vector2(), Main.rand.Next(61, 64)); - Main.gore[index7].velocity *= 0.3f; - Main.gore[index7].velocity.X += (float) Main.rand.Next(-10, 11) * 0.05f; - Main.gore[index7].velocity.Y += (float) Main.rand.Next(-10, 11) * 0.05f; - } - this.CreateGroundExplosion(40f, 20, 100, 2, 10, 2); - break; - case 2: - Vector2 center2 = this.Center; - Color celeb2Color2 = this.GetCeleb2Color(); - float num3 = 0.05f; - float num4 = 0.13f; - bool flag = Main.rand.Next(4) == 0; - if (flag) - { - num3 = 0.1f; - num4 = 0.1f; - } - float num5 = Main.rand.NextFloatDirection(); - for (float num6 = 0.0f; (double) num6 < 5.0; ++num6) - { - Vector2 spinningpoint = new Vector2(0.0f, -100f); - Vector2 vector2_1 = center2 + spinningpoint.RotatedBy((double) num5 + (double) num6 * 1.25663709640503); - Vector2 vector2_2 = center2 + spinningpoint.RotatedBy((double) num5 + ((double) num6 + 1.0) * 1.25663709640503); - Vector2 vector2_3 = center2 + spinningpoint.RotatedBy((double) num5 + ((double) num6 + 0.5) * 1.25663709640503) * 0.4f; - for (int index = 0; index < 2; ++index) - { - Vector2 vector2_4 = vector2_1; - Vector2 vector2_5 = vector2_3; - if (index == 1) - { - vector2_4 = vector2_3; - vector2_5 = vector2_2; - } - for (float amount = 0.0f; (double) amount < 1.0; amount += num4) - { - Vector2 vector2_6 = Vector2.Lerp(vector2_4, vector2_5, amount); - Vector2 Position = Vector2.Lerp(vector2_6, center2, 0.9f); - Vector2 vector2_7 = (vector2_6 - Position).SafeNormalize(Vector2.Zero); - Dust dust = Dust.NewDustPerfect(Position, 267, new Vector2?(Vector2.Zero), newColor: celeb2Color2, Scale: 0.5f); - dust.fadeIn = 1.2f; - dust.noGravity = true; - dust.velocity = vector2_7 * Vector2.Distance(vector2_6, Position) * num3; - } - } - } - if (flag) - { - for (int index = 0; index < 4; ++index) - Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); - for (int index8 = 0; index8 < 60; ++index8) - { - int index9 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 228, Alpha: 200, Scale: 2.5f); - Main.dust[index9].noGravity = true; - Main.dust[index9].velocity *= 8f; - int index10 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 228, Alpha: 200, Scale: 1.5f); - Main.dust[index10].velocity *= 4.2f; - Main.dust[index10].noGravity = true; - } - for (int index11 = 0; index11 < 1; ++index11) - { - int index12 = Gore.NewGore(this.position + new Vector2((float) (this.width * Main.rand.Next(100)) / 100f, (float) (this.height * Main.rand.Next(100)) / 100f) - Vector2.One * 10f, new Vector2(), Main.rand.Next(61, 64)); - Main.gore[index12].velocity *= 0.3f; - Main.gore[index12].velocity.X += (float) Main.rand.Next(-10, 11) * 0.05f; - Main.gore[index12].velocity.Y += (float) Main.rand.Next(-10, 11) * 0.05f; - } - break; - } - for (int index = 0; index < 4; ++index) - Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); - for (int index13 = 0; index13 < 40; ++index13) - { - int index14 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 228, Alpha: 200, Scale: 2.5f); - Main.dust[index14].noGravity = true; - Main.dust[index14].velocity *= 4f; - int index15 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 228, Alpha: 200, Scale: 1.5f); - Main.dust[index15].velocity *= 2.2f; - Main.dust[index15].noGravity = true; - } - for (int index16 = 0; index16 < 1; ++index16) - { - int index17 = Gore.NewGore(this.position + new Vector2((float) (this.width * Main.rand.Next(100)) / 100f, (float) (this.height * Main.rand.Next(100)) / 100f) - Vector2.One * 10f, new Vector2(), Main.rand.Next(61, 64)); - Main.gore[index17].velocity *= 0.3f; - Main.gore[index17].velocity.X += (float) Main.rand.Next(-10, 11) * 0.05f; - Main.gore[index17].velocity.Y += (float) Main.rand.Next(-10, 11) * 0.05f; - } - break; - case 3: - Color celeb2Color3 = this.GetCeleb2Color(); - Vector2 center3 = this.Center; - for (int index = 0; index < 4; ++index) - Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); - float num7 = Main.rand.NextFloat() * 6.283185f; - for (int index = 0; index < 40; ++index) - { - Dust dust = Dust.NewDustPerfect(center3, 278, Alpha: 100, newColor: Color.Lerp(celeb2Color3, Color.White, Main.rand.NextFloat() * 0.3f)); - dust.scale = (float) (1.29999995231628 * ((double) dust.velocity.Length() / 2.0)); - dust.fadeIn = (float) (1.5 * ((double) dust.velocity.Length() / 2.0)); - dust.noGravity = true; - dust.velocity *= 6f; - if ((double) Math.Abs(dust.velocity.X) > (double) Math.Abs(dust.velocity.Y)) - dust.velocity.Y *= 0.1f; - else - dust.velocity.X *= 0.1f; - dust.velocity = dust.velocity.RotatedBy((double) num7); - } - for (int index18 = 0; index18 < 1; ++index18) - { - int index19 = Gore.NewGore(this.position + new Vector2((float) (this.width * Main.rand.Next(100)) / 100f, (float) (this.height * Main.rand.Next(100)) / 100f) - Vector2.One * 10f, new Vector2(), Main.rand.Next(61, 64)); - Main.gore[index19].velocity *= 0.3f; - Main.gore[index19].velocity.X += (float) Main.rand.Next(-10, 11) * 0.05f; - Main.gore[index19].velocity.Y += (float) Main.rand.Next(-10, 11) * 0.05f; - } - break; - case 4: - this.GetCeleb2Color(); - Vector2 center4 = this.Center; - double num8 = (double) Main.rand.NextFloat(); - for (float num9 = 0.0f; (double) num9 < 1.0; num9 += 0.025f) - { - Dust dust = Dust.NewDustPerfect(center4, 132, Alpha: 200); - dust.scale = 1.1f; - dust.fadeIn = 1.5f; - dust.velocity *= (float) ((double) Main.rand.NextFloat() * 2.0 + 2.0); - if ((double) dust.velocity.Y > 0.0) - dust.velocity *= 0.3f; - dust.velocity *= 2f; - } - for (int index20 = 0; index20 < 3; ++index20) - { - int index21 = Gore.NewGore(this.position + new Vector2((float) (this.width * Main.rand.Next(100)) / 100f, (float) (this.height * Main.rand.Next(100)) / 100f) - Vector2.One * 10f, new Vector2(), Main.rand.Next(61, 64)); - Main.gore[index21].velocity *= 0.3f; - Main.gore[index21].velocity.X += (float) Main.rand.Next(-10, 11) * 0.05f; - Main.gore[index21].velocity.Y += (float) Main.rand.Next(-10, 11) * 0.05f; - } - break; - case 5: - Color celeb2Color4 = this.GetCeleb2Color(); - Vector2 center5 = this.Center; - for (int index22 = 0; index22 < 20; ++index22) - { - int index23 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 278, Alpha: 200, newColor: Color.Lerp(celeb2Color4, Color.White, Main.rand.NextFloat() * 0.4f), Scale: 2.5f); - Main.dust[index23].fadeIn = 1.3f; - Main.dust[index23].scale = 1.1f; - Main.dust[index23].velocity *= 2f; - int index24 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 27, Alpha: 200, newColor: celeb2Color4, Scale: 2.5f); - Main.dust[index24].velocity *= 1.2f; - Main.dust[index24].noGravity = true; - } - break; - case 6: - Color celeb2Color5 = this.GetCeleb2Color(); - Vector2 center6 = this.Center; - for (int index = 0; index < 4; ++index) - Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); - for (float num10 = 0.0f; (double) num10 < 1.0; num10 += 0.015f) - { - Vector2 vector2 = Vector2.UnitY.RotatedBy((double) num10 * 6.28318548202515) * (float) (1.0 + (double) Main.rand.NextFloatDirection() * 0.100000001490116); - Dust dust = Dust.NewDustPerfect(center6 + vector2, 134, new Vector2?(Vector2.Zero), newColor: celeb2Color5); - dust.scale = 1.4f; - dust.velocity = vector2 * 5f; - dust.velocity.Y += -3f; - dust.velocity *= 2f; - } - for (float num11 = 0.0f; (double) num11 < 1.0; num11 += 0.025f) - { - Vector2 vector2 = Vector2.UnitY.RotatedBy((double) num11 * 6.28318548202515) * (float) (1.0 + (double) Main.rand.NextFloatDirection() * 0.200000002980232); - Dust dust = Dust.NewDustPerfect(center6 + vector2, 267, new Vector2?(Vector2.Zero), newColor: celeb2Color5); - dust.noGravity = true; - dust.scale = 0.4f; - dust.fadeIn = 1.2f; - dust.velocity = vector2 * 4f; - dust.velocity.Y += -3f; - dust.velocity *= 2f; - } - for (float num12 = 0.0f; (double) num12 < 1.0; num12 += 0.07f) - { - Vector2 vector2 = Vector2.UnitY.RotatedBy((double) num12 * 6.28318548202515) * (float) (1.0 + (double) Main.rand.NextFloatDirection() * 0.300000011920929); - Dust dust = Dust.NewDustPerfect(center6 + vector2, 267, new Vector2?(Vector2.Zero), newColor: celeb2Color5); - dust.noGravity = true; - dust.scale = 0.4f; - dust.fadeIn = 1.3f; - dust.velocity = vector2 * 7f; - dust.velocity.Y += -3f; - dust.velocity *= 2f; - } - for (int index25 = 0; index25 < 1; ++index25) - { - int index26 = Gore.NewGore(this.position + new Vector2((float) (this.width * Main.rand.Next(100)) / 100f, (float) (this.height * Main.rand.Next(100)) / 100f) - Vector2.One * 10f, new Vector2(), Main.rand.Next(61, 64)); - Main.gore[index26].velocity *= 0.3f; - Main.gore[index26].velocity.X += (float) Main.rand.Next(-10, 11) * 0.05f; - Main.gore[index26].velocity.Y += (float) Main.rand.Next(-10, 11) * 0.05f; - } - break; - } - } - - private void CreateGroundExplosion( - float MAX_SPREAD, - int fluff, - int distFluff, - int layerStart, - int layerEnd, - int layerJump) - { - Point tileCoordinates1 = this.TopLeft.ToTileCoordinates(); - Point tileCoordinates2 = this.BottomRight.ToTileCoordinates(); - tileCoordinates1.X -= fluff; - tileCoordinates1.Y -= fluff; - tileCoordinates2.X += fluff; - tileCoordinates2.Y += fluff; - int num1 = tileCoordinates1.X / 2 + tileCoordinates2.X / 2; - int num2 = this.width / 2 + distFluff; - for (int index1 = layerStart; index1 < layerEnd; index1 += layerJump) - { - int num3 = index1; - for (int x = tileCoordinates1.X; x <= tileCoordinates2.X; ++x) - { - for (int y = tileCoordinates1.Y; y <= tileCoordinates2.Y; ++y) - { - if (!WorldGen.InWorld(x, y, 10)) - return; - if ((double) Vector2.Distance(this.Center, new Vector2((float) (x * 16), (float) (y * 16))) <= (double) num2) - { - Tile tileSafely1 = Framing.GetTileSafely(x, y); - if (tileSafely1.active() && Main.tileSolid[(int) tileSafely1.type] && !Main.tileSolidTop[(int) tileSafely1.type] && !Main.tileFrameImportant[(int) tileSafely1.type]) - { - Tile tileSafely2 = Framing.GetTileSafely(x, y - 1); - if (!tileSafely2.active() || !Main.tileSolid[(int) tileSafely2.type] || Main.tileSolidTop[(int) tileSafely2.type]) - { - int tileDustAmount = WorldGen.KillTile_GetTileDustAmount(true, tileSafely1); - for (int index2 = 0; index2 < tileDustAmount; ++index2) - { - Dust dust = Main.dust[WorldGen.KillTile_MakeTileDust(x, y, tileSafely1)]; - dust.velocity.Y -= (float) (3.0 + (double) num3 * 1.5); - dust.velocity.Y *= Main.rand.NextFloat(); - dust.scale += (float) num3 * 0.03f; - } - if (num3 >= 2) - { - for (int index3 = 0; index3 < tileDustAmount - 1; ++index3) - { - Dust dust = Main.dust[WorldGen.KillTile_MakeTileDust(x, y, tileSafely1)]; - dust.velocity.Y -= 1f + (float) num3; - dust.velocity.Y *= Main.rand.NextFloat(); - } - } - if (tileDustAmount > 0 && Main.rand.Next(3) != 0) - { - float num4 = (float) Math.Abs(num1 - x) / (MAX_SPREAD / 2f); - Gore gore = Gore.NewGoreDirect(this.position, Vector2.Zero, 61 + Main.rand.Next(3), (float) (1.0 - (double) num3 * 0.150000005960464 + (double) num4 * 0.5)); - gore.velocity.Y -= (float) (0.100000001490116 + (double) num3 * 0.5 + (double) num4 * (double) num3 * 1.0); - gore.velocity.Y *= Main.rand.NextFloat(); - gore.position = new Vector2((float) (x * 16 + 20), (float) (y * 16 + 20)); - } - } - } - } - } - } - } - } - - public void CheckUsability(Player player, ref bool currentlyUsable) - { - if (this.aiStyle != 160) - return; - currentlyUsable = false; - } - - private void AI_163_Chum() - { - float num1 = 0.05f; - float num2 = (float) (this.width / 2); - for (int index = 0; index < 1000; ++index) - { - if (index != this.whoAmI && Main.projectile[index].active && Main.projectile[index].type == this.type && (double) Math.Abs(this.position.X - Main.projectile[index].position.X) + (double) Math.Abs(this.position.Y - Main.projectile[index].position.Y) < (double) num2) - { - if ((double) this.position.X < (double) Main.projectile[index].position.X) - this.velocity.X -= num1; - else - this.velocity.X += num1; - if ((double) this.position.Y < (double) Main.projectile[index].position.Y) - this.velocity.Y -= num1; - else - this.velocity.Y += num1; - } - } - if (this.wet) - { - this.velocity.X *= 0.9f; - int index1 = (int) ((double) this.Center.X + (double) ((this.width / 2 + 8) * this.direction)) / 16; - int index2 = (int) ((double) this.Center.Y / 16.0); - double num3 = (double) this.position.Y / 16.0; - int index3 = (int) (((double) this.position.Y + (double) this.height) / 16.0); - if (Main.tile[index1, index2] == null) - Main.tile[index1, index2] = new Tile(); - if (Main.tile[index1, index3] == null) - Main.tile[index1, index3] = new Tile(); - if ((double) this.velocity.Y > 0.0) - this.velocity.Y *= 0.5f; - float waterLine = this.AI_061_FishingBobber_GetWaterLine((int) ((double) this.Center.X / 16.0), (int) ((double) this.Center.Y / 16.0)); - if ((double) this.Center.Y > (double) waterLine) - { - this.velocity.Y -= 0.1f; - if ((double) this.velocity.Y < -8.0) - this.velocity.Y = -8f; - if ((double) this.Center.Y + (double) this.velocity.Y < (double) waterLine) - this.velocity.Y = waterLine - this.Center.Y; - } - else - this.velocity.Y = waterLine - this.Center.Y; - } - else - { - if ((double) this.velocity.Y == 0.0) - this.velocity.X *= 0.95f; - this.velocity.X *= 0.98f; - this.velocity.Y += 0.3f; - if ((double) this.velocity.Y > 15.8999996185303) - this.velocity.Y = 15.9f; - } - if (this.frameCounter == 0) - { - this.frameCounter = 1; - this.frame = Main.rand.Next(4); - } - if (this.frameCounter < 10 && this.wet) - { - ++this.frameCounter; - for (float num4 = 0.0f; (double) num4 < 1.0; num4 += 0.5f) - { - Gore gore = Gore.NewGoreDirect(this.position + Vector2.UnitY * 6f, Vector2.Zero, 1201, this.scale * 0.7f); - gore.velocity = Main.rand.NextVector2CircularEdge(10f, 10f); - if ((double) gore.velocity.Y > 0.0) - gore.velocity.Y *= -1f; - } - for (float num5 = 0.0f; (double) num5 < 2.0; ++num5) - { - Gore gore = Gore.NewGoreDirect(this.position + Vector2.UnitY * 6f, Vector2.Zero, 1208, (float) ((double) this.scale * 0.699999988079071 + (double) Main.rand.NextFloat() * 0.150000005960464)); - gore.velocity = Main.rand.NextVector2CircularEdge(4f, 4f); - if ((double) gore.velocity.Y > 0.0) - gore.velocity.Y *= -1f; - } - } - this.scale = Utils.GetLerpValue(0.0f, 60f, (float) this.timeLeft, true); - this.rotation += this.velocity.X * 0.14f; - bool flag = !this.wet && (double) this.velocity.Length() < 0.800000011920929; - int maxValue = this.wet ? 90 : 5; - if (Main.rand.Next(maxValue) == 0 && !flag) - { - Gore gore = Gore.NewGoreDirect(this.position + Vector2.UnitY * 6f, Vector2.Zero, 1201, this.scale * 0.7f); - if (this.wet) - gore.velocity = Vector2.UnitX * Main.rand.NextFloatDirection() * 0.75f + Vector2.UnitY * Main.rand.NextFloat(); - else if ((double) gore.velocity.Y < 0.0) - gore.velocity.Y = -gore.velocity.Y; - } - Vector2 spot = this.Center + Vector2.UnitY * 16f; - if ((double) this.ai[0] >= 10.0 && this.timeLeft > 60) - { - this.timeLeft = 60; - this.netUpdate = true; - } - if ((double) this.ai[0] >= 10.0 || this.timeLeft <= 60) - return; - Main.instance.ChumBucketProjectileHelper.AddChumLocation(spot); - } - - private void ReduceRemainingChumsInPool() - { - int x = (int) this.Center.X / 16; - int y = (int) this.Center.Y / 16; - List> tupleList = new List>(); - List intList = new List(); - for (int index = 0; index < 1000; ++index) - { - Projectile projectile = Main.projectile[index]; - if (projectile.active && projectile.owner == Main.myPlayer && projectile.timeLeft > 60 && projectile.type == 820) - tupleList.Add(new Tuple(index, (projectile.Center + Vector2.UnitY * 16f).ToTileCoordinates())); - } - if (tupleList.Count == 0) - return; - int minX; - int maxX; - Projectile.GetFishingPondWidth(x, y, out minX, out maxX); - Point point = new Point(); - for (int i = minX; i <= maxX; ++i) - { - point.X = i; - int j = y; - while (Main.tile[i, j].liquid > (byte) 0 && !WorldGen.SolidTile(i, j) && j < Main.maxTilesY - 10) - { - ++j; - point.Y = j; - for (int index = tupleList.Count - 1; index >= 0; --index) - { - if (tupleList[index].Item2 == point) - { - intList.Add(tupleList[index].Item1); - tupleList.RemoveAt(index); - } - } - if (tupleList.Count == 0) - break; - } - if (tupleList.Count == 0) - break; - } - for (int index = 0; index < intList.Count; ++index) - { - Projectile projectile = Main.projectile[intList[index]]; - ++projectile.ai[0]; - projectile.netUpdate = true; - } + // ISSUE: The method is too long to display (80533 instructions) } private void AI_061_FishingBobber() { - Player player = Main.player[this.owner]; this.timeLeft = 60; - bool flag1 = false; - if (player.inventory[player.selectedItem].fishingPole == 0 || player.CCed || player.noItems) - flag1 = true; - else if (player.inventory[player.selectedItem].shoot != this.type) - flag1 = true; - else if (player.pulley) - flag1 = true; - else if (player.dead) - flag1 = true; - if (flag1) - { + if (Main.player[this.owner].inventory[Main.player[this.owner].selectedItem].fishingPole == 0 || Main.player[this.owner].CCed || Main.player[this.owner].noItems) this.Kill(); + else if (Main.player[this.owner].inventory[Main.player[this.owner].selectedItem].shoot != this.type) + this.Kill(); + else if (Main.player[this.owner].pulley) + this.Kill(); + else if (Main.player[this.owner].dead) + this.Kill(); + if ((double) this.ai[1] > 0.0 && (double) this.localAI[1] >= 0.0) + { + this.localAI[1] = -1f; + if (!this.lavaWet && !this.honeyWet) + { + for (int index1 = 0; index1 < 100; ++index1) + { + int index2 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y - 10f), this.width + 12, 24, Dust.dustWater()); + Main.dust[index2].velocity.Y -= 4f; + Main.dust[index2].velocity.X *= 2.5f; + Main.dust[index2].scale = 0.8f; + Main.dust[index2].alpha = 100; + Main.dust[index2].noGravity = true; + } + Main.PlaySound(19, (int) this.position.X, (int) this.position.Y, 0); + } + } + if ((double) this.ai[0] >= 1.0) + { + if ((double) this.ai[0] == 2.0) + { + ++this.ai[0]; + Main.PlaySound(SoundID.Item17, this.position); + if (!this.lavaWet && !this.honeyWet) + { + for (int index3 = 0; index3 < 100; ++index3) + { + int index4 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y - 10f), this.width + 12, 24, Dust.dustWater()); + Main.dust[index4].velocity.Y -= 4f; + Main.dust[index4].velocity.X *= 2.5f; + Main.dust[index4].scale = 0.8f; + Main.dust[index4].alpha = 100; + Main.dust[index4].noGravity = true; + } + Main.PlaySound(19, (int) this.position.X, (int) this.position.Y, 0); + } + } + if ((double) this.localAI[0] < 100.0) + ++this.localAI[0]; + this.tileCollide = false; + int num1 = 10; + Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); + float num2 = Main.player[this.owner].position.X + (float) (Main.player[this.owner].width / 2) - vector2.X; + float num3 = Main.player[this.owner].position.Y + (float) (Main.player[this.owner].height / 2) - vector2.Y; + float num4 = (float) Math.Sqrt((double) num2 * (double) num2 + (double) num3 * (double) num3); + if ((double) num4 > 3000.0) + this.Kill(); + float num5 = (float) (15.8999996185303 / (double) num4); + float num6 = num2 * num5; + float num7 = num3 * num5; + this.velocity.X = (this.velocity.X * (float) (num1 - 1) + num6) / (float) num1; + this.velocity.Y = (this.velocity.Y * (float) (num1 - 1) + num7) / (float) num1; + if (Main.myPlayer == this.owner && new Microsoft.Xna.Framework.Rectangle((int) this.position.X, (int) this.position.Y, this.width, this.height).Intersects(new Microsoft.Xna.Framework.Rectangle((int) Main.player[this.owner].position.X, (int) Main.player[this.owner].position.Y, Main.player[this.owner].width, Main.player[this.owner].height))) + { + if ((double) this.ai[1] > 0.0 && (double) this.ai[1] < 3930.0) + { + int Type = (int) this.ai[1]; + Item newItem = new Item(); + newItem.SetDefaults(Type); + if (Type == 3196) + { + int num8 = Main.player[this.owner].FishingLevel(); + int minValue = (num8 / 20 + 3) / 2; + int num9 = (num8 / 10 + 6) / 2; + if (Main.rand.Next(50) < num8) + ++num9; + if (Main.rand.Next(100) < num8) + ++num9; + if (Main.rand.Next(150) < num8) + ++num9; + if (Main.rand.Next(200) < num8) + ++num9; + int num10 = Main.rand.Next(minValue, num9 + 1); + newItem.stack = num10; + } + if (Type == 3197) + { + int num11 = Main.player[this.owner].FishingLevel(); + int minValue = (num11 / 4 + 15) / 2; + int num12 = (num11 / 2 + 30) / 2; + if (Main.rand.Next(50) < num11) + num12 += 4; + if (Main.rand.Next(100) < num11) + num12 += 4; + if (Main.rand.Next(150) < num11) + num12 += 4; + if (Main.rand.Next(200) < num11) + num12 += 4; + int num13 = Main.rand.Next(minValue, num12 + 1); + newItem.stack = num13; + } + newItem.newAndShiny = true; + if (Main.player[this.owner].GetItem(this.owner, newItem).stack > 0) + { + int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type, noGrabDelay: true); + if (Main.netMode == 1) + NetMessage.SendData(21, number: number, number2: 1f); + } + else + { + newItem.position.X = this.Center.X - (float) (newItem.width / 2); + newItem.position.Y = this.Center.Y - (float) (newItem.height / 2); + newItem.active = true; + ItemText.NewText(newItem, 0); + } + } + this.Kill(); + } + this.rotation = (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X) + 1.57f; } else { - if ((double) this.ai[1] > 0.0 && (double) this.localAI[1] != 0.0) + bool flag = false; + Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); + float num14 = Main.player[this.owner].position.X + (float) (Main.player[this.owner].width / 2) - vector2.X; + float num15 = Main.player[this.owner].position.Y + (float) (Main.player[this.owner].height / 2) - vector2.Y; + this.rotation = (float) Math.Atan2((double) num15, (double) num14) + 1.57f; + if (Math.Sqrt((double) num14 * (double) num14 + (double) num15 * (double) num15) > 900.0) + this.ai[0] = 1f; + if (this.wet) { - this.localAI[1] = 0.0f; - if (!this.lavaWet && !this.honeyWet) - this.AI_061_FishingBobber_DoASplash(); - } - if ((double) this.ai[0] >= 1.0) - { - if ((double) this.ai[0] == 2.0) + this.rotation = 0.0f; + this.velocity.X *= 0.9f; + int index5 = (int) ((double) this.Center.X + (double) ((this.width / 2 + 8) * this.direction)) / 16; + int index6 = (int) ((double) this.Center.Y / 16.0); + double num16 = (double) this.position.Y / 16.0; + int index7 = (int) (((double) this.position.Y + (double) this.height) / 16.0); + if (Main.tile[index5, index6] == null) + Main.tile[index5, index6] = new Tile(); + if (Main.tile[index5, index7] == null) + Main.tile[index5, index7] = new Tile(); + if ((double) this.velocity.Y > 0.0) + this.velocity.Y *= 0.5f; + int index8 = (int) ((double) this.Center.X / 16.0); + int index9 = (int) ((double) this.Center.Y / 16.0); + float num17 = this.position.Y + (float) this.height; + if (Main.tile[index8, index9 - 1] == null) + Main.tile[index8, index9 - 1] = new Tile(); + if (Main.tile[index8, index9] == null) + Main.tile[index8, index9] = new Tile(); + if (Main.tile[index8, index9 + 1] == null) + Main.tile[index8, index9 + 1] = new Tile(); + if (Main.tile[index8, index9 - 1].liquid > (byte) 0) + num17 = (float) (index9 * 16) - (float) ((int) Main.tile[index8, index9 - 1].liquid / 16); + else if (Main.tile[index8, index9].liquid > (byte) 0) + num17 = (float) ((index9 + 1) * 16) - (float) ((int) Main.tile[index8, index9].liquid / 16); + else if (Main.tile[index8, index9 + 1].liquid > (byte) 0) + num17 = (float) ((index9 + 2) * 16) - (float) ((int) Main.tile[index8, index9 + 1].liquid / 16); + if ((double) this.Center.Y > (double) num17) { - ++this.ai[0]; - SoundEngine.PlaySound(SoundID.Item17, this.position); - if (!this.lavaWet && !this.honeyWet) - this.AI_061_FishingBobber_DoASplash(); + this.velocity.Y -= 0.1f; + if ((double) this.velocity.Y < -8.0) + this.velocity.Y = -8f; + if ((double) this.Center.Y + (double) this.velocity.Y < (double) num17) + this.velocity.Y = num17 - this.Center.Y; } - if ((double) this.localAI[0] < 100.0) - ++this.localAI[0]; - if (this.frameCounter == 0) - { - this.frameCounter = 1; - this.ReduceRemainingChumsInPool(); - } - this.tileCollide = false; - int num1 = 10; - Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); - float num2 = player.position.X + (float) (player.width / 2) - vector2.X; - float num3 = player.position.Y + (float) (player.height / 2) - vector2.Y; - float num4 = (float) Math.Sqrt((double) num2 * (double) num2 + (double) num3 * (double) num3); - if ((double) num4 > 3000.0) - this.Kill(); - float num5 = (float) (15.8999996185303 / (double) num4); - float num6 = num2 * num5; - float num7 = num3 * num5; - this.velocity.X = (this.velocity.X * (float) (num1 - 1) + num6) / (float) num1; - this.velocity.Y = (this.velocity.Y * (float) (num1 - 1) + num7) / (float) num1; - this.rotation = (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X) + 1.57f; - if (Main.myPlayer != this.owner || !this.Hitbox.Intersects(player.Hitbox)) - return; - this.Kill(); + else + this.velocity.Y = num17 - this.Center.Y; + if ((double) this.velocity.Y >= -0.01 && (double) this.velocity.Y <= 0.01) + flag = true; } else { - bool flag2 = false; - Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); - float num8 = player.position.X + (float) (player.width / 2) - vector2.X; - float num9 = player.position.Y + (float) (player.height / 2) - vector2.Y; - this.rotation = (float) Math.Atan2((double) num9, (double) num8) + 1.57f; - if (Math.Sqrt((double) num8 * (double) num8 + (double) num9 * (double) num9) > 900.0) - this.ai[0] = 1f; - if (this.wet) + if ((double) this.velocity.Y == 0.0) + this.velocity.X *= 0.95f; + this.velocity.X *= 0.98f; + this.velocity.Y += 0.2f; + if ((double) this.velocity.Y > 15.8999996185303) + this.velocity.Y = 15.9f; + } + if (Main.myPlayer == this.owner) + { + int num18 = Main.player[this.owner].FishingLevel(); + if (num18 < 0 && num18 == -1) + Main.player[this.owner].displayedFishingInfo = Language.GetTextValue("GameUI.FishingWarning"); + } + if ((double) this.ai[1] != 0.0) + flag = true; + if (!flag) + return; + if ((double) this.ai[1] == 0.0 && Main.myPlayer == this.owner) + { + int num19 = Main.player[this.owner].FishingLevel(); + if (num19 == -9000) { - this.rotation = 0.0f; - this.velocity.X *= 0.9f; - int index1 = (int) ((double) this.Center.X + (double) ((this.width / 2 + 8) * this.direction)) / 16; - int index2 = (int) ((double) this.Center.Y / 16.0); - double num10 = (double) this.position.Y / 16.0; - int index3 = (int) (((double) this.position.Y + (double) this.height) / 16.0); - if (Main.tile[index1, index2] == null) - Main.tile[index1, index2] = new Tile(); - if (Main.tile[index1, index3] == null) - Main.tile[index1, index3] = new Tile(); - if ((double) this.velocity.Y > 0.0) - this.velocity.Y *= 0.5f; - float waterLine = this.AI_061_FishingBobber_GetWaterLine((int) ((double) this.Center.X / 16.0), (int) ((double) this.Center.Y / 16.0)); - if ((double) this.Center.Y > (double) waterLine) - { - this.velocity.Y -= 0.1f; - if ((double) this.velocity.Y < -8.0) - this.velocity.Y = -8f; - if ((double) this.Center.Y + (double) this.velocity.Y < (double) waterLine) - this.velocity.Y = waterLine - this.Center.Y; - } - else - this.velocity.Y = waterLine - this.Center.Y; - if ((double) this.velocity.Y >= -0.01 && (double) this.velocity.Y <= 0.01) - flag2 = true; + this.localAI[1] += 5f; + this.localAI[1] += (float) Main.rand.Next(1, 3); + if ((double) this.localAI[1] <= 660.0) + return; + this.localAI[1] = 0.0f; + this.FishingCheck(); } else { - if ((double) this.velocity.Y == 0.0) - this.velocity.X *= 0.95f; - this.velocity.X *= 0.98f; - this.velocity.Y += 0.2f; - if ((double) this.velocity.Y > 15.8999996185303) - this.velocity.Y = 15.9f; - } - if (Main.myPlayer == this.owner && player.GetFishingConditions().BaitItemType == 2673) - player.displayedFishingInfo = Language.GetTextValue("GameUI.FishingWarning"); - if ((double) this.ai[1] != 0.0) - flag2 = true; - if (!flag2) - return; - if ((double) this.ai[1] == 0.0 && Main.myPlayer == this.owner) - { - int finalFishingLevel = player.GetFishingConditions().FinalFishingLevel; - if (Main.rand.Next(300) < finalFishingLevel) + if (Main.rand.Next(300) < num19) this.localAI[1] += (float) Main.rand.Next(1, 3); - this.localAI[1] += (float) (finalFishingLevel / 30); + this.localAI[1] += (float) (num19 / 30); this.localAI[1] += (float) Main.rand.Next(1, 3); if (Main.rand.Next(60) == 0) this.localAI[1] += 60f; @@ -21768,111 +11227,26 @@ label_12: this.localAI[1] = 0.0f; this.FishingCheck(); } - else - { - if ((double) this.ai[1] >= 0.0) - return; - if ((double) this.velocity.Y == 0.0 || this.honeyWet && (double) Math.Abs(this.velocity.Y) <= 0.00999999977648258) - { - this.velocity.Y = (float) Main.rand.Next(100, 500) * 0.015f; - this.velocity.X = (float) Main.rand.Next(-100, 101) * 0.015f; - this.wet = false; - this.lavaWet = false; - this.honeyWet = false; - } - this.ai[1] += (float) Main.rand.Next(1, 5); - if ((double) this.ai[1] < 0.0) - return; - this.ai[1] = 0.0f; - this.localAI[1] = 0.0f; - this.netUpdate = true; - } } - } - } - - private float AI_061_FishingBobber_GetWaterLine(int X, int Y) - { - float num = this.position.Y + (float) this.height; - if (Main.tile[X, Y - 1] == null) - Main.tile[X, Y - 1] = new Tile(); - if (Main.tile[X, Y] == null) - Main.tile[X, Y] = new Tile(); - if (Main.tile[X, Y + 1] == null) - Main.tile[X, Y + 1] = new Tile(); - if (Main.tile[X, Y - 1].liquid > (byte) 0) - num = (float) (Y * 16) - (float) ((int) Main.tile[X, Y - 1].liquid / 16); - else if (Main.tile[X, Y].liquid > (byte) 0) - num = (float) ((Y + 1) * 16) - (float) ((int) Main.tile[X, Y].liquid / 16); - else if (Main.tile[X, Y + 1].liquid > (byte) 0) - num = (float) ((Y + 2) * 16) - (float) ((int) Main.tile[X, Y + 1].liquid / 16); - return num; - } - - private void AI_061_FishingBobber_DoASplash() - { - for (int index1 = 0; index1 < 100; ++index1) - { - int index2 = Dust.NewDust(new Vector2(this.position.X - 6f, this.position.Y - 10f), this.width + 12, 24, Dust.dustWater()); - Main.dust[index2].velocity.Y -= 4f; - Main.dust[index2].velocity.X *= 2.5f; - Main.dust[index2].scale = 0.8f; - Main.dust[index2].alpha = 100; - Main.dust[index2].noGravity = true; - } - SoundEngine.PlaySound(19, (int) this.position.X, (int) this.position.Y, 0); - } - - private void AI_061_FishingBobber_GiveItemToPlayer(Player thePlayer, int itemType) - { - Item newItem = new Item(); - newItem.SetDefaults(itemType); - if (itemType == 3196) - { - int finalFishingLevel = thePlayer.GetFishingConditions().FinalFishingLevel; - int minValue = (finalFishingLevel / 20 + 3) / 2; - int num1 = (finalFishingLevel / 10 + 6) / 2; - if (Main.rand.Next(50) < finalFishingLevel) - ++num1; - if (Main.rand.Next(100) < finalFishingLevel) - ++num1; - if (Main.rand.Next(150) < finalFishingLevel) - ++num1; - if (Main.rand.Next(200) < finalFishingLevel) - ++num1; - int num2 = Main.rand.Next(minValue, num1 + 1); - newItem.stack = num2; - } - if (itemType == 3197) - { - int finalFishingLevel = thePlayer.GetFishingConditions().FinalFishingLevel; - int minValue = (finalFishingLevel / 4 + 15) / 2; - int num3 = (finalFishingLevel / 2 + 30) / 2; - if (Main.rand.Next(50) < finalFishingLevel) - num3 += 4; - if (Main.rand.Next(100) < finalFishingLevel) - num3 += 4; - if (Main.rand.Next(150) < finalFishingLevel) - num3 += 4; - if (Main.rand.Next(200) < finalFishingLevel) - num3 += 4; - int num4 = Main.rand.Next(minValue, num3 + 1); - newItem.stack = num4; - } - newItem.newAndShiny = true; - if (thePlayer.GetItem(this.owner, newItem, new GetItemSettings()).stack > 0) - { - int number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, itemType, noGrabDelay: true); - if (Main.netMode != 1) - return; - NetMessage.SendData(21, number: number, number2: 1f); - } - else - { - newItem.position.X = this.Center.X - (float) (newItem.width / 2); - newItem.position.Y = this.Center.Y - (float) (newItem.height / 2); - newItem.active = true; - PopupText.NewText(PopupTextContext.RegularItemPickup, newItem, 0); + else + { + if ((double) this.ai[1] >= 0.0) + return; + if ((double) this.velocity.Y == 0.0 || this.honeyWet && (double) this.velocity.Y >= -0.01 && (double) this.velocity.Y <= 0.01) + { + this.velocity.Y = (float) Main.rand.Next(100, 500) * 0.015f; + this.velocity.X = (float) Main.rand.Next(-100, 101) * 0.015f; + this.wet = false; + this.lavaWet = false; + this.honeyWet = false; + } + this.ai[1] += (float) Main.rand.Next(1, 5); + if ((double) this.ai[1] < 0.0) + return; + this.ai[1] = 0.0f; + this.localAI[1] = 0.0f; + this.netUpdate = true; + } } } @@ -21892,16 +11266,12 @@ label_12: for (int index1 = 0; index1 < num2; ++index1) { int index2 = Projectile.NewProjectile(center, spinningpoint.RotatedBy((double) num1 + (double) num3 * (double) index1), 710, this.damage, this.knockBack, this.owner, ai1: -1f); - this.CopyLocalNPCImmunityTimes(Main.projectile[index2]); + Projectile projectile = Main.projectile[index2]; + for (int index3 = 0; index3 < this.localNPCImmunity.Length; ++index3) + projectile.localNPCImmunity[index3] = this.localNPCImmunity[index3]; } } - private void CopyLocalNPCImmunityTimes(Projectile p) - { - for (int index = 0; index < this.localNPCImmunity.Length; ++index) - p.localNPCImmunity[index] = this.localNPCImmunity[index]; - } - private void AI_001() { if (this.type == 469 && this.wet && !this.honeyWet) @@ -21925,10 +11295,6 @@ label_12: dust.noGravity = true; dust.customData = (object) Main.player[this.owner]; } - if ((double) this.ai[0] != 0.0) - SoundEngine.PlaySound(SoundID.Item114, this.position); - else - SoundEngine.PlaySound(SoundID.Item115, this.position); } this.alpha -= 15; if (this.alpha < 0) @@ -21960,7 +11326,7 @@ label_12: if ((double) this.localAI[0] == 0.0) { this.localAI[0] = 1f; - SoundEngine.PlaySound(SoundID.Item17, this.position); + Main.PlaySound(SoundID.Item17, this.position); for (int index2 = 0; index2 < 20; ++index2) { int index3 = Dust.NewDust(this.position, this.width, this.height, 30); @@ -21983,7 +11349,7 @@ label_12: if ((double) this.ai[1] == 0.0) { this.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item12, this.position); + Main.PlaySound(SoundID.Item12, this.position); } this.alpha -= 40; if (this.alpha < 0) @@ -22004,7 +11370,7 @@ label_12: if ((double) this.ai[1] == 0.0) { this.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item34, this.position); + Main.PlaySound(SoundID.Item34, this.position); } else if ((double) this.ai[1] == 1.0 && Main.netMode != 1) { @@ -22137,7 +11503,7 @@ label_12: if ((double) this.ai[1] == 0.0) { this.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item34, this.position); + Main.PlaySound(SoundID.Item34, this.position); } else if ((double) this.ai[1] == 1.0 && Main.netMode != 1) { @@ -22290,7 +11656,7 @@ label_12: { this.ai[1] = 1f; this.localAI[0] = (float) -Main.rand.Next(48); - SoundEngine.PlaySound(SoundID.Item34, this.position); + Main.PlaySound(SoundID.Item34, this.position); } else if ((double) this.ai[1] == 1.0 && this.owner == Main.myPlayer) { @@ -22497,7 +11863,7 @@ label_12: } Lighting.AddLight((int) this.Center.X / 16, (int) this.Center.Y / 16, 0.4f, 0.85f, 0.9f); if ((double) this.ai[1] == 0.0) - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_SkyDragonsFuryShot, this.Center); + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_SkyDragonsFuryShot, this.Center); ++this.ai[1]; if ((double) this.ai[1] >= 30.0) { @@ -22641,7 +12007,7 @@ label_12: if ((double) this.ai[1] == 0.0) { this.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item12, this.position); + Main.PlaySound(SoundID.Item12, this.position); } if ((double) this.localAI[0] == 0.0) { @@ -22673,7 +12039,7 @@ label_12: if ((double) this.ai[1] == 0.0) { this.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item12, this.position); + Main.PlaySound(SoundID.Item12, this.position); } this.alpha -= 40; if (this.alpha < 0) @@ -22694,7 +12060,7 @@ label_12: if ((double) this.ai[1] == 0.0) { this.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.DD2_LightningBugZap, this.position); + Main.PlaySound(SoundID.DD2_LightningBugZap, this.position); for (int index = 0; index < 8; ++index) { Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 272); @@ -22770,7 +12136,7 @@ label_12: this.frame = 0; } } - if (this.type == 225 && Main.rand.Next(2) == 0) + if (this.type == 225) { int index = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 40); Main.dust[index].noGravity = true; @@ -22792,58 +12158,25 @@ label_12: if ((double) this.ai[1] == 0.0) { this.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item17, this.position); + Main.PlaySound(SoundID.Item17, this.position); } } - else if (this.type == 605 || this.type == 920 || this.type == 921 || this.type == 926 || this.type == 937) + else if (this.type == 605) { - if (this.type == 920 && this.frameCounter == 0) - { - this.frameCounter = 1; - this.frame = Main.rand.Next(3); - } if (this.alpha == 0 && Main.rand.Next(3) == 0) { - int Type = 4; - Color newColor = new Color(78, 136, (int) byte.MaxValue, 150); - float Scale = 1.2f; - bool flag = true; - int num = 0; - if (this.type == 921) - { - Type = 243; - newColor = new Color(); - } - if (this.type == 926) - { - Type = 4; - newColor = NPC.AI_121_QueenSlime_GetDustColor(); - newColor.A = (byte) 150; - Scale = 1.2f; - num = 8; - flag = Main.rand.Next(2) == 0; - } - if (this.type == 937) - { - Type = 4; - newColor = NPC.AI_121_QueenSlime_GetDustColor(); - newColor.A = (byte) 150; - } - int index = Dust.NewDust(this.position - new Vector2((float) num, (float) num) + this.velocity, this.width + num * 2, this.height + num * 2, Type, Alpha: 50, newColor: newColor, Scale: Scale); + int index = Dust.NewDust(this.position - this.velocity * 3f, this.width, this.height, 4, Alpha: 50, newColor: new Color(78, 136, (int) byte.MaxValue, 150), Scale: 1.2f); Main.dust[index].velocity *= 0.3f; Main.dust[index].velocity += this.velocity * 0.3f; - Main.dust[index].noGravity = flag; + Main.dust[index].noGravity = true; } this.alpha -= 50; if (this.alpha < 0) this.alpha = 0; - if (this.type != 937 && (double) this.ai[1] == 0.0) + if ((double) this.ai[1] == 0.0) { this.ai[1] = 1f; - if (this.type == 926) - SoundEngine.PlaySound(SoundID.Item155, this.position); - else - SoundEngine.PlaySound(SoundID.Item154, this.position); + Main.PlaySound(SoundID.Item17, this.position); } } else if (this.type == 176) @@ -22862,7 +12195,7 @@ label_12: if ((double) this.ai[1] == 0.0) { this.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item17, this.position); + Main.PlaySound(SoundID.Item17, this.position); } } if (this.type == 350) @@ -22874,27 +12207,24 @@ label_12: if (this.alpha == 0) { int num = 2; - if (Main.rand.Next(3) != 0) + if (Main.rand.Next(2) == 0) { int index = Dust.NewDust(new Vector2(this.Center.X - (float) num, (float) ((double) this.Center.Y - (double) num - 2.0)) - this.velocity * 0.5f, num * 2, num * 2, 6, Alpha: 100); - Main.dust[index].scale *= (float) (1.29999995231628 + (double) Main.rand.Next(10) * 0.0500000007450581); + Main.dust[index].scale *= (float) (1.79999995231628 + (double) Main.rand.Next(10) * 0.100000001490116); Main.dust[index].velocity *= 0.2f; Main.dust[index].noGravity = true; - Main.dust[index].noLight = true; - Main.dust[index].velocity += this.velocity * 0.25f; } if (Main.rand.Next(4) == 0) { int index = Dust.NewDust(new Vector2(this.Center.X - (float) num, (float) ((double) this.Center.Y - (double) num - 2.0)) - this.velocity * 0.5f, num * 2, num * 2, 31, Alpha: 100, Scale: 0.5f); - Main.dust[index].fadeIn = (float) (0.600000023841858 + (double) Main.rand.Next(5) * 0.100000001490116); + Main.dust[index].fadeIn = (float) (1.0 + (double) Main.rand.Next(5) * 0.100000001490116); Main.dust[index].velocity *= 0.05f; - Main.dust[index].velocity += this.velocity * 0.25f; } } if ((double) this.ai[1] == 0.0) { this.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item42, this.position); + Main.PlaySound(SoundID.Item42, this.position); } } if (this.type == 325) @@ -22906,26 +12236,24 @@ label_12: if (this.alpha == 0) { int num = 2; - if (Main.rand.Next(3) != 0) + if (Main.rand.Next(2) == 0) { int index = Dust.NewDust(new Vector2(this.Center.X - (float) num, (float) ((double) this.Center.Y - (double) num - 2.0)) - this.velocity * 0.5f, num * 2, num * 2, 6, Alpha: 100); - Main.dust[index].scale *= (float) (1.20000004768372 + (double) Main.rand.Next(10) * 0.0500000007450581); + Main.dust[index].scale *= (float) (1.79999995231628 + (double) Main.rand.Next(10) * 0.100000001490116); Main.dust[index].velocity *= 0.2f; Main.dust[index].noGravity = true; - Main.dust[index].noLight = true; - Main.dust[index].velocity += this.velocity * 0.25f; } if (Main.rand.Next(4) == 0) { int index = Dust.NewDust(new Vector2(this.Center.X - (float) num, (float) ((double) this.Center.Y - (double) num - 2.0)) - this.velocity * 0.5f, num * 2, num * 2, 31, Alpha: 100, Scale: 0.5f); - Main.dust[index].fadeIn = (float) (0.5 + (double) Main.rand.Next(5) * 0.0500000007450581); + Main.dust[index].fadeIn = (float) (1.0 + (double) Main.rand.Next(5) * 0.100000001490116); Main.dust[index].velocity *= 0.05f; } } if ((double) this.ai[1] == 0.0) { this.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item42, this.position); + Main.PlaySound(SoundID.Item42, this.position); } } if (this.type == 469) @@ -22941,50 +12269,50 @@ label_12: else if (this.type == 83 && (double) this.ai[1] == 0.0) { this.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item33, this.position); + Main.PlaySound(SoundID.Item33, this.position); } else if (this.type == 408 && (double) this.ai[1] == 0.0) { this.ai[1] = 1f; - SoundEngine.PlaySound(4, (int) this.position.X, (int) this.position.Y, 19); + Main.PlaySound(4, (int) this.position.X, (int) this.position.Y, 19); } else if (this.type == 259 && (double) this.ai[1] == 0.0) { this.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item33, this.position); + Main.PlaySound(SoundID.Item33, this.position); } else if (this.type == 110 && (double) this.ai[1] == 0.0) { this.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item11, this.position); + Main.PlaySound(SoundID.Item11, this.position); } else if (this.type == 302 && (double) this.ai[1] == 0.0) { this.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item11, this.position); + Main.PlaySound(SoundID.Item11, this.position); } else if (this.type == 438 && (double) this.ai[1] == 0.0) { this.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item12, this.position); + Main.PlaySound(SoundID.Item12, this.position); } else if (this.type == 593 && (double) this.ai[1] == 0.0) { this.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item11, this.position); + Main.PlaySound(SoundID.Item11, this.position); } else if (this.type == 592 && (double) this.ai[1] == 0.0) { this.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item12, this.position); + Main.PlaySound(SoundID.Item12, this.position); } else if (this.type == 462 && (double) this.ai[1] == 0.0) { this.ai[1] = 1f; if (Main.rand.Next(2) == 0) - SoundEngine.PlaySound(SoundID.Item124, this.position); + Main.PlaySound(SoundID.Item124, this.position); else - SoundEngine.PlaySound(SoundID.Item125, this.position); + Main.PlaySound(SoundID.Item125, this.position); Vector2 vector2 = Vector2.Normalize(this.velocity); int num = Main.rand.Next(5, 10); for (int index38 = 0; index38 < num; ++index38) @@ -22999,72 +12327,72 @@ label_12: else if (this.type == 84 && (double) this.ai[1] == 0.0) { this.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item12, this.position); + Main.PlaySound(SoundID.Item12, this.position); } else if (this.type == 389 && (double) this.ai[1] == 0.0) { this.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item12, this.position); + Main.PlaySound(SoundID.Item12, this.position); } else if (this.type == 257 && (double) this.ai[1] == 0.0) { this.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item12, this.position); + Main.PlaySound(SoundID.Item12, this.position); } else if (this.type == 100 && (double) this.ai[1] == 0.0) { this.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item33, this.position); + Main.PlaySound(SoundID.Item33, this.position); } else if (this.type == 98 && (double) this.ai[1] == 0.0) { this.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item17, this.position); + Main.PlaySound(SoundID.Item17, this.position); } else if (this.type == 184 && (double) this.ai[1] == 0.0) { this.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item17, this.position); + Main.PlaySound(SoundID.Item17, this.position); } else if (this.type == 195 && (double) this.ai[1] == 0.0) { this.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item17, this.position); + Main.PlaySound(SoundID.Item17, this.position); } else if (this.type == 275 && (double) this.ai[1] == 0.0) { this.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item17, this.position); + Main.PlaySound(SoundID.Item17, this.position); } else if (this.type == 276 && (double) this.ai[1] == 0.0) { this.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item17, this.position); + Main.PlaySound(SoundID.Item17, this.position); } else if ((this.type == 81 || this.type == 82) && (double) this.ai[1] == 0.0) { - SoundEngine.PlaySound(SoundID.Item5, this.position); + Main.PlaySound(SoundID.Item5, this.position); this.ai[1] = 1f; } else if (this.type == 180 && (double) this.ai[1] == 0.0) { - SoundEngine.PlaySound(SoundID.Item11, this.position); + Main.PlaySound(SoundID.Item11, this.position); this.ai[1] = 1f; } else if (this.type == 248 && (double) this.ai[1] == 0.0) { - SoundEngine.PlaySound(SoundID.Item17, this.position); + Main.PlaySound(SoundID.Item17, this.position); this.ai[1] = 1f; } else if (this.type == 576 && (double) this.ai[1] == 0.0) { this.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item12, this.position); + Main.PlaySound(SoundID.Item12, this.position); } else if (this.type == 577 && (double) this.ai[1] == 0.0) { this.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item36, this.position); + Main.PlaySound(SoundID.Item36, this.position); } else if (this.type == 710) { @@ -23160,58 +12488,11 @@ label_12: int index = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 18, Scale: 0.9f); Main.dust[index].noGravity = true; } - else if (this.type == 719) - { - if (Main.rand.Next(2) == 0) - Dust.NewDustDirect(this.position - this.velocity, this.width, this.height, 147, Scale: 0.9f).noGravity = true; - if ((double) this.localAI[0] == 0.0) - { - this.localAI[0] = 1f; - for (int index = 0; index < 20; ++index) - { - Dust dust = Dust.NewDustDirect(this.position - this.velocity, this.width, this.height, 147, Scale: 1.3f); - dust.noGravity = true; - dust.velocity += this.velocity * 0.75f; - } - for (int index = 0; index < 10; ++index) - { - Dust dust = Dust.NewDustDirect(this.position - this.velocity, this.width, this.height, 147, Scale: 1.3f); - dust.noGravity = true; - dust.velocity *= 2f; - } - } - } - else if (this.type == 763) - { - if ((double) this.localAI[0] == 0.0) - { - this.localAI[0] = 1f; - for (int index = 0; index < 5; ++index) - { - Dust dust = Dust.NewDustDirect(this.position - this.velocity, this.width, this.height, 40, Scale: 1.1f); - dust.noGravity = true; - dust.velocity *= 1.5f; - } - } - } - else if (this.type == 772) - { - if (Main.rand.Next(7) == 0) - { - for (int index = 0; index < 1; ++index) - { - Dust dust = Dust.NewDustDirect(this.position - this.velocity, this.width, this.height, Main.rand.NextFromList(86, 87, 88, 89, 90, 91, 138), Scale: 0.7f); - dust.noGravity = true; - dust.velocity = this.velocity * 0.6f; - dust.fadeIn = 0.8f; - } - } - } else if (this.type == 374) { if ((double) this.localAI[0] == 0.0) { - SoundEngine.PlaySound(SoundID.Item17, this.position); + Main.PlaySound(SoundID.Item17, this.position); this.localAI[0] = 1f; } if (Main.rand.Next(2) == 0) @@ -23224,7 +12505,7 @@ label_12: else if (this.type == 376) { if ((double) this.localAI[0] == 0.0) - SoundEngine.PlaySound(SoundID.Item20, this.position); + Main.PlaySound(SoundID.Item20, this.position); ++this.localAI[0]; if ((double) this.localAI[0] > 3.0) { @@ -23325,10 +12606,10 @@ label_12: if (this.type == 660) { DelegateMethods.v3_1 = new Vector3(0.6f, 1f, 1f) * 0.2f; - Utils.PlotTileLine(this.Center, this.Center + this.velocity * 10f, 8f, new Utils.TileActionAttempt(DelegateMethods.CastLightOpen)); + Utils.PlotTileLine(this.Center, this.Center + this.velocity * 10f, 8f, new Utils.PerLinePoint(DelegateMethods.CastLightOpen)); if (this.alpha > 0) { - SoundEngine.PlaySound(SoundID.Item9, this.Center); + Main.PlaySound(SoundID.Item9, this.Center); this.alpha = 0; this.scale = 1.1f; this.frame = Main.rand.Next(14); @@ -23347,7 +12628,7 @@ label_12: if (this.type == 712) { DelegateMethods.v3_1 = new Vector3(0.4f, 0.4f, 0.4f) * 0.7f; - Utils.PlotTileLine(this.Center, this.Center + this.velocity * 10f, 8f, new Utils.TileActionAttempt(DelegateMethods.CastLightOpen)); + Utils.PlotTileLine(this.Center, this.Center + this.velocity * 10f, 8f, new Utils.PerLinePoint(DelegateMethods.CastLightOpen)); if (this.alpha == (int) byte.MaxValue) this.frame = Main.rand.Next(2) * 4; if (++this.frameCounter >= 4) @@ -23421,7 +12702,7 @@ label_12: if ((double) this.localAI[1] == 0.0) { float[] localAi = this.localAI; - SlotId slotId = SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_PhantomPhoenixShot, this.Center); + SlotId slotId = Main.PlayTrackedSound((SoundStyle) SoundID.DD2_PhantomPhoenixShot, this.Center); double num = (double) ((SlotId) ref slotId).ToFloat(); localAi[0] = (float) num; ++this.localAI[1]; @@ -23437,7 +12718,7 @@ label_12: } } } - ActiveSound activeSound = SoundEngine.GetActiveSound(SlotId.FromFloat(this.localAI[0])); + ActiveSound activeSound = Main.GetActiveSound(SlotId.FromFloat(this.localAI[0])); if (activeSound != null) { activeSound.Position = this.Center; @@ -23510,7 +12791,7 @@ label_12: } } DelegateMethods.v3_1 = new Vector3(1f, 0.6f, 0.2f); - Utils.PlotTileLine(this.Center, this.Center + this.velocity * 4f, 40f, new Utils.TileActionAttempt(DelegateMethods.CastLightOpen)); + Utils.PlotTileLine(this.Center, this.Center + this.velocity * 4f, 40f, new Utils.PerLinePoint(DelegateMethods.CastLightOpen)); } if (this.type == 638) { @@ -23551,14 +12832,6 @@ label_12: if (this.alpha < 0) this.alpha = 0; } - if (this.type == 876) - { - this.tileCollide = (double) this.ai[1] == 0.0; - if (this.alpha > 0) - this.alpha -= 10; - if (this.alpha < 0) - this.alpha = 0; - } if (this.type == 88) { if (this.alpha > 0) @@ -23579,46 +12852,46 @@ label_12: if (type <= 20) { if (type != 5 && type != 14 && type != 20) - goto label_648; + goto label_608; } else if (type != 36 && type != 38 && type != 55) - goto label_648; + goto label_608; } else if (type <= 98) { if ((uint) (type - 83) > 1U && (uint) (type - 88) > 1U && type != 98) - goto label_648; + goto label_608; } else if (type <= 104) { if (type != 100 && type != 104) - goto label_648; + goto label_608; } else if (type != 110 && (uint) (type - 158) > 3U) - goto label_648; + goto label_608; } else if (type <= 259) { if (type <= 242) { if (type != 180 && type != 184 && type != 242) - goto label_648; + goto label_608; } else if (type != 248 && type != 257 && type != 259) - goto label_648; + goto label_608; } else if (type <= 279) { if (type != 265 && type != 270 && type != 279) - goto label_648; + goto label_608; } else if (type <= 299) { if ((uint) (type - 283) > 4U && type != 299) - goto label_648; + goto label_608; } else if (type != 302 && type != 323) - goto label_648; + goto label_608; } else if (type <= 485) { @@ -23627,10 +12900,10 @@ label_12: if (type <= 355) { if (type != 325 && (uint) (type - 348) > 2U && type != 355) - goto label_648; + goto label_608; } else if (type != 374 && type != 376 && type != 389) - goto label_648; + goto label_608; } else if (type <= 459) { @@ -23645,47 +12918,42 @@ label_12: case 2: case 4: case 6: - goto label_648; + goto label_608; default: if (type == 449 || type == 459) break; - goto label_648; + goto label_608; } } else if (type <= 469) { if (type != 462 && (uint) (type - 467) > 2U) - goto label_648; + goto label_608; } else if (type != 472 && (uint) (type - 483) > 2U) - goto label_648; + goto label_608; } - else if (type <= 616) + else if (type <= 606) { if (type <= 585) { if (type != 498 && (uint) (type - 576) > 1U && type != 585) - goto label_648; + goto label_608; } - else if (type <= 601) - { - if ((uint) (type - 592) > 1U && type != 601) - goto label_648; - } - else if (type != 606 && type != 616) - goto label_648; + else if ((uint) (type - 592) > 1U && type != 601 && type != 606) + goto label_608; } - else if (type <= 661) + else if (type <= 639) { - if ((uint) (type - 634) > 1U && (uint) (type - 638) > 1U && (uint) (type - 660) > 1U) - goto label_648; + if (type != 616 && (uint) (type - 634) > 1U && (uint) (type - 638) > 1U) + goto label_608; } - else if (type <= 684) + else if (type <= 682) { - if (type != 682 && type != 684) - goto label_648; + if ((uint) (type - 660) > 1U && type != 682) + goto label_608; } - else + else if (type != 684) { switch (type - 706) { @@ -23694,19 +12962,12 @@ label_12: case 4: case 6: break; - case 1: - case 2: - case 5: - goto label_648; default: - if (type != 876) - goto label_648; - else - break; + goto label_608; } } flag1 = false; -label_648: +label_608: if (flag1) ++this.ai[0]; if (this.type == 270) @@ -23722,21 +12983,26 @@ label_648: this.velocity.Normalize(); this.velocity = this.velocity * num; } - if ((double) this.velocity.Length() < 18.0) - this.velocity = this.velocity * 1.02f; - if ((double) this.localAI[0] == 0.0) + if ((double) this.ai[0] < 0.0) { - this.localAI[0] = 1f; - SoundEngine.PlaySound(SoundID.Item8, this.position); - for (int index59 = 0; index59 < 10; ++index59) + if ((double) this.velocity.Length() < 18.0) + this.velocity = this.velocity * 1.02f; + if ((double) this.localAI[0] == 0.0) { - int index60 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 5, this.velocity.X, this.velocity.Y, Scale: 2f); - Main.dust[index60].noGravity = true; - Main.dust[index60].velocity = this.Center - Main.dust[index60].position; - Main.dust[index60].velocity.Normalize(); - Main.dust[index60].velocity *= -5f; - Main.dust[index60].velocity += this.velocity / 2f; + this.localAI[0] = 1f; + Main.PlaySound(SoundID.Item8, this.position); + for (int index59 = 0; index59 < 10; ++index59) + { + int index60 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 5, this.velocity.X, this.velocity.Y, Scale: 2f); + Main.dust[index60].noGravity = true; + Main.dust[index60].velocity = this.Center - Main.dust[index60].position; + Main.dust[index60].velocity.Normalize(); + Main.dust[index60].velocity *= -5f; + Main.dust[index60].velocity += this.velocity / 2f; + } } + this.friendly = false; + this.hostile = true; } } if (this.type == 585) @@ -23744,7 +13010,7 @@ label_648: if ((double) this.localAI[0] == 0.0) { this.localAI[0] = 1f; - SoundEngine.PlaySound(SoundID.Item8, this.position); + Main.PlaySound(SoundID.Item8, this.position); for (int index61 = 0; index61 < 3; ++index61) { int index62 = Dust.NewDust(this.position, this.width, this.height, 27, this.velocity.X, this.velocity.Y, Scale: 2f); @@ -23830,7 +13096,7 @@ label_648: { if ((double) this.localAI[0] == 2.0) { - SoundEngine.PlaySound(SoundID.Item5, this.position); + Main.PlaySound(SoundID.Item5, this.position); for (int index65 = 0; index65 < 4; ++index65) { int index66 = Dust.NewDust(this.position, this.width, this.height, 76, this.velocity.X, this.velocity.Y, newColor: rgb, Scale: 1.1f); @@ -23886,7 +13152,7 @@ label_648: if ((double) this.localAI[1] == 0.0) { this.localAI[1] = 1f; - SoundEngine.PlaySound(SoundID.Item8, this.position); + Main.PlaySound(SoundID.Item8, this.position); } if ((double) this.ai[0] == 0.0 || (double) this.ai[0] == 2.0) { @@ -23914,7 +13180,7 @@ label_648: if ((double) this.localAI[0] == 0.0) { this.localAI[0] = 1f; - SoundEngine.PlaySound(SoundID.Item17, this.position); + Main.PlaySound(SoundID.Item17, this.position); } for (int index69 = 0; index69 < 2; ++index69) { @@ -23947,7 +13213,7 @@ label_648: if ((double) this.localAI[0] == 0.0) { this.localAI[0] = 1f; - SoundEngine.PlaySound(SoundID.Item17, this.Center); + Main.PlaySound(SoundID.Item17, this.Center); } for (int index = 0; index < 2; ++index) { @@ -23991,100 +13257,12 @@ label_648: dust.noLight = true; } } - else if (this.type == 811) - { - if ((double) this.localAI[0] == 0.0) - { - SoundEngine.PlaySound(SoundID.Item17, this.Center); - this.localAI[0] = 1f; - for (int index = 0; index < 8; ++index) - { - Dust dust = Main.dust[Dust.NewDust(this.position, this.width, this.height, 5, this.velocity.X, this.velocity.Y, 100)]; - dust.velocity = (Main.rand.NextFloatDirection() * 3.141593f).ToRotationVector2() * 2f + this.velocity.SafeNormalize(Vector2.Zero) * 3f; - dust.scale = 1.5f; - dust.fadeIn = 1.7f; - dust.position = this.Center; - } - } - this.alpha -= 20; - if (this.alpha < 0) - this.alpha = 0; - for (int index = 0; index < 2; ++index) - { - Dust dust = Main.dust[Dust.NewDust(this.position, this.width, this.height, 5, this.velocity.X, this.velocity.Y, 100)]; - dust.velocity = dust.velocity / 4f + this.velocity / 2f; - dust.scale = 1.2f; - dust.position = this.Center + Main.rand.NextFloat() * this.velocity * 2f; - } - } - else if (this.type == 819) - { - if ((double) this.localAI[0] == 0.0) - { - this.localAI[0] = 1f; - for (int index = 0; index < 8; ++index) - { - Dust dust = Main.dust[Dust.NewDust(this.position, this.width, this.height, 5, this.velocity.X, this.velocity.Y, 100)]; - dust.velocity = (Main.rand.NextFloatDirection() * 3.141593f).ToRotationVector2() * 2f + this.velocity.SafeNormalize(Vector2.Zero) * 2f; - dust.scale = 0.9f; - dust.fadeIn = 1.1f; - dust.position = this.Center; - } - } - this.alpha -= 20; - if (this.alpha < 0) - this.alpha = 0; - for (int index = 1; index < 3; ++index) - { - Dust dust = Main.dust[Dust.NewDust(this.position, this.width, this.height, 5, this.velocity.X, this.velocity.Y, 100)]; - dust.velocity = this.velocity; - dust.velocity *= 0.75f; - dust.scale = 1f; - dust.position = this.Center + this.velocity * (float) index; - } - } - else if (this.type == 814) - { - if ((double) this.localAI[0] == 0.0) - { - SoundEngine.PlaySound(SoundID.Item171, this.Center); - this.localAI[0] = 1f; - for (int index = 0; index < 8; ++index) - { - Dust dust = Main.dust[Dust.NewDust(this.position, this.width, this.height, 5, this.velocity.X, this.velocity.Y, 100)]; - dust.velocity = (Main.rand.NextFloatDirection() * 3.141593f).ToRotationVector2() * 2f + this.velocity.SafeNormalize(Vector2.Zero) * 2f; - dust.scale = 0.9f; - dust.fadeIn = 1.1f; - dust.position = this.Center; - } - } - this.alpha -= 20; - if (this.alpha < 0) - this.alpha = 0; - for (int index = 0; index < 2; ++index) - { - Dust dust = Main.dust[Dust.NewDust(this.position, this.width, this.height, 5, this.velocity.X, this.velocity.Y, 100)]; - dust.velocity = dust.velocity / 4f + this.velocity / 2f; - dust.scale = 1.2f; - dust.position = this.Center + Main.rand.NextFloat() * this.velocity * 2f; - } - for (int index = 1; index < this.oldPos.Length && !(this.oldPos[index] == Vector2.Zero); ++index) - { - if (Main.rand.Next(3) == 0) - { - Dust dust = Main.dust[Dust.NewDust(this.oldPos[index], this.width, this.height, 5, this.velocity.X, this.velocity.Y, 100)]; - dust.velocity = dust.velocity / 4f + this.velocity / 2f; - dust.scale = 1.2f; - dust.position = this.oldPos[index] + this.Size / 2f + Main.rand.NextFloat() * this.velocity * 2f; - } - } - } else if (this.type == 675) { if ((double) this.localAI[0] == 0.0) { this.localAI[0] = 1f; - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_DarkMageAttack, this.Center); + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_DarkMageAttack, this.Center); } this.alpha -= 20; if (this.alpha < 0) @@ -24095,7 +13273,7 @@ label_648: if ((double) this.localAI[0] == 0.0) { this.localAI[0] = 1f; - SoundEngine.PlaySound(SoundID.Item17, this.Center); + Main.PlaySound(SoundID.Item17, this.Center); } this.alpha -= 20; if (this.alpha < 0) @@ -24121,7 +13299,7 @@ label_648: if ((double) this.localAI[0] == 0.0) { this.localAI[0] = 1f; - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_BetsyFireballShot, this.Center); + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_BetsyFireballShot, this.Center); } if ((double) this.ai[0] >= 2.0) { @@ -24181,7 +13359,7 @@ label_648: { if ((double) this.localAI[0] == 6.0) { - SoundEngine.PlaySound(SoundID.Item8, this.position); + Main.PlaySound(SoundID.Item8, this.position); for (int index71 = 0; index71 < 40; ++index71) { int index72 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 181, Alpha: 100); @@ -24203,9 +13381,9 @@ label_648: } } } - else if (this.type == 270 || this.type == 837) + else if (this.type == 270) { - if (this.type == 270) + if ((double) this.ai[0] < 0.0) this.alpha = 0; if (this.alpha > 0) this.alpha -= 50; @@ -24214,7 +13392,7 @@ label_648: ++this.frame; if (this.frame > 2) this.frame = 0; - if (this.type == 270) + if ((double) this.ai[0] < 0.0) { for (int index75 = 0; index75 < 2; ++index75) { @@ -24293,9 +13471,9 @@ label_648: if (this.alpha < 0) this.alpha = 0; } - else if (this.type == 207 || this.type == 837) + else if (this.type == 207) { - if (this.type == 207 && this.alpha < 170) + if (this.alpha < 170) { for (int index81 = 0; index81 < 10; ++index81) { @@ -24378,8 +13556,6 @@ label_648: float num40 = num36 * num39; float num41 = num37 * num39; int num42 = 8; - if (this.type == 837) - num42 = 32; this.velocity.X = (this.velocity.X * (float) (num42 - 1) + num40) / (float) num42; this.velocity.Y = (this.velocity.Y * (float) (num42 - 1) + num41) / (float) num42; } @@ -24392,7 +13568,7 @@ label_648: this.velocity.Y += 0.07f; } } - else if (this.type == 174 || this.type == 605 || this.type == 920 || this.type == 921 || this.type == 926 || this.type == 937) + else if (this.type == 174 || this.type == 605) { if ((double) this.ai[0] >= 5.0) { @@ -24529,15 +13705,15 @@ label_648: this.localAI[1] = 20f; this.velocity.Y += 0.15f; } - this.rotation += Main.windSpeedCurrent * 0.2f; - this.velocity.X += Main.windSpeedCurrent * 0.1f; + this.rotation += Main.windSpeed * 0.2f; + this.velocity.X += Main.windSpeed * 0.1f; } else if (this.type == 336 || this.type == 345) { if (this.type == 345 && (double) this.localAI[0] == 0.0) { this.localAI[0] = 1f; - SoundEngine.PlaySound(SoundID.Item1, this.position); + Main.PlaySound(SoundID.Item1, this.position); } if ((double) this.ai[0] >= 50.0) { @@ -24579,7 +13755,6 @@ label_648: this.ai[0] = 30f; this.velocity.Y += 0.5f; } - Lighting.AddLight(this.Center, 0.6f, 0.4f, 0.3f); } else if (this.type != 239 && this.type != 264) { @@ -24833,7 +14008,7 @@ label_648: if ((double) this.localAI[0] == 0.0) { ++this.localAI[0]; - SoundEngine.PlaySound(SoundID.Item17, this.position); + Main.PlaySound(SoundID.Item17, this.position); } ++this.ai[0]; if ((double) this.ai[0] >= 50.0) @@ -24895,16 +14070,14 @@ label_648: } } } - if (this.type == 921 || this.type == 926 || this.type == 937) - this.rotation += (float) (((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y)) * 0.0500000007450581); - else if (this.type == 248) + if (this.type == 248) { if ((double) this.velocity.X < 0.0) this.rotation -= (float) (((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y)) * 0.0500000007450581); else this.rotation += (float) (((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y)) * 0.0500000007450581); } - else if (this.type == 270 || this.type == 585 || this.type == 601 || this.type == 706 || this.type == 837) + else if (this.type == 270 || this.type == 585 || this.type == 601 || this.type == 706) { this.spriteDirection = this.direction; this.rotation = this.direction >= 0 ? (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X) : (float) Math.Atan2(-(double) this.velocity.Y, -(double) this.velocity.X); @@ -24974,8 +14147,6 @@ label_648: this.rotation += (float) (0.200000002980232 + (double) Math.Abs(this.velocity.X) * 0.100000001490116); else if (this.type == 483) this.rotation += this.velocity.X * 0.05f; - else if (this.type == 772) - this.rotation += (float) ((double) Math.Sign(this.velocity.X) * ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y)) * 0.0500000007450581); else if (this.type == 485) { this.velocity = (this.velocity * 39f + new Vector2(this.ai[0], this.ai[1])) / 40f; @@ -25007,8 +14178,6 @@ label_648: if (this.velocity != Vector2.Zero) this.rotation = this.velocity.ToRotation() + 1.570796f; } - else if (this.type == 325) - this.rotation = this.velocity.ToRotation() - 1.570796f; else if (this.type != 344 && this.type != 498) this.rotation = (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X) + 1.57f; } @@ -25017,218 +14186,2840 @@ label_648: this.velocity.Y = 16f; } - private void AI_010() + private void AI_026() { - if (this.type == 31 && (double) this.ai[0] != 2.0) + if (!Main.player[this.owner].active) { - if (Main.rand.Next(2) == 0) - { - int index = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 32, SpeedY: (this.velocity.Y / 2f)); - Main.dust[index].velocity.X *= 0.4f; - } + this.active = false; } - else if (this.type == 39) + else { - if (Main.rand.Next(2) == 0) + bool flag1 = false; + bool flag2 = false; + bool flag3 = false; + bool flag4 = false; + int num1 = 85; + bool flag5 = this.type >= 191 && this.type <= 194; + if (this.type == 324) + num1 = 120; + if (this.type == 112) + num1 = 100; + if (this.type == (int) sbyte.MaxValue) + num1 = 50; + if (flag5) { - int index = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 38, SpeedY: (this.velocity.Y / 2f)); - Main.dust[index].velocity.X *= 0.4f; - } - } - else if (this.type >= 411 && this.type <= 414) - { - if (Main.rand.Next(3) == 0) - { - int Type = 9; - if (this.type == 412 || this.type == 414) - Type = 11; - if (this.type == 413) - Type = 19; - int index = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, Type, SpeedY: (this.velocity.Y / 2f)); - Main.dust[index].noGravity = true; - Main.dust[index].velocity -= this.velocity * 0.5f; - } - } - else if (this.type == 40) - { - if (Main.rand.Next(2) == 0) - { - int index = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 36, SpeedY: (this.velocity.Y / 2f)); - Main.dust[index].velocity *= 0.4f; - } - } - else if (this.type == 42 || this.type == 31) - { - if (Main.rand.Next(2) == 0) - { - int index = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 32); - Main.dust[index].velocity.X *= 0.4f; - } - } - else if (this.type == 56 || this.type == 65) - { - if (Main.rand.Next(2) == 0) - { - int index = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 14); - Main.dust[index].velocity.X *= 0.4f; - } - } - else if (this.type == 67 || this.type == 68) - { - if (Main.rand.Next(2) == 0) - { - int index = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 51); - Main.dust[index].velocity.X *= 0.4f; - } - } - else if (this.type == 71) - { - if (Main.rand.Next(2) == 0) - { - int index = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 53); - Main.dust[index].velocity.X *= 0.4f; - } - } - else if (this.type == 179) - { - if (Main.rand.Next(2) == 0) - { - int index = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 149); - Main.dust[index].velocity.X *= 0.4f; - } - } - else if (this.type == 241 || this.type == 354) - { - if (Main.rand.Next(2) == 0) - { - int index = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 36); - Main.dust[index].velocity.X *= 0.4f; - } - } - else if (this.type >= 736 && this.type <= 738) - { - if (Main.rand.Next(40) == 0) - { - int index = Dust.NewDust(this.position, this.width, this.height, this.type - 736 + 275); - if (index >= 0) - Main.dust[index].velocity = Main.dust[index].velocity * 0.5f + this.velocity * 0.5f; - } - } - else if (this.type != 109 && Main.rand.Next(20) == 0) - Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 0); - if (this.type >= 736 && this.type <= 738) - { - if ((double) this.localAI[0] == 0.0) - { - this.frame = Main.rand.Next(3); - this.scale = (float) (1.0 - (double) Main.rand.Next(30) * 0.00999999977648258); - } - ++this.localAI[0]; - } - this.tileCollide = true; - this.localAI[1] = 0.0f; - if (Main.myPlayer == this.owner && (double) this.ai[0] == 0.0) - { - this.tileCollide = false; - if (Main.player[this.owner].channel && (this.type < 736 || this.type > 738) && this.type != 40) - { - this.localAI[1] = -1f; - float num1 = 12f; - Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); - float num2 = (float) Main.mouseX + Main.screenPosition.X - vector2.X; - float num3 = (float) Main.mouseY + Main.screenPosition.Y - vector2.Y; - if ((double) Main.player[this.owner].gravDir == -1.0) - num3 = Main.screenPosition.Y + (float) Main.screenHeight - (float) Main.mouseY - vector2.Y; - float num4 = (float) Math.Sqrt((double) num2 * (double) num2 + (double) num3 * (double) num3); - float num5 = (float) Math.Sqrt((double) num2 * (double) num2 + (double) num3 * (double) num3); - if ((double) num5 > (double) num1) + if (this.lavaWet) { - float num6 = num1 / num5; - float num7 = num2 * num6; - float num8 = num3 * num6; - if ((double) num7 != (double) this.velocity.X || (double) num8 != (double) this.velocity.Y) - this.netUpdate = true; - this.velocity.X = num7; - this.velocity.Y = num8; + this.ai[0] = 1f; + this.ai[1] = 0.0f; + } + num1 = 60 + 30 * this.minionPos; + } + else if (this.type == 266) + num1 = 60 + 30 * this.minionPos; + if (this.type == 111) + { + if (Main.player[this.owner].dead) + Main.player[this.owner].bunny = false; + if (Main.player[this.owner].bunny) + this.timeLeft = 2; + } + if (this.type == 112) + { + if (Main.player[this.owner].dead) + Main.player[this.owner].penguin = false; + if (Main.player[this.owner].penguin) + this.timeLeft = 2; + } + if (this.type == 334) + { + if (Main.player[this.owner].dead) + Main.player[this.owner].puppy = false; + if (Main.player[this.owner].puppy) + this.timeLeft = 2; + } + if (this.type == 353) + { + if (Main.player[this.owner].dead) + Main.player[this.owner].grinch = false; + if (Main.player[this.owner].grinch) + this.timeLeft = 2; + } + if (this.type == (int) sbyte.MaxValue) + { + if (Main.player[this.owner].dead) + Main.player[this.owner].turtle = false; + if (Main.player[this.owner].turtle) + this.timeLeft = 2; + } + if (this.type == 175) + { + if (Main.player[this.owner].dead) + Main.player[this.owner].eater = false; + if (Main.player[this.owner].eater) + this.timeLeft = 2; + } + if (this.type == 197) + { + if (Main.player[this.owner].dead) + Main.player[this.owner].skeletron = false; + if (Main.player[this.owner].skeletron) + this.timeLeft = 2; + } + if (this.type == 198) + { + if (Main.player[this.owner].dead) + Main.player[this.owner].hornet = false; + if (Main.player[this.owner].hornet) + this.timeLeft = 2; + } + if (this.type == 199) + { + if (Main.player[this.owner].dead) + Main.player[this.owner].tiki = false; + if (Main.player[this.owner].tiki) + this.timeLeft = 2; + } + if (this.type == 200) + { + if (Main.player[this.owner].dead) + Main.player[this.owner].lizard = false; + if (Main.player[this.owner].lizard) + this.timeLeft = 2; + } + if (this.type == 208) + { + if (Main.player[this.owner].dead) + Main.player[this.owner].parrot = false; + if (Main.player[this.owner].parrot) + this.timeLeft = 2; + } + if (this.type == 209) + { + if (Main.player[this.owner].dead) + Main.player[this.owner].truffle = false; + if (Main.player[this.owner].truffle) + this.timeLeft = 2; + } + if (this.type == 210) + { + if (Main.player[this.owner].dead) + Main.player[this.owner].sapling = false; + if (Main.player[this.owner].sapling) + this.timeLeft = 2; + } + if (this.type == 324) + { + if (Main.player[this.owner].dead) + Main.player[this.owner].cSapling = false; + if (Main.player[this.owner].cSapling) + this.timeLeft = 2; + } + if (this.type == 313) + { + if (Main.player[this.owner].dead) + Main.player[this.owner].spider = false; + if (Main.player[this.owner].spider) + this.timeLeft = 2; + } + if (this.type == 314) + { + if (Main.player[this.owner].dead) + Main.player[this.owner].squashling = false; + if (Main.player[this.owner].squashling) + this.timeLeft = 2; + } + if (this.type == 211) + { + if (Main.player[this.owner].dead) + Main.player[this.owner].wisp = false; + if (Main.player[this.owner].wisp) + this.timeLeft = 2; + } + if (this.type == 236) + { + if (Main.player[this.owner].dead) + Main.player[this.owner].dino = false; + if (Main.player[this.owner].dino) + this.timeLeft = 2; + } + if (this.type == 499) + { + if (Main.player[this.owner].dead) + Main.player[this.owner].babyFaceMonster = false; + if (Main.player[this.owner].babyFaceMonster) + this.timeLeft = 2; + } + if (this.type == 266) + { + if (Main.player[this.owner].dead) + Main.player[this.owner].slime = false; + if (Main.player[this.owner].slime) + this.timeLeft = 2; + } + if (this.type == 268) + { + if (Main.player[this.owner].dead) + Main.player[this.owner].eyeSpring = false; + if (Main.player[this.owner].eyeSpring) + this.timeLeft = 2; + } + if (this.type == 269) + { + if (Main.player[this.owner].dead) + Main.player[this.owner].snowman = false; + if (Main.player[this.owner].snowman) + this.timeLeft = 2; + } + if (this.type == 319) + { + if (Main.player[this.owner].dead) + Main.player[this.owner].blackCat = false; + if (Main.player[this.owner].blackCat) + this.timeLeft = 2; + } + if (this.type == 380) + { + if (Main.player[this.owner].dead) + Main.player[this.owner].zephyrfish = false; + if (Main.player[this.owner].zephyrfish) + this.timeLeft = 2; + } + if (flag5) + { + if (Main.player[this.owner].dead) + Main.player[this.owner].pygmy = false; + if (Main.player[this.owner].pygmy) + this.timeLeft = Main.rand.Next(2, 10); + } + if (this.type >= 390 && this.type <= 392) + { + if (Main.player[this.owner].dead) + Main.player[this.owner].spiderMinion = false; + if (Main.player[this.owner].spiderMinion) + this.timeLeft = 2; + } + if (this.type == 398) + { + if (Main.player[this.owner].dead) + Main.player[this.owner].miniMinotaur = false; + if (Main.player[this.owner].miniMinotaur) + this.timeLeft = 2; + } + if (flag5 || this.type == 266 || this.type >= 390 && this.type <= 392) + { + int num2 = 10; + int num3 = 40 * (this.minionPos + 1) * Main.player[this.owner].direction; + if ((double) Main.player[this.owner].position.X + (double) (Main.player[this.owner].width / 2) < (double) this.position.X + (double) (this.width / 2) - (double) num2 + (double) num3) + flag1 = true; + else if ((double) Main.player[this.owner].position.X + (double) (Main.player[this.owner].width / 2) > (double) this.position.X + (double) (this.width / 2) + (double) num2 + (double) num3) + flag2 = true; + } + else if ((double) Main.player[this.owner].position.X + (double) (Main.player[this.owner].width / 2) < (double) this.position.X + (double) (this.width / 2) - (double) num1) + flag1 = true; + else if ((double) Main.player[this.owner].position.X + (double) (Main.player[this.owner].width / 2) > (double) this.position.X + (double) (this.width / 2) + (double) num1) + flag2 = true; + if (this.type == 175) + { + float num4 = 0.1f; + this.tileCollide = false; + int num5 = 300; + Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); + float num6 = Main.player[this.owner].position.X + (float) (Main.player[this.owner].width / 2) - vector2.X; + float num7 = Main.player[this.owner].position.Y + (float) (Main.player[this.owner].height / 2) - vector2.Y; + if (this.type == (int) sbyte.MaxValue) + num7 = Main.player[this.owner].position.Y - vector2.Y; + float num8 = (float) Math.Sqrt((double) num6 * (double) num6 + (double) num7 * (double) num7); + float num9 = 7f; + if ((double) num8 < (double) num5 && (double) Main.player[this.owner].velocity.Y == 0.0 && (double) this.position.Y + (double) this.height <= (double) Main.player[this.owner].position.Y + (double) Main.player[this.owner].height && !Collision.SolidCollision(this.position, this.width, this.height)) + { + this.ai[0] = 0.0f; + if ((double) this.velocity.Y < -6.0) + this.velocity.Y = -6f; + } + if ((double) num8 < 150.0) + { + if ((double) Math.Abs(this.velocity.X) > 2.0 || (double) Math.Abs(this.velocity.Y) > 2.0) + this.velocity = this.velocity * 0.99f; + num4 = 0.01f; + if ((double) num6 < -2.0) + num6 = -2f; + if ((double) num6 > 2.0) + num6 = 2f; + if ((double) num7 < -2.0) + num7 = -2f; + if ((double) num7 > 2.0) + num7 = 2f; } else { - if ((double) num2 != (double) this.velocity.X || (double) num3 != (double) this.velocity.Y) - this.netUpdate = true; - this.velocity.X = num2; - this.velocity.Y = num3; + if ((double) num8 > 300.0) + num4 = 0.2f; + float num10 = num9 / num8; + num6 *= num10; + num7 *= num10; } - } - else - { - this.ai[0] = 1f; - this.netUpdate = true; - } - } - if ((double) this.ai[0] == 1.0 && this.type != 109) - { - if (this.type == 42 || this.type == 65 || this.type == 68 || this.type == 354) - { - ++this.ai[1]; - if ((double) this.ai[1] >= 60.0) + if ((double) Math.Abs(num6) > (double) Math.Abs(num7) || (double) num4 == 0.0500000007450581) { - this.ai[1] = 60f; - this.velocity.Y += 0.2f; - } - } - else - this.velocity.Y += 0.41f; - } - else if ((double) this.ai[0] == 2.0 && this.type != 109) - { - this.velocity.Y += 0.2f; - if ((double) this.velocity.X < -0.04) - this.velocity.X += 0.04f; - else if ((double) this.velocity.X > 0.04) - this.velocity.X -= 0.04f; - else - this.velocity.X = 0.0f; - } - if (this.owner == Main.myPlayer) - { - for (int index1 = (int) ((double) this.position.X / 16.0); index1 <= (int) (((double) this.position.X + (double) this.width) / 16.0); ++index1) - { - for (int index2 = (int) ((double) this.position.Y / 16.0); index2 <= (int) (((double) this.position.Y + (double) this.height) / 16.0); ++index2) - { - if (WorldGen.InWorld(index1, index2) && Main.tile[index1, index2].active()) + if ((double) this.velocity.X < (double) num6) { - if (Main.tile[index1, index2].type >= (ushort) 185 && Main.tile[index1, index2].type <= (ushort) 187 || Main.tile[index1, index2].type == (ushort) 165 || Main.tile[index1, index2].type == (ushort) 12 || Main.tile[index1, index2].type == (ushort) 105 || Main.tile[index1, index2].type == (ushort) 178) - WorldGen.KillTile(index1, index2); - else if (Main.tile[index1, index2].topSlope()) - Main.tile[index1, index2].slope((byte) 0); + this.velocity.X += num4; + if ((double) num4 > 0.0500000007450581 && (double) this.velocity.X < 0.0) + this.velocity.X += num4; + } + if ((double) this.velocity.X > (double) num6) + { + this.velocity.X -= num4; + if ((double) num4 > 0.0500000007450581 && (double) this.velocity.X > 0.0) + this.velocity.X -= num4; + } + } + if ((double) Math.Abs(num6) <= (double) Math.Abs(num7) || (double) num4 == 0.0500000007450581) + { + if ((double) this.velocity.Y < (double) num7) + { + this.velocity.Y += num4; + if ((double) num4 > 0.0500000007450581 && (double) this.velocity.Y < 0.0) + this.velocity.Y += num4; + } + if ((double) this.velocity.Y > (double) num7) + { + this.velocity.Y -= num4; + if ((double) num4 > 0.0500000007450581 && (double) this.velocity.Y > 0.0) + this.velocity.Y -= num4; + } + } + this.rotation = (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X) - 1.57f; + ++this.frameCounter; + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame <= 1) + return; + this.frame = 0; + } + else if (this.type == 197) + { + float num11 = 0.1f; + this.tileCollide = false; + int num12 = 300; + Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); + float num13 = Main.player[this.owner].position.X + (float) (Main.player[this.owner].width / 2) - vector2.X; + float num14 = Main.player[this.owner].position.Y + (float) (Main.player[this.owner].height / 2) - vector2.Y; + if (this.type == (int) sbyte.MaxValue) + num14 = Main.player[this.owner].position.Y - vector2.Y; + float num15 = (float) Math.Sqrt((double) num13 * (double) num13 + (double) num14 * (double) num14); + float num16 = 3f; + if ((double) num15 > 500.0) + this.localAI[0] = 10000f; + if ((double) this.localAI[0] >= 10000.0) + num16 = 14f; + if ((double) num15 < (double) num12 && (double) Main.player[this.owner].velocity.Y == 0.0 && (double) this.position.Y + (double) this.height <= (double) Main.player[this.owner].position.Y + (double) Main.player[this.owner].height && !Collision.SolidCollision(this.position, this.width, this.height)) + { + this.ai[0] = 0.0f; + if ((double) this.velocity.Y < -6.0) + this.velocity.Y = -6f; + } + if ((double) num15 < 150.0) + { + if ((double) Math.Abs(this.velocity.X) > 2.0 || (double) Math.Abs(this.velocity.Y) > 2.0) + this.velocity = this.velocity * 0.99f; + num11 = 0.01f; + if ((double) num13 < -2.0) + num13 = -2f; + if ((double) num13 > 2.0) + num13 = 2f; + if ((double) num14 < -2.0) + num14 = -2f; + if ((double) num14 > 2.0) + num14 = 2f; + } + else + { + if ((double) num15 > 300.0) + num11 = 0.2f; + float num17 = num16 / num15; + num13 *= num17; + num14 *= num17; + } + if ((double) this.velocity.X < (double) num13) + { + this.velocity.X += num11; + if ((double) num11 > 0.0500000007450581 && (double) this.velocity.X < 0.0) + this.velocity.X += num11; + } + if ((double) this.velocity.X > (double) num13) + { + this.velocity.X -= num11; + if ((double) num11 > 0.0500000007450581 && (double) this.velocity.X > 0.0) + this.velocity.X -= num11; + } + if ((double) this.velocity.Y < (double) num14) + { + this.velocity.Y += num11; + if ((double) num11 > 0.0500000007450581 && (double) this.velocity.Y < 0.0) + this.velocity.Y += num11; + } + if ((double) this.velocity.Y > (double) num14) + { + this.velocity.Y -= num11; + if ((double) num11 > 0.0500000007450581 && (double) this.velocity.Y > 0.0) + this.velocity.Y -= num11; + } + this.localAI[0] += (float) Main.rand.Next(10); + if ((double) this.localAI[0] > 10000.0) + { + if ((double) this.localAI[1] == 0.0) + this.localAI[1] = (double) this.velocity.X >= 0.0 ? 1f : -1f; + this.rotation += 0.25f * this.localAI[1]; + if ((double) this.localAI[0] > 12000.0) + this.localAI[0] = 0.0f; + } + else + { + this.localAI[1] = 0.0f; + float num18 = this.velocity.X * 0.1f; + if ((double) this.rotation > (double) num18) + { + this.rotation -= (float) (((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y)) * 0.00999999977648258); + if ((double) this.rotation < (double) num18) + this.rotation = num18; + } + if ((double) this.rotation < (double) num18) + { + this.rotation += (float) (((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y)) * 0.00999999977648258); + if ((double) this.rotation > (double) num18) + this.rotation = num18; + } + } + if ((double) this.rotation > 6.28) + this.rotation -= 6.28f; + if ((double) this.rotation >= -6.28) + return; + this.rotation += 6.28f; + } + else if (this.type == 198 || this.type == 380) + { + float num19 = 0.4f; + if (this.type == 380) + num19 = 0.3f; + this.tileCollide = false; + int num20 = 100; + Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); + float num21 = Main.player[this.owner].position.X + (float) (Main.player[this.owner].width / 2) - vector2.X; + float num22 = Main.player[this.owner].position.Y + (float) (Main.player[this.owner].height / 2) - vector2.Y + (float) Main.rand.Next(-10, 21); + float num23 = num21 + (float) Main.rand.Next(-10, 21) + (float) (60 * -Main.player[this.owner].direction); + float num24 = num22 - 60f; + if (this.type == (int) sbyte.MaxValue) + num24 = Main.player[this.owner].position.Y - vector2.Y; + float num25 = (float) Math.Sqrt((double) num23 * (double) num23 + (double) num24 * (double) num24); + float num26 = 14f; + if (this.type == 380) + num26 = 6f; + if ((double) num25 < (double) num20 && (double) Main.player[this.owner].velocity.Y == 0.0 && (double) this.position.Y + (double) this.height <= (double) Main.player[this.owner].position.Y + (double) Main.player[this.owner].height && !Collision.SolidCollision(this.position, this.width, this.height)) + { + this.ai[0] = 0.0f; + if ((double) this.velocity.Y < -6.0) + this.velocity.Y = -6f; + } + if ((double) num25 < 50.0) + { + if ((double) Math.Abs(this.velocity.X) > 2.0 || (double) Math.Abs(this.velocity.Y) > 2.0) + this.velocity = this.velocity * 0.99f; + num19 = 0.01f; + } + else + { + if (this.type == 380) + { + if ((double) num25 < 100.0) + num19 = 0.1f; + if ((double) num25 > 300.0) + num19 = 0.4f; + } + else if (this.type == 198) + { + if ((double) num25 < 100.0) + num19 = 0.1f; + if ((double) num25 > 300.0) + num19 = 0.6f; + } + float num27 = num26 / num25; + num23 *= num27; + num24 *= num27; + } + if ((double) this.velocity.X < (double) num23) + { + this.velocity.X += num19; + if ((double) num19 > 0.0500000007450581 && (double) this.velocity.X < 0.0) + this.velocity.X += num19; + } + if ((double) this.velocity.X > (double) num23) + { + this.velocity.X -= num19; + if ((double) num19 > 0.0500000007450581 && (double) this.velocity.X > 0.0) + this.velocity.X -= num19; + } + if ((double) this.velocity.Y < (double) num24) + { + this.velocity.Y += num19; + if ((double) num19 > 0.0500000007450581 && (double) this.velocity.Y < 0.0) + this.velocity.Y += num19 * 2f; + } + if ((double) this.velocity.Y > (double) num24) + { + this.velocity.Y -= num19; + if ((double) num19 > 0.0500000007450581 && (double) this.velocity.Y > 0.0) + this.velocity.Y -= num19 * 2f; + } + if ((double) this.velocity.X > 0.25) + this.direction = -1; + else if ((double) this.velocity.X < -0.25) + this.direction = 1; + this.spriteDirection = this.direction; + this.rotation = this.velocity.X * 0.05f; + ++this.frameCounter; + int num28 = 2; + if (this.type == 380) + num28 = 5; + if (this.frameCounter > num28) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame <= 3) + return; + this.frame = 0; + } + else if (this.type == 211) + { + float num29 = 0.2f; + float num30 = 5f; + this.tileCollide = false; + Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); + float num31 = Main.player[this.owner].position.X + (float) (Main.player[this.owner].width / 2) - vector2.X; + float num32 = Main.player[this.owner].position.Y + Main.player[this.owner].gfxOffY + (float) (Main.player[this.owner].height / 2) - vector2.Y; + if (Main.player[this.owner].controlLeft) + num31 -= 120f; + else if (Main.player[this.owner].controlRight) + num31 += 120f; + float num33; + if (Main.player[this.owner].controlDown) + { + num33 = num32 + 120f; + } + else + { + if (Main.player[this.owner].controlUp) + num32 -= 120f; + num33 = num32 - 60f; + } + float num34 = (float) Math.Sqrt((double) num31 * (double) num31 + (double) num33 * (double) num33); + if ((double) num34 > 1000.0) + { + this.position.X += num31; + this.position.Y += num33; + } + if ((double) this.localAI[0] == 1.0) + { + if ((double) num34 < 10.0 && (double) Math.Abs(Main.player[this.owner].velocity.X) + (double) Math.Abs(Main.player[this.owner].velocity.Y) < (double) num30 && (double) Main.player[this.owner].velocity.Y == 0.0) + this.localAI[0] = 0.0f; + float num35 = 12f; + if ((double) num34 < (double) num35) + { + this.velocity.X = num31; + this.velocity.Y = num33; + } + else + { + float num36 = num35 / num34; + this.velocity.X = num31 * num36; + this.velocity.Y = num33 * num36; + } + if ((double) this.velocity.X > 0.5) + this.direction = -1; + else if ((double) this.velocity.X < -0.5) + this.direction = 1; + this.spriteDirection = this.direction; + this.rotation -= (float) (0.200000002980232 + (double) Math.Abs(this.velocity.X) * 0.025000000372529) * (float) this.direction; + ++this.frameCounter; + if (this.frameCounter > 3) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame < 5) + this.frame = 5; + if (this.frame > 9) + this.frame = 5; + for (int index1 = 0; index1 < 2; ++index1) + { + int index2 = Dust.NewDust(new Vector2(this.position.X + 3f, this.position.Y + 4f), 14, 14, 156); + Main.dust[index2].velocity *= 0.2f; + Main.dust[index2].noGravity = true; + Main.dust[index2].scale = 1.25f; + Main.dust[index2].shader = GameShaders.Armor.GetSecondaryShader(Main.player[this.owner].cLight, Main.player[this.owner]); + } + } + else + { + if ((double) num34 > 200.0) + this.localAI[0] = 1f; + if ((double) this.velocity.X > 0.5) + this.direction = -1; + else if ((double) this.velocity.X < -0.5) + this.direction = 1; + this.spriteDirection = this.direction; + if ((double) num34 < 10.0) + { + this.velocity.X = num31; + this.velocity.Y = num33; + this.rotation = this.velocity.X * 0.05f; + if ((double) num34 < (double) num30) + { + this.position = this.position + this.velocity; + this.velocity = this.velocity * 0.0f; + num29 = 0.0f; + } + this.direction = -Main.player[this.owner].direction; + } + float num37 = num30 / num34; + float num38 = num31 * num37; + float num39 = num33 * num37; + if ((double) this.velocity.X < (double) num38) + { + this.velocity.X += num29; + if ((double) this.velocity.X < 0.0) + this.velocity.X *= 0.99f; + } + if ((double) this.velocity.X > (double) num38) + { + this.velocity.X -= num29; + if ((double) this.velocity.X > 0.0) + this.velocity.X *= 0.99f; + } + if ((double) this.velocity.Y < (double) num39) + { + this.velocity.Y += num29; + if ((double) this.velocity.Y < 0.0) + this.velocity.Y *= 0.99f; + } + if ((double) this.velocity.Y > (double) num39) + { + this.velocity.Y -= num29; + if ((double) this.velocity.Y > 0.0) + this.velocity.Y *= 0.99f; + } + if ((double) this.velocity.X != 0.0 || (double) this.velocity.Y != 0.0) + this.rotation = this.velocity.X * 0.05f; + ++this.frameCounter; + if (this.frameCounter > 3) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame <= 4) + return; + this.frame = 0; + } + } + else if (this.type == 199) + { + float num40 = 0.1f; + this.tileCollide = false; + int num41 = 200; + Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); + float num42 = Main.player[this.owner].position.X + (float) (Main.player[this.owner].width / 2) - vector2.X; + float num43 = Main.player[this.owner].position.Y + (float) (Main.player[this.owner].height / 2) - vector2.Y - 60f; + float num44 = num42 - 2f; + if (this.type == (int) sbyte.MaxValue) + num43 = Main.player[this.owner].position.Y - vector2.Y; + float num45 = (float) Math.Sqrt((double) num44 * (double) num44 + (double) num43 * (double) num43); + float num46 = 4f; + double num47 = (double) num45; + if ((double) num45 < (double) num41 && (double) Main.player[this.owner].velocity.Y == 0.0 && (double) this.position.Y + (double) this.height <= (double) Main.player[this.owner].position.Y + (double) Main.player[this.owner].height && !Collision.SolidCollision(this.position, this.width, this.height)) + { + this.ai[0] = 0.0f; + if ((double) this.velocity.Y < -6.0) + this.velocity.Y = -6f; + } + if ((double) num45 < 4.0) + { + this.velocity.X = num44; + this.velocity.Y = num43; + num40 = 0.0f; + } + else + { + if ((double) num45 > 350.0) + { + num40 = 0.2f; + num46 = 10f; + } + float num48 = num46 / num45; + num44 *= num48; + num43 *= num48; + } + if ((double) this.velocity.X < (double) num44) + { + this.velocity.X += num40; + if ((double) this.velocity.X < 0.0) + this.velocity.X += num40; + } + if ((double) this.velocity.X > (double) num44) + { + this.velocity.X -= num40; + if ((double) this.velocity.X > 0.0) + this.velocity.X -= num40; + } + if ((double) this.velocity.Y < (double) num43) + { + this.velocity.Y += num40; + if ((double) this.velocity.Y < 0.0) + this.velocity.Y += num40; + } + if ((double) this.velocity.Y > (double) num43) + { + this.velocity.Y -= num40; + if ((double) this.velocity.Y > 0.0) + this.velocity.Y -= num40; + } + this.direction = -Main.player[this.owner].direction; + this.spriteDirection = 1; + this.rotation = this.velocity.Y * 0.05f * (float) -this.direction; + if (num47 >= 50.0) + { + ++this.frameCounter; + if (this.frameCounter <= 6) + return; + this.frameCounter = 0; + if ((double) this.velocity.X < 0.0) + { + if (this.frame < 2) + ++this.frame; + if (this.frame <= 2) + return; + --this.frame; + } + else + { + if (this.frame < 6) + ++this.frame; + if (this.frame <= 6) + return; + --this.frame; + } + } + else + { + ++this.frameCounter; + if (this.frameCounter > 6) + { + this.frame += this.direction; + this.frameCounter = 0; + } + if (this.frame > 7) + this.frame = 0; + if (this.frame >= 0) + return; + this.frame = 7; + } + } + else + { + if ((double) this.ai[1] == 0.0) + { + int num49 = 500; + if (this.type == (int) sbyte.MaxValue) + num49 = 200; + if (this.type == 208) + num49 = 300; + if (flag5 || this.type == 266 || this.type >= 390 && this.type <= 392) + { + num49 += 40 * this.minionPos; + if ((double) this.localAI[0] > 0.0) + num49 += 500; + if (this.type == 266 && (double) this.localAI[0] > 0.0) + num49 += 100; + if (this.type >= 390 && this.type <= 392 && (double) this.localAI[0] > 0.0) + num49 += 400; + } + if (Main.player[this.owner].rocketDelay2 > 0) + this.ai[0] = 1f; + Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); + double num50 = (double) Main.player[this.owner].position.X + (double) (Main.player[this.owner].width / 2) - (double) vector2.X; + float num51 = Main.player[this.owner].position.Y + (float) (Main.player[this.owner].height / 2) - vector2.Y; + float num52 = (float) Math.Sqrt(num50 * num50 + (double) num51 * (double) num51); + if ((double) num52 > 2000.0) + { + this.position.X = Main.player[this.owner].position.X + (float) (Main.player[this.owner].width / 2) - (float) (this.width / 2); + this.position.Y = Main.player[this.owner].position.Y + (float) (Main.player[this.owner].height / 2) - (float) (this.height / 2); + } + else if ((double) num52 > (double) num49 || (double) Math.Abs(num51) > 300.0 && (!flag5 && this.type != 266 && (this.type < 390 || this.type > 392) || (double) this.localAI[0] <= 0.0)) + { + if (this.type != 324) + { + if ((double) num51 > 0.0 && (double) this.velocity.Y < 0.0) + this.velocity.Y = 0.0f; + if ((double) num51 < 0.0 && (double) this.velocity.Y > 0.0) + this.velocity.Y = 0.0f; + } + this.ai[0] = 1f; + } + } + if (this.type == 209 && (double) this.ai[0] != 0.0) + { + if ((double) Main.player[this.owner].velocity.Y == 0.0 && this.alpha >= 100) + { + this.position.X = Main.player[this.owner].position.X + (float) (Main.player[this.owner].width / 2) - (float) (this.width / 2); + this.position.Y = Main.player[this.owner].position.Y + (float) Main.player[this.owner].height - (float) this.height; + this.ai[0] = 0.0f; + } + else + { + this.velocity.X = 0.0f; + this.velocity.Y = 0.0f; + this.alpha += 5; + if (this.alpha <= (int) byte.MaxValue) + return; + this.alpha = (int) byte.MaxValue; + } + } + else if ((double) this.ai[0] != 0.0) + { + float num53 = 0.2f; + int num54 = 200; + if (this.type == (int) sbyte.MaxValue) + num54 = 100; + if (flag5) + { + num53 = 0.5f; + num54 = 100; + } + this.tileCollide = false; + Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); + float num55 = Main.player[this.owner].position.X + (float) (Main.player[this.owner].width / 2) - vector2.X; + if (flag5 || this.type == 266 || this.type >= 390 && this.type <= 392) + { + num55 -= (float) (40 * Main.player[this.owner].direction); + float num56 = 700f; + if (flag5) + num56 += 100f; + bool flag6 = false; + int num57 = -1; + for (int index = 0; index < 200; ++index) + { + if (Main.npc[index].CanBeChasedBy((object) this)) + { + float num58 = Main.npc[index].position.X + (float) (Main.npc[index].width / 2); + float num59 = Main.npc[index].position.Y + (float) (Main.npc[index].height / 2); + if ((double) Math.Abs(Main.player[this.owner].position.X + (float) (Main.player[this.owner].width / 2) - num58) + (double) Math.Abs(Main.player[this.owner].position.Y + (float) (Main.player[this.owner].height / 2) - num59) < (double) num56) + { + if (Collision.CanHit(this.position, this.width, this.height, Main.npc[index].position, Main.npc[index].width, Main.npc[index].height)) + num57 = index; + flag6 = true; + break; + } + } + } + if (!flag6) + num55 -= (float) (40 * this.minionPos * Main.player[this.owner].direction); + if (flag6 && num57 >= 0) + this.ai[0] = 0.0f; + } + float num60 = Main.player[this.owner].position.Y + (float) (Main.player[this.owner].height / 2) - vector2.Y; + if (this.type == (int) sbyte.MaxValue) + num60 = Main.player[this.owner].position.Y - vector2.Y; + float num61 = (float) Math.Sqrt((double) num55 * (double) num55 + (double) num60 * (double) num60); + float num62 = 10f; + float num63 = num61; + if (this.type == 111) + num62 = 11f; + if (this.type == (int) sbyte.MaxValue) + num62 = 9f; + if (this.type == 324) + num62 = 20f; + if (flag5) + { + num53 = 0.4f; + num62 = 12f; + if ((double) num62 < (double) Math.Abs(Main.player[this.owner].velocity.X) + (double) Math.Abs(Main.player[this.owner].velocity.Y)) + num62 = Math.Abs(Main.player[this.owner].velocity.X) + Math.Abs(Main.player[this.owner].velocity.Y); + } + if (this.type == 208 && (double) Math.Abs(Main.player[this.owner].velocity.X) + (double) Math.Abs(Main.player[this.owner].velocity.Y) > 4.0) + num54 = -1; + if ((double) num61 < (double) num54 && (double) Main.player[this.owner].velocity.Y == 0.0 && (double) this.position.Y + (double) this.height <= (double) Main.player[this.owner].position.Y + (double) Main.player[this.owner].height && !Collision.SolidCollision(this.position, this.width, this.height)) + { + this.ai[0] = 0.0f; + if ((double) this.velocity.Y < -6.0) + this.velocity.Y = -6f; + } + float num64; + float num65; + if ((double) num61 < 60.0) + { + num64 = this.velocity.X; + num65 = this.velocity.Y; + } + else + { + float num66 = num62 / num61; + num64 = num55 * num66; + num65 = num60 * num66; + } + if (this.type == 324) + { + if ((double) num63 > 1000.0) + { + if ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) < (double) num62 - 1.25) + this.velocity = this.velocity * 1.025f; + if ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) > (double) num62 + 1.25) + this.velocity = this.velocity * 0.975f; + } + else if ((double) num63 > 600.0) + { + if ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) < (double) num62 - 1.0) + this.velocity = this.velocity * 1.05f; + if ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) > (double) num62 + 1.0) + this.velocity = this.velocity * 0.95f; + } + else if ((double) num63 > 400.0) + { + if ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) < (double) num62 - 0.5) + this.velocity = this.velocity * 1.075f; + if ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) > (double) num62 + 0.5) + this.velocity = this.velocity * 0.925f; + } + else + { + if ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) < (double) num62 - 0.25) + this.velocity = this.velocity * 1.1f; + if ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) > (double) num62 + 0.25) + this.velocity = this.velocity * 0.9f; + } + this.velocity.X = (float) (((double) this.velocity.X * 34.0 + (double) num64) / 35.0); + this.velocity.Y = (float) (((double) this.velocity.Y * 34.0 + (double) num65) / 35.0); + } + else + { + if ((double) this.velocity.X < (double) num64) + { + this.velocity.X += num53; + if ((double) this.velocity.X < 0.0) + this.velocity.X += num53 * 1.5f; + } + if ((double) this.velocity.X > (double) num64) + { + this.velocity.X -= num53; + if ((double) this.velocity.X > 0.0) + this.velocity.X -= num53 * 1.5f; + } + if ((double) this.velocity.Y < (double) num65) + { + this.velocity.Y += num53; + if ((double) this.velocity.Y < 0.0) + this.velocity.Y += num53 * 1.5f; + } + if ((double) this.velocity.Y > (double) num65) + { + this.velocity.Y -= num53; + if ((double) this.velocity.Y > 0.0) + this.velocity.Y -= num53 * 1.5f; + } + } + if (this.type == 111) + this.frame = 7; + if (this.type == 112) + this.frame = 2; + if (flag5 && this.frame < 12) + { + this.frame = Main.rand.Next(12, 18); + this.frameCounter = 0; + } + if (this.type != 313) + { + if ((double) this.velocity.X > 0.5) + this.spriteDirection = -1; + else if ((double) this.velocity.X < -0.5) + this.spriteDirection = 1; + } + if (this.type == 398) + { + if ((double) this.velocity.X > 0.5) + this.spriteDirection = 1; + else if ((double) this.velocity.X < -0.5) + this.spriteDirection = -1; + } + if (this.type == 112) + this.rotation = this.spriteDirection != -1 ? (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X) + 1.57f : (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X) + 1.57f; + else if (this.type >= 390 && this.type <= 392) + { + int index3 = (int) ((double) this.Center.X / 16.0); + int index4 = (int) ((double) this.Center.Y / 16.0); + if (Main.tile[index3, index4] != null && Main.tile[index3, index4].wall > (byte) 0) + { + this.rotation = this.velocity.ToRotation() + 1.570796f; + this.frameCounter += (int) ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y)); + if (this.frameCounter > 5) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame > 7) + this.frame = 4; + if (this.frame < 4) + this.frame = 7; + } + else + { + ++this.frameCounter; + if (this.frameCounter > 2) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame < 8 || this.frame > 10) + this.frame = 8; + this.rotation = this.velocity.X * 0.1f; + } + } + else if (this.type == 334) + { + ++this.frameCounter; + if (this.frameCounter > 1) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame < 7 || this.frame > 10) + this.frame = 7; + this.rotation = this.velocity.X * 0.1f; + } + else if (this.type == 353) + { + ++this.frameCounter; + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame < 10 || this.frame > 13) + this.frame = 10; + this.rotation = this.velocity.X * 0.05f; + } + else if (this.type == (int) sbyte.MaxValue) + { + this.frameCounter += 3; + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame <= 5 || this.frame > 15) + this.frame = 6; + this.rotation = this.velocity.X * 0.1f; + } + else if (this.type == 269) + { + if (this.frame == 6) + this.frameCounter = 0; + else if (this.frame < 4 || this.frame > 6) + { + this.frameCounter = 0; + this.frame = 4; + } + else + { + ++this.frameCounter; + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + } + this.rotation = this.velocity.X * 0.05f; + } + else if (this.type == 266) + { + ++this.frameCounter; + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame < 2 || this.frame > 5) + this.frame = 2; + this.rotation = this.velocity.X * 0.1f; + } + else if (this.type == 324) + { + ++this.frameCounter; + if (this.frameCounter > 1) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame < 6 || this.frame > 9) + this.frame = 6; + this.rotation = (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X) + 1.58f; + Lighting.AddLight((int) this.Center.X / 16, (int) this.Center.Y / 16, 0.9f, 0.6f, 0.2f); + for (int index5 = 0; index5 < 2; ++index5) + { + int num67 = 4; + int index6 = Dust.NewDust(new Vector2(this.Center.X - (float) num67, this.Center.Y - (float) num67) - this.velocity * 0.0f, num67 * 2, num67 * 2, 6, Alpha: 100); + Main.dust[index6].scale *= (float) (1.79999995231628 + (double) Main.rand.Next(10) * 0.100000001490116); + Main.dust[index6].velocity *= 0.2f; + if (index5 == 1) + Main.dust[index6].position -= this.velocity * 0.5f; + Main.dust[index6].noGravity = true; + int index7 = Dust.NewDust(new Vector2(this.Center.X - (float) num67, this.Center.Y - (float) num67) - this.velocity * 0.0f, num67 * 2, num67 * 2, 31, Alpha: 100, Scale: 0.5f); + Main.dust[index7].fadeIn = (float) (1.0 + (double) Main.rand.Next(5) * 0.100000001490116); + Main.dust[index7].velocity *= 0.05f; + if (index5 == 1) + Main.dust[index7].position -= this.velocity * 0.5f; + } + } + else if (this.type == 268) + { + ++this.frameCounter; + if (this.frameCounter > 4) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame < 6 || this.frame > 7) + this.frame = 6; + this.rotation = (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X) + 1.58f; + } + else if (this.type == 200) + { + this.frameCounter += 3; + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame <= 5 || this.frame > 9) + this.frame = 6; + this.rotation = this.velocity.X * 0.1f; + } + else if (this.type == 208) + { + this.rotation = this.velocity.X * 0.075f; + ++this.frameCounter; + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame > 4) + this.frame = 1; + if (this.frame < 1) + this.frame = 1; + } + else if (this.type == 236) + { + this.rotation = this.velocity.Y * 0.05f * (float) this.direction; + if ((double) this.velocity.Y < 0.0) + this.frameCounter += 2; + else + ++this.frameCounter; + if (this.frameCounter >= 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame > 12) + this.frame = 9; + if (this.frame < 9) + this.frame = 9; + } + else if (this.type == 499) + { + this.rotation = this.velocity.Y * 0.05f * (float) this.direction; + if ((double) this.velocity.Y < 0.0) + this.frameCounter += 2; + else + ++this.frameCounter; + if (this.frameCounter >= 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame >= 12) + this.frame = 8; + if (this.frame < 8) + this.frame = 8; + } + else if (this.type == 314) + { + this.rotation = (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X) + 1.58f; + ++this.frameCounter; + if (this.frameCounter >= 3) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame > 12) + this.frame = 7; + if (this.frame < 7) + this.frame = 7; + } + else if (this.type == 319) + { + this.rotation = this.velocity.X * 0.05f; + ++this.frameCounter; + if (this.frameCounter >= 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame > 10) + this.frame = 6; + if (this.frame < 6) + this.frame = 6; + } + else if (this.type == 210) + { + this.rotation = (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X) + 1.58f; + this.frameCounter += 3; + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame > 11) + this.frame = 7; + if (this.frame < 7) + this.frame = 7; + } + else if (this.type == 313) + { + this.position.Y += (float) this.height; + this.height = 54; + this.position.Y -= (float) this.height; + this.position.X += (float) (this.width / 2); + this.width = 54; + this.position.X -= (float) (this.width / 2); + this.rotation += this.velocity.X * 0.01f; + this.frameCounter = 0; + this.frame = 11; + } + else if (this.type == 398) + { + ++this.frameCounter; + if (this.frameCounter > 1) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame < 6 || this.frame > 9) + this.frame = 6; + this.rotation = this.velocity.X * 0.1f; + } + else + this.rotation = this.spriteDirection != -1 ? (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X) + 3.14f : (float) Math.Atan2((double) this.velocity.Y, (double) this.velocity.X); + if (flag5 || this.type == 499 || this.type == 398 || this.type == 390 || this.type == 391 || this.type == 392 || this.type == (int) sbyte.MaxValue || this.type == 200 || this.type == 208 || this.type == 210 || this.type == 236 || this.type == 266 || this.type == 268 || this.type == 269 || this.type == 313 || this.type == 314 || this.type == 319 || this.type == 324 || this.type == 334 || this.type == 353) + return; + int index8 = Dust.NewDust(new Vector2((float) ((double) this.position.X + (double) (this.width / 2) - 4.0), (float) ((double) this.position.Y + (double) (this.height / 2) - 4.0)) - this.velocity, 8, 8, 16, (float) (-(double) this.velocity.X * 0.5), this.velocity.Y * 0.5f, 50, Scale: 1.7f); + Main.dust[index8].velocity.X *= 0.2f; + Main.dust[index8].velocity.Y *= 0.2f; + Main.dust[index8].noGravity = true; + } + else + { + if (flag5) + { + float num68 = (float) (40 * this.minionPos); + int num69 = 30; + int num70 = 60; + --this.localAI[0]; + if ((double) this.localAI[0] < 0.0) + this.localAI[0] = 0.0f; + if ((double) this.ai[1] > 0.0) + { + --this.ai[1]; + } + else + { + float num71 = this.position.X; + float num72 = this.position.Y; + float num73 = 100000f; + float num74 = num73; + int num75 = -1; + NPC minionAttackTargetNpc = this.OwnerMinionAttackTargetNPC; + if (minionAttackTargetNpc != null && minionAttackTargetNpc.CanBeChasedBy((object) this)) + { + float num76 = minionAttackTargetNpc.position.X + (float) (minionAttackTargetNpc.width / 2); + float num77 = minionAttackTargetNpc.position.Y + (float) (minionAttackTargetNpc.height / 2); + float num78 = Math.Abs(this.position.X + (float) (this.width / 2) - num76) + Math.Abs(this.position.Y + (float) (this.height / 2) - num77); + if ((double) num78 < (double) num73) + { + if (num75 == -1 && (double) num78 <= (double) num74) + { + num74 = num78; + num71 = num76; + num72 = num77; + } + if (Collision.CanHit(this.position, this.width, this.height, minionAttackTargetNpc.position, minionAttackTargetNpc.width, minionAttackTargetNpc.height)) + { + num73 = num78; + num71 = num76; + num72 = num77; + num75 = minionAttackTargetNpc.whoAmI; + } + } + } + if (num75 == -1) + { + for (int index = 0; index < 200; ++index) + { + if (Main.npc[index].CanBeChasedBy((object) this)) + { + float num79 = Main.npc[index].position.X + (float) (Main.npc[index].width / 2); + float num80 = Main.npc[index].position.Y + (float) (Main.npc[index].height / 2); + float num81 = Math.Abs(this.position.X + (float) (this.width / 2) - num79) + Math.Abs(this.position.Y + (float) (this.height / 2) - num80); + if ((double) num81 < (double) num73) + { + if (num75 == -1 && (double) num81 <= (double) num74) + { + num74 = num81; + num71 = num79; + num72 = num80; + } + if (Collision.CanHit(this.position, this.width, this.height, Main.npc[index].position, Main.npc[index].width, Main.npc[index].height)) + { + num73 = num81; + num71 = num79; + num72 = num80; + num75 = index; + } + } + } + } + } + if (num75 == -1 && (double) num74 < (double) num73) + num73 = num74; + float num82 = 400f; + if ((double) this.position.Y > Main.worldSurface * 16.0) + num82 = 200f; + if ((double) num73 < (double) num82 + (double) num68 && num75 == -1) + { + float num83 = num71 - (this.position.X + (float) (this.width / 2)); + if ((double) num83 < -5.0) + { + flag1 = true; + flag2 = false; + } + else if ((double) num83 > 5.0) + { + flag2 = true; + flag1 = false; + } + } + else if (num75 >= 0 && (double) num73 < 800.0 + (double) num68) + { + this.localAI[0] = (float) num70; + float num84 = num71 - (this.position.X + (float) (this.width / 2)); + if ((double) num84 > 300.0 || (double) num84 < -300.0) + { + if ((double) num84 < -50.0) + { + flag1 = true; + flag2 = false; + } + else if ((double) num84 > 50.0) + { + flag2 = true; + flag1 = false; + } + } + else if (this.owner == Main.myPlayer) + { + this.ai[1] = (float) num69; + Vector2 vector2 = new Vector2(this.position.X + (float) this.width * 0.5f, (float) ((double) this.position.Y + (double) (this.height / 2) - 8.0)); + float num85 = num71 - vector2.X + (float) Main.rand.Next(-20, 21); + float num86 = (float) ((double) (Math.Abs(num85) * 0.1f) * (double) Main.rand.Next(0, 100) * (1.0 / 1000.0)); + float num87 = num72 - vector2.Y + (float) Main.rand.Next(-20, 21) - num86; + float num88 = (float) (12.0 / Math.Sqrt((double) num85 * (double) num85 + (double) num87 * (double) num87)); + float SpeedX = num85 * num88; + float SpeedY = num87 * num88; + int damage = this.damage; + int Type = 195; + int index = Projectile.NewProjectile(vector2.X, vector2.Y, SpeedX, SpeedY, Type, damage, this.knockBack, Main.myPlayer); + Main.projectile[index].timeLeft = 300; + if ((double) SpeedX < 0.0) + this.direction = -1; + if ((double) SpeedX > 0.0) + this.direction = 1; + this.netUpdate = true; + } + } + } + } + bool flag7 = false; + Vector2 vector2_1 = Vector2.Zero; + bool flag8 = false; + if (this.type == 266 || this.type >= 390 && this.type <= 392) + { + float num89 = (float) (40 * this.minionPos); + int num90 = 60; + --this.localAI[0]; + if ((double) this.localAI[0] < 0.0) + this.localAI[0] = 0.0f; + if ((double) this.ai[1] > 0.0) + { + --this.ai[1]; + } + else + { + float x1 = this.position.X; + float y1 = this.position.Y; + float num91 = 100000f; + float num92 = num91; + int index9 = -1; + NPC minionAttackTargetNpc = this.OwnerMinionAttackTargetNPC; + if (minionAttackTargetNpc != null && minionAttackTargetNpc.CanBeChasedBy((object) this)) + { + float x2 = minionAttackTargetNpc.Center.X; + float y2 = minionAttackTargetNpc.Center.Y; + float num93 = Math.Abs(this.position.X + (float) (this.width / 2) - x2) + Math.Abs(this.position.Y + (float) (this.height / 2) - y2); + if ((double) num93 < (double) num91) + { + if (index9 == -1 && (double) num93 <= (double) num92) + { + num92 = num93; + x1 = x2; + y1 = y2; + } + if (Collision.CanHit(this.position, this.width, this.height, minionAttackTargetNpc.position, minionAttackTargetNpc.width, minionAttackTargetNpc.height)) + { + num91 = num93; + x1 = x2; + y1 = y2; + index9 = minionAttackTargetNpc.whoAmI; + } + } + } + if (index9 == -1) + { + for (int index10 = 0; index10 < 200; ++index10) + { + if (Main.npc[index10].CanBeChasedBy((object) this)) + { + float num94 = Main.npc[index10].position.X + (float) (Main.npc[index10].width / 2); + float num95 = Main.npc[index10].position.Y + (float) (Main.npc[index10].height / 2); + float num96 = Math.Abs(this.position.X + (float) (this.width / 2) - num94) + Math.Abs(this.position.Y + (float) (this.height / 2) - num95); + if ((double) num96 < (double) num91) + { + if (index9 == -1 && (double) num96 <= (double) num92) + { + num92 = num96; + x1 = num94; + y1 = num95; + } + if (Collision.CanHit(this.position, this.width, this.height, Main.npc[index10].position, Main.npc[index10].width, Main.npc[index10].height)) + { + num91 = num96; + x1 = num94; + y1 = num95; + index9 = index10; + } + } + } + } + } + if (this.type >= 390 && this.type <= 392 && !Collision.SolidCollision(this.position, this.width, this.height)) + this.tileCollide = true; + if (index9 == -1 && (double) num92 < (double) num91) + num91 = num92; + else if (index9 >= 0) + { + flag7 = true; + vector2_1 = new Vector2(x1, y1) - this.Center; + if (this.type >= 390 && this.type <= 392) + { + if ((double) Main.npc[index9].position.Y > (double) this.position.Y + (double) this.height) + { + int index11 = (int) ((double) this.Center.X / 16.0); + int index12 = (int) (((double) this.position.Y + (double) this.height + 1.0) / 16.0); + if (Main.tile[index11, index12] != null && Main.tile[index11, index12].active() && TileID.Sets.Platforms[(int) Main.tile[index11, index12].type]) + this.tileCollide = false; + } + Microsoft.Xna.Framework.Rectangle rectangle1 = new Microsoft.Xna.Framework.Rectangle((int) this.position.X, (int) this.position.Y, this.width, this.height); + Microsoft.Xna.Framework.Rectangle rectangle2 = new Microsoft.Xna.Framework.Rectangle((int) Main.npc[index9].position.X, (int) Main.npc[index9].position.Y, Main.npc[index9].width, Main.npc[index9].height); + int num97 = 10; + rectangle2.X -= num97; + rectangle2.Y -= num97; + rectangle2.Width += num97 * 2; + rectangle2.Height += num97 * 2; + if (rectangle1.Intersects(rectangle2)) + { + flag8 = true; + Vector2 v = Main.npc[index9].Center - this.Center; + if ((double) this.velocity.Y > 0.0 && (double) v.Y < 0.0) + this.velocity.Y *= 0.5f; + if ((double) this.velocity.Y < 0.0 && (double) v.Y > 0.0) + this.velocity.Y *= 0.5f; + if ((double) this.velocity.X > 0.0 && (double) v.X < 0.0) + this.velocity.X *= 0.5f; + if ((double) this.velocity.X < 0.0 && (double) v.X > 0.0) + this.velocity.X *= 0.5f; + if ((double) v.Length() > 14.0) + { + v.Normalize(); + v *= 14f; + } + this.rotation = (float) (((double) this.rotation * 5.0 + (double) v.ToRotation() + 1.57079637050629) / 6.0); + this.velocity = (this.velocity * 9f + v) / 10f; + for (int index13 = 0; index13 < 1000; ++index13) + { + if (this.whoAmI != index13 && this.owner == Main.projectile[index13].owner && Main.projectile[index13].type >= 390 && Main.projectile[index13].type <= 392 && (double) (Main.projectile[index13].Center - this.Center).Length() < 15.0) + { + float num98 = 0.5f; + if ((double) this.Center.Y > (double) Main.projectile[index13].Center.Y) + { + Main.projectile[index13].velocity.Y -= num98; + this.velocity.Y += num98; + } + else + { + Main.projectile[index13].velocity.Y += num98; + this.velocity.Y -= num98; + } + if ((double) this.Center.X > (double) Main.projectile[index13].Center.X) + { + this.velocity.X += num98; + Main.projectile[index13].velocity.X -= num98; + } + else + { + this.velocity.X -= num98; + Main.projectile[index13].velocity.Y += num98; + } + } + } + } + } + } + float num99 = 300f; + if ((double) this.position.Y > Main.worldSurface * 16.0) + num99 = 150f; + if (this.type >= 390 && this.type <= 392) + { + num99 = 500f; + if ((double) this.position.Y > Main.worldSurface * 16.0) + num99 = 250f; + } + if ((double) num91 < (double) num99 + (double) num89 && index9 == -1) + { + float num100 = x1 - (this.position.X + (float) (this.width / 2)); + if ((double) num100 < -5.0) + { + flag1 = true; + flag2 = false; + } + else if ((double) num100 > 5.0) + { + flag2 = true; + flag1 = false; + } + } + bool flag9 = false; + if (this.type >= 390 && this.type <= 392 && (double) this.localAI[1] > 0.0) + { + flag9 = true; + --this.localAI[1]; + } + if (index9 >= 0 && (double) num91 < 800.0 + (double) num89) + { + this.friendly = true; + this.localAI[0] = (float) num90; + float num101 = x1 - (this.position.X + (float) (this.width / 2)); + if ((double) num101 < -10.0) + { + flag1 = true; + flag2 = false; + } + else if ((double) num101 > 10.0) + { + flag2 = true; + flag1 = false; + } + if ((double) y1 < (double) this.Center.Y - 100.0 && (double) num101 > -50.0 && (double) num101 < 50.0 && (double) this.velocity.Y == 0.0) + { + float num102 = Math.Abs(y1 - this.Center.Y); + if ((double) num102 < 120.0) + this.velocity.Y = -10f; + else if ((double) num102 < 210.0) + this.velocity.Y = -13f; + else if ((double) num102 < 270.0) + this.velocity.Y = -15f; + else if ((double) num102 < 310.0) + this.velocity.Y = -17f; + else if ((double) num102 < 380.0) + this.velocity.Y = -18f; + } + if (flag9) + { + this.friendly = false; + if ((double) this.velocity.X < 0.0) + flag1 = true; + else if ((double) this.velocity.X > 0.0) + flag2 = true; + } + } + else + this.friendly = false; + } + } + if ((double) this.ai[1] != 0.0) + { + flag1 = false; + flag2 = false; + } + else if (flag5 && (double) this.localAI[0] == 0.0) + this.direction = Main.player[this.owner].direction; + else if (this.type >= 390 && this.type <= 392) + { + int index14 = (int) ((double) this.Center.X / 16.0); + int index15 = (int) ((double) this.Center.Y / 16.0); + if (Main.tile[index14, index15] != null && Main.tile[index14, index15].wall > (byte) 0) + flag1 = flag2 = false; + } + if (this.type == (int) sbyte.MaxValue) + { + if ((double) this.rotation > -0.1 && (double) this.rotation < 0.1) + this.rotation = 0.0f; + else if ((double) this.rotation < 0.0) + this.rotation += 0.1f; + else + this.rotation -= 0.1f; + } + else if (this.type != 313 && !flag8) + this.rotation = 0.0f; + if (this.type < 390 || this.type > 392) + this.tileCollide = true; + float num103 = 0.08f; + float num104 = 6.5f; + if (this.type == (int) sbyte.MaxValue) + { + num104 = 2f; + num103 = 0.04f; + } + if (this.type == 112) + { + num104 = 6f; + num103 = 0.06f; + } + if (this.type == 334) + { + num104 = 8f; + num103 = 0.08f; + } + if (this.type == 268) + { + num104 = 8f; + num103 = 0.4f; + } + if (this.type == 324) + { + num103 = 0.1f; + num104 = 3f; + } + if (flag5 || this.type == 266 || this.type >= 390 && this.type <= 392) + { + num104 = 6f; + num103 = 0.2f; + if ((double) num104 < (double) Math.Abs(Main.player[this.owner].velocity.X) + (double) Math.Abs(Main.player[this.owner].velocity.Y)) + { + num104 = Math.Abs(Main.player[this.owner].velocity.X) + Math.Abs(Main.player[this.owner].velocity.Y); + num103 = 0.3f; + } + } + if (this.type >= 390 && this.type <= 392) + num103 *= 2f; + if (flag1) + { + if ((double) this.velocity.X > -3.5) + this.velocity.X -= num103; + else + this.velocity.X -= num103 * 0.25f; + } + else if (flag2) + { + if ((double) this.velocity.X < 3.5) + this.velocity.X += num103; + else + this.velocity.X += num103 * 0.25f; + } + else + { + this.velocity.X *= 0.9f; + if ((double) this.velocity.X >= -(double) num103 && (double) this.velocity.X <= (double) num103) + this.velocity.X = 0.0f; + } + if (this.type == 208) + { + this.velocity.X *= 0.95f; + if ((double) this.velocity.X > -0.1 && (double) this.velocity.X < 0.1) + this.velocity.X = 0.0f; + flag1 = false; + flag2 = false; + } + if (flag1 | flag2) + { + int num105 = (int) ((double) this.position.X + (double) (this.width / 2)) / 16; + int j = (int) ((double) this.position.Y + (double) (this.height / 2)) / 16; + if (this.type == 236) + num105 += this.direction; + if (flag1) + --num105; + if (flag2) + ++num105; + if (WorldGen.SolidTile(num105 + (int) this.velocity.X, j)) + flag4 = true; + } + if ((double) Main.player[this.owner].position.Y + (double) Main.player[this.owner].height - 8.0 > (double) this.position.Y + (double) this.height) + flag3 = true; + if (this.type == 268 && this.frameCounter < 10) + flag4 = false; + Collision.StepUp(ref this.position, ref this.velocity, this.width, this.height, ref this.stepSpeed, ref this.gfxOffY); + if ((double) this.velocity.Y == 0.0 || this.type == 200) + { + if (!flag3 && ((double) this.velocity.X < 0.0 || (double) this.velocity.X > 0.0)) + { + int i = (int) ((double) this.position.X + (double) (this.width / 2)) / 16; + int j = (int) ((double) this.position.Y + (double) (this.height / 2)) / 16 + 1; + if (flag1) + --i; + if (flag2) + ++i; + WorldGen.SolidTile(i, j); + } + if (flag4) + { + int i1 = (int) ((double) this.position.X + (double) (this.width / 2)) / 16; + int j = (int) ((double) this.position.Y + (double) this.height) / 16 + 1; + if (WorldGen.SolidTile(i1, j) || Main.tile[i1, j].halfBrick() || Main.tile[i1, j].slope() > (byte) 0 || this.type == 200) + { + if (this.type == 200) + { + this.velocity.Y = -3.1f; + } + else + { + try + { + int num106 = (int) ((double) this.position.X + (double) (this.width / 2)) / 16; + int num107 = (int) ((double) this.position.Y + (double) (this.height / 2)) / 16; + if (flag1) + --num106; + if (flag2) + ++num106; + int i2 = num106 + (int) this.velocity.X; + if (!WorldGen.SolidTile(i2, num107 - 1) && !WorldGen.SolidTile(i2, num107 - 2)) + this.velocity.Y = -5.1f; + else if (!WorldGen.SolidTile(i2, num107 - 2)) + this.velocity.Y = -7.1f; + else if (WorldGen.SolidTile(i2, num107 - 5)) + this.velocity.Y = -11.1f; + else if (WorldGen.SolidTile(i2, num107 - 4)) + this.velocity.Y = -10.1f; + else + this.velocity.Y = -9.1f; + } + catch + { + this.velocity.Y = -9.1f; + } + } + if (this.type == (int) sbyte.MaxValue) + this.ai[0] = 1f; + } + } + else if (this.type == 266 && flag1 | flag2) + this.velocity.Y -= 6f; + } + if ((double) this.velocity.X > (double) num104) + this.velocity.X = num104; + if ((double) this.velocity.X < -(double) num104) + this.velocity.X = -num104; + if ((double) this.velocity.X < 0.0) + this.direction = -1; + if ((double) this.velocity.X > 0.0) + this.direction = 1; + if ((double) this.velocity.X > (double) num103 & flag2) + this.direction = 1; + if ((double) this.velocity.X < -(double) num103 & flag1) + this.direction = -1; + if (this.type != 313) + { + if (this.direction == -1) + this.spriteDirection = 1; + if (this.direction == 1) + this.spriteDirection = -1; + } + if (this.type == 398) + this.spriteDirection = this.direction; + if (flag5) + { + if ((double) this.ai[1] > 0.0) + { + if ((double) this.localAI[1] == 0.0) + { + this.localAI[1] = 1f; + this.frame = 1; + } + if (this.frame != 0) + { + ++this.frameCounter; + if (this.frameCounter > 4) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame == 4) + this.frame = 0; + } + } + else if ((double) this.velocity.Y == 0.0) + { + this.localAI[1] = 0.0f; + if ((double) this.velocity.X == 0.0) + { + this.frame = 0; + this.frameCounter = 0; + } + else if ((double) this.velocity.X < -0.8 || (double) this.velocity.X > 0.8) + { + this.frameCounter += (int) Math.Abs(this.velocity.X); + ++this.frameCounter; + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame < 5) + this.frame = 5; + if (this.frame >= 11) + this.frame = 5; + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + } + else if ((double) this.velocity.Y < 0.0) + { + this.frameCounter = 0; + this.frame = 4; + } + else if ((double) this.velocity.Y > 0.0) + { + this.frameCounter = 0; + this.frame = 4; + } + this.velocity.Y += 0.4f; + if ((double) this.velocity.Y > 10.0) + this.velocity.Y = 10f; + Vector2 velocity = this.velocity; + } + else if (this.type == 268) + { + if ((double) this.velocity.Y == 0.0) + { + if (this.frame > 5) + this.frameCounter = 0; + if ((double) this.velocity.X == 0.0) + { + int num108 = 3; + ++this.frameCounter; + if (this.frameCounter < num108) + this.frame = 0; + else if (this.frameCounter < num108 * 2) + this.frame = 1; + else if (this.frameCounter < num108 * 3) + this.frame = 2; + else if (this.frameCounter < num108 * 4) + this.frame = 3; + else + this.frameCounter = num108 * 4; + } + else + { + this.velocity.X *= 0.8f; + ++this.frameCounter; + int num109 = 3; + if (this.frameCounter < num109) + this.frame = 0; + else if (this.frameCounter < num109 * 2) + this.frame = 1; + else if (this.frameCounter < num109 * 3) + this.frame = 2; + else if (this.frameCounter < num109 * 4) + this.frame = 3; + else if (flag1 | flag2) + { + this.velocity.X *= 2f; + this.frame = 4; + this.velocity.Y = -6.1f; + this.frameCounter = 0; + for (int index16 = 0; index16 < 4; ++index16) + { + int index17 = Dust.NewDust(new Vector2(this.position.X, (float) ((double) this.position.Y + (double) this.height - 2.0)), this.width, 4, 5); + Main.dust[index17].velocity += this.velocity; + Main.dust[index17].velocity *= 0.4f; + } + } + else + this.frameCounter = num109 * 4; + } + } + else if ((double) this.velocity.Y < 0.0) + { + this.frameCounter = 0; + this.frame = 5; + } + else + { + this.frame = 4; + this.frameCounter = 3; + } + this.velocity.Y += 0.4f; + if ((double) this.velocity.Y <= 10.0) + return; + this.velocity.Y = 10f; + } + else if (this.type == 269) + { + if ((double) this.velocity.Y >= 0.0 && (double) this.velocity.Y <= 0.8) + { + if ((double) this.velocity.X == 0.0) + { + this.frame = 0; + this.frameCounter = 0; + } + else if ((double) this.velocity.X < -0.8 || (double) this.velocity.X > 0.8) + { + int index = Dust.NewDust(new Vector2(this.position.X, (float) ((double) this.position.Y + (double) this.height - 2.0)), this.width, 6, 76); + Main.dust[index].noGravity = true; + Main.dust[index].velocity *= 0.3f; + Main.dust[index].noLight = true; + this.frameCounter += (int) Math.Abs(this.velocity.X); + ++this.frameCounter; + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame > 3) + this.frame = 0; + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + } + else + { + this.frameCounter = 0; + this.frame = 2; + } + this.velocity.Y += 0.4f; + if ((double) this.velocity.Y <= 10.0) + return; + this.velocity.Y = 10f; + } + else if (this.type == 313) + { + int index18 = (int) ((double) this.Center.X / 16.0); + int index19 = (int) ((double) this.Center.Y / 16.0); + if (Main.tile[index18, index19] != null && Main.tile[index18, index19].wall > (byte) 0) + { + this.position.Y += (float) this.height; + this.height = 34; + this.position.Y -= (float) this.height; + this.position.X += (float) (this.width / 2); + this.width = 34; + this.position.X -= (float) (this.width / 2); + Vector2 vector2_2 = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); + float num110 = Main.player[this.owner].Center.X - vector2_2.X; + float num111 = Main.player[this.owner].Center.Y - vector2_2.Y; + float num112 = (float) Math.Sqrt((double) num110 * (double) num110 + (double) num111 * (double) num111); + float num113 = (float) (4.0 / (double) num112); + float num114 = num110 * num113; + float num115 = num111 * num113; + if ((double) num112 < 120.0) + { + this.velocity.X *= 0.9f; + this.velocity.Y *= 0.9f; + if ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) < 0.1) + this.velocity = this.velocity * 0.0f; + } + else + { + this.velocity.X = (float) (((double) this.velocity.X * 9.0 + (double) num114) / 10.0); + this.velocity.Y = (float) (((double) this.velocity.Y * 9.0 + (double) num115) / 10.0); + } + if ((double) num112 >= 120.0) + { + this.spriteDirection = this.direction; + this.rotation = (float) Math.Atan2((double) this.velocity.Y * (double) -this.direction, (double) this.velocity.X * (double) -this.direction); + } + this.frameCounter += (int) ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y)); + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame > 10) + this.frame = 5; + if (this.frame >= 5) + return; + this.frame = 10; + } + else + { + this.rotation = 0.0f; + if (this.direction == -1) + this.spriteDirection = 1; + if (this.direction == 1) + this.spriteDirection = -1; + this.position.Y += (float) this.height; + this.height = 30; + this.position.Y -= (float) this.height; + this.position.X += (float) (this.width / 2); + this.width = 30; + this.position.X -= (float) (this.width / 2); + if ((double) this.velocity.Y >= 0.0 && (double) this.velocity.Y <= 0.8) + { + if ((double) this.velocity.X == 0.0) + { + this.frame = 0; + this.frameCounter = 0; + } + else if ((double) this.velocity.X < -0.8 || (double) this.velocity.X > 0.8) + { + this.frameCounter += (int) Math.Abs(this.velocity.X); + ++this.frameCounter; + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame > 3) + this.frame = 0; + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + } + else + { + this.frameCounter = 0; + this.frame = 4; + } + this.velocity.Y += 0.4f; + if ((double) this.velocity.Y <= 10.0) + return; + this.velocity.Y = 10f; + } + } + else if (this.type >= 390 && this.type <= 392) + { + int index20 = (int) ((double) this.Center.X / 16.0); + int index21 = (int) ((double) this.Center.Y / 16.0); + if (Main.tile[index20, index21] != null && Main.tile[index20, index21].wall > (byte) 0) + { + this.position.Y += (float) this.height; + this.height = 34; + this.position.Y -= (float) this.height; + this.position.X += (float) (this.width / 2); + this.width = 34; + this.position.X -= (float) (this.width / 2); + float num116 = 9f; + float num117 = (float) (40 * (this.minionPos + 1)); + Vector2 v = Main.player[this.owner].Center - this.Center; + if (flag7) + { + v = vector2_1; + num117 = 10f; + } + else if (!Collision.CanHitLine(this.Center, 1, 1, Main.player[this.owner].Center, 1, 1)) + this.ai[0] = 1f; + if ((double) v.Length() < (double) num117) + { + this.velocity = this.velocity * 0.9f; + if ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y) < 0.1) + this.velocity = this.velocity * 0.0f; + } + else if ((double) v.Length() < 800.0 || !flag7) + this.velocity = (this.velocity * 9f + Vector2.Normalize(v) * num116) / 10f; + if ((double) v.Length() >= (double) num117) + { + this.spriteDirection = this.direction; + this.rotation = this.velocity.ToRotation() + 1.570796f; + } + else + this.rotation = v.ToRotation() + 1.570796f; + this.frameCounter += (int) ((double) Math.Abs(this.velocity.X) + (double) Math.Abs(this.velocity.Y)); + if (this.frameCounter > 5) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame > 7) + this.frame = 4; + if (this.frame >= 4) + return; + this.frame = 7; + } + else + { + if (!flag8) + this.rotation = 0.0f; + if (this.direction == -1) + this.spriteDirection = 1; + if (this.direction == 1) + this.spriteDirection = -1; + this.position.Y += (float) this.height; + this.height = 30; + this.position.Y -= (float) this.height; + this.position.X += (float) (this.width / 2); + this.width = 30; + this.position.X -= (float) (this.width / 2); + if (!flag7 && !Collision.CanHitLine(this.Center, 1, 1, Main.player[this.owner].Center, 1, 1)) + this.ai[0] = 1f; + if (!flag8 && this.frame >= 4 && this.frame <= 7) + { + Vector2 vector2_3 = Main.player[this.owner].Center - this.Center; + if (flag7) + vector2_3 = vector2_1; + float num118 = -vector2_3.Y; + if ((double) vector2_3.Y <= 0.0) + { + if ((double) num118 < 120.0) + this.velocity.Y = -10f; + else if ((double) num118 < 210.0) + this.velocity.Y = -13f; + else if ((double) num118 < 270.0) + this.velocity.Y = -15f; + else if ((double) num118 < 310.0) + this.velocity.Y = -17f; + else if ((double) num118 < 380.0) + this.velocity.Y = -18f; + } + } + if (flag8) + { + ++this.frameCounter; + if (this.frameCounter > 3) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame >= 8) + this.frame = 4; + if (this.frame <= 3) + this.frame = 7; + } + else if ((double) this.velocity.Y >= 0.0 && (double) this.velocity.Y <= 0.8) + { + if ((double) this.velocity.X == 0.0) + { + this.frame = 0; + this.frameCounter = 0; + } + else if ((double) this.velocity.X < -0.8 || (double) this.velocity.X > 0.8) + { + this.frameCounter += (int) Math.Abs(this.velocity.X); + ++this.frameCounter; + if (this.frameCounter > 5) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame > 2) + this.frame = 0; + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + } + else + { + this.frameCounter = 0; + this.frame = 3; + } + this.velocity.Y += 0.4f; + if ((double) this.velocity.Y <= 10.0) + return; + this.velocity.Y = 10f; + } + } + else if (this.type == 314) + { + if ((double) this.velocity.Y >= 0.0 && (double) this.velocity.Y <= 0.8) + { + if ((double) this.velocity.X == 0.0) + { + this.frame = 0; + this.frameCounter = 0; + } + else if ((double) this.velocity.X < -0.8 || (double) this.velocity.X > 0.8) + { + this.frameCounter += (int) Math.Abs(this.velocity.X); + ++this.frameCounter; + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame > 6) + this.frame = 1; + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + } + else + { + this.frameCounter = 0; + this.frame = 7; + } + this.velocity.Y += 0.4f; + if ((double) this.velocity.Y <= 10.0) + return; + this.velocity.Y = 10f; + } + else if (this.type == 319) + { + if ((double) this.velocity.Y >= 0.0 && (double) this.velocity.Y <= 0.8) + { + if ((double) this.velocity.X == 0.0) + { + this.frame = 0; + this.frameCounter = 0; + } + else if ((double) this.velocity.X < -0.8 || (double) this.velocity.X > 0.8) + { + this.frameCounter += (int) Math.Abs(this.velocity.X); + ++this.frameCounter; + if (this.frameCounter > 8) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame > 5) + this.frame = 2; + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + } + else + { + this.frameCounter = 0; + this.frame = 1; + } + this.velocity.Y += 0.4f; + if ((double) this.velocity.Y <= 10.0) + return; + this.velocity.Y = 10f; + } + else if (this.type == 236) + { + if ((double) this.velocity.Y >= 0.0 && (double) this.velocity.Y <= 0.8) + { + if ((double) this.velocity.X == 0.0) + { + this.frame = 0; + this.frameCounter = 0; + } + else if ((double) this.velocity.X < -0.8 || (double) this.velocity.X > 0.8) + { + if (this.frame < 2) + this.frame = 2; + this.frameCounter += (int) Math.Abs(this.velocity.X); + ++this.frameCounter; + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame > 8) + this.frame = 2; + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + } + else + { + this.frameCounter = 0; + this.frame = 1; + } + this.velocity.Y += 0.4f; + if ((double) this.velocity.Y <= 10.0) + return; + this.velocity.Y = 10f; + } + else if (this.type == 499) + { + if ((double) this.velocity.Y >= 0.0 && (double) this.velocity.Y <= 0.8) + { + if ((double) this.velocity.X == 0.0) + { + this.frame = 0; + this.frameCounter = 0; + } + else if ((double) this.velocity.X < -0.8 || (double) this.velocity.X > 0.8) + { + if (this.frame < 2) + this.frame = 2; + this.frameCounter += (int) Math.Abs(this.velocity.X); + ++this.frameCounter; + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame >= 8) + this.frame = 2; + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + } + else + { + this.frameCounter = 0; + this.frame = 1; + } + this.velocity.Y += 0.4f; + if ((double) this.velocity.Y <= 10.0) + return; + this.velocity.Y = 10f; + } + else if (this.type == 266) + { + if ((double) this.velocity.Y >= 0.0 && (double) this.velocity.Y <= 0.8) + { + if ((double) this.velocity.X == 0.0) + ++this.frameCounter; + else + this.frameCounter += 3; + } + else + this.frameCounter += 5; + if (this.frameCounter >= 20) + { + this.frameCounter -= 20; + ++this.frame; + } + if (this.frame > 1) + this.frame = 0; + if (this.wet && (double) Main.player[this.owner].position.Y + (double) Main.player[this.owner].height < (double) this.position.Y + (double) this.height && (double) this.localAI[0] == 0.0) + { + if ((double) this.velocity.Y > -4.0) + this.velocity.Y -= 0.2f; + if ((double) this.velocity.Y > 0.0) + this.velocity.Y *= 0.95f; + } + else + this.velocity.Y += 0.4f; + if ((double) this.velocity.Y <= 10.0) + return; + this.velocity.Y = 10f; + } + else if (this.type == 334) + { + if ((double) this.velocity.Y == 0.0) + { + if ((double) this.velocity.X == 0.0) + { + if (this.frame > 0) + { + this.frameCounter += 2; + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame >= 7) + this.frame = 0; + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + } + else if ((double) this.velocity.X < -0.8 || (double) this.velocity.X > 0.8) + { + this.frameCounter += (int) Math.Abs((double) this.velocity.X * 0.75); + ++this.frameCounter; + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame >= 7 || this.frame < 1) + this.frame = 1; + } + else if (this.frame > 0) + { + this.frameCounter += 2; + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame >= 7) + this.frame = 0; + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + } + else if ((double) this.velocity.Y < 0.0) + { + this.frameCounter = 0; + this.frame = 2; + } + else if ((double) this.velocity.Y > 0.0) + { + this.frameCounter = 0; + this.frame = 4; + } + this.velocity.Y += 0.4f; + if ((double) this.velocity.Y <= 10.0) + return; + this.velocity.Y = 10f; + } + else if (this.type == 353) + { + if ((double) this.velocity.Y == 0.0) + { + if ((double) this.velocity.X == 0.0) + { + this.frame = 0; + this.frameCounter = 0; + } + else if ((double) this.velocity.X < -0.8 || (double) this.velocity.X > 0.8) + { + this.frameCounter += (int) Math.Abs(this.velocity.X); + ++this.frameCounter; + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame > 9) + this.frame = 2; + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + } + else if ((double) this.velocity.Y < 0.0) + { + this.frameCounter = 0; + this.frame = 1; + } + else if ((double) this.velocity.Y > 0.0) + { + this.frameCounter = 0; + this.frame = 1; + } + this.velocity.Y += 0.4f; + if ((double) this.velocity.Y <= 10.0) + return; + this.velocity.Y = 10f; + } + else if (this.type == 111) + { + if ((double) this.velocity.Y == 0.0) + { + if ((double) this.velocity.X == 0.0) + { + this.frame = 0; + this.frameCounter = 0; + } + else if ((double) this.velocity.X < -0.8 || (double) this.velocity.X > 0.8) + { + this.frameCounter += (int) Math.Abs(this.velocity.X); + ++this.frameCounter; + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame >= 7) + this.frame = 0; + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + } + else if ((double) this.velocity.Y < 0.0) + { + this.frameCounter = 0; + this.frame = 4; + } + else if ((double) this.velocity.Y > 0.0) + { + this.frameCounter = 0; + this.frame = 6; + } + this.velocity.Y += 0.4f; + if ((double) this.velocity.Y <= 10.0) + return; + this.velocity.Y = 10f; + } + else if (this.type == 112) + { + if ((double) this.velocity.Y == 0.0) + { + if ((double) this.velocity.X == 0.0) + { + this.frame = 0; + this.frameCounter = 0; + } + else if ((double) this.velocity.X < -0.8 || (double) this.velocity.X > 0.8) + { + this.frameCounter += (int) Math.Abs(this.velocity.X); + ++this.frameCounter; + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame >= 3) + this.frame = 0; + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + } + else if ((double) this.velocity.Y < 0.0) + { + this.frameCounter = 0; + this.frame = 2; + } + else if ((double) this.velocity.Y > 0.0) + { + this.frameCounter = 0; + this.frame = 2; + } + this.velocity.Y += 0.4f; + if ((double) this.velocity.Y <= 10.0) + return; + this.velocity.Y = 10f; + } + else if (this.type == (int) sbyte.MaxValue) + { + if ((double) this.velocity.Y == 0.0) + { + if ((double) this.velocity.X == 0.0) + { + this.frame = 0; + this.frameCounter = 0; + } + else if ((double) this.velocity.X < -0.1 || (double) this.velocity.X > 0.1) + { + this.frameCounter += (int) Math.Abs(this.velocity.X); + ++this.frameCounter; + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame > 5) + this.frame = 0; + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + this.velocity.Y += 0.4f; + if ((double) this.velocity.Y <= 10.0) + return; + this.velocity.Y = 10f; + } + else if (this.type == 200) + { + if ((double) this.velocity.Y == 0.0) + { + if ((double) this.velocity.X == 0.0) + { + this.frame = 0; + this.frameCounter = 0; + } + else if ((double) this.velocity.X < -0.1 || (double) this.velocity.X > 0.1) + { + this.frameCounter += (int) Math.Abs(this.velocity.X); + ++this.frameCounter; + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame > 5) + this.frame = 0; + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + } + else + { + this.rotation = this.velocity.X * 0.1f; + ++this.frameCounter; + if ((double) this.velocity.Y < 0.0) + this.frameCounter += 2; + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame > 9) + this.frame = 6; + if (this.frame < 6) + this.frame = 6; + } + this.velocity.Y += 0.1f; + if ((double) this.velocity.Y <= 4.0) + return; + this.velocity.Y = 4f; + } + else if (this.type == 208) + { + if ((double) this.velocity.Y == 0.0 && (double) this.velocity.X == 0.0) + { + if ((double) Main.player[this.owner].position.X + (double) (Main.player[this.owner].width / 2) < (double) this.position.X + (double) (this.width / 2)) + this.direction = -1; + else if ((double) Main.player[this.owner].position.X + (double) (Main.player[this.owner].width / 2) > (double) this.position.X + (double) (this.width / 2)) + this.direction = 1; + this.rotation = 0.0f; + this.frame = 0; + } + else + { + this.rotation = this.velocity.X * 0.075f; + ++this.frameCounter; + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame > 4) + this.frame = 1; + if (this.frame < 1) + this.frame = 1; + } + this.velocity.Y += 0.1f; + if ((double) this.velocity.Y <= 4.0) + return; + this.velocity.Y = 4f; + } + else if (this.type == 209) + { + if (this.alpha > 0) + { + this.alpha -= 5; + if (this.alpha < 0) + this.alpha = 0; + } + if ((double) this.velocity.Y == 0.0) + { + if ((double) this.velocity.X == 0.0) + { + this.frame = 0; + this.frameCounter = 0; + } + else if ((double) this.velocity.X < -0.1 || (double) this.velocity.X > 0.1) + { + this.frameCounter += (int) Math.Abs(this.velocity.X); + ++this.frameCounter; + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame > 11) + this.frame = 2; + if (this.frame < 2) + this.frame = 2; + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + } + else + { + this.frame = 1; + this.frameCounter = 0; + this.rotation = 0.0f; + } + this.velocity.Y += 0.4f; + if ((double) this.velocity.Y <= 10.0) + return; + this.velocity.Y = 10f; + } + else if (this.type == 324) + { + if ((double) this.velocity.Y == 0.0) + { + if ((double) this.velocity.X < -0.1 || (double) this.velocity.X > 0.1) + { + this.frameCounter += (int) Math.Abs(this.velocity.X); + ++this.frameCounter; + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame > 5) + this.frame = 2; + if (this.frame < 2) + this.frame = 2; + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + } + else + { + this.frameCounter = 0; + this.frame = 1; + } + this.velocity.Y += 0.4f; + if ((double) this.velocity.Y <= 14.0) + return; + this.velocity.Y = 14f; + } + else if (this.type == 210) + { + if ((double) this.velocity.Y == 0.0) + { + if ((double) this.velocity.X < -0.1 || (double) this.velocity.X > 0.1) + { + this.frameCounter += (int) Math.Abs(this.velocity.X); + ++this.frameCounter; + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame > 6) + this.frame = 0; + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + } + else + { + this.rotation = this.velocity.X * 0.05f; + ++this.frameCounter; + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame > 11) + this.frame = 7; + if (this.frame < 7) + this.frame = 7; + } + this.velocity.Y += 0.4f; + if ((double) this.velocity.Y <= 10.0) + return; + this.velocity.Y = 10f; + } + else + { + if (this.type != 398) + return; + if ((double) this.velocity.Y == 0.0) + { + if ((double) this.velocity.X == 0.0) + { + this.frame = 0; + this.frameCounter = 0; + } + else if ((double) this.velocity.X < -0.8 || (double) this.velocity.X > 0.8) + { + this.frameCounter += (int) Math.Abs(this.velocity.X); + ++this.frameCounter; + if (this.frameCounter > 6) + { + ++this.frame; + this.frameCounter = 0; + } + if (this.frame >= 5) + this.frame = 0; + } + else + { + this.frame = 0; + this.frameCounter = 0; + } + } + else if ((double) this.velocity.Y != 0.0) + { + this.frameCounter = 0; + this.frame = 5; + } + this.velocity.Y += 0.4f; + if ((double) this.velocity.Y <= 10.0) + return; + this.velocity.Y = 10f; } } } } - if (this.type >= 736 && this.type <= 738) - { - if (this.frame == 0) - this.rotation -= 0.1f; - else if (this.frame == 1) - this.rotation += 0.1f; - else - this.rotation += 0.15f; - if ((double) this.velocity.Y <= 10.0) - return; - this.velocity.Y = 10f; - } - else - { - this.rotation += 0.1f; - if ((double) this.velocity.Y <= 10.0) - return; - this.velocity.Y = 10f; - } - } - - private void AI_026() - { - // ISSUE: unable to decompile the method. } private void AI_062() @@ -25795,7 +17586,7 @@ label_648: if (Main.rand.Next(3) == 0) ++this.ai[1]; } - if ((double) this.ai[1] > 90.0) + if ((double) this.ai[1] > (double) Main.rand.Next(180, 900)) { this.ai[1] = 0.0f; this.netUpdate = true; @@ -25936,10 +17727,10 @@ label_648: { if ((double) this.ai[1] != 0.0) return; - Vector2 vector2_20 = vector2_1 - this.Center; ++this.ai[1]; if (Main.myPlayer != this.owner) return; + Vector2 vector2_20 = vector2_1 - this.Center; vector2_20.Normalize(); Vector2 vector2_21 = vector2_20 * num21; int index = Projectile.NewProjectile(this.Center.X, this.Center.Y, vector2_21.X, vector2_21.Y, Type, this.damage, 0.0f, Main.myPlayer); @@ -25954,28 +17745,26 @@ label_648: Player player = Main.player[this.owner]; float num1 = 1.570796f; Vector2 vector2_1 = player.RotatedRelativePoint(player.MountedCenter); - int frames = 2; - float num2 = 0.0f; if (this.type == 439) { ++this.ai[0]; - int num3 = 0; + int num2 = 0; if ((double) this.ai[0] >= 40.0) - ++num3; + ++num2; if ((double) this.ai[0] >= 80.0) - ++num3; + ++num2; if ((double) this.ai[0] >= 120.0) - ++num3; - int num4 = 24; - int num5 = 6; + ++num2; + int num3 = 24; + int num4 = 6; ++this.ai[1]; bool flag = false; - if ((double) this.ai[1] >= (double) (num4 - num5 * num3)) + if ((double) this.ai[1] >= (double) (num3 - num4 * num2)) { this.ai[1] = 0.0f; flag = true; } - this.frameCounter += 1 + num3; + this.frameCounter += 1 + num2; if (this.frameCounter >= 4) { this.frameCounter = 0; @@ -25985,9 +17774,9 @@ label_648: } if (this.soundDelay <= 0) { - this.soundDelay = num4 - num5 * num3; + this.soundDelay = num3 - num4 * num2; if ((double) this.ai[0] != 1.0) - SoundEngine.PlaySound(SoundID.Item91, this.position); + Main.PlaySound(SoundID.Item91, this.position); } if ((double) this.ai[1] == 1.0 && (double) this.ai[0] != 1.0) { @@ -26004,7 +17793,7 @@ label_648: { if ((!player.channel || !player.CheckMana(player.inventory[player.selectedItem].mana, true) || player.noItems ? 0 : (!player.CCed ? 1 : 0)) != 0) { - float num6 = player.inventory[player.selectedItem].shootSpeed * this.scale; + float num5 = player.inventory[player.selectedItem].shootSpeed * this.scale; Vector2 vector2_3 = vector2_1; Vector2 vector2_4 = Main.screenPosition + new Vector2((float) Main.mouseX, (float) Main.mouseY) - vector2_3; if ((double) player.gravDir == -1.0) @@ -26012,17 +17801,17 @@ label_648: Vector2 vector2_5 = Vector2.Normalize(vector2_4); if (float.IsNaN(vector2_5.X) || float.IsNaN(vector2_5.Y)) vector2_5 = -Vector2.UnitY; - Vector2 vector2_6 = vector2_5 * num6; + Vector2 vector2_6 = vector2_5 * num5; if ((double) vector2_6.X != (double) this.velocity.X || (double) vector2_6.Y != (double) this.velocity.Y) this.netUpdate = true; this.velocity = vector2_6; int Type = 440; - float num7 = 14f; - int num8 = 7; + float num6 = 14f; + int num7 = 7; for (int index = 0; index < 2; ++index) { - Vector2 vector2_7 = this.Center + new Vector2((float) Main.rand.Next(-num8, num8 + 1), (float) Main.rand.Next(-num8, num8 + 1)); - Vector2 vector2_8 = (Vector2.Normalize(this.velocity) * num7).RotatedBy(Main.rand.NextDouble() * 0.196349546313286 - 0.0981747731566429); + Vector2 vector2_7 = this.Center + new Vector2((float) Main.rand.Next(-num7, num7 + 1), (float) Main.rand.Next(-num7, num7 + 1)); + Vector2 vector2_8 = (Vector2.Normalize(this.velocity) * num6).RotatedBy(Main.rand.NextDouble() * 0.196349546313286 - 0.0981747731566429); if (float.IsNaN(vector2_8.X) || float.IsNaN(vector2_8.Y)) vector2_8 = -Vector2.UnitY; Projectile.NewProjectile(vector2_7.X, vector2_7.Y, vector2_8.X, vector2_8.Y, Type, this.damage, this.knockBack, this.owner); @@ -26034,27 +17823,22 @@ label_648: } if (this.type == 445) { - if (this.soundDelay <= 0) - { - SoundEngine.PlaySound(SoundID.Item132, this.position); - this.soundDelay = 23; - } ++this.localAI[0]; if ((double) this.localAI[0] >= 60.0) this.localAI[0] = 0.0f; if ((double) Vector2.Distance(vector2_1, this.Center) >= 5.0) { - float num9 = this.localAI[0] / 60f; - if ((double) num9 > 0.5) - num9 = 1f - num9; - Vector3 vector3 = Vector3.Lerp(new Vector3(0.0f, 1f, 0.7f), new Vector3(0.0f, 0.7f, 1f), (float) (1.0 - (double) num9 * 2.0)) * 0.5f; + float num8 = this.localAI[0] / 60f; + if ((double) num8 > 0.5) + num8 = 1f - num8; + Vector3 vector3 = Vector3.Lerp(new Vector3(0.0f, 1f, 0.7f), new Vector3(0.0f, 0.7f, 1f), (float) (1.0 - (double) num8 * 2.0)) * 0.5f; if ((double) Vector2.Distance(vector2_1, this.Center) >= 30.0) { Vector2 vector2_9 = this.Center - vector2_1; vector2_9.Normalize(); Vector2 vector2_10 = vector2_9 * (Vector2.Distance(vector2_1, this.Center) - 30f); DelegateMethods.v3_1 = vector3 * 0.8f; - Utils.PlotTileLine(this.Center - vector2_10, this.Center, 8f, new Utils.TileActionAttempt(DelegateMethods.CastLightOpen)); + Utils.PlotTileLine(this.Center - vector2_10, this.Center, 8f, new Utils.PerLinePoint(DelegateMethods.CastLightOpen)); } Lighting.AddLight((int) this.Center.X / 16, (int) this.Center.Y / 16, vector3.X, vector3.Y, vector3.Z); } @@ -26078,37 +17862,37 @@ label_648: Vector2 vector2_13 = Vector2.Lerp(vector2_12, this.velocity, 0.7f); if (float.IsNaN(vector2_13.X) || float.IsNaN(vector2_13.Y)) vector2_13 = -Vector2.UnitY; - float num10 = 30f; - if ((double) vector2_13.Length() < (double) num10) - vector2_13 = Vector2.Normalize(vector2_13) * num10; + float num9 = 30f; + if ((double) vector2_13.Length() < (double) num9) + vector2_13 = Vector2.Normalize(vector2_13) * num9; int tileBoost = player.inventory[player.selectedItem].tileBoost; - int num11 = -Player.tileRangeX - tileBoost + 1; - int num12 = Player.tileRangeX + tileBoost - 1; - int num13 = -Player.tileRangeY - tileBoost; - int num14 = Player.tileRangeY + tileBoost - 1; - int num15 = 12; + int num10 = -Player.tileRangeX - tileBoost + 1; + int num11 = Player.tileRangeX + tileBoost - 1; + int num12 = -Player.tileRangeY - tileBoost; + int num13 = Player.tileRangeY + tileBoost - 1; + int num14 = 12; bool flag = false; - if ((double) vector2_13.X < (double) (num11 * 16 - num15)) + if ((double) vector2_13.X < (double) (num10 * 16 - num14)) flag = true; - if ((double) vector2_13.Y < (double) (num13 * 16 - num15)) + if ((double) vector2_13.Y < (double) (num12 * 16 - num14)) flag = true; - if ((double) vector2_13.X > (double) (num12 * 16 + num15)) + if ((double) vector2_13.X > (double) (num11 * 16 + num14)) flag = true; - if ((double) vector2_13.Y > (double) (num14 * 16 + num15)) + if ((double) vector2_13.Y > (double) (num13 * 16 + num14)) flag = true; if (flag) { Vector2 vector2_14 = Vector2.Normalize(vector2_13); - float num16 = -1f; - if ((double) vector2_14.X < 0.0 && ((double) (num11 * 16 - num15) / (double) vector2_14.X < (double) num16 || (double) num16 == -1.0)) - num16 = (float) (num11 * 16 - num15) / vector2_14.X; - if ((double) vector2_14.X > 0.0 && ((double) (num12 * 16 + num15) / (double) vector2_14.X < (double) num16 || (double) num16 == -1.0)) - num16 = (float) (num12 * 16 + num15) / vector2_14.X; - if ((double) vector2_14.Y < 0.0 && ((double) (num13 * 16 - num15) / (double) vector2_14.Y < (double) num16 || (double) num16 == -1.0)) - num16 = (float) (num13 * 16 - num15) / vector2_14.Y; - if ((double) vector2_14.Y > 0.0 && ((double) (num14 * 16 + num15) / (double) vector2_14.Y < (double) num16 || (double) num16 == -1.0)) - num16 = (float) (num14 * 16 + num15) / vector2_14.Y; - vector2_13 = vector2_14 * num16; + float num15 = -1f; + if ((double) vector2_14.X < 0.0 && ((double) (num10 * 16 - num14) / (double) vector2_14.X < (double) num15 || (double) num15 == -1.0)) + num15 = (float) (num10 * 16 - num14) / vector2_14.X; + if ((double) vector2_14.X > 0.0 && ((double) (num11 * 16 + num14) / (double) vector2_14.X < (double) num15 || (double) num15 == -1.0)) + num15 = (float) (num11 * 16 + num14) / vector2_14.X; + if ((double) vector2_14.Y < 0.0 && ((double) (num12 * 16 - num14) / (double) vector2_14.Y < (double) num15 || (double) num15 == -1.0)) + num15 = (float) (num12 * 16 - num14) / vector2_14.Y; + if ((double) vector2_14.Y > 0.0 && ((double) (num13 * 16 + num14) / (double) vector2_14.Y < (double) num15 || (double) num15 == -1.0)) + num15 = (float) (num13 * 16 + num14) / vector2_14.Y; + vector2_13 = vector2_14 * num15; } if ((double) vector2_13.X != (double) this.velocity.X || (double) vector2_13.Y != (double) this.velocity.Y) this.netUpdate = true; @@ -26119,31 +17903,28 @@ label_648: if (this.type == 460) { ++this.ai[0]; - int num17 = 0; - if ((double) this.ai[0] >= 80.0) - ++num17; + int num16 = 0; + if ((double) this.ai[0] >= 60.0) + ++num16; if ((double) this.ai[0] >= 180.0) - ++num17; + ++num16; bool flag1 = false; - double num18 = (double) this.ai[0]; - if ((double) this.ai[0] == 80.0 || (double) this.ai[0] == 180.0 || (double) this.ai[0] > 180.0 && (double) this.ai[0] % 20.0 == 0.0) + if ((double) this.ai[0] == 60.0 || (double) this.ai[0] == 180.0 || (double) this.ai[0] > 180.0 && (double) this.ai[0] % 20.0 == 0.0) flag1 = true; bool flag2 = (double) this.ai[0] >= 180.0; - int num19 = 5; + int num17 = 10; if (!flag2) ++this.ai[1]; bool flag3 = false; - if ((double) this.ai[0] == 1.0) - flag3 = true; if (flag2 && (double) this.ai[0] % 20.0 == 0.0) flag3 = true; - if ((double) this.ai[1] >= (double) num19 && !flag2) + if ((double) this.ai[1] >= (double) num17 && !flag2) { this.ai[1] = 0.0f; flag3 = true; if (!flag2) { - float num20 = player.inventory[player.selectedItem].shootSpeed * this.scale; + float num18 = player.inventory[player.selectedItem].shootSpeed * this.scale; Vector2 vector2_15 = vector2_1; Vector2 vector2_16 = Main.screenPosition + new Vector2((float) Main.mouseX, (float) Main.mouseY) - vector2_15; if ((double) player.gravDir == -1.0) @@ -26151,7 +17932,7 @@ label_648: Vector2 vector2_17 = Vector2.Normalize(vector2_16); if (float.IsNaN(vector2_17.X) || float.IsNaN(vector2_17.Y)) vector2_17 = -Vector2.UnitY; - Vector2 vector2_18 = vector2_17 * num20; + Vector2 vector2_18 = vector2_17 * num18; if ((double) vector2_18.X != (double) this.velocity.X || (double) vector2_18.Y != (double) this.velocity.Y) this.netUpdate = true; this.velocity = vector2_18; @@ -26159,54 +17940,31 @@ label_648: } if (this.soundDelay <= 0 && !flag2) { - this.soundDelay = num19 - num17; + this.soundDelay = num17 - num16; this.soundDelay *= 2; if ((double) this.ai[0] != 1.0) - SoundEngine.PlaySound(SoundID.Item15, this.position); + Main.PlaySound(SoundID.Item15, this.position); } if ((double) this.ai[0] > 10.0 && !flag2) { Vector2 vector2_19 = this.Center + (Vector2.UnitX * 18f).RotatedBy((double) this.rotation - 1.57079637050629); - for (int index3 = 0; index3 < num17 + 1; ++index3) + for (int index3 = 0; index3 < num16 + 1; ++index3) { int Type = 226; - float num21 = 0.4f; + float num19 = 0.4f; if (index3 % 2 == 1) { Type = 226; - num21 = 0.65f; + num19 = 0.65f; } - Vector2 vector2_20 = vector2_19 + ((float) Main.rand.NextDouble() * 6.283185f).ToRotationVector2() * (12f - (float) (num17 * 2)); + Vector2 vector2_20 = vector2_19 + ((float) Main.rand.NextDouble() * 6.283185f).ToRotationVector2() * (12f - (float) (num16 * 2)); int index4 = Dust.NewDust(vector2_20 - Vector2.One * 8f, 16, 16, Type, this.velocity.X / 2f, this.velocity.Y / 2f); - Main.dust[index4].velocity = Vector2.Normalize(vector2_19 - vector2_20) * 1.5f * (float) (10.0 - (double) num17 * 2.0) / 10f; + Main.dust[index4].velocity = Vector2.Normalize(vector2_19 - vector2_20) * 1.5f * (float) (10.0 - (double) num16 * 2.0) / 10f; Main.dust[index4].noGravity = true; - Main.dust[index4].scale = num21; + Main.dust[index4].scale = num19; Main.dust[index4].customData = (object) player; } } - if (flag2) - { - Vector2 vector2_21 = this.Center + (Vector2.UnitX * 14f).RotatedBy((double) this.rotation - 1.57079637050629); - for (int index5 = 0; index5 < 2; ++index5) - { - int Type = 226; - float num22 = 0.35f; - if (index5 % 2 == 1) - { - Type = 226; - num22 = 0.45f; - } - float num23 = Main.rand.NextFloatDirection(); - Vector2 vector2_22 = vector2_21 + ((float) ((double) this.rotation + (double) num23 * 0.785398185253143 * 0.800000011920929 - 1.57079637050629)).ToRotationVector2() * 6f; - int num24 = 24; - int index6 = Dust.NewDust(vector2_22 - Vector2.One * (float) (num24 / 2), num24, num24, Type, this.velocity.X / 2f, this.velocity.Y / 2f); - Main.dust[index6].velocity = (vector2_22 - vector2_21).SafeNormalize(Vector2.Zero) * MathHelper.Lerp(1.5f, 9f, Utils.GetLerpValue(1f, 0.0f, Math.Abs(num23), true)); - Main.dust[index6].noGravity = true; - Main.dust[index6].scale = num22; - Main.dust[index6].customData = (object) player; - Main.dust[index6].fadeIn = 0.5f; - } - } if (flag3 && Main.myPlayer == this.owner) { bool flag4 = !flag1 || player.CheckMana(player.inventory[player.selectedItem].mana, true); @@ -26215,11 +17973,11 @@ label_648: if ((double) this.ai[0] == 180.0) { Vector2 center = this.Center; - Vector2 vector2_23 = Vector2.Normalize(this.velocity); - if (float.IsNaN(vector2_23.X) || float.IsNaN(vector2_23.Y)) - vector2_23 = -Vector2.UnitY; - int Damage = (int) ((double) this.damage * 1.5); - this.ai[1] = (float) Projectile.NewProjectile(center.X, center.Y, vector2_23.X, vector2_23.Y, 461, Damage, this.knockBack, this.owner, ai1: ((float) this.whoAmI)); + Vector2 vector2_21 = Vector2.Normalize(this.velocity); + if (float.IsNaN(vector2_21.X) || float.IsNaN(vector2_21.Y)) + vector2_21 = -Vector2.UnitY; + int Damage = (int) ((double) this.damage * 3.0); + this.ai[1] = (float) Projectile.NewProjectile(center.X, center.Y, vector2_21.X, vector2_21.Y, 461, Damage, this.knockBack, this.owner, ai1: ((float) this.whoAmI)); this.netUpdate = true; } else if (flag2) @@ -26231,68 +17989,60 @@ label_648: return; } } - else - { - bool flag5 = false; - if ((double) this.ai[0] == 1.0) - flag5 = true; - if ((double) this.ai[0] <= 50.0 && (double) this.ai[0] % 10.0 == 0.0) - flag5 = true; - if ((double) this.ai[0] >= 80.0 && (double) this.ai[0] < 180.0 && (double) this.ai[0] % 30.0 == 0.0) - flag5 = true; - if (flag5) - { - int Type = 459; - float num25 = 10f; - Vector2 center = this.Center; - Vector2 vector2_24 = Vector2.Normalize(this.velocity) * num25; - if (float.IsNaN(vector2_24.X) || float.IsNaN(vector2_24.Y)) - vector2_24 = -Vector2.UnitY; - float ai1 = (float) (0.699999988079071 + (double) num17 * 0.300000011920929); - int Damage = (double) ai1 < 1.0 ? this.damage : (int) ((double) this.damage * 2.5); - Projectile.NewProjectile(center.X, center.Y, vector2_24.X, vector2_24.Y, Type, Damage, this.knockBack, this.owner, ai1: ai1); - } - } } else + { + if (!flag2) + { + int Type = 459; + float num20 = 10f; + Vector2 center = this.Center; + Vector2 vector2_22 = Vector2.Normalize(this.velocity) * num20; + if (float.IsNaN(vector2_22.X) || float.IsNaN(vector2_22.Y)) + vector2_22 = -Vector2.UnitY; + float ai1 = (float) (0.699999988079071 + (double) num16 * 0.300000011920929); + int Damage = (double) ai1 < 1.0 ? this.damage : (int) ((double) this.damage * 2.0); + Projectile.NewProjectile(center.X, center.Y, vector2_22.X, vector2_22.Y, Type, Damage, this.knockBack, this.owner, ai1: ai1); + } this.Kill(); + } } } if (this.type == 633) { - float num26 = 30f; + float num21 = 30f; if ((double) this.ai[0] > 90.0) - num26 = 15f; + num21 = 15f; if ((double) this.ai[0] > 120.0) - num26 = 5f; + num21 = 5f; this.damage = (int) ((double) player.inventory[player.selectedItem].damage * (double) player.magicDamage); ++this.ai[0]; ++this.ai[1]; + bool flag5 = false; + if ((double) this.ai[0] % (double) num21 == 0.0) + flag5 = true; + int num22 = 10; bool flag6 = false; - if ((double) this.ai[0] % (double) num26 == 0.0) + if ((double) this.ai[0] % (double) num21 == 0.0) flag6 = true; - int num27 = 10; - bool flag7 = false; - if ((double) this.ai[0] % (double) num26 == 0.0) - flag7 = true; if ((double) this.ai[1] >= 1.0) { this.ai[1] = 0.0f; - flag7 = true; + flag6 = true; if (Main.myPlayer == this.owner) { - float num28 = player.inventory[player.selectedItem].shootSpeed * this.scale; - Vector2 vector2_25 = vector2_1; - Vector2 vector2_26 = Main.screenPosition + new Vector2((float) Main.mouseX, (float) Main.mouseY) - vector2_25; + float num23 = player.inventory[player.selectedItem].shootSpeed * this.scale; + Vector2 vector2_23 = vector2_1; + Vector2 vector2_24 = Main.screenPosition + new Vector2((float) Main.mouseX, (float) Main.mouseY) - vector2_23; if ((double) player.gravDir == -1.0) - vector2_26.Y = (float) (Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - vector2_25.Y; - Vector2 vector2_27 = Vector2.Normalize(vector2_26); - if (float.IsNaN(vector2_27.X) || float.IsNaN(vector2_27.Y)) - vector2_27 = -Vector2.UnitY; - Vector2 vector2_28 = Vector2.Normalize(Vector2.Lerp(vector2_27, Vector2.Normalize(this.velocity), 0.92f)) * num28; - if ((double) vector2_28.X != (double) this.velocity.X || (double) vector2_28.Y != (double) this.velocity.Y) + vector2_24.Y = (float) (Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - vector2_23.Y; + Vector2 vector2_25 = Vector2.Normalize(vector2_24); + if (float.IsNaN(vector2_25.X) || float.IsNaN(vector2_25.Y)) + vector2_25 = -Vector2.UnitY; + Vector2 vector2_26 = Vector2.Normalize(Vector2.Lerp(vector2_25, Vector2.Normalize(this.velocity), 0.92f)) * num23; + if ((double) vector2_26.X != (double) this.velocity.X || (double) vector2_26.Y != (double) this.velocity.Y) this.netUpdate = true; - this.velocity = vector2_28; + this.velocity = vector2_26; } } ++this.frameCounter; @@ -26304,25 +18054,25 @@ label_648: } if (this.soundDelay <= 0) { - this.soundDelay = num27; + this.soundDelay = num22; this.soundDelay *= 2; if ((double) this.ai[0] != 1.0) - SoundEngine.PlaySound(SoundID.Item15, this.position); + Main.PlaySound(SoundID.Item15, this.position); } - if (flag7 && Main.myPlayer == this.owner) + if (flag6 && Main.myPlayer == this.owner) { - bool flag8 = !flag6 || player.CheckMana(player.inventory[player.selectedItem].mana, true); - if ((!(player.channel & flag8) || player.noItems ? 0 : (!player.CCed ? 1 : 0)) != 0) + bool flag7 = !flag5 || player.CheckMana(player.inventory[player.selectedItem].mana, true); + if ((!(player.channel & flag7) || player.noItems ? 0 : (!player.CCed ? 1 : 0)) != 0) { if ((double) this.ai[0] == 1.0) { Vector2 center = this.Center; - Vector2 vector2_29 = Vector2.Normalize(this.velocity); - if (float.IsNaN(vector2_29.X) || float.IsNaN(vector2_29.Y)) - vector2_29 = -Vector2.UnitY; + Vector2 vector2_27 = Vector2.Normalize(this.velocity); + if (float.IsNaN(vector2_27.X) || float.IsNaN(vector2_27.Y)) + vector2_27 = -Vector2.UnitY; int damage = this.damage; for (int index = 0; index < 6; ++index) - Projectile.NewProjectile(center.X, center.Y, vector2_29.X, vector2_29.Y, 632, damage, this.knockBack, this.owner, (float) index, (float) this.whoAmI); + Projectile.NewProjectile(center.X, center.Y, vector2_27.X, vector2_27.Y, 632, damage, this.knockBack, this.owner, (float) index, (float) this.whoAmI); this.netUpdate = true; } } @@ -26340,21 +18090,21 @@ label_648: --this.soundDelay; if (this.soundDelay <= 0) { - SoundEngine.PlaySound(SoundID.Item1, this.Center); + Main.PlaySound(SoundID.Item1, this.Center); this.soundDelay = 12; } if (Main.myPlayer == this.owner) { if (player.channel && !player.noItems && !player.CCed) { - float num29 = 1f; + float num24 = 1f; if (player.inventory[player.selectedItem].shoot == this.type) - num29 = player.inventory[player.selectedItem].shootSpeed * this.scale; + num24 = player.inventory[player.selectedItem].shootSpeed * this.scale; Vector2 vec = Main.MouseWorld - vector2_1; vec.Normalize(); if (vec.HasNaNs()) vec = Vector2.UnitX * (float) player.direction; - vec *= num29; + vec *= num24; if ((double) vec.X != (double) this.velocity.X || (double) vec.Y != (double) this.velocity.Y) this.netUpdate = true; this.velocity = vec; @@ -26371,116 +18121,43 @@ label_648: Main.dust[index].position -= this.velocity; } } - if (this.type == 735) - { - num1 = 0.0f; - if (this.spriteDirection == -1) - num1 = 3.141593f; - if (++this.frame >= Main.projFrames[this.type]) - this.frame = 0; - --this.soundDelay; - if (this.soundDelay <= 0) - { - SoundEngine.PlaySound(SoundID.Item1, this.Center); - this.soundDelay = 12; - } - if (Main.myPlayer == this.owner) - { - if (player.channel && !player.noItems && !player.CCed) - { - float num30 = 1f; - if (player.inventory[player.selectedItem].shoot == this.type) - num30 = player.inventory[player.selectedItem].shootSpeed * this.scale; - Vector2 vec = Main.MouseWorld - vector2_1; - vec.Normalize(); - if (vec.HasNaNs()) - vec = Vector2.UnitX * (float) player.direction; - vec *= num30; - if ((double) vec.X != (double) this.velocity.X || (double) vec.Y != (double) this.velocity.Y) - this.netUpdate = true; - this.velocity = vec; - } - else - this.Kill(); - } - Vector2 position = this.Center + this.velocity * 3f; - Lighting.AddLight(position, 0.8f, 0.8f, 0.8f); - if (Main.rand.Next(3) == 0) - { - int index = Dust.NewDust(position - this.Size / 2f, this.width, this.height, 302, this.velocity.X, this.velocity.Y, 100, Scale: 2f); - Main.dust[index].noGravity = true; - Main.dust[index].position -= this.velocity; - } - } - if (this.type == 927) - { - num1 = 0.0f; - ++this.ai[0]; - if ((double) this.ai[0] >= 8.0) - this.ai[0] = 0.0f; - frames = 9; - num2 = (float) ((double) Main.rand.NextFloatDirection() * 6.28318548202515 * 0.0500000007450581); - --this.soundDelay; - if (this.soundDelay <= 0) - { - SoundEngine.PlaySound(SoundID.Item1, this.Center); - this.soundDelay = 6; - } - if (Main.myPlayer == this.owner) - { - if (player.channel && !player.noItems && !player.CCed) - { - float num31 = 1f; - if (player.inventory[player.selectedItem].shoot == this.type) - num31 = player.inventory[player.selectedItem].shootSpeed * this.scale; - Vector2 vec = Main.MouseWorld - vector2_1; - vec.Normalize(); - if (vec.HasNaNs()) - vec = Vector2.UnitX * (float) player.direction; - vec *= num31; - if ((double) vec.X != (double) this.velocity.X || (double) vec.Y != (double) this.velocity.Y) - this.netUpdate = true; - this.velocity = vec; - } - else - this.Kill(); - } - DelegateMethods.v3_1 = new Vector3(0.5f, 0.5f, 0.5f); - Utils.PlotTileLine(this.Center - this.velocity, this.Center + this.velocity.SafeNormalize(Vector2.Zero) * 80f, 16f, new Utils.TileActionAttempt(DelegateMethods.CastLightOpen)); - } if (this.type == 600) { - double num32 = (double) this.ai[0]; + if ((double) this.ai[0] == 0.0) + { + if ((double) this.ai[1] != 0.0) + Main.PlaySound(SoundID.Item114, this.position); + else + Main.PlaySound(SoundID.Item115, this.position); + } ++this.ai[0]; if (Main.myPlayer == this.owner && (double) this.ai[0] == 1.0) { - float num33 = player.inventory[player.selectedItem].shootSpeed * this.scale; - Vector2 vector2_30 = vector2_1; - Vector2 vector2_31 = Main.screenPosition + new Vector2((float) Main.mouseX, (float) Main.mouseY) - vector2_30; + float num25 = player.inventory[player.selectedItem].shootSpeed * this.scale; + Vector2 vector2_28 = vector2_1; + Vector2 vector2_29 = Main.screenPosition + new Vector2((float) Main.mouseX, (float) Main.mouseY) - vector2_28; if ((double) player.gravDir == -1.0) - vector2_31.Y = (float) (Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - vector2_30.Y; - Vector2 vector2_32 = Vector2.Normalize(vector2_31); + vector2_29.Y = (float) (Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - vector2_28.Y; + Vector2 vector2_30 = Vector2.Normalize(vector2_29); + if (float.IsNaN(vector2_30.X) || float.IsNaN(vector2_30.Y)) + vector2_30 = -Vector2.UnitY; + Vector2 vector2_31 = vector2_30 * num25; + if ((double) vector2_31.X != (double) this.velocity.X || (double) vector2_31.Y != (double) this.velocity.Y) + this.netUpdate = true; + this.velocity = vector2_31; + int Type = 601; + float num26 = 3f; + Vector2 center = this.Center; + Vector2 vector2_32 = Vector2.Normalize(this.velocity) * num26; if (float.IsNaN(vector2_32.X) || float.IsNaN(vector2_32.Y)) vector2_32 = -Vector2.UnitY; - Vector2 vector2_33 = vector2_32 * num33; - if ((double) vector2_33.X != (double) this.velocity.X || (double) vector2_33.Y != (double) this.velocity.Y) - this.netUpdate = true; - this.velocity = vector2_33; - int Type = 601; - float num34 = 3f; - Vector2 center = this.Center; - Vector2 vector2_34 = Vector2.Normalize(this.velocity) * num34; - if (float.IsNaN(vector2_34.X) || float.IsNaN(vector2_34.Y)) - vector2_34 = -Vector2.UnitY; - Projectile.NewProjectile(center.X, center.Y, vector2_34.X, vector2_34.Y, Type, this.damage, this.knockBack, this.owner, this.ai[1]); + Projectile.NewProjectile(center.X, center.Y, vector2_32.X, vector2_32.Y, Type, this.damage, this.knockBack, this.owner, this.ai[1]); } if ((double) this.ai[0] >= 30.0) this.Kill(); } if (this.type == 611) { - if (Main.netMode != 2 && (double) this.localAI[0] == 0.0) - SoundEngine.PlaySound(SoundID.Item116, this.Center); if ((double) this.localAI[1] > 0.0) --this.localAI[1]; this.alpha -= 42; @@ -26488,17 +18165,17 @@ label_648: this.alpha = 0; if ((double) this.localAI[0] == 0.0) this.localAI[0] = this.velocity.ToRotation(); - float num35 = (double) this.localAI[0].ToRotationVector2().X >= 0.0 ? 1f : -1f; + float num27 = (double) this.localAI[0].ToRotationVector2().X >= 0.0 ? 1f : -1f; if ((double) this.ai[1] <= 0.0) - num35 *= -1f; - Vector2 rotationVector2 = (num35 * (float) ((double) this.ai[0] / 30.0 * 6.28318548202515 - 1.57079637050629)).ToRotationVector2(); + num27 *= -1f; + Vector2 rotationVector2 = (num27 * (float) ((double) this.ai[0] / 30.0 * 6.28318548202515 - 1.57079637050629)).ToRotationVector2(); rotationVector2.Y *= (float) Math.Sin((double) this.ai[1]); if ((double) this.ai[1] <= 0.0) rotationVector2.Y *= -1f; - Vector2 vector2_35 = rotationVector2.RotatedBy((double) this.localAI[0]); + Vector2 vector2_33 = rotationVector2.RotatedBy((double) this.localAI[0]); ++this.ai[0]; if ((double) this.ai[0] < 30.0) - this.velocity = this.velocity + 48f * vector2_35; + this.velocity = this.velocity + 48f * vector2_33; else this.Kill(); } @@ -26508,26 +18185,26 @@ label_648: if (this.spriteDirection == -1) num1 = 3.141593f; ++this.ai[0]; - int num36 = 0; + int num28 = 0; if ((double) this.ai[0] >= 40.0) - ++num36; + ++num28; if ((double) this.ai[0] >= 80.0) - ++num36; + ++num28; if ((double) this.ai[0] >= 120.0) - ++num36; - int num37 = 5; - int num38 = 0; + ++num28; + int num29 = 5; + int num30 = 0; --this.ai[1]; bool flag = false; - int num39 = -1; + int num31 = -1; if ((double) this.ai[1] <= 0.0) { - this.ai[1] = (float) (num37 - num38 * num36); + this.ai[1] = (float) (num29 - num30 * num28); flag = true; - if ((int) this.ai[0] / (num37 - num38 * num36) % 7 == 0) - num39 = 0; + if ((int) this.ai[0] / (num29 - num30 * num28) % 7 == 0) + num31 = 0; } - this.frameCounter += 1 + num36; + this.frameCounter += 1 + num28; if (this.frameCounter >= 4) { this.frameCounter = 0; @@ -26537,50 +18214,50 @@ label_648: } if (this.soundDelay <= 0) { - this.soundDelay = num37 - num38 * num36; + this.soundDelay = num29 - num30 * num28; if ((double) this.ai[0] != 1.0) - SoundEngine.PlaySound(SoundID.Item36, this.position); + Main.PlaySound(SoundID.Item36, this.position); } if (flag && Main.myPlayer == this.owner) { bool canShoot = player.channel && player.HasAmmo(player.inventory[player.selectedItem], true) && !player.noItems && !player.CCed; - int projToShoot = 14; + int shoot = 14; float speed = 14f; int weaponDamage = player.GetWeaponDamage(player.inventory[player.selectedItem]); float knockBack = player.inventory[player.selectedItem].knockBack; if (canShoot) { - player.PickAmmo(player.inventory[player.selectedItem], ref projToShoot, ref speed, ref canShoot, ref weaponDamage, ref knockBack); + player.PickAmmo(player.inventory[player.selectedItem], ref shoot, ref speed, ref canShoot, ref weaponDamage, ref knockBack); float weaponKnockback = player.GetWeaponKnockback(player.inventory[player.selectedItem], knockBack); - float num40 = player.inventory[player.selectedItem].shootSpeed * this.scale; - Vector2 vector2_36 = vector2_1; - Vector2 vector2_37 = Main.screenPosition + new Vector2((float) Main.mouseX, (float) Main.mouseY) - vector2_36; + float num32 = player.inventory[player.selectedItem].shootSpeed * this.scale; + Vector2 vector2_34 = vector2_1; + Vector2 vector2_35 = Main.screenPosition + new Vector2((float) Main.mouseX, (float) Main.mouseY) - vector2_34; if ((double) player.gravDir == -1.0) - vector2_37.Y = (float) (Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - vector2_36.Y; - Vector2 vector2_38 = Vector2.Normalize(vector2_37); - if (float.IsNaN(vector2_38.X) || float.IsNaN(vector2_38.Y)) - vector2_38 = -Vector2.UnitY; - Vector2 vector2_39 = (vector2_38 * num40).RotatedBy(Main.rand.NextDouble() * 0.130899697542191 - 0.0654498487710953); - if ((double) vector2_39.X != (double) this.velocity.X || (double) vector2_39.Y != (double) this.velocity.Y) + vector2_35.Y = (float) (Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - vector2_34.Y; + Vector2 vector2_36 = Vector2.Normalize(vector2_35); + if (float.IsNaN(vector2_36.X) || float.IsNaN(vector2_36.Y)) + vector2_36 = -Vector2.UnitY; + Vector2 vector2_37 = (vector2_36 * num32).RotatedBy(Main.rand.NextDouble() * 0.130899697542191 - 0.0654498487710953); + if ((double) vector2_37.X != (double) this.velocity.X || (double) vector2_37.Y != (double) this.velocity.Y) this.netUpdate = true; - this.velocity = vector2_39; + this.velocity = vector2_37; for (int index = 0; index < 1; ++index) { - Vector2 vector2_40 = (Vector2.Normalize(this.velocity) * speed).RotatedBy(Main.rand.NextDouble() * 0.196349546313286 - 0.0981747731566429); - if (float.IsNaN(vector2_40.X) || float.IsNaN(vector2_40.Y)) - vector2_40 = -Vector2.UnitY; - Projectile.NewProjectile(vector2_36.X, vector2_36.Y, vector2_40.X, vector2_40.Y, projToShoot, weaponDamage, weaponKnockback, this.owner); + Vector2 vector2_38 = (Vector2.Normalize(this.velocity) * speed).RotatedBy(Main.rand.NextDouble() * 0.196349546313286 - 0.0981747731566429); + if (float.IsNaN(vector2_38.X) || float.IsNaN(vector2_38.Y)) + vector2_38 = -Vector2.UnitY; + Projectile.NewProjectile(vector2_34.X, vector2_34.Y, vector2_38.X, vector2_38.Y, shoot, weaponDamage, weaponKnockback, this.owner); } - if (num39 == 0) + if (num31 == 0) { - projToShoot = 616; - float num41 = 8f; + shoot = 616; + float num33 = 8f; for (int index = 0; index < 1; ++index) { - Vector2 vector2_41 = (Vector2.Normalize(this.velocity) * num41).RotatedBy(Main.rand.NextDouble() * 0.392699092626572 - 0.196349546313286); - if (float.IsNaN(vector2_41.X) || float.IsNaN(vector2_41.Y)) - vector2_41 = -Vector2.UnitY; - Projectile.NewProjectile(vector2_36.X, vector2_36.Y, vector2_41.X, vector2_41.Y, projToShoot, weaponDamage + 20, weaponKnockback * 1.25f, this.owner); + Vector2 vector2_39 = (Vector2.Normalize(this.velocity) * num33).RotatedBy(Main.rand.NextDouble() * 0.392699092626572 - 0.196349546313286); + if (float.IsNaN(vector2_39.X) || float.IsNaN(vector2_39.Y)) + vector2_39 = -Vector2.UnitY; + Projectile.NewProjectile(vector2_34.X, vector2_34.Y, vector2_39.X, vector2_39.Y, shoot, weaponDamage + 20, weaponKnockback * 1.25f, this.owner); } } } @@ -26588,205 +18265,70 @@ label_648: this.Kill(); } } - if (this.type == 714) - { - num1 = 0.0f; - if (this.spriteDirection == -1) - num1 = 3.141593f; - ++this.ai[0]; - int num42 = 0; - int num43 = 8; - int num44 = 0; - --this.ai[1]; - bool flag = false; - int num45 = -1; - if ((double) this.ai[1] <= 0.0) - { - this.ai[1] = (float) (num43 - num44 * num42); - flag = true; - int num46 = (int) this.ai[0] / (num43 - num44 * num42); - if (num46 % 7 == 0) - ; - num45 = num46 % 7; - } - double rotation = (double) this.rotation; - Vector2 center = this.Center; - int direction = this.direction; - Vector2 velocity = this.velocity; - this.frameCounter += 1 + num42; - if (this.frameCounter >= 4) - { - this.frameCounter = 0; - ++this.frame; - if (this.frame >= Main.projFrames[this.type]) - this.frame = 0; - } - if (this.soundDelay <= 0 && Main.player[this.owner].controlUseItem) - { - this.soundDelay = num43 - num44 * num42; - if ((double) this.ai[0] != 1.0) - SoundEngine.PlaySound(SoundID.Item156, this.position); - } - if (flag && Main.myPlayer == this.owner) - { - bool canShoot = player.channel && player.HasAmmo(player.inventory[player.selectedItem], true) && !player.noItems && !player.CCed; - int projToShoot = 134; - float speed = 8f; - int weaponDamage = player.GetWeaponDamage(player.inventory[player.selectedItem]); - float knockBack = player.inventory[player.selectedItem].knockBack; - if (num45 == 3) - ++speed; - if (canShoot) - { - player.PickAmmo(player.inventory[player.selectedItem], ref projToShoot, ref speed, ref canShoot, ref weaponDamage, ref knockBack); - float weaponKnockback = player.GetWeaponKnockback(player.inventory[player.selectedItem], knockBack); - float num47 = player.inventory[player.selectedItem].shootSpeed * this.scale; - Vector2 vector2_42 = vector2_1; - Vector2 vector2_43 = Main.screenPosition + new Vector2((float) Main.mouseX, (float) Main.mouseY) - vector2_42; - if ((double) player.gravDir == -1.0) - vector2_43.Y = (float) (Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - vector2_42.Y; - Vector2 vector2_44 = Vector2.Normalize(vector2_43); - if (float.IsNaN(vector2_44.X) || float.IsNaN(vector2_44.Y)) - vector2_44 = -Vector2.UnitY; - Vector2 vector2_45 = (vector2_44 * num47).RotatedBy((Main.rand.NextDouble() * 0.130899697542191 - 0.0654498487710953) * 0.5); - if ((double) vector2_45.X != (double) this.velocity.X || (double) vector2_45.Y != (double) this.velocity.Y) - this.netUpdate = true; - this.velocity = vector2_45; - for (int index = 0; index < 1; ++index) - { - Vector2 spinningpoint = (Vector2.Normalize(this.velocity) * speed).RotatedBy(Main.rand.NextDouble() * 0.196349546313286 - 0.0981747731566429); - if (float.IsNaN(spinningpoint.X) || float.IsNaN(spinningpoint.Y)) - spinningpoint = -Vector2.UnitY; - Projectile.NewProjectile(vector2_42.X, vector2_42.Y, spinningpoint.X, spinningpoint.Y, projToShoot, weaponDamage, weaponKnockback, this.owner, (float) num45); - if (num45 == 5) - { - for (float num48 = -1f; (double) num48 <= 1.0; num48 += 2f) - { - Vector2 vector2_46 = spinningpoint.RotatedBy(6.28318548202515 * (double) num48 * 1.0 / 80.0); - if (float.IsNaN(spinningpoint.X) || float.IsNaN(spinningpoint.Y)) - vector2_46 = -Vector2.UnitY; - Projectile.NewProjectile(vector2_42.X, vector2_42.Y, vector2_46.X, vector2_46.Y, projToShoot, weaponDamage, weaponKnockback, this.owner, (float) num45); - } - } - if (num45 == 4) - Projectile.NewProjectile(vector2_42.X, vector2_42.Y, spinningpoint.X, spinningpoint.Y, projToShoot, weaponDamage, weaponKnockback, this.owner, (float) num45, 1f); - } - } - else - this.Kill(); - } - Vector2 Position = this.Center + this.velocity.ToRotation().ToRotationVector2() * 40f; - Vector2 vector2_47 = center + velocity.ToRotation().ToRotationVector2() * 40f; - Color rgb = Main.hslToRgb((float) ((double) this.ai[0] / 90.0 % 1.0), 1f, 0.5f); - rgb.A = (byte) 120; - int Type = 267; - Dust dust1 = Dust.NewDustPerfect(Position, Type, new Vector2?(Vector2.Zero)); - dust1.color = rgb; - dust1.scale = 0.6f; - dust1.fadeIn = 0.9f; - dust1.noGravity = true; - Dust dust2 = Dust.NewDustPerfect(Position, Type, new Vector2?(Vector2.Zero)); - dust2.color = rgb; - dust2.scale = 0.6f; - dust2.fadeIn = 0.7f; - dust2.noGravity = true; - dust2.velocity = -this.velocity.RotatedBy(2.09439516067505) / 10f; - Dust dust3 = Dust.NewDustPerfect(Position, Type, new Vector2?(Vector2.Zero)); - dust3.color = rgb; - dust3.scale = 0.6f; - dust3.fadeIn = 0.7f; - dust3.noGravity = true; - dust3.velocity = -this.velocity.RotatedBy(-2.09439516067505) / 10f; - if (Position != vector2_47) - { - float num49 = -1f; - Dust dust4 = Dust.NewDustPerfect(Vector2.Lerp(Position, vector2_47, 0.8f), Type, new Vector2?(Vector2.Zero)); - dust4.velocity = (Position - vector2_47).SafeNormalize(Vector2.Zero) * 2f; - dust4.color = rgb; - dust4.scale = 0.6f; - dust4.fadeIn = 0.9f; - dust4.velocity *= num49; - dust4.noGravity = true; - Dust dust5 = Dust.NewDustPerfect(Vector2.Lerp(Position, vector2_47, 0.5f), Type, new Vector2?(Vector2.Zero)); - dust5.velocity = (Position - vector2_47).SafeNormalize(Vector2.Zero) * 2f; - dust5.color = rgb; - dust5.scale = 0.6f; - dust5.fadeIn = 0.9f; - dust5.velocity *= num49; - dust5.noGravity = true; - Dust dust6 = Dust.NewDustPerfect(Vector2.Lerp(Position, vector2_47, 0.2f), Type, new Vector2?(Vector2.Zero)); - dust6.velocity = (Position - vector2_47).SafeNormalize(Vector2.Zero) * 2f; - dust6.color = rgb; - dust6.scale = 0.6f; - dust6.fadeIn = 0.9f; - dust6.velocity *= num49; - dust6.noGravity = true; - } - } if (this.type == 630) { num1 = 0.0f; if (this.spriteDirection == -1) num1 = 3.141593f; ++this.ai[0]; - int num50 = 0; + int num34 = 0; if ((double) this.ai[0] >= 40.0) - ++num50; + ++num34; if ((double) this.ai[0] >= 80.0) - ++num50; + ++num34; if ((double) this.ai[0] >= 120.0) - ++num50; - int num51 = 24; - int num52 = 2; + ++num34; + int num35 = 24; + int num36 = 2; --this.ai[1]; bool flag = false; if ((double) this.ai[1] <= 0.0) { - this.ai[1] = (float) (num51 - num52 * num50); + this.ai[1] = (float) (num35 - num36 * num34); flag = true; - int num53 = (int) this.ai[0] / (num51 - num52 * num50); + int num37 = (int) this.ai[0] / (num35 - num36 * num34); } bool canShoot = player.channel && player.HasAmmo(player.inventory[player.selectedItem], true) && !player.noItems && !player.CCed; if ((double) this.localAI[0] > 0.0) --this.localAI[0]; if (this.soundDelay <= 0 & canShoot) { - this.soundDelay = num51 - num52 * num50; + this.soundDelay = num35 - num36 * num34; if ((double) this.ai[0] != 1.0) - SoundEngine.PlaySound(SoundID.Item5, this.position); + Main.PlaySound(SoundID.Item5, this.position); this.localAI[0] = 12f; } player.phantasmTime = 2; if (flag && Main.myPlayer == this.owner) { - int projToShoot = 14; + int shoot = 14; float speed = 14f; int weaponDamage = player.GetWeaponDamage(player.inventory[player.selectedItem]); float knockBack = player.inventory[player.selectedItem].knockBack; if (canShoot) { - player.PickAmmo(player.inventory[player.selectedItem], ref projToShoot, ref speed, ref canShoot, ref weaponDamage, ref knockBack); + player.PickAmmo(player.inventory[player.selectedItem], ref shoot, ref speed, ref canShoot, ref weaponDamage, ref knockBack); float weaponKnockback = player.GetWeaponKnockback(player.inventory[player.selectedItem], knockBack); - float num54 = player.inventory[player.selectedItem].shootSpeed * this.scale; - Vector2 vector2_48 = vector2_1; - Vector2 vector2_49 = Main.screenPosition + new Vector2((float) Main.mouseX, (float) Main.mouseY) - vector2_48; + float num38 = player.inventory[player.selectedItem].shootSpeed * this.scale; + Vector2 vector2_40 = vector2_1; + Vector2 vector2_41 = Main.screenPosition + new Vector2((float) Main.mouseX, (float) Main.mouseY) - vector2_40; if ((double) player.gravDir == -1.0) - vector2_49.Y = (float) (Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - vector2_48.Y; - Vector2 vector2_50 = Vector2.Normalize(vector2_49); - if (float.IsNaN(vector2_50.X) || float.IsNaN(vector2_50.Y)) - vector2_50 = -Vector2.UnitY; - Vector2 vector2_51 = vector2_50 * num54; - if ((double) vector2_51.X != (double) this.velocity.X || (double) vector2_51.Y != (double) this.velocity.Y) + vector2_41.Y = (float) (Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - vector2_40.Y; + Vector2 vector2_42 = Vector2.Normalize(vector2_41); + if (float.IsNaN(vector2_42.X) || float.IsNaN(vector2_42.Y)) + vector2_42 = -Vector2.UnitY; + Vector2 vector2_43 = vector2_42 * num38; + if ((double) vector2_43.X != (double) this.velocity.X || (double) vector2_43.Y != (double) this.velocity.Y) this.netUpdate = true; - this.velocity = vector2_51 * 0.55f; - for (int index7 = 0; index7 < 4; ++index7) + this.velocity = vector2_43 * 0.55f; + for (int index5 = 0; index5 < 4; ++index5) { - Vector2 vector2_52 = Vector2.Normalize(this.velocity) * speed * (float) (0.600000023841858 + (double) Main.rand.NextFloat() * 0.800000011920929); - if (float.IsNaN(vector2_52.X) || float.IsNaN(vector2_52.Y)) - vector2_52 = -Vector2.UnitY; - Vector2 vector2_53 = vector2_48 + Utils.RandomVector2(Main.rand, -15f, 15f); - int index8 = Projectile.NewProjectile(vector2_53.X, vector2_53.Y, vector2_52.X, vector2_52.Y, projToShoot, weaponDamage, weaponKnockback, this.owner); - Main.projectile[index8].noDropItem = true; + Vector2 vector2_44 = Vector2.Normalize(this.velocity) * speed * (float) (0.600000023841858 + (double) Main.rand.NextFloat() * 0.800000011920929); + if (float.IsNaN(vector2_44.X) || float.IsNaN(vector2_44.Y)) + vector2_44 = -Vector2.UnitY; + Vector2 vector2_45 = vector2_40 + Utils.RandomVector2(Main.rand, -15f, 15f); + int index6 = Projectile.NewProjectile(vector2_45.X, vector2_45.Y, vector2_44.X, vector2_44.Y, shoot, weaponDamage, weaponKnockback, this.owner); + Main.projectile[index6].noDropItem = true; } } else @@ -26814,108 +18356,103 @@ label_648: { this.soundDelay = itemAnimationMax; if ((double) this.ai[0] != 1.0) - SoundEngine.PlaySound(SoundID.Item5, this.position); + Main.PlaySound(SoundID.Item5, this.position); this.localAI[0] = 12f; } if (flag && Main.myPlayer == this.owner) { - int projToShoot = 14; + int shoot = 14; float speed = 12f; int weaponDamage = player.GetWeaponDamage(player.inventory[player.selectedItem]); float knockBack = player.inventory[player.selectedItem].knockBack; - int num55 = 2; + int num39 = 2; float max = 1.5f; if (canShoot) { - player.PickAmmo(player.inventory[player.selectedItem], ref projToShoot, ref speed, ref canShoot, ref weaponDamage, ref knockBack); + player.PickAmmo(player.inventory[player.selectedItem], ref shoot, ref speed, ref canShoot, ref weaponDamage, ref knockBack); float weaponKnockback = player.GetWeaponKnockback(player.inventory[player.selectedItem], knockBack); - if (projToShoot == 1) - projToShoot = 2; - if (++player.phantomPhoneixCounter >= 3) + if (shoot == 1) + shoot = 2; + if (++player.phantomPhoneixCounter >= 4) { player.phantomPhoneixCounter = 0; - num55 = 1; + num39 = 1; weaponDamage *= 2; max = 0.0f; this.ai[1] *= 1.5f; - projToShoot = 706; + shoot = 706; speed = 16f; } - float num56 = player.inventory[player.selectedItem].shootSpeed * this.scale; - Vector2 vector2_54 = vector2_1; - Vector2 vector2_55 = Main.screenPosition + new Vector2((float) Main.mouseX, (float) Main.mouseY) - vector2_54; + float num40 = player.inventory[player.selectedItem].shootSpeed * this.scale; + Vector2 vector2_46 = vector2_1; + Vector2 vector2_47 = Main.screenPosition + new Vector2((float) Main.mouseX, (float) Main.mouseY) - vector2_46; if ((double) player.gravDir == -1.0) - vector2_55.Y = (float) (Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - vector2_54.Y; - Vector2 vector2_56 = Vector2.Normalize(vector2_55); - if (float.IsNaN(vector2_56.X) || float.IsNaN(vector2_56.Y)) - vector2_56 = -Vector2.UnitY; - Vector2 vector2_57 = vector2_56 * num56; - if ((double) vector2_57.X != (double) this.velocity.X || (double) vector2_57.Y != (double) this.velocity.Y) + vector2_47.Y = (float) (Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - vector2_46.Y; + Vector2 vector2_48 = Vector2.Normalize(vector2_47); + if (float.IsNaN(vector2_48.X) || float.IsNaN(vector2_48.Y)) + vector2_48 = -Vector2.UnitY; + Vector2 vector2_49 = vector2_48 * num40; + if ((double) vector2_49.X != (double) this.velocity.X || (double) vector2_49.Y != (double) this.velocity.Y) this.netUpdate = true; - this.velocity = vector2_57 * 0.55f; - for (int index9 = 0; index9 < num55; ++index9) + this.velocity = vector2_49 * 0.55f; + for (int index7 = 0; index7 < num39; ++index7) { - Vector2 vector2_58 = Vector2.Normalize(this.velocity) * speed + Main.rand.NextVector2Square(-max, max); - if (float.IsNaN(vector2_58.X) || float.IsNaN(vector2_58.Y)) - vector2_58 = -Vector2.UnitY; - Vector2 vector2_59 = vector2_54; - int index10 = Projectile.NewProjectile(vector2_59.X, vector2_59.Y, vector2_58.X, vector2_58.Y, projToShoot, weaponDamage, weaponKnockback, this.owner); - Main.projectile[index10].noDropItem = true; + Vector2 vector2_50 = Vector2.Normalize(this.velocity) * speed + Main.rand.NextVector2Square(-max, max); + if (float.IsNaN(vector2_50.X) || float.IsNaN(vector2_50.Y)) + vector2_50 = -Vector2.UnitY; + Vector2 vector2_51 = vector2_46; + int index8 = Projectile.NewProjectile(vector2_51.X, vector2_51.Y, vector2_50.X, vector2_50.Y, shoot, weaponDamage, weaponKnockback, this.owner); + Main.projectile[index8].noDropItem = true; } } else this.Kill(); } } - this.position = player.RotatedRelativePoint(player.MountedCenter, addGfxOffY: false) - this.Size / 2f; + this.position = player.RotatedRelativePoint(player.MountedCenter) - this.Size / 2f; this.rotation = this.velocity.ToRotation() + num1; this.spriteDirection = this.direction; this.timeLeft = 2; player.ChangeDir(this.direction); player.heldProj = this.whoAmI; - player.SetDummyItemTime(frames); - player.itemRotation = MathHelper.WrapAngle((float) Math.Atan2((double) this.velocity.Y * (double) this.direction, (double) this.velocity.X * (double) this.direction) + num2); + player.itemTime = 2; + player.itemAnimation = 2; + player.itemRotation = (float) Math.Atan2((double) this.velocity.Y * (double) this.direction, (double) this.velocity.X * (double) this.direction); if (this.type == 460 || this.type == 611) { - Vector2 vector2_60 = Main.OffsetsPlayerOnhand[player.bodyFrame.Y / 56] * 2f; + Vector2 vector2_52 = Main.OffsetsPlayerOnhand[player.bodyFrame.Y / 56] * 2f; if (player.direction != 1) - vector2_60.X = (float) player.bodyFrame.Width - vector2_60.X; + vector2_52.X = (float) player.bodyFrame.Width - vector2_52.X; if ((double) player.gravDir != 1.0) - vector2_60.Y = (float) player.bodyFrame.Height - vector2_60.Y; - Vector2 vector2_61 = vector2_60 - new Vector2((float) (player.bodyFrame.Width - player.width), (float) (player.bodyFrame.Height - 42)) / 2f; - this.Center = player.RotatedRelativePoint(player.MountedCenter - new Vector2(20f, 42f) / 2f + vector2_61, addGfxOffY: false) - this.velocity; + vector2_52.Y = (float) player.bodyFrame.Height - vector2_52.Y; + Vector2 vector2_53 = vector2_52 - new Vector2((float) (player.bodyFrame.Width - player.width), (float) (player.bodyFrame.Height - 42)) / 2f; + this.Center = player.RotatedRelativePoint(player.position + vector2_53) - this.velocity; } if (this.type == 615) this.position.Y += player.gravDir * 2f; - if (this.type == 714) - this.position.Y += player.gravDir * 2f; - if (this.type == 611 && this.alpha == 0) + if (this.type != 611 || this.alpha != 0) + return; + for (int index = 0; index < 2; ++index) { - for (int index = 0; index < 2; ++index) + Dust dust = Main.dust[Dust.NewDust(this.position + this.velocity * 2f, this.width, this.height, 6, Alpha: 100, newColor: Color.Transparent, Scale: 2f)]; + dust.noGravity = true; + dust.velocity *= 2f; + dust.velocity += this.localAI[0].ToRotationVector2(); + dust.fadeIn = 1.5f; + } + float num41 = 18f; + for (int index = 0; (double) index < (double) num41; ++index) + { + if (Main.rand.Next(4) == 0) { - Dust dust = Main.dust[Dust.NewDust(this.position + this.velocity * 2f, this.width, this.height, 6, Alpha: 100, newColor: Color.Transparent, Scale: 2f)]; + Vector2 Position = this.position + this.velocity + this.velocity * ((float) index / num41); + Dust dust = Main.dust[Dust.NewDust(Position, this.width, this.height, 6, Alpha: 100, newColor: Color.Transparent)]; dust.noGravity = true; - dust.velocity *= 2f; + dust.fadeIn = 0.5f; dust.velocity += this.localAI[0].ToRotationVector2(); - dust.fadeIn = 1.5f; - } - float num57 = 18f; - for (int index = 0; (double) index < (double) num57; ++index) - { - if (Main.rand.Next(4) == 0) - { - Vector2 Position = this.position + this.velocity + this.velocity * ((float) index / num57); - Dust dust = Main.dust[Dust.NewDust(Position, this.width, this.height, 6, Alpha: 100, newColor: Color.Transparent)]; - dust.noGravity = true; - dust.fadeIn = 0.5f; - dust.velocity += this.localAI[0].ToRotationVector2(); - dust.noLight = true; - } + dust.noLight = true; } } - if (this.type != 927) - return; - player.itemAnimation = frames - (int) this.ai[0]; } private void AI_099_1() @@ -26955,7 +18492,8 @@ label_648: if (!flag1) { Main.player[this.owner].heldProj = this.whoAmI; - Main.player[this.owner].SetDummyItemTime(2); + Main.player[this.owner].itemAnimation = 2; + Main.player[this.owner].itemTime = 2; if ((double) this.position.X + (double) (this.width / 2) > (double) Main.player[this.owner].position.X + (double) (Main.player[this.owner].width / 2)) { Main.player[this.owner].ChangeDir(1); @@ -27133,26 +18671,25 @@ label_648: { this.tileCollide = false; Vector2 vec = Main.player[this.owner].Center - this.Center; - float num15 = vec.Length(); - if ((double) num15 < 40.0 || vec.HasNaNs() || (double) num15 > 2000.0) + if ((double) vec.Length() < 40.0 || vec.HasNaNs()) { this.Kill(); } else { - float num16 = num6 * 1.5f; + float num15 = num6 * 1.5f; if (this.type == 546) - num16 *= 1.5f; + num15 *= 1.5f; if (this.type == 554) - num16 *= 1.25f; + num15 *= 1.25f; if (this.type == 555) - num16 *= 1.35f; + num15 *= 1.35f; if (this.type == 562) - num16 *= 1.25f; - float num17 = 12f; + num15 *= 1.25f; + float num16 = 12f; vec.Normalize(); - vec *= num16; - this.velocity = (this.velocity * (num17 - 1f) + vec) / num17; + vec *= num15; + this.velocity = (this.velocity * (num16 - 1f) + vec) / num16; } } } @@ -27224,7 +18761,8 @@ label_648: if (!flag2 && !flag1) { Main.player[this.owner].heldProj = this.whoAmI; - Main.player[this.owner].SetDummyItemTime(2); + Main.player[this.owner].itemAnimation = 2; + Main.player[this.owner].itemTime = 2; if ((double) this.position.X + (double) (this.width / 2) > (double) Main.player[this.owner].position.X + (double) (Main.player[this.owner].width / 2)) { Main.player[this.owner].ChangeDir(1); @@ -27258,16 +18796,14 @@ label_648: if (Main.player[this.owner].yoyoString) num7 = (float) ((double) num7 * 1.25 + 30.0); float num9 = num7 / (float) ((1.0 + (double) Main.player[this.owner].meleeSpeed * 3.0) / 4.0); - float val2 = num8 / (float) ((1.0 + (double) Main.player[this.owner].meleeSpeed * 3.0) / 4.0); - float num10 = (float) (14.0 - (double) val2 / 2.0); - if ((double) num10 < 1.0) - num10 = 1f; - float num11 = (float) (5.0 + (double) val2 / 2.0); + float num10 = num8 / (float) ((1.0 + (double) Main.player[this.owner].meleeSpeed * 3.0) / 4.0); + float num11 = (float) (14.0 - (double) num10 / 2.0); + float num12 = (float) (5.0 + (double) num10 / 2.0); if (flag1) - num11 += 20f; + num12 += 20f; if ((double) this.ai[0] >= 0.0) { - if ((double) this.velocity.Length() > (double) val2) + if ((double) this.velocity.Length() > (double) num10) this.velocity = this.velocity * 0.98f; bool flag3 = false; bool flag4 = false; @@ -27326,66 +18862,62 @@ label_648: { if (flag3) { - num10 /= 2f; - val2 *= 2f; + num11 /= 2f; + num10 *= 2f; if ((double) this.Center.X > (double) Main.player[this.owner].Center.X && (double) this.velocity.X > 0.0) this.velocity.X *= 0.5f; if ((double) this.Center.Y > (double) Main.player[this.owner].Center.Y && (double) this.velocity.Y > 0.0) this.velocity.Y *= 0.5f; - if ((double) this.Center.X < (double) Main.player[this.owner].Center.X && (double) this.velocity.X < 0.0) + if ((double) this.Center.X < (double) Main.player[this.owner].Center.X && (double) this.velocity.X > 0.0) this.velocity.X *= 0.5f; - if ((double) this.Center.Y < (double) Main.player[this.owner].Center.Y && (double) this.velocity.Y < 0.0) + if ((double) this.Center.Y < (double) Main.player[this.owner].Center.Y && (double) this.velocity.Y > 0.0) this.velocity.Y *= 0.5f; } Vector2 vector2_13 = new Vector2(this.ai[0], this.ai[1]) - this.Center; - if (flag3) - num10 = 1f; - double num12 = (double) this.velocity.Length(); - float num13 = vector2_13.Length(); - if ((double) num13 > (double) num11) + double num13 = (double) this.velocity.Length(); + float num14 = vector2_13.Length(); + if ((double) num14 > (double) num12) { vector2_13.Normalize(); - float val1 = Math.Min(num13 / 2f, val2); - if (flag3) - val1 = Math.Min(val1, val2 / 2f); - vector2_13 *= val1; - this.velocity = (this.velocity * (num10 - 1f) + vector2_13) / num10; + float num15 = (double) num14 > (double) num10 * 2.0 ? num10 : num14 / 2f; + vector2_13 *= num15; + this.velocity = (this.velocity * (num11 - 1f) + vector2_13) / num11; } else if (flag1) { - if ((double) this.velocity.Length() < (double) val2 * 0.6) + if ((double) this.velocity.Length() < (double) num10 * 0.6) { vector2_13 = this.velocity; vector2_13.Normalize(); - vector2_13 *= val2 * 0.6f; - this.velocity = (this.velocity * (num10 - 1f) + vector2_13) / num10; + vector2_13 *= num10 * 0.6f; + this.velocity = (this.velocity * (num11 - 1f) + vector2_13) / num11; } } else this.velocity = this.velocity * 0.8f; - if (flag1 && !flag3 && (double) this.velocity.Length() < (double) val2 * 0.6) + if (flag1 && !flag3 && (double) this.velocity.Length() < (double) num10 * 0.6) { this.velocity.Normalize(); - this.velocity = this.velocity * (val2 * 0.6f); + this.velocity = this.velocity * (num10 * 0.6f); } } } else { - float num14 = (float) (int) ((double) num10 * 0.8); - float num15 = val2 * 1.5f; + float num16 = (float) (int) ((double) num11 * 0.8); + float num17 = num10 * 1.5f; this.tileCollide = false; - Vector2 vector2 = Main.player[this.owner].Center - this.Center; - float num16 = vector2.Length(); - if ((double) num16 < (double) num15 + 10.0 || (double) num16 == 0.0 || (double) num16 > 2000.0) + Vector2 vector2 = Main.player[this.owner].position - this.Center; + float num18 = vector2.Length(); + if ((double) num18 < (double) num17 + 10.0 || (double) num18 == 0.0) { this.Kill(); } else { vector2.Normalize(); - vector2 *= num15; - this.velocity = (this.velocity * (num14 - 1f) + vector2) / num14; + vector2 *= num17; + this.velocity = (this.velocity * (num16 - 1f) + vector2) / num16; } } this.rotation += 0.45f; @@ -27646,7 +19178,7 @@ label_648: { for (int index2 = 0; index2 < 1; ++index2) { - if (minionAttackTargetNpc.CanBeChasedBy((object) this)) + if (minionAttackTargetNpc.CanBeChasedBy((object) this, true)) { float num = Vector2.Distance(shootingSpot, minionAttackTargetNpc.Center); if ((double) num <= (double) shot_range) @@ -27663,7 +19195,7 @@ label_648: for (int index3 = 0; index3 < 200; ++index3) { NPC npc = Main.npc[index3]; - if (npc.CanBeChasedBy((object) this)) + if (npc.CanBeChasedBy((object) this, true)) { float num = Vector2.Distance(shootingSpot, npc.Center); if ((double) num <= (double) shot_range) @@ -27684,7 +19216,7 @@ label_648: if ((double) this.localAI[0] == 0.0) { this.localAI[0] = 1f; - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_FlameburstTowerShot, this.Center); + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_FlameburstTowerShot, this.Center); } if (this.alpha > 0) { @@ -27787,7 +19319,7 @@ label_648: this.frame = num2 + (int) ((double) this.ai[1] / (double) num4); if ((double) this.ai[1] == (double) num6) { - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_BallistaTowerShot, this.Center); + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_BallistaTowerShot, this.Center); Vector2 v = new Vector2((float) this.direction, 0.0f); int target = this.AI_134_Ballista_FindTarget(shot_range, deadBottomAngle, center); if (target != -1) @@ -27814,9 +19346,6 @@ label_648: private void AI_135_OgreStomp() { - float num1 = 40f; - if (this.type == 922) - num1 = 30f; ++this.ai[0]; if ((double) this.ai[0] > 9.0) { @@ -27826,20 +19355,20 @@ label_648: { this.velocity = Vector2.Zero; this.position = this.Center; - this.Size = new Vector2(16f, 16f) * MathHelper.Lerp(5f, num1, Utils.GetLerpValue(0.0f, 9f, this.ai[0], false)); + this.Size = new Vector2(16f, 16f) * MathHelper.Lerp(5f, 40f, Utils.InverseLerp(0.0f, 9f, this.ai[0])); this.Center = this.position; Point tileCoordinates1 = this.TopLeft.ToTileCoordinates(); Point tileCoordinates2 = this.BottomRight.ToTileCoordinates(); - int num2 = tileCoordinates1.X / 2 + tileCoordinates2.X / 2; - int num3 = this.width / 2; + int num1 = tileCoordinates1.X / 2 + tileCoordinates2.X / 2; + int num2 = this.width / 2; if ((int) this.ai[0] % 3 != 0) return; - int num4 = (int) this.ai[0] / 3; + int num3 = (int) this.ai[0] / 3; for (int x = tileCoordinates1.X; x <= tileCoordinates2.X; ++x) { for (int y = tileCoordinates1.Y; y <= tileCoordinates2.Y; ++y) { - if ((double) Vector2.Distance(this.Center, new Vector2((float) (x * 16), (float) (y * 16))) <= (double) num3) + if ((double) Vector2.Distance(this.Center, new Vector2((float) (x * 16), (float) (y * 16))) <= (double) num2) { Tile tileSafely1 = Framing.GetTileSafely(x, y); if (tileSafely1.active() && Main.tileSolid[(int) tileSafely1.type] && !Main.tileSolidTop[(int) tileSafely1.type] && !Main.tileFrameImportant[(int) tileSafely1.type]) @@ -27851,70 +19380,26 @@ label_648: for (int index = 0; index < tileDustAmount; ++index) { Dust dust = Main.dust[WorldGen.KillTile_MakeTileDust(x, y, tileSafely1)]; - dust.velocity.Y -= (float) (3.0 + (double) num4 * 1.5); + dust.velocity.Y -= (float) (3.0 + (double) num3 * 1.5); dust.velocity.Y *= Main.rand.NextFloat(); - dust.velocity.Y *= 0.75f; - dust.scale += (float) num4 * 0.03f; + dust.scale += (float) num3 * 0.03f; } - if (num4 >= 2) + if (num3 >= 2) { - if (this.type == 922) + for (int index = 0; index < tileDustAmount - 1; ++index) { - Color dustColor = NPC.AI_121_QueenSlime_GetDustColor(); - dustColor.A = (byte) 150; - for (int index1 = 0; index1 < tileDustAmount - 1; ++index1) - { - int index2 = Dust.NewDust(this.position, 12, 12, 4, Alpha: 50, newColor: dustColor, Scale: 1.5f); - Main.dust[index2].velocity.Y -= (float) (0.100000001490116 + (double) num4 * 0.5); - Main.dust[index2].velocity.Y *= Main.rand.NextFloat(); - Main.dust[index2].velocity.X *= Main.rand.NextFloatDirection() * 3f; - Main.dust[index2].position = new Vector2((float) (x * 16 + Main.rand.Next(16)), (float) (y * 16 + Main.rand.Next(16))); - if (Main.rand.Next(3) != 0) - { - Main.dust[index2].velocity *= 0.5f; - Main.dust[index2].noGravity = true; - } - } - } - else - { - for (int index = 0; index < tileDustAmount - 1; ++index) - { - Dust dust = Main.dust[WorldGen.KillTile_MakeTileDust(x, y, tileSafely1)]; - dust.velocity.Y -= 1f + (float) num4; - dust.velocity.Y *= Main.rand.NextFloat(); - dust.velocity.Y *= 0.75f; - } + Dust dust = Main.dust[WorldGen.KillTile_MakeTileDust(x, y, tileSafely1)]; + dust.velocity.Y -= 1f + (float) num3; + dust.velocity.Y *= Main.rand.NextFloat(); } } if (tileDustAmount > 0 && Main.rand.Next(3) != 0) { - float num5 = (float) Math.Abs(num2 - x) / (num1 / 2f); - if (this.type == 922) - { - Color dustColor = NPC.AI_121_QueenSlime_GetDustColor(); - dustColor.A = (byte) 150; - for (int index3 = 0; index3 < 3; ++index3) - { - int index4 = Dust.NewDust(this.position, this.width, this.height, 31, Alpha: 50, newColor: dustColor, Scale: ((float) (2.0 - (double) num4 * 0.150000005960464 + (double) num5 * 0.5))); - Main.dust[index4].velocity.Y -= (float) (0.100000001490116 + (double) num4 * 0.5 + (double) num5 * (double) num4 * 1.0); - Main.dust[index4].velocity.Y *= Main.rand.NextFloat(); - Main.dust[index4].velocity.X *= Main.rand.NextFloatDirection() * 3f; - Main.dust[index4].position = new Vector2((float) (x * 16 + 20), (float) (y * 16 + 20)); - if (Main.rand.Next(3) != 0) - { - Main.dust[index4].velocity *= 0.5f; - Main.dust[index4].noGravity = true; - } - } - } - else - { - Gore gore = Gore.NewGoreDirect(this.position, Vector2.Zero, 61 + Main.rand.Next(3), (float) (1.0 - (double) num4 * 0.150000005960464 + (double) num5 * 0.5)); - gore.velocity.Y -= (float) (0.100000001490116 + (double) num4 * 0.5 + (double) num5 * (double) num4 * 1.0); - gore.velocity.Y *= Main.rand.NextFloat(); - gore.position = new Vector2((float) (x * 16 + 20), (float) (y * 16 + 20)); - } + float num4 = (float) Math.Abs(num1 - x) / 20f; + Gore gore = Gore.NewGoreDirect(this.position, Vector2.Zero, 61 + Main.rand.Next(3), (float) (1.0 - (double) num3 * 0.150000005960464 + (double) num4 * 0.5)); + gore.velocity.Y -= (float) (0.100000001490116 + (double) num3 * 0.5 + (double) num4 * (double) num3 * 1.0); + gore.velocity.Y *= Main.rand.NextFloat(); + gore.position = new Vector2((float) (x * 16 + 20), (float) (y * 16 + 20)); } } } @@ -27943,9 +19428,9 @@ label_648: float num3 = (float) (((double) this.ai[0] - 38.0) / 40.0); if ((double) num3 < 0.0) num3 = 0.0f; - Utils.PlotTileLine(this.Center + this.rotation.ToRotationVector2() * 400f * num3, this.Center + this.rotation.ToRotationVector2() * 400f * num2, 16f, new Utils.TileActionAttempt(DelegateMethods.CastLight)); - Utils.PlotTileLine(this.Center + this.rotation.ToRotationVector2().RotatedBy(0.196349546313286) * 400f * num3, this.Center + this.rotation.ToRotationVector2().RotatedBy(0.196349546313286) * 400f * num2, 16f, new Utils.TileActionAttempt(DelegateMethods.CastLight)); - Utils.PlotTileLine(this.Center + this.rotation.ToRotationVector2().RotatedBy(-0.196349546313286) * 400f * num3, this.Center + this.rotation.ToRotationVector2().RotatedBy(-0.196349546313286) * 400f * num2, 16f, new Utils.TileActionAttempt(DelegateMethods.CastLight)); + Utils.PlotTileLine(this.Center + this.rotation.ToRotationVector2() * 400f * num3, this.Center + this.rotation.ToRotationVector2() * 400f * num2, 16f, new Utils.PerLinePoint(DelegateMethods.CastLight)); + Utils.PlotTileLine(this.Center + this.rotation.ToRotationVector2().RotatedBy(0.196349546313286) * 400f * num3, this.Center + this.rotation.ToRotationVector2().RotatedBy(0.196349546313286) * 400f * num2, 16f, new Utils.PerLinePoint(DelegateMethods.CastLight)); + Utils.PlotTileLine(this.Center + this.rotation.ToRotationVector2().RotatedBy(-0.196349546313286) * 400f * num3, this.Center + this.rotation.ToRotationVector2().RotatedBy(-0.196349546313286) * 400f * num2, 16f, new Utils.PerLinePoint(DelegateMethods.CastLight)); if ((double) num3 == 0.0 && (double) num2 > 0.100000001490116) { for (int index = 0; index < 3; ++index) @@ -28018,27 +19503,23 @@ label_648: } } if (flag) - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_LightningAuraZap, this.Center); + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_LightningAuraZap, this.Center); } if ((double) this.localAI[0] == 0.0) { this.localAI[0] = 1f; this.velocity = Vector2.Zero; Point tileCoordinates = this.Center.ToTileCoordinates(); - bool flag = true; Point result1; - if (!WorldUtils.Find(tileCoordinates, Searches.Chain((GenSearch) new Searches.Down(500), (GenCondition) Projectile._cachedConditions_notNull, (GenCondition) Projectile._cachedConditions_solid), out result1)) + if (!WorldUtils.Find(tileCoordinates, Searches.Chain((GenSearch) new Searches.Down(500), (GenCondition) new Conditions.IsSolid()), out result1)) { this.position.Y += 16f; return; } Point result2; - if (!WorldUtils.Find(new Point(result1.X, result1.Y - 1), Searches.Chain((GenSearch) new Searches.Up(maxDistance), (GenCondition) Projectile._cachedConditions_notNull, (GenCondition) Projectile._cachedConditions_solid), out result2)) + if (!WorldUtils.Find(new Point(result1.X, result1.Y - 1), Searches.Chain((GenSearch) new Searches.Up(maxDistance), (GenCondition) new Conditions.IsSolid()), out result2)) result2 = new Point(tileCoordinates.X, tileCoordinates.Y - maxDistance - 1); - int num5 = 0; - if (flag && Main.tile[result1.X, result1.Y] != null && Main.tile[result1.X, result1.Y].blockType() == 1) - num5 += 8; - Vector2 worldCoordinates1 = result1.ToWorldCoordinates(autoAddY: ((float) num5)); + Vector2 worldCoordinates1 = result1.ToWorldCoordinates(autoAddY: 0.0f); Vector2 worldCoordinates2 = result2.ToWorldCoordinates(autoAddY: 0.0f); this.Size = new Vector2(1f, worldCoordinates1.Y - worldCoordinates2.Y); if (this.height > maxDistance * 16) @@ -28058,7 +19539,7 @@ label_648: this.frame = 0; } DelegateMethods.v3_1 = new Vector3(0.2f, 0.7f, 1f); - Utils.PlotTileLine(this.Center + Vector2.UnitX * -40f, this.Center + Vector2.UnitX * 40f, 80f, new Utils.TileActionAttempt(DelegateMethods.CastLightOpen)); + Utils.PlotTileLine(this.Center + Vector2.UnitX * -40f, this.Center + Vector2.UnitX * 40f, 80f, new Utils.PerLinePoint(DelegateMethods.CastLightOpen)); Vector2 vector2_1 = new Vector2(this.Top.X, this.position.Y + (float) num3); for (int index = 0; index < 4; ++index) { @@ -28152,7 +19633,7 @@ label_648: for (int index = 0; index < 200; ++index) { NPC npc = Main.npc[index]; - if (npc.CanBeChasedBy((object) this) && rectangle.Intersects(npc.Hitbox)) + if (npc.CanBeChasedBy((object) this, true) && rectangle.Intersects(npc.Hitbox)) { flag = true; break; @@ -28160,7 +19641,7 @@ label_648: } if (flag) { - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_ExplosiveTrapExplode); + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_ExplosiveTrapExplode); this.localAI[0] = (float) num1; Projectile.NewProjectile(this.Center + new Vector2(0.0f, (float) -num2), Vector2.Zero, Type, this.damage, this.knockBack, this.owner); } @@ -28188,7 +19669,7 @@ label_648: } } DelegateMethods.v3_1 = new Vector3(1.3f, 0.9f, 0.2f); - Utils.PlotTileLine(this.Top, this.Bottom, 2f, new Utils.TileActionAttempt(DelegateMethods.CastLightOpen)); + Utils.PlotTileLine(this.Top, this.Bottom, 2f, new Utils.PerLinePoint(DelegateMethods.CastLightOpen)); } private void AI_140_MonkStaffT1() @@ -28208,7 +19689,7 @@ label_648: { if (this.type == 697) { - int Damage = this.damage * 3; + int Damage = this.damage * 2; int num5 = Math.Sign(this.velocity.X); this.velocity = new Vector2((float) num5, 0.0f); if ((double) this.ai[0] == 0.0) @@ -28271,14 +19752,14 @@ label_648: { if ((double) this.localAI[1] != 1.0) { - if (!WorldUtils.Find(vec.ToTileCoordinates(), Searches.Chain((GenSearch) new Searches.Down(4), (GenCondition) Projectile._cachedConditions_notNull, (GenCondition) Projectile._cachedConditions_solid), out Point _)) + if (!WorldUtils.Find(vec.ToTileCoordinates(), Searches.Chain((GenSearch) new Searches.Down(4), (GenCondition) new Conditions.IsSolid()), out Point _)) { - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_MonkStaffGroundMiss, this.Center); + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_MonkStaffGroundMiss, this.Center); goto label_26; } } Projectile.NewProjectile(vec + new Vector2((float) (num5 * 20), -60f), Vector2.Zero, 698, Damage, 0.0f, this.owner); - SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_MonkStaffGroundImpact, this.Center); + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_MonkStaffGroundImpact, this.Center); } } label_26: @@ -28371,7 +19852,8 @@ label_26: this.timeLeft = 2; player.ChangeDir(this.direction); player.heldProj = this.whoAmI; - player.SetDummyItemTime(2); + player.itemTime = 2; + player.itemAnimation = 2; player.itemRotation = MathHelper.WrapAngle(this.rotation); } } @@ -28392,139 +19874,76 @@ label_26: { if ((double) this.ai[0] != 1.0) return; - bool causedShockwaves; - this.CreateImpactExplosion(6, this.Bottom, ref tileCoordinates1, ref tileCoordinates2, width, out causedShockwaves); - this.CreateImpactExplosion2_SleepyOctopod(this.Bottom, causedShockwaves); - } - } - - private void CreateImpactExplosion( - int dustAmountMultiplier, - Vector2 explosionOrigin, - ref Point scanAreaStart, - ref Point scanAreaEnd, - int explosionRange, - out bool causedShockwaves) - { - causedShockwaves = false; - int num1 = 4; - for (int x = scanAreaStart.X; x <= scanAreaEnd.X; ++x) - { - for (int y = scanAreaStart.Y; y <= scanAreaEnd.Y; ++y) + bool flag = false; + int num3 = 4; + for (int x = tileCoordinates1.X; x <= tileCoordinates2.X; ++x) { - if ((double) Vector2.Distance(explosionOrigin, new Vector2((float) (x * 16), (float) (y * 16))) <= (double) explosionRange) + for (int y = tileCoordinates1.Y; y <= tileCoordinates2.Y; ++y) { - Tile tileSafely1 = Framing.GetTileSafely(x, y); - if (tileSafely1.active() && Main.tileSolid[(int) tileSafely1.type] && !Main.tileSolidTop[(int) tileSafely1.type] && !Main.tileFrameImportant[(int) tileSafely1.type]) + if ((double) Vector2.Distance(this.Bottom, new Vector2((float) (x * 16), (float) (y * 16))) <= (double) width) { - Tile tileSafely2 = Framing.GetTileSafely(x, y - 1); - if (!tileSafely2.active() || !Main.tileSolid[(int) tileSafely2.type] || Main.tileSolidTop[(int) tileSafely2.type]) + Tile tileSafely1 = Framing.GetTileSafely(x, y); + if (tileSafely1.active() && Main.tileSolid[(int) tileSafely1.type] && !Main.tileSolidTop[(int) tileSafely1.type] && !Main.tileFrameImportant[(int) tileSafely1.type]) { - int num2 = WorldGen.KillTile_GetTileDustAmount(true, tileSafely1) * dustAmountMultiplier; - for (int index = 0; index < num2; ++index) + Tile tileSafely2 = Framing.GetTileSafely(x, y - 1); + if (!tileSafely2.active() || !Main.tileSolid[(int) tileSafely2.type] || Main.tileSolidTop[(int) tileSafely2.type]) { - Dust dust = Main.dust[WorldGen.KillTile_MakeTileDust(x, y, tileSafely1)]; - dust.velocity.Y -= (float) (3.0 + (double) num1 * 1.5); - dust.velocity.Y *= Main.rand.NextFloat(); - dust.scale += (float) num1 * 0.03f; - } - if (num1 >= 2) - { - for (int index = 0; index < num2 - 1; ++index) + int num4 = WorldGen.KillTile_GetTileDustAmount(true, tileSafely1) * 6; + for (int index = 0; index < num4; ++index) { Dust dust = Main.dust[WorldGen.KillTile_MakeTileDust(x, y, tileSafely1)]; - dust.velocity.Y -= 1f + (float) num1; + dust.velocity.Y -= (float) (3.0 + (double) num3 * 1.5); dust.velocity.Y *= Main.rand.NextFloat(); + dust.scale += (float) num3 * 0.03f; } + if (num3 >= 2) + { + for (int index = 0; index < num4 - 1; ++index) + { + Dust dust = Main.dust[WorldGen.KillTile_MakeTileDust(x, y, tileSafely1)]; + dust.velocity.Y -= 1f + (float) num3; + dust.velocity.Y *= Main.rand.NextFloat(); + } + } + if (num4 > 0) + flag = true; } - if (num2 > 0) - causedShockwaves = true; } } } } - } - } - - private void CreateImpactExplosion2_SleepyOctopod( - Vector2 explosionOrigin, - bool causedShockwaves) - { - Vector2 vector2_1 = explosionOrigin; - Vector2 spinningpoint = new Vector2(7f, 0.0f); - Vector2 vector2_2 = new Vector2(1f, 0.7f); - Color color = new Color(20, (int) byte.MaxValue, 100, 200); - for (float num = 0.0f; (double) num < 25.0; ++num) - { - Vector2 vector2_3 = spinningpoint.RotatedBy((double) num * 6.28318548202515 / 25.0) * vector2_2; - Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 55); - dust.alpha = 0; - if (!causedShockwaves) - dust.alpha = 50; - dust.color = color; - dust.position = vector2_1 + vector2_3; - dust.velocity.Y -= 3f; - dust.velocity.X *= 0.5f; - dust.fadeIn = (float) (0.5 + (double) Main.rand.NextFloat() * 0.5); - dust.noLight = true; - } - if (causedShockwaves) - return; - for (float num = 0.0f; (double) num < 25.0; ++num) - { - Vector2 vector2_4 = spinningpoint.RotatedBy((double) num * 6.28318548202515 / 25.0) * vector2_2; - Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 55); - dust.alpha = 100; - dust.color = color; - dust.position = vector2_1 + vector2_4; - dust.velocity.Y -= 5f; - dust.velocity.X *= 0.8f; - dust.fadeIn = (float) (0.5 + (double) Main.rand.NextFloat() * 0.5); - dust.noLight = true; - } - } - - private void CreateImpactExplosion2_FlailTileCollision( - Vector2 explosionOrigin, - bool causedShockwaves, - Vector2 velocityBeforeCollision) - { - Vector2 vector2_1 = explosionOrigin; - Vector2 spinningpoint = new Vector2(7f, 0.0f); - Vector2 vector2_2 = new Vector2(1f, 0.7f); - Color color = Color.White * 0.5f; - Vector2 vector2_3 = velocityBeforeCollision.SafeNormalize(Vector2.Zero); - for (float num = 0.0f; (double) num < 8.0; ++num) - { - Vector2 vector2_4 = spinningpoint.RotatedBy((double) num * 6.28318548202515 / 8.0) * vector2_2; - Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 31); - dust.alpha = 0; - if (!causedShockwaves) - dust.alpha = 50; - dust.color = color; - dust.position = vector2_1 + vector2_4; - dust.velocity.Y -= 0.8f; - dust.velocity.X *= 0.8f; - dust.fadeIn = (float) (0.300000011920929 + (double) Main.rand.NextFloat() * 0.400000005960464); - dust.scale = 0.4f; - dust.noLight = true; - dust.velocity += vector2_3 * 2f; - } - if (causedShockwaves) - return; - for (float num = 0.0f; (double) num < 8.0; ++num) - { - Vector2 vector2_5 = spinningpoint.RotatedBy((double) num * 6.28318548202515 / 8.0) * vector2_2; - Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 31); - dust.alpha = 100; - dust.color = color; - dust.position = vector2_1 + vector2_5; - --dust.velocity.Y; - dust.velocity.X *= 0.4f; - dust.fadeIn = (float) (0.300000011920929 + (double) Main.rand.NextFloat() * 0.400000005960464); - dust.scale = 0.4f; - dust.noLight = true; - dust.velocity += vector2_3 * 1.5f; + Vector2 bottom = this.Bottom; + Vector2 spinningpoint = new Vector2(7f, 0.0f); + Vector2 vector2_1 = new Vector2(1f, 0.7f); + Color color = new Color(20, (int) byte.MaxValue, 100, 200); + for (float num5 = 0.0f; (double) num5 < 25.0; ++num5) + { + Vector2 vector2_2 = spinningpoint.RotatedBy((double) num5 * 6.28318548202515 / 25.0) * vector2_1; + Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 55); + dust.alpha = 0; + if (!flag) + dust.alpha = 50; + dust.color = color; + dust.position = bottom + vector2_2; + dust.velocity.Y -= 3f; + dust.velocity.X *= 0.5f; + dust.fadeIn = (float) (0.5 + (double) Main.rand.NextFloat() * 0.5); + dust.noLight = true; + } + if (flag) + return; + for (float num6 = 0.0f; (double) num6 < 25.0; ++num6) + { + Vector2 vector2_3 = spinningpoint.RotatedBy((double) num6 * 6.28318548202515 / 25.0) * vector2_1; + Dust dust = Dust.NewDustDirect(this.position, this.width, this.height, 55); + dust.alpha = 100; + dust.color = color; + dust.position = bottom + vector2_3; + dust.velocity.Y -= 5f; + dust.velocity.X *= 0.8f; + dust.fadeIn = (float) (0.5 + (double) Main.rand.NextFloat() * 0.5); + dust.noLight = true; + } } } @@ -28546,7 +19965,6 @@ label_26: if (this.type == 699) { this.spriteDirection = this.direction = player.direction; - Vector2 Origin = vector2_1; this.alpha -= (int) sbyte.MaxValue; if (this.alpha < 0) this.alpha = 0; @@ -28558,18 +19976,18 @@ label_26: float num2 = 22f; Vector2 spinningpoint1 = new Vector2(1f, 0.0f).RotatedBy(3.14159274101257 + (double) num1 * 6.28318548202515) * new Vector2(x, this.ai[0]); this.position = this.position + (spinningpoint1.RotatedBy((double) rotation) + new Vector2(x + num2, 0.0f).RotatedBy((double) rotation)); - Vector2 Target = Origin + spinningpoint1.RotatedBy((double) rotation) + new Vector2((float) ((double) x + (double) num2 + 40.0), 0.0f).RotatedBy((double) rotation); - this.rotation = Origin.AngleTo(Target) + 0.7853982f * (float) player.direction; + Vector2 Destination = vector2_1 + spinningpoint1.RotatedBy((double) rotation) + new Vector2((float) ((double) x + (double) num2 + 40.0), 0.0f).RotatedBy((double) rotation); + this.rotation = player.AngleTo(Destination) + 0.7853982f * (float) player.direction; if (this.spriteDirection == -1) this.rotation += 3.141593f; - Origin.DirectionTo(this.Center); - Vector2 vector2_2 = Origin.DirectionTo(Target); + player.DirectionTo(this.Center); + Vector2 vector2_2 = player.DirectionTo(Destination); Vector2 spinningpoint2 = this.velocity.SafeNormalize(Vector2.UnitY); float num3 = 2f; for (int index = 0; (double) index < (double) num3; ++index) { Dust dust = Dust.NewDustDirect(this.Center, 14, 14, 228, Alpha: 110); - dust.velocity = Origin.DirectionTo(dust.position) * 2f; + dust.velocity = player.DirectionTo(dust.position) * 2f; dust.position = this.Center + spinningpoint2.RotatedBy((double) num1 * 6.28318548202515 * 2.0 + (double) index / (double) num3 * 6.28318548202515) * 10f; dust.scale = (float) (1.0 + 0.600000023841858 * (double) Main.rand.NextFloat()); dust.velocity += spinningpoint2 * 3f; @@ -28580,7 +19998,7 @@ label_26: if (Main.rand.Next(3) == 0) { Dust dust = Dust.NewDustDirect(this.Center, 20, 20, 228, Alpha: 110); - dust.velocity = Origin.DirectionTo(dust.position) * 2f; + dust.velocity = player.DirectionTo(dust.position) * 2f; dust.position = this.Center + vector2_2 * -110f; dust.scale = (float) (0.449999988079071 + 0.400000005960464 * (double) Main.rand.NextFloat()); dust.fadeIn = (float) (0.699999988079071 + 0.400000005960464 * (double) Main.rand.NextFloat()); @@ -28602,29 +20020,29 @@ label_26: float num5 = 22f; Vector2 spinningpoint3 = new Vector2(1f, 0.0f).RotatedBy(3.14159274101257 + (double) num4 * 6.28318548202515) * new Vector2(x, this.ai[0]); this.position = this.position + (spinningpoint3.RotatedBy((double) rotation) + new Vector2(x + num5, 0.0f).RotatedBy((double) rotation)); - Vector2 vector2_3 = vector2_1 + spinningpoint3.RotatedBy((double) rotation) + new Vector2((float) ((double) x + (double) num5 + 40.0), 0.0f).RotatedBy((double) rotation); - this.rotation = (vector2_3 - vector2_1).SafeNormalize(Vector2.UnitX).ToRotation() + 0.7853982f * (float) player.direction; + Vector2 Destination = vector2_1 + spinningpoint3.RotatedBy((double) rotation) + new Vector2((float) ((double) x + (double) num5 + 40.0), 0.0f).RotatedBy((double) rotation); + this.rotation = player.AngleTo(Destination) + 0.7853982f * (float) player.direction; if (this.spriteDirection == -1) this.rotation += 3.141593f; - (this.Center - vector2_1).SafeNormalize(Vector2.Zero); - (vector2_3 - vector2_1).SafeNormalize(Vector2.Zero); + player.DirectionTo(this.Center); + player.DirectionTo(Destination); Vector2 spinningpoint4 = this.velocity.SafeNormalize(Vector2.UnitY); if ((player.itemAnimation == 2 || player.itemAnimation == 6 || player.itemAnimation == 10) && this.owner == Main.myPlayer) { - Vector2 vector2_4 = (spinningpoint4 + Main.rand.NextVector2Square(-0.2f, 0.2f)) * 12f; + Vector2 vector2_3 = (spinningpoint4 + Main.rand.NextVector2Square(-0.2f, 0.2f)) * 12f; switch (player.itemAnimation) { case 2: - vector2_4 = spinningpoint4.RotatedBy(0.383972465991974); + vector2_3 = spinningpoint4.RotatedBy(0.383972465991974); break; case 6: - vector2_4 = spinningpoint4.RotatedBy(-0.383972465991974); + vector2_3 = spinningpoint4.RotatedBy(-0.383972465991974); break; case 10: - vector2_4 = spinningpoint4.RotatedBy(0.0); + vector2_3 = spinningpoint4.RotatedBy(0.0); break; } - Projectile.NewProjectile(this.Center, vector2_4 * (10f + (float) Main.rand.Next(4)), 709, this.damage, 0.0f, this.owner); + Projectile.NewProjectile(this.Center, vector2_3 * (10f + (float) Main.rand.Next(4)), 709, this.damage, 0.0f, this.owner); } for (int index = 0; index < 3; index += 2) { @@ -28676,11 +20094,11 @@ label_26: if ((double) this.ai[0] == 0.0) { float[] localAi = this.localAI; - slotId = SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_GhastlyGlaiveImpactGhost, this.Center); + slotId = Main.PlayTrackedSound((SoundStyle) SoundID.DD2_GhastlyGlaiveImpactGhost, this.Center); double num = (double) ((SlotId) ref slotId).ToFloat(); localAi[1] = (float) num; } - ActiveSound activeSound = SoundEngine.GetActiveSound(SlotId.FromFloat(this.localAI[1])); + ActiveSound activeSound = Main.GetActiveSound(SlotId.FromFloat(this.localAI[1])); if (activeSound == null) { float[] localAi = this.localAI; @@ -28740,9 +20158,6 @@ label_26: int num3 = 4; int num4 = Main.projFrames[this.type]; int num5 = 0; - float num6 = 0.08f; - bool flag1 = false; - float num7 = 0.1f; Vector2 vector2_1 = new Vector2((float) (player.direction * 30), -20f); if (player.dead) { @@ -28750,25 +20165,25 @@ label_26: } else { - bool flag2 = true; + bool flag = true; switch (this.type) { case 701: - if (player.petFlagDD2Dragon) + if (Main.myPlayer == this.owner && player.petFlagDD2Dragon) { this.timeLeft = 2; break; } break; case 702: - if (player.petFlagDD2Ghost) + if (Main.myPlayer == this.owner && player.petFlagDD2Ghost) this.timeLeft = 2; vector2_1.Y += (float) Math.Cos((double) this.localAI[0] * 0.0523598790168762) * 2f; num3 = 4; num2 = 10; - flag2 = false; + flag = false; num1 = 6f; - Vector2 vector2_2 = new Vector2(this.spriteDirection == -1 ? -6f : -2f, -26f).RotatedBy((double) this.rotation); + Vector2 vector2_2 = new Vector2(this.spriteDirection == -1 ? -6f : -2f, -20f).RotatedBy((double) this.rotation); if (Main.rand.Next(24) == 0) { Dust dust = Dust.NewDustDirect(this.Center + vector2_2, 4, 4, 135, Alpha: 100); @@ -28785,13 +20200,13 @@ label_26: dust.scale += (float) (0.100000001490116 + (double) Main.rand.NextFloat() * 0.600000023841858); } DelegateMethods.v3_1 = new Vector3(0.3f, 0.5f, 1f); - Utils.PlotTileLine(this.Center, this.Center + this.velocity * 6f, 20f, new Utils.TileActionAttempt(DelegateMethods.CastLightOpen)); - Utils.PlotTileLine(this.Left, this.Right, 20f, new Utils.TileActionAttempt(DelegateMethods.CastLightOpen)); - Utils.PlotTileLine(player.Center, player.Center + player.velocity * 6f, 40f, new Utils.TileActionAttempt(DelegateMethods.CastLightOpen)); - Utils.PlotTileLine(player.Left, player.Right, 40f, new Utils.TileActionAttempt(DelegateMethods.CastLightOpen)); + Utils.PlotTileLine(this.Center, this.Center + this.velocity * 6f, 20f, new Utils.PerLinePoint(DelegateMethods.CastLightOpen)); + Utils.PlotTileLine(this.Left, this.Right, 20f, new Utils.PerLinePoint(DelegateMethods.CastLightOpen)); + Utils.PlotTileLine(player.Center, player.Center + player.velocity * 6f, 40f, new Utils.PerLinePoint(DelegateMethods.CastLightOpen)); + Utils.PlotTileLine(player.Left, player.Right, 40f, new Utils.PerLinePoint(DelegateMethods.CastLightOpen)); break; case 703: - if (player.petFlagDD2Gato) + if (Main.myPlayer == this.owner && player.petFlagDD2Gato) this.timeLeft = 2; vector2_1.Y += (float) Math.Cos((double) this.localAI[0] * 0.104719758033752) * 2f; num2 = 4; @@ -28799,77 +20214,36 @@ label_26: num1 = 3f; num4 = 4; break; - case 764: - num7 = 0.025f; - num6 = 0.04f; - flag1 = true; - ++this.localAI[0]; - if ((double) this.localAI[0] > 120.0) - this.localAI[0] = 0.0f; - this.localAI[1] += this.velocity.X * 0.01f; - this.localAI[1] += 0.008333334f; - if ((double) this.localAI[1] < -6.28318548202515) - this.localAI[1] += 6.283185f; - if ((double) this.localAI[1] > 6.28318548202515) - this.localAI[1] -= 6.283185f; - if ((double) this.velocity.Length() < 4.0) - { - this.localAI[1] *= 0.9f; - if ((double) this.velocity.Length() > 0.100000001490116 && Main.rand.Next(30) == 0) - { - Dust dust = Dust.NewDustDirect(this.position - this.velocity, this.width, this.height, 292, this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 150); - dust.velocity *= 0.3f; - dust.noLightEmittence = true; - } - } - else - { - Vector2 vector2_3 = new Vector2((float) Main.screenWidth, (float) Main.screenHeight); - this.Hitbox.Intersects(Utils.CenteredRectangle(Main.screenPosition + vector2_3 / 2f, vector2_3 + new Vector2(400f))); - if (Main.rand.Next(15) == 0) - Dust.NewDustDirect(this.position - this.velocity, this.width, this.height, 292, this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 150, Scale: 0.9f).noLightEmittence = true; - } - float amount = (float) ((double) this.localAI[0] / 120.0 * 2.0); - if ((double) amount > 1.0) - amount = 2f - amount; - this.Opacity = MathHelper.Lerp(0.4f, 0.75f, amount); - vector2_1.Y += (float) Math.Cos((double) this.localAI[0] / 120.0 * 6.28318548202515) * 2f; - if (player.petFlagUpbeatStar) - { - this.timeLeft = 2; - break; - } - break; } - if (flag2 && (player.suspiciouslookingTentacle || player.petFlagDD2Ghost)) + if (flag && (player.suspiciouslookingTentacle || player.petFlagDD2Ghost)) vector2_1.X += (float) (-player.direction * 64); this.direction = this.spriteDirection = player.direction; - Vector2 vector2_4 = player.MountedCenter + vector2_1; - double num8 = (double) Vector2.Distance(this.Center, vector2_4); - if (num8 > 1000.0) + Vector2 vector2_3 = player.MountedCenter + vector2_1; + double num6 = (double) Vector2.Distance(this.Center, vector2_3); + if (num6 > 1000.0) this.Center = player.Center + vector2_1; - Vector2 vector2_5 = vector2_4 - this.Center; - if (num8 < (double) num1) + Vector2 vector2_4 = vector2_3 - this.Center; + if (num6 < (double) num1) this.velocity = this.velocity * 0.25f; - if (vector2_5 != Vector2.Zero) + if (vector2_4 != Vector2.Zero) { - if ((double) vector2_5.Length() < (double) num1 * 0.5) - this.velocity = vector2_5; + if ((double) vector2_4.Length() < (double) num1 * 0.5) + this.velocity = vector2_4; else - this.velocity = vector2_5 * num7; + this.velocity = vector2_4 * 0.1f; } if ((double) this.velocity.Length() > 6.0) { - float num9 = (float) ((double) this.velocity.X * (double) num6 + (double) this.velocity.Y * (double) this.spriteDirection * 0.0199999995529652); - if ((double) Math.Abs(this.rotation - num9) >= 3.14159274101257) + float num7 = (float) ((double) this.velocity.X * 0.0799999982118607 + (double) this.velocity.Y * (double) this.spriteDirection * 0.0199999995529652); + if ((double) Math.Abs(this.rotation - num7) >= 3.14159274101257) { - if ((double) num9 < (double) this.rotation) + if ((double) num7 < (double) this.rotation) this.rotation -= 6.283185f; else this.rotation += 6.283185f; } - float num10 = 12f; - this.rotation = (this.rotation * (num10 - 1f) + num9) / num10; + float num8 = 12f; + this.rotation = (this.rotation * (num8 - 1f) + num7) / num8; if (++this.frameCounter >= num3) { this.frameCounter = 0; @@ -28892,8 +20266,6 @@ label_26: this.frame = num5; } } - if (flag1) - return; ++this.localAI[0]; if ((double) this.localAI[0] <= 120.0) return; @@ -28909,11 +20281,11 @@ label_26: { this.soundDelay = -1; float[] localAi = this.localAI; - slotId = SoundEngine.PlayTrackedSound((SoundStyle) SoundID.DD2_BookStaffTwisterLoop, this.Center); + slotId = Main.PlayTrackedSound((SoundStyle) SoundID.DD2_BookStaffTwisterLoop, this.Center); double num2 = (double) ((SlotId) ref slotId).ToFloat(); localAi[1] = (float) num2; } - ActiveSound activeSound = SoundEngine.GetActiveSound(SlotId.FromFloat(this.localAI[1])); + ActiveSound activeSound = Main.GetActiveSound(SlotId.FromFloat(this.localAI[1])); if (activeSound != null) { activeSound.Position = this.Center; @@ -29058,302 +20430,4908 @@ label_26: return flag; } - private Point GetScarabBombDigDirectionSnap8() - { - Vector2 vector2 = this.DirectionTo(Main.player[this.owner].Center); - Point point = new Point((double) vector2.X > 0.0 ? -1 : 1, (double) vector2.Y > 0.0 ? -1 : 1); - if ((double) Math.Abs(vector2.X) > (double) Math.Abs(vector2.Y) * 2.0) - point.Y = 0; - else if ((double) Math.Abs(vector2.Y) > (double) Math.Abs(vector2.X) * 2.0) - point.X = 0; - return point; - } - - public Color GetFirstFractalColor() => Main.hslToRgb(this.ai[1], 1f, 0.5f); - - public void Kill_DirtAndFluidProjectiles_RunDelegateMethodPushUpForHalfBricks( - Point pt, - float size, - Utils.TileActionAttempt plot) - { - Tile tile = Main.tile[pt.X, pt.Y]; - if (tile != null && tile.active() && tile.halfBrick()) - { - int index = pt.Y - 1; - if (index >= 0 && !WorldGen.SolidOrSlopedTile(Main.tile[pt.X, index])) - --pt.Y; - } - DelegateMethods.v2_1 = pt.ToVector2(); - DelegateMethods.f_1 = size; - Utils.PlotTileArea(pt.X, pt.Y, plot); - } - public void Kill() { - // ISSUE: The method is too long to display (51354 instructions) - } - - private void DoRainbowCrystalStaffExplosion() - { - Vector2 spinningpoint = new Vector2(0.0f, -3f).RotatedByRandom(3.14159274101257); - float num1 = (float) Main.rand.Next(7, 13); - Vector2 vector2 = new Vector2(2.1f, 2f); - Color rgb = Main.hslToRgb(this.ai[0], 1f, 0.5f); - rgb.A = byte.MaxValue; - for (float num2 = 0.0f; (double) num2 < (double) num1; ++num2) + if (!this.active) + return; + Main.projectileIdentity[this.owner, this.identity] = -1; + int timeLeft = this.timeLeft; + this.timeLeft = 0; + if (this.type == 686) + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_BetsyFireballImpact, this.Center); + else if (this.type == 711) + Main.PlayTrackedSound((SoundStyle) SoundID.DD2_BetsysWrathImpact, this.Center); + else if (this.type == 704) { - int dustIndex = Dust.NewDust(this.Center, 0, 0, 267, newColor: rgb); - Main.dust[dustIndex].position = this.Center; - Main.dust[dustIndex].velocity = spinningpoint.RotatedBy(6.28318548202515 * (double) num2 / (double) num1) * vector2 * (float) (0.800000011920929 + (double) Main.rand.NextFloat() * 0.400000005960464); - Main.dust[dustIndex].noGravity = true; - Main.dust[dustIndex].scale = 2f; - Main.dust[dustIndex].fadeIn = Main.rand.NextFloat() * 2f; - if (dustIndex != 6000) + ActiveSound activeSound = Main.GetActiveSound(SlotId.FromFloat(this.localAI[1])); + if (activeSound != null) { - Dust dust = Dust.CloneDust(dustIndex); - dust.scale /= 2f; - dust.fadeIn /= 2f; - dust.color = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); + activeSound.Volume = 0.0f; + activeSound.Stop(); } } - for (float num3 = 0.0f; (double) num3 < (double) num1; ++num3) + if (this.type == 710) { - int dustIndex = Dust.NewDust(this.Center, 0, 0, 267, newColor: rgb); - Main.dust[dustIndex].position = this.Center; - Main.dust[dustIndex].velocity = spinningpoint.RotatedBy(6.28318548202515 * (double) num3 / (double) num1) * vector2 * (float) (0.800000011920929 + (double) Main.rand.NextFloat() * 0.400000005960464); - Main.dust[dustIndex].velocity *= Main.rand.NextFloat() * 0.8f; - Main.dust[dustIndex].noGravity = true; - Main.dust[dustIndex].scale = Main.rand.NextFloat() * 1f; - Main.dust[dustIndex].fadeIn = Main.rand.NextFloat() * 2f; - if (dustIndex != 6000) + this.ai[1] = -1f; + this.position = this.Center; + this.width = this.height = 40; + this.Center = this.position; + this.Damage(); + Main.PlaySound(SoundID.Item14, this.position); + for (int index1 = 0; index1 < 2; ++index1) { - Dust dust = Dust.CloneDust(dustIndex); - dust.scale /= 2f; - dust.fadeIn /= 2f; - dust.color = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); + int index2 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); + Main.dust[index2].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; + } + for (int index3 = 0; index3 < 10; ++index3) + { + int index4 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Scale: 2.5f); + Main.dust[index4].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; + Main.dust[index4].noGravity = true; + Main.dust[index4].velocity *= 2f; + } + for (int index5 = 0; index5 < 5; ++index5) + { + int index6 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Scale: 1.5f); + Main.dust[index6].position = this.Center + Vector2.UnitX.RotatedByRandom(3.14159274101257).RotatedBy((double) this.velocity.ToRotation()) * (float) this.width / 2f; + Main.dust[index6].noGravity = true; + Main.dust[index6].velocity *= 2f; } } - } - - private bool ShouldWallExplode( - Vector2 compareSpot, - int radius, - int minI, - int maxI, - int minJ, - int maxJ) - { - bool flag = false; - for (int index1 = minI; index1 <= maxI; ++index1) + else if (this.type == 711) { - for (int index2 = minJ; index2 <= maxJ; ++index2) + Microsoft.Xna.Framework.Rectangle hitbox = this.Hitbox; + for (int index7 = 0; index7 < this.oldPos.Length / 2; index7 += 2) { - double num1 = (double) Math.Abs((float) index1 - compareSpot.X / 16f); - float num2 = Math.Abs((float) index2 - compareSpot.Y / 16f); - if (Math.Sqrt(num1 * num1 + (double) num2 * (double) num2) < (double) radius && Main.tile[index1, index2] != null && Main.tile[index1, index2].wall == (ushort) 0) + hitbox.X = (int) this.oldPos[index7].X; + hitbox.Y = (int) this.oldPos[index7].Y; + for (int index8 = 0; index8 < 2; ++index8) { - flag = true; - break; + int Type = Utils.SelectRandom(Main.rand, 6, 55, 158); + int index9 = Dust.NewDust(hitbox.TopLeft(), this.width, this.height, Type, (float) this.direction, -2.5f); + Main.dust[index9].alpha = 200; + Main.dust[index9].velocity *= 2.4f; + Main.dust[index9].scale += Main.rand.NextFloat(); + Main.dust[index9].scale -= 0.5f; + if (Main.dust[index9].type == 55) + Main.dust[index9].color = Color.Lerp(new Color(128, 0, 180, 128), Color.Gold, Main.rand.NextFloat()); + Main.dust[index9].noLight = true; } } - } - return flag; - } - - public Color GetFloatingDaggerMinionGlowColor() => Main.hslToRgb((float) (0.660000026226044 + 0.330000013113022 * (double) ((float) (this.whoAmI % 6) / 6f)), 0.7f, 0.6f) * 0.7f; - - private bool CanExplodeTile(int x, int y) - { - if (Main.tileDungeon[(int) Main.tile[x, y].type] || TileID.Sets.BasicChest[(int) Main.tile[x, y].type]) - return false; - switch (Main.tile[x, y].type) - { - case 26: - case 37: - case 88: - case 107: - case 108: - case 111: - case 211: - case 221: - case 222: - case 223: - case 226: - case 237: - return false; - case 58: - if (!Main.hardMode) - return false; - break; - case 77: - if (!Main.hardMode && y >= Main.UnderworldLayer) - return false; - break; - case 137: - if (!NPC.downedGolemBoss) + for (int index10 = 10; index10 < this.oldPos.Length; index10 += 2) + { + hitbox.X = (int) this.oldPos[index10].X; + hitbox.Y = (int) this.oldPos[index10].Y; + for (int index11 = 0; index11 < 2; ++index11) { - switch ((int) Main.tile[x, y].frameY / 18) + if (Main.rand.Next(3) != 0) { - case 1: - case 2: - case 3: - case 4: - return false; + int Type = Utils.SelectRandom(Main.rand, 55); + int index12 = Dust.NewDust(hitbox.TopLeft(), this.width, this.height, Type, (float) this.direction, -2.5f); + Main.dust[index12].alpha = 120; + Main.dust[index12].velocity *= 2.4f; + Main.dust[index12].scale += Main.rand.NextFloat() * 0.7f; + Main.dust[index12].scale -= 0.5f; + if (Main.dust[index12].type == 55) + Main.dust[index12].color = Color.Lerp(Color.Purple, Color.Black, Main.rand.NextFloat()); + Main.dust[index12].noLight = true; } } + } + for (int index13 = 5; index13 < this.oldPos.Length; ++index13) + { + hitbox.X = (int) this.oldPos[index13].X; + hitbox.Y = (int) this.oldPos[index13].Y; + for (int index14 = 0; index14 < 1; ++index14) + { + if (Main.rand.Next(3) != 0) + { + int Type = Utils.SelectRandom(Main.rand, 55); + int index15 = Dust.NewDust(hitbox.TopLeft(), this.width, this.height, Type, (float) this.direction, -2.5f); + Main.dust[index15].alpha = 80; + Main.dust[index15].velocity *= 0.3f; + Main.dust[index15].velocity += this.velocity * 0.5f; + Main.dust[index15].scale += Main.rand.NextFloat() * 0.7f; + Main.dust[index15].scale -= 0.5f; + if (Main.dust[index15].type == 55) + Main.dust[index15].color = Color.Lerp(Color.Purple, Color.Black, Main.rand.NextFloat()); + Main.dust[index15].noLight = true; + } + } + } + for (int index = 0; index < 20; ++index) + { + if (Main.rand.Next(3) != 0) + { + int Type = 228; + Dust dust = Main.dust[Dust.NewDust(this.position, this.width, this.height, Type)]; + dust.noGravity = true; + dust.scale = 1.25f + Main.rand.NextFloat(); + dust.fadeIn = 1.5f; + dust.velocity *= 6f; + dust.noLight = true; + } + } + for (int index = 0; index < 20; ++index) + { + if (Main.rand.Next(3) != 0) + { + int Type = 55; + Dust dust = Main.dust[Dust.NewDust(this.position, this.width, this.height, Type)]; + dust.noGravity = true; + dust.scale = 1.25f + Main.rand.NextFloat(); + dust.fadeIn = 1.5f; + dust.velocity *= 6f; + dust.noLight = true; + dust.color = new Color(0, 0, 220, 128); + } + } + if (this.owner == Main.myPlayer) + { + this.position = this.Center; + this.Size = new Vector2(140f); + this.Center = this.position; + this.penetrate = -1; + this.usesLocalNPCImmunity = true; + this.localNPCHitCooldown = -1; + this.Damage(); + } + } + else if (this.type == 662 || this.type == 685) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + Vector2 vector2 = this.oldVelocity.SafeNormalize(Vector2.Zero); + Vector2 Position = this.position + vector2 * 16f; + for (int index = 0; index < 16; ++index) + { + if (Main.rand.Next(2) == 0) + { + Position -= vector2 * 8f; + } else - break; - break; - } - return true; - } - - private void ExplodeTiles( - Vector2 compareSpot, - int radius, - int minI, - int maxI, - int minJ, - int maxJ, - bool wallSplode) - { - AchievementsHelper.CurrentlyMining = true; - for (int index1 = minI; index1 <= maxI; ++index1) - { - for (int index2 = minJ; index2 <= maxJ; ++index2) - { - double num1 = (double) Math.Abs((float) index1 - compareSpot.X / 16f); - float num2 = Math.Abs((float) index2 - compareSpot.Y / 16f); - if (Math.Sqrt(num1 * num1 + (double) num2 * (double) num2) < (double) radius) { - bool flag = true; - if (Main.tile[index1, index2] != null && Main.tile[index1, index2].active()) + Dust dust = Dust.NewDustDirect(Position, this.width, this.height, 11); + dust.position = (dust.position + this.Center) / 2f; + dust.velocity += this.oldVelocity * 0.4f; + dust.velocity *= 0.5f; + dust.noGravity = true; + Position -= vector2 * 8f; + } + } + } + if (this.type == 680) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + Vector2 vector2 = this.oldVelocity.SafeNormalize(Vector2.Zero); + Vector2 Position = this.position + vector2 * 16f; + for (int index = 0; index < 16; ++index) + { + if (Main.rand.Next(2) == 0) + { + Position -= vector2 * 8f; + } + else + { + Dust dust = Dust.NewDustDirect(Position, this.width, this.height, 11); + dust.position = (dust.position + this.Center) / 2f; + dust.velocity += this.oldVelocity * 0.4f; + dust.velocity *= 0.5f; + dust.noGravity = true; + Position -= vector2 * 8f; + } + } + Dust.NewDustDirect(this.position, this.width, this.height, 11, newColor: Color.Red, Scale: 1.6f).noGravity = true; + } + if (this.type == 664 || this.type == 666 || this.type == 668 || this.type == 706) + { + int num1 = 4; + int num2 = 20; + int num3 = 10; + int num4 = 20; + int num5 = 20; + int num6 = 4; + float num7 = 1.5f; + int num8 = 6; + int Type = 6; + if (Main.player[this.owner].setApprenticeT3) + { + num1 += 4; + num5 += 10; + num2 += 20; + num4 += 30; + num3 /= 2; + num6 += 4; + num7 += 0.5f; + num8 += 7; + Type = 270; + } + this.position = this.Center; + this.width = this.height = 16 * num8; + this.Center = this.position; + this.Damage(); + Main.PlaySound(SoundID.Item100, this.position); + for (int index16 = 0; index16 < num1; ++index16) + { + int index17 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); + Main.dust[index17].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; + } + for (int index = 0; index < num2; ++index) + { + Dust dust = Dust.NewDustDirect(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 200, Scale: 2.5f); + dust.position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 10f; + dust.velocity *= 16f; + if ((double) dust.velocity.Y > -2.0) + dust.velocity.Y *= -0.4f; + dust.noLight = true; + dust.noGravity = true; + } + for (int index = 0; index < num4; ++index) + { + Dust dust = Dust.NewDustDirect(new Vector2(this.position.X, this.position.Y), this.width, this.height, Type, Alpha: 100, Scale: 1.5f); + dust.position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; + dust.velocity *= 2f; + dust.noGravity = true; + dust.fadeIn = num7; + } + for (int index18 = 0; index18 < num3; ++index18) + { + int index19 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Scale: 2.7f); + Main.dust[index19].position = this.Center + Vector2.UnitX.RotatedByRandom(3.14159274101257).RotatedBy((double) this.velocity.ToRotation()) * (float) this.width / 2f; + Main.dust[index19].noGravity = true; + Main.dust[index19].velocity *= 3f; + } + for (int index20 = 0; index20 < num5; ++index20) + { + int index21 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Scale: 1.5f); + Main.dust[index21].position = this.Center + Vector2.UnitX.RotatedByRandom(3.14159274101257).RotatedBy((double) this.velocity.ToRotation()) * (float) this.width / 2f; + Main.dust[index21].noGravity = true; + Main.dust[index21].velocity *= 3f; + } + for (int index22 = 0; index22 < num6; ++index22) + { + int index23 = Gore.NewGore(this.position + new Vector2((float) (this.width * Main.rand.Next(100)) / 100f, (float) (this.height * Main.rand.Next(100)) / 100f) - Vector2.One * 10f, new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index23].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; + Main.gore[index23].position -= Vector2.One * 16f; + if (Main.rand.Next(2) == 0) + Main.gore[index23].position.Y -= 30f; + Main.gore[index23].velocity *= 0.3f; + Main.gore[index23].velocity.X += (float) Main.rand.Next(-10, 11) * 0.05f; + Main.gore[index23].velocity.Y += (float) Main.rand.Next(-10, 11) * 0.05f; + } + } + else if (this.type == 681) + { + this.position.X += (float) (this.width / 2); + this.position.Y += (float) (this.height / 2); + Main.PlaySound(SoundID.DD2_GoblinBomb, this.position); + this.width = 22; + this.height = 22; + this.position.X -= (float) (this.width / 2); + this.position.Y -= (float) (this.height / 2); + for (int index24 = 0; index24 < 10; ++index24) + { + int index25 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); + Main.dust[index25].velocity *= 1.4f; + int index26 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 1.5f); + Main.dust[index26].velocity *= 1.4f; + Main.dust[index26].noGravity = true; + Main.dust[index26].fadeIn = 2f; + } + for (int index27 = 0; index27 < 10; ++index27) + { + int index28 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 2.5f); + Main.dust[index28].noGravity = true; + Main.dust[index28].velocity *= 5f; + int index29 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 1.5f); + Main.dust[index29].velocity *= 3f; + } + int index30 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index30].velocity *= 0.4f; + ++Main.gore[index30].velocity.X; + ++Main.gore[index30].velocity.Y; + int index31 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index31].velocity *= 0.4f; + --Main.gore[index31].velocity.X; + ++Main.gore[index31].velocity.Y; + int index32 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index32].velocity *= 0.4f; + ++Main.gore[index32].velocity.X; + --Main.gore[index32].velocity.Y; + int index33 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index33].velocity *= 0.4f; + --Main.gore[index33].velocity.X; + --Main.gore[index33].velocity.Y; + this.position.X += (float) (this.width / 2); + this.position.Y += (float) (this.height / 2); + this.width = 80; + this.height = 80; + this.position.X -= (float) (this.width / 2); + this.position.Y -= (float) (this.height / 2); + this.Damage(); + } + if (this.type == 669) + { + Main.PlaySound(13, (int) this.position.X, (int) this.position.Y); + Vector2 vector2 = new Vector2(20f, 20f); + for (int index = 0; index < 10; ++index) + Dust.NewDustDirect(this.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, 4, Alpha: 100, newColor: new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 110), Scale: 1.1f).velocity *= 1.4f; + for (int index = 0; index < 40; ++index) + { + Dust dust = Dust.NewDustDirect(this.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, 4, Alpha: 50, newColor: new Color(245, 200, 30, 155), Scale: 1.2f); + dust.noGravity = true; + dust.velocity *= 4f; + Dust.NewDustDirect(this.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, 4, Alpha: 50, newColor: new Color(245, 200, 30, 155), Scale: 0.8f).velocity *= 2f; + } + } + if (this.type == 634 || this.type == 635) + { + int num9 = Utils.SelectRandom(Main.rand, 242, 73, 72, 71, (int) byte.MaxValue); + int Type1 = (int) byte.MaxValue; + int Type2 = (int) byte.MaxValue; + int num10 = 50; + float Scale1 = 1.7f; + float Scale2 = 0.8f; + float Scale3 = 2f; + Vector2 vector2 = (this.rotation - 1.570796f).ToRotationVector2() * this.velocity.Length() * (float) this.MaxUpdates; + if (this.type == 635) + { + Type1 = 88; + Type2 = 88; + num9 = Utils.SelectRandom(Main.rand, 242, 59, 88); + Scale1 = 3.7f; + Scale2 = 1.5f; + Scale3 = 2.2f; + vector2 *= 0.5f; + } + Main.PlaySound(SoundID.Item14, this.position); + this.position = this.Center; + this.width = this.height = num10; + this.Center = this.position; + this.maxPenetrate = -1; + this.penetrate = -1; + this.Damage(); + for (int index34 = 0; index34 < 40; ++index34) + { + int Type3 = Utils.SelectRandom(Main.rand, 242, 73, 72, 71, (int) byte.MaxValue); + if (this.type == 635) + Type3 = Utils.SelectRandom(Main.rand, 242, 59, 88); + int index35 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, Type3, Alpha: 200, Scale: Scale1); + Main.dust[index35].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; + Main.dust[index35].noGravity = true; + Main.dust[index35].velocity *= 3f; + Main.dust[index35].velocity += vector2 * Main.rand.NextFloat(); + int index36 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, Type1, Alpha: 100, Scale: Scale2); + Main.dust[index36].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; + Main.dust[index36].velocity *= 2f; + Main.dust[index36].noGravity = true; + Main.dust[index36].fadeIn = 1f; + Main.dust[index36].color = Color.Crimson * 0.5f; + Main.dust[index36].velocity += vector2 * Main.rand.NextFloat(); + } + for (int index37 = 0; index37 < 20; ++index37) + { + int index38 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, Type2, Scale: Scale3); + Main.dust[index38].position = this.Center + Vector2.UnitX.RotatedByRandom(3.14159274101257).RotatedBy((double) this.velocity.ToRotation()) * (float) this.width / 3f; + Main.dust[index38].noGravity = true; + Main.dust[index38].velocity *= 0.5f; + Main.dust[index38].velocity += vector2 * (float) (0.600000023841858 + 0.600000023841858 * (double) Main.rand.NextFloat()); + } + } + else if (this.type == 651) + { + if ((double) this.localAI[0] == 1.0 && this.owner == Main.myPlayer) + { + Player master = Main.player[this.owner]; + Point point = new Vector2(this.ai[0], this.ai[1]).ToPoint(); + Point tileCoordinates = this.Center.ToTileCoordinates(); + if (Main.netMode == 1) + NetMessage.SendData(109, number: point.X, number2: ((float) point.Y), number3: ((float) tileCoordinates.X), number4: ((float) tileCoordinates.Y), number5: ((int) WiresUI.Settings.ToolMode)); + else + Wiring.MassWireOperation(point, tileCoordinates, master); + } + } + else if (this.type == 641) + { + if (this.owner == Main.myPlayer) + { + for (int index = 0; index < 1000; ++index) + { + if (Main.projectile[index].active && Main.projectile[index].owner == this.owner && Main.projectile[index].type == 642) + Main.projectile[index].Kill(); + } + } + } + else if (this.type == 643) + { + if (this.owner == Main.myPlayer) + { + for (int index = 0; index < 1000; ++index) + { + if (Main.projectile[index].active && Main.projectile[index].owner == this.owner && Main.projectile[index].type == 644) + Main.projectile[index].Kill(); + } + } + } + else if (this.type == 645) + { + bool flag = WorldGen.SolidTile(Framing.GetTileSafely((int) this.position.X / 16, (int) this.position.Y / 16)); + for (int index = 0; index < 4; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); + for (int index39 = 0; index39 < 4; ++index39) + { + int index40 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 229, Scale: 2.5f); + Main.dust[index40].noGravity = true; + Main.dust[index40].velocity *= 3f; + if (flag) + Main.dust[index40].noLight = true; + int index41 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 229, Alpha: 100, Scale: 1.5f); + Main.dust[index41].velocity *= 2f; + Main.dust[index41].noGravity = true; + if (flag) + Main.dust[index41].noLight = true; + } + for (int index42 = 0; index42 < 1; ++index42) + { + int index43 = Gore.NewGore(this.position + new Vector2((float) (this.width * Main.rand.Next(100)) / 100f, (float) (this.height * Main.rand.Next(100)) / 100f) - Vector2.One * 10f, new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index43].velocity *= 0.3f; + Main.gore[index43].velocity.X += (float) Main.rand.Next(-10, 11) * 0.05f; + Main.gore[index43].velocity.Y += (float) Main.rand.Next(-10, 11) * 0.05f; + } + } + else if (this.type == 636) + { + Microsoft.Xna.Framework.Rectangle hitbox = this.Hitbox; + for (int index44 = 0; index44 < 6; index44 += 3) + { + hitbox.X = (int) this.oldPos[index44].X; + hitbox.Y = (int) this.oldPos[index44].Y; + for (int index45 = 0; index45 < 5; ++index45) + { + int Type = Utils.SelectRandom(Main.rand, 6, 259, 158); + int index46 = Dust.NewDust(hitbox.TopLeft(), this.width, this.height, Type, 2.5f * (float) this.direction, -2.5f); + Main.dust[index46].alpha = 200; + Main.dust[index46].velocity *= 2.4f; + Main.dust[index46].scale += Main.rand.NextFloat(); + } + } + } + else if (this.type == 614) + { + for (int index = 0; index < 10; ++index) + { + Dust dust = Main.dust[Dust.NewDust(this.position, this.width, this.height, 229)]; + dust.noGravity = true; + dust.velocity *= 3f; + } + } + if (this.type == 644) + { + Vector2 spinningpoint = new Vector2(0.0f, -3f).RotatedByRandom(3.14159274101257); + float num11 = (float) Main.rand.Next(7, 13); + Vector2 vector2 = new Vector2(2.1f, 2f); + Color rgb = Main.hslToRgb(this.ai[0], 1f, 0.5f); + rgb.A = byte.MaxValue; + for (float num12 = 0.0f; (double) num12 < (double) num11; ++num12) + { + int dustIndex = Dust.NewDust(this.Center, 0, 0, 267, newColor: rgb); + Main.dust[dustIndex].position = this.Center; + Main.dust[dustIndex].velocity = spinningpoint.RotatedBy(6.28318548202515 * (double) num12 / (double) num11) * vector2 * (float) (0.800000011920929 + (double) Main.rand.NextFloat() * 0.400000005960464); + Main.dust[dustIndex].noGravity = true; + Main.dust[dustIndex].scale = 2f; + Main.dust[dustIndex].fadeIn = Main.rand.NextFloat() * 2f; + Dust dust = Dust.CloneDust(dustIndex); + dust.scale /= 2f; + dust.fadeIn /= 2f; + dust.color = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); + } + for (float num13 = 0.0f; (double) num13 < (double) num11; ++num13) + { + int dustIndex = Dust.NewDust(this.Center, 0, 0, 267, newColor: rgb); + Main.dust[dustIndex].position = this.Center; + Main.dust[dustIndex].velocity = spinningpoint.RotatedBy(6.28318548202515 * (double) num13 / (double) num11) * vector2 * (float) (0.800000011920929 + (double) Main.rand.NextFloat() * 0.400000005960464); + Main.dust[dustIndex].velocity *= Main.rand.NextFloat() * 0.8f; + Main.dust[dustIndex].noGravity = true; + Main.dust[dustIndex].scale = Main.rand.NextFloat() * 1f; + Main.dust[dustIndex].fadeIn = Main.rand.NextFloat() * 2f; + Dust dust = Dust.CloneDust(dustIndex); + dust.scale /= 2f; + dust.fadeIn /= 2f; + dust.color = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); + } + if (Main.myPlayer == this.owner) + { + this.friendly = true; + int width = this.width; + int height = this.height; + int penetrate = this.penetrate; + this.position = this.Center; + this.width = this.height = 60; + this.Center = this.position; + this.penetrate = -1; + this.maxPenetrate = -1; + this.Damage(); + this.penetrate = penetrate; + this.position = this.Center; + this.width = width; + this.height = height; + this.Center = this.position; + } + } + if (this.type == 608) + { + this.maxPenetrate = -1; + this.penetrate = -1; + this.Damage(); + Main.PlaySound(SoundID.Item14, this.position); + for (int index47 = 0; index47 < 4; ++index47) + { + int index48 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); + Main.dust[index48].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; + } + for (int index49 = 0; index49 < 30; ++index49) + { + int index50 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 200, Scale: 3.7f); + Main.dust[index50].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; + Main.dust[index50].noGravity = true; + Main.dust[index50].velocity *= 3f; + Main.dust[index50].shader = GameShaders.Armor.GetSecondaryShader(Main.player[this.owner].ArmorSetDye(), Main.player[this.owner]); + int index51 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 1.5f); + Main.dust[index51].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; + Main.dust[index51].velocity *= 2f; + Main.dust[index51].noGravity = true; + Main.dust[index51].fadeIn = 2.5f; + Main.dust[index51].shader = GameShaders.Armor.GetSecondaryShader(Main.player[this.owner].ArmorSetDye(), Main.player[this.owner]); + } + for (int index52 = 0; index52 < 10; ++index52) + { + int index53 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Scale: 2.7f); + Main.dust[index53].position = this.Center + Vector2.UnitX.RotatedByRandom(3.14159274101257).RotatedBy((double) this.velocity.ToRotation()) * (float) this.width / 2f; + Main.dust[index53].noGravity = true; + Main.dust[index53].velocity *= 3f; + Main.dust[index53].shader = GameShaders.Armor.GetSecondaryShader(Main.player[this.owner].ArmorSetDye(), Main.player[this.owner]); + } + for (int index54 = 0; index54 < 10; ++index54) + { + int index55 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Scale: 1.5f); + Main.dust[index55].position = this.Center + Vector2.UnitX.RotatedByRandom(3.14159274101257).RotatedBy((double) this.velocity.ToRotation()) * (float) this.width / 2f; + Main.dust[index55].noGravity = true; + Main.dust[index55].velocity *= 3f; + } + for (int index56 = 0; index56 < 2; ++index56) + { + int index57 = Gore.NewGore(this.position + new Vector2((float) (this.width * Main.rand.Next(100)) / 100f, (float) (this.height * Main.rand.Next(100)) / 100f) - Vector2.One * 10f, new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index57].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; + Main.gore[index57].velocity *= 0.3f; + Main.gore[index57].velocity.X += (float) Main.rand.Next(-10, 11) * 0.05f; + Main.gore[index57].velocity.Y += (float) Main.rand.Next(-10, 11) * 0.05f; + } + } + else if (this.type == 661) + { + this.position = this.Center; + this.width = this.height = 160; + this.Center = this.position; + this.maxPenetrate = -1; + this.penetrate = -1; + this.Damage(); + Main.PlaySound(SoundID.Item14, this.position); + Vector2 Position = this.Center + Vector2.One * -20f; + int Width = 40; + int Height = Width; + for (int index58 = 0; index58 < 4; ++index58) + { + int index59 = Dust.NewDust(Position, Width, Height, 240, Alpha: 100, Scale: 1.5f); + Main.dust[index59].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) Width / 2f; + } + for (int index60 = 0; index60 < 20; ++index60) + { + int index61 = Dust.NewDust(Position, Width, Height, 62, Alpha: 200, Scale: 3.7f); + Main.dust[index61].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) Width / 2f; + Main.dust[index61].noGravity = true; + Main.dust[index61].noLight = true; + Main.dust[index61].velocity *= 3f; + Main.dust[index61].velocity += this.DirectionTo(Main.dust[index61].position) * (float) (2.0 + (double) Main.rand.NextFloat() * 4.0); + int index62 = Dust.NewDust(Position, Width, Height, 62, Alpha: 100, Scale: 1.5f); + Main.dust[index62].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) Width / 2f; + Main.dust[index62].velocity *= 2f; + Main.dust[index62].noGravity = true; + Main.dust[index62].fadeIn = 1f; + Main.dust[index62].color = Color.Crimson * 0.5f; + Main.dust[index62].noLight = true; + Main.dust[index62].velocity += this.DirectionTo(Main.dust[index62].position) * 8f; + } + for (int index63 = 0; index63 < 20; ++index63) + { + int index64 = Dust.NewDust(Position, Width, Height, 62, Scale: 2.7f); + Main.dust[index64].position = this.Center + Vector2.UnitX.RotatedByRandom(3.14159274101257).RotatedBy((double) this.velocity.ToRotation()) * (float) Width / 2f; + Main.dust[index64].noGravity = true; + Main.dust[index64].noLight = true; + Main.dust[index64].velocity *= 3f; + Main.dust[index64].velocity += this.DirectionTo(Main.dust[index64].position) * 2f; + } + for (int index65 = 0; index65 < 70; ++index65) + { + int index66 = Dust.NewDust(Position, Width, Height, 240, Scale: 1.5f); + Main.dust[index66].position = this.Center + Vector2.UnitX.RotatedByRandom(3.14159274101257).RotatedBy((double) this.velocity.ToRotation()) * (float) Width / 2f; + Main.dust[index66].noGravity = true; + Main.dust[index66].velocity *= 3f; + Main.dust[index66].velocity += this.DirectionTo(Main.dust[index66].position) * 3f; + } + } + else if (this.type == 617) + { + this.position = this.Center; + this.width = this.height = 176; + this.Center = this.position; + this.maxPenetrate = -1; + this.penetrate = -1; + this.Damage(); + Main.PlaySound(SoundID.Item14, this.position); + for (int index67 = 0; index67 < 4; ++index67) + { + int index68 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 240, Alpha: 100, Scale: 1.5f); + Main.dust[index68].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; + } + for (int index69 = 0; index69 < 30; ++index69) + { + int index70 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 62, Alpha: 200, Scale: 3.7f); + Main.dust[index70].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; + Main.dust[index70].noGravity = true; + Main.dust[index70].velocity *= 3f; + int index71 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 90, Alpha: 100, Scale: 1.5f); + Main.dust[index71].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; + Main.dust[index71].velocity *= 2f; + Main.dust[index71].noGravity = true; + Main.dust[index71].fadeIn = 1f; + Main.dust[index71].color = Color.Crimson * 0.5f; + } + for (int index72 = 0; index72 < 10; ++index72) + { + int index73 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 62, Scale: 2.7f); + Main.dust[index73].position = this.Center + Vector2.UnitX.RotatedByRandom(3.14159274101257).RotatedBy((double) this.velocity.ToRotation()) * (float) this.width / 2f; + Main.dust[index73].noGravity = true; + Main.dust[index73].velocity *= 3f; + } + for (int index74 = 0; index74 < 10; ++index74) + { + int index75 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 240, Scale: 1.5f); + Main.dust[index75].position = this.Center + Vector2.UnitX.RotatedByRandom(3.14159274101257).RotatedBy((double) this.velocity.ToRotation()) * (float) this.width / 2f; + Main.dust[index75].noGravity = true; + Main.dust[index75].velocity *= 3f; + } + for (int index76 = 0; index76 < 2; ++index76) + { + int index77 = Gore.NewGore(this.position + new Vector2((float) (this.width * Main.rand.Next(100)) / 100f, (float) (this.height * Main.rand.Next(100)) / 100f) - Vector2.One * 10f, new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index77].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; + Main.gore[index77].velocity *= 0.3f; + Main.gore[index77].velocity.X += (float) Main.rand.Next(-10, 11) * 0.05f; + Main.gore[index77].velocity.Y += (float) Main.rand.Next(-10, 11) * 0.05f; + } + if (Main.myPlayer == this.owner) + { + for (int index = 0; index < 1000; ++index) + { + if (Main.projectile[index].active && Main.projectile[index].type == 618 && (double) Main.projectile[index].ai[1] == (double) this.whoAmI) + Main.projectile[index].Kill(); + } + int num14 = Main.rand.Next(5, 9); + int num15 = Main.rand.Next(5, 9); + int num16 = Utils.SelectRandom(Main.rand, 86, 90); + int num17 = num16 == 86 ? 90 : 86; + for (int index = 0; index < num14; ++index) + { + Vector2 vector2_1 = this.Center + Utils.RandomVector2(Main.rand, -30f, 30f); + Vector2 vector2_2 = new Vector2((float) Main.rand.Next(-100, 101), (float) Main.rand.Next(-100, 101)); + while ((double) vector2_2.X == 0.0 && (double) vector2_2.Y == 0.0) + vector2_2 = new Vector2((float) Main.rand.Next(-100, 101), (float) Main.rand.Next(-100, 101)); + vector2_2.Normalize(); + if ((double) vector2_2.Y > 0.200000002980232) + vector2_2.Y *= -1f; + vector2_2 *= (float) Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, vector2_2.X, vector2_2.Y, 620, (int) ((double) this.damage * 0.65), this.knockBack * 0.8f, this.owner, (float) num16); + } + for (int index = 0; index < num15; ++index) + { + Vector2 vector2_3 = this.Center + Utils.RandomVector2(Main.rand, -30f, 30f); + Vector2 vector2_4 = new Vector2((float) Main.rand.Next(-100, 101), (float) Main.rand.Next(-100, 101)); + while ((double) vector2_4.X == 0.0 && (double) vector2_4.Y == 0.0) + vector2_4 = new Vector2((float) Main.rand.Next(-100, 101), (float) Main.rand.Next(-100, 101)); + vector2_4.Normalize(); + if ((double) vector2_4.Y > 0.400000005960464) + vector2_4.Y *= -1f; + vector2_4 *= (float) Main.rand.Next(40, 81) * 0.1f; + Projectile.NewProjectile(vector2_3.X, vector2_3.Y, vector2_4.X, vector2_4.Y, 620, (int) ((double) this.damage * 0.65), this.knockBack * 0.8f, this.owner, (float) num17); + } + } + } + else if (this.type == 658) + { + for (int index78 = 0; index78 < 10; ++index78) + { + int index79 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 269, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, Scale: 0.5f); + if (Main.rand.Next(3) == 0) + { + Main.dust[index79].fadeIn = (float) (0.75 + (double) Main.rand.Next(-10, 11) * 0.00999999977648258); + Main.dust[index79].scale = (float) (0.25 + (double) Main.rand.Next(-10, 11) * 0.00499999988824129); + ++Main.dust[index79].type; + } + else + Main.dust[index79].scale = (float) (1.0 + (double) Main.rand.Next(-10, 11) * 0.00999999977648258); + Main.dust[index79].noGravity = true; + Main.dust[index79].velocity *= 1.25f; + Main.dust[index79].velocity -= this.oldVelocity / 10f; + } + } + else if (this.type == 620 || this.type == 618) + { + if (this.type == 618) + this.ai[0] = 86f; + for (int index80 = 0; index80 < 10; ++index80) + { + int index81 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, (int) this.ai[0], this.velocity.X * 0.1f, this.velocity.Y * 0.1f, Scale: 0.5f); + if (Main.rand.Next(3) == 0) + { + Main.dust[index81].fadeIn = (float) (0.75 + (double) Main.rand.Next(-10, 11) * 0.00999999977648258); + Main.dust[index81].scale = (float) (0.25 + (double) Main.rand.Next(-10, 11) * 0.00499999988824129); + ++Main.dust[index81].type; + } + else + Main.dust[index81].scale = (float) (1.0 + (double) Main.rand.Next(-10, 11) * 0.00999999977648258); + Main.dust[index81].noGravity = true; + Main.dust[index81].velocity *= 1.25f; + Main.dust[index81].velocity -= this.oldVelocity / 10f; + } + } + else if (this.type == 619) + { + Main.PlaySound(SoundID.Item50, this.position); + for (int index82 = 0; index82 < 20; ++index82) + { + int index83 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, (int) this.ai[0], this.velocity.X * 0.1f, this.velocity.Y * 0.1f, Scale: 0.5f); + if (Main.rand.Next(3) == 0) + { + Main.dust[index83].fadeIn = (float) (1.10000002384186 + (double) Main.rand.Next(-10, 11) * 0.00999999977648258); + Main.dust[index83].scale = (float) (0.349999994039536 + (double) Main.rand.Next(-10, 11) * 0.00999999977648258); + ++Main.dust[index83].type; + } + else + Main.dust[index83].scale = (float) (1.20000004768372 + (double) Main.rand.Next(-10, 11) * 0.00999999977648258); + Main.dust[index83].noGravity = true; + Main.dust[index83].velocity *= 2.5f; + Main.dust[index83].velocity -= this.oldVelocity / 10f; + } + if (Main.myPlayer == this.owner) + { + int num = Main.rand.Next(3, 6); + for (int index = 0; index < num; ++index) + { + Vector2 vector2 = new Vector2((float) Main.rand.Next(-100, 101), (float) Main.rand.Next(-100, 101)); + while ((double) vector2.X == 0.0 && (double) vector2.Y == 0.0) + vector2 = new Vector2((float) Main.rand.Next(-100, 101), (float) Main.rand.Next(-100, 101)); + vector2.Normalize(); + vector2 *= (float) Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(this.oldPosition.X + (float) (this.width / 2), this.oldPosition.Y + (float) (this.height / 2), vector2.X, vector2.Y, 620, (int) ((double) this.damage * 0.8), this.knockBack * 0.8f, this.owner, this.ai[0]); + } + } + } + if (this.type == 601) + { + Color portalColor = PortalHelper.GetPortalColor(this.owner, (int) this.ai[0]); + portalColor.A = byte.MaxValue; + for (int index = 0; index < 6; ++index) + { + Vector2 vector2 = Vector2.UnitY.RotatedByRandom(6.28318548202515) * (3f * Main.rand.NextFloat()); + Dust dust = Main.dust[Dust.NewDust(this.Center, 0, 0, 263)]; + dust.position = this.Center; + dust.velocity = vector2 + this.velocity / 5f; + dust.color = portalColor; + dust.scale = 2f; + dust.noLight = true; + dust.noGravity = true; + } + } + if (this.type == 596) + { + this.position = this.Center; + this.width = this.height = 60; + this.Center = this.position; + int num = 40; + if (Main.expertMode) + num = 30; + this.damage = num; + this.Damage(); + Main.PlaySound(SoundID.Item14, this.position); + for (int index84 = 0; index84 < 4; ++index84) + { + int index85 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); + Main.dust[index85].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; + } + for (int index86 = 0; index86 < 20; ++index86) + { + int index87 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 27, Scale: 2.5f); + Main.dust[index87].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; + Main.dust[index87].noGravity = true; + Main.dust[index87].velocity *= 2f; + } + for (int index88 = 0; index88 < 10; ++index88) + { + int index89 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Scale: 1.5f); + Main.dust[index89].position = this.Center + Vector2.UnitX.RotatedByRandom(3.14159274101257).RotatedBy((double) this.velocity.ToRotation()) * (float) this.width / 2f; + Main.dust[index89].noGravity = true; + Main.dust[index89].velocity *= 2f; + } + } + if (this.type == 659) + { + if ((double) this.ai[0] >= 0.0) + { + this.position = this.Center; + this.width = this.height = 40; + this.Center = this.position; + this.Damage(); + Main.PlaySound(SoundID.Item14, this.position); + for (int index90 = 0; index90 < 2; ++index90) + { + int index91 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); + Main.dust[index91].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; + } + for (int index92 = 0; index92 < 10; ++index92) + { + int index93 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 27, Scale: 2.5f); + Main.dust[index93].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; + Main.dust[index93].noGravity = true; + Main.dust[index93].velocity *= 2f; + } + for (int index94 = 0; index94 < 5; ++index94) + { + int index95 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Scale: 1.5f); + Main.dust[index95].position = this.Center + Vector2.UnitX.RotatedByRandom(3.14159274101257).RotatedBy((double) this.velocity.ToRotation()) * (float) this.width / 2f; + Main.dust[index95].noGravity = true; + Main.dust[index95].velocity *= 2f; + } + } + } + else if (this.type >= 625 && this.type <= 628) + { + for (int index96 = 0; index96 < 6; ++index96) + { + int index97 = Dust.NewDust(this.position, this.width, this.height, 135, Alpha: 100, Scale: 2f); + Main.dust[index97].noGravity = true; + Main.dust[index97].noLight = true; + } + } + if (this.type == 631) + { + int num = Main.rand.Next(5, 10); + for (int index98 = 0; index98 < num; ++index98) + { + int index99 = Dust.NewDust(this.Center, 0, 0, 229, Alpha: 100); + Main.dust[index99].velocity *= 1.6f; + --Main.dust[index99].velocity.Y; + Main.dust[index99].position -= Vector2.One * 4f; + Main.dust[index99].position = Vector2.Lerp(Main.dust[index99].position, this.Center, 0.5f); + Main.dust[index99].noGravity = true; + } + } + if (this.type == 539) + { + this.position = this.Center; + this.width = this.height = 80; + this.Center = this.position; + this.Damage(); + Main.PlaySound(4, (int) this.position.X, (int) this.position.Y, 7); + for (int index100 = 0; index100 < 4; ++index100) + { + int index101 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); + Main.dust[index101].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; + } + for (int index102 = 0; index102 < 20; ++index102) + { + int index103 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 176, Alpha: 200, Scale: 3.7f); + Main.dust[index103].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; + Main.dust[index103].noGravity = true; + Main.dust[index103].velocity *= 3f; + } + for (int index104 = 0; index104 < 20; ++index104) + { + int index105 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 180, Scale: 2.7f); + Main.dust[index105].position = this.Center + Vector2.UnitX.RotatedByRandom(3.14159274101257).RotatedBy((double) this.velocity.ToRotation()) * (float) this.width / 2f; + Main.dust[index105].noGravity = true; + Main.dust[index105].velocity *= 3f; + } + for (int index106 = 0; index106 < 10; ++index106) + { + int index107 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Scale: 1.5f); + Main.dust[index107].position = this.Center + Vector2.UnitX.RotatedByRandom(3.14159274101257).RotatedBy((double) this.velocity.ToRotation()) * (float) this.width / 2f; + Main.dust[index107].noGravity = true; + Main.dust[index107].velocity *= 3f; + } + } + else if (this.type == 585) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y, 27); + for (int index108 = 0; index108 < 20; ++index108) + { + int index109 = Dust.NewDust(this.position, this.width, this.height, 26, Alpha: 100); + Main.dust[index109].noGravity = true; + Main.dust[index109].velocity *= 1.2f; + Main.dust[index109].scale = 1.3f; + Main.dust[index109].velocity -= this.oldVelocity * 0.3f; + int index110 = Dust.NewDust(new Vector2(this.position.X + 4f, this.position.Y + 4f), this.width - 8, this.height - 8, 27, Alpha: 100, Scale: 2f); + Main.dust[index110].noGravity = true; + Main.dust[index110].velocity *= 3f; + } + } + else if (this.type == 590) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y, 27); + for (int index111 = 0; index111 < 10; ++index111) + { + int index112 = Dust.NewDust(this.position, this.width, this.height, 165, Alpha: 50, Scale: 1.5f); + Main.dust[index112].velocity *= 2f; + Main.dust[index112].noGravity = true; + } + float Scale = (float) (0.600000023841858 + (double) Main.rand.NextFloat() * 0.400000005960464); + int index113 = Gore.NewGore(this.position, Vector2.Zero, 375, Scale); + Main.gore[index113].velocity *= 0.3f; + int index114 = Gore.NewGore(this.position, Vector2.Zero, 376, Scale); + Main.gore[index114].velocity *= 0.3f; + int index115 = Gore.NewGore(this.position, Vector2.Zero, 377, Scale); + Main.gore[index115].velocity *= 0.3f; + } + else if (this.type == 587) + { + Color rgb = Main.hslToRgb(this.ai[1], 1f, 0.5f); + rgb.A = (byte) 200; + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index116 = 0; index116 < 10; ++index116) + { + int index117 = Dust.NewDust(this.position, this.width, this.height, 76, newColor: rgb); + Main.dust[index117].noGravity = true; + Main.dust[index117].velocity *= 1.2f; + Main.dust[index117].scale = 0.9f; + Main.dust[index117].velocity -= this.oldVelocity * 0.3f; + int index118 = Dust.NewDust(new Vector2(this.position.X + 4f, this.position.Y + 4f), this.width - 8, this.height - 8, 76, newColor: rgb, Scale: 1.1f); + Main.dust[index118].noGravity = true; + Main.dust[index118].velocity *= 2f; + } + } + else if (this.type == 572) + { + for (int index119 = 0; index119 < 15; ++index119) + { + int index120 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 40, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, 100); + Main.dust[index120].velocity *= 3f; + Main.dust[index120].noGravity = true; + Main.dust[index120].scale = 1.25f; + Main.dust[index120].position = (this.Center + this.position) / 2f; + } + } + else if (this.type == 581) + { + for (int index = 0; index < 30; ++index) + { + int Type = Utils.SelectRandom(Main.rand, 229, 229, 161); + Dust dust = Main.dust[Dust.NewDust(this.position, this.width, this.height, Type)]; + dust.noGravity = true; + dust.scale = 1.25f + Main.rand.NextFloat(); + dust.fadeIn = 0.25f; + dust.velocity *= 2f; + dust.noLight = true; + } + } + else if (this.type == 671) + { + for (int index = 0; index < 30; ++index) + { + int Type = Utils.SelectRandom(Main.rand, 27, 27, 62); + Dust dust = Main.dust[Dust.NewDust(this.position, this.width, this.height, Type)]; + dust.noGravity = true; + dust.scale = 1.25f + Main.rand.NextFloat(); + dust.fadeIn = 0.25f; + dust.velocity *= 2f; + dust.noLight = true; + } + } + else if (this.type == 675) + { + for (int index = 0; index < 40; ++index) + { + int Type = Utils.SelectRandom(Main.rand, 27, 242, 73, 72, 71, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); + Dust dust = Main.dust[Dust.NewDust(this.position, this.width, this.height, Type)]; + dust.noGravity = true; + dust.scale = 1.25f + Main.rand.NextFloat(); + dust.fadeIn = 0.25f; + dust.velocity *= 3f; + dust.noLight = true; + } + } + else if (this.type == 676) + { + for (int index = 0; index < 120; ++index) + { + int Type = Utils.SelectRandom(Main.rand, 4, 256); + Dust dust = Main.dust[Dust.NewDust(this.position, this.width, this.height, Type, Alpha: 100)]; + dust.scale = (float) (0.800000011920929 + (double) Main.rand.NextFloat() * 0.600000023841858); + dust.fadeIn = 0.5f; + dust.velocity *= 4.5f; + dust.noLight = true; + if ((double) dust.velocity.Y > 0.0) + dust.velocity *= -0.5f; + if (dust.type == 4) + dust.color = new Color(80, 170, 40, 120); + } + for (int index = 0; index < 10; ++index) + Gore.NewGoreDirect(this.Center, new Vector2(MathHelper.Lerp(-5f, 5f, Main.rand.NextFloat()), (float) (-(double) Main.rand.NextFloat() * 5.0)), 1024); + for (int index = 0; index < 10; ++index) + Gore.NewGoreDirect(this.Center, new Vector2(MathHelper.Lerp(-5f, 5f, Main.rand.NextFloat()), (float) (-(double) Main.rand.NextFloat() * 5.0)), 1025); + for (int index = 0; index < 10; ++index) + Gore.NewGoreDirect(this.Center, new Vector2(MathHelper.Lerp(-5f, 5f, Main.rand.NextFloat()), (float) (-(double) Main.rand.NextFloat() * 5.0)), 1026); + for (int index = 0; index < 20; ++index) + Gore.NewGoreDirect(this.Center, new Vector2(MathHelper.Lerp(-0.5f, 0.5f, Main.rand.NextFloat()), (float) (-(double) Main.rand.NextFloat() * 2.0)), 1026); + if (Main.netMode != 2) + { + Player player = Main.player[Main.myPlayer]; + if (!player.dead && player.active && (double) (player.Center - this.Center).Length() < 300.0) + player.AddBuff(197, 900, false); + } + } + else if (this.type == 686) + { + Microsoft.Xna.Framework.Rectangle hitbox = this.Hitbox; + for (int index121 = 0; index121 < this.oldPos.Length / 2; index121 += 2) + { + hitbox.X = (int) this.oldPos[index121].X; + hitbox.Y = (int) this.oldPos[index121].Y; + for (int index122 = 0; index122 < 3; ++index122) + { + int Type = Utils.SelectRandom(Main.rand, 6, 55, 158); + int index123 = Dust.NewDust(hitbox.TopLeft(), this.width, this.height, Type, (float) this.direction, -2.5f); + Main.dust[index123].alpha = 200; + Main.dust[index123].velocity *= 2.4f; + Main.dust[index123].scale += Main.rand.NextFloat(); + Main.dust[index123].scale -= 0.5f; + if (Main.dust[index123].type == 55) + Main.dust[index123].color = Color.Lerp(Color.Red, Color.Gold, Main.rand.NextFloat()); + Main.dust[index123].noLight = true; + } + } + for (int index124 = 10; index124 < this.oldPos.Length; index124 += 2) + { + hitbox.X = (int) this.oldPos[index124].X; + hitbox.Y = (int) this.oldPos[index124].Y; + for (int index125 = 0; index125 < 2; ++index125) + { + int Type = Utils.SelectRandom(Main.rand, 55); + int index126 = Dust.NewDust(hitbox.TopLeft(), this.width, this.height, Type, (float) this.direction, -2.5f); + Main.dust[index126].alpha = 120; + Main.dust[index126].velocity *= 2.4f; + Main.dust[index126].scale += Main.rand.NextFloat() * 0.7f; + Main.dust[index126].scale -= 0.5f; + if (Main.dust[index126].type == 55) + Main.dust[index126].color = Color.Lerp(Color.Purple, Color.Black, Main.rand.NextFloat()); + Main.dust[index126].noLight = true; + } + } + for (int index127 = 5; index127 < this.oldPos.Length; ++index127) + { + hitbox.X = (int) this.oldPos[index127].X; + hitbox.Y = (int) this.oldPos[index127].Y; + for (int index128 = 0; index128 < 1; ++index128) + { + int Type = Utils.SelectRandom(Main.rand, 55); + int index129 = Dust.NewDust(hitbox.TopLeft(), this.width, this.height, Type, (float) this.direction, -2.5f); + Main.dust[index129].alpha = 80; + Main.dust[index129].velocity *= 0.3f; + Main.dust[index129].velocity += this.velocity * 0.5f; + Main.dust[index129].scale += Main.rand.NextFloat() * 0.7f; + Main.dust[index129].scale -= 0.5f; + if (Main.dust[index129].type == 55) + Main.dust[index129].color = Color.Lerp(Color.Purple, Color.Black, Main.rand.NextFloat()); + Main.dust[index129].noLight = true; + } + } + for (int index = 0; index < 30; ++index) + { + int Type = 228; + Dust dust = Main.dust[Dust.NewDust(this.position, this.width, this.height, Type)]; + dust.noGravity = true; + dust.scale = 1.25f + Main.rand.NextFloat(); + dust.fadeIn = 1.5f; + dust.velocity *= 6f; + dust.noLight = true; + } + } + if (this.type == 405) + { + Main.PlaySound(SoundID.Item54, this.position); + Vector2 center = this.Center; + for (int index130 = 0; index130 < 20; ++index130) + { + int num = 10; + int index131 = Dust.NewDust(this.Center - Vector2.One * (float) num, num * 2, num * 2, 212); + Dust dust = Main.dust[index131]; + Vector2 vector2 = Vector2.Normalize(dust.position - this.Center); + dust.position = this.Center + vector2 * (float) num * this.scale; + dust.velocity = index130 >= 30 ? vector2 * (float) Main.rand.Next(45, 91) / 10f : vector2 * dust.velocity.Length(); + dust.color = Main.hslToRgb((float) (0.400000005960464 + Main.rand.NextDouble() * 0.200000002980232), 0.9f, 0.5f); + dust.color = Color.Lerp(dust.color, Color.White, 0.3f); + dust.noGravity = true; + dust.scale = 0.7f; + } + } + if (this.type == 501) + { + Main.PlaySound(13, (int) this.position.X, (int) this.position.Y); + int num18 = 20; + this.position.X -= (float) num18; + this.position.Y -= (float) num18; + this.width += num18 * 2; + this.height += num18 * 2; + int num19 = num18 + 20; + for (int index132 = 0; index132 < 20; ++index132) + { + int index133 = Dust.NewDust(this.position, this.width, this.height, 188, Alpha: 100, Scale: 1.5f); + Main.dust[index133].velocity *= 0.5f; + } + for (int index134 = 0; index134 < 5; ++index134) + { + int index135 = Gore.NewGore(new Vector2(this.position.X + (float) Main.rand.Next(this.width), this.position.Y + (float) Main.rand.Next(this.height)), new Vector2(), Main.rand.Next(435, 438)); + Main.gore[index135].velocity *= 0.5f; + if (index134 == 0) + { + ++Main.gore[index135].velocity.X; + ++Main.gore[index135].velocity.Y; + } + else if (index134 == 1) + { + --Main.gore[index135].velocity.X; + ++Main.gore[index135].velocity.Y; + } + else if (index134 == 2) + { + ++Main.gore[index135].velocity.X; + --Main.gore[index135].velocity.Y; + } + else + { + --Main.gore[index135].velocity.X; + --Main.gore[index135].velocity.Y; + } + Main.gore[index135].velocity *= 0.5f; + } + this.position.X -= (float) num19; + this.position.Y -= (float) num19; + this.width += num19 * 2; + this.height += num19 * 2; + this.Damage(); + } + if (this.type == 410) + { + Main.PlaySound(SoundID.Item54, this.position); + Vector2 center = this.Center; + for (int index136 = 0; index136 < 10; ++index136) + { + int num = (int) (10.0 * (double) this.ai[1]); + int index137 = Dust.NewDust(this.Center - Vector2.One * (float) num, num * 2, num * 2, 212); + Dust dust = Main.dust[index137]; + Vector2 vector2 = Vector2.Normalize(dust.position - this.Center); + dust.position = this.Center + vector2 * (float) num * this.scale; + dust.velocity = index136 >= 30 ? vector2 * (float) Main.rand.Next(45, 91) / 10f : vector2 * dust.velocity.Length(); + dust.color = Main.hslToRgb((float) (0.400000005960464 + Main.rand.NextDouble() * 0.200000002980232), 0.9f, 0.5f); + dust.color = Color.Lerp(dust.color, Color.White, 0.3f); + dust.noGravity = true; + dust.scale = 0.7f; + } + } + if (this.type == 629 && Main.netMode != 1) + { + switch (Main.npc[(int) this.ai[0]].type) + { + case 422: + if (NPC.ShieldStrengthTowerVortex != 0) + Main.npc[(int) this.ai[0]].ai[3] = 1f; + NPC.ShieldStrengthTowerVortex = (int) MathHelper.Clamp((float) (NPC.ShieldStrengthTowerVortex - 1), 0.0f, (float) NPC.ShieldStrengthTowerMax); + break; + case 493: + if (NPC.ShieldStrengthTowerStardust != 0) + Main.npc[(int) this.ai[0]].ai[3] = 1f; + NPC.ShieldStrengthTowerStardust = (int) MathHelper.Clamp((float) (NPC.ShieldStrengthTowerStardust - 1), 0.0f, (float) NPC.ShieldStrengthTowerMax); + break; + case 507: + if (NPC.ShieldStrengthTowerNebula != 0) + Main.npc[(int) this.ai[0]].ai[3] = 1f; + NPC.ShieldStrengthTowerNebula = (int) MathHelper.Clamp((float) (NPC.ShieldStrengthTowerNebula - 1), 0.0f, (float) NPC.ShieldStrengthTowerMax); + break; + case 517: + if (NPC.ShieldStrengthTowerSolar != 0) + Main.npc[(int) this.ai[0]].ai[3] = 1f; + NPC.ShieldStrengthTowerSolar = (int) MathHelper.Clamp((float) (NPC.ShieldStrengthTowerSolar - 1), 0.0f, (float) NPC.ShieldStrengthTowerMax); + break; + } + Main.npc[(int) this.ai[0]].netUpdate = true; + NetMessage.SendData(101); + } + if (this.aiStyle == 105 && this.owner == Main.myPlayer && (double) this.ai[1] == 0.0) + { + Vector2 vector2_5 = new Vector2((float) Main.rand.Next(-100, 101), (float) Main.rand.Next(-100, 101)); + vector2_5.Normalize(); + Vector2 vector2_6 = vector2_5 * 0.3f; + Projectile.NewProjectile(this.Center.X, this.Center.Y, vector2_6.X, vector2_6.Y, Main.rand.Next(569, 572), this.damage, 0.0f, this.owner); + } + if (this.type == 452) + { + Main.PlaySound(29, (int) this.position.X, (int) this.position.Y, 103); + this.position = this.Center; + this.width = this.height = 144; + this.position.X -= (float) (this.width / 2); + this.position.Y -= (float) (this.height / 2); + for (int index = 0; index < 4; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); + for (int index138 = 0; index138 < 40; ++index138) + { + int index139 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 229, Scale: 2.5f); + Main.dust[index139].noGravity = true; + Main.dust[index139].velocity *= 3f; + int index140 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 229, Alpha: 100, Scale: 1.5f); + Main.dust[index140].velocity *= 2f; + Main.dust[index140].noGravity = true; + } + for (int index141 = 0; index141 < 1; ++index141) + { + int index142 = Gore.NewGore(this.position + new Vector2((float) (this.width * Main.rand.Next(100)) / 100f, (float) (this.height * Main.rand.Next(100)) / 100f) - Vector2.One * 10f, new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index142].velocity *= 0.3f; + Main.gore[index142].velocity.X += (float) Main.rand.Next(-10, 11) * 0.05f; + Main.gore[index142].velocity.Y += (float) Main.rand.Next(-10, 11) * 0.05f; + } + this.Damage(); + } + if (this.type == 454) + { + Main.PlaySound(4, (int) this.position.X, (int) this.position.Y, 6); + this.position = this.Center; + this.width = this.height = 208; + this.position.X -= (float) (this.width / 2); + this.position.Y -= (float) (this.height / 2); + for (int index143 = 0; index143 < 7; ++index143) + { + int index144 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); + Main.dust[index144].position = new Vector2((float) (this.width / 2), 0.0f).RotatedBy(6.28318548202515 * Main.rand.NextDouble()) * (float) Main.rand.NextDouble() + this.Center; + } + for (int index145 = 0; index145 < 60; ++index145) + { + int index146 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 229, Scale: 2.5f); + Main.dust[index146].position = new Vector2((float) (this.width / 2), 0.0f).RotatedBy(6.28318548202515 * Main.rand.NextDouble()) * (float) Main.rand.NextDouble() + this.Center; + Main.dust[index146].noGravity = true; + Main.dust[index146].velocity *= 1f; + int index147 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 229, Alpha: 100, Scale: 1.5f); + Main.dust[index147].position = new Vector2((float) (this.width / 2), 0.0f).RotatedBy(6.28318548202515 * Main.rand.NextDouble()) * (float) Main.rand.NextDouble() + this.Center; + Main.dust[index147].velocity *= 1f; + Main.dust[index147].noGravity = true; + } + for (int index148 = 0; index148 < 3; ++index148) + { + int index149 = Gore.NewGore(this.position + new Vector2((float) (this.width * Main.rand.Next(100)) / 100f, (float) (this.height * Main.rand.Next(100)) / 100f) - Vector2.One * 10f, new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index149].velocity *= 0.3f; + Main.gore[index149].velocity.X += (float) Main.rand.Next(-10, 11) * 0.05f; + Main.gore[index149].velocity.Y += (float) Main.rand.Next(-10, 11) * 0.05f; + } + this.Damage(); + } + if (this.type == 467) + { + this.position = this.Center; + this.width = this.height = 176; + this.Center = this.position; + this.Damage(); + Main.PlaySound(SoundID.Item14, this.position); + for (int index150 = 0; index150 < 4; ++index150) + { + int index151 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); + Main.dust[index151].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; + } + for (int index152 = 0; index152 < 30; ++index152) + { + int index153 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 200, Scale: 3.7f); + Main.dust[index153].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; + Main.dust[index153].noGravity = true; + Main.dust[index153].velocity *= 3f; + int index154 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 1.5f); + Main.dust[index154].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; + Main.dust[index154].velocity *= 2f; + Main.dust[index154].noGravity = true; + Main.dust[index154].fadeIn = 2.5f; + } + for (int index155 = 0; index155 < 10; ++index155) + { + int index156 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Scale: 2.7f); + Main.dust[index156].position = this.Center + Vector2.UnitX.RotatedByRandom(3.14159274101257).RotatedBy((double) this.velocity.ToRotation()) * (float) this.width / 2f; + Main.dust[index156].noGravity = true; + Main.dust[index156].velocity *= 3f; + } + for (int index157 = 0; index157 < 10; ++index157) + { + int index158 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Scale: 1.5f); + Main.dust[index158].position = this.Center + Vector2.UnitX.RotatedByRandom(3.14159274101257).RotatedBy((double) this.velocity.ToRotation()) * (float) this.width / 2f; + Main.dust[index158].noGravity = true; + Main.dust[index158].velocity *= 3f; + } + for (int index159 = 0; index159 < 2; ++index159) + { + int index160 = Gore.NewGore(this.position + new Vector2((float) (this.width * Main.rand.Next(100)) / 100f, (float) (this.height * Main.rand.Next(100)) / 100f) - Vector2.One * 10f, new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index160].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; + Main.gore[index160].velocity *= 0.3f; + Main.gore[index160].velocity.X += (float) Main.rand.Next(-10, 11) * 0.05f; + Main.gore[index160].velocity.Y += (float) Main.rand.Next(-10, 11) * 0.05f; + } + } + if (this.type == 468) + { + this.position = this.Center; + this.width = this.height = 176; + this.Center = this.position; + this.Damage(); + Main.PlaySound(SoundID.Item14, this.position); + for (int index161 = 0; index161 < 4; ++index161) + { + int index162 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); + Main.dust[index162].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; + } + for (int index163 = 0; index163 < 20; ++index163) + { + int index164 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 27, Alpha: 200, Scale: 3.7f); + Main.dust[index164].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; + Main.dust[index164].noGravity = true; + Main.dust[index164].velocity *= 3f; + int index165 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 27, Alpha: 100, Scale: 1.5f); + Main.dust[index165].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; + Main.dust[index165].velocity *= 2f; + Main.dust[index165].noGravity = true; + Main.dust[index165].fadeIn = 2.5f; + } + for (int index166 = 0; index166 < 10; ++index166) + { + int index167 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 27, Scale: 2.7f); + Main.dust[index167].position = this.Center + Vector2.UnitX.RotatedByRandom(3.14159274101257).RotatedBy((double) this.velocity.ToRotation()) * (float) this.width / 2f; + Main.dust[index167].noGravity = true; + Main.dust[index167].velocity *= 3f; + } + for (int index168 = 0; index168 < 10; ++index168) + { + int index169 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Scale: 1.5f); + Main.dust[index169].position = this.Center + Vector2.UnitX.RotatedByRandom(3.14159274101257).RotatedBy((double) this.velocity.ToRotation()) * (float) this.width / 2f; + Main.dust[index169].noGravity = true; + Main.dust[index169].velocity *= 3f; + } + for (int index170 = 0; index170 < 2; ++index170) + { + int index171 = Gore.NewGore(this.position + new Vector2((float) (this.width * Main.rand.Next(100)) / 100f, (float) (this.height * Main.rand.Next(100)) / 100f) - Vector2.One * 10f, new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index171].position = this.Center + Vector2.UnitY.RotatedByRandom(3.14159274101257) * (float) Main.rand.NextDouble() * (float) this.width / 2f; + Main.gore[index171].velocity *= 0.3f; + Main.gore[index171].velocity.X += (float) Main.rand.Next(-10, 11) * 0.05f; + Main.gore[index171].velocity.Y += (float) Main.rand.Next(-10, 11) * 0.05f; + } + } + if (this.type == 485) + { + for (int index172 = 0; index172 < 15; ++index172) + { + int index173 = Dust.NewDust(this.position, this.width, this.height, 6); + Main.dust[index173].noGravity = true; + Main.dust[index173].velocity -= this.oldVelocity * (float) Main.rand.Next(20, 60) * 0.01f; + } + } + else if (this.type == 484) + { + for (int index174 = 0; index174 < 5; ++index174) + { + int index175 = Dust.NewDust(this.position, this.width, this.height, 78); + Main.dust[index175].noGravity = true; + Main.dust[index175].velocity -= this.oldVelocity / 5f; + Main.dust[index175].scale = 0.85f; + } + } + else if (this.type == 483) + { + Main.PlaySound(SoundID.Item14, this.position); + if (this.owner == Main.myPlayer) + { + int length = Main.rand.Next(4, 8); + int[] numArray = new int[length]; + int maxValue = 0; + for (int index = 0; index < 200; ++index) + { + if (Main.npc[index].CanBeChasedBy((object) this, true) && Collision.CanHitLine(this.position, this.width, this.height, Main.npc[index].position, Main.npc[index].width, Main.npc[index].height)) { - flag = this.CanExplodeTile(index1, index2); - if (flag) + numArray[maxValue] = index; + ++maxValue; + if (maxValue == length) + break; + } + } + if (maxValue > 1) + { + for (int index176 = 0; index176 < 100; ++index176) + { + int index177 = Main.rand.Next(maxValue); + int index178 = index177; + while (index178 == index177) + index178 = Main.rand.Next(maxValue); + int num = numArray[index177]; + numArray[index177] = numArray[index178]; + numArray[index178] = num; + } + } + Vector2 vector2_7 = new Vector2(-1f, -1f); + for (int index = 0; index < maxValue; ++index) + { + Vector2 vector2_8 = Main.npc[numArray[index]].Center - this.Center; + vector2_8.Normalize(); + vector2_7 += vector2_8; + } + vector2_7.Normalize(); + for (int index = 0; index < length; ++index) + { + float num = (float) Main.rand.Next(8, 15); + Vector2 vector2_9 = new Vector2((float) Main.rand.Next(-100, 101), (float) Main.rand.Next(-100, 101)); + vector2_9.Normalize(); + if (maxValue > 0) + { + vector2_9 += vector2_7; + vector2_9.Normalize(); + } + vector2_9 *= num; + if (maxValue > 0) + { + --maxValue; + vector2_9 = Main.npc[numArray[maxValue]].Center - this.Center; + vector2_9.Normalize(); + vector2_9 *= num; + } + Projectile.NewProjectile(this.Center.X, this.Center.Y, vector2_9.X, vector2_9.Y, 484, (int) ((double) this.damage * 0.7), this.knockBack * 0.7f, this.owner); + } + } + for (int index179 = 0; index179 < 20; ++index179) + { + int index180 = Dust.NewDust(this.position, this.width, this.height, 78); + Main.dust[index180].noGravity = true; + Main.dust[index180].velocity *= 4f; + } + for (int index181 = 0; index181 < 7; ++index181) + { + int index182 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); + Main.dust[index182].velocity *= 0.9f; + Main.dust[index182].scale = 0.9f; + } + for (int index183 = 0; index183 < 3; ++index183) + { + int index184 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 2.5f); + Main.dust[index184].noGravity = true; + Main.dust[index184].velocity *= 3f; + int index185 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 1.5f); + Main.dust[index185].velocity *= 2f; + } + int index186 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index186].velocity *= 0.3f; + Main.gore[index186].velocity.X += (float) Main.rand.Next(-1, 2); + Main.gore[index186].velocity.Y += (float) Main.rand.Next(-1, 2); + if (this.owner == Main.myPlayer) + { + int num = 100; + this.position.X -= (float) (num / 2); + this.position.Y -= (float) (num / 2); + this.width += num; + ++this.height; + this.penetrate = -1; + this.Damage(); + } + } + if (this.type == 523) + { + Main.PlaySound(SoundID.Item54, this.position); + for (int index187 = 0; index187 < 25; ++index187) + { + int index188 = Dust.NewDust(this.position, this.width, this.height, 256); + Main.dust[index188].noGravity = true; + Main.dust[index188].position = (Main.dust[index188].position + this.position) / 2f; + Main.dust[index188].velocity = new Vector2((float) Main.rand.Next(-100, 101), (float) Main.rand.Next(-100, 101)); + Main.dust[index188].velocity.Normalize(); + Main.dust[index188].velocity *= (float) Main.rand.Next(1, 30) * 0.1f; + Main.dust[index188].alpha = this.alpha; + } + } + else if (this.type == 522) + { + Main.PlaySound(SoundID.Item118, this.position); + for (int index189 = 0; index189 < 10; ++index189) + { + int index190 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 254, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, Scale: 0.5f); + if (Main.rand.Next(3) == 0) + { + Main.dust[index190].fadeIn = (float) (0.75 + (double) Main.rand.Next(-10, 11) * 0.00999999977648258); + Main.dust[index190].scale = (float) (0.25 + (double) Main.rand.Next(-10, 11) * 0.00499999988824129); + ++Main.dust[index190].type; + } + else + Main.dust[index190].scale = (float) (1.0 + (double) Main.rand.Next(-10, 11) * 0.00999999977648258); + Main.dust[index190].noGravity = true; + Main.dust[index190].velocity *= 1.25f; + Main.dust[index190].velocity -= this.oldVelocity / 10f; + } + } + else if (this.type == 521) + { + Main.PlaySound(SoundID.Item110, this.position); + for (int index191 = 0; index191 < 20; ++index191) + { + int index192 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 254, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, Scale: 0.5f); + if (Main.rand.Next(3) == 0) + { + Main.dust[index192].fadeIn = (float) (1.10000002384186 + (double) Main.rand.Next(-10, 11) * 0.00999999977648258); + Main.dust[index192].scale = (float) (0.349999994039536 + (double) Main.rand.Next(-10, 11) * 0.00999999977648258); + ++Main.dust[index192].type; + } + else + Main.dust[index192].scale = (float) (1.20000004768372 + (double) Main.rand.Next(-10, 11) * 0.00999999977648258); + Main.dust[index192].noGravity = true; + Main.dust[index192].velocity *= 2.5f; + Main.dust[index192].velocity -= this.oldVelocity / 10f; + } + if (Main.myPlayer == this.owner) + { + int num = Main.rand.Next(3, 6); + for (int index = 0; index < num; ++index) + { + Vector2 vector2 = new Vector2((float) Main.rand.Next(-100, 101), (float) Main.rand.Next(-100, 101)); + while ((double) vector2.X == 0.0 && (double) vector2.Y == 0.0) + vector2 = new Vector2((float) Main.rand.Next(-100, 101), (float) Main.rand.Next(-100, 101)); + vector2.Normalize(); + vector2 *= (float) Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(this.oldPosition.X + (float) (this.width / 2), this.oldPosition.Y + (float) (this.height / 2), vector2.X, vector2.Y, 522, (int) ((double) this.damage * 0.8), this.knockBack * 0.8f, this.owner); + } + } + } + if (this.type == 520) + { + Main.PlaySound(SoundID.Item50, this.position); + for (int index193 = 0; index193 < 10; ++index193) + { + int index194 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 252, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, Scale: 0.75f); + Main.dust[index194].noGravity = true; + Main.dust[index194].velocity -= this.oldVelocity / 3f; + } + } + if (this.type == 459 || this.type == 709) + { + int num20 = 3; + int num21 = 10; + int num22 = 0; + if ((double) this.scale >= 1.0) + { + this.position = this.Center; + this.width = this.height = 144; + this.Center = this.position; + num20 = 7; + num21 = 30; + num22 = 2; + this.Damage(); + } + for (int index195 = 0; index195 < num20; ++index195) + { + int index196 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); + Main.dust[index196].position = new Vector2((float) (this.width / 2), 0.0f).RotatedBy(6.28318548202515 * Main.rand.NextDouble()) * (float) Main.rand.NextDouble() + this.Center; + } + for (int index197 = 0; index197 < num21; ++index197) + { + int index198 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 226, Scale: 1.5f); + Main.dust[index198].position = new Vector2((float) (this.width / 2), 0.0f).RotatedBy(6.28318548202515 * Main.rand.NextDouble()) * (float) Main.rand.NextDouble() + this.Center; + Main.dust[index198].noGravity = true; + Main.dust[index198].velocity *= 1f; + } + for (int index199 = 0; index199 < num22; ++index199) + { + int index200 = Gore.NewGore(this.position + new Vector2((float) (this.width * Main.rand.Next(100)) / 100f, (float) (this.height * Main.rand.Next(100)) / 100f) - Vector2.One * 10f, new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index200].velocity *= 0.3f; + Main.gore[index200].velocity.X += (float) Main.rand.Next(-10, 11) * 0.05f; + Main.gore[index200].velocity.Y += (float) Main.rand.Next(-10, 11) * 0.05f; + } + if (this.type == 709 && Main.myPlayer == this.owner) + { + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle((int) this.Center.X - 40, (int) this.Center.Y - 40, 80, 80); + for (int index = 0; index < 1000; ++index) + { + if (index != this.whoAmI && Main.projectile[index].active && Main.projectile[index].owner == this.owner && Main.projectile[index].type == 443 && Main.projectile[index].getRect().Intersects(rectangle)) + { + Main.projectile[index].ai[1] = 1f; + Main.projectile[index].velocity = (this.Center - Main.projectile[index].Center) / 5f; + Main.projectile[index].netUpdate = true; + } + } + int index201 = Projectile.NewProjectile(this.Center.X, this.Center.Y, 0.0f, 0.0f, 443, this.damage, 0.0f, this.owner); + Main.projectile[index201].timeLeft = 30 * Main.rand.Next(2, 6); + float[] localAi = Main.projectile[index201].localAI; + SlotId slotId = Main.PlayTrackedSound((SoundStyle) SoundID.DD2_SkyDragonsFuryCircle, this.Center); + double num23 = (double) ((SlotId) ref slotId).ToFloat(); + localAi[0] = (float) num23; + } + } + if (this.owner != Main.myPlayer && this.type == 453 && Main.player[this.owner].mount.AbilityActive) + Main.player[this.owner].mount.UseAbility(Main.player[this.owner], this.position, false); + if (this.type == 441) + Main.player[this.owner].mount.StopAbilityCharge(); + if (this.type == 444) + { + Main.PlaySound(SoundID.Item96, this.position); + int num = Main.rand.Next(5, 9); + for (int index202 = 0; index202 < num; ++index202) + { + int index203 = Dust.NewDust(this.Center, 0, 0, 171, Alpha: 100, Scale: 1.4f); + Main.dust[index203].velocity *= 0.8f; + Main.dust[index203].position = Vector2.Lerp(Main.dust[index203].position, this.Center, 0.5f); + Main.dust[index203].noGravity = true; + } + if (this.owner == Main.myPlayer) + { + Vector2 vector2_10 = Main.screenPosition + new Vector2((float) Main.mouseX, (float) Main.mouseY); + if ((double) Main.player[this.owner].gravDir == -1.0) + vector2_10.Y = (float) (Main.screenHeight - Main.mouseY) + Main.screenPosition.Y; + Vector2 vector2_11 = Vector2.Normalize(vector2_10 - this.Center) * this.localAI[1]; + Projectile.NewProjectile(this.Center.X, this.Center.Y, vector2_11.X, vector2_11.Y, (int) this.localAI[0], this.damage, this.knockBack, this.owner); + } + } + if (this.type == 472) + { + for (int index204 = 0; index204 < 20; ++index204) + { + int index205 = Dust.NewDust(this.position, this.width, this.height, 30); + Main.dust[index205].noGravity = true; + Main.dust[index205].velocity *= 0.45f; + Main.dust[index205].velocity += this.velocity * 0.9f; + } + } + if (this.type == 639 || this.type == 640) + { + int num24 = Main.rand.Next(5, 10); + for (int index206 = 0; index206 < num24; ++index206) + { + int index207 = Dust.NewDust(this.Center, 0, 0, 220, Alpha: 100, Scale: 0.5f); + Main.dust[index207].velocity *= 1.6f; + --Main.dust[index207].velocity.Y; + Main.dust[index207].position = Vector2.Lerp(Main.dust[index207].position, this.Center, 0.5f); + Main.dust[index207].noGravity = true; + } + if (this.owner == Main.myPlayer && this.type == 639) + { + int num25 = timeLeft + 1; + int nextSlot = Projectile.GetNextSlot(); + if (Main.ProjectileUpdateLoopIndex < nextSlot && Main.ProjectileUpdateLoopIndex != -1) + ++num25; + Vector2 vector2 = new Vector2(this.ai[0], this.ai[1]); + Projectile.NewProjectile(this.localAI[0], this.localAI[1], vector2.X, vector2.Y, 640, this.damage, this.knockBack, this.owner, ai1: ((float) num25)); + } + } + if (this.type == 684) + { + int num = Main.rand.Next(15, 25); + for (int index208 = 0; index208 < num; ++index208) + { + int index209 = Dust.NewDust(this.Center, 0, 0, 60, Alpha: 100, newColor: new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0), Scale: 1.3f); + Main.dust[index209].velocity *= (float) (8.0 * (0.300000011920929 + 0.699999988079071 * (double) Main.rand.NextFloat())); + Main.dust[index209].fadeIn = (float) (1.29999995231628 + (double) Main.rand.NextFloat() * 0.200000002980232); + Main.dust[index209].noLight = true; + Main.dust[index209].noGravity = true; + Main.dust[index209].position += Main.dust[index209].velocity * 4f; + } + } + if (this.type == 435) + { + int num = Main.rand.Next(5, 10); + for (int index210 = 0; index210 < num; ++index210) + { + int index211 = Dust.NewDust(this.Center, 0, 0, 226, Alpha: 100, Scale: 0.5f); + Main.dust[index211].velocity *= 1.6f; + --Main.dust[index211].velocity.Y; + Main.dust[index211].position = Vector2.Lerp(Main.dust[index211].position, this.Center, 0.5f); + Main.dust[index211].noGravity = true; + } + } + if (this.type == 682) + { + int num = 22; + for (int index212 = 0; index212 < num; ++index212) + { + int index213 = Dust.NewDust(this.Center, 0, 0, 272, Scale: 0.5f); + Main.dust[index213].velocity *= 1.6f; + --Main.dust[index213].velocity.Y; + Main.dust[index213].position = Vector2.Lerp(Main.dust[index213].position, this.Center, 0.5f); + } + } + if (this.type == 436) + { + int num = Main.rand.Next(5, 10); + for (int index214 = 0; index214 < num; ++index214) + { + int index215 = Dust.NewDust(this.Center, 0, 0, 220, Alpha: 100, Scale: 0.5f); + Main.dust[index215].velocity *= 1.6f; + --Main.dust[index215].velocity.Y; + Main.dust[index215].position = Vector2.Lerp(Main.dust[index215].position, this.Center, 0.5f); + Main.dust[index215].noGravity = true; + } + } + if (this.type == 462) + { + int num = Main.rand.Next(5, 10); + for (int index216 = 0; index216 < num; ++index216) + { + int index217 = Dust.NewDust(this.Center, 0, 0, 229, Alpha: 100, Scale: 0.5f); + Main.dust[index217].velocity *= 1.6f; + --Main.dust[index217].velocity.Y; + Main.dust[index217].position -= Vector2.One * 4f; + Main.dust[index217].position = Vector2.Lerp(Main.dust[index217].position, this.Center, 0.5f); + Main.dust[index217].noGravity = true; + } + } + if (this.type == 442) + { + Main.PlaySound(SoundID.Item94, this.position); + int num = Main.rand.Next(3, 7); + for (int index218 = 0; index218 < num; ++index218) + { + int index219 = Dust.NewDust(this.position, this.width, this.height, 135, Alpha: 100, Scale: 2.1f); + Main.dust[index219].velocity *= 2f; + Main.dust[index219].noGravity = true; + } + if (Main.myPlayer == this.owner) + { + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle((int) this.Center.X - 40, (int) this.Center.Y - 40, 80, 80); + for (int index = 0; index < 1000; ++index) + { + if (index != this.whoAmI && Main.projectile[index].active && Main.projectile[index].owner == this.owner && Main.projectile[index].type == 443 && Main.projectile[index].getRect().Intersects(rectangle)) + { + Main.projectile[index].ai[1] = 1f; + Main.projectile[index].velocity = (this.Center - Main.projectile[index].Center) / 5f; + Main.projectile[index].netUpdate = true; + } + } + Projectile.NewProjectile(this.Center.X, this.Center.Y, 0.0f, 0.0f, 443, this.damage, 0.0f, this.owner); + } + } + if (this.type == 440) + { + int num = Main.rand.Next(3, 7); + for (int index220 = 0; index220 < num; ++index220) + { + int index221 = Dust.NewDust(this.Center - this.velocity / 2f, 0, 0, 135, Alpha: 100, Scale: 2.1f); + Main.dust[index221].velocity *= 2f; + Main.dust[index221].noGravity = true; + } + } + if (this.type == 606) + { + int num = Main.rand.Next(3, 7); + for (int index222 = 0; index222 < num; ++index222) + { + int index223 = Dust.NewDust(this.Center - this.velocity / 2f, 0, 0, 182, Alpha: 100, Scale: 1.6f); + Main.dust[index223].velocity *= 1.5f; + Main.dust[index223].noGravity = true; + } + } + if (this.type == 449) + { + int num = Main.rand.Next(3, 7); + for (int index224 = 0; index224 < num; ++index224) + { + int index225 = Dust.NewDust(this.Center - this.velocity / 2f, 0, 0, 228, Alpha: 100, Scale: 2.1f); + Main.dust[index225].velocity *= 2f; + Main.dust[index225].noGravity = true; + } + } + if (this.type == 495) + { + for (int index226 = 0; index226 < 15; ++index226) + { + int index227 = Dust.NewDust(this.Center, 10, 10, 27); + Main.dust[index227].noGravity = true; + Main.dust[index227].velocity -= this.oldVelocity * 0.3f; + } + } + if (this.type == 497) + { + for (int index228 = 0; index228 < 15; ++index228) + { + int index229 = Dust.NewDust(this.Center, 10, 10, 27); + Main.dust[index229].noGravity = true; + Main.dust[index229].velocity *= 2f; + Main.dust[index229].velocity -= this.oldVelocity * 0.3f; + Main.dust[index229].scale += (float) Main.rand.Next(150) * (1f / 1000f); + } + } + if (this.type == 448) + { + Main.PlaySound(SoundID.Item14, this.position); + this.position = this.Center; + this.width = this.height = 112; + this.position.X -= (float) (this.width / 2); + this.position.Y -= (float) (this.height / 2); + for (int index = 0; index < 4; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); + for (int index230 = 0; index230 < 40; ++index230) + { + int index231 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 228, Scale: 2.5f); + Main.dust[index231].noGravity = true; + Main.dust[index231].velocity *= 3f; + int index232 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 228, Alpha: 100, Scale: 1.5f); + Main.dust[index232].velocity *= 2f; + Main.dust[index232].noGravity = true; + } + for (int index233 = 0; index233 < 1; ++index233) + { + int index234 = Gore.NewGore(this.position + new Vector2((float) (this.width * Main.rand.Next(100)) / 100f, (float) (this.height * Main.rand.Next(100)) / 100f) - Vector2.One * 10f, new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index234].velocity *= 0.3f; + Main.gore[index234].velocity.X += (float) Main.rand.Next(-10, 11) * 0.05f; + Main.gore[index234].velocity.Y += (float) Main.rand.Next(-10, 11) * 0.05f; + } + this.Damage(); + } + if (this.type == 616) + { + Main.PlaySound(SoundID.Item14, this.position); + this.position = this.Center; + this.width = this.height = 80; + this.position.X -= (float) (this.width / 2); + this.position.Y -= (float) (this.height / 2); + for (int index = 0; index < 4; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); + for (int index235 = 0; index235 < 40; ++index235) + { + int index236 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 229, Alpha: 200, Scale: 2.5f); + Main.dust[index236].noGravity = true; + Main.dust[index236].velocity *= 2f; + int index237 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 229, Alpha: 200, Scale: 1.5f); + Main.dust[index237].velocity *= 1.2f; + Main.dust[index237].noGravity = true; + } + for (int index238 = 0; index238 < 1; ++index238) + { + int index239 = Gore.NewGore(this.position + new Vector2((float) (this.width * Main.rand.Next(100)) / 100f, (float) (this.height * Main.rand.Next(100)) / 100f) - Vector2.One * 10f, new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index239].velocity *= 0.3f; + Main.gore[index239].velocity.X += (float) Main.rand.Next(-10, 11) * 0.05f; + Main.gore[index239].velocity.Y += (float) Main.rand.Next(-10, 11) * 0.05f; + } + this.Damage(); + } + if (this.type == 502) + { + Vector2 vector2 = new Vector2((float) this.width, (float) this.height) / 2f; + for (int index240 = 0; index240 < this.oldPos.Length; ++index240) + { + if (!(this.oldPos[index240] == Vector2.Zero)) + { + int index241 = Dust.NewDust(this.oldPos[index240] + vector2, 0, 0, 66, Alpha: 150, newColor: Color.Transparent, Scale: 0.7f); + Main.dust[index241].color = Main.hslToRgb(Main.rand.NextFloat(), 1f, 0.5f); + Main.dust[index241].noGravity = true; + } + } + } + if (this.type == 510) + { + Main.PlaySound(SoundID.Item107, this.position); + Gore.NewGore(this.Center, -this.oldVelocity * 0.2f, 704); + Gore.NewGore(this.Center, -this.oldVelocity * 0.2f, 705); + if (this.owner == Main.myPlayer) + { + int num = Main.rand.Next(20, 31); + for (int index = 0; index < num; ++index) + { + Vector2 vector2 = new Vector2((float) Main.rand.Next(-100, 101), (float) Main.rand.Next(-100, 101)); + vector2.Normalize(); + vector2 *= (float) Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(this.Center.X, this.Center.Y, vector2.X, vector2.Y, 511 + Main.rand.Next(3), this.damage, 1f, this.owner, ai1: ((float) Main.rand.Next(-45, 1))); + } + } + } + if (this.type == 408) + { + for (int index242 = 0; index242 < 15; ++index242) + { + int index243 = Dust.NewDust(this.Center - Vector2.One * 10f, 50, 50, 5, SpeedY: -2f); + Main.dust[index243].velocity /= 2f; + } + int num = 10; + int index244 = Gore.NewGore(this.Center, this.velocity * 0.8f, 584); + Main.gore[index244].timeLeft /= num; + int index245 = Gore.NewGore(this.Center, this.velocity * 0.9f, 585); + Main.gore[index245].timeLeft /= num; + int index246 = Gore.NewGore(this.Center, this.velocity * 1f, 586); + Main.gore[index246].timeLeft /= num; + } + if (this.type == 385) + { + Main.PlaySound(4, (int) this.Center.X, (int) this.Center.Y, 19); + int num26 = 36; + for (int index247 = 0; index247 < num26; ++index247) + { + Vector2 vector2_12 = (Vector2.Normalize(this.velocity) * new Vector2((float) this.width / 2f, (float) this.height) * 0.75f).RotatedBy((double) (index247 - (num26 / 2 - 1)) * 6.28318548202515 / (double) num26) + this.Center; + Vector2 vector2_13 = vector2_12 - this.Center; + int index248 = Dust.NewDust(vector2_12 + vector2_13, 0, 0, 172, vector2_13.X * 2f, vector2_13.Y * 2f, 100, Scale: 1.4f); + Main.dust[index248].noGravity = true; + Main.dust[index248].noLight = true; + Main.dust[index248].velocity = vector2_13; + } + if (this.owner == Main.myPlayer) + { + if ((double) this.ai[1] < 1.0) + { + int index = Projectile.NewProjectile(this.Center.X - (float) (this.direction * 30), this.Center.Y - 4f, (float) -this.direction * 0.01f, 0.0f, 384, Main.expertMode ? 25 : 40, 4f, this.owner, 16f, 15f); + Main.projectile[index].netUpdate = true; + } + else + { + int num27 = (int) ((double) this.Center.Y / 16.0); + int index249 = (int) ((double) this.Center.X / 16.0); + int num28 = 100; + if (index249 < 10) + index249 = 10; + if (index249 > Main.maxTilesX - 10) + index249 = Main.maxTilesX - 10; + if (num27 < 10) + num27 = 10; + if (num27 > Main.maxTilesY - num28 - 10) + num27 = Main.maxTilesY - num28 - 10; + for (int index250 = num27; index250 < num27 + num28; ++index250) + { + Tile tile = Main.tile[index249, index250]; + if (tile.active() && (Main.tileSolid[(int) tile.type] || tile.liquid != (byte) 0)) { - WorldGen.KillTile(index1, index2); - if (!Main.tile[index1, index2].active() && Main.netMode != 0) - NetMessage.SendData(17, number2: ((float) index1), number3: ((float) index2)); + num27 = index250; + break; } } - if (flag) + int Damage = Main.expertMode ? 50 : 80; + int index251 = Projectile.NewProjectile((float) (index249 * 16 + 8), (float) (num27 * 16 - 24), 0.0f, 0.0f, 386, Damage, 4f, Main.myPlayer, 16f, 24f); + Main.projectile[index251].netUpdate = true; + } + } + } + else if (this.type >= 424 && this.type <= 426) + { + Main.PlaySound(SoundID.Item89, this.position); + this.position.X += (float) (this.width / 2); + this.position.Y += (float) (this.height / 2); + this.width = (int) (128.0 * (double) this.scale); + this.height = (int) (128.0 * (double) this.scale); + this.position.X -= (float) (this.width / 2); + this.position.Y -= (float) (this.height / 2); + for (int index = 0; index < 8; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); + for (int index252 = 0; index252 < 32; ++index252) + { + int index253 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 2.5f); + Main.dust[index253].noGravity = true; + Main.dust[index253].velocity *= 3f; + int index254 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 1.5f); + Main.dust[index254].velocity *= 2f; + Main.dust[index254].noGravity = true; + } + for (int index255 = 0; index255 < 2; ++index255) + { + int index256 = Gore.NewGore(this.position + new Vector2((float) (this.width * Main.rand.Next(100)) / 100f, (float) (this.height * Main.rand.Next(100)) / 100f) - Vector2.One * 10f, new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index256].velocity *= 0.3f; + Main.gore[index256].velocity.X += (float) Main.rand.Next(-10, 11) * 0.05f; + Main.gore[index256].velocity.Y += (float) Main.rand.Next(-10, 11) * 0.05f; + } + if (this.owner == Main.myPlayer) + { + this.localAI[1] = -1f; + this.maxPenetrate = 0; + this.Damage(); + } + for (int index257 = 0; index257 < 5; ++index257) + { + int index258 = Dust.NewDust(this.position, this.width, this.height, Utils.SelectRandom(Main.rand, 6, 259, 158), 2.5f * (float) this.direction, -2.5f); + Main.dust[index258].alpha = 200; + Main.dust[index258].velocity *= 2.4f; + Main.dust[index258].scale += Main.rand.NextFloat(); + } + } + if (this.type == 399) + { + Main.PlaySound(13, (int) this.position.X, (int) this.position.Y); + Vector2 vector2 = new Vector2(20f, 20f); + for (int index = 0; index < 5; ++index) + Dust.NewDust(this.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, 12, newColor: Color.Red); + for (int index259 = 0; index259 < 10; ++index259) + { + int index260 = Dust.NewDust(this.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, 31, Alpha: 100, Scale: 1.5f); + Main.dust[index260].velocity *= 1.4f; + } + for (int index261 = 0; index261 < 20; ++index261) + { + int index262 = Dust.NewDust(this.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, 6, Alpha: 100, Scale: 2.5f); + Main.dust[index262].noGravity = true; + Main.dust[index262].velocity *= 5f; + int index263 = Dust.NewDust(this.Center - vector2 / 2f, (int) vector2.X, (int) vector2.Y, 6, Alpha: 100, Scale: 1.5f); + Main.dust[index263].velocity *= 3f; + } + if (Main.myPlayer == this.owner) + { + for (int index = 0; index < 6; ++index) + { + float SpeedX = (float) (-(double) this.velocity.X * (double) Main.rand.Next(20, 50) * 0.00999999977648258 + (double) Main.rand.Next(-20, 21) * 0.400000005960464); + float SpeedY = (float) (-(double) Math.Abs(this.velocity.Y) * (double) Main.rand.Next(30, 50) * 0.00999999977648258 + (double) Main.rand.Next(-20, 5) * 0.400000005960464); + Projectile.NewProjectile(this.Center.X + SpeedX, this.Center.Y + SpeedY, SpeedX, SpeedY, 400 + Main.rand.Next(3), (int) ((double) this.damage * 0.5), 0.0f, this.owner); + } + } + } + if (this.type == 384 || this.type == 386) + { + for (int index264 = 0; index264 < 20; ++index264) + { + int index265 = Dust.NewDust(this.position, this.width, this.height, 212, (float) (this.direction * 2), Alpha: 100, Scale: 1.4f); + Dust dust = Main.dust[index265]; + dust.color = Color.CornflowerBlue; + dust.color = Color.Lerp(dust.color, Color.White, 0.3f); + dust.noGravity = true; + } + } + if (this.type == 507 || this.type == 508) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + Vector2 position = this.position; + Vector2 oldVelocity = this.oldVelocity; + oldVelocity.Normalize(); + Vector2 Position = position + oldVelocity * 16f; + for (int index266 = 0; index266 < 20; ++index266) + { + int index267 = Dust.NewDust(Position, this.width, this.height, 81); + Main.dust[index267].position = (Main.dust[index267].position + this.Center) / 2f; + Main.dust[index267].velocity += this.oldVelocity * 0.4f; + Main.dust[index267].velocity *= 0.5f; + Main.dust[index267].noGravity = true; + Position -= oldVelocity * 8f; + } + } + if (this.type == 598) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + Vector2 position = this.position; + Vector2 rotationVector2 = (this.rotation - 1.570796f).ToRotationVector2(); + Vector2 Position = position + rotationVector2 * 16f; + for (int index268 = 0; index268 < 20; ++index268) + { + int index269 = Dust.NewDust(Position, this.width, this.height, 81); + Main.dust[index269].position = (Main.dust[index269].position + this.Center) / 2f; + Main.dust[index269].velocity += rotationVector2 * 2f; + Main.dust[index269].velocity *= 0.5f; + Main.dust[index269].noGravity = true; + Position -= rotationVector2 * 8f; + } + } + if (this.type == 1 || this.type == 81 || this.type == 98) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index = 0; index < 10; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 7); + } + if (this.type == 336 || this.type == 345) + { + for (int index270 = 0; index270 < 6; ++index270) + { + int index271 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 196); + Main.dust[index271].noGravity = true; + Main.dust[index271].scale = this.scale; + } + } + if (this.type == 358) + { + this.velocity = this.oldVelocity * 0.2f; + for (int index272 = 0; index272 < 100; ++index272) + { + int index273 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 211, Alpha: 75, Scale: 1.2f); + if (Main.rand.Next(2) == 0) + Main.dust[index273].alpha += 25; + if (Main.rand.Next(2) == 0) + Main.dust[index273].alpha += 25; + if (Main.rand.Next(2) == 0) + Main.dust[index273].alpha += 25; + if (Main.rand.Next(2) == 0) + Main.dust[index273].scale = 0.6f; + else + Main.dust[index273].noGravity = true; + Main.dust[index273].velocity *= 0.3f; + Main.dust[index273].velocity += this.velocity; + Main.dust[index273].velocity *= (float) (1.0 + (double) Main.rand.Next(-100, 101) * 0.00999999977648258); + Main.dust[index273].velocity.X += (float) Main.rand.Next(-50, 51) * 0.015f; + Main.dust[index273].velocity.Y += (float) Main.rand.Next(-50, 51) * 0.015f; + Main.dust[index273].position = this.Center; + } + } + if (this.type == 406) + { + int Alpha = 175; + Color newColor = new Color(0, 80, (int) byte.MaxValue, 100); + this.velocity = this.oldVelocity * 0.2f; + for (int index274 = 0; index274 < 40; ++index274) + { + int index275 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 4, Alpha: Alpha, newColor: newColor, Scale: 1.6f); + if (Main.rand.Next(2) == 0) + Main.dust[index275].alpha += 25; + if (Main.rand.Next(2) == 0) + Main.dust[index275].alpha += 25; + if (Main.rand.Next(2) == 0) + Main.dust[index275].alpha += 25; + if (Main.rand.Next(2) == 0) + Main.dust[index275].scale = 0.6f; + else + Main.dust[index275].noGravity = true; + Main.dust[index275].velocity *= 0.3f; + Main.dust[index275].velocity += this.velocity; + Main.dust[index275].velocity *= (float) (1.0 + (double) Main.rand.Next(-100, 101) * 0.00999999977648258); + Main.dust[index275].velocity.X += (float) Main.rand.Next(-50, 51) * 0.015f; + Main.dust[index275].velocity.Y += (float) Main.rand.Next(-50, 51) * 0.015f; + Main.dust[index275].position = this.Center; + } + } + if (this.type == 344) + { + for (int index276 = 0; index276 < 3; ++index276) + { + int index277 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 197); + Main.dust[index277].noGravity = true; + Main.dust[index277].scale = this.scale; + } + } + else if (this.type == 343) + { + Main.PlaySound(SoundID.Item27, this.position); + for (int index278 = 4; index278 < 31; ++index278) + { + int index279 = Dust.NewDust(new Vector2(this.oldPosition.X - this.oldVelocity.X * (30f / (float) index278), this.oldPosition.Y - this.oldVelocity.Y * (30f / (float) index278)), 8, 8, 197, this.oldVelocity.X, this.oldVelocity.Y, 100, Scale: 1.2f); + Main.dust[index279].noGravity = true; + Main.dust[index279].velocity *= 0.5f; + } + } + else if (this.type == 349) + { + Main.PlaySound(SoundID.Item27, this.position); + for (int index280 = 0; index280 < 3; ++index280) + { + int index281 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 76); + Main.dust[index281].noGravity = true; + Main.dust[index281].noLight = true; + Main.dust[index281].scale = 0.7f; + } + } + if (this.type == 323) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index282 = 0; index282 < 20; ++index282) + { + int index283 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 7); + if (Main.rand.Next(2) == 0) + { + Main.dust[index283].noGravity = true; + Main.dust[index283].scale = 1.3f; + Main.dust[index283].velocity *= 1.5f; + Main.dust[index283].velocity -= this.oldVelocity * 0.5f; + Main.dust[index283].velocity *= 1.5f; + } + else + { + Main.dust[index283].velocity *= 0.75f; + Main.dust[index283].velocity -= this.oldVelocity * 0.25f; + Main.dust[index283].scale = 0.8f; + } + } + } + if (this.type == 589) + { + Main.PlaySound(SoundID.Item27, this.position); + Color newColor = Color.Red; + if ((double) this.ai[1] == 1.0) + newColor = Color.Green; + if ((double) this.ai[1] == 2.0) + newColor = Color.Purple; + if ((double) this.ai[1] == 3.0) + newColor = Color.Gold; + if ((double) this.ai[1] == 4.0) + newColor = Color.White; + newColor.A = (byte) 100; + for (int index284 = 0; index284 < 30; ++index284) + { + int index285 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 11, newColor: newColor); + Main.dust[index285].velocity *= (float) (1.0 + (double) Main.rand.NextFloat() * 1.0); + if (index284 < 10) + { + Main.dust[index285].noGravity = true; + Main.dust[index285].velocity *= 0.5f; + } + } + } + if (this.type == 346) + { + Main.PlaySound(SoundID.Item27, this.position); + for (int index286 = 0; index286 < 10; ++index286) + { + int Type = 10; + if ((double) this.ai[1] == 1.0) + Type = 4; + int index287 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, Type); + Main.dust[index287].noGravity = true; + } + } + if (this.type == 335) + { + Main.PlaySound(SoundID.Item27, this.position); + for (int index288 = 0; index288 < 10; ++index288) + { + int index289 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 90 - (int) this.ai[1]); + Main.dust[index289].noLight = true; + Main.dust[index289].scale = 0.8f; + } + } + if (this.type == 318) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index290 = 0; index290 < 10; ++index290) + { + int index291 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 30); + if (Main.rand.Next(2) == 0) + Main.dust[index291].noGravity = true; + } + } + if (this.type == 378) + { + for (int index292 = 0; index292 < 10; ++index292) + { + int index293 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 30); + if (Main.rand.Next(2) == 0) + Main.dust[index293].noGravity = true; + } + } + else if (this.type == 311) + { + for (int index294 = 0; index294 < 5; ++index294) + { + int index295 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 189); + Main.dust[index295].scale = 0.85f; + Main.dust[index295].noGravity = true; + Main.dust[index295].velocity += this.velocity * 0.5f; + } + } + else if (this.type == 316) + { + for (int index296 = 0; index296 < 5; ++index296) + { + int index297 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 195); + Main.dust[index297].scale = 0.85f; + Main.dust[index297].noGravity = true; + Main.dust[index297].velocity += this.velocity * 0.5f; + } + } + else if (this.type == 184 || this.type == 195) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index = 0; index < 5; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 7); + } + else if (this.type == 275 || this.type == 276) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index = 0; index < 5; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 7); + } + else if (this.type == 291) + { + if (this.owner == Main.myPlayer) + Projectile.NewProjectile(this.Center.X, this.Center.Y, 0.0f, 0.0f, 292, this.damage, this.knockBack, this.owner); + } + else if (this.type == 295) + { + if (this.owner == Main.myPlayer) + Projectile.NewProjectile(this.Center.X, this.Center.Y, 0.0f, 0.0f, 296, (int) ((double) this.damage * 0.65), this.knockBack, this.owner); + } + else if (this.type == 270) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y, 27); + if ((double) this.ai[0] < 0.0) + { + for (int index298 = 0; index298 < 20; ++index298) + { + int index299 = Dust.NewDust(this.position, this.width, this.height, 26, Alpha: 100); + Main.dust[index299].noGravity = true; + Main.dust[index299].velocity *= 1.2f; + Main.dust[index299].scale = 1.3f; + Main.dust[index299].velocity -= this.oldVelocity * 0.3f; + int index300 = Dust.NewDust(new Vector2(this.position.X + 4f, this.position.Y + 4f), this.width - 8, this.height - 8, 5, Alpha: 100, Scale: 1.5f); + Main.dust[index300].noGravity = true; + Main.dust[index300].velocity *= 3f; + } + } + else + { + for (int index301 = 0; index301 < 20; ++index301) + { + int index302 = Dust.NewDust(this.position, this.width, this.height, 26, Alpha: 100); + Main.dust[index302].noGravity = true; + Main.dust[index302].velocity *= 1.2f; + Main.dust[index302].scale = 1.3f; + Main.dust[index302].velocity -= this.oldVelocity * 0.3f; + int index303 = Dust.NewDust(new Vector2(this.position.X + 4f, this.position.Y + 4f), this.width - 8, this.height - 8, 6, Alpha: 100, Scale: 2f); + Main.dust[index303].noGravity = true; + Main.dust[index303].velocity *= 3f; + } + } + } + else if (this.type == 265) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y, 27); + for (int index304 = 0; index304 < 15; ++index304) + { + int index305 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 163, Alpha: 100, Scale: 1.2f); + Main.dust[index305].noGravity = true; + Main.dust[index305].velocity *= 1.2f; + Main.dust[index305].velocity -= this.oldVelocity * 0.3f; + } + } + else if (this.type == 355) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y, 27); + for (int index306 = 0; index306 < 15; ++index306) + { + int index307 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 205, Alpha: 100, Scale: 1.2f); + Main.dust[index307].noGravity = true; + Main.dust[index307].velocity *= 1.2f; + Main.dust[index307].velocity -= this.oldVelocity * 0.3f; + } + } + else if (this.type == 304) + { + for (int index308 = 0; index308 < 3; ++index308) + { + int index309 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 182, Alpha: 100, Scale: 0.8f); + Main.dust[index309].noGravity = true; + Main.dust[index309].velocity *= 1.2f; + Main.dust[index309].velocity -= this.oldVelocity * 0.3f; + } + } + else if (this.type == 263) + { + Main.PlaySound(SoundID.Item27, this.position); + for (int index310 = 0; index310 < 15; ++index310) + { + int index311 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 92, this.velocity.X, this.velocity.Y, Main.rand.Next(0, 101), Scale: ((float) (1.0 + (double) Main.rand.Next(40) * 0.00999999977648258))); + Main.dust[index311].noGravity = true; + Main.dust[index311].velocity *= 2f; + } + } + else if (this.type == 261) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index = 0; index < 5; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 148); + } + else if (this.type == 229) + { + for (int index312 = 0; index312 < 25; ++index312) + { + int index313 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 157); + Main.dust[index313].noGravity = true; + Main.dust[index313].velocity *= 1.5f; + Main.dust[index313].scale = 1.5f; + } + } + else if (this.type == 239) + { + int index = Dust.NewDust(new Vector2(this.position.X, (float) ((double) this.position.Y + (double) this.height - 2.0)), 2, 2, 154); + Main.dust[index].position.X -= 2f; + Main.dust[index].alpha = 38; + Main.dust[index].velocity *= 0.1f; + Main.dust[index].velocity += -this.oldVelocity * 0.25f; + Main.dust[index].scale = 0.95f; + } + else if (this.type == 245) + { + int index = Dust.NewDust(new Vector2(this.position.X, (float) ((double) this.position.Y + (double) this.height - 2.0)), 2, 2, 114); + Main.dust[index].noGravity = true; + Main.dust[index].position.X -= 2f; + Main.dust[index].alpha = 38; + Main.dust[index].velocity *= 0.1f; + Main.dust[index].velocity += -this.oldVelocity * 0.25f; + Main.dust[index].scale = 0.95f; + } + else if (this.type == 264) + { + int index = Dust.NewDust(new Vector2(this.position.X, (float) ((double) this.position.Y + (double) this.height - 2.0)), 2, 2, 54); + Main.dust[index].noGravity = true; + Main.dust[index].position.X -= 2f; + Main.dust[index].alpha = 38; + Main.dust[index].velocity *= 0.1f; + Main.dust[index].velocity += -this.oldVelocity * 0.25f; + Main.dust[index].scale = 0.95f; + } + else if (this.type == 206 || this.type == 225) + { + Main.PlaySound(6, (int) this.position.X, (int) this.position.Y); + for (int index = 0; index < 5; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 40); + } + else if (this.type == 227) + { + Main.PlaySound(6, (int) this.position.X, (int) this.position.Y); + for (int index314 = 0; index314 < 15; ++index314) + { + int index315 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 157); + Main.dust[index315].noGravity = true; + Main.dust[index315].velocity += this.oldVelocity; + Main.dust[index315].scale = 1.5f; + } + } + else if (this.type == 237 && this.owner == Main.myPlayer) + Projectile.NewProjectile(this.Center.X, this.Center.Y, 0.0f, 0.0f, 238, this.damage, this.knockBack, this.owner); + else if (this.type == 243 && this.owner == Main.myPlayer) + Projectile.NewProjectile(this.Center.X, this.Center.Y, 0.0f, 0.0f, 244, this.damage, this.knockBack, this.owner); + else if (this.type == 120) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index316 = 0; index316 < 10; ++index316) + { + int index317 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X, this.position.Y - this.velocity.Y), this.width, this.height, 67, this.velocity.X, this.velocity.Y, 100); + if (index316 < 5) + Main.dust[index317].noGravity = true; + Main.dust[index317].velocity *= 0.2f; + } + } + else if (this.type == 181 || this.type == 189 || this.type == 566) + { + for (int index318 = 0; index318 < 6; ++index318) + { + int index319 = Dust.NewDust(this.position, this.width, this.height, 150, this.velocity.X, this.velocity.Y, 50); + Main.dust[index319].noGravity = true; + Main.dust[index319].scale = 1f; + } + } + else if (this.type == 178) + { + for (int index320 = 0; index320 < 85; ++index320) + { + int index321 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, Main.rand.Next(139, 143), this.velocity.X, this.velocity.Y, Scale: 1.2f); + Main.dust[index321].velocity.X += (float) Main.rand.Next(-50, 51) * 0.01f; + Main.dust[index321].velocity.Y += (float) Main.rand.Next(-50, 51) * 0.01f; + Main.dust[index321].velocity.X *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); + Main.dust[index321].velocity.Y *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); + Main.dust[index321].velocity.X += (float) Main.rand.Next(-50, 51) * 0.05f; + Main.dust[index321].velocity.Y += (float) Main.rand.Next(-50, 51) * 0.05f; + Main.dust[index321].scale *= (float) (1.0 + (double) Main.rand.Next(-30, 31) * 0.00999999977648258); + } + for (int index322 = 0; index322 < 40; ++index322) + { + int index323 = Gore.NewGore(this.position, this.velocity, Main.rand.Next(276, 283)); + Main.gore[index323].velocity.X += (float) Main.rand.Next(-50, 51) * 0.01f; + Main.gore[index323].velocity.Y += (float) Main.rand.Next(-50, 51) * 0.01f; + Main.gore[index323].velocity.X *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); + Main.gore[index323].velocity.Y *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); + Main.gore[index323].scale *= (float) (1.0 + (double) Main.rand.Next(-20, 21) * 0.00999999977648258); + Main.gore[index323].velocity.X += (float) Main.rand.Next(-50, 51) * 0.05f; + Main.gore[index323].velocity.Y += (float) Main.rand.Next(-50, 51) * 0.05f; + } + } + else if (this.type == 289) + { + for (int index324 = 0; index324 < 30; ++index324) + { + int index325 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, Main.rand.Next(139, 143), this.velocity.X, this.velocity.Y, Scale: 1.2f); + Main.dust[index325].velocity.X += (float) Main.rand.Next(-50, 51) * 0.01f; + Main.dust[index325].velocity.Y += (float) Main.rand.Next(-50, 51) * 0.01f; + Main.dust[index325].velocity.X *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); + Main.dust[index325].velocity.Y *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); + Main.dust[index325].velocity.X += (float) Main.rand.Next(-50, 51) * 0.05f; + Main.dust[index325].velocity.Y += (float) Main.rand.Next(-50, 51) * 0.05f; + Main.dust[index325].scale *= (float) (1.0 + (double) Main.rand.Next(-30, 31) * 0.00999999977648258); + } + for (int index326 = 0; index326 < 15; ++index326) + { + int index327 = Gore.NewGore(this.position, this.velocity, Main.rand.Next(276, 283)); + Main.gore[index327].velocity.X += (float) Main.rand.Next(-50, 51) * 0.01f; + Main.gore[index327].velocity.Y += (float) Main.rand.Next(-50, 51) * 0.01f; + Main.gore[index327].velocity.X *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); + Main.gore[index327].velocity.Y *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); + Main.gore[index327].scale *= (float) (1.0 + (double) Main.rand.Next(-20, 21) * 0.00999999977648258); + Main.gore[index327].velocity.X += (float) Main.rand.Next(-50, 51) * 0.05f; + Main.gore[index327].velocity.Y += (float) Main.rand.Next(-50, 51) * 0.05f; + } + } + else if (this.type == 475 || this.type == 505 || this.type == 506) + { + if ((double) this.ai[1] == 0.0) + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + if ((double) this.ai[1] < 10.0) + { + Vector2 Position = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); + float num29 = -this.velocity.X; + float num30 = -this.velocity.Y; + float num31 = 1f; + if ((double) this.ai[0] <= 17.0) + num31 = this.ai[0] / 17f; + int num32 = (int) (30.0 * (double) num31); + float num33 = 1f; + if ((double) this.ai[0] <= 30.0) + num33 = this.ai[0] / 30f; + float num34 = 0.4f * num33; + float num35 = num34; + float num36 = num30 + num35; + for (int index328 = 0; index328 < num32; ++index328) + { + float num37 = (float) Math.Sqrt((double) num29 * (double) num29 + (double) num36 * (double) num36); + float num38 = 5.6f; + if ((double) Math.Abs(num29) + (double) Math.Abs(num36) < 1.0) + num38 *= Math.Abs(num29) + Math.Abs(num36) / 1f; + float num39 = num38 / num37; + float num40 = num29 * num39; + float num41 = num36 * num39; + Math.Atan2((double) num41, (double) num40); + int Type = 3; + if (this.type == 506) + Type = 30; + if (this.type == 505) + Type = 239; + if ((double) index328 > (double) this.ai[1]) { - for (int i = index1 - 1; i <= index1 + 1; ++i) + for (int index329 = 0; index329 < 4; ++index329) { - for (int j = index2 - 1; j <= index2 + 1; ++j) + int index330 = Dust.NewDust(Position, this.width, this.height, Type); + Main.dust[index330].noGravity = true; + Main.dust[index330].velocity *= 0.3f; + } + } + Position.X += num40; + Position.Y += num41; + num29 = -this.velocity.X; + float num42 = -this.velocity.Y; + num35 += num34; + num36 = num42 + num35; + } + } + } + else if (this.type == 171) + { + if ((double) this.ai[1] == 0.0) + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + if ((double) this.ai[1] < 10.0) + { + Vector2 Position = new Vector2(this.position.X + (float) this.width * 0.5f, this.position.Y + (float) this.height * 0.5f); + float num43 = -this.velocity.X; + float num44 = -this.velocity.Y; + float num45 = 1f; + if ((double) this.ai[0] <= 17.0) + num45 = this.ai[0] / 17f; + int num46 = (int) (30.0 * (double) num45); + float num47 = 1f; + if ((double) this.ai[0] <= 30.0) + num47 = this.ai[0] / 30f; + float num48 = 0.4f * num47; + float num49 = num48; + float num50 = num44 + num49; + for (int index331 = 0; index331 < num46; ++index331) + { + float num51 = (float) Math.Sqrt((double) num43 * (double) num43 + (double) num50 * (double) num50); + float num52 = 5.6f; + if ((double) Math.Abs(num43) + (double) Math.Abs(num50) < 1.0) + num52 *= Math.Abs(num43) + Math.Abs(num50) / 1f; + float num53 = num52 / num51; + float num54 = num43 * num53; + float num55 = num50 * num53; + Math.Atan2((double) num55, (double) num54); + if ((double) index331 > (double) this.ai[1]) + { + for (int index332 = 0; index332 < 4; ++index332) + { + int index333 = Dust.NewDust(Position, this.width, this.height, 129); + Main.dust[index333].noGravity = true; + Main.dust[index333].velocity *= 0.3f; + } + } + Position.X += num54; + Position.Y += num55; + num43 = -this.velocity.X; + float num56 = -this.velocity.Y; + num49 += num48; + num50 = num56 + num49; + } + } + } + else if (this.type == 117) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index = 0; index < 10; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 26); + } + else if (this.type == 166) + { + Main.PlaySound(SoundID.Item51, this.position); + for (int index334 = 0; index334 < 10; ++index334) + { + int index335 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 76); + Main.dust[index335].noGravity = true; + Main.dust[index335].velocity -= this.oldVelocity * 0.25f; + } + } + else if (this.type == 158) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index336 = 0; index336 < 10; ++index336) + { + int index337 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 9); + Main.dust[index337].noGravity = true; + Main.dust[index337].velocity -= this.velocity * 0.5f; + } + } + else if (this.type == 159) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index338 = 0; index338 < 10; ++index338) + { + int index339 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 11); + Main.dust[index339].noGravity = true; + Main.dust[index339].velocity -= this.velocity * 0.5f; + } + } + else if (this.type == 160) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index340 = 0; index340 < 10; ++index340) + { + int index341 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 19); + Main.dust[index341].noGravity = true; + Main.dust[index341].velocity -= this.velocity * 0.5f; + } + } + else if (this.type == 161) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index342 = 0; index342 < 10; ++index342) + { + int index343 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 11); + Main.dust[index343].noGravity = true; + Main.dust[index343].velocity -= this.velocity * 0.5f; + } + } + else if (this.type >= 191 && this.type <= 194) + { + int index = Gore.NewGore(new Vector2(this.position.X - (float) (this.width / 2), this.position.Y - (float) (this.height / 2)), new Vector2(0.0f, 0.0f), Main.rand.Next(61, 64), this.scale); + Main.gore[index].velocity *= 0.1f; + } + else if (!Main.projPet[this.type]) + { + if (this.type == 93) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index344 = 0; index344 < 10; ++index344) + { + int index345 = Dust.NewDust(this.position, this.width, this.height, 57, Alpha: 100, Scale: 0.5f); + Main.dust[index345].velocity.X *= 2f; + Main.dust[index345].velocity.Y *= 2f; + } + } + else if (this.type == 99) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index346 = 0; index346 < 30; ++index346) + { + int index347 = Dust.NewDust(this.position, this.width, this.height, 1); + if (Main.rand.Next(2) == 0) + Main.dust[index347].scale *= 1.4f; + this.velocity = this.velocity * 1.9f; + } + } + else if (this.type == 655) + { + Main.PlaySound(4, (int) this.position.X, (int) this.position.Y); + for (int index348 = 0; index348 < 30; ++index348) + { + int index349 = Dust.NewDust(this.position, this.width, this.height, 147); + if (Main.rand.Next(2) == 0) + Main.dust[index349].scale *= 1.4f; + this.velocity = this.velocity * 1.9f; + } + if (Main.netMode != 1 && !this.wet) + { + int num = 2; + if (Main.rand.Next(3) == 0) + ++num; + if (Main.rand.Next(3) == 0) + ++num; + if (Main.rand.Next(3) == 0) + ++num; + for (int index350 = 0; index350 < num; ++index350) + { + int index351 = NPC.NewNPC((int) this.Center.X, (int) this.Center.Y, Main.rand.Next(210, 212), 1); + Main.npc[index351].velocity.X = (float) Main.rand.Next(-200, 201) * (1f / 500f); + Main.npc[index351].velocity.Y = (float) Main.rand.Next(-200, 201) * (1f / 500f); + Main.npc[index351].netUpdate = true; + } + if (Main.rand.Next(4) == 0) + { + int index = NPC.NewNPC((int) this.Center.X, (int) this.Center.Y, 42, 1); + Main.npc[index].SetDefaults(-16); + Main.npc[index].velocity.X = (float) Main.rand.Next(-200, 201) * (1f / 1000f); + Main.npc[index].velocity.Y = (float) Main.rand.Next(-200, 201) * (1f / 1000f); + Main.npc[index].netUpdate = true; + } + } + } + else if (this.type == 91 || this.type == 92) + { + Main.PlaySound(SoundID.Item10, this.position); + for (int index = 0; index < 10; ++index) + Dust.NewDust(this.position, this.width, this.height, 58, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, 150, Scale: 1.2f); + for (int index = 0; index < 3; ++index) + Gore.NewGore(this.position, new Vector2(this.velocity.X * 0.05f, this.velocity.Y * 0.05f), Main.rand.Next(16, 18)); + if (this.type == 12 && this.damage < 500) + { + for (int index = 0; index < 10; ++index) + Dust.NewDust(this.position, this.width, this.height, 57, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, 150, Scale: 1.2f); + for (int index = 0; index < 3; ++index) + Gore.NewGore(this.position, new Vector2(this.velocity.X * 0.05f, this.velocity.Y * 0.05f), Main.rand.Next(16, 18)); + } + if ((this.type == 91 || this.type == 92 && (double) this.ai[0] > 0.0) && this.owner == Main.myPlayer) + { + float num57 = this.position.X + (float) Main.rand.Next(-400, 400); + float num58 = this.position.Y - (float) Main.rand.Next(600, 900); + Vector2 vector2 = new Vector2(num57, num58); + float num59 = this.position.X + (float) (this.width / 2) - vector2.X; + float num60 = this.position.Y + (float) (this.height / 2) - vector2.Y; + float num61 = 22f / (float) Math.Sqrt((double) num59 * (double) num59 + (double) num60 * (double) num60); + float SpeedX = num59 * num61; + float SpeedY = num60 * num61; + int damage = this.damage; + int index = Projectile.NewProjectile(num57, num58, SpeedX, SpeedY, 92, damage, this.knockBack, this.owner); + if (this.type == 91) + { + Main.projectile[index].ai[1] = this.position.Y; + Main.projectile[index].ai[0] = 1f; + } + else + Main.projectile[index].ai[1] = this.position.Y; + } + } + else if (this.type == 89) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index352 = 0; index352 < 5; ++index352) + { + int index353 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 68); + Main.dust[index353].noGravity = true; + Main.dust[index353].velocity *= 1.5f; + Main.dust[index353].scale *= 0.9f; + } + if (this.type == 89 && this.owner == Main.myPlayer) + { + for (int index = 0; index < 3; ++index) + { + float SpeedX = (float) (-(double) this.velocity.X * (double) Main.rand.Next(40, 70) * 0.00999999977648258 + (double) Main.rand.Next(-20, 21) * 0.400000005960464); + float SpeedY = (float) (-(double) this.velocity.Y * (double) Main.rand.Next(40, 70) * 0.00999999977648258 + (double) Main.rand.Next(-20, 21) * 0.400000005960464); + Projectile.NewProjectile(this.position.X + SpeedX, this.position.Y + SpeedY, SpeedX, SpeedY, 90, (int) ((double) this.damage * 0.5), 0.0f, this.owner); + } + } + } + else if (this.type == 177) + { + for (int index354 = 0; index354 < 20; ++index354) + { + int index355 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 137, Alpha: Main.rand.Next(0, 101), Scale: ((float) (1.0 + (double) Main.rand.Next(-20, 40) * 0.00999999977648258))); + Main.dust[index355].velocity -= this.oldVelocity * 0.2f; + if (Main.rand.Next(3) == 0) + { + Main.dust[index355].scale *= 0.8f; + Main.dust[index355].velocity *= 0.5f; + } + else + Main.dust[index355].noGravity = true; + } + } + else if (this.type == 119 || this.type == 118 || this.type == 128 || this.type == 359) + { + int num = 10; + if (this.type == 119 || this.type == 359) + num = 20; + Main.PlaySound(SoundID.Item27, this.position); + for (int index356 = 0; index356 < num; ++index356) + { + int index357 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 92); + if (Main.rand.Next(3) != 0) + { + Main.dust[index357].velocity *= 2f; + Main.dust[index357].noGravity = true; + Main.dust[index357].scale *= 1.75f; + } + else + Main.dust[index357].scale *= 0.5f; + } + } + else if (this.type == 309) + { + int num = 10; + Main.PlaySound(SoundID.Item27, this.position); + for (int index358 = 0; index358 < num; ++index358) + { + int index359 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 185); + if (Main.rand.Next(2) == 0) + { + Main.dust[index359].velocity *= 2f; + Main.dust[index359].noGravity = true; + Main.dust[index359].scale *= 1.75f; + } + } + } + else if (this.type == 308) + { + int num = 80; + Main.PlaySound(SoundID.Item27, this.position); + for (int index360 = 0; index360 < num; ++index360) + { + int index361 = Dust.NewDust(new Vector2(this.position.X, this.position.Y + 16f), this.width, this.height - 16, 185); + Main.dust[index361].velocity *= 2f; + Main.dust[index361].noGravity = true; + Main.dust[index361].scale *= 1.15f; + } + } + else if (this.aiStyle == 29 && this.type <= 126) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + int Type = this.type - 121 + 86; + for (int index362 = 0; index362 < 15; ++index362) + { + int index363 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, Type, this.oldVelocity.X, this.oldVelocity.Y, 50, Scale: 1.2f); + Main.dust[index363].noGravity = true; + Main.dust[index363].scale *= 1.25f; + Main.dust[index363].velocity *= 0.5f; + } + } + else if (this.type == 597) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index364 = 0; index364 < 15; ++index364) + { + int index365 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 262, this.oldVelocity.X, this.oldVelocity.Y, 50, Scale: 1.2f); + Main.dust[index365].noGravity = true; + Main.dust[index365].scale *= 1.25f; + Main.dust[index365].velocity *= 0.5f; + } + } + else if (this.type == 337) + { + Main.PlaySound(SoundID.Item27, this.position); + for (int index366 = 0; index366 < 10; ++index366) + { + int index367 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 197); + Main.dust[index367].noGravity = true; + } + } + else if (this.type == 379 || this.type == 377) + { + for (int index368 = 0; index368 < 5; ++index368) + { + int index369 = Dust.NewDust(this.position, this.width, this.height, 171, Alpha: 100); + Main.dust[index369].scale = (float) Main.rand.Next(1, 10) * 0.1f; + Main.dust[index369].noGravity = true; + Main.dust[index369].fadeIn = 1.5f; + Main.dust[index369].velocity *= 0.75f; + } + } + else if (this.type == 80) + { + if ((double) this.ai[0] >= 0.0) + { + Main.PlaySound(SoundID.Item27, this.position); + for (int index = 0; index < 10; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 67); + } + int i = (int) this.position.X / 16; + int j = (int) this.position.Y / 16; + if (Main.tile[i, j] == null) + Main.tile[i, j] = new Tile(); + if (Main.tile[i, j].type == (ushort) sbyte.MaxValue && Main.tile[i, j].active()) + WorldGen.KillTile(i, j); + } + else if (this.type == 76 || this.type == 77 || this.type == 78) + { + for (int index370 = 0; index370 < 5; ++index370) + { + int index371 = Dust.NewDust(this.position, this.width, this.height, 27, Alpha: 80, Scale: 1.5f); + Main.dust[index371].noGravity = true; + } + } + else if (this.type == 55) + { + for (int index372 = 0; index372 < 5; ++index372) + { + int index373 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 18, Scale: 1.5f); + Main.dust[index373].noGravity = true; + } + } + else if (this.type == 51 || this.type == 267) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index = 0; index < 5; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 0, Scale: 0.7f); + } + else if (this.type == 478) + { + if (this.owner == Main.myPlayer) + Projectile.NewProjectile(this.Center.X, this.Center.Y, 0.0f, 0.0f, 480, (int) ((double) this.damage * 0.8), this.knockBack * 0.5f, this.owner); + } + else if (this.type == 477 || this.type == 479) + { + int num = 0; + while (num < 5) + ++num; + Collision.HitTiles(this.position, this.velocity, this.width, this.height); + } + else if (this.type == 2 || this.type == 82) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index = 0; index < 10; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100); + } + else if (this.type == 474) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index = 0; index < 20; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 26, Scale: 0.9f); + } + else if (this.type == 172) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index = 0; index < 20; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 135, Alpha: 100); + } + else if (this.type == 103) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index374 = 0; index374 < 20; ++index374) + { + int index375 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 75, Alpha: 100); + if (Main.rand.Next(2) == 0) + { + Main.dust[index375].scale *= 2.5f; + Main.dust[index375].noGravity = true; + Main.dust[index375].velocity *= 5f; + } + } + } + else if (this.type == 278) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index376 = 0; index376 < 20; ++index376) + { + int index377 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 169, Alpha: 100); + if (Main.rand.Next(2) == 0) + { + Main.dust[index377].scale *= 1.5f; + Main.dust[index377].noGravity = true; + Main.dust[index377].velocity *= 5f; + } + } + } + else if (this.type == 3 || this.type == 48 || this.type == 54 || this.type == 599) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index = 0; index < 10; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 1, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, Scale: 0.75f); + } + else if (this.type == 330) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index = 0; index < 10; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 0, this.velocity.X * 0.4f, this.velocity.Y * 0.4f, Scale: 0.75f); + } + else if (this.type == 4) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index = 0; index < 10; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 14, Alpha: 150, Scale: 1.1f); + } + else if (this.type == 5) + { + Main.PlaySound(SoundID.Item10, this.position); + for (int index = 0; index < 60; ++index) + { + int Type; + switch (Main.rand.Next(3)) + { + case 0: + Type = 15; + break; + case 1: + Type = 57; + break; + default: + Type = 58; + break; + } + Dust.NewDust(this.position, this.width, this.height, Type, this.velocity.X * 0.5f, this.velocity.Y * 0.5f, 150, Scale: 1.5f); + } + } + else if (this.type == 9 || this.type == 12 || this.type == 503) + { + Main.PlaySound(SoundID.Item10, this.position); + int num62 = 10; + int num63 = 3; + if (this.type == 503) + { + num62 = 40; + num63 = 2; + this.velocity = this.velocity / 2f; + } + for (int index = 0; index < num62; ++index) + Dust.NewDust(this.position, this.width, this.height, 58, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, 150, Scale: 1.2f); + for (int index = 0; index < num63; ++index) + { + int Type = Main.rand.Next(16, 18); + if (this.type == 503) + Type = 16; + Gore.NewGore(this.position, new Vector2(this.velocity.X * 0.05f, this.velocity.Y * 0.05f), Type); + } + if (this.type == 12 && this.damage < 100) + { + for (int index = 0; index < 10; ++index) + Dust.NewDust(this.position, this.width, this.height, 57, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, 150, Scale: 1.2f); + for (int index = 0; index < 3; ++index) + Gore.NewGore(this.position, new Vector2(this.velocity.X * 0.05f, this.velocity.Y * 0.05f), Main.rand.Next(16, 18)); + } + } + else if (this.type == 281) + { + Main.PlaySound(4, (int) this.position.X, (int) this.position.Y); + int index378 = Gore.NewGore(this.position, new Vector2((float) Main.rand.Next(-20, 21) * 0.2f, (float) Main.rand.Next(-20, 21) * 0.2f), 76); + Main.gore[index378].velocity -= this.velocity * 0.5f; + int index379 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2((float) Main.rand.Next(-20, 21) * 0.2f, (float) Main.rand.Next(-20, 21) * 0.2f), 77); + Main.gore[index379].velocity -= this.velocity * 0.5f; + Main.PlaySound(SoundID.Item14, this.position); + for (int index380 = 0; index380 < 20; ++index380) + { + int index381 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); + Main.dust[index381].velocity *= 1.4f; + } + for (int index382 = 0; index382 < 10; ++index382) + { + int index383 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 2.5f); + Main.dust[index383].noGravity = true; + Main.dust[index383].velocity *= 5f; + int index384 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 1.5f); + Main.dust[index384].velocity *= 3f; + } + int index385 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index385].velocity *= 0.4f; + ++Main.gore[index385].velocity.X; + ++Main.gore[index385].velocity.Y; + int index386 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index386].velocity *= 0.4f; + --Main.gore[index386].velocity.X; + ++Main.gore[index386].velocity.Y; + int index387 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index387].velocity *= 0.4f; + ++Main.gore[index387].velocity.X; + --Main.gore[index387].velocity.Y; + int index388 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index388].velocity *= 0.4f; + --Main.gore[index388].velocity.X; + --Main.gore[index388].velocity.Y; + this.position.X += (float) (this.width / 2); + this.position.Y += (float) (this.height / 2); + this.width = 128; + this.height = 128; + this.position.X -= (float) (this.width / 2); + this.position.Y -= (float) (this.height / 2); + this.Damage(); + } + else if (this.type == 162) + { + Main.PlaySound(SoundID.Item14, this.position); + for (int index389 = 0; index389 < 20; ++index389) + { + int index390 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); + Main.dust[index390].velocity *= 1.4f; + } + for (int index391 = 0; index391 < 10; ++index391) + { + int index392 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 2.5f); + Main.dust[index392].noGravity = true; + Main.dust[index392].velocity *= 5f; + int index393 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 1.5f); + Main.dust[index393].velocity *= 3f; + } + int index394 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index394].velocity *= 0.4f; + ++Main.gore[index394].velocity.X; + ++Main.gore[index394].velocity.Y; + int index395 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index395].velocity *= 0.4f; + --Main.gore[index395].velocity.X; + ++Main.gore[index395].velocity.Y; + int index396 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index396].velocity *= 0.4f; + ++Main.gore[index396].velocity.X; + --Main.gore[index396].velocity.Y; + int index397 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index397].velocity *= 0.4f; + --Main.gore[index397].velocity.X; + --Main.gore[index397].velocity.Y; + this.position.X += (float) (this.width / 2); + this.position.Y += (float) (this.height / 2); + this.width = 128; + this.height = 128; + this.position.X -= (float) (this.width / 2); + this.position.Y -= (float) (this.height / 2); + this.Damage(); + } + else if (this.type == 240) + { + Main.PlaySound(SoundID.Item14, this.position); + for (int index398 = 0; index398 < 20; ++index398) + { + int index399 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); + Main.dust[index399].velocity *= 1.4f; + } + for (int index400 = 0; index400 < 10; ++index400) + { + int index401 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 2.5f); + Main.dust[index401].noGravity = true; + Main.dust[index401].velocity *= 5f; + int index402 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 1.5f); + Main.dust[index402].velocity *= 3f; + } + int index403 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index403].velocity *= 0.4f; + ++Main.gore[index403].velocity.X; + ++Main.gore[index403].velocity.Y; + int index404 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index404].velocity *= 0.4f; + --Main.gore[index404].velocity.X; + ++Main.gore[index404].velocity.Y; + int index405 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index405].velocity *= 0.4f; + ++Main.gore[index405].velocity.X; + --Main.gore[index405].velocity.Y; + int index406 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index406].velocity *= 0.4f; + --Main.gore[index406].velocity.X; + --Main.gore[index406].velocity.Y; + this.position.X += (float) (this.width / 2); + this.position.Y += (float) (this.height / 2); + this.width = 96; + this.height = 96; + this.position.X -= (float) (this.width / 2); + this.position.Y -= (float) (this.height / 2); + this.Damage(); + } + else + { + int type = this.type; + if (this.type == 283 || this.type == 282) + { + Main.PlaySound(SoundID.Item10, this.position); + for (int index407 = 0; index407 < 10; ++index407) + { + int index408 = Dust.NewDust(this.position, this.width, this.height, 171, Alpha: 100); + Main.dust[index408].scale = (float) Main.rand.Next(1, 10) * 0.1f; + Main.dust[index408].noGravity = true; + Main.dust[index408].fadeIn = 1.5f; + Main.dust[index408].velocity *= 0.75f; + } + } + else if (this.type == 284) + { + for (int index409 = 0; index409 < 10; ++index409) + { + int index410 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, Main.rand.Next(139, 143), (float) (-(double) this.velocity.X * 0.300000011920929), (float) (-(double) this.velocity.Y * 0.300000011920929), Scale: 1.2f); + Main.dust[index410].velocity.X += (float) Main.rand.Next(-50, 51) * 0.01f; + Main.dust[index410].velocity.Y += (float) Main.rand.Next(-50, 51) * 0.01f; + Main.dust[index410].velocity.X *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); + Main.dust[index410].velocity.Y *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); + Main.dust[index410].velocity.X += (float) Main.rand.Next(-50, 51) * 0.05f; + Main.dust[index410].velocity.Y += (float) Main.rand.Next(-50, 51) * 0.05f; + Main.dust[index410].scale *= (float) (1.0 + (double) Main.rand.Next(-30, 31) * 0.00999999977648258); + } + for (int index411 = 0; index411 < 5; ++index411) + { + int index412 = Gore.NewGore(this.position, -this.velocity * 0.3f, Main.rand.Next(276, 283)); + Main.gore[index412].velocity.X += (float) Main.rand.Next(-50, 51) * 0.01f; + Main.gore[index412].velocity.Y += (float) Main.rand.Next(-50, 51) * 0.01f; + Main.gore[index412].velocity.X *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); + Main.gore[index412].velocity.Y *= (float) (1.0 + (double) Main.rand.Next(-50, 51) * 0.00999999977648258); + Main.gore[index412].scale *= (float) (1.0 + (double) Main.rand.Next(-20, 21) * 0.00999999977648258); + Main.gore[index412].velocity.X += (float) Main.rand.Next(-50, 51) * 0.05f; + Main.gore[index412].velocity.Y += (float) Main.rand.Next(-50, 51) * 0.05f; + } + } + else if (this.type == 286) + { + Main.PlaySound(SoundID.Item14, this.position); + for (int index = 0; index < 7; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); + for (int index413 = 0; index413 < 3; ++index413) + { + int index414 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 2.5f); + Main.dust[index414].noGravity = true; + Main.dust[index414].velocity *= 3f; + int index415 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 1.5f); + Main.dust[index415].velocity *= 2f; + } + int index416 = Gore.NewGore(new Vector2(this.position.X - 10f, this.position.Y - 10f), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index416].velocity *= 0.3f; + Main.gore[index416].velocity.X += (float) Main.rand.Next(-10, 11) * 0.05f; + Main.gore[index416].velocity.Y += (float) Main.rand.Next(-10, 11) * 0.05f; + if (this.owner == Main.myPlayer) + { + this.localAI[1] = -1f; + this.maxPenetrate = 0; + this.position.X += (float) (this.width / 2); + this.position.Y += (float) (this.height / 2); + this.width = 80; + this.height = 80; + this.position.X -= (float) (this.width / 2); + this.position.Y -= (float) (this.height / 2); + this.Damage(); + } + } + else if (this.type == 14 || this.type == 20 || this.type == 36 || this.type == 83 || this.type == 84 || this.type == 389 || this.type == 104 || this.type == 279 || this.type == 100 || this.type == 110 || this.type == 180 || this.type == 207 || this.type == 357 || this.type == 242 || this.type == 302 || this.type == 257 || this.type == 259 || this.type == 285 || this.type == 287 || this.type == 576 || this.type == 577) + { + Collision.HitTiles(this.position, this.velocity, this.width, this.height); + Main.PlaySound(SoundID.Item10, this.position); + } + else if (this.type == 660) + { + Collision.HitTiles(this.position, this.velocity, this.width, this.height); + Main.PlaySound(SoundID.Item10, this.position); + int num = Main.rand.Next(4, 10); + for (int index417 = 0; index417 < num; ++index417) + { + int index418 = Dust.NewDust(this.Center, 0, 0, 180, Alpha: 100); + Main.dust[index418].velocity *= 1.6f; + --Main.dust[index418].velocity.Y; + Main.dust[index418].velocity += -this.velocity * (float) ((double) Main.rand.NextFloat() * 2.0 - 1.0) * 0.5f; + Main.dust[index418].scale = 2f; + Main.dust[index418].fadeIn = 0.5f; + Main.dust[index418].noGravity = true; + } + } + else if (this.type == 712) + { + Collision.HitTiles(this.position, this.velocity, this.width, this.height); + Main.PlaySound(SoundID.Item10, this.position); + int num = Main.rand.Next(6, 12); + for (int index419 = 0; index419 < num; ++index419) + { + int index420 = Dust.NewDust(this.Center, 0, 0, 15, Alpha: 100); + Main.dust[index420].velocity *= 1.6f; + --Main.dust[index420].velocity.Y; + Main.dust[index420].velocity += -this.velocity * (float) ((double) Main.rand.NextFloat() * 2.0 - 1.0) * 0.5f; + Main.dust[index420].scale = 1f; + Main.dust[index420].fadeIn = 1.5f; + Main.dust[index420].noGravity = true; + Main.dust[index420].color = new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * 0.3f; + Main.dust[index420].velocity *= 0.7f; + Main.dust[index420].position += Main.dust[index420].velocity * 5f; + } + for (int index = 0; index < 3; ++index) + Gore.NewGoreDirect(this.position, Vector2.Zero, 1008, (float) (1.0 + (double) Main.rand.NextFloatDirection() * 0.200000002980232)).velocity *= 4f; + } + else if (this.type == 638) + { + Collision.HitTiles(this.position, this.velocity, this.width, this.height); + Main.PlaySound(SoundID.Item10, this.position); + int num = Main.rand.Next(2, 5); + for (int index421 = 0; index421 < num; ++index421) + { + int index422 = Dust.NewDust(this.Center, 0, 0, 229, Alpha: 100); + Main.dust[index422].velocity *= 1.6f; + --Main.dust[index422].velocity.Y; + Main.dust[index422].position -= Vector2.One * 4f; + Main.dust[index422].position = Vector2.Lerp(Main.dust[index422].position, this.Center, 0.5f); + Main.dust[index422].noGravity = true; + } + } + else if (this.type == 15 || this.type == 34 || this.type == 321) + { + Main.PlaySound(SoundID.Item10, this.position); + for (int index423 = 0; index423 < 20; ++index423) + { + int index424 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, (float) (-(double) this.velocity.X * 0.200000002980232), (float) (-(double) this.velocity.Y * 0.200000002980232), 100, Scale: 2f); + Main.dust[index424].noGravity = true; + Main.dust[index424].velocity *= 2f; + int index425 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, (float) (-(double) this.velocity.X * 0.200000002980232), (float) (-(double) this.velocity.Y * 0.200000002980232), 100); + Main.dust[index425].velocity *= 2f; + } + } + else if (this.type == 253) + { + Main.PlaySound(SoundID.Item10, this.position); + for (int index426 = 0; index426 < 20; ++index426) + { + int index427 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 135, (float) (-(double) this.velocity.X * 0.200000002980232), (float) (-(double) this.velocity.Y * 0.200000002980232), 100, Scale: 2f); + Main.dust[index427].noGravity = true; + Main.dust[index427].velocity *= 2f; + int index428 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 135, (float) (-(double) this.velocity.X * 0.200000002980232), (float) (-(double) this.velocity.Y * 0.200000002980232), 100); + Main.dust[index428].velocity *= 2f; + } + } + else if (this.type == 95 || this.type == 96) + { + Main.PlaySound(SoundID.Item10, this.position); + for (int index429 = 0; index429 < 20; ++index429) + { + int index430 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 75, (float) (-(double) this.velocity.X * 0.200000002980232), (float) (-(double) this.velocity.Y * 0.200000002980232), 100, Scale: (2f * this.scale)); + Main.dust[index430].noGravity = true; + Main.dust[index430].velocity *= 2f; + int index431 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 75, (float) (-(double) this.velocity.X * 0.200000002980232), (float) (-(double) this.velocity.Y * 0.200000002980232), 100, Scale: (1f * this.scale)); + Main.dust[index431].velocity *= 2f; + } + } + else if (this.type == 79) + { + Main.PlaySound(SoundID.Item10, this.position); + for (int index432 = 0; index432 < 20; ++index432) + { + int index433 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 66, Alpha: 100, newColor: new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), Scale: 2f); + Main.dust[index433].noGravity = true; + Main.dust[index433].velocity *= 4f; + } + } + else if (this.type == 16) + { + if (this.type == 16 && this.penetrate == 1) + { + this.maxPenetrate = -1; + this.penetrate = -1; + int num = 60; + this.position.X -= (float) (num / 2); + this.position.Y -= (float) (num / 2); + this.width += num; + this.height += num; + this.tileCollide = false; + this.velocity = this.velocity * 0.01f; + this.Damage(); + this.scale = 0.01f; + } + this.position.X += (float) (this.width / 2); + this.width = 10; + this.position.X -= (float) (this.width / 2); + this.position.Y += (float) (this.height / 2); + this.height = 10; + this.position.Y -= (float) (this.height / 2); + Main.PlaySound(SoundID.Item10, this.position); + for (int index434 = 0; index434 < 20; ++index434) + { + int index435 = Dust.NewDust(new Vector2(this.position.X - this.velocity.X, this.position.Y - this.velocity.Y), this.width, this.height, 15, Alpha: 100, Scale: 2f); + Main.dust[index435].noGravity = true; + Main.dust[index435].velocity *= 2f; + Dust.NewDust(new Vector2(this.position.X - this.velocity.X, this.position.Y - this.velocity.Y), this.width, this.height, 15, Alpha: 100); + } + } + else if (this.type == 17) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index = 0; index < 5; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 0); + } + else if (this.type == 31 || this.type == 42) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index436 = 0; index436 < 5; ++index436) + { + int index437 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 32); + Main.dust[index437].velocity *= 0.6f; + } + } + else if (this.type >= 411 && this.type <= 414) + { + int Type = 9; + if (this.type == 412 || this.type == 414) + Type = 11; + if (this.type == 413) + Type = 19; + for (int index438 = 0; index438 < 5; ++index438) + { + int index439 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, Type, SpeedY: (this.velocity.Y / 2f)); + Main.dust[index439].noGravity = true; + Main.dust[index439].velocity -= this.velocity * 0.5f; + } + } + else if (this.type == 109) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index440 = 0; index440 < 5; ++index440) + { + int index441 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 51, Scale: 0.6f); + Main.dust[index441].velocity *= 0.6f; + } + } + else if (this.type == 39) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index442 = 0; index442 < 5; ++index442) + { + int index443 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 38); + Main.dust[index443].velocity *= 0.6f; + } + } + else if (this.type == 71) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index444 = 0; index444 < 5; ++index444) + { + int index445 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 53); + Main.dust[index445].velocity *= 0.6f; + } + } + else if (this.type == 40) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index446 = 0; index446 < 5; ++index446) + { + int index447 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 36); + Main.dust[index447].velocity *= 0.6f; + } + } + else if (this.type == 21 || this.type == 471 || this.type == 532) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index = 0; index < 10; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 26, Scale: 0.8f); + } + else if (this.type == 583) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index = 0; index < 10; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 4, Alpha: 100, newColor: new Color(20, 250, 20, 240), Scale: 0.8f); + } + else if (this.type == 584) + { + Main.PlaySound(0, (int) this.position.X, (int) this.position.Y); + for (int index = 0; index < 10; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 4, Alpha: 100, newColor: new Color(250, 20, 120, 240), Scale: 0.8f); + } + else if (this.type == 24) + { + for (int index = 0; index < 10; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 1, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, Scale: 0.75f); + } + else if (this.type == 27) + { + Main.PlaySound(SoundID.Item10, this.position); + for (int index448 = 0; index448 < 30; ++index448) + { + int index449 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 172, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, 100); + Main.dust[index449].noGravity = true; + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 172, this.velocity.X * 0.1f, this.velocity.Y * 0.1f, 100, Scale: 0.5f); + } + } + else if (this.type == 38) + { + for (int index = 0; index < 10; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 42, this.velocity.X * 0.1f, this.velocity.Y * 0.1f); + } + else if (this.type == 44 || this.type == 45) + { + Main.PlaySound(SoundID.Item10, this.position); + for (int index450 = 0; index450 < 30; ++index450) + { + int index451 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 27, this.velocity.X, this.velocity.Y, 100, Scale: 1.7f); + Main.dust[index451].noGravity = true; + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 27, this.velocity.X, this.velocity.Y, 100); + } + } + else if (this.type == 41) + { + Main.PlaySound(SoundID.Item14, this.position); + for (int index = 0; index < 10; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); + for (int index452 = 0; index452 < 5; ++index452) + { + int index453 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 2.5f); + Main.dust[index453].noGravity = true; + Main.dust[index453].velocity *= 3f; + int index454 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 1.5f); + Main.dust[index454].velocity *= 2f; + } + int index455 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index455].velocity *= 0.4f; + Main.gore[index455].velocity.X += (float) Main.rand.Next(-10, 11) * 0.1f; + Main.gore[index455].velocity.Y += (float) Main.rand.Next(-10, 11) * 0.1f; + int index456 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index456].velocity *= 0.4f; + Main.gore[index456].velocity.X += (float) Main.rand.Next(-10, 11) * 0.1f; + Main.gore[index456].velocity.Y += (float) Main.rand.Next(-10, 11) * 0.1f; + if (this.owner == Main.myPlayer) + { + this.penetrate = -1; + this.position.X += (float) (this.width / 2); + this.position.Y += (float) (this.height / 2); + this.width = 64; + this.height = 64; + this.position.X -= (float) (this.width / 2); + this.position.Y -= (float) (this.height / 2); + this.Damage(); + } + } + else if (this.type == 514) + { + Main.PlaySound(SoundID.Item14, this.position); + for (int index457 = 0; index457 < 10; ++index457) + { + int index458 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.3f); + Main.dust[index458].velocity *= 1.4f; + } + for (int index459 = 0; index459 < 6; ++index459) + { + int index460 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 2.1f); + Main.dust[index460].noGravity = true; + Main.dust[index460].velocity *= 4.6f; + int index461 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 1.3f); + Main.dust[index461].velocity *= 3.3f; + if (Main.rand.Next(2) == 0) + { + int index462 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 1.1f); + Main.dust[index462].velocity *= 2.7f; + } + } + if (this.owner == Main.myPlayer) + { + this.penetrate = -1; + this.position.X += (float) (this.width / 2); + this.position.Y += (float) (this.height / 2); + this.width = 112; + this.height = 112; + this.position.X -= (float) (this.width / 2); + this.position.Y -= (float) (this.height / 2); + this.ai[0] = 2f; + this.Damage(); + } + } + else if (this.type == 306) + { + Main.PlaySound(3, (int) this.position.X, (int) this.position.Y); + for (int index463 = 0; index463 < 20; ++index463) + { + int index464 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 184); + Main.dust[index464].scale *= 1.1f; + Main.dust[index464].noGravity = true; + } + for (int index465 = 0; index465 < 30; ++index465) + { + int index466 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 184); + Main.dust[index466].velocity *= 2.5f; + Main.dust[index466].scale *= 0.8f; + Main.dust[index466].noGravity = true; + } + if (this.owner == Main.myPlayer) + { + int num = 2; + if (Main.rand.Next(10) == 0) + ++num; + if (Main.rand.Next(10) == 0) + ++num; + if (Main.rand.Next(10) == 0) + ++num; + for (int index = 0; index < num; ++index) + Projectile.NewProjectile(this.position.X, this.position.Y, (float) Main.rand.Next(-35, 36) * 0.02f * 10f, (float) Main.rand.Next(-35, 36) * 0.02f * 10f, 307, (int) ((double) this.damage * 0.7), (float) (int) ((double) this.knockBack * 0.35), Main.myPlayer); + } + } + else if (this.type == 469) + { + if (this.owner == Main.myPlayer) + { + int num64 = 6; + for (int index467 = 0; index467 < num64; ++index467) + { + if (index467 % 2 != 1 || Main.rand.Next(3) == 0) { - if (Main.tile[i, j] != null && Main.tile[i, j].wall > (ushort) 0 && wallSplode) + Vector2 position = this.position; + Vector2 oldVelocity = this.oldVelocity; + oldVelocity.Normalize(); + oldVelocity *= 8f; + float num65 = (float) Main.rand.Next(-35, 36) * 0.01f; + float num66 = (float) Main.rand.Next(-35, 36) * 0.01f; + Vector2 vector2 = position - oldVelocity * (float) index467; + float SpeedX = num65 + this.oldVelocity.X / 6f; + float SpeedY = num66 + this.oldVelocity.Y / 6f; + int index468 = Projectile.NewProjectile(vector2.X, vector2.Y, SpeedX, SpeedY, Main.player[this.owner].beeType(), Main.player[this.owner].beeDamage(this.damage / 3), Main.player[this.owner].beeKB(0.0f), Main.myPlayer); + Main.projectile[index468].magic = false; + Main.projectile[index468].ranged = true; + Main.projectile[index468].penetrate = 2; + } + } + } + } + else if (this.type == 183) + { + Main.PlaySound(SoundID.Item14, this.position); + for (int index469 = 0; index469 < 20; ++index469) + { + int index470 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); + Main.dust[index470].velocity *= 1f; + } + int index471 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + ++Main.gore[index471].velocity.X; + ++Main.gore[index471].velocity.Y; + Main.gore[index471].velocity *= 0.3f; + int index472 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + --Main.gore[index472].velocity.X; + ++Main.gore[index472].velocity.Y; + Main.gore[index472].velocity *= 0.3f; + int index473 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + ++Main.gore[index473].velocity.X; + --Main.gore[index473].velocity.Y; + Main.gore[index473].velocity *= 0.3f; + int index474 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + --Main.gore[index474].velocity.X; + --Main.gore[index474].velocity.Y; + Main.gore[index474].velocity *= 0.3f; + if (this.owner == Main.myPlayer) + { + int num = Main.rand.Next(15, 25); + for (int index475 = 0; index475 < num; ++index475) + Projectile.NewProjectile(this.position.X, this.position.Y, (float) Main.rand.Next(-35, 36) * 0.02f, (float) Main.rand.Next(-35, 36) * 0.02f, Main.player[this.owner].beeType(), Main.player[this.owner].beeDamage(this.damage), Main.player[this.owner].beeKB(0.0f), Main.myPlayer); + } + } + else if (this.aiStyle == 34) + { + if (this.owner != Main.myPlayer) + this.timeLeft = 60; + Main.PlaySound(SoundID.Item14, this.position); + if (this.type == 167) + { + for (int index476 = 0; index476 < 400; ++index476) + { + float num67 = 16f; + if (index476 < 300) + num67 = 12f; + if (index476 < 200) + num67 = 8f; + if (index476 < 100) + num67 = 4f; + int index477 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), 6, 6, 130, Alpha: 100); + float num68 = Main.dust[index477].velocity.X; + float y = Main.dust[index477].velocity.Y; + if ((double) num68 == 0.0 && (double) y == 0.0) + num68 = 1f; + float num69 = (float) Math.Sqrt((double) num68 * (double) num68 + (double) y * (double) y); + float num70 = num67 / num69; + float num71 = num68 * num70; + float num72 = y * num70; + Main.dust[index477].velocity *= 0.5f; + Main.dust[index477].velocity.X += num71; + Main.dust[index477].velocity.Y += num72; + Main.dust[index477].scale = 1.3f; + Main.dust[index477].noGravity = true; + } + } + if (this.type == 168) + { + for (int index478 = 0; index478 < 400; ++index478) + { + float num73 = (float) (2.0 * ((double) index478 / 100.0)); + if (index478 > 100) + num73 = 10f; + if (index478 > 250) + num73 = 13f; + int index479 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), 6, 6, 131, Alpha: 100); + float num74 = Main.dust[index479].velocity.X; + float y = Main.dust[index479].velocity.Y; + if ((double) num74 == 0.0 && (double) y == 0.0) + num74 = 1f; + float num75 = (float) Math.Sqrt((double) num74 * (double) num74 + (double) y * (double) y); + float num76 = num73 / num75; + float num77; + float num78; + if (index478 <= 200) + { + num77 = num74 * num76; + num78 = y * num76; + } + else + { + num77 = (float) ((double) num74 * (double) num76 * 1.25); + num78 = (float) ((double) y * (double) num76 * 0.75); + } + Main.dust[index479].velocity *= 0.5f; + Main.dust[index479].velocity.X += num77; + Main.dust[index479].velocity.Y += num78; + if (index478 > 100) + { + Main.dust[index479].scale = 1.3f; + Main.dust[index479].noGravity = true; + } + } + } + if (this.type == 169) + { + Vector2 spinningpoint = ((float) Main.rand.NextDouble() * 6.283185f).ToRotationVector2(); + float num79 = (float) Main.rand.Next(5, 9); + float num80 = (float) Main.rand.Next(12, 17); + float num81 = (float) Main.rand.Next(3, 7); + float num82 = 20f; + for (float num83 = 0.0f; (double) num83 < (double) num79; ++num83) + { + for (int index480 = 0; index480 < 2; ++index480) + { + Vector2 vector2_14 = spinningpoint.RotatedBy((index480 == 0 ? 1.0 : -1.0) * 6.28318548202515 / ((double) num79 * 2.0)); + for (float num84 = 0.0f; (double) num84 < (double) num82; ++num84) { - WorldGen.KillWall(i, j); - if (Main.tile[i, j].wall == (ushort) 0 && Main.netMode != 0) - NetMessage.SendData(17, number: 2, number2: ((float) i), number3: ((float) j)); + Vector2 vector2_15 = Vector2.Lerp(spinningpoint, vector2_14, num84 / num82); + float num85 = MathHelper.Lerp(num80, num81, num84 / num82); + int index481 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), 6, 6, 133, Alpha: 100, Scale: 1.3f); + Main.dust[index481].velocity *= 0.1f; + Main.dust[index481].noGravity = true; + Main.dust[index481].velocity += vector2_15 * num85; + } + } + spinningpoint = spinningpoint.RotatedBy(6.28318548202515 / (double) num79); + } + for (float num86 = 0.0f; (double) num86 < (double) num79; ++num86) + { + for (int index482 = 0; index482 < 2; ++index482) + { + Vector2 vector2_16 = spinningpoint.RotatedBy((index482 == 0 ? 1.0 : -1.0) * 6.28318548202515 / ((double) num79 * 2.0)); + for (float num87 = 0.0f; (double) num87 < (double) num82; ++num87) + { + Vector2 vector2_17 = Vector2.Lerp(spinningpoint, vector2_16, num87 / num82); + float num88 = MathHelper.Lerp(num80, num81, num87 / num82) / 2f; + int index483 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), 6, 6, 133, Alpha: 100, Scale: 1.3f); + Main.dust[index483].velocity *= 0.1f; + Main.dust[index483].noGravity = true; + Main.dust[index483].velocity += vector2_17 * num88; + } + } + spinningpoint = spinningpoint.RotatedBy(6.28318548202515 / (double) num79); + } + for (int index484 = 0; index484 < 100; ++index484) + { + float num89 = num80; + int index485 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), 6, 6, 132, Alpha: 100); + float num90 = Main.dust[index485].velocity.X; + float y = Main.dust[index485].velocity.Y; + if ((double) num90 == 0.0 && (double) y == 0.0) + num90 = 1f; + float num91 = (float) Math.Sqrt((double) num90 * (double) num90 + (double) y * (double) y); + float num92 = num89 / num91; + float num93 = num90 * num92; + float num94 = y * num92; + Main.dust[index485].velocity *= 0.5f; + Main.dust[index485].velocity.X += num93; + Main.dust[index485].velocity.Y += num94; + Main.dust[index485].scale = 1.3f; + Main.dust[index485].noGravity = true; + } + } + if (this.type == 170) + { + for (int index486 = 0; index486 < 400; ++index486) + { + int Type = 133; + float num95 = 16f; + if (index486 > 100) + num95 = 11f; + if (index486 > 100) + Type = 134; + if (index486 > 200) + num95 = 8f; + if (index486 > 200) + Type = 133; + if (index486 > 300) + num95 = 5f; + if (index486 > 300) + Type = 134; + int index487 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), 6, 6, Type, Alpha: 100); + float num96 = Main.dust[index487].velocity.X; + float y = Main.dust[index487].velocity.Y; + if ((double) num96 == 0.0 && (double) y == 0.0) + num96 = 1f; + float num97 = (float) Math.Sqrt((double) num96 * (double) num96 + (double) y * (double) y); + float num98 = num95 / num97; + float num99; + float num100; + if (index486 > 300) + { + num99 = (float) ((double) num96 * (double) num98 * 0.699999988079071); + num100 = y * num98; + } + else if (index486 > 200) + { + num99 = num96 * num98; + num100 = (float) ((double) y * (double) num98 * 0.699999988079071); + } + else if (index486 > 100) + { + num99 = (float) ((double) num96 * (double) num98 * 0.699999988079071); + num100 = y * num98; + } + else + { + num99 = num96 * num98; + num100 = (float) ((double) y * (double) num98 * 0.699999988079071); + } + Main.dust[index487].velocity *= 0.5f; + Main.dust[index487].velocity.X += num99; + Main.dust[index487].velocity.Y += num100; + if (Main.rand.Next(3) != 0) + { + Main.dust[index487].scale = 1.3f; + Main.dust[index487].noGravity = true; + } + } + } + if (this.type == 415) + { + Vector2 spinningpoint = ((float) Main.rand.NextDouble() * 6.283185f).ToRotationVector2(); + float num101 = (float) Main.rand.Next(5, 9); + float num102 = (float) Main.rand.Next(10, 15) * 0.66f; + float num103 = (float) Main.rand.Next(4, 7) / 2f; + int num104 = 30; + for (int index488 = 0; (double) index488 < (double) num104 * (double) num101; ++index488) + { + if (index488 % num104 == 0) + spinningpoint = spinningpoint.RotatedBy(6.28318548202515 / (double) num101); + float num105 = MathHelper.Lerp(num103, num102, (float) (index488 % num104) / (float) num104); + int index489 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), 6, 6, 130, Alpha: 100); + Main.dust[index489].velocity *= 0.1f; + Main.dust[index489].velocity += spinningpoint * num105; + Main.dust[index489].scale = 1.3f; + Main.dust[index489].noGravity = true; + } + for (int index490 = 0; index490 < 100; ++index490) + { + float num106 = num102; + if (index490 < 30) + num106 = (float) (((double) num103 + (double) num102) / 2.0); + int index491 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), 6, 6, 130, Alpha: 100); + float num107 = Main.dust[index491].velocity.X; + float y = Main.dust[index491].velocity.Y; + if ((double) num107 == 0.0 && (double) y == 0.0) + num107 = 1f; + float num108 = (float) Math.Sqrt((double) num107 * (double) num107 + (double) y * (double) y); + float num109 = num106 / num108; + float num110 = num107 * num109; + float num111 = y * num109; + Main.dust[index491].velocity *= 0.5f; + Main.dust[index491].velocity.X += num110; + Main.dust[index491].velocity.Y += num111; + Main.dust[index491].scale = 1.3f; + Main.dust[index491].noGravity = true; + } + } + if (this.type == 416) + { + Vector2 spinningpoint1 = ((float) Main.rand.NextDouble() * 6.283185f).ToRotationVector2(); + Vector2 spinningpoint2 = spinningpoint1; + float num112 = (float) (Main.rand.Next(3, 6) * 2); + int num113 = 20; + float num114 = Main.rand.Next(2) == 0 ? 1f : -1f; + bool flag = true; + for (int index492 = 0; (double) index492 < (double) num113 * (double) num112; ++index492) + { + if (index492 % num113 == 0) + { + spinningpoint2 = spinningpoint2.RotatedBy((double) num114 * (6.28318548202515 / (double) num112)); + spinningpoint1 = spinningpoint2; + flag = !flag; + } + else + { + float num115 = 6.283185f / ((float) num113 * num112); + spinningpoint1 = spinningpoint1.RotatedBy((double) num115 * (double) num114 * 3.0); + } + float num116 = MathHelper.Lerp(1f, 8f, (float) (index492 % num113) / (float) num113); + int index493 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), 6, 6, 131, Alpha: 100, Scale: 1.4f); + Main.dust[index493].velocity *= 0.1f; + Main.dust[index493].velocity += spinningpoint1 * num116; + if (flag) + Main.dust[index493].scale = 0.9f; + Main.dust[index493].noGravity = true; + } + } + if (this.type == 417) + { + float num117 = (float) Main.rand.NextDouble() * 6.283185f; + float num118 = (float) Main.rand.NextDouble() * 6.283185f; + float num119 = (float) (4.0 + Main.rand.NextDouble() * 3.0); + float num120 = (float) (4.0 + Main.rand.NextDouble() * 3.0); + float num121 = num119; + if ((double) num120 > (double) num121) + num121 = num120; + for (int index494 = 0; index494 < 150; ++index494) + { + int Type = 132; + float num122 = num121; + if (index494 > 50) + num122 = num120; + if (index494 > 50) + Type = 133; + if (index494 > 100) + num122 = num119; + if (index494 > 100) + Type = 132; + int index495 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), 6, 6, Type, Alpha: 100); + Vector2 velocity = Main.dust[index495].velocity; + velocity.Normalize(); + Vector2 spinningpoint = velocity * num122; + if (index494 > 100) + { + spinningpoint.X *= 0.5f; + spinningpoint = spinningpoint.RotatedBy((double) num117); + } + else if (index494 > 50) + { + spinningpoint.Y *= 0.5f; + spinningpoint = spinningpoint.RotatedBy((double) num118); + } + Main.dust[index495].velocity *= 0.2f; + Main.dust[index495].velocity += spinningpoint; + if (index494 <= 200) + { + Main.dust[index495].scale = 1.3f; + Main.dust[index495].noGravity = true; + } + } + } + if (this.type == 418) + { + Vector2 spinningpoint = ((float) Main.rand.NextDouble() * 6.283185f).ToRotationVector2(); + float num123 = (float) Main.rand.Next(5, 12); + float num124 = (float) Main.rand.Next(9, 14) * 0.66f; + float num125 = (float) Main.rand.Next(2, 4) * 0.66f; + float num126 = 15f; + for (float num127 = 0.0f; (double) num127 < (double) num123; ++num127) + { + for (int index496 = 0; index496 < 2; ++index496) + { + Vector2 vector2_18 = spinningpoint.RotatedBy((index496 == 0 ? 1.0 : -1.0) * 6.28318548202515 / ((double) num123 * 2.0)); + for (float num128 = 0.0f; (double) num128 < (double) num126; ++num128) + { + Vector2 vector2_19 = Vector2.SmoothStep(spinningpoint, vector2_18, num128 / num126); + float num129 = MathHelper.SmoothStep(num124, num125, num128 / num126); + int index497 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), 6, 6, 134, Alpha: 100, Scale: 1.3f); + Main.dust[index497].velocity *= 0.1f; + Main.dust[index497].noGravity = true; + Main.dust[index497].velocity += vector2_19 * num129; + } + } + spinningpoint = spinningpoint.RotatedBy(6.28318548202515 / (double) num123); + } + for (int index498 = 0; index498 < 120; ++index498) + { + float num130 = num124; + int Type = 133; + if (index498 < 80) + num130 = num125 - 0.5f; + else + Type = 131; + int index499 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), 6, 6, Type, Alpha: 100); + float num131 = Main.dust[index499].velocity.X; + float y = Main.dust[index499].velocity.Y; + if ((double) num131 == 0.0 && (double) y == 0.0) + num131 = 1f; + float num132 = (float) Math.Sqrt((double) num131 * (double) num131 + (double) y * (double) y); + float num133 = num130 / num132; + float num134 = num131 * num133; + float num135 = y * num133; + Main.dust[index499].velocity *= 0.2f; + Main.dust[index499].velocity.X += num134; + Main.dust[index499].velocity.Y += num135; + Main.dust[index499].scale = 1.3f; + Main.dust[index499].noGravity = true; + } + } + this.position.X += (float) (this.width / 2); + this.position.Y += (float) (this.height / 2); + this.width = 192; + this.height = 192; + this.position.X -= (float) (this.width / 2); + this.position.Y -= (float) (this.height / 2); + this.penetrate = -1; + this.Damage(); + } + else if (this.type == 312) + { + Main.PlaySound(SoundID.Item14, this.position); + this.position.X += (float) (this.width / 2); + this.position.Y += (float) (this.height / 2); + this.width = 22; + this.height = 22; + this.position.X -= (float) (this.width / 2); + this.position.Y -= (float) (this.height / 2); + for (int index500 = 0; index500 < 30; ++index500) + { + int index501 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); + Main.dust[index501].velocity *= 1.4f; + } + for (int index502 = 0; index502 < 20; ++index502) + { + int index503 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 3.5f); + Main.dust[index503].noGravity = true; + Main.dust[index503].velocity *= 7f; + int index504 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 1.5f); + Main.dust[index504].velocity *= 3f; + } + for (int index505 = 0; index505 < 2; ++index505) + { + float num = 0.4f; + if (index505 == 1) + num = 0.8f; + int index506 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index506].velocity *= num; + ++Main.gore[index506].velocity.X; + ++Main.gore[index506].velocity.Y; + int index507 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index507].velocity *= num; + --Main.gore[index507].velocity.X; + ++Main.gore[index507].velocity.Y; + int index508 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index508].velocity *= num; + ++Main.gore[index508].velocity.X; + --Main.gore[index508].velocity.Y; + int index509 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index509].velocity *= num; + --Main.gore[index509].velocity.X; + --Main.gore[index509].velocity.Y; + } + this.position.X += (float) (this.width / 2); + this.position.Y += (float) (this.height / 2); + this.width = 128; + this.height = 128; + this.position.X -= (float) (this.width / 2); + this.position.Y -= (float) (this.height / 2); + this.Damage(); + } + else if (this.type == 133 || this.type == 134 || this.type == 135 || this.type == 136 || this.type == 137 || this.type == 138 || this.type == 303 || this.type == 338 || this.type == 339) + { + if (this.type == 30 || this.type == 133 || this.type == 136 || this.type == 139) + Main.PlaySound(SoundID.Item62, this.position); + else + Main.PlaySound(SoundID.Item14, this.position); + this.position.X += (float) (this.width / 2); + this.position.Y += (float) (this.height / 2); + this.width = 22; + this.height = 22; + this.position.X -= (float) (this.width / 2); + this.position.Y -= (float) (this.height / 2); + for (int index510 = 0; index510 < 30; ++index510) + { + int index511 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); + Main.dust[index511].velocity *= 1.4f; + } + for (int index512 = 0; index512 < 20; ++index512) + { + int index513 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 3.5f); + Main.dust[index513].noGravity = true; + Main.dust[index513].velocity *= 7f; + int index514 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 1.5f); + Main.dust[index514].velocity *= 3f; + } + for (int index515 = 0; index515 < 2; ++index515) + { + float num = 0.4f; + if (index515 == 1) + num = 0.8f; + int index516 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index516].velocity *= num; + ++Main.gore[index516].velocity.X; + ++Main.gore[index516].velocity.Y; + int index517 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index517].velocity *= num; + --Main.gore[index517].velocity.X; + ++Main.gore[index517].velocity.Y; + int index518 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index518].velocity *= num; + ++Main.gore[index518].velocity.X; + --Main.gore[index518].velocity.Y; + int index519 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index519].velocity *= num; + --Main.gore[index519].velocity.X; + --Main.gore[index519].velocity.Y; + } + } + else if (this.type == 139 || this.type == 140 || this.type == 141 || this.type == 142 || this.type == 143 || this.type == 144 || this.type == 340 || this.type == 341) + { + if (this.type == 30 || this.type == 133 || this.type == 136 || this.type == 139) + Main.PlaySound(SoundID.Item62, this.position); + else + Main.PlaySound(SoundID.Item14, this.position); + this.position.X += (float) (this.width / 2); + this.position.Y += (float) (this.height / 2); + this.width = 80; + this.height = 80; + this.position.X -= (float) (this.width / 2); + this.position.Y -= (float) (this.height / 2); + for (int index520 = 0; index520 < 40; ++index520) + { + int index521 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 2f); + Main.dust[index521].velocity *= 3f; + if (Main.rand.Next(2) == 0) + { + Main.dust[index521].scale = 0.5f; + Main.dust[index521].fadeIn = (float) (1.0 + (double) Main.rand.Next(10) * 0.100000001490116); + } + } + for (int index522 = 0; index522 < 70; ++index522) + { + int index523 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 3f); + Main.dust[index523].noGravity = true; + Main.dust[index523].velocity *= 5f; + int index524 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 2f); + Main.dust[index524].velocity *= 2f; + } + for (int index525 = 0; index525 < 3; ++index525) + { + float num = 0.33f; + if (index525 == 1) + num = 0.66f; + if (index525 == 2) + num = 1f; + int index526 = Gore.NewGore(new Vector2((float) ((double) this.position.X + (double) (this.width / 2) - 24.0), (float) ((double) this.position.Y + (double) (this.height / 2) - 24.0)), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index526].velocity *= num; + ++Main.gore[index526].velocity.X; + ++Main.gore[index526].velocity.Y; + int index527 = Gore.NewGore(new Vector2((float) ((double) this.position.X + (double) (this.width / 2) - 24.0), (float) ((double) this.position.Y + (double) (this.height / 2) - 24.0)), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index527].velocity *= num; + --Main.gore[index527].velocity.X; + ++Main.gore[index527].velocity.Y; + int index528 = Gore.NewGore(new Vector2((float) ((double) this.position.X + (double) (this.width / 2) - 24.0), (float) ((double) this.position.Y + (double) (this.height / 2) - 24.0)), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index528].velocity *= num; + ++Main.gore[index528].velocity.X; + --Main.gore[index528].velocity.Y; + int index529 = Gore.NewGore(new Vector2((float) ((double) this.position.X + (double) (this.width / 2) - 24.0), (float) ((double) this.position.Y + (double) (this.height / 2) - 24.0)), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index529].velocity *= num; + --Main.gore[index529].velocity.X; + --Main.gore[index529].velocity.Y; + } + this.position.X += (float) (this.width / 2); + this.position.Y += (float) (this.height / 2); + this.width = 10; + this.height = 10; + this.position.X -= (float) (this.width / 2); + this.position.Y -= (float) (this.height / 2); + } + else if (this.type == 246) + { + Main.PlaySound(SoundID.Item14, this.position); + for (int index530 = 0; index530 < 10; ++index530) + { + int index531 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); + Main.dust[index531].velocity *= 0.9f; + } + for (int index532 = 0; index532 < 5; ++index532) + { + int index533 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 2.5f); + Main.dust[index533].noGravity = true; + Main.dust[index533].velocity *= 3f; + int index534 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 1.5f); + Main.dust[index534].velocity *= 2f; + } + int index535 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index535].velocity *= 0.3f; + Main.gore[index535].velocity.X += (float) Main.rand.Next(-1, 2); + Main.gore[index535].velocity.Y += (float) Main.rand.Next(-1, 2); + this.position.X += (float) (this.width / 2); + this.position.Y += (float) (this.height / 2); + this.width = 150; + this.height = 150; + this.position.X -= (float) (this.width / 2); + this.position.Y -= (float) (this.height / 2); + this.penetrate = -1; + this.maxPenetrate = 0; + this.Damage(); + if (this.owner == Main.myPlayer) + { + int num136 = Main.rand.Next(2, 6); + for (int index536 = 0; index536 < num136; ++index536) + { + float num137 = (float) Main.rand.Next(-100, 101) + 0.01f; + float num138 = (float) Main.rand.Next(-100, 101); + float num139 = num137 - 0.01f; + float num140 = 8f / (float) Math.Sqrt((double) num139 * (double) num139 + (double) num138 * (double) num138); + int index537 = Projectile.NewProjectile(this.Center.X - this.oldVelocity.X, this.Center.Y - this.oldVelocity.Y, num139 * num140, num138 * num140, 249, this.damage, this.knockBack, this.owner); + Main.projectile[index537].maxPenetrate = 0; + } + } + } + else if (this.type == 249) + { + Main.PlaySound(SoundID.Item14, this.position); + for (int index538 = 0; index538 < 7; ++index538) + { + int index539 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); + Main.dust[index539].velocity *= 0.8f; + } + for (int index540 = 0; index540 < 2; ++index540) + { + int index541 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 2.5f); + Main.dust[index541].noGravity = true; + Main.dust[index541].velocity *= 2.5f; + int index542 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 1.5f); + Main.dust[index542].velocity *= 1.5f; + } + int index = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index].velocity *= 0.2f; + Main.gore[index].velocity.X += (float) Main.rand.Next(-1, 2); + Main.gore[index].velocity.Y += (float) Main.rand.Next(-1, 2); + this.position.X += (float) (this.width / 2); + this.position.Y += (float) (this.height / 2); + this.width = 100; + this.height = 100; + this.position.X -= (float) (this.width / 2); + this.position.Y -= (float) (this.height / 2); + this.penetrate = -1; + this.Damage(); + } + else if (this.type == 588) + { + Main.PlaySound(SoundID.Item14, this.position); + this.position = this.Center; + this.width = this.height = 22; + this.Center = this.position; + for (int index543 = 0; index543 < 8; ++index543) + { + int index544 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 219 + Main.rand.Next(5)); + Main.dust[index544].velocity *= 1.4f; + Main.dust[index544].fadeIn = 1f; + Main.dust[index544].noGravity = true; + } + for (int index545 = 0; index545 < 15; ++index545) + { + int index546 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 139 + Main.rand.Next(4), Scale: 1.6f); + Main.dust[index546].noGravity = true; + Main.dust[index546].velocity *= 5f; + int index547 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 139 + Main.rand.Next(4), Scale: 1.9f); + Main.dust[index547].velocity *= 3f; + } + if (Main.rand.Next(2) == 0) + { + int index = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(276, 283)); + Main.gore[index].velocity *= 0.4f; + ++Main.gore[index].velocity.X; + ++Main.gore[index].velocity.Y; + } + if (Main.rand.Next(2) == 0) + { + int index = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(276, 283)); + Main.gore[index].velocity *= 0.4f; + --Main.gore[index].velocity.X; + ++Main.gore[index].velocity.Y; + } + if (Main.rand.Next(2) == 0) + { + int index = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(276, 283)); + Main.gore[index].velocity *= 0.4f; + ++Main.gore[index].velocity.X; + --Main.gore[index].velocity.Y; + } + if (Main.rand.Next(2) == 0) + { + int index = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(276, 283)); + Main.gore[index].velocity *= 0.4f; + --Main.gore[index].velocity.X; + --Main.gore[index].velocity.Y; + } + } + else if (this.type == 28 || this.type == 30 || this.type == 37 || this.type == 75 || this.type == 102 || this.type == 164 || this.type == 397 || this.type == 517 || this.type == 516 || this.type == 519) + { + Main.PlaySound(SoundID.Item14, this.position); + this.position.X += (float) (this.width / 2); + this.position.Y += (float) (this.height / 2); + this.width = 22; + this.height = 22; + this.position.X -= (float) (this.width / 2); + this.position.Y -= (float) (this.height / 2); + for (int index548 = 0; index548 < 20; ++index548) + { + int index549 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 1.5f); + Main.dust[index549].velocity *= 1.4f; + } + for (int index550 = 0; index550 < 10; ++index550) + { + int index551 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 2.5f); + Main.dust[index551].noGravity = true; + Main.dust[index551].velocity *= 5f; + int index552 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 1.5f); + Main.dust[index552].velocity *= 3f; + } + int index553 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index553].velocity *= 0.4f; + ++Main.gore[index553].velocity.X; + ++Main.gore[index553].velocity.Y; + int index554 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index554].velocity *= 0.4f; + --Main.gore[index554].velocity.X; + ++Main.gore[index554].velocity.Y; + int index555 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index555].velocity *= 0.4f; + ++Main.gore[index555].velocity.X; + --Main.gore[index555].velocity.Y; + int index556 = Gore.NewGore(new Vector2(this.position.X, this.position.Y), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index556].velocity *= 0.4f; + --Main.gore[index556].velocity.X; + --Main.gore[index556].velocity.Y; + if (this.type == 102) + { + this.position.X += (float) (this.width / 2); + this.position.Y += (float) (this.height / 2); + this.width = 128; + this.height = 128; + this.position.X -= (float) (this.width / 2); + this.position.Y -= (float) (this.height / 2); + this.damage = 40; + this.Damage(); + } + } + else if (this.type == 29 || this.type == 108 || this.type == 470 || this.type == 637) + { + Main.PlaySound(SoundID.Item14, this.position); + if (this.type == 29) + { + this.position.X += (float) (this.width / 2); + this.position.Y += (float) (this.height / 2); + this.width = 200; + this.height = 200; + this.position.X -= (float) (this.width / 2); + this.position.Y -= (float) (this.height / 2); + } + for (int index557 = 0; index557 < 50; ++index557) + { + int index558 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 31, Alpha: 100, Scale: 2f); + Main.dust[index558].velocity *= 1.4f; + } + for (int index559 = 0; index559 < 80; ++index559) + { + int index560 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 3f); + Main.dust[index560].noGravity = true; + Main.dust[index560].velocity *= 5f; + int index561 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 6, Alpha: 100, Scale: 2f); + Main.dust[index561].velocity *= 3f; + } + for (int index562 = 0; index562 < 2; ++index562) + { + int index563 = Gore.NewGore(new Vector2((float) ((double) this.position.X + (double) (this.width / 2) - 24.0), (float) ((double) this.position.Y + (double) (this.height / 2) - 24.0)), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index563].scale = 1.5f; + Main.gore[index563].velocity.X += 1.5f; + Main.gore[index563].velocity.Y += 1.5f; + int index564 = Gore.NewGore(new Vector2((float) ((double) this.position.X + (double) (this.width / 2) - 24.0), (float) ((double) this.position.Y + (double) (this.height / 2) - 24.0)), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index564].scale = 1.5f; + Main.gore[index564].velocity.X -= 1.5f; + Main.gore[index564].velocity.Y += 1.5f; + int index565 = Gore.NewGore(new Vector2((float) ((double) this.position.X + (double) (this.width / 2) - 24.0), (float) ((double) this.position.Y + (double) (this.height / 2) - 24.0)), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index565].scale = 1.5f; + Main.gore[index565].velocity.X += 1.5f; + Main.gore[index565].velocity.Y -= 1.5f; + int index566 = Gore.NewGore(new Vector2((float) ((double) this.position.X + (double) (this.width / 2) - 24.0), (float) ((double) this.position.Y + (double) (this.height / 2) - 24.0)), new Vector2(), Main.rand.Next(61, 64)); + Main.gore[index566].scale = 1.5f; + Main.gore[index566].velocity.X -= 1.5f; + Main.gore[index566].velocity.Y -= 1.5f; + } + this.position.X += (float) (this.width / 2); + this.position.Y += (float) (this.height / 2); + this.width = 10; + this.height = 10; + this.position.X -= (float) (this.width / 2); + this.position.Y -= (float) (this.height / 2); + } + else if (this.type == 69) + { + Main.PlaySound(13, (int) this.position.X, (int) this.position.Y); + for (int index = 0; index < 5; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 13); + for (int index567 = 0; index567 < 30; ++index567) + { + int index568 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 33, SpeedY: -2f, Scale: 1.1f); + Main.dust[index568].alpha = 100; + Main.dust[index568].velocity.X *= 1.5f; + Main.dust[index568].velocity *= 3f; + } + } + else if (this.type == 70) + { + Main.PlaySound(13, (int) this.position.X, (int) this.position.Y); + for (int index = 0; index < 5; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 13); + for (int index569 = 0; index569 < 30; ++index569) + { + int index570 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 52, SpeedY: -2f, Scale: 1.1f); + Main.dust[index570].alpha = 100; + Main.dust[index570].velocity.X *= 1.5f; + Main.dust[index570].velocity *= 3f; + } + } + else if (this.type == 621) + { + Main.PlaySound(13, (int) this.position.X, (int) this.position.Y); + for (int index = 0; index < 5; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 13); + for (int index571 = 0; index571 < 30; ++index571) + { + int index572 = Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 266, SpeedY: -2f, Scale: 1.1f); + Main.dust[index572].alpha = 100; + Main.dust[index572].velocity.X *= 1.5f; + Main.dust[index572].velocity *= 3f; + } + } + else if (this.type == 114 || this.type == 115) + { + Main.PlaySound(SoundID.Item10, this.position); + for (int index573 = 4; index573 < 31; ++index573) + { + float num141 = this.oldVelocity.X * (30f / (float) index573); + float num142 = this.oldVelocity.Y * (30f / (float) index573); + int index574 = Dust.NewDust(new Vector2(this.position.X - num141, this.position.Y - num142), 8, 8, 27, this.oldVelocity.X, this.oldVelocity.Y, 100, Scale: 1.4f); + Main.dust[index574].noGravity = true; + Main.dust[index574].velocity *= 0.5f; + int index575 = Dust.NewDust(new Vector2(this.position.X - num141, this.position.Y - num142), 8, 8, 27, this.oldVelocity.X, this.oldVelocity.Y, 100, Scale: 0.9f); + Main.dust[index575].velocity *= 0.5f; + } + } + else if (this.type == 116) + { + Main.PlaySound(SoundID.Item10, this.position); + for (int index576 = 4; index576 < 31; ++index576) + { + float num143 = this.oldVelocity.X * (30f / (float) index576); + float num144 = this.oldVelocity.Y * (30f / (float) index576); + int index577 = Dust.NewDust(new Vector2(this.position.X - num143, this.position.Y - num144), 8, 8, 64, this.oldVelocity.X, this.oldVelocity.Y, 100, Scale: 1.8f); + Main.dust[index577].noGravity = true; + int index578 = Dust.NewDust(new Vector2(this.position.X - num143, this.position.Y - num144), 8, 8, 64, this.oldVelocity.X, this.oldVelocity.Y, 100, Scale: 1.4f); + Main.dust[index578].noGravity = true; + } + } + else if (this.type == 173) + { + Main.PlaySound(SoundID.Item10, this.position); + for (int index579 = 4; index579 < 24; ++index579) + { + float num145 = this.oldVelocity.X * (30f / (float) index579); + float num146 = this.oldVelocity.Y * (30f / (float) index579); + int Type; + switch (Main.rand.Next(3)) + { + case 0: + Type = 15; + break; + case 1: + Type = 57; + break; + default: + Type = 58; + break; + } + int index580 = Dust.NewDust(new Vector2(this.position.X - num145, this.position.Y - num146), 8, 8, Type, this.oldVelocity.X * 0.2f, this.oldVelocity.Y * 0.2f, 100, Scale: 1.8f); + Main.dust[index580].velocity *= 1.5f; + Main.dust[index580].noGravity = true; + } + } + else if (this.type == 132) + { + Main.PlaySound(SoundID.Item10, this.position); + for (int index581 = 4; index581 < 31; ++index581) + { + float num147 = this.oldVelocity.X * (30f / (float) index581); + float num148 = this.oldVelocity.Y * (30f / (float) index581); + int index582 = Dust.NewDust(new Vector2(this.oldPosition.X - num147, this.oldPosition.Y - num148), 8, 8, 107, this.oldVelocity.X, this.oldVelocity.Y, 100, Scale: 1.8f); + Main.dust[index582].noGravity = true; + Main.dust[index582].velocity *= 0.5f; + int index583 = Dust.NewDust(new Vector2(this.oldPosition.X - num147, this.oldPosition.Y - num148), 8, 8, 107, this.oldVelocity.X, this.oldVelocity.Y, 100, Scale: 1.4f); + Main.dust[index583].velocity *= 0.05f; + } + } + else if (this.type == 156) + { + Main.PlaySound(SoundID.Item10, this.position); + for (int index584 = 4; index584 < 31; ++index584) + { + float num149 = this.oldVelocity.X * (30f / (float) index584); + float num150 = this.oldVelocity.Y * (30f / (float) index584); + int index585 = Dust.NewDust(new Vector2(this.oldPosition.X - num149, this.oldPosition.Y - num150), 8, 8, 73, this.oldVelocity.X, this.oldVelocity.Y, (int) byte.MaxValue, Scale: 1.8f); + Main.dust[index585].noGravity = true; + Main.dust[index585].velocity *= 0.5f; + int index586 = Dust.NewDust(new Vector2(this.oldPosition.X - num149, this.oldPosition.Y - num150), 8, 8, 73, this.oldVelocity.X, this.oldVelocity.Y, (int) byte.MaxValue, Scale: 1.4f); + Main.dust[index586].velocity *= 0.05f; + Main.dust[index586].noGravity = true; + } + } + else if (this.type == 157) + { + Main.PlaySound(SoundID.Item10, this.position); + for (int index587 = 4; index587 < 31; ++index587) + { + int index588 = Dust.NewDust(this.position, this.width, this.height, 107, this.oldVelocity.X, this.oldVelocity.Y, 100, Scale: 1.8f); + Main.dust[index588].noGravity = true; + Main.dust[index588].velocity *= 0.5f; + } + } + else if (this.type == 370) + { + Main.PlaySound(SoundID.Item4, this.position); + for (int index = 0; index < 5; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 13); + for (int index589 = 0; index589 < 30; ++index589) + { + Vector2 vector2 = new Vector2((float) Main.rand.Next(-10, 11), (float) Main.rand.Next(-10, 11)); + vector2.Normalize(); + int index590 = Gore.NewGore(this.Center + vector2 * 10f, vector2 * (float) Main.rand.Next(4, 9) * 0.66f + Vector2.UnitY * 1.5f, 331, (float) Main.rand.Next(40, 141) * 0.01f); + Main.gore[index590].sticky = false; + } + } + else if (this.type == 371) + { + Main.PlaySound(13, (int) this.position.X, (int) this.position.Y); + Main.PlaySound(SoundID.Item16, this.position); + for (int index = 0; index < 5; ++index) + Dust.NewDust(new Vector2(this.position.X, this.position.Y), this.width, this.height, 13); + for (int index591 = 0; index591 < 30; ++index591) + { + Vector2 vector2 = new Vector2((float) Main.rand.Next(-10, 11), (float) Main.rand.Next(-10, 11)); + vector2.Normalize(); + vector2 *= 0.4f; + int index592 = Gore.NewGore(this.Center + vector2 * 10f, vector2 * (float) Main.rand.Next(4, 9) * 0.66f + Vector2.UnitY * 1.5f, Main.rand.Next(435, 438), (float) Main.rand.Next(20, 100) * 0.01f); + Main.gore[index592].sticky = false; + } + } + } + } + if (this.owner == Main.myPlayer && (this.type == 370 || this.type == 371)) + { + float num = 80f; + int type = 119; + if (this.type == 371) + type = 120; + for (int index = 0; index < (int) byte.MaxValue; ++index) + { + Player player = Main.player[index]; + if (player.active && !player.dead && (double) Vector2.Distance(this.Center, player.Center) < (double) num) + player.AddBuff(type, 1800, false); + } + for (int index = 0; index < 200; ++index) + { + NPC npc = Main.npc[index]; + if (npc.active && npc.life > 0 && (double) Vector2.Distance(this.Center, npc.Center) < (double) num) + npc.AddBuff(type, 1800); + } + } + if (this.owner == Main.myPlayer) + { + if (this.type == 28 || this.type == 29 || this.type == 37 || this.type == 108 || this.type == 136 || this.type == 137 || this.type == 138 || this.type == 142 || this.type == 143 || this.type == 144 || this.type == 339 || this.type == 341 || this.type == 470 || this.type == 516 || this.type == 519 || this.type == 637) + { + int num151 = 3; + if (this.type == 28 || this.type == 37 || this.type == 516 || this.type == 519) + num151 = 4; + if (this.type == 29 || this.type == 470 || this.type == 637) + num151 = 7; + if (this.type == 142 || this.type == 143 || this.type == 144 || this.type == 341) + num151 = 5; + if (this.type == 108) + num151 = 10; + int num152 = (int) ((double) this.position.X / 16.0 - (double) num151); + int num153 = (int) ((double) this.position.X / 16.0 + (double) num151); + int num154 = (int) ((double) this.position.Y / 16.0 - (double) num151); + int num155 = (int) ((double) this.position.Y / 16.0 + (double) num151); + if (num152 < 0) + num152 = 0; + if (num153 > Main.maxTilesX) + num153 = Main.maxTilesX; + if (num154 < 0) + num154 = 0; + if (num155 > Main.maxTilesY) + num155 = Main.maxTilesY; + bool flag1 = false; + for (int index593 = num152; index593 <= num153; ++index593) + { + for (int index594 = num154; index594 <= num155; ++index594) + { + float num156 = Math.Abs((float) index593 - this.position.X / 16f); + float num157 = Math.Abs((float) index594 - this.position.Y / 16f); + if (Math.Sqrt((double) num156 * (double) num156 + (double) num157 * (double) num157) < (double) num151 && Main.tile[index593, index594] != null && Main.tile[index593, index594].wall == (byte) 0) + { + flag1 = true; + break; + } + } + } + AchievementsHelper.CurrentlyMining = true; + for (int i1 = num152; i1 <= num153; ++i1) + { + for (int j1 = num154; j1 <= num155; ++j1) + { + float num158 = Math.Abs((float) i1 - this.position.X / 16f); + float num159 = Math.Abs((float) j1 - this.position.Y / 16f); + if (Math.Sqrt((double) num158 * (double) num158 + (double) num159 * (double) num159) < (double) num151) + { + bool flag2 = true; + if (Main.tile[i1, j1] != null && Main.tile[i1, j1].active()) + { + flag2 = true; + if (Main.tileDungeon[(int) Main.tile[i1, j1].type] || Main.tile[i1, j1].type == (ushort) 88 || TileID.Sets.BasicChest[(int) Main.tile[i1, j1].type] || Main.tile[i1, j1].type == (ushort) 26 || Main.tile[i1, j1].type == (ushort) 107 || Main.tile[i1, j1].type == (ushort) 108 || Main.tile[i1, j1].type == (ushort) 111 || Main.tile[i1, j1].type == (ushort) 226 || Main.tile[i1, j1].type == (ushort) 237 || Main.tile[i1, j1].type == (ushort) 221 || Main.tile[i1, j1].type == (ushort) 222 || Main.tile[i1, j1].type == (ushort) 223 || Main.tile[i1, j1].type == (ushort) 211 || Main.tile[i1, j1].type == (ushort) 404) + flag2 = false; + if (!Main.hardMode && Main.tile[i1, j1].type == (ushort) 58) + flag2 = false; + if (flag2) + { + WorldGen.KillTile(i1, j1); + if (!Main.tile[i1, j1].active() && Main.netMode != 0) + NetMessage.SendData(17, number2: ((float) i1), number3: ((float) j1)); + } + } + if (flag2) + { + for (int i2 = i1 - 1; i2 <= i1 + 1; ++i2) + { + for (int j2 = j1 - 1; j2 <= j1 + 1; ++j2) + { + if (Main.tile[i2, j2] != null && Main.tile[i2, j2].wall > (byte) 0 && flag1) + { + WorldGen.KillWall(i2, j2); + if (Main.tile[i2, j2].wall == (byte) 0 && Main.netMode != 0) + NetMessage.SendData(17, number: 2, number2: ((float) i2), number3: ((float) j2)); + } + } } } } } } + AchievementsHelper.CurrentlyMining = false; } - } - AchievementsHelper.CurrentlyMining = false; - } - - private void ExplodeCrackedTiles( - Vector2 compareSpot, - int radius, - int minI, - int maxI, - int minJ, - int maxJ) - { - AchievementsHelper.CurrentlyMining = true; - for (int i = minI; i <= maxI; ++i) - { - for (int j = minJ; j <= maxJ; ++j) + if (Main.netMode != 0) + NetMessage.SendData(29, number: this.identity, number2: ((float) this.owner)); + if (!this.noDropItem) { - double num1 = (double) Math.Abs((float) i - compareSpot.X / 16f); - float num2 = Math.Abs((float) j - compareSpot.Y / 16f); - if (Math.Sqrt(num1 * num1 + (double) num2 * (double) num2) < (double) radius) + int number = -1; + if (this.aiStyle == 10) { - bool flag = false; - if (Main.tile[i, j] != null && Main.tile[i, j].active()) + int i = (int) ((double) this.position.X + (double) (this.width / 2)) / 16; + int j = (int) ((double) this.position.Y + (double) (this.width / 2)) / 16; + int type = 0; + int Type = 2; + if (this.type == 109) { - if (Main.tile[i, j].type >= (ushort) 481 && Main.tile[i, j].type <= (ushort) 483) - flag = true; - if (flag) + type = 147; + Type = 0; + } + if (this.type == 31) + { + type = 53; + Type = 0; + } + if (this.type == 42) + { + type = 53; + Type = 0; + } + if (this.type == 56) + { + type = 112; + Type = 0; + } + if (this.type == 65) + { + type = 112; + Type = 0; + } + if (this.type == 67) + { + type = 116; + Type = 0; + } + if (this.type == 68) + { + type = 116; + Type = 0; + } + if (this.type == 71) + { + type = 123; + Type = 0; + } + if (this.type == 39) + { + type = 59; + Type = 176; + } + if (this.type == 40) + { + type = 57; + Type = 172; + } + if (this.type == 179) + { + type = 224; + Type = 0; + } + if (this.type == 241) + { + type = 234; + Type = 0; + } + if (this.type == 354) + { + type = 234; + Type = 0; + } + if (this.type == 411) + { + type = 330; + Type = 71; + } + if (this.type == 412) + { + type = 331; + Type = 72; + } + if (this.type == 413) + { + type = 332; + Type = 73; + } + if (this.type == 414) + { + type = 333; + Type = 74; + } + if (this.type == 109) + { + int closest = (int) Player.FindClosest(this.position, this.width, this.height); + if ((double) (this.Center - Main.player[closest].Center).Length() > (double) Main.LogicCheckScreenWidth * 0.75) { - WorldGen.KillTile(i, j); - if (!Main.tile[i, j].active() && Main.netMode != 0) - NetMessage.SendData(17, number2: ((float) i), number3: ((float) j)); + type = -1; + Type = 593; } } + if (Main.tile[i, j].halfBrick() && (double) this.velocity.Y > 0.0 && (double) Math.Abs(this.velocity.Y) > (double) Math.Abs(this.velocity.X)) + --j; + if (!Main.tile[i, j].active() && type >= 0) + { + bool flag = false; + if (j < Main.maxTilesY - 2 && Main.tile[i, j + 1] != null && Main.tile[i, j + 1].active() && Main.tile[i, j + 1].type == (ushort) 314) + flag = true; + if (!flag) + WorldGen.PlaceTile(i, j, type, forced: true); + if (!flag && Main.tile[i, j].active() && (int) Main.tile[i, j].type == type) + { + if (Main.tile[i, j + 1].halfBrick() || Main.tile[i, j + 1].slope() != (byte) 0) + { + WorldGen.SlopeTile(i, j + 1); + if (Main.netMode == 2) + NetMessage.SendData(17, number: 14, number2: ((float) i), number3: ((float) (j + 1))); + } + if (Main.netMode != 0) + NetMessage.SendData(17, number: 1, number2: ((float) i), number3: ((float) j), number4: ((float) type)); + } + else if (Type > 0) + number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type); + } + else if (Type > 0) + number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, Type); + } + if (this.type == 1 && Main.rand.Next(3) == 0) + number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 40); + if (this.type == 474 && Main.rand.Next(3) == 0) + number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3003); + if (this.type == 103 && Main.rand.Next(6) == 0) + number = Main.rand.Next(3) != 0 ? Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 40) : Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 545); + if (this.type == 2 && Main.rand.Next(3) == 0) + number = Main.rand.Next(3) != 0 ? Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 40) : Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 41); + if (this.type == 172 && Main.rand.Next(3) == 0) + number = Main.rand.Next(3) != 0 ? Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 40) : Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 988); + if (this.type == 171) + { + if ((double) this.ai[1] == 0.0) + { + number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 985); + Main.item[number].noGrabDelay = 0; + } + else if ((double) this.ai[1] < 10.0) + { + number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 965, (int) (10.0 - (double) this.ai[1])); + Main.item[number].noGrabDelay = 0; + } + } + if (this.type == 475) + { + if ((double) this.ai[1] == 0.0) + { + number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3005); + Main.item[number].noGrabDelay = 0; + } + else if ((double) this.ai[1] < 10.0) + { + number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 2996, (int) (10.0 - (double) this.ai[1])); + Main.item[number].noGrabDelay = 0; + } + } + if (this.type == 505) + { + if ((double) this.ai[1] == 0.0) + { + number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3079); + Main.item[number].noGrabDelay = 0; + } + else if ((double) this.ai[1] < 10.0) + { + number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3077, (int) (10.0 - (double) this.ai[1])); + Main.item[number].noGrabDelay = 0; + } + } + if (this.type == 506) + { + if ((double) this.ai[1] == 0.0) + { + number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3080); + Main.item[number].noGrabDelay = 0; + } + else if ((double) this.ai[1] < 10.0) + { + number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3078, (int) (10.0 - (double) this.ai[1])); + Main.item[number].noGrabDelay = 0; + } + } + if (this.type == 91 && Main.rand.Next(6) == 0) + number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 516); + if (this.type == 50 && Main.rand.Next(3) == 0) + number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 282); + if (this.type == 515 && Main.rand.Next(3) == 0) + number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3112); + if (this.type == 53 && Main.rand.Next(3) == 0) + number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 286); + if (this.type == 48 && Main.rand.Next(2) == 0) + number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 279); + if (this.type == 54 && Main.rand.Next(2) == 0) + number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 287); + if (this.type == 3 && Main.rand.Next(2) == 0) + number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 42); + if (this.type == 4 && Main.rand.Next(4) == 0) + number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 47); + if (this.type == 12 && this.damage > 500) + number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 75); + if (this.type == 155) + number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 859); + if (this.type == 598 && Main.rand.Next(4) == 0) + number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3378); + if (this.type == 599 && Main.rand.Next(4) == 0) + number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 3379); + if (this.type == 21 && Main.rand.Next(2) == 0) + number = Item.NewItem((int) this.position.X, (int) this.position.Y, this.width, this.height, 154); + if (Main.netMode == 1 && number >= 0) + NetMessage.SendData(21, number: number, number2: 1f); + } + if (this.type == 69 || this.type == 70 || this.type == 621) + { + int i = (int) ((double) this.position.X + (double) (this.width / 2)) / 16; + int j = (int) ((double) this.position.Y + (double) (this.height / 2)) / 16; + if (this.type == 69) + WorldGen.Convert(i, j, 2); + if (this.type == 70) + WorldGen.Convert(i, j, 1); + if (this.type == 621) + WorldGen.Convert(i, j, 4); + } + if (this.type == 378) + { + int num = Main.rand.Next(2, 4); + if (Main.rand.Next(5) == 0) + ++num; + for (int index = 0; index < num; ++index) + { + float x = this.velocity.X; + float y = this.velocity.Y; + Projectile.NewProjectile(this.Center.X, this.Center.Y, x * (float) (1.0 + (double) Main.rand.Next(-20, 21) * 0.00999999977648258), y * (float) (1.0 + (double) Main.rand.Next(-20, 21) * 0.00999999977648258), 379, this.damage, this.knockBack, this.owner); } } } - AchievementsHelper.CurrentlyMining = false; - } - - public bool TryGetContainerIndex(out int containerIndex) - { - containerIndex = -1; - if (this.type == 525) - { - containerIndex = -2; - return true; - } - if (this.type != 734) - return false; - containerIndex = -5; - return true; - } - - public bool IsInteractible() - { - switch (this.type) - { - case 525: - case 734: - return true; - default: - return false; - } + this.active = false; } public Color GetAlpha(Color newColor) { - if (this.type == 937) - newColor.A = (byte) ((double) newColor.A * 0.75); - if (this.type == 880 || this.type == 929) - newColor.A /= (byte) 2; - if (this.type == 855) - newColor = Color.Lerp(newColor, new Color((int) byte.MaxValue, 200, 60), 0.5f); - if (this.type == 933) - newColor = Color.White * this.Opacity; if (this.type == 270) - return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) Utils.WrappedLerp(0.0f, (float) byte.MaxValue, (float) (this.timeLeft % 40) / 40f)); - if (this.type == 837) - return this.alpha > 0 ? Color.Transparent : new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 200); - if (this.type == 180 || this.type == 345 || this.type == 586) - return Color.Lerp(newColor, Color.White, 0.75f); - if (this.type == 764 || this.type == 856 || this.type == 857 || this.type == 864) - return Color.White; - if (this.type == 873 || this.type == 872 || this.type == 931 || this.type == 913 || this.type == 34) - return Color.White * this.Opacity; - if (this.type == 756) - return Color.Lerp(newColor, Color.Black, 0.25f); - if (this.type == 895) - return Color.White * this.Opacity; - if (this.type == 893 || this.type == 907) - return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 150); - if (this.type == 833 || this.type == 834 || this.type == 835 || this.type == 912) - return Color.Lerp(newColor, Color.White, 0.25f); - if (this.type == 351 || this.type == 350) - { - Point tileCoordinates = this.Center.ToTileCoordinates(); - return WorldGen.InWorld(tileCoordinates.X, tileCoordinates.Y) && !WorldGen.SolidTile(tileCoordinates.X, tileCoordinates.Y) ? Color.Lerp(newColor, Color.White, 0.15f) : Color.Lerp(newColor, Color.White, 0.05f); - } - if (this.type == 346 || this.type == 347 || this.type == 325 || this.type == 755) - return Color.Lerp(newColor, Color.White, 0.75f); + return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, Main.rand.Next(0, (int) byte.MaxValue)); int num1; int num2; int num3; @@ -29371,8 +25349,6 @@ label_26: } else { - if (this.type == 948) - return Color.White; if (this.type == 604 || this.type == 631) return new Color((int) byte.MaxValue - this.alpha, (int) byte.MaxValue - this.alpha, (int) byte.MaxValue - this.alpha, 0); if (this.type == 636) @@ -29410,15 +25386,7 @@ label_26: newColor.A = a; return newColor; } - if (this.type == 714) - { - byte a = newColor.A; - newColor = Color.Lerp(newColor, Color.White, 0.8f); - newColor.A = a; - newColor *= (float) a / (float) byte.MaxValue; - return newColor; - } - if (this.type == 573 || this.type == 578 || this.type == 579 || this.type == 617 || this.type == 641 || this.type == 707 || this.type == 813) + if (this.type == 573 || this.type == 578 || this.type == 579 || this.type == 617 || this.type == 641 || this.type == 707) return new Color((int) byte.MaxValue - this.alpha, (int) byte.MaxValue - this.alpha, (int) byte.MaxValue - this.alpha, (int) byte.MaxValue - this.alpha); if (this.type == 9 || this.type == 490) return Color.White; @@ -29443,7 +25411,7 @@ label_26: float num7 = (float) (1.0 - (double) this.alpha / (double) byte.MaxValue); return new Color((int) (200.0 * (double) num7), (int) (200.0 * (double) num7), (int) (200.0 * (double) num7), (int) (100.0 * (double) num7)); } - if (this.type == 518 || this.type == 595 || this.type == 735) + if (this.type == 518 || this.type == 595) { Color color = Color.Lerp(newColor, Color.White, 0.85f); color.A = (byte) 128; @@ -29467,10 +25435,8 @@ label_26: return this.alpha == 0 ? new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 200) : new Color(0, 0, 0, 0); if (this.type == 473) return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue); - if (this.type == 50 || this.type == 53 || this.type == 515 || this.type == 870) + if (this.type == 50 || this.type == 53 || this.type == 515) return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); - if (this.type == 723 || this.type == 724 || this.type == 725 || this.type == 726 || this.type == 728) - return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) * this.Opacity; if (this.type == 92) return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); if (this.type == 91) @@ -29546,12 +25512,8 @@ label_26: if (this.type == 462) return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 128) * (float) (1.0 - (double) this.alpha / (double) byte.MaxValue); if (this.type == 352) - { - Color color = Color.Lerp(newColor, Color.White, 0.5f); - color.A = (byte) ((double) color.A * ((double) this.alpha / (double) byte.MaxValue)); - return new Color((int) color.R, (int) color.G, (int) color.B, (int) color.A); - } - if (this.type == 435 || this.type == 732 || this.type == 731) + return new Color(250, 250, 250, this.alpha); + if (this.type == 435) { newColor = Color.Lerp(newColor, Color.White, 0.8f); return new Color((int) newColor.R, (int) newColor.G, (int) newColor.B, 25); @@ -29641,6 +25603,8 @@ label_26: } if (this.type == 265 || this.type == 355) return this.alpha > 0 ? Color.Transparent : new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); + if (this.type == 270 && (double) this.ai[0] >= 0.0) + return this.alpha > 0 ? Color.Transparent : new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 200); if (this.type == 257) return this.alpha > 200 ? Color.Transparent : new Color((int) byte.MaxValue - this.alpha, (int) byte.MaxValue - this.alpha, (int) byte.MaxValue - this.alpha, 0); if (this.type == 259) @@ -29657,7 +25621,7 @@ label_26: return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0); if (this.type == 229) return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 50); - if (this.type == 221 || this.type == 729) + if (this.type == 221) return new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 200); if (this.type == 20) return this.alpha <= 150 ? new Color((int) byte.MaxValue, (int) byte.MaxValue, (int) byte.MaxValue, 0) : new Color(0, 0, 0, 0); @@ -29738,7 +25702,7 @@ label_26: int num26 = (int) (((double) this.localAI[1] - 5.0) / 10.0 * (double) byte.MaxValue); return new Color(num26, num26, num26, num26); } - if (this.type == 83 || this.type == 88 || this.type == 89 || this.type == 90 || this.type == 100 || this.type == 104 || this.type == 279 || this.type >= 283 && this.type <= 287 || this.type == 876) + if (this.type == 83 || this.type == 88 || this.type == 89 || this.type == 90 || this.type == 100 || this.type == 104 || this.type == 279 || this.type >= 283 && this.type <= 287) return this.alpha < 200 ? new Color((int) byte.MaxValue - this.alpha, (int) byte.MaxValue - this.alpha, (int) byte.MaxValue - this.alpha, 0) : Color.Transparent; if (this.type == 34 || this.type == 35 || this.type == 15 || this.type == 19 || this.type == 44 || this.type == 45) return Color.White; @@ -29785,38 +25749,5 @@ label_26: } public override string ToString() => "type:" + (object) this.type + "name:" + this.Name + ", active:" + this.active.ToString() + ", whoAmI:" + (object) this.whoAmI + ", identity:" + (object) this.identity + ", ai0:" + (object) this.ai[0] + " , uuid:" + (object) this.projUUID; - - private class NPCDistanceByIndexComparator : IComparer> - { - public int Compare(Tuple npcIndex1, Tuple npcIndex2) => npcIndex1.Item2.CompareTo(npcIndex2.Item2); - } - - public struct HallowBossPelletStormInfo - { - public float StartAngle; - public float AnglePerBullet; - public int BulletsInStorm; - public float BulletsProgressInStormStartNormalized; - public float BulletsProgressInStormBonusByIndexNormalized; - public float StormTotalRange; - public Vector2 BulletSize; - - public float GetBulletProgress(int bulletIndex) => this.BulletsProgressInStormStartNormalized + this.BulletsProgressInStormBonusByIndexNormalized * (float) bulletIndex; - - public bool IsValid(int bulletIndex) - { - float bulletProgress = this.GetBulletProgress(bulletIndex); - return (double) bulletProgress >= 0.0 && (double) bulletProgress <= 1.0; - } - - public Vector2 GetBulletPosition(int bulletIndex, Vector2 centerPoint) => centerPoint + Vector2.UnitX.RotatedBy((double) this.StartAngle + (double) this.AnglePerBullet * (double) bulletIndex) * this.StormTotalRange * this.GetBulletProgress(bulletIndex); - - public Microsoft.Xna.Framework.Rectangle GetBulletHitbox( - int bulletIndex, - Vector2 centerPoint) - { - return Utils.CenteredRectangle(this.GetBulletPosition(bulletIndex, centerPoint), this.BulletSize); - } - } } } diff --git a/README.md b/README.md index 278ffea..5c29a5d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,2 @@ -# Terraria Source Code - - -Started because me and a friend wanted to research a specfic check in the game. Now I just commit the decompiled source code from dotPeek so other people can fuck around wit the source code. - -I am not responsible for any legal consequences that may happen. This is only to be used as a reference and nothing else. This is a passion project of mine and none of the code was made by me. I only want to make certain versions of the source code available for everyone. +# Terraria-Source-Code +Terraria 1.3.5.3 Source Code diff --git a/Rain.cs b/Rain.cs index d43e6f3..05adcb5 100644 --- a/Rain.cs +++ b/Rain.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Rain -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -20,15 +20,9 @@ namespace Terraria public bool active; public byte type; - public static void ClearRain() - { - for (int index = 0; index < Main.maxRain; ++index) - Main.rain[index].active = false; - } - public static void MakeRain() { - if (Main.netMode == 2 || Main.gamePaused || (double) Main.screenPosition.Y > Main.worldSurface * 16.0 || Main.gameMenu) + if ((double) Main.screenPosition.Y > Main.worldSurface * 16.0 || Main.gameMenu) return; float num1 = (float) Main.screenWidth / 1920f * 25f * (float) (0.25 + 1.0 * (double) Main.cloudAlpha); if (Filters.Scene["Sandstorm"].IsActive()) @@ -41,7 +35,7 @@ namespace Terraria Vector2 Position; Position.X = (float) Main.rand.Next((int) Main.screenPosition.X - num2, (int) Main.screenPosition.X + Main.screenWidth + num2); Position.Y = Main.screenPosition.Y - (float) Main.rand.Next(20, 100); - Position.X -= (float) ((double) Main.windSpeedCurrent * 15.0 * 40.0); + Position.X -= (float) ((double) Main.windSpeed * 15.0 * 40.0); Position.X += Main.player[Main.myPlayer].velocity.X * 40f; if ((double) Position.X < 0.0) Position.X = 0.0f; @@ -53,13 +47,9 @@ namespace Terraria i = 0; if (i > Main.maxTilesX - 1) i = Main.maxTilesX - 1; - if (j < 0) - j = 0; - if (j > Main.maxTilesY - 1) - j = Main.maxTilesY - 1; - if (Main.gameMenu || !WorldGen.SolidTile(i, j) && Main.tile[i, j].wall <= (ushort) 0) + if (Main.gameMenu || !WorldGen.SolidTile(i, j) && Main.tile[i, j].wall <= (byte) 0) { - Vector2 Velocity = new Vector2(Main.windSpeedCurrent * 18f, 14f); + Vector2 Velocity = new Vector2(Main.windSpeed * 12f, 14f); Rain.NewRain(Position, Velocity); } } @@ -67,53 +57,42 @@ namespace Terraria public void Update() { - if (Main.gamePaused) - return; this.position += this.velocity; - if (Main.gameMenu) - { - if ((double) this.position.Y <= (double) Main.screenPosition.Y + (double) Main.screenHeight + 2000.0) - return; - this.active = false; - } - else - { - if (!Collision.SolidCollision(this.position, 2, 2) && (double) this.position.Y <= (double) Main.screenPosition.Y + (double) Main.screenHeight + 100.0 && !Collision.WetCollision(this.position, 2, 2)) - return; - this.active = false; - if ((double) Main.rand.Next(100) >= (double) Main.gfxQuality * 100.0) - return; - int index = Dust.NewDust(this.position - this.velocity, 2, 2, Dust.dustWater()); - Main.dust[index].position.X -= 2f; - Main.dust[index].position.Y += 2f; - Main.dust[index].alpha = 38; - Main.dust[index].velocity *= 0.1f; - Main.dust[index].velocity += -this.velocity * 0.025f; - Main.dust[index].velocity.Y -= 2f; - Main.dust[index].scale = 0.6f; - Main.dust[index].noGravity = true; - } + if (!Collision.SolidCollision(this.position, 2, 2) && (double) this.position.Y <= (double) Main.screenPosition.Y + (double) Main.screenHeight + 100.0 && !Collision.WetCollision(this.position, 2, 2)) + return; + this.active = false; + if ((double) Main.rand.Next(100) >= (double) Main.gfxQuality * 100.0) + return; + int Type = 154; + if (this.type == (byte) 3 || this.type == (byte) 4 || this.type == (byte) 5) + Type = 218; + int index = Dust.NewDust(this.position - this.velocity, 2, 2, Type); + Main.dust[index].position.X -= 2f; + Main.dust[index].alpha = 38; + Main.dust[index].velocity *= 0.1f; + Main.dust[index].velocity += -this.velocity * 0.025f; + Main.dust[index].scale = 0.75f; } - private static int NewRain(Vector2 Position, Vector2 Velocity) + public static int NewRain(Vector2 Position, Vector2 Velocity) { int index1 = -1; int num1 = (int) ((double) Main.maxRain * (double) Main.cloudAlpha); if (num1 > Main.maxRain) num1 = Main.maxRain; float num2 = (float) Main.maxTilesX / 6400f; - double num3 = (double) Math.Max(0.0f, Math.Min(1f, (float) (((double) Main.player[Main.myPlayer].position.Y / 16.0 - 85.0 * (double) num2) / (60.0 * (double) num2)))); - float num4 = (float) ((1.0 + (double) Main.gfxQuality) / 2.0); - if ((double) num4 < 0.9) - num1 = (int) ((double) num1 * (double) num4); - float num5 = (float) (800 - Main.SceneMetrics.SnowTileCount); - if ((double) num5 < 0.0) - num5 = 0.0f; - float num6 = num5 / 800f; - int num7 = (int) ((double) (int) ((double) num1 * (double) num6) * Math.Pow((double) Main.atmo, 9.0)); - if ((double) Main.atmo < 0.4) - num7 = 0; - for (int index2 = 0; index2 < num7; ++index2) + float num3 = Math.Max(0.0f, Math.Min(1f, (float) (((double) Main.player[Main.myPlayer].position.Y / 16.0 - 85.0 * (double) num2) / (60.0 * (double) num2)))); + float num4 = num3 * num3; + int num5 = (int) ((double) num1 * (double) num4); + float num6 = (float) ((1.0 + (double) Main.gfxQuality) / 2.0); + if ((double) num6 < 0.9) + num5 = (int) ((double) num5 * (double) num6); + float num7 = (float) (800 - Main.snowTiles); + if ((double) num7 < 0.0) + num7 = 0.0f; + float num8 = num7 / 800f; + int num9 = (int) ((double) num5 * (double) num8); + for (int index2 = 0; index2 < num9; ++index2) { if (!Main.rain[index2].active) { @@ -129,7 +108,9 @@ namespace Terraria rain.scale = (float) (1.0 + (double) Main.rand.Next(-20, 21) * 0.00999999977648258); rain.velocity = Velocity * rain.scale; rain.rotation = (float) Math.Atan2((double) rain.velocity.X, -(double) rain.velocity.Y); - rain.type = (byte) (Main.waterStyle * 3 + Main.rand.Next(3)); + rain.type = (byte) Main.rand.Next(3); + if (Main.bloodMoon) + rain.type += (byte) 3; return index1; } } diff --git a/Recipe.cs b/Recipe.cs index 12f9226..9541589 100644 --- a/Recipe.cs +++ b/Recipe.cs @@ -1,27 +1,25 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Recipe -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; using System.Collections.Generic; using Terraria.GameContent.Achievements; using Terraria.ID; -using Terraria.Localization; namespace Terraria { public class Recipe { public static int maxRequirements = 15; - public static int maxRecipes = 3000; - public static int numRecipes; - private static Recipe currentRecipe = new Recipe(); + public static int maxRecipes = 2000; + public static int numRecipes = 0; + private static Recipe newRecipe = new Recipe(); public Item createItem = new Item(); public Item[] requiredItem = new Item[Recipe.maxRequirements]; public int[] requiredTile = new int[Recipe.maxRequirements]; - public int[] acceptedGroups = new int[Recipe.maxRequirements]; public bool needHoney; public bool needWater; public bool needLava; @@ -32,51 +30,25 @@ namespace Terraria public bool anyFragment; public bool alchemy; public bool needSnowBiome; - public bool needGraveyardBiome; - private static bool _hasDelayedFindRecipes; + public List acceptedGroups = new List(); public void RequireGroup(string name) { int num; if (!RecipeGroup.recipeGroupIDs.TryGetValue(name, out num)) return; - for (int index = 0; index < Recipe.maxRequirements; ++index) - { - if (this.acceptedGroups[index] == -1) - { - this.acceptedGroups[index] = num; - break; - } - } - } - - public void RequireGroup(int id) - { - for (int index = 0; index < Recipe.maxRequirements; ++index) - { - if (this.acceptedGroups[index] == -1) - { - this.acceptedGroups[index] = id; - break; - } - } + this.acceptedGroups.Add(num); } public bool ProcessGroupsForText(int type, out string theText) { - for (int index = 0; index < Recipe.maxRequirements; ++index) + foreach (int acceptedGroup in this.acceptedGroups) { - int acceptedGroup = this.acceptedGroups[index]; - if (acceptedGroup != -1) + if (RecipeGroup.recipeGroups[acceptedGroup].ValidItems.Contains(type)) { - if (RecipeGroup.recipeGroups[acceptedGroup].ValidItems.Contains(type)) - { - theText = RecipeGroup.recipeGroups[acceptedGroup].GetText(); - return true; - } + theText = RecipeGroup.recipeGroups[acceptedGroup].GetText(); + return true; } - else - break; } theText = ""; return false; @@ -84,16 +56,10 @@ namespace Terraria public bool AcceptedByItemGroups(int invType, int reqType) { - for (int index = 0; index < Recipe.maxRequirements; ++index) + foreach (int acceptedGroup in this.acceptedGroups) { - int acceptedGroup = this.acceptedGroups[index]; - if (acceptedGroup != -1) - { - if (RecipeGroup.recipeGroups[acceptedGroup].ValidItems.Contains(invType) && RecipeGroup.recipeGroups[acceptedGroup].ValidItems.Contains(reqType)) - return true; - } - else - break; + if (RecipeGroup.recipeGroups[acceptedGroup].ValidItems.Contains(invType) && RecipeGroup.recipeGroups[acceptedGroup].ValidItems.Contains(reqType)) + return true; } return false; } @@ -104,7 +70,6 @@ namespace Terraria { this.requiredItem[index] = new Item(); this.requiredTile[index] = -1; - this.acceptedGroups[index] = -1; } } @@ -166,8 +131,6 @@ namespace Terraria inventory = Main.player[Main.myPlayer].bank2.item; else if (Main.player[Main.myPlayer].chest == -4) inventory = Main.player[Main.myPlayer].bank3.item; - else if (Main.player[Main.myPlayer].chest == -5) - inventory = Main.player[Main.myPlayer].bank4.item; for (int index4 = 0; index4 < 40; ++index4) { Item obj = inventory[index4]; @@ -240,7 +203,7 @@ namespace Terraria public bool useIronBar(int invType, int reqType) => this.anyIronBar && (reqType == 22 || reqType == 704) && (invType == 22 || invType == 704); - public bool useSand(int invType, int reqType) => (reqType == 169 || reqType == 408 || reqType == 1246 || reqType == 370 || reqType == 3272 || reqType == 3338 || reqType == 3274 || reqType == 3275) && this.anySand && (invType == 169 || invType == 408 || invType == 1246 || invType == 370 || invType == 3272 || invType == 3338 || invType == 3274 || invType == 3275); + public bool useSand(int invType, int reqType) => (reqType == 169 || reqType == 408 || reqType == 1246 || reqType == 370 || reqType == 3272) && this.anySand && (invType == 169 || invType == 408 || invType == 1246 || invType == 370 || invType == 3272); public bool useFragment(int invType, int reqType) => (reqType == 3458 || reqType == 3456 || reqType == 3457 || reqType == 3459) && this.anyFragment && (invType == 3458 || invType == 3456 || invType == 3457 || invType == 3459); @@ -257,7 +220,6 @@ namespace Terraria case 852: case 853: case 1151: - case 4261: switch (invType) { case 529: @@ -267,7 +229,6 @@ namespace Terraria case 852: case 853: case 1151: - case 4261: return true; default: return false; @@ -277,47 +238,54 @@ namespace Terraria } } - public static void GetThroughDelayedFindRecipes() + public static void FindRecipes() { - if (!Recipe._hasDelayedFindRecipes) - return; - Recipe._hasDelayedFindRecipes = false; - Recipe.FindRecipes(); - } - - public static void FindRecipes(bool canDelayCheck = false) - { - if (canDelayCheck) + int num1 = Main.availableRecipe[Main.focusRecipe]; + float num2 = Main.availableRecipeY[Main.focusRecipe]; + for (int index = 0; index < Recipe.maxRecipes; ++index) + Main.availableRecipe[index] = 0; + Main.numAvailableRecipes = 0; + if ((Main.guideItem.type <= 0 || Main.guideItem.stack <= 0 ? 0 : (Main.guideItem.Name != "" ? 1 : 0)) != 0) { - Recipe._hasDelayedFindRecipes = true; - } - else - { - int num1 = Main.availableRecipe[Main.focusRecipe]; - float num2 = Main.availableRecipeY[Main.focusRecipe]; - for (int index = 0; index < Recipe.maxRecipes; ++index) - Main.availableRecipe[index] = 0; - Main.numAvailableRecipes = 0; - if ((Main.guideItem.type <= 0 || Main.guideItem.stack <= 0 ? 0 : (Main.guideItem.Name != "" ? 1 : 0)) != 0) + for (int index1 = 0; index1 < Recipe.maxRecipes && Main.recipe[index1].createItem.type != 0; ++index1) { - for (int index1 = 0; index1 < Recipe.maxRecipes && Main.recipe[index1].createItem.type != 0; ++index1) + for (int index2 = 0; index2 < Recipe.maxRequirements && Main.recipe[index1].requiredItem[index2].type != 0; ++index2) { - for (int index2 = 0; index2 < Recipe.maxRequirements && Main.recipe[index1].requiredItem[index2].type != 0; ++index2) + if (Main.guideItem.IsTheSameAs(Main.recipe[index1].requiredItem[index2]) || Main.recipe[index1].useWood(Main.guideItem.type, Main.recipe[index1].requiredItem[index2].type) || Main.recipe[index1].useSand(Main.guideItem.type, Main.recipe[index1].requiredItem[index2].type) || Main.recipe[index1].useIronBar(Main.guideItem.type, Main.recipe[index1].requiredItem[index2].type) || Main.recipe[index1].useFragment(Main.guideItem.type, Main.recipe[index1].requiredItem[index2].type) || Main.recipe[index1].AcceptedByItemGroups(Main.guideItem.type, Main.recipe[index1].requiredItem[index2].type) || Main.recipe[index1].usePressurePlate(Main.guideItem.type, Main.recipe[index1].requiredItem[index2].type)) { - if (Main.guideItem.IsTheSameAs(Main.recipe[index1].requiredItem[index2]) || Main.recipe[index1].useWood(Main.guideItem.type, Main.recipe[index1].requiredItem[index2].type) || Main.recipe[index1].useSand(Main.guideItem.type, Main.recipe[index1].requiredItem[index2].type) || Main.recipe[index1].useIronBar(Main.guideItem.type, Main.recipe[index1].requiredItem[index2].type) || Main.recipe[index1].useFragment(Main.guideItem.type, Main.recipe[index1].requiredItem[index2].type) || Main.recipe[index1].AcceptedByItemGroups(Main.guideItem.type, Main.recipe[index1].requiredItem[index2].type) || Main.recipe[index1].usePressurePlate(Main.guideItem.type, Main.recipe[index1].requiredItem[index2].type)) - { - Main.availableRecipe[Main.numAvailableRecipes] = index1; - ++Main.numAvailableRecipes; - break; - } + Main.availableRecipe[Main.numAvailableRecipes] = index1; + ++Main.numAvailableRecipes; + break; } } } - else + } + else + { + Dictionary dictionary = new Dictionary(); + Item[] inventory = Main.player[Main.myPlayer].inventory; + for (int index = 0; index < 58; ++index) { - Dictionary dictionary = new Dictionary(); - Item[] inventory = Main.player[Main.myPlayer].inventory; - for (int index = 0; index < 58; ++index) + Item obj = inventory[index]; + if (obj.stack > 0) + { + if (dictionary.ContainsKey(obj.netID)) + dictionary[obj.netID] += obj.stack; + else + dictionary[obj.netID] = obj.stack; + } + } + if (Main.player[Main.myPlayer].chest != -1) + { + if (Main.player[Main.myPlayer].chest > -1) + inventory = Main.chest[Main.player[Main.myPlayer].chest].item; + else if (Main.player[Main.myPlayer].chest == -2) + inventory = Main.player[Main.myPlayer].bank.item; + else if (Main.player[Main.myPlayer].chest == -3) + inventory = Main.player[Main.myPlayer].bank2.item; + else if (Main.player[Main.myPlayer].chest == -4) + inventory = Main.player[Main.myPlayer].bank3.item; + for (int index = 0; index < 40; ++index) { Item obj = inventory[index]; if (obj.stack > 0) @@ -328,107 +296,82 @@ namespace Terraria dictionary[obj.netID] = obj.stack; } } - if (Main.player[Main.myPlayer].chest != -1) + } + for (int index3 = 0; index3 < Recipe.maxRecipes && Main.recipe[index3].createItem.type != 0; ++index3) + { + bool flag1 = true; + if (flag1) { - if (Main.player[Main.myPlayer].chest > -1) - inventory = Main.chest[Main.player[Main.myPlayer].chest].item; - else if (Main.player[Main.myPlayer].chest == -2) - inventory = Main.player[Main.myPlayer].bank.item; - else if (Main.player[Main.myPlayer].chest == -3) - inventory = Main.player[Main.myPlayer].bank2.item; - else if (Main.player[Main.myPlayer].chest == -4) - inventory = Main.player[Main.myPlayer].bank3.item; - else if (Main.player[Main.myPlayer].chest == -5) - inventory = Main.player[Main.myPlayer].bank4.item; - for (int index = 0; index < 40; ++index) + for (int index4 = 0; index4 < Recipe.maxRequirements && Main.recipe[index3].requiredTile[index4] != -1; ++index4) { - Item obj = inventory[index]; - if (obj != null && obj.stack > 0) + if (!Main.player[Main.myPlayer].adjTile[Main.recipe[index3].requiredTile[index4]]) { - if (dictionary.ContainsKey(obj.netID)) - dictionary[obj.netID] += obj.stack; - else - dictionary[obj.netID] = obj.stack; + flag1 = false; + break; } } } - for (int index3 = 0; index3 < Recipe.maxRecipes && Main.recipe[index3].createItem.type != 0; ++index3) + if (flag1) { - bool flag1 = true; - if (flag1) + for (int index5 = 0; index5 < Recipe.maxRequirements; ++index5) { - for (int index4 = 0; index4 < Recipe.maxRequirements && Main.recipe[index3].requiredTile[index4] != -1; ++index4) + Item obj = Main.recipe[index3].requiredItem[index5]; + if (obj.type != 0) { - if (!Main.player[Main.myPlayer].adjTile[Main.recipe[index3].requiredTile[index4]]) + int stack = obj.stack; + bool flag2 = false; + foreach (int key in dictionary.Keys) + { + if (Main.recipe[index3].useWood(key, obj.type) || Main.recipe[index3].useSand(key, obj.type) || Main.recipe[index3].useIronBar(key, obj.type) || Main.recipe[index3].useFragment(key, obj.type) || Main.recipe[index3].AcceptedByItemGroups(key, obj.type) || Main.recipe[index3].usePressurePlate(key, obj.type)) + { + stack -= dictionary[key]; + flag2 = true; + } + } + if (!flag2 && dictionary.ContainsKey(obj.netID)) + stack -= dictionary[obj.netID]; + if (stack > 0) { flag1 = false; break; } } - } - if (flag1) - { - for (int index5 = 0; index5 < Recipe.maxRequirements; ++index5) - { - Item obj = Main.recipe[index3].requiredItem[index5]; - if (obj.type != 0) - { - int stack = obj.stack; - bool flag2 = false; - foreach (int key in dictionary.Keys) - { - if (Main.recipe[index3].useWood(key, obj.type) || Main.recipe[index3].useSand(key, obj.type) || Main.recipe[index3].useIronBar(key, obj.type) || Main.recipe[index3].useFragment(key, obj.type) || Main.recipe[index3].AcceptedByItemGroups(key, obj.type) || Main.recipe[index3].usePressurePlate(key, obj.type)) - { - stack -= dictionary[key]; - flag2 = true; - } - } - if (!flag2 && dictionary.ContainsKey(obj.netID)) - stack -= dictionary[obj.netID]; - if (stack > 0) - { - flag1 = false; - break; - } - } - else - break; - } - } - if (flag1) - { - int num3 = !Main.recipe[index3].needWater || Main.player[Main.myPlayer].adjWater ? 1 : (Main.player[Main.myPlayer].adjTile[172] ? 1 : 0); - bool flag3 = !Main.recipe[index3].needHoney || Main.recipe[index3].needHoney == Main.player[Main.myPlayer].adjHoney; - bool flag4 = !Main.recipe[index3].needLava || Main.recipe[index3].needLava == Main.player[Main.myPlayer].adjLava; - bool flag5 = !Main.recipe[index3].needSnowBiome || Main.player[Main.myPlayer].ZoneSnow; - bool flag6 = !Main.recipe[index3].needGraveyardBiome || Main.player[Main.myPlayer].ZoneGraveyard; - int num4 = flag3 ? 1 : 0; - if ((num3 & num4 & (flag4 ? 1 : 0) & (flag5 ? 1 : 0) & (flag6 ? 1 : 0)) == 0) - flag1 = false; - } - if (flag1) - { - Main.availableRecipe[Main.numAvailableRecipes] = index3; - ++Main.numAvailableRecipes; + else + break; } } - } - for (int index = 0; index < Main.numAvailableRecipes; ++index) - { - if (num1 == Main.availableRecipe[index]) + if (flag1) { - Main.focusRecipe = index; - break; + int num3 = !Main.recipe[index3].needWater ? 1 : (Main.player[Main.myPlayer].adjWater ? 1 : (Main.player[Main.myPlayer].adjTile[172] ? 1 : 0)); + bool flag3 = !Main.recipe[index3].needHoney || Main.recipe[index3].needHoney == Main.player[Main.myPlayer].adjHoney; + bool flag4 = !Main.recipe[index3].needLava || Main.recipe[index3].needLava == Main.player[Main.myPlayer].adjLava; + bool flag5 = !Main.recipe[index3].needSnowBiome || Main.player[Main.myPlayer].ZoneSnow; + int num4 = flag3 ? 1 : 0; + if ((num3 & num4 & (flag4 ? 1 : 0) & (flag5 ? 1 : 0)) == 0) + flag1 = false; + } + if (flag1) + { + Main.availableRecipe[Main.numAvailableRecipes] = index3; + ++Main.numAvailableRecipes; } } - if (Main.focusRecipe >= Main.numAvailableRecipes) - Main.focusRecipe = Main.numAvailableRecipes - 1; - if (Main.focusRecipe < 0) - Main.focusRecipe = 0; - float num5 = Main.availableRecipeY[Main.focusRecipe] - num2; - for (int index = 0; index < Recipe.maxRecipes; ++index) - Main.availableRecipeY[index] -= num5; } + for (int index = 0; index < Main.numAvailableRecipes; ++index) + { + if (num1 == Main.availableRecipe[index]) + { + Main.focusRecipe = index; + break; + } + } + if (Main.focusRecipe >= Main.numAvailableRecipes) + Main.focusRecipe = Main.numAvailableRecipes - 1; + if (Main.focusRecipe < 0) + Main.focusRecipe = 0; + float num5 = Main.availableRecipeY[Main.focusRecipe] - num2; + for (int index = 0; index < Recipe.maxRecipes; ++index) + Main.availableRecipeY[index] -= num5; } public static void SetupRecipeGroups() @@ -481,817 +424,26 @@ namespace Terraria 2006, 2007 })); - RecipeGroupID.Dragonflies = RecipeGroup.RegisterGroup("Dragonflies", new RecipeGroup((Func) (() => Lang.misc[37].Value + " " + Lang.misc[105].Value), new int[6] - { - 4334, - 4335, - 4336, - 4338, - 4339, - 4337 - })); - RecipeGroupID.Turtles = RecipeGroup.RegisterGroup("Turtles", new RecipeGroup((Func) (() => Lang.misc[37].Value + " " + Lang.GetNPCNameValue(616)), new int[2] - { - 4464, - 4465 - })); - RecipeGroupID.Fruit = RecipeGroup.RegisterGroup("Fruit", new RecipeGroup((Func) (() => Lang.misc[37].Value + " " + Language.GetTextValue("Misc.Fruit")), new int[17] - { - 4009, - 4282, - 4283, - 4284, - 4285, - 4286, - 4287, - 4288, - 4289, - 4290, - 4291, - 4292, - 4293, - 4294, - 4295, - 4296, - 4297 - })); } public static void SetupRecipes() { - // ISSUE: The method is too long to display (57289 instructions) + // ISSUE: The method is too long to display (51538 instructions) } - private static void UpdateMaterialFieldForAllRecipes() - { - for (int index1 = 0; index1 < Recipe.numRecipes; ++index1) - { - for (int index2 = 0; Main.recipe[index1].requiredItem[index2].type > 0; ++index2) - Main.recipe[index1].requiredItem[index2].material = ItemID.Sets.IsAMaterial[Main.recipe[index1].requiredItem[index2].type]; - Main.recipe[index1].createItem.material = ItemID.Sets.IsAMaterial[Main.recipe[index1].createItem.type]; - } - } - - public static void UpdateWhichItemsAreMaterials() - { - for (int Type = 0; Type < 5045; ++Type) - { - Item obj = new Item(); - obj.SetDefaults(Type, true); - obj.checkMat(); - ItemID.Sets.IsAMaterial[Type] = obj.material; - } - } - - private static void AddSolarFurniture() - { - Recipe.currentRecipe.createItem.SetDefaults(4229); - Recipe.currentRecipe.createItem.stack = 10; - Recipe.currentRecipe.SetIngridients(3, 10, 3458, 1); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4233); - Recipe.currentRecipe.createItem.stack = 4; - Recipe.currentRecipe.SetIngridients(4229, 1); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4145); - Recipe.currentRecipe.SetIngridients(4229, 14); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4146); - Recipe.currentRecipe.SetIngridients(4229, 15, 225, 5); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4147); - Recipe.currentRecipe.SetIngridients(4229, 20, 149, 10); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4148); - Recipe.currentRecipe.SetIngridients(4229, 16); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4149); - Recipe.currentRecipe.SetIngridients(4229, 5, 8, 3); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4150); - Recipe.currentRecipe.SetIngridients(4229, 4, 8, 1); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4151); - Recipe.currentRecipe.SetIngridients(4229, 4); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4152); - Recipe.currentRecipe.SetIngridients(4229, 4, 8, 4, 85, 1); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4153); - Recipe.currentRecipe.SetIngridients(4229, 8, 22, 2); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.currentRecipe.anyIronBar = true; - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4154); - Recipe.currentRecipe.SetIngridients(4229, 10, 22, 3, 170, 6); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.currentRecipe.anyIronBar = true; - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4155); - Recipe.currentRecipe.SetIngridients(4229, 6); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4156); - Recipe.currentRecipe.SetIngridients(8, 1, 4229, 3); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4157); - Recipe.currentRecipe.SetIngridients(4229, 6, 8, 1); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4158); - Recipe.currentRecipe.SetIngridients(4229, 15, 154, 4, 149, 1); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4160); - Recipe.currentRecipe.SetIngridients(4229, 6, 206, 1); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4161); - Recipe.currentRecipe.SetIngridients(4229, 5, 225, 2); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4162); - Recipe.currentRecipe.SetIngridients(4229, 8); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4163); - Recipe.currentRecipe.SetIngridients(4229, 10); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4165); - Recipe.currentRecipe.SetIngridients(4229, 6); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - } - - private static void AddVortexFurniture() - { - Recipe.currentRecipe.createItem.SetDefaults(4230); - Recipe.currentRecipe.createItem.stack = 10; - Recipe.currentRecipe.SetIngridients(3, 10, 3456, 1); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4234); - Recipe.currentRecipe.createItem.stack = 4; - Recipe.currentRecipe.SetIngridients(4230, 1); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4166); - Recipe.currentRecipe.SetIngridients(4230, 14); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4167); - Recipe.currentRecipe.SetIngridients(4230, 15, 225, 5); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4168); - Recipe.currentRecipe.SetIngridients(4230, 20, 149, 10); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4169); - Recipe.currentRecipe.SetIngridients(4230, 16); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4170); - Recipe.currentRecipe.SetIngridients(4230, 5, 8, 3); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4171); - Recipe.currentRecipe.SetIngridients(4230, 4, 8, 1); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4172); - Recipe.currentRecipe.SetIngridients(4230, 4); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4173); - Recipe.currentRecipe.SetIngridients(4230, 4, 8, 4, 85, 1); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4174); - Recipe.currentRecipe.SetIngridients(4230, 8, 22, 2); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.currentRecipe.anyIronBar = true; - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4175); - Recipe.currentRecipe.SetIngridients(4230, 10, 22, 3, 170, 6); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.currentRecipe.anyIronBar = true; - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4176); - Recipe.currentRecipe.SetIngridients(4230, 6); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4177); - Recipe.currentRecipe.SetIngridients(8, 1, 4230, 3); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4178); - Recipe.currentRecipe.SetIngridients(4230, 6, 8, 1); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4179); - Recipe.currentRecipe.SetIngridients(4230, 15, 154, 4, 149, 1); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4181); - Recipe.currentRecipe.SetIngridients(4230, 6, 206, 1); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4182); - Recipe.currentRecipe.SetIngridients(4230, 5, 225, 2); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4183); - Recipe.currentRecipe.SetIngridients(4230, 8); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4184); - Recipe.currentRecipe.SetIngridients(4230, 10); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4186); - Recipe.currentRecipe.SetIngridients(4230, 6); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - } - - private static void AddNebulaFurniture() - { - Recipe.currentRecipe.createItem.SetDefaults(4231); - Recipe.currentRecipe.createItem.stack = 10; - Recipe.currentRecipe.SetIngridients(3, 10, 3457, 1); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4235); - Recipe.currentRecipe.createItem.stack = 4; - Recipe.currentRecipe.SetIngridients(4231, 1); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4187); - Recipe.currentRecipe.SetIngridients(4231, 14); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4188); - Recipe.currentRecipe.SetIngridients(4231, 15, 225, 5); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4189); - Recipe.currentRecipe.SetIngridients(4231, 20, 149, 10); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4190); - Recipe.currentRecipe.SetIngridients(4231, 16); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4191); - Recipe.currentRecipe.SetIngridients(4231, 5, 8, 3); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4192); - Recipe.currentRecipe.SetIngridients(4231, 4, 8, 1); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4193); - Recipe.currentRecipe.SetIngridients(4231, 4); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4194); - Recipe.currentRecipe.SetIngridients(4231, 4, 8, 4, 85, 1); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4195); - Recipe.currentRecipe.SetIngridients(4231, 8, 22, 2); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.currentRecipe.anyIronBar = true; - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4196); - Recipe.currentRecipe.SetIngridients(4231, 10, 22, 3, 170, 6); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.currentRecipe.anyIronBar = true; - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4197); - Recipe.currentRecipe.SetIngridients(4231, 6); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4198); - Recipe.currentRecipe.SetIngridients(8, 1, 4231, 3); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4199); - Recipe.currentRecipe.SetIngridients(4231, 6, 8, 1); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4200); - Recipe.currentRecipe.SetIngridients(4231, 15, 154, 4, 149, 1); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4202); - Recipe.currentRecipe.SetIngridients(4231, 6, 206, 1); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4203); - Recipe.currentRecipe.SetIngridients(4231, 5, 225, 2); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4204); - Recipe.currentRecipe.SetIngridients(4231, 8); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4205); - Recipe.currentRecipe.SetIngridients(4231, 10); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4207); - Recipe.currentRecipe.SetIngridients(4231, 6); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - } - - private static void AddStardustFurniture() - { - Recipe.currentRecipe.createItem.SetDefaults(4232); - Recipe.currentRecipe.createItem.stack = 10; - Recipe.currentRecipe.SetIngridients(3, 10, 3459, 1); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4236); - Recipe.currentRecipe.createItem.stack = 4; - Recipe.currentRecipe.SetIngridients(4232, 1); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4208); - Recipe.currentRecipe.SetIngridients(4232, 14); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4209); - Recipe.currentRecipe.SetIngridients(4232, 15, 225, 5); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4210); - Recipe.currentRecipe.SetIngridients(4232, 20, 149, 10); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4211); - Recipe.currentRecipe.SetIngridients(4232, 16); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4212); - Recipe.currentRecipe.SetIngridients(4232, 5, 8, 3); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4213); - Recipe.currentRecipe.SetIngridients(4232, 4, 8, 1); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4214); - Recipe.currentRecipe.SetIngridients(4232, 4); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4215); - Recipe.currentRecipe.SetIngridients(4232, 4, 8, 4, 85, 1); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4216); - Recipe.currentRecipe.SetIngridients(4232, 8, 22, 2); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.currentRecipe.anyIronBar = true; - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4217); - Recipe.currentRecipe.SetIngridients(4232, 10, 22, 3, 170, 6); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.currentRecipe.anyIronBar = true; - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4218); - Recipe.currentRecipe.SetIngridients(4232, 6); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4219); - Recipe.currentRecipe.SetIngridients(8, 1, 4232, 3); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4220); - Recipe.currentRecipe.SetIngridients(4232, 6, 8, 1); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4221); - Recipe.currentRecipe.SetIngridients(4232, 15, 154, 4, 149, 1); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4223); - Recipe.currentRecipe.SetIngridients(4232, 6, 206, 1); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4224); - Recipe.currentRecipe.SetIngridients(4232, 5, 225, 2); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4225); - Recipe.currentRecipe.SetIngridients(4232, 8); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4226); - Recipe.currentRecipe.SetIngridients(4232, 10); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4228); - Recipe.currentRecipe.SetIngridients(4232, 6); - Recipe.currentRecipe.SetCraftingStation(412); - Recipe.AddRecipe(); - } - - private static void AddSpiderFurniture() - { - Recipe.currentRecipe.createItem.SetDefaults(4139); - Recipe.currentRecipe.createItem.stack = 10; - Recipe.currentRecipe.SetIngridients(150, 10, 2607, 1); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4140); - Recipe.currentRecipe.createItem.stack = 4; - Recipe.currentRecipe.SetIngridients(4139, 1); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3931); - Recipe.currentRecipe.SetIngridients(4139, 14); - Recipe.currentRecipe.SetCraftingStation(106); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3932); - Recipe.currentRecipe.SetIngridients(4139, 15, 225, 5); - Recipe.currentRecipe.SetCraftingStation(106); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3933); - Recipe.currentRecipe.SetIngridients(4139, 20, 149, 10); - Recipe.currentRecipe.SetCraftingStation(106); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3934); - Recipe.currentRecipe.SetIngridients(4139, 16); - Recipe.currentRecipe.SetCraftingStation(106); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3935); - Recipe.currentRecipe.SetIngridients(4139, 5, 8, 3); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3936); - Recipe.currentRecipe.SetIngridients(4139, 4, 8, 1); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3937); - Recipe.currentRecipe.SetIngridients(4139, 4); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3938); - Recipe.currentRecipe.SetIngridients(4139, 4, 8, 4, 85, 1); - Recipe.currentRecipe.SetCraftingStation(16); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3939); - Recipe.currentRecipe.SetIngridients(4139, 8, 22, 2); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.currentRecipe.anyIronBar = true; - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3940); - Recipe.currentRecipe.SetIngridients(4139, 10, 22, 3, 170, 6); - Recipe.currentRecipe.SetCraftingStation(106); - Recipe.currentRecipe.anyIronBar = true; - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3941); - Recipe.currentRecipe.SetIngridients(4139, 6); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3942); - Recipe.currentRecipe.SetIngridients(8, 1, 4139, 3); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3943); - Recipe.currentRecipe.SetIngridients(4139, 6, 8, 1); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3944); - Recipe.currentRecipe.SetIngridients(4139, 15, 154, 4, 149, 1); - Recipe.currentRecipe.SetCraftingStation(106); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3946); - Recipe.currentRecipe.SetIngridients(4139, 6, 206, 1); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3947); - Recipe.currentRecipe.SetIngridients(4139, 5, 225, 2); - Recipe.currentRecipe.SetCraftingStation(106); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3948); - Recipe.currentRecipe.SetIngridients(4139, 8); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3949); - Recipe.currentRecipe.SetIngridients(4139, 10); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4125); - Recipe.currentRecipe.SetIngridients(4139, 6); - Recipe.currentRecipe.SetCraftingStation(106); - Recipe.AddRecipe(); - } - - private static void AddLesionFurniture() - { - int num = 3955; - Recipe.currentRecipe.createItem.SetDefaults(3955); - Recipe.currentRecipe.SetIngridients(61, 2); - Recipe.currentRecipe.SetCraftingStation(218); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3975); - Recipe.currentRecipe.SetIngridients(num, 10); - Recipe.currentRecipe.anyWood = true; - Recipe.currentRecipe.SetCraftingStation(499); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3956); - Recipe.currentRecipe.createItem.stack = 4; - Recipe.currentRecipe.SetIngridients(3955, 1); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3967); - Recipe.currentRecipe.SetIngridients(num, 6); - Recipe.currentRecipe.anyWood = true; - Recipe.currentRecipe.SetCraftingStation(499); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3963); - Recipe.currentRecipe.SetIngridients(num, 4); - Recipe.currentRecipe.anyWood = true; - Recipe.currentRecipe.SetCraftingStation(499); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3965); - Recipe.currentRecipe.SetIngridients(num, 8, 22, 2); - Recipe.currentRecipe.anyWood = true; - Recipe.currentRecipe.anyIronBar = true; - Recipe.currentRecipe.SetCraftingStation(499); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3974); - Recipe.currentRecipe.SetIngridients(num, 8); - Recipe.currentRecipe.anyWood = true; - Recipe.currentRecipe.SetCraftingStation(499); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3972); - Recipe.currentRecipe.SetIngridients(num, 6, 206, 1); - Recipe.currentRecipe.anyWood = true; - Recipe.currentRecipe.SetCraftingStation(499); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3970); - Recipe.currentRecipe.SetIngridients(num, 6, 8, 1); - Recipe.currentRecipe.anyWood = true; - Recipe.currentRecipe.SetCraftingStation(499); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3962); - Recipe.currentRecipe.SetIngridients(num, 4, 8, 1); - Recipe.currentRecipe.anyWood = true; - Recipe.currentRecipe.SetCraftingStation(499); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3969); - Recipe.currentRecipe.SetIngridients(num, 3, 8, 1); - Recipe.currentRecipe.anyWood = true; - Recipe.currentRecipe.SetCraftingStation(499); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3961); - Recipe.currentRecipe.SetIngridients(num, 5, 8, 3); - Recipe.currentRecipe.anyWood = true; - Recipe.currentRecipe.SetCraftingStation(499); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3959); - Recipe.currentRecipe.SetIngridients(num, 15, 225, 5); - Recipe.currentRecipe.anyWood = true; - Recipe.currentRecipe.SetCraftingStation(499); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3968); - Recipe.currentRecipe.SetIngridients(num, 16); - Recipe.currentRecipe.anyWood = true; - Recipe.currentRecipe.SetCraftingStation(499); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3960); - Recipe.currentRecipe.SetIngridients(num, 20, 149, 10); - Recipe.currentRecipe.anyWood = true; - Recipe.currentRecipe.SetCraftingStation(499); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3966); - Recipe.currentRecipe.SetIngridients(22, 3, 170, 6, num, 10); - Recipe.currentRecipe.anyWood = true; - Recipe.currentRecipe.anyIronBar = true; - Recipe.currentRecipe.SetCraftingStation(499); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3973); - Recipe.currentRecipe.SetIngridients(num, 5, 225, 2); - Recipe.currentRecipe.anyWood = true; - Recipe.currentRecipe.SetCraftingStation(499); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3971); - Recipe.currentRecipe.SetIngridients(154, 4, num, 15, 149, 1); - Recipe.currentRecipe.anyWood = true; - Recipe.currentRecipe.SetCraftingStation(499); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3958); - Recipe.currentRecipe.SetIngridients(num, 14); - Recipe.currentRecipe.anyWood = true; - Recipe.currentRecipe.SetCraftingStation(499); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(3964); - Recipe.currentRecipe.SetIngridients(num, 4, 8, 4, 85, 1); - Recipe.currentRecipe.anyWood = true; - Recipe.currentRecipe.SetCraftingStation(499); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4126); - Recipe.currentRecipe.SetIngridients(3955, 6); - Recipe.currentRecipe.SetCraftingStation(499); - Recipe.AddRecipe(); - } - - private static void AddSandstoneFurniture() - { - Recipe.currentRecipe.createItem.SetDefaults(4720); - Recipe.currentRecipe.createItem.stack = 2; - Recipe.currentRecipe.SetIngridients(4051, 1); - Recipe.currentRecipe.SetCraftingStation(106); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4298); - Recipe.currentRecipe.SetIngridients(4051, 14); - Recipe.currentRecipe.SetCraftingStation(106); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4299); - Recipe.currentRecipe.SetIngridients(4051, 15, 225, 5); - Recipe.currentRecipe.SetCraftingStation(106); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4300); - Recipe.currentRecipe.SetIngridients(4051, 20, 149, 10); - Recipe.currentRecipe.SetCraftingStation(106); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4301); - Recipe.currentRecipe.SetIngridients(4051, 16); - Recipe.currentRecipe.SetCraftingStation(106); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4302); - Recipe.currentRecipe.SetIngridients(4051, 5, 8, 3); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4303); - Recipe.currentRecipe.SetIngridients(4051, 4, 8, 1); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4304); - Recipe.currentRecipe.SetIngridients(4051, 4); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4305); - Recipe.currentRecipe.SetIngridients(4051, 4, 8, 4, 85, 1); - Recipe.currentRecipe.SetCraftingStation(16); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4267); - Recipe.currentRecipe.SetIngridients(4051, 8, 22, 2); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.currentRecipe.anyIronBar = true; - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4306); - Recipe.currentRecipe.SetIngridients(4051, 10, 22, 3, 170, 6); - Recipe.currentRecipe.SetCraftingStation(106); - Recipe.currentRecipe.anyIronBar = true; - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4307); - Recipe.currentRecipe.SetIngridients(4051, 6); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4308); - Recipe.currentRecipe.SetIngridients(8, 1, 4051, 3); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4309); - Recipe.currentRecipe.SetIngridients(4051, 6, 8, 1); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4310); - Recipe.currentRecipe.SetIngridients(4051, 15, 154, 4, 149, 1); - Recipe.currentRecipe.SetCraftingStation(106); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4312); - Recipe.currentRecipe.SetIngridients(4051, 6, 206, 1); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4313); - Recipe.currentRecipe.SetIngridients(4051, 5, 225, 2); - Recipe.currentRecipe.SetCraftingStation(106); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4314); - Recipe.currentRecipe.SetIngridients(4051, 8); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4315); - Recipe.currentRecipe.SetIngridients(4051, 10); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4316); - Recipe.currentRecipe.SetIngridients(4051, 6); - Recipe.currentRecipe.SetCraftingStation(106); - Recipe.AddRecipe(); - } - - private static void AddBambooFurniture() - { - Recipe.currentRecipe.createItem.SetDefaults(4566); - Recipe.currentRecipe.SetIngridients(4564, 14); - Recipe.currentRecipe.SetCraftingStation(106); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4567); - Recipe.currentRecipe.SetIngridients(4564, 15, 225, 5); - Recipe.currentRecipe.SetCraftingStation(106); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4568); - Recipe.currentRecipe.SetIngridients(4564, 20, 149, 10); - Recipe.currentRecipe.SetCraftingStation(106); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4569); - Recipe.currentRecipe.SetIngridients(4564, 16); - Recipe.currentRecipe.SetCraftingStation(106); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4570); - Recipe.currentRecipe.SetIngridients(4564, 5, 8, 3); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4571); - Recipe.currentRecipe.SetIngridients(4564, 4, 8, 1); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4572); - Recipe.currentRecipe.SetIngridients(4564, 4); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4573); - Recipe.currentRecipe.SetIngridients(4564, 4, 8, 4, 85, 1); - Recipe.currentRecipe.SetCraftingStation(16); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4574); - Recipe.currentRecipe.SetIngridients(4564, 8, 22, 2); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.currentRecipe.anyIronBar = true; - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4575); - Recipe.currentRecipe.SetIngridients(4564, 10, 22, 3, 170, 6); - Recipe.currentRecipe.SetCraftingStation(106); - Recipe.currentRecipe.anyIronBar = true; - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4576); - Recipe.currentRecipe.SetIngridients(4564, 6); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4577); - Recipe.currentRecipe.SetIngridients(8, 1, 4564, 3); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4578); - Recipe.currentRecipe.SetIngridients(4564, 6, 8, 1); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4579); - Recipe.currentRecipe.SetIngridients(4564, 15, 154, 4, 149, 1); - Recipe.currentRecipe.SetCraftingStation(106); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4581); - Recipe.currentRecipe.SetIngridients(4564, 6, 206, 1); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4582); - Recipe.currentRecipe.SetIngridients(4564, 5, 225, 2); - Recipe.currentRecipe.SetCraftingStation(106); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4583); - Recipe.currentRecipe.SetIngridients(4564, 8); - Recipe.currentRecipe.SetCraftingStation(18); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4584); - Recipe.currentRecipe.SetIngridients(4564, 10); - Recipe.AddRecipe(); - Recipe.currentRecipe.createItem.SetDefaults(4586); - Recipe.currentRecipe.SetIngridients(4564, 6); - Recipe.currentRecipe.SetCraftingStation(106); - Recipe.AddRecipe(); - } - - private static void CreateReversePlatformRecipes() + private static void PlatformReturn() { int numRecipes = Recipe.numRecipes; for (int index1 = 0; index1 < numRecipes; ++index1) { if (Main.recipe[index1].createItem.createTile >= 0 && TileID.Sets.Platforms[Main.recipe[index1].createItem.createTile] && Main.recipe[index1].requiredItem[1].type == 0) { - Recipe.currentRecipe.createItem.SetDefaults(Main.recipe[index1].requiredItem[0].type); - Recipe.currentRecipe.createItem.stack = Main.recipe[index1].requiredItem[0].stack; - Recipe.currentRecipe.requiredItem[0].SetDefaults(Main.recipe[index1].createItem.type); - Recipe.currentRecipe.requiredItem[0].stack = Main.recipe[index1].createItem.stack; - for (int index2 = 0; index2 < Recipe.currentRecipe.requiredTile.Length; ++index2) - Recipe.currentRecipe.requiredTile[index2] = Main.recipe[index1].requiredTile[index2]; + Recipe.newRecipe.createItem.SetDefaults(Main.recipe[index1].requiredItem[0].type); + Recipe.newRecipe.createItem.stack = Main.recipe[index1].requiredItem[0].stack; + Recipe.newRecipe.requiredItem[0].SetDefaults(Main.recipe[index1].createItem.type); + Recipe.newRecipe.requiredItem[0].stack = Main.recipe[index1].createItem.stack; + for (int index2 = 0; index2 < Recipe.newRecipe.requiredTile.Length; ++index2) + Recipe.newRecipe.requiredTile[index2] = Main.recipe[index1].requiredTile[index2]; Recipe.AddRecipe(); Recipe recipe = Main.recipe[Recipe.numRecipes - 1]; for (int index3 = Recipe.numRecipes - 2; index3 > index1; --index3) @@ -1301,19 +453,19 @@ namespace Terraria } } - private static void CreateReverseWallRecipes() + private static void WallReturn() { int numRecipes = Recipe.numRecipes; for (int index1 = 0; index1 < numRecipes; ++index1) { if (Main.recipe[index1].createItem.createWall > 0 && Main.recipe[index1].requiredItem[1].type == 0 && Main.recipe[index1].requiredItem[0].createWall == -1) { - Recipe.currentRecipe.createItem.SetDefaults(Main.recipe[index1].requiredItem[0].type); - Recipe.currentRecipe.createItem.stack = Main.recipe[index1].requiredItem[0].stack; - Recipe.currentRecipe.requiredItem[0].SetDefaults(Main.recipe[index1].createItem.type); - Recipe.currentRecipe.requiredItem[0].stack = Main.recipe[index1].createItem.stack; - for (int index2 = 0; index2 < Recipe.currentRecipe.requiredTile.Length; ++index2) - Recipe.currentRecipe.requiredTile[index2] = Main.recipe[index1].requiredTile[index2]; + Recipe.newRecipe.createItem.SetDefaults(Main.recipe[index1].requiredItem[0].type); + Recipe.newRecipe.createItem.stack = Main.recipe[index1].requiredItem[0].stack; + Recipe.newRecipe.requiredItem[0].SetDefaults(Main.recipe[index1].createItem.type); + Recipe.newRecipe.requiredItem[0].stack = Main.recipe[index1].createItem.stack; + for (int index2 = 0; index2 < Recipe.newRecipe.requiredTile.Length; ++index2) + Recipe.newRecipe.requiredTile[index2] = Main.recipe[index1].requiredTile[index2]; Recipe.AddRecipe(); Recipe recipe = Main.recipe[Recipe.numRecipes - 1]; for (int index3 = Recipe.numRecipes - 2; index3 > index1; --index3) @@ -1323,35 +475,13 @@ namespace Terraria } } - public void SetIngridients(params int[] ingridients) - { - if (ingridients.Length == 1) - ingridients = new int[2]{ ingridients[0], 1 }; - if (ingridients.Length % 2 != 0) - throw new Exception("Bad ingridients amount"); - for (int index1 = 0; index1 < ingridients.Length; index1 += 2) - { - int index2 = index1 / 2; - this.requiredItem[index2].SetDefaults(ingridients[index1]); - this.requiredItem[index2].stack = ingridients[index1 + 1]; - } - } - - public void SetCraftingStation(params int[] tileIDs) - { - for (int index = 0; index < tileIDs.Length; ++index) - this.requiredTile[index] = tileIDs[index]; - } - private static void AddRecipe() { - if (Recipe.currentRecipe.requiredTile[0] == 13) - Recipe.currentRecipe.alchemy = true; - Main.recipe[Recipe.numRecipes] = Recipe.currentRecipe; - Recipe.currentRecipe = new Recipe(); + if (Recipe.newRecipe.requiredTile[0] == 13) + Recipe.newRecipe.alchemy = true; + Main.recipe[Recipe.numRecipes] = Recipe.newRecipe; + Recipe.newRecipe = new Recipe(); ++Recipe.numRecipes; } - - public static int GetRequiredTileStyle(int tileID) => tileID == 26 && WorldGen.crimson ? 1 : 0; } } diff --git a/RecipeGroup.cs b/RecipeGroup.cs index a9f432f..6853cb0 100644 --- a/RecipeGroup.cs +++ b/RecipeGroup.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.RecipeGroup -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; @@ -12,17 +12,16 @@ namespace Terraria public class RecipeGroup { public Func GetText; - public HashSet ValidItems; - public int IconicItemId; + public List ValidItems; + public int IconicItemIndex; public static Dictionary recipeGroups = new Dictionary(); public static Dictionary recipeGroupIDs = new Dictionary(); - public static int nextRecipeGroupIndex; + public static int nextRecipeGroupIndex = 0; public RecipeGroup(Func getName, params int[] validItems) { this.GetText = getName; - this.ValidItems = new HashSet((IEnumerable) validItems); - this.IconicItemId = validItems[0]; + this.ValidItems = new List((IEnumerable) validItems); } public static int RegisterGroup(string name, RecipeGroup rec) diff --git a/Ref`1.cs b/Ref`1.cs index 2bd7f86..233e9c6 100644 --- a/Ref`1.cs +++ b/Ref`1.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Ref`1 -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria diff --git a/RemoteClient.cs b/RemoteClient.cs index b21da9f..a251020 100644 --- a/RemoteClient.cs +++ b/RemoteClient.cs @@ -1,12 +1,10 @@ // Decompiled with JetBrains decompiler // Type: Terraria.RemoteClient -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; -using System; -using System.Collections.Generic; using Terraria.Localization; using Terraria.Net.Sockets; @@ -19,8 +17,8 @@ namespace Terraria public string Name = "Anonymous"; public bool IsActive; public bool PendingTermination; - public bool PendingTerminationApproved; public bool IsAnnouncementCompleted; + public bool IsReading; public int State; public int TimeOutTimer; public string StatusText = ""; @@ -37,14 +35,12 @@ namespace Terraria public float SpamAddBlockMax = 100f; public float SpamDeleteBlockMax = 500f; public float SpamWaterMax = 50f; - private volatile bool _isReading; - private static List _pendingSectionFraming = new List(); public bool IsConnected() => this.Socket != null && this.Socket.IsConnected(); public void SpamUpdate() { - if (!Netplay.SpamCheck) + if (!Netplay.spamCheck) { this.SpamProjectile = 0.0f; this.SpamDeleteBlock = 0.0f; @@ -89,11 +85,11 @@ namespace Terraria { int index1 = playerIndex; int sectionX = Netplay.GetSectionX((int) ((double) position.X / 16.0)); - int sectionY = Netplay.GetSectionY((int) ((double) position.Y / 16.0)); + int sectionY1 = Netplay.GetSectionY((int) ((double) position.Y / 16.0)); int num = 0; for (int index2 = sectionX - fluff; index2 < sectionX + fluff + 1; ++index2) { - for (int index3 = sectionY - fluff; index3 < sectionY + fluff + 1; ++index3) + for (int index3 = sectionY1 - fluff; index3 < sectionY1 + fluff + 1; ++index3) { if (index2 >= 0 && index2 < Main.maxSectionsX && index3 >= 0 && index3 < Main.maxSectionsY && !Netplay.Clients[index1].TileSections[index2, index3]) ++num; @@ -105,20 +101,17 @@ namespace Terraria NetMessage.SendData(9, index1, text: Lang.inter[44].ToNetworkText(), number: number); Netplay.Clients[index1].StatusText2 = Language.GetTextValue("Net.IsReceivingTileData"); Netplay.Clients[index1].StatusMax += number; - RemoteClient._pendingSectionFraming.Clear(); for (int index4 = sectionX - fluff; index4 < sectionX + fluff + 1; ++index4) { - for (int index5 = sectionY - fluff; index5 < sectionY + fluff + 1; ++index5) + for (int sectionY2 = sectionY1 - fluff; sectionY2 < sectionY1 + fluff + 1; ++sectionY2) { - if (index4 >= 0 && index4 < Main.maxSectionsX && index5 >= 0 && index5 < Main.maxSectionsY && !Netplay.Clients[index1].TileSections[index4, index5]) + if (index4 >= 0 && index4 < Main.maxSectionsX && sectionY2 >= 0 && sectionY2 < Main.maxSectionsY && !Netplay.Clients[index1].TileSections[index4, sectionY2]) { - NetMessage.SendSection(index1, index4, index5); - RemoteClient._pendingSectionFraming.Add(new Point(index4, index5)); + NetMessage.SendSection(index1, index4, sectionY2); + NetMessage.SendData(11, index1, number: index4, number2: ((float) sectionY2), number3: ((float) index4), number4: ((float) sectionY2)); } } } - foreach (Point point in RemoteClient._pendingSectionFraming) - NetMessage.SendData(11, index1, number: point.X, number2: ((float) point.Y), number3: ((float) point.X), number4: ((float) point.Y)); } public bool SectionRange(int size, int firstX, int firstY) @@ -162,9 +155,8 @@ namespace Terraria this.StatusText2 = ""; this.StatusText = ""; this.State = 0; - this._isReading = false; + this.IsReading = false; this.PendingTermination = false; - this.PendingTerminationApproved = false; this.SpamClear(); this.IsActive = false; NetMessage.buffer[this.Id].Reset(); @@ -181,44 +173,14 @@ namespace Terraria ++this.StatusCount; } - public void Update() + public void ServerReadCallBack(object state, int length) { - if (!this.IsActive) - { - this.State = 0; - this.IsActive = true; - } - this.TryRead(); - this.UpdateStatusText(); - } - - private void TryRead() - { - if (this._isReading) - return; - try - { - if (!this.Socket.IsDataAvailable()) - return; - this._isReading = true; - this.Socket.AsyncReceive(this.ReadBuffer, 0, this.ReadBuffer.Length, new SocketReceiveCallback(this.ServerReadCallBack)); - } - catch - { - this.PendingTermination = true; - } - } - - private void ServerReadCallBack(object state, int length) - { - if (!Netplay.Disconnect) + if (!Netplay.disconnect) { int streamLength = length; if (streamLength == 0) - { this.PendingTermination = true; - } - else + else if (Main.ignoreErrors) { try { @@ -226,51 +188,12 @@ namespace Terraria } catch { - if (!Main.ignoreErrors) - throw; } } - } - this._isReading = false; - } - - private void UpdateStatusText() - { - if (this.StatusMax > 0 && this.StatusText2 != "") - { - if (this.StatusCount >= this.StatusMax) - { - this.StatusText = Language.GetTextValue("Net.ClientStatusComplete", (object) this.Socket.GetRemoteAddress(), (object) this.Name, (object) this.StatusText2); - this.StatusText2 = ""; - this.StatusMax = 0; - this.StatusCount = 0; - } else - this.StatusText = "(" + (object) this.Socket.GetRemoteAddress() + ") " + this.Name + " " + this.StatusText2 + ": " + (object) (int) ((double) this.StatusCount / (double) this.StatusMax * 100.0) + "%"; - } - else if (this.State == 0) - this.StatusText = Language.GetTextValue("Net.ClientConnecting", (object) string.Format("({0}) {1}", (object) this.Socket.GetRemoteAddress(), (object) this.Name)); - else if (this.State == 1) - this.StatusText = Language.GetTextValue("Net.ClientSendingData", (object) this.Socket.GetRemoteAddress(), (object) this.Name); - else if (this.State == 2) - { - this.StatusText = Language.GetTextValue("Net.ClientRequestedWorldInfo", (object) this.Socket.GetRemoteAddress(), (object) this.Name); - } - else - { - if (this.State == 3) - return; - if (this.State != 10) - return; - try - { - this.StatusText = Language.GetTextValue("Net.ClientPlaying", (object) this.Socket.GetRemoteAddress(), (object) this.Name); - } - catch (Exception ex) - { - this.PendingTermination = true; - } + NetMessage.ReceiveBytes(this.ReadBuffer, streamLength, this.Id); } + this.IsReading = false; } } } diff --git a/RemoteServer.cs b/RemoteServer.cs index 13e0285..73b1c7e 100644 --- a/RemoteServer.cs +++ b/RemoteServer.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.RemoteServer -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; @@ -22,11 +22,6 @@ namespace Terraria public string StatusText; public int StatusCount; public int StatusMax; - public BitsByte StatusTextFlags; - - public bool HideStatusTextPercent => this.StatusTextFlags[0]; - - public bool StatusTextHasShadows => this.StatusTextFlags[1]; public void ClientWriteCallBack(object state) => --NetMessage.buffer[256].spamCount; @@ -34,12 +29,12 @@ namespace Terraria { try { - if (!Netplay.Disconnect) + if (!Netplay.disconnect) { int streamLength = length; if (streamLength == 0) { - Netplay.Disconnect = true; + Netplay.disconnect = true; Main.statusText = Language.GetTextValue("Net.LostConnection"); } else if (Main.ignoreErrors) @@ -71,7 +66,7 @@ namespace Terraria catch { } - Netplay.Disconnect = true; + Netplay.disconnect = true; } } } diff --git a/ResolutionChangeEvent.cs b/ResolutionChangeEvent.cs index 6f6f776..6b58c98 100644 --- a/ResolutionChangeEvent.cs +++ b/ResolutionChangeEvent.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ResolutionChangeEvent -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria diff --git a/SceneMetrics.cs b/SceneMetrics.cs deleted file mode 100644 index 438eed0..0000000 --- a/SceneMetrics.cs +++ /dev/null @@ -1,370 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.SceneMetrics -// 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; -using System; -using System.Collections.Generic; -using Terraria.ID; -using Terraria.WorldBuilding; - -namespace Terraria -{ - public class SceneMetrics - { - public static int CorruptionTileThreshold = 300; - public static int CorruptionTileMax = 1000; - public static int CrimsonTileThreshold = 300; - public static int CrimsonTileMax = 1000; - public static int HallowTileThreshold = 125; - public static int HallowTileMax = 600; - public static int JungleTileThreshold = 140; - public static int JungleTileMax = 700; - public static int SnowTileThreshold = 1500; - public static int SnowTileMax = 6000; - public static int DesertTileThreshold = 1500; - public static int MushroomTileThreshold = 100; - public static int MushroomTileMax = 200; - public static int MeteorTileThreshold = 75; - public static int GraveyardTileMax = 32; - public static int GraveyardTileMin = 12; - public static int GraveyardTileThreshold = 24; - public bool[] NPCBannerBuff = new bool[289]; - public bool hasBanner; - private readonly int[] _tileCounts = new int[623]; - private readonly World _world; - private readonly List _oreFinderTileLocations = new List(512); - public int bestOre; - - public Point? ClosestOrePosition { get; private set; } - - public int EvilTileCount { get; set; } - - public int HolyTileCount { get; set; } - - public int HoneyBlockCount { get; set; } - - public int ActiveMusicBox { get; set; } - - public int SandTileCount { get; private set; } - - public int MushroomTileCount { get; private set; } - - public int SnowTileCount { get; private set; } - - public int WaterCandleCount { get; private set; } - - public int PeaceCandleCount { get; private set; } - - public int PartyMonolithCount { get; private set; } - - public int MeteorTileCount { get; private set; } - - public int BloodTileCount { get; private set; } - - public int JungleTileCount { get; private set; } - - public int DungeonTileCount { get; private set; } - - public bool HasSunflower { get; private set; } - - public bool HasGardenGnome { get; private set; } - - public bool HasClock { get; private set; } - - public bool HasCampfire { get; private set; } - - public bool HasStarInBottle { get; private set; } - - public bool HasHeartLantern { get; private set; } - - public int ActiveFountainColor { get; private set; } - - public int ActiveMonolithType { get; private set; } - - public bool BloodMoonMonolith { get; private set; } - - public bool MoonLordMonolith { get; private set; } - - public bool HasCatBast { get; private set; } - - public int GraveyardTileCount { get; private set; } - - public bool EnoughTilesForJungle => this.JungleTileCount >= SceneMetrics.JungleTileThreshold; - - public bool EnoughTilesForHallow => this.HolyTileCount >= SceneMetrics.HallowTileThreshold; - - public bool EnoughTilesForSnow => this.SnowTileCount >= SceneMetrics.SnowTileThreshold; - - public bool EnoughTilesForGlowingMushroom => this.MushroomTileCount >= SceneMetrics.MushroomTileThreshold; - - public bool EnoughTilesForDesert => this.SandTileCount >= SceneMetrics.DesertTileThreshold; - - public bool EnoughTilesForCorruption => this.EvilTileCount >= SceneMetrics.CorruptionTileThreshold; - - public bool EnoughTilesForCrimson => this.BloodTileCount >= SceneMetrics.CrimsonTileThreshold; - - public bool EnoughTilesForMeteor => this.MeteorTileCount >= SceneMetrics.MeteorTileThreshold; - - public bool EnoughTilesForGraveyard => this.GraveyardTileCount >= SceneMetrics.GraveyardTileThreshold; - - public SceneMetrics(World world) - { - this._world = world; - this.Reset(); - } - - public void ScanAndExportToMain(SceneMetricsScanSettings settings) - { - this.Reset(); - int num1 = 0; - int num2 = 0; - if (settings.ScanOreFinderData) - this._oreFinderTileLocations.Clear(); - if (settings.BiomeScanCenterPositionInWorld.HasValue) - { - Point tileCoordinates = settings.BiomeScanCenterPositionInWorld.Value.ToTileCoordinates(); - Microsoft.Xna.Framework.Rectangle tileRectangle = new Microsoft.Xna.Framework.Rectangle(tileCoordinates.X - Main.buffScanAreaWidth / 2, tileCoordinates.Y - Main.buffScanAreaHeight / 2, Main.buffScanAreaWidth, Main.buffScanAreaHeight); - tileRectangle = WorldUtils.ClampToWorld(this._world, tileRectangle); - for (int left = tileRectangle.Left; left < tileRectangle.Right; ++left) - { - for (int top = tileRectangle.Top; top < tileRectangle.Bottom; ++top) - { - if (tileRectangle.Contains(left, top)) - { - Tile tile = this._world.Tiles[left, top]; - if (tile != null && tile.active()) - { - tileRectangle.Contains(left, top); - if (!TileID.Sets.isDesertBiomeSand[(int) tile.type] || !WorldGen.oceanDepths(left, top)) - ++this._tileCounts[(int) tile.type]; - if (tile.type == (ushort) 215 && tile.frameY < (short) 36) - this.HasCampfire = true; - if (tile.type == (ushort) 49 && tile.frameX < (short) 18) - ++num1; - if (tile.type == (ushort) 372 && tile.frameX < (short) 18) - ++num2; - if (tile.type == (ushort) 405 && tile.frameX < (short) 54) - this.HasCampfire = true; - if (tile.type == (ushort) 506 && tile.frameX < (short) 72) - this.HasCatBast = true; - if (tile.type == (ushort) 42 && tile.frameY >= (short) 324 && tile.frameY <= (short) 358) - this.HasHeartLantern = true; - if (tile.type == (ushort) 42 && tile.frameY >= (short) 252 && tile.frameY <= (short) 286) - this.HasStarInBottle = true; - if (tile.type == (ushort) 91 && (tile.frameX >= (short) 396 || tile.frameY >= (short) 54)) - { - int banner = (int) tile.frameX / 18 - 21; - for (int frameY = (int) tile.frameY; frameY >= 54; frameY -= 54) - banner = banner + 90 + 21; - int index = Item.BannerToItem(banner); - if (ItemID.Sets.BannerStrength[index].Enabled) - { - this.NPCBannerBuff[banner] = true; - this.hasBanner = true; - } - } - if (settings.ScanOreFinderData && Main.tileOreFinderPriority[(int) tile.type] != (short) 0) - this._oreFinderTileLocations.Add(new Point(left, top)); - } - } - } - } - } - if (settings.VisualScanArea.HasValue) - { - Microsoft.Xna.Framework.Rectangle world = WorldUtils.ClampToWorld(this._world, settings.VisualScanArea.Value); - for (int left = world.Left; left < world.Right; ++left) - { - for (int top = world.Top; top < world.Bottom; ++top) - { - Tile tile = this._world.Tiles[left, top]; - if (tile != null && tile.active()) - { - if (tile.type == (ushort) 104) - this.HasClock = true; - switch (tile.type) - { - case 139: - if (tile.frameX >= (short) 36) - { - this.ActiveMusicBox = (int) tile.frameY / 36; - continue; - } - continue; - case 207: - if (tile.frameY >= (short) 72) - { - switch ((int) tile.frameX / 36) - { - case 0: - this.ActiveFountainColor = 0; - continue; - case 1: - this.ActiveFountainColor = 12; - continue; - case 2: - this.ActiveFountainColor = 3; - continue; - case 3: - this.ActiveFountainColor = 5; - continue; - case 4: - this.ActiveFountainColor = 2; - continue; - case 5: - this.ActiveFountainColor = 10; - continue; - case 6: - this.ActiveFountainColor = 4; - continue; - case 7: - this.ActiveFountainColor = 9; - continue; - case 8: - this.ActiveFountainColor = 8; - continue; - case 9: - this.ActiveFountainColor = 6; - continue; - default: - this.ActiveFountainColor = -1; - continue; - } - } - else - continue; - case 410: - if (tile.frameY >= (short) 56) - { - this.ActiveMonolithType = (int) tile.frameX / 36; - continue; - } - continue; - case 480: - if (tile.frameY >= (short) 54) - { - this.BloodMoonMonolith = true; - continue; - } - continue; - case 509: - if (tile.frameY >= (short) 56) - { - this.ActiveMonolithType = 4; - continue; - } - continue; - default: - continue; - } - } - } - } - } - this.WaterCandleCount = num1; - this.PeaceCandleCount = num2; - this.ExportTileCountsToMain(); - if (!settings.ScanOreFinderData) - return; - this.UpdateOreFinderData(); - } - - private void ExportTileCountsToMain() - { - if (this._tileCounts[27] > 0) - this.HasSunflower = true; - if (this._tileCounts[567] > 0) - this.HasGardenGnome = true; - this.HoneyBlockCount = this._tileCounts[229]; - this.HolyTileCount = this._tileCounts[109] + this._tileCounts[492] + this._tileCounts[110] + this._tileCounts[113] + this._tileCounts[117] + this._tileCounts[116] + this._tileCounts[164] + this._tileCounts[403] + this._tileCounts[402]; - this.EvilTileCount = this._tileCounts[23] + this._tileCounts[24] + this._tileCounts[25] + this._tileCounts[32] + this._tileCounts[112] + this._tileCounts[163] + this._tileCounts[400] + this._tileCounts[398] + -10 * this._tileCounts[27]; - this.BloodTileCount = this._tileCounts[199] + this._tileCounts[203] + this._tileCounts[200] + this._tileCounts[401] + this._tileCounts[399] + this._tileCounts[234] + this._tileCounts[352] - 10 * this._tileCounts[27]; - this.SnowTileCount = this._tileCounts[147] + this._tileCounts[148] + this._tileCounts[161] + this._tileCounts[162] + this._tileCounts[164] + this._tileCounts[163] + this._tileCounts[200]; - this.JungleTileCount = this._tileCounts[60] + this._tileCounts[61] + this._tileCounts[62] + this._tileCounts[74] + this._tileCounts[226] + this._tileCounts[225]; - this.MushroomTileCount = this._tileCounts[70] + this._tileCounts[71] + this._tileCounts[72] + this._tileCounts[528]; - this.MeteorTileCount = this._tileCounts[37]; - this.DungeonTileCount = this._tileCounts[41] + this._tileCounts[43] + this._tileCounts[44] + this._tileCounts[481] + this._tileCounts[482] + this._tileCounts[483]; - this.SandTileCount = this._tileCounts[53] + this._tileCounts[112] + this._tileCounts[116] + this._tileCounts[234] + this._tileCounts[397] + this._tileCounts[398] + this._tileCounts[402] + this._tileCounts[399] + this._tileCounts[396] + this._tileCounts[400] + this._tileCounts[403] + this._tileCounts[401]; - this.PartyMonolithCount = this._tileCounts[455]; - this.GraveyardTileCount = this._tileCounts[85]; - this.GraveyardTileCount -= this._tileCounts[27] / 2; - if (this._tileCounts[27] > 0) - this.HasSunflower = true; - if (this.GraveyardTileCount > SceneMetrics.GraveyardTileMin) - this.HasSunflower = false; - if (this.GraveyardTileCount < 0) - this.GraveyardTileCount = 0; - if (this.HolyTileCount < 0) - this.HolyTileCount = 0; - if (this.EvilTileCount < 0) - this.EvilTileCount = 0; - if (this.BloodTileCount < 0) - this.BloodTileCount = 0; - int holyTileCount = this.HolyTileCount; - this.HolyTileCount -= this.EvilTileCount; - this.HolyTileCount -= this.BloodTileCount; - this.EvilTileCount -= holyTileCount; - this.BloodTileCount -= holyTileCount; - if (this.HolyTileCount < 0) - this.HolyTileCount = 0; - if (this.EvilTileCount < 0) - this.EvilTileCount = 0; - if (this.BloodTileCount >= 0) - return; - this.BloodTileCount = 0; - } - - public int GetTileCount(ushort tileId) => this._tileCounts[(int) tileId]; - - public void Reset() - { - Array.Clear((Array) this._tileCounts, 0, this._tileCounts.Length); - this.SandTileCount = 0; - this.EvilTileCount = 0; - this.BloodTileCount = 0; - this.GraveyardTileCount = 0; - this.MushroomTileCount = 0; - this.SnowTileCount = 0; - this.HolyTileCount = 0; - this.MeteorTileCount = 0; - this.JungleTileCount = 0; - this.DungeonTileCount = 0; - this.HasCampfire = false; - this.HasSunflower = false; - this.HasGardenGnome = false; - this.HasStarInBottle = false; - this.HasHeartLantern = false; - this.HasClock = false; - this.HasCatBast = false; - this.ActiveMusicBox = -1; - this.WaterCandleCount = 0; - this.ActiveFountainColor = -1; - this.ActiveMonolithType = -1; - this.bestOre = -1; - this.BloodMoonMonolith = false; - this.MoonLordMonolith = false; - Array.Clear((Array) this.NPCBannerBuff, 0, this.NPCBannerBuff.Length); - this.hasBanner = false; - } - - private void UpdateOreFinderData() - { - int index = -1; - foreach (Point finderTileLocation in this._oreFinderTileLocations) - { - Tile tile = this._world.Tiles[finderTileLocation.X, finderTileLocation.Y]; - if (SceneMetrics.IsValidForOreFinder(tile) && (index < 0 || (int) Main.tileOreFinderPriority[(int) tile.type] > (int) Main.tileOreFinderPriority[index])) - { - index = (int) tile.type; - this.ClosestOrePosition = new Point?(finderTileLocation); - } - } - this.bestOre = index; - } - - public static bool IsValidForOreFinder(Tile t) => (t.type != (ushort) 227 || t.frameX >= (short) 272 && t.frameX <= (short) 374) && Main.tileOreFinderPriority[(int) t.type] > (short) 0; - } -} diff --git a/SceneMetricsScanSettings.cs b/SceneMetricsScanSettings.cs deleted file mode 100644 index dfa2bdc..0000000 --- a/SceneMetricsScanSettings.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.SceneMetricsScanSettings -// 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 -{ - public struct SceneMetricsScanSettings - { - public Rectangle? VisualScanArea; - public Vector2? BiomeScanCenterPositionInWorld; - public bool ScanOreFinderData; - } -} diff --git a/Server/Game.cs b/Server/Game.cs index ec06a7e..9c0fd46 100644 --- a/Server/Game.cs +++ b/Server/Game.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Server.Game -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/ShoppingSettings.cs b/ShoppingSettings.cs deleted file mode 100644 index 433092c..0000000 --- a/ShoppingSettings.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.ShoppingSettings -// 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 -{ - public struct ShoppingSettings - { - public double PriceAdjustment; - public string HappinessReport; - - public static ShoppingSettings NotInShop => new ShoppingSettings() - { - PriceAdjustment = 1.0, - HappinessReport = "" - }; - } -} diff --git a/Sign.cs b/Sign.cs index 3569584..15567b6 100644 --- a/Sign.cs +++ b/Sign.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Sign -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria diff --git a/Social/Base/AchievementsSocialModule.cs b/Social/Base/AchievementsSocialModule.cs index c77b616..4dcb3a5 100644 --- a/Social/Base/AchievementsSocialModule.cs +++ b/Social/Base/AchievementsSocialModule.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Social.Base.AchievementsSocialModule -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Social.Base diff --git a/Social/Base/CloudSocialModule.cs b/Social/Base/CloudSocialModule.cs index 501d00b..5c13c5f 100644 --- a/Social/Base/CloudSocialModule.cs +++ b/Social/Base/CloudSocialModule.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Social.Base.CloudSocialModule -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; diff --git a/Social/Base/FriendsSocialModule.cs b/Social/Base/FriendsSocialModule.cs index ac5bc4a..c17cadd 100644 --- a/Social/Base/FriendsSocialModule.cs +++ b/Social/Base/FriendsSocialModule.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Social.Base.FriendsSocialModule -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Social.Base diff --git a/Social/Base/NetSocialModule.cs b/Social/Base/NetSocialModule.cs index 7749863..6aa1380 100644 --- a/Social/Base/NetSocialModule.cs +++ b/Social/Base/NetSocialModule.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Social.Base.NetSocialModule -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System.Diagnostics; diff --git a/Social/Base/OverlaySocialModule.cs b/Social/Base/OverlaySocialModule.cs index b78e353..6e3aed3 100644 --- a/Social/Base/OverlaySocialModule.cs +++ b/Social/Base/OverlaySocialModule.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Social.Base.OverlaySocialModule -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Social.Base diff --git a/Social/Base/RichPresenceState.cs b/Social/Base/RichPresenceState.cs deleted file mode 100644 index 95dca0f..0000000 --- a/Social/Base/RichPresenceState.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.Base.RichPresenceState -// 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.UI.States; - -namespace Terraria.Social.Base -{ - public class RichPresenceState : IEquatable - { - public RichPresenceState.GameModeState GameMode; - - public bool Equals(RichPresenceState other) => this.GameMode == other.GameMode; - - public static RichPresenceState GetCurrentState() - { - RichPresenceState richPresenceState = new RichPresenceState(); - if (Main.gameMenu) - { - int num = Main.MenuUI.CurrentState is UICharacterCreation ? 1 : 0; - bool flag = Main.MenuUI.CurrentState is UIWorldCreation; - richPresenceState.GameMode = num == 0 ? (!flag ? RichPresenceState.GameModeState.InMainMenu : RichPresenceState.GameModeState.CreatingWorld) : RichPresenceState.GameModeState.CreatingPlayer; - } - else - richPresenceState.GameMode = Main.netMode != 0 ? RichPresenceState.GameModeState.PlayingMulti : RichPresenceState.GameModeState.PlayingSingle; - return richPresenceState; - } - - public enum GameModeState - { - InMainMenu, - CreatingPlayer, - CreatingWorld, - PlayingSingle, - PlayingMulti, - } - } -} diff --git a/Social/Base/ServerJoinRequestEvent.cs b/Social/Base/ServerJoinRequestEvent.cs deleted file mode 100644 index b279bf1..0000000 --- a/Social/Base/ServerJoinRequestEvent.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.Base.ServerJoinRequestEvent -// 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.Social.Base -{ - public delegate void ServerJoinRequestEvent(UserJoinToServerRequest request); -} diff --git a/Social/Base/ServerJoinRequestsManager.cs b/Social/Base/ServerJoinRequestsManager.cs deleted file mode 100644 index 9ffecc1..0000000 --- a/Social/Base/ServerJoinRequestsManager.cs +++ /dev/null @@ -1,68 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.Base.ServerJoinRequestsManager -// 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.Collections.ObjectModel; - -namespace Terraria.Social.Base -{ - public class ServerJoinRequestsManager - { - private readonly List _requests; - public readonly ReadOnlyCollection CurrentRequests; - - public event ServerJoinRequestEvent OnRequestAdded; - - public event ServerJoinRequestEvent OnRequestRemoved; - - public ServerJoinRequestsManager() - { - this._requests = new List(); - this.CurrentRequests = new ReadOnlyCollection((IList) this._requests); - } - - public void Update() - { - for (int index = this._requests.Count - 1; index >= 0; --index) - { - if (!this._requests[index].IsValid()) - this.RemoveRequestAtIndex(index); - } - } - - public void Add(UserJoinToServerRequest request) - { - for (int index = this._requests.Count - 1; index >= 0; --index) - { - if (this._requests[index].Equals((object) request)) - this.RemoveRequestAtIndex(index); - } - this._requests.Add(request); - request.OnAccepted += (Action) (() => this.RemoveRequest(request)); - request.OnRejected += (Action) (() => this.RemoveRequest(request)); - if (this.OnRequestAdded == null) - return; - this.OnRequestAdded(request); - } - - private void RemoveRequestAtIndex(int i) - { - UserJoinToServerRequest request = this._requests[i]; - this._requests.RemoveAt(i); - if (this.OnRequestRemoved == null) - return; - this.OnRequestRemoved(request); - } - - private void RemoveRequest(UserJoinToServerRequest request) - { - if (!this._requests.Remove(request) || this.OnRequestRemoved == null) - return; - this.OnRequestRemoved(request); - } - } -} diff --git a/Social/Base/UserJoinToServerRequest.cs b/Social/Base/UserJoinToServerRequest.cs deleted file mode 100644 index 94de277..0000000 --- a/Social/Base/UserJoinToServerRequest.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.Base.UserJoinToServerRequest -// 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.Social.Base -{ - public abstract class UserJoinToServerRequest - { - internal string UserDisplayName { get; private set; } - - internal string UserFullIdentifier { get; private set; } - - public event Action OnAccepted; - - public event Action OnRejected; - - public UserJoinToServerRequest(string userDisplayName, string fullIdentifier) - { - this.UserDisplayName = userDisplayName; - this.UserFullIdentifier = fullIdentifier; - } - - public void Accept() - { - if (this.OnAccepted == null) - return; - this.OnAccepted(); - } - - public void Reject() - { - if (this.OnRejected == null) - return; - this.OnRejected(); - } - - public abstract bool IsValid(); - - public abstract string GetUserWrapperText(); - } -} diff --git a/Social/ISocialModule.cs b/Social/ISocialModule.cs index 7e976a4..6f12236 100644 --- a/Social/ISocialModule.cs +++ b/Social/ISocialModule.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Social.ISocialModule -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Social diff --git a/Social/SocialAPI.cs b/Social/SocialAPI.cs index 32d40a4..0196ad8 100644 --- a/Social/SocialAPI.cs +++ b/Social/SocialAPI.cs @@ -1,13 +1,11 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Social.SocialAPI -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe -using System; using System.Collections.Generic; -using Terraria.Social.Base; -using Terraria.Social.WeGame; +using Terraria.Social.Steam; namespace Terraria.Social { @@ -19,7 +17,6 @@ namespace Terraria.Social public static Terraria.Social.Base.CloudSocialModule Cloud; public static Terraria.Social.Base.NetSocialModule Network; public static Terraria.Social.Base.OverlaySocialModule Overlay; - public static ServerJoinRequestsManager JoinRequests; private static List _modules; public static SocialMode Mode => SocialAPI._mode; @@ -33,17 +30,8 @@ namespace Terraria.Social } SocialAPI._mode = mode.Value; SocialAPI._modules = new List(); - SocialAPI.JoinRequests = new ServerJoinRequestsManager(); - Main.OnTickForInternalCodeOnly += new Action(SocialAPI.JoinRequests.Update); - switch (SocialAPI.Mode) - { - case SocialMode.Steam: - SocialAPI.LoadSteam(); - break; - case SocialMode.WeGame: - SocialAPI.LoadWeGame(); - break; - } + if (SocialAPI.Mode == SocialMode.Steam) + SocialAPI.LoadSteam(); foreach (ISocialModule module in SocialAPI._modules) module.Initialize(); } @@ -68,29 +56,14 @@ namespace Terraria.Social return module; } - private static void LoadDiscord() - { - } - private static void LoadSteam() { - SocialAPI.LoadModule(); + SocialAPI.LoadModule(); SocialAPI.Friends = (Terraria.Social.Base.FriendsSocialModule) SocialAPI.LoadModule(); SocialAPI.Achievements = (Terraria.Social.Base.AchievementsSocialModule) SocialAPI.LoadModule(); SocialAPI.Cloud = (Terraria.Social.Base.CloudSocialModule) SocialAPI.LoadModule(); SocialAPI.Overlay = (Terraria.Social.Base.OverlaySocialModule) SocialAPI.LoadModule(); - SocialAPI.Network = (Terraria.Social.Base.NetSocialModule) SocialAPI.LoadModule(); - WeGameHelper.WriteDebugString("LoadSteam modules"); - } - - private static void LoadWeGame() - { - SocialAPI.LoadModule(); - SocialAPI.Cloud = (Terraria.Social.Base.CloudSocialModule) SocialAPI.LoadModule(); - SocialAPI.Friends = (Terraria.Social.Base.FriendsSocialModule) SocialAPI.LoadModule(); - SocialAPI.Overlay = (Terraria.Social.Base.OverlaySocialModule) SocialAPI.LoadModule(); - SocialAPI.Network = (Terraria.Social.Base.NetSocialModule) SocialAPI.LoadModule(); - WeGameHelper.WriteDebugString("LoadWeGame modules"); + SocialAPI.Network = (Terraria.Social.Base.NetSocialModule) SocialAPI.LoadModule(); } } } diff --git a/Social/SocialMode.cs b/Social/SocialMode.cs index 76148ba..cdb53e0 100644 --- a/Social/SocialMode.cs +++ b/Social/SocialMode.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Social.SocialMode -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Social @@ -10,6 +10,5 @@ namespace Terraria.Social { None, Steam, - WeGame, } } diff --git a/Social/Steam/AchievementsSocialModule.cs b/Social/Steam/AchievementsSocialModule.cs index c094c86..073b477 100644 --- a/Social/Steam/AchievementsSocialModule.cs +++ b/Social/Steam/AchievementsSocialModule.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Social.Steam.AchievementsSocialModule -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Steamworks; diff --git a/Social/Steam/CloudSocialModule.cs b/Social/Steam/CloudSocialModule.cs index fb4feee..3747421 100644 --- a/Social/Steam/CloudSocialModule.cs +++ b/Social/Steam/CloudSocialModule.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Social.Steam.CloudSocialModule -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Steamworks; diff --git a/Social/Steam/CoreSocialModule.cs b/Social/Steam/CoreSocialModule.cs index 8c55efa..a250597 100644 --- a/Social/Steam/CoreSocialModule.cs +++ b/Social/Steam/CoreSocialModule.cs @@ -1,10 +1,9 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Social.Steam.CoreSocialModule -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe -using ReLogic.OS; using Steamworks; using System; using System.Threading; @@ -39,20 +38,10 @@ namespace Terraria.Social.Steam Environment.Exit(1); } this.IsSteamValid = true; - new Thread(new ParameterizedThreadStart(this.SteamCallbackLoop)) - { - IsBackground = true - }.Start(); - new Thread(new ParameterizedThreadStart(this.SteamTickLoop)) - { - IsBackground = true - }.Start(); - Main.OnTickForThirdPartySoftwareOnly += new Action(this.PulseSteamTick); - Main.OnTickForThirdPartySoftwareOnly += new Action(this.PulseSteamCallback); - if (!Platform.IsOSX) - return; - // ISSUE: method pointer - this._onOverlayActivated = Callback.Create(new Callback.DispatchDelegate((object) this, __methodptr(OnOverlayActivated))); + ThreadPool.QueueUserWorkItem(new WaitCallback(this.SteamCallbackLoop), (object) null); + ThreadPool.QueueUserWorkItem(new WaitCallback(this.SteamTickLoop), (object) null); + Main.OnTick += new Action(this.PulseSteamTick); + Main.OnTick += new Action(this.PulseSteamCallback); } } diff --git a/Social/Steam/FriendsSocialModule.cs b/Social/Steam/FriendsSocialModule.cs index 671ecba..32626bf 100644 --- a/Social/Steam/FriendsSocialModule.cs +++ b/Social/Steam/FriendsSocialModule.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Social.Steam.FriendsSocialModule -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Steamworks; diff --git a/Social/Steam/Lobby.cs b/Social/Steam/Lobby.cs index 24d9568..da0f75d 100644 --- a/Social/Steam/Lobby.cs +++ b/Social/Steam/Lobby.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Social.Steam.Lobby -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Steamworks; diff --git a/Social/Steam/LobbyState.cs b/Social/Steam/LobbyState.cs index 4fdc167..6fc54c2 100644 --- a/Social/Steam/LobbyState.cs +++ b/Social/Steam/LobbyState.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Social.Steam.LobbyState -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Social.Steam diff --git a/Social/Steam/NetClientSocialModule.cs b/Social/Steam/NetClientSocialModule.cs index b8a7183..16f394c 100644 --- a/Social/Steam/NetClientSocialModule.cs +++ b/Social/Steam/NetClientSocialModule.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Social.Steam.NetClientSocialModule -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Steamworks; @@ -10,7 +10,6 @@ using System.Diagnostics; using Terraria.Localization; using Terraria.Net; using Terraria.Net.Sockets; -using Terraria.Social.WeGame; namespace Terraria.Social.Steam { @@ -46,12 +45,7 @@ namespace Terraria.Social.Steam ulong result; if (!Program.LaunchParameters.ContainsKey("+connect_lobby") || !ulong.TryParse(Program.LaunchParameters["+connect_lobby"], out result)) return; - this.ConnectToLobby(result); - } - - public void ConnectToLobby(ulong lobbyId) - { - CSteamID lobbySteamId = new CSteamID(lobbyId); + CSteamID lobbySteamId = new CSteamID(result); if (!((CSteamID) ref lobbySteamId).IsValid()) return; Main.OpenPlayerSelect((Main.OnPlayerSelected) (playerData => @@ -60,7 +54,6 @@ namespace Terraria.Social.Steam playerData.SetAsActive(); Main.menuMode = 882; Main.statusText = Language.GetTextValue("Social.Joining"); - WeGameHelper.WriteDebugString(" CheckParameters, lobby.join"); // ISSUE: method pointer this._lobby.Join(lobbySteamId, new CallResult.APIDispatchDelegate((object) this, __methodptr(OnLobbyEntered))); })); @@ -68,7 +61,6 @@ namespace Terraria.Social.Steam public override void LaunchLocalServer(Process process, ServerMode mode) { - WeGameHelper.WriteDebugString(nameof (LaunchLocalServer)); if (this._lobby.State != LobbyState.Inactive) this._lobby.Leave(); ProcessStartInfo startInfo = process.StartInfo; @@ -131,11 +123,10 @@ namespace Terraria.Social.Steam private void OnLobbyJoinRequest(GameLobbyJoinRequested_t result) { - WeGameHelper.WriteDebugString(" OnLobbyJoinRequest"); if (this._lobby.State != LobbyState.Inactive) this._lobby.Leave(); string friendName = SteamFriends.GetFriendPersonaName((CSteamID) result.m_steamIDFriend); - Main.QueueMainThreadAction((Action) (() => Main.OpenPlayerSelect((Main.OnPlayerSelected) (playerData => + Main.OpenPlayerSelect((Main.OnPlayerSelected) (playerData => { Main.ServerSideCharacter = false; playerData.SetAsActive(); @@ -143,12 +134,11 @@ namespace Terraria.Social.Steam Main.statusText = Language.GetTextValue("Social.JoiningFriend", (object) friendName); // ISSUE: method pointer this._lobby.Join((CSteamID) result.m_steamIDLobby, new CallResult.APIDispatchDelegate((object) this, __methodptr(OnLobbyEntered))); - })))); + })); } private void OnLobbyEntered(LobbyEnter_t result, bool failure) { - WeGameHelper.WriteDebugString(" OnLobbyEntered"); SteamNetworking.AllowP2PPacketRelay(true); this.SendAuthTicket(this._lobby.Owner); int num = 0; @@ -195,7 +185,6 @@ namespace Terraria.Social.Steam private void SendAuthTicket(CSteamID address) { - WeGameHelper.WriteDebugString(" SendAuthTicket"); if (HAuthTicket.op_Equality(this._authTicket, (HAuthTicket) HAuthTicket.Invalid)) this._authTicket = SteamUser.GetAuthSessionTicket(this._authData, this._authData.Length, ref this._authDataLength); int length = (int) this._authDataLength + 3; @@ -225,15 +214,10 @@ namespace Terraria.Social.Steam Netplay.OnDisconnect -= new Action(this.OnDisconnect); } - private void OnSessionConnectFail(P2PSessionConnectFail_t result) - { - WeGameHelper.WriteDebugString(" OnSessionConnectFail"); - this.Close((CSteamID) result.m_steamIDRemote); - } + private void OnSessionConnectFail(P2PSessionConnectFail_t result) => this.Close((CSteamID) result.m_steamIDRemote); private void OnP2PSessionRequest(P2PSessionRequest_t result) { - WeGameHelper.WriteDebugString(" OnP2PSessionRequest"); CSteamID steamIdRemote = (CSteamID) result.m_steamIDRemote; if (!this._connectionStateMap.ContainsKey(steamIdRemote) || this._connectionStateMap[steamIdRemote] == NetSocialModule.ConnectionState.Inactive) return; diff --git a/Social/Steam/NetServerSocialModule.cs b/Social/Steam/NetServerSocialModule.cs index ce2bbff..5c9fc50 100644 --- a/Social/Steam/NetServerSocialModule.cs +++ b/Social/Steam/NetServerSocialModule.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Social.Steam.NetServerSocialModule -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Steamworks; diff --git a/Social/Steam/NetSocialModule.cs b/Social/Steam/NetSocialModule.cs index 96b1679..1737bc5 100644 --- a/Social/Steam/NetSocialModule.cs +++ b/Social/Steam/NetSocialModule.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Social.Steam.NetSocialModule -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Steamworks; diff --git a/Social/Steam/OverlaySocialModule.cs b/Social/Steam/OverlaySocialModule.cs index e644315..74a3031 100644 --- a/Social/Steam/OverlaySocialModule.cs +++ b/Social/Steam/OverlaySocialModule.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Social.Steam.OverlaySocialModule -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Steamworks; diff --git a/Social/Steam/SteamP2PReader.cs b/Social/Steam/SteamP2PReader.cs index 0dfbf1c..24b2ea4 100644 --- a/Social/Steam/SteamP2PReader.cs +++ b/Social/Steam/SteamP2PReader.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Social.Steam.SteamP2PReader -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Steamworks; diff --git a/Social/Steam/SteamP2PWriter.cs b/Social/Steam/SteamP2PWriter.cs index cc895d5..b09fb78 100644 --- a/Social/Steam/SteamP2PWriter.cs +++ b/Social/Steam/SteamP2PWriter.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Social.Steam.SteamP2PWriter -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Steamworks; diff --git a/Social/WeGame/AchievementsSocialModule.cs b/Social/WeGame/AchievementsSocialModule.cs deleted file mode 100644 index b5aee8b..0000000 --- a/Social/WeGame/AchievementsSocialModule.cs +++ /dev/null @@ -1,173 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.WeGame.AchievementsSocialModule -// 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 rail; -using System; -using System.Threading; - -namespace Terraria.Social.WeGame -{ - public class AchievementsSocialModule : Terraria.Social.Base.AchievementsSocialModule - { - private const string FILE_NAME = "/achievements-wegame.dat"; - private bool _areStatsReceived; - private bool _areAchievementReceived; - private RailCallBackHelper _callbackHelper = new RailCallBackHelper(); - private IRailPlayerAchievement _playerAchievement; - private IRailPlayerStats _playerStats; - - public override void Initialize() - { - // ISSUE: method pointer - this._callbackHelper.RegisterCallback((RAILEventID) 2001, new RailEventCallBackHandler((object) this, __methodptr(RailEventCallBack))); - // ISSUE: method pointer - this._callbackHelper.RegisterCallback((RAILEventID) 2101, new RailEventCallBackHandler((object) this, __methodptr(RailEventCallBack))); - IRailPlayerStats myPlayerStats = this.GetMyPlayerStats(); - IRailPlayerAchievement playerAchievement = this.GetMyPlayerAchievement(); - if (myPlayerStats == null || playerAchievement == null) - return; - myPlayerStats.AsyncRequestStats(""); - playerAchievement.AsyncRequestAchievement(""); - while (!this._areStatsReceived && !this._areAchievementReceived) - { - CoreSocialModule.RailEventTick(); - Thread.Sleep(10); - } - } - - public override void Shutdown() => this.StoreStats(); - - private IRailPlayerStats GetMyPlayerStats() - { - if (this._playerStats == null) - { - IRailStatisticHelper irailStatisticHelper = rail_api.RailFactory().RailStatisticHelper(); - if (irailStatisticHelper != null) - { - RailID railId = new RailID(); - ((RailComparableID) railId).id_ = (__Null) 0L; - this._playerStats = irailStatisticHelper.CreatePlayerStats(railId); - } - } - return this._playerStats; - } - - private IRailPlayerAchievement GetMyPlayerAchievement() - { - if (this._playerAchievement == null) - { - IRailAchievementHelper achievementHelper = rail_api.RailFactory().RailAchievementHelper(); - if (achievementHelper != null) - { - RailID railId = new RailID(); - ((RailComparableID) railId).id_ = (__Null) 0L; - this._playerAchievement = achievementHelper.CreatePlayerAchievement(railId); - } - } - return this._playerAchievement; - } - - public void RailEventCallBack(RAILEventID eventId, EventBase data) - { - if (eventId != 2001) - { - if (eventId != 2101) - return; - this._areAchievementReceived = true; - } - else - this._areStatsReceived = true; - } - - public override bool IsAchievementCompleted(string name) - { - bool flag = false; - RailResult railResult = (RailResult) 1; - IRailPlayerAchievement playerAchievement = this.GetMyPlayerAchievement(); - if (playerAchievement != null) - railResult = playerAchievement.HasAchieved(name, ref flag); - return flag && railResult == 0; - } - - public override byte[] GetEncryptionKey() - { - RailID railId = rail_api.RailFactory().RailPlayer().GetRailID(); - byte[] numArray = new byte[16]; - byte[] bytes = BitConverter.GetBytes((ulong) ((RailComparableID) railId).id_); - Array.Copy((Array) bytes, (Array) numArray, 8); - Array.Copy((Array) bytes, 0, (Array) numArray, 8, 8); - return numArray; - } - - public override string GetSavePath() => "/achievements-wegame.dat"; - - private int GetIntStat(string name) - { - int num = 0; - this.GetMyPlayerStats()?.GetStatValue(name, ref num); - return num; - } - - private float GetFloatStat(string name) - { - double num = 0.0; - this.GetMyPlayerStats()?.GetStatValue(name, ref num); - return (float) num; - } - - private bool SetFloatStat(string name, float value) - { - IRailPlayerStats myPlayerStats = this.GetMyPlayerStats(); - RailResult railResult = (RailResult) 1; - if (myPlayerStats != null) - railResult = myPlayerStats.SetStatValue(name, (double) value); - return railResult == 0; - } - - public override void UpdateIntStat(string name, int value) - { - IRailPlayerStats myPlayerStats = this.GetMyPlayerStats(); - if (myPlayerStats == null) - return; - int num = 0; - if (myPlayerStats.GetStatValue(name, ref num) != null || num >= value) - return; - myPlayerStats.SetStatValue(name, value); - } - - private bool SetIntStat(string name, int value) - { - IRailPlayerStats myPlayerStats = this.GetMyPlayerStats(); - RailResult railResult = (RailResult) 1; - if (myPlayerStats != null) - railResult = myPlayerStats.SetStatValue(name, value); - return railResult == 0; - } - - public override void UpdateFloatStat(string name, float value) - { - IRailPlayerStats myPlayerStats = this.GetMyPlayerStats(); - if (myPlayerStats == null) - return; - double num = 0.0; - if (myPlayerStats.GetStatValue(name, ref num) != null || num >= (double) value) - return; - myPlayerStats.SetStatValue(name, (double) value); - } - - public override void StoreStats() - { - this.SaveStats(); - this.SaveAchievement(); - } - - private void SaveStats() => this.GetMyPlayerStats()?.AsyncStoreStats(""); - - private void SaveAchievement() => this.GetMyPlayerAchievement()?.AsyncStoreAchievement(""); - - public override void CompleteAchievement(string name) => this.GetMyPlayerAchievement()?.MakeAchievement(name); - } -} diff --git a/Social/WeGame/AsyncTaskHelper.cs b/Social/WeGame/AsyncTaskHelper.cs deleted file mode 100644 index 749055b..0000000 --- a/Social/WeGame/AsyncTaskHelper.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.WeGame.AsyncTaskHelper -// 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.Threading.Tasks; - -namespace Terraria.Social.WeGame -{ - public class AsyncTaskHelper - { - private CurrentThreadRunner _currentThreadRunner; - - private AsyncTaskHelper() => this._currentThreadRunner = new CurrentThreadRunner(); - - public void RunAsyncTaskAndReply(Action task, Action replay) => Task.Factory.StartNew((Action) (() => - { - task(); - this._currentThreadRunner.Run(replay); - })); - - public void RunAsyncTask(Action task) => Task.Factory.StartNew(task); - } -} diff --git a/Social/WeGame/CloudSocialModule.cs b/Social/WeGame/CloudSocialModule.cs deleted file mode 100644 index e36bcab..0000000 --- a/Social/WeGame/CloudSocialModule.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.WeGame.CloudSocialModule -// 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 rail; -using System.Collections.Generic; - -namespace Terraria.Social.WeGame -{ - public class CloudSocialModule : Terraria.Social.Base.CloudSocialModule - { - private object ioLock = new object(); - - public override void Initialize() => base.Initialize(); - - public override void Shutdown() - { - } - - public override IEnumerable GetFiles() - { - lock (this.ioLock) - { - uint fileCount = rail_api.RailFactory().RailStorageHelper().GetFileCount(); - List stringList = new List((int) fileCount); - ulong num = 0; - for (uint index = 0; index < fileCount; ++index) - { - string str; - rail_api.RailFactory().RailStorageHelper().GetFileNameAndSize(index, ref str, ref num); - stringList.Add(str); - } - return (IEnumerable) stringList; - } - } - - public override bool Write(string path, byte[] data, int length) - { - lock (this.ioLock) - { - bool flag = true; - IRailFile irailFile = !rail_api.RailFactory().RailStorageHelper().IsFileExist(path) ? rail_api.RailFactory().RailStorageHelper().CreateFile(path) : rail_api.RailFactory().RailStorageHelper().OpenFile(path); - if (irailFile != null) - { - int num = (int) irailFile.Write(data, (uint) length); - irailFile.Close(); - } - else - flag = false; - return flag; - } - } - - public override int GetFileSize(string path) - { - lock (this.ioLock) - { - IRailFile irailFile = rail_api.RailFactory().RailStorageHelper().OpenFile(path); - if (irailFile == null) - return 0; - int size = (int) irailFile.GetSize(); - irailFile.Close(); - return size; - } - } - - public override void Read(string path, byte[] buffer, int size) - { - lock (this.ioLock) - { - IRailFile irailFile = rail_api.RailFactory().RailStorageHelper().OpenFile(path); - if (irailFile == null) - return; - int num = (int) irailFile.Read(buffer, (uint) size); - irailFile.Close(); - } - } - - public override bool HasFile(string path) - { - lock (this.ioLock) - return rail_api.RailFactory().RailStorageHelper().IsFileExist(path); - } - - public override bool Delete(string path) - { - lock (this.ioLock) - return rail_api.RailFactory().RailStorageHelper().RemoveFile(path) == 0; - } - } -} diff --git a/Social/WeGame/CoreSocialModule.cs b/Social/WeGame/CoreSocialModule.cs deleted file mode 100644 index 078a797..0000000 --- a/Social/WeGame/CoreSocialModule.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.WeGame.CoreSocialModule -// 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 rail; -using System; -using System.Runtime.InteropServices; -using System.Threading; -using System.Windows.Forms; - -namespace Terraria.Social.WeGame -{ - public class CoreSocialModule : ISocialModule - { - private RailCallBackHelper _callbackHelper = new RailCallBackHelper(); - private static object _railTickLock = new object(); - private bool isRailValid; - - [DllImport("kernel32.dll")] - private static extern uint GetCurrentThreadId(); - - public static event Action OnTick; - - public void Initialize() - { - RailGameID railGameId = new RailGameID(); - ((RailComparableID) railGameId).id_ = (__Null) 2000328L; - string[] strArray = new string[1]{ " " }; - if (rail_api.RailNeedRestartAppForCheckingEnvironment(railGameId, strArray.Length, strArray)) - Environment.Exit(1); - if (!rail_api.RailInitialize()) - Environment.Exit(1); - // ISSUE: method pointer - this._callbackHelper.RegisterCallback((RAILEventID) 2, new RailEventCallBackHandler((object) null, __methodptr(RailEventCallBack))); - this.isRailValid = true; - ThreadPool.QueueUserWorkItem(new WaitCallback(this.TickThread), (object) null); - Main.OnTickForThirdPartySoftwareOnly += new Action(CoreSocialModule.RailEventTick); - } - - public static void RailEventTick() - { - rail_api.RailFireEvents(); - if (!Monitor.TryEnter(CoreSocialModule._railTickLock)) - return; - Monitor.Pulse(CoreSocialModule._railTickLock); - Monitor.Exit(CoreSocialModule._railTickLock); - } - - private void TickThread(object context) - { - Monitor.Enter(CoreSocialModule._railTickLock); - while (this.isRailValid) - { - if (CoreSocialModule.OnTick != null) - CoreSocialModule.OnTick(); - Monitor.Wait(CoreSocialModule._railTickLock); - } - Monitor.Exit(CoreSocialModule._railTickLock); - } - - public void Shutdown() - { - Application.ApplicationExit += (EventHandler) ((obj, evt) => this.isRailValid = false); - this._callbackHelper.UnregisterAllCallback(); - rail_api.RailFinalize(); - } - - public static void RailEventCallBack(RAILEventID eventId, EventBase data) - { - if (eventId != 2) - return; - CoreSocialModule.ProcessRailSystemStateChange((RailSystemState) ((RailSystemStateChanged) data).state); - } - - public static void SaveAndQuitCallBack() => Main.WeGameRequireExitGame(); - - private static void ProcessRailSystemStateChange(RailSystemState state) - { - if (state != 2 && state != 3) - return; - int num = (int) MessageBox.Show("检测到WeGame异常,游戏将自动保存进度并退出游戏", "Terraria--WeGame Error"); - WorldGen.SaveAndQuit(new Action(CoreSocialModule.SaveAndQuitCallBack)); - } - } -} diff --git a/Social/WeGame/CurrentThreadRunner.cs b/Social/WeGame/CurrentThreadRunner.cs deleted file mode 100644 index 9bddde7..0000000 --- a/Social/WeGame/CurrentThreadRunner.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.WeGame.CurrentThreadRunner -// 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.Windows.Threading; - -namespace Terraria.Social.WeGame -{ - public class CurrentThreadRunner - { - private Dispatcher _dsipatcher; - - public CurrentThreadRunner() => this._dsipatcher = Dispatcher.CurrentDispatcher; - - public void Run(Action f) => this._dsipatcher.BeginInvoke((Delegate) f); - } -} diff --git a/Social/WeGame/FriendsSocialModule.cs b/Social/WeGame/FriendsSocialModule.cs deleted file mode 100644 index 94babe6..0000000 --- a/Social/WeGame/FriendsSocialModule.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.WeGame.FriendsSocialModule -// 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 rail; - -namespace Terraria.Social.WeGame -{ - public class FriendsSocialModule : Terraria.Social.Base.FriendsSocialModule - { - public override void Initialize() - { - } - - public override void Shutdown() - { - } - - public override string GetUsername() - { - string str; - rail_api.RailFactory().RailPlayer().GetPlayerName(ref str); - WeGameHelper.WriteDebugString("GetUsername by wegame" + str); - return str; - } - - public override void OpenJoinInterface() - { - WeGameHelper.WriteDebugString("OpenJoinInterface by wegame"); - rail_api.RailFactory().RailFloatingWindow().AsyncShowRailFloatingWindow((EnumRailWindowType) 10, ""); - } - } -} diff --git a/Social/WeGame/IPCBase.cs b/Social/WeGame/IPCBase.cs deleted file mode 100644 index de8f69b..0000000 --- a/Social/WeGame/IPCBase.cs +++ /dev/null @@ -1,179 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.WeGame.IPCBase -// 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.IO; -using System.IO.Pipes; -using System.Linq; -using System.Text; -using System.Threading; - -namespace Terraria.Social.WeGame -{ - public abstract class IPCBase - { - private List> _producer = new List>(); - private List> _consumer = new List>(); - private List _totalData = new List(); - private object _listLock = new object(); - private volatile bool _haveDataToReadFlag; - protected volatile bool _pipeBrokenFlag; - protected PipeStream _pipeStream; - protected CancellationTokenSource _cancelTokenSrc; - protected Action _onDataArrive; - - public int BufferSize { set; get; } - - public virtual event Action OnDataArrive - { - add => this._onDataArrive += value; - remove => this._onDataArrive -= value; - } - - public IPCBase() => this.BufferSize = 256; - - protected void AddPackToList(List pack) - { - lock (this._listLock) - { - this._producer.Add(pack); - this._haveDataToReadFlag = true; - } - } - - protected List> GetPackList() - { - List> byteListList = (List>) null; - lock (this._listLock) - { - List> producer = this._producer; - this._producer = this._consumer; - this._consumer = producer; - this._producer.Clear(); - byteListList = this._consumer; - this._haveDataToReadFlag = false; - } - return byteListList; - } - - protected bool HaveDataToRead() => this._haveDataToReadFlag; - - public virtual void Reset() - { - this._cancelTokenSrc.Cancel(); - this._pipeStream.Dispose(); - this._pipeStream = (PipeStream) null; - } - - public virtual void ProcessDataArriveEvent() - { - if (!this.HaveDataToRead()) - return; - List> packList = this.GetPackList(); - if (packList == null || this._onDataArrive == null) - return; - foreach (List byteList in packList) - this._onDataArrive(byteList.ToArray()); - } - - protected virtual bool BeginReadData() - { - bool flag = false; - IPCContent ipcContent = new IPCContent() - { - data = new byte[this.BufferSize], - CancelToken = this._cancelTokenSrc.Token - }; - WeGameHelper.WriteDebugString(nameof (BeginReadData)); - try - { - if (this._pipeStream != null) - { - this._pipeStream.BeginRead(ipcContent.data, 0, this.BufferSize, new AsyncCallback(this.ReadCallback), (object) ipcContent); - flag = true; - } - } - catch (IOException ex) - { - this._pipeBrokenFlag = true; - WeGameHelper.WriteDebugString("BeginReadData Exception, {0}", (object) ex.Message); - } - return flag; - } - - public virtual void ReadCallback(IAsyncResult result) - { - WeGameHelper.WriteDebugString("ReadCallback: " + Thread.CurrentThread.ManagedThreadId.ToString()); - IPCContent asyncState = (IPCContent) result.AsyncState; - try - { - int count = this._pipeStream.EndRead(result); - if (!asyncState.CancelToken.IsCancellationRequested) - { - if (count <= 0) - return; - this._totalData.AddRange(((IEnumerable) asyncState.data).Take(count)); - if (!this._pipeStream.IsMessageComplete) - return; - this.AddPackToList(this._totalData); - this._totalData = new List(); - } - else - WeGameHelper.WriteDebugString("IPCBase.ReadCallback.cancel"); - } - catch (IOException ex) - { - this._pipeBrokenFlag = true; - WeGameHelper.WriteDebugString("ReadCallback Exception, {0}", (object) ex.Message); - } - catch (InvalidOperationException ex) - { - this._pipeBrokenFlag = true; - WeGameHelper.WriteDebugString("ReadCallback Exception, {0}", (object) ex.Message); - } - } - - public virtual bool Send(string value) => this.Send(Encoding.UTF8.GetBytes(value)); - - public virtual bool Send(byte[] data) - { - bool flag = false; - if (this._pipeStream != null) - { - if (this._pipeStream.IsConnected) - { - try - { - this._pipeStream.BeginWrite(data, 0, data.Length, new AsyncCallback(this.SendCallback), (object) null); - flag = true; - } - catch (IOException ex) - { - this._pipeBrokenFlag = true; - WeGameHelper.WriteDebugString("Send Exception, {0}", (object) ex.Message); - } - } - } - return flag; - } - - protected virtual void SendCallback(IAsyncResult result) - { - try - { - if (this._pipeStream == null) - return; - this._pipeStream.EndWrite(result); - } - catch (IOException ex) - { - this._pipeBrokenFlag = true; - WeGameHelper.WriteDebugString("SendCallback Exception, {0}", (object) ex.Message); - } - } - } -} diff --git a/Social/WeGame/IPCClient.cs b/Social/WeGame/IPCClient.cs deleted file mode 100644 index fe9df71..0000000 --- a/Social/WeGame/IPCClient.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.WeGame.IPCClient -// 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.IO.Pipes; -using System.Threading; -using System.Threading.Tasks; - -namespace Terraria.Social.WeGame -{ - public class IPCClient : IPCBase - { - private bool _connectedFlag; - - public event Action OnConnected; - - public override event Action OnDataArrive - { - add => this._onDataArrive = this._onDataArrive + value; - remove => this._onDataArrive = this._onDataArrive - value; - } - - private NamedPipeClientStream GetPipeStream() => (NamedPipeClientStream) this._pipeStream; - - private void ProcessConnectedEvent() - { - if (!this._connectedFlag) - return; - if (this.OnConnected != null) - this.OnConnected(); - this._connectedFlag = false; - } - - private void ProcessPipeBrokenEvent() - { - if (!this._pipeBrokenFlag) - return; - this.Reset(); - this._pipeBrokenFlag = false; - } - - private void CheckFlagAndFireEvent() - { - this.ProcessConnectedEvent(); - this.ProcessDataArriveEvent(); - this.ProcessPipeBrokenEvent(); - } - - public void Init(string clientName) - { - } - - public void ConnectTo(string serverName) - { - if (this.GetPipeStream() != null) - return; - this._pipeStream = (PipeStream) new NamedPipeClientStream(".", serverName, PipeDirection.InOut, PipeOptions.Asynchronous); - this._cancelTokenSrc = new CancellationTokenSource(); - Task.Factory.StartNew((Action) (content => - { - this.GetPipeStream().Connect(); - if (((CancellationToken) content).IsCancellationRequested) - return; - this.GetPipeStream().ReadMode = PipeTransmissionMode.Message; - this.BeginReadData(); - this._connectedFlag = true; - }), (object) this._cancelTokenSrc.Token); - } - - public void Tick() => this.CheckFlagAndFireEvent(); - - public override void ReadCallback(IAsyncResult result) - { - IPCContent asyncState = (IPCContent) result.AsyncState; - base.ReadCallback(result); - if (!asyncState.CancelToken.IsCancellationRequested) - { - if (!this.GetPipeStream().IsConnected) - return; - this.BeginReadData(); - } - else - WeGameHelper.WriteDebugString("ReadCallback cancel"); - } - } -} diff --git a/Social/WeGame/IPCContent.cs b/Social/WeGame/IPCContent.cs deleted file mode 100644 index b3cd194..0000000 --- a/Social/WeGame/IPCContent.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.WeGame.IPCContent -// 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.Threading; - -namespace Terraria.Social.WeGame -{ - public class IPCContent - { - public byte[] data; - - public CancellationToken CancelToken { get; set; } - } -} diff --git a/Social/WeGame/IPCMessage.cs b/Social/WeGame/IPCMessage.cs deleted file mode 100644 index e8ecc8d..0000000 --- a/Social/WeGame/IPCMessage.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.WeGame.IPCMessage -// 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 System.Text; - -namespace Terraria.Social.WeGame -{ - public class IPCMessage - { - private IPCMessageType _cmd; - private string _jsonData; - - public void Build(IPCMessageType cmd, T t) - { - this._jsonData = WeGameHelper.Serialize(t); - this._cmd = cmd; - } - - public void BuildFrom(byte[] data) - { - byte[] array1 = ((IEnumerable) data).Take(4).ToArray(); - byte[] array2 = ((IEnumerable) data).Skip(4).ToArray(); - this._cmd = (IPCMessageType) BitConverter.ToInt32(array1, 0); - this._jsonData = Encoding.UTF8.GetString(array2); - } - - public void Parse(out T value) => WeGameHelper.UnSerialize(this._jsonData, out value); - - public byte[] GetBytes() - { - List byteList = new List(); - byteList.AddRange((IEnumerable) BitConverter.GetBytes((int) this._cmd)); - byteList.AddRange((IEnumerable) Encoding.UTF8.GetBytes(this._jsonData)); - return byteList.ToArray(); - } - - public IPCMessageType GetCmd() => this._cmd; - } -} diff --git a/Social/WeGame/IPCMessageType.cs b/Social/WeGame/IPCMessageType.cs deleted file mode 100644 index 4e74b0e..0000000 --- a/Social/WeGame/IPCMessageType.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.WeGame.IPCMessageType -// 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.Social.WeGame -{ - public enum IPCMessageType - { - IPCMessageTypeReportServerID, - IPCMessageTypeNotifyFriendList, - } -} diff --git a/Social/WeGame/IPCServer.cs b/Social/WeGame/IPCServer.cs deleted file mode 100644 index 2947369..0000000 --- a/Social/WeGame/IPCServer.cs +++ /dev/null @@ -1,124 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.WeGame.IPCServer -// 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.IO; -using System.IO.Pipes; -using System.Threading; - -namespace Terraria.Social.WeGame -{ - public class IPCServer : IPCBase - { - private string _serverName; - private bool _haveClientAccessFlag; - - public event Action OnClientAccess; - - public override event Action OnDataArrive - { - add => this._onDataArrive = this._onDataArrive + value; - remove => this._onDataArrive = this._onDataArrive - value; - } - - private NamedPipeServerStream GetPipeStream() => (NamedPipeServerStream) this._pipeStream; - - public void Init(string serverName) => this._serverName = serverName; - - private void LazyCreatePipe() - { - if (this.GetPipeStream() != null) - return; - this._pipeStream = (PipeStream) new NamedPipeServerStream(this._serverName, PipeDirection.InOut, 1, PipeTransmissionMode.Message, PipeOptions.Asynchronous); - this._cancelTokenSrc = new CancellationTokenSource(); - } - - public override void ReadCallback(IAsyncResult result) - { - IPCContent asyncState = (IPCContent) result.AsyncState; - base.ReadCallback(result); - if (!asyncState.CancelToken.IsCancellationRequested) - this.ContinueReadOrWait(); - else - WeGameHelper.WriteDebugString("servcer.ReadCallback cancel"); - } - - public void StartListen() - { - this.LazyCreatePipe(); - WeGameHelper.WriteDebugString("begin listen"); - this.GetPipeStream().BeginWaitForConnection(new AsyncCallback(this.ConnectionCallback), (object) this._cancelTokenSrc.Token); - } - - private void RestartListen() => this.StartListen(); - - private void ConnectionCallback(IAsyncResult result) - { - try - { - this._haveClientAccessFlag = true; - WeGameHelper.WriteDebugString("Connected in"); - this.GetPipeStream().EndWaitForConnection(result); - if (!((CancellationToken) result.AsyncState).IsCancellationRequested) - this.BeginReadData(); - else - WeGameHelper.WriteDebugString("ConnectionCallback but user cancel"); - } - catch (IOException ex) - { - this._pipeBrokenFlag = true; - WeGameHelper.WriteDebugString("ConnectionCallback Exception, {0}", (object) ex.Message); - } - } - - public void ContinueReadOrWait() - { - if (this.GetPipeStream().IsConnected) - { - this.BeginReadData(); - } - else - { - try - { - this.GetPipeStream().BeginWaitForConnection(new AsyncCallback(this.ConnectionCallback), (object) null); - } - catch (IOException ex) - { - this._pipeBrokenFlag = true; - WeGameHelper.WriteDebugString("ContinueReadOrWait Exception, {0}", (object) ex.Message); - } - } - } - - private void ProcessClientAccessEvent() - { - if (!this._haveClientAccessFlag) - return; - if (this.OnClientAccess != null) - this.OnClientAccess(); - this._haveClientAccessFlag = false; - } - - private void CheckFlagAndFireEvent() - { - this.ProcessClientAccessEvent(); - this.ProcessDataArriveEvent(); - this.ProcessPipeBrokenEvent(); - } - - private void ProcessPipeBrokenEvent() - { - if (!this._pipeBrokenFlag) - return; - this.Reset(); - this._pipeBrokenFlag = false; - this.RestartListen(); - } - - public void Tick() => this.CheckFlagAndFireEvent(); - } -} diff --git a/Social/WeGame/Lobby.cs b/Social/WeGame/Lobby.cs deleted file mode 100644 index cdcc779..0000000 --- a/Social/WeGame/Lobby.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.WeGame.Lobby -// 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 rail; -using System; - -namespace Terraria.Social.WeGame -{ - public class Lobby - { - private RailCallBackHelper _callbackHelper = new RailCallBackHelper(); - public LobbyState State; - private bool _gameServerInitSuccess; - private IRailGameServer _gameServer; - public Action _lobbyCreatedExternalCallback; - private RailID _server_id; - - private IRailGameServer RailServerHelper - { - get => this._gameServerInitSuccess ? this._gameServer : (IRailGameServer) null; - set => this._gameServer = value; - } - - private IRailGameServerHelper GetRailServerHelper() => rail_api.RailFactory().RailGameServerHelper(); - - private void RegisterGameServerEvent() - { - if (this._callbackHelper == null) - return; - // ISSUE: method pointer - this._callbackHelper.RegisterCallback((RAILEventID) 3002, new RailEventCallBackHandler((object) this, __methodptr(OnRailEvent))); - } - - public void OnRailEvent(RAILEventID id, EventBase data) - { - WeGameHelper.WriteDebugString("OnRailEvent,id=" + id.ToString() + " ,result=" + data.result.ToString()); - if (id != 3002) - return; - this.OnGameServerCreated((CreateGameServerResult) data); - } - - private void OnGameServerCreated(CreateGameServerResult result) - { - if (((EventBase) result).result != null) - return; - this._gameServerInitSuccess = true; - this._lobbyCreatedExternalCallback((RailID) result.game_server_id); - this._server_id = (RailID) result.game_server_id; - } - - public void Create(bool inviteOnly) - { - if (this.State == LobbyState.Inactive) - this.RegisterGameServerEvent(); - this.RailServerHelper = rail_api.RailFactory().RailGameServerHelper().AsyncCreateGameServer(new CreateGameServerOptions() - { - has_password = (__Null) 0, - enable_team_voice = (__Null) 0 - }, "terraria", "terraria"); - this.State = LobbyState.Creating; - } - - public void OpenInviteOverlay() - { - WeGameHelper.WriteDebugString("OpenInviteOverlay by wegame"); - rail_api.RailFactory().RailFloatingWindow().AsyncShowRailFloatingWindow((EnumRailWindowType) 10, ""); - } - - public void Join(RailID local_peer, RailID remote_peer) - { - if (this.State != LobbyState.Inactive) - WeGameHelper.WriteDebugString("Lobby connection attempted while already in a lobby. This should never happen?"); - else - this.State = LobbyState.Connecting; - } - - public byte[] GetMessage(int index) => (byte[]) null; - - public int GetUserCount() => 0; - - public RailID GetUserByIndex(int index) => (RailID) null; - - public bool SendMessage(byte[] data) => this.SendMessage(data, data.Length); - - public bool SendMessage(byte[] data, int length) => false; - - public void Set(RailID lobbyId) - { - } - - public void SetPlayedWith(RailID userId) - { - } - - public void Leave() => this.State = LobbyState.Inactive; - - public IRailGameServer GetServer() => this.RailServerHelper; - } -} diff --git a/Social/WeGame/LobbyState.cs b/Social/WeGame/LobbyState.cs deleted file mode 100644 index 245569d..0000000 --- a/Social/WeGame/LobbyState.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.WeGame.LobbyState -// 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.Social.WeGame -{ - public enum LobbyState - { - Inactive, - Connecting, - Creating, - Active, - } -} diff --git a/Social/WeGame/MessageDispatcherBase.cs b/Social/WeGame/MessageDispatcherBase.cs deleted file mode 100644 index c522a42..0000000 --- a/Social/WeGame/MessageDispatcherBase.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.WeGame.MessageDispatcherBase -// 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.Social.WeGame -{ - public abstract class MessageDispatcherBase - { - } -} diff --git a/Social/WeGame/MessageDispatcherClient.cs b/Social/WeGame/MessageDispatcherClient.cs deleted file mode 100644 index 4716b8c..0000000 --- a/Social/WeGame/MessageDispatcherClient.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.WeGame.MessageDispatcherClient -// 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.Social.WeGame -{ - public class MessageDispatcherClient - { - private IPCClient _ipcClient = new IPCClient(); - private string _severName; - private string _clientName; - - public event Action OnMessage; - - public event Action OnConnected; - - public void Init(string clientName, string serverName) - { - this._clientName = clientName; - this._severName = serverName; - this._ipcClient.Init(clientName); - this._ipcClient.OnDataArrive += new Action(this.OnDataArrive); - this._ipcClient.OnConnected += new Action(this.OnServerConnected); - } - - public void Start() => this._ipcClient.ConnectTo(this._severName); - - private void OnDataArrive(byte[] data) - { - IPCMessage ipcMessage = new IPCMessage(); - ipcMessage.BuildFrom(data); - if (this.OnMessage == null) - return; - this.OnMessage(ipcMessage); - } - - private void OnServerConnected() - { - if (this.OnConnected == null) - return; - this.OnConnected(); - } - - public void Tick() => this._ipcClient.Tick(); - - public bool SendMessage(IPCMessage msg) => this._ipcClient.Send(msg.GetBytes()); - } -} diff --git a/Social/WeGame/MessageDispatcherServer.cs b/Social/WeGame/MessageDispatcherServer.cs deleted file mode 100644 index 6902308..0000000 --- a/Social/WeGame/MessageDispatcherServer.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.WeGame.MessageDispatcherServer -// 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.Social.WeGame -{ - public class MessageDispatcherServer - { - private IPCServer _ipcSever = new IPCServer(); - - public event Action OnIPCClientAccess; - - public event Action OnMessage; - - public void Init(string serverName) - { - this._ipcSever.Init(serverName); - this._ipcSever.OnDataArrive += new Action(this.OnDataArrive); - this._ipcSever.OnClientAccess += new Action(this.OnClientAccess); - } - - public void OnClientAccess() - { - if (this.OnIPCClientAccess == null) - return; - this.OnIPCClientAccess(); - } - - public void Start() => this._ipcSever.StartListen(); - - private void OnDataArrive(byte[] data) - { - IPCMessage ipcMessage = new IPCMessage(); - ipcMessage.BuildFrom(data); - if (this.OnMessage == null) - return; - this.OnMessage(ipcMessage); - } - - public void Tick() => this._ipcSever.Tick(); - - public bool SendMessage(IPCMessage msg) => this._ipcSever.Send(msg.GetBytes()); - } -} diff --git a/Social/WeGame/NetClientSocialModule.cs b/Social/WeGame/NetClientSocialModule.cs deleted file mode 100644 index 8a3f412..0000000 --- a/Social/WeGame/NetClientSocialModule.cs +++ /dev/null @@ -1,498 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.WeGame.NetClientSocialModule -// 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 rail; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Text; -using Terraria.Localization; -using Terraria.Net; -using Terraria.Net.Sockets; - -namespace Terraria.Social.WeGame -{ - public class NetClientSocialModule : NetSocialModule - { - private RailCallBackHelper _callbackHelper = new RailCallBackHelper(); - private bool _hasLocalHost; - private IPCServer server = new IPCServer(); - private readonly string _serverIDMedataKey = "terraria.serverid"; - private RailID _inviter_id = new RailID(); - private List _player_info_list; - private MessageDispatcherServer _msgServer; - - private void OnIPCClientAccess() - { - WeGameHelper.WriteDebugString("IPC client access"); - this.SendFriendListToLocalServer(); - } - - private void LazyCreateWeGameMsgServer() - { - if (this._msgServer != null) - return; - this._msgServer = new MessageDispatcherServer(); - this._msgServer.Init("WeGame.Terraria.Message.Server"); - this._msgServer.OnMessage += new Action(this.OnWegameMessage); - this._msgServer.OnIPCClientAccess += new Action(this.OnIPCClientAccess); - CoreSocialModule.OnTick += new Action(this._msgServer.Tick); - this._msgServer.Start(); - } - - private void OnWegameMessage(IPCMessage message) - { - if (message.GetCmd() != IPCMessageType.IPCMessageTypeReportServerID) - return; - ReportServerID reportServerID; - message.Parse(out reportServerID); - this.OnReportServerID(reportServerID); - } - - private void OnReportServerID(ReportServerID reportServerID) - { - WeGameHelper.WriteDebugString("OnReportServerID - " + reportServerID._serverID); - this.AsyncSetMyMetaData(this._serverIDMedataKey, reportServerID._serverID); - this.AsyncSetInviteCommandLine(reportServerID._serverID); - } - - public override void Initialize() - { - base.Initialize(); - this.RegisterRailEvent(); - this.AsyncGetFriendsInfo(); - this._reader.SetReadEvent(new WeGameP2PReader.OnReadEvent(this.OnPacketRead)); - this._reader.SetLocalPeer(this.GetLocalPeer()); - this._writer.SetLocalPeer(this.GetLocalPeer()); - Main.OnEngineLoad += new Action(this.CheckParameters); - } - - private void AsyncSetInviteCommandLine(string cmdline) => rail_api.RailFactory().RailFriends().AsyncSetInviteCommandLine(cmdline, ""); - - private void AsyncSetMyMetaData(string key, string value) - { - List railKeyValueList = new List(); - railKeyValueList.Add(new RailKeyValue() - { - key = (__Null) key, - value = (__Null) value - }); - rail_api.RailFactory().RailFriends().AsyncSetMyMetadata(railKeyValueList, ""); - } - - private bool TryAuthUserByRecvData(RailID user, byte[] data, int length) - { - WeGameHelper.WriteDebugString("TryAuthUserByRecvData user:{0}", (object) (ulong) ((RailComparableID) user).id_); - if (length < 3) - { - WeGameHelper.WriteDebugString("Failed to validate authentication packet: Too short. (Length: " + (object) length + ")"); - return false; - } - int num = (int) data[1] << 8 | (int) data[0]; - if (num != length) - { - WeGameHelper.WriteDebugString("Failed to validate authentication packet: Packet size mismatch. (" + (object) num + "!=" + (object) length + ")"); - return false; - } - if (data[2] == (byte) 93) - return true; - WeGameHelper.WriteDebugString("Failed to validate authentication packet: Packet type is not correct. (Type: " + (object) data[2] + ")"); - return false; - } - - private bool OnPacketRead(byte[] data, int size, RailID user) - { - if (!this._connectionStateMap.ContainsKey(user)) - return false; - NetSocialModule.ConnectionState connectionState = this._connectionStateMap[user]; - if (connectionState != NetSocialModule.ConnectionState.Authenticating) - return connectionState == NetSocialModule.ConnectionState.Connected; - if (!this.TryAuthUserByRecvData(user, data, size)) - { - WeGameHelper.WriteDebugString(" Auth Server Ticket Failed"); - this.Close(user); - } - else - { - WeGameHelper.WriteDebugString("OnRailAuthSessionTicket Auth Success.."); - this.OnAuthSuccess(user); - } - return false; - } - - private void OnAuthSuccess(RailID remote_peer) - { - if (!this._connectionStateMap.ContainsKey(remote_peer)) - return; - this._connectionStateMap[remote_peer] = NetSocialModule.ConnectionState.Connected; - this.AsyncSetPlayWith(this._inviter_id); - this.AsyncSetMyMetaData("status", Language.GetTextValue("Social.StatusInGame")); - // ISSUE: explicit non-virtual call - this.AsyncSetMyMetaData(this._serverIDMedataKey, __nonvirtual (((RailComparableID) remote_peer).id_.ToString())); - Main.clrInput(); - Netplay.ServerPassword = ""; - Main.GetInputText(""); - Main.autoPass = false; - Main.netMode = 1; - Netplay.OnConnectedToSocialServer((ISocket) new SocialSocket((RemoteAddress) new WeGameAddress(remote_peer, this.GetFriendNickname(this._inviter_id)))); - // ISSUE: explicit non-virtual call - WeGameHelper.WriteDebugString("OnConnectToSocialServer server:" + __nonvirtual (((RailComparableID) remote_peer).id_.ToString())); - } - - private bool GetRailConnectIDFromCmdLine(RailID server_id) - { - foreach (string commandLineArg in Environment.GetCommandLineArgs()) - { - string str = "--rail_connect_cmd="; - int num = commandLineArg.IndexOf(str); - if (num != -1) - { - ulong result = 0; - if (ulong.TryParse(commandLineArg.Substring(num + str.Length), out result)) - { - ((RailComparableID) server_id).id_ = (__Null) (long) result; - return true; - } - } - } - return false; - } - - private void CheckParameters() - { - RailID server_id = new RailID(); - if (!this.GetRailConnectIDFromCmdLine(server_id)) - return; - if (((RailComparableID) server_id).IsValid()) - Main.OpenPlayerSelect((Main.OnPlayerSelected) (playerData => - { - Main.ServerSideCharacter = false; - playerData.SetAsActive(); - Main.menuMode = 882; - Main.statusText = Language.GetTextValue("Social.Joining"); - WeGameHelper.WriteDebugString(" CheckParameters, lobby.join"); - this.JoinServer(server_id); - })); - else - WeGameHelper.WriteDebugString("Invalid RailID passed to +connect_lobby"); - } - - public override void LaunchLocalServer(Process process, ServerMode mode) - { - if (this._lobby.State != LobbyState.Inactive) - this._lobby.Leave(); - this.LazyCreateWeGameMsgServer(); - ProcessStartInfo startInfo1 = process.StartInfo; - startInfo1.Arguments = startInfo1.Arguments + " -wegame -localwegameid " + (object) (ulong) ((RailComparableID) this.GetLocalPeer()).id_; - if (mode.HasFlag((Enum) ServerMode.Lobby)) - { - this._hasLocalHost = true; - if (mode.HasFlag((Enum) ServerMode.FriendsCanJoin)) - process.StartInfo.Arguments += " -lobby friends"; - else - process.StartInfo.Arguments += " -lobby private"; - if (mode.HasFlag((Enum) ServerMode.FriendsOfFriends)) - process.StartInfo.Arguments += " -friendsoffriends"; - } - string str; - rail_api.RailFactory().RailUtils().GetLaunchAppParameters((EnumRailLaunchAppType) 2, ref str); - ProcessStartInfo startInfo2 = process.StartInfo; - startInfo2.Arguments = startInfo2.Arguments + " " + str; - WeGameHelper.WriteDebugString("LaunchLocalServer,cmd_line:" + process.StartInfo.Arguments); - this.AsyncSetMyMetaData("status", Language.GetTextValue("Social.StatusInGame")); - Netplay.OnDisconnect += new Action(this.OnDisconnect); - process.Start(); - } - - public override void Shutdown() - { - this.AsyncSetInviteCommandLine(""); - this.CleanMyMetaData(); - this.UnRegisterRailEvent(); - base.Shutdown(); - } - - public override ulong GetLobbyId() => 0; - - public override bool StartListening(SocketConnectionAccepted callback) => false; - - public override void StopListening() - { - } - - public override void Close(RemoteAddress address) - { - this.CleanMyMetaData(); - this.Close(this.RemoteAddressToRailId(address)); - } - - public override bool CanInvite() => (this._hasLocalHost || this._lobby.State == LobbyState.Active || Main.LobbyId != 0UL) && (uint) Main.netMode > 0U; - - public override void OpenInviteInterface() => this._lobby.OpenInviteOverlay(); - - private void Close(RailID remote_peer) - { - if (!this._connectionStateMap.ContainsKey(remote_peer)) - return; - WeGameHelper.WriteDebugString("CloseRemotePeer, remote:{0}", (object) (ulong) ((RailComparableID) remote_peer).id_); - rail_api.RailFactory().RailNetworkHelper().CloseSession(this.GetLocalPeer(), remote_peer); - this._connectionStateMap[remote_peer] = NetSocialModule.ConnectionState.Inactive; - this._lobby.Leave(); - this._reader.ClearUser(remote_peer); - this._writer.ClearUser(remote_peer); - } - - public override void Connect(RemoteAddress address) - { - } - - public override void CancelJoin() - { - if (this._lobby.State == LobbyState.Inactive) - return; - this._lobby.Leave(); - } - - private void RegisterRailEvent() - { - RAILEventID[] railEventIdArray = new RAILEventID[7] - { - (RAILEventID) 16001, - (RAILEventID) 16002, - (RAILEventID) 13503, - (RAILEventID) 13501, - (RAILEventID) 12003, - (RAILEventID) 12002, - (RAILEventID) 12010 - }; - foreach (int num in railEventIdArray) - { - // ISSUE: method pointer - this._callbackHelper.RegisterCallback((RAILEventID) num, new RailEventCallBackHandler((object) this, __methodptr(OnRailEvent))); - } - } - - private void UnRegisterRailEvent() => this._callbackHelper.UnregisterAllCallback(); - - public void OnRailEvent(RAILEventID id, EventBase data) - { - WeGameHelper.WriteDebugString("OnRailEvent,id=" + id.ToString() + " ,result=" + data.result.ToString()); - if (id <= 12010) - { - if (id != 12002) - { - if (id != 12003) - { - if (id != 12010) - return; - this.OnFriendlistChange((RailFriendsListChanged) data); - } - else - this.OnGetFriendMetaData((RailFriendsGetMetadataResult) data); - } - else - this.OnRailSetMetaData((RailFriendsSetMetadataResult) data); - } - else if (id <= 13503) - { - if (id != 13501) - { - if (id != 13503) - return; - this.OnRailRespondInvation((RailUsersRespondInvitation) data); - } - else - this.OnRailGetUsersInfo((RailUsersInfoData) data); - } - else if (id != 16001) - { - if (id != 16002) - return; - this.OnRailCreateSessionFailed((CreateSessionFailed) data); - } - else - this.OnRailCreateSessionRequest((CreateSessionRequest) data); - } - - private string DumpMataDataString(List list) - { - StringBuilder stringBuilder = new StringBuilder(); - foreach (RailKeyValueResult railKeyValueResult in list) - stringBuilder.Append("key: " + (string) railKeyValueResult.key + " value: " + (string) railKeyValueResult.value); - return stringBuilder.ToString(); - } - - private string GetValueByKey(string key, List list) - { - string str = (string) null; - foreach (RailKeyValueResult railKeyValueResult in list) - { - if ((string) railKeyValueResult.key == key) - { - str = (string) railKeyValueResult.value; - break; - } - } - return str; - } - - private bool SendFriendListToLocalServer() - { - bool flag = false; - if (this._hasLocalHost) - { - List list = new List(); - if (this.GetRailFriendList(list)) - { - WeGameFriendListInfo t = new WeGameFriendListInfo() - { - _friendList = list - }; - IPCMessage msg = new IPCMessage(); - msg.Build(IPCMessageType.IPCMessageTypeNotifyFriendList, t); - flag = this._msgServer.SendMessage(msg); - WeGameHelper.WriteDebugString("NotifyFriendListToServer: " + flag.ToString()); - } - } - return flag; - } - - private bool GetRailFriendList(List list) - { - bool flag = false; - IRailFriends irailFriends = rail_api.RailFactory().RailFriends(); - if (irailFriends != null) - flag = irailFriends.GetFriendsList(list) == 0; - return flag; - } - - private void OnGetFriendMetaData(RailFriendsGetMetadataResult data) - { - if (((EventBase) data).result != null || ((List) data.friend_kvs).Count <= 0) - return; - WeGameHelper.WriteDebugString("OnGetFriendMetaData - " + this.DumpMataDataString((List) data.friend_kvs)); - string valueByKey = this.GetValueByKey(this._serverIDMedataKey, (List) data.friend_kvs); - if (valueByKey == null) - return; - if (valueByKey.Length > 0) - { - RailID server_id = new RailID(); - ((RailComparableID) server_id).id_ = (__Null) (long) ulong.Parse(valueByKey); - if (((RailComparableID) server_id).IsValid()) - this.JoinServer(server_id); - else - WeGameHelper.WriteDebugString("JoinServer failed, invalid server id"); - } - else - WeGameHelper.WriteDebugString("can not find server id key"); - } - - private void JoinServer(RailID server_id) - { - WeGameHelper.WriteDebugString("JoinServer:{0}", (object) (ulong) ((RailComparableID) server_id).id_); - this._connectionStateMap[server_id] = NetSocialModule.ConnectionState.Authenticating; - int length = 3; - byte[] numArray = new byte[length]; - numArray[0] = (byte) (length & (int) byte.MaxValue); - numArray[1] = (byte) (length >> 8 & (int) byte.MaxValue); - numArray[2] = (byte) 93; - rail_api.RailFactory().RailNetworkHelper().SendReliableData(this.GetLocalPeer(), server_id, numArray, (uint) length); - } - - private string GetFriendNickname(RailID rail_id) - { - if (this._player_info_list != null) - { - foreach (PlayerPersonalInfo playerInfo in this._player_info_list) - { - if (RailComparableID.op_Equality((RailComparableID) playerInfo.rail_id, (RailComparableID) rail_id)) - return (string) playerInfo.rail_name; - } - } - return ""; - } - - private void OnRailGetUsersInfo(RailUsersInfoData data) => this._player_info_list = (List) data.user_info_list; - - private void OnFriendlistChange(RailFriendsListChanged data) - { - if (!this._hasLocalHost) - return; - this.SendFriendListToLocalServer(); - } - - private void AsyncGetFriendsInfo() - { - IRailFriends irailFriends = rail_api.RailFactory().RailFriends(); - if (irailFriends == null) - return; - List railFriendInfoList = new List(); - irailFriends.GetFriendsList(railFriendInfoList); - List railIdList = new List(); - foreach (RailFriendInfo railFriendInfo in railFriendInfoList) - railIdList.Add((RailID) railFriendInfo.friend_rail_id); - irailFriends.AsyncGetPersonalInfo(railIdList, ""); - } - - private void AsyncSetPlayWith(RailID rail_id) - { - List railUserPlayedWithList = new List(); - railUserPlayedWithList.Add(new RailUserPlayedWith() - { - rail_id = (__Null) rail_id - }); - rail_api.RailFactory().RailFriends()?.AsyncReportPlayedWithUserList(railUserPlayedWithList, ""); - } - - private void OnRailSetMetaData(RailFriendsSetMetadataResult data) => WeGameHelper.WriteDebugString("OnRailSetMetaData - " + ((EventBase) data).result.ToString()); - - private void OnRailRespondInvation(RailUsersRespondInvitation data) - { - WeGameHelper.WriteDebugString(" request join game"); - if (this._lobby.State != LobbyState.Inactive) - this._lobby.Leave(); - this._inviter_id = (RailID) data.inviter_id; - Main.OpenPlayerSelect((Main.OnPlayerSelected) (playerData => - { - Main.ServerSideCharacter = false; - playerData.SetAsActive(); - Main.menuMode = 882; - Main.statusText = Language.GetTextValue("Social.JoiningFriend", (object) this.GetFriendNickname((RailID) data.inviter_id)); - this.AsyncGetServerIDByOwener((RailID) data.inviter_id); - WeGameHelper.WriteDebugString("inviter_id: " + (object) (ulong) ((RailComparableID) data.inviter_id).id_); - })); - } - - private void AsyncGetServerIDByOwener(RailID ownerID) => rail_api.RailFactory().RailFriends()?.AsyncGetFriendMetadata(ownerID, new List() - { - this._serverIDMedataKey - }, ""); - - private void OnRailCreateSessionRequest(CreateSessionRequest result) - { - WeGameHelper.WriteDebugString(nameof (OnRailCreateSessionRequest)); - if (!this._connectionStateMap.ContainsKey((RailID) result.remote_peer) || this._connectionStateMap[(RailID) result.remote_peer] == NetSocialModule.ConnectionState.Inactive) - return; - WeGameHelper.WriteDebugString("AcceptSessionRequest, local{0}, remote:{1}", (object) (ulong) ((RailComparableID) result.local_peer).id_, (object) (ulong) ((RailComparableID) result.remote_peer).id_); - rail_api.RailFactory().RailNetworkHelper().AcceptSessionRequest((RailID) result.local_peer, (RailID) result.remote_peer); - } - - private void OnRailCreateSessionFailed(CreateSessionFailed result) - { - WeGameHelper.WriteDebugString("OnRailCreateSessionFailed, CloseRemote: local:{0}, remote:{1}", (object) (ulong) ((RailComparableID) result.local_peer).id_, (object) (ulong) ((RailComparableID) result.remote_peer).id_); - this.Close((RailID) result.remote_peer); - } - - private void CleanMyMetaData() => rail_api.RailFactory().RailFriends()?.AsyncClearAllMyMetadata(""); - - private void OnDisconnect() - { - this.CleanMyMetaData(); - this._hasLocalHost = false; - Netplay.OnDisconnect -= new Action(this.OnDisconnect); - } - } -} diff --git a/Social/WeGame/NetServerSocialModule.cs b/Social/WeGame/NetServerSocialModule.cs deleted file mode 100644 index 08eb8fe..0000000 --- a/Social/WeGame/NetServerSocialModule.cs +++ /dev/null @@ -1,358 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.WeGame.NetServerSocialModule -// 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 rail; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Text; -using Terraria.Localization; -using Terraria.Net; -using Terraria.Net.Sockets; - -namespace Terraria.Social.WeGame -{ - public class NetServerSocialModule : NetSocialModule - { - private SocketConnectionAccepted _connectionAcceptedCallback; - private bool _acceptingClients; - private ServerMode _mode; - private RailCallBackHelper _callbackHelper = new RailCallBackHelper(); - private MessageDispatcherClient _client = new MessageDispatcherClient(); - private bool _serverConnected; - private RailID _serverID = new RailID(); - private Action _ipcConnetedAction; - private List _wegameFriendList; - - public NetServerSocialModule() => this._lobby._lobbyCreatedExternalCallback = new Action(this.OnLobbyCreated); - - private void BroadcastConnectedUsers() - { - } - - private bool AcceptAnUserSession(RailID local_peer, RailID remote_peer) - { - bool flag = false; - // ISSUE: explicit non-virtual call - // ISSUE: explicit non-virtual call - WeGameHelper.WriteDebugString("AcceptAnUserSession server:" + __nonvirtual (((RailComparableID) local_peer).id_.ToString()) + " remote:" + __nonvirtual (((RailComparableID) remote_peer).id_.ToString())); - IRailNetwork irailNetwork = rail_api.RailFactory().RailNetworkHelper(); - if (irailNetwork != null) - flag = irailNetwork.AcceptSessionRequest(local_peer, remote_peer) == 0; - return flag; - } - - private void TerminateRemotePlayerSession(RailID remote_id) => rail_api.RailFactory().RailPlayer()?.TerminateSessionOfPlayer(remote_id); - - private bool CloseNetWorkSession(RailID remote_peer) - { - bool flag = false; - IRailNetwork irailNetwork = rail_api.RailFactory().RailNetworkHelper(); - if (irailNetwork != null) - flag = irailNetwork.CloseSession(this._serverID, remote_peer) == 0; - return flag; - } - - private RailID GetServerID() - { - RailID railId = (RailID) null; - IRailGameServer server = this._lobby.GetServer(); - if (server != null) - railId = server.GetGameServerRailID(); - return railId ?? new RailID(); - } - - private void CloseAndUpdateUserState(RailID remote_peer) - { - if (!this._connectionStateMap.ContainsKey(remote_peer)) - return; - WeGameHelper.WriteDebugString("CloseAndUpdateUserState, remote:{0}", (object) (ulong) ((RailComparableID) remote_peer).id_); - this.TerminateRemotePlayerSession(remote_peer); - this.CloseNetWorkSession(remote_peer); - this._connectionStateMap[remote_peer] = NetSocialModule.ConnectionState.Inactive; - this._reader.ClearUser(remote_peer); - this._writer.ClearUser(remote_peer); - } - - public void OnConnected() - { - this._serverConnected = true; - if (this._ipcConnetedAction != null) - this._ipcConnetedAction(); - this._ipcConnetedAction = (Action) null; - WeGameHelper.WriteDebugString("IPC connected"); - } - - private void OnCreateSessionRequest(CreateSessionRequest data) - { - if (!this._acceptingClients) - WeGameHelper.WriteDebugString(" - Ignoring connection from " + (object) (ulong) ((RailComparableID) data.remote_peer).id_ + " while _acceptionClients is false."); - else if (!this._mode.HasFlag((Enum) ServerMode.FriendsOfFriends) && !this.IsWeGameFriend((RailID) data.remote_peer)) - { - WeGameHelper.WriteDebugString("Ignoring connection from " + (object) (ulong) ((RailComparableID) data.remote_peer).id_ + ". Friends of friends is disabled."); - } - else - { - WeGameHelper.WriteDebugString("pass wegame friend check"); - this.AcceptAnUserSession((RailID) data.local_peer, (RailID) data.remote_peer); - this._connectionStateMap[(RailID) data.remote_peer] = NetSocialModule.ConnectionState.Authenticating; - if (this._connectionAcceptedCallback == null) - return; - this._connectionAcceptedCallback((ISocket) new SocialSocket((RemoteAddress) new WeGameAddress((RailID) data.remote_peer, ""))); - } - } - - private void OnCreateSessionFailed(CreateSessionFailed data) - { - WeGameHelper.WriteDebugString("CreateSessionFailed, local:{0}, remote:{1}", (object) (ulong) ((RailComparableID) data.local_peer).id_, (object) (ulong) ((RailComparableID) data.remote_peer).id_); - this.CloseAndUpdateUserState((RailID) data.remote_peer); - } - - private bool GetRailFriendList(List list) - { - bool flag = false; - IRailFriends irailFriends = rail_api.RailFactory().RailFriends(); - if (irailFriends != null) - flag = irailFriends.GetFriendsList(list) == 0; - return flag; - } - - private void OnWegameMessage(IPCMessage message) - { - if (message.GetCmd() != IPCMessageType.IPCMessageTypeNotifyFriendList) - return; - WeGameFriendListInfo friendListInfo; - message.Parse(out friendListInfo); - this.UpdateFriendList(friendListInfo); - } - - private void UpdateFriendList(WeGameFriendListInfo friendListInfo) - { - this._wegameFriendList = friendListInfo._friendList; - WeGameHelper.WriteDebugString("On update friend list - " + this.DumpFriendListString(friendListInfo._friendList)); - } - - private bool IsWeGameFriend(RailID id) - { - bool flag = false; - if (this._wegameFriendList != null) - { - foreach (RailFriendInfo wegameFriend in this._wegameFriendList) - { - if (RailComparableID.op_Equality((RailComparableID) wegameFriend.friend_rail_id, (RailComparableID) id)) - { - flag = true; - break; - } - } - } - return flag; - } - - private string DumpFriendListString(List list) - { - StringBuilder stringBuilder = new StringBuilder(); - foreach (RailFriendInfo railFriendInfo in list) - stringBuilder.AppendLine(string.Format("friend_id: {0}, type: {1}, online: {2}, playing: {3}", (object) (ulong) ((RailComparableID) railFriendInfo.friend_rail_id).id_, (object) (EnumRailFriendType) railFriendInfo.friend_type, (object) ((RailFriendOnLineState) railFriendInfo.online_state).friend_online_state.ToString(), (object) (uint) ((RailFriendOnLineState) railFriendInfo.online_state).game_define_game_playing_state)); - return stringBuilder.ToString(); - } - - private bool IsActiveUser(RailID user) => this._connectionStateMap.ContainsKey(user) && (uint) this._connectionStateMap[user] > 0U; - - private void UpdateUserStateBySessionAuthResult(GameServerStartSessionWithPlayerResponse data) - { - RailID remoteRailId = (RailID) data.remote_rail_id; - RailResult result = (RailResult) ((EventBase) data).result; - if (!this._connectionStateMap.ContainsKey(remoteRailId)) - return; - if (result == null) - { - WeGameHelper.WriteDebugString("UpdateUserStateBySessionAuthResult Auth Success"); - this.BroadcastConnectedUsers(); - } - else - { - WeGameHelper.WriteDebugString("UpdateUserStateBySessionAuthResult Auth Failed"); - this.CloseAndUpdateUserState(remoteRailId); - } - } - - private bool TryAuthUserByRecvData(RailID user, byte[] data, int length) - { - WeGameHelper.WriteDebugString("TryAuthUserByRecvData user:{0}", (object) (ulong) ((RailComparableID) user).id_); - if (length < 3) - { - WeGameHelper.WriteDebugString("Failed to validate authentication packet: Too short. (Length: " + (object) length + ")"); - return false; - } - int num = (int) data[1] << 8 | (int) data[0]; - if (num != length) - { - WeGameHelper.WriteDebugString("Failed to validate authentication packet: Packet size mismatch. (" + (object) num + "!=" + (object) length + ")"); - return false; - } - if (data[2] == (byte) 93) - return true; - WeGameHelper.WriteDebugString("Failed to validate authentication packet: Packet type is not correct. (Type: " + (object) data[2] + ")"); - return false; - } - - private bool OnPacketRead(byte[] data, int size, RailID user) - { - if (!this.IsActiveUser(user)) - { - WeGameHelper.WriteDebugString("OnPacketRead IsActiveUser false"); - return false; - } - NetSocialModule.ConnectionState connectionState = this._connectionStateMap[user]; - if (connectionState != NetSocialModule.ConnectionState.Authenticating) - return connectionState == NetSocialModule.ConnectionState.Connected; - if (!this.TryAuthUserByRecvData(user, data, size)) - this.CloseAndUpdateUserState(user); - else - this.OnAuthSuccess(user); - return false; - } - - private void OnAuthSuccess(RailID remote_peer) - { - if (!this._connectionStateMap.ContainsKey(remote_peer)) - return; - this._connectionStateMap[remote_peer] = NetSocialModule.ConnectionState.Connected; - int length = 3; - byte[] numArray = new byte[length]; - numArray[0] = (byte) (length & (int) byte.MaxValue); - numArray[1] = (byte) (length >> 8 & (int) byte.MaxValue); - numArray[2] = (byte) 93; - rail_api.RailFactory().RailNetworkHelper().SendReliableData(this._serverID, remote_peer, numArray, (uint) length); - } - - public void OnRailEvent(RAILEventID event_id, EventBase data) - { - WeGameHelper.WriteDebugString("OnRailEvent,id=" + event_id.ToString() + " ,result=" + data.result.ToString()); - if (event_id != 3006) - { - if (event_id != 16001) - { - if (event_id != 16002) - return; - this.OnCreateSessionFailed((CreateSessionFailed) data); - } - else - this.OnCreateSessionRequest((CreateSessionRequest) data); - } - else - this.UpdateUserStateBySessionAuthResult((GameServerStartSessionWithPlayerResponse) data); - } - - private void OnLobbyCreated(RailID lobbyID) - { - WeGameHelper.WriteDebugString("SetLocalPeer: {0}", (object) (ulong) ((RailComparableID) lobbyID).id_); - this._reader.SetLocalPeer(lobbyID); - this._writer.SetLocalPeer(lobbyID); - this._serverID = lobbyID; - Action action = (Action) (() => - { - // ISSUE: explicit non-virtual call - ReportServerID t = new ReportServerID() - { - _serverID = __nonvirtual (((RailComparableID) lobbyID).id_.ToString()) - }; - IPCMessage msg = new IPCMessage(); - msg.Build(IPCMessageType.IPCMessageTypeReportServerID, t); - WeGameHelper.WriteDebugString("Send serverID to game client - " + this._client.SendMessage(msg).ToString()); - }); - if (this._serverConnected) - { - action(); - } - else - { - this._ipcConnetedAction += action; - WeGameHelper.WriteDebugString("report server id fail, no connection"); - } - } - - private void RegisterRailEvent() - { - RAILEventID[] railEventIdArray = new RAILEventID[4] - { - (RAILEventID) 16001, - (RAILEventID) 16002, - (RAILEventID) 3006, - (RAILEventID) 3005 - }; - foreach (int num in railEventIdArray) - { - // ISSUE: method pointer - this._callbackHelper.RegisterCallback((RAILEventID) num, new RailEventCallBackHandler((object) this, __methodptr(OnRailEvent))); - } - } - - public override void Initialize() - { - base.Initialize(); - this._mode |= ServerMode.Lobby; - this.RegisterRailEvent(); - this._reader.SetReadEvent(new WeGameP2PReader.OnReadEvent(this.OnPacketRead)); - if (Program.LaunchParameters.ContainsKey("-lobby")) - { - this._mode |= ServerMode.Lobby; - string launchParameter = Program.LaunchParameters["-lobby"]; - if (!(launchParameter == "private")) - { - if (launchParameter == "friends") - { - this._mode |= ServerMode.FriendsCanJoin; - this._lobby.Create(false); - } - else - Console.WriteLine(Language.GetTextValue("Error.InvalidLobbyFlag", (object) "private", (object) "friends")); - } - else - this._lobby.Create(true); - } - if (Program.LaunchParameters.ContainsKey("-friendsoffriends")) - this._mode |= ServerMode.FriendsOfFriends; - this._client.Init("WeGame.Terraria.Message.Client", "WeGame.Terraria.Message.Server"); - this._client.OnConnected += new Action(this.OnConnected); - this._client.OnMessage += new Action(this.OnWegameMessage); - CoreSocialModule.OnTick += new Action(this._client.Tick); - this._client.Start(); - } - - public override ulong GetLobbyId() => (ulong) ((RailComparableID) this._serverID).id_; - - public override void OpenInviteInterface() - { - } - - public override void CancelJoin() - { - } - - public override bool CanInvite() => false; - - public override void LaunchLocalServer(Process process, ServerMode mode) - { - } - - public override bool StartListening(SocketConnectionAccepted callback) - { - this._acceptingClients = true; - this._connectionAcceptedCallback = callback; - return false; - } - - public override void StopListening() => this._acceptingClients = false; - - public override void Connect(RemoteAddress address) - { - } - - public override void Close(RemoteAddress address) => this.CloseAndUpdateUserState(this.RemoteAddressToRailId(address)); - } -} diff --git a/Social/WeGame/NetSocialModule.cs b/Social/WeGame/NetSocialModule.cs deleted file mode 100644 index b23c10e..0000000 --- a/Social/WeGame/NetSocialModule.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.WeGame.NetSocialModule -// 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 rail; -using System; -using System.Collections.Concurrent; -using Terraria.Net; - -namespace Terraria.Social.WeGame -{ - public abstract class NetSocialModule : Terraria.Social.Base.NetSocialModule - { - protected const int LobbyMessageJoin = 1; - protected Lobby _lobby = new Lobby(); - protected WeGameP2PReader _reader; - protected WeGameP2PWriter _writer; - protected ConcurrentDictionary _connectionStateMap = new ConcurrentDictionary(); - protected static readonly byte[] _handshake = new byte[10] - { - (byte) 10, - (byte) 0, - (byte) 93, - (byte) 114, - (byte) 101, - (byte) 108, - (byte) 111, - (byte) 103, - (byte) 105, - (byte) 99 - }; - - protected NetSocialModule() - { - this._reader = new WeGameP2PReader(); - this._writer = new WeGameP2PWriter(); - } - - public override void Initialize() - { - CoreSocialModule.OnTick += new Action(this._reader.ReadTick); - CoreSocialModule.OnTick += new Action(this._writer.SendAll); - } - - public override void Shutdown() => this._lobby.Leave(); - - public override bool IsConnected(RemoteAddress address) - { - if (address == null) - return false; - RailID railId = this.RemoteAddressToRailId(address); - return this._connectionStateMap.ContainsKey(railId) && this._connectionStateMap[railId] == NetSocialModule.ConnectionState.Connected; - } - - protected RailID GetLocalPeer() => rail_api.RailFactory().RailPlayer().GetRailID(); - - protected bool GetSessionState(RailID userId, RailNetworkSessionState state) - { - if (rail_api.RailFactory().RailNetworkHelper().GetSessionState(userId, state) == null) - return true; - WeGameHelper.WriteDebugString("GetSessionState Failed user:{0}", (object) (ulong) ((RailComparableID) userId).id_); - return false; - } - - protected RailID RemoteAddressToRailId(RemoteAddress address) => ((WeGameAddress) address).rail_id; - - public override bool Send(RemoteAddress address, byte[] data, int length) - { - this._writer.QueueSend(this.RemoteAddressToRailId(address), data, length); - return true; - } - - public override int Receive(RemoteAddress address, byte[] data, int offset, int length) => address == null ? 0 : this._reader.Receive(this.RemoteAddressToRailId(address), data, offset, length); - - public override bool IsDataAvailable(RemoteAddress address) => this._reader.IsDataAvailable(this.RemoteAddressToRailId(address)); - - public enum ConnectionState - { - Inactive, - Authenticating, - Connected, - } - } -} diff --git a/Social/WeGame/OverlaySocialModule.cs b/Social/WeGame/OverlaySocialModule.cs deleted file mode 100644 index a1e1265..0000000 --- a/Social/WeGame/OverlaySocialModule.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.WeGame.OverlaySocialModule -// 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.Social.WeGame -{ - public class OverlaySocialModule : Terraria.Social.Base.OverlaySocialModule - { - private bool _gamepadTextInputActive; - - public override void Initialize() - { - } - - public override void Shutdown() - { - } - - public override bool IsGamepadTextInputActive() => this._gamepadTextInputActive; - - public override bool ShowGamepadTextInput( - string description, - uint maxLength, - bool multiLine = false, - string existingText = "", - bool password = false) - { - return false; - } - - public override string GetGamepadText() => ""; - } -} diff --git a/Social/WeGame/ReportServerID.cs b/Social/WeGame/ReportServerID.cs deleted file mode 100644 index 58fc40b..0000000 --- a/Social/WeGame/ReportServerID.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.WeGame.ReportServerID -// 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.Runtime.Serialization; - -namespace Terraria.Social.WeGame -{ - [DataContract] - public class ReportServerID - { - [DataMember] - public string _serverID; - } -} diff --git a/Social/WeGame/WeGameFriendListInfo.cs b/Social/WeGame/WeGameFriendListInfo.cs deleted file mode 100644 index 003978c..0000000 --- a/Social/WeGame/WeGameFriendListInfo.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.WeGame.WeGameFriendListInfo -// 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 rail; -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace Terraria.Social.WeGame -{ - [DataContract] - public class WeGameFriendListInfo - { - [DataMember] - public List _friendList; - } -} diff --git a/Social/WeGame/WeGameHelper.cs b/Social/WeGame/WeGameHelper.cs deleted file mode 100644 index 1784cec..0000000 --- a/Social/WeGame/WeGameHelper.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.WeGame.WeGameHelper -// 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.IO; -using System.Runtime.InteropServices; -using System.Runtime.Serialization.Json; -using System.Text; - -namespace Terraria.Social.WeGame -{ - public class WeGameHelper - { - [DllImport("kernel32.dll", CharSet = CharSet.Auto)] - private static extern void OutputDebugString(string message); - - public static void WriteDebugString(string format, params object[] args) - { - string str = "[WeGame] - " + format; - } - - public static string Serialize(T data) - { - using (MemoryStream memoryStream = new MemoryStream()) - { - new DataContractJsonSerializer(typeof (T)).WriteObject((Stream) memoryStream, (object) data); - memoryStream.Position = 0L; - using (StreamReader streamReader = new StreamReader((Stream) memoryStream, Encoding.UTF8)) - return streamReader.ReadToEnd(); - } - } - - public static void UnSerialize(string str, out T data) - { - using (MemoryStream memoryStream = new MemoryStream(Encoding.Unicode.GetBytes(str))) - { - DataContractJsonSerializer contractJsonSerializer = new DataContractJsonSerializer(typeof (T)); - data = (T) contractJsonSerializer.ReadObject((Stream) memoryStream); - } - } - } -} diff --git a/Social/WeGame/WeGameP2PReader.cs b/Social/WeGame/WeGameP2PReader.cs deleted file mode 100644 index e8a562d..0000000 --- a/Social/WeGame/WeGameP2PReader.cs +++ /dev/null @@ -1,138 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.WeGame.WeGameP2PReader -// 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 rail; -using System; -using System.Collections.Generic; - -namespace Terraria.Social.WeGame -{ - public class WeGameP2PReader - { - public object RailLock = new object(); - private const int BUFFER_SIZE = 4096; - private Dictionary> _pendingReadBuffers = new Dictionary>(); - private Queue _deletionQueue = new Queue(); - private Queue _bufferPool = new Queue(); - private WeGameP2PReader.OnReadEvent _readEvent; - private RailID _local_id; - - public void ClearUser(RailID id) - { - lock (this._pendingReadBuffers) - this._deletionQueue.Enqueue(id); - } - - public bool IsDataAvailable(RailID id) - { - lock (this._pendingReadBuffers) - { - if (!this._pendingReadBuffers.ContainsKey(id)) - return false; - Queue pendingReadBuffer = this._pendingReadBuffers[id]; - return pendingReadBuffer.Count != 0 && pendingReadBuffer.Peek().Size != 0U; - } - } - - public void SetReadEvent(WeGameP2PReader.OnReadEvent method) => this._readEvent = method; - - private bool IsPacketAvailable(out uint size) - { - lock (this.RailLock) - { - IRailNetwork irailNetwork = rail_api.RailFactory().RailNetworkHelper(); - RailID railId1 = new RailID(); - ((RailComparableID) railId1).id_ = ((RailComparableID) this.GetLocalPeer()).id_; - RailID railId2 = railId1; - ref uint local = ref size; - return irailNetwork.IsDataReady(railId2, ref local); - } - } - - private RailID GetLocalPeer() => this._local_id; - - public void SetLocalPeer(RailID rail_id) - { - if (RailComparableID.op_Equality((RailComparableID) this._local_id, (RailComparableID) null)) - this._local_id = new RailID(); - ((RailComparableID) this._local_id).id_ = ((RailComparableID) rail_id).id_; - } - - private bool IsValid() => RailComparableID.op_Inequality((RailComparableID) this._local_id, (RailComparableID) null) && ((RailComparableID) this._local_id).IsValid(); - - public void ReadTick() - { - if (!this.IsValid()) - return; - lock (this._pendingReadBuffers) - { - while (this._deletionQueue.Count > 0) - this._pendingReadBuffers.Remove(this._deletionQueue.Dequeue()); - uint size; - while (this.IsPacketAvailable(out size)) - { - byte[] data = this._bufferPool.Count != 0 ? this._bufferPool.Dequeue() : new byte[(int) Math.Max(size, 4096U)]; - RailID railId = new RailID(); - bool flag; - lock (this.RailLock) - flag = rail_api.RailFactory().RailNetworkHelper().ReadData(this.GetLocalPeer(), railId, data, size) == 0; - if (flag) - { - if (this._readEvent == null || this._readEvent(data, (int) size, railId)) - { - if (!this._pendingReadBuffers.ContainsKey(railId)) - this._pendingReadBuffers[railId] = new Queue(); - this._pendingReadBuffers[railId].Enqueue(new WeGameP2PReader.ReadResult(data, size)); - } - else - this._bufferPool.Enqueue(data); - } - } - } - } - - public int Receive(RailID user, byte[] buffer, int bufferOffset, int bufferSize) - { - uint num1 = 0; - lock (this._pendingReadBuffers) - { - if (!this._pendingReadBuffers.ContainsKey(user)) - return 0; - Queue pendingReadBuffer = this._pendingReadBuffers[user]; - while (pendingReadBuffer.Count > 0) - { - WeGameP2PReader.ReadResult readResult = pendingReadBuffer.Peek(); - uint num2 = Math.Min((uint) bufferSize - num1, readResult.Size - readResult.Offset); - if (num2 == 0U) - return (int) num1; - Array.Copy((Array) readResult.Data, (long) readResult.Offset, (Array) buffer, (long) bufferOffset + (long) num1, (long) num2); - if ((int) num2 == (int) readResult.Size - (int) readResult.Offset) - this._bufferPool.Enqueue(pendingReadBuffer.Dequeue().Data); - else - readResult.Offset += num2; - num1 += num2; - } - } - return (int) num1; - } - - public class ReadResult - { - public byte[] Data; - public uint Size; - public uint Offset; - - public ReadResult(byte[] data, uint size) - { - this.Data = data; - this.Size = size; - this.Offset = 0U; - } - } - - public delegate bool OnReadEvent(byte[] data, int size, RailID user); - } -} diff --git a/Social/WeGame/WeGameP2PWriter.cs b/Social/WeGame/WeGameP2PWriter.cs deleted file mode 100644 index 0e35082..0000000 --- a/Social/WeGame/WeGameP2PWriter.cs +++ /dev/null @@ -1,117 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Social.WeGame.WeGameP2PWriter -// 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 rail; -using System; -using System.Collections.Generic; - -namespace Terraria.Social.WeGame -{ - public class WeGameP2PWriter - { - private const int BUFFER_SIZE = 1024; - private RailID _local_id; - private Dictionary> _pendingSendData = new Dictionary>(); - private Dictionary> _pendingSendDataSwap = new Dictionary>(); - private Queue _bufferPool = new Queue(); - private object _lock = new object(); - - public void QueueSend(RailID user, byte[] data, int length) - { - lock (this._lock) - { - Queue writeInformationQueue; - if (this._pendingSendData.ContainsKey(user)) - writeInformationQueue = this._pendingSendData[user]; - else - this._pendingSendData[user] = writeInformationQueue = new Queue(); - int val1 = length; - int sourceIndex = 0; - while (val1 > 0) - { - WeGameP2PWriter.WriteInformation writeInformation; - if (writeInformationQueue.Count == 0 || 1024 - writeInformationQueue.Peek().Size == 0) - { - writeInformation = this._bufferPool.Count <= 0 ? new WeGameP2PWriter.WriteInformation() : new WeGameP2PWriter.WriteInformation(this._bufferPool.Dequeue()); - writeInformationQueue.Enqueue(writeInformation); - } - else - writeInformation = writeInformationQueue.Peek(); - int length1 = Math.Min(val1, 1024 - writeInformation.Size); - Array.Copy((Array) data, sourceIndex, (Array) writeInformation.Data, writeInformation.Size, length1); - writeInformation.Size += length1; - val1 -= length1; - sourceIndex += length1; - } - } - } - - public void ClearUser(RailID user) - { - lock (this._lock) - { - if (this._pendingSendData.ContainsKey(user)) - { - Queue writeInformationQueue = this._pendingSendData[user]; - while (writeInformationQueue.Count > 0) - this._bufferPool.Enqueue(writeInformationQueue.Dequeue().Data); - } - if (!this._pendingSendDataSwap.ContainsKey(user)) - return; - Queue writeInformationQueue1 = this._pendingSendDataSwap[user]; - while (writeInformationQueue1.Count > 0) - this._bufferPool.Enqueue(writeInformationQueue1.Dequeue().Data); - } - } - - public void SetLocalPeer(RailID rail_id) - { - if (RailComparableID.op_Equality((RailComparableID) this._local_id, (RailComparableID) null)) - this._local_id = new RailID(); - ((RailComparableID) this._local_id).id_ = ((RailComparableID) rail_id).id_; - } - - private RailID GetLocalPeer() => this._local_id; - - private bool IsValid() => RailComparableID.op_Inequality((RailComparableID) this._local_id, (RailComparableID) null) && ((RailComparableID) this._local_id).IsValid(); - - public void SendAll() - { - if (!this.IsValid()) - return; - lock (this._lock) - Utils.Swap>>(ref this._pendingSendData, ref this._pendingSendDataSwap); - foreach (KeyValuePair> keyValuePair in this._pendingSendDataSwap) - { - Queue writeInformationQueue = keyValuePair.Value; - while (writeInformationQueue.Count > 0) - { - WeGameP2PWriter.WriteInformation writeInformation = writeInformationQueue.Dequeue(); - int num = rail_api.RailFactory().RailNetworkHelper().SendData(this.GetLocalPeer(), keyValuePair.Key, writeInformation.Data, (uint) writeInformation.Size) == 0 ? 1 : 0; - this._bufferPool.Enqueue(writeInformation.Data); - } - } - } - - public class WriteInformation - { - public byte[] Data; - public int Size; - - public WriteInformation() - { - this.Data = new byte[1024]; - this.Size = 0; - } - - public WriteInformation(byte[] data) - { - this.Data = data; - this.Size = 0; - } - } - } -} diff --git a/Star.cs b/Star.cs index fbac371..a8d0e35 100644 --- a/Star.cs +++ b/Star.cs @@ -1,12 +1,10 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Star -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; -using System; -using Terraria.Utilities; namespace Terraria { @@ -19,188 +17,50 @@ namespace Terraria public float twinkle; public float twinkleSpeed; public float rotationSpeed; - public bool falling; - public bool hidden; - public Vector2 fallSpeed; - public int fallTime; - public static bool dayCheck = false; - public static float starfallBoost = 1f; - public static int starFallCount = 0; - public float fadeIn; - public static void NightSetup() + public static void SpawnStars() { - Star.starfallBoost = 1f; - if (Main.rand.Next(10) == 0) - Star.starfallBoost = (float) Main.rand.Next(300, 501) * 0.01f; - else if (Main.rand.Next(3) == 0) - Star.starfallBoost = (float) Main.rand.Next(100, 151) * 0.01f; - Star.starFallCount = 0; - } - - public static void StarFall(float positionX) - { - ++Star.starFallCount; - int index1 = -1; - float num1 = -1f; - float num2 = (float) ((double) positionX / (double) Main.rightWorld * 1920.0); - for (int index2 = 0; index2 < Main.numStars; ++index2) + Main.numStars = Main.rand.Next(65, 130); + Main.numStars = 130; + for (int index = 0; index < Main.numStars; ++index) { - if (!Main.star[index2].hidden && !Main.star[index2].falling) - { - float num3 = Math.Abs(Main.star[index2].position.X - num2); - if ((double) num1 == -1.0 || (double) num3 < (double) num1) - { - index1 = index2; - num1 = num3; - } - } - } - if (index1 < 0) - return; - Main.star[index1].Fall(); - } - - public static void SpawnStars(int s = -1) - { - FastRandom withRandomSeed = FastRandom.CreateWithRandomSeed(); - int num1 = withRandomSeed.Next(200, 400); - int num2 = 0; - int num3 = num1; - if (s >= 0) - { - num2 = s; - num3 = s + 1; - } - for (int index1 = num2; index1 < num3; ++index1) - { - Main.star[index1] = new Star(); - if (s >= 0) - { - Main.star[index1].fadeIn = 1f; - int num4 = 10; - int num5 = -2000; - for (int index2 = 0; index2 < num4; ++index2) - { - float num6 = (float) withRandomSeed.Next(1921); - int num7 = 2000; - for (int index3 = 0; index3 < Main.numStars; ++index3) - { - if (index3 != s && !Main.star[index3].hidden && !Main.star[index3].falling) - { - int num8 = (int) Math.Abs(num6 - Main.star[index3].position.X); - if (num8 < num7) - num7 = num8; - } - } - if (s == 0 || num7 > num5) - { - num5 = num7; - Main.star[index1].position.X = num6; - } - } - } - else - Main.star[index1].position.X = (float) withRandomSeed.Next(1921); - Main.star[index1].position.Y = (float) withRandomSeed.Next(1201); - Main.star[index1].rotation = (float) withRandomSeed.Next(628) * 0.01f; - Main.star[index1].scale = (float) withRandomSeed.Next(70, 130) * (3f / 500f); - Main.star[index1].type = withRandomSeed.Next(0, 4); - Main.star[index1].twinkle = (float) withRandomSeed.Next(60, 101) * 0.01f; - Main.star[index1].twinkleSpeed = (float) withRandomSeed.Next(30, 110) * 0.0001f; - if (withRandomSeed.Next(2) == 0) - Main.star[index1].twinkleSpeed *= -1f; - Main.star[index1].rotationSpeed = (float) withRandomSeed.Next(5, 50) * 0.0001f; - if (withRandomSeed.Next(2) == 0) - Main.star[index1].rotationSpeed *= -1f; - if (withRandomSeed.Next(40) == 0) - { - Main.star[index1].scale *= 2f; - Main.star[index1].twinkleSpeed /= 2f; - Main.star[index1].rotationSpeed /= 2f; - } - } - if (s != -1) - return; - Main.numStars = num1; - } - - public void Fall() - { - this.fallTime = 0; - this.falling = true; - this.fallSpeed.Y = (float) Main.rand.Next(700, 1001) * 0.01f; - this.fallSpeed.X = (float) Main.rand.Next(-400, 401) * 0.01f; - } - - public void Update() - { - if (this.falling && !this.hidden) - { - this.fallTime += Main.dayRate; - this.position += this.fallSpeed * (float) (Main.dayRate + 99) / 100f; - if ((double) this.position.Y > 1500.0) - this.hidden = true; - this.twinkle += this.twinkleSpeed * 3f; - if ((double) this.twinkle > 1.0) - { - this.twinkle = 1f; - this.twinkleSpeed *= -1f; - } - else if ((double) this.twinkle < 0.6) - { - this.twinkle = 0.6f; - this.twinkleSpeed *= -1f; - } - this.rotation += 0.5f; - if ((double) this.rotation > 6.28) - this.rotation -= 6.28f; - if ((double) this.rotation >= 0.0) - return; - this.rotation += 6.28f; - } - else - { - if ((double) this.fadeIn > 0.0) - { - this.fadeIn -= 6.172839E-05f * (float) Main.dayRate; - if ((double) this.fadeIn < 0.0) - this.fadeIn = 0.0f; - } - this.twinkle += this.twinkleSpeed; - if ((double) this.twinkle > 1.0) - { - this.twinkle = 1f; - this.twinkleSpeed *= -1f; - } - else if ((double) this.twinkle < 0.6) - { - this.twinkle = 0.6f; - this.twinkleSpeed *= -1f; - } - this.rotation += this.rotationSpeed; - if ((double) this.rotation > 6.28) - this.rotation -= 6.28f; - if ((double) this.rotation >= 0.0) - return; - this.rotation += 6.28f; + Main.star[index] = new Star(); + Main.star[index].position.X = (float) Main.rand.Next(-12, Main.screenWidth + 1); + Main.star[index].position.Y = (float) Main.rand.Next(-12, Main.screenHeight); + Main.star[index].rotation = (float) Main.rand.Next(628) * 0.01f; + Main.star[index].scale = (float) Main.rand.Next(50, 120) * 0.01f; + Main.star[index].type = Main.rand.Next(0, 5); + Main.star[index].twinkle = (float) Main.rand.Next(101) * 0.01f; + Main.star[index].twinkleSpeed = (float) Main.rand.Next(40, 100) * 0.0001f; + if (Main.rand.Next(2) == 0) + Main.star[index].twinkleSpeed *= -1f; + Main.star[index].rotationSpeed = (float) Main.rand.Next(10, 40) * 0.0001f; + if (Main.rand.Next(2) == 0) + Main.star[index].rotationSpeed *= -1f; } } public static void UpdateStars() { - if (!Main.dayTime) - Star.dayCheck = false; - else if (!Star.dayCheck && Main.time >= 27000.0) - { - for (int s = 0; s < Main.numStars; ++s) - { - if (Main.star[s].hidden) - Star.SpawnStars(s); - } - } for (int index = 0; index < Main.numStars; ++index) - Main.star[index].Update(); + { + Main.star[index].twinkle += Main.star[index].twinkleSpeed; + if ((double) Main.star[index].twinkle > 1.0) + { + Main.star[index].twinkle = 1f; + Main.star[index].twinkleSpeed *= -1f; + } + else if ((double) Main.star[index].twinkle < 0.5) + { + Main.star[index].twinkle = 0.5f; + Main.star[index].twinkleSpeed *= -1f; + } + Main.star[index].rotation += Main.star[index].rotationSpeed; + if ((double) Main.star[index].rotation > 6.28) + Main.star[index].rotation -= 6.28f; + if ((double) Main.star[index].rotation < 0.0) + Main.star[index].rotation += 6.28f; + } } } } diff --git a/StrayMethods.cs b/StrayMethods.cs index 4c66ad1..6c39724 100644 --- a/StrayMethods.cs +++ b/StrayMethods.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.StrayMethods -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/Terraria.csproj b/Terraria.csproj index 52c66aa..1bc7419 100644 --- a/Terraria.csproj +++ b/Terraria.csproj @@ -4,12 +4,12 @@ Debug AnyCPU - {7D3CE319-F33B-432A-BB01-21F097B10C55} + {2FFF7069-8A42-4F3C-9377-F5A328E80234} WinExe Terraria v4.0 Client - 1.4.0.5 + 1.3.5.3 512 Terraria @@ -42,24 +42,18 @@ - - - - - - - + @@ -79,7 +73,9 @@ + + @@ -87,13 +83,9 @@ - - - - @@ -108,7 +100,6 @@ - @@ -123,89 +114,72 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -221,41 +195,42 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -263,84 +238,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -366,19 +267,9 @@ - - - - - - - - - - - + @@ -409,30 +300,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - @@ -442,54 +309,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -505,327 +326,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -838,79 +344,57 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -921,17 +405,21 @@ - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -942,24 +430,6 @@ - - - - - - - - - - - - - - - - - - @@ -968,23 +438,10 @@ - - - - - - - - - - - - - @@ -996,28 +453,20 @@ - - - - - - - - @@ -1031,14 +480,8 @@ - - - - - - diff --git a/Terraria.pdb b/Terraria.pdb index 16f08ec..cc88b1a 100644 Binary files a/Terraria.pdb and b/Terraria.pdb differ diff --git a/Terraria.sln b/Terraria.sln index 5a331d7..15676bf 100644 --- a/Terraria.sln +++ b/Terraria.sln @@ -1,7 +1,7 @@ Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Terraria", "Terraria.csproj", "{7D3CE319-F33B-432A-BB01-21F097B10C55}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Terraria", "Terraria.csproj", "{2FFF7069-8A42-4F3C-9377-F5A328E80234}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -9,10 +9,10 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7D3CE319-F33B-432A-BB01-21F097B10C55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7D3CE319-F33B-432A-BB01-21F097B10C55}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7D3CE319-F33B-432A-BB01-21F097B10C55}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7D3CE319-F33B-432A-BB01-21F097B10C55}.Release|Any CPU.Build.0 = Release|Any CPU + {2FFF7069-8A42-4F3C-9377-F5A328E80234}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2FFF7069-8A42-4F3C-9377-F5A328E80234}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2FFF7069-8A42-4F3C-9377-F5A328E80234}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2FFF7069-8A42-4F3C-9377-F5A328E80234}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/TestHighFPSIssues.cs b/TestHighFPSIssues.cs index 344d7d3..957be2c 100644 --- a/TestHighFPSIssues.cs +++ b/TestHighFPSIssues.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.TestHighFPSIssues -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -15,11 +15,11 @@ namespace Terraria private static List _tapUpdates = new List(); private static List _tapUpdateEnds = new List(); private static List _tapDraws = new List(); - private static int conU; - private static int conUH; - private static int conD; - private static int conDH; - private static int race; + private static int conU = 0; + private static int conUH = 0; + private static int conD = 0; + private static int conDH = 0; + private static int race = 0; public static void TapUpdate(GameTime gt) { diff --git a/Testing/ChatCommands/ArgumentHelper.cs b/Testing/ChatCommands/ArgumentHelper.cs deleted file mode 100644 index 6f7fc49..0000000 --- a/Testing/ChatCommands/ArgumentHelper.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Testing.ChatCommands.ArgumentHelper -// 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; - -namespace Terraria.Testing.ChatCommands -{ - public static class ArgumentHelper - { - public static ArgumentListResult ParseList(string arguments) => new ArgumentListResult(((IEnumerable) arguments.Split(' ')).Select((Func) (arg => arg.Trim())).Where((Func) (arg => (uint) arg.Length > 0U))); - } -} diff --git a/Testing/ChatCommands/ArgumentListResult.cs b/Testing/ChatCommands/ArgumentListResult.cs deleted file mode 100644 index a467982..0000000 --- a/Testing/ChatCommands/ArgumentListResult.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Testing.ChatCommands.ArgumentListResult -// 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.Collections; -using System.Collections.Generic; -using System.Linq; - -namespace Terraria.Testing.ChatCommands -{ - public class ArgumentListResult : IEnumerable, IEnumerable - { - public static readonly ArgumentListResult Empty = new ArgumentListResult(true); - public static readonly ArgumentListResult Invalid = new ArgumentListResult(false); - public readonly bool IsValid; - private readonly List _results; - - public int Count => this._results.Count; - - public string this[int index] => this._results[index]; - - public ArgumentListResult(IEnumerable results) - { - this._results = results.ToList(); - this.IsValid = true; - } - - private ArgumentListResult(bool isValid) - { - this._results = new List(); - this.IsValid = isValid; - } - - public IEnumerator GetEnumerator() => (IEnumerator) this._results.GetEnumerator(); - - IEnumerator IEnumerable.GetEnumerator() => (IEnumerator) this.GetEnumerator(); - } -} diff --git a/Testing/PacketHistory.cs b/Testing/PacketHistory.cs deleted file mode 100644 index 2e0dc08..0000000 --- a/Testing/PacketHistory.cs +++ /dev/null @@ -1,103 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Testing.PacketHistory -// 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.Diagnostics; -using System.Globalization; -using System.IO; -using System.Text; -using System.Threading; - -namespace Terraria.Testing -{ - public class PacketHistory - { - private byte[] _buffer; - private PacketHistory.PacketView[] _packets; - private int _bufferPosition; - private int _historyPosition; - - public PacketHistory(int historySize = 100, int bufferSize = 65535) - { - } - - [Conditional("DEBUG")] - public void Record(byte[] buffer, int offset, int length) - { - length = Math.Max(0, length); - PacketHistory.PacketView packetView = this.AppendPacket(length); - Buffer.BlockCopy((Array) buffer, offset, (Array) this._buffer, packetView.Offset, length); - } - - private PacketHistory.PacketView AppendPacket(int size) - { - int offset = this._bufferPosition; - if (offset + size > this._buffer.Length) - offset = 0; - PacketHistory.PacketView packetView = new PacketHistory.PacketView(offset, size, DateTime.Now); - this._packets[this._historyPosition] = packetView; - this._historyPosition = (this._historyPosition + 1) % this._packets.Length; - this._bufferPosition = offset + size; - return packetView; - } - - [Conditional("DEBUG")] - public void Dump(string reason) - { - byte[] numArray = new byte[this._buffer.Length]; - Buffer.BlockCopy((Array) this._buffer, this._bufferPosition, (Array) numArray, 0, this._buffer.Length - this._bufferPosition); - Buffer.BlockCopy((Array) this._buffer, 0, (Array) numArray, this._buffer.Length - this._bufferPosition, this._bufferPosition); - StringBuilder stringBuilder = new StringBuilder(); - int num = 1; - for (int index1 = 0; index1 < this._packets.Length; ++index1) - { - PacketHistory.PacketView packet = this._packets[(index1 + this._historyPosition) % this._packets.Length]; - if (packet.Offset != 0 || packet.Length != 0) - { - stringBuilder.Append(string.Format("Packet {0} [Assumed MessageID: {4}, Size: {2}, Buffer Position: {1}, Timestamp: {3:G}]\r\n", (object) num++, (object) packet.Offset, (object) packet.Length, (object) packet.Time, (object) this._buffer[packet.Offset])); - for (int index2 = 0; index2 < packet.Length; ++index2) - { - stringBuilder.Append(this._buffer[packet.Offset + index2].ToString("X2") + " "); - if (index2 % 16 == 15 && index2 != this._packets.Length - 1) - stringBuilder.Append("\r\n"); - } - stringBuilder.Append("\r\n\r\n"); - } - } - stringBuilder.Append(reason); - Directory.CreateDirectory(Path.Combine(Main.SavePath, "NetDump")); - File.WriteAllText(Path.Combine(Main.SavePath, "NetDump", this.CreateDumpFileName()), stringBuilder.ToString()); - } - - private string CreateDumpFileName() - { - DateTime localTime = DateTime.Now.ToLocalTime(); - return string.Format("Net_{0}_{1}_{2}_{3}.txt", (object) "Terraria", (object) Main.versionNumber, (object) localTime.ToString("MM-dd-yy_HH-mm-ss-ffff", (IFormatProvider) CultureInfo.InvariantCulture), (object) Thread.CurrentThread.ManagedThreadId); - } - - [Conditional("DEBUG")] - private void InitializeBuffer(int historySize, int bufferSize) - { - this._packets = new PacketHistory.PacketView[historySize]; - this._buffer = new byte[bufferSize]; - } - - private struct PacketView - { - public static readonly PacketHistory.PacketView Empty = new PacketHistory.PacketView(0, 0, DateTime.Now); - public readonly int Offset; - public readonly int Length; - public readonly DateTime Time; - - public PacketView(int offset, int length, DateTime time) - { - this.Offset = offset; - this.Length = length; - this.Time = time; - } - } - } -} diff --git a/TexturePackSupport.cs b/TexturePackSupport.cs new file mode 100644 index 0000000..8157568 --- /dev/null +++ b/TexturePackSupport.cs @@ -0,0 +1,66 @@ +// Decompiled with JetBrains decompiler +// Type: Terraria.TexturePackSupport +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 +// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe + +using Ionic.Zip; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; + +namespace Terraria +{ + public class TexturePackSupport + { + public static bool Enabled = false; + public static int ReplacedTextures = 0; + private static ZipFile texturePack; + private static Dictionary entries = new Dictionary(); + private static Stopwatch test = new Stopwatch(); + + public static bool FetchTexture(string path, out Texture2D tex) + { + ZipEntry zipEntry; + if (TexturePackSupport.entries.TryGetValue(path, out zipEntry)) + { + using (MemoryStream memoryStream = new MemoryStream()) + { + zipEntry.Extract((Stream) memoryStream); + tex = TexturePackSupport.FromStreamSlow(Main.instance.GraphicsDevice, (Stream) memoryStream); + ++TexturePackSupport.ReplacedTextures; + return true; + } + } + else + { + tex = (Texture2D) null; + return false; + } + } + + public static Texture2D FromStreamSlow(GraphicsDevice graphicsDevice, Stream stream) + { + Texture2D texture2D = Texture2D.FromStream(graphicsDevice, stream); + Color[] data = new Color[texture2D.Width * texture2D.Height]; + texture2D.GetData(data); + for (int index = 0; index != data.Length; ++index) + data[index] = Color.FromNonPremultiplied(data[index].ToVector4()); + texture2D.SetData(data); + return texture2D; + } + + public static void FindTexturePack() + { + string path = Main.SavePath + "/Texture Pack.zip"; + if (!File.Exists(path)) + return; + TexturePackSupport.entries.Clear(); + TexturePackSupport.texturePack = ZipFile.Read((Stream) File.OpenRead(path)); + foreach (ZipEntry entry in (IEnumerable) TexturePackSupport.texturePack.Entries) + TexturePackSupport.entries.Add(entry.FileName.Replace("/", "\\"), entry); + } + } +} diff --git a/Tile.cs b/Tile.cs index 12cbb98..2d0a434 100644 --- a/Tile.cs +++ b/Tile.cs @@ -1,18 +1,17 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Tile -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; -using Terraria.DataStructures; namespace Terraria { public class Tile { public ushort type; - public ushort wall; + public byte wall; public byte liquid; public short sTileHeader; public byte bTileHeader; @@ -33,7 +32,7 @@ namespace Terraria public Tile() { this.type = (ushort) 0; - this.wall = (ushort) 0; + this.wall = (byte) 0; this.liquid = (byte) 0; this.sTileHeader = (short) 0; this.bTileHeader = (byte) 0; @@ -48,7 +47,7 @@ namespace Terraria if (copy == null) { this.type = (ushort) 0; - this.wall = (ushort) 0; + this.wall = (byte) 0; this.liquid = (byte) 0; this.sTileHeader = (short) 0; this.bTileHeader = (byte) 0; @@ -76,7 +75,7 @@ namespace Terraria public void ClearEverything() { this.type = (ushort) 0; - this.wall = (ushort) 0; + this.wall = (byte) 0; this.liquid = (byte) 0; this.sTileHeader = (short) 0; this.bTileHeader = (byte) 0; @@ -91,7 +90,6 @@ namespace Terraria this.slope((byte) 0); this.halfBrick(false); this.active(false); - this.inActive(false); } public void CopyFrom(Tile from) @@ -196,13 +194,6 @@ namespace Terraria return new Color((int) (byte) (num * (double) oldColor.R), (int) (byte) (num * (double) oldColor.G), (int) (byte) (num * (double) oldColor.B), (int) oldColor.A); } - public void actColor(ref Vector3 oldColor) - { - if (!this.inActive()) - return; - oldColor *= 0.4f; - } - public bool topSlope() { byte num = this.slope(); @@ -231,7 +222,12 @@ namespace Terraria public byte wallColor() => (byte) ((uint) this.bTileHeader & 31U); - public void wallColor(byte wallColor) => this.bTileHeader = (byte) ((uint) this.bTileHeader & 224U | (uint) wallColor); + public void wallColor(byte wallColor) + { + if (wallColor > (byte) 30) + wallColor = (byte) 30; + this.bTileHeader = (byte) ((uint) this.bTileHeader & 224U | (uint) wallColor); + } public bool lava() => ((int) this.bTileHeader & 32) == 32; @@ -301,7 +297,12 @@ namespace Terraria public byte color() => (byte) ((uint) this.sTileHeader & 31U); - public void color(byte color) => this.sTileHeader = (short) ((int) this.sTileHeader & 65504 | (int) color); + public void color(byte color) + { + if (color > (byte) 30) + color = (byte) 30; + this.sTileHeader = (short) ((int) this.sTileHeader & 65504 | (int) color); + } public bool active() => ((int) this.sTileHeader & 32) == 32; @@ -377,70 +378,24 @@ namespace Terraria public void slope(byte slope) => this.sTileHeader = (short) ((int) this.sTileHeader & 36863 | ((int) slope & 7) << 12); - public void Clear(TileDataType types) - { - if ((types & TileDataType.Tile) != (TileDataType) 0) - { - this.type = (ushort) 0; - this.active(false); - this.frameX = (short) 0; - this.frameY = (short) 0; - } - if ((types & TileDataType.Wall) != (TileDataType) 0) - { - this.wall = (ushort) 0; - this.wallFrameX(0); - this.wallFrameY(0); - } - if ((types & TileDataType.TilePaint) != (TileDataType) 0) - this.color((byte) 0); - if ((types & TileDataType.WallPaint) != (TileDataType) 0) - this.wallColor((byte) 0); - if ((types & TileDataType.Liquid) != (TileDataType) 0) - { - this.liquid = (byte) 0; - this.liquidType(0); - this.checkingLiquid(false); - } - if ((types & TileDataType.Slope) != (TileDataType) 0) - { - this.slope((byte) 0); - this.halfBrick(false); - } - if ((types & TileDataType.Wiring) != (TileDataType) 0) - { - this.wire(false); - this.wire2(false); - this.wire3(false); - this.wire4(false); - } - if ((types & TileDataType.Actuator) == (TileDataType) 0) - return; - this.actuator(false); - this.inActive(false); - } - - public static void SmoothSlope(int x, int y, bool applyToNeighbors = true, bool sync = false) + public static void SmoothSlope(int x, int y, bool applyToNeighbors = true) { if (applyToNeighbors) { - Tile.SmoothSlope(x + 1, y, false, sync); - Tile.SmoothSlope(x - 1, y, false, sync); - Tile.SmoothSlope(x, y + 1, false, sync); - Tile.SmoothSlope(x, y - 1, false, sync); + Tile.SmoothSlope(x + 1, y, false); + Tile.SmoothSlope(x - 1, y, false); + Tile.SmoothSlope(x, y + 1, false); + Tile.SmoothSlope(x, y - 1, false); } Tile tile = Main.tile[x, y]; - if (!WorldGen.CanPoundTile(x, y) || !WorldGen.SolidOrSlopedTile(x, y)) + if (!WorldGen.SolidOrSlopedTile(x, y)) return; bool flag1 = !WorldGen.TileEmpty(x, y - 1); bool flag2 = !WorldGen.SolidOrSlopedTile(x, y - 1) & flag1; bool flag3 = WorldGen.SolidOrSlopedTile(x, y + 1); bool flag4 = WorldGen.SolidOrSlopedTile(x - 1, y); bool flag5 = WorldGen.SolidOrSlopedTile(x + 1, y); - int num1 = (flag1 ? 1 : 0) << 3 | (flag3 ? 1 : 0) << 2 | (flag4 ? 1 : 0) << 1 | (flag5 ? 1 : 0); - bool flag6 = tile.halfBrick(); - int num2 = (int) tile.slope(); - switch (num1) + switch ((flag1 ? 1 : 0) << 3 | (flag3 ? 1 : 0) << 2 | (flag4 ? 1 : 0) << 1 | (flag5 ? 1 : 0)) { case 4: tile.slope((byte) 0); @@ -455,43 +410,22 @@ namespace Terraria tile.slope((byte) 1); break; case 9: - if (!flag2) - { - tile.halfBrick(false); - tile.slope((byte) 4); + if (flag2) break; - } + tile.halfBrick(false); + tile.slope((byte) 4); break; case 10: - if (!flag2) - { - tile.halfBrick(false); - tile.slope((byte) 3); + if (flag2) break; - } + tile.halfBrick(false); + tile.slope((byte) 3); break; default: tile.halfBrick(false); tile.slope((byte) 0); break; } - if (!sync) - return; - int num3 = (int) tile.slope(); - bool flag7 = flag6 != tile.halfBrick(); - bool flag8 = num2 != num3; - if (flag7 & flag8) - NetMessage.SendData(17, number: 23, number2: ((float) x), number3: ((float) y), number4: ((float) num3)); - else if (flag7) - { - NetMessage.SendData(17, number: 7, number2: ((float) x), number3: ((float) y), number4: 1f); - } - else - { - if (!flag8) - return; - NetMessage.SendData(17, number: 14, number2: ((float) x), number3: ((float) y), number4: ((float) num3)); - } } public override string ToString() => "Tile Type:" + (object) this.type + " Active:" + this.active().ToString() + " Wall:" + (object) this.wall + " Slope:" + (object) this.slope() + " fX:" + (object) this.frameX + " fY:" + (object) this.frameY; diff --git a/TileChangeReceivedEvent.cs b/TileChangeReceivedEvent.cs index 507122d..fb2589d 100644 --- a/TileChangeReceivedEvent.cs +++ b/TileChangeReceivedEvent.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.TileChangeReceivedEvent -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Terraria.ID; diff --git a/TileObject.cs b/TileObject.cs index 2d1b04e..4bfef38 100644 --- a/TileObject.cs +++ b/TileObject.cs @@ -1,14 +1,13 @@ // Decompiled with JetBrains decompiler // Type: Terraria.TileObject -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria.DataStructures; using Terraria.Enums; -using Terraria.GameContent; using Terraria.ID; using Terraria.ObjectData; @@ -44,7 +43,7 @@ namespace Terraria num1 = toBePlaced.xCoord + (int) tileData.Origin.X; num2 = toBePlaced.yCoord + (int) tileData.Origin.Y; } - if (tileData.HookPlaceOverride.hook(num1, num2, toBePlaced.type, toBePlaced.style, 1, toBePlaced.alternate) == tileData.HookPlaceOverride.badReturn) + if (tileData.HookPlaceOverride.hook(num1, num2, toBePlaced.type, toBePlaced.style, 1) == tileData.HookPlaceOverride.badReturn) return false; } else @@ -76,12 +75,8 @@ namespace Terraria for (int index2 = 0; index2 < tileData.Height; ++index2) { Tile tileSafely = Framing.GetTileSafely(xCoord + index1, yCoord + index2); - if (tileSafely.active() && tileSafely.type != (ushort) 484 && (Main.tileCut[(int) tileSafely.type] || TileID.Sets.BreakableWhenPlacing[(int) tileSafely.type])) - { + if (tileSafely.active() && Main.tileCut[(int) tileSafely.type]) WorldGen.KillTile(xCoord + index1, yCoord + index2); - if (!Main.tile[xCoord + index1, yCoord + index2].active() && Main.netMode == 1) - NetMessage.SendData(17, number2: ((float) (yCoord + index1)), number3: ((float) (yCoord + index2))); - } } } for (int index3 = 0; index3 < tileData.Width; ++index3) @@ -309,7 +304,7 @@ namespace Terraria ++num19; } bool flag4 = false; - if (tileSafely.active() && (!Main.tileCut[(int) tileSafely.type] || tileSafely.type == (ushort) 484) && !TileID.Sets.BreakableWhenPlacing[(int) tileSafely.type]) + if (tileSafely.active() && !Main.tileCut[(int) tileSafely.type]) flag4 = true; if (flag4 | flag2 | flag3) { @@ -343,7 +338,7 @@ namespace Terraria if (TileID.Sets.Platforms[(int) tileSafely.type]) { int num22 = (int) tileSafely.frameX / TileObjectData.PlatformFrameWidth(); - if (!tileSafely.halfBrick() && WorldGen.PlatformProperTopFrame(tileSafely.frameX)) + if (!tileSafely.halfBrick() && num22 >= 0 && num22 <= 7 || num22 >= 12 && num22 <= 16 || num22 >= 25 && num22 <= 26) flag5 = true; } else if (Main.tileSolid[(int) tileSafely.type] && Main.tileSolidTop[(int) tileSafely.type]) @@ -447,14 +442,14 @@ namespace Terraria break; } } - if (!flag7 && (anchorRight.type & AnchorType.Tree) == AnchorType.Tree && TileID.Sets.IsATreeTrunk[(int) tileSafely1.type]) + if (!flag7 && (anchorRight.type & AnchorType.Tree) == AnchorType.Tree && tileSafely1.type == (ushort) 5) { flag7 = true; if (index == 0) { ++num20; Tile tileSafely2 = Framing.GetTileSafely(num7 + width, num8 + num25 - 1); - if (tileSafely2.nactive() && TileID.Sets.IsATreeTrunk[(int) tileSafely2.type]) + if (tileSafely2.nactive() && tileSafely2.type == (ushort) 5) { ++num19; if (onlyCheck) @@ -467,7 +462,7 @@ namespace Terraria { ++num20; Tile tileSafely3 = Framing.GetTileSafely(num7 + width, num8 + num25 + 1); - if (tileSafely3.nactive() && TileID.Sets.IsATreeTrunk[(int) tileSafely3.type]) + if (tileSafely3.nactive() && tileSafely3.type == (ushort) 5) { ++num19; if (onlyCheck) @@ -519,14 +514,14 @@ namespace Terraria break; } } - if (!flag8 && (anchorLeft.type & AnchorType.Tree) == AnchorType.Tree && TileID.Sets.IsATreeTrunk[(int) tileSafely4.type]) + if (!flag8 && (anchorLeft.type & AnchorType.Tree) == AnchorType.Tree && tileSafely4.type == (ushort) 5) { flag8 = true; if (index == 0) { ++num20; Tile tileSafely5 = Framing.GetTileSafely(num7 + num26, num8 + num27 - 1); - if (tileSafely5.nactive() && TileID.Sets.IsATreeTrunk[(int) tileSafely5.type]) + if (tileSafely5.nactive() && tileSafely5.type == (ushort) 5) { ++num19; if (onlyCheck) @@ -539,7 +534,7 @@ namespace Terraria { ++num20; Tile tileSafely6 = Framing.GetTileSafely(num7 + num26, num8 + num27 + 1); - if (tileSafely6.nactive() && TileID.Sets.IsATreeTrunk[(int) tileSafely6.type]) + if (tileSafely6.nactive() && tileSafely6.type == (ushort) 5) { ++num19; if (onlyCheck) @@ -567,14 +562,14 @@ namespace Terraria } } } - if (tileData2.HookCheckIfCanPlace.hook != null) + if (tileData2.HookCheck.hook != null) { - if (tileData2.HookCheckIfCanPlace.processedCoordinates) + if (tileData2.HookCheck.processedCoordinates) { Point16 origin1 = tileData2.Origin; Point16 origin2 = tileData2.Origin; } - if (tileData2.HookCheckIfCanPlace.hook(x, y, type, style, dir, alternate) == tileData2.HookCheckIfCanPlace.badReturn && tileData2.HookCheckIfCanPlace.badResponse == 0) + if (tileData2.HookCheck.hook(x, y, type, style, dir) == tileData2.HookCheck.badReturn && tileData2.HookCheck.badResponse == 0) { num19 = 0.0f; num17 = 0.0f; @@ -653,53 +648,37 @@ namespace Terraria public static void DrawPreview(SpriteBatch sb, TileObjectPreviewData op, Vector2 position) { Point16 coordinates = op.Coordinates; - Texture2D texture = TextureAssets.Tile[(int) op.Type].Value; + Texture2D texture = Main.tileTexture[(int) op.Type]; TileObjectData tileData = TileObjectData.GetTileData((int) op.Type, (int) op.Style, op.Alternate); int placementStyle = tileData.CalculatePlacementStyle((int) op.Style, op.Alternate, op.Random); int num1 = 0; int drawYoffset = tileData.DrawYOffset; - int drawXoffset = tileData.DrawXOffset; - int num2 = placementStyle + tileData.DrawStyleOffset; - int styleWrapLimit = tileData.StyleWrapLimit; - int styleLineSkip = tileData.StyleLineSkip; - int? nullable; - if (tileData.StyleWrapLimitVisualOverride.HasValue) + if (tileData.StyleWrapLimit > 0) { - nullable = tileData.StyleWrapLimitVisualOverride; - styleWrapLimit = nullable.Value; - } - nullable = tileData.styleLineSkipVisualOverride; - if (nullable.HasValue) - { - nullable = tileData.styleLineSkipVisualOverride; - styleLineSkip = nullable.Value; - } - if (styleWrapLimit > 0) - { - num1 = num2 / styleWrapLimit * styleLineSkip; - num2 %= styleWrapLimit; + num1 = placementStyle / tileData.StyleWrapLimit * tileData.StyleLineSkip; + placementStyle %= tileData.StyleWrapLimit; } + int num2; int num3; - int num4; if (tileData.StyleHorizontal) { - num3 = tileData.CoordinateFullWidth * num2; - num4 = tileData.CoordinateFullHeight * num1; + num2 = tileData.CoordinateFullWidth * placementStyle; + num3 = tileData.CoordinateFullHeight * num1; } else { - num3 = tileData.CoordinateFullWidth * num1; - num4 = tileData.CoordinateFullHeight * num2; + num2 = tileData.CoordinateFullWidth * num1; + num3 = tileData.CoordinateFullHeight * placementStyle; } for (int x1 = 0; x1 < (int) op.Size.X; ++x1) { - int x2 = num3 + (x1 - (int) op.ObjectStart.X) * (tileData.CoordinateWidth + tileData.CoordinatePadding); - int y1 = num4; + int x2 = num2 + (x1 - (int) op.ObjectStart.X) * (tileData.CoordinateWidth + tileData.CoordinatePadding); + int y1 = num3; for (int y2 = 0; y2 < (int) op.Size.Y; ++y2) { int i = (int) coordinates.X + x1; - int num5 = (int) coordinates.Y + y2; - if (y2 == 0 && tileData.DrawStepDown != 0 && WorldGen.SolidTile(Framing.GetTileSafely(i, num5 - 1))) + int num4 = (int) coordinates.Y + y2; + if (y2 == 0 && tileData.DrawStepDown != 0 && WorldGen.SolidTile(Framing.GetTileSafely(i, num4 - 1))) drawYoffset += tileData.DrawStepDown; Color color1; switch (op[x1, y2]) @@ -717,12 +696,12 @@ namespace Terraria if (x1 >= (int) op.ObjectStart.X && x1 < (int) op.ObjectStart.X + tileData.Width && y2 >= (int) op.ObjectStart.Y && y2 < (int) op.ObjectStart.Y + tileData.Height) { SpriteEffects effects = SpriteEffects.None; - if (tileData.DrawFlipHorizontal && i % 2 == 0) + if (tileData.DrawFlipHorizontal && x1 % 2 == 1) effects |= SpriteEffects.FlipHorizontally; - if (tileData.DrawFlipVertical && num5 % 2 == 0) + if (tileData.DrawFlipVertical && y2 % 2 == 1) effects |= SpriteEffects.FlipVertically; Rectangle rectangle = new Rectangle(x2, y1, tileData.CoordinateWidth, tileData.CoordinateHeights[y2 - (int) op.ObjectStart.Y]); - sb.Draw(texture, new Vector2((float) (i * 16 - (int) ((double) position.X + (double) (tileData.CoordinateWidth - 16) / 2.0) + drawXoffset), (float) (num5 * 16 - (int) position.Y + drawYoffset)), new Rectangle?(rectangle), color2, 0.0f, Vector2.Zero, 1f, effects, 0.0f); + sb.Draw(texture, new Vector2((float) (i * 16 - (int) ((double) position.X + (double) (tileData.CoordinateWidth - 16) / 2.0)), (float) (num4 * 16 - (int) position.Y + drawYoffset)), new Rectangle?(rectangle), color2, 0.0f, Vector2.Zero, 1f, effects, 0.0f); y1 += tileData.CoordinateHeights[y2 - (int) op.ObjectStart.Y] + tileData.CoordinatePadding; } } diff --git a/TimeLogger.cs b/TimeLogger.cs index 63e73cf..22381df 100644 --- a/TimeLogger.cs +++ b/TimeLogger.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.TimeLogger -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; diff --git a/UI/AchievementAdvisor.cs b/UI/AchievementAdvisor.cs deleted file mode 100644 index dd65cf2..0000000 --- a/UI/AchievementAdvisor.cs +++ /dev/null @@ -1,399 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.UI.AchievementAdvisor -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria.Achievements; -using Terraria.GameInput; - -namespace Terraria.UI -{ - public class AchievementAdvisor - { - private List _cards = new List(); - private Asset _achievementsTexture; - private Asset _achievementsBorderTexture; - private Asset _achievementsBorderMouseHoverFatTexture; - private Asset _achievementsBorderMouseHoverThinTexture; - private AchievementAdvisorCard _hoveredCard; - - public bool CanDrawAboveCoins => Main.screenWidth >= 1000 && !PlayerInput.UsingGamepad; - - public void LoadContent() - { - this._achievementsTexture = Main.Assets.Request("Images/UI/Achievements", (AssetRequestMode) 1); - this._achievementsBorderTexture = Main.Assets.Request("Images/UI/Achievement_Borders", (AssetRequestMode) 1); - this._achievementsBorderMouseHoverFatTexture = Main.Assets.Request("Images/UI/Achievement_Borders_MouseHover", (AssetRequestMode) 1); - this._achievementsBorderMouseHoverThinTexture = Main.Assets.Request("Images/UI/Achievement_Borders_MouseHoverThin", (AssetRequestMode) 1); - } - - public void Draw(SpriteBatch spriteBatch) - { - } - - public void DrawOneAchievement(SpriteBatch spriteBatch, Vector2 position, bool large) - { - List bestCards = this.GetBestCards(1); - if (bestCards.Count < 1) - return; - AchievementAdvisorCard achievementAdvisorCard = bestCards[0]; - float scale = 0.35f; - if (large) - scale = 0.75f; - this._hoveredCard = (AchievementAdvisorCard) null; - bool hovered; - this.DrawCard(bestCards[0], spriteBatch, position + new Vector2(8f) * scale, scale, out hovered); - if (!hovered) - return; - this._hoveredCard = achievementAdvisorCard; - if (PlayerInput.IgnoreMouseInterface) - return; - Main.player[Main.myPlayer].mouseInterface = true; - if (!Main.mouseLeft || !Main.mouseLeftRelease) - return; - Main.ingameOptionsWindow = false; - IngameFancyUI.OpenAchievementsAndGoto(this._hoveredCard.achievement); - } - - public void Update() => this._hoveredCard = (AchievementAdvisorCard) null; - - public void DrawOptionsPanel( - SpriteBatch spriteBatch, - Vector2 leftPosition, - Vector2 rightPosition) - { - List bestCards = this.GetBestCards(); - this._hoveredCard = (AchievementAdvisorCard) null; - int num = bestCards.Count; - if (num > 5) - num = 5; - bool hovered; - for (int index = 0; index < num; ++index) - { - this.DrawCard(bestCards[index], spriteBatch, leftPosition + new Vector2((float) (42 * index), 0.0f), 0.5f, out hovered); - if (hovered) - this._hoveredCard = bestCards[index]; - } - for (int index = 5; index < bestCards.Count; ++index) - { - this.DrawCard(bestCards[index], spriteBatch, rightPosition + new Vector2((float) (42 * index), 0.0f), 0.5f, out hovered); - if (hovered) - this._hoveredCard = bestCards[index]; - } - if (this._hoveredCard == null) - return; - if (this._hoveredCard.achievement.IsCompleted) - { - this._hoveredCard = (AchievementAdvisorCard) null; - } - else - { - if (PlayerInput.IgnoreMouseInterface) - return; - Main.player[Main.myPlayer].mouseInterface = true; - if (!Main.mouseLeft || !Main.mouseLeftRelease) - return; - Main.ingameOptionsWindow = false; - IngameFancyUI.OpenAchievementsAndGoto(this._hoveredCard.achievement); - } - } - - public void DrawMouseHover() - { - if (this._hoveredCard == null) - return; - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, (BlendState) null, (SamplerState) null, (DepthStencilState) null, (RasterizerState) null, (Effect) null, Main.UIScaleMatrix); - PlayerInput.SetZoom_UI(); - Item obj = new Item(); - obj.SetDefaults(0, true); - obj.SetNameOverride(this._hoveredCard.achievement.FriendlyName.Value); - obj.ToolTip = ItemTooltip.FromLanguageKey(this._hoveredCard.achievement.Description.Key); - obj.type = 1; - obj.scale = 0.0f; - obj.rare = 10; - obj.value = -1; - Main.HoverItem = obj; - Main.instance.MouseText(""); - Main.mouseText = true; - } - - private void DrawCard( - AchievementAdvisorCard card, - SpriteBatch spriteBatch, - Vector2 position, - float scale, - out bool hovered) - { - hovered = false; - if (Main.MouseScreen.Between(position, position + card.frame.Size() * scale)) - { - Main.LocalPlayer.mouseInterface = true; - hovered = true; - } - Color color = Color.White; - if (!hovered) - color = new Color(220, 220, 220, 220); - Vector2 vector2_1 = new Vector2(-4f) * scale; - Vector2 vector2_2 = new Vector2(-8f) * scale; - Texture2D texture = this._achievementsBorderMouseHoverFatTexture.Value; - if ((double) scale > 0.5) - { - texture = this._achievementsBorderMouseHoverThinTexture.Value; - vector2_2 = new Vector2(-5f) * scale; - } - Rectangle frame = card.frame; - frame.X += 528; - spriteBatch.Draw(this._achievementsTexture.Value, position, new Rectangle?(frame), color, 0.0f, Vector2.Zero, scale, SpriteEffects.None, 0.0f); - spriteBatch.Draw(this._achievementsBorderTexture.Value, position + vector2_1, new Rectangle?(), color, 0.0f, Vector2.Zero, scale, SpriteEffects.None, 0.0f); - if (!hovered) - return; - spriteBatch.Draw(texture, position + vector2_2, new Rectangle?(), Main.OurFavoriteColor, 0.0f, Vector2.Zero, scale, SpriteEffects.None, 0.0f); - } - - private List GetBestCards(int cardsAmount = 10) - { - List achievementAdvisorCardList = new List(); - for (int index = 0; index < this._cards.Count; ++index) - { - AchievementAdvisorCard card = this._cards[index]; - if (!card.achievement.IsCompleted && card.IsAchievableInWorld()) - { - achievementAdvisorCardList.Add(card); - if (achievementAdvisorCardList.Count >= cardsAmount) - break; - } - } - return achievementAdvisorCardList; - } - - public void Initialize() - { - float num1 = 1f; - List cards1 = this._cards; - Achievement achievement1 = Main.Achievements.GetAchievement("TIMBER"); - double num2 = (double) num1; - float num3 = (float) (num2 + 1.0); - AchievementAdvisorCard achievementAdvisorCard1 = new AchievementAdvisorCard(achievement1, (float) num2); - cards1.Add(achievementAdvisorCard1); - List cards2 = this._cards; - Achievement achievement2 = Main.Achievements.GetAchievement("BENCHED"); - double num4 = (double) num3; - float num5 = (float) (num4 + 1.0); - AchievementAdvisorCard achievementAdvisorCard2 = new AchievementAdvisorCard(achievement2, (float) num4); - cards2.Add(achievementAdvisorCard2); - List cards3 = this._cards; - Achievement achievement3 = Main.Achievements.GetAchievement("OBTAIN_HAMMER"); - double num6 = (double) num5; - float num7 = (float) (num6 + 1.0); - AchievementAdvisorCard achievementAdvisorCard3 = new AchievementAdvisorCard(achievement3, (float) num6); - cards3.Add(achievementAdvisorCard3); - List cards4 = this._cards; - Achievement achievement4 = Main.Achievements.GetAchievement("NO_HOBO"); - double num8 = (double) num7; - float num9 = (float) (num8 + 1.0); - AchievementAdvisorCard achievementAdvisorCard4 = new AchievementAdvisorCard(achievement4, (float) num8); - cards4.Add(achievementAdvisorCard4); - List cards5 = this._cards; - Achievement achievement5 = Main.Achievements.GetAchievement("YOU_CAN_DO_IT"); - double num10 = (double) num9; - float num11 = (float) (num10 + 1.0); - AchievementAdvisorCard achievementAdvisorCard5 = new AchievementAdvisorCard(achievement5, (float) num10); - cards5.Add(achievementAdvisorCard5); - List cards6 = this._cards; - Achievement achievement6 = Main.Achievements.GetAchievement("OOO_SHINY"); - double num12 = (double) num11; - float num13 = (float) (num12 + 1.0); - AchievementAdvisorCard achievementAdvisorCard6 = new AchievementAdvisorCard(achievement6, (float) num12); - cards6.Add(achievementAdvisorCard6); - List cards7 = this._cards; - Achievement achievement7 = Main.Achievements.GetAchievement("HEAVY_METAL"); - double num14 = (double) num13; - float num15 = (float) (num14 + 1.0); - AchievementAdvisorCard achievementAdvisorCard7 = new AchievementAdvisorCard(achievement7, (float) num14); - cards7.Add(achievementAdvisorCard7); - List cards8 = this._cards; - Achievement achievement8 = Main.Achievements.GetAchievement("MATCHING_ATTIRE"); - double num16 = (double) num15; - float num17 = (float) (num16 + 1.0); - AchievementAdvisorCard achievementAdvisorCard8 = new AchievementAdvisorCard(achievement8, (float) num16); - cards8.Add(achievementAdvisorCard8); - List cards9 = this._cards; - Achievement achievement9 = Main.Achievements.GetAchievement("HEART_BREAKER"); - double num18 = (double) num17; - float num19 = (float) (num18 + 1.0); - AchievementAdvisorCard achievementAdvisorCard9 = new AchievementAdvisorCard(achievement9, (float) num18); - cards9.Add(achievementAdvisorCard9); - List cards10 = this._cards; - Achievement achievement10 = Main.Achievements.GetAchievement("I_AM_LOOT"); - double num20 = (double) num19; - float num21 = (float) (num20 + 1.0); - AchievementAdvisorCard achievementAdvisorCard10 = new AchievementAdvisorCard(achievement10, (float) num20); - cards10.Add(achievementAdvisorCard10); - List cards11 = this._cards; - Achievement achievement11 = Main.Achievements.GetAchievement("HOLD_ON_TIGHT"); - double num22 = (double) num21; - float num23 = (float) (num22 + 1.0); - AchievementAdvisorCard achievementAdvisorCard11 = new AchievementAdvisorCard(achievement11, (float) num22); - cards11.Add(achievementAdvisorCard11); - List cards12 = this._cards; - Achievement achievement12 = Main.Achievements.GetAchievement("STAR_POWER"); - double num24 = (double) num23; - float num25 = (float) (num24 + 1.0); - AchievementAdvisorCard achievementAdvisorCard12 = new AchievementAdvisorCard(achievement12, (float) num24); - cards12.Add(achievementAdvisorCard12); - List cards13 = this._cards; - Achievement achievement13 = Main.Achievements.GetAchievement("EYE_ON_YOU"); - double num26 = (double) num25; - float num27 = (float) (num26 + 1.0); - AchievementAdvisorCard achievementAdvisorCard13 = new AchievementAdvisorCard(achievement13, (float) num26); - cards13.Add(achievementAdvisorCard13); - List cards14 = this._cards; - Achievement achievement14 = Main.Achievements.GetAchievement("SMASHING_POPPET"); - double num28 = (double) num27; - float num29 = (float) (num28 + 1.0); - AchievementAdvisorCard achievementAdvisorCard14 = new AchievementAdvisorCard(achievement14, (float) num28); - cards14.Add(achievementAdvisorCard14); - List cards15 = this._cards; - Achievement achievement15 = Main.Achievements.GetAchievement("WHERES_MY_HONEY"); - double num30 = (double) num29; - float num31 = (float) (num30 + 1.0); - AchievementAdvisorCard achievementAdvisorCard15 = new AchievementAdvisorCard(achievement15, (float) num30); - cards15.Add(achievementAdvisorCard15); - List cards16 = this._cards; - Achievement achievement16 = Main.Achievements.GetAchievement("STING_OPERATION"); - double num32 = (double) num31; - float num33 = (float) (num32 + 1.0); - AchievementAdvisorCard achievementAdvisorCard16 = new AchievementAdvisorCard(achievement16, (float) num32); - cards16.Add(achievementAdvisorCard16); - List cards17 = this._cards; - Achievement achievement17 = Main.Achievements.GetAchievement("BONED"); - double num34 = (double) num33; - float num35 = (float) (num34 + 1.0); - AchievementAdvisorCard achievementAdvisorCard17 = new AchievementAdvisorCard(achievement17, (float) num34); - cards17.Add(achievementAdvisorCard17); - List cards18 = this._cards; - Achievement achievement18 = Main.Achievements.GetAchievement("DUNGEON_HEIST"); - double num36 = (double) num35; - float num37 = (float) (num36 + 1.0); - AchievementAdvisorCard achievementAdvisorCard18 = new AchievementAdvisorCard(achievement18, (float) num36); - cards18.Add(achievementAdvisorCard18); - List cards19 = this._cards; - Achievement achievement19 = Main.Achievements.GetAchievement("ITS_GETTING_HOT_IN_HERE"); - double num38 = (double) num37; - float num39 = (float) (num38 + 1.0); - AchievementAdvisorCard achievementAdvisorCard19 = new AchievementAdvisorCard(achievement19, (float) num38); - cards19.Add(achievementAdvisorCard19); - List cards20 = this._cards; - Achievement achievement20 = Main.Achievements.GetAchievement("MINER_FOR_FIRE"); - double num40 = (double) num39; - float num41 = (float) (num40 + 1.0); - AchievementAdvisorCard achievementAdvisorCard20 = new AchievementAdvisorCard(achievement20, (float) num40); - cards20.Add(achievementAdvisorCard20); - List cards21 = this._cards; - Achievement achievement21 = Main.Achievements.GetAchievement("STILL_HUNGRY"); - double num42 = (double) num41; - float num43 = (float) (num42 + 1.0); - AchievementAdvisorCard achievementAdvisorCard21 = new AchievementAdvisorCard(achievement21, (float) num42); - cards21.Add(achievementAdvisorCard21); - List cards22 = this._cards; - Achievement achievement22 = Main.Achievements.GetAchievement("ITS_HARD"); - double num44 = (double) num43; - float num45 = (float) (num44 + 1.0); - AchievementAdvisorCard achievementAdvisorCard22 = new AchievementAdvisorCard(achievement22, (float) num44); - cards22.Add(achievementAdvisorCard22); - List cards23 = this._cards; - Achievement achievement23 = Main.Achievements.GetAchievement("BEGONE_EVIL"); - double num46 = (double) num45; - float num47 = (float) (num46 + 1.0); - AchievementAdvisorCard achievementAdvisorCard23 = new AchievementAdvisorCard(achievement23, (float) num46); - cards23.Add(achievementAdvisorCard23); - List cards24 = this._cards; - Achievement achievement24 = Main.Achievements.GetAchievement("EXTRA_SHINY"); - double num48 = (double) num47; - float num49 = (float) (num48 + 1.0); - AchievementAdvisorCard achievementAdvisorCard24 = new AchievementAdvisorCard(achievement24, (float) num48); - cards24.Add(achievementAdvisorCard24); - List cards25 = this._cards; - Achievement achievement25 = Main.Achievements.GetAchievement("HEAD_IN_THE_CLOUDS"); - double num50 = (double) num49; - float num51 = (float) (num50 + 1.0); - AchievementAdvisorCard achievementAdvisorCard25 = new AchievementAdvisorCard(achievement25, (float) num50); - cards25.Add(achievementAdvisorCard25); - List cards26 = this._cards; - Achievement achievement26 = Main.Achievements.GetAchievement("BUCKETS_OF_BOLTS"); - double num52 = (double) num51; - float num53 = (float) (num52 + 1.0); - AchievementAdvisorCard achievementAdvisorCard26 = new AchievementAdvisorCard(achievement26, (float) num52); - cards26.Add(achievementAdvisorCard26); - List cards27 = this._cards; - Achievement achievement27 = Main.Achievements.GetAchievement("DRAX_ATTAX"); - double num54 = (double) num53; - float num55 = (float) (num54 + 1.0); - AchievementAdvisorCard achievementAdvisorCard27 = new AchievementAdvisorCard(achievement27, (float) num54); - cards27.Add(achievementAdvisorCard27); - List cards28 = this._cards; - Achievement achievement28 = Main.Achievements.GetAchievement("PHOTOSYNTHESIS"); - double num56 = (double) num55; - float num57 = (float) (num56 + 1.0); - AchievementAdvisorCard achievementAdvisorCard28 = new AchievementAdvisorCard(achievement28, (float) num56); - cards28.Add(achievementAdvisorCard28); - List cards29 = this._cards; - Achievement achievement29 = Main.Achievements.GetAchievement("GET_A_LIFE"); - double num58 = (double) num57; - float num59 = (float) (num58 + 1.0); - AchievementAdvisorCard achievementAdvisorCard29 = new AchievementAdvisorCard(achievement29, (float) num58); - cards29.Add(achievementAdvisorCard29); - List cards30 = this._cards; - Achievement achievement30 = Main.Achievements.GetAchievement("THE_GREAT_SOUTHERN_PLANTKILL"); - double num60 = (double) num59; - float num61 = (float) (num60 + 1.0); - AchievementAdvisorCard achievementAdvisorCard30 = new AchievementAdvisorCard(achievement30, (float) num60); - cards30.Add(achievementAdvisorCard30); - List cards31 = this._cards; - Achievement achievement31 = Main.Achievements.GetAchievement("TEMPLE_RAIDER"); - double num62 = (double) num61; - float num63 = (float) (num62 + 1.0); - AchievementAdvisorCard achievementAdvisorCard31 = new AchievementAdvisorCard(achievement31, (float) num62); - cards31.Add(achievementAdvisorCard31); - List cards32 = this._cards; - Achievement achievement32 = Main.Achievements.GetAchievement("LIHZAHRDIAN_IDOL"); - double num64 = (double) num63; - float num65 = (float) (num64 + 1.0); - AchievementAdvisorCard achievementAdvisorCard32 = new AchievementAdvisorCard(achievement32, (float) num64); - cards32.Add(achievementAdvisorCard32); - List cards33 = this._cards; - Achievement achievement33 = Main.Achievements.GetAchievement("ROBBING_THE_GRAVE"); - double num66 = (double) num65; - float num67 = (float) (num66 + 1.0); - AchievementAdvisorCard achievementAdvisorCard33 = new AchievementAdvisorCard(achievement33, (float) num66); - cards33.Add(achievementAdvisorCard33); - List cards34 = this._cards; - Achievement achievement34 = Main.Achievements.GetAchievement("OBSESSIVE_DEVOTION"); - double num68 = (double) num67; - float num69 = (float) (num68 + 1.0); - AchievementAdvisorCard achievementAdvisorCard34 = new AchievementAdvisorCard(achievement34, (float) num68); - cards34.Add(achievementAdvisorCard34); - List cards35 = this._cards; - Achievement achievement35 = Main.Achievements.GetAchievement("STAR_DESTROYER"); - double num70 = (double) num69; - float num71 = (float) (num70 + 1.0); - AchievementAdvisorCard achievementAdvisorCard35 = new AchievementAdvisorCard(achievement35, (float) num70); - cards35.Add(achievementAdvisorCard35); - List cards36 = this._cards; - Achievement achievement36 = Main.Achievements.GetAchievement("CHAMPION_OF_TERRARIA"); - double num72 = (double) num71; - float num73 = (float) (num72 + 1.0); - AchievementAdvisorCard achievementAdvisorCard36 = new AchievementAdvisorCard(achievement36, (float) num72); - cards36.Add(achievementAdvisorCard36); - this._cards.OrderBy((Func) (x => x.order)); - } - } -} diff --git a/UI/AchievementAdvisorCard.cs b/UI/AchievementAdvisorCard.cs deleted file mode 100644 index a0abcdd..0000000 --- a/UI/AchievementAdvisorCard.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.UI.AchievementAdvisorCard -// 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; -using Terraria.Achievements; - -namespace Terraria.UI -{ - public class AchievementAdvisorCard - { - private const int _iconSize = 64; - private const int _iconSizeWithSpace = 66; - private const int _iconsPerRow = 8; - public Achievement achievement; - public float order; - public Rectangle frame; - public int achievementIndex; - - public AchievementAdvisorCard(Achievement achievement, float order) - { - this.achievement = achievement; - this.order = order; - this.achievementIndex = Main.Achievements.GetIconIndex(achievement.Name); - this.frame = new Rectangle(this.achievementIndex % 8 * 66, this.achievementIndex / 8 * 66, 64, 64); - } - - public bool IsAchievableInWorld() - { - string name = this.achievement.Name; - if (name == "MASTERMIND") - return WorldGen.crimson; - return !(name == "WORM_FODDER") || !WorldGen.crimson; - } - } -} diff --git a/UI/AchievementCompleteUI.cs b/UI/AchievementCompleteUI.cs new file mode 100644 index 0000000..0566f65 --- /dev/null +++ b/UI/AchievementCompleteUI.cs @@ -0,0 +1,155 @@ +// Decompiled with JetBrains decompiler +// Type: Terraria.UI.AchievementCompleteUI +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 +// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe + +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System.Collections.Generic; +using Terraria.Achievements; +using Terraria.GameInput; +using Terraria.Graphics; + +namespace Terraria.UI +{ + public class AchievementCompleteUI + { + private static Texture2D AchievementsTexture; + private static Texture2D AchievementsTextureBorder; + private static List caches = new List(); + + public static void LoadContent() + { + AchievementCompleteUI.AchievementsTexture = TextureManager.Load("Images/UI/Achievements"); + AchievementCompleteUI.AchievementsTextureBorder = TextureManager.Load("Images/UI/Achievement_Borders"); + } + + public static void Initialize() => Main.Achievements.OnAchievementCompleted += new Achievement.AchievementCompleted(AchievementCompleteUI.AddCompleted); + + public static void Draw(SpriteBatch sb) + { + float y = (float) (Main.screenHeight - 40); + if (PlayerInput.UsingGamepad) + y -= 25f; + Vector2 center = new Vector2((float) (Main.screenWidth / 2), y); + foreach (AchievementCompleteUI.DrawCache cach in AchievementCompleteUI.caches) + { + AchievementCompleteUI.DrawAchievement(sb, ref center, cach); + if ((double) center.Y < -100.0) + break; + } + } + + public static void AddCompleted(Achievement achievement) + { + if (Main.netMode == 2) + return; + AchievementCompleteUI.caches.Add(new AchievementCompleteUI.DrawCache(achievement)); + } + + public static void Clear() => AchievementCompleteUI.caches.Clear(); + + public static void Update() + { + foreach (AchievementCompleteUI.DrawCache cach in AchievementCompleteUI.caches) + cach.Update(); + for (int index = 0; index < AchievementCompleteUI.caches.Count; ++index) + { + if (AchievementCompleteUI.caches[index].TimeLeft == 0) + { + AchievementCompleteUI.caches.Remove(AchievementCompleteUI.caches[index]); + --index; + } + } + } + + private static void DrawAchievement( + SpriteBatch sb, + ref Vector2 center, + AchievementCompleteUI.DrawCache ach) + { + float alpha = ach.Alpha; + if ((double) alpha > 0.0) + { + string title = ach.Title; + Vector2 center1 = center; + Vector2 vector2 = Main.fontItemStack.MeasureString(title); + float num1 = ach.Scale * 1.1f; + Vector2 size = (vector2 + new Vector2(58f, 10f)) * num1; + Rectangle rectangle = Utils.CenteredRectangle(center1, size); + Vector2 mouseScreen = Main.MouseScreen; + int num2 = rectangle.Contains(mouseScreen.ToPoint()) ? 1 : 0; + Color c = num2 != 0 ? new Color(64, 109, 164) * 0.75f : new Color(64, 109, 164) * 0.5f; + Utils.DrawInvBG(sb, rectangle, c); + float scale = num1 * 0.3f; + Color color = new Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor / 5, (int) Main.mouseTextColor); + Vector2 position = rectangle.Right() - Vector2.UnitX * num1 * (float) (12.0 + (double) scale * (double) ach.Frame.Width); + sb.Draw(AchievementCompleteUI.AchievementsTexture, position, new Rectangle?(ach.Frame), Color.White * alpha, 0.0f, new Vector2(0.0f, (float) (ach.Frame.Height / 2)), scale, SpriteEffects.None, 0.0f); + sb.Draw(AchievementCompleteUI.AchievementsTextureBorder, position, new Rectangle?(), Color.White * alpha, 0.0f, new Vector2(0.0f, (float) (ach.Frame.Height / 2)), scale, SpriteEffects.None, 0.0f); + Utils.DrawBorderString(sb, title, position - Vector2.UnitX * 10f, color * alpha, num1 * 0.9f, 1f, 0.4f); + if (num2 != 0 && !PlayerInput.IgnoreMouseInterface) + { + Main.player[Main.myPlayer].mouseInterface = true; + if (Main.mouseLeft && Main.mouseLeftRelease) + { + IngameFancyUI.OpenAchievementsAndGoto(ach.theAchievement); + ach.TimeLeft = 0; + } + } + } + ach.ApplyHeight(ref center); + } + + public class DrawCache + { + public Achievement theAchievement; + private const int _iconSize = 64; + private const int _iconSizeWithSpace = 66; + private const int _iconsPerRow = 8; + public int IconIndex; + public Rectangle Frame; + public string Title; + public int TimeLeft; + + public void Update() + { + --this.TimeLeft; + if (this.TimeLeft >= 0) + return; + this.TimeLeft = 0; + } + + public DrawCache(Achievement achievement) + { + this.theAchievement = achievement; + this.Title = achievement.FriendlyName.Value; + int iconIndex = Main.Achievements.GetIconIndex(achievement.Name); + this.IconIndex = iconIndex; + this.Frame = new Rectangle(iconIndex % 8 * 66, iconIndex / 8 * 66, 64, 64); + this.TimeLeft = 300; + } + + public float Scale + { + get + { + if (this.TimeLeft < 30) + return MathHelper.Lerp(0.0f, 1f, (float) this.TimeLeft / 30f); + return this.TimeLeft > 285 ? MathHelper.Lerp(1f, 0.0f, (float) (((double) this.TimeLeft - 285.0) / 15.0)) : 1f; + } + } + + public float Alpha + { + get + { + float scale = this.Scale; + return (double) scale <= 0.5 ? 0.0f : (float) (((double) scale - 0.5) / 0.5); + } + } + + public void ApplyHeight(ref Vector2 v) => v.Y -= 50f * this.Alpha; + } + } +} diff --git a/UI/Alignment.cs b/UI/Alignment.cs deleted file mode 100644 index 5018641..0000000 --- a/UI/Alignment.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.UI.Alignment -// 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.UI -{ - public struct Alignment - { - public static readonly Alignment TopLeft = new Alignment(0.0f, 0.0f); - public static readonly Alignment Top = new Alignment(0.5f, 0.0f); - public static readonly Alignment TopRight = new Alignment(1f, 0.0f); - public static readonly Alignment Left = new Alignment(0.0f, 0.5f); - public static readonly Alignment Center = new Alignment(0.5f, 0.5f); - public static readonly Alignment Right = new Alignment(1f, 0.5f); - public static readonly Alignment BottomLeft = new Alignment(0.0f, 1f); - public static readonly Alignment Bottom = new Alignment(0.5f, 1f); - public static readonly Alignment BottomRight = new Alignment(1f, 1f); - public readonly float VerticalOffsetMultiplier; - public readonly float HorizontalOffsetMultiplier; - - public Vector2 OffsetMultiplier => new Vector2(this.HorizontalOffsetMultiplier, this.VerticalOffsetMultiplier); - - private Alignment(float horizontal, float vertical) - { - this.HorizontalOffsetMultiplier = horizontal; - this.VerticalOffsetMultiplier = vertical; - } - } -} diff --git a/UI/CalculatedStyle.cs b/UI/CalculatedStyle.cs index 4789670..f682465 100644 --- a/UI/CalculatedStyle.cs +++ b/UI/CalculatedStyle.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.CalculatedStyle -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/UI/Chat/ChatLine.cs b/UI/Chat/ChatLine.cs index dcf7cfa..793cd98 100644 --- a/UI/Chat/ChatLine.cs +++ b/UI/Chat/ChatLine.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.Chat.ChatLine -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -12,30 +12,7 @@ namespace Terraria.UI.Chat { public Color color = Color.White; public int showTime; - public string originalText = ""; + public string text = ""; public TextSnippet[] parsedText = new TextSnippet[0]; - private int? parsingPixelLimit; - private bool needsParsing; - - public void UpdateTimeLeft() - { - if (this.showTime > 0) - --this.showTime; - if (!this.needsParsing) - return; - this.needsParsing = false; - } - - public void Copy(ChatLine other) - { - this.needsParsing = other.needsParsing; - this.parsingPixelLimit = other.parsingPixelLimit; - this.originalText = other.originalText; - this.parsedText = other.parsedText; - this.showTime = other.showTime; - this.color = other.color; - } - - public void FlagAsNeedsReprocessing() => this.needsParsing = true; } } diff --git a/UI/Chat/ChatManager.cs b/UI/Chat/ChatManager.cs index 77200b1..1d71a2e 100644 --- a/UI/Chat/ChatManager.cs +++ b/UI/Chat/ChatManager.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.Chat.ChatManager -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -64,7 +64,6 @@ namespace Terraria.UI.Chat public static List ParseMessage(string text, Color baseColor) { - text = text.Replace("\r", ""); MatchCollection matchCollection = ChatManager.Regexes.Format.Matches(text); List textSnippetList = new List(); int startIndex = 0; @@ -229,56 +228,41 @@ namespace Terraria.UI.Chat } else { - snippet.Text.Split('\n'); - string[] strArray1 = Regex.Split(snippet.Text, "(\n)"); - bool flag = true; - for (int index2 = 0; index2 < strArray1.Length; ++index2) + string[] strArray1 = snippet.Text.Split('\n'); + foreach (string str in strArray1) { - string input = strArray1[index2]; - Regex.Split(input, "( )"); - string[] strArray2 = input.Split(' '); - if (input == "\n") + char[] chArray = new char[1]{ ' ' }; + string[] strArray2 = str.Split(chArray); + for (int index2 = 0; index2 < strArray2.Length; ++index2) + { + if (index2 != 0) + vector2_1.X += x * baseScale.X * scale; + if ((double) maxWidth > 0.0) + { + float num3 = font.MeasureString(strArray2[index2]).X * baseScale.X * scale; + if ((double) vector2_1.X - (double) position.X + (double) num3 > (double) maxWidth) + { + vector2_1.X = position.X; + vector2_1.Y += (float) font.LineSpacing * num2 * baseScale.Y; + vector2_2.Y = Math.Max(vector2_2.Y, vector2_1.Y); + num2 = 0.0f; + } + } + if ((double) num2 < (double) scale) + num2 = scale; + DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, font, strArray2[index2], vector2_1, color, rotation, origin, baseScale * snippet.Scale * scale, SpriteEffects.None, 0.0f); + Vector2 vector2_3 = font.MeasureString(strArray2[index2]); + if (vec.Between(vector2_1, vector2_1 + vector2_3)) + num1 = index1; + vector2_1.X += vector2_3.X * baseScale.X * scale; + vector2_2.X = Math.Max(vector2_2.X, vector2_1.X); + } + if (strArray1.Length > 1) { vector2_1.Y += (float) font.LineSpacing * num2 * baseScale.Y; vector2_1.X = position.X; vector2_2.Y = Math.Max(vector2_2.Y, vector2_1.Y); num2 = 0.0f; - flag = false; - } - else - { - for (int index3 = 0; index3 < strArray2.Length; ++index3) - { - if (index3 != 0) - vector2_1.X += x * baseScale.X * scale; - if ((double) maxWidth > 0.0) - { - float num3 = font.MeasureString(strArray2[index3]).X * baseScale.X * scale; - if ((double) vector2_1.X - (double) position.X + (double) num3 > (double) maxWidth) - { - vector2_1.X = position.X; - vector2_1.Y += (float) font.LineSpacing * num2 * baseScale.Y; - vector2_2.Y = Math.Max(vector2_2.Y, vector2_1.Y); - num2 = 0.0f; - } - } - if ((double) num2 < (double) scale) - num2 = scale; - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, font, strArray2[index3], vector2_1, color, rotation, origin, baseScale * snippet.Scale * scale, SpriteEffects.None, 0.0f); - Vector2 vector2_3 = font.MeasureString(strArray2[index3]); - if (vec.Between(vector2_1, vector2_1 + vector2_3)) - num1 = index1; - vector2_1.X += vector2_3.X * baseScale.X * scale; - vector2_2.X = Math.Max(vector2_2.X, vector2_1.X); - } - if (strArray1.Length > 1 & flag) - { - vector2_1.Y += (float) font.LineSpacing * num2 * baseScale.Y; - vector2_1.X = position.X; - vector2_2.Y = Math.Max(vector2_2.Y, vector2_1.Y); - num2 = 0.0f; - } - flag = true; } } } @@ -303,23 +287,6 @@ namespace Terraria.UI.Chat return ChatManager.DrawColorCodedString(spriteBatch, font, snippets, position, Color.White, rotation, origin, baseScale, out hoveredSnippet, maxWidth); } - public static Vector2 DrawColorCodedStringWithShadow( - SpriteBatch spriteBatch, - DynamicSpriteFont font, - TextSnippet[] snippets, - Vector2 position, - float rotation, - Color color, - Vector2 origin, - Vector2 baseScale, - out int hoveredSnippet, - float maxWidth = -1f, - float spread = 2f) - { - ChatManager.DrawColorCodedStringShadow(spriteBatch, font, snippets, position, Color.Black, rotation, origin, baseScale, maxWidth, spread); - return ChatManager.DrawColorCodedString(spriteBatch, font, snippets, position, color, rotation, origin, baseScale, out hoveredSnippet, maxWidth, true); - } - public static void DrawColorCodedStringShadow( SpriteBatch spriteBatch, DynamicSpriteFont font, @@ -423,7 +390,7 @@ namespace Terraria.UI.Chat { TextSnippet[] array = ChatManager.ParseMessage(text, baseColor).ToArray(); ChatManager.ConvertNormalSnippets(array); - ChatManager.DrawColorCodedStringShadow(spriteBatch, font, array, position, new Color(0, 0, 0, (int) baseColor.A), rotation, origin, baseScale, maxWidth, spread); + ChatManager.DrawColorCodedStringShadow(spriteBatch, font, array, position, Color.Black, rotation, origin, baseScale, maxWidth, spread); return ChatManager.DrawColorCodedString(spriteBatch, font, array, position, Color.White, rotation, origin, baseScale, out int _, maxWidth); } diff --git a/UI/Chat/ChatMessageContainer.cs b/UI/Chat/ChatMessageContainer.cs deleted file mode 100644 index fffe317..0000000 --- a/UI/Chat/ChatMessageContainer.cs +++ /dev/null @@ -1,64 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.UI.Chat.ChatMessageContainer -// 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; -using System.Collections.Generic; -using Terraria.GameContent; - -namespace Terraria.UI.Chat -{ - public class ChatMessageContainer - { - public string OriginalText; - private bool _prepared; - private List _parsedText; - private Color _color; - private int _widthLimitInPixels; - private int _timeLeft; - - public void SetContents(string text, Color color, int widthLimitInPixels) - { - this.OriginalText = text; - this._color = color; - this._widthLimitInPixels = widthLimitInPixels; - this.MarkToNeedRefresh(); - this._parsedText = new List(); - this._timeLeft = 600; - this.Refresh(); - } - - public void MarkToNeedRefresh() => this._prepared = false; - - public void Update() - { - if (this._timeLeft > 0) - --this._timeLeft; - this.Refresh(); - } - - public TextSnippet[] GetSnippetWithInversedIndex(int snippetIndex) => this._parsedText[this._parsedText.Count - 1 - snippetIndex]; - - public int LineCount => this._parsedText.Count; - - public bool CanBeShownWhenChatIsClosed => this._timeLeft > 0; - - public bool Prepared => this._prepared; - - public void Refresh() - { - if (this._prepared) - return; - this._prepared = true; - int maxWidth = this._widthLimitInPixels; - if (maxWidth == -1) - maxWidth = Main.screenWidth - 320; - List> textSnippetListList = Utils.WordwrapStringSmart(this.OriginalText, this._color, FontAssets.MouseText.Value, maxWidth, 10); - this._parsedText.Clear(); - for (int index = 0; index < textSnippetListList.Count; ++index) - this._parsedText.Add(textSnippetListList[index].ToArray()); - } - } -} diff --git a/UI/Chat/ITagHandler.cs b/UI/Chat/ITagHandler.cs index 2a5b0f9..5c06127 100644 --- a/UI/Chat/ITagHandler.cs +++ b/UI/Chat/ITagHandler.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.Chat.ITagHandler -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/UI/Chat/TextSnippet.cs b/UI/Chat/TextSnippet.cs index 3cb761b..8975927 100644 --- a/UI/Chat/TextSnippet.cs +++ b/UI/Chat/TextSnippet.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.Chat.TextSnippet -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -67,7 +67,5 @@ namespace Terraria.UI.Chat } public virtual float GetStringLength(DynamicSpriteFont font) => font.MeasureString(this.Text).X * this.Scale; - - public override string ToString() => "Text: " + this.Text + " | OriginalText: " + this.TextOriginal; } } diff --git a/UI/ChestUI.cs b/UI/ChestUI.cs index 261e06e..f71cf4d 100644 --- a/UI/ChestUI.cs +++ b/UI/ChestUI.cs @@ -1,17 +1,14 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.ChestUI -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using System.Collections.Generic; -using Terraria.Audio; -using Terraria.GameContent; using Terraria.GameInput; -using Terraria.Localization; using Terraria.UI.Chat; using Terraria.UI.Gamepad; @@ -29,7 +26,7 @@ namespace Terraria.UI if (hovering) { if (!ChestUI.ButtonHovered[ID]) - SoundEngine.PlaySound(12); + Main.PlaySound(12); ChestUI.ButtonHovered[ID] = true; ChestUI.ButtonScale[ID] += 0.05f; if ((double) ChestUI.ButtonScale[ID] <= 1.0) @@ -90,21 +87,13 @@ namespace Terraria.UI Main.chest[player.chest] = new Chest(); Chest chest = Main.chest[player.chest]; if (chest.name != "") - { text = chest.name; - } - else - { - Tile tile = Main.tile[player.chestX, player.chestY]; - if (tile.type == (ushort) 21) - text = Lang.chestType[(int) tile.frameX / 36].Value; - else if (tile.type == (ushort) 467 && (int) tile.frameX / 36 == 4) - text = Lang.GetItemNameValue(3988); - else if (tile.type == (ushort) 467) - text = Lang.chestType2[(int) tile.frameX / 36].Value; - else if (tile.type == (ushort) 88) - text = Lang.dresserType[(int) tile.frameX / 54].Value; - } + else if (Main.tile[player.chestX, player.chestY].type == (ushort) 21) + text = Lang.chestType[(int) Main.tile[player.chestX, player.chestY].frameX / 36].Value; + else if (Main.tile[player.chestX, player.chestY].type == (ushort) 467) + text = Lang.chestType2[(int) Main.tile[player.chestX, player.chestY].frameX / 36].Value; + else if (Main.tile[player.chestX, player.chestY].type == (ushort) 88) + text = Lang.dresserType[(int) Main.tile[player.chestX, player.chestY].frameX / 54].Value; } else if (player.chest == -2) text = Lang.inter[32].Value; @@ -112,16 +101,14 @@ namespace Terraria.UI text = Lang.inter[33].Value; else if (player.chest == -4) text = Lang.GetItemNameValue(3813); - else if (player.chest == -5) - text = Lang.GetItemNameValue(4076); Color color = new Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor); Color baseColor = Color.White * (float) (1.0 - ((double) byte.MaxValue - (double) Main.mouseTextColor) / (double) byte.MaxValue * 0.5); baseColor.A = byte.MaxValue; int lineAmount; - Utils.WordwrapString(text, FontAssets.MouseText.Value, 200, 1, out lineAmount); - int num = lineAmount + 1; - for (int index = 0; index < num; ++index) - ChatManager.DrawColorCodedStringWithShadow(spritebatch, FontAssets.MouseText.Value, text, new Vector2(504f, (float) (Main.instance.invBottom + index * 26)), baseColor, 0.0f, Vector2.Zero, Vector2.One, spread: 1.5f); + Utils.WordwrapString(text, Main.fontMouseText, 200, 1, out lineAmount); + ++lineAmount; + for (int index = 0; index < lineAmount; ++index) + ChatManager.DrawColorCodedStringWithShadow(spritebatch, Main.fontMouseText, text, new Vector2(504f, (float) (Main.instance.invBottom + index * 26)), baseColor, 0.0f, Vector2.Zero, Vector2.One, spread: 1.5f); } private static void DrawButtons(SpriteBatch spritebatch) @@ -134,18 +121,13 @@ namespace Terraria.UI { Player player = Main.player[Main.myPlayer]; if (ID == 5 && player.chest < -1 || ID == 6 && !Main.editChest) - ChestUI.UpdateHover(ID, false); - else if (ID == 7 && player.chest != -5) { ChestUI.UpdateHover(ID, false); } else { - int num1 = ID; - if (ID == 7) - num1 = 5; - Y += num1 * 26; - float num2 = ChestUI.ButtonScale[ID]; + Y += ID * 26; + float num = ChestUI.ButtonScale[ID]; string text = ""; switch (ID) { @@ -170,38 +152,30 @@ namespace Terraria.UI case 6: text = Lang.inter[63].Value; break; - case 7: - text = !player.IsVoidVaultEnabled ? Language.GetTextValue("UI.ToggleBank4VacuumIsOff") : Language.GetTextValue("UI.ToggleBank4VacuumIsOn"); - break; } - Vector2 vector2_1 = FontAssets.MouseText.Value.MeasureString(text); - Color color = new Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor) * num2; + Vector2 vector2_1 = Main.fontMouseText.MeasureString(text); + Color color = new Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor) * num; Color baseColor = Color.White * 0.97f * (float) (1.0 - ((double) byte.MaxValue - (double) Main.mouseTextColor) / (double) byte.MaxValue * 0.5); baseColor.A = byte.MaxValue; - X += (int) ((double) vector2_1.X * (double) num2 / 2.0); - bool flag = Utils.FloatIntersect((float) Main.mouseX, (float) Main.mouseY, 0.0f, 0.0f, (float) X - vector2_1.X / 2f, (float) (Y - 12), vector2_1.X, 24f); - if (ChestUI.ButtonHovered[ID]) - flag = Utils.FloatIntersect((float) Main.mouseX, (float) Main.mouseY, 0.0f, 0.0f, (float) ((double) X - (double) vector2_1.X / 2.0 - 10.0), (float) (Y - 12), vector2_1.X + 16f, 24f); - if (flag) - baseColor = Main.OurFavoriteColor; - ChatManager.DrawColorCodedStringWithShadow(spriteBatch, FontAssets.MouseText.Value, text, new Vector2((float) X, (float) Y), baseColor, 0.0f, vector2_1 / 2f, new Vector2(num2), spread: 1.5f); - Vector2 vector2_2 = vector2_1 * num2; + X += (int) ((double) vector2_1.X * (double) num / 2.0); + ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontMouseText, text, new Vector2((float) X, (float) Y), baseColor, 0.0f, vector2_1 / 2f, new Vector2(num), spread: 1.5f); + Vector2 vector2_2 = vector2_1 * num; switch (ID) { case 0: - UILinkPointNavigator.SetPosition(500, new Vector2((float) X - (float) ((double) vector2_2.X * (double) num2 / 2.0 * 0.800000011920929), (float) Y)); + UILinkPointNavigator.SetPosition(500, new Vector2((float) X - (float) ((double) vector2_2.X * (double) num / 2.0 * 0.800000011920929), (float) Y)); break; case 1: - UILinkPointNavigator.SetPosition(501, new Vector2((float) X - (float) ((double) vector2_2.X * (double) num2 / 2.0 * 0.800000011920929), (float) Y)); + UILinkPointNavigator.SetPosition(501, new Vector2((float) X - (float) ((double) vector2_2.X * (double) num / 2.0 * 0.800000011920929), (float) Y)); break; case 2: - UILinkPointNavigator.SetPosition(502, new Vector2((float) X - (float) ((double) vector2_2.X * (double) num2 / 2.0 * 0.800000011920929), (float) Y)); + UILinkPointNavigator.SetPosition(502, new Vector2((float) X - (float) ((double) vector2_2.X * (double) num / 2.0 * 0.800000011920929), (float) Y)); break; case 3: - UILinkPointNavigator.SetPosition(503, new Vector2((float) X - (float) ((double) vector2_2.X * (double) num2 / 2.0 * 0.800000011920929), (float) Y)); + UILinkPointNavigator.SetPosition(503, new Vector2((float) X - (float) ((double) vector2_2.X * (double) num / 2.0 * 0.800000011920929), (float) Y)); break; case 4: - UILinkPointNavigator.SetPosition(505, new Vector2((float) X - (float) ((double) vector2_2.X * (double) num2 / 2.0 * 0.800000011920929), (float) Y)); + UILinkPointNavigator.SetPosition(505, new Vector2((float) X - (float) ((double) vector2_2.X * (double) num / 2.0 * 0.800000011920929), (float) Y)); break; case 5: UILinkPointNavigator.SetPosition(504, new Vector2((float) X, (float) Y)); @@ -209,11 +183,8 @@ namespace Terraria.UI case 6: UILinkPointNavigator.SetPosition(504, new Vector2((float) X, (float) Y)); break; - case 7: - UILinkPointNavigator.SetPosition(506, new Vector2((float) X - (float) ((double) vector2_2.X * (double) num2 / 2.0 * 0.800000011920929), (float) Y)); - break; } - if (!flag) + if (!Utils.FloatIntersect((float) Main.mouseX, (float) Main.mouseY, 0.0f, 0.0f, (float) X - vector2_2.X / 2f, (float) Y - vector2_2.Y / 2f, vector2_2.X, vector2_2.Y)) { ChestUI.UpdateHover(ID, false); } @@ -248,21 +219,12 @@ namespace Terraria.UI case 6: ChestUI.RenameChestCancel(); break; - case 7: - ChestUI.ToggleVacuum(); - break; } Recipe.FindRecipes(); } } } - private static void ToggleVacuum() - { - Player player = Main.player[Main.myPlayer]; - player.IsVoidVaultEnabled = !player.IsVoidVaultEnabled; - } - private static void DrawSlots(SpriteBatch spriteBatch) { Player player = Main.player[Main.myPlayer]; @@ -288,11 +250,6 @@ namespace Terraria.UI context = 4; inv = player.bank3.item; } - if (player.chest == -5) - { - context = 4; - inv = player.bank4.item; - } Main.inventoryScale = 0.755f; if (Utils.FloatIntersect((float) Main.mouseX, (float) Main.mouseY, 0.0f, 0.0f, 73f, (float) Main.instance.invBottom, 560f * Main.inventoryScale, 224f * Main.inventoryScale) && !PlayerInput.IgnoreMouseInterface) player.mouseInterface = true; @@ -304,7 +261,7 @@ namespace Terraria.UI int num2 = (int) ((double) Main.instance.invBottom + (double) (index2 * 56) * (double) Main.inventoryScale); int slot = index1 + index2 * 10; Color color = new Color(100, 100, 100, 100); - if (Utils.FloatIntersect((float) Main.mouseX, (float) Main.mouseY, 0.0f, 0.0f, (float) num1, (float) num2, (float) TextureAssets.InventoryBack.Width() * Main.inventoryScale, (float) TextureAssets.InventoryBack.Height() * Main.inventoryScale) && !PlayerInput.IgnoreMouseInterface) + if (Utils.FloatIntersect((float) Main.mouseX, (float) Main.mouseY, 0.0f, 0.0f, (float) num1, (float) num2, (float) Main.inventoryBackTexture.Width * Main.inventoryScale, (float) Main.inventoryBackTexture.Height * Main.inventoryScale) && !PlayerInput.IgnoreMouseInterface) { player.mouseInterface = true; ItemSlot.Handle(inv, context, slot); @@ -316,7 +273,6 @@ namespace Terraria.UI public static void LootAll() { - GetItemSettings lootAllSettings = GetItemSettings.LootAllSettings; Player player = Main.player[Main.myPlayer]; if (player.chest > -1) { @@ -326,7 +282,7 @@ namespace Terraria.UI if (chest.item[index].type > 0) { chest.item[index].position = player.Center; - chest.item[index] = player.GetItem(Main.myPlayer, chest.item[index], lootAllSettings); + chest.item[index] = player.GetItem(Main.myPlayer, chest.item[index]); if (Main.netMode == 1) NetMessage.SendData(32, number: player.chest, number2: ((float) index)); } @@ -339,7 +295,7 @@ namespace Terraria.UI if (player.bank2.item[index].type > 0) { player.bank2.item[index].position = player.Center; - player.bank2.item[index] = player.GetItem(Main.myPlayer, player.bank2.item[index], lootAllSettings); + player.bank2.item[index] = player.GetItem(Main.myPlayer, player.bank2.item[index]); } } } @@ -350,18 +306,7 @@ namespace Terraria.UI if (player.bank3.item[index].type > 0) { player.bank3.item[index].position = player.Center; - player.bank3.item[index] = player.GetItem(Main.myPlayer, player.bank3.item[index], lootAllSettings); - } - } - } - else if (player.chest == -5) - { - for (int index = 0; index < 40; ++index) - { - if (player.bank4.item[index].type > 0) - { - player.bank4.item[index].position = player.Center; - player.bank4.item[index] = player.GetItem(Main.myPlayer, player.bank4.item[index], lootAllSettings); + player.bank3.item[index] = player.GetItem(Main.myPlayer, player.bank3.item[index]); } } } @@ -372,7 +317,7 @@ namespace Terraria.UI if (player.bank.item[index].type > 0) { player.bank.item[index].position = player.Center; - player.bank.item[index] = player.GetItem(Main.myPlayer, player.bank.item[index], lootAllSettings); + player.bank.item[index] = player.GetItem(Main.myPlayer, player.bank.item[index]); } } } @@ -387,8 +332,6 @@ namespace Terraria.UI ChestUI.MoveCoins(player.inventory, player.bank2.item); else if (player.chest == -4) ChestUI.MoveCoins(player.inventory, player.bank3.item); - else if (player.chest == -5) - ChestUI.MoveCoins(player.inventory, player.bank4.item); else ChestUI.MoveCoins(player.inventory, player.bank.item); for (int index1 = 49; index1 >= 10; --index1) @@ -409,7 +352,7 @@ namespace Terraria.UI num = chest.item[index2].maxStack - chest.item[index2].stack; player.inventory[index1].stack -= num; chest.item[index2].stack += num; - SoundEngine.PlaySound(7); + Main.PlaySound(7); if (player.inventory[index1].stack <= 0) { player.inventory[index1].SetDefaults(); @@ -438,7 +381,7 @@ namespace Terraria.UI num = player.bank2.item[index2].maxStack - player.bank2.item[index2].stack; player.inventory[index1].stack -= num; player.bank2.item[index2].stack += num; - SoundEngine.PlaySound(7); + Main.PlaySound(7); if (player.inventory[index1].stack <= 0) { player.inventory[index1].SetDefaults(); @@ -460,7 +403,7 @@ namespace Terraria.UI num = player.bank3.item[index2].maxStack - player.bank3.item[index2].stack; player.inventory[index1].stack -= num; player.bank3.item[index2].stack += num; - SoundEngine.PlaySound(7); + Main.PlaySound(7); if (player.inventory[index1].stack <= 0) { player.inventory[index1].SetDefaults(); @@ -473,28 +416,6 @@ namespace Terraria.UI } } } - else if (player.chest == -5) - { - if (player.bank4.item[index2].stack < player.bank4.item[index2].maxStack && player.inventory[index1].IsTheSameAs(player.bank4.item[index2])) - { - int num = player.inventory[index1].stack; - if (player.inventory[index1].stack + player.bank4.item[index2].stack > player.bank4.item[index2].maxStack) - num = player.bank4.item[index2].maxStack - player.bank4.item[index2].stack; - player.inventory[index1].stack -= num; - player.bank4.item[index2].stack += num; - SoundEngine.PlaySound(7); - if (player.inventory[index1].stack <= 0) - { - player.inventory[index1].SetDefaults(); - break; - } - if (player.bank4.item[index2].type == 0) - { - player.bank4.item[index2] = player.inventory[index1].Clone(); - player.inventory[index1].SetDefaults(); - } - } - } else if (player.bank.item[index2].stack < player.bank.item[index2].maxStack && player.inventory[index1].IsTheSameAs(player.bank.item[index2])) { int num = player.inventory[index1].stack; @@ -502,7 +423,7 @@ namespace Terraria.UI num = player.bank.item[index2].maxStack - player.bank.item[index2].stack; player.inventory[index1].stack -= num; player.bank.item[index2].stack += num; - SoundEngine.PlaySound(7); + Main.PlaySound(7); if (player.inventory[index1].stack <= 0) { player.inventory[index1].SetDefaults(); @@ -524,7 +445,7 @@ namespace Terraria.UI { if (Main.chest[player.chest].item[index3].stack == 0) { - SoundEngine.PlaySound(7); + Main.PlaySound(7); Main.chest[player.chest].item[index3] = player.inventory[index1].Clone(); player.inventory[index1].SetDefaults(); if (Main.netMode == 1) @@ -542,7 +463,7 @@ namespace Terraria.UI { if (player.bank2.item[index4].stack == 0) { - SoundEngine.PlaySound(7); + Main.PlaySound(7); player.bank2.item[index4] = player.inventory[index1].Clone(); player.inventory[index1].SetDefaults(); break; @@ -555,34 +476,21 @@ namespace Terraria.UI { if (player.bank3.item[index5].stack == 0) { - SoundEngine.PlaySound(7); + Main.PlaySound(7); player.bank3.item[index5] = player.inventory[index1].Clone(); player.inventory[index1].SetDefaults(); break; } } } - else if (player.chest == -5) - { - for (int index6 = 0; index6 < 40; ++index6) - { - if (player.bank4.item[index6].stack == 0) - { - SoundEngine.PlaySound(7); - player.bank4.item[index6] = player.inventory[index1].Clone(); - player.inventory[index1].SetDefaults(); - break; - } - } - } else { - for (int index7 = 0; index7 < 40; ++index7) + for (int index6 = 0; index6 < 40; ++index6) { - if (player.bank.item[index7].stack == 0) + if (player.bank.item[index6].stack == 0) { - SoundEngine.PlaySound(7); - player.bank.item[index7] = player.inventory[index1].Clone(); + Main.PlaySound(7); + player.bank.item[index6] = player.inventory[index1].Clone(); player.inventory[index1].SetDefaults(); break; } @@ -596,9 +504,7 @@ namespace Terraria.UI public static void QuickStack() { Player player = Main.player[Main.myPlayer]; - if (player.chest == -5) - ChestUI.MoveCoins(player.inventory, player.bank4.item); - else if (player.chest == -4) + if (player.chest == -4) ChestUI.MoveCoins(player.inventory, player.bank3.item); else if (player.chest == -3) ChestUI.MoveCoins(player.inventory, player.bank2.item); @@ -614,8 +520,6 @@ namespace Terraria.UI objArray = player.bank2.item; else if (player.chest == -4) objArray = player.bank3.item; - else if (player.chest == -5) - objArray = player.bank4.item; List intList1 = new List(); List intList2 = new List(); List intList3 = new List(); @@ -624,7 +528,7 @@ namespace Terraria.UI bool[] flagArray = new bool[objArray.Length]; for (int index = 0; index < 40; ++index) { - if (objArray[index].type > 0 && objArray[index].stack > 0 && (objArray[index].type < 71 || objArray[index].type > 74)) + if (objArray[index].type > 0 && objArray[index].stack > 0 && objArray[index].maxStack > 1 && (objArray[index].type < 71 || objArray[index].type > 74)) { intList2.Add(index); intList1.Add(objArray[index].netID); @@ -635,7 +539,7 @@ namespace Terraria.UI int num1 = 50; if (player.chest <= -2) num1 += 4; - for (int key = 10; key < num1; ++key) + for (int key = 0; key < num1; ++key) { if (intList1.Contains(inventory[key].netID) && !inventory[key].favorited) dictionary.Add(key, inventory[key].netID); @@ -654,7 +558,7 @@ namespace Terraria.UI { if (num2 > num3) num2 = num3; - SoundEngine.PlaySound(7); + Main.PlaySound(7); objArray[index2].stack += num2; inventory[keyValuePair.Key].stack -= num2; if (inventory[keyValuePair.Key].stack == 0) @@ -678,38 +582,35 @@ namespace Terraria.UI int index4 = intList3[index3]; bool flag = true; int netId = objArray[index4].netID; - if (netId < 71 || netId > 74) + foreach (KeyValuePair keyValuePair in dictionary) { - foreach (KeyValuePair keyValuePair in dictionary) + if (keyValuePair.Value == netId && inventory[keyValuePair.Key].netID == netId || flag && inventory[keyValuePair.Key].stack > 0) { - if (keyValuePair.Value == netId && inventory[keyValuePair.Key].netID == netId || flag && inventory[keyValuePair.Key].stack > 0) + Main.PlaySound(7); + if (flag) { - SoundEngine.PlaySound(7); - if (flag) + netId = keyValuePair.Value; + objArray[index4] = inventory[keyValuePair.Key]; + inventory[keyValuePair.Key] = new Item(); + } + else + { + int num4 = inventory[keyValuePair.Key].stack; + int num5 = objArray[index4].maxStack - objArray[index4].stack; + if (num5 != 0) { - netId = keyValuePair.Value; - objArray[index4] = inventory[keyValuePair.Key]; - inventory[keyValuePair.Key] = new Item(); + if (num4 > num5) + num4 = num5; + objArray[index4].stack += num4; + inventory[keyValuePair.Key].stack -= num4; + if (inventory[keyValuePair.Key].stack == 0) + inventory[keyValuePair.Key] = new Item(); } else - { - int num4 = inventory[keyValuePair.Key].stack; - int num5 = objArray[index4].maxStack - objArray[index4].stack; - if (num5 != 0) - { - if (num4 > num5) - num4 = num5; - objArray[index4].stack += num4; - inventory[keyValuePair.Key].stack -= num4; - if (inventory[keyValuePair.Key].stack == 0) - inventory[keyValuePair.Key] = new Item(); - } - else - break; - } - flagArray[index4] = true; - flag = false; + break; } + flagArray[index4] = true; + flag = false; } } } @@ -736,11 +637,9 @@ namespace Terraria.UI public static void RenameChestSubmit(Player player) { - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.editChest = false; int chest = player.chest; - if (chest < 0) - return; if (Main.npcChatText == Main.defaultChestName) Main.npcChatText = ""; if (!(Main.chest[chest].name != Main.npcChatText)) @@ -753,7 +652,7 @@ namespace Terraria.UI public static void RenameChestCancel() { - SoundEngine.PlaySound(12); + Main.PlaySound(12); Main.editChest = false; Main.npcChatText = string.Empty; Main.blockKey = Keys.Escape.ToString(); @@ -772,8 +671,6 @@ namespace Terraria.UI objArray = player.bank2.item; else if (player.chest == -4) objArray = player.bank3.item; - else if (player.chest == -5) - objArray = player.bank4.item; HashSet intSet = new HashSet(); List intList1 = new List(); List intList2 = new List(); @@ -854,16 +751,15 @@ namespace Terraria.UI } if (!flag1) return; - SoundEngine.PlaySound(7); + Main.PlaySound(7); } public static void MoveCoins(Item[] pInv, Item[] cInv) { - bool flag1 = false; int[] numArray1 = new int[4]; List intList1 = new List(); List intList2 = new List(); - bool flag2 = false; + bool flag = false; int[] numArray2 = new int[40]; for (int index = 0; index < cInv.Length; ++index) { @@ -890,12 +786,13 @@ namespace Terraria.UI numArray1[num - 1] += cInv[index].stack; intList2.Add(index); cInv[index] = new Item(); - flag2 = true; + flag = true; } } } - if (!flag2) + if (!flag) return; + Main.PlaySound(7); for (int index = 0; index < pInv.Length; ++index) { if (index != 58 && pInv[index] != null && pInv[index].stack > 0) @@ -911,7 +808,6 @@ namespace Terraria.UI num = 4; if (num > 0) { - flag1 = true; numArray1[num - 1] += pInv[index].stack; intList1.Add(index); pInv[index] = new Item(); @@ -1005,59 +901,63 @@ namespace Terraria.UI if (pInv[index10].stack > pInv[index10].maxStack) pInv[index10].stack = pInv[index10].maxStack; numArray1[index9] -= pInv[index10].stack; - flag1 = false; - intList1.RemoveAt(0); } if (numArray1[index9] == 0) --index9; + intList1.RemoveAt(0); } - if (!flag1) - return; - SoundEngine.PlaySound(7); } public static bool TryPlacingInChest(Item I, bool justCheck) { - bool sync; - Item[] chestinv; - ChestUI.GetContainerUsageInfo(out sync, out chestinv); - if (ChestUI.IsBlockedFromTransferIntoChest(I, chestinv)) - return false; + bool flag1 = false; Player player = Main.player[Main.myPlayer]; - bool flag = false; + Item[] objArray = player.bank.item; + if (player.chest > -1) + { + objArray = Main.chest[player.chest].item; + flag1 = Main.netMode == 1; + } + else if (player.chest == -2) + objArray = player.bank.item; + else if (player.chest == -3) + objArray = player.bank2.item; + else if (player.chest == -4) + objArray = player.bank3.item; + bool flag2 = false; if (I.maxStack > 1) { for (int index = 0; index < 40; ++index) { - if (chestinv[index].stack < chestinv[index].maxStack && I.IsTheSameAs(chestinv[index])) + if (objArray[index].stack < objArray[index].maxStack && I.IsTheSameAs(objArray[index])) { int num = I.stack; - if (I.stack + chestinv[index].stack > chestinv[index].maxStack) - num = chestinv[index].maxStack - chestinv[index].stack; + if (I.stack + objArray[index].stack > objArray[index].maxStack) + num = objArray[index].maxStack - objArray[index].stack; if (justCheck) { - flag = flag || num > 0; + flag2 = flag2 || num > 0; break; } I.stack -= num; - chestinv[index].stack += num; - SoundEngine.PlaySound(7); + objArray[index].stack += num; + Main.PlaySound(7); if (I.stack <= 0) { I.SetDefaults(); - if (sync) + if (flag1) { NetMessage.SendData(32, number: player.chest, number2: ((float) index)); break; } break; } - if (chestinv[index].type == 0) + if (objArray[index].type == 0) { - chestinv[index] = I.Clone(); + objArray[index] = I.Clone(); I.SetDefaults(); } - if (sync) + if (flag1) NetMessage.SendData(32, number: player.chest, number2: ((float) index)); } } @@ -1066,17 +966,17 @@ namespace Terraria.UI { for (int index = 0; index < 40; ++index) { - if (chestinv[index].stack == 0) + if (objArray[index].stack == 0) { if (justCheck) { - flag = true; + flag2 = true; break; } - SoundEngine.PlaySound(7); - chestinv[index] = I.Clone(); + Main.PlaySound(7); + objArray[index] = I.Clone(); I.SetDefaults(); - if (sync) + if (flag1) { NetMessage.SendData(32, number: player.chest, number2: ((float) index)); break; @@ -1085,37 +985,9 @@ namespace Terraria.UI } } } - return flag; + return flag2; } - public static void GetContainerUsageInfo(out bool sync, out Item[] chestinv) - { - sync = false; - Player player = Main.player[Main.myPlayer]; - chestinv = player.bank.item; - if (player.chest > -1) - { - chestinv = Main.chest[player.chest].item; - sync = Main.netMode == 1; - } - else if (player.chest == -2) - chestinv = player.bank.item; - else if (player.chest == -3) - chestinv = player.bank2.item; - else if (player.chest == -4) - { - chestinv = player.bank3.item; - } - else - { - if (player.chest != -5) - return; - chestinv = player.bank4.item; - } - } - - public static bool IsBlockedFromTransferIntoChest(Item item, Item[] container) => item.type == 3213 && item.favorited && container == Main.LocalPlayer.bank.item || item.type == 4131 && item.favorited && container == Main.LocalPlayer.bank4.item; - public static bool TryPlacingInPlayer(int slot, bool justCheck) { bool flag1 = false; @@ -1133,8 +1005,6 @@ namespace Terraria.UI objArray = player.bank2.item; else if (player.chest == -4) objArray = player.bank3.item; - else if (player.chest == -5) - objArray = player.bank4.item; Item obj = objArray[slot]; bool flag2 = false; if (obj.maxStack > 1) @@ -1153,7 +1023,7 @@ namespace Terraria.UI } obj.stack -= num; inventory[index].stack += num; - SoundEngine.PlaySound(7); + Main.PlaySound(7); if (obj.stack <= 0) { obj.SetDefaults(); @@ -1185,7 +1055,7 @@ namespace Terraria.UI flag2 = true; break; } - SoundEngine.PlaySound(7); + Main.PlaySound(7); inventory[index] = obj.Clone(); obj.SetDefaults(); if (flag1) @@ -1209,7 +1079,6 @@ namespace Terraria.UI public const int Sort = 4; public const int RenameChest = 5; public const int RenameChestCancel = 6; - public const int ToggleVacuum = 7; public const int Count = 7; } } diff --git a/UI/EmptyDiagnosticsUI.cs b/UI/EmptyDiagnosticsUI.cs deleted file mode 100644 index 89d33ba..0000000 --- a/UI/EmptyDiagnosticsUI.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.UI.EmptyDiagnosticsUI -// 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.Graphics; - -namespace Terraria.UI -{ - public class EmptyDiagnosticsUI : INetDiagnosticsUI - { - public void Reset() - { - } - - public void CountReadMessage(int messageId, int messageLength) - { - } - - public void CountSentMessage(int messageId, int messageLength) - { - } - - public void CountReadModuleMessage(int moduleMessageId, int messageLength) - { - } - - public void CountSentModuleMessage(int moduleMessageId, int messageLength) - { - } - - public void Draw(SpriteBatch spriteBatch) - { - } - } -} diff --git a/UI/FancyErrorPrinter.cs b/UI/FancyErrorPrinter.cs deleted file mode 100644 index 972e6ab..0000000 --- a/UI/FancyErrorPrinter.cs +++ /dev/null @@ -1,121 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.UI.FancyErrorPrinter -// 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.Content; -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Windows.Forms; - -namespace Terraria.UI -{ - public class FancyErrorPrinter - { - public static void ShowFailedToLoadAssetError(Exception exception, string filePath) - { - bool flag = false; - if (exception is UnauthorizedAccessException) - flag = true; - if (exception is FileNotFoundException) - flag = true; - if (exception is DirectoryNotFoundException) - flag = true; - if (exception is AssetLoadException) - flag = true; - if (!flag) - return; - StringBuilder text = new StringBuilder(); - text.AppendLine("Failed to load asset: \"" + filePath.Replace("/", "\\") + "\"!"); - List suggestions = new List(); - suggestions.Add("Try verifying integrity of game files via Steam, the asset may be missing."); - suggestions.Add("If you are using an Anti-virus, please make sure it does not block Terraria in any way."); - text.AppendLine(); - text.AppendLine("Suggestions:"); - FancyErrorPrinter.AppendSuggestions(text, suggestions); - text.AppendLine(); - FancyErrorPrinter.IncludeOriginalMessage(text, exception); - FancyErrorPrinter.ShowTheBox(text.ToString()); - Console.WriteLine(text.ToString()); - } - - public static void ShowFileSavingFailError(Exception exception, string filePath) - { - bool flag = false; - if (exception is UnauthorizedAccessException) - flag = true; - if (exception is FileNotFoundException) - flag = true; - if (exception is DirectoryNotFoundException) - flag = true; - if (!flag) - return; - StringBuilder text = new StringBuilder(); - text.AppendLine("Failed to create the file: \"" + filePath.Replace("/", "\\") + "\"!"); - List suggestions = new List(); - suggestions.Add("If you are using an Anti-virus, please make sure it does not block Terraria in any way."); - suggestions.Add("Try making sure your `Documents/My Games/Terraria` folder is not set to 'read-only'."); - suggestions.Add("Try verifying integrity of game files via Steam."); - if (filePath.ToLower().Contains("onedrive")) - suggestions.Add("Try updating OneDrive."); - text.AppendLine(); - text.AppendLine("Suggestions:"); - FancyErrorPrinter.AppendSuggestions(text, suggestions); - text.AppendLine(); - FancyErrorPrinter.IncludeOriginalMessage(text, exception); - FancyErrorPrinter.ShowTheBox(text.ToString()); - Console.WriteLine(text.ToString()); - } - - public static void ShowDirectoryCreationFailError(Exception exception, string folderPath) - { - bool flag = false; - if (exception is UnauthorizedAccessException) - flag = true; - if (exception is FileNotFoundException) - flag = true; - if (exception is DirectoryNotFoundException) - flag = true; - if (!flag) - return; - StringBuilder text = new StringBuilder(); - text.AppendLine("Failed to create the folder: \"" + folderPath.Replace("/", "\\") + "\"!"); - List suggestions = new List(); - suggestions.Add("If you are using an Anti-virus, please make sure it does not block Terraria in any way."); - suggestions.Add("Try making sure your `Documents/My Games/Terraria` folder is not set to 'read-only'."); - suggestions.Add("Try verifying integrity of game files via Steam."); - if (folderPath.ToLower().Contains("onedrive")) - suggestions.Add("Try updating OneDrive."); - text.AppendLine(); - text.AppendLine("Suggestions:"); - FancyErrorPrinter.AppendSuggestions(text, suggestions); - text.AppendLine(); - FancyErrorPrinter.IncludeOriginalMessage(text, exception); - FancyErrorPrinter.ShowTheBox(text.ToString()); - Console.WriteLine((object) exception); - } - - private static void IncludeOriginalMessage(StringBuilder text, Exception exception) - { - text.AppendLine("The original Error below"); - text.Append((object) exception); - } - - private static void AppendSuggestions(StringBuilder text, List suggestions) - { - for (int index = 0; index < suggestions.Count; ++index) - { - string suggestion = suggestions[index]; - text.AppendLine((index + 1).ToString() + ". " + suggestion); - } - } - - private static void ShowTheBox(string preparedMessage) - { - int num = (int) MessageBox.Show(preparedMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); - } - } -} diff --git a/UI/GameInterfaceDrawMethod.cs b/UI/GameInterfaceDrawMethod.cs index d60dce6..5575de4 100644 --- a/UI/GameInterfaceDrawMethod.cs +++ b/UI/GameInterfaceDrawMethod.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.GameInterfaceDrawMethod -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.UI diff --git a/UI/GameInterfaceLayer.cs b/UI/GameInterfaceLayer.cs index 7170fa7..5d24666 100644 --- a/UI/GameInterfaceLayer.cs +++ b/UI/GameInterfaceLayer.cs @@ -1,12 +1,11 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.GameInterfaceLayer -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using Terraria.GameInput; namespace Terraria.UI @@ -40,18 +39,10 @@ namespace Terraria.UI PlayerInput.SetZoom_Unscaled(); transformMatrix = Matrix.Identity; } - bool flag = false; Main.spriteBatch.Begin(SpriteSortMode.Deferred, (BlendState) null, (SamplerState) null, (DepthStencilState) null, (RasterizerState) null, (Effect) null, transformMatrix); - try - { - flag = this.DrawSelf(); - } - catch (Exception ex) - { - TimeLogger.DrawException(ex); - } + int num = this.DrawSelf() ? 1 : 0; Main.spriteBatch.End(); - return flag; + return num != 0; } protected virtual bool DrawSelf() => true; diff --git a/UI/Gamepad/GamepadMainMenuHandler.cs b/UI/Gamepad/GamepadMainMenuHandler.cs index f37675a..04c6041 100644 --- a/UI/Gamepad/GamepadMainMenuHandler.cs +++ b/UI/Gamepad/GamepadMainMenuHandler.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.Gamepad.GamepadMainMenuHandler -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -24,7 +24,7 @@ namespace Terraria.UI.Gamepad { UILinkPage page = UILinkPointNavigator.Pages[1000]; page.CurrentPoint = page.DefaultPoint; - Vector2 vector2 = new Vector2((float) Math.Cos((double) Main.GlobalTimeWrappedHourly * 6.28318548202515), (float) Math.Sin((double) Main.GlobalTimeWrappedHourly * 6.28318548202515 * 2.0)) * new Vector2(30f, 15f) + Vector2.UnitY * 20f; + Vector2 vector2 = new Vector2((float) Math.Cos((double) Main.GlobalTime * 6.28318548202515), (float) Math.Sin((double) Main.GlobalTime * 6.28318548202515 * 2.0)) * new Vector2(30f, 15f) + Vector2.UnitY * 20f; UILinkPointNavigator.SetPosition(2000, new Vector2((float) Main.screenWidth, (float) Main.screenHeight) / 2f + vector2); } else @@ -68,15 +68,14 @@ namespace Terraria.UI.Gamepad page.CurrentPoint = page.DefaultPoint; for (int index = 0; index < GamepadMainMenuHandler.MenuItemPositions.Count; ++index) { - Vector2 vector2 = GamepadMainMenuHandler.MenuItemPositions[index] * Main.UIScale; if (index == 0 && lastMainMenu != GamepadMainMenuHandler.LastMainMenu && PlayerInput.UsingGamepad && Main.InvisibleCursorForGamepad) { - Main.mouseX = PlayerInput.MouseX = (int) vector2.X; - Main.mouseY = PlayerInput.MouseY = (int) vector2.Y; + Main.mouseX = PlayerInput.MouseX = (int) GamepadMainMenuHandler.MenuItemPositions[index].X; + Main.mouseY = PlayerInput.MouseY = (int) GamepadMainMenuHandler.MenuItemPositions[index].Y; Main.menuFocus = -1; } UILinkPoint link = page.LinkMap[2000 + index]; - link.Position = vector2; + link.Position = GamepadMainMenuHandler.MenuItemPositions[index]; link.Up = index != 0 ? 2000 + index - 1 : -1; link.Left = -3; link.Right = -4; diff --git a/UI/Gamepad/GamepadPageID.cs b/UI/Gamepad/GamepadPageID.cs index 0fcd811..a42b31e 100644 --- a/UI/Gamepad/GamepadPageID.cs +++ b/UI/Gamepad/GamepadPageID.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.Gamepad.GamepadPageID -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.UI.Gamepad @@ -19,7 +19,7 @@ namespace Terraria.UI.Gamepad public const int Equipment = 7; public const int Tabs = 8; public const int CraftSmall = 9; - public const int CraftsBig = 10; + public const int CraftBig = 10; public const int HairCustomizationStyle = 11; public const int HairCustomizationColor = 12; public const int NPCShop = 13; @@ -29,13 +29,10 @@ namespace Terraria.UI.Gamepad public const int InfoAccs = 17; public const int BuilderAccs = 18; public const int BuffsOnEquipment = 19; - public const int DisplayDoll = 20; - public const int HatRack = 21; public const int MainMenu = 1000; public const int IngameOptionsLeft = 1001; public const int IngameOptionsRight = 1002; public const int NPCChat = 1003; public const int FancyUI = 1004; - public const int CreativeMenu = 1005; } } diff --git a/UI/Gamepad/GamepadPointID.cs b/UI/Gamepad/GamepadPointID.cs index 591f08c..7597a05 100644 --- a/UI/Gamepad/GamepadPointID.cs +++ b/UI/Gamepad/GamepadPointID.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.Gamepad.GamepadPointID -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.UI.Gamepad @@ -119,9 +119,6 @@ namespace Terraria.UI.Gamepad public const int TabNPCs = 306; public const int TabCamera = 307; public const int TabSettings = 308; - public const int EmoteMenu = 309; - public const int BestiaryMenu = 310; - public const int CreativeMenuToggle = 311; public const int Chest0 = 400; public const int Chest1 = 401; public const int Chest2 = 402; @@ -168,13 +165,10 @@ namespace Terraria.UI.Gamepad public const int ChestActRestock = 503; public const int ChestActRenameChest = 504; public const int ChestSort = 505; - public const int ChestToggleVacuum = 506; public const int NPCHousing0 = 600; public const int CraftsBig = 700; public const int CraftsSmall = 1500; public const int PVP0 = 1550; - public const int PVPShield = 1557; - public const int AchievementAdvisor = 1570; public const int MainMenu = 2000; public const int MenuHack1 = 2001; public const int MenuHack2 = 2002; @@ -198,7 +192,6 @@ namespace Terraria.UI.Gamepad public const int NPCChat0 = 2500; public const int NPCChat1 = 2501; public const int NPCChat2 = 2502; - public const int NPCChat3 = 2503; public const int StylistColorH = 2600; public const int StylistColorS = 2601; public const int StylistColorL = 2602; @@ -206,8 +199,6 @@ namespace Terraria.UI.Gamepad public const int StylistColorClose = 2604; public const int StylistStyle0 = 2605; public const int NPCShop0 = 2700; - public const int NPCShop37 = 2737; - public const int NPCShop38 = 2738; public const int NPCShop39 = 2739; public const int ClothColorH = 2800; public const int ClothColorS = 2801; @@ -219,20 +210,10 @@ namespace Terraria.UI.Gamepad public const int ClothPicker1 = 2807; public const int ClothPicker2 = 2808; public const int ClothPicker3 = 2809; - public const int ClothPicker4 = 2810; - public const int ClothPicker5 = 2811; public const int IngameOptionsLeft0 = 2900; public const int IngameOptionsRight0 = 2930; public const int FancyUI0 = 3000; - public const int FancyUILast = 4999; - public const int HatRack0 = 5000; - public const int HatRack3 = 5003; - public const int DisplayDoll0 = 5100; - public const int DisplayDoll15 = 5115; - public const int BuilderAccs = 6000; + public const int BuilderAccs = 4000; public const int BuffsForEquips = 9000; - public const int CreativeMenu0 = 10000; - public const int CreativeMenuLast = 11000; - public const int CreativeResearchItem0 = 15000; } } diff --git a/UI/Gamepad/UILinkPage.cs b/UI/Gamepad/UILinkPage.cs index ec92abb..c044b87 100644 --- a/UI/Gamepad/UILinkPage.cs +++ b/UI/Gamepad/UILinkPage.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.Gamepad.UILinkPage -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; @@ -32,8 +32,6 @@ namespace Terraria.UI.Gamepad public event Func CanEnterEvent; - public event Action OnPageMoveAttempt; - public UILinkPage() { } @@ -73,19 +71,9 @@ namespace Terraria.UI.Gamepad public void TravelRight() => this.Travel(this.LinkMap[this.CurrentPoint].Right); - public void SwapPageLeft() - { - if (this.OnPageMoveAttempt != null) - this.OnPageMoveAttempt(-1); - UILinkPointNavigator.ChangePage(this.PageOnLeft); - } + public void SwapPageLeft() => UILinkPointNavigator.ChangePage(this.PageOnLeft); - public void SwapPageRight() - { - if (this.OnPageMoveAttempt != null) - this.OnPageMoveAttempt(1); - UILinkPointNavigator.ChangePage(this.PageOnRight); - } + public void SwapPageRight() => UILinkPointNavigator.ChangePage(this.PageOnRight); private void Travel(int next) { diff --git a/UI/Gamepad/UILinkPoint.cs b/UI/Gamepad/UILinkPoint.cs index f14f321..a3dedcf 100644 --- a/UI/Gamepad/UILinkPoint.cs +++ b/UI/Gamepad/UILinkPoint.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.Gamepad.UILinkPoint -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/UI/Gamepad/UILinkPointNavigator.cs b/UI/Gamepad/UILinkPointNavigator.cs index 47219f1..03df5e6 100644 --- a/UI/Gamepad/UILinkPointNavigator.cs +++ b/UI/Gamepad/UILinkPointNavigator.cs @@ -1,16 +1,13 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.Gamepad.UILinkPointNavigator -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using System; using System.Collections.Generic; using System.Linq; -using Terraria.Audio; -using Terraria.DataStructures; -using Terraria.GameContent.Tile_Entities; using Terraria.GameInput; namespace Terraria.UI.Gamepad @@ -21,11 +18,11 @@ namespace Terraria.UI.Gamepad public static Dictionary Points = new Dictionary(); public static int CurrentPage = 1000; public static int OldPage = 1000; - private static int XCooldown; - private static int YCooldown; + private static int XCooldown = 0; + private static int YCooldown = 0; private static Vector2 LastInput; - private static int PageLeftCD; - private static int PageRightCD; + private static int PageLeftCD = 0; + private static int PageRightCD = 0; public static bool InUse; public static int OverridePoint = -1; @@ -35,7 +32,6 @@ namespace Terraria.UI.Gamepad public static void GoToDefaultPage(int specialFlag = 0) { - TileEntity tileEntity = Main.LocalPlayer.tileEntityAnchor.GetTileEntity(); if (Main.MenuUI.IsVisible) UILinkPointNavigator.CurrentPage = 1004; else if (Main.InGameUI.IsVisible || specialFlag == 1) @@ -44,8 +40,6 @@ namespace Terraria.UI.Gamepad UILinkPointNavigator.CurrentPage = 1000; else if (Main.ingameOptionsWindow) UILinkPointNavigator.CurrentPage = 1001; - else if (Main.CreativeMenu.Enabled) - UILinkPointNavigator.CurrentPage = 1005; else if (Main.hairWindow) UILinkPointNavigator.CurrentPage = 12; else if (Main.clothesWindow) @@ -58,10 +52,6 @@ namespace Terraria.UI.Gamepad UILinkPointNavigator.CurrentPage = 5; else if (Main.player[Main.myPlayer].chest != -1) UILinkPointNavigator.CurrentPage = 4; - else if (tileEntity is TEDisplayDoll) - UILinkPointNavigator.CurrentPage = 20; - else if (tileEntity is TEHatRack) - UILinkPointNavigator.CurrentPage = 21; else if (Main.player[Main.myPlayer].talkNPC != -1 || Main.player[Main.myPlayer].sign != -1) UILinkPointNavigator.CurrentPage = 1003; else @@ -126,7 +116,7 @@ namespace Terraria.UI.Gamepad { Main.player[Main.myPlayer].releaseInventory = false; Main.player[Main.myPlayer].releaseUseTile = false; - PlayerInput.LockGamepadTileUseButton = true; + PlayerInput.LockTileUseButton = true; } if (!Main.gameMenu) { @@ -145,14 +135,14 @@ namespace Terraria.UI.Gamepad if (UILinkPointNavigator.PageRightCD > 0) --UILinkPointNavigator.PageRightCD; Vector2 navigatorDirections = PlayerInput.Triggers.Current.GetNavigatorDirections(); - int num1 = !PlayerInput.Triggers.Current.HotbarMinus ? 0 : (!PlayerInput.Triggers.Current.HotbarPlus ? 1 : 0); - bool flag3 = PlayerInput.Triggers.Current.HotbarPlus && !PlayerInput.Triggers.Current.HotbarMinus; - if (num1 == 0) - UILinkPointNavigator.PageLeftCD = 0; + bool flag3 = PlayerInput.Triggers.Current.HotbarMinus && !PlayerInput.Triggers.Current.HotbarPlus; + int num1 = !PlayerInput.Triggers.Current.HotbarPlus ? 0 : (!PlayerInput.Triggers.Current.HotbarMinus ? 1 : 0); if (!flag3) + UILinkPointNavigator.PageLeftCD = 0; + if (num1 == 0) UILinkPointNavigator.PageRightCD = 0; - int num2 = num1 == 0 ? 0 : (UILinkPointNavigator.PageLeftCD == 0 ? 1 : 0); - bool flag4 = flag3 && UILinkPointNavigator.PageRightCD == 0; + bool flag4 = flag3 && UILinkPointNavigator.PageLeftCD == 0; + int num2 = num1 == 0 ? 0 : (UILinkPointNavigator.PageRightCD == 0 ? 1 : 0); if ((double) UILinkPointNavigator.LastInput.X != (double) navigatorDirections.X) UILinkPointNavigator.XCooldown = 0; if ((double) UILinkPointNavigator.LastInput.Y != (double) navigatorDirections.Y) @@ -162,13 +152,13 @@ namespace Terraria.UI.Gamepad if (UILinkPointNavigator.YCooldown > 0) --UILinkPointNavigator.YCooldown; UILinkPointNavigator.LastInput = navigatorDirections; - if (num2 != 0) - UILinkPointNavigator.PageLeftCD = 16; if (flag4) + UILinkPointNavigator.PageLeftCD = 16; + if (num2 != 0) UILinkPointNavigator.PageRightCD = 16; UILinkPointNavigator.Pages[UILinkPointNavigator.CurrentPage].Update(); int num3 = 10; - if (!Main.gameMenu && Main.playerInventory && !Main.ingameOptionsWindow && !Main.inFancyUI && (UILinkPointNavigator.CurrentPage == 0 || UILinkPointNavigator.CurrentPage == 4 || UILinkPointNavigator.CurrentPage == 2 || UILinkPointNavigator.CurrentPage == 1 || UILinkPointNavigator.CurrentPage == 20 || UILinkPointNavigator.CurrentPage == 21)) + if (!Main.gameMenu && Main.playerInventory && !Main.ingameOptionsWindow && !Main.inFancyUI && (UILinkPointNavigator.CurrentPage == 0 || UILinkPointNavigator.CurrentPage == 4 || UILinkPointNavigator.CurrentPage == 2 || UILinkPointNavigator.CurrentPage == 1)) num3 = PlayerInput.CurrentProfile.InventoryMoveCD; if ((double) navigatorDirections.X == -1.0 && UILinkPointNavigator.XCooldown == 0) { @@ -191,9 +181,9 @@ namespace Terraria.UI.Gamepad UILinkPointNavigator.Pages[UILinkPointNavigator.CurrentPage].TravelDown(); } UILinkPointNavigator.XCooldown = UILinkPointNavigator.YCooldown = Math.Max(UILinkPointNavigator.XCooldown, UILinkPointNavigator.YCooldown); - if (num2 != 0) - UILinkPointNavigator.Pages[UILinkPointNavigator.CurrentPage].SwapPageLeft(); if (flag4) + UILinkPointNavigator.Pages[UILinkPointNavigator.CurrentPage].SwapPageLeft(); + if (num2 != 0) UILinkPointNavigator.Pages[UILinkPointNavigator.CurrentPage].SwapPageRight(); if (PlayerInput.Triggers.Current.UsedMovementKey) { @@ -238,13 +228,6 @@ namespace Terraria.UI.Gamepad return str1; } - public static void ForceMovementCooldown(int time) - { - UILinkPointNavigator.LastInput = PlayerInput.Triggers.Current.GetNavigatorDirections(); - UILinkPointNavigator.XCooldown = time; - UILinkPointNavigator.YCooldown = time; - } - public static void SetPosition(int ID, Vector2 Position) => UILinkPointNavigator.Points[ID].Position = Position * Main.UIScale; public static void RegisterPage(UILinkPage page, int ID, bool automatedDefault = true) @@ -265,7 +248,6 @@ namespace Terraria.UI.Gamepad { if (!UILinkPointNavigator.Pages.ContainsKey(PageID) || !UILinkPointNavigator.Pages[PageID].CanEnter()) return; - SoundEngine.PlaySound(12); UILinkPointNavigator.CurrentPage = PageID; UILinkPointNavigator.ProcessChanges(); } @@ -305,7 +287,7 @@ namespace Terraria.UI.Gamepad { public static int NPCS_IconsPerColumn = 100; public static int NPCS_IconsTotal = 0; - public static int NPCS_LastHovered = -2; + public static int NPCS_LastHovered = -1; public static bool NPCS_IconsDisplay = false; public static int CRAFT_IconsPerRow = 100; public static int CRAFT_IconsPerColumn = 100; @@ -315,14 +297,12 @@ namespace Terraria.UI.Gamepad public static bool NPCCHAT_ButtonsLeft = false; public static bool NPCCHAT_ButtonsMiddle = false; public static bool NPCCHAT_ButtonsRight = false; - public static bool NPCCHAT_ButtonsRight2 = false; public static int INGAMEOPTIONS_BUTTONS_LEFT = 0; public static int INGAMEOPTIONS_BUTTONS_RIGHT = 0; - public static bool CREATIVE_ItemSlotShouldHighlightAsSelected = false; - public static int OPTIONS_BUTTON_SPECIALFEATURE; - public static int BackButtonCommand; + public static int OPTIONS_BUTTON_SPECIALFEATURE = 0; + public static int BackButtonCommand = 0; public static bool BackButtonInUse = false; - public static bool BackButtonLock; + public static bool BackButtonLock = false; public static int FANCYUI_HIGHEST_INDEX = 1; public static int FANCYUI_SPECIAL_INSTRUCTIONS = 0; public static int INFOACCCOUNT = 0; diff --git a/UI/IInGameNotification.cs b/UI/IInGameNotification.cs deleted file mode 100644 index 9b9354e..0000000 --- a/UI/IInGameNotification.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.UI.IInGameNotification -// 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; -using Microsoft.Xna.Framework.Graphics; - -namespace Terraria.UI -{ - public interface IInGameNotification - { - object CreationObject { get; } - - bool ShouldBeRemoved { get; } - - void Update(); - - void DrawInGame(SpriteBatch spriteBatch, Vector2 bottomAnchorPosition); - - void PushAnchor(ref Vector2 positionAnchorBottom); - - void DrawInNotificationsArea( - SpriteBatch spriteBatch, - Rectangle area, - ref int gamepadPointLocalIndexTouse); - } -} diff --git a/UI/INetDiagnosticsUI.cs b/UI/INetDiagnosticsUI.cs deleted file mode 100644 index c1bb7f7..0000000 --- a/UI/INetDiagnosticsUI.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.UI.INetDiagnosticsUI -// 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.Graphics; - -namespace Terraria.UI -{ - public interface INetDiagnosticsUI - { - void Reset(); - - void Draw(SpriteBatch spriteBatch); - - void CountReadMessage(int messageId, int messageLength); - - void CountSentMessage(int messageId, int messageLength); - - void CountReadModuleMessage(int moduleMessageId, int messageLength); - - void CountSentModuleMessage(int moduleMessageId, int messageLength); - } -} diff --git a/UI/InGameNotificationsTracker.cs b/UI/InGameNotificationsTracker.cs deleted file mode 100644 index 73c7798..0000000 --- a/UI/InGameNotificationsTracker.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.UI.InGameNotificationsTracker -// 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; -using Microsoft.Xna.Framework.Graphics; -using System.Collections.Generic; -using Terraria.Achievements; -using Terraria.GameInput; -using Terraria.Social; -using Terraria.Social.Base; - -namespace Terraria.UI -{ - public class InGameNotificationsTracker - { - private static List _notifications = new List(); - - public static void Initialize() - { - Main.Achievements.OnAchievementCompleted += new Achievement.AchievementCompleted(InGameNotificationsTracker.AddCompleted); - SocialAPI.JoinRequests.OnRequestAdded += new ServerJoinRequestEvent(InGameNotificationsTracker.JoinRequests_OnRequestAdded); - SocialAPI.JoinRequests.OnRequestRemoved += new ServerJoinRequestEvent(InGameNotificationsTracker.JoinRequests_OnRequestRemoved); - } - - private static void JoinRequests_OnRequestAdded(UserJoinToServerRequest request) => InGameNotificationsTracker.AddJoinRequest(request); - - private static void JoinRequests_OnRequestRemoved(UserJoinToServerRequest request) - { - for (int index = InGameNotificationsTracker._notifications.Count - 1; index >= 0; --index) - { - if (InGameNotificationsTracker._notifications[index].CreationObject == request) - InGameNotificationsTracker._notifications.RemoveAt(index); - } - } - - public static void DrawInGame(SpriteBatch sb) - { - float y = (float) (Main.screenHeight - 40); - if (PlayerInput.UsingGamepad) - y -= 25f; - Vector2 positionAnchorBottom = new Vector2((float) (Main.screenWidth / 2), y); - foreach (IInGameNotification notification in InGameNotificationsTracker._notifications) - { - notification.DrawInGame(sb, positionAnchorBottom); - notification.PushAnchor(ref positionAnchorBottom); - if ((double) positionAnchorBottom.Y < -100.0) - break; - } - } - - public static void DrawInIngameOptions( - SpriteBatch spriteBatch, - Rectangle area, - ref int gamepadPointIdLocalIndexToUse) - { - int num1 = 4; - int height = area.Height / 5 - num1; - Rectangle area1 = new Rectangle(area.X, area.Y, area.Width - 6, height); - int num2 = 0; - foreach (IInGameNotification notification in InGameNotificationsTracker._notifications) - { - notification.DrawInNotificationsArea(spriteBatch, area1, ref gamepadPointIdLocalIndexToUse); - area1.Y += height + num1; - ++num2; - if (num2 >= 5) - break; - } - } - - public static void AddCompleted(Achievement achievement) - { - if (Main.netMode == 2) - return; - InGameNotificationsTracker._notifications.Add((IInGameNotification) new InGamePopups.AchievementUnlockedPopup(achievement)); - } - - public static void AddJoinRequest(UserJoinToServerRequest request) - { - if (Main.netMode == 2) - return; - InGameNotificationsTracker._notifications.Add((IInGameNotification) new InGamePopups.PlayerWantsToJoinGamePopup(request)); - } - - public static void Clear() => InGameNotificationsTracker._notifications.Clear(); - - public static void Update() - { - for (int index = 0; index < InGameNotificationsTracker._notifications.Count; ++index) - { - InGameNotificationsTracker._notifications[index].Update(); - if (InGameNotificationsTracker._notifications[index].ShouldBeRemoved) - { - InGameNotificationsTracker._notifications.Remove(InGameNotificationsTracker._notifications[index]); - --index; - } - } - } - } -} diff --git a/UI/InGamePopups.cs b/UI/InGamePopups.cs deleted file mode 100644 index a0aff0b..0000000 --- a/UI/InGamePopups.cs +++ /dev/null @@ -1,275 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.UI.InGamePopups -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria.Achievements; -using Terraria.GameContent; -using Terraria.GameInput; -using Terraria.Social.Base; - -namespace Terraria.UI -{ - public class InGamePopups - { - public class AchievementUnlockedPopup : IInGameNotification - { - private Achievement _theAchievement; - private Asset _achievementTexture; - private Asset _achievementBorderTexture; - private const int _iconSize = 64; - private const int _iconSizeWithSpace = 66; - private const int _iconsPerRow = 8; - private int _iconIndex; - private Rectangle _achievementIconFrame; - private string _title; - private int _ingameDisplayTimeLeft; - - public bool ShouldBeRemoved { get; private set; } - - public object CreationObject { get; private set; } - - public AchievementUnlockedPopup(Achievement achievement) - { - this.CreationObject = (object) achievement; - this._ingameDisplayTimeLeft = 300; - this._theAchievement = achievement; - this._title = achievement.FriendlyName.Value; - int iconIndex = Main.Achievements.GetIconIndex(achievement.Name); - this._iconIndex = iconIndex; - this._achievementIconFrame = new Rectangle(iconIndex % 8 * 66, iconIndex / 8 * 66, 64, 64); - this._achievementTexture = Main.Assets.Request("Images/UI/Achievements", (AssetRequestMode) 2); - this._achievementBorderTexture = Main.Assets.Request("Images/UI/Achievement_Borders", (AssetRequestMode) 2); - } - - public void Update() - { - --this._ingameDisplayTimeLeft; - if (this._ingameDisplayTimeLeft >= 0) - return; - this._ingameDisplayTimeLeft = 0; - } - - private float Scale - { - get - { - if (this._ingameDisplayTimeLeft < 30) - return MathHelper.Lerp(0.0f, 1f, (float) this._ingameDisplayTimeLeft / 30f); - return this._ingameDisplayTimeLeft > 285 ? MathHelper.Lerp(1f, 0.0f, (float) (((double) this._ingameDisplayTimeLeft - 285.0) / 15.0)) : 1f; - } - } - - private float Opacity - { - get - { - float scale = this.Scale; - return (double) scale <= 0.5 ? 0.0f : (float) (((double) scale - 0.5) / 0.5); - } - } - - public void PushAnchor(ref Vector2 anchorPosition) - { - float num = 50f * this.Opacity; - anchorPosition.Y -= num; - } - - public void DrawInGame(SpriteBatch sb, Vector2 bottomAnchorPosition) - { - float opacity = this.Opacity; - if ((double) opacity <= 0.0) - return; - float num1 = this.Scale * 1.1f; - Vector2 size = (FontAssets.ItemStack.Value.MeasureString(this._title) + new Vector2(58f, 10f)) * num1; - Rectangle rectangle = Utils.CenteredRectangle(bottomAnchorPosition + new Vector2(0.0f, (float) (-(double) size.Y * 0.5)), size); - Vector2 mouseScreen = Main.MouseScreen; - int num2 = rectangle.Contains(mouseScreen.ToPoint()) ? 1 : 0; - Color c = num2 != 0 ? new Color(64, 109, 164) * 0.75f : new Color(64, 109, 164) * 0.5f; - Utils.DrawInvBG(sb, rectangle, c); - float scale = num1 * 0.3f; - Vector2 position = rectangle.Right() - Vector2.UnitX * num1 * (float) (12.0 + (double) scale * (double) this._achievementIconFrame.Width); - sb.Draw(this._achievementTexture.Value, position, new Rectangle?(this._achievementIconFrame), Color.White * opacity, 0.0f, new Vector2(0.0f, (float) (this._achievementIconFrame.Height / 2)), scale, SpriteEffects.None, 0.0f); - sb.Draw(this._achievementBorderTexture.Value, position, new Rectangle?(), Color.White * opacity, 0.0f, new Vector2(0.0f, (float) (this._achievementIconFrame.Height / 2)), scale, SpriteEffects.None, 0.0f); - Color color = new Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor / 5, (int) Main.mouseTextColor); - Utils.DrawBorderString(sb, this._title, position - Vector2.UnitX * 10f, color * opacity, num1 * 0.9f, 1f, 0.4f); - if (num2 == 0) - return; - this.OnMouseOver(); - } - - private void OnMouseOver() - { - if (PlayerInput.IgnoreMouseInterface) - return; - Main.player[Main.myPlayer].mouseInterface = true; - if (!Main.mouseLeft || !Main.mouseLeftRelease) - return; - Main.mouseLeftRelease = false; - IngameFancyUI.OpenAchievementsAndGoto(this._theAchievement); - this._ingameDisplayTimeLeft = 0; - this.ShouldBeRemoved = true; - } - - public void DrawInNotificationsArea( - SpriteBatch spriteBatch, - Rectangle area, - ref int gamepadPointLocalIndexTouse) - { - Utils.DrawInvBG(spriteBatch, area, Color.Red); - } - } - - public class PlayerWantsToJoinGamePopup : IInGameNotification - { - private int _timeLeft; - private const int _timeLeftMax = 1800; - private string _displayTextWithoutTime; - private UserJoinToServerRequest _request; - - private float Scale - { - get - { - if (this._timeLeft < 30) - return MathHelper.Lerp(0.0f, 1f, (float) this._timeLeft / 30f); - return this._timeLeft > 1785 ? MathHelper.Lerp(1f, 0.0f, (float) (((double) this._timeLeft - 1785.0) / 15.0)) : 1f; - } - } - - private float Opacity - { - get - { - float scale = this.Scale; - return (double) scale <= 0.5 ? 0.0f : (float) (((double) scale - 0.5) / 0.5); - } - } - - public object CreationObject { get; private set; } - - public PlayerWantsToJoinGamePopup(UserJoinToServerRequest request) - { - this._request = request; - this.CreationObject = (object) request; - this._timeLeft = 1800; - switch (Main.rand.Next(5)) - { - case 1: - this._displayTextWithoutTime = "This Fucker Wants to Join you"; - break; - case 2: - this._displayTextWithoutTime = "This Weirdo Wants to Join you"; - break; - case 3: - this._displayTextWithoutTime = "This Great Gal Wants to Join you"; - break; - case 4: - this._displayTextWithoutTime = "The one guy who beat you up 30 years ago Wants to Join you"; - break; - default: - this._displayTextWithoutTime = "This Bloke Wants to Join you"; - break; - } - } - - public bool ShouldBeRemoved => this._timeLeft <= 0; - - public void Update() => --this._timeLeft; - - public void DrawInGame(SpriteBatch spriteBatch, Vector2 bottomAnchorPosition) - { - float opacity = this.Opacity; - if ((double) opacity <= 0.0) - return; - string text = Utils.FormatWith(this._request.GetUserWrapperText(), (object) new - { - DisplayName = this._request.UserDisplayName, - FullId = this._request.UserFullIdentifier - }); - float num = this.Scale * 1.1f; - Vector2 size = (FontAssets.ItemStack.Value.MeasureString(text) + new Vector2(58f, 10f)) * num; - Rectangle R = Utils.CenteredRectangle(bottomAnchorPosition + new Vector2(0.0f, (float) (-(double) size.Y * 0.5)), size); - Vector2 mouseScreen = Main.MouseScreen; - Color c = R.Contains(mouseScreen.ToPoint()) ? new Color(64, 109, 164) * 0.75f : new Color(64, 109, 164) * 0.5f; - Utils.DrawInvBG(spriteBatch, R, c); - new Vector2((float) R.Left, (float) R.Center.Y).X += 32f; - Texture2D texture2D1 = Main.Assets.Request("Images/UI/ButtonPlay", (AssetRequestMode) 1).Value; - Vector2 position = new Vector2((float) (R.Left + 7), (float) ((double) MathHelper.Lerp((float) R.Top, (float) R.Bottom, 0.5f) - (double) (texture2D1.Height / 2) - 1.0)); - bool flag1 = Utils.CenteredRectangle(position + new Vector2((float) (texture2D1.Width / 2), 0.0f), texture2D1.Size()).Contains(mouseScreen.ToPoint()); - spriteBatch.Draw(texture2D1, position, new Rectangle?(), Color.White * (flag1 ? 1f : 0.5f), 0.0f, new Vector2(0.0f, 0.5f) * texture2D1.Size(), 1f, SpriteEffects.None, 0.0f); - if (flag1) - this.OnMouseOver(); - Texture2D texture2D2 = Main.Assets.Request("Images/UI/ButtonDelete", (AssetRequestMode) 1).Value; - position = new Vector2((float) (R.Left + 7), (float) ((double) MathHelper.Lerp((float) R.Top, (float) R.Bottom, 0.5f) + (double) (texture2D2.Height / 2) + 1.0)); - bool flag2 = Utils.CenteredRectangle(position + new Vector2((float) (texture2D2.Width / 2), 0.0f), texture2D2.Size()).Contains(mouseScreen.ToPoint()); - spriteBatch.Draw(texture2D2, position, new Rectangle?(), Color.White * (flag2 ? 1f : 0.5f), 0.0f, new Vector2(0.0f, 0.5f) * texture2D2.Size(), 1f, SpriteEffects.None, 0.0f); - if (flag2) - this.OnMouseOver(true); - Color color = new Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor / 5, (int) Main.mouseTextColor); - Utils.DrawBorderString(spriteBatch, text, R.Center.ToVector2() + new Vector2(10f, 0.0f), color * opacity, num * 0.9f, 0.5f, 0.4f); - } - - private void OnMouseOver(bool reject = false) - { - if (PlayerInput.IgnoreMouseInterface) - return; - Main.player[Main.myPlayer].mouseInterface = true; - if (!Main.mouseLeft || !Main.mouseLeftRelease) - return; - Main.mouseLeftRelease = false; - this._timeLeft = 0; - if (reject) - this._request.Reject(); - else - this._request.Accept(); - } - - public void PushAnchor(ref Vector2 positionAnchorBottom) - { - float num = 70f * this.Opacity; - positionAnchorBottom.Y -= num; - } - - public void DrawInNotificationsArea( - SpriteBatch spriteBatch, - Rectangle area, - ref int gamepadPointLocalIndexTouse) - { - string userWrapperText = this._request.GetUserWrapperText(); - string userDisplayName = this._request.UserDisplayName; - Utils.TrimTextIfNeeded(ref userDisplayName, FontAssets.MouseText.Value, 0.9f, (float) (area.Width / 4)); - var data = new - { - DisplayName = userDisplayName, - FullId = this._request.UserFullIdentifier - }; - string text = Utils.FormatWith(userWrapperText, (object) data); - Vector2 mouseScreen = Main.MouseScreen; - Color c = area.Contains(mouseScreen.ToPoint()) ? new Color(64, 109, 164) * 0.75f : new Color(64, 109, 164) * 0.5f; - Utils.DrawInvBG(spriteBatch, area, c); - Vector2 pos = new Vector2((float) area.Left, (float) area.Center.Y); - pos.X += 32f; - Texture2D texture2D1 = Main.Assets.Request("Images/UI/ButtonPlay", (AssetRequestMode) 1).Value; - Vector2 position = new Vector2((float) (area.Left + 7), (float) ((double) MathHelper.Lerp((float) area.Top, (float) area.Bottom, 0.5f) - (double) (texture2D1.Height / 2) - 1.0)); - bool flag1 = Utils.CenteredRectangle(position + new Vector2((float) (texture2D1.Width / 2), 0.0f), texture2D1.Size()).Contains(mouseScreen.ToPoint()); - spriteBatch.Draw(texture2D1, position, new Rectangle?(), Color.White * (flag1 ? 1f : 0.5f), 0.0f, new Vector2(0.0f, 0.5f) * texture2D1.Size(), 1f, SpriteEffects.None, 0.0f); - if (flag1) - this.OnMouseOver(); - Texture2D texture2D2 = Main.Assets.Request("Images/UI/ButtonDelete", (AssetRequestMode) 1).Value; - position = new Vector2((float) (area.Left + 7), (float) ((double) MathHelper.Lerp((float) area.Top, (float) area.Bottom, 0.5f) + (double) (texture2D2.Height / 2) + 1.0)); - bool flag2 = Utils.CenteredRectangle(position + new Vector2((float) (texture2D2.Width / 2), 0.0f), texture2D2.Size()).Contains(mouseScreen.ToPoint()); - spriteBatch.Draw(texture2D2, position, new Rectangle?(), Color.White * (flag2 ? 1f : 0.5f), 0.0f, new Vector2(0.0f, 0.5f) * texture2D2.Size(), 1f, SpriteEffects.None, 0.0f); - if (flag2) - this.OnMouseOver(true); - pos.X += 6f; - Color color = new Color((int) Main.mouseTextColor, (int) Main.mouseTextColor, (int) Main.mouseTextColor / 5, (int) Main.mouseTextColor); - Utils.DrawBorderString(spriteBatch, text, pos, color, 0.9f, anchory: 0.4f); - } - } - } -} diff --git a/UI/IngameFancyUI.cs b/UI/IngameFancyUI.cs index 03d6ffa..6bc1367 100644 --- a/UI/IngameFancyUI.cs +++ b/UI/IngameFancyUI.cs @@ -1,14 +1,13 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.IngameFancyUI -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria.Achievements; -using Terraria.Audio; using Terraria.GameContent.UI.States; using Terraria.GameInput; using Terraria.Localization; @@ -37,7 +36,6 @@ namespace Terraria.UI Main.editChest = false; Main.npcChatText = ""; Main.inFancyUI = true; - IngameFancyUI.ClearChat(); Main.InGameUI.SetState((UIState) Main.AchievementsMenu); } @@ -47,23 +45,14 @@ namespace Terraria.UI Main.AchievementsMenu.GotoAchievement(achievement); } - private static void ClearChat() - { - Main.ClosePlayerChat(); - Main.chatText = ""; - } - - public static void OpenKeybinds() => IngameFancyUI.OpenUIState((UIState) Main.ManageControlsMenu); - - public static void OpenUIState(UIState uiState) + public static void OpenKeybinds() { IngameFancyUI.CoverNextFrame(); Main.playerInventory = false; Main.editChest = false; Main.npcChatText = ""; Main.inFancyUI = true; - IngameFancyUI.ClearChat(); - Main.InGameUI.SetState(uiState); + Main.InGameUI.SetState((UIState) Main.ManageControlsMenu); } public static bool CanShowVirtualKeyboard(int context) => UIVirtualKeyboard.CanDisplay(context); @@ -71,8 +60,7 @@ namespace Terraria.UI public static void OpenVirtualKeyboard(int keyboardContext) { IngameFancyUI.CoverNextFrame(); - IngameFancyUI.ClearChat(); - SoundEngine.PlaySound(12); + Main.PlaySound(12); string labelText = ""; switch (keyboardContext) { @@ -84,15 +72,12 @@ namespace Terraria.UI labelText = Language.GetTextValue("UI.EnterNewName"); Player player = Main.player[Main.myPlayer]; Main.npcChatText = Main.chest[player.chest].name; - Tile tile = Main.tile[player.chestX, player.chestY]; - if (tile.type == (ushort) 21) - Main.defaultChestName = Lang.chestType[(int) tile.frameX / 36].Value; - else if (tile.type == (ushort) 467 && (int) tile.frameX / 36 == 4) - Main.defaultChestName = Lang.GetItemNameValue(3988); - else if (tile.type == (ushort) 467) - Main.defaultChestName = Lang.chestType2[(int) tile.frameX / 36].Value; - else if (tile.type == (ushort) 88) - Main.defaultChestName = Lang.dresserType[(int) tile.frameX / 54].Value; + if (Main.tile[player.chestX, player.chestY].type == (ushort) 21) + Main.defaultChestName = Lang.chestType[(int) Main.tile[player.chestX, player.chestY].frameX / 36].Value; + if (Main.tile[player.chestX, player.chestY].type == (ushort) 467) + Main.defaultChestName = Lang.chestType2[(int) Main.tile[player.chestX, player.chestY].frameX / 36].Value; + if (Main.tile[player.chestX, player.chestY].type == (ushort) 88) + Main.defaultChestName = Lang.dresserType[(int) Main.tile[player.chestX, player.chestY].frameX / 54].Value; if (Main.npcChatText == "") Main.npcChatText = Main.defaultChestName; Main.editChest = true; @@ -133,30 +118,21 @@ namespace Terraria.UI public static void Close() { Main.inFancyUI = false; - SoundEngine.PlaySound(11); - bool flag1 = !Main.gameMenu; - bool flag2 = !(Main.InGameUI.CurrentState is UIVirtualKeyboard); - bool flag3 = false; - switch (UIVirtualKeyboard.KeyboardContext) - { - case 2: - case 3: - flag3 = true; - break; - } - if (flag1 && !(flag2 | flag3)) - flag1 = false; - if (flag1) + Main.PlaySound(11); + if (!Main.gameMenu && (!(Main.InGameUI.CurrentState is UIVirtualKeyboard) || UIVirtualKeyboard.KeyboardContext == 2)) Main.playerInventory = true; - if (!Main.gameMenu && Main.InGameUI.CurrentState is UIEmotesMenu) - Main.playerInventory = false; - Main.LocalPlayer.releaseInventory = false; Main.InGameUI.SetState((UIState) null); UILinkPointNavigator.Shortcuts.FANCYUI_SPECIAL_INSTRUCTIONS = 0; } public static bool Draw(SpriteBatch spriteBatch, GameTime gameTime) { + if (!Main.gameMenu && Main.player[Main.myPlayer].dead && !Main.player[Main.myPlayer].ghost) + { + IngameFancyUI.Close(); + Main.playerInventory = false; + return false; + } bool flag = false; if (Main.InGameUI.CurrentState is UIVirtualKeyboard && UIVirtualKeyboard.KeyboardContext > 0) { diff --git a/UI/InterfaceScaleType.cs b/UI/InterfaceScaleType.cs index e972695..5cebbee 100644 --- a/UI/InterfaceScaleType.cs +++ b/UI/InterfaceScaleType.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.InterfaceScaleType -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.UI diff --git a/UI/ItemSlot.cs b/UI/ItemSlot.cs index 3811fe2..ef8c996 100644 --- a/UI/ItemSlot.cs +++ b/UI/ItemSlot.cs @@ -1,20 +1,16 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.ItemSlot -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Terraria.Audio; -using Terraria.DataStructures; -using Terraria.GameContent; using Terraria.GameContent.Achievements; using Terraria.GameContent.UI; using Terraria.GameContent.UI.Chat; using Terraria.GameInput; using Terraria.ID; -using Terraria.Localization; using Terraria.UI.Chat; using Terraria.UI.Gamepad; @@ -22,72 +18,34 @@ namespace Terraria.UI { public class ItemSlot { - public static bool DrawGoldBGForCraftingMaterial = false; - public static bool ShiftForcedOn; + public static bool ShiftForcedOn = false; private static Item[] singleSlotArray = new Item[1]; - private static bool[] canFavoriteAt = new bool[31]; - private static bool[] canShareAt = new bool[31]; + private static bool[] canFavoriteAt = new bool[23]; private static float[] inventoryGlowHue = new float[58]; private static int[] inventoryGlowTime = new int[58]; private static float[] inventoryGlowHueChest = new float[58]; private static int[] inventoryGlowTimeChest = new int[58]; private static int _customCurrencyForSavings = -1; - private static int dyeSlotCount; - private static int accSlotToSwapTo; - public static float CircularRadialOpacity; - public static float QuicksRadialOpacity; + private static int dyeSlotCount = 0; + private static int accSlotCount = 0; + public static float CircularRadialOpacity = 0.0f; + public static float QuicksRadialOpacity = 0.0f; static ItemSlot() { ItemSlot.canFavoriteAt[0] = true; ItemSlot.canFavoriteAt[1] = true; ItemSlot.canFavoriteAt[2] = true; - ItemSlot.canShareAt[15] = true; - ItemSlot.canShareAt[4] = true; - ItemSlot.canShareAt[5] = true; - ItemSlot.canShareAt[6] = true; - ItemSlot.canShareAt[7] = true; - ItemSlot.canShareAt[27] = true; - ItemSlot.canShareAt[26] = true; - ItemSlot.canShareAt[23] = true; - ItemSlot.canShareAt[24] = true; - ItemSlot.canShareAt[25] = true; - ItemSlot.canShareAt[22] = true; - ItemSlot.canShareAt[3] = true; - ItemSlot.canShareAt[8] = true; - ItemSlot.canShareAt[9] = true; - ItemSlot.canShareAt[10] = true; - ItemSlot.canShareAt[11] = true; - ItemSlot.canShareAt[12] = true; - ItemSlot.canShareAt[16] = true; - ItemSlot.canShareAt[20] = true; - ItemSlot.canShareAt[18] = true; - ItemSlot.canShareAt[19] = true; - ItemSlot.canShareAt[17] = true; - ItemSlot.canShareAt[29] = true; - ItemSlot.canShareAt[30] = true; } public static bool ShiftInUse => Main.keyState.PressingShift() || ItemSlot.ShiftForcedOn; - public static bool ControlInUse => Main.keyState.PressingControl(); - - public static bool NotUsingGamepad => !PlayerInput.UsingGamepad; - public static void SetGlow(int index, float hue, bool chest) { if (chest) { - if ((double) hue < 0.0) - { - ItemSlot.inventoryGlowTimeChest[index] = 0; - ItemSlot.inventoryGlowHueChest[index] = 0.0f; - } - else - { - ItemSlot.inventoryGlowTimeChest[index] = 300; - ItemSlot.inventoryGlowHueChest[index] = hue; - } + ItemSlot.inventoryGlowTimeChest[index] = 300; + ItemSlot.inventoryGlowHueChest[index] = hue; } else { @@ -131,214 +89,70 @@ namespace Terraria.UI public static void Handle(Item[] inv, int context = 0, int slot = 0) { ItemSlot.OverrideHover(inv, context, slot); - ItemSlot.LeftClick(inv, context, slot); - ItemSlot.RightClick(inv, context, slot); if (Main.mouseLeftRelease && Main.mouseLeft) + { + ItemSlot.LeftClick(inv, context, slot); Recipe.FindRecipes(); + } + else + ItemSlot.RightClick(inv, context, slot); ItemSlot.MouseHover(inv, context, slot); } - public static void OverrideHover(ref Item inv, int context = 0) - { - ItemSlot.singleSlotArray[0] = inv; - ItemSlot.OverrideHover(ItemSlot.singleSlotArray, context); - inv = ItemSlot.singleSlotArray[0]; - } - - public static bool isEquipLocked(int type) => Main.npcShop > 0 && (type == 854 || type == 3035); - public static void OverrideHover(Item[] inv, int context = 0, int slot = 0) { Item obj = inv[slot]; - if (ItemSlot.NotUsingGamepad && ItemSlot.Options.DisableLeftShiftTrashCan) + if (ItemSlot.ShiftInUse && obj.type > 0 && obj.stack > 0 && !inv[slot].favorited) { - if (ItemSlot.ControlInUse) + switch (context) { - if (obj.type > 0 && obj.stack > 0 && !inv[slot].favorited) - { - switch (context) + case 0: + case 1: + case 2: + if (Main.npcShop > 0 && !obj.favorited) { - case 0: - case 1: - case 2: - Main.cursorOverride = Main.npcShop <= 0 || obj.favorited ? 6 : 10; - break; - case 3: - case 4: - case 7: - if (Main.player[Main.myPlayer].ItemSpace(obj).CanTakeItemToPersonalInventory) - { - Main.cursorOverride = 6; - break; - } - break; + Main.cursorOverride = 10; + break; } - } - } - else if (ItemSlot.ShiftInUse) - { - bool flag = false; - if (Main.LocalPlayer.tileEntityAnchor.IsInValidUseTileEntity()) - flag = Main.LocalPlayer.tileEntityAnchor.GetTileEntity().OverrideItemSlotHover(inv, context, slot); - if (obj.type > 0 && obj.stack > 0 && !inv[slot].favorited && !flag) - { - switch (context) + if (Main.player[Main.myPlayer].chest != -1) { - case 0: - case 1: - case 2: - if (context == 0 && Main.CreativeMenu.IsShowingResearchMenu()) - { - Main.cursorOverride = 9; - break; - } - if (context == 0 && Main.InReforgeMenu) - { - if (obj.maxStack == 1 && obj.Prefix(-3)) - { - Main.cursorOverride = 9; - break; - } - break; - } - if (context == 0 && Main.InGuideCraftMenu) - { - if (obj.material) - { - Main.cursorOverride = 9; - break; - } - break; - } - if (Main.player[Main.myPlayer].chest != -1 && ChestUI.TryPlacingInChest(obj, true)) - { - Main.cursorOverride = 9; - break; - } - break; - case 3: - case 4: - if (Main.player[Main.myPlayer].ItemSpace(obj).CanTakeItemToPersonalInventory) - { - Main.cursorOverride = 8; - break; - } - break; - case 5: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 16: - case 17: - case 18: - case 19: - case 20: - case 23: - case 24: - case 25: - case 26: - case 27: - case 29: - if (Main.player[Main.myPlayer].ItemSpace(inv[slot]).CanTakeItemToPersonalInventory) - { - Main.cursorOverride = 7; - break; - } - break; - } - } - } - } - else if (ItemSlot.ShiftInUse) - { - bool flag = false; - if (Main.LocalPlayer.tileEntityAnchor.IsInValidUseTileEntity()) - flag = Main.LocalPlayer.tileEntityAnchor.GetTileEntity().OverrideItemSlotHover(inv, context, slot); - if (obj.type > 0 && obj.stack > 0 && !inv[slot].favorited && !flag) - { - switch (context) - { - case 0: - case 1: - case 2: - if (Main.npcShop > 0 && !obj.favorited) - { - Main.cursorOverride = 10; - break; - } - if (context == 0 && Main.CreativeMenu.IsShowingResearchMenu()) + if (ChestUI.TryPlacingInChest(obj, true)) { Main.cursorOverride = 9; break; } - if (context == 0 && Main.InReforgeMenu) - { - if (obj.maxStack == 1 && obj.Prefix(-3)) - { - Main.cursorOverride = 9; - break; - } - break; - } - if (context == 0 && Main.InGuideCraftMenu) - { - if (obj.material) - { - Main.cursorOverride = 9; - break; - } - break; - } - if (Main.player[Main.myPlayer].chest != -1) - { - if (ChestUI.TryPlacingInChest(obj, true)) - { - Main.cursorOverride = 9; - break; - } - break; - } - Main.cursorOverride = 6; break; - case 3: - case 4: - if (Main.player[Main.myPlayer].ItemSpace(obj).CanTakeItemToPersonalInventory) - { - Main.cursorOverride = 8; - break; - } + } + Main.cursorOverride = 6; + break; + case 3: + case 4: + if (Main.player[Main.myPlayer].ItemSpace(obj)) + { + Main.cursorOverride = 8; break; - case 5: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 16: - case 17: - case 18: - case 19: - case 20: - case 23: - case 24: - case 25: - case 26: - case 27: - case 29: - if (Main.player[Main.myPlayer].ItemSpace(inv[slot]).CanTakeItemToPersonalInventory) - { - Main.cursorOverride = 7; - break; - } + } + break; + case 5: + case 8: + case 9: + case 10: + case 11: + case 12: + case 16: + case 17: + case 18: + case 19: + case 20: + if (Main.player[Main.myPlayer].ItemSpace(inv[slot])) + { + Main.cursorOverride = 7; break; - } + } + break; } } - if (!Main.keyState.IsKeyDown(Main.FavoriteKey) || !ItemSlot.canFavoriteAt[context] && (!Main.drawingPlayerChat || !ItemSlot.canShareAt[context])) + if (!Main.keyState.IsKeyDown(Main.FavoriteKey) || !ItemSlot.canFavoriteAt[context]) return; if (obj.type > 0 && obj.stack > 0 && Main.drawingPlayerChat) { @@ -354,58 +168,30 @@ namespace Terraria.UI private static bool OverrideLeftClick(Item[] inv, int context = 0, int slot = 0) { - if (context == 10 && ItemSlot.isEquipLocked(inv[slot].type) || Main.LocalPlayer.tileEntityAnchor.IsInValidUseTileEntity() && Main.LocalPlayer.tileEntityAnchor.GetTileEntity().OverrideItemSlotLeftClick(inv, context, slot)) - return true; Item I = inv[slot]; switch (Main.cursorOverride) { case 2: - if (ChatManager.AddChatText(FontAssets.MouseText.Value, ItemTagHandler.GenerateTag(I), Vector2.One)) - SoundEngine.PlaySound(12); + if (ChatManager.AddChatText(Main.fontMouseText, ItemTagHandler.GenerateTag(I), Vector2.One)) + Main.PlaySound(12); return true; case 3: if (!ItemSlot.canFavoriteAt[context]) return false; I.favorited = !I.favorited; - SoundEngine.PlaySound(12); + Main.PlaySound(12); return true; case 7: - if (context == 29) - { - Item newItem = new Item(); - newItem.SetDefaults(inv[slot].netID); - newItem.stack = newItem.maxStack; - Main.player[Main.myPlayer].GetItem(Main.myPlayer, newItem, GetItemSettings.InventoryEntityToPlayerInventorySettings); - SoundEngine.PlaySound(12); - return true; - } - inv[slot] = Main.player[Main.myPlayer].GetItem(Main.myPlayer, inv[slot], GetItemSettings.InventoryEntityToPlayerInventorySettings); - SoundEngine.PlaySound(12); + inv[slot] = Main.player[Main.myPlayer].GetItem(Main.myPlayer, inv[slot], noText: true); + Main.PlaySound(12); return true; case 8: - inv[slot] = Main.player[Main.myPlayer].GetItem(Main.myPlayer, inv[slot], GetItemSettings.InventoryEntityToPlayerInventorySettings); + inv[slot] = Main.player[Main.myPlayer].GetItem(Main.myPlayer, inv[slot], noText: true); if (Main.player[Main.myPlayer].chest > -1) NetMessage.SendData(32, number: Main.player[Main.myPlayer].chest, number2: ((float) slot)); return true; case 9: - if (Main.CreativeMenu.IsShowingResearchMenu()) - { - Main.CreativeMenu.SwapItem(ref inv[slot]); - SoundEngine.PlaySound(7); - } - else if (Main.InReforgeMenu) - { - Utils.Swap(ref inv[slot], ref Main.reforgeItem); - SoundEngine.PlaySound(7); - } - else if (Main.InGuideCraftMenu) - { - Utils.Swap(ref inv[slot], ref Main.guideItem); - Recipe.FindRecipes(); - SoundEngine.PlaySound(7); - } - else - ChestUI.TryPlacingInChest(inv[slot], false); + ChestUI.TryPlacingInChest(inv[slot], false); return true; default: return false; @@ -421,26 +207,34 @@ namespace Terraria.UI public static void LeftClick(Item[] inv, int context = 0, int slot = 0) { - Player player = Main.player[Main.myPlayer]; - bool flag = Main.mouseLeftRelease && Main.mouseLeft; - if (flag) - { - if (ItemSlot.OverrideLeftClick(inv, context, slot)) - return; - inv[slot].newAndShiny = false; - if (ItemSlot.LeftClick_SellOrTrash(inv, context, slot) || player.itemAnimation != 0 || player.itemTime != 0) - return; - } - int num1 = ItemSlot.PickItemMovementAction(inv, context, slot, Main.mouseItem); - if (num1 != 3 && !flag) + if (ItemSlot.OverrideLeftClick(inv, context, slot)) return; - switch (num1) + inv[slot].newAndShiny = false; + Player player = Main.player[Main.myPlayer]; + bool flag = false; + switch (context) { case 0: - if (context == 6 && Main.mouseItem.type != 0) - inv[slot].SetDefaults(); - if (context != 11 || inv[slot].FitsAccessoryVanitySlot) - { + case 1: + case 2: + case 3: + case 4: + flag = player.chest == -1; + break; + } + if (ItemSlot.ShiftInUse & flag) + { + ItemSlot.SellOrTrash(inv, context, slot); + } + else + { + if (player.itemAnimation != 0 || player.itemTime != 0) + return; + switch (ItemSlot.PickItemMovementAction(inv, context, slot, Main.mouseItem)) + { + case 0: + if (context == 6 && Main.mouseItem.type != 0) + inv[slot].SetDefaults(); Utils.Swap(ref inv[slot], ref Main.mouseItem); if (inv[slot].stack > 0) { @@ -456,8 +250,6 @@ namespace Terraria.UI case 12: case 16: case 17: - case 25: - case 27: AchievementsHelper.HandleOnEquip(player, inv[slot], context); break; } @@ -476,9 +268,9 @@ namespace Terraria.UI } else { - int num2 = Main.mouseItem.maxStack - inv[slot].stack; - inv[slot].stack += num2; - Main.mouseItem.stack -= num2; + int num = Main.mouseItem.maxStack - inv[slot].stack; + inv[slot].stack += num; + Main.mouseItem.stack -= num; } } } @@ -487,7 +279,7 @@ namespace Terraria.UI if (Main.mouseItem.type > 0 || inv[slot].type > 0) { Recipe.FindRecipes(); - SoundEngine.PlaySound(7); + Main.PlaySound(7); } if (context == 3 && Main.netMode == 1) { @@ -495,49 +287,28 @@ namespace Terraria.UI break; } break; - } - break; - case 1: - if (Main.mouseItem.stack == 1 && Main.mouseItem.type > 0 && inv[slot].type > 0 && inv[slot].IsNotTheSameAs(Main.mouseItem) && (context != 11 || Main.mouseItem.FitsAccessoryVanitySlot)) - { - Utils.Swap(ref inv[slot], ref Main.mouseItem); - SoundEngine.PlaySound(7); - if (inv[slot].stack > 0) + case 1: + if (Main.mouseItem.stack == 1 && Main.mouseItem.type > 0 && inv[slot].type > 0 && inv[slot].IsNotTheSameAs(Main.mouseItem)) { - if (context <= 12) + Utils.Swap(ref inv[slot], ref Main.mouseItem); + Main.PlaySound(7); + if (inv[slot].stack > 0) { if (context != 0) { - if ((uint) (context - 8) > 4U) - goto label_59; - } - else - { - AchievementsHelper.NotifyItemPickup(player, inv[slot]); - goto label_59; + if ((uint) (context - 8) <= 4U || (uint) (context - 16) <= 1U) + { + AchievementsHelper.HandleOnEquip(player, inv[slot], context); + break; + } + break; } + AchievementsHelper.NotifyItemPickup(player, inv[slot]); + break; } - else if ((uint) (context - 16) > 1U && context != 25 && context != 27) - goto label_59; - AchievementsHelper.HandleOnEquip(player, inv[slot], context); + break; } - } - else if (Main.mouseItem.type == 0 && inv[slot].type > 0) - { - Utils.Swap(ref inv[slot], ref Main.mouseItem); - if (inv[slot].type == 0 || inv[slot].stack < 1) - inv[slot] = new Item(); - if (Main.mouseItem.type == 0 || Main.mouseItem.stack < 1) - Main.mouseItem = new Item(); - if (Main.mouseItem.type > 0 || inv[slot].type > 0) - { - Recipe.FindRecipes(); - SoundEngine.PlaySound(7); - } - } - else if (Main.mouseItem.type > 0 && inv[slot].type == 0 && (context != 11 || Main.mouseItem.FitsAccessoryVanitySlot)) - { - if (Main.mouseItem.stack == 1) + if (Main.mouseItem.type == 0 && inv[slot].type > 0) { Utils.Swap(ref inv[slot], ref Main.mouseItem); if (inv[slot].type == 0 || inv[slot].stack < 1) @@ -547,86 +318,72 @@ namespace Terraria.UI if (Main.mouseItem.type > 0 || inv[slot].type > 0) { Recipe.FindRecipes(); - SoundEngine.PlaySound(7); + Main.PlaySound(7); + break; } + break; } - else + if (Main.mouseItem.type > 0 && inv[slot].type == 0) { - --Main.mouseItem.stack; - inv[slot].SetDefaults(Main.mouseItem.type); - Recipe.FindRecipes(); - SoundEngine.PlaySound(7); - } - if (inv[slot].stack > 0) - { - if (context <= 12) + if (Main.mouseItem.stack == 1) + { + Utils.Swap(ref inv[slot], ref Main.mouseItem); + if (inv[slot].type == 0 || inv[slot].stack < 1) + inv[slot] = new Item(); + if (Main.mouseItem.type == 0 || Main.mouseItem.stack < 1) + Main.mouseItem = new Item(); + if (Main.mouseItem.type > 0 || inv[slot].type > 0) + { + Recipe.FindRecipes(); + Main.PlaySound(7); + } + } + else + { + --Main.mouseItem.stack; + inv[slot].SetDefaults(Main.mouseItem.type); + Recipe.FindRecipes(); + Main.PlaySound(7); + } + if (inv[slot].stack > 0) { if (context != 0) { - if ((uint) (context - 8) > 4U) - goto label_59; - } - else - { - AchievementsHelper.NotifyItemPickup(player, inv[slot]); - goto label_59; + if ((uint) (context - 8) <= 4U || (uint) (context - 16) <= 1U) + { + AchievementsHelper.HandleOnEquip(player, inv[slot], context); + break; + } + break; } + AchievementsHelper.NotifyItemPickup(player, inv[slot]); + break; } - else if ((uint) (context - 16) > 1U && context != 25 && context != 27) - goto label_59; - AchievementsHelper.HandleOnEquip(player, inv[slot], context); + break; } - } -label_59: - if ((context == 23 || context == 24) && Main.netMode == 1) - NetMessage.SendData(121, number: Main.myPlayer, number2: ((float) player.tileEntityAnchor.interactEntityID), number3: ((float) slot)); - if (context == 26 && Main.netMode == 1) - { - NetMessage.SendData(124, number: Main.myPlayer, number2: ((float) player.tileEntityAnchor.interactEntityID), number3: ((float) slot)); break; - } - break; - case 2: - if (Main.mouseItem.stack == 1 && Main.mouseItem.dye > (byte) 0 && inv[slot].type > 0 && inv[slot].type != Main.mouseItem.type) - { - Utils.Swap(ref inv[slot], ref Main.mouseItem); - SoundEngine.PlaySound(7); - if (inv[slot].stack > 0) + case 2: + if (Main.mouseItem.stack == 1 && Main.mouseItem.dye > (byte) 0 && inv[slot].type > 0 && inv[slot].type != Main.mouseItem.type) { - if (context <= 12) + Utils.Swap(ref inv[slot], ref Main.mouseItem); + Main.PlaySound(7); + if (inv[slot].stack > 0) { if (context != 0) { - if ((uint) (context - 8) > 4U) - goto label_95; - } - else - { - AchievementsHelper.NotifyItemPickup(player, inv[slot]); - goto label_95; + if ((uint) (context - 8) <= 4U || (uint) (context - 16) <= 1U) + { + AchievementsHelper.HandleOnEquip(player, inv[slot], context); + break; + } + break; } + AchievementsHelper.NotifyItemPickup(player, inv[slot]); + break; } - else if ((uint) (context - 16) > 1U && context != 25 && context != 27) - goto label_95; - AchievementsHelper.HandleOnEquip(player, inv[slot], context); + break; } - } - else if (Main.mouseItem.type == 0 && inv[slot].type > 0) - { - Utils.Swap(ref inv[slot], ref Main.mouseItem); - if (inv[slot].type == 0 || inv[slot].stack < 1) - inv[slot] = new Item(); - if (Main.mouseItem.type == 0 || Main.mouseItem.stack < 1) - Main.mouseItem = new Item(); - if (Main.mouseItem.type > 0 || inv[slot].type > 0) - { - Recipe.FindRecipes(); - SoundEngine.PlaySound(7); - } - } - else if (Main.mouseItem.dye > (byte) 0 && inv[slot].type == 0) - { - if (Main.mouseItem.stack == 1) + if (Main.mouseItem.type == 0 && inv[slot].type > 0) { Utils.Swap(ref inv[slot], ref Main.mouseItem); if (inv[slot].type == 0 || inv[slot].stack < 1) @@ -636,122 +393,88 @@ label_59: if (Main.mouseItem.type > 0 || inv[slot].type > 0) { Recipe.FindRecipes(); - SoundEngine.PlaySound(7); + Main.PlaySound(7); + break; } + break; } - else + if (Main.mouseItem.dye > (byte) 0 && inv[slot].type == 0) { - --Main.mouseItem.stack; - inv[slot].SetDefaults(Main.mouseItem.type); - Recipe.FindRecipes(); - SoundEngine.PlaySound(7); - } - if (inv[slot].stack > 0) - { - if (context <= 12) + if (Main.mouseItem.stack == 1) + { + Utils.Swap(ref inv[slot], ref Main.mouseItem); + if (inv[slot].type == 0 || inv[slot].stack < 1) + inv[slot] = new Item(); + if (Main.mouseItem.type == 0 || Main.mouseItem.stack < 1) + Main.mouseItem = new Item(); + if (Main.mouseItem.type > 0 || inv[slot].type > 0) + { + Recipe.FindRecipes(); + Main.PlaySound(7); + } + } + else + { + --Main.mouseItem.stack; + inv[slot].SetDefaults(Main.mouseItem.type); + Recipe.FindRecipes(); + Main.PlaySound(7); + } + if (inv[slot].stack > 0) { if (context != 0) { - if ((uint) (context - 8) > 4U) - goto label_95; - } - else - { - AchievementsHelper.NotifyItemPickup(player, inv[slot]); - goto label_95; + if ((uint) (context - 8) <= 4U || (uint) (context - 16) <= 1U) + { + AchievementsHelper.HandleOnEquip(player, inv[slot], context); + break; + } + break; } + AchievementsHelper.NotifyItemPickup(player, inv[slot]); + break; } - else if ((uint) (context - 16) > 1U && context != 25 && context != 27) - goto label_95; - AchievementsHelper.HandleOnEquip(player, inv[slot], context); + break; } - } -label_95: - if (context == 25 && Main.netMode == 1) - NetMessage.SendData(121, number: Main.myPlayer, number2: ((float) player.tileEntityAnchor.interactEntityID), number3: ((float) slot), number4: 1f); - if (context == 27 && Main.netMode == 1) - { - NetMessage.SendData(124, number: Main.myPlayer, number2: ((float) player.tileEntityAnchor.interactEntityID), number3: ((float) slot), number4: 1f); break; - } - break; - case 3: - ItemSlot.HandleShopSlot(inv, slot, false, true); - break; - case 4: - Chest chest = Main.instance.shop[Main.npcShop]; - if (player.SellItem(Main.mouseItem)) - { - chest.AddItemToShop(Main.mouseItem); - Main.mouseItem.SetDefaults(); - SoundEngine.PlaySound(18); - } - else if (Main.mouseItem.value == 0) - { - chest.AddItemToShop(Main.mouseItem); - Main.mouseItem.SetDefaults(); - SoundEngine.PlaySound(7); - } - Recipe.FindRecipes(); - Main.stackSplit = 9999; - break; - default: - if (num1 == 5 && Main.mouseItem.IsAir) - { - SoundEngine.PlaySound(7); - Main.mouseItem.SetDefaults(inv[slot].netID); - Main.mouseItem.stack = Main.mouseItem.maxStack; - break; - } - break; - } - if ((uint) context <= 2U || context == 5) - return; - inv[slot].favorited = false; - } - - private static bool LeftClick_SellOrTrash(Item[] inv, int context, int slot) - { - bool flag1 = false; - bool flag2 = false; - if (ItemSlot.NotUsingGamepad && ItemSlot.Options.DisableLeftShiftTrashCan) - { - switch (context) - { - case 0: - case 1: - case 2: case 3: + Main.mouseItem.netDefaults(inv[slot].netID); + if (inv[slot].buyOnce) + Main.mouseItem.Prefix((int) inv[slot].prefix); + else + Main.mouseItem.Prefix(-1); + Main.mouseItem.position = player.Center - new Vector2((float) Main.mouseItem.width, (float) Main.mouseItem.headSlot) / 2f; + ItemText.NewText(Main.mouseItem, Main.mouseItem.stack); + if (inv[slot].buyOnce && --inv[slot].stack <= 0) + inv[slot].SetDefaults(); + if (inv[slot].value > 0) + { + Main.PlaySound(18); + break; + } + Main.PlaySound(7); + break; case 4: - case 7: - flag1 = true; + Chest chest = Main.instance.shop[Main.npcShop]; + if (player.SellItem(Main.mouseItem.value, Main.mouseItem.stack)) + { + chest.AddShop(Main.mouseItem); + Main.mouseItem.SetDefaults(); + Main.PlaySound(18); + } + else if (Main.mouseItem.value == 0) + { + chest.AddShop(Main.mouseItem); + Main.mouseItem.SetDefaults(); + Main.PlaySound(7); + } + Recipe.FindRecipes(); break; } - if (ItemSlot.ControlInUse & flag1) - { - ItemSlot.SellOrTrash(inv, context, slot); - flag2 = true; - } + if ((uint) context <= 2U || context == 5) + return; + inv[slot].favorited = false; } - else - { - switch (context) - { - case 0: - case 1: - case 2: - case 3: - case 4: - flag1 = Main.player[Main.myPlayer].chest == -1; - break; - } - if (ItemSlot.ShiftInUse & flag1) - { - ItemSlot.SellOrTrash(inv, context, slot); - flag2 = true; - } - } - return flag2; } private static void SellOrTrash(Item[] inv, int context, int slot) @@ -764,28 +487,28 @@ label_95: Chest chest = Main.instance.shop[Main.npcShop]; if (inv[slot].type >= 71 && inv[slot].type <= 74) return; - if (player.SellItem(inv[slot])) + if (player.SellItem(inv[slot].value, inv[slot].stack)) { - chest.AddItemToShop(inv[slot]); + chest.AddShop(inv[slot]); inv[slot].SetDefaults(); - SoundEngine.PlaySound(18); + Main.PlaySound(18); Recipe.FindRecipes(); } else { if (inv[slot].value != 0) return; - chest.AddItemToShop(inv[slot]); + chest.AddShop(inv[slot]); inv[slot].SetDefaults(); - SoundEngine.PlaySound(7); + Main.PlaySound(7); Recipe.FindRecipes(); } } else { - if (inv[slot].favorited) + if (inv[slot].favorited || ItemSlot.Options.DisableLeftShiftTrashCan) return; - SoundEngine.PlaySound(7); + Main.PlaySound(7); player.trashItem = inv[slot].Clone(); inv[slot].SetDefaults(); if (context == 3 && Main.netMode == 1) @@ -797,10 +520,6 @@ label_95: private static string GetOverrideInstructions(Item[] inv, int context, int slot) { Player player = Main.player[Main.myPlayer]; - TileEntity tileEntity = player.tileEntityAnchor.GetTileEntity(); - string instruction; - if (tileEntity != null && tileEntity.TryGetItemGamepadOverrideInstructions(inv, context, slot, out instruction)) - return instruction; if (inv[slot].type > 0 && inv[slot].stack > 0) { if (!inv[slot].favorited) @@ -812,16 +531,14 @@ label_95: case 2: if (Main.npcShop > 0 && !inv[slot].favorited) return Lang.misc[75].Value; - if (Main.player[Main.myPlayer].chest != -1) - { - if (ChestUI.TryPlacingInChest(inv[slot], true)) - return Lang.misc[76].Value; - break; - } - return Main.InGuideCraftMenu && inv[slot].material ? Lang.misc[76].Value : Lang.misc[74].Value; + if (Main.player[Main.myPlayer].chest == -1) + return Lang.misc[74].Value; + if (ChestUI.TryPlacingInChest(inv[slot], true)) + return Lang.misc[76].Value; + break; case 3: case 4: - if (Main.player[Main.myPlayer].ItemSpace(inv[slot]).CanTakeItemToPersonalInventory) + if (Main.player[Main.myPlayer].ItemSpace(inv[slot])) return Lang.misc[76].Value; break; case 5: @@ -835,9 +552,7 @@ label_95: case 18: case 19: case 20: - case 25: - case 27: - if (Main.player[Main.myPlayer].ItemSpace(inv[slot]).CanTakeItemToPersonalInventory) + if (Main.player[Main.myPlayer].ItemSpace(inv[slot])) return Lang.misc[68].Value; break; } @@ -852,7 +567,7 @@ label_95: Chest chest = Main.instance.shop[Main.npcShop]; return inv[slot].type >= 71 && inv[slot].type <= 74 ? "" : Lang.misc[75].Value; } - if (!inv[slot].favorited) + if (!inv[slot].favorited && !ItemSlot.Options.DisableLeftShiftTrashCan) return Lang.misc[74].Value; } } @@ -876,7 +591,7 @@ label_95: } break; case 2: - if (checkItem.FitsAmmoSlot()) + if ((checkItem.type == 0 || checkItem.ammo > 0 || checkItem.bait > 0) && !checkItem.notAmmo || checkItem.type == 530) { num = 0; break; @@ -886,13 +601,7 @@ label_95: num = 0; break; case 4: - Item[] chestinv; - ChestUI.GetContainerUsageInfo(out bool _, out chestinv); - if (!ChestUI.IsBlockedFromTransferIntoChest(checkItem, chestinv)) - { - num = 0; - break; - } + num = 0; break; case 5: if (checkItem.Prefix(-3) || checkItem.type == 0) @@ -926,112 +635,74 @@ label_95: } break; case 10: - if (checkItem.type == 0 || checkItem.accessory && !ItemSlot.AccCheck(Main.LocalPlayer.armor, checkItem, slot)) + if (checkItem.type == 0 || checkItem.accessory && !ItemSlot.AccCheck(checkItem, slot)) { num = 1; break; } break; case 11: - if (checkItem.type == 0 || checkItem.accessory && !ItemSlot.AccCheck(Main.LocalPlayer.armor, checkItem, slot)) + if (checkItem.type == 0 || checkItem.accessory && !ItemSlot.AccCheck(checkItem, slot)) { num = 1; break; } break; - case 23: - if (checkItem.type == 0 || checkItem.headSlot > 0 && slot == 0 || checkItem.bodySlot > 0 && slot == 1 || checkItem.legSlot > 0 && slot == 2) + case 12: + num = 2; + break; + case 15: + if (checkItem.type == 0 && inv[slot].type > 0) + { + if (player.BuyItem(inv[slot].GetStoreValue(), inv[slot].shopSpecialCurrency)) + { + num = 3; + break; + } + break; + } + if (inv[slot].type == 0 && checkItem.type > 0 && (checkItem.type < 71 || checkItem.type > 74)) + { + num = 4; + break; + } + break; + case 16: + if (checkItem.type == 0 || Main.projHook[checkItem.shoot]) { num = 1; break; } break; - case 24: - if (checkItem.type == 0 || checkItem.accessory && !ItemSlot.AccCheck(inv, checkItem, slot)) + case 17: + if (checkItem.type == 0 || checkItem.mountType != -1 && !MountID.Sets.Cart[checkItem.mountType]) { num = 1; break; } break; - case 26: - if (checkItem.type == 0 || checkItem.headSlot > 0) + case 18: + if (checkItem.type == 0 || checkItem.mountType != -1 && MountID.Sets.Cart[checkItem.mountType]) { num = 1; break; } break; - default: - if (context == 12 || context == 25 || context == 27) + case 19: + if (checkItem.type == 0 || checkItem.buffType > 0 && Main.vanityPet[checkItem.buffType] && !Main.lightPet[checkItem.buffType]) { - num = 2; + num = 1; break; } - switch (context) + break; + case 20: + if (checkItem.type == 0 || checkItem.buffType > 0 && Main.lightPet[checkItem.buffType]) { - case 15: - if (checkItem.type == 0 && inv[slot].type > 0) - { - num = 3; - break; - } - if (checkItem.type == inv[slot].type && checkItem.type > 0 && checkItem.stack < checkItem.maxStack && inv[slot].stack > 0) - { - num = 3; - break; - } - if (inv[slot].type == 0 && checkItem.type > 0 && (checkItem.type < 71 || checkItem.type > 74)) - { - num = 4; - break; - } - break; - case 16: - if (checkItem.type == 0 || Main.projHook[checkItem.shoot]) - { - num = 1; - break; - } - break; - case 17: - if (checkItem.type == 0 || checkItem.mountType != -1 && !MountID.Sets.Cart[checkItem.mountType]) - { - num = 1; - break; - } - break; - case 18: - if (checkItem.type == 0 || checkItem.mountType != -1 && MountID.Sets.Cart[checkItem.mountType]) - { - num = 1; - break; - } - break; - case 19: - if (checkItem.type == 0 || checkItem.buffType > 0 && Main.vanityPet[checkItem.buffType] && !Main.lightPet[checkItem.buffType]) - { - num = 1; - break; - } - break; - case 20: - if (checkItem.type == 0 || checkItem.buffType > 0 && Main.lightPet[checkItem.buffType]) - { - num = 1; - break; - } - break; - default: - if (context == 29 && checkItem.type == 0 && inv[slot].type > 0) - { - num = 5; - break; - } - break; + num = 1; + break; } break; } - if (context == 30) - num = 0; return num; } @@ -1046,80 +717,14 @@ label_95: { Player player = Main.player[Main.myPlayer]; inv[slot].newAndShiny = false; - if (player.itemAnimation > 0 || ItemSlot.RightClick_FindSpecialActions(inv, context, slot, player)) + if (player.itemAnimation > 0) return; - if ((context == 0 || context == 4 || context == 3) && Main.mouseRight && Main.mouseRightRelease && inv[slot].maxStack == 1) - { - ItemSlot.SwapEquip(inv, context, slot); - } - else - { - if (Main.stackSplit > 1 || !Main.mouseRight) - return; - bool flag = true; - if (context == 0 && inv[slot].maxStack <= 1) - flag = false; - if (context == 3 && inv[slot].maxStack <= 1) - flag = false; - if (context == 4 && inv[slot].maxStack <= 1) - flag = false; - if (!flag || !Main.mouseItem.IsTheSameAs(inv[slot]) && Main.mouseItem.type != 0 || Main.mouseItem.stack >= Main.mouseItem.maxStack && Main.mouseItem.type != 0) - return; - ItemSlot.PickupItemIntoMouse(inv, context, slot, player); - SoundEngine.PlaySound(12); - ItemSlot.RefreshStackSplitCooldown(); - } - } - - public static void PickupItemIntoMouse(Item[] inv, int context, int slot, Player player) - { - if (Main.mouseItem.type == 0) - { - Main.mouseItem = inv[slot].Clone(); - if (context == 29) - Main.mouseItem.SetDefaults(Main.mouseItem.type); - Main.mouseItem.stack = 0; - Main.mouseItem.favorited = inv[slot].favorited && inv[slot].stack == 1; - } - ++Main.mouseItem.stack; - if (context != 29) - --inv[slot].stack; - if (inv[slot].stack <= 0) - inv[slot] = new Item(); - Recipe.FindRecipes(); - if (context == 3 && Main.netMode == 1) - NetMessage.SendData(32, number: player.chest, number2: ((float) slot)); - if ((context == 23 || context == 24) && Main.netMode == 1) - NetMessage.SendData(121, number: Main.myPlayer, number2: ((float) player.tileEntityAnchor.interactEntityID), number3: ((float) slot)); - if (context == 25 && Main.netMode == 1) - NetMessage.SendData(121, number: Main.myPlayer, number2: ((float) player.tileEntityAnchor.interactEntityID), number3: ((float) slot), number4: 1f); - if (context == 26 && Main.netMode == 1) - NetMessage.SendData(124, number: Main.myPlayer, number2: ((float) player.tileEntityAnchor.interactEntityID), number3: ((float) slot)); - if (context != 27 || Main.netMode != 1) - return; - NetMessage.SendData(124, number: Main.myPlayer, number2: ((float) player.tileEntityAnchor.interactEntityID), number3: ((float) slot), number4: 1f); - } - - public static void RefreshStackSplitCooldown() - { - if (Main.stackSplit == 0) - Main.stackSplit = 30; - else - Main.stackSplit = Main.stackDelay; - } - - private static bool RightClick_FindSpecialActions( - Item[] inv, - int context, - int slot, - Player player) - { bool flag1 = false; switch (context) { case 0: flag1 = true; - if (Main.mouseRight && (inv[slot].type >= 3318 && inv[slot].type <= 3332 || inv[slot].type == 3860 || inv[slot].type == 3862 || inv[slot].type == 3861 || inv[slot].type == 4782 || inv[slot].type == 4957)) + if (Main.mouseRight && (inv[slot].type >= 3318 && inv[slot].type <= 3332 || inv[slot].type == 3860 || inv[slot].type == 3862 || inv[slot].type == 3861)) { if (Main.mouseRightRelease) { @@ -1127,7 +732,7 @@ label_95: --inv[slot].stack; if (inv[slot].stack == 0) inv[slot].SetDefaults(); - SoundEngine.PlaySound(7); + Main.PlaySound(7); Main.stackSplit = 30; Main.mouseRightRelease = false; Recipe.FindRecipes(); @@ -1135,15 +740,15 @@ label_95: } break; } - if (Main.mouseRight && inv[slot].type > 0 && inv[slot].type < 5045 && ItemID.Sets.IsFishingCrate[inv[slot].type]) + if (Main.mouseRight && (inv[slot].type >= 2334 && inv[slot].type <= 2336 || inv[slot].type >= 3203 && inv[slot].type <= 3208)) { if (Main.mouseRightRelease) { - player.OpenFishingCrate(inv[slot].type); + player.openCrate(inv[slot].type); --inv[slot].stack; if (inv[slot].stack == 0) inv[slot].SetDefaults(); - SoundEngine.PlaySound(7); + Main.PlaySound(7); Main.stackSplit = 30; Main.mouseRightRelease = false; Recipe.FindRecipes(); @@ -1155,43 +760,11 @@ label_95: { if (Main.mouseRightRelease) { - player.OpenHerbBag(); + player.openHerbBag(); --inv[slot].stack; if (inv[slot].stack == 0) inv[slot].SetDefaults(); - SoundEngine.PlaySound(7); - Main.stackSplit = 30; - Main.mouseRightRelease = false; - Recipe.FindRecipes(); - break; - } - break; - } - if (Main.mouseRight && inv[slot].type == 4345) - { - if (Main.mouseRightRelease) - { - player.OpenCanofWorms(); - --inv[slot].stack; - if (inv[slot].stack == 0) - inv[slot].SetDefaults(); - SoundEngine.PlaySound(7); - Main.stackSplit = 30; - Main.mouseRightRelease = false; - Recipe.FindRecipes(); - break; - } - break; - } - if (Main.mouseRight && inv[slot].type == 4410) - { - if (Main.mouseRightRelease) - { - player.OpenOyster(); - --inv[slot].stack; - if (inv[slot].stack == 0) - inv[slot].SetDefaults(); - SoundEngine.PlaySound(7); + Main.PlaySound(7); Main.stackSplit = 30; Main.mouseRightRelease = false; Recipe.FindRecipes(); @@ -1206,10 +779,10 @@ label_95: --inv[slot].stack; if (inv[slot].stack == 0) inv[slot].SetDefaults(); - SoundEngine.PlaySound(7); + Main.PlaySound(7); Main.stackSplit = 30; Main.mouseRightRelease = false; - player.OpenGoodieBag(); + player.openGoodieBag(); Recipe.FindRecipes(); break; } @@ -1222,26 +795,10 @@ label_95: --inv[slot].stack; if (inv[slot].stack == 0) inv[slot].SetDefaults(); - SoundEngine.PlaySound(7); + Main.PlaySound(7); Main.stackSplit = 30; Main.mouseRightRelease = false; - player.OpenLockBox(); - Recipe.FindRecipes(); - break; - } - break; - } - if (Main.mouseRight && inv[slot].type == 4879) - { - if (Main.mouseRightRelease && player.HasItem(329)) - { - --inv[slot].stack; - if (inv[slot].stack == 0) - inv[slot].SetDefaults(); - SoundEngine.PlaySound(7); - Main.stackSplit = 30; - Main.mouseRightRelease = false; - player.OpenShadowLockbox(); + player.openLockBox(); Recipe.FindRecipes(); break; } @@ -1254,7 +811,7 @@ label_95: --inv[slot].stack; if (inv[slot].stack == 0) inv[slot].SetDefaults(); - SoundEngine.PlaySound(7); + Main.PlaySound(7); Main.stackSplit = 30; Main.mouseRightRelease = false; player.openPresent(); @@ -1265,7 +822,7 @@ label_95: } if (Main.mouseRight && Main.mouseRightRelease && (inv[slot].type == 599 || inv[slot].type == 600 || inv[slot].type == 601)) { - SoundEngine.PlaySound(7); + Main.PlaySound(7); Main.stackSplit = 30; Main.mouseRightRelease = false; int num = Main.rand.Next(14); @@ -1289,49 +846,39 @@ label_95: case 9: case 11: flag1 = true; - if (Main.mouseRight && Main.mouseRightRelease) + if (Main.mouseRight && Main.mouseRightRelease && (inv[slot].type > 0 && inv[slot].stack > 0 || inv[slot - 10].type > 0 && inv[slot - 10].stack > 0)) { - if (Main.npcShop > 0) - return true; - if (inv[slot].type > 0 && inv[slot].stack > 0 || inv[slot - 10].type > 0 && inv[slot - 10].stack > 0) + bool flag2 = true; + if (flag2 && context == 11 && inv[slot].wingSlot > (sbyte) 0) { - Item obj = inv[slot - 10]; - bool flag2 = context != 11 || obj.FitsAccessoryVanitySlot || obj.IsAir; - if (flag2 && context == 11 && inv[slot].wingSlot > (sbyte) 0) + for (int index = 3; index < 10; ++index) { - for (int index = 3; index < 10; ++index) - { - if (inv[index].wingSlot > (sbyte) 0 && index != slot - 10) - flag2 = false; - } + if (inv[index].wingSlot > (sbyte) 0 && index != slot - 10) + flag2 = false; } - if (flag2) + } + if (flag2) + { + Utils.Swap(ref inv[slot], ref inv[slot - 10]); + Main.PlaySound(7); + Recipe.FindRecipes(); + if (inv[slot].stack > 0) { - Utils.Swap(ref inv[slot], ref inv[slot - 10]); - SoundEngine.PlaySound(7); - Recipe.FindRecipes(); - if (inv[slot].stack > 0) + switch (context) { - switch (context) - { - case 0: - AchievementsHelper.NotifyItemPickup(player, inv[slot]); - break; - case 8: - case 9: - case 10: - case 11: - case 12: - case 16: - case 17: - case 25: - case 27: - AchievementsHelper.HandleOnEquip(player, inv[slot], context); - break; - } + case 0: + AchievementsHelper.NotifyItemPickup(player, inv[slot]); + break; + case 8: + case 9: + case 10: + case 11: + case 12: + case 16: + case 17: + AchievementsHelper.HandleOnEquip(player, inv[slot], context); + break; } - else - break; } else break; @@ -1343,89 +890,174 @@ label_95: break; break; case 12: - case 25: - case 27: flag1 = true; - if (Main.mouseRight && Main.mouseRightRelease) + if (Main.mouseRight && Main.mouseRightRelease && Main.mouseItem.stack < Main.mouseItem.maxStack && Main.mouseItem.type > 0 && inv[slot].type > 0 && Main.mouseItem.type == inv[slot].type) { - bool flag3 = false; - if (!flag3 && (Main.mouseItem.stack < Main.mouseItem.maxStack && Main.mouseItem.type > 0 || Main.mouseItem.IsAir) && inv[slot].type > 0 && (Main.mouseItem.type == inv[slot].type || Main.mouseItem.IsAir)) - { - flag3 = true; - if (Main.mouseItem.IsAir) - Main.mouseItem.SetDefaults(inv[slot].type); - else - ++Main.mouseItem.stack; - inv[slot].SetDefaults(); - SoundEngine.PlaySound(7); - } - if (flag3) - { - if (context == 25 && Main.netMode == 1) - NetMessage.SendData(121, number: Main.myPlayer, number2: ((float) player.tileEntityAnchor.interactEntityID), number3: ((float) slot), number4: 1f); - if (context == 27 && Main.netMode == 1) - { - NetMessage.SendData(124, number: Main.myPlayer, number2: ((float) player.tileEntityAnchor.interactEntityID), number3: ((float) slot), number4: 1f); - break; - } - break; - } + ++Main.mouseItem.stack; + inv[slot].SetDefaults(); + Main.PlaySound(7); break; } break; case 15: flag1 = true; - ItemSlot.HandleShopSlot(inv, slot, true, false); + Chest chest = Main.instance.shop[Main.npcShop]; + if (Main.stackSplit <= 1 && Main.mouseRight && inv[slot].type > 0 && (Main.mouseItem.IsTheSameAs(inv[slot]) || Main.mouseItem.type == 0)) + { + int num = Main.superFastStack + 1; + for (int index = 0; index < num; ++index) + { + if ((Main.mouseItem.stack < Main.mouseItem.maxStack || Main.mouseItem.type == 0) && player.BuyItem(inv[slot].GetStoreValue(), inv[slot].shopSpecialCurrency) && inv[slot].stack > 0) + { + if (index == 0) + Main.PlaySound(18); + if (Main.mouseItem.type == 0) + { + Main.mouseItem.netDefaults(inv[slot].netID); + if (inv[slot].prefix != (byte) 0) + Main.mouseItem.Prefix((int) inv[slot].prefix); + Main.mouseItem.stack = 0; + } + ++Main.mouseItem.stack; + Main.stackSplit = Main.stackSplit != 0 ? Main.stackDelay : 15; + if (inv[slot].buyOnce && --inv[slot].stack <= 0) + inv[slot].SetDefaults(); + } + } + break; + } break; } - return flag1; + if (flag1) + return; + if ((context == 0 || context == 4 || context == 3) && Main.mouseRight && Main.mouseRightRelease && inv[slot].maxStack == 1) + { + ItemSlot.SwapEquip(inv, context, slot); + } + else + { + if (Main.stackSplit > 1 || !Main.mouseRight) + return; + bool flag3 = true; + if (context == 0 && inv[slot].maxStack <= 1) + flag3 = false; + if (context == 3 && inv[slot].maxStack <= 1) + flag3 = false; + if (context == 4 && inv[slot].maxStack <= 1) + flag3 = false; + if (!flag3 || !Main.mouseItem.IsTheSameAs(inv[slot]) && Main.mouseItem.type != 0 || Main.mouseItem.stack >= Main.mouseItem.maxStack && Main.mouseItem.type != 0) + return; + if (Main.mouseItem.type == 0) + { + Main.mouseItem = inv[slot].Clone(); + Main.mouseItem.stack = 0; + Main.mouseItem.favorited = inv[slot].favorited && inv[slot].maxStack == 1; + } + ++Main.mouseItem.stack; + --inv[slot].stack; + if (inv[slot].stack <= 0) + inv[slot] = new Item(); + Recipe.FindRecipes(); + Main.soundInstanceMenuTick.Stop(); + Main.soundInstanceMenuTick = Main.soundMenuTick.CreateInstance(); + Main.PlaySound(12); + Main.stackSplit = Main.stackSplit != 0 ? Main.stackDelay : 15; + if (context != 3 || Main.netMode != 1) + return; + NetMessage.SendData(32, number: player.chest, number2: ((float) slot)); + } } - private static void HandleShopSlot( - Item[] inv, - int slot, - bool rightClickIsValid, - bool leftClickIsValid) + public static bool Equippable(ref Item inv, int context = 0) { - if (Main.cursorOverride == 2) - return; - Chest chest = Main.instance.shop[Main.npcShop]; - bool flag = Main.mouseRight & rightClickIsValid || Main.mouseLeft & leftClickIsValid; - if (!(Main.stackSplit <= 1 & flag) || inv[slot].type <= 0 || !Main.mouseItem.IsTheSameAs(inv[slot]) && Main.mouseItem.type != 0) - return; - int num = Main.superFastStack + 1; - Player localPlayer = Main.LocalPlayer; - for (int index = 0; index < num; ++index) + ItemSlot.singleSlotArray[0] = inv; + int num = ItemSlot.Equippable(ItemSlot.singleSlotArray, context, 0) ? 1 : 0; + inv = ItemSlot.singleSlotArray[0]; + return num != 0; + } + + public static bool Equippable(Item[] inv, int context, int slot) + { + Player player = Main.player[Main.myPlayer]; + return inv[slot].dye > (byte) 0 || Main.projHook[inv[slot].shoot] || inv[slot].mountType != -1 || inv[slot].buffType > 0 && Main.lightPet[inv[slot].buffType] || inv[slot].buffType > 0 && Main.vanityPet[inv[slot].buffType] || inv[slot].headSlot >= 0 || inv[slot].bodySlot >= 0 || inv[slot].legSlot >= 0 || inv[slot].accessory; + } + + public static void SwapEquip(ref Item inv, int context = 0) + { + ItemSlot.singleSlotArray[0] = inv; + ItemSlot.SwapEquip(ItemSlot.singleSlotArray, context, 0); + inv = ItemSlot.singleSlotArray[0]; + } + + public static void SwapEquip(Item[] inv, int context, int slot) + { + Player player = Main.player[Main.myPlayer]; + if (inv[slot].dye > (byte) 0) { - if (Main.mouseItem.stack < Main.mouseItem.maxStack || Main.mouseItem.type == 0) + bool success; + inv[slot] = ItemSlot.DyeSwap(inv[slot], out success); + if (success) { - int calcForBuying; - localPlayer.GetItemExpectedPrice(inv[slot], out int _, out calcForBuying); - if (localPlayer.BuyItem(calcForBuying, inv[slot].shopSpecialCurrency) && inv[slot].stack > 0) - { - if (index == 0) - { - if (inv[slot].value > 0) - SoundEngine.PlaySound(18); - else - SoundEngine.PlaySound(7); - } - if (Main.mouseItem.type == 0) - { - Main.mouseItem.netDefaults(inv[slot].netID); - if (inv[slot].prefix != (byte) 0) - Main.mouseItem.Prefix((int) inv[slot].prefix); - Main.mouseItem.stack = 0; - } - if (!inv[slot].buyOnce) - Main.shopSellbackHelper.Add(inv[slot]); - ++Main.mouseItem.stack; - ItemSlot.RefreshStackSplitCooldown(); - if (inv[slot].buyOnce && --inv[slot].stack <= 0) - inv[slot].SetDefaults(); - } + Main.EquipPageSelected = 0; + AchievementsHelper.HandleOnEquip(player, inv[slot], 12); } } + else if (Main.projHook[inv[slot].shoot]) + { + bool success; + inv[slot] = ItemSlot.EquipSwap(inv[slot], player.miscEquips, 4, out success); + if (success) + { + Main.EquipPageSelected = 2; + AchievementsHelper.HandleOnEquip(player, inv[slot], 16); + } + } + else if (inv[slot].mountType != -1 && !MountID.Sets.Cart[inv[slot].mountType]) + { + bool success; + inv[slot] = ItemSlot.EquipSwap(inv[slot], player.miscEquips, 3, out success); + if (success) + { + Main.EquipPageSelected = 2; + AchievementsHelper.HandleOnEquip(player, inv[slot], 17); + } + } + else if (inv[slot].mountType != -1 && MountID.Sets.Cart[inv[slot].mountType]) + { + bool success; + inv[slot] = ItemSlot.EquipSwap(inv[slot], player.miscEquips, 2, out success); + if (success) + Main.EquipPageSelected = 2; + } + else if (inv[slot].buffType > 0 && Main.lightPet[inv[slot].buffType]) + { + bool success; + inv[slot] = ItemSlot.EquipSwap(inv[slot], player.miscEquips, 1, out success); + if (success) + Main.EquipPageSelected = 2; + } + else if (inv[slot].buffType > 0 && Main.vanityPet[inv[slot].buffType]) + { + bool success; + inv[slot] = ItemSlot.EquipSwap(inv[slot], player.miscEquips, 0, out success); + if (success) + Main.EquipPageSelected = 2; + } + else + { + Item obj = inv[slot]; + bool success; + inv[slot] = ItemSlot.ArmorSwap(inv[slot], out success); + if (success) + { + Main.EquipPageSelected = 0; + AchievementsHelper.HandleOnEquip(player, obj, obj.accessory ? 10 : 8); + } + } + Recipe.FindRecipes(); + if (context != 3 || Main.netMode != 1) + return; + NetMessage.SendData(32, number: player.chest, number2: ((float) slot)); } public static void Draw( @@ -1521,32 +1153,6 @@ label_95: break; } break; - case 23: - ID = 5100 + slot; - break; - case 24: - ID = 5100 + slot; - break; - case 25: - ID = 5108 + slot; - break; - case 26: - ID = 5000 + slot; - break; - case 27: - ID = 5002 + slot; - break; - case 29: - ID = 3000 + slot; - if (UILinkPointNavigator.Shortcuts.CREATIVE_ItemSlotShouldHighlightAsSelected) - { - ID = UILinkPointNavigator.CurrentPoint; - break; - } - break; - case 30: - ID = 15000 + slot; - break; } flag1 = UILinkPointNavigator.CurrentPoint == ID; if (context == 0) @@ -1556,78 +1162,60 @@ label_95: num1 = 0; } } - Texture2D texture2D1 = TextureAssets.InventoryBack.Value; + Texture2D texture2D1 = Main.inventoryBackTexture; Color color2 = Main.inventoryBack; bool flag2 = false; if (obj.type > 0 && obj.stack > 0 && obj.favorited && context != 13 && context != 21 && context != 22 && context != 14) - { - texture2D1 = TextureAssets.InventoryBack10.Value; - if (context == 0 && slot < 10 && player.selectedItem == slot) - { - color2 = Color.White; - texture2D1 = TextureAssets.InventoryBack17.Value; - } - } + texture2D1 = Main.inventoryBack10Texture; else if (obj.type > 0 && obj.stack > 0 && ItemSlot.Options.HighlightNewItems && obj.newAndShiny && context != 13 && context != 21 && context != 14 && context != 22) { - texture2D1 = TextureAssets.InventoryBack15.Value; + texture2D1 = Main.inventoryBack15Texture; float num2 = (float) ((double) ((float) Main.mouseTextColor / (float) byte.MaxValue) * 0.200000002980232 + 0.800000011920929); color2 = color2.MultiplyRGBA(new Color(num2, num2, num2)); } else if (PlayerInput.UsingGamepadUI && obj.type > 0 && obj.stack > 0 && num1 != 0 && context != 13 && context != 21 && context != 22) { - texture2D1 = TextureAssets.InventoryBack15.Value; + texture2D1 = Main.inventoryBack15Texture; float num3 = (float) ((double) ((float) Main.mouseTextColor / (float) byte.MaxValue) * 0.200000002980232 + 0.800000011920929); color2 = num1 != 1 ? color2.MultiplyRGBA(new Color(num3 / 2f, num3, num3 / 2f)) : color2.MultiplyRGBA(new Color(num3, num3 / 2f, num3 / 2f)); } else if (context == 0 && slot < 10) - { - texture2D1 = TextureAssets.InventoryBack9.Value; - if (player.selectedItem == slot && !PlayerInput.UsingGamepad) - { - texture2D1 = TextureAssets.InventoryBack14.Value; - color2 = Color.White; - } - } - else if (context == 28) - { - texture2D1 = TextureAssets.InventoryBack7.Value; - color2 = Color.White; - } + texture2D1 = Main.inventoryBack9Texture; else if (context == 10 || context == 8 || context == 16 || context == 17 || context == 19 || context == 18 || context == 20) - texture2D1 = TextureAssets.InventoryBack3.Value; - else if (context == 11 || context == 9 || context == 24 || context == 23 || context == 26) - texture2D1 = TextureAssets.InventoryBack8.Value; - else if (context == 12 || context == 25 || context == 27) + texture2D1 = Main.inventoryBack3Texture; + else if (context == 11 || context == 9) { - texture2D1 = TextureAssets.InventoryBack12.Value; + texture2D1 = Main.inventoryBack8Texture; } else { switch (context) { case 3: - texture2D1 = TextureAssets.InventoryBack5.Value; + texture2D1 = Main.inventoryBack5Texture; break; case 4: - texture2D1 = TextureAssets.InventoryBack2.Value; + texture2D1 = Main.inventoryBack2Texture; + break; + case 12: + texture2D1 = Main.inventoryBack12Texture; break; default: if (context == 7 || context == 5) { - texture2D1 = TextureAssets.InventoryBack4.Value; + texture2D1 = Main.inventoryBack4Texture; break; } switch (context) { case 6: - texture2D1 = TextureAssets.InventoryBack7.Value; + texture2D1 = Main.inventoryBack7Texture; break; case 13: byte num4 = 200; if (slot == Main.player[Main.myPlayer].selectedItem) { - texture2D1 = TextureAssets.InventoryBack14.Value; + texture2D1 = Main.inventoryBack14Texture; num4 = byte.MaxValue; } color2 = new Color((int) num4, (int) num4, (int) num4, (int) num4); @@ -1641,25 +1229,10 @@ label_95: switch (context) { case 15: - texture2D1 = TextureAssets.InventoryBack6.Value; + texture2D1 = Main.inventoryBack6Texture; break; case 22: - texture2D1 = TextureAssets.InventoryBack4.Value; - if (ItemSlot.DrawGoldBGForCraftingMaterial) - { - ItemSlot.DrawGoldBGForCraftingMaterial = false; - texture2D1 = TextureAssets.InventoryBack14.Value; - float t = (float) color2.A / (float) byte.MaxValue; - color2 = Color.White * ((double) t >= 0.699999988079071 ? 1f : Utils.GetLerpValue(0.0f, 0.7f, t, true)); - break; - } - break; - case 29: - color2 = new Color(53, 69, (int) sbyte.MaxValue, (int) byte.MaxValue); - texture2D1 = TextureAssets.InventoryBack18.Value; - break; - case 30: - flag2 = !flag1; + texture2D1 = Main.inventoryBack4Texture; break; } break; @@ -1667,7 +1240,7 @@ label_95: break; } } - if ((context == 0 || context == 2) && ItemSlot.inventoryGlowTime[slot] > 0 && !inv[slot].favorited && !inv[slot].IsAir) + if (context == 0 && ItemSlot.inventoryGlowTime[slot] > 0 && !inv[slot].favorited) { float num5 = Main.invAlpha / (float) byte.MaxValue; Color color3 = new Color(63, 65, 151, (int) byte.MaxValue) * num5; @@ -1677,9 +1250,9 @@ label_95: Color color5 = color4; double num8 = (double) num7 / 2.0; color2 = Color.Lerp(color3, color5, (float) num8); - texture2D1 = TextureAssets.InventoryBack13.Value; + texture2D1 = Main.inventoryBack13Texture; } - if ((context == 4 || context == 3) && ItemSlot.inventoryGlowTimeChest[slot] > 0 && !inv[slot].favorited && !inv[slot].IsAir) + if ((context == 4 || context == 3) && ItemSlot.inventoryGlowTimeChest[slot] > 0 && !inv[slot].favorited) { float num9 = Main.invAlpha / (float) byte.MaxValue; Color color6 = new Color(130, 62, 102, (int) byte.MaxValue) * num9; @@ -1689,16 +1262,11 @@ label_95: float num10 = (float) ItemSlot.inventoryGlowTimeChest[slot] / 300f; float num11 = num10 * num10; color2 = Color.Lerp(color6, color7, num11 / 2f); - texture2D1 = TextureAssets.InventoryBack13.Value; + texture2D1 = Main.inventoryBack13Texture; } if (flag1) { - texture2D1 = TextureAssets.InventoryBack14.Value; - color2 = Color.White; - } - if (context == 28 && Main.MouseScreen.Between(position, position + texture2D1.Size() * inventoryScale) && !player.mouseInterface) - { - texture2D1 = TextureAssets.InventoryBack14.Value; + texture2D1 = Main.inventoryBack14Texture; color2 = Color.White; } if (!flag2) @@ -1707,7 +1275,6 @@ label_95: switch (context) { case 8: - case 23: if (slot == 0) num12 = 0; if (slot == 1) @@ -1730,15 +1297,12 @@ label_95: } break; case 10: - case 24: num12 = 11; break; case 11: num12 = 2; break; case 12: - case 25: - case 27: num12 = 1; break; case 16: @@ -1756,13 +1320,10 @@ label_95: case 20: num12 = 17; break; - case 26: - num12 = 0; - break; } if ((obj.type <= 0 || obj.stack <= 0) && num12 != -1) { - Texture2D texture2D2 = TextureAssets.Extra[54].Value; + Texture2D texture2D2 = Main.extraTexture[54]; Rectangle r = texture2D2.Frame(3, 6, num12 % 3, num12 / 3); r.Width -= 2; r.Height -= 2; @@ -1771,8 +1332,7 @@ label_95: Vector2 vector2 = texture2D1.Size() * inventoryScale; if (obj.type > 0 && obj.stack > 0) { - Main.instance.LoadItem(obj.type); - Texture2D texture2D3 = TextureAssets.Item[obj.type].Value; + Texture2D texture2D3 = Main.itemTexture[obj.type]; Rectangle r = Main.itemAnimations[obj.type] == null ? texture2D3.Frame() : Main.itemAnimations[obj.type].GetFrame(texture2D3); Color currentColor = color1; float scale1 = 1f; @@ -1787,9 +1347,9 @@ label_95: if (obj.color != Color.Transparent) spriteBatch.Draw(texture2D3, position1, new Rectangle?(r), obj.GetColor(color1), 0.0f, origin, scale2 * scale1, SpriteEffects.None, 0.0f); if (ItemID.Sets.TrapSigned[obj.type]) - spriteBatch.Draw(TextureAssets.Wire.Value, position + new Vector2(40f, 40f) * inventoryScale, new Rectangle?(new Rectangle(4, 58, 8, 8)), color1, 0.0f, new Vector2(4f), 1f, SpriteEffects.None, 0.0f); + spriteBatch.Draw(Main.wireTexture, position + new Vector2(40f, 40f) * inventoryScale, new Rectangle?(new Rectangle(4, 58, 8, 8)), color1, 0.0f, new Vector2(4f), 1f, SpriteEffects.None, 0.0f); if (obj.stack > 1) - ChatManager.DrawColorCodedStringWithShadow(spriteBatch, FontAssets.ItemStack.Value, obj.stack.ToString(), position + new Vector2(10f, 26f) * inventoryScale, color1, 0.0f, Vector2.Zero, new Vector2(inventoryScale), spread: inventoryScale); + ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontItemStack, obj.stack.ToString(), position + new Vector2(10f, 26f) * inventoryScale, color1, 0.0f, Vector2.Zero, new Vector2(inventoryScale), spread: inventoryScale); int num14 = -1; if (context == 13) { @@ -1843,32 +1403,32 @@ label_95: } } if (num14 != -1) - ChatManager.DrawColorCodedStringWithShadow(spriteBatch, FontAssets.ItemStack.Value, num14.ToString(), position + new Vector2(8f, 30f) * inventoryScale, color1, 0.0f, Vector2.Zero, new Vector2(inventoryScale * 0.8f), spread: inventoryScale); + ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontItemStack, num14.ToString(), position + new Vector2(8f, 30f) * inventoryScale, color1, 0.0f, Vector2.Zero, new Vector2(inventoryScale * 0.8f), spread: inventoryScale); if (context == 13) { string text = string.Concat((object) (slot + 1)); if (text == "10") text = "0"; - ChatManager.DrawColorCodedStringWithShadow(spriteBatch, FontAssets.ItemStack.Value, text, position + new Vector2(8f, 4f) * inventoryScale, color1, 0.0f, Vector2.Zero, new Vector2(inventoryScale), spread: inventoryScale); + ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontItemStack, text, position + new Vector2(8f, 4f) * inventoryScale, color1, 0.0f, Vector2.Zero, new Vector2(inventoryScale), spread: inventoryScale); } if (context == 13 && obj.potion) { - Vector2 position2 = position + texture2D1.Size() * inventoryScale / 2f - TextureAssets.Cd.Value.Size() * inventoryScale / 2f; + Vector2 position2 = position + texture2D1.Size() * inventoryScale / 2f - Main.cdTexture.Size() * inventoryScale / 2f; Color color8 = obj.GetAlpha(color1) * ((float) player.potionDelay / (float) player.potionDelayTime); - spriteBatch.Draw(TextureAssets.Cd.Value, position2, new Rectangle?(), color8, 0.0f, new Vector2(), scale2, SpriteEffects.None, 0.0f); + spriteBatch.Draw(Main.cdTexture, position2, new Rectangle?(), color8, 0.0f, new Vector2(), scale2, SpriteEffects.None, 0.0f); } if ((context == 10 || context == 18) && obj.expertOnly && !Main.expertMode) { - Vector2 position3 = position + texture2D1.Size() * inventoryScale / 2f - TextureAssets.Cd.Value.Size() * inventoryScale / 2f; + Vector2 position3 = position + texture2D1.Size() * inventoryScale / 2f - Main.cdTexture.Size() * inventoryScale / 2f; Color white = Color.White; - spriteBatch.Draw(TextureAssets.Cd.Value, position3, new Rectangle?(), white, 0.0f, new Vector2(), scale2, SpriteEffects.None, 0.0f); + spriteBatch.Draw(Main.cdTexture, position3, new Rectangle?(), white, 0.0f, new Vector2(), scale2, SpriteEffects.None, 0.0f); } } else if (context == 6) { - Texture2D texture2D4 = TextureAssets.Trash.Value; - Vector2 position4 = position + texture2D1.Size() * inventoryScale / 2f - texture2D4.Size() * inventoryScale / 2f; - spriteBatch.Draw(texture2D4, position4, new Rectangle?(), new Color(100, 100, 100, 100), 0.0f, new Vector2(), inventoryScale, SpriteEffects.None, 0.0f); + Texture2D trashTexture = Main.trashTexture; + Vector2 position4 = position + texture2D1.Size() * inventoryScale / 2f - trashTexture.Size() * inventoryScale / 2f; + spriteBatch.Draw(trashTexture, position4, new Rectangle?(), new Color(100, 100, 100, 100), 0.0f, new Vector2(), inventoryScale, SpriteEffects.None, 0.0f); } if (context == 0 && slot < 10) { @@ -1876,16 +1436,18 @@ label_95: string text = string.Concat((object) (slot + 1)); if (text == "10") text = "0"; - Color baseColor = Main.inventoryBack; + Color inventoryBack = Main.inventoryBack; int num16 = 0; if (Main.player[Main.myPlayer].selectedItem == slot) { - baseColor = Color.White; - baseColor.A = (byte) 200; - num16 -= 2; + num16 -= 3; + inventoryBack.R = byte.MaxValue; + inventoryBack.B = (byte) 0; + inventoryBack.G = (byte) 210; + inventoryBack.A = (byte) 100; float num17 = num15 * 1.4f; } - ChatManager.DrawColorCodedStringWithShadow(spriteBatch, FontAssets.ItemStack.Value, text, position + new Vector2(6f, (float) (4 + num16)) * inventoryScale, baseColor, 0.0f, Vector2.Zero, new Vector2(inventoryScale), spread: inventoryScale); + ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontItemStack, text, position + new Vector2(6f, (float) (4 + num16)) * inventoryScale, inventoryBack, 0.0f, Vector2.Zero, new Vector2(inventoryScale), spread: inventoryScale); } if (ID == -1) return; @@ -1910,38 +1472,32 @@ label_95: if (inv[slot].stack > 1) Main.hoverItemName = Main.hoverItemName + " (" + (object) inv[slot].stack + ")"; Main.HoverItem = inv[slot].Clone(); - Main.HoverItem.tooltipContext = context; if (context == 8 && slot <= 2) Main.HoverItem.wornArmor = true; - else if (context == 11 || context == 9) - { + if (context == 11 || context == 9) Main.HoverItem.social = true; - } - else - { - if (context != 15) - return; - Main.HoverItem.buy = true; - } + if (context != 15) + return; + Main.HoverItem.buy = true; } else { - if (context == 10 || context == 11 || context == 24) + if (context == 10 || context == 11) Main.hoverItemName = Lang.inter[9].Value; if (context == 11) Main.hoverItemName = Lang.inter[11].Value + " " + Main.hoverItemName; - if (context == 8 || context == 9 || context == 23 || context == 26) + if (context == 8 || context == 9) { - if (slot == 0 || slot == 10 || context == 26) + if (slot == 0 || slot == 10) Main.hoverItemName = Lang.inter[12].Value; - else if (slot == 1 || slot == 11) + if (slot == 1 || slot == 11) Main.hoverItemName = Lang.inter[13].Value; - else if (slot == 2 || slot == 12) + if (slot == 2 || slot == 12) Main.hoverItemName = Lang.inter[14].Value; - else if (slot >= 10) + if (slot >= 10) Main.hoverItemName = Lang.inter[11].Value + " " + Main.hoverItemName; } - if (context == 12 || context == 25 || context == 27) + if (context == 12) Main.hoverItemName = Lang.inter[57].Value; if (context == 16) Main.hoverItemName = Lang.inter[90].Value; @@ -1957,109 +1513,14 @@ label_95: } } - public static void SwapEquip(ref Item inv, int context = 0) - { - ItemSlot.singleSlotArray[0] = inv; - ItemSlot.SwapEquip(ItemSlot.singleSlotArray, context, 0); - inv = ItemSlot.singleSlotArray[0]; - } - - public static void SwapEquip(Item[] inv, int context, int slot) + private static bool AccCheck(Item item, int slot) { Player player = Main.player[Main.myPlayer]; - if (ItemSlot.isEquipLocked(inv[slot].type)) - return; - if (inv[slot].dye > (byte) 0) - { - bool success; - inv[slot] = ItemSlot.DyeSwap(inv[slot], out success); - if (success) - { - Main.EquipPageSelected = 0; - AchievementsHelper.HandleOnEquip(player, inv[slot], 12); - } - } - else if (Main.projHook[inv[slot].shoot]) - { - bool success; - inv[slot] = ItemSlot.EquipSwap(inv[slot], player.miscEquips, 4, out success); - if (success) - { - Main.EquipPageSelected = 2; - AchievementsHelper.HandleOnEquip(player, inv[slot], 16); - } - } - else if (inv[slot].mountType != -1 && !MountID.Sets.Cart[inv[slot].mountType]) - { - bool success; - inv[slot] = ItemSlot.EquipSwap(inv[slot], player.miscEquips, 3, out success); - if (success) - { - Main.EquipPageSelected = 2; - AchievementsHelper.HandleOnEquip(player, inv[slot], 17); - } - } - else if (inv[slot].mountType != -1 && MountID.Sets.Cart[inv[slot].mountType]) - { - bool success; - inv[slot] = ItemSlot.EquipSwap(inv[slot], player.miscEquips, 2, out success); - if (success) - Main.EquipPageSelected = 2; - } - else if (inv[slot].buffType > 0 && Main.lightPet[inv[slot].buffType]) - { - bool success; - inv[slot] = ItemSlot.EquipSwap(inv[slot], player.miscEquips, 1, out success); - if (success) - Main.EquipPageSelected = 2; - } - else if (inv[slot].buffType > 0 && Main.vanityPet[inv[slot].buffType]) - { - bool success; - inv[slot] = ItemSlot.EquipSwap(inv[slot], player.miscEquips, 0, out success); - if (success) - Main.EquipPageSelected = 2; - } - else - { - Item obj = inv[slot]; - bool success; - inv[slot] = ItemSlot.ArmorSwap(inv[slot], out success); - if (success) - { - Main.EquipPageSelected = 0; - AchievementsHelper.HandleOnEquip(player, obj, obj.accessory ? 10 : 8); - } - } - Recipe.FindRecipes(); - if (context != 3 || Main.netMode != 1) - return; - NetMessage.SendData(32, number: player.chest, number2: ((float) slot)); - } - - public static bool Equippable(ref Item inv, int context = 0) - { - ItemSlot.singleSlotArray[0] = inv; - int num = ItemSlot.Equippable(ItemSlot.singleSlotArray, context, 0) ? 1 : 0; - inv = ItemSlot.singleSlotArray[0]; - return num != 0; - } - - public static bool Equippable(Item[] inv, int context, int slot) - { - Player player = Main.player[Main.myPlayer]; - return inv[slot].dye > (byte) 0 || Main.projHook[inv[slot].shoot] || inv[slot].mountType != -1 || inv[slot].buffType > 0 && Main.lightPet[inv[slot].buffType] || inv[slot].buffType > 0 && Main.vanityPet[inv[slot].buffType] || inv[slot].headSlot >= 0 || inv[slot].bodySlot >= 0 || inv[slot].legSlot >= 0 || inv[slot].accessory; - } - - private static bool AccCheck(Item[] itemCollection, Item item, int slot) - { - if (ItemSlot.isEquipLocked(item.type)) - return true; - if (slot != -1 && (itemCollection[slot].IsTheSameAs(item) || itemCollection[slot].wingSlot > (sbyte) 0 && item.wingSlot > (sbyte) 0)) + if (slot != -1 && (player.armor[slot].IsTheSameAs(item) || player.armor[slot].wingSlot > (sbyte) 0 && item.wingSlot > (sbyte) 0)) return false; - for (int index = 0; index < itemCollection.Length; ++index) + for (int index = 0; index < player.armor.Length; ++index) { - if (slot < 10 && index < 10 && (item.wingSlot > (sbyte) 0 && itemCollection[index].wingSlot > (sbyte) 0 || slot >= 10 && index >= 10 && item.wingSlot > (sbyte) 0 && itemCollection[index].wingSlot > (sbyte) 0) || item.IsTheSameAs(itemCollection[index])) + if (slot < 10 && index < 10 && (item.wingSlot > (sbyte) 0 && player.armor[index].wingSlot > (sbyte) 0 || slot >= 10 && index >= 10 && item.wingSlot > (sbyte) 0 && player.armor[index].wingSlot > (sbyte) 0) || item.IsTheSameAs(player.armor[index])) return true; } return false; @@ -2087,8 +1548,8 @@ label_95: player.dye[ItemSlot.dyeSlotCount] = item.Clone(); ++ItemSlot.dyeSlotCount; if (ItemSlot.dyeSlotCount >= 10) - ItemSlot.accSlotToSwapTo = 0; - SoundEngine.PlaySound(7); + ItemSlot.accSlotCount = 0; + Main.PlaySound(7); Recipe.FindRecipes(); success = true; return obj; @@ -2120,43 +1581,39 @@ label_95: } else if (item.accessory) { - int num = 3; - for (int slot = 3; slot < 10; ++slot) + int num = 5 + Main.player[Main.myPlayer].extraAccessorySlots; + for (int index2 = 3; index2 < 3 + num; ++index2) { - if (player.IsAValidEquipmentSlotForIteration(slot)) + if (player.armor[index2].type == 0) { - num = slot; - if (player.armor[slot].type == 0) - { - ItemSlot.accSlotToSwapTo = slot - 3; - break; - } + ItemSlot.accSlotCount = index2 - 3; + break; } } - for (int index2 = 0; index2 < player.armor.Length; ++index2) + for (int index3 = 0; index3 < player.armor.Length; ++index3) { - if (item.IsTheSameAs(player.armor[index2])) - ItemSlot.accSlotToSwapTo = index2 - 3; - if (index2 < 10 && item.wingSlot > (sbyte) 0 && player.armor[index2].wingSlot > (sbyte) 0) - ItemSlot.accSlotToSwapTo = index2 - 3; + if (item.IsTheSameAs(player.armor[index3])) + ItemSlot.accSlotCount = index3 - 3; + if (index3 < 10 && item.wingSlot > (sbyte) 0 && player.armor[index3].wingSlot > (sbyte) 0) + ItemSlot.accSlotCount = index3 - 3; } - if (ItemSlot.accSlotToSwapTo > num) - return item; - if (ItemSlot.accSlotToSwapTo < 0) - ItemSlot.accSlotToSwapTo = num - 3; - int index3 = 3 + ItemSlot.accSlotToSwapTo; - if (ItemSlot.isEquipLocked(player.armor[index3].type)) - return item; - for (int index4 = 0; index4 < player.armor.Length; ++index4) + if (ItemSlot.accSlotCount >= num) + ItemSlot.accSlotCount = 0; + if (ItemSlot.accSlotCount < 0) + ItemSlot.accSlotCount = num - 1; + int index4 = 3 + ItemSlot.accSlotCount; + for (int index5 = 0; index5 < player.armor.Length; ++index5) { - if (item.IsTheSameAs(player.armor[index4])) - index3 = index4; + if (item.IsTheSameAs(player.armor[index5])) + index4 = index5; } - obj = player.armor[index3].Clone(); - player.armor[index3] = item.Clone(); - ItemSlot.accSlotToSwapTo = 0; + obj = player.armor[index4].Clone(); + player.armor[index4] = item.Clone(); + ++ItemSlot.accSlotCount; + if (ItemSlot.accSlotCount >= num) + ItemSlot.accSlotCount = 0; } - SoundEngine.PlaySound(7); + Main.PlaySound(7); Recipe.FindRecipes(); success = true; return obj; @@ -2169,12 +1626,35 @@ label_95: item.favorited = false; Item obj = inv[slot].Clone(); inv[slot] = item.Clone(); - SoundEngine.PlaySound(7); + Main.PlaySound(7); Recipe.FindRecipes(); success = true; return obj; } + public static void EquipPage(Item item) + { + Main.EquipPage = -1; + if (Main.projHook[item.shoot]) + Main.EquipPage = 2; + else if (item.mountType != -1) + Main.EquipPage = 2; + else if (item.buffType > 0 && Main.vanityPet[item.buffType]) + Main.EquipPage = 2; + else if (item.buffType > 0 && Main.lightPet[item.buffType]) + Main.EquipPage = 2; + else if (item.dye > (byte) 0 && Main.EquipPageSelected == 1) + { + Main.EquipPage = 0; + } + else + { + if (item.legSlot == -1 && item.headSlot == -1 && item.bodySlot == -1 && !item.accessory) + return; + Main.EquipPage = 0; + } + } + public static void DrawMoney( SpriteBatch sb, string text, @@ -2183,29 +1663,27 @@ label_95: int[] coinsArray, bool horizontal = false) { - Utils.DrawBorderStringFourWay(sb, FontAssets.MouseText.Value, text, shopx, shopy + 40f, Color.White * ((float) Main.mouseTextColor / (float) byte.MaxValue), Color.Black, Vector2.Zero); + Utils.DrawBorderStringFourWay(sb, Main.fontMouseText, text, shopx, shopy + 40f, Color.White * ((float) Main.mouseTextColor / (float) byte.MaxValue), Color.Black, Vector2.Zero); if (horizontal) { for (int index = 0; index < 4; ++index) { - Main.instance.LoadItem(74 - index); if (index == 0) { int coins = coinsArray[3 - index]; } - Vector2 position = new Vector2((float) ((double) shopx + (double) ChatManager.GetStringSize(FontAssets.MouseText.Value, text, Vector2.One).X + (double) (24 * index) + 45.0), shopy + 50f); - sb.Draw(TextureAssets.Item[74 - index].Value, position, new Rectangle?(), Color.White, 0.0f, TextureAssets.Item[74 - index].Value.Size() / 2f, 1f, SpriteEffects.None, 0.0f); - Utils.DrawBorderStringFourWay(sb, FontAssets.ItemStack.Value, coinsArray[3 - index].ToString(), position.X - 11f, position.Y, Color.White, Color.Black, new Vector2(0.3f), 0.75f); + Vector2 position = new Vector2((float) ((double) shopx + (double) ChatManager.GetStringSize(Main.fontMouseText, text, Vector2.One).X + (double) (24 * index) + 45.0), shopy + 50f); + sb.Draw(Main.itemTexture[74 - index], position, new Rectangle?(), Color.White, 0.0f, Main.itemTexture[74 - index].Size() / 2f, 1f, SpriteEffects.None, 0.0f); + Utils.DrawBorderStringFourWay(sb, Main.fontItemStack, coinsArray[3 - index].ToString(), position.X - 11f, position.Y, Color.White, Color.Black, new Vector2(0.3f), 0.75f); } } else { for (int index = 0; index < 4; ++index) { - Main.instance.LoadItem(74 - index); int num = index != 0 || coinsArray[3 - index] <= 99 ? 0 : -6; - sb.Draw(TextureAssets.Item[74 - index].Value, new Vector2(shopx + 11f + (float) (24 * index), shopy + 75f), new Rectangle?(), Color.White, 0.0f, TextureAssets.Item[74 - index].Value.Size() / 2f, 1f, SpriteEffects.None, 0.0f); - Utils.DrawBorderStringFourWay(sb, FontAssets.ItemStack.Value, coinsArray[3 - index].ToString(), shopx + (float) (24 * index) + (float) num, shopy + 75f, Color.White, Color.Black, new Vector2(0.3f), 0.75f); + sb.Draw(Main.itemTexture[74 - index], new Vector2(shopx + 11f + (float) (24 * index), shopy + 75f), new Rectangle?(), Color.White, 0.0f, Main.itemTexture[74 - index].Size() / 2f, 1f, SpriteEffects.None, 0.0f); + Utils.DrawBorderStringFourWay(sb, Main.fontItemStack, coinsArray[3 - index].ToString(), shopx + (float) (24 * index) + (float) num, shopy + 75f, Color.White, Color.Black, new Vector2(0.3f), 0.75f); } } } @@ -2223,26 +1701,123 @@ label_95: long num1 = Utils.CoinsCount(out overFlowing, player.bank.item); long num2 = Utils.CoinsCount(out overFlowing, player.bank2.item); long num3 = Utils.CoinsCount(out overFlowing, player.bank3.item); - long num4 = Utils.CoinsCount(out overFlowing, player.bank4.item); - long count = Utils.CoinsCombineStacks(out overFlowing, num1, num2, num3, num4); + long count = Utils.CoinsCombineStacks(out overFlowing, num1, num2, num3); if (count <= 0L) return; - Main.instance.LoadItem(4076); - Main.instance.LoadItem(3813); - Main.instance.LoadItem(346); - Main.instance.LoadItem(87); - if (num4 > 0L) - sb.Draw(TextureAssets.Item[4076].Value, Utils.CenteredRectangle(new Vector2(shopx + 92f, shopy + 45f), TextureAssets.Item[4076].Value.Size() * 0.65f), new Rectangle?(), Color.White); if (num3 > 0L) - sb.Draw(TextureAssets.Item[3813].Value, Utils.CenteredRectangle(new Vector2(shopx + 92f, shopy + 45f), TextureAssets.Item[3813].Value.Size() * 0.65f), new Rectangle?(), Color.White); + sb.Draw(Main.itemTexture[3813], Utils.CenteredRectangle(new Vector2(shopx + 92f, shopy + 45f), Main.itemTexture[3813].Size() * 0.65f), new Rectangle?(), Color.White); if (num2 > 0L) - sb.Draw(TextureAssets.Item[346].Value, Utils.CenteredRectangle(new Vector2(shopx + 80f, shopy + 50f), TextureAssets.Item[346].Value.Size() * 0.65f), new Rectangle?(), Color.White); + sb.Draw(Main.itemTexture[346], Utils.CenteredRectangle(new Vector2(shopx + 80f, shopy + 50f), Main.itemTexture[346].Size() * 0.65f), new Rectangle?(), Color.White); if (num1 > 0L) - sb.Draw(TextureAssets.Item[87].Value, Utils.CenteredRectangle(new Vector2(shopx + 70f, shopy + 60f), TextureAssets.Item[87].Value.Size() * 0.65f), new Rectangle?(), Color.White); + sb.Draw(Main.itemTexture[87], Utils.CenteredRectangle(new Vector2(shopx + 70f, shopy + 60f), Main.itemTexture[87].Size() * 0.65f), new Rectangle?(), Color.White); ItemSlot.DrawMoney(sb, Lang.inter[66].Value, shopx, shopy, Utils.CoinsSplit(count), horizontal); } } + public static void DrawRadialDpad(SpriteBatch sb, Vector2 position) + { + if (!PlayerInput.UsingGamepad || !PlayerInput.CurrentProfile.UsingDpadHotbar()) + return; + Player player = Main.player[Main.myPlayer]; + if (player.chest != -1) + return; + Texture2D texture2D = Main.hotbarRadialTexture[0]; + float num = (float) Main.mouseTextColor / (float) byte.MaxValue; + Color color = Color.White * ((float) (1.0 - (1.0 - (double) num) * (1.0 - (double) num)) * 0.785f); + sb.Draw(texture2D, position, new Rectangle?(), color, 0.0f, texture2D.Size() / 2f, Main.inventoryScale, SpriteEffects.None, 0.0f); + for (int index = 0; index < 4; ++index) + { + int binding = player.DpadRadial.Bindings[index]; + if (binding != -1) + ItemSlot.Draw(sb, player.inventory, 14, binding, position + new Vector2((float) (texture2D.Width / 3), 0.0f).RotatedBy(1.57079637050629 * (double) index - 1.57079637050629) + new Vector2(-26f * Main.inventoryScale), Color.White); + } + } + + public static void DrawRadialCircular(SpriteBatch sb, Vector2 position) + { + ItemSlot.CircularRadialOpacity = MathHelper.Clamp(ItemSlot.CircularRadialOpacity + (!PlayerInput.UsingGamepad || !PlayerInput.Triggers.Current.RadialHotbar ? -0.15f : 0.25f), 0.0f, 1f); + if ((double) ItemSlot.CircularRadialOpacity == 0.0) + return; + Player player = Main.player[Main.myPlayer]; + Texture2D texture2D1 = Main.hotbarRadialTexture[2]; + float num1 = ItemSlot.CircularRadialOpacity * 0.9f; + float num2 = ItemSlot.CircularRadialOpacity * 1f; + float num3 = (float) Main.mouseTextColor / (float) byte.MaxValue; + Color color = Color.White * ((float) (1.0 - (1.0 - (double) num3) * (1.0 - (double) num3)) * 0.785f) * num1; + Texture2D texture2D2 = Main.hotbarRadialTexture[1]; + float num4 = 6.283185f / (float) player.CircularRadial.RadialCount; + float num5 = -1.570796f; + for (int index = 0; index < player.CircularRadial.RadialCount; ++index) + { + int binding = player.CircularRadial.Bindings[index]; + Vector2 vector2 = new Vector2(150f, 0.0f).RotatedBy((double) num5 + (double) num4 * (double) index) * num2; + float num6 = 0.85f; + if (player.CircularRadial.SelectedBinding == index) + num6 = 1.7f; + sb.Draw(texture2D2, position + vector2, new Rectangle?(), color * num6, 0.0f, texture2D2.Size() / 2f, num2 * num6, SpriteEffects.None, 0.0f); + if (binding != -1) + { + double inventoryScale = (double) Main.inventoryScale; + Main.inventoryScale = num2 * num6; + ItemSlot.Draw(sb, player.inventory, 14, binding, position + vector2 + new Vector2(-26f * num2 * num6), Color.White); + Main.inventoryScale = (float) inventoryScale; + } + } + } + + public static void DrawRadialQuicks(SpriteBatch sb, Vector2 position) + { + ItemSlot.QuicksRadialOpacity = MathHelper.Clamp(ItemSlot.QuicksRadialOpacity + (!PlayerInput.UsingGamepad || !PlayerInput.Triggers.Current.RadialQuickbar ? -0.15f : 0.25f), 0.0f, 1f); + if ((double) ItemSlot.QuicksRadialOpacity == 0.0) + return; + Player player = Main.player[Main.myPlayer]; + Texture2D texture2D = Main.hotbarRadialTexture[2]; + Texture2D quicksIconTexture = Main.quicksIconTexture; + float num1 = ItemSlot.QuicksRadialOpacity * 0.9f; + float num2 = ItemSlot.QuicksRadialOpacity * 1f; + float num3 = (float) Main.mouseTextColor / (float) byte.MaxValue; + Color color = Color.White * ((float) (1.0 - (1.0 - (double) num3) * (1.0 - (double) num3)) * 0.785f) * num1; + float num4 = 6.283185f / (float) player.QuicksRadial.RadialCount; + float num5 = -1.570796f; + Item obj1 = player.QuickHeal_GetItemToUse(); + Item obj2 = player.QuickMana_GetItemToUse(); + Item obj3 = (Item) null; + if (obj1 == null) + { + obj1 = new Item(); + obj1.SetDefaults(28); + } + if (obj2 == null) + { + obj2 = new Item(); + obj2.SetDefaults(110); + } + if (obj3 == null) + { + obj3 = new Item(); + obj3.SetDefaults(292); + } + for (int index = 0; index < player.QuicksRadial.RadialCount; ++index) + { + Item inv = obj1; + if (index == 1) + inv = obj3; + if (index == 2) + inv = obj2; + int binding = player.QuicksRadial.Bindings[index]; + Vector2 vector2 = new Vector2(120f, 0.0f).RotatedBy((double) num5 + (double) num4 * (double) index) * num2; + float num6 = 0.85f; + if (player.QuicksRadial.SelectedBinding == index) + num6 = 1.7f; + sb.Draw(texture2D, position + vector2, new Rectangle?(), color * num6, 0.0f, texture2D.Size() / 2f, (float) ((double) num2 * (double) num6 * 1.29999995231628), SpriteEffects.None, 0.0f); + double inventoryScale = (double) Main.inventoryScale; + Main.inventoryScale = num2 * num6; + ItemSlot.Draw(sb, ref inv, 14, position + vector2 + new Vector2(-26f * num2 * num6), Color.White); + Main.inventoryScale = (float) inventoryScale; + sb.Draw(quicksIconTexture, position + vector2 + new Vector2(34f, 20f) * 0.85f * num2 * num6, new Rectangle?(), color * num6, 0.0f, texture2D.Size() / 2f, (float) ((double) num2 * (double) num6 * 1.29999995231628), SpriteEffects.None, 0.0f); + } + } + public static void GetItemLight(ref Color currentColor, Item item, bool outInTheWorld = false) { float scale = 1f; @@ -2270,7 +1845,7 @@ label_95: int type, bool outInTheWorld = false) { - if (type < 0 || type > 5045) + if (type < 0 || type > 3930) return currentColor; if (type == 662 || type == 663) { @@ -2287,7 +1862,7 @@ label_95: currentColor.B = (byte) ((double) currentColor.B * (double) scale); currentColor.A = (byte) ((double) currentColor.A * (double) scale); } - else if (type == 58 || type == 184 || type == 4143) + else if (type == 58 || type == 184) { scale = (float) ((double) Main.essScale * 0.25 + 0.75); currentColor.R = (byte) ((double) currentColor.R * (double) scale); @@ -2298,118 +1873,6 @@ label_95: return currentColor; } - public static void DrawRadialCircular(SpriteBatch sb, Vector2 position) - { - ItemSlot.CircularRadialOpacity = MathHelper.Clamp(ItemSlot.CircularRadialOpacity + (!PlayerInput.UsingGamepad || !PlayerInput.Triggers.Current.RadialHotbar ? -0.15f : 0.25f), 0.0f, 1f); - if ((double) ItemSlot.CircularRadialOpacity == 0.0) - return; - Player player = Main.player[Main.myPlayer]; - Texture2D texture2D1 = TextureAssets.HotbarRadial[2].Value; - float num1 = ItemSlot.CircularRadialOpacity * 0.9f; - float num2 = ItemSlot.CircularRadialOpacity * 1f; - float num3 = (float) Main.mouseTextColor / (float) byte.MaxValue; - Color color = Color.White * ((float) (1.0 - (1.0 - (double) num3) * (1.0 - (double) num3)) * 0.785f) * num1; - Texture2D texture2D2 = TextureAssets.HotbarRadial[1].Value; - float num4 = 6.283185f / (float) player.CircularRadial.RadialCount; - float num5 = -1.570796f; - for (int index = 0; index < player.CircularRadial.RadialCount; ++index) - { - int binding = player.CircularRadial.Bindings[index]; - Vector2 vector2 = new Vector2(150f, 0.0f).RotatedBy((double) num5 + (double) num4 * (double) index) * num2; - float num6 = 0.85f; - if (player.CircularRadial.SelectedBinding == index) - num6 = 1.7f; - sb.Draw(texture2D2, position + vector2, new Rectangle?(), color * num6, 0.0f, texture2D2.Size() / 2f, num2 * num6, SpriteEffects.None, 0.0f); - if (binding != -1) - { - double inventoryScale = (double) Main.inventoryScale; - Main.inventoryScale = num2 * num6; - ItemSlot.Draw(sb, player.inventory, 14, binding, position + vector2 + new Vector2(-26f * num2 * num6), Color.White); - Main.inventoryScale = (float) inventoryScale; - } - } - } - - public static void DrawRadialQuicks(SpriteBatch sb, Vector2 position) - { - ItemSlot.QuicksRadialOpacity = MathHelper.Clamp(ItemSlot.QuicksRadialOpacity + (!PlayerInput.UsingGamepad || !PlayerInput.Triggers.Current.RadialQuickbar ? -0.15f : 0.25f), 0.0f, 1f); - if ((double) ItemSlot.QuicksRadialOpacity == 0.0) - return; - Player player = Main.player[Main.myPlayer]; - Texture2D texture2D = TextureAssets.HotbarRadial[2].Value; - Texture2D texture = TextureAssets.QuicksIcon.Value; - float num1 = ItemSlot.QuicksRadialOpacity * 0.9f; - float num2 = ItemSlot.QuicksRadialOpacity * 1f; - float num3 = (float) Main.mouseTextColor / (float) byte.MaxValue; - Color color = Color.White * ((float) (1.0 - (1.0 - (double) num3) * (1.0 - (double) num3)) * 0.785f) * num1; - float num4 = 6.283185f / (float) player.QuicksRadial.RadialCount; - float num5 = -1.570796f; - Item obj1 = player.QuickHeal_GetItemToUse(); - Item obj2 = player.QuickMana_GetItemToUse(); - Item obj3 = (Item) null; - Item obj4 = (Item) null; - if (obj1 == null) - { - obj1 = new Item(); - obj1.SetDefaults(28); - } - if (obj2 == null) - { - obj2 = new Item(); - obj2.SetDefaults(110); - } - if (obj3 == null) - { - obj3 = new Item(); - obj3.SetDefaults(292); - } - if (obj4 == null) - { - obj4 = new Item(); - obj4.SetDefaults(2428); - } - for (int index = 0; index < player.QuicksRadial.RadialCount; ++index) - { - Item inv = obj4; - if (index == 1) - inv = obj1; - if (index == 2) - inv = obj3; - if (index == 3) - inv = obj2; - int binding = player.QuicksRadial.Bindings[index]; - Vector2 vector2 = new Vector2(120f, 0.0f).RotatedBy((double) num5 + (double) num4 * (double) index) * num2; - float num6 = 0.85f; - if (player.QuicksRadial.SelectedBinding == index) - num6 = 1.7f; - sb.Draw(texture2D, position + vector2, new Rectangle?(), color * num6, 0.0f, texture2D.Size() / 2f, (float) ((double) num2 * (double) num6 * 1.29999995231628), SpriteEffects.None, 0.0f); - double inventoryScale = (double) Main.inventoryScale; - Main.inventoryScale = num2 * num6; - ItemSlot.Draw(sb, ref inv, 14, position + vector2 + new Vector2(-26f * num2 * num6), Color.White); - Main.inventoryScale = (float) inventoryScale; - sb.Draw(texture, position + vector2 + new Vector2(34f, 20f) * 0.85f * num2 * num6, new Rectangle?(), color * num6, 0.0f, texture2D.Size() / 2f, (float) ((double) num2 * (double) num6 * 1.29999995231628), SpriteEffects.None, 0.0f); - } - } - - public static void DrawRadialDpad(SpriteBatch sb, Vector2 position) - { - if (!PlayerInput.UsingGamepad || !PlayerInput.CurrentProfile.UsingDpadHotbar()) - return; - Player player = Main.player[Main.myPlayer]; - if (player.chest != -1) - return; - Texture2D texture2D = TextureAssets.HotbarRadial[0].Value; - float num = (float) Main.mouseTextColor / (float) byte.MaxValue; - Color color = Color.White * ((float) (1.0 - (1.0 - (double) num) * (1.0 - (double) num)) * 0.785f); - sb.Draw(texture2D, position, new Rectangle?(), color, 0.0f, texture2D.Size() / 2f, Main.inventoryScale, SpriteEffects.None, 0.0f); - for (int index = 0; index < 4; ++index) - { - int binding = player.DpadRadial.Bindings[index]; - if (binding != -1) - ItemSlot.Draw(sb, player.inventory, 14, binding, position + new Vector2((float) (texture2D.Width / 3), 0.0f).RotatedBy(1.57079637050629 * (double) index - 1.57079637050629) + new Vector2(-26f * Main.inventoryScale), Color.White); - } - } - public static string GetGamepadInstructions(ref Item inv, int context = 0) { ItemSlot.singleSlotArray[0] = inv; @@ -2421,40 +1884,40 @@ label_95: public static string GetGamepadInstructions(Item[] inv, int context = 0, int slot = 0) { Player player = Main.player[Main.myPlayer]; - string s = ""; + string str1 = ""; if (inv == null || inv[slot] == null || Main.mouseItem == null) - return s; + return str1; if (context == 0 || context == 1 || context == 2) { if (inv[slot].type > 0 && inv[slot].stack > 0) { - string str; + string str2; if (Main.mouseItem.type > 0) { - str = s + PlayerInput.BuildCommand(Lang.misc[65].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); + str2 = str1 + PlayerInput.BuildCommand(Lang.misc[65].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); if (inv[slot].type == Main.mouseItem.type && Main.mouseItem.stack < inv[slot].maxStack && inv[slot].maxStack > 1) - str += PlayerInput.BuildCommand(Lang.misc[55].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseRight"]); + str2 += PlayerInput.BuildCommand(Lang.misc[55].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseRight"]); } else { if (context == 0 && player.chest == -1) player.DpadRadial.ChangeBinding(slot); - str = s + PlayerInput.BuildCommand(Lang.misc[54].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); + str2 = str1 + PlayerInput.BuildCommand(Lang.misc[54].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); if (inv[slot].maxStack > 1) - str += PlayerInput.BuildCommand(Lang.misc[55].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseRight"]); + str2 += PlayerInput.BuildCommand(Lang.misc[55].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseRight"]); } if (inv[slot].maxStack == 1 && ItemSlot.Equippable(inv, context, slot)) { - str += PlayerInput.BuildCommand(Lang.misc[67].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Grapple"]); + str2 += PlayerInput.BuildCommand(Lang.misc[67].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Grapple"]); if (PlayerInput.Triggers.JustPressed.Grapple) ItemSlot.SwapEquip(inv, context, slot); } - s = str + PlayerInput.BuildCommand(Lang.misc[83].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["SmartCursor"]); + str1 = str2 + PlayerInput.BuildCommand(Lang.misc[83].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["SmartCursor"]); if (PlayerInput.Triggers.JustPressed.SmartCursor) inv[slot].favorited = !inv[slot].favorited; } else if (Main.mouseItem.type > 0) - s += PlayerInput.BuildCommand(Lang.misc[65].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); + str1 += PlayerInput.BuildCommand(Lang.misc[65].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); } if (context == 3 || context == 4) { @@ -2462,25 +1925,25 @@ label_95: { if (Main.mouseItem.type > 0) { - s += PlayerInput.BuildCommand(Lang.misc[65].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); + str1 += PlayerInput.BuildCommand(Lang.misc[65].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); if (inv[slot].type == Main.mouseItem.type && Main.mouseItem.stack < inv[slot].maxStack && inv[slot].maxStack > 1) - s += PlayerInput.BuildCommand(Lang.misc[55].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseRight"]); + str1 += PlayerInput.BuildCommand(Lang.misc[55].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseRight"]); } else { - s += PlayerInput.BuildCommand(Lang.misc[54].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); + str1 += PlayerInput.BuildCommand(Lang.misc[54].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); if (inv[slot].maxStack > 1) - s += PlayerInput.BuildCommand(Lang.misc[55].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseRight"]); + str1 += PlayerInput.BuildCommand(Lang.misc[55].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseRight"]); } if (inv[slot].maxStack == 1 && ItemSlot.Equippable(inv, context, slot)) { - s += PlayerInput.BuildCommand(Lang.misc[67].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Grapple"]); + str1 += PlayerInput.BuildCommand(Lang.misc[67].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Grapple"]); if (PlayerInput.Triggers.JustPressed.Grapple) ItemSlot.SwapEquip(inv, context, slot); } } else if (Main.mouseItem.type > 0) - s += PlayerInput.BuildCommand(Lang.misc[65].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); + str1 += PlayerInput.BuildCommand(Lang.misc[65].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); } if (context == 15) { @@ -2489,13 +1952,13 @@ label_95: if (Main.mouseItem.type > 0) { if (inv[slot].type == Main.mouseItem.type && Main.mouseItem.stack < inv[slot].maxStack && inv[slot].maxStack > 1) - s += PlayerInput.BuildCommand(Lang.misc[91].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseRight"]); + str1 += PlayerInput.BuildCommand(Lang.misc[91].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseRight"]); } else - s += PlayerInput.BuildCommand(Lang.misc[90].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"], PlayerInput.ProfileGamepadUI.KeyStatus["MouseRight"]); + str1 += PlayerInput.BuildCommand(Lang.misc[90].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"], PlayerInput.ProfileGamepadUI.KeyStatus["MouseRight"]); } else if (Main.mouseItem.type > 0) - s += PlayerInput.BuildCommand(Lang.misc[92].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); + str1 += PlayerInput.BuildCommand(Lang.misc[92].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); } if (context == 8 || context == 9 || context == 16 || context == 17 || context == 18 || context == 19 || context == 20) { @@ -2504,18 +1967,18 @@ label_95: if (Main.mouseItem.type > 0) { if (ItemSlot.Equippable(ref Main.mouseItem, context)) - s += PlayerInput.BuildCommand(Lang.misc[65].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); + str1 += PlayerInput.BuildCommand(Lang.misc[65].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); } - else if (context != 8 || !ItemSlot.isEquipLocked(inv[slot].type)) - s += PlayerInput.BuildCommand(Lang.misc[54].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); + else + str1 += PlayerInput.BuildCommand(Lang.misc[54].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); if (context == 8 && slot >= 3) { - bool flag = player.hideVisibleAccessory[slot]; - s += PlayerInput.BuildCommand(Lang.misc[flag ? 77 : 78].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Grapple"]); + bool flag = player.hideVisual[slot]; + str1 += PlayerInput.BuildCommand(Lang.misc[flag ? 77 : 78].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Grapple"]); if (PlayerInput.Triggers.JustPressed.Grapple) { - player.hideVisibleAccessory[slot] = !player.hideVisibleAccessory[slot]; - SoundEngine.PlaySound(12); + player.hideVisual[slot] = !player.hideVisual[slot]; + Main.PlaySound(12); if (Main.netMode == 1) NetMessage.SendData(4, number: Main.myPlayer); } @@ -2523,11 +1986,11 @@ label_95: if ((context == 16 || context == 17 || context == 18 || context == 19 || context == 20) && slot < 2) { bool flag = player.hideMisc[slot]; - s += PlayerInput.BuildCommand(Lang.misc[flag ? 77 : 78].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Grapple"]); + str1 += PlayerInput.BuildCommand(Lang.misc[flag ? 77 : 78].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Grapple"]); if (PlayerInput.Triggers.JustPressed.Grapple) { player.hideMisc[slot] = !player.hideMisc[slot]; - SoundEngine.PlaySound(12); + Main.PlaySound(12); if (Main.netMode == 1) NetMessage.SendData(4, number: Main.myPlayer); } @@ -2536,15 +1999,15 @@ label_95: else { if (Main.mouseItem.type > 0 && ItemSlot.Equippable(ref Main.mouseItem, context)) - s += PlayerInput.BuildCommand(Lang.misc[65].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); + str1 += PlayerInput.BuildCommand(Lang.misc[65].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); if (context == 8 && slot >= 3) { - bool flag = player.hideVisibleAccessory[slot]; - s += PlayerInput.BuildCommand(Lang.misc[flag ? 77 : 78].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Grapple"]); + bool flag = player.hideVisual[slot]; + str1 += PlayerInput.BuildCommand(Lang.misc[flag ? 77 : 78].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Grapple"]); if (PlayerInput.Triggers.JustPressed.Grapple) { - player.hideVisibleAccessory[slot] = !player.hideVisibleAccessory[slot]; - SoundEngine.PlaySound(12); + player.hideVisual[slot] = !player.hideVisual[slot]; + Main.PlaySound(12); if (Main.netMode == 1) NetMessage.SendData(4, number: Main.myPlayer); } @@ -2552,7 +2015,7 @@ label_95: if ((context == 16 || context == 17 || context == 18 || context == 19 || context == 20) && slot < 2) { bool flag = player.hideMisc[slot]; - s += PlayerInput.BuildCommand(Lang.misc[flag ? 77 : 78].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Grapple"]); + str1 += PlayerInput.BuildCommand(Lang.misc[flag ? 77 : 78].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Grapple"]); if (PlayerInput.Triggers.JustPressed.Grapple) { if (slot == 0) @@ -2560,228 +2023,153 @@ label_95: if (slot == 1) player.ToggleLight(); Main.mouseLeftRelease = false; - SoundEngine.PlaySound(12); + Main.PlaySound(12); if (Main.netMode == 1) NetMessage.SendData(4, number: Main.myPlayer); } } } } - if (context == 12 || context == 25 || context == 27) + switch (context) { - if (inv[slot].type > 0 && inv[slot].stack > 0) - { - if (Main.mouseItem.type > 0) + case 6: + if (inv[slot].type > 0 && inv[slot].stack > 0) { - if (Main.mouseItem.dye > (byte) 0) - s += PlayerInput.BuildCommand(Lang.misc[65].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); + if (Main.mouseItem.type > 0) + str1 += PlayerInput.BuildCommand(Lang.misc[74].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); + else + str1 += PlayerInput.BuildCommand(Lang.misc[54].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); } - else - s += PlayerInput.BuildCommand(Lang.misc[54].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); - if (context == 12 || context == 25 || context == 27) + else if (Main.mouseItem.type > 0) + str1 += PlayerInput.BuildCommand(Lang.misc[74].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); + return str1; + case 12: + if (inv[slot].type > 0 && inv[slot].stack > 0) { - int num = -1; - if (inv == player.dye) - num = slot; - if (inv == player.miscDyes) - num = 10 + slot; - if (num != -1) + if (Main.mouseItem.type > 0) { - if (num < 10) + if (Main.mouseItem.dye > (byte) 0) + str1 += PlayerInput.BuildCommand(Lang.misc[65].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); + } + else + str1 += PlayerInput.BuildCommand(Lang.misc[54].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); + if (context == 12) + { + int num = -1; + if (inv == player.dye) + num = slot; + if (inv == player.miscDyes) + num = 10 + slot; + if (num != -1) { - bool flag = player.hideVisibleAccessory[slot]; - s += PlayerInput.BuildCommand(Lang.misc[flag ? 77 : 78].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Grapple"]); - if (PlayerInput.Triggers.JustPressed.Grapple) + if (num < 10) { - player.hideVisibleAccessory[slot] = !player.hideVisibleAccessory[slot]; - SoundEngine.PlaySound(12); - if (Main.netMode == 1) - NetMessage.SendData(4, number: Main.myPlayer); + bool flag = player.hideVisual[slot]; + str1 += PlayerInput.BuildCommand(Lang.misc[flag ? 77 : 78].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Grapple"]); + if (PlayerInput.Triggers.JustPressed.Grapple) + { + player.hideVisual[slot] = !player.hideVisual[slot]; + Main.PlaySound(12); + if (Main.netMode == 1) + NetMessage.SendData(4, number: Main.myPlayer); + } } + else + { + bool flag = player.hideMisc[slot]; + str1 += PlayerInput.BuildCommand(Lang.misc[flag ? 77 : 78].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Grapple"]); + if (PlayerInput.Triggers.JustPressed.Grapple) + { + player.hideMisc[slot] = !player.hideMisc[slot]; + Main.PlaySound(12); + if (Main.netMode == 1) + NetMessage.SendData(4, number: Main.myPlayer); + } + } + } + } + } + else if (Main.mouseItem.type > 0 && Main.mouseItem.dye > (byte) 0) + str1 += PlayerInput.BuildCommand(Lang.misc[65].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); + return str1; + default: + if (context == 5 || context == 7) + { + bool flag = false; + if (context == 5) + flag = Main.mouseItem.Prefix(-3) || Main.mouseItem.type == 0; + if (context == 7) + flag = Main.mouseItem.material; + if (inv[slot].type > 0 && inv[slot].stack > 0) + { + if (Main.mouseItem.type > 0) + { + if (flag) + str1 += PlayerInput.BuildCommand(Lang.misc[65].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); } else - { - bool flag = player.hideMisc[slot]; - s += PlayerInput.BuildCommand(Lang.misc[flag ? 77 : 78].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["Grapple"]); - if (PlayerInput.Triggers.JustPressed.Grapple) - { - player.hideMisc[slot] = !player.hideMisc[slot]; - SoundEngine.PlaySound(12); - if (Main.netMode == 1) - NetMessage.SendData(4, number: Main.myPlayer); - } - } + str1 += PlayerInput.BuildCommand(Lang.misc[54].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); } + else if (Main.mouseItem.type > 0 & flag) + str1 += PlayerInput.BuildCommand(Lang.misc[65].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); + return str1; } - } - else if (Main.mouseItem.type > 0 && Main.mouseItem.dye > (byte) 0) - s += PlayerInput.BuildCommand(Lang.misc[65].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); - return s; - } - if (context == 6) - { - if (inv[slot].type > 0 && inv[slot].stack > 0) - { - if (Main.mouseItem.type > 0) - s += PlayerInput.BuildCommand(Lang.misc[74].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); - else - s += PlayerInput.BuildCommand(Lang.misc[54].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); - } - else if (Main.mouseItem.type > 0) - s += PlayerInput.BuildCommand(Lang.misc[74].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); - return s; - } - if (context == 5 || context == 7) - { - bool flag = false; - if (context == 5) - flag = Main.mouseItem.Prefix(-3) || Main.mouseItem.type == 0; - if (context == 7) - flag = Main.mouseItem.material; - if (inv[slot].type > 0 && inv[slot].stack > 0) - { - if (Main.mouseItem.type > 0) + string overrideInstructions = ItemSlot.GetOverrideInstructions(inv, context, slot); + if ((Main.mouseItem.type <= 0 ? 0 : (context == 0 || context == 1 || context == 2 || context == 6 || context == 15 ? 1 : (context == 7 ? 1 : 0))) != 0 && string.IsNullOrEmpty(overrideInstructions)) { - if (flag) - s += PlayerInput.BuildCommand(Lang.misc[65].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); - } - else - s += PlayerInput.BuildCommand(Lang.misc[54].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); - } - else if (Main.mouseItem.type > 0 & flag) - s += PlayerInput.BuildCommand(Lang.misc[65].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["MouseLeft"]); - return s; - } - string overrideInstructions = ItemSlot.GetOverrideInstructions(inv, context, slot); - bool flag1 = Main.mouseItem.type > 0 && (context == 0 || context == 1 || context == 2 || context == 6 || context == 15 || context == 7 || context == 4 || context == 3); - if (context != 8 || !ItemSlot.isEquipLocked(inv[slot].type)) - { - if (flag1 && string.IsNullOrEmpty(overrideInstructions)) - { - s += PlayerInput.BuildCommand(Lang.inter[121].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["SmartSelect"]); - if (PlayerInput.Triggers.JustPressed.SmartSelect) - player.DropSelectedItem(); - } - else if (!string.IsNullOrEmpty(overrideInstructions)) - { - ItemSlot.ShiftForcedOn = true; - int cursorOverride = Main.cursorOverride; - ItemSlot.OverrideHover(inv, context, slot); - if (-1 != Main.cursorOverride) - { - s += PlayerInput.BuildCommand(overrideInstructions, false, PlayerInput.ProfileGamepadUI.KeyStatus["SmartSelect"]); + str1 += PlayerInput.BuildCommand(Lang.inter[121].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["SmartSelect"]); if (PlayerInput.Triggers.JustPressed.SmartSelect) - { - int num = Main.mouseLeft ? 1 : 0; - Main.mouseLeft = true; - ItemSlot.LeftClick(inv, context, slot); - Main.mouseLeft = num != 0; - } + player.DropSelectedItem(); } - Main.cursorOverride = cursorOverride; - ItemSlot.ShiftForcedOn = false; - } - } - if (!ItemSlot.TryEnteringFastUseMode(inv, context, slot, player, ref s)) - ItemSlot.TryEnteringBuildingMode(inv, context, slot, player, ref s); - return s; - } - - private static bool TryEnteringFastUseMode( - Item[] inv, - int context, - int slot, - Player player, - ref string s) - { - int num = 0; - if (Main.mouseItem.CanBeQuickUsed) - num = 1; - if (num == 0 && Main.mouseItem.stack <= 0 && context == 0 && inv[slot].CanBeQuickUsed) - num = 2; - if (num <= 0) - return false; - s += PlayerInput.BuildCommand(Language.GetTextValue("UI.QuickUseItem"), false, PlayerInput.ProfileGamepadUI.KeyStatus["QuickMount"]); - if (PlayerInput.Triggers.JustPressed.QuickMount) - { - switch (num) - { - case 1: - PlayerInput.TryEnteringFastUseModeForMouseItem(); - break; - case 2: - PlayerInput.TryEnteringFastUseModeForInventorySlot(slot); - break; - } - } - return true; - } - - private static bool TryEnteringBuildingMode( - Item[] inv, - int context, - int slot, - Player player, - ref string s) - { - int num = 0; - if (ItemSlot.IsABuildingItem(Main.mouseItem)) - num = 1; - if (num == 0 && Main.mouseItem.stack <= 0 && context == 0 && ItemSlot.IsABuildingItem(inv[slot])) - num = 2; - if (num > 0) - { - Item mouseItem = Main.mouseItem; - if (num == 1) - mouseItem = Main.mouseItem; - if (num == 2) - mouseItem = inv[slot]; - if (num != 1 || player.ItemSpace(mouseItem).CanTakeItemToPersonalInventory) - { - if (mouseItem.damage > 0 && mouseItem.ammo == 0) - s += PlayerInput.BuildCommand(Lang.misc[60].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["QuickMount"]); - else if (mouseItem.createTile >= 0 || mouseItem.createWall > 0) - s += PlayerInput.BuildCommand(Lang.misc[61].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["QuickMount"]); - else - s += PlayerInput.BuildCommand(Lang.misc[63].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["QuickMount"]); - if (PlayerInput.Triggers.JustPressed.QuickMount) - PlayerInput.EnterBuildingMode(); - return true; - } - } - return false; - } - - public static bool IsABuildingItem(Item item) => item.type > 0 && item.stack > 0 && item.useStyle != 0 && item.useTime > 0; - - public static void SelectEquipPage(Item item) - { - Main.EquipPage = -1; - if (item.IsAir) - return; - if (Main.projHook[item.shoot]) - Main.EquipPage = 2; - else if (item.mountType != -1) - Main.EquipPage = 2; - else if (item.buffType > 0 && Main.vanityPet[item.buffType]) - Main.EquipPage = 2; - else if (item.buffType > 0 && Main.lightPet[item.buffType]) - Main.EquipPage = 2; - else if (item.dye > (byte) 0 && Main.EquipPageSelected == 1) - { - Main.EquipPage = 0; - } - else - { - if (item.legSlot == -1 && item.headSlot == -1 && item.bodySlot == -1 && !item.accessory) - return; - Main.EquipPage = 0; + else if (!string.IsNullOrEmpty(overrideInstructions)) + { + ItemSlot.ShiftForcedOn = true; + int cursorOverride = Main.cursorOverride; + ItemSlot.OverrideHover(inv, context, slot); + if (-1 != Main.cursorOverride) + { + str1 += PlayerInput.BuildCommand(overrideInstructions, false, PlayerInput.ProfileGamepadUI.KeyStatus["SmartSelect"]); + if (PlayerInput.Triggers.JustPressed.SmartSelect) + ItemSlot.LeftClick(inv, context, slot); + } + Main.cursorOverride = cursorOverride; + ItemSlot.ShiftForcedOn = false; + } + int num1 = 0; + if (ItemSlot.IsABuildingItem(Main.mouseItem)) + num1 = 1; + if (num1 == 0 && Main.mouseItem.stack <= 0 && context == 0 && ItemSlot.IsABuildingItem(inv[slot])) + num1 = 2; + if (Main.autoPause) + num1 = 0; + if (num1 > 0) + { + Item mouseItem = Main.mouseItem; + if (num1 == 1) + mouseItem = Main.mouseItem; + if (num1 == 2) + mouseItem = inv[slot]; + if (num1 != 1 || player.ItemSpace(mouseItem)) + { + if (mouseItem.damage > 0 && mouseItem.ammo == 0) + str1 += PlayerInput.BuildCommand(Lang.misc[60].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["QuickMount"]); + else if (mouseItem.createTile >= 0 || mouseItem.createWall > 0) + str1 += PlayerInput.BuildCommand(Lang.misc[61].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["QuickMount"]); + else + str1 += PlayerInput.BuildCommand(Lang.misc[63].Value, false, PlayerInput.ProfileGamepadUI.KeyStatus["QuickMount"]); + } + if (PlayerInput.Triggers.JustPressed.QuickMount) + PlayerInput.EnterBuildingMode(); + } + return str1; } } + public static bool IsABuildingItem(Item item) => item.type > 0 && item.stack > 0 && item.useStyle > 0 && item.useTime > 0; + public class Options { - public static bool DisableLeftShiftTrashCan = true; + public static bool DisableLeftShiftTrashCan = false; public static bool HighlightNewItems = true; } @@ -2810,15 +2198,7 @@ label_95: public const int EquipLight = 20; public const int MouseItem = 21; public const int CraftingMaterial = 22; - public const int DisplayDollArmor = 23; - public const int DisplayDollAccessory = 24; - public const int DisplayDollDye = 25; - public const int HatRackHat = 26; - public const int HatRackDye = 27; - public const int GoldDebug = 28; - public const int CreativeInfinite = 29; - public const int CreativeSacrifice = 30; - public const int Count = 31; + public const int Count = 23; } } } diff --git a/UI/ItemSorting.cs b/UI/ItemSorting.cs index ed0b446..c4c89f1 100644 --- a/UI/ItemSorting.cs +++ b/UI/ItemSorting.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.ItemSorting -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; @@ -26,6 +26,7 @@ namespace Terraria.UI itemSortingLayerList.Add(ItemSorting.ItemSortingLayers.WeaponsRanged); itemSortingLayerList.Add(ItemSorting.ItemSortingLayers.WeaponsMagic); itemSortingLayerList.Add(ItemSorting.ItemSortingLayers.WeaponsMinions); + itemSortingLayerList.Add(ItemSorting.ItemSortingLayers.WeaponsThrown); itemSortingLayerList.Add(ItemSorting.ItemSortingLayers.WeaponsAssorted); itemSortingLayerList.Add(ItemSorting.ItemSortingLayers.WeaponsAmmo); itemSortingLayerList.Add(ItemSorting.ItemSortingLayers.ToolsPicksaws); @@ -60,7 +61,7 @@ namespace Terraria.UI itemSortingLayerList.Add(ItemSorting.ItemSortingLayers.LastTilesCommon); itemSortingLayerList.Add(ItemSorting.ItemSortingLayers.LastNotTrash); itemSortingLayerList.Add(ItemSorting.ItemSortingLayers.LastTrash); - for (int type = -48; type < 5045; ++type) + for (int type = -48; type < 3930; ++type) { Item obj = new Item(); obj.netDefaults(type); @@ -87,7 +88,8 @@ namespace Terraria.UI player.meleeDamage, player.rangedDamage, player.magicDamage, - player.minionDamage + player.minionDamage, + player.thrownDamage }; floatList.Sort((Comparison) ((x, y) => y.CompareTo(x))); for (int index = 0; index < 5; ++index) @@ -112,6 +114,11 @@ namespace Terraria.UI floatList.RemoveAt(0); ItemSorting._layerList.Add(ItemSorting.ItemSortingLayers.WeaponsMinions); } + if (!ItemSorting._layerList.Contains(ItemSorting.ItemSortingLayers.WeaponsThrown) && (double) player.thrownDamage == (double) floatList[0]) + { + floatList.RemoveAt(0); + ItemSorting._layerList.Add(ItemSorting.ItemSortingLayers.WeaponsThrown); + } } ItemSorting._layerList.Add(ItemSorting.ItemSortingLayers.WeaponsAssorted); ItemSorting._layerList.Add(ItemSorting.ItemSortingLayers.WeaponsAmmo); @@ -240,13 +247,7 @@ namespace Terraria.UI } } - public static void SortInventory() - { - if (!Main.LocalPlayer.HasItem(905)) - ItemSorting.SortCoins(); - ItemSorting.SortAmmo(); - ItemSorting.Sort(Main.player[Main.myPlayer].inventory, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 50, 51, 52, 53, 54, 55, 56, 57, 58); - } + public static void SortInventory() => ItemSorting.Sort(Main.player[Main.myPlayer].inventory, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 50, 51, 52, 53, 54, 55, 56, 57, 58); public static void SortChest() { @@ -258,8 +259,6 @@ namespace Terraria.UI inv = Main.player[Main.myPlayer].bank2.item; if (chest == -4) inv = Main.player[Main.myPlayer].bank3.item; - if (chest == -5) - inv = Main.player[Main.myPlayer].bank4.item; if (chest > -1) inv = Main.chest[chest].item; Tuple[] tupleArray1 = new Tuple[40]; @@ -278,209 +277,6 @@ namespace Terraria.UI } } - public static void SortAmmo() - { - ItemSorting.ClearAmmoSlotSpaces(); - ItemSorting.FillAmmoFromInventory(); - } - - public static void FillAmmoFromInventory() - { - List intList1 = new List(); - List intList2 = new List(); - Item[] inventory = Main.player[Main.myPlayer].inventory; - for (int index = 54; index < 58; ++index) - { - ItemSlot.SetGlow(index, 0.31f, false); - Item obj = inventory[index]; - if (obj.IsAir) - intList2.Add(index); - else if (obj.ammo != AmmoID.None) - { - if (!intList1.Contains(obj.type)) - intList1.Add(obj.type); - ItemSorting.RefillItemStack(inventory, inventory[index], 0, 50); - } - } - if (intList2.Count < 1) - return; - for (int index1 = 0; index1 < 50; ++index1) - { - Item obj = inventory[index1]; - if (obj.stack >= 1 && obj.CanFillEmptyAmmoSlot() && intList1.Contains(obj.type)) - { - int index2 = intList2[0]; - intList2.Remove(index2); - Utils.Swap(ref inventory[index1], ref inventory[index2]); - ItemSorting.RefillItemStack(inventory, inventory[index2], 0, 50); - if (intList2.Count == 0) - break; - } - } - if (intList2.Count < 1) - return; - for (int index3 = 0; index3 < 50; ++index3) - { - Item obj = inventory[index3]; - if (obj.stack >= 1 && obj.CanFillEmptyAmmoSlot() && obj.FitsAmmoSlot()) - { - int index4 = intList2[0]; - intList2.Remove(index4); - Utils.Swap(ref inventory[index3], ref inventory[index4]); - ItemSorting.RefillItemStack(inventory, inventory[index4], 0, 50); - if (intList2.Count == 0) - break; - } - } - } - - public static void ClearAmmoSlotSpaces() - { - Item[] inventory = Main.player[Main.myPlayer].inventory; - for (int index = 54; index < 58; ++index) - { - Item itemToRefill = inventory[index]; - if (!itemToRefill.IsAir && itemToRefill.ammo != AmmoID.None && itemToRefill.stack < itemToRefill.maxStack) - ItemSorting.RefillItemStack(inventory, itemToRefill, index + 1, 58); - } - for (int slot = 54; slot < 58; ++slot) - { - if (inventory[slot].type > 0) - ItemSorting.TrySlidingUp(inventory, slot, 54); - } - } - - private static void SortCoins() - { - Item[] inventory = Main.LocalPlayer.inventory; - bool overFlowing; - long count = Utils.CoinsCount(out overFlowing, inventory, 58); - if (overFlowing) - return; - int[] numArray = Utils.CoinsSplit(count); - int num1 = 0; - for (int index = 0; index < 3; ++index) - { - int num2 = numArray[index]; - while (num2 > 0) - { - num2 -= 99; - ++num1; - } - } - int num3 = numArray[3]; - while (num3 > 999) - { - num3 -= 999; - ++num1; - } - int num4 = 0; - for (int index = 0; index < 58; ++index) - { - if (inventory[index].type >= 71 && inventory[index].type <= 74 && inventory[index].stack > 0) - ++num4; - } - if (num4 < num1) - return; - for (int index = 0; index < 58; ++index) - { - if (inventory[index].type >= 71 && inventory[index].type <= 74 && inventory[index].stack > 0) - inventory[index].TurnToAir(); - } -label_23: - int index1; - int num5; - bool flag; - do - { - index1 = -1; - for (int index2 = 3; index2 >= 0; --index2) - { - if (numArray[index2] > 0) - { - index1 = index2; - break; - } - } - if (index1 != -1) - { - num5 = numArray[index1]; - if (index1 == 3 && num5 > 999) - num5 = 999; - flag = false; - if (!flag) - { - for (int index3 = 50; index3 < 54; ++index3) - { - if (inventory[index3].IsAir) - { - inventory[index3].SetDefaults(71 + index1); - inventory[index3].stack = num5; - numArray[index1] -= num5; - flag = true; - break; - } - } - } - } - else - goto label_17; - } - while (flag); - goto label_38; -label_17: - return; -label_38: - for (int index4 = 0; index4 < 50; ++index4) - { - if (inventory[index4].IsAir) - { - inventory[index4].SetDefaults(71 + index1); - inventory[index4].stack = num5; - numArray[index1] -= num5; - break; - } - } - goto label_23; - } - - private static void RefillItemStack( - Item[] inv, - Item itemToRefill, - int loopStartIndex, - int loopEndIndex) - { - int num1 = itemToRefill.maxStack - itemToRefill.stack; - if (num1 <= 0) - return; - for (int index = loopStartIndex; index < loopEndIndex; ++index) - { - Item obj = inv[index]; - if (obj.stack >= 1 && obj.type == itemToRefill.type) - { - int num2 = obj.stack; - if (num2 > num1) - num2 = num1; - num1 -= num2; - itemToRefill.stack += num2; - obj.stack -= num2; - if (obj.stack <= 0) - obj.TurnToAir(); - if (num1 <= 0) - break; - } - } - } - - private static void TrySlidingUp(Item[] inv, int slot, int minimumIndex) - { - for (int index = slot; index > minimumIndex; --index) - { - if (inv[index - 1].IsAir) - Utils.Swap(ref inv[index], ref inv[index - 1]); - } - } - private class ItemSortingLayer { public readonly string Name; @@ -515,11 +311,9 @@ label_38: itemsToSort.Remove(num); list.Sort((Comparison) ((x, y) => { - int num = inv[y].OriginalRarity.CompareTo(inv[x].OriginalRarity); + int num = inv[y].rare.CompareTo(inv[x].rare); if (num == 0) - num = inv[y].OriginalDamage.CompareTo(inv[x].OriginalDamage); - if (num == 0) - num = x.CompareTo(y); + num = x == y ? 0 : -1; return num; })); return list; @@ -532,11 +326,9 @@ label_38: itemsToSort.Remove(num); list.Sort((Comparison) ((x, y) => { - int num = inv[y].OriginalRarity.CompareTo(inv[x].OriginalRarity); + int num = inv[y].rare.CompareTo(inv[x].rare); if (num == 0) - num = inv[y].OriginalDamage.CompareTo(inv[x].OriginalDamage); - if (num == 0) - num = x.CompareTo(y); + num = x == y ? 0 : -1; return num; })); return list; @@ -549,11 +341,9 @@ label_38: itemsToSort.Remove(num); list.Sort((Comparison) ((x, y) => { - int num = inv[y].OriginalRarity.CompareTo(inv[x].OriginalRarity); + int num = inv[y].rare.CompareTo(inv[x].rare); if (num == 0) - num = inv[y].OriginalDamage.CompareTo(inv[x].OriginalDamage); - if (num == 0) - num = x.CompareTo(y); + num = x == y ? 0 : -1; return num; })); return list; @@ -566,11 +356,24 @@ label_38: itemsToSort.Remove(num); list.Sort((Comparison) ((x, y) => { - int num = inv[y].OriginalRarity.CompareTo(inv[x].OriginalRarity); + int num = inv[y].rare.CompareTo(inv[x].rare); if (num == 0) - num = inv[y].OriginalDamage.CompareTo(inv[x].OriginalDamage); + num = x == y ? 0 : -1; + return num; + })); + return list; + })); + public static ItemSorting.ItemSortingLayer WeaponsThrown = new ItemSorting.ItemSortingLayer("Weapons - Thrown", (Func, List>) ((layer, inv, itemsToSort) => + { + List list = itemsToSort.Where((Func) (i => inv[i].damage > 0 && (inv[i].ammo == 0 || inv[i].notAmmo) && inv[i].shoot > 0 && inv[i].thrown)).ToList(); + layer.Validate(ref list, inv); + foreach (int num in list) + itemsToSort.Remove(num); + list.Sort((Comparison) ((x, y) => + { + int num = inv[y].rare.CompareTo(inv[x].rare); if (num == 0) - num = x.CompareTo(y); + num = x == y ? 0 : -1; return num; })); return list; @@ -583,11 +386,9 @@ label_38: itemsToSort.Remove(num); list.Sort((Comparison) ((x, y) => { - int num = inv[y].OriginalRarity.CompareTo(inv[x].OriginalRarity); + int num = inv[y].rare.CompareTo(inv[x].rare); if (num == 0) - num = inv[y].OriginalDamage.CompareTo(inv[x].OriginalDamage); - if (num == 0) - num = x.CompareTo(y); + num = x == y ? 0 : -1; return num; })); return list; @@ -600,11 +401,9 @@ label_38: itemsToSort.Remove(num); list.Sort((Comparison) ((x, y) => { - int num = inv[y].OriginalRarity.CompareTo(inv[x].OriginalRarity); + int num = inv[y].rare.CompareTo(inv[x].rare); if (num == 0) - num = inv[y].OriginalDamage.CompareTo(inv[x].OriginalDamage); - if (num == 0) - num = x.CompareTo(y); + num = x == y ? 0 : -1; return num; })); return list; @@ -666,7 +465,7 @@ label_38: if (num == 0) num = inv[y].stack.CompareTo(inv[x].stack); if (num == 0) - num = x.CompareTo(y); + num = x == y ? 0 : -1; return num; })); return list; @@ -679,11 +478,9 @@ label_38: itemsToSort.Remove(num); list.Sort((Comparison) ((x, y) => { - int num = inv[y].OriginalRarity.CompareTo(inv[x].OriginalRarity); + int num = inv[y].rare.CompareTo(inv[x].rare); if (num == 0) - num = inv[y].OriginalDamage.CompareTo(inv[x].OriginalDamage); - if (num == 0) - num = x.CompareTo(y); + num = x == y ? 0 : -1; return num; })); return list; @@ -696,9 +493,7 @@ label_38: itemsToSort.Remove(num); list.Sort((Comparison) ((x, y) => { - int num = inv[y].OriginalRarity.CompareTo(inv[x].OriginalRarity); - if (num == 0) - num = inv[y].OriginalDefense.CompareTo(inv[x].OriginalDefense); + int num = inv[y].rare.CompareTo(inv[x].rare); if (num == 0) num = inv[x].netID.CompareTo(inv[y].netID); return num; @@ -713,7 +508,7 @@ label_38: itemsToSort.Remove(num); list.Sort((Comparison) ((x, y) => { - int num = inv[y].OriginalRarity.CompareTo(inv[x].OriginalRarity); + int num = inv[y].rare.CompareTo(inv[x].rare); if (num == 0) num = inv[x].netID.CompareTo(inv[y].netID); return num; @@ -730,9 +525,7 @@ label_38: { int num = inv[x].vanity.CompareTo(inv[y].vanity); if (num == 0) - num = inv[y].OriginalRarity.CompareTo(inv[x].OriginalRarity); - if (num == 0) - num = inv[y].OriginalDefense.CompareTo(inv[x].OriginalDefense); + num = inv[y].rare.CompareTo(inv[x].rare); if (num == 0) num = inv[x].netID.CompareTo(inv[y].netID); return num; @@ -747,11 +540,11 @@ label_38: itemsToSort.Remove(num); list.Sort((Comparison) ((x, y) => { - int num = inv[y].OriginalRarity.CompareTo(inv[x].OriginalRarity); + int num = inv[y].rare.CompareTo(inv[x].rare); if (num == 0) num = inv[x].netID.CompareTo(inv[y].netID); if (num == 0) - num = x.CompareTo(y); + num = x == y ? 0 : -1; return num; })); return list; @@ -764,11 +557,11 @@ label_38: itemsToSort.Remove(num); list.Sort((Comparison) ((x, y) => { - int num = inv[y].OriginalRarity.CompareTo(inv[x].OriginalRarity); + int num = inv[y].rare.CompareTo(inv[x].rare); if (num == 0) num = inv[x].netID.CompareTo(inv[y].netID); if (num == 0) - num = x.CompareTo(y); + num = x == y ? 0 : -1; return num; })); return list; @@ -781,11 +574,11 @@ label_38: itemsToSort.Remove(num); list.Sort((Comparison) ((x, y) => { - int num = inv[y].OriginalRarity.CompareTo(inv[x].OriginalRarity); + int num = inv[y].rare.CompareTo(inv[x].rare); if (num == 0) num = inv[x].netID.CompareTo(inv[y].netID); if (num == 0) - num = x.CompareTo(y); + num = x == y ? 0 : -1; return num; })); return list; @@ -798,11 +591,11 @@ label_38: itemsToSort.Remove(num); list.Sort((Comparison) ((x, y) => { - int num = inv[y].OriginalRarity.CompareTo(inv[x].OriginalRarity); + int num = inv[y].rare.CompareTo(inv[x].rare); if (num == 0) num = inv[x].netID.CompareTo(inv[y].netID); if (num == 0) - num = x.CompareTo(y); + num = x == y ? 0 : -1; return num; })); return list; @@ -815,11 +608,11 @@ label_38: itemsToSort.Remove(num); list.Sort((Comparison) ((x, y) => { - int num = inv[y].OriginalRarity.CompareTo(inv[x].OriginalRarity); + int num = inv[y].rare.CompareTo(inv[x].rare); if (num == 0) num = inv[x].netID.CompareTo(inv[y].netID); if (num == 0) - num = x.CompareTo(y); + num = x == y ? 0 : -1; return num; })); return list; @@ -830,15 +623,7 @@ label_38: layer.Validate(ref list, inv); foreach (int num in list) itemsToSort.Remove(num); - list.Sort((Comparison) ((x, y) => - { - int num = inv[y].healLife.CompareTo(inv[x].healLife); - if (num == 0) - num = inv[y].stack.CompareTo(inv[x].stack); - if (num == 0) - num = x.CompareTo(y); - return num; - })); + list.Sort((Comparison) ((x, y) => inv[y].healLife.CompareTo(inv[x].healLife))); return list; })); public static ItemSorting.ItemSortingLayer PotionsMana = new ItemSorting.ItemSortingLayer("Potions - Mana", (Func, List>) ((layer, inv, itemsToSort) => @@ -847,15 +632,7 @@ label_38: layer.Validate(ref list, inv); foreach (int num in list) itemsToSort.Remove(num); - list.Sort((Comparison) ((x, y) => - { - int num = inv[y].healMana.CompareTo(inv[x].healMana); - if (num == 0) - num = inv[y].stack.CompareTo(inv[x].stack); - if (num == 0) - num = x.CompareTo(y); - return num; - })); + list.Sort((Comparison) ((x, y) => inv[y].healMana.CompareTo(inv[x].healMana))); return list; })); public static ItemSorting.ItemSortingLayer PotionsElixirs = new ItemSorting.ItemSortingLayer("Potions - Elixirs", (Func, List>) ((layer, inv, itemsToSort) => @@ -864,15 +641,7 @@ label_38: layer.Validate(ref list, inv); foreach (int num in list) itemsToSort.Remove(num); - list.Sort((Comparison) ((x, y) => - { - int num = inv[y].healLife.CompareTo(inv[x].healLife); - if (num == 0) - num = inv[y].stack.CompareTo(inv[x].stack); - if (num == 0) - num = x.CompareTo(y); - return num; - })); + list.Sort((Comparison) ((x, y) => inv[y].healLife.CompareTo(inv[x].healLife))); return list; })); public static ItemSorting.ItemSortingLayer PotionsBuffs = new ItemSorting.ItemSortingLayer("Potions - Buffs", (Func, List>) ((layer, inv, itemsToSort) => @@ -883,13 +652,13 @@ label_38: itemsToSort.Remove(num); list.Sort((Comparison) ((x, y) => { - int num = inv[y].OriginalRarity.CompareTo(inv[x].OriginalRarity); + int num = inv[y].rare.CompareTo(inv[x].rare); if (num == 0) num = inv[x].netID.CompareTo(inv[y].netID); if (num == 0) num = inv[y].stack.CompareTo(inv[x].stack); if (num == 0) - num = x.CompareTo(y); + num = x == y ? 0 : -1; return num; })); return list; @@ -902,13 +671,13 @@ label_38: itemsToSort.Remove(num); list.Sort((Comparison) ((x, y) => { - int num = inv[y].OriginalRarity.CompareTo(inv[x].OriginalRarity); + int num = inv[y].rare.CompareTo(inv[x].rare); if (num == 0) num = inv[y].dye.CompareTo(inv[x].dye); if (num == 0) num = inv[y].stack.CompareTo(inv[x].stack); if (num == 0) - num = x.CompareTo(y); + num = x == y ? 0 : -1; return num; })); return list; @@ -921,13 +690,13 @@ label_38: itemsToSort.Remove(num); list.Sort((Comparison) ((x, y) => { - int num = inv[y].OriginalRarity.CompareTo(inv[x].OriginalRarity); + int num = inv[y].rare.CompareTo(inv[x].rare); if (num == 0) num = inv[y].hairDye.CompareTo(inv[x].hairDye); if (num == 0) num = inv[y].stack.CompareTo(inv[x].stack); if (num == 0) - num = x.CompareTo(y); + num = x == y ? 0 : -1; return num; })); return list; @@ -944,7 +713,7 @@ label_38: if (num == 0) num = inv[y].stack.CompareTo(inv[x].stack); if (num == 0) - num = x.CompareTo(y); + num = x == y ? 0 : -1; return num; })); return list; @@ -959,13 +728,13 @@ label_38: { int num = ItemID.Sets.SortingPriorityWiring[inv[y].netID].CompareTo(ItemID.Sets.SortingPriorityWiring[inv[x].netID]); if (num == 0) - num = inv[y].OriginalRarity.CompareTo(inv[x].OriginalRarity); + num = inv[y].rare.CompareTo(inv[x].rare); if (num == 0) num = inv[y].netID.CompareTo(inv[x].netID); if (num == 0) num = inv[y].stack.CompareTo(inv[x].stack); if (num == 0) - num = x.CompareTo(y); + num = x == y ? 0 : -1; return num; })); return list; @@ -976,15 +745,7 @@ label_38: layer.Validate(ref list, inv); foreach (int num in list) itemsToSort.Remove(num); - list.Sort((Comparison) ((x, y) => - { - int num = ItemID.Sets.SortingPriorityMaterials[inv[y].netID].CompareTo(ItemID.Sets.SortingPriorityMaterials[inv[x].netID]); - if (num == 0) - num = inv[y].stack.CompareTo(inv[x].stack); - if (num == 0) - num = x.CompareTo(y); - return num; - })); + list.Sort((Comparison) ((x, y) => ItemID.Sets.SortingPriorityMaterials[inv[y].netID].CompareTo(ItemID.Sets.SortingPriorityMaterials[inv[x].netID]))); return list; })); public static ItemSorting.ItemSortingLayer MiscExtractinator = new ItemSorting.ItemSortingLayer("Misc - Extractinator", (Func, List>) ((layer, inv, itemsToSort) => @@ -993,15 +754,7 @@ label_38: layer.Validate(ref list, inv); foreach (int num in list) itemsToSort.Remove(num); - list.Sort((Comparison) ((x, y) => - { - int num = ItemID.Sets.SortingPriorityExtractibles[inv[y].netID].CompareTo(ItemID.Sets.SortingPriorityExtractibles[inv[x].netID]); - if (num == 0) - num = inv[y].stack.CompareTo(inv[x].stack); - if (num == 0) - num = x.CompareTo(y); - return num; - })); + list.Sort((Comparison) ((x, y) => ItemID.Sets.SortingPriorityExtractibles[inv[y].netID].CompareTo(ItemID.Sets.SortingPriorityExtractibles[inv[x].netID]))); return list; })); public static ItemSorting.ItemSortingLayer MiscPainting = new ItemSorting.ItemSortingLayer("Misc - Painting", (Func, List>) ((layer, inv, itemsToSort) => @@ -1018,7 +771,7 @@ label_38: if (num == 0) num = inv[y].stack.CompareTo(inv[x].stack); if (num == 0) - num = x.CompareTo(y); + num = x == y ? 0 : -1; return num; })); return list; @@ -1029,15 +782,7 @@ label_38: layer.Validate(ref list, inv); foreach (int num in list) itemsToSort.Remove(num); - list.Sort((Comparison) ((x, y) => - { - int num = ItemID.Sets.SortingPriorityRopes[inv[y].netID].CompareTo(ItemID.Sets.SortingPriorityRopes[inv[x].netID]); - if (num == 0) - num = inv[y].stack.CompareTo(inv[x].stack); - if (num == 0) - num = x.CompareTo(y); - return num; - })); + list.Sort((Comparison) ((x, y) => ItemID.Sets.SortingPriorityRopes[inv[y].netID].CompareTo(ItemID.Sets.SortingPriorityRopes[inv[x].netID]))); return list; })); public static ItemSorting.ItemSortingLayer LastMaterials = new ItemSorting.ItemSortingLayer("Last - Materials", (Func, List>) ((layer, inv, itemsToSort) => @@ -1048,13 +793,13 @@ label_38: itemsToSort.Remove(num); list.Sort((Comparison) ((x, y) => { - int num = inv[y].OriginalRarity.CompareTo(inv[x].OriginalRarity); + int num = inv[y].rare.CompareTo(inv[x].rare); if (num == 0) num = inv[y].value.CompareTo(inv[x].value); if (num == 0) num = inv[y].stack.CompareTo(inv[x].stack); if (num == 0) - num = x.CompareTo(y); + num = x == y ? 0 : -1; return num; })); return list; @@ -1071,7 +816,7 @@ label_38: if (num == 0) num = inv[y].stack.CompareTo(inv[x].stack); if (num == 0) - num = x.CompareTo(y); + num = x == y ? 0 : -1; return num; })); return list; @@ -1088,26 +833,26 @@ label_38: if (num == 0) num = inv[y].stack.CompareTo(inv[x].stack); if (num == 0) - num = x.CompareTo(y); + num = x == y ? 0 : -1; return num; })); return list; })); public static ItemSorting.ItemSortingLayer LastNotTrash = new ItemSorting.ItemSortingLayer("Last - Not Trash", (Func, List>) ((layer, inv, itemsToSort) => { - List list = itemsToSort.Where((Func) (i => inv[i].OriginalRarity >= 0)).ToList(); + List list = itemsToSort.Where((Func) (i => inv[i].rare >= 0)).ToList(); layer.Validate(ref list, inv); foreach (int num in list) itemsToSort.Remove(num); list.Sort((Comparison) ((x, y) => { - int num = inv[y].OriginalRarity.CompareTo(inv[x].OriginalRarity); + int num = inv[y].rare.CompareTo(inv[x].rare); if (num == 0) num = string.Compare(inv[x].Name, inv[y].Name, StringComparison.OrdinalIgnoreCase); if (num == 0) num = inv[y].stack.CompareTo(inv[x].stack); if (num == 0) - num = x.CompareTo(y); + num = x == y ? 0 : -1; return num; })); return list; @@ -1124,7 +869,7 @@ label_38: if (num == 0) num = inv[y].stack.CompareTo(inv[x].stack); if (num == 0) - num = x.CompareTo(y); + num = x == y ? 0 : -1; return num; })); return indexesSortable; diff --git a/UI/ItemTooltip.cs b/UI/ItemTooltip.cs index a3f961d..b506805 100644 --- a/UI/ItemTooltip.cs +++ b/UI/ItemTooltip.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.ItemTooltip -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System.Collections.Generic; @@ -12,11 +12,10 @@ namespace Terraria.UI public class ItemTooltip { public static readonly ItemTooltip None = new ItemTooltip(); - private static readonly List _globalProcessors = new List(); - private static ulong _globalValidatorKey = 1; + private static List _globalProcessors = new List(); private string[] _tooltipLines; - private ulong _validatorKey; - private readonly LocalizedText _text; + private GameCulture _lastCulture; + private LocalizedText _text; private string _processedText; public int Lines @@ -44,9 +43,9 @@ namespace Terraria.UI private void ValidateTooltip() { - if ((long) this._validatorKey == (long) ItemTooltip._globalValidatorKey) + if (this._lastCulture == Language.ActiveCulture) return; - this._validatorKey = ItemTooltip._globalValidatorKey; + this._lastCulture = Language.ActiveCulture; if (this._text == null) { this._tooltipLines = (string[]) null; @@ -67,13 +66,5 @@ namespace Terraria.UI public static void RemoveGlobalProcessor(TooltipProcessor processor) => ItemTooltip._globalProcessors.Remove(processor); public static void ClearGlobalProcessors() => ItemTooltip._globalProcessors.Clear(); - - public static void InvalidateTooltips() - { - ++ItemTooltip._globalValidatorKey; - if (ItemTooltip._globalValidatorKey != ulong.MaxValue) - return; - ItemTooltip._globalValidatorKey = 0UL; - } } } diff --git a/UI/LegacyGameInterfaceLayer.cs b/UI/LegacyGameInterfaceLayer.cs index dd0bade..0366a87 100644 --- a/UI/LegacyGameInterfaceLayer.cs +++ b/UI/LegacyGameInterfaceLayer.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.LegacyGameInterfaceLayer -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.UI diff --git a/UI/LegacyNetDiagnosticsUI.cs b/UI/LegacyNetDiagnosticsUI.cs deleted file mode 100644 index aa9db35..0000000 --- a/UI/LegacyNetDiagnosticsUI.cs +++ /dev/null @@ -1,142 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.UI.LegacyNetDiagnosticsUI -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Graphics; -using Terraria.GameContent; - -namespace Terraria.UI -{ - public class LegacyNetDiagnosticsUI : INetDiagnosticsUI - { - public static bool netDiag; - public static int txData = 0; - public static int rxData = 0; - public static int txMsg = 0; - public static int rxMsg = 0; - private const int maxMsg = 141; - public static int[] rxMsgType = new int[141]; - public static int[] rxDataType = new int[141]; - public static int[] txMsgType = new int[141]; - public static int[] txDataType = new int[141]; - - public void Reset() - { - LegacyNetDiagnosticsUI.rxMsg = 0; - LegacyNetDiagnosticsUI.rxData = 0; - LegacyNetDiagnosticsUI.txMsg = 0; - LegacyNetDiagnosticsUI.txData = 0; - for (int index = 0; index < 141; ++index) - { - LegacyNetDiagnosticsUI.rxMsgType[index] = 0; - LegacyNetDiagnosticsUI.rxDataType[index] = 0; - LegacyNetDiagnosticsUI.txMsgType[index] = 0; - LegacyNetDiagnosticsUI.txDataType[index] = 0; - } - } - - public void CountReadMessage(int messageId, int messageLength) - { - ++LegacyNetDiagnosticsUI.rxMsg; - LegacyNetDiagnosticsUI.rxData += messageLength; - ++LegacyNetDiagnosticsUI.rxMsgType[messageId]; - LegacyNetDiagnosticsUI.rxDataType[messageId] += messageLength; - } - - public void CountSentMessage(int messageId, int messageLength) - { - ++LegacyNetDiagnosticsUI.txMsg; - LegacyNetDiagnosticsUI.txData += messageLength; - ++LegacyNetDiagnosticsUI.txMsgType[messageId]; - LegacyNetDiagnosticsUI.txDataType[messageId] += messageLength; - } - - public void Draw(SpriteBatch spriteBatch) - { - LegacyNetDiagnosticsUI.DrawTitles(spriteBatch); - LegacyNetDiagnosticsUI.DrawMesageLines(spriteBatch); - } - - private static void DrawMesageLines(SpriteBatch spriteBatch) - { - for (int msgId = 0; msgId < 141; ++msgId) - { - int num1 = 200; - int num2 = 120; - int num3 = msgId / 50; - int x = num1 + num3 * 400; - int y = num2 + (msgId - num3 * 50) * 13; - LegacyNetDiagnosticsUI.PrintNetDiagnosticsLineForMessage(spriteBatch, msgId, x, y); - } - } - - private static void DrawTitles(SpriteBatch spriteBatch) - { - for (int index = 0; index < 4; ++index) - { - string str = ""; - int num1 = 20; - int num2 = 220; - if (index == 0) - { - str = "RX Msgs: " + string.Format("{0:0,0}", (object) LegacyNetDiagnosticsUI.rxMsg); - num2 += index * 20; - } - else if (index == 1) - { - str = "RX Bytes: " + string.Format("{0:0,0}", (object) LegacyNetDiagnosticsUI.rxData); - num2 += index * 20; - } - else if (index == 2) - { - str = "TX Msgs: " + string.Format("{0:0,0}", (object) LegacyNetDiagnosticsUI.txMsg); - num2 += index * 20; - } - else if (index == 3) - { - str = "TX Bytes: " + string.Format("{0:0,0}", (object) LegacyNetDiagnosticsUI.txData); - num2 += index * 20; - } - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, str, new Vector2((float) num1, (float) num2), Color.White, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - } - } - - private static void PrintNetDiagnosticsLineForMessage( - SpriteBatch spriteBatch, - int msgId, - int x, - int y) - { - float num = 0.7f; - string str1 = msgId.ToString() + ": "; - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, str1, new Vector2((float) x, (float) y), Color.White, 0.0f, new Vector2(), num, SpriteEffects.None, 0.0f); - x += 30; - string str2 = "rx:" + string.Format("{0:0,0}", (object) LegacyNetDiagnosticsUI.rxMsgType[msgId]); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, str2, new Vector2((float) x, (float) y), Color.White, 0.0f, new Vector2(), num, SpriteEffects.None, 0.0f); - x += 70; - string str3 = string.Format("{0:0,0}", (object) LegacyNetDiagnosticsUI.rxDataType[msgId]); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, str3, new Vector2((float) x, (float) y), Color.White, 0.0f, new Vector2(), num, SpriteEffects.None, 0.0f); - x += 70; - string str4 = msgId.ToString() + ": "; - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, str4, new Vector2((float) x, (float) y), Color.White, 0.0f, new Vector2(), num, SpriteEffects.None, 0.0f); - x += 30; - string str5 = "tx:" + string.Format("{0:0,0}", (object) LegacyNetDiagnosticsUI.txMsgType[msgId]); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, str5, new Vector2((float) x, (float) y), Color.White, 0.0f, new Vector2(), num, SpriteEffects.None, 0.0f); - x += 70; - string str6 = string.Format("{0:0,0}", (object) LegacyNetDiagnosticsUI.txDataType[msgId]); - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, str6, new Vector2((float) x, (float) y), Color.White, 0.0f, new Vector2(), num, SpriteEffects.None, 0.0f); - } - - public void CountReadModuleMessage(int moduleMessageId, int messageLength) - { - } - - public void CountSentModuleMessage(int moduleMessageId, int messageLength) - { - } - } -} diff --git a/UI/NetDiagnosticsUI.cs b/UI/NetDiagnosticsUI.cs deleted file mode 100644 index c83cd8f..0000000 --- a/UI/NetDiagnosticsUI.cs +++ /dev/null @@ -1,146 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.UI.NetDiagnosticsUI -// 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; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Graphics; -using System.Collections.Generic; -using Terraria.GameContent; - -namespace Terraria.UI -{ - public class NetDiagnosticsUI : INetDiagnosticsUI - { - private NetDiagnosticsUI.CounterForMessage[] _counterByMessageId = new NetDiagnosticsUI.CounterForMessage[141]; - private Dictionary _counterByModuleId = new Dictionary(); - private int _highestFoundReadBytes = 1; - private int _highestFoundReadCount = 1; - - public void Reset() - { - for (int index = 0; index < this._counterByMessageId.Length; ++index) - this._counterByMessageId[index].Reset(); - this._counterByModuleId.Clear(); - this._counterByMessageId[10].exemptFromBadScoreTest = true; - this._counterByMessageId[82].exemptFromBadScoreTest = true; - } - - public void CountReadMessage(int messageId, int messageLength) => this._counterByMessageId[messageId].CountReadMessage(messageLength); - - public void CountSentMessage(int messageId, int messageLength) => this._counterByMessageId[messageId].CountSentMessage(messageLength); - - public void CountReadModuleMessage(int moduleMessageId, int messageLength) - { - NetDiagnosticsUI.CounterForMessage counterForMessage; - this._counterByModuleId.TryGetValue(moduleMessageId, out counterForMessage); - counterForMessage.CountReadMessage(messageLength); - this._counterByModuleId[moduleMessageId] = counterForMessage; - } - - public void CountSentModuleMessage(int moduleMessageId, int messageLength) - { - NetDiagnosticsUI.CounterForMessage counterForMessage; - this._counterByModuleId.TryGetValue(moduleMessageId, out counterForMessage); - counterForMessage.CountSentMessage(messageLength); - this._counterByModuleId[moduleMessageId] = counterForMessage; - } - - public void Draw(SpriteBatch spriteBatch) - { - int num1 = this._counterByMessageId.Length + this._counterByModuleId.Count; - for (int index = 0; index <= num1 / 51; ++index) - Utils.DrawInvBG(spriteBatch, 190 + 400 * index, 110, 390, 683, new Color()); - Vector2 position; - for (int index = 0; index < this._counterByMessageId.Length; ++index) - { - int num2 = index / 51; - int num3 = index - num2 * 51; - position.X = (float) (200 + num2 * 400); - position.Y = (float) (120 + num3 * 13); - this.DrawCounter(spriteBatch, ref this._counterByMessageId[index], index.ToString(), position); - } - int num4 = this._counterByMessageId.Length + 1; - foreach (KeyValuePair keyValuePair in this._counterByModuleId) - { - int num5 = num4 / 51; - int num6 = num4 - num5 * 51; - position.X = (float) (200 + num5 * 400); - position.Y = (float) (120 + num6 * 13); - NetDiagnosticsUI.CounterForMessage counter = keyValuePair.Value; - this.DrawCounter(spriteBatch, ref counter, ".." + keyValuePair.Key.ToString(), position); - ++num4; - } - } - - private void DrawCounter( - SpriteBatch spriteBatch, - ref NetDiagnosticsUI.CounterForMessage counter, - string title, - Vector2 position) - { - if (!counter.exemptFromBadScoreTest) - { - if (this._highestFoundReadCount < counter.timesReceived) - this._highestFoundReadCount = counter.timesReceived; - if (this._highestFoundReadBytes < counter.bytesReceived) - this._highestFoundReadBytes = counter.bytesReceived; - } - Vector2 pos = position; - string str = title + ": "; - Color color = Main.hslToRgb((float) (0.300000011920929 * (1.0 - (double) Utils.Remap((float) counter.bytesReceived, 0.0f, (float) this._highestFoundReadBytes, 0.0f, 1f))), 1f, 0.5f); - if (counter.exemptFromBadScoreTest) - color = Color.White; - string text1 = str; - this.DrawText(spriteBatch, text1, pos, color); - pos.X += 30f; - string text2 = "rx:" + string.Format("{0,0}", (object) counter.timesReceived); - this.DrawText(spriteBatch, text2, pos, color); - pos.X += 70f; - string text3 = string.Format("{0,0}", (object) counter.bytesReceived); - this.DrawText(spriteBatch, text3, pos, color); - pos.X += 70f; - string text4 = str; - this.DrawText(spriteBatch, text4, pos, color); - pos.X += 30f; - string text5 = "tx:" + string.Format("{0,0}", (object) counter.timesSent); - this.DrawText(spriteBatch, text5, pos, color); - pos.X += 70f; - string text6 = string.Format("{0,0}", (object) counter.bytesSent); - this.DrawText(spriteBatch, text6, pos, color); - } - - private void DrawText(SpriteBatch spriteBatch, string text, Vector2 pos, Color color) => DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, FontAssets.MouseText.Value, text, pos, color, 0.0f, Vector2.Zero, 0.7f, SpriteEffects.None, 0.0f); - - private struct CounterForMessage - { - public int timesReceived; - public int timesSent; - public int bytesReceived; - public int bytesSent; - public bool exemptFromBadScoreTest; - - public void Reset() - { - this.timesReceived = 0; - this.timesSent = 0; - this.bytesReceived = 0; - this.bytesSent = 0; - } - - public void CountReadMessage(int messageLength) - { - ++this.timesReceived; - this.bytesReceived += messageLength; - } - - public void CountSentMessage(int messageLength) - { - ++this.timesSent; - this.bytesSent += messageLength; - } - } - } -} diff --git a/UI/SnapPoint.cs b/UI/SnapPoint.cs index 3b5e52a..b6d5a37 100644 --- a/UI/SnapPoint.cs +++ b/UI/SnapPoint.cs @@ -1,44 +1,43 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.SnapPoint -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; -using System.Diagnostics; namespace Terraria.UI { - [DebuggerDisplay("Snap Point - {Name} {Id}")] public class SnapPoint { - public string Name; private Vector2 _anchor; private Vector2 _offset; + private Vector2 _calculatedPosition; + private string _name; + private int _id; + public UIElement BoundElement; - public int Id { get; private set; } + public string Name => this._name; - public Vector2 Position { get; private set; } + public int ID => this._id; + + public Vector2 Position => this._calculatedPosition; public SnapPoint(string name, int id, Vector2 anchor, Vector2 offset) { - this.Name = name; - this.Id = id; + this._name = name; + this._id = id; this._anchor = anchor; this._offset = offset; } public void Calculate(UIElement element) { + this.BoundElement = element; CalculatedStyle dimensions = element.GetDimensions(); - this.Position = dimensions.Position() + this._offset + this._anchor * new Vector2(dimensions.Width, dimensions.Height); + this._calculatedPosition = dimensions.Position() + this._offset + this._anchor * new Vector2(dimensions.Width, dimensions.Height); } - public void ThisIsAHackThatChangesTheSnapPointsInfo(Vector2 anchor, Vector2 offset, int id) - { - this._anchor = anchor; - this._offset = offset; - this.Id = id; - } + public override string ToString() => "Snap Point - " + this.Name + " " + (object) this.ID; } } diff --git a/UI/StyleDimension.cs b/UI/StyleDimension.cs index 492bbd5..be57d71 100644 --- a/UI/StyleDimension.cs +++ b/UI/StyleDimension.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.StyleDimension -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.UI @@ -26,11 +26,5 @@ namespace Terraria.UI } public float GetValue(float containerSize) => this.Pixels + this.Precent * containerSize; - - public static StyleDimension FromPixels(float pixels) => new StyleDimension(pixels, 0.0f); - - public static StyleDimension FromPercent(float percent) => new StyleDimension(0.0f, percent); - - public static StyleDimension FromPixelsAndPercent(float pixels, float percent) => new StyleDimension(pixels, percent); } } diff --git a/UI/TooltipProcessor.cs b/UI/TooltipProcessor.cs index 6ed0228..a40c644 100644 --- a/UI/TooltipProcessor.cs +++ b/UI/TooltipProcessor.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.TooltipProcessor -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.UI diff --git a/UI/UIAlign.cs b/UI/UIAlign.cs index d0e35fe..6b188fb 100644 --- a/UI/UIAlign.cs +++ b/UI/UIAlign.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.UIAlign -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.UI diff --git a/UI/UIElement.cs b/UI/UIElement.cs index 694cf42..0c0342b 100644 --- a/UI/UIElement.cs +++ b/UI/UIElement.cs @@ -1,22 +1,22 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.UIElement -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Graphics; using System; using System.Collections.Generic; -using System.Diagnostics; using Terraria.GameContent.UI.Elements; namespace Terraria.UI { public class UIElement : IComparable { - protected readonly List Elements = new List(); + public string Id = ""; + public UIElement Parent; + protected List Elements = new List(); public StyleDimension Top; public StyleDimension Left; public StyleDimension Width; @@ -26,9 +26,7 @@ namespace Terraria.UI public StyleDimension MinWidth = StyleDimension.Empty; public StyleDimension MinHeight = StyleDimension.Empty; private bool _isInitialized; - public bool IgnoresMouseInteraction; public bool OverflowHidden; - public SamplerState OverrideSamplerState; public float PaddingTop; public float PaddingLeft; public float PaddingRight; @@ -42,20 +40,10 @@ namespace Terraria.UI private CalculatedStyle _innerDimensions; private CalculatedStyle _dimensions; private CalculatedStyle _outerDimensions; - private static readonly RasterizerState OverflowHiddenRasterizerState = new RasterizerState() - { - CullMode = CullMode.None, - ScissorTestEnable = true - }; - public bool UseImmediateMode; + private static RasterizerState _overflowHiddenRasterizerState; + protected bool _useImmediateMode; private SnapPoint _snapPoint; - private static int _idCounter = 0; - - public UIElement Parent { get; private set; } - - public int UniqueId { get; private set; } - - public IEnumerable Children => (IEnumerable) this.Elements; + private bool _isMouseHovering; public event UIElement.MouseEvent OnMouseDown; @@ -71,11 +59,18 @@ namespace Terraria.UI public event UIElement.ScrollWheelEvent OnScrollWheel; - public event UIElement.ElementEvent OnUpdate; + public bool IsMouseHovering => this._isMouseHovering; - public bool IsMouseHovering { get; private set; } - - public UIElement() => this.UniqueId = UIElement._idCounter++; + public UIElement() + { + if (UIElement._overflowHiddenRasterizerState != null) + return; + UIElement._overflowHiddenRasterizerState = new RasterizerState() + { + CullMode = CullMode.None, + ScissorTestEnable = true + }; + } public void SetSnapPoint(string name, int id, Vector2? anchor = null, Vector2? offset = null) { @@ -134,42 +129,38 @@ namespace Terraria.UI public virtual void Draw(SpriteBatch spriteBatch) { - int num = this.OverflowHidden ? 1 : 0; - bool useImmediateMode = this.UseImmediateMode; + int num1 = this.OverflowHidden ? 1 : 0; + int num2 = this._useImmediateMode ? 1 : 0; RasterizerState rasterizerState = spriteBatch.GraphicsDevice.RasterizerState; Rectangle scissorRectangle = spriteBatch.GraphicsDevice.ScissorRectangle; SamplerState anisotropicClamp = SamplerState.AnisotropicClamp; - if (useImmediateMode || this.OverrideSamplerState != null) + if (num2 != 0) { spriteBatch.End(); - spriteBatch.Begin(useImmediateMode ? SpriteSortMode.Immediate : SpriteSortMode.Deferred, BlendState.AlphaBlend, this.OverrideSamplerState != null ? this.OverrideSamplerState : anisotropicClamp, DepthStencilState.None, UIElement.OverflowHiddenRasterizerState, (Effect) null, Main.UIScaleMatrix); + spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, anisotropicClamp, DepthStencilState.None, UIElement._overflowHiddenRasterizerState, (Effect) null, Main.UIScaleMatrix); this.DrawSelf(spriteBatch); spriteBatch.End(); - spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, anisotropicClamp, DepthStencilState.None, UIElement.OverflowHiddenRasterizerState, (Effect) null, Main.UIScaleMatrix); + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, anisotropicClamp, DepthStencilState.None, UIElement._overflowHiddenRasterizerState, (Effect) null, Main.UIScaleMatrix); } else this.DrawSelf(spriteBatch); - if (num != 0) + if (num1 != 0) { spriteBatch.End(); Rectangle clippingRectangle = this.GetClippingRectangle(spriteBatch); spriteBatch.GraphicsDevice.ScissorRectangle = clippingRectangle; - spriteBatch.GraphicsDevice.RasterizerState = UIElement.OverflowHiddenRasterizerState; - spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, anisotropicClamp, DepthStencilState.None, UIElement.OverflowHiddenRasterizerState, (Effect) null, Main.UIScaleMatrix); + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, anisotropicClamp, DepthStencilState.None, UIElement._overflowHiddenRasterizerState, (Effect) null, Main.UIScaleMatrix); } this.DrawChildren(spriteBatch); - if (num == 0) + if (num1 == 0) return; spriteBatch.End(); spriteBatch.GraphicsDevice.ScissorRectangle = scissorRectangle; - spriteBatch.GraphicsDevice.RasterizerState = rasterizerState; spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, anisotropicClamp, DepthStencilState.None, rasterizerState, (Effect) null, Main.UIScaleMatrix); } public virtual void Update(GameTime gameTime) { - if (this.OnUpdate != null) - this.OnUpdate(this); foreach (UIElement element in this.Elements) element.Update(gameTime); } @@ -181,18 +172,13 @@ namespace Terraria.UI Vector2 vector2_1 = Vector2.Transform(position1, Main.UIScaleMatrix); Vector2 vector2_2 = Vector2.Transform(position2, Main.UIScaleMatrix); Rectangle rectangle = new Rectangle((int) vector2_1.X, (int) vector2_1.Y, (int) ((double) vector2_2.X - (double) vector2_1.X), (int) ((double) vector2_2.Y - (double) vector2_1.Y)); - int max1 = (int) ((double) Main.screenWidth * (double) Main.UIScale); - int max2 = (int) ((double) Main.screenHeight * (double) Main.UIScale); - rectangle.X = Utils.Clamp(rectangle.X, 0, max1); - rectangle.Y = Utils.Clamp(rectangle.Y, 0, max2); - rectangle.Width = Utils.Clamp(rectangle.Width, 0, max1 - rectangle.X); - rectangle.Height = Utils.Clamp(rectangle.Height, 0, max2 - rectangle.Y); - Rectangle scissorRectangle = spriteBatch.GraphicsDevice.ScissorRectangle; - int x = Utils.Clamp(rectangle.Left, scissorRectangle.Left, scissorRectangle.Right); - int y = Utils.Clamp(rectangle.Top, scissorRectangle.Top, scissorRectangle.Bottom); - int num1 = Utils.Clamp(rectangle.Right, scissorRectangle.Left, scissorRectangle.Right); - int num2 = Utils.Clamp(rectangle.Bottom, scissorRectangle.Top, scissorRectangle.Bottom); - return new Rectangle(x, y, num1 - x, num2 - y); + int width = spriteBatch.GraphicsDevice.Viewport.Width; + int height = spriteBatch.GraphicsDevice.Viewport.Height; + rectangle.X = Utils.Clamp(rectangle.X, 0, width); + rectangle.Y = Utils.Clamp(rectangle.Y, 0, height); + rectangle.Width = Utils.Clamp(rectangle.Width, 0, width - rectangle.X); + rectangle.Height = Utils.Clamp(rectangle.Height, 0, height - rectangle.Y); + return rectangle; } public virtual List GetSnapPoints() @@ -208,50 +194,42 @@ namespace Terraria.UI public virtual void Recalculate() { - CalculatedStyle parentDimensions1 = this.Parent == null ? UserInterface.ActiveInstance.GetDimensions() : this.Parent.GetInnerDimensions(); + CalculatedStyle calculatedStyle1 = this.Parent == null ? UserInterface.ActiveInstance.GetDimensions() : this.Parent.GetInnerDimensions(); if (this.Parent != null && this.Parent is UIList) - parentDimensions1.Height = float.MaxValue; - CalculatedStyle parentDimensions2 = this.GetDimensionsBasedOnParentDimensions(parentDimensions1); - this._outerDimensions = parentDimensions2; - parentDimensions2.X += this.MarginLeft; - parentDimensions2.Y += this.MarginTop; - parentDimensions2.Width -= this.MarginLeft + this.MarginRight; - parentDimensions2.Height -= this.MarginTop + this.MarginBottom; - this._dimensions = parentDimensions2; - parentDimensions2.X += this.PaddingLeft; - parentDimensions2.Y += this.PaddingTop; - parentDimensions2.Width -= this.PaddingLeft + this.PaddingRight; - parentDimensions2.Height -= this.PaddingTop + this.PaddingBottom; - this._innerDimensions = parentDimensions2; + calculatedStyle1.Height = float.MaxValue; + CalculatedStyle calculatedStyle2; + calculatedStyle2.X = this.Left.GetValue(calculatedStyle1.Width) + calculatedStyle1.X; + calculatedStyle2.Y = this.Top.GetValue(calculatedStyle1.Height) + calculatedStyle1.Y; + float min1 = this.MinWidth.GetValue(calculatedStyle1.Width); + float max1 = this.MaxWidth.GetValue(calculatedStyle1.Width); + float min2 = this.MinHeight.GetValue(calculatedStyle1.Height); + float max2 = this.MaxHeight.GetValue(calculatedStyle1.Height); + calculatedStyle2.Width = MathHelper.Clamp(this.Width.GetValue(calculatedStyle1.Width), min1, max1); + calculatedStyle2.Height = MathHelper.Clamp(this.Height.GetValue(calculatedStyle1.Height), min2, max2); + calculatedStyle2.Width += this.MarginLeft + this.MarginRight; + calculatedStyle2.Height += this.MarginTop + this.MarginBottom; + calculatedStyle2.X += (float) ((double) calculatedStyle1.Width * (double) this.HAlign - (double) calculatedStyle2.Width * (double) this.HAlign); + calculatedStyle2.Y += (float) ((double) calculatedStyle1.Height * (double) this.VAlign - (double) calculatedStyle2.Height * (double) this.VAlign); + this._outerDimensions = calculatedStyle2; + calculatedStyle2.X += this.MarginLeft; + calculatedStyle2.Y += this.MarginTop; + calculatedStyle2.Width -= this.MarginLeft + this.MarginRight; + calculatedStyle2.Height -= this.MarginTop + this.MarginBottom; + this._dimensions = calculatedStyle2; + calculatedStyle2.X += this.PaddingLeft; + calculatedStyle2.Y += this.PaddingTop; + calculatedStyle2.Width -= this.PaddingLeft + this.PaddingRight; + calculatedStyle2.Height -= this.PaddingTop + this.PaddingBottom; + this._innerDimensions = calculatedStyle2; this.RecalculateChildren(); } - private CalculatedStyle GetDimensionsBasedOnParentDimensions( - CalculatedStyle parentDimensions) - { - CalculatedStyle calculatedStyle; - calculatedStyle.X = this.Left.GetValue(parentDimensions.Width) + parentDimensions.X; - calculatedStyle.Y = this.Top.GetValue(parentDimensions.Height) + parentDimensions.Y; - float min1 = this.MinWidth.GetValue(parentDimensions.Width); - float max1 = this.MaxWidth.GetValue(parentDimensions.Width); - float min2 = this.MinHeight.GetValue(parentDimensions.Height); - float max2 = this.MaxHeight.GetValue(parentDimensions.Height); - calculatedStyle.Width = MathHelper.Clamp(this.Width.GetValue(parentDimensions.Width), min1, max1); - calculatedStyle.Height = MathHelper.Clamp(this.Height.GetValue(parentDimensions.Height), min2, max2); - calculatedStyle.Width += this.MarginLeft + this.MarginRight; - calculatedStyle.Height += this.MarginTop + this.MarginBottom; - calculatedStyle.X += (float) ((double) parentDimensions.Width * (double) this.HAlign - (double) calculatedStyle.Width * (double) this.HAlign); - calculatedStyle.Y += (float) ((double) parentDimensions.Height * (double) this.VAlign - (double) calculatedStyle.Height * (double) this.VAlign); - return calculatedStyle; - } - public UIElement GetElementAt(Vector2 point) { UIElement uiElement = (UIElement) null; - for (int index = this.Elements.Count - 1; index >= 0; --index) + foreach (UIElement element in this.Elements) { - UIElement element = this.Elements[index]; - if (!element.IgnoresMouseInteraction && element.ContainsPoint(point)) + if (element.ContainsPoint(point)) { uiElement = element; break; @@ -259,15 +237,11 @@ namespace Terraria.UI } if (uiElement != null) return uiElement.GetElementAt(point); - if (this.IgnoresMouseInteraction) - return (UIElement) null; return this.ContainsPoint(point) ? this : (UIElement) null; } public virtual bool ContainsPoint(Vector2 point) => (double) point.X > (double) this._dimensions.X && (double) point.Y > (double) this._dimensions.Y && (double) point.X < (double) this._dimensions.X + (double) this._dimensions.Width && (double) point.Y < (double) this._dimensions.Y + (double) this._dimensions.Height; - public virtual Rectangle GetViewCullingArea() => this._dimensions.ToRectangle(); - public void SetPadding(float pixels) { this.PaddingBottom = pixels; @@ -327,7 +301,7 @@ namespace Terraria.UI public virtual void MouseOver(UIMouseEvent evt) { - this.IsMouseHovering = true; + this._isMouseHovering = true; if (this.OnMouseOver != null) this.OnMouseOver(evt, this); if (this.Parent == null) @@ -337,7 +311,7 @@ namespace Terraria.UI public virtual void MouseOut(UIMouseEvent evt) { - this.IsMouseHovering = false; + this._isMouseHovering = false; if (this.OnMouseOut != null) this.OnMouseOut(evt, this); if (this.Parent == null) @@ -385,21 +359,6 @@ namespace Terraria.UI { } - [Conditional("DEBUG")] - public void DrawDebugHitbox(BasicDebugDrawer drawer, float colorIntensity = 0.0f) - { - if (this.IsMouseHovering) - colorIntensity += 0.1f; - Color rgb = Main.hslToRgb(colorIntensity, colorIntensity, 0.5f); - CalculatedStyle innerDimensions = this.GetInnerDimensions(); - drawer.DrawLine(innerDimensions.Position(), innerDimensions.Position() + new Vector2(innerDimensions.Width, 0.0f), 2f, rgb); - drawer.DrawLine(innerDimensions.Position() + new Vector2(innerDimensions.Width, 0.0f), innerDimensions.Position() + new Vector2(innerDimensions.Width, innerDimensions.Height), 2f, rgb); - drawer.DrawLine(innerDimensions.Position() + new Vector2(innerDimensions.Width, innerDimensions.Height), innerDimensions.Position() + new Vector2(0.0f, innerDimensions.Height), 2f, rgb); - drawer.DrawLine(innerDimensions.Position() + new Vector2(0.0f, innerDimensions.Height), innerDimensions.Position(), 2f, rgb); - foreach (UIElement element in this.Elements) - ; - } - public void Deactivate() { this.OnDeactivate(); @@ -426,7 +385,5 @@ namespace Terraria.UI public delegate void MouseEvent(UIMouseEvent evt, UIElement listeningElement); public delegate void ScrollWheelEvent(UIScrollWheelEvent evt, UIElement listeningElement); - - public delegate void ElementEvent(UIElement affectedElement); } } diff --git a/UI/UIEvent.cs b/UI/UIEvent.cs index e641cc8..3d7e890 100644 --- a/UI/UIEvent.cs +++ b/UI/UIEvent.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.UIEvent -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.UI diff --git a/UI/UIMouseEvent.cs b/UI/UIMouseEvent.cs index 2321093..77ca025 100644 --- a/UI/UIMouseEvent.cs +++ b/UI/UIMouseEvent.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.UIMouseEvent -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/UI/UIScrollWheelEvent.cs b/UI/UIScrollWheelEvent.cs index fd8415e..ca48f90 100644 --- a/UI/UIScrollWheelEvent.cs +++ b/UI/UIScrollWheelEvent.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.UIScrollWheelEvent -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/UI/UIState.cs b/UI/UIState.cs index 8ea9b82..f89b4c4 100644 --- a/UI/UIState.cs +++ b/UI/UIState.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.UIState -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.UI diff --git a/UI/UserInterface.cs b/UI/UserInterface.cs index 36a5c06..dfbe281 100644 --- a/UI/UserInterface.cs +++ b/UI/UserInterface.cs @@ -1,12 +1,11 @@ // Decompiled with JetBrains decompiler // Type: Terraria.UI.UserInterface -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Graphics; using System; using System.Collections.Generic; using Terraria.GameInput; @@ -28,21 +27,16 @@ namespace Terraria.UI private UIElement _lastElementClicked; private double _lastMouseDownTime; private double _clickDisabledTimeRemaining; - private bool _isStateDirty; public bool IsVisible; private UIState _currentState; public void ResetLasts() { - if (this._lastElementHover != null) - this._lastElementHover.MouseOut(new UIMouseEvent(this._lastElementHover, this.MousePosition)); this._lastElementHover = (UIElement) null; this._lastElementDown = (UIElement) null; this._lastElementClicked = (UIElement) null; } - public void EscapeElements() => this._lastElementHover = (UIElement) null; - public UIState CurrentState => this._currentState; public UserInterface() => UserInterface.ActiveInstance = this; @@ -60,7 +54,7 @@ namespace Terraria.UI private void ResetState() { - this.GetMousePosition(); + this.MousePosition = new Vector2((float) Main.mouseX, (float) Main.mouseY); this._wasMouseDown = Main.mouseLeft; if (this._lastElementHover != null) this._lastElementHover.MouseOut(new UIMouseEvent(this._lastElementHover, this.MousePosition)); @@ -71,19 +65,14 @@ namespace Terraria.UI this._clickDisabledTimeRemaining = Math.Max(this._clickDisabledTimeRemaining, 200.0); } - private void GetMousePosition() => this.MousePosition = new Vector2((float) Main.mouseX, (float) Main.mouseY); - public void Update(GameTime time) { if (this._currentState == null) return; - this.GetMousePosition(); + this.MousePosition = new Vector2((float) Main.mouseX, (float) Main.mouseY); bool flag1 = Main.mouseLeft && Main.hasFocus; UIElement target = Main.hasFocus ? this._currentState.GetElementAt(this.MousePosition) : (UIElement) null; - double disabledTimeRemaining = this._clickDisabledTimeRemaining; - TimeSpan timeSpan = time.ElapsedGameTime; - double totalMilliseconds = timeSpan.TotalMilliseconds; - this._clickDisabledTimeRemaining = Math.Max(0.0, disabledTimeRemaining - totalMilliseconds); + this._clickDisabledTimeRemaining = Math.Max(0.0, this._clickDisabledTimeRemaining - time.ElapsedGameTime.TotalMilliseconds); bool flag2 = this._clickDisabledTimeRemaining > 0.0; if (target != this._lastElementHover) { @@ -96,17 +85,12 @@ namespace Terraria.UI { this._lastElementDown = target; target.MouseDown(new UIMouseEvent(target, this.MousePosition)); - if (this._lastElementClicked == target) + if (this._lastElementClicked == target && time.TotalGameTime.TotalMilliseconds - this._lastMouseDownTime < 500.0) { - timeSpan = time.TotalGameTime; - if (timeSpan.TotalMilliseconds - this._lastMouseDownTime < 500.0) - { - target.DoubleClick(new UIMouseEvent(target, this.MousePosition)); - this._lastElementClicked = (UIElement) null; - } + target.DoubleClick(new UIMouseEvent(target, this.MousePosition)); + this._lastElementClicked = (UIElement) null; } - timeSpan = time.TotalGameTime; - this._lastMouseDownTime = timeSpan.TotalMilliseconds; + this._lastMouseDownTime = time.TotalGameTime.TotalMilliseconds; } else if (!flag1 && this._wasMouseDown && this._lastElementDown != null && !flag2) { @@ -135,36 +119,19 @@ namespace Terraria.UI this.Use(); if (this._currentState == null) return; - if (this._isStateDirty) - { - this._currentState.Recalculate(); - this._isStateDirty = false; - } this._currentState.Draw(spriteBatch); } - public void DrawDebugHitbox(BasicDebugDrawer drawer) - { - UIState currentState = this._currentState; - } - public void SetState(UIState state) { - if (state == this._currentState) - return; if (state != null) this.AddToHistory(state); if (this._currentState != null) - { - if (this._lastElementHover != null) - this._lastElementHover.MouseOut(new UIMouseEvent(this._lastElementHover, this.MousePosition)); this._currentState.Deactivate(); - } this._currentState = state; this.ResetState(); if (state == null) return; - this._isStateDirty = true; state.Activate(); state.Recalculate(); } @@ -193,11 +160,7 @@ namespace Terraria.UI this._currentState.Recalculate(); } - public CalculatedStyle GetDimensions() - { - Vector2 originalScreenSize = PlayerInput.OriginalScreenSize; - return new CalculatedStyle(0.0f, 0.0f, originalScreenSize.X / Main.UIScale, originalScreenSize.Y / Main.UIScale); - } + public CalculatedStyle GetDimensions() => new CalculatedStyle(0.0f, 0.0f, (float) Main.screenWidth, (float) Main.screenHeight); internal void RefreshState() { diff --git a/Utilities/CrashDump.cs b/Utilities/CrashDump.cs index e14a7a5..f3eb23c 100644 --- a/Utilities/CrashDump.cs +++ b/Utilities/CrashDump.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Utilities.CrashDump -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using ReLogic.OS; @@ -34,8 +34,8 @@ namespace Terraria.Utilities if (!Platform.IsWindows) return false; string path = Path.Combine(outputDirectory, CrashDump.CreateDumpName()); - if (!Utils.TryCreatingDirectory(outputDirectory)) - return false; + if (!Directory.Exists(outputDirectory)) + Directory.CreateDirectory(outputDirectory); using (FileStream fileStream = File.Create(path)) return CrashDump.Write((SafeHandle) fileStream.SafeFileHandle, options, exceptionInfo); } diff --git a/Utilities/CrashWatcher.cs b/Utilities/CrashWatcher.cs deleted file mode 100644 index ee38c20..0000000 --- a/Utilities/CrashWatcher.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Utilities.CrashWatcher -// 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.Diagnostics; -using System.IO; -using System.Runtime.ExceptionServices; -using System.Threading; - -namespace Terraria.Utilities -{ - public static class CrashWatcher - { - public static bool LogAllExceptions { get; set; } - - public static bool DumpOnException { get; set; } - - public static bool DumpOnCrash { get; private set; } - - public static CrashDump.Options CrashDumpOptions { get; private set; } - - private static string DumpPath => Path.Combine(Main.SavePath, "Dumps"); - - public static void Inititialize() - { - Console.WriteLine("Error Logging Enabled."); - AppDomain.CurrentDomain.FirstChanceException += (EventHandler) ((sender, exceptionArgs) => - { - if (!CrashWatcher.LogAllExceptions) - return; - Console.Write("================\r\n" + string.Format("{0}: First-Chance Exception\r\nThread: {1} [{2}]\r\nCulture: {3}\r\nException: {4}\r\n", (object) DateTime.Now, (object) Thread.CurrentThread.ManagedThreadId, (object) Thread.CurrentThread.Name, (object) Thread.CurrentThread.CurrentCulture.Name, (object) exceptionArgs.Exception.ToString()) + "================\r\n\r\n"); - }); - AppDomain.CurrentDomain.UnhandledException += (UnhandledExceptionEventHandler) ((sender, exceptionArgs) => - { - Console.Write("================\r\n" + string.Format("{0}: Unhandled Exception\r\nThread: {1} [{2}]\r\nCulture: {3}\r\nException: {4}\r\n", (object) DateTime.Now, (object) Thread.CurrentThread.ManagedThreadId, (object) Thread.CurrentThread.Name, (object) Thread.CurrentThread.CurrentCulture.Name, (object) exceptionArgs.ExceptionObject.ToString()) + "================\r\n"); - if (!CrashWatcher.DumpOnCrash) - return; - CrashDump.WriteException(CrashWatcher.CrashDumpOptions, CrashWatcher.DumpPath); - }); - } - - public static void EnableCrashDumps(CrashDump.Options options) - { - CrashWatcher.DumpOnCrash = true; - CrashWatcher.CrashDumpOptions = options; - } - - public static void DisableCrashDumps() => CrashWatcher.DumpOnCrash = false; - - [Conditional("DEBUG")] - private static void HookDebugExceptionDialog() - { - } - } -} diff --git a/Utilities/FastRandom.cs b/Utilities/FastRandom.cs deleted file mode 100644 index 9db7638..0000000 --- a/Utilities/FastRandom.cs +++ /dev/null @@ -1,68 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Utilities.FastRandom -// 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.Utilities -{ - public struct FastRandom - { - private const ulong RANDOM_MULTIPLIER = 25214903917; - private const ulong RANDOM_ADD = 11; - private const ulong RANDOM_MASK = 281474976710655; - - public ulong Seed { get; private set; } - - public FastRandom(ulong seed) - : this() - { - this.Seed = seed; - } - - public FastRandom(int seed) - : this() - { - this.Seed = (ulong) seed; - } - - public FastRandom WithModifier(ulong modifier) => new FastRandom(FastRandom.NextSeed(modifier) ^ this.Seed); - - public FastRandom WithModifier(int x, int y) => this.WithModifier((ulong) ((long) x + 2654435769L + ((long) y << 6)) + ((ulong) y >> 2)); - - public static FastRandom CreateWithRandomSeed() => new FastRandom((ulong) Guid.NewGuid().GetHashCode()); - - public void NextSeed() => this.Seed = FastRandom.NextSeed(this.Seed); - - private int NextBits(int bits) - { - this.Seed = FastRandom.NextSeed(this.Seed); - return (int) (this.Seed >> 48 - bits); - } - - public float NextFloat() => (float) this.NextBits(24) * 5.960464E-08f; - - public double NextDouble() => (double) this.NextBits(32) * 4.65661287307739E-10; - - public int Next(int max) - { - if ((max & -max) == max) - return (int) ((long) max * (long) this.NextBits(31) >> 31); - int num1; - int num2; - do - { - num1 = this.NextBits(31); - num2 = num1 % max; - } - while (num1 - num2 + (max - 1) < 0); - return num2; - } - - public int Next(int min, int max) => this.Next(max - min) + min; - - private static ulong NextSeed(ulong seed) => (ulong) ((long) seed * 25214903917L + 11L & 281474976710655L); - } -} diff --git a/Utilities/FileOperationAPIWrapper.cs b/Utilities/FileOperationAPIWrapper.cs index 6f12f4d..ba60199 100644 --- a/Utilities/FileOperationAPIWrapper.cs +++ b/Utilities/FileOperationAPIWrapper.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Utilities.FileOperationAPIWrapper -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; diff --git a/Utilities/FileUtilities.cs b/Utilities/FileUtilities.cs index 200b248..8c282e5 100644 --- a/Utilities/FileUtilities.cs +++ b/Utilities/FileUtilities.cs @@ -1,13 +1,12 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Utilities.FileUtilities -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; using System.IO; using System.Text.RegularExpressions; -using System.Threading; using Terraria.Social; namespace Terraria.Utilities @@ -77,8 +76,7 @@ namespace Terraria.Utilities { string parentFolderPath = FileUtilities.GetParentFolderPath(path); if (parentFolderPath != "") - Utils.TryCreatingDirectory(parentFolderPath); - FileUtilities.RemoveReadOnlyAttribute(path); + Directory.CreateDirectory(parentFolderPath); using (FileStream fileStream = File.Open(path, FileMode.Create)) { while (fileStream.Position < (long) length) @@ -87,23 +85,6 @@ namespace Terraria.Utilities } } - public static void RemoveReadOnlyAttribute(string path) - { - if (!File.Exists(path)) - return; - try - { - FileAttributes attributes = File.GetAttributes(path); - if ((attributes & FileAttributes.ReadOnly) != FileAttributes.ReadOnly) - return; - FileAttributes fileAttributes = attributes & ~FileAttributes.ReadOnly; - File.SetAttributes(path, fileAttributes); - } - catch (Exception ex) - { - } - } - public static bool MoveToCloud(string localPath, string cloudPath) { if (SocialAPI.Cloud == null) @@ -145,19 +126,5 @@ namespace Terraria.Utilities foreach (string file in Directory.GetFiles(sourcePath, "*.*", SearchOption.AllDirectories)) File.Copy(file, file.Replace(sourcePath, destinationPath), true); } - - public static void ProtectedInvoke(Action action) - { - bool isBackground = Thread.CurrentThread.IsBackground; - try - { - Thread.CurrentThread.IsBackground = false; - action(); - } - finally - { - Thread.CurrentThread.IsBackground = isBackground; - } - } } } diff --git a/Utilities/IntRange.cs b/Utilities/IntRange.cs deleted file mode 100644 index d89dc0d..0000000 --- a/Utilities/IntRange.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Utilities.IntRange -// 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 Newtonsoft.Json; - -namespace Terraria.Utilities -{ - public struct IntRange - { - [JsonProperty("Min")] - public readonly int Minimum; - [JsonProperty("Max")] - public readonly int Maximum; - - public IntRange(int minimum, int maximum) - { - this.Minimum = minimum; - this.Maximum = maximum; - } - - public static IntRange operator *(IntRange range, float scale) => new IntRange((int) ((double) range.Minimum * (double) scale), (int) ((double) range.Maximum * (double) scale)); - - public static IntRange operator *(float scale, IntRange range) => range * scale; - - public static IntRange operator /(IntRange range, float scale) => new IntRange((int) ((double) range.Minimum / (double) scale), (int) ((double) range.Maximum / (double) scale)); - - public static IntRange operator /(float scale, IntRange range) => range / scale; - } -} diff --git a/Utilities/NPCUtils.cs b/Utilities/NPCUtils.cs index ec9ed4d..db49458 100644 --- a/Utilities/NPCUtils.cs +++ b/Utilities/NPCUtils.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Utilities.NPCUtils -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -47,7 +47,7 @@ namespace Terraria.Utilities for (int index = 0; index < 200; ++index) { NPC entity = Main.npc[index]; - if (entity.active && entity.whoAmI != searcher.whoAmI && (npcFilter == null || npcFilter(entity))) + if (entity.active && (npcFilter == null || npcFilter(entity))) { float num2 = Vector2.DistanceSquared(position, entity.Center); if ((double) num2 < (double) num1) @@ -111,20 +111,6 @@ namespace Terraria.Utilities searcher.FaceTarget(); } - public static void TargetClosestNonBees(NPC searcher, bool faceTarget = true, Vector2? checkPosition = null) - { - NPCUtils.TargetSearchResults searchResults = NPCUtils.SearchForTarget(searcher, npcFilter: new NPCUtils.SearchFilter(NPCUtils.SearchFilters.NonBeeNPCs)); - if (!searchResults.FoundTarget) - return; - searcher.target = searchResults.NearestTargetIndex; - searcher.targetRect = searchResults.NearestTargetHitbox; - if (!(searcher.ShouldFaceTarget(ref searchResults) & faceTarget)) - return; - searcher.FaceTarget(); - } - - public static void TargetClosestCommon(NPC searcher, bool faceTarget = true, Vector2? checkPosition = null) => searcher.TargetClosest(faceTarget); - public static void TargetClosestBetsy(NPC searcher, bool faceTarget = true, Vector2? checkPosition = null) { NPCUtils.TargetSearchResults searchResults = NPCUtils.SearchForTarget(searcher, npcFilter: new NPCUtils.SearchFilter(NPCUtils.SearchFilters.OnlyCrystal)); @@ -142,8 +128,6 @@ namespace Terraria.Utilities public delegate bool SearchFilter(T entity) where T : Entity; - public delegate void NPCTargetingMethod(NPC searcher, bool faceTarget, Vector2? checkPosition); - public static class SearchFilters { public static bool OnlyCrystal(NPC npc) => npc.type == 548 && !npc.dontTakeDamageFromHostiles; @@ -154,8 +138,6 @@ namespace Terraria.Utilities { return (NPCUtils.SearchFilter) (player => (double) player.Distance(position) <= (double) maxDistance); } - - public static bool NonBeeNPCs(NPC npc) => npc.type != 211 && npc.type != 210 && npc.type != 222 && npc.CanBeChasedBy(); } public enum TargetType diff --git a/Utilities/PlatformUtilities.cs b/Utilities/PlatformUtilities.cs index 9c80c17..9ea7b2c 100644 --- a/Utilities/PlatformUtilities.cs +++ b/Utilities/PlatformUtilities.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Utilities.PlatformUtilities -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria.Utilities diff --git a/Utilities/Terraria/Utilities/FloatRange.cs b/Utilities/Terraria/Utilities/FloatRange.cs deleted file mode 100644 index 66316e2..0000000 --- a/Utilities/Terraria/Utilities/FloatRange.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.Utilities.Terraria.Utilities.FloatRange -// 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 Newtonsoft.Json; - -namespace Terraria.Utilities.Terraria.Utilities -{ - public struct FloatRange - { - [JsonProperty("Min")] - public readonly float Minimum; - [JsonProperty("Max")] - public readonly float Maximum; - - public FloatRange(float minimum, float maximum) - { - this.Minimum = minimum; - this.Maximum = maximum; - } - - public static FloatRange operator *(FloatRange range, float scale) => new FloatRange(range.Minimum * scale, range.Maximum * scale); - - public static FloatRange operator *(float scale, FloatRange range) => range * scale; - - public static FloatRange operator /(FloatRange range, float scale) => new FloatRange(range.Minimum / scale, range.Maximum / scale); - - public static FloatRange operator /(float scale, FloatRange range) => range / scale; - } -} diff --git a/Utilities/UnifiedRandom.cs b/Utilities/UnifiedRandom.cs index f1c0592..29315c6 100644 --- a/Utilities/UnifiedRandom.cs +++ b/Utilities/UnifiedRandom.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Utilities.UnifiedRandom -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; diff --git a/Utilities/WeightedRandom`1.cs b/Utilities/WeightedRandom`1.cs index a502e83..522d12b 100644 --- a/Utilities/WeightedRandom`1.cs +++ b/Utilities/WeightedRandom`1.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Utilities.WeightedRandom`1 -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; diff --git a/Utils.cs b/Utils.cs index 9ef5ddc..5904d33 100644 --- a/Utils.cs +++ b/Utils.cs @@ -1,30 +1,22 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Utils -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics.PackedVector; using Microsoft.Xna.Framework.Input; -using ReLogic.Content; using ReLogic.Graphics; using System; using System.Collections; using System.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics; using System.IO; using System.Linq; -using System.Reflection; -using System.Text.RegularExpressions; using Terraria.DataStructures; -using Terraria.GameContent; -using Terraria.UI; using Terraria.UI.Chat; using Terraria.Utilities; -using Terraria.Utilities.Terraria.Utilities; namespace Terraria { @@ -32,7 +24,6 @@ namespace Terraria { public const long MaxCoins = 999999999; public static Dictionary charLengths = new Dictionary(); - private static Regex _substitutionRegex = new Regex("{(\\?(?:!)?)?([a-zA-Z][\\w\\.]*)}", RegexOptions.Compiled); private const ulong RANDOM_MULTIPLIER = 25214903917; private const ulong RANDOM_ADD = 11; private const ulong RANDOM_MASK = 281474976710655; @@ -45,8 +36,6 @@ namespace Terraria public static float SmoothStep(float min, float max, float x) => MathHelper.Clamp((float) (((double) x - (double) min) / ((double) max - (double) min)), 0.0f, 1f); - public static float UnclampedSmoothStep(float min, float max, float x) => (float) (((double) x - (double) min) / ((double) max - (double) min)); - public static Dictionary ParseArguements(string[] args) { string str1 = (string) null; @@ -97,35 +86,7 @@ namespace Terraria return value.CompareTo(min) < 0 ? min : value; } - public static float Turn01ToCyclic010(float value) => (float) (1.0 - (Math.Cos((double) value * 6.28318548202515) * 0.5 + 0.5)); - - public static float PingPongFrom01To010(float value) - { - value %= 1f; - if ((double) value < 0.0) - ++value; - return (double) value >= 0.5 ? (float) (2.0 - (double) value * 2.0) : value * 2f; - } - - public static float MultiLerp(float percent, params float[] floats) - { - float num1 = (float) (1.0 / ((double) floats.Length - 1.0)); - float num2 = num1; - int index; - for (index = 0; (double) percent / (double) num2 > 1.0 && index < floats.Length - 2; ++index) - num2 += num1; - return MathHelper.Lerp(floats[index], floats[index + 1], (percent - num1 * (float) index) / num1); - } - - public static float WrappedLerp(float value1, float value2, float percent) - { - float amount = percent * 2f; - if ((double) amount > 1.0) - amount = 2f - amount; - return MathHelper.Lerp(value1, value2, amount); - } - - public static float GetLerpValue(float from, float to, float t, bool clamped = false) + public static float InverseLerp(float from, float to, float t, bool clamped = false) { if (clamped) { @@ -147,55 +108,6 @@ namespace Terraria return (float) (((double) t - (double) from) / ((double) to - (double) from)); } - public static float Remap( - float fromValue, - float fromMin, - float fromMax, - float toMin, - float toMax, - bool clamped = true) - { - return MathHelper.Lerp(toMin, toMax, Utils.GetLerpValue(fromMin, fromMax, fromValue, clamped)); - } - - public static void ClampWithinWorld( - ref int minX, - ref int minY, - ref int maxX, - ref int maxY, - bool lastValuesInclusiveToIteration = false, - int fluffX = 0, - int fluffY = 0) - { - int num = lastValuesInclusiveToIteration ? 1 : 0; - minX = Utils.Clamp(minX, fluffX, Main.maxTilesX - num - fluffX); - maxX = Utils.Clamp(maxX, fluffX, Main.maxTilesX - num - fluffX); - minY = Utils.Clamp(minY, fluffY, Main.maxTilesY - num - fluffY); - maxY = Utils.Clamp(maxY, fluffY, Main.maxTilesY - num - fluffY); - } - - public static double GetLerpValue(double from, double to, double t, bool clamped = false) - { - if (clamped) - { - if (from < to) - { - if (t < from) - return 0.0; - if (t > to) - return 1.0; - } - else - { - if (t < to) - return 1.0; - if (t > from) - return 0.0; - } - } - return (t - from) / (to - from); - } - public static string[] ConvertMonoArgsToDotNet(string[] brokenArgs) { ArrayList arrayList = new ArrayList(); @@ -226,17 +138,6 @@ namespace Terraria return strArray; } - public static T Max(params T[] args) where T : IComparable - { - T obj = args[0]; - for (int index = 1; index < args.Length; ++index) - { - if (obj.CompareTo((object) args[index]) < 0) - obj = args[index]; - } - return obj; - } - public static List> WordwrapStringSmart( string text, Color c, @@ -323,7 +224,7 @@ namespace Terraria int index1 = 0; List stringList1 = new List((IEnumerable) text.Split('\n')); List stringList2 = new List((IEnumerable) stringList1[0].Split(' ')); - for (int index2 = 1; index2 < stringList1.Count && index2 < maxLines; ++index2) + for (int index2 = 1; index2 < stringList1.Count; ++index2) { stringList2.Add("\n"); stringList2.AddRange((IEnumerable) stringList1[index2].Split(' ')); @@ -339,7 +240,6 @@ namespace Terraria { // ISSUE: explicit reference operation ^ref strArray[index1++] += str1; - flag = true; if (index1 < maxLines) stringList2.RemoveAt(0); else @@ -506,7 +406,6 @@ namespace Terraria { int index2 = Gore.NewGore(position, (Main.rand.NextFloat() * 6.283185f).ToRotationVector2() * new Vector2(2f, 0.7f) * 0.7f, Main.rand.Next(11, 14)); Main.gore[index2].scale = 0.7f; - Main.gore[index2].velocity *= 0.5f; } for (int index = 0; index < 10; ++index) { @@ -516,64 +415,6 @@ namespace Terraria } } - public static Vector2 ToScreenPosition(this Vector2 worldPosition) => Vector2.Transform(worldPosition - Main.screenPosition, Main.GameViewMatrix.ZoomMatrix) / Main.UIScale; - - public static string PrettifyPercentDisplay(float percent, string originalFormat) => string.Format("{0:" + originalFormat + "}", (object) percent).TrimEnd('0', '%', ' ').TrimEnd('.', ' ').TrimStart('0', ' ') + "%"; - - public static void TrimTextIfNeeded( - ref string text, - DynamicSpriteFont font, - float scale, - float maxWidth) - { - int num = 0; - for (Vector2 vector2 = font.MeasureString(text) * scale; (double) vector2.X > (double) maxWidth; vector2 = font.MeasureString(text) * scale) - { - text = text.Substring(0, text.Length - 1); - ++num; - } - if (num <= 0) - return; - text = text.Substring(0, text.Length - 1) + "…"; - } - - public static string FormatWith(string original, object obj) - { - string input = original; - PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(obj); - return Utils._substitutionRegex.Replace(input, (MatchEvaluator) (match => - { - if (match.Groups[1].Length != 0) - return ""; - PropertyDescriptor propertyDescriptor = properties.Find(match.Groups[2].ToString(), false); - return propertyDescriptor == null ? "" : (propertyDescriptor.GetValue(obj) ?? (object) "").ToString(); - })); - } - - public static bool TryCreatingDirectory(string folderPath) - { - if (Directory.Exists(folderPath)) - return true; - try - { - Directory.CreateDirectory(folderPath); - return true; - } - catch (Exception ex) - { - string folderPath1 = folderPath; - FancyErrorPrinter.ShowDirectoryCreationFailError(ex, folderPath1); - return false; - } - } - - public static void OpenFolder(string folderPath) - { - if (!Utils.TryCreatingDirectory(folderPath)) - return; - Process.Start(folderPath); - } - public static byte[] ToByteArray(this string str) { byte[] numArray = new byte[str.Length * 2]; @@ -585,16 +426,8 @@ namespace Terraria public static float NextFloatDirection(this UnifiedRandom r) => (float) (r.NextDouble() * 2.0 - 1.0); - public static float NextFloat(this UnifiedRandom random, FloatRange range) => random.NextFloat() * (range.Maximum - range.Minimum) + range.Minimum; - - public static T NextFromList(this UnifiedRandom random, params T[] objs) => objs[random.Next(objs.Length)]; - - public static int Next(this UnifiedRandom random, IntRange range) => random.Next(range.Minimum, range.Maximum + 1); - public static Vector2 NextVector2Square(this UnifiedRandom r, float min, float max) => new Vector2((max - min) * (float) r.NextDouble() + min, (max - min) * (float) r.NextDouble() + min); - public static Vector2 NextVector2FromRectangle(this UnifiedRandom r, Rectangle rect) => new Vector2((float) rect.X + r.NextFloat() * (float) rect.Width, (float) rect.Y + r.NextFloat() * (float) rect.Height); - public static Vector2 NextVector2Unit( this UnifiedRandom r, float startRotation = 0.0f, @@ -619,43 +452,16 @@ namespace Terraria return r.NextVector2Unit() * new Vector2(circleHalfWidth, circleHalfHeight); } - public static int Width(this Asset asset) => !asset.IsLoaded ? 0 : asset.Value.Width; - - public static int Height(this Asset asset) => !asset.IsLoaded ? 0 : asset.Value.Height; - - public static Rectangle Frame( - this Asset tex, - int horizontalFrames = 1, - int verticalFrames = 1, - int frameX = 0, - int frameY = 0, - int sizeOffsetX = 0, - int sizeOffsetY = 0) - { - return !tex.IsLoaded ? Rectangle.Empty : tex.Value.Frame(horizontalFrames, verticalFrames, frameX, frameY, sizeOffsetX, sizeOffsetY); - } - - public static Rectangle OffsetSize(this Rectangle rect, int xSize, int ySize) - { - rect.Width += xSize; - rect.Height += ySize; - return rect; - } - - public static Vector2 Size(this Asset tex) => !tex.IsLoaded ? Vector2.Zero : tex.Value.Size(); - public static Rectangle Frame( this Texture2D tex, int horizontalFrames = 1, int verticalFrames = 1, int frameX = 0, - int frameY = 0, - int sizeOffsetX = 0, - int sizeOffsetY = 0) + int frameY = 0) { - int num1 = tex.Width / horizontalFrames; - int num2 = tex.Height / verticalFrames; - return new Rectangle(num1 * frameX, num2 * frameY, num1 + sizeOffsetX, num2 + sizeOffsetY); + int width = tex.Width / horizontalFrames; + int height = tex.Height / verticalFrames; + return new Rectangle(width * frameX, height * frameY, width, height); } public static Vector2 OriginFlip( @@ -727,22 +533,6 @@ namespace Terraria return (double) point.X >= (double) r.Left && (double) point.X <= (double) r.Right ? ((double) point.Y < (double) r.Top ? (float) r.Top - point.Y : point.Y - (float) r.Bottom) : ((double) point.Y >= (double) r.Top && (double) point.Y <= (double) r.Bottom ? ((double) point.X < (double) r.Left ? (float) r.Left - point.X : point.X - (float) r.Right) : ((double) point.X < (double) r.Left ? ((double) point.Y < (double) r.Top ? Vector2.Distance(point, r.TopLeft()) : Vector2.Distance(point, r.BottomLeft())) : ((double) point.Y < (double) r.Top ? Vector2.Distance(point, r.TopRight()) : Vector2.Distance(point, r.BottomRight())))); } - public static Vector2 ClosestPointInRect(this Rectangle r, Vector2 point) - { - Vector2 vector2 = point; - if ((double) vector2.X < (double) r.Left) - vector2.X = (float) r.Left; - if ((double) vector2.X > (double) r.Right) - vector2.X = (float) r.Right; - if ((double) vector2.Y < (double) r.Top) - vector2.Y = (float) r.Top; - if ((double) vector2.Y > (double) r.Bottom) - vector2.Y = (float) r.Bottom; - return vector2; - } - - public static Rectangle Modified(this Rectangle r, int x, int y, int w, int h) => new Rectangle(r.X + x, r.Y + y, r.Width + w, r.Height + h); - public static float ToRotation(this Vector2 v) => (float) Math.Atan2((double) v.Y, (double) v.X); public static Vector2 ToRotationVector2(this float f) => new Vector2((float) Math.Cos((double) f), (float) Math.Sin((double) f)); @@ -776,28 +566,15 @@ namespace Terraria public static Vector2 ToVector2(this Point p) => new Vector2((float) p.X, (float) p.Y); - public static Vector2 ToVector2(this Point16 p) => new Vector2((float) p.X, (float) p.Y); - public static Vector2 ToWorldCoordinates(this Point p, float autoAddX = 8f, float autoAddY = 8f) => p.ToVector2() * 16f + new Vector2(autoAddX, autoAddY); - public static Vector2 ToWorldCoordinates(this Point16 p, float autoAddX = 8f, float autoAddY = 8f) => p.ToVector2() * 16f + new Vector2(autoAddX, autoAddY); - - public static Vector2 MoveTowards( - this Vector2 currentPosition, - Vector2 targetPosition, - float maxAmountAllowedToMove) - { - Vector2 v = targetPosition - currentPosition; - return (double) v.Length() < (double) maxAmountAllowedToMove ? targetPosition : currentPosition + v.SafeNormalize(Vector2.Zero) * maxAmountAllowedToMove; - } - public static Point16 ToTileCoordinates16(this Vector2 vec) => new Point16((int) vec.X >> 4, (int) vec.Y >> 4); public static Point ToTileCoordinates(this Vector2 vec) => new Point((int) vec.X >> 4, (int) vec.Y >> 4); public static Point ToPoint(this Vector2 v) => new Point((int) v.X, (int) v.Y); - public static Vector2 SafeNormalize(this Vector2 v, Vector2 defaultValue) => v == Vector2.Zero || v.HasNaNs() ? defaultValue : Vector2.Normalize(v); + public static Vector2 SafeNormalize(this Vector2 v, Vector2 defaultValue) => v == Vector2.Zero ? defaultValue : Vector2.Normalize(v); public static Vector2 ClosestPointOnLine(this Vector2 P, Vector2 A, Vector2 B) { @@ -838,31 +615,6 @@ namespace Terraria public static Vector2 RotateRandom(this Vector2 spinninpoint, double maxRadians) => spinninpoint.RotatedBy(Main.rand.NextDouble() * maxRadians - Main.rand.NextDouble() * maxRadians); - public static float AngleTo(this Vector2 Origin, Vector2 Target) => (float) Math.Atan2((double) Target.Y - (double) Origin.Y, (double) Target.X - (double) Origin.X); - - public static float AngleFrom(this Vector2 Origin, Vector2 Target) => (float) Math.Atan2((double) Origin.Y - (double) Target.Y, (double) Origin.X - (double) Target.X); - - public static Vector2 rotateTowards( - Vector2 currentPosition, - Vector2 currentVelocity, - Vector2 targetPosition, - float maxChange) - { - float num = currentVelocity.Length(); - float targetAngle = currentPosition.AngleTo(targetPosition); - return currentVelocity.ToRotation().AngleTowards(targetAngle, (float) Math.PI / 180f).ToRotationVector2() * num; - } - - public static float Distance(this Vector2 Origin, Vector2 Target) => Vector2.Distance(Origin, Target); - - public static float DistanceSQ(this Vector2 Origin, Vector2 Target) => Vector2.DistanceSquared(Origin, Target); - - public static Vector2 DirectionTo(this Vector2 Origin, Vector2 Target) => Vector2.Normalize(Target - Origin); - - public static Vector2 DirectionFrom(this Vector2 Origin, Vector2 Target) => Vector2.Normalize(Origin - Target); - - public static bool WithinRange(this Vector2 Origin, Vector2 Target, float MaxRange) => (double) Vector2.DistanceSquared(Origin, Target) <= (double) MaxRange * (double) MaxRange; - public static Vector2 XY(this Vector4 vec) => new Vector2(vec.X, vec.Y); public static Vector2 ZW(this Vector4 vec) => new Vector2(vec.Z, vec.W); @@ -903,8 +655,6 @@ namespace Terraria public static int ToInt(this bool value) => !value ? 0 : 1; - public static int ModulusPositive(this int myInteger, int modulusNumber) => (myInteger % modulusNumber + modulusNumber) % modulusNumber; - public static float AngleLerp(this float curAngle, float targetAngle, float amount) { float angle; @@ -952,39 +702,18 @@ namespace Terraria return true; } - public static List GetTrueIndexes(this bool[] array) - { - List intList = new List(); - for (int index = 0; index < array.Length; ++index) - { - if (array[index]) - intList.Add(index); - } - return intList; - } - - public static List GetTrueIndexes(params bool[][] arrays) - { - List source = new List(); - foreach (bool[] array in arrays) - source.AddRange((IEnumerable) array.GetTrueIndexes()); - return source.Distinct().ToList(); - } - public static bool PressingShift(this KeyboardState kb) => kb.IsKeyDown(Keys.LeftShift) || kb.IsKeyDown(Keys.RightShift); - public static bool PressingControl(this KeyboardState kb) => kb.IsKeyDown(Keys.LeftControl) || kb.IsKeyDown(Keys.RightControl); + public static bool PlotLine(Point16 p0, Point16 p1, Utils.PerLinePoint plot, bool jump = true) => Utils.PlotLine((int) p0.X, (int) p0.Y, (int) p1.X, (int) p1.Y, plot, jump); - public static bool PlotLine(Point16 p0, Point16 p1, Utils.TileActionAttempt plot, bool jump = true) => Utils.PlotLine((int) p0.X, (int) p0.Y, (int) p1.X, (int) p1.Y, plot, jump); - - public static bool PlotLine(Point p0, Point p1, Utils.TileActionAttempt plot, bool jump = true) => Utils.PlotLine(p0.X, p0.Y, p1.X, p1.Y, plot, jump); + public static bool PlotLine(Point p0, Point p1, Utils.PerLinePoint plot, bool jump = true) => Utils.PlotLine(p0.X, p0.Y, p1.X, p1.Y, plot, jump); private static bool PlotLine( int x0, int y0, int x1, int y1, - Utils.TileActionAttempt plot, + Utils.PerLinePoint plot, bool jump = true) { if (x0 == x1 && y0 == y1) @@ -1061,7 +790,7 @@ namespace Terraria Vector2 start, Vector2 end, float width, - Utils.TileActionAttempt plot) + Utils.PerLinePoint plot) { float num = width / 2f; Vector2 vector2_1 = end - start; @@ -1073,14 +802,14 @@ namespace Terraria Point tileCoordinates4 = end.ToTileCoordinates(); Point lineMinOffset = new Point(tileCoordinates1.X - tileCoordinates3.X, tileCoordinates1.Y - tileCoordinates3.Y); Point lineMaxOffset = new Point(tileCoordinates2.X - tileCoordinates3.X, tileCoordinates2.Y - tileCoordinates3.Y); - return Utils.PlotLine(tileCoordinates3.X, tileCoordinates3.Y, tileCoordinates4.X, tileCoordinates4.Y, (Utils.TileActionAttempt) ((x, y) => Utils.PlotLine(x + lineMinOffset.X, y + lineMinOffset.Y, x + lineMaxOffset.X, y + lineMaxOffset.Y, plot, false))); + return Utils.PlotLine(tileCoordinates3.X, tileCoordinates3.Y, tileCoordinates4.X, tileCoordinates4.Y, (Utils.PerLinePoint) ((x, y) => Utils.PlotLine(x + lineMinOffset.X, y + lineMinOffset.Y, x + lineMaxOffset.X, y + lineMaxOffset.Y, plot, false))); } public static bool PlotTileTale( Vector2 start, Vector2 end, float width, - Utils.TileActionAttempt plot) + Utils.PerLinePoint plot) { float halfWidth = width / 2f; Vector2 vector2_1 = end - start; @@ -1089,14 +818,14 @@ namespace Terraria Point pointStart = start.ToTileCoordinates(); Point tileCoordinates1 = end.ToTileCoordinates(); int length = 0; - Utils.PlotLine(pointStart.X, pointStart.Y, tileCoordinates1.X, tileCoordinates1.Y, (Utils.TileActionAttempt) ((_param1, _param2) => + Utils.PlotLine(pointStart.X, pointStart.Y, tileCoordinates1.X, tileCoordinates1.Y, (Utils.PerLinePoint) ((x, y) => { ++length; return true; })); length--; int curLength = 0; - return Utils.PlotLine(pointStart.X, pointStart.Y, tileCoordinates1.X, tileCoordinates1.Y, (Utils.TileActionAttempt) ((x, y) => + return Utils.PlotLine(pointStart.X, pointStart.Y, tileCoordinates1.X, tileCoordinates1.Y, (Utils.PerLinePoint) ((x, y) => { float num = (float) (1.0 - (double) curLength / (double) length); ++curLength; @@ -1108,51 +837,6 @@ namespace Terraria })); } - public static bool PlotTileArea(int x, int y, Utils.TileActionAttempt plot) - { - if (!WorldGen.InWorld(x, y)) - return false; - List pointList1 = new List(); - List pointList2 = new List(); - HashSet pointSet = new HashSet(); - pointList2.Add(new Point(x, y)); - while (pointList2.Count > 0) - { - pointList1.Clear(); - pointList1.AddRange((IEnumerable) pointList2); - pointList2.Clear(); - while (pointList1.Count > 0) - { - Point point1 = pointList1[0]; - if (!WorldGen.InWorld(point1.X, point1.Y, 1)) - { - pointList1.Remove(point1); - } - else - { - pointSet.Add(point1); - pointList1.Remove(point1); - if (plot(point1.X, point1.Y)) - { - Point point2 = new Point(point1.X - 1, point1.Y); - if (!pointSet.Contains(point2)) - pointList2.Add(point2); - point2 = new Point(point1.X + 1, point1.Y); - if (!pointSet.Contains(point2)) - pointList2.Add(point2); - point2 = new Point(point1.X, point1.Y - 1); - if (!pointSet.Contains(point2)) - pointList2.Add(point2); - point2 = new Point(point1.X, point1.Y + 1); - if (!pointSet.Contains(point2)) - pointList2.Add(point2); - } - } - } - } - return true; - } - public static int RandomConsecutive(double random, int odds) => (int) Math.Log(1.0 - random, 1.0 / (double) odds); public static Vector2 RandomVector2(UnifiedRandom random, float min, float max) => new Vector2((max - min) * (float) random.NextDouble() + min, (max - min) * (float) random.NextDouble() + min); @@ -1218,9 +902,9 @@ namespace Terraria { if (maxCharactersDisplayed != -1 && text.Length > maxCharactersDisplayed) text.Substring(0, maxCharactersDisplayed); - DynamicSpriteFont font = FontAssets.MouseText.Value; - Vector2 vector2 = font.MeasureString(text); - ChatManager.DrawColorCodedStringWithShadow(sb, font, text, pos, color, 0.0f, new Vector2(anchorx, anchory) * vector2, new Vector2(scale), spread: 1.5f); + DynamicSpriteFont fontMouseText = Main.fontMouseText; + Vector2 vector2 = fontMouseText.MeasureString(text); + ChatManager.DrawColorCodedStringWithShadow(sb, fontMouseText, text, pos, color, 0.0f, new Vector2(anchorx, anchory) * vector2, new Vector2(scale), spread: 1.5f); return vector2 * scale; } @@ -1236,14 +920,14 @@ namespace Terraria { if (maxCharactersDisplayed != -1 && text.Length > maxCharactersDisplayed) text.Substring(0, maxCharactersDisplayed); - DynamicSpriteFont dynamicSpriteFont = FontAssets.DeathText.Value; + DynamicSpriteFont fontDeathText = Main.fontDeathText; for (int index1 = -1; index1 < 2; ++index1) { for (int index2 = -1; index2 < 2; ++index2) - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, dynamicSpriteFont, text, pos + new Vector2((float) index1, (float) index2), Color.Black, 0.0f, new Vector2(anchorx, anchory) * dynamicSpriteFont.MeasureString(text), scale, SpriteEffects.None, 0.0f); + DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, fontDeathText, text, pos + new Vector2((float) index1, (float) index2), Color.Black, 0.0f, new Vector2(anchorx, anchory) * fontDeathText.MeasureString(text), scale, SpriteEffects.None, 0.0f); } - DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, dynamicSpriteFont, text, pos, color, 0.0f, new Vector2(anchorx, anchory) * dynamicSpriteFont.MeasureString(text), scale, SpriteEffects.None, 0.0f); - return dynamicSpriteFont.MeasureString(text) * scale; + DynamicSpriteFontExtensionMethods.DrawString(spriteBatch, fontDeathText, text, pos, color, 0.0f, new Vector2(anchorx, anchory) * fontDeathText.MeasureString(text), scale, SpriteEffects.None, 0.0f); + return fontDeathText.MeasureString(text) * scale; } public static void DrawInvBG(SpriteBatch sb, Rectangle R, Color c = default (Color)) => Utils.DrawInvBG(sb, R.X, R.Y, R.Width, R.Height, c); @@ -1254,57 +938,20 @@ namespace Terraria { if (c == new Color()) c = new Color(63, 65, 151, (int) byte.MaxValue) * 0.785f; - Texture2D texture = TextureAssets.InventoryBack13.Value; + Texture2D inventoryBack13Texture = Main.inventoryBack13Texture; if (w < 20) w = 20; if (h < 20) h = 20; - sb.Draw(texture, new Rectangle(x, y, 10, 10), new Rectangle?(new Rectangle(0, 0, 10, 10)), c); - sb.Draw(texture, new Rectangle(x + 10, y, w - 20, 10), new Rectangle?(new Rectangle(10, 0, 10, 10)), c); - sb.Draw(texture, new Rectangle(x + w - 10, y, 10, 10), new Rectangle?(new Rectangle(texture.Width - 10, 0, 10, 10)), c); - sb.Draw(texture, new Rectangle(x, y + 10, 10, h - 20), new Rectangle?(new Rectangle(0, 10, 10, 10)), c); - sb.Draw(texture, new Rectangle(x + 10, y + 10, w - 20, h - 20), new Rectangle?(new Rectangle(10, 10, 10, 10)), c); - sb.Draw(texture, new Rectangle(x + w - 10, y + 10, 10, h - 20), new Rectangle?(new Rectangle(texture.Width - 10, 10, 10, 10)), c); - sb.Draw(texture, new Rectangle(x, y + h - 10, 10, 10), new Rectangle?(new Rectangle(0, texture.Height - 10, 10, 10)), c); - sb.Draw(texture, new Rectangle(x + 10, y + h - 10, w - 20, 10), new Rectangle?(new Rectangle(10, texture.Height - 10, 10, 10)), c); - sb.Draw(texture, new Rectangle(x + w - 10, y + h - 10, 10, 10), new Rectangle?(new Rectangle(texture.Width - 10, texture.Height - 10, 10, 10)), c); - } - - public static string ReadEmbeddedResource(string path) - { - using (Stream manifestResourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(path)) - { - using (StreamReader streamReader = new StreamReader(manifestResourceStream)) - return streamReader.ReadToEnd(); - } - } - - public static void DrawSplicedPanel( - SpriteBatch sb, - Texture2D texture, - int x, - int y, - int w, - int h, - int leftEnd, - int rightEnd, - int topEnd, - int bottomEnd, - Color c) - { - if (w < leftEnd + rightEnd) - w = leftEnd + rightEnd; - if (h < topEnd + bottomEnd) - h = topEnd + bottomEnd; - sb.Draw(texture, new Rectangle(x, y, leftEnd, topEnd), new Rectangle?(new Rectangle(0, 0, leftEnd, topEnd)), c); - sb.Draw(texture, new Rectangle(x + leftEnd, y, w - leftEnd - rightEnd, topEnd), new Rectangle?(new Rectangle(leftEnd, 0, texture.Width - leftEnd - rightEnd, topEnd)), c); - sb.Draw(texture, new Rectangle(x + w - rightEnd, y, topEnd, rightEnd), new Rectangle?(new Rectangle(texture.Width - rightEnd, 0, rightEnd, topEnd)), c); - sb.Draw(texture, new Rectangle(x, y + topEnd, leftEnd, h - topEnd - bottomEnd), new Rectangle?(new Rectangle(0, topEnd, leftEnd, texture.Height - topEnd - bottomEnd)), c); - sb.Draw(texture, new Rectangle(x + leftEnd, y + topEnd, w - leftEnd - rightEnd, h - topEnd - bottomEnd), new Rectangle?(new Rectangle(leftEnd, topEnd, texture.Width - leftEnd - rightEnd, texture.Height - topEnd - bottomEnd)), c); - sb.Draw(texture, new Rectangle(x + w - rightEnd, y + topEnd, rightEnd, h - topEnd - bottomEnd), new Rectangle?(new Rectangle(texture.Width - rightEnd, topEnd, rightEnd, texture.Height - topEnd - bottomEnd)), c); - sb.Draw(texture, new Rectangle(x, y + h - bottomEnd, leftEnd, bottomEnd), new Rectangle?(new Rectangle(0, texture.Height - bottomEnd, leftEnd, bottomEnd)), c); - sb.Draw(texture, new Rectangle(x + leftEnd, y + h - bottomEnd, w - leftEnd - rightEnd, bottomEnd), new Rectangle?(new Rectangle(leftEnd, texture.Height - bottomEnd, texture.Width - leftEnd - rightEnd, bottomEnd)), c); - sb.Draw(texture, new Rectangle(x + w - rightEnd, y + h - bottomEnd, rightEnd, bottomEnd), new Rectangle?(new Rectangle(texture.Width - rightEnd, texture.Height - bottomEnd, rightEnd, bottomEnd)), c); + sb.Draw(inventoryBack13Texture, new Rectangle(x, y, 10, 10), new Rectangle?(new Rectangle(0, 0, 10, 10)), c); + sb.Draw(inventoryBack13Texture, new Rectangle(x + 10, y, w - 20, 10), new Rectangle?(new Rectangle(10, 0, 10, 10)), c); + sb.Draw(inventoryBack13Texture, new Rectangle(x + w - 10, y, 10, 10), new Rectangle?(new Rectangle(inventoryBack13Texture.Width - 10, 0, 10, 10)), c); + sb.Draw(inventoryBack13Texture, new Rectangle(x, y + 10, 10, h - 20), new Rectangle?(new Rectangle(0, 10, 10, 10)), c); + sb.Draw(inventoryBack13Texture, new Rectangle(x + 10, y + 10, w - 20, h - 20), new Rectangle?(new Rectangle(10, 10, 10, 10)), c); + sb.Draw(inventoryBack13Texture, new Rectangle(x + w - 10, y + 10, 10, h - 20), new Rectangle?(new Rectangle(inventoryBack13Texture.Width - 10, 10, 10, 10)), c); + sb.Draw(inventoryBack13Texture, new Rectangle(x, y + h - 10, 10, 10), new Rectangle?(new Rectangle(0, inventoryBack13Texture.Height - 10, 10, 10)), c); + sb.Draw(inventoryBack13Texture, new Rectangle(x + 10, y + h - 10, w - 20, 10), new Rectangle?(new Rectangle(10, inventoryBack13Texture.Height - 10, 10, 10)), c); + sb.Draw(inventoryBack13Texture, new Rectangle(x + w - 10, y + h - 10, 10, 10), new Rectangle?(new Rectangle(inventoryBack13Texture.Width - 10, inventoryBack13Texture.Height - 10, 10, 10)), c); } public static void DrawSettingsPanel( @@ -1313,7 +960,7 @@ namespace Terraria float width, Color color) { - Utils.DrawPanel(TextureAssets.SettingsPanel.Value, 2, 0, spriteBatch, position, width, color); + Utils.DrawPanel(Main.settingsPanelTexture, 2, 0, spriteBatch, position, width, color); } public static void DrawSettings2Panel( @@ -1322,7 +969,7 @@ namespace Terraria float width, Color color) { - Utils.DrawPanel(TextureAssets.SettingsPanel.Value, 2, 0, spriteBatch, position, width, color); + Utils.DrawPanel(Main.settingsPanelTexture, 2, 0, spriteBatch, position, width, color); } public static void DrawPanel( @@ -1407,7 +1054,7 @@ namespace Terraria for (float num2 = 0.0f; (double) num2 <= (double) num1; num2 += 4f) { float num3 = num2 / num1; - spriteBatch.Draw(TextureAssets.BlackTile.Value, vector2 - screenPosition, new Rectangle?(), new Color(new Vector4(num3, num3, num3, 1f) * color.ToVector4()), rotation, Vector2.Zero, 0.25f, SpriteEffects.None, 0.0f); + spriteBatch.Draw(Main.blackTileTexture, vector2 - screenPosition, new Rectangle?(), new Color(new Vector4(num3, num3, num3, 1f) * color.ToVector4()), rotation, Vector2.Zero, 0.25f, SpriteEffects.None, 0.0f); vector2 = start + num2 * v; } } @@ -1429,29 +1076,14 @@ namespace Terraria for (float num2 = 0.0f; (double) num2 <= (double) num1; num2 += width) { float amount = num2 / num1; - spriteBatch.Draw(TextureAssets.BlackTile.Value, vector2 - screenPosition, new Rectangle?(), Color.Lerp(colorStart, colorEnd, amount), rotation, Vector2.Zero, scale, SpriteEffects.None, 0.0f); + spriteBatch.Draw(Main.blackTileTexture, vector2 - screenPosition, new Rectangle?(), Color.Lerp(colorStart, colorEnd, amount), rotation, Vector2.Zero, scale, SpriteEffects.None, 0.0f); vector2 = start + num2 * v; } } - public static void DrawRectForTilesInWorld( - SpriteBatch spriteBatch, - Rectangle rect, - Color color) - { - Utils.DrawRectForTilesInWorld(spriteBatch, new Point(rect.X, rect.Y), new Point(rect.X + rect.Width, rect.Y + rect.Height), color); - } + public static void DrawRect(SpriteBatch spriteBatch, Rectangle rect, Color color) => Utils.DrawRect(spriteBatch, new Point(rect.X, rect.Y), new Point(rect.X + rect.Width, rect.Y + rect.Height), color); - public static void DrawRectForTilesInWorld( - SpriteBatch spriteBatch, - Point start, - Point end, - Color color) - { - Utils.DrawRect(spriteBatch, new Vector2((float) (start.X << 4), (float) (start.Y << 4)), new Vector2((float) ((end.X << 4) - 4), (float) ((end.Y << 4) - 4)), color); - } - - public static void DrawRect(SpriteBatch spriteBatch, Rectangle rect, Color color) => Utils.DrawRect(spriteBatch, new Vector2((float) rect.X, (float) rect.Y), new Vector2((float) (rect.X + rect.Width), (float) (rect.Y + rect.Height)), color); + public static void DrawRect(SpriteBatch spriteBatch, Point start, Point end, Color color) => Utils.DrawRect(spriteBatch, new Vector2((float) (start.X << 4), (float) (start.Y << 4)), new Vector2((float) ((end.X << 4) - 4), (float) ((end.Y << 4) - 4)), color); public static void DrawRect(SpriteBatch spriteBatch, Vector2 start, Vector2 end, Color color) { @@ -1523,13 +1155,13 @@ namespace Terraria if (Main.ThickMouse && cursorSlot == 0 || cursorSlot == 1) vector2_2 = Main.DrawThickCursor(cursorSlot == 1); if (flag2) - sb.Draw(TextureAssets.Cursors[cursorSlot].Value, vector2_1 + vector2_2 + Vector2.One, new Rectangle?(), color.MultiplyRGB(new Color(0.2f, 0.2f, 0.2f, 0.5f)), rot, origin, scale * 1.1f, SpriteEffects.None, 0.0f); + sb.Draw(Main.cursorTextures[cursorSlot], vector2_1 + vector2_2 + Vector2.One, new Rectangle?(), color.MultiplyRGB(new Color(0.2f, 0.2f, 0.2f, 0.5f)), rot, origin, scale * 1.1f, SpriteEffects.None, 0.0f); if (!flag3) return; - sb.Draw(TextureAssets.Cursors[cursorSlot].Value, vector2_1 + vector2_2, new Rectangle?(), color, rot, origin, scale, SpriteEffects.None, 0.0f); + sb.Draw(Main.cursorTextures[cursorSlot], vector2_1 + vector2_2, new Rectangle?(), color, rot, origin, scale, SpriteEffects.None, 0.0f); } - public delegate bool TileActionAttempt(int x, int y); + public delegate bool PerLinePoint(int x, int y); public delegate void LaserLineFraming( int stage, diff --git a/WaterfallManager.cs b/WaterfallManager.cs index 597ad34..eb767ca 100644 --- a/WaterfallManager.cs +++ b/WaterfallManager.cs @@ -1,29 +1,26 @@ // Decompiled with JetBrains decompiler // Type: Terraria.WaterfallManager -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; using System; -using Terraria.ID; -using Terraria.IO; +using System.IO; namespace Terraria { public class WaterfallManager { private const int minWet = 160; - private const int maxWaterfallCountDefault = 1000; + private const int maxCount = 200; private const int maxLength = 100; - private const int maxTypes = 24; - public int maxWaterfallCount = 1000; + private const int maxTypes = 23; private int qualityMax; private int currentMax; private WaterfallManager.WaterfallData[] waterfalls; - private Asset[] waterfallTexture = new Asset[24]; + public Texture2D[] waterfallTexture = new Texture2D[23]; private int wFallFrCounter; private int regularFrame; private int wFallFrCounter2; @@ -36,20 +33,12 @@ namespace Terraria private int findWaterfallCount; private int waterfallDist = 100; - public WaterfallManager() - { - this.waterfalls = new WaterfallManager.WaterfallData[1000]; - Main.Configuration.OnLoad += (Action) (preferences => - { - this.maxWaterfallCount = Math.Max(0, preferences.Get("WaterfallDrawLimit", 1000)); - this.waterfalls = new WaterfallManager.WaterfallData[this.maxWaterfallCount]; - }); - } + public WaterfallManager() => this.waterfalls = new WaterfallManager.WaterfallData[200]; public void LoadContent() { - for (int index = 0; index < 24; ++index) - this.waterfallTexture[index] = Main.Assets.Request("Images/Waterfall_" + (object) index, (AssetRequestMode) 2); + for (int index = 0; index < 23; ++index) + this.waterfallTexture[index] = Main.instance.OurLoad("Images" + Path.DirectorySeparatorChar.ToString() + "Waterfall_" + (object) index); } public bool CheckForWaterfall(int i, int j) @@ -69,7 +58,7 @@ namespace Terraria return; this.findWaterfallCount = 0; this.waterfallDist = (int) (75.0 * (double) Main.gfxQuality) + 25; - this.qualityMax = (int) ((double) this.maxWaterfallCount * (double) Main.gfxQuality); + this.qualityMax = (int) (175.0 * (double) Main.gfxQuality) + 25; this.currentMax = 0; int num1 = (int) ((double) Main.screenPosition.X / 16.0 - 1.0); int num2 = (int) (((double) Main.screenPosition.X + (double) Main.screenWidth) / 16.0) + 2; @@ -109,13 +98,13 @@ namespace Terraria } if (testTile1.liquid < (byte) 16 || WorldGen.SolidTile(testTile1)) { - Tile testTile2 = Main.tile[index1 - 1, index2]; + Tile testTile2 = Main.tile[index1 + 1, index2]; if (testTile2 == null) { testTile2 = new Tile(); Main.tile[index1 - 1, index2] = testTile2; } - Tile testTile3 = Main.tile[index1 + 1, index2]; + Tile testTile3 = Main.tile[index1 - 1, index2]; if (testTile3 == null) { testTile3 = new Tile(); @@ -210,7 +199,6 @@ namespace Terraria private void DrawWaterfall(SpriteBatch spriteBatch, int Style = 0, float Alpha = 1f) { - Main.tileSolid[546] = false; float num1 = 0.0f; float num2 = 99999f; float num3 = 99999f; @@ -260,7 +248,7 @@ namespace Terraria num17 = this.waterfallDist / 2; if (this.waterfalls[index1].stopAtStep > num17) this.waterfalls[index1].stopAtStep = num17; - if (this.waterfalls[index1].stopAtStep != 0 && (double) (y + num17) >= (double) Main.screenPosition.Y / 16.0 && (double) x1 >= (double) Main.screenPosition.X / 16.0 - 20.0 && (double) x1 <= ((double) Main.screenPosition.X + (double) Main.screenWidth) / 16.0 + 20.0) + if (this.waterfalls[index1].stopAtStep != 0 && (double) (y + num17) >= (double) Main.screenPosition.Y / 16.0 && (double) x1 >= (double) Main.screenPosition.X / 16.0 - 1.0 && (double) x1 <= ((double) Main.screenPosition.X + (double) Main.screenWidth) / 16.0 + 1.0) { int num18; int num19; @@ -290,11 +278,7 @@ namespace Terraria Rectangle rectangle2 = new Rectangle(num18 * 18, 0, 16, 16); Vector2 origin = new Vector2(8f, 8f); Vector2 position = y % 2 != 0 ? new Vector2((float) (x1 * 16 + 8), (float) (y * 16 + 8)) - Main.screenPosition : new Vector2((float) (x1 * 16 + 9), (float) (y * 16 + 8)) - Main.screenPosition; - Tile tile = Main.tile[x1, y - 1]; - if (tile.active() && tile.bottomSlope()) - position.Y -= 16f; bool flag = false; - float rotation = 0.0f; for (int index4 = 0; index4 < num17; ++index4) { Color color1 = Lighting.GetColor(x1, y); @@ -310,12 +294,12 @@ namespace Terraria Color color3 = color1 * num21; if (index2 == 22) { - spriteBatch.Draw(this.waterfallTexture[22].Value, position, new Rectangle?(rectangle2), color2, 0.0f, origin, 1f, SpriteEffects.None, 0.0f); + spriteBatch.Draw(this.waterfallTexture[22], position, new Rectangle?(rectangle2), color2, 0.0f, origin, 1f, SpriteEffects.None, 0.0f); } else { - spriteBatch.Draw(this.waterfallTexture[12].Value, position, new Rectangle?(rectangle1), color3, rotation, origin, 1f, SpriteEffects.None, 0.0f); - spriteBatch.Draw(this.waterfallTexture[11].Value, position, new Rectangle?(rectangle2), color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); + spriteBatch.Draw(this.waterfallTexture[12], position, new Rectangle?(rectangle1), color3, 0.0f, origin, 1f, SpriteEffects.None, 0.0f); + spriteBatch.Draw(this.waterfallTexture[11], position, new Rectangle?(rectangle2), color2, 0.0f, origin, 1f, SpriteEffects.None, 0.0f); } if (!flag) { @@ -364,58 +348,58 @@ namespace Terraria { case 1: double num26; - float r1 = (float) (num26 = (0.550000011920929 + (double) (270 - (int) Main.mouseTextColor) / 900.0) * 0.400000005960464); - float g1 = (float) (num26 * 0.300000011920929); - float b1 = (float) (num26 * 0.100000001490116); - Lighting.AddLight(x1, y, r1, g1, b1); + float R1 = (float) (num26 = (0.550000011920929 + (double) (270 - (int) Main.mouseTextColor) / 900.0) * 0.400000005960464); + float G1 = (float) (num26 * 0.300000011920929); + float B1 = (float) (num26 * 0.100000001490116); + Lighting.AddLight(x1, y, R1, G1, B1); break; case 2: float num27 = (float) Main.DiscoR / (float) byte.MaxValue; float num28 = (float) Main.DiscoG / (float) byte.MaxValue; float num29 = (float) Main.DiscoB / (float) byte.MaxValue; - float r2 = num27 * 0.2f; - float g2 = num28 * 0.2f; - float b2 = num29 * 0.2f; - Lighting.AddLight(x1, y, r2, g2, b2); + float R2 = num27 * 0.2f; + float G2 = num28 * 0.2f; + float B2 = num29 * 0.2f; + Lighting.AddLight(x1, y, R2, G2, B2); break; case 15: - float r3 = 0.0f; - float g3 = 0.0f; - float b3 = 0.2f; - Lighting.AddLight(x1, y, r3, g3, b3); + float R3 = 0.0f; + float G3 = 0.0f; + float B3 = 0.2f; + Lighting.AddLight(x1, y, R3, G3, B3); break; case 16: - float r4 = 0.0f; - float g4 = 0.2f; - float b4 = 0.0f; - Lighting.AddLight(x1, y, r4, g4, b4); + float R4 = 0.0f; + float G4 = 0.2f; + float B4 = 0.0f; + Lighting.AddLight(x1, y, R4, G4, B4); break; case 17: - float r5 = 0.0f; - float g5 = 0.0f; - float b5 = 0.2f; - Lighting.AddLight(x1, y, r5, g5, b5); + float R5 = 0.0f; + float G5 = 0.0f; + float B5 = 0.2f; + Lighting.AddLight(x1, y, R5, G5, B5); break; case 18: - float r6 = 0.0f; - float g6 = 0.2f; - float b6 = 0.0f; - Lighting.AddLight(x1, y, r6, g6, b6); + float R6 = 0.0f; + float G6 = 0.2f; + float B6 = 0.0f; + Lighting.AddLight(x1, y, R6, G6, B6); break; case 19: - float r7 = 0.2f; - float g7 = 0.0f; - float b7 = 0.0f; - Lighting.AddLight(x1, y, r7, g7, b7); + float R7 = 0.2f; + float G7 = 0.0f; + float B7 = 0.0f; + Lighting.AddLight(x1, y, R7, G7, B7); break; case 20: Lighting.AddLight(x1, y, 0.2f, 0.2f, 0.2f); break; case 21: - float r8 = 0.2f; - float g8 = 0.0f; - float b8 = 0.0f; - Lighting.AddLight(x1, y, r8, g8, b8); + float R8 = 0.2f; + float G8 = 0.0f; + float B8 = 0.0f; + Lighting.AddLight(x1, y, R8, G8, B8); break; } Tile tile = Main.tile[x1, y]; @@ -424,372 +408,357 @@ namespace Terraria tile = new Tile(); Main.tile[x1, y] = tile; } - if (!tile.nactive() || !Main.tileSolid[(int) tile.type] || Main.tileSolidTop[(int) tile.type] || TileID.Sets.Platforms[(int) tile.type] || tile.blockType() != 0) + Tile testTile1 = Main.tile[x1 - 1, y]; + if (testTile1 == null) { - Tile testTile1 = Main.tile[x1 - 1, y]; - if (testTile1 == null) + testTile1 = new Tile(); + Main.tile[x1 - 1, y] = testTile1; + } + Tile testTile2 = Main.tile[x1, y + 1]; + if (testTile2 == null) + { + testTile2 = new Tile(); + Main.tile[x1, y + 1] = testTile2; + } + Tile testTile3 = Main.tile[x1 + 1, y]; + if (testTile3 == null) + { + testTile3 = new Tile(); + Main.tile[x1 + 1, y] = testTile3; + } + int num30 = (int) tile.liquid / 16; + int num31 = 0; + int num32 = num15; + int num33; + int num34; + if (testTile2.topSlope()) + { + if (testTile2.slope() == (byte) 1) { - testTile1 = new Tile(); - Main.tile[x1 - 1, y] = testTile1; - } - Tile testTile2 = Main.tile[x1, y + 1]; - if (testTile2 == null) - { - testTile2 = new Tile(); - Main.tile[x1, y + 1] = testTile2; - } - Tile testTile3 = Main.tile[x1 + 1, y]; - if (testTile3 == null) - { - testTile3 = new Tile(); - Main.tile[x1 + 1, y] = testTile3; - } - int num30 = (int) tile.liquid / 16; - int num31 = 0; - int num32 = num15; - int num33; - int num34; - if (testTile2.topSlope() && !tile.halfBrick() && testTile2.type != (ushort) 19) - { - if (testTile2.slope() == (byte) 1) - { - num31 = 1; - num33 = 1; - num14 = 1; - num15 = num14; - } - else - { - num31 = -1; - num33 = -1; - num14 = -1; - num15 = num14; - } - num34 = 1; - } - else if (!WorldGen.SolidTile(testTile2) && !testTile2.bottomSlope() && !tile.halfBrick() || !testTile2.active() && !tile.halfBrick()) - { - num24 = 0; - num34 = 1; - num33 = 0; - } - else if ((WorldGen.SolidTile(testTile1) || testTile1.topSlope() || testTile1.liquid > (byte) 0) && !WorldGen.SolidTile(testTile3) && testTile3.liquid == (byte) 0) - { - if (num14 == -1) - ++num24; + num31 = 1; num33 = 1; - num34 = 0; num14 = 1; - } - else if ((WorldGen.SolidTile(testTile3) || testTile3.topSlope() || testTile3.liquid > (byte) 0) && !WorldGen.SolidTile(testTile1) && testTile1.liquid == (byte) 0) - { - if (num14 == 1) - ++num24; - num33 = -1; - num34 = 0; - num14 = -1; - } - else if ((!WorldGen.SolidTile(testTile3) && !tile.topSlope() || testTile3.liquid == (byte) 0) && !WorldGen.SolidTile(testTile1) && !tile.topSlope() && testTile1.liquid == (byte) 0) - { - num34 = 0; - num33 = num14; + num15 = num14; } else { + num31 = -1; + num33 = -1; + num14 = -1; + num15 = num14; + } + num34 = 1; + } + else if ((!WorldGen.SolidTile(testTile2) && !testTile2.bottomSlope() || testTile2.type == (ushort) 162) && !tile.halfBrick() || !testTile2.active() && !tile.halfBrick()) + { + num24 = 0; + num34 = 1; + num33 = 0; + } + else if ((WorldGen.SolidTile(testTile1) || testTile1.topSlope() || testTile1.liquid > (byte) 0) && !WorldGen.SolidTile(testTile3) && testTile3.liquid == (byte) 0) + { + if (num14 == -1) ++num24; - num34 = 0; - num33 = 0; - } - if (num24 >= 2) - { - num14 *= -1; - num33 *= -1; - } - int num35 = -1; - if (index2 != 1 && index2 != 14) - { - if (testTile2.active()) - num35 = (int) testTile2.type; - if (tile.active()) - num35 = (int) tile.type; - } - switch (num35) - { - case 160: - index2 = 2; + num33 = 1; + num34 = 0; + num14 = 1; + } + else if ((WorldGen.SolidTile(testTile3) || testTile3.topSlope() || testTile3.liquid > (byte) 0) && !WorldGen.SolidTile(testTile1) && testTile1.liquid == (byte) 0) + { + if (num14 == 1) + ++num24; + num33 = -1; + num34 = 0; + num14 = -1; + } + else if ((!WorldGen.SolidTile(testTile3) && !tile.topSlope() || testTile3.liquid == (byte) 0) && !WorldGen.SolidTile(testTile1) && !tile.topSlope() && testTile1.liquid == (byte) 0) + { + num34 = 0; + num33 = num14; + } + else + { + ++num24; + num34 = 0; + num33 = 0; + } + if (num24 >= 2) + { + num14 *= -1; + num33 *= -1; + } + int num35 = -1; + if (index2 != 1 && index2 != 14) + { + if (testTile2.active()) + num35 = (int) testTile2.type; + if (tile.active()) + num35 = (int) tile.type; + } + switch (num35) + { + case 160: + index2 = 2; + break; + case 262: + case 263: + case 264: + case 265: + case 266: + case 267: + case 268: + index2 = 15 + num35 - 262; + break; + } + if (WorldGen.SolidTile(testTile2) && !tile.halfBrick()) + num11 = 8; + else if (num13 != 0) + num11 = 0; + Color color5 = Lighting.GetColor(x1, y); + Color color6 = color5; + float num36; + switch (index2) + { + case 1: + num36 = 1f; + break; + case 14: + num36 = 0.8f; + break; + default: + num36 = tile.wall != (byte) 0 || (double) y >= Main.worldSurface ? 0.6f * Alpha : Alpha; + break; + } + if (index5 > num25 - 10) + num36 *= (float) (num25 - index5) / 10f; + float num37 = (float) color5.R * num36; + float num38 = (float) color5.G * num36; + float num39 = (float) color5.B * num36; + float num40 = (float) color5.A * num36; + switch (index2) + { + case 1: + if ((double) num37 < 190.0 * (double) num36) + num37 = 190f * num36; + if ((double) num38 < 190.0 * (double) num36) + num38 = 190f * num36; + if ((double) num39 < 190.0 * (double) num36) + { + num39 = 190f * num36; break; - case 262: - case 263: - case 264: - case 265: - case 266: - case 267: - case 268: - index2 = 15 + num35 - 262; - break; - } - if (WorldGen.SolidTile(testTile2) && !tile.halfBrick()) - num11 = 8; - else if (num13 != 0) - num11 = 0; - Color color5 = Lighting.GetColor(x1, y); - Color color6 = color5; - float num36; - switch (index2) + } + break; + case 2: + num37 = (float) Main.DiscoR * num36; + num38 = (float) Main.DiscoG * num36; + num39 = (float) Main.DiscoB * num36; + break; + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + num37 = (float) byte.MaxValue * num36; + num38 = (float) byte.MaxValue * num36; + num39 = (float) byte.MaxValue * num36; + break; + } + color5 = new Color((int) num37, (int) num38, (int) num39, (int) num40); + if (index2 == 1) + { + float num41 = Math.Abs((float) (x1 * 16 + 8) - (Main.screenPosition.X + (float) (Main.screenWidth / 2))); + float num42 = Math.Abs((float) (y * 16 + 8) - (Main.screenPosition.Y + (float) (Main.screenHeight / 2))); + if ((double) num41 < (double) (Main.screenWidth * 2) && (double) num42 < (double) (Main.screenHeight * 2)) { - case 1: - num36 = 1f; - break; - case 14: - num36 = 0.8f; - break; - default: - num36 = tile.wall != (ushort) 0 || (double) y >= Main.worldSurface ? 0.6f * Alpha : Alpha; - break; + float num43 = (float) (1.0 - Math.Sqrt((double) num41 * (double) num41 + (double) num42 * (double) num42) / ((double) Main.screenWidth * 0.75)); + if ((double) num43 > 0.0) + num6 += num43; } - if (index5 > num25 - 10) - num36 *= (float) (num25 - index5) / 10f; - float num37 = (float) color5.R * num36; - float num38 = (float) color5.G * num36; - float num39 = (float) color5.B * num36; - float num40 = (float) color5.A * num36; - switch (index2) + if ((double) num41 < (double) num7) { - case 1: - if ((double) num37 < 190.0 * (double) num36) - num37 = 190f * num36; - if ((double) num38 < 190.0 * (double) num36) - num38 = 190f * num36; - if ((double) num39 < 190.0 * (double) num36) + num7 = num41; + num9 = x1 * 16 + 8; + } + if ((double) num42 < (double) num8) + { + num8 = num41; + num10 = y * 16 + 8; + } + } + else if (index2 != 1 && index2 != 14 && index2 != 11 && index2 != 12 && index2 != 22) + { + float num44 = Math.Abs((float) (x1 * 16 + 8) - (Main.screenPosition.X + (float) (Main.screenWidth / 2))); + float num45 = Math.Abs((float) (y * 16 + 8) - (Main.screenPosition.Y + (float) (Main.screenHeight / 2))); + if ((double) num44 < (double) (Main.screenWidth * 2) && (double) num45 < (double) (Main.screenHeight * 2)) + { + float num46 = (float) (1.0 - Math.Sqrt((double) num44 * (double) num44 + (double) num45 * (double) num45) / ((double) Main.screenWidth * 0.75)); + if ((double) num46 > 0.0) + num1 += num46; + } + if ((double) num44 < (double) num2) + { + num2 = num44; + num4 = x1 * 16 + 8; + } + if ((double) num45 < (double) num3) + { + num3 = num44; + num5 = y * 16 + 8; + } + } + if (index5 > 50 && (color6.R > (byte) 20 || color6.B > (byte) 20 || color6.G > (byte) 20)) + { + float num47 = (float) color6.R; + if ((double) color6.G > (double) num47) + num47 = (float) color6.G; + if ((double) color6.B > (double) num47) + num47 = (float) color6.B; + if ((double) Main.rand.Next(20000) < (double) num47 / 30.0) + { + int index6 = Dust.NewDust(new Vector2((float) (x1 * 16 - num14 * 7), (float) (y * 16 + 6)), 10, 8, 43, Alpha: 254, newColor: Color.White, Scale: 0.5f); + Main.dust[index6].velocity *= 0.0f; + } + } + if (num12 == 0 && num31 != 0 && num13 == 1 && num14 != num15) + { + num31 = 0; + num14 = num15; + color5 = Color.White; + if (num14 == 1) + spriteBatch.Draw(this.waterfallTexture[index2], new Vector2((float) (x1 * 16 - 16), (float) (y * 16 + 16)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 24, 32, 16 - num30)), color5, 0.0f, Vector2.Zero, 1f, SpriteEffects.FlipHorizontally, 0.0f); + else + spriteBatch.Draw(this.waterfallTexture[index2], new Vector2((float) (x1 * 16 - 16), (float) (y * 16 + 16)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 24, 32, 8)), color5, 0.0f, Vector2.Zero, 1f, SpriteEffects.FlipHorizontally, 0.0f); + } + if (num16 != 0 && num33 == 0 && num34 == 1) + { + if (num14 == 1) + { + if (index3 != index2) + spriteBatch.Draw(this.waterfallTexture[index3], new Vector2((float) (x1 * 16), (float) (y * 16 + num11 + 8)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 0, 16, 16 - num30 - 8)), color4, 0.0f, Vector2.Zero, 1f, SpriteEffects.FlipHorizontally, 0.0f); + else + spriteBatch.Draw(this.waterfallTexture[index2], new Vector2((float) (x1 * 16), (float) (y * 16 + num11 + 8)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 0, 16, 16 - num30 - 8)), color5, 0.0f, Vector2.Zero, 1f, SpriteEffects.FlipHorizontally, 0.0f); + } + else + spriteBatch.Draw(this.waterfallTexture[index2], new Vector2((float) (x1 * 16), (float) (y * 16 + num11 + 8)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 0, 16, 16 - num30 - 8)), color5, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + if (num11 == 8 && num13 == 1 && num16 == 0) + { + if (num15 == -1) + { + if (index3 != index2) + spriteBatch.Draw(this.waterfallTexture[index3], new Vector2((float) (x1 * 16), (float) (y * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 24, 32, 8)), color4, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + else + spriteBatch.Draw(this.waterfallTexture[index2], new Vector2((float) (x1 * 16), (float) (y * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 24, 32, 8)), color5, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + } + else if (index3 != index2) + spriteBatch.Draw(this.waterfallTexture[index3], new Vector2((float) (x1 * 16 - 16), (float) (y * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 24, 32, 8)), color4, 0.0f, new Vector2(), 1f, SpriteEffects.FlipHorizontally, 0.0f); + else + spriteBatch.Draw(this.waterfallTexture[index2], new Vector2((float) (x1 * 16 - 16), (float) (y * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 24, 32, 8)), color5, 0.0f, new Vector2(), 1f, SpriteEffects.FlipHorizontally, 0.0f); + } + if (num31 != 0 && num12 == 0) + { + if (num32 == 1) + { + if (index3 != index2) + spriteBatch.Draw(this.waterfallTexture[index3], new Vector2((float) (x1 * 16 - 16), (float) (y * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 24, 32, 16 - num30)), color4, 0.0f, new Vector2(), 1f, SpriteEffects.FlipHorizontally, 0.0f); + else + spriteBatch.Draw(this.waterfallTexture[index2], new Vector2((float) (x1 * 16 - 16), (float) (y * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 24, 32, 16 - num30)), color5, 0.0f, new Vector2(), 1f, SpriteEffects.FlipHorizontally, 0.0f); + } + else if (index3 != index2) + spriteBatch.Draw(this.waterfallTexture[index3], new Vector2((float) (x1 * 16), (float) (y * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 24, 32, 16 - num30)), color4, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + else + spriteBatch.Draw(this.waterfallTexture[index2], new Vector2((float) (x1 * 16), (float) (y * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 24, 32, 16 - num30)), color5, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + } + if (num34 == 1 && num31 == 0 && num16 == 0) + { + if (num14 == -1) + { + if (num13 == 0) + spriteBatch.Draw(this.waterfallTexture[index2], new Vector2((float) (x1 * 16), (float) (y * 16 + num11)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 0, 16, 16 - num30)), color5, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + else if (index3 != index2) + spriteBatch.Draw(this.waterfallTexture[index3], new Vector2((float) (x1 * 16), (float) (y * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 24, 32, 16 - num30)), color4, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + else + spriteBatch.Draw(this.waterfallTexture[index2], new Vector2((float) (x1 * 16), (float) (y * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 24, 32, 16 - num30)), color5, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + } + else if (num13 == 0) + spriteBatch.Draw(this.waterfallTexture[index2], new Vector2((float) (x1 * 16), (float) (y * 16 + num11)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 0, 16, 16 - num30)), color5, 0.0f, new Vector2(), 1f, SpriteEffects.FlipHorizontally, 0.0f); + else if (index3 != index2) + spriteBatch.Draw(this.waterfallTexture[index3], new Vector2((float) (x1 * 16 - 16), (float) (y * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 24, 32, 16 - num30)), color4, 0.0f, new Vector2(), 1f, SpriteEffects.FlipHorizontally, 0.0f); + else + spriteBatch.Draw(this.waterfallTexture[index2], new Vector2((float) (x1 * 16 - 16), (float) (y * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 24, 32, 16 - num30)), color5, 0.0f, new Vector2(), 1f, SpriteEffects.FlipHorizontally, 0.0f); + } + else + { + switch (num33) + { + case -1: + if (Main.tile[x1, y].liquid <= (byte) 0 || Main.tile[x1, y].halfBrick()) { - num39 = 190f * num36; + if (num31 == -1) + { + for (int index7 = 0; index7 < 8; ++index7) + { + int num48 = index7 * 2; + int num49 = index7 * 2; + int num50 = 14 - index7 * 2; + num11 = 8; + if (num12 == 0 && index7 > 5) + num50 = 4; + spriteBatch.Draw(this.waterfallTexture[index2], new Vector2((float) (x1 * 16 + num48), (float) (y * 16 + num11 + num50)) - Main.screenPosition, new Rectangle?(new Rectangle(16 + x2 + num49, 0, 2, 16 - num11)), color5, 0.0f, new Vector2(), 1f, SpriteEffects.FlipHorizontally, 0.0f); + } + break; + } + spriteBatch.Draw(this.waterfallTexture[index2], new Vector2((float) (x1 * 16), (float) (y * 16 + num11)) - Main.screenPosition, new Rectangle?(new Rectangle(16 + x2, 0, 16, 16)), color5, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); break; } break; - case 2: - num37 = (float) Main.DiscoR * num36; - num38 = (float) Main.DiscoG * num36; - num39 = (float) Main.DiscoB * num36; + case 0: + if (num34 == 0) + { + if (Main.tile[x1, y].liquid <= (byte) 0 || Main.tile[x1, y].halfBrick()) + spriteBatch.Draw(this.waterfallTexture[index2], new Vector2((float) (x1 * 16), (float) (y * 16 + num11)) - Main.screenPosition, new Rectangle?(new Rectangle(16 + x2, 0, 16, 16)), color5, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); + index5 = 1000; + break; + } break; - case 15: - case 16: - case 17: - case 18: - case 19: - case 20: - case 21: - num37 = (float) byte.MaxValue * num36; - num38 = (float) byte.MaxValue * num36; - num39 = (float) byte.MaxValue * num36; + case 1: + if (Main.tile[x1, y].liquid <= (byte) 0 || Main.tile[x1, y].halfBrick()) + { + if (num31 == 1) + { + for (int index8 = 0; index8 < 8; ++index8) + { + int num51 = index8 * 2; + int num52 = 14 - index8 * 2; + int num53 = num51; + num11 = 8; + if (num12 == 0 && index8 < 2) + num53 = 4; + spriteBatch.Draw(this.waterfallTexture[index2], new Vector2((float) (x1 * 16 + num51), (float) (y * 16 + num11 + num53)) - Main.screenPosition, new Rectangle?(new Rectangle(16 + x2 + num52, 0, 2, 16 - num11)), color5, 0.0f, new Vector2(), 1f, SpriteEffects.FlipHorizontally, 0.0f); + } + break; + } + spriteBatch.Draw(this.waterfallTexture[index2], new Vector2((float) (x1 * 16), (float) (y * 16 + num11)) - Main.screenPosition, new Rectangle?(new Rectangle(16 + x2, 0, 16, 16)), color5, 0.0f, new Vector2(), 1f, SpriteEffects.FlipHorizontally, 0.0f); + break; + } break; } - color5 = new Color((int) num37, (int) num38, (int) num39, (int) num40); - if (index2 == 1) - { - float num41 = Math.Abs((float) (x1 * 16 + 8) - (Main.screenPosition.X + (float) (Main.screenWidth / 2))); - float num42 = Math.Abs((float) (y * 16 + 8) - (Main.screenPosition.Y + (float) (Main.screenHeight / 2))); - if ((double) num41 < (double) (Main.screenWidth * 2) && (double) num42 < (double) (Main.screenHeight * 2)) - { - float num43 = (float) (1.0 - Math.Sqrt((double) num41 * (double) num41 + (double) num42 * (double) num42) / ((double) Main.screenWidth * 0.75)); - if ((double) num43 > 0.0) - num6 += num43; - } - if ((double) num41 < (double) num7) - { - num7 = num41; - num9 = x1 * 16 + 8; - } - if ((double) num42 < (double) num8) - { - num8 = num41; - num10 = y * 16 + 8; - } - } - else if (index2 != 1 && index2 != 14 && index2 != 11 && index2 != 12 && index2 != 22) - { - float num44 = Math.Abs((float) (x1 * 16 + 8) - (Main.screenPosition.X + (float) (Main.screenWidth / 2))); - float num45 = Math.Abs((float) (y * 16 + 8) - (Main.screenPosition.Y + (float) (Main.screenHeight / 2))); - if ((double) num44 < (double) (Main.screenWidth * 2) && (double) num45 < (double) (Main.screenHeight * 2)) - { - float num46 = (float) (1.0 - Math.Sqrt((double) num44 * (double) num44 + (double) num45 * (double) num45) / ((double) Main.screenWidth * 0.75)); - if ((double) num46 > 0.0) - num1 += num46; - } - if ((double) num44 < (double) num2) - { - num2 = num44; - num4 = x1 * 16 + 8; - } - if ((double) num45 < (double) num3) - { - num3 = num44; - num5 = y * 16 + 8; - } - } - if (index5 > 50 && (color6.R > (byte) 20 || color6.B > (byte) 20 || color6.G > (byte) 20)) - { - float num47 = (float) color6.R; - if ((double) color6.G > (double) num47) - num47 = (float) color6.G; - if ((double) color6.B > (double) num47) - num47 = (float) color6.B; - if ((double) Main.rand.Next(20000) < (double) num47 / 30.0) - { - int index6 = Dust.NewDust(new Vector2((float) (x1 * 16 - num14 * 7), (float) (y * 16 + 6)), 10, 8, 43, Alpha: 254, newColor: Color.White, Scale: 0.5f); - Main.dust[index6].velocity *= 0.0f; - } - } - if (num12 == 0 && num31 != 0 && num13 == 1 && num14 != num15) - { - num31 = 0; - num14 = num15; - color5 = Color.White; - if (num14 == 1) - spriteBatch.Draw(this.waterfallTexture[index2].Value, new Vector2((float) (x1 * 16 - 16), (float) (y * 16 + 16)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 24, 32, 16 - num30)), color5, 0.0f, Vector2.Zero, 1f, SpriteEffects.FlipHorizontally, 0.0f); - else - spriteBatch.Draw(this.waterfallTexture[index2].Value, new Vector2((float) (x1 * 16 - 16), (float) (y * 16 + 16)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 24, 32, 8)), color5, 0.0f, Vector2.Zero, 1f, SpriteEffects.FlipHorizontally, 0.0f); - } - if (num16 != 0 && num33 == 0 && num34 == 1) - { - if (num14 == 1) - { - if (index3 != index2) - spriteBatch.Draw(this.waterfallTexture[index3].Value, new Vector2((float) (x1 * 16), (float) (y * 16 + num11 + 8)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 0, 16, 16 - num30 - 8)), color4, 0.0f, Vector2.Zero, 1f, SpriteEffects.FlipHorizontally, 0.0f); - else - spriteBatch.Draw(this.waterfallTexture[index2].Value, new Vector2((float) (x1 * 16), (float) (y * 16 + num11 + 8)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 0, 16, 16 - num30 - 8)), color5, 0.0f, Vector2.Zero, 1f, SpriteEffects.FlipHorizontally, 0.0f); - } - else - spriteBatch.Draw(this.waterfallTexture[index2].Value, new Vector2((float) (x1 * 16), (float) (y * 16 + num11 + 8)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 0, 16, 16 - num30 - 8)), color5, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - } - if (num11 == 8 && num13 == 1 && num16 == 0) - { - if (num15 == -1) - { - if (index3 != index2) - spriteBatch.Draw(this.waterfallTexture[index3].Value, new Vector2((float) (x1 * 16), (float) (y * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 24, 32, 8)), color4, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - else - spriteBatch.Draw(this.waterfallTexture[index2].Value, new Vector2((float) (x1 * 16), (float) (y * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 24, 32, 8)), color5, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - } - else if (index3 != index2) - spriteBatch.Draw(this.waterfallTexture[index3].Value, new Vector2((float) (x1 * 16 - 16), (float) (y * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 24, 32, 8)), color4, 0.0f, new Vector2(), 1f, SpriteEffects.FlipHorizontally, 0.0f); - else - spriteBatch.Draw(this.waterfallTexture[index2].Value, new Vector2((float) (x1 * 16 - 16), (float) (y * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 24, 32, 8)), color5, 0.0f, new Vector2(), 1f, SpriteEffects.FlipHorizontally, 0.0f); - } - if (num31 != 0 && num12 == 0) - { - if (num32 == 1) - { - if (index3 != index2) - spriteBatch.Draw(this.waterfallTexture[index3].Value, new Vector2((float) (x1 * 16 - 16), (float) (y * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 24, 32, 16 - num30)), color4, 0.0f, new Vector2(), 1f, SpriteEffects.FlipHorizontally, 0.0f); - else - spriteBatch.Draw(this.waterfallTexture[index2].Value, new Vector2((float) (x1 * 16 - 16), (float) (y * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 24, 32, 16 - num30)), color5, 0.0f, new Vector2(), 1f, SpriteEffects.FlipHorizontally, 0.0f); - } - else if (index3 != index2) - spriteBatch.Draw(this.waterfallTexture[index3].Value, new Vector2((float) (x1 * 16), (float) (y * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 24, 32, 16 - num30)), color4, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - else - spriteBatch.Draw(this.waterfallTexture[index2].Value, new Vector2((float) (x1 * 16), (float) (y * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 24, 32, 16 - num30)), color5, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - } - if (num34 == 1 && num31 == 0 && num16 == 0) - { - if (num14 == -1) - { - if (num13 == 0) - spriteBatch.Draw(this.waterfallTexture[index2].Value, new Vector2((float) (x1 * 16), (float) (y * 16 + num11)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 0, 16, 16 - num30)), color5, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - else if (index3 != index2) - spriteBatch.Draw(this.waterfallTexture[index3].Value, new Vector2((float) (x1 * 16), (float) (y * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 24, 32, 16 - num30)), color4, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - else - spriteBatch.Draw(this.waterfallTexture[index2].Value, new Vector2((float) (x1 * 16), (float) (y * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 24, 32, 16 - num30)), color5, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - } - else if (num13 == 0) - spriteBatch.Draw(this.waterfallTexture[index2].Value, new Vector2((float) (x1 * 16), (float) (y * 16 + num11)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 0, 16, 16 - num30)), color5, 0.0f, new Vector2(), 1f, SpriteEffects.FlipHorizontally, 0.0f); - else if (index3 != index2) - spriteBatch.Draw(this.waterfallTexture[index3].Value, new Vector2((float) (x1 * 16 - 16), (float) (y * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 24, 32, 16 - num30)), color4, 0.0f, new Vector2(), 1f, SpriteEffects.FlipHorizontally, 0.0f); - else - spriteBatch.Draw(this.waterfallTexture[index2].Value, new Vector2((float) (x1 * 16 - 16), (float) (y * 16)) - Main.screenPosition, new Rectangle?(new Rectangle(x2, 24, 32, 16 - num30)), color5, 0.0f, new Vector2(), 1f, SpriteEffects.FlipHorizontally, 0.0f); - } - else - { - switch (num33) - { - case -1: - if (Main.tile[x1, y].liquid <= (byte) 0 || Main.tile[x1, y].halfBrick()) - { - if (num31 == -1) - { - for (int index7 = 0; index7 < 8; ++index7) - { - int num48 = index7 * 2; - int num49 = index7 * 2; - int num50 = 14 - index7 * 2; - num11 = 8; - if (num12 == 0 && index7 > 5) - num50 = 4; - spriteBatch.Draw(this.waterfallTexture[index2].Value, new Vector2((float) (x1 * 16 + num48), (float) (y * 16 + num11 + num50)) - Main.screenPosition, new Rectangle?(new Rectangle(16 + x2 + num49, 0, 2, 16 - num11)), color5, 0.0f, new Vector2(), 1f, SpriteEffects.FlipHorizontally, 0.0f); - } - break; - } - int height = 16; - if (TileID.Sets.BlocksWaterDrawingBehindSelf[(int) Main.tile[x1, y].type]) - height = 8; - else if (TileID.Sets.BlocksWaterDrawingBehindSelf[(int) Main.tile[x1, y + 1].type]) - height = 8; - spriteBatch.Draw(this.waterfallTexture[index2].Value, new Vector2((float) (x1 * 16), (float) (y * 16 + num11)) - Main.screenPosition, new Rectangle?(new Rectangle(16 + x2, 0, 16, height)), color5, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - break; - } - break; - case 0: - if (num34 == 0) - { - if (Main.tile[x1, y].liquid <= (byte) 0 || Main.tile[x1, y].halfBrick()) - spriteBatch.Draw(this.waterfallTexture[index2].Value, new Vector2((float) (x1 * 16), (float) (y * 16 + num11)) - Main.screenPosition, new Rectangle?(new Rectangle(16 + x2, 0, 16, 16)), color5, 0.0f, new Vector2(), 1f, SpriteEffects.None, 0.0f); - index5 = 1000; - break; - } - break; - case 1: - if (Main.tile[x1, y].liquid <= (byte) 0 || Main.tile[x1, y].halfBrick()) - { - if (num31 == 1) - { - for (int index8 = 0; index8 < 8; ++index8) - { - int num51 = index8 * 2; - int num52 = 14 - index8 * 2; - int num53 = num51; - num11 = 8; - if (num12 == 0 && index8 < 2) - num53 = 4; - spriteBatch.Draw(this.waterfallTexture[index2].Value, new Vector2((float) (x1 * 16 + num51), (float) (y * 16 + num11 + num53)) - Main.screenPosition, new Rectangle?(new Rectangle(16 + x2 + num52, 0, 2, 16 - num11)), color5, 0.0f, new Vector2(), 1f, SpriteEffects.FlipHorizontally, 0.0f); - } - break; - } - int height = 16; - if (TileID.Sets.BlocksWaterDrawingBehindSelf[(int) Main.tile[x1, y].type]) - height = 8; - else if (TileID.Sets.BlocksWaterDrawingBehindSelf[(int) Main.tile[x1, y + 1].type]) - height = 8; - spriteBatch.Draw(this.waterfallTexture[index2].Value, new Vector2((float) (x1 * 16), (float) (y * 16 + num11)) - Main.screenPosition, new Rectangle?(new Rectangle(16 + x2, 0, 16, height)), color5, 0.0f, new Vector2(), 1f, SpriteEffects.FlipHorizontally, 0.0f); - break; - } - break; - } - } - if (tile.liquid > (byte) 0 && !tile.halfBrick()) - index5 = 1000; - num13 = num34; - num15 = num14; - num12 = num33; - x1 += num33; - y += num34; - num16 = num31; - color4 = color5; - if (index3 != index2) - index3 = index2; - if (testTile1.active() && (testTile1.type == (ushort) 189 || testTile1.type == (ushort) 196) || testTile3.active() && (testTile3.type == (ushort) 189 || testTile3.type == (ushort) 196) || testTile2.active() && (testTile2.type == (ushort) 189 || testTile2.type == (ushort) 196)) - num25 = (int) ((double) (40 * (Main.maxTilesX / 4200)) * (double) Main.gfxQuality); } - else - break; + if (tile.liquid > (byte) 0 && !tile.halfBrick()) + index5 = 1000; + num13 = num34; + num15 = num14; + num12 = num33; + x1 += num33; + y += num34; + num16 = num31; + color4 = color5; + if (index3 != index2) + index3 = index2; + if (testTile1.active() && (testTile1.type == (ushort) 189 || testTile1.type == (ushort) 196) || testTile3.active() && (testTile3.type == (ushort) 189 || testTile3.type == (ushort) 196) || testTile2.active() && (testTile2.type == (ushort) 189 || testTile2.type == (ushort) 196)) + num25 = (int) ((double) (40 * (Main.maxTilesX / 4200)) * (double) Main.gfxQuality); } } } @@ -799,7 +768,6 @@ namespace Terraria Main.ambientLavafallX = (float) num9; Main.ambientLavafallY = (float) num10; Main.ambientLavafallStrength = num6; - Main.tileSolid[546] = true; } public void Draw(SpriteBatch spriteBatch) @@ -825,11 +793,9 @@ namespace Terraria this.DrawWaterfall(spriteBatch, 9, Main.liquidAlpha[8]); if ((double) Main.liquidAlpha[9] > 0.0) this.DrawWaterfall(spriteBatch, 10, Main.liquidAlpha[9]); - if ((double) Main.liquidAlpha[10] > 0.0) - this.DrawWaterfall(spriteBatch, 13, Main.liquidAlpha[10]); - if ((double) Main.liquidAlpha[12] <= 0.0) + if ((double) Main.liquidAlpha[10] <= 0.0) return; - this.DrawWaterfall(spriteBatch, 23, Main.liquidAlpha[12]); + this.DrawWaterfall(spriteBatch, 13, Main.liquidAlpha[10]); } public struct WaterfallData diff --git a/WindowsLaunch.cs b/WindowsLaunch.cs index 5600a52..06efa63 100644 --- a/WindowsLaunch.cs +++ b/WindowsLaunch.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.WindowsLaunch -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System; @@ -41,7 +41,7 @@ namespace Terraria } [DllImport("Kernel32")] - public static extern bool SetConsoleCtrlHandler(WindowsLaunch.HandlerRoutine handler, bool add); + public static extern bool SetConsoleCtrlHandler(WindowsLaunch.HandlerRoutine Handler, bool Add); [STAThread] private static void Main(string[] args) @@ -62,7 +62,7 @@ namespace Terraria Program.LaunchGame(args); } - public delegate bool HandlerRoutine(WindowsLaunch.CtrlTypes ctrlType); + public delegate bool HandlerRoutine(WindowsLaunch.CtrlTypes CtrlType); public enum CtrlTypes { diff --git a/Wiring.cs b/Wiring.cs index f8f9c9f..9a0210d 100644 --- a/Wiring.cs +++ b/Wiring.cs @@ -1,13 +1,12 @@ // Decompiled with JetBrains decompiler // Type: Terraria.Wiring -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using System; using System.Collections.Generic; -using Terraria.Audio; using Terraria.DataStructures; using Terraria.GameContent.Events; using Terraria.GameContent.UI; @@ -43,12 +42,12 @@ namespace Terraria private static int _numMechs; private static int[] _mechTime; private static int _currentWireColor; - private static int CurrentUser = (int) byte.MaxValue; + private static int CurrentUser = 254; public static void SetCurrentUser(int plr = -1) { - if (plr < 0 || plr > (int) byte.MaxValue) - plr = (int) byte.MaxValue; + if (plr < 0 || plr >= (int) byte.MaxValue) + plr = 254; if (Main.netMode == 0) plr = Main.myPlayer; Wiring.CurrentUser = plr; @@ -105,12 +104,6 @@ namespace Terraria case 2: num = 300; break; - case 3: - num = 30; - break; - case 4: - num = 15; - break; } if (Math.IEEERemainder((double) Wiring._mechTime[index1], (double) num) == 0.0) { @@ -158,24 +151,22 @@ namespace Terraria { if (!WorldGen.InWorld(i, j) || Main.tile[i, j] == null) return; - if (Main.tile[i, j].type == (ushort) 135 || Main.tile[i, j].type == (ushort) 314 || Main.tile[i, j].type == (ushort) 423 || Main.tile[i, j].type == (ushort) 428 || Main.tile[i, j].type == (ushort) 442 || Main.tile[i, j].type == (ushort) 476) + if (Main.tile[i, j].type == (ushort) 135 || Main.tile[i, j].type == (ushort) 314 || Main.tile[i, j].type == (ushort) 423 || Main.tile[i, j].type == (ushort) 428 || Main.tile[i, j].type == (ushort) 442) { - SoundEngine.PlaySound(28, i * 16, j * 16, 0); + Main.PlaySound(28, i * 16, j * 16, 0); Wiring.TripWire(i, j, 1, 1); } else if (Main.tile[i, j].type == (ushort) 440) { - SoundEngine.PlaySound(28, i * 16 + 16, j * 16 + 16, 0); + Main.PlaySound(28, i * 16 + 16, j * 16 + 16, 0); Wiring.TripWire(i, j, 3, 3); } else if (Main.tile[i, j].type == (ushort) 136) { Main.tile[i, j].frameY = Main.tile[i, j].frameY != (short) 0 ? (short) 0 : (short) 18; - SoundEngine.PlaySound(28, i * 16, j * 16, 0); + Main.PlaySound(28, i * 16, j * 16, 0); Wiring.TripWire(i, j, 1, 1); } - else if (Main.tile[i, j].type == (ushort) 443) - Wiring.GeyserTrap(i, j); else if (Main.tile[i, j].type == (ushort) 144) { if (Main.tile[i, j].frameY == (short) 0) @@ -186,7 +177,7 @@ namespace Terraria } else Main.tile[i, j].frameY = (short) 0; - SoundEngine.PlaySound(28, i * 16, j * 16, 0); + Main.PlaySound(28, i * 16, j * 16, 0); } else if (Main.tile[i, j].type == (ushort) 441 || Main.tile[i, j].type == (ushort) 468) { @@ -197,38 +188,24 @@ namespace Terraria num3 += 2; int left = num3 + i; int top = num2 + j; - SoundEngine.PlaySound(28, i * 16, j * 16, 0); - Wiring.TripWire(left, top, 2, 2); - } - else if (Main.tile[i, j].type == (ushort) 467) - { - if ((int) Main.tile[i, j].frameX / 36 != 4) - return; - int num4 = (int) Main.tile[i, j].frameX / 18 * -1; - int num5 = (int) Main.tile[i, j].frameY / 18 * -1; - int num6 = num4 % 4; - if (num6 < -1) - num6 += 2; - int left = num6 + i; - int top = num5 + j; - SoundEngine.PlaySound(28, i * 16, j * 16, 0); + Main.PlaySound(28, i * 16, j * 16, 0); Wiring.TripWire(left, top, 2, 2); } else { if (Main.tile[i, j].type != (ushort) 132 && Main.tile[i, j].type != (ushort) 411) return; - short num7 = 36; - int num8 = (int) Main.tile[i, j].frameX / 18 * -1; - int num9 = (int) Main.tile[i, j].frameY / 18 * -1; - int num10 = num8 % 4; - if (num10 < -1) + short num4 = 36; + int num5 = (int) Main.tile[i, j].frameX / 18 * -1; + int num6 = (int) Main.tile[i, j].frameY / 18 * -1; + int num7 = num5 % 4; + if (num7 < -1) { - num10 += 2; - num7 = (short) -36; + num7 += 2; + num4 = (short) -36; } - int index1 = num10 + i; - int index2 = num9 + j; + int index1 = num7 + i; + int index2 = num6 + j; if (Main.netMode != 1 && Main.tile[index1, index2].type == (ushort) 411) Wiring.CheckMech(index1, index2, 60); for (int index3 = index1; index3 < index1 + 2; ++index3) @@ -236,11 +213,11 @@ namespace Terraria for (int index4 = index2; index4 < index2 + 2; ++index4) { if (Main.tile[index3, index4].type == (ushort) 132 || Main.tile[index3, index4].type == (ushort) 411) - Main.tile[index3, index4].frameX += num7; + Main.tile[index3, index4].frameX += num4; } } WorldGen.TileFrame(index1, index2); - SoundEngine.PlaySound(28, i * 16, j * 16, 0); + Main.PlaySound(28, i * 16, j * 16, 0); Wiring.TripWire(index1, index2, 2, 2); } } @@ -258,16 +235,22 @@ namespace Terraria Tile tile = Main.tile[i, j]; if (!tile.actuator()) return false; - if (tile.inActive()) - Wiring.ReActive(i, j); - else - Wiring.DeActive(i, j); + if ((tile.type != (ushort) 226 || (double) j <= Main.worldSurface || NPC.downedPlantBoss) && ((double) j <= Main.worldSurface || NPC.downedGolemBoss || Main.tile[i, j - 1].type != (ushort) 237)) + { + if (tile.inActive()) + Wiring.ReActive(i, j); + else + Wiring.DeActive(i, j); + } return true; } public static void ActuateForced(int i, int j) { - if (Main.tile[i, j].inActive()) + Tile tile = Main.tile[i, j]; + if (tile.type == (ushort) 226 && (double) j > Main.worldSurface && !NPC.downedPlantBoss) + return; + if (tile.inActive()) Wiring.ReActive(i, j); else Wiring.DeActive(i, j); @@ -510,7 +493,6 @@ namespace Terraria int num9 = index8 + 1; Vector2 vector2_8 = Wiring._teleport[1]; vector2Array9[index8] = vector2_8; - Wiring.running = false; for (int index9 = 0; index9 < 8; index9 += 2) { Wiring._teleport[0] = vector2Array1[index9]; @@ -818,6 +800,7 @@ namespace Terraria } Wiring._wireSkip.Clear(); Wiring._toProcess.Clear(); + Wiring.running = false; } private static void HitWireSingle(int i, int j) @@ -977,7 +960,7 @@ namespace Terraria double num16 = (double) Main.rand.Next(-35, 11); int Type1 = 166; int Damage1 = 0; - float KnockBack1 = 0.0f; + float KnockBack = 0.0f; Vector2 vector2_1 = new Vector2((float) ((i1 + 2) * 16 - 8), (float) ((j1 + 2) * 16 - 8)); if ((int) tile1.frameX / 54 == 0) { @@ -992,7 +975,7 @@ namespace Terraria float num20 = (float) (num14 / num19); float SpeedX1 = num17 * num20; float SpeedY1 = num18 * num20; - Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX1, SpeedY1, Type1, Damage1, KnockBack1, Wiring.CurrentUser); + Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX1, SpeedY1, Type1, Damage1, KnockBack, Wiring.CurrentUser); break; case 215: int num21 = (int) tile1.frameX % 54 / 18; @@ -1162,6 +1145,13 @@ namespace Terraria } switch (type) { + case 4: + if (tile1.frameX < (short) 66) + tile1.frameX += (short) 66; + else + tile1.frameX -= (short) 66; + NetMessage.SendTileSquare(-1, i, j, 1); + return; case 10: int direction = 1; if (Main.rand.Next(2) == 0) @@ -1180,1092 +1170,935 @@ namespace Terraria return; NetMessage.SendData(19, number: 1, number2: ((float) i), number3: ((float) j)); return; + case 42: + int num40 = (int) tile1.frameY / 18; + while (num40 >= 2) + num40 -= 2; + int y1 = j - num40; + short num41 = 18; + if (tile1.frameX > (short) 0) + num41 = (short) -18; + Main.tile[i, y1].frameX += num41; + Main.tile[i, y1 + 1].frameX += num41; + Wiring.SkipWire(i, y1); + Wiring.SkipWire(i, y1 + 1); + NetMessage.SendTileSquare(-1, i, j, 2); + return; + case 93: + int num42 = (int) tile1.frameY / 18; + while (num42 >= 3) + num42 -= 3; + int y2 = j - num42; + short num43 = 18; + if (tile1.frameX > (short) 0) + num43 = (short) -18; + Main.tile[i, y2].frameX += num43; + Main.tile[i, y2 + 1].frameX += num43; + Main.tile[i, y2 + 2].frameX += num43; + Wiring.SkipWire(i, y2); + Wiring.SkipWire(i, y2 + 1); + Wiring.SkipWire(i, y2 + 2); + NetMessage.SendTileSquare(-1, i, y2 + 1, 3); + return; + case 149: + if (tile1.frameX < (short) 54) + tile1.frameX += (short) 54; + else + tile1.frameX -= (short) 54; + NetMessage.SendTileSquare(-1, i, j, 1); + return; case 216: WorldGen.LaunchRocket(i, j); Wiring.SkipWire(i, j); return; - default: - if (type == 497 || type == 15 && (int) tile1.frameY / 40 == 1 || type == 15 && (int) tile1.frameY / 40 == 20) + case 235: + int num44 = i - (int) tile1.frameX / 18; + if (tile1.wall == (byte) 87 && (double) j > Main.worldSurface && !NPC.downedPlantBoss) + return; + if ((double) Wiring._teleport[0].X == -1.0) { - int num40 = j - (int) tile1.frameY % 40 / 18; - int num41 = i; - Wiring.SkipWire(num41, num40); - Wiring.SkipWire(num41, num40 + 1); - if (!Wiring.CheckMech(num41, num40, 60)) + Wiring._teleport[0].X = (float) num44; + Wiring._teleport[0].Y = (float) j; + if (!tile1.halfBrick()) return; - Projectile.NewProjectile((float) (num41 * 16 + 8), (float) (num40 * 16 + 12), 0.0f, 0.0f, 733, 0, 0.0f, Main.myPlayer); + Wiring._teleport[0].Y += 0.5f; + return; + } + if ((double) Wiring._teleport[0].X == (double) num44 && (double) Wiring._teleport[0].Y == (double) j) + return; + Wiring._teleport[1].X = (float) num44; + Wiring._teleport[1].Y = (float) j; + if (!tile1.halfBrick()) + return; + Wiring._teleport[1].Y += 0.5f; + return; + case 244: + int num45 = (int) tile1.frameX / 18; + while (num45 >= 3) + num45 -= 3; + int num46 = (int) tile1.frameY / 18; + while (num46 >= 3) + num46 -= 3; + int index10 = i - num45; + int index11 = j - num46; + int num47 = 54; + if (Main.tile[index10, index11].frameX >= (short) 54) + num47 = -54; + for (int x = index10; x < index10 + 3; ++x) + { + for (int y3 = index11; y3 < index11 + 2; ++y3) + { + Wiring.SkipWire(x, y3); + Main.tile[x, y3].frameX += (short) num47; + } + } + NetMessage.SendTileSquare(-1, index10 + 1, index11 + 1, 3); + return; + case 335: + int num48 = j - (int) tile1.frameY / 18; + int num49 = i - (int) tile1.frameX / 18; + Wiring.SkipWire(num49, num48); + Wiring.SkipWire(num49, num48 + 1); + Wiring.SkipWire(num49 + 1, num48); + Wiring.SkipWire(num49 + 1, num48 + 1); + if (!Wiring.CheckMech(num49, num48, 30)) + return; + WorldGen.LaunchRocketSmall(num49, num48); + return; + case 338: + int num50 = j - (int) tile1.frameY / 18; + int num51 = i - (int) tile1.frameX / 18; + Wiring.SkipWire(num51, num50); + Wiring.SkipWire(num51, num50 + 1); + if (!Wiring.CheckMech(num51, num50, 30)) + return; + bool flag5 = false; + for (int index12 = 0; index12 < 1000; ++index12) + { + if (Main.projectile[index12].active && Main.projectile[index12].aiStyle == 73 && (double) Main.projectile[index12].ai[0] == (double) num51 && (double) Main.projectile[index12].ai[1] == (double) num50) + { + flag5 = true; + break; + } + } + if (flag5) + return; + Projectile.NewProjectile((float) (num51 * 16 + 8), (float) (num50 * 16 + 2), 0.0f, 0.0f, 419 + Main.rand.Next(4), 0, 0.0f, Main.myPlayer, (float) num51, (float) num50); + return; + case 429: + int num52 = (int) Main.tile[i, j].frameX / 18; + bool flag6 = num52 % 2 >= 1; + bool flag7 = num52 % 4 >= 2; + bool flag8 = num52 % 8 >= 4; + bool flag9 = num52 % 16 >= 8; + bool flag10 = false; + short num53 = 0; + switch (Wiring._currentWireColor) + { + case 1: + num53 = (short) 18; + flag10 = !flag6; + break; + case 2: + num53 = (short) 72; + flag10 = !flag8; + break; + case 3: + num53 = (short) 36; + flag10 = !flag7; + break; + case 4: + num53 = (short) 144; + flag10 = !flag9; + break; + } + if (flag10) + tile1.frameX += num53; + else + tile1.frameX -= num53; + NetMessage.SendTileSquare(-1, i, j, 1); + return; + default: + if (type == 126 || type == 95 || type == 100 || type == 173) + { + int num54 = (int) tile1.frameY / 18; + while (num54 >= 2) + num54 -= 2; + int index13 = j - num54; + int num55 = (int) tile1.frameX / 18; + if (num55 > 1) + num55 -= 2; + int index14 = i - num55; + short num56 = 36; + if (Main.tile[index14, index13].frameX > (short) 0) + num56 = (short) -36; + Main.tile[index14, index13].frameX += num56; + Main.tile[index14, index13 + 1].frameX += num56; + Main.tile[index14 + 1, index13].frameX += num56; + Main.tile[index14 + 1, index13 + 1].frameX += num56; + Wiring.SkipWire(index14, index13); + Wiring.SkipWire(index14 + 1, index13); + Wiring.SkipWire(index14, index13 + 1); + Wiring.SkipWire(index14 + 1, index13 + 1); + NetMessage.SendTileSquare(-1, index14, index13, 3); return; } switch (type) { - case 4: - if (tile1.frameX < (short) 66) - tile1.frameX += (short) 66; - else - tile1.frameX -= (short) 66; - NetMessage.SendTileSquare(-1, i, j, 1); - return; - case 42: - int num42 = (int) tile1.frameY / 18; - while (num42 >= 2) - num42 -= 2; - int y1 = j - num42; - short num43 = 18; - if (tile1.frameX > (short) 0) - num43 = (short) -18; - Main.tile[i, y1].frameX += num43; - Main.tile[i, y1 + 1].frameX += num43; - Wiring.SkipWire(i, y1); - Wiring.SkipWire(i, y1 + 1); - NetMessage.SendTileSquare(-1, i, j, 3); - return; - case 93: - int num44 = (int) tile1.frameY / 18; - while (num44 >= 3) - num44 -= 3; - int y2 = j - num44; - short num45 = 18; - if (tile1.frameX > (short) 0) - num45 = (short) -18; - Main.tile[i, y2].frameX += num45; - Main.tile[i, y2 + 1].frameX += num45; - Main.tile[i, y2 + 2].frameX += num45; - Wiring.SkipWire(i, y2); - Wiring.SkipWire(i, y2 + 1); - Wiring.SkipWire(i, y2 + 2); - NetMessage.SendTileSquare(-1, i, y2 + 1, 3); - return; - case 149: - if (tile1.frameX < (short) 54) - tile1.frameX += (short) 54; - else - tile1.frameX -= (short) 54; - NetMessage.SendTileSquare(-1, i, j, 1); - return; - case 235: - int num46 = i - (int) tile1.frameX / 18; - if (tile1.wall == (ushort) 87 && (double) j > Main.worldSurface && !NPC.downedPlantBoss) - return; - if ((double) Wiring._teleport[0].X == -1.0) - { - Wiring._teleport[0].X = (float) num46; - Wiring._teleport[0].Y = (float) j; - if (!tile1.halfBrick()) - return; - Wiring._teleport[0].Y += 0.5f; - return; - } - if ((double) Wiring._teleport[0].X == (double) num46 && (double) Wiring._teleport[0].Y == (double) j) - return; - Wiring._teleport[1].X = (float) num46; - Wiring._teleport[1].Y = (float) j; - if (!tile1.halfBrick()) - return; - Wiring._teleport[1].Y += 0.5f; - return; - case 244: - int num47 = (int) tile1.frameX / 18; - while (num47 >= 3) - num47 -= 3; - int num48 = (int) tile1.frameY / 18; - while (num48 >= 3) - num48 -= 3; - int index10 = i - num47; - int index11 = j - num48; - int num49 = 54; - if (Main.tile[index10, index11].frameX >= (short) 54) - num49 = -54; - for (int x = index10; x < index10 + 3; ++x) - { - for (int y3 = index11; y3 < index11 + 2; ++y3) - { - Wiring.SkipWire(x, y3); - Main.tile[x, y3].frameX += (short) num49; - } - } - NetMessage.SendTileSquare(-1, index10 + 1, index11 + 1, 3); - return; - case 335: - int num50 = j - (int) tile1.frameY / 18; - int num51 = i - (int) tile1.frameX / 18; - Wiring.SkipWire(num51, num50); - Wiring.SkipWire(num51, num50 + 1); - Wiring.SkipWire(num51 + 1, num50); - Wiring.SkipWire(num51 + 1, num50 + 1); - if (!Wiring.CheckMech(num51, num50, 30)) - return; - WorldGen.LaunchRocketSmall(num51, num50); - return; - case 338: - int num52 = j - (int) tile1.frameY / 18; - int num53 = i - (int) tile1.frameX / 18; - Wiring.SkipWire(num53, num52); - Wiring.SkipWire(num53, num52 + 1); - if (!Wiring.CheckMech(num53, num52, 30)) - return; - bool flag5 = false; - for (int index12 = 0; index12 < 1000; ++index12) - { - if (Main.projectile[index12].active && Main.projectile[index12].aiStyle == 73 && (double) Main.projectile[index12].ai[0] == (double) num53 && (double) Main.projectile[index12].ai[1] == (double) num52) - { - flag5 = true; - break; - } - } - if (flag5) - return; - Projectile.NewProjectile((float) (num53 * 16 + 8), (float) (num52 * 16 + 2), 0.0f, 0.0f, 419 + Main.rand.Next(4), 0, 0.0f, Main.myPlayer, (float) num53, (float) num52); - return; - case 429: - int num54 = (int) Main.tile[i, j].frameX / 18; - bool flag6 = num54 % 2 >= 1; - bool flag7 = num54 % 4 >= 2; - bool flag8 = num54 % 8 >= 4; - bool flag9 = num54 % 16 >= 8; - bool flag10 = false; - short num55 = 0; - switch (Wiring._currentWireColor) - { - case 1: - num55 = (short) 18; - flag10 = !flag6; - break; - case 2: - num55 = (short) 72; - flag10 = !flag8; - break; - case 3: - num55 = (short) 36; - flag10 = !flag7; - break; - case 4: - num55 = (short) 144; - flag10 = !flag9; - break; - } - if (flag10) - tile1.frameX += num55; - else - tile1.frameX -= num55; - NetMessage.SendTileSquare(-1, i, j, 1); - return; - case 565: - int num56 = (int) tile1.frameX / 18; - while (num56 >= 2) - num56 -= 2; + case 34: int num57 = (int) tile1.frameY / 18; - while (num57 >= 2) - num57 -= 2; - int index13 = i - num56; - int index14 = j - num57; - int num58 = 36; - if (Main.tile[index13, index14].frameX >= (short) 36) - num58 = -36; - for (int x = index13; x < index13 + 2; ++x) + while (num57 >= 3) + num57 -= 3; + int index15 = j - num57; + int num58 = (int) tile1.frameX % 108 / 18; + if (num58 > 2) + num58 -= 3; + int index16 = i - num58; + short num59 = 54; + if ((int) Main.tile[index16, index15].frameX % 108 > 0) + num59 = (short) -54; + for (int x = index16; x < index16 + 3; ++x) { - for (int y4 = index14; y4 < index14 + 2; ++y4) + for (int y4 = index15; y4 < index15 + 3; ++y4) { + Main.tile[x, y4].frameX += num59; Wiring.SkipWire(x, y4); - Main.tile[x, y4].frameX += (short) num58; } } - NetMessage.SendTileSquare(-1, index13 + 1, index14 + 1, 3); + NetMessage.SendTileSquare(-1, index16 + 1, index15 + 1, 3); + return; + case 314: + if (!Wiring.CheckMech(i, j, 5)) + return; + Minecart.FlipSwitchTrack(i, j); return; default: - if (type == 126 || type == 95 || type == 100 || type == 173 || type == 564) + if (type == 33 || type == 174) { - int num59 = (int) tile1.frameY / 18; - while (num59 >= 2) - num59 -= 2; - int index15 = j - num59; - int num60 = (int) tile1.frameX / 18; - if (num60 > 1) - num60 -= 2; - int index16 = i - num60; - short num61 = 36; - if (Main.tile[index16, index15].frameX > (short) 0) - num61 = (short) -36; - Main.tile[index16, index15].frameX += num61; - Main.tile[index16, index15 + 1].frameX += num61; - Main.tile[index16 + 1, index15].frameX += num61; - Main.tile[index16 + 1, index15 + 1].frameX += num61; - Wiring.SkipWire(index16, index15); - Wiring.SkipWire(index16 + 1, index15); - Wiring.SkipWire(index16, index15 + 1); - Wiring.SkipWire(index16 + 1, index15 + 1); - NetMessage.SendTileSquare(-1, index16, index15, 3); + short num60 = 18; + if (tile1.frameX > (short) 0) + num60 = (short) -18; + tile1.frameX += num60; + NetMessage.SendTileSquare(-1, i, j, 3); return; } switch (type) { - case 34: - int num62 = (int) tile1.frameY / 18; - while (num62 >= 3) - num62 -= 3; - int index17 = j - num62; - int num63 = (int) tile1.frameX % 108 / 18; - if (num63 > 2) - num63 -= 3; - int index18 = i - num63; - short num64 = 54; - if ((int) Main.tile[index18, index17].frameX % 108 > 0) - num64 = (short) -54; - for (int x = index18; x < index18 + 3; ++x) + case 92: + int num61 = j - (int) tile1.frameY / 18; + short num62 = 18; + if (tile1.frameX > (short) 0) + num62 = (short) -18; + for (int y5 = num61; y5 < num61 + 6; ++y5) { - for (int y5 = index17; y5 < index17 + 3; ++y5) - { - Main.tile[x, y5].frameX += num64; - Wiring.SkipWire(x, y5); - } + Main.tile[i, y5].frameX += num62; + Wiring.SkipWire(i, y5); } - NetMessage.SendTileSquare(-1, index18 + 1, index17 + 1, 3); + NetMessage.SendTileSquare(-1, i, num61 + 3, 7); return; - case 314: - if (!Wiring.CheckMech(i, j, 5)) + case 137: + int num63 = (int) tile1.frameY / 18; + Vector2 vector2_2 = Vector2.Zero; + float SpeedX2 = 0.0f; + float SpeedY2 = 0.0f; + int Type2 = 0; + int Damage2 = 0; + switch (num63) + { + case 0: + case 1: + case 2: + if (Wiring.CheckMech(i, j, 200)) + { + int num64 = tile1.frameX == (short) 0 ? -1 : (tile1.frameX == (short) 18 ? 1 : 0); + int num65 = tile1.frameX < (short) 36 ? 0 : (tile1.frameX < (short) 72 ? -1 : 1); + vector2_2 = new Vector2((float) (i * 16 + 8 + 10 * num64), (float) (j * 16 + 9 + num65 * 9)); + float num66 = 3f; + if (num63 == 0) + { + Type2 = 98; + Damage2 = 20; + num66 = 12f; + } + if (num63 == 1) + { + Type2 = 184; + Damage2 = 40; + num66 = 12f; + } + if (num63 == 2) + { + Type2 = 187; + Damage2 = 40; + num66 = 5f; + } + SpeedX2 = (float) num64 * num66; + SpeedY2 = (float) num65 * num66; + break; + } + break; + case 3: + if (Wiring.CheckMech(i, j, 300)) + { + int num67 = 200; + for (int index17 = 0; index17 < 1000; ++index17) + { + if (Main.projectile[index17].active && Main.projectile[index17].type == Type2) + { + float num68 = (new Vector2((float) (i * 16 + 8), (float) (j * 18 + 8)) - Main.projectile[index17].Center).Length(); + if ((double) num68 < 50.0) + num67 -= 50; + else if ((double) num68 < 100.0) + num67 -= 15; + else if ((double) num68 < 200.0) + num67 -= 10; + else if ((double) num68 < 300.0) + num67 -= 8; + else if ((double) num68 < 400.0) + num67 -= 6; + else if ((double) num68 < 500.0) + num67 -= 5; + else if ((double) num68 < 700.0) + num67 -= 4; + else if ((double) num68 < 900.0) + num67 -= 3; + else if ((double) num68 < 1200.0) + num67 -= 2; + else + --num67; + } + } + if (num67 > 0) + { + Type2 = 185; + Damage2 = 40; + int num69 = 0; + int num70 = 0; + switch ((int) tile1.frameX / 18) + { + case 0: + case 1: + num69 = 0; + num70 = 1; + break; + case 2: + num69 = 0; + num70 = -1; + break; + case 3: + num69 = -1; + num70 = 0; + break; + case 4: + num69 = 1; + num70 = 0; + break; + } + SpeedX2 = (float) (4 * num69) + (float) Main.rand.Next((num69 == 1 ? 20 : 0) - 20, 21 - (num69 == -1 ? 20 : 0)) * 0.05f; + SpeedY2 = (float) (4 * num70) + (float) Main.rand.Next((num70 == 1 ? 20 : 0) - 20, 21 - (num70 == -1 ? 20 : 0)) * 0.05f; + vector2_2 = new Vector2((float) (i * 16 + 8 + 14 * num69), (float) (j * 16 + 8 + 14 * num70)); + break; + } + break; + } + break; + case 4: + if (Wiring.CheckMech(i, j, 90)) + { + int num71 = 0; + int num72 = 0; + switch ((int) tile1.frameX / 18) + { + case 0: + case 1: + num71 = 0; + num72 = 1; + break; + case 2: + num71 = 0; + num72 = -1; + break; + case 3: + num71 = -1; + num72 = 0; + break; + case 4: + num71 = 1; + num72 = 0; + break; + } + SpeedX2 = (float) (8 * num71); + SpeedY2 = (float) (8 * num72); + Damage2 = 60; + Type2 = 186; + vector2_2 = new Vector2((float) (i * 16 + 8 + 18 * num71), (float) (j * 16 + 8 + 18 * num72)); + break; + } + break; + } + switch (num63 + 10) + { + case 0: + if (Wiring.CheckMech(i, j, 200)) + { + int num73 = -1; + if (tile1.frameX != (short) 0) + num73 = 1; + SpeedX2 = (float) (12 * num73); + Damage2 = 20; + Type2 = 98; + vector2_2 = new Vector2((float) (i * 16 + 8), (float) (j * 16 + 7)); + vector2_2.X += (float) (10 * num73); + vector2_2.Y += 2f; + break; + } + break; + case 1: + if (Wiring.CheckMech(i, j, 200)) + { + int num74 = -1; + if (tile1.frameX != (short) 0) + num74 = 1; + SpeedX2 = (float) (12 * num74); + Damage2 = 40; + Type2 = 184; + vector2_2 = new Vector2((float) (i * 16 + 8), (float) (j * 16 + 7)); + vector2_2.X += (float) (10 * num74); + vector2_2.Y += 2f; + break; + } + break; + case 2: + if (Wiring.CheckMech(i, j, 200)) + { + int num75 = -1; + if (tile1.frameX != (short) 0) + num75 = 1; + SpeedX2 = (float) (5 * num75); + Damage2 = 40; + Type2 = 187; + vector2_2 = new Vector2((float) (i * 16 + 8), (float) (j * 16 + 7)); + vector2_2.X += (float) (10 * num75); + vector2_2.Y += 2f; + break; + } + break; + case 3: + if (Wiring.CheckMech(i, j, 300)) + { + Type2 = 185; + int num76 = 200; + for (int index18 = 0; index18 < 1000; ++index18) + { + if (Main.projectile[index18].active && Main.projectile[index18].type == Type2) + { + float num77 = (new Vector2((float) (i * 16 + 8), (float) (j * 18 + 8)) - Main.projectile[index18].Center).Length(); + if ((double) num77 < 50.0) + num76 -= 50; + else if ((double) num77 < 100.0) + num76 -= 15; + else if ((double) num77 < 200.0) + num76 -= 10; + else if ((double) num77 < 300.0) + num76 -= 8; + else if ((double) num77 < 400.0) + num76 -= 6; + else if ((double) num77 < 500.0) + num76 -= 5; + else if ((double) num77 < 700.0) + num76 -= 4; + else if ((double) num77 < 900.0) + num76 -= 3; + else if ((double) num77 < 1200.0) + num76 -= 2; + else + --num76; + } + } + if (num76 > 0) + { + SpeedX2 = (float) Main.rand.Next(-20, 21) * 0.05f; + SpeedY2 = (float) (4.0 + (double) Main.rand.Next(0, 21) * 0.0500000007450581); + Damage2 = 40; + vector2_2 = new Vector2((float) (i * 16 + 8), (float) (j * 16 + 16)); + vector2_2.Y += 6f; + Projectile.NewProjectile((float) (int) vector2_2.X, (float) (int) vector2_2.Y, SpeedX2, SpeedY2, Type2, Damage2, 2f, Main.myPlayer); + break; + } + break; + } + break; + case 4: + if (Wiring.CheckMech(i, j, 90)) + { + SpeedX2 = 0.0f; + SpeedY2 = 8f; + Damage2 = 60; + Type2 = 186; + vector2_2 = new Vector2((float) (i * 16 + 8), (float) (j * 16 + 16)); + vector2_2.Y += 10f; + break; + } + break; + } + if (Type2 == 0) return; - Minecart.FlipSwitchTrack(i, j); + Projectile.NewProjectile((float) (int) vector2_2.X, (float) (int) vector2_2.Y, SpeedX2, SpeedY2, Type2, Damage2, 2f, Main.myPlayer); return; - case 593: - int index19 = i; - int index20 = j; - Wiring.SkipWire(index19, index20); - short num65 = Main.tile[index19, index20].frameX != (short) 0 ? (short) -18 : (short) 18; - Main.tile[index19, index20].frameX += num65; - if (Main.netMode == 2) - NetMessage.SendTileRange(-1, index19, index20, 1, 1); - int num66 = num65 > (short) 0 ? 4 : 3; - Animation.NewTemporaryAnimation(num66, (ushort) 593, index19, index20); - NetMessage.SendTemporaryAnimation(-1, num66, 593, index19, index20); - return; - case 594: - int num67 = (int) tile1.frameY / 18; - while (num67 >= 2) - num67 -= 2; - int index21 = j - num67; - int num68 = (int) tile1.frameX / 18; - if (num68 > 1) - num68 -= 2; - int index22 = i - num68; - Wiring.SkipWire(index22, index21); - Wiring.SkipWire(index22, index21 + 1); - Wiring.SkipWire(index22 + 1, index21); - Wiring.SkipWire(index22 + 1, index21 + 1); - short num69 = Main.tile[index22, index21].frameX != (short) 0 ? (short) -36 : (short) 36; - for (int index23 = 0; index23 < 2; ++index23) + case 443: + int num78 = (int) tile1.frameX / 36; + int i3 = i - ((int) tile1.frameX - num78 * 36) / 18; + int j3 = j; + if (!Wiring.CheckMech(i3, j3, 200)) + return; + Vector2 zero = Vector2.Zero; + Vector2 vector2_3 = Vector2.Zero; + int Type3 = 654; + int Damage3 = 20; + Vector2 vector2_4; + if (num78 < 2) { - for (int index24 = 0; index24 < 2; ++index24) - Main.tile[index22 + index23, index21 + index24].frameX += num69; + vector2_4 = new Vector2((float) (i3 + 1), (float) j3) * 16f; + vector2_3 = new Vector2(0.0f, -8f); } - if (Main.netMode == 2) - NetMessage.SendTileRange(-1, index22, index21, 2, 2); - int num70 = num69 > (short) 0 ? 4 : 3; - Animation.NewTemporaryAnimation(num70, (ushort) 594, index22, index21); - NetMessage.SendTemporaryAnimation(-1, num70, 594, index22, index21); + else + { + vector2_4 = new Vector2((float) (i3 + 1), (float) (j3 + 1)) * 16f; + vector2_3 = new Vector2(0.0f, 8f); + } + if (Type3 == 0) + return; + Projectile.NewProjectile((float) (int) vector2_4.X, (float) (int) vector2_4.Y, vector2_3.X, vector2_3.Y, Type3, Damage3, 2f, Main.myPlayer); return; default: - if (type == 33 || type == 174 || type == 49 || type == 372) + if (type == 139 || type == 35) { - short num71 = 18; - if (tile1.frameX > (short) 0) - num71 = (short) -18; - tile1.frameX += num71; - NetMessage.SendTileSquare(-1, i, j, 3); + WorldGen.SwitchMB(i, j); return; } switch (type) { - case 92: - int num72 = j - (int) tile1.frameY / 18; - short num73 = 18; - if (tile1.frameX > (short) 0) - num73 = (short) -18; - for (int y6 = num72; y6 < num72 + 6; ++y6) - { - Main.tile[i, y6].frameX += num73; - Wiring.SkipWire(i, y6); - } - NetMessage.SendTileSquare(-1, i, num72 + 3, 7); + case 141: + WorldGen.KillTile(i, j, noItem: true); + NetMessage.SendTileSquare(-1, i, j, 1); + Projectile.NewProjectile((float) (i * 16 + 8), (float) (j * 16 + 8), 0.0f, 0.0f, 108, 500, 10f, Main.myPlayer); return; - case 137: - int num74 = (int) tile1.frameY / 18; - Vector2 vector2_2 = Vector2.Zero; - float SpeedX2 = 0.0f; - float SpeedY2 = 0.0f; - int Type2 = 0; - int Damage2 = 0; - switch (num74) - { - case 0: - case 1: - case 2: - if (Wiring.CheckMech(i, j, 200)) - { - int num75 = tile1.frameX == (short) 0 ? -1 : (tile1.frameX == (short) 18 ? 1 : 0); - int num76 = tile1.frameX < (short) 36 ? 0 : (tile1.frameX < (short) 72 ? -1 : 1); - vector2_2 = new Vector2((float) (i * 16 + 8 + 10 * num75), (float) (j * 16 + 8 + 10 * num76)); - float num77 = 3f; - if (num74 == 0) - { - Type2 = 98; - Damage2 = 20; - num77 = 12f; - } - if (num74 == 1) - { - Type2 = 184; - Damage2 = 40; - num77 = 12f; - } - if (num74 == 2) - { - Type2 = 187; - Damage2 = 40; - num77 = 5f; - } - SpeedX2 = (float) num75 * num77; - SpeedY2 = (float) num76 * num77; - break; - } - break; - case 3: - if (Wiring.CheckMech(i, j, 300)) - { - int num78 = 200; - for (int index25 = 0; index25 < 1000; ++index25) - { - if (Main.projectile[index25].active && Main.projectile[index25].type == Type2) - { - float num79 = (new Vector2((float) (i * 16 + 8), (float) (j * 18 + 8)) - Main.projectile[index25].Center).Length(); - if ((double) num79 < 50.0) - num78 -= 50; - else if ((double) num79 < 100.0) - num78 -= 15; - else if ((double) num79 < 200.0) - num78 -= 10; - else if ((double) num79 < 300.0) - num78 -= 8; - else if ((double) num79 < 400.0) - num78 -= 6; - else if ((double) num79 < 500.0) - num78 -= 5; - else if ((double) num79 < 700.0) - num78 -= 4; - else if ((double) num79 < 900.0) - num78 -= 3; - else if ((double) num79 < 1200.0) - num78 -= 2; - else - --num78; - } - } - if (num78 > 0) - { - Type2 = 185; - Damage2 = 40; - int num80 = 0; - int num81 = 0; - switch ((int) tile1.frameX / 18) - { - case 0: - case 1: - num80 = 0; - num81 = 1; - break; - case 2: - num80 = 0; - num81 = -1; - break; - case 3: - num80 = -1; - num81 = 0; - break; - case 4: - num80 = 1; - num81 = 0; - break; - } - SpeedX2 = (float) (4 * num80) + (float) Main.rand.Next((num80 == 1 ? 20 : 0) - 20, 21 - (num80 == -1 ? 20 : 0)) * 0.05f; - SpeedY2 = (float) (4 * num81) + (float) Main.rand.Next((num81 == 1 ? 20 : 0) - 20, 21 - (num81 == -1 ? 20 : 0)) * 0.05f; - vector2_2 = new Vector2((float) (i * 16 + 8 + 14 * num80), (float) (j * 16 + 8 + 14 * num81)); - break; - } - break; - } - break; - case 4: - if (Wiring.CheckMech(i, j, 90)) - { - int num82 = 0; - int num83 = 0; - switch ((int) tile1.frameX / 18) - { - case 0: - case 1: - num82 = 0; - num83 = 1; - break; - case 2: - num82 = 0; - num83 = -1; - break; - case 3: - num82 = -1; - num83 = 0; - break; - case 4: - num82 = 1; - num83 = 0; - break; - } - SpeedX2 = (float) (8 * num82); - SpeedY2 = (float) (8 * num83); - Damage2 = 60; - Type2 = 186; - vector2_2 = new Vector2((float) (i * 16 + 8 + 18 * num82), (float) (j * 16 + 8 + 18 * num83)); - break; - } - break; - } - switch (num74 + 10) - { - case 0: - if (Wiring.CheckMech(i, j, 200)) - { - int num84 = -1; - if (tile1.frameX != (short) 0) - num84 = 1; - SpeedX2 = (float) (12 * num84); - Damage2 = 20; - Type2 = 98; - vector2_2 = new Vector2((float) (i * 16 + 8), (float) (j * 16 + 7)); - vector2_2.X += (float) (10 * num84); - vector2_2.Y += 2f; - break; - } - break; - case 1: - if (Wiring.CheckMech(i, j, 200)) - { - int num85 = -1; - if (tile1.frameX != (short) 0) - num85 = 1; - SpeedX2 = (float) (12 * num85); - Damage2 = 40; - Type2 = 184; - vector2_2 = new Vector2((float) (i * 16 + 8), (float) (j * 16 + 7)); - vector2_2.X += (float) (10 * num85); - vector2_2.Y += 2f; - break; - } - break; - case 2: - if (Wiring.CheckMech(i, j, 200)) - { - int num86 = -1; - if (tile1.frameX != (short) 0) - num86 = 1; - SpeedX2 = (float) (5 * num86); - Damage2 = 40; - Type2 = 187; - vector2_2 = new Vector2((float) (i * 16 + 8), (float) (j * 16 + 7)); - vector2_2.X += (float) (10 * num86); - vector2_2.Y += 2f; - break; - } - break; - case 3: - if (Wiring.CheckMech(i, j, 300)) - { - Type2 = 185; - int num87 = 200; - for (int index26 = 0; index26 < 1000; ++index26) - { - if (Main.projectile[index26].active && Main.projectile[index26].type == Type2) - { - float num88 = (new Vector2((float) (i * 16 + 8), (float) (j * 18 + 8)) - Main.projectile[index26].Center).Length(); - if ((double) num88 < 50.0) - num87 -= 50; - else if ((double) num88 < 100.0) - num87 -= 15; - else if ((double) num88 < 200.0) - num87 -= 10; - else if ((double) num88 < 300.0) - num87 -= 8; - else if ((double) num88 < 400.0) - num87 -= 6; - else if ((double) num88 < 500.0) - num87 -= 5; - else if ((double) num88 < 700.0) - num87 -= 4; - else if ((double) num88 < 900.0) - num87 -= 3; - else if ((double) num88 < 1200.0) - num87 -= 2; - else - --num87; - } - } - if (num87 > 0) - { - SpeedX2 = (float) Main.rand.Next(-20, 21) * 0.05f; - SpeedY2 = (float) (4.0 + (double) Main.rand.Next(0, 21) * 0.0500000007450581); - Damage2 = 40; - vector2_2 = new Vector2((float) (i * 16 + 8), (float) (j * 16 + 16)); - vector2_2.Y += 6f; - Projectile.NewProjectile((float) (int) vector2_2.X, (float) (int) vector2_2.Y, SpeedX2, SpeedY2, Type2, Damage2, 2f, Main.myPlayer); - break; - } - break; - } - break; - case 4: - if (Wiring.CheckMech(i, j, 90)) - { - SpeedX2 = 0.0f; - SpeedY2 = 8f; - Damage2 = 60; - Type2 = 186; - vector2_2 = new Vector2((float) (i * 16 + 8), (float) (j * 16 + 16)); - vector2_2.Y += 10f; - break; - } - break; - } - if (Type2 == 0) - return; - Projectile.NewProjectile((float) (int) vector2_2.X, (float) (int) vector2_2.Y, SpeedX2, SpeedY2, Type2, Damage2, 2f, Main.myPlayer); + case 207: + WorldGen.SwitchFountain(i, j); return; - case 443: - Wiring.GeyserTrap(i, j); + case 210: + WorldGen.ExplodeMine(i, j); return; - case 531: - int num89 = (int) tile1.frameX / 36; - int num90 = (int) tile1.frameY / 54; - int i3 = i - ((int) tile1.frameX - num89 * 36) / 18; - int j3 = j - ((int) tile1.frameY - num90 * 54) / 18; - if (!Wiring.CheckMech(i3, j3, 900)) - return; - Vector2 vector2_3 = new Vector2((float) (i3 + 1), (float) j3) * 16f; - vector2_3.Y += 28f; - int Type3 = 99; - int Damage3 = 70; - float KnockBack2 = 10f; - if (Type3 == 0) - return; - Projectile.NewProjectile((float) (int) vector2_3.X, (float) (int) vector2_3.Y, 0.0f, 0.0f, Type3, Damage3, KnockBack2, Main.myPlayer); + case 410: + WorldGen.SwitchMonolith(i, j); + return; + case 455: + BirthdayParty.ToggleManualParty(); return; default: - if (type == 139 || type == 35) + if (type == 142 || type == 143) { - WorldGen.SwitchMB(i, j); - return; - } - if (type == 207) - { - WorldGen.SwitchFountain(i, j); - return; - } - if (type == 410 || type == 480 || type == 509) - { - WorldGen.SwitchMonolith(i, j); + int y6 = j - (int) tile1.frameY / 18; + int num79 = (int) tile1.frameX / 18; + if (num79 > 1) + num79 -= 2; + int x = i - num79; + Wiring.SkipWire(x, y6); + Wiring.SkipWire(x, y6 + 1); + Wiring.SkipWire(x + 1, y6); + Wiring.SkipWire(x + 1, y6 + 1); + if (type == 142) + { + for (int index19 = 0; index19 < 4 && Wiring._numInPump < 19; ++index19) + { + int num80; + int num81; + switch (index19) + { + case 0: + num80 = x; + num81 = y6 + 1; + break; + case 1: + num80 = x + 1; + num81 = y6 + 1; + break; + case 2: + num80 = x; + num81 = y6; + break; + default: + num80 = x + 1; + num81 = y6; + break; + } + Wiring._inPumpX[Wiring._numInPump] = num80; + Wiring._inPumpY[Wiring._numInPump] = num81; + ++Wiring._numInPump; + } + return; + } + for (int index20 = 0; index20 < 4 && Wiring._numOutPump < 19; ++index20) + { + int num82; + int num83; + switch (index20) + { + case 0: + num82 = x; + num83 = y6 + 1; + break; + case 1: + num82 = x + 1; + num83 = y6 + 1; + break; + case 2: + num82 = x; + num83 = y6; + break; + default: + num82 = x + 1; + num83 = y6; + break; + } + Wiring._outPumpX[Wiring._numOutPump] = num82; + Wiring._outPumpY[Wiring._numOutPump] = num83; + ++Wiring._numOutPump; + } return; } switch (type) { - case 141: - WorldGen.KillTile(i, j, noItem: true); - NetMessage.SendTileSquare(-1, i, j, 1); - Projectile.NewProjectile((float) (i * 16 + 8), (float) (j * 16 + 8), 0.0f, 0.0f, 108, 500, 10f, Main.myPlayer); - return; - case 210: - WorldGen.ExplodeMine(i, j); - return; - case 455: - BirthdayParty.ToggleManualParty(); - return; - default: - if (type == 142 || type == 143) + case 105: + int num84 = j - (int) tile1.frameY / 18; + int num85 = (int) tile1.frameX / 18; + int num86 = 0; + while (num85 >= 2) { - int y7 = j - (int) tile1.frameY / 18; - int num91 = (int) tile1.frameX / 18; - if (num91 > 1) - num91 -= 2; - int x = i - num91; - Wiring.SkipWire(x, y7); - Wiring.SkipWire(x, y7 + 1); - Wiring.SkipWire(x + 1, y7); - Wiring.SkipWire(x + 1, y7 + 1); - if (type == 142) - { - for (int index27 = 0; index27 < 4 && Wiring._numInPump < 19; ++index27) - { - int num92; - int num93; - switch (index27) - { - case 0: - num92 = x; - num93 = y7 + 1; - break; - case 1: - num92 = x + 1; - num93 = y7 + 1; - break; - case 2: - num92 = x; - num93 = y7; - break; - default: - num92 = x + 1; - num93 = y7; - break; - } - Wiring._inPumpX[Wiring._numInPump] = num92; - Wiring._inPumpY[Wiring._numInPump] = num93; - ++Wiring._numInPump; - } - return; - } - for (int index28 = 0; index28 < 4 && Wiring._numOutPump < 19; ++index28) - { - int num94; - int num95; - switch (index28) - { - case 0: - num94 = x; - num95 = y7 + 1; - break; - case 1: - num94 = x + 1; - num95 = y7 + 1; - break; - case 2: - num94 = x; - num95 = y7; - break; - default: - num94 = x + 1; - num95 = y7; - break; - } - Wiring._outPumpX[Wiring._numOutPump] = num94; - Wiring._outPumpY[Wiring._numOutPump] = num95; - ++Wiring._numOutPump; - } - return; + num85 -= 2; + ++num86; } - switch (type) + int num87 = i - num85; + int num88 = i - (int) tile1.frameX % 36 / 18; + int num89 = j - (int) tile1.frameY % 54 / 18; + int num90 = (int) tile1.frameX / 36 + (int) tile1.frameY / 54 * 55; + Wiring.SkipWire(num88, num89); + Wiring.SkipWire(num88, num89 + 1); + Wiring.SkipWire(num88, num89 + 2); + Wiring.SkipWire(num88 + 1, num89); + Wiring.SkipWire(num88 + 1, num89 + 1); + Wiring.SkipWire(num88 + 1, num89 + 2); + int X = num88 * 16 + 16; + int Y = (num89 + 3) * 16; + int index21 = -1; + int num91 = -1; + bool flag11 = true; + bool flag12 = false; + switch (num90) { - case 105: - int num96 = j - (int) tile1.frameY / 18; - int num97 = (int) tile1.frameX / 18; - int num98 = 0; - while (num97 >= 2) - { - num97 -= 2; - ++num98; - } - int num99 = i - num97; - int num100 = i - (int) tile1.frameX % 36 / 18; - int num101 = j - (int) tile1.frameY % 54 / 18; - int num102 = (int) tile1.frameY / 54 % 3; - int num103 = (int) tile1.frameX / 36 + num102 * 55; - Wiring.SkipWire(num100, num101); - Wiring.SkipWire(num100, num101 + 1); - Wiring.SkipWire(num100, num101 + 2); - Wiring.SkipWire(num100 + 1, num101); - Wiring.SkipWire(num100 + 1, num101 + 1); - Wiring.SkipWire(num100 + 1, num101 + 2); - int X = num100 * 16 + 16; - int Y = (num101 + 3) * 16; - int index29 = -1; - int num104 = -1; - bool flag11 = true; - bool flag12 = false; - switch (num103) - { - case 5: - num104 = 73; - break; - case 13: - num104 = 24; - break; - case 30: - num104 = 6; - break; - case 35: - num104 = 2; - break; - case 51: - num104 = (int) Utils.SelectRandom(Main.rand, (short) 299, (short) 538); - break; - case 52: - num104 = 356; - break; - case 53: - num104 = 357; - break; - case 54: - num104 = (int) Utils.SelectRandom(Main.rand, (short) 355, (short) 358); - break; - case 55: - num104 = (int) Utils.SelectRandom(Main.rand, (short) 367, (short) 366); - break; - case 56: - num104 = (int) Utils.SelectRandom(Main.rand, (short) 359, (short) 359, (short) 359, (short) 359, (short) 360); - break; - case 57: - num104 = 377; - break; - case 58: - num104 = 300; - break; - case 59: - num104 = (int) Utils.SelectRandom(Main.rand, (short) 364, (short) 362); - break; - case 60: - num104 = 148; - break; - case 61: - num104 = 361; - break; - case 62: - num104 = (int) Utils.SelectRandom(Main.rand, (short) 487, (short) 486, (short) 485); - break; - case 63: - num104 = 164; - flag11 &= NPC.MechSpawn((float) X, (float) Y, 165); - break; - case 64: - num104 = 86; - flag12 = true; - break; - case 65: - num104 = 490; - break; - case 66: - num104 = 82; - break; - case 67: - num104 = 449; - break; - case 68: - num104 = 167; - break; - case 69: - num104 = 480; - break; - case 70: - num104 = 48; - break; - case 71: - num104 = (int) Utils.SelectRandom(Main.rand, (short) 170, (short) 180, (short) 171); - flag12 = true; - break; - case 72: - num104 = 481; - break; - case 73: - num104 = 482; - break; - case 74: - num104 = 430; - break; - case 75: - num104 = 489; - break; - case 76: - num104 = 611; - break; - case 77: - num104 = 602; - break; - case 78: - num104 = (int) Utils.SelectRandom(Main.rand, (short) 595, (short) 596, (short) 599, (short) 597, (short) 600, (short) 598); - break; - case 79: - num104 = (int) Utils.SelectRandom(Main.rand, (short) 616, (short) 617); - break; - } - if (((num104 == -1 || !Wiring.CheckMech(num100, num101, 30) ? 0 : (NPC.MechSpawn((float) X, (float) Y, num104) ? 1 : 0)) & (flag11 ? 1 : 0)) != 0) - { - if (!flag12 || !Collision.SolidTiles(num100 - 2, num100 + 3, num101, num101 + 2)) + case 51: + num91 = (int) Utils.SelectRandom(Main.rand, (short) 299, (short) 538); + break; + case 52: + num91 = 356; + break; + case 53: + num91 = 357; + break; + case 54: + num91 = (int) Utils.SelectRandom(Main.rand, (short) 355, (short) 358); + break; + case 55: + num91 = (int) Utils.SelectRandom(Main.rand, (short) 367, (short) 366); + break; + case 56: + num91 = (int) Utils.SelectRandom(Main.rand, (short) 359, (short) 359, (short) 359, (short) 359, (short) 360); + break; + case 57: + num91 = 377; + break; + case 58: + num91 = 300; + break; + case 59: + num91 = (int) Utils.SelectRandom(Main.rand, (short) 364, (short) 362); + break; + case 60: + num91 = 148; + break; + case 61: + num91 = 361; + break; + case 62: + num91 = (int) Utils.SelectRandom(Main.rand, (short) 487, (short) 486, (short) 485); + break; + case 63: + num91 = 164; + flag11 &= NPC.MechSpawn((float) X, (float) Y, 165); + break; + case 64: + num91 = 86; + flag12 = true; + break; + case 65: + num91 = 490; + break; + case 66: + num91 = 82; + break; + case 67: + num91 = 449; + break; + case 68: + num91 = 167; + break; + case 69: + num91 = 480; + break; + case 70: + num91 = 48; + break; + case 71: + num91 = (int) Utils.SelectRandom(Main.rand, (short) 170, (short) 180, (short) 171); + flag12 = true; + break; + case 72: + num91 = 481; + break; + case 73: + num91 = 482; + break; + case 74: + num91 = 430; + break; + case 75: + num91 = 489; + break; + } + if (((num91 == -1 || !Wiring.CheckMech(num88, num89, 30) ? 0 : (NPC.MechSpawn((float) X, (float) Y, num91) ? 1 : 0)) & (flag11 ? 1 : 0)) != 0) + { + if (!flag12 || !Collision.SolidTiles(num88 - 2, num88 + 3, num89, num89 + 2)) + { + index21 = NPC.NewNPC(X, Y - 12, num91); + } + else + { + Vector2 position = new Vector2((float) (X - 4), (float) (Y - 22)) - new Vector2(10f); + Utils.PoofOfSmoke(position); + NetMessage.SendData(106, number: ((int) position.X), number2: position.Y); + } + } + if (index21 <= -1) + { + switch (num90) + { + case 2: + if (Wiring.CheckMech(num88, num89, 600) && Item.MechSpawn((float) X, (float) Y, 184) && Item.MechSpawn((float) X, (float) Y, 1735) && Item.MechSpawn((float) X, (float) Y, 1868)) { - index29 = NPC.NewNPC(X, Y, num104); + Item.NewItem(X, Y - 16, 0, 0, 184); + break; } - else + break; + case 4: + if (Wiring.CheckMech(num88, num89, 30) && NPC.MechSpawn((float) X, (float) Y, 1)) { + index21 = NPC.NewNPC(X, Y - 12, 1); + break; + } + break; + case 7: + if (Wiring.CheckMech(num88, num89, 30) && NPC.MechSpawn((float) X, (float) Y, 49)) + { + index21 = NPC.NewNPC(X - 4, Y - 6, 49); + break; + } + break; + case 8: + if (Wiring.CheckMech(num88, num89, 30) && NPC.MechSpawn((float) X, (float) Y, 55)) + { + index21 = NPC.NewNPC(X, Y - 12, 55); + break; + } + break; + case 9: + if (Wiring.CheckMech(num88, num89, 30) && NPC.MechSpawn((float) X, (float) Y, 46)) + { + index21 = NPC.NewNPC(X, Y - 12, 46); + break; + } + break; + case 10: + if (Wiring.CheckMech(num88, num89, 30) && NPC.MechSpawn((float) X, (float) Y, 21)) + { + index21 = NPC.NewNPC(X, Y, 21); + break; + } + break; + case 17: + if (Wiring.CheckMech(num88, num89, 600) && Item.MechSpawn((float) X, (float) Y, 166)) + { + Item.NewItem(X, Y - 20, 0, 0, 166); + break; + } + break; + case 18: + if (Wiring.CheckMech(num88, num89, 30) && NPC.MechSpawn((float) X, (float) Y, 67)) + { + index21 = NPC.NewNPC(X, Y - 12, 67); + break; + } + break; + case 23: + if (Wiring.CheckMech(num88, num89, 30) && NPC.MechSpawn((float) X, (float) Y, 63)) + { + index21 = NPC.NewNPC(X, Y - 12, 63); + break; + } + break; + case 27: + if (Wiring.CheckMech(num88, num89, 30) && NPC.MechSpawn((float) X, (float) Y, 85)) + { + index21 = NPC.NewNPC(X - 9, Y, 85); + break; + } + break; + case 28: + if (Wiring.CheckMech(num88, num89, 30) && NPC.MechSpawn((float) X, (float) Y, 74)) + { + index21 = NPC.NewNPC(X, Y - 12, (int) Utils.SelectRandom(Main.rand, (short) 74, (short) 297, (short) 298)); + break; + } + break; + case 34: + for (int index22 = 0; index22 < 2; ++index22) + { + for (int index23 = 0; index23 < 3; ++index23) + { + Tile tile2 = Main.tile[num88 + index22, num89 + index23]; + tile2.type = (ushort) 349; + tile2.frameX = (short) (index22 * 18 + 216); + tile2.frameY = (short) (index23 * 18); + } + } + Animation.NewTemporaryAnimation(0, (ushort) 349, num88, num89); + if (Main.netMode == 2) + { + NetMessage.SendTileRange(-1, num88, num89, 2, 3); + break; + } + break; + case 37: + if (Wiring.CheckMech(num88, num89, 600) && Item.MechSpawn((float) X, (float) Y, 58) && Item.MechSpawn((float) X, (float) Y, 1734) && Item.MechSpawn((float) X, (float) Y, 1867)) + { + Item.NewItem(X, Y - 16, 0, 0, 58); + break; + } + break; + case 40: + if (Wiring.CheckMech(num88, num89, 300)) + { + int[] numArray = new int[10]; + int maxValue = 0; + for (int index24 = 0; index24 < 200; ++index24) + { + if (Main.npc[index24].active && (Main.npc[index24].type == 17 || Main.npc[index24].type == 19 || Main.npc[index24].type == 22 || Main.npc[index24].type == 38 || Main.npc[index24].type == 54 || Main.npc[index24].type == 107 || Main.npc[index24].type == 108 || Main.npc[index24].type == 142 || Main.npc[index24].type == 160 || Main.npc[index24].type == 207 || Main.npc[index24].type == 209 || Main.npc[index24].type == 227 || Main.npc[index24].type == 228 || Main.npc[index24].type == 229 || Main.npc[index24].type == 358 || Main.npc[index24].type == 369 || Main.npc[index24].type == 550)) + { + numArray[maxValue] = index24; + ++maxValue; + if (maxValue >= 9) + break; + } + } + if (maxValue > 0) + { + int number = numArray[Main.rand.Next(maxValue)]; + Main.npc[number].position.X = (float) (X - Main.npc[number].width / 2); + Main.npc[number].position.Y = (float) (Y - Main.npc[number].height - 1); + NetMessage.SendData(23, number: number); + break; + } + break; + } + break; + case 41: + if (Wiring.CheckMech(num88, num89, 300)) + { + int[] numArray = new int[10]; + int maxValue = 0; + for (int index25 = 0; index25 < 200; ++index25) + { + if (Main.npc[index25].active && (Main.npc[index25].type == 18 || Main.npc[index25].type == 20 || Main.npc[index25].type == 124 || Main.npc[index25].type == 178 || Main.npc[index25].type == 208 || Main.npc[index25].type == 353)) + { + numArray[maxValue] = index25; + ++maxValue; + if (maxValue >= 9) + break; + } + } + if (maxValue > 0) + { + int number = numArray[Main.rand.Next(maxValue)]; + Main.npc[number].position.X = (float) (X - Main.npc[number].width / 2); + Main.npc[number].position.Y = (float) (Y - Main.npc[number].height - 1); + NetMessage.SendData(23, number: number); + break; + } + break; + } + break; + case 42: + if (Wiring.CheckMech(num88, num89, 30) && NPC.MechSpawn((float) X, (float) Y, 58)) + { + index21 = NPC.NewNPC(X, Y - 12, 58); + break; + } + break; + case 50: + if (Wiring.CheckMech(num88, num89, 30) && NPC.MechSpawn((float) X, (float) Y, 65)) + { + if (!Collision.SolidTiles(num88 - 2, num88 + 3, num89, num89 + 2)) + { + index21 = NPC.NewNPC(X, Y - 12, 65); + break; + } Vector2 position = new Vector2((float) (X - 4), (float) (Y - 22)) - new Vector2(10f); Utils.PoofOfSmoke(position); NetMessage.SendData(106, number: ((int) position.X), number2: position.Y); + break; } - } - if (index29 <= -1) - { - switch (num103) - { - case 2: - if (Wiring.CheckMech(num100, num101, 600) && Item.MechSpawn((float) X, (float) Y, 184) && Item.MechSpawn((float) X, (float) Y, 1735) && Item.MechSpawn((float) X, (float) Y, 1868)) - { - Item.NewItem(X, Y - 16, 0, 0, 184); - break; - } - break; - case 4: - if (Wiring.CheckMech(num100, num101, 30) && NPC.MechSpawn((float) X, (float) Y, 1)) - { - index29 = NPC.NewNPC(X, Y - 12, 1); - break; - } - break; - case 7: - if (Wiring.CheckMech(num100, num101, 30) && NPC.MechSpawn((float) X, (float) Y, 49)) - { - index29 = NPC.NewNPC(X - 4, Y - 6, 49); - break; - } - break; - case 8: - if (Wiring.CheckMech(num100, num101, 30) && NPC.MechSpawn((float) X, (float) Y, 55)) - { - index29 = NPC.NewNPC(X, Y - 12, 55); - break; - } - break; - case 9: - int num105 = 46; - if (BirthdayParty.PartyIsUp) - num105 = 540; - if (Wiring.CheckMech(num100, num101, 30) && NPC.MechSpawn((float) X, (float) Y, num105)) - { - index29 = NPC.NewNPC(X, Y - 12, num105); - break; - } - break; - case 10: - if (Wiring.CheckMech(num100, num101, 30) && NPC.MechSpawn((float) X, (float) Y, 21)) - { - index29 = NPC.NewNPC(X, Y, 21); - break; - } - break; - case 16: - if (Wiring.CheckMech(num100, num101, 30) && NPC.MechSpawn((float) X, (float) Y, 42)) - { - if (!Collision.SolidTiles(num100 - 1, num100 + 1, num101, num101 + 1)) - { - index29 = NPC.NewNPC(X, Y - 12, 42); - break; - } - Vector2 position = new Vector2((float) (X - 4), (float) (Y - 22)) - new Vector2(10f); - Utils.PoofOfSmoke(position); - NetMessage.SendData(106, number: ((int) position.X), number2: position.Y); - break; - } - break; - case 17: - if (Wiring.CheckMech(num100, num101, 600) && Item.MechSpawn((float) X, (float) Y, 166)) - { - Item.NewItem(X, Y - 20, 0, 0, 166); - break; - } - break; - case 18: - if (Wiring.CheckMech(num100, num101, 30) && NPC.MechSpawn((float) X, (float) Y, 67)) - { - index29 = NPC.NewNPC(X, Y - 12, 67); - break; - } - break; - case 23: - if (Wiring.CheckMech(num100, num101, 30) && NPC.MechSpawn((float) X, (float) Y, 63)) - { - index29 = NPC.NewNPC(X, Y - 12, 63); - break; - } - break; - case 27: - if (Wiring.CheckMech(num100, num101, 30) && NPC.MechSpawn((float) X, (float) Y, 85)) - { - index29 = NPC.NewNPC(X - 9, Y, 85); - break; - } - break; - case 28: - if (Wiring.CheckMech(num100, num101, 30) && NPC.MechSpawn((float) X, (float) Y, 74)) - { - index29 = NPC.NewNPC(X, Y - 12, (int) Utils.SelectRandom(Main.rand, (short) 74, (short) 297, (short) 298)); - break; - } - break; - case 34: - for (int index30 = 0; index30 < 2; ++index30) - { - for (int index31 = 0; index31 < 3; ++index31) - { - Tile tile2 = Main.tile[num100 + index30, num101 + index31]; - tile2.type = (ushort) 349; - tile2.frameX = (short) (index30 * 18 + 216); - tile2.frameY = (short) (index31 * 18); - } - } - Animation.NewTemporaryAnimation(0, (ushort) 349, num100, num101); - if (Main.netMode == 2) - { - NetMessage.SendTileRange(-1, num100, num101, 2, 3); - break; - } - break; - case 37: - if (Wiring.CheckMech(num100, num101, 600) && Item.MechSpawn((float) X, (float) Y, 58) && Item.MechSpawn((float) X, (float) Y, 1734) && Item.MechSpawn((float) X, (float) Y, 1867)) - { - Item.NewItem(X, Y - 16, 0, 0, 58); - break; - } - break; - case 40: - if (Wiring.CheckMech(num100, num101, 300)) - { - int length = 50; - int[] numArray = new int[length]; - int maxValue = 0; - for (int index32 = 0; index32 < 200; ++index32) - { - if (Main.npc[index32].active && (Main.npc[index32].type == 17 || Main.npc[index32].type == 19 || Main.npc[index32].type == 22 || Main.npc[index32].type == 38 || Main.npc[index32].type == 54 || Main.npc[index32].type == 107 || Main.npc[index32].type == 108 || Main.npc[index32].type == 142 || Main.npc[index32].type == 160 || Main.npc[index32].type == 207 || Main.npc[index32].type == 209 || Main.npc[index32].type == 227 || Main.npc[index32].type == 228 || Main.npc[index32].type == 229 || Main.npc[index32].type == 368 || Main.npc[index32].type == 369 || Main.npc[index32].type == 550 || Main.npc[index32].type == 441 || Main.npc[index32].type == 588)) - { - numArray[maxValue] = index32; - ++maxValue; - if (maxValue >= length) - break; - } - } - if (maxValue > 0) - { - int number = numArray[Main.rand.Next(maxValue)]; - Main.npc[number].position.X = (float) (X - Main.npc[number].width / 2); - Main.npc[number].position.Y = (float) (Y - Main.npc[number].height - 1); - NetMessage.SendData(23, number: number); - break; - } - break; - } - break; - case 41: - if (Wiring.CheckMech(num100, num101, 300)) - { - int length = 50; - int[] numArray = new int[length]; - int maxValue = 0; - for (int index33 = 0; index33 < 200; ++index33) - { - if (Main.npc[index33].active && (Main.npc[index33].type == 18 || Main.npc[index33].type == 20 || Main.npc[index33].type == 124 || Main.npc[index33].type == 178 || Main.npc[index33].type == 208 || Main.npc[index33].type == 353 || Main.npc[index33].type == 633)) - { - numArray[maxValue] = index33; - ++maxValue; - if (maxValue >= length) - break; - } - } - if (maxValue > 0) - { - int number = numArray[Main.rand.Next(maxValue)]; - Main.npc[number].position.X = (float) (X - Main.npc[number].width / 2); - Main.npc[number].position.Y = (float) (Y - Main.npc[number].height - 1); - NetMessage.SendData(23, number: number); - break; - } - break; - } - break; - case 42: - if (Wiring.CheckMech(num100, num101, 30) && NPC.MechSpawn((float) X, (float) Y, 58)) - { - index29 = NPC.NewNPC(X, Y - 12, 58); - break; - } - break; - case 50: - if (Wiring.CheckMech(num100, num101, 30) && NPC.MechSpawn((float) X, (float) Y, 65)) - { - if (!Collision.SolidTiles(num100 - 2, num100 + 3, num101, num101 + 2)) - { - index29 = NPC.NewNPC(X, Y - 12, 65); - break; - } - Vector2 position = new Vector2((float) (X - 4), (float) (Y - 22)) - new Vector2(10f); - Utils.PoofOfSmoke(position); - NetMessage.SendData(106, number: ((int) position.X), number2: position.Y); - break; - } - break; - } - } - if (index29 < 0) - return; - Main.npc[index29].value = 0.0f; - Main.npc[index29].npcSlots = 0.0f; - Main.npc[index29].SpawnedFromStatue = true; - return; - case 349: - int num106 = (int) tile1.frameY / 18 % 3; - int index34 = j - num106; - int num107 = (int) tile1.frameX / 18; - while (num107 >= 2) - num107 -= 2; - int index35 = i - num107; - Wiring.SkipWire(index35, index34); - Wiring.SkipWire(index35, index34 + 1); - Wiring.SkipWire(index35, index34 + 2); - Wiring.SkipWire(index35 + 1, index34); - Wiring.SkipWire(index35 + 1, index34 + 1); - Wiring.SkipWire(index35 + 1, index34 + 2); - short num108 = Main.tile[index35, index34].frameX != (short) 0 ? (short) -216 : (short) 216; - for (int index36 = 0; index36 < 2; ++index36) - { - for (int index37 = 0; index37 < 3; ++index37) - Main.tile[index35 + index36, index34 + index37].frameX += num108; - } - if (Main.netMode == 2) - NetMessage.SendTileRange(-1, index35, index34, 2, 3); - Animation.NewTemporaryAnimation(num108 > (short) 0 ? 0 : 1, (ushort) 349, index35, index34); - return; - case 506: - int num109 = (int) tile1.frameY / 18 % 3; - int index38 = j - num109; - int num110 = (int) tile1.frameX / 18; - while (num110 >= 2) - num110 -= 2; - int index39 = i - num110; - Wiring.SkipWire(index39, index38); - Wiring.SkipWire(index39, index38 + 1); - Wiring.SkipWire(index39, index38 + 2); - Wiring.SkipWire(index39 + 1, index38); - Wiring.SkipWire(index39 + 1, index38 + 1); - Wiring.SkipWire(index39 + 1, index38 + 2); - short num111 = Main.tile[index39, index38].frameX >= (short) 72 ? (short) -72 : (short) 72; - for (int index40 = 0; index40 < 2; ++index40) - { - for (int index41 = 0; index41 < 3; ++index41) - Main.tile[index39 + index40, index38 + index41].frameX += num111; - } - if (Main.netMode != 2) - return; - NetMessage.SendTileRange(-1, index39, index38, 2, 3); - return; - case 546: - tile1.type = (ushort) 557; - WorldGen.SquareTileFrame(i, j); - NetMessage.SendTileSquare(-1, i, j, 1); - return; - case 557: - tile1.type = (ushort) 546; - WorldGen.SquareTileFrame(i, j); - NetMessage.SendTileSquare(-1, i, j, 1); - return; - default: - return; + break; + } } + if (index21 < 0) + return; + Main.npc[index21].value = 0.0f; + Main.npc[index21].npcSlots = 0.0f; + Main.npc[index21].SpawnedFromStatue = true; + return; + case 349: + int index26 = j - (int) tile1.frameY / 18; + int num92 = (int) tile1.frameX / 18; + while (num92 >= 2) + num92 -= 2; + int index27 = i - num92; + Wiring.SkipWire(index27, index26); + Wiring.SkipWire(index27, index26 + 1); + Wiring.SkipWire(index27, index26 + 2); + Wiring.SkipWire(index27 + 1, index26); + Wiring.SkipWire(index27 + 1, index26 + 1); + Wiring.SkipWire(index27 + 1, index26 + 2); + short num93 = Main.tile[index27, index26].frameX != (short) 0 ? (short) -216 : (short) 216; + for (int index28 = 0; index28 < 2; ++index28) + { + for (int index29 = 0; index29 < 3; ++index29) + Main.tile[index27 + index28, index26 + index29].frameX += num93; + } + if (Main.netMode == 2) + NetMessage.SendTileRange(-1, index27, index26, 2, 3); + Animation.NewTemporaryAnimation(num93 > (short) 0 ? 0 : 1, (ushort) 349, index27, index26); + return; + default: + return; } } } @@ -2275,36 +2108,6 @@ namespace Terraria } } - private static void GeyserTrap(int i, int j) - { - Tile tile = Main.tile[i, j]; - if (tile.type != (ushort) 443) - return; - int num = (int) tile.frameX / 36; - int i1 = i - ((int) tile.frameX - num * 36) / 18; - int j1 = j; - if (!Wiring.CheckMech(i1, j1, 200)) - return; - Vector2 zero = Vector2.Zero; - Vector2 vector2_1 = Vector2.Zero; - int Type = 654; - int Damage = 20; - Vector2 vector2_2; - if (num < 2) - { - vector2_2 = new Vector2((float) (i1 + 1), (float) j1) * 16f; - vector2_1 = new Vector2(0.0f, -8f); - } - else - { - vector2_2 = new Vector2((float) (i1 + 1), (float) (j1 + 1)) * 16f; - vector2_1 = new Vector2(0.0f, 8f); - } - if (Type == 0) - return; - Projectile.NewProjectile((float) (int) vector2_2.X, (float) (int) vector2_2.Y, vector2_1.X, vector2_1.Y, Type, Damage, 2f, Main.myPlayer); - } - private static void Teleport() { if ((double) Wiring._teleport[0].X < (double) Wiring._teleport[1].X + 3.0 && (double) Wiring._teleport[0].X > (double) Wiring._teleport[1].X - 3.0 && (double) Wiring._teleport[0].Y > (double) Wiring._teleport[1].Y - 3.0 && (double) Wiring._teleport[0].Y < (double) Wiring._teleport[1].Y) @@ -2327,7 +2130,7 @@ namespace Terraria { for (int playerIndex = 0; playerIndex < (int) byte.MaxValue; ++playerIndex) { - if (Main.player[playerIndex].active && !Main.player[playerIndex].dead && !Main.player[playerIndex].teleporting && Wiring.TeleporterHitboxIntersects(rectangleArray[index1], Main.player[playerIndex].Hitbox)) + if (Main.player[playerIndex].active && !Main.player[playerIndex].dead && !Main.player[playerIndex].teleporting && rectangleArray[index1].Intersects(Main.player[playerIndex].getRect())) { Vector2 vector2_2 = Main.player[playerIndex].position + vector2_1; Main.player[playerIndex].teleporting = true; @@ -2344,7 +2147,7 @@ namespace Terraria if (Main.npc[index2].active && !Main.npc[index2].teleporting && Main.npc[index2].lifeMax > 5 && !Main.npc[index2].boss && !Main.npc[index2].noTileCollide) { int type = Main.npc[index2].type; - if (!NPCID.Sets.TeleportationImmune[type] && Wiring.TeleporterHitboxIntersects(rectangleArray[index1], Main.npc[index2].Hitbox)) + if (!NPCID.Sets.TeleportationImmune[type] && rectangleArray[index1].Intersects(Main.npc[index2].getRect())) { Main.npc[index2].teleporting = true; Main.npc[index2].Teleport(Main.npc[index2].position + vector2_1); @@ -2358,15 +2161,9 @@ namespace Terraria Main.npc[index].teleporting = false; } - private static bool TeleporterHitboxIntersects(Rectangle teleporter, Rectangle entity) - { - Rectangle rectangle = Rectangle.Union(teleporter, entity); - return rectangle.Width <= teleporter.Width + entity.Width && rectangle.Height <= teleporter.Height + entity.Height; - } - private static void DeActive(int i, int j) { - if (!Main.tile[i, j].active() || Main.tile[i, j].type == (ushort) 226 && (double) j > Main.worldSurface && !NPC.downedPlantBoss) + if (!Main.tile[i, j].active()) return; bool flag = Main.tileSolid[(int) Main.tile[i, j].type] && !TileID.Sets.NotReallySolid[(int) Main.tile[i, j].type]; switch (Main.tile[i, j].type) @@ -2376,11 +2173,10 @@ namespace Terraria case 387: case 388: case 389: - case 476: flag = false; break; } - if (!flag || Main.tile[i, j - 1].active() && (TileID.Sets.BasicChest[(int) Main.tile[i, j - 1].type] || Main.tile[i, j - 1].type == (ushort) 26 || Main.tile[i, j - 1].type == (ushort) 77 || Main.tile[i, j - 1].type == (ushort) 88 || Main.tile[i, j - 1].type == (ushort) 470 || Main.tile[i, j - 1].type == (ushort) 475 || Main.tile[i, j - 1].type == (ushort) 237 || Main.tile[i, j - 1].type == (ushort) 597 || !WorldGen.CanKillTile(i, j - 1))) + if (!flag || Main.tile[i, j - 1].active() && (Main.tile[i, j - 1].type == (ushort) 5 || TileID.Sets.BasicChest[(int) Main.tile[i, j - 1].type] || Main.tile[i, j - 1].type == (ushort) 26 || Main.tile[i, j - 1].type == (ushort) 77 || Main.tile[i, j - 1].type == (ushort) 72 || Main.tile[i, j - 1].type == (ushort) 88)) return; Main.tile[i, j].inActive(true); WorldGen.SquareTileFrame(i, j, false); diff --git a/World.cs b/World.cs deleted file mode 100644 index 7917b8b..0000000 --- a/World.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.World -// 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 -{ - public class World - { - public Tile[,] Tiles => Main.tile; - - public int TileColumns => Main.maxTilesX; - - public int TileRows => Main.maxTilesY; - - public Player[] Players => Main.player; - } -} diff --git a/WorldBuilding/Actions.cs b/World/Generation/Actions.cs similarity index 83% rename from WorldBuilding/Actions.cs rename to World/Generation/Actions.cs index fc33324..a49c152 100644 --- a/WorldBuilding/Actions.cs +++ b/World/Generation/Actions.cs @@ -1,16 +1,14 @@ // Decompiled with JetBrains decompiler -// Type: Terraria.WorldBuilding.Actions -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Type: Terraria.World.Generation.Actions +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.Collections.Generic; -using Terraria.DataStructures; -using Terraria.GameContent; -namespace Terraria.WorldBuilding +namespace Terraria.World.Generation { public static class Actions { @@ -185,42 +183,7 @@ namespace Terraria.WorldBuilding public override bool Apply(Point origin, int x, int y, params object[] args) { - GenBase._tiles[x, y].Clear(~(TileDataType.Wiring | TileDataType.Actuator)); - GenBase._tiles[x, y].type = this._type; - GenBase._tiles[x, y].active(true); - if (this._doFraming) - WorldUtils.TileFrame(x, y, this._doNeighborFraming); - return this.UnitApply(origin, x, y, args); - } - } - - public class SetTileKeepWall : GenAction - { - private ushort _type; - private bool _doFraming; - private bool _doNeighborFraming; - - public SetTileKeepWall(ushort type, bool setSelfFrames = false, bool setNeighborFrames = true) - { - this._type = type; - this._doFraming = setSelfFrames; - this._doNeighborFraming = setNeighborFrames; - } - - public override bool Apply(Point origin, int x, int y, params object[] args) - { - ushort wall = GenBase._tiles[x, y].wall; - int wallFrameX = GenBase._tiles[x, y].wallFrameX(); - int wallFrameY = GenBase._tiles[x, y].wallFrameY(); - GenBase._tiles[x, y].Clear(~(TileDataType.Wiring | TileDataType.Actuator)); - GenBase._tiles[x, y].type = this._type; - GenBase._tiles[x, y].active(true); - if (wall > (ushort) 0) - { - GenBase._tiles[x, y].wall = wall; - GenBase._tiles[x, y].wallFrameX(wallFrameX); - GenBase._tiles[x, y].wallFrameY(wallFrameY); - } + GenBase._tiles[x, y].ResetToType(this._type); if (this._doFraming) WorldUtils.TileFrame(x, y, this._doNeighborFraming); return this.UnitApply(origin, x, y, args); @@ -240,7 +203,7 @@ namespace Terraria.WorldBuilding public override bool Apply(Point origin, int x, int y, params object[] args) { - this._spriteBatch.Draw(TextureAssets.MagicPixel.Value, new Microsoft.Xna.Framework.Rectangle((x << 4) - (int) Main.screenPosition.X, (y << 4) - (int) Main.screenPosition.Y, 16, 16), this._color); + this._spriteBatch.Draw(Main.magicPixel, new Microsoft.Xna.Framework.Rectangle((x << 4) - (int) Main.screenPosition.X, (y << 4) - (int) Main.screenPosition.Y, 16, 16), this._color); return this.UnitApply(origin, x, y, args); } } @@ -293,17 +256,17 @@ namespace Terraria.WorldBuilding { public override bool Apply(Point origin, int x, int y, params object[] args) { - GenBase._tiles[x, y].wall = (ushort) 0; + GenBase._tiles[x, y].wall = (byte) 0; return this.UnitApply(origin, x, y, args); } } public class PlaceWall : GenAction { - private ushort _type; + private byte _type; private bool _neighbors; - public PlaceWall(ushort type, bool neighbors = true) + public PlaceWall(byte type, bool neighbors = true) { this._type = type; this._neighbors = neighbors; diff --git a/World/Generation/BiomeCollection.cs b/World/Generation/BiomeCollection.cs new file mode 100644 index 0000000..9f42348 --- /dev/null +++ b/World/Generation/BiomeCollection.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Terraria.World.Generation.BiomeCollection +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 +// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe + +using System.Collections.Generic; + +namespace Terraria.World.Generation +{ + internal static class BiomeCollection + { + public static List Biomes = new List(); + } +} diff --git a/World/Generation/Biomes`1.cs b/World/Generation/Biomes`1.cs new file mode 100644 index 0000000..c95ece0 --- /dev/null +++ b/World/Generation/Biomes`1.cs @@ -0,0 +1,28 @@ +// Decompiled with JetBrains decompiler +// Type: Terraria.World.Generation.Biomes`1 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 +// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe + +using Microsoft.Xna.Framework; + +namespace Terraria.World.Generation +{ + public static class Biomes where T : MicroBiome, new() + { + private static T _microBiome = Biomes.CreateInstance(); + + public static bool Place(int x, int y, StructureMap structures) => Biomes._microBiome.Place(new Point(x, y), structures); + + public static bool Place(Point origin, StructureMap structures) => Biomes._microBiome.Place(origin, structures); + + public static T Get() => Biomes._microBiome; + + private static T CreateInstance() + { + T obj = new T(); + BiomeCollection.Biomes.Add((MicroBiome) obj); + return obj; + } + } +} diff --git a/WorldBuilding/Conditions.cs b/World/Generation/Conditions.cs similarity index 62% rename from WorldBuilding/Conditions.cs rename to World/Generation/Conditions.cs index 7d98b70..f7b063f 100644 --- a/WorldBuilding/Conditions.cs +++ b/World/Generation/Conditions.cs @@ -1,10 +1,10 @@ // Decompiled with JetBrains decompiler -// Type: Terraria.WorldBuilding.Conditions -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Type: Terraria.World.Generation.Conditions +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe -namespace Terraria.WorldBuilding +namespace Terraria.World.Generation { public static class Conditions { @@ -33,24 +33,14 @@ namespace Terraria.WorldBuilding protected override bool CheckValidity(int x, int y) => false; } - public class MysticSnake : GenCondition - { - protected override bool CheckValidity(int x, int y) => GenBase._tiles[x, y].active() && !Main.tileCut[(int) GenBase._tiles[x, y].type] && GenBase._tiles[x, y].type != (ushort) 504; - } - public class IsSolid : GenCondition { - protected override bool CheckValidity(int x, int y) => WorldGen.InWorld(x, y, 10) && GenBase._tiles[x, y].active() && Main.tileSolid[(int) GenBase._tiles[x, y].type]; + protected override bool CheckValidity(int x, int y) => GenBase._tiles[x, y].active() && Main.tileSolid[(int) GenBase._tiles[x, y].type]; } public class HasLava : GenCondition { protected override bool CheckValidity(int x, int y) => GenBase._tiles[x, y].liquid > (byte) 0 && GenBase._tiles[x, y].liquidType() == (byte) 1; } - - public class NotNull : GenCondition - { - protected override bool CheckValidity(int x, int y) => GenBase._tiles[x, y] != null; - } } } diff --git a/WorldBuilding/GenAction.cs b/World/Generation/GenAction.cs similarity index 83% rename from WorldBuilding/GenAction.cs rename to World/Generation/GenAction.cs index 17bf03d..71d62ed 100644 --- a/WorldBuilding/GenAction.cs +++ b/World/Generation/GenAction.cs @@ -1,12 +1,12 @@ // Decompiled with JetBrains decompiler -// Type: Terraria.WorldBuilding.GenAction -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Type: Terraria.World.Generation.GenAction +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; -namespace Terraria.WorldBuilding +namespace Terraria.World.Generation { public abstract class GenAction : GenBase { diff --git a/WorldBuilding/GenBase.cs b/World/Generation/GenBase.cs similarity index 74% rename from WorldBuilding/GenBase.cs rename to World/Generation/GenBase.cs index 5b5c5d0..2222312 100644 --- a/WorldBuilding/GenBase.cs +++ b/World/Generation/GenBase.cs @@ -1,12 +1,12 @@ // Decompiled with JetBrains decompiler -// Type: Terraria.WorldBuilding.GenBase -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Type: Terraria.World.Generation.GenBase +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Terraria.Utilities; -namespace Terraria.WorldBuilding +namespace Terraria.World.Generation { public class GenBase { diff --git a/WorldBuilding/GenCondition.cs b/World/Generation/GenCondition.cs similarity index 90% rename from WorldBuilding/GenCondition.cs rename to World/Generation/GenCondition.cs index f32ad80..f30d6f9 100644 --- a/WorldBuilding/GenCondition.cs +++ b/World/Generation/GenCondition.cs @@ -1,10 +1,10 @@ // Decompiled with JetBrains decompiler -// Type: Terraria.WorldBuilding.GenCondition -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Type: Terraria.World.Generation.GenCondition +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe -namespace Terraria.WorldBuilding +namespace Terraria.World.Generation { public abstract class GenCondition : GenBase { diff --git a/WorldBuilding/GenModShape.cs b/World/Generation/GenModShape.cs similarity index 62% rename from WorldBuilding/GenModShape.cs rename to World/Generation/GenModShape.cs index ea4401c..cbd1c3b 100644 --- a/WorldBuilding/GenModShape.cs +++ b/World/Generation/GenModShape.cs @@ -1,10 +1,10 @@ // Decompiled with JetBrains decompiler -// Type: Terraria.WorldBuilding.GenModShape -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Type: Terraria.World.Generation.GenModShape +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe -namespace Terraria.WorldBuilding +namespace Terraria.World.Generation { public abstract class GenModShape : GenShape { diff --git a/World/Generation/GenPass.cs b/World/Generation/GenPass.cs new file mode 100644 index 0000000..15c7d47 --- /dev/null +++ b/World/Generation/GenPass.cs @@ -0,0 +1,22 @@ +// Decompiled with JetBrains decompiler +// Type: Terraria.World.Generation.GenPass +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 +// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe + +namespace Terraria.World.Generation +{ + public abstract class GenPass : GenBase + { + public string Name; + public float Weight; + + public GenPass(string name, float loadWeight) + { + this.Name = name; + this.Weight = loadWeight; + } + + public abstract void Apply(GenerationProgress progress); + } +} diff --git a/WorldBuilding/GenSearch.cs b/World/Generation/GenSearch.cs similarity index 83% rename from WorldBuilding/GenSearch.cs rename to World/Generation/GenSearch.cs index ec3d965..3e2318d 100644 --- a/WorldBuilding/GenSearch.cs +++ b/World/Generation/GenSearch.cs @@ -1,12 +1,12 @@ // Decompiled with JetBrains decompiler -// Type: Terraria.WorldBuilding.GenSearch -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Type: Terraria.World.Generation.GenSearch +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; -namespace Terraria.WorldBuilding +namespace Terraria.World.Generation { public abstract class GenSearch : GenBase { diff --git a/WorldBuilding/GenShape.cs b/World/Generation/GenShape.cs similarity index 82% rename from WorldBuilding/GenShape.cs rename to World/Generation/GenShape.cs index bc8a287..5540541 100644 --- a/WorldBuilding/GenShape.cs +++ b/World/Generation/GenShape.cs @@ -1,12 +1,12 @@ // Decompiled with JetBrains decompiler -// Type: Terraria.WorldBuilding.GenShape -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Type: Terraria.World.Generation.GenShape +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; -namespace Terraria.WorldBuilding +namespace Terraria.World.Generation { public abstract class GenShape : GenBase { diff --git a/WorldBuilding/GenStructure.cs b/World/Generation/GenStructure.cs similarity index 62% rename from WorldBuilding/GenStructure.cs rename to World/Generation/GenStructure.cs index 041eb97..3117ef4 100644 --- a/WorldBuilding/GenStructure.cs +++ b/World/Generation/GenStructure.cs @@ -1,12 +1,12 @@ // Decompiled with JetBrains decompiler -// Type: Terraria.WorldBuilding.GenStructure -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Type: Terraria.World.Generation.GenStructure +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; -namespace Terraria.WorldBuilding +namespace Terraria.World.Generation { public abstract class GenStructure : GenBase { diff --git a/WorldBuilding/GenerationProgress.cs b/World/Generation/GenerationProgress.cs similarity index 76% rename from WorldBuilding/GenerationProgress.cs rename to World/Generation/GenerationProgress.cs index bcbe224..c7d43ff 100644 --- a/WorldBuilding/GenerationProgress.cs +++ b/World/Generation/GenerationProgress.cs @@ -1,10 +1,10 @@ // Decompiled with JetBrains decompiler -// Type: Terraria.WorldBuilding.GenerationProgress -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Type: Terraria.World.Generation.GenerationProgress +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe -namespace Terraria.WorldBuilding +namespace Terraria.World.Generation { public class GenerationProgress { @@ -36,10 +36,6 @@ namespace Terraria.WorldBuilding this._value = 0.0f; } - public void End() - { - this._totalProgress += this.CurrentPassWeight; - this._value = 0.0f; - } + public void End() => this._totalProgress += this.CurrentPassWeight; } } diff --git a/World/Generation/MicroBiome.cs b/World/Generation/MicroBiome.cs new file mode 100644 index 0000000..066c041 --- /dev/null +++ b/World/Generation/MicroBiome.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: Terraria.World.Generation.MicroBiome +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 +// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe + +namespace Terraria.World.Generation +{ + public abstract class MicroBiome : GenStructure + { + public virtual void Reset() + { + } + + public static void ResetAll() + { + foreach (MicroBiome biome in BiomeCollection.Biomes) + biome.Reset(); + } + } +} diff --git a/WorldBuilding/ModShapes.cs b/World/Generation/ModShapes.cs similarity index 94% rename from WorldBuilding/ModShapes.cs rename to World/Generation/ModShapes.cs index 2ad5e12..ec30e59 100644 --- a/WorldBuilding/ModShapes.cs +++ b/World/Generation/ModShapes.cs @@ -1,13 +1,13 @@ // Decompiled with JetBrains decompiler -// Type: Terraria.WorldBuilding.ModShapes -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Type: Terraria.World.Generation.ModShapes +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using Terraria.DataStructures; -namespace Terraria.WorldBuilding +namespace Terraria.World.Generation { public static class ModShapes { diff --git a/WorldBuilding/Modifiers.cs b/World/Generation/Modifiers.cs similarity index 90% rename from WorldBuilding/Modifiers.cs rename to World/Generation/Modifiers.cs index 5e5da01..faa1841 100644 --- a/WorldBuilding/Modifiers.cs +++ b/World/Generation/Modifiers.cs @@ -1,13 +1,13 @@ // Decompiled with JetBrains decompiler -// Type: Terraria.WorldBuilding.Modifiers -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Type: Terraria.World.Generation.Modifiers +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using System; -namespace Terraria.WorldBuilding +namespace Terraria.World.Generation { public static class Modifiers { @@ -131,27 +131,9 @@ namespace Terraria.WorldBuilding } } - public class InShape : GenAction - { - private readonly ShapeData _shapeData; - - public InShape(ShapeData shapeData) => this._shapeData = shapeData; - - public override bool Apply(Point origin, int x, int y, params object[] args) => !this._shapeData.Contains(x - origin.X, y - origin.Y) ? this.Fail() : this.UnitApply(origin, x, y, args); - } - - public class NotInShape : GenAction - { - private readonly ShapeData _shapeData; - - public NotInShape(ShapeData shapeData) => this._shapeData = shapeData; - - public override bool Apply(Point origin, int x, int y, params object[] args) => this._shapeData.Contains(x - origin.X, y - origin.Y) ? this.Fail() : this.UnitApply(origin, x, y, args); - } - public class Conditions : GenAction { - private readonly GenCondition[] _conditions; + private GenCondition[] _conditions; public Conditions(params GenCondition[] conditions) => this._conditions = conditions; @@ -166,9 +148,9 @@ namespace Terraria.WorldBuilding public class OnlyWalls : GenAction { - private ushort[] _types; + private byte[] _types; - public OnlyWalls(params ushort[] types) => this._types = types; + public OnlyWalls(params byte[] types) => this._types = types; public override bool Apply(Point origin, int x, int y, params object[] args) { @@ -361,8 +343,8 @@ namespace Terraria.WorldBuilding public HasLiquid(int liquidLevel = -1, int liquidType = -1) { - this._liquidType = liquidType; this._liquidLevel = liquidLevel; + this._liquidType = liquidType; } public override bool Apply(Point origin, int x, int y, params object[] args) @@ -374,9 +356,9 @@ namespace Terraria.WorldBuilding public class SkipWalls : GenAction { - private ushort[] _types; + private byte[] _types; - public SkipWalls(params ushort[] types) => this._types = types; + public SkipWalls(params byte[] types) => this._types = types; public override bool Apply(Point origin, int x, int y, params object[] args) { @@ -396,12 +378,12 @@ namespace Terraria.WorldBuilding public class IsSolid : GenAction { - public override bool Apply(Point origin, int x, int y, params object[] args) => GenBase._tiles[x, y].active() && WorldGen.SolidOrSlopedTile(x, y) ? this.UnitApply(origin, x, y, args) : this.Fail(); + public override bool Apply(Point origin, int x, int y, params object[] args) => GenBase._tiles[x, y].active() && WorldGen.SolidTile(x, y) ? this.UnitApply(origin, x, y, args) : this.Fail(); } public class IsNotSolid : GenAction { - public override bool Apply(Point origin, int x, int y, params object[] args) => !GenBase._tiles[x, y].active() || !WorldGen.SolidOrSlopedTile(x, y) ? this.UnitApply(origin, x, y, args) : this.Fail(); + public override bool Apply(Point origin, int x, int y, params object[] args) => !GenBase._tiles[x, y].active() || !WorldGen.SolidTile(x, y) ? this.UnitApply(origin, x, y, args) : this.Fail(); } public class RectangleMask : GenAction diff --git a/WorldBuilding/Passes.cs b/World/Generation/Passes.cs similarity index 76% rename from WorldBuilding/Passes.cs rename to World/Generation/Passes.cs index 0a0268c..498282c 100644 --- a/WorldBuilding/Passes.cs +++ b/World/Generation/Passes.cs @@ -1,12 +1,10 @@ // Decompiled with JetBrains decompiler -// Type: Terraria.WorldBuilding.Passes -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Type: Terraria.World.Generation.Passes +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe -using Terraria.IO; - -namespace Terraria.WorldBuilding +namespace Terraria.World.Generation { public static class Passes { @@ -17,9 +15,7 @@ namespace Terraria.WorldBuilding { } - protected override void ApplyPass( - GenerationProgress progress, - GameConfiguration configuration) + public override void Apply(GenerationProgress progress) { for (int index1 = 0; index1 < GenBase._worldWidth; ++index1) { @@ -52,9 +48,7 @@ namespace Terraria.WorldBuilding public void SetCustomAction(GenBase.CustomPerUnitAction perUnit) => this._perUnit = perUnit; - protected override void ApplyPass( - GenerationProgress progress, - GameConfiguration configuration) + public override void Apply(GenerationProgress progress) { int count = this._count; while (count > 0) diff --git a/WorldBuilding/Searches.cs b/World/Generation/Searches.cs similarity index 93% rename from WorldBuilding/Searches.cs rename to World/Generation/Searches.cs index 90b0c40..abb1540 100644 --- a/WorldBuilding/Searches.cs +++ b/World/Generation/Searches.cs @@ -1,12 +1,12 @@ // Decompiled with JetBrains decompiler -// Type: Terraria.WorldBuilding.Searches -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Type: Terraria.World.Generation.Searches +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; -namespace Terraria.WorldBuilding +namespace Terraria.World.Generation { public static class Searches { diff --git a/WorldBuilding/ShapeData.cs b/World/Generation/ShapeData.cs similarity index 92% rename from WorldBuilding/ShapeData.cs rename to World/Generation/ShapeData.cs index 3bb89b1..b92033b 100644 --- a/WorldBuilding/ShapeData.cs +++ b/World/Generation/ShapeData.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler -// Type: Terraria.WorldBuilding.ShapeData -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Type: Terraria.World.Generation.ShapeData +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -10,7 +10,7 @@ using System.Collections.Generic; using System.Linq; using Terraria.DataStructures; -namespace Terraria.WorldBuilding +namespace Terraria.World.Generation { public class ShapeData { diff --git a/WorldBuilding/Shapes.cs b/World/Generation/Shapes.cs similarity index 85% rename from WorldBuilding/Shapes.cs rename to World/Generation/Shapes.cs index 615a16f..c40d3d8 100644 --- a/WorldBuilding/Shapes.cs +++ b/World/Generation/Shapes.cs @@ -1,13 +1,13 @@ // Decompiled with JetBrains decompiler -// Type: Terraria.WorldBuilding.Shapes -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Type: Terraria.World.Generation.Shapes +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; using System; -namespace Terraria.WorldBuilding +namespace Terraria.World.Generation { public static class Shapes { @@ -28,12 +28,6 @@ namespace Terraria.WorldBuilding this._verticalRadius = verticalRadius; } - public void SetRadius(int radius) - { - this._verticalRadius = radius; - this._horizontalRadius = radius; - } - public override bool Perform(Point origin, GenAction action) { int num1 = (this._horizontalRadius + 1) * (this._horizontalRadius + 1); @@ -123,19 +117,20 @@ namespace Terraria.WorldBuilding public class Rectangle : GenShape { - private Microsoft.Xna.Framework.Rectangle _area; + private int _width; + private int _height; - public Rectangle(Microsoft.Xna.Framework.Rectangle area) => this._area = area; - - public Rectangle(int width, int height) => this._area = new Microsoft.Xna.Framework.Rectangle(0, 0, width, height); - - public void SetArea(Microsoft.Xna.Framework.Rectangle area) => this._area = area; + public Rectangle(int width, int height) + { + this._width = width; + this._height = height; + } public override bool Perform(Point origin, GenAction action) { - for (int x = origin.X + this._area.Left; x < origin.X + this._area.Right; ++x) + for (int x = origin.X; x < origin.X + this._width; ++x) { - for (int y = origin.Y + this._area.Top; y < origin.Y + this._area.Bottom; ++y) + for (int y = origin.Y; y < origin.Y + this._height; ++y) { if (!this.UnitApply(action, origin, x, y) && this._quitOnFail) return false; @@ -159,7 +154,7 @@ namespace Terraria.WorldBuilding public override bool Perform(Point origin, GenAction action) { Vector2 start = new Vector2((float) (origin.X << 4), (float) (origin.Y << 4)); - return Utils.PlotTileTale(start, start + this._endOffset, this._width, (Utils.TileActionAttempt) ((x, y) => this.UnitApply(action, origin, x, y) || !this._quitOnFail)); + return Utils.PlotTileTale(start, start + this._endOffset, this._width, (Utils.PerLinePoint) ((x, y) => this.UnitApply(action, origin, x, y) || !this._quitOnFail)); } } diff --git a/WorldBuilding/SimpleStructure.cs b/World/Generation/SimpleStructure.cs similarity index 88% rename from WorldBuilding/SimpleStructure.cs rename to World/Generation/SimpleStructure.cs index 94b0757..f26ea8c 100644 --- a/WorldBuilding/SimpleStructure.cs +++ b/World/Generation/SimpleStructure.cs @@ -1,12 +1,12 @@ // Decompiled with JetBrains decompiler -// Type: Terraria.WorldBuilding.SimpleStructure -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Type: Terraria.World.Generation.SimpleStructure +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; -namespace Terraria.WorldBuilding +namespace Terraria.World.Generation { public class SimpleStructure : GenStructure { @@ -84,7 +84,7 @@ namespace Terraria.WorldBuilding return false; } } - structures.AddProtectedStructure(new Microsoft.Xna.Framework.Rectangle(origin.X, origin.Y, this._width, this._height)); + structures.AddStructure(new Microsoft.Xna.Framework.Rectangle(origin.X, origin.Y, this._width, this._height)); return true; } } diff --git a/World/Generation/StructureMap.cs b/World/Generation/StructureMap.cs new file mode 100644 index 0000000..bd75622 --- /dev/null +++ b/World/Generation/StructureMap.cs @@ -0,0 +1,47 @@ +// Decompiled with JetBrains decompiler +// Type: Terraria.World.Generation.StructureMap +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 +// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe + +using System.Collections.Generic; +using Terraria.ID; + +namespace Terraria.World.Generation +{ + public class StructureMap + { + private List _structures = new List(2048); + + public bool CanPlace(Microsoft.Xna.Framework.Rectangle area, int padding = 0) => this.CanPlace(area, TileID.Sets.GeneralPlacementTiles, padding); + + public bool CanPlace(Microsoft.Xna.Framework.Rectangle area, bool[] validTiles, int padding = 0) + { + if (area.X < 0 || area.Y < 0 || area.X + area.Width > Main.maxTilesX - 1 || area.Y + area.Height > Main.maxTilesY - 1) + return false; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(area.X - padding, area.Y - padding, area.Width + padding * 2, area.Height + padding * 2); + for (int index = 0; index < this._structures.Count; ++index) + { + if (rectangle.Intersects(this._structures[index])) + return false; + } + for (int x = rectangle.X; x < rectangle.X + rectangle.Width; ++x) + { + for (int y = rectangle.Y; y < rectangle.Y + rectangle.Height; ++y) + { + if (Main.tile[x, y].active()) + { + ushort type = Main.tile[x, y].type; + if (!validTiles[(int) type]) + return false; + } + } + } + return true; + } + + public void AddStructure(Microsoft.Xna.Framework.Rectangle area, int padding = 0) => this._structures.Add(new Microsoft.Xna.Framework.Rectangle(area.X - padding, area.Y - padding, area.Width + padding * 2, area.Height + padding * 2)); + + public void Reset() => this._structures.Clear(); + } +} diff --git a/WorldBuilding/WorldGenerator.cs b/World/Generation/WorldGenerator.cs similarity index 57% rename from WorldBuilding/WorldGenerator.cs rename to World/Generation/WorldGenerator.cs index 8cce00b..1664c60 100644 --- a/WorldBuilding/WorldGenerator.cs +++ b/World/Generation/WorldGenerator.cs @@ -1,28 +1,24 @@ // Decompiled with JetBrains decompiler -// Type: Terraria.WorldBuilding.WorldGenerator -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Type: Terraria.World.Generation.WorldGenerator +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using System.Collections.Generic; using System.Diagnostics; +using Terraria.GameContent.UI.States; +using Terraria.UI; using Terraria.Utilities; -namespace Terraria.WorldBuilding +namespace Terraria.World.Generation { public class WorldGenerator { - private readonly List _passes = new List(); + private List _passes = new List(); private float _totalLoadWeight; - private readonly int _seed; - private readonly WorldGenConfiguration _configuration; - public static GenerationProgress CurrentGenerationProgress; + private int _seed; - public WorldGenerator(int seed, WorldGenConfiguration configuration) - { - this._seed = seed; - this._configuration = configuration; - } + public WorldGenerator(int seed) => this._seed = seed; public void Append(GenPass pass) { @@ -38,19 +34,19 @@ namespace Terraria.WorldBuilding num += pass.Weight; if (progress == null) progress = new GenerationProgress(); - WorldGenerator.CurrentGenerationProgress = progress; progress.TotalWeight = num; + Main.menuMode = 888; + Main.MenuUI.SetState((UIState) new UIWorldLoad(progress)); foreach (GenPass pass in this._passes) { WorldGen._genRand = new UnifiedRandom(this._seed); Main.rand = new UnifiedRandom(this._seed); stopwatch.Start(); progress.Start(pass.Weight); - pass.Apply(progress, this._configuration.GetPassConfiguration(pass.Name)); + pass.Apply(progress); progress.End(); stopwatch.Reset(); } - WorldGenerator.CurrentGenerationProgress = (GenerationProgress) null; } } } diff --git a/WorldBuilding/WorldUtils.cs b/World/Generation/WorldUtils.cs similarity index 77% rename from WorldBuilding/WorldUtils.cs rename to World/Generation/WorldUtils.cs index 8e4b49b..00c42ce 100644 --- a/WorldBuilding/WorldUtils.cs +++ b/World/Generation/WorldUtils.cs @@ -1,31 +1,17 @@ // Decompiled with JetBrains decompiler -// Type: Terraria.WorldBuilding.WorldUtils -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Type: Terraria.World.Generation.WorldUtils +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; -using System; -namespace Terraria.WorldBuilding +namespace Terraria.World.Generation { public static class WorldUtils { - public static Microsoft.Xna.Framework.Rectangle ClampToWorld( - World world, - Microsoft.Xna.Framework.Rectangle tileRectangle) - { - int x = Math.Max(0, Math.Min(tileRectangle.Left, world.TileColumns)); - int y = Math.Max(0, Math.Min(tileRectangle.Top, world.TileRows)); - int num1 = Math.Max(0, Math.Min(tileRectangle.Right, world.TileColumns)); - int num2 = Math.Max(0, Math.Min(tileRectangle.Bottom, world.TileRows)); - return new Microsoft.Xna.Framework.Rectangle(x, y, num1 - x, num2 - y); - } - public static bool Gen(Point origin, GenShape shape, GenAction action) => shape.Perform(origin, action); - public static bool Gen(Point origin, GenShapeActionPair pair) => pair.Shape.Perform(origin, pair.Action); - public static bool Find(Point origin, GenSearch search, out Point result) { result = search.Find(origin); @@ -45,7 +31,7 @@ namespace Terraria.WorldBuilding public static void ClearWall(int x, int y, bool frameNeighbors = false) { - Main.tile[x, y].wall = (ushort) 0; + Main.tile[x, y].wall = (byte) 0; if (!frameNeighbors) return; WorldGen.SquareWallFrame(x + 1, y); @@ -90,7 +76,7 @@ namespace Terraria.WorldBuilding public static void DebugRegen() { WorldGen.clearWorld(); - WorldGen.GenerateWorld(Main.ActiveWorldFileData.Seed); + WorldGen.generateWorld(Main.ActiveWorldFileData.Seed); Main.NewText("World Regen Complete."); } diff --git a/WorldBuilding/GenPass.cs b/WorldBuilding/GenPass.cs deleted file mode 100644 index f7c39cb..0000000 --- a/WorldBuilding/GenPass.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.WorldBuilding.GenPass -// 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.IO; - -namespace Terraria.WorldBuilding -{ - public abstract class GenPass : GenBase - { - public string Name; - public float Weight; - private Action _onComplete; - private Action _onBegin; - - public GenPass(string name, float loadWeight) - { - this.Name = name; - this.Weight = loadWeight; - } - - protected abstract void ApplyPass(GenerationProgress progress, GameConfiguration configuration); - - public void Apply(GenerationProgress progress, GameConfiguration configuration) - { - if (this._onBegin != null) - this._onBegin(this); - this.ApplyPass(progress, configuration); - if (this._onComplete == null) - return; - this._onComplete(this); - } - - public GenPass OnBegin(Action beginAction) - { - this._onBegin = beginAction; - return this; - } - - public GenPass OnComplete(Action completionAction) - { - this._onComplete = completionAction; - return this; - } - } -} diff --git a/WorldBuilding/GenShapeActionPair.cs b/WorldBuilding/GenShapeActionPair.cs deleted file mode 100644 index 6e1e473..0000000 --- a/WorldBuilding/GenShapeActionPair.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.WorldBuilding.GenShapeActionPair -// 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.WorldBuilding -{ - public struct GenShapeActionPair - { - public readonly GenShape Shape; - public readonly GenAction Action; - - public GenShapeActionPair(GenShape shape, GenAction action) - { - this.Shape = shape; - this.Action = action; - } - } -} diff --git a/WorldBuilding/MicroBiome.cs b/WorldBuilding/MicroBiome.cs deleted file mode 100644 index be6f0f7..0000000 --- a/WorldBuilding/MicroBiome.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.WorldBuilding.MicroBiome -// 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.WorldBuilding -{ - public abstract class MicroBiome : GenStructure - { - } -} diff --git a/WorldBuilding/StructureMap.cs b/WorldBuilding/StructureMap.cs deleted file mode 100644 index 8937296..0000000 --- a/WorldBuilding/StructureMap.cs +++ /dev/null @@ -1,88 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.WorldBuilding.StructureMap -// 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; -using System; -using System.Collections.Generic; -using System.Linq; -using Terraria.ID; - -namespace Terraria.WorldBuilding -{ - public class StructureMap - { - private readonly List _structures = new List(2048); - private readonly List _protectedStructures = new List(2048); - private readonly object _lock = new object(); - - public bool CanPlace(Microsoft.Xna.Framework.Rectangle area, int padding = 0) => this.CanPlace(area, TileID.Sets.GeneralPlacementTiles, padding); - - public bool CanPlace(Microsoft.Xna.Framework.Rectangle area, bool[] validTiles, int padding = 0) - { - lock (this._lock) - { - if (area.X < 0 || area.Y < 0 || area.X + area.Width > Main.maxTilesX - 1 || area.Y + area.Height > Main.maxTilesY - 1) - return false; - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(area.X - padding, area.Y - padding, area.Width + padding * 2, area.Height + padding * 2); - for (int index = 0; index < this._protectedStructures.Count; ++index) - { - if (rectangle.Intersects(this._protectedStructures[index])) - return false; - } - for (int x = rectangle.X; x < rectangle.X + rectangle.Width; ++x) - { - for (int y = rectangle.Y; y < rectangle.Y + rectangle.Height; ++y) - { - if (Main.tile[x, y].active()) - { - ushort type = Main.tile[x, y].type; - if (!validTiles[(int) type]) - return false; - } - } - } - return true; - } - } - - public Microsoft.Xna.Framework.Rectangle GetBoundingBox() - { - lock (this._lock) - { - if (this._structures.Count == 0) - return Microsoft.Xna.Framework.Rectangle.Empty; - Point point1 = new Point(this._structures.Min((Func) (rect => rect.Left)), this._structures.Min((Func) (rect => rect.Top))); - Point point2 = new Point(this._structures.Max((Func) (rect => rect.Right)), this._structures.Max((Func) (rect => rect.Bottom))); - return new Microsoft.Xna.Framework.Rectangle(point1.X, point1.Y, point2.X - point1.X, point2.Y - point1.Y); - } - } - - public void AddStructure(Microsoft.Xna.Framework.Rectangle area, int padding = 0) - { - lock (this._lock) - { - area.Inflate(padding, padding); - this._structures.Add(area); - } - } - - public void AddProtectedStructure(Microsoft.Xna.Framework.Rectangle area, int padding = 0) - { - lock (this._lock) - { - area.Inflate(padding, padding); - this._structures.Add(area); - this._protectedStructures.Add(area); - } - } - - public void Reset() - { - lock (this._lock) - this._protectedStructures.Clear(); - } - } -} diff --git a/WorldBuilding/TileFont.cs b/WorldBuilding/TileFont.cs deleted file mode 100644 index 635839b..0000000 --- a/WorldBuilding/TileFont.cs +++ /dev/null @@ -1,838 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.WorldBuilding.TileFont -// 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; -using System; -using System.Collections.Generic; - -namespace Terraria.WorldBuilding -{ - public class TileFont - { - private static readonly Dictionary MicroFont = new Dictionary() - { - { - 'A', - new byte[5] - { - (byte) 124, - (byte) 68, - (byte) 68, - (byte) 124, - (byte) 68 - } - }, - { - 'B', - new byte[5] - { - (byte) 124, - (byte) 68, - (byte) 120, - (byte) 68, - (byte) 124 - } - }, - { - 'C', - new byte[5] - { - (byte) 124, - (byte) 64, - (byte) 64, - (byte) 64, - (byte) 124 - } - }, - { - 'D', - new byte[5] - { - (byte) 120, - (byte) 68, - (byte) 68, - (byte) 68, - (byte) 120 - } - }, - { - 'E', - new byte[5] - { - (byte) 124, - (byte) 64, - (byte) 120, - (byte) 64, - (byte) 124 - } - }, - { - 'F', - new byte[5] - { - (byte) 124, - (byte) 64, - (byte) 112, - (byte) 64, - (byte) 64 - } - }, - { - 'G', - new byte[5] - { - (byte) 124, - (byte) 64, - (byte) 76, - (byte) 68, - (byte) 124 - } - }, - { - 'H', - new byte[5] - { - (byte) 68, - (byte) 68, - (byte) 124, - (byte) 68, - (byte) 68 - } - }, - { - 'I', - new byte[5] - { - (byte) 124, - (byte) 16, - (byte) 16, - (byte) 16, - (byte) 124 - } - }, - { - 'J', - new byte[5] - { - (byte) 12, - (byte) 4, - (byte) 4, - (byte) 68, - (byte) 124 - } - }, - { - 'K', - new byte[5] - { - (byte) 68, - (byte) 72, - (byte) 112, - (byte) 72, - (byte) 68 - } - }, - { - 'L', - new byte[5] - { - (byte) 64, - (byte) 64, - (byte) 64, - (byte) 64, - (byte) 124 - } - }, - { - 'M', - new byte[5] - { - (byte) 68, - (byte) 108, - (byte) 84, - (byte) 68, - (byte) 68 - } - }, - { - 'N', - new byte[5] - { - (byte) 68, - (byte) 100, - (byte) 84, - (byte) 76, - (byte) 68 - } - }, - { - 'O', - new byte[5] - { - (byte) 124, - (byte) 68, - (byte) 68, - (byte) 68, - (byte) 124 - } - }, - { - 'P', - new byte[5] - { - (byte) 120, - (byte) 68, - (byte) 120, - (byte) 64, - (byte) 64 - } - }, - { - 'Q', - new byte[5] - { - (byte) 124, - (byte) 68, - (byte) 68, - (byte) 124, - (byte) 16 - } - }, - { - 'R', - new byte[5] - { - (byte) 120, - (byte) 68, - (byte) 120, - (byte) 68, - (byte) 68 - } - }, - { - 'S', - new byte[5] - { - (byte) 124, - (byte) 64, - (byte) 124, - (byte) 4, - (byte) 124 - } - }, - { - 'T', - new byte[5] - { - (byte) 124, - (byte) 16, - (byte) 16, - (byte) 16, - (byte) 16 - } - }, - { - 'U', - new byte[5] - { - (byte) 68, - (byte) 68, - (byte) 68, - (byte) 68, - (byte) 124 - } - }, - { - 'V', - new byte[5] - { - (byte) 68, - (byte) 68, - (byte) 40, - (byte) 40, - (byte) 16 - } - }, - { - 'W', - new byte[5] - { - (byte) 68, - (byte) 68, - (byte) 84, - (byte) 84, - (byte) 40 - } - }, - { - 'X', - new byte[5] - { - (byte) 68, - (byte) 40, - (byte) 16, - (byte) 40, - (byte) 68 - } - }, - { - 'Y', - new byte[5] - { - (byte) 68, - (byte) 68, - (byte) 40, - (byte) 16, - (byte) 16 - } - }, - { - 'Z', - new byte[5] - { - (byte) 124, - (byte) 8, - (byte) 16, - (byte) 32, - (byte) 124 - } - }, - { - 'a', - new byte[5] - { - (byte) 56, - (byte) 4, - (byte) 60, - (byte) 68, - (byte) 60 - } - }, - { - 'b', - new byte[5] - { - (byte) 64, - (byte) 120, - (byte) 68, - (byte) 68, - (byte) 120 - } - }, - { - 'c', - new byte[5] - { - (byte) 56, - (byte) 68, - (byte) 64, - (byte) 68, - (byte) 56 - } - }, - { - 'd', - new byte[5] - { - (byte) 4, - (byte) 60, - (byte) 68, - (byte) 68, - (byte) 60 - } - }, - { - 'e', - new byte[5] - { - (byte) 56, - (byte) 68, - (byte) 124, - (byte) 64, - (byte) 60 - } - }, - { - 'f', - new byte[5] - { - (byte) 28, - (byte) 32, - (byte) 120, - (byte) 32, - (byte) 32 - } - }, - { - 'g', - new byte[5] - { - (byte) 56, - (byte) 68, - (byte) 60, - (byte) 4, - (byte) 120 - } - }, - { - 'h', - new byte[5] - { - (byte) 64, - (byte) 64, - (byte) 120, - (byte) 68, - (byte) 68 - } - }, - { - 'i', - new byte[5] - { - (byte) 16, - (byte) 0, - (byte) 16, - (byte) 16, - (byte) 16 - } - }, - { - 'j', - new byte[5] - { - (byte) 4, - (byte) 4, - (byte) 4, - (byte) 4, - (byte) 120 - } - }, - { - 'k', - new byte[5] - { - (byte) 64, - (byte) 72, - (byte) 112, - (byte) 72, - (byte) 68 - } - }, - { - 'l', - new byte[5] - { - (byte) 64, - (byte) 64, - (byte) 64, - (byte) 64, - (byte) 60 - } - }, - { - 'm', - new byte[5] - { - (byte) 40, - (byte) 84, - (byte) 84, - (byte) 84, - (byte) 84 - } - }, - { - 'n', - new byte[5] - { - (byte) 120, - (byte) 68, - (byte) 68, - (byte) 68, - (byte) 68 - } - }, - { - 'o', - new byte[5] - { - (byte) 56, - (byte) 68, - (byte) 68, - (byte) 68, - (byte) 56 - } - }, - { - 'p', - new byte[5] - { - (byte) 56, - (byte) 68, - (byte) 68, - (byte) 120, - (byte) 64 - } - }, - { - 'q', - new byte[5] - { - (byte) 56, - (byte) 68, - (byte) 68, - (byte) 60, - (byte) 4 - } - }, - { - 'r', - new byte[5] - { - (byte) 88, - (byte) 100, - (byte) 64, - (byte) 64, - (byte) 64 - } - }, - { - 's', - new byte[5] - { - (byte) 60, - (byte) 64, - (byte) 56, - (byte) 4, - (byte) 120 - } - }, - { - 't', - new byte[5] - { - (byte) 64, - (byte) 112, - (byte) 64, - (byte) 68, - (byte) 56 - } - }, - { - 'u', - new byte[5] - { - (byte) 0, - (byte) 68, - (byte) 68, - (byte) 68, - (byte) 56 - } - }, - { - 'v', - new byte[5] - { - (byte) 0, - (byte) 68, - (byte) 68, - (byte) 40, - (byte) 16 - } - }, - { - 'w', - new byte[5] - { - (byte) 84, - (byte) 84, - (byte) 84, - (byte) 84, - (byte) 40 - } - }, - { - 'x', - new byte[5] - { - (byte) 68, - (byte) 68, - (byte) 56, - (byte) 68, - (byte) 68 - } - }, - { - 'y', - new byte[5] - { - (byte) 68, - (byte) 68, - (byte) 60, - (byte) 4, - (byte) 120 - } - }, - { - 'z', - new byte[5] - { - (byte) 124, - (byte) 4, - (byte) 56, - (byte) 64, - (byte) 124 - } - }, - { - '0', - new byte[5] - { - (byte) 124, - (byte) 76, - (byte) 84, - (byte) 100, - (byte) 124 - } - }, - { - '1', - new byte[5] - { - (byte) 16, - (byte) 48, - (byte) 16, - (byte) 16, - (byte) 56 - } - }, - { - '2', - new byte[5] - { - (byte) 120, - (byte) 4, - (byte) 56, - (byte) 64, - (byte) 124 - } - }, - { - '3', - new byte[5] - { - (byte) 124, - (byte) 4, - (byte) 56, - (byte) 4, - (byte) 124 - } - }, - { - '4', - new byte[5] - { - (byte) 64, - (byte) 64, - (byte) 80, - (byte) 124, - (byte) 16 - } - }, - { - '5', - new byte[5] - { - (byte) 124, - (byte) 64, - (byte) 120, - (byte) 4, - (byte) 120 - } - }, - { - '6', - new byte[5] - { - (byte) 124, - (byte) 64, - (byte) 124, - (byte) 68, - (byte) 124 - } - }, - { - '7', - new byte[5] - { - (byte) 124, - (byte) 4, - (byte) 8, - (byte) 16, - (byte) 16 - } - }, - { - '8', - new byte[5] - { - (byte) 124, - (byte) 68, - (byte) 124, - (byte) 68, - (byte) 124 - } - }, - { - '9', - new byte[5] - { - (byte) 124, - (byte) 68, - (byte) 124, - (byte) 4, - (byte) 124 - } - }, - { - '-', - new byte[5] - { - (byte) 0, - (byte) 0, - (byte) 124, - (byte) 0, - (byte) 0 - } - }, - { - ' ', - new byte[5] - } - }; - - public static void DrawString(Point start, string text, TileFont.DrawMode mode) - { - Point position = start; - foreach (char key in text) - { - if (key == '\n') - { - position.X = start.X; - position.Y += 6; - } - byte[] charData; - if (TileFont.MicroFont.TryGetValue(key, out charData)) - { - TileFont.DrawChar(position, charData, mode); - position.X += 6; - } - } - } - - private static void DrawChar(Point position, byte[] charData, TileFont.DrawMode mode) - { - if (mode.HasBackground) - { - for (int index1 = -1; index1 < charData.Length + 1; ++index1) - { - for (int index2 = -1; index2 < 6; ++index2) - { - Main.tile[position.X + index2, position.Y + index1].ResetToType(mode.BackgroundTile); - WorldGen.TileFrame(position.X + index2, position.Y + index1); - } - } - } - for (int index3 = 0; index3 < charData.Length; ++index3) - { - int num = (int) charData[index3] << 1; - for (int index4 = 0; index4 < 5; ++index4) - { - if ((num & 128) == 128) - { - Main.tile[position.X + index4, position.Y + index3].ResetToType(mode.ForegroundTile); - WorldGen.TileFrame(position.X + index4, position.Y + index3); - } - num <<= 1; - } - } - } - - public static Point MeasureString(string text) - { - Point zero = Point.Zero; - Point point1 = zero; - Point point2 = new Point(0, 5); - foreach (char key in text) - { - if (key == '\n') - { - point1.X = zero.X; - point1.Y += 6; - point2.Y = point1.Y + 5; - } - if (TileFont.MicroFont.TryGetValue(key, out byte[] _)) - { - point1.X += 6; - point2.X = Math.Max(point2.X, point1.X - 1); - } - } - return point2; - } - - public static void HLineLabel( - Point start, - int width, - string text, - TileFont.DrawMode mode, - bool rightSideText = false) - { - Point point = TileFont.MeasureString(text); - for (int x = start.X; x < start.X + width; ++x) - { - Main.tile[x, start.Y].ResetToType(mode.ForegroundTile); - WorldGen.TileFrame(x, start.Y); - } - TileFont.DrawString(new Point(rightSideText ? start.X + width + 1 : start.X - point.X - 1, start.Y - point.Y / 2), text, mode); - } - - public static void VLineLabel( - Point start, - int height, - string text, - TileFont.DrawMode mode, - bool bottomText = false) - { - Point point = TileFont.MeasureString(text); - for (int y = start.Y; y < start.Y + height; ++y) - { - Main.tile[start.X, y].ResetToType(mode.ForegroundTile); - WorldGen.TileFrame(start.X, y); - } - TileFont.DrawString(new Point(start.X - point.X / 2, bottomText ? start.Y + height + 1 : start.Y - point.Y - 1), text, mode); - } - - public struct DrawMode - { - public readonly ushort ForegroundTile; - public readonly ushort BackgroundTile; - public readonly bool HasBackground; - - public DrawMode(ushort foregroundTile) - { - this.ForegroundTile = foregroundTile; - this.HasBackground = false; - this.BackgroundTile = (ushort) 0; - } - - public DrawMode(ushort foregroundTile, ushort backgroundTile) - { - this.ForegroundTile = foregroundTile; - this.BackgroundTile = backgroundTile; - this.HasBackground = true; - } - } - } -} diff --git a/WorldBuilding/WorldGenConfiguration.cs b/WorldBuilding/WorldGenConfiguration.cs deleted file mode 100644 index 5f5084c..0000000 --- a/WorldBuilding/WorldGenConfiguration.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.WorldBuilding.WorldGenConfiguration -// 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 Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using System.IO; -using System.Reflection; -using Terraria.IO; - -namespace Terraria.WorldBuilding -{ - public class WorldGenConfiguration : GameConfiguration - { - private readonly JObject _biomeRoot; - private readonly JObject _passRoot; - - public WorldGenConfiguration(JObject configurationRoot) - : base(configurationRoot) - { - this._biomeRoot = (JObject) configurationRoot["Biomes"] ?? new JObject(); - this._passRoot = (JObject) configurationRoot["Passes"] ?? new JObject(); - } - - public T CreateBiome() where T : MicroBiome, new() => this.CreateBiome(typeof (T).Name); - - public T CreateBiome(string name) where T : MicroBiome, new() - { - JToken jtoken; - return this._biomeRoot.TryGetValue(name, ref jtoken) ? jtoken.ToObject() : new T(); - } - - public GameConfiguration GetPassConfiguration(string name) - { - JToken jtoken; - return this._passRoot.TryGetValue(name, ref jtoken) ? new GameConfiguration((JObject) jtoken) : new GameConfiguration(new JObject()); - } - - public static WorldGenConfiguration FromEmbeddedPath(string path) - { - using (Stream manifestResourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(path)) - { - using (StreamReader streamReader = new StreamReader(manifestResourceStream)) - return new WorldGenConfiguration(JsonConvert.DeserializeObject(streamReader.ReadToEnd())); - } - } - } -} diff --git a/WorldBuilding/WorldGenRange.cs b/WorldBuilding/WorldGenRange.cs deleted file mode 100644 index a57c888..0000000 --- a/WorldBuilding/WorldGenRange.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Decompiled with JetBrains decompiler -// Type: Terraria.WorldBuilding.WorldGenRange -// 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 Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using Terraria.Utilities; - -namespace Terraria.WorldBuilding -{ - public class WorldGenRange - { - public static readonly WorldGenRange Empty = new WorldGenRange(0, 0); - [JsonProperty("Min")] - public readonly int Minimum; - [JsonProperty("Max")] - public readonly int Maximum; - [JsonProperty] - [JsonConverter(typeof (StringEnumConverter))] - public readonly WorldGenRange.ScalingMode ScaleWith; - - public int ScaledMinimum => this.ScaleValue(this.Minimum); - - public int ScaledMaximum => this.ScaleValue(this.Maximum); - - public WorldGenRange(int minimum, int maximum) - { - this.Minimum = minimum; - this.Maximum = maximum; - } - - public int GetRandom(UnifiedRandom random) => random.Next(this.ScaledMinimum, this.ScaledMaximum + 1); - - private int ScaleValue(int value) - { - float num = 1f; - switch (this.ScaleWith) - { - case WorldGenRange.ScalingMode.None: - num = 1f; - break; - case WorldGenRange.ScalingMode.WorldArea: - num = (float) (Main.maxTilesX * Main.maxTilesY) / 5040000f; - break; - case WorldGenRange.ScalingMode.WorldWidth: - num = (float) Main.maxTilesX / 4200f; - break; - } - return (int) ((double) num * (double) value); - } - - public enum ScalingMode - { - None, - WorldArea, - WorldWidth, - } - } -} diff --git a/WorldGen.cs b/WorldGen.cs index a0f4451..9e92380 100644 --- a/WorldGen.cs +++ b/WorldGen.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.WorldGen -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; @@ -9,28 +9,22 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.Threading; -using System.Threading.Tasks; -using Terraria.Audio; -using Terraria.Chat; using Terraria.DataStructures; using Terraria.Enums; using Terraria.GameContent; using Terraria.GameContent.Achievements; using Terraria.GameContent.Biomes; -using Terraria.GameContent.Creative; using Terraria.GameContent.Events; using Terraria.GameContent.Generation; using Terraria.GameContent.Tile_Entities; -using Terraria.GameContent.UI.States; using Terraria.Graphics.Capture; using Terraria.ID; using Terraria.IO; using Terraria.Localization; using Terraria.Map; using Terraria.ObjectData; -using Terraria.UI; using Terraria.Utilities; -using Terraria.WorldBuilding; +using Terraria.World.Generation; namespace Terraria { @@ -39,9 +33,8 @@ namespace Terraria public static TownRoomManager TownManager = new TownRoomManager(); private static int lAltarX; private static int lAltarY; - private static Queue> _postGenActions = new Queue>(); - public static int tileReframeCount; - public static bool noMapUpdate; + public static int tileReframeCount = 0; + public static bool noMapUpdate = false; public static double worldSurfaceLow; public static int tLeft; public static int tRight; @@ -49,102 +42,99 @@ namespace Terraria public static int tBottom; public static int tRooms; public static int[] mossType = new int[3]; - public static ushort neonMossType; + public static int c = 0; + public static int m = 0; + public static int a = 0; + public static int co = 0; + public static int ir = 0; + public static int si = 0; + public static int go = 0; public static int copperBar = 20; public static int ironBar = 22; public static int silverBar = 21; public static int goldBar = 19; - private const int NUM_SEASHELL_STYLES = 2; - public static int treeBG1; - public static int treeBG2; - public static int treeBG3; - public static int treeBG4; - public static int corruptBG; - public static int jungleBG; - public static int snowBG; - public static int hallowBG; - public static int crimsonBG; - public static int desertBG; - public static int oceanBG; - public static int mushroomBG; - public static int underworldBG; - private static ushort crackedType = 481; - public static int oceanDistance = 250; - public static int beachDistance = 380; - public static bool skipDesertTileCheck = false; - public static bool crimson; - public static ushort mossTile = 179; - public static ushort mossWall = 54; + public static ushort CopperTierOre = 7; + public static ushort IronTierOre = 6; + public static ushort SilverTierOre = 9; + public static ushort GoldTierOre = 8; + public static int treeBG = 0; + public static int corruptBG = 0; + public static int jungleBG = 0; + public static int snowBG = 0; + public static int hallowBG = 0; + public static int crimsonBG = 0; + public static int desertBG = 0; + public static int oceanBG = 0; + public static int oreTier1 = -1; + public static int oreTier2 = -1; + public static int oreTier3 = -1; + public static bool crimson = false; + public static byte mossTile = 179; + public static byte mossWall = 54; public static bool[] gem = new bool[6]; - public static int[] tileCounts = new int[623]; - public static int totalEvil; - public static int totalBlood; - public static int totalGood; - public static int totalSolid; - public static int totalEvil2; - public static int totalBlood2; - public static int totalGood2; - public static int totalSolid2; - public static byte tEvil; - public static byte tBlood; - public static byte tGood; - public static string currentWorldSeed; - public static bool dungeonLake = false; - public static int totalX; - public static int totalD; - public static bool IsGeneratingHardMode; + public static int[] tileCounts = new int[470]; + public static int totalEvil = 0; + public static int totalBlood = 0; + public static int totalGood = 0; + public static int totalSolid = 0; + public static int totalEvil2 = 0; + public static int totalBlood2 = 0; + public static int totalGood2 = 0; + public static int totalSolid2 = 0; + public static byte tEvil = 0; + public static byte tBlood = 0; + public static byte tGood = 0; + public static int totalX = 0; + public static int totalD = 0; + public static bool IsGeneratingHardMode = false; private static Vector2[] heartPos = new Vector2[100]; - private static int heartCount; - public static int maxTreeShakes = 200; - public static int numTreeShakes = 0; - public static int[] treeShakeX = new int[WorldGen.maxTreeShakes]; - public static int[] treeShakeY = new int[WorldGen.maxTreeShakes]; + private static int heartCount = 0; public static int lavaLine; public static int waterLine; - public static bool noTileActions; - public static bool spawnEye; - public static int spawnHardBoss; - public static int numLarva; + public static bool noTileActions = false; + public static bool spawnEye = false; + public static int spawnHardBoss = 0; + public static int numLarva = 0; public static int[] larvaX = new int[100]; public static int[] larvaY = new int[100]; - public static volatile bool gen; - public static bool shadowOrbSmashed; - public static int shadowOrbCount; - public static int altarCount; - public static bool spawnMeteor; + public static bool gen = false; + public static bool shadowOrbSmashed = false; + public static int shadowOrbCount = 0; + public static int altarCount = 0; + public static bool spawnMeteor = false; public static bool loadFailed = false; public static bool loadSuccess = false; - public static bool worldCleared; - public static bool worldBackup; + public static bool worldCleared = false; + public static bool worldBackup = false; public static bool loadBackup = false; - private static int lastMaxTilesX; - private static int lastMaxTilesY; - private static bool mergeUp; - private static bool mergeDown; - private static bool mergeLeft; - private static bool mergeRight; - private static bool stopDrops; - public static bool mudWall; - private static int grassSpread; - public static bool noLiquidCheck; - public static bool AllowedToSpreadInfections = true; + private static int lastMaxTilesX = 0; + private static int lastMaxTilesY = 0; + public static bool saveLock = false; + private static bool mergeUp = false; + private static bool mergeDown = false; + private static bool mergeLeft = false; + private static bool mergeRight = false; + private static bool stopDrops = false; + private static bool mudWall = false; + private static int grassSpread = 0; + public static bool noLiquidCheck = false; [ThreadStatic] public static UnifiedRandom _genRand; [ThreadStatic] public static int _genRandSeed = -2; public static int _lastSeed; public static string statusText = ""; - public static bool destroyObject; - public static int spawnDelay; - public static int prioritizedTownNPCType; - public static int numTileCount; + public static bool destroyObject = false; + public static int spawnDelay = 0; + public static int prioritizedTownNPC = 0; + public static int numTileCount = 0; public static int maxTileCount = 3500; public static int maxWallOut2 = 5000; - public static Dictionary CountedTiles = new Dictionary(WorldGen.maxTileCount); - public static int lavaCount; - public static int iceCount; - public static int rockCount; - public static int shroomCount; + public static int[] countX = new int[WorldGen.maxTileCount]; + public static int[] countY = new int[WorldGen.maxTileCount]; + public static int lavaCount = 0; + public static int iceCount = 0; + public static int rockCount = 0; public static int maxRoomTiles = 750; public static int numRoomTiles; public static int[] roomX = new int[WorldGen.maxRoomTiles]; @@ -157,15 +147,15 @@ namespace Terraria public static int roomY1; public static int roomY2; public static bool canSpawn; - public static bool[] houseTile = new bool[623]; - public static int bestX; - public static int bestY; - public static int hiScore; + public static bool[] houseTile = new bool[470]; + public static int bestX = 0; + public static int bestY = 0; + public static int hiScore = 0; public static int dungeonX; public static int dungeonY; public static Vector2 lastDungeonHall = Vector2.Zero; public static int maxDRooms = 100; - public static int numDRooms; + public static int numDRooms = 0; public static int[] dRoomX = new int[WorldGen.maxDRooms]; public static int[] dRoomY = new int[WorldGen.maxDRooms]; public static int[] dRoomSize = new int[WorldGen.maxDRooms]; @@ -175,19 +165,18 @@ namespace Terraria private static int[] dRoomT = new int[WorldGen.maxDRooms]; private static int[] dRoomB = new int[WorldGen.maxDRooms]; private static int numDDoors; - private static int[] DDoorX = new int[500]; - private static int[] DDoorY = new int[500]; - private static int[] DDoorPos = new int[500]; - private static int numDungeonPlatforms; - private static int[] dungeonPlatformX = new int[500]; - private static int[] dungeonPlatformY = new int[500]; - private static bool generatedShadowKey; - private static int JungleItemCount; + private static int[] DDoorX = new int[300]; + private static int[] DDoorY = new int[300]; + private static int[] DDoorPos = new int[300]; + private static int numDPlats; + private static int[] DPlatX = new int[300]; + private static int[] DPlatY = new int[300]; + private static int JungleItemCount = 0; private static int[] JChestX = new int[100]; private static int[] JChestY = new int[100]; - private static int numJChests; - public static int dEnteranceX; - public static bool dSurface; + private static int numJChests = 0; + public static int dEnteranceX = 0; + public static bool dSurface = false; private static double dxStrength1; private static double dyStrength1; private static double dxStrength2; @@ -196,42 +185,17 @@ namespace Terraria private static int dMaxX; private static int dMinY; private static int dMaxY; - private static int numIslandHouses; - private static int houseCount; + private static int numIslandHouses = 0; + private static int houseCount = 0; private static bool[] skyLake = new bool[30]; - private static int[] floatingIslandHouseX = new int[30]; - private static int[] floatingIslandHouseY = new int[30]; - private static int[] floatingIslandStyle = new int[30]; - private static int numMCaves; + private static int[] fihX = new int[30]; + private static int[] fihY = new int[30]; + private static int numMCaves = 0; private static int[] mCaveX = new int[30]; private static int[] mCaveY = new int[30]; - public static int WorldGenParam_Evil = -1; - private static int maxTunnels = 50; - private static int numTunnels; - private static int[] tunnelX = new int[WorldGen.maxTunnels]; - private static int maxOrePatch = 50; - private static int numOrePatch; - private static int[] orePatchX = new int[WorldGen.maxOrePatch]; - private static int maxOasis = 20; - private static int numOasis = 0; - private static Vector2[] oasisPosition = new Vector2[WorldGen.maxOasis]; - private static int[] oasisWidth = new int[WorldGen.maxOasis]; - private static int oasisHeight = 20; - private static int maxMushroomBiomes = 50; - private static int numMushroomBiomes = 0; - private static Vector2[] mushroomBiomesPosition = new Vector2[WorldGen.maxMushroomBiomes]; - private static int maxLakes = 50; - private static int numLakes = 0; - private static int[] LakeX = new int[WorldGen.maxLakes]; - private static int maxOceanCaveTreasure = 2; - private static int numOceanCaveTreasure = 0; - private static Point[] oceanCaveTreasure = new Point[WorldGen.maxOceanCaveTreasure]; - private static int cactusWaterWidth = 50; - private static int cactusWaterHeight = 25; - private static int cactusWaterLimit = 25; - private static int JungleX; - private static int hellChest; - private static int[] hellChestItem = new int[7]; + private static int JungleX = 0; + private static int hellChest = 0; + private static int[] hellChestItem = new int[5]; private static bool roomTorch; private static bool roomDoor; private static bool roomChair; @@ -247,32 +211,15 @@ namespace Terraria 18 }); public static Microsoft.Xna.Framework.Rectangle UndergroundDesertLocation = Microsoft.Xna.Framework.Rectangle.Empty; - public static Microsoft.Xna.Framework.Rectangle UndergroundDesertHiveLocation = Microsoft.Xna.Framework.Rectangle.Empty; - public static MysticLogFairiesEvent mysticLogsEvent = new MysticLogFairiesEvent(); - private static bool currentlyTryingToUseAlternateHousingSpot; - private static int sharedRoomX; + private static bool currentlyTryingToUseAlternateHousingSpot = false; public static TownNPCRoomCheckFailureReason roomCheckFailureReason = TownNPCRoomCheckFailureReason.None; - public static bool generatingWorld = false; private static int[,] trapDiag = new int[4, 2]; - private static int tileCounterNum; + private static int tileCounterNum = 0; private static int tileCounterMax = 20; private static int[] tileCounterX = new int[WorldGen.tileCounterMax]; private static int[] tileCounterY = new int[WorldGen.tileCounterMax]; private static WorldGenerator _generator; - public static int SmallConsecutivesFound = 0; - public static int SmallConsecutivesEliminated = 0; - public static bool drunkWorldGen = false; - public static bool getGoodWorldGen = false; - public static bool drunkWorldGenText = false; - public static bool placingTraps = false; - public const bool USE_FRAMING_SKIP_FOR_UNIMPORTANT_TILES_IN_WORLDGEN = false; - public static bool notTheBees = false; - private static int catTailDistance = 8; - public static TreeTopsInfo TreeTops = new TreeTopsInfo(); - public static BackgroundChangeFlashInfo BackgroundsCache = new BackgroundChangeFlashInfo(); - private static bool fossilBreak = false; - private const bool BUBBLES_SOLID_STATE_FOR_HOUSING = true; - private static bool skipFramingDuringGen = false; + public static int WorldGenParam_Evil = -1; public static UnifiedRandom genRand { @@ -310,20 +257,6 @@ namespace Terraria point16List.Add(new Point16(105, 72)); point16List.Add(new Point16(105, 73)); point16List.Add(new Point16(105, 75)); - point16List.Add(new Point16(105, 51)); - point16List.Add(new Point16(105, 52)); - point16List.Add(new Point16(105, 53)); - point16List.Add(new Point16(105, 54)); - point16List.Add(new Point16(105, 55)); - point16List.Add(new Point16(105, 56)); - point16List.Add(new Point16(105, 57)); - point16List.Add(new Point16(105, 58)); - point16List.Add(new Point16(105, 59)); - point16List.Add(new Point16(105, 60)); - point16List.Add(new Point16(105, 61)); - point16List.Add(new Point16(105, 62)); - point16List.Add(new Point16(105, 77)); - point16List.Add(new Point16(105, 78)); if (Main.expertMode) { point16List.Add(new Point16(105, 67)); @@ -353,64 +286,6 @@ namespace Terraria } } - public static bool EmptyLiquid(int x, int y) - { - if (!WorldGen.InWorld(x, y)) - return false; - Tile tile = Main.tile[x, y]; - if (tile == null) - return false; - int num = (int) tile.liquidType(); - if (tile.nactive() && Main.tileSolid[(int) tile.type] && !Main.tileSolidTop[(int) tile.type]) - return false; - tile.Clear(TileDataType.Liquid); - WorldGen.SquareTileFrame(x, y, false); - if (Main.netMode == 1) - NetMessage.sendWater(x, y); - else - Liquid.AddWater(x, y); - return true; - } - - public static bool PlaceLiquid(int x, int y, byte liquidType, byte amount) - { - if (!WorldGen.InWorld(x, y)) - return false; - Tile tile = Main.tile[x, y]; - if (tile == null) - return false; - byte num1 = tile.liquidType(); - if (tile.nactive() && Main.tileSolid[(int) tile.type] && !Main.tileSolidTop[(int) tile.type]) - return false; - if (tile.liquid == (byte) 0 || (int) liquidType == (int) num1) - { - tile.liquidType((int) liquidType); - if ((int) amount + (int) tile.liquid > (int) byte.MaxValue) - amount = (byte) ((uint) byte.MaxValue - (uint) tile.liquid); - tile.liquid += amount; - WorldGen.SquareTileFrame(x, y); - if (Main.netMode != 0) - NetMessage.sendWater(x, y); - return true; - } - ushort num2 = 0; - if (liquidType == (byte) 0 && num1 == (byte) 1 || liquidType == (byte) 1 && num1 == (byte) 0) - num2 = (ushort) 56; - else if (liquidType == (byte) 0 && num1 == (byte) 2 || liquidType == (byte) 2 && num1 == (byte) 0) - num2 = (ushort) 229; - else if (liquidType == (byte) 1 && num1 == (byte) 2 || liquidType == (byte) 2 && num1 == (byte) 1) - num2 = (ushort) 230; - if (num2 == (ushort) 0) - return false; - tile.liquid = (byte) 0; - tile.liquidType(0); - WorldGen.PlaceTile(x, y, (int) num2, true); - WorldGen.SquareTileFrame(x, y); - if (Main.netMode != 0) - NetMessage.SendTileSquare(-1, x - 1, y - 1, 3, num2 == (ushort) 56 ? TileChangeType.LavaWater : TileChangeType.HoneyLava); - return true; - } - public static bool MoveTownNPC(int x, int y, int n) { if (!WorldGen.StartRoomCheck(x, y)) @@ -437,7 +312,7 @@ namespace Terraria Main.NewText(textValue, G: (byte) 240, B: (byte) 20); return false; } - if (!WorldGen.RoomNeeds(WorldGen.prioritizedTownNPCType)) + if (!WorldGen.RoomNeeds(WorldGen.prioritizedTownNPC)) { int index = 0; int length = (WorldGen.roomTorch ? 0 : 1) + (WorldGen.roomDoor ? 0 : 1) + (WorldGen.roomTable ? 0 : 1) + (WorldGen.roomChair ? 0 : 1); @@ -465,10 +340,7 @@ namespace Terraria Main.NewText(Language.GetTextValue("Game.HouseMissing_" + (object) length, (object[]) strArray), G: (byte) 240, B: (byte) 20); return false; } - int npcTypeAskingToScoreRoom = WorldGen.prioritizedTownNPCType; - if (n >= 0) - npcTypeAskingToScoreRoom = Main.npc[n].type; - WorldGen.ScoreRoom(npcTypeAskingToScoreRoom: npcTypeAskingToScoreRoom); + WorldGen.ScoreRoom(); if (WorldGen.hiScore <= 0) { if (WorldGen.roomOccupied) @@ -479,7 +351,7 @@ namespace Terraria Main.NewText(Lang.inter[40].Value, G: (byte) 240, B: (byte) 20); return false; } - if (n < 0 || WorldGen.CheckSpecialTownNPCSpawningConditions(Main.npc[n].type)) + if (n <= 0 || WorldGen.CheckSpecialTownNPCSpawningConditions(Main.npc[n].type)) return true; Main.NewText(Lang.inter[55].Value + " " + Main.npc[n].TypeName, G: (byte) 240, B: (byte) 20); return false; @@ -493,24 +365,13 @@ namespace Terraria } else { - WorldGen.prioritizedTownNPCType = Main.npc[n].type; + WorldGen.prioritizedTownNPC = Main.npc[n].type; Main.npc[n].homeless = true; int num = (int) WorldGen.SpawnTownNPC(x, y); WorldGen.TownManager.SetRoom(Main.npc[n].type, Main.npc[n].homeTileX, Main.npc[n].homeTileY); } } - public static bool IsNPCEvictable(int n) - { - if (n < 0) - return false; - Microsoft.Xna.Framework.Rectangle hitbox = Main.LocalPlayer.Hitbox; - hitbox.Inflate(Main.LogicCheckScreenWidth / 2, Main.LogicCheckScreenHeight / 2); - NPC npc = Main.npc[n]; - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(npc.homeTileX * 16, npc.homeTileY * 16, 16, 16); - return hitbox.Intersects(rectangle); - } - public static void kickOut(int n) { if (Main.netMode == 1) @@ -524,73 +385,18 @@ namespace Terraria } } - public static bool IsThereASpawnablePrioritizedTownNPC( - int x, - int y, - ref bool canSpawnNewTownNPC) + public static bool IsThereASpawnablePrioritizedTownNPC(int x, int y) { - if (WorldGen.CheckSpecialTownNPCSpawningConditions(WorldGen.prioritizedTownNPCType) && NPC.AnyNPCs(WorldGen.prioritizedTownNPCType)) - { - canSpawnNewTownNPC = false; + if (WorldGen.CheckSpecialTownNPCSpawningConditions(WorldGen.prioritizedTownNPC) && NPC.AnyNPCs(WorldGen.prioritizedTownNPC)) return true; - } - List occupantsList = new List(); - WorldGen.TownManager.AddOccupantsToList(x, y, occupantsList); - for (int index1 = 0; index1 < occupantsList.Count; ++index1) + int occupation = WorldGen.TownManager.FindOccupation(x, y); + if (occupation != -1 && Main.townNPCCanSpawn[occupation] && !NPC.AnyNPCs(occupation) && WorldGen.CheckSpecialTownNPCSpawningConditions(occupation)) { - int index2 = occupantsList[index1]; - if (Main.townNPCCanSpawn[index2] && !NPC.AnyNPCs(index2) && WorldGen.CheckSpecialTownNPCSpawningConditions(index2)) - { - WorldGen.prioritizedTownNPCType = index2; - canSpawnNewTownNPC = true; - return true; - } - } - for (int index = 0; index < 663; ++index) - { - if (Main.townNPCCanSpawn[index] && WorldGen.CheckSpecialTownNPCSpawningConditions(index)) - { - if (NPC.AnyNPCs(index)) - { - Main.townNPCCanSpawn[index] = false; - } - else - { - if (WorldGen.TownManager.HasRoomQuick(index)) - { - WorldGen.prioritizedTownNPCType = index; - canSpawnNewTownNPC = true; - return true; - } - if (!NPCID.Sets.IsTownPet[WorldGen.prioritizedTownNPCType] || NPCID.Sets.IsTownPet[index]) - { - WorldGen.prioritizedTownNPCType = index; - canSpawnNewTownNPC = true; - return true; - } - } - } - } - return false; - } - - public static bool IsThereASpawnablePrioritizedTownNPC_Old(int x, int y) - { - if (WorldGen.CheckSpecialTownNPCSpawningConditions(WorldGen.prioritizedTownNPCType) && NPC.AnyNPCs(WorldGen.prioritizedTownNPCType)) + WorldGen.prioritizedTownNPC = occupation; return true; - List occupantsList = new List(); - WorldGen.TownManager.AddOccupantsToList(x, y, occupantsList); - for (int index1 = 0; index1 < occupantsList.Count; ++index1) - { - int index2 = occupantsList[index1]; - if (Main.townNPCCanSpawn[index2] && !NPC.AnyNPCs(index2) && WorldGen.CheckSpecialTownNPCSpawningConditions(index2)) - { - WorldGen.prioritizedTownNPCType = index2; - return true; - } } int num = -1; - for (int index = 0; index < 663; ++index) + for (int index = 0; index < 580; ++index) { if (Main.townNPCCanSpawn[index] && WorldGen.CheckSpecialTownNPCSpawningConditions(index)) { @@ -601,16 +407,16 @@ namespace Terraria if (num == -1) num = index; } - else if (!NPCID.Sets.IsTownPet[WorldGen.prioritizedTownNPCType] || NPCID.Sets.IsTownPet[index]) + else { - WorldGen.prioritizedTownNPCType = index; + WorldGen.prioritizedTownNPC = index; return true; } } } if (num == -1) return false; - WorldGen.prioritizedTownNPCType = num; + WorldGen.prioritizedTownNPC = num; return true; } @@ -621,28 +427,27 @@ namespace Terraria if ((double) WorldGen.roomY2 > Main.worldSurface) return false; int num1 = 0; - int num2 = WorldGen.roomX1 - Main.buffScanAreaWidth / 2 / 16 - 1 - Lighting.OffScreenTiles; - int num3 = WorldGen.roomX2 + Main.buffScanAreaWidth / 2 / 16 + 1 + Lighting.OffScreenTiles; - int num4 = WorldGen.roomY1 - Main.buffScanAreaHeight / 2 / 16 - 1 - Lighting.OffScreenTiles; - int num5 = WorldGen.roomY2 + Main.buffScanAreaHeight / 2 / 16 + 1 + Lighting.OffScreenTiles; + int num2 = WorldGen.roomX1 - Main.zoneX / 2 / 16 - 1 - Lighting.offScreenTiles; + int num3 = WorldGen.roomX2 + Main.zoneX / 2 / 16 + 1 + Lighting.offScreenTiles; + int num4 = WorldGen.roomY1 - Main.zoneY / 2 / 16 - 1 - Lighting.offScreenTiles; + int num5 = WorldGen.roomY2 + Main.zoneY / 2 / 16 + 1 + Lighting.offScreenTiles; if (num2 < 0) num2 = 0; if (num3 >= Main.maxTilesX) num3 = Main.maxTilesX - 1; if (num4 < 0) num4 = 0; - if (num5 >= Main.maxTilesY) - num5 = Main.maxTilesY - 1; + if (num5 > Main.maxTilesX) + num5 = Main.maxTilesX; for (int index1 = num2 + 1; index1 < num3; ++index1) { for (int index2 = num4 + 2; index2 < num5 + 2; ++index2) { - Tile tile = Main.tile[index1, index2]; - if (tile.active() && (tile.type == (ushort) 70 || tile.type == (ushort) 71 || tile.type == (ushort) 72 || tile.type == (ushort) 528)) + if (Main.tile[index1, index2].active() && (Main.tile[index1, index2].type == (ushort) 70 || Main.tile[index1, index2].type == (ushort) 71 || Main.tile[index1, index2].type == (ushort) 72)) ++num1; } } - return num1 >= SceneMetrics.MushroomTileThreshold; + return num1 >= 100; } public static void UnspawnTravelNPC() @@ -679,7 +484,7 @@ namespace Terraria Main.NewText(Lang.misc[35].Format((object) fullName), (byte) 50, (byte) 125); break; case 2: - ChatHelper.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[35].Key, (object) Main.npc[number].GetFullNetName()), new Color(50, 125, (int) byte.MaxValue)); + NetMessage.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[35].Key, (object) Main.npc[number].GetFullNetName()), new Color(50, 125, (int) byte.MaxValue)); break; } Main.npc[number].active = false; @@ -804,7 +609,7 @@ namespace Terraria { if (Main.netMode != 2) return; - ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasArrived", (object) Main.npc[index9].GetFullNetName()), new Color(50, 125, (int) byte.MaxValue)); + NetMessage.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasArrived", (object) Main.npc[index9].GetFullNetName()), new Color(50, 125, (int) byte.MaxValue)); } } @@ -812,33 +617,34 @@ namespace Terraria { if (Main.wallHouse[(int) Main.tile[x, y].wall]) WorldGen.canSpawn = true; - if (!WorldGen.canSpawn || !WorldGen.StartRoomCheck(x, y) || !WorldGen.RoomNeeds(WorldGen.prioritizedTownNPCType)) + if (!WorldGen.canSpawn || !WorldGen.StartRoomCheck(x, y) || !WorldGen.RoomNeeds(WorldGen.prioritizedTownNPC)) return TownNPCSpawnResult.Blocked; - int ahomelessNpc = WorldGen.FindAHomelessNPC(); - int npcTypeAskingToScoreRoom = WorldGen.prioritizedTownNPCType; - if (ahomelessNpc != -1) - npcTypeAskingToScoreRoom = Main.npc[ahomelessNpc].type; - WorldGen.ScoreRoom(npcTypeAskingToScoreRoom: npcTypeAskingToScoreRoom); - if (WorldGen.hiScore <= 0) + WorldGen.ScoreRoom(); + if (WorldGen.hiScore <= 0 || !WorldGen.IsThereASpawnablePrioritizedTownNPC(WorldGen.bestX, WorldGen.bestY)) return TownNPCSpawnResult.Blocked; - bool canSpawnNewTownNPC = true; - if (!WorldGen.IsThereASpawnablePrioritizedTownNPC(WorldGen.bestX, WorldGen.bestY, ref canSpawnNewTownNPC)) - return TownNPCSpawnResult.Blocked; - int prioritizedTownNpcType1 = WorldGen.prioritizedTownNPCType; - if (ahomelessNpc != -1) + int index1 = -1; + for (int index2 = 0; index2 < 200; ++index2) { - Main.townNPCCanSpawn[WorldGen.prioritizedTownNPCType] = false; - Main.npc[ahomelessNpc].homeTileX = WorldGen.bestX; - Main.npc[ahomelessNpc].homeTileY = WorldGen.bestY; - Main.npc[ahomelessNpc].homeless = false; + if (Main.npc[index2].active && Main.npc[index2].homeless && Main.npc[index2].type == WorldGen.prioritizedTownNPC && WorldGen.CheckSpecialTownNPCSpawningConditions(Main.npc[index2].type)) + { + index1 = index2; + break; + } + } + if (index1 != -1) + { + Main.townNPCCanSpawn[WorldGen.prioritizedTownNPC] = false; + Main.npc[index1].homeTileX = WorldGen.bestX; + Main.npc[index1].homeTileY = WorldGen.bestY; + Main.npc[index1].homeless = false; AchievementsHelper.NotifyProgressionEvent(8); - WorldGen.prioritizedTownNPCType = 0; + WorldGen.prioritizedTownNPC = 0; return TownNPCSpawnResult.RelocatedHomeless; } - if (canSpawnNewTownNPC && ahomelessNpc == -1) + if (index1 == -1) { Point roomPosition; - if (WorldGen.TownManager.HasRoom(prioritizedTownNpcType1, out roomPosition) && !WorldGen.currentlyTryingToUseAlternateHousingSpot) + if (WorldGen.TownManager.HasRoom(WorldGen.prioritizedTownNPC, out roomPosition) && !WorldGen.currentlyTryingToUseAlternateHousingSpot) { int bestX = WorldGen.bestX; int bestY = WorldGen.bestY; @@ -850,54 +656,63 @@ namespace Terraria if (townNpcSpawnResult == TownNPCSpawnResult.Successful) return townNpcSpawnResult; } - int spawnTileX = WorldGen.bestX; - int spawnTileY = WorldGen.bestY; - int prioritizedTownNpcType2 = WorldGen.prioritizedTownNPCType; - if (WorldGen.IsRoomConsideredAlreadyOccupied(spawnTileX, spawnTileY, prioritizedTownNpcType2)) - return TownNPCSpawnResult.BlockedInfiHousing; - bool flag = false; - if (!flag) + int index3 = WorldGen.bestX; + int index4 = WorldGen.bestY; + bool flag1 = false; + for (int index5 = 0; index5 < 200; ++index5) { - flag = true; - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(spawnTileX * 16 + 8 - NPC.sWidth / 2 - NPC.safeRangeX, spawnTileY * 16 + 8 - NPC.sHeight / 2 - NPC.safeRangeY, NPC.sWidth + NPC.safeRangeX * 2, NPC.sHeight + NPC.safeRangeY * 2); - for (int index = 0; index < (int) byte.MaxValue; ++index) + NPC npc = Main.npc[index5]; + if (npc.active && npc.townNPC && !npc.homeless && npc.homeTileX == index3 && npc.homeTileY == index4) { - if (Main.player[index].active && new Microsoft.Xna.Framework.Rectangle((int) Main.player[index].position.X, (int) Main.player[index].position.Y, Main.player[index].width, Main.player[index].height).Intersects(rectangle)) + flag1 = true; + break; + } + } + if (flag1) + return TownNPCSpawnResult.BlockedInfiHousing; + bool flag2 = false; + if (!flag2) + { + flag2 = true; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(index3 * 16 + 8 - NPC.sWidth / 2 - NPC.safeRangeX, index4 * 16 + 8 - NPC.sHeight / 2 - NPC.safeRangeY, NPC.sWidth + NPC.safeRangeX * 2, NPC.sHeight + NPC.safeRangeY * 2); + for (int index6 = 0; index6 < (int) byte.MaxValue; ++index6) + { + if (Main.player[index6].active && new Microsoft.Xna.Framework.Rectangle((int) Main.player[index6].position.X, (int) Main.player[index6].position.Y, Main.player[index6].width, Main.player[index6].height).Intersects(rectangle)) { - flag = false; + flag2 = false; break; } } } - if (!flag && (double) spawnTileY <= Main.worldSurface) + if (!flag2 && (double) index4 <= Main.worldSurface) { - for (int index1 = 1; index1 < 500; ++index1) + for (int index7 = 1; index7 < 500; ++index7) { - for (int index2 = 0; index2 < 2; ++index2) + for (int index8 = 0; index8 < 2; ++index8) { - spawnTileX = index2 != 0 ? WorldGen.bestX - index1 : WorldGen.bestX + index1; - if (spawnTileX > 10 && spawnTileX < Main.maxTilesX - 10) + index3 = index8 != 0 ? WorldGen.bestX - index7 : WorldGen.bestX + index7; + if (index3 > 10 && index3 < Main.maxTilesX - 10) { - int num1 = WorldGen.bestY - index1; - double num2 = (double) (WorldGen.bestY + index1); + int num1 = WorldGen.bestY - index7; + double num2 = (double) (WorldGen.bestY + index7); if (num1 < 10) num1 = 10; if (num2 > Main.worldSurface) num2 = Main.worldSurface; - for (int index3 = num1; (double) index3 < num2; ++index3) + for (int index9 = num1; (double) index9 < num2; ++index9) { - spawnTileY = index3; - if (Main.tile[spawnTileX, spawnTileY].nactive() && Main.tileSolid[(int) Main.tile[spawnTileX, spawnTileY].type]) + index4 = index9; + if (Main.tile[index3, index4].nactive() && Main.tileSolid[(int) Main.tile[index3, index4].type]) { - if (!Collision.SolidTiles(spawnTileX - 1, spawnTileX + 1, spawnTileY - 3, spawnTileY - 1)) + if (!Collision.SolidTiles(index3 - 1, index3 + 1, index4 - 3, index4 - 1)) { - flag = true; - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(spawnTileX * 16 + 8 - NPC.sWidth / 2 - NPC.safeRangeX, spawnTileY * 16 + 8 - NPC.sHeight / 2 - NPC.safeRangeY, NPC.sWidth + NPC.safeRangeX * 2, NPC.sHeight + NPC.safeRangeY * 2); - for (int index4 = 0; index4 < (int) byte.MaxValue; ++index4) + flag2 = true; + Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(index3 * 16 + 8 - NPC.sWidth / 2 - NPC.safeRangeX, index4 * 16 + 8 - NPC.sHeight / 2 - NPC.safeRangeY, NPC.sWidth + NPC.safeRangeX * 2, NPC.sHeight + NPC.safeRangeY * 2); + for (int index10 = 0; index10 < (int) byte.MaxValue; ++index10) { - if (Main.player[index4].active && new Microsoft.Xna.Framework.Rectangle((int) Main.player[index4].position.X, (int) Main.player[index4].position.Y, Main.player[index4].width, Main.player[index4].height).Intersects(rectangle)) + if (Main.player[index10].active && new Microsoft.Xna.Framework.Rectangle((int) Main.player[index10].position.X, (int) Main.player[index10].position.Y, Main.player[index10].width, Main.player[index10].height).Intersects(rectangle)) { - flag = false; + flag2 = false; break; } } @@ -907,82 +722,50 @@ namespace Terraria } } } - if (flag) + if (flag2) break; } - if (flag) + if (flag2) break; } } - int index5 = NPC.NewNPC(spawnTileX * 16, spawnTileY * 16, prioritizedTownNpcType1, 1); - Main.townNPCCanSpawn[prioritizedTownNpcType1] = false; - Main.npc[index5].homeTileX = WorldGen.bestX; - Main.npc[index5].homeTileY = WorldGen.bestY; - if (spawnTileX < WorldGen.bestX) - Main.npc[index5].direction = 1; - else if (spawnTileX > WorldGen.bestX) - Main.npc[index5].direction = -1; - Main.npc[index5].netUpdate = true; - string fullName = Main.npc[index5].FullName; + int index11 = NPC.NewNPC(index3 * 16, index4 * 16, WorldGen.prioritizedTownNPC, 1); + Main.townNPCCanSpawn[WorldGen.prioritizedTownNPC] = false; + Main.npc[index11].homeTileX = WorldGen.bestX; + Main.npc[index11].homeTileY = WorldGen.bestY; + if (index3 < WorldGen.bestX) + Main.npc[index11].direction = 1; + else if (index3 > WorldGen.bestX) + Main.npc[index11].direction = -1; + Main.npc[index11].netUpdate = true; + string fullName = Main.npc[index11].FullName; switch (Main.netMode) { case 0: Main.NewText(Language.GetTextValue("Announcement.HasArrived", (object) fullName), (byte) 50, (byte) 125); break; case 2: - ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasArrived", (object) Main.npc[index5].GetFullNetName()), new Color(50, 125, (int) byte.MaxValue)); + NetMessage.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasArrived", (object) Main.npc[index11].GetFullNetName()), new Color(50, 125, (int) byte.MaxValue)); break; } AchievementsHelper.NotifyProgressionEvent(8); - if (Main.npc[index5].type == 160) + if (Main.npc[index11].type == 160) AchievementsHelper.NotifyProgressionEvent(18); WorldGen.CheckAchievement_RealEstate(); - WorldGen.prioritizedTownNPCType = 0; + WorldGen.prioritizedTownNPC = 0; } return TownNPCSpawnResult.Successful; } - private static int FindAHomelessNPC() + private static void CheckAchievement_RealEstate() { - int num = -1; + bool[] flagArray = new bool[580]; for (int index = 0; index < 200; ++index) { - if (Main.npc[index].active && Main.npc[index].homeless && Main.npc[index].type == WorldGen.prioritizedTownNPCType && WorldGen.CheckSpecialTownNPCSpawningConditions(Main.npc[index].type)) - { - num = index; - break; - } - } - return num; - } - - private static bool IsRoomConsideredAlreadyOccupied( - int spawnTileX, - int spawnTileY, - int npcTypeToSpawn) - { - bool flag = false; - for (int index = 0; index < 200; ++index) - { - NPC npc2 = Main.npc[index]; - if (npc2.active && npc2.townNPC && !npc2.homeless && npc2.homeTileX == spawnTileX && npc2.homeTileY == spawnTileY && !WorldGen.TownManager.CanNPCsLiveWithEachOther(npcTypeToSpawn, npc2)) - { - flag = true; - break; - } - } - return flag; - } - - public static void CheckAchievement_RealEstate() - { - bool[] flagArray = new bool[663]; - for (int index = 0; index < 200; ++index) - { - if (Main.npc[index].active && Main.npc[index].type >= 0 && Main.npc[index].type < 663) + if (Main.npc[index].active && Main.npc[index].type >= 0 && Main.npc[index].type < 580) flagArray[Main.npc[index].type] = true; } - if (!flagArray[38] || !flagArray[17] || !flagArray[107] || !flagArray[19] || !flagArray[22] || !flagArray[124] || !flagArray[228] || !flagArray[178] || !flagArray[18] || !flagArray[229] || !flagArray[209] || !flagArray[54] || !flagArray[108] || !flagArray[160] || !flagArray[20] || !flagArray[369] || !flagArray[207] || !flagArray[227] || !flagArray[208] || !flagArray[441] || !flagArray[353] || !flagArray[588] || !flagArray[633]) + if (!flagArray[38] || !flagArray[17] || !flagArray[107] || !flagArray[19] || !flagArray[22] || !flagArray[124] || !flagArray[228] || !flagArray[178] || !flagArray[18] || !flagArray[229] || !flagArray[209] || !flagArray[54] || !flagArray[108] || !flagArray[160] || !flagArray[20] || !flagArray[369] || !flagArray[207] || !flagArray[227] || !flagArray[208] || !flagArray[441] || !flagArray[353]) return; AchievementsHelper.NotifyProgressionEvent(17); } @@ -1031,74 +814,65 @@ namespace Terraria public static void QuickFindHome(int npc) { - bool flag = Main.tileSolid[379]; - Main.tileSolid[379] = true; - if (Main.npc[npc].homeTileX > 10 && Main.npc[npc].homeTileY > 10 && Main.npc[npc].homeTileX < Main.maxTilesX - 10 && Main.npc[npc].homeTileY < Main.maxTilesY) + if (Main.npc[npc].homeTileX <= 10 || Main.npc[npc].homeTileY <= 10 || Main.npc[npc].homeTileX >= Main.maxTilesX - 10 || Main.npc[npc].homeTileY >= Main.maxTilesY) + return; + WorldGen.canSpawn = false; + WorldGen.StartRoomCheck(Main.npc[npc].homeTileX, Main.npc[npc].homeTileY - 1); + if (!WorldGen.canSpawn) { - WorldGen.canSpawn = false; - WorldGen.StartRoomCheck(Main.npc[npc].homeTileX, Main.npc[npc].homeTileY - 1); - if (!WorldGen.canSpawn) + for (int x = Main.npc[npc].homeTileX - 1; x < Main.npc[npc].homeTileX + 2; ++x) { - for (int x = Main.npc[npc].homeTileX - 1; x < Main.npc[npc].homeTileX + 2; ++x) - { - int y = Main.npc[npc].homeTileY - 1; - while (y < Main.npc[npc].homeTileY + 2 && !WorldGen.StartRoomCheck(x, y)) - ++y; - } + int y = Main.npc[npc].homeTileY - 1; + while (y < Main.npc[npc].homeTileY + 2 && !WorldGen.StartRoomCheck(x, y)) + ++y; } - if (!WorldGen.canSpawn) + } + if (!WorldGen.canSpawn) + { + int num = 10; + for (int x = Main.npc[npc].homeTileX - num; x <= Main.npc[npc].homeTileX + num; x += 2) { - int num = 10; - for (int x = Main.npc[npc].homeTileX - num; x <= Main.npc[npc].homeTileX + num; x += 2) - { - int y = Main.npc[npc].homeTileY - num; - while (y <= Main.npc[npc].homeTileY + num && !WorldGen.StartRoomCheck(x, y)) - y += 2; - } + int y = Main.npc[npc].homeTileY - num; + while (y <= Main.npc[npc].homeTileY + num && !WorldGen.StartRoomCheck(x, y)) + y += 2; } + } + if (WorldGen.canSpawn) + { + WorldGen.RoomNeeds(Main.npc[npc].type); if (WorldGen.canSpawn) + WorldGen.ScoreRoom(npc); + if (WorldGen.canSpawn && WorldGen.hiScore > 0) { - WorldGen.RoomNeeds(Main.npc[npc].type); - if (WorldGen.canSpawn) - WorldGen.ScoreRoom(npc, Main.npc[npc].type); - if (WorldGen.canSpawn && WorldGen.hiScore > 0) - WorldGen.canSpawn = WorldGen.IsRoomConsideredOccupiedForNPCIndex(npc); - if (WorldGen.canSpawn && WorldGen.hiScore > 0) + for (int index = 0; index < 200; ++index) { - Main.npc[npc].homeTileX = WorldGen.bestX; - Main.npc[npc].homeTileY = WorldGen.bestY; - Main.npc[npc].homeless = false; - AchievementsHelper.NotifyProgressionEvent(8); - WorldGen.canSpawn = false; + if (index != npc) + { + NPC npc1 = Main.npc[index]; + if (npc1.active && npc1.townNPC && !npc1.homeless && npc1.homeTileX == WorldGen.bestX && npc1.homeTileY == WorldGen.bestY) + { + WorldGen.canSpawn = false; + break; + } + } } - else - Main.npc[npc].homeless = true; + } + if (WorldGen.canSpawn && WorldGen.hiScore > 0) + { + Main.npc[npc].homeTileX = WorldGen.bestX; + Main.npc[npc].homeTileY = WorldGen.bestY; + Main.npc[npc].homeless = false; + AchievementsHelper.NotifyProgressionEvent(8); + WorldGen.canSpawn = false; } else Main.npc[npc].homeless = true; } - Main.tileSolid[379] = flag; + else + Main.npc[npc].homeless = true; } - private static bool IsRoomConsideredOccupiedForNPCIndex(int npc) - { - bool flag = true; - for (int index = 0; index < 200; ++index) - { - if (index != npc) - { - NPC npc2 = Main.npc[index]; - if (npc2.active && npc2.townNPC && !npc2.homeless && npc2.homeTileX == WorldGen.bestX && npc2.homeTileY == WorldGen.bestY && !WorldGen.TownManager.CanNPCsLiveWithEachOther(Main.npc[npc], npc2)) - { - flag = false; - break; - } - } - } - return flag; - } - - private static bool ScoreRoom_IsThisRoomOccupiedBySomeone(int ignoreNPC = -1, int npcTypeAsking = -1) + private static bool ScoreRoom_IsThisRoomOccupiedBySomeone(int ignoreNPC = -1) { for (int index1 = 0; index1 < 200; ++index1) { @@ -1113,15 +887,8 @@ namespace Terraria { if (Main.npc[index1].homeTileX == WorldGen.roomX[index3] && Main.npc[index1].homeTileY - 1 == WorldGen.roomY[index3]) { - if (WorldGen.TownManager.CanNPCsLiveWithEachOther(npcTypeAsking, Main.npc[index1])) - { - WorldGen.sharedRoomX = Main.npc[index1].homeTileX; - } - else - { - flag = true; - break; - } + flag = true; + break; } } if (flag) @@ -1175,12 +942,11 @@ namespace Terraria } } - public static void ScoreRoom(int ignoreNPC = -1, int npcTypeAskingToScoreRoom = -1) + public static void ScoreRoom(int ignoreNPC = -1) { WorldGen.roomOccupied = false; WorldGen.roomEvil = false; - WorldGen.sharedRoomX = -1; - if (WorldGen.ScoreRoom_IsThisRoomOccupiedBySomeone(ignoreNPC, npcTypeAskingToScoreRoom)) + if (WorldGen.ScoreRoom_IsThisRoomOccupiedBySomeone(ignoreNPC)) { WorldGen.roomOccupied = true; WorldGen.hiScore = -1; @@ -1190,19 +956,19 @@ namespace Terraria WorldGen.hiScore = 0; int num1 = 50; int num2 = 40; - int num3 = WorldGen.roomX1 - Main.buffScanAreaWidth / 2 / 16 - 1 - num2; - int num4 = WorldGen.roomX2 + Main.buffScanAreaWidth / 2 / 16 + 1 + num2; - int num5 = WorldGen.roomY1 - Main.buffScanAreaHeight / 2 / 16 - 1 - num2; - int num6 = WorldGen.roomY2 + Main.buffScanAreaHeight / 2 / 16 + 1 + num2; - if (num3 < 5) - num3 = 5; - if (num4 >= Main.maxTilesX - 5) - num4 = Main.maxTilesX - 6; - if (num5 < 5) - num5 = 5; - if (num6 >= Main.maxTilesY - 5) - num6 = Main.maxTilesY - 6; - int[] tileTypeCounts = new int[623]; + int num3 = WorldGen.roomX1 - Main.zoneX / 2 / 16 - 1 - num2; + int num4 = WorldGen.roomX2 + Main.zoneX / 2 / 16 + 1 + num2; + int num5 = WorldGen.roomY1 - Main.zoneY / 2 / 16 - 1 - num2; + int num6 = WorldGen.roomY2 + Main.zoneY / 2 / 16 + 1 + num2; + if (num3 < 0) + num3 = 0; + if (num4 >= Main.maxTilesX) + num4 = Main.maxTilesX - 1; + if (num5 < 0) + num5 = 0; + if (num6 > Main.maxTilesY) + num6 = Main.maxTilesY - 1; + int[] tileTypeCounts = new int[470]; WorldGen.CountTileTypesInArea(tileTypeCounts, num3 + 1, num4 - 1, num5 + 2, num6 + 1); int num7 = -WorldGen.GetTileTypeCountByCategory(tileTypeCounts, TileScanGroup.TotalGoodEvil); if (num7 < 50) @@ -1219,41 +985,44 @@ namespace Terraria int roomX2 = WorldGen.roomX2; int roomY1 = WorldGen.roomY1; int roomY2 = WorldGen.roomY2; - for (int index1 = roomX1 + 1; index1 < roomX2; ++index1) + for (int i = roomX1 + 1; i < roomX2; ++i) { - for (int index2 = roomY1 + 2; index2 < roomY2 + 2; ++index2) + for (int j = roomY1 + 2; j < roomY2 + 2; ++j) { - if (Main.tile[index1, index2].nactive() && WorldGen.ScoreRoom_CanBeHomeSpot(index1, index2)) + if (Main.tile[i, j].nactive()) { int num9 = num8; - if (Main.tileSolid[(int) Main.tile[index1, index2].type] && !Main.tileSolidTop[(int) Main.tile[index1, index2].type] && !Collision.SolidTiles(index1 - 1, index1 + 1, index2 - 3, index2 - 1) && Main.tile[index1 - 1, index2].nactive() && Main.tileSolid[(int) Main.tile[index1 - 1, index2].type] && Main.tile[index1 + 1, index2].nactive() && Main.tileSolid[(int) Main.tile[index1 + 1, index2].type]) + if (Main.tileSolid[(int) Main.tile[i, j].type] && !Main.tileSolidTop[(int) Main.tile[i, j].type] && !Collision.SolidTiles(i - 1, i + 1, j - 3, j - 1) && Main.tile[i - 1, j].nactive() && Main.tileSolid[(int) Main.tile[i - 1, j].type] && Main.tile[i + 1, j].nactive() && Main.tileSolid[(int) Main.tile[i + 1, j].type]) { int num10 = 0; int num11 = 0; - for (int x = index1 - 2; x < index1 + 3; ++x) + for (int x = i - 2; x < i + 3; ++x) { - for (int y = index2 - 4; y < index2; ++y) + for (int y = j - 4; y < j; ++y) { - Tile tile = Main.tile[x, y]; - if (tile.nactive() && !TileID.Sets.IgnoredInHouseScore[(int) tile.type]) + if (Main.tile[x, y].nactive()) { - if (x == index1) + if (x == i) + { ++num10; - else if (TileID.Sets.BasicChest[(int) tile.type]) - ++num11; - else if (tile.type == (ushort) 10 || tile.type == (ushort) 388) - num9 -= 20; - else if (WorldGen.IsOpenDoorAnchorFrame(x, y)) - num9 -= 20; - else if (Main.tileSolid[(int) tile.type]) - num9 -= 5; + } else - num9 += 5; + { + Tile tile = Main.tile[x, y]; + if (TileID.Sets.BasicChest[(int) tile.type]) + ++num11; + else if (tile.type == (ushort) 10 || tile.type == (ushort) 388) + num9 -= 20; + else if (WorldGen.IsOpenDoorAnchorFrame(x, y)) + num9 -= 20; + else if (Main.tileSolid[(int) tile.type]) + num9 -= 5; + else + num9 += 5; + } } } } - if (WorldGen.sharedRoomX >= 0 && num9 >= 1 && Math.Abs(WorldGen.sharedRoomX - index1) < 3) - num9 = 1; if (num9 > 0 && num11 > 0) { num9 -= 30 * num11; @@ -1268,14 +1037,14 @@ namespace Terraria } if (num9 > WorldGen.hiScore) { - bool flag1 = WorldGen.Housing_CheckIfInRoom(index1, index2); + bool flag1 = WorldGen.Housing_CheckIfInRoom(i, j); bool[] flagArray = new bool[3]; - for (int index3 = 1; index3 <= 3; ++index3) + for (int index = 1; index <= 3; ++index) { - if (!Main.tile[index1, index2 - index3].active() || !Main.tileSolid[(int) Main.tile[index1, index2 - index3].type]) - flagArray[index3 - 1] = true; - if (!WorldGen.Housing_CheckIfInRoom(index1, index2 - index3)) - flagArray[index3 - 1] = false; + if (!Main.tile[i, j - index].active() || !Main.tileSolid[(int) Main.tile[i, j - index].type]) + flagArray[index - 1] = true; + if (!WorldGen.Housing_CheckIfInRoom(i, j - index)) + flagArray[index - 1] = false; } foreach (bool flag2 in flagArray) { @@ -1285,11 +1054,11 @@ namespace Terraria break; } } - if (flag1 && !WorldGen.Housing_CheckIfIsCeiling(index1, index2)) + if (flag1 && !WorldGen.Housing_CheckIfIsCeiling(i, j)) { WorldGen.hiScore = num9; - WorldGen.bestX = index1; - WorldGen.bestY = index2; + WorldGen.bestX = i; + WorldGen.bestY = j; } } } @@ -1300,10 +1069,34 @@ namespace Terraria } } - private static bool ScoreRoom_CanBeHomeSpot(int x, int y) + private static void ScoreRoom_CountEvilTilesOld( + ref int startScore, + int startX, + int endX, + int startY, + int endY) { - Tile tile = Main.tile[x, y]; - return !tile.active() || tile.type != (ushort) 379; + int num = 0; + for (int index1 = startX + 1; index1 < endX; ++index1) + { + for (int index2 = startY + 2; index2 < endY + 2; ++index2) + { + if (Main.tile[index1, index2].active()) + { + if (Main.tile[index1, index2].type == (ushort) 23 || Main.tile[index1, index2].type == (ushort) 24 || Main.tile[index1, index2].type == (ushort) 25 || Main.tile[index1, index2].type == (ushort) 32 || Main.tile[index1, index2].type == (ushort) 112 || Main.tile[index1, index2].type == (ushort) 163) + ++num; + else if (Main.tile[index1, index2].type == (ushort) 199 || Main.tile[index1, index2].type == (ushort) 201 || Main.tile[index1, index2].type == (ushort) 200 || Main.tile[index1, index2].type == (ushort) 203 || Main.tile[index1, index2].type == (ushort) 234) + ++num; + else if (Main.tile[index1, index2].type == (ushort) 27) + num -= 5; + else if (Main.tile[index1, index2].type == (ushort) 109 || Main.tile[index1, index2].type == (ushort) 110 || Main.tile[index1, index2].type == (ushort) 113 || Main.tile[index1, index2].type == (ushort) 116 || Main.tile[index1, index2].type == (ushort) 164) + --num; + } + } + } + if (num < 50) + num = 0; + startScore -= num; } private static bool Housing_CheckIfIsCeiling(int i, int j) @@ -1346,7 +1139,7 @@ namespace Terraria WorldGen.roomY2 = y; WorldGen.numRoomTiles = 0; WorldGen.roomCeilingsCount = 0; - for (int index = 0; index < 623; ++index) + for (int index = 0; index < 470; ++index) WorldGen.houseTile[index] = false; WorldGen.canSpawn = true; if (Main.tile[x, y].nactive() && Main.tileSolid[(int) Main.tile[x, y].type]) @@ -1497,7 +1290,7 @@ namespace Terraria i1 = Main.rand.Next(150, Main.maxTilesX - 150); for (int j1 = (int) (Main.worldSurface * 0.3); j1 < Main.maxTilesY; ++j1) { - if (Main.tile[i1, j1].active() && Main.tileSolid[(int) Main.tile[i1, j1].type] && !TileID.Sets.Platforms[(int) Main.tile[i1, j1].type]) + if (Main.tile[i1, j1].active() && Main.tileSolid[(int) Main.tile[i1, j1].type]) { int num5 = 0; int num6 = 15; @@ -1531,7 +1324,7 @@ namespace Terraria } } - public static bool meteor(int i, int j, bool ignorePlayers = false) + public static bool meteor(int i, int j) { if (i < 50 || i > Main.maxTilesX - 50 || j < 50 || j > Main.maxTilesY - 50) return false; @@ -1539,7 +1332,7 @@ namespace Terraria Microsoft.Xna.Framework.Rectangle rectangle1 = new Microsoft.Xna.Framework.Rectangle((i - num1) * 16, (j - num1) * 16, num1 * 2 * 16, num1 * 2 * 16); for (int index = 0; index < (int) byte.MaxValue; ++index) { - if (Main.player[index].active && !ignorePlayers) + if (Main.player[index].active) { Microsoft.Xna.Framework.Rectangle rectangle2 = new Microsoft.Xna.Framework.Rectangle((int) ((double) Main.player[index].position.X + (double) (Main.player[index].width / 2) - (double) (NPC.sWidth / 2) - (double) NPC.safeRangeX), (int) ((double) Main.player[index].position.Y + (double) (Main.player[index].height / 2) - (double) (NPC.sHeight / 2) - (double) NPC.safeRangeY), NPC.sWidth + NPC.safeRangeX * 2, NPC.sHeight + NPC.safeRangeY * 2); if (rectangle1.Intersects(rectangle2)) @@ -1559,22 +1352,8 @@ namespace Terraria { for (int index2 = j - num1; index2 < j + num1; ++index2) { - if (Main.tile[index1, index2].active()) - { - if (TileID.Sets.BasicChest[(int) Main.tile[index1, index2].type] || Main.tileDungeon[(int) Main.tile[index1, index2].type]) - return false; - switch (Main.tile[index1, index2].type) - { - case 226: - case 470: - case 475: - case 488: - case 597: - return false; - default: - continue; - } - } + if (Main.tile[index1, index2].active() && TileID.Sets.BasicChest[(int) Main.tile[index1, index2].type]) + return false; } } WorldGen.stopDrops = true; @@ -1619,7 +1398,7 @@ namespace Terraria float num10 = (float) Math.Abs(j - j1); if (Math.Sqrt(num9 * num9 + (double) num10 * (double) num10) < (double) num8 * 0.7) { - if (TileID.Sets.GetsDestroyedForMeteors[(int) Main.tile[i1, j1].type]) + if (Main.tile[i1, j1].type == (ushort) 5 || Main.tile[i1, j1].type == (ushort) 32 || Main.tile[i1, j1].type == (ushort) 352) WorldGen.KillTile(i1, j1); Main.tile[i1, j1].liquid = (byte) 0; } @@ -1645,7 +1424,7 @@ namespace Terraria float num13 = (float) Math.Abs(j - j2); if (Math.Sqrt(num12 * num12 + (double) num13 * (double) num13) < (double) num11 * 0.8) { - if (TileID.Sets.GetsDestroyedForMeteors[(int) Main.tile[i2, j2].type]) + if (Main.tile[i2, j2].type == (ushort) 5 || Main.tile[i2, j2].type == (ushort) 32 || Main.tile[i2, j2].type == (ushort) 352) WorldGen.KillTile(i2, j2); Main.tile[i2, j2].type = (ushort) 37; WorldGen.SquareTileFrame(i2, j2); @@ -1664,7 +1443,7 @@ namespace Terraria float num16 = (float) Math.Abs(j - j3); if (Math.Sqrt(num15 * num15 + (double) num16 * (double) num16) < (double) num14 * 0.85) { - if (TileID.Sets.GetsDestroyedForMeteors[(int) Main.tile[i3, j3].type]) + if (Main.tile[i3, j3].type == (ushort) 5 || Main.tile[i3, j3].type == (ushort) 32 || Main.tile[i3, j3].type == (ushort) 352) WorldGen.KillTile(i3, j3); Main.tile[i3, j3].type = (ushort) 37; WorldGen.SquareTileFrame(i3, j3); @@ -1676,7 +1455,7 @@ namespace Terraria if (Main.netMode == 0) Main.NewText(Lang.gen[59].Value, (byte) 50, B: (byte) 130); else if (Main.netMode == 2) - ChatHelper.BroadcastChatMessage(NetworkText.FromKey(Lang.gen[59].Key), new Color(50, (int) byte.MaxValue, 130)); + NetMessage.BroadcastChatMessage(NetworkText.FromKey(Lang.gen[59].Key), new Color(50, (int) byte.MaxValue, 130)); if (Main.netMode != 1) NetMessage.SendTileSquare(-1, i, j, 40); return true; @@ -1690,107 +1469,56 @@ namespace Terraria Main.maxSectionsY = Main.maxTilesY / 150; } - public static void worldGenCallback(object threadContext) + public static void worldGenCallBack(object threadContext) { - SoundEngine.PlaySound(10); + Main.PlaySound(10); WorldGen.clearWorld(); - WorldGen.GenerateWorld(Main.ActiveWorldFileData.Seed, threadContext as GenerationProgress); - WorldFile.SaveWorld(Main.ActiveWorldFileData.IsCloudSave, true); + WorldGen.generateWorld(Main.ActiveWorldFileData.Seed, threadContext as GenerationProgress); + WorldFile.saveWorld(Main.ActiveWorldFileData.IsCloudSave, true); if (Main.menuMode == 10 || Main.menuMode == 888) Main.menuMode = 6; - SoundEngine.PlaySound(10); - WorldGen.generatingWorld = false; + Main.PlaySound(10); } - public static Task CreateNewWorld(GenerationProgress progress = null) + public static void CreateNewWorld(GenerationProgress progress = null) { - WorldGen.generatingWorld = true; Main.rand = new UnifiedRandom(Main.ActiveWorldFileData.Seed); - WorldGen.gen = true; - Main.menuMode = 888; - try - { - Main.MenuUI.SetState((UIState) new UIWorldLoad()); - } - catch - { - } - return Task.Factory.StartNew(new Action(WorldGen.worldGenCallback), (object) progress); - } - - public static void JustQuit() - { - try - { - SoundEngine.PlaySound(34, Style: 0); - SoundEngine.PlaySound(35, Style: 0); - } - catch - { - } - Main.invasionProgress = -1; - Main.invasionProgressDisplayLeft = 0; - Main.invasionProgressAlpha = 0.0f; - Main.invasionProgressIcon = 0; - Main.menuMode = 10; - Main.gameMenu = true; - SoundEngine.StopTrackedSounds(); - CaptureInterface.ResetFocus(); - Main.ActivePlayerFileData.StopPlayTimer(); - Main.fastForwardTime = false; - Main.UpdateTimeRate(); - if (Main.netMode == 0) - { - Main.GoToWorldSelect(); - Main.player[Main.myPlayer].position = new Vector2(0.0f, 0.0f); - } - else - { - if (Main.netMode != 1) - return; - Main.menuMode = 0; - Netplay.Disconnect = true; - Main.netMode = 0; - } + ThreadPool.QueueUserWorkItem(new WaitCallback(WorldGen.worldGenCallBack), (object) progress); } public static void SaveAndQuitCallBack(object threadContext) { - int netMode = Main.netMode; try { - SoundEngine.PlaySound(34, Style: 0); - SoundEngine.PlaySound(35, Style: 0); + Main.PlaySound(34, Style: 0); + Main.PlaySound(35, Style: 0); } catch { } - if (netMode == 0) + if (Main.netMode == 0) WorldFile.CacheSaveTime(); - Main.invasionProgress = -1; + Main.invasionProgress = 0; Main.invasionProgressDisplayLeft = 0; Main.invasionProgressAlpha = 0.0f; - Main.invasionProgressIcon = 0; Main.menuMode = 10; Main.gameMenu = true; - SoundEngine.StopTrackedSounds(); + Main.StopTrackedSounds(); CaptureInterface.ResetFocus(); Main.ActivePlayerFileData.StopPlayTimer(); Player.SavePlayer(Main.ActivePlayerFileData); - Player.ClearPlayerTempInfo(); - Rain.ClearRain(); - if (netMode == 0) + if (Main.netMode == 0) { - WorldFile.SaveWorld(); - SoundEngine.PlaySound(10); + WorldFile.saveWorld(); + Main.PlaySound(10); } else { - Netplay.Disconnect = true; + Netplay.disconnect = true; Main.netMode = 0; } Main.fastForwardTime = false; - Main.UpdateTimeRate(); + Main.UpdateSundial(); Main.menuMode = 0; if (threadContext == null) return; @@ -1799,7 +1527,7 @@ namespace Terraria public static void SaveAndQuit(Action callback = null) { - SoundEngine.PlaySound(11); + Main.PlaySound(11); ThreadPool.QueueUserWorkItem(new WaitCallback(WorldGen.SaveAndQuitCallBack), (object) callback); } @@ -1813,10 +1541,10 @@ namespace Terraria Main.player[index].active = false; } WorldGen.noMapUpdate = true; - WorldFile.LoadWorld(Main.ActiveWorldFileData.IsCloudSave); + WorldFile.loadWorld(Main.ActiveWorldFileData.IsCloudSave); if (WorldGen.loadFailed || !WorldGen.loadSuccess) { - WorldFile.LoadWorld(Main.ActiveWorldFileData.IsCloudSave); + WorldFile.loadWorld(Main.ActiveWorldFileData.IsCloudSave); if (WorldGen.loadFailed || !WorldGen.loadSuccess) { bool isCloudSave = Main.ActiveWorldFileData.IsCloudSave; @@ -1836,10 +1564,10 @@ namespace Terraria FileUtilities.Copy(Main.worldPathName, Main.worldPathName + ".bad", isCloudSave); FileUtilities.Copy(Main.worldPathName + ".bak", Main.worldPathName, isCloudSave); FileUtilities.Delete(Main.worldPathName + ".bak", isCloudSave); - WorldFile.LoadWorld(Main.ActiveWorldFileData.IsCloudSave); + WorldFile.loadWorld(Main.ActiveWorldFileData.IsCloudSave); if (WorldGen.loadFailed || !WorldGen.loadSuccess) { - WorldFile.LoadWorld(Main.ActiveWorldFileData.IsCloudSave); + WorldFile.loadWorld(Main.ActiveWorldFileData.IsCloudSave); if (WorldGen.loadFailed || !WorldGen.loadSuccess) { FileUtilities.Copy(Main.worldPathName, Main.worldPathName + ".bak", isCloudSave); @@ -1873,19 +1601,20 @@ namespace Terraria Main.gameMenu = false; if (Main.netMode == 0 && Main.anglerWhoFinishedToday.Contains(Main.player[Main.myPlayer].name)) Main.anglerQuestFinished = true; - Main.player[Main.myPlayer].Spawn(PlayerSpawnContext.SpawningIntoWorld); + Main.player[Main.myPlayer].Spawn(); + Main.player[Main.myPlayer].Update(Main.myPlayer); Main.ActivePlayerFileData.StartPlayTimer(); WorldGen._lastSeed = Main.ActiveWorldFileData.Seed; Player.Hooks.EnterWorld(Main.myPlayer); WorldFile.SetOngoingToTemps(); - SoundEngine.PlaySound(11); + Main.PlaySound(11); Main.resetClouds = true; WorldGen.noMapUpdate = false; } public static void playWorld() => ThreadPool.QueueUserWorkItem(new WaitCallback(WorldGen.playWorldCallBack), (object) 1); - public static void saveAndPlayCallBack(object threadContext) => WorldFile.SaveWorld(); + public static void saveAndPlayCallBack(object threadContext) => WorldFile.saveWorld(); public static void saveAndPlay() => ThreadPool.QueueUserWorkItem(new WaitCallback(WorldGen.saveAndPlayCallBack), (object) 1); @@ -1893,13 +1622,13 @@ namespace Terraria public static void saveToonWhilePlaying() => ThreadPool.QueueUserWorkItem(new WaitCallback(WorldGen.saveToonWhilePlayingCallBack), (object) 1); - public static void serverLoadWorldCallBack() + public static void serverLoadWorldCallBack(object threadContext) { Main.rand = new UnifiedRandom((int) DateTime.Now.Ticks); - WorldFile.LoadWorld(Main.ActiveWorldFileData.IsCloudSave); + WorldFile.loadWorld(Main.ActiveWorldFileData.IsCloudSave); if (WorldGen.loadFailed || !WorldGen.loadSuccess) { - WorldFile.LoadWorld(Main.ActiveWorldFileData.IsCloudSave); + WorldFile.loadWorld(Main.ActiveWorldFileData.IsCloudSave); if (WorldGen.loadFailed || !WorldGen.loadSuccess) { bool isCloudSave = Main.ActiveWorldFileData.IsCloudSave; @@ -1918,10 +1647,10 @@ namespace Terraria { FileUtilities.Copy(Main.worldPathName + ".bak", Main.worldPathName, isCloudSave); FileUtilities.Delete(Main.worldPathName + ".bak", isCloudSave); - WorldFile.LoadWorld(Main.ActiveWorldFileData.IsCloudSave); + WorldFile.loadWorld(Main.ActiveWorldFileData.IsCloudSave); if (WorldGen.loadFailed || !WorldGen.loadSuccess) { - WorldFile.LoadWorld(Main.ActiveWorldFileData.IsCloudSave); + WorldFile.loadWorld(Main.ActiveWorldFileData.IsCloudSave); if (WorldGen.loadFailed || !WorldGen.loadSuccess) { Console.WriteLine(Language.GetTextValue("Error.LoadFailed")); @@ -1937,21 +1666,16 @@ namespace Terraria } } WorldGen._lastSeed = Main.ActiveWorldFileData.Seed; - SoundEngine.PlaySound(10); + Main.PlaySound(10); + Netplay.StartServer(); WorldFile.SetOngoingToTemps(); WorldGen.Hooks.WorldLoaded(); } - public static Task serverLoadWorld() => Task.Factory.StartNew(new Action(WorldGen.serverLoadWorldCallBack)); + public static void serverLoadWorld() => ThreadPool.QueueUserWorkItem(new WaitCallback(WorldGen.serverLoadWorldCallBack), (object) 1); public static void clearWorld() { - Main.getGoodWorld = false; - Main.drunkWorld = false; - NPC.ResetBadgerHatTime(); - NPC.freeCake = false; - Main.mapDelay = 2; - Main.ResetWindCounter(true); WorldGen.TownManager = new TownRoomManager(); WorldGen.Hooks.ClearWorld(); TileEntity.Clear(); @@ -1967,9 +1691,6 @@ namespace Terraria Main.Map.Clear(); } NPC.MoonLordCountdown = 0; - Main.forceHalloweenForToday = false; - Main.forceXMasForToday = false; - NPC.RevengeManager.Reset(); Main.pumpkinMoon = false; Main.clearMap = true; Main.mapTime = 0; @@ -1979,15 +1700,12 @@ namespace Terraria Main.eclipse = false; Main.slimeRain = false; Main.slimeRainTime = 0.0; - Main.slimeWarningTime = 0; Main.sundialCooldown = 0; Main.fastForwardTime = false; BirthdayParty.WorldClear(); - LanternNight.WorldClear(); - WorldGen.mysticLogsEvent.WorldClear(); Sandstorm.WorldClear(); - Main.UpdateTimeRate(); - Main.wofNPCIndex = -1; + Main.UpdateSundial(); + Main.wof = -1; NPC.waveKills = 0.0f; WorldGen.spawnHardBoss = 0; WorldGen.totalSolid2 = 0; @@ -2006,16 +1724,12 @@ namespace Terraria WorldGen.tBlood = (byte) 0; WorldGen.tGood = (byte) 0; WorldGen.spawnEye = false; - WorldGen.prioritizedTownNPCType = 0; + WorldGen.prioritizedTownNPC = 0; WorldGen.shadowOrbCount = 0; WorldGen.altarCount = 0; - WorldGen.SavedOreTiers.Copper = -1; - WorldGen.SavedOreTiers.Iron = -1; - WorldGen.SavedOreTiers.Silver = -1; - WorldGen.SavedOreTiers.Gold = -1; - WorldGen.SavedOreTiers.Cobalt = -1; - WorldGen.SavedOreTiers.Mythril = -1; - WorldGen.SavedOreTiers.Adamantite = -1; + WorldGen.oreTier1 = -1; + WorldGen.oreTier2 = -1; + WorldGen.oreTier3 = -1; Main.cloudBGActive = 0.0f; Main.raining = false; Main.hardMode = false; @@ -2042,9 +1756,6 @@ namespace Terraria NPC.downedChristmasTree = false; NPC.downedPlantBoss = false; NPC.downedGolemBoss = false; - NPC.downedEmpressOfLight = false; - NPC.downedQueenSlime = false; - NPC.combatBookWasUsed = false; NPC.savedStylist = false; NPC.savedGoblin = false; NPC.savedWizard = false; @@ -2052,10 +1763,6 @@ namespace Terraria NPC.savedTaxCollector = false; NPC.savedAngler = false; NPC.savedBartender = false; - NPC.savedGolfer = false; - NPC.boughtCat = false; - NPC.boughtDog = false; - NPC.boughtBunny = false; NPC.downedGoblins = false; NPC.downedClown = false; NPC.downedFrost = false; @@ -2074,10 +1781,6 @@ namespace Terraria NPC.TowerActiveSolar = num2 != 0; DD2Event.ResetProgressEntirely(); NPC.ClearFoundActiveNPCs(); - Main.BestiaryTracker.Reset(); - Main.PylonSystem.Reset(); - CreativePowerManager.Instance.Reset(); - Main.CreativeMenu.Reset(); WorldGen.shadowOrbSmashed = false; WorldGen.spawnMeteor = false; WorldGen.stopDrops = false; @@ -2126,35 +1829,32 @@ namespace Terraria } } } - for (int index = 0; index < Main.countsAsHostForGameplay.Length; ++index) - Main.countsAsHostForGameplay[index] = false; CombatText.clearAll(); for (int index = 0; index < 6000; ++index) { Main.dust[index] = new Dust(); Main.dust[index].dustIndex = index; } - for (int index = 0; index < 600; ++index) + for (int index = 0; index < 500; ++index) Main.gore[index] = new Gore(); for (int index = 0; index < 400; ++index) { Main.item[index] = new Item(); - Main.timeItemSlotCannotBeReusedFor[index] = 0; + Main.itemLockoutTime[index] = 0; } for (int index = 0; index < 200; ++index) Main.npc[index] = new NPC(); for (int index = 0; index < 1000; ++index) Main.projectile[index] = new Projectile(); - for (int index = 0; index < 8000; ++index) + for (int index = 0; index < 1000; ++index) Main.chest[index] = (Chest) null; for (int index = 0; index < 1000; ++index) Main.sign[index] = (Sign) null; - for (int index = 0; index < Liquid.maxLiquid; ++index) + for (int index = 0; index < Liquid.resLiquid; ++index) Main.liquid[index] = new Liquid(); - for (int index = 0; index < 50000; ++index) + for (int index = 0; index < 10000; ++index) Main.liquidBuffer[index] = new LiquidBuffer(); WorldGen.setWorldSize(); - Star.SpawnStars(); WorldGen.worldCleared = true; } @@ -2163,74 +1863,128 @@ namespace Terraria switch (bg) { case 0: - WorldGen.treeBG1 = style; - WorldGen.SetForestBGSet(style, Main.treeMntBGSet1, Main.treeBGSet1); - break; - case 1: - WorldGen.corruptBG = style; + WorldGen.treeBG = style; + Main.treeMntBG[0] = 7; + Main.treeMntBG[1] = 8; switch (style) { case 1: - Main.corruptBG[0] = 56; - Main.corruptBG[1] = 57; - Main.corruptBG[2] = 58; + Main.treeBG[0] = 50; + Main.treeBG[1] = 51; + Main.treeBG[2] = 52; return; case 2: - Main.corruptBG[0] = 211; - Main.corruptBG[1] = 212; - Main.corruptBG[2] = 213; + Main.treeBG[0] = 53; + Main.treeBG[1] = 54; + Main.treeBG[2] = 55; return; case 3: - Main.corruptBG[0] = 225; - Main.corruptBG[1] = 226; - Main.corruptBG[2] = 227; + Main.treeMntBG[1] = 90; + Main.treeBG[0] = 91; + Main.treeBG[1] = -1; + Main.treeBG[2] = 92; return; case 4: - Main.corruptBG[0] = 240; - Main.corruptBG[1] = 241; - Main.corruptBG[2] = 242; - return; - default: - Main.corruptBG[0] = 12; - Main.corruptBG[1] = 13; - Main.corruptBG[2] = 14; - return; - } - case 2: - WorldGen.jungleBG = style; - switch (style) - { - case 1: - Main.jungleBG[0] = 59; - Main.jungleBG[1] = 60; - Main.jungleBG[2] = 61; - return; - case 2: - Main.jungleBG[0] = 222; - Main.jungleBG[1] = 223; - Main.jungleBG[2] = 224; - return; - case 3: - Main.jungleBG[0] = 237; - Main.jungleBG[1] = 238; - Main.jungleBG[2] = 239; - return; - case 4: - Main.jungleBG[0] = 284; - Main.jungleBG[1] = 285; - Main.jungleBG[2] = 286; + Main.treeMntBG[0] = 93; + Main.treeMntBG[1] = 94; + Main.treeBG[0] = -1; + Main.treeBG[1] = -1; + Main.treeBG[2] = -1; return; case 5: - Main.jungleBG[0] = 271; - Main.jungleBG[1] = 272; - Main.jungleBG[2] = 273; + Main.treeMntBG[0] = 93; + Main.treeMntBG[1] = 94; + Main.treeBG[0] = -1; + Main.treeBG[1] = -1; + Main.treeBG[2] = 55; + return; + case 6: + Main.treeMntBG[0] = 171; + Main.treeMntBG[1] = 172; + Main.treeBG[0] = 173; + Main.treeBG[1] = -1; + Main.treeBG[2] = -1; + return; + case 7: + Main.treeMntBG[0] = 176; + Main.treeMntBG[1] = 177; + Main.treeBG[0] = 178; + Main.treeBG[1] = -1; + Main.treeBG[2] = -1; + return; + case 8: + Main.treeMntBG[0] = 179; + Main.treeMntBG[1] = 180; + Main.treeBG[0] = 184; + Main.treeBG[1] = -1; + Main.treeBG[2] = -1; + return; + case 31: + Main.treeMntBG[1] = 90; + Main.treeBG[0] = 91; + Main.treeBG[1] = -1; + Main.treeBG[2] = 11; + return; + case 51: + Main.treeMntBG[0] = 93; + Main.treeMntBG[1] = 94; + Main.treeBG[0] = -1; + Main.treeBG[1] = -1; + Main.treeBG[2] = 11; + return; + case 71: + Main.treeMntBG[0] = 176; + Main.treeMntBG[1] = 177; + Main.treeBG[0] = 178; + Main.treeBG[1] = -1; + Main.treeBG[2] = 11; + return; + case 72: + Main.treeMntBG[0] = 176; + Main.treeMntBG[1] = 177; + Main.treeBG[0] = 178; + Main.treeBG[1] = -1; + Main.treeBG[2] = 52; + return; + case 73: + Main.treeMntBG[0] = 176; + Main.treeMntBG[1] = 177; + Main.treeBG[0] = 178; + Main.treeBG[1] = -1; + Main.treeBG[2] = 55; return; default: - Main.jungleBG[0] = 15; - Main.jungleBG[1] = 16; - Main.jungleBG[2] = 17; + Main.treeBG[0] = 9; + Main.treeBG[1] = 10; + Main.treeBG[2] = 11; return; } + case 1: + WorldGen.corruptBG = style; + if (style == 1) + { + Main.corruptBG[0] = 56; + Main.corruptBG[1] = 57; + Main.corruptBG[2] = 58; + break; + } + Main.corruptBG[0] = 12; + Main.corruptBG[1] = 13; + Main.corruptBG[2] = 14; + break; + case 2: + WorldGen.jungleBG = style; + if (style == 1) + { + Main.jungleBG[0] = 59; + Main.jungleBG[1] = 60; + Main.jungleBG[2] = 61; + break; + } + Main.jungleBG[0] = 15; + Main.jungleBG[1] = 16; + Main.jungleBG[2] = 17; + break; case 3: WorldGen.snowBG = style; Main.snowMntBG[0] = 35; @@ -2263,27 +2017,6 @@ namespace Terraria Main.snowBG[1] = -1; Main.snowBG[2] = -1; return; - case 5: - Main.snowMntBG[0] = -1; - Main.snowMntBG[1] = -1; - Main.snowBG[0] = 258; - Main.snowBG[1] = 259; - Main.snowBG[2] = 260; - return; - case 6: - Main.snowMntBG[0] = -1; - Main.snowMntBG[1] = -1; - Main.snowBG[0] = 263; - Main.snowBG[1] = 264; - Main.snowBG[2] = 265; - return; - case 7: - Main.snowMntBG[0] = 269; - Main.snowMntBG[1] = 270; - Main.snowBG[0] = 267; - Main.snowBG[1] = 266; - Main.snowBG[2] = 268; - return; case 21: Main.snowMntBG[0] = 98; Main.snowMntBG[1] = 99; @@ -2334,463 +2067,108 @@ namespace Terraria } case 4: WorldGen.hallowBG = style; - switch (style) + if (style == 1) { - case 1: - Main.hallowBG[0] = 102; - Main.hallowBG[1] = 103; - Main.hallowBG[2] = 104; - return; - case 2: - Main.hallowBG[0] = 219; - Main.hallowBG[1] = 220; - Main.hallowBG[2] = 221; - return; - case 3: - Main.hallowBG[0] = 243; - Main.hallowBG[1] = 244; - Main.hallowBG[2] = 245; - return; - case 4: - Main.hallowBG[0] = -1; - Main.hallowBG[1] = 261; - Main.hallowBG[2] = 262; - return; - default: - Main.hallowBG[0] = 29; - Main.hallowBG[1] = 30; - Main.hallowBG[2] = 31; - return; - } - case 5: - WorldGen.crimsonBG = style; - switch (style) - { - case 1: - Main.crimsonBG[0] = 105; - Main.crimsonBG[1] = 106; - Main.crimsonBG[2] = 107; - return; - case 2: - Main.crimsonBG[0] = 174; - Main.crimsonBG[1] = -1; - Main.crimsonBG[2] = 175; - return; - case 3: - Main.crimsonBG[0] = 214; - Main.crimsonBG[1] = 215; - Main.crimsonBG[2] = 216; - return; - case 4: - Main.crimsonBG[0] = -1; - Main.crimsonBG[1] = 229; - Main.crimsonBG[2] = 230; - return; - case 5: - Main.crimsonBG[0] = (int) byte.MaxValue; - Main.crimsonBG[1] = 256; - Main.crimsonBG[2] = 257; - return; - default: - Main.crimsonBG[0] = 43; - Main.crimsonBG[1] = 44; - Main.crimsonBG[2] = 45; - return; - } - case 6: - WorldGen.desertBG = style; - switch (style) - { - case 1: - Main.desertBG[0] = 108; - Main.desertBG[1] = 109; - Main.desertBG[2] = -1; - return; - case 2: - Main.desertBG[0] = 207; - Main.desertBG[1] = 208; - Main.desertBG[2] = -1; - return; - case 3: - Main.desertBG[0] = 217; - Main.desertBG[1] = 218; - Main.desertBG[2] = -1; - return; - case 4: - Main.desertBG[0] = 248; - Main.desertBG[1] = 249; - Main.desertBG[2] = 250; - return; - default: - Main.desertBG[0] = 21; - Main.desertBG[1] = 20; - Main.desertBG[2] = -1; - return; - } - case 7: - WorldGen.oceanBG = style; - switch (style) - { - case 1: - Main.oceanBG = 110; - return; - case 2: - Main.oceanBG = 111; - return; - case 3: - Main.oceanBG = 209; - return; - case 4: - Main.oceanBG = 210; - return; - case 5: - Main.oceanBG = 283; - return; - default: - Main.oceanBG = 28; - return; - } - case 8: - WorldGen.mushroomBG = style; - switch (style) - { - case 1: - Main.mushroomBG[0] = 231; - Main.mushroomBG[1] = 232; - Main.mushroomBG[2] = 233; - return; - case 2: - Main.mushroomBG[0] = 234; - Main.mushroomBG[1] = 235; - Main.mushroomBG[2] = 236; - return; - case 3: - Main.mushroomBG[0] = 287; - Main.mushroomBG[1] = 288; - Main.mushroomBG[2] = 289; - return; - default: - Main.mushroomBG[0] = 46; - Main.mushroomBG[1] = 47; - Main.mushroomBG[2] = 48; - return; - } - case 9: - WorldGen.underworldBG = style; - if (style != 1) - { - if (style != 2) - { - Main.underworldBG[0] = 0; - Main.underworldBG[1] = 1; - Main.underworldBG[2] = 2; - Main.underworldBG[3] = 3; - Main.underworldBG[4] = 4; - break; - } - Main.underworldBG[0] = 10; - Main.underworldBG[1] = 11; - Main.underworldBG[2] = 12; - Main.underworldBG[3] = 13; - Main.underworldBG[4] = 9; + Main.hallowBG[0] = 102; + Main.hallowBG[1] = 103; + Main.hallowBG[2] = 104; break; } - Main.underworldBG[0] = 5; - Main.underworldBG[1] = 6; - Main.underworldBG[2] = 7; - Main.underworldBG[3] = 8; - Main.underworldBG[4] = 9; - break; - case 10: - WorldGen.treeBG2 = style; - WorldGen.SetForestBGSet(style, Main.treeMntBGSet2, Main.treeBGSet2); - break; - case 11: - WorldGen.treeBG3 = style; - WorldGen.SetForestBGSet(style, Main.treeMntBGSet3, Main.treeBGSet3); - break; - case 12: - WorldGen.treeBG4 = style; - WorldGen.SetForestBGSet(style, Main.treeMntBGSet4, Main.treeBGSet4); - break; - } - } - - private static void SetForestBGSet(int style, int[] mountainSet, int[] treeSet) - { - mountainSet[0] = 7; - mountainSet[1] = 8; - switch (style) - { - case 1: - treeSet[0] = 50; - treeSet[1] = 51; - treeSet[2] = 52; - break; - case 2: - treeSet[0] = 53; - treeSet[1] = 54; - treeSet[2] = 55; - break; - case 3: - mountainSet[1] = 90; - treeSet[0] = 91; - treeSet[1] = -1; - treeSet[2] = 92; - break; - case 4: - mountainSet[0] = 93; - mountainSet[1] = 94; - treeSet[0] = -1; - treeSet[1] = -1; - treeSet[2] = -1; + Main.hallowBG[0] = 29; + Main.hallowBG[1] = 30; + Main.hallowBG[2] = 31; break; case 5: - mountainSet[0] = 93; - mountainSet[1] = 94; - treeSet[0] = -1; - treeSet[1] = -1; - treeSet[2] = 55; + WorldGen.crimsonBG = style; + if (style == 1) + { + Main.crimsonBG[0] = 105; + Main.crimsonBG[1] = 106; + Main.crimsonBG[2] = 107; + } + if (style == 2) + { + Main.crimsonBG[0] = 174; + Main.crimsonBG[1] = -1; + Main.crimsonBG[2] = 175; + break; + } + Main.crimsonBG[0] = 43; + Main.crimsonBG[1] = 44; + Main.crimsonBG[2] = 45; break; case 6: - mountainSet[0] = 171; - mountainSet[1] = 172; - treeSet[0] = 173; - treeSet[1] = -1; - treeSet[2] = -1; + WorldGen.desertBG = style; + if (style == 1) + { + Main.desertBG[0] = 108; + Main.desertBG[1] = 109; + break; + } + Main.desertBG[0] = 21; + Main.desertBG[1] = 20; break; case 7: - mountainSet[0] = 176; - mountainSet[1] = 177; - treeSet[0] = 178; - treeSet[1] = -1; - treeSet[2] = -1; - break; - case 8: - mountainSet[0] = 179; - mountainSet[1] = 180; - treeSet[0] = 184; - treeSet[1] = -1; - treeSet[2] = -1; - break; - case 9: - mountainSet[0] = 277; - mountainSet[1] = 278; - treeSet[0] = 279; - treeSet[1] = -1; - treeSet[2] = -1; - break; - case 10: - mountainSet[0] = 280; - mountainSet[1] = 281; - treeSet[0] = 282; - treeSet[1] = -1; - treeSet[2] = -1; - break; - case 31: - mountainSet[1] = 90; - treeSet[0] = 91; - treeSet[1] = -1; - treeSet[2] = 11; - break; - case 51: - mountainSet[0] = 93; - mountainSet[1] = 94; - treeSet[0] = -1; - treeSet[1] = -1; - treeSet[2] = 11; - break; - case 71: - mountainSet[0] = 176; - mountainSet[1] = 177; - treeSet[0] = 178; - treeSet[1] = -1; - treeSet[2] = 11; - break; - case 72: - mountainSet[0] = 176; - mountainSet[1] = 177; - treeSet[0] = 178; - treeSet[1] = -1; - treeSet[2] = 52; - break; - case 73: - mountainSet[0] = 176; - mountainSet[1] = 177; - treeSet[0] = 178; - treeSet[1] = -1; - treeSet[2] = 55; - break; - default: - treeSet[0] = 9; - treeSet[1] = 10; - treeSet[2] = 11; + WorldGen.oceanBG = style; + if (style == 1) + { + Main.oceanBG = 110; + break; + } + if (style == 2) + { + Main.oceanBG = 111; + break; + } + Main.oceanBG = 28; break; } } public static void RandomizeWeather() { - Main.numClouds = WorldGen.genRand.Next(10, 200); - Main.windSpeedCurrent = 0.0f; - while ((double) Main.windSpeedCurrent == 0.0) + if (Main.cloudLimit < 10) + return; + Main.numClouds = WorldGen.genRand.Next(10, Main.cloudLimit); + Main.windSpeed = 0.0f; + while ((double) Main.windSpeed == 0.0) { - Main.windSpeedCurrent = (float) WorldGen.genRand.Next(-400, 401) * (1f / 1000f); - Main.windSpeedTarget = Main.windSpeedCurrent; + Main.windSpeed = (float) WorldGen.genRand.Next(-100, 101) * 0.01f; + Main.windSpeedSet = Main.windSpeed; } Cloud.resetClouds(); } - public static void RandomizeMoonState() => Main.moonType = WorldGen.genRand.Next(9); + public static void RandomizeMoonState() => Main.moonType = WorldGen.genRand.Next(Main.maxMoons); - public static void RandomizeBackgroundBasedOnPlayer(UnifiedRandom random, Player player) + public static void RandomizeBackgrounds() { - if (player.ZoneGlowshroom) - { - int mushroomBg = WorldGen.mushroomBG; - while (mushroomBg == WorldGen.mushroomBG) - WorldGen.setBG(8, random.Next(4)); - } - else if (player.ZoneUnderworldHeight) - { - int underworldBg = WorldGen.underworldBG; - while (underworldBg == WorldGen.underworldBG) - WorldGen.setBG(9, random.Next(3)); - } - else if (player.ZoneDesert) - { - int desertBg = WorldGen.desertBG; - while (desertBg == WorldGen.desertBG) - WorldGen.setBG(6, random.Next(5)); - } - else if (player.ZoneHallow) - { - int hallowBg = WorldGen.hallowBG; - while (hallowBg == WorldGen.hallowBG) - WorldGen.setBG(4, random.Next(5)); - } - else if (player.ZoneCorrupt) - { - int corruptBg = WorldGen.corruptBG; - while (corruptBg == WorldGen.corruptBG) - WorldGen.setBG(1, random.Next(5)); - } - else if (player.ZoneCrimson) - { - int crimsonBg = WorldGen.crimsonBG; - while (crimsonBg == WorldGen.crimsonBG) - WorldGen.setBG(5, random.Next(6)); - } - else if (player.ZoneJungle) - { - int jungleBg = WorldGen.jungleBG; - while (jungleBg == WorldGen.jungleBG) - WorldGen.setBG(2, random.Next(6)); - } - else if (player.ZoneSnow) - { - int snowBg = WorldGen.snowBG; - while (snowBg == WorldGen.snowBG) - { - WorldGen.snowBG = random.Next(8); - if (WorldGen.snowBG == 2 && random.Next(2) == 0) - WorldGen.snowBG = random.Next(2) != 0 ? 22 : 21; - if (WorldGen.snowBG == 3 && random.Next(2) == 0) - WorldGen.snowBG = random.Next(2) != 0 ? 32 : 31; - if (WorldGen.snowBG == 4 && random.Next(2) == 0) - WorldGen.snowBG = random.Next(2) != 0 ? 42 : 41; - WorldGen.setBG(3, WorldGen.snowBG); - } - } - else if (player.ZoneBeach) - { - int oceanBg = WorldGen.oceanBG; - while (oceanBg == WorldGen.oceanBG) - WorldGen.setBG(7, random.Next(6)); - } - else - { - int num = (int) ((double) player.Center.X / 16.0); - if (num < Main.treeX[0]) - { - int treeBg1 = WorldGen.treeBG1; - while (treeBg1 == WorldGen.treeBG1) - WorldGen.treeBG1 = WorldGen.RollRandomForestBGStyle(random); - WorldGen.setBG(0, WorldGen.treeBG1); - } - else if (num < Main.treeX[1]) - { - int treeBg2 = WorldGen.treeBG2; - while (treeBg2 == WorldGen.treeBG2) - WorldGen.treeBG2 = WorldGen.RollRandomForestBGStyle(random); - WorldGen.setBG(10, WorldGen.treeBG2); - } - else if (num < Main.treeX[2]) - { - int treeBg3 = WorldGen.treeBG3; - while (treeBg3 == WorldGen.treeBG3) - WorldGen.treeBG3 = WorldGen.RollRandomForestBGStyle(random); - WorldGen.setBG(11, WorldGen.treeBG3); - } - else - { - int treeBg4 = WorldGen.treeBG4; - while (treeBg4 == WorldGen.treeBG4) - WorldGen.treeBG4 = WorldGen.RollRandomForestBGStyle(random); - WorldGen.setBG(12, WorldGen.treeBG4); - } - } - WorldGen.BackgroundsCache.UpdateCache(); - } - - public static void RandomizeBackgrounds(UnifiedRandom random) - { - WorldGen.treeBG1 = WorldGen.RollRandomForestBGStyle(random); - WorldGen.treeBG2 = WorldGen.RollRandomForestBGStyle(random); - while (WorldGen.treeBG2 == WorldGen.treeBG1) - WorldGen.treeBG2 = WorldGen.RollRandomForestBGStyle(random); - WorldGen.treeBG3 = WorldGen.RollRandomForestBGStyle(random); - while (WorldGen.treeBG3 == WorldGen.treeBG1 || WorldGen.treeBG3 == WorldGen.treeBG2) - WorldGen.treeBG3 = WorldGen.RollRandomForestBGStyle(random); - WorldGen.treeBG4 = WorldGen.RollRandomForestBGStyle(random); - while (WorldGen.treeBG4 == WorldGen.treeBG1 || WorldGen.treeBG4 == WorldGen.treeBG2 || WorldGen.treeBG4 == WorldGen.treeBG3) - WorldGen.treeBG4 = WorldGen.RollRandomForestBGStyle(random); - WorldGen.setBG(0, WorldGen.treeBG1); - WorldGen.setBG(10, WorldGen.treeBG2); - WorldGen.setBG(11, WorldGen.treeBG3); - WorldGen.setBG(12, WorldGen.treeBG4); - WorldGen.setBG(1, random.Next(5)); - WorldGen.setBG(2, random.Next(6)); - WorldGen.snowBG = random.Next(8); - if (WorldGen.snowBG == 2 && random.Next(2) == 0) - WorldGen.snowBG = random.Next(2) != 0 ? 22 : 21; - if (WorldGen.snowBG == 3 && random.Next(2) == 0) - WorldGen.snowBG = random.Next(2) != 0 ? 32 : 31; - if (WorldGen.snowBG == 4 && random.Next(2) == 0) - WorldGen.snowBG = random.Next(2) != 0 ? 42 : 41; + WorldGen.treeBG = WorldGen.genRand.Next(9); + if ((WorldGen.treeBG == 1 || WorldGen.treeBG == 2) && WorldGen.genRand.Next(2) == 0) + WorldGen.treeBG = WorldGen.genRand.Next(7); + if (WorldGen.treeBG == 0) + WorldGen.treeBG = WorldGen.genRand.Next(7); + if (WorldGen.treeBG == 3 && WorldGen.genRand.Next(3) == 0) + WorldGen.treeBG = 31; + if (WorldGen.treeBG == 5 && WorldGen.genRand.Next(2) == 0) + WorldGen.treeBG = 51; + if (WorldGen.treeBG == 7 && WorldGen.genRand.Next(4) == 0) + WorldGen.treeBG = WorldGen.genRand.Next(71, 74); + WorldGen.setBG(0, WorldGen.treeBG); + WorldGen.setBG(1, WorldGen.genRand.Next(2)); + WorldGen.setBG(2, WorldGen.genRand.Next(2)); + WorldGen.snowBG = WorldGen.genRand.Next(6); + if (WorldGen.snowBG == 2 && WorldGen.genRand.Next(2) == 0) + WorldGen.snowBG = WorldGen.genRand.Next(2) != 0 ? 22 : 21; + if (WorldGen.snowBG == 3 && WorldGen.genRand.Next(2) == 0) + WorldGen.snowBG = WorldGen.genRand.Next(2) != 0 ? 32 : 31; + if (WorldGen.snowBG == 4 && WorldGen.genRand.Next(2) == 0) + WorldGen.snowBG = WorldGen.genRand.Next(2) != 0 ? 42 : 41; WorldGen.setBG(3, WorldGen.snowBG); - WorldGen.setBG(4, random.Next(5)); - WorldGen.setBG(5, random.Next(6)); - WorldGen.setBG(6, random.Next(5)); - WorldGen.setBG(7, random.Next(6)); - WorldGen.setBG(8, random.Next(4)); - WorldGen.setBG(9, random.Next(3)); - } - - private static int RollRandomForestBGStyle(UnifiedRandom random) - { - int num = random.Next(11); - if ((num == 1 || num == 2) && random.Next(2) == 0) - num = random.Next(11); - if (num == 0) - num = random.Next(11); - if (num == 3 && random.Next(3) == 0) - num = 31; - if (num == 5 && random.Next(2) == 0) - num = 51; - if (num == 7 && random.Next(4) == 0) - num = random.Next(71, 74); - return num; + WorldGen.setBG(4, WorldGen.genRand.Next(2)); + WorldGen.setBG(5, WorldGen.genRand.Next(3)); + WorldGen.setBG(6, WorldGen.genRand.Next(2)); + WorldGen.setBG(7, WorldGen.genRand.Next(3)); } public static void RandomizeTreeStyle() @@ -2805,11 +2183,6 @@ namespace Terraria Main.treeStyle[1] = WorldGen.genRand.Next(6); Main.treeX[1] = Main.maxTilesX; Main.treeX[2] = Main.maxTilesX; - for (int index = 0; index < 2; ++index) - { - if (Main.treeStyle[index] == 0 && WorldGen.genRand.Next(3) != 0) - Main.treeStyle[index] = 4; - } break; case 6400: Main.treeX[0] = WorldGen.genRand.Next((int) ((double) Main.maxTilesX * 0.334 - (double) Main.maxTilesX * 0.200000002980232), (int) ((double) Main.maxTilesX * 0.334 + (double) Main.maxTilesX * 0.200000002980232)); @@ -2822,11 +2195,6 @@ namespace Terraria while (Main.treeStyle[2] == Main.treeStyle[0] || Main.treeStyle[2] == Main.treeStyle[1]) Main.treeStyle[2] = WorldGen.genRand.Next(6); Main.treeX[2] = Main.maxTilesX; - for (int index = 0; index < 3; ++index) - { - if (Main.treeStyle[index] == 0 && WorldGen.genRand.Next(3) != 0) - Main.treeStyle[index] = 4; - } break; default: Main.treeX[0] = WorldGen.genRand.Next((int) ((double) Main.maxTilesX * 0.25 - (double) Main.maxTilesX * 0.150000005960464), (int) ((double) Main.maxTilesX * 0.25 + (double) Main.maxTilesX * 0.150000005960464)); @@ -2842,11 +2210,6 @@ namespace Terraria Main.treeStyle[2] = WorldGen.genRand.Next(6); while (Main.treeStyle[3] == Main.treeStyle[0] || Main.treeStyle[3] == Main.treeStyle[1] || Main.treeStyle[3] == Main.treeStyle[2]) Main.treeStyle[3] = WorldGen.genRand.Next(6); - for (int index = 0; index < 4; ++index) - { - if (Main.treeStyle[index] == 0 && WorldGen.genRand.Next(3) != 0) - Main.treeStyle[index] = 4; - } break; } } @@ -2900,12 +2263,6 @@ namespace Terraria private static void ResetGenerator() { - WorldGen.numOrePatch = 0; - WorldGen.numTunnels = 0; - WorldGen.numLakes = 0; - WorldGen.numMushroomBiomes = 0; - WorldGen.numOceanCaveTreasure = 0; - WorldGen.numOasis = 0; WorldGen.mudWall = false; WorldGen.hellChest = 0; WorldGen.JungleX = 0; @@ -2915,8 +2272,7 @@ namespace Terraria WorldGen.dEnteranceX = 0; WorldGen.numDRooms = 0; WorldGen.numDDoors = 0; - WorldGen.generatedShadowKey = false; - WorldGen.numDungeonPlatforms = 0; + WorldGen.numDPlats = 0; WorldGen.numJChests = 0; WorldGen.JungleItemCount = 0; } @@ -2926,116 +2282,116 @@ namespace Terraria int num1 = 1; if (WorldGen.genRand.Next(3) == 0) num1 = 0; - int index1 = x2; - int y = y2; - while (!WorldGen.SolidOrSlopedTile(index1, y)) + int i1 = x2; + int j1 = y2; + while (!WorldGen.SolidTile(i1, j1)) { - ++y; - if (y >= Main.maxTilesY - 300) + ++j1; + if (j1 >= Main.maxTilesY - 300) return false; } - if (Main.tile[index1, y].type == (ushort) 232 || Main.tile[index1, y].type == (ushort) 10) + if (Main.tile[i1, j1].type == (ushort) 232) return false; - int j = y - 1; - if (Main.tile[index1, j].liquid > (byte) 0 && Main.tile[index1, j].lava()) + int j2 = j1 - 1; + if (Main.tile[i1, j2].liquid > (byte) 0 && Main.tile[i1, j2].lava()) return false; if (num1 == -1 && WorldGen.genRand.Next(20) == 0) num1 = 2; else if (num1 == -1) num1 = WorldGen.genRand.Next(2); - if (Main.tile[index1, j].nactive() || Main.tile[index1 - 1, j].nactive() || Main.tile[index1 + 1, j].nactive() || Main.tile[index1, j - 1].nactive() || Main.tile[index1 - 1, j - 1].nactive() || Main.tile[index1 + 1, j - 1].nactive() || Main.tile[index1, j - 2].nactive() || Main.tile[index1 - 1, j - 2].nactive() || Main.tile[index1 + 1, j - 2].nactive() || Main.tile[index1, j + 1].type == (ushort) 10 || Main.tile[index1, j + 1].type == (ushort) 48 || Main.tile[index1, j + 1].type == (ushort) 232) + if (Main.tile[i1, j2].nactive() || Main.tile[i1 - 1, j2].nactive() || Main.tile[i1 + 1, j2].nactive() || Main.tile[i1, j2 - 1].nactive() || Main.tile[i1 - 1, j2 - 1].nactive() || Main.tile[i1 + 1, j2 - 1].nactive() || Main.tile[i1, j2 - 2].nactive() || Main.tile[i1 - 1, j2 - 2].nactive() || Main.tile[i1 + 1, j2 - 2].nactive() || Main.tile[i1, j2 + 1].type == (ushort) 48 || Main.tile[i1, j2 + 1].type == (ushort) 232) return false; switch (num1) { case 0: - int x1 = index1; - int index2 = j - WorldGen.genRand.Next(3); - while (!WorldGen.SolidOrSlopedTile(x1, index2)) - --x1; - int x3 = x1; - int x4 = index1; - while (!WorldGen.SolidOrSlopedTile(x4, index2)) - ++x4; - int x5 = x4; - int num2 = index1 - x3; - int num3 = x5 - index1; + int i2 = i1; + int j3 = j2 - WorldGen.genRand.Next(3); + while (!WorldGen.SolidTile(i2, j3)) + --i2; + int i3 = i2; + int i4 = i1; + while (!WorldGen.SolidTile(i4, j3)) + ++i4; + int i5 = i4; + int num2 = i1 - i3; + int num3 = i5 - i1; bool flag1 = false; bool flag2 = false; if (num2 > 5 && num2 < 50) flag1 = true; if (num3 > 5 && num3 < 50) flag2 = true; - if (flag1 && !WorldGen.SolidOrSlopedTile(x3, index2 + 1)) + if (flag1 && !WorldGen.SolidTile(i3, j3 + 1)) flag1 = false; - if (flag2 && !WorldGen.SolidOrSlopedTile(x5, index2 + 1)) + if (flag2 && !WorldGen.SolidTile(i5, j3 + 1)) flag2 = false; - if (flag1 && (Main.tile[x3, index2].type == (ushort) 10 || Main.tile[x3, index2].type == (ushort) 48 || Main.tile[x3, index2 + 1].type == (ushort) 10 || Main.tile[x3, index2 + 1].type == (ushort) 48)) + if (flag1 && (Main.tile[i3, j3].type == (ushort) 10 || Main.tile[i3, j3].type == (ushort) 48 || Main.tile[i3, j3 + 1].type == (ushort) 10 || Main.tile[i3, j3 + 1].type == (ushort) 48)) flag1 = false; - if (flag2 && (Main.tile[x5, index2].type == (ushort) 10 || Main.tile[x5, index2].type == (ushort) 48 || Main.tile[x5, index2 + 1].type == (ushort) 10 || Main.tile[x5, index2 + 1].type == (ushort) 48)) + if (flag2 && (Main.tile[i5, j3].type == (ushort) 10 || Main.tile[i5, j3].type == (ushort) 48 || Main.tile[i5, j3 + 1].type == (ushort) 10 || Main.tile[i5, j3 + 1].type == (ushort) 48)) flag2 = false; int num4; - int i; + int i6; if (flag1 & flag2) { num4 = 1; - i = x3; + i6 = i3; if (WorldGen.genRand.Next(2) == 0) { - i = x5; + i6 = i5; num4 = -1; } } else if (flag2) { - i = x5; + i6 = i5; num4 = -1; } else { if (!flag1) return false; - i = x3; + i6 = i3; num4 = 1; } - if (Main.tile[i, index2].wall != (ushort) 87 || Main.tile[i, index2].type == (ushort) 190 || Main.tile[i, index2].type == (ushort) 135 || Main.tile[i, index2].type == (ushort) 137 || Main.tile[i, index2].type == (ushort) 232 || Main.tile[i, index2].type == (ushort) 237 || Main.tile[i, index2].type == (ushort) 10) + if (Main.tile[i6, j3].wall != (byte) 87 || Main.tile[i6, j3].type == (ushort) 190 || Main.tile[i6, j3].type == (ushort) 135 || Main.tile[i6, j3].type == (ushort) 137 || Main.tile[i6, j3].type == (ushort) 232) return false; - WorldGen.PlaceTile(index1, j, 135, true, true, style: 6); - WorldGen.KillTile(i, index2); + WorldGen.PlaceTile(i1, j2, 135, true, true, style: 6); + WorldGen.KillTile(i6, j3); int num5 = WorldGen.genRand.Next(3); - if (Main.tile[index1, j].wire()) + if (Main.tile[i1, j2].wire()) num5 = 0; - if (Main.tile[index1, j].wire2()) + if (Main.tile[i1, j2].wire2()) num5 = 1; - if (Main.tile[index1, j].wire3()) + if (Main.tile[i1, j2].wire3()) num5 = 2; - int num6 = Math.Abs(i - index1); + int num6 = Math.Abs(i6 - i1); int style1 = 1; if (num6 < 10 && WorldGen.genRand.Next(3) != 0) style1 = 2; - WorldGen.PlaceTile(i, index2, 137, true, true, style: style1); + WorldGen.PlaceTile(i6, j3, 137, true, true, style: style1); if (num4 == 1) - Main.tile[i, index2].frameX += (short) 18; + Main.tile[i6, j3].frameX += (short) 18; int num7 = WorldGen.genRand.Next(5); - int index3 = index2; + int j4 = j3; while (num7 > 0) { --num7; - --index3; - if (WorldGen.SolidTile(i, index3) && WorldGen.SolidTile(i - num4, index3) && !WorldGen.SolidOrSlopedTile(i + num4, index3)) + --j4; + if (WorldGen.SolidTile(i6, j4) && WorldGen.SolidTile(i6 - num4, j4) && !WorldGen.SolidTile(i6 + num4, j4)) { - WorldGen.PlaceTile(i, index3, 137, true, true, style: style1); + WorldGen.PlaceTile(i6, j4, 137, true, true, style: style1); if (num4 == 1) - Main.tile[i, index3].frameX += (short) 18; + Main.tile[i6, j4].frameX += (short) 18; switch (num5) { case 0: - Main.tile[i, index3].wire(true); + Main.tile[i6, j4].wire(true); continue; case 1: - Main.tile[i, index3].wire2(true); + Main.tile[i6, j4].wire2(true); continue; case 2: - Main.tile[i, index3].wire3(true); + Main.tile[i6, j4].wire3(true); continue; default: continue; @@ -3044,52 +2400,52 @@ namespace Terraria else break; } - int index4 = index1; - int index5 = j; - while (index4 != i || index5 != index2) + int index1 = i1; + int index2 = j2; + while (index1 != i6 || index2 != j3) { switch (num5) { case 0: - Main.tile[index4, index5].wire(true); + Main.tile[index1, index2].wire(true); break; case 1: - Main.tile[index4, index5].wire2(true); + Main.tile[index1, index2].wire2(true); break; case 2: - Main.tile[index4, index5].wire3(true); + Main.tile[index1, index2].wire3(true); break; } - if (index4 > i) - --index4; - if (index4 < i) - ++index4; + if (index1 > i6) + --index1; + if (index1 < i6) + ++index1; switch (num5) { case 0: - Main.tile[index4, index5].wire(true); + Main.tile[index1, index2].wire(true); break; case 1: - Main.tile[index4, index5].wire2(true); + Main.tile[index1, index2].wire2(true); break; case 2: - Main.tile[index4, index5].wire3(true); + Main.tile[index1, index2].wire3(true); break; } - if (index5 > index2) - --index5; - if (index5 < index2) - ++index5; + if (index2 > j3) + --index2; + if (index2 < j3) + ++index2; switch (num5) { case 0: - Main.tile[index4, index5].wire(true); + Main.tile[index1, index2].wire(true); continue; case 1: - Main.tile[index4, index5].wire2(true); + Main.tile[index1, index2].wire2(true); continue; case 2: - Main.tile[index4, index5].wire3(true); + Main.tile[index1, index2].wire3(true); continue; default: continue; @@ -3097,55 +2453,55 @@ namespace Terraria } return true; case 1: - int index6 = index1; - int index7 = j; - while (!WorldGen.SolidOrSlopedTile(index6, index7)) + int i7 = i1; + int j5 = j2; + while (!WorldGen.SolidTile(i7, j5)) { - --index7; - if ((double) index7 < Main.worldSurface) + --j5; + if ((double) j5 < Main.worldSurface) return false; } - int num8 = Math.Abs(index7 - j); + int num8 = Math.Abs(j5 - j2); if (num8 < 3) return false; int num9 = WorldGen.genRand.Next(3); - if (Main.tile[index1, j].wire()) + if (Main.tile[i1, j2].wire()) num9 = 0; - if (Main.tile[index1, j].wire2()) + if (Main.tile[i1, j2].wire2()) num9 = 1; - if (Main.tile[index1, j].wire3()) + if (Main.tile[i1, j2].wire3()) num9 = 2; int style2 = 3; if (num8 < 16 && WorldGen.genRand.Next(3) != 0) style2 = 4; - if (Main.tile[index6, index7].type == (ushort) 135 || Main.tile[index6, index7].type == (ushort) 137 || Main.tile[index6, index7].type == (ushort) 232 || Main.tile[index6, index7].type == (ushort) 237 || Main.tile[index6, index7].type == (ushort) 10 || Main.tile[index6, index7].wall != (ushort) 87) + if (Main.tile[i7, j5].type == (ushort) 135 || Main.tile[i7, j5].type == (ushort) 137 || Main.tile[i7, j5].type == (ushort) 232 || Main.tile[i7, j5].wall != (byte) 87) return false; - WorldGen.PlaceTile(index1, j, 135, true, true, style: 6); - WorldGen.PlaceTile(index6, index7, 137, true, true, style: style2); - for (int index8 = 0; index8 < 2; ++index8) + WorldGen.PlaceTile(i1, j2, 135, true, true, style: 6); + WorldGen.PlaceTile(i7, j5, 137, true, true, style: style2); + for (int index3 = 0; index3 < 2; ++index3) { int num10 = WorldGen.genRand.Next(1, 5); - int index9 = index6; + int i8 = i7; int num11 = -1; - if (index8 == 1) + if (index3 == 1) num11 = 1; while (num10 > 0) { --num10; - index9 += num11; - if (WorldGen.SolidTile(index9, index7 - 1) && !WorldGen.SolidOrSlopedTile(index9, index7 + 1)) + i8 += num11; + if (WorldGen.SolidTile(i8, j5 - 1) && !WorldGen.SolidTile(i8, j5 + 1)) { - WorldGen.PlaceTile(index9, index7, 137, true, true, style: style2); + WorldGen.PlaceTile(i8, j5, 137, true, true, style: style2); switch (num9) { case 0: - Main.tile[index9, index7].wire(true); + Main.tile[i8, j5].wire(true); continue; case 1: - Main.tile[index9, index7].wire2(true); + Main.tile[i8, j5].wire2(true); continue; case 2: - Main.tile[index9, index7].wire3(true); + Main.tile[i8, j5].wire3(true); continue; default: continue; @@ -3155,52 +2511,52 @@ namespace Terraria break; } } - int index10 = index1; - int index11 = j; - while (index10 != index6 || index11 != index7) + int index4 = i1; + int index5 = j2; + while (index4 != i7 || index5 != j5) { switch (num9) { case 0: - Main.tile[index10, index11].wire(true); + Main.tile[index4, index5].wire(true); break; case 1: - Main.tile[index10, index11].wire2(true); + Main.tile[index4, index5].wire2(true); break; case 2: - Main.tile[index10, index11].wire3(true); + Main.tile[index4, index5].wire3(true); break; } - if (index10 > index6) - --index10; - if (index10 < index6) - ++index10; + if (index4 > i7) + --index4; + if (index4 < i7) + ++index4; switch (num9) { case 0: - Main.tile[index10, index11].wire(true); + Main.tile[index4, index5].wire(true); break; case 1: - Main.tile[index10, index11].wire2(true); + Main.tile[index4, index5].wire2(true); break; case 2: - Main.tile[index10, index11].wire3(true); + Main.tile[index4, index5].wire3(true); break; } - if (index11 > index7) - --index11; - if (index11 < index7) - ++index11; + if (index5 > j5) + --index5; + if (index5 < j5) + ++index5; switch (num9) { case 0: - Main.tile[index10, index11].wire(true); + Main.tile[index4, index5].wire(true); continue; case 1: - Main.tile[index10, index11].wire2(true); + Main.tile[index4, index5].wire2(true); continue; case 2: - Main.tile[index10, index11].wire3(true); + Main.tile[index4, index5].wire3(true); continue; default: continue; @@ -3212,94 +2568,6 @@ namespace Terraria } } - public static bool placeLavaTrap(int x, int y) - { - int num1 = 5; - int num2 = 50; - int num3 = 40; - int num4 = 20; - int num5 = 4; - if (Main.tile[x, y].active() || Main.tile[x, y].liquid < byte.MaxValue || !Main.tile[x, y].lava()) - return false; - int num6 = 0; - for (int index1 = x - num1; index1 <= x + num1; ++index1) - { - for (int index2 = y - num1; index2 <= y + num1; ++index2) - { - if (Main.tile[index1, index2].lava() && !Main.tile[index1, index2].active() && Main.tile[index1, index2].liquid == byte.MaxValue) - ++num6; - } - } - if (num6 < num2) - return false; - int index3 = y; - while (!Main.tile[x, index3].active()) - { - ++index3; - if (index3 > Main.maxTilesY - 200) - return false; - } - if (!Main.tileSolid[(int) Main.tile[x, index3].type] || Main.tileSolidTop[(int) Main.tile[x, index3].type]) - return false; - int num7 = index3; - for (int index4 = x - num4; index4 <= x + num4; ++index4) - { - for (int index5 = index3 - num4; index5 <= index3 + num4; ++index5) - { - if (Main.tile[index4, index5].wire()) - return false; - } - } - while (Main.tile[x, index3].active() && Main.tileSolid[(int) Main.tile[x, index3].type] && !Main.tileSolidTop[(int) Main.tile[x, index3].type]) - { - ++index3; - if (index3 > Main.maxTilesY - 200) - return false; - } - Tile tile = Main.tile[x, index3 - 1]; - if (Main.tileDungeon[(int) tile.type] || tile.type == (ushort) 225 || tile.type == (ushort) 226) - return false; - int num8 = index3; - while (!Main.tile[x, index3].active()) - { - ++index3; - if (index3 > Main.maxTilesY - 200 || Main.tile[x, index3].liquid > (byte) 0) - return false; - } - if (!Main.tileSolid[(int) Main.tile[x, index3].type] || Main.tileSolidTop[(int) Main.tile[x, index3].type]) - return false; - int j = index3 - 1; - if (j - num7 > num3 || j - num8 < num5) - return false; - Main.tile[x, index3].slope((byte) 0); - Main.tile[x, index3].halfBrick(false); - WorldGen.PlaceTile(x, j, 135, forced: true, style: 7); - for (int index6 = num7; index6 <= j; ++index6) - { - Main.tile[x, index6].wire(true); - if (index6 < num8) - { - Main.tile[x, index6].slope((byte) 0); - Main.tile[x, index6].halfBrick(false); - Main.tile[x, index6].actuator(true); - } - } - return true; - } - - public static bool IsTileNearby(int x, int y, int type, int distance) - { - for (int x1 = x - distance; x1 <= x + distance; ++x1) - { - for (int y1 = y - distance; y1 <= y + distance; ++y1) - { - if (WorldGen.InWorld(x1, y1) && Main.tile[x1, y1].active() && (int) Main.tile[x1, y1].type == type) - return true; - } - } - return false; - } - public static bool placeTrap(int x2, int y2, int type = -1) { int index1 = x2; @@ -3309,13 +2577,11 @@ namespace Terraria while (!WorldGen.SolidTile(index1, j1)) { ++j1; - if (j1 > Main.maxTilesY - 10) - return false; if (j1 >= Main.maxTilesY - 300) flag2 = true; } int index2 = j1 - 1; - if (WorldGen.IsTileNearby(index1, index2, 70, 20) || Main.tile[index1, index2].wall == (ushort) 87) + if (Main.tile[index1, index2].wall == (byte) 87) return false; if (Main.tile[index1, index2].liquid > (byte) 0 && Main.tile[index1, index2].lava()) flag1 = true; @@ -3342,20 +2608,12 @@ namespace Terraria { int i1 = index1; int j2 = index2 - WorldGen.genRand.Next(3); - while (!WorldGen.SolidTile(i1, j2) && !Main.tileCracked[(int) Main.tile[i1, j2].type]) - { + while (!WorldGen.SolidTile(i1, j2)) --i1; - if (i1 < 0) - return false; - } int i2 = i1; int i3 = index1; - while (!WorldGen.SolidTile(i3, j2) && !Main.tileCracked[(int) Main.tile[i3, j2].type]) - { + while (!WorldGen.SolidTile(i3, j2)) ++i3; - if (i3 > Main.maxTilesX) - return false; - } int i4 = i3; int num1 = index1 - i2; int num2 = i4 - index1; @@ -3405,7 +2663,7 @@ namespace Terraria ++WorldGen.trapDiag[type, 0]; return false; } - if (Main.tile[index1, index2].wall > (ushort) 0) + if (Main.tile[index1, index2].wall > (byte) 0) WorldGen.PlaceTile(index1, index2, 135, true, true, style: 2); else WorldGen.PlaceTile(index1, index2, 135, true, true, style: WorldGen.genRand.Next(2, 4)); @@ -3435,83 +2693,84 @@ namespace Terraria if (type == 1) { int num4 = index1; - int y = index2 - 8; - int index7 = num4 + WorldGen.genRand.Next(-1, 2); - if (WorldGen.IsTileNearby(index7, y, 138, 10)) - return false; + int num5 = index2 - 8; + int i6 = num4 + WorldGen.genRand.Next(-1, 2); bool flag5 = true; while (flag5) { bool flag6 = true; - int num5 = 0; - for (int i = index7 - 2; i <= index7 + 3; ++i) + int num6 = 0; + for (int i7 = i6 - 2; i7 <= i6 + 3; ++i7) { - for (int j3 = y; j3 <= y + 3; ++j3) + for (int j3 = num5; j3 <= num5 + 3; ++j3) { - if (!WorldGen.SolidTile(i, j3)) + if (!WorldGen.SolidTile(i7, j3)) flag6 = false; - if (Main.tile[i, j3].active() && (Main.tile[i, j3].type == (ushort) 0 || Main.tile[i, j3].type == (ushort) 1 || Main.tile[i, j3].type == (ushort) 59)) - ++num5; + if (Main.tile[i7, j3].active() && (Main.tile[i7, j3].type == (ushort) 0 || Main.tile[i7, j3].type == (ushort) 1 || Main.tile[i7, j3].type == (ushort) 59)) + ++num6; } } - --y; - if ((double) y < Main.worldSurface) + --num5; + if ((double) num5 < Main.worldSurface) { ++WorldGen.trapDiag[type, 0]; return false; } - if (flag6 && num5 > 2) + if (flag6 && num6 > 2) flag5 = false; } - if (index2 - y <= 5 || index2 - y >= 40) + if (index2 - num5 <= 5 || index2 - num5 >= 40) { ++WorldGen.trapDiag[type, 0]; return false; } - for (int i = index7; i <= index7 + 1; ++i) + for (int i8 = i6; i8 <= i6 + 1; ++i8) { - for (int j4 = y; j4 <= index2; ++j4) - WorldGen.KillTile(i, j4); - } - for (int i = index7 - 2; i <= index7 + 3; ++i) - { - for (int j5 = y - 2; j5 <= y + 3; ++j5) + for (int j4 = num5; j4 <= index2; ++j4) { - if (WorldGen.SolidTile(i, j5)) - Main.tile[i, j5].type = (ushort) 1; + if (WorldGen.SolidTile(i8, j4)) + WorldGen.KillTile(i8, j4); } } - WorldGen.PlaceTile(index1, index2, 135, true, true, style: 7); - WorldGen.PlaceTile(index7, y + 2, 130, true); - WorldGen.PlaceTile(index7 + 1, y + 2, 130, true); - WorldGen.PlaceTile(index7 + 1, y + 1, 138, true); - int index8 = y + 2; - Main.tile[index7, index8].wire(true); - Main.tile[index7 + 1, index8].wire(true); - int j6 = index8 + 1; - WorldGen.PlaceTile(index7, j6, 130, true); - WorldGen.PlaceTile(index7 + 1, j6, 130, true); - Main.tile[index7, j6].wire(true); - Main.tile[index7 + 1, j6].wire(true); - WorldGen.PlaceTile(index7, j6 + 1, 130, true); - WorldGen.PlaceTile(index7 + 1, j6 + 1, 130, true); - Main.tile[index7, j6 + 1].wire(true); - Main.tile[index7 + 1, j6 + 1].wire(true); - int index9 = index1; - int index10 = index2; - while (index9 != index7 || index10 != j6) + for (int i9 = i6 - 2; i9 <= i6 + 3; ++i9) { - Main.tile[index9, index10].wire(true); - if (index9 > index7) + for (int j5 = num5 - 2; j5 <= num5 + 3; ++j5) + { + if (WorldGen.SolidTile(i9, j5)) + Main.tile[i9, j5].type = (ushort) 1; + } + } + WorldGen.PlaceTile(index1, index2, 135, true, true, style: WorldGen.genRand.Next(2, 4)); + WorldGen.PlaceTile(i6, num5 + 2, 130, true); + WorldGen.PlaceTile(i6 + 1, num5 + 2, 130, true); + WorldGen.PlaceTile(i6 + 1, num5 + 1, 138, true); + int index7 = num5 + 2; + Main.tile[i6, index7].wire(true); + Main.tile[i6 + 1, index7].wire(true); + int j6 = index7 + 1; + WorldGen.PlaceTile(i6, j6, 130, true); + WorldGen.PlaceTile(i6 + 1, j6, 130, true); + Main.tile[i6, j6].wire(true); + Main.tile[i6 + 1, j6].wire(true); + WorldGen.PlaceTile(i6, j6 + 1, 130, true); + WorldGen.PlaceTile(i6 + 1, j6 + 1, 130, true); + Main.tile[i6, j6 + 1].wire(true); + Main.tile[i6 + 1, j6 + 1].wire(true); + int index8 = index1; + int index9 = index2; + while (index8 != i6 || index9 != j6) + { + Main.tile[index8, index9].wire(true); + if (index8 > i6) + --index8; + if (index8 < i6) + ++index8; + Main.tile[index8, index9].wire(true); + if (index9 > j6) --index9; - if (index9 < index7) + if (index9 < j6) ++index9; - Main.tile[index9, index10].wire(true); - if (index10 > j6) - --index10; - if (index10 < j6) - ++index10; - Main.tile[index9, index10].wire(true); + Main.tile[index8, index9].wire(true); } ++WorldGen.trapDiag[type, 1]; return true; @@ -3519,101 +2778,159 @@ namespace Terraria if (type == 2) { int num = WorldGen.genRand.Next(4, 7); - int i6 = index1 + WorldGen.genRand.Next(-1, 2); + int i10 = index1 + WorldGen.genRand.Next(-1, 2); int j7 = index2; - for (int index11 = 0; index11 < num; ++index11) + for (int index10 = 0; index10 < num; ++index10) { ++j7; - if (!WorldGen.SolidTile(i6, j7)) + if (!WorldGen.SolidTile(i10, j7)) { ++WorldGen.trapDiag[type, 0]; return false; } } - for (int i7 = i6 - 2; i7 <= i6 + 2; ++i7) + for (int i11 = i10 - 2; i11 <= i10 + 2; ++i11) { for (int j8 = j7 - 2; j8 <= j7 + 2; ++j8) { - if (!WorldGen.SolidTile(i7, j8)) + if (!WorldGen.SolidTile(i11, j8)) return false; } } - WorldGen.KillTile(i6, j7); - Main.tile[i6, j7].active(true); - Main.tile[i6, j7].type = (ushort) 141; - Main.tile[i6, j7].frameX = (short) 0; - Main.tile[i6, j7].frameY = (short) (18 * WorldGen.genRand.Next(2)); + WorldGen.KillTile(i10, j7); + Main.tile[i10, j7].active(true); + Main.tile[i10, j7].type = (ushort) 141; + Main.tile[i10, j7].frameX = (short) 0; + Main.tile[i10, j7].frameY = (short) (18 * WorldGen.genRand.Next(2)); WorldGen.PlaceTile(index1, index2, 135, true, true, style: WorldGen.genRand.Next(2, 4)); - int index12 = index1; - int index13 = index2; - while (index12 != i6 || index13 != j7) + int index11 = index1; + int index12 = index2; + while (index11 != i10 || index12 != j7) { - Main.tile[index12, index13].wire(true); - if (index12 > i6) + Main.tile[index11, index12].wire(true); + if (index11 > i10) + --index11; + if (index11 < i10) + ++index11; + Main.tile[index11, index12].wire(true); + if (index12 > j7) --index12; - if (index12 < i6) + if (index12 < j7) ++index12; - Main.tile[index12, index13].wire(true); - if (index13 > j7) - --index13; - if (index13 < j7) - ++index13; - Main.tile[index12, index13].wire(true); + Main.tile[index11, index12].wire(true); } ++WorldGen.trapDiag[type, 1]; } - else if (type == 3 && !Main.tile[index1 + 1, index2].active()) + else if (type == 3) { - for (int i = index1; i <= index1 + 1; ++i) + int num7 = 0; + int num8 = 0; + for (int index13 = 0; index13 < 4; ++index13) { - int j9 = index2 + 1; - if (!WorldGen.SolidTile(i, j9)) - return false; - } - int num = WorldGen.genRand.Next(2); - for (int index14 = 0; index14 < 2; ++index14) - { - Main.tile[index1 + index14, index2].active(true); - Main.tile[index1 + index14, index2].type = (ushort) 443; - Main.tile[index1 + index14, index2].frameX = (short) (18 * index14 + 36 * num); - Main.tile[index1 + index14, index2].frameY = (short) 0; - } - return true; - } - return false; - } - - public static int countWires(int x, int y, int size) - { - int num = 0; - for (int x1 = x - size; x1 <= x + size; ++x1) - { - for (int y1 = y - size; y1 <= y + size; ++y1) - { - if (WorldGen.InWorld(x1, y1)) + if (num7 < 2 && WorldGen.genRand.Next(5) == 0) { - if (Main.tile[x1, y1].wire()) - ++num; - if (Main.tile[x1, y1].wire2()) - ++num; - if (Main.tile[x1, y1].wire3()) - ++num; - if (Main.tile[x1, y1].wire4()) - ++num; + ++num7; + } + else + { + int num9 = index1; + int j9 = index2; + bool flag7 = false; + int i12 = num8 != 0 ? num9 + WorldGen.genRand.Next(-15, 16) : num9 + WorldGen.genRand.Next(-1, 2); + int num10 = WorldGen.genRand.Next(3, 6 + (num8 > 0).ToInt() * 3); + for (int index14 = 0; index14 < num10; ++index14) + { + ++j9; + if (!WorldGen.SolidTile(i12, j9)) + { + ++WorldGen.trapDiag[type, 0]; + flag7 = true; + break; + } + } + if (!flag7) + { + int num11 = 2; + for (int i13 = i12 - num11; i13 <= i12 + num11; ++i13) + { + for (int j10 = j9 - num11; j10 <= j9 + num11; ++j10) + { + if (!WorldGen.SolidTile(i13, j10)) + { + ++WorldGen.trapDiag[type, 0]; + flag7 = true; + break; + } + } + if (flag7) + break; + } + if (!flag7) + { + int num12 = 10; + for (int i14 = i12; i14 <= i12 + 1; ++i14) + { + int j11 = j9; + while (j11 > j9 - 20 && WorldGen.SolidTile(i14, j11)) + --j11; + for (int j12 = j11 - num12; j12 <= j11; ++j12) + { + if (WorldGen.SolidTile(i14, j12)) + { + ++WorldGen.trapDiag[type, 0]; + flag7 = true; + break; + } + } + if (flag7) + break; + } + if (!flag7) + { + WorldGen.KillTile(i12, j9); + WorldGen.KillTile(i12 + 1, j9); + int num13 = WorldGen.genRand.Next(2); + for (int index15 = 0; index15 < 2; ++index15) + { + Main.tile[i12 + index15, j9].active(true); + Main.tile[i12 + index15, j9].type = (ushort) 443; + Main.tile[i12 + index15, j9].frameX = (short) (18 * index15 + 36 * num13); + Main.tile[i12 + index15, j9].frameY = (short) 0; + } + WorldGen.PlaceTile(index1, index2, 135, true, true, style: WorldGen.genRand.Next(2, 4)); + int index16 = index1; + int index17 = index2; + while (index16 != i12 || index17 != j9) + { + Main.tile[index16, index17].wire(true); + if (index16 > i12) + --index16; + if (index16 < i12) + ++index16; + Main.tile[index16, index17].wire(true); + if (index17 > j9) + --index17; + if (index17 < j9) + ++index17; + Main.tile[index16, index17].wire(true); + } + ++num8; + ++WorldGen.trapDiag[type, 1]; + } + } + } } } } - return num; + return false; } public static int countTiles(int x, int y, bool jungle = false, bool lavaOk = false) { WorldGen.numTileCount = 0; - WorldGen.shroomCount = 0; WorldGen.lavaCount = 0; WorldGen.iceCount = 0; WorldGen.rockCount = 0; - WorldGen.CountedTiles.Clear(); WorldGen.nextCount(x, y, jungle, lavaOk); return WorldGen.numTileCount; } @@ -3628,58 +2945,52 @@ namespace Terraria } else { - if (WorldGen.CountedTiles.ContainsKey(new Point(x, y))) - return; - if (Main.tile[x, y].wall == (ushort) 244) + for (int index = 0; index < WorldGen.numTileCount; ++index) { - WorldGen.numTileCount = WorldGen.maxTileCount; + if (WorldGen.countX[index] == x && WorldGen.countY[index] == y) + return; } - else + if (!jungle) { - if (!jungle) + if (Main.tile[x, y].wall != (byte) 0) { - if (Main.tile[x, y].wall != (ushort) 0) + WorldGen.numTileCount = WorldGen.maxTileCount; + return; + } + if (!lavaOk) + { + if (Main.tile[x, y].lava() && Main.tile[x, y].liquid > (byte) 0) { + ++WorldGen.lavaCount; WorldGen.numTileCount = WorldGen.maxTileCount; return; } - if (!lavaOk) - { - if (Main.tile[x, y].lava() && Main.tile[x, y].liquid > (byte) 0) - { - ++WorldGen.lavaCount; - WorldGen.numTileCount = WorldGen.maxTileCount; - return; - } - } - else if (Main.tile[x, y].lava() && Main.tile[x, y].liquid > (byte) 0) - ++WorldGen.lavaCount; } - if (Main.tile[x, y].active()) - { - if (Main.tile[x, y].type == (ushort) 70) - ++WorldGen.shroomCount; - if (Main.tile[x, y].type == (ushort) 1) - ++WorldGen.rockCount; - if (Main.tile[x, y].type == (ushort) 147 || Main.tile[x, y].type == (ushort) 161) - ++WorldGen.iceCount; - } - if (WorldGen.SolidTile(x, y)) - return; - WorldGen.CountedTiles.Add(new Point(x, y), true); - ++WorldGen.numTileCount; - WorldGen.nextCount(x - 1, y, jungle, lavaOk); - WorldGen.nextCount(x + 1, y, jungle, lavaOk); - WorldGen.nextCount(x, y - 1, jungle, lavaOk); - WorldGen.nextCount(x, y + 1, jungle, lavaOk); + else if (Main.tile[x, y].lava() && Main.tile[x, y].liquid > (byte) 0) + ++WorldGen.lavaCount; } + if (Main.tile[x, y].active()) + { + if (Main.tile[x, y].type == (ushort) 1) + ++WorldGen.rockCount; + if (Main.tile[x, y].type == (ushort) 147 || Main.tile[x, y].type == (ushort) 161) + ++WorldGen.iceCount; + } + if (WorldGen.SolidTile(x, y)) + return; + WorldGen.countX[WorldGen.numTileCount] = x; + WorldGen.countY[WorldGen.numTileCount] = y; + ++WorldGen.numTileCount; + WorldGen.nextCount(x - 1, y, jungle, lavaOk); + WorldGen.nextCount(x + 1, y, jungle, lavaOk); + WorldGen.nextCount(x, y - 1, jungle, lavaOk); + WorldGen.nextCount(x, y + 1, jungle, lavaOk); } } public static int countDirtTiles(int x, int y) { WorldGen.numTileCount = 0; - WorldGen.CountedTiles.Clear(); WorldGen.nextDirtCount(x, y); return WorldGen.numTileCount; } @@ -3694,19 +3005,23 @@ namespace Terraria } else { - if (WorldGen.CountedTiles.ContainsKey(new Point(x, y))) - return; + for (int index = 0; index < WorldGen.numTileCount; ++index) + { + if (WorldGen.countX[index] == x && WorldGen.countY[index] == y) + return; + } if (Main.tile[x, y].active() && (Main.tile[x, y].type == (ushort) 147 || Main.tile[x, y].type == (ushort) 161)) WorldGen.numTileCount = WorldGen.maxTileCount; - else if (Main.tile[x, y].wall == (ushort) 244 || Main.tile[x, y].wall == (ushort) 83 || Main.tile[x, y].wall == (ushort) 3 || Main.tile[x, y].wall == (ushort) 187 || Main.tile[x, y].wall == (ushort) 216) + else if (Main.tile[x, y].wall == (byte) 78 || Main.tile[x, y].wall == (byte) 83 || Main.tile[x, y].wall == (byte) 3) { WorldGen.numTileCount = WorldGen.maxTileCount; } else { - if (WorldGen.SolidTile(x, y) || Main.tile[x, y].wall != (ushort) 2 && Main.tile[x, y].wall != (ushort) 59) + if (WorldGen.SolidTile(x, y) || Main.tile[x, y].wall != (byte) 2 && Main.tile[x, y].wall != (byte) 59) return; - WorldGen.CountedTiles.Add(new Point(x, y), true); + WorldGen.countX[WorldGen.numTileCount] = x; + WorldGen.countY[WorldGen.numTileCount] = y; ++WorldGen.numTileCount; WorldGen.nextDirtCount(x - 1, y); WorldGen.nextDirtCount(x + 1, y); @@ -3769,7 +3084,6 @@ namespace Terraria public static void randMoss() { - WorldGen.neonMossType = WorldGen.genRand.NextFromList((ushort) 539, (ushort) 536, (ushort) 534); WorldGen.mossType[0] = WorldGen.genRand.Next(5); WorldGen.mossType[1] = WorldGen.genRand.Next(5); while (WorldGen.mossType[1] == WorldGen.mossType[0]) @@ -3779,214 +3093,11 @@ namespace Terraria WorldGen.mossType[2] = WorldGen.genRand.Next(5); } - public static void neonMossBiome(int i, int j, int maxY = 99999) - { - Vector2 vector2_1; - vector2_1.X = (float) i; - vector2_1.Y = (float) j; - Vector2 vector2_2; - vector2_2.X = (float) ((double) WorldGen.genRand.NextFloat() * 4.0 - 2.0); - vector2_2.Y = (float) ((double) WorldGen.genRand.NextFloat() * 4.0 - 2.0); - if ((double) vector2_2.X == 0.0) - vector2_2.X = 1f; - while ((double) vector2_2.Length() < 4.0) - vector2_2 *= 1.5f; - double num1 = (double) WorldGen.genRand.Next(60, 80); - double num2 = (double) WorldGen.genRand.Next(30, 40); - float num3 = (float) (Main.maxTilesX / 4200); - if (WorldGen.getGoodWorldGen) - num3 *= 1.5f; - double num4 = num1 * (double) num3; - double num5 = num2 * (double) num3; - while (num5 > 0.0) - { - num4 *= 0.980000019073486; - --num5; - int num6 = (int) ((double) vector2_1.X - num4); - int num7 = (int) ((double) vector2_1.X + num4); - int num8 = (int) ((double) vector2_1.Y - num4); - int num9 = (int) ((double) vector2_1.Y + num4); - if (num6 < 1) - num6 = 1; - if (num7 > Main.maxTilesX - 1) - num7 = Main.maxTilesX - 1; - if (num8 < 1) - num8 = 1; - if (num9 > Main.maxTilesY - 1) - num9 = Main.maxTilesY - 1; - if ((double) num8 < Main.rockLayer) - { - num8 = (int) Main.rockLayer; - if ((double) vector2_2.Y < 5.0) - vector2_2.Y = 5f; - } - if (num9 > maxY) - { - num9 = maxY; - if ((double) vector2_2.Y > -5.0) - vector2_2.Y = -5f; - } - double num10 = num4 * (1.0 + (double) WorldGen.genRand.NextFloat() * 0.400000005960464 - 0.200000002980232); - for (int x = num6; x < num7; ++x) - { - for (int index = num8; index < num9; ++index) - { - if ((double) new Vector2(Math.Abs((float) x - vector2_1.X), Math.Abs((float) index - vector2_1.Y)).Length() < num10 * 0.8 && WorldGen.TileType(x, index) == 1 && (!Main.tile[x - 1, index].active() || !Main.tile[x + 1, index].active() || !Main.tile[x, index - 1].active() || !Main.tile[x, index + 1].active())) - WorldGen.SpreadGrass(x - 1, index, 1, (int) WorldGen.neonMossType); - } - } - vector2_1 += vector2_2; - vector2_2.X += (float) ((double) WorldGen.genRand.NextFloat() * 4.0 - 2.0); - vector2_2.Y += (float) ((double) WorldGen.genRand.NextFloat() * 4.0 - 2.0); - vector2_2.Y = MathHelper.Clamp(vector2_2.Y, -10f, 10f); - vector2_2.X = MathHelper.Clamp(vector2_2.X, -10f, 10f); - } - } - public static void setMoss(int x, int y) { int index = (double) x >= (double) Main.maxTilesX * 0.334 ? ((double) x >= (double) Main.maxTilesX * 0.667 ? 2 : 1) : 0; - WorldGen.mossWall = (ushort) (54 + WorldGen.mossType[index]); - WorldGen.mossTile = (ushort) (179 + WorldGen.mossType[index]); - } - - public static void FillWallHolesInArea(Microsoft.Xna.Framework.Rectangle worldCoordsArea) - { - int num1 = Math.Max(worldCoordsArea.Left, 0); - int num2 = Math.Min(worldCoordsArea.Right, Main.maxTilesX); - int num3 = 0; - for (int x = num1; x <= num2; ++x) - { - if (x >= 0 && x < Main.maxTilesX) - num3 += WorldGen.FillWallHolesInColumn(x, worldCoordsArea.Top, worldCoordsArea.Bottom); - } - } - - private static int FillWallHolesInColumn(int x, int startY, int endY) - { - int num = 0; - x = Utils.Clamp(x, 2, Main.maxTilesX - 1 - 2); - startY = Math.Max(startY, 2); - endY = Math.Min(endY, Main.maxTilesY - 2); - bool flag = false; - for (int originY = startY; originY < endY; ++originY) - { - if (Main.tile[x, originY].wall == (ushort) 0) - { - if (flag) - { - flag = false; - if (WorldGen.FillWallHolesInSpot(x, originY, 150)) - ++num; - } - } - else - flag = true; - } - return num; - } - - private static bool FillWallHolesInSpot(int originX, int originY, int maxWallsThreshold) - { - if (!WorldGen.InWorld(originX, originY, 2)) - return false; - List pointList1 = new List(); - List pointList2 = new List(); - HashSet pointSet = new HashSet(); - Dictionary dictionary = new Dictionary(); - pointList2.Add(new Point(originX, originY)); - while (pointList2.Count > 0) - { - pointList1.Clear(); - pointList1.AddRange((IEnumerable) pointList2); - pointList2.Clear(); - while (pointList1.Count > 0) - { - if (pointSet.Count >= maxWallsThreshold) - return false; - Point point1 = pointList1[0]; - if (pointSet.Contains(point1)) - pointList1.Remove(point1); - else if (!WorldGen.InWorld(point1.X, point1.Y, 1)) - { - pointList1.Remove(point1); - } - else - { - pointSet.Add(point1); - pointList1.Remove(point1); - Tile tile = Main.tile[point1.X, point1.Y]; - if (tile.wall != (ushort) 0) - { - dictionary[tile.wall] = !dictionary.ContainsKey(tile.wall) ? 1 : dictionary[tile.wall] + 1; - } - else - { - bool flag = false; - if (!flag) - { - int y = point1.Y; - for (int index = point1.X - 1; index <= point1.X + 1; ++index) - { - if (!Main.tile[index, y].active()) - { - flag = true; - break; - } - } - } - if (!flag) - { - int x = point1.X; - for (int index = point1.Y - 1; index <= point1.Y + 1; ++index) - { - if (!Main.tile[x, index].active()) - { - flag = true; - break; - } - } - } - if (flag) - { - Point point2 = new Point(point1.X - 1, point1.Y); - if (!pointSet.Contains(point2)) - pointList2.Add(point2); - point2 = new Point(point1.X + 1, point1.Y); - if (!pointSet.Contains(point2)) - pointList2.Add(point2); - point2 = new Point(point1.X, point1.Y - 1); - if (!pointSet.Contains(point2)) - pointList2.Add(point2); - point2 = new Point(point1.X, point1.Y + 1); - if (!pointSet.Contains(point2)) - pointList2.Add(point2); - } - } - } - } - } - if (pointSet.Count == 1) - return false; - ushort num1 = 0; - int num2 = -1; - foreach (KeyValuePair keyValuePair in dictionary) - { - if (keyValuePair.Value > num2) - { - num1 = keyValuePair.Key; - num2 = keyValuePair.Value; - } - } - if (num2 == -1) - num1 = (ushort) 2; - foreach (Point point in pointSet) - { - Tile tile = Main.tile[point.X, point.Y]; - if (tile.wall == (ushort) 0) - tile.wall = num1; - } - return true; + WorldGen.mossWall = (byte) (54 + WorldGen.mossType[index]); + WorldGen.mossTile = (byte) (179 + WorldGen.mossType[index]); } public static void tileCountAndDestroy() @@ -4038,8 +3149,6 @@ namespace Terraria private static void AddGenerationPass(string name, WorldGenLegacyMethod method) => WorldGen._generator.Append((GenPass) new PassLegacy(name, method)); - private static void AddGenerationPass(GenPass pass) => WorldGen._generator.Append(pass); - private static void AddGenerationPass(string name, float weight, WorldGenLegacyMethod method) => WorldGen._generator.Append((GenPass) new PassLegacy(name, method, weight)); public static bool checkUnderground(int x, int y) @@ -4064,7 +3173,7 @@ namespace Terraria { for (int j = num4; j < num4 + num3; ++j) { - if (WorldGen.SolidTile(i, j) || Main.tile[x, y].wall > (ushort) 0) + if (WorldGen.SolidTile(i, j) || Main.tile[x, y].wall > (byte) 0) ++num6; } } @@ -4105,549 +3214,18 @@ namespace Terraria return num; } - private static void ScanTileColumnAndRemoveClumps(int x) + public static void generateWorld(int seed, GenerationProgress customProgressObject = null) { - int num = 0; - int y = 0; - for (int index = 10; index < Main.maxTilesY - 10; ++index) - { - if (Main.tile[x, index].active() && Main.tileSolid[(int) Main.tile[x, index].type] && TileID.Sets.CanBeClearedDuringGeneration[(int) Main.tile[x, index].type]) - { - if (num == 0) - y = index; - ++num; - } - else - { - if (num > 0 && num < WorldGen.tileCounterMax) - { - ++WorldGen.SmallConsecutivesFound; - if (WorldGen.tileCounter(x, y) < WorldGen.tileCounterMax) - { - ++WorldGen.SmallConsecutivesEliminated; - WorldGen.tileCounterKill(); - } - } - num = 0; - } - } - } - - public static void OreHelper(int X, int Y) - { - for (int index1 = X - 1; index1 <= X + 1; ++index1) - { - for (int index2 = Y - 1; index2 <= Y + 1; ++index2) - { - if (Main.tile[index1, index2].type == (ushort) 1 || Main.tile[index1, index2].type == (ushort) 40) - Main.tile[index1, index2].type = (ushort) 0; - } - } - } - - public static bool StonePatch(int X, int Y) - { - int i1 = X; - int j1 = Y; - while (!WorldGen.SolidTile(i1, j1)) - { - ++j1; - if ((double) j1 > Main.worldSurface) - return false; - } - if (!TileID.Sets.Conversion.Grass[(int) Main.tile[i1, j1].type] || !TileID.Sets.Conversion.Grass[(int) Main.tile[i1 - 1, j1].type] || !TileID.Sets.Conversion.Grass[(int) Main.tile[i1 + 1, j1].type] || Main.tile[i1, j1].wall > (ushort) 0) - return false; - for (int index1 = i1 - 10; index1 <= i1 + 10; ++index1) - { - for (int index2 = j1 + 7; index2 <= j1 + 30; ++index2) - { - if (!Main.tile[index1, index2].active() || Main.tileDungeon[(int) Main.tile[index1, index2].type] || TileID.Sets.Clouds[(int) Main.tile[index1, index2].type] || TileID.Sets.Conversion.Sand[(int) Main.tile[index1, index2].type] || Main.tile[index1, index2].wall == (ushort) 0 || Main.tile[index1, index2].type == (ushort) 199 || Main.tile[index1, index2].type == (ushort) 23) - return false; - } - } - Vector2 vector2_1 = new Vector2((float) i1, (float) j1); - Vector2 vector2_2; - vector2_2.X = (float) ((double) WorldGen.genRand.NextFloat() * 0.600000023841858 - 0.300000011920929); - vector2_2.Y = (float) ((double) WorldGen.genRand.NextFloat() * 0.5 + 0.5); - float num1 = (float) WorldGen.genRand.Next(13, 18); - int num2 = WorldGen.genRand.Next(13, 19); - if (WorldGen.genRand.Next(3) == 0) - num1 += (float) WorldGen.genRand.Next(3); - if (WorldGen.genRand.Next(3) == 0) - num2 += WorldGen.genRand.Next(3); - while (num2 > 0) - { - --num2; - for (int i2 = i1 - (int) num1 * 4; (double) i2 <= (double) i1 + (double) num1 * 4.0; ++i2) - { - for (int j2 = j1 - (int) num1 * 4; (double) j2 <= (double) j1 + (double) num1 * 4.0; ++j2) - { - float num3 = (float) ((double) num1 * (0.699999988079071 + (double) WorldGen.genRand.NextFloat() * 0.600000023841858) * 0.300000011920929); - if (WorldGen.genRand.Next(8) == 0) - num3 *= 2f; - Vector2 vector2_3 = vector2_1 - new Vector2((float) i2, (float) j2); - if ((double) vector2_3.Length() < (double) num3 * 2.0 && !Main.tile[i2, j2].active() && Main.tile[i2, j2 + 1].active() && Main.tile[i2, j2 + 1].type == (ushort) 1 && WorldGen.genRand.Next(7) == 0 && WorldGen.SolidTile(i2 - 1, j2 + 1) && WorldGen.SolidTile(i2 + 1, j2 + 1)) - { - if (WorldGen.genRand.Next(3) != 0) - WorldGen.PlaceTile(i2, j2, 186, true, style: WorldGen.genRand.Next(7, 13)); - if (WorldGen.genRand.Next(3) != 0) - WorldGen.PlaceSmallPile(i2, j2, WorldGen.genRand.Next(6), 1); - WorldGen.PlaceSmallPile(i2, j2, WorldGen.genRand.Next(6), 0); - } - if ((double) vector2_3.Length() < (double) num3) - { - if (Main.tileSolid[(int) Main.tile[i2, j2].type]) - Main.tile[i2, j2].type = (ushort) 1; - if (!WorldGen.gen) - WorldGen.SquareTileFrame(i2, j2); - } - } - } - vector2_1 += vector2_2; - vector2_2.X += (float) ((double) WorldGen.genRand.NextFloat() * 0.200000002980232 - 0.100000001490116); - vector2_2.Y += (float) ((double) WorldGen.genRand.NextFloat() * 0.200000002980232 - 0.100000001490116); - double num4 = (double) MathHelper.Clamp(vector2_2.X, -0.3f, 0.3f); - double num5 = (double) MathHelper.Clamp(vector2_2.Y, 0.5f, 1f); - } - return true; - } - - public static bool ShellPile(int X, int Y) - { - int i1 = X; - int j1 = Y; - while (!WorldGen.SolidTile(i1, j1)) - { - ++j1; - if ((double) j1 > Main.worldSurface) - return false; - } - if (Main.tile[i1, j1].type != (ushort) 53 || Main.tile[i1, j1].wall > (ushort) 0) - return false; - int num1 = j1 - 1; - Vector2 vector2_1 = new Vector2((float) i1, (float) num1); - Vector2 vector2_2; - vector2_2.X = (float) ((double) WorldGen.genRand.NextFloat() * 0.600000023841858 - 0.300000011920929); - vector2_2.Y = (float) ((double) WorldGen.genRand.NextFloat() * 0.5 + 0.5); - float num2 = (float) WorldGen.genRand.Next(2, 4); - if (WorldGen.genRand.Next(10) == 0) - ++num2; - int num3 = WorldGen.genRand.Next(3, 6); - while (num3 > 0) - { - --num3; - for (int i2 = i1 - (int) num2 * 4; (double) i2 <= (double) i1 + (double) num2 * 4.0; ++i2) - { - for (int j2 = num1 + (int) num2 * 4; (double) j2 > (double) num1 - (double) num2 * 4.0; --j2) - { - float num4 = (float) ((double) num2 * (double) WorldGen.genRand.Next(70, 91) * 0.00999999977648258); - Vector2 vector2_3 = vector2_1 - new Vector2((float) i2, (float) j2); - vector2_3.X *= 0.6f; - if ((double) vector2_3.Length() < (double) num4) - { - if (j2 <= num1 + 1 || WorldGen.genRand.Next(6) == 0) - { - Main.tile[i2, j2].type = (ushort) 495; - Main.tile[i2, j2].active(true); - Main.tile[i2, j2].halfBrick(false); - Main.tile[i2, j2].slope((byte) 0); - if (!Main.tile[i2, j2 + 1].active()) - { - Main.tile[i2, j2 + 1].type = (ushort) 495; - Main.tile[i2, j2 + 1].active(true); - Main.tile[i2, j2 + 1].halfBrick(false); - Main.tile[i2, j2 + 1].slope((byte) 0); - if (!Main.tile[i2, j2 + 2].active()) - { - Main.tile[i2, j2 + 2].type = (ushort) 53; - Main.tile[i2, j2 + 2].active(true); - Main.tile[i2, j2 + 2].halfBrick(false); - Main.tile[i2, j2 + 2].slope((byte) 0); - if (!Main.tile[i2, j2 + 3].active()) - { - Main.tile[i2, j2 + 3].type = (ushort) 397; - Main.tile[i2, j2 + 3].active(true); - Main.tile[i2, j2 + 3].halfBrick(false); - Main.tile[i2, j2 + 3].slope((byte) 0); - } - } - } - if (!WorldGen.gen) - WorldGen.SquareTileFrame(i2, j2); - } - else if (Main.tile[i2, j2].type != (ushort) 495) - { - Main.tile[i2, j2].active(true); - Main.tile[i2, j2].halfBrick(false); - Main.tile[i2, j2].slope((byte) 0); - Main.tile[i2, j2].type = (ushort) 53; - if (!WorldGen.gen) - WorldGen.SquareTileFrame(i2, j2); - } - } - } - } - vector2_1 += vector2_2; - vector2_2.X += (float) ((double) WorldGen.genRand.NextFloat() * 0.200000002980232 - 0.100000001490116); - vector2_2.Y += (float) ((double) WorldGen.genRand.NextFloat() * 0.200000002980232 - 0.100000001490116); - double num5 = (double) MathHelper.Clamp(vector2_2.X, -0.3f, 0.3f); - double num6 = (double) MathHelper.Clamp(vector2_2.Y, 0.5f, 1f); - } - return true; - } - - public static bool OrePatch(int X, int Y) - { - ushort num1 = (ushort) WorldGen.SavedOreTiers.Copper; - if (WorldGen.genRand.Next(3) == 0) - num1 = (ushort) WorldGen.SavedOreTiers.Iron; - int index1 = X; - int j = Y; - while (!WorldGen.SolidTile(index1, j)) - { - ++j; - if ((double) j > Main.worldSurface) - return false; - } - if (!TileID.Sets.Conversion.Grass[(int) Main.tile[index1, j].type] || !TileID.Sets.Conversion.Grass[(int) Main.tile[index1 - 1, j].type] || !TileID.Sets.Conversion.Grass[(int) Main.tile[index1 + 1, j].type] || Main.tile[index1, j].wall > (ushort) 0) - return false; - for (int index2 = index1 - 10; index2 <= index1 + 10; ++index2) - { - for (int index3 = j + 7; index3 <= j + 30; ++index3) - { - if (!Main.tile[index2, index3].active() || Main.tileDungeon[(int) Main.tile[index2, index3].type] || TileID.Sets.Clouds[(int) Main.tile[index2, index3].type] || TileID.Sets.Conversion.Sand[(int) Main.tile[index2, index3].type] || Main.tile[index2, index3].wall == (ushort) 0) - return false; - } - } - int index4 = j + WorldGen.genRand.Next(2); - Main.tile[index1, index4].type = num1; - Main.tile[index1, index4].active(true); - WorldGen.OreHelper(index1, index4); - if (!WorldGen.gen) - WorldGen.SquareTileFrame(index1, index4); - int num2 = index4; - while (index4 < num2 + WorldGen.genRand.Next(8, 13)) - { - index1 += WorldGen.genRand.Next(-1, 2); - index4 += WorldGen.genRand.Next(1, 3); - if (WorldGen.genRand.Next(3) == 0) - ++index4; - Main.tile[index1, index4].type = num1; - Main.tile[index1, index4].active(true); - WorldGen.OreHelper(index1, index4); - if (!WorldGen.gen) - WorldGen.SquareTileFrame(index1, index4); - if (WorldGen.genRand.Next(4) == 0) - { - int index5 = index1 + WorldGen.genRand.Next(-2, 3); - int index6 = index4 + WorldGen.genRand.Next(2); - Main.tile[index5, index6].type = num1; - Main.tile[index5, index6].active(true); - WorldGen.OreHelper(index5, index6); - if (!WorldGen.gen) - WorldGen.SquareTileFrame(index5, index6); - } - } - Vector2 vector2_1 = new Vector2((float) index1, (float) index4); - Vector2 vector2_2; - vector2_2.X = (float) ((double) WorldGen.genRand.NextFloat() * 0.600000023841858 - 0.300000011920929); - vector2_2.Y = (float) ((double) WorldGen.genRand.NextFloat() * 0.5 + 0.5); - float num3 = (float) WorldGen.genRand.Next(5, 9); - int num4 = WorldGen.genRand.Next(9, 14); - if (WorldGen.genRand.Next(3) == 0) - num3 += (float) WorldGen.genRand.Next(2); - if (WorldGen.genRand.Next(3) == 0) - num4 += WorldGen.genRand.Next(2); - while (num4 > 0) - { - --num4; - for (int index7 = index1 - (int) num3 * 4; (double) index7 <= (double) index1 + (double) num3 * 4.0; ++index7) - { - for (int index8 = index4 - (int) num3 * 4; (double) index8 <= (double) index4 + (double) num3 * 4.0; ++index8) - { - float num5 = (float) ((double) num3 * (0.5 + (double) WorldGen.genRand.NextFloat() * 0.5) * 0.100000001490116); - float num6 = (float) ((double) num3 * (0.699999988079071 + (double) WorldGen.genRand.NextFloat() * 0.600000023841858) * 0.300000011920929); - if (WorldGen.genRand.Next(8) == 0) - num6 *= 2f; - Vector2 vector2_3 = vector2_1 - new Vector2((float) index7, (float) index8); - if ((double) vector2_3.Length() < (double) num5) - Main.tile[index7, index8].active(false); - else if ((double) vector2_3.Length() < (double) num6) - { - Main.tile[index7, index8].type = num1; - if (WorldGen.genRand.Next(4) == 0) - Main.tile[index7, index8].active(true); - WorldGen.OreHelper(index7, index8); - if (!WorldGen.gen) - WorldGen.SquareTileFrame(index7, index8); - } - } - } - vector2_1 += vector2_2; - vector2_2.X += (float) ((double) WorldGen.genRand.NextFloat() * 0.200000002980232 - 0.100000001490116); - vector2_2.Y += (float) ((double) WorldGen.genRand.NextFloat() * 0.200000002980232 - 0.100000001490116); - double num7 = (double) MathHelper.Clamp(vector2_2.X, -0.3f, 0.3f); - double num8 = (double) MathHelper.Clamp(vector2_2.Y, 0.5f, 1f); - } - return true; - } - - public static bool PlaceOasis(int X, int Y) - { - int index1 = X; - int index2 = Y; - if (Main.tile[index1, index2].active() || Main.tile[index1, index2].wall != (ushort) 0) - return false; - while (!Main.tile[index1, index2].active() && Main.tile[index1, index2].wall == (ushort) 0 && (double) index2 <= Main.worldSurface) - ++index2; - if ((double) index2 > Main.worldSurface - 10.0 || Main.tile[index1, index2].type != (ushort) 53) - return false; - int num1 = 350; - for (int index3 = 0; index3 < WorldGen.numOasis; ++index3) - { - if ((double) Vector2.Distance(WorldGen.oasisPosition[index3], new Vector2((float) index1, (float) index2)) < (double) num1) - return false; - } - int num2 = WorldGen.genRand.Next(45, 61); - int oasisHeight = WorldGen.oasisHeight; - int num3 = num2 + 50; - int num4 = 4; - for (int index4 = index1 - num3; index4 <= index1 + num3; ++index4) - { - for (int index5 = index2 - oasisHeight; index5 <= index2 + oasisHeight + num4; ++index5) - { - Tile tile = Main.tile[index4, index5]; - if (tile.active()) - { - if (Main.tileSolid[(int) tile.type] && ((tile.type == (ushort) 151 || tile.type == (ushort) 397) && Math.Abs(index4 - index1) < num2 && Math.Abs(index5 - index2) < oasisHeight / 2 || tile.type != (ushort) 53)) - return false; - } - else if ((tile.liquid > (byte) 0 || tile.wall > (ushort) 0) && Math.Abs(index4 - index1) < num2 && Math.Abs(index5 - index2) < oasisHeight / 2) - return false; - } - if (index4 > index1 - num2 / 2 && index4 < index1 - num2 / 2 && (Main.tile[index4, index2 - 6].active() || !Main.tile[index4, index2 + 1].active())) - return false; - } - int num5 = 5; - int num6 = index2; - while (!Main.tile[index1 - num2, index2 + num5].active() || Main.tile[index1 - num2, index2 + num5].wall != (ushort) 0 || !Main.tile[index1 + num2, index2 + num5].active() || Main.tile[index1 + num2, index2 + num5].wall != (ushort) 0) - { - ++index2; - if (index2 - num6 > 20) - break; - } - int num7 = num2 / 2; - int num8 = index1 - num2 * 3; - int num9 = index1 + num2 * 3; - int num10 = index2 - oasisHeight * 4; - int num11 = index2 + oasisHeight * 3; - if (num8 < 0) - num8 = 0; - if (num9 > Main.maxTilesX) - num9 = Main.maxTilesX; - if (num10 < 0) - num10 = 0; - if (num11 > Main.maxTilesY) - num11 = Main.maxTilesY; - for (int index6 = num8; index6 < num9; ++index6) - { - for (int index7 = num10; index7 < num11; ++index7) - { - float num12 = (float) Math.Abs(index6 - index1) * 0.7f; - float num13 = (float) Math.Abs(index7 - index2) * 1.35f; - double num14 = Math.Sqrt((double) num12 * (double) num12 + (double) num13 * (double) num13); - float num15 = (float) num7 * (float) (0.529999971389771 + (double) WorldGen.genRand.NextFloat() * 0.0399999991059303); - float num16 = (1f - (float) Math.Abs(index6 - index1) / (float) (num9 - index1)) * 2.3f; - float num17 = num16 * num16; - float num18 = num17 * num17; - double num19 = (double) num15; - if (num14 < num19) - { - if (index7 == index2 + 1) - Main.tile[index6, index7].liquid = (byte) 127; - else if (index7 > index2 + 1) - Main.tile[index6, index7].liquid = byte.MaxValue; - Main.tile[index6, index7].lava(false); - Main.tile[index6, index7].active(false); - } - else if (index7 < index2 && (double) num12 < (double) num15 + (double) Math.Abs(index7 - index2) * 3.0 * (double) num18) - { - if (Main.tile[index6, index7].type == (ushort) 53) - Main.tile[index6, index7].active(false); - } - else if (index7 >= index2 && (double) num12 < (double) num15 + (double) Math.Abs(index7 - index2) * (double) num18 && Main.tile[index6, index7].wall == (ushort) 0) - { - if (Main.tile[index6, index7].active() && Main.tileSolid[(int) Main.tile[index6, index7].type] && !Main.tileSolidTop[(int) Main.tile[index6, index7].type]) - { - Main.tile[index6, index7].slope((byte) 0); - Main.tile[index6, index7].halfBrick(false); - } - else - { - Main.tile[index6, index7].active(true); - Main.tile[index6, index7].type = (ushort) 53; - Main.tile[index6, index7].slope((byte) 0); - Main.tile[index6, index7].halfBrick(false); - } - } - } - } - int num20 = 50; - int num21 = index1 - num2 * 2; - int num22 = index1 + num2 * 2; - int num23 = index2 + oasisHeight * 2; - for (int index8 = num21; index8 < num22; ++index8) - { - for (int index9 = num23; index9 >= index2; --index9) - { - double num24 = (double) Math.Abs(index8 - index1) * 0.699999988079071; - float num25 = (float) Math.Abs(index9 - index2) * 1.35f; - if (Math.Sqrt(num24 * num24 + (double) num25 * (double) num25) > (double) ((float) num7 * 0.57f)) - { - bool flag1 = false; - if (!Main.tile[index8, index9].active() && Main.tile[index8, index9].wall == (ushort) 0) - { - int num26 = -1; - int num27 = -1; - for (int index10 = index8; index10 <= index8 + num20 && Main.tile[index10, index9 + 1].active() && Main.tileSolid[(int) Main.tile[index10, index9 + 1].type] && Main.tile[index10, index9].wall <= (ushort) 0; ++index10) - { - if (Main.tile[index10, index9].active() && Main.tileSolid[(int) Main.tile[index10, index9].type]) - { - if (Main.tile[index10, index9].type == (ushort) 53) - flag1 = true; - num27 = index10; - break; - } - if (Main.tile[index10, index9].active()) - break; - } - for (int index11 = index8; index11 >= index8 - num20 && Main.tile[index11, index9 + 1].active() && Main.tileSolid[(int) Main.tile[index11, index9 + 1].type] && Main.tile[index11, index9].wall <= (ushort) 0; --index11) - { - if (Main.tile[index11, index9].active() && Main.tileSolid[(int) Main.tile[index11, index9].type]) - { - if (Main.tile[index11, index9].type == (ushort) 53) - flag1 = true; - num26 = index11; - break; - } - if (Main.tile[index11, index9].active()) - break; - } - bool flag2 = true; - if (((num26 <= -1 ? 0 : (num27 > -1 ? 1 : 0)) & (flag2 ? 1 : 0)) != 0) - { - int num28 = 0; - for (int index12 = num26 + 1; index12 < num27; ++index12) - { - if (num27 - num26 > 5 && WorldGen.genRand.Next(5) == 0) - num28 = WorldGen.genRand.Next(5, 10); - Main.tile[index12, index9].active(true); - Main.tile[index12, index9].type = (ushort) 53; - if (num28 > 0) - { - --num28; - Main.tile[index12, index9 - 1].active(true); - Main.tile[index12, index9 - 1].type = (ushort) 53; - } - } - } - } - } - } - } - if (WorldGen.numOasis < WorldGen.maxOasis) - { - WorldGen.oasisPosition[WorldGen.numOasis] = new Vector2((float) index1, (float) index2); - WorldGen.oasisWidth[WorldGen.numOasis] = num2; - ++WorldGen.numOasis; - } - return true; - } - - public static bool BiomeTileCheck(int x, int y) - { - int num = 50; - for (int x1 = x - num; x1 <= x + num; ++x1) - { - for (int y1 = y - num; y1 <= y + num; ++y1) - { - if (WorldGen.InWorld(x1, y1)) - { - if (Main.tile[x1, y1].active()) - { - switch (Main.tile[x1, y1].type) - { - case 70: - case 72: - case 147: - case 161: - case 162: - case 367: - case 368: - case 396: - case 397: - return true; - } - } - switch (Main.tile[x1, y1].wall) - { - case 187: - case 216: - return true; - default: - continue; - } - } - } - } - return false; - } - - public static double oceanLevel => (Main.worldSurface + Main.rockLayer) / 2.0 + 40.0; - - public static bool oceanDepths(int x, int y) => (double) y <= WorldGen.oceanLevel && (x < WorldGen.beachDistance || x > Main.maxTilesX - WorldGen.beachDistance); - - public static void GenerateWorld(int seed, GenerationProgress customProgressObject = null) - { - WorldGen.drunkWorldGen = false; - WorldGen.drunkWorldGenText = false; - if (seed == 5162020) - { - WorldGen.drunkWorldGen = true; - WorldGen.drunkWorldGenText = true; - Main.drunkWorld = true; - Main.rand = new UnifiedRandom(); - seed = Main.rand.Next(999999999); - if (!Main.dayTime) - Main.time = 0.0; - } - if (WorldGen.notTheBees) - { - Main.rand = new UnifiedRandom(); - seed = Main.rand.Next(999999999); - } - if (WorldGen.getGoodWorldGen) - { - Main.getGoodWorld = true; - Main.rand = new UnifiedRandom(); - seed = Main.rand.Next(999999999); - } - else - Main.getGoodWorld = false; - Console.WriteLine("Creating world - Seed: {0} Width: {1}, Height: {2}, Evil: {3}, IsExpert: {4}", (object) seed, (object) Main.maxTilesX, (object) Main.maxTilesY, (object) WorldGen.WorldGenParam_Evil, (object) Main.expertMode); - Main.lockMenuBGChange = true; - WorldGenConfiguration configuration = WorldGenConfiguration.FromEmbeddedPath("Terraria.GameContent.WorldBuilding.Configuration.json"); - WorldGen.Hooks.ProcessWorldGenConfig(ref configuration); WorldGen._lastSeed = seed; - WorldGen._generator = new WorldGenerator(seed, configuration); - WorldGen._genRand = new UnifiedRandom(seed); + WorldGen._generator = new WorldGenerator(seed); Main.rand = new UnifiedRandom(seed); + MicroBiome.ResetAll(); StructureMap structures = new StructureMap(); - WorldGen.worldSurfaceLow = 0.0; double worldSurface = 0.0; + WorldGen.worldSurfaceLow = 0.0; double worldSurfaceHigh = 0.0; - double rockLayerLow = 0.0; double rockLayer = 0.0; + double rockLayerLow = 0.0; double rockLayerHigh = 0.0; int copper = 7; int iron = 6; @@ -4655,16 +3233,10 @@ namespace Terraria int gold = 8; int dungeonSide = 0; ushort jungleHut = (ushort) WorldGen.genRand.Next(5); - int shellStartXLeft = 0; - int shellStartYLeft = 0; - int shellStartXRight = 0; - int shellStartYRight = 0; int howFar = 0; int[] PyrX = (int[]) null; int[] PyrY = (int[]) null; int numPyr = 0; - int jungleMinX = -1; - int jungleMaxX = -1; int[] snowMinX = new int[Main.maxTilesY]; int[] snowMaxX = new int[Main.maxTilesY]; int snowTop = 0; @@ -4675,33 +3247,22 @@ namespace Terraria ++skyLakes; if (Main.maxTilesX > 6000) ++skyLakes; - int beachSandRandomCenter = 275 + 5 + 40; - int beachSandRandomWidthRange = 20; - int beachSandDungeonExtraWidth = 40; - int beachSandJungleExtraWidth = 20; - int oceanWaterStartRandomMin = 220; - int oceanWaterStartRandomMax = oceanWaterStartRandomMin + 40; - int oceanWaterForcedJungleLength = 275; - int leftBeachEnd = 0; - int rightBeachStart = 0; - int minSsandBeforeWater = 50; - int evilBiomeBeachAvoidance = beachSandRandomCenter + 60; - int evilBiomeAvoidanceMidFixer = 50; - int lakesBeachAvoidance = beachSandRandomCenter + 20; - int smallHolesBeachAvoidance = beachSandRandomCenter + 20; - int num1 = beachSandRandomCenter; - int surfaceCavesBeachAvoidance2 = beachSandRandomCenter + 20; - int jungleOriginX = 0; - int snowOriginLeft = 0; - int snowOriginRight = 0; - int logX = -1; - int logY = -1; - int dungeonLocation = 0; - WorldGen.AddGenerationPass("Reset", (WorldGenLegacyMethod) ((progress, passConfig) => + for (int index1 = 0; index1 < WorldGen.hellChestItem.Length; ++index1) + { + bool flag = true; + while (flag) + { + flag = false; + WorldGen.hellChestItem[index1] = WorldGen.genRand.Next(WorldGen.hellChestItem.Length); + for (int index2 = 0; index2 < index1; ++index2) + { + if (WorldGen.hellChestItem[index2] == WorldGen.hellChestItem[index1]) + flag = true; + } + } + } + WorldGen.AddGenerationPass("Reset", (WorldGenLegacyMethod) (progress => { - WorldGen.numOceanCaveTreasure = 0; - WorldGen.skipDesertTileCheck = false; - WorldGen.gen = true; Liquid.ReInit(); WorldGen.noTileActions = true; progress.Message = ""; @@ -4709,37 +3270,21 @@ namespace Terraria WorldGen.RandomizeWeather(); Main.cloudAlpha = 0.0f; Main.maxRaining = 0.0f; + WorldFile.tempMaxRain = 0.0f; Main.raining = false; WorldGen.heartCount = 0; Main.checkXMas(); Main.checkHalloween(); + WorldGen.gen = true; WorldGen.ResetGenerator(); - WorldGen.UndergroundDesertLocation = Microsoft.Xna.Framework.Rectangle.Empty; - WorldGen.UndergroundDesertHiveLocation = Microsoft.Xna.Framework.Rectangle.Empty; WorldGen.numLarva = 0; - WorldGen.hellChestItem = new int[WorldGen.hellChestItem.Length]; - for (int index1 = 0; index1 < WorldGen.hellChestItem.Length; ++index1) - { - bool flag = true; - while (flag) - { - flag = false; - WorldGen.hellChestItem[index1] = WorldGen.genRand.Next(WorldGen.hellChestItem.Length); - for (int index2 = 0; index2 < index1; ++index2) - { - if (WorldGen.hellChestItem[index2] == WorldGen.hellChestItem[index1]) - flag = true; - } - } - } - int num2 = 86400; - Main.slimeRainTime = (double) -WorldGen.genRand.Next(num2 * 2, num2 * 3); + int num = 86400; + Main.slimeRainTime = (double) -WorldGen.genRand.Next(num * 2, num * 3); Main.cloudBGActive = (float) -WorldGen.genRand.Next(8640, 86400); - WorldGen.skipFramingDuringGen = false; - WorldGen.SavedOreTiers.Copper = 7; - WorldGen.SavedOreTiers.Iron = 6; - WorldGen.SavedOreTiers.Silver = 9; - WorldGen.SavedOreTiers.Gold = 8; + WorldGen.CopperTierOre = (ushort) 7; + WorldGen.IronTierOre = (ushort) 6; + WorldGen.SilverTierOre = (ushort) 9; + WorldGen.GoldTierOre = (ushort) 8; WorldGen.copperBar = 20; WorldGen.ironBar = 22; WorldGen.silverBar = 21; @@ -4748,25 +3293,25 @@ namespace Terraria { copper = 166; WorldGen.copperBar = 703; - WorldGen.SavedOreTiers.Copper = 166; + WorldGen.CopperTierOre = (ushort) 166; } if (WorldGen.genRand.Next(2) == 0) { iron = 167; WorldGen.ironBar = 704; - WorldGen.SavedOreTiers.Iron = 167; + WorldGen.IronTierOre = (ushort) 167; } if (WorldGen.genRand.Next(2) == 0) { silver = 168; WorldGen.silverBar = 705; - WorldGen.SavedOreTiers.Silver = 168; + WorldGen.SilverTierOre = (ushort) 168; } if (WorldGen.genRand.Next(2) == 0) { gold = 169; WorldGen.goldBar = 706; - WorldGen.SavedOreTiers.Gold = 169; + WorldGen.GoldTierOre = (ushort) 169; } WorldGen.crimson = WorldGen.genRand.Next(2) == 0; if (WorldGen.WorldGenParam_Evil == 0) @@ -4794,290 +3339,281 @@ namespace Terraria Main.worldID = WorldGen.genRand.Next(int.MaxValue); WorldGen.RandomizeTreeStyle(); WorldGen.RandomizeCaveBackgrounds(); - WorldGen.RandomizeBackgrounds(WorldGen.genRand); + WorldGen.RandomizeBackgrounds(); WorldGen.RandomizeMoonState(); - WorldGen.TreeTops.CopyExistingWorldInfoForWorldGeneration(); dungeonSide = WorldGen.genRand.Next(2) == 0 ? -1 : 1; - if (dungeonSide == -1) - { - float num3 = (float) (1.0 - (double) WorldGen.genRand.Next(15, 30) * 0.00999999977648258); - jungleOriginX = (int) ((double) Main.maxTilesX * (double) num3); - } - else - { - float num4 = (float) WorldGen.genRand.Next(15, 30) * 0.01f; - jungleOriginX = (int) ((double) Main.maxTilesX * (double) num4); - } - int num5 = WorldGen.genRand.Next(Main.maxTilesX); - if (WorldGen.drunkWorldGen) - dungeonSide *= -1; - if (dungeonSide == 1) - { - while ((double) num5 < (double) Main.maxTilesX * 0.600000023841858 || (double) num5 > (double) Main.maxTilesX * 0.75) - num5 = WorldGen.genRand.Next(Main.maxTilesX); - } - else - { - while ((double) num5 < (double) Main.maxTilesX * 0.25 || (double) num5 > (double) Main.maxTilesX * 0.400000005960464) - num5 = WorldGen.genRand.Next(Main.maxTilesX); - } - if (WorldGen.drunkWorldGen) - dungeonSide *= -1; - int num6 = WorldGen.genRand.Next(50, 90); - float num7 = (float) (Main.maxTilesX / 4200); - int num8 = num6 + (int) ((double) WorldGen.genRand.Next(20, 40) * (double) num7) + (int) ((double) WorldGen.genRand.Next(20, 40) * (double) num7); - int num9 = num5 - num8; - int num10 = WorldGen.genRand.Next(50, 90) + (int) ((double) WorldGen.genRand.Next(20, 40) * (double) num7) + (int) ((double) WorldGen.genRand.Next(20, 40) * (double) num7); - int num11 = num5 + num10; - if (num9 < 0) - num9 = 0; - if (num11 > Main.maxTilesX) - num11 = Main.maxTilesX; - snowOriginLeft = num9; - snowOriginRight = num11; - leftBeachEnd = WorldGen.genRand.Next(beachSandRandomCenter - beachSandRandomWidthRange, beachSandRandomCenter + beachSandRandomWidthRange); - if (dungeonSide == 1) - leftBeachEnd += beachSandDungeonExtraWidth; - else - leftBeachEnd += beachSandJungleExtraWidth; - rightBeachStart = Main.maxTilesX - WorldGen.genRand.Next(beachSandRandomCenter - beachSandRandomWidthRange, beachSandRandomCenter + beachSandRandomWidthRange); - if (dungeonSide == -1) - rightBeachStart -= beachSandDungeonExtraWidth; - else - rightBeachStart -= beachSandJungleExtraWidth; - int num12 = 50; - if (dungeonSide == -1) - dungeonLocation = WorldGen.genRand.Next(leftBeachEnd + num12, (int) ((double) Main.maxTilesX * 0.2)); - else - dungeonLocation = WorldGen.genRand.Next((int) ((double) Main.maxTilesX * 0.8), rightBeachStart - num12); })); - WorldGen.AddGenerationPass(new TerrainPass().OnBegin((Action) (pass => + WorldGen.AddGenerationPass("Terrain", (WorldGenLegacyMethod) (progress => { - TerrainPass terrainPass = pass as TerrainPass; - terrainPass.LeftBeachSize = leftBeachEnd; - terrainPass.RightBeachSize = Main.maxTilesX - rightBeachStart; - })).OnComplete((Action) (pass => - { - TerrainPass terrainPass = pass as TerrainPass; - rockLayer = terrainPass.RockLayer; - rockLayerHigh = terrainPass.RockLayerHigh; - rockLayerLow = terrainPass.RockLayerLow; - worldSurface = terrainPass.WorldSurface; - worldSurfaceHigh = terrainPass.WorldSurfaceHigh; - WorldGen.worldSurfaceLow = terrainPass.WorldSurfaceLow; - WorldGen.waterLine = terrainPass.WaterLine; - WorldGen.lavaLine = terrainPass.LavaLine; - }))); - WorldGen.AddGenerationPass("Dunes", (WorldGenLegacyMethod) ((progress, passConfig) => - { - progress.Message = Lang.gen[1].Value; - int random = passConfig.Get("Count").GetRandom(WorldGen.genRand); - float num13 = passConfig.Get("ChanceOfPyramid"); - if (WorldGen.drunkWorldGen) - num13 = 1f; - float num14 = (float) Main.maxTilesX / 4200f; - PyrX = new int[random + 3]; - PyrY = new int[random + 3]; - DunesBiome biome = configuration.CreateBiome(); - for (int index3 = 0; index3 < random; ++index3) + progress.Message = Lang.gen[0].Value; + int num1 = 0; + int num2 = 0; + worldSurface = (double) Main.maxTilesY * 0.3; + worldSurface *= (double) WorldGen.genRand.Next(90, 110) * 0.005; + rockLayer = worldSurface + (double) Main.maxTilesY * 0.2; + rockLayer *= (double) WorldGen.genRand.Next(90, 110) * 0.01; + WorldGen.worldSurfaceLow = worldSurface; + worldSurfaceHigh = worldSurface; + rockLayerLow = rockLayer; + rockLayerHigh = rockLayer; + for (int index3 = 0; index3 < Main.maxTilesX; ++index3) { - progress.Set((float) index3 / (float) random); - Point origin = Point.Zero; - bool flag1 = false; - int num15 = 0; - bool flag2; - bool flag3; - bool flag4; - for (; !flag1; flag1 = !(flag2 | flag3 | flag4)) + float num3 = (float) index3 / (float) Main.maxTilesX; + progress.Set(num3); + if (worldSurface < WorldGen.worldSurfaceLow) + WorldGen.worldSurfaceLow = worldSurface; + if (worldSurface > worldSurfaceHigh) + worldSurfaceHigh = worldSurface; + if (rockLayer < rockLayerLow) + rockLayerLow = rockLayer; + if (rockLayer > rockLayerHigh) + rockLayerHigh = rockLayer; + if (num2 <= 0) { - origin = WorldGen.RandomWorldPoint(right: 500, left: 500); - flag2 = Math.Abs(origin.X - jungleOriginX) < (int) (600.0 * (double) num14); - flag3 = Math.Abs(origin.X - Main.maxTilesX / 2) < 300; - flag4 = origin.X > snowOriginLeft - 300 && origin.Y < snowOriginRight + 300; - ++num15; - if (num15 >= Main.maxTilesX) - flag2 = false; - if (num15 >= Main.maxTilesX * 2) - flag4 = false; + num1 = WorldGen.genRand.Next(0, 5); + num2 = WorldGen.genRand.Next(5, 40); + if (num1 == 0) + num2 *= (int) ((double) WorldGen.genRand.Next(5, 30) * 0.2); } - biome.Place(origin, structures); - if ((double) WorldGen.genRand.NextFloat() <= (double) num13) - { - int index4 = WorldGen.genRand.Next(origin.X - 200, origin.X + 200); - for (int index5 = 0; index5 < Main.maxTilesY; ++index5) - { - if (Main.tile[index4, index5].active()) - { - PyrX[numPyr] = index4; - PyrY[numPyr] = index5 + 20; - ++numPyr; - break; - } - } - } - } - })); - WorldGen.AddGenerationPass("Ocean Sand", (WorldGenLegacyMethod) ((progress, passConfig) => - { - progress.Message = Language.GetTextValue("WorldGeneration.OceanSand"); - for (int index6 = 0; index6 < 3; ++index6) - { - progress.Set((float) index6 / 3f); - int num16 = WorldGen.genRand.Next(Main.maxTilesX); - while ((double) num16 > (double) Main.maxTilesX * 0.400000005960464 && (double) num16 < (double) Main.maxTilesX * 0.600000023841858) - num16 = WorldGen.genRand.Next(Main.maxTilesX); - int num17 = WorldGen.genRand.Next(35, 90); - if (index6 == 1) - { - float num18 = (float) (Main.maxTilesX / 4200); - num17 += (int) ((double) WorldGen.genRand.Next(20, 40) * (double) num18); - } - if (WorldGen.genRand.Next(3) == 0) - num17 *= 2; - if (index6 == 1) - num17 *= 2; - int num19 = num16 - num17; - int num20 = WorldGen.genRand.Next(35, 90); - if (WorldGen.genRand.Next(3) == 0) - num20 *= 2; - if (index6 == 1) - num20 *= 2; - int num21 = num16 + num20; - if (num19 < 0) - num19 = 0; - if (num21 > Main.maxTilesX) - num21 = Main.maxTilesX; - switch (index6) + --num2; + if ((double) index3 > (double) Main.maxTilesX * 0.43 && (double) index3 < (double) Main.maxTilesX * 0.57 && num1 >= 3) + num1 = WorldGen.genRand.Next(3); + if ((double) index3 > (double) Main.maxTilesX * 0.47 && (double) index3 < (double) Main.maxTilesX * 0.53) + num1 = 0; + switch (num1) { case 0: - num19 = 0; - num21 = leftBeachEnd; + while (WorldGen.genRand.Next(0, 7) == 0) + worldSurface += (double) WorldGen.genRand.Next(-1, 2); break; case 1: - continue; + while (WorldGen.genRand.Next(0, 4) == 0) + --worldSurface; + while (WorldGen.genRand.Next(0, 10) == 0) + ++worldSurface; + break; case 2: - num19 = rightBeachStart; - num21 = Main.maxTilesX; + while (WorldGen.genRand.Next(0, 4) == 0) + ++worldSurface; + while (WorldGen.genRand.Next(0, 10) == 0) + --worldSurface; + break; + case 3: + while (WorldGen.genRand.Next(0, 2) == 0) + --worldSurface; + while (WorldGen.genRand.Next(0, 6) == 0) + ++worldSurface; + break; + case 4: + while (WorldGen.genRand.Next(0, 2) == 0) + ++worldSurface; + while (WorldGen.genRand.Next(0, 5) == 0) + --worldSurface; break; } - int num22 = WorldGen.genRand.Next(50, 100); - for (int index7 = num19; index7 < num21; ++index7) + if (worldSurface < (double) Main.maxTilesY * 0.17) { - if (WorldGen.genRand.Next(2) == 0) + worldSurface = (double) Main.maxTilesY * 0.17; + num2 = 0; + } + else if (worldSurface > (double) Main.maxTilesY * 0.3) + { + worldSurface = (double) Main.maxTilesY * 0.3; + num2 = 0; + } + if ((index3 < 275 || index3 > Main.maxTilesX - 275) && worldSurface > (double) Main.maxTilesY * 0.25) + { + worldSurface = (double) Main.maxTilesY * 0.25; + num2 = 1; + } + while (WorldGen.genRand.Next(0, 3) == 0) + rockLayer += (double) WorldGen.genRand.Next(-2, 3); + if (rockLayer < worldSurface + (double) Main.maxTilesY * 0.05) + ++rockLayer; + if (rockLayer > worldSurface + (double) Main.maxTilesY * 0.35) + --rockLayer; + for (int index4 = 0; (double) index4 < worldSurface; ++index4) + { + Main.tile[index3, index4].active(false); + Main.tile[index3, index4].frameX = (short) -1; + Main.tile[index3, index4].frameY = (short) -1; + } + for (int index5 = (int) worldSurface; index5 < Main.maxTilesY; ++index5) + { + if ((double) index5 < rockLayer) { - num22 += WorldGen.genRand.Next(-1, 2); - if (num22 < 50) - num22 = 50; - if (num22 > 200) - num22 = 200; + Main.tile[index3, index5].active(true); + Main.tile[index3, index5].type = (ushort) 0; + Main.tile[index3, index5].frameX = (short) -1; + Main.tile[index3, index5].frameY = (short) -1; } - for (int index8 = 0; (double) index8 < (Main.worldSurface + Main.rockLayer) / 2.0; ++index8) + else { - if (Main.tile[index7, index8].active()) - { - if (index7 == (num19 + num21) / 2 && WorldGen.genRand.Next(6) == 0) - { - PyrX[numPyr] = index7; - PyrY[numPyr] = index8; - ++numPyr; - } - int num23 = num22; - if (index7 - num19 < num23) - num23 = index7 - num19; - if (num21 - index7 < num23) - num23 = num21 - index7; - int num24 = num23 + WorldGen.genRand.Next(5); - for (int index9 = index8; index9 < index8 + num24; ++index9) - { - if (index7 > num19 + WorldGen.genRand.Next(5) && index7 < num21 - WorldGen.genRand.Next(5)) - Main.tile[index7, index9].type = (ushort) 53; - } - break; - } + Main.tile[index3, index5].active(true); + Main.tile[index3, index5].type = (ushort) 1; + Main.tile[index3, index5].frameX = (short) -1; + Main.tile[index3, index5].frameY = (short) -1; } } } + Main.worldSurface = worldSurfaceHigh + 25.0; + Main.rockLayer = rockLayerHigh; + double num4 = (double) ((int) ((Main.rockLayer - Main.worldSurface) / 6.0) * 6); + Main.rockLayer = Main.worldSurface + num4; + WorldGen.waterLine = (int) (Main.rockLayer + (double) Main.maxTilesY) / 2; + WorldGen.waterLine += WorldGen.genRand.Next(-100, 20); + WorldGen.lavaLine = WorldGen.waterLine + WorldGen.genRand.Next(50, 80); })); - WorldGen.AddGenerationPass("Sand Patches", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Tunnels", (WorldGenLegacyMethod) (progress => { - int num25 = (int) ((double) Main.maxTilesX * 0.0130000002682209); - for (int index = 0; index < num25; ++index) - { - int i = WorldGen.genRand.Next(0, Main.maxTilesX); - int j; - for (j = WorldGen.genRand.Next((int) Main.worldSurface, (int) Main.rockLayer); (double) i > (double) Main.maxTilesX * 0.46 && (double) i < (double) Main.maxTilesX * 0.54 && (double) j < Main.worldSurface + 150.0; j = WorldGen.genRand.Next((int) Main.worldSurface, (int) Main.rockLayer)) - i = WorldGen.genRand.Next(0, Main.maxTilesX); - WorldGen.TileRunner(i, j, (double) WorldGen.genRand.Next(15, 70), WorldGen.genRand.Next(20, 130), 53); - } - })); - WorldGen.AddGenerationPass("Tunnels", (WorldGenLegacyMethod) ((progress, passConfig) => - { - for (int index10 = 0; index10 < (int) ((double) Main.maxTilesX * 0.0015) && WorldGen.numTunnels < WorldGen.maxTunnels - 1; ++index10) + for (int index6 = 0; index6 < (int) ((double) Main.maxTilesX * 0.0015); ++index6) { int[] numArray1 = new int[10]; int[] numArray2 = new int[10]; - int num26 = WorldGen.genRand.Next(450, Main.maxTilesX - 450); - while ((double) num26 > (double) Main.maxTilesX * 0.4 && (double) num26 < (double) Main.maxTilesX * 0.6) - num26 = WorldGen.genRand.Next(450, Main.maxTilesX - 450); - int index11 = 0; - bool flag; - do + int num = WorldGen.genRand.Next(450, Main.maxTilesX - 450); + while ((double) num > (double) Main.maxTilesX * 0.449999988079071 && (double) num < (double) Main.maxTilesX * 0.550000011920929) + num = WorldGen.genRand.Next(0, Main.maxTilesX); + int index7 = 0; + for (int index8 = 0; index8 < 10; ++index8) { - flag = false; - for (int index12 = 0; index12 < 10; ++index12) - { - int index13 = num26 % Main.maxTilesX; - while (!Main.tile[index13, index11].active()) - ++index11; - if (Main.tile[index13, index11].type == (ushort) 53) - flag = true; - numArray1[index12] = index13; - numArray2[index12] = index11 - WorldGen.genRand.Next(11, 16); - num26 = index13 + WorldGen.genRand.Next(5, 11); - } + int index9 = num % Main.maxTilesX; + while (!Main.tile[index9, index7].active()) + ++index7; + numArray1[index8] = index9; + numArray2[index8] = index7 - WorldGen.genRand.Next(11, 16); + num = index9 + WorldGen.genRand.Next(5, 11); } - while (flag); - WorldGen.tunnelX[WorldGen.numTunnels] = numArray1[5]; - ++WorldGen.numTunnels; - for (int index14 = 0; index14 < 10; ++index14) + for (int index10 = 0; index10 < 10; ++index10) { - WorldGen.TileRunner(numArray1[index14], numArray2[index14], (double) WorldGen.genRand.Next(5, 8), WorldGen.genRand.Next(6, 9), 0, true, -2f, -0.3f); - WorldGen.TileRunner(numArray1[index14], numArray2[index14], (double) WorldGen.genRand.Next(5, 8), WorldGen.genRand.Next(6, 9), 0, true, 2f, -0.3f); + WorldGen.TileRunner(numArray1[index10], numArray2[index10], (double) WorldGen.genRand.Next(5, 8), WorldGen.genRand.Next(6, 9), 0, true, -2f, -0.3f); + WorldGen.TileRunner(numArray1[index10], numArray2[index10], (double) WorldGen.genRand.Next(5, 8), WorldGen.genRand.Next(6, 9), 0, true, 2f, -0.3f); } } })); - WorldGen.AddGenerationPass("Mount Caves", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Sand", (WorldGenLegacyMethod) (progress => { - WorldGen.numMCaves = 0; - progress.Message = Lang.gen[2].Value; - for (int index15 = 0; index15 < (int) ((double) Main.maxTilesX * 0.001); ++index15) + progress.Message = Lang.gen[1].Value; + int length = WorldGen.genRand.Next((int) ((double) Main.maxTilesX * 0.0008), (int) ((double) Main.maxTilesX * (1.0 / 400.0))) + 2; + PyrX = new int[length]; + PyrY = new int[length]; + for (int index11 = 0; index11 < length; ++index11) { - progress.Set((float) ((double) index15 / (double) Main.maxTilesX * (1.0 / 1000.0))); - int num27 = 0; - bool flag5 = false; - bool flag6 = false; - int i = WorldGen.genRand.Next((int) ((double) Main.maxTilesX * 0.25), (int) ((double) Main.maxTilesX * 0.75)); - while (!flag6) + int num5 = WorldGen.genRand.Next(Main.maxTilesX); + while ((double) num5 > (double) Main.maxTilesX * 0.400000005960464 && (double) num5 < (double) Main.maxTilesX * 0.600000023841858) + num5 = WorldGen.genRand.Next(Main.maxTilesX); + int num6 = WorldGen.genRand.Next(35, 90); + if (index11 == 1) { - flag6 = true; - while (i > Main.maxTilesX / 2 - 90 && i < Main.maxTilesX / 2 + 90) - i = WorldGen.genRand.Next((int) ((double) Main.maxTilesX * 0.25), (int) ((double) Main.maxTilesX * 0.75)); - for (int index16 = 0; index16 < WorldGen.numMCaves; ++index16) - { - if (Math.Abs(i - WorldGen.mCaveX[index16]) < 100) + float num7 = (float) (Main.maxTilesX / 4200); + num6 += (int) ((double) WorldGen.genRand.Next(20, 40) * (double) num7); + } + if (WorldGen.genRand.Next(3) == 0) + num6 *= 2; + if (index11 == 1) + num6 *= 2; + int num8 = num5 - num6; + int num9 = WorldGen.genRand.Next(35, 90); + if (WorldGen.genRand.Next(3) == 0) + num9 *= 2; + if (index11 == 1) + num9 *= 2; + int num10 = num5 + num9; + if (num8 < 0) + num8 = 0; + if (num10 > Main.maxTilesX) + num10 = Main.maxTilesX; + switch (index11) + { + case 0: + num8 = 0; + num10 = WorldGen.genRand.Next(260, 300); + if (dungeonSide == 1) { - ++num27; - flag6 = false; + num10 += 40; + break; + } + break; + case 2: + num8 = Main.maxTilesX - WorldGen.genRand.Next(260, 300); + num10 = Main.maxTilesX; + if (dungeonSide == -1) + { + num8 -= 40; + break; + } + break; + } + int num11 = WorldGen.genRand.Next(50, 100); + for (int index12 = num8; index12 < num10; ++index12) + { + if (WorldGen.genRand.Next(2) == 0) + { + num11 += WorldGen.genRand.Next(-1, 2); + if (num11 < 50) + num11 = 50; + if (num11 > 100) + num11 = 100; + } + for (int index13 = 0; (double) index13 < Main.worldSurface; ++index13) + { + if (Main.tile[index12, index13].active()) + { + if (index12 == (num8 + num10) / 2 && WorldGen.genRand.Next(6) == 0) + { + PyrX[numPyr] = index12; + PyrY[numPyr] = index13; + ++numPyr; + } + int num12 = num11; + if (index12 - num8 < num12) + num12 = index12 - num8; + if (num10 - index12 < num12) + num12 = num10 - index12; + int num13 = num12 + WorldGen.genRand.Next(5); + for (int index14 = index13; index14 < index13 + num13; ++index14) + { + if (index12 > num8 + WorldGen.genRand.Next(5) && index12 < num10 - WorldGen.genRand.Next(5)) + Main.tile[index12, index14].type = (ushort) 53; + } break; } } - if (num27 >= Main.maxTilesX / 5) + } + } + for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 8E-06); ++index) + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int) Main.worldSurface, (int) Main.rockLayer), (double) WorldGen.genRand.Next(15, 70), WorldGen.genRand.Next(20, 130), 53); + })); + WorldGen.AddGenerationPass("Mount Caves", (WorldGenLegacyMethod) (progress => + { + WorldGen.numMCaves = 0; + progress.Message = Lang.gen[2].Value; + for (int index15 = 0; index15 < (int) ((double) Main.maxTilesX * 0.0008); ++index15) + { + int num = 0; + bool flag1 = false; + bool flag2 = false; + int i = WorldGen.genRand.Next((int) ((double) Main.maxTilesX * 0.25), (int) ((double) Main.maxTilesX * 0.75)); + while (!flag2) + { + flag2 = true; + while (i > Main.maxTilesX / 2 - 100 && i < Main.maxTilesX / 2 + 100) + i = WorldGen.genRand.Next((int) ((double) Main.maxTilesX * 0.25), (int) ((double) Main.maxTilesX * 0.75)); + for (int index16 = 0; index16 < WorldGen.numMCaves; ++index16) { - flag5 = true; + if (i > WorldGen.mCaveX[index16] - 50 && i < WorldGen.mCaveX[index16] + 50) + { + ++num; + flag2 = false; + break; + } + } + if (num >= 200) + { + flag1 = true; break; } } - if (!flag5) + if (!flag1) { for (int j = 0; (double) j < Main.worldSurface; ++j) { @@ -5088,10 +3624,10 @@ namespace Terraria for (int index18 = j - 25; index18 < j + 25; ++index18) { if (Main.tile[index17, index18].active() && (Main.tile[index17, index18].type == (ushort) 53 || Main.tile[index17, index18].type == (ushort) 151 || Main.tile[index17, index18].type == (ushort) 274)) - flag5 = true; + flag1 = true; } } - if (!flag5) + if (!flag1) { WorldGen.Mountinater(i, j); WorldGen.mCaveX[WorldGen.numMCaves] = i; @@ -5104,14 +3640,14 @@ namespace Terraria } } })); - WorldGen.AddGenerationPass("Dirt Wall Backgrounds", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Dirt Wall Backgrounds", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[3].Value; for (int index19 = 1; index19 < Main.maxTilesX - 1; ++index19) { - ushort num28 = 2; - float num29 = (float) index19 / (float) Main.maxTilesX; - progress.Set(num29); + byte num14 = 2; + float num15 = (float) index19 / (float) Main.maxTilesX; + progress.Set(num15); bool flag = false; howFar += WorldGen.genRand.Next(-1, 2); if (howFar < 0) @@ -5121,23 +3657,20 @@ namespace Terraria for (int index20 = 0; (double) index20 < Main.worldSurface + 10.0 && (double) index20 <= Main.worldSurface + (double) howFar; ++index20) { if (Main.tile[index19, index20].active()) - num28 = Main.tile[index19, index20].type != (ushort) 147 ? (ushort) 2 : (ushort) 40; - if (flag && Main.tile[index19, index20].wall != (ushort) 64) - Main.tile[index19, index20].wall = num28; + num14 = Main.tile[index19, index20].type != (ushort) 147 ? (byte) 2 : (byte) 40; + if (flag && Main.tile[index19, index20].wall != (byte) 64) + Main.tile[index19, index20].wall = num14; if (Main.tile[index19, index20].active() && Main.tile[index19 - 1, index20].active() && Main.tile[index19 + 1, index20].active() && Main.tile[index19, index20 + 1].active() && Main.tile[index19 - 1, index20 + 1].active() && Main.tile[index19 + 1, index20 + 1].active()) flag = true; } } })); - WorldGen.AddGenerationPass("Rocks In Dirt", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Rocks In Dirt", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[4].Value; - float num30 = (float) (Main.maxTilesX * Main.maxTilesY) * 0.00015f; - for (int index = 0; (double) index < (double) num30; ++index) + for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 0.00015); ++index) WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next(0, (int) WorldGen.worldSurfaceLow + 1), (double) WorldGen.genRand.Next(4, 15), WorldGen.genRand.Next(5, 40), 1); - progress.Set(0.34f); - float num31 = (float) (Main.maxTilesX * Main.maxTilesY) * 0.0002f; - for (int index = 0; (double) index < (double) num31; ++index) + for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 0.0002); ++index) { int i = WorldGen.genRand.Next(0, Main.maxTilesX); int j = WorldGen.genRand.Next((int) WorldGen.worldSurfaceLow, (int) worldSurfaceHigh + 1); @@ -5145,33 +3678,24 @@ namespace Terraria j = WorldGen.genRand.Next((int) WorldGen.worldSurfaceLow, (int) worldSurfaceHigh + 1); WorldGen.TileRunner(i, j, (double) WorldGen.genRand.Next(4, 10), WorldGen.genRand.Next(5, 30), 1); } - progress.Set(0.67f); - float num32 = (float) (Main.maxTilesX * Main.maxTilesY) * 0.0045f; - for (int index = 0; (double) index < (double) num32; ++index) + for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 0.0045); ++index) WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int) worldSurfaceHigh, (int) rockLayerHigh + 1), (double) WorldGen.genRand.Next(2, 7), WorldGen.genRand.Next(2, 23), 1); })); - WorldGen.AddGenerationPass("Dirt In Rocks", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Dirt In Rocks", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[5].Value; - float num33 = (float) (Main.maxTilesX * Main.maxTilesY) * 0.005f; - for (int index = 0; (double) index < (double) num33; ++index) - { - progress.Set((float) index / num33); + for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 0.005); ++index) WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int) rockLayerLow, Main.maxTilesY), (double) WorldGen.genRand.Next(2, 6), WorldGen.genRand.Next(2, 40), 0); - } })); - WorldGen.AddGenerationPass("Clay", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Clay", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[6].Value; for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 2E-05); ++index) WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next(0, (int) WorldGen.worldSurfaceLow), (double) WorldGen.genRand.Next(4, 14), WorldGen.genRand.Next(10, 50), 40); - progress.Set(0.25f); for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 5E-05); ++index) WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int) WorldGen.worldSurfaceLow, (int) worldSurfaceHigh + 1), (double) WorldGen.genRand.Next(8, 14), WorldGen.genRand.Next(15, 45), 40); - progress.Set(0.5f); for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 2E-05); ++index) WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int) worldSurfaceHigh, (int) rockLayerHigh + 1), (double) WorldGen.genRand.Next(8, 15), WorldGen.genRand.Next(5, 50), 40); - progress.Set(0.75f); for (int index21 = 5; index21 < Main.maxTilesX - 5; ++index21) { for (int index22 = 1; (double) index22 < Main.worldSurface - 1.0; ++index22) @@ -5189,58 +3713,44 @@ namespace Terraria } })); int i2; - WorldGen.AddGenerationPass("Small Holes", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Small Holes", (WorldGenLegacyMethod) (progress => { i2 = 0; progress.Message = Lang.gen[7].Value; - double num34 = worldSurfaceHigh; for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 0.0015); ++index) { - float num35 = (float) index / ((float) (Main.maxTilesX * Main.maxTilesY) * 0.0015f); - progress.Set(num35); + float num = (float) index / ((float) (Main.maxTilesX * Main.maxTilesY) * 0.0015f); + progress.Set(num); int type = -1; if (WorldGen.genRand.Next(5) == 0) type = -2; - int i1 = WorldGen.genRand.Next(0, Main.maxTilesX); - int j1; - for (j1 = WorldGen.genRand.Next((int) worldSurfaceHigh, Main.maxTilesY); (i1 < smallHolesBeachAvoidance || i1 > Main.maxTilesX - smallHolesBeachAvoidance) && (double) j1 < num34 || (double) i1 > (double) Main.maxTilesX * 0.45 && (double) i1 < (double) Main.maxTilesX * 0.55 && (double) j1 < worldSurface; j1 = WorldGen.genRand.Next((int) worldSurfaceHigh, Main.maxTilesY)) - i1 = WorldGen.genRand.Next(0, Main.maxTilesX); - WorldGen.TileRunner(i1, j1, (double) WorldGen.genRand.Next(2, 5), WorldGen.genRand.Next(2, 20), type); - int i3 = WorldGen.genRand.Next(0, Main.maxTilesX); - int j2; - for (j2 = WorldGen.genRand.Next((int) worldSurfaceHigh, Main.maxTilesY); (i3 < smallHolesBeachAvoidance || i3 > Main.maxTilesX - smallHolesBeachAvoidance) && (double) j2 < num34 || (double) i3 > (double) Main.maxTilesX * 0.45 && (double) i3 < (double) Main.maxTilesX * 0.55 && (double) j2 < worldSurface; j2 = WorldGen.genRand.Next((int) worldSurfaceHigh, Main.maxTilesY)) - i3 = WorldGen.genRand.Next(0, Main.maxTilesX); - WorldGen.TileRunner(i3, j2, (double) WorldGen.genRand.Next(8, 15), WorldGen.genRand.Next(7, 30), type); + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int) worldSurfaceHigh, Main.maxTilesY), (double) WorldGen.genRand.Next(2, 5), WorldGen.genRand.Next(2, 20), type); + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int) worldSurfaceHigh, Main.maxTilesY), (double) WorldGen.genRand.Next(8, 15), WorldGen.genRand.Next(7, 30), type); } })); - WorldGen.AddGenerationPass("Dirt Layer Caves", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Dirt Layer Caves", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[8].Value; - double num36 = worldSurfaceHigh; for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 3E-05); ++index) { - float num37 = (float) index / ((float) (Main.maxTilesX * Main.maxTilesY) * 3E-05f); - progress.Set(num37); + float num = (float) index / ((float) (Main.maxTilesX * Main.maxTilesY) * 3E-05f); + progress.Set(num); if (rockLayerHigh <= (double) Main.maxTilesY) { int type = -1; if (WorldGen.genRand.Next(6) == 0) type = -2; - int i = WorldGen.genRand.Next(0, Main.maxTilesX); - int j; - for (j = WorldGen.genRand.Next((int) WorldGen.worldSurfaceLow, (int) rockLayerHigh + 1); (i < smallHolesBeachAvoidance || i > Main.maxTilesX - smallHolesBeachAvoidance) && (double) j < num36 || (double) i >= (double) Main.maxTilesX * 0.45 && (double) i <= (double) Main.maxTilesX * 0.55 && (double) j < Main.worldSurface; j = WorldGen.genRand.Next((int) WorldGen.worldSurfaceLow, (int) rockLayerHigh + 1)) - i = WorldGen.genRand.Next(0, Main.maxTilesX); - WorldGen.TileRunner(i, j, (double) WorldGen.genRand.Next(5, 15), WorldGen.genRand.Next(30, 200), type); + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int) WorldGen.worldSurfaceLow, (int) rockLayerHigh + 1), (double) WorldGen.genRand.Next(5, 15), WorldGen.genRand.Next(30, 200), type); } } })); - WorldGen.AddGenerationPass("Rock Layer Caves", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Rock Layer Caves", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[9].Value; for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 0.00013); ++index) { - float num38 = (float) index / ((float) (Main.maxTilesX * Main.maxTilesY) * 0.00013f); - progress.Set(num38); + float num = (float) index / ((float) (Main.maxTilesX * Main.maxTilesY) * 0.00013f); + progress.Set(num); if (rockLayerHigh <= (double) Main.maxTilesY) { int type = -1; @@ -5250,13 +3760,13 @@ namespace Terraria } } })); - WorldGen.AddGenerationPass("Surface Caves", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Surface Caves", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[10].Value; for (int index = 0; index < (int) ((double) Main.maxTilesX * 0.002); ++index) { i2 = WorldGen.genRand.Next(0, Main.maxTilesX); - while ((double) i2 > (double) Main.maxTilesX * 0.449999988079071 && (double) i2 < (double) Main.maxTilesX * 0.550000011920929 || i2 < leftBeachEnd + 20 || i2 > rightBeachStart - 20) + while ((double) i2 > (double) Main.maxTilesX * 0.449999988079071 && (double) i2 < (double) Main.maxTilesX * 0.550000011920929) i2 = WorldGen.genRand.Next(0, Main.maxTilesX); for (int j = 0; (double) j < worldSurfaceHigh; ++j) { @@ -5267,11 +3777,10 @@ namespace Terraria } } } - progress.Set(0.2f); for (int index = 0; index < (int) ((double) Main.maxTilesX * 0.0007); ++index) { i2 = WorldGen.genRand.Next(0, Main.maxTilesX); - while ((double) i2 > (double) Main.maxTilesX * 0.430000007152557 && (double) i2 < (double) Main.maxTilesX * 0.569999992847443 || i2 < leftBeachEnd + 20 || i2 > rightBeachStart - 20) + while ((double) i2 > (double) Main.maxTilesX * 0.430000007152557 && (double) i2 < (double) Main.maxTilesX * 0.569999992847443) i2 = WorldGen.genRand.Next(0, Main.maxTilesX); for (int j = 0; (double) j < worldSurfaceHigh; ++j) { @@ -5282,11 +3791,10 @@ namespace Terraria } } } - progress.Set(0.4f); for (int index = 0; index < (int) ((double) Main.maxTilesX * 0.0003); ++index) { i2 = WorldGen.genRand.Next(0, Main.maxTilesX); - while ((double) i2 > (double) Main.maxTilesX * 0.400000005960464 && (double) i2 < (double) Main.maxTilesX * 0.600000023841858 || i2 < leftBeachEnd + 20 || i2 > rightBeachStart - 20) + while ((double) i2 > (double) Main.maxTilesX * 0.400000005960464 && (double) i2 < (double) Main.maxTilesX * 0.600000023841858) i2 = WorldGen.genRand.Next(0, Main.maxTilesX); for (int j = 0; (double) j < worldSurfaceHigh; ++j) { @@ -5299,11 +3807,10 @@ namespace Terraria } } } - progress.Set(0.6f); for (int index = 0; index < (int) ((double) Main.maxTilesX * 0.0004); ++index) { i2 = WorldGen.genRand.Next(0, Main.maxTilesX); - while ((double) i2 > (double) Main.maxTilesX * 0.400000005960464 && (double) i2 < (double) Main.maxTilesX * 0.600000023841858 || i2 < leftBeachEnd + 20 || i2 > rightBeachStart - 20) + while ((double) i2 > (double) Main.maxTilesX * 0.400000005960464 && (double) i2 < (double) Main.maxTilesX * 0.600000023841858) i2 = WorldGen.genRand.Next(0, Main.maxTilesX); for (int j = 0; (double) j < worldSurfaceHigh; ++j) { @@ -5314,58 +3821,56 @@ namespace Terraria } } } - progress.Set(0.8f); - float num39 = (float) (Main.maxTilesX / 4200); - for (int index = 0; (double) index < 5.0 * (double) num39; ++index) + float num = (float) (Main.maxTilesX / 4200); + for (int index = 0; (double) index < 5.0 * (double) num; ++index) { try { - WorldGen.Caverer(WorldGen.genRand.Next(surfaceCavesBeachAvoidance2, Main.maxTilesX - surfaceCavesBeachAvoidance2), WorldGen.genRand.Next((int) Main.rockLayer, Main.maxTilesY - 400)); + WorldGen.Caverer(WorldGen.genRand.Next(100, Main.maxTilesX - 100), WorldGen.genRand.Next((int) Main.rockLayer, Main.maxTilesY - 400)); } catch { } } })); - WorldGen.AddGenerationPass("Generate Ice Biome", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Slush Check", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[56].Value; snowTop = (int) Main.worldSurface; - int num40 = WorldGen.lavaLine - WorldGen.genRand.Next(160, 200); - int num41 = snowOriginLeft; - int num42 = snowOriginRight; - int num43 = 10; + int num16 = WorldGen.genRand.Next(Main.maxTilesX); + if (dungeonSide == 1) + { + while ((double) num16 < (double) Main.maxTilesX * 0.550000011920929 || (double) num16 > (double) Main.maxTilesX * 0.699999988079071) + num16 = WorldGen.genRand.Next(Main.maxTilesX); + } + else + { + while ((double) num16 < (double) Main.maxTilesX * 0.300000011920929 || (double) num16 > (double) Main.maxTilesX * 0.449999988079071) + num16 = WorldGen.genRand.Next(Main.maxTilesX); + } + int num17 = WorldGen.genRand.Next(50, 90); + float num18 = (float) (Main.maxTilesX / 4200); + int num19 = num17 + (int) ((double) WorldGen.genRand.Next(20, 40) * (double) num18) + (int) ((double) WorldGen.genRand.Next(20, 40) * (double) num18); + int num20 = num16 - num19; + int num21 = WorldGen.genRand.Next(50, 90) + (int) ((double) WorldGen.genRand.Next(20, 40) * (double) num18) + (int) ((double) WorldGen.genRand.Next(20, 40) * (double) num18); + int num22 = num16 + num21; + if (num20 < 0) + num20 = 0; + if (num22 > Main.maxTilesX) + num22 = Main.maxTilesX; + int num23 = 10; for (int index24 = 0; index24 <= WorldGen.lavaLine - 140; ++index24) { - progress.Set((float) index24 / (float) (WorldGen.lavaLine - 140)); - num41 += WorldGen.genRand.Next(-4, 4); - num42 += WorldGen.genRand.Next(-3, 5); - if (index24 > 0) + num20 += WorldGen.genRand.Next(-4, 4); + num22 += WorldGen.genRand.Next(-3, 5); + snowMinX[index24] = num20; + snowMaxX[index24] = num22; + for (int index25 = num20; index25 < num22; ++index25) { - num41 = (num41 + snowMinX[index24 - 1]) / 2; - num42 = (num42 + snowMaxX[index24 - 1]) / 2; - } - if (dungeonSide > 0) - { - if (WorldGen.genRand.Next(4) == 0) + if (index24 < WorldGen.lavaLine - 140) { - ++num41; - ++num42; - } - } - else if (WorldGen.genRand.Next(4) == 0) - { - --num41; - --num42; - } - snowMinX[index24] = num41; - snowMaxX[index24] = num42; - for (int index25 = num41; index25 < num42; ++index25) - { - if (index24 < num40) - { - if (Main.tile[index25, index24].wall == (ushort) 2) - Main.tile[index25, index24].wall = (ushort) 40; + if (Main.tile[index25, index24].wall == (byte) 2) + Main.tile[index25, index24].wall = (byte) 40; switch (Main.tile[index25, index24].type) { case 0: @@ -5384,21 +3889,21 @@ namespace Terraria } else { - num43 += WorldGen.genRand.Next(-3, 4); + num23 += WorldGen.genRand.Next(-3, 4); if (WorldGen.genRand.Next(3) == 0) { - num43 += WorldGen.genRand.Next(-4, 5); + num23 += WorldGen.genRand.Next(-4, 5); if (WorldGen.genRand.Next(3) == 0) - num43 += WorldGen.genRand.Next(-6, 7); + num23 += WorldGen.genRand.Next(-6, 7); } - if (num43 < 0) - num43 = WorldGen.genRand.Next(3); - else if (num43 > 50) - num43 = 50 - WorldGen.genRand.Next(3); - for (int index26 = index24; index26 < index24 + num43; ++index26) + if (num23 < 0) + num23 = WorldGen.genRand.Next(3); + else if (num23 > 50) + num23 = 50 - WorldGen.genRand.Next(3); + for (int index26 = index24; index26 < index24 + num23; ++index26) { - if (Main.tile[index25, index26].wall == (ushort) 2) - Main.tile[index25, index26].wall = (ushort) 40; + if (Main.tile[index25, index26].wall == (byte) 2) + Main.tile[index25, index26].wall = (byte) 40; switch (Main.tile[index25, index26].type) { case 0: @@ -5419,12 +3924,10 @@ namespace Terraria snowBottom = index24; } })); - WorldGen.AddGenerationPass("Grass", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Grass", (WorldGenLegacyMethod) (progress => { - float num44 = (float) (Main.maxTilesX * Main.maxTilesY) * (1f / 500f); - for (int index27 = 0; (double) index27 < (double) num44; ++index27) + for (int index27 = 0; index27 < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 0.002); ++index27) { - progress.Set((float) index27 / num44); int index28 = WorldGen.genRand.Next(1, Main.maxTilesX - 1); int index29 = WorldGen.genRand.Next((int) WorldGen.worldSurfaceLow, (int) worldSurfaceHigh); if (index29 >= Main.maxTilesY) @@ -5445,19 +3948,138 @@ namespace Terraria } } })); - WorldGen.AddGenerationPass(new JunglePass().OnBegin((Action) (pass => + WorldGen.AddGenerationPass("Jungle", (WorldGenLegacyMethod) (progress => { - JunglePass junglePass = pass as JunglePass; - junglePass.JungleOriginX = jungleOriginX; - junglePass.DungeonSide = dungeonSide; - junglePass.WorldSurface = worldSurface; - junglePass.LeftBeachEnd = leftBeachEnd; - junglePass.RightBeachStart = rightBeachStart; - })).OnComplete((Action) (pass => WorldGen.JungleX = (pass as JunglePass).JungleX))); - WorldGen.AddGenerationPass("Mud Caves To Grass", (WorldGenLegacyMethod) ((progress, passConfig) => + progress.Message = Lang.gen[11].Value; + float num24 = (float) (Main.maxTilesX / 4200) * 1.5f; + float num25 = (float) WorldGen.genRand.Next(15, 30) * 0.01f; + int num26; + if (dungeonSide == -1) + { + float num27 = 1f - num25; + num26 = (int) ((double) Main.maxTilesX * (double) num27); + } + else + num26 = (int) ((double) Main.maxTilesX * (double) num25); + int num28 = (int) ((double) Main.maxTilesY + Main.rockLayer) / 2; + int i1 = num26 + WorldGen.genRand.Next((int) (-100.0 * (double) num24), (int) (101.0 * (double) num24)); + int j1 = num28 + WorldGen.genRand.Next((int) (-100.0 * (double) num24), (int) (101.0 * (double) num24)); + int num29 = i1; + int num30 = j1; + WorldGen.TileRunner(i1, j1, (double) WorldGen.genRand.Next((int) (250.0 * (double) num24), (int) (500.0 * (double) num24)), WorldGen.genRand.Next(50, 150), 59, speedX: ((float) (dungeonSide * 3))); + for (int index = 0; (double) index < 6.0 * (double) num24; ++index) + WorldGen.TileRunner(i1 + WorldGen.genRand.Next(-(int) (125.0 * (double) num24), (int) (125.0 * (double) num24)), j1 + WorldGen.genRand.Next(-(int) (125.0 * (double) num24), (int) (125.0 * (double) num24)), (double) WorldGen.genRand.Next(3, 7), WorldGen.genRand.Next(3, 8), WorldGen.genRand.Next(63, 65)); + WorldGen.mudWall = true; + progress.Set(0.15f); + int i3 = i1 + WorldGen.genRand.Next((int) (-250.0 * (double) num24), (int) (251.0 * (double) num24)); + int j2 = j1 + WorldGen.genRand.Next((int) (-150.0 * (double) num24), (int) (151.0 * (double) num24)); + int num31 = i3; + int num32 = j2; + int num33 = i3; + int num34 = j2; + WorldGen.TileRunner(i3, j2, (double) WorldGen.genRand.Next((int) (250.0 * (double) num24), (int) (500.0 * (double) num24)), WorldGen.genRand.Next(50, 150), 59); + WorldGen.mudWall = false; + for (int index = 0; (double) index < 6.0 * (double) num24; ++index) + WorldGen.TileRunner(i3 + WorldGen.genRand.Next(-(int) (125.0 * (double) num24), (int) (125.0 * (double) num24)), j2 + WorldGen.genRand.Next(-(int) (125.0 * (double) num24), (int) (125.0 * (double) num24)), (double) WorldGen.genRand.Next(3, 7), WorldGen.genRand.Next(3, 8), WorldGen.genRand.Next(65, 67)); + WorldGen.mudWall = true; + progress.Set(0.3f); + int i4 = i3 + WorldGen.genRand.Next((int) (-400.0 * (double) num24), (int) (401.0 * (double) num24)); + int j3 = j2 + WorldGen.genRand.Next((int) (-150.0 * (double) num24), (int) (151.0 * (double) num24)); + int num35 = i4; + int num36 = j3; + WorldGen.TileRunner(i4, j3, (double) WorldGen.genRand.Next((int) (250.0 * (double) num24), (int) (500.0 * (double) num24)), WorldGen.genRand.Next(50, 150), 59, speedX: ((float) (dungeonSide * -3))); + WorldGen.mudWall = false; + for (int index = 0; (double) index < 6.0 * (double) num24; ++index) + WorldGen.TileRunner(i4 + WorldGen.genRand.Next(-(int) (125.0 * (double) num24), (int) (125.0 * (double) num24)), j3 + WorldGen.genRand.Next(-(int) (125.0 * (double) num24), (int) (125.0 * (double) num24)), (double) WorldGen.genRand.Next(3, 7), WorldGen.genRand.Next(3, 8), WorldGen.genRand.Next(67, 69)); + WorldGen.mudWall = true; + progress.Set(0.45f); + int i5 = (num29 + num31 + num35) / 3; + int j4 = (num30 + num32 + num36) / 3; + WorldGen.TileRunner(i5, j4, (double) WorldGen.genRand.Next((int) (400.0 * (double) num24), (int) (600.0 * (double) num24)), 10000, 59, speedY: -20f, noYChange: true); + WorldGen.JungleRunner(i5, j4); + progress.Set(0.6f); + WorldGen.mudWall = false; + for (int index = 0; index < Main.maxTilesX / 4; ++index) + { + int i6 = WorldGen.genRand.Next(20, Main.maxTilesX - 20); + int j5; + for (j5 = WorldGen.genRand.Next((int) worldSurface + 10, Main.maxTilesY - 200); Main.tile[i6, j5].wall != (byte) 64 && Main.tile[i6, j5].wall != (byte) 15; j5 = WorldGen.genRand.Next((int) worldSurface + 10, Main.maxTilesY - 200)) + i6 = WorldGen.genRand.Next(20, Main.maxTilesX - 20); + WorldGen.MudWallRunner(i6, j5); + } + int i7 = num33; + int j6 = num34; + for (int index = 0; (double) index <= 20.0 * (double) num24; ++index) + { + progress.Set((float) ((60.0 + (double) index / (double) num24) * 0.00999999977648258)); + i7 += WorldGen.genRand.Next((int) (-5.0 * (double) num24), (int) (6.0 * (double) num24)); + j6 += WorldGen.genRand.Next((int) (-5.0 * (double) num24), (int) (6.0 * (double) num24)); + WorldGen.TileRunner(i7, j6, (double) WorldGen.genRand.Next(40, 100), WorldGen.genRand.Next(300, 500), 59); + } + for (int index32 = 0; (double) index32 <= 10.0 * (double) num24; ++index32) + { + progress.Set((float) ((80.0 + (double) index32 / (double) num24 * 2.0) * 0.00999999977648258)); + int i8 = num33 + WorldGen.genRand.Next((int) (-600.0 * (double) num24), (int) (600.0 * (double) num24)); + int j7; + for (j7 = num34 + WorldGen.genRand.Next((int) (-200.0 * (double) num24), (int) (200.0 * (double) num24)); i8 < 1 || i8 >= Main.maxTilesX - 1 || j7 < 1 || j7 >= Main.maxTilesY - 1 || Main.tile[i8, j7].type != (ushort) 59; j7 = num34 + WorldGen.genRand.Next((int) (-200.0 * (double) num24), (int) (200.0 * (double) num24))) + i8 = num33 + WorldGen.genRand.Next((int) (-600.0 * (double) num24), (int) (600.0 * (double) num24)); + for (int index33 = 0; (double) index33 < 8.0 * (double) num24; ++index33) + { + i8 += WorldGen.genRand.Next(-30, 31); + j7 += WorldGen.genRand.Next(-30, 31); + int type = -1; + if (WorldGen.genRand.Next(7) == 0) + type = -2; + WorldGen.TileRunner(i8, j7, (double) WorldGen.genRand.Next(10, 20), WorldGen.genRand.Next(30, 70), type); + } + } + for (int index = 0; (double) index <= 300.0 * (double) num24; ++index) + { + int i9 = num33 + WorldGen.genRand.Next((int) (-600.0 * (double) num24), (int) (600.0 * (double) num24)); + int j8; + for (j8 = num34 + WorldGen.genRand.Next((int) (-200.0 * (double) num24), (int) (200.0 * (double) num24)); i9 < 1 || i9 >= Main.maxTilesX - 1 || j8 < 1 || j8 >= Main.maxTilesY - 1 || Main.tile[i9, j8].type != (ushort) 59; j8 = num34 + WorldGen.genRand.Next((int) (-200.0 * (double) num24), (int) (200.0 * (double) num24))) + i9 = num33 + WorldGen.genRand.Next((int) (-600.0 * (double) num24), (int) (600.0 * (double) num24)); + WorldGen.TileRunner(i9, j8, (double) WorldGen.genRand.Next(4, 10), WorldGen.genRand.Next(5, 30), 1); + if (WorldGen.genRand.Next(4) == 0) + { + int type = WorldGen.genRand.Next(63, 69); + WorldGen.TileRunner(i9 + WorldGen.genRand.Next(-1, 2), j8 + WorldGen.genRand.Next(-1, 2), (double) WorldGen.genRand.Next(3, 7), WorldGen.genRand.Next(4, 8), type); + } + } + })); + WorldGen.AddGenerationPass("Marble", (WorldGenLegacyMethod) (progress => + { + progress.Message = Lang.gen[80].Value; + float num37 = (float) (Main.maxTilesX * Main.maxTilesY) / 5040000f; + int num38 = (int) ((double) WorldGen.genRand.Next(10, 15) * (double) num37); + float num39 = (float) (Main.maxTilesX - 160) / (float) num38; + int num40 = 0; + while (num40 < num38) + { + float num41 = (float) num40 / (float) num38; + progress.Set(num41); + if (Terraria.World.Generation.Biomes.Place(WorldGen.RandomRectanglePoint((int) ((double) num41 * (double) (Main.maxTilesX - 160)) + 80, (int) rockLayer + 20, (int) num39, Main.maxTilesY - ((int) rockLayer + 40) - 200), structures)) + ++num40; + } + })); + WorldGen.AddGenerationPass("Granite", (WorldGenLegacyMethod) (progress => + { + progress.Message = Lang.gen[81].Value; + float num42 = (float) Main.maxTilesX / 4200f; + int num43 = (int) ((double) WorldGen.genRand.Next(8, 14) * (double) num42); + float num44 = (float) (Main.maxTilesX - 200) / (float) num43; + int num45 = 0; + while (num45 < num43) + { + float num46 = (float) num45 / (float) num43; + progress.Set(num46); + if (Terraria.World.Generation.Biomes.Place(WorldGen.RandomRectanglePoint((int) ((double) num46 * (double) (Main.maxTilesX - 200)) + 100, (int) rockLayer + 20, (int) num44, Main.maxTilesY - ((int) rockLayer + 40) - 200), structures)) + ++num45; + } + })); + WorldGen.AddGenerationPass("Mud Caves To Grass", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[77].Value; - WorldGen.NotTheBees(); for (int i = 0; i < Main.maxTilesX; ++i) { for (int j = 0; j < Main.maxTilesY; ++j) @@ -5470,518 +4092,322 @@ namespace Terraria progress.Set((float) (0.200000002980232 * ((double) (i * Main.maxTilesY + j) / (double) (Main.maxTilesX * Main.maxTilesY)))); } } - WorldGen.SmallConsecutivesFound = 0; - WorldGen.SmallConsecutivesEliminated = 0; - float num45 = (float) (Main.maxTilesX - 20); for (int x = 10; x < Main.maxTilesX - 10; ++x) { - WorldGen.ScanTileColumnAndRemoveClumps(x); - float num46 = (float) (x - 10) / num45; - progress.Set((float) (0.200000002980232 + (double) num46 * 0.800000011920929)); - } - })); - WorldGen.AddGenerationPass("Full Desert", (WorldGenLegacyMethod) ((progress, passConfig) => - { - progress.Message = Lang.gen[78].Value; - Main.tileSolid[484] = false; - int num47 = 0; - int num48 = dungeonSide; - int maxValue = Main.maxTilesX / 2; - int num49 = WorldGen.genRand.Next(maxValue) / 8 + maxValue / 8; - int x = maxValue + num49 * -num48; - if (WorldGen.drunkWorldGen) - num48 *= -1; - int num50 = 0; - DesertBiome biome = configuration.CreateBiome(); - while (!biome.Place(new Point(x, (int) worldSurfaceHigh + 25), structures)) - { - int num51 = WorldGen.genRand.Next(maxValue) / 2 + maxValue / 8 + WorldGen.genRand.Next(num50 / 12); - x = maxValue + num51 * -num48; - if (++num50 > Main.maxTilesX / 4) + for (int y = 10; y < Main.maxTilesY - 10; ++y) { - num48 *= -1; - num50 = 0; - ++num47; - if (num47 >= 2) - WorldGen.skipDesertTileCheck = true; + if (Main.tile[x, y].active() && WorldGen.tileCounter(x, y) < WorldGen.tileCounterMax) + WorldGen.tileCounterKill(); + float num = (float) ((x - 10) * (Main.maxTilesY - 20) + (y - 10)) / (float) ((Main.maxTilesX - 20) * (Main.maxTilesY - 20)); + progress.Set((float) (0.200000002980232 + (double) num * 0.800000011920929)); } } })); - WorldGen.AddGenerationPass("Floating Islands", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Full Desert", (WorldGenLegacyMethod) (progress => + { + progress.Message = Lang.gen[78].Value; + int num47 = dungeonSide; + int maxValue = Main.maxTilesX / 2; + int num48 = WorldGen.genRand.Next(maxValue) / 8 + maxValue / 8; + int x = maxValue + num48 * -num47; + int num49 = 0; + while (!Terraria.World.Generation.Biomes.Place(new Point(x, (int) worldSurface), structures)) + { + int num50 = WorldGen.genRand.Next(maxValue) / 2 + maxValue / 8; + x = maxValue + num50 * -num47; + if (++num49 > 1000) + { + num47 *= -1; + num49 = 0; + } + } + })); + WorldGen.AddGenerationPass("Floating Islands", (WorldGenLegacyMethod) (progress => { WorldGen.numIslandHouses = 0; WorldGen.houseCount = 0; progress.Message = Lang.gen[12].Value; - int num52 = (int) ((double) Main.maxTilesX * 0.0008); - int num53 = 0; - float num54 = (float) (num52 + skyLakes); - for (int index32 = 0; (double) index32 < (double) num54; ++index32) + for (int index34 = 0; index34 < (int) ((double) Main.maxTilesX * 0.0008) + skyLakes; ++index34) { - progress.Set((float) index32 / num54); - int num55 = Main.maxTilesX; - while (--num55 > 0) + int num51 = 1000; + int i = WorldGen.genRand.Next((int) ((double) Main.maxTilesX * 0.1), (int) ((double) Main.maxTilesX * 0.9)); + while (--num51 > 0) { - bool flag7 = true; - int i = WorldGen.genRand.Next((int) ((double) Main.maxTilesX * 0.1), (int) ((double) Main.maxTilesX * 0.9)); - while (i > Main.maxTilesX / 2 - 150 && i < Main.maxTilesX / 2 + 150) + bool flag3 = true; + while (i > Main.maxTilesX / 2 - 80 && i < Main.maxTilesX / 2 + 80) i = WorldGen.genRand.Next((int) ((double) Main.maxTilesX * 0.1), (int) ((double) Main.maxTilesX * 0.9)); - for (int index33 = 0; index33 < WorldGen.numIslandHouses; ++index33) + for (int index35 = 0; index35 < WorldGen.numIslandHouses; ++index35) { - if (i > WorldGen.floatingIslandHouseX[index33] - 180 && i < WorldGen.floatingIslandHouseX[index33] + 180) + if (i > WorldGen.fihX[index35] - 180 && i < WorldGen.fihX[index35] + 180) { - flag7 = false; + flag3 = false; break; } } - if (flag7) + if (flag3) { - bool flag8 = false; - int num56 = 0; - for (int index34 = 200; (double) index34 < Main.worldSurface; ++index34) + bool flag4 = false; + int num52 = 0; + for (int index36 = 200; (double) index36 < Main.worldSurface; ++index36) { - if (Main.tile[i, index34].active()) + if (Main.tile[i, index36].active()) { - num56 = index34; - flag8 = true; + num52 = index36; + flag4 = true; break; } } - if (flag8) + if (flag4) { - int num57 = 0; - num55 = -1; - int j = Math.Min(WorldGen.genRand.Next(90, num56 - 100), (int) WorldGen.worldSurfaceLow - 50); - if (num53 >= num52) + int j = Math.Min(WorldGen.genRand.Next(90, num52 - 100), (int) WorldGen.worldSurfaceLow - 50); + if (index34 < skyLakes) { WorldGen.skyLake[WorldGen.numIslandHouses] = true; WorldGen.CloudLake(i, j); } else - { - WorldGen.skyLake[WorldGen.numIslandHouses] = false; - if (WorldGen.drunkWorldGen) - { - if (WorldGen.genRand.Next(2) == 0) - { - num57 = 3; - WorldGen.SnowCloudIsland(i, j); - } - else - { - num57 = 1; - WorldGen.DesertCloudIsland(i, j); - } - } - else - { - if (WorldGen.getGoodWorldGen) - num57 = !WorldGen.crimson ? 4 : 5; - WorldGen.CloudIsland(i, j); - } - } - WorldGen.floatingIslandHouseX[WorldGen.numIslandHouses] = i; - WorldGen.floatingIslandHouseY[WorldGen.numIslandHouses] = j; - WorldGen.floatingIslandStyle[WorldGen.numIslandHouses] = num57; + WorldGen.CloudIsland(i, j); + WorldGen.fihX[WorldGen.numIslandHouses] = i; + WorldGen.fihY[WorldGen.numIslandHouses] = j; ++WorldGen.numIslandHouses; - ++num53; } } } } })); - WorldGen.AddGenerationPass("Mushroom Patches", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Mushroom Patches", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[13].Value; - float num58 = (float) (Main.maxTilesX / 700); - if ((double) num58 > (double) WorldGen.maxMushroomBiomes) - num58 = (float) WorldGen.maxMushroomBiomes; - for (int index35 = 0; (double) index35 < (double) num58; ++index35) + for (int index = 0; index < Main.maxTilesX / 500; ++index) { - int num59 = 0; + int num53 = 0; bool flag = true; while (flag) { - int i = WorldGen.genRand.Next((int) ((double) Main.maxTilesX * 0.2), (int) ((double) Main.maxTilesX * 0.8)); - if (num59 > Main.maxTilesX / 4) - i = WorldGen.genRand.Next((int) ((double) Main.maxTilesX * 0.25), (int) ((double) Main.maxTilesX * 0.975)); - int j = WorldGen.genRand.Next((int) Main.rockLayer + 50, Main.maxTilesY - 300); + int i = WorldGen.genRand.Next((int) ((double) Main.maxTilesX * 0.3), (int) ((double) Main.maxTilesX * 0.7)); + int j = WorldGen.genRand.Next((int) Main.rockLayer, Main.maxTilesY - 350); flag = false; - int num60 = 100; - int num61 = 500; - for (int x = i - num60; x < i + num60; x += 3) + int num54 = 60; + for (int x = i - num54; x < i + num54; x += 3) { - for (int y = j - num60; y < j + num60; y += 3) + for (int y = j - num54; y < j + num54; y += 3) { - if (WorldGen.InWorld(x, y)) + if (Main.tile[x, y].type == (ushort) 147 || Main.tile[x, y].type == (ushort) 161 || Main.tile[x, y].type == (ushort) 162) { - if (Main.tile[x, y].type == (ushort) 147 || Main.tile[x, y].type == (ushort) 161 || Main.tile[x, y].type == (ushort) 162 || Main.tile[x, y].type == (ushort) 60 || Main.tile[x, y].type == (ushort) 368 || Main.tile[x, y].type == (ushort) 367) - { - flag = true; - break; - } - if (WorldGen.UndergroundDesertLocation.Contains(new Point(x, y))) - { - flag = true; - break; - } - } - else flag = true; + break; + } + if (WorldGen.UndergroundDesertLocation.Contains(new Point(x, y))) + { + flag = true; + break; + } } } if (!flag) - { - for (int index36 = 0; index36 < WorldGen.numMushroomBiomes; ++index36) - { - if ((double) Vector2.Distance(WorldGen.mushroomBiomesPosition[index36], new Vector2((float) i, (float) j)) < (double) num61) - flag = true; - } - } - if (!flag && WorldGen.numMushroomBiomes < WorldGen.maxMushroomBiomes) - { WorldGen.ShroomPatch(i, j); - for (int index37 = 0; index37 < 5; ++index37) - WorldGen.ShroomPatch(i + WorldGen.genRand.Next(-40, 41), j + WorldGen.genRand.Next(-40, 41)); - WorldGen.mushroomBiomesPosition[WorldGen.numMushroomBiomes].X = (float) i; - WorldGen.mushroomBiomesPosition[WorldGen.numMushroomBiomes].Y = (float) j; - ++WorldGen.numMushroomBiomes; - } - ++num59; - if (num59 > Main.maxTilesX / 2) + ++num53; + if (num53 > 100) break; } } - for (int index = 0; index < Main.maxTilesX; ++index) + for (int i10 = 0; i10 < Main.maxTilesX; ++i10) { - progress.Set((float) index / (float) Main.maxTilesX); for (int worldSurface1 = (int) Main.worldSurface; worldSurface1 < Main.maxTilesY; ++worldSurface1) { - if (WorldGen.InWorld(index, worldSurface1, 50) && Main.tile[index, worldSurface1].active()) + if (Main.tile[i10, worldSurface1].active()) { WorldGen.grassSpread = 0; - WorldGen.SpreadGrass(index, worldSurface1, 59, 70, false); - } - } - } - for (int index38 = 0; index38 < Main.maxTilesX; ++index38) - { - for (int worldSurface2 = (int) Main.worldSurface; worldSurface2 < Main.maxTilesY; ++worldSurface2) - { - if (Main.tile[index38, worldSurface2].active() && Main.tile[index38, worldSurface2].type == (ushort) 70) - { - int Type = 59; - for (int i = index38 - 1; i <= index38 + 1; ++i) + WorldGen.SpreadGrass(i10, worldSurface1, 59, 70, false); + if (Main.tile[i10, worldSurface1].type == (ushort) 70 && WorldGen.genRand.Next(20) == 0) { - for (int j = worldSurface2 - 1; j <= worldSurface2 + 1; ++j) + int num55 = WorldGen.genRand.Next(5) != 0 ? 1 : 2; + int num56 = WorldGen.genRand.Next(2, 6); + int j9 = worldSurface1 - num56; + bool flag = true; + for (int index = i10 - num55; index <= i10 + num55; ++index) { - if (Main.tile[i, j].active()) - { - if (!Main.tile[i - 1, j].active() && !Main.tile[i + 1, j].active()) - WorldGen.KillTile(i, j); - else if (!Main.tile[i, j - 1].active() && !Main.tile[i, j + 1].active()) - WorldGen.KillTile(i, j); - } - else if (Main.tile[i - 1, j].active() && Main.tile[i + 1, j].active()) - { - WorldGen.PlaceTile(i, j, Type); - if (Main.tile[i - 1, worldSurface2].type == (ushort) 70) - Main.tile[i - 1, worldSurface2].type = (ushort) 59; - if (Main.tile[i + 1, worldSurface2].type == (ushort) 70) - Main.tile[i + 1, worldSurface2].type = (ushort) 59; - } - else if (Main.tile[i, j - 1].active() && Main.tile[i, j + 1].active()) - { - WorldGen.PlaceTile(i, j, Type); - if (Main.tile[i, worldSurface2 - 1].type == (ushort) 70) - Main.tile[i, worldSurface2 - 1].type = (ushort) 59; - if (Main.tile[i, worldSurface2 + 1].type == (ushort) 70) - Main.tile[i, worldSurface2 + 1].type = (ushort) 59; - } + if (Main.tile[index, j9].active()) + flag = false; + if (Main.tileBrick[(int) Main.tile[index, j9 - 1].type]) + flag = false; + if (Main.tileBrick[(int) Main.tile[index, j9 + 1].type]) + flag = false; + } + if (Main.tile[i10 - num55 - 1, j9].type == (ushort) 190) + flag = false; + if (Main.tile[i10 + num55 + 1, j9].type == (ushort) 190) + flag = false; + for (int index = j9; index < worldSurface1; ++index) + { + if (Main.tile[i10, index].active()) + flag = false; + if (Main.tileBrick[(int) Main.tile[i10 - 1, index].type]) + flag = false; + if (Main.tileBrick[(int) Main.tile[i10 + 1, index].type]) + flag = false; + } + if (flag) + { + for (int i11 = i10 - num55; i11 <= i10 + num55; ++i11) + WorldGen.PlaceTile(i11, j9, 190, true, true); + for (int j10 = j9; j10 < worldSurface1; ++j10) + WorldGen.PlaceTile(i10, j10, 190, true, true); } } - if (WorldGen.genRand.Next(4) == 0) - { - int index39 = index38 + WorldGen.genRand.Next(-20, 21); - int index40 = worldSurface2 + WorldGen.genRand.Next(-20, 21); - if (Main.tile[index39, index40].type == (ushort) 59) - Main.tile[index39, index40].type = (ushort) 70; - } } } } })); - WorldGen.AddGenerationPass("Marble", (WorldGenLegacyMethod) ((progress, passConfig) => - { - progress.Message = Lang.gen[80].Value; - int random = passConfig.Get("Count").GetRandom(WorldGen.genRand); - float num62 = (float) (Main.maxTilesX - 160) / (float) random; - MarbleBiome biome = configuration.CreateBiome(); - int num63 = 0; - int num64 = 0; - while (num64 < random) - { - float num65 = (float) num64 / (float) random; - progress.Set(num65); - Point origin = WorldGen.RandomRectanglePoint((int) ((double) num65 * (double) (Main.maxTilesX - 160)) + 80, (int) rockLayer + 20, (int) num62, Main.maxTilesY - ((int) rockLayer + 40) - 200); - while ((double) origin.X > (double) Main.maxTilesX * 0.45 && (double) origin.X < (double) Main.maxTilesX * 0.55) - origin.X = WorldGen.genRand.Next(WorldGen.beachDistance, Main.maxTilesX - WorldGen.beachDistance); - ++num63; - if (biome.Place(origin, structures) || num63 > Main.maxTilesX) - { - ++num64; - num63 = 0; - } - } - })); - WorldGen.AddGenerationPass("Granite", (WorldGenLegacyMethod) ((progress, passConfig) => - { - progress.Message = Lang.gen[81].Value; - int random = passConfig.Get("Count").GetRandom(WorldGen.genRand); - float num66 = (float) (Main.maxTilesX - 200) / (float) random; - List pointList = new List(random); - int num67 = 0; - int num68 = 0; - while (num68 < random) - { - float num69 = (float) num68 / (float) random; - progress.Set(num69); - Point origin = WorldGen.RandomRectanglePoint((int) ((double) num69 * (double) (Main.maxTilesX - 200)) + 100, (int) rockLayer + 20, (int) num66, Main.maxTilesY - ((int) rockLayer + 40) - 200); - while ((double) origin.X > (double) Main.maxTilesX * 0.45 && (double) origin.X < (double) Main.maxTilesX * 0.55) - origin.X = WorldGen.genRand.Next(WorldGen.beachDistance, Main.maxTilesX - WorldGen.beachDistance); - ++num67; - if (GraniteBiome.CanPlace(origin, structures)) - { - pointList.Add(origin); - ++num68; - } - else if (num67 > Main.maxTilesX) - { - ++num68; - num67 = 0; - } - } - GraniteBiome biome = configuration.CreateBiome(); - for (int index = 0; index < random; ++index) - biome.Place(pointList[index], structures); - })); - WorldGen.AddGenerationPass("Dirt To Mud", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Mud To Dirt", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[14].Value; - float num70 = (float) (Main.maxTilesX * Main.maxTilesY) * (1f / 1000f); - for (int index = 0; (double) index < (double) num70; ++index) - { - progress.Set((float) index / num70); - WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int) rockLayerLow, Main.maxTilesY), (double) WorldGen.genRand.Next(2, 6), WorldGen.genRand.Next(2, 40), 59, ignoreTileType: 53); - } + for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 0.001); ++index) + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int) rockLayerLow, Main.maxTilesY), (double) WorldGen.genRand.Next(2, 6), WorldGen.genRand.Next(2, 40), 59); })); - WorldGen.AddGenerationPass("Silt", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Silt", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[15].Value; for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 0.0001); ++index) - { - int i = WorldGen.genRand.Next(0, Main.maxTilesX); - int j = WorldGen.genRand.Next((int) rockLayerHigh, Main.maxTilesY); - if (Main.tile[i, j].wall != (ushort) 187 && Main.tile[i, j].wall != (ushort) 216) - WorldGen.TileRunner(i, j, (double) WorldGen.genRand.Next(5, 12), WorldGen.genRand.Next(15, 50), 123); - } + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int) rockLayerHigh, Main.maxTilesY), (double) WorldGen.genRand.Next(5, 12), WorldGen.genRand.Next(15, 50), 123); for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 0.0005); ++index) - { - int i = WorldGen.genRand.Next(0, Main.maxTilesX); - int j = WorldGen.genRand.Next((int) rockLayerHigh, Main.maxTilesY); - if (Main.tile[i, j].wall != (ushort) 187 && Main.tile[i, j].wall != (ushort) 216) - WorldGen.TileRunner(i, j, (double) WorldGen.genRand.Next(2, 5), WorldGen.genRand.Next(2, 5), 123); - } + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int) rockLayerHigh, Main.maxTilesY), (double) WorldGen.genRand.Next(2, 5), WorldGen.genRand.Next(2, 5), 123); })); - WorldGen.AddGenerationPass("Shinies", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Shinies", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[16].Value; for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 6E-05); ++index) - { - if (WorldGen.drunkWorldGen) - copper = WorldGen.genRand.Next(2) != 0 ? 166 : 7; WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int) WorldGen.worldSurfaceLow, (int) worldSurfaceHigh), (double) WorldGen.genRand.Next(3, 6), WorldGen.genRand.Next(2, 6), copper); - } for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 8E-05); ++index) - { - if (WorldGen.drunkWorldGen) - copper = WorldGen.genRand.Next(2) != 0 ? 166 : 7; WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int) worldSurfaceHigh, (int) rockLayerHigh), (double) WorldGen.genRand.Next(3, 7), WorldGen.genRand.Next(3, 7), copper); - } for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 0.0002); ++index) - { - if (WorldGen.drunkWorldGen) - copper = WorldGen.genRand.Next(2) != 0 ? 166 : 7; WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int) rockLayerLow, Main.maxTilesY), (double) WorldGen.genRand.Next(4, 9), WorldGen.genRand.Next(4, 8), copper); - } for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 3E-05); ++index) - { - if (WorldGen.drunkWorldGen) - iron = WorldGen.genRand.Next(2) != 0 ? 167 : 6; WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int) WorldGen.worldSurfaceLow, (int) worldSurfaceHigh), (double) WorldGen.genRand.Next(3, 7), WorldGen.genRand.Next(2, 5), iron); - } for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 8E-05); ++index) - { - if (WorldGen.drunkWorldGen) - iron = WorldGen.genRand.Next(2) != 0 ? 167 : 6; WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int) worldSurfaceHigh, (int) rockLayerHigh), (double) WorldGen.genRand.Next(3, 6), WorldGen.genRand.Next(3, 6), iron); - } for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 0.0002); ++index) - { - if (WorldGen.drunkWorldGen) - iron = WorldGen.genRand.Next(2) != 0 ? 167 : 6; WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int) rockLayerLow, Main.maxTilesY), (double) WorldGen.genRand.Next(4, 9), WorldGen.genRand.Next(4, 8), iron); - } for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 2.6E-05); ++index) - { - if (WorldGen.drunkWorldGen) - silver = WorldGen.genRand.Next(2) != 0 ? 168 : 9; WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int) worldSurfaceHigh, (int) rockLayerHigh), (double) WorldGen.genRand.Next(3, 6), WorldGen.genRand.Next(3, 6), silver); - } for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 0.00015); ++index) - { - if (WorldGen.drunkWorldGen) - silver = WorldGen.genRand.Next(2) != 0 ? 168 : 9; WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int) rockLayerLow, Main.maxTilesY), (double) WorldGen.genRand.Next(4, 9), WorldGen.genRand.Next(4, 8), silver); - } for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 0.00017); ++index) - { - if (WorldGen.drunkWorldGen) - silver = WorldGen.genRand.Next(2) != 0 ? 168 : 9; WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next(0, (int) WorldGen.worldSurfaceLow), (double) WorldGen.genRand.Next(4, 9), WorldGen.genRand.Next(4, 8), silver); - } for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 0.00012); ++index) - { - if (WorldGen.drunkWorldGen) - gold = WorldGen.genRand.Next(2) != 0 ? 169 : 8; WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int) rockLayerLow, Main.maxTilesY), (double) WorldGen.genRand.Next(4, 8), WorldGen.genRand.Next(4, 8), gold); - } for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 0.00012); ++index) - { - if (WorldGen.drunkWorldGen) - gold = WorldGen.genRand.Next(2) != 0 ? 169 : 8; WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next(0, (int) WorldGen.worldSurfaceLow - 20), (double) WorldGen.genRand.Next(4, 8), WorldGen.genRand.Next(4, 8), gold); - } - if (WorldGen.drunkWorldGen) - { - for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 2.25E-05 / 2.0); ++index) - WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int) Main.rockLayer, Main.maxTilesY), (double) WorldGen.genRand.Next(3, 6), WorldGen.genRand.Next(4, 8), 204); - for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 2.25E-05 / 2.0); ++index) - WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int) Main.rockLayer, Main.maxTilesY), (double) WorldGen.genRand.Next(3, 6), WorldGen.genRand.Next(4, 8), 22); - } if (WorldGen.crimson) { - for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 2.25E-05); ++index) - WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int) Main.rockLayer, Main.maxTilesY), (double) WorldGen.genRand.Next(3, 6), WorldGen.genRand.Next(4, 8), 204); + for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 2E-05); ++index) + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int) rockLayerLow, Main.maxTilesY), (double) WorldGen.genRand.Next(2, 4), WorldGen.genRand.Next(3, 6), 204); } else { - for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 2.25E-05); ++index) - WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int) Main.rockLayer, Main.maxTilesY), (double) WorldGen.genRand.Next(3, 6), WorldGen.genRand.Next(4, 8), 22); + for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 2E-05); ++index) + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int) rockLayerLow, Main.maxTilesY), (double) WorldGen.genRand.Next(2, 4), WorldGen.genRand.Next(3, 6), 22); } })); - WorldGen.AddGenerationPass("Webs", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Webs", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[17].Value; - for (int index41 = 0; index41 < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 0.0006); ++index41) + for (int index37 = 0; index37 < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 0.0006); ++index37) { - int index42 = WorldGen.genRand.Next(20, Main.maxTilesX - 20); - int index43 = WorldGen.genRand.Next((int) worldSurfaceHigh, Main.maxTilesY - 20); - if (index41 < WorldGen.numMCaves) + int index38 = WorldGen.genRand.Next(20, Main.maxTilesX - 20); + int index39 = WorldGen.genRand.Next((int) worldSurfaceHigh, Main.maxTilesY - 20); + if (index37 < WorldGen.numMCaves) { - index42 = WorldGen.mCaveX[index41]; - index43 = WorldGen.mCaveY[index41]; + index38 = WorldGen.mCaveX[index37]; + index39 = WorldGen.mCaveY[index37]; } - if (!Main.tile[index42, index43].active() && ((double) index43 > Main.worldSurface || Main.tile[index42, index43].wall > (ushort) 0)) + if (!Main.tile[index38, index39].active() && ((double) index39 > Main.worldSurface || Main.tile[index38, index39].wall > (byte) 0)) { - while (!Main.tile[index42, index43].active() && index43 > (int) WorldGen.worldSurfaceLow) - --index43; - int j = index43 + 1; - int num71 = 1; + while (!Main.tile[index38, index39].active() && index39 > (int) WorldGen.worldSurfaceLow) + --index39; + int j = index39 + 1; + int num = 1; if (WorldGen.genRand.Next(2) == 0) - num71 = -1; - while (!Main.tile[index42, j].active() && index42 > 10 && index42 < Main.maxTilesX - 10) - index42 += num71; - int i = index42 - num71; - if ((double) j > Main.worldSurface || Main.tile[i, j].wall > (ushort) 0) - WorldGen.TileRunner(i, j, (double) WorldGen.genRand.Next(4, 11), WorldGen.genRand.Next(2, 4), 51, true, (float) num71, -1f, overRide: false); + num = -1; + while (!Main.tile[index38, j].active() && index38 > 10 && index38 < Main.maxTilesX - 10) + index38 += num; + int i = index38 - num; + if ((double) j > Main.worldSurface || Main.tile[i, j].wall > (byte) 0) + WorldGen.TileRunner(i, j, (double) WorldGen.genRand.Next(4, 11), WorldGen.genRand.Next(2, 4), 51, true, (float) num, -1f, overRide: false); } } })); - WorldGen.AddGenerationPass("Underworld", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Underworld", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[18].Value; progress.Set(0.0f); - int num72 = Main.maxTilesY - WorldGen.genRand.Next(150, 190); - for (int index44 = 0; index44 < Main.maxTilesX; ++index44) + int num57 = Main.maxTilesY - WorldGen.genRand.Next(150, 190); + for (int index40 = 0; index40 < Main.maxTilesX; ++index40) { - num72 += WorldGen.genRand.Next(-3, 4); - if (num72 < Main.maxTilesY - 190) - num72 = Main.maxTilesY - 190; - if (num72 > Main.maxTilesY - 160) - num72 = Main.maxTilesY - 160; - for (int index45 = num72 - 20 - WorldGen.genRand.Next(3); index45 < Main.maxTilesY; ++index45) + num57 += WorldGen.genRand.Next(-3, 4); + if (num57 < Main.maxTilesY - 190) + num57 = Main.maxTilesY - 190; + if (num57 > Main.maxTilesY - 160) + num57 = Main.maxTilesY - 160; + for (int index41 = num57 - 20 - WorldGen.genRand.Next(3); index41 < Main.maxTilesY; ++index41) { - if (index45 >= num72) + if (index41 >= num57) { - Main.tile[index44, index45].active(false); - Main.tile[index44, index45].lava(false); - Main.tile[index44, index45].liquid = (byte) 0; + Main.tile[index40, index41].active(false); + Main.tile[index40, index41].lava(false); + Main.tile[index40, index41].liquid = (byte) 0; } else - Main.tile[index44, index45].type = (ushort) 57; + Main.tile[index40, index41].type = (ushort) 57; } } - int num73 = Main.maxTilesY - WorldGen.genRand.Next(40, 70); - for (int index46 = 10; index46 < Main.maxTilesX - 10; ++index46) + int num58 = Main.maxTilesY - WorldGen.genRand.Next(40, 70); + for (int index42 = 10; index42 < Main.maxTilesX - 10; ++index42) { - num73 += WorldGen.genRand.Next(-10, 11); - if (num73 > Main.maxTilesY - 60) - num73 = Main.maxTilesY - 60; - if (num73 < Main.maxTilesY - 100) - num73 = Main.maxTilesY - 120; - for (int index47 = num73; index47 < Main.maxTilesY - 10; ++index47) + num58 += WorldGen.genRand.Next(-10, 11); + if (num58 > Main.maxTilesY - 60) + num58 = Main.maxTilesY - 60; + if (num58 < Main.maxTilesY - 100) + num58 = Main.maxTilesY - 120; + for (int index43 = num58; index43 < Main.maxTilesY - 10; ++index43) { - if (!Main.tile[index46, index47].active()) + if (!Main.tile[index42, index43].active()) { - Main.tile[index46, index47].lava(true); - Main.tile[index46, index47].liquid = byte.MaxValue; + Main.tile[index42, index43].lava(true); + Main.tile[index42, index43].liquid = byte.MaxValue; } } } - for (int index48 = 0; index48 < Main.maxTilesX; ++index48) + for (int index44 = 0; index44 < Main.maxTilesX; ++index44) { if (WorldGen.genRand.Next(50) == 0) { - int index49 = Main.maxTilesY - 65; - while (!Main.tile[index48, index49].active() && index49 > Main.maxTilesY - 135) - --index49; - WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), index49 + WorldGen.genRand.Next(20, 50), (double) WorldGen.genRand.Next(15, 20), 1000, 57, true, speedY: ((float) WorldGen.genRand.Next(1, 3)), noYChange: true); + int index45 = Main.maxTilesY - 65; + while (!Main.tile[index44, index45].active() && index45 > Main.maxTilesY - 135) + --index45; + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), index45 + WorldGen.genRand.Next(20, 50), (double) WorldGen.genRand.Next(15, 20), 1000, 57, true, speedY: ((float) WorldGen.genRand.Next(1, 3)), noYChange: true); } } Liquid.QuickWater(-2); for (int i = 0; i < Main.maxTilesX; ++i) { - float num74 = (float) i / (float) (Main.maxTilesX - 1); - progress.Set((float) ((double) num74 / 2.0 + 0.5)); + float num59 = (float) i / (float) (Main.maxTilesX - 1); + progress.Set((float) ((double) num59 / 2.0 + 0.5)); if (WorldGen.genRand.Next(13) == 0) { int index = Main.maxTilesY - 65; while ((Main.tile[i, index].liquid > (byte) 0 || Main.tile[i, index].active()) && index > Main.maxTilesY - 140) --index; - if (!WorldGen.drunkWorldGen || WorldGen.genRand.Next(3) == 0 || (double) i <= (double) Main.maxTilesX * 0.4 || (double) i >= (double) Main.maxTilesX * 0.6) - WorldGen.TileRunner(i, index - WorldGen.genRand.Next(2, 5), (double) WorldGen.genRand.Next(5, 30), 1000, 57, true, speedY: ((float) WorldGen.genRand.Next(1, 3)), noYChange: true); - float num75 = (float) WorldGen.genRand.Next(1, 3); + WorldGen.TileRunner(i, index - WorldGen.genRand.Next(2, 5), (double) WorldGen.genRand.Next(5, 30), 1000, 57, true, speedY: ((float) WorldGen.genRand.Next(1, 3)), noYChange: true); + float num60 = (float) WorldGen.genRand.Next(1, 3); if (WorldGen.genRand.Next(3) == 0) - num75 *= 0.5f; - if (!WorldGen.drunkWorldGen || WorldGen.genRand.Next(3) == 0 || (double) i <= (double) Main.maxTilesX * 0.4 || (double) i >= (double) Main.maxTilesX * 0.6) + num60 *= 0.5f; + if (WorldGen.genRand.Next(2) == 0) + WorldGen.TileRunner(i, index - WorldGen.genRand.Next(2, 5), (double) (int) ((double) WorldGen.genRand.Next(5, 15) * (double) num60), (int) ((double) WorldGen.genRand.Next(10, 15) * (double) num60), 57, true, 1f, 0.3f); + if (WorldGen.genRand.Next(2) == 0) { - if (WorldGen.genRand.Next(2) == 0) - WorldGen.TileRunner(i, index - WorldGen.genRand.Next(2, 5), (double) (int) ((double) WorldGen.genRand.Next(5, 15) * (double) num75), (int) ((double) WorldGen.genRand.Next(10, 15) * (double) num75), 57, true, 1f, 0.3f); - if (WorldGen.genRand.Next(2) == 0) - { - float num76 = (float) WorldGen.genRand.Next(1, 3); - WorldGen.TileRunner(i, index - WorldGen.genRand.Next(2, 5), (double) (int) ((double) WorldGen.genRand.Next(5, 15) * (double) num76), (int) ((double) WorldGen.genRand.Next(10, 15) * (double) num76), 57, true, -1f, 0.3f); - } + float num61 = (float) WorldGen.genRand.Next(1, 3); + WorldGen.TileRunner(i, index - WorldGen.genRand.Next(2, 5), (double) (int) ((double) WorldGen.genRand.Next(5, 15) * (double) num61), (int) ((double) WorldGen.genRand.Next(10, 15) * (double) num61), 57, true, -1f, 0.3f); } WorldGen.TileRunner(i + WorldGen.genRand.Next(-10, 10), index + WorldGen.genRand.Next(-10, 10), (double) WorldGen.genRand.Next(5, 15), WorldGen.genRand.Next(5, 10), -2, speedX: ((float) WorldGen.genRand.Next(-1, 3)), speedY: ((float) WorldGen.genRand.Next(-1, 3))); if (WorldGen.genRand.Next(3) == 0) @@ -5992,11 +4418,6 @@ namespace Terraria } for (int index = 0; index < Main.maxTilesX; ++index) WorldGen.TileRunner(WorldGen.genRand.Next(20, Main.maxTilesX - 20), WorldGen.genRand.Next(Main.maxTilesY - 180, Main.maxTilesY - 10), (double) WorldGen.genRand.Next(2, 7), WorldGen.genRand.Next(2, 7), -2); - if (WorldGen.drunkWorldGen) - { - for (int index = 0; index < Main.maxTilesX * 2; ++index) - WorldGen.TileRunner(WorldGen.genRand.Next((int) ((double) Main.maxTilesX * 0.35), (int) ((double) Main.maxTilesX * 0.65)), WorldGen.genRand.Next(Main.maxTilesY - 180, Main.maxTilesY - 10), (double) WorldGen.genRand.Next(5, 20), WorldGen.genRand.Next(5, 10), -2); - } for (int index = 0; index < Main.maxTilesX; ++index) { if (!Main.tile[index, Main.maxTilesY - 145].active()) @@ -6014,166 +4435,146 @@ namespace Terraria WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next(Main.maxTilesY - 140, Main.maxTilesY), (double) WorldGen.genRand.Next(2, 7), WorldGen.genRand.Next(3, 7), 58); WorldGen.AddHellHouses(); })); - WorldGen.AddGenerationPass("Corruption", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Lakes", (WorldGenLegacyMethod) (progress => { - int num77 = Main.maxTilesX; - int num78 = 0; - int num79 = Main.maxTilesX; - int num80 = 0; - for (int index50 = 0; index50 < Main.maxTilesX; ++index50) + progress.Message = Lang.gen[19].Value; + int num62 = WorldGen.genRand.Next(2, (int) ((double) Main.maxTilesX * 0.005)); + for (int index = 0; index < num62; ++index) { - for (int index51 = 0; (double) index51 < Main.worldSurface; ++index51) - { - if (Main.tile[index50, index51].active()) - { - if (Main.tile[index50, index51].type == (ushort) 60) - { - if (index50 < num77) - num77 = index50; - if (index50 > num78) - num78 = index50; - } - else if (Main.tile[index50, index51].type == (ushort) 147 || Main.tile[index50, index51].type == (ushort) 161) - { - if (index50 < num79) - num79 = index50; - if (index50 > num80) - num80 = index50; - } - } - } + float num63 = (float) index / (float) num62; + progress.Set(num63); + int i = WorldGen.genRand.Next(300, Main.maxTilesX - 300); + while (i > Main.maxTilesX / 2 - 100 && i < Main.maxTilesX / 2 + 100) + i = WorldGen.genRand.Next(300, Main.maxTilesX - 300); + int j = (int) WorldGen.worldSurfaceLow - 20; + while (!Main.tile[i, j].active()) + ++j; + WorldGen.Lakinater(i, j); } - int num81 = 10; - int num82 = num77 - num81; - int num83 = num78 + num81; - int num84 = num79 - num81; - int num85 = num80 + num81; - int minValue = 500; - int num86 = 100; - bool flag9 = WorldGen.crimson; - bool flag10 = true; - double num87 = (double) Main.maxTilesX * 0.00045; - if (WorldGen.drunkWorldGen) + })); + WorldGen.AddGenerationPass("Dungeon", (WorldGenLegacyMethod) (progress => + { + int x; + if (dungeonSide == -1) { - flag9 = true; - num87 /= 2.0; - if (WorldGen.genRand.Next(2) == 0) - flag10 = false; + x = WorldGen.genRand.Next((int) ((double) Main.maxTilesX * 0.05), (int) ((double) Main.maxTilesX * 0.2)); + dungeonSide = -1; } - if (flag9) + else + { + x = WorldGen.genRand.Next((int) ((double) Main.maxTilesX * 0.8), (int) ((double) Main.maxTilesX * 0.95)); + dungeonSide = 1; + } + int y = (int) ((Main.worldSurface + Main.rockLayer) / 2.0) + WorldGen.genRand.Next(-200, 200); + WorldGen.MakeDungeon(x, y); + })); + WorldGen.AddGenerationPass("Corruption", (WorldGenLegacyMethod) (progress => + { + if (WorldGen.crimson) { progress.Message = Lang.gen[72].Value; - for (int index52 = 0; (double) index52 < num87; ++index52) + for (int index46 = 0; (double) index46 < (double) Main.maxTilesX * 0.00045; ++index46) { - int num88 = num84; - int num89 = num85; - int num90 = num82; - int num91 = num83; - float num92 = (float) index52 / (float) num87; - progress.Set(num92); - bool flag11 = false; + float num64 = (float) index46 / ((float) Main.maxTilesX * 0.00045f); + progress.Set(num64); + bool flag5 = false; int i = 0; - int num93 = 0; - int num94 = 0; - while (!flag11) + int num65 = 0; + int num66 = 0; + while (!flag5) { - flag11 = true; - int num95 = Main.maxTilesX / 2; - int num96 = 200; - if (WorldGen.drunkWorldGen) - { - num96 = 100; - i = !flag10 ? WorldGen.genRand.Next((int) ((double) Main.maxTilesX * 0.5), Main.maxTilesX - minValue) : WorldGen.genRand.Next(minValue, (int) ((double) Main.maxTilesX * 0.5)); - } - else - i = WorldGen.genRand.Next(minValue, Main.maxTilesX - minValue); - num93 = i - WorldGen.genRand.Next(200) - 100; - num94 = i + WorldGen.genRand.Next(200) + 100; - if (num93 < evilBiomeBeachAvoidance) - num93 = evilBiomeBeachAvoidance; - if (num94 > Main.maxTilesX - evilBiomeBeachAvoidance) - num94 = Main.maxTilesX - evilBiomeBeachAvoidance; - if (i < num93 + evilBiomeAvoidanceMidFixer) - i = num93 + evilBiomeAvoidanceMidFixer; - if (i > num94 - evilBiomeAvoidanceMidFixer) - i = num94 - evilBiomeAvoidanceMidFixer; - if (dungeonSide < 0 && num93 < 400) - num93 = 400; - else if (dungeonSide > 0 && num93 > Main.maxTilesX - 400) - num93 = Main.maxTilesX - 400; - if (i > num95 - num96 && i < num95 + num96) - flag11 = false; - if (num93 > num95 - num96 && num93 < num95 + num96) - flag11 = false; - if (num94 > num95 - num96 && num94 < num95 + num96) - flag11 = false; + int num67 = 0; + flag5 = true; + int num68 = Main.maxTilesX / 2; + int num69 = 200; + i = dungeonSide >= 0 ? WorldGen.genRand.Next(320, Main.maxTilesX - 600) : WorldGen.genRand.Next(600, Main.maxTilesX - 320); + num65 = i - WorldGen.genRand.Next(200) - 100; + num66 = i + WorldGen.genRand.Next(200) + 100; + if (num65 < 285) + num65 = 285; + if (num66 > Main.maxTilesX - 285) + num66 = Main.maxTilesX - 285; + if (dungeonSide < 0 && num65 < 400) + num65 = 400; + else if (dungeonSide > 0 && num65 > Main.maxTilesX - 400) + num65 = Main.maxTilesX - 400; + if (i > num68 - num69 && i < num68 + num69) + flag5 = false; + if (num65 > num68 - num69 && num65 < num68 + num69) + flag5 = false; + if (num66 > num68 - num69 && num66 < num68 + num69) + flag5 = false; if (i > WorldGen.UndergroundDesertLocation.X && i < WorldGen.UndergroundDesertLocation.X + WorldGen.UndergroundDesertLocation.Width) - flag11 = false; - if (num93 > WorldGen.UndergroundDesertLocation.X && num93 < WorldGen.UndergroundDesertLocation.X + WorldGen.UndergroundDesertLocation.Width) - flag11 = false; - if (num94 > WorldGen.UndergroundDesertLocation.X && num94 < WorldGen.UndergroundDesertLocation.X + WorldGen.UndergroundDesertLocation.Width) - flag11 = false; - if (num93 < dungeonLocation + num86 && num94 > dungeonLocation - num86) - flag11 = false; - if (num93 < num89 && num94 > num88) + flag5 = false; + if (num65 > WorldGen.UndergroundDesertLocation.X && num65 < WorldGen.UndergroundDesertLocation.X + WorldGen.UndergroundDesertLocation.Width) + flag5 = false; + if (num66 > WorldGen.UndergroundDesertLocation.X && num66 < WorldGen.UndergroundDesertLocation.X + WorldGen.UndergroundDesertLocation.Width) + flag5 = false; + for (int index47 = num65; index47 < num66; ++index47) { - ++num88; - --num89; - flag11 = false; + for (int index48 = 0; index48 < (int) Main.worldSurface; index48 += 5) + { + if (Main.tile[index47, index48].active() && Main.tileDungeon[(int) Main.tile[index47, index48].type]) + { + flag5 = false; + break; + } + if (!flag5) + break; + } } - if (num93 < num91 && num94 > num90) + if (num67 < 200 && WorldGen.JungleX > num65 && WorldGen.JungleX < num66) { - ++num90; - --num91; - flag11 = false; + int num70 = num67 + 1; + flag5 = false; } } WorldGen.CrimStart(i, (int) WorldGen.worldSurfaceLow - 10); - for (int index53 = num93; index53 < num94; ++index53) + for (int index49 = num65; index49 < num66; ++index49) { for (int worldSurfaceLow = (int) WorldGen.worldSurfaceLow; (double) worldSurfaceLow < Main.worldSurface - 1.0; ++worldSurfaceLow) { - if (Main.tile[index53, worldSurfaceLow].active()) + if (Main.tile[index49, worldSurfaceLow].active()) { - int num97 = worldSurfaceLow + WorldGen.genRand.Next(10, 14); - for (int index54 = worldSurfaceLow; index54 < num97; ++index54) + int num71 = worldSurfaceLow + WorldGen.genRand.Next(10, 14); + for (int index50 = worldSurfaceLow; index50 < num71; ++index50) { - if ((Main.tile[index53, index54].type == (ushort) 59 || Main.tile[index53, index54].type == (ushort) 60) && index53 >= num93 + WorldGen.genRand.Next(5) && index53 < num94 - WorldGen.genRand.Next(5)) - Main.tile[index53, index54].type = (ushort) 0; + if ((Main.tile[index49, index50].type == (ushort) 59 || Main.tile[index49, index50].type == (ushort) 60) && index49 >= num65 + WorldGen.genRand.Next(5) && index49 < num66 - WorldGen.genRand.Next(5)) + Main.tile[index49, index50].type = (ushort) 0; } break; } } } - double num98 = Main.worldSurface + 40.0; - for (int index55 = num93; index55 < num94; ++index55) + double num72 = Main.worldSurface + 40.0; + for (int index51 = num65; index51 < num66; ++index51) { - num98 += (double) WorldGen.genRand.Next(-2, 3); - if (num98 < Main.worldSurface + 30.0) - num98 = Main.worldSurface + 30.0; - if (num98 > Main.worldSurface + 50.0) - num98 = Main.worldSurface + 50.0; - i2 = index55; - bool flag12 = false; - for (int worldSurfaceLow = (int) WorldGen.worldSurfaceLow; (double) worldSurfaceLow < num98; ++worldSurfaceLow) + num72 += (double) WorldGen.genRand.Next(-2, 3); + if (num72 < Main.worldSurface + 30.0) + num72 = Main.worldSurface + 30.0; + if (num72 > Main.worldSurface + 50.0) + num72 = Main.worldSurface + 50.0; + i2 = index51; + bool flag6 = false; + for (int worldSurfaceLow = (int) WorldGen.worldSurfaceLow; (double) worldSurfaceLow < num72; ++worldSurfaceLow) { if (Main.tile[i2, worldSurfaceLow].active()) { - if (Main.tile[i2, worldSurfaceLow].type == (ushort) 53 && i2 >= num93 + WorldGen.genRand.Next(5) && i2 <= num94 - WorldGen.genRand.Next(5)) + if (Main.tile[i2, worldSurfaceLow].type == (ushort) 53 && i2 >= num65 + WorldGen.genRand.Next(5) && i2 <= num66 - WorldGen.genRand.Next(5)) Main.tile[i2, worldSurfaceLow].type = (ushort) 234; - if (Main.tile[i2, worldSurfaceLow].type == (ushort) 0 && (double) worldSurfaceLow < Main.worldSurface - 1.0 && !flag12) + if (Main.tile[i2, worldSurfaceLow].type == (ushort) 0 && (double) worldSurfaceLow < Main.worldSurface - 1.0 && !flag6) { WorldGen.grassSpread = 0; WorldGen.SpreadGrass(i2, worldSurfaceLow, grass: 199); } - flag12 = true; - if (Main.tile[i2, worldSurfaceLow].wall == (ushort) 216) - Main.tile[i2, worldSurfaceLow].wall = (ushort) 218; - else if (Main.tile[i2, worldSurfaceLow].wall == (ushort) 187) - Main.tile[i2, worldSurfaceLow].wall = (ushort) 221; + flag6 = true; + if (Main.tile[i2, worldSurfaceLow].wall == (byte) 216) + Main.tile[i2, worldSurfaceLow].wall = (byte) 218; + else if (Main.tile[i2, worldSurfaceLow].wall == (byte) 187) + Main.tile[i2, worldSurfaceLow].wall = (byte) 221; if (Main.tile[i2, worldSurfaceLow].type == (ushort) 1) { - if (i2 >= num93 + WorldGen.genRand.Next(5) && i2 <= num94 - WorldGen.genRand.Next(5)) + if (i2 >= num65 + WorldGen.genRand.Next(5) && i2 <= num66 - WorldGen.genRand.Next(5)) Main.tile[i2, worldSurfaceLow].type = (ushort) 203; } else if (Main.tile[i2, worldSurfaceLow].type == (ushort) 2) @@ -6187,23 +4588,21 @@ namespace Terraria } } } - int num99 = WorldGen.genRand.Next(10, 15); - for (int index56 = 0; index56 < num99; ++index56) + int num73 = WorldGen.genRand.Next(10, 15); + for (int index52 = 0; index52 < num73; ++index52) { - int num100 = 0; - bool flag13 = false; - int num101 = 0; - while (!flag13) + int num74 = 0; + bool flag7 = false; + int num75 = 0; + while (!flag7) { - ++num100; - int x = WorldGen.genRand.Next(num93 - num101, num94 + num101); - int y; - for (y = WorldGen.genRand.Next((int) (Main.worldSurface - (double) (num101 / 2)), (int) (Main.worldSurface + 100.0 + (double) num101)); WorldGen.oceanDepths(x, y); y = WorldGen.genRand.Next((int) (Main.worldSurface - (double) (num101 / 2)), (int) (Main.worldSurface + 100.0 + (double) num101))) - x = WorldGen.genRand.Next(num93 - num101, num94 + num101); - if (num100 > 100) + ++num74; + int x = WorldGen.genRand.Next(num65 - num75, num66 + num75); + int y = WorldGen.genRand.Next((int) (Main.worldSurface - (double) (num75 / 2)), (int) (Main.worldSurface + 100.0 + (double) num75)); + if (num74 > 100) { - ++num101; - num100 = 0; + ++num75; + num74 = 0; } if (!Main.tile[x, y].active()) { @@ -6216,301 +4615,179 @@ namespace Terraria while (Main.tile[x, y].active() && (double) y > Main.worldSurface) --y; } - if ((num101 > 10 || Main.tile[x, y + 1].active() && Main.tile[x, y + 1].type == (ushort) 203) && !WorldGen.IsTileNearby(x, y, 26, 3)) + if (num75 > 10 || Main.tile[x, y + 1].active() && Main.tile[x, y + 1].type == (ushort) 203) { WorldGen.Place3x2(x, y, (ushort) 26, 1); if (Main.tile[x, y].type == (ushort) 26) - flag13 = true; - } - if (num101 > 100) - flag13 = true; - } - } - } - WorldGen.CrimPlaceHearts(); - } - if (WorldGen.drunkWorldGen) - flag9 = false; - if (flag9) - return; - progress.Message = Lang.gen[20].Value; - for (int index57 = 0; (double) index57 < num87; ++index57) - { - int num102 = num84; - int num103 = num85; - int num104 = num82; - int num105 = num83; - float num106 = (float) index57 / (float) num87; - progress.Set(num106); - bool flag14 = false; - int num107 = 0; - int num108 = 0; - int num109 = 0; - while (!flag14) - { - flag14 = true; - int num110 = Main.maxTilesX / 2; - int num111 = 200; - num107 = !WorldGen.drunkWorldGen ? WorldGen.genRand.Next(minValue, Main.maxTilesX - minValue) : (flag10 ? WorldGen.genRand.Next((int) ((double) Main.maxTilesX * 0.5), Main.maxTilesX - minValue) : WorldGen.genRand.Next(minValue, (int) ((double) Main.maxTilesX * 0.5))); - num108 = num107 - WorldGen.genRand.Next(200) - 100; - num109 = num107 + WorldGen.genRand.Next(200) + 100; - if (num108 < evilBiomeBeachAvoidance) - num108 = evilBiomeBeachAvoidance; - if (num109 > Main.maxTilesX - evilBiomeBeachAvoidance) - num109 = Main.maxTilesX - evilBiomeBeachAvoidance; - if (num107 < num108 + evilBiomeAvoidanceMidFixer) - num107 = num108 + evilBiomeAvoidanceMidFixer; - if (num107 > num109 - evilBiomeAvoidanceMidFixer) - num107 = num109 - evilBiomeAvoidanceMidFixer; - if (num107 > num110 - num111 && num107 < num110 + num111) - flag14 = false; - if (num108 > num110 - num111 && num108 < num110 + num111) - flag14 = false; - if (num109 > num110 - num111 && num109 < num110 + num111) - flag14 = false; - if (num107 > WorldGen.UndergroundDesertLocation.X && num107 < WorldGen.UndergroundDesertLocation.X + WorldGen.UndergroundDesertLocation.Width) - flag14 = false; - if (num108 > WorldGen.UndergroundDesertLocation.X && num108 < WorldGen.UndergroundDesertLocation.X + WorldGen.UndergroundDesertLocation.Width) - flag14 = false; - if (num109 > WorldGen.UndergroundDesertLocation.X && num109 < WorldGen.UndergroundDesertLocation.X + WorldGen.UndergroundDesertLocation.Width) - flag14 = false; - if (num108 < dungeonLocation + num86 && num109 > dungeonLocation - num86) - flag14 = false; - if (num108 < num103 && num109 > num102) - { - ++num102; - --num103; - flag14 = false; - } - if (num108 < num105 && num109 > num104) - { - ++num104; - --num105; - flag14 = false; - } - } - int num112 = 0; - for (int i = num108; i < num109; ++i) - { - if (num112 > 0) - --num112; - if (i == num107 || num112 == 0) - { - for (int worldSurfaceLow = (int) WorldGen.worldSurfaceLow; (double) worldSurfaceLow < Main.worldSurface - 1.0; ++worldSurfaceLow) - { - if (Main.tile[i, worldSurfaceLow].active() || Main.tile[i, worldSurfaceLow].wall > (ushort) 0) - { - if (i == num107) - { - num112 = 20; - WorldGen.ChasmRunner(i, worldSurfaceLow, WorldGen.genRand.Next(150) + 150, true); - break; - } - if (WorldGen.genRand.Next(35) == 0 && num112 == 0) - { - num112 = 30; - bool makeOrb = true; - WorldGen.ChasmRunner(i, worldSurfaceLow, WorldGen.genRand.Next(50) + 50, makeOrb); - break; - } - break; - } - } - } - for (int worldSurfaceLow = (int) WorldGen.worldSurfaceLow; (double) worldSurfaceLow < Main.worldSurface - 1.0; ++worldSurfaceLow) - { - if (Main.tile[i, worldSurfaceLow].active()) - { - int num113 = worldSurfaceLow + WorldGen.genRand.Next(10, 14); - for (int index58 = worldSurfaceLow; index58 < num113; ++index58) - { - if ((Main.tile[i, index58].type == (ushort) 59 || Main.tile[i, index58].type == (ushort) 60) && i >= num108 + WorldGen.genRand.Next(5) && i < num109 - WorldGen.genRand.Next(5)) - Main.tile[i, index58].type = (ushort) 0; - } - break; - } - } - } - double num114 = Main.worldSurface + 40.0; - for (int index59 = num108; index59 < num109; ++index59) - { - num114 += (double) WorldGen.genRand.Next(-2, 3); - if (num114 < Main.worldSurface + 30.0) - num114 = Main.worldSurface + 30.0; - if (num114 > Main.worldSurface + 50.0) - num114 = Main.worldSurface + 50.0; - i2 = index59; - bool flag15 = false; - for (int worldSurfaceLow = (int) WorldGen.worldSurfaceLow; (double) worldSurfaceLow < num114; ++worldSurfaceLow) - { - if (Main.tile[i2, worldSurfaceLow].active()) - { - if (Main.tile[i2, worldSurfaceLow].type == (ushort) 53 && i2 >= num108 + WorldGen.genRand.Next(5) && i2 <= num109 - WorldGen.genRand.Next(5)) - Main.tile[i2, worldSurfaceLow].type = (ushort) 112; - if (Main.tile[i2, worldSurfaceLow].type == (ushort) 0 && (double) worldSurfaceLow < Main.worldSurface - 1.0 && !flag15) - { - WorldGen.grassSpread = 0; - WorldGen.SpreadGrass(i2, worldSurfaceLow, grass: 23); - } - flag15 = true; - if (Main.tile[i2, worldSurfaceLow].type == (ushort) 1 && i2 >= num108 + WorldGen.genRand.Next(5) && i2 <= num109 - WorldGen.genRand.Next(5)) - Main.tile[i2, worldSurfaceLow].type = (ushort) 25; - if (Main.tile[i2, worldSurfaceLow].wall == (ushort) 216) - Main.tile[i2, worldSurfaceLow].wall = (ushort) 217; - else if (Main.tile[i2, worldSurfaceLow].wall == (ushort) 187) - Main.tile[i2, worldSurfaceLow].wall = (ushort) 220; - if (Main.tile[i2, worldSurfaceLow].type == (ushort) 2) - Main.tile[i2, worldSurfaceLow].type = (ushort) 23; - if (Main.tile[i2, worldSurfaceLow].type == (ushort) 161) - Main.tile[i2, worldSurfaceLow].type = (ushort) 163; - else if (Main.tile[i2, worldSurfaceLow].type == (ushort) 396) - Main.tile[i2, worldSurfaceLow].type = (ushort) 400; - else if (Main.tile[i2, worldSurfaceLow].type == (ushort) 397) - Main.tile[i2, worldSurfaceLow].type = (ushort) 398; - } - } - } - for (int index60 = num108; index60 < num109; ++index60) - { - for (int index61 = 0; index61 < Main.maxTilesY - 50; ++index61) - { - if (Main.tile[index60, index61].active() && Main.tile[index60, index61].type == (ushort) 31) - { - int num115 = index60 - 13; - int num116 = index60 + 13; - int num117 = index61 - 13; - int num118 = index61 + 13; - for (int index62 = num115; index62 < num116; ++index62) - { - if (index62 > 10 && index62 < Main.maxTilesX - 10) - { - for (int index63 = num117; index63 < num118; ++index63) - { - if (Math.Abs(index62 - index60) + Math.Abs(index63 - index61) < 9 + WorldGen.genRand.Next(11) && WorldGen.genRand.Next(3) != 0 && Main.tile[index62, index63].type != (ushort) 31) - { - Main.tile[index62, index63].active(true); - Main.tile[index62, index63].type = (ushort) 25; - if (Math.Abs(index62 - index60) <= 1 && Math.Abs(index63 - index61) <= 1) - Main.tile[index62, index63].active(false); - } - if (Main.tile[index62, index63].type != (ushort) 31 && Math.Abs(index62 - index60) <= 2 + WorldGen.genRand.Next(3) && Math.Abs(index63 - index61) <= 2 + WorldGen.genRand.Next(3)) - Main.tile[index62, index63].active(false); - } - } + flag7 = true; } + if (num75 > 100) + flag7 = true; } } } } - })); - WorldGen.AddGenerationPass("Lakes", (WorldGenLegacyMethod) ((progress, passConfig) => - { - progress.Message = Lang.gen[19].Value; - int num119 = Main.maxTilesX / 4200; - int num120 = WorldGen.genRand.Next(num119 * 3, num119 * 6); - for (int index64 = 0; index64 < num120; ++index64) + else { - int num121 = Main.maxTilesX / 4; - if (WorldGen.numLakes >= WorldGen.maxLakes - 1) - break; - float num122 = (float) index64 / (float) num120; - progress.Set(num122); - while (num121 > 0) + progress.Message = Lang.gen[20].Value; + for (int index53 = 0; (double) index53 < (double) Main.maxTilesX * 0.00045; ++index53) { - bool flag = false; - --num121; - int i4 = WorldGen.genRand.Next(lakesBeachAvoidance, Main.maxTilesX - lakesBeachAvoidance); - while ((double) i4 > (double) Main.maxTilesX * 0.45 && (double) i4 < (double) Main.maxTilesX * 0.55) - i4 = WorldGen.genRand.Next(lakesBeachAvoidance, Main.maxTilesX - lakesBeachAvoidance); - for (int index65 = 0; index65 < WorldGen.numLakes; ++index65) + float num76 = (float) index53 / ((float) Main.maxTilesX * 0.00045f); + progress.Set(num76); + bool flag8 = false; + int num77 = 0; + int num78 = 0; + int num79 = 0; + while (!flag8) { - if (Math.Abs(i4 - WorldGen.LakeX[index65]) < 150) + int num80 = 0; + flag8 = true; + int num81 = Main.maxTilesX / 2; + int num82 = 200; + num77 = WorldGen.genRand.Next(320, Main.maxTilesX - 320); + num78 = num77 - WorldGen.genRand.Next(200) - 100; + num79 = num77 + WorldGen.genRand.Next(200) + 100; + if (num78 < 285) + num78 = 285; + if (num79 > Main.maxTilesX - 285) + num79 = Main.maxTilesX - 285; + if (num77 > num81 - num82 && num77 < num81 + num82) + flag8 = false; + if (num78 > num81 - num82 && num78 < num81 + num82) + flag8 = false; + if (num79 > num81 - num82 && num79 < num81 + num82) + flag8 = false; + if (num77 > WorldGen.UndergroundDesertLocation.X && num77 < WorldGen.UndergroundDesertLocation.X + WorldGen.UndergroundDesertLocation.Width) + flag8 = false; + if (num78 > WorldGen.UndergroundDesertLocation.X && num78 < WorldGen.UndergroundDesertLocation.X + WorldGen.UndergroundDesertLocation.Width) + flag8 = false; + if (num79 > WorldGen.UndergroundDesertLocation.X && num79 < WorldGen.UndergroundDesertLocation.X + WorldGen.UndergroundDesertLocation.Width) + flag8 = false; + for (int index54 = num78; index54 < num79; ++index54) { - flag = true; - break; - } - } - for (int index66 = 0; index66 < WorldGen.numMCaves; ++index66) - { - if (Math.Abs(i4 - WorldGen.mCaveX[index66]) < 100) - { - flag = true; - break; - } - } - for (int index67 = 0; index67 < WorldGen.numTunnels; ++index67) - { - if (Math.Abs(i4 - WorldGen.tunnelX[index67]) < 100) - { - flag = true; - break; - } - } - if (!flag) - { - int j3 = (int) WorldGen.worldSurfaceLow - 20; - while (!Main.tile[i4, j3].active()) - { - ++j3; - if ((double) j3 >= Main.worldSurface || Main.tile[i4, j3].wall > (ushort) 0) + for (int index55 = 0; index55 < (int) Main.worldSurface; index55 += 5) { - flag = true; - break; + if (Main.tile[index54, index55].active() && Main.tileDungeon[(int) Main.tile[index54, index55].type]) + { + flag8 = false; + break; + } + if (!flag8) + break; } } - if (Main.tile[i4, j3].type == (ushort) 53) - flag = true; - if (!flag) + if (num80 < 200 && WorldGen.JungleX > num78 && WorldGen.JungleX < num79) { - int num123 = 50; - for (int index68 = i4 - num123; index68 <= i4 + num123; ++index68) + int num83 = num80 + 1; + flag8 = false; + } + } + int num84 = 0; + for (int i = num78; i < num79; ++i) + { + if (num84 > 0) + --num84; + if (i == num77 || num84 == 0) + { + for (int worldSurfaceLow = (int) WorldGen.worldSurfaceLow; (double) worldSurfaceLow < Main.worldSurface - 1.0; ++worldSurfaceLow) { - for (int index69 = j3 - num123; index69 <= j3 + num123; ++index69) + if (Main.tile[i, worldSurfaceLow].active() || Main.tile[i, worldSurfaceLow].wall > (byte) 0) { - if (Main.tile[index68, index69].type == (ushort) 203 || Main.tile[index68, index69].type == (ushort) 25) + if (i == num77) { - flag = true; + num84 = 20; + WorldGen.ChasmRunner(i, worldSurfaceLow, WorldGen.genRand.Next(150) + 150, true); break; } + if (WorldGen.genRand.Next(35) == 0 && num84 == 0) + { + num84 = 30; + bool makeOrb = true; + WorldGen.ChasmRunner(i, worldSurfaceLow, WorldGen.genRand.Next(50) + 50, makeOrb); + break; + } + break; } } - if (!flag) + } + for (int worldSurfaceLow = (int) WorldGen.worldSurfaceLow; (double) worldSurfaceLow < Main.worldSurface - 1.0; ++worldSurfaceLow) + { + if (Main.tile[i, worldSurfaceLow].active()) { - int num124 = j3; - int num125 = 20; - while (!WorldGen.SolidTile(i4 - num125, j3) || !WorldGen.SolidTile(i4 + num125, j3)) + int num85 = worldSurfaceLow + WorldGen.genRand.Next(10, 14); + for (int index56 = worldSurfaceLow; index56 < num85; ++index56) { - ++j3; - if ((double) j3 > Main.worldSurface - 50.0) - flag = true; + if ((Main.tile[i, index56].type == (ushort) 59 || Main.tile[i, index56].type == (ushort) 60) && i >= num78 + WorldGen.genRand.Next(5) && i < num79 - WorldGen.genRand.Next(5)) + Main.tile[i, index56].type = (ushort) 0; } - if (j3 - num124 <= 10) + break; + } + } + } + double num86 = Main.worldSurface + 40.0; + for (int index57 = num78; index57 < num79; ++index57) + { + num86 += (double) WorldGen.genRand.Next(-2, 3); + if (num86 < Main.worldSurface + 30.0) + num86 = Main.worldSurface + 30.0; + if (num86 > Main.worldSurface + 50.0) + num86 = Main.worldSurface + 50.0; + i2 = index57; + bool flag9 = false; + for (int worldSurfaceLow = (int) WorldGen.worldSurfaceLow; (double) worldSurfaceLow < num86; ++worldSurfaceLow) + { + if (Main.tile[i2, worldSurfaceLow].active()) + { + if (Main.tile[i2, worldSurfaceLow].type == (ushort) 53 && i2 >= num78 + WorldGen.genRand.Next(5) && i2 <= num79 - WorldGen.genRand.Next(5)) + Main.tile[i2, worldSurfaceLow].type = (ushort) 112; + if (Main.tile[i2, worldSurfaceLow].type == (ushort) 0 && (double) worldSurfaceLow < Main.worldSurface - 1.0 && !flag9) { - int num126 = 60; - for (int index70 = i4 - num126; index70 <= i4 + num126; ++index70) + WorldGen.grassSpread = 0; + WorldGen.SpreadGrass(i2, worldSurfaceLow, grass: 23); + } + flag9 = true; + if (Main.tile[i2, worldSurfaceLow].type == (ushort) 1 && i2 >= num78 + WorldGen.genRand.Next(5) && i2 <= num79 - WorldGen.genRand.Next(5)) + Main.tile[i2, worldSurfaceLow].type = (ushort) 25; + if (Main.tile[i2, worldSurfaceLow].wall == (byte) 216) + Main.tile[i2, worldSurfaceLow].wall = (byte) 217; + else if (Main.tile[i2, worldSurfaceLow].wall == (byte) 187) + Main.tile[i2, worldSurfaceLow].wall = (byte) 220; + if (Main.tile[i2, worldSurfaceLow].type == (ushort) 2) + Main.tile[i2, worldSurfaceLow].type = (ushort) 23; + if (Main.tile[i2, worldSurfaceLow].type == (ushort) 161) + Main.tile[i2, worldSurfaceLow].type = (ushort) 163; + else if (Main.tile[i2, worldSurfaceLow].type == (ushort) 396) + Main.tile[i2, worldSurfaceLow].type = (ushort) 400; + else if (Main.tile[i2, worldSurfaceLow].type == (ushort) 397) + Main.tile[i2, worldSurfaceLow].type = (ushort) 398; + } + } + } + for (int index58 = num78; index58 < num79; ++index58) + { + for (int index59 = 0; index59 < Main.maxTilesY - 50; ++index59) + { + if (Main.tile[index58, index59].active() && Main.tile[index58, index59].type == (ushort) 31) + { + int num87 = index58 - 13; + int num88 = index58 + 13; + int num89 = index59 - 13; + int num90 = index59 + 13; + for (int index60 = num87; index60 < num88; ++index60) + { + if (index60 > 10 && index60 < Main.maxTilesX - 10) { - int index71 = j3 - 20; - if (Main.tile[index70, index71].active() || Main.tile[index70, index71].wall > (ushort) 0) - flag = true; - } - if (!flag) - { - int num127 = 0; - for (int i5 = i4 - num126; i5 <= i4 + num126; ++i5) + for (int index61 = num89; index61 < num90; ++index61) { - for (int j4 = j3; j4 <= j3 + num126 * 2; ++j4) + if (Math.Abs(index60 - index58) + Math.Abs(index61 - index59) < 9 + WorldGen.genRand.Next(11) && WorldGen.genRand.Next(3) != 0 && Main.tile[index60, index61].type != (ushort) 31) { - if (WorldGen.SolidTile(i5, j4)) - ++num127; + Main.tile[index60, index61].active(true); + Main.tile[index60, index61].type = (ushort) 25; + if (Math.Abs(index60 - index58) <= 1 && Math.Abs(index61 - index59) <= 1) + Main.tile[index60, index61].active(false); } - } - int num128 = (num126 * 2 + 1) * (num126 * 2 + 1); - if ((double) num127 >= (double) num128 * 0.8 && !WorldGen.UndergroundDesertLocation.Intersects(new Microsoft.Xna.Framework.Rectangle(i4 - 8, j3 - 8, 16, 16))) - { - WorldGen.SonOfLakinater(i4, j3); - WorldGen.LakeX[WorldGen.numLakes] = i4; - ++WorldGen.numLakes; - break; + if (Main.tile[index60, index61].type != (ushort) 31 && Math.Abs(index60 - index58) <= 2 + WorldGen.genRand.Next(3) && Math.Abs(index61 - index59) <= 2 + WorldGen.genRand.Next(3)) + Main.tile[index60, index61].active(false); } } } @@ -6520,50 +4797,25 @@ namespace Terraria } } })); - WorldGen.AddGenerationPass("Dungeon", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Slush", (WorldGenLegacyMethod) (progress => { - progress.Set(1f); - int num129 = dungeonLocation; - int num130 = (int) ((Main.worldSurface + Main.rockLayer) / 2.0) + WorldGen.genRand.Next(-200, 200); - int num131 = (int) ((Main.worldSurface + Main.rockLayer) / 2.0) + 200; - int y = num130; - bool flag = false; - for (int index = 0; index < 10; ++index) + for (int index62 = snowTop; index62 < snowBottom; ++index62) { - if (WorldGen.SolidTile(num129, y + index)) + for (int index63 = snowMinX[index62]; index63 < snowMaxX[index62]; ++index63) { - flag = true; - break; - } - } - if (!flag) - { - while (y < num131 && !WorldGen.SolidTile(num129, y + 10)) - ++y; - } - if (WorldGen.drunkWorldGen) - y = (int) Main.worldSurface + 70; - WorldGen.MakeDungeon(num129, y); - })); - WorldGen.AddGenerationPass("Slush", (WorldGenLegacyMethod) ((progress, passConfig) => - { - for (int index72 = snowTop; index72 < snowBottom; ++index72) - { - for (int index73 = snowMinX[index72]; index73 < snowMaxX[index72]; ++index73) - { - switch (Main.tile[index73, index72].type) + switch (Main.tile[index63, index62].type) { case 1: - Main.tile[index73, index72].type = (ushort) 161; + Main.tile[index63, index62].type = (ushort) 161; break; case 59: bool flag = true; - int num132 = 3; - for (int index74 = index73 - num132; index74 <= index73 + num132; ++index74) + int num = 3; + for (int index64 = index63 - num; index64 <= index63 + num; ++index64) { - for (int index75 = index72 - num132; index75 <= index72 + num132; ++index75) + for (int index65 = index62 - num; index65 <= index62 + num; ++index65) { - if (Main.tile[index74, index75].type == (ushort) 60 || Main.tile[index74, index75].type == (ushort) 70 || Main.tile[index74, index75].type == (ushort) 71 || Main.tile[index74, index75].type == (ushort) 72) + if (Main.tile[index64, index65].type == (ushort) 60 || Main.tile[index64, index65].type == (ushort) 70 || Main.tile[index64, index65].type == (ushort) 71 || Main.tile[index64, index65].type == (ushort) 72) { flag = false; break; @@ -6572,18 +4824,18 @@ namespace Terraria } if (flag) { - Main.tile[index73, index72].type = (ushort) 224; + Main.tile[index63, index62].type = (ushort) 224; break; } break; case 123: - Main.tile[index73, index72].type = (ushort) 224; + Main.tile[index63, index62].type = (ushort) 224; break; } } } })); - WorldGen.AddGenerationPass("Mountain Caves", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Mud Caves To Grass", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[21].Value; for (int index = 0; index < WorldGen.numMCaves; ++index) @@ -6594,153 +4846,194 @@ namespace Terraria WorldGen.Cavinator(i, j, WorldGen.genRand.Next(40, 50)); } })); - WorldGen.AddGenerationPass("Beaches", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Beaches", (WorldGenLegacyMethod) (progress => { + int index66 = 0; + int index67 = 0; + int index68 = 20; + int index69 = Main.maxTilesX - 20; progress.Message = Lang.gen[22].Value; - bool floridaStyle1 = false; - bool floridaStyle2 = false; - if (WorldGen.genRand.Next(4) == 0) + for (int index70 = 0; index70 < 2; ++index70) { - if (WorldGen.genRand.Next(2) == 0) - floridaStyle1 = true; - else - floridaStyle2 = true; - } - for (int index76 = 0; index76 < 2; ++index76) - { - if (index76 == 0) + if (index70 == 0) { - int num133 = 0; - int num134 = WorldGen.genRand.Next(oceanWaterStartRandomMin, oceanWaterStartRandomMax); + int num91 = 0; + int num92 = WorldGen.genRand.Next(125, 200) + 50; if (dungeonSide == 1) - num134 = oceanWaterForcedJungleLength; - int num135 = leftBeachEnd - minSsandBeforeWater; - if (num134 > num135) - num134 = num135; - int count = 0; - float depth = 1f; - int index77 = 0; - while (!Main.tile[num134 - 1, index77].active()) - ++index77; - shellStartYLeft = index77; - int num136 = index77 + WorldGen.genRand.Next(1, 5); - for (int index78 = num134 - 1; index78 >= num133; --index78) + num92 = 275; + int num93 = 0; + float num94 = 1f; + int index71 = 0; + while (!Main.tile[num92 - 1, index71].active()) + ++index71; + index66 = index71; + int num95 = index71 + WorldGen.genRand.Next(1, 5); + for (int index72 = num92 - 1; index72 >= num91; --index72) { - if (index78 > 30) + ++num93; + if (num93 < 3) + num94 += (float) WorldGen.genRand.Next(10, 20) * 0.2f; + else if (num93 < 6) + num94 += (float) WorldGen.genRand.Next(10, 20) * 0.15f; + else if (num93 < 9) + num94 += (float) WorldGen.genRand.Next(10, 20) * 0.1f; + else if (num93 < 15) + num94 += (float) WorldGen.genRand.Next(10, 20) * 0.07f; + else if (num93 < 50) + num94 += (float) WorldGen.genRand.Next(10, 20) * 0.05f; + else if (num93 < 75) + num94 += (float) WorldGen.genRand.Next(10, 20) * 0.04f; + else if (num93 < 100) + num94 += (float) WorldGen.genRand.Next(10, 20) * 0.03f; + else if (num93 < 125) + num94 += (float) WorldGen.genRand.Next(10, 20) * 0.02f; + else if (num93 < 150) + num94 += (float) WorldGen.genRand.Next(10, 20) * 0.01f; + else if (num93 < 175) + num94 += (float) WorldGen.genRand.Next(10, 20) * 0.005f; + else if (num93 < 200) + num94 += (float) WorldGen.genRand.Next(10, 20) * (1f / 1000f); + else if (num93 < 230) + num94 += (float) WorldGen.genRand.Next(10, 20) * 0.01f; + else if (num93 < 235) + num94 += (float) WorldGen.genRand.Next(10, 20) * 0.05f; + else if (num93 < 240) + num94 += (float) WorldGen.genRand.Next(10, 20) * 0.1f; + else if (num93 < 245) + num94 += (float) WorldGen.genRand.Next(10, 20) * 0.05f; + else if (num93 < (int) byte.MaxValue) + num94 += (float) WorldGen.genRand.Next(10, 20) * 0.01f; + if (num93 == 235) + index69 = index72; + if (num93 == 235) + index68 = index72; + int num96 = WorldGen.genRand.Next(15, 20); + for (int index73 = 0; (double) index73 < (double) num95 + (double) num94 + (double) num96; ++index73) { - ++count; - depth = WorldGen.TuneOceanDepth(count, depth, floridaStyle1); - } - else - ++depth; - int num137 = WorldGen.genRand.Next(15, 20); - for (int index79 = 0; (double) index79 < (double) num136 + (double) depth + (double) num137; ++index79) - { - if ((double) index79 < (double) num136 + (double) depth * 0.75 - 3.0) + if ((double) index73 < (double) num95 + (double) num94 * 0.75 - 3.0) { - Main.tile[index78, index79].active(false); - if (index79 > num136) - Main.tile[index78, index79].liquid = byte.MaxValue; - else if (index79 == num136) - { - Main.tile[index78, index79].liquid = (byte) 127; - if (shellStartXLeft == 0) - shellStartXLeft = index78; - } + Main.tile[index72, index73].active(false); + if (index73 > num95) + Main.tile[index72, index73].liquid = byte.MaxValue; + else if (index73 == num95) + Main.tile[index72, index73].liquid = (byte) 127; } - else if (index79 > num136) + else if (index73 > num95) { - Main.tile[index78, index79].type = (ushort) 53; - Main.tile[index78, index79].active(true); + Main.tile[index72, index73].type = (ushort) 53; + Main.tile[index72, index73].active(true); } - Main.tile[index78, index79].wall = (ushort) 0; + Main.tile[index72, index73].wall = (byte) 0; } } } else { - int index80 = Main.maxTilesX - WorldGen.genRand.Next(oceanWaterStartRandomMin, oceanWaterStartRandomMax); + int index74 = Main.maxTilesX - WorldGen.genRand.Next(125, 200) - 50; int maxTilesX = Main.maxTilesX; if (dungeonSide == -1) - index80 = Main.maxTilesX - oceanWaterForcedJungleLength; - int num138 = rightBeachStart + minSsandBeforeWater; - if (index80 < num138) - index80 = num138; - float depth = 1f; - int count = 0; - int index81 = 0; - while (!Main.tile[index80, index81].active()) - ++index81; - shellStartXRight = 0; - shellStartYRight = index81; - int num139 = index81 + WorldGen.genRand.Next(1, 5); - for (int index82 = index80; index82 < maxTilesX; ++index82) + index74 = Main.maxTilesX - 275; + float num97 = 1f; + int num98 = 0; + int index75 = 0; + while (!Main.tile[index74, index75].active()) + ++index75; + index67 = index75; + int num99 = index75 + WorldGen.genRand.Next(1, 5); + for (int index76 = index74; index76 < maxTilesX; ++index76) { - if (index82 < maxTilesX - 30) + ++num98; + if (num98 < 3) + num97 += (float) WorldGen.genRand.Next(10, 20) * 0.2f; + else if (num98 < 6) + num97 += (float) WorldGen.genRand.Next(10, 20) * 0.15f; + else if (num98 < 9) + num97 += (float) WorldGen.genRand.Next(10, 20) * 0.1f; + else if (num98 < 15) + num97 += (float) WorldGen.genRand.Next(10, 20) * 0.07f; + else if (num98 < 50) + num97 += (float) WorldGen.genRand.Next(10, 20) * 0.05f; + else if (num98 < 75) + num97 += (float) WorldGen.genRand.Next(10, 20) * 0.04f; + else if (num98 < 100) + num97 += (float) WorldGen.genRand.Next(10, 20) * 0.03f; + else if (num98 < 125) + num97 += (float) WorldGen.genRand.Next(10, 20) * 0.02f; + else if (num98 < 150) + num97 += (float) WorldGen.genRand.Next(10, 20) * 0.01f; + else if (num98 < 175) + num97 += (float) WorldGen.genRand.Next(10, 20) * 0.005f; + else if (num98 < 200) + num97 += (float) WorldGen.genRand.Next(10, 20) * (1f / 1000f); + else if (num98 < 230) + num97 += (float) WorldGen.genRand.Next(10, 20) * 0.01f; + else if (num98 < 235) + num97 += (float) WorldGen.genRand.Next(10, 20) * 0.05f; + else if (num98 < 240) + num97 += (float) WorldGen.genRand.Next(10, 20) * 0.1f; + else if (num98 < 245) + num97 += (float) WorldGen.genRand.Next(10, 20) * 0.05f; + else if (num98 < (int) byte.MaxValue) + num97 += (float) WorldGen.genRand.Next(10, 20) * 0.01f; + if (num98 == 235) + index69 = index76; + int num100 = WorldGen.genRand.Next(15, 20); + for (int index77 = 0; (double) index77 < (double) num99 + (double) num97 + (double) num100; ++index77) { - ++count; - depth = WorldGen.TuneOceanDepth(count, depth, floridaStyle2); - } - else - ++depth; - int num140 = WorldGen.genRand.Next(15, 20); - for (int index83 = 0; (double) index83 < (double) num139 + (double) depth + (double) num140; ++index83) - { - if ((double) index83 < (double) num139 + (double) depth * 0.75 - 3.0) + if ((double) index77 < (double) num99 + (double) num97 * 0.75 - 3.0 && (double) index77 < Main.worldSurface - 2.0) { - Main.tile[index82, index83].active(false); - if (index83 > num139) - Main.tile[index82, index83].liquid = byte.MaxValue; - else if (index83 == num139) - { - Main.tile[index82, index83].liquid = (byte) 127; - if (shellStartXRight == 0) - shellStartXRight = index82; - } + Main.tile[index76, index77].active(false); + if (index77 > num99) + Main.tile[index76, index77].liquid = byte.MaxValue; + else if (index77 == num99) + Main.tile[index76, index77].liquid = (byte) 127; } - else if (index83 > num139) + else if (index77 > num99) { - Main.tile[index82, index83].type = (ushort) 53; - Main.tile[index82, index83].active(true); + Main.tile[index76, index77].type = (ushort) 53; + Main.tile[index76, index77].active(true); } - Main.tile[index82, index83].wall = (ushort) 0; + Main.tile[index76, index77].wall = (byte) 0; } } } } + while (!Main.tile[index68, index66].active()) + ++index66; + int num101 = index66 + 1; + while (!Main.tile[index69, index67].active()) + ++index67; + int num102 = index67 + 1; })); - WorldGen.AddGenerationPass("Gems", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Gems", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[23].Value; - Main.tileSolid[484] = false; for (int type = 63; type <= 68; ++type) { - float num141 = (float) (type - 63) / 6f; - progress.Set(num141); - float num142 = 0.0f; + float num103 = 0.0f; switch (type) { case 63: - num142 = (float) Main.maxTilesX * 0.3f; + num103 = (float) Main.maxTilesX * 0.3f; break; case 64: - num142 = (float) Main.maxTilesX * 0.1f; + num103 = (float) Main.maxTilesX * 0.1f; break; case 65: - num142 = (float) Main.maxTilesX * 0.25f; + num103 = (float) Main.maxTilesX * 0.25f; break; case 66: - num142 = (float) Main.maxTilesX * 0.45f; + num103 = (float) Main.maxTilesX * 0.45f; break; case 67: - num142 = (float) Main.maxTilesX * 0.5f; + num103 = (float) Main.maxTilesX * 0.5f; break; case 68: - num142 = (float) Main.maxTilesX * 0.05f; + num103 = (float) Main.maxTilesX * 0.05f; break; } - float num143 = num142 * 0.2f; - for (int index = 0; (double) index < (double) num143; ++index) + float num104 = num103 * 0.2f; + for (int index = 0; (double) index < (double) num104; ++index) { int i = WorldGen.genRand.Next(0, Main.maxTilesX); int j; @@ -6749,244 +5042,214 @@ namespace Terraria WorldGen.TileRunner(i, j, (double) WorldGen.genRand.Next(2, 6), WorldGen.genRand.Next(3, 7), type); } } - for (int index84 = 0; index84 < 2; ++index84) + for (int index78 = 0; index78 < 2; ++index78) { - int num144 = 1; - int num145 = 5; - int num146 = Main.maxTilesX - 5; - if (index84 == 1) + int num105 = 1; + int num106 = 5; + int num107 = Main.maxTilesX - 5; + if (index78 == 1) { - num144 = -1; - num145 = Main.maxTilesX - 5; - num146 = 5; + num105 = -1; + num106 = Main.maxTilesX - 5; + num107 = 5; } - for (int index85 = num145; index85 != num146; index85 += num144) + for (int index79 = num106; index79 != num107; index79 += num105) { - if (index85 <= WorldGen.UndergroundDesertLocation.Left || index85 >= WorldGen.UndergroundDesertLocation.Right) + for (int index80 = 10; index80 < Main.maxTilesY - 10; ++index80) { - for (int index86 = 10; index86 < Main.maxTilesY - 10; ++index86) + if (Main.tile[index79, index80].active() && Main.tile[index79, index80 + 1].active() && Main.tileSand[(int) Main.tile[index79, index80].type] && Main.tileSand[(int) Main.tile[index79, index80 + 1].type]) { - if (Main.tile[index85, index86].active() && Main.tile[index85, index86 + 1].active() && Main.tileSand[(int) Main.tile[index85, index86].type] && Main.tileSand[(int) Main.tile[index85, index86 + 1].type]) + ushort type = Main.tile[index79, index80].type; + int index81 = index79 + num105; + int index82 = index80 + 1; + if (!Main.tile[index81, index80].active() && !Main.tile[index81, index80 + 1].active()) { - ushort type = Main.tile[index85, index86].type; - int index87 = index85 + num144; - int index88 = index86 + 1; - if (!Main.tile[index87, index86].active() && !Main.tile[index87, index88].active()) - { - while (!Main.tile[index87, index88].active()) - ++index88; - int index89 = index88 - 1; - Main.tile[index85, index86].active(false); - Main.tile[index87, index89].active(true); - Main.tile[index87, index89].type = type; - } + while (!Main.tile[index81, index82].active()) + ++index82; + int index83 = index82 - 1; + Main.tile[index79, index80].active(false); + Main.tile[index81, index83].active(true); + Main.tile[index81, index83].type = type; } } } } } })); - WorldGen.AddGenerationPass("Gravitating Sand", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Gravitating Sand", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[24].Value; for (int x = 0; x < Main.maxTilesX; ++x) { - float num147 = (float) x / (float) (Main.maxTilesX - 1); - progress.Set(num147); + float num108 = (float) x / (float) (Main.maxTilesX - 1); + progress.Set(num108); bool flag = false; - int num148 = 0; + int num109 = 0; for (int y = Main.maxTilesY - 1; y > 0; --y) { if (WorldGen.SolidOrSlopedTile(x, y)) { ushort type = Main.tile[x, y].type; - if (flag && y < (int) Main.worldSurface && y != num148 - 1 && TileID.Sets.Falling[(int) type]) + if (flag && y < (int) Main.worldSurface && y != num109 - 1 && TileID.Sets.Falling[(int) type]) { - for (int index = y; index < num148; ++index) - Main.tile[x, index].ResetToType(type); + for (int index = y; index < num109; ++index) + { + Main.tile[x, index].type = type; + Main.tile[x, index].active(true); + } } flag = true; - num148 = y; + num109 = y; } } } })); - WorldGen.AddGenerationPass("Create Ocean Caves", (WorldGenLegacyMethod) ((progress, passConfig) => - { - for (int index = 0; index < 2; ++index) - { - if (WorldGen.genRand.Next(4) == 0 || WorldGen.drunkWorldGen) - { - progress.Message = Lang.gen[90].Value; - int i = WorldGen.genRand.Next(55, 95); - if (index == 1) - i = WorldGen.genRand.Next(Main.maxTilesX - 95, Main.maxTilesX - 55); - int j = 0; - while (!Main.tile[i, j].active()) - ++j; - WorldGen.oceanCave(i, j); - } - } - })); - WorldGen.AddGenerationPass("Clean Up Dirt", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Clean Up Dirt", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[25].Value; - for (int index90 = 3; index90 < Main.maxTilesX - 3; ++index90) + for (int index84 = 3; index84 < Main.maxTilesX - 3; ++index84) { - float num149 = (float) index90 / (float) Main.maxTilesX; - progress.Set(0.5f * num149); + float num = (float) index84 / (float) Main.maxTilesX; + progress.Set(0.5f * num); bool flag = true; - for (int index91 = 0; (double) index91 < Main.worldSurface; ++index91) + for (int index85 = 0; (double) index85 < Main.worldSurface; ++index85) { if (flag) { - if (Main.tile[index90, index91].wall == (ushort) 2 || Main.tile[index90, index91].wall == (ushort) 40 || Main.tile[index90, index91].wall == (ushort) 64 || Main.tile[index90, index91].wall == (ushort) 86) - Main.tile[index90, index91].wall = (ushort) 0; - if (Main.tile[index90, index91].type != (ushort) 53 && Main.tile[index90, index91].type != (ushort) 112 && Main.tile[index90, index91].type != (ushort) 234) + if (Main.tile[index84, index85].wall == (byte) 2 || Main.tile[index84, index85].wall == (byte) 40 || Main.tile[index84, index85].wall == (byte) 64) + Main.tile[index84, index85].wall = (byte) 0; + if (Main.tile[index84, index85].type != (ushort) 53 && Main.tile[index84, index85].type != (ushort) 112 && Main.tile[index84, index85].type != (ushort) 234) { - if (Main.tile[index90 - 1, index91].wall == (ushort) 2 || Main.tile[index90 - 1, index91].wall == (ushort) 40 || Main.tile[index90 - 1, index91].wall == (ushort) 40) - Main.tile[index90 - 1, index91].wall = (ushort) 0; - if ((Main.tile[index90 - 2, index91].wall == (ushort) 2 || Main.tile[index90 - 2, index91].wall == (ushort) 40 || Main.tile[index90 - 2, index91].wall == (ushort) 40) && WorldGen.genRand.Next(2) == 0) - Main.tile[index90 - 2, index91].wall = (ushort) 0; - if ((Main.tile[index90 - 3, index91].wall == (ushort) 2 || Main.tile[index90 - 3, index91].wall == (ushort) 40 || Main.tile[index90 - 3, index91].wall == (ushort) 40) && WorldGen.genRand.Next(2) == 0) - Main.tile[index90 - 3, index91].wall = (ushort) 0; - if (Main.tile[index90 + 1, index91].wall == (ushort) 2 || Main.tile[index90 + 1, index91].wall == (ushort) 40 || Main.tile[index90 + 1, index91].wall == (ushort) 40) - Main.tile[index90 + 1, index91].wall = (ushort) 0; - if ((Main.tile[index90 + 2, index91].wall == (ushort) 2 || Main.tile[index90 + 2, index91].wall == (ushort) 40 || Main.tile[index90 + 2, index91].wall == (ushort) 40) && WorldGen.genRand.Next(2) == 0) - Main.tile[index90 + 2, index91].wall = (ushort) 0; - if ((Main.tile[index90 + 3, index91].wall == (ushort) 2 || Main.tile[index90 + 3, index91].wall == (ushort) 40 || Main.tile[index90 + 3, index91].wall == (ushort) 40) && WorldGen.genRand.Next(2) == 0) - Main.tile[index90 + 3, index91].wall = (ushort) 0; - if (Main.tile[index90, index91].active()) + if (Main.tile[index84 - 1, index85].wall == (byte) 2 || Main.tile[index84 - 1, index85].wall == (byte) 40 || Main.tile[index84 - 1, index85].wall == (byte) 40) + Main.tile[index84 - 1, index85].wall = (byte) 0; + if ((Main.tile[index84 - 2, index85].wall == (byte) 2 || Main.tile[index84 - 2, index85].wall == (byte) 40 || Main.tile[index84 - 2, index85].wall == (byte) 40) && WorldGen.genRand.Next(2) == 0) + Main.tile[index84 - 2, index85].wall = (byte) 0; + if ((Main.tile[index84 - 3, index85].wall == (byte) 2 || Main.tile[index84 - 3, index85].wall == (byte) 40 || Main.tile[index84 - 3, index85].wall == (byte) 40) && WorldGen.genRand.Next(2) == 0) + Main.tile[index84 - 3, index85].wall = (byte) 0; + if (Main.tile[index84 + 1, index85].wall == (byte) 2 || Main.tile[index84 + 1, index85].wall == (byte) 40 || Main.tile[index84 + 1, index85].wall == (byte) 40) + Main.tile[index84 + 1, index85].wall = (byte) 0; + if ((Main.tile[index84 + 2, index85].wall == (byte) 2 || Main.tile[index84 + 2, index85].wall == (byte) 40 || Main.tile[index84 + 2, index85].wall == (byte) 40) && WorldGen.genRand.Next(2) == 0) + Main.tile[index84 + 2, index85].wall = (byte) 0; + if ((Main.tile[index84 + 3, index85].wall == (byte) 2 || Main.tile[index84 + 3, index85].wall == (byte) 40 || Main.tile[index84 + 3, index85].wall == (byte) 40) && WorldGen.genRand.Next(2) == 0) + Main.tile[index84 + 3, index85].wall = (byte) 0; + if (Main.tile[index84, index85].active()) flag = false; } } - else if (Main.tile[index90, index91].wall == (ushort) 0 && Main.tile[index90, index91 + 1].wall == (ushort) 0 && Main.tile[index90, index91 + 2].wall == (ushort) 0 && Main.tile[index90, index91 + 3].wall == (ushort) 0 && Main.tile[index90, index91 + 4].wall == (ushort) 0 && Main.tile[index90 - 1, index91].wall == (ushort) 0 && Main.tile[index90 + 1, index91].wall == (ushort) 0 && Main.tile[index90 - 2, index91].wall == (ushort) 0 && Main.tile[index90 + 2, index91].wall == (ushort) 0 && !Main.tile[index90, index91].active() && !Main.tile[index90, index91 + 1].active() && !Main.tile[index90, index91 + 2].active() && !Main.tile[index90, index91 + 3].active()) + else if (Main.tile[index84, index85].wall == (byte) 0 && Main.tile[index84, index85 + 1].wall == (byte) 0 && Main.tile[index84, index85 + 2].wall == (byte) 0 && Main.tile[index84, index85 + 3].wall == (byte) 0 && Main.tile[index84, index85 + 4].wall == (byte) 0 && Main.tile[index84 - 1, index85].wall == (byte) 0 && Main.tile[index84 + 1, index85].wall == (byte) 0 && Main.tile[index84 - 2, index85].wall == (byte) 0 && Main.tile[index84 + 2, index85].wall == (byte) 0 && !Main.tile[index84, index85].active() && !Main.tile[index84, index85 + 1].active() && !Main.tile[index84, index85 + 2].active() && !Main.tile[index84, index85 + 3].active()) flag = true; } } - for (int index92 = Main.maxTilesX - 5; index92 >= 5; --index92) + for (int index86 = Main.maxTilesX - 5; index86 >= 5; --index86) { - float num150 = (float) index92 / (float) Main.maxTilesX; - progress.Set((float) (1.0 - 0.5 * (double) num150)); + float num = (float) index86 / (float) Main.maxTilesX; + progress.Set((float) (1.0 - 0.5 * (double) num)); bool flag = true; - for (int index93 = 0; (double) index93 < Main.worldSurface; ++index93) + for (int index87 = 0; (double) index87 < Main.worldSurface; ++index87) { if (flag) { - if (Main.tile[index92, index93].wall == (ushort) 2 || Main.tile[index92, index93].wall == (ushort) 40 || Main.tile[index92, index93].wall == (ushort) 64) - Main.tile[index92, index93].wall = (ushort) 0; - if (Main.tile[index92, index93].type != (ushort) 53) + if (Main.tile[index86, index87].wall == (byte) 2 || Main.tile[index86, index87].wall == (byte) 40 || Main.tile[index86, index87].wall == (byte) 64) + Main.tile[index86, index87].wall = (byte) 0; + if (Main.tile[index86, index87].type != (ushort) 53) { - if (Main.tile[index92 - 1, index93].wall == (ushort) 2 || Main.tile[index92 - 1, index93].wall == (ushort) 40 || Main.tile[index92 - 1, index93].wall == (ushort) 40) - Main.tile[index92 - 1, index93].wall = (ushort) 0; - if ((Main.tile[index92 - 2, index93].wall == (ushort) 2 || Main.tile[index92 - 2, index93].wall == (ushort) 40 || Main.tile[index92 - 2, index93].wall == (ushort) 40) && WorldGen.genRand.Next(2) == 0) - Main.tile[index92 - 2, index93].wall = (ushort) 0; - if ((Main.tile[index92 - 3, index93].wall == (ushort) 2 || Main.tile[index92 - 3, index93].wall == (ushort) 40 || Main.tile[index92 - 3, index93].wall == (ushort) 40) && WorldGen.genRand.Next(2) == 0) - Main.tile[index92 - 3, index93].wall = (ushort) 0; - if (Main.tile[index92 + 1, index93].wall == (ushort) 2 || Main.tile[index92 + 1, index93].wall == (ushort) 40 || Main.tile[index92 + 1, index93].wall == (ushort) 40) - Main.tile[index92 + 1, index93].wall = (ushort) 0; - if ((Main.tile[index92 + 2, index93].wall == (ushort) 2 || Main.tile[index92 + 2, index93].wall == (ushort) 40 || Main.tile[index92 + 2, index93].wall == (ushort) 40) && WorldGen.genRand.Next(2) == 0) - Main.tile[index92 + 2, index93].wall = (ushort) 0; - if ((Main.tile[index92 + 3, index93].wall == (ushort) 2 || Main.tile[index92 + 3, index93].wall == (ushort) 40 || Main.tile[index92 + 3, index93].wall == (ushort) 40) && WorldGen.genRand.Next(2) == 0) - Main.tile[index92 + 3, index93].wall = (ushort) 0; - if (Main.tile[index92, index93].active()) + if (Main.tile[index86 - 1, index87].wall == (byte) 2 || Main.tile[index86 - 1, index87].wall == (byte) 40 || Main.tile[index86 - 1, index87].wall == (byte) 40) + Main.tile[index86 - 1, index87].wall = (byte) 0; + if ((Main.tile[index86 - 2, index87].wall == (byte) 2 || Main.tile[index86 - 2, index87].wall == (byte) 40 || Main.tile[index86 - 2, index87].wall == (byte) 40) && WorldGen.genRand.Next(2) == 0) + Main.tile[index86 - 2, index87].wall = (byte) 0; + if ((Main.tile[index86 - 3, index87].wall == (byte) 2 || Main.tile[index86 - 3, index87].wall == (byte) 40 || Main.tile[index86 - 3, index87].wall == (byte) 40) && WorldGen.genRand.Next(2) == 0) + Main.tile[index86 - 3, index87].wall = (byte) 0; + if (Main.tile[index86 + 1, index87].wall == (byte) 2 || Main.tile[index86 + 1, index87].wall == (byte) 40 || Main.tile[index86 + 1, index87].wall == (byte) 40) + Main.tile[index86 + 1, index87].wall = (byte) 0; + if ((Main.tile[index86 + 2, index87].wall == (byte) 2 || Main.tile[index86 + 2, index87].wall == (byte) 40 || Main.tile[index86 + 2, index87].wall == (byte) 40) && WorldGen.genRand.Next(2) == 0) + Main.tile[index86 + 2, index87].wall = (byte) 0; + if ((Main.tile[index86 + 3, index87].wall == (byte) 2 || Main.tile[index86 + 3, index87].wall == (byte) 40 || Main.tile[index86 + 3, index87].wall == (byte) 40) && WorldGen.genRand.Next(2) == 0) + Main.tile[index86 + 3, index87].wall = (byte) 0; + if (Main.tile[index86, index87].active()) flag = false; } } - else if (Main.tile[index92, index93].wall == (ushort) 0 && Main.tile[index92, index93 + 1].wall == (ushort) 0 && Main.tile[index92, index93 + 2].wall == (ushort) 0 && Main.tile[index92, index93 + 3].wall == (ushort) 0 && Main.tile[index92, index93 + 4].wall == (ushort) 0 && Main.tile[index92 - 1, index93].wall == (ushort) 0 && Main.tile[index92 + 1, index93].wall == (ushort) 0 && Main.tile[index92 - 2, index93].wall == (ushort) 0 && Main.tile[index92 + 2, index93].wall == (ushort) 0 && !Main.tile[index92, index93].active() && !Main.tile[index92, index93 + 1].active() && !Main.tile[index92, index93 + 2].active() && !Main.tile[index92, index93 + 3].active()) + else if (Main.tile[index86, index87].wall == (byte) 0 && Main.tile[index86, index87 + 1].wall == (byte) 0 && Main.tile[index86, index87 + 2].wall == (byte) 0 && Main.tile[index86, index87 + 3].wall == (byte) 0 && Main.tile[index86, index87 + 4].wall == (byte) 0 && Main.tile[index86 - 1, index87].wall == (byte) 0 && Main.tile[index86 + 1, index87].wall == (byte) 0 && Main.tile[index86 - 2, index87].wall == (byte) 0 && Main.tile[index86 + 2, index87].wall == (byte) 0 && !Main.tile[index86, index87].active() && !Main.tile[index86, index87 + 1].active() && !Main.tile[index86, index87 + 2].active() && !Main.tile[index86, index87 + 3].active()) flag = true; } } })); - WorldGen.AddGenerationPass("Pyramids", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Pyramids", (WorldGenLegacyMethod) (progress => { - for (int index94 = 0; index94 < numPyr; ++index94) + for (int index88 = 0; index88 < numPyr; ++index88) { - int i = PyrX[index94]; - int index95 = PyrY[index94]; + int i = PyrX[index88]; + int index89 = PyrY[index88]; if (i > 300 && i < Main.maxTilesX - 300 && (dungeonSide >= 0 || (double) i >= (double) WorldGen.dungeonX + (double) Main.maxTilesX * 0.15) && (dungeonSide <= 0 || (double) i <= (double) WorldGen.dungeonX - (double) Main.maxTilesX * 0.15)) { - while (!Main.tile[i, index95].active() && (double) index95 < Main.worldSurface) - ++index95; - if ((double) index95 < Main.worldSurface && Main.tile[i, index95].type == (ushort) 53) + while (!Main.tile[i, index89].active() && (double) index89 < Main.worldSurface) + ++index89; + if ((double) index89 < Main.worldSurface && Main.tile[i, index89].type == (ushort) 53) { - int num151 = Main.maxTilesX; - for (int index96 = 0; index96 < index94; ++index96) + int num110 = Main.maxTilesX; + for (int index90 = 0; index90 < index88; ++index90) { - int num152 = Math.Abs(i - PyrX[index96]); - if (num152 < num151) - num151 = num152; + int num111 = Math.Abs(i - PyrX[index90]); + if (num111 < num110) + num110 = num111; } - int num153 = 220; - if (WorldGen.drunkWorldGen) - num153 /= 2; - if (num151 >= num153) + if (num110 >= 250) { - int j = index95 - 1; + int j = index89 - 1; WorldGen.Pyramid(i, j); } } } } })); - WorldGen.AddGenerationPass("Dirt Rock Wall Runner", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Dirt Rock Wall Runner", (WorldGenLegacyMethod) (progress => { for (int index = 0; index < Main.maxTilesX; ++index) { int i = WorldGen.genRand.Next(10, Main.maxTilesX - 10); int j = WorldGen.genRand.Next(10, (int) Main.worldSurface); - if (Main.tile[i, j].wall == (ushort) 2) + if (Main.tile[i, j].wall == (byte) 2) WorldGen.DirtyRockRunner(i, j); } })); - WorldGen.AddGenerationPass("Living Trees", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Living Trees", (WorldGenLegacyMethod) (progress => { - int num154 = 200; - float num155 = (float) (Main.maxTilesX / 4200); - int num156 = WorldGen.genRand.Next(0, (int) (2.0 * (double) num155) + 1); - if (num156 == 0 && WorldGen.genRand.Next(2) == 0) - ++num156; - if (WorldGen.drunkWorldGen) - num156 += (int) (2.0 * (double) num155); - for (int index97 = 0; index97 < num156; ++index97) + int num112 = WorldGen.genRand.Next(0, (int) (3.0 * (double) (Main.maxTilesX / 4200))); + for (int index91 = 0; index91 < num112; ++index91) { - bool flag16 = false; - int num157 = 0; - while (!flag16) + bool flag10 = false; + int num113 = 0; + while (!flag10) { - ++num157; - if (num157 > Main.maxTilesX / 2) - flag16 = true; - int i6 = WorldGen.genRand.Next(WorldGen.beachDistance, Main.maxTilesX - WorldGen.beachDistance); - if (i6 <= Main.maxTilesX / 2 - num154 || i6 >= Main.maxTilesX / 2 + num154) + ++num113; + if (num113 > 1000) + flag10 = true; + int i = WorldGen.genRand.Next(300, Main.maxTilesX - 300); + if (i <= Main.maxTilesX / 2 - 100 || i >= Main.maxTilesX / 2 + 100) { - int index98 = 0; - while (!Main.tile[i6, index98].active() && (double) index98 < Main.worldSurface) - ++index98; - if (Main.tile[i6, index98].type == (ushort) 0) + int index92 = 0; + while (!Main.tile[i, index92].active() && (double) index92 < Main.worldSurface) + ++index92; + if (Main.tile[i, index92].type == (ushort) 0) { - int j5 = index98 - 1; - if (j5 > 150) + int j = index92 - 1; + if (j > 150) { - bool flag17 = true; - for (int index99 = i6 - 50; index99 < i6 + 50; ++index99) + bool flag11 = true; + for (int index93 = i - 50; index93 < i + 50; ++index93) { - for (int index100 = j5 - 50; index100 < j5 + 50; ++index100) + for (int index94 = j - 50; index94 < j + 50; ++index94) { - if (Main.tile[index99, index100].active()) + if (Main.tile[index93, index94].active()) { - switch (Main.tile[index99, index100].type) + switch (Main.tile[index93, index94].type) { case 41: case 43: case 44: case 189: case 196: - case 460: - case 481: - case 482: - case 483: - flag17 = false; + flag11 = false; continue; default: continue; @@ -6994,78 +5257,8 @@ namespace Terraria } } } - for (int index101 = 0; index101 < WorldGen.numMCaves; ++index101) - { - if (i6 > WorldGen.mCaveX[index101] - 50 && i6 < WorldGen.mCaveX[index101] + 50) - { - flag17 = false; - break; - } - } - if (flag17) - { - flag16 = WorldGen.GrowLivingTree(i6, j5); - if (flag16) - { - for (int index102 = -1; index102 <= 1; ++index102) - { - if (index102 != 0) - { - int i7 = i6; - int num158 = WorldGen.genRand.Next(4); - if (WorldGen.drunkWorldGen) - num158 += WorldGen.genRand.Next(2, 5); - for (int index103 = 0; index103 < num158; ++index103) - { - i7 += WorldGen.genRand.Next(13, 31) * index102; - if (i7 <= Main.maxTilesX / 2 - num154 || i7 >= Main.maxTilesX / 2 + num154) - { - int j6 = j5; - if (Main.tile[i7, j6].active()) - { - while (Main.tile[i7, j6].active()) - --j6; - } - else - { - while (!Main.tile[i7, j6].active()) - ++j6; - --j6; - } - bool flag18 = true; - for (int index104 = i6 - 50; index104 < i6 + 50; ++index104) - { - for (int index105 = j5 - 50; index105 < j5 + 50; ++index105) - { - if (Main.tile[index104, index105].active()) - { - switch (Main.tile[index104, index105].type) - { - case 41: - case 43: - case 44: - case 189: - case 196: - case 460: - case 481: - case 482: - case 483: - flag18 = false; - continue; - default: - continue; - } - } - } - } - if (flag18) - WorldGen.GrowLivingTree(i7, j6, true); - } - } - } - } - } - } + if (flag11) + flag10 = WorldGen.GrowLivingTree(i, j); } } } @@ -7073,60 +5266,49 @@ namespace Terraria } Main.tileSolid[192] = false; })); - WorldGen.AddGenerationPass("Wood Tree Walls", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Wood Tree Walls", (WorldGenLegacyMethod) (progress => { - for (int index106 = 25; index106 < Main.maxTilesX - 25; ++index106) + for (int index95 = 25; index95 < Main.maxTilesX - 25; ++index95) { - for (int index107 = 25; (double) index107 < Main.worldSurface; ++index107) + for (int index96 = 25; (double) index96 < Main.worldSurface; ++index96) { - if (Main.tile[index106, index107].type == (ushort) 191 || Main.tile[index106, index107 - 1].type == (ushort) 191 || Main.tile[index106 - 1, index107].type == (ushort) 191 || Main.tile[index106 + 1, index107].type == (ushort) 191 || Main.tile[index106, index107 + 1].type == (ushort) 191) + if (Main.tile[index95, index96].type == (ushort) 191 || Main.tile[index95, index96 - 1].type == (ushort) 191 || Main.tile[index95 - 1, index96].type == (ushort) 191 || Main.tile[index95 + 1, index96].type == (ushort) 191 || Main.tile[index95, index96 + 1].type == (ushort) 191) { bool flag = true; - for (int index108 = index106 - 1; index108 <= index106 + 1; ++index108) + for (int index97 = index95 - 1; index97 <= index95 + 1; ++index97) { - for (int index109 = index107 - 1; index109 <= index107 + 1; ++index109) + for (int index98 = index96 - 1; index98 <= index96 + 1; ++index98) { - if (index108 != index106 && index109 != index107 && Main.tile[index108, index109].type != (ushort) 191 && Main.tile[index108, index109].wall != (ushort) 244) + if (index97 != index95 && index98 != index96 && Main.tile[index97, index98].type != (ushort) 191 && Main.tile[index97, index98].wall != (byte) 78) flag = false; } } if (flag) - Main.tile[index106, index107].wall = (ushort) 244; + Main.tile[index95, index96].wall = (byte) 78; } } } })); - WorldGen.AddGenerationPass("Altars", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Altars", (WorldGenLegacyMethod) (progress => { - Main.tileSolid[484] = false; progress.Message = Lang.gen[26].Value; - int num159 = (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 1.99999994947575E-05); - for (int index110 = 0; index110 < num159; ++index110) + int num = (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 1.99999994947575E-05); + for (int index99 = 0; index99 < num; ++index99) { - progress.Set((float) index110 / (float) num159); - for (int index111 = 0; index111 < 10000; ++index111) + progress.Set((float) index99 / (float) num); + for (int index100 = 0; index100 < 10000; ++index100) { - int x = WorldGen.genRand.Next(281, Main.maxTilesX - 3 - 280); - while ((double) x > (double) Main.maxTilesX * 0.45 && (double) x < (double) Main.maxTilesX * 0.55) - x = WorldGen.genRand.Next(281, Main.maxTilesX - 3 - 280); - int y; - for (y = (int) (Main.worldSurface * 2.0 + Main.rockLayer) / 3; WorldGen.oceanDepths(x, y); y = (int) (Main.worldSurface * 2.0 + Main.rockLayer) / 3) - { - x = WorldGen.genRand.Next(281, Main.maxTilesX - 3 - 280); - while ((double) x > (double) Main.maxTilesX * 0.45 && (double) x < (double) Main.maxTilesX * 0.55) - x = WorldGen.genRand.Next(281, Main.maxTilesX - 3 - 280); - } + int x = WorldGen.genRand.Next(1, Main.maxTilesX - 3); + int y = (int) (worldSurfaceHigh + 20.0); int style = WorldGen.crimson ? 1 : 0; - if (!WorldGen.IsTileNearby(x, y, 26, 3)) - WorldGen.Place3x2(x, y, (ushort) 26, style); + WorldGen.Place3x2(x, y, (ushort) 26, style); if (Main.tile[x, y].type == (ushort) 26) break; } } })); - WorldGen.AddGenerationPass("Wet Jungle", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Wet Jungle", (WorldGenLegacyMethod) (progress => { - progress.Set(1f); for (int index = 0; index < Main.maxTilesX; ++index) { i2 = index; @@ -7145,481 +5327,308 @@ namespace Terraria } } })); - WorldGen.AddGenerationPass("Jungle Temple", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Remove Water From Sand", (WorldGenLegacyMethod) (progress => { - int num160 = 0; - progress.Message = Lang.gen[70].Value; - long num161 = 0; - double num162 = 0.25; - while (true) - { - do - { - int y = WorldGen.genRand.Next((int) Main.rockLayer, Main.maxTilesY - 500); - int x = (int) (((WorldGen.genRand.NextDouble() * num162 + 0.1) * (double) -dungeonSide + 0.5) * (double) Main.maxTilesX); - if (Main.tile[x, y].active() && Main.tile[x, y].type == (ushort) 60) - { - WorldGen.makeTemple(x, y); - return; - } - } - while (num161++ <= 2000000L); - if (num162 == 0.35) - { - ++num160; - if (num160 > 10) - break; - } - num162 = Math.Min(0.35, num162 + 0.05); - num161 = 0L; - } - })); - WorldGen.AddGenerationPass("Hives", (WorldGenLegacyMethod) ((progress, passConfig) => - { - progress.Message = Lang.gen[71].Value; - float num163 = (float) (Main.maxTilesX / 4200); - float num164 = (float) (1 + WorldGen.genRand.Next((int) (5.0 * (double) num163), (int) (8.0 * (double) num163))); - if (WorldGen.drunkWorldGen) - num164 *= 0.667f; - int num165 = 10000; - HiveBiome biome = configuration.CreateBiome(); label_10: - while ((double) num164 > 0.0 && num165 > 0) + for (int index101 = 400; index101 < Main.maxTilesX - 400; ++index101) { - --num165; - Point origin = WorldGen.RandomWorldPoint((int) (Main.worldSurface + Main.rockLayer) >> 1, 20, 300, 20); - if (WorldGen.drunkWorldGen) - WorldGen.RandomWorldPoint((int) Main.worldSurface, 20, 300, 20); - if (biome.Place(origin, structures)) + i2 = index101; + for (int worldSurfaceLow = (int) WorldGen.worldSurfaceLow; (double) worldSurfaceLow < Main.worldSurface - 1.0; ++worldSurfaceLow) { - --num164; - int num166 = WorldGen.genRand.Next(5); - int num167 = 0; - int num168 = 10000; - while (true) + if (Main.tile[i2, worldSurfaceLow].active()) { - int x; - int y; - do - { - if (num167 < num166 && num168 > 0) - { - float num169 = (float) ((double) WorldGen.genRand.NextFloat() * 60.0 + 30.0); - double a; - x = (int) (Math.Cos(a = (double) WorldGen.genRand.NextFloat() * 6.28318548202515) * (double) num169) + origin.X; - y = (int) (Math.Sin(a) * (double) num169) + origin.Y; - --num168; - } - else - goto label_10; - } - while (x <= 50 || x >= Main.maxTilesX - 50 || !biome.Place(new Point(x, y), structures)); - ++num167; - } - } - } - })); - WorldGen.AddGenerationPass("Jungle Chests", (WorldGenLegacyMethod) ((progress, passConfig) => - { - WorldGen.genRand.Next(40, Main.maxTilesX - 40); - WorldGen.genRand.Next((int) (Main.worldSurface + Main.rockLayer) / 2, Main.maxTilesY - 400); - float num170 = (float) WorldGen.genRand.Next(7, 12) * (float) (Main.maxTilesX / 4200); - int num171 = 0; - for (int index112 = 0; (double) index112 < (double) num170; ++index112) - { - bool flag19 = true; - while (flag19) - { - ++num171; - int index113 = WorldGen.genRand.Next(40, Main.maxTilesX / 2 - 40); - if (dungeonSide < 0) - index113 += Main.maxTilesX / 2; - int index114 = WorldGen.genRand.Next((int) (Main.worldSurface + Main.rockLayer) / 2, Main.maxTilesY - 400); - if (Main.tile[index113, index114].type == (ushort) 60) - { - int num172 = 30; - flag19 = false; - for (int index115 = index113 - num172; index115 < index113 + num172; index115 += 3) - { - for (int index116 = index114 - num172; index116 < index114 + num172; index116 += 3) - { - if (Main.tile[index115, index116].active() && (Main.tile[index115, index116].type == (ushort) 225 || Main.tile[index115, index116].type == (ushort) 229 || Main.tile[index115, index116].type == (ushort) 226 || Main.tile[index115, index116].type == (ushort) 119 || Main.tile[index115, index116].type == (ushort) 120)) - flag19 = true; - if (Main.tile[index115, index116].wall == (ushort) 86 || Main.tile[index115, index116].wall == (ushort) 87) - flag19 = true; - } - } - } - if (!flag19) - { - int num173 = WorldGen.genRand.Next(2, 4); - int num174 = WorldGen.genRand.Next(2, 4); - ushort num175 = 0; - switch (jungleHut) - { - case 45: - num175 = (ushort) 10; - break; - case 119: - num175 = (ushort) 23; - break; - case 120: - num175 = (ushort) 24; - break; - case 158: - num175 = (ushort) 42; - break; - case 175: - num175 = (ushort) 45; - break; - } - for (int index117 = index113 - num173 - 1; index117 <= index113 + num173 + 1; ++index117) - { - for (int index118 = index114 - num174 - 1; index118 <= index114 + num174 + 1; ++index118) - { - Main.tile[index117, index118].active(true); - Main.tile[index117, index118].type = jungleHut; - Main.tile[index117, index118].liquid = (byte) 0; - Main.tile[index117, index118].lava(false); - } - } - for (int index119 = index113 - num173; index119 <= index113 + num173; ++index119) - { - for (int index120 = index114 - num174; index120 <= index114 + num174; ++index120) - { - Main.tile[index119, index120].active(false); - Main.tile[index119, index120].wall = num175; - } - } - bool flag20 = false; - int num176 = 0; - while (!flag20 && num176 < 100) - { - ++num176; - int i = WorldGen.genRand.Next(index113 - num173, index113 + num173 + 1); - int j = WorldGen.genRand.Next(index114 - num174, index114 + num174 - 2); - WorldGen.PlaceTile(i, j, 4, true, style: 3); - if (Main.tile[i, j].type == (ushort) 4) - flag20 = true; - } - for (int index121 = index113 - num173 - 1; index121 <= index113 + num173 + 1; ++index121) - { - for (int index122 = index114 + num174 - 2; index122 <= index114 + num174; ++index122) - Main.tile[index121, index122].active(false); - } - for (int index123 = index113 - num173 - 1; index123 <= index113 + num173 + 1; ++index123) - { - for (int index124 = index114 + num174 - 2; index124 <= index114 + num174 - 1; ++index124) - Main.tile[index123, index124].active(false); - } - for (int index125 = index113 - num173 - 1; index125 <= index113 + num173 + 1; ++index125) - { - int num177 = 4; - for (int index126 = index114 + num174 + 2; !Main.tile[index125, index126].active() && index126 < Main.maxTilesY && num177 > 0; --num177) - { - Main.tile[index125, index126].active(true); - Main.tile[index125, index126].type = (ushort) 59; - ++index126; - } - } - int num178 = num173 - WorldGen.genRand.Next(1, 3); - int index127 = index114 - num174 - 2; - while (num178 > -1) - { - for (int index128 = index113 - num178 - 1; index128 <= index113 + num178 + 1; ++index128) - { - Main.tile[index128, index127].active(true); - Main.tile[index128, index127].type = jungleHut; - } - num178 -= WorldGen.genRand.Next(1, 3); - --index127; - } - WorldGen.JChestX[WorldGen.numJChests] = index113; - WorldGen.JChestY[WorldGen.numJChests] = index114; - structures.AddProtectedStructure(new Microsoft.Xna.Framework.Rectangle(index113 - num178 - 1, index114 - num174 - 1, index113 + num178 + 1, index114 + num174 + 1)); - ++WorldGen.numJChests; - num171 = 0; - } - else if (num171 > Main.maxTilesX * 10) - { - ++index112; - num171 = 0; - break; - } - } - } - Main.tileSolid[137] = false; - })); - WorldGen.AddGenerationPass("Settle Liquids", (WorldGenLegacyMethod) ((progress, passConfig) => - { - progress.Message = Lang.gen[27].Value; - if (WorldGen.notTheBees) - WorldGen.NotTheBees(); - Liquid.worldGenTilesIgnoreWater(true); - Liquid.QuickWater(3); - WorldGen.WaterCheck(); - int num179 = 0; - Liquid.quickSettle = true; - while (num179 < 10) - { - int num180 = Liquid.numLiquid + LiquidBuffer.numLiquidBuffer; - ++num179; - float num181 = 0.0f; - while (Liquid.numLiquid > 0) - { - float num182 = (float) (num180 - (Liquid.numLiquid + LiquidBuffer.numLiquidBuffer)) / (float) num180; - if (Liquid.numLiquid + LiquidBuffer.numLiquidBuffer > num180) - num180 = Liquid.numLiquid + LiquidBuffer.numLiquidBuffer; - if ((double) num182 > (double) num181) - num181 = num182; - else - num182 = num181; - if (num179 == 1) - progress.Set((float) ((double) num182 / 3.0 + 0.330000013113022)); - int num183 = 10; - if (num179 > num183) - ; - Liquid.UpdateLiquid(); - } - WorldGen.WaterCheck(); - progress.Set((float) ((double) num179 * 0.100000001490116 / 3.0 + 0.660000026226044)); - } - Liquid.quickSettle = false; - Liquid.worldGenTilesIgnoreWater(false); - Main.tileSolid[484] = false; - })); - WorldGen.AddGenerationPass("Remove Water From Sand", (WorldGenLegacyMethod) ((progress, passConfig) => - { - progress.Set(1f); -label_11: - for (int index129 = 400; index129 < Main.maxTilesX - 400; ++index129) - { - i2 = index129; - for (int index130 = 100; (double) index130 < Main.worldSurface - 1.0; ++index130) - { - if (Main.tile[i2, index130].active()) - { - switch (Main.tile[i2, index130].type) + switch (Main.tile[i2, worldSurfaceLow].type) { case 53: - case 151: case 396: case 397: case 404: case 407: - int index131 = index130; - while (index131 > 100) + int index102 = worldSurfaceLow; + while ((double) index102 > WorldGen.worldSurfaceLow) { - --index131; - if (!Main.tile[i2, index131].active()) - Main.tile[i2, index131].liquid = (byte) 0; - else - break; + --index102; + Main.tile[i2, index102].liquid = (byte) 0; } - goto label_11; + goto label_10; default: - goto label_11; + goto label_10; } } } } Main.tileSolid[192] = true; })); - WorldGen.AddGenerationPass("Oasis", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Jungle Temple", (WorldGenLegacyMethod) (progress => { - if (WorldGen.notTheBees) - return; - progress.Set(1f); - int num184 = Main.maxTilesX / 2100 + WorldGen.genRand.Next(2); - for (int index = 0; index < num184; ++index) + progress.Message = Lang.gen[70].Value; + bool flag = true; + while (flag) { - int minValue = WorldGen.beachDistance + 300; - int num185 = Main.maxTilesX * 2; - while (num185 > 0) + int y = WorldGen.genRand.Next((int) Main.rockLayer, Main.maxTilesY - 500); + int x = dungeonSide >= 0 ? WorldGen.genRand.Next((int) ((double) Main.maxTilesX * 0.15), (int) ((double) Main.maxTilesX * 0.4)) : WorldGen.genRand.Next((int) ((double) Main.maxTilesX * 0.6), (int) ((double) Main.maxTilesX * 0.85)); + if (Main.tile[x, y].active() && Main.tile[x, y].type == (ushort) 60) { - --num185; - if (WorldGen.PlaceOasis(WorldGen.genRand.Next(minValue, Main.maxTilesX - minValue), WorldGen.genRand.Next(100, (int) Main.worldSurface))) - num185 = -1; + flag = false; + WorldGen.makeTemple(x, y); } } })); - WorldGen.AddGenerationPass("Shell Piles", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Hives", (WorldGenLegacyMethod) (progress => { - if (WorldGen.notTheBees) - return; - progress.Set(1f); - if (WorldGen.genRand.Next(2) == 0) + progress.Message = Lang.gen[71].Value; + float num114 = (float) (Main.maxTilesX / 4200); + float num115 = (float) (1 + WorldGen.genRand.Next((int) (5.0 * (double) num114), (int) (8.0 * (double) num114))); + int num116 = 10000; +label_6: + while ((double) num115 > 0.0 && num116 > 0) { - int num186 = shellStartXLeft; - int num187 = shellStartYLeft; - for (int index132 = num186 - 20; index132 <= num186 + 20; ++index132) + --num116; + Point origin = WorldGen.RandomWorldPoint((int) (Main.worldSurface + Main.rockLayer) >> 1, 20, 300, 20); + if (Terraria.World.Generation.Biomes.Place(origin, structures)) { - for (int index133 = num187 - 10; index133 <= num187 + 10; ++index133) + --num115; + int num117 = WorldGen.genRand.Next(5); + int num118 = 0; + int num119 = 10000; + while (true) { - if (Main.tile[index132, index133].active() && Main.tile[index132, index133].type == (ushort) 53 && !Main.tile[index132, index133 - 1].active() && Main.tile[index132, index133 - 1].liquid == (byte) 0 && !Main.tile[index132 - 1, index133].active() && Main.tile[index132 - 1, index133].liquid > (byte) 0) + int x; + int y; + do { - shellStartXLeft = index132; - shellStartYLeft = index133; + if (num118 < num117 && num119 > 0) + { + float num120 = (float) ((double) WorldGen.genRand.NextFloat() * 60.0 + 30.0); + double a; + x = (int) (Math.Cos(a = (double) WorldGen.genRand.NextFloat() * 6.28318548202515) * (double) num120) + origin.X; + y = (int) (Math.Sin(a) * (double) num120) + origin.Y; + --num119; + } + else + goto label_6; + } + while (x <= 50 || x >= Main.maxTilesX - 50 || !Terraria.World.Generation.Biomes.Place(x, y, structures)); + ++num118; + } + } + } + })); + WorldGen.AddGenerationPass("Jungle Chests", (WorldGenLegacyMethod) (progress => + { + WorldGen.genRand.Next(40, Main.maxTilesX - 40); + WorldGen.genRand.Next((int) (Main.worldSurface + Main.rockLayer) / 2, Main.maxTilesY - 400); + float num121 = (float) WorldGen.genRand.Next(7, 12) * (float) (Main.maxTilesX / 4200); + for (int index103 = 0; (double) index103 < (double) num121; ++index103) + { + bool flag12 = true; + while (flag12) + { + int index104 = WorldGen.genRand.Next(40, Main.maxTilesX / 2 - 40); + if (dungeonSide < 0) + index104 += Main.maxTilesX / 2; + int index105 = WorldGen.genRand.Next((int) (Main.worldSurface + Main.rockLayer) / 2, Main.maxTilesY - 400); + if (Main.tile[index104, index105].type == (ushort) 60) + { + int num122 = 30; + flag12 = false; + for (int index106 = index104 - num122; index106 < index104 + num122; index106 += 3) + { + for (int index107 = index105 - num122; index107 < index105 + num122; index107 += 3) + { + if (Main.tile[index106, index107].active() && (Main.tile[index106, index107].type == (ushort) 225 || Main.tile[index106, index107].type == (ushort) 229 || Main.tile[index106, index107].type == (ushort) 226 || Main.tile[index106, index107].type == (ushort) 119 || Main.tile[index106, index107].type == (ushort) 120)) + flag12 = false; + if (Main.tile[index106, index107].wall == (byte) 86 || Main.tile[index106, index107].wall == (byte) 87) + flag12 = false; + } } } - } - shellStartYLeft -= 50; - shellStartXLeft -= WorldGen.genRand.Next(5); - if (WorldGen.genRand.Next(2) == 0) - shellStartXLeft -= WorldGen.genRand.Next(10); - if (WorldGen.genRand.Next(3) == 0) - shellStartXLeft -= WorldGen.genRand.Next(15); - if (WorldGen.genRand.Next(4) != 0) - WorldGen.ShellPile(shellStartXLeft, shellStartYLeft); - int maxValue = WorldGen.genRand.Next(2, 4); - if (WorldGen.genRand.Next(maxValue) == 0) - WorldGen.ShellPile(shellStartXLeft - WorldGen.genRand.Next(10, 35), shellStartYLeft); - if (WorldGen.genRand.Next(maxValue) == 0) - WorldGen.ShellPile(shellStartXLeft - WorldGen.genRand.Next(40, 65), shellStartYLeft); - if (WorldGen.genRand.Next(maxValue) == 0) - WorldGen.ShellPile(shellStartXLeft - WorldGen.genRand.Next(70, 95), shellStartYLeft); - if (WorldGen.genRand.Next(maxValue) == 0) - WorldGen.ShellPile(shellStartXLeft - WorldGen.genRand.Next(100, 125), shellStartYLeft); - if (WorldGen.genRand.Next(maxValue) == 0) - WorldGen.ShellPile(shellStartXLeft + WorldGen.genRand.Next(10, 25), shellStartYLeft); - } - if (WorldGen.genRand.Next(2) != 0) - return; - int num188 = shellStartXRight; - int num189 = shellStartYRight; - for (int index134 = num188 - 20; index134 <= num188 + 20; ++index134) - { - for (int index135 = num189 - 10; index135 <= num189 + 10; ++index135) - { - if (Main.tile[index134, index135].active() && Main.tile[index134, index135].type == (ushort) 53 && !Main.tile[index134, index135 - 1].active() && Main.tile[index134, index135 - 1].liquid == (byte) 0 && !Main.tile[index134 + 1, index135].active() && Main.tile[index134 + 1, index135].liquid > (byte) 0) + if (!flag12) { - shellStartXRight = index134; - shellStartYRight = index135; + int num123 = WorldGen.genRand.Next(2, 4); + int num124 = WorldGen.genRand.Next(2, 4); + int num125 = 0; + switch (jungleHut) + { + case 45: + num125 = 10; + break; + case 119: + num125 = 23; + break; + case 120: + num125 = 24; + break; + case 158: + num125 = 42; + break; + case 175: + num125 = 45; + break; + } + for (int index108 = index104 - num123 - 1; index108 <= index104 + num123 + 1; ++index108) + { + for (int index109 = index105 - num124 - 1; index109 <= index105 + num124 + 1; ++index109) + { + Main.tile[index108, index109].active(true); + Main.tile[index108, index109].type = jungleHut; + Main.tile[index108, index109].liquid = (byte) 0; + Main.tile[index108, index109].lava(false); + } + } + for (int index110 = index104 - num123; index110 <= index104 + num123; ++index110) + { + for (int index111 = index105 - num124; index111 <= index105 + num124; ++index111) + { + Main.tile[index110, index111].active(false); + Main.tile[index110, index111].wall = (byte) num125; + } + } + bool flag13 = false; + int num126 = 0; + while (!flag13 && num126 < 100) + { + ++num126; + int i = WorldGen.genRand.Next(index104 - num123, index104 + num123 + 1); + int j = WorldGen.genRand.Next(index105 - num124, index105 + num124 - 2); + WorldGen.PlaceTile(i, j, 4, true, style: 3); + if (Main.tile[i, j].type == (ushort) 4) + flag13 = true; + } + for (int index112 = index104 - num123 - 1; index112 <= index104 + num123 + 1; ++index112) + { + for (int index113 = index105 + num124 - 2; index113 <= index105 + num124; ++index113) + Main.tile[index112, index113].active(false); + } + for (int index114 = index104 - num123 - 1; index114 <= index104 + num123 + 1; ++index114) + { + for (int index115 = index105 + num124 - 2; index115 <= index105 + num124 - 1; ++index115) + Main.tile[index114, index115].active(false); + } + for (int index116 = index104 - num123 - 1; index116 <= index104 + num123 + 1; ++index116) + { + int num127 = 4; + for (int index117 = index105 + num124 + 2; !Main.tile[index116, index117].active() && index117 < Main.maxTilesY && num127 > 0; --num127) + { + Main.tile[index116, index117].active(true); + Main.tile[index116, index117].type = (ushort) 59; + ++index117; + } + } + int num128 = num123 - WorldGen.genRand.Next(1, 3); + int index118 = index105 - num124 - 2; + while (num128 > -1) + { + for (int index119 = index104 - num128 - 1; index119 <= index104 + num128 + 1; ++index119) + { + Main.tile[index119, index118].active(true); + Main.tile[index119, index118].type = jungleHut; + } + num128 -= WorldGen.genRand.Next(1, 3); + --index118; + } + WorldGen.JChestX[WorldGen.numJChests] = index104; + WorldGen.JChestY[WorldGen.numJChests] = index105; + ++WorldGen.numJChests; } } } - shellStartYRight -= 50; - shellStartXRight += WorldGen.genRand.Next(5); - if (WorldGen.genRand.Next(2) == 0) - shellStartXLeft += WorldGen.genRand.Next(10); - if (WorldGen.genRand.Next(3) == 0) - shellStartXLeft += WorldGen.genRand.Next(15); - if (WorldGen.genRand.Next(4) != 0) - WorldGen.ShellPile(shellStartXRight, shellStartYRight); - int maxValue1 = WorldGen.genRand.Next(2, 4); - if (WorldGen.genRand.Next(maxValue1) == 0) - WorldGen.ShellPile(shellStartXRight + WorldGen.genRand.Next(10, 35), shellStartYRight); - if (WorldGen.genRand.Next(maxValue1) == 0) - WorldGen.ShellPile(shellStartXRight + WorldGen.genRand.Next(40, 65), shellStartYRight); - if (WorldGen.genRand.Next(maxValue1) == 0) - WorldGen.ShellPile(shellStartXRight + WorldGen.genRand.Next(70, 95), shellStartYRight); - if (WorldGen.genRand.Next(maxValue1) == 0) - WorldGen.ShellPile(shellStartXRight + WorldGen.genRand.Next(100, 125), shellStartYRight); - if (WorldGen.genRand.Next(maxValue1) != 0) - return; - WorldGen.ShellPile(shellStartXRight - WorldGen.genRand.Next(10, 25), shellStartYRight); + Main.tileSolid[137] = false; })); - WorldGen.AddGenerationPass("Smooth World", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Smooth World", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[60].Value; - Main.tileSolid[(int) WorldGen.crackedType] = true; - for (int index136 = 20; index136 < Main.maxTilesX - 20; ++index136) + for (int index120 = 20; index120 < Main.maxTilesX - 20; ++index120) { - float num190 = (float) index136 / (float) Main.maxTilesX; - progress.Set(num190); - for (int index137 = 20; index137 < Main.maxTilesY - 20; ++index137) + float num = (float) index120 / (float) Main.maxTilesX; + progress.Set(num); + for (int index121 = 20; index121 < Main.maxTilesY - 20; ++index121) { - if (Main.tile[index136, index137].type != (ushort) 48 && Main.tile[index136, index137].type != (ushort) 137 && Main.tile[index136, index137].type != (ushort) 232 && Main.tile[index136, index137].type != (ushort) 191 && Main.tile[index136, index137].type != (ushort) 151 && Main.tile[index136, index137].type != (ushort) 274) + if (Main.tile[index120, index121].type != (ushort) 48 && Main.tile[index120, index121].type != (ushort) 137 && Main.tile[index120, index121].type != (ushort) 232 && Main.tile[index120, index121].type != (ushort) 191 && Main.tile[index120, index121].type != (ushort) 151 && Main.tile[index120, index121].type != (ushort) 274) { - if (!Main.tile[index136, index137 - 1].active() && Main.tile[index136 - 1, index137].type != (ushort) 136 && Main.tile[index136 + 1, index137].type != (ushort) 136) + if (!Main.tile[index120, index121 - 1].active()) { - if (WorldGen.SolidTile(index136, index137) && TileID.Sets.CanBeClearedDuringGeneration[(int) Main.tile[index136, index137].type]) + if (WorldGen.SolidTile(index120, index121) && TileID.Sets.CanBeClearedDuringGeneration[(int) Main.tile[index120, index121].type]) { - if (!Main.tile[index136 - 1, index137].halfBrick() && !Main.tile[index136 + 1, index137].halfBrick() && Main.tile[index136 - 1, index137].slope() == (byte) 0 && Main.tile[index136 + 1, index137].slope() == (byte) 0) + if (!Main.tile[index120 - 1, index121].halfBrick() && !Main.tile[index120 + 1, index121].halfBrick() && Main.tile[index120 - 1, index121].slope() == (byte) 0 && Main.tile[index120 + 1, index121].slope() == (byte) 0) { - if (WorldGen.SolidTile(index136, index137 + 1)) + if (WorldGen.SolidTile(index120, index121 + 1)) { - if (!WorldGen.SolidTile(index136 - 1, index137) && !Main.tile[index136 - 1, index137 + 1].halfBrick() && WorldGen.SolidTile(index136 - 1, index137 + 1) && WorldGen.SolidTile(index136 + 1, index137) && !Main.tile[index136 + 1, index137 - 1].active()) + if (!WorldGen.SolidTile(index120 - 1, index121) && !Main.tile[index120 - 1, index121 + 1].halfBrick() && WorldGen.SolidTile(index120 - 1, index121 + 1) && WorldGen.SolidTile(index120 + 1, index121) && !Main.tile[index120 + 1, index121 - 1].active()) { if (WorldGen.genRand.Next(2) == 0) - WorldGen.SlopeTile(index136, index137, 2); + WorldGen.SlopeTile(index120, index121, 2); else - WorldGen.PoundTile(index136, index137); + WorldGen.PoundTile(index120, index121); } - else if (!WorldGen.SolidTile(index136 + 1, index137) && !Main.tile[index136 + 1, index137 + 1].halfBrick() && WorldGen.SolidTile(index136 + 1, index137 + 1) && WorldGen.SolidTile(index136 - 1, index137) && !Main.tile[index136 - 1, index137 - 1].active()) + else if (!WorldGen.SolidTile(index120 + 1, index121) && !Main.tile[index120 + 1, index121 + 1].halfBrick() && WorldGen.SolidTile(index120 + 1, index121 + 1) && WorldGen.SolidTile(index120 - 1, index121) && !Main.tile[index120 - 1, index121 - 1].active()) { if (WorldGen.genRand.Next(2) == 0) - WorldGen.SlopeTile(index136, index137, 1); + WorldGen.SlopeTile(index120, index121, 1); else - WorldGen.PoundTile(index136, index137); + WorldGen.PoundTile(index120, index121); } - else if (WorldGen.SolidTile(index136 + 1, index137 + 1) && WorldGen.SolidTile(index136 - 1, index137 + 1) && !Main.tile[index136 + 1, index137].active() && !Main.tile[index136 - 1, index137].active()) - WorldGen.PoundTile(index136, index137); - if (WorldGen.SolidTile(index136, index137)) + else if (WorldGen.SolidTile(index120 + 1, index121 + 1) && WorldGen.SolidTile(index120 - 1, index121 + 1) && !Main.tile[index120 + 1, index121].active() && !Main.tile[index120 - 1, index121].active()) + WorldGen.PoundTile(index120, index121); + if (WorldGen.SolidTile(index120, index121)) { - if (WorldGen.SolidTile(index136 - 1, index137) && WorldGen.SolidTile(index136 + 1, index137 + 2) && !Main.tile[index136 + 1, index137].active() && !Main.tile[index136 + 1, index137 + 1].active() && !Main.tile[index136 - 1, index137 - 1].active()) - WorldGen.KillTile(index136, index137); - else if (WorldGen.SolidTile(index136 + 1, index137) && WorldGen.SolidTile(index136 - 1, index137 + 2) && !Main.tile[index136 - 1, index137].active() && !Main.tile[index136 - 1, index137 + 1].active() && !Main.tile[index136 + 1, index137 - 1].active()) - WorldGen.KillTile(index136, index137); - else if (!Main.tile[index136 - 1, index137 + 1].active() && !Main.tile[index136 - 1, index137].active() && WorldGen.SolidTile(index136 + 1, index137) && WorldGen.SolidTile(index136, index137 + 2)) + if (WorldGen.SolidTile(index120 - 1, index121) && WorldGen.SolidTile(index120 + 1, index121 + 2) && !Main.tile[index120 + 1, index121].active() && !Main.tile[index120 + 1, index121 + 1].active() && !Main.tile[index120 - 1, index121 - 1].active()) + WorldGen.KillTile(index120, index121); + else if (WorldGen.SolidTile(index120 + 1, index121) && WorldGen.SolidTile(index120 - 1, index121 + 2) && !Main.tile[index120 - 1, index121].active() && !Main.tile[index120 - 1, index121 + 1].active() && !Main.tile[index120 + 1, index121 - 1].active()) + WorldGen.KillTile(index120, index121); + else if (!Main.tile[index120 - 1, index121 + 1].active() && !Main.tile[index120 - 1, index121].active() && WorldGen.SolidTile(index120 + 1, index121) && WorldGen.SolidTile(index120, index121 + 2)) { if (WorldGen.genRand.Next(5) == 0) - WorldGen.KillTile(index136, index137); + WorldGen.KillTile(index120, index121); else if (WorldGen.genRand.Next(5) == 0) - WorldGen.PoundTile(index136, index137); + WorldGen.PoundTile(index120, index121); else - WorldGen.SlopeTile(index136, index137, 2); + WorldGen.SlopeTile(index120, index121, 2); } - else if (!Main.tile[index136 + 1, index137 + 1].active() && !Main.tile[index136 + 1, index137].active() && WorldGen.SolidTile(index136 - 1, index137) && WorldGen.SolidTile(index136, index137 + 2)) + else if (!Main.tile[index120 + 1, index121 + 1].active() && !Main.tile[index120 + 1, index121].active() && WorldGen.SolidTile(index120 - 1, index121) && WorldGen.SolidTile(index120, index121 + 2)) { if (WorldGen.genRand.Next(5) == 0) - WorldGen.KillTile(index136, index137); + WorldGen.KillTile(index120, index121); else if (WorldGen.genRand.Next(5) == 0) - WorldGen.PoundTile(index136, index137); + WorldGen.PoundTile(index120, index121); else - WorldGen.SlopeTile(index136, index137, 1); + WorldGen.SlopeTile(index120, index121, 1); } } } - if (WorldGen.SolidTile(index136, index137) && !Main.tile[index136 - 1, index137].active() && !Main.tile[index136 + 1, index137].active()) - WorldGen.KillTile(index136, index137); + if (WorldGen.SolidTile(index120, index121) && !Main.tile[index120 - 1, index121].active() && !Main.tile[index120 + 1, index121].active()) + WorldGen.KillTile(index120, index121); } } - else if (!Main.tile[index136, index137].active() && Main.tile[index136, index137 + 1].type != (ushort) 151 && Main.tile[index136, index137 + 1].type != (ushort) 274) + else if (!Main.tile[index120, index121].active() && Main.tile[index120, index121 + 1].type != (ushort) 151 && Main.tile[index120, index121 + 1].type != (ushort) 274) { - if (Main.tile[index136 + 1, index137].type != (ushort) 190 && Main.tile[index136 + 1, index137].type != (ushort) 48 && Main.tile[index136 + 1, index137].type != (ushort) 232 && WorldGen.SolidTile(index136 - 1, index137 + 1) && WorldGen.SolidTile(index136 + 1, index137) && !Main.tile[index136 - 1, index137].active() && !Main.tile[index136 + 1, index137 - 1].active()) + if (Main.tile[index120 + 1, index121].type != (ushort) 190 && Main.tile[index120 + 1, index121].type != (ushort) 48 && Main.tile[index120 + 1, index121].type != (ushort) 232 && WorldGen.SolidTile(index120 - 1, index121 + 1) && WorldGen.SolidTile(index120 + 1, index121) && !Main.tile[index120 - 1, index121].active() && !Main.tile[index120 + 1, index121 - 1].active()) { - if (Main.tile[index136 + 1, index137].type == (ushort) 495) - WorldGen.PlaceTile(index136, index137, (int) Main.tile[index136 + 1, index137].type); - else - WorldGen.PlaceTile(index136, index137, (int) Main.tile[index136, index137 + 1].type); + WorldGen.PlaceTile(index120, index121, (int) Main.tile[index120, index121 + 1].type); if (WorldGen.genRand.Next(2) == 0) - WorldGen.SlopeTile(index136, index137, 2); + WorldGen.SlopeTile(index120, index121, 2); else - WorldGen.PoundTile(index136, index137); + WorldGen.PoundTile(index120, index121); } - if (Main.tile[index136 - 1, index137].type != (ushort) 190 && Main.tile[index136 - 1, index137].type != (ushort) 48 && Main.tile[index136 - 1, index137].type != (ushort) 232 && WorldGen.SolidTile(index136 + 1, index137 + 1) && WorldGen.SolidTile(index136 - 1, index137) && !Main.tile[index136 + 1, index137].active() && !Main.tile[index136 - 1, index137 - 1].active()) + if (Main.tile[index120 - 1, index121].type != (ushort) 190 && Main.tile[index120 - 1, index121].type != (ushort) 48 && Main.tile[index120 - 1, index121].type != (ushort) 232 && WorldGen.SolidTile(index120 + 1, index121 + 1) && WorldGen.SolidTile(index120 - 1, index121) && !Main.tile[index120 + 1, index121].active() && !Main.tile[index120 - 1, index121 - 1].active()) { - if (Main.tile[index136 - 1, index137].type == (ushort) 495) - WorldGen.PlaceTile(index136, index137, (int) Main.tile[index136 - 1, index137].type); - else - WorldGen.PlaceTile(index136, index137, (int) Main.tile[index136, index137 + 1].type); + WorldGen.PlaceTile(index120, index121, (int) Main.tile[index120, index121 + 1].type); if (WorldGen.genRand.Next(2) == 0) - WorldGen.SlopeTile(index136, index137, 1); + WorldGen.SlopeTile(index120, index121, 1); else - WorldGen.PoundTile(index136, index137); + WorldGen.PoundTile(index120, index121); } } } - else if (!Main.tile[index136, index137 + 1].active() && WorldGen.genRand.Next(2) == 0 && WorldGen.SolidTile(index136, index137) && !Main.tile[index136 - 1, index137].halfBrick() && !Main.tile[index136 + 1, index137].halfBrick() && Main.tile[index136 - 1, index137].slope() == (byte) 0 && Main.tile[index136 + 1, index137].slope() == (byte) 0 && WorldGen.SolidTile(index136, index137 - 1)) + else if (!Main.tile[index120, index121 + 1].active() && WorldGen.genRand.Next(2) == 0 && WorldGen.SolidTile(index120, index121) && !Main.tile[index120 - 1, index121].halfBrick() && !Main.tile[index120 + 1, index121].halfBrick() && Main.tile[index120 - 1, index121].slope() == (byte) 0 && Main.tile[index120 + 1, index121].slope() == (byte) 0 && WorldGen.SolidTile(index120, index121 - 1)) { - if (WorldGen.SolidTile(index136 - 1, index137) && !WorldGen.SolidTile(index136 + 1, index137) && WorldGen.SolidTile(index136 - 1, index137 - 1)) - WorldGen.SlopeTile(index136, index137, 3); - else if (WorldGen.SolidTile(index136 + 1, index137) && !WorldGen.SolidTile(index136 - 1, index137) && WorldGen.SolidTile(index136 + 1, index137 - 1)) - WorldGen.SlopeTile(index136, index137, 4); + if (WorldGen.SolidTile(index120 - 1, index121) && !WorldGen.SolidTile(index120 + 1, index121) && WorldGen.SolidTile(index120 - 1, index121 - 1)) + WorldGen.SlopeTile(index120, index121, 3); + else if (WorldGen.SolidTile(index120 + 1, index121) && !WorldGen.SolidTile(index120 - 1, index121) && WorldGen.SolidTile(index120 + 1, index121 - 1)) + WorldGen.SlopeTile(index120, index121, 4); } - if (TileID.Sets.Conversion.Sand[(int) Main.tile[index136, index137].type]) - Tile.SmoothSlope(index136, index137, false); + if (TileID.Sets.Conversion.Sand[(int) Main.tile[index120, index121].type]) + Tile.SmoothSlope(index120, index121, false); } } } @@ -7649,26 +5658,58 @@ label_11: Main.tileSolid[137] = true; Main.tileSolid[190] = false; Main.tileSolid[192] = false; - Main.tileSolid[(int) WorldGen.crackedType] = false; })); - WorldGen.AddGenerationPass("Waterfalls", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Settle Liquids", (WorldGenLegacyMethod) (progress => + { + progress.Message = Lang.gen[27].Value; + Liquid.QuickWater(3); + WorldGen.WaterCheck(); + int num129 = 0; + Liquid.quickSettle = true; + while (num129 < 10) + { + int num130 = Liquid.numLiquid + LiquidBuffer.numLiquidBuffer; + ++num129; + float num131 = 0.0f; + while (Liquid.numLiquid > 0) + { + float num132 = (float) (num130 - (Liquid.numLiquid + LiquidBuffer.numLiquidBuffer)) / (float) num130; + if (Liquid.numLiquid + LiquidBuffer.numLiquidBuffer > num130) + num130 = Liquid.numLiquid + LiquidBuffer.numLiquidBuffer; + if ((double) num132 > (double) num131) + num131 = num132; + else + num132 = num131; + if (num129 == 1) + progress.Set((float) ((double) num132 / 3.0 + 0.330000013113022)); + int num133 = 10; + if (num129 > num133) + ; + Liquid.UpdateLiquid(); + } + WorldGen.WaterCheck(); + progress.Set((float) ((double) num129 * 0.100000001490116 / 3.0 + 0.660000026226044)); + } + Liquid.quickSettle = false; + Main.tileSolid[190] = true; + })); + WorldGen.AddGenerationPass("Waterfalls", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[69].Value; - Main.tileSolid[191] = false; for (int i = 20; i < Main.maxTilesX - 20; ++i) { - float num191 = (float) i / (float) Main.maxTilesX; - progress.Set(num191 * 0.5f); + float num134 = (float) i / (float) Main.maxTilesX; + progress.Set(num134 * 0.5f); for (int j = 20; j < Main.maxTilesY - 20; ++j) { if (WorldGen.SolidTile(i, j) && !Main.tile[i - 1, j].active() && WorldGen.SolidTile(i, j + 1) && !Main.tile[i + 1, j].active() && (Main.tile[i - 1, j].liquid > (byte) 0 || Main.tile[i + 1, j].liquid > (byte) 0)) { bool flag = true; - int num192 = WorldGen.genRand.Next(8, 20); - int num193 = WorldGen.genRand.Next(8, 20); - int num194 = j - num192; - int num195 = num193 + j; - for (int index = num194; index <= num195; ++index) + int num135 = WorldGen.genRand.Next(8, 20); + int num136 = WorldGen.genRand.Next(8, 20); + int num137 = j - num135; + int num138 = num136 + j; + for (int index = num137; index <= num138; ++index) { if (Main.tile[i, index].halfBrick()) flag = false; @@ -7682,8 +5723,8 @@ label_11: } for (int i = 20; i < Main.maxTilesX - 20; ++i) { - float num196 = (float) i / (float) Main.maxTilesX; - progress.Set((float) ((double) num196 * 0.5 + 0.5)); + float num = (float) i / (float) Main.maxTilesX; + progress.Set((float) ((double) num * 0.5 + 0.5)); for (int j = 20; j < Main.maxTilesY - 20; ++j) { if (Main.tile[i, j].type != (ushort) 48 && Main.tile[i, j].type != (ushort) 232 && WorldGen.SolidTile(i, j) && WorldGen.SolidTile(i, j + 1)) @@ -7695,539 +5736,367 @@ label_11: } } } - Main.tileSolid[191] = true; })); - WorldGen.AddGenerationPass("Ice", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Ice", (WorldGenLegacyMethod) (progress => { - if (WorldGen.notTheBees) - WorldGen.NotTheBees(); - progress.Set(1f); for (int i = 10; i < Main.maxTilesX - 10; ++i) { - for (int worldSurface3 = (int) Main.worldSurface; worldSurface3 < Main.maxTilesY - 100; ++worldSurface3) + for (int worldSurface2 = (int) Main.worldSurface; worldSurface2 < Main.maxTilesY - 100; ++worldSurface2) { - if (Main.tile[i, worldSurface3].liquid > (byte) 0 && !Main.tile[i, worldSurface3].lava()) - WorldGen.MakeWateryIceThing(i, worldSurface3); + if (Main.tile[i, worldSurface2].liquid > (byte) 0 && !Main.tile[i, worldSurface2].lava()) + WorldGen.MakeWateryIceThing(i, worldSurface2); } } Main.tileSolid[226] = false; Main.tileSolid[162] = false; })); - WorldGen.AddGenerationPass("Wall Variety", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Wall Variety", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[79].Value; - int num197 = (int) (300.0 * (double) ((float) (Main.maxTilesX * Main.maxTilesY) / 5040000f)); - int num198 = num197; + int num139 = (int) (300.0 * (double) ((float) (Main.maxTilesX * Main.maxTilesY) / 5040000f)); + int num140 = num139; ShapeData data = new ShapeData(); - while (num197 > 0) + while (num139 > 0) { - progress.Set((float) (1.0 - (double) num197 / (double) num198)); + progress.Set((float) (1.0 - (double) num139 / (double) num140)); Point point = WorldGen.RandomWorldPoint((int) worldSurface, 2, 190, 2); Tile tile1 = Main.tile[point.X, point.Y]; Tile tile2 = Main.tile[point.X, point.Y - 1]; - ushort type = 0; - if (tile1.type == (ushort) 60) - type = (ushort) (204 + WorldGen.genRand.Next(4)); - else if (tile1.type == (ushort) 1 && tile2.wall == (ushort) 0) - type = (double) point.Y >= rockLayer ? (point.Y >= WorldGen.lavaLine ? (ushort) (208 + WorldGen.genRand.Next(4)) : (ushort) (212 + WorldGen.genRand.Next(4))) : (ushort) (196 + WorldGen.genRand.Next(4)); - if (tile1.active() && type != (ushort) 0 && !tile2.active()) + byte type = 0; + if (tile1.type == (ushort) 59 || tile1.type == (ushort) 60) + type = (byte) (204 + WorldGen.genRand.Next(4)); + else if (tile1.type == (ushort) 1 && tile2.wall == (byte) 0) + type = (double) point.Y >= rockLayer ? (point.Y >= WorldGen.lavaLine ? (byte) (208 + WorldGen.genRand.Next(4)) : (byte) (212 + WorldGen.genRand.Next(4))) : (byte) (196 + WorldGen.genRand.Next(4)); + if (tile1.active() && type != (byte) 0 && !tile2.active()) { bool foundInvalidTile = false; - bool flag; - if (tile1.type == (ushort) 60) - flag = WorldUtils.Gen(new Point(point.X, point.Y - 1), (GenShape) new ShapeFloodFill(1000), Actions.Chain((GenAction) new Modifiers.IsNotSolid(), new Actions.Blank().Output(data), (GenAction) new Actions.ContinueWrapper(Actions.Chain((GenAction) new Modifiers.IsTouching(true, new ushort[6] - { - (ushort) 147, - (ushort) 161, - (ushort) 396, - (ushort) 397, - (ushort) 70, - (ushort) 191 - }), (GenAction) new Actions.Custom((GenBase.CustomPerUnitAction) ((x, y, args) => - { - foundInvalidTile = true; - return true; - })))))); - else - flag = WorldUtils.Gen(new Point(point.X, point.Y - 1), (GenShape) new ShapeFloodFill(1000), Actions.Chain((GenAction) new Modifiers.IsNotSolid(), new Actions.Blank().Output(data), (GenAction) new Actions.ContinueWrapper(Actions.Chain((GenAction) new Modifiers.IsTouching(true, new ushort[7] - { - (ushort) 60, - (ushort) 147, - (ushort) 161, - (ushort) 396, - (ushort) 397, - (ushort) 70, - (ushort) 191 - }), (GenAction) new Modifiers.IsTouching(true, new ushort[6] - { - (ushort) 147, - (ushort) 161, - (ushort) 396, - (ushort) 397, - (ushort) 70, - (ushort) 191 - }), (GenAction) new Actions.Custom((GenBase.CustomPerUnitAction) ((x, y, args) => - { - foundInvalidTile = true; - return true; - })))))); + bool flag = WorldUtils.Gen(new Point(point.X, point.Y - 1), (GenShape) new ShapeFloodFill(1000), Actions.Chain((GenAction) new Modifiers.IsNotSolid(), new Actions.Blank().Output(data), (GenAction) new Actions.ContinueWrapper(Actions.Chain((GenAction) new Modifiers.IsTouching(true, new ushort[5] + { + (ushort) 60, + (ushort) 147, + (ushort) 161, + (ushort) 396, + (ushort) 397 + }), (GenAction) new Actions.Custom((GenBase.CustomPerUnitAction) ((x, y, args) => + { + foundInvalidTile = true; + return true; + })))))); if (data.Count > 50 & flag && !foundInvalidTile) { - WorldUtils.Gen(new Point(point.X, point.Y), (GenShape) new ModShapes.OuterOutline(data, useInterior: true), Actions.Chain((GenAction) new Modifiers.SkipWalls(new ushort[1] - { - (ushort) 87 - }), (GenAction) new Actions.PlaceWall(type))); - --num197; + WorldUtils.Gen(new Point(point.X, point.Y), (GenShape) new ModShapes.OuterOutline(data, useInterior: true), (GenAction) new Actions.PlaceWall(type)); + --num139; } data.Clear(); } } })); - WorldGen.AddGenerationPass("Life Crystals", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Traps", (WorldGenLegacyMethod) (progress => + { + progress.Message = Lang.gen[34].Value; + for (int index122 = 0; index122 < (int) ((double) Main.maxTilesX * 0.05); ++index122) + { + float num = (float) index122 / ((float) Main.maxTilesX * 0.05f); + progress.Set(num); + for (int index123 = 0; index123 < 1150; ++index123) + { + int x2 = WorldGen.genRand.Next(200, Main.maxTilesX - 200); + int y2 = WorldGen.genRand.Next((int) Main.worldSurface, Main.maxTilesY - 210); + if (Main.tile[x2, y2].wall == (byte) 0 && WorldGen.placeTrap(x2, y2)) + break; + } + } + })); + WorldGen.AddGenerationPass("Life Crystals", (WorldGenLegacyMethod) (progress => { - if (WorldGen.getGoodWorldGen) - Main.tileSolid[56] = false; - if (WorldGen.notTheBees) - WorldGen.NotTheBees(); dub2 = (float) (Main.maxTilesX / 4200); progress.Message = Lang.gen[28].Value; for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 2E-05); ++index) { - float num199 = (float) index / ((float) (Main.maxTilesX * Main.maxTilesY) * 2E-05f); - progress.Set(num199); + float num141 = (float) index / ((float) (Main.maxTilesX * Main.maxTilesY) * 2E-05f); + progress.Set(num141); bool flag = false; - int num200 = 0; + int num142 = 0; while (!flag) { - if (WorldGen.AddLifeCrystal(WorldGen.genRand.Next(40, Main.maxTilesX - 40), WorldGen.genRand.Next((int) (Main.worldSurface * 2.0 + Main.rockLayer) / 3, Main.maxTilesY - 300))) + if (WorldGen.AddLifeCrystal(WorldGen.genRand.Next(40, Main.maxTilesX - 40), WorldGen.genRand.Next((int) (worldSurfaceHigh + 20.0), Main.maxTilesY - 300))) { flag = true; } else { - ++num200; - if (num200 >= 10000) + ++num142; + if (num142 >= 10000) flag = true; } } } Main.tileSolid[225] = false; })); - WorldGen.AddGenerationPass("Statues", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Statues", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[29].Value; - int index138 = 0; - int num201 = (int) ((double) (WorldGen.statueList.Length * 2) * (double) dub2); - for (int index139 = 0; index139 < num201; ++index139) + int index124 = 0; + int num143 = (int) ((double) (WorldGen.statueList.Length * 2) * (double) dub2); + for (int index125 = 0; index125 < num143; ++index125) { - if (index138 >= WorldGen.statueList.Length) - index138 = 0; - int x = (int) WorldGen.statueList[index138].X; - int y1 = (int) WorldGen.statueList[index138].Y; - float num202 = (float) (index139 / num201); - progress.Set(num202); + if (index124 >= WorldGen.statueList.Length) + index124 = 0; + int x = (int) WorldGen.statueList[index124].X; + int y = (int) WorldGen.statueList[index124].Y; + float num144 = (float) (index125 / num143); + progress.Set(num144); bool flag = false; - int num203 = 0; + int num145 = 0; while (!flag) { - int index140 = WorldGen.genRand.Next(20, Main.maxTilesX - 20); - int y2; - for (y2 = WorldGen.genRand.Next((int) (Main.worldSurface * 2.0 + Main.rockLayer) / 3, Main.maxTilesY - 300); WorldGen.oceanDepths(index140, y2); y2 = WorldGen.genRand.Next((int) (Main.worldSurface * 2.0 + Main.rockLayer) / 3, Main.maxTilesY - 300)) - index140 = WorldGen.genRand.Next(20, Main.maxTilesX - 20); - while (!Main.tile[index140, y2].active()) + int index126 = WorldGen.genRand.Next(20, Main.maxTilesX - 20); + int index127 = WorldGen.genRand.Next((int) (worldSurfaceHigh + 20.0), Main.maxTilesY - 300); + while (!Main.tile[index126, index127].active()) + ++index127; + int index128 = index127 - 1; + WorldGen.PlaceTile(index126, index128, x, true, true, style: y); + if (Main.tile[index126, index128].active() && (int) Main.tile[index126, index128].type == x) { - ++y2; - if (y2 >= Main.maxTilesY) - break; + flag = true; + if (WorldGen.StatuesWithTraps.Contains(index124)) + WorldGen.PlaceStatueTrap(index126, index128); + ++index124; } - if (y2 < Main.maxTilesY) + else { - int index141 = y2 - 1; - WorldGen.PlaceTile(index140, index141, x, true, true, style: y1); - if (Main.tile[index140, index141].active() && (int) Main.tile[index140, index141].type == x) - { + ++num145; + if (num145 >= 10000) flag = true; - if (WorldGen.StatuesWithTraps.Contains(index138)) - WorldGen.PlaceStatueTrap(index140, index141); - ++index138; - } - else - { - ++num203; - if (num203 >= 10000) - flag = true; - } } } } })); - WorldGen.AddGenerationPass("Buried Chests", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Buried Chests", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[30].Value; Main.tileSolid[226] = true; Main.tileSolid[162] = true; Main.tileSolid[225] = true; - CaveHouseBiome biome = configuration.CreateBiome(); - int random1 = passConfig.Get("CaveHouseCount").GetRandom(WorldGen.genRand); - int random2 = passConfig.Get("UnderworldChestCount").GetRandom(WorldGen.genRand); - int random3 = passConfig.Get("CaveChestCount").GetRandom(WorldGen.genRand); - int random4 = passConfig.Get("AdditionalDesertHouseCount").GetRandom(WorldGen.genRand); - int num204 = random1 + random2 + random3 + random4; - int num205 = 10000; - for (int index142 = 0; index142 < random3 && num205 > 0; ++index142) + for (int index129 = 0; index129 < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 1.6E-05); ++index129) { - progress.Set((float) index142 / (float) num204); - int index143 = WorldGen.genRand.Next(20, Main.maxTilesX - 20); - int index144 = WorldGen.genRand.Next((int) ((worldSurfaceHigh + 20.0 + Main.rockLayer) / 2.0), Main.maxTilesY - 230); - ushort wall = Main.tile[index143, index144].wall; - if (Main.wallDungeon[(int) wall] || wall == (ushort) 87 || WorldGen.oceanDepths(index143, index144) || !WorldGen.AddBuriedChest(index143, index144)) + float num146 = (float) index129 / ((float) (Main.maxTilesX * Main.maxTilesY) * 1.6E-05f); + progress.Set(num146); + bool flag = false; + int num147 = 0; + while (!flag) { - --num205; - --index142; + float num148 = (float) WorldGen.genRand.Next((int) (5.0 * (double) dub2), (int) (8.0 * (double) dub2 + 1.0)); + int i = WorldGen.genRand.Next(20, Main.maxTilesX - 20); + int j = WorldGen.genRand.Next((int) (worldSurfaceHigh + 20.0), Main.maxTilesY - 230); + if ((double) index129 <= (double) num148) + j = WorldGen.genRand.Next(Main.maxTilesY - 200, Main.maxTilesY - 50); + int num149 = 0; + while (Main.wallDungeon[(int) Main.tile[i, j].wall]) + { + ++num149; + i = WorldGen.genRand.Next(1, Main.maxTilesX); + j = WorldGen.genRand.Next((int) (worldSurfaceHigh + 20.0), Main.maxTilesY - 230); + if (num149 < 1000 && (double) index129 <= (double) num148) + j = WorldGen.genRand.Next(Main.maxTilesY - 200, Main.maxTilesY - 50); + } + if ((double) index129 > (double) num148) + { + for (int index130 = 10; index130 > 0; --index130) + { + if (Terraria.World.Generation.Biomes.Place(WorldGen.genRand.Next(80, Main.maxTilesX - 80), WorldGen.genRand.Next((int) (worldSurfaceHigh + 20.0), Main.maxTilesY - 230), structures)) + { + flag = true; + break; + } + } + } + else if (WorldGen.AddBuriedChest(i, j)) + flag = true; + ++num147; + if (num147 >= 1000) + flag = true; } } - int num206 = 10000; - for (int index = 0; index < random2 && num206 > 0; ++index) + int num = (int) (2.0 * (double) (Main.maxTilesX * Main.maxTilesY) / 5040000.0); + for (int index = 1000; index >= 0 && num >= 0; --index) { - progress.Set((float) (index + random3) / (float) num204); - int i = WorldGen.genRand.Next(20, Main.maxTilesX - 20); - int j = WorldGen.genRand.Next(Main.UnderworldLayer, Main.maxTilesY - 50); - if (Main.wallDungeon[(int) Main.tile[i, j].wall] || !WorldGen.AddBuriedChest(i, j)) - { - --num206; - --index; - } - } - int num207 = 10000; - for (int index = 0; index < random1 && num207 > 0; ++index) - { - progress.Set((float) (index + random3 + random2) / (float) num204); - int x = WorldGen.genRand.Next(80, Main.maxTilesX - 80); - int y = WorldGen.genRand.Next((int) (worldSurfaceHigh + 20.0), Main.maxTilesY - 230); - if (WorldGen.oceanDepths(x, y) || !biome.Place(new Point(x, y), structures)) - { - --num207; - --index; - } - } - int num208 = 10000; - Microsoft.Xna.Framework.Rectangle desertHiveLocation = WorldGen.UndergroundDesertHiveLocation; - if ((double) desertHiveLocation.Y < Main.worldSurface + 26.0) - { - int num209 = (int) Main.worldSurface + 26 - desertHiveLocation.Y; - desertHiveLocation.Y += num209; - desertHiveLocation.Height -= num209; - } - for (int index = 0; index < random4 && num208 > 0; ++index) - { - progress.Set((float) (index + random3 + random2 + random1) / (float) num204); - if (!biome.Place(WorldGen.RandomRectanglePoint(desertHiveLocation), structures)) - { - --num208; - --index; - } + if (Terraria.World.Generation.Biomes.Place(WorldGen.RandomRectanglePoint(WorldGen.UndergroundDesertLocation), structures)) + --num; } Main.tileSolid[226] = false; Main.tileSolid[162] = false; Main.tileSolid[225] = false; })); - WorldGen.AddGenerationPass("Surface Chests", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Surface Chests", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[31].Value; - for (int index145 = 0; index145 < (int) ((double) Main.maxTilesX * 0.005); ++index145) + for (int index = 0; index < (int) ((double) Main.maxTilesX * 0.005); ++index) { - float num210 = (float) index145 / ((float) Main.maxTilesX * 0.005f); - progress.Set(num210); - bool flag21 = false; - int num211 = 0; - while (!flag21) + float num150 = (float) index / ((float) Main.maxTilesX * 0.005f); + progress.Set(num150); + bool flag14 = false; + int num151 = 0; + while (!flag14) { - int index146 = WorldGen.genRand.Next(300, Main.maxTilesX - 300); - int index147; - for (index147 = WorldGen.genRand.Next((int) WorldGen.worldSurfaceLow, (int) Main.worldSurface); WorldGen.oceanDepths(index146, index147); index147 = WorldGen.genRand.Next((int) WorldGen.worldSurfaceLow, (int) Main.worldSurface)) - index146 = WorldGen.genRand.Next(300, Main.maxTilesX - 300); - bool flag22 = false; - if (!Main.tile[index146, index147].active()) + int i = WorldGen.genRand.Next(300, Main.maxTilesX - 300); + int j = WorldGen.genRand.Next((int) WorldGen.worldSurfaceLow, (int) Main.worldSurface); + bool flag15 = false; + if (Main.tile[i, j].wall == (byte) 2 && !Main.tile[i, j].active()) + flag15 = true; + if (flag15 && WorldGen.AddBuriedChest(i, j, notNearOtherChests: true)) { - if (Main.tile[index146, index147].wall == (ushort) 2 || Main.tile[index146, index147].wall == (ushort) 59 || Main.tile[index146, index147].wall == (ushort) 244) - flag22 = true; + flag14 = true; } else { - int num212 = 50; - int num213 = index146; - int num214 = index147; - int maxValue = 1; - for (int index148 = num213 - num212; index148 <= num213 + num212; index148 += 2) - { - for (int index149 = num214 - num212; index149 <= num214 + num212; index149 += 2) - { - if ((double) index149 < Main.worldSurface && !Main.tile[index148, index149].active() && Main.tile[index148, index149].wall == (ushort) 244 && WorldGen.genRand.Next(maxValue) == 0) - { - ++maxValue; - flag22 = true; - index146 = index148; - index147 = index149; - } - } - } - } - if (flag22 && WorldGen.AddBuriedChest(index146, index147, notNearOtherChests: true)) - { - flag21 = true; - } - else - { - ++num211; - if (num211 >= 2000) - flag21 = true; + ++num151; + if (num151 >= 2000) + flag14 = true; } } } })); - WorldGen.AddGenerationPass("Jungle Chests Placement", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Jungle Chests Placement", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[32].Value; - for (int index150 = 0; index150 < WorldGen.numJChests; ++index150) + for (int index131 = 0; index131 < WorldGen.numJChests; ++index131) { - float num215 = (float) (index150 / WorldGen.numJChests); - progress.Set(num215); + float num = (float) (index131 / WorldGen.numJChests); + progress.Set(num); int nextJungleChestItem = WorldGen.GetNextJungleChestItem(); - if (!WorldGen.AddBuriedChest(WorldGen.JChestX[index150] + WorldGen.genRand.Next(2), WorldGen.JChestY[index150], nextJungleChestItem, Style: 10)) + if (!WorldGen.AddBuriedChest(WorldGen.JChestX[index131] + WorldGen.genRand.Next(2), WorldGen.JChestY[index131], nextJungleChestItem, Style: 10)) { - for (int i = WorldGen.JChestX[index150] - 1; i <= WorldGen.JChestX[index150] + 1; ++i) + for (int i = WorldGen.JChestX[index131] - 1; i <= WorldGen.JChestX[index131] + 1; ++i) { - for (int j = WorldGen.JChestY[index150]; j <= WorldGen.JChestY[index150] + 2; ++j) + for (int j = WorldGen.JChestY[index131]; j <= WorldGen.JChestY[index131] + 2; ++j) WorldGen.KillTile(i, j); } - for (int index151 = WorldGen.JChestX[index150] - 1; index151 <= WorldGen.JChestX[index150] + 1; ++index151) + for (int index132 = WorldGen.JChestX[index131] - 1; index132 <= WorldGen.JChestX[index131] + 1; ++index132) { - for (int index152 = WorldGen.JChestY[index150]; index152 <= WorldGen.JChestY[index150] + 3; ++index152) + for (int index133 = WorldGen.JChestY[index131]; index133 <= WorldGen.JChestY[index131] + 3; ++index133) { - if (index152 < Main.maxTilesY) + if (index133 < Main.maxTilesY) { - Main.tile[index151, index152].slope((byte) 0); - Main.tile[index151, index152].halfBrick(false); + Main.tile[index132, index133].slope((byte) 0); + Main.tile[index132, index133].halfBrick(false); } } } - WorldGen.AddBuriedChest(WorldGen.JChestX[index150], WorldGen.JChestY[index150], nextJungleChestItem, Style: 10); + WorldGen.AddBuriedChest(WorldGen.JChestX[index131], WorldGen.JChestY[index131], nextJungleChestItem, Style: 10); } } })); - WorldGen.AddGenerationPass("Water Chests", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Water Chests", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[33].Value; - for (int index = 0; index < WorldGen.numOceanCaveTreasure; ++index) - { - int contain = (int) WorldGen.genRand.NextFromList((short) 863, (short) 186, (short) 277, (short) 187, (short) 4404, (short) 4425); - bool flag = false; - float num216 = 2f; - while (!flag && (double) num216 < 50.0) - { - num216 += 0.1f; - int num217 = WorldGen.genRand.Next(WorldGen.oceanCaveTreasure[index].X - (int) num216, WorldGen.oceanCaveTreasure[index].X + (int) num216 + 1); - int j = WorldGen.genRand.Next(WorldGen.oceanCaveTreasure[index].Y - (int) num216 / 2, WorldGen.oceanCaveTreasure[index].Y + (int) num216 / 2 + 1); - int i = num217 >= Main.maxTilesX ? (int) ((double) num217 + (double) num216 / 2.0) : (int) ((double) num217 - (double) num216 / 2.0); - if (Main.tile[i, j].liquid > (byte) 250 && (Main.tile[i, j].liquidType() == (byte) 0 || WorldGen.notTheBees)) - flag = WorldGen.AddBuriedChest(i, j, contain, Style: 17, trySlope: true); - } - } - int num218 = 0; + int num152 = 0; for (int index = 0; (double) index < 9.0 * (double) dub2; ++index) { - float num219 = (float) index / (9f * dub2); - progress.Set(num219); - ++num218; + float num153 = (float) index / (9f * dub2); + progress.Set(num153); + ++num152; int contain; - if (WorldGen.genRand.Next(10) == 0) - contain = 4425; - else if (WorldGen.genRand.Next(10) == 0) + if (WorldGen.genRand.Next(15) == 0) { contain = 863; } else { - switch (num218) + switch (num152) { case 1: contain = 186; break; case 2: - contain = 4404; - break; - case 3: contain = 277; break; default: contain = 187; - num218 = 0; + num152 = 0; break; } } - bool flag23 = false; - int num220 = 0; - while (!flag23) + int i12; + int j11; + for (bool flag = false; !flag; flag = WorldGen.AddBuriedChest(i12, j11, contain, Style: 17)) { - int i = WorldGen.genRand.Next(50, Main.maxTilesX - 50); - int j; - for (j = WorldGen.genRand.Next(1, Main.UnderworldLayer); Main.tile[i, j].liquid < (byte) 250 || Main.tile[i, j].liquidType() != (byte) 0 && !WorldGen.notTheBees; j = WorldGen.genRand.Next(50, Main.UnderworldLayer)) - i = WorldGen.genRand.Next(50, Main.maxTilesX - 50); - flag23 = WorldGen.AddBuriedChest(i, j, contain, Style: 17, trySlope: (i < WorldGen.beachDistance || i > Main.maxTilesX - WorldGen.beachDistance)); - ++num220; - if (num220 > 10000) - break; + i12 = WorldGen.genRand.Next(1, Main.maxTilesX); + for (j11 = WorldGen.genRand.Next(1, Main.maxTilesY - 200); Main.tile[i12, j11].liquid < (byte) 200 || Main.tile[i12, j11].lava(); j11 = WorldGen.genRand.Next(1, Main.maxTilesY - 200)) + i12 = WorldGen.genRand.Next(1, Main.maxTilesX); } - bool flag24 = false; - int num221 = 0; - while (!flag24) + int i13; + int j12; + for (bool flag = false; !flag; flag = WorldGen.AddBuriedChest(i13, j12, contain, Style: 17)) { - int i = WorldGen.genRand.Next(50, Main.maxTilesX - 50); - int j; - for (j = WorldGen.genRand.Next((int) Main.worldSurface, Main.UnderworldLayer); Main.tile[i, j].liquid < (byte) 250 || Main.tile[i, j].liquidType() != (byte) 0 && !WorldGen.notTheBees; j = WorldGen.genRand.Next((int) Main.worldSurface, Main.UnderworldLayer)) - i = WorldGen.genRand.Next(50, Main.maxTilesX - 50); - flag24 = WorldGen.AddBuriedChest(i, j, contain, Style: 17, trySlope: (i < WorldGen.beachDistance || i > Main.maxTilesX - WorldGen.beachDistance)); - ++num221; - if (num221 > 10000) - break; + i13 = WorldGen.genRand.Next(1, Main.maxTilesX); + for (j12 = WorldGen.genRand.Next((int) Main.worldSurface, Main.maxTilesY - 200); Main.tile[i13, j12].liquid < (byte) 200 || Main.tile[i13, j12].lava(); j12 = WorldGen.genRand.Next(1, Main.maxTilesY - 200)) + i13 = WorldGen.genRand.Next(1, Main.maxTilesX); } } })); - WorldGen.AddGenerationPass("Spider Caves", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Spider Caves", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[64].Value; WorldGen.maxTileCount = 3500; - int num222 = Main.maxTilesX / 2; - int num223 = (int) ((double) Main.maxTilesX * 0.005); - if (WorldGen.getGoodWorldGen) - num223 *= 3; - for (int index = 0; index < num223; ++index) + for (int index134 = 0; index134 < (int) ((double) Main.maxTilesX * 0.005); ++index134) { - float num224 = (float) index / ((float) Main.maxTilesX * 0.005f); - progress.Set(num224); - int num225 = 0; + float num154 = (float) index134 / ((float) Main.maxTilesX * 0.005f); + progress.Set(num154); + int num155 = 0; int x = WorldGen.genRand.Next(200, Main.maxTilesX - 200); int y = WorldGen.genRand.Next((int) (Main.worldSurface + Main.rockLayer) / 2, Main.maxTilesY - 230); - int num226 = WorldGen.countTiles(x, y, lavaOk: true); - while ((num226 >= 3500 || num226 < 500) && num225 < num222) + for (int index135 = WorldGen.countTiles(x, y, lavaOk: true); (index135 >= 3500 || index135 < 500) && num155 < 500; index135 = WorldGen.countTiles(x, y, lavaOk: true)) { - ++num225; + ++num155; x = WorldGen.genRand.Next(200, Main.maxTilesX - 200); y = WorldGen.genRand.Next((int) Main.rockLayer + 30, Main.maxTilesY - 230); - num226 = WorldGen.countTiles(x, y, lavaOk: true); - if (WorldGen.shroomCount > 1) - num226 = 0; } - if (num225 < num222) + if (num155 < 500) WorldGen.Spread.Spider(x, y); } Main.tileSolid[162] = true; })); - WorldGen.AddGenerationPass("Gem Caves", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Gem Caves", (WorldGenLegacyMethod) (progress => { - if (WorldGen.notTheBees) - return; progress.Message = Lang.gen[64].Value; WorldGen.maxTileCount = 300; - for (int index153 = 0; index153 < (int) ((double) Main.maxTilesX * 0.003); ++index153) + for (int index136 = 0; index136 < (int) ((double) Main.maxTilesX * 0.003); ++index136) { - float num227 = (float) index153 / ((float) Main.maxTilesX * (3f / 1000f)); - progress.Set(num227); - int num228 = 0; + float num156 = (float) index136 / ((float) Main.maxTilesX * (3f / 1000f)); + progress.Set(num156); + int num157 = 0; int x = WorldGen.genRand.Next(200, Main.maxTilesX - 200); int y = WorldGen.genRand.Next((int) Main.rockLayer + 30, Main.maxTilesY - 230); - for (int index154 = WorldGen.countTiles(x, y); (index154 >= 300 || index154 < 50 || WorldGen.lavaCount > 0 || WorldGen.iceCount > 0 || WorldGen.rockCount == 0) && num228 < 1000; index154 = WorldGen.countTiles(x, y)) + for (int index137 = WorldGen.countTiles(x, y); (index137 >= 300 || index137 < 50 || WorldGen.lavaCount > 0 || WorldGen.iceCount > 0 || WorldGen.rockCount == 0) && num157 < 1000; index137 = WorldGen.countTiles(x, y)) { - ++num228; + ++num157; x = WorldGen.genRand.Next(200, Main.maxTilesX - 200); y = WorldGen.genRand.Next((int) Main.rockLayer + 30, Main.maxTilesY - 230); } - if (num228 < 1000) + if (num157 < 1000) WorldGen.gemCave(x, y); } })); - WorldGen.AddGenerationPass("Moss", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Moss", (WorldGenLegacyMethod) (progress => { - if (WorldGen.notTheBees) - return; progress.Message = Lang.gen[61].Value; WorldGen.randMoss(); - int num229 = Main.maxTilesX / 2100; - int num230 = 0; - int num231 = 0; - while (num231 < num229) - { - int i = WorldGen.genRand.Next(100, Main.maxTilesX - 100); - if (WorldGen.getGoodWorldGen) - { - while ((double) i > (double) Main.maxTilesX * 0.42 && (double) i < (double) Main.maxTilesX * 0.48) - i = WorldGen.genRand.Next(100, Main.maxTilesX - 100); - } - else if (!WorldGen.drunkWorldGen) - { - while ((double) i > (double) Main.maxTilesX * 0.38 && (double) i < (double) Main.maxTilesX * 0.62) - i = WorldGen.genRand.Next(100, Main.maxTilesX - 100); - } - int j = WorldGen.genRand.Next((int) Main.rockLayer + 40, WorldGen.lavaLine - 40); - bool flag = false; - int num232 = 50; -label_19: - for (int index155 = i - num232; index155 <= i + num232; ++index155) - { - for (int index156 = j - num232; index156 <= j + num232; ++index156) - { - if (Main.tile[index155, index156].active()) - { - int type = (int) Main.tile[index155, index156].type; - switch (type) - { - case 60: - case 70: - case 147: - case 161: - case 367: - case 368: - case 396: - case 397: - flag = true; - index155 = i + num232 + 1; - goto label_19; - default: - if (!Main.tileDungeon[type]) - continue; - goto case 60; - } - } - } - } - if (flag) - { - ++num230; - if (num230 > Main.maxTilesX) - ++num231; - } - else - { - num230 = 0; - ++num231; - WorldGen.neonMossBiome(i, j, WorldGen.lavaLine); - } - } WorldGen.maxTileCount = 2500; - for (int index157 = 0; index157 < (int) ((double) Main.maxTilesX * 0.01); ++index157) + for (int index138 = 0; index138 < (int) ((double) Main.maxTilesX * 0.01); ++index138) { - float num233 = (float) index157 / ((float) Main.maxTilesX * 0.01f); - progress.Set(num233); - int num234 = 0; + float num158 = (float) index138 / ((float) Main.maxTilesX * 0.01f); + progress.Set(num158); + int num159 = 0; int x = WorldGen.genRand.Next(200, Main.maxTilesX - 200); int y = WorldGen.genRand.Next((int) (Main.worldSurface + Main.rockLayer) / 2, WorldGen.waterLine); - for (int index158 = WorldGen.countTiles(x, y); (index158 >= 2500 || index158 < 10 || WorldGen.lavaCount > 0 || WorldGen.iceCount > 0 || WorldGen.rockCount == 0 || WorldGen.shroomCount > 0) && num234 < 1000; index158 = WorldGen.countTiles(x, y)) + for (int index139 = WorldGen.countTiles(x, y); (index139 >= 2500 || index139 < 10 || WorldGen.lavaCount > 0 || WorldGen.iceCount > 0 || WorldGen.rockCount == 0) && num159 < 1000; index139 = WorldGen.countTiles(x, y)) { - ++num234; + ++num159; x = WorldGen.genRand.Next(200, Main.maxTilesX - 200); y = WorldGen.genRand.Next((int) Main.rockLayer + 30, Main.maxTilesY - 230); } - if (num234 < 1000) + if (num159 < 1000) { WorldGen.setMoss(x, y); WorldGen.Spread.Moss(x, y); @@ -8240,110 +6109,108 @@ label_19: if (Main.tile[x, y].type == (ushort) 1) { WorldGen.setMoss(x, y); - Main.tile[x, y].type = WorldGen.mossTile; + Main.tile[x, y].type = (ushort) WorldGen.mossTile; } } - float num235 = (float) Main.maxTilesX * 0.05f; - while ((double) num235 > 0.0) + float num160 = (float) Main.maxTilesX * 0.05f; + while ((double) num160 > 0.0) { int x = WorldGen.genRand.Next(50, Main.maxTilesX - 50); int y = WorldGen.genRand.Next((int) (Main.worldSurface + Main.rockLayer) / 2, WorldGen.lavaLine); if (Main.tile[x, y].type == (ushort) 1 && (!Main.tile[x - 1, y].active() || !Main.tile[x + 1, y].active() || !Main.tile[x, y - 1].active() || !Main.tile[x, y + 1].active())) { WorldGen.setMoss(x, y); - Main.tile[x, y].type = WorldGen.mossTile; - --num235; + Main.tile[x, y].type = (ushort) WorldGen.mossTile; + --num160; } } - float num236 = (float) Main.maxTilesX * 0.065f; - while ((double) num236 > 0.0) + float num161 = (float) Main.maxTilesX * 0.065f; + while ((double) num161 > 0.0) { - int index159 = WorldGen.genRand.Next(50, Main.maxTilesX - 50); - int index160 = WorldGen.genRand.Next(WorldGen.waterLine, Main.UnderworldLayer); - if (Main.tile[index159, index160].type == (ushort) 1 && (!Main.tile[index159 - 1, index160].active() || !Main.tile[index159 + 1, index160].active() || !Main.tile[index159, index160 - 1].active() || !Main.tile[index159, index160 + 1].active())) + int index140 = WorldGen.genRand.Next(50, Main.maxTilesX - 50); + int index141 = WorldGen.genRand.Next(WorldGen.waterLine, Main.maxTilesY - 200); + if (Main.tile[index140, index141].type == (ushort) 1 && (!Main.tile[index140 - 1, index141].active() || !Main.tile[index140 + 1, index141].active() || !Main.tile[index140, index141 - 1].active() || !Main.tile[index140, index141 + 1].active())) { - int num237 = 25; - int num238 = 0; - for (int index161 = index159 - num237; index161 < index159 + num237; ++index161) + int num162 = 25; + int num163 = 0; + for (int index142 = index140 - num162; index142 < index140 + num162; ++index142) { - for (int index162 = index160 - num237; index162 < index160 + num237; ++index162) + for (int index143 = index141 - num162; index143 < index141 + num162; ++index143) { - if (Main.tile[index161, index162].liquid > (byte) 0 && Main.tile[index161, index162].lava()) - ++num238; + if (Main.tile[index142, index143].liquid > (byte) 0 && Main.tile[index142, index143].lava()) + ++num163; } } - if (num238 > 20) + if (num163 > 20) { - Main.tile[index159, index160].type = (ushort) 381; - --num236; + Main.tile[index140, index141].type = (ushort) 381; + --num161; } else - num236 -= 1f / 500f; + num161 -= 1f / 500f; } } - for (int index163 = 0; index163 < Main.maxTilesX; ++index163) + for (int index144 = 0; index144 < Main.maxTilesX; ++index144) { - for (int index164 = 0; index164 < Main.maxTilesY; ++index164) + for (int index145 = 0; index145 < Main.maxTilesY; ++index145) { - if (Main.tile[index163, index164].active() && Main.tileMoss[(int) Main.tile[index163, index164].type]) + if (Main.tile[index144, index145].active() && Main.tileMoss[(int) Main.tile[index144, index145].type]) { - for (int index165 = 0; index165 < 4; ++index165) + for (int index146 = 0; index146 < 4; ++index146) { - int i = index163; - int j = index164; - if (index165 == 0) + int i = index144; + int j = index145; + if (index146 == 0) --i; - if (index165 == 1) + if (index146 == 1) ++i; - if (index165 == 2) + if (index146 == 2) --j; - if (index165 == 3) + if (index146 == 3) ++j; try { WorldGen.grassSpread = 0; - WorldGen.SpreadGrass(i, j, 1, (int) Main.tile[index163, index164].type); + WorldGen.SpreadGrass(i, j, 1, (int) Main.tile[index144, index145].type); } catch { WorldGen.grassSpread = 0; - WorldGen.SpreadGrass(i, j, 1, (int) Main.tile[index163, index164].type, false); + WorldGen.SpreadGrass(i, j, 1, (int) Main.tile[index144, index145].type, false); } } } } } })); - WorldGen.AddGenerationPass("Temple", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Temple", (WorldGenLegacyMethod) (progress => { Main.tileSolid[162] = false; Main.tileSolid[226] = true; WorldGen.templePart2(); Main.tileSolid[232] = false; })); - WorldGen.AddGenerationPass("Cave Walls", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Ice Walls", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[63].Value; WorldGen.maxTileCount = 1500; - for (int index166 = 0; index166 < (int) ((double) Main.maxTilesX * 0.04); ++index166) + for (int index147 = 0; index147 < (int) ((double) Main.maxTilesX * 0.04); ++index147) { - float num239 = (float) index166 / ((float) Main.maxTilesX * 0.04f); - progress.Set(num239 * 0.66f); - int num240 = 0; + float num164 = (float) index147 / ((float) Main.maxTilesX * 0.04f); + progress.Set(num164 * 0.66f); + int num165 = 0; int x = WorldGen.genRand.Next(200, Main.maxTilesX - 200); int y = WorldGen.genRand.Next((int) (Main.worldSurface + Main.rockLayer) / 2, Main.maxTilesY - 220); - for (int index167 = WorldGen.countTiles(x, y, lavaOk: true); (index167 >= WorldGen.maxTileCount || index167 < 10) && num240 < 500; index167 = WorldGen.countTiles(x, y, lavaOk: true)) + for (int index148 = WorldGen.countTiles(x, y, lavaOk: true); (index148 >= 1500 || index148 < 10) && num165 < 500; index148 = WorldGen.countTiles(x, y, lavaOk: true)) { - ++num240; + ++num165; x = WorldGen.genRand.Next(200, Main.maxTilesX - 200); y = WorldGen.genRand.Next((int) (Main.worldSurface + Main.rockLayer) / 2, Main.maxTilesY - 220); } - if (num240 < 500) + if (num165 < 500) { int wallType = WorldGen.genRand.Next(2); - if ((double) WorldGen.shroomCount > (double) WorldGen.rockCount * 0.75) - wallType = 80; - else if (WorldGen.iceCount > 0) + if (WorldGen.iceCount > 0) { switch (wallType) { @@ -8382,199 +6249,135 @@ label_19: } } WorldGen.maxTileCount = 1500; - float num241 = (float) Main.maxTilesX * 0.02f; - for (int index = 0; (double) index < (double) num241; ++index) + for (int index = 0; index < (int) ((double) Main.maxTilesX * 0.02); ++index) { - float num242 = (float) index / ((float) Main.maxTilesX * 0.02f); - progress.Set((float) ((double) num242 * 0.330000013113022 + 0.660000026226044)); - int num243 = 0; + float num166 = (float) index / ((float) Main.maxTilesX * 0.02f); + progress.Set((float) ((double) num166 * 0.340000003576279 + 0.660000026226044)); + int num167 = 0; int x = WorldGen.genRand.Next(200, Main.maxTilesX - 200); int y = WorldGen.genRand.Next((int) Main.worldSurface, WorldGen.lavaLine); - int num244 = 0; - if (Main.tile[x, y].wall == (ushort) 64) - num244 = WorldGen.countTiles(x, y, true); - while ((num244 >= WorldGen.maxTileCount || num244 < 10) && num243 < 1000) + int num168 = 0; + if (Main.tile[x, y].wall == (byte) 64) + num168 = WorldGen.countTiles(x, y, true); + while ((num168 >= 1500 || num168 < 10) && num167 < 1000) { - ++num243; + ++num167; x = WorldGen.genRand.Next(200, Main.maxTilesX - 200); y = WorldGen.genRand.Next((int) Main.worldSurface, WorldGen.lavaLine); - if (!Main.wallHouse[(int) Main.tile[x, y].wall] && Main.tile[x, y].wall != (ushort) 244) - num244 = Main.tile[x, y].wall != (ushort) 64 ? 0 : WorldGen.countTiles(x, y, true); + if (!Main.wallHouse[(int) Main.tile[x, y].wall]) + num168 = Main.tile[x, y].wall != (byte) 64 ? 0 : WorldGen.countTiles(x, y, true); } - if (num243 < 1000) + if (num167 < 1000) WorldGen.Spread.Wall2(x, y, 15); } })); - WorldGen.AddGenerationPass("Jungle Trees", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Jungle Trees", (WorldGenLegacyMethod) (progress => { - progress.Message = Lang.gen[83].Value; for (int i = 0; i < Main.maxTilesX; ++i) { - progress.Set((float) i / (float) Main.maxTilesX); for (int y = (int) Main.worldSurface - 1; y < Main.maxTilesY - 350; ++y) { - if (WorldGen.genRand.Next(10) == 0 || WorldGen.drunkWorldGen) + if (WorldGen.genRand.Next(10) == 0) WorldGen.GrowUndergroundTree(i, y); } } })); - WorldGen.AddGenerationPass("Floating Island Houses", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Floating Island Houses", (WorldGenLegacyMethod) (progress => { - progress.Set(1f); for (int index = 0; index < WorldGen.numIslandHouses; ++index) { if (!WorldGen.skyLake[index]) - WorldGen.IslandHouse(WorldGen.floatingIslandHouseX[index], WorldGen.floatingIslandHouseY[index], WorldGen.floatingIslandStyle[index]); + WorldGen.IslandHouse(WorldGen.fihX[index], WorldGen.fihY[index]); } })); - WorldGen.AddGenerationPass("Quick Cleanup", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Quick Cleanup", (WorldGenLegacyMethod) (progress => { - progress.Set(1f); - if (WorldGen.notTheBees) - WorldGen.NotTheBees(); Main.tileSolid[137] = false; Main.tileSolid[130] = false; - for (int index168 = 20; index168 < Main.maxTilesX - 20; ++index168) + for (int i = 20; i < Main.maxTilesX - 20; ++i) { - for (int y = 20; y < Main.maxTilesY - 20; ++y) + for (int index = 20; index < Main.maxTilesY - 20; ++index) { - if ((double) y < Main.worldSurface && WorldGen.oceanDepths(index168, y) && Main.tile[index168, y].type == (ushort) 53 && Main.tile[index168, y].active()) + if (Main.tile[i, index].type != (ushort) 19 && TileID.Sets.CanBeClearedDuringGeneration[(int) Main.tile[i, index].type]) { - if (Main.tile[index168, y].bottomSlope()) - Main.tile[index168, y].slope((byte) 0); - for (int index169 = y + 1; index169 < y + WorldGen.genRand.Next(4, 7) && (!Main.tile[index168, index169].active() || Main.tile[index168, index169].type != (ushort) 397 && Main.tile[index168, index169].type != (ushort) 53) && (!Main.tile[index168, index169 + 1].active() || Main.tile[index168, index169 + 1].type != (ushort) 397 && Main.tile[index168, index169 + 1].type != (ushort) 53 && Main.tile[index168, index169 + 1].type != (ushort) 495) && (!Main.tile[index168, index169 + 2].active() || Main.tile[index168, index169 + 2].type != (ushort) 397 && Main.tile[index168, index169 + 2].type != (ushort) 53 && Main.tile[index168, index169 + 2].type != (ushort) 495); ++index169) + if (Main.tile[i, index].topSlope() || Main.tile[i, index].halfBrick()) { - Main.tile[index168, index169].type = (ushort) 0; - Main.tile[index168, index169].active(true); - Main.tile[index168, index169].halfBrick(false); - Main.tile[index168, index169].slope((byte) 0); + if (!WorldGen.SolidTile(i, index + 1)) + Main.tile[i, index].active(false); + if (Main.tile[i + 1, index].type == (ushort) 137 || Main.tile[i - 1, index].type == (ushort) 137) + Main.tile[i, index].active(false); } - } - if (Main.tile[index168, y].wall == (ushort) 187 || Main.tile[index168, y].wall == (ushort) 216) - { - if (Main.tile[index168, y].type == (ushort) 59 || Main.tile[index168, y].type == (ushort) 123 || Main.tile[index168, y].type == (ushort) 224) - Main.tile[index168, y].type = (ushort) 397; - if (Main.tile[index168, y].type == (ushort) 368 || Main.tile[index168, y].type == (ushort) 367) - Main.tile[index168, y].type = (ushort) 397; - if ((double) y <= Main.rockLayer) - Main.tile[index168, y].liquid = (byte) 0; - else if (Main.tile[index168, y].liquid > (byte) 0) + else if (Main.tile[i, index].bottomSlope()) { - Main.tile[index168, y].liquid = byte.MaxValue; - Main.tile[index168, y].lava(true); - } - } - if ((double) y < Main.worldSurface && Main.tile[index168, y].active() && Main.tile[index168, y].type == (ushort) 53 && Main.tile[index168, y + 1].wall == (ushort) 0 && !WorldGen.SolidTile(index168, y + 1)) - { - ushort num245 = 0; - int num246 = 3; - for (int index170 = index168 - num246; index170 <= index168 + num246; ++index170) - { - for (int index171 = y - num246; index171 <= y + num246; ++index171) - { - if (Main.tile[index170, index171].wall > (ushort) 0) - { - num245 = Main.tile[index170, index171].wall; - break; - } - } - } - if (num245 > (ushort) 0) - { - Main.tile[index168, y + 1].wall = num245; - if (Main.tile[index168, y].wall == (ushort) 0) - Main.tile[index168, y].wall = num245; - } - } - if (Main.tile[index168, y].type != (ushort) 19 && TileID.Sets.CanBeClearedDuringGeneration[(int) Main.tile[index168, y].type]) - { - if (Main.tile[index168, y].topSlope() || Main.tile[index168, y].halfBrick()) - { - if (Main.tile[index168, y].type != (ushort) 225 || !Main.tile[index168, y].halfBrick()) - { - if (!WorldGen.SolidTile(index168, y + 1)) - Main.tile[index168, y].active(false); - if (Main.tile[index168 + 1, y].type == (ushort) 137 || Main.tile[index168 - 1, y].type == (ushort) 137) - Main.tile[index168, y].active(false); - } - } - else if (Main.tile[index168, y].bottomSlope()) - { - if (!WorldGen.SolidTile(index168, y - 1)) - Main.tile[index168, y].active(false); - if (Main.tile[index168 + 1, y].type == (ushort) 137 || Main.tile[index168 - 1, y].type == (ushort) 137) - Main.tile[index168, y].active(false); + if (!WorldGen.SolidTile(i, index - 1)) + Main.tile[i, index].active(false); + if (Main.tile[i + 1, index].type == (ushort) 137 || Main.tile[i - 1, index].type == (ushort) 137) + Main.tile[i, index].active(false); } } } } })); - WorldGen.AddGenerationPass("Pots", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Pots", (WorldGenLegacyMethod) (progress => { Main.tileSolid[137] = true; Main.tileSolid[130] = true; progress.Message = Lang.gen[35].Value; for (int index = 0; index < (int) ((double) (Main.maxTilesX * Main.maxTilesY) * 0.0008); ++index) { - float num247 = (float) index / ((float) (Main.maxTilesX * Main.maxTilesY) * 0.0008f); - progress.Set(num247); - bool flag25 = false; - int num248 = 0; - while (!flag25) + float num169 = (float) index / ((float) (Main.maxTilesX * Main.maxTilesY) * 0.0008f); + progress.Set(num169); + bool flag16 = false; + int num170 = 0; + while (!flag16) { - int num249 = WorldGen.genRand.Next((int) worldSurfaceHigh, Main.maxTilesY - 10); - if ((double) num247 > 0.93) - num249 = Main.maxTilesY - 150; - else if ((double) num247 > 0.75) - num249 = (int) WorldGen.worldSurfaceLow; + int num171 = WorldGen.genRand.Next((int) worldSurfaceHigh, Main.maxTilesY - 10); + if ((double) num169 > 0.93) + num171 = Main.maxTilesY - 150; + else if ((double) num169 > 0.75) + num171 = (int) WorldGen.worldSurfaceLow; int x = WorldGen.genRand.Next(1, Main.maxTilesX); - bool flag26 = false; - for (int y = num249; y < Main.maxTilesY; ++y) + bool flag17 = false; + for (int y = num171; y < Main.maxTilesY; ++y) { - if (!flag26) + if (!flag17) { if (Main.tile[x, y].active() && Main.tileSolid[(int) Main.tile[x, y].type] && !Main.tile[x, y - 1].lava()) - flag26 = true; + flag17 = true; } - else if ((double) y >= Main.worldSurface || Main.tile[x, y].wall != (ushort) 0) + else { int style = WorldGen.genRand.Next(0, 4); - int num250 = 0; - int num251 = 0; + int num172 = 0; if (y < Main.maxTilesY - 5) - { - num250 = (int) Main.tile[x, y + 1].type; - num251 = (int) Main.tile[x, y].wall; - } - if (num250 == 147 || num250 == 161 || num250 == 162) + num172 = (int) Main.tile[x, y + 1].type; + if (num172 == 147 || num172 == 161 || num172 == 162) style = WorldGen.genRand.Next(4, 7); - if (num250 == 60) + if (num172 == 60) style = WorldGen.genRand.Next(7, 10); if (Main.wallDungeon[(int) Main.tile[x, y].wall]) style = WorldGen.genRand.Next(10, 13); - if (num250 == 41 || num250 == 43 || num250 == 44 || num250 == 481 || num250 == 482 || num250 == 483) + if (num172 == 41 || num172 == 43 || num172 == 44) style = WorldGen.genRand.Next(10, 13); - if (num250 == 22 || num250 == 23 || num250 == 25) + if (num172 == 22 || num172 == 23 || num172 == 25) style = WorldGen.genRand.Next(16, 19); - if (num250 == 199 || num250 == 203 || num250 == 204 || num250 == 200) + if (num172 == 199 || num172 == 203 || num172 == 204 || num172 == 200) style = WorldGen.genRand.Next(22, 25); - if (num250 == 367) + if (num172 == 367) style = WorldGen.genRand.Next(31, 34); - if (num250 == 226) + if (num172 == 226) style = WorldGen.genRand.Next(28, 31); - if (num251 == 187 || num251 == 216) - style = WorldGen.genRand.Next(34, 37); - if (y > Main.UnderworldLayer) + if (y > Main.maxTilesY - 200) style = WorldGen.genRand.Next(13, 16); - if (!WorldGen.oceanDepths(x, y) && WorldGen.PlacePot(x, y, style: style)) + if (WorldGen.PlacePot(x, y, style: style)) { - flag25 = true; + flag16 = true; break; } - ++num248; - if (num248 >= 10000) + ++num170; + if (num170 >= 10000) { - flag25 = true; + flag16 = true; break; } } @@ -8582,29 +6385,29 @@ label_19: } } })); - WorldGen.AddGenerationPass("Hellforge", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Hellforge", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[36].Value; - for (int index172 = 0; index172 < Main.maxTilesX / 200; ++index172) + for (int index149 = 0; index149 < Main.maxTilesX / 200; ++index149) { - float num252 = (float) (index172 / (Main.maxTilesX / 200)); - progress.Set(num252); + float num173 = (float) (index149 / (Main.maxTilesX / 200)); + progress.Set(num173); bool flag = false; - int num253 = 0; + int num174 = 0; while (!flag) { int i = WorldGen.genRand.Next(1, Main.maxTilesX); - int index173 = WorldGen.genRand.Next(Main.maxTilesY - 250, Main.maxTilesY - 30); + int index150 = WorldGen.genRand.Next(Main.maxTilesY - 250, Main.maxTilesY - 5); try { - if (Main.tile[i, index173].wall != (ushort) 13) + if (Main.tile[i, index150].wall != (byte) 13) { - if (Main.tile[i, index173].wall != (ushort) 14) + if (Main.tile[i, index150].wall != (byte) 14) continue; } - while (!Main.tile[i, index173].active() && index173 < Main.maxTilesY - 20) - ++index173; - int j = index173 - 1; + while (!Main.tile[i, index150].active()) + ++index150; + int j = index150 - 1; WorldGen.PlaceTile(i, j, 77); if (Main.tile[i, j].type == (ushort) 77) { @@ -8612,8 +6415,8 @@ label_19: } else { - ++num253; - if (num253 >= 10000) + ++num174; + if (num174 >= 10000) flag = true; } } @@ -8623,77 +6426,10 @@ label_19: } } })); - WorldGen.AddGenerationPass("Spreading Grass", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Spreading Grass", (WorldGenLegacyMethod) (progress => { - if (WorldGen.notTheBees) - return; progress.Message = Lang.gen[37].Value; - for (int index174 = 50; index174 < Main.maxTilesX - 50; ++index174) - { - for (int index175 = 50; (double) index175 <= Main.worldSurface; ++index175) - { - if (Main.tile[index174, index175].active()) - { - int type = (int) Main.tile[index174, index175].type; - if (Main.tile[index174, index175].active() && type == 60) - { - for (int index176 = index174 - 1; index176 <= index174 + 1; ++index176) - { - for (int index177 = index175 - 1; index177 <= index175 + 1; ++index177) - { - if (Main.tile[index176, index177].active() && Main.tile[index176, index177].type == (ushort) 0) - Main.tile[index176, index177].type = Main.tile[index176, index177 - 1].active() ? (ushort) 59 : (ushort) 60; - } - } - } - else if (type == 1 || type == 40 || TileID.Sets.Ore[type]) - { - int num254 = 3; - bool flag = false; - ushort num255 = 0; - for (int index178 = index174 - num254; index178 <= index174 + num254; ++index178) - { - for (int index179 = index175 - num254; index179 <= index175 + num254; ++index179) - { - if (Main.tile[index178, index179].active()) - { - if (Main.tile[index178, index179].type == (ushort) 53 || num255 == (ushort) 53) - num255 = (ushort) 53; - else if (Main.tile[index178, index179].type == (ushort) 59 || Main.tile[index178, index179].type == (ushort) 60 || Main.tile[index178, index179].type == (ushort) 147 || Main.tile[index178, index179].type == (ushort) 161 || Main.tile[index178, index179].type == (ushort) 199 || Main.tile[index178, index179].type == (ushort) 23) - num255 = Main.tile[index178, index179].type; - } - else if (index179 < index175 && Main.tile[index178, index179].wall == (ushort) 0) - flag = true; - } - } - if (flag) - { - switch (num255) - { - case 23: - case 199: - if (Main.tile[index174, index175 - 1].active()) - { - num255 = (ushort) 0; - break; - } - break; - case 59: - case 60: - if (index174 >= jungleMinX && index174 <= jungleMaxX) - { - num255 = Main.tile[index174, index175 - 1].active() ? (ushort) 59 : (ushort) 60; - break; - } - break; - } - Main.tile[index174, index175].type = num255; - } - } - } - } - } - for (int index = 10; index < Main.maxTilesX - 10; ++index) + for (int index = 0; index < Main.maxTilesX; ++index) { i2 = index; bool flag = true; @@ -8722,247 +6458,29 @@ label_19: else break; } - else if (Main.tile[i2, j].wall == (ushort) 0) + else if (Main.tile[i2, j].wall == (byte) 0) flag = true; } } })); - WorldGen.AddGenerationPass("Surface Ore and Stone", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Piles", (WorldGenLegacyMethod) (progress => { - progress.Set(1f); - int num256 = WorldGen.genRand.Next(Main.maxTilesX / 4200 * 5, Main.maxTilesX / 4200 * 10); - for (int index180 = 0; index180 < num256; ++index180) - { - int num257 = Main.maxTilesX / 420; - while (num257 > 0) - { - --num257; - int X = WorldGen.genRand.Next(WorldGen.beachDistance, Main.maxTilesX - WorldGen.beachDistance); - while ((double) X >= (double) Main.maxTilesX * 0.48 && (double) X <= (double) Main.maxTilesX * 0.52) - X = WorldGen.genRand.Next(WorldGen.beachDistance, Main.maxTilesX - WorldGen.beachDistance); - int Y = WorldGen.genRand.Next((int) WorldGen.worldSurfaceLow, (int) worldSurface); - bool flag = false; - for (int index181 = 0; index181 < WorldGen.numOrePatch; ++index181) - { - if (Math.Abs(X - WorldGen.orePatchX[index181]) < 200) - flag = true; - } - if (!flag && WorldGen.OrePatch(X, Y)) - { - if (WorldGen.numOrePatch < WorldGen.maxOrePatch - 1) - { - WorldGen.orePatchX[WorldGen.numOrePatch] = X; - ++WorldGen.numOrePatch; - break; - } - break; - } - } - } - int num258 = WorldGen.genRand.Next(1, Main.maxTilesX / 4200 * 7); - for (int index182 = 0; index182 < num258; ++index182) - { - int num259 = Main.maxTilesX / 420; - while (num259 > 0) - { - --num259; - int X = WorldGen.genRand.Next(WorldGen.beachDistance, Main.maxTilesX - WorldGen.beachDistance); - while ((double) X >= (double) Main.maxTilesX * 0.47 && (double) X <= (double) Main.maxTilesX * 0.53) - X = WorldGen.genRand.Next(WorldGen.beachDistance, Main.maxTilesX - WorldGen.beachDistance); - int Y = WorldGen.genRand.Next((int) WorldGen.worldSurfaceLow, (int) worldSurface); - bool flag = false; - for (int index183 = 0; index183 < WorldGen.numOrePatch; ++index183) - { - if (Math.Abs(X - WorldGen.orePatchX[index183]) < 100) - flag = true; - } - if (!flag && WorldGen.StonePatch(X, Y)) - break; - } - } - })); - WorldGen.AddGenerationPass("Place Fallen Log", (WorldGenLegacyMethod) ((progress, passConfig) => - { - progress.Message = Lang.gen[85].Value; - int num260 = Main.maxTilesX / 2100 + WorldGen.genRand.Next(-1, 2); - for (int index184 = 0; index184 < num260; ++index184) - { - progress.Set((float) index184 / (float) num260); - int minValue = WorldGen.beachDistance + 20; - int num261 = 50000; - int num262 = 5000; - while (num261 > 0) - { - --num261; - int i = WorldGen.genRand.Next(minValue, Main.maxTilesX - minValue); - int index185 = WorldGen.genRand.Next(10, (int) Main.worldSurface); - bool flag27 = false; - if (num261 < num262) - flag27 = true; - if (num261 > num262 / 2) - { - while ((double) i > (double) Main.maxTilesX * 0.4 && (double) i < (double) Main.maxTilesX * 0.6) - i = WorldGen.genRand.Next(minValue, Main.maxTilesX - minValue); - } - if (!Main.tile[i, index185].active() && Main.tile[i, index185].wall == (ushort) 0) - { - while (!Main.tile[i, index185].active() && Main.tile[i, index185].wall == (ushort) 0 && (double) index185 <= Main.worldSurface) - ++index185; - bool flag28 = true; - if ((double) index185 > Main.worldSurface - 10.0) - flag28 = false; - else if (!flag27) - { - int num263 = 50; - for (int index186 = i - num263; index186 < i + num263; ++index186) - { - if (index186 > 10 && index186 < Main.maxTilesX - 10) - { - for (int index187 = index185 - num263; index187 < index185 + num263; ++index187) - { - if (index187 > 10 && index187 < Main.maxTilesY - 10) - { - int type = (int) Main.tile[index186, index187].type; - switch (type) - { - case 53: - flag28 = false; - continue; - case 189: - flag28 = false; - continue; - default: - if (Main.tileDungeon[type]) - { - flag28 = false; - continue; - } - if (TileID.Sets.Crimson[type]) - { - flag28 = false; - continue; - } - if (TileID.Sets.Corrupt[type]) - { - flag28 = false; - continue; - } - continue; - } - } - } - } - } - if (flag28) - { - int num264 = 10; - int num265 = 10; - for (int index188 = i - num264; index188 < i + num264; ++index188) - { - for (int index189 = index185 - num265; index189 < index185 - 1; ++index189) - { - if (Main.tile[index188, index189].active() && Main.tileSolid[(int) Main.tile[index188, index189].type]) - flag28 = false; - if (Main.tile[index188, index189].wall != (ushort) 0) - flag28 = false; - } - } - } - } - if (flag28 && (Main.tile[i, index185 - 1].liquid == (byte) 0 || num261 < num262 / 5) && (Main.tile[i, index185].type == (ushort) 2 || WorldGen.notTheBees && Main.tile[i, index185].type == (ushort) 60) && (Main.tile[i - 1, index185].type == (ushort) 2 || WorldGen.notTheBees && Main.tile[i - 1, index185].type == (ushort) 60) && (Main.tile[i + 1, index185].type == (ushort) 2 || WorldGen.notTheBees && Main.tile[i + 1, index185].type == (ushort) 60)) - { - int j = index185 - 1; - WorldGen.PlaceTile(i, j, 488); - if (Main.tile[i, j].active() && Main.tile[i, j].type == (ushort) 488) - { - if (WorldGen.genRand.Next(2) == 0) - { - logX = i; - logY = j; - } - num261 = -1; - } - } - } - } - } - })); - WorldGen.AddGenerationPass("Traps", (WorldGenLegacyMethod) ((progress, passConfig) => - { - if (WorldGen.notTheBees) - return; - WorldGen.placingTraps = true; - progress.Message = Lang.gen[34].Value; - float num266 = (float) Main.maxTilesX * 0.05f; - if (WorldGen.getGoodWorldGen) - num266 *= 1.5f; - for (int index190 = 0; (double) index190 < (double) num266; ++index190) - { - progress.Set((float) ((double) index190 / (double) num266 / 2.0)); - for (int index191 = 0; index191 < 1150; ++index191) - { - int index192 = WorldGen.genRand.Next(200, Main.maxTilesX - 200); - int index193; - for (index193 = WorldGen.genRand.Next((int) Main.worldSurface, Main.maxTilesY - 210); WorldGen.oceanDepths(index192, index193); index193 = WorldGen.genRand.Next((int) Main.worldSurface, Main.maxTilesY - 210)) - index192 = WorldGen.genRand.Next(200, Main.maxTilesX - 200); - if (Main.tile[index192, index193].wall == (ushort) 0 && WorldGen.placeTrap(index192, index193)) - break; - } - } - float num267 = (float) Main.maxTilesX * (3f / 1000f); - if (WorldGen.getGoodWorldGen) - num267 *= 1.5f; - for (int index194 = 0; (double) index194 < (double) num267; ++index194) - { - progress.Set((float) ((double) index194 / (double) num267 / 2.0 + 0.5)); - for (int index195 = 0; index195 < 20000; ++index195) - { - int i = WorldGen.genRand.Next((int) ((double) Main.maxTilesX * 0.15), (int) ((double) Main.maxTilesX * 0.85)); - int j = WorldGen.genRand.Next((int) Main.worldSurface + 20, Main.maxTilesY - 210); - if (Main.tile[i, j].wall == (ushort) 187 && WorldGen.PlaceSandTrap(i, j)) - break; - } - } - if (WorldGen.drunkWorldGen) - { - for (int index196 = 0; index196 < 8; ++index196) - { - progress.Message = Lang.gen[34].Value; - float num268 = 100f; - for (int index197 = 0; (double) index197 < (double) num268; ++index197) - { - progress.Set((float) index197 / num268); - Thread.Sleep(10); - } - } - } - WorldGen.placingTraps = false; - })); - WorldGen.AddGenerationPass("Piles", (WorldGenLegacyMethod) ((progress, passConfig) => - { - progress.Message = Lang.gen[89].Value; - Main.tileSolid[229] = false; Main.tileSolid[190] = false; Main.tileSolid[196] = false; Main.tileSolid[189] = false; Main.tileSolid[202] = false; - Main.tileSolid[460] = false; - for (int index198 = 0; (double) index198 < (double) Main.maxTilesX * 0.06; ++index198) + for (int index151 = 0; (double) index151 < (double) Main.maxTilesX * 0.06; ++index151) { - int num269 = Main.maxTilesX / 2; bool flag = false; - while (!flag && num269 > 0) + while (!flag) { - --num269; - int index199 = WorldGen.genRand.Next(25, Main.maxTilesX - 25); - int index200; - for (index200 = WorldGen.genRand.Next((int) Main.worldSurface, Main.maxTilesY - 300); WorldGen.oceanDepths(index199, index200); index200 = WorldGen.genRand.Next((int) Main.worldSurface, Main.maxTilesY - 300)) - index199 = WorldGen.genRand.Next(25, Main.maxTilesX - 25); - if (!Main.tile[index199, index200].active()) + int i14 = WorldGen.genRand.Next(25, Main.maxTilesX - 25); + int j13 = WorldGen.genRand.Next((int) Main.worldSurface, Main.maxTilesY - 300); + if (!Main.tile[i14, j13].active()) { - int Type = 186; - while (!Main.tile[index199, index200 + 1].active() && index200 < Main.maxTilesY - 5) - ++index200; + int type = 186; + while (!Main.tile[i14, j13 + 1].active() && j13 < Main.maxTilesY - 5) + ++j13; int style = WorldGen.genRand.Next(22); switch (style) { @@ -8976,83 +6494,68 @@ label_19: style = WorldGen.genRand.Next(22); break; } - if ((Main.tile[index199, index200 + 1].type == (ushort) 0 || Main.tile[index199, index200 + 1].type == (ushort) 1 || Main.tileMoss[(int) Main.tile[index199, index200 + 1].type]) && WorldGen.genRand.Next(5) == 0) + if ((Main.tile[i14, j13 + 1].type == (ushort) 0 || Main.tile[i14, j13 + 1].type == (ushort) 1 || Main.tileMoss[(int) Main.tile[i14, j13 + 1].type]) && WorldGen.genRand.Next(5) == 0) { style = WorldGen.genRand.Next(23, 29); - Type = 187; + type = 187; } - if (index200 > Main.maxTilesY - 300 || Main.wallDungeon[(int) Main.tile[index199, index200].wall] || Main.tile[index199, index200 + 1].type == (ushort) 30 || Main.tile[index199, index200 + 1].type == (ushort) 19 || Main.tile[index199, index200 + 1].type == (ushort) 25 || Main.tile[index199, index200 + 1].type == (ushort) 203) + if (j13 > Main.maxTilesY - 300 || Main.wallDungeon[(int) Main.tile[i14, j13].wall] || Main.tile[i14, j13 + 1].type == (ushort) 30 || Main.tile[i14, j13 + 1].type == (ushort) 19 || Main.tile[i14, j13 + 1].type == (ushort) 25 || Main.tile[i14, j13 + 1].type == (ushort) 203) { style = WorldGen.genRand.Next(7); - Type = 186; + type = 186; } - if (Main.tile[index199, index200 + 1].type == (ushort) 147 || Main.tile[index199, index200 + 1].type == (ushort) 161 || Main.tile[index199, index200 + 1].type == (ushort) 162) + if (Main.tile[i14, j13 + 1].type == (ushort) 147 || Main.tile[i14, j13 + 1].type == (ushort) 161 || Main.tile[i14, j13 + 1].type == (ushort) 162) { style = WorldGen.genRand.Next(26, 32); - Type = 186; + type = 186; } - if (Main.tile[index199, index200 + 1].type == (ushort) 60) + if (Main.tile[i14, j13 + 1].type == (ushort) 60) { - Type = 187; + type = 187; style = WorldGen.genRand.Next(6); } - if ((Main.tile[index199, index200 + 1].type == (ushort) 57 || Main.tile[index199, index200 + 1].type == (ushort) 58) && WorldGen.genRand.Next(3) < 2) + if ((Main.tile[i14, j13 + 1].type == (ushort) 57 || Main.tile[i14, j13 + 1].type == (ushort) 58) && WorldGen.genRand.Next(3) < 2) { - Type = 187; + type = 187; style = WorldGen.genRand.Next(6, 9); } - if (Main.tile[index199, index200 + 1].type == (ushort) 226) + if (Main.tile[i14, j13 + 1].type == (ushort) 226) { - Type = 187; + type = 187; style = WorldGen.genRand.Next(18, 23); } - if (Main.tile[index199, index200 + 1].type == (ushort) 70) + if (Main.tile[i14, j13 + 1].type == (ushort) 70) { style = WorldGen.genRand.Next(32, 35); - Type = 186; + type = 186; } - if (Main.tile[index199, index200 + 1].type == (ushort) 396 || Main.tile[index199, index200 + 1].type == (ushort) 397 || Main.tile[index199, index200 + 1].type == (ushort) 404) + if (type == 186 && style >= 7 && style <= 15 && WorldGen.genRand.Next(75) == 0) { - style = WorldGen.genRand.Next(29, 35); - Type = 187; - } - if (Main.tile[index199, index200 + 1].type == (ushort) 368) - { - style = WorldGen.genRand.Next(35, 41); - Type = 187; - } - if (Main.tile[index199, index200 + 1].type == (ushort) 367) - { - style = WorldGen.genRand.Next(41, 47); - Type = 187; - } - if (Type == 186 && style >= 7 && style <= 15 && WorldGen.genRand.Next(75) == 0) - { - Type = 187; + type = 187; style = 17; } - if (Main.wallDungeon[(int) Main.tile[index199, index200].wall] && WorldGen.genRand.Next(3) != 0) + if (Main.wallDungeon[(int) Main.tile[i14, j13].wall] && WorldGen.genRand.Next(3) != 0) { flag = true; } else { - WorldGen.PlaceTile(index199, index200, Type, true, style: style); - if (Main.tile[index199, index200].type == (ushort) 186 || Main.tile[index199, index200].type == (ushort) 187) + WorldGen.PlaceTile(i14, j13, type, true, style: style); + if (Main.tile[i14, j13].type == (ushort) 186 || Main.tile[i14, j13].type == (ushort) 187) flag = true; - if (flag && Type == 186 && style <= 7) + if (flag && type == 186 && style <= 7) { - int num270 = WorldGen.genRand.Next(1, 5); - for (int index201 = 0; index201 < num270; ++index201) + int num = WorldGen.genRand.Next(1, 5); + for (int index152 = 0; index152 < num; ++index152) { - int i = index199 + WorldGen.genRand.Next(-10, 11); - int j = index200 - WorldGen.genRand.Next(5); - if (!Main.tile[i, j].active()) + int i15 = i14 + WorldGen.genRand.Next(-10, 11); + int j14 = j13 - WorldGen.genRand.Next(5); + if (!Main.tile[i15, j14].active()) { - while (!Main.tile[i, j + 1].active() && j < Main.maxTilesY - 5) - ++j; + while (!Main.tile[i15, j14 + 1].active() && j14 < Main.maxTilesY - 5) + ++j14; int X = WorldGen.genRand.Next(12, 36); - WorldGen.PlaceSmallPile(i, j, X, 0); + WorldGen.PlaceSmallPile(i15, j14, X, 0); } } } @@ -9060,20 +6563,18 @@ label_19: } } } - for (int index202 = 0; (double) index202 < (double) Main.maxTilesX * 0.01; ++index202) + for (int index153 = 0; (double) index153 < (double) Main.maxTilesX * 0.01; ++index153) { - int num271 = Main.maxTilesX / 2; bool flag = false; - while (!flag && num271 > 0) + while (!flag) { - --num271; - int i8 = WorldGen.genRand.Next(25, Main.maxTilesX - 25); - int j7 = WorldGen.genRand.Next(Main.maxTilesY - 300, Main.maxTilesY - 10); - if (!Main.tile[i8, j7].active()) + int i16 = WorldGen.genRand.Next(25, Main.maxTilesX - 25); + int j15 = WorldGen.genRand.Next(Main.maxTilesY - 300, Main.maxTilesY - 10); + if (!Main.tile[i16, j15].active()) { - int Type = 186; - while (!Main.tile[i8, j7 + 1].active() && j7 < Main.maxTilesY - 5) - ++j7; + int type = 186; + while (!Main.tile[i16, j15 + 1].active() && j15 < Main.maxTilesY - 5) + ++j15; int style = WorldGen.genRand.Next(22); switch (style) { @@ -9087,154 +6588,139 @@ label_19: style = WorldGen.genRand.Next(22); break; } - if (j7 > Main.maxTilesY - 300 || Main.wallDungeon[(int) Main.tile[i8, j7].wall] || Main.tile[i8, j7 + 1].type == (ushort) 30 || Main.tile[i8, j7 + 1].type == (ushort) 19) + if (j15 > Main.maxTilesY - 300 || Main.wallDungeon[(int) Main.tile[i16, j15].wall] || Main.tile[i16, j15 + 1].type == (ushort) 30 || Main.tile[i16, j15 + 1].type == (ushort) 19) style = WorldGen.genRand.Next(7); - if ((Main.tile[i8, j7 + 1].type == (ushort) 57 || Main.tile[i8, j7 + 1].type == (ushort) 58) && WorldGen.genRand.Next(3) < 2) + if ((Main.tile[i16, j15 + 1].type == (ushort) 57 || Main.tile[i16, j15 + 1].type == (ushort) 58) && WorldGen.genRand.Next(3) < 2) { - Type = 187; + type = 187; style = WorldGen.genRand.Next(6, 9); } - if (Main.tile[i8, j7 + 1].type == (ushort) 147 || Main.tile[i8, j7 + 1].type == (ushort) 161 || Main.tile[i8, j7 + 1].type == (ushort) 162) + if (Main.tile[i16, j15 + 1].type == (ushort) 147 || Main.tile[i16, j15 + 1].type == (ushort) 161 || Main.tile[i16, j15 + 1].type == (ushort) 162) style = WorldGen.genRand.Next(26, 32); - WorldGen.PlaceTile(i8, j7, Type, true, style: style); - if (Main.tile[i8, j7].type == (ushort) 186 || Main.tile[i8, j7].type == (ushort) 187) + WorldGen.PlaceTile(i16, j15, type, true, style: style); + if (Main.tile[i16, j15].type == (ushort) 186 || Main.tile[i16, j15].type == (ushort) 187) flag = true; - if (flag && Type == 186 && style <= 7) + if (flag && type == 186 && style <= 7) { - int num272 = WorldGen.genRand.Next(1, 5); - for (int index203 = 0; index203 < num272; ++index203) + int num = WorldGen.genRand.Next(1, 5); + for (int index154 = 0; index154 < num; ++index154) { - int i9 = i8 + WorldGen.genRand.Next(-10, 11); - int j8 = j7 - WorldGen.genRand.Next(5); - if (!Main.tile[i9, j8].active()) + int i17 = i16 + WorldGen.genRand.Next(-10, 11); + int j16 = j15 - WorldGen.genRand.Next(5); + if (!Main.tile[i17, j16].active()) { - while (!Main.tile[i9, j8 + 1].active() && j8 < Main.maxTilesY - 5) - ++j8; + while (!Main.tile[i17, j16 + 1].active() && j16 < Main.maxTilesY - 5) + ++j16; int X = WorldGen.genRand.Next(12, 36); - WorldGen.PlaceSmallPile(i9, j8, X, 0); + WorldGen.PlaceSmallPile(i17, j16, X, 0); } } } } } } - for (int index204 = 0; (double) index204 < (double) Main.maxTilesX * 0.003; ++index204) + for (int index = 0; (double) index < (double) Main.maxTilesX * 0.003; ++index) { - int num273 = Main.maxTilesX / 2; bool flag = false; - while (!flag && num273 > 0) + while (!flag) { - --num273; - int Type = 186; - int index205 = WorldGen.genRand.Next(25, Main.maxTilesX - 25); - int index206; - for (index206 = WorldGen.genRand.Next(10, (int) Main.worldSurface); WorldGen.oceanDepths(index205, index206); index206 = WorldGen.genRand.Next(10, (int) Main.worldSurface)) - index205 = WorldGen.genRand.Next(25, Main.maxTilesX - 25); - if (!Main.tile[index205, index206].active()) + int type = 186; + int i = WorldGen.genRand.Next(25, Main.maxTilesX - 25); + int j = WorldGen.genRand.Next(10, (int) Main.worldSurface); + if (!Main.tile[i, j].active()) { - while (!Main.tile[index205, index206 + 1].active() && index206 < Main.maxTilesY - 5) - ++index206; + while (!Main.tile[i, j + 1].active() && j < Main.maxTilesY - 5) + ++j; int style = WorldGen.genRand.Next(7, 13); - if (index206 > Main.maxTilesY - 300 || Main.wallDungeon[(int) Main.tile[index205, index206].wall] || Main.tile[index205, index206 + 1].type == (ushort) 30 || Main.tile[index205, index206 + 1].type == (ushort) 19 || Main.tile[index205, index206 + 1].type == (ushort) 25 || Main.tile[index205, index206 + 1].type == (ushort) 203 || Main.tile[index205, index206 + 1].type == (ushort) 234 || Main.tile[index205, index206 + 1].type == (ushort) 112) + if (j > Main.maxTilesY - 300 || Main.wallDungeon[(int) Main.tile[i, j].wall] || Main.tile[i, j + 1].type == (ushort) 30 || Main.tile[i, j + 1].type == (ushort) 19 || Main.tile[i, j + 1].type == (ushort) 53 || Main.tile[i, j + 1].type == (ushort) 25 || Main.tile[i, j + 1].type == (ushort) 203) style = -1; - if (Main.tile[index205, index206 + 1].type == (ushort) 147 || Main.tile[index205, index206 + 1].type == (ushort) 161 || Main.tile[index205, index206 + 1].type == (ushort) 162) + if (Main.tile[i, j + 1].type == (ushort) 147 || Main.tile[i, j + 1].type == (ushort) 161 || Main.tile[i, j + 1].type == (ushort) 162) style = WorldGen.genRand.Next(26, 32); - if (Main.tile[index205, index206 + 1].type == (ushort) 53) + if (Main.tile[i, j + 1].type == (ushort) 2 || Main.tile[i - 1, j + 1].type == (ushort) 2 || Main.tile[i + 1, j + 1].type == (ushort) 2) { - Type = 187; - style = WorldGen.genRand.Next(52, 55); - } - if (Main.tile[index205, index206 + 1].type == (ushort) 2 || Main.tile[index205 - 1, index206 + 1].type == (ushort) 2 || Main.tile[index205 + 1, index206 + 1].type == (ushort) 2) - { - Type = 187; + type = 187; style = WorldGen.genRand.Next(14, 17); } - if (Main.tile[index205, index206 + 1].type == (ushort) 151 || Main.tile[index205, index206 + 1].type == (ushort) 274) + if (Main.tile[i, j + 1].type == (ushort) 151 || Main.tile[i, j + 1].type == (ushort) 274) { - Type = 186; + type = 186; style = WorldGen.genRand.Next(7); } if (style >= 0) - WorldGen.PlaceTile(index205, index206, Type, true, style: style); - if ((int) Main.tile[index205, index206].type == Type) + WorldGen.PlaceTile(i, j, type, true, style: style); + if ((int) Main.tile[i, j].type == type) flag = true; } } } - for (int index207 = 0; (double) index207 < (double) Main.maxTilesX * 0.0035; ++index207) + for (int index155 = 0; (double) index155 < (double) Main.maxTilesX * 0.0035; ++index155) { - int num274 = Main.maxTilesX / 2; bool flag = false; - while (!flag && num274 > 0) + while (!flag) { - --num274; - int i10 = WorldGen.genRand.Next(25, Main.maxTilesX - 25); - int j9 = WorldGen.genRand.Next(10, (int) Main.worldSurface); - if (!Main.tile[i10, j9].active() && Main.tile[i10, j9].wall > (ushort) 0) + int i18 = WorldGen.genRand.Next(25, Main.maxTilesX - 25); + int j17 = WorldGen.genRand.Next(10, (int) Main.worldSurface); + if (!Main.tile[i18, j17].active() && Main.tile[i18, j17].wall > (byte) 0) { - int Type = 186; - while (!Main.tile[i10, j9 + 1].active() && j9 < Main.maxTilesY - 5) - ++j9; + int type = 186; + while (!Main.tile[i18, j17 + 1].active() && j17 < Main.maxTilesY - 5) + ++j17; int style = WorldGen.genRand.Next(7, 13); - if (j9 > Main.maxTilesY - 300 || Main.wallDungeon[(int) Main.tile[i10, j9].wall] || Main.tile[i10, j9 + 1].type == (ushort) 30 || Main.tile[i10, j9 + 1].type == (ushort) 19) + if (j17 > Main.maxTilesY - 300 || Main.wallDungeon[(int) Main.tile[i18, j17].wall] || Main.tile[i18, j17 + 1].type == (ushort) 30 || Main.tile[i18, j17 + 1].type == (ushort) 19) style = -1; - if (Main.tile[i10, j9 + 1].type == (ushort) 25) + if (Main.tile[i18, j17 + 1].type == (ushort) 25) style = WorldGen.genRand.Next(7); - if (Main.tile[i10, j9 + 1].type == (ushort) 147 || Main.tile[i10, j9 + 1].type == (ushort) 161 || Main.tile[i10, j9 + 1].type == (ushort) 162) + if (Main.tile[i18, j17 + 1].type == (ushort) 147 || Main.tile[i18, j17 + 1].type == (ushort) 161 || Main.tile[i18, j17 + 1].type == (ushort) 162) style = WorldGen.genRand.Next(26, 32); - if (Main.tile[i10, j9 + 1].type == (ushort) 2 || Main.tile[i10 - 1, j9 + 1].type == (ushort) 2 || Main.tile[i10 + 1, j9 + 1].type == (ushort) 2) + if (Main.tile[i18, j17 + 1].type == (ushort) 2 || Main.tile[i18 - 1, j17 + 1].type == (ushort) 2 || Main.tile[i18 + 1, j17 + 1].type == (ushort) 2) { - Type = 187; + type = 187; style = WorldGen.genRand.Next(14, 17); } - if (Main.tile[i10, j9 + 1].type == (ushort) 151 || Main.tile[i10, j9 + 1].type == (ushort) 274) + if (Main.tile[i18, j17 + 1].type == (ushort) 151 || Main.tile[i18, j17 + 1].type == (ushort) 274) { - Type = 186; + type = 186; style = WorldGen.genRand.Next(7); } if (style >= 0) - WorldGen.PlaceTile(i10, j9, Type, true, style: style); - if ((int) Main.tile[i10, j9].type == Type) + WorldGen.PlaceTile(i18, j17, type, true, style: style); + if ((int) Main.tile[i18, j17].type == type) flag = true; if (flag && style <= 7) { - int num275 = WorldGen.genRand.Next(1, 5); - for (int index208 = 0; index208 < num275; ++index208) + int num = WorldGen.genRand.Next(1, 5); + for (int index156 = 0; index156 < num; ++index156) { - int i11 = i10 + WorldGen.genRand.Next(-10, 11); - int j10 = j9 - WorldGen.genRand.Next(5); - if (!Main.tile[i11, j10].active()) + int i19 = i18 + WorldGen.genRand.Next(-10, 11); + int j18 = j17 - WorldGen.genRand.Next(5); + if (!Main.tile[i19, j18].active()) { - while (!Main.tile[i11, j10 + 1].active() && j10 < Main.maxTilesY - 5) - ++j10; + while (!Main.tile[i19, j18 + 1].active() && j18 < Main.maxTilesY - 5) + ++j18; int X = WorldGen.genRand.Next(12, 36); - WorldGen.PlaceSmallPile(i11, j10, X, 0); + WorldGen.PlaceSmallPile(i19, j18, X, 0); } } } } } } - for (int index209 = 0; (double) index209 < (double) Main.maxTilesX * 0.6; ++index209) + for (int index157 = 0; (double) index157 < (double) Main.maxTilesX * 0.6; ++index157) { - int num276 = Main.maxTilesX / 2; bool flag = false; - while (!flag && num276 > 0) + while (!flag) { - --num276; - int index210 = WorldGen.genRand.Next(25, Main.maxTilesX - 25); - int index211 = WorldGen.genRand.Next((int) Main.worldSurface, Main.maxTilesY - 20); - if (Main.tile[index210, index211].wall == (ushort) 87 && WorldGen.genRand.Next(2) == 0) + int i20 = WorldGen.genRand.Next(25, Main.maxTilesX - 25); + int j19 = WorldGen.genRand.Next((int) Main.worldSurface, Main.maxTilesY - 20); + if (Main.tile[i20, j19].wall == (byte) 87 && WorldGen.genRand.Next(2) == 0) { - index210 = WorldGen.genRand.Next(25, Main.maxTilesX - 25); - index211 = WorldGen.genRand.Next((int) Main.worldSurface, Main.maxTilesY - 20); + i20 = WorldGen.genRand.Next(25, Main.maxTilesX - 25); + j19 = WorldGen.genRand.Next((int) Main.worldSurface, Main.maxTilesY - 20); } - for (; WorldGen.oceanDepths(index210, index211); index211 = WorldGen.genRand.Next((int) Main.worldSurface, Main.maxTilesY - 20)) - index210 = WorldGen.genRand.Next(25, Main.maxTilesX - 25); - if (!Main.tile[index210, index211].active()) + if (!Main.tile[i20, j19].active()) { - while (!Main.tile[index210, index211 + 1].active() && index211 < Main.maxTilesY - 5) - ++index211; + while (!Main.tile[i20, j19 + 1].active() && j19 < Main.maxTilesY - 5) + ++j19; int Y = WorldGen.genRand.Next(2); int X1 = WorldGen.genRand.Next(36); switch (X1) @@ -9268,14 +6754,14 @@ label_19: break; } } - if (index211 > Main.maxTilesY - 300) + if (j19 > Main.maxTilesY - 300) { if (Y == 0) X1 = WorldGen.genRand.Next(12, 28); if (Y == 1) X1 = WorldGen.genRand.Next(6, 16); } - if (Main.wallDungeon[(int) Main.tile[index210, index211].wall] || Main.tile[index210, index211 + 1].type == (ushort) 30 || Main.tile[index210, index211 + 1].type == (ushort) 19 || Main.tile[index210, index211 + 1].type == (ushort) 25 || Main.tile[index210, index211 + 1].type == (ushort) 203 || Main.tile[index210, index211].wall == (ushort) 87) + if (Main.wallDungeon[(int) Main.tile[i20, j19].wall] || Main.tile[i20, j19 + 1].type == (ushort) 30 || Main.tile[i20, j19 + 1].type == (ushort) 19 || Main.tile[i20, j19 + 1].type == (ushort) 25 || Main.tile[i20, j19 + 1].type == (ushort) 203 || Main.tile[i20, j19].wall == (byte) 87) { if (Y == 0 && X1 < 12) X1 += 12; @@ -9284,7 +6770,7 @@ label_19: if (Y == 1 && X1 >= 17) X1 -= 10; } - if (Main.tile[index210, index211 + 1].type == (ushort) 147 || Main.tile[index210, index211 + 1].type == (ushort) 161 || Main.tile[index210, index211 + 1].type == (ushort) 162) + if (Main.tile[i20, j19 + 1].type == (ushort) 147 || Main.tile[i20, j19 + 1].type == (ushort) 161 || Main.tile[i20, j19 + 1].type == (ushort) 162) { if (Y == 0 && X1 < 12) X1 += 36; @@ -9293,99 +6779,41 @@ label_19: if (Y == 1 && X1 < 6) X1 += 25; } - if (Main.tile[index210, index211 + 1].type == (ushort) 151 || Main.tile[index210, index211 + 1].type == (ushort) 274) + if (Main.tile[i20, j19 + 1].type == (ushort) 151 || Main.tile[i20, j19 + 1].type == (ushort) 274) { if (Y == 0) X1 = WorldGen.genRand.Next(12, 28); if (Y == 1) X1 = WorldGen.genRand.Next(12, 19); } - if (Main.tile[index210, index211 + 1].type == (ushort) 368) - { - if (Y == 0) - X1 = WorldGen.genRand.Next(60, 66); - if (Y == 1) - X1 = WorldGen.genRand.Next(47, 53); - } - if (Main.tile[index210, index211 + 1].type == (ushort) 367) - { - if (Y == 0) - X1 = WorldGen.genRand.Next(66, 72); - if (Y == 1) - X1 = WorldGen.genRand.Next(53, 59); - } - flag = Main.wallDungeon[(int) Main.tile[index210, index211].wall] && WorldGen.genRand.Next(3) != 0 || WorldGen.PlaceSmallPile(index210, index211, X1, Y); + flag = Main.wallDungeon[(int) Main.tile[i20, j19].wall] && WorldGen.genRand.Next(3) != 0 || WorldGen.PlaceSmallPile(i20, j19, X1, Y); if (flag && Y == 1 && X1 >= 6 && X1 <= 15) { - int num277 = WorldGen.genRand.Next(1, 5); - for (int index212 = 0; index212 < num277; ++index212) + int num = WorldGen.genRand.Next(1, 5); + for (int index158 = 0; index158 < num; ++index158) { - int i = index210 + WorldGen.genRand.Next(-10, 11); - int j = index211 - WorldGen.genRand.Next(5); - if (!Main.tile[i, j].active()) + int i21 = i20 + WorldGen.genRand.Next(-10, 11); + int j20 = j19 - WorldGen.genRand.Next(5); + if (!Main.tile[i21, j20].active()) { - while (!Main.tile[i, j + 1].active() && j < Main.maxTilesY - 5) - ++j; + while (!Main.tile[i21, j20 + 1].active() && j20 < Main.maxTilesY - 5) + ++j20; int X2 = WorldGen.genRand.Next(12, 36); - WorldGen.PlaceSmallPile(i, j, X2, 0); + WorldGen.PlaceSmallPile(i21, j20, X2, 0); } } } } } } - for (int index213 = 0; (double) index213 < (double) Main.maxTilesX * 0.0199999995529652; ++index213) + for (int index = 0; (double) index < (double) Main.maxTilesX * 0.0199999995529652; ++index) { - int num278 = Main.maxTilesX / 2; bool flag = false; - while (!flag && num278 > 0) + while (!flag) { - --num278; - int index214 = WorldGen.genRand.Next(25, Main.maxTilesX - 25); - int index215; - for (index215 = WorldGen.genRand.Next(15, (int) Main.worldSurface); WorldGen.oceanDepths(index214, index215); index215 = WorldGen.genRand.Next(15, (int) Main.worldSurface)) - index214 = WorldGen.genRand.Next(25, Main.maxTilesX - 25); - if (!Main.tile[index214, index215].active()) - { - while (!Main.tile[index214, index215 + 1].active() && index215 < Main.maxTilesY - 5) - ++index215; - int Y = WorldGen.genRand.Next(2); - int X = WorldGen.genRand.Next(11); - if (Y == 1) - X = WorldGen.genRand.Next(5); - if (Main.tile[index214, index215 + 1].type == (ushort) 147 || Main.tile[index214, index215 + 1].type == (ushort) 161 || Main.tile[index214, index215 + 1].type == (ushort) 162) - { - if (Y == 0 && X < 12) - X += 36; - if (Y == 1 && X >= 20) - X += 6; - if (Y == 1 && X < 6) - X += 25; - } - if (Main.tile[index214, index215 + 1].type == (ushort) 2 && Y == 1) - X = WorldGen.genRand.Next(38, 41); - if (Main.tile[index214, index215 + 1].type == (ushort) 151 || Main.tile[index214, index215 + 1].type == (ushort) 274) - { - if (Y == 0) - X = WorldGen.genRand.Next(12, 28); - if (Y == 1) - X = WorldGen.genRand.Next(12, 19); - } - if (!Main.wallDungeon[(int) Main.tile[index214, index215].wall] && Main.tile[index214, index215 + 1].type != (ushort) 30 && Main.tile[index214, index215 + 1].type != (ushort) 19 && Main.tile[index214, index215 + 1].type != (ushort) 41 && Main.tile[index214, index215 + 1].type != (ushort) 43 && Main.tile[index214, index215 + 1].type != (ushort) 44 && Main.tile[index214, index215 + 1].type != (ushort) 481 && Main.tile[index214, index215 + 1].type != (ushort) 482 && Main.tile[index214, index215 + 1].type != (ushort) 483 && Main.tile[index214, index215 + 1].type != (ushort) 45 && Main.tile[index214, index215 + 1].type != (ushort) 46 && Main.tile[index214, index215 + 1].type != (ushort) 47 && Main.tile[index214, index215 + 1].type != (ushort) 175 && Main.tile[index214, index215 + 1].type != (ushort) 176 && Main.tile[index214, index215 + 1].type != (ushort) 177 && Main.tile[index214, index215 + 1].type != (ushort) 53 && Main.tile[index214, index215 + 1].type != (ushort) 25 && Main.tile[index214, index215 + 1].type != (ushort) 203) - flag = WorldGen.PlaceSmallPile(index214, index215, X, Y); - } - } - } - for (int index = 0; (double) index < (double) Main.maxTilesX * 0.150000005960464; ++index) - { - int num279 = Main.maxTilesX / 2; - bool flag = false; - while (!flag && num279 > 0) - { - --num279; int i = WorldGen.genRand.Next(25, Main.maxTilesX - 25); int j = WorldGen.genRand.Next(15, (int) Main.worldSurface); - if (!Main.tile[i, j].active() && (Main.tile[i, j].wall == (ushort) 2 || Main.tile[i, j].wall == (ushort) 40)) + if (!Main.tile[i, j].active()) { while (!Main.tile[i, j + 1].active() && j < Main.maxTilesY - 5) ++j; @@ -9411,7 +6839,45 @@ label_19: if (Y == 1) X = WorldGen.genRand.Next(12, 19); } - if ((Main.tile[i, j].liquid != byte.MaxValue || Main.tile[i, j + 1].type != (ushort) 53 || Main.tile[i, j].wall != (ushort) 0) && !Main.wallDungeon[(int) Main.tile[i, j].wall] && Main.tile[i, j + 1].type != (ushort) 30 && Main.tile[i, j + 1].type != (ushort) 19 && Main.tile[i, j + 1].type != (ushort) 41 && Main.tile[i, j + 1].type != (ushort) 43 && Main.tile[i, j + 1].type != (ushort) 44 && Main.tile[i, j + 1].type != (ushort) 481 && Main.tile[i, j + 1].type != (ushort) 482 && Main.tile[i, j + 1].type != (ushort) 483 && Main.tile[i, j + 1].type != (ushort) 45 && Main.tile[i, j + 1].type != (ushort) 46 && Main.tile[i, j + 1].type != (ushort) 47 && Main.tile[i, j + 1].type != (ushort) 175 && Main.tile[i, j + 1].type != (ushort) 176 && Main.tile[i, j + 1].type != (ushort) 177 && Main.tile[i, j + 1].type != (ushort) 25 && Main.tile[i, j + 1].type != (ushort) 203) + if (!Main.wallDungeon[(int) Main.tile[i, j].wall] && Main.tile[i, j + 1].type != (ushort) 30 && Main.tile[i, j + 1].type != (ushort) 19 && Main.tile[i, j + 1].type != (ushort) 41 && Main.tile[i, j + 1].type != (ushort) 43 && Main.tile[i, j + 1].type != (ushort) 44 && Main.tile[i, j + 1].type != (ushort) 45 && Main.tile[i, j + 1].type != (ushort) 46 && Main.tile[i, j + 1].type != (ushort) 47 && Main.tile[i, j + 1].type != (ushort) 175 && Main.tile[i, j + 1].type != (ushort) 176 && Main.tile[i, j + 1].type != (ushort) 177 && Main.tile[i, j + 1].type != (ushort) 53 && Main.tile[i, j + 1].type != (ushort) 25 && Main.tile[i, j + 1].type != (ushort) 203) + flag = WorldGen.PlaceSmallPile(i, j, X, Y); + } + } + } + for (int index = 0; (double) index < (double) Main.maxTilesX * 0.150000005960464; ++index) + { + bool flag = false; + while (!flag) + { + int i = WorldGen.genRand.Next(25, Main.maxTilesX - 25); + int j = WorldGen.genRand.Next(15, (int) Main.worldSurface); + if (!Main.tile[i, j].active() && (Main.tile[i, j].wall == (byte) 2 || Main.tile[i, j].wall == (byte) 40)) + { + while (!Main.tile[i, j + 1].active() && j < Main.maxTilesY - 5) + ++j; + int Y = WorldGen.genRand.Next(2); + int X = WorldGen.genRand.Next(11); + if (Y == 1) + X = WorldGen.genRand.Next(5); + if (Main.tile[i, j + 1].type == (ushort) 147 || Main.tile[i, j + 1].type == (ushort) 161 || Main.tile[i, j + 1].type == (ushort) 162) + { + if (Y == 0 && X < 12) + X += 36; + if (Y == 1 && X >= 20) + X += 6; + if (Y == 1 && X < 6) + X += 25; + } + if (Main.tile[i, j + 1].type == (ushort) 2 && Y == 1) + X = WorldGen.genRand.Next(38, 41); + if (Main.tile[i, j + 1].type == (ushort) 151 || Main.tile[i, j + 1].type == (ushort) 274) + { + if (Y == 0) + X = WorldGen.genRand.Next(12, 28); + if (Y == 1) + X = WorldGen.genRand.Next(12, 19); + } + if (!Main.wallDungeon[(int) Main.tile[i, j].wall] && Main.tile[i, j + 1].type != (ushort) 30 && Main.tile[i, j + 1].type != (ushort) 19 && Main.tile[i, j + 1].type != (ushort) 41 && Main.tile[i, j + 1].type != (ushort) 43 && Main.tile[i, j + 1].type != (ushort) 44 && Main.tile[i, j + 1].type != (ushort) 45 && Main.tile[i, j + 1].type != (ushort) 46 && Main.tile[i, j + 1].type != (ushort) 47 && Main.tile[i, j + 1].type != (ushort) 175 && Main.tile[i, j + 1].type != (ushort) 176 && Main.tile[i, j + 1].type != (ushort) 177 && Main.tile[i, j + 1].type != (ushort) 25 && Main.tile[i, j + 1].type != (ushort) 203) flag = WorldGen.PlaceSmallPile(i, j, X, Y); } } @@ -9422,78 +6888,148 @@ label_19: Main.tileSolid[189] = true; Main.tileSolid[202] = true; Main.tileSolid[225] = true; - Main.tileSolid[460] = true; })); - WorldGen.AddGenerationPass("Spawn Point", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Moss", (WorldGenLegacyMethod) (progress => { - progress.Set(1f); - int num280 = 5; + progress.Message = Lang.gen[38].Value; + int num175 = 8; + int num176 = 400; + int num177 = 4; + int num178 = 275; + for (int index = 0; index < 3; ++index) + { + int num179; + int num180; + bool flag; + int maxValue; + switch (index) + { + case 1: + num179 = num176; + num180 = Main.maxTilesX - num176; + flag = true; + maxValue = num175; + break; + case 2: + num179 = Main.maxTilesX - num178; + num180 = Main.maxTilesX - 5; + flag = false; + maxValue = num177; + break; + default: + num179 = 5; + num180 = num178; + flag = false; + maxValue = num177; + break; + } + for (int i = num179; i < num180; ++i) + { + if (WorldGen.genRand.Next(maxValue) == 0) + { + for (int j = 0; (double) j < Main.worldSurface - 1.0; ++j) + { + Tile tile3 = Main.tile[i, j]; + if (tile3.active() && tile3.type == (ushort) 53) + { + Tile tile4 = Main.tile[i, j - 1]; + if (!tile4.active() && tile4.wall == (byte) 0) + { + if (flag) + { + WorldGen.PlantCactus(i, j); + break; + } + if (Main.tile[i, j - 2].liquid == byte.MaxValue && Main.tile[i, j - 3].liquid == byte.MaxValue && Main.tile[i, j - 4].liquid == byte.MaxValue) + { + if (WorldGen.genRand.Next(2) == 0) + { + WorldGen.PlaceTile(i, j - 1, 81, true); + break; + } + WorldGen.PlaceTile(i, j - 1, 324, true, style: WorldGen.genRand.Next(2)); + break; + } + if (Main.tile[i, j - 2].liquid == (byte) 0) + { + WorldGen.PlaceTile(i, j - 1, 324, true, style: WorldGen.genRand.Next(2)); + break; + } + } + } + } + } + } + } + })); + WorldGen.AddGenerationPass("Spawn Point", (WorldGenLegacyMethod) (progress => + { + int num181 = 5; bool flag = true; while (flag) { - int index216 = Main.maxTilesX / 2 + WorldGen.genRand.Next(-num280, num280 + 1); - for (int index217 = 0; index217 < Main.maxTilesY; ++index217) + int index159 = Main.maxTilesX / 2 + WorldGen.genRand.Next(-num181, num181 + 1); + for (int index160 = 0; index160 < Main.maxTilesY; ++index160) { - if (Main.tile[index216, index217].active()) + if (Main.tile[index159, index160].active()) { - Main.spawnTileX = index216; - Main.spawnTileY = index217; + Main.spawnTileX = index159; + Main.spawnTileY = index160; break; } } flag = false; - ++num280; + ++num181; if ((double) Main.spawnTileY > Main.worldSurface) flag = true; if (Main.tile[Main.spawnTileX, Main.spawnTileY - 1].liquid > (byte) 0) flag = true; } - int num281 = 10; + int num182 = 10; while ((double) Main.spawnTileY > Main.worldSurface) { - int index218 = WorldGen.genRand.Next(Main.maxTilesX / 2 - num281, Main.maxTilesX / 2 + num281); - for (int index219 = 0; index219 < Main.maxTilesY; ++index219) + int index161 = WorldGen.genRand.Next(Main.maxTilesX / 2 - num182, Main.maxTilesX / 2 + num182); + for (int index162 = 0; index162 < Main.maxTilesY; ++index162) { - if (Main.tile[index218, index219].active()) + if (Main.tile[index161, index162].active()) { - Main.spawnTileX = index218; - Main.spawnTileY = index219; + Main.spawnTileX = index161; + Main.spawnTileY = index162; break; } } - ++num281; + ++num182; } })); - WorldGen.AddGenerationPass("Grass Wall", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Grass Wall", (WorldGenLegacyMethod) (progress => { WorldGen.maxTileCount = 3500; - progress.Set(1f); - for (int index220 = 50; index220 < Main.maxTilesX - 50; ++index220) + for (int index163 = 50; index163 < Main.maxTilesX - 50; ++index163) { - for (int index221 = 0; (double) index221 < Main.worldSurface - 10.0; ++index221) + for (int index164 = 0; (double) index164 < Main.worldSurface - 10.0; ++index164) { if (WorldGen.genRand.Next(4) == 0) { bool flag = false; int x = -1; int y = -1; - if (Main.tile[index220, index221].active() && Main.tile[index220, index221].type == (ushort) 2 && (Main.tile[index220, index221].wall == (ushort) 2 || Main.tile[index220, index221].wall == (ushort) 63)) + if (Main.tile[index163, index164].active() && Main.tile[index163, index164].type == (ushort) 2 && (Main.tile[index163, index164].wall == (byte) 2 || Main.tile[index163, index164].wall == (byte) 63)) { - for (int i = index220 - 1; i <= index220 + 1; ++i) + for (int i = index163 - 1; i <= index163 + 1; ++i) { - for (int j = index221 - 1; j <= index221 + 1; ++j) + for (int j = index164 - 1; j <= index164 + 1; ++j) { - if (Main.tile[i, j].wall == (ushort) 0 && !WorldGen.SolidTile(i, j)) + if (Main.tile[i, j].wall == (byte) 0 && !WorldGen.SolidTile(i, j)) flag = true; } } if (flag) { - for (int i = index220 - 1; i <= index220 + 1; ++i) + for (int i = index163 - 1; i <= index163 + 1; ++i) { - for (int j = index221 - 1; j <= index221 + 1; ++j) + for (int j = index164 - 1; j <= index164 + 1; ++j) { - if ((Main.tile[i, j].wall == (ushort) 2 || Main.tile[i, j].wall == (ushort) 15) && !WorldGen.SolidTile(i, j)) + if ((Main.tile[i, j].wall == (byte) 2 || Main.tile[i, j].wall == (byte) 15) && !WorldGen.SolidTile(i, j)) { x = i; y = j; @@ -9522,16 +7058,16 @@ label_19: { for (int j = 10; (double) j < Main.worldSurface - 1.0; ++j) { - if (Main.tile[i, j].wall == (ushort) 63 && WorldGen.genRand.Next(10) == 0) - Main.tile[i, j].wall = (ushort) 65; + if (Main.tile[i, j].wall == (byte) 63 && WorldGen.genRand.Next(10) == 0) + Main.tile[i, j].wall = (byte) 65; if (Main.tile[i, j].active() && Main.tile[i, j].type == (ushort) 0) { bool flag = false; - for (int index222 = i - 1; index222 <= i + 1; ++index222) + for (int index165 = i - 1; index165 <= i + 1; ++index165) { - for (int index223 = j - 1; index223 <= j + 1; ++index223) + for (int index166 = j - 1; index166 <= j + 1; ++index166) { - if (Main.tile[index222, index223].wall == (ushort) 63 || Main.tile[index222, index223].wall == (ushort) 65) + if (Main.tile[i, j].wall == (byte) 63 || Main.tile[i, j].wall == (byte) 65) { flag = true; break; @@ -9544,133 +7080,96 @@ label_19: } } })); - WorldGen.AddGenerationPass("Guide", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Guide", (WorldGenLegacyMethod) (progress => { - progress.Set(1f); - if (WorldGen.getGoodWorldGen) - { - int index = NPC.NewNPC(Main.spawnTileX * 16, Main.spawnTileY * 16, 38); - Main.npc[index].homeTileX = Main.spawnTileX; - Main.npc[index].homeTileY = Main.spawnTileY; - Main.npc[index].direction = 1; - Main.npc[index].homeless = true; - } - else if (WorldGen.drunkWorldGen) - { - int index = NPC.NewNPC(Main.spawnTileX * 16, Main.spawnTileY * 16, 208); - Main.npc[index].homeTileX = Main.spawnTileX; - Main.npc[index].homeTileY = Main.spawnTileY; - Main.npc[index].direction = 1; - Main.npc[index].homeless = true; - } - else if (WorldGen.notTheBees) - { - int index = NPC.NewNPC(Main.spawnTileX * 16, Main.spawnTileY * 16, 17); - Main.npc[index].homeTileX = Main.spawnTileX; - Main.npc[index].homeTileY = Main.spawnTileY; - Main.npc[index].direction = 1; - Main.npc[index].homeless = true; - } - else - { - int index = NPC.NewNPC(Main.spawnTileX * 16, Main.spawnTileY * 16, 22); - Main.npc[index].homeTileX = Main.spawnTileX; - Main.npc[index].homeTileY = Main.spawnTileY; - Main.npc[index].direction = 1; - Main.npc[index].homeless = true; - } + int index = NPC.NewNPC(Main.spawnTileX * 16, Main.spawnTileY * 16, 22); + Main.npc[index].homeTileX = Main.spawnTileX; + Main.npc[index].homeTileY = Main.spawnTileY; + Main.npc[index].direction = 1; + Main.npc[index].homeless = true; })); - WorldGen.AddGenerationPass("Sunflowers", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Sunflowers", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[39].Value; - for (int index224 = 0; (double) index224 < (double) Main.maxTilesX * 0.002; ++index224) + for (int index167 = 0; (double) index167 < (double) Main.maxTilesX * 0.002; ++index167) { - progress.Set((float) ((double) index224 / (double) Main.maxTilesX * (1.0 / 500.0))); - int num282 = Main.maxTilesX / 2; - int num283 = WorldGen.genRand.Next(Main.maxTilesX); - int num284 = num283 - WorldGen.genRand.Next(10) - 7; - int num285 = num283 + WorldGen.genRand.Next(10) + 7; - if (num284 < 0) - num284 = 0; - if (num285 > Main.maxTilesX - 1) - num285 = Main.maxTilesX - 1; - for (int i = num284; i < num285; ++i) + int num183 = Main.maxTilesX / 2; + int num184 = WorldGen.genRand.Next(Main.maxTilesX); + int num185 = num184 - WorldGen.genRand.Next(10) - 7; + int num186 = num184 + WorldGen.genRand.Next(10) + 7; + if (num185 < 0) + num185 = 0; + if (num186 > Main.maxTilesX - 1) + num186 = Main.maxTilesX - 1; + for (int i = num185; i < num186; ++i) { - for (int index225 = 1; (double) index225 < Main.worldSurface - 1.0; ++index225) + for (int index168 = 1; (double) index168 < Main.worldSurface - 1.0; ++index168) { - if (Main.tile[i, index225].type == (ushort) 2 && Main.tile[i, index225].active() && !Main.tile[i, index225 - 1].active()) - WorldGen.PlaceTile(i, index225 - 1, 27, true); - if (Main.tile[i, index225].active()) + if (Main.tile[i, index168].type == (ushort) 2 && Main.tile[i, index168].active() && !Main.tile[i, index168 - 1].active()) + WorldGen.PlaceTile(i, index168 - 1, 27, true); + if (Main.tile[i, index168].active()) break; } } } })); - WorldGen.AddGenerationPass("Planting Trees", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Planting Trees", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[40].Value; - if (!WorldGen.drunkWorldGen) + for (int index = 0; (double) index < (double) Main.maxTilesX * 0.003; ++index) { - for (int index = 0; (double) index < (double) Main.maxTilesX * 0.003; ++index) + int num187 = WorldGen.genRand.Next(50, Main.maxTilesX - 50); + int num188 = WorldGen.genRand.Next(25, 50); + for (int i = num187 - num188; i < num187 + num188; ++i) { - progress.Set((float) ((double) index / (double) Main.maxTilesX * (3.0 / 1000.0))); - int num286 = WorldGen.genRand.Next(50, Main.maxTilesX - 50); - int num287 = WorldGen.genRand.Next(25, 50); - for (int i = num286 - num287; i < num286 + num287; ++i) - { - for (int y = 20; (double) y < Main.worldSurface; ++y) - WorldGen.GrowEpicTree(i, y); - } + for (int y = 20; (double) y < Main.worldSurface; ++y) + WorldGen.GrowEpicTree(i, y); } } WorldGen.AddTrees(); })); - WorldGen.AddGenerationPass("Herbs", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Herbs", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[41].Value; for (int index = 0; (double) index < (double) Main.maxTilesX * 1.7; ++index) - { - progress.Set((float) ((double) index / (double) Main.maxTilesX * 1.70000004768372)); WorldGen.PlantAlch(); - } })); - WorldGen.AddGenerationPass("Dye Plants", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Dye Plants", (WorldGenLegacyMethod) (progress => { - progress.Set(1f); for (int index = 0; index < Main.maxTilesX; ++index) - WorldGen.plantDye(WorldGen.genRand.Next(100, Main.maxTilesX - 100), WorldGen.genRand.Next(100, Main.UnderworldLayer)); - WorldGen.MatureTheHerbPlants(); + WorldGen.plantDye(WorldGen.genRand.Next(100, Main.maxTilesX - 100), WorldGen.genRand.Next(100, Main.maxTilesY - 200)); + for (int index = 0; index < Main.maxTilesX / 8; ++index) + WorldGen.plantDye(WorldGen.genRand.Next(100, Main.maxTilesX - 100), WorldGen.genRand.Next(100, Main.maxTilesY - 200), true); })); - WorldGen.AddGenerationPass("Webs And Honey", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Webs And Honey", (WorldGenLegacyMethod) (progress => { - progress.Set(1f); for (int index = 100; index < Main.maxTilesX - 100; ++index) { - for (int worldSurface4 = (int) Main.worldSurface; worldSurface4 < Main.maxTilesY - 100; ++worldSurface4) + for (int worldSurface3 = (int) Main.worldSurface; worldSurface3 < Main.maxTilesY - 100; ++worldSurface3) { - if (Main.tile[index, worldSurface4].wall == (ushort) 86) + if (Main.tile[index, worldSurface3].wall == (byte) 86) { - if (Main.tile[index, worldSurface4].liquid > (byte) 0) - Main.tile[index, worldSurface4].honey(true); + if (Main.tile[index, worldSurface3].liquid > (byte) 0) + Main.tile[index, worldSurface3].honey(true); if (WorldGen.genRand.Next(3) == 0) - WorldGen.PlaceTight(index, worldSurface4); + WorldGen.PlaceTight(index, worldSurface3); } - if (Main.tile[index, worldSurface4].wall == (ushort) 62) + if (Main.tile[index, worldSurface3].wall == (byte) 62) { - Main.tile[index, worldSurface4].liquid = (byte) 0; - Main.tile[index, worldSurface4].lava(false); + Main.tile[index, worldSurface3].liquid = (byte) 0; + Main.tile[index, worldSurface3].lava(false); } - if (Main.tile[index, worldSurface4].wall == (ushort) 62 && !Main.tile[index, worldSurface4].active() && WorldGen.genRand.Next(10) != 0) + if (Main.tile[index, worldSurface3].wall == (byte) 62 && !Main.tile[index, worldSurface3].active() && WorldGen.genRand.Next(10) != 0) { - int num288 = WorldGen.genRand.Next(2, 5); - int num289 = index - num288; - int num290 = index + num288; - int num291 = worldSurface4 - num288; - int num292 = worldSurface4 + num288; + int num189 = WorldGen.genRand.Next(2, 5); + int num190 = index - num189; + int num191 = index + num189; + int num192 = worldSurface3 - num189; + int num193 = worldSurface3 + num189; bool flag = false; - for (int i = num289; i <= num290; ++i) + for (int i = num190; i <= num191; ++i) { - for (int j = num291; j <= num292; ++j) + for (int j = num192; j <= num193; ++j) { if (WorldGen.SolidTile(i, j)) { @@ -9681,55 +7180,36 @@ label_19: } if (flag) { - WorldGen.PlaceTile(index, worldSurface4, 51, true); - WorldGen.TileFrame(index, worldSurface4); + WorldGen.PlaceTile(index, worldSurface3, 51, true); + WorldGen.TileFrame(index, worldSurface3); } } } } })); - WorldGen.AddGenerationPass("Weeds", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Weeds", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[42].Value; if (Main.halloween) { - for (int index226 = 40; index226 < Main.maxTilesX - 40; ++index226) + for (int index169 = 40; index169 < Main.maxTilesX - 40; ++index169) { - for (int index227 = 50; (double) index227 < Main.worldSurface; ++index227) + for (int index170 = 50; (double) index170 < Main.worldSurface; ++index170) { - if (Main.tile[index226, index227].active() && Main.tile[index226, index227].type == (ushort) 2 && WorldGen.genRand.Next(15) == 0) + if (Main.tile[index169, index170].active() && Main.tile[index169, index170].type == (ushort) 2 && WorldGen.genRand.Next(15) == 0) { - WorldGen.PlacePumpkin(index226, index227 - 1); - int num293 = WorldGen.genRand.Next(5); - for (int index228 = 0; index228 < num293; ++index228) - WorldGen.GrowPumpkin(index226, index227 - 1, 254); + WorldGen.PlacePumpkin(index169, index170 - 1); + int num = WorldGen.genRand.Next(5); + for (int index171 = 0; index171 < num; ++index171) + WorldGen.GrowPumpkin(index169, index170 - 1, 254); } } } } - for (int i = 0; i < Main.maxTilesX; ++i) - { - progress.Set((float) i / (float) Main.maxTilesX); - for (int index = 1; index < Main.maxTilesY; ++index) - { - if (Main.tile[i, index].type == (ushort) 2 && Main.tile[i, index].nactive()) - { - if (!Main.tile[i, index - 1].active()) - WorldGen.PlaceTile(i, index - 1, 3, true); - } - else if (Main.tile[i, index].type == (ushort) 23 && Main.tile[i, index].nactive()) - { - if (!Main.tile[i, index - 1].active()) - WorldGen.PlaceTile(i, index - 1, 24, true); - } - else if (Main.tile[i, index].type == (ushort) 199 && Main.tile[i, index].nactive() && !Main.tile[i, index - 1].active()) - WorldGen.PlaceTile(i, index - 1, 201, true); - } - } + WorldGen.AddPlants(); })); - WorldGen.AddGenerationPass("Glowing Mushrooms and Jungle Plants", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Mud Caves To Grass", (WorldGenLegacyMethod) (progress => { - progress.Set(1f); for (int i = 0; i < Main.maxTilesX; ++i) { for (int y = 0; y < Main.maxTilesY; ++y) @@ -9738,17 +7218,9 @@ label_19: { if (y >= (int) Main.worldSurface && Main.tile[i, y].type == (ushort) 70 && !Main.tile[i, y - 1].active()) { - WorldGen.GrowTree(i, y); + WorldGen.GrowShroom(i, y); if (!Main.tile[i, y - 1].active()) - { - WorldGen.GrowTree(i, y); - if (!Main.tile[i, y - 1].active()) - { - WorldGen.GrowShroom(i, y); - if (!Main.tile[i, y - 1].active()) - WorldGen.PlaceTile(i, y - 1, 71, true); - } - } + WorldGen.PlaceTile(i, y - 1, 71, true); } if (Main.tile[i, y].type == (ushort) 60 && !Main.tile[i, y - 1].active()) WorldGen.PlaceTile(i, y - 1, 61, true); @@ -9756,82 +7228,70 @@ label_19: } } })); - WorldGen.AddGenerationPass("Jungle Plants", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Jungle Plants", (WorldGenLegacyMethod) (progress => { - progress.Set(1f); - for (int index229 = 0; index229 < Main.maxTilesX * 100; ++index229) + for (int index172 = 0; index172 < Main.maxTilesX * 100; ++index172) { int X2 = WorldGen.genRand.Next(40, Main.maxTilesX / 2 - 40); if (dungeonSide < 0) X2 += Main.maxTilesX / 2; - int index230 = WorldGen.genRand.Next(Main.maxTilesY - 300); - while (!Main.tile[X2, index230].active() && index230 < Main.maxTilesY - 300) - ++index230; - if (Main.tile[X2, index230].active() && Main.tile[X2, index230].type == (ushort) 60) + int index173 = WorldGen.genRand.Next(Main.maxTilesY - 300); + while (!Main.tile[X2, index173].active() && index173 < Main.maxTilesY - 300) + ++index173; + if (Main.tile[X2, index173].active() && Main.tile[X2, index173].type == (ushort) 60) { - int Y2 = index230 - 1; + int Y2 = index173 - 1; WorldGen.PlaceJunglePlant(X2, Y2, (ushort) 233, WorldGen.genRand.Next(8), 0); if (Main.tile[X2, Y2].type != (ushort) 233) WorldGen.PlaceJunglePlant(X2, Y2, (ushort) 233, WorldGen.genRand.Next(12), 1); } } })); - WorldGen.AddGenerationPass("Vines", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Vines", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[43].Value; - for (int index231 = 5; index231 < Main.maxTilesX - 5; ++index231) + for (int i22 = 0; i22 < Main.maxTilesX; ++i22) { - progress.Set((float) index231 / (float) Main.maxTilesX); - int num294 = 0; - ushort num295 = 52; - for (int y = 0; (double) y < Main.worldSurface; ++y) + int num194 = 0; + for (int index = 0; (double) index < Main.worldSurface; ++index) { - if (num294 > 0 && !Main.tile[index231, y].active()) + if (num194 > 0 && !Main.tile[i22, index].active()) { - Main.tile[index231, y].active(true); - Main.tile[index231, y].type = num295; - Main.tile[index231, y].color(Main.tile[index231, y - 1].color()); - --num294; + Main.tile[i22, index].active(true); + Main.tile[i22, index].type = (ushort) 52; + --num194; } else - num294 = 0; - if (Main.tile[index231, y].active() && !Main.tile[index231, y].bottomSlope() && (Main.tile[index231, y].type == (ushort) 2 || Main.tile[index231, y].type == (ushort) 192 && WorldGen.genRand.Next(4) == 0) && WorldGen.GrowMoreVines(index231, y)) - { - num295 = (ushort) 52; - if (Main.tile[index231, y].wall == (ushort) 68 || Main.tile[index231, y].wall == (ushort) 65 || Main.tile[index231, y].wall == (ushort) 66 || Main.tile[index231, y].wall == (ushort) 63) - num295 = (ushort) 382; - else if (Main.tile[index231, y + 1].wall == (ushort) 68 || Main.tile[index231, y + 1].wall == (ushort) 65 || Main.tile[index231, y + 1].wall == (ushort) 66 || Main.tile[index231, y + 1].wall == (ushort) 63) - num295 = (ushort) 382; - if (WorldGen.genRand.Next(5) < 3) - num294 = WorldGen.genRand.Next(1, 10); - } + num194 = 0; + if (Main.tile[i22, index].active() && !Main.tile[i22, index].bottomSlope() && (Main.tile[i22, index].type == (ushort) 2 || Main.tile[i22, index].type == (ushort) 192 && WorldGen.genRand.Next(4) == 0) && WorldGen.genRand.Next(5) < 3) + num194 = WorldGen.genRand.Next(1, 10); } - int num296 = 0; - for (int index232 = 5; index232 < Main.maxTilesY - 5; ++index232) + int num195 = 0; + for (int j21 = 0; j21 < Main.maxTilesY; ++j21) { - if (num296 > 0 && !Main.tile[index231, index232].active()) + if (num195 > 0 && !Main.tile[i22, j21].active()) { - Main.tile[index231, index232].active(true); - Main.tile[index231, index232].type = (ushort) 62; - --num296; + Main.tile[i22, j21].active(true); + Main.tile[i22, j21].type = (ushort) 62; + --num195; } else - num296 = 0; - if (Main.tile[index231, index232].active() && Main.tile[index231, index232].type == (ushort) 60 && !Main.tile[index231, index232].bottomSlope() && WorldGen.GrowMoreVines(index231, index232)) + num195 = 0; + if (Main.tile[i22, j21].active() && Main.tile[i22, j21].type == (ushort) 60 && !Main.tile[i22, j21].bottomSlope()) { - if (WorldGen.notTheBees && index232 < Main.maxTilesY - 10 && Main.tile[index231, index232 - 1].active() && !Main.tile[index231, index232 - 1].bottomSlope() && Main.tile[index231 + 1, index232 - 1].active() && !Main.tile[index231 + 1, index232 - 1].bottomSlope() && (Main.tile[index231, index232 - 1].type == (ushort) 60 || Main.tile[index231, index232 - 1].type == (ushort) 444 || Main.tile[index231, index232 - 1].type == (ushort) 230)) + if (i22 < Main.maxTilesX - 1 && j21 < Main.maxTilesY - 2 && Main.tile[i22 + 1, j21].active() && Main.tile[i22 + 1, j21].type == (ushort) 60 && !Main.tile[i22 + 1, j21].bottomSlope() && WorldGen.genRand.Next(40) == 0) { bool flag = true; - for (int index233 = index231; index233 < index231 + 2; ++index233) + for (int index174 = i22; index174 < i22 + 2; ++index174) { - for (int index234 = index232 + 1; index234 < index232 + 3; ++index234) + for (int index175 = j21 + 1; index175 < j21 + 3; ++index175) { - if (Main.tile[index233, index234].active() && (!Main.tileCut[(int) Main.tile[index233, index234].type] || Main.tile[index233, index234].type == (ushort) 444)) + if (Main.tile[index174, index175].active() && (!Main.tileCut[(int) Main.tile[index174, index175].type] || Main.tile[index174, index175].type == (ushort) 444)) { flag = false; break; } - if (Main.tile[index233, index234].liquid > (byte) 0 || Main.wallHouse[(int) Main.tile[index233, index234].wall]) + if (Main.tile[index174, index175].liquid > (byte) 0 || Main.wallHouse[(int) Main.tile[index174, index175].wall]) { flag = false; break; @@ -9842,165 +7302,70 @@ label_19: } if (flag) { - if (WorldGen.CountNearBlocksTypes(index231, index232, WorldGen.genRand.Next(3, 10), 1, 444) > 0) + if (WorldGen.CountNearBlocksTypes(i22, j21, 20, 1, 444) > 0) flag = false; } if (flag) { - for (int i = index231; i < index231 + 2; ++i) + for (int i23 = i22; i23 < i22 + 2; ++i23) { - for (int j = index232 + 1; j < index232 + 3; ++j) - WorldGen.KillTile(i, j); + for (int j22 = j21 + 1; j22 < j21 + 3; ++j22) + WorldGen.KillTile(i23, j22); } - for (int index235 = index231; index235 < index231 + 2; ++index235) + for (int index176 = i22; index176 < i22 + 2; ++index176) { - for (int index236 = index232 + 1; index236 < index232 + 3; ++index236) + for (int index177 = j21 + 1; index177 < j21 + 3; ++index177) { - Main.tile[index235, index236].active(true); - Main.tile[index235, index236].type = (ushort) 444; - Main.tile[index235, index236].frameX = (short) ((index235 - index231) * 18); - Main.tile[index235, index236].frameY = (short) ((index236 - index232 - 1) * 18); - } - } - continue; - } - } - else if (index231 < Main.maxTilesX - 1 && index232 < Main.maxTilesY - 2 && Main.tile[index231 + 1, index232].active() && Main.tile[index231 + 1, index232].type == (ushort) 60 && !Main.tile[index231 + 1, index232].bottomSlope() && WorldGen.genRand.Next(40) == 0) - { - bool flag = true; - for (int index237 = index231; index237 < index231 + 2; ++index237) - { - for (int index238 = index232 + 1; index238 < index232 + 3; ++index238) - { - if (Main.tile[index237, index238].active() && (!Main.tileCut[(int) Main.tile[index237, index238].type] || Main.tile[index237, index238].type == (ushort) 444)) - { - flag = false; - break; - } - if (Main.tile[index237, index238].liquid > (byte) 0 || Main.wallHouse[(int) Main.tile[index237, index238].wall]) - { - flag = false; - break; - } - } - if (!flag) - break; - } - if (flag) - { - if (WorldGen.CountNearBlocksTypes(index231, index232, 20, 1, 444) > 0) - flag = false; - } - if (flag) - { - for (int i = index231; i < index231 + 2; ++i) - { - for (int j = index232 + 1; j < index232 + 3; ++j) - WorldGen.KillTile(i, j); - } - for (int index239 = index231; index239 < index231 + 2; ++index239) - { - for (int index240 = index232 + 1; index240 < index232 + 3; ++index240) - { - Main.tile[index239, index240].active(true); - Main.tile[index239, index240].type = (ushort) 444; - Main.tile[index239, index240].frameX = (short) ((index239 - index231) * 18); - Main.tile[index239, index240].frameY = (short) ((index240 - index232 - 1) * 18); + Main.tile[index176, index177].active(true); + Main.tile[index176, index177].type = (ushort) 444; + Main.tile[index176, index177].frameX = (short) ((index176 - i22) * 18); + Main.tile[index176, index177].frameY = (short) ((index177 - j21 - 1) * 18); } } continue; } } if (WorldGen.genRand.Next(5) < 3) - num296 = WorldGen.genRand.Next(1, 10); + num195 = WorldGen.genRand.Next(1, 10); } } - int num297 = 0; - for (int y = 0; y < Main.maxTilesY; ++y) + int num196 = 0; + for (int index = 0; index < Main.maxTilesY; ++index) { - if (num297 > 0 && !Main.tile[index231, y].active()) + if (num196 > 0 && !Main.tile[i22, index].active()) { - Main.tile[index231, y].active(true); - Main.tile[index231, y].type = (ushort) 528; - --num297; + Main.tile[i22, index].active(true); + Main.tile[i22, index].type = (ushort) 205; + --num196; } else - num297 = 0; - if (Main.tile[index231, y].active() && Main.tile[index231, y].type == (ushort) 70 && WorldGen.genRand.Next(5) == 0 && !Main.tile[index231, y].bottomSlope() && WorldGen.GrowMoreVines(index231, y) && WorldGen.genRand.Next(5) < 3) - num297 = WorldGen.genRand.Next(1, 10); - } - int num298 = 0; - for (int y = 0; y < Main.maxTilesY; ++y) - { - if (num298 > 0 && !Main.tile[index231, y].active()) - { - Main.tile[index231, y].active(true); - Main.tile[index231, y].type = (ushort) 205; - --num298; - } - else - num298 = 0; - if (Main.tile[index231, y].active() && !Main.tile[index231, y].bottomSlope() && Main.tile[index231, y].type == (ushort) 199 && WorldGen.GrowMoreVines(index231, y) && WorldGen.genRand.Next(5) < 3) - num298 = WorldGen.genRand.Next(1, 10); + num196 = 0; + if (Main.tile[i22, index].active() && Main.tile[i22, index].type == (ushort) 199 && WorldGen.genRand.Next(5) < 3) + num196 = WorldGen.genRand.Next(1, 10); } } })); - WorldGen.AddGenerationPass("Flowers", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Flowers", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[44].Value; - for (int index241 = 0; (double) index241 < (double) Main.maxTilesX * 0.004; ++index241) + for (int index178 = 0; (double) index178 < (double) Main.maxTilesX * 0.005; ++index178) { - progress.Set((float) ((double) index241 / (double) Main.maxTilesX * 0.00400000018998981)); - int index242 = WorldGen.genRand.Next(32, Main.maxTilesX - 32); - int num299 = WorldGen.genRand.Next(15, 30); - int num300 = WorldGen.genRand.Next(15, 30); - for (int index243 = num300; (double) index243 < Main.worldSurface - (double) num300 - 1.0; ++index243) + int index179 = WorldGen.genRand.Next(20, Main.maxTilesX - 20); + int num197 = WorldGen.genRand.Next(5, 15); + int num198 = WorldGen.genRand.Next(15, 30); + for (int index180 = 1; (double) index180 < Main.worldSurface - 1.0; ++index180) { - if (Main.tile[index242, index243].active()) + if (Main.tile[index179, index180].active()) { - if (logX >= 0) + for (int index181 = index179 - num197; index181 < index179 + num197; ++index181) { - index242 = logX; - index243 = logY; - logX = -1; - } - int num301 = WorldGen.genRand.NextFromList(21, 24, 27, 30, 33, 36, 39, 42); - for (int i = index242 - num299; i < index242 + num299; ++i) - { - for (int j = index243 - num300; j < index243 + num300; ++j) + for (int index182 = index180 - num198; index182 < index180 + num198; ++index182) { - if (Main.tile[i, j].type != (ushort) 488 && !Main.tileSolid[(int) Main.tile[i, j].type]) + if (Main.tile[index181, index182].type == (ushort) 3 || Main.tile[index181, index182].type == (ushort) 24) { - if (Main.tile[i, j].type == (ushort) 3) - { - Main.tile[i, j].frameX = (short) ((num301 + WorldGen.genRand.Next(3)) * 18); - if (WorldGen.genRand.Next(3) != 0) - Main.tile[i, j].type = (ushort) 73; - } - else if (Main.tile[i, j + 1].wall == (ushort) 0 && (Main.tile[i, j + 1].type == (ushort) 2 || (Main.tile[i, j + 1].type == (ushort) 40 || Main.tile[i, j + 1].type == (ushort) 1 || TileID.Sets.Ore[(int) Main.tile[i, j + 1].type]) && !Main.tile[i, j].active()) && (!Main.tile[i, j].active() || Main.tile[i, j].type == (ushort) 185 || Main.tile[i, j].type == (ushort) 186 || Main.tile[i, j].type == (ushort) 187 || Main.tile[i, j].type == (ushort) 5 && (double) i < (double) Main.maxTilesX * 0.48 || (double) i > (double) Main.maxTilesX * 0.52)) - { - if (Main.tile[i, j + 1].type == (ushort) 40 || Main.tile[i, j + 1].type == (ushort) 1 || TileID.Sets.Ore[(int) Main.tile[i, j + 1].type]) - { - Main.tile[i, j + 1].type = (ushort) 2; - if (Main.tile[i, j + 2].type == (ushort) 40 || Main.tile[i, j + 2].type == (ushort) 1 || TileID.Sets.Ore[(int) Main.tile[i, j + 2].type]) - Main.tile[i, j + 2].type = (ushort) 2; - } - WorldGen.KillTile(i, j); - if (WorldGen.genRand.Next(2) == 0) - { - Main.tile[i, j + 1].slope((byte) 0); - Main.tile[i, j + 1].halfBrick(false); - } - WorldGen.PlaceTile(i, j, 3); - if (Main.tile[i, j].active() && Main.tile[i, j].type == (ushort) 3) - { - Main.tile[i, j].frameX = (short) ((num301 + WorldGen.genRand.Next(3)) * 18); - if (WorldGen.genRand.Next(3) != 0) - Main.tile[i, j].type = (ushort) 73; - } - if (Main.tile[i, j + 2].type == (ushort) 40 || Main.tile[i, j + 2].type == (ushort) 1 || TileID.Sets.Ore[(int) Main.tile[i, j + 2].type]) - Main.tile[i, j + 2].type = (ushort) 0; - } + Main.tile[index181, index182].frameX = (short) (WorldGen.genRand.Next(6, 8) * 18); + if (Main.tile[index181, index182].type == (ushort) 3 && WorldGen.genRand.Next(2) == 0) + Main.tile[index181, index182].frameX = (short) (WorldGen.genRand.Next(9, 11) * 18); } } } @@ -10009,27 +7374,26 @@ label_19: } } })); - WorldGen.AddGenerationPass("Mushrooms", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Mushrooms", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[45].Value; - for (int index244 = 0; (double) index244 < (double) Main.maxTilesX * 0.002; ++index244) + for (int index183 = 0; (double) index183 < (double) Main.maxTilesX * 0.002; ++index183) { - progress.Set((float) ((double) index244 / (double) Main.maxTilesX * (1.0 / 500.0))); - int index245 = WorldGen.genRand.Next(20, Main.maxTilesX - 20); - int num302 = WorldGen.genRand.Next(4, 10); - int num303 = WorldGen.genRand.Next(15, 30); - for (int index246 = 1; (double) index246 < Main.worldSurface - 1.0; ++index246) + int index184 = WorldGen.genRand.Next(20, Main.maxTilesX - 20); + int num199 = WorldGen.genRand.Next(4, 10); + int num200 = WorldGen.genRand.Next(15, 30); + for (int index185 = 1; (double) index185 < Main.worldSurface - 1.0; ++index185) { - if (Main.tile[index245, index246].active()) + if (Main.tile[index184, index185].active()) { - for (int index247 = index245 - num302; index247 < index245 + num302; ++index247) + for (int index186 = index184 - num199; index186 < index184 + num199; ++index186) { - for (int index248 = index246 - num303; index248 < index246 + num303 && index247 >= 10 && index248 >= 0 && index247 <= Main.maxTilesX - 10 && index248 <= Main.maxTilesY - 10; ++index248) + for (int index187 = index185 - num200; index187 < index185 + num200; ++index187) { - if (Main.tile[index247, index248].type == (ushort) 3 || Main.tile[index247, index248].type == (ushort) 24) - Main.tile[index247, index248].frameX = (short) 144; - else if (Main.tile[index247, index248].type == (ushort) 201) - Main.tile[index247, index248].frameX = (short) 270; + if (Main.tile[index186, index187].type == (ushort) 3 || Main.tile[index186, index187].type == (ushort) 24) + Main.tile[index186, index187].frameX = (short) 144; + else if (Main.tile[index186, index187].type == (ushort) 201) + Main.tile[index186, index187].frameX = (short) 270; } } break; @@ -10037,24 +7401,61 @@ label_19: } } })); - WorldGen.AddGenerationPass("Gems In Ice Biome", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Stalac", (WorldGenLegacyMethod) (progress => { - progress.Set(1f); - for (int index249 = 0; (double) index249 < (double) Main.maxTilesX * 0.25; ++index249) + for (int x = 20; x < Main.maxTilesX - 20; ++x) { - int index250 = WorldGen.genRand.Next((int) (Main.worldSurface + Main.rockLayer) / 2, WorldGen.lavaLine); - int index251 = WorldGen.genRand.Next(snowMinX[index250], snowMaxX[index250]); - if (Main.tile[index251, index250].active() && (Main.tile[index251, index250].type == (ushort) 147 || Main.tile[index251, index250].type == (ushort) 161 || Main.tile[index251, index250].type == (ushort) 162 || Main.tile[index251, index250].type == (ushort) 224)) + for (int worldSurface4 = (int) Main.worldSurface; worldSurface4 < Main.maxTilesY - 20; ++worldSurface4) { - int num304 = WorldGen.genRand.Next(1, 4); - int num305 = WorldGen.genRand.Next(1, 4); - int num306 = WorldGen.genRand.Next(1, 4); - int num307 = WorldGen.genRand.Next(1, 4); - int num308 = WorldGen.genRand.Next(12); - int style = num308 >= 3 ? (num308 >= 6 ? (num308 >= 8 ? (num308 >= 10 ? (num308 >= 11 ? 5 : 4) : 3) : 2) : 1) : 0; - for (int i = index251 - num304; i < index251 + num305; ++i) + if (!Main.tile[x, worldSurface4].active() && WorldGen.genRand.Next(5) == 0) { - for (int j = index250 - num306; j < index250 + num307; ++j) + if ((Main.tile[x, worldSurface4 - 1].type == (ushort) 1 || Main.tile[x, worldSurface4 - 1].type == (ushort) 147 || Main.tile[x, worldSurface4 - 1].type == (ushort) 161 || Main.tile[x, worldSurface4 - 1].type == (ushort) 25 || Main.tile[x, worldSurface4 - 1].type == (ushort) 203 || Main.tileStone[(int) Main.tile[x, worldSurface4 - 1].type] || Main.tileMoss[(int) Main.tile[x, worldSurface4 - 1].type]) && !Main.tile[x, worldSurface4].active() && !Main.tile[x, worldSurface4 + 1].active()) + Main.tile[x, worldSurface4 - 1].slope((byte) 0); + if ((Main.tile[x, worldSurface4 + 1].type == (ushort) 1 || Main.tile[x, worldSurface4 + 1].type == (ushort) 147 || Main.tile[x, worldSurface4 + 1].type == (ushort) 161 || Main.tile[x, worldSurface4 + 1].type == (ushort) 25 || Main.tile[x, worldSurface4 + 1].type == (ushort) 203 || Main.tileStone[(int) Main.tile[x, worldSurface4 + 1].type] || Main.tileMoss[(int) Main.tile[x, worldSurface4 + 1].type]) && !Main.tile[x, worldSurface4].active() && !Main.tile[x, worldSurface4 - 1].active()) + Main.tile[x, worldSurface4 + 1].slope((byte) 0); + WorldGen.PlaceTight(x, worldSurface4); + } + } + for (int y = 5; y < (int) Main.worldSurface; ++y) + { + if ((Main.tile[x, y - 1].type == (ushort) 147 || Main.tile[x, y - 1].type == (ushort) 161) && WorldGen.genRand.Next(5) == 0) + { + if (!Main.tile[x, y].active() && !Main.tile[x, y + 1].active()) + Main.tile[x, y - 1].slope((byte) 0); + WorldGen.PlaceTight(x, y); + } + if ((Main.tile[x, y - 1].type == (ushort) 25 || Main.tile[x, y - 1].type == (ushort) 203) && WorldGen.genRand.Next(5) == 0) + { + if (!Main.tile[x, y].active() && !Main.tile[x, y + 1].active()) + Main.tile[x, y - 1].slope((byte) 0); + WorldGen.PlaceTight(x, y); + } + if ((Main.tile[x, y + 1].type == (ushort) 25 || Main.tile[x, y + 1].type == (ushort) 203) && WorldGen.genRand.Next(5) == 0) + { + if (!Main.tile[x, y].active() && !Main.tile[x, y - 1].active()) + Main.tile[x, y + 1].slope((byte) 0); + WorldGen.PlaceTight(x, y); + } + } + } + })); + WorldGen.AddGenerationPass("Gems In Ice Biome", (WorldGenLegacyMethod) (progress => + { + for (int index188 = 0; (double) index188 < (double) Main.maxTilesX * 0.25; ++index188) + { + int index189 = WorldGen.genRand.Next((int) (Main.worldSurface + Main.rockLayer) / 2, WorldGen.lavaLine); + int index190 = WorldGen.genRand.Next(snowMinX[index189], snowMaxX[index189]); + if (Main.tile[index190, index189].active() && (Main.tile[index190, index189].type == (ushort) 147 || Main.tile[index190, index189].type == (ushort) 161 || Main.tile[index190, index189].type == (ushort) 162 || Main.tile[index190, index189].type == (ushort) 224)) + { + int num201 = WorldGen.genRand.Next(1, 4); + int num202 = WorldGen.genRand.Next(1, 4); + int num203 = WorldGen.genRand.Next(1, 4); + int num204 = WorldGen.genRand.Next(1, 4); + int num205 = WorldGen.genRand.Next(12); + int style = num205 >= 3 ? (num205 >= 6 ? (num205 >= 8 ? (num205 >= 10 ? (num205 >= 11 ? 5 : 4) : 3) : 2) : 1) : 0; + for (int i = index190 - num201; i < index190 + num202; ++i) + { + for (int j = index189 - num203; j < index189 + num204; ++j) { if (!Main.tile[i, j].active()) WorldGen.PlaceTile(i, j, 178, true, style: style); @@ -10063,61 +7464,39 @@ label_19: } } })); - WorldGen.AddGenerationPass("Random Gems", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Random Gems", (WorldGenLegacyMethod) (progress => { - progress.Set(1f); for (int index = 0; index < Main.maxTilesX; ++index) { int i = WorldGen.genRand.Next(20, Main.maxTilesX - 20); int j = WorldGen.genRand.Next((int) Main.rockLayer, Main.maxTilesY - 300); - if (!Main.tile[i, j].active() && !Main.tile[i, j].lava() && !Main.wallDungeon[(int) Main.tile[i, j].wall] && Main.tile[i, j].wall != (ushort) 27) + if (!Main.tile[i, j].active() && !Main.tile[i, j].lava() && !Main.wallDungeon[(int) Main.tile[i, j].wall] && Main.tile[i, j].wall != (byte) 27) { - int num309 = WorldGen.genRand.Next(12); - int style = num309 >= 3 ? (num309 >= 6 ? (num309 >= 8 ? (num309 >= 10 ? (num309 >= 11 ? 5 : 4) : 3) : 2) : 1) : 0; + int num = WorldGen.genRand.Next(12); + int style = num >= 3 ? (num >= 6 ? (num >= 8 ? (num >= 10 ? (num >= 11 ? 5 : 4) : 3) : 2) : 1) : 0; WorldGen.PlaceTile(i, j, 178, true, style: style); } } - for (int index252 = 0; index252 < Main.maxTilesX; ++index252) - { - int index253 = WorldGen.genRand.Next(20, Main.maxTilesX - 20); - int index254 = WorldGen.genRand.Next((int) Main.worldSurface, Main.maxTilesY - 300); - if (!Main.tile[index253, index254].active() && !Main.tile[index253, index254].lava() && (Main.tile[index253, index254].wall == (ushort) 216 || Main.tile[index253, index254].wall == (ushort) 187)) - { - int num310 = WorldGen.genRand.Next(1, 4); - int num311 = WorldGen.genRand.Next(1, 4); - int num312 = WorldGen.genRand.Next(1, 4); - int num313 = WorldGen.genRand.Next(1, 4); - for (int i = index253 - num310; i < index253 + num311; ++i) - { - for (int j = index254 - num312; j < index254 + num313; ++j) - { - if (!Main.tile[i, j].active()) - WorldGen.PlaceTile(i, j, 178, true, style: 6); - } - } - } - } })); - WorldGen.AddGenerationPass("Moss Grass", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Moss Grass", (WorldGenLegacyMethod) (progress => { - progress.Set(1f); - for (int index255 = 5; index255 < Main.maxTilesX - 5; ++index255) + for (int index191 = 5; index191 < Main.maxTilesX - 5; ++index191) { - for (int index256 = 5; index256 < Main.maxTilesY - 5; ++index256) + for (int index192 = 5; index192 < Main.maxTilesY - 5; ++index192) { - if (Main.tile[index255, index256].active() && Main.tileMoss[(int) Main.tile[index255, index256].type]) + if (Main.tile[index191, index192].active() && Main.tileMoss[(int) Main.tile[index191, index192].type]) { - for (int index257 = 0; index257 < 4; ++index257) + for (int index193 = 0; index193 < 4; ++index193) { - int i = index255; - int j = index256; - if (index257 == 0) + int i = index191; + int j = index192; + if (index193 == 0) --i; - if (index257 == 1) + if (index193 == 1) ++i; - if (index257 == 2) + if (index193 == 2) --j; - if (index257 == 3) + if (index193 == 3) ++j; if (!Main.tile[i, j].active()) WorldGen.PlaceTile(i, j, 184, true); @@ -10126,74 +7505,69 @@ label_19: } } })); - WorldGen.AddGenerationPass("Muds Walls In Jungle", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Muds Walls In Jungle", (WorldGenLegacyMethod) (progress => { - progress.Set(1f); - int num314 = 0; - int num315 = 0; - bool flag29 = false; - for (int index258 = 5; index258 < Main.maxTilesX - 5; ++index258) + int num206 = 0; + int num207 = 0; + bool flag18 = false; + for (int index194 = 5; index194 < Main.maxTilesX - 5; ++index194) { - for (int index259 = 0; (double) index259 < Main.worldSurface + 20.0; ++index259) + for (int index195 = 0; (double) index195 < Main.worldSurface + 20.0; ++index195) { - if (Main.tile[index258, index259].active() && Main.tile[index258, index259].type == (ushort) 60) + if (Main.tile[index194, index195].active() && Main.tile[index194, index195].type == (ushort) 60) { - num314 = index258; - flag29 = true; + num206 = index194; + flag18 = true; break; } } - if (flag29) + if (flag18) break; } - bool flag30 = false; - for (int index260 = Main.maxTilesX - 5; index260 > 5; --index260) + bool flag19 = false; + for (int index196 = Main.maxTilesX - 5; index196 > 5; --index196) { - for (int index261 = 0; (double) index261 < Main.worldSurface + 20.0; ++index261) + for (int index197 = 0; (double) index197 < Main.worldSurface + 20.0; ++index197) { - if (Main.tile[index260, index261].active() && Main.tile[index260, index261].type == (ushort) 60) + if (Main.tile[index196, index197].active() && Main.tile[index196, index197].type == (ushort) 60) { - num315 = index260; - flag30 = true; + num207 = index196; + flag19 = true; break; } } - if (flag30) + if (flag19) break; } - jungleMinX = num314; - jungleMaxX = num315; - for (int index262 = num314; index262 <= num315; ++index262) + for (int index198 = num206; index198 <= num207; ++index198) { - for (int index263 = 0; (double) index263 < Main.worldSurface + 20.0; ++index263) + for (int index199 = 0; (double) index199 < Main.worldSurface + 20.0; ++index199) { - if ((index262 >= num314 + 2 && index262 <= num315 - 2 || WorldGen.genRand.Next(2) != 0) && (index262 >= num314 + 3 && index262 <= num315 - 3 || WorldGen.genRand.Next(3) != 0) && (Main.tile[index262, index263].wall == (ushort) 2 || Main.tile[index262, index263].wall == (ushort) 59)) - Main.tile[index262, index263].wall = (ushort) 15; + if ((index198 >= num206 + 2 && index198 <= num207 - 2 || WorldGen.genRand.Next(2) != 0) && (index198 >= num206 + 3 && index198 <= num207 - 3 || WorldGen.genRand.Next(3) != 0) && (Main.tile[index198, index199].wall == (byte) 2 || Main.tile[index198, index199].wall == (byte) 59)) + Main.tile[index198, index199].wall = (byte) 15; } } })); - WorldGen.AddGenerationPass("Larva", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Larva", (WorldGenLegacyMethod) (progress => { - Main.tileSolid[229] = true; - progress.Set(1f); - for (int index264 = 0; index264 < WorldGen.numLarva; ++index264) + for (int index200 = 0; index200 < WorldGen.numLarva; ++index200) { - int i = WorldGen.larvaX[index264]; - int j = WorldGen.larvaY[index264]; - for (int index265 = i - 1; index265 <= i + 1; ++index265) + int i = WorldGen.larvaX[index200]; + int j = WorldGen.larvaY[index200]; + for (int index201 = i - 1; index201 <= i + 1; ++index201) { - for (int index266 = j - 2; index266 <= j + 1; ++index266) + for (int index202 = j - 2; index202 <= j + 1; ++index202) { - if (index266 != j + 1) + if (index202 != j + 1) { - Main.tile[index265, index266].active(false); + Main.tile[index201, index202].active(false); } else { - Main.tile[index265, index266].active(true); - Main.tile[index265, index266].type = (ushort) 225; - Main.tile[index265, index266].slope((byte) 0); - Main.tile[index265, index266].halfBrick(false); + Main.tile[index201, index202].active(true); + Main.tile[index201, index202].type = (ushort) 225; + Main.tile[index201, index202].slope((byte) 0); + Main.tile[index201, index202].halfBrick(false); } } } @@ -10202,1513 +7576,448 @@ label_19: Main.tileSolid[232] = true; Main.tileSolid[162] = true; })); - WorldGen.AddGenerationPass("Settle Liquids Again", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Settle Liquids Again", (WorldGenLegacyMethod) (progress => { - if (WorldGen.getGoodWorldGen) - Main.tileSolid[56] = true; progress.Message = Lang.gen[27].Value; - if (WorldGen.notTheBees) - WorldGen.NotTheBees(); - Liquid.worldGenTilesIgnoreWater(true); Liquid.QuickWater(3); WorldGen.WaterCheck(); - int num316 = 0; + int num208 = 0; Liquid.quickSettle = true; - int num317 = 10; - while (num316 < num317) + while (num208 < 10) { - int num318 = Liquid.numLiquid + LiquidBuffer.numLiquidBuffer; - ++num316; - float num319 = 0.0f; + int num209 = Liquid.numLiquid + LiquidBuffer.numLiquidBuffer; + ++num208; + float num210 = 0.0f; while (Liquid.numLiquid > 0) { - float num320 = (float) (num318 - (Liquid.numLiquid + LiquidBuffer.numLiquidBuffer)) / (float) num318; - if (Liquid.numLiquid + LiquidBuffer.numLiquidBuffer > num318) - num318 = Liquid.numLiquid + LiquidBuffer.numLiquidBuffer; - if ((double) num320 > (double) num319) - num319 = num320; + float num211 = (float) (num209 - (Liquid.numLiquid + LiquidBuffer.numLiquidBuffer)) / (float) num209; + if (Liquid.numLiquid + LiquidBuffer.numLiquidBuffer > num209) + num209 = Liquid.numLiquid + LiquidBuffer.numLiquidBuffer; + if ((double) num211 > (double) num210) + num210 = num211; else - num320 = num319; - if (num316 == 1) - progress.Set((float) ((double) num320 / 3.0 + 0.330000013113022)); + num211 = num210; + if (num208 == 1) + progress.Set((float) ((double) num211 / 3.0 + 0.330000013113022)); + int num212 = 10; + if (num208 > num212) + ; Liquid.UpdateLiquid(); } WorldGen.WaterCheck(); - progress.Set((float) ((double) (num316 / num317) / 3.0 + 0.660000026226044)); + progress.Set((float) ((double) num208 * 0.100000001490116 / 3.0 + 0.660000026226044)); } Liquid.quickSettle = false; - Liquid.worldGenTilesIgnoreWater(false); - Main.tileSolid[484] = false; })); - WorldGen.AddGenerationPass("Cactus, Palm Trees, & Coral", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Tile Cleanup", (WorldGenLegacyMethod) (progress => { - progress.Message = Lang.gen[38].Value; - int num321 = 8; - int num322 = 400; - int num323 = WorldGen.genRand.Next(3, 13); - int num324 = WorldGen.genRand.Next(3, 13); - WorldGen.genRand.Next(2, 6); - WorldGen.genRand.Next(2, 6); - int num325 = 380; - for (int index267 = 0; index267 < WorldGen.numOasis; ++index267) - { - int num326 = (int) ((double) WorldGen.oasisWidth[index267] * 1.5); - for (int index268 = (int) WorldGen.oasisPosition[index267].X - num326; index268 <= (int) WorldGen.oasisPosition[index267].X + num326; ++index268) - { - for (int index269 = (int) WorldGen.oasisPosition[index267].Y - WorldGen.oasisHeight; index269 <= (int) WorldGen.oasisPosition[index267].Y + WorldGen.oasisHeight; ++index269) - { - float num327 = 1f; - int num328 = 8; - for (int x = index268 - num328; x <= index268 + num328; ++x) - { - for (int y = index269 - num328; y <= index269 + num328; ++y) - { - if (WorldGen.InWorld(x, y) && Main.tile[x, y] != null && Main.tile[x, y].active() && Main.tile[x, y].type == (ushort) 323) - num327 = 0.13f; - } - } - if ((double) WorldGen.genRand.NextFloat() < (double) num327) - WorldGen.GrowPalmTree(index268, index269); - if (WorldGen.PlantSeaOat(index268, index269)) - { - if (WorldGen.genRand.Next(2) == 0) - WorldGen.GrowSeaOat(index268, index269); - if (WorldGen.genRand.Next(2) == 0) - WorldGen.GrowSeaOat(index268, index269); - } - WorldGen.PlaceOasisPlant(index268, index269); - } - } - } - for (int index270 = 0; index270 < 3; ++index270) - { - progress.Set((float) index270 / 3f); - int num329; - int num330; - bool flag; - int maxValue; - switch (index270) - { - case 1: - num329 = num322; - num330 = Main.maxTilesX - num322; - flag = true; - maxValue = num321; - break; - case 2: - num329 = Main.maxTilesX - num325; - num330 = Main.maxTilesX - 5; - flag = false; - maxValue = num324; - break; - default: - num329 = 5; - num330 = num325; - flag = false; - maxValue = num323; - break; - } - for (int index271 = num329; index271 < num330; ++index271) - { - if (WorldGen.genRand.Next(maxValue) == 0) - { - for (int index272 = 0; (double) index272 < Main.worldSurface - 1.0; ++index272) - { - Tile tile3 = Main.tile[index271, index272]; - if (tile3.active() && (tile3.type == (ushort) 53 || tile3.type == (ushort) 112 || tile3.type == (ushort) 234)) - { - Tile tile4 = Main.tile[index271, index272 - 1]; - if (!tile4.active() && tile4.wall == (ushort) 0) - { - if (flag) - { - int num331 = 0; - for (int index273 = index271 - WorldGen.cactusWaterWidth; index273 < index271 + WorldGen.cactusWaterWidth; ++index273) - { - for (int index274 = index272 - WorldGen.cactusWaterHeight; index274 < index272 + WorldGen.cactusWaterHeight; ++index274) - num331 += (int) Main.tile[index273, index274].liquid; - } - if (num331 / (int) byte.MaxValue > WorldGen.cactusWaterLimit) - { - if (WorldGen.genRand.Next(4) == 0) - { - WorldGen.GrowPalmTree(index271, index272); - break; - } - break; - } - WorldGen.PlantCactus(index271, index272); - break; - } - if (Main.tile[index271, index272 - 2].liquid == byte.MaxValue && Main.tile[index271, index272 - 3].liquid == byte.MaxValue && Main.tile[index271, index272 - 4].liquid == byte.MaxValue) - { - if (WorldGen.genRand.Next(2) == 0) - { - WorldGen.PlaceTile(index271, index272 - 1, 81, true); - break; - } - WorldGen.PlaceTile(index271, index272 - 1, 324, true, style: WorldGen.RollRandomSeaShellStyle()); - break; - } - if (Main.tile[index271, index272 - 2].liquid == (byte) 0 && (double) index272 < Main.worldSurface) - { - WorldGen.PlaceTile(index271, index272 - 1, 324, true, style: WorldGen.RollRandomSeaShellStyle()); - break; - } - } - } - } - } - else - { - for (int index275 = 0; (double) index275 < Main.worldSurface - 1.0; ++index275) - { - if (WorldGen.PlantSeaOat(index271, index275)) - { - if (WorldGen.genRand.Next(2) == 0) - WorldGen.GrowSeaOat(index271, index275); - if (WorldGen.genRand.Next(2) == 0) - WorldGen.GrowSeaOat(index271, index275); - } - WorldGen.PlaceOasisPlant(index271, index275); - } - } - } - } - })); - WorldGen.AddGenerationPass("Tile Cleanup", (WorldGenLegacyMethod) ((progress, passConfig) => - { - progress.Message = Lang.gen[84].Value; for (int i = 40; i < Main.maxTilesX - 40; ++i) { - progress.Set((float) (i - 40) / (float) (Main.maxTilesX - 80)); - for (int j = 40; j < Main.maxTilesY - 40; ++j) + for (int index203 = 40; index203 < Main.maxTilesY - 40; ++index203) { - if (Main.tile[i, j].active() && Main.tile[i, j].topSlope() && (Main.tile[i, j].leftSlope() && Main.tile[i + 1, j].halfBrick() || Main.tile[i, j].rightSlope() && Main.tile[i - 1, j].halfBrick())) + if (!Main.tile[i, index203].active() && Main.tile[i, index203].liquid == (byte) 0 && WorldGen.genRand.Next(3) != 0 && WorldGen.SolidTile(i, index203 - 1)) { - Main.tile[i, j].slope((byte) 0); - Main.tile[i, j].halfBrick(true); - } - if (Main.tile[i, j].active() && Main.tile[i, j].liquid > (byte) 0 && TileID.Sets.SlowlyDiesInWater[(int) Main.tile[i, j].type]) - WorldGen.KillTile(i, j); - if (!Main.tile[i, j].active() && Main.tile[i, j].liquid == (byte) 0 && WorldGen.genRand.Next(3) != 0 && WorldGen.SolidTile(i, j - 1)) - { - int num332 = WorldGen.genRand.Next(15, 21); - for (int index = j - 2; index >= j - num332; --index) + int num213 = WorldGen.genRand.Next(15, 21); + for (int index204 = index203 - 2; index204 >= index203 - num213; --index204) { - if (Main.tile[i, index].liquid >= (byte) 128) + if (Main.tile[i, index204].liquid >= (byte) 128) { - int num333 = 373; - if (Main.tile[i, index].lava()) - num333 = 374; - else if (Main.tile[i, index].honey()) - num333 = 375; - if (WorldGen.genRand.Next(j - index) <= 1) + int num214 = 373; + if (Main.tile[i, index204].lava()) + num214 = 374; + else if (Main.tile[i, index204].honey()) + num214 = 375; + if (WorldGen.genRand.Next(index203 - index204) <= 1) { - if (Main.tile[i, j].wall == (ushort) 86) - num333 = 375; - Main.tile[i, j].type = (ushort) num333; - Main.tile[i, j].frameX = (short) 0; - Main.tile[i, j].frameY = (short) 0; - Main.tile[i, j].active(true); + Main.tile[i, index203].type = (ushort) num214; + Main.tile[i, index203].frameX = (short) 0; + Main.tile[i, index203].frameY = (short) 0; + Main.tile[i, index203].active(true); break; } } } - if (!Main.tile[i, j].active()) + if (!Main.tile[i, index203].active()) { - int num334 = WorldGen.genRand.Next(3, 11); - for (int index = j + 1; index <= j + num334; ++index) + int num215 = WorldGen.genRand.Next(3, 11); + for (int index205 = index203 + 1; index205 <= index203 + num215; ++index205) { - if (Main.tile[i, index].liquid >= (byte) 200) + if (Main.tile[i, index205].liquid >= (byte) 200) { - int num335 = 373; - if (Main.tile[i, index].lava()) - num335 = 374; - else if (Main.tile[i, index].honey()) - num335 = 375; - if (WorldGen.genRand.Next((index - j) * 3) <= 1) + int num216 = 373; + if (Main.tile[i, index205].lava()) + num216 = 374; + else if (Main.tile[i, index205].honey()) + num216 = 375; + if (WorldGen.genRand.Next((index205 - index203) * 3) <= 1) { - Main.tile[i, j].type = (ushort) num335; - Main.tile[i, j].frameX = (short) 0; - Main.tile[i, j].frameY = (short) 0; - Main.tile[i, j].active(true); + Main.tile[i, index203].type = (ushort) num216; + Main.tile[i, index203].frameX = (short) 0; + Main.tile[i, index203].frameY = (short) 0; + Main.tile[i, index203].active(true); break; } } } } - if (!Main.tile[i, j].active() && WorldGen.genRand.Next(4) == 0) + if (!Main.tile[i, index203].active() && WorldGen.genRand.Next(3) != 0) { - Tile tile = Main.tile[i, j - 1]; + Tile tile = Main.tile[i, index203 - 1]; if (TileID.Sets.Conversion.Sandstone[(int) tile.type] || TileID.Sets.Conversion.HardenedSand[(int) tile.type]) { - Main.tile[i, j].type = (ushort) 461; - Main.tile[i, j].frameX = (short) 0; - Main.tile[i, j].frameY = (short) 0; - Main.tile[i, j].active(true); + Main.tile[i, index203].type = (ushort) 461; + Main.tile[i, index203].frameX = (short) 0; + Main.tile[i, index203].frameY = (short) 0; + Main.tile[i, index203].active(true); } } } - if (Main.tile[i, j].type == (ushort) 137) + if (Main.tile[i, index203].type == (ushort) 137) { - if (Main.tile[i, j].frameY <= (short) 52) + if (Main.tile[i, index203].frameY <= (short) 52) { - int num336 = -1; - if (Main.tile[i, j].frameX >= (short) 18) - num336 = 1; - if (Main.tile[i + num336, j].halfBrick() || Main.tile[i + num336, j].slope() != (byte) 0) - Main.tile[i + num336, j].active(false); + int num = -1; + if (Main.tile[i, index203].frameX >= (short) 18) + num = 1; + if (Main.tile[i + num, index203].halfBrick() || Main.tile[i + num, index203].slope() != (byte) 0) + Main.tile[i + num, index203].active(false); } } - else if (Main.tile[i, j].type == (ushort) 162 && Main.tile[i, j + 1].liquid == (byte) 0 && WorldGen.CanKillTile(i, j)) - Main.tile[i, j].active(false); - if (Main.tile[i, j].wall == (ushort) 13 || Main.tile[i, j].wall == (ushort) 14) - Main.tile[i, j].liquid = (byte) 0; - if (Main.tile[i, j].type == (ushort) 31) + else if (Main.tile[i, index203].type == (ushort) 162 && Main.tile[i, index203 + 1].liquid == (byte) 0) + Main.tile[i, index203].active(false); + if (Main.tile[i, index203].wall == (byte) 13 || Main.tile[i, index203].wall == (byte) 14) + Main.tile[i, index203].liquid = (byte) 0; + if (Main.tile[i, index203].type == (ushort) 31) { - int num337 = (int) Main.tile[i, j].frameX / 18; - int num338 = 0; - int num339 = i; - int num340 = num338 + num337 / 2; - int num341 = !WorldGen.drunkWorldGen ? (WorldGen.crimson ? 1 : 0) : (Main.tile[i, j].wall != (ushort) 83 ? 0 : 1); - int num342 = num337 % 2; - int num343 = num339 - num342; - int num344 = (int) Main.tile[i, j].frameY / 18; - int num345 = 0; - int num346 = j; - int num347 = num345 + num344 / 2; - int num348 = num344 % 2; - int num349 = num346 - num348; - for (int index276 = 0; index276 < 2; ++index276) + int num217 = (int) Main.tile[i, index203].frameX / 18; + int num218 = 0; + int num219 = i; + int num220 = num218 + num217 / 2; + int num221 = WorldGen.crimson ? 1 : 0; + int num222 = num217 % 2; + int num223 = num219 - num222; + int num224 = (int) Main.tile[i, index203].frameY / 18; + int num225 = 0; + int num226 = index203; + int num227 = num225 + num224 / 2; + int num228 = num224 % 2; + int num229 = num226 - num228; + for (int index206 = 0; index206 < 2; ++index206) { - for (int index277 = 0; index277 < 2; ++index277) + for (int index207 = 0; index207 < 2; ++index207) { - int index278 = num343 + index276; - int index279 = num349 + index277; - Main.tile[index278, index279].active(true); - Main.tile[index278, index279].slope((byte) 0); - Main.tile[index278, index279].halfBrick(false); - Main.tile[index278, index279].type = (ushort) 31; - Main.tile[index278, index279].frameX = (short) (index276 * 18 + 36 * num341); - Main.tile[index278, index279].frameY = (short) (index277 * 18 + 36 * num347); + int index208 = num223 + index206; + int index209 = num229 + index207; + Main.tile[index208, index209].active(true); + Main.tile[index208, index209].slope((byte) 0); + Main.tile[index208, index209].halfBrick(false); + Main.tile[index208, index209].type = (ushort) 31; + Main.tile[index208, index209].frameX = (short) (index206 * 18 + 36 * num221); + Main.tile[index208, index209].frameY = (short) (index207 * 18 + 36 * num227); } } } - if (Main.tile[i, j].type == (ushort) 12) + if (Main.tile[i, index203].type == (ushort) 12) { - int num350 = (int) Main.tile[i, j].frameX / 18; - int num351 = 0; - int num352 = i; - int num353 = num351 + num350 / 2; - int num354 = num350 % 2; - int num355 = num352 - num354; - int num356 = (int) Main.tile[i, j].frameY / 18; - int num357 = 0; - int num358 = j; - int num359 = num357 + num356 / 2; - int num360 = num356 % 2; - int num361 = num358 - num360; - for (int index280 = 0; index280 < 2; ++index280) + int num230 = (int) Main.tile[i, index203].frameX / 18; + int num231 = 0; + int num232 = i; + int num233 = num231 + num230 / 2; + int num234 = num230 % 2; + int num235 = num232 - num234; + int num236 = (int) Main.tile[i, index203].frameY / 18; + int num237 = 0; + int num238 = index203; + int num239 = num237 + num236 / 2; + int num240 = num236 % 2; + int num241 = num238 - num240; + for (int index210 = 0; index210 < 2; ++index210) { - for (int index281 = 0; index281 < 2; ++index281) + for (int index211 = 0; index211 < 2; ++index211) { - int index282 = num355 + index280; - int index283 = num361 + index281; - Main.tile[index282, index283].active(true); - Main.tile[index282, index283].slope((byte) 0); - Main.tile[index282, index283].halfBrick(false); - Main.tile[index282, index283].type = (ushort) 12; - Main.tile[index282, index283].frameX = (short) (index280 * 18 + 36 * num353); - Main.tile[index282, index283].frameY = (short) (index281 * 18 + 36 * num359); + int index212 = num235 + index210; + int index213 = num241 + index211; + Main.tile[index212, index213].active(true); + Main.tile[index212, index213].slope((byte) 0); + Main.tile[index212, index213].halfBrick(false); + Main.tile[index212, index213].type = (ushort) 12; + Main.tile[index212, index213].frameX = (short) (index210 * 18 + 36 * num233); + Main.tile[index212, index213].frameY = (short) (index211 * 18 + 36 * num239); } - if (!Main.tile[index280, j + 2].active()) + if (!Main.tile[index210, index203 + 2].active()) { - Main.tile[index280, j + 2].active(true); - if (!Main.tileSolid[(int) Main.tile[index280, j + 2].type] || Main.tileSolidTop[(int) Main.tile[index280, j + 2].type]) - Main.tile[index280, j + 2].type = (ushort) 0; + Main.tile[index210, index203 + 2].active(true); + if (!Main.tileSolid[(int) Main.tile[index210, index203 + 2].type] || Main.tileSolidTop[(int) Main.tile[index210, index203 + 2].type]) + Main.tile[index210, index203 + 2].type = (ushort) 0; } - Main.tile[index280, j + 2].slope((byte) 0); - Main.tile[index280, j + 2].halfBrick(false); + Main.tile[index210, index203 + 2].slope((byte) 0); + Main.tile[index210, index203 + 2].halfBrick(false); } } - if (TileID.Sets.BasicChest[(int) Main.tile[i, j].type]) + if (TileID.Sets.BasicChest[(int) Main.tile[i, index203].type]) { - int num362 = (int) Main.tile[i, j].frameX / 18; - int num363 = 0; - ushort num364 = 21; - int num365 = i; - int Y = j - (int) Main.tile[i, j].frameY / 18; - if (Main.tile[i, j].type == (ushort) 467) - num364 = (ushort) 467; - for (; num362 >= 2; num362 -= 2) - ++num363; - int X = num365 - num362; + int num242 = (int) Main.tile[i, index203].frameX / 18; + int num243 = 0; + int num244 = i; + int Y = index203 - (int) Main.tile[i, index203].frameY / 18; + for (; num242 >= 2; num242 -= 2) + ++num243; + int X = num244 - num242; int chest = Chest.FindChest(X, Y); if (chest != -1) { switch (Main.chest[chest].item[0].type) { case 1156: - num363 = 23; + num243 = 23; break; case 1260: - num363 = 26; + num243 = 26; break; case 1569: - num363 = 25; + num243 = 25; break; case 1571: - num363 = 24; + num243 = 24; break; case 1572: - num363 = 27; + num243 = 27; break; } } - for (int index284 = 0; index284 < 2; ++index284) + for (int index214 = 0; index214 < 2; ++index214) { - for (int index285 = 0; index285 < 2; ++index285) + for (int index215 = 0; index215 < 2; ++index215) { - int index286 = X + index284; - int index287 = Y + index285; - Main.tile[index286, index287].active(true); - Main.tile[index286, index287].slope((byte) 0); - Main.tile[index286, index287].halfBrick(false); - Main.tile[index286, index287].type = num364; - Main.tile[index286, index287].frameX = (short) (index284 * 18 + 36 * num363); - Main.tile[index286, index287].frameY = (short) (index285 * 18); + int index216 = X + index214; + int index217 = Y + index215; + Main.tile[index216, index217].active(true); + Main.tile[index216, index217].slope((byte) 0); + Main.tile[index216, index217].halfBrick(false); + Main.tile[index216, index217].type = (ushort) 21; + Main.tile[index216, index217].frameX = (short) (index214 * 18 + 36 * num243); + Main.tile[index216, index217].frameY = (short) (index215 * 18); } - if (!Main.tile[index284, j + 2].active()) + if (!Main.tile[index214, index203 + 2].active()) { - Main.tile[index284, j + 2].active(true); - if (!Main.tileSolid[(int) Main.tile[index284, j + 2].type] || Main.tileSolidTop[(int) Main.tile[index284, j + 2].type]) - Main.tile[index284, j + 2].type = (ushort) 0; + Main.tile[index214, index203 + 2].active(true); + if (!Main.tileSolid[(int) Main.tile[index214, index203 + 2].type] || Main.tileSolidTop[(int) Main.tile[index214, index203 + 2].type]) + Main.tile[index214, index203 + 2].type = (ushort) 0; } - Main.tile[index284, j + 2].slope((byte) 0); - Main.tile[index284, j + 2].halfBrick(false); + Main.tile[index214, index203 + 2].slope((byte) 0); + Main.tile[index214, index203 + 2].halfBrick(false); } } - if (Main.tile[i, j].type == (ushort) 28) + if (Main.tile[i, index203].type == (ushort) 28) { - int num366 = (int) Main.tile[i, j].frameX / 18; - int num367 = 0; - int num368 = i; - for (; num366 >= 2; num366 -= 2) - ++num367; - int num369 = num368 - num366; - int num370 = (int) Main.tile[i, j].frameY / 18; - int num371 = 0; - int num372 = j; - for (; num370 >= 2; num370 -= 2) - ++num371; - int num373 = num372 - num370; - for (int index288 = 0; index288 < 2; ++index288) + int num245 = (int) Main.tile[i, index203].frameX / 18; + int num246 = 0; + int num247 = i; + for (; num245 >= 2; num245 -= 2) + ++num246; + int num248 = num247 - num245; + int num249 = (int) Main.tile[i, index203].frameY / 18; + int num250 = 0; + int num251 = index203; + for (; num249 >= 2; num249 -= 2) + ++num250; + int num252 = num251 - num249; + for (int index218 = 0; index218 < 2; ++index218) { - for (int index289 = 0; index289 < 2; ++index289) + for (int index219 = 0; index219 < 2; ++index219) { - int index290 = num369 + index288; - int index291 = num373 + index289; - Main.tile[index290, index291].active(true); - Main.tile[index290, index291].slope((byte) 0); - Main.tile[index290, index291].halfBrick(false); - Main.tile[index290, index291].type = (ushort) 28; - Main.tile[index290, index291].frameX = (short) (index288 * 18 + 36 * num367); - Main.tile[index290, index291].frameY = (short) (index289 * 18 + 36 * num371); + int index220 = num248 + index218; + int index221 = num252 + index219; + Main.tile[index220, index221].active(true); + Main.tile[index220, index221].slope((byte) 0); + Main.tile[index220, index221].halfBrick(false); + Main.tile[index220, index221].type = (ushort) 28; + Main.tile[index220, index221].frameX = (short) (index218 * 18 + 36 * num246); + Main.tile[index220, index221].frameY = (short) (index219 * 18 + 36 * num250); } - if (!Main.tile[index288, j + 2].active()) + if (!Main.tile[index218, index203 + 2].active()) { - Main.tile[index288, j + 2].active(true); - if (!Main.tileSolid[(int) Main.tile[index288, j + 2].type] || Main.tileSolidTop[(int) Main.tile[index288, j + 2].type]) - Main.tile[index288, j + 2].type = (ushort) 0; + Main.tile[index218, index203 + 2].active(true); + if (!Main.tileSolid[(int) Main.tile[index218, index203 + 2].type] || Main.tileSolidTop[(int) Main.tile[index218, index203 + 2].type]) + Main.tile[index218, index203 + 2].type = (ushort) 0; } - Main.tile[index288, j + 2].slope((byte) 0); - Main.tile[index288, j + 2].halfBrick(false); + Main.tile[index218, index203 + 2].slope((byte) 0); + Main.tile[index218, index203 + 2].halfBrick(false); } } - if (Main.tile[i, j].type == (ushort) 26) + if (Main.tile[i, index203].type == (ushort) 26) { - int num374 = (int) Main.tile[i, j].frameX / 18; - int num375 = 0; - int num376 = i; - int num377 = j - (int) Main.tile[i, j].frameY / 18; - for (; num374 >= 3; num374 -= 3) - ++num375; - int num378 = num376 - num374; - int num379 = !WorldGen.drunkWorldGen ? (!WorldGen.crimson ? 0 : 1) : (Main.tile[i, j].wall != (ushort) 83 ? 0 : 1); - for (int index292 = 0; index292 < 3; ++index292) + int num253 = (int) Main.tile[i, index203].frameX / 18; + int num254 = 0; + int num255 = i; + int num256 = index203 - (int) Main.tile[i, index203].frameY / 18; + for (; num253 >= 3; num253 -= 3) + ++num254; + int num257 = num255 - num253; + for (int index222 = 0; index222 < 3; ++index222) { - for (int index293 = 0; index293 < 2; ++index293) + for (int index223 = 0; index223 < 2; ++index223) { - int index294 = num378 + index292; - int index295 = num377 + index293; - Main.tile[index294, index295].active(true); - Main.tile[index294, index295].slope((byte) 0); - Main.tile[index294, index295].halfBrick(false); - Main.tile[index294, index295].type = (ushort) 26; - Main.tile[index294, index295].frameX = (short) (index292 * 18 + 54 * num379); - Main.tile[index294, index295].frameY = (short) (index293 * 18); + int index224 = num257 + index222; + int index225 = num256 + index223; + Main.tile[index224, index225].active(true); + Main.tile[index224, index225].slope((byte) 0); + Main.tile[index224, index225].halfBrick(false); + Main.tile[index224, index225].type = (ushort) 26; + Main.tile[index224, index225].frameX = (short) (index222 * 18 + 54 * num254); + Main.tile[index224, index225].frameY = (short) (index223 * 18); } - if (!Main.tile[num378 + index292, num377 + 2].active() || !Main.tileSolid[(int) Main.tile[num378 + index292, num377 + 2].type] || Main.tileSolidTop[(int) Main.tile[num378 + index292, num377 + 2].type]) + if (!Main.tile[num257 + index222, num256 + 2].active() || !Main.tileSolid[(int) Main.tile[num257 + index222, num256 + 2].type] || Main.tileSolidTop[(int) Main.tile[num257 + index222, num256 + 2].type]) { - Main.tile[num378 + index292, num377 + 2].active(true); - if (!TileID.Sets.Platforms[(int) Main.tile[num378 + index292, num377 + 2].type] && (!Main.tileSolid[(int) Main.tile[num378 + index292, num377 + 2].type] || Main.tileSolidTop[(int) Main.tile[num378 + index292, num377 + 2].type])) - Main.tile[num378 + index292, num377 + 2].type = (ushort) 0; + Main.tile[num257 + index222, num256 + 2].active(true); + if (!TileID.Sets.Platforms[(int) Main.tile[num257 + index222, num256 + 2].type] && (!Main.tileSolid[(int) Main.tile[num257 + index222, num256 + 2].type] || Main.tileSolidTop[(int) Main.tile[num257 + index222, num256 + 2].type])) + Main.tile[num257 + index222, num256 + 2].type = (ushort) 0; } - Main.tile[num378 + index292, num377 + 2].slope((byte) 0); - Main.tile[num378 + index292, num377 + 2].halfBrick(false); - if (Main.tile[num378 + index292, num377 + 3].type == (ushort) 28 && (int) Main.tile[num378 + index292, num377 + 3].frameY % 36 >= 18) + Main.tile[num257 + index222, num256 + 2].slope((byte) 0); + Main.tile[num257 + index222, num256 + 2].halfBrick(false); + if (Main.tile[num257 + index222, num256 + 3].type == (ushort) 28 && (int) Main.tile[num257 + index222, num256 + 3].frameY % 36 >= 18) { - Main.tile[num378 + index292, num377 + 3].type = (ushort) 0; - Main.tile[num378 + index292, num377 + 3].active(false); + Main.tile[num257 + index222, num256 + 3].type = (ushort) 0; + Main.tile[num257 + index222, num256 + 3].active(false); } } - for (int index = 0; index < 3; ++index) + for (int index226 = 0; index226 < 3; ++index226) { - if ((Main.tile[num378 - 1, num377 + index].type == (ushort) 28 || Main.tile[num378 - 1, num377 + index].type == (ushort) 12) && (int) Main.tile[num378 - 1, num377 + index].frameX % 36 < 18) + if ((Main.tile[num257 - 1, num256 + index226].type == (ushort) 28 || Main.tile[num257 - 1, num256 + index226].type == (ushort) 12) && (int) Main.tile[num257 - 1, num256 + index226].frameX % 36 < 18) { - Main.tile[num378 - 1, num377 + index].type = (ushort) 0; - Main.tile[num378 - 1, num377 + index].active(false); + Main.tile[num257 - 1, num256 + index226].type = (ushort) 0; + Main.tile[num257 - 1, num256 + index226].active(false); } - if ((Main.tile[num378 + 3, num377 + index].type == (ushort) 28 || Main.tile[num378 + 3, num377 + index].type == (ushort) 12) && (int) Main.tile[num378 + 3, num377 + index].frameX % 36 >= 18) + if ((Main.tile[num257 + 3, num256 + index226].type == (ushort) 28 || Main.tile[num257 + 3, num256 + index226].type == (ushort) 12) && (int) Main.tile[num257 + 3, num256 + index226].frameX % 36 >= 18) { - Main.tile[num378 + 3, num377 + index].type = (ushort) 0; - Main.tile[num378 + 3, num377 + index].active(false); + Main.tile[num257 + 3, num256 + index226].type = (ushort) 0; + Main.tile[num257 + 3, num256 + index226].active(false); } } } - if (Main.tile[i, j].type == (ushort) 237 && Main.tile[i, j + 1].type == (ushort) 232) - Main.tile[i, j + 1].type = (ushort) 226; - if (Main.tile[i, j].wall == (ushort) 87) - Main.tile[i, j].liquid = (byte) 0; + if (Main.tile[i, index203].type == (ushort) 237 && Main.tile[i, index203 + 1].type == (ushort) 232) + Main.tile[i, index203 + 1].type = (ushort) 226; } } })); - WorldGen.AddGenerationPass("Lihzahrd Altars", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Lihzahrd Altars", (WorldGenLegacyMethod) (progress => { - progress.Set(1f); - for (int index296 = 0; index296 < 3; ++index296) + int lAltarX = WorldGen.lAltarX; + int lAltarY = WorldGen.lAltarY; + for (int index227 = 0; index227 <= 2; ++index227) { - for (int index297 = 0; index297 < 2; ++index297) + for (int index228 = 0; index228 <= 1; ++index228) { - int index298 = WorldGen.lAltarX + index296; - int index299 = WorldGen.lAltarY + index297; - Main.tile[index298, index299].active(true); - Main.tile[index298, index299].type = (ushort) 237; - Main.tile[index298, index299].frameX = (short) (index296 * 18); - Main.tile[index298, index299].frameY = (short) (index297 * 18); + int index229 = lAltarX + index227; + int index230 = lAltarY + index228; + Main.tile[index229, index230].active(true); + Main.tile[index229, index230].type = (ushort) 237; + Main.tile[index229, index230].frameX = (short) (index227 * 18); + Main.tile[index229, index230].frameY = (short) (index228 * 18); } - Main.tile[WorldGen.lAltarX + index296, WorldGen.lAltarY + 2].active(true); - Main.tile[WorldGen.lAltarX + index296, WorldGen.lAltarY + 2].slope((byte) 0); - Main.tile[WorldGen.lAltarX + index296, WorldGen.lAltarY + 2].halfBrick(false); - Main.tile[WorldGen.lAltarX + index296, WorldGen.lAltarY + 2].type = (ushort) 226; - } - for (int index300 = 0; index300 < 3; ++index300) - { - for (int index301 = 0; index301 < 2; ++index301) - WorldGen.SquareTileFrame(WorldGen.lAltarX + index300, WorldGen.lAltarY + index301); + Main.tile[index227, lAltarY + 2].active(true); + Main.tile[index227, lAltarY + 2].slope((byte) 0); + Main.tile[index227, lAltarY + 2].halfBrick(false); + Main.tile[index227, lAltarY + 2].type = (ushort) 226; } })); - WorldGen.AddGenerationPass("Micro Biomes", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Micro Biomes", (WorldGenLegacyMethod) (progress => { progress.Message = Lang.gen[76].Value; - double num380 = (double) (Main.maxTilesX * Main.maxTilesY) / 5040000.0; - float num381 = 10f; - if (WorldGen.getGoodWorldGen) - num381 *= 10f; - DeadMansChestBiome biome1 = configuration.CreateBiome(); - List possibleChestsToTrapify = biome1.GetPossibleChestsToTrapify(structures); - int random5 = passConfig.Get("DeadManChests").GetRandom(WorldGen.genRand); - int num382 = 0; - while (num382 < random5 && possibleChestsToTrapify.Count > 0) + float num258 = (float) (Main.maxTilesX * Main.maxTilesY) / 5040000f; + float num259 = (float) Main.maxTilesX / 4200f; + int num260 = (int) ((double) WorldGen.genRand.Next(3, 6) * (double) num258); + int num261 = 0; + while (num261 < num260) { - int index = possibleChestsToTrapify[WorldGen.genRand.Next(possibleChestsToTrapify.Count)]; - Point origin = new Point(Main.chest[index].x, Main.chest[index].y); - biome1.Place(origin, structures); - ++num382; - possibleChestsToTrapify.Remove(index); - } - progress.Set(1f / num381); - if (!WorldGen.notTheBees) - { - ThinIceBiome biome2 = configuration.CreateBiome(); - int random6 = passConfig.Get("ThinIcePatchCount").GetRandom(WorldGen.genRand); - int num383 = 0; - while (num383 < random6) - { - if (biome2.Place(WorldGen.RandomWorldPoint((int) Main.worldSurface + 20, 50, 200, 50), structures)) - ++num383; - } + if (Terraria.World.Generation.Biomes.Place(WorldGen.RandomWorldPoint((int) Main.worldSurface + 20, 50, 200, 50), structures)) + ++num261; } progress.Set(0.1f); - progress.Set(2f / num381); - EnchantedSwordBiome biome3 = configuration.CreateBiome(); - int random7 = passConfig.Get("SwordShrineAttempts").GetRandom(WorldGen.genRand); - float num384 = passConfig.Get("SwordShrinePlacementChance"); - for (int index = 0; index < random7; ++index) + int num262 = (int) Math.Ceiling((double) num258); + int num263 = 0; + while (num263 < num262) { - if ((double) WorldGen.genRand.NextFloat() <= (double) num384) - { - int num385 = 0; - while (num385++ <= Main.maxTilesX) - { - Point origin; - origin.Y = (int) worldSurface + WorldGen.genRand.Next(50, 100); - origin.X = WorldGen.genRand.Next(2) != 0 ? WorldGen.genRand.Next((int) ((double) Main.maxTilesX * 0.699999988079071), Main.maxTilesX - 50) : WorldGen.genRand.Next(50, (int) ((double) Main.maxTilesX * 0.300000011920929)); - if (biome3.Place(origin, structures)) - break; - } - } + Point origin; + origin.Y = (int) worldSurface + WorldGen.genRand.Next(50, 100); + origin.X = WorldGen.genRand.Next(2) != 0 ? WorldGen.genRand.Next((int) ((double) Main.maxTilesX * 0.699999988079071), Main.maxTilesX - 50) : WorldGen.genRand.Next(50, (int) ((double) Main.maxTilesX * 0.300000011920929)); + if (Terraria.World.Generation.Biomes.Place(origin, structures)) + ++num263; } progress.Set(0.2f); - progress.Set(3f / num381); - if (!WorldGen.notTheBees) + int num264 = (int) ((double) WorldGen.genRand.Next(6, 12) * (double) num258); + int num265 = 0; + while (num265 < num264) { - CampsiteBiome biome4 = configuration.CreateBiome(); - int random8 = passConfig.Get("CampsiteCount").GetRandom(WorldGen.genRand); - int num386 = 0; - while (num386 < random8) - { - if (biome4.Place(WorldGen.RandomWorldPoint((int) Main.worldSurface, WorldGen.beachDistance, 200, WorldGen.beachDistance), structures)) - ++num386; - } + if (Terraria.World.Generation.Biomes.Place(WorldGen.RandomWorldPoint((int) Main.worldSurface, 50, 200, 50), structures)) + ++num265; } - progress.Set(4f / num381); - if (!WorldGen.notTheBees) + int num266 = (int) ((double) WorldGen.genRand.Next(14, 30) * (double) num258); + int num267 = 0; + while (num267 < num266) { - MiningExplosivesBiome biome5 = configuration.CreateBiome(); - int num387 = passConfig.Get("ExplosiveTrapCount").GetRandom(WorldGen.genRand); - if (WorldGen.getGoodWorldGen) - num387 = (int) ((double) num387 * 1.5); - int num388 = 0; - while (num388 < num387) - { - if (biome5.Place(WorldGen.RandomWorldPoint((int) rockLayer, WorldGen.beachDistance, 200, WorldGen.beachDistance), structures)) - ++num388; - } + if (Terraria.World.Generation.Biomes.Place(WorldGen.RandomWorldPoint((int) rockLayer, 50, 200, 50), structures)) + ++num267; } progress.Set(0.3f); - progress.Set(5f / num381); - MahoganyTreeBiome biome6 = configuration.CreateBiome(); - int random9 = passConfig.Get("LivingTreeCount").GetRandom(WorldGen.genRand); - int num389 = 0; - for (int index = 0; num389 < random9 && index < 20000; ++index) + int num268 = (int) ((double) WorldGen.genRand.Next(6, 12) * (double) num259); + int num269 = 0; + for (int index = 0; num269 < num268 && index < 20000; ++index) { - if (biome6.Place(WorldGen.RandomWorldPoint((int) Main.worldSurface + 50, 50, 500, 50), structures)) - ++num389; + if (Terraria.World.Generation.Biomes.Place(WorldGen.RandomWorldPoint((int) Main.worldSurface + 50, 50, 500, 50), structures)) + ++num269; } progress.Set(0.4f); - progress.Set(6f / num381); - progress.Set(7f / num381); - TrackGenerator trackGenerator = new TrackGenerator(); - int random10 = passConfig.Get("LongTrackCount").GetRandom(WorldGen.genRand); - WorldGenRange worldGenRange1 = passConfig.Get("LongTrackLength"); - int num390 = Main.maxTilesX * 10; - int num391 = 0; - int num392 = 0; - while (num392 < random10) + if (!WorldGen.crimson) { - if (trackGenerator.Place(WorldGen.RandomWorldPoint((int) Main.worldSurface, 10, 200, 10), worldGenRange1.ScaledMinimum, worldGenRange1.ScaledMaximum)) + int num270 = (int) ((double) WorldGen.genRand.Next(1, 3) * (double) num258); + int num271 = 0; + while (num271 < num270) { - ++num392; - num391 = 0; - } - else - { - ++num391; - if (num391 > num390) - { - ++num392; - num391 = 0; - } - } - } - progress.Set(8f / num381); - int random11 = passConfig.Get("StandardTrackCount").GetRandom(WorldGen.genRand); - WorldGenRange worldGenRange2 = passConfig.Get("StandardTrackLength"); - int num393 = 0; - while (num393 < random11) - { - if (trackGenerator.Place(WorldGen.RandomWorldPoint((int) Main.worldSurface, 10, 200, 10), worldGenRange2.ScaledMinimum, worldGenRange2.ScaledMaximum)) - ++num393; - } - progress.Set(9f / num381); - if (!WorldGen.notTheBees) - { - double num394 = (double) Main.maxTilesX * 0.02; - if (WorldGen.getGoodWorldGen) - { - float num395 = num381 * 2f; - } - for (int index = 0; (double) index < num394; ++index) - { - int num396 = 0; - while (num396 < 10150 && !WorldGen.placeLavaTrap(WorldGen.genRand.Next(200, Main.maxTilesX - 200), WorldGen.genRand.Next(WorldGen.lavaLine - 100, Main.maxTilesY - 210))) - ++num396; + if (Terraria.World.Generation.Biomes.Place(WorldGen.RandomWorldPoint((int) Main.worldSurface, 50, 500, 50), structures)) + ++num271; } } + TrackGenerator.Run((int) (10.0 * (double) num258), (int) ((double) num258 * 25.0) + 250); progress.Set(1f); })); - WorldGen.AddGenerationPass("Water Plants", (WorldGenLegacyMethod) ((progress, passConfig) => + WorldGen.AddGenerationPass("Final Cleanup", (WorldGenLegacyMethod) (progress => { - progress.Message = Lang.gen[88].Value; - for (int x = 20; x < Main.maxTilesX - 20; ++x) + for (int i = 0; i < Main.maxTilesX; ++i) { - progress.Set((float) x / (float) Main.maxTilesX); - for (int index302 = 1; (double) index302 < Main.worldSurface; ++index302) + for (int index = 0; index < Main.maxTilesY; ++index) { - if (WorldGen.genRand.Next(5) == 0 && Main.tile[x, index302].liquid > (byte) 0) + if (Main.tile[i, index].active() && (!WorldGen.SolidTile(i, index + 1) || !WorldGen.SolidTile(i, index + 2))) { - if (!Main.tile[x, index302].active()) + switch (Main.tile[i, index].type) { - if (WorldGen.genRand.Next(2) == 0) - { - WorldGen.PlaceLilyPad(x, index302); - } - else - { - Point point = WorldGen.PlaceCatTail(x, index302); - if (WorldGen.InWorld(point.X, point.Y)) - { - int num397 = WorldGen.genRand.Next(14); - for (int index303 = 0; index303 < num397; ++index303) - WorldGen.GrowCatTail(point.X, point.Y); - WorldGen.SquareTileFrame(point.X, point.Y); - } - } - } - if ((!Main.tile[x, index302].active() || Main.tile[x, index302].type == (ushort) 61 || Main.tile[x, index302].type == (ushort) 74) && WorldGen.PlaceBamboo(x, index302)) - { - int num398 = WorldGen.genRand.Next(10, 20); - int num399 = 0; - while (num399 < num398 && WorldGen.PlaceBamboo(x, index302 - num399)) - ++num399; + case 53: + Main.tile[i, index].type = (ushort) 397; + continue; + case 112: + Main.tile[i, index].type = (ushort) 398; + continue; + case 123: + Main.tile[i, index].type = (ushort) 1; + continue; + case 224: + Main.tile[i, index].type = (ushort) 147; + continue; + case 234: + Main.tile[i, index].type = (ushort) 399; + continue; + default: + continue; } } } - for (int underworldLayer = Main.UnderworldLayer; (double) underworldLayer > Main.worldSurface; --underworldLayer) - { - if (Main.tile[x, underworldLayer].type == (ushort) 53 && WorldGen.genRand.Next(3) != 0) - WorldGen.GrowCheckSeaweed(x, underworldLayer); - else if (Main.tile[x, underworldLayer].type == (ushort) 549) - WorldGen.GrowCheckSeaweed(x, underworldLayer); - } - } - })); - WorldGen.AddGenerationPass("Stalac", (WorldGenLegacyMethod) ((progress, passConfig) => - { - progress.Set(1f); - for (int index = 20; index < Main.maxTilesX - 20; ++index) - { - for (int worldSurface5 = (int) Main.worldSurface; worldSurface5 < Main.maxTilesY - 20; ++worldSurface5) - { - if ((WorldGen.drunkWorldGen || WorldGen.genRand.Next(5) == 0) && Main.tile[index, worldSurface5 - 1].liquid == (byte) 0) - { - int num400 = WorldGen.genRand.Next(7); - int treeTileType = 0; - switch (num400) - { - case 0: - treeTileType = 583; - break; - case 1: - treeTileType = 584; - break; - case 2: - treeTileType = 585; - break; - case 3: - treeTileType = 586; - break; - case 4: - treeTileType = 587; - break; - case 5: - treeTileType = 588; - break; - case 6: - treeTileType = 589; - break; - } - WorldGen.TryGrowingTreeByType(treeTileType, index, worldSurface5); - } - if (!WorldGen.oceanDepths(index, worldSurface5) && !Main.tile[index, worldSurface5].active() && WorldGen.genRand.Next(5) == 0) - { - if ((Main.tile[index, worldSurface5 - 1].type == (ushort) 1 || Main.tile[index, worldSurface5 - 1].type == (ushort) 147 || Main.tile[index, worldSurface5 - 1].type == (ushort) 161 || Main.tile[index, worldSurface5 - 1].type == (ushort) 25 || Main.tile[index, worldSurface5 - 1].type == (ushort) 203 || Main.tileStone[(int) Main.tile[index, worldSurface5 - 1].type] || Main.tileMoss[(int) Main.tile[index, worldSurface5 - 1].type]) && !Main.tile[index, worldSurface5].active() && !Main.tile[index, worldSurface5 + 1].active()) - Main.tile[index, worldSurface5 - 1].slope((byte) 0); - if ((Main.tile[index, worldSurface5 + 1].type == (ushort) 1 || Main.tile[index, worldSurface5 + 1].type == (ushort) 147 || Main.tile[index, worldSurface5 + 1].type == (ushort) 161 || Main.tile[index, worldSurface5 + 1].type == (ushort) 25 || Main.tile[index, worldSurface5 + 1].type == (ushort) 203 || Main.tileStone[(int) Main.tile[index, worldSurface5 + 1].type] || Main.tileMoss[(int) Main.tile[index, worldSurface5 + 1].type]) && !Main.tile[index, worldSurface5].active() && !Main.tile[index, worldSurface5 - 1].active()) - Main.tile[index, worldSurface5 + 1].slope((byte) 0); - WorldGen.PlaceTight(index, worldSurface5); - } - } - for (int y = 5; y < (int) Main.worldSurface; ++y) - { - if ((Main.tile[index, y - 1].type == (ushort) 147 || Main.tile[index, y - 1].type == (ushort) 161) && WorldGen.genRand.Next(5) == 0) - { - if (!Main.tile[index, y].active() && !Main.tile[index, y + 1].active()) - Main.tile[index, y - 1].slope((byte) 0); - WorldGen.PlaceTight(index, y); - } - if ((Main.tile[index, y - 1].type == (ushort) 25 || Main.tile[index, y - 1].type == (ushort) 203) && WorldGen.genRand.Next(5) == 0) - { - if (!Main.tile[index, y].active() && !Main.tile[index, y + 1].active()) - Main.tile[index, y - 1].slope((byte) 0); - WorldGen.PlaceTight(index, y); - } - if ((Main.tile[index, y + 1].type == (ushort) 25 || Main.tile[index, y + 1].type == (ushort) 203) && WorldGen.genRand.Next(5) == 0) - { - if (!Main.tile[index, y].active() && !Main.tile[index, y - 1].active()) - Main.tile[index, y + 1].slope((byte) 0); - WorldGen.PlaceTight(index, y); - } - } - } - })); - WorldGen.AddGenerationPass("Remove Broken Traps", (WorldGenLegacyMethod) ((progress, passConfig) => - { - progress.Message = Lang.gen[82].Value; - List pointsWeAlreadyWentOver = new List(); - int num401 = 50; - for (int x = num401; x < Main.maxTilesX - num401; ++x) - { - float num402 = (float) (x - num401) / (float) (Main.maxTilesX - num401 * 2); - progress.Set(num402); - for (int y = 50; y < Main.maxTilesY - 50; ++y) - { - if (Main.tile[x, y].wire() && !pointsWeAlreadyWentOver.Contains(new Point(x, y))) - WorldGen.ClearBrokenTraps(new Point(x, y), pointsWeAlreadyWentOver); - } - } - })); - WorldGen.AddGenerationPass("Final Cleanup", (WorldGenLegacyMethod) ((progress, passConfig) => - { - WorldGen.FillWallHolesInArea(new Microsoft.Xna.Framework.Rectangle(0, 0, Main.maxTilesX, (int) Main.worldSurface)); - progress.Message = Lang.gen[86].Value; - for (int index304 = 0; index304 < Main.maxTilesX; ++index304) - { - progress.Set((float) index304 / (float) Main.maxTilesX); - for (int index305 = 0; index305 < Main.maxTilesY; ++index305) - { - if (Main.tile[index304, index305].active() && !WorldGen.SolidTile(index304, index305 + 1) && (Main.tile[index304, index305].type == (ushort) 53 || Main.tile[index304, index305].type == (ushort) 112 || Main.tile[index304, index305].type == (ushort) 234 || Main.tile[index304, index305].type == (ushort) 224 || Main.tile[index304, index305].type == (ushort) 123)) - { - if ((double) index305 < Main.worldSurface + 10.0 && !Main.tile[index304, index305 + 1].active() && Main.tile[index304, index305 + 1].wall != (ushort) 191 && !WorldGen.oceanDepths(index304, index305)) - { - int num403 = 10; - int index306 = index305 + 1; - for (int index307 = index306; index307 < index306 + 10; ++index307) - { - if (Main.tile[index304, index307].active() && Main.tile[index304, index307].type == (ushort) 314) - { - num403 = 0; - break; - } - } - for (; !Main.tile[index304, index306].active() && num403 > 0 && index306 < Main.maxTilesY - 50; --num403) - { - Main.tile[index304, index306 - 1].slope((byte) 0); - Main.tile[index304, index306 - 1].halfBrick(false); - Main.tile[index304, index306].active(true); - Main.tile[index304, index306].type = Main.tile[index304, index305].type; - Main.tile[index304, index306].slope((byte) 0); - Main.tile[index304, index306].halfBrick(false); - ++index306; - } - if (num403 == 0 && !Main.tile[index304, index306].active()) - { - switch (Main.tile[index304, index305].type) - { - case 53: - Main.tile[index304, index306].type = (ushort) 397; - Main.tile[index304, index306].active(true); - break; - case 112: - Main.tile[index304, index306].type = (ushort) 398; - Main.tile[index304, index306].active(true); - break; - case 123: - Main.tile[index304, index306].type = (ushort) 1; - Main.tile[index304, index306].active(true); - break; - case 224: - Main.tile[index304, index306].type = (ushort) 147; - Main.tile[index304, index306].active(true); - break; - case 234: - Main.tile[index304, index306].type = (ushort) 399; - Main.tile[index304, index306].active(true); - break; - } - } - else if (Main.tile[index304, index306].active() && Main.tileSolid[(int) Main.tile[index304, index306].type] && !Main.tileSolidTop[(int) Main.tile[index304, index306].type]) - { - Main.tile[index304, index306].slope((byte) 0); - Main.tile[index304, index306].halfBrick(false); - } - } - else if (Main.tileSolid[(int) Main.tile[index304, index305 + 1].type] && !Main.tileSolidTop[(int) Main.tile[index304, index305 + 1].type] && (Main.tile[index304, index305 + 1].topSlope() || Main.tile[index304, index305 + 1].halfBrick())) - { - Main.tile[index304, index305 + 1].slope((byte) 0); - Main.tile[index304, index305 + 1].halfBrick(false); - } - else - { - switch (Main.tile[index304, index305].type) - { - case 53: - Main.tile[index304, index305].type = (ushort) 397; - break; - case 112: - Main.tile[index304, index305].type = (ushort) 398; - break; - case 123: - Main.tile[index304, index305].type = (ushort) 1; - break; - case 224: - Main.tile[index304, index305].type = (ushort) 147; - break; - case 234: - Main.tile[index304, index305].type = (ushort) 399; - break; - } - } - } - if ((Main.tile[index304, index305].wall == (ushort) 187 || Main.tile[index304, index305].wall == (ushort) 216) && Main.tile[index304, index305].liquid > (byte) 0) - { - Main.tile[index304, index305].liquid = byte.MaxValue; - Main.tile[index304, index305].lava(true); - } - if (Main.tile[index304, index305].type == (ushort) 485 || Main.tile[index304, index305].type == (ushort) 187 || Main.tile[index304, index305].type == (ushort) 165) - WorldGen.TileFrame(index304, index305); - if (Main.tile[index304, index305].type == (ushort) 28) - WorldGen.TileFrame(index304, index305); - if (Main.tile[index304, index305].type == (ushort) 137) - { - Main.tile[index304, index305].slope((byte) 0); - Main.tile[index304, index305].halfBrick(false); - } - if (Main.tile[index304, index305].active() && TileID.Sets.Boulders[(int) Main.tile[index304, index305].type]) - { - int num404 = (int) Main.tile[index304, index305].frameX / 18; - int num405 = index304 - num404; - int num406 = (int) Main.tile[index304, index305].frameY / 18; - int num407 = index305 - num406; - for (int index308 = 0; index308 < 2; ++index308) - { - for (int index309 = 0; index309 < 2; ++index309) - { - int index310 = num405 + index308; - int index311 = num407 + index309; - Main.tile[index310, index311].active(true); - Main.tile[index310, index311].slope((byte) 0); - Main.tile[index310, index311].halfBrick(false); - Main.tile[index310, index311].type = Main.tile[index304, index305].type; - Main.tile[index310, index311].frameX = (short) (index308 * 18); - Main.tile[index310, index311].frameY = (short) (index309 * 18); - } - } - } - if (Main.tile[index304, index305].type == (ushort) 323 && Main.tile[index304, index305].liquid > (byte) 0) - WorldGen.KillTile(index304, index305); - if (Main.wallDungeon[(int) Main.tile[index304, index305].wall]) - { - Main.tile[index304, index305].lava(false); - if (Main.tile[index304, index305].active() && Main.tile[index304, index305].type == (ushort) 56) - { - WorldGen.KillTile(index304, index305); - Main.tile[index304, index305].lava(false); - Main.tile[index304, index305].liquid = byte.MaxValue; - } - } - if (Main.tile[index304, index305].active() && Main.tile[index304, index305].type == (ushort) 314) - { - int num408 = 15; - int num409 = 1; - for (int index312 = index305; index305 - index312 < num408; --index312) - Main.tile[index304, index312].liquid = (byte) 0; - for (int index313 = index305; index313 - index305 < num409; ++index313) - Main.tile[index304, index313].liquid = (byte) 0; - } - if (Main.tile[index304, index305].active() && Main.tile[index304, index305].type == (ushort) 332 && !Main.tile[index304, index305 + 1].active()) - { - Main.tile[index304, index305 + 1].ClearEverything(); - Main.tile[index304, index305 + 1].active(true); - Main.tile[index304, index305 + 1].type = (ushort) 332; - } - if (index304 > WorldGen.beachDistance && index304 < Main.maxTilesX - WorldGen.beachDistance && (double) index305 < Main.worldSurface && Main.tile[index304, index305].liquid > (byte) 0 && Main.tile[index304, index305].liquid < byte.MaxValue && Main.tile[index304 - 1, index305].liquid < byte.MaxValue && Main.tile[index304 + 1, index305].liquid < byte.MaxValue && Main.tile[index304, index305 + 1].liquid < byte.MaxValue && !TileID.Sets.Clouds[(int) Main.tile[index304 - 1, index305].type] && !TileID.Sets.Clouds[(int) Main.tile[index304 + 1, index305].type] && !TileID.Sets.Clouds[(int) Main.tile[index304, index305 + 1].type]) - Main.tile[index304, index305].liquid = (byte) 0; - } - } - if (WorldGen.drunkWorldGen) - WorldGen.FinishDrunkGen(); - if (WorldGen.notTheBees) - { - WorldGen.NotTheBees(); - WorldGen.FinishNotTheBees(); - WorldGen.notTheBees = false; - } - if (WorldGen.getGoodWorldGen) - { - WorldGen.FinishGetGoodWorld(); - WorldGen.getGoodWorldGen = false; } WorldGen.noTileActions = false; - Main.tileSolid[(int) WorldGen.crackedType] = true; - Main.tileSolid[484] = true; WorldGen.gen = false; Main.AnglerQuestSwap(); - WorldGen.skipFramingDuringGen = false; - progress.Message = Lang.gen[87].Value; })); WorldGen._generator.GenerateWorld(customProgressObject); - WorldGen.ConsumePostGenActions(structures); Main.WorldFileMetadata = FileMetadata.FromCurrentSettings(FileType.World); - Main.NotifyOfEvent(GameNotificationType.WorldGen); - WorldGen.drunkWorldGenText = false; - } - - private static void NotTheBees() - { - if (!WorldGen.notTheBees) - return; - for (int x = 0; x < Main.maxTilesX; ++x) - { - for (int y = 0; y < Main.maxTilesY - 180; ++y) - { - if (Main.tile[x, y].type == (ushort) 52) - Main.tile[x, y].type = (ushort) 62; - if ((WorldGen.SolidOrSlopedTile(x, y) || TileID.Sets.CrackedBricks[(int) Main.tile[x, y].type]) && !TileID.Sets.Ore[(int) Main.tile[x, y].type] && Main.tile[x, y].type != (ushort) 123 && Main.tile[x, y].type != (ushort) 40) - { - if (Main.tile[x, y].type == (ushort) 191 || Main.tile[x, y].type == (ushort) 383) - Main.tile[x, y].type = (ushort) 383; - else if (Main.tile[x, y].type == (ushort) 192 || Main.tile[x, y].type == (ushort) 384) - Main.tile[x, y].type = (ushort) 384; - else if (Main.tile[x, y].type != (ushort) 151 && Main.tile[x, y].type != (ushort) 189 && Main.tile[x, y].type != (ushort) 196 && Main.tile[x, y].type != (ushort) 120 && Main.tile[x, y].type != (ushort) 158 && Main.tile[x, y].type != (ushort) 175 && Main.tile[x, y].type != (ushort) 45 && Main.tile[x, y].type != (ushort) 119) - { - if (Main.tile[x, y].type >= (ushort) 63 && Main.tile[x, y].type <= (ushort) 68) - Main.tile[x, y].type = (ushort) 230; - else if (Main.tile[x, y].type != (ushort) 57 && Main.tile[x, y].type != (ushort) 76 && Main.tile[x, y].type != (ushort) 75 && Main.tile[x, y].type != (ushort) 229 && Main.tile[x, y].type != (ushort) 230 && Main.tile[x, y].type != (ushort) 407 && Main.tile[x, y].type != (ushort) 404) - { - if (Main.tile[x, y].type == (ushort) 224) - Main.tile[x, y].type = (ushort) 229; - else if (Main.tile[x, y].type == (ushort) 53) - { - if (x < WorldGen.beachDistance + WorldGen.genRand.Next(3) || x > Main.maxTilesX - WorldGen.beachDistance - WorldGen.genRand.Next(3)) - Main.tile[x, y].type = (ushort) 229; - } - else if ((x <= WorldGen.beachDistance - WorldGen.genRand.Next(3) || x >= Main.maxTilesX - WorldGen.beachDistance + WorldGen.genRand.Next(3) || Main.tile[x, y].type != (ushort) 397 && Main.tile[x, y].type != (ushort) 396) && Main.tile[x, y].type != (ushort) 10 && Main.tile[x, y].type != (ushort) 203 && Main.tile[x, y].type != (ushort) 25 && Main.tile[x, y].type != (ushort) 137 && Main.tile[x, y].type != (ushort) 138 && Main.tile[x, y].type != (ushort) 141) - { - if (Main.tileDungeon[(int) Main.tile[x, y].type] || TileID.Sets.CrackedBricks[(int) Main.tile[x, y].type]) - Main.tile[x, y].color((byte) 14); - else if (Main.tile[x, y].type == (ushort) 226) - Main.tile[x, y].color((byte) 15); - else if (Main.tile[x, y].type != (ushort) 202 && Main.tile[x, y].type != (ushort) 70 && Main.tile[x, y].type != (ushort) 48 && Main.tile[x, y].type != (ushort) 232) - Main.tile[x, y].type = !TileID.Sets.Conversion.Grass[(int) Main.tile[x, y].type] ? (Main.tile[x, y].type == (ushort) 0 || Main.tile[x, y].type == (ushort) 59 ? (ushort) 59 : (y <= WorldGen.lavaLine + WorldGen.genRand.Next(-2, 3) + 2 ? (ushort) 225 : (ushort) 230)) : (y <= WorldGen.lavaLine + WorldGen.genRand.Next(-2, 3) + 2 ? (ushort) 60 : (ushort) 70); - } - } - } - } - if (Main.tile[x, y].wall != (ushort) 15 && Main.tile[x, y].wall != (ushort) 64 && Main.tile[x, y].wall != (ushort) 204 && Main.tile[x, y].wall != (ushort) 205 && Main.tile[x, y].wall != (ushort) 206 && Main.tile[x, y].wall != (ushort) 207 && Main.tile[x, y].wall != (ushort) 23 && Main.tile[x, y].wall != (ushort) 24 && Main.tile[x, y].wall != (ushort) 42 && Main.tile[x, y].wall != (ushort) 10 && Main.tile[x, y].wall != (ushort) 21 && Main.tile[x, y].wall != (ushort) 82 && Main.tile[x, y].wall != (ushort) 187 && Main.tile[x, y].wall != (ushort) 216 && Main.tile[x, y].wall != (ushort) 34 && Main.tile[x, y].wall != (ushort) 244) - { - if (Main.tile[x, y].wall == (ushort) 87) - Main.tile[x, y].wallColor((byte) 15); - else if (Main.wallDungeon[(int) Main.tile[x, y].wall]) - Main.tile[x, y].wallColor((byte) 14); - else if (Main.tile[x, y].wall == (ushort) 2) - Main.tile[x, y].wall = (ushort) 2; - else if (Main.tile[x, y].wall == (ushort) 196) - Main.tile[x, y].wall = (ushort) 196; - else if (Main.tile[x, y].wall == (ushort) 197) - Main.tile[x, y].wall = (ushort) 197; - else if (Main.tile[x, y].wall == (ushort) 198) - Main.tile[x, y].wall = (ushort) 198; - else if (Main.tile[x, y].wall == (ushort) 199) - Main.tile[x, y].wall = (ushort) 199; - else if (Main.tile[x, y].wall == (ushort) 63) - Main.tile[x, y].wall = (ushort) 64; - else if (Main.tile[x, y].wall != (ushort) 3 && Main.tile[x, y].wall != (ushort) 83 && Main.tile[x, y].wall != (ushort) 73 && Main.tile[x, y].wall != (ushort) 13 && Main.tile[x, y].wall != (ushort) 14 && Main.tile[x, y].wall > (ushort) 0) - Main.tile[x, y].wall = (ushort) 86; - } - if (Main.tile[x, y].liquid > (byte) 0 && y <= WorldGen.lavaLine + 2) - { - if ((double) y > Main.rockLayer && (x < WorldGen.beachDistance + 200 || x > Main.maxTilesX - WorldGen.beachDistance - 200)) - Main.tile[x, y].honey(false); - else if (Main.wallDungeon[(int) Main.tile[x, y].wall]) - Main.tile[x, y].honey(false); - else - Main.tile[x, y].honey(true); - } - } - } - } - - private static void FinishNotTheBees() - { - if (!WorldGen.notTheBees) - return; - int num1 = 0; - for (int index1 = 20; (double) index1 < Main.worldSurface; ++index1) - { - for (int index2 = 20; index2 < Main.maxTilesX - 20; ++index2) - { - if (Main.tile[index2, index1].active() && TileID.Sets.Clouds[(int) Main.tile[index2, index1].type]) - { - num1 = index1; - break; - } - } - } - for (int i1 = 20; i1 < Main.maxTilesX - 20; ++i1) - { - for (int j = 20; j < Main.maxTilesY - 20; ++j) - { - int num2 = 20; - if (Main.tile[i1, j].type == (ushort) 25) - { - for (int i2 = i1 - num2; i2 <= i1 + num2; ++i2) - { - for (int index = j - num2; index <= j + num2; ++index) - { - if (Main.tile[i2, index].type == (ushort) 60) - { - if (Main.tile[i2, index + 1].type == (ushort) 444) - WorldGen.KillTile(i2, index + 1); - Main.tile[i2, index].type = (ushort) 23; - if (Main.tile[i2, index - 1].type == (ushort) 61 || Main.tile[i2, index - 1].type == (ushort) 74) - { - Main.tile[i2, index - 1].active(false); - WorldGen.PlaceTile(i2, index - 1, 24); - } - } - else if (Main.tile[i2, index - 1].type == (ushort) 233 || Main.tile[i2, index - 1].type == (ushort) 82) - WorldGen.KillTile(i2, index - 1); - if (Main.tile[i2, index].type == (ushort) 59) - Main.tile[i2, index].type = (ushort) 0; - } - } - } - else if (Main.tile[i1, j].type == (ushort) 203) - { - for (int i3 = i1 - num2; i3 <= i1 + num2; ++i3) - { - for (int index = j - num2; index <= j + num2; ++index) - { - if (Main.tile[i3, index].type == (ushort) 60) - { - if (Main.tile[i3, index + 1].type == (ushort) 444) - WorldGen.KillTile(i3, index + 1); - Main.tile[i3, index].type = (ushort) 199; - if (Main.tile[i3, index - 1].type == (ushort) 61 || Main.tile[i3, index - 1].type == (ushort) 74) - { - Main.tile[i3, index - 1].active(false); - WorldGen.PlaceTile(i3, index - 1, 201); - } - else if (Main.tile[i3, index - 1].type == (ushort) 233 || Main.tile[i3, index - 1].type == (ushort) 82) - WorldGen.KillTile(i3, index - 1); - } - if (Main.tile[i3, index].type == (ushort) 59) - Main.tile[i3, index].type = (ushort) 0; - } - } - } - if (Main.tile[i1, j].type == (ushort) 382 || Main.tile[i1, j].type == (ushort) 52) - Main.tile[i1, j].type = (ushort) 62; - if (j > WorldGen.lavaLine + WorldGen.genRand.Next(-2, 3) + 2) - WorldGen.SpreadGrass(i1, j, 59, 70); - else - WorldGen.SpreadGrass(i1, j, 59, 60); - if ((double) j > Main.rockLayer + 20.0 + (double) WorldGen.genRand.Next(-2, 3) && j <= WorldGen.lavaLine + 2 - 20 - WorldGen.genRand.Next(-2, 3) && (i1 < WorldGen.beachDistance + 200 - 20 - WorldGen.genRand.Next(-2, 3) || i1 > Main.maxTilesX - WorldGen.beachDistance - 200 + 20 + WorldGen.genRand.Next(-2, 3))) - { - if (Main.tile[i1, j].liquid > (byte) 0) - { - Main.tile[i1, j].honey(false); - Main.tile[i1, j].lava(false); - } - if (Main.tile[i1, j].type == (ushort) 59) - { - bool flag = false; - for (int index3 = i1 - 1; index3 <= i1 + 1; ++index3) - { - for (int index4 = j - 1; index4 <= j + 1; ++index4) - { - if (Main.tile[index3, index4].type == (ushort) 60) - flag = true; - } - } - if (!flag) - Main.tile[i1, j].type = (double) j >= (Main.rockLayer + (double) WorldGen.lavaLine) / 2.0 ? (ushort) 147 : (ushort) 161; - } - } - if (Main.tile[i1, j].type == (ushort) 7 || Main.tile[i1, j].type == (ushort) 166 || Main.tile[i1, j].type == (ushort) 6 || Main.tile[i1, j].type == (ushort) 167) - { - if ((double) j > ((double) WorldGen.lavaLine + Main.rockLayer * 2.0) / 3.0 + (double) WorldGen.genRand.Next(-2, 3) + 2.0) - Main.tile[i1, j].type = (ushort) 0; - } - else if ((Main.tile[i1, j].type == (ushort) 123 || Main.tile[i1, j].type == (ushort) 40) && (double) j > ((double) WorldGen.lavaLine + Main.rockLayer) / 2.0 + (double) WorldGen.genRand.Next(-2, 3) + 2.0) - Main.tile[i1, j].type = (ushort) 1; - if (j > num1 && (Main.tile[i1, j].liquid == (byte) 0 || !Main.tile[i1, j].lava()) && WorldGen.genRand.Next(25) == 0) - WorldGen.PlaceTile(i1, j, 231, true); - } - } - for (int checkedY = 20; checkedY < num1; ++checkedY) - { - for (int index = 20; index <= Main.maxTilesX - 20; ++index) - { - Main.tile[index, checkedY].honey(false); - if (Main.tile[index, checkedY].type == (ushort) 375) - Main.tile[index, checkedY].type = (ushort) 373; - if (Main.tile[index, checkedY].type == (ushort) 60) - { - Main.tile[index, checkedY].type = (ushort) 2; - if (WorldGen.genRand.Next(2) == 0) - WorldGen.GrowTreeWithSettings(index, checkedY, WorldGen.GrowTreeSettings.Profiles.VanityTree_Willow); - else - WorldGen.GrowTreeWithSettings(index, checkedY, WorldGen.GrowTreeSettings.Profiles.VanityTree_Sakura); - if (!Main.tile[index, checkedY - 1].active()) - WorldGen.PlaceTile(index, checkedY - 1, 3); - } - if (Main.tile[index, checkedY].type == (ushort) 59) - Main.tile[index, checkedY].type = (ushort) 0; - } - } - } - - private static void FinishGetGoodWorld() - { - int num1 = 0; - for (int index1 = 20; (double) index1 < Main.worldSurface; ++index1) - { - for (int index2 = 20; index2 < Main.maxTilesX - 20; ++index2) - { - if (Main.tile[index2, index1].active() && TileID.Sets.Clouds[(int) Main.tile[index2, index1].type]) - { - num1 = index1; - break; - } - } - } - byte num2 = (byte) WorldGen.genRand.Next(13, 25); - for (int index3 = 0; index3 < Main.maxTilesX; ++index3) - { - bool flag = false; - for (int index4 = 0; index4 < Main.maxTilesY; ++index4) - { - if (Main.tile[index3, index4].active() && Main.tileDungeon[(int) Main.tile[index3, index4].type]) - { - if (Main.tile[index3, index4].type == (ushort) 44) - { - num2 = (byte) WorldGen.genRand.Next(13, 15); - if (WorldGen.genRand.Next(2) == 0) - num2 = (byte) WorldGen.genRand.Next(23, 25); - } - if (Main.tile[index3, index4].type == (ushort) 43) - num2 = (byte) WorldGen.genRand.Next(15, 19); - if (Main.tile[index3, index4].type == (ushort) 41) - num2 = (byte) WorldGen.genRand.Next(19, 23); - } - } - if (flag) - break; - } - for (int i = 0; i < Main.maxTilesX; ++i) - { - for (int index = 5; index < Main.maxTilesY - 5; ++index) - { - if (Main.tile[i, index].active() && (Main.tileDungeon[(int) Main.tile[i, index].type] || TileID.Sets.CrackedBricks[(int) Main.tile[i, index].type])) - Main.tile[i, index].color(num2); - if (Main.wallDungeon[(int) Main.tile[i, index].wall]) - Main.tile[i, index].wallColor(num2); - if (Main.tile[i, index].active() && (Main.tile[i, index].type == (ushort) 226 || Main.tile[i, index].type == (ushort) 137 && Main.tile[i, index].frameY > (short) 0)) - Main.tile[i, index].color((byte) 17); - if (Main.tile[i, index].wall == (ushort) 87) - Main.tile[i, index].wallColor((byte) 25); - if (Main.tile[i, index].active()) - { - if (Main.tile[i, index].type == (ushort) 57 && WorldGen.genRand.Next(15) == 0) - { - if (Main.tile[i, index - 1].type == (ushort) 57) - Main.tile[i, index].active(false); - Main.tile[i, index].liquid = byte.MaxValue; - Main.tile[i, index].lava(true); - } - if (index < num1 && Main.tile[i, index].type == (ushort) 2) - { - Main.tile[i, index].type = !WorldGen.crimson ? (ushort) 23 : (ushort) 199; - if (Main.tile[i, index - 1].type == (ushort) 3) - Main.tile[i, index - 1].active(false); - if (Main.tile[i, index - 1].type == (ushort) 73) - Main.tile[i, index - 1].active(false); - if (Main.tile[i, index - 1].type == (ushort) 27) - WorldGen.KillTile(i, index - 1); - if (Main.tile[i, index - 1].type == (ushort) 596) - WorldGen.KillTile(i, index - 1); - if (Main.tile[i, index - 1].type == (ushort) 616) - WorldGen.KillTile(i, index - 1); - if (Main.tile[i, index - 1].type == (ushort) 82) - WorldGen.KillTile(i, index - 1); - if (Main.tile[i, index - 1].type == (ushort) 83) - WorldGen.KillTile(i, index - 1); - if (Main.tile[i, index - 1].type == (ushort) 186) - WorldGen.KillTile(i, index - 1); - if (Main.tile[i, index - 1].type == (ushort) 187) - WorldGen.KillTile(i, index - 1); - if (Main.tile[i, index - 1].type == (ushort) 185) - WorldGen.KillTile(i, index - 1); - if (Main.tile[i, index - 1].type == (ushort) 227) - WorldGen.KillTile(i, index - 1); - } - } - } - } - for (int index5 = 0; index5 < 8000 && Main.chest[index5] != null; ++index5) - { - if (WorldGen.genRand.Next(10) == 0 && Main.chest[index5].item[1].stack != 0) - { - for (int index6 = 1; index6 < 40; ++index6) - { - if (Main.chest[index5].item[index6].stack == 0) - { - Main.chest[index5].item[index6].SetDefaults(678); - break; - } - } - } - } - } - - private static void FinishDrunkGen() - { - byte color = (byte) WorldGen.genRand.Next(13, 25); - byte num = 16; - for (int index1 = 0; index1 < Main.maxTilesX; ++index1) - { - bool flag = false; - for (int index2 = 0; index2 < Main.maxTilesY; ++index2) - { - if (Main.tile[index1, index2].active() && Main.tileDungeon[(int) Main.tile[index1, index2].type]) - { - if (Main.tile[index1, index2].type == (ushort) 44) - { - color = (byte) WorldGen.genRand.Next(13, 15); - if (WorldGen.genRand.Next(2) == 0) - color = (byte) WorldGen.genRand.Next(23, 25); - } - if (Main.tile[index1, index2].type == (ushort) 43) - color = (byte) WorldGen.genRand.Next(15, 19); - if (Main.tile[index1, index2].type == (ushort) 41) - color = (byte) WorldGen.genRand.Next(19, 23); - } - } - if (flag) - break; - } - for (int index3 = 0; index3 < Main.maxTilesX; ++index3) - { - for (int index4 = 0; index4 < Main.maxTilesY; ++index4) - { - if (Main.tile[index3, index4].active() && (Main.tileDungeon[(int) Main.tile[index3, index4].type] || TileID.Sets.CrackedBricks[(int) Main.tile[index3, index4].type])) - Main.tile[index3, index4].color(color); - if (Main.wallDungeon[(int) Main.tile[index3, index4].wall]) - Main.tile[index3, index4].wallColor((byte) 25); - if (Main.tile[index3, index4].active() && (Main.tile[index3, index4].type == (ushort) 226 || Main.tile[index3, index4].type == (ushort) 137 && Main.tile[index3, index4].frameY > (short) 0)) - Main.tile[index3, index4].color(num); - if (Main.tile[index3, index4].wall == (ushort) 87) - Main.tile[index3, index4].wallColor(num); - } - } - for (int index5 = 0; index5 < 8000 && Main.chest[index5] != null; ++index5) - { - if (WorldGen.genRand.Next(15) == 0 && Main.chest[index5].item[1].stack != 0) - { - for (int index6 = 1; index6 < 40; ++index6) - { - if (Main.chest[index5].item[index6].stack == 0) - { - Main.chest[index5].item[index6].SetDefaults(5001); - break; - } - } - } - if (WorldGen.genRand.Next(30) == 0 && Main.chest[index5].item[1].stack != 0) - { - for (int index7 = 1; index7 < 40; ++index7) - { - if (Main.chest[index5].item[index7].stack == 0) - { - Main.chest[index5].item[index7].SetDefaults(678); - break; - } - } - } - } - } - - public static bool IsItATrap(Tile tile) => tile.actuator() || tile.active() && TileID.Sets.IsAMechanism[(int) tile.type]; - - public static bool IsItATrigger(Tile tile) => tile.active() && (TileID.Sets.IsATrigger[(int) tile.type] || tile.type == (ushort) 467 && (int) tile.frameX / 36 == 4 || tile.type == (ushort) 314 && Minecart.IsPressurePlate(tile)); - - public static void ClearAllBrokenTraps() - { - List pointsWeAlreadyWentOver = new List(); - for (int x = 50; x < Main.maxTilesX - 50; ++x) - { - for (int y = 50; y < Main.maxTilesY - 50; ++y) - { - if (Main.tile[x, y].wire() && !pointsWeAlreadyWentOver.Contains(new Point(x, y))) - WorldGen.ClearBrokenTraps(new Point(x, y), pointsWeAlreadyWentOver); - } - } - } - - public static void ClearBrokenTraps(Point startTileCoords, List pointsWeAlreadyWentOver) - { - List t1 = new List(); - List t2 = new List(); - List pointList = new List(); - bool flag1 = false; - bool flag2 = false; - t2.Add(startTileCoords); - while (t2.Count > 0) - { - Utils.Swap>(ref t1, ref t2); - while (t1.Count > 0) - { - Point point1 = t1[0]; - t1.RemoveAt(0); - if (WorldGen.InWorld(point1.X, point1.Y, 5)) - { - Tile tile = Main.tile[point1.X, point1.Y]; - if (tile.wire()) - { - pointsWeAlreadyWentOver.Add(point1); - pointList.Add(point1); - if (WorldGen.IsItATrap(tile)) - flag1 = true; - if (WorldGen.IsItATrigger(tile)) - flag2 = true; - if (!(flag2 & flag1)) - { - Point point2 = new Point(point1.X - 1, point1.Y); - if (!pointList.Contains(point2)) - t2.Add(point2); - point2 = new Point(point1.X + 1, point1.Y); - if (!pointList.Contains(point2)) - t2.Add(point2); - point2 = new Point(point1.X, point1.Y - 1); - if (!pointList.Contains(point2)) - t2.Add(point2); - point2 = new Point(point1.X, point1.Y + 1); - if (!pointList.Contains(point2)) - t2.Add(point2); - } - else - break; - } - } - } - if (flag2 & flag1) - break; - } - if (flag2 && flag1) - return; - foreach (Point point in pointList) - { - Tile tile = Main.tile[point.X, point.Y]; - tile.wire(false); - if (WorldGen.IsItATrap(tile)) - { - if (tile.actuator()) - Main.tile[point.X, point.Y].actuator(false); - else if (tile.type != (ushort) 105) - WorldGen.KillTile(point.X, point.Y); - } - else if (WorldGen.IsItATrigger(tile)) - { - if (tile.type == (ushort) 314) - tile.frameX = (short) 1; - else - WorldGen.KillTile(point.X, point.Y); - } - } - } - - private static float TuneOceanDepth(int count, float depth, bool floridaStyle = false) - { - if (!floridaStyle) - { - if (count < 3) - depth += (float) WorldGen.genRand.Next(10, 20) * 0.2f; - else if (count < 6) - depth += (float) WorldGen.genRand.Next(10, 20) * 0.15f; - else if (count < 9) - depth += (float) WorldGen.genRand.Next(10, 20) * 0.1f; - else if (count < 15) - depth += (float) WorldGen.genRand.Next(10, 20) * 0.07f; - else if (count < 50) - depth += (float) WorldGen.genRand.Next(10, 20) * 0.05f; - else if (count < 75) - depth += (float) WorldGen.genRand.Next(10, 20) * 0.04f; - else if (count < 100) - depth += (float) WorldGen.genRand.Next(10, 20) * 0.03f; - else if (count < 125) - depth += (float) WorldGen.genRand.Next(10, 20) * 0.02f; - else if (count < 150) - depth += (float) WorldGen.genRand.Next(10, 20) * 0.01f; - else if (count < 175) - depth += (float) WorldGen.genRand.Next(10, 20) * 0.005f; - else if (count < 200) - depth += (float) WorldGen.genRand.Next(10, 20) * (1f / 1000f); - else if (count < 230) - depth += (float) WorldGen.genRand.Next(10, 20) * 0.01f; - else if (count < 235) - depth += (float) WorldGen.genRand.Next(10, 20) * 0.05f; - else if (count < 240) - depth += (float) WorldGen.genRand.Next(10, 20) * 0.1f; - else if (count < 245) - depth += (float) WorldGen.genRand.Next(10, 20) * 0.05f; - else if (count < (int) byte.MaxValue) - depth += (float) WorldGen.genRand.Next(10, 20) * 0.01f; - } - else if (count < 3) - depth += (float) WorldGen.genRand.Next(10, 20) * (1f / 1000f); - else if (count < 6) - depth += (float) WorldGen.genRand.Next(10, 20) * (1f / 500f); - else if (count < 9) - depth += (float) WorldGen.genRand.Next(10, 20) * 0.004f; - else if (count < 15) - depth += (float) WorldGen.genRand.Next(10, 20) * 0.007f; - else if (count < 50) - depth += (float) WorldGen.genRand.Next(10, 20) * 0.01f; - else if (count < 75) - depth += (float) WorldGen.genRand.Next(10, 20) * 0.014f; - else if (count < 100) - depth += (float) WorldGen.genRand.Next(10, 20) * 0.019f; - else if (count < 125) - depth += (float) WorldGen.genRand.Next(10, 20) * 0.027f; - else if (count < 150) - depth += (float) WorldGen.genRand.Next(10, 20) * 0.038f; - else if (count < 175) - depth += (float) WorldGen.genRand.Next(10, 20) * 0.052f; - else if (count < 200) - depth += (float) WorldGen.genRand.Next(10, 20) * 0.08f; - else if (count < 230) - depth += (float) WorldGen.genRand.Next(10, 20) * 0.12f; - else if (count < 235) - depth += (float) WorldGen.genRand.Next(10, 20) * 0.16f; - else if (count < 240) - depth += (float) WorldGen.genRand.Next(10, 20) * 0.27f; - else if (count < 245) - depth += (float) WorldGen.genRand.Next(10, 20) * 0.43f; - else if (count < (int) byte.MaxValue) - depth += (float) WorldGen.genRand.Next(10, 20) * 0.6f; - return depth; - } - - public static void QueuePostGenAction(Action action) => WorldGen._postGenActions.Enqueue(action); - - public static void ConsumePostGenActions(StructureMap structures) - { - while (WorldGen._postGenActions.Count > 0) - WorldGen._postGenActions.Dequeue()(structures); } public static Point RandomRectanglePoint(Microsoft.Xna.Framework.Rectangle rectangle) => new Point(WorldGen.genRand.Next(rectangle.X, rectangle.X + rectangle.Width), WorldGen.genRand.Next(rectangle.Y, rectangle.Y + rectangle.Height)); @@ -11722,24 +8031,16 @@ label_19: public static bool GrowPalmTree(int i, int y) { int index1 = y; - if (!WorldGen.InWorld(i, y)) - return false; while (Main.tile[i, index1].type == (ushort) 20) - { ++index1; - if (Main.tile[i, index1] == null) - return false; - } Tile tile1 = Main.tile[i, index1]; Tile tile2 = Main.tile[i, index1 - 1]; - int num1 = (int) tile1.slope(); - tile1.halfBrick(); - if (!tile1.active() || tile1.halfBrick() || tile1.slope() != (byte) 0 || tile2.wall != (ushort) 0 || tile2.liquid != (byte) 0 || tile1.type != (ushort) 53 && tile1.type != (ushort) 234 && tile1.type != (ushort) 116 && tile1.type != (ushort) 112 || !WorldGen.EmptyTileCheck(i, i, index1 - 2, index1 - 1, 20) || !WorldGen.EmptyTileCheck(i - 1, i + 1, index1 - 30, index1 - 3, 20)) + if (!tile1.active() || tile1.halfBrick() || tile1.slope() != (byte) 0 || tile2.wall != (byte) 0 || tile2.liquid != (byte) 0 || tile1.type != (ushort) 53 && tile1.type != (ushort) 234 && tile1.type != (ushort) 116 && tile1.type != (ushort) 112 || !WorldGen.EmptyTileCheck(i - 1, i + 1, index1 - 30, index1 - 1, 20)) return false; - int num2 = WorldGen.genRand.Next(10, 21); - int num3 = WorldGen.genRand.Next(-8, 9) * 2; - short num4 = 0; - for (int index2 = 0; index2 < num2; ++index2) + int num1 = WorldGen.genRand.Next(10, 21); + int num2 = WorldGen.genRand.Next(-8, 9) * 2; + short num3 = 0; + for (int index2 = 0; index2 < num1; ++index2) { Tile tile3 = Main.tile[i, index1 - 1 - index2]; if (index2 == 0) @@ -11749,44 +8050,42 @@ label_19: tile3.frameX = (short) 66; tile3.frameY = (short) 0; } - else if (index2 == num2 - 1) + else if (index2 == num1 - 1) { tile3.active(true); tile3.type = (ushort) 323; tile3.frameX = (short) (22 * WorldGen.genRand.Next(4, 7)); - tile3.frameY = num4; + tile3.frameY = num3; } else { - if ((int) num4 != num3) + if ((int) num3 != num2) { - float num5 = (float) index2 / (float) num2; - if ((double) num5 >= 0.25 && ((double) num5 < 0.5 && WorldGen.genRand.Next(13) == 0 || (double) num5 < 0.699999988079071 && WorldGen.genRand.Next(9) == 0 || (double) num5 < 0.949999988079071 && WorldGen.genRand.Next(5) == 0 || true)) + float num4 = (float) index2 / (float) num1; + if ((double) num4 >= 0.25 && ((double) num4 < 0.5 && WorldGen.genRand.Next(13) == 0 || (double) num4 < 0.699999988079071 && WorldGen.genRand.Next(9) == 0 || (double) num4 < 0.949999988079071 && WorldGen.genRand.Next(5) == 0 || true)) { - short num6 = (short) Math.Sign(num3); - num4 += (short) ((int) num6 * 2); + short num5 = (short) Math.Sign(num2); + num3 += (short) ((int) num5 * 2); } } tile3.active(true); tile3.type = (ushort) 323; tile3.frameX = (short) (22 * WorldGen.genRand.Next(0, 3)); - tile3.frameY = num4; + tile3.frameY = num3; } } - WorldGen.RangeFrame(i - 2, index1 - num2 - 1, i + 2, index1 + 1); + WorldGen.RangeFrame(i - 2, index1 - num1 - 1, i + 2, index1 + 1); if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, i, (int) ((double) index1 - (double) num2 * 0.5), num2 + 1); + NetMessage.SendTileSquare(-1, i, (int) ((double) index1 - (double) num1 * 0.5), num1 + 1); return true; } - public static bool IsPalmOasisTree(int x) => x >= WorldGen.beachDistance && x <= Main.maxTilesX - WorldGen.beachDistance; - public static bool GrowEpicTree(int i, int y) { int index1 = y; while (Main.tile[i, index1].type == (ushort) 20) ++index1; - if (Main.tile[i, index1].active() && !Main.tile[i, index1].halfBrick() && Main.tile[i, index1].slope() == (byte) 0 && Main.tile[i, index1].type == (ushort) 2 && Main.tile[i, index1 - 1].wall == (ushort) 0 && Main.tile[i, index1 - 1].liquid == (byte) 0 && (Main.tile[i - 1, index1].active() && (Main.tile[i - 1, index1].type == (ushort) 2 || Main.tile[i - 1, index1].type == (ushort) 23 || Main.tile[i - 1, index1].type == (ushort) 60 || Main.tile[i - 1, index1].type == (ushort) 109) || Main.tile[i + 1, index1].active() && (Main.tile[i + 1, index1].type == (ushort) 2 || Main.tile[i + 1, index1].type == (ushort) 23 || Main.tile[i + 1, index1].type == (ushort) 60 || Main.tile[i + 1, index1].type == (ushort) 109))) + if (Main.tile[i, index1].active() && !Main.tile[i, index1].halfBrick() && Main.tile[i, index1].slope() == (byte) 0 && Main.tile[i, index1].type == (ushort) 2 && Main.tile[i, index1 - 1].wall == (byte) 0 && Main.tile[i, index1 - 1].liquid == (byte) 0 && (Main.tile[i - 1, index1].active() && (Main.tile[i - 1, index1].type == (ushort) 2 || Main.tile[i - 1, index1].type == (ushort) 23 || Main.tile[i - 1, index1].type == (ushort) 60 || Main.tile[i - 1, index1].type == (ushort) 109) || Main.tile[i + 1, index1].active() && (Main.tile[i + 1, index1].type == (ushort) 2 || Main.tile[i + 1, index1].type == (ushort) 23 || Main.tile[i + 1, index1].type == (ushort) 60 || Main.tile[i + 1, index1].type == (ushort) 109))) { int num1 = 2; if (WorldGen.EmptyTileCheck(i - num1, i + num1, index1 - 55, index1 - 1, 20)) @@ -11794,8 +8093,6 @@ label_19: bool flag1 = false; bool flag2 = false; int num2 = WorldGen.genRand.Next(20, 30); - if (WorldGen.drunkWorldGen) - num2 = WorldGen.genRand.Next(3, 7); for (int index2 = index1 - num2; index2 < index1; ++index2) { Main.tile[i, index2].frameNumber((byte) WorldGen.genRand.Next(3)); @@ -12170,7 +8467,7 @@ label_19: } break; } - if (WorldGen.genRand.Next(13) != 0) + if (WorldGen.genRand.Next(8) != 0) { int num11 = WorldGen.genRand.Next(3); if (num11 == 0) @@ -12250,7 +8547,7 @@ label_19: } if (flag) { - Main.tile[i1, j1].wall = (ushort) 34; + Main.tile[i1, j1].wall = (byte) 34; WorldGen.SquareWallFrame(i1, j1); } } @@ -12274,8 +8571,8 @@ label_19: flag2 = true; if ((int) Main.tile[index6, index5].type == (int) num1) { - Main.tile[index6, index5 + 1].wall = (ushort) 34; - Main.tile[index6 + num6, index5].wall = (ushort) 34; + Main.tile[index6, index5 + 1].wall = (byte) 34; + Main.tile[index6 + num6, index5].wall = (byte) 34; Main.tile[index6, index5].active(false); flag1 = true; } @@ -12415,7 +8712,7 @@ label_19: Main.tile[index12, index13].slope((byte) 0); } if (index12 >= index7 - 1 && index12 <= index7 + 1 + num18) - Main.tile[index12, index13].wall = (ushort) 34; + Main.tile[index12, index13].wall = (byte) 34; } ++j2; index7 += num6; @@ -12439,7 +8736,7 @@ label_19: return true; } - public static bool GrowLivingTree(int i, int j, bool patch = false) + public static bool GrowLivingTree(int i, int j) { int index1 = 0; int[] numArray1 = new int[1000]; @@ -12450,80 +8747,49 @@ label_19: int[] numArray5 = new int[2000]; int[] numArray6 = new int[2000]; bool[] flagArray = new bool[2000]; - if (!WorldGen.SolidTile(i, j + 1) || Main.tile[i, j].active() || Main.tile[i, j + 1].type != (ushort) 0 && Main.tile[i, j + 1].type != (ushort) 2 && Main.tile[i, j + 1].type != (ushort) 1 && Main.tile[i, j + 1].type != (ushort) 40 && !TileID.Sets.Ore[(int) Main.tile[i, j + 1].type] || j < 150) + if (!WorldGen.SolidTile(i, j + 1) || Main.tile[i, j].active()) return false; - int num1 = i - WorldGen.genRand.Next(2, 3); - int num2 = i + WorldGen.genRand.Next(2, 3); - if (WorldGen.genRand.Next(5) == 0) - { - if (WorldGen.genRand.Next(2) == 0) - --num1; - else - ++num2; - } - int num3 = num2 - num1; - bool flag1 = num3 >= 4; - int num4 = i - 50; - int num5 = i + 50; - if (patch) - { - num4 = i - 20; - num5 = i + 20; - num1 = i - WorldGen.genRand.Next(1, 3); - num2 = i + WorldGen.genRand.Next(1, 3); - flag1 = num3 >= 4; - } - for (int index3 = num4; index3 <= num5; ++index3) + int num1 = i - WorldGen.genRand.Next(1, 4); + int num2 = i + WorldGen.genRand.Next(1, 4); + if (j < 150) + return false; + int num3 = i - 50; + int num4 = i + 50; + for (int index3 = num3; index3 <= num4; ++index3) { for (int index4 = 5; index4 < j - 5; ++index4) { if (Main.tile[index3, index4].active()) - { - if (!patch) - return false; - switch (Main.tile[index3, index4].type) - { - case 0: - case 1: - case 2: - case 191: - case 192: - continue; - default: - return false; - } - } + return false; } } - int num6 = num1; - int num7 = num2; - int minl = num1; - int minr = num2; - bool flag2 = true; - int num8 = WorldGen.genRand.Next(-8, -4); - int num9 = WorldGen.genRand.Next(2); + int num5 = num1; + int num6 = num2; + int num7 = num1; + int num8 = num2; + int minValue = num2 - num1; + bool flag1 = true; + int num9 = WorldGen.genRand.Next(-10, -5); + int num10 = WorldGen.genRand.Next(2); int index5 = j; - int num10 = WorldGen.genRand.Next(5, 15); - Main.tileSolid[48] = false; - while (flag2) + while (flag1) { - ++num8; - if (num8 > num10) + ++num9; + if (num9 > WorldGen.genRand.Next(5, 30)) { - num10 = WorldGen.genRand.Next(5, 15); - num8 = 0; + num9 = 0; numArray2[index1] = index5 + WorldGen.genRand.Next(5); if (WorldGen.genRand.Next(5) == 0) - num9 = num9 != 0 ? 0 : 1; - if (num9 == 0) + num10 = num10 != 0 ? 0 : 1; + if (num10 == 0) { numArray3[index1] = -1; numArray1[index1] = num1; numArray4[index1] = num2 - num1; if (WorldGen.genRand.Next(2) == 0) ++num1; - ++num6; - num9 = 1; + ++num5; + num10 = 1; } else { @@ -12532,11 +8798,11 @@ label_19: numArray4[index1] = num2 - num1; if (WorldGen.genRand.Next(2) == 0) --num2; - --num7; - num9 = 0; + --num6; + num10 = 0; } - if (num6 == num7) - flag2 = false; + if (num5 == num6) + flag1 = false; ++index1; } for (int index6 = num1; index6 <= num2; ++index6) @@ -12547,7 +8813,7 @@ label_19: } --index5; } - for (int index7 = 0; index7 < index1 - 1; ++index7) + for (int index7 = 0; index7 < index1; ++index7) { int index8 = numArray1[index7] + numArray3[index7]; int index9 = numArray2[index7]; @@ -12611,7 +8877,7 @@ label_19: } int index10 = (num1 + num2) / 2; int index11 = index5; - int num13 = WorldGen.genRand.Next(num3 * 3, num3 * 5); + int num13 = WorldGen.genRand.Next(minValue * 3, minValue * 5); int num14 = 0; int num15 = 0; for (; num13 > 0; --num13) @@ -12629,7 +8895,7 @@ label_19: { int index13 = index10; int index14 = index11; - int num16 = WorldGen.genRand.Next(num3, num3 * 3); + int num16 = WorldGen.genRand.Next(minValue, minValue * 3); if (index12 < 0) num14 = WorldGen.genRand.Next(3, 5); if (index12 > 0) @@ -12673,11 +8939,7 @@ label_19: numArray5[index2] = index15; numArray6[index2] = index16; flagArray[index2] = true; - int index17 = index2 + 1; - numArray5[index17] = index15 + WorldGen.genRand.Next(-5, 6); - numArray6[index17] = index16 + WorldGen.genRand.Next(-5, 6); - flagArray[index17] = true; - index2 = index17 + 1; + ++index2; } } } @@ -12697,7 +8959,7 @@ label_19: } --index11; } - for (int i1 = minl; i1 <= minr; ++i1) + for (int i1 = num7; i1 <= num8; ++i1) { int num19 = WorldGen.genRand.Next(1, 6); int j1 = j + 1; @@ -12711,1437 +8973,473 @@ label_19: ++j1; } int num20 = j1; - int num21 = WorldGen.genRand.Next(2, num3 + 1); - for (int index18 = 0; index18 < num21; ++index18) + for (int index17 = 0; index17 < 2; ++index17) { - int index19 = num20; - int num22 = (minl + minr) / 2; - int num23 = 1; - int num24 = i1 >= num22 ? 1 : -1; - if (i1 == num22 || num3 > 6 && (i1 == num22 - 1 || i1 == num22 + 1)) - num24 = 0; - int num25 = num24; - int index20 = i1; - int num26 = WorldGen.genRand.Next((int) ((double) num3 * 3.5), num3 * 6); - while (num26 > 0) + int index18 = num20; + int num21 = (num7 + num8) / 2; + int num22 = 1; + int num23 = i1 >= num21 ? 1 : -1; + if (i1 == num21 || minValue > 6 && (i1 == num21 - 1 || i1 == num21 + 1)) + num23 = 0; + int num24 = num23; + int index19 = i1; + int num25 = WorldGen.genRand.Next((int) ((double) minValue * 2.5), minValue * 4); + while (num25 > 0) { - --num26; - index20 += num24; - if (Main.tile[index20, index19].wall != (ushort) 244) - { - Main.tile[index20, index19].type = (ushort) 191; - Main.tile[index20, index19].active(true); - Main.tile[index20, index19].halfBrick(false); - } + --num25; index19 += num23; - if (Main.tile[index20, index19].wall != (ushort) 244) - { - Main.tile[index20, index19].type = (ushort) 191; - Main.tile[index20, index19].active(true); - Main.tile[index20, index19].halfBrick(false); - } - if (!Main.tile[index20, index19 + 1].active()) - { - num24 = 0; - num23 = 1; - } - if (WorldGen.genRand.Next(3) == 0) - num24 = num25 >= 0 ? (num25 <= 0 ? WorldGen.genRand.Next(-1, 2) : (num24 != 0 ? 0 : 1)) : (num24 != 0 ? 0 : -1); - if (WorldGen.genRand.Next(3) == 0) - num23 = num23 != 0 ? 0 : 1; - } - } - } - for (int index21 = 0; index21 < index2; ++index21) - { - int num27 = (int) ((double) WorldGen.genRand.Next(5, 8) * (1.0 + (double) num3 * 0.0500000007450581)); - if (flagArray[index21]) - num27 = WorldGen.genRand.Next(6, 12) + num3; - int num28 = numArray5[index21] - num27 * 2; - int num29 = numArray5[index21] + num27 * 2; - int num30 = numArray6[index21] - num27 * 2; - int num31 = numArray6[index21] + num27 * 2; - float num32 = (float) (2.0 - (double) WorldGen.genRand.Next(5) * 0.100000001490116); - for (int i2 = num28; i2 <= num29; ++i2) - { - for (int index22 = num30; index22 <= num31; ++index22) - { - if (Main.tile[i2, index22].type != (ushort) 191) - { - if (flagArray[index21]) - { - if ((double) (new Vector2((float) numArray5[index21], (float) numArray6[index21]) - new Vector2((float) i2, (float) index22)).Length() < (double) num27 * 0.9) - { - Main.tile[i2, index22].type = (ushort) 192; - Main.tile[i2, index22].active(true); - Main.tile[i2, index22].halfBrick(false); - } - } - else if ((double) Math.Abs(numArray5[index21] - i2) + (double) Math.Abs(numArray6[index21] - index22) * (double) num32 < (double) num27) - { - Main.tile[i2, index22].type = (ushort) 192; - Main.tile[i2, index22].active(true); - Main.tile[i2, index22].halfBrick(false); - } - } - } - if (WorldGen.genRand.Next(30) == 0) - { - int j2 = num30; - if (!Main.tile[i2, j2].active()) - { - while (!Main.tile[i2, j2 + 1].active() && j2 < num31) - ++j2; - if (Main.tile[i2, j2 + 1].type == (ushort) 192) - WorldGen.PlaceTile(i2, j2, 187, true, style: WorldGen.genRand.Next(50, 52)); - } - } - if (!flagArray[index21] && WorldGen.genRand.Next(15) == 0) - { - int j3 = num31; - int num33 = j3 + 100; - if (!Main.tile[i2, j3].active()) - { - while (!Main.tile[i2, j3 + 1].active() && j3 < num33) - ++j3; - if (Main.tile[i2, j3 + 1].type != (ushort) 192) - { - if (WorldGen.genRand.Next(2) == 0) - { - WorldGen.PlaceTile(i2, j3, 187, true, style: WorldGen.genRand.Next(47, 50)); - } - else - { - int Y = WorldGen.genRand.Next(2); - int X = 72; - if (Y == 1) - X = WorldGen.genRand.Next(59, 62); - WorldGen.PlaceSmallPile(i2, j3, X, Y); - } - } - } - } - } - } - if (flag1) - { - bool flag3 = false; - for (int j4 = j; j4 < j + 20 && (double) j4 < Main.worldSurface - 2.0; ++j4) - { - for (int i3 = minl; i3 <= minr; ++i3) - { - if (Main.tile[i3, j4].wall == (ushort) 0 && !WorldGen.SolidTile(i3, j4)) - flag3 = true; - } - } - if (!flag3) - WorldGen.GrowLivingTree_MakePassage(j, num3, ref minl, ref minr, patch); - } - Main.tileSolid[48] = true; - return true; - } - - public static bool GrowDungeonTree(int i, int j, bool patch = false) - { - int index1 = 0; - int[] numArray1 = new int[1000]; - int[] numArray2 = new int[1000]; - int[] numArray3 = new int[1000]; - int[] numArray4 = new int[1000]; - int index2 = 0; - int[] numArray5 = new int[2000]; - int[] numArray6 = new int[2000]; - bool[] flagArray = new bool[2000]; - int num1 = i - WorldGen.genRand.Next(2, 3); - int num2 = i + WorldGen.genRand.Next(2, 3); - if (WorldGen.genRand.Next(5) == 0) - { - if (WorldGen.genRand.Next(2) == 0) - --num1; - else - ++num2; - } - int num3 = num2 - num1; - int num4 = num1; - int num5 = num2; - int minl = num1; - int minr = num2; - bool flag = true; - int num6 = WorldGen.genRand.Next(-8, -4); - int num7 = WorldGen.genRand.Next(2); - int index3 = j; - int num8 = WorldGen.genRand.Next(5, 15); - Main.tileSolid[48] = false; - while (flag) - { - ++num6; - if (num6 > num8) - { - num8 = WorldGen.genRand.Next(5, 15); - num6 = 0; - numArray2[index1] = index3 + WorldGen.genRand.Next(5); - if (WorldGen.genRand.Next(5) == 0) - num7 = num7 != 0 ? 0 : 1; - if (num7 == 0) - { - numArray3[index1] = -1; - numArray1[index1] = num1; - numArray4[index1] = num2 - num1; - if (WorldGen.genRand.Next(2) == 0) - ++num1; - ++num4; - num7 = 1; - } - else - { - numArray3[index1] = 1; - numArray1[index1] = num2; - numArray4[index1] = num2 - num1; - if (WorldGen.genRand.Next(2) == 0) - --num2; - --num5; - num7 = 0; - } - if (num4 == num5) - flag = false; - ++index1; - } - for (int index4 = num1; index4 <= num2; ++index4) - { - Main.tile[index4, index3].type = (ushort) 191; - Main.tile[index4, index3].active(true); - Main.tile[index4, index3].halfBrick(false); - Main.tile[index4, index3].color((byte) 28); - } - --index3; - } - for (int index5 = 0; index5 < index1 - 1; ++index5) - { - int index6 = numArray1[index5] + numArray3[index5]; - int index7 = numArray2[index5]; - int num9 = (int) ((double) numArray4[index5] * (1.0 + (double) WorldGen.genRand.Next(20, 30) * 0.100000001490116)); - Main.tile[index6, index7 + 1].type = (ushort) 191; - Main.tile[index6, index7 + 1].active(true); - Main.tile[index6, index7 + 1].halfBrick(false); - Main.tile[index6, index7 + 1].color((byte) 28); - int num10 = WorldGen.genRand.Next(3, 5); - while (num9 > 0) - { - --num9; - Main.tile[index6, index7].type = (ushort) 191; - Main.tile[index6, index7].active(true); - Main.tile[index6, index7].halfBrick(false); - Main.tile[index6, index7].color((byte) 28); - if (WorldGen.genRand.Next(10) == 0) - { - if (WorldGen.genRand.Next(2) == 0) - --index7; - else - ++index7; - } - else - index6 += numArray3[index5]; - if (num10 > 0) - --num10; - else if (WorldGen.genRand.Next(2) == 0) - { - num10 = WorldGen.genRand.Next(2, 5); - if (WorldGen.genRand.Next(2) == 0) - { - Main.tile[index6, index7].type = (ushort) 191; - Main.tile[index6, index7].active(true); - Main.tile[index6, index7].halfBrick(false); - Main.tile[index6, index7].color((byte) 28); - Main.tile[index6, index7 - 1].type = (ushort) 191; - Main.tile[index6, index7 - 1].active(true); - Main.tile[index6, index7 - 1].halfBrick(false); - Main.tile[index6, index7 - 1].color((byte) 28); - numArray5[index2] = index6; - numArray6[index2] = index7; - ++index2; - } - else - { - Main.tile[index6, index7].type = (ushort) 191; - Main.tile[index6, index7].active(true); - Main.tile[index6, index7].halfBrick(false); - Main.tile[index6, index7].color((byte) 28); - Main.tile[index6, index7 + 1].type = (ushort) 191; - Main.tile[index6, index7 + 1].active(true); - Main.tile[index6, index7 + 1].halfBrick(false); - Main.tile[index6, index7 + 1].color((byte) 28); - numArray5[index2] = index6; - numArray6[index2] = index7; - ++index2; - } - } - if (num9 == 0) - { - numArray5[index2] = index6; - numArray6[index2] = index7; - ++index2; - } - } - } - int index8 = (num1 + num2) / 2; - int index9 = index3; - int num11 = WorldGen.genRand.Next(num3 * 3, num3 * 5); - int num12 = 0; - int num13 = 0; - for (; num11 > 0; --num11) - { - Main.tile[index8, index9].type = (ushort) 191; - Main.tile[index8, index9].active(true); - Main.tile[index8, index9].halfBrick(false); - Main.tile[index8, index9].color((byte) 28); - if (num12 > 0) - --num12; - if (num13 > 0) - --num13; - for (int index10 = -1; index10 < 2; ++index10) - { - if (index10 != 0 && (index10 < 0 && num12 == 0 || index10 > 0 && num13 == 0) && WorldGen.genRand.Next(2) == 0) - { - int index11 = index8; - int index12 = index9; - int num14 = WorldGen.genRand.Next(num3, num3 * 3); - if (index10 < 0) - num12 = WorldGen.genRand.Next(3, 5); - if (index10 > 0) - num13 = WorldGen.genRand.Next(3, 5); - int num15 = 0; - while (num14 > 0) - { - --num14; - index11 += index10; - Main.tile[index11, index12].type = (ushort) 191; - Main.tile[index11, index12].active(true); - Main.tile[index11, index12].halfBrick(false); - Main.tile[index11, index12].color((byte) 28); - if (num14 == 0) - { - numArray5[index2] = index11; - numArray6[index2] = index12; - flagArray[index2] = true; - ++index2; - } - if (WorldGen.genRand.Next(5) == 0) - { - if (WorldGen.genRand.Next(2) == 0) - --index12; - else - ++index12; - Main.tile[index11, index12].type = (ushort) 191; - Main.tile[index11, index12].active(true); - Main.tile[index11, index12].halfBrick(false); - Main.tile[index11, index12].color((byte) 28); - } - if (num15 > 0) - --num15; - else if (WorldGen.genRand.Next(3) == 0) - { - num15 = WorldGen.genRand.Next(2, 4); - int index13 = index11; - int num16 = index12; - int index14 = WorldGen.genRand.Next(2) != 0 ? num16 + 1 : num16 - 1; - Main.tile[index13, index14].type = (ushort) 191; - Main.tile[index13, index14].active(true); - Main.tile[index13, index14].halfBrick(false); - Main.tile[index13, index14].color((byte) 28); - numArray5[index2] = index13; - numArray6[index2] = index14; - flagArray[index2] = true; - int index15 = index2 + 1; - numArray5[index15] = index13 + WorldGen.genRand.Next(-5, 6); - numArray6[index15] = index14 + WorldGen.genRand.Next(-5, 6); - flagArray[index15] = true; - index2 = index15 + 1; - } - } - } - } - numArray5[index2] = index8; - numArray6[index2] = index9; - ++index2; - if (WorldGen.genRand.Next(4) == 0) - { - if (WorldGen.genRand.Next(2) == 0) - --index8; - else - ++index8; - Main.tile[index8, index9].type = (ushort) 191; - Main.tile[index8, index9].active(true); - Main.tile[index8, index9].halfBrick(false); - Main.tile[index8, index9].color((byte) 28); - } - --index9; - } - for (int i1 = minl; i1 <= minr; ++i1) - { - int num17 = WorldGen.genRand.Next(1, 6); - int j1 = j + 1; - while (num17 > 0) - { - if (WorldGen.SolidTile(i1, j1)) - --num17; - Main.tile[i1, j1].type = (ushort) 191; - Main.tile[i1, j1].active(true); - Main.tile[i1, j1].halfBrick(false); - ++j1; - } - int num18 = j1; - int num19 = WorldGen.genRand.Next(2, num3 + 1); - for (int index16 = 0; index16 < num19; ++index16) - { - int index17 = num18; - int num20 = (minl + minr) / 2; - int num21 = 1; - int num22 = i1 >= num20 ? 1 : -1; - if (i1 == num20 || num3 > 6 && (i1 == num20 - 1 || i1 == num20 + 1)) - num22 = 0; - int num23 = num22; - int index18 = i1; - int num24 = WorldGen.genRand.Next((int) ((double) num3 * 3.5), num3 * 6); - while (num24 > 0) - { - --num24; + Main.tile[index19, index18].type = (ushort) 191; + Main.tile[index19, index18].active(true); + Main.tile[index19, index18].halfBrick(false); index18 += num22; - if (Main.tile[index18, index17].wall != (ushort) 244) + Main.tile[index19, index18].type = (ushort) 191; + Main.tile[index19, index18].active(true); + Main.tile[index19, index18].halfBrick(false); + if (!Main.tile[index19, index18 + 1].active()) { - Main.tile[index18, index17].type = (ushort) 191; - Main.tile[index18, index17].active(true); - Main.tile[index18, index17].halfBrick(false); - } - index17 += num21; - if (Main.tile[index18, index17].wall != (ushort) 244) - { - Main.tile[index18, index17].type = (ushort) 191; - Main.tile[index18, index17].active(true); - Main.tile[index18, index17].halfBrick(false); - } - if (!Main.tile[index18, index17 + 1].active()) - { - num22 = 0; - num21 = 1; + num23 = 0; + num22 = 1; } if (WorldGen.genRand.Next(3) == 0) - num22 = num23 >= 0 ? (num23 <= 0 ? WorldGen.genRand.Next(-1, 2) : (num22 != 0 ? 0 : 1)) : (num22 != 0 ? 0 : -1); + num23 = num24 >= 0 ? (num24 <= 0 ? WorldGen.genRand.Next(-1, 2) : (num23 != 0 ? 0 : 1)) : (num23 != 0 ? 0 : -1); if (WorldGen.genRand.Next(3) == 0) - num21 = num21 != 0 ? 0 : 1; + num22 = num22 != 0 ? 0 : 1; } } } - for (int index19 = 0; index19 < index2; ++index19) + for (int index20 = 0; index20 < index2; ++index20) { - int num25 = (int) ((double) WorldGen.genRand.Next(5, 8) * (1.0 + (double) num3 * 0.0500000007450581)); - if (flagArray[index19]) - num25 = WorldGen.genRand.Next(6, 12) + num3; - int num26 = numArray5[index19] - num25 * 2; - int num27 = numArray5[index19] + num25 * 2; - int num28 = numArray6[index19] - num25 * 2; - int num29 = numArray6[index19] + num25 * 2; - float num30 = (float) (2.0 - (double) WorldGen.genRand.Next(5) * 0.100000001490116); - for (int index20 = num26; index20 <= num27; ++index20) + int num26 = (int) ((double) WorldGen.genRand.Next(5, 8) * (1.0 + (double) minValue * 0.0500000007450581)); + if (flagArray[index20]) + num26 = WorldGen.genRand.Next(7, 13); + int num27 = numArray5[index20] - num26; + int num28 = numArray5[index20] + num26; + int num29 = numArray6[index20] - num26; + int num30 = numArray6[index20] + num26; + float num31 = (float) (2.0 - (double) WorldGen.genRand.Next(5) * 0.100000001490116); + for (int index21 = num27; index21 <= num28; ++index21) { - for (int index21 = num28; index21 <= num29; ++index21) + for (int index22 = num29; index22 <= num30; ++index22) { - if (Main.tile[index20, index21].type != (ushort) 191) + if (Main.tile[index21, index22].type != (ushort) 191 && (double) Math.Abs(numArray5[index20] - index21) + (double) Math.Abs(numArray6[index20] - index22) * (double) num31 < (double) num26) { - if (flagArray[index19]) - { - if ((double) (new Vector2((float) numArray5[index19], (float) numArray6[index19]) - new Vector2((float) index20, (float) index21)).Length() < (double) num25 * 0.9) - { - Main.tile[index20, index21].type = (ushort) 192; - Main.tile[index20, index21].active(true); - Main.tile[index20, index21].halfBrick(false); - Main.tile[index20, index21].color((byte) 28); - } - } - else if ((double) Math.Abs(numArray5[index19] - index20) + (double) Math.Abs(numArray6[index19] - index21) * (double) num30 < (double) num25) - { - Main.tile[index20, index21].type = (ushort) 192; - Main.tile[index20, index21].active(true); - Main.tile[index20, index21].halfBrick(false); - Main.tile[index20, index21].color((byte) 28); - } + Main.tile[index21, index22].type = (ushort) 192; + Main.tile[index21, index22].active(true); + Main.tile[index21, index22].halfBrick(false); } } } } - WorldGen.GrowDungeonTree_MakePassage(j, num3, ref minl, ref minr, patch); - Main.tileSolid[48] = true; - return true; - } - - private static bool GrowLivingTree_HorizontalTunnel(int i, int j) - { - int num1 = i; - int y = j; - int num2 = num1; - int num3 = num1; - int num4 = 80; - bool flag1 = false; - int num5 = 1; - if (WorldGen.genRand.Next(2) == 0) - num5 *= -1; - for (int index1 = 0; index1 < 2; ++index1) + if (minValue >= 4 && WorldGen.genRand.Next(3) != 0) { bool flag2 = false; - if (num2 == num1 && num5 > 0) + int num32 = num7; + int num33 = num8; + int j2 = j - 5; + int num34 = 50; + int num35 = WorldGen.genRand.Next(400, 700); + int num36 = 1; + bool flag3 = true; + while (num35 > 0) { - for (int x = num1 + 5; x < num1 + num4; ++x) + ++j2; + --num35; + --num34; + int num37 = (num7 + num8) / 2; + int num38 = 0; + if (j2 > j && minValue == 4) + num38 = 1; + for (int index23 = num7 - num38; index23 <= num8 + num38; ++index23) { - if (!WorldGen.InWorld(x, y, 10)) - return false; - if ((double) y < Main.worldSurface) + if (index23 > num37 - 2 && index23 <= num37 + 1) { - int index2 = y - 7; - while (index2 <= y + 7 && Main.tile[x, index2].wall != (ushort) 0) - ++index2; + if (Main.tile[index23, j2].type != (ushort) 19) + Main.tile[index23, j2].active(false); + Main.tile[index23, j2].wall = (byte) 78; + if (Main.tile[index23 - 1, j2].wall > (byte) 0 || (double) j2 >= Main.worldSurface) + Main.tile[index23 - 1, j2].wall = (byte) 78; + if (Main.tile[index23 + 1, j2].wall > (byte) 0 || (double) j2 >= Main.worldSurface) + Main.tile[index23 + 1, j2].wall = (byte) 78; } - if (Main.tile[x, j].type == (ushort) 48) + else { - flag1 = true; - break; - } - if (Main.tile[x, j].type == (ushort) 191) - { - for (int index3 = y - 2; index3 <= y; ++index3) - { - if (Main.tile[x + 2, index3].wall != (ushort) 244) - flag2 = true; - } - if (!flag2) - { - index1 = 2; - num3 = x + 2; - break; - } - break; - } - if (!Main.tile[x, j].active()) - { - bool flag3 = true; - for (int index4 = y - 2; index4 <= y; ++index4) - { - if ((double) y < Main.worldSurface + 3.0 && (Main.tile[x + 1, index4].wall == (ushort) 0 || Main.tile[x + 2, index4].wall == (ushort) 0 || Main.tile[x + 3, index4].wall == (ushort) 0)) - return false; - if (Main.tile[x, index4].active() || Main.tile[x + 1, index4].active() || Main.tile[x + 2, index4].active()) - flag3 = false; - } - if (flag3) - { - index1 = 2; - num3 = x; - break; - } + Main.tile[index23, j2].type = (ushort) 191; + Main.tile[index23, j2].active(true); + Main.tile[index23, j2].halfBrick(false); } } - } - bool flag4 = false; - if (num3 == num1 && num5 < 0) - { - for (int x = num1 - 5; x > num1 - num4; --x) + ++num36; + if (num36 >= 6) { - if (!WorldGen.InWorld(x, y, 10)) - return false; - if ((double) y < Main.worldSurface) + num36 = 0; + int num39 = WorldGen.genRand.Next(3); + if (num39 == 0) + num39 = -1; + if (flag3) + num39 = 2; + if (num39 == 2) { - int index5 = y - 7; - while (index5 <= y + 7 && Main.tile[x, index5].wall != (ushort) 0) - ++index5; - } - if (Main.tile[x, j].type == (ushort) 48) - { - flag1 = true; - break; - } - if (Main.tile[x, y].type == (ushort) 191) - { - for (int index6 = y - 2; index6 <= y; ++index6) + flag3 = false; + for (int i2 = num7; i2 <= num8; ++i2) { - if (Main.tile[x - 3, index6].wall != (ushort) 244) - flag4 = true; + if (i2 > num37 - 2 && i2 <= num37 + 1) + { + Main.tile[i2, j2 + 1].active(false); + WorldGen.PlaceTile(i2, j2 + 1, 19, true, style: 23); + } + } + } + else + { + num7 += num39; + num8 += num39; + } + if (num34 <= 0 && !flag2) + { + flag2 = true; + int num40 = WorldGen.genRand.Next(2); + if (num40 == 0) + num40 = -1; + int num41 = j2 - 2; + int num42 = j2; + int num43 = (num7 + num8) / 2; + if (num40 < 0) + --num43; + if (num40 > 0) + ++num43; + int num44 = WorldGen.genRand.Next(15, 30); + int num45 = num43 + num44; + if (num40 < 0) + { + num45 = num43; + num43 -= num44; + } + WorldGen.dMinX = num43; + WorldGen.dMaxX = num45; + if (num40 < 0) + WorldGen.dMinX -= 40; + else + WorldGen.dMaxX += 40; + bool flag4 = false; + for (int index24 = num43; index24 < num45; ++index24) + { + for (int index25 = j2 - 20; index25 < j2 + 10; ++index25) + { + if (Main.tile[index24, index25].wall == (byte) 0 && !Main.tile[index24, index25].active() && (double) index25 < Main.worldSurface) + flag4 = true; + } } if (!flag4) { - index1 = 2; - num2 = x - 2; - break; + for (int index26 = num43; index26 <= num45; ++index26) + { + for (int index27 = num41 - 2; index27 <= num42 + 2; ++index27) + { + if (Main.tile[index26, index27].wall != (byte) 78 && Main.tile[index26, index27].type != (ushort) 19) + { + Main.tile[index26, index27].active(true); + Main.tile[index26, index27].type = (ushort) 191; + Main.tile[index26, index27].halfBrick(false); + } + if (index27 >= num41 && index27 <= num42) + { + Main.tile[index26, index27].liquid = (byte) 0; + Main.tile[index26, index27].wall = (byte) 78; + Main.tile[index26, index27].active(false); + } + } + } + int i3 = (num7 + num8) / 2 + 3 * num40; + int j3 = j2; + WorldGen.PlaceTile(i3, j3, 10, true, style: 7); + int num46 = WorldGen.genRand.Next(5, 9); + int num47 = WorldGen.genRand.Next(4, 6); + int num48; + int num49; + if (num40 < 0) + { + num48 = num43 + num46; + num49 = num43 - num46; + } + else + { + num49 = num45 - num46; + num48 = num45 + num46; + } + int num50 = num42 - num47; + for (int index28 = num49 - 2; index28 <= num48 + 2; ++index28) + { + for (int index29 = num50 - 2; index29 <= num42 + 2; ++index29) + { + if (Main.tile[index28, index29].wall != (byte) 78 && Main.tile[index28, index29].type != (ushort) 19) + { + Main.tile[index28, index29].active(true); + Main.tile[index28, index29].type = (ushort) 191; + Main.tile[index28, index29].halfBrick(false); + } + if (index29 >= num50 && index29 <= num42 && index28 >= num49 && index28 <= num48) + { + Main.tile[index28, index29].liquid = (byte) 0; + Main.tile[index28, index29].wall = (byte) 78; + Main.tile[index28, index29].active(false); + } + } + } + int i4 = num49 - 2; + if (num40 < 0) + i4 = num48 + 2; + WorldGen.PlaceTile(i4, j3, 10, true, style: 7); + int i5 = num48; + if (num40 < 0) + i5 = num49; + WorldGen.PlaceTile(i5, j2, 15, true, style: 5); + if (num40 < 0) + { + Main.tile[i5, j2 - 1].frameX += (short) 18; + Main.tile[i5, j2].frameX += (short) 18; + } + int i6 = num48 - 2; + if (num40 < 0) + i6 = num49 + 2; + WorldGen.PlaceTile(i6, j2, 14, true, style: 6); + int i7 = num48 - 4; + if (num40 < 0) + i7 = num49 + 4; + WorldGen.PlaceTile(i7, j2, 15, true, style: 5); + if (num40 > 0) + { + Main.tile[i7, j2 - 1].frameX += (short) 18; + Main.tile[i7, j2].frameX += (short) 18; + } + int i8 = num48 - 7; + if (num40 < 0) + i8 = num49 + 8; + WorldGen.genRand.Next(2); + int contain = 832; + WorldGen.AddBuriedChest(i8, j2, contain, Style: 12); } - break; } - if (!Main.tile[x, j].active()) + } + if (num34 <= 0) + { + bool flag5 = true; + for (int i9 = num7; i9 <= num8; ++i9) { - bool flag5 = true; - for (int index7 = y - 2; index7 <= y; ++index7) + for (int j4 = j2 + 1; j4 <= j2 + 4; ++j4) { - if ((double) y < Main.worldSurface + 3.0 && (Main.tile[x - 1, index7].wall == (ushort) 0 || Main.tile[x - 2, index7].wall == (ushort) 0 || Main.tile[x - 3, index7].wall == (ushort) 0)) - return false; - if (Main.tile[x, index7].active() || Main.tile[x - 1, index7].active() || Main.tile[x - 2, index7].active()) + if (WorldGen.SolidTile(i9, j4)) flag5 = false; } - if (flag5) - { - index1 = 2; - num2 = x; - break; - } } + if (flag5) + num35 = 0; } } - num5 *= -1; - } - if (num2 == num3) - return false; - bool flag6 = false; - bool flag7 = false; - for (int j1 = y - 5; j1 <= y + 1; ++j1) - { - for (int i1 = num2; i1 <= num3; ++i1) + int num51 = num32; + int num52 = num33; + int num53 = (num51 + num52) / 2; + if (WorldGen.genRand.Next(2) == 0) + num52 = num53; + else + num51 = num53; + for (int index30 = num51; index30 <= num52; ++index30) { - int num6 = 2; - if (Math.Abs(i1 - num3) > 3 && Math.Abs(i1 - num2) > 3) - num6 = 4; - if (Main.tile[i1, j1].wall != (ushort) 244 && Main.tile[i1, j1].type != (ushort) 19 && Main.tile[i1, j1].type != (ushort) 15 && Main.tile[i1, j1].type != (ushort) 304 && Main.tile[i1, j1].type != (ushort) 21 && Main.tile[i1, j1].type != (ushort) 10) + for (int index31 = j - 3; index31 <= j; ++index31) { - if (!Main.wallDungeon[(int) Main.tile[i1, j1].wall] && (!Main.tile[i1, j1].active() || !Main.wallDungeon[(int) Main.tile[i1, j1 - 1].wall] && !Main.wallDungeon[(int) Main.tile[i1, j1 + 1].wall])) + Main.tile[index30, index31].active(false); + bool flag6 = true; + for (int index32 = index30 - 1; index32 <= index30 + 1; ++index32) { - Main.tile[i1, j1].active(true); - Main.tile[i1, j1].type = (ushort) 191; - Main.tile[i1, j1].halfBrick(false); - } - if (Main.tile[i1, j1 - 1].type == (ushort) 40) - Main.tile[i1, j1 - 1].type = (ushort) 0; - if (Main.tile[i1, j1 + 1].type == (ushort) 40) - Main.tile[i1, j1 + 1].type = (ushort) 0; - } - if (j1 >= y - num6 && j1 <= y && Main.tile[i1, j1].type != (ushort) 19 && Main.tile[i1, j1].type != (ushort) 15 && Main.tile[i1, j1].type != (ushort) 304 && Main.tile[i1, j1].type != (ushort) 21 && Main.tile[i1, j1].type != (ushort) 10 && Main.tile[i1, j1 - 1].type != (ushort) 15 && Main.tile[i1, j1 - 1].type != (ushort) 304 && Main.tile[i1, j1 - 1].type != (ushort) 21 && Main.tile[i1, j1 - 1].type != (ushort) 10 && Main.tile[i1, j1 + 1].type != (ushort) 10) - { - if (!Main.wallDungeon[(int) Main.tile[i1, j1].wall]) - Main.tile[i1, j1].wall = (ushort) 244; - Main.tile[i1, j1].liquid = (byte) 0; - Main.tile[i1, j1].active(false); - } - if (j1 == y) - { - int style = 7; - if (Main.wallDungeon[(int) Main.tile[i1, j1].wall] || Main.wallDungeon[(int) Main.tile[i1, j1 - 1].wall] || Main.wallDungeon[(int) Main.tile[i1, j1 - 2].wall]) - style = 13; - if (i1 <= num2 + 4 && !flag6) - { - if (Main.tile[i1 - 1, j1].type == (ushort) 10 || Main.tile[i1 + 1, j1].type == (ushort) 10) - flag6 = true; - else if (WorldGen.genRand.Next(3) == 0) + for (int index33 = index31 - 1; index33 <= index31 + 1; ++index33) { - WorldGen.PlaceTile(i1, j1, 10, true, style: style); - if (Main.tile[i1, j1].type == (ushort) 10) - flag6 = true; - } - } - if (i1 >= num3 - 4 && !flag7) - { - if (Main.tile[i1 - 1, j1].type == (ushort) 10 || Main.tile[i1 + 1, j1].type == (ushort) 10) - flag7 = true; - else if (WorldGen.genRand.Next(3) == 0) - { - WorldGen.PlaceTile(i1, j1, 10, true, style: style); - if (Main.tile[i1, j1].type == (ushort) 10) - flag7 = true; + if (!Main.tile[index32, index33].active() && Main.tile[index32, index33].wall == (byte) 0) + flag6 = false; } } + if (flag6) + Main.tile[index30, index31].wall = (byte) 78; } } } return true; } - private static void GrowDungeonTree_MakePassage( - int j, - int W, - ref int minl, - ref int minr, - bool noSecretRoom = false) - { - int num1 = minl; - int num2 = minr; - int num3 = (minl + minr) / 2; - int num4 = 5; - int j1 = j - 6; - int num5 = 0; - bool flag = true; - WorldGen.genRand.Next(5, 16); -label_1: - int num6; - int style; - while (true) - { - int num7; - do - { - do - { - ++j1; - if (j1 <= WorldGen.dungeonY - 5) - { - num6 = (minl + minr) / 2; - int num8 = 1; - if (j1 > j && W <= 4) - ++num8; - for (int i = minl - num8; i <= minr + num8; ++i) - { - if (i > num6 - 2 && i <= num6 + 1) - { - if (j1 > j - 4) - { - if (Main.tile[i, j1].type != (ushort) 19 && Main.tile[i, j1].type != (ushort) 15 && Main.tile[i, j1].type != (ushort) 304 && Main.tile[i, j1].type != (ushort) 21 && Main.tile[i, j1].type != (ushort) 10 && Main.tile[i, j1 - 1].type != (ushort) 15 && Main.tile[i, j1 - 1].type != (ushort) 304 && Main.tile[i, j1 - 1].type != (ushort) 21 && Main.tile[i, j1 - 1].type != (ushort) 10 && Main.tile[i, j1 + 1].type != (ushort) 10) - Main.tile[i, j1].active(false); - if (!Main.wallDungeon[(int) Main.tile[i, j1].wall]) - Main.tile[i, j1].wall = (ushort) 244; - if (!Main.wallDungeon[(int) Main.tile[i - 1, j1].wall] && (Main.tile[i - 1, j1].wall > (ushort) 0 || (double) j1 >= Main.worldSurface)) - Main.tile[i - 1, j1].wall = (ushort) 244; - if (!Main.wallDungeon[(int) Main.tile[i + 1, j1].wall] && (Main.tile[i + 1, j1].wall > (ushort) 0 || (double) j1 >= Main.worldSurface)) - Main.tile[i + 1, j1].wall = (ushort) 244; - if (j1 == j && i > num6 - 2 && i <= num6 + 1) - { - Main.tile[i, j1 + 1].active(false); - WorldGen.PlaceTile(i, j1 + 1, 19, true, style: 23); - } - } - } - else - { - if (Main.tile[i, j1].type != (ushort) 15 && Main.tile[i, j1].type != (ushort) 304 && Main.tile[i, j1].type != (ushort) 21 && Main.tile[i, j1].type != (ushort) 10 && Main.tile[i - 1, j1].type != (ushort) 10 && Main.tile[i + 1, j1].type != (ushort) 10) - { - if (!Main.wallDungeon[(int) Main.tile[i, j1].wall]) - { - Main.tile[i, j1].type = (ushort) 191; - Main.tile[i, j1].active(true); - Main.tile[i, j1].halfBrick(false); - } - if (Main.tile[i - 1, j1].type == (ushort) 40) - Main.tile[i - 1, j1].type = (ushort) 0; - if (Main.tile[i + 1, j1].type == (ushort) 40) - Main.tile[i + 1, j1].type = (ushort) 0; - } - if (j1 <= j && j1 > j - 4 && i > minl - num8 && i <= minr + num8 - 1) - Main.tile[i, j1].wall = (ushort) 244; - } - if (!WorldGen.gen) - { - WorldGen.SquareTileFrame(i, j1); - WorldGen.SquareWallFrame(i, j1); - } - } - ++num5; - } - else - goto label_50; - } - while (num5 < 6); - num5 = 0; - num7 = WorldGen.genRand.Next(3); - if (num7 == 0) - num7 = -1; - if (flag) - num7 = 2; - if (num7 == -1 && Main.tile[minl - num4, j1].wall == (ushort) 244) - num7 = 1; - else if (num7 == 1 && Main.tile[minr + num4, j1].wall == (ushort) 244) - num7 = -1; - if (num7 == 2) - { - flag = false; - style = 23; - if (Main.wallDungeon[(int) Main.tile[minl, j1 + 1].wall] || Main.wallDungeon[(int) Main.tile[minl + 1, j1 + 1].wall] || Main.wallDungeon[(int) Main.tile[minl + 2, j1 + 1].wall]) - style = 12; - } - else - goto label_49; - } - while (!WorldGen.SolidTile(minl - 1, j1 + 1) && !WorldGen.SolidTile(minr + 1, j1 + 1) && style == 12); - break; -label_49: - minl += num7; - minr += num7; - } - for (int i = minl; i <= minr; ++i) - { - if (i > num6 - 2 && i <= num6 + 1) - { - Main.tile[i, j1 + 1].active(false); - WorldGen.PlaceTile(i, j1 + 1, 19, true, style: style); - } - } - goto label_1; -label_50: - minl = num1; - minr = num2; - int num9 = (minl + minr) / 2; - for (int index1 = minl; index1 <= minr; ++index1) - { - for (int index2 = j - 3; index2 <= j; ++index2) - { - Main.tile[index1, index2].active(false); - if (!Main.wallDungeon[(int) Main.tile[index1, index2].wall]) - Main.tile[index1, index2].wall = (ushort) 244; - } - } - } - - private static void GrowLivingTree_MakePassage( - int j, - int W, - ref int minl, - ref int minr, - bool noSecretRoom = false) - { - bool flag1 = noSecretRoom; - int num1 = minl; - int num2 = minr; - bool flag2 = false; - int num3 = (minl + minr) / 2; - int num4 = 5; - int index1 = j - 6; - int num5 = 50; - int num6 = WorldGen.genRand.Next(400, 700); - int num7 = 0; - bool flag3 = true; - int num8 = WorldGen.genRand.Next(5, 16); - while (num6 > 0) - { - ++index1; - --num6; - --num5; - int i1 = (minl + minr) / 2; - if (!Main.tile[minl, index1].active() && Main.tile[minl, index1].wall == (ushort) 244 && !Main.tile[minr, index1].active() && Main.tile[minr, index1].wall == (ushort) 244) - break; - int num9 = 1; - if (index1 > j && W <= 4) - ++num9; - for (int i2 = minl - num9; i2 <= minr + num9; ++i2) - { - if (Main.wallDungeon[(int) Main.tile[i2, index1].wall]) - { - flag1 = true; - flag2 = true; - } - if (i2 > i1 - 2 && i2 <= i1 + 1) - { - if (index1 > j - 4) - { - if (Main.tile[i2, index1].type != (ushort) 19 && Main.tile[i2, index1].type != (ushort) 15 && Main.tile[i2, index1].type != (ushort) 304 && Main.tile[i2, index1].type != (ushort) 21 && Main.tile[i2, index1].type != (ushort) 10 && Main.tile[i2, index1 - 1].type != (ushort) 15 && Main.tile[i2, index1 - 1].type != (ushort) 304 && Main.tile[i2, index1 - 1].type != (ushort) 21 && Main.tile[i2, index1 - 1].type != (ushort) 10 && Main.tile[i2, index1 + 1].type != (ushort) 10) - Main.tile[i2, index1].active(false); - if (!Main.wallDungeon[(int) Main.tile[i2, index1].wall]) - Main.tile[i2, index1].wall = (ushort) 244; - if (!Main.wallDungeon[(int) Main.tile[i2 - 1, index1].wall] && (Main.tile[i2 - 1, index1].wall > (ushort) 0 || (double) index1 >= Main.worldSurface)) - Main.tile[i2 - 1, index1].wall = (ushort) 244; - if (!Main.wallDungeon[(int) Main.tile[i2 + 1, index1].wall] && (Main.tile[i2 + 1, index1].wall > (ushort) 0 || (double) index1 >= Main.worldSurface)) - Main.tile[i2 + 1, index1].wall = (ushort) 244; - if (index1 == j && i2 > i1 - 2 && i2 <= i1 + 1) - { - Main.tile[i2, index1 + 1].active(false); - WorldGen.PlaceTile(i2, index1 + 1, 19, true, style: 23); - } - } - } - else - { - if (Main.tile[i2, index1].type != (ushort) 15 && Main.tile[i2, index1].type != (ushort) 304 && Main.tile[i2, index1].type != (ushort) 21 && Main.tile[i2, index1].type != (ushort) 10 && Main.tile[i2 - 1, index1].type != (ushort) 10 && Main.tile[i2 + 1, index1].type != (ushort) 10) - { - if (!Main.wallDungeon[(int) Main.tile[i2, index1].wall]) - { - Main.tile[i2, index1].type = (ushort) 191; - Main.tile[i2, index1].active(true); - Main.tile[i2, index1].halfBrick(false); - } - if (Main.tile[i2 - 1, index1].type == (ushort) 40) - Main.tile[i2 - 1, index1].type = (ushort) 0; - if (Main.tile[i2 + 1, index1].type == (ushort) 40) - Main.tile[i2 + 1, index1].type = (ushort) 0; - } - if (index1 <= j && index1 > j - 4 && i2 > minl - num9 && i2 <= minr + num9 - 1) - Main.tile[i2, index1].wall = (ushort) 244; - } - if (!WorldGen.gen) - { - WorldGen.SquareTileFrame(i2, index1); - WorldGen.SquareWallFrame(i2, index1); - } - } - ++num7; - if (num7 >= 6) - { - num7 = 0; - int num10 = WorldGen.genRand.Next(3); - if (num10 == 0) - num10 = -1; - if (flag3) - num10 = 2; - if (num10 == -1 && Main.tile[minl - num4, index1].wall == (ushort) 244) - num10 = 1; - else if (num10 == 1 && Main.tile[minr + num4, index1].wall == (ushort) 244) - num10 = -1; - if (num10 == 2) - { - flag3 = false; - int style = 23; - if (Main.wallDungeon[(int) Main.tile[minl, index1 + 1].wall] || Main.wallDungeon[(int) Main.tile[minl + 1, index1 + 1].wall] || Main.wallDungeon[(int) Main.tile[minl + 2, index1 + 1].wall]) - style = 12; - for (int i3 = minl; i3 <= minr; ++i3) - { - if (i3 > i1 - 2 && i3 <= i1 + 1) - { - Main.tile[i3, index1 + 1].active(false); - WorldGen.PlaceTile(i3, index1 + 1, 19, true, style: style); - } - } - } - else - { - minl += num10; - minr += num10; - } - if (noSecretRoom) - { - --num8; - if (num8 <= 0) - num8 = !WorldGen.GrowLivingTree_HorizontalTunnel(i1, index1) ? WorldGen.genRand.Next(2, 11) : WorldGen.genRand.Next(5, 21); - } - if (num5 <= 0 && !flag1) - { - flag1 = true; - WorldGen.GrowLivingTreePassageRoom(minl, minr, index1); - } - } - if (flag2) - { - bool flag4 = true; - for (int i4 = minl; i4 <= minr; ++i4) - { - for (int j1 = index1 + 1; j1 <= index1 + 2; ++j1) - { - if (WorldGen.SolidTile(i4, j1)) - flag4 = false; - } - } - if (flag4) - num6 = 0; - } - else if (num5 <= 0) - { - bool flag5 = true; - for (int i5 = minl; i5 <= minr; ++i5) - { - for (int j2 = index1 + 1; j2 <= index1 + 4; ++j2) - { - if (WorldGen.SolidTile(i5, j2)) - flag5 = false; - } - } - if (flag5) - num6 = 0; - } - } - minl = num1; - minr = num2; - int num11 = (minl + minr) / 2; - for (int index2 = minl; index2 <= minr; ++index2) - { - for (int index3 = j - 3; index3 <= j; ++index3) - { - Main.tile[index2, index3].active(false); - bool flag6 = true; - for (int index4 = index2 - 1; index4 <= index2 + 1; ++index4) - { - for (int index5 = index3 - 1; index5 <= index3 + 1; ++index5) - { - if (!Main.tile[index4, index5].active() && Main.tile[index4, index5].wall == (ushort) 0) - flag6 = false; - } - } - if (flag6 && !Main.wallDungeon[(int) Main.tile[index2, index3].wall]) - Main.tile[index2, index3].wall = (ushort) 244; - } - } - } - - private static void GrowLivingTreePassageRoom(int minl, int minr, int Y) - { - int num1 = WorldGen.genRand.Next(2); - if (num1 == 0) - num1 = -1; - int num2 = Y - 2; - int num3 = Y; - int num4 = (minl + minr) / 2; - if (num1 < 0) - --num4; - if (num1 > 0) - ++num4; - int num5 = WorldGen.genRand.Next(15, 30); - int num6 = num4 + num5; - if (num1 < 0) - { - num6 = num4; - num4 -= num5; - } - for (int index1 = num4; index1 < num6; ++index1) - { - for (int index2 = Y - 20; index2 < Y + 10; ++index2) - { - if (Main.tile[index1, index2].wall == (ushort) 0 && !Main.tile[index1, index2].active() && (double) index2 < Main.worldSurface) - return; - } - } - WorldGen.dMinX = num4; - WorldGen.dMaxX = num6; - if (num1 < 0) - WorldGen.dMinX -= 40; - else - WorldGen.dMaxX += 40; - for (int index3 = num4; index3 <= num6; ++index3) - { - for (int index4 = num2 - 2; index4 <= num3 + 2; ++index4) - { - if (Main.tile[index3 - 1, index4].type == (ushort) 40) - Main.tile[index3 - 1, index4].type = (ushort) 0; - if (Main.tile[index3 + 1, index4].type == (ushort) 40) - Main.tile[index3 + 1, index4].type = (ushort) 0; - if (Main.tile[index3, index4 - 1].type == (ushort) 40) - Main.tile[index3, index4 - 1].type = (ushort) 0; - if (Main.tile[index3, index4 + 1].type == (ushort) 40) - Main.tile[index3, index4 + 1].type = (ushort) 0; - if (Main.tile[index3, index4].wall != (ushort) 244 && Main.tile[index3, index4].type != (ushort) 19) - { - Main.tile[index3, index4].active(true); - Main.tile[index3, index4].type = (ushort) 191; - Main.tile[index3, index4].halfBrick(false); - } - if (index4 >= num2 && index4 <= num3) - { - Main.tile[index3, index4].liquid = (byte) 0; - Main.tile[index3, index4].wall = (ushort) 244; - Main.tile[index3, index4].active(false); - } - } - } - int i1 = (minl + minr) / 2 + 3 * num1; - int j = Y; - WorldGen.PlaceTile(i1, j, 10, true, style: 7); - int num7 = WorldGen.genRand.Next(5, 9); - int num8 = WorldGen.genRand.Next(4, 6); - int num9; - int num10; - if (num1 < 0) - { - num9 = num4 + num7; - num10 = num4 - num7; - } - else - { - num10 = num6 - num7; - num9 = num6 + num7; - } - int num11 = num3 - num8; - for (int index5 = num10 - 2; index5 <= num9 + 2; ++index5) - { - for (int index6 = num11 - 2; index6 <= num3 + 2; ++index6) - { - if (Main.tile[index5 - 1, index6].type == (ushort) 40) - Main.tile[index5 - 1, index6].type = (ushort) 40; - if (Main.tile[index5 + 1, index6].type == (ushort) 40) - Main.tile[index5 + 1, index6].type = (ushort) 40; - if (Main.tile[index5, index6 - 1].type == (ushort) 40) - Main.tile[index5, index6 - 1].type = (ushort) 40; - if (Main.tile[index5, index6 + 1].type == (ushort) 40) - Main.tile[index5, index6 + 1].type = (ushort) 40; - if (Main.tile[index5, index6].wall != (ushort) 244 && Main.tile[index5, index6].type != (ushort) 19) - { - Main.tile[index5, index6].active(true); - Main.tile[index5, index6].type = (ushort) 191; - Main.tile[index5, index6].halfBrick(false); - } - if (index6 >= num11 && index6 <= num3 && index5 >= num10 && index5 <= num9) - { - Main.tile[index5, index6].liquid = (byte) 0; - Main.tile[index5, index6].wall = (ushort) 244; - Main.tile[index5, index6].active(false); - } - } - } - int i2 = num10 - 2; - if (num1 < 0) - i2 = num9 + 2; - WorldGen.PlaceTile(i2, j, 10, true, style: 7); - int i3 = num9; - if (num1 < 0) - i3 = num10; - int maxValue = 2; - if (WorldGen.genRand.Next(maxValue) == 0) - { - maxValue += 2; - WorldGen.PlaceTile(i3, Y, 15, true, style: 5); - if (num1 < 0) - { - Main.tile[i3, Y - 1].frameX += (short) 18; - Main.tile[i3, Y].frameX += (short) 18; - } - } - int i4 = num9 - 2; - if (num1 < 0) - i4 = num10 + 2; - WorldGen.PlaceTile(i4, Y, 304, true); - int i5 = num9 - 4; - if (num1 < 0) - i5 = num10 + 4; - if (WorldGen.genRand.Next(maxValue) == 0) - { - WorldGen.PlaceTile(i5, Y, 15, true, style: 5); - if (num1 > 0) - { - Main.tile[i5, Y - 1].frameX += (short) 18; - Main.tile[i5, Y].frameX += (short) 18; - } - } - int i6 = num9 - 7; - if (num1 < 0) - i6 = num10 + 8; - int contain = 832; - if (WorldGen.genRand.Next(3) == 0) - contain = 4281; - WorldGen.AddBuriedChest(i6, Y, contain, Style: 12); - } - public static void TreeGrowFXCheck(int x, int y) { - int treeHeight = 1; - int passStyle = -1; - Tile topTile = (Tile) null; + int height = 1; + int num1 = -1; + Tile tile1 = (Tile) null; for (int index = -1; index > -100; --index) { - Tile tile = Main.tile[x, y + index]; - if (tile.active() && TileID.Sets.GetsCheckedForLeaves[(int) tile.type]) + Tile tile2 = Main.tile[x, y + index]; + if (tile2.active() && (tile2.type == (ushort) 5 || tile2.type == (ushort) 323 || tile2.type == (ushort) 72)) { - topTile = tile; - ++treeHeight; + tile1 = tile2; + ++height; } else break; } for (int index = 1; index < 5; ++index) { - Tile t = Main.tile[x, y + index]; - if (t.active() && TileID.Sets.GetsCheckedForLeaves[(int) t.type]) + Tile tile3 = Main.tile[x, y + index]; + if (tile3.active() && (tile3.type == (ushort) 5 || tile3.type == (ushort) 323 || tile3.type == (ushort) 72)) { - ++treeHeight; + ++height; } else { - WorldGen.GetTreeLeaf(x, topTile, t, ref treeHeight, out int _, out passStyle); - break; + int num2 = 0; + if (tile1.frameX == (short) 22) + { + if (tile1.frameY == (short) 220) + num2 = 1; + else if (tile1.frameY == (short) 242) + num2 = 2; + } + switch (tile3.type) + { + case 2: + num1 = 910; + goto label_39; + case 23: + case 400: + num1 = 915; + goto label_39; + case 53: + num1 = 911; + goto label_39; + case 60: + num1 = 914; + goto label_39; + case 70: + num1 = 912; + goto label_39; + case 109: + if (x % 3 == 1) + num2 += 3; + if (x % 3 == 2) + num2 += 6; + int num3 = 917; + switch (num2) + { + case 0: + num1 = 2; + break; + case 1: + num1 = 1; + break; + case 2: + num1 = 7; + break; + case 3: + num1 = 4; + break; + case 4: + num1 = 5; + break; + case 5: + num1 = 6; + break; + case 6: + num1 = 3; + break; + case 7: + num1 = 8; + break; + case 8: + num1 = 0; + break; + } + num1 += num3; + height += 5; + goto label_39; + case 116: + num1 = 919; + goto label_39; + case 147: + num1 = 913; + goto label_39; + case 199: + case 234: + num1 = 916; + goto label_39; + default: + goto label_39; + } } } - if (treeHeight <= 0 || passStyle <= 0) +label_39: + if (height <= 0 || num1 <= 0) return; if (Main.netMode == 2) - NetMessage.SendData(112, number: 1, number2: ((float) x), number3: ((float) y), number4: ((float) treeHeight), number5: passStyle); + NetMessage.SendData(112, number: 1, number2: ((float) x), number3: ((float) y), number4: ((float) height), number5: num1); if (Main.netMode != 0) return; - WorldGen.TreeGrowFX(x, y, treeHeight, passStyle); + WorldGen.TreeGrowFX(x, y, height, num1); } - public static void GetTreeLeaf( - int x, - Tile topTile, - Tile t, - ref int treeHeight, - out int treeFrame, - out int passStyle) + public static void TreeGrowFX(int x, int y, int height, int treeGore) { - treeFrame = 0; - passStyle = -1; - if (topTile.frameX == (short) 22 || topTile.frameX == (short) 44 || topTile.frameX == (short) 66) - { - if (topTile.frameY == (short) 220) - treeFrame = 1; - else if (topTile.frameY == (short) 242) - treeFrame = 2; - } - if (topTile.frameX == (short) 44 || topTile.frameX == (short) 66) - { - if (topTile.frameY == (short) 220) - treeFrame = 1; - else if (topTile.frameY == (short) 242) - treeFrame = 2; - } - switch (topTile.type) - { - case 583: - case 584: - case 585: - case 586: - case 587: - case 588: - case 589: - passStyle = 1249 + ((int) topTile.type - 583); - break; - case 596: - passStyle = 1248; - break; - case 616: - passStyle = 1257; - break; - } - if (passStyle > -1) - return; - switch (t.type) - { - case 2: - case 477: - passStyle = 910; - break; - case 23: - case 400: - passStyle = 915; - break; - case 53: - passStyle = 911; - break; - case 60: - passStyle = 914; - break; - case 70: - passStyle = 912; - break; - case 109: - case 492: - int num1 = 917; - if (WorldGen.GetHollowTreeFoliageStyle() != 20) - { - if (x % 3 == 1) - treeFrame += 3; - if (x % 3 == 2) - treeFrame += 6; - switch (treeFrame) - { - case 0: - passStyle = 2; - break; - case 1: - passStyle = 1; - break; - case 2: - passStyle = 7; - break; - case 3: - passStyle = 4; - break; - case 4: - passStyle = 5; - break; - case 5: - passStyle = 6; - break; - case 6: - passStyle = 3; - break; - case 7: - passStyle = 8; - break; - case 8: - passStyle = 0; - break; - } - } - else - { - int num2 = 196; - if (x % 6 == 1) - treeFrame += 3; - else if (x % 6 == 2) - treeFrame += 6; - else if (x % 6 == 3) - treeFrame += 9; - else if (x % 6 == 4) - treeFrame += 12; - else if (x % 6 == 5) - treeFrame += 15; - switch (treeFrame) - { - case 0: - passStyle = num2; - break; - case 1: - passStyle = num2; - break; - case 2: - passStyle = num2; - break; - case 3: - passStyle = num2 + 1; - break; - case 4: - passStyle = num2 + 2; - break; - case 5: - passStyle = num2 + 1; - break; - case 6: - passStyle = num2 + 3; - break; - case 7: - passStyle = num2 + 4; - break; - case 8: - passStyle = num2 + 5; - break; - case 9: - passStyle = num2 + 6; - break; - case 10: - passStyle = num2 + 6; - break; - case 11: - passStyle = num2 + 6; - break; - case 12: - passStyle = num2 + 7; - break; - case 13: - passStyle = num2 + 7; - break; - case 14: - passStyle = num2 + 7; - break; - case 15: - passStyle = num2 + 8; - break; - case 16: - passStyle = num2 + 8; - break; - case 17: - passStyle = num2 + 8; - break; - } - } - passStyle += num1; - treeHeight += 5; - break; - case 116: - passStyle = 919; - break; - case 147: - passStyle = 913; - break; - case 199: - case 234: - passStyle = 916; - break; - } - } - - public static void TreeGrowFX(int x, int y, int height, int treeGore, bool hitTree = false) - { - Vector2 vector2_1 = new Vector2((float) x, (float) y) * 16f + new Vector2(8f, 8f); + Vector2 vector2 = new Vector2((float) x, (float) y) * 16f + new Vector2(8f, 8f); int Type = treeGore; - int num1 = 4; + int num = 4; int maxValue = 2; for (int index1 = 0; index1 > -height; --index1) { if (index1 > -height / 2 && Main.rand.Next(3) != 0) { for (int index2 = 0; index2 < 5; ++index2) - Dust.NewDust(vector2_1 + new Vector2(-16f, (float) (index1 * 16)) + Utils.RandomVector2(Main.rand, -20f, 20f), 4, 4, num1 + Main.rand.Next(maxValue), SpeedY: -4f, Alpha: 100); + Dust.NewDust(vector2 + new Vector2(-16f, (float) (index1 * 16)) + Utils.RandomVector2(Main.rand, -20f, 20f), 4, 4, num + Main.rand.Next(maxValue), SpeedY: -4f, Alpha: 100); } else { float max = 10f; - Vector2 vector2_2 = new Vector2(5f, 7f); - Gore.NewGore(vector2_1 + new Vector2(-16f, (float) (index1 * 16)) - vector2_2, Utils.RandomVector2(Main.rand, -max, max), Type, (float) (0.699999988079071 + (double) Main.rand.NextFloat() * 0.600000023841858)); - Gore.NewGore(vector2_1 + new Vector2(0.0f, (float) (index1 * 16)) - vector2_2, Utils.RandomVector2(Main.rand, -max, max), Type, (float) (0.699999988079071 + (double) Main.rand.NextFloat() * 0.600000023841858)); - Gore.NewGore(vector2_1 + new Vector2(16f, (float) (index1 * 16)) - vector2_2, Utils.RandomVector2(Main.rand, -max, max), Type, (float) (0.699999988079071 + (double) Main.rand.NextFloat() * 0.600000023841858)); + Gore.NewGore(vector2 + new Vector2(-16f, (float) (index1 * 16)), Utils.RandomVector2(Main.rand, -max, max), Type, (float) (0.699999988079071 + (double) Main.rand.NextFloat() * 0.600000023841858)); + Gore.NewGore(vector2 + new Vector2(0.0f, (float) (index1 * 16)), Utils.RandomVector2(Main.rand, -max, max), Type, (float) (0.699999988079071 + (double) Main.rand.NextFloat() * 0.600000023841858)); + Gore.NewGore(vector2 + new Vector2(16f, (float) (index1 * 16)), Utils.RandomVector2(Main.rand, -max, max), Type, (float) (0.699999988079071 + (double) Main.rand.NextFloat() * 0.600000023841858)); if (index1 == -height + 1) { - int num2 = 20; - if (hitTree) - num2 = 5; - for (int index3 = 0; index3 < num2; ++index3) - Gore.NewGore(vector2_1 + new Vector2(0.0f, (float) (index1 * 16 - 40)) + Utils.RandomVector2(Main.rand, -40f, 40f) - vector2_2, Utils.RandomVector2(Main.rand, -10f, 10f), Type, (float) (0.699999988079071 + (double) Main.rand.NextFloat() * 0.600000023841858)); + for (int index3 = 0; index3 < 20; ++index3) + Gore.NewGore(vector2 + new Vector2(0.0f, (float) (index1 * 16 - 40)) + Utils.RandomVector2(Main.rand, -40f, 40f), Utils.RandomVector2(Main.rand, -10f, 10f), Type, (float) (0.699999988079071 + (double) Main.rand.NextFloat() * 0.600000023841858)); } } } } - public static bool IsTileALeafyTreeTop(int i, int j) - { - Tile tileSafely = Framing.GetTileSafely(i, j); - return tileSafely.active() && TileID.Sets.GetsCheckedForLeaves[(int) tileSafely.type] && (tileSafely.type == (ushort) 323 && tileSafely.frameX >= (short) 88 || tileSafely.frameX == (short) 22 && tileSafely.frameY >= (short) 198 && tileSafely.frameY <= (short) 242); - } - - public static bool IsTileTypeFitForTree(ushort type) - { - if (type <= (ushort) 70) - { - if (type <= (ushort) 23) - { - if (type != (ushort) 2 && type != (ushort) 23) - goto label_8; - } - else if (type != (ushort) 60 && type != (ushort) 70) - goto label_8; - } - else if (type <= (ushort) 147) - { - if (type != (ushort) 109 && type != (ushort) 147) - goto label_8; - } - else if (type != (ushort) 199 && type != (ushort) 477 && type != (ushort) 492) - goto label_8; - return true; -label_8: - return false; - } - public static bool GrowTree(int i, int y) { int index1 = y; while (Main.tile[i, index1].type == (ushort) 20) ++index1; - if ((Main.tile[i - 1, index1 - 1].liquid != (byte) 0 || Main.tile[i, index1 - 1].liquid != (byte) 0 || Main.tile[i + 1, index1 - 1].liquid != (byte) 0) && !WorldGen.notTheBees || !Main.tile[i, index1].nactive() || Main.tile[i, index1].halfBrick() || Main.tile[i, index1].slope() != (byte) 0 || !WorldGen.IsTileTypeFitForTree(Main.tile[i, index1].type) || Main.tile[i, index1 - 1].wall != (ushort) 0 && Main.tile[i, index1 - 1].wall != (ushort) 106 && Main.tile[i, index1 - 1].wall != (ushort) 107 && (Main.tile[i, index1 - 1].wall < (ushort) 138 || Main.tile[i, index1 - 1].wall > (ushort) 141) && Main.tile[i, index1 - 1].wall != (ushort) 145 && Main.tile[i, index1 - 1].wall != (ushort) 150 && Main.tile[i, index1 - 1].wall != (ushort) 152 && Main.tile[i, index1 - 1].wall != (ushort) 80 || (!Main.tile[i - 1, index1].active() || !WorldGen.IsTileTypeFitForTree(Main.tile[i - 1, index1].type)) && (!Main.tile[i + 1, index1].active() || !WorldGen.IsTileTypeFitForTree(Main.tile[i + 1, index1].type))) + if ((Main.tile[i - 1, index1 - 1].liquid != (byte) 0 || Main.tile[i, index1 - 1].liquid != (byte) 0 || Main.tile[i + 1, index1 - 1].liquid != (byte) 0) && Main.tile[i, index1].type != (ushort) 60 || !Main.tile[i, index1].nactive() || Main.tile[i, index1].halfBrick() || Main.tile[i, index1].slope() != (byte) 0 || Main.tile[i, index1].type != (ushort) 2 && Main.tile[i, index1].type != (ushort) 23 && Main.tile[i, index1].type != (ushort) 60 && Main.tile[i, index1].type != (ushort) 109 && Main.tile[i, index1].type != (ushort) 147 && Main.tile[i, index1].type != (ushort) 199 && Main.tile[i, index1].type != (ushort) 70 || Main.tile[i, index1 - 1].wall != (byte) 0 && Main.tile[i, index1 - 1].wall != (byte) 106 && Main.tile[i, index1 - 1].wall != (byte) 107 && (Main.tile[i, index1 - 1].wall < (byte) 138 || Main.tile[i, index1 - 1].wall > (byte) 141) && Main.tile[i, index1 - 1].wall != (byte) 145 && Main.tile[i, index1 - 1].wall != (byte) 150 && Main.tile[i, index1 - 1].wall != (byte) 152 || (!Main.tile[i - 1, index1].active() || Main.tile[i - 1, index1].type != (ushort) 2 && Main.tile[i - 1, index1].type != (ushort) 23 && Main.tile[i - 1, index1].type != (ushort) 60 && Main.tile[i - 1, index1].type != (ushort) 109 && Main.tile[i - 1, index1].type != (ushort) 147 && Main.tile[i - 1, index1].type != (ushort) 199 && Main.tile[i - 1, index1].type != (ushort) 70) && (!Main.tile[i + 1, index1].active() || Main.tile[i + 1, index1].type != (ushort) 2 && Main.tile[i + 1, index1].type != (ushort) 23 && Main.tile[i + 1, index1].type != (ushort) 60 && Main.tile[i + 1, index1].type != (ushort) 109 && Main.tile[i + 1, index1].type != (ushort) 147 && Main.tile[i + 1, index1].type != (ushort) 199 && Main.tile[i + 1, index1].type != (ushort) 70)) return false; - byte color = Main.tile[i, index1].color(); int num1 = 2; - int num2 = WorldGen.genRand.Next(5, 17); - int num3 = num2 + 4; + int num2 = 16; if (Main.tile[i, index1].type == (ushort) 60) - num3 += 5; - bool flag1 = false; - if (Main.tile[i, index1].type == (ushort) 70 && WorldGen.EmptyTileCheck(i - num1, i + num1, index1 - num3, index1 - 3, 20) && WorldGen.EmptyTileCheck(i - 1, i + 1, index1 - 2, index1 - 1, 20)) - flag1 = true; - if (WorldGen.EmptyTileCheck(i - num1, i + num1, index1 - num3, index1 - 1, 20)) - flag1 = true; - if (!flag1) + num2 += 5; + if (!WorldGen.EmptyTileCheck(i - num1, i + num1, index1 - num2, index1 - 1, 20)) return false; + bool flag1 = false; bool flag2 = false; - bool flag3 = false; - for (int index2 = index1 - num2; index2 < index1; ++index2) + int num3 = WorldGen.genRand.Next(5, num2 + 1); + for (int index2 = index1 - num3; index2 < index1; ++index2) { Main.tile[i, index2].frameNumber((byte) WorldGen.genRand.Next(3)); Main.tile[i, index2].active(true); Main.tile[i, index2].type = (ushort) 5; - Main.tile[i, index2].color(color); int num4 = WorldGen.genRand.Next(3); int num5 = WorldGen.genRand.Next(10); - if (index2 == index1 - 1 || index2 == index1 - num2) + if (index2 == index1 - 1 || index2 == index1 - num3) num5 = 0; - while (((num5 == 5 ? 1 : (num5 == 7 ? 1 : 0)) & (flag2 ? 1 : 0)) != 0 || ((num5 == 6 ? 1 : (num5 == 7 ? 1 : 0)) & (flag3 ? 1 : 0)) != 0) + while (((num5 == 5 ? 1 : (num5 == 7 ? 1 : 0)) & (flag1 ? 1 : 0)) != 0 || ((num5 == 6 ? 1 : (num5 == 7 ? 1 : 0)) & (flag2 ? 1 : 0)) != 0) num5 = WorldGen.genRand.Next(10); + flag1 = false; flag2 = false; - flag3 = false; if (num5 == 5 || num5 == 7) - flag2 = true; + flag1 = true; if (num5 == 6 || num5 == 7) - flag3 = true; + flag2 = true; switch (num5) { case 1: @@ -14293,7 +9591,6 @@ label_8: { Main.tile[i - 1, index2].active(true); Main.tile[i - 1, index2].type = (ushort) 5; - Main.tile[i - 1, index2].color(color); int num6 = WorldGen.genRand.Next(3); if (WorldGen.genRand.Next(3) < 2) { @@ -14336,7 +9633,6 @@ label_8: { Main.tile[i + 1, index2].active(true); Main.tile[i + 1, index2].type = (ushort) 5; - Main.tile[i + 1, index2].color(color); int num7 = WorldGen.genRand.Next(3); if (WorldGen.genRand.Next(3) < 2) { @@ -14377,35 +9673,34 @@ label_8: } } int num8 = WorldGen.genRand.Next(3); + bool flag3 = false; bool flag4 = false; - bool flag5 = false; - if (Main.tile[i - 1, index1].nactive() && !Main.tile[i - 1, index1].halfBrick() && Main.tile[i - 1, index1].slope() == (byte) 0 && WorldGen.IsTileTypeFitForTree(Main.tile[i - 1, index1].type)) + if (Main.tile[i - 1, index1].nactive() && !Main.tile[i - 1, index1].halfBrick() && Main.tile[i - 1, index1].slope() == (byte) 0 && (Main.tile[i - 1, index1].type == (ushort) 2 || Main.tile[i - 1, index1].type == (ushort) 23 || Main.tile[i - 1, index1].type == (ushort) 60 || Main.tile[i - 1, index1].type == (ushort) 109 || Main.tile[i - 1, index1].type == (ushort) 147 || Main.tile[i - 1, index1].type == (ushort) 199)) + flag3 = true; + if (Main.tile[i + 1, index1].nactive() && !Main.tile[i + 1, index1].halfBrick() && Main.tile[i + 1, index1].slope() == (byte) 0 && (Main.tile[i + 1, index1].type == (ushort) 2 || Main.tile[i + 1, index1].type == (ushort) 23 || Main.tile[i + 1, index1].type == (ushort) 60 || Main.tile[i + 1, index1].type == (ushort) 109 || Main.tile[i + 1, index1].type == (ushort) 147 || Main.tile[i + 1, index1].type == (ushort) 199)) flag4 = true; - if (Main.tile[i + 1, index1].nactive() && !Main.tile[i + 1, index1].halfBrick() && Main.tile[i + 1, index1].slope() == (byte) 0 && WorldGen.IsTileTypeFitForTree(Main.tile[i + 1, index1].type)) - flag5 = true; - if (!flag4) + if (!flag3) { if (num8 == 0) num8 = 2; if (num8 == 1) num8 = 3; } - if (!flag5) + if (!flag4) { if (num8 == 0) num8 = 1; if (num8 == 2) num8 = 3; } - if (flag4 && !flag5) + if (flag3 && !flag4) num8 = 2; - if (flag5 && !flag4) + if (flag4 && !flag3) num8 = 1; if (num8 == 0 || num8 == 1) { Main.tile[i + 1, index1 - 1].active(true); Main.tile[i + 1, index1 - 1].type = (ushort) 5; - Main.tile[i + 1, index1 - 1].color(color); int num9 = WorldGen.genRand.Next(3); if (num9 == 0) { @@ -14427,7 +9722,6 @@ label_8: { Main.tile[i - 1, index1 - 1].active(true); Main.tile[i - 1, index1 - 1].type = (ushort) 5; - Main.tile[i - 1, index1 - 1].color(color); int num10 = WorldGen.genRand.Next(3); if (num10 == 0) { @@ -14503,23 +9797,23 @@ label_8: } break; } - if (WorldGen.genRand.Next(13) != 0) + if (WorldGen.genRand.Next(8) != 0) { int num12 = WorldGen.genRand.Next(3); if (num12 == 0) { - Main.tile[i, index1 - num2].frameX = (short) 22; - Main.tile[i, index1 - num2].frameY = (short) 198; + Main.tile[i, index1 - num3].frameX = (short) 22; + Main.tile[i, index1 - num3].frameY = (short) 198; } if (num12 == 1) { - Main.tile[i, index1 - num2].frameX = (short) 22; - Main.tile[i, index1 - num2].frameY = (short) 220; + Main.tile[i, index1 - num3].frameX = (short) 22; + Main.tile[i, index1 - num3].frameY = (short) 220; } if (num12 == 2) { - Main.tile[i, index1 - num2].frameX = (short) 22; - Main.tile[i, index1 - num2].frameY = (short) 242; + Main.tile[i, index1 - num3].frameX = (short) 22; + Main.tile[i, index1 - num3].frameY = (short) 242; } } else @@ -14527,554 +9821,23 @@ label_8: int num13 = WorldGen.genRand.Next(3); if (num13 == 0) { - Main.tile[i, index1 - num2].frameX = (short) 0; - Main.tile[i, index1 - num2].frameY = (short) 198; + Main.tile[i, index1 - num3].frameX = (short) 0; + Main.tile[i, index1 - num3].frameY = (short) 198; } if (num13 == 1) { - Main.tile[i, index1 - num2].frameX = (short) 0; - Main.tile[i, index1 - num2].frameY = (short) 220; + Main.tile[i, index1 - num3].frameX = (short) 0; + Main.tile[i, index1 - num3].frameY = (short) 220; } if (num13 == 2) { - Main.tile[i, index1 - num2].frameX = (short) 0; - Main.tile[i, index1 - num2].frameY = (short) 242; + Main.tile[i, index1 - num3].frameX = (short) 0; + Main.tile[i, index1 - num3].frameY = (short) 242; } } - WorldGen.RangeFrame(i - 2, index1 - num2 - 1, i + 2, index1 + 1); + WorldGen.RangeFrame(i - 2, index1 - num3 - 1, i + 2, index1 + 1); if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, i, (int) ((double) index1 - (double) num2 * 0.5), num2 + 1); - return true; - } - - public static bool DefaultTreeWallTest(int wallType) - { - switch (wallType) - { - case 0: - case 80: - case 106: - case 107: - case 138: - case 139: - case 140: - case 141: - case 145: - case 150: - case 152: - case 245: - case 315: - return true; - default: - return false; - } - } - - public static bool GemTreeWallTest(int wallType) - { - if (WorldGen.DefaultTreeWallTest(wallType)) - return true; - switch (wallType) - { - case 2: - case 54: - case 55: - case 56: - case 57: - case 58: - case 59: - case 61: - case 185: - case 196: - case 197: - case 198: - case 199: - case 208: - case 209: - case 210: - case 211: - case 212: - case 213: - case 214: - case 215: - return true; - default: - return false; - } - } - - public static bool GemTreeGroundTest(int tileType) => tileType >= 0 && (TileID.Sets.Conversion.Stone[tileType] || TileID.Sets.Conversion.Moss[tileType]); - - public static bool VanityTreeGroundTest(int tileType) => tileType >= 0 && TileID.Sets.Conversion.Grass[tileType]; - - public static bool TryGrowingTreeByType(int treeTileType, int checkedX, int checkedY) - { - bool flag = false; - switch (treeTileType) - { - case 5: - flag = WorldGen.GrowTree(checkedX, checkedY); - break; - case 583: - flag = WorldGen.GrowTreeWithSettings(checkedX, checkedY, WorldGen.GrowTreeSettings.Profiles.GemTree_Topaz); - break; - case 584: - flag = WorldGen.GrowTreeWithSettings(checkedX, checkedY, WorldGen.GrowTreeSettings.Profiles.GemTree_Amethyst); - break; - case 585: - flag = WorldGen.GrowTreeWithSettings(checkedX, checkedY, WorldGen.GrowTreeSettings.Profiles.GemTree_Sappphire); - break; - case 586: - flag = WorldGen.GrowTreeWithSettings(checkedX, checkedY, WorldGen.GrowTreeSettings.Profiles.GemTree_Emerald); - break; - case 587: - flag = WorldGen.GrowTreeWithSettings(checkedX, checkedY, WorldGen.GrowTreeSettings.Profiles.GemTree_Ruby); - break; - case 588: - flag = WorldGen.GrowTreeWithSettings(checkedX, checkedY, WorldGen.GrowTreeSettings.Profiles.GemTree_Diamond); - break; - case 589: - flag = WorldGen.GrowTreeWithSettings(checkedX, checkedY, WorldGen.GrowTreeSettings.Profiles.GemTree_Amber); - break; - case 596: - flag = WorldGen.GrowTreeWithSettings(checkedX, checkedY, WorldGen.GrowTreeSettings.Profiles.VanityTree_Sakura); - break; - case 616: - flag = WorldGen.GrowTreeWithSettings(checkedX, checkedY, WorldGen.GrowTreeSettings.Profiles.VanityTree_Willow); - break; - } - return flag; - } - - public static bool GrowTreeWithSettings( - int checkedX, - int checkedY, - WorldGen.GrowTreeSettings settings) - { - int index1 = checkedY; - while ((int) Main.tile[checkedX, index1].type == (int) settings.SaplingTileType) - ++index1; - if (Main.tile[checkedX - 1, index1 - 1].liquid != (byte) 0 || Main.tile[checkedX, index1 - 1].liquid != (byte) 0 || Main.tile[checkedX + 1, index1 - 1].liquid != (byte) 0) - return false; - Tile tile1 = Main.tile[checkedX, index1]; - if ((!tile1.nactive() || tile1.halfBrick() ? 0 : (tile1.slope() == (byte) 0 ? 1 : 0)) == 0) - return false; - bool flag1 = settings.WallTest((int) Main.tile[checkedX, index1 - 1].wall); - if (!settings.GroundTest((int) tile1.type) || !flag1 || (!Main.tile[checkedX - 1, index1].active() || !settings.GroundTest((int) Main.tile[checkedX - 1, index1].type) ? (!Main.tile[checkedX + 1, index1].active() ? 0 : (settings.GroundTest((int) Main.tile[checkedX + 1, index1].type) ? 1 : 0)) : 1) == 0) - return false; - byte color = Main.tile[checkedX, index1].color(); - int num1 = 2; - int num2 = WorldGen.genRand.Next(settings.TreeHeightMin, settings.TreeHeightMax + 1); - int num3 = num2 + settings.TreeTopPaddingNeeded; - if (!WorldGen.EmptyTileCheck(checkedX - num1, checkedX + num1, index1 - num3, index1 - 1, 20)) - return false; - bool flag2 = false; - bool flag3 = false; - for (int index2 = index1 - num2; index2 < index1; ++index2) - { - Tile tile2 = Main.tile[checkedX, index2]; - tile2.frameNumber((byte) WorldGen.genRand.Next(3)); - tile2.active(true); - tile2.type = settings.TreeTileType; - tile2.color(color); - int num4 = WorldGen.genRand.Next(3); - int num5 = WorldGen.genRand.Next(10); - if (index2 == index1 - 1 || index2 == index1 - num2) - num5 = 0; - while (((num5 == 5 ? 1 : (num5 == 7 ? 1 : 0)) & (flag2 ? 1 : 0)) != 0 || ((num5 == 6 ? 1 : (num5 == 7 ? 1 : 0)) & (flag3 ? 1 : 0)) != 0) - num5 = WorldGen.genRand.Next(10); - flag2 = false; - flag3 = false; - if (num5 == 5 || num5 == 7) - flag2 = true; - if (num5 == 6 || num5 == 7) - flag3 = true; - switch (num5) - { - case 1: - if (num4 == 0) - { - tile2.frameX = (short) 0; - tile2.frameY = (short) 66; - } - if (num4 == 1) - { - tile2.frameX = (short) 0; - tile2.frameY = (short) 88; - } - if (num4 == 2) - { - tile2.frameX = (short) 0; - tile2.frameY = (short) 110; - break; - } - break; - case 2: - if (num4 == 0) - { - tile2.frameX = (short) 22; - tile2.frameY = (short) 0; - } - if (num4 == 1) - { - tile2.frameX = (short) 22; - tile2.frameY = (short) 22; - } - if (num4 == 2) - { - tile2.frameX = (short) 22; - tile2.frameY = (short) 44; - break; - } - break; - case 3: - if (num4 == 0) - { - tile2.frameX = (short) 44; - tile2.frameY = (short) 66; - } - if (num4 == 1) - { - tile2.frameX = (short) 44; - tile2.frameY = (short) 88; - } - if (num4 == 2) - { - tile2.frameX = (short) 44; - tile2.frameY = (short) 110; - break; - } - break; - case 4: - if (num4 == 0) - { - tile2.frameX = (short) 22; - tile2.frameY = (short) 66; - } - if (num4 == 1) - { - tile2.frameX = (short) 22; - tile2.frameY = (short) 88; - } - if (num4 == 2) - { - tile2.frameX = (short) 22; - tile2.frameY = (short) 110; - break; - } - break; - case 5: - if (num4 == 0) - { - tile2.frameX = (short) 88; - tile2.frameY = (short) 0; - } - if (num4 == 1) - { - tile2.frameX = (short) 88; - tile2.frameY = (short) 22; - } - if (num4 == 2) - { - tile2.frameX = (short) 88; - tile2.frameY = (short) 44; - break; - } - break; - case 6: - if (num4 == 0) - { - tile2.frameX = (short) 66; - tile2.frameY = (short) 66; - } - if (num4 == 1) - { - tile2.frameX = (short) 66; - tile2.frameY = (short) 88; - } - if (num4 == 2) - { - tile2.frameX = (short) 66; - tile2.frameY = (short) 110; - break; - } - break; - case 7: - if (num4 == 0) - { - tile2.frameX = (short) 110; - tile2.frameY = (short) 66; - } - if (num4 == 1) - { - tile2.frameX = (short) 110; - tile2.frameY = (short) 88; - } - if (num4 == 2) - { - tile2.frameX = (short) 110; - tile2.frameY = (short) 110; - break; - } - break; - default: - if (num4 == 0) - { - tile2.frameX = (short) 0; - tile2.frameY = (short) 0; - } - if (num4 == 1) - { - tile2.frameX = (short) 0; - tile2.frameY = (short) 22; - } - if (num4 == 2) - { - tile2.frameX = (short) 0; - tile2.frameY = (short) 44; - break; - } - break; - } - if (num5 == 5 || num5 == 7) - { - Tile tile3 = Main.tile[checkedX - 1, index2]; - tile3.active(true); - tile3.type = settings.TreeTileType; - tile3.color(color); - int num6 = WorldGen.genRand.Next(3); - if (WorldGen.genRand.Next(3) < 2) - { - if (num6 == 0) - { - tile3.frameX = (short) 44; - tile3.frameY = (short) 198; - } - if (num6 == 1) - { - tile3.frameX = (short) 44; - tile3.frameY = (short) 220; - } - if (num6 == 2) - { - tile3.frameX = (short) 44; - tile3.frameY = (short) 242; - } - } - else - { - if (num6 == 0) - { - tile3.frameX = (short) 66; - tile3.frameY = (short) 0; - } - if (num6 == 1) - { - tile3.frameX = (short) 66; - tile3.frameY = (short) 22; - } - if (num6 == 2) - { - tile3.frameX = (short) 66; - tile3.frameY = (short) 44; - } - } - } - if (num5 == 6 || num5 == 7) - { - Tile tile4 = Main.tile[checkedX + 1, index2]; - tile4.active(true); - tile4.type = settings.TreeTileType; - tile4.color(color); - int num7 = WorldGen.genRand.Next(3); - if (WorldGen.genRand.Next(3) < 2) - { - if (num7 == 0) - { - tile4.frameX = (short) 66; - tile4.frameY = (short) 198; - } - if (num7 == 1) - { - tile4.frameX = (short) 66; - tile4.frameY = (short) 220; - } - if (num7 == 2) - { - tile4.frameX = (short) 66; - tile4.frameY = (short) 242; - } - } - else - { - if (num7 == 0) - { - tile4.frameX = (short) 88; - tile4.frameY = (short) 66; - } - if (num7 == 1) - { - tile4.frameX = (short) 88; - tile4.frameY = (short) 88; - } - if (num7 == 2) - { - tile4.frameX = (short) 88; - tile4.frameY = (short) 110; - } - } - } - } - bool flag4 = false; - bool flag5 = false; - if (Main.tile[checkedX - 1, index1].nactive() && !Main.tile[checkedX - 1, index1].halfBrick() && Main.tile[checkedX - 1, index1].slope() == (byte) 0 && WorldGen.IsTileTypeFitForTree(Main.tile[checkedX - 1, index1].type)) - flag4 = true; - if (Main.tile[checkedX + 1, index1].nactive() && !Main.tile[checkedX + 1, index1].halfBrick() && Main.tile[checkedX + 1, index1].slope() == (byte) 0 && WorldGen.IsTileTypeFitForTree(Main.tile[checkedX + 1, index1].type)) - flag5 = true; - if (WorldGen.genRand.Next(3) == 0) - flag4 = false; - if (WorldGen.genRand.Next(3) == 0) - flag5 = false; - if (flag5) - { - Main.tile[checkedX + 1, index1 - 1].active(true); - Main.tile[checkedX + 1, index1 - 1].type = settings.TreeTileType; - Main.tile[checkedX + 1, index1 - 1].color(color); - int num8 = WorldGen.genRand.Next(3); - if (num8 == 0) - { - Main.tile[checkedX + 1, index1 - 1].frameX = (short) 22; - Main.tile[checkedX + 1, index1 - 1].frameY = (short) 132; - } - if (num8 == 1) - { - Main.tile[checkedX + 1, index1 - 1].frameX = (short) 22; - Main.tile[checkedX + 1, index1 - 1].frameY = (short) 154; - } - if (num8 == 2) - { - Main.tile[checkedX + 1, index1 - 1].frameX = (short) 22; - Main.tile[checkedX + 1, index1 - 1].frameY = (short) 176; - } - } - if (flag4) - { - Main.tile[checkedX - 1, index1 - 1].active(true); - Main.tile[checkedX - 1, index1 - 1].type = settings.TreeTileType; - Main.tile[checkedX - 1, index1 - 1].color(color); - int num9 = WorldGen.genRand.Next(3); - if (num9 == 0) - { - Main.tile[checkedX - 1, index1 - 1].frameX = (short) 44; - Main.tile[checkedX - 1, index1 - 1].frameY = (short) 132; - } - if (num9 == 1) - { - Main.tile[checkedX - 1, index1 - 1].frameX = (short) 44; - Main.tile[checkedX - 1, index1 - 1].frameY = (short) 154; - } - if (num9 == 2) - { - Main.tile[checkedX - 1, index1 - 1].frameX = (short) 44; - Main.tile[checkedX - 1, index1 - 1].frameY = (short) 176; - } - } - int num10 = WorldGen.genRand.Next(3); - if (flag4 & flag5) - { - if (num10 == 0) - { - Main.tile[checkedX, index1 - 1].frameX = (short) 88; - Main.tile[checkedX, index1 - 1].frameY = (short) 132; - } - if (num10 == 1) - { - Main.tile[checkedX, index1 - 1].frameX = (short) 88; - Main.tile[checkedX, index1 - 1].frameY = (short) 154; - } - if (num10 == 2) - { - Main.tile[checkedX, index1 - 1].frameX = (short) 88; - Main.tile[checkedX, index1 - 1].frameY = (short) 176; - } - } - else if (flag4) - { - if (num10 == 0) - { - Main.tile[checkedX, index1 - 1].frameX = (short) 0; - Main.tile[checkedX, index1 - 1].frameY = (short) 132; - } - if (num10 == 1) - { - Main.tile[checkedX, index1 - 1].frameX = (short) 0; - Main.tile[checkedX, index1 - 1].frameY = (short) 154; - } - if (num10 == 2) - { - Main.tile[checkedX, index1 - 1].frameX = (short) 0; - Main.tile[checkedX, index1 - 1].frameY = (short) 176; - } - } - else if (flag5) - { - if (num10 == 0) - { - Main.tile[checkedX, index1 - 1].frameX = (short) 66; - Main.tile[checkedX, index1 - 1].frameY = (short) 132; - } - if (num10 == 1) - { - Main.tile[checkedX, index1 - 1].frameX = (short) 66; - Main.tile[checkedX, index1 - 1].frameY = (short) 154; - } - if (num10 == 2) - { - Main.tile[checkedX, index1 - 1].frameX = (short) 66; - Main.tile[checkedX, index1 - 1].frameY = (short) 176; - } - } - if (WorldGen.genRand.Next(13) != 0) - { - int num11 = WorldGen.genRand.Next(3); - if (num11 == 0) - { - Main.tile[checkedX, index1 - num2].frameX = (short) 22; - Main.tile[checkedX, index1 - num2].frameY = (short) 198; - } - if (num11 == 1) - { - Main.tile[checkedX, index1 - num2].frameX = (short) 22; - Main.tile[checkedX, index1 - num2].frameY = (short) 220; - } - if (num11 == 2) - { - Main.tile[checkedX, index1 - num2].frameX = (short) 22; - Main.tile[checkedX, index1 - num2].frameY = (short) 242; - } - } - else - { - int num12 = WorldGen.genRand.Next(3); - if (num12 == 0) - { - Main.tile[checkedX, index1 - num2].frameX = (short) 0; - Main.tile[checkedX, index1 - num2].frameY = (short) 198; - } - if (num12 == 1) - { - Main.tile[checkedX, index1 - num2].frameX = (short) 0; - Main.tile[checkedX, index1 - num2].frameY = (short) 220; - } - if (num12 == 2) - { - Main.tile[checkedX, index1 - num2].frameX = (short) 0; - Main.tile[checkedX, index1 - num2].frameY = (short) 242; - } - } - WorldGen.RangeFrame(checkedX - 2, index1 - num2 - 1, checkedX + 2, index1 + 1); - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, checkedX, (int) ((double) index1 - (double) num2 * 0.5), num2 + 1); + NetMessage.SendTileSquare(-1, i, (int) ((double) index1 - (double) num3 * 0.5), num3 + 1); return true; } @@ -15505,7 +10268,7 @@ label_8: } } WorldGen.RangeFrame(i - 2, index1 - num2 - 1, i + 2, index1 + 1); - if (Main.netMode != 2 || WorldGen.gen) + if (Main.netMode != 2) return; NetMessage.SendTileSquare(-1, i, (int) ((double) index1 - (double) num2 * 0.5), num2 + 1); } @@ -15513,14 +10276,7 @@ label_8: public static bool GrowShroom(int i, int y) { int index1 = y; - if (Main.tile[i - 1, index1 - 1].lava() || Main.tile[i - 1, index1 - 1].lava() || Main.tile[i + 1, index1 - 1].lava() || !Main.tile[i, index1].nactive() || Main.tile[i, index1].type != (ushort) 70 || Main.tile[i, index1 - 1].wall != (ushort) 0 || !Main.tile[i - 1, index1].active() || Main.tile[i - 1, index1].type != (ushort) 70 || !Main.tile[i + 1, index1].active() || Main.tile[i + 1, index1].type != (ushort) 70 || !WorldGen.EmptyTileCheck(i - 2, i + 2, index1 - 13, index1 - 3, 71) || !WorldGen.EmptyTileCheck(i - 1, i + 1, index1 - 3, index1 - 1, 71)) - return false; - if (WorldGen.gen && WorldGen.genRand.Next(3) != 0) - { - Main.tile[i, index1].halfBrick(false); - Main.tile[i, index1].slope((byte) 0); - } - if (Main.tile[i, index1].halfBrick() || Main.tile[i, index1].slope() != (byte) 0) + if (Main.tile[i - 1, index1 - 1].lava() || Main.tile[i - 1, index1 - 1].lava() || Main.tile[i + 1, index1 - 1].lava() || !Main.tile[i, index1].nactive() || Main.tile[i, index1].halfBrick() || Main.tile[i, index1].slope() != (byte) 0 || Main.tile[i, index1].type != (ushort) 70 || Main.tile[i, index1 - 1].wall != (byte) 0 || !Main.tile[i - 1, index1].active() || Main.tile[i - 1, index1].type != (ushort) 70 || !Main.tile[i + 1, index1].active() || Main.tile[i + 1, index1].type != (ushort) 70 || !WorldGen.EmptyTileCheck(i - 2, i + 2, index1 - 13, index1 - 1, 71)) return false; int num1 = WorldGen.genRand.Next(4, 11); for (int index2 = index1 - num1; index2 < index1; ++index2) @@ -15569,36 +10325,18 @@ label_8: public static void AddTrees() { - float num1 = (float) (0.100000001490116 + (double) WorldGen.genRand.NextFloat() * 0.349999994039536); - float num2 = (float) (0.100000001490116 + (double) WorldGen.genRand.NextFloat() * 0.349999994039536); - for (int index1 = 1; index1 < Main.maxTilesX - 1; ++index1) + for (int i = 1; i < Main.maxTilesX - 1; ++i) { - for (int index2 = 20; (double) index2 < Main.worldSurface; ++index2) + for (int y = 20; (double) y < Main.worldSurface; ++y) { - if (index1 < 380) - { - if ((double) WorldGen.genRand.NextFloat() < (double) num1 && Main.tile[index1, index2].liquid == (byte) 0) - WorldGen.GrowPalmTree(index1, index2); - } - else if (index1 > Main.maxTilesX - 380 && (double) WorldGen.genRand.NextFloat() < (double) num2 && Main.tile[index1, index2].liquid == (byte) 0) - WorldGen.GrowPalmTree(index1, index2); - int maxValue = 20; - if (WorldGen.drunkWorldGen) - maxValue /= 3; - if (Main.tile[index1, index2].type == (ushort) 2 && WorldGen.genRand.Next(maxValue) == 0) - { - if (WorldGen.genRand.Next(2) == 0) - WorldGen.GrowTreeWithSettings(index1, index2, WorldGen.GrowTreeSettings.Profiles.VanityTree_Willow); - else - WorldGen.GrowTreeWithSettings(index1, index2, WorldGen.GrowTreeSettings.Profiles.VanityTree_Sakura); - } - else - WorldGen.GrowTree(index1, index2); + WorldGen.GrowTree(i, y); + if ((i < 380 || i > Main.maxTilesX - 380) && WorldGen.genRand.Next(3) == 0) + WorldGen.GrowPalmTree(i, y); } if (WorldGen.genRand.Next(3) == 0) - ++index1; + ++i; if (WorldGen.genRand.Next(4) == 0) - ++index1; + ++i; } } @@ -15614,10 +10352,6 @@ label_8: { if (startX < 0 || endX >= Main.maxTilesX || startY < 0 || endY >= Main.maxTilesY) return false; - bool flag = false; - if (ignoreID != -1 && TileID.Sets.CommonSapling[ignoreID]) - flag = true; -label_20: for (int index1 = startX; index1 < endX + 1; ++index1) { for (int index2 = startY; index2 < endY + 1; ++index2) @@ -15632,47 +10366,37 @@ label_20: if (Main.tile[index1, index2].type != (ushort) 11) return false; continue; + case 20: + switch (Main.tile[index1, index2].type) + { + case 3: + case 20: + case 24: + case 32: + case 61: + case 62: + case 69: + case 71: + case 73: + case 74: + case 82: + case 83: + case 84: + case 110: + case 113: + case 201: + case 233: + case 352: + continue; + default: + return false; + } case 71: if (Main.tile[index1, index2].type != (ushort) 71) return false; continue; default: - if (flag) - { - if (!TileID.Sets.CommonSapling[(int) Main.tile[index1, index2].type]) - { - switch (Main.tile[index1, index2].type) - { - case 3: - case 24: - case 32: - case 61: - case 62: - case 69: - case 71: - case 73: - case 74: - case 82: - case 83: - case 84: - case 110: - case 113: - case 201: - case 233: - case 352: - case 485: - case 529: - case 530: - continue; - default: - return false; - } - } - else - goto label_20; - } - else - continue; + continue; } } } @@ -15685,6 +10409,7 @@ label_20: if (Main.netMode == 1 || Main.hardMode) return; Main.hardMode = true; + Main.InitLifeBytes(); ThreadPool.QueueUserWorkItem(new WaitCallback(WorldGen.smCallBack), (object) 1); } @@ -15730,48 +10455,47 @@ label_20: Point point = WorldGen.RandomWorldPoint((int) Main.worldSurface - 100, 1, 190, 1); Tile tile1 = Main.tile[point.X, point.Y]; Tile tile2 = Main.tile[point.X, point.Y - 1]; - ushort type = 0; + byte type = 0; if (TileID.Sets.Crimson[(int) tile1.type]) - type = (ushort) (192 + WorldGen.genRand.Next(4)); + type = (byte) (192 + WorldGen.genRand.Next(4)); else if (TileID.Sets.Corrupt[(int) tile1.type]) - type = (ushort) (188 + WorldGen.genRand.Next(4)); + type = (byte) (188 + WorldGen.genRand.Next(4)); else if (TileID.Sets.Hallow[(int) tile1.type]) - type = (ushort) (200 + WorldGen.genRand.Next(4)); - if (tile1.active() && type != (ushort) 0 && !tile2.active()) + type = (byte) (200 + WorldGen.genRand.Next(4)); + if (tile1.active() && type != (byte) 0 && !tile2.active()) { - bool flag = WorldUtils.Gen(new Point(point.X, point.Y - 1), (GenShape) new ShapeFloodFill(1000), Actions.Chain((GenAction) new Modifiers.IsNotSolid(), (GenAction) new Modifiers.OnlyWalls(new ushort[31] + bool flag = WorldUtils.Gen(new Point(point.X, point.Y - 1), (GenShape) new ShapeFloodFill(1000), Actions.Chain((GenAction) new Modifiers.IsNotSolid(), (GenAction) new Modifiers.OnlyWalls(new byte[30] { - (ushort) 0, - (ushort) 54, - (ushort) 55, - (ushort) 56, - (ushort) 57, - (ushort) 58, - (ushort) 59, - (ushort) 61, - (ushort) 185, - (ushort) 212, - (ushort) 213, - (ushort) 214, - (ushort) 215, - (ushort) 2, - (ushort) 196, - (ushort) 197, - (ushort) 198, - (ushort) 199, - (ushort) 15, - (ushort) 40, - (ushort) 71, - (ushort) 64, - (ushort) 204, - (ushort) 205, - (ushort) 206, - (ushort) 207, - (ushort) 208, - (ushort) 209, - (ushort) 210, - (ushort) 211, - (ushort) 71 + (byte) 0, + (byte) 54, + (byte) 55, + (byte) 56, + (byte) 57, + (byte) 58, + (byte) 59, + (byte) 61, + (byte) 185, + (byte) 212, + (byte) 213, + (byte) 214, + (byte) 215, + (byte) 196, + (byte) 197, + (byte) 198, + (byte) 199, + (byte) 15, + (byte) 40, + (byte) 71, + (byte) 64, + (byte) 204, + (byte) 205, + (byte) 206, + (byte) 207, + (byte) 208, + (byte) 209, + (byte) 210, + (byte) 211, + (byte) 71 }), new Actions.Blank().Output(data))); if (data.Count > 50 & flag) { @@ -15787,7 +10511,7 @@ label_20: Main.NewText(Lang.misc[15].Value, (byte) 50, B: (byte) 130); break; case 2: - ChatHelper.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[15].Key), new Color(50, (int) byte.MaxValue, 130)); + NetMessage.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[15].Key), new Color(50, (int) byte.MaxValue, 130)); break; } AchievementsHelper.NotifyProgressionEvent(9); @@ -15798,26 +10522,23 @@ label_20: public static bool PlaceDoor(int i, int j, int type, int style = 0) { - int num1 = style / 36; - int num2 = style % 36; - int num3 = 54 * num1; - int num4 = 54 * num2; + int num = 54 * style; try { if (!Main.tile[i, j - 2].nactive() || !Main.tileSolid[(int) Main.tile[i, j - 2].type] || !WorldGen.SolidTile(i, j + 2)) return false; Main.tile[i, j - 1].active(true); Main.tile[i, j - 1].type = (ushort) 10; - Main.tile[i, j - 1].frameY = (short) num4; - Main.tile[i, j - 1].frameX = (short) (num3 + WorldGen.genRand.Next(3) * 18); + Main.tile[i, j - 1].frameY = (short) num; + Main.tile[i, j - 1].frameX = (short) (WorldGen.genRand.Next(3) * 18); Main.tile[i, j].active(true); Main.tile[i, j].type = (ushort) 10; - Main.tile[i, j].frameY = (short) (num4 + 18); - Main.tile[i, j].frameX = (short) (num3 + WorldGen.genRand.Next(3) * 18); + Main.tile[i, j].frameY = (short) (num + 18); + Main.tile[i, j].frameX = (short) (WorldGen.genRand.Next(3) * 18); Main.tile[i, j + 1].active(true); Main.tile[i, j + 1].type = (ushort) 10; - Main.tile[i, j + 1].frameY = (short) (num4 + 36); - Main.tile[i, j + 1].frameX = (short) (num3 + WorldGen.genRand.Next(3) * 18); + Main.tile[i, j + 1].frameY = (short) (num + 36); + Main.tile[i, j + 1].frameX = (short) (WorldGen.genRand.Next(3) * 18); return true; } catch @@ -15910,7 +10631,7 @@ label_20: for (int j2 = y - 1; j2 <= y + 2; ++j2) WorldGen.TileFrame(i1, j2); } - SoundEngine.PlaySound(9, i * 16, j * 16); + Main.PlaySound(9, i * 16, j * 16); return true; } @@ -15995,49 +10716,44 @@ label_20: public static void AddHellHouses() { - int num1 = (int) ((double) Main.maxTilesX * 0.25); - for (int i = 100; i < Main.maxTilesX - 100; ++i) + int minValue = (int) ((double) Main.maxTilesX * 0.25); + for (int i = minValue; i < Main.maxTilesX - minValue; ++i) { - if ((!WorldGen.drunkWorldGen || i <= num1 || i >= Main.maxTilesX - num1) && (WorldGen.drunkWorldGen || i >= num1 && i <= Main.maxTilesX - num1)) + int j = Main.maxTilesY - 40; + while (Main.tile[i, j].active() || Main.tile[i, j].liquid > (byte) 0) + --j; + if (Main.tile[i, j + 1].active()) { - int j = Main.maxTilesY - 40; - while (Main.tile[i, j].active() || Main.tile[i, j].liquid > (byte) 0) - --j; - if (Main.tile[i, j + 1].active()) - { - ushort tileType = (ushort) WorldGen.genRand.Next(75, 77); - byte wallType = 13; - if (WorldGen.genRand.Next(5) > 0) - tileType = (ushort) 75; - if (tileType == (ushort) 75) - wallType = (byte) 14; - if (WorldGen.getGoodWorldGen) - tileType = (ushort) 76; - WorldGen.HellFort(i, j, tileType, wallType); - i += WorldGen.genRand.Next(30, 130); - if (WorldGen.genRand.Next(10) == 0) - i += WorldGen.genRand.Next(0, 200); - } + ushort tileType = (ushort) WorldGen.genRand.Next(75, 77); + byte wallType = 13; + if (WorldGen.genRand.Next(5) > 0) + tileType = (ushort) 75; + if (tileType == (ushort) 75) + wallType = (byte) 14; + WorldGen.HellFort(i, j, tileType, wallType); + i += WorldGen.genRand.Next(30, 130); + if (WorldGen.genRand.Next(10) == 0) + i += WorldGen.genRand.Next(0, 200); } } - float num2 = (float) (Main.maxTilesX / 4200); - for (int index1 = 0; (double) index1 < 200.0 * (double) num2; ++index1) + float num1 = (float) (Main.maxTilesX / 4200); + for (int index1 = 0; (double) index1 < 200.0 * (double) num1; ++index1) { - int num3 = 0; + int num2 = 0; bool flag1 = false; while (!flag1) { - ++num3; + ++num2; int index2 = WorldGen.genRand.Next((int) ((double) Main.maxTilesX * 0.2), (int) ((double) Main.maxTilesX * 0.8)); int j = WorldGen.genRand.Next(Main.maxTilesY - 300, Main.maxTilesY - 20); if (Main.tile[index2, j].active() && (Main.tile[index2, j].type == (ushort) 75 || Main.tile[index2, j].type == (ushort) 76)) { - int num4 = 0; - if (Main.tile[index2 - 1, j].wall > (ushort) 0) - num4 = -1; - else if (Main.tile[index2 + 1, j].wall > (ushort) 0) - num4 = 1; - if (!Main.tile[index2 + num4, j].active() && !Main.tile[index2 + num4, j + 1].active()) + int num3 = 0; + if (Main.tile[index2 - 1, j].wall > (byte) 0) + num3 = -1; + else if (Main.tile[index2 + 1, j].wall > (byte) 0) + num3 = 1; + if (!Main.tile[index2 + num3, j].active() && !Main.tile[index2 + num3, j + 1].active()) { bool flag2 = false; for (int index3 = index2 - 8; index3 < index2 + 8; ++index3) @@ -16053,32 +10769,23 @@ label_20: } if (!flag2) { - WorldGen.PlaceTile(index2 + num4, j, 4, true, true, style: 7); + WorldGen.PlaceTile(index2 + num3, j, 4, true, true, style: 7); flag1 = true; } } } - if (num3 > 1000) + if (num2 > 1000) flag1 = true; } } - float num5 = 4200000f / (float) Main.maxTilesX; - for (int index5 = 0; (double) index5 < (double) num5; ++index5) + float num4 = 4200000f / (float) Main.maxTilesX; + for (int index5 = 0; (double) index5 < (double) num4; ++index5) { - int num6 = 0; - int i1 = WorldGen.genRand.Next(num1, Main.maxTilesX - num1); - int j = WorldGen.genRand.Next(Main.maxTilesY - 250, Main.maxTilesY - 20); - while (Main.tile[i1, j].wall != (ushort) 13 && Main.tile[i1, j].wall != (ushort) 14 || Main.tile[i1, j].active()) - { - i1 = WorldGen.genRand.Next(num1, Main.maxTilesX - num1); - j = WorldGen.genRand.Next(Main.maxTilesY - 250, Main.maxTilesY - 20); - if (WorldGen.drunkWorldGen) - i1 = WorldGen.genRand.Next(2) != 0 ? WorldGen.genRand.Next(Main.maxTilesX - num1, Main.maxTilesX - 50) : WorldGen.genRand.Next(50, num1); - ++num6; - if (num6 > 100000) - break; - } - if (num6 <= 100000 && (Main.tile[i1, j].wall == (ushort) 13 || Main.tile[i1, j].wall == (ushort) 14) && !Main.tile[i1, j].active()) + int i1 = WorldGen.genRand.Next(minValue, Main.maxTilesX - minValue); + int j; + for (j = WorldGen.genRand.Next(Main.maxTilesY - 250, Main.maxTilesY - 20); Main.tile[i1, j].wall != (byte) 13 && Main.tile[i1, j].wall != (byte) 14 || Main.tile[i1, j].active(); j = WorldGen.genRand.Next(Main.maxTilesY - 250, Main.maxTilesY - 20)) + i1 = WorldGen.genRand.Next(minValue, Main.maxTilesX - minValue); + if ((Main.tile[i1, j].wall == (byte) 13 || Main.tile[i1, j].wall == (byte) 14) && !Main.tile[i1, j].active()) { while (!WorldGen.SolidTile(i1, j) && j < Main.maxTilesY - 20) ++j; @@ -16087,13 +10794,13 @@ label_20: int i3 = i1; while (!Main.tile[i2, index6].active() && WorldGen.SolidTile(i2, index6 + 1)) --i2; - int num7 = i2 + 1; + int num5 = i2 + 1; while (!Main.tile[i3, index6].active() && WorldGen.SolidTile(i3, index6 + 1)) ++i3; - int num8 = i3 - 1; - int num9 = num8 - num7; - int index7 = (num8 + num7) / 2; - if (!Main.tile[index7, index6].active() && (Main.tile[index7, index6].wall == (ushort) 13 || Main.tile[index7, index6].wall == (ushort) 14) && WorldGen.SolidTile(index7, index6 + 1)) + int num6 = i3 - 1; + int num7 = num6 - num5; + int index7 = (num6 + num5) / 2; + if (!Main.tile[index7, index6].active() && (Main.tile[index7, index6].wall == (byte) 13 || Main.tile[index7, index6].wall == (byte) 14) && WorldGen.SolidTile(index7, index6 + 1)) { int style1 = 16; int style2 = 13; @@ -16109,94 +10816,94 @@ label_20: int style12 = 25; int style13 = 23; int style14 = 25; - int num10 = WorldGen.genRand.Next(13); - int num11 = 0; - int num12 = 0; - if (num10 == 0) + int num8 = WorldGen.genRand.Next(13); + int num9 = 0; + int num10 = 0; + if (num8 == 0) { - num11 = 5; - num12 = 4; + num9 = 5; + num10 = 4; } - if (num10 == 1) + if (num8 == 1) { - num11 = 4; - num12 = 3; + num9 = 4; + num10 = 3; } - if (num10 == 2) + if (num8 == 2) { - num11 = 3; - num12 = 5; + num9 = 3; + num10 = 5; } - if (num10 == 3) + if (num8 == 3) { - num11 = 4; - num12 = 6; + num9 = 4; + num10 = 6; } - if (num10 == 4) + if (num8 == 4) { - num11 = 3; - num12 = 3; + num9 = 3; + num10 = 3; } - if (num10 == 5) + if (num8 == 5) { - num11 = 5; - num12 = 3; + num9 = 5; + num10 = 3; } - if (num10 == 6) + if (num8 == 6) { - num11 = 5; - num12 = 4; + num9 = 5; + num10 = 4; } - if (num10 == 7) + if (num8 == 7) { - num11 = 5; - num12 = 4; + num9 = 5; + num10 = 4; } - if (num10 == 8) + if (num8 == 8) { - num11 = 5; - num12 = 4; + num9 = 5; + num10 = 4; } - if (num10 == 9) + if (num8 == 9) { - num11 = 3; - num12 = 5; + num9 = 3; + num10 = 5; } - if (num10 == 10) + if (num8 == 10) { - num11 = 5; - num12 = 3; + num9 = 5; + num10 = 3; } - if (num10 == 11) + if (num8 == 11) { - num11 = 2; - num12 = 4; + num9 = 2; + num10 = 4; } - if (num10 == 12) + if (num8 == 12) { - num11 = 3; - num12 = 3; + num9 = 3; + num10 = 3; } - for (int index8 = index7 - num11; index8 <= index7 + num11; ++index8) + for (int index8 = index7 - num9; index8 <= index7 + num9; ++index8) { - for (int index9 = index6 - num12; index9 <= index6; ++index9) + for (int index9 = index6 - num10; index9 <= index6; ++index9) { if (Main.tile[index8, index9].active()) { - num10 = -1; + num8 = -1; break; } } } - if ((double) num9 < (double) num11 * 1.75) - num10 = -1; - switch (num10) + if ((double) num7 < (double) num9 * 1.75) + num8 = -1; + switch (num8) { case 0: WorldGen.PlaceTile(index7, index6, 14, true, style: style2); - int num13 = WorldGen.genRand.Next(6); - if (num13 < 3) - WorldGen.PlaceTile(index7 + num13, index6 - 2, 33, true, style: style12); + int num11 = WorldGen.genRand.Next(6); + if (num11 < 3) + WorldGen.PlaceTile(index7 + num11, index6 - 2, 33, true, style: style12); if (Main.tile[index7, index6].active()) { if (!Main.tile[index7 - 2, index6].active()) @@ -16218,9 +10925,9 @@ label_20: continue; case 1: WorldGen.PlaceTile(index7, index6, 18, true, style: style3); - int num14 = WorldGen.genRand.Next(4); - if (num14 < 2) - WorldGen.PlaceTile(index7 + num14, index6 - 1, 33, true, style: style12); + int num12 = WorldGen.genRand.Next(4); + if (num12 < 2) + WorldGen.PlaceTile(index7 + num12, index6 - 1, 33, true, style: style12); if (Main.tile[index7, index6].active()) { if (WorldGen.genRand.Next(2) == 0) @@ -16302,78 +11009,66 @@ label_20: } } } - float num15 = 420000f / (float) Main.maxTilesX; - for (int index10 = 0; (double) index10 < (double) num15; ++index10) + float num13 = 420000f / (float) Main.maxTilesX; + for (int index10 = 0; (double) index10 < (double) num13; ++index10) { - int num16 = 0; - int index11 = WorldGen.genRand.Next(num1, Main.maxTilesX - num1); - int index12 = WorldGen.genRand.Next(Main.maxTilesY - 250, Main.maxTilesY - 20); - while (Main.tile[index11, index12].wall != (ushort) 13 && Main.tile[index11, index12].wall != (ushort) 14 || Main.tile[index11, index12].active()) + int index11 = WorldGen.genRand.Next(minValue, Main.maxTilesX - minValue); + int index12; + for (index12 = WorldGen.genRand.Next(Main.maxTilesY - 250, Main.maxTilesY - 20); Main.tile[index11, index12].wall != (byte) 13 && Main.tile[index11, index12].wall != (byte) 14 || Main.tile[index11, index12].active(); index12 = WorldGen.genRand.Next(Main.maxTilesY - 250, Main.maxTilesY - 20)) + index11 = WorldGen.genRand.Next(minValue, Main.maxTilesX - minValue); + for (int index13 = 0; index13 < 2; ++index13) { - index11 = WorldGen.genRand.Next(num1, Main.maxTilesX - num1); - index12 = WorldGen.genRand.Next(Main.maxTilesY - 250, Main.maxTilesY - 20); - if (WorldGen.drunkWorldGen) - index11 = WorldGen.genRand.Next(2) != 0 ? WorldGen.genRand.Next(Main.maxTilesX - num1, Main.maxTilesX - 50) : WorldGen.genRand.Next(50, num1); - ++num16; - if (num16 > 100000) - break; + int index14 = index11; + int index15 = index11; + while (!Main.tile[index14, index12].active() && (Main.tile[index14, index12].wall == (byte) 13 || Main.tile[index14, index12].wall == (byte) 14)) + --index14; + int num14 = index14 + 1; + while (!Main.tile[index15, index12].active() && (Main.tile[index15, index12].wall == (byte) 13 || Main.tile[index15, index12].wall == (byte) 14)) + ++index15; + int num15 = index15 - 1; + index11 = (num14 + num15) / 2; + int index16 = index12; + int index17 = index12; + while (!Main.tile[index11, index16].active() && (Main.tile[index11, index16].wall == (byte) 13 || Main.tile[index11, index16].wall == (byte) 14)) + --index16; + int num16 = index16 + 1; + while (!Main.tile[index11, index17].active() && (Main.tile[index11, index17].wall == (byte) 13 || Main.tile[index11, index17].wall == (byte) 14)) + ++index17; + int num17 = index17 - 1; + index12 = (num16 + num17) / 2; } - if (num16 <= 100000) + int index18 = index11; + int index19 = index11; + while (!Main.tile[index18, index12].active() && !Main.tile[index18, index12 - 1].active() && !Main.tile[index18, index12 + 1].active()) + --index18; + int num18 = index18 + 1; + while (!Main.tile[index19, index12].active() && !Main.tile[index19, index12 - 1].active() && !Main.tile[index19, index12 + 1].active()) + ++index19; + int num19 = index19 - 1; + int index20 = index12; + int index21 = index12; + while (!Main.tile[index11, index20].active() && !Main.tile[index11 - 1, index20].active() && !Main.tile[index11 + 1, index20].active()) + --index20; + int num20 = index20 + 1; + while (!Main.tile[index11, index21].active() && !Main.tile[index11 - 1, index21].active() && !Main.tile[index11 + 1, index21].active()) + ++index21; + int num21 = index21 - 1; + int num22 = (num18 + num19) / 2; + int num23 = (num20 + num21) / 2; + int num24 = num19 - num18; + int num25 = num21 - num20; + if (num24 > 7 && num25 > 5) { - for (int index13 = 0; index13 < 2; ++index13) + int num26 = 0; + if (WorldGen.nearPicture2(num22, num23)) + num26 = -1; + if (num26 == 0) { - int index14 = index11; - int index15 = index11; - while (!Main.tile[index14, index12].active() && (Main.tile[index14, index12].wall == (ushort) 13 || Main.tile[index14, index12].wall == (ushort) 14)) - --index14; - int num17 = index14 + 1; - while (!Main.tile[index15, index12].active() && (Main.tile[index15, index12].wall == (ushort) 13 || Main.tile[index15, index12].wall == (ushort) 14)) - ++index15; - int num18 = index15 - 1; - index11 = (num17 + num18) / 2; - int index16 = index12; - int index17 = index12; - while (!Main.tile[index11, index16].active() && (Main.tile[index11, index16].wall == (ushort) 13 || Main.tile[index11, index16].wall == (ushort) 14)) - --index16; - int num19 = index16 + 1; - while (!Main.tile[index11, index17].active() && (Main.tile[index11, index17].wall == (ushort) 13 || Main.tile[index11, index17].wall == (ushort) 14)) - ++index17; - int num20 = index17 - 1; - index12 = (num19 + num20) / 2; - } - int index18 = index11; - int index19 = index11; - while (!Main.tile[index18, index12].active() && !Main.tile[index18, index12 - 1].active() && !Main.tile[index18, index12 + 1].active()) - --index18; - int num21 = index18 + 1; - while (!Main.tile[index19, index12].active() && !Main.tile[index19, index12 - 1].active() && !Main.tile[index19, index12 + 1].active()) - ++index19; - int num22 = index19 - 1; - int index20 = index12; - int index21 = index12; - while (!Main.tile[index11, index20].active() && !Main.tile[index11 - 1, index20].active() && !Main.tile[index11 + 1, index20].active()) - --index20; - int num23 = index20 + 1; - while (!Main.tile[index11, index21].active() && !Main.tile[index11 - 1, index21].active() && !Main.tile[index11 + 1, index21].active()) - ++index21; - int num24 = index21 - 1; - int num25 = (num21 + num22) / 2; - int num26 = (num23 + num24) / 2; - int num27 = num22 - num21; - int num28 = num24 - num23; - if (num27 > 7 && num28 > 5) - { - int num29 = 0; - if (WorldGen.nearPicture2(num25, num26)) - num29 = -1; - if (num29 == 0) - { - Vector2 vector2 = WorldGen.randHellPicture(); - int x = (int) vector2.X; - int y = (int) vector2.Y; - if (!WorldGen.nearPicture(num25, num26)) - WorldGen.PlaceTile(num25, num26, x, true, style: y); - } + Vector2 vector2 = WorldGen.randHellPicture(); + int x = (int) vector2.X; + int y = (int) vector2.Y; + if (!WorldGen.nearPicture(num22, num23)) + WorldGen.PlaceTile(num22, num23, x, true, style: y); } } } @@ -16387,89 +11082,82 @@ label_20: numArray[1] = WorldGen.genRand.Next(16, 22); while (numArray[2] == numArray[0] || numArray[2] == numArray[1]) numArray[2] = WorldGen.genRand.Next(16, 22); - float num30 = 420000f / (float) Main.maxTilesX; - for (int index22 = 0; (double) index22 < (double) num30; ++index22) + float num27 = 420000f / (float) Main.maxTilesX; + for (int index22 = 0; (double) index22 < (double) num27; ++index22) { - int num31 = 0; int i; int j1; do { - i = WorldGen.genRand.Next(num1, Main.maxTilesX - num1); + i = WorldGen.genRand.Next(minValue, Main.maxTilesX - minValue); j1 = WorldGen.genRand.Next(Main.maxTilesY - 250, Main.maxTilesY - 20); - if (WorldGen.drunkWorldGen) - i = WorldGen.genRand.Next(2) != 0 ? WorldGen.genRand.Next(Main.maxTilesX - num1, Main.maxTilesX - 50) : WorldGen.genRand.Next(50, num1); - ++num31; } - while (num31 <= 100000 && (Main.tile[i, j1].wall != (ushort) 13 && Main.tile[i, j1].wall != (ushort) 14 || Main.tile[i, j1].active())); - if (num31 <= 100000) + while (Main.tile[i, j1].wall != (byte) 13 && Main.tile[i, j1].wall != (byte) 14 || Main.tile[i, j1].active()); + while (!WorldGen.SolidTile(i, j1) && j1 > 10) + --j1; + int j2 = j1 + 1; + if (Main.tile[i, j2].wall == (byte) 13 || Main.tile[i, j2].wall == (byte) 14) { - while (!WorldGen.SolidTile(i, j1) && j1 > 10) - --j1; - int j2 = j1 + 1; - if (Main.tile[i, j2].wall == (ushort) 13 || Main.tile[i, j2].wall == (ushort) 14) + int num28 = WorldGen.genRand.Next(3); + int style15 = 32; + int style16 = 32; + int num29; + int num30; + switch (num28) { - int num32 = WorldGen.genRand.Next(3); - int style15 = 32; - int style16 = 32; - int num33; - int num34; - switch (num32) + case 1: + num29 = 3; + num30 = 3; + break; + case 2: + num29 = 1; + num30 = 2; + break; + default: + num29 = 1; + num30 = 3; + break; + } + for (int index23 = i - 1; index23 <= i + num29; ++index23) + { + for (int index24 = j2; index24 <= j2 + num30; ++index24) { - case 1: - num33 = 3; - num34 = 3; - break; - case 2: - num33 = 1; - num34 = 2; - break; - default: - num33 = 1; - num34 = 3; - break; - } - for (int index23 = i - 1; index23 <= i + num33; ++index23) - { - for (int index24 = j2; index24 <= j2 + num34; ++index24) + Tile tile = Main.tile[i, j2]; + if (index23 < i || index23 == i + num29) { - Tile tile = Main.tile[i, j2]; - if (index23 < i || index23 == i + num33) + if (tile.active()) { - if (tile.active()) + switch (tile.type) { - switch (tile.type) - { - case 10: - case 11: - case 34: - case 42: - case 91: - num32 = -1; - continue; - default: - continue; - } + case 10: + case 11: + case 34: + case 42: + case 91: + num28 = -1; + continue; + default: + continue; } } - else if (tile.active()) - num32 = -1; } + else if (tile.active()) + num28 = -1; } - switch (num32) - { - case 0: - WorldGen.PlaceTile(i, j2, 91, true, style: numArray[WorldGen.genRand.Next(3)]); - continue; - case 1: - WorldGen.PlaceTile(i, j2, 34, true, style: style15); - continue; - case 2: - WorldGen.PlaceTile(i, j2, 42, true, style: style16); - continue; - default: - continue; - } + } + switch (num28) + { + case 0: + WorldGen.PlaceTile(i, j2, 91, true, style: numArray[WorldGen.genRand.Next(3)]); + continue; + case 1: + WorldGen.PlaceTile(i, j2, 34, true, style: style15); + continue; + case 2: + WorldGen.PlaceTile(i, j2, 42, true, style: style16); + continue; + default: + continue; } } } @@ -16483,11 +11171,6 @@ label_20: int[] numArray4 = new int[10]; int minValue1 = 8; int maxValue1 = 20; - if (WorldGen.drunkWorldGen) - { - minValue1 /= 2; - maxValue1 *= 2; - } numArray1[2] = i - WorldGen.genRand.Next(minValue1 / 2, maxValue1 / 2); numArray2[2] = i + WorldGen.genRand.Next(minValue1 / 2, maxValue1 / 2); numArray1[3] = numArray2[2]; @@ -16519,7 +11202,7 @@ label_20: int num2 = 3; for (int index1 = 0; index1 < 2; ++index1) { - if (WorldGen.genRand.Next(3) == 0 || WorldGen.drunkWorldGen) + if (WorldGen.genRand.Next(3) == 0) { flag1 = true; int index2 = WorldGen.genRand.Next(10); @@ -16528,7 +11211,7 @@ label_20: if (index2 > num2) num2 = index2; int index3 = 1; - if (WorldGen.genRand.Next(2) == 0 || WorldGen.drunkWorldGen) + if (WorldGen.genRand.Next(2) == 0) { flagArray1[0, index2] = true; flagArray1[1, index2] = true; @@ -16542,7 +11225,7 @@ label_20: for (int index4 = WorldGen.genRand.Next(10); index4 > 0 && index2 >= 0 && index2 < 10; index2 += num3) flagArray1[index3, index2] = true; } - if (WorldGen.genRand.Next(3) == 0 || WorldGen.drunkWorldGen) + if (WorldGen.genRand.Next(3) == 0) { flag2 = true; int index5 = WorldGen.genRand.Next(10); @@ -16551,7 +11234,7 @@ label_20: if (index5 > num2) num2 = index5; int index6 = 3; - if (WorldGen.genRand.Next(2) == 0 || WorldGen.drunkWorldGen) + if (WorldGen.genRand.Next(2) == 0) { flagArray1[3, index5] = true; flagArray1[4, index5] = true; @@ -16570,22 +11253,15 @@ label_20: { int index9 = numArray1[index8]; bool flag3 = false; - if (index9 < 10 || index9 > Main.maxTilesX - 10) + for (int index10 = Main.maxTilesY - 200; index10 < Main.maxTilesY; ++index10) { - flag3 = true; - } - else - { - for (int underworldLayer = Main.UnderworldLayer; underworldLayer < Main.maxTilesY; ++underworldLayer) - { - if (Main.tile[index9, underworldLayer].wall > (ushort) 0) - flag3 = true; - } + if (Main.tile[index9, index10].wall > (byte) 0) + flag3 = true; } if (flag3) { - for (int index10 = 0; index10 < 10; ++index10) - flagArray1[index8, index10] = false; + for (int index11 = 0; index11 < 10; ++index11) + flagArray1[index8, index11] = false; } } int num5 = WorldGen.genRand.Next(10); @@ -16608,36 +11284,36 @@ label_20: } for (int index = num1; index <= num2; ++index) flagArray1[2, index] = true; - for (int index11 = 0; index11 < 5; ++index11) + for (int index12 = 0; index12 < 5; ++index12) { - for (int index12 = 0; index12 < 10; ++index12) + for (int index13 = 0; index13 < 10; ++index13) { - if (flagArray1[index11, index12] && (numArray3[index12] < Main.UnderworldLayer || numArray4[index12] > Main.maxTilesY - 20)) - flagArray1[index11, index12] = false; + if (flagArray1[index12, index13] && (numArray3[index13] < Main.maxTilesY - 200 || numArray4[index13] > Main.maxTilesY - 20)) + flagArray1[index12, index13] = false; } } - for (int index13 = 0; index13 < 5; ++index13) + for (int index14 = 0; index14 < 5; ++index14) { - for (int index14 = 0; index14 < 10; ++index14) + for (int index15 = 0; index15 < 10; ++index15) { - if (flagArray1[index13, index14]) + if (flagArray1[index14, index15]) { - for (int index15 = numArray1[index13]; index15 <= numArray2[index13]; ++index15) + for (int index16 = numArray1[index14]; index16 <= numArray2[index14]; ++index16) { - for (int index16 = numArray3[index14]; index16 <= numArray4[index14] && index15 >= 10 && index15 <= Main.maxTilesX - 10; ++index16) + for (int index17 = numArray3[index15]; index17 <= numArray4[index15]; ++index17) { - Main.tile[index15, index16].liquid = (byte) 0; - if (index15 == numArray1[index13] || index15 == numArray2[index13] || index16 == numArray3[index14] || index16 == numArray4[index14]) + Main.tile[index16, index17].liquid = (byte) 0; + if (index16 == numArray1[index14] || index16 == numArray2[index14] || index17 == numArray3[index15] || index17 == numArray4[index15]) { - Main.tile[index15, index16].active(true); - Main.tile[index15, index16].type = tileType; - Main.tile[index15, index16].halfBrick(false); - Main.tile[index15, index16].slope((byte) 0); + Main.tile[index16, index17].active(true); + Main.tile[index16, index17].type = tileType; + Main.tile[index16, index17].halfBrick(false); + Main.tile[index16, index17].slope((byte) 0); } else { - Main.tile[index15, index16].wall = (ushort) wallType; - Main.tile[index15, index16].active(false); + Main.tile[index16, index17].wall = wallType; + Main.tile[index16, index17].active(false); } } } @@ -16646,173 +11322,156 @@ label_20: } int style1 = 19; int style2 = 13; - for (int index17 = 0; index17 < 4; ++index17) + for (int index18 = 0; index18 < 4; ++index18) { bool[] flagArray2 = new bool[10]; bool flag4 = false; - for (int index18 = 0; index18 < 10; ++index18) + for (int index19 = 0; index19 < 10; ++index19) { - if (flagArray1[index17, index18] && flagArray1[index17 + 1, index18]) + if (flagArray1[index18, index19] && flagArray1[index18 + 1, index19]) { - flagArray2[index18] = true; + flagArray2[index19] = true; flag4 = true; } } while (flag4) { - int index19 = WorldGen.genRand.Next(10); - if (flagArray2[index19]) + int index20 = WorldGen.genRand.Next(10); + if (flagArray2[index20]) { flag4 = false; - Main.tile[numArray2[index17], numArray4[index19] - 1].active(false); - Main.tile[numArray2[index17], numArray4[index19] - 2].active(false); - Main.tile[numArray2[index17], numArray4[index19] - 3].active(false); - Main.tile[numArray2[index17], numArray4[index19] - 1].wall = (ushort) wallType; - Main.tile[numArray2[index17], numArray4[index19] - 2].wall = (ushort) wallType; - Main.tile[numArray2[index17], numArray4[index19] - 3].wall = (ushort) wallType; - WorldGen.PlaceTile(numArray2[index17], numArray4[index19] - 1, 10, true, style: style1); + Main.tile[numArray2[index18], numArray4[index20] - 1].active(false); + Main.tile[numArray2[index18], numArray4[index20] - 2].active(false); + Main.tile[numArray2[index18], numArray4[index20] - 3].active(false); + Main.tile[numArray2[index18], numArray4[index20] - 1].wall = wallType; + Main.tile[numArray2[index18], numArray4[index20] - 2].wall = wallType; + Main.tile[numArray2[index18], numArray4[index20] - 3].wall = wallType; + WorldGen.PlaceTile(numArray2[index18], numArray4[index20] - 1, 10, true, style: style1); } } } - for (int index20 = 0; index20 < 5; ++index20) + for (int index21 = 0; index21 < 5; ++index21) { - for (int index21 = 0; index21 < 10; ++index21) + for (int index22 = 0; index22 < 10; ++index22) { - if (flagArray1[index20, index21]) + if (flagArray1[index21, index22]) { - if (index21 > 0 && flagArray1[index20, index21 - 1]) + if (index22 > 0 && flagArray1[index21, index22 - 1]) { - int num9 = WorldGen.genRand.Next(numArray1[index20] + 2, numArray2[index20] - 1); - int num10 = WorldGen.genRand.Next(numArray1[index20] + 2, numArray2[index20] - 1); - int num11 = 0; - while (num10 - num9 < 2 || num10 - num9 > 5) + int num9 = WorldGen.genRand.Next(numArray1[index21] + 2, numArray2[index21] - 1); + int num10; + for (num10 = WorldGen.genRand.Next(numArray1[index21] + 2, numArray2[index21] - 1); num10 - num9 < 2 || num10 - num9 > 5; num10 = WorldGen.genRand.Next(numArray1[index21] + 2, numArray2[index21] - 1)) + num9 = WorldGen.genRand.Next(numArray1[index21] + 2, numArray2[index21] - 1); + for (int i1 = num9; i1 <= num10; ++i1) { - num9 = WorldGen.genRand.Next(numArray1[index20] + 2, numArray2[index20] - 1); - num10 = WorldGen.genRand.Next(numArray1[index20] + 2, numArray2[index20] - 1); - ++num11; - if (num11 > 10000) - break; + Main.tile[i1, numArray3[index22]].active(false); + WorldGen.PlaceTile(i1, numArray3[index22], 19, true, true, style: style2); + Main.tile[i1, numArray3[index22]].wall = wallType; } - if (num11 <= 10000) - { - for (int i1 = num9; i1 <= num10 && i1 >= 20 && i1 <= Main.maxTilesX - 20; ++i1) - { - Main.tile[i1, numArray3[index21]].active(false); - WorldGen.PlaceTile(i1, numArray3[index21], 19, true, true, style: style2); - Main.tile[i1, numArray3[index21]].wall = (ushort) wallType; - } - } - else - break; } - if (index20 < 4 && flagArray1[index20 + 1, index21] && WorldGen.genRand.Next(3) == 0) + if (index21 < 4 && flagArray1[index21 + 1, index22] && WorldGen.genRand.Next(3) == 0) { - Main.tile[numArray2[index20], numArray4[index21] - 1].active(false); - Main.tile[numArray2[index20], numArray4[index21] - 2].active(false); - Main.tile[numArray2[index20], numArray4[index21] - 3].active(false); - Main.tile[numArray2[index20], numArray4[index21] - 1].wall = (ushort) wallType; - Main.tile[numArray2[index20], numArray4[index21] - 2].wall = (ushort) wallType; - Main.tile[numArray2[index20], numArray4[index21] - 3].wall = (ushort) wallType; - WorldGen.PlaceTile(numArray2[index20], numArray4[index21] - 1, 10, true, style: style1); + Main.tile[numArray2[index21], numArray4[index22] - 1].active(false); + Main.tile[numArray2[index21], numArray4[index22] - 2].active(false); + Main.tile[numArray2[index21], numArray4[index22] - 3].active(false); + Main.tile[numArray2[index21], numArray4[index22] - 1].wall = wallType; + Main.tile[numArray2[index21], numArray4[index22] - 2].wall = wallType; + Main.tile[numArray2[index21], numArray4[index22] - 3].wall = wallType; + WorldGen.PlaceTile(numArray2[index21], numArray4[index22] - 1, 10, true, style: style1); } } } } bool flag5 = false; - for (int index22 = 0; index22 < 5; ++index22) + for (int index23 = 0; index23 < 5; ++index23) { bool[] flagArray3 = new bool[10]; - for (int index23 = 0; index23 < 10; ++index23) + for (int index24 = 0; index24 < 10; ++index24) { - if (flagArray1[index22, index23]) + if (flagArray1[index23, index24]) { flag5 = true; - flagArray3[index23] = true; + flagArray3[index24] = true; } } if (flag5) { bool flag6 = false; - for (int index24 = 0; index24 < 10; ++index24) + for (int index25 = 0; index25 < 10; ++index25) { - if (flagArray3[index24]) + if (flagArray3[index25]) { - if (!Main.tile[numArray1[index22] - 1, numArray4[index24] - 1].active() && !Main.tile[numArray1[index22] - 1, numArray4[index24] - 2].active() && !Main.tile[numArray1[index22] - 1, numArray4[index24] - 3].active() && Main.tile[numArray1[index22] - 1, numArray4[index24] - 1].liquid == (byte) 0 && Main.tile[numArray1[index22] - 1, numArray4[index24] - 2].liquid == (byte) 0 && Main.tile[numArray1[index22] - 1, numArray4[index24] - 3].liquid == (byte) 0) + if (!Main.tile[numArray1[index23] - 1, numArray4[index25] - 1].active() && !Main.tile[numArray1[index23] - 1, numArray4[index25] - 2].active() && !Main.tile[numArray1[index23] - 1, numArray4[index25] - 3].active() && Main.tile[numArray1[index23] - 1, numArray4[index25] - 1].liquid == (byte) 0 && Main.tile[numArray1[index23] - 1, numArray4[index25] - 2].liquid == (byte) 0 && Main.tile[numArray1[index23] - 1, numArray4[index25] - 3].liquid == (byte) 0) flag6 = true; else - flagArray3[index24] = false; + flagArray3[index25] = false; } } while (flag6) { - int index25 = WorldGen.genRand.Next(10); - if (flagArray3[index25]) + int index26 = WorldGen.genRand.Next(10); + if (flagArray3[index26]) { flag6 = false; - Main.tile[numArray1[index22], numArray4[index25] - 1].active(false); - Main.tile[numArray1[index22], numArray4[index25] - 2].active(false); - Main.tile[numArray1[index22], numArray4[index25] - 3].active(false); - WorldGen.PlaceTile(numArray1[index22], numArray4[index25] - 1, 10, true, style: style1); + Main.tile[numArray1[index23], numArray4[index26] - 1].active(false); + Main.tile[numArray1[index23], numArray4[index26] - 2].active(false); + Main.tile[numArray1[index23], numArray4[index26] - 3].active(false); + WorldGen.PlaceTile(numArray1[index23], numArray4[index26] - 1, 10, true, style: style1); } } break; } } bool flag7 = false; - for (int index26 = 4; index26 >= 0; --index26) + for (int index27 = 4; index27 >= 0; --index27) { bool[] flagArray4 = new bool[10]; - for (int index27 = 0; index27 < 10; ++index27) + for (int index28 = 0; index28 < 10; ++index28) { - if (flagArray1[index26, index27]) + if (flagArray1[index27, index28]) { flag7 = true; - flagArray4[index27] = true; + flagArray4[index28] = true; } } if (flag7) { bool flag8 = false; - for (int index28 = 0; index28 < 10; ++index28) + for (int index29 = 0; index29 < 10; ++index29) { - if (flagArray4[index28]) + if (flagArray4[index29]) { - if (index26 >= 20 && index26 <= Main.maxTilesX - 20) - { - if (!Main.tile[numArray2[index26] + 1, numArray4[index28] - 1].active() && !Main.tile[numArray2[index26] + 1, numArray4[index28] - 2].active() && !Main.tile[numArray2[index26] + 1, numArray4[index28] - 3].active() && Main.tile[numArray2[index26] + 1, numArray4[index28] - 1].liquid == (byte) 0 && Main.tile[numArray2[index26] + 1, numArray4[index28] - 2].liquid == (byte) 0 && Main.tile[numArray2[index26] + 1, numArray4[index28] - 3].liquid == (byte) 0) - flag8 = true; - else - flagArray4[index28] = false; - } + if (!Main.tile[numArray2[index27] + 1, numArray4[index29] - 1].active() && !Main.tile[numArray2[index27] + 1, numArray4[index29] - 2].active() && !Main.tile[numArray2[index27] + 1, numArray4[index29] - 3].active() && Main.tile[numArray2[index27] + 1, numArray4[index29] - 1].liquid == (byte) 0 && Main.tile[numArray2[index27] + 1, numArray4[index29] - 2].liquid == (byte) 0 && Main.tile[numArray2[index27] + 1, numArray4[index29] - 3].liquid == (byte) 0) + flag8 = true; else - break; + flagArray4[index29] = false; } } while (flag8) { - int index29 = WorldGen.genRand.Next(10); - if (flagArray4[index29]) + int index30 = WorldGen.genRand.Next(10); + if (flagArray4[index30]) { flag8 = false; - Main.tile[numArray2[index26], numArray4[index29] - 1].active(false); - Main.tile[numArray2[index26], numArray4[index29] - 2].active(false); - Main.tile[numArray2[index26], numArray4[index29] - 3].active(false); - WorldGen.PlaceTile(numArray2[index26], numArray4[index29] - 1, 10, true, style: style1); + Main.tile[numArray2[index27], numArray4[index30] - 1].active(false); + Main.tile[numArray2[index27], numArray4[index30] - 2].active(false); + Main.tile[numArray2[index27], numArray4[index30] - 3].active(false); + WorldGen.PlaceTile(numArray2[index27], numArray4[index30] - 1, 10, true, style: style1); } } break; } } bool flag9 = false; - for (int index30 = 0; index30 < 10; ++index30) + for (int index31 = 0; index31 < 10; ++index31) { bool[] flagArray5 = new bool[10]; - for (int index31 = 0; index31 < 5; ++index31) + for (int index32 = 0; index32 < 5; ++index32) { - if (flagArray1[index31, index30]) + if (flagArray1[index32, index31]) { flag9 = true; - flagArray5[index31] = true; + flagArray5[index32] = true; } } if (flag9) @@ -16820,33 +11479,24 @@ label_20: bool flag10 = true; while (flag10) { - int index32 = WorldGen.genRand.Next(5); - if (flagArray5[index32]) + int index33 = WorldGen.genRand.Next(5); + if (flagArray5[index33]) { - int num12 = WorldGen.genRand.Next(numArray1[index32] + 2, numArray2[index32] - 1); - int num13 = WorldGen.genRand.Next(numArray1[index32] + 2, numArray2[index32] - 1); - int num14 = 0; - while (num13 - num12 < 2 || num13 - num12 > 5) + int num11 = WorldGen.genRand.Next(numArray1[index33] + 2, numArray2[index33] - 1); + int num12; + for (num12 = WorldGen.genRand.Next(numArray1[index33] + 2, numArray2[index33] - 1); num12 - num11 < 2 || num12 - num11 > 5; num12 = WorldGen.genRand.Next(numArray1[index33] + 2, numArray2[index33] - 1)) + num11 = WorldGen.genRand.Next(numArray1[index33] + 2, numArray2[index33] - 1); + for (int index34 = num11; index34 <= num12; ++index34) { - num12 = WorldGen.genRand.Next(numArray1[index32] + 2, numArray2[index32] - 1); - num13 = WorldGen.genRand.Next(numArray1[index32] + 2, numArray2[index32] - 1); - ++num14; - if (num14 > 10000) - break; - } - if (num14 > 10000) - break; - for (int index33 = num12; index33 <= num13 && index33 >= 10 && index33 <= Main.maxTilesX - 10; ++index33) - { - if (Main.tile[index33, numArray3[index30] - 1].active() || Main.tile[index33, numArray3[index30] - 1].liquid > (byte) 0) + if (Main.tile[index34, numArray3[index31] - 1].active() || Main.tile[index34, numArray3[index31] - 1].liquid > (byte) 0) flag10 = false; } if (flag10) { - for (int i2 = num12; i2 <= num13 && i2 >= 10 && i2 <= Main.maxTilesX - 10; ++i2) + for (int i2 = num11; i2 <= num12; ++i2) { - Main.tile[i2, numArray3[index30]].active(false); - WorldGen.PlaceTile(i2, numArray3[index30], 19, true, true, style: style2); + Main.tile[i2, numArray3[index31]].active(false); + WorldGen.PlaceTile(i2, numArray3[index31], 19, true, true, style: style2); } } flag10 = false; @@ -16880,7 +11530,7 @@ label_20: for (int index1 = i - width / 2; index1 <= i + width / 2; ++index1) { int index2 = j; - while (index2 < Main.maxTilesY && (Main.tile[index1, index2].active() && (Main.tile[index1, index2].type == (ushort) 76 || Main.tile[index1, index2].type == (ushort) 75) || Main.tile[i, index2].wall == (ushort) 13 || Main.tile[i, index2].wall == (ushort) 14)) + while (index2 < Main.maxTilesY && (Main.tile[index1, index2].active() && (Main.tile[index1, index2].type == (ushort) 76 || Main.tile[index1, index2].type == (ushort) 75) || Main.tile[i, index2].wall == (byte) 13 || Main.tile[i, index2].wall == (byte) 14)) ++index2; int num3 = 6 + WorldGen.genRand.Next(3); while (index2 < Main.maxTilesY && !Main.tile[index1, index2].active()) @@ -16894,11 +11544,11 @@ label_20: } } int index3 = j; - while (index3 < Main.maxTilesY && (Main.tile[i, index3].active() && (Main.tile[i, index3].type == (ushort) 76 || Main.tile[i, index3].type == (ushort) 75) || Main.tile[i, index3].wall == (ushort) 13 || Main.tile[i, index3].wall == (ushort) 14)) + while (index3 < Main.maxTilesY && (Main.tile[i, index3].active() && (Main.tile[i, index3].type == (ushort) 76 || Main.tile[i, index3].type == (ushort) 75) || Main.tile[i, index3].wall == (byte) 13 || Main.tile[i, index3].wall == (byte) 14)) ++index3; int index4 = index3 - 1; int maxValue = index4; - while (Main.tile[i, index4].active() && (Main.tile[i, index4].type == (ushort) 76 || Main.tile[i, index4].type == (ushort) 75) || Main.tile[i, index4].wall == (ushort) 13 || Main.tile[i, index4].wall == (ushort) 14) + while (Main.tile[i, index4].active() && (Main.tile[i, index4].type == (ushort) 76 || Main.tile[i, index4].type == (ushort) 75) || Main.tile[i, index4].wall == (byte) 13 || Main.tile[i, index4].wall == (byte) 14) { --index4; if (Main.tile[i, index4].active() && (Main.tile[i, index4].type == (ushort) 76 || Main.tile[i, index4].type == (ushort) 75)) @@ -16920,10 +11570,10 @@ label_20: } for (int index5 = num4; index5 <= num5; ++index5) { - if (Main.tile[index5, index4 - 1].wall == (ushort) 13) - Main.tile[index5, index4].wall = (ushort) 13; - if (Main.tile[index5, index4 - 1].wall == (ushort) 14) - Main.tile[index5, index4].wall = (ushort) 14; + if (Main.tile[index5, index4 - 1].wall == (byte) 13) + Main.tile[index5, index4].wall = (byte) 13; + if (Main.tile[index5, index4 - 1].wall == (byte) 14) + Main.tile[index5, index4].wall = (byte) 14; Main.tile[index5, index4].type = (ushort) 19; Main.tile[index5, index4].active(true); } @@ -16949,7 +11599,7 @@ label_20: { if (Main.tile[index7, index8].type == (ushort) 76 || Main.tile[index7, index8].type == (ushort) 19) Main.tile[index7, index8].active(false); - Main.tile[index7, index8].wall = (ushort) 0; + Main.tile[index7, index8].wall = (byte) 0; } catch { @@ -16987,7 +11637,7 @@ label_20: try { Main.tile[index3, index4].active(false); - Main.tile[index3, index4].wall = (ushort) wall; + Main.tile[index3, index4].wall = wall; Main.tile[index3, index4].liquid = (byte) 0; Main.tile[index3, index4].lava(false); } @@ -17016,7 +11666,7 @@ label_20: if (num > 1) return; Main.tile[index1, index2].active(false); - Main.tile[index1, index2].wall = (ushort) 87; + Main.tile[index1, index2].wall = (byte) 87; } else { @@ -17052,7 +11702,7 @@ label_20: for (int index2 = y - num2; index2 < y + num2; ++index2) { Main.tile[index1, index2].active(false); - Main.tile[index1, index2].wall = (ushort) 87; + Main.tile[index1, index2].wall = (byte) 87; } } } @@ -17061,14 +11711,14 @@ label_20: public static void outerTempled(int x, int y) { - if (Main.tile[x, y].active() & Main.tile[x, y].type == (ushort) 226 || Main.tile[x, y].wall == (ushort) 87) + if (Main.tile[x, y].active() & Main.tile[x, y].type == (ushort) 226 || Main.tile[x, y].wall == (byte) 87) return; int num = 6; for (int index1 = x - num; index1 <= x + num; ++index1) { for (int index2 = y - num; index2 <= y + num; ++index2) { - if (!Main.tile[index1, index2].active() && Main.tile[index1, index2].wall == (ushort) 87) + if (!Main.tile[index1, index2].active() && Main.tile[index1, index2].wall == (byte) 87) { int index3 = x; int index4 = y; @@ -17085,13 +11735,9 @@ label_20: public static void makeTemple(int x, int y) { - Microsoft.Xna.Framework.Rectangle[] rectangleArray = new Microsoft.Xna.Framework.Rectangle[100]; + Microsoft.Xna.Framework.Rectangle[] rectangleArray = new Microsoft.Xna.Framework.Rectangle[40]; float num1 = (float) (Main.maxTilesX / 4200); int maxValue = WorldGen.genRand.Next((int) ((double) num1 * 10.0), (int) ((double) num1 * 16.0)); - if (WorldGen.drunkWorldGen) - maxValue *= 3; - if (WorldGen.getGoodWorldGen) - maxValue *= 3; int num2 = 1; if (WorldGen.genRand.Next(2) == 0) num2 = -1; @@ -17210,7 +11856,7 @@ label_20: } for (int index9 = 0; index9 < maxValue; ++index9) { - if (true) + if (WorldGen.genRand.Next(1) == 0) { for (int x3 = rectangleArray[index9].X; x3 < rectangleArray[index9].X + rectangleArray[index9].Width; ++x3) { @@ -17268,7 +11914,7 @@ label_20: if (index10 >= num26 && index10 < num27 & index11 >= num28 && index11 <= num29) { Main.tile[index10, index11].active(false); - Main.tile[index10, index11].wall = (ushort) 87; + Main.tile[index10, index11].wall = (byte) 87; } } } @@ -17303,7 +11949,7 @@ label_20: if (index13 >= num26 && index13 < num27 & index12 >= num28 && index12 <= num29) { Main.tile[index13, index12].active(false); - Main.tile[index13, index12].wall = (ushort) 87; + Main.tile[index13, index12].wall = (byte) 87; } } } @@ -17322,11 +11968,6 @@ label_20: { int destX = WorldGen.genRand.Next(rectangle.X, rectangle.X + rectangle.Width); int destY = WorldGen.genRand.Next(rectangle.Y, rectangle.Y + rectangle.Height); - if (index14 == maxValue - 1) - { - destX = rectangle.X + rectangle.Width / 2 + WorldGen.genRand.Next(-10, 10); - destY = rectangle.Y + rectangle.Height / 2 + WorldGen.genRand.Next(-10, 10); - } templePath = WorldGen.templePather(templePath, destX, destY); if ((double) templePath.X == (double) destX && (double) templePath.Y == (double) destY) flag1 = false; @@ -17339,14 +11980,7 @@ label_20: if (rectangleArray[index15].Y >= rectangleArray[index14].Y + rectangleArray[index14].Height) { rectangle.X = rectangleArray[index15].X; - if (index14 == 0) - { - if (num2 > 0) - rectangle.X += (int) ((double) rectangleArray[index15].Width * 0.8); - else - rectangle.X += (int) ((double) rectangleArray[index15].Width * 0.2); - } - else if (rectangleArray[index15].X < rectangleArray[index14].X) + if (rectangleArray[index15].X < rectangleArray[index14].X) rectangle.X += (int) ((double) rectangleArray[index15].Width * 0.2); else rectangle.X += (int) ((double) rectangleArray[index15].Width * 0.8); @@ -17354,7 +11988,7 @@ label_20: } else { - rectangle.X = (rectangleArray[index14].X + rectangleArray[index14].Width / 2 + rectangleArray[index15].X + rectangleArray[index15].Width / 2) / 2; + rectangle.X = (rectangleArray[index14].X + rectangleArray[index14].Width / 2 + (rectangleArray[index15].X + rectangleArray[index15].Width / 2)) / 2; rectangle.Y = (int) ((double) rectangleArray[index15].Y + (double) rectangleArray[index15].Height * 0.8); } int x5 = rectangle.X; @@ -17372,8 +12006,8 @@ label_20: else { int index16 = index14 + 1; - int num32 = (rectangleArray[index14].X + rectangleArray[index14].Width / 2 + rectangleArray[index16].X + rectangleArray[index16].Width / 2) / 2; - int num33 = (rectangleArray[index14].Y + rectangleArray[index14].Height / 2 + rectangleArray[index16].Y + rectangleArray[index16].Height / 2) / 2; + int num32 = (rectangleArray[index14].X + rectangleArray[index14].Width / 2 + (rectangleArray[index16].X + rectangleArray[index16].Width / 2)) / 2; + int num33 = (rectangleArray[index14].Y + rectangleArray[index14].Height / 2 + (rectangleArray[index16].Y + rectangleArray[index16].Height / 2)) / 2; bool flag3 = true; while (flag3) { @@ -17444,12 +12078,12 @@ label_20: flag4 = false; for (int index = (int) vector2.Y - num43; (double) index < (double) vector2.Y + (double) num43; ++index) { - if (Main.tile[x10, index].wall == (ushort) 87 || Main.tile[x10, index].active() && Main.tile[x10, index].type == (ushort) 226) + if (Main.tile[x10, index].wall == (byte) 87 || Main.tile[x10, index].active() && Main.tile[x10, index].type == (ushort) 226) flag4 = true; if (Main.tile[x10, index].active() && Main.tile[x10, index].type == (ushort) 226) { Main.tile[x10, index].active(false); - Main.tile[x10, index].wall = (ushort) 87; + Main.tile[x10, index].wall = (byte) 87; } } } @@ -17459,7 +12093,7 @@ label_20: ++index17; int j1 = index17 - 4; int index18 = j1; - while (Main.tile[i1, index18].active() && Main.tile[i1, index18].type == (ushort) 226 || Main.tile[i1, index18].wall == (ushort) 87) + while (Main.tile[i1, index18].active() && Main.tile[i1, index18].type == (ushort) 226 || Main.tile[i1, index18].wall == (byte) 87) --index18; int num46 = index18 + 2; for (int index19 = i1 - 1; index19 <= i1 + 1; ++index19) @@ -17478,7 +12112,7 @@ label_20: for (int index22 = j1 - 1; index22 < j1 + 3; ++index22) { Main.tile[index21, index22].active(false); - Main.tile[index21, index22].wall = (ushort) 87; + Main.tile[index21, index22].wall = (byte) 87; } } for (int index23 = i1 - 1; index23 <= i1 + 1; ++index23) @@ -17492,15 +12126,12 @@ label_20: Main.tile[index23, index24].halfBrick(false); } } - for (int index25 = i1 - 3; index25 <= i1 + 3; ++index25) + for (int index25 = i1 - 1; index25 <= i1 + 1; ++index25) { - for (int index26 = j1 - 2; index26 < j1 + 3; ++index26) + for (int index26 = j1; index26 < j1 + 3; ++index26) { - if (index26 >= j1 || index25 < num4 - 1 || index25 > num4 + 1) - { - Main.tile[index25, index26].active(false); - Main.tile[index25, index26].wall = (ushort) 87; - } + Main.tile[index25, index26].active(false); + Main.tile[index25, index26].wall = (byte) 87; } } WorldGen.PlaceTile(i1, j1, 10, true, style: 11); @@ -17523,7 +12154,7 @@ label_20: { for (int index30 = index28 - 1; index30 <= index28 + 1; ++index30) { - if ((!Main.tile[index29, index30].active() || Main.tile[index29, index30].type != (ushort) 226) && Main.tile[index29, index30].wall != (ushort) 87) + if ((!Main.tile[index29, index30].active() || Main.tile[index29, index30].type != (ushort) 226) && Main.tile[index29, index30].wall != (byte) 87) { flag5 = false; break; @@ -17531,31 +12162,30 @@ label_20: } } if (flag5) - Main.tile[index27, index28].wall = (ushort) 87; + Main.tile[index27, index28].wall = (byte) 87; } } int num47 = 0; - Microsoft.Xna.Framework.Rectangle rectangle1 = rectangleArray[maxValue - 1]; - int num48 = rectangle1.Width / 2; - int num49 = rectangle1.Height / 2; + Microsoft.Xna.Framework.Rectangle rectangle1; do { ++num47; - int i2 = rectangle1.X + num48 + 15 - WorldGen.genRand.Next(30); - int j2 = rectangle1.Y + num49 + 15 - WorldGen.genRand.Next(30); + rectangle1 = rectangleArray[maxValue - 1]; + int i2 = rectangle1.X + WorldGen.genRand.Next(rectangle1.Width); + int j2 = rectangle1.Y + WorldGen.genRand.Next(rectangle1.Height); WorldGen.PlaceTile(i2, j2, 237); if (Main.tile[i2, j2].type == (ushort) 237) { WorldGen.lAltarX = i2 - (int) Main.tile[i2, j2].frameX / 18; WorldGen.lAltarY = j2 - (int) Main.tile[i2, j2].frameY / 18; - goto label_296; + goto label_278; } } while (num47 < 1000); - int num50 = rectangle1.X + num48; - int num51 = rectangle1.Y + num49; - int index31 = num50 + WorldGen.genRand.Next(-10, 11); - int index32 = num51 + WorldGen.genRand.Next(-10, 11); + int num48 = rectangle1.X + rectangle1.Width / 2; + int num49 = rectangle1.Y + rectangle1.Height / 2; + int index31 = num48 + WorldGen.genRand.Next(-10, 11); + int index32 = num49 + WorldGen.genRand.Next(-10, 11); while (!Main.tile[index31, index32].active()) ++index32; Main.tile[index31 - 1, index32].active(true); @@ -17570,70 +12200,59 @@ label_20: Main.tile[index31 + 1, index32].slope((byte) 0); Main.tile[index31 + 1, index32].halfBrick(false); Main.tile[index31 + 1, index32].type = (ushort) 226; - int num52 = index32 - 2; - int num53 = index31 - 1; + int num50 = index32 - 2; + int num51 = index31 - 1; for (int index33 = -1; index33 <= 3; ++index33) { for (int index34 = -1; index34 <= 1; ++index34) { - x = num53 + index33; - y = num52 + index34; + x = num51 + index33; + y = num50 + index34; Main.tile[x, y].active(false); } } - WorldGen.lAltarX = num53; - WorldGen.lAltarY = num52; + WorldGen.lAltarX = num51; + WorldGen.lAltarY = num50; for (int index35 = 0; index35 <= 2; ++index35) { for (int index36 = 0; index36 <= 1; ++index36) { - x = num53 + index35; - y = num52 + index36; + x = num51 + index35; + y = num50 + index36; Main.tile[x, y].active(true); Main.tile[x, y].type = (ushort) 237; Main.tile[x, y].frameX = (short) (index35 * 18); Main.tile[x, y].frameY = (short) (index36 * 18); } } - for (int index37 = 0; index37 <= 2; ++index37) +label_278: + float num52 = (float) maxValue * 1.1f * (float) (1.0 + (double) WorldGen.genRand.Next(-25, 26) * 0.00999999977648258); + int num53 = 0; + while ((double) num52 > 0.0) { - for (int index38 = 0; index38 <= 1; ++index38) - { - x = num53 + index37; - y = num52 + index38; - WorldGen.SquareTileFrame(x, y); - } - } -label_296: - float num54 = (float) maxValue * 1.1f * (float) (1.0 + (double) WorldGen.genRand.Next(-25, 26) * 0.00999999977648258); - if (WorldGen.drunkWorldGen) - num54 *= 1.5f; - int num55 = 0; - while ((double) num54 > 0.0) - { - ++num55; - int index39 = WorldGen.genRand.Next(maxValue); - int index40 = WorldGen.genRand.Next(rectangleArray[index39].X, rectangleArray[index39].X + rectangleArray[index39].Width); - int index41 = WorldGen.genRand.Next(rectangleArray[index39].Y, rectangleArray[index39].Y + rectangleArray[index39].Height); - if (Main.tile[index40, index41].wall == (ushort) 87 && !Main.tile[index40, index41].active()) + ++num53; + int index37 = WorldGen.genRand.Next(maxValue); + int index38 = WorldGen.genRand.Next(rectangleArray[index37].X, rectangleArray[index37].X + rectangleArray[index37].Width); + int index39 = WorldGen.genRand.Next(rectangleArray[index37].Y, rectangleArray[index37].Y + rectangleArray[index37].Height); + if (Main.tile[index38, index39].wall == (byte) 87 && !Main.tile[index38, index39].active()) { bool flag6 = false; if (WorldGen.genRand.Next(2) == 0) { - int num56 = 1; + int num54 = 1; if (WorldGen.genRand.Next(2) == 0) - num56 = -1; - while (!Main.tile[index40, index41].active()) - index41 += num56; - int num57 = index41 - num56; - int num58 = WorldGen.genRand.Next(2); - int num59 = WorldGen.genRand.Next(3, 10); + num54 = -1; + while (!Main.tile[index38, index39].active()) + index39 += num54; + int num55 = index39 - num54; + int num56 = WorldGen.genRand.Next(2); + int num57 = WorldGen.genRand.Next(3, 10); bool flag7 = true; - for (int index42 = index40 - num59; index42 < index40 + num59; ++index42) + for (int index40 = index38 - num57; index40 < index38 + num57; ++index40) { - for (int index43 = num57 - num59; index43 < num57 + num59; ++index43) + for (int index41 = num55 - num57; index41 < num55 + num57; ++index41) { - if (Main.tile[index42, index43].active() && (Main.tile[index42, index43].type == (ushort) 10 || Main.tile[index42, index43].type == (ushort) 237)) + if (Main.tile[index40, index41].active() && Main.tile[index40, index41].type == (ushort) 10) { flag7 = false; break; @@ -17642,63 +12261,53 @@ label_296: } if (flag7) { - for (int i3 = index40 - num59; i3 < index40 + num59; ++i3) + for (int i3 = index38 - num57; i3 < index38 + num57; ++i3) { - for (int j3 = num57 - num59; j3 < num57 + num59; ++j3) + for (int j3 = num55 - num57; j3 < num55 + num57; ++j3) { - if (WorldGen.SolidTile(i3, j3) && Main.tile[i3, j3].type != (ushort) 232 && !WorldGen.SolidTile(i3, j3 - num56)) + if (WorldGen.SolidTile(i3, j3) && Main.tile[i3, j3].type != (ushort) 232 && !WorldGen.SolidTile(i3, j3 - num54)) { Main.tile[i3, j3].type = (ushort) 232; flag6 = true; - if (num58 == 0) + if (num56 == 0) { Main.tile[i3, j3 - 1].type = (ushort) 232; Main.tile[i3, j3 - 1].active(true); - if (WorldGen.drunkWorldGen) - { - Main.tile[i3, j3 - 2].type = (ushort) 232; - Main.tile[i3, j3 - 2].active(true); - } } else { Main.tile[i3, j3 + 1].type = (ushort) 232; Main.tile[i3, j3 + 1].active(true); - if (WorldGen.drunkWorldGen) - { - Main.tile[i3, j3 + 2].type = (ushort) 232; - Main.tile[i3, j3 + 2].active(true); - } } - ++num58; - if (num58 > 1) - num58 = 0; + ++num56; + if (num56 > 1) + num56 = 0; } } } } if (flag6) { - num55 = 0; - --num54; + num53 = 0; + --num52; } } else { - int num60 = 1; + int num58 = 1; if (WorldGen.genRand.Next(2) == 0) - num60 = -1; - while (!Main.tile[index40, index41].active()) - index40 += num60; - int num61 = index40 - num60; - int num62 = WorldGen.genRand.Next(2); - int num63 = WorldGen.genRand.Next(3, 10); + num58 = -1; + while (!Main.tile[index38, index39].active()) + index38 += num58; + int num59 = index38 - num58; + int num60 = WorldGen.genRand.Next(2); + int num61 = WorldGen.genRand.Next(3, 10); bool flag8 = true; - for (int index44 = num61 - num63; index44 < num61 + num63; ++index44) + for (int index42 = num59 - num61; index42 < num59 + num61; ++index42) { - for (int index45 = index41 - num63; index45 < index41 + num63; ++index45) + for (int index43 = index39 - num61; index43 < index39 + num61; ++index43) { - if (Main.tile[index44, index45].active() && Main.tile[index44, index45].type == (ushort) 10) + if (Main.tile[index42, index43].active() && Main.tile[index42, index43].type == (ushort) 10) { flag8 = false; break; @@ -17707,52 +12316,42 @@ label_296: } if (flag8) { - for (int i4 = num61 - num63; i4 < num61 + num63; ++i4) + for (int i4 = num59 - num61; i4 < num59 + num61; ++i4) { - for (int j4 = index41 - num63; j4 < index41 + num63; ++j4) + for (int j4 = index39 - num61; j4 < index39 + num61; ++j4) { - if (WorldGen.SolidTile(i4, j4) && Main.tile[i4, j4].type != (ushort) 232 && !WorldGen.SolidTile(i4 - num60, j4)) + if (WorldGen.SolidTile(i4, j4) && Main.tile[i4, j4].type != (ushort) 232 && !WorldGen.SolidTile(i4 - num58, j4)) { Main.tile[i4, j4].type = (ushort) 232; flag6 = true; - if (num62 == 0) + if (num60 == 0) { Main.tile[i4 - 1, j4].type = (ushort) 232; Main.tile[i4 - 1, j4].active(true); - if (WorldGen.drunkWorldGen) - { - Main.tile[i4 - 2, j4].type = (ushort) 232; - Main.tile[i4 - 2, j4].active(true); - } } else { Main.tile[i4 + 1, j4].type = (ushort) 232; Main.tile[i4 + 1, j4].active(true); - if (WorldGen.drunkWorldGen) - { - Main.tile[i4 - 2, j4].type = (ushort) 232; - Main.tile[i4 - 2, j4].active(true); - } } - ++num62; - if (num62 > 1) - num62 = 0; + ++num60; + if (num60 > 1) + num60 = 0; } } } } if (flag6) { - num55 = 0; - --num54; + num53 = 0; + --num52; } } } - if (num55 > 1000) + if (num53 > 1000) { - num55 = 0; - --num54; + num53 = 0; + --num52; } } WorldGen.tLeft = num38; @@ -17775,7 +12374,7 @@ label_296: { int x2 = WorldGen.genRand.Next(tLeft, tRight); int y2 = WorldGen.genRand.Next(tTop, tBottom); - if (Main.tile[x2, y2].wall == (ushort) 87 && !Main.tile[x2, y2].active()) + if (Main.tile[x2, y2].wall == (byte) 87 && !Main.tile[x2, y2].active()) { if (WorldGen.mayanTrap(x2, y2)) { @@ -17801,7 +12400,7 @@ label_296: { int i = WorldGen.genRand.Next(tLeft, tRight); int j = WorldGen.genRand.Next(tTop, tBottom); - if (Main.tile[i, j].wall == (ushort) 87 && !Main.tile[i, j].active() && WorldGen.AddBuriedChest(i, j, contain, true, 16)) + if (Main.tile[i, j].wall == (byte) 87 && !Main.tile[i, j].active() && WorldGen.AddBuriedChest(i, j, contain, true, 16)) { --num3; num4 = 0; @@ -17817,7 +12416,7 @@ label_296: ++num6; int index1 = WorldGen.genRand.Next(tLeft, tRight); int index2 = WorldGen.genRand.Next(tTop, tBottom); - if (Main.tile[index1, index2].wall == (ushort) 87 && !Main.tile[index1, index2].active()) + if (Main.tile[index1, index2].wall == (byte) 87 && !Main.tile[index1, index2].active()) { int i = index1; int index3 = index2; @@ -17843,7 +12442,7 @@ label_296: ++num8; int index4 = WorldGen.genRand.Next(tLeft, tRight); int index5 = WorldGen.genRand.Next(tTop, tBottom); - if (Main.tile[index4, index5].wall == (ushort) 87 && !Main.tile[index4, index5].active()) + if (Main.tile[index4, index5].wall == (byte) 87 && !Main.tile[index4, index5].active()) { int i = index4; int index6 = index5; @@ -17906,7 +12505,7 @@ label_296: public static bool nearPicture2(int x, int y) { - if (Main.tile[x, y].wall != (ushort) 7 && Main.tile[x, y].wall != (ushort) 8 && Main.tile[x, y].wall != (ushort) 9) + if (Main.tile[x, y].wall != (byte) 7 && Main.tile[x, y].wall != (byte) 8 && Main.tile[x, y].wall != (byte) 9) { for (int index1 = x - 8; index1 <= x + 8; ++index1) { @@ -17933,36 +12532,27 @@ label_296: public static void MakeDungeon(int x, int y) { - WorldGen.dEnteranceX = 0; - WorldGen.numDRooms = 0; - WorldGen.numDDoors = 0; - WorldGen.numDungeonPlatforms = 0; int num1 = WorldGen.genRand.Next(3); WorldGen.genRand.Next(3); ushort tileType; - int wallType1; + int wallType; switch (num1) { case 0: tileType = (ushort) 41; - wallType1 = 7; - WorldGen.crackedType = (ushort) 481; + wallType = 7; break; case 1: tileType = (ushort) 43; - wallType1 = 8; - WorldGen.crackedType = (ushort) 482; + wallType = 8; break; default: tileType = (ushort) 44; - wallType1 = 9; - WorldGen.crackedType = (ushort) 483; + wallType = 9; break; } - Main.tileSolid[(int) WorldGen.crackedType] = false; - WorldGen.dungeonLake = true; WorldGen.numDDoors = 0; - WorldGen.numDungeonPlatforms = 0; + WorldGen.numDPlats = 0; WorldGen.numDRooms = 0; WorldGen.dungeonX = x; WorldGen.dungeonY = y; @@ -17978,7 +12568,7 @@ label_296: float num3 = num2 + (float) WorldGen.genRand.Next(0, (int) ((double) num2 / 3.0)); float num4 = num3; int num5 = 5; - WorldGen.DungeonRoom(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType1); + WorldGen.DungeonRoom(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType); while ((double) num3 > 0.0) { if (WorldGen.dungeonX < WorldGen.dMinX) @@ -17998,20 +12588,20 @@ label_296: { int dungeonX = WorldGen.dungeonX; int dungeonY = WorldGen.dungeonY; - WorldGen.DungeonHalls(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType1); + WorldGen.DungeonHalls(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType); if (WorldGen.genRand.Next(2) == 0) - WorldGen.DungeonHalls(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType1); - WorldGen.DungeonRoom(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType1); + WorldGen.DungeonHalls(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType); + WorldGen.DungeonRoom(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType); WorldGen.dungeonX = dungeonX; WorldGen.dungeonY = dungeonY; } else - WorldGen.DungeonRoom(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType1); + WorldGen.DungeonRoom(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType); } else - WorldGen.DungeonHalls(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType1); + WorldGen.DungeonHalls(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType); } - WorldGen.DungeonRoom(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType1); + WorldGen.DungeonRoom(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType); int num6 = WorldGen.dRoomX[0]; int num7 = WorldGen.dRoomY[0]; for (int index = 0; index < WorldGen.numDRooms; ++index) @@ -18027,8 +12617,6 @@ label_296: WorldGen.dEnteranceX = num6; WorldGen.dSurface = false; int num8 = 5; - if (WorldGen.drunkWorldGen) - WorldGen.dSurface = true; while (!WorldGen.dSurface) { if (num8 > 0) @@ -18038,39 +12626,24 @@ label_296: num8 = 10; int dungeonX = WorldGen.dungeonX; int dungeonY = WorldGen.dungeonY; - WorldGen.DungeonHalls(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType1, true); - WorldGen.DungeonRoom(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType1); + WorldGen.DungeonHalls(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType, true); + WorldGen.DungeonRoom(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType); WorldGen.dungeonX = dungeonX; WorldGen.dungeonY = dungeonY; } - WorldGen.DungeonStairs(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType1); + WorldGen.DungeonStairs(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType); } - WorldGen.DungeonEnt(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType1); + WorldGen.DungeonEnt(WorldGen.dungeonX, WorldGen.dungeonY, tileType, wallType); Main.statusText = Lang.gen[58].Value + " 65%"; - int num9 = Main.maxTilesX * 2; - int i1; - int j1; - int num10; - int wallType2; - for (int index = 0; index < num9; index = (!WorldGen.DungeonPitTrap(i1, j1, (ushort) num10, wallType2) ? index + 1 : index + 1500) + 1) - { - i1 = WorldGen.genRand.Next(WorldGen.dMinX, WorldGen.dMaxX); - int minValue = WorldGen.dMinY; - if ((double) minValue < Main.worldSurface) - minValue = (int) Main.worldSurface; - j1 = WorldGen.genRand.Next(minValue, WorldGen.dMaxY); - num10 = (int) tileType; - wallType2 = wallType1; - } for (int index1 = 0; index1 < WorldGen.numDRooms; ++index1) { for (int index2 = WorldGen.dRoomL[index1]; index2 <= WorldGen.dRoomR[index1]; ++index2) { if (!Main.tile[index2, WorldGen.dRoomT[index1] - 1].active()) { - WorldGen.dungeonPlatformX[WorldGen.numDungeonPlatforms] = index2; - WorldGen.dungeonPlatformY[WorldGen.numDungeonPlatforms] = WorldGen.dRoomT[index1] - 1; - ++WorldGen.numDungeonPlatforms; + WorldGen.DPlatX[WorldGen.numDPlats] = index2; + WorldGen.DPlatY[WorldGen.numDPlats] = WorldGen.dRoomT[index1] - 1; + ++WorldGen.numDPlats; break; } } @@ -18078,9 +12651,9 @@ label_296: { if (!Main.tile[index3, WorldGen.dRoomB[index1] + 1].active()) { - WorldGen.dungeonPlatformX[WorldGen.numDungeonPlatforms] = index3; - WorldGen.dungeonPlatformY[WorldGen.numDungeonPlatforms] = WorldGen.dRoomB[index1] + 1; - ++WorldGen.numDungeonPlatforms; + WorldGen.DPlatX[WorldGen.numDPlats] = index3; + WorldGen.DPlatY[WorldGen.numDPlats] = WorldGen.dRoomB[index1] + 1; + ++WorldGen.numDPlats; break; } } @@ -18108,132 +12681,111 @@ label_296: } } Main.statusText = Lang.gen[58].Value + " 70%"; + int num9 = 0; + int num10 = 1000; int num11 = 0; - int num12 = 1000; - int num13 = 0; - int num14 = Main.maxTilesX / 100; - if (WorldGen.getGoodWorldGen) - num14 *= 3; - while (num13 < num14) + while (num11 < Main.maxTilesX / 100) { - ++num11; + ++num9; int index6 = WorldGen.genRand.Next(WorldGen.dMinX, WorldGen.dMaxX); int index7 = WorldGen.genRand.Next((int) Main.worldSurface + 25, WorldGen.dMaxY); - if (WorldGen.drunkWorldGen) - index7 = WorldGen.genRand.Next(WorldGen.dungeonY + 25, WorldGen.dMaxY); - int num15 = index6; - if ((int) Main.tile[index6, index7].wall == wallType1 && !Main.tile[index6, index7].active()) + int num12 = index6; + if ((int) Main.tile[index6, index7].wall == wallType && !Main.tile[index6, index7].active()) { - int num16 = 1; + int num13 = 1; if (WorldGen.genRand.Next(2) == 0) - num16 = -1; + num13 = -1; while (!Main.tile[index6, index7].active()) - index7 += num16; - if (Main.tile[index6 - 1, index7].active() && Main.tile[index6 + 1, index7].active() && (int) Main.tile[index6 - 1, index7].type != (int) WorldGen.crackedType && !Main.tile[index6 - 1, index7 - num16].active() && !Main.tile[index6 + 1, index7 - num16].active()) + index7 += num13; + if (Main.tile[index6 - 1, index7].active() && Main.tile[index6 + 1, index7].active() && !Main.tile[index6 - 1, index7 - num13].active() && !Main.tile[index6 + 1, index7 - num13].active()) { - ++num13; - for (int index8 = WorldGen.genRand.Next(5, 13); Main.tile[index6 - 1, index7].active() && (int) Main.tile[index6 - 1, index7].type != (int) WorldGen.crackedType && Main.tile[index6, index7 + num16].active() && Main.tile[index6, index7].active() && !Main.tile[index6, index7 - num16].active() && index8 > 0; --index8) + ++num11; + for (int index8 = WorldGen.genRand.Next(5, 13); Main.tile[index6 - 1, index7].active() && Main.tile[index6, index7 + num13].active() && Main.tile[index6, index7].active() && !Main.tile[index6, index7 - num13].active() && index8 > 0; --index8) { Main.tile[index6, index7].type = (ushort) 48; - if (!Main.tile[index6 - 1, index7 - num16].active() && !Main.tile[index6 + 1, index7 - num16].active()) + if (!Main.tile[index6 - 1, index7 - num13].active() && !Main.tile[index6 + 1, index7 - num13].active()) { - Main.tile[index6, index7 - num16].Clear(TileDataType.Slope); - Main.tile[index6, index7 - num16].type = (ushort) 48; - Main.tile[index6, index7 - num16].active(true); - Main.tile[index6, index7 - num16 * 2].Clear(TileDataType.Slope); - Main.tile[index6, index7 - num16 * 2].type = (ushort) 48; - Main.tile[index6, index7 - num16 * 2].active(true); + Main.tile[index6, index7 - num13].type = (ushort) 48; + Main.tile[index6, index7 - num13].active(true); } --index6; } - int num17 = WorldGen.genRand.Next(5, 13); - for (int index9 = num15 + 1; Main.tile[index9 + 1, index7].active() && (int) Main.tile[index9 + 1, index7].type != (int) WorldGen.crackedType && Main.tile[index9, index7 + num16].active() && Main.tile[index9, index7].active() && !Main.tile[index9, index7 - num16].active() && num17 > 0; --num17) + int num14 = WorldGen.genRand.Next(5, 13); + for (int index9 = num12 + 1; Main.tile[index9 + 1, index7].active() && Main.tile[index9, index7 + num13].active() && Main.tile[index9, index7].active() && !Main.tile[index9, index7 - num13].active() && num14 > 0; --num14) { Main.tile[index9, index7].type = (ushort) 48; - if (!Main.tile[index9 - 1, index7 - num16].active() && !Main.tile[index9 + 1, index7 - num16].active()) + if (!Main.tile[index9 - 1, index7 - num13].active() && !Main.tile[index9 + 1, index7 - num13].active()) { - Main.tile[index9, index7 - num16].Clear(TileDataType.Slope); - Main.tile[index9, index7 - num16].type = (ushort) 48; - Main.tile[index9, index7 - num16].active(true); - Main.tile[index9, index7 - num16 * 2].Clear(TileDataType.Slope); - Main.tile[index9, index7 - num16 * 2].type = (ushort) 48; - Main.tile[index9, index7 - num16 * 2].active(true); + Main.tile[index9, index7 - num13].type = (ushort) 48; + Main.tile[index9, index7 - num13].active(true); } ++index9; } } } - if (num11 > num12) + if (num9 > num10) { - num11 = 0; - ++num13; + num9 = 0; + ++num11; } } - int num18 = 0; - int num19 = 1000; - int num20 = 0; + int num15 = 0; + int num16 = 1000; + int num17 = 0; Main.statusText = Lang.gen[58].Value + " 75%"; - while (num20 < num14) + while (num17 < Main.maxTilesX / 100) { - ++num18; + ++num15; int index10 = WorldGen.genRand.Next(WorldGen.dMinX, WorldGen.dMaxX); int index11 = WorldGen.genRand.Next((int) Main.worldSurface + 25, WorldGen.dMaxY); - int num21 = index11; - if ((int) Main.tile[index10, index11].wall == wallType1 && !Main.tile[index10, index11].active()) + int num18 = index11; + if ((int) Main.tile[index10, index11].wall == wallType && !Main.tile[index10, index11].active()) { - int num22 = 1; + int num19 = 1; if (WorldGen.genRand.Next(2) == 0) - num22 = -1; + num19 = -1; while (index10 > 5 && index10 < Main.maxTilesX - 5 && !Main.tile[index10, index11].active()) - index10 += num22; - if (Main.tile[index10, index11 - 1].active() && Main.tile[index10, index11 + 1].active() && (int) Main.tile[index10, index11 - 1].type != (int) WorldGen.crackedType && !Main.tile[index10 - num22, index11 - 1].active() && !Main.tile[index10 - num22, index11 + 1].active()) + index10 += num19; + if (Main.tile[index10, index11 - 1].active() && Main.tile[index10, index11 + 1].active() && !Main.tile[index10 - num19, index11 - 1].active() && !Main.tile[index10 - num19, index11 + 1].active()) { - ++num20; - for (int index12 = WorldGen.genRand.Next(5, 13); Main.tile[index10, index11 - 1].active() && (int) Main.tile[index10, index11 - 1].type != (int) WorldGen.crackedType && Main.tile[index10 + num22, index11].active() && Main.tile[index10, index11].active() && !Main.tile[index10 - num22, index11].active() && index12 > 0; --index12) + ++num17; + for (int index12 = WorldGen.genRand.Next(5, 13); Main.tile[index10, index11 - 1].active() && Main.tile[index10 + num19, index11].active() && Main.tile[index10, index11].active() && !Main.tile[index10 - num19, index11].active() && index12 > 0; --index12) { Main.tile[index10, index11].type = (ushort) 48; - if (!Main.tile[index10 - num22, index11 - 1].active() && !Main.tile[index10 - num22, index11 + 1].active()) + if (!Main.tile[index10 - num19, index11 - 1].active() && !Main.tile[index10 - num19, index11 + 1].active()) { - Main.tile[index10 - num22, index11].type = (ushort) 48; - Main.tile[index10 - num22, index11].active(true); - Main.tile[index10 - num22, index11].Clear(TileDataType.Slope); - Main.tile[index10 - num22 * 2, index11].type = (ushort) 48; - Main.tile[index10 - num22 * 2, index11].active(true); - Main.tile[index10 - num22 * 2, index11].Clear(TileDataType.Slope); + Main.tile[index10 - num19, index11].type = (ushort) 48; + Main.tile[index10 - num19, index11].active(true); } --index11; } - int num23 = WorldGen.genRand.Next(5, 13); - for (int index13 = num21 + 1; Main.tile[index10, index13 + 1].active() && (int) Main.tile[index10, index13 + 1].type != (int) WorldGen.crackedType && Main.tile[index10 + num22, index13].active() && Main.tile[index10, index13].active() && !Main.tile[index10 - num22, index13].active() && num23 > 0; --num23) + int num20 = WorldGen.genRand.Next(5, 13); + for (int index13 = num18 + 1; Main.tile[index10, index13 + 1].active() && Main.tile[index10 + num19, index13].active() && Main.tile[index10, index13].active() && !Main.tile[index10 - num19, index13].active() && num20 > 0; --num20) { Main.tile[index10, index13].type = (ushort) 48; - if (!Main.tile[index10 - num22, index13 - 1].active() && !Main.tile[index10 - num22, index13 + 1].active()) + if (!Main.tile[index10 - num19, index13 - 1].active() && !Main.tile[index10 - num19, index13 + 1].active()) { - Main.tile[index10 - num22, index13].type = (ushort) 48; - Main.tile[index10 - num22, index13].active(true); - Main.tile[index10 - num22, index13].Clear(TileDataType.Slope); - Main.tile[index10 - num22 * 2, index13].type = (ushort) 48; - Main.tile[index10 - num22 * 2, index13].active(true); - Main.tile[index10 - num22 * 2, index13].Clear(TileDataType.Slope); + Main.tile[index10 - num19, index13].type = (ushort) 48; + Main.tile[index10 - num19, index13].active(true); } ++index13; } } } - if (num18 > num19) + if (num15 > num16) { - num18 = 0; - ++num20; + num15 = 0; + ++num17; } } Main.statusText = Lang.gen[58].Value + " 80%"; for (int index14 = 0; index14 < WorldGen.numDDoors; ++index14) { - int num24 = WorldGen.DDoorX[index14] - 10; - int num25 = WorldGen.DDoorX[index14] + 10; - int num26 = 100; - int num27 = 0; - for (int index15 = num24; index15 < num25; ++index15) + int num21 = WorldGen.DDoorX[index14] - 10; + int num22 = WorldGen.DDoorX[index14] + 10; + int num23 = 100; + int num24 = 0; + for (int index15 = num21; index15 < num22; ++index15) { bool flag1 = true; int index16 = WorldGen.DDoorY[index14]; @@ -18241,22 +12793,22 @@ label_296: --index16; if (!Main.tileDungeon[(int) Main.tile[index15, index16].type]) flag1 = false; - int num28 = index16; + int num25 = index16; int index17 = WorldGen.DDoorY[index14]; while (!Main.tile[index15, index17].active()) ++index17; if (!Main.tileDungeon[(int) Main.tile[index15, index17].type]) flag1 = false; - int num29 = index17; - if (num29 - num28 >= 3) + int num26 = index17; + if (num26 - num25 >= 3) { - int num30 = index15 - 20; - int num31 = index15 + 20; - int num32 = num29 - 10; - int num33 = num29 + 10; - for (int index18 = num30; index18 < num31; ++index18) + int num27 = index15 - 20; + int num28 = index15 + 20; + int num29 = num26 - 10; + int num30 = num26 + 10; + for (int index18 = num27; index18 < num28; ++index18) { - for (int index19 = num32; index19 < num33; ++index19) + for (int index19 = num29; index19 < num30; ++index19) { if (Main.tile[index18, index19].active() && Main.tile[index18, index19].type == (ushort) 10) { @@ -18267,7 +12819,7 @@ label_296: } if (flag1) { - for (int index20 = num29 - 3; index20 < num29; ++index20) + for (int index20 = num26 - 3; index20 < num26; ++index20) { for (int index21 = index15 - 3; index21 <= index15 + 3; ++index21) { @@ -18279,44 +12831,43 @@ label_296: } } } - if (flag1 && num29 - num28 < 20) + if (flag1 && num26 - num25 < 20) { bool flag2 = false; - if (WorldGen.DDoorPos[index14] == 0 && num29 - num28 < num26) + if (WorldGen.DDoorPos[index14] == 0 && num26 - num25 < num23) flag2 = true; - if (WorldGen.DDoorPos[index14] == -1 && index15 > num27) + if (WorldGen.DDoorPos[index14] == -1 && index15 > num24) flag2 = true; - if (WorldGen.DDoorPos[index14] == 1 && (index15 < num27 || num27 == 0)) + if (WorldGen.DDoorPos[index14] == 1 && (index15 < num24 || num24 == 0)) flag2 = true; if (flag2) { - num27 = index15; - num26 = num29 - num28; + num24 = index15; + num23 = num26 - num25; } } } } - if (num26 < 20) + if (num23 < 20) { - int i2 = num27; + int i = num24; int index22 = WorldGen.DDoorY[index14]; int index23 = index22; - for (; !Main.tile[i2, index22].active(); ++index22) - Main.tile[i2, index22].active(false); - while (!Main.tile[i2, index23].active()) + for (; !Main.tile[i, index22].active(); ++index22) + Main.tile[i, index22].active(false); + while (!Main.tile[i, index23].active()) --index23; - int j2 = index22 - 1; - int num34 = index23 + 1; - for (int index24 = num34; index24 < j2 - 2; ++index24) + int j = index22 - 1; + int num31 = index23 + 1; + for (int index24 = num31; index24 < j - 2; ++index24) { - Main.tile[i2, index24].Clear(TileDataType.Slope); - Main.tile[i2, index24].active(true); - Main.tile[i2, index24].type = tileType; + Main.tile[i, index24].active(true); + Main.tile[i, index24].type = tileType; } int style = 13; if (WorldGen.genRand.Next(3) == 0) { - switch (wallType1) + switch (wallType) { case 7: style = 16; @@ -18329,45 +12880,41 @@ label_296: break; } } - WorldGen.PlaceTile(i2, j2, 10, true, style: style); - int index25 = i2 - 1; - int index26 = j2 - 3; + WorldGen.PlaceTile(i, j, 10, true, style: style); + int index25 = i - 1; + int index26 = j - 3; while (!Main.tile[index25, index26].active()) --index26; - if (j2 - index26 < j2 - num34 + 5 && Main.tileDungeon[(int) Main.tile[index25, index26].type]) + if (j - index26 < j - num31 + 5 && Main.tileDungeon[(int) Main.tile[index25, index26].type]) { - for (int index27 = j2 - 4 - WorldGen.genRand.Next(3); index27 > index26; --index27) + for (int index27 = j - 4 - WorldGen.genRand.Next(3); index27 > index26; --index27) { - Main.tile[index25, index27].Clear(TileDataType.Slope); Main.tile[index25, index27].active(true); Main.tile[index25, index27].type = tileType; } } int index28 = index25 + 2; - int index29 = j2 - 3; + int index29 = j - 3; while (!Main.tile[index28, index29].active()) --index29; - if (j2 - index29 < j2 - num34 + 5 && Main.tileDungeon[(int) Main.tile[index28, index29].type]) + if (j - index29 < j - num31 + 5 && Main.tileDungeon[(int) Main.tile[index28, index29].type]) { - for (int index30 = j2 - 4 - WorldGen.genRand.Next(3); index30 > index29; --index30) + for (int index30 = j - 4 - WorldGen.genRand.Next(3); index30 > index29; --index30) { Main.tile[index28, index30].active(true); - Main.tile[index28, index30].Clear(TileDataType.Slope); Main.tile[index28, index30].type = tileType; } } - int index31 = j2 + 1; - int num35 = index28 - 1; - Main.tile[num35 - 1, index31].active(true); - Main.tile[num35 - 1, index31].type = tileType; - Main.tile[num35 - 1, index31].Clear(TileDataType.Slope); - Main.tile[num35 + 1, index31].active(true); - Main.tile[num35 + 1, index31].type = tileType; - Main.tile[num35 + 1, index31].Clear(TileDataType.Slope); + int index31 = j + 1; + int num32 = index28 - 1; + Main.tile[num32 - 1, index31].active(true); + Main.tile[num32 - 1, index31].type = tileType; + Main.tile[num32 + 1, index31].active(true); + Main.tile[num32 + 1, index31].type = tileType; } } int[] roomWall = new int[3]; - switch (wallType1) + switch (wallType) { case 7: roomWall[0] = 7; @@ -18389,18 +12936,18 @@ label_296: { for (int index33 = 0; index33 < 3; ++index33) { - int num36 = WorldGen.genRand.Next(40, 240); - int num37 = WorldGen.genRand.Next(WorldGen.dMinX, WorldGen.dMaxX); - int num38 = WorldGen.genRand.Next(WorldGen.dMinY, WorldGen.dMaxY); - for (int x1 = num37 - num36; x1 < num37 + num36; ++x1) + int num33 = WorldGen.genRand.Next(40, 240); + int num34 = WorldGen.genRand.Next(WorldGen.dMinX, WorldGen.dMaxX); + int num35 = WorldGen.genRand.Next(WorldGen.dMinY, WorldGen.dMaxY); + for (int x1 = num34 - num33; x1 < num34 + num33; ++x1) { - for (int y1 = num38 - num36; y1 < num38 + num36; ++y1) + for (int y1 = num35 - num33; y1 < num35 + num33; ++y1) { if ((double) y1 > Main.worldSurface) { - double num39 = (double) Math.Abs(num37 - x1); - float num40 = (float) Math.Abs(num38 - y1); - if (Math.Sqrt(num39 * num39 + (double) num40 * (double) num40) < (double) num36 * 0.4 && Main.wallDungeon[(int) Main.tile[x1, y1].wall]) + double num36 = (double) Math.Abs(num34 - x1); + float num37 = (float) Math.Abs(num35 - y1); + if (Math.Sqrt(num36 * num36 + (double) num37 * (double) num37) < (double) num33 * 0.4 && Main.wallDungeon[(int) Main.tile[x1, y1].wall]) WorldGen.Spread.WallDungeon(x1, y1, roomWall[index33]); } } @@ -18408,15 +12955,15 @@ label_296: } } Main.statusText = Lang.gen[58].Value + " 85%"; - for (int index34 = 0; index34 < WorldGen.numDungeonPlatforms; ++index34) + for (int index34 = 0; index34 < WorldGen.numDPlats; ++index34) { - int index35 = WorldGen.dungeonPlatformX[index34]; - int num41 = WorldGen.dungeonPlatformY[index34]; - int num42 = Main.maxTilesX; - int num43 = 10; - if ((double) num41 < Main.worldSurface + 50.0) - num43 = 20; - for (int index36 = num41 - 5; index36 <= num41 + 5; ++index36) + int index35 = WorldGen.DPlatX[index34]; + int num38 = WorldGen.DPlatY[index34]; + int num39 = Main.maxTilesX; + int num40 = 10; + if ((double) num38 < Main.worldSurface + 50.0) + num40 = 20; + for (int index36 = num38 - 5; index36 <= num38 + 5; ++index36) { int index37 = index35; int index38 = index35; @@ -18430,32 +12977,26 @@ label_296: while (!Main.tile[index37, index36].active()) { --index37; - if (!Main.tileDungeon[(int) Main.tile[index37, index36].type] || index37 == 0) - { + if (!Main.tileDungeon[(int) Main.tile[index37, index36].type]) flag3 = true; - break; - } } while (!Main.tile[index38, index36].active()) { ++index38; - if (!Main.tileDungeon[(int) Main.tile[index38, index36].type] || index38 == Main.maxTilesX - 1) - { + if (!Main.tileDungeon[(int) Main.tile[index38, index36].type]) flag3 = true; - break; - } } } - if (!flag3 && index38 - index37 <= num43) + if (!flag3 && index38 - index37 <= num40) { bool flag4 = true; - int num44 = index35 - num43 / 2 - 2; - int num45 = index35 + num43 / 2 + 2; - int num46 = index36 - 5; - int num47 = index36 + 5; - for (int index39 = num44; index39 <= num45; ++index39) + int num41 = index35 - num40 / 2 - 2; + int num42 = index35 + num40 / 2 + 2; + int num43 = index36 - 5; + int num44 = index36 + 5; + for (int index39 = num41; index39 <= num42; ++index39) { - for (int index40 = num46; index40 <= num47; ++index40) + for (int index40 = num43; index40 <= num44; ++index40) { if (Main.tile[index39, index40].active() && Main.tile[index39, index40].type == (ushort) 19) { @@ -18474,69 +13015,49 @@ label_296: } if (flag4) { - num42 = index36; + num39 = index36; break; } } } - if (num42 > num41 - 10 && num42 < num41 + 10) + if (num39 > num38 - 10 && num39 < num38 + 10) { - int i3 = index35; - int j3 = num42; - int i4 = index35 + 1; - for (; !Main.tile[i3, j3].active(); --i3) + int index42 = index35; + int index43 = num39; + int index44 = index35 + 1; + for (; !Main.tile[index42, index43].active(); --index42) { - Main.tile[i3, j3].active(true); - Main.tile[i3, j3].type = (ushort) 19; - Main.tile[i3, j3].Clear(TileDataType.Slope); - switch (wallType1) - { - case 7: - Main.tile[i3, j3].frameY = (short) 108; - break; - case 8: - Main.tile[i3, j3].frameY = (short) 144; - break; - default: - Main.tile[i3, j3].frameY = (short) 126; - break; - } - WorldGen.TileFrame(i3, j3); + Main.tile[index42, index43].active(true); + Main.tile[index42, index43].type = (ushort) 19; + if (wallType == 7) + Main.tile[index42, index43].frameY = (short) 108; + if (wallType == 8) + Main.tile[index42, index43].frameY = (short) 144; + if (wallType == 9) + Main.tile[index42, index43].frameY = (short) 126; } - for (; !Main.tile[i4, j3].active(); ++i4) + for (; !Main.tile[index44, index43].active(); ++index44) { - Main.tile[i4, j3].active(true); - Main.tile[i4, j3].type = (ushort) 19; - Main.tile[i4, j3].Clear(TileDataType.Slope); - switch (wallType1) - { - case 7: - Main.tile[i4, j3].frameY = (short) 108; - break; - case 8: - Main.tile[i4, j3].frameY = (short) 144; - break; - default: - Main.tile[i4, j3].frameY = (short) 126; - break; - } - WorldGen.TileFrame(i4, j3); + Main.tile[index44, index43].active(true); + Main.tile[index44, index43].type = (ushort) 19; + if (wallType == 7) + Main.tile[index44, index43].frameY = (short) 108; + if (wallType == 8) + Main.tile[index44, index43].frameY = (short) 144; + if (wallType == 9) + Main.tile[index44, index43].frameY = (short) 126; } } } - int num48 = 5; - if (WorldGen.drunkWorldGen) - num48 = 6; - for (int index = 0; index < num48; ++index) + for (int index = 0; index < 4; ++index) { bool flag = false; while (!flag) { - int i5 = WorldGen.genRand.Next(WorldGen.dMinX, WorldGen.dMaxX); - int j4 = WorldGen.genRand.Next((int) Main.worldSurface, WorldGen.dMaxY); - if (Main.wallDungeon[(int) Main.tile[i5, j4].wall] && !Main.tile[i5, j4].active()) + int i = WorldGen.genRand.Next(WorldGen.dMinX, WorldGen.dMaxX); + int j = WorldGen.genRand.Next((int) Main.worldSurface, WorldGen.dMaxY); + if (Main.wallDungeon[(int) Main.tile[i, j].wall] && !Main.tile[i, j].active()) { - ushort chestTileType = 21; int contain = 0; int Style = 0; switch (index) @@ -18563,23 +13084,8 @@ label_296: Style = 27; contain = 1572; break; - case 4: - chestTileType = (ushort) 467; - Style = 13; - contain = 4607; - break; - case 5: - if (WorldGen.crimson) - { - Style = 24; - contain = 1571; - break; - } - Style = 25; - contain = 1569; - break; } - flag = WorldGen.AddBuriedChest(i5, j4, contain, Style: Style, chestTileType: chestTileType); + flag = WorldGen.AddBuriedChest(i, j, contain, Style: Style); } } } @@ -18595,154 +13101,165 @@ label_296: while (numArray[2] == numArray[0] || numArray[2] == numArray[1]) numArray[2] = WorldGen.genRand.Next(9, 13); Main.statusText = Lang.gen[58].Value + " 90%"; - int num49 = 0; - int num50 = 1000; - int num51 = 0; - while (num51 < Main.maxTilesX / 20) + int num45 = 0; + int num46 = 1000; + int num47 = 0; + while (num47 < Main.maxTilesX / 20) { - ++num49; - int index42 = WorldGen.genRand.Next(WorldGen.dMinX, WorldGen.dMaxX); - int j5 = WorldGen.genRand.Next(WorldGen.dMinY, WorldGen.dMaxY); + ++num45; + int index45 = WorldGen.genRand.Next(WorldGen.dMinX, WorldGen.dMaxX); + int index46 = WorldGen.genRand.Next(WorldGen.dMinY, WorldGen.dMaxY); bool flag5 = true; - if (Main.wallDungeon[(int) Main.tile[index42, j5].wall] && !Main.tile[index42, j5].active()) + if (Main.wallDungeon[(int) Main.tile[index45, index46].wall] && !Main.tile[index45, index46].active()) { - int num52 = 1; + int num48 = 1; if (WorldGen.genRand.Next(2) == 0) - num52 = -1; - while (flag5 && !Main.tile[index42, j5].active()) + num48 = -1; + while (flag5 && !Main.tile[index45, index46].active()) { - index42 -= num52; - if (index42 < 5 || index42 > Main.maxTilesX - 5) + index45 -= num48; + if (index45 < 5 || index45 > Main.maxTilesX - 5) flag5 = false; - else if (Main.tile[index42, j5].active() && !Main.tileDungeon[(int) Main.tile[index42, j5].type]) + else if (Main.tile[index45, index46].active() && !Main.tileDungeon[(int) Main.tile[index45, index46].type]) flag5 = false; } - if (flag5 && Main.tile[index42, j5].active() && Main.tileDungeon[(int) Main.tile[index42, j5].type] && Main.tile[index42, j5 - 1].active() && Main.tileDungeon[(int) Main.tile[index42, j5 - 1].type] && Main.tile[index42, j5 + 1].active() && Main.tileDungeon[(int) Main.tile[index42, j5 + 1].type]) + if (flag5 && Main.tile[index45, index46].active() && Main.tileDungeon[(int) Main.tile[index45, index46].type] && Main.tile[index45, index46 - 1].active() && Main.tileDungeon[(int) Main.tile[index45, index46 - 1].type] && Main.tile[index45, index46 + 1].active() && Main.tileDungeon[(int) Main.tile[index45, index46 + 1].type]) { - int i6 = index42 + num52; - for (int index43 = i6 - 3; index43 <= i6 + 3; ++index43) + int i1 = index45 + num48; + for (int index47 = i1 - 3; index47 <= i1 + 3; ++index47) { - for (int index44 = j5 - 3; index44 <= j5 + 3; ++index44) + for (int index48 = index46 - 3; index48 <= index46 + 3; ++index48) { - if (Main.tile[index43, index44].active() && Main.tile[index43, index44].type == (ushort) 19) + if (Main.tile[index47, index48].active() && Main.tile[index47, index48].type == (ushort) 19) { flag5 = false; break; } } } - if (flag5 && !Main.tile[i6, j5 - 1].active() & !Main.tile[i6, j5 - 2].active() & !Main.tile[i6, j5 - 3].active()) + if (flag5 && !Main.tile[i1, index46 - 1].active() & !Main.tile[i1, index46 - 2].active() & !Main.tile[i1, index46 - 3].active()) { - int index45 = i6; - int num53 = i6; - while (index45 > WorldGen.dMinX && index45 < WorldGen.dMaxX && !Main.tile[index45, j5].active() && !Main.tile[index45, j5 - 1].active() && !Main.tile[index45, j5 + 1].active()) - index45 += num52; - int num54 = Math.Abs(i6 - index45); + int index49 = i1; + int num49 = i1; + while (index49 > WorldGen.dMinX && index49 < WorldGen.dMaxX && !Main.tile[index49, index46].active() && !Main.tile[index49, index46 - 1].active() && !Main.tile[index49, index46 + 1].active()) + index49 += num48; + int num50 = Math.Abs(i1 - index49); bool flag6 = false; if (WorldGen.genRand.Next(2) == 0) flag6 = true; - if (num54 > 5) + if (num50 > 5) { - for (int index46 = WorldGen.genRand.Next(1, 4); index46 > 0; --index46) + for (int index50 = WorldGen.genRand.Next(1, 4); index50 > 0; --index50) { - Main.tile[i6, j5].active(true); - Main.tile[i6, j5].Clear(TileDataType.Slope); - Main.tile[i6, j5].type = (ushort) 19; - Main.tile[i6, j5].frameY = (int) Main.tile[i6, j5].wall != roomWall[0] ? ((int) Main.tile[i6, j5].wall != roomWall[1] ? (short) (18 * numArray[2]) : (short) (18 * numArray[1])) : (short) (18 * numArray[0]); - WorldGen.TileFrame(i6, j5); + Main.tile[i1, index46].active(true); + Main.tile[i1, index46].type = (ushort) 19; + if ((int) Main.tile[i1, index46].wall == roomWall[0]) + Main.tile[i1, index46].frameY = (short) (18 * numArray[0]); + if ((int) Main.tile[i1, index46].wall == roomWall[1]) + Main.tile[i1, index46].frameY = (short) (18 * numArray[1]); + if ((int) Main.tile[i1, index46].wall == roomWall[2]) + Main.tile[i1, index46].frameY = (short) (18 * numArray[2]); if (flag6) { - WorldGen.PlaceTile(i6, j5 - 1, 50, true); - if (WorldGen.genRand.Next(50) == 0 && (double) j5 > (Main.worldSurface + Main.rockLayer) / 2.0 && Main.tile[i6, j5 - 1].type == (ushort) 50) - Main.tile[i6, j5 - 1].frameX = (short) 90; + WorldGen.PlaceTile(i1, index46 - 1, 50, true); + if (WorldGen.genRand.Next(50) == 0 && Main.tile[i1, index46 - 1].type == (ushort) 50) + Main.tile[i1, index46 - 1].frameX = (short) 90; } - i6 += num52; + i1 += num48; } - num49 = 0; - ++num51; + num45 = 0; + ++num47; if (!flag6 && WorldGen.genRand.Next(2) == 0) { - int i7 = num53; - int j6 = j5 - 1; - int Type = 0; + int i2 = num49; + int j = index46 - 1; + int type = 0; if (WorldGen.genRand.Next(4) == 0) - Type = 1; - switch (Type) + type = 1; + switch (type) { case 0: - Type = 13; + type = 13; break; case 1: - Type = 49; + type = 49; break; } - WorldGen.PlaceTile(i7, j6, Type, true); - if (Main.tile[i7, j6].type == (ushort) 13) - Main.tile[i7, j6].frameX = WorldGen.genRand.Next(2) != 0 ? (short) 36 : (short) 18; + WorldGen.PlaceTile(i2, j, type, true); + if (Main.tile[i2, j].type == (ushort) 13) + Main.tile[i2, j].frameX = WorldGen.genRand.Next(2) != 0 ? (short) 36 : (short) 18; } } } } } - if (num49 > num50) + if (num45 > num46) { - num49 = 0; - ++num51; + num45 = 0; + ++num47; } } Main.statusText = Lang.gen[58].Value + " 95%"; - int num55 = 1; + int num51 = 1; for (int index = 0; index < WorldGen.numDRooms; ++index) { - int num56 = 0; - while (num56 < 1000) + int num52 = 0; + while (num52 < 1000) { - int num57 = (int) ((double) WorldGen.dRoomSize[index] * 0.4); - int i8 = WorldGen.dRoomX[index] + WorldGen.genRand.Next(-num57, num57 + 1); - int j7 = WorldGen.dRoomY[index] + WorldGen.genRand.Next(-num57, num57 + 1); + int num53 = (int) ((double) WorldGen.dRoomSize[index] * 0.4); + int i = WorldGen.dRoomX[index] + WorldGen.genRand.Next(-num53, num53 + 1); + int j = WorldGen.dRoomY[index] + WorldGen.genRand.Next(-num53, num53 + 1); int Style = 2; - if (num55 == 1) - ++num55; int contain; - if (num55 == 2) - contain = 155; - else if (num55 == 3) - contain = 156; - else if (num55 == 4) - contain = 157; - else if (num55 == 5) - contain = 163; - else if (num55 == 6) - contain = 113; - else if (num55 == 7) - contain = 3317; - else if (num55 == 8) + switch (num51) { - contain = 327; - Style = 0; + case 1: + contain = 329; + break; + case 2: + contain = 155; + break; + case 3: + contain = 156; + break; + case 4: + contain = 157; + break; + case 5: + contain = 163; + break; + case 6: + contain = 113; + break; + case 7: + contain = 3317; + break; + case 8: + contain = 327; + Style = 0; + break; + default: + contain = 164; + num51 = 0; + break; } - else - { - contain = 164; - num55 = 0; - } - if ((double) j7 < Main.worldSurface + 50.0) + if ((double) j < Main.worldSurface + 50.0) { contain = 327; Style = 0; } if (contain == 0 && WorldGen.genRand.Next(2) == 0) { - num56 = 1000; + num52 = 1000; } else { - if (WorldGen.AddBuriedChest(i8, j7, contain, Style: Style)) + if (WorldGen.AddBuriedChest(i, j, contain, Style: Style)) { - num56 += 1000; - ++num55; + num52 += 1000; + ++num51; } - ++num56; + ++num52; } } } @@ -18760,13 +13277,13 @@ label_296: WorldGen.dMaxY = Main.maxTilesY; int failCount = 0; int failMax1 = 1000; - int numAdd1 = 0; - WorldGen.MakeDungeon_Lights(tileType, ref failCount, failMax1, ref numAdd1, roomWall); + int numAdd = 0; + WorldGen.MakeDungeon_Lights(tileType, ref failCount, failMax1, ref numAdd, roomWall); failCount = 0; int failMax2 = 1000; - int numAdd2 = 0; - WorldGen.MakeDungeon_Traps(ref failCount, failMax2, ref numAdd2); - float count1 = WorldGen.MakeDungeon_GroundFurniture(wallType1); + numAdd = 0; + WorldGen.MakeDungeon_Traps(ref failCount, failMax2, ref numAdd); + float count1 = WorldGen.MakeDungeon_GroundFurniture(wallType); float count2 = WorldGen.MakeDungeon_Pictures(roomWall, count1); WorldGen.MakeDungeon_Banners(roomWall, count2); } @@ -18871,9 +13388,9 @@ label_296: { int i = index1 + WorldGen.genRand.Next(-12, 13); int j = y + WorldGen.genRand.Next(3, 21); - if (!Main.tile[i, j].active() && !Main.tile[i, j + 1].active() && Main.tileDungeon[(int) Main.tile[i - 1, j].type] && Main.tileDungeon[(int) Main.tile[i + 1, j].type] && Collision.CanHit(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, new Vector2((float) (index1 * 16), (float) (y * 16 + 1)), 16, 16)) + if (!Main.tile[i, j].active() && !Main.tile[i, j + 1].active() && Main.tile[i - 1, j].type != (ushort) 48 && Main.tile[i + 1, j].type != (ushort) 48 && Collision.CanHit(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, new Vector2((float) (index1 * 16), (float) (y * 16 + 1)), 16, 16)) { - if ((WorldGen.SolidTile(i - 1, j) && Main.tile[i - 1, j].type != (ushort) 10 || WorldGen.SolidTile(i + 1, j) && Main.tile[i + 1, j].type != (ushort) 10 || WorldGen.SolidTile(i, j + 1)) && Main.wallDungeon[(int) Main.tile[i, j].wall] && (Main.tileDungeon[(int) Main.tile[i - 1, j].type] || Main.tileDungeon[(int) Main.tile[i + 1, j].type])) + if (WorldGen.SolidTile(i - 1, j) && Main.tile[i - 1, j].type != (ushort) 10 || WorldGen.SolidTile(i + 1, j) && Main.tile[i + 1, j].type != (ushort) 10 || WorldGen.SolidTile(i, j + 1)) WorldGen.PlaceTile(i, j, 136, true); if (Main.tile[i, j].active()) { @@ -19227,7 +13744,7 @@ label_296: i1 = WorldGen.genRand.Next(WorldGen.dMinX, WorldGen.dMaxX); if (Main.wallDungeon[(int) Main.tile[i1, j].wall] && !Main.tile[i1, j].active()) { - while (!WorldGen.SolidTile(i1, j) && j < Main.UnderworldLayer) + while (!WorldGen.SolidTile(i1, j) && j < Main.maxTilesY - 200) ++j; int index2 = j - 1; int i2 = i1; @@ -19291,7 +13808,7 @@ label_296: style14 = 32; break; } - if (Main.tile[index3, index2].wall >= (ushort) 94 && Main.tile[index3, index2].wall <= (ushort) 105) + if (Main.tile[index3, index2].wall >= (byte) 94 && Main.tile[index3, index2].wall <= (byte) 105) { style1 = 17; style2 = 14; @@ -19639,34 +14156,9 @@ label_296: return new Vector2((float) num2, (float) num3); } - public static Vector2 RandHousePictureDesert() - { - int num1 = WorldGen.genRand.Next(4); - int num2; - int num3; - if (num1 <= 1) - { - num2 = 240; - num3 = 63 + WorldGen.genRand.Next(6); - } - else if (num1 == 2) - { - num2 = 245; - num3 = 7 + WorldGen.genRand.Next(2); - } - else - { - num2 = 242; - num3 = 37 + WorldGen.genRand.Next(6); - } - return new Vector2((float) num2, (float) num3); - } - public static Vector2 randHousePicture() { int num1 = WorldGen.genRand.Next(4); - if (num1 >= 3 && WorldGen.genRand.Next(10) != 0) - num1 = WorldGen.genRand.Next(3); int num2; int num3; if (num1 <= 1) @@ -19784,18 +14276,17 @@ label_296: { Vector2 zero = Vector2.Zero; double num1 = (double) WorldGen.genRand.Next(5, 9); - int num2 = 1; Vector2 vector2; vector2.X = (float) i; vector2.Y = (float) j; - int num3 = WorldGen.genRand.Next(10, 30); - int num4 = i <= WorldGen.dEnteranceX ? 1 : -1; + int num2 = WorldGen.genRand.Next(10, 30); + int num3 = i <= WorldGen.dEnteranceX ? 1 : -1; if (i > Main.maxTilesX - 400) - num4 = -1; + num3 = -1; else if (i < 400) - num4 = 1; + num3 = 1; zero.Y = -1f; - zero.X = (float) num4; + zero.X = (float) num3; if (WorldGen.genRand.Next(3) != 0) zero.X *= (float) (1.0 + (double) WorldGen.genRand.Next(0, 200) * 0.00999999977648258); else if (WorldGen.genRand.Next(3) == 0) @@ -19806,79 +14297,74 @@ label_296: zero.X = -0.5f; if (WorldGen.dungeonX > Main.maxTilesX / 2 && (double) zero.X > 0.0 && (double) zero.X > 0.5) zero.X = -0.5f; - if (WorldGen.drunkWorldGen) + while (num2 > 0) { - num2 = num4 * -1; - zero.X *= -1f; - } - while (num3 > 0) - { - --num3; - int num5 = (int) ((double) vector2.X - num1 - 4.0 - (double) WorldGen.genRand.Next(6)); - int num6 = (int) ((double) vector2.X + num1 + 4.0 + (double) WorldGen.genRand.Next(6)); - int num7 = (int) ((double) vector2.Y - num1 - 4.0); - int num8 = (int) ((double) vector2.Y + num1 + 4.0 + (double) WorldGen.genRand.Next(6)); - if (num5 < 0) - num5 = 0; - if (num6 > Main.maxTilesX) - num6 = Main.maxTilesX; - if (num7 < 0) - num7 = 0; - if (num8 > Main.maxTilesY) - num8 = Main.maxTilesY; - int num9 = 1; + --num2; + int num4 = (int) ((double) vector2.X - num1 - 4.0 - (double) WorldGen.genRand.Next(6)); + int num5 = (int) ((double) vector2.X + num1 + 4.0 + (double) WorldGen.genRand.Next(6)); + int num6 = (int) ((double) vector2.Y - num1 - 4.0); + int num7 = (int) ((double) vector2.Y + num1 + 4.0 + (double) WorldGen.genRand.Next(6)); + if (num4 < 0) + num4 = 0; + if (num5 > Main.maxTilesX) + num5 = Main.maxTilesX; + if (num6 < 0) + num6 = 0; + if (num7 > Main.maxTilesY) + num7 = Main.maxTilesY; + int num8 = 1; if ((double) vector2.X > (double) (Main.maxTilesX / 2)) - num9 = -1; - int i1 = (int) ((double) vector2.X + WorldGen.dxStrength1 * 0.600000023841858 * (double) num9 + WorldGen.dxStrength2 * (double) num9); - int num10 = (int) (WorldGen.dyStrength2 * 0.5); - if ((double) vector2.Y < Main.worldSurface - 5.0 && Main.tile[i1, (int) ((double) vector2.Y - num1 - 6.0 + (double) num10)].wall == (ushort) 0 && Main.tile[i1, (int) ((double) vector2.Y - num1 - 7.0 + (double) num10)].wall == (ushort) 0 && Main.tile[i1, (int) ((double) vector2.Y - num1 - 8.0 + (double) num10)].wall == (ushort) 0) + num8 = -1; + int i1 = (int) ((double) vector2.X + WorldGen.dxStrength1 * 0.600000023841858 * (double) num8 + WorldGen.dxStrength2 * (double) num8); + int num9 = (int) (WorldGen.dyStrength2 * 0.5); + if ((double) vector2.Y < Main.worldSurface - 5.0 && Main.tile[i1, (int) ((double) vector2.Y - num1 - 6.0 + (double) num9)].wall == (byte) 0 && Main.tile[i1, (int) ((double) vector2.Y - num1 - 7.0 + (double) num9)].wall == (byte) 0 && Main.tile[i1, (int) ((double) vector2.Y - num1 - 8.0 + (double) num9)].wall == (byte) 0) { WorldGen.dSurface = true; - WorldGen.TileRunner(i1, (int) ((double) vector2.Y - num1 - 6.0 + (double) num10), (double) WorldGen.genRand.Next(25, 35), WorldGen.genRand.Next(10, 20), -1, speedY: -1f); + WorldGen.TileRunner(i1, (int) ((double) vector2.Y - num1 - 6.0 + (double) num9), (double) WorldGen.genRand.Next(25, 35), WorldGen.genRand.Next(10, 20), -1, speedY: -1f); } - for (int index1 = num5; index1 < num6; ++index1) + for (int index1 = num4; index1 < num5; ++index1) { - for (int index2 = num7; index2 < num8; ++index2) + for (int index2 = num6; index2 < num7; ++index2) { Main.tile[index1, index2].liquid = (byte) 0; if (!Main.wallDungeon[(int) Main.tile[index1, index2].wall]) { - Main.tile[index1, index2].wall = (ushort) 0; + Main.tile[index1, index2].wall = (byte) 0; Main.tile[index1, index2].active(true); Main.tile[index1, index2].type = tileType; } } } - for (int index3 = num5 + 1; index3 < num6 - 1; ++index3) + for (int index3 = num4 + 1; index3 < num5 - 1; ++index3) { - for (int index4 = num7 + 1; index4 < num8 - 1; ++index4) - Main.tile[index3, index4].wall = (ushort) wallType; + for (int index4 = num6 + 1; index4 < num7 - 1; ++index4) + Main.tile[index3, index4].wall = (byte) wallType; } - int num11 = 0; + int num10 = 0; if (WorldGen.genRand.Next((int) num1) == 0) - num11 = WorldGen.genRand.Next(1, 3); - int num12 = (int) ((double) vector2.X - num1 * 0.5 - (double) num11); - int num13 = (int) ((double) vector2.X + num1 * 0.5 + (double) num11); - int num14 = (int) ((double) vector2.Y - num1 * 0.5 - (double) num11); - int num15 = (int) ((double) vector2.Y + num1 * 0.5 + (double) num11); - if (num12 < 0) - num12 = 0; - if (num13 > Main.maxTilesX) - num13 = Main.maxTilesX; - if (num14 < 0) - num14 = 0; - if (num15 > Main.maxTilesY) - num15 = Main.maxTilesY; - for (int i2 = num12; i2 < num13; ++i2) + num10 = WorldGen.genRand.Next(1, 3); + int num11 = (int) ((double) vector2.X - num1 * 0.5 - (double) num10); + int num12 = (int) ((double) vector2.X + num1 * 0.5 + (double) num10); + int num13 = (int) ((double) vector2.Y - num1 * 0.5 - (double) num10); + int num14 = (int) ((double) vector2.Y + num1 * 0.5 + (double) num10); + if (num11 < 0) + num11 = 0; + if (num12 > Main.maxTilesX) + num12 = Main.maxTilesX; + if (num13 < 0) + num13 = 0; + if (num14 > Main.maxTilesY) + num14 = Main.maxTilesY; + for (int i2 = num11; i2 < num12; ++i2) { - for (int j1 = num14; j1 < num15; ++j1) + for (int j1 = num13; j1 < num14; ++j1) { Main.tile[i2, j1].active(false); WorldGen.PlaceWall(i2, j1, wallType, true); } } if (WorldGen.dSurface) - num3 = 0; + num2 = 0; vector2 += zero; if ((double) vector2.Y < Main.worldSurface) zero.Y *= 0.98f; @@ -19887,299 +14373,6 @@ label_296: WorldGen.dungeonY = (int) vector2.Y; } - public static bool PlaceSandTrap(int i, int j) - { - int num1 = 6; - int num2 = 4; - int num3 = 25; - int i1 = i; - int index1 = j; - while (!Main.tile[i1, index1].active() && index1 < Main.UnderworldLayer) - ++index1; - if (!Main.tileSolid[(int) Main.tile[i1, index1].type] || Main.tile[i1, index1].halfBrick() || Main.tile[i1, index1].topSlope() || Main.tile[i1, index1].type != (ushort) 53 && Main.tile[i1, index1].type != (ushort) 397 && Main.tile[i1, index1].type != (ushort) 396 || Main.tile[i1, index1].wall != (ushort) 216 && Main.tile[i1, index1].wall != (ushort) 187) - return false; - int j1 = index1 - 1; - int num4 = -1; - int num5 = WorldGen.genRand.Next(6, 12); - int num6 = WorldGen.genRand.Next(6, 14); - for (int index2 = i1 - num3; index2 <= i1 + num3; ++index2) - { - for (int index3 = j1 - num3; index3 < j1 + num3; ++index3) - { - if (Main.tile[index2, index3].wire() || TileID.Sets.BasicChest[(int) Main.tile[index2, index3].type] || TileID.Sets.Paintings[(int) Main.tile[index2, index3].type] || Main.tile[index2, index3].type == (ushort) 10 || Main.tile[index2, index3].type == (ushort) 19 || Main.tile[index2, index3].type == (ushort) 15 || Main.tile[index2, index3].type == (ushort) 219) - return false; - } - } - for (int index4 = i1 - 2; index4 <= i1 + 2; ++index4) - { - for (int index5 = j1 + 1; index5 <= j1 + 3; ++index5) - { - if (!Main.tile[index4, index5].active() || !Main.tileSolid[(int) Main.tile[index4, index5].type]) - return false; - } - } - for (int index6 = j1; index6 > j1 - 30; --index6) - { - if (Main.tile[i1, index6].active()) - { - if (Main.tile[i1, index6].type != (ushort) 396) - return false; - num4 = index6; - break; - } - } - if (num4 <= -1 || j1 - num4 < num6 + num2) - return false; - int num7 = 0; - int index7 = (j1 + num4) / 2; - for (int index8 = i1 - num5; index8 <= i1 + num5; ++index8) - { - if (Main.tile[index8, index7].active() && Main.tileSolid[(int) Main.tile[index8, index7].type]) - return false; - for (int index9 = num4 - num6; index9 <= num4; ++index9) - { - if (Main.tile[index8, index9].active()) - { - if (TileID.Sets.Ore[(int) Main.tile[index8, index9].type] || Main.tile[index8, index9].type == (ushort) 404) - return false; - if (Main.tileSolid[(int) Main.tile[index8, index9].type]) - ++num7; - } - } - } - float num8 = (float) ((num5 * 2 + 1) * (num6 + 1)) * 0.75f; - if ((double) num7 < (double) num8) - return false; - for (int index10 = i1 - num5 - 1; index10 <= i1 + num5 + 1; ++index10) - { - for (int index11 = num4 - num6; index11 <= num4; ++index11) - { - bool flag = false; - if (Main.tile[index10, index11].active() && Main.tileSolid[(int) Main.tile[index10, index11].type]) - flag = true; - if (index11 == num4) - { - Main.tile[index10, index11].slope((byte) 0); - Main.tile[index10, index11].halfBrick(false); - if (!flag) - { - Main.tile[index10, index11].active(true); - Main.tile[index10, index11].type = (ushort) 396; - } - } - else if (index11 == num4 - num6) - { - Main.tile[index10, index11].ClearTile(); - Main.tile[index10, index11].active(true); - Main.tile[index10, index11].type = !flag || !Main.tile[index10, index11 - 1].active() || !Main.tileSolid[(int) Main.tile[index10, index11 - 1].type] ? (ushort) 396 : (ushort) 397; - } - else if (index10 == i1 - num5 - 1 || index10 == i1 + num5 + 1) - { - if (!flag) - { - Main.tile[index10, index11].ClearTile(); - Main.tile[index10, index11].active(true); - Main.tile[index10, index11].type = (ushort) 396; - } - else - { - Main.tile[index10, index11].slope((byte) 0); - Main.tile[index10, index11].halfBrick(false); - } - } - else - { - Main.tile[index10, index11].ClearTile(); - Main.tile[index10, index11].active(true); - Main.tile[index10, index11].type = (ushort) 53; - } - } - } - for (int index12 = (int) ((double) num4 - (double) num6 * 0.666000008583069); (double) index12 <= (double) num4 - (double) num6 * 0.333; ++index12) - { - if ((double) index12 < (double) num4 - (double) num6 * 0.400000005960464) - { - if (Main.tile[i1 - num5 - 2, index12].bottomSlope()) - Main.tile[i1 - num5 - 2, index12].slope((byte) 0); - } - else if ((double) index12 > (double) num4 - (double) num6 * 0.600000023841858) - { - if (Main.tile[i1 - num5 - 2, index12].topSlope()) - Main.tile[i1 - num5 - 2, index12].slope((byte) 0); - Main.tile[i1 - num5 - 2, index12].halfBrick(false); - } - else - { - Main.tile[i1 - num5 - 2, index12].halfBrick(false); - Main.tile[i1 - num5 - 2, index12].slope((byte) 0); - } - if (!Main.tile[i1 - num5 - 2, index12].active() || !Main.tileSolid[(int) Main.tile[i1 - num5 - 2, index12].type]) - { - Main.tile[i1 - num5 - 2, index12].active(true); - Main.tile[i1 - num5 - 2, index12].type = (ushort) 396; - } - if (!Main.tile[i1 + num5 + 2, index12].active() || !Main.tileSolid[(int) Main.tile[i1 + num5 + 2, index12].type]) - { - Main.tile[i1 + num5 + 2, index12].active(true); - Main.tile[i1 + num5 + 2, index12].type = (ushort) 396; - } - } - for (int index13 = num4 - num6; index13 <= num4; ++index13) - { - Main.tile[i1 - num5 - 2, index13].slope((byte) 0); - Main.tile[i1 - num5 - 2, index13].halfBrick(false); - Main.tile[i1 - num5 - 1, index13].slope((byte) 0); - Main.tile[i1 - num5 - 1, index13].halfBrick(false); - Main.tile[i1 - num5 + 1, index13].slope((byte) 0); - Main.tile[i1 - num5 + 1, index13].halfBrick(false); - Main.tile[i1 - num5 + 2, index13].slope((byte) 0); - Main.tile[i1 - num5 + 2, index13].halfBrick(false); - } - for (int index14 = i1 - num5 - 1; index14 < i1 + num5 + 1; ++index14) - { - int index15 = j1 - num6 - 1; - if (Main.tile[index14, index15].bottomSlope()) - Main.tile[index14, index15].slope((byte) 0); - Main.tile[index14, index15].halfBrick(false); - } - WorldGen.KillTile(i1 - 2, j1); - WorldGen.KillTile(i1 - 1, j1); - WorldGen.KillTile(i1 + 1, j1); - WorldGen.KillTile(i1 + 2, j1); - WorldGen.PlaceTile(i1, j1, 135, true, style: 7); - for (int i2 = i1 - num5; i2 <= i1 + num5; ++i2) - { - int num9 = j1; - if ((double) i2 < (double) i1 - (double) num5 * 0.8 || (double) i2 > (double) i1 + (double) num5 * 0.8) - num9 = j1 - 3; - else if ((double) i2 < (double) i1 - (double) num5 * 0.6 || (double) i2 > (double) i1 + (double) num5 * 0.6) - num9 = j1 - 2; - else if ((double) i2 < (double) i1 - (double) num5 * 0.4 || (double) i2 > (double) i1 + (double) num5 * 0.4) - num9 = j1 - 1; - for (int j2 = num4; j2 <= j1; ++j2) - { - if (i2 == i1 && j2 <= j1) - Main.tile[i1, j2].wire(true); - if (Main.tile[i2, j2].active() && Main.tileSolid[(int) Main.tile[i2, j2].type]) - { - if (j2 < num4 + num1 - 4) - { - Main.tile[i2, j2].actuator(true); - Main.tile[i2, j2].wire(true); - } - else if (j2 < num9) - WorldGen.KillTile(i2, j2); - } - } - } - return true; - } - - public static bool DungeonPitTrap(int i, int j, ushort tileType, int wallType) - { - int num1 = 30; - int i1 = i; - int index1 = j; - int num2 = index1; - int num3 = WorldGen.genRand.Next(8, 19); - int num4 = WorldGen.genRand.Next(19, 46); - int num5 = num3 + WorldGen.genRand.Next(6, 10); - int num6 = num4 + WorldGen.genRand.Next(6, 10); - if (!Main.wallDungeon[(int) Main.tile[i1, index1].wall] || Main.tile[i1, index1].active()) - return false; - for (int j1 = index1; j1 < Main.maxTilesY; ++j1) - { - if (j1 > Main.maxTilesY - 300) - return false; - if (Main.tile[i1, j1].active() && WorldGen.SolidTile(i1, j1)) - { - if (Main.tile[i1, j1].type == (ushort) 48) - return false; - index1 = j1; - break; - } - } - if (!Main.wallDungeon[(int) Main.tile[i1 - num3, index1].wall] || !Main.wallDungeon[(int) Main.tile[i1 + num3, index1].wall]) - return false; - for (int index2 = index1; index2 < index1 + num1; ++index2) - { - bool flag = true; - for (int index3 = i1 - num3; index3 <= i1 + num3; ++index3) - { - Tile tile = Main.tile[index3, index2]; - if (tile.active() && Main.tileDungeon[(int) tile.type]) - flag = false; - } - if (flag) - { - index1 = index2; - break; - } - } - for (int index4 = i1 - num3; index4 <= i1 + num3; ++index4) - { - for (int index5 = index1; index5 <= index1 + num4; ++index5) - { - Tile tile = Main.tile[index4, index5]; - if (tile.active() && (Main.tileDungeon[(int) tile.type] || (int) tile.type == (int) WorldGen.crackedType)) - return false; - } - } - bool flag1 = false; - if (WorldGen.dungeonLake) - { - flag1 = true; - WorldGen.dungeonLake = false; - } - else if (WorldGen.genRand.Next(8) == 0) - flag1 = true; - for (int index6 = i1 - num3; index6 <= i1 + num3; ++index6) - { - for (int index7 = num2; index7 <= index1 + num4; ++index7) - { - if (Main.tileDungeon[(int) Main.tile[index6, index7].type]) - { - Main.tile[index6, index7].type = WorldGen.crackedType; - Main.tile[index6, index7].wall = (ushort) wallType; - } - } - } - for (int index8 = i1 - num5; index8 <= i1 + num5; ++index8) - { - for (int index9 = num2; index9 <= index1 + num6; ++index9) - { - Main.tile[index8, index9].lava(false); - Main.tile[index8, index9].liquid = (byte) 0; - if (!Main.wallDungeon[(int) Main.tile[index8, index9].wall] && (int) Main.tile[index8, index9].type != (int) WorldGen.crackedType) - { - Main.tile[index8, index9].Clear(TileDataType.Slope); - Main.tile[index8, index9].type = tileType; - Main.tile[index8, index9].active(true); - if (index8 > i1 - num5 && index8 < i1 + num5 && index9 < index1 + num6) - Main.tile[index8, index9].wall = (ushort) wallType; - } - } - } - for (int index10 = i1 - num3; index10 <= i1 + num3; ++index10) - { - for (int index11 = num2; index11 <= index1 + num4; ++index11) - { - if ((int) Main.tile[index10, index11].type != (int) WorldGen.crackedType) - { - if (flag1) - Main.tile[index10, index11].liquid = byte.MaxValue; - if (index10 == i1 - num3 || index10 == i1 + num3 || index11 == index1 + num4) - Main.tile[index10, index11].type = (ushort) 48; - else if (index10 == i1 - num3 + 1 && index11 % 2 == 0 || index10 == i1 + num3 - 1 && index11 % 2 == 0 || index11 == index1 + num4 - 1 && index10 % 2 == 0) - Main.tile[index10, index11].type = (ushort) 48; - else - Main.tile[index10, index11].active(false); - } - } - } - return true; - } - public static void DungeonHalls(int i, int j, ushort tileType, int wallType, bool forceX = false) { Vector2 zero1 = Vector2.Zero; @@ -20191,9 +14384,6 @@ label_296: vector2.X = (float) i; vector2.Y = (float) j; int num3 = WorldGen.genRand.Next(35, 80); - bool flag1 = false; - if (WorldGen.genRand.Next(5) == 0) - flag1 = true; if (forceX) { num3 += 20; @@ -20204,25 +14394,40 @@ label_296: num1 *= 2.0; num3 /= 2; } + bool flag1 = false; bool flag2 = false; - bool flag3 = false; - bool flag4 = true; - while (!flag2) + bool flag3 = true; + while (!flag1) { - bool flag5 = false; + bool flag4 = false; int num4; - if (flag4 && !forceX) + if (flag3 && !forceX) { + bool flag5 = true; bool flag6 = true; bool flag7 = true; bool flag8 = true; - bool flag9 = true; int num5 = num3; - bool flag10 = false; + bool flag9 = false; for (int index1 = j; index1 > j - num5; --index1) { int index2 = i; if ((int) Main.tile[index2, index1].wall == wallType) + { + if (flag9) + { + flag5 = false; + break; + } + } + else + flag9 = true; + } + bool flag10 = false; + for (int index3 = j; index3 < j + num5; ++index3) + { + int index4 = i; + if ((int) Main.tile[index4, index3].wall == wallType) { if (flag10) { @@ -20234,10 +14439,10 @@ label_296: flag10 = true; } bool flag11 = false; - for (int index3 = j; index3 < j + num5; ++index3) + for (int index5 = i; index5 > i - num5; --index5) { - int index4 = i; - if ((int) Main.tile[index4, index3].wall == wallType) + int index6 = j; + if ((int) Main.tile[index5, index6].wall == wallType) { if (flag11) { @@ -20249,10 +14454,10 @@ label_296: flag11 = true; } bool flag12 = false; - for (int index5 = i; index5 > i - num5; --index5) + for (int index7 = i; index7 < i + num5; ++index7) { - int index6 = j; - if ((int) Main.tile[index5, index6].wall == wallType) + int index8 = j; + if ((int) Main.tile[index7, index8].wall == wallType) { if (flag12) { @@ -20263,26 +14468,11 @@ label_296: else flag12 = true; } - bool flag13 = false; - for (int index7 = i; index7 < i + num5; ++index7) - { - int index8 = j; - if ((int) Main.tile[index7, index8].wall == wallType) - { - if (flag13) - { - flag9 = false; - break; - } - } - else - flag13 = true; - } - if (!flag8 && !flag9 && !flag6 && !flag7) + if (!flag7 && !flag8 && !flag5 && !flag6) { num4 = WorldGen.genRand.Next(2) != 0 ? 1 : -1; if (WorldGen.genRand.Next(2) == 0) - flag5 = true; + flag4 = true; } else { @@ -20292,7 +14482,7 @@ label_296: { num6 = WorldGen.genRand.Next(4); } - while (!(num6 == 0 & flag6) && !(num6 == 1 & flag7) && !(num6 == 2 & flag8) && !(num6 == 3 & flag9)); + while (!(num6 == 0 & flag5) && !(num6 == 1 & flag6) && !(num6 == 2 & flag7) && !(num6 == 3 & flag8)); switch (num6) { case 0: @@ -20302,7 +14492,7 @@ label_296: num4 = 1; break; default: - flag5 = true; + flag4 = true; num4 = num6 != 2 ? 1 : -1; break; } @@ -20312,12 +14502,12 @@ label_296: { num4 = WorldGen.genRand.Next(2) != 0 ? 1 : -1; if (WorldGen.genRand.Next(2) == 0) - flag5 = true; + flag4 = true; } - flag4 = false; + flag3 = false; if (forceX) - flag5 = true; - if (flag5) + flag4 = true; + if (flag4) { zero2.Y = 0.0f; zero2.X = (float) num4; @@ -20339,7 +14529,7 @@ label_296: zero3.Y = (float) -num4; if (WorldGen.genRand.Next(3) != 0) { - flag3 = true; + flag2 = true; zero1.X = WorldGen.genRand.Next(2) != 0 ? (float) -WorldGen.genRand.Next(10, 20) * 0.1f : (float) WorldGen.genRand.Next(10, 20) * 0.1f; } else if (WorldGen.genRand.Next(2) == 0) @@ -20348,7 +14538,7 @@ label_296: num3 /= 2; } if (WorldGen.lastDungeonHall != zero3) - flag2 = true; + flag1 = true; } int num7 = 0; if (!forceX) @@ -20394,7 +14584,7 @@ label_296: zero2.Y = (float) num11; if (WorldGen.genRand.Next(3) != 0) { - flag3 = true; + flag2 = true; zero1.X = WorldGen.genRand.Next(2) != 0 ? (float) -WorldGen.genRand.Next(10, 20) * 0.1f : (float) WorldGen.genRand.Next(10, 20) * 0.1f; } else if (WorldGen.genRand.Next(2) == 0) @@ -20430,9 +14620,9 @@ label_296: } else { - WorldGen.dungeonPlatformX[WorldGen.numDungeonPlatforms] = (int) vector2.X; - WorldGen.dungeonPlatformY[WorldGen.numDungeonPlatforms] = (int) vector2.Y; - ++WorldGen.numDungeonPlatforms; + WorldGen.DPlatX[WorldGen.numDPlats] = (int) vector2.X; + WorldGen.DPlatY[WorldGen.numDPlats] = (int) vector2.Y; + ++WorldGen.numDPlats; } WorldGen.lastDungeonHall = zero2; if ((double) Math.Abs(zero1.X) > (double) Math.Abs(zero1.Y) && WorldGen.genRand.Next(3) != 0) @@ -20476,14 +14666,13 @@ label_296: { Main.tile[index9, index10].active(true); Main.tile[index9, index10].type = tileType; - Main.tile[index9, index10].Clear(TileDataType.Slope); } } } for (int index11 = num14 + 1; index11 < num15 - 1; ++index11) { for (int index12 = num16 + 1; index12 < num17 - 1; ++index12) - Main.tile[index11, index12].wall = (ushort) wallType; + Main.tile[index11, index12].wall = (byte) wallType; } int num18 = 0; if ((double) zero1.Y == 0.0 && WorldGen.genRand.Next((int) num1 + 1) == 0) @@ -20508,23 +14697,12 @@ label_296: { for (int index14 = num21; index14 < num22; ++index14) { - Main.tile[index13, index14].Clear(TileDataType.Slope); - if (flag1) - { - if (Main.tile[index13, index14].active() || (int) Main.tile[index13, index14].wall != wallType) - { - Main.tile[index13, index14].active(true); - Main.tile[index13, index14].type = WorldGen.crackedType; - } - } - else - Main.tile[index13, index14].active(false); - Main.tile[index13, index14].Clear(TileDataType.Slope); - Main.tile[index13, index14].wall = (ushort) wallType; + Main.tile[index13, index14].active(false); + Main.tile[index13, index14].wall = (byte) wallType; } } vector2 += zero1; - if (flag3 && num7 > WorldGen.genRand.Next(10, 20)) + if (flag2 && num7 > WorldGen.genRand.Next(10, 20)) { num7 = 0; zero1.X *= -1f; @@ -20541,9 +14719,9 @@ label_296: } else { - WorldGen.dungeonPlatformX[WorldGen.numDungeonPlatforms] = (int) vector2.X; - WorldGen.dungeonPlatformY[WorldGen.numDungeonPlatforms] = (int) vector2.Y; - ++WorldGen.numDungeonPlatforms; + WorldGen.DPlatX[WorldGen.numDPlats] = (int) vector2.X; + WorldGen.DPlatY[WorldGen.numDPlats] = (int) vector2.Y; + ++WorldGen.numDPlats; } } @@ -20589,7 +14767,6 @@ label_296: Main.tile[index1, index2].liquid = (byte) 0; if (!Main.wallDungeon[(int) Main.tile[index1, index2].wall]) { - Main.tile[index1, index2].Clear(TileDataType.Slope); Main.tile[index1, index2].active(true); Main.tile[index1, index2].type = tileType; } @@ -20598,7 +14775,7 @@ label_296: for (int index3 = num7 + 1; index3 < num8 - 1; ++index3) { for (int index4 = num9 + 1; index4 < num10 - 1; ++index4) - Main.tile[index3, index4].wall = (ushort) wallType; + Main.tile[index3, index4].wall = (byte) wallType; } int num11 = (int) ((double) vector2_2.X - num1 * 0.5); int num12 = (int) ((double) vector2_2.X + num1 * 0.5); @@ -20625,7 +14802,7 @@ label_296: for (int index6 = num13; index6 < num14; ++index6) { Main.tile[index5, index6].active(false); - Main.tile[index5, index6].wall = (ushort) wallType; + Main.tile[index5, index6].wall = (byte) wallType; } } vector2_2 += vector2_1; @@ -20660,7 +14837,6 @@ label_296: { Main.tile[index1, index2].liquid = (byte) 0; Main.tile[index1, index2].lava(false); - Main.tile[index1, index2].Clear(TileDataType.Slope); } } double dxStrength1 = WorldGen.dxStrength1; @@ -20672,8 +14848,6 @@ label_296: int num2 = 1; if (i > Main.maxTilesX / 2) num2 = -1; - if (WorldGen.drunkWorldGen || WorldGen.getGoodWorldGen) - num2 *= -1; int num3 = (int) ((double) vector2.X - dxStrength1 * 0.600000023841858 - (double) WorldGen.genRand.Next(2, 5)); int num4 = (int) ((double) vector2.X + dxStrength1 * 0.600000023841858 + (double) WorldGen.genRand.Next(2, 5)); int num5 = (int) ((double) vector2.Y - dyStrength1 * 0.600000023841858 - (double) WorldGen.genRand.Next(2, 5)); @@ -20693,12 +14867,11 @@ label_296: Main.tile[index3, index4].liquid = (byte) 0; if ((int) Main.tile[index3, index4].wall != wallType) { - Main.tile[index3, index4].wall = (ushort) 0; + Main.tile[index3, index4].wall = (byte) 0; if (index3 > num3 + 1 && index3 < num4 - 2 && index4 > num5 + 1 && index4 < num6 - 2) - Main.tile[index3, index4].wall = (ushort) wallType; + Main.tile[index3, index4].wall = (byte) wallType; Main.tile[index3, index4].active(true); Main.tile[index3, index4].type = tileType; - Main.tile[index3, index4].Clear(TileDataType.Slope); } } } @@ -20710,12 +14883,10 @@ label_296: { for (int index6 = num9; index6 < num10; ++index6) { - Main.tile[index5, index6].liquid = (byte) 0; if ((int) Main.tile[index5, index6].wall != wallType) { Main.tile[index5, index6].active(true); Main.tile[index5, index6].type = tileType; - Main.tile[index5, index6].Clear(TileDataType.Slope); } } } @@ -20727,12 +14898,10 @@ label_296: { for (int index8 = num13; index8 < num14; ++index8) { - Main.tile[index7, index8].liquid = (byte) 0; if ((int) Main.tile[index7, index8].wall != wallType) { Main.tile[index7, index8].active(true); Main.tile[index7, index8].type = tileType; - Main.tile[index7, index8].Clear(TileDataType.Slope); } } } @@ -20743,12 +14912,10 @@ label_296: { for (int index10 = num5 - num15; index10 < num5; ++index10) { - Main.tile[index9, index10].liquid = (byte) 0; if ((int) Main.tile[index9, index10].wall != wallType) { Main.tile[index9, index10].active(true); Main.tile[index9, index10].type = tileType; - Main.tile[index9, index10].Clear(TileDataType.Slope); } } ++num17; @@ -20762,15 +14929,12 @@ label_296: { for (int index12 = num6; (double) index12 < Main.worldSurface; ++index12) { - Main.tile[index11, index12].liquid = (byte) 0; if (!Main.wallDungeon[(int) Main.tile[index11, index12].wall]) { Main.tile[index11, index12].active(true); Main.tile[index11, index12].type = tileType; } - if (index11 > num3 && index11 < num4 - 1) - Main.tile[index11, index12].wall = (ushort) wallType; - Main.tile[index11, index12].Clear(TileDataType.Slope); + Main.tile[index11, index12].wall = (byte) wallType; } } int num18 = (int) ((double) vector2.X - dxStrength1 * 0.600000023841858); @@ -20788,11 +14952,7 @@ label_296: for (int index13 = num18; index13 < num19; ++index13) { for (int index14 = num20; index14 < num21; ++index14) - { - Main.tile[index13, index14].liquid = (byte) 0; - Main.tile[index13, index14].wall = (ushort) wallType; - Main.tile[index13, index14].Clear(TileDataType.Slope); - } + Main.tile[index13, index14].wall = (byte) wallType; } int num22 = (int) ((double) vector2.X - dxStrength1 * 0.6 - 1.0); int num23 = (int) ((double) vector2.X + dxStrength1 * 0.6 + 1.0); @@ -20806,16 +14966,10 @@ label_296: num24 = 0; if (num25 > Main.maxTilesY) num25 = Main.maxTilesY; - if (WorldGen.drunkWorldGen) - num22 -= 4; for (int index15 = num22; index15 < num23; ++index15) { for (int index16 = num24; index16 < num25; ++index16) - { - Main.tile[index15, index16].liquid = (byte) 0; - Main.tile[index15, index16].wall = (ushort) wallType; - Main.tile[index15, index16].Clear(TileDataType.Slope); - } + Main.tile[index15, index16].wall = (byte) wallType; } int num26 = (int) ((double) vector2.X - dxStrength1 * 0.5); int num27 = (int) ((double) vector2.X + dxStrength1 * 0.5); @@ -20833,9 +14987,8 @@ label_296: { for (int index18 = num28; index18 < num29; ++index18) { - Main.tile[index17, index18].liquid = (byte) 0; Main.tile[index17, index18].active(false); - Main.tile[index17, index18].wall = (ushort) wallType; + Main.tile[index17, index18].wall = (byte) wallType; } } int x = (int) vector2.X; @@ -20845,17 +14998,17 @@ label_296: int index21 = (int) vector2.X - index20; if (!Main.tile[index21, index19].active() && Main.wallDungeon[(int) Main.tile[index21, index19].wall]) { - WorldGen.dungeonPlatformX[WorldGen.numDungeonPlatforms] = index21; - WorldGen.dungeonPlatformY[WorldGen.numDungeonPlatforms] = index19; - ++WorldGen.numDungeonPlatforms; + WorldGen.DPlatX[WorldGen.numDPlats] = index21; + WorldGen.DPlatY[WorldGen.numDPlats] = index19; + ++WorldGen.numDPlats; break; } int index22 = (int) vector2.X + index20; if (!Main.tile[index22, index19].active() && Main.wallDungeon[(int) Main.tile[index22, index19].wall]) { - WorldGen.dungeonPlatformX[WorldGen.numDungeonPlatforms] = index22; - WorldGen.dungeonPlatformY[WorldGen.numDungeonPlatforms] = index19; - ++WorldGen.numDungeonPlatforms; + WorldGen.DPlatX[WorldGen.numDPlats] = index22; + WorldGen.DPlatY[WorldGen.numDPlats] = index19; + ++WorldGen.numDPlats; break; } } @@ -20881,7 +15034,6 @@ label_296: { for (int index24 = num32; index24 < num33; ++index24) { - Main.tile[index23, index24].liquid = (byte) 0; if ((int) Main.tile[index23, index24].wall != wallType) { bool flag = true; @@ -20894,10 +15046,9 @@ label_296: flag = false; if (flag) { - Main.tile[index23, index24].wall = (ushort) 0; + Main.tile[index23, index24].wall = (byte) 0; Main.tile[index23, index24].active(true); Main.tile[index23, index24].type = tileType; - Main.tile[index23, index24].Clear(TileDataType.Slope); } } } @@ -20906,14 +15057,12 @@ label_296: { for (int index26 = num33; (double) index26 < Main.worldSurface; ++index26) { - Main.tile[index25, index26].liquid = (byte) 0; if (!Main.wallDungeon[(int) Main.tile[index25, index26].wall]) { Main.tile[index25, index26].active(true); Main.tile[index25, index26].type = tileType; } - Main.tile[index25, index26].wall = (ushort) wallType; - Main.tile[index25, index26].Clear(TileDataType.Slope); + Main.tile[index25, index26].wall = (byte) wallType; } } int num34 = (int) ((double) vector2.X - dxStrength2 * 0.5); @@ -20928,12 +15077,10 @@ label_296: { for (int index28 = num38; index28 < num39; ++index28) { - Main.tile[index27, index28].liquid = (byte) 0; if ((int) Main.tile[index27, index28].wall != wallType) { Main.tile[index27, index28].active(true); Main.tile[index27, index28].type = tileType; - Main.tile[index27, index28].Clear(TileDataType.Slope); } } } @@ -20945,12 +15092,10 @@ label_296: { for (int index30 = num42; index30 < num43; ++index30) { - Main.tile[index29, index30].liquid = (byte) 0; if ((int) Main.tile[index29, index30].wall != wallType) { Main.tile[index29, index30].active(true); Main.tile[index29, index30].type = tileType; - Main.tile[index29, index30].Clear(TileDataType.Slope); } } } @@ -20963,12 +15108,10 @@ label_296: { for (int index32 = num32 - num44; index32 < num32; ++index32) { - Main.tile[index31, index32].liquid = (byte) 0; if ((int) Main.tile[index31, index32].wall != wallType) { Main.tile[index31, index32].active(true); Main.tile[index31, index32].type = tileType; - Main.tile[index31, index32].Clear(TileDataType.Slope); } } ++num46; @@ -20978,191 +15121,133 @@ label_296: num46 = 0; } } - if (!WorldGen.drunkWorldGen) + int num47 = (int) ((double) vector2.X - dxStrength2 * 0.6); + int num48 = (int) ((double) vector2.X + dxStrength2 * 0.6); + int num49 = (int) ((double) vector2.Y - dyStrength2 * 0.6); + int num50 = (int) ((double) vector2.Y + dyStrength2 * 0.6); + if (num47 < 0) + num47 = 0; + if (num48 > Main.maxTilesX) + num48 = Main.maxTilesX; + if (num49 < 0) + num49 = 0; + if (num50 > Main.maxTilesY) + num50 = Main.maxTilesY; + for (int index33 = num47; index33 < num48; ++index33) { - int num47 = (int) ((double) vector2.X - dxStrength2 * 0.6); - int num48 = (int) ((double) vector2.X + dxStrength2 * 0.6); - int num49 = (int) ((double) vector2.Y - dyStrength2 * 0.6); - int num50 = (int) ((double) vector2.Y + dyStrength2 * 0.6); - if (num47 < 0) - num47 = 0; - if (num48 > Main.maxTilesX) - num48 = Main.maxTilesX; - if (num49 < 0) - num49 = 0; - if (num50 > Main.maxTilesY) - num50 = Main.maxTilesY; - for (int index33 = num47; index33 < num48; ++index33) - { - for (int index34 = num49; index34 < num50; ++index34) - { - Main.tile[index33, index34].liquid = (byte) 0; - Main.tile[index33, index34].wall = (ushort) 0; - } - } + for (int index34 = num49; index34 < num50; ++index34) + Main.tile[index33, index34].wall = (byte) 0; } int num51 = (int) ((double) vector2.X - dxStrength2 * 0.5); int num52 = (int) ((double) vector2.X + dxStrength2 * 0.5); int num53 = (int) ((double) vector2.Y - dyStrength2 * 0.5); - int num54 = (int) ((double) vector2.Y + dyStrength2 * 0.5); + int index35 = (int) ((double) vector2.Y + dyStrength2 * 0.5); if (num51 < 0) num51 = 0; if (num52 > Main.maxTilesX) num52 = Main.maxTilesX; if (num53 < 0) num53 = 0; - if (num54 > Main.maxTilesY) - num54 = Main.maxTilesY; - for (int index35 = num51; index35 < num52; ++index35) + if (index35 > Main.maxTilesY) + index35 = Main.maxTilesY; + for (int index36 = num51; index36 < num52; ++index36) { - for (int index36 = num53; index36 < num54; ++index36) + for (int index37 = num53; index37 < index35; ++index37) { - Main.tile[index35, index36].liquid = (byte) 0; - Main.tile[index35, index36].active(false); - Main.tile[index35, index36].wall = (ushort) 0; + Main.tile[index36, index37].active(false); + Main.tile[index36, index37].wall = (byte) 0; + } + } + for (int index38 = num51; index38 < num52; ++index38) + { + if (!Main.tile[index38, index35].active()) + { + Main.tile[index38, index35].active(true); + Main.tile[index38, index35].type = (ushort) 19; + if (wallType == 7) + Main.tile[index38, index35].frameY = (short) 108; + if (wallType == 8) + Main.tile[index38, index35].frameY = (short) 144; + if (wallType == 9) + Main.tile[index38, index35].frameY = (short) 126; } } Main.dungeonX = (int) vector2.X; - Main.dungeonY = num54; - int index37 = NPC.NewNPC(Main.dungeonX * 16 + 8, Main.dungeonY * 16, 37); - Main.npc[index37].homeless = false; - Main.npc[index37].homeTileX = Main.dungeonX; - Main.npc[index37].homeTileY = Main.dungeonY; - if (WorldGen.drunkWorldGen) + Main.dungeonY = index35; + int index39 = NPC.NewNPC(Main.dungeonX * 16 + 8, Main.dungeonY * 16, 37); + Main.npc[index39].homeless = false; + Main.npc[index39].homeTileX = Main.dungeonX; + Main.npc[index39].homeTileY = Main.dungeonY; + if (num2 == 1) { - int worldSurface = (int) Main.worldSurface; - while (Main.tile[WorldGen.dungeonX, worldSurface].active() || Main.tile[WorldGen.dungeonX, worldSurface].wall > (ushort) 0 || Main.tile[WorldGen.dungeonX, worldSurface - 1].active() || Main.tile[WorldGen.dungeonX, worldSurface - 1].wall > (ushort) 0 || Main.tile[WorldGen.dungeonX, worldSurface - 2].active() || Main.tile[WorldGen.dungeonX, worldSurface - 2].wall > (ushort) 0 || Main.tile[WorldGen.dungeonX, worldSurface - 3].active() || Main.tile[WorldGen.dungeonX, worldSurface - 3].wall > (ushort) 0 || Main.tile[WorldGen.dungeonX, worldSurface - 4].active() || Main.tile[WorldGen.dungeonX, worldSurface - 4].wall > (ushort) 0) + int num54 = 0; + for (int index40 = num52; index40 < num52 + 50; ++index40) { - --worldSurface; - if (worldSurface < 50) - break; - } - if (worldSurface > 50) - WorldGen.GrowDungeonTree(WorldGen.dungeonX, worldSurface); - } - if (!WorldGen.drunkWorldGen) - { - int num55 = 100; - if (num2 == 1) - { - int num56 = 0; - for (int index38 = num52; index38 < num52 + num55; ++index38) + ++num54; + for (int index41 = index35 + num54; index41 < index35 + 50; ++index41) { - ++num56; - for (int index39 = num54 + num56; index39 < num54 + num55; ++index39) + if (!Main.wallDungeon[(int) Main.tile[index40, index41].wall]) { - Main.tile[index38, index39].liquid = (byte) 0; - Main.tile[index38, index39 - 1].liquid = (byte) 0; - Main.tile[index38, index39 - 2].liquid = (byte) 0; - Main.tile[index38, index39 - 3].liquid = (byte) 0; - if (!Main.wallDungeon[(int) Main.tile[index38, index39].wall] && Main.tile[index38, index39].wall != (ushort) 3 && Main.tile[index38, index39].wall != (ushort) 83) - { - Main.tile[index38, index39].active(true); - Main.tile[index38, index39].type = tileType; - Main.tile[index38, index39].Clear(TileDataType.Slope); - } + Main.tile[index40, index41].active(true); + Main.tile[index40, index41].type = tileType; } } } - else - { - int num57 = 0; - for (int index40 = num51; index40 > num51 - num55; --index40) - { - ++num57; - for (int index41 = num54 + num57; index41 < num54 + num55; ++index41) - { - Main.tile[index40, index41].liquid = (byte) 0; - Main.tile[index40, index41 - 1].liquid = (byte) 0; - Main.tile[index40, index41 - 2].liquid = (byte) 0; - Main.tile[index40, index41 - 3].liquid = (byte) 0; - if (!Main.wallDungeon[(int) Main.tile[index40, index41].wall] && Main.tile[index40, index41].wall != (ushort) 3 && Main.tile[index40, index41].wall != (ushort) 83) - { - Main.tile[index40, index41].active(true); - Main.tile[index40, index41].type = tileType; - Main.tile[index40, index41].Clear(TileDataType.Slope); - } - } - } - } - } - int num58 = 1 + WorldGen.genRand.Next(2); - int num59 = 2 + WorldGen.genRand.Next(4); - int num60 = 0; - int num61 = (int) ((double) vector2.X - dxStrength2 * 0.5); - int num62 = (int) ((double) vector2.X + dxStrength2 * 0.5); - int num63; - int num64; - if (WorldGen.drunkWorldGen) - { - if (num2 == 1) - { - num63 = num62 - 1; - num64 = num61 - 1; - } - else - { - num64 = num61 + 1; - num63 = num62 + 1; - } } else { - num64 = num61 + 2; - num63 = num62 - 2; - } - for (int i1 = num64; i1 < num63; ++i1) - { - for (int j1 = num53; j1 < num54 + 1; ++j1) - WorldGen.PlaceWall(i1, j1, wallType, true); - if (!WorldGen.drunkWorldGen) + int num55 = 0; + for (int index42 = num51; index42 > num51 - 50; --index42) { - ++num60; - if (num60 >= num59) + ++num55; + for (int index43 = index35 + num55; index43 < index35 + 50; ++index43) { - i1 += num59 * 2; - num60 = 0; + if (!Main.wallDungeon[(int) Main.tile[index42, index43].wall]) + { + Main.tile[index42, index43].active(true); + Main.tile[index42, index43].type = tileType; + } } } } - if (WorldGen.drunkWorldGen) + int num56 = 1 + WorldGen.genRand.Next(2); + int num57 = 2 + WorldGen.genRand.Next(4); + int num58 = 0; + int num59 = (int) ((double) vector2.X - dxStrength2 * 0.5); + int num60 = (int) ((double) vector2.X + dxStrength2 * 0.5); + int num61 = num59 + 2; + int num62 = num60 - 2; + for (int i1 = num61; i1 < num62; ++i1) { - int num65 = (int) ((double) vector2.X - dxStrength2 * 0.5); - int num66 = (int) ((double) vector2.X + dxStrength2 * 0.5); - if (num2 == 1) - num65 = num66 - 3; - else - num66 = num65 + 3; - for (int index42 = num65; index42 < num66; ++index42) + for (int j1 = num53; j1 < index35; ++j1) + WorldGen.PlaceWall(i1, j1, wallType, true); + ++num58; + if (num58 >= num57) { - for (int index43 = num53; index43 < num54 + 1; ++index43) - { - Main.tile[index42, index43].active(true); - Main.tile[index42, index43].type = tileType; - Main.tile[index42, index43].Clear(TileDataType.Slope); - } + i1 += num57 * 2; + num58 = 0; } } vector2.X -= (float) (dxStrength2 * 0.600000023841858) * (float) num2; vector2.Y += (float) dyStrength2 * 0.5f; - double num67 = 15.0; - double num68 = 3.0; - vector2.Y -= (float) num68 * 0.5f; - int num69 = (int) ((double) vector2.X - num67 * 0.5); - int num70 = (int) ((double) vector2.X + num67 * 0.5); - int num71 = (int) ((double) vector2.Y - num68 * 0.5); - int num72 = (int) ((double) vector2.Y + num68 * 0.5); - if (num69 < 0) - num69 = 0; - if (num70 > Main.maxTilesX) - num70 = Main.maxTilesX; - if (num71 < 0) - num71 = 0; - if (num72 > Main.maxTilesY) - num72 = Main.maxTilesY; - for (int index44 = num69; index44 < num70; ++index44) + double num63 = 15.0; + double num64 = 3.0; + vector2.Y -= (float) num64 * 0.5f; + int num65 = (int) ((double) vector2.X - num63 * 0.5); + int num66 = (int) ((double) vector2.X + num63 * 0.5); + int num67 = (int) ((double) vector2.Y - num64 * 0.5); + int num68 = (int) ((double) vector2.Y + num64 * 0.5); + if (num65 < 0) + num65 = 0; + if (num66 > Main.maxTilesX) + num66 = Main.maxTilesX; + if (num67 < 0) + num67 = 0; + if (num68 > Main.maxTilesY) + num68 = Main.maxTilesY; + for (int index44 = num65; index44 < num66; ++index44) { - for (int index45 = num71; index45 < num72; ++index45) + for (int index45 = num67; index45 < num68; ++index45) Main.tile[index44, index45].active(false); } if (num2 < 0) @@ -21179,122 +15264,35 @@ label_296: return WorldGen.AddBuriedChest(point.X, point.Y, contain, notNearOtherChests, Style); } - public static bool IsChestRigged(int x, int y) => Main.tile[x, y].type == (ushort) 467 && (int) Main.tile[x, y].frameX / 36 == 4; - - private static bool IsUndergroundDesert(int x, int y) - { - if ((double) y < Main.worldSurface || (double) x < (double) Main.maxTilesX * 0.15 || (double) x > (double) Main.maxTilesX * 0.85) - return false; - int num = 15; - for (int index1 = x - num; index1 <= x + num; ++index1) - { - for (int index2 = y - num; index2 <= y + num; ++index2) - { - if (Main.tile[index1, index2].wall == (ushort) 187 || Main.tile[index1, index2].wall == (ushort) 216) - return true; - } - } - return false; - } - - private static bool IsDungeon(int x, int y) => (double) y >= Main.worldSurface && x >= 0 && x <= Main.maxTilesX && Main.wallDungeon[(int) Main.tile[x, y].wall]; - public static bool AddBuriedChest( int i, int j, int contain = 0, bool notNearOtherChests = false, - int Style = -1, - bool trySlope = false, - ushort chestTileType = 0) + int Style = -1) { - if (chestTileType == (ushort) 0) - chestTileType = (ushort) 21; bool flag1 = false; bool flag2 = false; - bool flag3 = false; - bool flag4 = false; - bool flag5 = false; - bool flag6 = false; - bool flag7 = false; - bool flag8 = false; - int maxValue = 15; - for (int index1 = j; index1 < Main.maxTilesY - 10; ++index1) + for (int j1 = j; j1 < Main.maxTilesY; ++j1) { - int num1 = -1; - int num2 = -1; - if (trySlope && Main.tile[i, index1].active() && Main.tileSolid[(int) Main.tile[i, index1].type] && !Main.tileSolidTop[(int) Main.tile[i, index1].type]) + if (WorldGen.SolidTile(i, j1)) { - if (Style == 17) + bool flag3 = false; + int num1 = i; + int num2 = j1; + int style = 0; + if ((double) num2 >= Main.worldSurface + 25.0 || contain > 0) { - int num3 = 30; - for (int x = i - num3; x <= i + num3; ++x) + style = 1; + if (Style == 10 || contain == 211 || contain == 212 || contain == 213 || contain == 753) { - for (int y = index1 - num3; y <= index1 + num3; ++y) - { - if (!WorldGen.InWorld(x, y, 5) || Main.tile[x, y].active() && (Main.tile[x, y].type == (ushort) 21 || Main.tile[x, y].type == (ushort) 467)) - return false; - } + style = 10; + flag2 = true; } } - if (Main.tile[i - 1, index1].topSlope()) - { - num1 = (int) Main.tile[i - 1, index1].slope(); - Main.tile[i - 1, index1].slope((byte) 0); - } - if (Main.tile[i, index1].topSlope()) - { - num2 = (int) Main.tile[i, index1].slope(); - Main.tile[i, index1].slope((byte) 0); - } - } - int num4 = 2; - for (int index2 = i - num4; index2 <= i + num4; ++index2) - { - for (int index3 = index1 - num4; index3 <= index1 + num4; ++index3) - { - if (Main.tile[index2, index3].active() && (TileID.Sets.Boulders[(int) Main.tile[index2, index3].type] || Main.tile[index2, index3].type == (ushort) 26 || Main.tile[index2, index3].type == (ushort) 237)) - return false; - } - } - if (WorldGen.SolidTile(i, index1)) - { - bool flag9 = false; - int num5 = i; - int num6 = index1; - int style = 0; - if ((double) num6 >= Main.worldSurface + 25.0 || contain > 0) - style = 1; if (Style >= 0) style = Style; - if (contain == 0 && (double) num6 >= Main.worldSurface + 25.0 && num6 <= Main.maxTilesY - 205 && WorldGen.IsUndergroundDesert(i, index1)) - { - flag2 = true; - style = 10; - chestTileType = (ushort) 467; - int num7 = -1; - int num8 = -1; - for (int index4 = (int) Main.worldSurface - 100; index4 < Main.maxTilesY - 200; ++index4) - { - for (int index5 = 100; index5 < Main.maxTilesX - 100; ++index5) - { - if (Main.tile[index5, index4].wall == (ushort) 216 || Main.tile[index5, index4].wall == (ushort) 187) - { - if (num7 == -1) - num7 = index4; - num8 = index4; - break; - } - } - } - if (num6 > (num7 * 3 + num8 * 4) / 7) - contain = (int) Utils.SelectRandom(WorldGen.genRand, (short) 4061, (short) 4062, (short) 4276); - else - contain = (int) Utils.SelectRandom(WorldGen.genRand, (short) 4056, (short) 4055, (short) 4262, (short) 4263); - if (WorldGen.getGoodWorldGen && WorldGen.genRand.Next(maxValue) == 0) - contain = 52; - } - if (chestTileType == (ushort) 21 && (style == 11 || contain == 0 && (double) num6 >= Main.worldSurface + 25.0 && num6 <= Main.maxTilesY - 205 && (Main.tile[i, index1].type == (ushort) 147 || Main.tile[i, index1].type == (ushort) 161 || Main.tile[i, index1].type == (ushort) 162))) + if (style == 11 || contain == 0 && (double) num2 >= Main.worldSurface + 25.0 && num2 <= Main.maxTilesY - 205 && (Main.tile[i, j1].type == (ushort) 147 || Main.tile[i, j1].type == (ushort) 161 || Main.tile[i, j1].type == (ushort) 162)) { flag1 = true; style = 11; @@ -21323,957 +15321,778 @@ label_296: contain = 997; if (WorldGen.genRand.Next(50) == 0) contain = 669; - if (WorldGen.getGoodWorldGen && WorldGen.genRand.Next(maxValue) == 0) - contain = 52; } - if (chestTileType == (ushort) 21 && (Style == 10 || contain == 211 || contain == 212 || contain == 213 || contain == 753)) + if (num2 > Main.maxTilesY - 205 && contain == 0) { - flag3 = true; - style = 10; - if (WorldGen.getGoodWorldGen && WorldGen.genRand.Next(maxValue) == 0) - contain = 52; - } - if (chestTileType == (ushort) 21 && num6 > Main.maxTilesY - 205 && contain == 0) - { - flag7 = true; - if (WorldGen.hellChest == WorldGen.hellChestItem[1]) + if (WorldGen.hellChest == WorldGen.hellChestItem[0]) + { + contain = 274; + style = 4; + flag3 = true; + } + else if (WorldGen.hellChest == WorldGen.hellChestItem[1]) { contain = 220; style = 4; - flag9 = true; + flag3 = true; } else if (WorldGen.hellChest == WorldGen.hellChestItem[2]) { contain = 112; style = 4; - flag9 = true; + flag3 = true; } else if (WorldGen.hellChest == WorldGen.hellChestItem[3]) { contain = 218; style = 4; - flag9 = true; - } - else if (WorldGen.hellChest == WorldGen.hellChestItem[4]) - { - contain = 274; - style = 4; - flag9 = true; - } - else if (WorldGen.hellChest == WorldGen.hellChestItem[5]) - { - contain = 3019; - style = 4; - flag9 = true; + flag3 = true; } else { - contain = 5010; + contain = 3019; style = 4; - flag9 = true; + flag3 = true; } - if (WorldGen.getGoodWorldGen && WorldGen.genRand.Next(maxValue) == 0) - contain = 52; } - if (chestTileType == (ushort) 21 && style == 17) + int index1 = WorldGen.PlaceChest(num1 - 1, num2 - 1, notNearOtherChests: notNearOtherChests, style: style); + if (index1 < 0) + return false; + if (flag3) { - flag4 = true; - if (WorldGen.getGoodWorldGen && WorldGen.genRand.Next(maxValue) == 0) - contain = 52; + ++WorldGen.hellChest; + if (WorldGen.hellChest > 4) + WorldGen.hellChest = 0; } - if (chestTileType == (ushort) 21 && style == 12) + int index2 = 0; + while (index2 == 0) { - flag5 = true; - if (WorldGen.getGoodWorldGen && WorldGen.genRand.Next(maxValue) == 0) - contain = 52; - } - if (chestTileType == (ushort) 21 && style == 32) - { - flag6 = true; - if (WorldGen.getGoodWorldGen && WorldGen.genRand.Next(maxValue) == 0) - contain = 52; - } - if (chestTileType == (ushort) 21 && style != 0 && WorldGen.IsDungeon(i, index1)) - { - flag8 = true; - if (WorldGen.getGoodWorldGen && WorldGen.genRand.Next(maxValue) == 0) - contain = 52; - } - int index6 = chestTileType != (ushort) 467 ? WorldGen.PlaceChest(num5 - 1, num6 - 1, chestTileType, notNearOtherChests, style) : WorldGen.PlaceChest(num5 - 1, num6 - 1, chestTileType, notNearOtherChests, style); - if (index6 >= 0) - { - if (flag9) + if (style == 0 && (double) num2 < Main.worldSurface + 25.0 || contain == 848) { - ++WorldGen.hellChest; - if (WorldGen.hellChest > 4) - WorldGen.hellChest = 0; + if (contain > 0) + { + Main.chest[index1].item[index2].SetDefaults(contain); + Main.chest[index1].item[index2].Prefix(-1); + switch (contain) + { + case 832: + ++index2; + Main.chest[index1].item[index2].SetDefaults(933); + break; + case 848: + ++index2; + Main.chest[index1].item[index2].SetDefaults(866); + break; + } + ++index2; + } + else + { + int num3 = WorldGen.genRand.Next(11); + if (num3 == 0) + { + Main.chest[index1].item[index2].SetDefaults(280); + Main.chest[index1].item[index2].Prefix(-1); + } + if (num3 == 1) + { + Main.chest[index1].item[index2].SetDefaults(281); + Main.chest[index1].item[index2].Prefix(-1); + } + if (num3 == 2) + { + Main.chest[index1].item[index2].SetDefaults(284); + Main.chest[index1].item[index2].Prefix(-1); + } + if (num3 == 3) + { + Main.chest[index1].item[index2].SetDefaults(282); + Main.chest[index1].item[index2].stack = WorldGen.genRand.Next(40, 75); + } + if (num3 == 4) + { + Main.chest[index1].item[index2].SetDefaults(279); + Main.chest[index1].item[index2].stack = WorldGen.genRand.Next(70, 150); + } + if (num3 == 5) + { + Main.chest[index1].item[index2].SetDefaults(285); + Main.chest[index1].item[index2].Prefix(-1); + } + if (num3 == 6) + { + Main.chest[index1].item[index2].SetDefaults(953); + Main.chest[index1].item[index2].Prefix(-1); + } + if (num3 == 7) + { + Main.chest[index1].item[index2].SetDefaults(946); + Main.chest[index1].item[index2].Prefix(-1); + } + if (num3 == 8) + { + Main.chest[index1].item[index2].SetDefaults(3068); + Main.chest[index1].item[index2].Prefix(-1); + } + if (num3 == 9) + { + Main.chest[index1].item[index2].SetDefaults(3069); + Main.chest[index1].item[index2].Prefix(-1); + } + if (num3 == 10) + { + Main.chest[index1].item[index2].SetDefaults(3084); + Main.chest[index1].item[index2].Prefix(-1); + } + ++index2; + } + if (WorldGen.genRand.Next(6) == 0) + { + Main.chest[index1].item[index2].SetDefaults(3093); + Main.chest[index1].item[index2].stack = 1; + if (WorldGen.genRand.Next(5) == 0) + Main.chest[index1].item[index2].stack += WorldGen.genRand.Next(2); + if (WorldGen.genRand.Next(10) == 0) + Main.chest[index1].item[index2].stack += WorldGen.genRand.Next(3); + ++index2; + } + if (WorldGen.genRand.Next(3) == 0) + { + Main.chest[index1].item[index2].SetDefaults(168); + Main.chest[index1].item[index2].stack = WorldGen.genRand.Next(3, 6); + ++index2; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num4 = WorldGen.genRand.Next(2); + int num5 = WorldGen.genRand.Next(8) + 3; + if (num4 == 0) + Main.chest[index1].item[index2].SetDefaults(WorldGen.copperBar); + if (num4 == 1) + Main.chest[index1].item[index2].SetDefaults(WorldGen.ironBar); + Main.chest[index1].item[index2].stack = num5; + ++index2; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num6 = WorldGen.genRand.Next(50, 101); + Main.chest[index1].item[index2].SetDefaults(965); + Main.chest[index1].item[index2].stack = num6; + ++index2; + } + if (WorldGen.genRand.Next(3) != 0) + { + int num7 = WorldGen.genRand.Next(2); + int num8 = WorldGen.genRand.Next(26) + 25; + if (num7 == 0) + Main.chest[index1].item[index2].SetDefaults(40); + if (num7 == 1) + Main.chest[index1].item[index2].SetDefaults(42); + Main.chest[index1].item[index2].stack = num8; + ++index2; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num9 = WorldGen.genRand.Next(1); + int num10 = WorldGen.genRand.Next(3) + 3; + if (num9 == 0) + Main.chest[index1].item[index2].SetDefaults(28); + Main.chest[index1].item[index2].stack = num10; + ++index2; + } + if (WorldGen.genRand.Next(3) != 0) + { + Main.chest[index1].item[index2].SetDefaults(2350); + Main.chest[index1].item[index2].stack = WorldGen.genRand.Next(2, 5); + ++index2; + } + if (WorldGen.genRand.Next(3) > 0) + { + int num11 = WorldGen.genRand.Next(6); + int num12 = WorldGen.genRand.Next(1, 3); + if (num11 == 0) + Main.chest[index1].item[index2].SetDefaults(292); + if (num11 == 1) + Main.chest[index1].item[index2].SetDefaults(298); + if (num11 == 2) + Main.chest[index1].item[index2].SetDefaults(299); + if (num11 == 3) + Main.chest[index1].item[index2].SetDefaults(290); + if (num11 == 4) + Main.chest[index1].item[index2].SetDefaults(2322); + if (num11 == 5) + Main.chest[index1].item[index2].SetDefaults(2325); + Main.chest[index1].item[index2].stack = num12; + ++index2; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num13 = WorldGen.genRand.Next(2); + int num14 = WorldGen.genRand.Next(11) + 10; + if (num13 == 0) + Main.chest[index1].item[index2].SetDefaults(8); + if (num13 == 1) + Main.chest[index1].item[index2].SetDefaults(31); + Main.chest[index1].item[index2].stack = num14; + ++index2; + } + if (WorldGen.genRand.Next(2) == 0) + { + Main.chest[index1].item[index2].SetDefaults(72); + Main.chest[index1].item[index2].stack = WorldGen.genRand.Next(10, 30); + ++index2; + } } - Chest chest = Main.chest[index6]; - int index7 = 0; - while (index7 == 0) + else if ((double) num2 < Main.rockLayer) { - if (style == 0 && (double) num6 < Main.worldSurface + 25.0 || contain == 848) + if (contain > 0) { - if (contain > 0) + if (contain == 832) { - chest.item[index7].SetDefaults(contain); - chest.item[index7].Prefix(-1); - ++index7; - switch (contain) - { - case 832: - chest.item[index7].SetDefaults(933); - ++index7; - if (WorldGen.genRand.Next(10) == 0) - { - int Type = WorldGen.genRand.Next(2); - switch (Type) - { - case 0: - Type = 4429; - break; - case 1: - Type = 4427; - break; - } - chest.item[index7].SetDefaults(Type); - ++index7; - break; - } - break; - case 848: - chest.item[index7].SetDefaults(866); - ++index7; - break; - } - } - else - { - int num9 = WorldGen.genRand.Next(12); - if (num9 == 0) - { - chest.item[index7].SetDefaults(280); - chest.item[index7].Prefix(-1); - } - if (num9 == 1) - { - chest.item[index7].SetDefaults(281); - chest.item[index7].Prefix(-1); - } - if (num9 == 2) - { - chest.item[index7].SetDefaults(284); - chest.item[index7].Prefix(-1); - } - if (num9 == 3) - { - chest.item[index7].SetDefaults(282); - chest.item[index7].stack = WorldGen.genRand.Next(40, 75); - } - if (num9 == 4) - { - chest.item[index7].SetDefaults(279); - chest.item[index7].stack = WorldGen.genRand.Next(150, 300); - } - if (num9 == 5) - { - chest.item[index7].SetDefaults(285); - chest.item[index7].Prefix(-1); - } - if (num9 == 6) - { - chest.item[index7].SetDefaults(953); - chest.item[index7].Prefix(-1); - } - if (num9 == 7) - { - chest.item[index7].SetDefaults(946); - chest.item[index7].Prefix(-1); - } - if (num9 == 8) - { - chest.item[index7].SetDefaults(3068); - chest.item[index7].Prefix(-1); - } - if (num9 == 9) - { - chest.item[index7].SetDefaults(3069); - chest.item[index7].Prefix(-1); - } - if (num9 == 10) - { - chest.item[index7].SetDefaults(3084); - chest.item[index7].Prefix(-1); - } - if (num9 == 11) - { - chest.item[index7].SetDefaults(4341); - chest.item[index7].Prefix(-1); - } - ++index7; - } - if (WorldGen.genRand.Next(6) == 0) - { - chest.item[index7].SetDefaults(3093); - chest.item[index7].stack = 1; - if (WorldGen.genRand.Next(5) == 0) - chest.item[index7].stack += WorldGen.genRand.Next(2); - if (WorldGen.genRand.Next(10) == 0) - chest.item[index7].stack += WorldGen.genRand.Next(3); - ++index7; - } - if (WorldGen.genRand.Next(6) == 0) - { - chest.item[index7].SetDefaults(4345); - chest.item[index7].stack = 1; - if (WorldGen.genRand.Next(5) == 0) - chest.item[index7].stack += WorldGen.genRand.Next(2); - if (WorldGen.genRand.Next(10) == 0) - chest.item[index7].stack += WorldGen.genRand.Next(3); - ++index7; - } - if (WorldGen.genRand.Next(3) == 0) - { - chest.item[index7].SetDefaults(168); - chest.item[index7].stack = WorldGen.genRand.Next(3, 6); - ++index7; - } - if (WorldGen.genRand.Next(2) == 0) - { - int num10 = WorldGen.genRand.Next(2); - int num11 = WorldGen.genRand.Next(8) + 3; - if (num10 == 0) - chest.item[index7].SetDefaults(WorldGen.copperBar); - if (num10 == 1) - chest.item[index7].SetDefaults(WorldGen.ironBar); - chest.item[index7].stack = num11; - ++index7; - } - if (WorldGen.genRand.Next(2) == 0) - { - int num12 = WorldGen.genRand.Next(50, 101); - chest.item[index7].SetDefaults(965); - chest.item[index7].stack = num12; - ++index7; - } - if (WorldGen.genRand.Next(3) != 0) - { - int num13 = WorldGen.genRand.Next(2); - int num14 = WorldGen.genRand.Next(26) + 25; - if (num13 == 0) - chest.item[index7].SetDefaults(40); - if (num13 == 1) - chest.item[index7].SetDefaults(42); - chest.item[index7].stack = num14; - ++index7; - } - if (WorldGen.genRand.Next(2) == 0) - { - int num15 = WorldGen.genRand.Next(3) + 3; - chest.item[index7].SetDefaults(28); - chest.item[index7].stack = num15; - ++index7; - } - if (WorldGen.genRand.Next(3) != 0) - { - chest.item[index7].SetDefaults(2350); - chest.item[index7].stack = WorldGen.genRand.Next(3, 6); - ++index7; - } - if (WorldGen.genRand.Next(3) > 0) - { - int num16 = WorldGen.genRand.Next(6); - int num17 = WorldGen.genRand.Next(1, 3); - if (num16 == 0) - chest.item[index7].SetDefaults(292); - if (num16 == 1) - chest.item[index7].SetDefaults(298); - if (num16 == 2) - chest.item[index7].SetDefaults(299); - if (num16 == 3) - chest.item[index7].SetDefaults(290); - if (num16 == 4) - chest.item[index7].SetDefaults(2322); - if (num16 == 5) - chest.item[index7].SetDefaults(2325); - chest.item[index7].stack = num17; - ++index7; - } - if (WorldGen.genRand.Next(2) == 0) - { - int num18 = WorldGen.genRand.Next(2); - int num19 = WorldGen.genRand.Next(11) + 10; - if (num18 == 0) - chest.item[index7].SetDefaults(8); - if (num18 == 1) - chest.item[index7].SetDefaults(31); - chest.item[index7].stack = num19; - ++index7; - } - if (WorldGen.genRand.Next(2) == 0) - { - chest.item[index7].SetDefaults(72); - chest.item[index7].stack = WorldGen.genRand.Next(10, 30); - ++index7; - } - if (WorldGen.genRand.Next(2) == 0) - { - chest.item[index7].SetDefaults(9); - chest.item[index7].stack = WorldGen.genRand.Next(50, 100); - ++index7; + Main.chest[index1].item[index2].SetDefaults(933); + ++index2; } + Main.chest[index1].item[index2].SetDefaults(contain); + Main.chest[index1].item[index2].Prefix(-1); + ++index2; } - else if ((double) num6 < Main.rockLayer) + else { - if (contain > 0) + int num15 = WorldGen.genRand.Next(7); + if (WorldGen.genRand.Next(20) == 0) { - if (contain == 832) - { - chest.item[index7].SetDefaults(933); - ++index7; - } - chest.item[index7].SetDefaults(contain); - chest.item[index7].Prefix(-1); - ++index7; - if (flag4 && WorldGen.genRand.Next(2) == 0) - { - chest.item[index7].SetDefaults(4460); - ++index7; - } - if (flag5 && WorldGen.genRand.Next(10) == 0) - { - int Type = WorldGen.genRand.Next(2); - switch (Type) - { - case 0: - Type = 4429; - break; - case 1: - Type = 4427; - break; - } - chest.item[index7].SetDefaults(Type); - ++index7; - } - if (flag8 && (!WorldGen.generatedShadowKey || WorldGen.genRand.Next(3) == 0)) - { - WorldGen.generatedShadowKey = true; - chest.item[index7].SetDefaults(329); - ++index7; - } + Main.chest[index1].item[index2].SetDefaults(997); + Main.chest[index1].item[index2].Prefix(-1); } else { - switch (WorldGen.genRand.Next(6)) + if (num15 == 0) { - case 0: - chest.item[index7].SetDefaults(49); - chest.item[index7].Prefix(-1); - break; - case 1: - chest.item[index7].SetDefaults(50); - chest.item[index7].Prefix(-1); - break; - case 2: - chest.item[index7].SetDefaults(53); - chest.item[index7].Prefix(-1); - break; - case 3: - chest.item[index7].SetDefaults(54); - chest.item[index7].Prefix(-1); - break; - case 4: - chest.item[index7].SetDefaults(5011); - chest.item[index7].Prefix(-1); - break; - default: - chest.item[index7].SetDefaults(975); - chest.item[index7].Prefix(-1); - break; + Main.chest[index1].item[index2].SetDefaults(49); + Main.chest[index1].item[index2].Prefix(-1); } - ++index7; - if (WorldGen.genRand.Next(20) == 0) + if (num15 == 1) { - chest.item[index7].SetDefaults(997); - chest.item[index7].Prefix(-1); - ++index7; + Main.chest[index1].item[index2].SetDefaults(50); + Main.chest[index1].item[index2].Prefix(-1); } - else if (WorldGen.genRand.Next(20) == 0) + if (num15 == 2) { - chest.item[index7].SetDefaults(930); - chest.item[index7].Prefix(-1); - int index8 = index7 + 1; - chest.item[index8].SetDefaults(931); - chest.item[index8].stack = WorldGen.genRand.Next(26) + 25; - index7 = index8 + 1; + Main.chest[index1].item[index2].SetDefaults(53); + Main.chest[index1].item[index2].Prefix(-1); } - if (flag6 && WorldGen.genRand.Next(2) == 0) + if (num15 == 3) { - chest.item[index7].SetDefaults(4450); - ++index7; + Main.chest[index1].item[index2].SetDefaults(54); + Main.chest[index1].item[index2].Prefix(-1); } - if (flag6 && WorldGen.genRand.Next(3) == 0) + if (num15 == 4) { - chest.item[index7].SetDefaults(4779); - int index9 = index7 + 1; - chest.item[index9].SetDefaults(4780); - int index10 = index9 + 1; - chest.item[index10].SetDefaults(4781); - index7 = index10 + 1; + Main.chest[index1].item[index2].SetDefaults(55); + Main.chest[index1].item[index2].Prefix(-1); + } + if (num15 == 5) + { + Main.chest[index1].item[index2].SetDefaults(975); + Main.chest[index1].item[index2].Prefix(-1); + } + if (num15 == 6) + { + Main.chest[index1].item[index2].SetDefaults(930); + Main.chest[index1].item[index2].Prefix(-1); + ++index2; + Main.chest[index1].item[index2].SetDefaults(931); + Main.chest[index1].item[index2].stack = WorldGen.genRand.Next(26) + 25; } } - if (flag2) - { - if (WorldGen.genRand.Next(3) == 0) - { - chest.item[index7].SetDefaults(4423); - chest.item[index7].stack = WorldGen.genRand.Next(10, 20); - ++index7; - } - } - else if (WorldGen.genRand.Next(3) == 0) - { - chest.item[index7].SetDefaults(166); - chest.item[index7].stack = WorldGen.genRand.Next(10, 20); - ++index7; - } - if (WorldGen.genRand.Next(5) == 0) - { - chest.item[index7].SetDefaults(52); - ++index7; - } - if (WorldGen.genRand.Next(3) == 0) - { - int num20 = WorldGen.genRand.Next(50, 101); - chest.item[index7].SetDefaults(965); - chest.item[index7].stack = num20; - ++index7; - } - if (WorldGen.genRand.Next(2) == 0) - { - int num21 = WorldGen.genRand.Next(2); - int num22 = WorldGen.genRand.Next(10) + 5; - if (num21 == 0) - chest.item[index7].SetDefaults(WorldGen.ironBar); - if (num21 == 1) - chest.item[index7].SetDefaults(WorldGen.silverBar); - chest.item[index7].stack = num22; - ++index7; - } - if (WorldGen.genRand.Next(2) == 0) - { - int num23 = WorldGen.genRand.Next(2); - int num24 = WorldGen.genRand.Next(25) + 25; - if (num23 == 0) - chest.item[index7].SetDefaults(40); - if (num23 == 1) - chest.item[index7].SetDefaults(42); - chest.item[index7].stack = num24; - ++index7; - } - if (WorldGen.genRand.Next(2) == 0) - { - int num25 = WorldGen.genRand.Next(3) + 3; - chest.item[index7].SetDefaults(28); - chest.item[index7].stack = num25; - ++index7; - } - if (WorldGen.genRand.Next(3) > 0) - { - int num26 = WorldGen.genRand.Next(9); - int num27 = WorldGen.genRand.Next(1, 3); - if (num26 == 0) - chest.item[index7].SetDefaults(289); - if (num26 == 1) - chest.item[index7].SetDefaults(298); - if (num26 == 2) - chest.item[index7].SetDefaults(299); - if (num26 == 3) - chest.item[index7].SetDefaults(290); - if (num26 == 4) - chest.item[index7].SetDefaults(303); - if (num26 == 5) - chest.item[index7].SetDefaults(291); - if (num26 == 6) - chest.item[index7].SetDefaults(304); - if (num26 == 7) - chest.item[index7].SetDefaults(2322); - if (num26 == 8) - chest.item[index7].SetDefaults(2329); - chest.item[index7].stack = num27; - ++index7; - } - if (WorldGen.genRand.Next(3) != 0) - { - int num28 = WorldGen.genRand.Next(2, 5); - chest.item[index7].SetDefaults(2350); - chest.item[index7].stack = num28; - ++index7; - } - if (WorldGen.genRand.Next(2) == 0) - { - int num29 = WorldGen.genRand.Next(11) + 10; - if (style == 11) - chest.item[index7].SetDefaults(974); - else - chest.item[index7].SetDefaults(8); - chest.item[index7].stack = num29; - ++index7; - } - if (WorldGen.genRand.Next(2) == 0) - { - chest.item[index7].SetDefaults(72); - chest.item[index7].stack = WorldGen.genRand.Next(50, 90); - ++index7; - } + ++index2; } - else if (num6 < Main.maxTilesY - 250) + if (WorldGen.genRand.Next(3) == 0) { - if (contain > 0) - { - chest.item[index7].SetDefaults(contain); - chest.item[index7].Prefix(-1); - ++index7; - if (flag1 && WorldGen.genRand.Next(5) == 0) - { - chest.item[index7].SetDefaults(3199); - ++index7; - } - if (flag2) - { - if (WorldGen.genRand.Next(7) == 0) - { - chest.item[index7].SetDefaults(4346); - ++index7; - } - if (WorldGen.genRand.Next(15) == 0) - { - chest.item[index7].SetDefaults(4066); - ++index7; - } - } - if (flag3 && WorldGen.genRand.Next(6) == 0) - { - Item[] objArray1 = chest.item; - int index11 = index7; - int num30 = index11 + 1; - objArray1[index11].SetDefaults(3360); - Item[] objArray2 = chest.item; - int index12 = num30; - index7 = index12 + 1; - objArray2[index12].SetDefaults(3361); - } - if (flag3 && WorldGen.genRand.Next(10) == 0) - chest.item[index7++].SetDefaults(4426); - if (flag4 && WorldGen.genRand.Next(2) == 0) - { - chest.item[index7].SetDefaults(4460); - ++index7; - } - if (flag8 && (!WorldGen.generatedShadowKey || WorldGen.genRand.Next(3) == 0)) - { - WorldGen.generatedShadowKey = true; - chest.item[index7].SetDefaults(329); - ++index7; - } - } + Main.chest[index1].item[index2].SetDefaults(166); + Main.chest[index1].item[index2].stack = WorldGen.genRand.Next(10, 20); + ++index2; + } + if (WorldGen.genRand.Next(5) == 0) + { + Main.chest[index1].item[index2].SetDefaults(52); + ++index2; + } + if (WorldGen.genRand.Next(3) == 0) + { + int num16 = WorldGen.genRand.Next(50, 101); + Main.chest[index1].item[index2].SetDefaults(965); + Main.chest[index1].item[index2].stack = num16; + ++index2; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num17 = WorldGen.genRand.Next(2); + int num18 = WorldGen.genRand.Next(10) + 5; + if (num17 == 0) + Main.chest[index1].item[index2].SetDefaults(WorldGen.ironBar); + if (num17 == 1) + Main.chest[index1].item[index2].SetDefaults(WorldGen.silverBar); + Main.chest[index1].item[index2].stack = num18; + ++index2; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num19 = WorldGen.genRand.Next(2); + int num20 = WorldGen.genRand.Next(25) + 25; + if (num19 == 0) + Main.chest[index1].item[index2].SetDefaults(40); + if (num19 == 1) + Main.chest[index1].item[index2].SetDefaults(42); + Main.chest[index1].item[index2].stack = num20; + ++index2; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num21 = WorldGen.genRand.Next(1); + int num22 = WorldGen.genRand.Next(3) + 3; + if (num21 == 0) + Main.chest[index1].item[index2].SetDefaults(28); + Main.chest[index1].item[index2].stack = num22; + ++index2; + } + if (WorldGen.genRand.Next(3) > 0) + { + int num23 = WorldGen.genRand.Next(9); + int num24 = WorldGen.genRand.Next(1, 3); + if (num23 == 0) + Main.chest[index1].item[index2].SetDefaults(289); + if (num23 == 1) + Main.chest[index1].item[index2].SetDefaults(298); + if (num23 == 2) + Main.chest[index1].item[index2].SetDefaults(299); + if (num23 == 3) + Main.chest[index1].item[index2].SetDefaults(290); + if (num23 == 4) + Main.chest[index1].item[index2].SetDefaults(303); + if (num23 == 5) + Main.chest[index1].item[index2].SetDefaults(291); + if (num23 == 6) + Main.chest[index1].item[index2].SetDefaults(304); + if (num23 == 7) + Main.chest[index1].item[index2].SetDefaults(2322); + if (num23 == 8) + Main.chest[index1].item[index2].SetDefaults(2329); + Main.chest[index1].item[index2].stack = num24; + ++index2; + } + if (WorldGen.genRand.Next(3) != 0) + { + int num25 = WorldGen.genRand.Next(1, 3); + Main.chest[index1].item[index2].SetDefaults(2350); + Main.chest[index1].item[index2].stack = num25; + ++index2; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num26 = WorldGen.genRand.Next(11) + 10; + if (style == 11) + Main.chest[index1].item[index2].SetDefaults(974); else + Main.chest[index1].item[index2].SetDefaults(8); + Main.chest[index1].item[index2].stack = num26; + ++index2; + } + if (WorldGen.genRand.Next(2) == 0) + { + Main.chest[index1].item[index2].SetDefaults(72); + Main.chest[index1].item[index2].stack = WorldGen.genRand.Next(50, 90); + ++index2; + } + } + else if (num2 < Main.maxTilesY - 250) + { + if (contain > 0) + { + Main.chest[index1].item[index2].SetDefaults(contain); + Main.chest[index1].item[index2].Prefix(-1); + ++index2; + if (flag1 && WorldGen.genRand.Next(5) == 0) { - int num31 = WorldGen.genRand.Next(7); - if (WorldGen.genRand.Next(40) == 0 && num6 > WorldGen.lavaLine) - { - chest.item[index7].SetDefaults(906); - chest.item[index7].Prefix(-1); - } - else if (WorldGen.genRand.Next(15) == 0) - { - chest.item[index7].SetDefaults(997); - chest.item[index7].Prefix(-1); - } - else - { - if (num31 == 0) - { - chest.item[index7].SetDefaults(49); - chest.item[index7].Prefix(-1); - } - if (num31 == 1) - { - chest.item[index7].SetDefaults(50); - chest.item[index7].Prefix(-1); - } - if (num31 == 2) - { - chest.item[index7].SetDefaults(53); - chest.item[index7].Prefix(-1); - } - if (num31 == 3) - { - chest.item[index7].SetDefaults(54); - chest.item[index7].Prefix(-1); - } - if (num31 == 4) - { - chest.item[index7].SetDefaults(5011); - chest.item[index7].Prefix(-1); - } - if (num31 == 5) - { - chest.item[index7].SetDefaults(975); - chest.item[index7].Prefix(-1); - } - if (num31 == 6) - { - chest.item[index7].SetDefaults(930); - chest.item[index7].Prefix(-1); - ++index7; - chest.item[index7].SetDefaults(931); - chest.item[index7].stack = WorldGen.genRand.Next(26) + 25; - } - } - ++index7; - if (flag6 && WorldGen.genRand.Next(2) == 0) - { - chest.item[index7].SetDefaults(4450); - ++index7; - } - if (flag6 && WorldGen.genRand.Next(3) == 0) - { - chest.item[index7].SetDefaults(4779); - int index13 = index7 + 1; - chest.item[index13].SetDefaults(4780); - int index14 = index13 + 1; - chest.item[index14].SetDefaults(4781); - index7 = index14 + 1; - } + Main.chest[index1].item[index2].SetDefaults(3199); + ++index2; } - if (WorldGen.genRand.Next(5) == 0) + if (flag2 && WorldGen.genRand.Next(6) == 0) { - chest.item[index7].SetDefaults(43); - ++index7; - } - if (WorldGen.genRand.Next(3) == 0) - { - chest.item[index7].SetDefaults(167); - ++index7; - } - if (WorldGen.genRand.Next(4) == 0) - { - chest.item[index7].SetDefaults(51); - chest.item[index7].stack = WorldGen.genRand.Next(26) + 25; - ++index7; - } - if (WorldGen.genRand.Next(2) == 0) - { - int num32 = WorldGen.genRand.Next(2); - int num33 = WorldGen.genRand.Next(8) + 3; - if (num32 == 0) - chest.item[index7].SetDefaults(WorldGen.goldBar); - if (num32 == 1) - chest.item[index7].SetDefaults(WorldGen.silverBar); - chest.item[index7].stack = num33; - ++index7; - } - if (WorldGen.genRand.Next(2) == 0) - { - int num34 = WorldGen.genRand.Next(2); - int num35 = WorldGen.genRand.Next(26) + 25; - if (num34 == 0) - chest.item[index7].SetDefaults(41); - if (num34 == 1) - chest.item[index7].SetDefaults(279); - chest.item[index7].stack = num35; - ++index7; - } - if (WorldGen.genRand.Next(2) == 0) - { - int num36 = WorldGen.genRand.Next(3) + 3; - chest.item[index7].SetDefaults(188); - chest.item[index7].stack = num36; - ++index7; - } - if (WorldGen.genRand.Next(3) > 0) - { - int num37 = WorldGen.genRand.Next(6); - int num38 = WorldGen.genRand.Next(1, 3); - if (num37 == 0) - chest.item[index7].SetDefaults(296); - if (num37 == 1) - chest.item[index7].SetDefaults(295); - if (num37 == 2) - chest.item[index7].SetDefaults(299); - if (num37 == 3) - chest.item[index7].SetDefaults(302); - if (num37 == 4) - chest.item[index7].SetDefaults(303); - if (num37 == 5) - chest.item[index7].SetDefaults(305); - chest.item[index7].stack = num38; - ++index7; - } - if (WorldGen.genRand.Next(3) > 1) - { - int num39 = WorldGen.genRand.Next(6); - int num40 = WorldGen.genRand.Next(1, 3); - if (num39 == 0) - chest.item[index7].SetDefaults(301); - if (num39 == 1) - chest.item[index7].SetDefaults(297); - if (num39 == 2) - chest.item[index7].SetDefaults(304); - if (num39 == 3) - chest.item[index7].SetDefaults(2329); - if (num39 == 4) - chest.item[index7].SetDefaults(2351); - if (num39 == 5) - chest.item[index7].SetDefaults(2326); - chest.item[index7].stack = num40; - ++index7; - } - if (WorldGen.genRand.Next(2) == 0) - { - int num41 = WorldGen.genRand.Next(2, 5); - chest.item[index7].SetDefaults(2350); - chest.item[index7].stack = num41; - ++index7; - } - if (WorldGen.genRand.Next(2) == 0) - { - int num42 = WorldGen.genRand.Next(2); - int num43 = WorldGen.genRand.Next(15) + 15; - if (num42 == 0) - { - if (style == 11) - chest.item[index7].SetDefaults(974); - else - chest.item[index7].SetDefaults(8); - } - if (num42 == 1) - chest.item[index7].SetDefaults(282); - chest.item[index7].stack = num43; - ++index7; - } - if (WorldGen.genRand.Next(2) == 0) - { - chest.item[index7].SetDefaults(73); - chest.item[index7].stack = WorldGen.genRand.Next(1, 3); - ++index7; + Item[] objArray1 = Main.chest[index1].item; + int index3 = index2; + int num27 = index3 + 1; + objArray1[index3].SetDefaults(3360); + Item[] objArray2 = Main.chest[index1].item; + int index4 = num27; + index2 = index4 + 1; + objArray2[index4].SetDefaults(3361); } } else { - if (contain > 0) + int num28 = WorldGen.genRand.Next(7); + if (WorldGen.genRand.Next(40) == 0) { - chest.item[index7].SetDefaults(contain); - chest.item[index7].Prefix(-1); - ++index7; - if (flag7 && WorldGen.genRand.Next(10) == 0) - { - chest.item[index7].SetDefaults(4443); - ++index7; - } - if (flag7 && WorldGen.genRand.Next(10) == 0) - { - chest.item[index7].SetDefaults(4737); - ++index7; - } - else if (flag7 && WorldGen.genRand.Next(10) == 0) - { - chest.item[index7].SetDefaults(4551); - ++index7; - } + Main.chest[index1].item[index2].SetDefaults(906); + Main.chest[index1].item[index2].Prefix(-1); + } + else if (WorldGen.genRand.Next(15) == 0) + { + Main.chest[index1].item[index2].SetDefaults(997); + Main.chest[index1].item[index2].Prefix(-1); } else { - int num44 = WorldGen.genRand.Next(4); - if (num44 == 0) + if (num28 == 0) { - chest.item[index7].SetDefaults(49); - chest.item[index7].Prefix(-1); + Main.chest[index1].item[index2].SetDefaults(49); + Main.chest[index1].item[index2].Prefix(-1); } - if (num44 == 1) + if (num28 == 1) { - chest.item[index7].SetDefaults(50); - chest.item[index7].Prefix(-1); + Main.chest[index1].item[index2].SetDefaults(50); + Main.chest[index1].item[index2].Prefix(-1); } - if (num44 == 2) + if (num28 == 2) { - chest.item[index7].SetDefaults(53); - chest.item[index7].Prefix(-1); + Main.chest[index1].item[index2].SetDefaults(53); + Main.chest[index1].item[index2].Prefix(-1); } - if (num44 == 3) + if (num28 == 3) { - chest.item[index7].SetDefaults(54); - chest.item[index7].Prefix(-1); + Main.chest[index1].item[index2].SetDefaults(54); + Main.chest[index1].item[index2].Prefix(-1); } - ++index7; - } - if (WorldGen.genRand.Next(3) == 0) - { - chest.item[index7].SetDefaults(167); - ++index7; - } - if (WorldGen.genRand.Next(2) == 0) - { - int num45 = WorldGen.genRand.Next(2); - int num46 = WorldGen.genRand.Next(15) + 15; - if (num45 == 0) - chest.item[index7].SetDefaults(117); - if (num45 == 1) - chest.item[index7].SetDefaults(WorldGen.goldBar); - chest.item[index7].stack = num46; - ++index7; - } - if (WorldGen.genRand.Next(2) == 0) - { - int num47 = WorldGen.genRand.Next(2); - int num48 = WorldGen.genRand.Next(25) + 50; - if (num47 == 0) - chest.item[index7].SetDefaults(265); - if (num47 == 1) + if (num28 == 4) { - if (WorldGen.SavedOreTiers.Silver == 168) - chest.item[index7].SetDefaults(4915); - else - chest.item[index7].SetDefaults(278); + Main.chest[index1].item[index2].SetDefaults(55); + Main.chest[index1].item[index2].Prefix(-1); + } + if (num28 == 5) + { + Main.chest[index1].item[index2].SetDefaults(975); + Main.chest[index1].item[index2].Prefix(-1); + } + if (num28 == 6) + { + Main.chest[index1].item[index2].SetDefaults(930); + Main.chest[index1].item[index2].Prefix(-1); + ++index2; + Main.chest[index1].item[index2].SetDefaults(931); + Main.chest[index1].item[index2].stack = WorldGen.genRand.Next(26) + 25; } - chest.item[index7].stack = num48; - ++index7; - } - if (WorldGen.genRand.Next(2) == 0) - { - int num49 = WorldGen.genRand.Next(6) + 15; - chest.item[index7].SetDefaults(227); - chest.item[index7].stack = num49; - ++index7; - } - if (WorldGen.genRand.Next(4) > 0) - { - int num50 = WorldGen.genRand.Next(8); - int num51 = WorldGen.genRand.Next(1, 3); - if (num50 == 0) - chest.item[index7].SetDefaults(296); - if (num50 == 1) - chest.item[index7].SetDefaults(295); - if (num50 == 2) - chest.item[index7].SetDefaults(293); - if (num50 == 3) - chest.item[index7].SetDefaults(288); - if (num50 == 4) - chest.item[index7].SetDefaults(294); - if (num50 == 5) - chest.item[index7].SetDefaults(297); - if (num50 == 6) - chest.item[index7].SetDefaults(304); - if (num50 == 7) - chest.item[index7].SetDefaults(2323); - chest.item[index7].stack = num51; - ++index7; - } - if (WorldGen.genRand.Next(3) > 0) - { - int num52 = WorldGen.genRand.Next(8); - int num53 = WorldGen.genRand.Next(1, 3); - if (num52 == 0) - chest.item[index7].SetDefaults(305); - if (num52 == 1) - chest.item[index7].SetDefaults(301); - if (num52 == 2) - chest.item[index7].SetDefaults(302); - if (num52 == 3) - chest.item[index7].SetDefaults(288); - if (num52 == 4) - chest.item[index7].SetDefaults(300); - if (num52 == 5) - chest.item[index7].SetDefaults(2351); - if (num52 == 6) - chest.item[index7].SetDefaults(2348); - if (num52 == 7) - chest.item[index7].SetDefaults(2345); - chest.item[index7].stack = num53; - ++index7; - } - if (WorldGen.genRand.Next(3) == 0) - { - int num54 = WorldGen.genRand.Next(1, 3); - if (WorldGen.genRand.Next(2) == 0) - chest.item[index7].SetDefaults(2350); - else - chest.item[index7].SetDefaults(4870); - chest.item[index7].stack = num54; - ++index7; - } - if (WorldGen.genRand.Next(2) == 0) - { - int num55 = WorldGen.genRand.Next(2); - int num56 = WorldGen.genRand.Next(15) + 15; - if (num55 == 0) - chest.item[index7].SetDefaults(8); - if (num55 == 1) - chest.item[index7].SetDefaults(282); - chest.item[index7].stack = num56; - ++index7; - } - if (WorldGen.genRand.Next(2) == 0) - { - chest.item[index7].SetDefaults(73); - chest.item[index7].stack = WorldGen.genRand.Next(2, 5); - ++index7; } + ++index2; } - if (index7 > 0 && chestTileType == (ushort) 21) + if (WorldGen.genRand.Next(5) == 0) { - if (style == 10 && WorldGen.genRand.Next(4) == 0) + Main.chest[index1].item[index2].SetDefaults(43); + ++index2; + } + if (WorldGen.genRand.Next(3) == 0) + { + Main.chest[index1].item[index2].SetDefaults(167); + ++index2; + } + if (WorldGen.genRand.Next(4) == 0) + { + Main.chest[index1].item[index2].SetDefaults(51); + Main.chest[index1].item[index2].stack = WorldGen.genRand.Next(26) + 25; + ++index2; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num29 = WorldGen.genRand.Next(2); + int num30 = WorldGen.genRand.Next(8) + 3; + if (num29 == 0) + Main.chest[index1].item[index2].SetDefaults(WorldGen.goldBar); + if (num29 == 1) + Main.chest[index1].item[index2].SetDefaults(WorldGen.silverBar); + Main.chest[index1].item[index2].stack = num30; + ++index2; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num31 = WorldGen.genRand.Next(2); + int num32 = WorldGen.genRand.Next(26) + 25; + if (num31 == 0) + Main.chest[index1].item[index2].SetDefaults(41); + if (num31 == 1) + Main.chest[index1].item[index2].SetDefaults(279); + Main.chest[index1].item[index2].stack = num32; + ++index2; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num33 = WorldGen.genRand.Next(1); + int num34 = WorldGen.genRand.Next(3) + 3; + if (num33 == 0) + Main.chest[index1].item[index2].SetDefaults(188); + Main.chest[index1].item[index2].stack = num34; + ++index2; + } + if (WorldGen.genRand.Next(3) > 0) + { + int num35 = WorldGen.genRand.Next(6); + int num36 = WorldGen.genRand.Next(1, 3); + if (num35 == 0) + Main.chest[index1].item[index2].SetDefaults(296); + if (num35 == 1) + Main.chest[index1].item[index2].SetDefaults(295); + if (num35 == 2) + Main.chest[index1].item[index2].SetDefaults(299); + if (num35 == 3) + Main.chest[index1].item[index2].SetDefaults(302); + if (num35 == 4) + Main.chest[index1].item[index2].SetDefaults(303); + if (num35 == 5) + Main.chest[index1].item[index2].SetDefaults(305); + Main.chest[index1].item[index2].stack = num36; + ++index2; + } + if (WorldGen.genRand.Next(3) > 1) + { + int num37 = WorldGen.genRand.Next(7); + int num38 = WorldGen.genRand.Next(1, 3); + if (num37 == 0) + Main.chest[index1].item[index2].SetDefaults(301); + if (num37 == 1) + Main.chest[index1].item[index2].SetDefaults(302); + if (num37 == 2) + Main.chest[index1].item[index2].SetDefaults(297); + if (num37 == 3) + Main.chest[index1].item[index2].SetDefaults(304); + if (num37 == 4) + Main.chest[index1].item[index2].SetDefaults(2329); + if (num37 == 5) + Main.chest[index1].item[index2].SetDefaults(2351); + if (num37 == 6) + Main.chest[index1].item[index2].SetDefaults(2329); + Main.chest[index1].item[index2].stack = num38; + ++index2; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num39 = WorldGen.genRand.Next(1, 3); + Main.chest[index1].item[index2].SetDefaults(2350); + Main.chest[index1].item[index2].stack = num39; + ++index2; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num40 = WorldGen.genRand.Next(2); + int num41 = WorldGen.genRand.Next(15) + 15; + if (num40 == 0) { - chest.item[index7].SetDefaults(2204); - ++index7; - } - if (style == 11 && WorldGen.genRand.Next(7) == 0) - { - chest.item[index7].SetDefaults(2198); - ++index7; - } - if (style == 13 && WorldGen.genRand.Next(3) == 0) - { - chest.item[index7].SetDefaults(2197); - ++index7; - } - if (style == 16) - { - chest.item[index7].SetDefaults(2195); - ++index7; - } - if (Main.wallDungeon[(int) Main.tile[i, index1].wall] && WorldGen.genRand.Next(8) == 0) - { - chest.item[index7].SetDefaults(2192); - ++index7; - } - if (style == 16) - { - if (WorldGen.genRand.Next(5) == 0) - { - chest.item[index7].SetDefaults(2767); - ++index7; - } + if (style == 11) + Main.chest[index1].item[index2].SetDefaults(974); else - { - chest.item[index7].SetDefaults(2766); - chest.item[index7].stack = WorldGen.genRand.Next(3, 8); - ++index7; - } + Main.chest[index1].item[index2].SetDefaults(8); + } + if (num40 == 1) + Main.chest[index1].item[index2].SetDefaults(282); + Main.chest[index1].item[index2].stack = num41; + ++index2; + } + if (WorldGen.genRand.Next(2) == 0) + { + Main.chest[index1].item[index2].SetDefaults(73); + Main.chest[index1].item[index2].stack = WorldGen.genRand.Next(1, 3); + ++index2; + } + } + else + { + if (contain > 0) + { + Main.chest[index1].item[index2].SetDefaults(contain); + Main.chest[index1].item[index2].Prefix(-1); + ++index2; + } + else + { + int num42 = WorldGen.genRand.Next(4); + if (num42 == 0) + { + Main.chest[index1].item[index2].SetDefaults(49); + Main.chest[index1].item[index2].Prefix(-1); + } + if (num42 == 1) + { + Main.chest[index1].item[index2].SetDefaults(50); + Main.chest[index1].item[index2].Prefix(-1); + } + if (num42 == 2) + { + Main.chest[index1].item[index2].SetDefaults(53); + Main.chest[index1].item[index2].Prefix(-1); + } + if (num42 == 3) + { + Main.chest[index1].item[index2].SetDefaults(54); + Main.chest[index1].item[index2].Prefix(-1); + } + ++index2; + } + if (WorldGen.genRand.Next(3) == 0) + { + Main.chest[index1].item[index2].SetDefaults(167); + ++index2; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num43 = WorldGen.genRand.Next(2); + int num44 = WorldGen.genRand.Next(15) + 15; + if (num43 == 0) + Main.chest[index1].item[index2].SetDefaults(117); + if (num43 == 1) + Main.chest[index1].item[index2].SetDefaults(WorldGen.goldBar); + Main.chest[index1].item[index2].stack = num44; + ++index2; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num45 = WorldGen.genRand.Next(2); + int num46 = WorldGen.genRand.Next(25) + 50; + if (num45 == 0) + Main.chest[index1].item[index2].SetDefaults(265); + if (num45 == 1) + Main.chest[index1].item[index2].SetDefaults(278); + Main.chest[index1].item[index2].stack = num46; + ++index2; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num47 = WorldGen.genRand.Next(2); + int num48 = WorldGen.genRand.Next(6) + 15; + if (num47 == 0) + Main.chest[index1].item[index2].SetDefaults(226); + if (num47 == 1) + Main.chest[index1].item[index2].SetDefaults(227); + Main.chest[index1].item[index2].stack = num48; + ++index2; + } + if (WorldGen.genRand.Next(4) > 0) + { + int num49 = WorldGen.genRand.Next(8); + int num50 = WorldGen.genRand.Next(1, 3); + if (num49 == 0) + Main.chest[index1].item[index2].SetDefaults(296); + if (num49 == 1) + Main.chest[index1].item[index2].SetDefaults(295); + if (num49 == 2) + Main.chest[index1].item[index2].SetDefaults(293); + if (num49 == 3) + Main.chest[index1].item[index2].SetDefaults(288); + if (num49 == 4) + Main.chest[index1].item[index2].SetDefaults(294); + if (num49 == 5) + Main.chest[index1].item[index2].SetDefaults(297); + if (num49 == 6) + Main.chest[index1].item[index2].SetDefaults(304); + if (num49 == 7) + Main.chest[index1].item[index2].SetDefaults(2323); + Main.chest[index1].item[index2].stack = num50; + ++index2; + } + if (WorldGen.genRand.Next(3) > 0) + { + int num51 = WorldGen.genRand.Next(8); + int num52 = WorldGen.genRand.Next(1, 3); + if (num51 == 0) + Main.chest[index1].item[index2].SetDefaults(305); + if (num51 == 1) + Main.chest[index1].item[index2].SetDefaults(301); + if (num51 == 2) + Main.chest[index1].item[index2].SetDefaults(302); + if (num51 == 3) + Main.chest[index1].item[index2].SetDefaults(288); + if (num51 == 4) + Main.chest[index1].item[index2].SetDefaults(300); + if (num51 == 5) + Main.chest[index1].item[index2].SetDefaults(2351); + if (num51 == 6) + Main.chest[index1].item[index2].SetDefaults(2348); + if (num51 == 7) + Main.chest[index1].item[index2].SetDefaults(2345); + Main.chest[index1].item[index2].stack = num52; + ++index2; + } + if (WorldGen.genRand.Next(3) == 0) + { + int num53 = WorldGen.genRand.Next(1, 3); + Main.chest[index1].item[index2].SetDefaults(2350); + Main.chest[index1].item[index2].stack = num53; + ++index2; + } + if (WorldGen.genRand.Next(2) == 0) + { + int num54 = WorldGen.genRand.Next(2); + int num55 = WorldGen.genRand.Next(15) + 15; + if (num54 == 0) + Main.chest[index1].item[index2].SetDefaults(8); + if (num54 == 1) + Main.chest[index1].item[index2].SetDefaults(282); + Main.chest[index1].item[index2].stack = num55; + ++index2; + } + if (WorldGen.genRand.Next(2) == 0) + { + Main.chest[index1].item[index2].SetDefaults(73); + Main.chest[index1].item[index2].stack = WorldGen.genRand.Next(2, 5); + ++index2; + } + } + if (index2 > 0) + { + if (style == 10 && WorldGen.genRand.Next(4) == 0) + { + Main.chest[index1].item[index2].SetDefaults(2204); + ++index2; + } + if (style == 11 && WorldGen.genRand.Next(7) == 0) + { + Main.chest[index1].item[index2].SetDefaults(2198); + ++index2; + } + if (style == 12 && WorldGen.genRand.Next(2) == 0) + { + Main.chest[index1].item[index2].SetDefaults(2196); + ++index2; + } + if (style == 13 && WorldGen.genRand.Next(3) == 0) + { + Main.chest[index1].item[index2].SetDefaults(2197); + ++index2; + } + if (style == 16) + { + Main.chest[index1].item[index2].SetDefaults(2195); + ++index2; + } + if (Main.wallDungeon[(int) Main.tile[i, j1].wall] && WorldGen.genRand.Next(8) == 0) + { + Main.chest[index1].item[index2].SetDefaults(2192); + ++index2; + } + if (style == 16) + { + if (WorldGen.genRand.Next(5) == 0) + { + Main.chest[index1].item[index2].SetDefaults(2767); + ++index2; + } + else + { + Main.chest[index1].item[index2].SetDefaults(2766); + Main.chest[index1].item[index2].stack = WorldGen.genRand.Next(3, 8); + ++index2; } } } - return true; } - if (trySlope) - { - if (num1 > -1) - Main.tile[i - 1, index1].slope((byte) num1); - if (num2 > -1) - Main.tile[i, index1].slope((byte) num2); - } - return false; + return true; } } return false; @@ -22291,7 +16110,7 @@ label_296: if (Main.tile[index1, index2].frameY < (short) 594 || index2 <= 0) return; } - SoundEngine.PlaySound(22, index1 * 16, index2 * 16 + 16); + Main.PlaySound(22, index1 * 16, index2 * 16 + 16); for (int index3 = index2; index3 <= index2 + 2; ++index3) { if (Main.tile[index1, index3] == null) @@ -22300,7 +16119,6 @@ label_296: for (int index4 = 0; index4 < 4; ++index4) Dust.NewDust(new Vector2((float) (index1 * 16), (float) (index3 * 16)), 16, 16, 11); } - AchievementsHelper.NotifyProgressionEvent(22); } public static bool OpenDoor(int i, int j, int direction) @@ -22313,20 +16131,20 @@ label_296: Main.tile[i, j + 1] = new Tile(); if (Main.tile[i, j] == null) Main.tile[i, j] = new Tile(); - Tile t = Main.tile[i, j]; - if (t.type != (ushort) 10 || WorldGen.IsLockedDoor(t)) + Tile tile = Main.tile[i, j]; + if (tile.type != (ushort) 10 || tile.frameY >= (short) 594 && tile.frameY <= (short) 646 && tile.frameX < (short) 54) return false; short num1 = 0; - int frameY = (int) t.frameY; + int frameY = (int) tile.frameY; int num2 = 0; while (frameY >= 54) { frameY -= 54; ++num2; } - if (t.frameX >= (short) 54) + if (tile.frameX >= (short) 54) { - int num3 = (int) t.frameX / 54; + int num3 = (int) tile.frameX / 54; num2 += 36 * num3; num1 += (short) (72 * num3); } @@ -22358,7 +16176,7 @@ label_296: Main.tile[i1, j1] = new Tile(); if (Main.tile[i1, j1].active()) { - if (!Main.tileCut[(int) Main.tile[i1, j1].type] && Main.tile[i1, j1].type != (ushort) 3 && Main.tile[i1, j1].type != (ushort) 24 && Main.tile[i1, j1].type != (ushort) 52 && Main.tile[i1, j1].type != (ushort) 61 && Main.tile[i1, j1].type != (ushort) 62 && Main.tile[i1, j1].type != (ushort) 69 && Main.tile[i1, j1].type != (ushort) 71 && Main.tile[i1, j1].type != (ushort) 73 && Main.tile[i1, j1].type != (ushort) 74 && Main.tile[i1, j1].type != (ushort) 110 && Main.tile[i1, j1].type != (ushort) 113 && Main.tile[i1, j1].type != (ushort) 115 && Main.tile[i1, j1].type != (ushort) 165) + if (!Main.tileCut[(int) Main.tile[i1, j1].type] && Main.tile[i1, j1].type != (ushort) 3 && Main.tile[i1, j1].type != (ushort) 24 && Main.tile[i1, j1].type != (ushort) 52 && Main.tile[i1, j1].type != (ushort) 61 && Main.tile[i1, j1].type != (ushort) 62 && Main.tile[i1, j1].type != (ushort) 69 && Main.tile[i1, j1].type != (ushort) 71 && Main.tile[i1, j1].type != (ushort) 73 && Main.tile[i1, j1].type != (ushort) 74 && Main.tile[i1, j1].type != (ushort) 110 && Main.tile[i1, j1].type != (ushort) 113 && Main.tile[i1, j1].type != (ushort) 115) return false; WorldGen.KillTile(i1, j1); } @@ -22373,7 +16191,7 @@ label_296: Wiring.SkipWire(x + 1, y + 2); } int num4 = num2 % 36 * 54; - SoundEngine.PlaySound(8, i * 16, j * 16); + Main.PlaySound(8, i * 16, j * 16); Main.tile[x, y].active(true); Main.tile[x, y].type = (ushort) 11; Main.tile[x, y].frameY = (short) num4; @@ -22532,30 +16350,6 @@ label_296: case 31: Type = 3892; break; - case 32: - Type = 3942; - break; - case 33: - Type = 3969; - break; - case 34: - Type = 4156; - break; - case 35: - Type = 4177; - break; - case 36: - Type = 4198; - break; - case 37: - Type = 4219; - break; - case 38: - Type = 4308; - break; - case 39: - Type = 4577; - break; } } Item.NewItem(x * 16, j * 16, 32, 32, Type); @@ -22618,11 +16412,13 @@ label_296: else if ((int) Main.tile[index1 + 1, y + index2].frameX != frameX2 + 18) flag = true; } - if (type == (ushort) 465 || type == (ushort) 531 || type == (ushort) 591 || type == (ushort) 592) + if (type == (ushort) 465) { for (int index3 = 0; index3 < 2; ++index3) { - if (!WorldGen.SolidTileAllowTopSlope(index1 + index3, y - 1)) + if (Main.tile[index1 + index3, y - 1] == null) + Main.tile[index1 + index3, y - 1] = new Tile(); + if (!Main.tile[index1 + index3, y - 1].nactive() || !Main.tileSolid[(int) Main.tile[index1 + index3, y - 1].type] || Main.tileSolidTop[(int) Main.tile[index1 + index3, y - 1].type]) { flag = true; break; @@ -22649,13 +16445,13 @@ label_296: if (type == (ushort) 104) { int num4 = frameX2 / 36; - int Type = num4 < 1 || num4 > 5 ? (num4 != 6 ? (num4 != 7 ? (num4 < 8 || num4 > 23 ? (num4 != 24 ? (num4 != 25 ? (num4 != 26 ? (num4 != 27 ? (num4 != 28 ? (num4 != 29 ? (num4 != 30 ? (num4 != 31 ? (num4 != 32 ? (num4 != 33 ? (num4 != 34 ? (num4 != 35 ? (num4 != 36 ? (num4 != 37 ? (num4 != 38 ? (num4 != 39 ? (num4 != 40 ? 359 : 4575) : 4306) : 4217) : 4196) : 4175) : 4154) : 3966) : 3940) : 3902) : 3901) : 3900) : 3899) : 3898) : 3127) : 3128) : 3126) : 2809) : 2591 + num4 - 8) : 2575) : 2560) : 2237 + num4 - 1; + int Type = num4 < 1 || num4 > 5 ? (num4 != 6 ? (num4 != 7 ? (num4 < 8 || num4 > 23 ? (num4 != 24 ? (num4 != 25 ? (num4 != 26 ? (num4 != 27 ? (num4 != 28 ? (num4 != 29 ? (num4 != 30 ? (num4 != 31 ? (num4 != 32 ? 359 : 3902) : 3901) : 3900) : 3899) : 3898) : 3127) : 3128) : 3126) : 2809) : 2591 + num4 - 8) : 2575) : 2560) : 2237 + num4 - 1; Item.NewItem(index1 * 16, j * 16, 32, 32, Type); } if (type == (ushort) 105) { - int num5 = frameX2 / 36 + frameY / 54 % 3 * 55; - int Type = num5 != 0 ? (num5 != 1 ? (num5 != 43 ? (num5 != 44 ? (num5 != 45 ? (num5 != 46 ? (num5 != 47 ? (num5 != 48 ? (num5 != 49 ? (num5 != 50 ? (num5 < 51 || num5 > 62 ? (num5 < 63 || num5 > 75 ? (num5 != 76 ? (num5 != 77 ? (num5 != 78 ? (num5 != 79 ? 438 + num5 - 2 : 4466) : 4342) : 4360) : 4397) : 3708 + num5 - 63) : 3651 + num5 - 51) : 2672) : 1462) : 1410) : 1409) : 1408) : 1154) : 1153) : 1152) : 52) : 360; + int num5 = frameX2 / 36 + frameY / 54 * 55; + int Type = num5 != 0 ? (num5 != 1 ? (num5 != 43 ? (num5 != 44 ? (num5 != 45 ? (num5 != 46 ? (num5 != 47 ? (num5 != 48 ? (num5 != 49 ? (num5 != 50 ? (num5 < 51 || num5 > 62 ? (num5 < 63 || num5 > 75 ? 438 + num5 - 2 : 3708 + num5 - 63) : 3651 + num5 - 51) : 2672) : 1462) : 1410) : 1409) : 1408) : 1154) : 1153) : 1152) : 52) : 360; Item.NewItem(index1 * 16, j * 16, 32, 32, Type); } if (type == (ushort) 356) @@ -22678,21 +16474,13 @@ label_296: case 1: Type = 910; break; - default: - if (Type >= 2 && Type <= 7) - { - Type = 938 + Type; - break; - } - switch (Type) - { - case 8: - Type = 4922; - break; - case 9: - Type = 4417; - break; - } + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + Type = 938 + Type; break; } Item.NewItem(index1 * 16, j * 16, 32, 32, Type); @@ -22702,45 +16490,21 @@ label_296: int num7 = frameX2 / 36; Item.NewItem(index1 * 16, j * 16, 32, 32, num7 + 3536); } - if (type == (ushort) 480) - Item.NewItem(index1 * 16, j * 16, 32, 32, 4054); - if (type == (ushort) 509) - Item.NewItem(index1 * 16, j * 16, 32, 32, 4318); - if (type == (ushort) 489) - Item.NewItem(index1 * 16, j * 16, 32, 32, 4074); if (type == (ushort) 320) Item.NewItem(index1 * 16, j * 16, 32, 32, 2496); if (type == (ushort) 349) Item.NewItem(index1 * 16, j * 16, 32, 32, 470); - if (type == (ushort) 506) - Item.NewItem(index1 * 16, j * 16, 32, 32, 4276); - if (type == (ushort) 545) - Item.NewItem(index1 * 16, j * 16, 32, 32, 4420); if (type == (ushort) 465) Item.NewItem(index1 * 16, j * 16, 32, 32, 3815); - if (type == (ushort) 531) - Item.NewItem(index1 * 16, j * 16, 32, 32, 4355); if (type == (ushort) 378) { Item.NewItem(index1 * 16, j * 16, 32, 48, 3202); TETrainingDummy.Kill(index1, y); } - if (type == (ushort) 560) - { - int num8 = frameX2 / 36; - Item.NewItem(index1 * 16, j * 16, 32, 32, num8 + 4599); - } - if (type == (ushort) 591) - { - int num9 = frameX2 / 36; - Item.NewItem(index1 * 16, j * 16, 32, 32, num9 + 4858); - } - if (type == (ushort) 592) - Item.NewItem(index1 * 16, j * 16, 32, 32, 4867); WorldGen.destroyObject = false; } - public static void PlaceTight(int x, int y, bool spiders = false) + public static void PlaceTight(int x, int y, ushort type = 165, bool spiders = false) { if (Main.tile[x, y - 1] == null) Main.tile[x, y - 1] = new Tile(); @@ -22748,429 +16512,383 @@ label_296: Main.tile[x, y] = new Tile(); if (Main.tile[x, y + 1] == null) Main.tile[x, y + 1] = new Tile(); - WorldGen.PlaceUncheckedStalactite(x, y, WorldGen.genRand.Next(2) == 0, WorldGen.genRand.Next(3), spiders); - if (Main.tile[x, y].type != (ushort) 165) - return; - WorldGen.CheckTight(x, y); - } - - public static void PlaceUncheckedStalactite( - int x, - int y, - bool preferSmall, - int variation, - bool spiders) - { - ushort num1 = 165; - variation = Utils.Clamp(variation, 0, 2); if (WorldGen.SolidTile(x, y - 1) && !Main.tile[x, y].active() && !Main.tile[x, y + 1].active()) { if (spiders) { - int num2 = 108 + variation * 18; - Main.tile[x, y].type = num1; + int num = 108 + WorldGen.genRand.Next(3) * 18; + Main.tile[x, y].type = type; Main.tile[x, y].active(true); - Main.tile[x, y].frameX = (short) num2; + Main.tile[x, y].frameX = (short) num; Main.tile[x, y].frameY = (short) 0; - Main.tile[x, y + 1].type = num1; + Main.tile[x, y + 1].type = type; Main.tile[x, y + 1].active(true); - Main.tile[x, y + 1].frameX = (short) num2; + Main.tile[x, y + 1].frameX = (short) num; Main.tile[x, y + 1].frameY = (short) 18; } else { if (Main.tile[x, y - 1].type == (ushort) 147 || Main.tile[x, y - 1].type == (ushort) 161 || Main.tile[x, y - 1].type == (ushort) 163 || Main.tile[x, y - 1].type == (ushort) 164 || Main.tile[x, y - 1].type == (ushort) 200) { - if (preferSmall) + if (WorldGen.genRand.Next(2) == 0) { - int num3 = variation * 18; - Main.tile[x, y].type = num1; + int num = WorldGen.genRand.Next(3) * 18; + Main.tile[x, y].type = type; Main.tile[x, y].active(true); - Main.tile[x, y].frameX = (short) num3; + Main.tile[x, y].frameX = (short) num; Main.tile[x, y].frameY = (short) 72; } else { - int num4 = variation * 18; - Main.tile[x, y].type = num1; + int num = WorldGen.genRand.Next(3) * 18; + Main.tile[x, y].type = type; Main.tile[x, y].active(true); - Main.tile[x, y].frameX = (short) num4; + Main.tile[x, y].frameX = (short) num; Main.tile[x, y].frameY = (short) 0; - Main.tile[x, y + 1].type = num1; + Main.tile[x, y + 1].type = type; Main.tile[x, y + 1].active(true); - Main.tile[x, y + 1].frameX = (short) num4; + Main.tile[x, y + 1].frameX = (short) num; Main.tile[x, y + 1].frameY = (short) 18; } } if (Main.tile[x, y - 1].type == (ushort) 1 || Main.tileMoss[(int) Main.tile[x, y - 1].type] || Main.tile[x, y - 1].type == (ushort) 117 || Main.tile[x, y - 1].type == (ushort) 25 || Main.tile[x, y - 1].type == (ushort) 203) { - if (preferSmall) + if (WorldGen.genRand.Next(2) == 0) { - int num5 = 54 + variation * 18; - Main.tile[x, y].type = num1; + int num = 54 + WorldGen.genRand.Next(3) * 18; + Main.tile[x, y].type = type; Main.tile[x, y].active(true); - Main.tile[x, y].frameX = (short) num5; + Main.tile[x, y].frameX = (short) num; Main.tile[x, y].frameY = (short) 72; } else { - int num6 = 54 + variation * 18; - Main.tile[x, y].type = num1; + int num = 54 + WorldGen.genRand.Next(3) * 18; + Main.tile[x, y].type = type; Main.tile[x, y].active(true); - Main.tile[x, y].frameX = (short) num6; + Main.tile[x, y].frameX = (short) num; Main.tile[x, y].frameY = (short) 0; - Main.tile[x, y + 1].type = num1; + Main.tile[x, y + 1].type = type; Main.tile[x, y + 1].active(true); - Main.tile[x, y + 1].frameX = (short) num6; + Main.tile[x, y + 1].frameX = (short) num; Main.tile[x, y + 1].frameY = (short) 18; } } if (Main.tile[x, y - 1].type == (ushort) 225) { - int num7 = 162 + variation * 18; - Main.tile[x, y].type = num1; + int num = 162 + WorldGen.genRand.Next(3) * 18; + Main.tile[x, y].type = type; Main.tile[x, y].active(true); - Main.tile[x, y].frameX = (short) num7; + Main.tile[x, y].frameX = (short) num; Main.tile[x, y].frameY = (short) 72; } if (Main.tile[x, y - 1].type == (ushort) 396 || Main.tile[x, y - 1].type == (ushort) 397) { - if (preferSmall) + if (WorldGen.genRand.Next(2) == 0) { - int num8 = 378 + variation * 18; - Main.tile[x, y].type = num1; + int num = 378 + WorldGen.genRand.Next(3) * 18; + Main.tile[x, y].type = type; Main.tile[x, y].active(true); - Main.tile[x, y].frameX = (short) num8; + Main.tile[x, y].frameX = (short) num; Main.tile[x, y].frameY = (short) 72; } else { - int num9 = 378 + variation * 18; - Main.tile[x, y].type = num1; + int num = 378 + WorldGen.genRand.Next(3) * 18; + Main.tile[x, y].type = type; Main.tile[x, y].active(true); - Main.tile[x, y].frameX = (short) num9; + Main.tile[x, y].frameX = (short) num; Main.tile[x, y].frameY = (short) 0; - Main.tile[x, y + 1].type = num1; + Main.tile[x, y + 1].type = type; Main.tile[x, y + 1].active(true); - Main.tile[x, y + 1].frameX = (short) num9; + Main.tile[x, y + 1].frameX = (short) num; Main.tile[x, y + 1].frameY = (short) 18; } } if (Main.tile[x, y - 1].type == (ushort) 368) { - if (preferSmall) + if (WorldGen.genRand.Next(2) == 0) { - int num10 = 432 + variation * 18; - Main.tile[x, y].type = num1; + int num = 432 + WorldGen.genRand.Next(3) * 18; + Main.tile[x, y].type = type; Main.tile[x, y].active(true); - Main.tile[x, y].frameX = (short) num10; + Main.tile[x, y].frameX = (short) num; Main.tile[x, y].frameY = (short) 72; } else { - int num11 = 432 + variation * 18; - Main.tile[x, y].type = num1; + int num = 432 + WorldGen.genRand.Next(3) * 18; + Main.tile[x, y].type = type; Main.tile[x, y].active(true); - Main.tile[x, y].frameX = (short) num11; + Main.tile[x, y].frameX = (short) num; Main.tile[x, y].frameY = (short) 0; - Main.tile[x, y + 1].type = num1; + Main.tile[x, y + 1].type = type; Main.tile[x, y + 1].active(true); - Main.tile[x, y + 1].frameX = (short) num11; + Main.tile[x, y + 1].frameX = (short) num; Main.tile[x, y + 1].frameY = (short) 18; } } - if (Main.tile[x, y - 1].type != (ushort) 367) - return; - if (preferSmall) + if (Main.tile[x, y - 1].type == (ushort) 367) { - int num12 = 486 + variation * 18; - Main.tile[x, y].type = num1; - Main.tile[x, y].active(true); - Main.tile[x, y].frameX = (short) num12; - Main.tile[x, y].frameY = (short) 72; - } - else - { - int num13 = 486 + variation * 18; - Main.tile[x, y].type = num1; - Main.tile[x, y].active(true); - Main.tile[x, y].frameX = (short) num13; - Main.tile[x, y].frameY = (short) 0; - Main.tile[x, y + 1].type = num1; - Main.tile[x, y + 1].active(true); - Main.tile[x, y + 1].frameX = (short) num13; - Main.tile[x, y + 1].frameY = (short) 18; + if (WorldGen.genRand.Next(2) == 0) + { + int num = 486 + WorldGen.genRand.Next(3) * 18; + Main.tile[x, y].type = type; + Main.tile[x, y].active(true); + Main.tile[x, y].frameX = (short) num; + Main.tile[x, y].frameY = (short) 72; + } + else + { + int num = 486 + WorldGen.genRand.Next(3) * 18; + Main.tile[x, y].type = type; + Main.tile[x, y].active(true); + Main.tile[x, y].frameX = (short) num; + Main.tile[x, y].frameY = (short) 0; + Main.tile[x, y + 1].type = type; + Main.tile[x, y + 1].active(true); + Main.tile[x, y + 1].frameX = (short) num; + Main.tile[x, y + 1].frameY = (short) 18; + } } } } else { - if (spiders || !WorldGen.SolidTile(x, y + 1) || Main.tile[x, y].active() || Main.tile[x, y - 1].active()) + if (spiders) return; - if (Main.tile[x, y + 1].type == (ushort) 1 || Main.tileMoss[(int) Main.tile[x, y + 1].type] || Main.tile[x, y - 1].type == (ushort) 117 || Main.tile[x, y - 1].type == (ushort) 25 || Main.tile[x, y - 1].type == (ushort) 203) + if (WorldGen.SolidTile(x, y + 1) && !Main.tile[x, y].active() && !Main.tile[x, y - 1].active()) { - if (preferSmall) + if (Main.tile[x, y + 1].type == (ushort) 1 || Main.tileMoss[(int) Main.tile[x, y + 1].type] || Main.tile[x, y - 1].type == (ushort) 117 || Main.tile[x, y - 1].type == (ushort) 25 || Main.tile[x, y - 1].type == (ushort) 203) { - int num14 = 54 + variation * 18; - Main.tile[x, y].type = num1; + if (WorldGen.genRand.Next(2) == 0) + { + int num = 54 + WorldGen.genRand.Next(3) * 18; + Main.tile[x, y].type = type; + Main.tile[x, y].active(true); + Main.tile[x, y].frameX = (short) num; + Main.tile[x, y].frameY = (short) 90; + } + else + { + int num = 54 + WorldGen.genRand.Next(3) * 18; + Main.tile[x, y - 1].type = type; + Main.tile[x, y - 1].active(true); + Main.tile[x, y - 1].frameX = (short) num; + Main.tile[x, y - 1].frameY = (short) 36; + Main.tile[x, y].type = type; + Main.tile[x, y].active(true); + Main.tile[x, y].frameX = (short) num; + Main.tile[x, y].frameY = (short) 54; + } + } + if (Main.tile[x, y + 1].type == (ushort) 225) + { + int num = 162 + WorldGen.genRand.Next(3) * 18; + Main.tile[x, y].type = type; Main.tile[x, y].active(true); - Main.tile[x, y].frameX = (short) num14; + Main.tile[x, y].frameX = (short) num; Main.tile[x, y].frameY = (short) 90; } - else + if (Main.tile[x, y + 1].type == (ushort) 396 || Main.tile[x, y + 1].type == (ushort) 397) { - int num15 = 54 + variation * 18; - Main.tile[x, y - 1].type = num1; - Main.tile[x, y - 1].active(true); - Main.tile[x, y - 1].frameX = (short) num15; - Main.tile[x, y - 1].frameY = (short) 36; - Main.tile[x, y].type = num1; - Main.tile[x, y].active(true); - Main.tile[x, y].frameX = (short) num15; - Main.tile[x, y].frameY = (short) 54; + if (WorldGen.genRand.Next(2) == 0) + { + int num = 378 + WorldGen.genRand.Next(3) * 18; + Main.tile[x, y].type = type; + Main.tile[x, y].active(true); + Main.tile[x, y].frameX = (short) num; + Main.tile[x, y].frameY = (short) 90; + } + else + { + int num = 378 + WorldGen.genRand.Next(3) * 18; + Main.tile[x, y - 1].type = type; + Main.tile[x, y - 1].active(true); + Main.tile[x, y - 1].frameX = (short) num; + Main.tile[x, y - 1].frameY = (short) 36; + Main.tile[x, y].type = type; + Main.tile[x, y].active(true); + Main.tile[x, y].frameX = (short) num; + Main.tile[x, y].frameY = (short) 54; + } } - } - if (Main.tile[x, y + 1].type == (ushort) 225) - { - int num16 = 162 + variation * 18; - Main.tile[x, y].type = num1; - Main.tile[x, y].active(true); - Main.tile[x, y].frameX = (short) num16; - Main.tile[x, y].frameY = (short) 90; - } - if (Main.tile[x, y + 1].type == (ushort) 396 || Main.tile[x, y + 1].type == (ushort) 397) - { - if (preferSmall) + if (Main.tile[x, y + 1].type == (ushort) 368) { - int num17 = 378 + variation * 18; - Main.tile[x, y].type = num1; - Main.tile[x, y].active(true); - Main.tile[x, y].frameX = (short) num17; - Main.tile[x, y].frameY = (short) 90; + if (WorldGen.genRand.Next(2) == 0) + { + int num = 432 + WorldGen.genRand.Next(3) * 18; + Main.tile[x, y].type = type; + Main.tile[x, y].active(true); + Main.tile[x, y].frameX = (short) num; + Main.tile[x, y].frameY = (short) 90; + } + else + { + int num = 432 + WorldGen.genRand.Next(3) * 18; + Main.tile[x, y - 1].type = type; + Main.tile[x, y - 1].active(true); + Main.tile[x, y - 1].frameX = (short) num; + Main.tile[x, y - 1].frameY = (short) 36; + Main.tile[x, y].type = type; + Main.tile[x, y].active(true); + Main.tile[x, y].frameX = (short) num; + Main.tile[x, y].frameY = (short) 54; + } } - else + if (Main.tile[x, y + 1].type == (ushort) 367) { - int num18 = 378 + variation * 18; - Main.tile[x, y - 1].type = num1; - Main.tile[x, y - 1].active(true); - Main.tile[x, y - 1].frameX = (short) num18; - Main.tile[x, y - 1].frameY = (short) 36; - Main.tile[x, y].type = num1; - Main.tile[x, y].active(true); - Main.tile[x, y].frameX = (short) num18; - Main.tile[x, y].frameY = (short) 54; + if (WorldGen.genRand.Next(2) == 0) + { + int num = 486 + WorldGen.genRand.Next(3) * 18; + Main.tile[x, y].type = type; + Main.tile[x, y].active(true); + Main.tile[x, y].frameX = (short) num; + Main.tile[x, y].frameY = (short) 90; + } + else + { + int num = 486 + WorldGen.genRand.Next(3) * 18; + Main.tile[x, y - 1].type = type; + Main.tile[x, y - 1].active(true); + Main.tile[x, y - 1].frameX = (short) num; + Main.tile[x, y - 1].frameY = (short) 36; + Main.tile[x, y].type = type; + Main.tile[x, y].active(true); + Main.tile[x, y].frameX = (short) num; + Main.tile[x, y].frameY = (short) 54; + } } } - if (Main.tile[x, y + 1].type == (ushort) 368) - { - if (preferSmall) - { - int num19 = 432 + variation * 18; - Main.tile[x, y].type = num1; - Main.tile[x, y].active(true); - Main.tile[x, y].frameX = (short) num19; - Main.tile[x, y].frameY = (short) 90; - } - else - { - int num20 = 432 + variation * 18; - Main.tile[x, y - 1].type = num1; - Main.tile[x, y - 1].active(true); - Main.tile[x, y - 1].frameX = (short) num20; - Main.tile[x, y - 1].frameY = (short) 36; - Main.tile[x, y].type = num1; - Main.tile[x, y].active(true); - Main.tile[x, y].frameX = (short) num20; - Main.tile[x, y].frameY = (short) 54; - } - } - if (Main.tile[x, y + 1].type != (ushort) 367) - return; - if (preferSmall) - { - int num21 = 486 + variation * 18; - Main.tile[x, y].type = num1; - Main.tile[x, y].active(true); - Main.tile[x, y].frameX = (short) num21; - Main.tile[x, y].frameY = (short) 90; - } - else - { - int num22 = 486 + variation * 18; - Main.tile[x, y - 1].type = num1; - Main.tile[x, y - 1].active(true); - Main.tile[x, y - 1].frameX = (short) num22; - Main.tile[x, y - 1].frameY = (short) 36; - Main.tile[x, y].type = num1; - Main.tile[x, y].active(true); - Main.tile[x, y].frameX = (short) num22; - Main.tile[x, y].frameY = (short) 54; - } } + if (Main.tile[x, y].type != (ushort) 165) + return; + WorldGen.CheckTight(x, y); } - public static bool UpdateStalagtiteStyle(int x, int j) + public static void TightBiome(int x, int j) { if (Main.netMode == 1 || Main.tile[x, j] == null) - return true; - int style; - bool fail1; - WorldGen.GetStalagtiteStyle(x, j, out style, out fail1); - if (fail1) - return false; - bool fail2; - int desiredStyle; - int height; - int y; - WorldGen.GetDesiredStalagtiteStyle(x, j, out fail2, out desiredStyle, out height, out y); - if (fail2) - return false; - if (style != desiredStyle) + return; + int tileY = j; + int num1 = 1; + int num2; + if (Main.tile[x, tileY].frameX >= (short) 0 && Main.tile[x, tileY].frameX <= (short) 36) + num2 = 7; + else if (Main.tile[x, tileY].frameX >= (short) 54 && Main.tile[x, tileY].frameX <= (short) 90) + num2 = 0; + else if (Main.tile[x, tileY].frameX >= (short) 216 && Main.tile[x, tileY].frameX <= (short) 252) + num2 = 1; + else if (Main.tile[x, tileY].frameX >= (short) 270 && Main.tile[x, tileY].frameX <= (short) 306) + num2 = 2; + else if (Main.tile[x, tileY].frameX >= (short) 324 && Main.tile[x, tileY].frameX <= (short) 360) + num2 = 3; + else if (Main.tile[x, tileY].frameX >= (short) 378 && Main.tile[x, tileY].frameX <= (short) 414) + num2 = 4; + else if (Main.tile[x, tileY].frameX >= (short) 432 && Main.tile[x, tileY].frameX <= (short) 468) { - int num = WorldGen.genRand.Next(3) * 18; - switch (desiredStyle) - { - case 0: - num += 54; - break; - case 1: - num += 216; - break; - case 2: - num += 270; - break; - case 3: - num += 324; - break; - case 4: - num += 378; - break; - case 5: - num += 432; - break; - case 6: - num += 486; - break; - case 7: - num = num; - break; - case 8: - num += 540; - break; - case 9: - num += 594; - break; - case 10: - num += 648; - break; - } - for (int index = y; index < y + height; ++index) - Main.tile[x, index].frameX = (short) num; - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, x, y, 2); - } - return true; - } - - private static void GetDesiredStalagtiteStyle( - int x, - int j, - out bool fail, - out int desiredStyle, - out int height, - out int y) - { - fail = false; - desiredStyle = 0; - height = 1; - y = j; - if (Main.tile[x, y].frameY == (short) 72) - desiredStyle = (int) Main.tile[x, y - 1].type; - else if (Main.tile[x, y].frameY == (short) 90) - desiredStyle = (int) Main.tile[x, y + 1].type; - else if (Main.tile[x, y].frameY >= (short) 36) - { - if (Main.tile[x, y].frameY == (short) 54) - --y; - height = 2; - desiredStyle = (int) Main.tile[x, y + 2].type; + num2 = 5; } else { - if (Main.tile[x, y].frameY == (short) 18) - --y; - height = 2; - desiredStyle = (int) Main.tile[x, y - 1].type; + if (Main.tile[x, tileY].frameX < (short) 486 || Main.tile[x, tileY].frameX > (short) 522) + return; + num2 = 6; } - if (desiredStyle == 1 || Main.tileMoss[desiredStyle]) - desiredStyle = 0; - else if (desiredStyle == 200) - desiredStyle = 10; - else if (desiredStyle == 164) - desiredStyle = 8; - else if (desiredStyle == 163) - desiredStyle = 9; - else if (desiredStyle == 117 || desiredStyle == 402 || desiredStyle == 403) - desiredStyle = 1; - else if (desiredStyle == 25 || desiredStyle == 398 || desiredStyle == 400) - desiredStyle = 2; - else if (desiredStyle == 203 || desiredStyle == 399 || desiredStyle == 401) - desiredStyle = 3; - else if (desiredStyle == 396 || desiredStyle == 397) - desiredStyle = 4; - else if (desiredStyle == 367) - desiredStyle = 6; - else if (desiredStyle == 368) - desiredStyle = 5; - else if (desiredStyle == 161 || desiredStyle == 147) - desiredStyle = 7; - else - fail = true; - } - - private static void GetStalagtiteStyle(int x, int y, out int style, out bool fail) - { - style = 0; - fail = false; - switch ((int) Main.tile[x, y].frameX / 54) + int type; + if (Main.tile[x, tileY].frameY == (short) 72) + type = (int) Main.tile[x, tileY - 1].type; + else if (Main.tile[x, tileY].frameY == (short) 90) + type = (int) Main.tile[x, tileY + 1].type; + else if (Main.tile[x, tileY].frameY >= (short) 36) + { + if (Main.tile[x, tileY].frameY == (short) 54) + --tileY; + num1 = 2; + type = (int) Main.tile[x, tileY + 2].type; + } + else + { + if (Main.tile[x, tileY].frameY == (short) 18) + --tileY; + num1 = 2; + type = (int) Main.tile[x, tileY - 1].type; + } + int num3; + switch (type) { - case 0: - style = 7; - break; case 1: - style = 0; + num3 = 0; break; - case 4: - style = 1; + case 25: + case 163: + case 398: + case 400: + num3 = 2; break; - case 5: - style = 2; + case 117: + case 164: + case 402: + case 403: + num3 = 1; break; - case 6: - style = 3; + case 161: + num3 = 7; break; - case 7: - style = 4; + case 200: + case 203: + case 399: + case 401: + num3 = 3; break; - case 8: - style = 5; + case 367: + num3 = 6; break; - case 9: - style = 6; + case 368: + num3 = 5; break; - case 10: - style = 8; - break; - case 11: - style = 9; - break; - case 12: - style = 10; + case 396: + case 397: + num3 = 4; break; default: - fail = true; + return; + } + if (num2 == num3) + return; + int num4 = WorldGen.genRand.Next(3) * 18; + switch (num3) + { + case 0: + num4 += 54; + break; + case 1: + num4 += 216; + break; + case 2: + num4 += 270; + break; + case 3: + num4 += 324; + break; + case 4: + num4 += 378; + break; + case 5: + num4 += 432; + break; + case 6: + num4 += 486; + break; + case 7: + num4 = num4; break; } + for (int index = tileY; index < tileY + num1; ++index) + Main.tile[x, index].frameX = (short) num4; + if (Main.netMode != 2) + return; + NetMessage.SendTileSquare(-1, x, tileY, 2); } public static void CheckTight(int x, int j) @@ -23189,14 +16907,14 @@ label_296: bool flag = false; if (!WorldGen.SolidTile(x, j1 - 1)) flag = true; - if (!flag && !WorldGen.UpdateStalagtiteStyle(x, j1)) - flag = true; - if (!flag) - return; - WorldGen.destroyObject = true; - if ((int) Main.tile[x, j1].type == (int) Main.tile[x, j].type) + if (flag) + { + if ((int) Main.tile[x, j1].type != (int) Main.tile[x, j].type) + return; WorldGen.KillTile(x, j1); - WorldGen.destroyObject = false; + } + else + WorldGen.TightBiome(x, j1); } else if (Main.tile[x, j1].frameY == (short) 90) { @@ -23209,14 +16927,14 @@ label_296: bool flag = false; if (!WorldGen.SolidTile(x, j1 + 1)) flag = true; - if (!flag && !WorldGen.UpdateStalagtiteStyle(x, j1)) - flag = true; - if (!flag) - return; - WorldGen.destroyObject = true; - if ((int) Main.tile[x, j1].type == (int) Main.tile[x, j].type) + if (flag) + { + if ((int) Main.tile[x, j1].type != (int) Main.tile[x, j].type) + return; WorldGen.KillTile(x, j1); - WorldGen.destroyObject = false; + } + else + WorldGen.TightBiome(x, j1); } else if (Main.tile[x, j1].frameY >= (short) 36) { @@ -23235,16 +16953,16 @@ label_296: flag = true; if ((int) Main.tile[x, j1 + 1].frameX != (int) Main.tile[x, j1].frameX) flag = true; - if (!flag && !WorldGen.UpdateStalagtiteStyle(x, j1)) - flag = true; - if (!flag) - return; - WorldGen.destroyObject = true; - if ((int) Main.tile[x, j1].type == (int) Main.tile[x, j].type) - WorldGen.KillTile(x, j1); - if ((int) Main.tile[x, j1 + 1].type == (int) Main.tile[x, j].type) + if (flag) + { + if ((int) Main.tile[x, j1].type == (int) Main.tile[x, j].type) + WorldGen.KillTile(x, j1); + if ((int) Main.tile[x, j1 + 1].type != (int) Main.tile[x, j].type) + return; WorldGen.KillTile(x, j1 + 1); - WorldGen.destroyObject = false; + } + else + WorldGen.TightBiome(x, j1); } else { @@ -23263,16 +16981,16 @@ label_296: flag = true; if ((int) Main.tile[x, j1 + 1].frameX != (int) Main.tile[x, j1].frameX) flag = true; - if (!flag && !WorldGen.UpdateStalagtiteStyle(x, j1)) - flag = true; - if (!flag) - return; - WorldGen.destroyObject = true; - if ((int) Main.tile[x, j1].type == (int) Main.tile[x, j].type) - WorldGen.KillTile(x, j1); - if ((int) Main.tile[x, j1 + 1].type == (int) Main.tile[x, j].type) + if (flag) + { + if ((int) Main.tile[x, j1].type == (int) Main.tile[x, j].type) + WorldGen.KillTile(x, j1); + if ((int) Main.tile[x, j1 + 1].type != (int) Main.tile[x, j].type) + return; WorldGen.KillTile(x, j1 + 1); - WorldGen.destroyObject = false; + } + else + WorldGen.TightBiome(x, j1); } } @@ -23504,13 +17222,7 @@ label_296: Main.tile[index1, index2].frameY &= (short) -8193; } - public static int PlaceXmasTree_Direct( - int x, - int y, - int type, - int style, - int dir, - int alternate) + public static int PlaceXmasTree_Direct(int x, int y, int type, int style, int dir) { for (short index1 = 0; index1 < (short) 4; ++index1) { @@ -23670,230 +17382,6 @@ label_296: } } - public static int GetItemDrop_Benches(int style) - { - switch (style) - { - case 1: - return 2397; - case 2: - return 2398; - case 3: - return 2399; - case 4: - return 2400; - case 5: - return 2401; - case 6: - return 2402; - case 7: - return 2403; - case 8: - return 2404; - case 9: - return 2405; - case 10: - return 2406; - case 11: - return 2407; - case 12: - return 2408; - case 13: - return 2409; - case 14: - return 2410; - case 15: - return 2411; - case 16: - return 2412; - case 17: - return 2413; - case 18: - return 2414; - case 19: - return 2415; - case 20: - return 2416; - case 21: - return 2521; - case 22: - return 2527; - case 23: - return 2539; - case 24: - return 858; - case 25: - return 2582; - case 26: - return 2634; - case 27: - return 2635; - case 28: - return 2636; - case 29: - return 2823; - case 30: - return 3150; - case 31: - return 3152; - case 32: - return 3151; - case 33: - return 3918; - case 34: - return 3919; - case 35: - return 3947; - case 36: - return 3973; - case 37: - return 4161; - case 38: - return 4182; - case 39: - return 4203; - case 40: - return 4224; - case 41: - return 4313; - case 42: - return 4582; - case 43: - return 4993; - default: - return 335; - } - } - - public static int GetItemDrop_PicnicTables(int style) => style == 0 || style != 1 ? 4064 : 4065; - - public static int GetItemDrop_Chair(int style) - { - switch (style) - { - case 1: - return 358; - case 2: - return 628; - case 3: - return 629; - case 4: - return 630; - case 5: - return 806; - case 6: - return 807; - case 7: - return 808; - case 8: - return 809; - case 9: - return 810; - case 10: - return 826; - case 11: - return 915; - case 12: - return 1143; - case 13: - return 1396; - case 14: - return 1399; - case 15: - return 1402; - case 16: - return 1459; - case 17: - return 1509; - case 18: - case 19: - case 20: - case 21: - case 22: - case 23: - return 1703 + style - 18; - case 24: - return 1792; - case 25: - return 1814; - case 26: - return 1925; - case 27: - return 2228; - case 28: - return 2288; - case 29: - return 2524; - case 30: - return 2557; - case 31: - return 2572; - case 32: - return 2812; - case 33: - return 3174; - case 34: - return 3176; - case 35: - return 3175; - case 36: - return 3889; - case 37: - return 3937; - case 38: - return 3963; - case 39: - return 4151; - case 40: - return 4172; - case 41: - return 4193; - case 42: - return 4214; - case 43: - return 4304; - case 44: - return 4572; - default: - return 34; - } - } - - public static int GetItemDrop_Toilet(int style) - { - int num = 4096 + style; - switch (style) - { - case 32: - num = 4141; - break; - case 33: - num = 4165; - break; - case 34: - num = 4186; - break; - case 35: - num = 4207; - break; - case 36: - num = 4228; - break; - case 37: - num = 4316; - break; - case 38: - num = 4586; - break; - case 39: - num = 4731; - break; - } - if (num > 4731) - num = 4731; - return num; - } - public static void Check1x2(int x, int j, ushort type) { if (WorldGen.destroyObject) @@ -23905,20 +17393,17 @@ label_296: if (Main.tile[x, j1 + 1] == null) Main.tile[x, j1 + 1] = new Tile(); int frameY = (int) Main.tile[x, j1].frameY; - int style = 0; + int num1 = 0; while (frameY >= 40) { frameY -= 40; - ++style; + ++num1; } if (frameY == 18) --j1; - int num1 = (int) Main.tile[x, j1].frameX / 18; - if (Main.tile[x, j1].frameX == (short) -1) - num1 = (int) Main.tile[x, j1 + 1].frameX / 18; if (Main.tile[x, j1] == null) Main.tile[x, j1] = new Tile(); - if ((int) Main.tile[x, j1].frameY == 40 * style && (int) Main.tile[x, j1 + 1].frameY == 40 * style + 18 && (int) Main.tile[x, j1].type == (int) type && (int) Main.tile[x, j1 + 1].type == (int) type) + if ((int) Main.tile[x, j1].frameY == 40 * num1 && (int) Main.tile[x, j1 + 1].frameY == 40 * num1 + 18 && (int) Main.tile[x, j1].type == (int) type && (int) Main.tile[x, j1 + 1].type == (int) type) flag = false; if (Main.tile[x, j1 + 2] == null) Main.tile[x, j1 + 2] = new Tile(); @@ -23932,7 +17417,6 @@ label_296: switch (type1) { case 2: - case 477: num3 = 0; break; case 23: @@ -23945,7 +17429,6 @@ label_296: num3 = 2; break; case 109: - case 492: num3 = 5; break; case 112: @@ -23982,51 +17465,19 @@ label_296: if ((int) Main.tile[x, j1 + 1].type == (int) type) WorldGen.KillTile(x, j1 + 1); if (type == (ushort) 216) - Item.NewItem(x * 16, j1 * 16, 32, 32, 970 + style); + Item.NewItem(x * 16, j1 * 16, 32, 32, 970 + num1); if (type == (ushort) 338) Item.NewItem(x * 16, j1 * 16, 32, 32, 2738); if (type == (ushort) 390) Item.NewItem(x * 16, j1 * 16, 16, 32, 3253); - if (type == (ushort) 493) - { - int Type = 0; - switch (num1) - { - case 0: - Type = 4083; - break; - case 1: - Type = 4084; - break; - case 2: - Type = 4085; - break; - case 3: - Type = 4086; - break; - case 4: - Type = 4087; - break; - case 5: - Type = 4088; - break; - } - if (Type > 0) - Item.NewItem(x * 16, j1 * 16, 32, 32, Type); - } if (type == (ushort) 15) { - int itemDropChair = WorldGen.GetItemDrop_Chair(style); - Item.NewItem(x * 16, j1 * 16, 32, 32, itemDropChair); - } - if (type == (ushort) 497) - { - int itemDropToilet = WorldGen.GetItemDrop_Toilet(style); - Item.NewItem(x * 16, j1 * 16, 32, 32, itemDropToilet); + int Type = num1 < 18 || num1 > 23 ? (num1 != 5 ? (num1 != 6 ? (num1 != 7 ? (num1 != 8 ? (num1 != 9 ? (num1 != 10 ? (num1 != 11 ? (num1 != 13 ? (num1 != 14 ? (num1 != 15 ? (num1 != 12 ? (num1 != 4 ? (num1 != 3 ? (num1 != 2 ? (num1 != 17 ? (num1 != 1 ? (num1 != 24 ? (num1 != 25 ? (num1 != 16 ? (num1 != 26 ? (num1 != 27 ? (num1 != 28 ? (num1 != 29 ? (num1 != 30 ? (num1 != 31 ? (num1 != 32 ? (num1 != 33 ? (num1 != 34 ? (num1 != 35 ? (num1 != 36 ? 34 : 3889) : 3175) : 3176) : 3174) : 2812) : 2572) : 2557) : 2524) : 2288) : 2228) : 1925) : 1459) : 1814) : 1792) : 358) : 1509) : 628) : 629) : 630) : 1143) : 1402) : 1399) : 1396) : 915) : 826) : 810) : 809) : 808) : 807) : 806) : 1703 + num1 - 18; + Item.NewItem(x * 16, j1 * 16, 32, 32, Type); } else if (type == (ushort) 134) { - if (style == 1) + if (num1 == 1) Item.NewItem(x * 16, j1 * 16, 32, 32, 1220); else Item.NewItem(x * 16, j1 * 16, 32, 32, 525); @@ -24036,32 +17487,16 @@ label_296: public static void CheckOnTable1x1(int x, int y, int type) { - if (Main.tile[x, y + 1] == null) + if (Main.tile[x, y + 1] == null || Main.tile[x, y + 1].active() && Main.tileTable[(int) Main.tile[x, y + 1].type] && !Main.tile[x, y + 1].topSlope() && !Main.tile[x, y + 1].halfBrick()) return; - if (Main.tile[x, y + 1].topSlope()) + if (type == 78) { - if (TileID.Sets.Platforms[(int) Main.tile[x, y + 1].type]) - { - if (Main.tile[x, y + 1].blockType() == 3 && Main.tile[x - 1, y + 1].active() && Main.tile[x - 1, y + 1].blockType() == 0 && TileID.Sets.Platforms[(int) Main.tile[x - 1, y + 1].type] || Main.tile[x, y + 1].blockType() == 2 && Main.tile[x + 1, y + 1].active() && Main.tile[x + 1, y + 1].blockType() == 0 && TileID.Sets.Platforms[(int) Main.tile[x + 1, y + 1].type]) - return; - WorldGen.KillTile(x, y); - } - else - WorldGen.KillTile(x, y); + if (WorldGen.SolidTile2(x, y + 1)) + return; + WorldGen.KillTile(x, y); } else - { - if (Main.tile[x, y + 1].active() && Main.tileTable[(int) Main.tile[x, y + 1].type] && !Main.tile[x, y + 1].halfBrick()) - return; - if (type == 78) - { - if (WorldGen.SolidTileAllowBottomSlope(x, y + 1)) - return; - WorldGen.KillTile(x, y); - } - else - WorldGen.KillTile(x, y); - } + WorldGen.KillTile(x, y); } public static void CheckSign(int x, int y, ushort type) @@ -24086,61 +17521,59 @@ label_296: int num5 = (int) Main.tile[x, y].frameX / 18; int num6 = (int) Main.tile[x, y].frameY / 18; int num7 = num5 % 2; - int num8 = num6 % 2; - int index3 = x - num7; - int index4 = y - num8; - int num9 = (int) Main.tile[index3, index4].frameX / 18 / 2; - int num10 = (int) Main.tile[index3, index4].frameY / 18 / 2; - int num11 = (int) Main.tile[x, y].frameX / 18; - int num12 = 0; - while (num11 > 1) + int x1 = x - num7; + int y1 = y - num6; + int num8 = (int) Main.tile[x1, y1].frameX / 18 / 2; + int num9 = (int) Main.tile[x, y].frameX / 18; + int num10 = 0; + while (num9 > 1) { - num11 -= 2; - ++num12; + num9 -= 2; + ++num10; } - int num13 = index3; - int num14 = index3 + 2; - int num15 = index4; - int num16 = index4 + 2; - int num17 = 0; - for (int index5 = num13; index5 < num14; ++index5) + int num11 = x1; + int num12 = x1 + 2; + int num13 = y1; + int num14 = y1 + 2; + int num15 = 0; + for (int index3 = num11; index3 < num12; ++index3) { - int num18 = 0; - for (int index6 = num15; index6 < num16; ++index6) + int num16 = 0; + for (int index4 = num13; index4 < num14; ++index4) { - if (!Main.tile[index5, index6].active() || (int) Main.tile[index5, index6].type != (int) type) + if (!Main.tile[index3, index4].active() || (int) Main.tile[index3, index4].type != (int) type) { flag = true; break; } - if ((int) Main.tile[index5, index6].frameX / 18 != num17 + num9 * 2 || (int) Main.tile[index5, index6].frameY / 18 != num18 + num10 * 2) + if ((int) Main.tile[index3, index4].frameX / 18 != num15 + num8 * 2 || (int) Main.tile[index3, index4].frameY / 18 != num16) { flag = true; break; } - ++num18; + ++num16; } - ++num17; + ++num15; } if (!flag) { if (type == (ushort) 85) { - if (WorldGen.SolidTileAllowBottomSlope(index3, index4 + 2) && WorldGen.SolidTileAllowBottomSlope(index3 + 1, index4 + 2)) - num9 = num12; + if (Main.tile[x1, y1 + 2].active() && (Main.tileSolid[(int) Main.tile[x1, y1 + 2].type] || Main.tileSolidTop[(int) Main.tile[x1, y1 + 2].type]) && Main.tile[x1 + 1, y1 + 2].active() && (Main.tileSolid[(int) Main.tile[x1 + 1, y1 + 2].type] || Main.tileSolidTop[(int) Main.tile[x1 + 1, y1 + 2].type])) + num8 = num10; else flag = true; } - else if (WorldGen.TopEdgeCanBeAttachedTo(index3, index4 + 2) && WorldGen.TopEdgeCanBeAttachedTo(index3 + 1, index4 + 2)) - num9 = 0; - else if (WorldGen.BottomEdgeCanBeAttachedTo(index3, index4 - 1) && WorldGen.BottomEdgeCanBeAttachedTo(index3 + 1, index4 - 1)) - num9 = 1; - else if (WorldGen.RightEdgeCanBeAttachedTo(index3 - 1, index4) && WorldGen.RightEdgeCanBeAttachedTo(index3 - 1, index4 + 1)) - num9 = 2; - else if (WorldGen.LeftEdgeCanBeAttachedTo(index3 + 2, index4) && WorldGen.LeftEdgeCanBeAttachedTo(index3 + 2, index4 + 1)) - num9 = 3; - else if (Main.tile[index3, index4].wall > (ushort) 0 && Main.tile[index3 + 1, index4].wall > (ushort) 0 && Main.tile[index3, index4 + 1].wall > (ushort) 0 && Main.tile[index3 + 1, index4 + 1].wall > (ushort) 0) - num9 = 4; + else if (Main.tile[x1, y1 + 2].active() && (Main.tileSolid[(int) Main.tile[x1, y1 + 2].type] || Main.tileSolidTop[(int) Main.tile[x1, y1 + 2].type] && !Main.tileNoAttach[(int) Main.tile[x1, y1 + 2].type]) && Main.tile[x1 + 1, y1 + 2].active() && (Main.tileSolid[(int) Main.tile[x1 + 1, y1 + 2].type] || Main.tileSolidTop[(int) Main.tile[x1 + 1, y1 + 2].type] && !Main.tileNoAttach[(int) Main.tile[x1 + 1, y1 + 2].type])) + num8 = 0; + else if (Main.tile[x1, y1 - 1].nactive() && Main.tileSolid[(int) Main.tile[x1, y1 - 1].type] && !Main.tileSolidTop[(int) Main.tile[x1, y1 - 1].type] && !Main.tileNoAttach[(int) Main.tile[x1, y1 - 1].type] && Main.tile[x1 + 1, y1 - 1].nactive() && Main.tileSolid[(int) Main.tile[x1 + 1, y1 - 1].type] && !Main.tileSolidTop[(int) Main.tile[x1 + 1, y1 - 1].type] && !Main.tileNoAttach[(int) Main.tile[x1 + 1, y1 - 1].type]) + num8 = 1; + else if (Main.tile[x1 - 1, y1].nactive() && Main.tileSolid[(int) Main.tile[x1 - 1, y1].type] && !Main.tileSolidTop[(int) Main.tile[x1 - 1, y1].type] && !Main.tileNoAttach[(int) Main.tile[x1 - 1, y1].type] && Main.tile[x1 - 1, y1 + 1].nactive() && Main.tileSolid[(int) Main.tile[x1 - 1, y1 + 1].type] && !Main.tileSolidTop[(int) Main.tile[x1 - 1, y1 + 1].type] && !Main.tileNoAttach[(int) Main.tile[x1 - 1, y1 + 1].type]) + num8 = 2; + else if (Main.tile[x1 + 2, y1].nactive() && Main.tileSolid[(int) Main.tile[x1 + 2, y1].type] && !Main.tileSolidTop[(int) Main.tile[x1 + 2, y1].type] && !Main.tileNoAttach[(int) Main.tile[x1 + 2, y1].type] && Main.tile[x1 + 2, y1 + 1].nactive() && Main.tileSolid[(int) Main.tile[x1 + 2, y1 + 1].type] && !Main.tileSolidTop[(int) Main.tile[x1 + 2, y1 + 1].type] && !Main.tileNoAttach[(int) Main.tile[x1 + 2, y1 + 1].type]) + num8 = 3; + else if (Main.tile[x1, y1].wall > (byte) 0 && Main.tile[x1 + 1, y1].wall > (byte) 0 && Main.tile[x1, y1 + 1].wall > (byte) 0 && Main.tile[x1 + 1, y1 + 1].wall > (byte) 0) + num8 = 4; else flag = true; } @@ -24148,68 +17581,58 @@ label_296: { if (type == (ushort) 395) { - int key = TEItemFrame.Find(index3, index4); + int key = TEItemFrame.Find(x1, y1); if (key != -1 && ((TEItemFrame) TileEntity.ByID[key]).item.stack > 0) { ((TEItemFrame) TileEntity.ByID[key]).DropItem(); - if (Main.netMode != 2) - Main.LocalPlayer.InterruptItemUsageIfOverTile(395); + if (Main.netMode == 2) + return; + Main.blockMouse = true; + return; } } WorldGen.destroyObject = true; - for (int i = num13; i < num14; ++i) + for (int i = num11; i < num12; ++i) { - for (int j = num15; j < num16; ++j) + for (int j = num13; j < num14; ++j) { if ((int) Main.tile[i, j].type == (int) type) WorldGen.KillTile(i, j); } } if (type != (ushort) 395) - Sign.KillSign(index3, index4); + Sign.KillSign(x1, y1); if (type == (ushort) 85) { int Type = 321; - if (num12 >= 6 && num12 <= 10) - Type = 3229 + num12 - 6; - else if (num12 >= 1 && num12 <= 5) - Type = 1173 + num12 - 1; + if (num10 >= 6 && num10 <= 10) + Type = 3229 + num10 - 6; + else if (num10 >= 1 && num10 <= 5) + Type = 1173 + num10 - 1; Item.NewItem(x * 16, y * 16, 32, 32, Type); - if (Main.netMode != 1 && WorldGen.genRand.Next(2) == 0 && NPC.CountNPCS(316) < 2) - { - int closest = (int) Player.FindClosest(new Vector2((float) (x * 16), (float) (y * 16)), 16, 16); - if (Main.player[closest].ZoneGraveyard || !Main.dayTime || (double) y > Main.worldSurface) - NPC.SpawnOnPlayer(closest, 316); - } } else if (type == (ushort) 395) { - Item.NewItem(index3 * 16, index4 * 16, 32, 32, 3270); - TEItemFrame.Kill(index3, index4); + Item.NewItem(x1 * 16, y1 * 16, 32, 32, 3270); + TEItemFrame.Kill(x1, y1); } else if (type == (ushort) 425) - Item.NewItem(index3 * 16, index4 * 16, 32, 32, 3617); - else if (type == (ushort) 573) - Item.NewItem(index3 * 16, index4 * 16, 32, 32, 4710); - else if (type == (ushort) 511) - Item.NewItem(index3 * 16, index4 * 16, 32, 32, 4320); - else if (type == (ushort) 510) - Item.NewItem(index3 * 16, index4 * 16, 32, 32, 4319); + Item.NewItem(x1 * 16, y1 * 16, 32, 32, 3617); else Item.NewItem(x * 16, y * 16, 32, 32, 171); WorldGen.destroyObject = false; } else { - int num19 = 36 * num9; - for (int index7 = 0; index7 < 2; ++index7) + int num17 = 36 * num8; + for (int index5 = 0; index5 < 2; ++index5) { - for (int index8 = 0; index8 < 2; ++index8) + for (int index6 = 0; index6 < 2; ++index6) { - Main.tile[index3 + index7, index4 + index8].active(true); - Main.tile[index3 + index7, index4 + index8].type = type; - Main.tile[index3 + index7, index4 + index8].frameX = (short) (num19 + 18 * index7); - Main.tile[index3 + index7, index4 + index8].frameY = (short) (18 * index8 + num10 * 36); + Main.tile[x1 + index5, y1 + index6].active(true); + Main.tile[x1 + index5, y1 + index6].type = type; + Main.tile[x1 + index5, y1 + index6].frameX = (short) (num17 + 18 * index5); + Main.tile[x1 + index5, y1 + index6].frameY = (short) (18 * index6); } } } @@ -24234,7 +17657,7 @@ label_296: int index3 = x; int index4 = y; int num5 = 0; - if (type == (ushort) 55 || type == (ushort) 425 || type == (ushort) 510 || type == (ushort) 511) + if (type == (ushort) 55 || type == (ushort) 425) { if (WorldGen.SolidTile2(x, y + 1) && WorldGen.SolidTile2(x + 1, y + 1)) { @@ -24252,7 +17675,7 @@ label_296: } else { - if (Main.tile[index3, index4].wall <= (ushort) 0 || Main.tile[index3 + 1, index4].wall <= (ushort) 0 || Main.tile[index3, index4 + 1].wall <= (ushort) 0 || Main.tile[index3 + 1, index4 + 1].wall <= (ushort) 0) + if (Main.tile[index3, index4].wall <= (byte) 0 || Main.tile[index3 + 1, index4].wall <= (byte) 0 || Main.tile[index3, index4 + 1].wall <= (byte) 0 || Main.tile[index3 + 1, index4 + 1].wall <= (byte) 0) return false; num5 = 4; } @@ -24460,7 +17883,7 @@ label_296: public static bool paintWall(int x, int y, byte color, bool broadCast = false) { - if (Main.tile[x, y] == null || Main.tile[x, y].wall == (ushort) 0) + if (Main.tile[x, y] == null || Main.tile[x, y].wall == (byte) 0) return false; byte oldColor = Main.tile[x, y].wallColor(); Main.tile[x, y].wallColor(color); @@ -24479,7 +17902,7 @@ label_296: { for (int index2 = num2; index2 < num2 + 3; ++index2) { - if (Main.tile[index1, index2].active() || Main.tile[index1, index2].wall == (ushort) 0) + if (Main.tile[index1, index2].active() || Main.tile[index1, index2].wall == (byte) 0) { flag = false; break; @@ -24533,7 +17956,7 @@ label_296: { for (int index2 = num6; index2 < num6 + 3; ++index2) { - if ((int) Main.tile[index1, index2].type != type || !Main.tile[index1, index2].active() || Main.tile[index1, index2].wall <= (ushort) 0 || (int) Main.tile[index1, index2].frameX != num8 + (index1 - num4) * 18 || (int) Main.tile[index1, index2].frameY != num7 + (index2 - num6) * 18) + if ((int) Main.tile[index1, index2].type != type || !Main.tile[index1, index2].active() || Main.tile[index1, index2].wall <= (byte) 0 || (int) Main.tile[index1, index2].frameX != num8 + (index1 - num4) * 18 || (int) Main.tile[index1, index2].frameY != num7 + (index2 - num6) * 18) { flag = true; break; @@ -24620,27 +18043,7 @@ label_296: case 62: Item.NewItem(x * 16, y * 16, 32, 32, 3868); break; - case 69: - Item.NewItem(x * 16, y * 16, 32, 32, 4660); - break; - case 70: - Item.NewItem(x * 16, y * 16, 32, 32, 4723); - break; - case 71: - Item.NewItem(x * 16, y * 16, 32, 32, 4724); - break; - case 72: - Item.NewItem(x * 16, y * 16, 32, 32, 4783); - break; - case 73: - Item.NewItem(x * 16, y * 16, 32, 32, 4958); - break; default: - if (num9 >= 63 && num9 <= 68) - { - Item.NewItem(x * 16, y * 16, 32, 32, 4626 + num9 - 63); - break; - } if (num9 >= 41 && num9 <= 45) { Item.NewItem(x * 16, y * 16, 32, 32, 2114 + num9 - 41); @@ -24725,7 +18128,7 @@ label_296: { for (int index2 = num2; index2 < num2 + 3; ++index2) { - if (Main.tile[index1, index2].active() || Main.tile[index1, index2].wall == (ushort) 0) + if (Main.tile[index1, index2].active() || Main.tile[index1, index2].wall == (byte) 0) { flag = false; break; @@ -24768,7 +18171,7 @@ label_296: { for (int index2 = num4; index2 < num4 + 3; ++index2) { - if ((int) Main.tile[index1, index2].type != type || !Main.tile[index1, index2].active() || Main.tile[index1, index2].wall <= (ushort) 0 || (int) Main.tile[index1, index2].frameX != num5 + (index1 - num3) * 18 || (int) Main.tile[index1, index2].frameY != (index2 - num4) * 18) + if ((int) Main.tile[index1, index2].type != type || !Main.tile[index1, index2].active() || Main.tile[index1, index2].wall <= (byte) 0 || (int) Main.tile[index1, index2].frameX != num5 + (index1 - num3) * 18 || (int) Main.tile[index1, index2].frameY != (index2 - num4) * 18) { flag = true; break; @@ -24796,24 +18199,6 @@ label_296: case 6: Item.NewItem(x * 16, y * 16, 32, 32, 1577); break; - case 7: - Item.NewItem(x * 16, y * 16, 32, 32, 4638); - break; - case 8: - Item.NewItem(x * 16, y * 16, 32, 32, 4639); - break; - case 9: - Item.NewItem(x * 16, y * 16, 32, 32, 4659); - break; - case 10: - Item.NewItem(x * 16, y * 16, 32, 32, 4726); - break; - case 11: - Item.NewItem(x * 16, y * 16, 32, 32, 4727); - break; - case 12: - Item.NewItem(x * 16, y * 16, 32, 32, 4728); - break; default: Item.NewItem(x * 16, y * 16, 32, 32, 1474 + num1); break; @@ -24831,7 +18216,7 @@ label_296: { for (int index2 = num2; index2 < num2 + 2; ++index2) { - if (Main.tile[index1, index2].active() || Main.tile[index1, index2].wall == (ushort) 0) + if (Main.tile[index1, index2].active() || Main.tile[index1, index2].wall == (byte) 0) { flag = false; break; @@ -24874,7 +18259,7 @@ label_296: { for (int index2 = num3; index2 < num3 + 2; ++index2) { - if ((int) Main.tile[index1, index2].type != type || !Main.tile[index1, index2].active() || Main.tile[index1, index2].wall <= (ushort) 0 || (int) Main.tile[index1, index2].frameY != num5 + (index2 - num3) * 18 || (int) Main.tile[index1, index2].frameX != (index1 - num4) * 18) + if ((int) Main.tile[index1, index2].type != type || !Main.tile[index1, index2].active() || Main.tile[index1, index2].wall <= (byte) 0 || (int) Main.tile[index1, index2].frameY != num5 + (index2 - num3) * 18 || (int) Main.tile[index1, index2].frameX != (index1 - num4) * 18) { flag = true; break; @@ -24905,12 +18290,6 @@ label_296: case 18: Item.NewItem(x * 16, y * 16, 32, 32, 1908); break; - case 19: - Item.NewItem(x * 16, y * 16, 32, 32, 4661); - break; - case 20: - Item.NewItem(x * 16, y * 16, 32, 32, 4729); - break; default: Item.NewItem(x * 16, y * 16, 32, 32, 1479 + num1); break; @@ -24928,7 +18307,7 @@ label_296: { for (int index2 = num2; index2 < num2 + 3; ++index2) { - if (Main.tile[index1, index2].active() || Main.tile[index1, index2].wall == (ushort) 0) + if (Main.tile[index1, index2].active() || Main.tile[index1, index2].wall == (byte) 0) { flag = false; break; @@ -24971,7 +18350,7 @@ label_296: { for (int index2 = num3; index2 < num3 + 3; ++index2) { - if ((int) Main.tile[index1, index2].type != type || !Main.tile[index1, index2].active() || Main.tile[index1, index2].wall <= (ushort) 0 || (int) Main.tile[index1, index2].frameY != num5 + (index2 - num3) * 18 || (int) Main.tile[index1, index2].frameX != (index1 - num4) * 18) + if ((int) Main.tile[index1, index2].type != type || !Main.tile[index1, index2].active() || Main.tile[index1, index2].wall <= (byte) 0 || (int) Main.tile[index1, index2].frameY != num5 + (index2 - num3) * 18 || (int) Main.tile[index1, index2].frameX != (index1 - num4) * 18) { flag = true; break; @@ -25003,7 +18382,7 @@ label_296: { for (int index2 = num2; index2 < num2 + 4; ++index2) { - if (Main.tile[index1, index2].active() || Main.tile[index1, index2].wall == (ushort) 0) + if (Main.tile[index1, index2].active() || Main.tile[index1, index2].wall == (byte) 0) { flag = false; break; @@ -25046,7 +18425,7 @@ label_296: { for (int index2 = num6; index2 < num6 + 4; ++index2) { - if ((int) Main.tile[index1, index2].type != type || !Main.tile[index1, index2].active() || Main.tile[index1, index2].wall <= (ushort) 0 || (int) Main.tile[index1, index2].frameY != num8 + (index2 - num6) * 18 || (int) Main.tile[index1, index2].frameX != num9 + (index1 - num7) * 18) + if ((int) Main.tile[index1, index2].type != type || !Main.tile[index1, index2].active() || Main.tile[index1, index2].wall <= (byte) 0 || (int) Main.tile[index1, index2].frameY != num8 + (index2 - num6) * 18 || (int) Main.tile[index1, index2].frameX != num9 + (index1 - num7) * 18) { flag = true; break; @@ -25066,92 +18445,34 @@ label_296: } if (type == 242) { - switch (num3) - { - case 30: - Item.NewItem(x * 16, y * 16, 32, 32, 2995); - break; - case 43: - Item.NewItem(x * 16, y * 16, 32, 32, 4658); - break; - case 44: - Item.NewItem(x * 16, y * 16, 32, 32, 4725); - break; - default: - if (num3 >= 37 && num3 <= 42) - { - Item.NewItem(x * 16, y * 16, 32, 32, 4632 + num3 - 37); - break; - } - if (num3 >= 31 && num3 <= 35) - { - Item.NewItem(x * 16, y * 16, 32, 32, 3055 + num3 - 31); - break; - } - if (num3 >= 27 && num3 <= 29) - { - Item.NewItem(x * 16, y * 16, 32, 32, 2865 + num3 - 27); - break; - } - if (num3 == 36) - { - Item.NewItem(x * 16, y * 16, 32, 32, 3596); - break; - } - if (num3 == 26) - { - Item.NewItem(x * 16, y * 16, 32, 32, 2497); - break; - } - if (num3 == 25) - { - Item.NewItem(x * 16, y * 16, 32, 32, 2495); - break; - } - if (num3 >= 22) - { - Item.NewItem(x * 16, y * 16, 32, 32, 2281 + num3 - 22); - break; - } - if (num3 >= 17) - { - Item.NewItem(x * 16, y * 16, 32, 32, 1846 + num3 - 17); - break; - } - if (num3 == 16) - { - Item.NewItem(x * 16, y * 16, 32, 32, 1573); - break; - } - if (num3 >= 13) - { - Item.NewItem(x * 16, y * 16, 32, 32, 1500 + num3 - 13); - break; - } - if (num3 >= 6) - { - Item.NewItem(x * 16, y * 16, 32, 32, 1433 + num3 - 6); - break; - } - Item.NewItem(x * 16, y * 16, 32, 32, 1421 + num3); - break; - } + if (num3 == 30) + Item.NewItem(x * 16, y * 16, 32, 32, 2995); + else if (num3 >= 31 && num3 <= 35) + Item.NewItem(x * 16, y * 16, 32, 32, 3055 + num3 - 31); + else if (num3 >= 27 && num3 <= 29) + Item.NewItem(x * 16, y * 16, 32, 32, 2865 + num3 - 27); + else if (num3 == 36) + Item.NewItem(x * 16, y * 16, 32, 32, 3596); + else if (num3 == 26) + Item.NewItem(x * 16, y * 16, 32, 32, 2497); + else if (num3 == 25) + Item.NewItem(x * 16, y * 16, 32, 32, 2495); + else if (num3 >= 22) + Item.NewItem(x * 16, y * 16, 32, 32, 2281 + num3 - 22); + else if (num3 >= 17) + Item.NewItem(x * 16, y * 16, 32, 32, 1846 + num3 - 17); + else if (num3 == 16) + Item.NewItem(x * 16, y * 16, 32, 32, 1573); + else if (num3 >= 13) + Item.NewItem(x * 16, y * 16, 32, 32, 1500 + num3 - 13); + else if (num3 >= 6) + Item.NewItem(x * 16, y * 16, 32, 32, 1433 + num3 - 6); + else + Item.NewItem(x * 16, y * 16, 32, 32, 1421 + num3); } WorldGen.destroyObject = false; } - private static int RollRandomSeaShellStyle() - { - int num = WorldGen.genRand.Next(2); - if (WorldGen.genRand.Next(10) == 0) - num = 2; - if (WorldGen.genRand.Next(10) == 0) - num = 3; - if (WorldGen.genRand.Next(50) == 0) - num = 4; - return num; - } - public static void Place1x1(int x, int y, int type, int style = 0) { Tile tile = Main.tile[x, y]; @@ -25168,7 +18489,7 @@ label_296: return; tile.active(true); tile.type = (ushort) type; - tile.frameX = (short) (22 * WorldGen.genRand.Next(3)); + tile.frameX = (short) (22 * WorldGen.genRand.Next(2)); tile.frameY = (short) (22 * style); } else @@ -25186,7 +18507,7 @@ label_296: tile.frameY = (short) 0; break; case 324: - tile.frameX = (short) (22 * WorldGen.RollRandomSeaShellStyle()); + tile.frameX = (short) (22 * WorldGen.genRand.Next(2)); tile.frameY = (short) (22 * style); break; default: @@ -25203,21 +18524,6 @@ label_296: WorldGen.KillTile(x, y); } - public static void CheckGolf1x1(int x, int y, int type) - { - Tile tile = Main.tile[x, y]; - bool flag = false; - if ((int) tile.frameX % 18 != 0) - flag = true; - if ((int) tile.frameY % 18 != 0) - flag = true; - if (!WorldGen.SolidTileAllowBottomSlope(x, y + 1)) - flag = true; - if (!flag) - return; - WorldGen.KillTile(x, y); - } - public static void CheckLogicTiles(int x, int y, int type) { if (type == 419) @@ -25312,7 +18618,7 @@ label_296: switch (style) { case 0: - if (Main.tile[x, y + 1].type != (ushort) 2 && Main.tile[x, y + 1].type != (ushort) 477 && Main.tile[x, y + 1].type != (ushort) 492 && Main.tile[x, y + 1].type != (ushort) 78 && Main.tile[x, y + 1].type != (ushort) 380 && Main.tile[x, y + 1].type != (ushort) 109) + if (Main.tile[x, y + 1].type != (ushort) 2 && Main.tile[x, y + 1].type != (ushort) 78 && Main.tile[x, y + 1].type != (ushort) 380 && Main.tile[x, y + 1].type != (ushort) 109) flag = true; if (Main.tile[x, y].liquid > (byte) 0) { @@ -25457,136 +18763,40 @@ label_296: NetMessage.SendTileSquare(-1, index1, index2, 3); } - private static bool GrowMoreVines(int x, int y) - { - if (!WorldGen.InWorld(x, y, 30)) - return false; - int num1 = 4; - int num2 = 6; - int num3 = 10; - int num4 = 60; - int num5 = 0; - int num6 = y; - if (Main.tile[x, y].type == (ushort) 528) - num4 /= 5; - for (int index1 = x - num1; index1 <= x + num1; ++index1) - { - for (int index2 = num6 - num2; index2 <= num6 + num3; ++index2) - { - if (TileID.Sets.IsVine[(int) Main.tile[index1, index2].type]) - { - ++num5; - if (index2 > y && Collision.CanHitLine(new Vector2((float) (x * 16), (float) (y * 16)), 1, 1, new Vector2((float) (index1 * 16), (float) (index2 * 16)), 1, 1)) - { - if (Main.tile[index1, index2].type == (ushort) 528) - num5 += (index2 - y) * 20; - else - num5 += (index2 - y) * 2; - } - if (num5 > num4) - return false; - } - } - } - return true; - } - - private static void MatureTheHerbPlants() - { - for (int i = 10; i < Main.maxTilesX - 10; ++i) - { - for (int index = 10; index < Main.maxTilesY - 10; ++index) - { - if ((double) index > Main.rockLayer && (Main.tile[i, index + 1].type == (ushort) 59 || Main.tile[i, index + 1].type == (ushort) 0) && WorldGen.SolidTile(i, index + 1) && !Main.tile[i, index].active() && Main.tile[i, index].liquid == (byte) 0 && WorldGen.genRand.Next(25) == 0) - { - Main.tile[i, index].active(true); - Main.tile[i, index].type = (ushort) 82; - Main.tile[i, index].frameX = (short) 36; - Main.tile[i, index].frameY = (short) 0; - } - if (Main.tile[i, index].type == (ushort) 82 && WorldGen.genRand.Next(3) == 0) - { - Main.tile[i, index].type = (ushort) 83; - if (Main.tile[i, index].frameX == (short) 36 && WorldGen.genRand.Next(2) == 0) - Main.tile[i, index].type = (ushort) 84; - if (Main.tile[i, index].frameX == (short) 108 && WorldGen.genRand.Next(3) == 0) - Main.tile[i, index].type = (ushort) 84; - } - } - } - } - public static void GrowAlch(int x, int y) { if (!Main.tile[x, y].active()) return; - if (Main.tile[x, y].liquid > (byte) 0) + if (Main.tile[x, y].type == (ushort) 82 && WorldGen.genRand.Next(50) == 0) { - int num = (int) Main.tile[x, y].frameX / 18; - if ((!Main.tile[x, y].lava() || num != 5) && (Main.tile[x, y].liquidType() != (byte) 0 || num != 1 && num != 4)) + bool flag = false; + if (Main.tile[x, y].frameX == (short) 108) { - WorldGen.KillTile(x, y); - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, x, y, 1); - WorldGen.SquareTileFrame(x, y); - } - } - if (Main.tile[x, y].type == (ushort) 82) - { - if (WorldGen.genRand.Next(50) == 0) - { - bool flag = false; - if (Main.tile[x, y].frameX == (short) 108) - { - if (WorldGen.genRand.Next(2) == 0) - flag = true; - } - else + if (WorldGen.genRand.Next(3) != 0) flag = true; - if (!flag) - return; - Main.tile[x, y].type = (ushort) 83; - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, x, y, 1); - WorldGen.SquareTileFrame(x, y); - } - else if (Main.dayTime && Main.tile[x, y].type == (ushort) 82 && Main.tile[x, y].frameX == (short) 0 && WorldGen.genRand.Next(50) == 0) - { - Main.tile[x, y].type = (ushort) 83; - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, x, y, 1); - WorldGen.SquareTileFrame(x, y); - } - else if (!Main.dayTime && Main.tile[x, y].type == (ushort) 82 && Main.tile[x, y].frameX == (short) 18 && WorldGen.genRand.Next(50) == 0) - { - Main.tile[x, y].type = (ushort) 83; - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, x, y, 1); - WorldGen.SquareTileFrame(x, y); - } - else if (Main.raining && Main.tile[x, y].type == (ushort) 82 && Main.tile[x, y].frameX == (short) 72 && WorldGen.genRand.Next(50) == 0) - { - Main.tile[x, y].type = (ushort) 83; - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, x, y, 1); - WorldGen.SquareTileFrame(x, y); - } - else if ((double) y > Main.worldSurface && Main.tile[x, y].type == (ushort) 82 && Main.tile[x, y].frameX == (short) 36 && WorldGen.genRand.Next(50) == 0) - { - Main.tile[x, y].type = (ushort) 83; - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, x, y, 1); - WorldGen.SquareTileFrame(x, y); } else - { - if (y <= Main.maxTilesY - 200 || Main.tile[x, y].type != (ushort) 82 || Main.tile[x, y].frameX != (short) 90 || WorldGen.genRand.Next(50) != 0) - return; - Main.tile[x, y].type = (ushort) 83; - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, x, y, 1); - WorldGen.SquareTileFrame(x, y); - } + flag = true; + if (!flag) + return; + Main.tile[x, y].type = (ushort) 83; + if (Main.netMode == 2) + NetMessage.SendTileSquare(-1, x, y, 1); + WorldGen.SquareTileFrame(x, y); + } + else if (Main.dayTime && Main.tile[x, y].type == (ushort) 82 && Main.tile[x, y].frameX == (short) 0 && WorldGen.genRand.Next(50) == 0) + { + Main.tile[x, y].type = (ushort) 83; + if (Main.netMode == 2) + NetMessage.SendTileSquare(-1, x, y, 1); + WorldGen.SquareTileFrame(x, y); + } + else if (!Main.dayTime && Main.tile[x, y].type == (ushort) 82 && Main.tile[x, y].frameX == (short) 18 && WorldGen.genRand.Next(50) == 0) + { + Main.tile[x, y].type = (ushort) 83; + if (Main.netMode == 2) + NetMessage.SendTileSquare(-1, x, y, 1); + WorldGen.SquareTileFrame(x, y); } else if (Main.tile[x, y].frameX == (short) 36 && WorldGen.genRand.Next(3) != 0) { @@ -25601,7 +18811,7 @@ label_296: } else { - if (Main.tile[x, y].type != (ushort) 84 || WorldGen.genRand.Next(5) != 0) + if (WorldGen.genRand.Next(5) != 0 && Main.tile[x, y].type != (ushort) 84) return; Main.tile[x, y].type = (ushort) 83; if (Main.netMode != 2) @@ -25611,7 +18821,7 @@ label_296: } else { - if (Main.tile[x, y].frameX != (short) 108 || Main.tile[x, y].type != (ushort) 83 || WorldGen.genRand.Next(30) != 0) + if (Main.tile[x, y].frameX != (short) 108 || Main.tile[x, y].type != (ushort) 83 || WorldGen.genRand.Next(80) != 0) return; Main.tile[x, y].type = (ushort) 84; if (Main.netMode == 2) @@ -25623,7 +18833,7 @@ label_296: public static void PlantAlch() { int index1 = WorldGen.genRand.Next(20, Main.maxTilesX - 20); - int index2 = WorldGen.genRand.Next(40) != 0 ? (WorldGen.genRand.Next(10) != 0 ? WorldGen.genRand.Next((int) Main.worldSurface, Main.maxTilesY - 20) : WorldGen.genRand.Next(20, Main.maxTilesY - 20)) : WorldGen.genRand.Next((int) (Main.rockLayer + (double) Main.maxTilesY) / 2, Main.maxTilesY - 20); + int index2 = WorldGen.genRand.Next(40) != 0 ? (WorldGen.genRand.Next(10) != 0 ? WorldGen.genRand.Next((int) Main.worldSurface, Main.maxTilesY - 20) : WorldGen.genRand.Next(0, Main.maxTilesY - 20)) : WorldGen.genRand.Next((int) (Main.rockLayer + (double) Main.maxTilesY) / 2, Main.maxTilesY - 20); while (index2 < Main.maxTilesY - 20 && !Main.tile[index1, index2].active()) ++index2; if (!Main.tile[index1, index2].nactive() || Main.tile[index1, index2 - 1].active() || Main.tile[index1, index2 - 1].liquid != (byte) 0) @@ -25654,7 +18864,7 @@ label_296: WorldGen.PlaceAlch(index1, index2 - 1, 2); if (Main.tile[index1, index2].type == (ushort) 23 || Main.tile[index1, index2].type == (ushort) 25 || Main.tile[index1, index2].type == (ushort) 203 || Main.tile[index1, index2].type == (ushort) 199) WorldGen.PlaceAlch(index1, index2 - 1, 3); - if ((Main.tile[index1, index2].type == (ushort) 53 || Main.tile[index1, index2].type == (ushort) 116) && index1 >= WorldGen.beachDistance && index1 <= Main.maxTilesX - WorldGen.beachDistance) + if (Main.tile[index1, index2].type == (ushort) 53 || Main.tile[index1, index2].type == (ushort) 116) WorldGen.PlaceAlch(index1, index2 - 1, 4); if (Main.tile[index1, index2].type == (ushort) 57) WorldGen.PlaceAlch(index1, index2 - 1, 5); @@ -25672,7 +18882,7 @@ label_296: if (Main.tile[x, y + 1] == null) Main.tile[x, y + 1] = new Tile(); bool flag = false; - if (!Main.tile[x, y + 1].nactive()) + if (!Main.tile[x, y + 1].active()) flag = true; if (Main.tile[x, y + 1].halfBrick()) flag = true; @@ -25683,7 +18893,7 @@ label_296: switch (num) { case 0: - if (Main.tile[x, y + 1].type != (ushort) 109 && Main.tile[x, y + 1].type != (ushort) 2 && Main.tile[x, y + 1].type != (ushort) 477 && Main.tile[x, y + 1].type != (ushort) 492 && Main.tile[x, y + 1].type != (ushort) 78 && Main.tile[x, y + 1].type != (ushort) 380) + if (Main.tile[x, y + 1].type != (ushort) 109 && Main.tile[x, y + 1].type != (ushort) 2 && Main.tile[x, y + 1].type != (ushort) 78 && Main.tile[x, y + 1].type != (ushort) 380) flag = true; if (Main.tile[x, y].liquid > (byte) 0 && Main.tile[x, y].lava()) { @@ -25730,7 +18940,9 @@ label_296: case 5: if (Main.tile[x, y + 1].type != (ushort) 57 && Main.tile[x, y + 1].type != (ushort) 78 && Main.tile[x, y + 1].type != (ushort) 380) flag = true; - if (Main.tile[x, y].type != (ushort) 82 && Main.tile[x, y].lava() && Main.netMode != 1) + if (Main.tile[x, y].liquid > (byte) 0 && !Main.tile[x, y].lava()) + flag = true; + if (Main.tile[x, y].type != (ushort) 82 && Main.tile[x, y].lava() && Main.tile[x, y].type != (ushort) 82 && Main.tile[x, y].lava() && Main.netMode != 1) { if (Main.tile[x, y].liquid > (byte) 16) { @@ -25819,15 +19031,7 @@ label_296: if (type == (byte) 91) { int num4 = frameX / 18 + num2 * 111; - if (num4 >= 297) - Item.NewItem(x * 16, (num3 + 1) * 16, 32, 32, 4668 + num4); - else if (num4 >= 295) - Item.NewItem(x * 16, (num3 + 1) * 16, 32, 32, 4392 + num4); - else if (num4 >= 294) - Item.NewItem(x * 16, (num3 + 1) * 16, 32, 32, 4602); - else if (num4 >= 288) - Item.NewItem(x * 16, (num3 + 1) * 16, 32, 32, 4253 + num4); - else if (num4 >= 278) + if (num4 >= 278) Item.NewItem(x * 16, (num3 + 1) * 16, 32, 32, 3559 + num4); else if (num4 >= 273) Item.NewItem(x * 16, (num3 + 1) * 16, 32, 32, 3516 + num4); @@ -26004,7 +19208,7 @@ label_296: if (num8 != 0) num7 = (num8 - 1) * 18; int num9 = num7 % 54; - if (!Main.tile[index3, index4].active() || Main.tile[index3, index4].type != (ushort) 334 || Main.tile[index3, index4].wall <= (ushort) 0 || (int) Main.tile[index3, index4].frameY != index2 * 18 || num9 != index1 * 18) + if (!Main.tile[index3, index4].active() || Main.tile[index3, index4].type != (ushort) 334 || Main.tile[index3, index4].wall <= (byte) 0 || (int) Main.tile[index3, index4].frameY != index2 * 18 || num9 != index1 * 18) flag = true; } } @@ -26350,30 +19554,6 @@ label_296: case 37: Type = 3891; break; - case 38: - Type = 3943; - break; - case 39: - Type = 3970; - break; - case 40: - Type = 4157; - break; - case 41: - Type = 4178; - break; - case 42: - Type = 4199; - break; - case 43: - Type = 4220; - break; - case 44: - Type = 4309; - break; - case 45: - Type = 4578; - break; } break; } @@ -26387,12 +19567,6 @@ label_296: case 271: Item.NewItem(x * 16, j1 * 16, 32, 32, 2005); break; - case 572: - Item.NewItem(x * 16, j1 * 16, 32, 32, 4695 + num2); - break; - case 581: - Item.NewItem(x * 16, j1 * 16, 32, 32, 4848); - break; } WorldGen.destroyObject = false; } @@ -26490,9 +19664,9 @@ label_296: flag = false; if (type == (ushort) 29 || type == (ushort) 103 || type == (ushort) 462) { - if (!Main.tile[i1, y + 1].active() || !Main.tileTable[(int) Main.tile[i1, y + 1].type] || Main.tile[i1, y + 1].halfBrick() || Main.tile[i1, y + 1].topSlope()) + if (!Main.tile[i1, y + 1].active() || !Main.tileTable[(int) Main.tile[i1, y + 1].type]) flag = true; - if (!Main.tile[i1 + 1, y + 1].active() || !Main.tileTable[(int) Main.tile[i1 + 1, y + 1].type] || Main.tile[i1 + 1, y + 1].halfBrick() || Main.tile[i1 + 1, y + 1].topSlope()) + if (!Main.tile[i1 + 1, y + 1].active() || !Main.tileTable[(int) Main.tile[i1 + 1, y + 1].type]) flag = true; } else @@ -26502,7 +19676,7 @@ label_296: if (!WorldGen.SolidTileAllowBottomSlope(i1 + 1, y + 1)) flag = true; } - if (type == (ushort) 185 && Main.tile[i1, y].frameX >= (short) 1368 && Main.tile[i1, y].frameX <= (short) 1458 && Main.tile[i1, y + 1].type != (ushort) 2 && Main.tile[i1 + 1, y + 1].type != (ushort) 2 && Main.tile[i1, y + 1].type != (ushort) 477 && Main.tile[i1 + 1, y + 1].type != (ushort) 477 && Main.tile[i1, y + 1].type != (ushort) 492 && Main.tile[i1 + 1, y + 1].type != (ushort) 492) + if (type == (ushort) 185 && Main.tile[i1, y].frameX >= (short) 1368 && Main.tile[i1, y].frameX <= (short) 1458 && Main.tile[i1, y + 1].type != (ushort) 2 && Main.tile[i1 + 1, y + 1].type != (ushort) 2) { Main.tile[i1, y].frameX -= (short) 1368; Main.tile[i1 + 1, y].frameX -= (short) 1368; @@ -26609,30 +19783,6 @@ label_296: case 32: Type = 3910; break; - case 33: - Type = 3949; - break; - case 34: - Type = 3975; - break; - case 35: - Type = 4163; - break; - case 36: - Type = 4184; - break; - case 37: - Type = 4205; - break; - case 38: - Type = 4226; - break; - case 39: - Type = 4315; - break; - case 40: - Type = 4584; - break; } } Item.NewItem(i1 * 16, y * 16, 32, 32, Type); @@ -26698,7 +19848,7 @@ label_296: if (type == (ushort) 29) { Item.NewItem(i1 * 16, y * 16, 32, 32, 87); - SoundEngine.PlaySound(13, i * 16, y * 16); + Main.PlaySound(13, i * 16, y * 16); } if (type == (ushort) 103) { @@ -26710,7 +19860,7 @@ label_296: if (num2 == 3) Type = 2243; Item.NewItem(i1 * 16, y * 16, 32, 32, Type); - SoundEngine.PlaySound(13, i * 16, y * 16); + Main.PlaySound(13, i * 16, y * 16); } else if (type == (ushort) 134) { @@ -26756,35 +19906,27 @@ label_296: if (WorldGen.destroyObject) return; bool flag = false; - int num1 = i; - int num2 = type != 487 ? num1 + (int) Main.tile[i, j].frameX / 18 * -1 : num1 + (int) Main.tile[i, j].frameX / 18 % 4 * -1; + int num1 = i + (int) Main.tile[i, j].frameX / 18 * -1; if ((type == 79 || type == 90) && Main.tile[i, j].frameX >= (short) 72) - num2 += 4; - int num3 = (int) Main.tile[i, j].frameY / 18; - int style = 0; - while (num3 > 1) + num1 += 4; + int num2 = (int) Main.tile[i, j].frameY / 18; + int num3 = 0; + while (num2 > 1) { - num3 -= 2; - ++style; + num2 -= 2; + ++num3; } - int num4 = j - num3; - if (type == 487) - style = (int) Main.tile[i, j].frameX / 72; - for (int i1 = num2; i1 < num2 + 4; ++i1) + int num4 = j - num2; + for (int i1 = num1; i1 < num1 + 4; ++i1) { for (int index = num4; index < num4 + 2; ++index) { - int num5 = (i1 - num2) * 18; - int num6 = (index - num4) * 18; + int num5 = (i1 - num1) * 18; if ((type == 79 || type == 90) && Main.tile[i, j].frameX >= (short) 72) - num5 = (i1 - num2 + 4) * 18; - if (type == 487) - num5 += style * 72; - else - num6 += style * 36; + num5 = (i1 - num1 + 4) * 18; if (Main.tile[i1, index] == null) Main.tile[i1, index] = new Tile(); - if (!Main.tile[i1, index].active() || (int) Main.tile[i1, index].type != type || (int) Main.tile[i1, index].frameX != num5 || (int) Main.tile[i1, index].frameY != num6) + if (!Main.tile[i1, index].active() || (int) Main.tile[i1, index].type != type || (int) Main.tile[i1, index].frameX != num5 || (int) Main.tile[i1, index].frameY != (index - num4) * 18 + num3 * 36) flag = true; } if (Main.tile[i1, num4 + 2] == null) @@ -26795,7 +19937,7 @@ label_296: if (!flag) return; WorldGen.destroyObject = true; - for (int i2 = num2; i2 < num2 + 4; ++i2) + for (int i2 = num1; i2 < num1 + 4; ++i2) { for (int j1 = num4; j1 < num4 + 3; ++j1) { @@ -26805,25 +19947,23 @@ label_296: } if (type == 79) { - int Type = style != 0 ? (style != 4 ? (style < 9 || style > 12 ? (style < 5 || style > 8 ? (style < 13 || style > 18 ? (style != 19 ? (style != 20 ? (style != 21 ? (style != 22 ? (style != 23 ? (style != 24 ? (style != 25 ? (style != 26 ? (style != 27 ? (style != 28 ? (style != 29 ? (style != 30 ? (style != 31 ? (style != 32 ? (style != 33 ? (style != 34 ? (style != 35 ? (style != 36 ? (style != 37 ? (style != 38 ? (style != 39 ? style + 643 : 4567) : 4299) : 4209) : 4188) : 4167) : 4146) : 3959) : 3932) : 3897) : 3163) : 3164) : 3162) : 2811) : 2669) : 2568) : 2553) : 2538) : 2520) : 2231) : 2140) : 2139) : 2066 + style - 13) : 1465 + style) : 1710 + style) : 920) : 224; + int Type = num3 != 0 ? (num3 != 4 ? (num3 < 9 || num3 > 12 ? (num3 < 5 || num3 > 8 ? (num3 < 13 || num3 > 18 ? (num3 != 19 ? (num3 != 20 ? (num3 != 21 ? (num3 != 22 ? (num3 != 23 ? (num3 != 24 ? (num3 != 25 ? (num3 != 26 ? (num3 != 27 ? (num3 != 28 ? (num3 != 29 ? (num3 != 30 ? (num3 != 31 ? num3 + 643 : 3897) : 3163) : 3164) : 3162) : 2811) : 2669) : 2568) : 2553) : 2538) : 2520) : 2231) : 2140) : 2139) : 2066 + num3 - 13) : 1465 + num3) : 1710 + num3) : 920) : 224; Item.NewItem(i * 16, j * 16, 32, 32, Type); } - if (type == 487) - Item.NewItem(i * 16, j * 16, 32, 32, WorldGen.GetItemDrop_PicnicTables(style)); if (type == 90) { int Type = 0; - if (style == 0) + if (num3 == 0) Type = 336; - else if (style >= 1 && style <= 10) - Type = 2072 + style - 1; - else if (style >= 11 && style <= 15) + else if (num3 >= 1 && num3 <= 10) + Type = 2072 + num3 - 1; + else if (num3 >= 11 && num3 <= 15) { - Type = 2124 + style - 11; + Type = 2124 + num3 - 11; } else { - switch (style) + switch (num3) { case 16: Type = 2232; @@ -26873,207 +20013,18 @@ label_296: case 31: Type = 3895; break; - case 32: - Type = 3931; - break; - case 33: - Type = 3958; - break; - case 34: - Type = 4145; - break; - case 35: - Type = 4166; - break; - case 36: - Type = 4187; - break; - case 37: - Type = 4208; - break; - case 38: - Type = 4298; - break; - case 39: - Type = 4566; - break; } } Item.NewItem(i * 16, j * 16, 32, 32, Type); } WorldGen.destroyObject = false; - for (int i3 = num2 - 1; i3 < num2 + 4; ++i3) + for (int i3 = num1 - 1; i3 < num1 + 4; ++i3) { for (int j2 = num4 - 1; j2 < num4 + 4; ++j2) WorldGen.TileFrame(i3, j2); } } - private static bool OasisPlantWaterCheck(int x, int y, bool boost = false) - { - int num1 = 45; - int num2 = 20; - if (boost) - { - num1 += 4; - num2 += 3; - } - int num3 = 20; - int num4 = 0; - for (int index1 = x - num1; index1 <= x + num1; ++index1) - { - if (x > WorldGen.beachDistance && x < Main.maxTilesX - WorldGen.beachDistance) - { - for (int index2 = y - num2; index2 <= y + num2; ++index2) - { - if (WorldGen.InWorld(index1, index2) && !WorldGen.SolidTile(index1, index2)) - num4 += (int) Main.tile[index1, index2].liquid; - } - } - } - return num4 / (int) byte.MaxValue >= num3; - } - - public static void PlaceOasisPlant(int X, int Y, ushort type = 530) - { - int num1 = WorldGen.genRand.Next(9); - int num2 = 0; - int x = X; - int y = Y; - if (x < WorldGen.beachDistance || x > Main.maxTilesX - WorldGen.beachDistance || y < 5 || y > Main.maxTilesY - 5) - return; - bool flag = true; - for (int i = x - 1; i < x + 2; ++i) - { - for (int index = y - 1; index < y + 1; ++index) - { - if (Main.tile[i, index] == null) - Main.tile[i, index] = new Tile(); - if (Main.tile[i, index].active() && Main.tile[i, index].type != (ushort) 529) - flag = false; - if (Main.tile[i, index].liquid > (byte) 0) - flag = false; - } - if (Main.tile[i, y + 1] == null) - Main.tile[i, y + 1] = new Tile(); - if (!WorldGen.SolidTile(i, y + 1) || !TileID.Sets.Conversion.Sand[(int) Main.tile[i, y + 1].type]) - flag = false; - } - if (!flag || !WorldGen.OasisPlantWaterCheck(x, y)) - return; - short num3 = (short) (54 * num1); - short num4 = (short) (36 * num2); - Main.tile[x - 1, y - 1].active(true); - Main.tile[x - 1, y - 1].frameY = num4; - Main.tile[x - 1, y - 1].frameX = num3; - Main.tile[x - 1, y - 1].type = type; - Main.tile[x, y - 1].active(true); - Main.tile[x, y - 1].frameY = num4; - Main.tile[x, y - 1].frameX = (short) ((int) num3 + 18); - Main.tile[x, y - 1].type = type; - Main.tile[x + 1, y - 1].active(true); - Main.tile[x + 1, y - 1].frameY = num4; - Main.tile[x + 1, y - 1].frameX = (short) ((int) num3 + 36); - Main.tile[x + 1, y - 1].type = type; - Main.tile[x - 1, y].active(true); - Main.tile[x - 1, y].frameY = (short) ((int) num4 + 18); - Main.tile[x - 1, y].frameX = num3; - Main.tile[x - 1, y].type = type; - Main.tile[x, y].active(true); - Main.tile[x, y].frameY = (short) ((int) num4 + 18); - Main.tile[x, y].frameX = (short) ((int) num3 + 18); - Main.tile[x, y].type = type; - Main.tile[x + 1, y].active(true); - Main.tile[x + 1, y].frameY = (short) ((int) num4 + 18); - Main.tile[x + 1, y].frameX = (short) ((int) num3 + 36); - Main.tile[x + 1, y].type = type; - } - - public static void CheckOasisPlant(int i, int j, int type = 530) - { - if (WorldGen.destroyObject) - return; - bool flag = false; - int num1 = j; - Tile tileSafely = Framing.GetTileSafely(i, j); - int num2 = (int) tileSafely.frameY % 36; - int j1 = num1 + num2 / 18 * -1; - int i1 = (int) tileSafely.frameX / 18; - int num3 = 0; - int num4 = (int) Framing.GetTileSafely(i1, j1).frameY / 36; - while (i1 > 2) - { - i1 -= 3; - ++num3; - } - int num5 = i - i1; - int num6 = num3 * 54; - for (int i2 = num5; i2 < num5 + 3; ++i2) - { - for (int index = j1; index < j1 + 2; ++index) - { - if (Main.tile[i2, index] == null) - Main.tile[i2, index] = new Tile(); - if (!Main.tile[i2, index].active() || (int) Main.tile[i2, index].type != type || (int) Main.tile[i2, index].frameX != (i2 - num5) * 18 + num6 || (int) Main.tile[i2, index].frameY != (index - j1) * 18) - flag = true; - } - if (Main.tile[i2, j1 + 2] == null) - Main.tile[i2, j1 + 2] = new Tile(); - if (!WorldGen.SolidTile(i2, j1 + 2) || !TileID.Sets.Conversion.Sand[(int) Main.tile[i2, j1 + 2].type]) - flag = true; - } - if (!flag) - return; - int frameX = (int) Main.tile[i, j].frameX; - WorldGen.destroyObject = true; - for (int i3 = num5; i3 < num5 + 3; ++i3) - { - for (int j2 = j1; j2 < j1 + 2; ++j2) - { - if (Main.tile[i3, j2] == null) - Main.tile[i3, j2] = new Tile(); - if ((int) Main.tile[i3, j2].type == type && Main.tile[i3, j2].active()) - WorldGen.KillTile(i3, j2); - } - } - WorldGen.destroyObject = false; - for (int i4 = num5 - 1; i4 < num5 + 4; ++i4) - { - for (int j3 = j1 - 1; j3 < j1 + 3; ++j3) - WorldGen.TileFrame(i4, j3); - } - } - - public static void GetBiomeInfluence( - int startX, - int endX, - int startY, - int endY, - out int corruptCount, - out int crimsonCount, - out int hallowedCount) - { - corruptCount = 0; - crimsonCount = 0; - hallowedCount = 0; - for (int index1 = startX; index1 <= endX; ++index1) - { - for (int index2 = startY; index2 <= endY; ++index2) - { - Tile tile = Main.tile[index1, index2]; - if (tile != null) - { - if (TileID.Sets.Corrupt[(int) tile.type]) - ++corruptCount; - if (TileID.Sets.Crimson[(int) tile.type]) - ++crimsonCount; - if (TileID.Sets.Hallow[(int) tile.type]) - ++hallowedCount; - } - } - } - } - public static void PlaceJunglePlant(int X2, int Y2, ushort type, int styleX, int styleY) { if (styleY > 0 || type == (ushort) 236 || type == (ushort) 238) @@ -27247,7 +20198,6 @@ label_296: WorldGen.KillTile(i2, j1); } } - WorldGen.destroyObject = false; } else { @@ -27290,7 +20240,6 @@ label_296: WorldGen.KillTile(i4, j2); } } - WorldGen.destroyObject = false; } } @@ -27304,12 +20253,9 @@ label_296: style = (int) tile.frameX / 36; if (type == 443) style = (int) tile.frameX / 36; - if (type == 485) - style = (int) tile.frameX / 36; bool flag1 = type == 376; bool flag2 = type == 443; bool flag3 = type == 444; - bool flag4 = type == 485; TileObjectData tileData = TileObjectData.GetTileData(type, style); int num1 = tileData.StyleHorizontal ? 1 : 0; int width = tileData.Width; @@ -27324,15 +20270,15 @@ label_296: num5 = (int) tile.frameX / tileData.CoordinateFullWidth; else num6 = (int) tile.frameY / tileData.CoordinateFullHeight; + bool flag4 = false; bool flag5 = false; - bool flag6 = false; for (int index1 = 0; index1 < width; ++index1) { for (int index2 = 0; index2 < height; ++index2) { Tile tileSafely = Framing.GetTileSafely(num4 + index1, j + index2); if (!tileSafely.active() || (int) tileSafely.type != type || (int) tileSafely.frameX != num5 * tileData.CoordinateFullWidth + index1 * (tileData.CoordinateWidth + 2) || (int) tileSafely.frameY != num6 * tileData.CoordinateFullHeight + index2 * (tileData.CoordinateHeights[0] + 2)) - flag5 = true; + flag4 = true; } } if (flag1) @@ -27341,73 +20287,65 @@ label_296: { Tile tileSafely = Framing.GetTileSafely(num4 + index, j + height); if (!tileSafely.active() || !Main.tileSolid[(int) tileSafely.type] && !Main.tileTable[(int) tileSafely.type]) - flag5 = true; + flag4 = true; if (tileSafely.halfBrick()) - flag5 = true; + flag4 = true; } } if (flag2) { + bool flag6 = true; bool flag7 = true; - bool flag8 = true; for (int index = 0; index < width; ++index) { if (!WorldGen.AnchorValid(Framing.GetTileSafely(num4 + index, j + height), AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide)) - flag8 = false; - if (!WorldGen.AnchorValid(Framing.GetTileSafely(num4 + index, j - 1), AnchorType.SolidBottom)) flag7 = false; + if (!WorldGen.AnchorValid(Framing.GetTileSafely(num4 + index, j - 1), AnchorType.SolidBottom)) + flag6 = false; } - if (!flag7 && !flag8) - flag5 = true; - if (!flag5) + if (!flag6 && !flag7) + flag4 = true; + if (!flag4) { int num7 = 0; - if (flag8) + if (Main.netMode != 1) { - for (int index = 0; index < width; ++index) - Framing.GetTileSafely(num4 + index, j).frameX = (short) (index * 18 + style / 2 * 36 + num7 * 36); - } - else - { - for (int index = 0; index < width; ++index) - Framing.GetTileSafely(num4 + index, j).frameX = (short) (index * 18 + (style - 2) / 2 * 36 + 72 + num7 * 36); + if (flag7) + { + for (int index = 0; index < width; ++index) + Framing.GetTileSafely(num4 + index, j).frameX = (short) (index * 18 + style / 2 * 36 + num7 * 36); + } + else + { + for (int index = 0; index < width; ++index) + Framing.GetTileSafely(num4 + index, j).frameX = (short) (index * 18 + (style - 2) / 2 * 36 + 72 + num7 * 36); + } } } } if (flag3) { - bool flag9 = true; + bool flag8 = true; for (int index = 0; index < width; ++index) { if (!WorldGen.AnchorValid(Framing.GetTileSafely(num4 + index, j - 1), AnchorType.SolidTile)) - flag9 = false; + flag8 = false; } - if (!flag9) - flag5 = true; + if (!flag8) + flag4 = true; for (int index3 = 0; index3 < width; ++index3) { for (int index4 = 0; index4 < height; ++index4) { if (Framing.GetTileSafely(num4 + index3, j + index4).liquid > (byte) 0) { + flag4 = true; flag5 = true; - flag6 = true; } } } } - if (flag4) - { - bool flag10 = true; - for (int index = 0; index < width; ++index) - { - if (!WorldGen.AnchorValid(Framing.GetTileSafely(num4 + index, j + height), AnchorType.SolidTile)) - flag10 = false; - } - if (!flag10) - flag5 = true; - } - if (!flag5) + if (!flag4) return; WorldGen.destroyObject = true; for (int index5 = 0; index5 < width; ++index5) @@ -27420,107 +20358,10 @@ label_296: } int Type = 0; if (type == 376) - { - switch (style) - { - case 0: - Type = 2334; - break; - case 1: - Type = 2335; - break; - case 2: - Type = 2336; - break; - case 3: - Type = 3203; - break; - case 4: - Type = 3204; - break; - case 5: - Type = 3205; - break; - case 6: - Type = 3206; - break; - case 7: - Type = 3207; - break; - case 8: - Type = 3208; - break; - case 9: - Type = 3979; - break; - case 10: - Type = 3980; - break; - case 11: - Type = 3981; - break; - case 12: - Type = 3982; - break; - case 13: - Type = 3983; - break; - case 14: - Type = 3984; - break; - case 15: - Type = 3985; - break; - case 16: - Type = 3986; - break; - case 17: - Type = 3987; - break; - case 18: - Type = 4405; - break; - case 19: - Type = 4406; - break; - case 20: - Type = 4407; - break; - case 21: - Type = 4408; - break; - case 22: - Type = 4877; - break; - case 23: - Type = 4878; - break; - case 24: - Type = 5002; - break; - case 25: - Type = 5003; - break; - } - } + Type = style <= 2 ? 2334 + style : 3203 + style - 3; if (type == 443) Type = 3722; - if (type == 485 && !WorldGen.gen && Main.netMode != 1) - { - int num8 = 1; - for (int index = 0; index < num8; ++index) - { - int number = NPC.NewNPC(num4 * 16, j * 16 + 32, 582); - Main.npc[number].TargetClosest(); - Main.npc[number].velocity = new Vector2((float) Main.npc[number].direction * 1.5f, -5f); - NetMessage.SendData(23, number: number); - int time = 20; - int fromWho = -1; - Main.npc[number].GetImmuneTime(fromWho, time); - NetMessage.SendData(131, number: number, number2: 1f, number3: ((float) fromWho), number4: ((float) time)); - } - } - if (type == 444 && Main.netMode != 1 && !flag6) + if (type == 444 && Main.netMode != 1 && !flag5) Projectile.NewProjectile((float) (num4 * 16 + 16), (float) (j * 16 + 16), 0.0f, 0.0f, 655, 0, 0.0f, Main.myPlayer); if (Type != 0) Item.NewItem(num4 * 16, j * 16, tileData.CoordinateFullWidth, tileData.CoordinateFullHeight, Type); @@ -27575,7 +20416,6 @@ label_296: continue; case 132: case 138: - case 484: continue; default: Tile tileSafely1 = Framing.GetTileSafely(i2, index1 + 2); @@ -27625,7 +20465,7 @@ label_296: flag2 = true; if (flag2) { - if (Main.tile[i1, index1].wall < (ushort) 1 || Main.tile[i1 + 1, index1].wall < (ushort) 1 || Main.tile[i1, index1 + 1].wall < (ushort) 1 || Main.tile[i1 + 1, index1 + 1].wall < (ushort) 1) + if (Main.tile[i1, index1].wall < (byte) 1 || Main.tile[i1 + 1, index1].wall < (byte) 1 || Main.tile[i1, index1 + 1].wall < (byte) 1 || Main.tile[i1 + 1, index1 + 1].wall < (byte) 1) { flag1 = true; break; @@ -27652,10 +20492,9 @@ label_296: } break; case 138: - case 484: ushort type3 = Main.tile[i1, index1 - 1].type; ushort type4 = Main.tile[i1 + 1, index1 - 1].type; - if ((TileID.Sets.BasicChest[(int) type3] || TileID.Sets.BasicChest[(int) type4] || type3 == (ushort) 88 || type4 == (ushort) 88 || TileID.Sets.BasicChestFake[(int) type3] || TileID.Sets.BasicChestFake[(int) type4] || type3 == (ushort) 470 || type4 == (ushort) 470 || type3 == (ushort) 475 ? 1 : (type4 == (ushort) 475 ? 1 : 0)) == 0 && !WorldGen.SolidTileAllowBottomSlope(i1, index1 + 2) && !WorldGen.SolidTileAllowBottomSlope(i1 + 1, index1 + 2)) + if ((TileID.Sets.BasicChest[(int) type3] || TileID.Sets.BasicChest[(int) type4] || type3 == (ushort) 88 || type4 == (ushort) 88 || TileID.Sets.BasicChestFake[(int) type3] ? 1 : (TileID.Sets.BasicChestFake[(int) type4] ? 1 : 0)) == 0 && !WorldGen.SolidTileAllowBottomSlope(i1, index1 + 2) && !WorldGen.SolidTileAllowBottomSlope(i1 + 1, index1 + 2)) { flag1 = true; break; @@ -27674,75 +20513,8 @@ label_296: } } int Type = 0; - if (type <= 565) - { - switch (type - 521) - { - case 0: - Type = 4327; - break; - case 1: - Type = 4328; - break; - case 2: - Type = 4329; - break; - case 3: - Type = 4330; - break; - case 4: - Type = 4331; - break; - case 5: - Type = 4332; - break; - case 6: - Type = 4333; - break; - default: - if (type != 564) - { - if (type == 565) - { - Type = 4552; - break; - } - break; - } - Type = 4553; - break; - } - } - else if (type != 594) - { - if (type != 621) - { - if (type == 622) - Type = 5008; - } - else - Type = 3750; - } - else - Type = 4869; - if (type == 598) - Type = 4880; if (type == 360) Type = 3072; - if (type == 580) - Type = 4846; - if (type == 620) - Type = 4964; - if (type == 505) - Type = 4275; - if (type == 543) - Type = 4398; - if (type == 568) - Type = 4655; - if (type == 569) - Type = 4656; - if (type == 570) - Type = 4657; if (type >= 288 && type <= 295) Type = 2178 + type - 288; if (type >= 316 && type <= 318) @@ -27824,30 +20596,6 @@ label_296: case 31: Type = 3893; break; - case 32: - Type = 3935; - break; - case 33: - Type = 3961; - break; - case 34: - Type = 4149; - break; - case 35: - Type = 4170; - break; - case 36: - Type = 4191; - break; - case 37: - Type = 4212; - break; - case 38: - Type = 4302; - break; - case 39: - Type = 4570; - break; } } } @@ -27869,8 +20617,6 @@ label_296: Type = 250; if (type == 319) Type = 2490; - if (type == 490) - Type = 4075; if (type == 172) { Type = 2827 + num4; @@ -27888,38 +20634,12 @@ label_296: case 32: Type = 3896; break; - case 33: - Type = 3946; - break; - case 34: - Type = 3972; - break; - case 35: - Type = 4160; - break; - case 36: - Type = 4181; - break; - case 37: - Type = 4202; - break; - case 38: - Type = 4223; - break; - case 39: - Type = 4312; - break; - case 40: - Type = 4581; - break; } } if (Type != 0) Item.NewItem(i * 16, j * 16, 32, 32, Type); if (type == 138 && !WorldGen.gen && Main.netMode != 1) Projectile.NewProjectile((float) (i1 * 16) + 15.5f, (float) (index1 * 16 + 16), 0.0f, 0.0f, 99, 70, 10f, Main.myPlayer); - if (type == 484 && !WorldGen.gen && Main.netMode != 1) - Projectile.NewProjectile((float) (i1 * 16) + 15.5f, (float) (index1 * 16 + 16), 0.0f, 0.0f, 727, 70, 10f, Main.myPlayer); WorldGen.destroyObject = false; for (int i4 = i1 - 1; i4 < i1 + 3; ++i4) { @@ -27938,11 +20658,9 @@ label_296: while (frameY >= 36) frameY -= 36; int num2 = j - frameY / 18; - return WorldGen.IsAContainer(Main.tile[index, num2 - 1]) || WorldGen.IsAContainer(Main.tile[index + 1, num2 - 1]); + return TileID.Sets.BasicChest[(int) Main.tile[index, num2 - 1].type] || TileID.Sets.BasicChest[(int) Main.tile[index + 1, num2 - 1].type] || TileID.Sets.BasicChestFake[(int) Main.tile[index, num2 - 1].type] || TileID.Sets.BasicChestFake[(int) Main.tile[index + 1, num2 - 1].type] || Main.tile[index, num2 - 1].type == (ushort) 88 || Main.tile[index + 1, num2 - 1].type == (ushort) 88; } - public static bool IsAContainer(Tile t) => t.type == (ushort) 88 || t.type == (ushort) 470 || t.type == (ushort) 475 || TileID.Sets.BasicChest[(int) t.type] || TileID.Sets.BasicChestFake[(int) t.type]; - public static void OreRunner(int i, int j, double strength, int steps, ushort type) { double num1 = strength; @@ -27975,7 +20693,7 @@ label_296: { for (int index2 = num5; index2 < num6; ++index2) { - if ((double) Math.Abs((float) index1 - vector2_1.X) + (double) Math.Abs((float) index2 - vector2_1.Y) < strength * 0.5 * (1.0 + (double) WorldGen.genRand.Next(-10, 11) * 0.015) && Main.tile[index1, index2].active() && (Main.tile[index1, index2].type == (ushort) 0 || Main.tile[index1, index2].type == (ushort) 1 || Main.tile[index1, index2].type == (ushort) 23 || Main.tile[index1, index2].type == (ushort) 25 || Main.tile[index1, index2].type == (ushort) 40 || Main.tile[index1, index2].type == (ushort) 53 || Main.tile[index1, index2].type == (ushort) 57 || Main.tile[index1, index2].type == (ushort) 59 || Main.tile[index1, index2].type == (ushort) 60 || Main.tile[index1, index2].type == (ushort) 70 || Main.tile[index1, index2].type == (ushort) 109 || Main.tile[index1, index2].type == (ushort) 112 || Main.tile[index1, index2].type == (ushort) 116 || Main.tile[index1, index2].type == (ushort) 117 || Main.tile[index1, index2].type == (ushort) 147 || Main.tile[index1, index2].type == (ushort) 161 || Main.tile[index1, index2].type == (ushort) 163 || Main.tile[index1, index2].type == (ushort) 164 || Main.tileMoss[(int) Main.tile[index1, index2].type] || Main.tile[index1, index2].type == (ushort) 199 || Main.tile[index1, index2].type == (ushort) 200 || Main.tile[index1, index2].type == (ushort) 203 || Main.tile[index1, index2].type == (ushort) 234 || Main.tile[index1, index2].type == (ushort) 225 && Main.tile[index1, index2].wall != (ushort) 108)) + if ((double) Math.Abs((float) index1 - vector2_1.X) + (double) Math.Abs((float) index2 - vector2_1.Y) < strength * 0.5 * (1.0 + (double) WorldGen.genRand.Next(-10, 11) * 0.015) && Main.tile[index1, index2].active() && (Main.tile[index1, index2].type == (ushort) 0 || Main.tile[index1, index2].type == (ushort) 1 || Main.tile[index1, index2].type == (ushort) 23 || Main.tile[index1, index2].type == (ushort) 25 || Main.tile[index1, index2].type == (ushort) 40 || Main.tile[index1, index2].type == (ushort) 53 || Main.tile[index1, index2].type == (ushort) 57 || Main.tile[index1, index2].type == (ushort) 59 || Main.tile[index1, index2].type == (ushort) 60 || Main.tile[index1, index2].type == (ushort) 70 || Main.tile[index1, index2].type == (ushort) 109 || Main.tile[index1, index2].type == (ushort) 112 || Main.tile[index1, index2].type == (ushort) 116 || Main.tile[index1, index2].type == (ushort) 117 || Main.tile[index1, index2].type == (ushort) 147 || Main.tile[index1, index2].type == (ushort) 161 || Main.tile[index1, index2].type == (ushort) 163 || Main.tile[index1, index2].type == (ushort) 164 || Main.tileMoss[(int) Main.tile[index1, index2].type] || Main.tile[index1, index2].type == (ushort) 199 || Main.tile[index1, index2].type == (ushort) 200 || Main.tile[index1, index2].type == (ushort) 203 || Main.tile[index1, index2].type == (ushort) 234)) { Main.tile[index1, index2].type = type; WorldGen.SquareTileFrame(index1, index2); @@ -28002,32 +20720,18 @@ label_296: float num3 = (float) (Main.maxTilesX / 4200); int num4 = 1 - num1; float num5 = (num3 * 310f - (float) (85 * num1)) * 0.85f / (float) num2; - bool flag = false; - if (Main.drunkWorld) - { - switch (WorldGen.SavedOreTiers.Adamantite) - { - case 111: - WorldGen.SavedOreTiers.Adamantite = 223; - break; - case 223: - WorldGen.SavedOreTiers.Adamantite = 111; - break; - } - } int num6; switch (num1) { case 0: - if (WorldGen.SavedOreTiers.Cobalt == -1) + if (WorldGen.oreTier1 == -1) { - flag = true; - WorldGen.SavedOreTiers.Cobalt = 107; + WorldGen.oreTier1 = 107; if (WorldGen.genRand.Next(2) == 0) - WorldGen.SavedOreTiers.Cobalt = 221; + WorldGen.oreTier1 = 221; } int index1 = 12; - if (WorldGen.SavedOreTiers.Cobalt == 221) + if (WorldGen.oreTier1 == 221) { index1 += 9; num5 *= 0.9f; @@ -28038,29 +20742,21 @@ label_296: Main.NewText(Lang.misc[index1].Value, (byte) 50, B: (byte) 130); break; case 2: - ChatHelper.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[index1].Key), new Color(50, (int) byte.MaxValue, 130)); + NetMessage.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[index1].Key), new Color(50, (int) byte.MaxValue, 130)); break; } - num6 = WorldGen.SavedOreTiers.Cobalt; + num6 = WorldGen.oreTier1; num5 *= 1.05f; break; case 1: - if (Main.drunkWorld) + if (WorldGen.oreTier2 == -1) { - if (WorldGen.SavedOreTiers.Mythril == 108) - WorldGen.SavedOreTiers.Mythril = 222; - else if (WorldGen.SavedOreTiers.Mythril == 222) - WorldGen.SavedOreTiers.Mythril = 108; - } - if (WorldGen.SavedOreTiers.Mythril == -1) - { - flag = true; - WorldGen.SavedOreTiers.Mythril = 108; + WorldGen.oreTier2 = 108; if (WorldGen.genRand.Next(2) == 0) - WorldGen.SavedOreTiers.Mythril = 222; + WorldGen.oreTier2 = 222; } int index2 = 13; - if (WorldGen.SavedOreTiers.Mythril == 222) + if (WorldGen.oreTier2 == 222) { index2 += 9; num5 *= 0.9f; @@ -28071,33 +20767,20 @@ label_296: Main.NewText(Lang.misc[index2].Value, (byte) 50, B: (byte) 130); break; case 2: - ChatHelper.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[index2].Key), new Color(50, (int) byte.MaxValue, 130)); + NetMessage.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[index2].Key), new Color(50, (int) byte.MaxValue, 130)); break; } - num6 = WorldGen.SavedOreTiers.Mythril; + num6 = WorldGen.oreTier2; break; default: - if (Main.drunkWorld) + if (WorldGen.oreTier3 == -1) { - switch (WorldGen.SavedOreTiers.Cobalt) - { - case 107: - WorldGen.SavedOreTiers.Cobalt = 221; - break; - case 221: - WorldGen.SavedOreTiers.Cobalt = 107; - break; - } - } - if (WorldGen.SavedOreTiers.Adamantite == -1) - { - flag = true; - WorldGen.SavedOreTiers.Adamantite = 111; + WorldGen.oreTier3 = 111; if (WorldGen.genRand.Next(2) == 0) - WorldGen.SavedOreTiers.Adamantite = 223; + WorldGen.oreTier3 = 223; } int index3 = 14; - if (WorldGen.SavedOreTiers.Adamantite == 223) + if (WorldGen.oreTier3 == 223) { index3 += 9; num5 *= 0.9f; @@ -28108,14 +20791,12 @@ label_296: Main.NewText(Lang.misc[index3].Value, (byte) 50, B: (byte) 130); break; case 2: - ChatHelper.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[index3].Key), new Color(50, (int) byte.MaxValue, 130)); + NetMessage.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[index3].Key), new Color(50, (int) byte.MaxValue, 130)); break; } - num6 = WorldGen.SavedOreTiers.Adamantite; + num6 = WorldGen.oreTier3; break; } - if (flag) - NetMessage.SendData(7); for (int index4 = 0; (double) index4 < (double) num5; ++index4) { int i1 = WorldGen.genRand.Next(100, Main.maxTilesX - 100); @@ -28178,7 +20859,7 @@ label_296: Main.tile[i1, index] = new Tile(); if (!Main.tile[i1, index].active() || (int) Main.tile[i1, index].type != type || (int) Main.tile[i1, index].frameX != (i1 - num3) * 18 + num4 || Main.tile[i1, index].frameY != (short) 0) flag = true; - if (Main.tile[i1, index - 1].active() && (TileID.Sets.BasicChest[(int) Main.tile[i1, index - 1].type] || TileID.Sets.BasicChestFake[(int) Main.tile[i1, index - 1].type] || Main.tile[i1, index - 1].type == (ushort) 88 || Main.tile[i1, index - 1].type == (ushort) 470 || Main.tile[i1, index - 1].type == (ushort) 475 || Main.tile[i1, index - 1].type == (ushort) 597)) + if (Main.tile[i1, index - 1].active() && (TileID.Sets.BasicChest[(int) Main.tile[i1, index - 1].type] || TileID.Sets.BasicChestFake[(int) Main.tile[i1, index - 1].type] || Main.tile[i1, index - 1].type == (ushort) 88)) return; if (!WorldGen.SolidTileAllowBottomSlope(i1, index + 1)) flag = true; @@ -28212,22 +20893,20 @@ label_296: bool flag1 = false; bool flag2 = false; int num1 = j; - if (Main.tile[i, j] == null) - Main.tile[i, j] = new Tile(); int num2 = 36; int num3 = (int) Main.tile[i, j].frameY / num2; int num4 = (int) Main.tile[i, j].frameY % num2; int index1 = num1 - num4 / 18; int num5 = (int) Main.tile[i, j].frameX / 18; - int style = 0; + int num6 = 0; while (num5 > 2) { num5 -= 3; - ++style; + ++num6; } int index2 = i - num5; - int num6 = style * 54; - if (type == 14 && style == 25) + int num7 = num6 * 54; + if (type == 14 && num6 == 25) flag2 = true; int j1 = index1 + 2; if (flag2) @@ -28238,26 +20917,18 @@ label_296: { if (Main.tile[i1, index3] == null) Main.tile[i1, index3] = new Tile(); - if (!Main.tile[i1, index3].active() || (int) Main.tile[i1, index3].type != type || (int) Main.tile[i1, index3].frameX != (i1 - index2) * 18 + num6 || (int) Main.tile[i1, index3].frameY != (index3 - index1) * 18 + num3 * 36) + if (!Main.tile[i1, index3].active() || (int) Main.tile[i1, index3].type != type || (int) Main.tile[i1, index3].frameX != (i1 - index2) * 18 + num7 || (int) Main.tile[i1, index3].frameY != (index3 - index1) * 18 + num3 * 36) flag1 = true; } - if (type == 285 || type == 286 || type == 298 || type == 299 || type == 310 || type == 339 || type == 538 || type >= 361 && type <= 364 || type == 532 || type == 544 || type == 533 || type == 555 || type == 556 || type == 582 || type == 619) + if (type == 285 || type == 286 || type == 298 || type == 299 || type == 310 || type == 339 || type >= 361 && type <= 364) { - if (!WorldGen.SolidTileAllowBottomSlope(i1, j1) && (Main.tile[i1, j1] == null || !Main.tile[i1, j1].nactive() || !Main.tileSolidTop[(int) Main.tile[i1, j1].type] || Main.tile[i1, j1].frameY != (short) 0) && (Main.tile[i1, j1] == null || !Main.tile[i1, j1].active() || !TileID.Sets.Platforms[(int) Main.tile[i1, j1].type])) - flag1 = true; - } - else if (type == 488) - { - int num7 = 0; - if (Main.tile[i1, j1] != null && Main.tile[i1, j1].active()) - num7 = (int) Main.tile[i1, j1].type; - if ((num7 == 2 || num7 == 477 || num7 == 109 ? 1 : (num7 == 492 ? 1 : 0)) == 0) + if (!WorldGen.SolidTileAllowBottomSlope(i1, j1) && (!Main.tile[i1, j1].nactive() || !Main.tileSolidTop[(int) Main.tile[i1, j1].type] || Main.tile[i1, j1].frameY != (short) 0) && (!Main.tile[i1, j1].active() || !TileID.Sets.Platforms[(int) Main.tile[i1, j1].type])) flag1 = true; } else if (!WorldGen.SolidTileAllowBottomSlope(i1, j1)) flag1 = true; } - if (type == 187 && Main.tile[index2, index1] != null && Main.tile[index2, index1].frameX >= (short) 756 && Main.tile[index2, index1].frameX <= (short) 900 && Main.tile[index2, index1 + 2].type != (ushort) 2 && Main.tile[index2 + 1, index1 + 2].type != (ushort) 2 && Main.tile[index2 + 2, index1 + 2].type != (ushort) 2 && Main.tile[index2, index1 + 2].type != (ushort) 477 && Main.tile[index2 + 1, index1 + 2].type != (ushort) 477 && Main.tile[index2 + 2, index1 + 2].type != (ushort) 477 && Main.tile[index2, index1 + 2].type != (ushort) 492 && Main.tile[index2 + 1, index1 + 2].type != (ushort) 492 && Main.tile[index2 + 2, index1 + 2].type != (ushort) 492) + if (type == 187 && Main.tile[index2, index1].frameX >= (short) 756 && Main.tile[index2, index1].frameX <= (short) 900 && Main.tile[index2, index1 + 2].type != (ushort) 2 && Main.tile[index2 + 1, index1 + 2].type != (ushort) 2 && Main.tile[index2 + 2, index1 + 2].type != (ushort) 2) { Main.tile[index2, index1].frameX -= (short) 378; Main.tile[index2 + 1, index1].frameX -= (short) 378; @@ -28272,24 +20943,6 @@ label_296: Main.tile[index2 + 1, index1 + 1].type = (ushort) 186; Main.tile[index2 + 2, index1 + 1].type = (ushort) 186; } - if (flag1 && type == 488 && WorldGen.gen) - { - for (int index4 = index2; index4 < index2 + 3; ++index4) - { - for (int index5 = index1; index5 < index1 + 2; ++index5) - { - Main.tile[index4, index5].active(true); - Main.tile[index4, index5].type = (ushort) 488; - Main.tile[index4, index5].frameX = (short) ((index4 - index2) * 18); - Main.tile[index4, index5].frameY = (short) ((index5 - index1) * 18); - } - Main.tile[index4, index1 + 2].active(true); - Main.tile[index4, index1 + 2].type = (ushort) 2; - Main.tile[index4, index1 + 2].slope((byte) 0); - Main.tile[index4, index1 + 2].halfBrick(false); - } - flag1 = false; - } if (!flag1) return; int frameX = (int) Main.tile[i, j].frameX; @@ -28311,28 +20964,12 @@ label_296: } if (type == 14) { - int Type = style < 1 || style > 3 ? (style < 15 || style > 20 ? (style < 4 || style > 7 ? (style != 8 ? (style != 9 ? (style != 10 ? (style != 11 ? (style != 12 ? (style != 13 ? (style != 14 ? (style != 23 ? (style != 21 ? (style != 22 ? (style != 24 ? (style != 25 ? (style != 26 ? (style != 27 ? (style != 28 ? (style != 29 ? (style != 30 ? (style != 31 ? (style != 32 ? (style != 33 ? (style != 34 ? 32 : 3154) : 3155) : 3153) : 2824) : 2743) : 2583) : 677) : 2550) : 2532) : 2259) : 2248) : 1816) : 1794) : 1926) : 1510) : 1460) : 1403) : 1400) : 1397) : 1144) : 917) : 823 + style) : 1698 + style) : 637 + style; + int Type = num6 < 1 || num6 > 3 ? (num6 < 15 || num6 > 20 ? (num6 < 4 || num6 > 7 ? (num6 != 8 ? (num6 != 9 ? (num6 != 10 ? (num6 != 11 ? (num6 != 12 ? (num6 != 13 ? (num6 != 14 ? (num6 != 23 ? (num6 != 21 ? (num6 != 22 ? (num6 != 24 ? (num6 != 25 ? (num6 != 26 ? (num6 != 27 ? (num6 != 28 ? (num6 != 29 ? (num6 != 30 ? (num6 != 31 ? (num6 != 32 ? (num6 != 33 ? (num6 != 34 ? 32 : 3154) : 3155) : 3153) : 2824) : 2743) : 2583) : 677) : 2550) : 2532) : 2259) : 2248) : 1816) : 1794) : 1926) : 1510) : 1460) : 1403) : 1400) : 1397) : 1144) : 917) : 823 + num6) : 1698 + num6) : 637 + num6; Item.NewItem(i * 16, j * 16, 32, 32, Type); } if (type == 469) { int Type = 3920; - if (style == 1) - Type = 3948; - if (style == 2) - Type = 3974; - if (style == 3) - Type = 4162; - if (style == 4) - Type = 4183; - if (style == 5) - Type = 4204; - if (style == 6) - Type = 4225; - if (style == 7) - Type = 4314; - if (style == 8) - Type = 4583; Item.NewItem(i * 16, j * 16, 32, 32, Type); } else if (type == 114) @@ -28366,15 +21003,16 @@ label_296: Item.NewItem(i * 16, j * 16, 32, 32, 332); break; case 87: - int Type1 = style < 1 || style > 3 ? (style != 4 ? (style < 5 || style > 7 ? (style < 8 || style > 10 ? (style < 11 || style > 20 ? (style != 21 ? (style != 22 ? (style != 23 ? (style != 24 ? (style != 25 ? (style != 26 ? (style != 27 ? (style != 28 ? (style != 29 ? (style != 30 ? (style != 31 ? (style != 32 ? (style != 33 ? (style != 34 ? (style != 35 ? (style != 36 ? (style != 37 ? (style != 38 ? (style != 39 ? 333 : 4579) : 4310) : 4221) : 4200) : 4179) : 4158) : 3971) : 3944) : 3916) : 3915) : 3142) : 3143) : 3141) : 2821) : 2671) : 2580) : 2565) : 2548) : 2531) : 2376 + style - 11) : 2254 + style - 8) : 2245 + style - 5) : 919) : 640 + style; + int Type1 = num6 < 1 || num6 > 3 ? (num6 != 4 ? (num6 < 5 || num6 > 7 ? (num6 < 8 || num6 > 10 ? (num6 < 11 || num6 > 20 ? (num6 != 21 ? (num6 != 22 ? (num6 != 23 ? (num6 != 24 ? (num6 != 25 ? (num6 != 26 ? (num6 != 27 ? (num6 != 28 ? (num6 != 29 ? (num6 != 30 ? (num6 != 31 ? 333 : 3916) : 3915) : 3142) : 3143) : 3141) : 2821) : 2671) : 2580) : 2565) : 2548) : 2531) : 2376 + num6 - 11) : 2254 + num6 - 8) : 2245 + num6 - 5) : 919) : 640 + num6; Item.NewItem(i * 16, j * 16, 32, 32, Type1); break; case 88: - int dresserItemDrop = WorldGen.GetDresserItemDrop(style); - Item.NewItem(i * 16, j * 16, 32, 32, dresserItemDrop); + int Type2 = num6 < 1 || num6 > 3 ? (num6 != 4 ? (num6 < 5 || num6 > 15 ? (num6 != 16 ? (num6 != 17 ? (num6 != 18 ? (num6 != 19 ? (num6 != 20 ? (num6 != 21 ? (num6 != 22 ? (num6 != 23 ? (num6 != 24 ? (num6 != 25 ? (num6 != 26 ? (num6 != 27 ? (num6 != 28 ? (num6 != 29 ? (num6 != 30 ? (num6 != 31 ? 334 : 3914) : 3913) : 3912) : 3911) : 3133) : 3134) : 3132) : 2816) : 2640) : 2639) : 2638) : 2637) : 2577) : 2562) : 2545) : 2529) : 2386 + num6 - 5) : 918) : 646 + num6; + Item.NewItem(i * 16, j * 16, 32, 32, Type2); break; case 89: - Item.NewItem(i * 16, j * 16, 32, 32, WorldGen.GetItemDrop_Benches(style)); + int Type3 = num6 < 1 || num6 > 20 ? (num6 != 21 ? (num6 != 22 ? (num6 != 23 ? (num6 != 24 ? (num6 != 25 ? (num6 != 26 ? (num6 != 27 ? (num6 != 28 ? (num6 != 29 ? (num6 != 30 ? (num6 != 31 ? (num6 != 32 ? (num6 != 33 ? (num6 != 34 ? 335 : 3919) : 3918) : 3151) : 3152) : 3150) : 2823) : 2636) : 2635) : 2634) : 2582) : 858) : 2539) : 2527) : 2521) : 2397 + num6 - 1; + Item.NewItem(i * 16, j * 16, 32, 32, Type3); break; case 133: if (frameX >= 54) @@ -28463,7 +21101,7 @@ label_296: } break; case 215: - switch (style) + switch (num6) { case 0: Item.NewItem(i * 16, j * 16, 32, 32, 966); @@ -28474,16 +21112,8 @@ label_296: case 7: Item.NewItem(i * 16, j * 16, 32, 32, 3724); break; - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - Item.NewItem(i * 16, j * 16, 32, 32, 4689 + style - 8); - break; default: - Item.NewItem(i * 16, j * 16, 32, 32, 3046 + style - 1); + Item.NewItem(i * 16, j * 16, 32, 32, 3046 + num6 - 1); break; } break; @@ -28526,42 +21156,12 @@ label_296: case 405: Item.NewItem(i * 16, j * 16, 32, 32, 3364); break; - case 486: - Item.NewItem(i * 16, j * 16, 32, 32, 4063); - break; - case 488: - Item.NewItem(i * 16, j * 16, 32, 32, 9, WorldGen.genRand.Next(10, 21)); - break; - case 532: - Item.NewItem(i * 16, j * 16, 32, 32, 4364); - break; - case 533: - Item.NewItem(i * 16, j * 16, 32, 32, 4376); - break; - case 538: - Item.NewItem(i * 16, j * 16, 32, 32, 4380); - break; - case 544: - Item.NewItem(i * 16, j * 16, 32, 32, 4399); - break; - case 555: - Item.NewItem(i * 16, j * 16, 32, 32, 4475); - break; - case 556: - Item.NewItem(i * 16, j * 16, 32, 32, 4476); - break; - case 582: - Item.NewItem(i * 16, j * 16, 32, 32, 4850); - break; - case 619: - Item.NewItem(i * 16, j * 16, 32, 32, 4963); - break; default: if (type == 187 && frameX >= 918 && frameX <= 970) { - if (Main.rand.Next(50) == 0) + if (Main.rand.Next(10) == 0) { - Item.NewItem(i * 16, j * 16, 32, 32, 4144); + Item.NewItem(i * 16, j * 16, 32, 32, 3368); break; } Item.NewItem(i * 16, j * 16, 32, 32, 989); @@ -28576,13 +21176,8 @@ label_296: for (int j3 = index1 - 1; j3 < index1 + 4; ++j3) WorldGen.TileFrame(i3, j3); } - if (type != 488) - return; - WorldGen.mysticLogsEvent.FallenLogDestroyed(); } - private static int GetDresserItemDrop(int style) => style < 1 || style > 3 ? (style != 4 ? (style < 5 || style > 15 ? (style != 16 ? (style != 17 ? (style != 18 ? (style != 19 ? (style != 20 ? (style != 21 ? (style != 22 ? (style != 23 ? (style != 24 ? (style != 25 ? (style != 26 ? (style != 27 ? (style != 28 ? (style != 29 ? (style != 30 ? (style != 31 ? (style != 32 ? (style != 33 ? (style != 34 ? (style != 35 ? (style != 36 ? (style != 37 ? (style != 38 ? (style != 39 ? 334 : 4569) : 4301) : 4211) : 4190) : 4169) : 4148) : 3968) : 3934) : 3914) : 3913) : 3912) : 3911) : 3133) : 3134) : 3132) : 2816) : 2640) : 2639) : 2638) : 2637) : 2577) : 2562) : 2545) : 2529) : 2386 + style - 5) : 918) : 646 + style; - public static void Check3x4(int i, int j, int type) { if (WorldGen.destroyObject) @@ -28591,35 +21186,31 @@ label_296: int num1 = i; int num2 = j; int num3 = 0; - int num4 = 0; - int num5 = (int) Main.tile[i, j].frameX / 18; - int num6 = (int) Main.tile[i, j].frameY / 18; - for (; num5 >= 3; num5 -= 3) + int num4; + for (num4 = (int) Main.tile[i, j].frameX / 18; num4 >= 3; num4 -= 3) ++num3; - for (; num6 >= 4; num6 -= 4) - ++num4; - int num7 = num1 - num5; - int num8 = num2 - num6; - for (int i1 = num7; i1 < num7 + 3; ++i1) + int num5 = num1 - num4; + int num6 = num2 + (int) Main.tile[i, j].frameY / 18 * -1; + for (int i1 = num5; i1 < num5 + 3; ++i1) { - for (int index = num8; index < num8 + 4; ++index) + for (int index = num6; index < num6 + 4; ++index) { if (Main.tile[i1, index] == null) Main.tile[i1, index] = new Tile(); - if (!Main.tile[i1, index].active() || (int) Main.tile[i1, index].type != type || (int) Main.tile[i1, index].frameX != num3 * 54 + (i1 - num7) * 18 || (int) Main.tile[i1, index].frameY != num4 * 72 + (index - num8) * 18) + if (!Main.tile[i1, index].active() || (int) Main.tile[i1, index].type != type || (int) Main.tile[i1, index].frameX != num3 * 54 + (i1 - num5) * 18 || (int) Main.tile[i1, index].frameY != (index - num6) * 18) flag = true; } - if (Main.tile[i1, num8 + 4] == null) - Main.tile[i1, num8 + 4] = new Tile(); - if (!WorldGen.SolidTileAllowBottomSlope(i1, num8 + 4)) + if (Main.tile[i1, num6 + 4] == null) + Main.tile[i1, num6 + 4] = new Tile(); + if (!WorldGen.SolidTileAllowBottomSlope(i1, num6 + 4)) flag = true; } if (!flag) return; WorldGen.destroyObject = true; - for (int i2 = num7; i2 < num7 + 3; ++i2) + for (int i2 = num5; i2 < num5 + 3; ++i2) { - for (int j1 = num8; j1 < num8 + 4; ++j1) + for (int j1 = num6; j1 < num6 + 4; ++j1) { if ((int) Main.tile[i2, j1].type == type && Main.tile[i2, j1].active()) WorldGen.KillTile(i2, j1); @@ -28628,8 +21219,8 @@ label_296: switch (type) { case 101: - int Type1 = num3 != 1 ? (num3 != 2 ? (num3 != 3 ? (num3 != 4 ? (num3 != 5 ? (num3 != 6 ? (num3 != 7 ? (num3 != 8 ? (num3 != 9 ? (num3 != 10 ? (num3 != 11 ? (num3 != 12 ? (num3 != 13 ? (num3 != 14 ? (num3 != 15 ? (num3 != 16 ? (num3 != 17 ? (num3 < 18 || num3 > 21 ? (num3 != 22 ? (num3 != 23 ? (num3 != 24 ? (num3 != 25 ? (num3 != 26 ? (num3 != 27 ? (num3 != 28 ? (num3 != 29 ? (num3 != 30 ? (num3 != 31 ? (num3 != 32 ? (num3 != 33 ? (num3 != 34 ? (num3 != 35 ? (num3 != 36 ? (num3 != 37 ? (num3 != 38 ? (num3 != 39 ? (num3 != 40 ? 354 : 4568) : 4300) : 4210) : 4189) : 4168) : 4147) : 3960) : 3933) : 3917) : 3166) : 3167) : 3165) : 2817) : 2670) : 2569) : 2554) : 2540) : 2536) : 2233) : 2135 + num3 - 18) : 2031) : 2030) : 2029) : 2028) : 2027) : 2026) : 2025) : 2024) : 2023) : 2022) : 2021) : 2020) : 1512) : 1463) : 1416) : 1415) : 1414; - Item.NewItem(i * 16, j * 16, 32, 32, Type1); + int Type = num3 != 1 ? (num3 != 2 ? (num3 != 3 ? (num3 != 4 ? (num3 != 5 ? (num3 != 6 ? (num3 != 7 ? (num3 != 8 ? (num3 != 9 ? (num3 != 10 ? (num3 != 11 ? (num3 != 12 ? (num3 != 13 ? (num3 != 14 ? (num3 != 15 ? (num3 != 16 ? (num3 != 17 ? (num3 < 18 || num3 > 21 ? (num3 != 22 ? (num3 != 23 ? (num3 != 24 ? (num3 != 25 ? (num3 != 26 ? (num3 != 27 ? (num3 != 28 ? (num3 != 29 ? (num3 != 30 ? (num3 != 31 ? (num3 != 32 ? 354 : 3917) : 3166) : 3167) : 3165) : 2817) : 2670) : 2569) : 2554) : 2540) : 2536) : 2233) : 2135 + num3 - 18) : 2031) : 2030) : 2029) : 2028) : 2027) : 2026) : 2025) : 2024) : 2023) : 2022) : 2021) : 2020) : 1512) : 1463) : 1416) : 1415) : 1414; + Item.NewItem(i * 16, j * 16, 32, 32, Type); break; case 102: Item.NewItem(i * 16, j * 16, 32, 32, 355); @@ -28637,15 +21228,11 @@ label_296: case 463: Item.NewItem(i * 16, j * 16, 32, 32, 3813); break; - case 617: - int Type2 = 4924 + num3; - Item.NewItem(i * 16, j * 16, 32, 32, Type2); - break; } WorldGen.destroyObject = false; - for (int i3 = num7 - 1; i3 < num7 + 4; ++i3) + for (int i3 = num5 - 1; i3 < num5 + 4; ++i3) { - for (int j2 = num8 - 1; j2 < num8 + 4; ++j2) + for (int j2 = num6 - 1; j2 < num6 + 4; ++j2) WorldGen.TileFrame(i3, j2); } } @@ -28763,48 +21350,6 @@ label_296: Item.NewItem(i * 16, j * 16, 32, 32, 3070); if (type == 359) Item.NewItem(i * 16, j * 16, 32, 32, 3071); - if (type == 542) - Item.NewItem(i * 16, j * 16, 32, 32, 4396); - if (type == 550) - Item.NewItem(i * 16, j * 16, 32, 32, 4461); - if (type == 551) - Item.NewItem(i * 16, j * 16, 32, 32, 4462); - if (type == 553) - Item.NewItem(i * 16, j * 16, 32, 32, 4473); - if (type == 554) - Item.NewItem(i * 16, j * 16, 32, 32, 4474); - if (type == 558) - Item.NewItem(i * 16, j * 16, 32, 32, 4481); - if (type == 559) - Item.NewItem(i * 16, j * 16, 32, 32, 4483); - if (type == 599) - Item.NewItem(i * 16, j * 16, 32, 32, 4882); - if (type == 600) - Item.NewItem(i * 16, j * 16, 32, 32, 4883); - if (type == 601) - Item.NewItem(i * 16, j * 16, 32, 32, 4884); - if (type == 602) - Item.NewItem(i * 16, j * 16, 32, 32, 4885); - if (type == 603) - Item.NewItem(i * 16, j * 16, 32, 32, 4886); - if (type == 604) - Item.NewItem(i * 16, j * 16, 32, 32, 4887); - if (type == 605) - Item.NewItem(i * 16, j * 16, 32, 32, 4888); - if (type == 606) - Item.NewItem(i * 16, j * 16, 32, 32, 4889); - if (type == 607) - Item.NewItem(i * 16, j * 16, 32, 32, 4890); - if (type == 608) - Item.NewItem(i * 16, j * 16, 32, 32, 4891); - if (type == 609) - Item.NewItem(i * 16, j * 16, 32, 32, 4892); - if (type == 610) - Item.NewItem(i * 16, j * 16, 32, 32, 4893); - if (type == 611) - Item.NewItem(i * 16, j * 16, 32, 32, 4894); - if (type == 612) - Item.NewItem(i * 16, j * 16, 32, 32, 4895); WorldGen.destroyObject = false; for (int i3 = num3 - 1; i3 < num3 + 7; ++i3) { @@ -28937,11 +21482,8 @@ label_296: num1 = 3f; } int num4 = 0; - int num5 = 0; if (ammo == 5) num4 = 1; - if (ammo == 2) - num5 = owner + 1; if (angle == 0) { num2 = 10f; @@ -28988,18 +21530,18 @@ label_296: num3 = 0.0f; } Vector2 vector2 = new Vector2((float) ((x + 2) * 16), (float) ((y + 2) * 16)); - float num6 = num2; - float num7 = num3; - float num8 = (float) Math.Sqrt((double) num6 * (double) num6 + (double) num7 * (double) num7); + float num5 = num2; + float num6 = num3; + float num7 = (float) Math.Sqrt((double) num5 * (double) num5 + (double) num6 * (double) num6); if (ammo == 4 || ammo == 5) { if (angle == 4) vector2.X += 5f; vector2.Y += 5f; } - float num9 = num1 / num8; - float SpeedX = num6 * num9; - float SpeedY = num7 * num9; + float num8 = num1 / num7; + float SpeedX = num5 * num8; + float SpeedY = num6 * num8; if (Main.myPlayer != owner && Main.netMode == 2 && (ammo == 4 || ammo == 5)) { NetMessage.SendData(108, owner, number: Damage, number2: KnockBack, number3: ((float) x), number4: ((float) y), number5: angle, number6: ammo, number7: owner); @@ -29008,8 +21550,7 @@ label_296: { if (Main.netMode == 2) owner = Main.myPlayer; - int index = Projectile.NewProjectile(vector2.X, vector2.Y, SpeedX, SpeedY, Type, Damage, KnockBack, owner, (float) num4, (float) num5); - Main.projectile[index].originatedFromActivableTile = true; + Projectile.NewProjectile(vector2.X, vector2.Y, SpeedX, SpeedY, Type, Damage, KnockBack, owner, (float) num4); } } @@ -29233,29 +21774,12 @@ label_296: { if (Main.tile[index1, index2] == null) Main.tile[index1, index2] = new Tile(); - if (Main.tile[index1, index2].active()) + if (Main.tile[index1, index2].active() && Main.tile[index1, index2].type == (ushort) 410) { - if (Main.tile[index1, index2].type == (ushort) 410) - { - if (Main.tile[index1, index2].frameY < (short) 56) - Main.tile[index1, index2].frameY += (short) 56; - else - Main.tile[index1, index2].frameY -= (short) 56; - } - else if (Main.tile[index1, index2].type == (ushort) 480) - { - if (Main.tile[index1, index2].frameY < (short) 54) - Main.tile[index1, index2].frameY += (short) 54; - else - Main.tile[index1, index2].frameY -= (short) 54; - } - else if (Main.tile[index1, index2].type == (ushort) 509) - { - if (Main.tile[index1, index2].frameY < (short) 54) - Main.tile[index1, index2].frameY += (short) 54; - else - Main.tile[index1, index2].frameY -= (short) 54; - } + if (Main.tile[index1, index2].frameY < (short) 56) + Main.tile[index1, index2].frameY += (short) 56; + else + Main.tile[index1, index2].frameY -= (short) 56; } } } @@ -29379,98 +21903,6 @@ label_296: Item.NewItem(i * 16, j * 16, 32, 32, 3796); else if (num1 == 39) Item.NewItem(i * 16, j * 16, 32, 32, 3869); - else if (num1 == 43) - Item.NewItem(i * 16, j * 16, 32, 32, 4077); - else if (num1 == 41) - Item.NewItem(i * 16, j * 16, 32, 32, 4078); - else if (num1 == 42) - Item.NewItem(i * 16, j * 16, 32, 32, 4079); - else if (num1 == 44) - Item.NewItem(i * 16, j * 16, 32, 32, 4080); - else if (num1 == 45) - Item.NewItem(i * 16, j * 16, 32, 32, 4081); - else if (num1 == 40) - Item.NewItem(i * 16, j * 16, 32, 32, 4082); - else if (num1 == 46) - Item.NewItem(i * 16, j * 16, 32, 32, 4237); - else if (num1 == 47) - Item.NewItem(i * 16, j * 16, 32, 32, 4356); - else if (num1 == 48) - Item.NewItem(i * 16, j * 16, 32, 32, 4357); - else if (num1 == 49) - Item.NewItem(i * 16, j * 16, 32, 32, 4358); - else if (num1 == 50) - Item.NewItem(i * 16, j * 16, 32, 32, 4421); - else if (num1 == 51) - Item.NewItem(i * 16, j * 16, 32, 32, 4606); - else if (num1 == 52) - Item.NewItem(i * 16, j * 16, 32, 32, 4979); - else if (num1 == 53) - Item.NewItem(i * 16, j * 16, 32, 32, 4985); - else if (num1 == 54) - Item.NewItem(i * 16, j * 16, 32, 32, 4990); - else if (num1 == 55) - Item.NewItem(i * 16, j * 16, 32, 32, 4991); - else if (num1 == 56) - Item.NewItem(i * 16, j * 16, 32, 32, 4992); - else if (num1 == 57) - Item.NewItem(i * 16, j * 16, 32, 32, 5006); - else if (num1 == 58) - Item.NewItem(i * 16, j * 16, 32, 32, 5014); - else if (num1 == 59) - Item.NewItem(i * 16, j * 16, 32, 32, 5015); - else if (num1 == 60) - Item.NewItem(i * 16, j * 16, 32, 32, 5016); - else if (num1 == 61) - Item.NewItem(i * 16, j * 16, 32, 32, 5017); - else if (num1 == 62) - Item.NewItem(i * 16, j * 16, 32, 32, 5018); - else if (num1 == 63) - Item.NewItem(i * 16, j * 16, 32, 32, 5019); - else if (num1 == 64) - Item.NewItem(i * 16, j * 16, 32, 32, 5020); - else if (num1 == 65) - Item.NewItem(i * 16, j * 16, 32, 32, 5021); - else if (num1 == 66) - Item.NewItem(i * 16, j * 16, 32, 32, 5022); - else if (num1 == 67) - Item.NewItem(i * 16, j * 16, 32, 32, 5023); - else if (num1 == 68) - Item.NewItem(i * 16, j * 16, 32, 32, 5024); - else if (num1 == 69) - Item.NewItem(i * 16, j * 16, 32, 32, 5025); - else if (num1 == 70) - Item.NewItem(i * 16, j * 16, 32, 32, 5026); - else if (num1 == 71) - Item.NewItem(i * 16, j * 16, 32, 32, 5027); - else if (num1 == 72) - Item.NewItem(i * 16, j * 16, 32, 32, 5028); - else if (num1 == 73) - Item.NewItem(i * 16, j * 16, 32, 32, 5029); - else if (num1 == 74) - Item.NewItem(i * 16, j * 16, 32, 32, 5030); - else if (num1 == 75) - Item.NewItem(i * 16, j * 16, 32, 32, 5031); - else if (num1 == 76) - Item.NewItem(i * 16, j * 16, 32, 32, 5032); - else if (num1 == 77) - Item.NewItem(i * 16, j * 16, 32, 32, 5033); - else if (num1 == 78) - Item.NewItem(i * 16, j * 16, 32, 32, 5034); - else if (num1 == 79) - Item.NewItem(i * 16, j * 16, 32, 32, 5035); - else if (num1 == 80) - Item.NewItem(i * 16, j * 16, 32, 32, 5036); - else if (num1 == 81) - Item.NewItem(i * 16, j * 16, 32, 32, 5037); - else if (num1 == 82) - Item.NewItem(i * 16, j * 16, 32, 32, 5038); - else if (num1 == 83) - Item.NewItem(i * 16, j * 16, 32, 32, 5039); - else if (num1 == 84) - Item.NewItem(i * 16, j * 16, 32, 32, 5040); - else if (num1 == 85) - Item.NewItem(i * 16, j * 16, 32, 32, 5044); else if (num1 >= 13) Item.NewItem(i * 16, j * 16, 32, 32, 1596 + num1 - 13); else @@ -29573,7 +22005,7 @@ label_296: flag = false; if (!Main.tile[x, y + 1].nactive() || !WorldGen.SolidTile2(x, y + 1) && !Main.tileTable[(int) Main.tile[x, y + 1].type]) flag = false; - if (!flag && (Main.tile[x - 1, y - 1].wall < (ushort) 1 || Main.tile[x, y - 1].wall < (ushort) 1 || Main.tile[x - 1, y].wall < (ushort) 1 || Main.tile[x - 1, y].wall < (ushort) 1)) + if (!flag && (Main.tile[x - 1, y - 1].wall < (byte) 1 || Main.tile[x, y - 1].wall < (byte) 1 || Main.tile[x - 1, y].wall < (byte) 1 || Main.tile[x - 1, y].wall < (byte) 1)) return; } --x; @@ -29603,15 +22035,15 @@ label_296: int direction = -1) { TileObject objectData; - if (type >= 623 || !TileObject.CanPlace(x, y, type, style, direction, out objectData)) + if (type >= 470 || !TileObject.CanPlace(x, y, type, style, direction, out objectData)) return false; objectData.random = random; if (TileObject.Place(objectData) && !mute) { WorldGen.SquareTileFrame(x, y); - SoundEngine.PlaySound(0, x * 16, y * 16); + Main.PlaySound(0, x * 16, y * 16); } - return true; + return false; } public static bool ShiftTrapdoor(int x, int y, bool playerAbove, int onlyCloseOrOpen = -1) @@ -29631,7 +22063,7 @@ label_296: } if (!Collision.EmptyTile(x, y + 1, true) || !Collision.EmptyTile(x + 1, y + 1, true)) return false; - SoundEngine.PlaySound(8, x * 16 + 16, y * 16 + 16); + Main.PlaySound(8, x * 16 + 16, y * 16 + 16); for (int index = 0; index < 2; ++index) Framing.GetTileSafely(x + index, y).ClearTile(); for (int index = 0; index < 2; ++index) @@ -29659,7 +22091,7 @@ label_296: } if (!Collision.EmptyTile(x, y, true) || !Collision.EmptyTile(x + 1, y, true)) return false; - SoundEngine.PlaySound(8, x * 16 + 16, y * 16); + Main.PlaySound(8, x * 16 + 16, y * 16); for (int index = 0; index < 2; ++index) Framing.GetTileSafely(x + index, y + 1).ClearTile(); for (int index = 0; index < 2; ++index) @@ -29694,7 +22126,7 @@ label_296: Wiring.SkipWire(x + 1, y); Wiring.SkipWire(x + 1, y + directionInt); } - SoundEngine.PlaySound(8, x * 16 + 16, y * 16); + Main.PlaySound(8, x * 16 + 16, y * 16); for (int index = 0; index < 2; ++index) { Tile tileSafely5 = Framing.GetTileSafely(x + index, y + directionInt); @@ -29721,7 +22153,7 @@ label_296: } return true; } - SoundEngine.PlaySound(9, x * 16, y * 16); + Main.PlaySound(9, x * 16, y * 16); return false; } @@ -29818,7 +22250,7 @@ label_296: WorldGen.destroyObject = false; } - public static bool ShiftTallGate(int x, int y, bool closing, bool forced = false) + public static bool ShiftTallGate(int x, int y, bool closing) { ushort num1 = closing ? (ushort) 388 : (ushort) 389; ushort num2 = closing ? (ushort) 389 : (ushort) 388; @@ -29842,10 +22274,10 @@ label_296: } for (int index4 = 0; index4 < height; ++index4) { - if (!forced && !Collision.EmptyTile(x, y + index4, true)) + if (!Collision.EmptyTile(x, y + index4, true)) return false; } - SoundEngine.PlaySound(8, x * 16 + 16, y * 16 + 16); + Main.PlaySound(8, x * 16 + 16, y * 16 + 16); for (int index5 = 0; index5 < height; ++index5) Framing.GetTileSafely(x, y + index5).type = num1; for (int index6 = -1; index6 < 2; ++index6) @@ -30129,18 +22561,13 @@ label_296: } if (Main.tile[i, y + 1] == null) Main.tile[i, y + 1] = new Tile(); - if (type == (ushort) 285 || type == (ushort) 286 || type == (ushort) 298 || type == (ushort) 299 || type == (ushort) 310 || type >= (ushort) 361 && type <= (ushort) 364 || type == (ushort) 582 || type == (ushort) 619) + if (type == (ushort) 285 || type == (ushort) 286 || type == (ushort) 298 || type == (ushort) 299 || type == (ushort) 310 || type >= (ushort) 361 && type <= (ushort) 364) { if (!WorldGen.SolidTile2(i, y + 1) && (!Main.tile[i, y + 1].nactive() || !Main.tileSolidTop[(int) Main.tile[i, y + 1].type] || Main.tile[i, y + 1].frameY != (short) 0)) flag2 = false; } - else - { - if (type == (ushort) 26 && Main.tile[i, y + 1].type == (ushort) 484) - flag2 = false; - if (!WorldGen.SolidTile2(i, y + 1)) - flag2 = false; - } + else if (!WorldGen.SolidTile2(i, y + 1)) + flag2 = false; } if (type == (ushort) 88) { @@ -30217,7 +22644,7 @@ label_296: Main.tile[i, y + 1] = new Tile(); if (!WorldGen.SolidTile(i, y + 1)) flag = false; - if (type == (ushort) 254 && Main.tile[i, y + 1].type != (ushort) 2 && Main.tile[i, y + 1].type != (ushort) 477 && Main.tile[i, y + 1].type != (ushort) 492 && Main.tile[i, y + 1].type != (ushort) 109) + if (type == (ushort) 254 && Main.tile[i, y + 1].type != (ushort) 2 && Main.tile[i, y + 1].type != (ushort) 109) flag = false; } if (!flag) @@ -30245,7 +22672,7 @@ label_296: { try { - if (x < 2 || x >= Main.maxTilesX - 2 || y < 2 || y >= Main.maxTilesY - 2 || Main.tile[x, y].wall == (ushort) 0 || Main.wallHouse[(int) Main.tile[x, y].wall] || Main.tile[x - 1, y].wall == (ushort) 0 || Main.wallHouse[(int) Main.tile[x - 1, y].wall] || Main.tile[x + 1, y].wall == (ushort) 0 || Main.wallHouse[(int) Main.tile[x + 1, y].wall] || Main.tile[x, y - 1].wall == (ushort) 0 || Main.wallHouse[(int) Main.tile[x, y - 1].wall] || Main.tile[x, y + 1].wall == (ushort) 0) + if (x < 2 || x >= Main.maxTilesX - 2 || y < 2 || y >= Main.maxTilesY - 2 || Main.tile[x, y].wall == (byte) 0 || Main.wallHouse[(int) Main.tile[x, y].wall] || Main.tile[x - 1, y].wall == (byte) 0 || Main.wallHouse[(int) Main.tile[x - 1, y].wall] || Main.tile[x + 1, y].wall == (byte) 0 || Main.wallHouse[(int) Main.tile[x + 1, y].wall] || Main.tile[x, y - 1].wall == (byte) 0 || Main.wallHouse[(int) Main.tile[x, y - 1].wall] || Main.tile[x, y + 1].wall == (byte) 0) return true; if (Main.wallHouse[(int) Main.tile[x, y + 1].wall]) return true; @@ -30482,39 +22909,6 @@ label_296: case 1: Type2 = 3887; break; - case 2: - Type2 = 3950; - break; - case 3: - Type2 = 3976; - break; - case 4: - Type2 = -1; - break; - case 5: - Type2 = 4164; - break; - case 6: - Type2 = 4185; - break; - case 7: - Type2 = 4206; - break; - case 8: - Type2 = 4227; - break; - case 9: - Type2 = 4266; - break; - case 10: - Type2 = 4268; - break; - case 11: - Type2 = 4585; - break; - case 12: - Type2 = 4713; - break; } if (Type2 != -1) { @@ -30603,7 +22997,7 @@ label_296: if (!Main.tile[i1, index].active() || (int) Main.tile[i1, index].type != type || (int) Main.tile[i1, index].frameX != (i1 - tileX) * 18 + num5) flag = true; } - if (!WorldGen.SolidTile(i1, tileY + 2) || Main.tile[i1, tileY + 2].type != (ushort) 2 && Main.tile[i1, tileY + 2].type != (ushort) 477 && Main.tile[i1, tileY + 2].type != (ushort) 492 && Main.tile[i1, tileY + 2].type != (ushort) 109) + if (!WorldGen.SolidTile(i1, tileY + 2) || Main.tile[i1, tileY + 2].type != (ushort) 2 && Main.tile[i1, tileY + 2].type != (ushort) 109) flag = true; } if (!flag) @@ -30784,7 +23178,7 @@ label_296: flag = false; if (!flag) return; - int num2 = style / 36 * 18 * 6; + int num2 = style / 36 * 108; int num3 = style * 18 * 3; Main.tile[x - 1, y + num1].active(true); Main.tile[x - 1, y + num1].frameY = (short) num3; @@ -30950,7 +23344,7 @@ label_296: } if (type == 34) { - int Type = num8 != 1 ? (num8 != 2 ? (num8 != 3 ? (num8 != 4 ? (num8 != 5 ? (num8 != 6 ? (num8 < 7 || num8 > 17 ? (num8 < 18 || num8 > 21 ? (num8 != 22 ? (num8 != 23 ? (num8 != 24 ? (num8 != 25 ? (num8 != 26 ? (num8 != 27 ? (num8 != 28 ? (num8 != 29 ? (num8 != 30 ? (num8 != 31 ? (num8 != 32 ? (num8 != 33 ? (num8 != 34 ? (num8 != 35 ? (num8 != 36 ? (num8 != 37 ? (num8 != 38 ? (num8 != 39 ? (num8 != 40 ? (num8 != 41 ? (num8 != 42 ? (num8 != 43 ? (num8 != 44 ? (num8 != 45 ? 106 : 4573) : 4305) : 4215) : 4194) : 4173) : 4152) : 3964) : 3938) : 3894) : 3178) : 3179) : 3177) : 2813) : 2657) : 2656) : 2655) : 2654) : 2653) : 2652) : 2573) : 2558) : 2543) : 2525) : 2224) : 2141 + num8 - 18) : 2055 + num8 - 7) : 1812) : 712) : 711) : 710) : 108) : 107; + int Type = num8 != 1 ? (num8 != 2 ? (num8 != 3 ? (num8 != 4 ? (num8 != 5 ? (num8 != 6 ? (num8 < 7 || num8 > 17 ? (num8 < 18 || num8 > 21 ? (num8 != 22 ? (num8 != 23 ? (num8 != 24 ? (num8 != 25 ? (num8 != 26 ? (num8 != 27 ? (num8 != 28 ? (num8 != 29 ? (num8 != 30 ? (num8 != 31 ? (num8 != 32 ? (num8 != 33 ? (num8 != 34 ? (num8 != 35 ? (num8 != 36 ? (num8 != 37 ? 106 : 3894) : 3178) : 3179) : 3177) : 2813) : 2657) : 2656) : 2655) : 2654) : 2653) : 2652) : 2573) : 2558) : 2543) : 2525) : 2224) : 2141 + num8 - 18) : 2055 + num8 - 7) : 1812) : 712) : 711) : 710) : 108) : 107; Item.NewItem(i * 16, j * 16, 32, 32, Type); } WorldGen.destroyObject = false; @@ -30989,7 +23383,7 @@ label_296: flag = true; } } - if (type == 106 || type == 212 || type == 219 || type == 220 || type == 228 || type == 231 || type == 243 || type == 247 || type == 283 || type >= 300 && type <= 308 || type == 354 || type == 355 || type == 499 || type == 406 || type == 412 || type == 452 || type == 455 || type == 491) + if (type == 106 || type == 212 || type == 219 || type == 220 || type == 228 || type == 231 || type == 243 || type == 247 || type == 283 || type >= 300 && type <= 308 || type == 354 || type == 355 || type == 406 || type == 412 || type == 452 || type == 455) { for (int i1 = num8; i1 < num8 + 3; ++i1) { @@ -31076,11 +23470,7 @@ label_296: } } } - if ((double) num14 < 4800.0) - { - NPC.SpawnOnPlayer(plr, 222); - break; - } + NPC.SpawnOnPlayer(plr, 222); break; case 307: Item.NewItem(i * 16, j * 16, 32, 32, 2203); @@ -31106,12 +23496,6 @@ label_296: case 455: Item.NewItem(i * 16, j * 16, 32, 32, 3747); break; - case 491: - Item.NewItem(i * 16, j * 16, 32, 32, 4076); - break; - case 499: - Item.NewItem(i * 16, j * 16, 32, 32, 4142); - break; } break; } @@ -31123,187 +23507,6 @@ label_296: } } - public static void Check2x5(int i, int j, int type) - { - if (WorldGen.destroyObject) - return; - bool flag = false; - int num1 = j; - int num2 = (int) Main.tile[i, j].frameX / 18; - int num3 = 0; - for (; num2 >= 2; num2 -= 2) - ++num3; - int num4 = i - num2; - int num5 = 36 * num3; - int num6 = (int) Main.tile[i, j].frameY % 80 / 18; - if (num2 >= 3) - num2 -= 2; - int num7 = i - num2; - int num8 = num1 - num6; - for (int index1 = num7; index1 < num7 + 2; ++index1) - { - for (int index2 = num8; index2 < num8 + 5; ++index2) - { - if (Main.tile[index1, index2] == null) - Main.tile[index1, index2] = new Tile(); - if (!Main.tile[index1, index2].active() || (int) Main.tile[index1, index2].type != type || (int) Main.tile[index1, index2].frameX != (index1 - num4) * 18 + num5 || (int) Main.tile[index1, index2].frameY != (index2 - num8) * 18) - flag = true; - } - } - for (int i1 = num7; i1 < num7 + 2; ++i1) - { - if (Main.tile[i1, num8 + 5] == null) - Main.tile[i1, num8 + 5] = new Tile(); - if (!WorldGen.SolidTileAllowBottomSlope(i1, num8 + 5)) - { - flag = true; - break; - } - } - if (!flag) - return; - WorldGen.destroyObject = true; - for (int i2 = num7; i2 < num7 + 2; ++i2) - { - for (int j1 = num8; j1 < num8 + 5; ++j1) - { - if ((int) Main.tile[i2, j1].type == type && Main.tile[i2, j1].active()) - WorldGen.KillTile(i2, j1); - } - } - if (type == 547) - Item.NewItem(i * 16, j * 16, 32, 32, 4430 + num3); - WorldGen.destroyObject = false; - for (int i3 = num7 - 1; i3 < num7 + 3; ++i3) - { - for (int j2 = num8 - 1; j2 < num8 + 6; ++j2) - WorldGen.TileFrame(i3, j2); - } - } - - public static void Check3x5(int i, int j, int type) - { - if (WorldGen.destroyObject) - return; - bool flag = false; - int num1 = j; - int num2 = (int) Main.tile[i, j].frameX / 18; - int num3 = 0; - for (; num2 >= 3; num2 -= 3) - ++num3; - int num4 = i - num2; - int num5 = 54 * num3; - int num6 = (int) Main.tile[i, j].frameY % 90 / 18; - if (num2 >= 4) - num2 -= 3; - int num7 = i - num2; - int num8 = num1 - num6; - for (int index1 = num7; index1 < num7 + 3; ++index1) - { - for (int index2 = num8; index2 < num8 + 5; ++index2) - { - if (Main.tile[index1, index2] == null) - Main.tile[index1, index2] = new Tile(); - if (!Main.tile[index1, index2].active() || (int) Main.tile[index1, index2].type != type || (int) Main.tile[index1, index2].frameX != (index1 - num4) * 18 + num5 || (int) Main.tile[index1, index2].frameY != (index2 - num8) * 18) - flag = true; - } - } - for (int i1 = num7; i1 < num7 + 3; ++i1) - { - if (Main.tile[i1, num8 + 5] == null) - Main.tile[i1, num8 + 5] = new Tile(); - if (!WorldGen.SolidTileAllowBottomSlope(i1, num8 + 5)) - { - flag = true; - break; - } - } - if (!flag) - return; - WorldGen.destroyObject = true; - for (int i2 = num7; i2 < num7 + 3; ++i2) - { - for (int j1 = num8; j1 < num8 + 5; ++j1) - { - if ((int) Main.tile[i2, j1].type == type && Main.tile[i2, j1].active()) - WorldGen.KillTile(i2, j1); - } - } - if (type == 613) - Item.NewItem(i * 16, j * 16, 32, 32, 4904 + num3); - WorldGen.destroyObject = false; - for (int i3 = num7 - 1; i3 < num7 + 4; ++i3) - { - for (int j2 = num8 - 1; j2 < num8 + 6; ++j2) - WorldGen.TileFrame(i3, j2); - } - } - - public static void Check3x6(int i, int j, int type) - { - if (WorldGen.destroyObject) - return; - bool flag = false; - int num1 = j; - int num2 = (int) Main.tile[i, j].frameX / 18; - int num3 = 0; - for (; num2 >= 3; num2 -= 3) - ++num3; - int num4 = i - num2; - int num5 = 54 * num3; - int num6 = (int) Main.tile[i, j].frameY % 96 / 18; - if (num2 >= 4) - num2 -= 3; - int num7 = i - num2; - int num8 = num1 - num6; - for (int index1 = num7; index1 < num7 + 3; ++index1) - { - for (int index2 = num8; index2 < num8 + 6; ++index2) - { - if (Main.tile[index1, index2] == null) - Main.tile[index1, index2] = new Tile(); - if (!Main.tile[index1, index2].active() || (int) Main.tile[index1, index2].type != type || (int) Main.tile[index1, index2].frameX != (index1 - num4) * 18 + num5 || (int) Main.tile[index1, index2].frameY != (index2 - num8) * 18) - flag = true; - } - } - for (int i1 = num7; i1 < num7 + 3; ++i1) - { - if (Main.tile[i1, num8 + 6] == null) - Main.tile[i1, num8 + 6] = new Tile(); - if (!WorldGen.SolidTileAllowBottomSlope(i1, num8 + 6)) - { - flag = true; - break; - } - } - if (!flag) - return; - WorldGen.destroyObject = true; - for (int i2 = num7; i2 < num7 + 3; ++i2) - { - for (int j1 = num8; j1 < num8 + 6; ++j1) - { - if ((int) Main.tile[i2, j1].type == type && Main.tile[i2, j1].active()) - WorldGen.KillTile(i2, j1); - } - } - if (type == 548) - { - if (num3 >= 7) - Item.NewItem(i * 16, j * 16, 32, 32, 4902 + num3 - 7); - else - Item.NewItem(i * 16, j * 16, 32, 32, 4435 + num3); - } - if (type == 614) - Item.NewItem(i * 16, j * 16, 32, 32, 4906); - WorldGen.destroyObject = false; - for (int i3 = num7 - 1; i3 < num7 + 4; ++i3) - { - for (int j2 = num8 - 1; j2 < num8 + 7; ++j2) - WorldGen.TileFrame(i3, j2); - } - } - public static void Place3x3(int x, int y, ushort type, int style = 0) { bool flag = true; @@ -31401,7 +23604,7 @@ label_296: { if (Main.tile[index1, index2] == null) Main.tile[index1, index2] = new Tile(); - if (Main.tile[index1, index2].active() || Main.tile[index1, index2].wall > (ushort) 0) + if (Main.tile[index1, index2].active() || Main.tile[index1, index2].wall > (byte) 0) flag = false; } if (Main.tile[index1, y + 1] == null) @@ -31487,7 +23690,7 @@ label_296: } if (Main.tile[i1, num4 + 4] == null) Main.tile[i1, num4 + 4] = new Tile(); - if (!Main.tile[i1, num4 + 4].nactive() || Main.tile[i1, num4 + 4].type != (ushort) 2 && Main.tile[i1, num4 + 4].type != (ushort) 477 && Main.tile[i1, num4 + 4].type != (ushort) 492 && Main.tile[i1, num4 + 4].type != (ushort) 109 && Main.tile[i1, num4 + 4].type != (ushort) 60) + if (!Main.tile[i1, num4 + 4].nactive() || Main.tile[i1, num4 + 4].type != (ushort) 2 && Main.tile[i1, num4 + 4].type != (ushort) 109) flag = true; if (!WorldGen.SolidTile(i1, num4 + 4)) flag = true; @@ -31529,53 +23732,9 @@ label_296: } } - public static void CheckRockGolemHead(int x, int y) - { - if (WorldGen.SolidTileAllowBottomSlope(x, y + 1)) - return; - WorldGen.KillTile(x, y); - } - - public static void CheckGnome(int x, int j) - { - if (WorldGen.destroyObject) - return; - int num1 = 567; - int j1 = j; - bool flag = true; - Tile tileSafely1 = Framing.GetTileSafely(x, j1); - Tile tileSafely2 = Framing.GetTileSafely(x, j1 + 1); - if (tileSafely1.frameY > (short) 0) - { - --j1; - tileSafely1 = Framing.GetTileSafely(x, j1); - tileSafely2 = Framing.GetTileSafely(x, j1 + 1); - } - int num2 = (int) tileSafely1.frameX / 28; - if (tileSafely1.frameY == (short) 0 && tileSafely2.frameY == (short) 20 && (int) tileSafely1.type == num1 && (int) tileSafely2.type == num1) - flag = false; - if (Main.tile[x, j1 + 2] == null) - Main.tile[x, j1 + 2] = new Tile(); - if (!WorldGen.SolidTileAllowBottomSlope(x, j1 + 2) && !TileID.Sets.Platforms[(int) Main.tile[x, j1 + 2].type]) - flag = true; - if (!flag) - return; - WorldGen.destroyObject = true; - if ((int) tileSafely1.type == num1) - WorldGen.KillTile(x, j1); - if ((int) tileSafely2.type == num1) - WorldGen.KillTile(x, j1 + 1); - Item.NewItem(x * 16, j1 * 16, 16, 32, 4609); - WorldGen.destroyObject = false; - } - - public static void PlaceGnome(int x, int y, int style) => WorldGen.PlaceObject(x, y, 567, style: style); - public static void PlaceDye(int x, int y, int style) { bool flag = false; - if (Main.tile[x, y + 1] == null || Main.tile[x, y - 1] == null) - return; if (style == 7) { if (Main.tile[x, y + 1].active() && Main.tile[x, y + 1].type != (ushort) 3 && Main.tile[x, y + 1].type != (ushort) 51 && Main.tile[x, y + 1].type != (ushort) 61 && Main.tile[x, y + 1].type != (ushort) 73 && Main.tile[x, y + 1].type != (ushort) 74 && Main.tile[x, y + 1].type != (ushort) 184) @@ -31614,7 +23773,7 @@ label_296: { if (style == 3 || style == 4) { - if (Main.tile[x, y].wall == (ushort) 0) + if (Main.tile[x, y].wall == (byte) 0) { flag = true; break; @@ -31773,6 +23932,8 @@ label_296: Item.NewItem(num1 * 16, num2 * 16, 32, 32, 29); break; case 31: + if (WorldGen.genRand.Next(2) == 0) + WorldGen.spawnMeteor = true; if (flag) { int num3 = Main.rand.Next(5); @@ -31829,27 +23990,24 @@ label_296: ++WorldGen.shadowOrbCount; if (WorldGen.shadowOrbCount >= 3) { - if (!(NPC.AnyNPCs(266) & flag) && (!NPC.AnyNPCs(13) || flag)) + WorldGen.shadowOrbCount = 0; + float num5 = (float) (num1 * 16); + float num6 = (float) (num2 * 16); + float num7 = -1f; + int plr = 0; + for (int index = 0; index < (int) byte.MaxValue; ++index) { - WorldGen.shadowOrbCount = 0; - float num5 = (float) (num1 * 16); - float num6 = (float) (num2 * 16); - float num7 = -1f; - int plr = 0; - for (int index = 0; index < (int) byte.MaxValue; ++index) + float num8 = Math.Abs(Main.player[index].position.X - num5) + Math.Abs(Main.player[index].position.Y - num6); + if ((double) num8 < (double) num7 || (double) num7 == -1.0) { - float num8 = Math.Abs(Main.player[index].position.X - num5) + Math.Abs(Main.player[index].position.Y - num6); - if ((double) num8 < (double) num7 || (double) num7 == -1.0) - { - plr = index; - num7 = num8; - } + plr = index; + num7 = num8; } - if (flag) - NPC.SpawnOnPlayer(plr, 266); - else - NPC.SpawnOnPlayer(plr, 13); } + if (flag) + NPC.SpawnOnPlayer(plr, 266); + else + NPC.SpawnOnPlayer(plr, 13); } else { @@ -31862,7 +24020,7 @@ label_296: Main.NewText(localizedText.ToString(), (byte) 50, B: (byte) 130); break; case 2: - ChatHelper.BroadcastChatMessage(NetworkText.FromKey(localizedText.Key), new Color(50, (int) byte.MaxValue, 130)); + NetMessage.BroadcastChatMessage(NetworkText.FromKey(localizedText.Key), new Color(50, (int) byte.MaxValue, 130)); break; } } @@ -31871,9 +24029,9 @@ label_296: } } if (flag) - SoundEngine.PlaySound(4, i * 16, j * 16); + Main.PlaySound(4, i * 16, j * 16); else - SoundEngine.PlaySound(13, i * 16, j * 16); + Main.PlaySound(13, i * 16, j * 16); WorldGen.destroyObject = false; } @@ -31912,343 +24070,6 @@ label_296: WorldGen.TileFrame(i, j + 1); } - public static void CheckTreeWithSettings(int x, int y, WorldGen.CheckTreeSettings settings) - { - int num1 = -1; - int num2 = -1; - int num3 = -1; - int groundTileType = -1; - Tile tile = Main.tile[x, y]; - int type = (int) tile.type; - int frameX = (int) tile.frameX; - int frameY = (int) tile.frameY; - if (Main.tile[x - 1, y] != null && Main.tile[x - 1, y].active()) - num2 = (int) Main.tile[x - 1, y].type; - if (Main.tile[x + 1, y] != null && Main.tile[x + 1, y].active()) - num3 = (int) Main.tile[x + 1, y].type; - if (Main.tile[x, y - 1] != null && Main.tile[x, y - 1].active()) - num1 = (int) Main.tile[x, y - 1].type; - if (Main.tile[x, y + 1] != null && Main.tile[x, y + 1].active()) - groundTileType = (int) Main.tile[x, y + 1].type; - bool flag1 = settings.IsGroundValid(groundTileType); - bool flag2 = num3 == type; - bool flag3 = num2 == type; - if (!flag1 && groundTileType != type && (tile.frameX == (short) 0 && tile.frameY <= (short) 130 || tile.frameX == (short) 22 && tile.frameY <= (short) 130 || tile.frameX == (short) 44 && tile.frameY <= (short) 130)) - WorldGen.KillTile(x, y); - if (tile.frameX >= (short) 22 && tile.frameX <= (short) 44 && tile.frameY >= (short) 132 && tile.frameY <= (short) 176) - { - if (!flag1) - WorldGen.KillTile(x, y); - else if (!(tile.frameX == (short) 22 & flag3) && !(tile.frameX == (short) 44 & flag2)) - WorldGen.KillTile(x, y); - } - else if (tile.frameX == (short) 88 && tile.frameY >= (short) 0 && tile.frameY <= (short) 44 || tile.frameX == (short) 66 && tile.frameY >= (short) 66 && tile.frameY <= (short) 130 || tile.frameX == (short) 110 && tile.frameY >= (short) 66 && tile.frameY <= (short) 110 || tile.frameX == (short) 132 && tile.frameY >= (short) 0 && tile.frameY <= (short) 176) - { - if (flag3 & flag2) - { - if (tile.frameNumber() == (byte) 0) - { - tile.frameX = (short) 110; - tile.frameY = (short) 66; - } - if (tile.frameNumber() == (byte) 1) - { - tile.frameX = (short) 110; - tile.frameY = (short) 88; - } - if (tile.frameNumber() == (byte) 2) - { - tile.frameX = (short) 110; - tile.frameY = (short) 110; - } - } - else if (flag3) - { - if (tile.frameNumber() == (byte) 0) - { - tile.frameX = (short) 88; - tile.frameY = (short) 0; - } - if (tile.frameNumber() == (byte) 1) - { - tile.frameX = (short) 88; - tile.frameY = (short) 22; - } - if (tile.frameNumber() == (byte) 2) - { - tile.frameX = (short) 88; - tile.frameY = (short) 44; - } - } - else if (flag2) - { - if (tile.frameNumber() == (byte) 0) - { - tile.frameX = (short) 66; - tile.frameY = (short) 66; - } - if (tile.frameNumber() == (byte) 1) - { - tile.frameX = (short) 66; - tile.frameY = (short) 88; - } - if (tile.frameNumber() == (byte) 2) - { - tile.frameX = (short) 66; - tile.frameY = (short) 110; - } - } - else - { - if (tile.frameNumber() == (byte) 0) - { - tile.frameX = (short) 0; - tile.frameY = (short) 0; - } - if (tile.frameNumber() == (byte) 1) - { - tile.frameX = (short) 0; - tile.frameY = (short) 22; - } - if (tile.frameNumber() == (byte) 2) - { - tile.frameX = (short) 0; - tile.frameY = (short) 44; - } - } - } - if (tile.frameY >= (short) 132 && tile.frameY <= (short) 176 && (tile.frameX == (short) 0 || tile.frameX == (short) 66 || tile.frameX == (short) 88)) - { - if (!flag1) - WorldGen.KillTile(x, y); - if (!flag3 && !flag2) - { - if (tile.frameNumber() == (byte) 0) - { - tile.frameX = (short) 0; - tile.frameY = (short) 0; - } - if (tile.frameNumber() == (byte) 1) - { - tile.frameX = (short) 0; - tile.frameY = (short) 22; - } - if (tile.frameNumber() == (byte) 2) - { - tile.frameX = (short) 0; - tile.frameY = (short) 44; - } - } - else if (!flag3) - { - if (tile.frameNumber() == (byte) 0) - { - tile.frameX = (short) 0; - tile.frameY = (short) 132; - } - if (tile.frameNumber() == (byte) 1) - { - tile.frameX = (short) 0; - tile.frameY = (short) 154; - } - if (tile.frameNumber() == (byte) 2) - { - tile.frameX = (short) 0; - tile.frameY = (short) 176; - } - } - else if (!flag2) - { - if (tile.frameNumber() == (byte) 0) - { - tile.frameX = (short) 66; - tile.frameY = (short) 132; - } - if (tile.frameNumber() == (byte) 1) - { - tile.frameX = (short) 66; - tile.frameY = (short) 154; - } - if (tile.frameNumber() == (byte) 2) - { - tile.frameX = (short) 66; - tile.frameY = (short) 176; - } - } - else - { - if (tile.frameNumber() == (byte) 0) - { - tile.frameX = (short) 88; - tile.frameY = (short) 132; - } - if (tile.frameNumber() == (byte) 1) - { - tile.frameX = (short) 88; - tile.frameY = (short) 154; - } - if (tile.frameNumber() == (byte) 2) - { - tile.frameX = (short) 88; - tile.frameY = (short) 176; - } - } - } - if (tile.frameX == (short) 66 && (tile.frameY == (short) 0 || tile.frameY == (short) 22 || tile.frameY == (short) 44) || tile.frameX == (short) 44 && (tile.frameY == (short) 198 || tile.frameY == (short) 220 || tile.frameY == (short) 242)) - { - if (!flag2) - WorldGen.KillTile(x, y); - } - else if (tile.frameX == (short) 88 && (tile.frameY == (short) 66 || tile.frameY == (short) 88 || tile.frameY == (short) 110) || tile.frameX == (short) 66 && (tile.frameY == (short) 198 || tile.frameY == (short) 220 || tile.frameY == (short) 242)) - { - if (!flag3) - WorldGen.KillTile(x, y); - } - else if (groundTileType == -1) - WorldGen.KillTile(x, y); - else if (num1 != type && tile.frameY < (short) 198 && (tile.frameX != (short) 22 && tile.frameX != (short) 44 || tile.frameY < (short) 132)) - { - if (flag3 | flag2) - { - if (groundTileType == type) - { - if (flag3 & flag2) - { - if (tile.frameNumber() == (byte) 0) - { - tile.frameX = (short) 132; - tile.frameY = (short) 132; - } - if (tile.frameNumber() == (byte) 1) - { - tile.frameX = (short) 132; - tile.frameY = (short) 154; - } - if (tile.frameNumber() == (byte) 2) - { - tile.frameX = (short) 132; - tile.frameY = (short) 176; - } - } - else if (flag3) - { - if (tile.frameNumber() == (byte) 0) - { - tile.frameX = (short) 132; - tile.frameY = (short) 0; - } - if (tile.frameNumber() == (byte) 1) - { - tile.frameX = (short) 132; - tile.frameY = (short) 22; - } - if (tile.frameNumber() == (byte) 2) - { - tile.frameX = (short) 132; - tile.frameY = (short) 44; - } - } - else if (flag2) - { - if (tile.frameNumber() == (byte) 0) - { - tile.frameX = (short) 132; - tile.frameY = (short) 66; - } - if (tile.frameNumber() == (byte) 1) - { - tile.frameX = (short) 132; - tile.frameY = (short) 88; - } - if (tile.frameNumber() == (byte) 2) - { - tile.frameX = (short) 132; - tile.frameY = (short) 110; - } - } - } - else if (flag3 & flag2) - { - if (tile.frameNumber() == (byte) 0) - { - tile.frameX = (short) 154; - tile.frameY = (short) 132; - } - if (tile.frameNumber() == (byte) 1) - { - tile.frameX = (short) 154; - tile.frameY = (short) 154; - } - if (tile.frameNumber() == (byte) 2) - { - tile.frameX = (short) 154; - tile.frameY = (short) 176; - } - } - else if (flag3) - { - if (tile.frameNumber() == (byte) 0) - { - tile.frameX = (short) 154; - tile.frameY = (short) 0; - } - if (tile.frameNumber() == (byte) 1) - { - tile.frameX = (short) 154; - tile.frameY = (short) 22; - } - if (tile.frameNumber() == (byte) 2) - { - tile.frameX = (short) 154; - tile.frameY = (short) 44; - } - } - else if (flag2) - { - if (tile.frameNumber() == (byte) 0) - { - tile.frameX = (short) 154; - tile.frameY = (short) 66; - } - if (tile.frameNumber() == (byte) 1) - { - tile.frameX = (short) 154; - tile.frameY = (short) 88; - } - if (tile.frameNumber() == (byte) 2) - { - tile.frameX = (short) 154; - tile.frameY = (short) 110; - } - } - } - else - { - if (tile.frameNumber() == (byte) 0) - { - tile.frameX = (short) 110; - tile.frameY = (short) 0; - } - if (tile.frameNumber() == (byte) 1) - { - tile.frameX = (short) 110; - tile.frameY = (short) 22; - } - if (tile.frameNumber() == (byte) 2) - { - tile.frameX = (short) 110; - tile.frameY = (short) 44; - } - } - } - if ((int) tile.frameX == frameX || (int) tile.frameY == frameY || frameX < 0 || frameY < 0) - return; - WorldGen.TileFrame(x - 1, y); - WorldGen.TileFrame(x + 1, y); - WorldGen.TileFrame(x, y - 1); - WorldGen.TileFrame(x, y + 1); - } - public static void CheckTree(int i, int j) { int num1 = -1; @@ -32284,8 +24105,6 @@ label_296: } if (num4 == 23) num4 = 2; - if (num4 == 477) - num4 = 2; if (num4 == 60) num4 = 2; if (num4 == 70) @@ -32296,8 +24115,6 @@ label_296: num4 = 2; if (num4 == 199) num4 = 2; - if (num4 == 492) - num4 = 2; if (num4 != 2 && num4 != type1 && (Main.tile[i, j].frameX == (short) 0 && Main.tile[i, j].frameY <= (short) 130 || Main.tile[i, j].frameX == (short) 22 && Main.tile[i, j].frameY <= (short) 130 || Main.tile[i, j].frameX == (short) 44 && Main.tile[i, j].frameY <= (short) 130)) WorldGen.KillTile(i, j); if (Main.tile[i, j].frameX >= (short) 22 && Main.tile[i, j].frameX <= (short) 44 && Main.tile[i, j].frameY >= (short) 132 && Main.tile[i, j].frameY <= (short) 176) @@ -32627,53 +24444,29 @@ label_296: switch (conversionType) { case 1: - if (type <= 623 && wall <= 316) + if (type <= 470 && wall <= 231) { if (WallID.Sets.Conversion.Grass[wall] && wall != 69) { - Main.tile[index1, index2].wall = (ushort) 69; + Main.tile[index1, index2].wall = (byte) 69; WorldGen.SquareWallFrame(index1, index2); NetMessage.SendTileSquare(-1, index1, index2, 1); } else if (WallID.Sets.Conversion.Stone[wall] && wall != 3) { - Main.tile[index1, index2].wall = (ushort) 3; + Main.tile[index1, index2].wall = (byte) 3; WorldGen.SquareWallFrame(index1, index2); NetMessage.SendTileSquare(-1, index1, index2, 1); } else if (WallID.Sets.Conversion.HardenedSand[wall] && wall != 217) { - Main.tile[index1, index2].wall = (ushort) 217; + Main.tile[index1, index2].wall = (byte) 217; WorldGen.SquareWallFrame(index1, index2); NetMessage.SendTileSquare(-1, index1, index2, 1); } else if (WallID.Sets.Conversion.Sandstone[wall] && wall != 220) { - Main.tile[index1, index2].wall = (ushort) 220; - WorldGen.SquareWallFrame(index1, index2); - NetMessage.SendTileSquare(-1, index1, index2, 1); - } - else if (WallID.Sets.Conversion.NewWall1[wall] && wall != 188) - { - Main.tile[index1, index2].wall = (ushort) 188; - WorldGen.SquareWallFrame(index1, index2); - NetMessage.SendTileSquare(-1, index1, index2, 1); - } - else if (WallID.Sets.Conversion.NewWall2[wall] && wall != 189) - { - Main.tile[index1, index2].wall = (ushort) 189; - WorldGen.SquareWallFrame(index1, index2); - NetMessage.SendTileSquare(-1, index1, index2, 1); - } - else if (WallID.Sets.Conversion.NewWall3[wall] && wall != 190) - { - Main.tile[index1, index2].wall = (ushort) 190; - WorldGen.SquareWallFrame(index1, index2); - NetMessage.SendTileSquare(-1, index1, index2, 1); - } - else if (WallID.Sets.Conversion.NewWall4[wall] && wall != 191) - { - Main.tile[index1, index2].wall = (ushort) 191; + Main.tile[index1, index2].wall = (byte) 220; WorldGen.SquareWallFrame(index1, index2); NetMessage.SendTileSquare(-1, index1, index2, 1); } @@ -32730,53 +24523,29 @@ label_296: } continue; case 2: - if (type <= 623 && wall <= 316) + if (type <= 470 && wall <= 231) { if (WallID.Sets.Conversion.Grass[wall] && wall != 70) { - Main.tile[index1, index2].wall = (ushort) 70; + Main.tile[index1, index2].wall = (byte) 70; WorldGen.SquareWallFrame(index1, index2); NetMessage.SendTileSquare(-1, index1, index2, 1); } else if (WallID.Sets.Conversion.Stone[wall] && wall != 28) { - Main.tile[index1, index2].wall = (ushort) 28; + Main.tile[index1, index2].wall = (byte) 28; WorldGen.SquareWallFrame(index1, index2); NetMessage.SendTileSquare(-1, index1, index2, 1); } else if (WallID.Sets.Conversion.HardenedSand[wall] && wall != 219) { - Main.tile[index1, index2].wall = (ushort) 219; + Main.tile[index1, index2].wall = (byte) 219; WorldGen.SquareWallFrame(index1, index2); NetMessage.SendTileSquare(-1, index1, index2, 1); } else if (WallID.Sets.Conversion.Sandstone[wall] && wall != 222) { - Main.tile[index1, index2].wall = (ushort) 222; - WorldGen.SquareWallFrame(index1, index2); - NetMessage.SendTileSquare(-1, index1, index2, 1); - } - else if (WallID.Sets.Conversion.NewWall1[wall] && wall != 200) - { - Main.tile[index1, index2].wall = (ushort) 200; - WorldGen.SquareWallFrame(index1, index2); - NetMessage.SendTileSquare(-1, index1, index2, 1); - } - else if (WallID.Sets.Conversion.NewWall2[wall] && wall != 201) - { - Main.tile[index1, index2].wall = (ushort) 201; - WorldGen.SquareWallFrame(index1, index2); - NetMessage.SendTileSquare(-1, index1, index2, 1); - } - else if (WallID.Sets.Conversion.NewWall3[wall] && wall != 202) - { - Main.tile[index1, index2].wall = (ushort) 202; - WorldGen.SquareWallFrame(index1, index2); - NetMessage.SendTileSquare(-1, index1, index2, 1); - } - else if (WallID.Sets.Conversion.NewWall4[wall] && wall != 203) - { - Main.tile[index1, index2].wall = (ushort) 203; + Main.tile[index1, index2].wall = (byte) 222; WorldGen.SquareWallFrame(index1, index2); NetMessage.SendTileSquare(-1, index1, index2, 1); } @@ -32786,13 +24555,7 @@ label_296: WorldGen.SquareTileFrame(index1, index2); NetMessage.SendTileSquare(-1, index1, index2, 1); } - else if (TileID.Sets.Conversion.GolfGrass[type] && type != 492) - { - Main.tile[index1, index2].type = (ushort) 492; - WorldGen.SquareTileFrame(index1, index2); - NetMessage.SendTileSquare(-1, index1, index2, 1); - } - else if (TileID.Sets.Conversion.Grass[type] && type != 109 && type != 492) + else if (TileID.Sets.Conversion.Grass[type] && type != 109) { Main.tile[index1, index2].type = (ushort) 109; WorldGen.SquareTileFrame(index1, index2); @@ -32839,9 +24602,9 @@ label_296: } continue; case 3: - if (WallID.Sets.CanBeConvertedToGlowingMushroom[wall]) + if (Main.tile[index1, index2].wall == (byte) 64 || Main.tile[index1, index2].wall == (byte) 15) { - Main.tile[index1, index2].wall = (ushort) 80; + Main.tile[index1, index2].wall = (byte) 80; WorldGen.SquareWallFrame(index1, index2); NetMessage.SendTileSquare(-1, index1, index2, 3); } @@ -32864,53 +24627,29 @@ label_296: } continue; case 4: - if (type <= 623 && wall <= 316) + if (type <= 470 && wall <= 231) { if (WallID.Sets.Conversion.Grass[wall] && wall != 81) { - Main.tile[index1, index2].wall = (ushort) 81; + Main.tile[index1, index2].wall = (byte) 81; WorldGen.SquareWallFrame(index1, index2); NetMessage.SendTileSquare(-1, index1, index2, 1); } else if (WallID.Sets.Conversion.Stone[wall] && wall != 83) { - Main.tile[index1, index2].wall = (ushort) 83; + Main.tile[index1, index2].wall = (byte) 83; WorldGen.SquareWallFrame(index1, index2); NetMessage.SendTileSquare(-1, index1, index2, 1); } else if (WallID.Sets.Conversion.HardenedSand[wall] && wall != 218) { - Main.tile[index1, index2].wall = (ushort) 218; + Main.tile[index1, index2].wall = (byte) 218; WorldGen.SquareWallFrame(index1, index2); NetMessage.SendTileSquare(-1, index1, index2, 1); } else if (WallID.Sets.Conversion.Sandstone[wall] && wall != 221) { - Main.tile[index1, index2].wall = (ushort) 221; - WorldGen.SquareWallFrame(index1, index2); - NetMessage.SendTileSquare(-1, index1, index2, 1); - } - else if (WallID.Sets.Conversion.NewWall1[wall] && wall != 192) - { - Main.tile[index1, index2].wall = (ushort) 192; - WorldGen.SquareWallFrame(index1, index2); - NetMessage.SendTileSquare(-1, index1, index2, 1); - } - else if (WallID.Sets.Conversion.NewWall2[wall] && wall != 193) - { - Main.tile[index1, index2].wall = (ushort) 193; - WorldGen.SquareWallFrame(index1, index2); - NetMessage.SendTileSquare(-1, index1, index2, 1); - } - else if (WallID.Sets.Conversion.NewWall3[wall] && wall != 194) - { - Main.tile[index1, index2].wall = (ushort) 194; - WorldGen.SquareWallFrame(index1, index2); - NetMessage.SendTileSquare(-1, index1, index2, 1); - } - else if (WallID.Sets.Conversion.NewWall4[wall] && wall != 195) - { - Main.tile[index1, index2].wall = (ushort) 195; + Main.tile[index1, index2].wall = (byte) 221; WorldGen.SquareWallFrame(index1, index2); NetMessage.SendTileSquare(-1, index1, index2, 1); } @@ -32967,124 +24706,81 @@ label_296: } continue; default: - if (Main.tile[index1, index2].wall == (ushort) 69 || Main.tile[index1, index2].wall == (ushort) 70 || Main.tile[index1, index2].wall == (ushort) 81) + if (Main.tile[index1, index2].wall == (byte) 69 || Main.tile[index1, index2].wall == (byte) 70 || Main.tile[index1, index2].wall == (byte) 81) { - Main.tile[index1, index2].wall = (double) index2 >= Main.worldSurface ? (ushort) 64 : (WorldGen.genRand.Next(10) != 0 ? (ushort) 63 : (ushort) 65); + Main.tile[index1, index2].wall = (double) index2 >= Main.worldSurface ? (byte) 64 : (WorldGen.genRand.Next(10) != 0 ? (byte) 63 : (byte) 65); WorldGen.SquareWallFrame(index1, index2); NetMessage.SendTileSquare(-1, index1, index2, 1); } - else if (WallID.Sets.Conversion.Stone[wall] && wall != 1 && wall != 262 && wall != 274 && wall != 61 && wall != 185) + else if (Main.tile[index1, index2].wall == (byte) 3 || Main.tile[index1, index2].wall == (byte) 28 || Main.tile[index1, index2].wall == (byte) 83) { - Main.tile[index1, index2].wall = (ushort) 1; + Main.tile[index1, index2].wall = (byte) 1; WorldGen.SquareWallFrame(index1, index2); NetMessage.SendTileSquare(-1, index1, index2, 1); } - else if (WallID.Sets.Conversion.Stone[wall] && wall == 262) - { - Main.tile[index1, index2].wall = (ushort) 61; - WorldGen.SquareWallFrame(index1, index2); - NetMessage.SendTileSquare(-1, index1, index2, 1); - } - else if (WallID.Sets.Conversion.Stone[wall] && wall == 274) - { - Main.tile[index1, index2].wall = (ushort) 185; - WorldGen.SquareWallFrame(index1, index2); - NetMessage.SendTileSquare(-1, index1, index2, 1); - } - if (WallID.Sets.Conversion.NewWall1[wall] && wall != 212) - { - Main.tile[index1, index2].wall = (ushort) 212; - WorldGen.SquareWallFrame(index1, index2); - NetMessage.SendTileSquare(-1, index1, index2, 1); - } - else if (WallID.Sets.Conversion.NewWall2[wall] && wall != 213) - { - Main.tile[index1, index2].wall = (ushort) 213; - WorldGen.SquareWallFrame(index1, index2); - NetMessage.SendTileSquare(-1, index1, index2, 1); - } - else if (WallID.Sets.Conversion.NewWall3[wall] && wall != 214) - { - Main.tile[index1, index2].wall = (ushort) 214; - WorldGen.SquareWallFrame(index1, index2); - NetMessage.SendTileSquare(-1, index1, index2, 1); - } - else if (WallID.Sets.Conversion.NewWall4[wall] && wall != 215) - { - Main.tile[index1, index2].wall = (ushort) 215; - WorldGen.SquareWallFrame(index1, index2); - NetMessage.SendTileSquare(-1, index1, index2, 1); - } - else if (Main.tile[index1, index2].wall == (ushort) 80) + else if (Main.tile[index1, index2].wall == (byte) 80) { if ((double) index2 < Main.worldSurface + 4.0 + (double) WorldGen.genRand.Next(3) || (double) index2 > ((double) Main.maxTilesY + Main.rockLayer) / 2.0 - 3.0 + (double) WorldGen.genRand.Next(3)) { - Main.tile[index1, index2].wall = (ushort) 15; + Main.tile[index1, index2].wall = (byte) 15; WorldGen.SquareWallFrame(index1, index2); NetMessage.SendTileSquare(-1, index1, index2, 3); } else { - Main.tile[index1, index2].wall = (ushort) 64; + Main.tile[index1, index2].wall = (byte) 64; WorldGen.SquareWallFrame(index1, index2); NetMessage.SendTileSquare(-1, index1, index2, 3); } } else if (WallID.Sets.Conversion.HardenedSand[wall] && wall != 216) { - Main.tile[index1, index2].wall = (ushort) 216; + Main.tile[index1, index2].wall = (byte) 216; WorldGen.SquareWallFrame(index1, index2); NetMessage.SendTileSquare(-1, index1, index2, 1); } else if (WallID.Sets.Conversion.Sandstone[wall] && wall != 187) { - Main.tile[index1, index2].wall = (ushort) 187; + Main.tile[index1, index2].wall = (byte) 187; WorldGen.SquareWallFrame(index1, index2); NetMessage.SendTileSquare(-1, index1, index2, 1); } - if (Main.tile[index1, index2].type == (ushort) 492) - { - Main.tile[index1, index2].type = (ushort) 477; - WorldGen.SquareTileFrame(index1, index2); - NetMessage.SendTileSquare(-1, index1, index2, 1); - continue; - } - if (type != 60 && TileID.Sets.Conversion.Grass[type] && type != 2 && type != 477) + if (Main.tile[index1, index2].type == (ushort) 23 || Main.tile[index1, index2].type == (ushort) 109 || Main.tile[index1, index2].type == (ushort) 199) { Main.tile[index1, index2].type = (ushort) 2; WorldGen.SquareTileFrame(index1, index2); NetMessage.SendTileSquare(-1, index1, index2, 1); continue; } - if (TileID.Sets.Conversion.Stone[type] && type != 1) + if (Main.tile[index1, index2].type == (ushort) 117 || Main.tile[index1, index2].type == (ushort) 25 || Main.tile[index1, index2].type == (ushort) 203) { Main.tile[index1, index2].type = (ushort) 1; WorldGen.SquareTileFrame(index1, index2); NetMessage.SendTileSquare(-1, index1, index2, 1); continue; } - if (TileID.Sets.Conversion.Sand[type] && type != 53) + if (Main.tile[index1, index2].type == (ushort) 112 || Main.tile[index1, index2].type == (ushort) 116 || Main.tile[index1, index2].type == (ushort) 234) { Main.tile[index1, index2].type = (ushort) 53; WorldGen.SquareTileFrame(index1, index2); NetMessage.SendTileSquare(-1, index1, index2, 1); continue; } - if (TileID.Sets.Conversion.HardenedSand[type] && type != 397) + if (Main.tile[index1, index2].type == (ushort) 398 || Main.tile[index1, index2].type == (ushort) 402 || Main.tile[index1, index2].type == (ushort) 399) { Main.tile[index1, index2].type = (ushort) 397; WorldGen.SquareTileFrame(index1, index2); NetMessage.SendTileSquare(-1, index1, index2, 1); continue; } - if (TileID.Sets.Conversion.Sandstone[type] && type != 396) + if (Main.tile[index1, index2].type == (ushort) 400 || Main.tile[index1, index2].type == (ushort) 403 || Main.tile[index1, index2].type == (ushort) 401) { Main.tile[index1, index2].type = (ushort) 396; WorldGen.SquareTileFrame(index1, index2); NetMessage.SendTileSquare(-1, index1, index2, 1); continue; } - if (TileID.Sets.Conversion.Ice[type] && type != 161) + if (Main.tile[index1, index2].type == (ushort) 164 || Main.tile[index1, index2].type == (ushort) 163 || Main.tile[index1, index2].type == (ushort) 200) { Main.tile[index1, index2].type = (ushort) 161; WorldGen.SquareTileFrame(index1, index2); @@ -33148,8 +24844,6 @@ label_296: if (Main.tile[i + 1, j] == null) return; int num4 = (int) Main.tile[i + 1, j].type; - if (Main.tile[i, j - 1] == null) - return; int num5 = (int) Main.tile[i, j - 1].type; if (num5 == 227) num5 = 80; @@ -33310,42 +25004,34 @@ label_296: { int index1 = j; int i1 = i; - if (!Main.tile[i, j].nactive() || Main.tile[i, j].halfBrick() || !WorldGen.gen && Main.tile[i, j].slope() != (byte) 0 || Main.tile[i, j - 1].liquid > (byte) 0 || Main.tile[i, j].type != (ushort) 53 && Main.tile[i, j].type != (ushort) 80 && Main.tile[i, j].type != (ushort) 234 && Main.tile[i, j].type != (ushort) 112 && Main.tile[i, j].type != (ushort) 116) - return; - int num1 = 0; - for (int index2 = i - WorldGen.cactusWaterWidth; index2 < i + WorldGen.cactusWaterWidth; ++index2) - { - for (int index3 = j - WorldGen.cactusWaterHeight; index3 < j + WorldGen.cactusWaterHeight; ++index3) - num1 += (int) Main.tile[index2, index3].liquid; - } - if (num1 / (int) byte.MaxValue > WorldGen.cactusWaterLimit) + if (!Main.tile[i, j].nactive() || Main.tile[i, j].halfBrick() || Main.tile[i, j].slope() != (byte) 0 || Main.tile[i, j - 1].liquid > (byte) 0 || Main.tile[i, j].type != (ushort) 53 && Main.tile[i, j].type != (ushort) 80 && Main.tile[i, j].type != (ushort) 234 && Main.tile[i, j].type != (ushort) 112 && Main.tile[i, j].type != (ushort) 116) return; if (Main.tile[i, j].type == (ushort) 53 || Main.tile[i, j].type == (ushort) 112 || Main.tile[i, j].type == (ushort) 116 || Main.tile[i, j].type == (ushort) 234) { if (Main.tile[i, j - 1].active() || Main.tile[i - 1, j - 1].active() || Main.tile[i + 1, j - 1].active()) return; + int num1 = 0; int num2 = 0; - int num3 = 0; - for (int index4 = i - 6; index4 <= i + 6; ++index4) + for (int index2 = i - 6; index2 <= i + 6; ++index2) { - for (int index5 = j - 3; index5 <= j + 1; ++index5) + for (int index3 = j - 3; index3 <= j + 1; ++index3) { try { - if (Main.tile[index4, index5].active()) + if (Main.tile[index2, index3].active()) { - if (Main.tile[index4, index5].type == (ushort) 80) + if (Main.tile[index2, index3].type == (ushort) 80) { - ++num2; - if (num2 >= 4) + ++num1; + if (num1 >= 4) return; } - if (Main.tile[index4, index5].type != (ushort) 53 && Main.tile[index4, index5].type != (ushort) 112 && Main.tile[index4, index5].type != (ushort) 116) + if (Main.tile[index2, index3].type != (ushort) 53 && Main.tile[index2, index3].type != (ushort) 112 && Main.tile[index2, index3].type != (ushort) 116) { - if (Main.tile[index4, index5].type != (ushort) 234) + if (Main.tile[index2, index3].type != (ushort) 234) continue; } - ++num3; + ++num2; } } catch @@ -33353,10 +25039,8 @@ label_296: } } } - if (num3 <= 10) + if (num2 <= 10) return; - if (WorldGen.gen && WorldGen.genRand.Next(2) == 0) - Main.tile[i, j].slope((byte) 0); Main.tile[i, j - 1].active(true); Main.tile[i, j - 1].type = (ushort) 80; if (Main.netMode == 2) @@ -33378,101 +25062,96 @@ label_296: ++i1; } } - int num4 = index1 - 1 - j; - int num5 = i - i1; - int num6 = i - num5; - int num7 = j; - int num8 = 11 - num4; - int num9 = 0; - for (int index6 = num6 - 2; index6 <= num6 + 2; ++index6) + int num3 = index1 - 1 - j; + int num4 = i - i1; + int num5 = i - num4; + int num6 = j; + int num7 = 11 - num3; + int num8 = 0; + for (int index4 = num5 - 2; index4 <= num5 + 2; ++index4) { - for (int index7 = num7 - num8; index7 <= num7 + num4; ++index7) + for (int index5 = num6 - num7; index5 <= num6 + num3; ++index5) { - if (Main.tile[index6, index7].active() && Main.tile[index6, index7].type == (ushort) 80) - ++num9; + if (Main.tile[index4, index5].active() && Main.tile[index4, index5].type == (ushort) 80) + ++num8; } } - if (Main.drunkWorld) - { - if (num9 >= WorldGen.genRand.Next(11, 20)) - return; - } - else if (num9 >= WorldGen.genRand.Next(11, 13)) + if (num8 >= WorldGen.genRand.Next(11, 13)) return; - int index8 = i; - int index9 = j; - if (num5 == 0) + int index6 = i; + int index7 = j; + if (num4 == 0) { - if (num4 == 0) + if (num3 == 0) { - if (Main.tile[index8, index9 - 1].active()) + if (Main.tile[index6, index7 - 1].active()) return; - Main.tile[index8, index9 - 1].active(true); - Main.tile[index8, index9 - 1].type = (ushort) 80; - WorldGen.SquareTileFrame(index8, index9 - 1); + Main.tile[index6, index7 - 1].active(true); + Main.tile[index6, index7 - 1].type = (ushort) 80; + WorldGen.SquareTileFrame(index6, index7 - 1); if (Main.netMode != 2) return; - NetMessage.SendTileSquare(-1, index8, index9 - 1, 1); + NetMessage.SendTileSquare(-1, index6, index7 - 1, 1); } else { bool flag1 = false; bool flag2 = false; - if (Main.tile[index8, index9 - 1].active() && Main.tile[index8, index9 - 1].type == (ushort) 80) + if (Main.tile[index6, index7 - 1].active() && Main.tile[index6, index7 - 1].type == (ushort) 80) { - if (!Main.tile[index8 - 1, index9].active() && !Main.tile[index8 - 2, index9 + 1].active() && !Main.tile[index8 - 1, index9 - 1].active() && !Main.tile[index8 - 1, index9 + 1].active() && !Main.tile[index8 - 2, index9].active()) + if (!Main.tile[index6 - 1, index7].active() && !Main.tile[index6 - 2, index7 + 1].active() && !Main.tile[index6 - 1, index7 - 1].active() && !Main.tile[index6 - 1, index7 + 1].active() && !Main.tile[index6 - 2, index7].active()) flag1 = true; - if (!Main.tile[index8 + 1, index9].active() && !Main.tile[index8 + 2, index9 + 1].active() && !Main.tile[index8 + 1, index9 - 1].active() && !Main.tile[index8 + 1, index9 + 1].active() && !Main.tile[index8 + 2, index9].active()) + if (!Main.tile[index6 + 1, index7].active() && !Main.tile[index6 + 2, index7 + 1].active() && !Main.tile[index6 + 1, index7 - 1].active() && !Main.tile[index6 + 1, index7 + 1].active() && !Main.tile[index6 + 2, index7].active()) flag2 = true; } - int num10 = WorldGen.genRand.Next(3); - if (num10 == 0 & flag1) + int num9 = WorldGen.genRand.Next(3); + if (num9 == 0 & flag1) { - Main.tile[index8 - 1, index9].active(true); - Main.tile[index8 - 1, index9].type = (ushort) 80; - WorldGen.SquareTileFrame(index8 - 1, index9); + Main.tile[index6 - 1, index7].active(true); + Main.tile[index6 - 1, index7].type = (ushort) 80; + WorldGen.SquareTileFrame(index6 - 1, index7); if (Main.netMode != 2) return; - NetMessage.SendTileSquare(-1, index8 - 1, index9, 1); + NetMessage.SendTileSquare(-1, index6 - 1, index7, 1); } - else if (num10 == 1 & flag2) + else if (num9 == 1 & flag2) { - Main.tile[index8 + 1, index9].active(true); - Main.tile[index8 + 1, index9].type = (ushort) 80; - WorldGen.SquareTileFrame(index8 + 1, index9); + Main.tile[index6 + 1, index7].active(true); + Main.tile[index6 + 1, index7].type = (ushort) 80; + WorldGen.SquareTileFrame(index6 + 1, index7); if (Main.netMode != 2) return; - NetMessage.SendTileSquare(-1, index8 + 1, index9, 1); + NetMessage.SendTileSquare(-1, index6 + 1, index7, 1); } else { - if (num4 >= WorldGen.genRand.Next(2, 8)) + if (num3 >= WorldGen.genRand.Next(2, 8)) return; - if (Main.tile[index8 - 1, index9 - 1].active()) + if (Main.tile[index6 - 1, index7 - 1].active()) { - int type = (int) Main.tile[index8 - 1, index9 - 1].type; + int type = (int) Main.tile[index6 - 1, index7 - 1].type; } - if (Main.tile[index8 + 1, index9 - 1].active() && Main.tile[index8 + 1, index9 - 1].type == (ushort) 80 || Main.tile[index8, index9 - 1].active()) + if (Main.tile[index6 + 1, index7 - 1].active() && Main.tile[index6 + 1, index7 - 1].type == (ushort) 80 || Main.tile[index6, index7 - 1].active()) return; - Main.tile[index8, index9 - 1].active(true); - Main.tile[index8, index9 - 1].type = (ushort) 80; - WorldGen.SquareTileFrame(index8, index9 - 1); + Main.tile[index6, index7 - 1].active(true); + Main.tile[index6, index7 - 1].type = (ushort) 80; + WorldGen.SquareTileFrame(index6, index7 - 1); if (Main.netMode != 2) return; - NetMessage.SendTileSquare(-1, index8, index9 - 1, 1); + NetMessage.SendTileSquare(-1, index6, index7 - 1, 1); } } } else { - if (Main.tile[index8, index9 - 1].active() || Main.tile[index8, index9 - 2].active() || Main.tile[index8 + num5, index9 - 1].active() || !Main.tile[index8 - num5, index9 - 1].active() || Main.tile[index8 - num5, index9 - 1].type != (ushort) 80) + if (Main.tile[index6, index7 - 1].active() || Main.tile[index6, index7 - 2].active() || Main.tile[index6 + num4, index7 - 1].active() || !Main.tile[index6 - num4, index7 - 1].active() || Main.tile[index6 - num4, index7 - 1].type != (ushort) 80) return; - Main.tile[index8, index9 - 1].active(true); - Main.tile[index8, index9 - 1].type = (ushort) 80; - WorldGen.SquareTileFrame(index8, index9 - 1); + Main.tile[index6, index7 - 1].active(true); + Main.tile[index6, index7 - 1].type = (ushort) 80; + WorldGen.SquareTileFrame(index6, index7 - 1); if (Main.netMode != 2) return; - NetMessage.SendTileSquare(-1, index8, index9 - 1, 1); + NetMessage.SendTileSquare(-1, index6, index7 - 1, 1); } } } @@ -33481,7 +25160,7 @@ label_296: { if (WorldGen.destroyObject) return; - bool flag1 = false; + bool flag = false; int num1 = 0; int num2 = j; int num3 = num1 + (int) Main.tile[i, j].frameX / 18; @@ -33506,22 +25185,22 @@ label_296: while (num8 > 1) num8 -= 2; if (!Main.tile[i1, index].active() || (int) Main.tile[i1, index].type != type || num8 != i1 - num4 || (int) Main.tile[i1, index].frameY != (index - num7) * 18 + num6 * 36) - flag1 = true; + flag = true; } if (Main.tile[i1, num7 + 2] == null) Main.tile[i1, num7 + 2] = new Tile(); if (!WorldGen.SolidTile2(i1, num7 + 2)) - flag1 = true; + flag = true; } - if (!flag1) + if (!flag) return; WorldGen.destroyObject = true; if (num6 >= 7 && num6 <= 9) - SoundEngine.PlaySound(6, i * 16, j * 16); + Main.PlaySound(6, i * 16, j * 16); else if (num6 >= 16 && num6 <= 24) - SoundEngine.PlaySound(4, i * 16, j * 16); + Main.PlaySound(4, i * 16, j * 16); else - SoundEngine.PlaySound(13, i * 16, j * 16); + Main.PlaySound(13, i * 16, j * 16); for (int i2 = num4; i2 < num4 + 2; ++i2) { for (int j1 = num7; j1 < num7 + 2; ++j1) @@ -33531,7 +25210,6 @@ label_296: } } float num9 = 1f; - bool flag2 = false; switch (num6) { case 0: @@ -33624,30 +25302,19 @@ label_296: num9 = 2f; break; } - if (num6 >= 34 && num6 <= 36) - { - Gore.NewGore(new Vector2((float) (i * 16), (float) (j * 16)), new Vector2(), 1122); - Gore.NewGore(new Vector2((float) (i * 16), (float) (j * 16)), new Vector2(), 1123); - Gore.NewGore(new Vector2((float) (i * 16), (float) (j * 16)), new Vector2(), 1124); - num9 = 1.25f; - flag2 = true; - break; - } break; } float num11 = (float) (((double) num9 * 2.0 + 1.0) / 3.0); - int range = (int) (500.0 / (((double) num11 + 1.0) / 2.0)); + int maxValue = (int) (250.0 / (((double) num11 + 1.0) / 2.0)); if (!WorldGen.gen) { - if ((double) Player.GetClosestRollLuck(i, j, range) == 0.0) + if (Main.rand.Next(maxValue) == 0) { if (Main.netMode != 1) Projectile.NewProjectile((float) (i * 16 + 16), (float) (j * 16 + 16), 0.0f, -12f, 518, 0, 0.0f, Main.myPlayer); } - else if (WorldGen.genRand.Next(35) == 0 && Main.wallDungeon[(int) Main.tile[i, j].wall] && (double) j > Main.worldSurface) + else if (WorldGen.genRand.Next(40) == 0 && Main.wallDungeon[(int) Main.tile[i, j].wall] && (double) j > Main.worldSurface) Item.NewItem(i * 16, j * 16, 16, 16, 327); - else if (Main.getGoodWorld && WorldGen.genRand.Next(4) == 0) - Projectile.NewProjectile((float) (i * 16 + 16), (float) (j * 16 + 8), (float) Main.rand.Next(-100, 101) * (1f / 500f), 0.0f, 28, 0, 0.0f, (int) Player.FindClosest(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16)); else if (WorldGen.genRand.Next(45) == 0 || Main.rand.Next(45) == 0 && Main.expertMode) { if ((double) j < Main.worldSurface) @@ -33668,7 +25335,7 @@ label_296: if (num12 == 6) Item.NewItem(i * 16, j * 16, 16, 16, 2325); if (num12 >= 7) - Item.NewItem(i * 16, j * 16, 16, 16, 2350, WorldGen.genRand.Next(1, 3)); + Item.NewItem(i * 16, j * 16, 16, 16, 2350); } else if ((double) j < Main.rockLayer) { @@ -33691,10 +25358,10 @@ label_296: Item.NewItem(i * 16, j * 16, 16, 16, 2322); if (num13 == 8) Item.NewItem(i * 16, j * 16, 16, 16, 2329); - if (num13 >= 7) - Item.NewItem(i * 16, j * 16, 16, 16, 2350, WorldGen.genRand.Next(1, 3)); + if (num13 >= 9) + Item.NewItem(i * 16, j * 16, 16, 16, 2350); } - else if (j < Main.UnderworldLayer) + else if (j < Main.maxTilesY - 200) { int num14 = WorldGen.genRand.Next(15); if (num14 == 0) @@ -33725,8 +25392,8 @@ label_296: Item.NewItem(i * 16, j * 16, 16, 16, 2327); if (num14 == 13) Item.NewItem(i * 16, j * 16, 16, 16, 2329); - if (num14 >= 7) - Item.NewItem(i * 16, j * 16, 16, 16, 2350, WorldGen.genRand.Next(1, 3)); + if (num14 == 14) + Item.NewItem(i * 16, j * 16, 16, 16, 2350); } else { @@ -33759,8 +25426,6 @@ label_296: Item.NewItem(i * 16, j * 16, 16, 16, 2323); if (num15 == 13) Item.NewItem(i * 16, j * 16, 16, 16, 2326); - if (WorldGen.genRand.Next(5) == 0) - Item.NewItem(i * 16, j * 16, 16, 16, 4870); } } else if (Main.netMode == 2 && Main.rand.Next(30) == 0) @@ -33769,11 +25434,10 @@ label_296: } else { - int num16 = Main.rand.Next(7); + int num16 = Main.rand.Next(8); if (Main.expertMode) --num16; - Player player = Main.player[(int) Player.FindClosest(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16)]; - if (num16 == 0 && player.statLife < player.statLifeMax2) + if (num16 == 0 && Main.player[(int) Player.FindClosest(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16)].statLife < Main.player[(int) Player.FindClosest(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16)].statLifeMax2) { Item.NewItem(i * 16, j * 16, 16, 16, 58); if (Main.rand.Next(2) == 0) @@ -33786,86 +25450,55 @@ label_296: Item.NewItem(i * 16, j * 16, 16, 16, 58); } } + else if (num16 == 1 && Main.player[(int) Player.FindClosest(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16)].statMana < Main.player[(int) Player.FindClosest(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16)].statManaMax2) + { + Item.NewItem(i * 16, j * 16, 16, 16, 184); + } else { switch (num16) { - case 1: - int Stack1 = Main.rand.Next(2, 7); + case 2: + int Stack1 = Main.rand.Next(2, 6); if (Main.expertMode) Stack1 += Main.rand.Next(1, 7); - int Type1 = 8; - int Type2 = 282; - if (player.ZoneHallow) - { - Stack1 += Main.rand.Next(2, 7); - Type1 = 4387; - } - else if (num6 >= 22 && num6 <= 24 || player.ZoneCrimson) - { - Stack1 += Main.rand.Next(2, 7); - Type1 = 4386; - } - else if (num6 >= 16 && num6 <= 18 || player.ZoneCorrupt) - { - Stack1 += Main.rand.Next(2, 7); - Type1 = 4385; - } - else if (num6 >= 7 && num6 <= 9) - { - Stack1 += Main.rand.Next(2, 7); - Type1 = 4388; - } - else if (num6 >= 4 && num6 <= 6) - { - Type1 = 974; - Type2 = 286; - } - else if (num6 >= 34 && num6 <= 36) - { - Stack1 += Main.rand.Next(2, 7); - Type1 = 4383; - } if (Main.tile[i, j].liquid > (byte) 0) { - Item.NewItem(i * 16, j * 16, 16, 16, Type2, Stack1); + Item.NewItem(i * 16, j * 16, 16, 16, 282, Stack1); break; } - Item.NewItem(i * 16, j * 16, 16, 16, Type1, Stack1); - break; - case 2: - int Stack2 = Main.rand.Next(10, 21); - int Type3 = 40; - if ((double) j < Main.rockLayer && WorldGen.genRand.Next(2) == 0) - Type3 = !Main.hardMode ? 42 : 168; - if (j > Main.UnderworldLayer) - Type3 = 265; - else if (Main.hardMode) - Type3 = Main.rand.Next(2) != 0 ? 47 : (WorldGen.SavedOreTiers.Silver != 168 ? 278 : 4915); - Item.NewItem(i * 16, j * 16, 16, 16, Type3, Stack2); + Item.NewItem(i * 16, j * 16, 16, 16, 8, Stack1); break; case 3: - int Type4 = 28; - if (j > Main.UnderworldLayer || Main.hardMode) - Type4 = 188; + int Stack2 = Main.rand.Next(10, 21); + int Type1 = 40; + if ((double) j < Main.rockLayer && WorldGen.genRand.Next(2) == 0) + Type1 = !Main.hardMode ? 42 : 168; + if (j > Main.maxTilesY - 200) + Type1 = 265; + else if (Main.hardMode) + Type1 = Main.rand.Next(2) != 0 ? 47 : 278; + Item.NewItem(i * 16, j * 16, 16, 16, Type1, Stack2); + break; + case 4: + int Type2 = 28; + if (j > Main.maxTilesY - 200 || Main.hardMode) + Type2 = 188; int Stack3 = 1; if (Main.expertMode && Main.rand.Next(3) != 0) ++Stack3; - Item.NewItem(i * 16, j * 16, 16, 16, Type4, Stack3); + Item.NewItem(i * 16, j * 16, 16, 16, Type2, Stack3); break; default: - if (num16 == 4 && (flag2 || (double) j > Main.rockLayer)) + if (num16 == 5 && (double) j > Main.rockLayer) { - int Type5 = 166; - if (flag2) - Type5 = 4423; int Stack4 = Main.rand.Next(4) + 1; if (Main.expertMode) Stack4 += Main.rand.Next(4); - Item.NewItem(i * 16, j * 16, 16, 16, Type5, Stack4); + Item.NewItem(i * 16, j * 16, 16, 16, 166, Stack4); break; } - if ((num16 == 4 || num16 == 5) && j < Main.UnderworldLayer && !Main.hardMode) + if ((num16 == 5 || num16 == 6) && j < Main.maxTilesY - 200 && !Main.hardMode) { int Stack5 = Main.rand.Next(20, 41); Item.NewItem(i * 16, j * 16, 16, 16, 965, Stack5); @@ -33978,8 +25611,6 @@ label_296: public static int PlaceChest(int x, int y, ushort type = 21, bool notNearOtherChests = false, int style = 0) { int num = -1; - if (TileID.Sets.Boulders[(int) Main.tile[x, y + 1].type] || TileID.Sets.Boulders[(int) Main.tile[x + 1, y + 1].type]) - return -1; TileObject objectData; if (TileObject.CanPlace(x, y, (int) type, style, 1, out objectData)) { @@ -34080,57 +25711,55 @@ label_296: int num1 = 0; int num2 = j; int num3 = num1 + (int) Main.tile[i, j].frameX / 18; - int Y = num2 + (int) Main.tile[i, j].frameY / 18 * -1; + int num4 = num2 + (int) Main.tile[i, j].frameY / 18 * -1; while (num3 > 1) num3 -= 2; - int X = num3 * -1 + i; - for (int index1 = X; index1 < X + 2; ++index1) + int i1 = num3 * -1 + i; + for (int index1 = i1; index1 < i1 + 2; ++index1) { - for (int index2 = Y; index2 < Y + 2; ++index2) + for (int index2 = num4; index2 < num4 + 2; ++index2) { if (Main.tile[index1, index2] == null) Main.tile[index1, index2] = new Tile(); - int num4 = (int) Main.tile[index1, index2].frameX / 18; - while (num4 > 1) - num4 -= 2; - if (!Main.tile[index1, index2].active() || (int) Main.tile[index1, index2].type != type || num4 != index1 - X || (int) Main.tile[index1, index2].frameY != (index2 - Y) * 18) + int num5 = (int) Main.tile[index1, index2].frameX / 18; + while (num5 > 1) + num5 -= 2; + if (!Main.tile[index1, index2].active() || (int) Main.tile[index1, index2].type != type || num5 != index1 - i1 || (int) Main.tile[index1, index2].frameY != (index2 - num4) * 18) flag = true; } - if (Main.tile[index1, Y + 2] == null) - Main.tile[index1, Y + 2] = new Tile(); - if ((!Main.tile[index1, Y + 2].active() || !Main.tileSolid[(int) Main.tile[index1, Y + 2].type]) && Chest.CanDestroyChest(X, Y)) + if (Main.tile[index1, num4 + 2] == null) + Main.tile[index1, num4 + 2] = new Tile(); + if (!Main.tile[index1, num4 + 2].active() || !Main.tileSolid[(int) Main.tile[index1, num4 + 2].type]) flag = true; } if (!flag) return; - int chestItemDrop = WorldGen.GetChestItemDrop(i, j, type); + int index3 = (int) Main.tile[i, j].frameX / 36; + int Type = type != 467 ? Chest.chestItemSpawn[index3] : Chest.chestItemSpawn2[index3]; WorldGen.destroyObject = true; - for (int index3 = X; index3 < X + 2; ++index3) + for (int index4 = i1; index4 < i1 + 2; ++index4) { - for (int index4 = Y; index4 < Y + 3; ++index4) + for (int index5 = num4; index5 < num4 + 3; ++index5) { - if ((int) Main.tile[index3, index4].type == type && Main.tile[index3, index4].active()) + if ((int) Main.tile[index4, index5].type == type && Main.tile[index4, index5].active()) { - Chest.DestroyChest(index3, index4); - WorldGen.KillTile(index3, index4); + Chest.DestroyChest(index4, index5); + WorldGen.KillTile(index4, index5); } } } - Item.NewItem(i * 16, j * 16, 32, 32, chestItemDrop); + Item.NewItem(i * 16, j * 16, 32, 32, Type); WorldGen.destroyObject = false; - } - - private static int GetChestItemDrop(int x, int y, int type) - { - int index = (int) Main.tile[x, y].frameX / 36; - return type != 467 ? Chest.chestItemSpawn[index] : Chest.chestItemSpawn2[index]; + if (Main.tile[i1, num4 + 2].type != (ushort) 138 && Main.tile[i1 + 1, num4 + 2].type != (ushort) 138) + return; + WorldGen.SquareTileFrame(i1, num4 + 2); } public static bool PlaceActuator(int i, int j) { if (Main.tile[i, j].actuator()) return false; - SoundEngine.PlaySound(0, i * 16, j * 16); + Main.PlaySound(0, i * 16, j * 16); Main.tile[i, j].actuator(true); return true; } @@ -34139,7 +25768,7 @@ label_296: { if (!Main.tile[i, j].actuator()) return false; - SoundEngine.PlaySound(0, i * 16, j * 16); + Main.PlaySound(0, i * 16, j * 16); Main.tile[i, j].actuator(false); if (Main.netMode != 1) Item.NewItem(i * 16, j * 16, 16, 16, 849); @@ -34152,7 +25781,7 @@ label_296: { if (Main.tile[i, j].wire()) return false; - SoundEngine.PlaySound(0, i * 16, j * 16); + Main.PlaySound(0, i * 16, j * 16); Main.tile[i, j].wire(true); return true; } @@ -34161,7 +25790,7 @@ label_296: { if (!Main.tile[i, j].wire()) return false; - SoundEngine.PlaySound(0, i * 16, j * 16); + Main.PlaySound(0, i * 16, j * 16); Main.tile[i, j].wire(false); if (Main.netMode != 1) Item.NewItem(i * 16, j * 16, 16, 16, 530); @@ -34174,7 +25803,7 @@ label_296: { if (Main.tile[i, j].wire2()) return false; - SoundEngine.PlaySound(0, i * 16, j * 16); + Main.PlaySound(0, i * 16, j * 16); Main.tile[i, j].wire2(true); return true; } @@ -34183,7 +25812,7 @@ label_296: { if (!Main.tile[i, j].wire2()) return false; - SoundEngine.PlaySound(0, i * 16, j * 16); + Main.PlaySound(0, i * 16, j * 16); Main.tile[i, j].wire2(false); if (Main.netMode != 1) Item.NewItem(i * 16, j * 16, 16, 16, 530); @@ -34196,7 +25825,7 @@ label_296: { if (Main.tile[i, j].wire3()) return false; - SoundEngine.PlaySound(0, i * 16, j * 16); + Main.PlaySound(0, i * 16, j * 16); Main.tile[i, j].wire3(true); return true; } @@ -34205,7 +25834,7 @@ label_296: { if (!Main.tile[i, j].wire3()) return false; - SoundEngine.PlaySound(0, i * 16, j * 16); + Main.PlaySound(0, i * 16, j * 16); Main.tile[i, j].wire3(false); if (Main.netMode != 1) Item.NewItem(i * 16, j * 16, 16, 16, 530); @@ -34218,7 +25847,7 @@ label_296: { if (Main.tile[i, j].wire4()) return false; - SoundEngine.PlaySound(0, i * 16, j * 16); + Main.PlaySound(0, i * 16, j * 16); Main.tile[i, j].wire4(true); return true; } @@ -34227,7 +25856,7 @@ label_296: { if (!Main.tile[i, j].wire4()) return false; - SoundEngine.PlaySound(0, i * 16, j * 16); + Main.PlaySound(0, i * 16, j * 16); Main.tile[i, j].wire4(false); if (Main.netMode != 1) Item.NewItem(i * 16, j * 16, 16, 16, 530); @@ -34236,830 +25865,16 @@ label_296: return true; } - public static bool IsFitToPlaceFlowerIn(int x, int y, int typeAttemptedToPlace) - { - if (y < 1 || y > Main.maxTilesY - 1) - return false; - Tile tile = Main.tile[x, y + 1]; - if (!tile.active() || tile.slope() != (byte) 0 || tile.halfBrick()) - return false; - if ((tile.type == (ushort) 2 || tile.type == (ushort) 78 || tile.type == (ushort) 380 || tile.type == (ushort) 477 || tile.type == (ushort) 579) && typeAttemptedToPlace == 3 || tile.type == (ushort) 23 && typeAttemptedToPlace == 24 || (tile.type == (ushort) 109 || tile.type == (ushort) 492) && typeAttemptedToPlace == 110) - return true; - return tile.type == (ushort) 199 && typeAttemptedToPlace == 201; - } - - private static bool SeaOatWaterCheck(int x, int y) - { - int num1 = 45; - int num2 = 20; - int num3 = 20; - int num4 = -1; - int num5 = num1 + 1; - int num6 = 0; - bool flag = false; - if (x <= WorldGen.beachDistance || x >= Main.maxTilesX - WorldGen.beachDistance) - { - flag = true; - num4 = 40; - num1 = 65; - num2 += 5; - } - for (int index1 = x - num1; index1 <= x + num1; ++index1) - { - for (int index2 = y - num2; index2 <= y + num2; ++index2) - { - if (WorldGen.InWorld(index1, index2) && !WorldGen.SolidTile(index1, index2) && Main.tile[index1, index2].liquid > (byte) 0) - { - num6 += (int) Main.tile[index1, index2].liquid; - int num7 = Math.Abs(index1 - x); - if (num7 < num5) - num5 = num7; - } - } - } - if (num6 / (int) byte.MaxValue >= num3) - { - if (!flag) - return true; - return false; - } - return flag; - } - - private static bool PlantSeaOat(int x, int y) - { - if (Main.tile[x, y].wall > (ushort) 0 || Main.tile[x, y].active() || Main.tile[x, y].liquid > (byte) 0 || !WorldGen.SolidTileAllowBottomSlope(x, y + 1) || !TileID.Sets.Conversion.Sand[(int) Main.tile[x, y + 1].type] || !WorldGen.SeaOatWaterCheck(x, y)) - return false; - Main.tile[x, y].active(true); - Main.tile[x, y].slope((byte) 0); - Main.tile[x, y].halfBrick(false); - Main.tile[x, y].type = (ushort) 529; - Main.tile[x, y].frameX = (short) (WorldGen.genRand.Next(5) * 18); - int num = 0; - Main.tile[x, y].frameY = (short) (num * 34); - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, x, y, 1); - return true; - } - - private static bool CheckSeaOat(int x, int y) - { - if (WorldGen.SeaOatWaterCheck(x, y)) - return true; - WorldGen.KillTile(x, y); - if (Main.netMode == 2) - NetMessage.SendData(17, number2: ((float) x), number3: ((float) y)); - return false; - } - - private static bool GrowSeaOat(int x, int y) - { - if (Main.tile[x, y].frameX < (short) 180) - Main.tile[x, y].frameX += (short) 90; - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, x, y, 1); - return false; - } - - private static int GetWaterDepth(int x, int y) - { - int j1 = y; - while (!WorldGen.SolidTile(x, j1)) - { - ++j1; - if (j1 > Main.maxTilesY - 1) - return 0; - } - int num = j1 - 1; - int j2 = num; - while (Main.tile[x, j2].liquid > (byte) 0 && !WorldGen.SolidTile(x, j2)) - --j2; - return num - j2; - } - - private static int CountGrowingPlantTiles(int x, int y, int range, int type) - { - int num = 0; - for (int index1 = x - range; index1 <= x + range; ++index1) - { - for (int index2 = y - range * 3; index2 <= y + range * 3; ++index2) - { - if (Main.tile[index1, index2].active() && (int) Main.tile[index1, index2].type == type) - ++num; - } - } - return num; - } - - private static bool PlaceBamboo(int x, int y) - { - int num1 = 2; - int num2 = 5; - int num3 = WorldGen.genRand.Next(1, 21); - if (Main.tile[x, y].wall > (ushort) 0) - return false; - Tile tile1 = Main.tile[x, y + 1]; - if (tile1.type != (ushort) 571 && tile1.type != (ushort) 60) - return false; - int waterDepth = WorldGen.GetWaterDepth(x, y); - if (waterDepth < num1 || waterDepth > num2) - return false; - int num4 = WorldGen.CountGrowingPlantTiles(x, y, 5, 571); - int num5 = 1; - if (tile1.type == (ushort) 571) - { - while (!WorldGen.SolidTile(x, y + num5)) - ++num5; - if (num5 + num4 / WorldGen.genRand.Next(1, 21) > num3) - return false; - } - else - num4 += 25; - if (num4 + num5 * 2 > WorldGen.genRand.Next(40, 61)) - return false; - Tile tile2 = Main.tile[x, y]; - tile2.active(true); - tile2.type = (ushort) 571; - tile2.frameX = (short) 0; - tile2.frameY = (short) 0; - tile2.slope((byte) 0); - tile2.halfBrick(false); - WorldGen.SquareTileFrame(x, y); - return true; - } - - public static void CheckBamboo(int x, int y) - { - Tile tile1 = Main.tile[x, y + 1]; - if (tile1 == null) - return; - if (!tile1.active() || tile1.type != (ushort) 60 && tile1.type != (ushort) 571) - { - WorldGen.KillTile(x, y); - if (Main.netMode == 2) - NetMessage.SendData(17, number2: ((float) x), number3: ((float) y)); - WorldGen.SquareTileFrame(x, y); - } - else - { - Tile tile2 = Main.tile[x, y - 1]; - if (tile2 == null) - return; - Tile tile3 = Main.tile[x, y]; - if (tile3 == null) - return; - int num1 = !tile2.active() ? 0 : (tile2.type == (ushort) 571 ? 1 : 0); - bool flag = tile1.active() && tile1.type == (ushort) 571; - int num2 = (int) tile3.frameX / 18; - tile3.frameY = (short) 0; - if (num1 != 0) - { - if (flag) - { - if ((num2 < 5 ? 0 : (num2 <= 14 ? 1 : 0)) != 0) - return; - tile3.frameX = (short) (WorldGen.genRand.Next(5, 15) * 18); - if (Main.netMode != 2) - return; - NetMessage.SendTileSquare(-1, x, y, 1); - } - else - { - if ((num2 < 1 ? 0 : (num2 <= 4 ? 1 : 0)) != 0) - return; - tile3.frameX = (short) (WorldGen.genRand.Next(1, 5) * 18); - if (Main.netMode != 2) - return; - NetMessage.SendTileSquare(-1, x, y, 1); - } - } - else if (flag) - { - if ((num2 < 15 ? 0 : (num2 <= 19 ? 1 : 0)) != 0) - return; - tile3.frameX = (short) (WorldGen.genRand.Next(15, 20) * 18); - if (Main.netMode != 2) - return; - NetMessage.SendTileSquare(-1, x, y, 1); - } - else - { - if ((uint) num2 <= 0U) - return; - tile3.frameX = (short) 0; - if (Main.netMode != 2) - return; - NetMessage.SendTileSquare(-1, x, y, 1); - } - } - } - - public static void PlaceUnderwaterPlant(ushort type, int x, int y) - { - if (!WorldGen.CanUnderwaterPlantGrowHere(type, x, y, false)) - return; - Tile tileSafely1 = Framing.GetTileSafely(x, y + 1); - tileSafely1.slope((byte) 0); - tileSafely1.halfBrick(false); - Tile tileSafely2 = Framing.GetTileSafely(x, y); - tileSafely2.active(true); - tileSafely2.type = type; - tileSafely2.frameX = (short) 0; - tileSafely2.frameY = (short) 0; - tileSafely2.slope((byte) 0); - tileSafely2.halfBrick(false); - WorldGen.SquareTileFrame(x, y); - } - - public static bool CanUnderwaterPlantGrowHere(ushort type, int x, int y, bool ignoreSelf) - { - if (!WorldGen.InWorld(x, y, 50)) - return false; - Tile tileSafely1 = Framing.GetTileSafely(x, y); - if (!ignoreSelf && tileSafely1.active()) - return false; - for (int index = 0; index < 3; ++index) - { - Tile tileSafely2 = Framing.GetTileSafely(x, y - index); - if (tileSafely2.liquid == (byte) 0 || tileSafely2.liquidType() != (byte) 0) - return false; - } - Tile tileSafely3 = Framing.GetTileSafely(x, y + 1); - if (!tileSafely3.nactive() || (TileID.Sets.Conversion.Sand[(int) tileSafely3.type] ? 1 : ((int) type == (int) tileSafely3.type ? 1 : 0)) == 0) - return false; - switch (Framing.GetTileSafely(x, y).wall) - { - case 0: - case 63: - case 64: - case 65: - case 66: - case 67: - case 68: - case 69: - case 80: - case 81: - return true; - default: - return false; - } - } - - public static void CheckUnderwaterPlant(ushort type, int x, int y) - { - if (!WorldGen.CanUnderwaterPlantGrowHere(type, x, y, true)) - { - WorldGen.KillTile(x, y); - if (Main.netMode == 2) - NetMessage.SendData(17, number2: ((float) x), number3: ((float) y)); - WorldGen.SquareTileFrame(x, y); - } - else - { - Tile tileSafely1 = Framing.GetTileSafely(x, y - 1); - Tile tileSafely2 = Framing.GetTileSafely(x, y); - Tile tileSafely3 = Framing.GetTileSafely(x, y + 1); - int num1 = !tileSafely1.active() ? 0 : ((int) tileSafely1.type == (int) type ? 1 : 0); - bool flag = tileSafely3.active() && (int) tileSafely3.type == (int) type; - int num2 = (int) tileSafely2.frameX / 18; - tileSafely2.frameY = (short) 0; - if (num1 != 0) - { - if ((1 > num2 ? 0 : (num2 <= 7 ? 1 : 0)) != 0) - return; - tileSafely2.frameX = (short) (WorldGen.genRand.Next(1, 8) * 18); - if (Main.netMode != 2) - return; - NetMessage.SendTileSquare(-1, x, y, 1); - } - else if (flag) - { - if ((7 > num2 ? 0 : (num2 <= 12 ? 1 : 0)) != 0) - return; - tileSafely2.frameX = (short) (WorldGen.genRand.Next(7, 13) * 18); - if (Main.netMode != 2) - return; - NetMessage.SendTileSquare(-1, x, y, 1); - } - else - { - if ((uint) num2 <= 0U) - return; - tileSafely2.frameX = (short) 0; - if (Main.netMode != 2) - return; - NetMessage.SendTileSquare(-1, x, y, 1); - } - } - } - - public static Point PlaceCatTail(int x, int j) - { - int index1 = j; - Point point = new Point(-1, -1); - if (x < 50 || x > Main.maxTilesX - 50 || index1 < 50 || index1 > Main.maxTilesY - 50 || Main.tile[x, index1].active() && Main.tile[x, index1].type != (ushort) 71 || Main.tile[x, index1].liquid == (byte) 0 || Main.tile[x, index1].liquidType() != (byte) 0) - return point; - while (Main.tile[x, index1].liquid > (byte) 0 && index1 > 50) - --index1; - int index2 = index1 + 1; - if (Main.tile[x, index2].active() || Main.tile[x, index2 - 1].active() || Main.tile[x, index2].liquid == (byte) 0 || Main.tile[x, index2].liquidType() != (byte) 0 || Main.tile[x, index2].wall != (ushort) 0 && Main.tile[x, index2].wall != (ushort) 80 && Main.tile[x, index2].wall != (ushort) 81 && Main.tile[x, index2].wall != (ushort) 69 && (Main.tile[x, index2].wall < (ushort) 63 || Main.tile[x, index2].wall > (ushort) 68)) - return point; - int num1 = 7; - int num2 = 0; - for (int index3 = x - num1; index3 <= x + num1; ++index3) - { - for (int index4 = index2 - num1; index4 <= index2 + num1; ++index4) - { - if (Main.tile[index3, index4].active() && Main.tile[index3, index4].type == (ushort) 519) - { - ++num2; - break; - } - } - } - if (num2 > 3) - return point; - int index5; - for (index5 = index2; (!Main.tile[x, index5].active() || !Main.tileSolid[(int) Main.tile[x, index5].type] || Main.tileSolidTop[(int) Main.tile[x, index5].type]) && index5 < Main.maxTilesY - 50; ++index5) - { - if (Main.tile[x, index5].active() && Main.tile[x, index5].type != (ushort) 71) - return point; - } - int num3 = WorldGen.catTailDistance - 1; - if (index5 - index2 > num3 || index5 - index2 < 2) - return point; - int type = (int) Main.tile[x, index5].type; - if (!Main.tile[x, index5].nactive()) - return point; - int num4 = -1; - switch (type) - { - case 2: - case 477: - num4 = 0; - break; - case 23: - case 112: - num4 = 72; - break; - case 53: - if (x < WorldGen.beachDistance || x > Main.maxTilesX - WorldGen.beachDistance) - return point; - num4 = 18; - break; - case 70: - num4 = 90; - break; - case 199: - case 234: - num4 = 54; - break; - } - if (num4 < 0) - return point; - if (Main.tile[x, index5].topSlope() && WorldGen.gen && WorldGen.genRand.Next(3) != 0) - Main.tile[x, index5].slope((byte) 0); - else if (Main.tile[x, index5].topSlope() || Main.tile[x, index5].halfBrick()) - return point; - int index6 = index5 - 1; - Main.tile[x, index6].active(true); - Main.tile[x, index6].type = (ushort) 519; - Main.tile[x, index6].frameX = (short) 0; - Main.tile[x, index6].frameY = (short) num4; - Main.tile[x, index6].halfBrick(false); - Main.tile[x, index6].slope((byte) 0); - WorldGen.SquareTileFrame(x, index6); - point = new Point(x, index6); - return point; - } - - public static void CheckCatTail(int x, int j) - { - if (Main.tile[x, j] == null) - return; - int num1 = j; - bool flag = false; - int index1 = num1; - while ((!Main.tile[x, index1].active() || !Main.tileSolid[(int) Main.tile[x, index1].type] || Main.tileSolidTop[(int) Main.tile[x, index1].type]) && index1 < Main.maxTilesY - 50) - { - if (Main.tile[x, index1].active() && Main.tile[x, index1].type != (ushort) 519) - flag = true; - if (Main.tile[x, index1].active()) - { - ++index1; - if (Main.tile[x, index1] == null) - return; - } - else - break; - } - int index2 = index1 - 1; - if (Main.tile[x, index2] == null) - return; - while (Main.tile[x, index2] != null && Main.tile[x, index2].liquid > (byte) 0 && index2 > 50) - { - if (Main.tile[x, index2].active() && Main.tile[x, index2].type != (ushort) 519 || Main.tile[x, index2].liquidType() != (byte) 0) - flag = true; - --index2; - if (Main.tile[x, index2] == null) - return; - } - int index3 = index2 + 1; - if (Main.tile[x, index3] == null) - return; - int num2 = index3; - int catTailDistance = WorldGen.catTailDistance; - if (index1 - num2 > catTailDistance) - flag = true; - int type = (int) Main.tile[x, index1].type; - int num3 = -1; - switch (type) - { - case 2: - case 477: - num3 = 0; - break; - case 23: - case 112: - num3 = 72; - break; - case 53: - num3 = 18; - break; - case 70: - num3 = 90; - break; - case 199: - case 234: - num3 = 54; - break; - } - if (!Main.tile[x, index1].nactive()) - flag = true; - if (num3 < 0) - flag = true; - int index4 = index1 - 1; - if (Main.tile[x, index4] != null && !Main.tile[x, index4].active()) - { - for (int index5 = index4; index5 >= num2; --index5) - { - if (Main.tile[x, index5] == null) - return; - if (Main.tile[x, index5].active() && Main.tile[x, index5].type == (ushort) 519) - { - index4 = index5; - break; - } - } - } - while (Main.tile[x, index4] != null && Main.tile[x, index4].active() && Main.tile[x, index4].type == (ushort) 519) - --index4; - int tileY = index4 + 1; - if (Main.tile[x, index1 - 1] != null && Main.tile[x, index1 - 1].liquid < (byte) 127 && WorldGen.genRand.Next(4) == 0) - flag = true; - if (Main.tile[x, tileY] != null && Main.tile[x, tileY].frameX >= (short) 180 && Main.tile[x, tileY].liquid > (byte) 127 && WorldGen.genRand.Next(4) == 0) - flag = true; - if (Main.tile[x, tileY] != null && Main.tile[x, index1 - 1] != null && Main.tile[x, tileY].frameX > (short) 18) - { - if (Main.tile[x, index1 - 1].frameX < (short) 36 || Main.tile[x, index1 - 1].frameX > (short) 72) - flag = true; - else if (Main.tile[x, tileY].frameX < (short) 90) - flag = true; - else if (Main.tile[x, tileY].frameX >= (short) 108 && Main.tile[x, tileY].frameX <= (short) 162) - Main.tile[x, tileY].frameX = (short) 90; - } - if (index1 > tileY + 4 && Main.tile[x, tileY + 4] != null && Main.tile[x, tileY + 3] != null && Main.tile[x, tileY + 4].liquid == (byte) 0 && Main.tile[x, tileY + 3].type == (ushort) 519) - flag = true; - if (flag) - { - int num4 = num2; - if (tileY < num2) - num4 = tileY; - for (int j1 = num4 - 4; j1 <= index1; ++j1) - { - if (Main.tile[x, j1] != null && Main.tile[x, j1].active() && Main.tile[x, j1].type == (ushort) 519) - { - WorldGen.KillTile(x, j1); - if (Main.netMode == 2) - NetMessage.SendData(17, number2: ((float) x), number3: ((float) j1)); - WorldGen.SquareTileFrame(x, j1); - } - } - } - else - { - if (num3 == (int) Main.tile[x, tileY].frameY) - return; - for (int index6 = tileY; index6 < index1; ++index6) - { - if (Main.tile[x, index6] != null && Main.tile[x, index6].active() && Main.tile[x, index6].type == (ushort) 519) - { - Main.tile[x, index6].frameY = (short) num3; - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, x, tileY, 2); - } - } - } - } - - public static void GrowCheckSeaweed(int x, int y) - { - int maxValue = 1; - if (Main.netMode == 1) - return; - if (Main.tile[x, y].type == (ushort) 549 && Main.tile[x, y].liquid < (byte) 200 || Main.tile[x, y - 1].liquid < (byte) 200) - { - if (!Main.tile[x, y].active() || Main.tile[x, y].type != (ushort) 549 || WorldGen.genRand.Next(2) != 0) - return; - WorldGen.KillTile(x, y); - if (Main.netMode != 2) - return; - NetMessage.SendData(17, number2: ((float) x), number3: ((float) y)); - } - else - { - if (Main.tile[x, y - 1].active() || Main.tile[x, y - 2].active() || WorldGen.genRand.Next(maxValue) != 0 || Main.tile[x, y - 2].liquid != byte.MaxValue || Main.tile[x, y - 3].liquid != byte.MaxValue) - return; - int num1 = 17; - int num2 = 4; - int num3 = 30; - int num4 = 0; - for (int index1 = x - num2; index1 <= x + num2; ++index1) - { - for (int index2 = y; index2 <= y + num2 * 3; ++index2) - { - if (Main.tile[index1, index2].active() && Main.tile[index1, index2].type == (ushort) 549) - { - ++num4; - if (num4 > num3) - return; - } - } - } - int j = y; - while (!WorldGen.SolidTile(x, j) && j < Main.maxTilesY - 50) - ++j; - if (j - y >= num1 - WorldGen.genRand.Next(20)) - return; - WorldGen.PlaceTile(x, y - 1, 549, true); - if (Main.netMode != 2) - return; - NetMessage.SendTileSquare(-1, x, y - 1, 2); - } - } - - public static void GrowCatTail(int x, int j) - { - if (Main.netMode == 1) - return; - int index1 = j; - while (Main.tile[x, index1].liquid > (byte) 0 && index1 > 50) - --index1; - int index2 = index1 + 1; - while ((!Main.tile[x, index2].active() || !Main.tileSolid[(int) Main.tile[x, index2].type] || Main.tileSolidTop[(int) Main.tile[x, index2].type]) && index2 < Main.maxTilesY - 50) - ++index2; - int index3 = index2 - 1; - while (Main.tile[x, index3].active() && Main.tile[x, index3].type == (ushort) 519) - --index3; - int index4 = index3 + 1; - if (Main.tile[x, index4].frameX == (short) 90 && Main.tile[x, index4 - 1].active() && Main.tileCut[(int) Main.tile[x, index4 - 1].type]) - { - WorldGen.KillTile(x, index4 - 1); - if (Main.netMode == 2) - NetMessage.SendData(17, number2: ((float) x), number3: ((float) (index4 - 1))); - } - if (Main.tile[x, index4 - 1].active()) - return; - if (Main.tile[x, index4].frameX == (short) 0) - { - Main.tile[x, index4].frameX = (short) 18; - WorldGen.SquareTileFrame(x, index4); - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, x, index4, 2); - } - else if (Main.tile[x, index4].frameX == (short) 18) - { - Main.tile[x, index4].frameX = (short) (18 * WorldGen.genRand.Next(2, 5)); - Main.tile[x, index4 - 1].active(true); - Main.tile[x, index4 - 1].type = (ushort) 519; - Main.tile[x, index4 - 1].frameX = (short) 90; - Main.tile[x, index4 - 1].frameY = Main.tile[x, index4].frameY; - Main.tile[x, index4 - 1].halfBrick(false); - Main.tile[x, index4 - 1].slope((byte) 0); - WorldGen.SquareTileFrame(x, index4); - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, x, index4, 2); - } - else if (Main.tile[x, index4].frameX == (short) 90) - { - if (Main.tile[x, index4 - 1].liquid == (byte) 0) - { - if (!Main.tile[x, index4 - 2].active() && (Main.tile[x, index4].liquid > (byte) 0 || Main.tile[x, index4 + 1].liquid > (byte) 0 || Main.tile[x, index4 + 2].liquid > (byte) 0) && WorldGen.genRand.Next(3) == 0) - { - Main.tile[x, index4].frameX = (short) 108; - Main.tile[x, index4 - 1].active(true); - Main.tile[x, index4 - 1].type = (ushort) 519; - Main.tile[x, index4 - 1].frameX = (short) 90; - Main.tile[x, index4 - 1].frameY = Main.tile[x, index4].frameY; - Main.tile[x, index4 - 1].halfBrick(false); - Main.tile[x, index4 - 1].slope((byte) 0); - WorldGen.SquareTileFrame(x, index4); - } - else - { - int num = WorldGen.genRand.Next(3); - Main.tile[x, index4].frameX = (short) (126 + num * 18); - Main.tile[x, index4 - 1].active(true); - Main.tile[x, index4 - 1].type = (ushort) 519; - Main.tile[x, index4 - 1].frameX = (short) (180 + num * 18); - Main.tile[x, index4 - 1].frameY = Main.tile[x, index4].frameY; - Main.tile[x, index4 - 1].halfBrick(false); - Main.tile[x, index4 - 1].slope((byte) 0); - WorldGen.SquareTileFrame(x, index4); - } - } - else - { - Main.tile[x, index4].frameX = (short) 108; - Main.tile[x, index4 - 1].active(true); - Main.tile[x, index4 - 1].type = (ushort) 519; - Main.tile[x, index4 - 1].frameX = (short) 90; - Main.tile[x, index4 - 1].frameY = Main.tile[x, index4].frameY; - Main.tile[x, index4 - 1].halfBrick(false); - Main.tile[x, index4 - 1].slope((byte) 0); - WorldGen.SquareTileFrame(x, index4); - } - } - WorldGen.SquareTileFrame(x, index4 - 1, false); - if (Main.netMode != 2) - return; - NetMessage.SendTileSquare(-1, x, index4, 2); - } - - public static bool PlaceLilyPad(int x, int j) - { - int index1 = j; - if (x < 50 || x > Main.maxTilesX - 50 || index1 < 50 || index1 > Main.maxTilesY - 50 || Main.tile[x, index1].active() || Main.tile[x, index1].liquid == (byte) 0 || Main.tile[x, index1].liquidType() != (byte) 0) - return false; - while (Main.tile[x, index1].liquid > (byte) 0 && index1 > 50) - --index1; - int j1 = index1 + 1; - if (Main.tile[x, j1].active() || Main.tile[x, j1 - 1].active() || Main.tile[x, j1].liquid == (byte) 0 || Main.tile[x, j1].liquidType() != (byte) 0 || Main.tile[x, j1].wall != (ushort) 0 && Main.tile[x, j1].wall != (ushort) 15 && Main.tile[x, j1].wall != (ushort) 70 && (Main.tile[x, j1].wall < (ushort) 63 || Main.tile[x, j1].wall > (ushort) 68)) - return false; - int num1 = 5; - int num2 = 0; - for (int index2 = x - num1; index2 <= x + num1; ++index2) - { - for (int index3 = j1 - num1; index3 <= j1 + num1; ++index3) - { - if (Main.tile[index2, index3].active() && Main.tile[index2, index3].type == (ushort) 518) - ++num2; - } - } - if (num2 > 3) - return false; - int index4; - for (index4 = j1; (!Main.tile[x, index4].active() || !Main.tileSolid[(int) Main.tile[x, index4].type] || Main.tileSolidTop[(int) Main.tile[x, index4].type]) && index4 < Main.maxTilesY - 50; ++index4) - { - if (Main.tile[x, index4].active() && Main.tile[x, index4].type == (ushort) 519) - return false; - } - int num3 = 12; - if (index4 - j1 > num3 || index4 - j1 < 3) - return false; - int type = (int) Main.tile[x, index4].type; - int num4 = -1; - if (type == 2 || type == 477) - num4 = 0; - if (type == 109 || type == 109 || type == 116) - num4 = 18; - if (type == 60) - num4 = 36; - if (num4 < 0) - return false; - Main.tile[x, j1].active(true); - Main.tile[x, j1].type = (ushort) 518; - if (WorldGen.genRand.Next(2) == 0) - Main.tile[x, j1].frameX = (short) (18 * WorldGen.genRand.Next(3)); - else if (WorldGen.genRand.Next(15) == 0) - { - Main.tile[x, j1].frameX = (short) (18 * WorldGen.genRand.Next(18)); - } - else - { - int num5 = Main.maxTilesX / 5; - Main.tile[x, j1].frameX = x >= num5 ? (x >= num5 * 2 ? (x >= num5 * 3 ? (x >= num5 * 4 ? (short) (18 * WorldGen.genRand.Next(12, 15)) : (short) (18 * WorldGen.genRand.Next(15, 18))) : (short) (18 * WorldGen.genRand.Next(3, 6))) : (short) (18 * WorldGen.genRand.Next(9, 12))) : (short) (18 * WorldGen.genRand.Next(6, 9)); - } - Main.tile[x, j1].frameY = (short) num4; - Main.tile[x, j1].halfBrick(false); - Main.tile[x, j1].slope((byte) 0); - WorldGen.SquareTileFrame(x, j1); - return true; - } - - public static void CheckLilyPad(int x, int y) - { - if (Main.netMode == 1) - return; - if (Main.tile[x, y].liquidType() != (byte) 0) - { - WorldGen.KillTile(x, y); - if (Main.netMode != 2) - return; - NetMessage.SendData(17, number2: ((float) x), number3: ((float) y)); - } - else - { - int index = y; - while ((!Main.tile[x, index].active() || !Main.tileSolid[(int) Main.tile[x, index].type] || Main.tileSolidTop[(int) Main.tile[x, index].type]) && index < Main.maxTilesY - 50) - { - ++index; - if (Main.tile[x, index] == null) - return; - } - int type = (int) Main.tile[x, index].type; - int num = -1; - if (type == 2 || type == 477) - num = 0; - if (type == 109 || type == 109 || type == 116) - num = 18; - if (type == 60) - num = 36; - if (num >= 0) - { - if (num != (int) Main.tile[x, y].frameY) - { - Main.tile[x, y].frameY = (short) num; - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, x, y, 2); - } - if (Main.tile[x, y - 1].liquid > (byte) 0 && !Main.tile[x, y - 1].active()) - { - Main.tile[x, y - 1].active(true); - Main.tile[x, y - 1].type = (ushort) 518; - Main.tile[x, y - 1].frameX = Main.tile[x, y].frameX; - Main.tile[x, y - 1].frameY = Main.tile[x, y].frameY; - Main.tile[x, y - 1].halfBrick(false); - Main.tile[x, y - 1].slope((byte) 0); - Main.tile[x, y].active(false); - Main.tile[x, y].type = (ushort) 0; - WorldGen.SquareTileFrame(x, y - 1, false); - if (Main.netMode != 2) - return; - NetMessage.SendTileSquare(-1, x, y - 1, 3); - } - else - { - if (Main.tile[x, y].liquid != (byte) 0) - return; - Tile tileSafely = Framing.GetTileSafely(x, y + 1); - if (!tileSafely.active()) - { - Main.tile[x, y + 1].active(true); - Main.tile[x, y + 1].type = (ushort) 518; - Main.tile[x, y + 1].frameX = Main.tile[x, y].frameX; - Main.tile[x, y + 1].frameY = Main.tile[x, y].frameY; - Main.tile[x, y + 1].halfBrick(false); - Main.tile[x, y + 1].slope((byte) 0); - Main.tile[x, y].active(false); - Main.tile[x, y].type = (ushort) 0; - WorldGen.SquareTileFrame(x, y + 1, false); - if (Main.netMode != 2) - return; - NetMessage.SendTileSquare(-1, x, y, 3); - } - else - { - if (!tileSafely.active() || TileID.Sets.Platforms[(int) tileSafely.type] || Main.tileSolid[(int) tileSafely.type] && !Main.tileSolidTop[(int) tileSafely.type]) - return; - WorldGen.KillTile(x, y); - if (Main.netMode != 2) - return; - NetMessage.SendData(17, number2: ((float) x), number3: ((float) y)); - } - } - } - else - { - WorldGen.KillTile(x, y); - if (Main.netMode != 2) - return; - NetMessage.SendData(17, number2: ((float) x), number3: ((float) y)); - } - } - } - public static bool PlaceTile( int i, int j, - int Type, + int type, bool mute = false, bool forced = false, int plr = -1, int style = 0) { - int index1 = Type; - if (WorldGen.gen && Main.tile[i, j].active() && Main.tile[i, j].type == (ushort) 488 || index1 >= 623) + if (type >= 470) return false; bool flag = false; if (i >= 0 && j >= 0 && i < Main.maxTilesX && j < Main.maxTilesY) @@ -35070,37 +25885,11 @@ label_296: trackCache = new Tile(); Main.tile[i, j] = trackCache; } - if (forced || Collision.EmptyTile(i, j) || !Main.tileSolid[index1] || index1 == 23 && trackCache.type == (ushort) 0 && trackCache.active() || index1 == 199 && trackCache.type == (ushort) 0 && trackCache.active() || index1 == 2 && trackCache.type == (ushort) 0 && trackCache.active() || index1 == 109 && trackCache.type == (ushort) 0 && trackCache.active() || index1 == 60 && trackCache.type == (ushort) 59 && trackCache.active() || index1 == 70 && trackCache.type == (ushort) 59 && trackCache.active() || Main.tileMoss[index1] && (trackCache.type == (ushort) 1 || trackCache.type == (ushort) 38) && trackCache.active()) + if (forced || Collision.EmptyTile(i, j) || !Main.tileSolid[type] || type == 23 && trackCache.type == (ushort) 0 && trackCache.active() || type == 199 && trackCache.type == (ushort) 0 && trackCache.active() || type == 2 && trackCache.type == (ushort) 0 && trackCache.active() || type == 109 && trackCache.type == (ushort) 0 && trackCache.active() || type == 60 && trackCache.type == (ushort) 59 && trackCache.active() || type == 70 && trackCache.type == (ushort) 59 && trackCache.active()) { - if (index1 == 23 && (trackCache.type != (ushort) 0 || !trackCache.active()) || index1 == 199 && (trackCache.type != (ushort) 0 || !trackCache.active()) || index1 == 2 && (trackCache.type != (ushort) 0 || !trackCache.active()) || index1 == 109 && (trackCache.type != (ushort) 0 || !trackCache.active()) || index1 == 60 && (trackCache.type != (ushort) 59 || !trackCache.active()) || index1 == 70 && (trackCache.type != (ushort) 59 || !trackCache.active())) + if (type == 23 && (trackCache.type != (ushort) 0 || !trackCache.active()) || type == 2 && (trackCache.type != (ushort) 0 || !trackCache.active()) || type == 109 && (trackCache.type != (ushort) 0 || !trackCache.active()) || type == 60 && (trackCache.type != (ushort) 59 || !trackCache.active())) return false; - if (Main.tileMoss[index1]) - { - if (trackCache.type != (ushort) 1 && trackCache.type != (ushort) 38 || !trackCache.active()) - return false; - if (trackCache.type == (ushort) 38) - { - switch (index1) - { - case 381: - index1 = 517; - break; - case 534: - index1 = 535; - break; - case 536: - index1 = 537; - break; - case 539: - index1 = 540; - break; - default: - index1 = 512 + index1 - 179; - break; - } - } - } - if (index1 == 81) + if (type == 81) { if (Main.tile[i, j - 1] == null) Main.tile[i, j - 1] = new Tile(); @@ -35109,93 +25898,70 @@ label_296: if (Main.tile[i, j - 1].active() || !Main.tile[i, j + 1].active() || !Main.tileSolid[(int) Main.tile[i, j + 1].type] || Main.tile[i, j + 1].halfBrick() || Main.tile[i, j + 1].slope() != (byte) 0) return false; } - if ((index1 == 373 || index1 == 375 || index1 == 374 || index1 == 461) && (Main.tile[i, j - 1] == null || Main.tile[i, j - 1].bottomSlope())) + if ((type == 373 || type == 375 || type == 374 || type == 461) && (Main.tile[i, j - 1] == null || Main.tile[i, j - 1].bottomSlope())) return false; - if (trackCache.liquid > (byte) 0 || trackCache.checkingLiquid()) + if (trackCache.liquid > (byte) 0) { - switch (index1) + if (type == 4) { - case 3: - case 20: - case 24: - case 27: - case 32: - case 51: - case 69: - case 72: - case 201: - case 352: - case 529: + if (style != 8 && style != 11) return false; - case 4: - if (style != 8 && style != 11 && style != 17) - return false; - break; } + else if (type == 3 || type == 20 || type == 24 || type == 27 || type == 32 || type == 51 || type == 69 || type == 72 || type == 201 || type == 352) + return false; } - if (TileID.Sets.ResetsHalfBrickPlacementAttempt[index1] && (!trackCache.active() || !Main.tileFrameImportant[(int) trackCache.type])) + if (type != 2 || Main.tile[i, j].type != (ushort) 0) { trackCache.halfBrick(false); trackCache.frameY = (short) 0; trackCache.frameX = (short) 0; } - if (index1 == 3 || index1 == 24 || index1 == 110 || index1 == 201) + if (type == 3 || type == 24 || type == 110 || type == 201) { - if (WorldGen.IsFitToPlaceFlowerIn(i, j, index1)) + if (j + 1 < Main.maxTilesY && Main.tile[i, j + 1].active() && Main.tile[i, j + 1].slope() == (byte) 0 && !Main.tile[i, j + 1].halfBrick() && (Main.tile[i, j + 1].type == (ushort) 2 && type == 3 || Main.tile[i, j + 1].type == (ushort) 23 && type == 24 || Main.tile[i, j + 1].type == (ushort) 199 && type == 201 || (Main.tile[i, j + 1].type == (ushort) 78 || Main.tile[i, j + 1].type == (ushort) 380) && type == 3 || Main.tile[i, j + 1].type == (ushort) 109 && type == 110)) { - if (index1 == 24 && WorldGen.genRand.Next(13) == 0) + if (type == 24 && WorldGen.genRand.Next(13) == 0) { trackCache.active(true); trackCache.type = (ushort) 32; WorldGen.SquareTileFrame(i, j); } - else if (index1 == 201 && WorldGen.genRand.Next(13) == 0) + else if (type == 201 && WorldGen.genRand.Next(13) == 0) { trackCache.active(true); trackCache.type = (ushort) 352; WorldGen.SquareTileFrame(i, j); } - else if (Main.tile[i, j + 1].type == (ushort) 78 || Main.tile[i, j + 1].type == (ushort) 380 || Main.tile[i, j + 1].type == (ushort) 579) + else if (Main.tile[i, j + 1].type == (ushort) 78 || Main.tile[i, j + 1].type == (ushort) 380) { trackCache.active(true); - trackCache.type = (ushort) index1; - int num = WorldGen.genRand.NextFromList(6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 24, 27, 30, 33, 36, 39, 42); - switch (num) - { - case 21: - case 24: - case 27: - case 30: - case 33: - case 36: - case 39: - case 42: - num += WorldGen.genRand.Next(3); - break; - } - trackCache.frameX = (short) (num * 18); + trackCache.type = (ushort) type; + trackCache.frameX = (short) (WorldGen.genRand.Next(2) * 18 + 108); } - else if ((trackCache.wall == (ushort) 0 || trackCache.wall == (ushort) 106 || trackCache.wall == (ushort) 107 || trackCache.wall >= (ushort) 63 && trackCache.wall <= (ushort) 70) && (Main.tile[i, j + 1].wall == (ushort) 0 || Main.tile[i, j + 1].wall == (ushort) 106 || Main.tile[i, j + 1].wall == (ushort) 107 || Main.tile[i, j + 1].wall >= (ushort) 63 && Main.tile[i, j + 1].wall <= (ushort) 70)) + else if ((trackCache.wall == (byte) 0 || trackCache.wall == (byte) 106 || trackCache.wall == (byte) 107 || trackCache.wall >= (byte) 63 && trackCache.wall <= (byte) 70) && (Main.tile[i, j + 1].wall == (byte) 0 || Main.tile[i, j + 1].wall == (byte) 106 || Main.tile[i, j + 1].wall == (byte) 107 || Main.tile[i, j + 1].wall >= (byte) 63 && Main.tile[i, j + 1].wall <= (byte) 70)) { - if (WorldGen.genRand.Next(50) == 0 || (index1 == 24 || index1 == 201) && WorldGen.genRand.Next(40) == 0) + if (type == 3 && WorldGen.genRand.Next(35) == 0) { trackCache.active(true); - trackCache.type = (ushort) index1; - trackCache.frameX = index1 != 201 ? (short) 144 : (short) 270; + trackCache.type = (ushort) type; + trackCache.frameX = (short) (WorldGen.genRand.Next(2) * 18 + 162); } - else if (WorldGen.genRand.Next(35) == 0 || Main.tile[i, j].wall >= (ushort) 63 && Main.tile[i, j].wall <= (ushort) 70) + else if (WorldGen.genRand.Next(50) == 0 || (type == 24 || type == 201) && WorldGen.genRand.Next(40) == 0) { trackCache.active(true); - trackCache.type = (ushort) index1; - int num = WorldGen.genRand.NextFromList(6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20); - if (index1 == 201) - num = WorldGen.genRand.NextFromList(6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22); - trackCache.frameX = (short) (num * 18); + trackCache.type = (ushort) type; + trackCache.frameX = type != 201 ? (short) 144 : (short) 270; + } + else if (WorldGen.genRand.Next(35) == 0) + { + trackCache.active(true); + trackCache.type = (ushort) type; + trackCache.frameX = (short) (WorldGen.genRand.Next(2) * 18 + 108); } else { trackCache.active(true); - trackCache.type = (ushort) index1; + trackCache.type = (ushort) type; trackCache.frameX = (short) (WorldGen.genRand.Next(6) * 18); } } @@ -35203,7 +25969,7 @@ label_296: } else { - switch (index1) + switch (type) { case 61: if (j + 1 < Main.maxTilesY && Main.tile[i, j + 1].active() && Main.tile[i, j + 1].slope() == (byte) 0 && !Main.tile[i, j + 1].halfBrick() && Main.tile[i, j + 1].type == (ushort) 60) @@ -35218,26 +25984,26 @@ label_296: if (WorldGen.genRand.Next(60) == 0 && (double) j > Main.rockLayer) { trackCache.active(true); - trackCache.type = (ushort) index1; + trackCache.type = (ushort) type; trackCache.frameX = (short) 144; break; } - if (WorldGen.genRand.Next(230) == 0 && (double) j > Main.rockLayer) + if (WorldGen.genRand.Next(300) == 0 && (double) j > Main.rockLayer) { trackCache.active(true); - trackCache.type = (ushort) index1; + trackCache.type = (ushort) type; trackCache.frameX = (short) 162; break; } if (WorldGen.genRand.Next(15) == 0) { trackCache.active(true); - trackCache.type = (ushort) index1; + trackCache.type = (ushort) type; trackCache.frameX = WorldGen.genRand.Next(3) == 0 ? (short) (WorldGen.genRand.Next(13) * 18 + 180) : (short) (WorldGen.genRand.Next(2) * 18 + 108); break; } trackCache.active(true); - trackCache.type = (ushort) index1; + trackCache.type = (ushort) type; trackCache.frameX = (short) (WorldGen.genRand.Next(6) * 18); break; } @@ -35245,23 +26011,8 @@ label_296: case 71: if (j + 1 < Main.maxTilesY && Main.tile[i, j + 1].active() && Main.tile[i, j + 1].slope() == (byte) 0 && !Main.tile[i, j + 1].halfBrick() && Main.tile[i, j + 1].type == (ushort) 70) { - Point point = new Point(-1, -1); - if ((double) j > Main.worldSurface) - point = WorldGen.PlaceCatTail(i, j); - if (WorldGen.InWorld(point.X, point.Y)) - { - if (WorldGen.gen) - { - int num = WorldGen.genRand.Next(14); - for (int index2 = 0; index2 < num; ++index2) - WorldGen.GrowCatTail(point.X, point.Y); - WorldGen.SquareTileFrame(point.X, point.Y); - break; - } - break; - } trackCache.active(true); - trackCache.type = (ushort) index1; + trackCache.type = (ushort) type; trackCache.frameX = (short) (WorldGen.genRand.Next(5) * 18); break; } @@ -35270,10 +26021,8 @@ label_296: if (WorldGen.SolidTile(i - 1, j) || WorldGen.SolidTile(i + 1, j) || WorldGen.SolidTile(i, j - 1) || WorldGen.SolidTile(i, j + 1)) { trackCache.active(true); - trackCache.type = (ushort) index1; + trackCache.type = (ushort) type; trackCache.frameX = (short) (WorldGen.genRand.Next(18) * 18); - if (plr <= -1 && WorldGen.genRand.Next(50) == 0) - trackCache.frameX = (short) ((18 + WorldGen.genRand.Next(6)) * 18); WorldGen.SquareTileFrame(i, j); break; } @@ -35282,10 +26031,10 @@ label_296: WorldGen.PlaceXmasTree(i, j); break; case 178: - if (WorldGen.SolidTile(i - 1, j, true) || WorldGen.SolidTile(i + 1, j, true) || WorldGen.SolidTile(i, j - 1) || WorldGen.SolidTile(i, j + 1)) + if (WorldGen.SolidTile(i - 1, j) || WorldGen.SolidTile(i + 1, j) || WorldGen.SolidTile(i, j - 1) || WorldGen.SolidTile(i, j + 1)) { trackCache.active(true); - trackCache.type = (ushort) index1; + trackCache.type = (ushort) type; trackCache.frameX = (short) (style * 18); trackCache.frameY = (short) (WorldGen.genRand.Next(3) * 18); WorldGen.SquareTileFrame(i, j); @@ -35296,15 +26045,7 @@ label_296: if (Main.tileMoss[(int) Main.tile[i - 1, j].type] && WorldGen.SolidTile(i - 1, j) || Main.tileMoss[(int) Main.tile[i + 1, j].type] && WorldGen.SolidTile(i + 1, j) || Main.tileMoss[(int) Main.tile[i, j - 1].type] && WorldGen.SolidTile(i, j - 1) || Main.tileMoss[(int) Main.tile[i, j + 1].type] && WorldGen.SolidTile(i, j + 1)) { trackCache.active(true); - trackCache.type = (ushort) index1; - trackCache.frameX = (short) (style * 18); - trackCache.frameY = (short) (WorldGen.genRand.Next(3) * 18); - WorldGen.SquareTileFrame(i, j); - } - if (TileID.Sets.tileMossBrick[(int) Main.tile[i - 1, j].type] && WorldGen.SolidTile(i - 1, j) || TileID.Sets.tileMossBrick[(int) Main.tile[i + 1, j].type] && WorldGen.SolidTile(i + 1, j) || TileID.Sets.tileMossBrick[(int) Main.tile[i, j - 1].type] && WorldGen.SolidTile(i, j - 1) || TileID.Sets.tileMossBrick[(int) Main.tile[i, j + 1].type] && WorldGen.SolidTile(i, j + 1)) - { - trackCache.active(true); - trackCache.type = (ushort) index1; + trackCache.type = (ushort) type; trackCache.frameX = (short) (style * 18); trackCache.frameY = (short) (WorldGen.genRand.Next(3) * 18); WorldGen.SquareTileFrame(i, j); @@ -35312,38 +26053,18 @@ label_296: } break; case 254: - WorldGen.Place2x2Style(i, j, (ushort) index1, style); + WorldGen.Place2x2Style(i, j, (ushort) type, style); break; - case 485: - WorldGen.PlaceObject(i, j, index1, style: style); - break; - case 518: - WorldGen.PlaceLilyPad(i, j); - break; - case 519: - WorldGen.PlaceCatTail(i, j); - break; - case 529: - WorldGen.PlantSeaOat(i, j); - break; - case 549: - WorldGen.PlaceUnderwaterPlant((ushort) 549, i, j); - break; - case 571: - WorldGen.PlaceBamboo(i, j); + case 335: + WorldGen.Place2x2(i, j, (ushort) type, 0); break; default: - if (index1 == 335 || index1 == 564 || index1 == 594) + if (type == 319 || type == 132 || type == 138 || type == 142 || type == 143 || type == 282 || type >= 288 && type <= 295 || type >= 316 && type <= 318) { - WorldGen.Place2x2(i, j, (ushort) index1, 0); + WorldGen.Place2x2(i, j, (ushort) type, 0); break; } - if (index1 == 319 || index1 == 132 || index1 == 484 || index1 == 138 || index1 == 142 || index1 == 143 || index1 == 282 || index1 >= 288 && index1 <= 295 || index1 >= 316 && index1 <= 318) - { - WorldGen.Place2x2(i, j, (ushort) index1, 0); - break; - } - switch (index1) + switch (type) { case 4: if (Main.tile[i - 1, j] == null) @@ -35355,10 +26076,10 @@ label_296: Tile tile1 = Main.tile[i - 1, j]; Tile tile2 = Main.tile[i + 1, j]; Tile tile3 = Main.tile[i, j + 1]; - if (trackCache.wall > (ushort) 0 || tile1.active() && (tile1.slope() == (byte) 0 || (int) tile1.slope() % 2 != 1) && (Main.tileSolid[(int) tile1.type] && !Main.tileSolidTop[(int) tile1.type] && !TileID.Sets.NotReallySolid[(int) tile1.type] || TileID.Sets.IsBeam[(int) tile1.type] || WorldGen.IsTreeType((int) tile1.type) && WorldGen.IsTreeType((int) Main.tile[i - 1, j - 1].type) && WorldGen.IsTreeType((int) Main.tile[i - 1, j + 1].type)) || tile2.active() && (tile2.slope() == (byte) 0 || (int) tile2.slope() % 2 != 0) && (Main.tileSolid[(int) tile2.type] && !Main.tileSolidTop[(int) tile2.type] && !TileID.Sets.NotReallySolid[(int) tile2.type] || TileID.Sets.IsBeam[(int) tile2.type] || WorldGen.IsTreeType((int) tile2.type) && WorldGen.IsTreeType((int) Main.tile[i + 1, j - 1].type) && WorldGen.IsTreeType((int) Main.tile[i + 1, j + 1].type)) || tile3.active() && Main.tileSolid[(int) tile3.type] && (TileID.Sets.Platforms[(int) tile3.type] && WorldGen.TopEdgeCanBeAttachedTo(i, j + 1) || (!Main.tileSolidTop[(int) tile3.type] || tile3.type == (ushort) 380 && tile3.slope() == (byte) 0) && !TileID.Sets.NotReallySolid[(int) tile3.type] && !tile3.halfBrick() && tile3.slope() == (byte) 0)) + if (trackCache.wall > (byte) 0 || tile1.active() && (tile1.slope() == (byte) 0 || (int) tile1.slope() % 2 != 1) && (Main.tileSolid[(int) tile1.type] && !Main.tileSolidTop[(int) tile1.type] && !TileID.Sets.NotReallySolid[(int) tile1.type] || tile1.type == (ushort) 124 || tile1.type == (ushort) 5 && Main.tile[i - 1, j - 1].type == (ushort) 5 && Main.tile[i - 1, j + 1].type == (ushort) 5) || tile2.active() && (tile2.slope() == (byte) 0 || (int) tile2.slope() % 2 != 0) && (Main.tileSolid[(int) tile2.type] && !Main.tileSolidTop[(int) tile2.type] && !TileID.Sets.NotReallySolid[(int) tile2.type] || tile2.type == (ushort) 124 || tile2.type == (ushort) 5 && Main.tile[i + 1, j - 1].type == (ushort) 5 && Main.tile[i + 1, j + 1].type == (ushort) 5) || tile3.active() && Main.tileSolid[(int) tile3.type] && (!Main.tileSolidTop[(int) tile3.type] || TileID.Sets.Platforms[(int) tile3.type] && tile3.slope() == (byte) 0) && !TileID.Sets.NotReallySolid[(int) tile3.type] && !tile3.halfBrick() && tile3.slope() == (byte) 0) { trackCache.active(true); - trackCache.type = (ushort) index1; + trackCache.type = (ushort) type; trackCache.frameY = (short) (22 * style); WorldGen.SquareTileFrame(i, j); break; @@ -35379,13 +26100,13 @@ label_296: Main.tile[i, j + 3] = new Tile(); if (!Main.tile[i, j - 1].active() && !Main.tile[i, j - 2].active() && Main.tile[i, j - 3].active() && Main.tileSolid[(int) Main.tile[i, j - 3].type]) { - WorldGen.PlaceDoor(i, j - 1, index1, style); + WorldGen.PlaceDoor(i, j - 1, type, style); WorldGen.SquareTileFrame(i, j); break; } if (Main.tile[i, j + 1].active() || Main.tile[i, j + 2].active() || !Main.tile[i, j + 3].active() || !Main.tileSolid[(int) Main.tile[i, j + 3].type]) return false; - WorldGen.PlaceDoor(i, j + 1, index1, style); + WorldGen.PlaceDoor(i, j + 1, type, style); WorldGen.SquareTileFrame(i, j); break; case 136: @@ -35395,21 +26116,21 @@ label_296: Main.tile[i + 1, j] = new Tile(); if (Main.tile[i, j + 1] == null) Main.tile[i, j + 1] = new Tile(); - if (Main.tile[i - 1, j].nactive() && !Main.tile[i - 1, j].halfBrick() && !TileID.Sets.NotReallySolid[(int) Main.tile[i - 1, j].type] && Main.tile[i - 1, j].slope() == (byte) 0 && (WorldGen.SolidTile(i - 1, j) || TileID.Sets.IsBeam[(int) Main.tile[i - 1, j].type] || Main.tile[i - 1, j].type == (ushort) 5 && Main.tile[i - 1, j - 1].type == (ushort) 5 && Main.tile[i - 1, j + 1].type == (ushort) 5) || Main.tile[i + 1, j].nactive() && !Main.tile[i + 1, j].halfBrick() && !TileID.Sets.NotReallySolid[(int) Main.tile[i + 1, j].type] && Main.tile[i + 1, j].slope() == (byte) 0 && (WorldGen.SolidTile(i + 1, j) || TileID.Sets.IsBeam[(int) Main.tile[i + 1, j].type] || Main.tile[i + 1, j].type == (ushort) 5 && Main.tile[i + 1, j - 1].type == (ushort) 5 && Main.tile[i + 1, j + 1].type == (ushort) 5) || Main.tile[i, j + 1].nactive() && !Main.tile[i, j + 1].halfBrick() && WorldGen.SolidTile(i, j + 1) && Main.tile[i, j + 1].slope() == (byte) 0 || trackCache.wall > (ushort) 0) + if (Main.tile[i - 1, j].nactive() && !Main.tile[i - 1, j].halfBrick() && !TileID.Sets.NotReallySolid[(int) Main.tile[i - 1, j].type] && Main.tile[i - 1, j].slope() == (byte) 0 && (WorldGen.SolidTile(i - 1, j) || Main.tile[i - 1, j].type == (ushort) 124 || Main.tile[i - 1, j].type == (ushort) 5 && Main.tile[i - 1, j - 1].type == (ushort) 5 && Main.tile[i - 1, j + 1].type == (ushort) 5) || Main.tile[i + 1, j].nactive() && !Main.tile[i + 1, j].halfBrick() && !TileID.Sets.NotReallySolid[(int) Main.tile[i + 1, j].type] && Main.tile[i + 1, j].slope() == (byte) 0 && (WorldGen.SolidTile(i + 1, j) || Main.tile[i + 1, j].type == (ushort) 124 || Main.tile[i + 1, j].type == (ushort) 5 && Main.tile[i + 1, j - 1].type == (ushort) 5 && Main.tile[i + 1, j + 1].type == (ushort) 5) || Main.tile[i, j + 1].nactive() && !Main.tile[i, j + 1].halfBrick() && WorldGen.SolidTile(i, j + 1) && Main.tile[i, j + 1].slope() == (byte) 0 || trackCache.wall > (byte) 0) { trackCache.active(true); - trackCache.type = (ushort) index1; + trackCache.type = (ushort) type; WorldGen.SquareTileFrame(i, j); break; } break; case 137: trackCache.active(true); - trackCache.type = (ushort) index1; + trackCache.type = (ushort) type; trackCache.frameY = (short) (18 * style); break; case 411: - WorldGen.Place2x2(i, j, (ushort) index1, 0); + WorldGen.Place2x2(i, j, (ushort) type, 0); break; case 442: if (Main.tile[i - 1, j] == null) @@ -35418,10 +26139,10 @@ label_296: Main.tile[i + 1, j] = new Tile(); if (Main.tile[i, j + 1] == null) Main.tile[i, j + 1] = new Tile(); - if (Main.tile[i - 1, j].nactive() && !Main.tile[i - 1, j].halfBrick() && !TileID.Sets.NotReallySolid[(int) Main.tile[i - 1, j].type] && Main.tile[i - 1, j].slope() == (byte) 0 && (WorldGen.SolidTile(i - 1, j) || TileID.Sets.IsBeam[(int) Main.tile[i - 1, j].type] || Main.tile[i - 1, j].type == (ushort) 5 && Main.tile[i - 1, j - 1].type == (ushort) 5 && Main.tile[i - 1, j + 1].type == (ushort) 5) || Main.tile[i + 1, j].nactive() && !Main.tile[i + 1, j].halfBrick() && !TileID.Sets.NotReallySolid[(int) Main.tile[i + 1, j].type] && Main.tile[i + 1, j].slope() == (byte) 0 && (WorldGen.SolidTile(i + 1, j) || TileID.Sets.IsBeam[(int) Main.tile[i + 1, j].type] || Main.tile[i + 1, j].type == (ushort) 5 && Main.tile[i + 1, j - 1].type == (ushort) 5 && Main.tile[i + 1, j + 1].type == (ushort) 5) || Main.tile[i, j + 1].nactive() && !Main.tile[i, j + 1].halfBrick() && WorldGen.SolidTile(i, j + 1) && Main.tile[i, j + 1].slope() == (byte) 0) + if (Main.tile[i - 1, j].nactive() && !Main.tile[i - 1, j].halfBrick() && !TileID.Sets.NotReallySolid[(int) Main.tile[i - 1, j].type] && Main.tile[i - 1, j].slope() == (byte) 0 && (WorldGen.SolidTile(i - 1, j) || Main.tile[i - 1, j].type == (ushort) 124 || Main.tile[i - 1, j].type == (ushort) 5 && Main.tile[i - 1, j - 1].type == (ushort) 5 && Main.tile[i - 1, j + 1].type == (ushort) 5) || Main.tile[i + 1, j].nactive() && !Main.tile[i + 1, j].halfBrick() && !TileID.Sets.NotReallySolid[(int) Main.tile[i + 1, j].type] && Main.tile[i + 1, j].slope() == (byte) 0 && (WorldGen.SolidTile(i + 1, j) || Main.tile[i + 1, j].type == (ushort) 124 || Main.tile[i + 1, j].type == (ushort) 5 && Main.tile[i + 1, j - 1].type == (ushort) 5 && Main.tile[i + 1, j + 1].type == (ushort) 5) || Main.tile[i, j + 1].nactive() && !Main.tile[i, j + 1].halfBrick() && WorldGen.SolidTile(i, j + 1) && Main.tile[i, j + 1].slope() == (byte) 0) { trackCache.active(true); - trackCache.type = (ushort) index1; + trackCache.type = (ushort) type; WorldGen.SquareTileFrame(i, j); break; } @@ -35430,17 +26151,17 @@ label_296: WorldGen.Place2x2Horizontal(i, j, (ushort) 457, style); break; default: - if (index1 >= 275 && index1 <= 281 || index1 == 296 || index1 == 297 || index1 == 309 || index1 == 358 || index1 == 359 || index1 == 413 || index1 == 414 || index1 == 542) + if (type >= 275 && type <= 281 || type == 296 || type == 297 || type == 309 || type == 358 || type == 359 || type == 413 || type == 414) { - WorldGen.Place6x3(i, j, (ushort) index1); + WorldGen.Place6x3(i, j, (ushort) type); break; } - if (index1 == 237 || index1 == 244 || index1 == 285 || index1 == 286 || index1 == 298 || index1 == 299 || index1 == 310 || index1 == 339 || index1 == 538 || index1 >= 361 && index1 <= 364 || index1 == 532 || index1 == 533 || index1 == 486 || index1 == 488 || index1 == 544 || index1 == 582 || index1 == 619) + if (type == 237 || type == 244 || type == 285 || type == 286 || type == 298 || type == 299 || type == 310 || type == 339 || type >= 361 && type <= 364) { - WorldGen.Place3x2(i, j, (ushort) index1); + WorldGen.Place3x2(i, j, (ushort) type); break; } - switch (index1) + switch (type) { case 128: WorldGen.PlaceMan(i, j, style); @@ -35451,7 +26172,7 @@ label_296: { trackCache.frameX = (short) (18 * style); trackCache.active(true); - trackCache.type = (ushort) index1; + trackCache.type = (ushort) type; WorldGen.SquareTileFrame(i, j); break; } @@ -35468,155 +26189,147 @@ label_296: WorldGen.SquareTileFrame(i, j); break; default: - if (index1 == 139 || index1 == 35) + if (type == 139 || type == 35) { - WorldGen.PlaceMB(i, j, (ushort) index1, style); + WorldGen.PlaceMB(i, j, (ushort) type, style); WorldGen.SquareTileFrame(i, j); break; } - switch (index1) + switch (type) { case 34: - WorldGen.PlaceChand(i, j, (ushort) index1, style); + WorldGen.PlaceChand(i, j, (ushort) type, style); WorldGen.SquareTileFrame(i, j); break; case 165: - WorldGen.PlaceTight(i, j); + WorldGen.PlaceTight(i, j, (ushort) type); WorldGen.SquareTileFrame(i, j); break; case 235: - WorldGen.Place3x1(i, j, (ushort) index1); + WorldGen.Place3x1(i, j, (ushort) type); WorldGen.SquareTileFrame(i, j); break; case 240: - WorldGen.Place3x3Wall(i, j, (ushort) index1, style); + WorldGen.Place3x3Wall(i, j, (ushort) type, style); break; case 241: - WorldGen.Place4x3Wall(i, j, (ushort) index1, style); + WorldGen.Place4x3Wall(i, j, (ushort) type, style); break; case 242: - WorldGen.Place6x4Wall(i, j, (ushort) index1, style); + WorldGen.Place6x4Wall(i, j, (ushort) type, style); break; case 245: - WorldGen.Place2x3Wall(i, j, (ushort) index1, style); + WorldGen.Place2x3Wall(i, j, (ushort) type, style); break; case 246: - WorldGen.Place3x2Wall(i, j, (ushort) index1, style); + WorldGen.Place3x2Wall(i, j, (ushort) type, style); break; case 440: - WorldGen.Place3x3Wall(i, j, (ushort) index1, style); + WorldGen.Place3x3Wall(i, j, (ushort) type, style); break; default: - if (index1 == 106 || index1 == 212 || index1 == 219 || index1 == 220 || index1 == 228 || index1 == 231 || index1 == 243 || index1 == 247 || index1 == 283 || index1 >= 300 && index1 <= 308 || index1 == 354 || index1 == 355 || index1 == 491) + if (type == 106 || type == 212 || type == 219 || type == 220 || type == 228 || type == 231 || type == 243 || type == 247 || type == 283 || type >= 300 && type <= 308 || type == 354 || type == 355) { - WorldGen.Place3x3(i, j, (ushort) index1, style); + WorldGen.Place3x3(i, j, (ushort) type, style); WorldGen.SquareTileFrame(i, j); break; } - if (index1 == 13 || index1 == 33 || index1 == 49 || index1 == 50 || index1 == 78 || index1 == 174 || index1 == 372) + if (type == 13 || type == 33 || type == 49 || type == 50 || type == 78 || type == 174 || type == 372) { - WorldGen.PlaceOnTable1x1(i, j, index1, style); + WorldGen.PlaceOnTable1x1(i, j, type, style); WorldGen.SquareTileFrame(i, j); break; } - if (index1 == 14 || index1 == 469 || index1 == 26 || index1 == 86 || index1 == 87 || index1 == 88 || index1 == 89 || index1 == 114 || index1 == 186 || index1 == 187 || index1 == 215 || index1 == 217 || index1 == 218 || index1 == 377) + if (type == 14 || type == 26 || type == 86 || type == 87 || type == 88 || type == 89 || type == 114 || type == 186 || type == 187 || type == 215 || type == 217 || type == 218 || type == 377) { - WorldGen.Place3x2(i, j, (ushort) index1, style); + WorldGen.Place3x2(i, j, (ushort) type, style); WorldGen.SquareTileFrame(i, j); break; } - switch (index1) + switch (type) { case 20: if (Main.tile[i, j + 1] == null) Main.tile[i, j + 1] = new Tile(); - int type = (int) Main.tile[i, j + 1].type; - if (Main.tile[i, j + 1].active() && (type == 2 || type == 109 || type == 147 || type == 60 || type == 23 || type == 199 || type == 53 || type == 234 || type == 116 || type == 112)) + int type1 = (int) Main.tile[i, j + 1].type; + if (Main.tile[i, j + 1].active() && (type1 == 2 || type1 == 109 || type1 == 147 || type1 == 60 || type1 == 23 || type1 == 199 || type1 == 53 || type1 == 234 || type1 == 116 || type1 == 112)) { - WorldGen.Place1x2(i, j, (ushort) index1, style); + WorldGen.Place1x2(i, j, (ushort) type, style); WorldGen.SquareTileFrame(i, j); break; } break; case 236: - WorldGen.PlaceJunglePlant(i, j, (ushort) index1, WorldGen.genRand.Next(3), 0); + WorldGen.PlaceJunglePlant(i, j, (ushort) type, WorldGen.genRand.Next(3), 0); WorldGen.SquareTileFrame(i, j); break; case 238: - WorldGen.PlaceJunglePlant(i, j, (ushort) index1, 0, 0); + WorldGen.PlaceJunglePlant(i, j, (ushort) type, 0, 0); WorldGen.SquareTileFrame(i, j); break; default: - if (index1 == 15 || index1 == 216 || index1 == 338 || index1 == 390) + if (type == 15 || type == 216 || type == 338 || type == 390) { if (Main.tile[i, j - 1] == null) Main.tile[i, j - 1] = new Tile(); if (Main.tile[i, j] == null) Main.tile[i, j] = new Tile(); - WorldGen.Place1x2(i, j, (ushort) index1, style); + WorldGen.Place1x2(i, j, (ushort) type, style); WorldGen.SquareTileFrame(i, j); break; } - switch (index1) + if (type == 227) { - case 227: - WorldGen.PlaceDye(i, j, style); + WorldGen.PlaceDye(i, j, style); + WorldGen.SquareTileFrame(i, j); + break; + } + if (type == 16 || type == 18 || type == 29 || type == 103 || type == 134 || type == 462) + { + WorldGen.Place2x1(i, j, (ushort) type, style); + WorldGen.SquareTileFrame(i, j); + break; + } + if (type == 92 || type == 93 || type == 453) + { + WorldGen.Place1xX(i, j, (ushort) type, style); + WorldGen.SquareTileFrame(i, j); + break; + } + if (type == 104 || type == 105 || type == 320 || type == 337 || type == 349 || type == 356 || type == 378 || type == 456) + { + WorldGen.Place2xX(i, j, (ushort) type, style); + WorldGen.SquareTileFrame(i, j); + break; + } + if (type == 17 || type == 77 || type == 133) + { + WorldGen.Place3x2(i, j, (ushort) type, style); + WorldGen.SquareTileFrame(i, j); + break; + } + switch (type) + { + case 207: + WorldGen.Place2xX(i, j, (ushort) type, style); WorldGen.SquareTileFrame(i, j); break; - case 567: - WorldGen.PlaceGnome(i, j, style); + case 410: + WorldGen.Place2xX(i, j, (ushort) type, style); + WorldGen.SquareTileFrame(i, j); + break; + case 465: + WorldGen.Place2xX(i, j, (ushort) type, style); WorldGen.SquareTileFrame(i, j); break; default: - if (index1 == 16 || index1 == 18 || index1 == 29 || index1 == 103 || index1 == 134 || index1 == 462) + if (TileID.Sets.BasicChest[type]) { - WorldGen.Place2x1(i, j, (ushort) index1, style); + WorldGen.PlaceChest(i, j, (ushort) type, style: style); WorldGen.SquareTileFrame(i, j); break; } - if (index1 == 92 || index1 == 93 || index1 == 453) - { - WorldGen.Place1xX(i, j, (ushort) index1, style); - WorldGen.SquareTileFrame(i, j); - break; - } - if (index1 == 104 || index1 == 105 || index1 == 320 || index1 == 337 || index1 == 349 || index1 == 356 || index1 == 378 || index1 == 456 || index1 == 506 || index1 == 545) - { - WorldGen.Place2xX(i, j, (ushort) index1, style); - WorldGen.SquareTileFrame(i, j); - break; - } - if (index1 == 17 || index1 == 77 || index1 == 133) - { - WorldGen.Place3x2(i, j, (ushort) index1, style); - WorldGen.SquareTileFrame(i, j); - break; - } - if (index1 == 207) - { - WorldGen.Place2xX(i, j, (ushort) index1, style); - WorldGen.SquareTileFrame(i, j); - break; - } - if (index1 == 410 || index1 == 480 || index1 == 509) - { - WorldGen.Place2xX(i, j, (ushort) index1, style); - WorldGen.SquareTileFrame(i, j); - break; - } - if (index1 == 465 || index1 == 531 || index1 == 591 || index1 == 592) - { - WorldGen.Place2xX(i, j, (ushort) index1, style); - WorldGen.SquareTileFrame(i, j); - break; - } - if (TileID.Sets.BasicChest[index1]) - { - WorldGen.PlaceChest(i, j, (ushort) index1, style: style); - WorldGen.SquareTileFrame(i, j); - break; - } - switch (index1) + switch (type) { case 27: WorldGen.PlaceSunflower(i, j); @@ -35633,35 +26346,31 @@ label_296: case 210: case 239: case 324: - case 476: - case 494: - WorldGen.Place1x1(i, j, index1, style); + WorldGen.Place1x1(i, j, type, style); WorldGen.SquareTileFrame(i, j); break; case 42: case 270: case 271: - WorldGen.Place1x2Top(i, j, (ushort) index1, style); + WorldGen.Place1x2Top(i, j, (ushort) type, style); WorldGen.SquareTileFrame(i, j); break; case 55: case 425: - case 510: - case 511: - WorldGen.PlaceSign(i, j, (ushort) index1, style); + WorldGen.PlaceSign(i, j, (ushort) type, style); break; case 85: case 376: - WorldGen.Place2x2Horizontal(i, j, (ushort) index1, style); + WorldGen.Place2x2Horizontal(i, j, (ushort) type, style); break; case 91: - WorldGen.PlaceBanner(i, j, (ushort) index1, style); + WorldGen.PlaceBanner(i, j, (ushort) type, style); WorldGen.SquareTileFrame(i, j); break; case 101: case 102: case 463: - WorldGen.Place3x4(i, j, (ushort) index1, style); + WorldGen.Place3x4(i, j, (ushort) type, style); WorldGen.SquareTileFrame(i, j); break; case 419: @@ -35670,38 +26379,38 @@ label_296: case 424: case 429: case 445: - WorldGen.PlaceLogicTiles(i, j, index1, style); + WorldGen.PlaceLogicTiles(i, j, type, style); WorldGen.SquareTileFrame(i, j); break; case 464: case 466: - WorldGen.Place5x4(i, j, (ushort) index1, style); + WorldGen.Place5x4(i, j, (ushort) type, style); WorldGen.SquareTileFrame(i, j); break; default: - if (Main.tileAlch[index1]) + if (Main.tileAlch[type]) { WorldGen.PlaceAlch(i, j, style); break; } - switch (index1) + switch (type) { case 19: trackCache.frameY = (short) (18 * style); trackCache.active(true); - trackCache.type = (ushort) index1; + trackCache.type = (ushort) type; break; case 79: case 90: int direction = 1; if (plr > -1) direction = Main.player[plr].direction; - WorldGen.Place4x2(i, j, (ushort) index1, direction, style); + WorldGen.Place4x2(i, j, (ushort) type, direction, style); break; case 81: trackCache.frameX = (short) (26 * WorldGen.genRand.Next(6)); trackCache.active(true); - trackCache.type = (ushort) index1; + trackCache.type = (ushort) type; break; case 94: case 95: @@ -35714,13 +26423,13 @@ label_296: case 172: case 173: case 287: - WorldGen.Place2x2(i, j, (ushort) index1, style); + WorldGen.Place2x2(i, j, (ushort) type, style); break; case 96: - WorldGen.Place2x2Style(i, j, (ushort) index1, style); + WorldGen.Place2x2Style(i, j, (ushort) type, style); break; case 209: - WorldGen.PlaceCannon(i, j, (ushort) index1, style); + WorldGen.PlaceCannon(i, j, (ushort) type, style); break; case 314: Minecart.PlaceTrack(trackCache, style); @@ -35728,11 +26437,11 @@ label_296: case 380: trackCache.frameY = (short) (18 * style); trackCache.active(true); - trackCache.type = (ushort) index1; + trackCache.type = (ushort) type; break; default: trackCache.active(true); - trackCache.type = (ushort) index1; + trackCache.type = (ushort) type; break; } break; @@ -35752,33 +26461,33 @@ label_296: } if (trackCache.active()) { - if (TileID.Sets.BlocksWaterDrawingBehindSelf[(int) trackCache.type]) + if (trackCache.type == (ushort) 54) WorldGen.SquareWallFrame(i, j); WorldGen.SquareTileFrame(i, j); flag = true; if (!mute) { - switch (index1) + switch (type) { case (int) sbyte.MaxValue: - SoundEngine.PlaySound(SoundID.Item30, i * 16, j * 16); + Main.PlaySound(SoundID.Item30, i * 16, j * 16); break; case 314: - SoundEngine.PlaySound(SoundID.Item52, i * 16, j * 16); + Main.PlaySound(SoundID.Item52, i * 16, j * 16); break; case 330: case 331: case 332: case 333: - SoundEngine.PlaySound(18, i * 16, j * 16); + Main.PlaySound(18, i * 16, j * 16); break; default: - SoundEngine.PlaySound(0, i * 16, j * 16); + Main.PlaySound(0, i * 16, j * 16); break; } - if (index1 == 22 || index1 == 140) + if (type == 22 || type == 140) { - for (int index3 = 0; index3 < 3; ++index3) + for (int index = 0; index < 3; ++index) Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, 14); } } @@ -35792,1003 +26501,579 @@ label_296: { if (i < 0 || j < 0 || i >= Main.maxTilesX || j >= Main.maxTilesY) return; - Tile tileCache = Main.tile[i, j]; - if (tileCache == null) + Tile tile = Main.tile[i, j]; + if (tile == null) { - tileCache = new Tile(); - Main.tile[i, j] = tileCache; + tile = new Tile(); + Main.tile[i, j] = tile; } - if (tileCache.wall <= (ushort) 0) + if (tile.wall <= (byte) 0) return; - fail = WorldGen.KillWall_CheckFailure(fail, tileCache); - WorldGen.KillWall_PlaySounds(i, j, tileCache); + if (Main.wallDungeon[(int) tile.wall] && !NPC.downedBoss3) + fail = true; + if (tile.wall == (byte) 87 && !NPC.downedGolemBoss) + fail = true; + if (tile.wall == (byte) 21 || tile.wall == (byte) 186 || tile.wall == (byte) 136 || tile.wall == (byte) 137 || tile.wall == (byte) 168 || tile.wall == (byte) 169 || tile.wall == (byte) 172 || tile.wall == (byte) 226 || tile.wall == (byte) 227) + Main.PlaySound(13, i * 16, j * 16); + else if (tile.wall >= (byte) 63 && tile.wall <= (byte) 70) + Main.PlaySound(6, i * 16, j * 16); + else + Main.PlaySound(0, i * 16, j * 16); int num = 10; if (fail) num = 3; - for (int index = 0; index < num; ++index) - WorldGen.KillWall_MakeWallDust(i, j, tileCache); + for (int index1 = 0; index1 < num; ++index1) + { + int Type = 0; + if (tile.wall == (byte) 148) + Type = -1; + if (tile.wall == (byte) 1 || tile.wall == (byte) 5 || tile.wall == (byte) 6 || tile.wall == (byte) 7 || tile.wall == (byte) 107 || tile.wall == (byte) 8 || tile.wall == (byte) 9 || tile.wall >= (byte) 48 && tile.wall <= (byte) 53 || tile.wall >= (byte) 54 && tile.wall <= (byte) 58 || tile.wall == (byte) 185) + Type = 1; + if (tile.wall >= (byte) 94 && tile.wall <= (byte) 105) + Type = 1; + if (tile.wall == (byte) 3) + Type = WorldGen.genRand.Next(2) != 0 ? 1 : 14; + if (tile.wall == (byte) 35) + Type = 37; + if (tile.wall == (byte) 4 || tile.wall == (byte) 106) + Type = 7; + if (tile.wall == (byte) 12) + Type = 9; + if (tile.wall == (byte) 10) + Type = 10; + if (tile.wall == (byte) 11) + Type = 11; + if (tile.wall == (byte) 21) + Type = 13; + if (tile.wall == (byte) 34) + Type = 32; + if (tile.wall == (byte) 225) + Type = 1; + if (tile.wall == (byte) 145) + Type = 8; + if (tile.wall == (byte) 22 || tile.wall == (byte) 28) + Type = 51; + if (tile.wall == (byte) 23) + Type = 38; + if (tile.wall == (byte) 24) + Type = 36; + if (tile.wall == (byte) 25) + Type = 48; + if (tile.wall == (byte) 179 || tile.wall == (byte) 178 || tile.wall == (byte) 183) + Type = 236; + if (tile.wall == (byte) 181 || tile.wall == (byte) 180 || tile.wall == (byte) 184) + Type = 240; + if (tile.wall == (byte) 113) + Type = 189; + if (tile.wall == (byte) 114) + Type = 190; + if (tile.wall == (byte) 115) + Type = 191; + if (tile.wall == (byte) 177 || tile.wall == (byte) 13) + Type = 25; + if (tile.wall == (byte) 186) + Type = WorldGen.genRand.Next(68, 71); + if (tile.wall == (byte) 142) + Type = 210; + if (tile.wall == (byte) 143) + Type = 210; + if (tile.wall == (byte) 224) + Type = 265; + if (tile.wall == (byte) 173) + Type = 128; + if (tile.wall == (byte) 174) + Type = 117; + if (tile.wall == (byte) 175) + Type = 42; + if (tile.wall == (byte) 176) + Type = 226; + if (tile.wall == (byte) 182) + Type = WorldGen.genRand.Next(2) != 0 ? 23 : 6; + if (tile.wall >= (byte) 153 && tile.wall <= (byte) 166) + { + switch (tile.wall) + { + case 153: + case 157: + Type = 138; + break; + case 154: + case 158: + Type = 86; + break; + case 155: + case 159: + Type = 91; + break; + case 156: + case 160: + Type = 89; + break; + case 161: + case 164: + Type = 90; + break; + case 162: + case 165: + Type = 88; + break; + case 163: + case 166: + Type = 87; + break; + } + } + if (tile.wall == (byte) 26 || tile.wall == (byte) 30) + Type = 49; + if (tile.wall == (byte) 29 || tile.wall == (byte) 32) + Type = 50; + if (tile.wall == (byte) 31) + Type = 51; + if (tile.wall == (byte) 14 || tile.wall == (byte) 20) + Type = 109; + if (tile.wall >= (byte) 88 && tile.wall <= (byte) 93) + { + Type = 86 + (int) tile.wall - 88; + if (tile.wall == (byte) 93) + Type = WorldGen.genRand.Next(88, 94); + } + if (tile.wall == (byte) 33) + Type = 14; + if (tile.wall == (byte) 41) + Type = 77; + if (tile.wall == (byte) 42) + Type = 78; + if (tile.wall == (byte) 43) + Type = 78; + if (tile.wall == (byte) 43) + Type = 78; + if (tile.wall == (byte) 36) + Type = 26; + if (tile.wall == (byte) 37) + Type = 32; + if (tile.wall == (byte) 38) + Type = 2; + if (tile.wall == (byte) 39) + Type = 1; + if (tile.wall == (byte) 40) + Type = 51; + if (tile.wall == (byte) 45) + Type = 81; + if (tile.wall == (byte) 46) + Type = 83; + if (tile.wall == (byte) 47) + Type = 84; + if (tile.wall == (byte) 85) + Type = 126; + if (tile.wall == (byte) 59) + Type = 0; + if (tile.wall == (byte) 61) + Type = 0; + if (tile.wall == (byte) 62) + Type = 0; + if (tile.wall == (byte) 63) + Type = 3; + if (tile.wall == (byte) 65) + Type = 3; + if (tile.wall == (byte) 66) + Type = 3; + if (tile.wall == (byte) 68) + Type = 3; + if (tile.wall == (byte) 64) + Type = 40; + if (tile.wall == (byte) 67) + Type = 40; + if (tile.wall == (byte) 84) + Type = 80; + if (tile.wall == (byte) 71) + Type = 80; + if (tile.wall == (byte) 60) + Type = 3; + if (tile.wall == (byte) 71) + Type = 80; + if (tile.wall == (byte) 167) + Type = 81; + if (tile.wall == (byte) 147) + Type = 51; + if (tile.wall == (byte) 146) + Type = 9; + if (tile.wall == (byte) 109) + Type = 144; + if (tile.wall == (byte) 110) + Type = 145; + if (tile.wall == (byte) 111) + Type = 146; + if (tile.wall == (byte) 86 || tile.wall == (byte) 108) + Type = 147; + if (tile.wall == (byte) 87) + Type = 148; + if (tile.wall == (byte) 83) + { + Type = 117; + if (WorldGen.genRand.Next(2) == 0) + Type = 1; + } + if (tile.wall == (byte) 81) + Type = 123; + if (tile.wall == (byte) 136) + Type = 13; + if (tile.wall == (byte) 137) + Type = 13; + if (tile.wall == (byte) 168) + Type = 13; + if (tile.wall == (byte) 169) + Type = 13; + if (tile.wall == (byte) 172) + Type = 13; + if (tile.wall == (byte) 226) + Type = 13; + if (tile.wall == (byte) 227) + Type = 13; + if (tile.wall == (byte) 72) + Type = 40; + if (tile.wall == (byte) 73) + Type = 16; + if (tile.wall == (byte) 74 || tile.wall == (byte) 80) + Type = 26; + if (tile.wall == (byte) 144) + Type = WorldGen.genRand.Next(2) != 0 ? 118 : 10; + if (tile.wall == (byte) 75) + Type = 26; + if (tile.wall == (byte) 76) + Type = 4; + if (tile.wall == (byte) 77 || tile.wall == (byte) 81) + Type = 5; + if (tile.wall == (byte) 78) + Type = 7; + if (tile.wall == (byte) 79) + Type = 37; + if (tile.wall == (byte) 82) + Type = 36; + if (tile.wall == (byte) 69) + Type = WorldGen.genRand.Next(2) != 0 ? 17 : 14; + if (tile.wall == (byte) 70) + Type = 47; + if (tile.wall == (byte) 27) + Type = WorldGen.genRand.Next(2) != 0 ? 1 : 7; + if (tile.wall == (byte) 138) + Type = 77; + if (tile.wall == (byte) 139) + Type = 78; + if (tile.wall == (byte) 140) + Type = 79; + if (tile.wall == (byte) 141) + Type = 126; + if (tile.wall == (byte) 149 || tile.wall == (byte) 150) + Type = 214; + if (tile.wall == (byte) 151 || tile.wall == (byte) 152) + Type = 215; + else if (tile.wall == (byte) 17 || tile.wall == (byte) 18 || tile.wall == (byte) 19) + Type = 1; + if (tile.wall == (byte) 44) + { + int index2 = Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, 66, Alpha: 100, newColor: new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), Scale: 0.75f); + Main.dust[index2].noGravity = true; + } + else if ((tile.wall < (byte) 133 || tile.wall > (byte) 135) && (tile.wall < (byte) 116 || tile.wall > (byte) 125) && (tile.wall < (byte) 126 || tile.wall > (byte) 132)) + { + if (tile.wall == (byte) 76) + Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, Type, Alpha: 75, newColor: new Color(0, 80, (int) byte.MaxValue, 100), Scale: 0.75f); + else if (Type >= 0) + Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, Type); + } + } if (fail) { WorldGen.SquareWallFrame(i, j); } else { - WorldGen.KillWall_DropItems(i, j, tileCache); - tileCache.wall = (ushort) 0; - tileCache.wallColor((byte) 0); + int Type = 0; + if (tile.wall == (byte) 168) + Type = 2696; + if (tile.wall == (byte) 169) + Type = 2698; + if (tile.wall == (byte) 226) + Type = 3752; + if (tile.wall == (byte) 227) + Type = 3753; + if (tile.wall == (byte) 228) + Type = 3760; + if (tile.wall == (byte) 229) + Type = 3761; + if (tile.wall == (byte) 230) + Type = 3762; + if (tile.wall == (byte) 142) + Type = 2263; + if (tile.wall == (byte) 143) + Type = 2264; + if (tile.wall == (byte) 144) + Type = 2271; + if (tile.wall == (byte) 149) + Type = 2505; + if (tile.wall == (byte) 150) + Type = 2507; + if (tile.wall == (byte) 151) + Type = 2506; + if (tile.wall == (byte) 152) + Type = 2508; + if (tile.wall == (byte) 1) + Type = 26; + if (tile.wall == (byte) 4) + Type = 93; + if (tile.wall == (byte) 5) + Type = 130; + if (tile.wall == (byte) 6) + Type = 132; + if (tile.wall == (byte) 7) + Type = 135; + if (tile.wall == (byte) 8) + Type = 138; + if (tile.wall == (byte) 9) + Type = 140; + if (tile.wall == (byte) 10) + Type = 142; + if (tile.wall == (byte) 11) + Type = 144; + if (tile.wall == (byte) 12) + Type = 146; + if (tile.wall == (byte) 14) + Type = 330; + if (tile.wall == (byte) 224) + Type = 3472; + if (tile.wall == (byte) 177) + Type = 3067; + if (tile.wall == (byte) 167) + Type = 2691; + if (tile.wall == (byte) 60) + Type = 3584; + if (tile.wall == (byte) 225) + Type = 3751; + if (tile.wall == (byte) 179) + Type = 3083; + if (tile.wall == (byte) 183) + Type = 3082; + if (tile.wall == (byte) 181) + Type = 3089; + if (tile.wall == (byte) 184) + Type = 3088; + if (tile.wall == (byte) 186) + Type = 3238; + if (tile.wall >= (byte) 153 && tile.wall <= (byte) 166) + { + switch (tile.wall) + { + case 153: + Type = 2677; + break; + case 154: + Type = 2679; + break; + case 155: + Type = 2681; + break; + case 156: + Type = 2683; + break; + case 157: + Type = 2678; + break; + case 158: + Type = 2680; + break; + case 159: + Type = 2682; + break; + case 160: + Type = 2684; + break; + case 161: + Type = 2686; + break; + case 162: + Type = 2688; + break; + case 163: + Type = 2690; + break; + case 164: + Type = 2685; + break; + case 165: + Type = 2687; + break; + case 166: + Type = 2689; + break; + } + } + if (tile.wall == (byte) 136) + Type = 2169; + if (tile.wall == (byte) 137) + Type = 2170; + if (tile.wall == (byte) 172) + Type = 2788; + if (tile.wall == (byte) 145) + Type = 2333; + if (tile.wall == (byte) 16) + Type = 30; + if (tile.wall == (byte) 17) + Type = 135; + if (tile.wall == (byte) 18) + Type = 138; + if (tile.wall == (byte) 19) + Type = 140; + if (tile.wall == (byte) 20) + Type = 330; + if (tile.wall == (byte) 21) + Type = 392; + if (tile.wall == (byte) 86 || tile.wall == (byte) 108) + Type = 1126; + if (tile.wall == (byte) 173) + Type = 2789; + if (tile.wall == (byte) 174) + Type = 2790; + if (tile.wall == (byte) 175) + Type = 2791; + if (tile.wall == (byte) 176) + Type = 2861; + if (tile.wall == (byte) 182) + Type = 3101; + if (tile.wall == (byte) 133) + Type = 2158; + if (tile.wall == (byte) 134) + Type = 2159; + if (tile.wall == (byte) 135) + Type = 2160; + else if (tile.wall == (byte) 113) + Type = 1726; + else if (tile.wall == (byte) 114) + Type = 1728; + else if (tile.wall == (byte) 115) + Type = 1730; + else if (tile.wall == (byte) 146) + Type = 2432; + else if (tile.wall == (byte) 147) + Type = 2433; + else if (tile.wall == (byte) 148) + Type = 2434; + if (tile.wall >= (byte) 116 && tile.wall <= (byte) 125) + Type = 1948 + (int) tile.wall - 116; + if (tile.wall >= (byte) 126 && tile.wall <= (byte) 132) + Type = 2008 + (int) tile.wall - 126; + if (tile.wall == (byte) 22) + Type = 417; + if (tile.wall == (byte) 23) + Type = 418; + if (tile.wall == (byte) 24) + Type = 419; + if (tile.wall == (byte) 25) + Type = 420; + if (tile.wall == (byte) 26) + Type = 421; + if (tile.wall == (byte) 29) + Type = 587; + if (tile.wall == (byte) 30) + Type = 592; + if (tile.wall == (byte) 31) + Type = 595; + if (tile.wall == (byte) 32) + Type = 605; + if (tile.wall == (byte) 33) + Type = 606; + if (tile.wall == (byte) 34) + Type = 608; + if (tile.wall == (byte) 35) + Type = 610; + if (tile.wall == (byte) 36) + Type = 615; + if (tile.wall == (byte) 37) + Type = 616; + if (tile.wall == (byte) 38) + Type = 617; + if (tile.wall == (byte) 39) + Type = 618; + if (tile.wall == (byte) 41) + Type = 622; + if (tile.wall == (byte) 42) + Type = 623; + if (tile.wall == (byte) 43) + Type = 624; + if (tile.wall == (byte) 44) + Type = 663; + if (tile.wall == (byte) 45) + Type = 720; + if (tile.wall == (byte) 46) + Type = 721; + if (tile.wall == (byte) 47) + Type = 722; + if (tile.wall == (byte) 66) + Type = 745; + if (tile.wall == (byte) 67) + Type = 746; + if (tile.wall == (byte) 68) + Type = 747; + if (tile.wall == (byte) 84) + Type = 884; + if (tile.wall == (byte) 72) + Type = 750; + if (tile.wall == (byte) 73) + Type = 752; + if (tile.wall == (byte) 74) + Type = 764; + if (tile.wall == (byte) 85) + Type = 927; + if (tile.wall == (byte) 75) + Type = 768; + if (tile.wall == (byte) 76) + Type = 769; + if (tile.wall == (byte) 77) + Type = 770; + if (tile.wall == (byte) 82) + Type = 825; + if (tile.wall == (byte) 27) + Type = 479; + if (tile.wall == (byte) 106) + Type = 1447; + if (tile.wall == (byte) 107) + Type = 1448; + if (tile.wall == (byte) 109) + Type = 1590; + if (tile.wall == (byte) 110) + Type = 1592; + if (tile.wall == (byte) 111) + Type = 1594; + if (tile.wall == (byte) 78) + Type = 1723; + if (tile.wall == (byte) 87 || tile.wall == (byte) 112) + Type = 1102; + if (tile.wall == (byte) 94 || tile.wall == (byte) 100) + Type = 1378; + if (tile.wall == (byte) 95 || tile.wall == (byte) 101) + Type = 1379; + if (tile.wall == (byte) 96 || tile.wall == (byte) 102) + Type = 1380; + if (tile.wall == (byte) 97 || tile.wall == (byte) 103) + Type = 1381; + if (tile.wall == (byte) 98 || tile.wall == (byte) 104) + Type = 1382; + if (tile.wall == (byte) 99 || tile.wall == (byte) 105) + Type = 1383; + if (tile.wall >= (byte) 88 && tile.wall <= (byte) 93) + Type = 1267 + (int) tile.wall - 88; + if (tile.wall >= (byte) 138 && tile.wall <= (byte) 141) + Type = 2210 + (int) tile.wall - 138; + if (Type > 0) + Item.NewItem(i * 16, j * 16, 16, 16, Type); + tile.wall = (byte) 0; + tile.wallColor((byte) 0); WorldGen.SquareWallFrame(i, j); - if (tileCache.type < (ushort) 0 || tileCache.type >= (ushort) 623 || !TileID.Sets.FramesOnKillWall[(int) tileCache.type]) + if (tile.type < (ushort) 0 || tile.type >= (ushort) 470 || !TileID.Sets.FramesOnKillWall[(int) tile.type]) return; WorldGen.TileFrame(i, j); } } - private static bool KillWall_CheckFailure(bool fail, Tile tileCache) - { - if (Main.wallDungeon[(int) tileCache.wall] && !NPC.downedBoss3) - fail = true; - if (tileCache.wall == (ushort) 87 && !NPC.downedGolemBoss) - fail = true; - return fail; - } - - private static void KillWall_PlaySounds(int i, int j, Tile tileCache) - { - if (tileCache.wall == (ushort) 241 || tileCache.wall >= (ushort) 88 && tileCache.wall <= (ushort) 93 || tileCache.wall == (ushort) 21 || tileCache.wall == (ushort) 186 || tileCache.wall == (ushort) 136 || tileCache.wall == (ushort) 137 || tileCache.wall == (ushort) 168 || tileCache.wall == (ushort) 169 || tileCache.wall == (ushort) 172 || tileCache.wall == (ushort) 226 || tileCache.wall == (ushort) 227 || tileCache.wall == (ushort) 242 || tileCache.wall == (ushort) 243) - SoundEngine.PlaySound(13, i * 16, j * 16); - else if (tileCache.wall >= (ushort) 63 && tileCache.wall <= (ushort) 70 || tileCache.wall == (ushort) 264 || tileCache.wall == (ushort) 268 || tileCache.wall == (ushort) 265) - SoundEngine.PlaySound(6, i * 16, j * 16); - else - SoundEngine.PlaySound(0, i * 16, j * 16); - } - - private static void KillWall_DropItems(int i, int j, Tile tileCache) - { - int itemDrops = WorldGen.KillWall_GetItemDrops(tileCache); - if (itemDrops <= 0) - return; - Item.NewItem(i * 16, j * 16, 16, 16, itemDrops); - } - - private static int KillWall_GetItemDrops(Tile tileCache) - { - switch (tileCache.wall) - { - case 237: - return 4233; - case 238: - return 4234; - case 239: - return 4235; - case 240: - return 4236; - case 246: - return 4486; - case 247: - return 4487; - case 248: - return 4488; - case 249: - return 4489; - case 250: - return 4490; - case 251: - return 4491; - case 252: - return 4492; - case 253: - return 4493; - case 254: - return 4494; - case (ushort) byte.MaxValue: - return 4495; - case 256: - return 4496; - case 257: - return 4497; - case 258: - return 4498; - case 259: - return 4499; - case 260: - return 4500; - case 261: - return 4501; - case 262: - return 4502; - case 263: - return 4503; - case 264: - return 4504; - case 265: - return 4505; - case 266: - return 4506; - case 267: - return 4507; - case 268: - return 4508; - case 269: - return 4509; - case 270: - return 4510; - case 271: - return 4511; - case 274: - return 4512; - case 275: - return 3273; - case 276: - return 4513; - case 277: - return 4514; - case 278: - return 4515; - case 279: - return 4516; - case 280: - return 4517; - case 281: - return 4518; - case 282: - return 4519; - case 283: - return 4520; - case 284: - return 4521; - case 285: - return 4522; - case 286: - return 4523; - case 287: - return 4524; - case 288: - return 4525; - case 289: - return 4526; - case 290: - return 4527; - case 291: - return 4528; - case 292: - return 4529; - case 293: - return 4530; - case 294: - return 4531; - case 295: - return 4532; - case 296: - return 4533; - case 297: - return 4534; - case 298: - return 4535; - case 299: - return 4536; - case 300: - return 4537; - case 301: - return 4538; - case 302: - return 4539; - case 303: - return 4540; - case 304: - return 3340; - case 305: - return 3341; - case 306: - return 3342; - case 307: - return 3343; - case 308: - return 3344; - case 309: - return 3345; - case 310: - return 3346; - case 311: - return 3348; - case 314: - return 4647; - default: - int num = 0; - if (tileCache.wall == (ushort) 168) - num = 2696; - if (tileCache.wall == (ushort) 169) - num = 2698; - if (tileCache.wall == (ushort) 226) - num = 3752; - if (tileCache.wall == (ushort) 227) - num = 3753; - if (tileCache.wall == (ushort) 228) - num = 3760; - if (tileCache.wall == (ushort) 229) - num = 3761; - if (tileCache.wall == (ushort) 230) - num = 3762; - if (tileCache.wall == (ushort) 142) - num = 2263; - if (tileCache.wall == (ushort) 143) - num = 2264; - if (tileCache.wall == (ushort) 144) - num = 2271; - if (tileCache.wall == (ushort) 149) - num = 2505; - if (tileCache.wall == (ushort) 150) - num = 2507; - if (tileCache.wall == (ushort) 151) - num = 2506; - if (tileCache.wall == (ushort) 152) - num = 2508; - if (tileCache.wall == (ushort) 245) - num = 4424; - if (tileCache.wall == (ushort) 315) - num = 4667; - if (tileCache.wall == (ushort) 1) - num = 26; - if (tileCache.wall == (ushort) 4) - num = 93; - if (tileCache.wall == (ushort) 5) - num = 130; - if (tileCache.wall == (ushort) 6) - num = 132; - if (tileCache.wall == (ushort) 7) - num = 135; - if (tileCache.wall == (ushort) 8) - num = 138; - if (tileCache.wall == (ushort) 9) - num = 140; - if (tileCache.wall == (ushort) 10) - num = 142; - if (tileCache.wall == (ushort) 11) - num = 144; - if (tileCache.wall == (ushort) 12) - num = 146; - if (tileCache.wall == (ushort) 14) - num = 330; - if (tileCache.wall == (ushort) 224) - num = 3472; - if (tileCache.wall == (ushort) 177) - num = 3067; - if (tileCache.wall == (ushort) 167) - num = 2691; - if (tileCache.wall == (ushort) 60) - num = 3584; - if (tileCache.wall == (ushort) 231) - num = 3952; - if (tileCache.wall == (ushort) 232) - num = 3954; - if (tileCache.wall == (ushort) 225) - num = 3751; - if (tileCache.wall == (ushort) 233) - num = 3956; - if (tileCache.wall == (ushort) 234) - num = 4052; - if (tileCache.wall == (ushort) 235) - num = 4053; - if (tileCache.wall == (ushort) 236) - num = 4140; - if (tileCache.wall == (ushort) 312) - num = 4565; - if (tileCache.wall == (ushort) 313) - num = 4548; - if (tileCache.wall == (ushort) 179) - num = 3083; - if (tileCache.wall == (ushort) 183) - num = 3082; - if (tileCache.wall == (ushort) 181) - num = 3089; - if (tileCache.wall == (ushort) 184) - num = 3088; - if (tileCache.wall == (ushort) 186) - num = 3238; - if (tileCache.wall >= (ushort) 153 && tileCache.wall <= (ushort) 166) - { - switch (tileCache.wall) - { - case 153: - num = 2677; - break; - case 154: - num = 2679; - break; - case 155: - num = 2681; - break; - case 156: - num = 2683; - break; - case 157: - num = 2678; - break; - case 158: - num = 2680; - break; - case 159: - num = 2682; - break; - case 160: - num = 2684; - break; - case 161: - num = 2686; - break; - case 162: - num = 2688; - break; - case 163: - num = 2690; - break; - case 164: - num = 2685; - break; - case 165: - num = 2687; - break; - case 166: - num = 2689; - break; - } - } - if (tileCache.wall == (ushort) 136) - num = 2169; - if (tileCache.wall == (ushort) 137) - num = 2170; - if (tileCache.wall == (ushort) 172) - num = 2788; - if (tileCache.wall == (ushort) 242) - num = 4279; - if (tileCache.wall == (ushort) 243) - num = 4280; - if (tileCache.wall == (ushort) 145) - num = 2333; - if (tileCache.wall == (ushort) 16) - num = 30; - if (tileCache.wall == (ushort) 17) - num = 135; - if (tileCache.wall == (ushort) 18) - num = 138; - if (tileCache.wall == (ushort) 19) - num = 140; - if (tileCache.wall == (ushort) 20) - num = 330; - if (tileCache.wall == (ushort) 21) - num = 392; - if (tileCache.wall == (ushort) 86 || tileCache.wall == (ushort) 108) - num = 1126; - if (tileCache.wall == (ushort) 173) - num = 2789; - if (tileCache.wall == (ushort) 174) - num = 2790; - if (tileCache.wall == (ushort) 175) - num = 2791; - if (tileCache.wall == (ushort) 176) - num = 2861; - if (tileCache.wall == (ushort) 182) - num = 3101; - if (tileCache.wall == (ushort) 133) - num = 2158; - if (tileCache.wall == (ushort) 134) - num = 2159; - if (tileCache.wall == (ushort) 135) - num = 2160; - else if (tileCache.wall == (ushort) 113) - num = 1726; - else if (tileCache.wall == (ushort) 114) - num = 1728; - else if (tileCache.wall == (ushort) 115) - num = 1730; - else if (tileCache.wall == (ushort) 146) - num = 2432; - else if (tileCache.wall == (ushort) 147) - num = 2433; - else if (tileCache.wall == (ushort) 148) - num = 2434; - if (tileCache.wall >= (ushort) 116 && tileCache.wall <= (ushort) 125) - num = 1948 + (int) tileCache.wall - 116; - if (tileCache.wall >= (ushort) 126 && tileCache.wall <= (ushort) 132) - num = 2008 + (int) tileCache.wall - 126; - if (tileCache.wall == (ushort) 22) - num = 417; - if (tileCache.wall == (ushort) 23) - num = 418; - if (tileCache.wall == (ushort) 24) - num = 419; - if (tileCache.wall == (ushort) 25) - num = 420; - if (tileCache.wall == (ushort) 26) - num = 421; - if (tileCache.wall == (ushort) 29) - num = 587; - if (tileCache.wall == (ushort) 30) - num = 592; - if (tileCache.wall == (ushort) 31) - num = 595; - if (tileCache.wall == (ushort) 32) - num = 605; - if (tileCache.wall == (ushort) 33) - num = 606; - if (tileCache.wall == (ushort) 34) - num = 608; - if (tileCache.wall == (ushort) 35) - num = 610; - if (tileCache.wall == (ushort) 36) - num = 615; - if (tileCache.wall == (ushort) 37) - num = 616; - if (tileCache.wall == (ushort) 38) - num = 617; - if (tileCache.wall == (ushort) 39) - num = 618; - if (tileCache.wall == (ushort) 41) - num = 622; - if (tileCache.wall == (ushort) 42) - num = 623; - if (tileCache.wall == (ushort) 43) - num = 624; - if (tileCache.wall == (ushort) 44) - num = 663; - if (tileCache.wall == (ushort) 45) - num = 720; - if (tileCache.wall == (ushort) 46) - num = 721; - if (tileCache.wall == (ushort) 47) - num = 722; - if (tileCache.wall == (ushort) 66) - num = 745; - if (tileCache.wall == (ushort) 67) - num = 746; - if (tileCache.wall == (ushort) 68) - num = 747; - if (tileCache.wall == (ushort) 84) - num = 884; - if (tileCache.wall == (ushort) 72) - num = 750; - if (tileCache.wall == (ushort) 73) - num = 752; - if (tileCache.wall == (ushort) 74) - num = 764; - if (tileCache.wall == (ushort) 85) - num = 927; - if (tileCache.wall == (ushort) 75) - num = 768; - if (tileCache.wall == (ushort) 76) - num = 769; - if (tileCache.wall == (ushort) 77) - num = 770; - if (tileCache.wall == (ushort) 82) - num = 825; - if (tileCache.wall == (ushort) 27) - num = 479; - if (tileCache.wall == (ushort) 106) - num = 1447; - if (tileCache.wall == (ushort) 107) - num = 1448; - if (tileCache.wall == (ushort) 109) - num = 1590; - if (tileCache.wall == (ushort) 110) - num = 1592; - if (tileCache.wall == (ushort) 111) - num = 1594; - if (tileCache.wall == (ushort) 78) - num = 1723; - if (tileCache.wall == (ushort) 87 || tileCache.wall == (ushort) 112) - num = 1102; - if (tileCache.wall == (ushort) 94 || tileCache.wall == (ushort) 100) - num = 1378; - if (tileCache.wall == (ushort) 95 || tileCache.wall == (ushort) 101) - num = 1379; - if (tileCache.wall == (ushort) 96 || tileCache.wall == (ushort) 102) - num = 1380; - if (tileCache.wall == (ushort) 97 || tileCache.wall == (ushort) 103) - num = 1381; - if (tileCache.wall == (ushort) 98 || tileCache.wall == (ushort) 104) - num = 1382; - if (tileCache.wall == (ushort) 99 || tileCache.wall == (ushort) 105) - num = 1383; - if (tileCache.wall == (ushort) 241) - num = 4260; - if (tileCache.wall >= (ushort) 88 && tileCache.wall <= (ushort) 93) - num = 1267 + (int) tileCache.wall - 88; - if (tileCache.wall >= (ushort) 138 && tileCache.wall <= (ushort) 141) - num = 2210 + (int) tileCache.wall - 138; - return num; - } - } - - private static void KillWall_MakeWallDust(int i, int j, Tile tileCache) - { - int Type = 0; - switch (tileCache.wall) - { - case 3: - case 246: - Type = WorldGen.genRand.Next(2) != 0 ? 1 : 14; - break; - case 7: - case 17: - case 94: - case 95: - case 100: - case 101: - Type = 275; - break; - case 8: - case 18: - case 98: - case 99: - case 104: - case 105: - Type = 276; - break; - case 9: - case 19: - case 96: - case 97: - case 102: - case 103: - Type = 277; - break; - case 15: - case 247: - Type = 38; - break; - case 22: - case 28: - case 248: - Type = 51; - break; - case 40: - case 249: - Type = 51; - break; - case 48: - case 49: - case 50: - case 51: - case 52: - case 53: - case 54: - case 55: - case 56: - case 57: - case 58: - case 185: - case 250: - case 251: - case 252: - case 253: - case 254: - case (ushort) byte.MaxValue: - case 256: - case 257: - case 258: - case 259: - case 260: - case 274: - case 314: - Type = 1; - break; - case 59: - case 61: - case 261: - case 262: - Type = 0; - break; - case 62: - case 263: - Type = 0; - break; - case 69: - case 264: - Type = WorldGen.genRand.Next(2) != 0 ? 17 : 14; - break; - case 70: - case 265: - Type = 47; - break; - case 71: - case 266: - Type = 80; - break; - case 79: - case 267: - Type = 37; - break; - case 81: - case 268: - Type = 123; - break; - case 83: - case 234: - case 269: - Type = WorldGen.genRand.Next(2) != 0 ? 117 : 1; - break; - case 170: - case 171: - case 270: - case 271: - Type = 0; - break; - case 187: - case 275: - Type = 0; - break; - case 188: - case 189: - case 190: - case 191: - case 276: - case 277: - case 278: - case 279: - Type = 37; - break; - case 192: - case 193: - case 194: - case 195: - case 280: - case 281: - case 282: - case 283: - Type = 117; - break; - case 196: - case 197: - case 198: - case 199: - case 284: - case 285: - case 286: - case 287: - Type = 0; - break; - case 200: - case 202: - case 288: - case 290: - Type = WorldGen.genRand.Next(2) != 0 ? 70 : 69; - break; - case 201: - case 289: - Type = 17; - break; - case 203: - case 291: - Type = WorldGen.genRand.Next(2) != 0 ? 68 : 69; - break; - case 204: - case 205: - case 207: - case 292: - case 293: - case 295: - Type = 0; - break; - case 206: - case 294: - Type = 1; - break; - case 208: - case 209: - case 210: - case 211: - case 296: - case 297: - case 298: - case 299: - Type = WorldGen.genRand.Next(2) != 0 ? 125 : 155; - break; - case 212: - case 213: - case 214: - case 215: - case 300: - case 301: - case 302: - case 303: - Type = 1; - break; - case 216: - case 304: - Type = 0; - break; - case 217: - case 305: - Type = 37; - break; - case 218: - case 306: - Type = 155; - break; - case 219: - case 307: - Type = 17; - break; - case 220: - case 308: - Type = 37; - break; - case 221: - case 309: - Type = 155; - break; - case 222: - case 310: - Type = 37; - break; - case 223: - case 311: - Type = 0; - break; - case 231: - Type = 8; - break; - case 232: - Type = 82; - break; - case 233: - Type = 18; - break; - case 237: - Type = 6; - break; - case 238: - Type = 61; - break; - case 239: - Type = 242; - break; - case 240: - Type = 135; - break; - case 312: - case 313: - case 315: - Type = -1; - break; - } - if (tileCache.wall == (ushort) 148) - Type = -1; - if (tileCache.wall == (ushort) 1 || tileCache.wall == (ushort) 5 || tileCache.wall == (ushort) 6 || tileCache.wall == (ushort) 107) - Type = 1; - if (tileCache.wall == (ushort) 35) - Type = 37; - if (tileCache.wall == (ushort) 4 || tileCache.wall == (ushort) 106) - Type = 7; - if (tileCache.wall == (ushort) 12) - Type = 9; - if (tileCache.wall == (ushort) 10) - Type = 10; - if (tileCache.wall == (ushort) 11) - Type = 11; - if (tileCache.wall == (ushort) 21) - Type = 13; - if (tileCache.wall == (ushort) 34) - Type = 32; - if (tileCache.wall == (ushort) 225) - Type = 1; - if (tileCache.wall == (ushort) 145) - Type = 8; - if (tileCache.wall == (ushort) 23) - Type = 38; - if (tileCache.wall == (ushort) 24) - Type = 36; - if (tileCache.wall == (ushort) 25) - Type = 48; - if (tileCache.wall == (ushort) 179 || tileCache.wall == (ushort) 178 || tileCache.wall == (ushort) 183) - Type = 236; - if (tileCache.wall == (ushort) 181 || tileCache.wall == (ushort) 180 || tileCache.wall == (ushort) 184) - Type = 240; - if (tileCache.wall == (ushort) 113) - Type = 189; - if (tileCache.wall == (ushort) 114) - Type = 190; - if (tileCache.wall == (ushort) 115) - Type = 191; - if (tileCache.wall == (ushort) 177 || tileCache.wall == (ushort) 13) - Type = 25; - if (tileCache.wall == (ushort) 186) - Type = WorldGen.genRand.Next(68, 71); - if (tileCache.wall == (ushort) 142) - Type = 210; - if (tileCache.wall == (ushort) 143) - Type = 210; - if (tileCache.wall == (ushort) 224) - Type = 265; - if (tileCache.wall == (ushort) 173) - Type = 128; - if (tileCache.wall == (ushort) 174) - Type = 117; - if (tileCache.wall == (ushort) 175) - Type = 42; - if (tileCache.wall == (ushort) 176) - Type = 226; - if (tileCache.wall == (ushort) 182) - Type = WorldGen.genRand.Next(2) != 0 ? 23 : 6; - if (tileCache.wall >= (ushort) 153 && tileCache.wall <= (ushort) 166) - { - switch (tileCache.wall) - { - case 153: - case 157: - Type = 138; - break; - case 154: - case 158: - Type = 86; - break; - case 155: - case 159: - Type = 91; - break; - case 156: - case 160: - Type = 89; - break; - case 161: - case 164: - Type = 90; - break; - case 162: - case 165: - Type = 88; - break; - case 163: - case 166: - Type = 87; - break; - } - } - if (tileCache.wall == (ushort) 26 || tileCache.wall == (ushort) 30) - Type = 49; - if (tileCache.wall == (ushort) 29 || tileCache.wall == (ushort) 32) - Type = 50; - if (tileCache.wall == (ushort) 31) - Type = 51; - if (tileCache.wall == (ushort) 14 || tileCache.wall == (ushort) 20) - Type = 109; - if (tileCache.wall == (ushort) 241) - Type = 286; - if (tileCache.wall >= (ushort) 88 && tileCache.wall <= (ushort) 93) - { - Type = 86 + (int) tileCache.wall - 88; - if (tileCache.wall == (ushort) 93) - Type = WorldGen.genRand.Next(88, 94); - } - if (tileCache.wall == (ushort) 33) - Type = 14; - if (tileCache.wall == (ushort) 41) - Type = 77; - if (tileCache.wall == (ushort) 42) - Type = 78; - if (tileCache.wall == (ushort) 43) - Type = 78; - if (tileCache.wall == (ushort) 36) - Type = 26; - if (tileCache.wall == (ushort) 37) - Type = 32; - if (tileCache.wall == (ushort) 38) - Type = 2; - if (tileCache.wall == (ushort) 39) - Type = 1; - if (tileCache.wall == (ushort) 45) - Type = 81; - if (tileCache.wall == (ushort) 46) - Type = 83; - if (tileCache.wall == (ushort) 47) - Type = 84; - if (tileCache.wall == (ushort) 85) - Type = 126; - if (tileCache.wall == (ushort) 63) - Type = 3; - if (tileCache.wall == (ushort) 65) - Type = 3; - if (tileCache.wall == (ushort) 66) - Type = 3; - if (tileCache.wall == (ushort) 68) - Type = 3; - if (tileCache.wall == (ushort) 64) - Type = 40; - if (tileCache.wall == (ushort) 67) - Type = 40; - if (tileCache.wall == (ushort) 84) - Type = 80; - if (tileCache.wall == (ushort) 60) - Type = 3; - if (tileCache.wall == (ushort) 167) - Type = 81; - if (tileCache.wall == (ushort) 147) - Type = 51; - if (tileCache.wall == (ushort) 146) - Type = 9; - if (tileCache.wall == (ushort) 109) - Type = 144; - if (tileCache.wall == (ushort) 110) - Type = 145; - if (tileCache.wall == (ushort) 111) - Type = 146; - if (tileCache.wall == (ushort) 86 || tileCache.wall == (ushort) 108) - Type = 147; - if (tileCache.wall == (ushort) 87) - Type = 148; - if (tileCache.wall == (ushort) 136) - Type = 13; - if (tileCache.wall == (ushort) 137) - Type = 13; - if (tileCache.wall == (ushort) 168) - Type = 13; - if (tileCache.wall == (ushort) 169) - Type = 13; - if (tileCache.wall == (ushort) 172) - Type = 13; - if (tileCache.wall == (ushort) 226) - Type = 13; - if (tileCache.wall == (ushort) 227) - Type = 13; - if (tileCache.wall == (ushort) 242) - Type = 13; - if (tileCache.wall == (ushort) 243) - Type = 13; - if (tileCache.wall == (ushort) 72) - Type = 40; - if (tileCache.wall == (ushort) 73) - Type = 16; - if (tileCache.wall == (ushort) 74 || tileCache.wall == (ushort) 80) - Type = 26; - if (tileCache.wall == (ushort) 144) - Type = WorldGen.genRand.Next(2) != 0 ? 118 : 10; - if (tileCache.wall == (ushort) 75) - Type = 26; - if (tileCache.wall == (ushort) 76) - Type = 4; - if (tileCache.wall == (ushort) 77 || tileCache.wall == (ushort) 81) - Type = 5; - if (tileCache.wall == (ushort) 78 || tileCache.wall == (ushort) 244) - Type = 7; - if (tileCache.wall == (ushort) 82) - Type = 36; - if (tileCache.wall == (ushort) 27) - Type = WorldGen.genRand.Next(2) != 0 ? 1 : 7; - if (tileCache.wall == (ushort) 138) - Type = 77; - if (tileCache.wall == (ushort) 139) - Type = 78; - if (tileCache.wall == (ushort) 140) - Type = 79; - if (tileCache.wall == (ushort) 141) - Type = 126; - if (tileCache.wall == (ushort) 149 || tileCache.wall == (ushort) 150) - Type = 214; - if (tileCache.wall == (ushort) 151 || tileCache.wall == (ushort) 152) - Type = 215; - if (tileCache.wall == (ushort) 245) - Type = 195; - if (tileCache.wall == (ushort) 44) - { - int index = Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, 66, Alpha: 100, newColor: new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), Scale: 0.75f); - Main.dust[index].noGravity = true; - } - else - { - if (tileCache.wall >= (ushort) 133 && tileCache.wall <= (ushort) 135 || tileCache.wall >= (ushort) 116 && tileCache.wall <= (ushort) 125 || tileCache.wall >= (ushort) 126 && tileCache.wall <= (ushort) 132) - return; - if (tileCache.wall == (ushort) 76) - { - Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, Type, Alpha: 75, newColor: new Color(0, 80, (int) byte.MaxValue, 100), Scale: 0.75f); - } - else - { - if (Type < 0) - return; - Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, Type); - } - } - } - public static void LaunchRocket(int x, int y) { int frameY = (int) Main.tile[x, y].frameY; @@ -36804,8 +27089,7 @@ label_296: int Type = 167 + num1; int Damage = 150; int num2 = 7; - int index = Projectile.NewProjectile(vector2.X, vector2.Y + 2f, 0.0f, -8f, Type, Damage, (float) num2, Main.myPlayer); - Main.projectile[index].originatedFromActivableTile = true; + Projectile.NewProjectile(vector2.X, vector2.Y + 2f, 0.0f, -8f, Type, Damage, (float) num2, Main.myPlayer); Main.tile[x, y].active(false); Main.tile[x, y + 1].active(false); NetMessage.SendTileSquare(-1, x - 1, y, 3); @@ -36821,21 +27105,7 @@ label_296: int Type = 415 + Main.rand.Next(4); int Damage = 0; int num = 0; - int index = Projectile.NewProjectile(vector2.X, vector2.Y + 2f, 0.0f, -8f, Type, Damage, (float) num, Main.myPlayer); - Main.projectile[index].originatedFromActivableTile = true; - } - - public static bool CanKillTile(int i, int j, WorldGen.SpecialKillTileContext context) - { - if (context == WorldGen.SpecialKillTileContext.MowingTheGrass) - { - Tile tile = Main.tile[i, j]; - if (tile == null) - return false; - if (tile.type == (ushort) 2 || tile.type == (ushort) 109) - return true; - } - return WorldGen.CanKillTile(i, j); + Projectile.NewProjectile(vector2.X, vector2.Y + 2f, 0.0f, -8f, Type, Damage, (float) num, Main.myPlayer); } public static bool CanKillTile(int i, int j) => WorldGen.CanKillTile(i, j, out bool _); @@ -36845,66 +27115,49 @@ label_296: blockDamaged = false; if (i < 0 || j < 0 || i >= Main.maxTilesX || j >= Main.maxTilesY) return false; - Tile t1 = Main.tile[i, j]; - Tile tile = (Tile) null; - if (t1 == null || !t1.active()) + Tile tile1 = Main.tile[i, j]; + Tile tile2 = (Tile) null; + if (tile1 == null || !tile1.active()) return false; if (j >= 1) - tile = Main.tile[i, j - 1]; - if (tile != null && tile.active()) + tile2 = Main.tile[i, j - 1]; + if (tile2 != null && tile2.active()) { - int type = (int) tile.type; - if (TileID.Sets.IsATreeTrunk[type] && (int) t1.type != type && (tile.frameX != (short) 66 || tile.frameY < (short) 0 || tile.frameY > (short) 44) && (tile.frameX != (short) 88 || tile.frameY < (short) 66 || tile.frameY > (short) 110) && tile.frameY < (short) 198) - return false; + int type = (int) tile2.type; switch (type) { + case 5: + if ((int) tile1.type != type && (tile2.frameX != (short) 66 || tile2.frameY < (short) 0 || tile2.frameY > (short) 44) && (tile2.frameX != (short) 88 || tile2.frameY < (short) 66 || tile2.frameY > (short) 110) && tile2.frameY < (short) 198) + return false; + break; case 21: case 26: case 72: - case 77: case 88: - case 467: - case 488: - if ((int) t1.type != type) + if ((int) tile1.type != type) return false; break; - case 80: - if ((int) t1.type != type) - { - switch ((int) tile.frameX / 18) - { - case 0: - case 1: - case 4: - case 5: - return false; - } - } - else - break; - break; case 323: - if ((int) t1.type != type && (tile.frameX == (short) 66 || tile.frameX == (short) 220)) + if ((int) tile1.type != type && (tile2.frameX == (short) 66 || tile2.frameX == (short) 220)) return false; break; } } - switch (t1.type) + switch (tile1.type) { case 10: - if (WorldGen.IsLockedDoor(t1)) + if (tile1.type == (ushort) 10 && tile1.frameY >= (short) 594 && tile1.frameY <= (short) 646) { blockDamaged = true; return false; } break; case 21: - case 467: - if (!Chest.CanDestroyChest(i - (int) t1.frameX / 18 % 2, j - (int) t1.frameY / 18)) + if (!Chest.CanDestroyChest(i - (int) tile1.frameX / 18 % 2, j - (int) tile1.frameY / 18)) return false; break; case 88: - if (!Chest.CanDestroyChest(i - (int) t1.frameX / 18 % 3, j - (int) t1.frameY / 18)) + if (!Chest.CanDestroyChest(i - (int) tile1.frameX / 18 % 3, j - (int) tile1.frameY / 18)) return false; break; case 138: @@ -36915,11 +27168,10 @@ label_296: } break; case 235: - int num = i - (int) t1.frameX % 54 / 18; + int num = i - (int) tile1.frameX % 54 / 18; for (int index = 0; index < 3; ++index) { - Tile t2 = Main.tile[num + index, j - 1]; - if (t2.active() && WorldGen.IsAContainer(t2)) + if (Main.tile[num + index, j - 1].active() && (TileID.Sets.BasicChest[(int) Main.tile[num + index, j - 1].type] || TileID.Sets.BasicChestFake[(int) Main.tile[num + index, j - 1].type])) { blockDamaged = true; return false; @@ -36930,859 +27182,104 @@ label_296: return true; } - public static bool IsTileReplacable(int x, int y) - { - Tile tile1 = Main.tile[x, y]; - if (y >= 1) - { - Tile tile2 = Main.tile[x, y - 1]; - if (tile1 == null || tile2 == null) - return false; - if (tile2.active()) - { - if (tile2.type == (ushort) 80 || tile2.type == (ushort) 488) - return false; - if (TileID.Sets.PreventsTileReplaceIfOnTopOfIt[(int) tile2.type] && (int) tile1.type != (int) tile2.type) - return TileID.Sets.IsATreeTrunk[(int) tile2.type] ? tile2.frameX == (short) 66 && tile2.frameY >= (short) 0 && tile2.frameY <= (short) 44 || tile2.frameX == (short) 88 && tile2.frameY >= (short) 66 && tile2.frameY <= (short) 110 || tile2.frameY >= (short) 198 : tile2.type == (ushort) 323 && tile2.frameX != (short) 66 && tile2.frameX != (short) 220; - } - } - return true; - } - - public static int CheckTileBreakability(int x, int y) - { - Tile t1 = Main.tile[x, y]; - if (y >= 1 && y <= Main.maxTilesY - 1) - { - Tile t2 = Main.tile[x, y - 1]; - Tile tile = Main.tile[x, y + 1]; - if (tile != null && tile.active() && WorldGen.IsLockedDoor(x, y + 1)) - return 2; - if (!Main.tileSolid[(int) t1.type] && !Main.tileSolidTop[(int) t1.type]) - return 0; - if (t2.active()) - { - if (((!TileID.Sets.PreventsTileRemovalIfOnTopOfIt[(int) t2.type] ? 0 : ((int) t1.type != (int) t2.type ? 1 : 0)) | (WorldGen.IsLockedDoor(x, y - 1) ? 1 : 0) | (t2.type != (ushort) 77 || t1.type == (ushort) 77 ? 0 : (!Main.hardMode ? 1 : 0)) | (!WorldGen.IsAContainer(t2) ? 0 : (!WorldGen.IsAContainer(t1) ? 1 : 0))) != 0) - return TileID.Sets.IsATreeTrunk[(int) t2.type] ? (t2.frameX == (short) 66 && t2.frameY >= (short) 0 && t2.frameY <= (short) 44 || t2.frameX == (short) 88 && t2.frameY >= (short) 66 && t2.frameY <= (short) 110 || t2.frameY >= (short) 198 ? 0 : 2) : (t2.type == (ushort) 323 && t2.frameX != (short) 66 && t2.frameX != (short) 220 ? 0 : 2); - if (t2.type == (ushort) 80 && (int) t2.type != (int) t1.type) - { - switch ((int) t2.frameX / 18) - { - case 0: - case 1: - case 4: - case 5: - return 2; - } - } - if (t1.type == (ushort) 10 && t1.frameY >= (short) 594 && t1.frameY <= (short) 646) - return 1; - if (t1.type == (ushort) 138 || t1.type == (ushort) 484) - return WorldGen.CheckBoulderChest(x, y) ? 1 : 0; - } - if (t1.type == (ushort) 235) - { - int frameX = (int) t1.frameX; - int num = x - frameX % 54 / 18; - for (int index = 0; index < 3; ++index) - { - if (Main.tile[num + index, y - 1].active() && WorldGen.IsAContainer(Main.tile[num + index, y - 1])) - return 2; - } - } - } - return 0; - } - - public static bool CheckTileBreakability2_ShouldTileSurvive(int x, int y) - { - if (Main.netMode == 1) - return false; - Tile tile = Main.tile[x, y]; - if (TileID.Sets.BasicChest[(int) tile.type]) - { - int num = (int) tile.frameX / 18; - int Y = y - (int) tile.frameY / 18; - while (num > 1) - num -= 2; - if (!Chest.DestroyChest(x - num, Y)) - return true; - } - if (tile.type == (ushort) 88) - { - int num1 = (int) tile.frameX / 18; - int Y = y - (int) tile.frameY / 18; - int num2 = num1 % 3; - if (!Chest.DestroyChest(x - num2, Y)) - return true; - } - if (tile.type == (ushort) 470) - return !TEDisplayDoll.IsBreakable(x, y); - return tile.type == (ushort) 475 && !TEHatRack.IsBreakable(x, y); - } - - public static bool ReplaceWall(int x, int y, ushort targetWall) - { - if (targetWall >= (ushort) 316) - return false; - Tile tileCache = Main.tile[x, y]; - if (tileCache.wall == (ushort) 0 || targetWall == (ushort) 0 || WorldGen.KillWall_CheckFailure(false, tileCache)) - return false; - int num = 10; - for (int index = 0; index < num; ++index) - WorldGen.KillWall_MakeWallDust(x, y, tileCache); - WorldGen.KillWall_PlaySounds(x, y, tileCache); - WorldGen.KillWall_DropItems(x, y, tileCache); - tileCache.wall = targetWall; - tileCache.wallColor((byte) 0); - WorldGen.SquareWallFrame(x, y); - return true; - } - - public static bool ReplaceTile(int x, int y, ushort targetType, int targetStyle) - { - Tile tileSafely = Framing.GetTileSafely(x, y); - if (!WorldGen.WouldTileReplacementWork(targetType, x, y) || !WorldGen.IsTileReplacable(x, y)) - return false; - WorldGen.MoveReplaceTileAnchor(ref x, ref y, targetType, tileSafely); - int tileDustAmount = WorldGen.KillTile_GetTileDustAmount(false, tileSafely); - for (int index = 0; index < tileDustAmount; ++index) - WorldGen.KillTile_MakeTileDust(x, y, tileSafely); - WorldGen.KillTile_PlaySounds(x, y, false, tileSafely); - WorldGen.KillTile_DropItems(x, y, tileSafely, true); - WorldGen.AttemptFossilShattering(x, y, tileSafely, false); - WorldGen.ReplaceTIle_DoActualReplacement(targetType, targetStyle, x, y, tileSafely); - return true; - } - - private static void ReplaceTIle_DoActualReplacement( - ushort targetType, - int targetStyle, - int topLeftX, - int topLeftY, - Tile t) - { - if (TileID.Sets.BasicChest[(int) targetType]) - { - if (WorldGen.IsChestRigged(topLeftX, topLeftY) && Main.netMode != 1) - { - Wiring.HitSwitch(topLeftX, topLeftY); - NetMessage.SendData(59, number: topLeftX, number2: ((float) topLeftY)); - } - WorldGen.ReplaceTile_DoActualReplacement_Area(targetType, targetStyle, topLeftX, topLeftY, 2, 2); - } - else if (TileID.Sets.BasicDresser[(int) targetType]) - WorldGen.ReplaceTile_DoActualReplacement_Area(targetType, targetStyle, topLeftX, topLeftY, 3, 2); - else - WorldGen.ReplaceTile_DoActualReplacement_Single(targetType, targetStyle, topLeftX, topLeftY, t); - } - - private static void ReplaceTile_DoActualReplacement_Single( - ushort targetType, - int targetStyle, - int topLeftX, - int topLeftY, - Tile t) - { - WorldGen.ReplaceTile_EliminateNaturalExtras(topLeftX, topLeftY); - int type = (int) t.type; - t.type = targetType; - if (TileID.Sets.Platforms[(int) t.type]) - t.frameY = (short) (targetStyle * 18); - t.color((byte) 0); - bool flag = !WorldGen.CanPoundTile(topLeftX, topLeftY); - if (TileID.Sets.Platforms[type] && TileID.Sets.Platforms[(int) t.type]) - flag = false; - if (flag) - { - t.slope((byte) 0); - t.halfBrick(false); - } - WorldGen.SquareTileFrame(topLeftX, topLeftY); - } - - private static void ReplaceTile_EliminateNaturalExtras(int x, int y) - { - if (!WorldGen.InWorld(x, y, 2)) - return; - if (Main.tile[x, y - 1] != null && Main.tile[x, y - 1].active() && (TileID.Sets.ReplaceTileBreakUp[(int) Main.tile[x, y - 1].type] || Main.tile[x, y - 1].type == (ushort) 165 && (Main.tile[x, y - 1].frameY == (short) 36 || Main.tile[x, y - 1].frameY == (short) 54 || Main.tile[x, y - 1].frameY == (short) 90))) - WorldGen.KillTile(x, y - 1); - if (Main.tile[x, y + 1] == null || !Main.tile[x, y + 1].active() || !TileID.Sets.ReplaceTileBreakDown[(int) Main.tile[x, y + 1].type] && (Main.tile[x, y + 1].type != (ushort) 165 || Main.tile[x, y + 1].frameY != (short) 0 && Main.tile[x, y + 1].frameY != (short) 18 && Main.tile[x, y + 1].frameY != (short) 72)) - return; - WorldGen.KillTile(x, y + 1); - } - - private static void ReplaceTile_DoActualReplacement_Area( - ushort targetType, - int targetStyle, - int topLeftX, - int topLeftY, - int areaSizeX, - int areaSizeY) - { - for (int index1 = 0; index1 < areaSizeX; ++index1) - { - for (int index2 = 0; index2 < areaSizeY; ++index2) - { - Tile tile = Main.tile[topLeftX + index1, topLeftY + index2]; - tile.type = targetType; - tile.frameX = (short) (targetStyle * (areaSizeX * 18) + index1 * 18); - tile.frameY = (short) (index2 * 18); - tile.color((byte) 0); - } - } - for (int index3 = 0; index3 < areaSizeX; ++index3) - { - for (int index4 = 0; index4 < areaSizeY; ++index4) - WorldGen.SquareTileFrame(topLeftX + index3, topLeftY + index4); - } - } - - private static void MoveReplaceTileAnchor(ref int x, ref int y, ushort targetType, Tile t) - { - if (TileID.Sets.BasicChest[(int) t.type]) - { - x -= (int) t.frameX % 36 / 18; - y -= (int) t.frameY % 36 / 18; - } - if (!TileID.Sets.BasicDresser[(int) t.type]) - return; - x -= (int) t.frameX % 54 / 18; - y -= (int) t.frameY % 36 / 18; - } - - public static bool WouldTileReplacementBeBlockedByLiquid(int x, int y, int liquidType) - { - if (Main.tile[x - 1, y].liquid > (byte) 0 && (int) Main.tile[x - 1, y].liquidType() == liquidType || Main.tile[x + 1, y].liquid > (byte) 0 && (int) Main.tile[x + 1, y].liquidType() == liquidType) - return true; - return Main.tile[x, y - 1].liquid > (byte) 0 && (int) Main.tile[x, y - 1].liquidType() == liquidType; - } - - public static bool WouldTileReplacementWork(ushort attemptingToReplaceWith, int x, int y) - { - Tile t = Main.tile[x, y]; - if (attemptingToReplaceWith >= (ushort) 623 || TileID.Sets.Conversion.Grass[(int) attemptingToReplaceWith]) - return false; - bool flag1 = !WorldGen.ReplaceTile_IsValidSolid((int) attemptingToReplaceWith) || !WorldGen.ReplaceTile_IsValidSolid((int) t.type); - int num1 = !WorldGen.ReplaceTile_IsValidPlatform((int) attemptingToReplaceWith) ? 1 : (!WorldGen.ReplaceTile_IsValidPlatform((int) t.type) ? 1 : 0); - bool flag2 = !WorldGen.ReplaceTile_IsValidSolid((int) attemptingToReplaceWith) && !WorldGen.ReplaceTile_IsValidPlatform((int) attemptingToReplaceWith) || !WorldGen.ReplaceTile_IsValidSolid((int) t.type) && !WorldGen.ReplaceTile_IsValidPlatform((int) t.type); - bool flag3 = !WorldGen.ReplaceTile_IsValidChest((int) attemptingToReplaceWith) || !WorldGen.ReplaceTile_IsValidChest((int) t.type) || Chest.IsLocked(t); - bool flag4 = !WorldGen.ReplaceTile_IsValidDresser((int) attemptingToReplaceWith) || !WorldGen.ReplaceTile_IsValidDresser((int) t.type); - int num2 = flag1 ? 1 : 0; - return (num1 & num2 & (flag2 ? 1 : 0) & (flag3 ? 1 : 0) & (flag4 ? 1 : 0)) == 0; - } - - private static bool ReplaceTile_IsValidSolid(int type) => Main.tileSolid[type] && !Main.tileSolidTop[type] && !Main.tileFrameImportant[type]; - - private static bool ReplaceTile_IsValidChest(int type) => TileID.Sets.BasicChest[type]; - - private static bool ReplaceTile_IsValidDresser(int type) => TileID.Sets.BasicDresser[type]; - - private static bool ReplaceTile_IsValidPlatform(int type) => TileID.Sets.Platforms[type]; - - public static bool GetVanityTreeFoliageData( - int i, - int j, - int xoffset, - ref int treeFrame, - ref int treeStyle, - out int floorY, - out int topTextureFrameWidth, - out int topTextureFrameHeight) - { - Tile tile1 = Main.tile[i, j]; - int index1 = i + xoffset; - topTextureFrameWidth = 114; - topTextureFrameHeight = 96; - floorY = j; - for (int index2 = 0; index2 < 100; ++index2) - { - floorY = j + index2; - Tile tile2 = Main.tile[index1, floorY]; - if (tile2 == null) - return false; - if (TileID.Sets.Conversion.Grass[(int) tile2.type]) - { - switch (tile1.type) - { - case 596: - treeStyle = 29; - return true; - case 616: - treeStyle = 30; - return true; - default: - continue; - } - } - } - return false; - } - - public static bool GetGemTreeFoliageData( - int i, - int j, - int xoffset, - ref int treeFrame, - ref int treeStyle, - out int floorY, - out int topTextureFrameWidth, - out int topTextureFrameHeight) - { - Tile tile1 = Main.tile[i, j]; - int index1 = i + xoffset; - topTextureFrameWidth = 114; - topTextureFrameHeight = 96; - floorY = j; - for (int index2 = 0; index2 < 100; ++index2) - { - floorY = j + index2; - Tile tile2 = Main.tile[index1, floorY]; - if (tile2 == null) - return false; - if (TileID.Sets.Conversion.Stone[(int) tile2.type]) - { - switch (tile1.type) - { - case 583: - treeStyle = 22; - return true; - case 584: - treeStyle = 23; - return true; - case 585: - treeStyle = 24; - return true; - case 586: - treeStyle = 25; - return true; - case 587: - treeStyle = 26; - return true; - case 588: - treeStyle = 27; - return true; - case 589: - treeStyle = 28; - return true; - default: - continue; - } - } - } - return false; - } - - public static bool GetCommonTreeFoliageData( - int i, - int j, - int xoffset, - ref int treeFrame, - ref int treeStyle, - out int floorY, - out int topTextureFrameWidth, - out int topTextureFrameHeight) - { - Tile tile1 = Main.tile[i, j]; - int index1 = i + xoffset; - topTextureFrameWidth = 80; - topTextureFrameHeight = 80; - floorY = j; - for (int index2 = 0; index2 < 100; ++index2) - { - floorY = j + index2; - Tile tile2 = Main.tile[index1, floorY]; - if (tile2 == null) - return false; - switch (tile2.type) - { - case 2: - case 477: - int num = index1 > Main.treeX[0] ? (index1 > Main.treeX[1] ? (index1 > Main.treeX[2] ? WorldGen.TreeTops.GetTreeStyle(3) : WorldGen.TreeTops.GetTreeStyle(2)) : WorldGen.TreeTops.GetTreeStyle(1)) : WorldGen.TreeTops.GetTreeStyle(0); - switch (num) - { - case 0: - treeStyle = 0; - break; - case 5: - treeStyle = 10; - break; - default: - treeStyle = 5 + num; - break; - } - return true; - case 23: - treeStyle = 1; - return true; - case 60: - topTextureFrameHeight = 96; - topTextureFrameWidth = 114; - treeStyle = 2; - if (WorldGen.TreeTops.GetTreeStyle(5) == 1) - treeStyle = 11; - if ((double) floorY > Main.worldSurface) - treeStyle = 13; - return true; - case 70: - treeStyle = 14; - return true; - case 109: - case 492: - topTextureFrameHeight = 140; - int treeFoliageStyle = WorldGen.GetHollowTreeFoliageStyle(); - treeStyle = treeFoliageStyle; - if (treeFoliageStyle == 19) - topTextureFrameWidth = 114; - if (treeFoliageStyle == 20) - { - treeStyle = 20; - if (i % 6 == 1) - treeFrame += 3; - else if (i % 6 == 2) - treeFrame += 6; - else if (i % 6 == 3) - treeFrame += 9; - else if (i % 6 == 4) - treeFrame += 12; - else if (i % 6 == 5) - treeFrame += 15; - } - else if (i % 3 == 1) - treeFrame += 3; - else if (i % 3 == 2) - treeFrame += 6; - return true; - case 147: - treeStyle = 4; - int treeStyle1 = WorldGen.TreeTops.GetTreeStyle(6); - if (treeStyle1 == 0) - { - treeStyle = 12; - if (i % 10 == 0) - treeStyle = 18; - } - if (treeStyle1 == 2 || treeStyle1 == 3 || treeStyle1 == 32 || treeStyle1 == 4 || treeStyle1 == 42 || treeStyle1 == 5 || treeStyle1 == 7) - treeStyle = treeStyle1 % 2 != 0 ? (i <= Main.maxTilesX / 2 ? 17 : 16) : (i >= Main.maxTilesX / 2 ? 17 : 16); - return true; - case 199: - treeStyle = 5; - return true; - default: - continue; - } - } - return false; - } - - public static int GetHollowTreeFoliageStyle() - { - WorldGen.TreeTops.GetTreeStyle(7); - switch (WorldGen.hallowBG) - { - case 2: - case 3: - return 20; - case 4: - return 19; - default: - return 3; - } - } - - public static int GetTreeFrame(Tile t) - { - if (t.frameY == (short) 220) - return 1; - return t.frameY == (short) 242 ? 2 : 0; - } - - public static TreeTypes GetTreeType(int tileType) - { - switch (tileType) - { - case 2: - case 477: - return TreeTypes.Forest; - case 23: - return TreeTypes.Corrupt; - case 53: - return TreeTypes.Palm; - case 60: - return TreeTypes.Jungle; - case 70: - return TreeTypes.Mushroom; - case 109: - case 492: - return TreeTypes.Hallowed; - case 112: - return TreeTypes.PalmCorrupt; - case 116: - return TreeTypes.PalmHallowed; - case 147: - return TreeTypes.Snow; - case 199: - return TreeTypes.Crimson; - case 234: - return TreeTypes.PalmCrimson; - default: - return TreeTypes.None; - } - } - - public static bool IsThisAMushroomTree(int i, int j) - { - int x; - int y; - WorldGen.GetTreeBottom(i, j, out x, out y); - return WorldGen.GetTreeType((int) Main.tile[x, y].type) == TreeTypes.Mushroom; - } - - private static void ShakeTree(int i, int j) - { - if (WorldGen.numTreeShakes == WorldGen.maxTreeShakes) - return; - int x; - int y; - WorldGen.GetTreeBottom(i, j, out x, out y); - int index1 = y; - TreeTypes treeType = WorldGen.GetTreeType((int) Main.tile[x, y].type); - if (treeType == TreeTypes.None) - return; - for (int index2 = 0; index2 < WorldGen.numTreeShakes; ++index2) - { - if (WorldGen.treeShakeX[index2] == x && WorldGen.treeShakeY[index2] == y) - return; - } - WorldGen.treeShakeX[WorldGen.numTreeShakes] = x; - WorldGen.treeShakeY[WorldGen.numTreeShakes] = y; - ++WorldGen.numTreeShakes; - --y; - while (y > 10 && Main.tile[x, y].active() && TileID.Sets.IsShakeable[(int) Main.tile[x, y].type]) - --y; - ++y; - if (!WorldGen.IsTileALeafyTreeTop(x, y) || Collision.SolidTiles(x - 2, x + 2, y - 2, y + 2)) - return; - bool flag = false; - if (Main.getGoodWorld && WorldGen.genRand.Next(15) == 0) - Projectile.NewProjectile((float) (x * 16), (float) (y * 16), (float) Main.rand.Next(-100, 101) * (1f / 500f), 0.0f, 28, 0, 0.0f, (int) Player.FindClosest(new Vector2((float) (x * 16), (float) (y * 16)), 16, 16)); - else if (WorldGen.genRand.Next(1000) == 0 && treeType == TreeTypes.Forest) - { - flag = true; - Item.NewItem(x * 16, y * 16, 16, 16, 4366); - } - else if (WorldGen.genRand.Next(7) == 0 && (treeType == TreeTypes.Forest || treeType == TreeTypes.Snow || treeType == TreeTypes.Hallowed)) - { - flag = true; - Item.NewItem(x * 16, y * 16, 16, 16, 27, WorldGen.genRand.Next(1, 3)); - } - else if (WorldGen.genRand.Next(8) == 0 && treeType == TreeTypes.Mushroom) - { - flag = true; - Item.NewItem(x * 16, y * 16, 16, 16, 194, WorldGen.genRand.Next(1, 2)); - } - else if (WorldGen.genRand.Next(35) == 0 && Main.halloween) - { - flag = true; - Item.NewItem(x * 16, y * 16, 16, 16, 1809, WorldGen.genRand.Next(1, 3)); - } - else if (WorldGen.genRand.Next(12) == 0) - { - flag = true; - int dropItem = 0; - WorldGen.KillTile_GetItemDrops(i, j, Main.tile[i, j], out dropItem, out int _, out int _, out int _); - Item.NewItem(x * 16, y * 16, 16, 16, dropItem, WorldGen.genRand.Next(1, 4)); - } - else if (WorldGen.genRand.Next(20) == 0) - { - flag = true; - int Type = 71; - int Stack = WorldGen.genRand.Next(50, 100); - if (WorldGen.genRand.Next(30) == 0) - { - Type = 73; - Stack = 1; - if (WorldGen.genRand.Next(5) == 0) - ++Stack; - if (WorldGen.genRand.Next(10) == 0) - ++Stack; - } - else if (WorldGen.genRand.Next(10) == 0) - { - Type = 72; - Stack = WorldGen.genRand.Next(1, 21); - if (WorldGen.genRand.Next(3) == 0) - Stack += WorldGen.genRand.Next(1, 21); - if (WorldGen.genRand.Next(4) == 0) - Stack += WorldGen.genRand.Next(1, 21); - } - Item.NewItem(x * 16, y * 16, 16, 16, Type, Stack); - } - else if (WorldGen.genRand.Next(15) == 0 && (treeType == TreeTypes.Forest || treeType == TreeTypes.Hallowed)) - { - flag = true; - int Type; - switch (WorldGen.genRand.Next(5)) - { - case 0: - Type = 74; - break; - case 1: - Type = 297; - break; - case 2: - Type = 298; - break; - case 3: - Type = 299; - break; - default: - Type = 538; - break; - } - if ((double) Player.GetClosestRollLuck(x, y, NPC.goldCritterChance) == 0.0) - Type = WorldGen.genRand.Next(2) != 0 ? 539 : 442; - NPC.NewNPC(x * 16, y * 16, Type); - } - else if (WorldGen.genRand.Next(50) == 0 && treeType == TreeTypes.Hallowed && !Main.dayTime) - { - flag = true; - NPC.NewNPC(x * 16, y * 16, (int) Main.rand.NextFromList((short) 583, (short) 584, (short) 585)); - } - else if (WorldGen.genRand.Next(50) == 0 && treeType == TreeTypes.Forest && !Main.dayTime) - { - flag = true; - NPC npc = Main.npc[NPC.NewNPC(x * 16, y * 16, 611)]; - npc.velocity.Y = 1f; - npc.netUpdate = true; - } - else if (WorldGen.genRand.Next(40) == 0 && treeType == TreeTypes.Forest && !Main.dayTime && Main.halloween) - { - flag = true; - NPC.NewNPC(x * 16, y * 16, 301); - } - else if (WorldGen.genRand.Next(50) == 0 && (treeType == TreeTypes.Forest || treeType == TreeTypes.Hallowed)) - { - flag = true; - for (int index3 = 0; index3 < 5; ++index3) - { - Point point = new Point(x + Main.rand.Next(-2, 2), y - 1 + Main.rand.Next(-2, 2)); - int Type; - if ((double) Player.GetClosestRollLuck(x, y, NPC.goldCritterChance) == 0.0) - Type = 442; - else - Type = (int) Main.rand.NextFromList((short) 74, (short) 297, (short) 298); - NPC npc = Main.npc[NPC.NewNPC(point.X * 16, point.Y * 16, Type)]; - npc.velocity = Main.rand.NextVector2CircularEdge(3f, 3f); - npc.netUpdate = true; - } - } - else if (WorldGen.genRand.Next(40) == 0 && treeType == TreeTypes.Jungle) - { - flag = true; - for (int index4 = 0; index4 < 5; ++index4) - { - Point point = new Point(x + Main.rand.Next(-2, 2), y - 1 + Main.rand.Next(-2, 2)); - NPC npc = Main.npc[NPC.NewNPC(point.X * 16, point.Y * 16, (int) Main.rand.NextFromList((short) 210, (short) 211))]; - npc.ai[1] = 65f; - npc.netUpdate = true; - } - } - else if (WorldGen.genRand.Next(20) == 0 && (treeType == TreeTypes.Palm || treeType == TreeTypes.PalmCorrupt || treeType == TreeTypes.PalmCrimson || treeType == TreeTypes.PalmHallowed) && !WorldGen.IsPalmOasisTree(x)) - { - flag = true; - NPC.NewNPC(x * 16, y * 16, 603); - } - else if (WorldGen.genRand.Next(30) == 0 && (treeType == TreeTypes.Crimson || treeType == TreeTypes.PalmCrimson)) - { - flag = true; - NPC.NewNPC(x * 16 + 8, (y - 1) * 16, -22); - } - else if (WorldGen.genRand.Next(30) == 0 && (treeType == TreeTypes.Corrupt || treeType == TreeTypes.PalmCorrupt)) - { - flag = true; - NPC.NewNPC(x * 16 + 8, (y - 1) * 16, -11); - } - else if (WorldGen.genRand.Next(30) == 0 && treeType == TreeTypes.Jungle && !Main.dayTime) - { - flag = true; - NPC.NewNPC(x * 16, y * 16, 51); - } - else if (WorldGen.genRand.Next(40) == 0 && treeType == TreeTypes.Jungle) - { - flag = true; - Projectile.NewProjectile((float) (x * 16 + 8), (float) ((y - 1) * 16), 0.0f, 0.0f, 655, 0, 0.0f, Main.myPlayer); - } - else if (WorldGen.genRand.Next(20) == 0 && (treeType == TreeTypes.Forest || treeType == TreeTypes.Hallowed) && !Main.raining && !NPC.TooWindyForButterflies && Main.dayTime) - { - flag = true; - int Type = 356; - if ((double) Player.GetClosestRollLuck(x, y, NPC.goldCritterChance) == 0.0) - Type = 444; - NPC.NewNPC(x * 16, y * 16, Type); - } - else if (WorldGen.genRand.Next(15) == 0 && treeType == TreeTypes.Forest) - { - flag = true; - int Type; - switch (WorldGen.genRand.Next(5)) - { - case 0: - Type = 4009; - break; - case 1: - Type = 4293; - break; - case 2: - Type = 4282; - break; - case 3: - Type = 4290; - break; - default: - Type = 4291; - break; - } - Item.NewItem(x * 16, y * 16, 16, 16, Type); - } - else if (WorldGen.genRand.Next(15) == 0 && treeType == TreeTypes.Snow) - { - flag = true; - int Type = WorldGen.genRand.Next(2) != 0 ? 4295 : 4286; - Item.NewItem(x * 16, y * 16, 16, 16, Type); - } - else if (WorldGen.genRand.Next(15) == 0 && treeType == TreeTypes.Jungle) - { - flag = true; - int Type = WorldGen.genRand.Next(2) != 0 ? 4292 : 4294; - Item.NewItem(x * 16, y * 16, 16, 16, Type); - } - else if (WorldGen.genRand.Next(15) == 0 && (treeType == TreeTypes.Palm || treeType == TreeTypes.PalmCorrupt || treeType == TreeTypes.PalmCrimson || treeType == TreeTypes.PalmHallowed) && !WorldGen.IsPalmOasisTree(x)) - { - flag = true; - int Type = WorldGen.genRand.Next(2) != 0 ? 4287 : 4283; - Item.NewItem(x * 16, y * 16, 16, 16, Type); - } - else if (WorldGen.genRand.Next(15) == 0 && (treeType == TreeTypes.Corrupt || treeType == TreeTypes.PalmCorrupt)) - { - flag = true; - int Type = WorldGen.genRand.Next(2) != 0 ? 4289 : 4284; - Item.NewItem(x * 16, y * 16, 16, 16, Type); - } - else if (WorldGen.genRand.Next(15) == 0 && (treeType == TreeTypes.Hallowed || treeType == TreeTypes.PalmHallowed)) - { - flag = true; - int Type = WorldGen.genRand.Next(2) != 0 ? 4288 : 4297; - Item.NewItem(x * 16, y * 16, 16, 16, Type); - } - else if (WorldGen.genRand.Next(15) == 0 && (treeType == TreeTypes.Crimson || treeType == TreeTypes.PalmCrimson)) - { - flag = true; - int Type = WorldGen.genRand.Next(2) != 0 ? 4285 : 4296; - Item.NewItem(x * 16, y * 16, 16, 16, Type); - } - if (!flag) - return; - int treeHeight = 0; - int treeFrame = 0; - int passStyle = 0; - WorldGen.GetTreeLeaf(x, Main.tile[x, y], Main.tile[x, index1], ref treeHeight, out treeFrame, out passStyle); - if (Main.netMode == 2) - NetMessage.SendData(112, number: 1, number2: ((float) x), number3: ((float) y), number4: 1f, number5: passStyle); - if (Main.netMode != 0) - return; - WorldGen.TreeGrowFX(x, y, 1, passStyle, true); - } - - private static void GetTreeBottom(int i, int j, out int x, out int y) - { - x = i; - y = j; - Tile tileSafely1 = Framing.GetTileSafely(x, y); - if (tileSafely1.type == (ushort) 323) - { - for (; y < Main.maxTilesY - 50 && (!tileSafely1.active() || tileSafely1.type == (ushort) 323); tileSafely1 = Framing.GetTileSafely(x, y)) - ++y; - } - else - { - int num1 = (int) tileSafely1.frameX / 22; - int num2 = (int) tileSafely1.frameY / 22; - if (num1 == 3 && num2 <= 2) - ++x; - else if (num1 == 4 && num2 >= 3 && num2 <= 5) - --x; - else if (num1 == 1 && num2 >= 6 && num2 <= 8) - --x; - else if (num1 == 2 && num2 >= 6 && num2 <= 8) - ++x; - else if (num1 == 2 && num2 >= 9) - ++x; - else if (num1 == 3 && num2 >= 9) - --x; - for (Tile tileSafely2 = Framing.GetTileSafely(x, y); y < Main.maxTilesY - 50 && (!tileSafely2.active() || TileID.Sets.IsATreeTrunk[(int) tileSafely2.type] || tileSafely2.type == (ushort) 72); tileSafely2 = Framing.GetTileSafely(x, y)) - ++y; - } - } - - private static void AttemptFossilShattering(int i, int j, Tile tileCache, bool fail) - { - if (tileCache.type != (ushort) 404 || Main.netMode == 1 || WorldGen.fossilBreak) - return; - WorldGen.fossilBreak = true; - for (int i1 = i - 1; i1 <= i + 1; ++i1) - { - for (int j1 = j - 1; j1 <= j + 1; ++j1) - { - int maxValue = 15; - if (!WorldGen.SolidTile(i1, j1 + 1)) - maxValue = 4; - else if (i1 == i && j1 == j - 1 && !fail) - maxValue = 4; - if ((i1 != i || j1 != j) && Main.tile[i1, j1].active() && Main.tile[i1, j1].type == (ushort) 404 && WorldGen.genRand.Next(maxValue) == 0) - { - WorldGen.KillTile(i1, j1, noItem: true); - if (Main.netMode == 2) - NetMessage.SendData(17, number2: ((float) i1), number3: ((float) j1)); - } - } - } - WorldGen.fossilBreak = false; - } - public static void KillTile(int i, int j, bool fail = false, bool effectOnly = false, bool noItem = false) { if (i < 0 || j < 0 || i >= Main.maxTilesX || j >= Main.maxTilesY) return; - Tile tileCache = Main.tile[i, j]; - if (tileCache == null) + Tile tile = Main.tile[i, j]; + if (tile == null) { - tileCache = new Tile(); - Main.tile[i, j] = tileCache; + tile = new Tile(); + Main.tile[i, j] = tile; } - if (!tileCache.active()) + if (!tile.active()) return; if (j >= 1 && Main.tile[i, j - 1] == null) Main.tile[i, j - 1] = new Tile(); - int num1 = WorldGen.CheckTileBreakability(i, j); - if (num1 == 1) + if (j >= 1 && Main.tile[i, j - 1].active() && (Main.tile[i, j - 1].type == (ushort) 5 && tile.type != (ushort) 5 || Main.tile[i, j - 1].type == (ushort) 323 && tile.type != (ushort) 323 || TileID.Sets.BasicChest[(int) Main.tile[i, j - 1].type] && !TileID.Sets.BasicChest[(int) tile.type] || Main.tile[i, j - 1].type == (ushort) 323 && tile.type != (ushort) 323 || Main.tile[i, j - 1].type == (ushort) 88 && tile.type != (ushort) 88 || Main.tile[i, j - 1].type == (ushort) 26 && tile.type != (ushort) 26 || Main.tile[i, j - 1].type == (ushort) 72 && tile.type != (ushort) 72)) + { + if (Main.tile[i, j - 1].type == (ushort) 5) + { + if ((Main.tile[i, j - 1].frameX != (short) 66 || Main.tile[i, j - 1].frameY < (short) 0 || Main.tile[i, j - 1].frameY > (short) 44) && (Main.tile[i, j - 1].frameX != (short) 88 || Main.tile[i, j - 1].frameY < (short) 66 || Main.tile[i, j - 1].frameY > (short) 110) && Main.tile[i, j - 1].frameY < (short) 198) + return; + } + else if (Main.tile[i, j - 1].type != (ushort) 323 || Main.tile[i, j - 1].frameX == (short) 66 || Main.tile[i, j - 1].frameX == (short) 220) + return; + } + if (tile.type == (ushort) 10 && tile.frameY >= (short) 594 && tile.frameY <= (short) 646) fail = true; - if (num1 == 2) - return; - if (WorldGen.gen) - noItem = true; + if (tile.type == (ushort) 138) + fail = WorldGen.CheckBoulderChest(i, j); + if (tile.type == (ushort) 235) + { + int frameX = (int) tile.frameX; + int num = i - frameX % 54 / 18; + for (int index = 0; index < 3; ++index) + { + if (Main.tile[num + index, j - 1].active() && (TileID.Sets.BasicChest[(int) Main.tile[num + index, j - 1].type] || TileID.Sets.BasicChestFake[(int) Main.tile[num + index, j - 1].type] || Main.tile[num + index, j - 1].type == (ushort) 88)) + { + fail = true; + break; + } + } + } if (!effectOnly && !WorldGen.stopDrops) { if (!noItem && FixExploitManEaters.SpotProtected(i, j)) return; - if (!WorldGen.gen && !Main.gameMenu) - WorldGen.KillTile_PlaySounds(i, j, fail, tileCache); + if (tile.type == (ushort) sbyte.MaxValue) + Main.PlaySound(SoundID.Item27, i * 16, j * 16); + else if (tile.type == (ushort) 147 || tile.type == (ushort) 224) + { + if (WorldGen.genRand.Next(2) == 0) + Main.PlaySound(SoundID.Item48, i * 16, j * 16); + else + Main.PlaySound(SoundID.Item49, i * 16, j * 16); + } + else if (tile.type == (ushort) 161 || tile.type == (ushort) 163 || tile.type == (ushort) 164 || tile.type == (ushort) 200) + Main.PlaySound(SoundID.Item50, i * 16, j * 16); + else if (tile.type == (ushort) 3 || tile.type == (ushort) 110) + { + Main.PlaySound(6, i * 16, j * 16); + if (tile.frameX == (short) 144) + Item.NewItem(i * 16, j * 16, 16, 16, 5); + } + else if (tile.type == (ushort) 254) + Main.PlaySound(6, i * 16, j * 16); + else if (tile.type == (ushort) 24) + { + Main.PlaySound(6, i * 16, j * 16); + if (tile.frameX == (short) 144) + Item.NewItem(i * 16, j * 16, 16, 16, 60); + } + else if (Main.tileAlch[(int) tile.type] || tile.type == (ushort) 384 || tile.type == (ushort) 227 || tile.type == (ushort) 32 || tile.type == (ushort) 51 || tile.type == (ushort) 52 || tile.type == (ushort) 61 || tile.type == (ushort) 62 || tile.type == (ushort) 69 || tile.type == (ushort) 71 || tile.type == (ushort) 73 || tile.type == (ushort) 74 || tile.type == (ushort) 113 || tile.type == (ushort) 115 || tile.type == (ushort) 184 || tile.type == (ushort) 192 || tile.type == (ushort) 205 || tile.type == (ushort) 233 || tile.type == (ushort) 352 || tile.type == (ushort) 382) + Main.PlaySound(6, i * 16, j * 16); + else if (tile.type == (ushort) 201) + { + Main.PlaySound(6, i * 16, j * 16); + if (tile.frameX == (short) 270) + Item.NewItem(i * 16, j * 16, 16, 16, 2887); + } + else if (tile.type == (ushort) 1 || tile.type == (ushort) 6 || tile.type == (ushort) 7 || tile.type == (ushort) 8 || tile.type == (ushort) 9 || tile.type == (ushort) 22 || tile.type == (ushort) 140 || tile.type == (ushort) 25 || tile.type == (ushort) 37 || tile.type == (ushort) 38 || tile.type == (ushort) 39 || tile.type == (ushort) 41 || tile.type == (ushort) 43 || tile.type == (ushort) 44 || tile.type == (ushort) 45 || tile.type == (ushort) 46 || tile.type == (ushort) 47 || tile.type == (ushort) 48 || tile.type == (ushort) 56 || tile.type == (ushort) 58 || tile.type == (ushort) 63 || tile.type == (ushort) 64 || tile.type == (ushort) 65 || tile.type == (ushort) 66 || tile.type == (ushort) 67 || tile.type == (ushort) 68 || tile.type == (ushort) 75 || tile.type == (ushort) 76 || tile.type == (ushort) 107 || tile.type == (ushort) 108 || tile.type == (ushort) 111 || tile.type == (ushort) 117 || tile.type == (ushort) 118 || tile.type == (ushort) 119 || tile.type == (ushort) 120 || tile.type == (ushort) 121 || tile.type == (ushort) 122 || tile.type == (ushort) 150 || tile.type == (ushort) 151 || tile.type == (ushort) 152 || tile.type == (ushort) 153 || tile.type == (ushort) 154 || tile.type == (ushort) 155 || tile.type == (ushort) 156 || tile.type == (ushort) 160 || tile.type == (ushort) 161 || tile.type == (ushort) 166 || tile.type == (ushort) 167 || tile.type == (ushort) 168 || tile.type == (ushort) 169 || tile.type == (ushort) 175 || tile.type == (ushort) 176 || tile.type == (ushort) 177 || tile.type == (ushort) 203 || tile.type == (ushort) 202 || tile.type == (ushort) 204 || tile.type == (ushort) 206 || tile.type == (ushort) 211 || tile.type == (ushort) 221 || tile.type == (ushort) 222 || tile.type == (ushort) 223 || tile.type == (ushort) 226 || tile.type == (ushort) 248 || tile.type == (ushort) 249 || tile.type == (ushort) 250 || tile.type == (ushort) 272 || tile.type == (ushort) 273 || tile.type == (ushort) 274 || tile.type == (ushort) 284 || tile.type == (ushort) 325 || tile.type == (ushort) 346 || tile.type == (ushort) 347 || tile.type == (ushort) 348 || tile.type == (ushort) 350 || tile.type == (ushort) 367 || tile.type == (ushort) 357 || tile.type == (ushort) 368 || tile.type == (ushort) 369 || tile.type == (ushort) 370 || tile.type == (ushort) 407) + Main.PlaySound(21, i * 16, j * 16); + else if (tile.type == (ushort) 231 || tile.type == (ushort) 195) + Main.PlaySound(4, i * 16, j * 16); + else if (tile.type == (ushort) 26 && tile.frameX >= (short) 54) + Main.PlaySound(4, i * 16, j * 16); + else if (tile.type == (ushort) 314) + Main.PlaySound(SoundID.Item52, i * 16, j * 16); + else if (tile.type >= (ushort) 330 && tile.type <= (ushort) 333) + Main.PlaySound(18, i * 16, j * 16); + else if (tile.type != (ushort) 138) + Main.PlaySound(0, i * 16, j * 16); + if ((tile.type == (ushort) 162 || tile.type == (ushort) 385 || tile.type == (ushort) 129 || tile.type == (ushort) 165 && tile.frameX < (short) 54) && !fail) + Main.PlaySound(SoundID.Item27, i * 16, j * 16); } - if (tileCache.type == (ushort) 128 || tileCache.type == (ushort) 269) + if (tile.type == (ushort) 128 || tile.type == (ushort) 269) { int index1 = i; - int frameX1 = (int) tileCache.frameX; - int frameX2 = (int) tileCache.frameX; + int frameX1 = (int) tile.frameX; + int frameX2 = (int) tile.frameX; while (frameX2 >= 100) frameX2 -= 100; while (frameX2 >= 36) @@ -37800,12 +27297,12 @@ label_296: frameX1 -= 100; ++index2; } - int num2 = (int) Main.tile[index1, j].frameY / 18; - if (num2 == 0) + int num = (int) Main.tile[index1, j].frameY / 18; + if (num == 0) Item.NewItem(i * 16, j * 16, 16, 16, Item.headType[index2]); - if (num2 == 1) + if (num == 1) Item.NewItem(i * 16, j * 16, 16, 16, Item.bodyType[index2]); - if (num2 == 2) + if (num == 2) Item.NewItem(i * 16, j * 16, 16, 16, Item.legType[index2]); int frameX3 = (int) Main.tile[index1, j].frameX; while (frameX3 >= 100) @@ -37813,2279 +27310,1406 @@ label_296: Main.tile[index1, j].frameX = (short) frameX3; } } - if (tileCache.type == (ushort) 334) + if (tile.type == (ushort) 334) { int index = i; - int frameX4 = (int) tileCache.frameX; - int num3 = (int) tileCache.frameX; - int num4 = 0; - while (num3 >= 5000) + int frameX4 = (int) tile.frameX; + int num1 = (int) tile.frameX; + int num2 = 0; + while (num1 >= 5000) { - num3 -= 5000; - ++num4; + num1 -= 5000; + ++num2; } - if (num4 != 0) - num3 = (num4 - 1) * 18; - int num5 = num3 % 54; - if (num5 == 18) + if (num2 != 0) + num1 = (num2 - 1) * 18; + int num3 = num1 % 54; + if (num3 == 18) { frameX4 = (int) Main.tile[i - 1, j].frameX; --index; } - if (num5 == 36) + if (num3 == 36) { frameX4 = (int) Main.tile[i - 2, j].frameX; index -= 2; } if (frameX4 >= 5000) { - int num6 = frameX4 % 5000 - 100; + int num4 = frameX4 % 5000 - 100; int frameX5 = (int) Main.tile[index + 1, j].frameX; int pre = frameX5 < 25000 ? frameX5 - 10000 : frameX5 - 25000; if (Main.netMode != 1) { Item obj = new Item(); - obj.netDefaults(num6); + obj.netDefaults(num4); obj.Prefix(pre); - int number = Item.NewItem(i * 16, j * 16, 16, 16, num6, noBroadcast: true); + int number = Item.NewItem(i * 16, j * 16, 16, 16, num4, noBroadcast: true); obj.position = Main.item[number].position; Main.item[number] = obj; NetMessage.SendData(21, number: number); } - int num7 = (int) Main.tile[index, j].frameX; - int num8 = 0; - while (num7 >= 5000) + int num5 = (int) Main.tile[index, j].frameX; + int num6 = 0; + while (num5 >= 5000) { - num7 -= 5000; - ++num8; + num5 -= 5000; + ++num6; } - if (num8 != 0) - num7 = (num8 - 1) * 18; - Main.tile[index, j].frameX = (short) num7; - Main.tile[index + 1, j].frameX = (short) (num7 + 18); + if (num6 != 0) + num5 = (num6 - 1) * 18; + Main.tile[index, j].frameX = (short) num5; + Main.tile[index + 1, j].frameX = (short) (num5 + 18); } } - if (tileCache.type == (ushort) 395) + if (tile.type == (ushort) 395) { - int key = TEItemFrame.Find(i - (int) tileCache.frameX % 36 / 18, j - (int) tileCache.frameY % 36 / 18); + int key = TEItemFrame.Find(i - (int) tile.frameX % 36 / 18, j - (int) tile.frameY % 36 / 18); if (key != -1 && ((TEItemFrame) TileEntity.ByID[key]).item.stack > 0) { ((TEItemFrame) TileEntity.ByID[key]).DropItem(); if (Main.netMode == 2) return; - Main.LocalPlayer.InterruptItemUsageIfOverTile(395); + Main.blockMouse = true; return; } } - if (tileCache.type == (ushort) 520) - { - int key = TEFoodPlatter.Find(i, j); - if (key != -1 && ((TEFoodPlatter) TileEntity.ByID[key]).item.stack > 0) - { - ((TEFoodPlatter) TileEntity.ByID[key]).DropItem(); - if (Main.netMode == 2) - return; - Main.LocalPlayer.InterruptItemUsageIfOverTile(520); - return; - } - } - if (tileCache.type == (ushort) 471 && TEWeaponsRack.KillTileDropItem(tileCache, i, j) || tileCache.type == (ushort) 470 && WorldGen.CheckTileBreakability2_ShouldTileSurvive(i, j) | fail || tileCache.type == (ushort) 475 && WorldGen.CheckTileBreakability2_ShouldTileSurvive(i, j) | fail) - return; - int tileDustAmount = WorldGen.KillTile_GetTileDustAmount(fail, tileCache); + int tileDustAmount = WorldGen.KillTile_GetTileDustAmount(fail, tile); for (int index = 0; index < tileDustAmount; ++index) - WorldGen.KillTile_MakeTileDust(i, j, tileCache); + WorldGen.KillTile_MakeTileDust(i, j, tile); if (effectOnly) return; - WorldGen.AttemptFossilShattering(i, j, tileCache, fail); if (fail) { - if (Main.netMode != 1 && TileID.Sets.IsShakeable[(int) tileCache.type]) - WorldGen.ShakeTree(i, j); - if (tileCache.type == (ushort) 2 || tileCache.type == (ushort) 23 || tileCache.type == (ushort) 109 || tileCache.type == (ushort) 199 || tileCache.type == (ushort) 477 || tileCache.type == (ushort) 492) - tileCache.type = (ushort) 0; - if (tileCache.type == (ushort) 60 || tileCache.type == (ushort) 70) - tileCache.type = (ushort) 59; - if (Main.tileMoss[(int) tileCache.type]) - tileCache.type = (ushort) 1; - if (TileID.Sets.tileMossBrick[(int) tileCache.type]) - tileCache.type = (ushort) 38; + if (tile.type == (ushort) 2 || tile.type == (ushort) 23 || tile.type == (ushort) 109 || tile.type == (ushort) 199) + tile.type = (ushort) 0; + if (tile.type == (ushort) 60 || tile.type == (ushort) 70) + tile.type = (ushort) 59; + if (Main.tileMoss[(int) tile.type]) + tile.type = (ushort) 1; WorldGen.SquareTileFrame(i, j); } else { - if (Main.getGoodWorld && Main.netMode != 1 && tileCache.type == (ushort) 57) + if (TileID.Sets.BasicChest[(int) tile.type] && Main.netMode != 1) { - for (int index3 = 0; index3 < 8; ++index3) - { - int maxValue = 2; - int i1 = i; - int j1 = j; - if (index3 == 0) - --i1; - else if (index3 == 1) - ++i1; - else if (index3 == 2) - --j1; - else if (index3 == 3) - ++j1; - else if (index3 == 4) - { - --i1; - --j1; - } - else if (index3 == 5) - { - ++i1; - --j1; - } - else if (index3 == 6) - { - --i1; - ++j1; - } - else if (index3 == 7) - { - ++i1; - ++j1; - } - Tile tile = Main.tile[i1, j1]; - if (tile.active() && WorldGen.genRand.Next(maxValue) == 0 && tile.type == (ushort) 57 && !WorldGen.SolidTile(i1, j1 + 1)) - { - WorldGen.KillTile(i1, j1, noItem: true); - int index4 = Projectile.NewProjectile((float) (i1 * 16 + 8), (float) (j1 * 16 + 8), 0.0f, 0.41f, 40, 15, 0.0f, Main.myPlayer); - Main.projectile[index4].netUpdate = true; - } - } + int num = (int) tile.frameX / 18; + int Y = j - (int) tile.frameY / 18; + while (num > 1) + num -= 2; + if (!Chest.DestroyChest(i - num, Y)) + return; } - if (Main.netMode != 1 && tileCache.type >= (ushort) 481 && tileCache.type <= (ushort) 483) + if (tile.type == (ushort) 88 && Main.netMode != 1) { - for (int index = 0; index < 8; ++index) - { - int maxValue = 6; - int i2 = i; - int j2 = j; - if (index == 0) - --i2; - else if (index == 1) - ++i2; - else if (index == 2) - { - --j2; - maxValue /= 2; - } - else if (index == 3) - ++j2; - else if (index == 4) - { - --i2; - --j2; - } - else if (index == 5) - { - ++i2; - --j2; - } - else if (index == 6) - { - --i2; - ++j2; - } - else if (index == 7) - { - ++i2; - ++j2; - } - Tile tile = Main.tile[i2, j2]; - if (tile.active() && WorldGen.genRand.Next(maxValue) == 0 && tile.type >= (ushort) 481 && tile.type <= (ushort) 483) - { - tileCache.active(false); - WorldGen.KillTile(i2, j2, noItem: true); - } - } - int Type = (int) tileCache.type - 481 + 736; - int Damage = 20; - switch (Main.netMode) - { - case 0: - Projectile.NewProjectile((float) (i * 16 + 8), (float) (j * 16 + 8), 0.0f, 0.41f, Type, Damage, 0.0f, Main.myPlayer); - break; - case 2: - int index5 = Projectile.NewProjectile((float) (i * 16 + 8), (float) (j * 16 + 8), 0.0f, 0.41f, Type, Damage, 0.0f, Main.myPlayer); - Main.projectile[index5].netUpdate = true; - break; - } + int num7 = (int) tile.frameX / 18; + int Y = j - (int) tile.frameY / 18; + int num8 = num7 % 3; + if (!Chest.DestroyChest(i - num8, Y)) + return; } - if (WorldGen.CheckTileBreakability2_ShouldTileSurvive(i, j)) - return; - if (tileCache.type == (ushort) 51 && tileCache.wall == (ushort) 62 && WorldGen.genRand.Next(4) != 0) + if (tile.type == (ushort) 51 && tile.wall == (byte) 62 && WorldGen.genRand.Next(4) != 0) noItem = true; if (!noItem && !WorldGen.stopDrops && Main.netMode != 1) { - WorldGen.KillTile_DropBait(i, j, tileCache); - WorldGen.KillTile_DropItems(i, j, tileCache); - } - if (Main.netMode != 2) - AchievementsHelper.NotifyTileDestroyed(Main.player[Main.myPlayer], tileCache.type); - tileCache.active(false); - tileCache.halfBrick(false); - tileCache.frameX = (short) -1; - tileCache.frameY = (short) -1; - tileCache.color((byte) 0); - tileCache.frameNumber((byte) 0); - if (tileCache.type == (ushort) 58 && j > Main.UnderworldLayer) - { - tileCache.lava(true); - tileCache.liquid = (byte) 128; - } - else if (tileCache.type == (ushort) 419) - Wiring.PokeLogicGate(i, j + 1); - else if (TileID.Sets.BlocksWaterDrawingBehindSelf[(int) tileCache.type]) - WorldGen.SquareWallFrame(i, j); - tileCache.type = (ushort) 0; - tileCache.inActive(false); - WorldGen.SquareTileFrame(i, j); - } - } - - private static Player GetPlayerForTile(int x, int y) => Main.player[(int) Player.FindClosest(new Vector2((float) x, (float) y) * 16f, 16, 16)]; - - private static void KillTile_DropItems( - int x, - int y, - Tile tileCache, - bool includeLargeObjectDrops = false) - { - int dropItem; - int dropItemStack; - int secondaryItem; - int secondaryItemStack; - WorldGen.KillTile_GetItemDrops(x, y, tileCache, out dropItem, out dropItemStack, out secondaryItem, out secondaryItemStack, includeLargeObjectDrops); - if (Main.getGoodWorld && !tileCache.active()) - return; - if (dropItem > 0) - { - int i = Item.NewItem(x * 16, y * 16, 16, 16, dropItem, dropItemStack, pfix: -1); - Main.item[i].TryCombiningIntoNearbyItems(i); - } - if (secondaryItem <= 0) - return; - int i1 = Item.NewItem(x * 16, y * 16, 16, 16, secondaryItem, secondaryItemStack, pfix: -1); - Main.item[i1].TryCombiningIntoNearbyItems(i1); - } - - public static void KillTile_GetItemDrops( - int x, - int y, - Tile tileCache, - out int dropItem, - out int dropItemStack, - out int secondaryItem, - out int secondaryItemStack, - bool includeLargeObjectDrops = false) - { - dropItem = 0; - dropItemStack = 1; - secondaryItem = 0; - secondaryItemStack = 1; - if (includeLargeObjectDrops) - { - switch (tileCache.type) - { - case 21: - case 467: - dropItem = WorldGen.GetChestItemDrop(x, y, (int) tileCache.type); - break; - case 88: - int style1 = (int) tileCache.frameX / 54; - dropItem = WorldGen.GetDresserItemDrop(style1); - break; - } - } - switch (tileCache.type) - { - case 0: - case 2: - case 109: - case 199: - case 477: - case 492: - dropItem = 2; - break; - case 1: - dropItem = 3; - break; - case 3: - if (tileCache.frameX == (short) 144) + bool flag1 = false; + int maxValue1 = -1; + int maxValue2 = -1; + int maxValue3 = -1; + if (tile.type == (ushort) 3) { - dropItem = 5; - break; - } - if (!WorldGen.KillTile_ShouldDropSeeds(x, y)) - break; - dropItem = 283; - break; - case 4: - int num1 = (int) tileCache.frameY / 22; - switch (num1) - { - case 0: - dropItem = 8; - return; - case 8: - dropItem = 523; - return; - case 9: - dropItem = 974; - return; - case 10: - dropItem = 1245; - return; - case 11: - dropItem = 1333; - return; - case 12: - dropItem = 2274; - return; - case 13: - dropItem = 3004; - return; - case 14: - dropItem = 3045; - return; - case 15: - dropItem = 3114; - return; - case 16: - dropItem = 4383; - return; - case 17: - dropItem = 4384; - return; - case 18: - dropItem = 4385; - return; - case 19: - dropItem = 4386; - return; - case 20: - dropItem = 4387; - return; - case 21: - dropItem = 4388; - return; - default: - dropItem = 426 + num1; - return; - } - case 5: - case 596: - case 616: - bool bonusWood = false; - WorldGen.KillTile_GetTreeDrops(x, y, tileCache, ref bonusWood, ref dropItem, ref secondaryItem); - if (!bonusWood) - break; - ++dropItemStack; - break; - case 6: - dropItem = 11; - break; - case 7: - dropItem = 12; - break; - case 8: - dropItem = 13; - break; - case 9: - dropItem = 14; - break; - case 13: - switch ((int) tileCache.frameX / 18) - { - case 1: - dropItem = 28; - return; - case 2: - dropItem = 110; - return; - case 3: - dropItem = 350; - return; - case 4: - dropItem = 351; - return; - case 5: - dropItem = 2234; - return; - case 6: - dropItem = 2244; - return; - case 7: - dropItem = 2257; - return; - case 8: - dropItem = 2258; - return; - default: - dropItem = 31; - return; - } - case 19: - int num2 = (int) tileCache.frameY / 18; - switch (num2) - { - case 0: - dropItem = 94; - return; - case 1: - dropItem = 631; - return; - case 2: - dropItem = 632; - return; - case 3: - dropItem = 633; - return; - case 4: - dropItem = 634; - return; - case 5: - dropItem = 913; - return; - case 6: - dropItem = 1384; - return; - case 7: - dropItem = 1385; - return; - case 8: - dropItem = 1386; - return; - case 9: - dropItem = 1387; - return; - case 10: - dropItem = 1388; - return; - case 11: - dropItem = 1389; - return; - case 12: - dropItem = 1418; - return; - case 13: - dropItem = 1457; - return; - case 14: - dropItem = 1702; - return; - case 15: - dropItem = 1796; - return; - case 16: - dropItem = 1818; - return; - case 17: - dropItem = 2518; - return; - case 18: - dropItem = 2549; - return; - case 19: - dropItem = 2566; - return; - case 20: - dropItem = 2581; - return; - case 21: - dropItem = 2627; - return; - case 22: - dropItem = 2628; - return; - case 23: - dropItem = 2629; - return; - case 24: - dropItem = 2630; - return; - case 25: - dropItem = 2744; - return; - case 26: - dropItem = 2822; - return; - case 27: - dropItem = 3144; - return; - case 28: - dropItem = 3146; - return; - case 29: - dropItem = 3145; - return; - default: - if (num2 >= 30 && num2 <= 35) - { - dropItem = 3903 + num2 - 30; - return; - } - switch (num2) - { - case 36: - dropItem = 3945; - return; - case 37: - dropItem = 3957; - return; - case 38: - dropItem = 4159; - return; - case 39: - dropItem = 4180; - return; - case 40: - dropItem = 4201; - return; - case 41: - dropItem = 4222; - return; - case 42: - dropItem = 4311; - return; - case 43: - dropItem = 4416; - return; - case 44: - dropItem = 4580; - return; - default: - return; - } - } - case 22: - dropItem = 56; - break; - case 23: - dropItem = 2; - break; - case 24: - if (tileCache.frameX != (short) 144) - break; - dropItem = 60; - break; - case 25: - dropItem = 61; - break; - case 30: - dropItem = 9; - break; - case 33: - int num3 = (int) tileCache.frameY / 22; - dropItem = 105; - switch (num3) - { - case 1: - dropItem = 1405; - return; - case 2: - dropItem = 1406; - return; - case 3: - dropItem = 1407; - return; - default: - if (num3 >= 4 && num3 <= 13) - { - dropItem = 2045 + num3 - 4; - return; - } - if (num3 >= 14 && num3 <= 16) - { - dropItem = 2153 + num3 - 14; - return; - } - switch (num3) - { - case 17: - dropItem = 2236; - return; - case 18: - dropItem = 2523; - return; - case 19: - dropItem = 2542; - return; - case 20: - dropItem = 2556; - return; - case 21: - dropItem = 2571; - return; - case 22: - dropItem = 2648; - return; - case 23: - dropItem = 2649; - return; - case 24: - dropItem = 2650; - return; - case 25: - dropItem = 2651; - return; - case 26: - dropItem = 2818; - return; - case 27: - dropItem = 3171; - return; - case 28: - dropItem = 3173; - return; - case 29: - dropItem = 3172; - return; - case 30: - dropItem = 3890; - return; - case 31: - dropItem = 3936; - return; - case 32: - dropItem = 3962; - return; - case 33: - dropItem = 4150; - return; - case 34: - dropItem = 4171; - return; - case 35: - dropItem = 4192; - return; - case 36: - dropItem = 4213; - return; - case 37: - dropItem = 4303; - return; - case 38: - dropItem = 4571; - return; - default: - return; - } - } - case 36: - dropItem = 1869; - break; - case 37: - dropItem = 116; - break; - case 38: - dropItem = 129; - break; - case 39: - dropItem = 131; - break; - case 40: - dropItem = 133; - break; - case 41: - dropItem = 134; - break; - case 43: - dropItem = 137; - break; - case 44: - dropItem = 139; - break; - case 45: - dropItem = 141; - break; - case 46: - dropItem = 143; - break; - case 47: - dropItem = 145; - break; - case 48: - dropItem = 147; - break; - case 49: - dropItem = 148; - break; - case 50: - if (tileCache.frameX == (short) 90) - { - dropItem = 165; - break; - } - dropItem = 149; - break; - case 51: - dropItem = 150; - break; - case 52: - case 62: - case 382: - if (Main.rand.Next(2) != 0 || !WorldGen.GetPlayerForTile(x, y).cordage) - break; - dropItem = 2996; - break; - case 53: - dropItem = 169; - break; - case 54: - dropItem = 170; - break; - case 56: - dropItem = 173; - break; - case 57: - dropItem = 172; - break; - case 58: - dropItem = 174; - break; - case 59: - case 60: - dropItem = 176; - break; - case 61: - case 74: - if (tileCache.frameX == (short) 144 && tileCache.type == (ushort) 61) - { - dropItem = 331; - dropItemStack = Main.rand.Next(2, 4); - break; - } - if (tileCache.frameX == (short) 162 && tileCache.type == (ushort) 61) - { - dropItem = 223; - break; - } - if (tileCache.frameX >= (short) 108 && tileCache.frameX <= (short) 126 && tileCache.type == (ushort) 61 && Main.rand.Next(20) == 0) - { - dropItem = 208; - break; - } - if (Main.rand.Next(100) != 0) - break; - dropItem = 195; - break; - case 63: - case 64: - case 65: - case 66: - case 67: - case 68: - dropItem = (int) tileCache.type - 63 + 177; - break; - case 70: - dropItem = 176; - break; - case 71: - case 72: - if (Main.rand.Next(40) == 0) - { - dropItem = 194; - break; - } - if (Main.rand.Next(2) != 0) - break; - dropItem = 183; - break; - case 73: - if (!WorldGen.KillTile_ShouldDropSeeds(x, y)) - break; - dropItem = 283; - break; - case 75: - dropItem = 192; - break; - case 76: - dropItem = 214; - break; - case 78: - dropItem = 222; - break; - case 80: - dropItem = 276; - break; - case 81: - dropItem = 275; - break; - case 83: - case 84: - int style2 = (int) tileCache.frameX / 18; - dropItem = 313 + style2; - int num4 = 307 + style2; - if (style2 == 6) - { - dropItem = 2358; - num4 = 2357; - } - bool flag = WorldGen.IsHarvestableHerbWithSeed((int) tileCache.type, style2); - if (WorldGen.GetPlayerForTile(x, y).HeldItem.type == 213) - { - dropItemStack = Main.rand.Next(1, 3); - secondaryItem = num4; - secondaryItemStack = Main.rand.Next(1, 6); - break; - } - if (!flag) - break; - secondaryItem = num4; - secondaryItemStack = Main.rand.Next(1, 4); - break; - case 107: - dropItem = 364; - break; - case 108: - dropItem = 365; - break; - case 110: - if (tileCache.frameX != (short) 144) - break; - dropItem = 5; - break; - case 111: - dropItem = 366; - break; - case 112: - dropItem = 370; - break; - case 116: - dropItem = 408; - break; - case 117: - dropItem = 409; - break; - case 118: - dropItem = 412; - break; - case 119: - dropItem = 413; - break; - case 120: - dropItem = 414; - break; - case 121: - dropItem = 415; - break; - case 122: - dropItem = 416; - break; - case 123: - dropItem = 424; - break; - case 124: - dropItem = 480; - break; - case 129: - if (tileCache.frameX >= (short) 324) - { - dropItem = 4988; - break; - } - dropItem = 502; - break; - case 130: - dropItem = 511; - break; - case 131: - dropItem = 512; - break; - case 135: - int num5 = (int) tileCache.frameY / 18; - if (num5 == 0) - dropItem = 529; - if (num5 == 1) - dropItem = 541; - if (num5 == 2) - dropItem = 542; - if (num5 == 3) - dropItem = 543; - if (num5 == 4) - dropItem = 852; - if (num5 == 5) - dropItem = 853; - if (num5 != 6) - break; - dropItem = 1151; - break; - case 136: - dropItem = 538; - break; - case 137: - int num6 = (int) tileCache.frameY / 18; - if (num6 == 0) - dropItem = 539; - if (num6 == 1) - dropItem = 1146; - if (num6 == 2) - dropItem = 1147; - if (num6 == 3) - dropItem = 1148; - if (num6 != 4) - break; - dropItem = 1149; - break; - case 140: - dropItem = 577; - break; - case 141: - dropItem = 580; - break; - case 144: - if (tileCache.frameX == (short) 0) - dropItem = 583; - if (tileCache.frameX == (short) 18) - dropItem = 584; - if (tileCache.frameX == (short) 36) - dropItem = 585; - if (tileCache.frameX == (short) 54) - dropItem = 4484; - if (tileCache.frameX != (short) 72) - break; - dropItem = 4485; - break; - case 145: - dropItem = 586; - break; - case 146: - dropItem = 591; - break; - case 147: - dropItem = 593; - break; - case 148: - dropItem = 594; - break; - case 149: - if (tileCache.frameX == (short) 0 || tileCache.frameX == (short) 54) - { - dropItem = 596; - break; - } - if (tileCache.frameX == (short) 18 || tileCache.frameX == (short) 72) - { - dropItem = 597; - break; - } - if (tileCache.frameX != (short) 36 && tileCache.frameX != (short) 90) - break; - dropItem = 598; - break; - case 150: - dropItem = 604; - break; - case 151: - dropItem = 607; - break; - case 152: - dropItem = 609; - break; - case 153: - dropItem = 611; - break; - case 154: - dropItem = 612; - break; - case 155: - dropItem = 613; - break; - case 156: - dropItem = 614; - break; - case 157: - dropItem = 619; - break; - case 158: - dropItem = 620; - break; - case 159: - dropItem = 621; - break; - case 160: - dropItem = 662; - break; - case 161: - dropItem = 664; - break; - case 163: - dropItem = 833; - break; - case 164: - dropItem = 834; - break; - case 166: - dropItem = 699; - break; - case 167: - dropItem = 700; - break; - case 168: - dropItem = 701; - break; - case 169: - dropItem = 702; - break; - case 170: - dropItem = 1872; - break; - case 171: - if (tileCache.frameX < (short) 10) - break; - WorldGen.dropXmasTree(x, y, 0); - WorldGen.dropXmasTree(x, y, 1); - WorldGen.dropXmasTree(x, y, 2); - WorldGen.dropXmasTree(x, y, 3); - break; - case 174: - dropItem = 713; - break; - case 175: - dropItem = 717; - break; - case 176: - dropItem = 718; - break; - case 177: - dropItem = 719; - break; - case 178: - switch ((int) tileCache.frameX / 18) - { - case 0: - dropItem = 181; - return; - case 1: - dropItem = 180; - return; - case 2: - dropItem = 177; - return; - case 3: - dropItem = 179; - return; - case 4: - dropItem = 178; - return; - case 5: - dropItem = 182; - return; - case 6: - dropItem = 999; - return; - default: - return; - } - case 179: - case 180: - case 181: - case 182: - case 183: - case 381: - case 534: - case 536: - case 539: - dropItem = 3; - break; - case 188: - dropItem = 276; - break; - case 189: - dropItem = 751; - break; - case 190: - dropItem = 183; - break; - case 191: - dropItem = 9; - break; - case 193: - dropItem = 762; - break; - case 194: - dropItem = 154; - break; - case 195: - dropItem = 763; - break; - case 196: - dropItem = 765; - break; - case 197: - dropItem = 767; - break; - case 198: - dropItem = 775; - break; - case 200: - dropItem = 835; - break; - case 201: - if (tileCache.frameX != (short) 270) - break; - dropItem = 2887; - break; - case 202: - dropItem = 824; - break; - case 203: - dropItem = 836; - break; - case 204: - dropItem = 880; - break; - case 206: - dropItem = 883; - break; - case 208: - dropItem = 911; - break; - case 210: - dropItem = 937; - break; - case 211: - dropItem = 947; - break; - case 213: - dropItem = 965; - break; - case 214: - dropItem = 85; - break; - case 221: - dropItem = 1104; - break; - case 222: - dropItem = 1105; - break; - case 223: - dropItem = 1106; - break; - case 224: - dropItem = 1103; - break; - case 225: - if (Main.rand.Next(3) == 0) - { - tileCache.honey(true); - tileCache.liquid = byte.MaxValue; - break; - } - dropItem = 1124; - if (Main.netMode == 1 || Main.rand.Next(2) != 0) - break; - int num7 = 1; - if (Main.rand.Next(3) == 0) - num7 = 2; - for (int index1 = 0; index1 < num7; ++index1) - { - int Type = Main.rand.Next(210, 212); - int index2 = NPC.NewNPC(x * 16 + 8, y * 16 + 15, Type, 1); - Main.npc[index2].velocity.X = (float) Main.rand.Next(-200, 201) * (1f / 500f); - Main.npc[index2].velocity.Y = (float) Main.rand.Next(-200, 201) * (1f / 500f); - Main.npc[index2].netUpdate = true; - } - break; - case 226: - dropItem = 1101; - break; - case 227: - int num8 = (int) tileCache.frameX / 34; - dropItem = 1107 + num8; - if (num8 < 8 || num8 > 11) - break; - dropItem = 3385 + num8 - 8; - break; - case 229: - dropItem = 1125; - break; - case 230: - dropItem = 1127; - break; - case 232: - dropItem = 1150; - break; - case 234: - dropItem = 1246; - break; - case 239: - int num9 = (int) tileCache.frameX / 18; - if (num9 == 0) - dropItem = 20; - if (num9 == 1) - dropItem = 703; - if (num9 == 2) - dropItem = 22; - if (num9 == 3) - dropItem = 704; - if (num9 == 4) - dropItem = 21; - if (num9 == 5) - dropItem = 705; - if (num9 == 6) - dropItem = 19; - if (num9 == 7) - dropItem = 706; - if (num9 == 8) - dropItem = 57; - if (num9 == 9) - dropItem = 117; - if (num9 == 10) - dropItem = 175; - if (num9 == 11) - dropItem = 381; - if (num9 == 12) - dropItem = 1184; - if (num9 == 13) - dropItem = 382; - if (num9 == 14) - dropItem = 1191; - if (num9 == 15) - dropItem = 391; - if (num9 == 16) - dropItem = 1198; - if (num9 == 17) - dropItem = 1006; - if (num9 == 18) - dropItem = 1225; - if (num9 == 19) - dropItem = 1257; - if (num9 == 20) - dropItem = 1552; - if (num9 == 21) - dropItem = 3261; - if (num9 != 22) - break; - dropItem = 3467; - break; - case 248: - dropItem = 1589; - break; - case 249: - dropItem = 1591; - break; - case 250: - dropItem = 1593; - break; - case 251: - dropItem = 1725; - break; - case 252: - dropItem = 1727; - break; - case 253: - dropItem = 1729; - break; - case (ushort) byte.MaxValue: - case 256: - case 257: - case 258: - case 259: - case 260: - case 261: - dropItem = 1970 + (int) tileCache.type - (int) byte.MaxValue; - break; - case 262: - case 263: - case 264: - case 265: - case 266: - case 267: - case 268: - dropItem = 1970 + (int) tileCache.type - 262; - break; - case 272: - dropItem = 1344; - break; - case 273: - dropItem = 2119; - break; - case 274: - dropItem = 2120; - break; - case 284: - dropItem = 2173; - break; - case 311: - dropItem = 2260; - break; - case 312: - dropItem = 2261; - break; - case 313: - dropItem = 2262; - break; - case 314: - dropItem = Minecart.GetTrackItem(tileCache); - break; - case 315: - dropItem = 2435; - break; - case 321: - dropItem = 2503; - break; - case 322: - dropItem = 2504; - break; - case 323: - dropItem = 2504; - if (tileCache.frameX <= (short) 132 && tileCache.frameX >= (short) 88) - secondaryItem = 27; - int index3 = x; - int index4 = y; - while (!Main.tile[index3, index4].active() || !Main.tileSolid[(int) Main.tile[index3, index4].type]) - ++index4; - if (!Main.tile[index3, index4].active()) - break; - switch (Main.tile[index3, index4].type) - { - case 112: - dropItem = 619; - return; - case 116: - dropItem = 621; - return; - case 234: - dropItem = 911; - return; - default: - return; - } - case 324: - switch ((int) tileCache.frameY / 22) - { - case 0: - dropItem = 2625; - return; - case 1: - dropItem = 2626; - return; - case 2: - dropItem = 4072; - return; - case 3: - dropItem = 4073; - return; - case 4: - dropItem = 4071; - return; - default: - return; - } - case 325: - dropItem = 2692; - break; - case 326: - dropItem = 2693; - break; - case 327: - dropItem = 2694; - break; - case 328: - dropItem = 2695; - break; - case 329: - dropItem = 2697; - break; - case 330: - dropItem = 71; - break; - case 331: - dropItem = 72; - break; - case 332: - dropItem = 73; - break; - case 333: - dropItem = 74; - break; - case 336: - dropItem = 2701; - break; - case 340: - dropItem = 2751; - break; - case 341: - dropItem = 2752; - break; - case 342: - dropItem = 2753; - break; - case 343: - dropItem = 2754; - break; - case 344: - dropItem = 2755; - break; - case 345: - dropItem = 2787; - break; - case 346: - dropItem = 2792; - break; - case 347: - dropItem = 2793; - break; - case 348: - dropItem = 2794; - break; - case 350: - dropItem = 2860; - break; - case 351: - dropItem = 2868; - break; - case 353: - dropItem = 2996; - break; - case 357: - dropItem = 3066; - break; - case 365: - dropItem = 3077; - break; - case 366: - dropItem = 3078; - break; - case 367: - dropItem = 3081; - break; - case 368: - dropItem = 3086; - break; - case 369: - dropItem = 3087; - break; - case 370: - dropItem = 3100; - break; - case 371: - dropItem = 3113; - break; - case 372: - dropItem = 3117; - break; - case 379: - dropItem = 3214; - break; - case 380: - int num10 = (int) tileCache.frameY / 18; - dropItem = 3215 + num10; - break; - case 383: - dropItem = 620; - break; - case 385: - dropItem = 3234; - break; - case 396: - dropItem = 3271; - break; - case 397: - dropItem = 3272; - break; - case 398: - dropItem = 3274; - break; - case 399: - dropItem = 3275; - break; - case 400: - dropItem = 3276; - break; - case 401: - dropItem = 3277; - break; - case 402: - dropItem = 3338; - break; - case 403: - dropItem = 3339; - break; - case 404: - dropItem = 3347; - break; - case 407: - dropItem = 3380; - break; - case 408: - dropItem = 3460; - break; - case 409: - dropItem = 3461; - break; - case 415: - dropItem = 3573; - break; - case 416: - dropItem = 3574; - break; - case 417: - dropItem = 3575; - break; - case 418: - dropItem = 3576; - break; - case 419: - switch ((int) tileCache.frameX / 18) - { - case 0: - dropItem = 3602; - return; - case 1: - dropItem = 3618; - return; - case 2: - dropItem = 3663; - return; - default: - return; - } - case 420: - switch ((int) tileCache.frameY / 18) - { - case 0: - dropItem = 3603; - return; - case 1: - dropItem = 3604; - return; - case 2: - dropItem = 3605; - return; - case 3: - dropItem = 3606; - return; - case 4: - dropItem = 3607; - return; - case 5: - dropItem = 3608; - return; - default: - return; - } - case 421: - dropItem = 3609; - break; - case 422: - dropItem = 3610; - break; - case 423: - TELogicSensor.Kill(x, y); - switch ((int) tileCache.frameY / 18) - { - case 0: - dropItem = 3613; - return; - case 1: - dropItem = 3614; - return; - case 2: - dropItem = 3615; - return; - case 3: - dropItem = 3726; - return; - case 4: - dropItem = 3727; - return; - case 5: - dropItem = 3728; - return; - case 6: - dropItem = 3729; - return; - default: - return; - } - case 424: - dropItem = 3616; - break; - case 426: - dropItem = 3621; - break; - case 427: - dropItem = 3622; - break; - case 428: - switch ((int) tileCache.frameY / 18) - { - case 0: - dropItem = 3630; - break; - case 1: - dropItem = 3632; - break; - case 2: - dropItem = 3631; - break; - case 3: - dropItem = 3626; - break; - } - PressurePlateHelper.DestroyPlate(new Point(x, y)); - break; - case 429: - dropItem = 3629; - break; - case 430: - dropItem = 3633; - break; - case 431: - dropItem = 3634; - break; - case 432: - dropItem = 3635; - break; - case 433: - dropItem = 3636; - break; - case 434: - dropItem = 3637; - break; - case 435: - dropItem = 3638; - break; - case 436: - dropItem = 3639; - break; - case 437: - dropItem = 3640; - break; - case 438: - dropItem = 3641; - break; - case 439: - dropItem = 3642; - break; - case 442: - dropItem = 3707; - break; - case 445: - dropItem = 3725; - break; - case 446: - dropItem = 3736; - break; - case 447: - dropItem = 3737; - break; - case 448: - dropItem = 3738; - break; - case 449: - dropItem = 3739; - break; - case 450: - dropItem = 3740; - break; - case 451: - dropItem = 3741; - break; - case 458: - dropItem = 3754; - break; - case 459: - dropItem = 3755; - break; - case 460: - dropItem = 3756; - break; - case 472: - dropItem = 3951; - break; - case 473: - dropItem = 3953; - break; - case 474: - dropItem = 3955; - break; - case 476: - dropItem = 4040; - break; - case 478: - dropItem = 4050; - break; - case 479: - dropItem = 4051; - break; - case 494: - dropItem = 4089; - break; - case 495: - dropItem = 4090; - break; - case 496: - dropItem = 4091; - break; - case 498: - dropItem = 4139; - break; - case 500: - dropItem = 4229; - break; - case 501: - dropItem = 4230; - break; - case 502: - dropItem = 4231; - break; - case 503: - dropItem = 4232; - break; - case 507: - dropItem = 4277; - break; - case 508: - dropItem = 4278; - break; - case 512: - case 513: - case 514: - case 515: - case 516: - case 517: - case 535: - case 537: - case 540: - dropItem = 129; - break; - case 519: - if (tileCache.frameY != (short) 90 || WorldGen.genRand.Next(2) != 0) - break; - dropItem = 183; - break; - case 520: - dropItem = 4326; - break; - case 528: - if (WorldGen.genRand.Next(2) != 0) - break; - dropItem = 183; - break; - case 541: - dropItem = 4392; - break; - case 546: - case 557: - dropItem = 4422; - break; - case 561: - dropItem = 4554; - break; - case 562: - dropItem = 4564; - break; - case 563: - dropItem = 4547; - break; - case 566: - dropItem = 999; - break; - case 571: - dropItem = 4564; - dropItemStack = WorldGen.genRand.Next(1, 3); - break; - case 574: - dropItem = 4717; - break; - case 575: - dropItem = 4718; - break; - case 576: - dropItem = 4719; - break; - case 577: - dropItem = 4720; - break; - case 578: - dropItem = 4721; - break; - case 579: - dropItem = 4761; - break; - case 583: - WorldGen.SetGemTreeDrops(180, 4851, tileCache, ref dropItem, ref secondaryItem); - if (dropItem != 3) - break; - dropItemStack = Main.rand.Next(1, 3); - break; - case 584: - WorldGen.SetGemTreeDrops(181, 4852, tileCache, ref dropItem, ref secondaryItem); - if (dropItem != 3) - break; - dropItemStack = Main.rand.Next(1, 3); - break; - case 585: - WorldGen.SetGemTreeDrops(177, 4853, tileCache, ref dropItem, ref secondaryItem); - if (dropItem != 3) - break; - dropItemStack = Main.rand.Next(1, 3); - break; - case 586: - WorldGen.SetGemTreeDrops(179, 4854, tileCache, ref dropItem, ref secondaryItem); - if (dropItem != 3) - break; - dropItemStack = Main.rand.Next(1, 3); - break; - case 587: - WorldGen.SetGemTreeDrops(178, 4855, tileCache, ref dropItem, ref secondaryItem); - if (dropItem != 3) - break; - dropItemStack = Main.rand.Next(1, 3); - break; - case 588: - WorldGen.SetGemTreeDrops(182, 4856, tileCache, ref dropItem, ref secondaryItem); - if (dropItem != 3) - break; - dropItemStack = Main.rand.Next(1, 3); - break; - case 589: - WorldGen.SetGemTreeDrops(999, 4857, tileCache, ref dropItem, ref secondaryItem); - if (dropItem != 3) - break; - dropItemStack = Main.rand.Next(1, 3); - break; - case 593: - dropItem = 4868; - break; - case 618: - dropItem = 4962; - break; - } - } - - private static void SetGemTreeDrops( - int gemType, - int seedType, - Tile tileCache, - ref int dropItem, - ref int secondaryItem) - { - dropItem = Main.rand.Next(10) != 0 ? 3 : gemType; - if (tileCache.frameX < (short) 22 || tileCache.frameY < (short) 198 || Main.rand.Next(2) != 0) - return; - secondaryItem = seedType; - } - - private static void SetVanityTreeDrops(int dropType, Tile tileCache, ref int dropItem) - { - if (Main.rand.Next(2) != 0) - return; - dropItem = dropType; - } - - public static bool IsHarvestableHerbWithSeed(int type, int style) - { - bool flag = false; - if (type == 84) - flag = true; - if (style == 0 && Main.dayTime) - flag = true; - if (style == 1 && !Main.dayTime) - flag = true; - if (style == 3 && !Main.dayTime && (Main.bloodMoon || Main.moonPhase == 0)) - flag = true; - if (style == 4 && (Main.raining || (double) Main.cloudAlpha > 0.0)) - flag = true; - if (style == 5 && !Main.raining && Main.dayTime && Main.time > 40500.0) - flag = true; - return flag; - } - - private static bool KillTile_ShouldDropSeeds(int x, int y) - { - if (Main.rand.Next(2) != 0) - return false; - return WorldGen.GetPlayerForTile(x, y).HasItem(281) || WorldGen.GetPlayerForTile(x, y).HasItem(986); - } - - private static void KillTile_GetTreeDrops( - int i, - int j, - Tile tileCache, - ref bool bonusWood, - ref int dropItem, - ref int secondaryItem) - { - if (tileCache.frameX >= (short) 22 && tileCache.frameY >= (short) 198) - { - if (Main.netMode != 1) - { - if (WorldGen.genRand.Next(2) == 0) - { - int index = j; - while (Main.tile[i, index] != null && (!Main.tile[i, index].active() || !Main.tileSolid[(int) Main.tile[i, index].type] || Main.tileSolidTop[(int) Main.tile[i, index].type])) - ++index; - if (Main.tile[i, index] != null) + maxValue1 = 400; + maxValue2 = 100; + if (tile.frameX >= (short) 108) { - Tile tile = Main.tile[i, index]; - if (tile.type == (ushort) 2 || tile.type == (ushort) 109 || tile.type == (ushort) 477 || tile.type == (ushort) 492 || tile.type == (ushort) 147 || tile.type == (ushort) 199 || tile.type == (ushort) 23) - { - dropItem = 9; - secondaryItem = 27; - } - else - dropItem = 9; + maxValue1 *= 3; + maxValue2 *= 3; } } - else - dropItem = 9; - } - } - else - dropItem = 9; - if (dropItem != 9) - return; - int x; - int y; - WorldGen.GetTreeBottom(i, j, out x, out y); - if (Main.tile[x, y].active()) - { - switch (Main.tile[x, y].type) - { - case 23: - dropItem = 619; - break; - case 60: - dropItem = 620; - break; - case 70: - dropItem = WorldGen.genRand.Next(2) != 0 ? 0 : 183; - break; - case 109: - case 492: - dropItem = 621; - break; - case 147: - dropItem = 2503; - break; - case 199: - dropItem = 911; - break; - } - } - int closest = (int) Player.FindClosest(new Vector2((float) (x * 16), (float) (y * 16)), 16, 16); - int axe = Main.player[closest].inventory[Main.player[closest].selectedItem].axe; - if (WorldGen.genRand.Next(100) >= axe && Main.rand.Next(3) != 0) - return; - bonusWood = true; - } - - private static void KillTile_DropBait(int i, int j, Tile tileCache) - { - int maxValue1 = -1; - int maxValue2 = -1; - int maxValue3 = -1; - int closest = (int) Player.FindClosest(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16); - if (tileCache.type == (ushort) 3) - { - maxValue1 = 400; - maxValue2 = 100; - if (Main.player[closest].flowerBoots && tileCache.frameX >= (short) 108) - { - maxValue1 *= 10000; - maxValue2 *= 10000; - } - } - if (tileCache.type == (ushort) 73) - { - maxValue1 = 200; - maxValue2 = 50; - if (Main.player[closest].flowerBoots && tileCache.frameX >= (short) 108) - { - maxValue1 *= 10000; - maxValue2 *= 10000; - } - } - if (tileCache.type == (ushort) 61) - { - maxValue3 = 80; - if (Main.player[closest].flowerBoots && tileCache.frameX >= (short) 108) - maxValue3 *= 10000; - } - if (tileCache.type == (ushort) 74) - { - maxValue3 = 40; - if (Main.player[closest].flowerBoots && tileCache.frameX >= (short) 108) - maxValue3 *= 10000; - } - if (tileCache.type == (ushort) 62) - maxValue3 = 250; - if (tileCache.type == (ushort) 185) - { - if (tileCache.frameY == (short) 0 && tileCache.frameX < (short) 214) - maxValue1 = 6; - if (tileCache.frameY == (short) 18 && (tileCache.frameX < (short) 214 || tileCache.frameX >= (short) 1368)) - maxValue1 = 6; - } - else if (tileCache.type == (ushort) 186) - { - if (tileCache.frameX >= (short) 378 && tileCache.frameX <= (short) 700) - maxValue1 = 6; - } - else if (tileCache.type == (ushort) 187) - { - if (tileCache.frameX >= (short) 756 && tileCache.frameX <= (short) 916) - maxValue1 = 6; - if (tileCache.frameX <= (short) 322) - maxValue1 = 6; - } - else if (tileCache.type == (ushort) 233) - maxValue3 = 10; - int Type1 = 357; - if (Main.player[closest].ZoneGraveyard) - Type1 = 606; - if (maxValue1 > 0 && NPC.CountNPCS(Type1) < 5 && WorldGen.genRand.Next(maxValue1) == 0) - { - int Type2 = Type1; - if (Type1 == 357 && (double) Player.GetClosestRollLuck(i, j, NPC.goldCritterChance) == 0.0) - Type2 = 448; - int index = NPC.NewNPC(i * 16 + 10, j * 16, Type2); - Main.npc[index].TargetClosest(); - Main.npc[index].velocity.Y = (float) WorldGen.genRand.Next(-50, -21) * 0.1f; - Main.npc[index].velocity.X = (float) WorldGen.genRand.Next(0, 26) * 0.1f * (float) -Main.npc[index].direction; - Main.npc[index].direction *= -1; - Main.npc[index].netUpdate = true; - } - if (maxValue2 > 0 && NPC.CountNPCS(377) < 5 && WorldGen.genRand.Next(maxValue2) == 0) - { - int Type3 = 377; - if ((double) Player.GetClosestRollLuck(i, j, NPC.goldCritterChance) == 0.0) - Type3 = 446; - int index = NPC.NewNPC(i * 16 + 10, j * 16, Type3); - Main.npc[index].TargetClosest(); - Main.npc[index].velocity.Y = (float) WorldGen.genRand.Next(-50, -21) * 0.1f; - Main.npc[index].velocity.X = (float) WorldGen.genRand.Next(0, 26) * 0.1f * (float) -Main.npc[index].direction; - Main.npc[index].direction *= -1; - Main.npc[index].netUpdate = true; - } - if (maxValue3 <= 0 || NPC.CountNPCS(485) + NPC.CountNPCS(486) + NPC.CountNPCS(487) >= 8 || WorldGen.genRand.Next(maxValue3) != 0) - return; - int Type4 = 485; - if (WorldGen.genRand.Next(4) == 0) - Type4 = 486; - if (WorldGen.genRand.Next(12) == 0) - Type4 = 487; - int index1 = NPC.NewNPC(i * 16 + 10, j * 16, Type4); - Main.npc[index1].TargetClosest(); - Main.npc[index1].velocity.Y = (float) WorldGen.genRand.Next(-50, -21) * 0.1f; - Main.npc[index1].velocity.X = (float) WorldGen.genRand.Next(0, 26) * 0.1f * (float) -Main.npc[index1].direction; - Main.npc[index1].direction *= -1; - Main.npc[index1].netUpdate = true; - } - - public static void KillTile_PlaySounds(int i, int j, bool fail, Tile tileCache) - { - if (WorldGen.gen) - return; - int type = (int) tileCache.type; - if (type == (int) sbyte.MaxValue) - SoundEngine.PlaySound(SoundID.Item27, i * 16, j * 16); - else if (type == 147 || type == 224) - { - if (WorldGen.genRand.Next(2) == 0) - SoundEngine.PlaySound(SoundID.Item48, i * 16, j * 16); - else - SoundEngine.PlaySound(SoundID.Item49, i * 16, j * 16); - } - else if (type == 161 || type == 163 || type == 164 || type == 200 || type == 541) - SoundEngine.PlaySound(SoundID.Item50, i * 16, j * 16); - else if (type == 518 || type == 519 || type == 528 || type == 529 || type == 549) - SoundEngine.PlaySound(6, i * 16, j * 16); - else if (type == 530 && tileCache.frameX < (short) 270) - SoundEngine.PlaySound(6, i * 16, j * 16); - else if (type == 3 || type == 110) - { - SoundEngine.PlaySound(6, i * 16, j * 16); - } - else - { - switch (type) - { - case 24: - SoundEngine.PlaySound(6, i * 16, j * 16); - break; - case 254: - SoundEngine.PlaySound(6, i * 16, j * 16); - break; - default: - if (Main.tileAlch[type] || type == 384 || type == 227 || type == 32 || type == 51 || type == 52 || type == 61 || type == 62 || type == 69 || type == 71 || type == 73 || type == 74 || type == 113 || type == 115 || type == 184 || type == 192 || type == 205 || type == 233 || type == 352 || type == 382) + if (tile.type == (ushort) 73) + { + maxValue1 = 200; + maxValue2 = 50; + if (tile.frameX >= (short) 108) { - SoundEngine.PlaySound(6, i * 16, j * 16); - break; + maxValue1 *= 3; + maxValue2 *= 3; } - switch (type) + } + if (tile.type == (ushort) 61) + { + maxValue3 = 80; + if (tile.frameX >= (short) 108) + maxValue3 *= 3; + } + if (tile.type == (ushort) 74) + { + maxValue3 = 40; + if (tile.frameX >= (short) 108) + maxValue3 *= 3; + } + if (tile.type == (ushort) 62) + maxValue3 = 250; + if (tile.type == (ushort) 185) + { + if (tile.frameY == (short) 0 && tile.frameX < (short) 214) + maxValue1 = 6; + if (tile.frameY == (short) 18 && (tile.frameX < (short) 214 || tile.frameX >= (short) 1368)) + maxValue1 = 6; + } + else if (tile.type == (ushort) 186) + { + if (tile.frameX >= (short) 378 && tile.frameX <= (short) 700) + maxValue1 = 6; + } + else if (tile.type == (ushort) 187) + { + if (tile.frameX >= (short) 756 && tile.frameX <= (short) 916) + maxValue1 = 6; + if (tile.frameX <= (short) 322) + maxValue1 = 6; + } + else if (tile.type == (ushort) 233) + maxValue3 = 10; + if (maxValue1 > 0 && NPC.CountNPCS(357) < 5 && WorldGen.genRand.Next(maxValue1) == 0) + { + int Type = 357; + if (WorldGen.genRand.Next(NPC.goldCritterChance) == 0) + Type = 448; + int index = NPC.NewNPC(i * 16 + 10, j * 16, Type); + Main.npc[index].TargetClosest(); + Main.npc[index].velocity.Y = (float) WorldGen.genRand.Next(-50, -21) * 0.1f; + Main.npc[index].velocity.X = (float) WorldGen.genRand.Next(0, 26) * 0.1f * (float) -Main.npc[index].direction; + Main.npc[index].direction *= -1; + Main.npc[index].netUpdate = true; + } + if (maxValue2 > 0 && NPC.CountNPCS(377) < 5 && WorldGen.genRand.Next(maxValue2) == 0) + { + int Type = 377; + if (WorldGen.genRand.Next(NPC.goldCritterChance) == 0) + Type = 446; + int index = NPC.NewNPC(i * 16 + 10, j * 16, Type); + Main.npc[index].TargetClosest(); + Main.npc[index].velocity.Y = (float) WorldGen.genRand.Next(-50, -21) * 0.1f; + Main.npc[index].velocity.X = (float) WorldGen.genRand.Next(0, 26) * 0.1f * (float) -Main.npc[index].direction; + Main.npc[index].direction *= -1; + Main.npc[index].netUpdate = true; + } + if (maxValue3 > 0 && NPC.CountNPCS(485) + NPC.CountNPCS(486) + NPC.CountNPCS(487) < 8 && WorldGen.genRand.Next(maxValue3) == 0) + { + int Type = 485; + if (WorldGen.genRand.Next(4) == 0) + Type = 486; + if (WorldGen.genRand.Next(12) == 0) + Type = 487; + int index = NPC.NewNPC(i * 16 + 10, j * 16, Type); + Main.npc[index].TargetClosest(); + Main.npc[index].velocity.Y = (float) WorldGen.genRand.Next(-50, -21) * 0.1f; + Main.npc[index].velocity.X = (float) WorldGen.genRand.Next(0, 26) * 0.1f * (float) -Main.npc[index].direction; + Main.npc[index].direction *= -1; + Main.npc[index].netUpdate = true; + } + int Type1 = 0; + int Type2 = 0; + if (tile.type == (ushort) 0 || tile.type == (ushort) 2 || tile.type == (ushort) 109) + Type1 = 2; + else if (tile.type == (ushort) 426) + Type1 = 3621; + else if (tile.type == (ushort) 430) + Type1 = 3633; + else if (tile.type == (ushort) 431) + Type1 = 3634; + else if (tile.type == (ushort) 432) + Type1 = 3635; + else if (tile.type == (ushort) 433) + Type1 = 3636; + else if (tile.type == (ushort) 434) + Type1 = 3637; + else if (tile.type == (ushort) 427) + Type1 = 3622; + else if (tile.type == (ushort) 435) + Type1 = 3638; + else if (tile.type == (ushort) 436) + Type1 = 3639; + else if (tile.type == (ushort) 437) + Type1 = 3640; + else if (tile.type == (ushort) 438) + Type1 = 3641; + else if (tile.type == (ushort) 439) + Type1 = 3642; + else if (tile.type == (ushort) 446) + Type1 = 3736; + else if (tile.type == (ushort) 447) + Type1 = 3737; + else if (tile.type == (ushort) 448) + Type1 = 3738; + else if (tile.type == (ushort) 449) + Type1 = 3739; + else if (tile.type == (ushort) 450) + Type1 = 3740; + else if (tile.type == (ushort) 451) + Type1 = 3741; + else if (tile.type == (ushort) 368) + Type1 = 3086; + else if (tile.type == (ushort) 369) + Type1 = 3087; + else if (tile.type == (ushort) 367) + Type1 = 3081; + else if (tile.type == (ushort) 379) + Type1 = 3214; + else if (tile.type == (ushort) 353) + Type1 = 2996; + else if (tile.type == (ushort) 365) + Type1 = 3077; + else if (tile.type == (ushort) 366) + Type1 = 3078; + else if ((tile.type == (ushort) 52 || tile.type == (ushort) 62) && WorldGen.genRand.Next(2) == 0 && Main.player[(int) Player.FindClosest(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16)].cordage) + Type1 = 2996; + else if (tile.type == (ushort) 357) + Type1 = 3066; + else if (tile.type == (ushort) 1) + Type1 = 3; + else if (tile.type == (ushort) 3 || tile.type == (ushort) 73) + { + if (WorldGen.genRand.Next(2) == 0 && (Main.player[(int) Player.FindClosest(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16)].HasItem(281) || Main.player[(int) Player.FindClosest(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16)].HasItem(986))) + Type1 = 283; + } + else if (tile.type == (ushort) 227) + { + int num = (int) tile.frameX / 34; + Type1 = 1107 + num; + if (num >= 8 && num <= 11) + Type1 = 3385 + num - 8; + } + else if (tile.type == (ushort) 4) + { + int num = (int) tile.frameY / 22; + switch (num) { - case 201: - SoundEngine.PlaySound(6, i * 16, j * 16); + case 0: + Type1 = 8; break; - case 485: - SoundEngine.PlaySound(4, i * 16, j * 16, 11); + case 8: + Type1 = 523; + break; + case 9: + Type1 = 974; + break; + case 10: + Type1 = 1245; + break; + case 11: + Type1 = 1333; + break; + case 12: + Type1 = 2274; + break; + case 13: + Type1 = 3004; + break; + case 14: + Type1 = 3045; + break; + case 15: + Type1 = 3114; break; default: - if (type == 481 || type == 482 || type == 483) + Type1 = 426 + num; + break; + } + } + else if (tile.type == (ushort) 239) + { + int num = (int) tile.frameX / 18; + if (num == 0) + Type1 = 20; + if (num == 1) + Type1 = 703; + if (num == 2) + Type1 = 22; + if (num == 3) + Type1 = 704; + if (num == 4) + Type1 = 21; + if (num == 5) + Type1 = 705; + if (num == 6) + Type1 = 19; + if (num == 7) + Type1 = 706; + if (num == 8) + Type1 = 57; + if (num == 9) + Type1 = 117; + if (num == 10) + Type1 = 175; + if (num == 11) + Type1 = 381; + if (num == 12) + Type1 = 1184; + if (num == 13) + Type1 = 382; + if (num == 14) + Type1 = 1191; + if (num == 15) + Type1 = 391; + if (num == 16) + Type1 = 1198; + if (num == 17) + Type1 = 1006; + if (num == 18) + Type1 = 1225; + if (num == 19) + Type1 = 1257; + if (num == 20) + Type1 = 1552; + if (num == 21) + Type1 = 3261; + if (num == 22) + Type1 = 3467; + } + else if (tile.type == (ushort) 380) + Type1 = 3215 + (int) tile.frameY / 18; + else if (tile.type == (ushort) 442) + Type1 = 3707; + else if (tile.type == (ushort) 383) + Type1 = 620; + else if (tile.type == (ushort) 315) + Type1 = 2435; + else if (tile.type == (ushort) 330) + Type1 = 71; + else if (tile.type == (ushort) 331) + Type1 = 72; + else if (tile.type == (ushort) 332) + Type1 = 73; + else if (tile.type == (ushort) 333) + Type1 = 74; + else if (tile.type == (ushort) 5) + { + if (tile.frameX >= (short) 22 && tile.frameY >= (short) 198) + { + if (Main.netMode != 1) + { + if (WorldGen.genRand.Next(2) == 0) { - SoundEngine.PlaySound(SoundID.Item127, i * 16, j * 16); + int index = j; + while (Main.tile[i, index] != null && (!Main.tile[i, index].active() || !Main.tileSolid[(int) Main.tile[i, index].type] || Main.tileSolidTop[(int) Main.tile[i, index].type])) + ++index; + if (Main.tile[i, index] != null) + { + if (Main.tile[i, index].type == (ushort) 2 || Main.tile[i, index].type == (ushort) 109 || Main.tile[i, index].type == (ushort) 147 || Main.tile[i, index].type == (ushort) 199 || Main.tile[i, index].type == (ushort) 23) + { + Type1 = 9; + Type2 = 27; + } + else + Type1 = 9; + } + } + else + Type1 = 9; + } + } + else + Type1 = 9; + if (Type1 == 9) + { + int index3 = i; + int index4 = j; + if (tile.frameX == (short) 66 && tile.frameY <= (short) 45) + ++index3; + if (tile.frameX == (short) 88 && tile.frameY >= (short) 66 && tile.frameY <= (short) 110) + --index3; + if (tile.frameX == (short) 22 && tile.frameY >= (short) 132 && tile.frameY <= (short) 176) + --index3; + if (tile.frameX == (short) 44 && tile.frameY >= (short) 132 && tile.frameY <= (short) 176) + ++index3; + if (tile.frameX == (short) 44 && tile.frameY >= (short) 198) + ++index3; + if (tile.frameX == (short) 66 && tile.frameY >= (short) 198) + --index3; + while (!Main.tile[index3, index4].active() || !Main.tileSolid[(int) Main.tile[index3, index4].type]) + ++index4; + if (Main.tile[index3, index4].active()) + { + switch (Main.tile[index3, index4].type) + { + case 23: + Type1 = 619; + break; + case 60: + Type1 = 620; + break; + case 70: + Type1 = 183; + break; + case 109: + Type1 = 621; + break; + case 147: + Type1 = 2503; + break; + case 199: + Type1 = 911; + break; + } + } + int closest = (int) Player.FindClosest(new Vector2((float) (index3 * 16), (float) (index4 * 16)), 16, 16); + int axe = Main.player[closest].inventory[Main.player[closest].selectedItem].axe; + if (WorldGen.genRand.Next(100) < axe || Main.rand.Next(3) == 0) + flag1 = true; + } + } + else if (tile.type == (ushort) 323) + { + Type1 = 2504; + if (tile.frameX <= (short) 132 && tile.frameX >= (short) 88) + Type2 = 27; + int index5 = i; + int index6 = j; + while (!Main.tile[index5, index6].active() || !Main.tileSolid[(int) Main.tile[index5, index6].type]) + ++index6; + if (Main.tile[index5, index6].active()) + { + switch (Main.tile[index5, index6].type) + { + case 112: + Type1 = 619; + break; + case 116: + Type1 = 621; + break; + case 234: + Type1 = 911; + break; + } + } + } + else if (tile.type == (ushort) 408) + Type1 = 3460; + else if (tile.type == (ushort) 409) + Type1 = 3461; + else if (tile.type == (ushort) 415) + Type1 = 3573; + else if (tile.type == (ushort) 416) + Type1 = 3574; + else if (tile.type == (ushort) 417) + Type1 = 3575; + else if (tile.type == (ushort) 418) + Type1 = 3576; + else if (tile.type >= (ushort) byte.MaxValue && tile.type <= (ushort) 261) + Type1 = 1970 + (int) tile.type - (int) byte.MaxValue; + else if (tile.type >= (ushort) 262 && tile.type <= (ushort) 268) + Type1 = 1970 + (int) tile.type - 262; + else if (tile.type == (ushort) 171) + { + if (tile.frameX >= (short) 10) + { + WorldGen.dropXmasTree(i, j, 0); + WorldGen.dropXmasTree(i, j, 1); + WorldGen.dropXmasTree(i, j, 2); + WorldGen.dropXmasTree(i, j, 3); + } + } + else if (tile.type == (ushort) 324) + { + switch ((int) tile.frameY / 22) + { + case 0: + Type1 = 2625; + break; + case 1: + Type1 = 2626; + break; + } + } + else if (tile.type == (ushort) 421) + Type1 = 3609; + else if (tile.type == (ushort) 422) + Type1 = 3610; + else if (tile.type == (ushort) 419) + { + switch ((int) tile.frameX / 18) + { + case 0: + Type1 = 3602; + break; + case 1: + Type1 = 3618; + break; + case 2: + Type1 = 3663; + break; + } + } + else if (tile.type == (ushort) 428) + { + switch ((int) tile.frameY / 18) + { + case 0: + Type1 = 3630; + break; + case 1: + Type1 = 3632; + break; + case 2: + Type1 = 3631; + break; + case 3: + Type1 = 3626; + break; + } + PressurePlateHelper.DestroyPlate(new Point(i, j)); + } + else if (tile.type == (ushort) 420) + { + switch ((int) tile.frameY / 18) + { + case 0: + Type1 = 3603; + break; + case 1: + Type1 = 3604; + break; + case 2: + Type1 = 3605; + break; + case 3: + Type1 = 3606; + break; + case 4: + Type1 = 3607; + break; + case 5: + Type1 = 3608; + break; + } + } + else if (tile.type == (ushort) 423) + { + TELogicSensor.Kill(i, j); + switch ((int) tile.frameY / 18) + { + case 0: + Type1 = 3613; + break; + case 1: + Type1 = 3614; + break; + case 2: + Type1 = 3615; + break; + case 3: + Type1 = 3726; + break; + case 4: + Type1 = 3727; + break; + case 5: + Type1 = 3728; + break; + case 6: + Type1 = 3729; + break; + } + } + else if (tile.type == (ushort) 424) + Type1 = 3616; + else if (tile.type == (ushort) 445) + Type1 = 3725; + else if (tile.type == (ushort) 429) + Type1 = 3629; + else if (tile.type == (ushort) 272) + Type1 = 1344; + else if (tile.type == (ushort) 273) + Type1 = 2119; + else if (tile.type == (ushort) 274) + Type1 = 2120; + else if (tile.type == (ushort) 460) + Type1 = 3756; + else if (tile.type == (ushort) 326) + { + Type1 = 2693; + Main.PlaySound(13, i * 16, j * 16); + } + else if (tile.type == (ushort) 327) + { + Type1 = 2694; + Main.PlaySound(13, i * 16, j * 16); + } + else if (tile.type == (ushort) 458) + { + Type1 = 3754; + Main.PlaySound(13, i * 16, j * 16); + } + else if (tile.type == (ushort) 459) + { + Type1 = 3755; + Main.PlaySound(13, i * 16, j * 16); + } + else if (tile.type == (ushort) 345) + { + Type1 = 2787; + Main.PlaySound(13, i * 16, j * 16); + } + else if (tile.type == (ushort) 328) + { + Type1 = 2695; + Main.PlaySound(13, i * 16, j * 16); + } + else if (tile.type == (ushort) 329) + { + Type1 = 2697; + Main.PlaySound(13, i * 16, j * 16); + } + else if (tile.type == (ushort) 346) + Type1 = 2792; + else if (tile.type == (ushort) 347) + Type1 = 2793; + else if (tile.type == (ushort) 348) + Type1 = 2794; + else if (tile.type == (ushort) 350) + Type1 = 2860; + else if (tile.type == (ushort) 336) + Type1 = 2701; + else if (tile.type == (ushort) 340) + Type1 = 2751; + else if (tile.type == (ushort) 341) + Type1 = 2752; + else if (tile.type == (ushort) 342) + Type1 = 2753; + else if (tile.type == (ushort) 343) + Type1 = 2754; + else if (tile.type == (ushort) 344) + Type1 = 2755; + else if (tile.type == (ushort) 351) + Type1 = 2868; + else if (tile.type == (ushort) 251) + Type1 = 1725; + else if (tile.type == (ushort) 252) + Type1 = 1727; + else if (tile.type == (ushort) 253) + Type1 = 1729; + else if (tile.type == (ushort) 325) + Type1 = 2692; + else if (tile.type == (ushort) 370) + Type1 = 3100; + else if (tile.type == (ushort) 396) + Type1 = 3271; + else if (tile.type == (ushort) 400) + Type1 = 3276; + else if (tile.type == (ushort) 401) + Type1 = 3277; + else if (tile.type == (ushort) 403) + Type1 = 3339; + else if (tile.type == (ushort) 397) + Type1 = 3272; + else if (tile.type == (ushort) 398) + Type1 = 3274; + else if (tile.type == (ushort) 399) + Type1 = 3275; + else if (tile.type == (ushort) 402) + Type1 = 3338; + else if (tile.type == (ushort) 404) + Type1 = 3347; + else if (tile.type == (ushort) 407) + Type1 = 3380; + else if (tile.type == (ushort) 170) + Type1 = 1872; + else if (tile.type == (ushort) 284) + Type1 = 2173; + else if (tile.type == (ushort) 214) + Type1 = 85; + else if (tile.type == (ushort) 213) + Type1 = 965; + else if (tile.type == (ushort) 211) + Type1 = 947; + else if (tile.type == (ushort) 6) + Type1 = 11; + else if (tile.type == (ushort) 7) + Type1 = 12; + else if (tile.type == (ushort) 8) + Type1 = 13; + else if (tile.type == (ushort) 9) + Type1 = 14; + else if (tile.type == (ushort) 202) + Type1 = 824; + else if (tile.type == (ushort) 234) + Type1 = 1246; + else if (tile.type == (ushort) 226) + Type1 = 1101; + else if (tile.type == (ushort) 224) + Type1 = 1103; + else if (tile.type == (ushort) 36) + Type1 = 1869; + else if (tile.type == (ushort) 311) + Type1 = 2260; + else if (tile.type == (ushort) 312) + Type1 = 2261; + else if (tile.type == (ushort) 313) + Type1 = 2262; + else if (tile.type == (ushort) 229) + Type1 = 1125; + else if (tile.type == (ushort) 230) + Type1 = 1127; + else if (tile.type == (ushort) 225) + { + if (WorldGen.genRand.Next(3) == 0) + { + tile.honey(true); + tile.liquid = byte.MaxValue; + } + else + { + Type1 = 1124; + if (Main.netMode != 1 && WorldGen.genRand.Next(2) == 0) + { + int num = 1; + if (WorldGen.genRand.Next(3) == 0) + num = 2; + for (int index7 = 0; index7 < num; ++index7) + { + int Type3 = WorldGen.genRand.Next(210, 212); + int index8 = NPC.NewNPC(i * 16 + 8, j * 16 + 15, Type3, 1); + Main.npc[index8].velocity.X = (float) WorldGen.genRand.Next(-200, 201) * (1f / 500f); + Main.npc[index8].velocity.Y = (float) WorldGen.genRand.Next(-200, 201) * (1f / 500f); + Main.npc[index8].netUpdate = true; + } + } + } + } + else if (tile.type == (ushort) 221) + Type1 = 1104; + else if (tile.type == (ushort) 222) + Type1 = 1105; + else if (tile.type == (ushort) 223) + Type1 = 1106; + else if (tile.type == (ushort) 248) + Type1 = 1589; + else if (tile.type == (ushort) 249) + Type1 = 1591; + else if (tile.type == (ushort) 250) + Type1 = 1593; + else if (tile.type == (ushort) 191) + Type1 = 9; + else if (tile.type == (ushort) 203) + Type1 = 836; + else if (tile.type == (ushort) 204) + Type1 = 880; + else if (tile.type == (ushort) 166) + Type1 = 699; + else if (tile.type == (ushort) 167) + Type1 = 700; + else if (tile.type == (ushort) 168) + Type1 = 701; + else if (tile.type == (ushort) 169) + Type1 = 702; + else if (tile.type == (ushort) 123) + Type1 = 424; + else if (tile.type == (ushort) 124) + Type1 = 480; + else if (tile.type == (ushort) 157) + Type1 = 619; + else if (tile.type == (ushort) 158) + Type1 = 620; + else if (tile.type == (ushort) 159) + Type1 = 621; + else if (tile.type == (ushort) 161) + Type1 = 664; + else if (tile.type == (ushort) 206) + Type1 = 883; + else if (tile.type == (ushort) 232) + Type1 = 1150; + else if (tile.type == (ushort) 198) + Type1 = 775; + else if (tile.type == (ushort) 314) + Type1 = Minecart.GetTrackItem(tile); + else if (tile.type == (ushort) 189) + Type1 = 751; + else if (tile.type == (ushort) 195) + Type1 = 763; + else if (tile.type == (ushort) 194) + Type1 = 766; + else if (tile.type == (ushort) 193) + Type1 = 762; + else if (tile.type == (ushort) 196) + Type1 = 765; + else if (tile.type == (ushort) 197) + Type1 = 767; + else if (tile.type == (ushort) 178) + { + switch ((int) tile.frameX / 18) + { + case 0: + Type1 = 181; + break; + case 1: + Type1 = 180; + break; + case 2: + Type1 = 177; + break; + case 3: + Type1 = 179; + break; + case 4: + Type1 = 178; + break; + case 5: + Type1 = 182; + break; + case 6: + Type1 = 999; + break; + } + } + else if (tile.type == (ushort) 149) + { + if (tile.frameX == (short) 0 || tile.frameX == (short) 54) + Type1 = 596; + else if (tile.frameX == (short) 18 || tile.frameX == (short) 72) + Type1 = 597; + else if (tile.frameX == (short) 36 || tile.frameX == (short) 90) + Type1 = 598; + } + else if (tile.type == (ushort) 13) + { + Main.PlaySound(13, i * 16, j * 16); + switch ((int) tile.frameX / 18) + { + case 1: + Type1 = 28; + break; + case 2: + Type1 = 110; + break; + case 3: + Type1 = 350; + break; + case 4: + Type1 = 351; + break; + case 5: + Type1 = 2234; + break; + case 6: + Type1 = 2244; + break; + case 7: + Type1 = 2257; + break; + case 8: + Type1 = 2258; + break; + default: + Type1 = 31; + break; + } + } + else if (tile.type == (ushort) 19) + { + int num = (int) tile.frameY / 18; + switch (num) + { + case 0: + Type1 = 94; + break; + case 1: + Type1 = 631; + break; + case 2: + Type1 = 632; + break; + case 3: + Type1 = 633; + break; + case 4: + Type1 = 634; + break; + case 5: + Type1 = 913; + break; + case 6: + Type1 = 1384; + break; + case 7: + Type1 = 1385; + break; + case 8: + Type1 = 1386; + break; + case 9: + Type1 = 1387; + break; + case 10: + Type1 = 1388; + break; + case 11: + Type1 = 1389; + break; + case 12: + Type1 = 1418; + break; + case 13: + Type1 = 1457; + break; + case 14: + Type1 = 1702; + break; + case 15: + Type1 = 1796; + break; + case 16: + Type1 = 1818; + break; + case 17: + Type1 = 2518; + break; + case 18: + Type1 = 2549; + break; + case 19: + Type1 = 2566; + break; + case 20: + Type1 = 2581; + break; + case 21: + Type1 = 2627; + break; + case 22: + Type1 = 2628; + break; + case 23: + Type1 = 2629; + break; + case 24: + Type1 = 2630; + break; + case 25: + Type1 = 2744; + break; + case 26: + Type1 = 2822; + break; + case 27: + Type1 = 3144; + break; + case 28: + Type1 = 3146; + break; + case 29: + Type1 = 3145; + break; + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + Type1 = 3903 + num - 30; + break; + } + } + else if (tile.type == (ushort) 22) + Type1 = 56; + else if (tile.type == (ushort) 140) + Type1 = 577; + else if (tile.type == (ushort) 23) + Type1 = 2; + else if (tile.type == (ushort) 25) + Type1 = 61; + else if (tile.type == (ushort) 30) + Type1 = 9; + else if (tile.type == (ushort) 191) + Type1 = 9; + else if (tile.type == (ushort) 208) + Type1 = 911; + else if (tile.type == (ushort) 33) + { + int num = (int) tile.frameY / 22; + Type1 = 105; + switch (num) + { + case 1: + Type1 = 1405; + break; + case 2: + Type1 = 1406; + break; + case 3: + Type1 = 1407; + break; + default: + if (num >= 4 && num <= 13) + { + Type1 = 2045 + num - 4; break; } - if (type == 1 || type == 6 || type == 7 || type == 8 || type == 9 || type == 22 || type == 140 || type == 25 || type == 37 || type == 38 || type == 39 || type == 41 || type == 43 || type == 44 || type == 45 || type == 46 || type == 47 || type == 48 || type == 56 || type == 58 || type == 63 || type == 64 || type == 65 || type == 66 || type == 67 || type == 68 || type == 75 || type == 76 || type == 107 || type == 108 || type == 111 || type == 117 || type == 118 || type == 119 || type == 120 || type == 121 || type == 122 || type == 150 || type == 151 || type == 152 || type == 153 || type == 154 || type == 155 || type == 156 || type == 160 || type == 161 || type == 166 || type == 167 || type == 168 || type == 169 || type == 175 || type == 176 || type == 177 || type == 203 || type == 202 || type == 204 || type == 206 || type == 211 || type == 221 || type == 222 || type == 223 || type == 226 || type == 248 || type == 249 || type == 250 || type == 272 || type == 273 || type == 274 || type == 478 || type == 284 || type == 325 || type == 346 || type == 347 || type == 348 || type == 350 || type == 367 || type == 357 || type == 368 || type == 369 || type == 370 || type == 407 || type == 472 || type == 473 || type == 500 || type == 501 || type == 502 || type == 503 || type == 546 || type == 557 || type == 566 || type == 618) + if (num >= 14 && num <= 16) { - SoundEngine.PlaySound(21, i * 16, j * 16); + Type1 = 2153 + num - 14; break; } - if (type == 231 || type == 195 || type == 474) + switch (num) { - SoundEngine.PlaySound(4, i * 16, j * 16); - break; - } - if (type == 26 && tileCache.frameX >= (short) 54) - { - SoundEngine.PlaySound(4, i * 16, j * 16); - break; - } - if (type == 314) - { - SoundEngine.PlaySound(SoundID.Item52, i * 16, j * 16); - break; - } - if (type >= 330 && type <= 333) - { - SoundEngine.PlaySound(18, i * 16, j * 16); - break; - } - if ((type == 162 || type == 385 || type == 129 || type == 165 && tileCache.frameX < (short) 54) && !fail) - { - SoundEngine.PlaySound(SoundID.Item27, i * 16, j * 16); - break; - } - if (type != 138) - { - SoundEngine.PlaySound(0, i * 16, j * 16); - break; + case 17: + Type1 = 2236; + break; + case 18: + Type1 = 2523; + break; + case 19: + Type1 = 2542; + break; + case 20: + Type1 = 2556; + break; + case 21: + Type1 = 2571; + break; + case 22: + Type1 = 2648; + break; + case 23: + Type1 = 2649; + break; + case 24: + Type1 = 2650; + break; + case 25: + Type1 = 2651; + break; + case 26: + Type1 = 2818; + break; + case 27: + Type1 = 3171; + break; + case 28: + Type1 = 3173; + break; + case 29: + Type1 = 3172; + break; + case 30: + Type1 = 3890; + break; } break; } - break; + } + else if (tile.type == (ushort) 372) + Type1 = 3117; + else if (tile.type == (ushort) 371) + Type1 = 3113; + else if (tile.type == (ushort) 174) + Type1 = 713; + else if (tile.type == (ushort) 37) + Type1 = 116; + else if (tile.type == (ushort) 38) + Type1 = 129; + else if (tile.type == (ushort) 39) + Type1 = 131; + else if (tile.type == (ushort) 40) + Type1 = 133; + else if (tile.type == (ushort) 41) + Type1 = 134; + else if (tile.type == (ushort) 43) + Type1 = 137; + else if (tile.type == (ushort) 44) + Type1 = 139; + else if (tile.type == (ushort) 45) + Type1 = 141; + else if (tile.type == (ushort) 46) + Type1 = 143; + else if (tile.type == (ushort) 47) + Type1 = 145; + else if (tile.type == (ushort) 48) + Type1 = 147; + else if (tile.type == (ushort) 49) + Type1 = 148; + else if (tile.type == (ushort) 51) + Type1 = 150; + else if (tile.type == (ushort) 53) + Type1 = 169; + else if (tile.type == (ushort) 151) + Type1 = 607; + else if (tile.type == (ushort) 152) + Type1 = 609; + else if (tile.type == (ushort) 54) + { + Type1 = 170; + Main.PlaySound(13, i * 16, j * 16); + } + else if (tile.type == (ushort) 56) + Type1 = 173; + else if (tile.type == (ushort) 57) + Type1 = 172; + else if (tile.type == (ushort) 58) + Type1 = 174; + else if (tile.type == (ushort) 60) + Type1 = 176; + else if (tile.type == (ushort) 70) + Type1 = 176; + else if (tile.type == (ushort) 75) + Type1 = 192; + else if (tile.type == (ushort) 76) + Type1 = 214; + else if (tile.type == (ushort) 78) + Type1 = 222; + else if (tile.type == (ushort) 81) + Type1 = 275; + else if (tile.type == (ushort) 80) + Type1 = 276; + else if (tile.type == (ushort) 188) + Type1 = 276; + else if (tile.type == (ushort) 107) + Type1 = 364; + else if (tile.type == (ushort) 108) + Type1 = 365; + else if (tile.type == (ushort) 111) + Type1 = 366; + else if (tile.type == (ushort) 150) + Type1 = 604; + else if (tile.type == (ushort) 112) + Type1 = 370; + else if (tile.type == (ushort) 116) + Type1 = 408; + else if (tile.type == (ushort) 117) + Type1 = 409; + else if (tile.type == (ushort) 129) + Type1 = 502; + else if (tile.type == (ushort) 118) + Type1 = 412; + else if (tile.type == (ushort) 119) + Type1 = 413; + else if (tile.type == (ushort) 120) + Type1 = 414; + else if (tile.type == (ushort) 121) + Type1 = 415; + else if (tile.type == (ushort) 122) + Type1 = 416; + else if (tile.type == (ushort) 136) + Type1 = 538; + else if (tile.type == (ushort) 385) + Type1 = 3234; + else if (tile.type == (ushort) 137) + { + int num = (int) tile.frameY / 18; + if (num == 0) + Type1 = 539; + if (num == 1) + Type1 = 1146; + if (num == 2) + Type1 = 1147; + if (num == 3) + Type1 = 1148; + if (num == 4) + Type1 = 1149; + } + else if (tile.type == (ushort) 141) + Type1 = 580; + else if (tile.type == (ushort) 145) + Type1 = 586; + else if (tile.type == (ushort) 146) + Type1 = 591; + else if (tile.type == (ushort) 147) + Type1 = 593; + else if (tile.type == (ushort) 148) + Type1 = 594; + else if (tile.type == (ushort) 153) + Type1 = 611; + else if (tile.type == (ushort) 154) + Type1 = 612; + else if (tile.type == (ushort) 155) + Type1 = 613; + else if (tile.type == (ushort) 156) + Type1 = 614; + else if (tile.type == (ushort) 160) + Type1 = 662; + else if (tile.type == (ushort) 175) + Type1 = 717; + else if (tile.type == (ushort) 176) + Type1 = 718; + else if (tile.type == (ushort) 177) + Type1 = 719; + else if (tile.type == (ushort) 163) + Type1 = 833; + else if (tile.type == (ushort) 164) + Type1 = 834; + else if (tile.type == (ushort) 200) + Type1 = 835; + else if (tile.type == (ushort) 210) + Type1 = 937; + else if (tile.type == (ushort) 135) + { + int num = (int) tile.frameY / 18; + if (num == 0) + Type1 = 529; + if (num == 1) + Type1 = 541; + if (num == 2) + Type1 = 542; + if (num == 3) + Type1 = 543; + if (num == 4) + Type1 = 852; + if (num == 5) + Type1 = 853; + if (num == 6) + Type1 = 1151; + } + else if (tile.type == (ushort) 144) + { + if (tile.frameX == (short) 0) + Type1 = 583; + if (tile.frameX == (short) 18) + Type1 = 584; + if (tile.frameX == (short) 36) + Type1 = 585; + } + else if (tile.type == (ushort) 130) + Type1 = 511; + else if (tile.type == (ushort) 131) + Type1 = 512; + else if (tile.type == (ushort) 61 || tile.type == (ushort) 74) + { + if (tile.frameX == (short) 144 && tile.type == (ushort) 61) + Item.NewItem(i * 16, j * 16, 16, 16, 331, WorldGen.genRand.Next(2, 4)); + else if (tile.frameX == (short) 162 && tile.type == (ushort) 61) + Type1 = 223; + else if (tile.frameX >= (short) 108 && tile.frameX <= (short) 126 && tile.type == (ushort) 61 && WorldGen.genRand.Next(20) == 0) + Type1 = 208; + else if (WorldGen.genRand.Next(100) == 0) + Type1 = 195; + } + else if (tile.type == (ushort) 59 || tile.type == (ushort) 60) + Type1 = 176; + else if (tile.type == (ushort) 190) + Type1 = 183; + else if (tile.type == (ushort) 71 || tile.type == (ushort) 72) + { + if (WorldGen.genRand.Next(50) == 0) + Type1 = 194; + else if (WorldGen.genRand.Next(2) == 0) + Type1 = 183; + } + else if (tile.type >= (ushort) 63 && tile.type <= (ushort) 68) + Type1 = (int) tile.type - 63 + 177; + else if (tile.type == (ushort) 50) + Type1 = tile.frameX != (short) 90 ? 149 : 165; + else if (Main.tileAlch[(int) tile.type]) + { + if (tile.type > (ushort) 82) + { + int num = (int) tile.frameX / 18; + bool flag2 = false; + Type1 = 313 + num; + int Type4 = 307 + num; + if (tile.type == (ushort) 84) + flag2 = true; + if (num == 0 && Main.dayTime) + flag2 = true; + if (num == 1 && !Main.dayTime) + flag2 = true; + if (num == 3 && !Main.dayTime && (Main.bloodMoon || Main.moonPhase == 0)) + flag2 = true; + if (num == 4 && (Main.raining || (double) Main.cloudAlpha > 0.0)) + flag2 = true; + if (num == 5 && !Main.raining && Main.dayTime && Main.time > 40500.0) + flag2 = true; + if (num == 6) + { + Type1 = 2358; + Type4 = 2357; + } + int closest = (int) Player.FindClosest(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16); + if (Main.player[closest].inventory[Main.player[closest].selectedItem].type == 213) + { + Item.NewItem(i * 16, j * 16, 16, 16, Type4, WorldGen.genRand.Next(1, 6)); + Item.NewItem(i * 16, j * 16, 16, 16, Type1, WorldGen.genRand.Next(1, 3)); + Type1 = -1; + } + else if (flag2) + { + int Stack = WorldGen.genRand.Next(1, 4); + Item.NewItem(i * 16, j * 16, 16, 16, Type4, Stack); + } + } + } + else if (tile.type == (ushort) 321) + Type1 = 2503; + else if (tile.type == (ushort) 322) + Type1 = 2504; + if (Type1 > 0) + { + int Stack = 1; + if (flag1) + ++Stack; + Item.NewItem(i * 16, j * 16, 16, 16, Type1, Stack, pfix: -1); + } + if (Type2 > 0) + Item.NewItem(i * 16, j * 16, 16, 16, Type2, pfix: -1); } + if (Main.netMode != 2) + AchievementsHelper.NotifyTileDestroyed(Main.player[Main.myPlayer], tile.type); + tile.active(false); + tile.halfBrick(false); + tile.frameX = (short) -1; + tile.frameY = (short) -1; + tile.color((byte) 0); + tile.frameNumber((byte) 0); + if (tile.type == (ushort) 58 && j > Main.maxTilesY - 200) + { + tile.lava(true); + tile.liquid = (byte) 128; + } + else if (tile.type == (ushort) 419) + Wiring.PokeLogicGate(i, j + 1); + else if (tile.type == (ushort) 54) + WorldGen.SquareWallFrame(i, j); + tile.type = (ushort) 0; + tile.inActive(false); + WorldGen.SquareTileFrame(i, j); } - if (fail) - return; - if (tileCache.type == (ushort) 13) - SoundEngine.PlaySound(13, i * 16, j * 16); - else if (tileCache.type == (ushort) 54) - SoundEngine.PlaySound(13, i * 16, j * 16); - else if (tileCache.type == (ushort) 326) - SoundEngine.PlaySound(13, i * 16, j * 16); - else if (tileCache.type == (ushort) 327) - SoundEngine.PlaySound(13, i * 16, j * 16); - else if (tileCache.type == (ushort) 458) - SoundEngine.PlaySound(13, i * 16, j * 16); - else if (tileCache.type == (ushort) 459) - SoundEngine.PlaySound(13, i * 16, j * 16); - else if (tileCache.type == (ushort) 345) - SoundEngine.PlaySound(13, i * 16, j * 16); - else if (tileCache.type == (ushort) 328) - SoundEngine.PlaySound(13, i * 16, j * 16); - else if (tileCache.type == (ushort) 329) - SoundEngine.PlaySound(13, i * 16, j * 16); - else if (tileCache.type == (ushort) 507) - { - SoundEngine.PlaySound(13, i * 16, j * 16); - } - else - { - if (tileCache.type != (ushort) 508) - return; - SoundEngine.PlaySound(13, i * 16, j * 16); - } - } - - public static Microsoft.Xna.Framework.Rectangle? GetTileVisualHitbox(int x, int y) - { - Tile tile = Main.tile[x, y]; - if (tile == null || !tile.nactive()) - return new Microsoft.Xna.Framework.Rectangle?(); - Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(x * 16, y * 16, 16, 16); - if (tile.type == (ushort) 323) - rectangle.X += (int) tile.frameY; - if (tile.halfBrick()) - { - rectangle.Y += 8; - rectangle.Height = 8; - } - return new Microsoft.Xna.Framework.Rectangle?(rectangle); } public static int KillTile_GetTileDustAmount(bool fail, Tile tileCache) { - switch (tileCache.type) - { - case 125: - case 138: - case 172: - case 287: - case 300: - case 301: - case 302: - case 303: - case 304: - case 305: - case 306: - case 307: - case 308: - case 354: - case 355: - case 373: - case 374: - case 375: - case 376: - case 461: - case 484: - case 499: - case 564: - case 565: - case 593: - case 594: - case 617: - return 0; - case 184: - if ((int) tileCache.frameX / 22 >= 5) - return 5; - return !fail ? 10 : 3; - case 231: - return !fail ? 6 : 3; - case 481: - case 482: - case 483: - return 3; - case 534: - case 536: - case 539: - return !fail ? 5 : 3; - case 541: - return 1; - case 549: - return 2; - default: - return !fail ? 10 : 3; - } + int num = 10; + if (tileCache.type == (ushort) 231) + num = 6; + if (fail) + num = 3; + if (tileCache.type == (ushort) 138) + num = 0; + if (tileCache.type == (ushort) 373) + num = 0; + if (tileCache.type == (ushort) 374) + num = 0; + if (tileCache.type == (ushort) 375) + num = 0; + if (tileCache.type == (ushort) 461) + num = 0; + if (tileCache.type >= (ushort) 300 && tileCache.type <= (ushort) 308) + num = 0; + if (tileCache.type == (ushort) 125) + num = 0; + if (tileCache.type == (ushort) 287) + num = 0; + if (tileCache.type == (ushort) 354) + num = 0; + if (tileCache.type == (ushort) 355) + num = 0; + if (tileCache.type == (ushort) 376) + num = 0; + return num; } public static int KillTile_MakeTileDust(int i, int j, Tile tileCache) { int Type1 = 0; - if (tileCache.type == (ushort) 216) - Type1 = -1; - if (tileCache.type == (ushort) 324) - Type1 = tileCache.frameY != (short) 0 ? 281 + (int) tileCache.frameX / 18 : 280; if (tileCache.type == (ushort) 216) Type1 = -1; if (tileCache.type == (ushort) 335) @@ -40106,17 +28730,15 @@ label_296: if (tileCache.frameX >= (short) 36) Type1 = 82; } - else if (tileCache.type == (ushort) 415 || tileCache.type == (ushort) 500) + else if (tileCache.type == (ushort) 415) Type1 = 6; - else if (tileCache.type == (ushort) 416 || tileCache.type == (ushort) 501) + else if (tileCache.type == (ushort) 416) Type1 = 61; - else if (tileCache.type == (ushort) 417 || tileCache.type == (ushort) 502) + else if (tileCache.type == (ushort) 417) Type1 = 242; - else if (tileCache.type == (ushort) 418 || tileCache.type == (ushort) 503) + else if (tileCache.type == (ushort) 418) Type1 = 135; - else if (tileCache.type == (ushort) 474) - Type1 = 18; - if (tileCache.type == (ushort) 1 || tileCache.type == (ushort) 17 || tileCache.type == (ushort) 38 || tileCache.type == (ushort) 39 || tileCache.type == (ushort) 41 || tileCache.type == (ushort) 43 || tileCache.type == (ushort) 44 || tileCache.type == (ushort) 481 || tileCache.type == (ushort) 482 || tileCache.type == (ushort) 483 || tileCache.type == (ushort) 48 || Main.tileStone[(int) tileCache.type] || tileCache.type == (ushort) 85 || tileCache.type == (ushort) 90 || tileCache.type == (ushort) 92 || tileCache.type == (ushort) 96 || tileCache.type == (ushort) 97 || tileCache.type == (ushort) 99 || tileCache.type == (ushort) 117 || tileCache.type == (ushort) 130 || tileCache.type == (ushort) 131 || tileCache.type == (ushort) 132 || tileCache.type == (ushort) 135 || tileCache.type == (ushort) 135 || tileCache.type == (ushort) 142 || tileCache.type == (ushort) 143 || tileCache.type == (ushort) 144 || tileCache.type == (ushort) 210 || tileCache.type == (ushort) 207 || tileCache.type == (ushort) 235 || tileCache.type == (ushort) 247 || tileCache.type == (ushort) 272 || tileCache.type == (ushort) 273 || tileCache.type == (ushort) 283 || tileCache.type == (ushort) 410 || tileCache.type == (ushort) 480 || tileCache.type == (ushort) 509 || tileCache.type == (ushort) 618) + if (tileCache.type == (ushort) 1 || tileCache.type == (ushort) 17 || tileCache.type == (ushort) 38 || tileCache.type == (ushort) 39 || tileCache.type == (ushort) 41 || tileCache.type == (ushort) 43 || tileCache.type == (ushort) 44 || tileCache.type == (ushort) 48 || Main.tileStone[(int) tileCache.type] || tileCache.type == (ushort) 85 || tileCache.type == (ushort) 90 || tileCache.type == (ushort) 92 || tileCache.type == (ushort) 96 || tileCache.type == (ushort) 97 || tileCache.type == (ushort) 99 || tileCache.type == (ushort) 117 || tileCache.type == (ushort) 130 || tileCache.type == (ushort) 131 || tileCache.type == (ushort) 132 || tileCache.type == (ushort) 135 || tileCache.type == (ushort) 135 || tileCache.type == (ushort) 142 || tileCache.type == (ushort) 143 || tileCache.type == (ushort) 144 || tileCache.type == (ushort) 210 || tileCache.type == (ushort) 207 || tileCache.type == (ushort) 235 || tileCache.type == (ushort) 247 || tileCache.type == (ushort) 272 || tileCache.type == (ushort) 273 || tileCache.type == (ushort) 283 || tileCache.type == (ushort) 410) Type1 = 1; if (tileCache.type == (ushort) 379) Type1 = 257; @@ -40185,198 +28807,30 @@ label_296: case 465: case 466: case 468: - case 476: - case 486: - case 487: - case 489: - case 490: - case 491: - case 493: - case 494: - case 497: - case 510: - case 511: - case 520: - case 521: - case 522: - case 523: - case 524: - case 525: - case 526: - case 527: - case 531: - case 545: - case 547: - case 548: - case 560: - case 564: - case 565: - case 567: - case 572: - case 579: - case 591: - case 592: - case 593: - case 594: - case 613: - case 614: - case 621: - case 622: Type1 = -1; break; - case 41: - case 481: - Type1 = 275; - break; - case 43: - case 482: - Type1 = 276; - break; - case 44: - case 483: - Type1 = 277; - break; - case 184: - int num1 = (int) tileCache.frameX / 22; - switch (num1) - { - case 5: - Type1 = 258; - break; - case 6: - Type1 = 299; - break; - case 7: - Type1 = 300; - break; - case 8: - Type1 = 301; - break; - default: - Type1 = 93 + num1; - break; - } - break; case 407: Type1 = 10; break; case 454: Type1 = 139; break; - case 472: - case 546: - case 557: - Type1 = 8; - break; - case 473: - Type1 = 82; - break; - case 498: - Type1 = 30; - break; - case 512: - Type1 = 93; - break; - case 513: - Type1 = 94; - break; - case 514: - Type1 = 95; - break; - case 515: - Type1 = 96; - break; - case 516: - Type1 = 97; - break; - case 517: - Type1 = 258; - break; - case 535: - Type1 = 299; - break; - case 537: - Type1 = 300; - break; - case 540: - Type1 = 301; - break; - case 541: - Type1 = 226; - break; - case 583: - Type1 = WorldGen.genRand.Next(10) == 0 ? 87 : 1; - break; - case 584: - Type1 = WorldGen.genRand.Next(10) == 0 ? 86 : 1; - break; - case 585: - Type1 = WorldGen.genRand.Next(10) == 0 ? 88 : 1; - break; - case 586: - Type1 = WorldGen.genRand.Next(10) == 0 ? 89 : 1; - break; - case 587: - Type1 = WorldGen.genRand.Next(10) == 0 ? 90 : 1; - break; - case 588: - Type1 = WorldGen.genRand.Next(10) == 0 ? 91 : 1; - break; - case 589: - Type1 = WorldGen.genRand.Next(10) == 0 ? 138 : 1; - break; - case 590: - Type1 = 1; - break; - case 595: - Type1 = 78; - break; - case 596: - Type1 = 78; - break; - case 615: - Type1 = 78; - break; - case 616: - Type1 = 78; - break; } - if (Main.tileMoss[(int) tileCache.type]) - Type1 = tileCache.type != (ushort) 381 ? (tileCache.type != (ushort) 534 ? (tileCache.type != (ushort) 536 ? (tileCache.type != (ushort) 539 ? (int) tileCache.type - 179 + 93 : 301) : 300) : 299) : 258; if (tileCache.type == (ushort) 240) { - int num2 = (int) tileCache.frameX / 54; + int num = (int) tileCache.frameX / 54; if (tileCache.frameY >= (short) 54) - num2 += 36; + num += 36; Type1 = 7; - if (num2 == 16 || num2 == 17) + if (num == 16 || num == 17) Type1 = 26; - if (num2 >= 46 && num2 <= 49) + if (num >= 46 && num <= 49) Type1 = -1; } if (tileCache.type == (ushort) 241) Type1 = 1; if (tileCache.type == (ushort) 242) Type1 = -1; - int num3; - if (tileCache.type == (ushort) 529) - { - switch (Main.tile[i, j + 1].type) - { - case 112: - Type1 = num3 = 17; - break; - case 116: - Type1 = num3 = 47; - break; - case 234: - Type1 = num3 = 125; - break; - default: - Type1 = i < WorldGen.beachDistance || i > Main.maxTilesX - WorldGen.beachDistance ? 290 : 289; - break; - } - } if (tileCache.type == (ushort) 356) Type1 = -1; if (tileCache.type == (ushort) 351) @@ -40389,11 +28843,9 @@ label_296: Type1 = 239; if (tileCache.type == (ushort) 366) Type1 = 30; - if (tileCache.type == (ushort) 504) - Type1 = -1; - if (tileCache.type == (ushort) 357 || tileCache.type == (ushort) 367 || tileCache.type == (ushort) 561) + if (tileCache.type == (ushort) 357 || tileCache.type == (ushort) 367) Type1 = 236; - if (tileCache.type == (ushort) 368 || tileCache.type == (ushort) 369 || tileCache.type == (ushort) 576) + if (tileCache.type == (ushort) 368 || tileCache.type == (ushort) 369) Type1 = 240; if (tileCache.type == (ushort) 170) Type1 = 196; @@ -40437,16 +28889,6 @@ label_296: Type1 = 13; if (tileCache.type == (ushort) 329) Type1 = 13; - if (tileCache.type == (ushort) 507) - Type1 = 13; - if (tileCache.type == (ushort) 508) - Type1 = 13; - if (tileCache.type == (ushort) 562) - Type1 = -1; - if (tileCache.type == (ushort) 571) - Type1 = 40; - if (tileCache.type == (ushort) 563) - Type1 = -1; if (tileCache.type == (ushort) 330) Type1 = 9; if (tileCache.type == (ushort) 331) @@ -40459,146 +28901,13 @@ label_296: Type1 = -1; if (tileCache.type == (ushort) 19) { - switch ((int) tileCache.frameY / 18) - { - case 0: - Type1 = 7; - break; - case 1: - Type1 = 77; - break; - case 2: - Type1 = 78; - break; - case 3: - Type1 = 79; - break; - case 4: - Type1 = 26; - break; - case 5: - Type1 = 126; - break; - case 6: - Type1 = 275; - break; - case 7: - Type1 = 277; - break; - case 8: - Type1 = 276; - break; - case 9: - Type1 = 1; - break; - case 10: - Type1 = 214; - break; - case 11: - Type1 = 214; - break; - case 12: - Type1 = 214; - break; - case 13: - Type1 = 109; - break; - case 14: - Type1 = 13; - break; - case 15: - Type1 = 189; - break; - case 16: - Type1 = 191; - break; - case 17: - Type1 = 215; - break; - case 18: - Type1 = 26; - break; - case 19: - Type1 = 214; - break; - case 20: - Type1 = 4; - break; - case 21: - Type1 = 10; - break; - case 22: - Type1 = 32; - break; - case 23: - Type1 = 78; - break; - case 24: - Type1 = 147; - break; - case 25: - Type1 = 40; - break; - case 26: - Type1 = 226; - break; - case 27: - Type1 = 23; - break; - case 28: - Type1 = 240; - break; - case 29: - Type1 = 236; - break; - case 30: - Type1 = 68 + Main.rand.Next(3); - break; - case 31: - Type1 = 10; - break; - case 32: - Type1 = 78; - break; - case 33: - Type1 = 148; - break; - case 34: - Type1 = 5; - break; - case 35: - Type1 = 80; - break; - case 37: - Type1 = 18; - break; - case 38: - Type1 = 6; - break; - case 39: - Type1 = 61; - break; - case 40: - Type1 = 242; - break; - case 41: - Type1 = 135; - break; - case 42: - Type1 = 287; - break; - case 44: - Type1 = -1; - break; - default: - Type1 = 1; - break; - } + int num = (int) tileCache.frameY / 18; + Type1 = num == 0 || num == 9 || num == 10 || num == 11 || num == 12 ? 7 : (num != 1 ? (num != 2 ? (num != 3 ? (num != 4 ? (num != 5 ? (num != 13 ? (num != 14 ? (num < 15 || num > 16 ? (num != 17 ? (num != 18 ? (num != 19 ? (num != 20 ? (num != 21 ? (num != 22 ? (num != 23 ? (num != 24 ? (num != 25 ? (num != 26 ? (num != 27 ? (num != 28 ? (num != 29 ? (num != 30 ? (num != 31 ? (num != 32 ? (num != 33 ? (num != 34 ? (num != 35 ? 1 : 80) : 5) : 148) : 78) : 10) : 68 + Main.rand.Next(3)) : 236) : 240) : 23) : 226) : 40) : 147) : 78) : 8) : 1) : 4) : 214) : 214) : 215) : -1) : 13) : 109) : 126) : 26) : 79) : 78) : 77); } if (tileCache.type == (ushort) 79) { - int num4 = (int) tileCache.frameY / 36; - Type1 = num4 != 0 ? (num4 != 1 ? (num4 != 2 ? (num4 != 3 ? (num4 != 4 ? (num4 != 8 ? (num4 < 9 ? 1 : -1) : 109) : 126) : 79) : 78) : 77) : 7; + int num = (int) tileCache.frameY / 36; + Type1 = num != 0 ? (num != 1 ? (num != 2 ? (num != 3 ? (num != 4 ? (num != 8 ? (num < 9 ? 1 : -1) : 109) : 126) : 79) : 78) : 77) : 7; } if (tileCache.type == (ushort) 18) { @@ -40653,27 +28962,27 @@ label_296: break; } } - if (tileCache.type == (ushort) 14 || tileCache.type == (ushort) 87 || tileCache.type == (ushort) 88 || tileCache.type == (ushort) 469) + if (tileCache.type == (ushort) 14 || tileCache.type == (ushort) 87 || tileCache.type == (ushort) 88) Type1 = -1; if (tileCache.type >= (ushort) byte.MaxValue && tileCache.type <= (ushort) 261) { - int num5 = (int) tileCache.type - (int) byte.MaxValue; - Type1 = 86 + num5; - if (num5 == 6) + int num = (int) tileCache.type - (int) byte.MaxValue; + Type1 = 86 + num; + if (num == 6) Type1 = 138; } if (tileCache.type >= (ushort) 262 && tileCache.type <= (ushort) 268) { - int num6 = (int) tileCache.type - 262; - Type1 = 86 + num6; - if (num6 == 6) + int num = (int) tileCache.type - 262; + Type1 = 86 + num; + if (num == 6) Type1 = 138; } if (tileCache.type == (ushort) 178) { - int num7 = (int) tileCache.frameX / 18; - Type1 = 86 + num7; - if (num7 == 6) + int num = (int) tileCache.frameX / 18; + Type1 = 86 + num; + if (num == 6) Type1 = 138; } if (tileCache.type == (ushort) 440) @@ -40734,15 +29043,6 @@ label_296: case 439: Type1 = 91; break; - case 496: - Type1 = 109; - break; - case 549: - Type1 = 3; - break; - case 552: - Type1 = 32; - break; } if (tileCache.type == (ushort) 186) Type1 = tileCache.frameX > (short) 360 ? (tileCache.frameX > (short) 846 ? (tileCache.frameX > (short) 954 ? (tileCache.frameX > (short) 1062 ? (tileCache.frameX > (short) 1170 ? (tileCache.frameX > (short) 1332 ? (tileCache.frameX > (short) 1386 ? 80 : 10) : 0) : 10) : 11) : 9) : 1) : 26; @@ -40766,12 +29066,6 @@ label_296: Type1 = 1; else if (tileCache.frameX <= (short) 1564) Type1 = 0; - else if (tileCache.frameX <= (short) 1890) - Type1 = 250; - else if (tileCache.frameX <= (short) 2196) - Type1 = 240; - else if (tileCache.frameX <= (short) 2520) - Type1 = 236; } if (tileCache.type == (ushort) 105) { @@ -40781,72 +29075,72 @@ label_296: } if (tileCache.type == (ushort) 349) Type1 = 1; - if (tileCache.type == (ushort) 337 || tileCache.type == (ushort) 506) + if (tileCache.type == (ushort) 337) Type1 = 1; if (tileCache.type == (ushort) 239) { - int num8 = (int) tileCache.frameX / 18; - if (num8 == 0) + int num = (int) tileCache.frameX / 18; + if (num == 0) Type1 = 9; - if (num8 == 1) + if (num == 1) Type1 = 81; - if (num8 == 2) + if (num == 2) Type1 = 8; - if (num8 == 3) + if (num == 3) Type1 = 82; - if (num8 == 4) + if (num == 4) Type1 = 11; - if (num8 == 5) + if (num == 5) Type1 = 83; - if (num8 == 6) + if (num == 6) Type1 = 10; - if (num8 == 7) + if (num == 7) Type1 = 84; - if (num8 == 8) + if (num == 8) Type1 = 14; - if (num8 == 9) + if (num == 9) Type1 = 23; - if (num8 == 10) + if (num == 10) Type1 = 25; - if (num8 == 11) + if (num == 11) Type1 = 48; - if (num8 == 12) + if (num == 12) Type1 = 144; - if (num8 == 13) + if (num == 13) Type1 = 49; - if (num8 == 14) + if (num == 14) Type1 = 145; - if (num8 == 15) + if (num == 15) Type1 = 50; - if (num8 == 16) + if (num == 16) Type1 = 146; - if (num8 == 17) + if (num == 17) Type1 = 128; - if (num8 == 18) + if (num == 18) Type1 = 84; - if (num8 == 19) + if (num == 19) Type1 = 117; - if (num8 == 20) + if (num == 20) Type1 = 42; - if (num8 == 21) + if (num == 21) Type1 = -1; - if (num8 == 22) + if (num == 22) Type1 = 265; } if (tileCache.type == (ushort) 185) { if (tileCache.frameY == (short) 18) { - int num9 = (int) tileCache.frameX / 36; - if (num9 < 6) + int num = (int) tileCache.frameX / 36; + if (num < 6) Type1 = 1; - else if (num9 < 16) + else if (num < 16) { Type1 = 26; } else { - switch (num9) + switch (num) { case 16: Type1 = 9; @@ -40876,80 +29170,64 @@ label_296: Type1 = 91; break; default: - if (num9 < 31) + if (num < 31) { Type1 = 80; break; } - if (num9 < 33) + if (num < 33) { Type1 = 7; break; } - if (num9 < 34) + if (num < 34) { Type1 = 8; break; } - if (num9 < 39) + if (num < 39) { Type1 = 30; break; } - if (num9 < 42) + if (num < 42) { Type1 = 1; break; } - if (num9 < 48) - { - Type1 = 32; - break; - } - if (num9 < 54) - { - Type1 = 240; - break; - } - if (num9 < 60) - { - Type1 = 236; - break; - } break; } } } else { - int num10 = (int) tileCache.frameX / 18; - if (num10 < 6) + int num = (int) tileCache.frameX / 18; + if (num < 6) Type1 = 1; - else if (num10 < 12) + else if (num < 12) Type1 = 0; - else if (num10 < 27) + else if (num < 27) Type1 = 26; - else if (num10 < 32) + else if (num < 32) Type1 = 1; - else if (num10 < 35) + else if (num < 35) Type1 = 0; - else if (num10 < 46) + else if (num < 46) Type1 = 80; - else if (num10 < 52) + else if (num < 52) Type1 = 30; - else if (num10 < 58) - Type1 = 32; - else if (num10 < 64) - Type1 = 240; - else if (num10 < 70) - Type1 = 236; } } + if (tileCache.type == (ushort) 184) + { + int num = (int) tileCache.frameX / 22; + Type1 = num != 5 ? 93 + num : 258; + } if (tileCache.type == (ushort) 237) Type1 = 148; if (tileCache.type == (ushort) 157) Type1 = 77; - if (tileCache.type == (ushort) 158 || tileCache.type == (ushort) 232 || tileCache.type == (ushort) 383 || tileCache.type == (ushort) 575) + if (tileCache.type == (ushort) 158 || tileCache.type == (ushort) 232 || tileCache.type == (ushort) 383) Type1 = 78; if (tileCache.type == (ushort) 159) Type1 = 78; @@ -41070,10 +29348,10 @@ label_296: Type1 = -1; if (tileCache.type == (ushort) 21) Type1 = tileCache.frameX < (short) 1008 ? (tileCache.frameX < (short) 612 ? (tileCache.frameX < (short) 576 ? (tileCache.frameX < (short) 540 ? (tileCache.frameX < (short) 504 ? (tileCache.frameX < (short) 468 ? (tileCache.frameX < (short) 432 ? (tileCache.frameX < (short) 396 ? (tileCache.frameX < (short) 360 ? (tileCache.frameX < (short) 324 ? (tileCache.frameX < (short) 288 ? (tileCache.frameX < (short) 252 ? (tileCache.frameX < (short) 216 ? (tileCache.frameX < (short) 180 ? (tileCache.frameX < (short) 108 ? (tileCache.frameX < (short) 36 ? 7 : 10) : 37) : 7) : 1) : 77) : 78) : 79) : 10) : 11) : 7) : 116) : 126) : 26) : 148) : 11) : -1; - if (tileCache.type == (ushort) 382) - Type1 = 3; - if (tileCache.type == (ushort) 2 || tileCache.type == (ushort) 477) + if (tileCache.type == (ushort) 2) Type1 = WorldGen.genRand.Next(2) != 0 ? 2 : 0; + if (Main.tileMoss[(int) tileCache.type]) + Type1 = tileCache.type != (ushort) 381 ? (int) tileCache.type - 179 + 93 : 258; if (tileCache.type == (ushort) sbyte.MaxValue) Type1 = 67; if (tileCache.type == (ushort) 91) @@ -41142,7 +29420,7 @@ label_296: break; } } - if (tileCache.type == (ushort) 204 || tileCache.type == (ushort) 478) + if (tileCache.type == (ushort) 204) { Type1 = 117; if (WorldGen.genRand.Next(2) == 0) @@ -41154,9 +29432,7 @@ label_296: Type1 = WorldGen.genRand.Next(2) != 0 ? 13 : 7; if (tileCache.type == (ushort) 244) Type1 = WorldGen.genRand.Next(2) != 0 ? 13 : 1; - if (tileCache.type == (ushort) 597) - Type1 = -1; - else if (tileCache.type >= (ushort) 358 && tileCache.type <= (ushort) 364 || tileCache.type >= (ushort) 275 && tileCache.type <= (ushort) 282 || tileCache.type == (ushort) 285 || tileCache.type == (ushort) 286 || tileCache.type >= (ushort) 288 && tileCache.type <= (ushort) 297 || tileCache.type >= (ushort) 316 && tileCache.type <= (ushort) 318 || tileCache.type == (ushort) 298 || tileCache.type == (ushort) 299 || tileCache.type == (ushort) 309 || tileCache.type == (ushort) 310 || tileCache.type == (ushort) 339 || tileCache.type == (ushort) 538 || tileCache.type == (ushort) 413 || tileCache.type == (ushort) 414 || tileCache.type == (ushort) 505 || tileCache.type == (ushort) 521 || tileCache.type == (ushort) 522 || tileCache.type == (ushort) 523 || tileCache.type == (ushort) 524 || tileCache.type == (ushort) 525 || tileCache.type == (ushort) 526 || tileCache.type == (ushort) 527 || tileCache.type == (ushort) 532 || tileCache.type == (ushort) 543 || tileCache.type == (ushort) 544 || tileCache.type == (ushort) 550 || tileCache.type == (ushort) 551 || tileCache.type == (ushort) 533 || tileCache.type == (ushort) 553 || tileCache.type == (ushort) 554 || tileCache.type == (ushort) 555 || tileCache.type == (ushort) 556 || tileCache.type == (ushort) 558 || tileCache.type == (ushort) 559 || tileCache.type == (ushort) 542 || tileCache.type == (ushort) 391 || tileCache.type == (ushort) 394 || tileCache.type == (ushort) 392 || tileCache.type == (ushort) 393 || tileCache.type == (ushort) 568 || tileCache.type == (ushort) 569 || tileCache.type == (ushort) 570 || tileCache.type == (ushort) 582 || tileCache.type == (ushort) 580 || tileCache.type == (ushort) 598 || tileCache.type == (ushort) 599 || tileCache.type == (ushort) 600 || tileCache.type == (ushort) 601 || tileCache.type == (ushort) 602 || tileCache.type == (ushort) 603 || tileCache.type == (ushort) 604 || tileCache.type == (ushort) 605 || tileCache.type == (ushort) 606 || tileCache.type == (ushort) 607 || tileCache.type == (ushort) 608 || tileCache.type == (ushort) 609 || tileCache.type == (ushort) 610 || tileCache.type == (ushort) 611 || tileCache.type == (ushort) 612 || tileCache.type == (ushort) 619 || tileCache.type == (ushort) 620) + else if (tileCache.type >= (ushort) 358 && tileCache.type <= (ushort) 364 || tileCache.type >= (ushort) 275 && tileCache.type <= (ushort) 282 || tileCache.type == (ushort) 285 || tileCache.type == (ushort) 286 || tileCache.type >= (ushort) 288 && tileCache.type <= (ushort) 297 || tileCache.type >= (ushort) 316 && tileCache.type <= (ushort) 318 || tileCache.type == (ushort) 298 || tileCache.type == (ushort) 299 || tileCache.type == (ushort) 309 || tileCache.type == (ushort) 310 || tileCache.type == (ushort) 339 || tileCache.type == (ushort) 413 || tileCache.type == (ushort) 414) { Type1 = 13; if (WorldGen.genRand.Next(3) != 0) @@ -41168,50 +29444,6 @@ label_296: Type1 = 16; if (tileCache.type == (ushort) 460) Type1 = 16; - if (tileCache.type == (ushort) 530) - { - switch (Main.tile[i, j + 2 - (int) tileCache.frameY / 18].type) - { - case 112: - Type1 = 17; - break; - case 116: - Type1 = 47; - break; - case 234: - Type1 = 125; - break; - default: - Type1 = tileCache.frameX >= (short) 270 ? 291 : 40; - break; - } - } - if (tileCache.type == (ushort) 518) - { - if (tileCache.frameY == (short) 0) - Type1 = 3; - else if (tileCache.frameY == (short) 18) - Type1 = 47; - else if (tileCache.frameY == (short) 36) - Type1 = 40; - } - else if (tileCache.type == (ushort) 519) - { - if (tileCache.frameY == (short) 0) - Type1 = 3; - else if (tileCache.frameY == (short) 18) - Type1 = 40; - else if (tileCache.frameY == (short) 36) - Type1 = 47; - else if (tileCache.frameY == (short) 54) - Type1 = 125; - else if (tileCache.frameY == (short) 72) - Type1 = 17; - else if (tileCache.frameY == (short) 90) - Type1 = 26; - } - else if (tileCache.type == (ushort) 528) - Type1 = 26; if (tileCache.type == (ushort) 12) Type1 = 12; if (tileCache.type == (ushort) 3 || tileCache.type == (ushort) 73) @@ -41245,8 +29477,6 @@ label_296: Type1 = 148; if (tileCache.frameY >= (short) 1116 && tileCache.frameY <= (short) 1222) Type1 = 241; - if (tileCache.frameY >= (short) 1224 && tileCache.frameY <= (short) 1330) - Type1 = 287; } if (tileCache.type == (ushort) 163) Type1 = 118; @@ -41288,7 +29518,7 @@ label_296: Type1 = 30; if (tileCache.type == (ushort) 52 || tileCache.type == (ushort) 353) Type1 = 3; - if (tileCache.type == (ushort) 53 || tileCache.type == (ushort) 81 || tileCache.type == (ushort) 151 || tileCache.type == (ushort) 202 || tileCache.type == (ushort) 274 || tileCache.type == (ushort) 495) + if (tileCache.type == (ushort) 53 || tileCache.type == (ushort) 81 || tileCache.type == (ushort) 151 || tileCache.type == (ushort) 202 || tileCache.type == (ushort) 274) Type1 = 32; if (tileCache.type == (ushort) 56 || tileCache.type == (ushort) 152) Type1 = 37; @@ -41300,13 +29530,11 @@ label_296: Type1 = 38; if (tileCache.type == (ushort) 61 || tileCache.type == (ushort) 62 || tileCache.type == (ushort) 74 || tileCache.type == (ushort) 80 || tileCache.type == (ushort) 188 || tileCache.type == (ushort) 233 || tileCache.type == (ushort) 236 || tileCache.type == (ushort) 384) Type1 = 40; - if (tileCache.type == (ushort) 485) - Type1 = 32; if (tileCache.type == (ushort) 238) Type1 = WorldGen.genRand.Next(3) != 0 ? 166 : 167; if (tileCache.type == (ushort) 69) Type1 = 7; - if (tileCache.type == (ushort) 71 || tileCache.type == (ushort) 72 || tileCache.type == (ushort) 190 || tileCache.type == (ushort) 578) + if (tileCache.type == (ushort) 71 || tileCache.type == (ushort) 72 || tileCache.type == (ushort) 190) Type1 = 26; if (tileCache.type == (ushort) 70) Type1 = 17; @@ -41367,8 +29595,6 @@ label_296: Type1 = 5; if (tileCache.type == (ushort) 196) Type1 = 108; - if (tileCache.type == (ushort) 460) - Type1 = 108; if (tileCache.type == (ushort) 197) Type1 = 4; if (tileCache.type == (ushort) 153) @@ -41381,7 +29607,7 @@ label_296: Type1 = 1; if (tileCache.type == (ushort) 116 || tileCache.type == (ushort) 118 || tileCache.type == (ushort) 147 || tileCache.type == (ushort) 148) Type1 = 51; - if (tileCache.type == (ushort) 109 || tileCache.type == (ushort) 492) + if (tileCache.type == (ushort) 109) Type1 = WorldGen.genRand.Next(2) != 0 ? 47 : 0; if (tileCache.type == (ushort) 110 || tileCache.type == (ushort) 113 || tileCache.type == (ushort) 115) Type1 = 47; @@ -41407,20 +29633,20 @@ label_296: Type1 = 49; if (Main.tileAlch[(int) tileCache.type]) { - int num11 = (int) tileCache.frameX / 18; - if (num11 == 0) + int num = (int) tileCache.frameX / 18; + if (num == 0) Type1 = 3; - if (num11 == 1) + if (num == 1) Type1 = 3; - if (num11 == 2) + if (num == 2) Type1 = 7; - if (num11 == 3) + if (num == 3) Type1 = 17; - if (num11 == 4) - Type1 = 289; - if (num11 == 5) + if (num == 4) + Type1 = 3; + if (num == 5) Type1 = 6; - if (num11 == 6) + if (num == 6) Type1 = 224; } if (tileCache.type == (ushort) 58 || tileCache.type == (ushort) 76 || tileCache.type == (ushort) 77) @@ -41462,17 +29688,45 @@ label_296: if (tileCache.type == (ushort) 27) Type1 = WorldGen.genRand.Next(2) != 0 ? 19 : 3; if (tileCache.type == (ushort) 129) - { - if (tileCache.frameX >= (short) 324) - num3 = 69; Type1 = tileCache.frameX == (short) 0 || tileCache.frameX == (short) 54 || tileCache.frameX == (short) 108 ? 68 : (tileCache.frameX == (short) 18 || tileCache.frameX == (short) 72 || tileCache.frameX == (short) 126 ? 69 : 70); - } if (tileCache.type == (ushort) 385) Type1 = WorldGen.genRand.Next(68, 71); if (tileCache.type == (ushort) 4) { - int index = (int) tileCache.frameY / 22; - Type1 = TorchID.Dust[index]; + int num = (int) tileCache.frameY / 22; + switch (num) + { + case 0: + Type1 = 6; + break; + case 8: + Type1 = 75; + break; + case 9: + Type1 = 135; + break; + case 10: + Type1 = 158; + break; + case 11: + Type1 = 169; + break; + case 12: + Type1 = 156; + break; + case 13: + Type1 = 234; + break; + case 14: + Type1 = 66; + break; + case 15: + Type1 = 242; + break; + default: + Type1 = 58 + num; + break; + } } if (tileCache.type == (ushort) 35) { @@ -41486,13 +29740,11 @@ label_296: Type1 = -1; if (tileCache.type == (ushort) 271) Type1 = -1; - if (tileCache.type == (ushort) 581) - Type1 = -1; if (tileCache.type == (ushort) 79 || tileCache.type == (ushort) 90 || tileCache.type == (ushort) 101) Type1 = -1; if (tileCache.type == (ushort) 33 || tileCache.type == (ushort) 34 || tileCache.type == (ushort) 42 || tileCache.type == (ushort) 93 || tileCache.type == (ushort) 100) Type1 = -1; - if (tileCache.type == (ushort) 321 || tileCache.type == (ushort) 574) + if (tileCache.type == (ushort) 321) Type1 = 214; if (tileCache.type == (ushort) 322) Type1 = 215; @@ -41518,13 +29770,6 @@ label_296: } if (Type1 < 0) return 6000; - if (tileCache.type == (ushort) 518) - { - int num12 = (int) tileCache.liquid / 16 - 3; - if (WorldGen.SolidTile(i, j - 1) && num12 > 8) - num12 = 8; - return Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16 - num12)), 16, 16, Type1); - } if (tileCache.type == (ushort) 352 && Type1 == 5) { int index = Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, 5, Alpha: 100); @@ -41559,7 +29804,7 @@ label_296: Main.dust[index].noLight = true; return index; } - if (tileCache.type == (ushort) 193 || tileCache.type == (ushort) 18 && Type1 == 4 || tileCache.type == (ushort) 19 && Type1 == 4) + if (tileCache.type == (ushort) 193 || tileCache.type == (ushort) 18 && Type1 == 4) return Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, Type1, Alpha: 75, newColor: new Color(0, 80, (int) byte.MaxValue, 100), Scale: 0.75f); if (tileCache.type == (ushort) 197) return Dust.NewDust(new Vector2((float) (i * 16), (float) (j * 16)), 16, 16, Type1, Alpha: 75, newColor: new Color(97, 200, (int) byte.MaxValue, 100), Scale: 0.75f); @@ -41587,12 +29832,14 @@ label_296: if (!tile.active() || tile.type != (ushort) 11) return false; int num = (int) tile.frameX % 72; - return num < 18 || num >= 54; + return num >= 18 && num < 54; } - public static bool IsLockedDoor(int x, int y) => WorldGen.IsLockedDoor(Main.tile[x, y]); - - public static bool IsLockedDoor(Tile t) => t.type == (ushort) 10 && t.frameY >= (short) 594 && t.frameY <= (short) 646 && t.frameX < (short) 54; + public static bool IsLockedDoor(int x, int y) + { + Tile tile = Main.tile[x, y]; + return tile.type == (ushort) 10 && tile.frameY >= (short) 594 && tile.frameY <= (short) 646 && tile.frameX < (short) 54; + } public static void DropDoorItem(int x, int y, int doorStyle) { @@ -41679,33 +29926,6 @@ label_296: case 36: Type = 3888; break; - case 37: - Type = 3941; - break; - case 38: - Type = 3967; - break; - case 39: - Type = 4155; - break; - case 40: - Type = 4176; - break; - case 41: - Type = 4197; - break; - case 42: - Type = 4218; - break; - case 43: - Type = 4307; - break; - case 44: - Type = 4415; - break; - case 45: - Type = 4576; - break; default: if (doorStyle >= 4 && doorStyle <= 8) { @@ -41755,22 +29975,22 @@ label_296: num4 = (int) ((double) num4 * 1.5); } int num5 = 0; - for (int x = i - num3; x < i + num3; ++x) + for (int index1 = i - num3; index1 < i + num3; ++index1) { - for (int y = j - num3; y < j + num3; ++y) + for (int index2 = j - num3; index2 < j + num3; ++index2) { - if (WorldGen.InWorld(x, y) && Main.tile[x, y].active() && Main.tile[x, y].type == (ushort) 211) + if (index1 < Main.maxTilesX - 10 && index1 > 10 && Main.tile[index1, index2].active() && Main.tile[index1, index2].type == (ushort) 211) ++num5; } } if (num5 > num1) return false; int num6 = 0; - for (int x = i - num4; x < i + num4; ++x) + for (int index3 = i - num4; index3 < i + num4; ++index3) { - for (int y = j - num4; y < j + num4; ++y) + for (int index4 = j - num4; index4 < j + num4; ++index4) { - if (WorldGen.InWorld(x, y) && Main.tile[x, y].active() && Main.tile[x, y].type == (ushort) 211) + if (index3 < Main.maxTilesX - 10 && index3 > 10 && Main.tile[index3, index4].active() && Main.tile[index3, index4].type == (ushort) 211) ++num6; } } @@ -41780,17 +30000,17 @@ label_296: private static bool nearbyChlorophyte(int i, int j) { float num1 = 0.0f; - int num2 = 5; + int num2 = 10; if (i <= num2 + 5 || i >= Main.maxTilesX - num2 - 5 || j <= num2 + 5 || j >= Main.maxTilesY - num2 - 5) return false; - for (int index1 = i - num2; index1 <= i + num2; ++index1) + for (int index1 = i - num2; index1 < i + num2; ++index1) { - for (int index2 = j - num2; index2 <= j + num2; ++index2) + for (int index2 = j - num2; index2 < j + num2; ++index2) { if (Main.tile[index1, index2].active() && (Main.tile[index1, index2].type == (ushort) 211 || Main.tile[index1, index2].type == (ushort) 346)) { ++num1; - if ((double) num1 >= 4.0) + if ((double) num1 == 5.0) return true; } } @@ -41817,9 +30037,9 @@ label_296: int num7 = Utils.Clamp(num3, 0, Main.maxTilesY - 1); int num8 = Utils.Clamp(num4, 0, Main.maxTilesY - 1); int num9 = 0; - for (int index1 = num5; index1 <= num6; ++index1) + for (int index1 = num5; index1 < num6; ++index1) { - for (int index2 = num7; index2 <= num8; ++index2) + for (int index2 = num7; index2 < num8; ++index2) { if (Main.tile[index1, index2].active()) { @@ -41927,11 +30147,11 @@ label_296: while (flag) { flag = false; - int index7 = i + Main.rand.Next(-6, 7); - int index8 = j + Main.rand.Next(-6, 7); + int index7 = i + Main.rand.Next(-5, 6); + int index8 = j + Main.rand.Next(-5, 6); if (WorldGen.InWorld(index7, index8, 2) && Main.tile[index7, index8].active()) { - if (Main.tile[index7, index8].type == (ushort) 23 || Main.tile[index7, index8].type == (ushort) 199 || Main.tile[index7, index8].type == (ushort) 2 || Main.tile[index7, index8].type == (ushort) 477 || Main.tile[index7, index8].type == (ushort) 492 || Main.tile[index7, index8].type == (ushort) 109) + if (Main.tile[index7, index8].type == (ushort) 23 || Main.tile[index7, index8].type == (ushort) 199 || Main.tile[index7, index8].type == (ushort) 2 || Main.tile[index7, index8].type == (ushort) 109) { Main.tile[index7, index8].type = (ushort) 60; WorldGen.SquareTileFrame(index7, index8); @@ -41951,250 +30171,279 @@ label_296: } } } - if (NPC.downedPlantBoss && WorldGen.genRand.Next(2) != 0 || !WorldGen.AllowedToSpreadInfections) + if (NPC.downedPlantBoss && WorldGen.genRand.Next(2) != 0) return; if (type == 23 || type == 25 || type == 32 || type == 112 || type == 163 || type == 400 || type == 398) { - bool flag = true; - while (flag) + bool flag1 = true; + while (flag1) { - flag = false; + flag1 = false; int index9 = i + WorldGen.genRand.Next(-3, 4); int index10 = j + WorldGen.genRand.Next(-3, 4); - if (!WorldGen.nearbyChlorophyte(index9, index10)) + bool flag2 = false; + switch (Main.tile[index9, index10].type) { - if (WorldGen.CountNearBlocksTypes(index9, index10, 2, 1, 27) <= 0) + case 59: + case 60: + flag2 = WorldGen.nearbyChlorophyte(index9, index10); + break; + default: + bool flag3 = false; + int index11 = index9; + int index12 = index10; + for (int index13 = 0; index13 < 4; ++index13) + { + switch (index13) + { + case 0: + index11 = index9 - 1; + index12 = index10; + break; + case 1: + index11 = index9 + 1; + index12 = index10; + break; + case 2: + index11 = index9; + index12 = index10 - 1; + break; + case 3: + index11 = index9; + index12 = index10 + 1; + break; + } + if (Main.tile[index11, index12].active() && (Main.tile[index11, index12].type == (ushort) 59 || Main.tile[index11, index12].type == (ushort) 60)) + { + flag3 = true; + break; + } + } + if (flag3) + { + flag2 = WorldGen.nearbyChlorophyte(index9, index10); + break; + } + break; + } + if (!(Main.tile[index9, index10 - 1].type == (ushort) 27 | flag2)) + { + if (Main.tile[index9, index10].type == (ushort) 2) { - if (Main.tile[index9, index10].type == (ushort) 2) - { - if (WorldGen.genRand.Next(2) == 0) - flag = true; - Main.tile[index9, index10].type = (ushort) 23; - WorldGen.SquareTileFrame(index9, index10); - NetMessage.SendTileSquare(-1, index9, index10, 1); - } - else if (Main.tile[index9, index10].type == (ushort) 1 || Main.tileMoss[(int) Main.tile[index9, index10].type]) - { - if (WorldGen.genRand.Next(2) == 0) - flag = true; - Main.tile[index9, index10].type = (ushort) 25; - WorldGen.SquareTileFrame(index9, index10); - NetMessage.SendTileSquare(-1, index9, index10, 1); - } - else if (Main.tile[index9, index10].type == (ushort) 53) - { - if (WorldGen.genRand.Next(2) == 0) - flag = true; - Main.tile[index9, index10].type = (ushort) 112; - WorldGen.SquareTileFrame(index9, index10); - NetMessage.SendTileSquare(-1, index9, index10, 1); - } - else if (Main.tile[index9, index10].type == (ushort) 396) - { - if (WorldGen.genRand.Next(2) == 0) - flag = true; - Main.tile[index9, index10].type = (ushort) 400; - WorldGen.SquareTileFrame(index9, index10); - NetMessage.SendTileSquare(-1, index9, index10, 1); - } - else if (Main.tile[index9, index10].type == (ushort) 397) - { - if (WorldGen.genRand.Next(2) == 0) - flag = true; - Main.tile[index9, index10].type = (ushort) 398; - WorldGen.SquareTileFrame(index9, index10); - NetMessage.SendTileSquare(-1, index9, index10, 1); - } - else if (Main.tile[index9, index10].type == (ushort) 59) - { - if (WorldGen.genRand.Next(2) == 0) - flag = true; - Main.tile[index9, index10].type = (ushort) 0; - WorldGen.SquareTileFrame(index9, index10); - NetMessage.SendTileSquare(-1, index9, index10, 1); - } - else if (Main.tile[index9, index10].type == (ushort) 60) - { - if (WorldGen.genRand.Next(2) == 0) - flag = true; - Main.tile[index9, index10].type = (ushort) 23; - WorldGen.SquareTileFrame(index9, index10); - NetMessage.SendTileSquare(-1, index9, index10, 1); - } - else if (Main.tile[index9, index10].type == (ushort) 69) - { - if (WorldGen.genRand.Next(2) == 0) - flag = true; - Main.tile[index9, index10].type = (ushort) 32; - WorldGen.SquareTileFrame(index9, index10); - NetMessage.SendTileSquare(-1, index9, index10, 1); - } - else if (Main.tile[index9, index10].type == (ushort) 161) - { - if (WorldGen.genRand.Next(2) == 0) - flag = true; - Main.tile[index9, index10].type = (ushort) 163; - WorldGen.SquareTileFrame(index9, index10); - NetMessage.SendTileSquare(-1, index9, index10, 1); - } + if (WorldGen.genRand.Next(2) == 0) + flag1 = true; + Main.tile[index9, index10].type = (ushort) 23; + WorldGen.SquareTileFrame(index9, index10); + NetMessage.SendTileSquare(-1, index9, index10, 1); + } + else if (Main.tile[index9, index10].type == (ushort) 1 || Main.tileMoss[(int) Main.tile[index9, index10].type]) + { + if (WorldGen.genRand.Next(2) == 0) + flag1 = true; + Main.tile[index9, index10].type = (ushort) 25; + WorldGen.SquareTileFrame(index9, index10); + NetMessage.SendTileSquare(-1, index9, index10, 1); + } + else if (Main.tile[index9, index10].type == (ushort) 53) + { + if (WorldGen.genRand.Next(2) == 0) + flag1 = true; + Main.tile[index9, index10].type = (ushort) 112; + WorldGen.SquareTileFrame(index9, index10); + NetMessage.SendTileSquare(-1, index9, index10, 1); + } + else if (Main.tile[index9, index10].type == (ushort) 396) + { + if (WorldGen.genRand.Next(2) == 0) + flag1 = true; + Main.tile[index9, index10].type = (ushort) 400; + WorldGen.SquareTileFrame(index9, index10); + NetMessage.SendTileSquare(-1, index9, index10, 1); + } + else if (Main.tile[index9, index10].type == (ushort) 397) + { + if (WorldGen.genRand.Next(2) == 0) + flag1 = true; + Main.tile[index9, index10].type = (ushort) 398; + WorldGen.SquareTileFrame(index9, index10); + NetMessage.SendTileSquare(-1, index9, index10, 1); + } + else if (Main.tile[index9, index10].type == (ushort) 59) + { + if (WorldGen.genRand.Next(2) == 0) + flag1 = true; + Main.tile[index9, index10].type = (ushort) 0; + WorldGen.SquareTileFrame(index9, index10); + NetMessage.SendTileSquare(-1, index9, index10, 1); + } + else if (Main.tile[index9, index10].type == (ushort) 60) + { + if (WorldGen.genRand.Next(2) == 0) + flag1 = true; + Main.tile[index9, index10].type = (ushort) 23; + WorldGen.SquareTileFrame(index9, index10); + NetMessage.SendTileSquare(-1, index9, index10, 1); + } + else if (Main.tile[index9, index10].type == (ushort) 69) + { + if (WorldGen.genRand.Next(2) == 0) + flag1 = true; + Main.tile[index9, index10].type = (ushort) 32; + WorldGen.SquareTileFrame(index9, index10); + NetMessage.SendTileSquare(-1, index9, index10, 1); + } + else if (Main.tile[index9, index10].type == (ushort) 161) + { + if (WorldGen.genRand.Next(2) == 0) + flag1 = true; + Main.tile[index9, index10].type = (ushort) 163; + WorldGen.SquareTileFrame(index9, index10); + NetMessage.SendTileSquare(-1, index9, index10, 1); } } } } if (type == 199 || type == 200 || type == 201 || type == 203 || type == 205 || type == 234 || type == 352 || type == 401 || type == 399) { - bool flag = true; - while (flag) + bool flag4 = true; + while (flag4) { - flag = false; - int index11 = i + WorldGen.genRand.Next(-3, 4); - int index12 = j + WorldGen.genRand.Next(-3, 4); - if (!WorldGen.nearbyChlorophyte(index11, index12)) + flag4 = false; + int index14 = i + WorldGen.genRand.Next(-3, 4); + int index15 = j + WorldGen.genRand.Next(-3, 4); + bool flag5 = WorldGen.nearbyChlorophyte(index14, index15); + if (!(Main.tile[index14, index15 - 1].type == (ushort) 27 | flag5)) { - if (WorldGen.CountNearBlocksTypes(index11, index12, 2, 1, 27) <= 0) + if (Main.tile[index14, index15].type == (ushort) 2) { - if (Main.tile[index11, index12].type == (ushort) 2) - { - if (WorldGen.genRand.Next(2) == 0) - flag = true; - Main.tile[index11, index12].type = (ushort) 199; - WorldGen.SquareTileFrame(index11, index12); - NetMessage.SendTileSquare(-1, index11, index12, 1); - } - else if (Main.tile[index11, index12].type == (ushort) 1 || Main.tileMoss[(int) Main.tile[index11, index12].type]) - { - if (WorldGen.genRand.Next(2) == 0) - flag = true; - Main.tile[index11, index12].type = (ushort) 203; - WorldGen.SquareTileFrame(index11, index12); - NetMessage.SendTileSquare(-1, index11, index12, 1); - } - else if (Main.tile[index11, index12].type == (ushort) 53) - { - if (WorldGen.genRand.Next(2) == 0) - flag = true; - Main.tile[index11, index12].type = (ushort) 234; - WorldGen.SquareTileFrame(index11, index12); - NetMessage.SendTileSquare(-1, index11, index12, 1); - } - else if (Main.tile[index11, index12].type == (ushort) 396) - { - if (WorldGen.genRand.Next(2) == 0) - flag = true; - Main.tile[index11, index12].type = (ushort) 401; - WorldGen.SquareTileFrame(index11, index12); - NetMessage.SendTileSquare(-1, index11, index12, 1); - } - else if (Main.tile[index11, index12].type == (ushort) 397) - { - if (WorldGen.genRand.Next(2) == 0) - flag = true; - Main.tile[index11, index12].type = (ushort) 399; - WorldGen.SquareTileFrame(index11, index12); - NetMessage.SendTileSquare(-1, index11, index12, 1); - } - else if (Main.tile[index11, index12].type == (ushort) 59) - { - if (WorldGen.genRand.Next(2) == 0) - flag = true; - Main.tile[index11, index12].type = (ushort) 0; - WorldGen.SquareTileFrame(index11, index12); - NetMessage.SendTileSquare(-1, index11, index12, 1); - } - else if (Main.tile[index11, index12].type == (ushort) 60) - { - if (WorldGen.genRand.Next(2) == 0) - flag = true; - Main.tile[index11, index12].type = (ushort) 199; - WorldGen.SquareTileFrame(index11, index12); - NetMessage.SendTileSquare(-1, index11, index12, 1); - } - else if (Main.tile[index11, index12].type == (ushort) 69) - { - if (WorldGen.genRand.Next(2) == 0) - flag = true; - Main.tile[index11, index12].type = (ushort) 352; - WorldGen.SquareTileFrame(index11, index12); - NetMessage.SendTileSquare(-1, index11, index12, 1); - } - else if (Main.tile[index11, index12].type == (ushort) 161) - { - if (WorldGen.genRand.Next(2) == 0) - flag = true; - Main.tile[index11, index12].type = (ushort) 200; - WorldGen.SquareTileFrame(index11, index12); - NetMessage.SendTileSquare(-1, index11, index12, 1); - } + if (WorldGen.genRand.Next(2) == 0) + flag4 = true; + Main.tile[index14, index15].type = (ushort) 199; + WorldGen.SquareTileFrame(index14, index15); + NetMessage.SendTileSquare(-1, index14, index15, 1); + } + else if (Main.tile[index14, index15].type == (ushort) 1 || Main.tileMoss[(int) Main.tile[index14, index15].type]) + { + if (WorldGen.genRand.Next(2) == 0) + flag4 = true; + Main.tile[index14, index15].type = (ushort) 203; + WorldGen.SquareTileFrame(index14, index15); + NetMessage.SendTileSquare(-1, index14, index15, 1); + } + else if (Main.tile[index14, index15].type == (ushort) 53) + { + if (WorldGen.genRand.Next(2) == 0) + flag4 = true; + Main.tile[index14, index15].type = (ushort) 234; + WorldGen.SquareTileFrame(index14, index15); + NetMessage.SendTileSquare(-1, index14, index15, 1); + } + else if (Main.tile[index14, index15].type == (ushort) 396) + { + if (WorldGen.genRand.Next(2) == 0) + flag4 = true; + Main.tile[index14, index15].type = (ushort) 401; + WorldGen.SquareTileFrame(index14, index15); + NetMessage.SendTileSquare(-1, index14, index15, 1); + } + else if (Main.tile[index14, index15].type == (ushort) 397) + { + if (WorldGen.genRand.Next(2) == 0) + flag4 = true; + Main.tile[index14, index15].type = (ushort) 399; + WorldGen.SquareTileFrame(index14, index15); + NetMessage.SendTileSquare(-1, index14, index15, 1); + } + else if (Main.tile[index14, index15].type == (ushort) 59) + { + if (WorldGen.genRand.Next(2) == 0) + flag4 = true; + Main.tile[index14, index15].type = (ushort) 0; + WorldGen.SquareTileFrame(index14, index15); + NetMessage.SendTileSquare(-1, index14, index15, 1); + } + else if (Main.tile[index14, index15].type == (ushort) 60) + { + if (WorldGen.genRand.Next(2) == 0) + flag4 = true; + Main.tile[index14, index15].type = (ushort) 199; + WorldGen.SquareTileFrame(index14, index15); + NetMessage.SendTileSquare(-1, index14, index15, 1); + } + else if (Main.tile[index14, index15].type == (ushort) 69) + { + if (WorldGen.genRand.Next(2) == 0) + flag4 = true; + Main.tile[index14, index15].type = (ushort) 352; + WorldGen.SquareTileFrame(index14, index15); + NetMessage.SendTileSquare(-1, index14, index15, 1); + } + else if (Main.tile[index14, index15].type == (ushort) 161) + { + if (WorldGen.genRand.Next(2) == 0) + flag4 = true; + Main.tile[index14, index15].type = (ushort) 200; + WorldGen.SquareTileFrame(index14, index15); + NetMessage.SendTileSquare(-1, index14, index15, 1); } } } } - if (type != 109 && type != 110 && type != 113 && type != 115 && type != 116 && type != 117 && type != 164 && type != 402 && type != 403 && type != 492) + if (type != 109 && type != 110 && type != 113 && type != 115 && type != 116 && type != 117 && type != 164 && type != 402 && type != 403) return; - bool flag1 = true; - while (flag1) + bool flag6 = true; + while (flag6) { - flag1 = false; - int index13 = i + WorldGen.genRand.Next(-3, 4); - int index14 = j + WorldGen.genRand.Next(-3, 4); - if (WorldGen.CountNearBlocksTypes(index13, index14, 2, 1, 27) <= 0) + flag6 = false; + int index16 = i + WorldGen.genRand.Next(-3, 4); + int index17 = j + WorldGen.genRand.Next(-3, 4); + if (Main.tile[index16, index17].type == (ushort) 2) { - if (Main.tile[index13, index14].type == (ushort) 2) - { - if (WorldGen.genRand.Next(2) == 0) - flag1 = true; - Main.tile[index13, index14].type = (ushort) 109; - WorldGen.SquareTileFrame(index13, index14); - NetMessage.SendTileSquare(-1, index13, index14, 1); - } - else if (Main.tile[index13, index14].type == (ushort) 477) - { - if (WorldGen.genRand.Next(2) == 0) - flag1 = true; - Main.tile[index13, index14].type = (ushort) 492; - WorldGen.SquareTileFrame(index13, index14); - NetMessage.SendTileSquare(-1, index13, index14, 1); - } - else if (Main.tile[index13, index14].type == (ushort) 1 || Main.tileMoss[(int) Main.tile[index13, index14].type]) - { - if (WorldGen.genRand.Next(2) == 0) - flag1 = true; - Main.tile[index13, index14].type = (ushort) 117; - WorldGen.SquareTileFrame(index13, index14); - NetMessage.SendTileSquare(-1, index13, index14, 1); - } - else if (Main.tile[index13, index14].type == (ushort) 53) - { - if (WorldGen.genRand.Next(2) == 0) - flag1 = true; - Main.tile[index13, index14].type = (ushort) 116; - WorldGen.SquareTileFrame(index13, index14); - NetMessage.SendTileSquare(-1, index13, index14, 1); - } - else if (Main.tile[index13, index14].type == (ushort) 396) - { - if (WorldGen.genRand.Next(2) == 0) - flag1 = true; - Main.tile[index13, index14].type = (ushort) 403; - WorldGen.SquareTileFrame(index13, index14); - NetMessage.SendTileSquare(-1, index13, index14, 1); - } - else if (Main.tile[index13, index14].type == (ushort) 397) - { - if (WorldGen.genRand.Next(2) == 0) - flag1 = true; - Main.tile[index13, index14].type = (ushort) 402; - WorldGen.SquareTileFrame(index13, index14); - NetMessage.SendTileSquare(-1, index13, index14, 1); - } - else if (Main.tile[index13, index14].type == (ushort) 161) - { - if (WorldGen.genRand.Next(2) == 0) - flag1 = true; - Main.tile[index13, index14].type = (ushort) 164; - WorldGen.SquareTileFrame(index13, index14); - NetMessage.SendTileSquare(-1, index13, index14, 1); - } + if (WorldGen.genRand.Next(2) == 0) + flag6 = true; + Main.tile[index16, index17].type = (ushort) 109; + WorldGen.SquareTileFrame(index16, index17); + NetMessage.SendTileSquare(-1, index16, index17, 1); + } + else if (Main.tile[index16, index17].type == (ushort) 1 || Main.tileMoss[(int) Main.tile[index16, index17].type]) + { + if (WorldGen.genRand.Next(2) == 0) + flag6 = true; + Main.tile[index16, index17].type = (ushort) 117; + WorldGen.SquareTileFrame(index16, index17); + NetMessage.SendTileSquare(-1, index16, index17, 1); + } + else if (Main.tile[index16, index17].type == (ushort) 53) + { + if (WorldGen.genRand.Next(2) == 0) + flag6 = true; + Main.tile[index16, index17].type = (ushort) 116; + WorldGen.SquareTileFrame(index16, index17); + NetMessage.SendTileSquare(-1, index16, index17, 1); + } + else if (Main.tile[index16, index17].type == (ushort) 396) + { + if (WorldGen.genRand.Next(2) == 0) + flag6 = true; + Main.tile[index16, index17].type = (ushort) 403; + WorldGen.SquareTileFrame(index16, index17); + NetMessage.SendTileSquare(-1, index16, index17, 1); + } + else if (Main.tile[index16, index17].type == (ushort) 397) + { + if (WorldGen.genRand.Next(2) == 0) + flag6 = true; + Main.tile[index16, index17].type = (ushort) 402; + WorldGen.SquareTileFrame(index16, index17); + NetMessage.SendTileSquare(-1, index16, index17, 1); + } + else if (Main.tile[index16, index17].type == (ushort) 161) + { + if (WorldGen.genRand.Next(2) == 0) + flag6 = true; + Main.tile[index16, index17].type = (ushort) 164; + WorldGen.SquareTileFrame(index16, index17); + NetMessage.SendTileSquare(-1, index16, index17, 1); } } } @@ -42233,13 +30482,9 @@ label_296: public static bool SolidOrSlopedTile(Tile tile) => tile != null && tile.active() && Main.tileSolid[(int) tile.type] && !Main.tileSolidTop[(int) tile.type] && !tile.inActive(); - public static int TileType(int x, int y) => !Main.tile[x, y].active() ? -1 : (int) Main.tile[x, y].type; - public static bool SolidOrSlopedTile(int x, int y) => WorldGen.SolidOrSlopedTile(Main.tile[x, y]); - public static bool SolidTile(Point p) => WorldGen.SolidTile(p.X, p.Y); - - public static bool SolidTile(int i, int j, bool noDoors = false) + public static bool SolidTile(int i, int j) { try { @@ -42256,7 +30501,7 @@ label_296: if (Main.tile[i, j].slope() == (byte) 0) { if (!Main.tile[i, j].inActive()) - return !noDoors || Main.tile[i, j].type != (ushort) 10; + return true; } } } @@ -42342,176 +30587,6 @@ label_12: return false; } - public static bool SolidTileAllowTopSlope(int i, int j) - { - try - { - Tile tile = Main.tile[i, j]; - if (tile == null) - return true; - if (tile.active()) - { - if (Main.tileSolid[(int) tile.type]) - { - if (tile.bottomSlope()) - { - if (TileID.Sets.Platforms[(int) tile.type]) - { - if (!tile.halfBrick()) - goto label_10; - } - else - goto label_10; - } - if (!tile.inActive()) - return true; - } - } - } - catch - { - } -label_10: - return false; - } - - public static bool TopEdgeCanBeAttachedTo(int i, int j) - { - try - { - Tile tile = Main.tile[i, j]; - if (tile == null) - return true; - if (tile.active()) - { - if (!Main.tileSolid[(int) tile.type]) - { - if (!Main.tileSolidTop[(int) tile.type]) - goto label_12; - } - if (tile.topSlope()) - { - if (TileID.Sets.Platforms[(int) tile.type]) - { - if (!WorldGen.PlatformProperTopFrame(tile.frameX)) - goto label_12; - } - else - goto label_12; - } - if (!tile.halfBrick()) - { - if (!tile.inActive()) - return true; - } - } - } - catch - { - } -label_12: - return false; - } - - public static bool RightEdgeCanBeAttachedTo(int i, int j) - { - try - { - Tile tile = Main.tile[i, j]; - if (tile == null) - return true; - if (tile.active()) - { - if (Main.tileSolid[(int) tile.type]) - { - if (!Main.tileSolidTop[(int) tile.type]) - { - if (!tile.rightSlope()) - { - if (!tile.halfBrick()) - { - if (!tile.inActive()) - { - if (!Main.tileNoAttach[(int) tile.type]) - return true; - } - } - } - } - } - } - } - catch - { - } - return false; - } - - public static bool LeftEdgeCanBeAttachedTo(int i, int j) - { - try - { - Tile tile = Main.tile[i, j]; - if (tile == null) - return true; - if (tile.active()) - { - if (Main.tileSolid[(int) tile.type]) - { - if (!Main.tileSolidTop[(int) tile.type]) - { - if (!tile.leftSlope()) - { - if (!tile.halfBrick()) - { - if (!tile.inActive()) - { - if (!Main.tileNoAttach[(int) tile.type]) - return true; - } - } - } - } - } - } - } - catch - { - } - return false; - } - - public static bool BottomEdgeCanBeAttachedTo(int i, int j) - { - try - { - Tile tile = Main.tile[i, j]; - if (tile == null) - return true; - if (tile.active()) - { - if (Main.tileSolid[(int) tile.type]) - { - if (!Main.tileSolidTop[(int) tile.type]) - { - if (!tile.bottomSlope()) - { - if (!tile.inActive()) - { - if (!Main.tileNoAttach[(int) tile.type]) - return true; - } - } - } - } - } - } - catch - { - } - return false; - } - public static bool SolidTile3(int i, int j) => WorldGen.InWorld(i, j, 1) && WorldGen.SolidTile3(Main.tile[i, j]); public static bool SolidTile3(Tile t) => t != null && t.active() && !t.inActive() && Main.tileSolid[(int) t.type] && !Main.tileSolidTop[(int) t.type]; @@ -42526,15 +30601,13 @@ label_12: { if (Main.tileSolid[(int) Main.tile[i, j].type]) { - if (!TileID.Sets.Platforms[(int) Main.tile[i, j].type] || !Main.tile[i, j].halfBrick() && !Main.tile[i, j].topSlope()) + if (Main.tile[i, j].slope() == (byte) 0) { - if (Main.tile[i, j].slope() != (byte) 0) - goto label_10; - } - if (!Main.tile[i, j].halfBrick()) - { - if (!Main.tile[i, j].inActive()) - return true; + if (!Main.tile[i, j].halfBrick()) + { + if (!Main.tile[i, j].inActive()) + return true; + } } } } @@ -42542,7 +30615,6 @@ label_12: catch { } -label_10: return false; } @@ -42576,6 +30648,76 @@ label_10: return false; } + public static Vector2 Hive(int i, int j) + { + double num1 = (double) WorldGen.genRand.Next(12, 21); + double num2 = num1; + float num3 = (float) WorldGen.genRand.Next(10, 21); + Vector2 vector2_1; + vector2_1.X = (float) i; + vector2_1.Y = (float) j; + Vector2 vector2_2; + vector2_2.X = (float) WorldGen.genRand.Next(-10, 11) * 0.2f; + vector2_2.Y = (float) WorldGen.genRand.Next(-10, 11) * 0.2f; + while (num1 > 0.0 && (double) num3 > 0.0) + { + num1 = num2 * (1.0 + (double) WorldGen.genRand.Next(-20, 20) * 0.00999999977648258); + float num4 = num3 - 1f; + int num5 = (int) ((double) vector2_1.X - num1); + int num6 = (int) ((double) vector2_1.X + num1); + int num7 = (int) ((double) vector2_1.Y - num1); + int num8 = (int) ((double) vector2_1.Y + num1); + if (num5 < 1) + num5 = 1; + if (num6 > Main.maxTilesX - 1) + num6 = Main.maxTilesX - 1; + if (num7 < 1) + num7 = 1; + if (num8 > Main.maxTilesY - 1) + num8 = Main.maxTilesY - 1; + for (int i1 = num5; i1 < num6; ++i1) + { + for (int j1 = num7; j1 < num8; ++j1) + { + double num9 = (double) Math.Abs((float) i1 - vector2_1.X); + float num10 = Math.Abs((float) j1 - vector2_1.Y); + double num11 = Math.Sqrt(num9 * num9 + (double) num10 * (double) num10); + if (num11 < num2 * 0.4 * (1.0 + (double) WorldGen.genRand.Next(-10, 11) * 0.005)) + { + if (WorldGen.genRand.Next(3) == 0) + Main.tile[i1, j1].liquid = byte.MaxValue; + Main.tile[i1, j1].honey(true); + Main.tile[i1, j1].wall = (byte) 86; + Main.tile[i1, j1].active(false); + Main.tile[i1, j1].halfBrick(false); + Main.tile[i1, j1].slope((byte) 0); + WorldGen.SquareWallFrame(i1, j1); + } + else if (num11 < num2 * 0.75 * (1.0 + (double) WorldGen.genRand.Next(-10, 11) * 0.005)) + { + Main.tile[i1, j1].liquid = (byte) 0; + if (Main.tile[i1, j1].wall != (byte) 86) + { + Main.tile[i1, j1].active(true); + Main.tile[i1, j1].halfBrick(false); + Main.tile[i1, j1].slope((byte) 0); + Main.tile[i1, j1].type = (ushort) 225; + } + } + if (num11 < num2 * 0.6 * (1.0 + (double) WorldGen.genRand.Next(-10, 11) * 0.005)) + Main.tile[i1, j1].wall = (byte) 86; + WorldGen.SquareWallFrame(i1, j1); + WorldGen.SquareTileFrame(i1, j1); + } + } + vector2_1 += vector2_2; + num3 = num4 - 1f; + vector2_2.Y += (float) WorldGen.genRand.Next(-10, 11) * 0.05f; + vector2_2.X += (float) WorldGen.genRand.Next(-10, 11) * 0.05f; + } + return new Vector2(vector2_1.X, vector2_1.Y); + } + public static void MineHouse(int i, int j) { if (i < 50 || i > Main.maxTilesX - 50 || j < 50 || j > Main.maxTilesY - 50) @@ -42584,7 +30726,7 @@ label_10: int num2 = WorldGen.genRand.Next(3, 6); int num3 = WorldGen.genRand.Next(15, 30); int num4 = WorldGen.genRand.Next(15, 30); - if (WorldGen.SolidTile(i, j) || Main.tile[i, j].wall > (ushort) 0) + if (WorldGen.SolidTile(i, j) || Main.tile[i, j].wall > (byte) 0) return; int num5 = j - num1; int num6 = j + num2; @@ -42621,7 +30763,7 @@ label_10: } while (flag2) { - if (i1 != i && Main.tile[i1 - num7, j2].wall != (ushort) 27 && (WorldGen.SolidTile(i1 - num7, j2) || !Main.tile[i1 - num7, j2].active() || Main.tile[i1 - num7, j2].halfBrick() || Main.tile[i1 - num7, j2].slope() != (byte) 0)) + if (i1 != i && Main.tile[i1 - num7, j2].wall != (byte) 27 && (WorldGen.SolidTile(i1 - num7, j2) || !Main.tile[i1 - num7, j2].active() || Main.tile[i1 - num7, j2].halfBrick() || Main.tile[i1 - num7, j2].slope() != (byte) 0)) { Main.tile[i1 - num7, j2].active(true); Main.tile[i1 - num7, j2].type = (ushort) 30; @@ -42653,7 +30795,7 @@ label_10: } else { - Main.tile[i1, j2].wall = (ushort) 27; + Main.tile[i1, j2].wall = (byte) 27; Main.tile[i1, j2].liquid = (byte) 0; Main.tile[i1, j2].lava(false); } @@ -42728,17 +30870,17 @@ label_10: { for (int j5 = minValue2; j5 < maxValue2; ++j5) { - if (Main.tile[i2, j5].wall == (ushort) 27 && !Main.tile[i2, j5].active()) + if (Main.tile[i2, j5].wall == (byte) 27 && !Main.tile[i2, j5].active()) { - if (Main.tile[i2 - 1, j5].wall != (ushort) 27 && i2 < i && !WorldGen.SolidTile(i2 - 1, j5)) + if (Main.tile[i2 - 1, j5].wall != (byte) 27 && i2 < i && !WorldGen.SolidTile(i2 - 1, j5)) { WorldGen.PlaceTile(i2, j5, 30, true); - Main.tile[i2, j5].wall = (ushort) 0; + Main.tile[i2, j5].wall = (byte) 0; } - if (Main.tile[i2 + 1, j5].wall != (ushort) 27 && i2 > i && !WorldGen.SolidTile(i2 + 1, j5)) + if (Main.tile[i2 + 1, j5].wall != (byte) 27 && i2 > i && !WorldGen.SolidTile(i2 + 1, j5)) { WorldGen.PlaceTile(i2, j5, 30, true); - Main.tile[i2, j5].wall = (ushort) 0; + Main.tile[i2, j5].wall = (byte) 0; } for (int i3 = i2 - 1; i3 <= i2 + 1; ++i3) { @@ -42749,10 +30891,10 @@ label_10: } } } - if (Main.tile[i2, j5].type == (ushort) 30 && Main.tile[i2 - 1, j5].wall == (ushort) 27 && Main.tile[i2 + 1, j5].wall == (ushort) 27 && (Main.tile[i2, j5 - 1].wall == (ushort) 27 || Main.tile[i2, j5 - 1].active()) && (Main.tile[i2, j5 + 1].wall == (ushort) 27 || Main.tile[i2, j5 + 1].active())) + if (Main.tile[i2, j5].type == (ushort) 30 && Main.tile[i2 - 1, j5].wall == (byte) 27 && Main.tile[i2 + 1, j5].wall == (byte) 27 && (Main.tile[i2, j5 - 1].wall == (byte) 27 || Main.tile[i2, j5 - 1].active()) && (Main.tile[i2, j5 + 1].wall == (byte) 27 || Main.tile[i2, j5 + 1].active())) { Main.tile[i2, j5].active(false); - Main.tile[i2, j5].wall = (ushort) 27; + Main.tile[i2, j5].wall = (byte) 27; } } } @@ -42762,22 +30904,22 @@ label_10: { if (Main.tile[index3, index4].type == (ushort) 30) { - if (Main.tile[index3 - 1, index4].wall == (ushort) 27 && Main.tile[index3 + 1, index4].wall == (ushort) 27 && !Main.tile[index3 - 1, index4].active() && !Main.tile[index3 + 1, index4].active()) + if (Main.tile[index3 - 1, index4].wall == (byte) 27 && Main.tile[index3 + 1, index4].wall == (byte) 27 && !Main.tile[index3 - 1, index4].active() && !Main.tile[index3 + 1, index4].active()) { Main.tile[index3, index4].active(false); - Main.tile[index3, index4].wall = (ushort) 27; + Main.tile[index3, index4].wall = (byte) 27; } - if (!TileID.Sets.BasicChest[(int) Main.tile[index3, index4 - 1].type] && Main.tile[index3 - 1, index4].wall == (ushort) 27 && Main.tile[index3 + 1, index4].type == (ushort) 30 && Main.tile[index3 + 2, index4].wall == (ushort) 27 && !Main.tile[index3 - 1, index4].active() && !Main.tile[index3 + 2, index4].active()) + if (!TileID.Sets.BasicChest[(int) Main.tile[index3, index4 - 1].type] && Main.tile[index3 - 1, index4].wall == (byte) 27 && Main.tile[index3 + 1, index4].type == (ushort) 30 && Main.tile[index3 + 2, index4].wall == (byte) 27 && !Main.tile[index3 - 1, index4].active() && !Main.tile[index3 + 2, index4].active()) { Main.tile[index3, index4].active(false); - Main.tile[index3, index4].wall = (ushort) 27; + Main.tile[index3, index4].wall = (byte) 27; Main.tile[index3 + 1, index4].active(false); - Main.tile[index3 + 1, index4].wall = (ushort) 27; + Main.tile[index3 + 1, index4].wall = (byte) 27; } - if (Main.tile[index3, index4 - 1].wall == (ushort) 27 && Main.tile[index3, index4 + 1].wall == (ushort) 27 && !Main.tile[index3, index4 - 1].active() && !Main.tile[index3, index4 + 1].active()) + if (Main.tile[index3, index4 - 1].wall == (byte) 27 && Main.tile[index3, index4 + 1].wall == (byte) 27 && !Main.tile[index3, index4 - 1].active() && !Main.tile[index3, index4 + 1].active()) { Main.tile[index3, index4].active(false); - Main.tile[index3, index4].wall = (ushort) 27; + Main.tile[index3, index4].wall = (byte) 27; } } } @@ -42792,12 +30934,12 @@ label_10: int num14 = -1; for (int index5 = 0; index5 < 2; ++index5) { - if (!WorldGen.SolidTile(i4 + num14, j7) && Main.tile[i4 + num14, j7].wall == (ushort) 0) + if (!WorldGen.SolidTile(i4 + num14, j7) && Main.tile[i4 + num14, j7].wall == (byte) 0) { int num15 = 0; int j8 = j7; int num16 = j7; - while (Main.tile[i4, j8].active() && Main.tile[i4, j8].type == (ushort) 30 && !WorldGen.SolidTile(i4 + num14, j8) && Main.tile[i4 + num14, j8].wall == (ushort) 0) + while (Main.tile[i4, j8].active() && Main.tile[i4, j8].type == (ushort) 30 && !WorldGen.SolidTile(i4 + num14, j8) && Main.tile[i4 + num14, j8].wall == (byte) 0) { --j8; ++num15; @@ -42936,7 +31078,7 @@ label_10: { for (int j11 = minValue2; j11 < maxValue2; ++j11) { - if (Main.tile[i5, j11].wall == (ushort) 27 && !Main.tile[i5, j11].active()) + if (Main.tile[i5, j11].wall == (byte) 27 && !Main.tile[i5, j11].active()) WorldGen.PlaceTile(i5, j11, 124, true); } } @@ -42945,39 +31087,39 @@ label_10: { int i7 = WorldGen.genRand.Next(minValue1 + 2, maxValue1 - 1); int index22; - for (index22 = WorldGen.genRand.Next(minValue2 + 2, maxValue2 - 1); Main.tile[i7, index22].wall != (ushort) 27; index22 = WorldGen.genRand.Next(minValue2 + 2, maxValue2 - 1)) + for (index22 = WorldGen.genRand.Next(minValue2 + 2, maxValue2 - 1); Main.tile[i7, index22].wall != (byte) 27; index22 = WorldGen.genRand.Next(minValue2 + 2, maxValue2 - 1)) i7 = WorldGen.genRand.Next(minValue1 + 2, maxValue1 - 1); while (Main.tile[i7, index22].active()) --index22; while (!Main.tile[i7, index22].active()) ++index22; int j12 = index22 - 1; - if (Main.tile[i7, j12].wall == (ushort) 27) + if (Main.tile[i7, j12].wall == (byte) 27) { if (WorldGen.genRand.Next(3) == 0) { - int Type = WorldGen.genRand.Next(9); - if (Type == 0) - Type = 14; - if (Type == 1) - Type = 16; - if (Type == 2) - Type = 18; - if (Type == 3) - Type = 86; - if (Type == 4) - Type = 87; - if (Type == 5) - Type = 94; - if (Type == 6) - Type = 101; - if (Type == 7) - Type = 104; - if (Type == 8) - Type = 106; - WorldGen.PlaceTile(i7, j12, Type, true); + int type = WorldGen.genRand.Next(9); + if (type == 0) + type = 14; + if (type == 1) + type = 16; + if (type == 2) + type = 18; + if (type == 3) + type = 86; + if (type == 4) + type = 87; + if (type == 5) + type = 94; + if (type == 6) + type = 101; + if (type == 7) + type = 104; + if (type == 8) + type = 106; + WorldGen.PlaceTile(i7, j12, type, true); } - else if (WorldGen.statueList != null) + else { int index23 = WorldGen.genRand.Next(2, WorldGen.statueList.Length); WorldGen.PlaceTile(i7, j12, (int) WorldGen.statueList[index23].X, true, true, style: ((int) WorldGen.statueList[index23].Y)); @@ -42988,14 +31130,14 @@ label_10: { int i8 = WorldGen.genRand.Next(minValue1 + 2, maxValue1 - 1); int index25; - for (index25 = WorldGen.genRand.Next(minValue2 + 2, maxValue2 - 1); Main.tile[i8, index25].wall != (ushort) 27; index25 = WorldGen.genRand.Next(minValue2 + 2, maxValue2 - 1)) + for (index25 = WorldGen.genRand.Next(minValue2 + 2, maxValue2 - 1); Main.tile[i8, index25].wall != (byte) 27; index25 = WorldGen.genRand.Next(minValue2 + 2, maxValue2 - 1)) i8 = WorldGen.genRand.Next(minValue1 + 2, maxValue1 - 1); while (Main.tile[i8, index25].active()) --index25; while (!Main.tile[i8, index25].active()) ++index25; int j13 = index25 - 1; - if (Main.tile[i8, j13].wall == (ushort) 27 && WorldGen.genRand.Next(2) == 0) + if (Main.tile[i8, j13].wall == (byte) 27 && WorldGen.genRand.Next(2) == 0) { int style = WorldGen.genRand.Next(22, 26); WorldGen.PlaceTile(i8, j13, 186, true, style: style); @@ -43005,14 +31147,14 @@ label_10: { int i9 = WorldGen.genRand.Next(minValue1 + 2, maxValue1 - 1); int index27; - for (index27 = WorldGen.genRand.Next(minValue2 + 2, maxValue2 - 1); Main.tile[i9, index27].wall != (ushort) 27; index27 = WorldGen.genRand.Next(minValue2 + 2, maxValue2 - 1)) + for (index27 = WorldGen.genRand.Next(minValue2 + 2, maxValue2 - 1); Main.tile[i9, index27].wall != (byte) 27; index27 = WorldGen.genRand.Next(minValue2 + 2, maxValue2 - 1)) i9 = WorldGen.genRand.Next(minValue1 + 2, maxValue1 - 1); while (Main.tile[i9, index27].active()) --index27; while (!Main.tile[i9, index27].active()) ++index27; int j14 = index27 - 1; - if (Main.tile[i9, j14].wall == (ushort) 27 && WorldGen.genRand.Next(2) == 0) + if (Main.tile[i9, j14].wall == (byte) 27 && WorldGen.genRand.Next(2) == 0) { int X = WorldGen.genRand.Next(31, 34); WorldGen.PlaceSmallPile(i9, j14, X, 1); @@ -43022,31 +31164,31 @@ label_10: { int i10 = WorldGen.genRand.Next(minValue1 + 2, maxValue1 - 1); int j15; - for (j15 = WorldGen.genRand.Next(minValue2 + 2, maxValue2 - 1); Main.tile[i10, j15].wall != (ushort) 27; j15 = WorldGen.genRand.Next(minValue2 + 2, maxValue2 - 1)) + for (j15 = WorldGen.genRand.Next(minValue2 + 2, maxValue2 - 1); Main.tile[i10, j15].wall != (byte) 27; j15 = WorldGen.genRand.Next(minValue2 + 2, maxValue2 - 1)) i10 = WorldGen.genRand.Next(minValue1 + 2, maxValue1 - 1); while (Main.tile[i10, j15].active()) --j15; while (j15 > 0 && !Main.tile[i10, j15 - 1].active()) --j15; - if (Main.tile[i10, j15].wall == (ushort) 27) + if (Main.tile[i10, j15].wall == (byte) 27) { int style = 0; - int Type; + int type; if (WorldGen.genRand.Next(10) < 9) { - Type = -1; + type = -1; } else { - Type = 34; + type = 34; style = WorldGen.genRand.Next(6); } - if (Type > 0) + if (type > 0) { - WorldGen.PlaceTile(i10, j15, Type, true, style: style); - if ((int) Main.tile[i10, j15].type == Type) + WorldGen.PlaceTile(i10, j15, type, true, style: style); + if ((int) Main.tile[i10, j15].type == type) { - if (Type == 4) + if (type == 4) { Main.tile[i10, j15].frameX += (short) 54; } @@ -43156,8 +31298,8 @@ label_10: WorldGen.totalGood2 += WorldGen.tileCounts[164] + WorldGen.tileCounts[109] + WorldGen.tileCounts[117] + WorldGen.tileCounts[116]; WorldGen.totalEvil2 += WorldGen.tileCounts[23] + WorldGen.tileCounts[163] + WorldGen.tileCounts[112] + WorldGen.tileCounts[25]; WorldGen.totalBlood2 += WorldGen.tileCounts[199] + WorldGen.tileCounts[234] + WorldGen.tileCounts[203] + WorldGen.tileCounts[200]; - WorldGen.totalSolid2 += WorldGen.tileCounts[2] + WorldGen.tileCounts[477] + WorldGen.tileCounts[1] + WorldGen.tileCounts[60] + WorldGen.tileCounts[53] + WorldGen.tileCounts[161]; - WorldGen.totalSolid2 += WorldGen.tileCounts[164] + WorldGen.tileCounts[109] + WorldGen.tileCounts[492] + WorldGen.tileCounts[117] + WorldGen.tileCounts[116]; + WorldGen.totalSolid2 += WorldGen.tileCounts[2] + WorldGen.tileCounts[1] + WorldGen.tileCounts[60] + WorldGen.tileCounts[53] + WorldGen.tileCounts[161]; + WorldGen.totalSolid2 += WorldGen.tileCounts[164] + WorldGen.tileCounts[109] + WorldGen.tileCounts[117] + WorldGen.tileCounts[116]; WorldGen.totalSolid2 += WorldGen.tileCounts[23] + WorldGen.tileCounts[163] + WorldGen.tileCounts[112] + WorldGen.tileCounts[25]; WorldGen.totalSolid2 += WorldGen.tileCounts[199] + WorldGen.tileCounts[234] + WorldGen.tileCounts[203] + WorldGen.tileCounts[200]; Array.Clear((Array) WorldGen.tileCounts, 0, WorldGen.tileCounts.Length); @@ -43243,7 +31385,7 @@ label_10: } else { - if (j >= Main.UnderworldLayer) + if (j >= Main.maxTilesY - 200) return; if (!Main.tile[i, j - 1].active() || Main.tile[i, j - 1].type == (ushort) 3 || Main.tile[i, j - 1].type == (ushort) 51 || Main.tile[i, j - 1].type == (ushort) 61 || Main.tile[i, j - 1].type == (ushort) 73 || Main.tile[i, j - 1].type == (ushort) 74 || Main.tile[i, j - 1].type == (ushort) 184) { @@ -43300,62 +31442,12 @@ label_10: } } - private static int MossConversion(int thisType, int otherType) - { - if (TileID.Sets.tileMossBrick[thisType] && otherType == 38 || Main.tileMoss[thisType] && otherType == 1) - return thisType; - switch (thisType) - { - case 179: - return 512; - case 180: - return 513; - case 181: - return 514; - case 182: - return 515; - case 183: - return 516; - case 381: - return 517; - case 512: - return 179; - case 513: - return 180; - case 514: - return 181; - case 515: - return 182; - case 516: - return 183; - case 517: - return 381; - case 534: - return 535; - case 535: - return 534; - case 536: - return 537; - case 537: - return 536; - case 539: - return 540; - case 540: - return 539; - default: - return 0; - } - } - public static void UpdateWorld() { - if (WorldGen.gen) - return; - WorldGen.AllowedToSpreadInfections = true; - CreativePowers.StopBiomeSpreadPower power = CreativePowerManager.Instance.GetPower(); - if (power != null && power.GetIsUnlocked()) - WorldGen.AllowedToSpreadInfections = !power.Enabled; - int wallDist = 3; + int wallDist = 20; + int maxValue1 = 40; + if (Main.expertMode) + maxValue1 = 30; Wiring.UpdateMech(); TileEntity.UpdateStart(); foreach (TileEntity tileEntity in TileEntity.ByID.Values) @@ -43374,32 +31466,31 @@ label_10: WorldGen.totalX = 0; } } + if (Main.worldRate == 0) + return; ++Liquid.skipCount; if (Liquid.skipCount > 1) { Liquid.UpdateLiquid(); Liquid.skipCount = 0; } - int worldUpdateRate = WorldGen.GetWorldUpdateRate(); - if (worldUpdateRate == 0) - return; - float num1 = 3E-05f * (float) worldUpdateRate; - float num2 = 1.5E-05f * (float) worldUpdateRate; - bool checkNPCSpawns = false; + float num1 = 3E-05f * (float) Main.worldRate; + float num2 = 1.5E-05f * (float) Main.worldRate; + bool flag1 = false; ++WorldGen.spawnDelay; if (Main.invasionType > 0 || Main.eclipse) WorldGen.spawnDelay = 0; if (WorldGen.spawnDelay >= 20) { - checkNPCSpawns = true; + flag1 = true; WorldGen.spawnDelay = 0; - if (WorldGen.prioritizedTownNPCType != 37) + if (WorldGen.prioritizedTownNPC != 37) { for (int index = 0; index < 200; ++index) { if (Main.npc[index].active && Main.npc[index].homeless && Main.npc[index].townNPC && Main.npc[index].type != 368) { - WorldGen.prioritizedTownNPCType = Main.npc[index].type; + WorldGen.prioritizedTownNPC = Main.npc[index].type; break; } } @@ -43407,1571 +31498,1329 @@ label_10: } float num3 = (float) (Main.maxTilesX * Main.maxTilesY) * num1; int num4 = 151; - int num5 = (int) MathHelper.Lerp((float) num4, (float) num4 * 2.8f, MathHelper.Clamp((float) ((double) Main.maxTilesX / 4200.0 - 1.0), 0.0f, 1f)); - for (int index = 0; (double) index < (double) num3; ++index) + int maxValue2 = (int) MathHelper.Lerp((float) num4, (float) num4 * 2.8f, MathHelper.Clamp((float) ((double) Main.maxTilesX / 4200.0 - 1.0), 0.0f, 1f)); + for (int index1 = 0; (double) index1 < (double) num3; ++index1) { - if (Main.rand.Next(num5 * 100) == 0) + if (Main.rand.Next(100) == 0 && Main.rand.Next(maxValue2) == 0) WorldGen.PlantAlch(); - WorldGen.UpdateWorld_OvergroundTile(WorldGen.genRand.Next(10, Main.maxTilesX - 10), WorldGen.genRand.Next(10, (int) Main.worldSurface - 1), checkNPCSpawns, wallDist); - } - for (int index = 0; (double) index < (double) (Main.maxTilesX * Main.maxTilesY) * (double) num2; ++index) - WorldGen.UpdateWorld_UndergroundTile(WorldGen.genRand.Next(10, Main.maxTilesX - 10), WorldGen.genRand.Next((int) Main.worldSurface - 1, Main.maxTilesY - 20), checkNPCSpawns, wallDist); - if (Main.dayTime) - return; - for (int index = 0; index < Main.dayRate; ++index) - { - float num6 = (float) (Main.maxTilesX / 4200) * Star.starfallBoost; - if ((double) Main.rand.Next(8000) < 10.0 * (double) num6) + int index2 = WorldGen.genRand.Next(10, Main.maxTilesX - 10); + int index3 = WorldGen.genRand.Next(10, (int) Main.worldSurface - 1); + int num5 = index2 - 1; + int num6 = index2 + 2; + int index4 = index3 - 1; + int num7 = index3 + 2; + if (num5 < 10) + num5 = 10; + if (num6 > Main.maxTilesX - 10) + num6 = Main.maxTilesX - 10; + if (index4 < 10) + index4 = 10; + if (num7 > Main.maxTilesY - 10) + num7 = Main.maxTilesY - 10; + if (Main.tile[index2, index3] != null) { - int num7 = 12; - Vector2 Position = new Vector2((float) ((Main.rand.Next(Main.maxTilesX - 50) + 100) * 16), (float) (Main.rand.Next((int) ((double) Main.maxTilesY * 0.05)) * 16)); - int num8 = -1; - if (Main.expertMode && Main.rand.Next(15) == 0) + if (Main.tileAlch[(int) Main.tile[index2, index3].type]) + WorldGen.GrowAlch(index2, index3); + if (Main.tile[index2, index3].liquid > (byte) 32) { - int closest = (int) Player.FindClosest(Position, 1, 1); - if ((double) Main.player[closest].position.Y < Main.worldSurface * 16.0 && Main.player[closest].afkCounter < 3600) + if (Main.tile[index2, index3].active() && (Main.tile[index2, index3].type == (ushort) 3 || Main.tile[index2, index3].type == (ushort) 20 || Main.tile[index2, index3].type == (ushort) 24 || Main.tile[index2, index3].type == (ushort) 27 || Main.tile[index2, index3].type == (ushort) 73 || Main.tile[index2, index3].type == (ushort) 201)) { - int num9 = Main.rand.Next(1, 640); - Position.X = Main.player[closest].position.X + (float) Main.rand.Next(-num9, num9 + 1); - num8 = closest; + WorldGen.KillTile(index2, index3); + if (Main.netMode == 2) + NetMessage.SendData(17, number2: ((float) index2), number3: ((float) index3)); } } - if (!Collision.SolidCollision(Position, 16, 16)) + else if (Main.tile[index2, index3].nactive()) { - float num10 = (float) Main.rand.Next(-100, 101); - float num11 = (float) (Main.rand.Next(200) + 100); - float num12 = (float) Math.Sqrt((double) num10 * (double) num10 + (double) num11 * (double) num11); - float num13 = (float) num7 / num12; - float SpeedX = num10 * num13; - float SpeedY = num11 * num13; - Projectile.NewProjectile(Position.X, Position.Y, SpeedX, SpeedY, 720, 0, 0.0f, Main.myPlayer, ai1: ((float) num8)); - } - } - } - } - - public static int GetWorldUpdateRate() - { - int num = Math.Min(Main.desiredWorldTilesUpdateRate, 24); - if (CreativePowerManager.Instance.GetPower().Enabled) - num = 0; - return num; - } - - private static void UpdateWorld_OvergroundTile( - int i, - int j, - bool checkNPCSpawns, - int wallDist) - { - int minI = i - 1; - int maxI = i + 2; - int index1 = j - 1; - int maxJ = j + 2; - if (minI < 10) - minI = 10; - if (maxI > Main.maxTilesX - 10) - maxI = Main.maxTilesX - 10; - if (index1 < 10) - index1 = 10; - if (maxJ > Main.maxTilesY - 10) - maxJ = Main.maxTilesY - 10; - if (Main.tile[i, j] == null) - return; - if (Main.tileAlch[(int) Main.tile[i, j].type]) - WorldGen.GrowAlch(i, j); - else if ((double) j < Main.worldSurface + 10.0 && (i < WorldGen.beachDistance || i > Main.maxTilesX - WorldGen.beachDistance) && !Main.tile[i, j].nactive()) - { - int maxValue = 3000 - (int) ((double) Math.Abs(Main.windSpeedCurrent) * 1250.0); - if (Main.raining) - maxValue -= (int) (1250.0 * (double) Main.maxRaining); - if (maxValue < 300) - maxValue = 300; - if (WorldGen.genRand.Next(maxValue) == 0) - { - int j1 = j; - while ((double) j1 < Main.worldSurface + 10.0 && !Main.tile[i, j1].nactive() && j1 - j < 15) - ++j1; - if (Main.tile[i, j1].nactive() && Main.tile[i, j1].type == (ushort) 53 && WorldGen.SolidTileAllowBottomSlope(i, j1)) - { - int index2 = j1 - 1; - int num1 = WorldGen.genRand.Next(2, 5); - int num2 = WorldGen.genRand.Next(8, 11); - int num3 = 0; - for (int index3 = i - num2; index3 <= i + num2; ++index3) + WorldGen.hardUpdateWorld(index2, index3); + if (Main.rand.Next(3000) == 0) + WorldGen.plantDye(index2, index3); + if (Main.rand.Next(9001) == 0) + WorldGen.plantDye(index2, index3, true); + if (Main.tile[index2, index3].type == (ushort) 80) { - for (int index4 = index2 - num2; index4 <= index2 + num2; ++index4) - { - if (Main.tile[index3, index4].active() && (Main.tile[index3, index4].type == (ushort) 324 || Main.tile[index3, index4].type == (ushort) 81)) - ++num3; - } + if (WorldGen.genRand.Next(15) == 0) + WorldGen.GrowCactus(index2, index3); } - if (num3 < num1) + else if (TileID.Sets.Conversion.Sand[(int) Main.tile[index2, index3].type]) { - if (WorldGen.genRand.Next(2) == 0 && Main.tile[i, index2].liquid >= (byte) 230) + if (!Main.tile[index2, index4].active()) { - WorldGen.PlaceTile(i, index2, 81); - if (Main.netMode == 2 && Main.tile[i, index2].active()) - NetMessage.SendTileSquare(-1, i, index2, 3); - } - else - { - WorldGen.PlaceTile(i, index2, 324, style: WorldGen.RollRandomSeaShellStyle()); - if (Main.netMode == 2 && Main.tile[i, index2].active()) - NetMessage.SendTileSquare(-1, i, index2, 3); - } - } - } - } - } - if ((Main.tile[i, j].type == (ushort) 596 || Main.tile[i, j].type == (ushort) 616 || Main.tile[i, j].type == (ushort) 595 || Main.tile[i, j].type == (ushort) 615) && (Main.tile[i, j + 1].type == (ushort) 199 || Main.tile[i, j + 1].type == (ushort) 23)) - { - WorldGen.KillTile(i, j); - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, i, j, 4); - } - if ((Main.tile[i, j].type == (ushort) 571 || Main.tile[i, j].type == (ushort) 60 && Main.tile[i, j - 1].liquid > (byte) 0) && WorldGen.genRand.Next(5) == 0 && (!Main.tile[i, j - 1].active() || Main.tile[i, j - 1].type == (ushort) 61 || Main.tile[i, j - 1].type == (ushort) 74 || Main.tile[i, j - 1].type == (ushort) 518) && (Main.tile[i, j].type != (ushort) 60 || WorldGen.genRand.Next(30) == 0) && WorldGen.PlaceBamboo(i, j - 1)) - NetMessage.SendTileSquare(-1, i, j, 3); - if (Main.tile[i, j].type == (ushort) 518) - { - if (Main.tile[i, j].liquid == (byte) 0 || (int) Main.tile[i, j].liquid / 16 >= 9 && WorldGen.SolidTile(i, j - 1) || Main.tile[i, j - 1].liquid > (byte) 0 && Main.tile[i, j - 1].active()) - { - WorldGen.KillTile(i, j); - if (Main.netMode == 2) - NetMessage.SendData(17, number2: ((float) i), number3: ((float) j)); - } - else - WorldGen.CheckLilyPad(i, j); - } - else if (Main.tile[i, j].type == (ushort) 519) - { - WorldGen.CheckCatTail(i, j); - if (Main.tile[i, j].active() && WorldGen.genRand.Next(8) == 0) - { - WorldGen.GrowCatTail(i, j); - WorldGen.CheckCatTail(i, j); - } - } - else if (Main.tile[i, j].liquid > (byte) 32) - { - if (Main.tile[i, j].active()) - { - if (TileID.Sets.SlowlyDiesInWater[(int) Main.tile[i, j].type]) - { - WorldGen.KillTile(i, j); - if (Main.netMode == 2) - NetMessage.SendData(17, number2: ((float) i), number3: ((float) j)); - } - else if (Main.tile[i, j].type == (ushort) 60) - WorldGen.UpdateWorld_GrassGrowth(i, j, minI, maxI, index1, maxJ, false); - } - else if (WorldGen.genRand.Next(600) == 0) - { - WorldGen.PlaceTile(i, j, 518, true); - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, i, j, 3); - } - else if (WorldGen.genRand.Next(600) == 0) - { - WorldGen.PlaceTile(i, j, 519, true); - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, i, j, 3); - } - } - else if (Main.tile[i, j].nactive()) - { - WorldGen.hardUpdateWorld(i, j); - if (Main.rand.Next(3000) == 0) - WorldGen.plantDye(i, j); - else if (Main.hardMode && ((double) i < (double) Main.maxTilesX * 0.4 || (double) i > (double) Main.maxTilesX * 0.6) && Main.rand.Next(15000) == 0) - WorldGen.plantDye(i, j, true); - if (Main.tile[i, j].type == (ushort) 80) - { - if (WorldGen.genRand.Next(15) == 0) - WorldGen.GrowCactus(i, j); - } - else if (Main.tile[i, j].type == (ushort) 529) - { - if (WorldGen.CheckSeaOat(i, j) && WorldGen.genRand.Next(20) == 0) - WorldGen.GrowSeaOat(i, j); - } - else if (TileID.Sets.Conversion.Sand[(int) Main.tile[i, j].type]) - { - if (!Main.tile[i, index1].active()) - { - if (WorldGen.genRand.Next(25) == 0) - { - WorldGen.PlaceOasisPlant(i, index1); - if (Main.tile[i, index1].type == (ushort) 530 && Main.netMode == 2) - NetMessage.SendTileSquare(-1, i, index1, 4); - } - if (WorldGen.genRand.Next(20) != 0 || !WorldGen.PlantSeaOat(i, index1)) - { - if (i < WorldGen.oceanDistance || i > Main.maxTilesX - WorldGen.oceanDistance) - { - if (WorldGen.genRand.Next(500) == 0) + if (index2 < 250 || index2 > Main.maxTilesX - 250) { - int num4 = 7; - int num5 = 6; - int num6 = 0; - for (int index5 = i - num4; index5 <= i + num4; ++index5) + if (WorldGen.genRand.Next(500) == 0) { - for (int index6 = index1 - num4; index6 <= index1 + num4; ++index6) + int num8 = 7; + int num9 = 6; + int num10 = 0; + for (int index5 = index2 - num8; index5 <= index2 + num8; ++index5) { - if (Main.tile[index5, index6].active() && Main.tile[index5, index6].type == (ushort) 81) - ++num6; + for (int index6 = index4 - num8; index6 <= index4 + num8; ++index6) + { + if (Main.tile[index5, index6].active() && Main.tile[index5, index6].type == (ushort) 81) + ++num10; + } + } + if (num10 < num9 && Main.tile[index2, index4].liquid == byte.MaxValue && Main.tile[index2, index4 - 1].liquid == byte.MaxValue && Main.tile[index2, index4 - 2].liquid == byte.MaxValue && Main.tile[index2, index4 - 3].liquid == byte.MaxValue && Main.tile[index2, index4 - 4].liquid == byte.MaxValue) + { + WorldGen.PlaceTile(index2, index4, 81, true); + if (Main.netMode == 2 && Main.tile[index2, index4].active()) + NetMessage.SendTileSquare(-1, index2, index4, 1); } } - if (num6 < num5 && Main.tile[i, index1].liquid == byte.MaxValue && Main.tile[i, index1 - 1].liquid == byte.MaxValue && Main.tile[i, index1 - 2].liquid == byte.MaxValue && Main.tile[i, index1 - 3].liquid == byte.MaxValue && Main.tile[i, index1 - 4].liquid == byte.MaxValue) + } + else if (index2 > 400 && index2 < Main.maxTilesX - 400 && WorldGen.genRand.Next(300) == 0) + WorldGen.GrowCactus(index2, index3); + } + } + else if (Main.tile[index2, index3].type == (ushort) 116 || Main.tile[index2, index3].type == (ushort) 112 || Main.tile[index2, index3].type == (ushort) 234) + { + if (!Main.tile[index2, index4].active() && index2 > 400 && index2 < Main.maxTilesX - 400 && WorldGen.genRand.Next(300) == 0) + WorldGen.GrowCactus(index2, index3); + } + else if (Main.tile[index2, index3].type == (ushort) 147 || Main.tile[index2, index3].type == (ushort) 161 || Main.tile[index2, index3].type == (ushort) 163 || Main.tile[index2, index3].type == (ushort) 164 || Main.tile[index2, index3].type == (ushort) 200) + { + if (Main.rand.Next(10) == 0 && !Main.tile[index2, index3 + 1].active() && !Main.tile[index2, index3 + 2].active()) + { + int num11 = index2 - 3; + int num12 = index2 + 4; + int num13 = 0; + for (int index7 = num11; index7 < num12; ++index7) + { + if (Main.tile[index7, index3].type == (ushort) 165 && Main.tile[index7, index3].active()) + ++num13; + if (Main.tile[index7, index3 + 1].type == (ushort) 165 && Main.tile[index7, index3 + 1].active()) + ++num13; + if (Main.tile[index7, index3 + 2].type == (ushort) 165 && Main.tile[index7, index3 + 2].active()) + ++num13; + if (Main.tile[index7, index3 + 3].type == (ushort) 165 && Main.tile[index7, index3 + 3].active()) + ++num13; + } + if (num13 < 2) + { + WorldGen.PlaceTight(index2, index3 + 1); + WorldGen.SquareTileFrame(index2, index3 + 1); + if (Main.netMode == 2 && Main.tile[index2, index3 + 1].active()) + NetMessage.SendTileSquare(-1, index2, index3 + 1, 3); + } + } + } + else if (Main.tile[index2, index3].type == (ushort) 254) + { + if (Main.rand.Next(((int) Main.tile[index2, index3].frameX + 10) / 10) == 0) + WorldGen.GrowPumpkin(index2, index3, 254); + } + else if (Main.tile[index2, index3].type == (ushort) 78 || Main.tile[index2, index3].type == (ushort) 380) + { + if (!Main.tile[index2, index4].active() && WorldGen.genRand.Next(2) == 0) + { + WorldGen.PlaceTile(index2, index4, 3, true); + if (Main.netMode == 2 && Main.tile[index2, index4].active()) + NetMessage.SendTileSquare(-1, index2, index4, 1); + } + } + else if (Main.tile[index2, index3].type == (ushort) 2 || Main.tile[index2, index3].type == (ushort) 23 || Main.tile[index2, index3].type == (ushort) 32 || Main.tile[index2, index3].type == (ushort) 109 || Main.tile[index2, index3].type == (ushort) 199 || Main.tile[index2, index3].type == (ushort) 352) + { + int grass = (int) Main.tile[index2, index3].type; + if (Main.halloween && WorldGen.genRand.Next(75) == 0 && (grass == 2 || grass == 109)) + { + int num14 = 100; + int num15 = 0; + for (int index8 = index2 - num14; index8 < index2 + num14; index8 += 2) + { + for (int index9 = index3 - num14; index9 < index3 + num14; index9 += 2) { - WorldGen.PlaceTile(i, index1, 81, true); - if (Main.netMode == 2 && Main.tile[i, index1].active()) - NetMessage.SendTileSquare(-1, i, index1, 1); + if (index8 > 1 && index8 < Main.maxTilesX - 2 && index9 > 1 && index9 < Main.maxTilesY - 2 && Main.tile[index8, index9].active() && Main.tile[index8, index9].type == (ushort) 254) + ++num15; } } - } - else if (i > WorldGen.beachDistance + 20 && i < Main.maxTilesX - WorldGen.beachDistance - 20 && WorldGen.genRand.Next(300) == 0) - WorldGen.GrowCactus(i, j); - } - } - } - else if (Main.tile[i, j].type == (ushort) 530) - { - if (!WorldGen.OasisPlantWaterCheck(i, j, true)) - { - WorldGen.KillTile(i, j); - if (Main.netMode == 2) - NetMessage.SendData(17, number2: ((float) i), number3: ((float) j)); - } - } - else if (Main.tile[i, j].type == (ushort) 147 || Main.tile[i, j].type == (ushort) 161 || Main.tile[i, j].type == (ushort) 163 || Main.tile[i, j].type == (ushort) 164 || Main.tile[i, j].type == (ushort) 200) - { - if (Main.rand.Next(10) == 0 && !Main.tile[i, j + 1].active() && !Main.tile[i, j + 2].active()) - { - int num7 = i - 3; - int num8 = i + 4; - int num9 = 0; - for (int index7 = num7; index7 < num8; ++index7) - { - if (Main.tile[index7, j].type == (ushort) 165 && Main.tile[index7, j].active()) - ++num9; - if (Main.tile[index7, j + 1].type == (ushort) 165 && Main.tile[index7, j + 1].active()) - ++num9; - if (Main.tile[index7, j + 2].type == (ushort) 165 && Main.tile[index7, j + 2].active()) - ++num9; - if (Main.tile[index7, j + 3].type == (ushort) 165 && Main.tile[index7, j + 3].active()) - ++num9; - } - if (num9 < 2) - { - WorldGen.PlaceTight(i, j + 1); - WorldGen.SquareTileFrame(i, j + 1); - if (Main.netMode == 2 && Main.tile[i, j + 1].active()) - NetMessage.SendTileSquare(-1, i, j + 1, 3); - } - } - } - else if (Main.tile[i, j].type == (ushort) 254) - { - if (Main.rand.Next(((int) Main.tile[i, j].frameX + 10) / 10) == 0) - WorldGen.GrowPumpkin(i, j, 254); - } - else if (Main.tile[i, j].type == (ushort) 78 || Main.tile[i, j].type == (ushort) 380 || Main.tile[i, j].type == (ushort) 579) - { - if (!Main.tile[i, index1].active() && WorldGen.genRand.Next(2) == 0) - { - WorldGen.PlaceTile(i, index1, 3, true); - if (Main.netMode == 2 && Main.tile[i, index1].active()) - NetMessage.SendTileSquare(-1, i, index1, 1); - } - } - else if (TileID.Sets.SpreadOverground[(int) Main.tile[i, j].type]) - WorldGen.UpdateWorld_GrassGrowth(i, j, minI, maxI, index1, maxJ, false); - else if (Main.tileMoss[(int) Main.tile[i, j].type] || TileID.Sets.tileMossBrick[(int) Main.tile[i, j].type]) - { - if ((double) WorldGen.genRand.NextFloat() < 0.5) - { - int type1 = (int) Main.tile[i, j].type; - bool flag = false; - for (int i1 = minI; i1 < maxI; ++i1) - { - for (int j2 = index1; j2 < maxJ; ++j2) - { - if ((i != i1 || j != j2) && Main.tile[i1, j2].active() && (Main.tile[i1, j2].type == (ushort) 1 || Main.tile[i1, j2].type == (ushort) 38)) + if (num15 < 6) { - int type2 = (int) Main.tile[i1, j2].type; - WorldGen.SpreadGrass(i1, j2, (int) Main.tile[i1, j2].type, WorldGen.MossConversion(type1, type2), false, Main.tile[i, j].color()); - if ((int) Main.tile[i1, j2].type == type1) - { - WorldGen.SquareTileFrame(i1, j2); - flag = true; - } + WorldGen.PlacePumpkin(index2, index4); + if (Main.netMode == 2 && Main.tile[index2, index4].type == (ushort) 254) + NetMessage.SendTileSquare(-1, index2, index4, 4); } } - } - if (Main.netMode == 2 & flag) - NetMessage.SendTileSquare(-1, i, j, 3); - if (WorldGen.genRand.Next(6) == 0) - { - int index8 = i; - int index9 = j; - switch (WorldGen.genRand.Next(4)) + if (!Main.tile[index2, index4].active() && WorldGen.genRand.Next(12) == 0 && grass == 2 && WorldGen.PlaceTile(index2, index4, 3, true)) { - case 0: - --index8; - break; - case 1: - ++index8; - break; - case 2: - --index9; - break; - default: - ++index9; - break; - } - if (!Main.tile[index8, index9].active()) - { - if (WorldGen.PlaceTile(index8, index9, 184, true)) - Main.tile[index8, index9].color(Main.tile[i, j].color()); - if (Main.netMode == 2 && Main.tile[index8, index9].active()) - NetMessage.SendTileSquare(-1, index8, index9, 1); - } - } - } - } - else if (Main.tile[i, j].type == (ushort) 20) - { - if (WorldGen.genRand.Next(20) == 0) - { - bool flag = WorldGen.PlayerLOS(i, j); - if ((Main.tile[i, j].frameX < (short) 324 || Main.tile[i, j].frameX >= (short) 540 ? WorldGen.GrowTree(i, j) : WorldGen.GrowPalmTree(i, j)) & flag) - WorldGen.TreeGrowFXCheck(i, j); - } - } - else if (Main.tile[i, j].type == (ushort) 595) - { - if (WorldGen.genRand.Next(5) == 0) - { - int num = (int) Main.tile[i, j].frameX / 54; - int treeTileType = 596; - if (num == 0) - treeTileType = 596; - if (WorldGen.TryGrowingTreeByType(treeTileType, i, j) && WorldGen.PlayerLOS(i, j)) - WorldGen.TreeGrowFXCheck(i, j); - } - } - else if (Main.tile[i, j].type == (ushort) 615) - { - if (WorldGen.genRand.Next(5) == 0) - { - int num = (int) Main.tile[i, j].frameX / 54; - int treeTileType = 616; - if (num == 0) - treeTileType = 616; - if (WorldGen.TryGrowingTreeByType(treeTileType, i, j) && WorldGen.PlayerLOS(i, j)) - WorldGen.TreeGrowFXCheck(i, j); - } - } - else if (Main.tile[i, j].type == (ushort) 3 && WorldGen.genRand.Next(20) == 0) - { - if (Main.tile[i, j].frameX != (short) 144) - { - Main.tile[i, j].type = (ushort) 73; - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, i, j, 3); - } - } - else if (Main.tile[i, j].type == (ushort) 110 && WorldGen.genRand.Next(20) == 0) - { - if (Main.tile[i, j].frameX < (short) 144) - { - Main.tile[i, j].type = (ushort) 113; - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, i, j, 3); - } - } - else if (Main.tile[i, j].type == (ushort) 32 && WorldGen.genRand.Next(3) == 0) - WorldGen.GrowSpike(i, j, (ushort) 32, (ushort) 23); - else if (Main.tile[i, j].type == (ushort) 352 && WorldGen.genRand.Next(3) == 0) - WorldGen.GrowSpike(i, j, (ushort) 352, (ushort) 199); - } - else if (checkNPCSpawns) - WorldGen.TrySpawningTownNPC(i, j); - if (WorldGen.AllowedToSpreadInfections) - { - if (Main.tile[i, j].wall == (ushort) 81 || Main.tile[i, j].wall == (ushort) 83 || Main.tile[i, j].type == (ushort) 199 && Main.tile[i, j].active()) - { - int tileX = i + WorldGen.genRand.Next(-2, 3); - int tileY = j + WorldGen.genRand.Next(-2, 3); - if (Main.tile[tileX, tileY].wall >= (ushort) 63 && Main.tile[tileX, tileY].wall <= (ushort) 68) - { - bool flag = false; -label_187: - for (int index10 = i - wallDist; index10 < i + wallDist; ++index10) - { - for (int index11 = j - wallDist; index11 < j + wallDist; ++index11) - { - if (Main.tile[i, j].active()) - { - switch (Main.tile[i, j].type) - { - case 199: - case 200: - case 201: - case 203: - case 205: - case 234: - case 352: - flag = true; - goto label_187; - default: - continue; - } - } - } - } - if (flag) - { - Main.tile[tileX, tileY].wall = (ushort) 81; - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, tileX, tileY, 3); - } - } - } - else if (Main.tile[i, j].wall == (ushort) 69 || Main.tile[i, j].wall == (ushort) 3 || Main.tile[i, j].type == (ushort) 23 && Main.tile[i, j].active()) - { - int tileX = i + WorldGen.genRand.Next(-2, 3); - int tileY = j + WorldGen.genRand.Next(-2, 3); - if (Main.tile[tileX, tileY].wall >= (ushort) 63 && Main.tile[tileX, tileY].wall <= (ushort) 68) - { - bool flag = false; -label_201: - for (int index12 = i - wallDist; index12 < i + wallDist; ++index12) - { - for (int index13 = j - wallDist; index13 < j + wallDist; ++index13) - { - if (Main.tile[index12, index13].active()) - { - switch (Main.tile[index12, index13].type) - { - case 22: - case 23: - case 24: - case 25: - case 32: - case 112: - case 163: - flag = true; - goto label_201; - default: - continue; - } - } - } - } - if (flag) - { - Main.tile[tileX, tileY].wall = (ushort) 69; - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, tileX, tileY, 3); - } - } - } - else if (Main.tile[i, j].wall == (ushort) 70 || Main.tile[i, j].type == (ushort) 109 && Main.tile[i, j].active()) - { - int tileX = i + WorldGen.genRand.Next(-2, 3); - int tileY = j + WorldGen.genRand.Next(-2, 3); - if (Main.tile[tileX, tileY].wall == (ushort) 63 || Main.tile[tileX, tileY].wall == (ushort) 65 || Main.tile[tileX, tileY].wall == (ushort) 66 || Main.tile[tileX, tileY].wall == (ushort) 68) - { - bool flag = false; -label_215: - for (int index14 = i - wallDist; index14 < i + wallDist; ++index14) - { - for (int index15 = j - wallDist; index15 < j + wallDist; ++index15) - { - if (Main.tile[index14, index15].active()) - { - switch (Main.tile[index14, index15].type) - { - case 109: - case 110: - case 113: - case 115: - case 116: - case 117: - case 164: - flag = true; - goto label_215; - default: - continue; - } - } - } - } - if (flag) - { - Main.tile[tileX, tileY].wall = (ushort) 70; - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, tileX, tileY, 3); - } - } - } - WorldGen.SpreadDesertWalls(wallDist, i, j); - } - if (!Main.tile[i, j].nactive()) - return; - if ((Main.tile[i, j].type == (ushort) 2 || Main.tile[i, j].type == (ushort) 52 || Main.tile[i, j].type == (ushort) 382 || Main.tile[i, j].type == (ushort) 192 && WorldGen.genRand.Next(10) == 0) && WorldGen.GrowMoreVines(i, j)) - { - int maxValue = 60; - if (Main.tile[i, j].type == (ushort) 52 || Main.tile[i, j].type == (ushort) 382) - maxValue = 20; - if (WorldGen.genRand.Next(maxValue) == 0 && !Main.tile[i, j + 1].active() && !Main.tile[i, j + 1].lava()) - { - bool flag = false; - ushort num = 52; - if (Main.tile[i, j].type == (ushort) 382) - num = (ushort) 382; - else if (Main.tile[i, j].type != (ushort) 52) - { - if (Main.tile[i, j].wall == (ushort) 68 || Main.tile[i, j].wall == (ushort) 65 || Main.tile[i, j].wall == (ushort) 66 || Main.tile[i, j].wall == (ushort) 63) - num = (ushort) 382; - else if (Main.tile[i, j + 1].wall == (ushort) 68 || Main.tile[i, j + 1].wall == (ushort) 65 || Main.tile[i, j + 1].wall == (ushort) 66 || Main.tile[i, j + 1].wall == (ushort) 63) - num = (ushort) 382; - } - for (int index16 = j; index16 > j - 10; --index16) - { - if (Main.tile[i, index16].bottomSlope()) - { - flag = false; - break; - } - if (Main.tile[i, index16].active() && Main.tile[i, index16].type == (ushort) 2 && !Main.tile[i, index16].bottomSlope()) - { - flag = true; - break; - } - } - if (flag) - { - int index17 = i; - int index18 = j + 1; - Main.tile[index17, index18].type = num; - Main.tile[index17, index18].active(true); - Main.tile[index17, index18].color(Main.tile[i, j].color()); - WorldGen.SquareTileFrame(index17, index18); - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, index17, index18, 3); - } - } - } - else if (Main.tile[i, j].type == (ushort) 61 && WorldGen.genRand.Next(3) == 0 && Main.tile[i, j].frameX < (short) 144) - { - if (Main.rand.Next(4) == 0) - Main.tile[i, j].frameX = (short) (162 + WorldGen.genRand.Next(8) * 18); - Main.tile[i, j].type = (ushort) 74; - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, i, j, 3); - } - if ((Main.tile[i, j].type == (ushort) 60 || Main.tile[i, j].type == (ushort) 62) && WorldGen.GrowMoreVines(i, j)) - { - int maxValue = 30; - if (Main.tile[i, j].type == (ushort) 62) - maxValue = 10; - if (WorldGen.genRand.Next(maxValue) != 0 || Main.tile[i, j + 1].active() || Main.tile[i, j + 1].lava()) - return; - bool flag = false; - for (int index19 = j; index19 > j - 10; --index19) - { - if (Main.tile[i, index19].bottomSlope()) - { - flag = false; - break; - } - if (Main.tile[i, index19].active() && Main.tile[i, index19].type == (ushort) 60 && !Main.tile[i, index19].bottomSlope()) - { - flag = true; - break; - } - } - if (!flag) - return; - int index20 = i; - int index21 = j + 1; - Main.tile[index20, index21].type = (ushort) 62; - Main.tile[index20, index21].active(true); - WorldGen.SquareTileFrame(index20, index21); - if (Main.netMode != 2) - return; - NetMessage.SendTileSquare(-1, index20, index21, 3); - } - else if ((Main.tile[i, j].type == (ushort) 70 || Main.tile[i, j].type == (ushort) 528) && WorldGen.GrowMoreVines(i, j)) - { - int maxValue = 70; - if (Main.tile[i, j].type == (ushort) 528) - maxValue = 7; - if (WorldGen.genRand.Next(maxValue) != 0 || Main.tile[i, j + 1].active() || Main.tile[i, j + 1].lava()) - return; - bool flag = false; - for (int index22 = j; index22 > j - 10; --index22) - { - if (Main.tile[i, index22].bottomSlope()) - { - flag = false; - break; - } - if (Main.tile[i, index22].active() && Main.tile[i, index22].type == (ushort) 70 && !Main.tile[i, index22].bottomSlope()) - { - flag = true; - break; - } - } - if (!flag) - return; - int index23 = i; - int index24 = j + 1; - Main.tile[index23, index24].type = (ushort) 528; - Main.tile[index23, index24].active(true); - WorldGen.SquareTileFrame(index23, index24); - if (Main.netMode != 2) - return; - NetMessage.SendTileSquare(-1, index23, index24, 3); - } - else if ((Main.tile[i, j].type == (ushort) 109 || Main.tile[i, j].type == (ushort) 115) && WorldGen.GrowMoreVines(i, j)) - { - int maxValue = 60; - if (Main.tile[i, j].type == (ushort) 115) - maxValue = 20; - if (WorldGen.genRand.Next(maxValue) != 0 || Main.tile[i, j + 1].active() || Main.tile[i, j + 1].lava()) - return; - bool flag = false; - for (int index25 = j; index25 > j - 10; --index25) - { - if (Main.tile[i, index25].bottomSlope()) - { - flag = false; - break; - } - if (Main.tile[i, index25].active() && Main.tile[i, index25].type == (ushort) 109 && !Main.tile[i, index25].bottomSlope()) - { - flag = true; - break; - } - } - if (!flag) - return; - int index26 = i; - int index27 = j + 1; - Main.tile[index26, index27].type = (ushort) 115; - Main.tile[index26, index27].active(true); - WorldGen.SquareTileFrame(index26, index27); - if (Main.netMode != 2) - return; - NetMessage.SendTileSquare(-1, index26, index27, 3); - } - else - { - if (Main.tile[i, j].type != (ushort) 199 && Main.tile[i, j].type != (ushort) 205 || !WorldGen.GrowMoreVines(i, j)) - return; - int maxValue = 60; - if (Main.tile[i, j].type == (ushort) 205) - maxValue = 20; - if (WorldGen.genRand.Next(maxValue) != 0 || Main.tile[i, j + 1].active() || Main.tile[i, j + 1].lava()) - return; - bool flag = false; - for (int index28 = j; index28 > j - 10; --index28) - { - if (Main.tile[i, index28].bottomSlope()) - { - flag = false; - break; - } - if (Main.tile[i, index28].active() && Main.tile[i, index28].type == (ushort) 199 && !Main.tile[i, index28].bottomSlope()) - { - flag = true; - break; - } - } - if (!flag) - return; - int index29 = i; - int index30 = j + 1; - Main.tile[index29, index30].type = (ushort) 205; - Main.tile[index29, index30].active(true); - WorldGen.SquareTileFrame(index29, index30); - if (Main.netMode != 2) - return; - NetMessage.SendTileSquare(-1, index29, index30, 3); - } - } - - private static void UpdateWorld_UndergroundTile( - int i, - int j, - bool checkNPCSpawns, - int wallDist) - { - int minI = i - 1; - int maxI = i + 2; - int minJ = j - 1; - int maxJ = j + 2; - if (minI < 10) - minI = 10; - if (maxI > Main.maxTilesX - 10) - maxI = Main.maxTilesX - 10; - if (minJ < 10) - minJ = 10; - if (maxJ > Main.maxTilesY - 10) - maxJ = Main.maxTilesY - 10; - if (Main.tile[i, j] == null) - return; - if (Main.tileAlch[(int) Main.tile[i, j].type]) - WorldGen.GrowAlch(i, j); - else if (Main.tile[i, j].nactive()) - { - WorldGen.hardUpdateWorld(i, j); - if (Main.rand.Next(2500) == 0) - WorldGen.plantDye(i, j); - else if (Main.hardMode && Main.rand.Next(10000) == 0) - WorldGen.plantDye(i, j, true); - if (Main.tile[i, j].type == (ushort) 519) - { - WorldGen.CheckCatTail(i, j); - if (Main.tile[i, j].active() && WorldGen.genRand.Next(2) == 0) - { - WorldGen.GrowCatTail(i, j); - WorldGen.CheckCatTail(i, j); - } - } - if (Main.tile[i, j].type == (ushort) 549) - WorldGen.GrowCheckSeaweed(i, j); - else if (Main.tile[i, j].type == (ushort) 53 && !Main.tile[i, j].topSlope() && !Main.tile[i, j].halfBrick() && !Main.tile[i, j - 1].active() && WorldGen.genRand.Next(20) == 0) - WorldGen.GrowCheckSeaweed(i, j); - else if (TileID.Sets.SpreadUnderground[(int) Main.tile[i, j].type]) - WorldGen.UpdateWorld_GrassGrowth(i, j, minI, maxI, minJ, maxJ, true); - else if (Main.tile[i, j].type == (ushort) 32) - WorldGen.GrowSpike(i, j, (ushort) 32, (ushort) 23); - else if (Main.tile[i, j].type == (ushort) 352 && WorldGen.genRand.Next(3) == 0) - WorldGen.GrowSpike(i, j, (ushort) 352, (ushort) 199); - else if (Main.tile[i, j].type == (ushort) 61 && WorldGen.genRand.Next(3) == 0) - { - if (Main.tile[i, j].frameX < (short) 144) - { - if (Main.rand.Next(4) == 0) - Main.tile[i, j].frameX = (short) (162 + WorldGen.genRand.Next(8) * 18); - Main.tile[i, j].type = (ushort) 74; - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, i, j, 3); - } - } - else if ((Main.tile[i, j].type == (ushort) 60 || Main.tile[i, j].type == (ushort) 62) && WorldGen.genRand.Next(5) == 0 && WorldGen.GrowMoreVines(i, j)) - { - if (!Main.tile[i, j + 1].active() && !Main.tile[i, j + 1].lava()) - { - bool flag = false; - for (int index = j; index > j - 10; --index) - { - if (Main.tile[i, index].bottomSlope()) - { - flag = false; - break; - } - if (Main.tile[i, index].active() && Main.tile[i, index].type == (ushort) 60 && !Main.tile[i, index].bottomSlope()) - { - flag = true; - break; - } - } - if (flag) - { - int index1 = i; - int index2 = j + 1; - Main.tile[index1, index2].type = (ushort) 62; - Main.tile[index1, index2].active(true); - WorldGen.SquareTileFrame(index1, index2); - Main.tile[index1, index2].color(Main.tile[index1, index2 - 1].color()); - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, index1, index2, 3); - } - } - } - else if ((Main.tile[i, j].type == (ushort) 70 || Main.tile[i, j].type == (ushort) 528) && WorldGen.GrowMoreVines(i, j)) - { - if (!Main.tile[i, j + 1].active() && !Main.tile[i, j + 1].lava()) - { - int maxValue = 70; - if (Main.tile[i, j].type == (ushort) 528) - maxValue = 7; - if (WorldGen.genRand.Next(maxValue) == 0) - { - bool flag = false; - for (int index = j; index > j - 10; --index) - { - if (Main.tile[i, index].bottomSlope()) - { - flag = false; - break; - } - if (Main.tile[i, index].active() && Main.tile[i, index].type == (ushort) 70 && !Main.tile[i, index].bottomSlope()) - { - flag = true; - break; - } - } - if (flag) - { - int index3 = i; - int index4 = j + 1; - Main.tile[index3, index4].type = (ushort) 528; - Main.tile[index3, index4].active(true); - Main.tile[index3, index4].color(Main.tile[index3, index4 - 1].color()); - WorldGen.SquareTileFrame(index3, index4); + Main.tile[index2, index4].color(Main.tile[index2, index3].color()); if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, index3, index4, 3); + NetMessage.SendTileSquare(-1, index2, index4, 1); + } + if (!Main.tile[index2, index4].active() && WorldGen.genRand.Next(10) == 0 && grass == 23 && WorldGen.PlaceTile(index2, index4, 24, true)) + { + Main.tile[index2, index4].color(Main.tile[index2, index3].color()); + if (Main.netMode == 2) + NetMessage.SendTileSquare(-1, index2, index4, 1); + } + if (!Main.tile[index2, index4].active() && WorldGen.genRand.Next(10) == 0 && grass == 109 && WorldGen.PlaceTile(index2, index4, 110, true)) + { + Main.tile[index2, index4].color(Main.tile[index2, index3].color()); + if (Main.netMode == 2) + NetMessage.SendTileSquare(-1, index2, index4, 1); + } + if (!Main.tile[index2, index4].active() && WorldGen.genRand.Next(10) == 0 && grass == 199 && WorldGen.PlaceTile(index2, index4, 201, true)) + { + Main.tile[index2, index4].color(Main.tile[index2, index3].color()); + if (Main.netMode == 2) + NetMessage.SendTileSquare(-1, index2, index4, 1); + } + bool flag2 = false; + for (int i = num5; i < num6; ++i) + { + for (int j = index4; j < num7; ++j) + { + if ((index2 != i || index3 != j) && Main.tile[i, j].active()) + { + if (grass == 32) + grass = 23; + if (grass == 352) + grass = 199; + if (Main.tile[i, j].type == (ushort) 0 || grass == 23 && Main.tile[i, j].type == (ushort) 2 || grass == 199 && Main.tile[i, j].type == (ushort) 2 || grass == 23 && Main.tile[i, j].type == (ushort) 109) + { + WorldGen.SpreadGrass(i, j, grass: grass, repeat: false, color: Main.tile[index2, index3].color()); + if (grass == 23) + WorldGen.SpreadGrass(i, j, 2, grass, false, Main.tile[index2, index3].color()); + if (grass == 23) + WorldGen.SpreadGrass(i, j, 109, grass, false, Main.tile[index2, index3].color()); + if (grass == 199) + WorldGen.SpreadGrass(i, j, 2, grass, false, Main.tile[index2, index3].color()); + if (grass == 199) + WorldGen.SpreadGrass(i, j, 109, grass, false, Main.tile[index2, index3].color()); + if ((int) Main.tile[i, j].type == grass) + { + WorldGen.SquareTileFrame(i, j); + flag2 = true; + } + } + if (Main.tile[i, j].type == (ushort) 0 || grass == 109 && Main.tile[i, j].type == (ushort) 2 || grass == 109 && Main.tile[i, j].type == (ushort) 23 || grass == 109 && Main.tile[i, j].type == (ushort) 199) + { + WorldGen.SpreadGrass(i, j, grass: grass, repeat: false, color: Main.tile[index2, index3].color()); + if (grass == 109) + WorldGen.SpreadGrass(i, j, 2, grass, false, Main.tile[index2, index3].color()); + if (grass == 109) + WorldGen.SpreadGrass(i, j, 23, grass, false, Main.tile[index2, index3].color()); + if (grass == 109) + WorldGen.SpreadGrass(i, j, 199, grass, false, Main.tile[index2, index3].color()); + if ((int) Main.tile[i, j].type == grass) + { + WorldGen.SquareTileFrame(i, j); + flag2 = true; + } + } + } + } + } + if (Main.netMode == 2 & flag2) + NetMessage.SendTileSquare(-1, index2, index3, 3); + } + else if (Main.tile[index2, index3].type == (ushort) 20 && WorldGen.genRand.Next(20) == 0) + { + bool flag3 = WorldGen.PlayerLOS(index2, index3); + if ((Main.tile[index2, index3].frameX < (short) 324 || Main.tile[index2, index3].frameX >= (short) 540 ? WorldGen.GrowTree(index2, index3) : WorldGen.GrowPalmTree(index2, index3)) & flag3) + WorldGen.TreeGrowFXCheck(index2, index3); + } + if (Main.tile[index2, index3].type == (ushort) 3 && WorldGen.genRand.Next(20) == 0 && Main.tile[index2, index3].frameX != (short) 144) + { + if (Main.tile[index2, index3].frameX < (short) 144 && Main.rand.Next(10) == 0 || (Main.tile[index2, index3 + 1].type == (ushort) 78 || Main.tile[index2, index3 + 1].type == (ushort) 380) && Main.rand.Next(2) == 0) + Main.tile[index2, index3].frameX = (short) (198 + WorldGen.genRand.Next(10) * 18); + Main.tile[index2, index3].type = (ushort) 73; + if (Main.netMode == 2) + NetMessage.SendTileSquare(-1, index2, index3, 3); + } + if (Main.tile[index2, index3].type == (ushort) 110 && WorldGen.genRand.Next(20) == 0 && Main.tile[index2, index3].frameX < (short) 144) + { + Main.tile[index2, index3].type = (ushort) 113; + if (Main.netMode == 2) + NetMessage.SendTileSquare(-1, index2, index3, 3); + } + if (Main.tile[index2, index3].type == (ushort) 32 && WorldGen.genRand.Next(3) == 0) + { + int index10 = index2; + int index11 = index3; + int num16 = 0; + if (Main.tile[index10 + 1, index11].active() && Main.tile[index10 + 1, index11].type == (ushort) 32) + ++num16; + if (Main.tile[index10 - 1, index11].active() && Main.tile[index10 - 1, index11].type == (ushort) 32) + ++num16; + if (Main.tile[index10, index11 + 1].active() && Main.tile[index10, index11 + 1].type == (ushort) 32) + ++num16; + if (Main.tile[index10, index11 - 1].active() && Main.tile[index10, index11 - 1].type == (ushort) 32) + ++num16; + if (num16 < 3 || Main.tile[index2, index3].type == (ushort) 23) + { + switch (WorldGen.genRand.Next(4)) + { + case 0: + --index11; + break; + case 1: + ++index11; + break; + case 2: + --index10; + break; + case 3: + ++index10; + break; + } + if (!Main.tile[index10, index11].active()) + { + int num17 = 0; + if (Main.tile[index10 + 1, index11].active() && Main.tile[index10 + 1, index11].type == (ushort) 32) + ++num17; + if (Main.tile[index10 - 1, index11].active() && Main.tile[index10 - 1, index11].type == (ushort) 32) + ++num17; + if (Main.tile[index10, index11 + 1].active() && Main.tile[index10, index11 + 1].type == (ushort) 32) + ++num17; + if (Main.tile[index10, index11 - 1].active() && Main.tile[index10, index11 - 1].type == (ushort) 32) + ++num17; + if (num17 < 2) + { + int num18 = 7; + int num19 = index10 - num18; + int num20 = index10 + num18; + int num21 = index11 - num18; + int num22 = index11 + num18; + bool flag4 = false; + for (int index12 = num19; index12 < num20; ++index12) + { + for (int index13 = num21; index13 < num22; ++index13) + { + if (Math.Abs(index12 - index10) * 2 + Math.Abs(index13 - index11) < 9 && Main.tile[index12, index13].active() && Main.tile[index12, index13].type == (ushort) 23 && Main.tile[index12, index13 - 1].active() && Main.tile[index12, index13 - 1].type == (ushort) 32 && Main.tile[index12, index13 - 1].liquid == (byte) 0) + { + flag4 = true; + break; + } + } + } + if (flag4) + { + Main.tile[index10, index11].type = (ushort) 32; + Main.tile[index10, index11].active(true); + WorldGen.SquareTileFrame(index10, index11); + if (Main.netMode == 2) + NetMessage.SendTileSquare(-1, index10, index11, 3); + } + } + } + } + } + if (Main.tile[index2, index3].type == (ushort) 352 && WorldGen.genRand.Next(3) == 0) + WorldGen.GrowSpike(index2, index3, (ushort) 352, (ushort) 199); + } + else if (flag1) + WorldGen.TrySpawningTownNPC(index2, index3); + if (Main.tile[index2, index3].wall == (byte) 81 || Main.tile[index2, index3].wall == (byte) 83 || Main.tile[index2, index3].type == (ushort) 199 && Main.tile[index2, index3].active()) + { + int tileX = index2 + WorldGen.genRand.Next(-2, 3); + int tileY = index3 + WorldGen.genRand.Next(-2, 3); + if (Main.tile[tileX, tileY].wall >= (byte) 63 && Main.tile[tileX, tileY].wall <= (byte) 68) + { + bool flag5 = false; +label_213: + for (int index14 = index2 - wallDist; index14 < index2 + wallDist; ++index14) + { + for (int index15 = index3 - wallDist; index15 < index3 + wallDist; ++index15) + { + if (Main.tile[index2, index3].active()) + { + switch (Main.tile[index2, index3].type) + { + case 199: + case 200: + case 201: + case 203: + case 205: + case 234: + case 352: + flag5 = true; + goto label_213; + default: + continue; + } + } + } + } + if (flag5) + { + Main.tile[tileX, tileY].wall = (byte) 81; + if (Main.netMode == 2) + NetMessage.SendTileSquare(-1, tileX, tileY, 3); + } + } + } + if (Main.tile[index2, index3].wall == (byte) 69 || Main.tile[index2, index3].wall == (byte) 3 || Main.tile[index2, index3].type == (ushort) 23 && Main.tile[index2, index3].active()) + { + int tileX = index2 + WorldGen.genRand.Next(-2, 3); + int tileY = index3 + WorldGen.genRand.Next(-2, 3); + if (Main.tile[tileX, tileY].wall >= (byte) 63 && Main.tile[tileX, tileY].wall <= (byte) 68) + { + bool flag6 = false; +label_227: + for (int index16 = index2 - wallDist; index16 < index2 + wallDist; ++index16) + { + for (int index17 = index3 - wallDist; index17 < index3 + wallDist; ++index17) + { + if (Main.tile[index16, index17].active()) + { + switch (Main.tile[index16, index17].type) + { + case 22: + case 23: + case 24: + case 25: + case 32: + case 112: + case 163: + flag6 = true; + goto label_227; + default: + continue; + } + } + } + } + if (flag6) + { + Main.tile[tileX, tileY].wall = (byte) 69; + if (Main.netMode == 2) + NetMessage.SendTileSquare(-1, tileX, tileY, 3); + } + } + } + if (Main.tile[index2, index3].wall == (byte) 70 || Main.tile[index2, index3].type == (ushort) 109 && Main.tile[index2, index3].active()) + { + int tileX = index2 + WorldGen.genRand.Next(-2, 3); + int tileY = index3 + WorldGen.genRand.Next(-2, 3); + if (Main.tile[tileX, tileY].wall == (byte) 63 || Main.tile[tileX, tileY].wall == (byte) 65 || Main.tile[tileX, tileY].wall == (byte) 66 || Main.tile[tileX, tileY].wall == (byte) 68) + { + bool flag7 = false; +label_241: + for (int index18 = index2 - wallDist; index18 < index2 + wallDist; ++index18) + { + for (int index19 = index3 - wallDist; index19 < index3 + wallDist; ++index19) + { + if (Main.tile[index18, index19].active()) + { + switch (Main.tile[index18, index19].type) + { + case 109: + case 110: + case 113: + case 115: + case 116: + case 117: + case 164: + flag7 = true; + goto label_241; + default: + continue; + } + } + } + } + if (flag7) + { + Main.tile[tileX, tileY].wall = (byte) 70; + if (Main.netMode == 2) + NetMessage.SendTileSquare(-1, tileX, tileY, 3); + } + } + } + WorldGen.SpreadDesertWalls(wallDist, index2, index3); + if (Main.tile[index2, index3].active()) + { + if ((Main.tile[index2, index3].type == (ushort) 2 || Main.tile[index2, index3].type == (ushort) 52 || Main.tile[index2, index3].type == (ushort) 192 && WorldGen.genRand.Next(10) == 0) && WorldGen.genRand.Next(40) == 0 && !Main.tile[index2, index3 + 1].active() && !Main.tile[index2, index3 + 1].lava()) + { + bool flag8 = false; + for (int index20 = index3; index20 > index3 - 10; --index20) + { + if (Main.tile[index2, index20].bottomSlope()) + { + flag8 = false; + break; + } + if (Main.tile[index2, index20].active() && Main.tile[index2, index20].type == (ushort) 2 && !Main.tile[index2, index20].bottomSlope()) + { + flag8 = true; + break; + } + } + if (flag8) + { + int index21 = index2; + int index22 = index3 + 1; + Main.tile[index21, index22].type = (ushort) 52; + Main.tile[index21, index22].active(true); + Main.tile[index21, index22].color(Main.tile[index2, index3].color()); + WorldGen.SquareTileFrame(index21, index22); + if (Main.netMode == 2) + NetMessage.SendTileSquare(-1, index21, index22, 3); + } + } + if (Main.tile[index2, index3].type == (ushort) 70) + { + int type = (int) Main.tile[index2, index3].type; + if (!Main.tile[index2, index4].active() && WorldGen.genRand.Next(10) == 0) + { + WorldGen.PlaceTile(index2, index4, 71, true); + if (Main.tile[index2, index4].active()) + Main.tile[index2, index4].color(Main.tile[index2, index3].color()); + if (Main.netMode == 2 && Main.tile[index2, index4].active()) + NetMessage.SendTileSquare(-1, index2, index4, 1); + } + if (WorldGen.genRand.Next(100) == 0) + { + bool flag9 = WorldGen.PlayerLOS(index2, index3); + if (WorldGen.GrowTree(index2, index3) & flag9) + WorldGen.TreeGrowFXCheck(index2, index3 - 1); + } + bool flag10 = false; + for (int i = num5; i < num6; ++i) + { + for (int j = index4; j < num7; ++j) + { + if ((index2 != i || index3 != j) && Main.tile[i, j].active() && Main.tile[i, j].type == (ushort) 59) + { + WorldGen.SpreadGrass(i, j, 59, type, false, Main.tile[index2, index3].color()); + if ((int) Main.tile[i, j].type == type) + { + WorldGen.SquareTileFrame(i, j); + flag10 = true; + } + } + } + } + if (Main.netMode == 2 & flag10) + NetMessage.SendTileSquare(-1, index2, index3, 3); + } + if (Main.tile[index2, index3].type == (ushort) 60) + { + int type = (int) Main.tile[index2, index3].type; + if (!Main.tile[index2, index4].active() && WorldGen.genRand.Next(7) == 0) + { + WorldGen.PlaceTile(index2, index4, 61, true); + if (Main.tile[index2, index4].active()) + Main.tile[index2, index4].color(Main.tile[index2, index3].color()); + if (Main.netMode == 2 && Main.tile[index2, index4].active()) + NetMessage.SendTileSquare(-1, index2, index4, 1); + } + else if (WorldGen.genRand.Next(500) == 0 && (!Main.tile[index2, index4].active() || Main.tile[index2, index4].type == (ushort) 61 || Main.tile[index2, index4].type == (ushort) 74 || Main.tile[index2, index4].type == (ushort) 69)) + { + if (WorldGen.GrowTree(index2, index3) && WorldGen.PlayerLOS(index2, index3)) + WorldGen.TreeGrowFXCheck(index2, index3 - 1); + } + else if (WorldGen.genRand.Next(25) == 0 && Main.tile[index2, index4].liquid == (byte) 0) + { + WorldGen.PlaceJunglePlant(index2, index4, (ushort) 233, WorldGen.genRand.Next(8), 0); + if (Main.tile[index2, index4].type == (ushort) 233) + { + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, index2, index4, 4); + } + else + { + WorldGen.PlaceJunglePlant(index2, index4, (ushort) 233, WorldGen.genRand.Next(12), 1); + if (Main.tile[index2, index4].type == (ushort) 233 && Main.netMode == 2) + NetMessage.SendTileSquare(-1, index2, index4, 3); + } + } + } + bool flag11 = false; + for (int i = num5; i < num6; ++i) + { + for (int j = index4; j < num7; ++j) + { + if ((index2 != i || index3 != j) && Main.tile[i, j].active() && Main.tile[i, j].type == (ushort) 59) + { + WorldGen.SpreadGrass(i, j, 59, type, false, Main.tile[index2, index3].color()); + if ((int) Main.tile[i, j].type == type) + { + WorldGen.SquareTileFrame(i, j); + flag11 = true; + } + } + } + } + if (Main.netMode == 2 & flag11) + NetMessage.SendTileSquare(-1, index2, index3, 3); + } + if (Main.tile[index2, index3].type == (ushort) 61 && WorldGen.genRand.Next(3) == 0 && Main.tile[index2, index3].frameX < (short) 144) + { + if (Main.rand.Next(4) == 0) + Main.tile[index2, index3].frameX = (short) (162 + WorldGen.genRand.Next(8) * 18); + Main.tile[index2, index3].type = (ushort) 74; + if (Main.netMode == 2) + NetMessage.SendTileSquare(-1, index2, index3, 3); + } + if ((Main.tile[index2, index3].type == (ushort) 60 || Main.tile[index2, index3].type == (ushort) 62) && WorldGen.genRand.Next(15) == 0 && !Main.tile[index2, index3 + 1].active() && !Main.tile[index2, index3 + 1].lava()) + { + bool flag12 = false; + for (int index23 = index3; index23 > index3 - 10; --index23) + { + if (Main.tile[index2, index23].bottomSlope()) + { + flag12 = false; + break; + } + if (Main.tile[index2, index23].active() && Main.tile[index2, index23].type == (ushort) 60 && !Main.tile[index2, index23].bottomSlope()) + { + flag12 = true; + break; + } + } + if (flag12) + { + int index24 = index2; + int index25 = index3 + 1; + Main.tile[index24, index25].type = (ushort) 62; + Main.tile[index24, index25].active(true); + WorldGen.SquareTileFrame(index24, index25); + if (Main.netMode == 2) + NetMessage.SendTileSquare(-1, index24, index25, 3); + } + } + if ((Main.tile[index2, index3].type == (ushort) 109 || Main.tile[index2, index3].type == (ushort) 115) && WorldGen.genRand.Next(15) == 0 && !Main.tile[index2, index3 + 1].active() && !Main.tile[index2, index3 + 1].lava()) + { + bool flag13 = false; + for (int index26 = index3; index26 > index3 - 10; --index26) + { + if (Main.tile[index2, index26].bottomSlope()) + { + flag13 = false; + break; + } + if (Main.tile[index2, index26].active() && Main.tile[index2, index26].type == (ushort) 109 && !Main.tile[index2, index26].bottomSlope()) + { + flag13 = true; + break; + } + } + if (flag13) + { + int index27 = index2; + int index28 = index3 + 1; + Main.tile[index27, index28].type = (ushort) 115; + Main.tile[index27, index28].active(true); + WorldGen.SquareTileFrame(index27, index28); + if (Main.netMode == 2) + NetMessage.SendTileSquare(-1, index27, index28, 3); + } + } + if ((Main.tile[index2, index3].type == (ushort) 199 || Main.tile[index2, index3].type == (ushort) 205) && WorldGen.genRand.Next(15) == 0 && !Main.tile[index2, index3 + 1].active() && !Main.tile[index2, index3 + 1].lava()) + { + bool flag14 = false; + for (int index29 = index3; index29 > index3 - 10; --index29) + { + if (Main.tile[index2, index29].bottomSlope()) + { + flag14 = false; + break; + } + if (Main.tile[index2, index29].active() && Main.tile[index2, index29].type == (ushort) 199 && !Main.tile[index2, index29].bottomSlope()) + { + flag14 = true; + break; + } + } + if (flag14) + { + int index30 = index2; + int index31 = index3 + 1; + Main.tile[index30, index31].type = (ushort) 205; + Main.tile[index30, index31].active(true); + WorldGen.SquareTileFrame(index30, index31); + if (Main.netMode == 2) + NetMessage.SendTileSquare(-1, index30, index31, 3); } } } } - else if ((Main.tile[i, j].type == (ushort) 60 || Main.tile[i, j].type == (ushort) 62) && WorldGen.genRand.Next(80) == 0 && !WorldGen.PlayerLOS(i, j)) + } + for (int index32 = 0; (double) index32 < (double) (Main.maxTilesX * Main.maxTilesY) * (double) num2; ++index32) + { + int index33 = WorldGen.genRand.Next(10, Main.maxTilesX - 10); + int index34 = WorldGen.genRand.Next((int) Main.worldSurface - 1, Main.maxTilesY - 20); + int num23 = index33 - 1; + int num24 = index33 + 2; + int index35 = index34 - 1; + int num25 = index34 + 2; + if (num23 < 10) + num23 = 10; + if (num24 > Main.maxTilesX - 10) + num24 = Main.maxTilesX - 10; + if (index35 < 10) + index35 = 10; + if (num25 > Main.maxTilesY - 10) + num25 = Main.maxTilesY - 10; + if (Main.tile[index33, index34] != null) { - bool flag = true; - int tileY = j; - if (Main.tile[i, j].type == (ushort) 60) - ++tileY; - for (int i1 = i; i1 < i + 2; ++i1) + if (Main.tileAlch[(int) Main.tile[index33, index34].type]) + WorldGen.GrowAlch(index33, index34); + if (Main.tile[index33, index34].liquid <= (byte) 32) { - int j1 = tileY - 1; - if (!WorldGen.AnchorValid(Framing.GetTileSafely(i1, j1), AnchorType.SolidTile) || Main.tile[i1, j1].bottomSlope()) - flag = false; - if (Main.tile[i1, j1].liquid > (byte) 0 || Main.wallHouse[(int) Main.tile[i1, j1].wall]) - flag = false; - if (flag) + if (Main.tile[index33, index34].nactive()) { - for (int index = tileY; index < tileY + 2; ++index) + WorldGen.hardUpdateWorld(index33, index34); + if (Main.rand.Next(3000) == 0) + WorldGen.plantDye(index33, index34); + if (Main.rand.Next(4500) == 0) + WorldGen.plantDye(index33, index34, true); + if (Main.tile[index33, index34].type == (ushort) 23 && !Main.tile[index33, index35].active() && WorldGen.genRand.Next(1) == 0) { - if ((!Main.tile[i1, index].active() || Main.tileCut[(int) Main.tile[i1, index].type] && Main.tile[i1, index].type != (ushort) 444 ? (!Main.tile[i1, index].lava() ? 1 : 0) : 0) == 0) - flag = false; - if (!flag) - break; + WorldGen.PlaceTile(index33, index35, 24, true); + if (Main.netMode == 2 && Main.tile[index33, index35].active()) + NetMessage.SendTileSquare(-1, index33, index35, 1); + } + if (Main.tile[index33, index34].type == (ushort) 32 && WorldGen.genRand.Next(3) == 0) + { + int index36 = index33; + int index37 = index34; + int num26 = 0; + if (Main.tile[index36 + 1, index37].active() && Main.tile[index36 + 1, index37].type == (ushort) 32) + ++num26; + if (Main.tile[index36 - 1, index37].active() && Main.tile[index36 - 1, index37].type == (ushort) 32) + ++num26; + if (Main.tile[index36, index37 + 1].active() && Main.tile[index36, index37 + 1].type == (ushort) 32) + ++num26; + if (Main.tile[index36, index37 - 1].active() && Main.tile[index36, index37 - 1].type == (ushort) 32) + ++num26; + if (num26 < 3 || Main.tile[index33, index34].type == (ushort) 23) + { + switch (WorldGen.genRand.Next(4)) + { + case 0: + --index37; + break; + case 1: + ++index37; + break; + case 2: + --index36; + break; + case 3: + ++index36; + break; + } + if (!Main.tile[index36, index37].active()) + { + int num27 = 0; + if (Main.tile[index36 + 1, index37].active() && Main.tile[index36 + 1, index37].type == (ushort) 32) + ++num27; + if (Main.tile[index36 - 1, index37].active() && Main.tile[index36 - 1, index37].type == (ushort) 32) + ++num27; + if (Main.tile[index36, index37 + 1].active() && Main.tile[index36, index37 + 1].type == (ushort) 32) + ++num27; + if (Main.tile[index36, index37 - 1].active() && Main.tile[index36, index37 - 1].type == (ushort) 32) + ++num27; + if (num27 < 2) + { + int num28 = 7; + int num29 = index36 - num28; + int num30 = index36 + num28; + int num31 = index37 - num28; + int num32 = index37 + num28; + bool flag15 = false; + for (int index38 = num29; index38 < num30; ++index38) + { + for (int index39 = num31; index39 < num32; ++index39) + { + if (Math.Abs(index38 - index36) * 2 + Math.Abs(index39 - index37) < 9 && Main.tile[index38, index39].active() && Main.tile[index38, index39].type == (ushort) 23 && Main.tile[index38, index39 - 1].active() && Main.tile[index38, index39 - 1].type == (ushort) 32 && Main.tile[index38, index39 - 1].liquid == (byte) 0) + { + flag15 = true; + break; + } + } + } + if (flag15) + { + Main.tile[index36, index37].type = (ushort) 32; + Main.tile[index36, index37].active(true); + WorldGen.SquareTileFrame(index36, index37); + if (Main.netMode == 2) + NetMessage.SendTileSquare(-1, index36, index37, 3); + } + } + } + } + } + if (Main.tile[index33, index34].type == (ushort) 352 && WorldGen.genRand.Next(3) == 0) + WorldGen.GrowSpike(index33, index34, (ushort) 352, (ushort) 199); + if (Main.tile[index33, index34].type == (ushort) 199) + { + int type = (int) Main.tile[index33, index34].type; + bool flag16 = false; + for (int i = num23; i < num24; ++i) + { + for (int j = index35; j < num25; ++j) + { + if ((index33 != i || index34 != j) && Main.tile[i, j].active() && Main.tile[i, j].type == (ushort) 0) + { + WorldGen.SpreadGrass(i, j, grass: type, repeat: false, color: Main.tile[index33, index34].color()); + if ((int) Main.tile[i, j].type == type) + { + WorldGen.SquareTileFrame(i, j); + flag16 = true; + } + } + } + } + if (Main.netMode == 2 & flag16) + NetMessage.SendTileSquare(-1, index33, index34, 3); + } + if (Main.tile[index33, index34].type == (ushort) 60) + { + int type = (int) Main.tile[index33, index34].type; + if (!Main.tile[index33, index35].active() && WorldGen.genRand.Next(10) == 0) + { + WorldGen.PlaceTile(index33, index35, 61, true); + if (Main.netMode == 2 && Main.tile[index33, index35].active()) + NetMessage.SendTileSquare(-1, index33, index35, 1); + } + else if (WorldGen.genRand.Next(25) == 0 && Main.tile[index33, index35].liquid == (byte) 0) + { + if (Main.hardMode && NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3 && WorldGen.genRand.Next(60) == 0) + { + bool flag17 = true; + int num33 = 150; + for (int index40 = index33 - num33; index40 < index33 + num33; index40 += 2) + { + for (int index41 = index34 - num33; index41 < index34 + num33; index41 += 2) + { + if (index40 > 1 && index40 < Main.maxTilesX - 2 && index41 > 1 && index41 < Main.maxTilesY - 2 && Main.tile[index40, index41].active() && Main.tile[index40, index41].type == (ushort) 238) + { + flag17 = false; + break; + } + } + } + if (flag17) + { + WorldGen.PlaceJunglePlant(index33, index35, (ushort) 238, 0, 0); + WorldGen.SquareTileFrame(index33, index35); + WorldGen.SquareTileFrame(index33 + 1, index35 + 1); + if (Main.tile[index33, index35].type == (ushort) 238 && Main.netMode == 2) + NetMessage.SendTileSquare(-1, index33, index35, 4); + } + } + if (Main.hardMode && NPC.downedMechBossAny && WorldGen.genRand.Next(maxValue1) == 0) + { + bool flag18 = true; + int num34 = 60; + if (Main.expertMode) + num34 -= 10; + for (int index42 = index33 - num34; index42 < index33 + num34; index42 += 2) + { + for (int index43 = index34 - num34; index43 < index34 + num34; index43 += 2) + { + if (index42 > 1 && index42 < Main.maxTilesX - 2 && index43 > 1 && index43 < Main.maxTilesY - 2 && Main.tile[index42, index43].active() && Main.tile[index42, index43].type == (ushort) 236) + { + flag18 = false; + break; + } + } + } + if (flag18) + { + WorldGen.PlaceJunglePlant(index33, index35, (ushort) 236, WorldGen.genRand.Next(3), 0); + WorldGen.SquareTileFrame(index33, index35); + WorldGen.SquareTileFrame(index33 + 1, index35 + 1); + if (Main.tile[index33, index35].type == (ushort) 236 && Main.netMode == 2) + NetMessage.SendTileSquare(-1, index33, index35, 4); + } + } + else + { + WorldGen.PlaceJunglePlant(index33, index35, (ushort) 233, WorldGen.genRand.Next(8), 0); + if (Main.tile[index33, index35].type == (ushort) 233) + { + if (Main.netMode == 2) + { + NetMessage.SendTileSquare(-1, index33, index35, 4); + } + else + { + WorldGen.PlaceJunglePlant(index33, index35, (ushort) 233, WorldGen.genRand.Next(12), 1); + if (Main.tile[index33, index35].type == (ushort) 233 && Main.netMode == 2) + NetMessage.SendTileSquare(-1, index33, index35, 3); + } + } + } + } + bool flag19 = false; + for (int i = num23; i < num24; ++i) + { + for (int j = index35; j < num25; ++j) + { + if ((index33 != i || index34 != j) && Main.tile[i, j].active() && Main.tile[i, j].type == (ushort) 59) + { + WorldGen.SpreadGrass(i, j, 59, type, false, Main.tile[index33, index34].color()); + if ((int) Main.tile[i, j].type == type) + { + WorldGen.SquareTileFrame(i, j); + flag19 = true; + } + } + } + } + if (Main.netMode == 2 & flag19) + NetMessage.SendTileSquare(-1, index33, index34, 3); + } + if (Main.tile[index33, index34].type == (ushort) 61 && WorldGen.genRand.Next(3) == 0 && Main.tile[index33, index34].frameX < (short) 144) + { + if (Main.rand.Next(4) == 0) + Main.tile[index33, index34].frameX = (short) (162 + WorldGen.genRand.Next(8) * 18); + Main.tile[index33, index34].type = (ushort) 74; + if (Main.netMode == 2) + NetMessage.SendTileSquare(-1, index33, index34, 3); + } + if ((Main.tile[index33, index34].type == (ushort) 60 || Main.tile[index33, index34].type == (ushort) 62) && WorldGen.genRand.Next(5) == 0 && !Main.tile[index33, index34 + 1].active() && !Main.tile[index33, index34 + 1].lava()) + { + bool flag20 = false; + for (int index44 = index34; index44 > index34 - 10; --index44) + { + if (Main.tile[index33, index44].bottomSlope()) + { + flag20 = false; + break; + } + if (Main.tile[index33, index44].active() && Main.tile[index33, index44].type == (ushort) 60 && !Main.tile[index33, index44].bottomSlope()) + { + flag20 = true; + break; + } + } + if (flag20) + { + int index45 = index33; + int index46 = index34 + 1; + Main.tile[index45, index46].type = (ushort) 62; + Main.tile[index45, index46].active(true); + WorldGen.SquareTileFrame(index45, index46); + if (Main.netMode == 2) + NetMessage.SendTileSquare(-1, index45, index46, 3); + } + } + if ((Main.tile[index33, index34].type == (ushort) 60 || Main.tile[index33, index34].type == (ushort) 62) && WorldGen.genRand.Next(80) == 0 && !WorldGen.PlayerLOS(index33, index34)) + { + bool flag21 = true; + int tileY = index34; + if (Main.tile[index33, index34].type == (ushort) 60) + ++tileY; + for (int i = index33; i < index33 + 2; ++i) + { + int j = tileY - 1; + if (!WorldGen.AnchorValid(Framing.GetTileSafely(i, j), AnchorType.SolidTile) || Main.tile[i, j].bottomSlope()) + flag21 = false; + if (Main.tile[i, j].liquid > (byte) 0 || Main.wallHouse[(int) Main.tile[i, j].wall]) + flag21 = false; + if (flag21) + { + for (int index47 = tileY; index47 < tileY + 2; ++index47) + { + if ((!Main.tile[i, index47].active() || Main.tileCut[(int) Main.tile[i, index47].type] && Main.tile[i, index47].type != (ushort) 444 ? (!Main.tile[i, index47].lava() ? 1 : 0) : 0) == 0) + flag21 = false; + if (!flag21) + break; + } + if (!flag21) + break; + } + else + break; + } + if (flag21) + { + if (WorldGen.CountNearBlocksTypes(index33, index34, 20, 1, 444) > 0) + flag21 = false; + } + if (flag21) + { + for (int i = index33; i < index33 + 2; ++i) + { + Main.tile[i, tileY - 1].slope((byte) 0); + Main.tile[i, tileY - 1].halfBrick(false); + for (int j = tileY; j < tileY + 2; ++j) + { + if (Main.tile[i, j].active()) + WorldGen.KillTile(i, j); + } + } + for (int index48 = index33; index48 < index33 + 2; ++index48) + { + for (int index49 = tileY; index49 < tileY + 2; ++index49) + { + Main.tile[index48, index49].active(true); + Main.tile[index48, index49].type = (ushort) 444; + Main.tile[index48, index49].frameX = (short) ((index48 - index33) * 18); + Main.tile[index48, index49].frameY = (short) ((index49 - tileY) * 18); + } + } + if (Main.netMode == 2) + NetMessage.SendTileSquare(-1, index33, tileY, 3); + } + } + if (Main.tile[index33, index34].type == (ushort) 69 && WorldGen.genRand.Next(3) == 0) + { + int index50 = index33; + int index51 = index34; + int num35 = 0; + if (Main.tile[index50 + 1, index51].active() && Main.tile[index50 + 1, index51].type == (ushort) 69) + ++num35; + if (Main.tile[index50 - 1, index51].active() && Main.tile[index50 - 1, index51].type == (ushort) 69) + ++num35; + if (Main.tile[index50, index51 + 1].active() && Main.tile[index50, index51 + 1].type == (ushort) 69) + ++num35; + if (Main.tile[index50, index51 - 1].active() && Main.tile[index50, index51 - 1].type == (ushort) 69) + ++num35; + if (num35 < 3 || Main.tile[index33, index34].type == (ushort) 60) + { + switch (WorldGen.genRand.Next(4)) + { + case 0: + --index51; + break; + case 1: + ++index51; + break; + case 2: + --index50; + break; + case 3: + ++index50; + break; + } + if (!Main.tile[index50, index51].active()) + { + int num36 = 0; + if (Main.tile[index50 + 1, index51].active() && Main.tile[index50 + 1, index51].type == (ushort) 69) + ++num36; + if (Main.tile[index50 - 1, index51].active() && Main.tile[index50 - 1, index51].type == (ushort) 69) + ++num36; + if (Main.tile[index50, index51 + 1].active() && Main.tile[index50, index51 + 1].type == (ushort) 69) + ++num36; + if (Main.tile[index50, index51 - 1].active() && Main.tile[index50, index51 - 1].type == (ushort) 69) + ++num36; + if (num36 < 2) + { + int num37 = 7; + int num38 = index50 - num37; + int num39 = index50 + num37; + int num40 = index51 - num37; + int num41 = index51 + num37; + bool flag22 = false; + for (int index52 = num38; index52 < num39; ++index52) + { + for (int index53 = num40; index53 < num41; ++index53) + { + if (Math.Abs(index52 - index50) * 2 + Math.Abs(index53 - index51) < 9 && Main.tile[index52, index53].active() && Main.tile[index52, index53].type == (ushort) 60 && Main.tile[index52, index53 - 1].active() && Main.tile[index52, index53 - 1].type == (ushort) 69 && Main.tile[index52, index53 - 1].liquid == (byte) 0) + { + flag22 = true; + break; + } + } + } + if (flag22) + { + Main.tile[index50, index51].type = (ushort) 69; + Main.tile[index50, index51].active(true); + WorldGen.SquareTileFrame(index50, index51); + if (Main.netMode == 2) + NetMessage.SendTileSquare(-1, index50, index51, 3); + } + } + } + } + } + else if (Main.tile[index33, index34].type == (ushort) 147 || Main.tile[index33, index34].type == (ushort) 161 || Main.tile[index33, index34].type == (ushort) 163 || Main.tile[index33, index34].type == (ushort) 164 || Main.tile[index33, index34].type == (ushort) 200) + { + if (Main.rand.Next(10) == 0 && !Main.tile[index33, index34 + 1].active() && !Main.tile[index33, index34 + 2].active()) + { + int num42 = index33 - 3; + int num43 = index33 + 4; + int num44 = 0; + for (int index54 = num42; index54 < num43; ++index54) + { + if (Main.tile[index54, index34].type == (ushort) 165 && Main.tile[index54, index34].active()) + ++num44; + if (Main.tile[index54, index34 + 1].type == (ushort) 165 && Main.tile[index54, index34 + 1].active()) + ++num44; + if (Main.tile[index54, index34 + 2].type == (ushort) 165 && Main.tile[index54, index34 + 2].active()) + ++num44; + if (Main.tile[index54, index34 + 3].type == (ushort) 165 && Main.tile[index54, index34 + 3].active()) + ++num44; + } + if (num44 < 2) + { + WorldGen.PlaceTight(index33, index34 + 1); + WorldGen.SquareTileFrame(index33, index34 + 1); + if (Main.netMode == 2 && Main.tile[index33, index34 + 1].active()) + NetMessage.SendTileSquare(-1, index33, index34 + 1, 3); + } + } + } + else if (Main.tileMoss[(int) Main.tile[index33, index34].type]) + { + int type = (int) Main.tile[index33, index34].type; + bool flag23 = false; + for (int i = num23; i < num24; ++i) + { + for (int j = index35; j < num25; ++j) + { + if ((index33 != i || index34 != j) && Main.tile[i, j].active() && Main.tile[i, j].type == (ushort) 1) + { + WorldGen.SpreadGrass(i, j, 1, type, false, Main.tile[index33, index34].color()); + if ((int) Main.tile[i, j].type == type) + { + WorldGen.SquareTileFrame(i, j); + flag23 = true; + } + } + } + } + if (Main.netMode == 2 & flag23) + NetMessage.SendTileSquare(-1, index33, index34, 3); + if (WorldGen.genRand.Next(6) == 0) + { + int index55 = index33; + int index56 = index34; + switch (WorldGen.genRand.Next(4)) + { + case 0: + --index55; + break; + case 1: + ++index55; + break; + case 2: + --index56; + break; + default: + ++index56; + break; + } + if (!Main.tile[index55, index56].active()) + { + WorldGen.PlaceTile(index55, index56, 184, true); + if (Main.netMode == 2 && Main.tile[index55, index56].active()) + NetMessage.SendTileSquare(-1, index55, index56, 1); + } + } + } + if (Main.tile[index33, index34].type == (ushort) 70) + { + int type = (int) Main.tile[index33, index34].type; + if (!Main.tile[index33, index35].active() && WorldGen.genRand.Next(10) == 0) + { + WorldGen.PlaceTile(index33, index35, 71, true); + if (Main.netMode == 2 && Main.tile[index33, index35].active()) + NetMessage.SendTileSquare(-1, index33, index35, 1); + } + if (WorldGen.genRand.Next(200) == 0 && WorldGen.GrowShroom(index33, index34) && WorldGen.PlayerLOS(index33, index34)) + WorldGen.TreeGrowFXCheck(index33, index34 - 1); + bool flag24 = false; + for (int i = num23; i < num24; ++i) + { + for (int j = index35; j < num25; ++j) + { + if ((index33 != i || index34 != j) && Main.tile[i, j].active() && Main.tile[i, j].type == (ushort) 59) + { + WorldGen.SpreadGrass(i, j, 59, type, false, Main.tile[index33, index34].color()); + if ((int) Main.tile[i, j].type == type) + { + WorldGen.SquareTileFrame(i, j); + flag24 = true; + } + } + } + } + if (Main.netMode == 2 & flag24) + NetMessage.SendTileSquare(-1, index33, index34, 3); } - if (!flag) - break; } else - break; - } - if (flag) - { - if (WorldGen.CountNearBlocksTypes(i, j, 20, 1, 444) > 0) - flag = false; - } - if (flag) - { - for (int i2 = i; i2 < i + 2; ++i2) { - Main.tile[i2, tileY - 1].slope((byte) 0); - Main.tile[i2, tileY - 1].halfBrick(false); - for (int j2 = tileY; j2 < tileY + 2; ++j2) + if (Main.tile[index33, index34].wall == (byte) 62 && Main.tile[index33, index34].liquid == (byte) 0 && WorldGen.genRand.Next(10) == 0) { - if (Main.tile[i2, j2].active()) - WorldGen.KillTile(i2, j2); - } - } - for (int index5 = i; index5 < i + 2; ++index5) - { - for (int index6 = tileY; index6 < tileY + 2; ++index6) - { - Main.tile[index5, index6].active(true); - Main.tile[index5, index6].type = (ushort) 444; - Main.tile[index5, index6].frameX = (short) ((index5 - i) * 18); - Main.tile[index5, index6].frameY = (short) ((index6 - tileY) * 18); - } - } - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, i, tileY, 3); - } - } - else if (Main.tile[i, j].type == (ushort) 69) - WorldGen.GrowSpike(i, j, (ushort) 69, (ushort) 60); - else if (Main.tile[i, j].type == (ushort) 147 || Main.tile[i, j].type == (ushort) 161 || Main.tile[i, j].type == (ushort) 163 || Main.tile[i, j].type == (ushort) 164 || Main.tile[i, j].type == (ushort) 200) - { - if (Main.rand.Next(10) == 0 && !Main.tile[i, j + 1].active() && !Main.tile[i, j + 2].active()) - { - int num1 = i - 3; - int num2 = i + 4; - int num3 = 0; - for (int index = num1; index < num2; ++index) - { - if (Main.tile[index, j].type == (ushort) 165 && Main.tile[index, j].active()) - ++num3; - if (Main.tile[index, j + 1].type == (ushort) 165 && Main.tile[index, j + 1].active()) - ++num3; - if (Main.tile[index, j + 2].type == (ushort) 165 && Main.tile[index, j + 2].active()) - ++num3; - if (Main.tile[index, j + 3].type == (ushort) 165 && Main.tile[index, j + 3].active()) - ++num3; - } - if (num3 < 2) - { - WorldGen.PlaceTight(i, j + 1); - WorldGen.SquareTileFrame(i, j + 1); - if (Main.netMode == 2 && Main.tile[i, j + 1].active()) - NetMessage.SendTileSquare(-1, i, j + 1, 3); - } - } - } - else if (Main.tileMoss[(int) Main.tile[i, j].type] || TileID.Sets.tileMossBrick[(int) Main.tile[i, j].type]) - { - int type1 = (int) Main.tile[i, j].type; - bool flag = false; - for (int i3 = minI; i3 < maxI; ++i3) - { - for (int j3 = minJ; j3 < maxJ; ++j3) - { - if ((i != i3 || j != j3) && Main.tile[i3, j3].active() && (Main.tile[i3, j3].type == (ushort) 1 || Main.tile[i3, j3].type == (ushort) 38)) - { - int type2 = (int) Main.tile[i3, j3].type; - WorldGen.SpreadGrass(i3, j3, (int) Main.tile[i3, j3].type, WorldGen.MossConversion(type1, type2), false, Main.tile[i, j].color()); - if ((int) Main.tile[i3, j3].type == type1) + int num45 = WorldGen.genRand.Next(2, 4); + int num46 = index33 - num45; + int num47 = index33 + num45; + int num48 = index34 - num45; + int num49 = index34 + num45; + bool flag25 = false; + for (int i = num46; i <= num47; ++i) { - WorldGen.SquareTileFrame(i3, j3); - flag = true; + for (int j = num48; j <= num49; ++j) + { + if (WorldGen.SolidTile(i, j)) + { + flag25 = true; + break; + } + } + } + if (flag25 && !Main.tile[index33, index34].active()) + { + WorldGen.PlaceTile(index33, index34, 51, true); + WorldGen.TileFrame(index33, index34, true); + if (Main.netMode == 2) + NetMessage.SendTileSquare(-1, index33, index34, 3); } } + if (flag1) + WorldGen.TrySpawningTownNPC(index33, index34); } } - if (Main.netMode == 2 & flag) - NetMessage.SendTileSquare(-1, i, j, 3); - if (WorldGen.genRand.Next(6) == 0) + if (Main.tile[index33, index34].wall == (byte) 81 || Main.tile[index33, index34].wall == (byte) 83 || Main.tile[index33, index34].type == (ushort) 199 && Main.tile[index33, index34].active()) { - int index7 = i; - int index8 = j; - switch (WorldGen.genRand.Next(4)) + int tileX = index33 + WorldGen.genRand.Next(-2, 3); + int tileY = index34 + WorldGen.genRand.Next(-2, 3); + if (Main.tile[tileX, tileY].wall >= (byte) 63 && Main.tile[tileX, tileY].wall <= (byte) 68) { - case 0: - --index7; - break; - case 1: - ++index7; - break; - case 2: - --index8; - break; - default: - ++index8; - break; - } - if (!Main.tile[index7, index8].active()) - { - if (WorldGen.PlaceTile(index7, index8, 184, true)) - Main.tile[index7, index8].color(Main.tile[i, j].color()); - if (Main.netMode == 2 && Main.tile[index7, index8].active()) - NetMessage.SendTileSquare(-1, index7, index8, 1); - } - } - } - else if (Main.tile[i, j].type == (ushort) 590) - { - if (WorldGen.genRand.Next(5) == 0) - { - int num = (int) Main.tile[i, j].frameX / 54; - int treeTileType = 587; - switch (num) - { - case 0: - treeTileType = 583; - break; - case 1: - treeTileType = 584; - break; - case 2: - treeTileType = 585; - break; - case 3: - treeTileType = 586; - break; - case 4: - treeTileType = 587; - break; - case 5: - treeTileType = 588; - break; - case 6: - treeTileType = 589; - break; - } - if (WorldGen.TryGrowingTreeByType(treeTileType, i, j) && WorldGen.PlayerLOS(i, j)) - WorldGen.TreeGrowFXCheck(i, j); - } - } - else if (Main.tile[i, j].type == (ushort) 595) - { - if (WorldGen.genRand.Next(5) == 0) - { - int num = (int) Main.tile[i, j].frameX / 54; - int treeTileType = 596; - if (num == 0) - treeTileType = 596; - if (WorldGen.TryGrowingTreeByType(treeTileType, i, j) && WorldGen.PlayerLOS(i, j)) - WorldGen.TreeGrowFXCheck(i, j); - } - } - else if (Main.tile[i, j].type == (ushort) 615 && WorldGen.genRand.Next(5) == 0) - { - int num = (int) Main.tile[i, j].frameX / 54; - int treeTileType = 616; - if (num == 0) - treeTileType = 616; - if (WorldGen.TryGrowingTreeByType(treeTileType, i, j) && WorldGen.PlayerLOS(i, j)) - WorldGen.TreeGrowFXCheck(i, j); - } - } - else - { - if (Main.tile[i, j].wall == (ushort) 62 && Main.tile[i, j].liquid == (byte) 0 && WorldGen.genRand.Next(10) == 0) - { - int num4 = WorldGen.genRand.Next(2, 4); - int num5 = i - num4; - int num6 = i + num4; - int num7 = j - num4; - int num8 = j + num4; - bool flag = false; - for (int i4 = num5; i4 <= num6; ++i4) - { - for (int j4 = num7; j4 <= num8; ++j4) - { - if (WorldGen.SolidTile(i4, j4)) + bool flag26 = false; +label_629: + for (int index57 = index33 - wallDist; index57 < index33 + wallDist; ++index57) { - flag = true; - break; + for (int index58 = index34 - wallDist; index58 < index34 + wallDist; ++index58) + { + if (Main.tile[index33, index34].active()) + { + switch (Main.tile[index33, index34].type) + { + case 199: + case 200: + case 201: + case 203: + case 205: + case 234: + case 352: + flag26 = true; + goto label_629; + default: + continue; + } + } + } + } + if (flag26) + { + Main.tile[tileX, tileY].wall = (byte) 81; + if (Main.netMode == 2) + NetMessage.SendTileSquare(-1, tileX, tileY, 3); } } } - if (flag && !Main.tile[i, j].active()) + if (Main.tile[index33, index34].wall == (byte) 69 || Main.tile[index33, index34].wall == (byte) 3 || Main.tile[index33, index34].type == (ushort) 23 && Main.tile[index33, index34].active()) { - WorldGen.PlaceTile(i, j, 51, true); - WorldGen.TileFrame(i, j, true); - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, i, j, 3); + int tileX = index33 + WorldGen.genRand.Next(-2, 3); + int tileY = index34 + WorldGen.genRand.Next(-2, 3); + if (Main.tile[tileX, tileY].wall >= (byte) 63 && Main.tile[tileX, tileY].wall <= (byte) 68) + { + bool flag27 = false; +label_643: + for (int index59 = index33 - wallDist; index59 < index33 + wallDist; ++index59) + { + for (int index60 = index34 - wallDist; index60 < index34 + wallDist; ++index60) + { + if (Main.tile[index33, index34].active()) + { + switch (Main.tile[index33, index34].type) + { + case 22: + case 23: + case 24: + case 25: + case 32: + case 112: + case 163: + flag27 = true; + goto label_643; + default: + continue; + } + } + } + } + if (flag27) + { + Main.tile[tileX, tileY].wall = (byte) 69; + if (Main.netMode == 2) + NetMessage.SendTileSquare(-1, tileX, tileY, 3); + } + } } + if (Main.tile[index33, index34].wall == (byte) 70 || Main.tile[index33, index34].type == (ushort) 109 && Main.tile[index33, index34].active()) + { + int tileX = index33 + WorldGen.genRand.Next(-2, 3); + int tileY = index34 + WorldGen.genRand.Next(-2, 3); + if (Main.tile[tileX, tileY].wall == (byte) 63 || Main.tile[tileX, tileY].wall == (byte) 65 || Main.tile[tileX, tileY].wall == (byte) 66 || Main.tile[tileX, tileY].wall == (byte) 68) + { + bool flag28 = false; +label_657: + for (int index61 = index33 - wallDist; index61 < index33 + wallDist; ++index61) + { + for (int index62 = index34 - wallDist; index62 < index34 + wallDist; ++index62) + { + if (Main.tile[index33, index34].active()) + { + switch (Main.tile[index33, index34].type) + { + case 109: + case 110: + case 113: + case 115: + case 116: + case 117: + case 164: + flag28 = true; + goto label_657; + default: + continue; + } + } + } + } + if (flag28) + { + Main.tile[tileX, tileY].wall = (byte) 70; + if (Main.netMode == 2) + NetMessage.SendTileSquare(-1, tileX, tileY, 3); + } + } + } + WorldGen.SpreadDesertWalls(wallDist, index33, index34); } - if (checkNPCSpawns) - WorldGen.TrySpawningTownNPC(i, j); } - if (!WorldGen.AllowedToSpreadInfections) + if (Main.dayTime) return; - if (Main.tile[i, j].wall == (ushort) 81 || Main.tile[i, j].wall == (ushort) 83 || Main.tile[i, j].type == (ushort) 199 && Main.tile[i, j].active()) - { - int tileX = i + WorldGen.genRand.Next(-2, 3); - int tileY = j + WorldGen.genRand.Next(-2, 3); - if (Main.tile[tileX, tileY].wall >= (ushort) 63 && Main.tile[tileX, tileY].wall <= (ushort) 68) - { - bool flag = false; -label_190: - for (int index9 = i - wallDist; index9 < i + wallDist; ++index9) - { - for (int index10 = j - wallDist; index10 < j + wallDist; ++index10) - { - if (Main.tile[index9, index10].active()) - { - switch (Main.tile[index9, index10].type) - { - case 199: - case 200: - case 201: - case 203: - case 205: - case 234: - case 352: - flag = true; - goto label_190; - default: - continue; - } - } - } - } - if (flag) - { - Main.tile[tileX, tileY].wall = (ushort) 81; - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, tileX, tileY, 3); - } - } - } - else if (Main.tile[i, j].wall == (ushort) 69 || Main.tile[i, j].wall == (ushort) 3 || Main.tile[i, j].type == (ushort) 23 && Main.tile[i, j].active()) - { - int tileX = i + WorldGen.genRand.Next(-2, 3); - int tileY = j + WorldGen.genRand.Next(-2, 3); - if (Main.tile[tileX, tileY].wall >= (ushort) 63 && Main.tile[tileX, tileY].wall <= (ushort) 68) - { - bool flag = false; -label_204: - for (int index11 = i - wallDist; index11 < i + wallDist; ++index11) - { - for (int index12 = j - wallDist; index12 < j + wallDist; ++index12) - { - if (Main.tile[index11, index12].active()) - { - switch (Main.tile[index11, index12].type) - { - case 22: - case 23: - case 24: - case 25: - case 32: - case 112: - case 163: - flag = true; - goto label_204; - default: - continue; - } - } - } - } - if (flag) - { - Main.tile[tileX, tileY].wall = (ushort) 69; - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, tileX, tileY, 3); - } - } - } - else if (Main.tile[i, j].wall == (ushort) 70 || Main.tile[i, j].type == (ushort) 109 && Main.tile[i, j].active()) - { - int tileX = i + WorldGen.genRand.Next(-2, 3); - int tileY = j + WorldGen.genRand.Next(-2, 3); - if (Main.tile[tileX, tileY].wall == (ushort) 63 || Main.tile[tileX, tileY].wall == (ushort) 65 || Main.tile[tileX, tileY].wall == (ushort) 66 || Main.tile[tileX, tileY].wall == (ushort) 68) - { - bool flag = false; -label_218: - for (int index13 = i - wallDist; index13 < i + wallDist; ++index13) - { - for (int index14 = j - wallDist; index14 < j + wallDist; ++index14) - { - if (Main.tile[index13, index14].active()) - { - switch (Main.tile[index13, index14].type) - { - case 109: - case 110: - case 113: - case 115: - case 116: - case 117: - case 164: - flag = true; - goto label_218; - default: - continue; - } - } - } - } - if (flag) - { - Main.tile[tileX, tileY].wall = (ushort) 70; - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, tileX, tileY, 3); - } - } - } - WorldGen.SpreadDesertWalls(wallDist, i, j); - } - - private static void UpdateWorld_GrassGrowth( - int i, - int j, - int minI, - int maxI, - int minJ, - int maxJ, - bool underground) - { - if (underground) - { - int type = (int) Main.tile[i, j].type; - int dirt = -1; - int Type = -1; - int maxValue1 = 1; - switch (type) - { - case 23: - dirt = 0; - Type = 24; - maxValue1 = 2; - if (!WorldGen.AllowedToSpreadInfections) - return; - break; - case 60: - dirt = 59; - Type = 61; - maxValue1 = 10; - break; - case 70: - dirt = 59; - Type = 71; - maxValue1 = 10; - break; - case 199: - dirt = 0; - Type = 201; - maxValue1 = 2; - if (!WorldGen.AllowedToSpreadInfections) - return; - break; - } - bool flag1 = false; - if (Type != -1 && !Main.tile[i, minJ].active() && WorldGen.genRand.Next(maxValue1) == 0) - { - flag1 = true; - if (WorldGen.PlaceTile(i, minJ, Type, true)) - Main.tile[i, minJ].color(Main.tile[i, j].color()); - if (Main.netMode == 2 && Main.tile[i, minJ].active()) - NetMessage.SendTileSquare(-1, i, minJ, 1); - } - if (dirt != -1) - { - bool flag2 = false; - for (int i1 = minI; i1 < maxI; ++i1) - { - for (int j1 = minJ; j1 < maxJ; ++j1) - { - if ((i != i1 || j != j1) && Main.tile[i1, j1].active() && (int) Main.tile[i1, j1].type == dirt) - { - WorldGen.SpreadGrass(i1, j1, dirt, type, false, Main.tile[i, j].color()); - if ((int) Main.tile[i1, j1].type == type) - { - WorldGen.SquareTileFrame(i1, j1); - flag2 = true; - } - } - } - } - if (Main.netMode == 2 & flag2) - NetMessage.SendTileSquare(-1, i, j, 3); - } - switch (type) - { - case 60: - if (flag1 || WorldGen.genRand.Next(25) != 0 || Main.tile[i, minJ].liquid != (byte) 0) - break; - if (Main.hardMode && NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3 && WorldGen.genRand.Next(60) == 0) - { - bool flag3 = true; - int num = 150; - for (int index1 = i - num; index1 < i + num; index1 += 2) - { - for (int index2 = j - num; index2 < j + num; index2 += 2) - { - if (index1 > 1 && index1 < Main.maxTilesX - 2 && index2 > 1 && index2 < Main.maxTilesY - 2 && Main.tile[index1, index2].active() && Main.tile[index1, index2].type == (ushort) 238) - { - flag3 = false; - break; - } - } - } - if (flag3) - { - WorldGen.PlaceJunglePlant(i, minJ, (ushort) 238, 0, 0); - WorldGen.SquareTileFrame(i, minJ); - WorldGen.SquareTileFrame(i + 2, minJ); - WorldGen.SquareTileFrame(i - 1, minJ); - if (Main.tile[i, minJ].type == (ushort) 238 && Main.netMode == 2) - NetMessage.SendTileSquare(-1, i, minJ, 5); - } - } - int maxValue2 = Main.expertMode ? 30 : 40; - if (Main.hardMode && NPC.downedMechBossAny && WorldGen.genRand.Next(maxValue2) == 0) - { - bool flag4 = true; - int num = 60; - if (Main.expertMode) - num -= 10; - for (int index3 = i - num; index3 < i + num; index3 += 2) - { - for (int index4 = j - num; index4 < j + num; index4 += 2) - { - if (index3 > 1 && index3 < Main.maxTilesX - 2 && index4 > 1 && index4 < Main.maxTilesY - 2 && Main.tile[index3, index4].active() && Main.tile[index3, index4].type == (ushort) 236) - { - flag4 = false; - break; - } - } - } - if (!flag4) - break; - WorldGen.PlaceJunglePlant(i, minJ, (ushort) 236, WorldGen.genRand.Next(3), 0); - WorldGen.SquareTileFrame(i, minJ); - WorldGen.SquareTileFrame(i + 1, minJ + 1); - if (Main.tile[i, minJ].type != (ushort) 236 || Main.netMode != 2) - break; - NetMessage.SendTileSquare(-1, i, minJ, 4); - break; - } - WorldGen.PlaceJunglePlant(i, minJ, (ushort) 233, WorldGen.genRand.Next(8), 0); - if (Main.tile[i, minJ].type != (ushort) 233) - break; - if (Main.netMode == 2) - { - NetMessage.SendTileSquare(-1, i, minJ, 4); - break; - } - WorldGen.PlaceJunglePlant(i, minJ, (ushort) 233, WorldGen.genRand.Next(12), 1); - if (Main.tile[i, minJ].type != (ushort) 233 || Main.netMode != 2) - break; - NetMessage.SendTileSquare(-1, i, minJ, 3); - break; - case 70: - if (Main.tile[i, j - 1].liquid > (byte) 0) - WorldGen.PlaceCatTail(i, j - 1); - if (WorldGen.genRand.Next(300) != 0 || !WorldGen.GrowShroom(i, j) || !WorldGen.PlayerLOS(i, j)) - break; - WorldGen.TreeGrowFXCheck(i, j - 1); - break; - } - } - else - { - int grass = (int) Main.tile[i, j].type; - switch (grass) - { - case 2: - case 23: - case 32: - case 109: - case 199: - case 352: - case 477: - case 492: - if (Main.halloween && WorldGen.genRand.Next(75) == 0 && (grass == 2 || grass == 109)) - { - int num1 = 100; - int num2 = 0; - for (int index5 = i - num1; index5 < i + num1; index5 += 2) - { - for (int index6 = j - num1; index6 < j + num1; index6 += 2) - { - if (index5 > 1 && index5 < Main.maxTilesX - 2 && index6 > 1 && index6 < Main.maxTilesY - 2 && Main.tile[index5, index6].active() && Main.tile[index5, index6].type == (ushort) 254) - ++num2; - } - } - if (num2 < 6) - { - WorldGen.PlacePumpkin(i, minJ); - if (Main.netMode == 2 && Main.tile[i, minJ].type == (ushort) 254) - NetMessage.SendTileSquare(-1, i, minJ, 4); - } - } - if (!Main.tile[i, minJ].active() && Main.tile[i, minJ].liquid == (byte) 0) - { - int Type = -1; - if (grass == 2 && WorldGen.genRand.Next(12) == 0) - Type = 3; - else if (grass == 23 && WorldGen.genRand.Next(10) == 0) - Type = 24; - else if (grass == 109 && WorldGen.genRand.Next(10) == 0) - Type = 110; - else if (grass == 199 && WorldGen.genRand.Next(10) == 0) - Type = 201; - if (Type != -1 && WorldGen.PlaceTile(i, minJ, Type, true)) - { - Main.tile[i, minJ].color(Main.tile[i, j].color()); - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, i, minJ, 1); - } - } - bool flag5 = false; - switch (grass) - { - case 32: - grass = 23; - if (!WorldGen.AllowedToSpreadInfections) - return; - break; - case 352: - grass = 199; - if (!WorldGen.AllowedToSpreadInfections) - return; - break; - case 477: - grass = 2; - break; - case 492: - grass = 109; - break; - } - bool flag6 = WorldGen.AllowedToSpreadInfections && (grass == 23 || grass == 199 || grass == 109 || grass == 492); - for (int i2 = minI; i2 < maxI; ++i2) - { - for (int j2 = minJ; j2 < maxJ; ++j2) - { - if ((i != i2 || j != j2) && Main.tile[i2, j2].active()) - { - int type = (int) Main.tile[i2, j2].type; - if (flag6 || type == 0) - { - if (type == 0 || (grass == 23 || grass == 199) && (type == 2 || type == 109 || type == 477 || type == 492)) - { - WorldGen.SpreadGrass(i2, j2, grass: grass, repeat: false, color: Main.tile[i, j].color()); - if (grass == 23 || grass == 199) - { - if (WorldGen.AllowedToSpreadInfections) - { - WorldGen.SpreadGrass(i2, j2, 2, grass, false, Main.tile[i, j].color()); - WorldGen.SpreadGrass(i2, j2, 109, grass, false, Main.tile[i, j].color()); - WorldGen.SpreadGrass(i2, j2, 477, grass, false, Main.tile[i, j].color()); - WorldGen.SpreadGrass(i2, j2, 492, grass, false, Main.tile[i, j].color()); - } - else - continue; - } - if ((int) Main.tile[i2, j2].type == grass) - { - WorldGen.SquareTileFrame(i2, j2); - flag5 = true; - } - } - if (type == 0 || (grass == 109 || grass == 492) && (type == 2 || type == 477 || type == 23 || type == 199)) - { - WorldGen.SpreadGrass(i2, j2, grass: grass, repeat: false, color: Main.tile[i, j].color()); - if (grass == 109) - WorldGen.SpreadGrass(i2, j2, 2, grass, false, Main.tile[i, j].color()); - if (grass == 492) - WorldGen.SpreadGrass(i2, j2, 477, grass, false, Main.tile[i, j].color()); - else if (grass == 109) - WorldGen.SpreadGrass(i2, j2, 477, 492, false, Main.tile[i, j].color()); - if ((grass == 492 || grass == 109) && WorldGen.AllowedToSpreadInfections) - WorldGen.SpreadGrass(i2, j2, 23, 109, false, Main.tile[i, j].color()); - if ((grass == 492 || grass == 109) && WorldGen.AllowedToSpreadInfections) - WorldGen.SpreadGrass(i2, j2, 199, 109, false, Main.tile[i, j].color()); - if ((int) Main.tile[i2, j2].type == grass) - { - WorldGen.SquareTileFrame(i2, j2); - flag5 = true; - } - } - } - } - } - } - if (!(Main.netMode == 2 & flag5)) - break; - NetMessage.SendTileSquare(-1, i, j, 3); - break; - case 60: - if (!Main.tile[i, minJ].active() && WorldGen.genRand.Next(7) == 0) - { - WorldGen.PlaceTile(i, minJ, 61, true); - if (Main.tile[i, minJ].active()) - Main.tile[i, minJ].color(Main.tile[i, j].color()); - if (Main.netMode == 2 && Main.tile[i, minJ].active()) - NetMessage.SendTileSquare(-1, i, minJ, 1); - } - else if (WorldGen.genRand.Next(500) == 0 && (!Main.tile[i, minJ].active() || Main.tile[i, minJ].type == (ushort) 61 || Main.tile[i, minJ].type == (ushort) 74 || Main.tile[i, minJ].type == (ushort) 69)) - { - if (WorldGen.GrowTree(i, j) && WorldGen.PlayerLOS(i, j)) - WorldGen.TreeGrowFXCheck(i, j - 1); - } - else if (WorldGen.genRand.Next(25) == 0 && Main.tile[i, minJ].liquid == (byte) 0) - { - WorldGen.PlaceJunglePlant(i, minJ, (ushort) 233, WorldGen.genRand.Next(8), 0); - if (Main.tile[i, minJ].type == (ushort) 233) - { - if (Main.netMode == 2) - { - NetMessage.SendTileSquare(-1, i, minJ, 4); - } - else - { - WorldGen.PlaceJunglePlant(i, minJ, (ushort) 233, WorldGen.genRand.Next(12), 1); - if (Main.tile[i, minJ].type == (ushort) 233 && Main.netMode == 2) - NetMessage.SendTileSquare(-1, i, minJ, 3); - } - } - } - bool flag7 = false; - for (int i3 = minI; i3 < maxI; ++i3) - { - for (int j3 = minJ; j3 < maxJ; ++j3) - { - if ((i != i3 || j != j3) && Main.tile[i3, j3].active() && Main.tile[i3, j3].type == (ushort) 59) - { - WorldGen.SpreadGrass(i3, j3, 59, grass, false, Main.tile[i, j].color()); - if ((int) Main.tile[i3, j3].type == grass) - { - WorldGen.SquareTileFrame(i3, j3); - flag7 = true; - } - } - } - } - if (!(Main.netMode == 2 & flag7)) - break; - NetMessage.SendTileSquare(-1, i, j, 3); - break; - case 70: - if (!Main.tile[i, j].inActive()) - { - if (!Main.tile[i, minJ].active() && WorldGen.genRand.Next(10) == 0) - { - WorldGen.PlaceTile(i, minJ, 71, true); - if (Main.tile[i, minJ].active()) - Main.tile[i, minJ].color(Main.tile[i, j].color()); - if (Main.netMode == 2 && Main.tile[i, minJ].active()) - NetMessage.SendTileSquare(-1, i, minJ, 1); - } - if (WorldGen.genRand.Next(300) == 0) - { - bool flag8 = WorldGen.PlayerLOS(i, j); - if (WorldGen.GrowTree(i, j) & flag8) - WorldGen.TreeGrowFXCheck(i, j - 1); - } - } - bool flag9 = false; - for (int i4 = minI; i4 < maxI; ++i4) - { - for (int j4 = minJ; j4 < maxJ; ++j4) - { - if ((i != i4 || j != j4) && Main.tile[i4, j4].active() && Main.tile[i4, j4].type == (ushort) 59) - { - WorldGen.SpreadGrass(i4, j4, 59, grass, false, Main.tile[i, j].color()); - if ((int) Main.tile[i4, j4].type == grass) - { - WorldGen.SquareTileFrame(i4, j4); - flag9 = true; - } - } - } - } - if (!(Main.netMode == 2 & flag9)) - break; - NetMessage.SendTileSquare(-1, i, j, 3); - break; - } - } + float num50 = (float) (Main.maxTilesX / 4200); + if ((double) Main.rand.Next(8000) >= 10.0 * (double) num50) + return; + Vector2 vector2 = new Vector2((float) ((Main.rand.Next(Main.maxTilesX - 50) + 100) * 16), (float) (Main.rand.Next((int) ((double) Main.maxTilesY * 0.05)) * 16)); + float num51 = (float) Main.rand.Next(-100, 101); + float num52 = (float) (Main.rand.Next(200) + 100); + float num53 = 12f / (float) Math.Sqrt((double) num51 * (double) num51 + (double) num52 * (double) num52); + float SpeedX = num51 * num53; + float SpeedY = num52 * num53; + Projectile.NewProjectile(vector2.X, vector2.Y, SpeedX, SpeedY, 12, 1000, 10f, Main.myPlayer); } private static void TrySpawningTownNPC(int x, int y) { - bool flag = Main.tileSolid[379]; - Main.tileSolid[379] = true; - if (WorldGen.prioritizedTownNPCType > 0) + if (WorldGen.prioritizedTownNPC <= 0) + return; + if (Main.tile[x, y].wall == (byte) 34) { - if (Main.tile[x, y].wall == (ushort) 34) - { - if (Main.rand.Next(4) == 0) - { - int num1 = (int) WorldGen.SpawnTownNPC(x, y); - } - } - else - { - int num2 = (int) WorldGen.SpawnTownNPC(x, y); - } + if (Main.rand.Next(4) != 0) + return; + int num = (int) WorldGen.SpawnTownNPC(x, y); + } + else + { + int num1 = (int) WorldGen.SpawnTownNPC(x, y); } - Main.tileSolid[379] = flag; } public static void SpreadDesertWalls(int wallDist, int i, int j) @@ -44992,7 +32841,7 @@ label_218: int tileX = i + WorldGen.genRand.Next(-2, 3); int tileY = j + WorldGen.genRand.Next(-2, 3); bool flag = false; - if (WallID.Sets.Conversion.PureSand[(int) Main.tile[tileX, tileY].wall]) + if (WallID.Sets.Conversion.Sandstone[(int) Main.tile[tileX, tileY].wall] || WallID.Sets.Conversion.HardenedSand[(int) Main.tile[tileX, tileY].wall]) { switch (num) { @@ -45045,19 +32894,19 @@ label_218: } if (!flag) return; - ushort? nullable = new ushort?(); + byte? nullable = new byte?(); if (WallID.Sets.Conversion.Sandstone[(int) Main.tile[tileX, tileY].wall]) { switch (num) { case 1: - nullable = new ushort?((ushort) 220); + nullable = new byte?((byte) 220); break; case 2: - nullable = new ushort?((ushort) 222); + nullable = new byte?((byte) 222); break; case 3: - nullable = new ushort?((ushort) 221); + nullable = new byte?((byte) 221); break; } } @@ -45066,13 +32915,13 @@ label_218: switch (num) { case 1: - nullable = new ushort?((ushort) 217); + nullable = new byte?((byte) 217); break; case 2: - nullable = new ushort?((ushort) 219); + nullable = new byte?((byte) 219); break; case 3: - nullable = new ushort?((ushort) 218); + nullable = new byte?((byte) 218); break; } } @@ -45090,28 +32939,42 @@ label_218: return; if (Main.tile[i, j] == null) Main.tile[i, j] = new Tile(); - if (Main.tile[i, j].wall != (ushort) 0) + if (Main.tile[i, j].wall != (byte) 0) return; - Main.tile[i, j].wall = (ushort) type; + Main.tile[i, j].wall = (byte) type; WorldGen.SquareWallFrame(i, j); if (mute) return; - SoundEngine.PlaySound(0, i * 16, j * 16); + Main.PlaySound(0, i * 16, j * 16); + } + + public static void AddPlants() + { + for (int i = 0; i < Main.maxTilesX; ++i) + { + for (int index = 1; index < Main.maxTilesY; ++index) + { + if (Main.tile[i, index].type == (ushort) 2 && Main.tile[i, index].nactive()) + { + if (!Main.tile[i, index - 1].active()) + WorldGen.PlaceTile(i, index - 1, 3, true); + } + else if (Main.tile[i, index].type == (ushort) 23 && Main.tile[i, index].nactive()) + { + if (!Main.tile[i, index - 1].active()) + WorldGen.PlaceTile(i, index - 1, 24, true); + } + else if (Main.tile[i, index].type == (ushort) 199 && Main.tile[i, index].nactive() && !Main.tile[i, index - 1].active()) + WorldGen.PlaceTile(i, index - 1, 201, true); + } + } } public static void SpreadGrass(int i, int j, int dirt = 0, int grass = 2, bool repeat = true, byte color = 0) { try { - if (!WorldGen.InWorld(i, j, 1)) - return; - if (WorldGen.gen && (grass == 199 || grass == 23)) - { - int beachDistance = WorldGen.beachDistance; - if ((double) i > (double) Main.maxTilesX * 0.45 && (double) i <= (double) Main.maxTilesX * 0.55 || i < beachDistance || i >= Main.maxTilesX - beachDistance) - return; - } - else if ((WorldGen.gen || grass != 199 && grass != 23) && ((int) Main.tile[i, j].type != dirt || !Main.tile[i, j].active() || (double) j >= Main.worldSurface && dirt == 0)) + if (!WorldGen.InWorld(i, j, 1) || (int) Main.tile[i, j].type != dirt || !Main.tile[i, j].active() || (double) j >= Main.worldSurface && dirt == 0) return; int num1 = i - 1; int num2 = i + 2; @@ -45139,7 +33002,7 @@ label_218: } } } - if (flag || !TileID.Sets.CanBeClearedDuringGeneration[(int) Main.tile[i, j].type] || grass == 23 && Main.tile[i, j - 1].type == (ushort) 27 || grass == 199 && Main.tile[i, j - 1].type == (ushort) 27 || grass == 109 && Main.tile[i, j - 1].type == (ushort) 27) + if (flag || !TileID.Sets.CanBeClearedDuringGeneration[(int) Main.tile[i, j].type] || grass == 23 && Main.tile[i, j - 1].type == (ushort) 27 || grass == 199 && Main.tile[i, j - 1].type == (ushort) 27) return; Main.tile[i, j].type = (ushort) grass; Main.tile[i, j].color(color); @@ -45271,15 +33134,15 @@ label_218: { for (int index4 = num9; index4 < num10; ++index4) { - if ((double) Math.Abs((float) index3 - vector2_1.X) + (double) Math.Abs((float) index4 - vector2_1.Y) < num2 * 1.1 * (1.0 + (double) WorldGen.genRand.Next(-10, 11) * 0.015) && Main.tile[index3, index4].wall != (ushort) 3) + if ((double) Math.Abs((float) index3 - vector2_1.X) + (double) Math.Abs((float) index4 - vector2_1.Y) < num2 * 1.1 * (1.0 + (double) WorldGen.genRand.Next(-10, 11) * 0.015) && Main.tile[index3, index4].wall != (byte) 3) { if (Main.tile[index3, index4].type != (ushort) 25 && index4 > j + WorldGen.genRand.Next(3, 20)) Main.tile[index3, index4].active(true); Main.tile[index3, index4].active(true); if (Main.tile[index3, index4].type != (ushort) 31 && Main.tile[index3, index4].type != (ushort) 22) Main.tile[index3, index4].type = (ushort) 25; - if (Main.tile[index3, index4].wall == (ushort) 2) - Main.tile[index3, index4].wall = (ushort) 0; + if (Main.tile[index3, index4].wall == (byte) 2) + Main.tile[index3, index4].wall = (byte) 0; } } } @@ -45287,7 +33150,7 @@ label_218: { for (int j1 = num9; j1 < num10; ++j1) { - if ((double) Math.Abs((float) i1 - vector2_1.X) + (double) Math.Abs((float) j1 - vector2_1.Y) < num2 * 1.1 * (1.0 + (double) WorldGen.genRand.Next(-10, 11) * 0.015) && Main.tile[i1, j1].wall != (ushort) 3) + if ((double) Math.Abs((float) i1 - vector2_1.X) + (double) Math.Abs((float) j1 - vector2_1.Y) < num2 * 1.1 * (1.0 + (double) WorldGen.genRand.Next(-10, 11) * 0.015) && Main.tile[i1, j1].wall != (byte) 3) { if (Main.tile[i1, j1].type != (ushort) 31 && Main.tile[i1, j1].type != (ushort) 22) Main.tile[i1, j1].type = (ushort) 25; @@ -45309,6 +33172,8 @@ label_218: public static void CrimStart(int i, int j) { int crimDir = 1; + WorldGen.heartCount = 0; + WorldGen.crimson = true; int i1 = i; int j1 = j; if ((double) j1 > Main.worldSurface) @@ -45340,20 +33205,20 @@ label_218: if ((double) Math.Abs((float) index1 - position.X) + (double) Math.Abs((float) index2 - position.Y) < (double) num3 * 0.3) { Main.tile[index1, index2].active(false); - Main.tile[index1, index2].wall = (ushort) 83; + Main.tile[index1, index2].wall = (byte) 83; } - else if ((double) Math.Abs((float) index1 - position.X) + (double) Math.Abs((float) index2 - position.Y) < (double) num3 * 0.8 && Main.tile[index1, index2].wall != (ushort) 83) + else if ((double) Math.Abs((float) index1 - position.X) + (double) Math.Abs((float) index2 - position.Y) < (double) num3 * 0.8 && Main.tile[index1, index2].wall != (byte) 83) { Main.tile[index1, index2].active(true); Main.tile[index1, index2].type = (ushort) 203; if ((double) Math.Abs((float) index1 - position.X) + (double) Math.Abs((float) index2 - position.Y) < (double) num3 * 0.6) - Main.tile[index1, index2].wall = (ushort) 83; + Main.tile[index1, index2].wall = (byte) 83; } } else if ((double) Math.Abs((float) index1 - position.X) + (double) Math.Abs((float) index2 - position.Y) < (double) num3 * 0.3 && Main.tile[index1, index2].active()) { Main.tile[index1, index2].active(false); - Main.tile[index1, index2].wall = (ushort) 83; + Main.tile[index1, index2].wall = (byte) 83; } } } @@ -45400,14 +33265,14 @@ label_218: if (num15 < (double) num5 * 0.25) { Main.tile[index4, index5].active(false); - Main.tile[index4, index5].wall = (ushort) 83; + Main.tile[index4, index5].wall = (byte) 83; } - else if (num15 < (double) num5 * 0.4 && Main.tile[index4, index5].wall != (ushort) 83) + else if (num15 < (double) num5 * 0.4 && Main.tile[index4, index5].wall != (byte) 83) { Main.tile[index4, index5].active(true); Main.tile[index4, index5].type = (ushort) 203; if (num15 < (double) num5 * 0.35) - Main.tile[index4, index5].wall = (ushort) 83; + Main.tile[index4, index5].wall = (byte) 83; } } } @@ -45442,114 +33307,110 @@ label_218: vector2Array[index6] = velocity; WorldGen.CrimVein(new Vector2((float) x, (float) y), velocity); } - int num17 = Main.maxTilesX; - int num18 = 0; - position.X = (float) num1; - position.Y = (float) num2; - float num19 = (float) WorldGen.genRand.Next(25, 35); - float num20 = (float) WorldGen.genRand.Next(0, 6); - for (int index8 = 0; index8 < 50; ++index8) + for (int index8 = 0; index8 < WorldGen.heartCount; ++index8) { - if ((double) num20 > 0.0) + float num17 = (float) WorldGen.genRand.Next(16, 21); + int x = (int) WorldGen.heartPos[index8].X; + int y = (int) WorldGen.heartPos[index8].Y; + for (int index9 = (int) ((double) x - (double) num17 / 2.0); (double) index9 < (double) x + (double) num17 / 2.0; ++index9) { - float num21 = (float) WorldGen.genRand.Next(10, 30) * 0.01f; - num20 -= num21; - position.Y -= num21; - } - int num22 = (int) position.X + WorldGen.genRand.Next(-2, 3); - int num23 = (int) position.Y + WorldGen.genRand.Next(-2, 3); - for (int index9 = (int) ((double) num22 - (double) num19 / 2.0); (double) index9 < (double) num22 + (double) num19 / 2.0; ++index9) - { - for (int index10 = (int) ((double) num23 - (double) num19 / 2.0); (double) index10 < (double) num23 + (double) num19 / 2.0; ++index10) + for (int index10 = (int) ((double) y - (double) num17 / 2.0); (double) index10 < (double) y + (double) num17 / 2.0; ++index10) { - double num24 = (double) Math.Abs(index9 - num22); - float num25 = (float) Math.Abs(index10 - num23); - float num26 = (float) (1.0 + (double) WorldGen.genRand.Next(-20, 21) * 0.00499999988824129); - float num27 = (float) (1.0 + (double) WorldGen.genRand.Next(-20, 21) * 0.00499999988824129); - double num28 = (double) num26; - double num29 = num24 * num28; - float num30 = num25 * num27; - double num31 = Math.Sqrt(num29 * num29 + (double) num30 * (double) num30); - if (num31 < (double) num19 * 0.2 * ((double) WorldGen.genRand.Next(90, 111) * 0.01)) + double num18 = (double) Math.Abs(index9 - x); + float num19 = (float) Math.Abs(index10 - y); + if (Math.Sqrt(num18 * num18 + (double) num19 * (double) num19) < (double) num17 * 0.4) { - Main.tile[index9, index10].active(false); - Main.tile[index9, index10].wall = (ushort) 83; - } - else if (num31 < (double) num19 * 0.45) - { - if (index9 < num17) - num17 = index9; - if (index9 > num18) - num18 = index9; - if (Main.tile[index9, index10].wall != (ushort) 83) - { - Main.tile[index9, index10].active(true); - Main.tile[index9, index10].type = (ushort) 203; - if (num31 < (double) num19 * 0.35) - Main.tile[index9, index10].wall = (ushort) 83; - } + Main.tile[index9, index10].active(true); + Main.tile[index9, index10].type = (ushort) 203; + Main.tile[index9, index10].wall = (byte) 83; } } } } - for (int index11 = num17; index11 <= num18; ++index11) + for (int index11 = 0; index11 < WorldGen.heartCount; ++index11) { - int index12 = num2; - while (Main.tile[index11, index12].type == (ushort) 203 && Main.tile[index11, index12].active() || Main.tile[index11, index12].wall == (ushort) 83) - ++index12; - for (int index13 = WorldGen.genRand.Next(15, 20); !Main.tile[index11, index12].active() && index13 > 0 && Main.tile[index11, index12].wall != (ushort) 83; ++index12) + float num20 = (float) WorldGen.genRand.Next(10, 14); + int x = (int) WorldGen.heartPos[index11].X; + int y = (int) WorldGen.heartPos[index11].Y; + for (int index12 = (int) ((double) x - (double) num20 / 2.0); (double) index12 < (double) x + (double) num20 / 2.0; ++index12) { - --index13; - Main.tile[index11, index12].type = (ushort) 203; - Main.tile[index11, index12].active(true); - } - } - WorldGen.CrimEnt(position, crimDir); - } - - public static void CrimPlaceHearts() - { - for (int index1 = 0; index1 < WorldGen.heartCount; ++index1) - { - int num1 = WorldGen.genRand.Next(16, 21); - int x = (int) WorldGen.heartPos[index1].X; - int y = (int) WorldGen.heartPos[index1].Y; - for (int index2 = x - num1 / 2; index2 < x + num1 / 2; ++index2) - { - for (int index3 = y - num1 / 2; index3 < y + num1 / 2; ++index3) + for (int index13 = (int) ((double) y - (double) num20 / 2.0); (double) index13 < (double) y + (double) num20 / 2.0; ++index13) { - double num2 = (double) Math.Abs(index2 - x); - float num3 = (float) Math.Abs(index3 - y); - if (Math.Sqrt(num2 * num2 + (double) num3 * (double) num3) < (double) num1 * 0.4) + double num21 = (double) Math.Abs(index12 - x); + float num22 = (float) Math.Abs(index13 - y); + if (Math.Sqrt(num21 * num21 + (double) num22 * (double) num22) < (double) num20 * 0.3) { - Main.tile[index2, index3].active(true); - Main.tile[index2, index3].type = (ushort) 203; - Main.tile[index2, index3].wall = (ushort) 83; - } - } - } - } - for (int index4 = 0; index4 < WorldGen.heartCount; ++index4) - { - int num4 = WorldGen.genRand.Next(10, 14); - int x = (int) WorldGen.heartPos[index4].X; - int y = (int) WorldGen.heartPos[index4].Y; - for (int index5 = x - num4 / 2; index5 < x + num4 / 2; ++index5) - { - for (int index6 = y - num4 / 2; index6 < y + num4 / 2; ++index6) - { - double num5 = (double) Math.Abs(index5 - x); - float num6 = (float) Math.Abs(index6 - y); - if (Math.Sqrt(num5 * num5 + (double) num6 * (double) num6) < (double) num4 * 0.3) - { - Main.tile[index5, index6].active(false); - Main.tile[index5, index6].wall = (ushort) 83; + Main.tile[index12, index13].active(false); + Main.tile[index12, index13].wall = (byte) 83; } } } } for (int index = 0; index < WorldGen.heartCount; ++index) WorldGen.AddShadowOrb((int) WorldGen.heartPos[index].X, (int) WorldGen.heartPos[index].Y); + int num23 = Main.maxTilesX; + int num24 = 0; + position.X = (float) num1; + position.Y = (float) num2; + float num25 = (float) WorldGen.genRand.Next(25, 35); + float num26 = (float) WorldGen.genRand.Next(0, 6); + for (int index14 = 0; index14 < 50; ++index14) + { + if ((double) num26 > 0.0) + { + float num27 = (float) WorldGen.genRand.Next(10, 30) * 0.01f; + num26 -= num27; + position.Y -= num27; + } + int num28 = (int) position.X + WorldGen.genRand.Next(-2, 3); + int num29 = (int) position.Y + WorldGen.genRand.Next(-2, 3); + for (int index15 = (int) ((double) num28 - (double) num25 / 2.0); (double) index15 < (double) num28 + (double) num25 / 2.0; ++index15) + { + for (int index16 = (int) ((double) num29 - (double) num25 / 2.0); (double) index16 < (double) num29 + (double) num25 / 2.0; ++index16) + { + double num30 = (double) Math.Abs(index15 - num28); + float num31 = (float) Math.Abs(index16 - num29); + float num32 = (float) (1.0 + (double) WorldGen.genRand.Next(-20, 21) * 0.00499999988824129); + float num33 = (float) (1.0 + (double) WorldGen.genRand.Next(-20, 21) * 0.00499999988824129); + double num34 = (double) num32; + double num35 = num30 * num34; + float num36 = num31 * num33; + double num37 = Math.Sqrt(num35 * num35 + (double) num36 * (double) num36); + if (num37 < (double) num25 * 0.2 * ((double) WorldGen.genRand.Next(90, 111) * 0.01)) + { + Main.tile[index15, index16].active(false); + Main.tile[index15, index16].wall = (byte) 83; + } + else if (num37 < (double) num25 * 0.45) + { + if (index15 < num23) + num23 = index15; + if (index15 > num24) + num24 = index15; + if (Main.tile[index15, index16].wall != (byte) 83) + { + Main.tile[index15, index16].active(true); + Main.tile[index15, index16].type = (ushort) 203; + if (num37 < (double) num25 * 0.35) + Main.tile[index15, index16].wall = (byte) 83; + } + } + } + } + } + for (int index17 = num23; index17 <= num24; ++index17) + { + int index18 = num2; + while (Main.tile[index17, index18].type == (ushort) 203 && Main.tile[index17, index18].active() || Main.tile[index17, index18].wall == (byte) 83) + ++index18; + for (int index19 = WorldGen.genRand.Next(15, 20); !Main.tile[index17, index18].active() && index19 > 0 && Main.tile[index17, index18].wall != (byte) 83; ++index18) + { + --index19; + Main.tile[index17, index18].type = (ushort) 203; + Main.tile[index17, index18].active(true); + } + } + WorldGen.CrimEnt(position, crimDir); } public static void CrimEnt(Vector2 position, int crimDir) @@ -45613,14 +33474,14 @@ label_218: if (num5 < (double) num1 * 0.2) { Main.tile[index1, index2].active(false); - Main.tile[index1, index2].wall = (ushort) 83; + Main.tile[index1, index2].wall = (byte) 83; } - else if (num5 < (double) num1 * 0.5 && Main.tile[index1, index2].wall != (ushort) 83) + else if (num5 < (double) num1 * 0.5 && Main.tile[index1, index2].wall != (byte) 83) { Main.tile[index1, index2].active(true); Main.tile[index1, index2].type = (ushort) 203; if (num5 < (double) num1 * 0.4) - Main.tile[index1, index2].wall = (ushort) 83; + Main.tile[index1, index2].wall = (byte) 83; } } } @@ -45732,8 +33593,7 @@ label_218: y = Main.maxTilesY - 5; if ((double) y > Main.worldSurface) { - if (!WorldGen.IsTileNearby(x, y, 26, 3)) - WorldGen.Place3x2(x, y, (ushort) 26); + WorldGen.Place3x2(x, y, (ushort) 26); if (Main.tile[x, y].type == (ushort) 26) { flag4 = true; @@ -45794,29 +33654,91 @@ label_218: if (steps <= num2) Main.tile[index5, index6].active(true); if (index6 > j + WorldGen.genRand.Next(3, 20)) - Main.tile[index5, index6].wall = (ushort) 3; + Main.tile[index5, index6].wall = (byte) 3; } } } } } + public static void JungleRunner(int i, int j) + { + double num1 = (double) WorldGen.genRand.Next(5, 11); + Vector2 vector2_1; + vector2_1.X = (float) i; + vector2_1.Y = (float) j; + Vector2 vector2_2; + vector2_2.X = (float) WorldGen.genRand.Next(-10, 11) * 0.1f; + vector2_2.Y = (float) WorldGen.genRand.Next(10, 20) * 0.1f; + int num2 = 0; + bool flag = true; + while (flag) + { + if ((double) vector2_1.Y < Main.worldSurface) + { + int x = (int) vector2_1.X; + int y = (int) vector2_1.Y; + int index1 = Utils.Clamp(x, 10, Main.maxTilesX - 10); + int index2 = Utils.Clamp(y, 10, Main.maxTilesY - 10); + if (index2 < 5) + index2 = 5; + if (Main.tile[index1, index2].wall == (byte) 0 && !Main.tile[index1, index2].active() && Main.tile[index1, index2 - 3].wall == (byte) 0 && !Main.tile[index1, index2 - 3].active() && Main.tile[index1, index2 - 1].wall == (byte) 0 && !Main.tile[index1, index2 - 1].active() && Main.tile[index1, index2 - 4].wall == (byte) 0 && !Main.tile[index1, index2 - 4].active() && Main.tile[index1, index2 - 2].wall == (byte) 0 && !Main.tile[index1, index2 - 2].active() && Main.tile[index1, index2 - 5].wall == (byte) 0 && !Main.tile[index1, index2 - 5].active()) + flag = false; + } + WorldGen.JungleX = (int) vector2_1.X; + num1 += (double) WorldGen.genRand.Next(-20, 21) * 0.100000001490116; + if (num1 < 5.0) + num1 = 5.0; + if (num1 > 10.0) + num1 = 10.0; + int num3 = (int) ((double) vector2_1.X - num1 * 0.5); + int num4 = (int) ((double) vector2_1.X + num1 * 0.5); + int num5 = (int) ((double) vector2_1.Y - num1 * 0.5); + int num6 = (int) ((double) vector2_1.Y + num1 * 0.5); + int max = Main.maxTilesX - 10; + int num7 = Utils.Clamp(num3, 10, max); + int num8 = Utils.Clamp(num4, 10, Main.maxTilesX - 10); + int num9 = Utils.Clamp(num5, 10, Main.maxTilesY - 10); + int num10 = Utils.Clamp(num6, 10, Main.maxTilesY - 10); + for (int i1 = num7; i1 < num8; ++i1) + { + for (int j1 = num9; j1 < num10; ++j1) + { + if ((double) Math.Abs((float) i1 - vector2_1.X) + (double) Math.Abs((float) j1 - vector2_1.Y) < num1 * 0.5 * (1.0 + (double) WorldGen.genRand.Next(-10, 11) * 0.015)) + WorldGen.KillTile(i1, j1); + } + } + ++num2; + if (num2 > 10 && WorldGen.genRand.Next(50) < num2) + { + num2 = 0; + int num11 = -2; + if (WorldGen.genRand.Next(2) == 0) + num11 = 2; + WorldGen.TileRunner((int) vector2_1.X, (int) vector2_1.Y, (double) WorldGen.genRand.Next(3, 20), WorldGen.genRand.Next(10, 100), -1, speedX: ((float) num11)); + } + vector2_1 += vector2_2; + vector2_2.Y += (float) WorldGen.genRand.Next(-10, 11) * 0.01f; + if ((double) vector2_2.Y > 0.0) + vector2_2.Y = 0.0f; + if ((double) vector2_2.Y < -2.0) + vector2_2.Y = -2f; + vector2_2.X += (float) WorldGen.genRand.Next(-10, 11) * 0.1f; + if ((double) vector2_1.X < (double) (i - 200)) + vector2_2.X += (float) WorldGen.genRand.Next(5, 21) * 0.1f; + if ((double) vector2_1.X > (double) (i + 200)) + vector2_2.X -= (float) WorldGen.genRand.Next(5, 21) * 0.1f; + if ((double) vector2_2.X > 1.5) + vector2_2.X = 1.5f; + if ((double) vector2_2.X < -1.5) + vector2_2.X = -1.5f; + } + } + public static void GERunner(int i, int j, float speedX = 0.0f, float speedY = 0.0f, bool good = true) { - int num1 = 0; - for (int index1 = 20; index1 < Main.maxTilesX - 20; ++index1) - { - for (int index2 = 20; index2 < Main.maxTilesY - 20; ++index2) - { - if (Main.tile[index1, index2].active() && Main.tile[index1, index2].type == (ushort) 225) - ++num1; - } - } - bool flag1 = false; - if (num1 > 200000) - flag1 = true; - int num2 = (int) ((double) WorldGen.genRand.Next(200, 250) * (double) (Main.maxTilesX / 4200)); - double num3 = (double) num2; + int num1 = (int) ((double) WorldGen.genRand.Next(200, 250) * (double) (Main.maxTilesX / 4200)); + double num2 = (double) num1; Vector2 vector2_1; vector2_1.X = (float) i; vector2_1.Y = (float) j; @@ -45828,48 +33750,38 @@ label_218: vector2_2.X = speedX; vector2_2.Y = speedY; } - bool flag2 = true; - while (flag2) + bool flag = true; + while (flag) { - int num4 = (int) ((double) vector2_1.X - num3 * 0.5); - int num5 = (int) ((double) vector2_1.X + num3 * 0.5); - int num6 = (int) ((double) vector2_1.Y - num3 * 0.5); - int num7 = (int) ((double) vector2_1.Y + num3 * 0.5); - if (num4 < 0) - num4 = 0; - if (num5 > Main.maxTilesX) - num5 = Main.maxTilesX; - if (num6 < 0) - num6 = 0; - if (num7 > Main.maxTilesY - 5) - num7 = Main.maxTilesY - 5; - for (int i1 = num4; i1 < num5; ++i1) + int num3 = (int) ((double) vector2_1.X - num2 * 0.5); + int num4 = (int) ((double) vector2_1.X + num2 * 0.5); + int num5 = (int) ((double) vector2_1.Y - num2 * 0.5); + int num6 = (int) ((double) vector2_1.Y + num2 * 0.5); + if (num3 < 0) + num3 = 0; + if (num4 > Main.maxTilesX) + num4 = Main.maxTilesX; + if (num5 < 0) + num5 = 0; + if (num6 > Main.maxTilesY) + num6 = Main.maxTilesY; + for (int i1 = num3; i1 < num4; ++i1) { - for (int j1 = num6; j1 < num7; ++j1) + for (int j1 = num5; j1 < num6; ++j1) { - if ((double) Math.Abs((float) i1 - vector2_1.X) + (double) Math.Abs((float) j1 - vector2_1.Y) < (double) num2 * 0.5 * (1.0 + (double) WorldGen.genRand.Next(-10, 11) * 0.015)) + if ((double) Math.Abs((float) i1 - vector2_1.X) + (double) Math.Abs((float) j1 - vector2_1.Y) < (double) num1 * 0.5 * (1.0 + (double) WorldGen.genRand.Next(-10, 11) * 0.015)) { if (good) { - if (Main.tile[i1, j1].wall == (ushort) 63 || Main.tile[i1, j1].wall == (ushort) 65 || Main.tile[i1, j1].wall == (ushort) 66 || Main.tile[i1, j1].wall == (ushort) 68 || Main.tile[i1, j1].wall == (ushort) 69 || Main.tile[i1, j1].wall == (ushort) 81) - Main.tile[i1, j1].wall = (ushort) 70; - else if (Main.tile[i1, j1].wall == (ushort) 216) - Main.tile[i1, j1].wall = (ushort) 219; - else if (Main.tile[i1, j1].wall == (ushort) 187) - Main.tile[i1, j1].wall = (ushort) 222; - if (Main.tile[i1, j1].wall == (ushort) 3 || Main.tile[i1, j1].wall == (ushort) 83) - Main.tile[i1, j1].wall = (ushort) 28; - if (flag1 && Main.tile[i1, j1].type == (ushort) 225) - { - Main.tile[i1, j1].type = (ushort) 117; - WorldGen.SquareTileFrame(i1, j1); - } - else if (flag1 && Main.tile[i1, j1].type == (ushort) 230) - { - Main.tile[i1, j1].type = (ushort) 402; - WorldGen.SquareTileFrame(i1, j1); - } - else if (Main.tile[i1, j1].type == (ushort) 2) + if (Main.tile[i1, j1].wall == (byte) 63 || Main.tile[i1, j1].wall == (byte) 65 || Main.tile[i1, j1].wall == (byte) 66 || Main.tile[i1, j1].wall == (byte) 68 || Main.tile[i1, j1].wall == (byte) 69 || Main.tile[i1, j1].wall == (byte) 81) + Main.tile[i1, j1].wall = (byte) 70; + else if (Main.tile[i1, j1].wall == (byte) 216) + Main.tile[i1, j1].wall = (byte) 219; + else if (Main.tile[i1, j1].wall == (byte) 187) + Main.tile[i1, j1].wall = (byte) 222; + if (Main.tile[i1, j1].wall == (byte) 3 || Main.tile[i1, j1].wall == (byte) 83) + Main.tile[i1, j1].wall = (byte) 28; + if (Main.tile[i1, j1].type == (ushort) 2) { Main.tile[i1, j1].type = (ushort) 109; WorldGen.SquareTileFrame(i1, j1); @@ -45917,23 +33829,13 @@ label_218: } else if (WorldGen.crimson) { - if (Main.tile[i1, j1].wall == (ushort) 63 || Main.tile[i1, j1].wall == (ushort) 65 || Main.tile[i1, j1].wall == (ushort) 66 || Main.tile[i1, j1].wall == (ushort) 68) - Main.tile[i1, j1].wall = (ushort) 81; - else if (Main.tile[i1, j1].wall == (ushort) 216) - Main.tile[i1, j1].wall = (ushort) 218; - else if (Main.tile[i1, j1].wall == (ushort) 187) - Main.tile[i1, j1].wall = (ushort) 221; - if (flag1 && Main.tile[i1, j1].type == (ushort) 225) - { - Main.tile[i1, j1].type = (ushort) 203; - WorldGen.SquareTileFrame(i1, j1); - } - else if (flag1 && Main.tile[i1, j1].type == (ushort) 230) - { - Main.tile[i1, j1].type = (ushort) 399; - WorldGen.SquareTileFrame(i1, j1); - } - else if (Main.tile[i1, j1].type == (ushort) 2) + if (Main.tile[i1, j1].wall == (byte) 63 || Main.tile[i1, j1].wall == (byte) 65 || Main.tile[i1, j1].wall == (byte) 66 || Main.tile[i1, j1].wall == (byte) 68) + Main.tile[i1, j1].wall = (byte) 81; + else if (Main.tile[i1, j1].wall == (byte) 216) + Main.tile[i1, j1].wall = (byte) 218; + else if (Main.tile[i1, j1].wall == (byte) 187) + Main.tile[i1, j1].wall = (byte) 221; + if (Main.tile[i1, j1].type == (ushort) 2) { Main.tile[i1, j1].type = (ushort) 199; WorldGen.SquareTileFrame(i1, j1); @@ -45981,23 +33883,13 @@ label_218: } else { - if (Main.tile[i1, j1].wall == (ushort) 63 || Main.tile[i1, j1].wall == (ushort) 65 || Main.tile[i1, j1].wall == (ushort) 66 || Main.tile[i1, j1].wall == (ushort) 68) - Main.tile[i1, j1].wall = (ushort) 69; - else if (Main.tile[i1, j1].wall == (ushort) 216) - Main.tile[i1, j1].wall = (ushort) 217; - else if (Main.tile[i1, j1].wall == (ushort) 187) - Main.tile[i1, j1].wall = (ushort) 220; - if (flag1 && Main.tile[i1, j1].type == (ushort) 225) - { - Main.tile[i1, j1].type = (ushort) 25; - WorldGen.SquareTileFrame(i1, j1); - } - else if (flag1 && Main.tile[i1, j1].type == (ushort) 230) - { - Main.tile[i1, j1].type = (ushort) 398; - WorldGen.SquareTileFrame(i1, j1); - } - else if (Main.tile[i1, j1].type == (ushort) 2) + if (Main.tile[i1, j1].wall == (byte) 63 || Main.tile[i1, j1].wall == (byte) 65 || Main.tile[i1, j1].wall == (byte) 66 || Main.tile[i1, j1].wall == (byte) 68) + Main.tile[i1, j1].wall = (byte) 69; + else if (Main.tile[i1, j1].wall == (byte) 216) + Main.tile[i1, j1].wall = (byte) 217; + else if (Main.tile[i1, j1].wall == (byte) 187) + Main.tile[i1, j1].wall = (byte) 220; + if (Main.tile[i1, j1].type == (ushort) 2) { Main.tile[i1, j1].type = (ushort) 23; WorldGen.SquareTileFrame(i1, j1); @@ -46052,219 +33944,11 @@ label_218: vector2_2.X = speedX + 1f; if ((double) vector2_2.X < (double) speedX - 1.0) vector2_2.X = speedX - 1f; - if ((double) vector2_1.X < (double) -num2 || (double) vector2_1.Y < (double) -num2 || (double) vector2_1.X > (double) (Main.maxTilesX + num2) || (double) vector2_1.Y > (double) (Main.maxTilesY + num2)) - flag2 = false; + if ((double) vector2_1.X < (double) -num1 || (double) vector2_1.Y < (double) -num1 || (double) vector2_1.X > (double) (Main.maxTilesX + num1) || (double) vector2_1.Y > (double) (Main.maxTilesX + num1)) + flag = false; } } - private static bool badOceanCaveTiles(int x, int y) => Main.tile[x, y].wall == (ushort) 83 || Main.tile[x, y].wall == (ushort) 3 || Main.wallDungeon[(int) Main.tile[x, y].wall] || Main.tile[x, y].type == (ushort) 203 || Main.tile[x, y].type == (ushort) 25 || Main.tileDungeon[(int) Main.tile[x, y].type] || Main.tile[x, y].type == (ushort) 26 || Main.tile[x, y].type == (ushort) 31; - - public static void oceanCave(int i, int j) - { - if (WorldGen.numOceanCaveTreasure >= WorldGen.maxOceanCaveTreasure) - WorldGen.numOceanCaveTreasure = 0; - Vector2 vector2_1; - vector2_1.X = (float) i; - vector2_1.Y = (float) j; - Vector2 vector2_2; - vector2_2.X = i >= Main.maxTilesX / 2 ? (float) (-0.349999994039536 - (double) WorldGen.genRand.NextFloat() * 0.5) : (float) (0.25 + (double) WorldGen.genRand.NextFloat() * 0.25); - vector2_2.Y = (float) (0.400000005960464 + (double) WorldGen.genRand.NextFloat() * 0.25); - ushort num1 = 264; - ushort num2 = 53; - ushort num3 = 397; - double num4 = (double) WorldGen.genRand.Next(17, 25); - double num5 = (double) WorldGen.genRand.Next(600, 800); - double num6 = 4.0; - bool flag1 = true; - while (num4 > num6 && num5 > 0.0) - { - bool flag2 = true; - bool flag3 = true; - bool flag4 = true; - if ((double) vector2_1.X > (double) (WorldGen.beachDistance - 50) && (double) vector2_1.X < (double) (Main.maxTilesX - WorldGen.beachDistance + 50)) - { - num4 *= 0.959999978542328; - num5 *= 0.959999978542328; - } - if (num4 < num6 + 2.0 || num5 < 20.0) - flag4 = false; - if (flag1) - { - num4 -= 0.01 + (double) WorldGen.genRand.NextFloat() * 0.01; - num5 -= 0.5; - } - else - { - num4 -= 0.02 + (double) WorldGen.genRand.NextFloat() * 0.02; - --num5; - } - if (flag4) - { - WorldGen.oceanCaveTreasure[WorldGen.numOceanCaveTreasure].X = (int) vector2_1.X; - WorldGen.oceanCaveTreasure[WorldGen.numOceanCaveTreasure].Y = (int) vector2_1.Y; - } - int num7 = (int) ((double) vector2_1.X - num4 * 3.0); - int num8 = (int) ((double) vector2_1.X + num4 * 3.0); - int num9 = (int) ((double) vector2_1.Y - num4 * 3.0); - int num10 = (int) ((double) vector2_1.Y + num4 * 3.0); - if (num7 < 1) - num7 = 1; - if (num8 > Main.maxTilesX - 1) - num8 = Main.maxTilesX - 1; - if (num9 < 1) - num9 = 1; - if (num10 > Main.maxTilesY - 1) - num10 = Main.maxTilesY - 1; - for (int x1 = num7; x1 < num8; ++x1) - { - for (int y1 = num9; y1 < num10; ++y1) - { - if (!WorldGen.badOceanCaveTiles(x1, y1)) - { - float num11 = new Vector2(Math.Abs((float) x1 - vector2_1.X), Math.Abs((float) y1 - vector2_1.Y)).Length(); - if (flag4 && (double) num11 < num4 * 0.5 + 1.0) - { - Main.tile[x1, y1].type = num1; - Main.tile[x1, y1].active(false); - } - else if ((double) num11 < num4 * 1.5 + 1.0 && (int) Main.tile[x1, y1].type != (int) num1) - { - if ((double) y1 < (double) vector2_1.Y) - { - if ((double) vector2_2.X < 0.0 && (double) x1 < (double) vector2_1.X || (double) vector2_2.X > 0.0 && (double) x1 > (double) vector2_1.X) - { - if ((double) num11 < num4 * 1.1 + 1.0) - { - Main.tile[x1, y1].type = num3; - if (Main.tile[x1, y1].liquid == byte.MaxValue) - Main.tile[x1, y1].wall = (ushort) 0; - } - else if ((int) Main.tile[x1, y1].type != (int) num3) - Main.tile[x1, y1].type = num2; - } - } - else if ((double) vector2_2.X < 0.0 && x1 < i || (double) vector2_2.X > 0.0 && x1 > i) - { - if (Main.tile[x1, y1].liquid == byte.MaxValue) - Main.tile[x1, y1].wall = (ushort) 0; - Main.tile[x1, y1].type = num2; - Main.tile[x1, y1].active(true); - if (x1 == (int) vector2_1.X & flag2) - { - flag2 = false; - int num12 = 50 + WorldGen.genRand.Next(3); - int num13 = 43 + WorldGen.genRand.Next(3); - int num14 = 20 + WorldGen.genRand.Next(3); - int num15 = x1; - int num16 = x1 + num14; - if ((double) vector2_2.X < 0.0) - { - num15 = x1 - num14; - num16 = x1; - } - if (num5 < 100.0) - { - num12 = (int) ((double) num12 * (num5 / 100.0)); - num13 = (int) ((double) num13 * (num5 / 100.0)); - num14 = (int) ((double) num14 * (num5 / 100.0)); - } - if (num4 < num6 + 5.0) - { - double num17 = (num4 - num6) / 5.0; - num12 = (int) ((double) num12 * num17); - num13 = (int) ((double) num13 * num17); - int num18 = (int) ((double) num14 * num17); - } - for (int index1 = num15; index1 <= num16; ++index1) - { - for (int index2 = y1; index2 < y1 + num12 && !WorldGen.badOceanCaveTiles(index1, index2); ++index2) - { - if (index2 > y1 + num13) - { - if (!WorldGen.SolidTile(index1, index2) || (int) Main.tile[index1, index2].type == (int) num2) - Main.tile[index1, index2].type = num3; - else - break; - } - else - Main.tile[index1, index2].type = num2; - Main.tile[index1, index2].active(true); - if (WorldGen.genRand.Next(3) == 0) - { - Main.tile[index1 - 1, index2].type = num2; - Main.tile[index1 - 1, index2].active(true); - } - if (WorldGen.genRand.Next(3) == 0) - { - Main.tile[index1 + 1, index2].type = num2; - Main.tile[index1 + 1, index2].active(true); - } - } - } - } - } - } - if ((double) num11 < num4 * 1.3 + 1.0 && y1 > j - 10) - Main.tile[x1, y1].liquid = byte.MaxValue; - if (flag3 && x1 == (int) vector2_1.X && (double) y1 > (double) vector2_1.Y) - { - flag3 = false; - int num19 = 100; - int num20 = 2; - for (int x2 = x1 - num20; x2 <= x1 + num20; ++x2) - { - for (int y2 = y1; y2 < y1 + num19; ++y2) - { - if (!WorldGen.badOceanCaveTiles(x2, y2)) - Main.tile[x2, y2].liquid = byte.MaxValue; - } - } - } - } - } - } - vector2_1 += vector2_2; - vector2_2.X += (float) ((double) WorldGen.genRand.NextFloat() * 0.100000001490116 - 0.0500000007450581); - vector2_2.Y += (float) ((double) WorldGen.genRand.NextFloat() * 0.100000001490116 - 0.0500000007450581); - if (flag1) - { - if ((double) vector2_1.Y > (Main.worldSurface * 2.0 + Main.rockLayer) / 3.0 && (double) vector2_1.Y > (double) (j + 30)) - flag1 = false; - vector2_2.Y = MathHelper.Clamp(vector2_2.Y, 0.35f, 1f); - } - else - { - if ((double) vector2_1.X < (double) (Main.maxTilesX / 2)) - { - if ((double) vector2_2.X < 0.5) - vector2_2.X += 0.02f; - } - else if ((double) vector2_2.X > -0.5) - vector2_2.X -= 0.02f; - if (!flag4) - { - if ((double) vector2_2.Y < 0.0) - vector2_2.Y *= 0.95f; - vector2_2.Y += 0.04f; - } - else if ((double) vector2_1.Y < (Main.worldSurface * 4.0 + Main.rockLayer) / 5.0) - { - if ((double) vector2_2.Y < 0.0) - vector2_2.Y *= 0.97f; - vector2_2.Y += 0.02f; - } - else if ((double) vector2_2.Y > -0.100000001490116) - { - vector2_2.Y *= 0.99f; - vector2_2.Y -= 0.01f; - } - vector2_2.Y = MathHelper.Clamp(vector2_2.Y, -1f, 1f); - } - vector2_2.X = (double) vector2_1.X >= (double) (Main.maxTilesX / 2) ? MathHelper.Clamp(vector2_2.X, -1f, -0.1f) : MathHelper.Clamp(vector2_2.X, 0.1f, 1f); - } - ++WorldGen.numOceanCaveTreasure; - } - public static void TileRunner( int i, int j, @@ -46275,19 +33959,8 @@ label_218: float speedX = 0.0f, float speedY = 0.0f, bool noYChange = false, - bool overRide = true, - int ignoreTileType = -1) + bool overRide = true) { - if (WorldGen.drunkWorldGen) - { - strength *= 1.0 + (double) WorldGen.genRand.Next(-80, 81) * 0.00999999977648258; - steps = (int) ((double) steps * (1.0 + (double) WorldGen.genRand.Next(-80, 81) * 0.00999999977648258)); - } - if (WorldGen.getGoodWorldGen && type != 57) - { - strength *= 1.0 + (double) WorldGen.genRand.Next(-80, 81) * 0.0149999996647239; - steps += WorldGen.genRand.Next(3); - } double num1 = strength; float num2 = (float) steps; Vector2 vector2_1; @@ -46303,16 +33976,8 @@ label_218: } bool flag1 = type == 368; bool flag2 = type == 367; - bool lava = false; - if (WorldGen.getGoodWorldGen && WorldGen.genRand.Next(4) == 0) - lava = true; while (num1 > 0.0 && (double) num2 > 0.0) { - if (WorldGen.drunkWorldGen && WorldGen.genRand.Next(30) == 0) - { - vector2_1.X += (float) WorldGen.genRand.Next(-100, 101) * 0.05f; - vector2_1.Y += (float) WorldGen.genRand.Next(-100, 101) * 0.05f; - } if ((double) vector2_1.Y < 0.0 && (double) num2 > 0.0 && type == 59) num2 = 0.0f; num1 = strength * ((double) num2 / (double) steps); @@ -46329,54 +33994,48 @@ label_218: num5 = 1; if (num6 > Main.maxTilesY - 1) num6 = Main.maxTilesY - 1; - for (int index1 = num3; index1 < num4; ++index1) + for (int i1 = num3; i1 < num4; ++i1) { - if (index1 < WorldGen.beachDistance + 50 || index1 >= Main.maxTilesX - WorldGen.beachDistance - 50) - lava = false; - for (int index2 = num5; index2 < num6; ++index2) + for (int j1 = num5; j1 < num6; ++j1) { - if ((!WorldGen.drunkWorldGen || index2 >= Main.maxTilesY - 300 || type != 57) && (ignoreTileType < 0 || !Main.tile[index1, index2].active() || (int) Main.tile[index1, index2].type != ignoreTileType) && (double) Math.Abs((float) index1 - vector2_1.X) + (double) Math.Abs((float) index2 - vector2_1.Y) < strength * 0.5 * (1.0 + (double) WorldGen.genRand.Next(-10, 11) * 0.015)) + if ((double) Math.Abs((float) i1 - vector2_1.X) + (double) Math.Abs((float) j1 - vector2_1.Y) < strength * 0.5 * (1.0 + (double) WorldGen.genRand.Next(-10, 11) * 0.015)) { - if (WorldGen.mudWall && (double) index2 > Main.worldSurface && Main.tile[index1, index2 - 1].wall != (ushort) 2 && index2 < Main.maxTilesY - 210 - WorldGen.genRand.Next(3) && (double) Math.Abs((float) index1 - vector2_1.X) + (double) Math.Abs((float) index2 - vector2_1.Y) < strength * 0.45 * (1.0 + (double) WorldGen.genRand.Next(-10, 11) * 0.01)) + if (WorldGen.mudWall && (double) j1 > Main.worldSurface && Main.tile[i1, j1 - 1].wall != (byte) 2 && j1 < Main.maxTilesY - 210 - WorldGen.genRand.Next(3)) { - if (index2 > WorldGen.lavaLine - WorldGen.genRand.Next(0, 4) - 50) + if (j1 > WorldGen.lavaLine - WorldGen.genRand.Next(0, 4) - 50) { - if (Main.tile[index1, index2 - 1].wall != (ushort) 64 && Main.tile[index1, index2 + 1].wall != (ushort) 64 && Main.tile[index1 - 1, index2].wall != (ushort) 64 && Main.tile[index1, index2 + 1].wall != (ushort) 64) - WorldGen.PlaceWall(index1, index2, 15, true); + if (Main.tile[i1, j1 - 1].wall != (byte) 64 && Main.tile[i1, j1 + 1].wall != (byte) 64 && Main.tile[i1 - 1, j1].wall != (byte) 64 && Main.tile[i1, j1 + 1].wall != (byte) 64) + WorldGen.PlaceWall(i1, j1, 15, true); } - else if (Main.tile[index1, index2 - 1].wall != (ushort) 15 && Main.tile[index1, index2 + 1].wall != (ushort) 15 && Main.tile[index1 - 1, index2].wall != (ushort) 15 && Main.tile[index1, index2 + 1].wall != (ushort) 15) - WorldGen.PlaceWall(index1, index2, 64, true); + else if (Main.tile[i1, j1 - 1].wall != (byte) 15 && Main.tile[i1, j1 + 1].wall != (byte) 15 && Main.tile[i1 - 1, j1].wall != (byte) 15 && Main.tile[i1, j1 + 1].wall != (byte) 15) + WorldGen.PlaceWall(i1, j1, 64, true); } if (type < 0) { - if (Main.tile[index1, index2].type != (ushort) 53) + if (type == -2 && Main.tile[i1, j1].active() && (j1 < WorldGen.waterLine || j1 > WorldGen.lavaLine)) { - if (type == -2 && Main.tile[index1, index2].active() && (index2 < WorldGen.waterLine || index2 > WorldGen.lavaLine)) - { - Main.tile[index1, index2].liquid = byte.MaxValue; - Main.tile[index1, index2].lava(lava); - if (index2 > WorldGen.lavaLine) - Main.tile[index1, index2].lava(true); - } - Main.tile[index1, index2].active(false); + Main.tile[i1, j1].liquid = byte.MaxValue; + if (j1 > WorldGen.lavaLine) + Main.tile[i1, j1].lava(true); } + Main.tile[i1, j1].active(false); } else { - if (flag1 && (double) Math.Abs((float) index1 - vector2_1.X) + (double) Math.Abs((float) index2 - vector2_1.Y) < strength * 0.3 * (1.0 + (double) WorldGen.genRand.Next(-10, 11) * 0.01)) - WorldGen.PlaceWall(index1, index2, 180, true); - if (flag2 && (double) Math.Abs((float) index1 - vector2_1.X) + (double) Math.Abs((float) index2 - vector2_1.Y) < strength * 0.3 * (1.0 + (double) WorldGen.genRand.Next(-10, 11) * 0.01)) - WorldGen.PlaceWall(index1, index2, 178, true); - if (overRide || !Main.tile[index1, index2].active()) + if (flag1 && (double) Math.Abs((float) i1 - vector2_1.X) + (double) Math.Abs((float) j1 - vector2_1.Y) < strength * 0.3 * (1.0 + (double) WorldGen.genRand.Next(-10, 11) * 0.01)) + WorldGen.PlaceWall(i1, j1, 180, true); + if (flag2 && (double) Math.Abs((float) i1 - vector2_1.X) + (double) Math.Abs((float) j1 - vector2_1.Y) < strength * 0.3 * (1.0 + (double) WorldGen.genRand.Next(-10, 11) * 0.01)) + WorldGen.PlaceWall(i1, j1, 178, true); + if (overRide || !Main.tile[i1, j1].active()) { - Tile tile = Main.tile[index1, index2]; + Tile tile = Main.tile[i1, j1]; bool flag3 = Main.tileStone[type] && tile.type != (ushort) 1; if (!TileID.Sets.CanBeClearedDuringGeneration[(int) tile.type]) flag3 = true; switch (tile.type) { case 1: - if (type == 59 && (double) index2 < Main.worldSurface + (double) WorldGen.genRand.Next(-50, 50)) + if (type == 59 && (double) j1 < Main.worldSurface + (double) WorldGen.genRand.Next(-50, 50)) { flag3 = true; break; @@ -46387,15 +34046,12 @@ label_218: case 189: case 190: case 196: - case 460: flag3 = true; break; case 53: - if (type == 59 && WorldGen.UndergroundDesertLocation.Contains(index1, index2)) - flag3 = true; if (type == 40) flag3 = true; - if ((double) index2 < Main.worldSurface && type != 59) + if ((double) j1 < Main.worldSurface && type != 59) { flag3 = true; break; @@ -46419,23 +34075,23 @@ label_218: } if (addTile) { - Main.tile[index1, index2].active(true); - Main.tile[index1, index2].liquid = (byte) 0; - Main.tile[index1, index2].lava(false); + Main.tile[i1, j1].active(true); + Main.tile[i1, j1].liquid = (byte) 0; + Main.tile[i1, j1].lava(false); } - if (noYChange && (double) index2 < Main.worldSurface && type != 59) - Main.tile[index1, index2].wall = (ushort) 2; - if (type == 59 && index2 > WorldGen.waterLine && Main.tile[index1, index2].liquid > (byte) 0) + if (noYChange && (double) j1 < Main.worldSurface && type != 59) + Main.tile[i1, j1].wall = (byte) 2; + if (type == 59 && j1 > WorldGen.waterLine && Main.tile[i1, j1].liquid > (byte) 0) { - Main.tile[index1, index2].lava(false); - Main.tile[index1, index2].liquid = (byte) 0; + Main.tile[i1, j1].lava(false); + Main.tile[i1, j1].liquid = (byte) 0; } } } } } vector2_1 += vector2_2; - if ((!WorldGen.drunkWorldGen || WorldGen.genRand.Next(3) != 0) && num1 > 50.0) + if (num1 > 50.0) { vector2_1 += vector2_2; --num2; @@ -46520,8 +34176,6 @@ label_218: } } vector2_2.X += (float) WorldGen.genRand.Next(-10, 11) * 0.05f; - if (WorldGen.drunkWorldGen) - vector2_2.X += (float) WorldGen.genRand.Next(-10, 11) * 0.25f; if ((double) vector2_2.X > 1.0) vector2_2.X = 1f; if ((double) vector2_2.X < -1.0) @@ -46586,8 +34240,8 @@ label_218: { for (int index2 = num7; index2 < num8; ++index2) { - if ((double) Math.Abs((float) index1 - vector2_1.X) + (double) Math.Abs((float) index2 - vector2_1.Y) < num1 * 0.5 * (1.0 + (double) WorldGen.genRand.Next(-10, 11) * 0.015) && Main.tile[index1, index2].wall == (ushort) 2) - Main.tile[index1, index2].wall = (ushort) 59; + if ((double) Math.Abs((float) index1 - vector2_1.X) + (double) Math.Abs((float) index2 - vector2_1.Y) < num1 * 0.5 * (1.0 + (double) WorldGen.genRand.Next(-10, 11) * 0.015) && Main.tile[index1, index2].wall == (byte) 2) + Main.tile[index1, index2].wall = (byte) 59; } } vector2_1 += vector2_2; @@ -46636,7 +34290,7 @@ label_218: for (int index2 = num7; index2 < num8; ++index2) { if ((double) Math.Abs((float) index1 - vector2_1.X) + (double) Math.Abs((float) index2 - vector2_1.Y) < num1 * 0.5 * (1.0 + (double) WorldGen.genRand.Next(-10, 11) * 0.015) && (double) index2 > Main.worldSurface) - Main.tile[index1, index2].wall = (ushort) 0; + Main.tile[index1, index2].wall = (byte) 0; } } vector2_1 += vector2_2; @@ -46653,610 +34307,6 @@ label_218: } } - public static void SnowCloudIsland(int i, int j) - { - double num1 = (double) WorldGen.genRand.Next(100, 150); - double num2 = num1; - float num3 = (float) WorldGen.genRand.Next(20, 30); - int num4 = i; - int num5 = i; - int num6 = i; - int num7 = j; - Vector2 vector2_1; - vector2_1.X = (float) i; - vector2_1.Y = (float) j; - Vector2 vector2_2; - vector2_2.X = (float) WorldGen.genRand.Next(-20, 21) * 0.2f; - while ((double) vector2_2.X > -2.0 && (double) vector2_2.X < 2.0) - vector2_2.X = (float) WorldGen.genRand.Next(-20, 21) * 0.2f; - vector2_2.Y = (float) WorldGen.genRand.Next(-20, -10) * 0.02f; - while (num1 > 0.0 && (double) num3 > 0.0) - { - num1 -= (double) WorldGen.genRand.Next(4); - --num3; - int num8 = (int) ((double) vector2_1.X - num1 * 0.5); - int num9 = (int) ((double) vector2_1.X + num1 * 0.5); - int num10 = (int) ((double) vector2_1.Y - num1 * 0.5); - int num11 = (int) ((double) vector2_1.Y + num1 * 0.5); - if (num8 < 0) - num8 = 0; - if (num9 > Main.maxTilesX) - num9 = Main.maxTilesX; - if (num10 < 0) - num10 = 0; - if (num11 > Main.maxTilesY) - num11 = Main.maxTilesY; - double num12 = num1 * (double) WorldGen.genRand.Next(80, 120) * 0.01; - float num13 = vector2_1.Y + 1f; - for (int i1 = num8; i1 < num9; ++i1) - { - if (WorldGen.genRand.Next(2) == 0) - num13 += (float) WorldGen.genRand.Next(-1, 2); - if ((double) num13 < (double) vector2_1.Y) - num13 = vector2_1.Y; - if ((double) num13 > (double) vector2_1.Y + 2.0) - num13 = vector2_1.Y + 2f; - for (int j1 = num10; j1 < num11; ++j1) - { - if ((double) j1 > (double) num13) - { - double num14 = (double) Math.Abs((float) i1 - vector2_1.X); - float num15 = Math.Abs((float) j1 - vector2_1.Y) * 3f; - if (Math.Sqrt(num14 * num14 + (double) num15 * (double) num15) < num12 * 0.4) - { - if (i1 < num4) - num4 = i1; - if (i1 > num5) - num5 = i1; - if (j1 < num6) - num6 = j1; - if (j1 > num7) - num7 = j1; - Main.tile[i1, j1].active(true); - Main.tile[i1, j1].type = (ushort) 189; - WorldGen.SquareTileFrame(i1, j1); - } - } - } - } - vector2_1 += vector2_2; - vector2_2.X += (float) WorldGen.genRand.Next(-20, 21) * 0.05f; - if ((double) vector2_2.X > 1.0) - vector2_2.X = 1f; - if ((double) vector2_2.X < -1.0) - vector2_2.X = -1f; - if ((double) vector2_2.Y > 0.2) - vector2_2.Y = -0.2f; - if ((double) vector2_2.Y < -0.2) - vector2_2.Y = -0.2f; - } - int minValue1; - for (int index1 = num4 + WorldGen.genRand.Next(5); index1 < num5; index1 += WorldGen.genRand.Next(minValue1, (int) ((double) minValue1 * 1.5))) - { - int index2 = num7; - while (!Main.tile[index1, index2].active()) - --index2; - int num16 = index2 + WorldGen.genRand.Next(-3, 4); - minValue1 = WorldGen.genRand.Next(4, 8); - int num17 = 189; - if (WorldGen.genRand.Next(4) == 0) - num17 = 460; - for (int i2 = index1 - minValue1; i2 <= index1 + minValue1; ++i2) - { - for (int j2 = num16 - minValue1; j2 <= num16 + minValue1; ++j2) - { - if (j2 > num6) - { - double num18 = (double) Math.Abs(i2 - index1); - float num19 = (float) (Math.Abs(j2 - num16) * 2); - if (Math.Sqrt(num18 * num18 + (double) num19 * (double) num19) < (double) (minValue1 + WorldGen.genRand.Next(2))) - { - Main.tile[i2, j2].active(true); - Main.tile[i2, j2].type = (ushort) num17; - WorldGen.SquareTileFrame(i2, j2); - } - } - } - } - } - double num20 = (double) WorldGen.genRand.Next(80, 95); - num2 = num20; - float num21 = (float) WorldGen.genRand.Next(10, 15); - vector2_1.X = (float) i; - vector2_1.Y = (float) num6; - vector2_2.X = (float) WorldGen.genRand.Next(-20, 21) * 0.2f; - while ((double) vector2_2.X > -2.0 && (double) vector2_2.X < 2.0) - vector2_2.X = (float) WorldGen.genRand.Next(-20, 21) * 0.2f; - vector2_2.Y = (float) WorldGen.genRand.Next(-20, -10) * 0.02f; - while (num20 > 0.0 && (double) num21 > 0.0) - { - num20 -= (double) WorldGen.genRand.Next(4); - --num21; - int num22 = (int) ((double) vector2_1.X - num20 * 0.5); - int num23 = (int) ((double) vector2_1.X + num20 * 0.5); - int num24 = num6 - 1; - int num25 = (int) ((double) vector2_1.Y + num20 * 0.5); - if (num22 < 0) - num22 = 0; - if (num23 > Main.maxTilesX) - num23 = Main.maxTilesX; - if (num24 < 0) - num24 = 0; - if (num25 > Main.maxTilesY) - num25 = Main.maxTilesY; - double num26 = num20 * (double) WorldGen.genRand.Next(80, 120) * 0.01; - float num27 = vector2_1.Y + 1f; - for (int i3 = num22; i3 < num23; ++i3) - { - if (WorldGen.genRand.Next(2) == 0) - num27 += (float) WorldGen.genRand.Next(-1, 2); - if ((double) num27 < (double) vector2_1.Y) - num27 = vector2_1.Y; - if ((double) num27 > (double) vector2_1.Y + 2.0) - num27 = vector2_1.Y + 2f; - for (int j3 = num24; j3 < num25; ++j3) - { - if ((double) j3 > (double) num27) - { - double num28 = (double) Math.Abs((float) i3 - vector2_1.X); - float num29 = Math.Abs((float) j3 - vector2_1.Y) * 3f; - if (Math.Sqrt(num28 * num28 + (double) num29 * (double) num29) < num26 * 0.4 && Main.tile[i3, j3].type == (ushort) 189) - { - Main.tile[i3, j3].type = (ushort) 147; - WorldGen.SquareTileFrame(i3, j3); - } - } - } - } - vector2_1 += vector2_2; - vector2_2.X += (float) WorldGen.genRand.Next(-20, 21) * 0.05f; - if ((double) vector2_2.X > 1.0) - vector2_2.X = 1f; - if ((double) vector2_2.X < -1.0) - vector2_2.X = -1f; - if ((double) vector2_2.Y > 0.2) - vector2_2.Y = -0.2f; - if ((double) vector2_2.Y < -0.2) - vector2_2.Y = -0.2f; - } - int index3 = num4 + WorldGen.genRand.Next(5); - while (index3 < num5) - { - int index4 = num7; - while ((!Main.tile[index3, index4].active() || Main.tile[index3, index4].type != (ushort) 0) && index3 < num5) - { - --index4; - if (index4 < num6) - { - index4 = num7; - index3 += WorldGen.genRand.Next(1, 4); - } - } - if (index3 < num5) - { - int num30 = index4 + WorldGen.genRand.Next(0, 4); - int minValue2 = WorldGen.genRand.Next(2, 5); - int num31 = 189; - for (int i4 = index3 - minValue2; i4 <= index3 + minValue2; ++i4) - { - for (int j4 = num30 - minValue2; j4 <= num30 + minValue2; ++j4) - { - if (j4 > num6) - { - double num32 = (double) Math.Abs(i4 - index3); - float num33 = (float) (Math.Abs(j4 - num30) * 2); - if (Math.Sqrt(num32 * num32 + (double) num33 * (double) num33) < (double) minValue2) - { - Main.tile[i4, j4].type = (ushort) num31; - WorldGen.SquareTileFrame(i4, j4); - } - } - } - } - index3 += WorldGen.genRand.Next(minValue2, (int) ((double) minValue2 * 1.5)); - } - } - for (int i5 = num4 - 20; i5 <= num5 + 20; ++i5) - { - for (int j5 = num6 - 20; j5 <= num7 + 20; ++j5) - { - bool flag = true; - for (int index5 = i5 - 1; index5 <= i5 + 1; ++index5) - { - for (int index6 = j5 - 1; index6 <= j5 + 1; ++index6) - { - if (!Main.tile[index5, index6].active()) - flag = false; - } - } - if (flag) - { - Main.tile[i5, j5].wall = (ushort) 73; - WorldGen.SquareWallFrame(i5, j5); - } - } - } - for (int index7 = num4; index7 <= num5; ++index7) - { - int index8 = num6 - 10; - while (!Main.tile[index7, index8 + 1].active()) - ++index8; - if (index8 < num7 && Main.tile[index7, index8 + 1].type == (ushort) 189) - { - if (WorldGen.genRand.Next(10) == 0) - { - int num34 = WorldGen.genRand.Next(1, 3); - for (int x = index7 - num34; x <= index7 + num34; ++x) - { - if (Main.tile[x, index8].type == (ushort) 189 && WorldGen.WillWaterPlacedHereStayPut(x, index8)) - { - Main.tile[x, index8].active(false); - Main.tile[x, index8].liquid = byte.MaxValue; - Main.tile[x, index8].lava(false); - WorldGen.SquareTileFrame(index7, index8); - } - if (Main.tile[x, index8 + 1].type == (ushort) 189 && WorldGen.WillWaterPlacedHereStayPut(x, index8 + 1)) - { - Main.tile[x, index8 + 1].active(false); - Main.tile[x, index8 + 1].liquid = byte.MaxValue; - Main.tile[x, index8 + 1].lava(false); - WorldGen.SquareTileFrame(index7, index8 + 1); - } - if (x > index7 - num34 && x < index7 + 2 && Main.tile[x, index8 + 2].type == (ushort) 189 && WorldGen.WillWaterPlacedHereStayPut(x, index8 + 2)) - { - Main.tile[x, index8 + 2].active(false); - Main.tile[x, index8 + 2].liquid = byte.MaxValue; - Main.tile[x, index8 + 2].lava(false); - WorldGen.SquareTileFrame(index7, index8 + 2); - } - } - } - if (WorldGen.genRand.Next(5) == 0 && WorldGen.WillWaterPlacedHereStayPut(index7, index8)) - Main.tile[index7, index8].liquid = byte.MaxValue; - Main.tile[index7, index8].lava(false); - WorldGen.SquareTileFrame(index7, index8); - } - } - int num35 = WorldGen.genRand.Next(4); - for (int index9 = 0; index9 <= num35; ++index9) - { - int num36 = WorldGen.genRand.Next(num4 - 5, num5 + 5); - int num37 = num6 - WorldGen.genRand.Next(20, 40); - int num38 = WorldGen.genRand.Next(4, 8); - int num39 = 189; - if (WorldGen.genRand.Next(2) == 0) - num39 = 460; - for (int i6 = num36 - num38; i6 <= num36 + num38; ++i6) - { - for (int j6 = num37 - num38; j6 <= num37 + num38; ++j6) - { - double num40 = (double) Math.Abs(i6 - num36); - float num41 = (float) (Math.Abs(j6 - num37) * 2); - if (Math.Sqrt(num40 * num40 + (double) num41 * (double) num41) < (double) (num38 + WorldGen.genRand.Next(-1, 2))) - { - Main.tile[i6, j6].active(true); - Main.tile[i6, j6].type = (ushort) num39; - WorldGen.SquareTileFrame(i6, j6); - } - } - } - for (int index10 = num36 - num38 + 2; index10 <= num36 + num38 - 2; ++index10) - { - int index11 = num37 - num38; - while (!Main.tile[index10, index11].active()) - ++index11; - if (WorldGen.WillWaterPlacedHereStayPut(index10, index11)) - { - Main.tile[index10, index11].active(false); - Main.tile[index10, index11].liquid = byte.MaxValue; - WorldGen.SquareTileFrame(index10, index11); - } - } - } - } - - public static void DesertCloudIsland(int i, int j) - { - double num1 = (double) WorldGen.genRand.Next(100, 150); - double num2 = num1; - float num3 = (float) WorldGen.genRand.Next(20, 30); - int num4 = i; - int num5 = i; - int num6 = i; - int num7 = j; - Vector2 vector2_1; - vector2_1.X = (float) i; - vector2_1.Y = (float) j; - Vector2 vector2_2; - vector2_2.X = (float) WorldGen.genRand.Next(-20, 21) * 0.2f; - while ((double) vector2_2.X > -2.0 && (double) vector2_2.X < 2.0) - vector2_2.X = (float) WorldGen.genRand.Next(-20, 21) * 0.2f; - vector2_2.Y = (float) WorldGen.genRand.Next(-20, -10) * 0.02f; - while (num1 > 0.0 && (double) num3 > 0.0) - { - num1 -= (double) WorldGen.genRand.Next(4); - --num3; - int num8 = (int) ((double) vector2_1.X - num1 * 0.5); - int num9 = (int) ((double) vector2_1.X + num1 * 0.5); - int num10 = (int) ((double) vector2_1.Y - num1 * 0.5); - int num11 = (int) ((double) vector2_1.Y + num1 * 0.5); - if (num8 < 0) - num8 = 0; - if (num9 > Main.maxTilesX) - num9 = Main.maxTilesX; - if (num10 < 0) - num10 = 0; - if (num11 > Main.maxTilesY) - num11 = Main.maxTilesY; - double num12 = num1 * (double) WorldGen.genRand.Next(80, 120) * 0.01; - float num13 = vector2_1.Y + 1f; - for (int i1 = num8; i1 < num9; ++i1) - { - if (WorldGen.genRand.Next(2) == 0) - num13 += (float) WorldGen.genRand.Next(-1, 2); - if ((double) num13 < (double) vector2_1.Y) - num13 = vector2_1.Y; - if ((double) num13 > (double) vector2_1.Y + 2.0) - num13 = vector2_1.Y + 2f; - for (int j1 = num10; j1 < num11; ++j1) - { - if ((double) j1 > (double) num13) - { - double num14 = (double) Math.Abs((float) i1 - vector2_1.X); - float num15 = Math.Abs((float) j1 - vector2_1.Y) * 3f; - if (Math.Sqrt(num14 * num14 + (double) num15 * (double) num15) < num12 * 0.4) - { - if (i1 < num4) - num4 = i1; - if (i1 > num5) - num5 = i1; - if (j1 < num6) - num6 = j1; - if (j1 > num7) - num7 = j1; - Main.tile[i1, j1].active(true); - Main.tile[i1, j1].type = (ushort) 189; - WorldGen.SquareTileFrame(i1, j1); - } - } - } - } - vector2_1 += vector2_2; - vector2_2.X += (float) WorldGen.genRand.Next(-20, 21) * 0.05f; - if ((double) vector2_2.X > 1.0) - vector2_2.X = 1f; - if ((double) vector2_2.X < -1.0) - vector2_2.X = -1f; - if ((double) vector2_2.Y > 0.2) - vector2_2.Y = -0.2f; - if ((double) vector2_2.Y < -0.2) - vector2_2.Y = -0.2f; - } - int minValue1; - for (int index1 = num4 + WorldGen.genRand.Next(5); index1 < num5; index1 += WorldGen.genRand.Next(minValue1, (int) ((double) minValue1 * 1.5))) - { - int index2 = num7; - while (!Main.tile[index1, index2].active()) - --index2; - int num16 = index2 + WorldGen.genRand.Next(-3, 4); - minValue1 = WorldGen.genRand.Next(4, 8); - int num17 = 189; - if (WorldGen.genRand.Next(4) == 0) - num17 = 196; - for (int i2 = index1 - minValue1; i2 <= index1 + minValue1; ++i2) - { - for (int j2 = num16 - minValue1; j2 <= num16 + minValue1; ++j2) - { - if (j2 > num6) - { - double num18 = (double) Math.Abs(i2 - index1); - float num19 = (float) (Math.Abs(j2 - num16) * 2); - if (Math.Sqrt(num18 * num18 + (double) num19 * (double) num19) < (double) (minValue1 + WorldGen.genRand.Next(2))) - { - Main.tile[i2, j2].active(true); - Main.tile[i2, j2].type = (ushort) num17; - WorldGen.SquareTileFrame(i2, j2); - } - } - } - } - } - double num20 = (double) WorldGen.genRand.Next(80, 95); - num2 = num20; - float num21 = (float) WorldGen.genRand.Next(10, 15); - vector2_1.X = (float) i; - vector2_1.Y = (float) num6; - vector2_2.X = (float) WorldGen.genRand.Next(-20, 21) * 0.2f; - while ((double) vector2_2.X > -2.0 && (double) vector2_2.X < 2.0) - vector2_2.X = (float) WorldGen.genRand.Next(-20, 21) * 0.2f; - vector2_2.Y = (float) WorldGen.genRand.Next(-20, -10) * 0.02f; - while (num20 > 0.0 && (double) num21 > 0.0) - { - num20 -= (double) WorldGen.genRand.Next(4); - --num21; - int num22 = (int) ((double) vector2_1.X - num20 * 0.5); - int num23 = (int) ((double) vector2_1.X + num20 * 0.5); - int num24 = num6 - 1; - int num25 = (int) ((double) vector2_1.Y + num20 * 0.5); - if (num22 < 0) - num22 = 0; - if (num23 > Main.maxTilesX) - num23 = Main.maxTilesX; - if (num24 < 0) - num24 = 0; - if (num25 > Main.maxTilesY) - num25 = Main.maxTilesY; - double num26 = num20 * (double) WorldGen.genRand.Next(80, 120) * 0.01; - float num27 = vector2_1.Y + 1f; - for (int i3 = num22; i3 < num23; ++i3) - { - if (WorldGen.genRand.Next(2) == 0) - num27 += (float) WorldGen.genRand.Next(-1, 2); - if ((double) num27 < (double) vector2_1.Y) - num27 = vector2_1.Y; - if ((double) num27 > (double) vector2_1.Y + 2.0) - num27 = vector2_1.Y + 2f; - for (int j3 = num24; j3 < num25; ++j3) - { - if ((double) j3 > (double) num27) - { - double num28 = (double) Math.Abs((float) i3 - vector2_1.X); - float num29 = Math.Abs((float) j3 - vector2_1.Y) * 3f; - if (Math.Sqrt(num28 * num28 + (double) num29 * (double) num29) < num26 * 0.4 && Main.tile[i3, j3].type == (ushort) 189) - { - Main.tile[i3, j3].type = (ushort) 53; - WorldGen.SquareTileFrame(i3, j3); - } - } - } - } - vector2_1 += vector2_2; - vector2_2.X += (float) WorldGen.genRand.Next(-20, 21) * 0.05f; - if ((double) vector2_2.X > 1.0) - vector2_2.X = 1f; - if ((double) vector2_2.X < -1.0) - vector2_2.X = -1f; - if ((double) vector2_2.Y > 0.2) - vector2_2.Y = -0.2f; - if ((double) vector2_2.Y < -0.2) - vector2_2.Y = -0.2f; - } - int index3 = num4 + WorldGen.genRand.Next(5); - while (index3 < num5) - { - int index4 = num7; - while ((!Main.tile[index3, index4].active() || Main.tile[index3, index4].type != (ushort) 0) && index3 < num5) - { - --index4; - if (index4 < num6) - { - index4 = num7; - index3 += WorldGen.genRand.Next(1, 4); - } - } - if (index3 < num5) - { - int num30 = index4 + WorldGen.genRand.Next(0, 4); - int minValue2 = WorldGen.genRand.Next(2, 5); - int num31 = 189; - for (int i4 = index3 - minValue2; i4 <= index3 + minValue2; ++i4) - { - for (int j4 = num30 - minValue2; j4 <= num30 + minValue2; ++j4) - { - if (j4 > num6) - { - double num32 = (double) Math.Abs(i4 - index3); - float num33 = (float) (Math.Abs(j4 - num30) * 2); - if (Math.Sqrt(num32 * num32 + (double) num33 * (double) num33) < (double) minValue2) - { - Main.tile[i4, j4].type = (ushort) num31; - WorldGen.SquareTileFrame(i4, j4); - } - } - } - } - index3 += WorldGen.genRand.Next(minValue2, (int) ((double) minValue2 * 1.5)); - } - } - for (int i5 = num4 - 20; i5 <= num5 + 20; ++i5) - { - for (int j5 = num6 - 20; j5 <= num7 + 20; ++j5) - { - bool flag = true; - for (int index5 = i5 - 1; index5 <= i5 + 1; ++index5) - { - for (int index6 = j5 - 1; index6 <= j5 + 1; ++index6) - { - if (!Main.tile[index5, index6].active()) - flag = false; - } - } - if (flag) - { - Main.tile[i5, j5].wall = (ushort) 73; - WorldGen.SquareWallFrame(i5, j5); - } - } - } - for (int index7 = num4; index7 <= num5; ++index7) - { - int index8 = num6 - 10; - while (!Main.tile[index7, index8 + 1].active()) - ++index8; - if (index8 < num7 && Main.tile[index7, index8 + 1].type == (ushort) 189) - { - if (WorldGen.genRand.Next(10) == 0) - { - int num34 = WorldGen.genRand.Next(1, 3); - for (int x = index7 - num34; x <= index7 + num34; ++x) - { - if (Main.tile[x, index8].type == (ushort) 189 && WorldGen.WillWaterPlacedHereStayPut(x, index8)) - { - Main.tile[x, index8].active(false); - Main.tile[x, index8].liquid = byte.MaxValue; - Main.tile[x, index8].lava(false); - WorldGen.SquareTileFrame(index7, index8); - } - if (Main.tile[x, index8 + 1].type == (ushort) 189 && WorldGen.WillWaterPlacedHereStayPut(x, index8 + 1)) - { - Main.tile[x, index8 + 1].active(false); - Main.tile[x, index8 + 1].liquid = byte.MaxValue; - Main.tile[x, index8 + 1].lava(false); - WorldGen.SquareTileFrame(index7, index8 + 1); - } - if (x > index7 - num34 && x < index7 + 2 && Main.tile[x, index8 + 2].type == (ushort) 189 && WorldGen.WillWaterPlacedHereStayPut(x, index8 + 2)) - { - Main.tile[x, index8 + 2].active(false); - Main.tile[x, index8 + 2].liquid = byte.MaxValue; - Main.tile[x, index8 + 2].lava(false); - WorldGen.SquareTileFrame(index7, index8 + 2); - } - } - } - if (WorldGen.genRand.Next(5) == 0 && WorldGen.WillWaterPlacedHereStayPut(index7, index8)) - Main.tile[index7, index8].liquid = byte.MaxValue; - Main.tile[index7, index8].lava(false); - WorldGen.SquareTileFrame(index7, index8); - } - } - int num35 = WorldGen.genRand.Next(4); - for (int index9 = 0; index9 <= num35; ++index9) - { - int num36 = WorldGen.genRand.Next(num4 - 5, num5 + 5); - int num37 = num6 - WorldGen.genRand.Next(20, 40); - int num38 = WorldGen.genRand.Next(4, 8); - int num39 = 189; - if (WorldGen.genRand.Next(2) == 0) - num39 = 196; - for (int i6 = num36 - num38; i6 <= num36 + num38; ++i6) - { - for (int j6 = num37 - num38; j6 <= num37 + num38; ++j6) - { - double num40 = (double) Math.Abs(i6 - num36); - float num41 = (float) (Math.Abs(j6 - num37) * 2); - if (Math.Sqrt(num40 * num40 + (double) num41 * (double) num41) < (double) (num38 + WorldGen.genRand.Next(-1, 2))) - { - Main.tile[i6, j6].active(true); - Main.tile[i6, j6].type = (ushort) num39; - WorldGen.SquareTileFrame(i6, j6); - } - } - } - for (int index10 = num36 - num38 + 2; index10 <= num36 + num38 - 2; ++index10) - { - int index11 = num37 - num38; - while (!Main.tile[index10, index11].active()) - ++index11; - if (WorldGen.WillWaterPlacedHereStayPut(index10, index11)) - { - Main.tile[index10, index11].active(false); - Main.tile[index10, index11].liquid = byte.MaxValue; - WorldGen.SquareTileFrame(index10, index11); - } - } - } - } - public static void CloudIsland(int i, int j) { double num1 = (double) WorldGen.genRand.Next(100, 150); @@ -47475,54 +34525,54 @@ label_218: } if (flag) { - Main.tile[i5, j5].wall = (ushort) 73; + Main.tile[i5, j5].wall = (byte) 73; WorldGen.SquareWallFrame(i5, j5); } } } - for (int index7 = num4; index7 <= num5; ++index7) + for (int i6 = num4; i6 <= num5; ++i6) { - int index8 = num6 - 10; - while (!Main.tile[index7, index8 + 1].active()) - ++index8; - if (index8 < num7 && Main.tile[index7, index8 + 1].type == (ushort) 189) + int j6 = num6 - 10; + while (!Main.tile[i6, j6 + 1].active()) + ++j6; + if (j6 < num7 && Main.tile[i6, j6 + 1].type == (ushort) 189) { if (WorldGen.genRand.Next(10) == 0) { int num34 = WorldGen.genRand.Next(1, 3); - for (int x = index7 - num34; x <= index7 + num34; ++x) + for (int index7 = i6 - num34; index7 <= i6 + num34; ++index7) { - if (Main.tile[x, index8].type == (ushort) 189 && WorldGen.WillWaterPlacedHereStayPut(x, index8)) + if (Main.tile[index7, j6].type == (ushort) 189) { - Main.tile[x, index8].active(false); - Main.tile[x, index8].liquid = byte.MaxValue; - Main.tile[x, index8].lava(false); - WorldGen.SquareTileFrame(index7, index8); + Main.tile[index7, j6].active(false); + Main.tile[index7, j6].liquid = byte.MaxValue; + Main.tile[index7, j6].lava(false); + WorldGen.SquareTileFrame(i6, j6); } - if (Main.tile[x, index8 + 1].type == (ushort) 189 && WorldGen.WillWaterPlacedHereStayPut(x, index8 + 1)) + if (Main.tile[index7, j6 + 1].type == (ushort) 189) { - Main.tile[x, index8 + 1].active(false); - Main.tile[x, index8 + 1].liquid = byte.MaxValue; - Main.tile[x, index8 + 1].lava(false); - WorldGen.SquareTileFrame(index7, index8 + 1); + Main.tile[index7, j6 + 1].active(false); + Main.tile[index7, j6 + 1].liquid = byte.MaxValue; + Main.tile[index7, j6 + 1].lava(false); + WorldGen.SquareTileFrame(i6, j6 + 1); } - if (x > index7 - num34 && x < index7 + 2 && Main.tile[x, index8 + 2].type == (ushort) 189 && WorldGen.WillWaterPlacedHereStayPut(x, index8 + 2)) + if (index7 > i6 - num34 && index7 < i6 + 2 && Main.tile[index7, j6 + 2].type == (ushort) 189) { - Main.tile[x, index8 + 2].active(false); - Main.tile[x, index8 + 2].liquid = byte.MaxValue; - Main.tile[x, index8 + 2].lava(false); - WorldGen.SquareTileFrame(index7, index8 + 2); + Main.tile[index7, j6 + 2].active(false); + Main.tile[index7, j6 + 2].liquid = byte.MaxValue; + Main.tile[index7, j6 + 2].lava(false); + WorldGen.SquareTileFrame(i6, j6 + 2); } } } - if (WorldGen.genRand.Next(5) == 0 && WorldGen.WillWaterPlacedHereStayPut(index7, index8)) - Main.tile[index7, index8].liquid = byte.MaxValue; - Main.tile[index7, index8].lava(false); - WorldGen.SquareTileFrame(index7, index8); + if (WorldGen.genRand.Next(5) == 0) + Main.tile[i6, j6].liquid = byte.MaxValue; + Main.tile[i6, j6].lava(false); + WorldGen.SquareTileFrame(i6, j6); } } int num35 = WorldGen.genRand.Next(4); - for (int index9 = 0; index9 <= num35; ++index9) + for (int index8 = 0; index8 <= num35; ++index8) { int num36 = WorldGen.genRand.Next(num4 - 5, num5 + 5); int num37 = num6 - WorldGen.genRand.Next(20, 40); @@ -47530,37 +34580,32 @@ label_218: int num39 = 189; if (WorldGen.genRand.Next(2) == 0) num39 = 196; - for (int i6 = num36 - num38; i6 <= num36 + num38; ++i6) + for (int i7 = num36 - num38; i7 <= num36 + num38; ++i7) { - for (int j6 = num37 - num38; j6 <= num37 + num38; ++j6) + for (int j7 = num37 - num38; j7 <= num37 + num38; ++j7) { - double num40 = (double) Math.Abs(i6 - num36); - float num41 = (float) (Math.Abs(j6 - num37) * 2); + double num40 = (double) Math.Abs(i7 - num36); + float num41 = (float) (Math.Abs(j7 - num37) * 2); if (Math.Sqrt(num40 * num40 + (double) num41 * (double) num41) < (double) (num38 + WorldGen.genRand.Next(-1, 2))) { - Main.tile[i6, j6].active(true); - Main.tile[i6, j6].type = (ushort) num39; - WorldGen.SquareTileFrame(i6, j6); + Main.tile[i7, j7].active(true); + Main.tile[i7, j7].type = (ushort) num39; + WorldGen.SquareTileFrame(i7, j7); } } } - for (int index10 = num36 - num38 + 2; index10 <= num36 + num38 - 2; ++index10) + for (int i8 = num36 - num38 + 2; i8 <= num36 + num38 - 2; ++i8) { - int index11 = num37 - num38; - while (!Main.tile[index10, index11].active()) - ++index11; - if (WorldGen.WillWaterPlacedHereStayPut(index10, index11)) - { - Main.tile[index10, index11].active(false); - Main.tile[index10, index11].liquid = byte.MaxValue; - WorldGen.SquareTileFrame(index10, index11); - } + int j8 = num37 - num38; + while (!Main.tile[i8, j8].active()) + ++j8; + Main.tile[i8, j8].active(false); + Main.tile[i8, j8].liquid = byte.MaxValue; + WorldGen.SquareTileFrame(i8, j8); } } } - public static bool WillWaterPlacedHereStayPut(int x, int y) => (Main.tile[x, y + 1].active() && Main.tileSolid[(int) Main.tile[x, y + 1].type] && !Main.tileSolidTop[(int) Main.tile[x, y + 1].type] || Main.tile[x, y + 1].liquid == byte.MaxValue) && (Main.tile[x - 1, y].active() && Main.tileSolid[(int) Main.tile[x - 1, y].type] && !Main.tileSolidTop[(int) Main.tile[x - 1, y].type] || Main.tile[x - 1, y].liquid == byte.MaxValue) && (Main.tile[x + 1, y].active() && Main.tileSolid[(int) Main.tile[x + 1, y].type] && !Main.tileSolidTop[(int) Main.tile[x + 1, y].type] || Main.tile[x + 1, y].liquid == byte.MaxValue); - public static void CloudLake(int i, int j) { double num1 = (double) WorldGen.genRand.Next(100, 150); @@ -47694,7 +34739,7 @@ label_218: num25 = Main.maxTilesY; double num26 = num20 * (double) WorldGen.genRand.Next(80, 120) * 0.01; float num27 = vector2_1.Y + 1f; - for (int x = num22; x < num23; ++x) + for (int index3 = num22; index3 < num23; ++index3) { if (WorldGen.genRand.Next(2) == 0) num27 += (float) WorldGen.genRand.Next(-1, 2); @@ -47702,22 +34747,18 @@ label_218: num27 = vector2_1.Y; if ((double) num27 > (double) vector2_1.Y + 2.0) num27 = vector2_1.Y + 2f; - for (int y = num24; y < num25; ++y) + for (int index4 = num24; index4 < num25; ++index4) { - if ((double) y > (double) num27 - 2.0) + if ((double) index4 > (double) num27) { - double num28 = (double) Math.Abs((float) x - vector2_1.X); - float num29 = Math.Abs((float) y - vector2_1.Y) * 3f; - if (Math.Sqrt(num28 * num28 + (double) num29 * (double) num29) < num26 * 0.4 && Main.tile[x, y].type == (ushort) 189) + double num28 = (double) Math.Abs((float) index3 - vector2_1.X); + float num29 = Math.Abs((float) index4 - vector2_1.Y) * 3f; + if (Math.Sqrt(num28 * num28 + (double) num29 * (double) num29) < num26 * 0.4 && Main.tile[index3, index4].type == (ushort) 189) { - Main.tile[x, y].active(false); - if ((double) y > (double) num27 + 1.0) - { - if (WorldGen.WillWaterPlacedHereStayPut(x, y)) - Main.tile[x, y].liquid = byte.MaxValue; - Main.tile[x, y].honey(false); - Main.tile[x, y].lava(false); - } + Main.tile[index3, index4].active(false); + Main.tile[index3, index4].liquid = byte.MaxValue; + Main.tile[index3, index4].honey(false); + Main.tile[index3, index4].lava(false); } } } @@ -47730,69 +34771,69 @@ label_218: vector2_2.X = -1f; if ((double) vector2_2.Y > 0.2) vector2_2.Y = -0.2f; - if ((double) vector2_2.Y < 0.0) - vector2_2.Y = 0.0f; + if ((double) vector2_2.Y < -0.2) + vector2_2.Y = -0.2f; } - for (int index3 = num4 - 20; index3 <= num5 + 20; ++index3) + for (int index5 = num4 - 20; index5 <= num5 + 20; ++index5) { - for (int index4 = num6 - 20; index4 <= num7 + 20; ++index4) + for (int index6 = num6 - 20; index6 <= num7 + 20; ++index6) { bool flag = true; - for (int index5 = index3 - 1; index5 <= index3 + 1; ++index5) + for (int index7 = index5 - 1; index7 <= index5 + 1; ++index7) { - for (int index6 = index4 - 1; index6 <= index4 + 1; ++index6) + for (int index8 = index6 - 1; index8 <= index6 + 1; ++index8) { - if (!Main.tile[index5, index6].active()) + if (!Main.tile[index7, index8].active()) flag = false; } } if (flag) - Main.tile[index3, index4].wall = (ushort) 73; + Main.tile[index5, index6].wall = (byte) 73; } } - for (int index7 = num4; index7 <= num5; ++index7) + for (int i3 = num4; i3 <= num5; ++i3) { - int index8 = num6 - 10; - while (!Main.tile[index7, index8 + 1].active()) - ++index8; - if (index8 < num7 && Main.tile[index7, index8 + 1].type == (ushort) 189) + int j3 = num6 - 10; + while (!Main.tile[i3, j3 + 1].active()) + ++j3; + if (j3 < num7 && Main.tile[i3, j3 + 1].type == (ushort) 189) { if (WorldGen.genRand.Next(10) == 0) { int num30 = WorldGen.genRand.Next(1, 3); - for (int x = index7 - num30; x <= index7 + num30; ++x) + for (int index = i3 - num30; index <= i3 + num30; ++index) { - if (Main.tile[x, index8].type == (ushort) 189 && WorldGen.WillWaterPlacedHereStayPut(x, index8)) + if (Main.tile[index, j3].type == (ushort) 189) { - Main.tile[x, index8].active(false); - Main.tile[x, index8].liquid = byte.MaxValue; - Main.tile[x, index8].lava(false); - WorldGen.SquareTileFrame(index7, index8); + Main.tile[index, j3].active(false); + Main.tile[index, j3].liquid = byte.MaxValue; + Main.tile[index, j3].lava(false); + WorldGen.SquareTileFrame(i3, j3); } - if (Main.tile[x, index8 + 1].type == (ushort) 189 && WorldGen.WillWaterPlacedHereStayPut(x, index8 + 1)) + if (Main.tile[index, j3 + 1].type == (ushort) 189) { - Main.tile[x, index8 + 1].active(false); - Main.tile[x, index8 + 1].liquid = byte.MaxValue; - Main.tile[x, index8 + 1].lava(false); - WorldGen.SquareTileFrame(index7, index8 + 1); + Main.tile[index, j3 + 1].active(false); + Main.tile[index, j3 + 1].liquid = byte.MaxValue; + Main.tile[index, j3 + 1].lava(false); + WorldGen.SquareTileFrame(i3, j3 + 1); } - if (x > index7 - num30 && x < index7 + 2 && Main.tile[x, index8 + 2].type == (ushort) 189 && WorldGen.WillWaterPlacedHereStayPut(x, index8 + 2)) + if (index > i3 - num30 && index < i3 + 2 && Main.tile[index, j3 + 2].type == (ushort) 189) { - Main.tile[x, index8 + 2].active(false); - Main.tile[x, index8 + 2].liquid = byte.MaxValue; - Main.tile[x, index8 + 2].lava(false); - WorldGen.SquareTileFrame(index7, index8 + 2); + Main.tile[index, j3 + 2].active(false); + Main.tile[index, j3 + 2].liquid = byte.MaxValue; + Main.tile[index, j3 + 2].lava(false); + WorldGen.SquareTileFrame(i3, j3 + 2); } } } - if (WorldGen.genRand.Next(5) == 0 && WorldGen.WillWaterPlacedHereStayPut(index7, index8)) - Main.tile[index7, index8].liquid = byte.MaxValue; - Main.tile[index7, index8].lava(false); - WorldGen.SquareTileFrame(index7, index8); + if (WorldGen.genRand.Next(5) == 0) + Main.tile[i3, j3].liquid = byte.MaxValue; + Main.tile[i3, j3].lava(false); + WorldGen.SquareTileFrame(i3, j3); } } int num31 = WorldGen.genRand.Next(1, 4); - for (int index9 = 0; index9 <= num31; ++index9) + for (int index = 0; index <= num31; ++index) { int num32 = WorldGen.genRand.Next(num4 - 5, num5 + 5); int num33 = num6 - WorldGen.genRand.Next(20, 40); @@ -47800,31 +34841,28 @@ label_218: int num35 = 189; if (WorldGen.genRand.Next(4) != 0) num35 = 196; - for (int i3 = num32 - num34; i3 <= num32 + num34; ++i3) + for (int i4 = num32 - num34; i4 <= num32 + num34; ++i4) { - for (int j3 = num33 - num34; j3 <= num33 + num34; ++j3) + for (int j4 = num33 - num34; j4 <= num33 + num34; ++j4) { - double num36 = (double) Math.Abs(i3 - num32); - float num37 = (float) (Math.Abs(j3 - num33) * 2); + double num36 = (double) Math.Abs(i4 - num32); + float num37 = (float) (Math.Abs(j4 - num33) * 2); if (Math.Sqrt(num36 * num36 + (double) num37 * (double) num37) < (double) (num34 + WorldGen.genRand.Next(-1, 2))) { - Main.tile[i3, j3].active(true); - Main.tile[i3, j3].type = (ushort) num35; - WorldGen.SquareTileFrame(i3, j3); + Main.tile[i4, j4].active(true); + Main.tile[i4, j4].type = (ushort) num35; + WorldGen.SquareTileFrame(i4, j4); } } } - for (int index10 = num32 - num34 + 2; index10 <= num32 + num34 - 2; ++index10) + for (int i5 = num32 - num34 + 2; i5 <= num32 + num34 - 2; ++i5) { - int index11 = num33 - num34; - while (!Main.tile[index10, index11].active()) - ++index11; - if (WorldGen.WillWaterPlacedHereStayPut(index10, index11)) - { - Main.tile[index10, index11].active(false); - Main.tile[index10, index11].liquid = byte.MaxValue; - WorldGen.SquareTileFrame(index10, index11); - } + int j5 = num33 - num34; + while (!Main.tile[i5, j5].active()) + ++j5; + Main.tile[i5, j5].active(false); + Main.tile[i5, j5].liquid = byte.MaxValue; + WorldGen.SquareTileFrame(i5, j5); } } } @@ -47904,7 +34942,7 @@ label_218: double num16 = (double) Math.Abs((float) index3 - vector2_1.X); float num17 = Math.Abs((float) index4 - vector2_1.Y) * 2f; if (Math.Sqrt(num16 * num16 + (double) num17 * (double) num17) < num15 * 0.4) - Main.tile[index3, index4].wall = (ushort) 2; + Main.tile[index3, index4].wall = (byte) 2; } } } @@ -48042,7 +35080,7 @@ label_218: return new Vector2(x, y); } - public static void IslandHouse(int i, int j, int islandStyle) + public static void IslandHouse(int i, int j) { byte num1 = 202; byte num2 = 82; @@ -48083,7 +35121,7 @@ label_218: Main.tile[index1, index2].active(true); Main.tile[index1, index2].liquid = (byte) 0; Main.tile[index1, index2].type = (ushort) num1; - Main.tile[index1, index2].wall = (ushort) 0; + Main.tile[index1, index2].wall = (byte) 0; Main.tile[index1, index2].halfBrick(false); Main.tile[index1, index2].slope((byte) 0); } @@ -48105,10 +35143,10 @@ label_218: { for (int index4 = j1; index4 < num12; ++index4) { - if ((index4 != j1 || index3 != num10 && index3 != num11) && Main.tile[index3, index4].wall == (ushort) 0) + if ((index4 != j1 || index3 != num10 && index3 != num11) && Main.tile[index3, index4].wall == (byte) 0) { Main.tile[index3, index4].active(false); - Main.tile[index3, index4].wall = (ushort) num2; + Main.tile[index3, index4].wall = num2; } } } @@ -48127,7 +35165,7 @@ label_218: Main.tile[index5, index6].active(true); Main.tile[index5, index6].liquid = (byte) 0; Main.tile[index5, index6].type = (ushort) num1; - Main.tile[index5, index6].wall = (ushort) 0; + Main.tile[index5, index6].wall = (byte) 0; Main.tile[index5, index6].halfBrick(false); Main.tile[index5, index6].slope((byte) 0); } @@ -48147,27 +35185,7 @@ label_218: contain = 158; break; } - if (WorldGen.getGoodWorldGen) - WorldGen.AddBuriedChest(i, y - 3, contain, Style: 2); - else - WorldGen.AddBuriedChest(i, y - 3, contain, Style: 13); - if (islandStyle > 0) - { - for (int index7 = 0; index7 < 100000; ++index7) - { - int index8 = i + WorldGen.genRand.Next(-50, 51); - int index9 = y + WorldGen.genRand.Next(21); - if ((index7 >= 50000 || Main.tile[index8, index9].type != (ushort) 202) && !Main.tile[index8, index9].active()) - { - WorldGen.Place2xX(index8, index9, (ushort) 207, islandStyle); - if (Main.tile[index8, index9].active()) - { - WorldGen.SwitchFountain(index8, index9); - break; - } - } - } - } + WorldGen.AddBuriedChest(i, y - 3, contain, Style: 13); ++WorldGen.houseCount; int num14 = i - num4 / 2 + 1; int num15 = i + num4 / 2 - 1; @@ -48175,15 +35193,15 @@ label_218: if (num4 > 10) num16 = 2; int num17 = (j1 + num12) / 2 - 1; - for (int index10 = num14 - num16; index10 <= num14 + num16; ++index10) + for (int index7 = num14 - num16; index7 <= num14 + num16; ++index7) { - for (int index11 = num17 - 1; index11 <= num17 + 1; ++index11) - Main.tile[index10, index11].wall = (ushort) 21; + for (int index8 = num17 - 1; index8 <= num17 + 1; ++index8) + Main.tile[index7, index8].wall = (byte) 21; } - for (int index12 = num15 - num16; index12 <= num15 + num16; ++index12) + for (int index9 = num15 - num16; index9 <= num15 + num16; ++index9) { - for (int index13 = num17 - 1; index13 <= num17 + 1; ++index13) - Main.tile[index12, index13].wall = (ushort) 21; + for (int index10 = num17 - 1; index10 <= num17 + 1; ++index10) + Main.tile[index9, index10].wall = (byte) 21; } int i2 = i + (num4 / 2 + 1) * -num3; WorldGen.PlaceTile(i2, num12 - 1, 14, true, style: 7); @@ -48206,22 +35224,6 @@ label_218: j2 = j1 + 1; } WorldGen.PlaceTile(i3, j2, 91, true, style: WorldGen.genRand.Next(7, 10)); - if (islandStyle != 1) - return; - int num18 = WorldGen.genRand.Next(3, 6); - for (int index14 = 0; index14 < 100000; ++index14) - { - int i4 = i + WorldGen.genRand.Next(-50, 51); - int index15 = y + WorldGen.genRand.Next(-10, 21); - if (!Main.tile[i4, index15].active()) - { - WorldGen.GrowPalmTree(i4, index15 + 1); - if (Main.tile[i4, index15].active()) - --num18; - } - if (num18 <= 0) - break; - } } public static void Mountinater(int i, int j) @@ -48309,9 +35311,9 @@ label_218: WorldGen.PlaceTile(i2, j1, 162, true); } - public static void Lakinater(int i, int j, float strengthMultiplier = 1f) + public static void Lakinater(int i, int j) { - double num1 = (double) WorldGen.genRand.Next(25, 50) * (double) strengthMultiplier; + double num1 = (double) WorldGen.genRand.Next(25, 50); double num2 = num1; float num3 = (float) WorldGen.genRand.Next(30, 80); if (WorldGen.genRand.Next(5) == 0) @@ -48373,47 +35375,31 @@ label_218: } } - public static void SonOfLakinater(int i, int j, float strengthMultiplier = 1f) + public static void ShroomPatch(int i, int j) { - bool lava = false; - if (WorldGen.getGoodWorldGen && WorldGen.genRand.Next(3) == 0) - lava = true; - double num1 = (double) WorldGen.genRand.Next(15, 31) * (double) strengthMultiplier; - float num2 = (float) WorldGen.genRand.Next(30, 61); + double num1 = (double) WorldGen.genRand.Next(40, 70); + double num2 = num1; + float num3 = (float) WorldGen.genRand.Next(20, 30); if (WorldGen.genRand.Next(5) == 0) { - num1 *= 1.29999995231628; - num2 *= 1.3f; - } - if (WorldGen.drunkWorldGen) - { - num1 *= 1.29999995231628; - num2 *= 1.3f; + num1 *= 1.5; + double num4 = num2 * 1.5; + num3 *= 1.2f; } Vector2 vector2_1; vector2_1.X = (float) i; - vector2_1.Y = (float) j; - float num3 = WorldGen.genRand.NextFloat() * (1f / 500f); + vector2_1.Y = (float) j - num3 * 0.3f; Vector2 vector2_2; - if (WorldGen.genRand.Next(4) != 0) + vector2_2.X = (float) WorldGen.genRand.Next(-10, 11) * 0.1f; + vector2_2.Y = (float) WorldGen.genRand.Next(-20, -10) * 0.1f; + while (num1 > 0.0 && (double) num3 > 0.0) { - vector2_2.X = (float) WorldGen.genRand.Next(-15, 16) * 0.01f; - } - else - { - vector2_2.X = (float) WorldGen.genRand.Next(-50, 51) * 0.01f; - num3 = (float) ((double) WorldGen.genRand.NextFloat() * 0.00400000018998981 + 1.0 / 1000.0); - } - vector2_2.Y = (float) WorldGen.genRand.Next(101) * 0.01f; - float num4 = num2; - while (num1 > 3.0 && (double) num2 > 0.0) - { - num1 -= (double) WorldGen.genRand.Next(11) * 0.100000001490116; - --num2; - int num5 = (int) ((double) vector2_1.X - num1 * 4.0); - int num6 = (int) ((double) vector2_1.X + num1 * 4.0); - int num7 = (int) ((double) vector2_1.Y - num1 * 3.0); - int num8 = (int) ((double) vector2_1.Y + num1 * 2.0); + num1 -= (double) WorldGen.genRand.Next(3); + --num3; + int num5 = (int) ((double) vector2_1.X - num1 * 0.5); + int num6 = (int) ((double) vector2_1.X + num1 * 0.5); + int num7 = (int) ((double) vector2_1.Y - num1 * 0.5); + int num8 = (int) ((double) vector2_1.Y + num1 * 0.5); if (num5 < 0) num5 = 0; if (num6 > Main.maxTilesX) @@ -48422,170 +35408,52 @@ label_218: num7 = 0; if (num8 > Main.maxTilesY) num8 = Main.maxTilesY; - double num9 = num1; + double num9 = num1 * (double) WorldGen.genRand.Next(80, 120) * 0.01; for (int index1 = num5; index1 < num6; ++index1) { for (int index2 = num7; index2 < num8; ++index2) { - float num10 = Math.Abs((float) index1 - vector2_1.X) * 0.6f; - float num11 = Math.Abs((float) index2 - vector2_1.Y) * 1.4f; - float num12 = Math.Abs((float) index1 - vector2_1.X) * 0.3f; - float num13 = Math.Abs((float) index2 - vector2_1.Y) * 5f; - float num14 = MathHelper.Lerp(num10, num12, num2 / num4); - float num15 = MathHelper.Lerp(num11, num13, num2 / num4); - double num16 = Math.Sqrt((double) num14 * (double) num14 + (double) num15 * (double) num15); - int num17 = j + 5; - if (num16 < num9 * 0.4) + double num10 = (double) Math.Abs((float) index1 - vector2_1.X); + float num11 = Math.Abs((float) (((double) index2 - (double) vector2_1.Y) * 2.29999995231628)); + if (Math.Sqrt(num10 * num10 + (double) num11 * (double) num11) < num9 * 0.4) { - if (index2 >= j) + if ((double) index2 < (double) vector2_1.Y + num9 * 0.02) { - if (index2 <= j + 1) - { - if (WorldGen.WillWaterPlacedHereStayPut(index1, index2)) - { - Main.tile[index1, index2].liquid = byte.MaxValue; - Main.tile[index1, index2].lava(lava); - } - } - else - { - Main.tile[index1, index2].liquid = byte.MaxValue; - Main.tile[index1, index2].lava(lava); - } + if (Main.tile[index1, index2].type != (ushort) 59) + Main.tile[index1, index2].active(false); } - Main.tile[index1, index2].active(false); - if (!WorldGen.gen) - WorldGen.SquareTileFrame(index1, index2); - if (Main.tile[index1, index2].type == (ushort) 59 || Main.tile[index1, index2].type == (ushort) 60) - { - WorldGen.SpreadGrass(index1 - 1, index2, 59, 60); - WorldGen.SpreadGrass(index1 + 1, index2, 59, 60); - WorldGen.SpreadGrass(index1, index2 + 1, 59, 60); - } - } - else if (index2 > j + 1 && num16 < num9 && Main.tile[index1, index2].liquid == (byte) 0) - { - if ((double) Math.Abs((float) index1 - vector2_1.X) * 0.8 < num9 && Main.tile[index1, index2].wall > (ushort) 0 && Main.tile[index1 - 1, index2].wall > (ushort) 0 && Main.tile[index1 + 1, index2].wall > (ushort) 0 && Main.tile[index1, index2 + 1].wall > (ushort) 0) - Main.tile[index1, index2].active(true); - } - else if (index2 < j && (double) num2 == (double) num4 - 1.0 && (double) index2 > WorldGen.worldSurfaceLow - 20.0 && !TileID.Sets.Clouds[(int) Main.tile[index1, index2].type]) - { - float num18 = (float) Math.Abs(index1 - i) * 0.7f; - float num19 = (float) Math.Abs(index2 - num17) * 1.35f; - Math.Sqrt((double) num18 * (double) num18 + (double) num19 * (double) num19); - float num20 = (float) num9 * 0.4f; - float num21 = (1f - (float) Math.Abs(index1 - i) / (float) (num6 - i)) * 2.3f; - float num22 = num21 * num21; - float num23 = num22 * num22; - if (index2 < num17 && (double) num18 < (double) num20 + (double) Math.Abs(index2 - num17) * 0.5 * (double) num23) - { - Main.tile[index1, index2].active(false); - if (Main.tile[index1, index2].type == (ushort) 59 || Main.tile[index1, index2].type == (ushort) 60) - { - WorldGen.SpreadGrass(index1 - 1, index2, 59, 60); - WorldGen.SpreadGrass(index1 + 1, index2, 59, 60); - WorldGen.SpreadGrass(index1, index2 + 1, 59, 60); - } - } - } - } - } - vector2_1 += vector2_2; - vector2_2.X += (float) WorldGen.genRand.Next(-100, 101) * num3; - vector2_2.Y += (float) WorldGen.genRand.Next(-100, 101) * 0.01f; - if ((double) vector2_2.X > 1.0) - vector2_2.X = 1f; - if ((double) vector2_2.X < -1.0) - vector2_2.X = -1f; - if ((double) vector2_2.Y > 1.0) - vector2_2.Y = 1f; - float num24 = (float) (0.5 * (1.0 - (double) num2 / (double) num4)); - if ((double) vector2_2.Y < (double) num24) - vector2_2.Y = num24; - } - } - - public static void ShroomPatch(int i, int j) - { - double num1 = (double) WorldGen.genRand.Next(80, 100); - float num2 = (float) WorldGen.genRand.Next(20, 26); - float num3 = (float) (Main.maxTilesX / 4200); - if (WorldGen.getGoodWorldGen) - num3 *= 2f; - double num4 = num1 * (double) num3; - float num5 = num2 * num3; - float num6 = num5 - 1f; - Vector2 vector2_1; - vector2_1.X = (float) i; - vector2_1.Y = (float) j - num5 * 0.3f; - Vector2 vector2_2; - vector2_2.X = (float) WorldGen.genRand.Next(-100, 101) * 0.005f; - vector2_2.Y = (float) WorldGen.genRand.Next(-200, -100) * 0.005f; - while (num4 > 0.0 && (double) num5 > 0.0) - { - num4 -= (double) WorldGen.genRand.Next(3); - --num5; - int num7 = (int) ((double) vector2_1.X - num4 * 0.5); - int num8 = (int) ((double) vector2_1.X + num4 * 0.5); - int num9 = (int) ((double) vector2_1.Y - num4 * 0.5); - int num10 = (int) ((double) vector2_1.Y + num4 * 0.5); - if (num7 < 0) - num7 = 0; - if (num8 > Main.maxTilesX) - num8 = Main.maxTilesX; - if (num9 < 0) - num9 = 0; - if (num10 > Main.maxTilesY) - num10 = Main.maxTilesY; - double num11 = num4 * (double) WorldGen.genRand.Next(80, 120) * 0.01; - for (int index1 = num7; index1 < num8; ++index1) - { - for (int index2 = num9; index2 < num10; ++index2) - { - double num12 = (double) Math.Abs((float) index1 - vector2_1.X); - float num13 = Math.Abs((float) (((double) index2 - (double) vector2_1.Y) * 2.29999995231628)); - double num14 = Math.Sqrt(num12 * num12 + (double) num13 * (double) num13); - if (num14 < num11 * 0.8 && Main.tile[index1, index2].lava()) + else + Main.tile[index1, index2].type = (ushort) 59; Main.tile[index1, index2].liquid = (byte) 0; - if (num14 < num11 * 0.2 && (double) index2 < (double) vector2_1.Y) - { - Main.tile[index1, index2].active(false); - if (Main.tile[index1, index2].wall > (ushort) 0) - Main.tile[index1, index2].wall = (ushort) 80; - } - else if (num14 < num11 * 0.4 * (0.95 + (double) WorldGen.genRand.NextFloat() * 0.1)) - { - Main.tile[index1, index2].type = (ushort) 59; - if ((double) num5 == (double) num6 && (double) index2 > (double) vector2_1.Y) - Main.tile[index1, index2].active(true); - if (Main.tile[index1, index2].wall > (ushort) 0) - Main.tile[index1, index2].wall = (ushort) 80; + Main.tile[index1, index2].lava(false); } } } vector2_1 += vector2_2; vector2_1.X += vector2_2.X; - vector2_2.X += (float) WorldGen.genRand.Next(-100, 110) * 0.005f; - vector2_2.Y -= (float) WorldGen.genRand.Next(110) * 0.005f; + vector2_2.X += (float) WorldGen.genRand.Next(-10, 11) * 0.05f; + vector2_2.Y -= (float) WorldGen.genRand.Next(11) * 0.05f; if ((double) vector2_2.X > -0.5 && (double) vector2_2.X < 0.5) vector2_2.X = (double) vector2_2.X >= 0.0 ? 0.5f : -0.5f; - if ((double) vector2_2.X > 0.5) - vector2_2.X = 0.5f; - if ((double) vector2_2.X < -0.5) - vector2_2.X = -0.5f; - if ((double) vector2_2.Y > 0.5) - vector2_2.Y = 0.5f; - if ((double) vector2_2.Y < -0.5) - vector2_2.Y = -0.5f; + if ((double) vector2_2.X > 2.0) + vector2_2.X = 1f; + if ((double) vector2_2.X < -2.0) + vector2_2.X = -1f; + if ((double) vector2_2.Y > 1.0) + vector2_2.Y = 1f; + if ((double) vector2_2.Y < -1.0) + vector2_2.Y = -1f; for (int index = 0; index < 2; ++index) { int i1 = (int) vector2_1.X + WorldGen.genRand.Next(-20, 20); int j1; for (j1 = (int) vector2_1.Y + WorldGen.genRand.Next(0, 20); !Main.tile[i1, j1].active() && Main.tile[i1, j1].type != (ushort) 59; j1 = (int) vector2_1.Y + WorldGen.genRand.Next(0, 20)) i1 = (int) vector2_1.X + WorldGen.genRand.Next(-20, 20); - int num15 = WorldGen.genRand.Next(10, 20); - int steps = WorldGen.genRand.Next(10, 20); - WorldGen.TileRunner(i1, j1, (double) num15, steps, 59, speedY: 2f, noYChange: true); + int num12 = WorldGen.genRand.Next(7, 10); + int steps = WorldGen.genRand.Next(7, 10); + WorldGen.TileRunner(i1, j1, (double) num12, steps, 59, speedY: 2f, noYChange: true); + if (WorldGen.genRand.Next(3) == 0) + WorldGen.TileRunner(i1, j1, (double) (num12 - 3), steps - 3, -1, speedY: 2f, noYChange: true); } } } @@ -48625,7 +35493,7 @@ label_218: { double num9 = (double) Math.Abs((float) index1 - vector2_1.X); float num10 = Math.Abs((float) index2 - vector2_1.Y); - if (Math.Sqrt(num9 * num9 + (double) num10 * (double) num10) < num8 * 0.4 && TileID.Sets.CanBeClearedDuringGeneration[(int) Main.tile[index1, index2].type] && Main.tile[index1, index2].type != (ushort) 53) + if (Math.Sqrt(num9 * num9 + (double) num10 * (double) num10) < num8 * 0.4 && TileID.Sets.CanBeClearedDuringGeneration[(int) Main.tile[index1, index2].type]) Main.tile[index1, index2].active(false); } } @@ -48652,8 +35520,6 @@ label_218: int num2 = 1; if (WorldGen.genRand.Next(2) == 0) num2 = -1; - if (WorldGen.genRand.Next(10) != 0) - num2 = i >= Main.maxTilesX / 2 ? -1 : 1; Vector2 vector2_1; vector2_1.X = (float) i; vector2_1.Y = (float) j; @@ -48663,8 +35529,7 @@ label_218: vector2_2.X = (float) num2; while (num3 > 0) { - Tile tile = Main.tile[(int) vector2_1.X, (int) vector2_1.Y]; - if (tile.wall == (ushort) 0 || tile.active() && !TileID.Sets.CanBeClearedDuringGeneration[(int) tile.type]) + if (Main.tile[(int) vector2_1.X, (int) vector2_1.Y].wall == (byte) 0) num3 = 0; --num3; int num4 = (int) ((double) vector2_1.X - num1 * 0.5); @@ -48686,7 +35551,7 @@ label_218: { double num9 = (double) Math.Abs((float) index1 - vector2_1.X); float num10 = Math.Abs((float) index2 - vector2_1.Y); - if (Math.Sqrt(num9 * num9 + (double) num10 * (double) num10) < num8 * 0.4 && TileID.Sets.CanBeClearedDuringGeneration[(int) Main.tile[index1, index2].type]) + if (Math.Sqrt(num9 * num9 + (double) num10 * (double) num10) < num8 * 0.4) Main.tile[index1, index2].active(false); } } @@ -48814,7 +35679,6 @@ label_218: public static void WaterCheck() { - Liquid.tilesIgnoreWater(true); Liquid.numLiquid = 0; LiquidBuffer.numLiquidBuffer = 0; for (int index1 = 1; index1 < Main.maxTilesX - 1; ++index1) @@ -48865,7 +35729,6 @@ label_218: } } } - Liquid.tilesIgnoreWater(false); } public static void EveryTileFrame() @@ -48882,7 +35745,7 @@ label_218: { if (Main.tile[i, j].active()) WorldGen.TileFrame(i, j, true); - if (Main.tile[i, j].wall > (ushort) 0) + if (Main.tile[i, j].wall > (byte) 0) Framing.WallFrame(i, j, true); } } @@ -48891,103 +35754,92 @@ label_218: long elapsedMilliseconds = stopwatch.ElapsedMilliseconds; } - public static void PlantCheck(int x, int y) + public static void PlantCheck(int i, int j) { - x = Utils.Clamp(x, 1, Main.maxTilesX - 2); - y = Utils.Clamp(y, 1, Main.maxTilesY - 2); - for (int index1 = x - 1; index1 <= x + 1; ++index1) - { - for (int index2 = y - 1; index2 <= y + 1; ++index2) - { - if (Main.tile[index1, index2] == null) - return; - } - } int num1 = -1; - int num2 = (int) Main.tile[x, y].type; - int num3 = x - 1; - int num4 = x + 1; + int num2 = (int) Main.tile[i, j].type; + int num3 = i - 1; + int num4 = i + 1; int maxTilesX = Main.maxTilesX; - int num5 = y - 1; - if (y + 1 >= Main.maxTilesY) + int num5 = j - 1; + if (j + 1 >= Main.maxTilesY) num1 = num2; - if (x - 1 >= 0 && Main.tile[x - 1, y] != null && Main.tile[x - 1, y].nactive()) + if (i - 1 >= 0 && Main.tile[i - 1, j] != null && Main.tile[i - 1, j].nactive()) { - int type1 = (int) Main.tile[x - 1, y].type; + int type1 = (int) Main.tile[i - 1, j].type; } - if (x + 1 < Main.maxTilesX && Main.tile[x + 1, y] != null && Main.tile[x + 1, y].nactive()) + if (i + 1 < Main.maxTilesX && Main.tile[i + 1, j] != null && Main.tile[i + 1, j].nactive()) { - int type2 = (int) Main.tile[x + 1, y].type; + int type2 = (int) Main.tile[i + 1, j].type; } - if (y - 1 >= 0 && Main.tile[x, y - 1] != null && Main.tile[x, y - 1].nactive()) + if (j - 1 >= 0 && Main.tile[i, j - 1] != null && Main.tile[i, j - 1].nactive()) { - int type3 = (int) Main.tile[x, y - 1].type; + int type3 = (int) Main.tile[i, j - 1].type; } - if (y + 1 < Main.maxTilesY && Main.tile[x, y + 1] != null && Main.tile[x, y + 1].nactive() && !Main.tile[x, y + 1].halfBrick() && Main.tile[x, y + 1].slope() == (byte) 0) - num1 = (int) Main.tile[x, y + 1].type; - if (x - 1 >= 0 && y - 1 >= 0 && Main.tile[x - 1, y - 1] != null && Main.tile[x - 1, y - 1].nactive()) + if (j + 1 < Main.maxTilesY && Main.tile[i, j + 1] != null && Main.tile[i, j + 1].nactive() && !Main.tile[i, j + 1].halfBrick() && Main.tile[i, j + 1].slope() == (byte) 0) + num1 = (int) Main.tile[i, j + 1].type; + if (i - 1 >= 0 && j - 1 >= 0 && Main.tile[i - 1, j - 1] != null && Main.tile[i - 1, j - 1].nactive()) { - int type4 = (int) Main.tile[x - 1, y - 1].type; + int type4 = (int) Main.tile[i - 1, j - 1].type; } - if (x + 1 < Main.maxTilesX && y - 1 >= 0 && Main.tile[x + 1, y - 1] != null && Main.tile[x + 1, y - 1].nactive()) + if (i + 1 < Main.maxTilesX && j - 1 >= 0 && Main.tile[i + 1, j - 1] != null && Main.tile[i + 1, j - 1].nactive()) { - int type5 = (int) Main.tile[x + 1, y - 1].type; + int type5 = (int) Main.tile[i + 1, j - 1].type; } - if (x - 1 >= 0 && y + 1 < Main.maxTilesY && Main.tile[x - 1, y + 1] != null && Main.tile[x - 1, y + 1].nactive()) + if (i - 1 >= 0 && j + 1 < Main.maxTilesY && Main.tile[i - 1, j + 1] != null && Main.tile[i - 1, j + 1].nactive()) { - int type6 = (int) Main.tile[x - 1, y + 1].type; + int type6 = (int) Main.tile[i - 1, j + 1].type; } - if (x + 1 < Main.maxTilesX && y + 1 < Main.maxTilesY && Main.tile[x + 1, y + 1] != null && Main.tile[x + 1, y + 1].nactive()) + if (i + 1 < Main.maxTilesX && j + 1 < Main.maxTilesY && Main.tile[i + 1, j + 1] != null && Main.tile[i + 1, j + 1].nactive()) { - int type7 = (int) Main.tile[x + 1, y + 1].type; + int type7 = (int) Main.tile[i + 1, j + 1].type; } - if ((num2 != 3 || num1 == 2 || num1 == 477 || num1 == 78 || num1 == 380 || num1 == 579) && (num2 != 73 || num1 == 2 || num1 == 477 || num1 == 78 || num1 == 380 || num1 == 579) && (num2 != 24 || num1 == 23) && (num2 != 61 || num1 == 60) && (num2 != 74 || num1 == 60) && (num2 != 71 || num1 == 70) && (num2 != 110 || num1 == 109 || num1 == 492) && (num2 != 113 || num1 == 109 || num1 == 492) && (num2 != 201 || num1 == 199)) + if ((num2 != 3 || num1 == 2 || num1 == 78 || num1 == 380) && (num2 != 24 || num1 == 23) && (num2 != 61 || num1 == 60) && (num2 != 71 || num1 == 70) && (num2 != 73 || num1 == 2 || num1 == 78 || num1 == 380) && (num2 != 74 || num1 == 60) && (num2 != 110 || num1 == 109) && (num2 != 113 || num1 == 109) && (num2 != 201 || num1 == 199)) return; - if ((num2 == 3 || num2 == 73) && num1 != 2 && num1 != 477 && Main.tile[x, y].frameX >= (short) 162) - Main.tile[x, y].frameX = (short) 126; - if (num2 == 74 && num1 != 60 && Main.tile[x, y].frameX >= (short) 162) - Main.tile[x, y].frameX = (short) 126; - if (num1 == 23) + if ((num2 == 3 || num2 == 73) && num1 != 2 && Main.tile[i, j].frameX >= (short) 162) + Main.tile[i, j].frameX = (short) 126; + if (num2 == 74 && num1 != 60 && Main.tile[i, j].frameX >= (short) 162) + Main.tile[i, j].frameX = (short) 126; + switch (num1) { - num2 = 24; - if (Main.tile[x, y].frameX >= (short) 162) - Main.tile[x, y].frameX = (short) 126; - } - else if (num1 == 2 || num1 == 477) - num2 = num2 != 113 ? 3 : 73; - else if (num1 == 109 || num1 == 492) - { - num2 = num2 != 73 ? 110 : 113; - } - else - { - switch (num1) - { - case 70: - num2 = 71; - while (Main.tile[x, y].frameX > (short) 72) - Main.tile[x, y].frameX -= (short) 72; + case 2: + num2 = num2 != 113 ? 3 : 73; + break; + case 23: + num2 = 24; + if (Main.tile[i, j].frameX >= (short) 162) + { + Main.tile[i, j].frameX = (short) 126; break; - case 199: - num2 = 201; - break; - } + } + break; + case 70: + num2 = 71; + while (Main.tile[i, j].frameX > (short) 72) + Main.tile[i, j].frameX -= (short) 72; + break; + case 109: + num2 = num2 != 73 ? 110 : 113; + break; + case 199: + num2 = 201; + break; } - if (num2 != (int) Main.tile[x, y].type) - Main.tile[x, y].type = (ushort) num2; + if (num2 != (int) Main.tile[i, j].type) + Main.tile[i, j].type = (ushort) num2; else - WorldGen.KillTile(x, y); + WorldGen.KillTile(i, j); } - public static bool CanPoundTile(int x, int y) + public static bool CheckPound(int i, int j) { - if (Main.tile[x, y] == null) - Main.tile[x, y] = new Tile(); - if (Main.tile[x, y - 1] == null) - Main.tile[x, y - 1] = new Tile(); - if (Main.tile[x, y + 1] == null) - Main.tile[x, y + 1] = new Tile(); - switch (Main.tile[x, y].type) + if (Main.tile[i, j] == null) + Main.tile[i, j] = new Tile(); + if (Main.tile[i, j - 1] == null) + Main.tile[i, j - 1] = new Tile(); + if (Main.tile[i, j + 1] == null) + Main.tile[i, j + 1] = new Tile(); + switch (Main.tile[i, j].type) { case 10: case 48: @@ -48997,47 +35849,43 @@ label_218: case 380: case 387: case 388: - case 476: - case 484: return false; default: - if (WorldGen.gen && (Main.tile[x, y].type == (ushort) 190 || Main.tile[x, y].type == (ushort) 30)) + if (WorldGen.gen && (Main.tile[i, j].type == (ushort) 190 || Main.tile[i, j].type == (ushort) 30)) return false; - if (Main.tile[x, y - 1].active()) + if (Main.tile[i, j - 1].active()) { - switch (Main.tile[x, y - 1].type) + switch (Main.tile[i, j - 1].type) { + case 5: case 21: case 26: + case 72: case 77: case 88: case 235: case 237: + case 323: case 441: case 467: case 468: - case 470: - case 475: - case 488: - case 597: return false; } } - return WorldGen.CanKillTile(x, y); + return true; } } - public static bool SlopeTile(int i, int j, int slope = 0, bool noEffects = false) + public static bool SlopeTile(int i, int j, int slope = 0) { - if (!WorldGen.CanPoundTile(i, j)) + if (!WorldGen.CheckPound(i, j)) return false; Main.tile[i, j].halfBrick(false); Main.tile[i, j].slope((byte) slope); if (!WorldGen.gen) { - if (!noEffects) - WorldGen.KillTile(i, j, true, true); - SoundEngine.PlaySound(0, i * 16, j * 16); + WorldGen.KillTile(i, j, true, true); + Main.PlaySound(0, i * 16, j * 16); WorldGen.SquareTileFrame(i, j); if (Main.tile[i, j].slope() == (byte) 0) { @@ -49057,7 +35905,7 @@ label_218: public static bool PoundTile(int i, int j) { - if (!WorldGen.CanPoundTile(i, j)) + if (!WorldGen.CheckPound(i, j)) return false; if (!Main.tile[i, j].halfBrick()) Main.tile[i, j].halfBrick(true); @@ -49066,7 +35914,7 @@ label_218: if (!WorldGen.gen) { WorldGen.KillTile(i, j, true, true); - SoundEngine.PlaySound(0, i * 16, j * 16); + Main.PlaySound(0, i * 16, j * 16); WorldGen.SquareTileFrame(i, j); if (!Main.tile[i, j].halfBrick()) { @@ -49430,66 +36278,6 @@ label_218: downRight = changeTo; } - public static int GetTileMossColor(int tileType) - { - switch (tileType) - { - case 179: - case 512: - return 0; - case 180: - case 513: - return 1; - case 181: - case 514: - return 2; - case 182: - case 515: - return 3; - case 183: - case 516: - return 4; - case 381: - case 517: - return 5; - case 534: - case 535: - return 6; - case 536: - case 537: - return 7; - case 539: - case 540: - return 8; - default: - return -1; - } - } - - public static void CheckFoodPlatter(int x, int y, int type) - { - if (Main.tile[x, y] == null || WorldGen.destroyObject || WorldGen.SolidTileAllowBottomSlope(x, y + 1)) - return; - if (type == 520) - { - int key = TEFoodPlatter.Find(x, y); - if (key != -1 && ((TEFoodPlatter) TileEntity.ByID[key]).item.stack > 0) - { - ((TEFoodPlatter) TileEntity.ByID[key]).DropItem(); - if (Main.netMode != 2) - Main.LocalPlayer.InterruptItemUsageIfOverTile(520); - } - } - WorldGen.destroyObject = true; - if ((int) Main.tile[x, y].type == type) - WorldGen.KillTile(x, y); - if (type == 520) - TEFoodPlatter.Kill(x, y); - WorldGen.destroyObject = false; - } - - public static bool SkipFramingBecauseOfGen => WorldGen.generatingWorld && WorldGen.skipFramingDuringGen; - public static void TileFrame(int i, int j, bool resetFrame = false, bool noBreak = false) { bool addToList = false; @@ -49505,143 +36293,270 @@ label_218: { if (Main.tile[i, j] != null) { - if (WorldGen.SkipFramingBecauseOfGen && !Main.tileFrameImportant[(int) Main.tile[i, j].type]) - return; addToList = WorldGen.UpdateMapTile(i, j); - Tile tile1 = Main.tile[i, j]; - if (!tile1.active()) + Tile centerTile = Main.tile[i, j]; + if (!centerTile.active()) { - tile1.halfBrick(false); - tile1.color((byte) 0); - tile1.slope((byte) 0); + centerTile.halfBrick(false); + centerTile.color((byte) 0); + centerTile.slope((byte) 0); } - if (tile1.liquid > (byte) 0 && Main.netMode != 1 && !WorldGen.noLiquidCheck) + if (centerTile.liquid > (byte) 0 && Main.netMode != 1 && !WorldGen.noLiquidCheck) Liquid.AddWater(i, j); - if (tile1.active()) + if (centerTile.active()) { - if (noBreak && Main.tileFrameImportant[(int) tile1.type] && tile1.type != (ushort) 4) + if (noBreak && Main.tileFrameImportant[(int) centerTile.type] && centerTile.type != (ushort) 4) return; - int index1 = (int) tile1.type; + int index1 = (int) centerTile.type; if (Main.tileStone[index1]) index1 = 1; - int frameX = (int) tile1.frameX; - int frameY = (int) tile1.frameY; + int frameX1 = (int) centerTile.frameX; + int frameY1 = (int) centerTile.frameY; Microsoft.Xna.Framework.Rectangle rectangle = new Microsoft.Xna.Framework.Rectangle(-1, -1, 0, 0); - if (Main.tileFrameImportant[(int) tile1.type]) + if (Main.tileFrameImportant[(int) centerTile.type]) { switch (index1) { case 4: - WorldGen.CheckTorch(i, j); + Tile tile1 = Main.tile[i, j - 1]; + Tile tile2 = Main.tile[i, j + 1]; + Tile tile3 = Main.tile[i - 1, j]; + Tile tile4 = Main.tile[i + 1, j]; + Tile tile5 = Main.tile[i - 1, j + 1]; + Tile tile6 = Main.tile[i + 1, j + 1]; + Tile tile7 = Main.tile[i - 1, j - 1]; + Tile tile8 = Main.tile[i + 1, j - 1]; + short num1 = 0; + if (centerTile.frameX >= (short) 66) + num1 = (short) 66; + int index2 = -1; + int index3 = -1; + int index4 = -1; + int num2 = -1; + int num3 = -1; + int num4 = -1; + int num5 = -1; + if (tile1 != null && tile1.active() && !tile1.bottomSlope()) + { + int type1 = (int) tile1.type; + } + if (tile2 != null && tile2.active() && !tile2.halfBrick() && !tile2.topSlope()) + index2 = (int) tile2.type; + if (tile3 != null && tile3.active() && (tile3.slope() == (byte) 0 || (int) tile3.slope() % 2 != 1)) + index3 = (int) tile3.type; + if (tile4 != null && tile4.active() && (tile4.slope() == (byte) 0 || (int) tile4.slope() % 2 != 0)) + index4 = (int) tile4.type; + if (tile5 != null && tile5.active()) + num2 = (int) tile5.type; + if (tile6 != null && tile6.active()) + num3 = (int) tile6.type; + if (tile7 != null && tile7.active()) + num4 = (int) tile7.type; + if (tile8 != null && tile8.active()) + num5 = (int) tile8.type; + if (index2 >= 0 && Main.tileSolid[index2] && (!Main.tileNoAttach[index2] || TileID.Sets.Platforms[index2])) + { + centerTile.frameX = num1; + return; + } + if (index3 >= 0 && Main.tileSolid[index3] && !Main.tileNoAttach[index3] || index3 == 124 || index3 == 5 && num4 == 5 && num2 == 5) + { + centerTile.frameX = (short) (22 + (int) num1); + return; + } + if (index4 >= 0 && Main.tileSolid[index4] && !Main.tileNoAttach[index4] || index4 == 124 || index4 == 5 && num5 == 5 && num3 == 5) + { + centerTile.frameX = (short) (44 + (int) num1); + return; + } + if (centerTile.wall > (byte) 0) + { + centerTile.frameX = num1; + return; + } + WorldGen.KillTile(i, j); return; case 136: - Tile tile2 = Main.tile[i, j - 1]; - Tile tile3 = Main.tile[i, j + 1]; - Tile tile4 = Main.tile[i - 1, j]; - Tile tile5 = Main.tile[i + 1, j]; - Tile tile6 = Main.tile[i - 1, j + 1]; - Tile tile7 = Main.tile[i + 1, j + 1]; - Tile tile8 = Main.tile[i - 1, j - 1]; - Tile tile9 = Main.tile[i + 1, j - 1]; - int index2 = -1; - int tree1 = -1; - int tree2 = -1; - int tree3 = -1; - int tree4 = -1; - int tree5 = -1; - int tree6 = -1; - if (tile2 != null && tile2.nactive()) - { - int type = (int) tile2.type; - } - if (tile3 != null && tile3.nactive() && !tile3.halfBrick() && !tile3.topSlope()) - index2 = (int) tile3.type; - if (tile4 != null && tile4.nactive()) - tree1 = (int) tile4.type; - if (tile5 != null && tile5.nactive()) - tree2 = (int) tile5.type; - if (tile6 != null && tile6.nactive()) - tree3 = (int) tile6.type; - if (tile7 != null && tile7.nactive()) - tree4 = (int) tile7.type; - if (tile8 != null && tile8.nactive()) - tree5 = (int) tile8.type; + Tile tile9 = Main.tile[i, j - 1]; + Tile tile10 = Main.tile[i, j + 1]; + Tile tile11 = Main.tile[i - 1, j]; + Tile tile12 = Main.tile[i + 1, j]; + Tile tile13 = Main.tile[i - 1, j + 1]; + Tile tile14 = Main.tile[i + 1, j + 1]; + Tile tile15 = Main.tile[i - 1, j - 1]; + Tile tile16 = Main.tile[i + 1, j - 1]; + int index5 = -1; + int index6 = -1; + int index7 = -1; + int num6 = -1; + int num7 = -1; + int num8 = -1; + int num9 = -1; if (tile9 != null && tile9.nactive()) - tree6 = (int) tile9.type; - if (index2 >= 0 && Main.tileSolid[index2] && !Main.tileNoAttach[index2] && !tile3.halfBrick() && (tile3.slope() == (byte) 0 || tile3.bottomSlope())) { - tile1.frameX = (short) 0; + int type2 = (int) tile9.type; + } + if (tile10 != null && tile10.nactive() && !tile10.halfBrick() && !tile10.topSlope()) + index5 = (int) tile10.type; + if (tile11 != null && tile11.nactive()) + index6 = (int) tile11.type; + if (tile12 != null && tile12.nactive()) + index7 = (int) tile12.type; + if (tile13 != null && tile13.nactive()) + num6 = (int) tile13.type; + if (tile14 != null && tile14.nactive()) + num7 = (int) tile14.type; + if (tile15 != null && tile15.nactive()) + num8 = (int) tile15.type; + if (tile16 != null && tile16.nactive()) + num9 = (int) tile16.type; + if (index5 >= 0 && Main.tileSolid[index5] && !Main.tileNoAttach[index5] && !tile10.halfBrick() && (tile10.slope() == (byte) 0 || tile10.bottomSlope())) + { + centerTile.frameX = (short) 0; return; } - if (tree1 >= 0 && Main.tileSolid[tree1] && !Main.tileNoAttach[tree1] && (tile4.leftSlope() || tile4.slope() == (byte) 0) && !tile4.halfBrick() || tree1 >= 0 && TileID.Sets.IsBeam[tree1] || WorldGen.IsTreeType(tree1) && WorldGen.IsTreeType(tree5) && WorldGen.IsTreeType(tree3)) + if (index6 >= 0 && Main.tileSolid[index6] && !Main.tileNoAttach[index6] && (tile11.leftSlope() || tile11.slope() == (byte) 0) && !tile11.halfBrick() || index6 == 124 || index6 == 5 && num8 == 5 && num6 == 5) { - tile1.frameX = (short) 18; + centerTile.frameX = (short) 18; return; } - if (tree2 >= 0 && Main.tileSolid[tree2] && !Main.tileNoAttach[tree2] && (tile5.rightSlope() || tile5.slope() == (byte) 0) && !tile5.halfBrick() || tree2 >= 0 && TileID.Sets.IsBeam[tree2] || WorldGen.IsTreeType(tree2) && WorldGen.IsTreeType(tree6) && WorldGen.IsTreeType(tree4)) + if (index7 >= 0 && Main.tileSolid[index7] && !Main.tileNoAttach[index7] && (tile12.rightSlope() || tile12.slope() == (byte) 0) && !tile12.halfBrick() || index7 == 124 || index7 == 5 && num9 == 5 && num7 == 5) { - tile1.frameX = (short) 36; + centerTile.frameX = (short) 36; return; } - if (tile1.wall > (ushort) 0) + if (centerTile.wall > (byte) 0) { - tile1.frameX = (short) 54; + centerTile.frameX = (short) 54; return; } WorldGen.KillTile(i, j); return; case 442: - WorldGen.CheckProjectilePressurePad(i, j); - return; - case 518: - WorldGen.CheckLilyPad(i, j); - return; - case 519: - WorldGen.CheckCatTail(i, j); - return; - case 549: - WorldGen.CheckUnderwaterPlant((ushort) 549, i, j); - return; - case 571: - WorldGen.CheckBamboo(i, j); + Tile tile17 = Main.tile[i, j - 1]; + Tile tile18 = Main.tile[i, j + 1]; + Tile tile19 = Main.tile[i - 1, j]; + Tile tile20 = Main.tile[i + 1, j]; + Tile tile21 = Main.tile[i - 1, j + 1]; + Tile tile22 = Main.tile[i + 1, j + 1]; + Tile tile23 = Main.tile[i - 1, j - 1]; + Tile tile24 = Main.tile[i + 1, j - 1]; + int index8 = -1; + int index9 = -1; + int index10 = -1; + int index11 = -1; + int num10 = -1; + int num11 = -1; + int num12 = -1; + int num13 = -1; + if (tile17 != null && tile17.nactive() && !tile17.bottomSlope()) + index9 = (int) tile17.type; + if (tile18 != null && tile18.nactive() && !tile18.halfBrick() && !tile18.topSlope()) + index8 = (int) tile18.type; + if (tile19 != null && tile19.nactive() && (tile19.slope() == (byte) 0 || (int) tile19.slope() % 2 != 1)) + index10 = (int) tile19.type; + if (tile20 != null && tile20.nactive() && (tile20.slope() == (byte) 0 || (int) tile20.slope() % 2 != 0)) + index11 = (int) tile20.type; + if (tile21 != null && tile21.nactive()) + num10 = (int) tile21.type; + if (tile22 != null && tile22.nactive()) + num11 = (int) tile22.type; + if (tile23 != null && tile23.nactive()) + num12 = (int) tile23.type; + if (tile24 != null && tile24.nactive()) + num13 = (int) tile24.type; + bool flag1 = false; + bool flag2 = false; + bool flag3 = false; + bool flag4 = false; + if (index8 >= 0 && Main.tileSolid[index8] && (!Main.tileNoAttach[index8] || TileID.Sets.Platforms[index8]) && (tile18.bottomSlope() || tile18.slope() == (byte) 0) && !tile18.halfBrick()) + flag4 = true; + if (index9 >= 0 && Main.tileSolid[index9] && (!Main.tileNoAttach[index9] || TileID.Sets.Platforms[index9] && tile17.halfBrick()) && (tile17.topSlope() || tile17.slope() == (byte) 0 || tile17.halfBrick())) + flag1 = true; + if (index10 >= 0 && Main.tileSolid[index10] && !Main.tileNoAttach[index10] && (tile19.leftSlope() || tile19.slope() == (byte) 0) && !tile19.halfBrick() || index10 == 124 || index10 == 5 && num12 == 5 && num10 == 5) + flag2 = true; + if (index11 >= 0 && Main.tileSolid[index11] && !Main.tileNoAttach[index11] && (tile20.rightSlope() || tile20.slope() == (byte) 0) && !tile20.halfBrick() || index11 == 124 || index11 == 5 && num13 == 5 && num11 == 5) + flag3 = true; + bool flag5; + switch ((int) centerTile.frameX / 22) + { + case 0: + flag5 = !flag4; + break; + case 1: + flag5 = !flag1; + break; + case 2: + flag5 = !flag2; + break; + case 3: + flag5 = !flag3; + break; + default: + flag5 = true; + break; + } + if (!flag5) + return; + if (flag4) + { + centerTile.frameX = (short) 0; + return; + } + if (flag1) + { + centerTile.frameX = (short) 22; + return; + } + if (flag2) + { + centerTile.frameX = (short) 44; + return; + } + if (flag3) + { + centerTile.frameX = (short) 66; + return; + } + WorldGen.KillTile(i, j); return; default: if (index1 == 129 || index1 == 149) { - Tile tile10 = Main.tile[i, j - 1]; - Tile tile11 = Main.tile[i, j + 1]; - Tile tile12 = Main.tile[i - 1, j]; - Tile tile13 = Main.tile[i + 1, j]; - int index3 = -1; - int index4 = -1; - int index5 = -1; - int index6 = -1; - if (tile10 != null && tile10.nactive() && !tile10.bottomSlope()) - index4 = (int) tile10.type; - if (tile11 != null && tile11.nactive() && !tile11.halfBrick() && !tile11.topSlope()) - index3 = (int) tile11.type; - if (tile12 != null && tile12.nactive()) - index5 = (int) tile12.type; - if (tile13 != null && tile13.nactive()) - index6 = (int) tile13.type; - if (index3 >= 0 && Main.tileSolid[index3] && !Main.tileSolidTop[index3]) + Tile tile25 = Main.tile[i, j - 1]; + Tile tile26 = Main.tile[i, j + 1]; + Tile tile27 = Main.tile[i - 1, j]; + Tile tile28 = Main.tile[i + 1, j]; + int index12 = -1; + int index13 = -1; + int index14 = -1; + int index15 = -1; + if (tile25 != null && tile25.nactive() && !tile25.bottomSlope()) + index13 = (int) tile25.type; + if (tile26 != null && tile26.nactive() && !tile26.halfBrick() && !tile26.topSlope()) + index12 = (int) tile26.type; + if (tile27 != null && tile27.nactive()) + index14 = (int) tile27.type; + if (tile28 != null && tile28.nactive()) + index15 = (int) tile28.type; + if (index12 >= 0 && Main.tileSolid[index12] && !Main.tileSolidTop[index12]) { - tile1.frameY = (short) 0; + centerTile.frameY = (short) 0; return; } - if (index5 >= 0 && Main.tileSolid[index5] && !Main.tileSolidTop[index5]) + if (index14 >= 0 && Main.tileSolid[index14] && !Main.tileSolidTop[index14]) { - tile1.frameY = (short) 54; + centerTile.frameY = (short) 54; return; } - if (index6 >= 0 && Main.tileSolid[index6] && !Main.tileSolidTop[index6]) + if (index15 >= 0 && Main.tileSolid[index15] && !Main.tileSolidTop[index15]) { - tile1.frameY = (short) 36; + centerTile.frameY = (short) 36; return; } - if (index4 >= 0 && Main.tileSolid[index4] && !Main.tileSolidTop[index4]) + if (index13 >= 0 && Main.tileSolid[index13] && !Main.tileSolidTop[index13]) { - tile1.frameY = (short) 18; + centerTile.frameY = (short) 18; return; } WorldGen.KillTile(i, j); @@ -49649,8 +36564,8 @@ label_218: } if (index1 >= 373 && index1 <= 375 || index1 == 461) { - Tile tile14 = Main.tile[i, j - 1]; - if (tile14 != null && tile14.active() && !tile14.bottomSlope() && Main.tileSolid[(int) tile14.type] && !Main.tileSolidTop[(int) tile14.type]) + Tile tile29 = Main.tile[i, j - 1]; + if (tile29 != null && tile29.active() && !tile29.bottomSlope() && Main.tileSolid[(int) tile29.type] && !Main.tileSolidTop[(int) tile29.type]) return; WorldGen.KillTile(i, j); return; @@ -49658,120 +36573,105 @@ label_218: switch (index1) { case 178: - Tile tile15 = Main.tile[i, j - 1]; - Tile tile16 = Main.tile[i, j + 1]; - Tile tile17 = Main.tile[i - 1, j]; - Tile tile18 = Main.tile[i + 1, j]; - int index7 = -1; - int index8 = -1; - int index9 = -1; - int index10 = -1; - if (tile15 != null && tile15.nactive() && !tile15.bottomSlope()) - index8 = (int) tile15.type; - if (tile16 != null && tile16.nactive() && !tile16.halfBrick() && !tile16.topSlope()) - index7 = (int) tile16.type; - if (tile17 != null && tile17.nactive() && !tile17.halfBrick() && !tile17.rightSlope()) - index9 = (int) tile17.type; - if (tile18 != null && tile18.nactive() && !tile18.halfBrick() && !tile18.leftSlope()) - index10 = (int) tile18.type; - if (index9 == 10) - index9 = -1; - if (index10 == 10) - index10 = -1; - short num1 = (short) (WorldGen.genRand.Next(3) * 18); - if (index7 >= 0 && Main.tileSolid[index7] && !Main.tileSolidTop[index7]) + Tile tile30 = Main.tile[i, j - 1]; + Tile tile31 = Main.tile[i, j + 1]; + Tile tile32 = Main.tile[i - 1, j]; + Tile tile33 = Main.tile[i + 1, j]; + int index16 = -1; + int index17 = -1; + int index18 = -1; + int index19 = -1; + if (tile30 != null && tile30.active() && !tile30.bottomSlope()) + index17 = (int) tile30.type; + if (tile31 != null && tile31.active() && !tile31.halfBrick() && !tile31.topSlope()) + index16 = (int) tile31.type; + if (tile32 != null && tile32.active()) + index18 = (int) tile32.type; + if (tile33 != null && tile33.active()) + index19 = (int) tile33.type; + short num14 = (short) (WorldGen.genRand.Next(3) * 18); + if (index16 >= 0 && Main.tileSolid[index16] && !Main.tileSolidTop[index16]) { - if (tile1.frameY >= (short) 0 && tile1.frameY <= (short) 36) + if (centerTile.frameY >= (short) 0 && centerTile.frameY <= (short) 36) return; - tile1.frameY = num1; + centerTile.frameY = num14; return; } - if (index9 >= 0 && Main.tileSolid[index9] && !Main.tileSolidTop[index9]) + if (index18 >= 0 && Main.tileSolid[index18] && !Main.tileSolidTop[index18]) { - if (tile1.frameY >= (short) 108 && tile1.frameY <= (short) 54) + if (centerTile.frameY >= (short) 108 && centerTile.frameY <= (short) 54) return; - tile1.frameY = (short) (108 + (int) num1); + centerTile.frameY = (short) (108 + (int) num14); return; } - if (index10 >= 0 && Main.tileSolid[index10] && !Main.tileSolidTop[index10]) + if (index19 >= 0 && Main.tileSolid[index19] && !Main.tileSolidTop[index19]) { - if (tile1.frameY >= (short) 162 && tile1.frameY <= (short) 198) + if (centerTile.frameY >= (short) 162 && centerTile.frameY <= (short) 198) return; - tile1.frameY = (short) (162 + (int) num1); + centerTile.frameY = (short) (162 + (int) num14); return; } - if (index8 >= 0 && Main.tileSolid[index8] && !Main.tileSolidTop[index8]) + if (index17 >= 0 && Main.tileSolid[index17] && !Main.tileSolidTop[index17]) { - if (tile1.frameY >= (short) 54 && tile1.frameY <= (short) 90) + if (centerTile.frameY >= (short) 54 && centerTile.frameY <= (short) 90) return; - tile1.frameY = (short) (54 + (int) num1); + centerTile.frameY = (short) (54 + (int) num14); return; } WorldGen.KillTile(i, j); return; case 184: - Tile tile19 = Main.tile[i, j - 1]; - Tile tile20 = Main.tile[i, j + 1]; - Tile tile21 = Main.tile[i - 1, j]; - Tile tile22 = Main.tile[i + 1, j]; - int tileType1 = -1; - int tileType2 = -1; - int tileType3 = -1; - int tileType4 = -1; - if (tile19 != null && tile19.active() && !tile19.bottomSlope()) - tileType2 = (int) tile19.type; - if (tile20 != null && tile20.active() && !tile20.halfBrick() && !tile20.topSlope()) - tileType1 = (int) tile20.type; - if (tile21 != null && tile21.active()) - tileType3 = (int) tile21.type; - if (tile22 != null && tile22.active()) - tileType4 = (int) tile22.type; - short num2 = (short) (WorldGen.genRand.Next(3) * 18); - if (tileType1 >= 0 && WorldGen.GetTileMossColor(tileType1) != -1) + Tile tile34 = Main.tile[i, j - 1]; + Tile tile35 = Main.tile[i, j + 1]; + Tile tile36 = Main.tile[i - 1, j]; + Tile tile37 = Main.tile[i + 1, j]; + int index20 = -1; + int index21 = -1; + int index22 = -1; + int index23 = -1; + if (tile34 != null && tile34.active() && !tile34.bottomSlope()) + index21 = (int) tile34.type; + if (tile35 != null && tile35.active() && !tile35.halfBrick() && !tile35.topSlope()) + index20 = (int) tile35.type; + if (tile36 != null && tile36.active()) + index22 = (int) tile36.type; + if (tile37 != null && tile37.active()) + index23 = (int) tile37.type; + short num15 = (short) (WorldGen.genRand.Next(3) * 18); + if (index20 >= 0 && Main.tileMoss[index20]) { - tile1.frameX = (short) (22 * WorldGen.GetTileMossColor(tileType1)); - if (tile1.frameY >= (short) 0 && tile1.frameY <= (short) 36) + centerTile.frameX = index20 != 381 ? (short) (22 * (index20 - 179)) : (short) 110; + if (centerTile.frameY >= (short) 0 && centerTile.frameY <= (short) 36) return; - tile1.frameY = num2; + centerTile.frameY = num15; return; } - if (tileType2 >= 0 && WorldGen.GetTileMossColor(tileType2) != -1) + if (index21 >= 0 && Main.tileMoss[index21]) { - tile1.frameX = (short) (22 * WorldGen.GetTileMossColor(tileType2)); - if (tile1.frameY >= (short) 54 && tile1.frameY <= (short) 90) + centerTile.frameX = index21 != 381 ? (short) (22 * (index21 - 179)) : (short) 110; + if (centerTile.frameY >= (short) 54 && centerTile.frameY <= (short) 90) return; - tile1.frameY = (short) (54 + (int) num2); + centerTile.frameY = (short) (54 + (int) num15); return; } - if (tileType3 >= 0 && WorldGen.GetTileMossColor(tileType3) != -1) + if (index22 >= 0 && Main.tileMoss[index22]) { - tile1.frameX = (short) (22 * WorldGen.GetTileMossColor(tileType3)); - if (tile1.frameY >= (short) 108 && tile1.frameY <= (short) 54) + centerTile.frameX = index22 != 381 ? (short) (22 * (index22 - 179)) : (short) 110; + if (centerTile.frameY >= (short) 108 && centerTile.frameY <= (short) 54) return; - tile1.frameY = (short) (108 + (int) num2); + centerTile.frameY = (short) (108 + (int) num15); return; } - if (tileType4 >= 0 && WorldGen.GetTileMossColor(tileType4) != -1) + if (index23 >= 0 && Main.tileMoss[index23]) { - tile1.frameX = (short) (22 * WorldGen.GetTileMossColor(tileType4)); - if (tile1.frameY >= (short) 162 && tile1.frameY <= (short) 198) + centerTile.frameX = index23 != 381 ? (short) (22 * (index23 - 179)) : (short) 110; + if (centerTile.frameY >= (short) 162 && centerTile.frameY <= (short) 198) return; - tile1.frameY = (short) (162 + (int) num2); + centerTile.frameY = (short) (162 + (int) num15); return; } WorldGen.KillTile(i, j); return; - case 529: - if (!WorldGen.SolidTileAllowBottomSlope(i, j + 1)) - { - WorldGen.KillTile(i, j); - return; - } - int num3 = (int) Main.tile[i, j].frameY / 34; - if (TileID.Sets.Conversion.Sand[(int) Main.tile[i, j + 1].type]) - return; - WorldGen.KillTile(i, j); - return; default: if (index1 == 3 || index1 == 24 || index1 == 61 || index1 == 71 || index1 == 73 || index1 == 74 || index1 == 110 || index1 == 113 || index1 == 201) { @@ -49783,11 +36683,6 @@ label_218: WorldGen.CheckDye(i, j); return; } - if (index1 == 579) - { - WorldGen.CheckRockGolemHead(i, j); - return; - } if (index1 == 12 || index1 == 31) { WorldGen.CheckOrb(i, j, index1); @@ -49805,12 +36700,18 @@ label_218: WorldGen.Check3x1(i, j, index1); return; case 324: - if (WorldGen.SolidTileAllowBottomSlope(i, j + 1)) + Tile tile38 = Main.tile[i, j + 1]; + if (tile38 == null) + { + tile38 = new Tile(); + Main.tile[i, j + 1] = tile38; + } + if (tile38.nactive() && (Main.tileSolid[(int) tile38.type] || Main.tileSolidTop[(int) tile38.type])) return; WorldGen.KillTile(i, j); return; default: - if (index1 >= 275 && index1 <= 281 || index1 == 296 || index1 == 297 || index1 == 309 || index1 == 358 || index1 == 359 || index1 == 413 || index1 == 414 || index1 == 542 || index1 == 550 || index1 == 551 || index1 == 553 || index1 == 554 || index1 == 558 || index1 == 559 || index1 == 599 || index1 == 600 || index1 == 601 || index1 == 602 || index1 == 603 || index1 == 604 || index1 == 605 || index1 == 606 || index1 == 607 || index1 == 608 || index1 == 609 || index1 == 610 || index1 == 611 || index1 == 612) + if (index1 >= 275 && index1 <= 281 || index1 == 296 || index1 == 297 || index1 == 309 || index1 == 358 || index1 == 359 || index1 == 413 || index1 == 414) { WorldGen.Check6x3(i, j, index1); return; @@ -49818,83 +36719,206 @@ label_218: switch (index1) { case 10: - WorldGen.CheckDoorClosed(i, j, tile1, index1); + if (WorldGen.destroyObject) + return; + bool flag6 = false; + int frameY2 = (int) centerTile.frameY; + int doorStyle1 = frameY2 / 54 + (int) centerTile.frameX / 54 * 36; + int j1 = j - frameY2 % 54 / 18; + Tile tile39 = Main.tile[i, j1 - 1]; + Tile tile40 = Main.tile[i, j1]; + Tile tile41 = Main.tile[i, j1 + 1]; + Tile tile42 = Main.tile[i, j1 + 2]; + Tile testTile1 = Main.tile[i, j1 + 3]; + if (tile39 == null) + { + tile39 = new Tile(); + Main.tile[i, j1 - 1] = tile39; + } + if (tile40 == null) + { + tile40 = new Tile(); + Main.tile[i, j1] = tile40; + } + if (tile41 == null) + { + tile41 = new Tile(); + Main.tile[i, j1 + 1] = tile41; + } + if (tile42 == null) + { + tile42 = new Tile(); + Main.tile[i, j1 + 2] = tile42; + } + if (testTile1 == null) + { + testTile1 = new Tile(); + Main.tile[i, j1 + 3] = testTile1; + } + if (!tile39.active() || !Main.tileSolid[(int) tile39.type]) + flag6 = true; + if (!WorldGen.SolidTile(testTile1)) + flag6 = true; + if (!tile40.active() || (int) tile40.type != index1) + flag6 = true; + if (!tile41.active() || (int) tile41.type != index1) + flag6 = true; + if (!tile42.active() || (int) tile42.type != index1) + flag6 = true; + if (flag6) + { + WorldGen.destroyObject = true; + WorldGen.KillTile(i, j1); + WorldGen.KillTile(i, j1 + 1); + WorldGen.KillTile(i, j1 + 2); + WorldGen.DropDoorItem(i, j, doorStyle1); + } + WorldGen.destroyObject = false; return; case 11: - WorldGen.CheckDoorOpen(i, j, tile1); + if (WorldGen.destroyObject) + return; + int num16 = 0; + int index24 = i; + int frameX2 = (int) centerTile.frameX; + int frameY3 = (int) centerTile.frameY; + int doorStyle2 = frameY3 / 54 + (int) centerTile.frameX / 72 * 36; + int num17 = j - frameY3 % 54 / 18; + bool flag7 = false; + switch (frameX2 % 72) + { + case 0: + index24 = i; + num16 = 1; + break; + case 18: + index24 = i - 1; + num16 = 1; + break; + case 36: + index24 = i + 1; + num16 = -1; + break; + case 54: + index24 = i; + num16 = -1; + break; + } + Tile tile43 = Main.tile[index24, num17 - 1]; + Tile testTile2 = Main.tile[index24, num17 + 3]; + if (tile43 == null) + { + tile43 = new Tile(); + Main.tile[index24, num17 - 1] = tile43; + } + if (testTile2 == null) + { + testTile2 = new Tile(); + Main.tile[index24, num17 + 3] = testTile2; + } + if (!tile43.active() || !Main.tileSolid[(int) tile43.type] || !WorldGen.SolidTile(testTile2)) + { + flag7 = true; + WorldGen.destroyObject = true; + WorldGen.DropDoorItem(i, j, doorStyle2); + } + int num18 = index24; + if (num16 == -1) + num18 = index24 - 1; + for (int i1 = num18; i1 < num18 + 2; ++i1) + { + for (int j2 = num17; j2 < num17 + 3; ++j2) + { + if (!flag7) + { + Tile tile44 = Main.tile[i1, j2]; + if (!tile44.active() || tile44.type != (ushort) 11) + { + WorldGen.destroyObject = true; + WorldGen.DropDoorItem(i, j, doorStyle2); + flag7 = true; + i1 = num18; + j2 = num17; + } + } + if (flag7) + WorldGen.KillTile(i1, j2); + } + } + WorldGen.destroyObject = false; return; case 314: Minecart.FrameTrack(i, j, false); return; case 380: - Tile tile23 = Main.tile[i - 1, j]; - if (tile23 == null) + Tile tile45 = Main.tile[i - 1, j]; + if (tile45 == null) return; - Tile tile24 = Main.tile[i + 1, j]; - if (tile24 == null || Main.tile[i - 1, j + 1] == null || Main.tile[i + 1, j + 1] == null || Main.tile[i - 1, j - 1] == null || Main.tile[i + 1, j - 1] == null) + Tile tile46 = Main.tile[i + 1, j]; + if (tile46 == null || Main.tile[i - 1, j + 1] == null || Main.tile[i + 1, j + 1] == null || Main.tile[i - 1, j - 1] == null || Main.tile[i + 1, j - 1] == null) return; - int index11 = -1; - int index12 = -1; - if (tile23 != null && tile23.active()) - index12 = !Main.tileStone[(int) tile23.type] ? (int) tile23.type : 1; - if (tile24 != null && tile24.active()) - index11 = !Main.tileStone[(int) tile24.type] ? (int) tile24.type : 1; - if (index11 >= 0 && !Main.tileSolid[index11]) - index11 = -1; - if (index12 >= 0 && !Main.tileSolid[index12]) - index12 = -1; - rectangle.X = index12 != index1 || index11 != index1 ? (index12 != index1 || index11 == index1 ? (index12 == index1 || index11 != index1 ? 54 : 0) : 36) : 18; - tile1.frameX = (short) rectangle.X; + int index25 = -1; + int index26 = -1; + if (tile45 != null && tile45.active()) + index26 = !Main.tileStone[(int) tile45.type] ? (int) tile45.type : 1; + if (tile46 != null && tile46.active()) + index25 = !Main.tileStone[(int) tile46.type] ? (int) tile46.type : 1; + if (index25 >= 0 && !Main.tileSolid[index25]) + index25 = -1; + if (index26 >= 0 && !Main.tileSolid[index26]) + index26 = -1; + rectangle.X = index26 != index1 || index25 != index1 ? (index26 != index1 || index25 == index1 ? (index26 == index1 || index25 != index1 ? 54 : 0) : 36) : 18; + centerTile.frameX = (short) rectangle.X; return; default: if (index1 >= 0 && TileID.Sets.Platforms[index1]) { - Tile tile25 = Main.tile[i - 1, j]; - if (tile25 == null) + Tile tile47 = Main.tile[i - 1, j]; + if (tile47 == null) return; - Tile tile26 = Main.tile[i + 1, j]; - if (tile26 == null) + Tile tile48 = Main.tile[i + 1, j]; + if (tile48 == null) return; - Tile tile27 = Main.tile[i - 1, j + 1]; - if (tile27 == null) + Tile tile49 = Main.tile[i - 1, j + 1]; + if (tile49 == null) return; - Tile tile28 = Main.tile[i + 1, j + 1]; - if (tile28 == null) + Tile tile50 = Main.tile[i + 1, j + 1]; + if (tile50 == null) return; - Tile tile29 = Main.tile[i - 1, j - 1]; - if (tile29 == null) + Tile tile51 = Main.tile[i - 1, j - 1]; + if (tile51 == null) return; - Tile tile30 = Main.tile[i + 1, j - 1]; - if (tile30 == null) + Tile tile52 = Main.tile[i + 1, j - 1]; + if (tile52 == null) return; - int index13 = -1; - int index14 = -1; - if (tile25 != null && tile25.active()) - index14 = !Main.tileStone[(int) tile25.type] ? (!TileID.Sets.Platforms[(int) tile25.type] ? (int) tile25.type : index1) : 1; - if (tile26 != null && tile26.active()) - index13 = !Main.tileStone[(int) tile26.type] ? (!TileID.Sets.Platforms[(int) tile26.type] ? (int) tile26.type : index1) : 1; - if (index13 >= 0 && !Main.tileSolid[index13]) - index13 = -1; - if (index14 >= 0 && !Main.tileSolid[index14]) - index14 = -1; - if (index14 == index1 && tile25.halfBrick() != tile1.halfBrick()) - index14 = -1; - if (index13 == index1 && tile26.halfBrick() != tile1.halfBrick()) - index13 = -1; - if (index14 != -1 && index14 != index1 && tile1.halfBrick()) - index14 = -1; - if (index13 != -1 && index13 != index1 && tile1.halfBrick()) - index13 = -1; - if (index14 == -1 && tile29.active() && (int) tile29.type == index1 && tile29.slope() == (byte) 1) - index14 = index1; - if (index13 == -1 && tile30.active() && (int) tile30.type == index1 && tile30.slope() == (byte) 2) - index13 = index1; - if (index14 == index1 && tile25.slope() == (byte) 2 && index13 != index1) - index13 = -1; - if (index13 == index1 && tile26.slope() == (byte) 1 && index14 != index1) - index14 = -1; - rectangle.X = tile1.slope() != (byte) 1 ? (tile1.slope() != (byte) 2 ? (index14 != index1 || index13 != index1 ? (index14 != index1 || index13 != -1 ? (index14 != -1 || index13 != index1 ? (index14 == index1 || index13 != index1 ? (index14 != index1 || index13 == index1 ? (index14 == index1 || index14 == -1 || index13 != -1 ? (index14 != -1 || index13 == index1 || index13 == -1 ? 90 : 126) : 108) : 72) : 54) : (tile26.slope() != (byte) 1 ? 36 : 288)) : (tile25.slope() != (byte) 2 ? 18 : 270)) : (tile25.slope() != (byte) 2 || tile26.slope() != (byte) 1 ? (tile25.slope() != (byte) 2 ? (tile26.slope() != (byte) 1 ? 0 : 234) : 216) : 252)) : (!TileID.Sets.Platforms[(int) tile25.type] || tile25.slope() != (byte) 0 || tile25.halfBrick() ? (tile27.active() || TileID.Sets.Platforms[(int) tile27.type] && tile27.slope() != (byte) 1 ? (tile26.active() || TileID.Sets.Platforms[(int) tile30.type] && tile30.slope() == (byte) 2 ? 144 : 378) : (tile26.active() || TileID.Sets.Platforms[(int) tile30.type] && tile30.slope() == (byte) 2 ? 342 : 414)) : 450)) : (!TileID.Sets.Platforms[(int) tile26.type] || tile26.slope() != (byte) 0 || tile26.halfBrick() ? (tile28.active() || TileID.Sets.Platforms[(int) tile28.type] && tile28.slope() != (byte) 2 ? (tile25.active() || TileID.Sets.Platforms[(int) tile29.type] && tile29.slope() == (byte) 1 ? 180 : 396) : (tile25.active() || TileID.Sets.Platforms[(int) tile29.type] && tile29.slope() == (byte) 1 ? 360 : 432)) : 468); - tile1.frameX = (short) rectangle.X; + int index27 = -1; + int index28 = -1; + if (tile47 != null && tile47.active()) + index28 = !Main.tileStone[(int) tile47.type] ? (!TileID.Sets.Platforms[(int) tile47.type] ? (int) tile47.type : index1) : 1; + if (tile48 != null && tile48.active()) + index27 = !Main.tileStone[(int) tile48.type] ? (!TileID.Sets.Platforms[(int) tile48.type] ? (int) tile48.type : index1) : 1; + if (index27 >= 0 && !Main.tileSolid[index27]) + index27 = -1; + if (index28 >= 0 && !Main.tileSolid[index28]) + index28 = -1; + if (index28 == index1 && tile47.halfBrick() != centerTile.halfBrick()) + index28 = -1; + if (index27 == index1 && tile48.halfBrick() != centerTile.halfBrick()) + index27 = -1; + if (index28 != -1 && index28 != index1 && centerTile.halfBrick()) + index28 = -1; + if (index27 != -1 && index27 != index1 && centerTile.halfBrick()) + index27 = -1; + if (index28 == -1 && tile51.active() && (int) tile51.type == index1 && tile51.slope() == (byte) 1) + index28 = index1; + if (index27 == -1 && tile52.active() && (int) tile52.type == index1 && tile52.slope() == (byte) 2) + index27 = index1; + if (index28 == index1 && tile47.slope() == (byte) 2 && index27 != index1) + index27 = -1; + if (index27 == index1 && tile48.slope() == (byte) 1 && index28 != index1) + index28 = -1; + rectangle.X = centerTile.slope() != (byte) 1 ? (centerTile.slope() != (byte) 2 ? (index28 != index1 || index27 != index1 ? (index28 != index1 || index27 != -1 ? (index28 != -1 || index27 != index1 ? (index28 == index1 || index27 != index1 ? (index28 != index1 || index27 == index1 ? (index28 == index1 || index28 == -1 || index27 != -1 ? (index28 != -1 || index27 == index1 || index27 == -1 ? 90 : 126) : 108) : 72) : 54) : (tile48.slope() != (byte) 1 ? 36 : 288)) : (tile47.slope() != (byte) 2 ? 18 : 270)) : (tile47.slope() != (byte) 2 || tile48.slope() != (byte) 1 ? (tile47.slope() != (byte) 2 ? (tile48.slope() != (byte) 1 ? 0 : 234) : 216) : 252)) : (!TileID.Sets.Platforms[(int) tile47.type] || tile47.slope() != (byte) 0 ? (tile49.active() || TileID.Sets.Platforms[(int) tile49.type] && tile49.slope() != (byte) 1 ? (tile48.active() || TileID.Sets.Platforms[(int) tile52.type] && tile52.slope() == (byte) 2 ? 144 : 378) : (tile48.active() || TileID.Sets.Platforms[(int) tile52.type] && tile52.slope() == (byte) 2 ? 342 : 414)) : 450)) : (!TileID.Sets.Platforms[(int) tile48.type] || tile48.slope() != (byte) 0 ? (tile50.active() || TileID.Sets.Platforms[(int) tile50.type] && tile50.slope() != (byte) 2 ? (tile47.active() || TileID.Sets.Platforms[(int) tile51.type] && tile51.slope() == (byte) 1 ? 180 : 396) : (tile47.active() || TileID.Sets.Platforms[(int) tile51.type] && tile51.slope() == (byte) 1 ? 360 : 432)) : 468); + centerTile.frameX = (short) rectangle.X; return; } if (index1 == 233 || index1 == 236 || index1 == 238) @@ -49902,11 +36926,6 @@ label_218: WorldGen.CheckJunglePlant(i, j, index1); return; } - if (index1 == 530) - { - WorldGen.CheckOasisPlant(i, j); - return; - } if (index1 == 240 || index1 == 440) { WorldGen.Check3x3Wall(i, j); @@ -49937,61 +36956,31 @@ label_218: WorldGen.CheckWeaponsRack(i, j); return; } - if (index1 == 471) - { - TEWeaponsRack.Framing_CheckTile(i, j); - return; - } if (index1 == 34 || index1 == 454) { WorldGen.CheckChand(i, j, index1); return; } - if (index1 == 547) - { - WorldGen.Check2x5(i, j, index1); - return; - } - if (index1 == 548 || index1 == 614) - { - WorldGen.Check3x6(i, j, index1); - return; - } - if (index1 == 613) - { - WorldGen.Check3x5(i, j, index1); - return; - } - if (index1 == 106 || index1 == 212 || index1 == 219 || index1 == 220 || index1 == 228 || index1 == 231 || index1 == 243 || index1 == 247 || index1 == 283 || index1 >= 300 && index1 <= 308 || index1 == 354 || index1 == 406 || index1 == 412 || index1 == 355 || index1 == 452 || index1 == 455 || index1 == 491 || index1 == 499) + if (index1 == 106 || index1 == 212 || index1 == 219 || index1 == 220 || index1 == 228 || index1 == 231 || index1 == 243 || index1 == 247 || index1 == 283 || index1 >= 300 && index1 <= 308 || index1 == 354 || index1 == 406 || index1 == 412 || index1 == 355 || index1 == 452 || index1 == 455) { WorldGen.Check3x3(i, j, (int) (ushort) index1); return; } - if (index1 == 15 || index1 == 497 || index1 == 20 || index1 == 590 || index1 == 216 || index1 == 338 || index1 == 390 || index1 == 493 || index1 == 595 || index1 == 615) + if (index1 == 15 || index1 == 20 || index1 == 216 || index1 == 338 || index1 == 390) { WorldGen.Check1x2(i, j, (ushort) index1); return; } - if (index1 == 14 || index1 == 469 || index1 == 17 || index1 == 26 || index1 == 77 || index1 == 86 || index1 == 87 || index1 == 377 || index1 == 88 || index1 == 89 || index1 == 114 || index1 == 133 || index1 == 186 || index1 == 187 || index1 == 215 || index1 == 217 || index1 == 218 || index1 == 237 || index1 == 244 || index1 == 285 || index1 == 286 || index1 == 298 || index1 == 299 || index1 == 310 || index1 == 339 || index1 == 538 || index1 >= 361 && index1 <= 364 || index1 >= 391 && index1 <= 394 || index1 == 405 || index1 == 486 || index1 == 488 || index1 == 532 || index1 == 544 || index1 == 533 || index1 == 552 || index1 == 555 || index1 == 556 || index1 == 582 || index1 == 619) + if (index1 == 14 || index1 == 469 || index1 == 17 || index1 == 26 || index1 == 77 || index1 == 86 || index1 == 87 || index1 == 377 || index1 == 88 || index1 == 89 || index1 == 114 || index1 == 133 || index1 == 186 || index1 == 187 || index1 == 215 || index1 == 217 || index1 == 218 || index1 == 237 || index1 == 244 || index1 == 285 || index1 == 286 || index1 == 298 || index1 == 299 || index1 == 310 || index1 == 339 || index1 >= 361 && index1 <= 364 || index1 >= 391 && index1 <= 394 || index1 == 405) { WorldGen.Check3x2(i, j, (int) (ushort) index1); return; } - if (index1 == 135 || index1 == 144 || index1 == 141 || index1 == 210 || index1 == 239 || index1 == 36 || index1 == 428 || index1 == 593) + if (index1 == 135 || index1 == 144 || index1 == 141 || index1 == 210 || index1 == 239 || index1 == 36 || index1 == 428) { WorldGen.Check1x1(i, j, index1); return; } - if (index1 == 476) - { - WorldGen.CheckGolf1x1(i, j, index1); - return; - } - if (index1 == 494) - { - WorldGen.CheckGolf1x1(i, j, index1); - return; - } if (index1 == 419 || index1 == 420 || index1 == 423 || index1 == 424 || index1 == 429 || index1 == 445) { WorldGen.CheckLogicTiles(i, j, index1); @@ -50002,9 +36991,9 @@ label_218: WorldGen.Check2x1(i, j, (ushort) index1); return; } - if (index1 == 13 || index1 == 33 || index1 == 50 || index1 == 78 || index1 == 174 || index1 == 372 || index1 == 49) + if (index1 == 13 || index1 == 33 || index1 == 50 || index1 == 78 || index1 == 174 || index1 == 372) { - WorldGen.CheckOnTable1x1(i, j, index1); + WorldGen.CheckOnTable1x1(i, j, (int) (byte) index1); return; } if (TileID.Sets.BasicChest[index1]) @@ -50032,29 +37021,20 @@ label_218: case 269: WorldGen.CheckWoman(i, j); return; - case 470: - TEDisplayDoll.Framing_CheckTile(i, j); - return; - case 475: - TEHatRack.Framing_CheckTile(i, j); - return; - case 597: - TETeleportationPylon.Framing_CheckTile(i, j); - return; default: if (!TileID.Sets.BasicChestFake[index1] && index1 != 457) { - if (index1 == 335 || index1 == 411 || index1 == 490 || index1 == 564 || index1 == 565 || index1 == 594) + if (index1 == 335 || index1 == 411) { WorldGen.Check2x2(i, j, index1); return; } - if (index1 == 132 || index1 == 138 || index1 == 484 || index1 == 142 || index1 == 143 || index1 >= 288 && index1 <= 295 || index1 >= 316 && index1 <= 318 || index1 == 172 || index1 == 360 || index1 == 505 || index1 == 521 || index1 == 522 || index1 == 523 || index1 == 524 || index1 == 525 || index1 == 526 || index1 == 527 || index1 == 543 || index1 == 568 || index1 == 569 || index1 == 570 || index1 == 580 || index1 == 598 || index1 == 620) + if (index1 == 132 || index1 == 138 || index1 == 142 || index1 == 143 || index1 >= 288 && index1 <= 295 || index1 >= 316 && index1 <= 318 || index1 == 172 || index1 == 360) { WorldGen.Check2x2(i, j, index1); return; } - if (index1 == 376 || index1 == 443 || index1 == 444 || index1 == 485) + if (index1 == 376 || index1 == 443 || index1 == 444) { WorldGen.CheckSuper(i, j, index1); return; @@ -50084,42 +37064,37 @@ label_218: WorldGen.Check1xX(i, j, (short) index1); return; } - if (index1 == 104 || index1 == 105 || index1 == 207 || index1 == 320 || index1 == 337 || index1 == 349 || index1 == 356 || index1 == 378 || index1 == 410 || index1 == 456 || index1 == 465 || index1 == 480 || index1 == 489 || index1 == 506 || index1 == 509 || index1 == 531 || index1 == 545 || index1 == 560 || index1 == 591 || index1 == 592) + if (index1 == 104 || index1 == 105 || index1 == 207 || index1 == 320 || index1 == 337 || index1 == 349 || index1 == 356 || index1 == 378 || index1 == 410 || index1 == 456 || index1 == 465) { WorldGen.Check2xX(i, j, (ushort) index1); return; } - if (index1 == 101 || index1 == 102 || index1 == 463 || index1 == 617) + if (index1 == 101 || index1 == 102 || index1 == 463) { WorldGen.Check3x4(i, j, index1); return; } - if (index1 == 42 || index1 == 270 || index1 == 271 || index1 == 572 || index1 == 581) + if (index1 == 42 || index1 == 270 || index1 == 271) { WorldGen.Check1x2Top(i, j, (ushort) index1); return; } - if (index1 == 55 || index1 == 85 || index1 == 395 || index1 == 425 || index1 == 510 || index1 == 511 || index1 == 573) + if (index1 == 55 || index1 == 85 || index1 == 395 || index1 == 425) { WorldGen.CheckSign(i, j, (ushort) index1); return; } - if (index1 == 520) - { - WorldGen.CheckFoodPlatter(i, j, (int) (ushort) index1); - return; - } if (index1 == 209) { WorldGen.CheckCannon(i, j, index1); return; } - if (index1 == 79 || index1 == 90 || index1 == 487) + if (index1 == 79 || index1 == 90) { WorldGen.Check4x2(i, j, index1); return; } - if (index1 == 94 || index1 == 95 || index1 == 97 || index1 == 319 || index1 == 98 || index1 == 99 || index1 == 100 || index1 == 125 || index1 == 126 || index1 == 173 || index1 == 282 || index1 == 287 || index1 == 621 || index1 == 622) + if (index1 == 94 || index1 == 95 || index1 == 97 || index1 == 319 || index1 == 98 || index1 == 99 || index1 == 100 || index1 == 125 || index1 == 126 || index1 == 173 || index1 == 282 || index1 == 287) { WorldGen.Check2x2(i, j, index1); return; @@ -50127,22 +37102,22 @@ label_218: switch (index1) { case 81: - Tile tile31 = Main.tile[i, j - 1]; - Tile tile32 = Main.tile[i, j + 1]; - Tile tile33 = Main.tile[i - 1, j]; - Tile tile34 = Main.tile[i + 1, j]; - int index15 = -1; - int num4 = -1; - if (tile31 != null && tile31.active()) - num4 = (int) tile31.type; - if (tile32 != null && tile32.active()) - index15 = (int) tile32.type; - if (num4 != -1) + Tile tile53 = Main.tile[i, j - 1]; + Tile tile54 = Main.tile[i, j + 1]; + Tile tile55 = Main.tile[i - 1, j]; + Tile tile56 = Main.tile[i + 1, j]; + int index29 = -1; + int num19 = -1; + if (tile53 != null && tile53.active()) + num19 = (int) tile53.type; + if (tile54 != null && tile54.active()) + index29 = (int) tile54.type; + if (num19 != -1) { WorldGen.KillTile(i, j); return; } - if (index15 >= 0 && Main.tileSolid[index15] && !tile32.halfBrick() && !tile32.topSlope()) + if (index29 >= 0 && Main.tileSolid[index29] && !tile54.halfBrick() && !tile54.topSlope()) return; WorldGen.KillTile(i, j); return; @@ -50161,67 +37136,40 @@ label_218: WorldGen.CheckTree(i, j); return; case 72: - Tile tile35 = Main.tile[i, j - 1]; - Tile tile36 = Main.tile[i, j + 1]; - int num5 = -1; - int num6 = -1; - if (tile35 != null && tile35.active()) - num6 = (int) tile35.type; - if (tile36 != null && tile36.active()) - num5 = (int) tile36.type; - if (num5 != index1 && num5 != 70) + Tile tile57 = Main.tile[i, j - 1]; + Tile tile58 = Main.tile[i, j + 1]; + int num20 = -1; + int num21 = -1; + if (tile57 != null && tile57.active()) + num21 = (int) tile57.type; + if (tile58 != null && tile58.active()) + num20 = (int) tile58.type; + if (num20 != index1 && num20 != 70) { WorldGen.KillTile(i, j); return; } - if (num6 == index1 || tile1.frameX != (short) 0) + if (num21 == index1 || centerTile.frameX != (short) 0) return; - tile1.frameNumber((byte) WorldGen.genRand.Next(3)); - if (tile1.frameNumber() == (byte) 0) + centerTile.frameNumber((byte) WorldGen.genRand.Next(3)); + if (centerTile.frameNumber() == (byte) 0) { - tile1.frameX = (short) 18; - tile1.frameY = (short) 0; + centerTile.frameX = (short) 18; + centerTile.frameY = (short) 0; } - if (tile1.frameNumber() == (byte) 1) + if (centerTile.frameNumber() == (byte) 1) { - tile1.frameX = (short) 18; - tile1.frameY = (short) 18; + centerTile.frameX = (short) 18; + centerTile.frameY = (short) 18; } - if (tile1.frameNumber() != (byte) 2) + if (centerTile.frameNumber() != (byte) 2) return; - tile1.frameX = (short) 18; - tile1.frameY = (short) 36; + centerTile.frameX = (short) 18; + centerTile.frameY = (short) 36; return; case 323: WorldGen.CheckPalmTree(i, j); return; - case 567: - WorldGen.CheckGnome(i, j); - return; - case 583: - case 584: - case 585: - case 586: - case 587: - case 588: - case 589: - WorldGen.CheckTreeWithSettings(i, j, new WorldGen.CheckTreeSettings() - { - IsGroundValid = new WorldGen.CheckTreeSettings.GroundValidTest(WorldGen.GemTreeGroundTest) - }); - return; - case 596: - WorldGen.CheckTreeWithSettings(i, j, new WorldGen.CheckTreeSettings() - { - IsGroundValid = new WorldGen.CheckTreeSettings.GroundValidTest(WorldGen.VanityTreeGroundTest) - }); - return; - case 616: - WorldGen.CheckTreeWithSettings(i, j, new WorldGen.CheckTreeSettings() - { - IsGroundValid = new WorldGen.CheckTreeSettings.GroundValidTest(WorldGen.VanityTreeGroundTest) - }); - return; default: return; } @@ -50240,17 +37188,17 @@ label_218: { if (index1 >= (int) byte.MaxValue && index1 <= 268 || index1 == 385 || index1 >= 446 && index1 <= 448) { - Framing.SelfFrame8Way(i, j, tile1, resetFrame); + Framing.SelfFrame8Way(i, j, centerTile, resetFrame); return; } - Tile tileTopCache = Main.tile[i, j - 1]; - Tile tile37 = Main.tile[i, j + 1]; - Tile tile38 = Main.tile[i - 1, j]; - Tile tile39 = Main.tile[i + 1, j]; - Tile tile40 = Main.tile[i - 1, j + 1]; - Tile tile41 = Main.tile[i + 1, j + 1]; - Tile tile42 = Main.tile[i - 1, j - 1]; - Tile tile43 = Main.tile[i + 1, j - 1]; + Tile tile59 = Main.tile[i, j - 1]; + Tile tile60 = Main.tile[i, j + 1]; + Tile tile61 = Main.tile[i - 1, j]; + Tile tile62 = Main.tile[i + 1, j]; + Tile tile63 = Main.tile[i - 1, j + 1]; + Tile tile64 = Main.tile[i + 1, j + 1]; + Tile tile65 = Main.tile[i - 1, j - 1]; + Tile tile66 = Main.tile[i + 1, j - 1]; int upLeft = -1; int up = -1; int upRight = -1; @@ -50259,54 +37207,54 @@ label_218: int downLeft = -1; int down = -1; int downRight = -1; - if (tile38 != null && tile38.active()) + if (tile61 != null && tile61.active()) { - left = !Main.tileStone[(int) tile38.type] ? (int) tile38.type : 1; - if (tile38.slope() == (byte) 1 || tile38.slope() == (byte) 3) + left = !Main.tileStone[(int) tile61.type] ? (int) tile61.type : 1; + if (tile61.slope() == (byte) 1 || tile61.slope() == (byte) 3) left = -1; } - if (tile39 != null && tile39.active()) + if (tile62 != null && tile62.active()) { - right = !Main.tileStone[(int) tile39.type] ? (int) tile39.type : 1; - if (tile39.slope() == (byte) 2 || tile39.slope() == (byte) 4) + right = !Main.tileStone[(int) tile62.type] ? (int) tile62.type : 1; + if (tile62.slope() == (byte) 2 || tile62.slope() == (byte) 4) right = -1; } - if (tileTopCache != null && tileTopCache.active()) + if (tile59 != null && tile59.active()) { - up = !Main.tileStone[(int) tileTopCache.type] ? (int) tileTopCache.type : 1; - if (tileTopCache.slope() == (byte) 3 || tileTopCache.slope() == (byte) 4) + up = !Main.tileStone[(int) tile59.type] ? (int) tile59.type : 1; + if (tile59.slope() == (byte) 3 || tile59.slope() == (byte) 4) up = -1; } - if (tile37 != null && tile37.active()) + if (tile60 != null && tile60.active()) { - down = !Main.tileStone[(int) tile37.type] ? (int) tile37.type : 1; - if (tile37.slope() == (byte) 1 || tile37.slope() == (byte) 2) + down = !Main.tileStone[(int) tile60.type] ? (int) tile60.type : 1; + if (tile60.slope() == (byte) 1 || tile60.slope() == (byte) 2) down = -1; } - if (tile42 != null && tile42.active()) - upLeft = !Main.tileStone[(int) tile42.type] ? (int) tile42.type : 1; - if (tile43 != null && tile43.active()) - upRight = !Main.tileStone[(int) tile43.type] ? (int) tile43.type : 1; - if (tile40 != null && tile40.active()) - downLeft = !Main.tileStone[(int) tile40.type] ? (int) tile40.type : 1; - if (tile41 != null && tile41.active()) - downRight = !Main.tileStone[(int) tile41.type] ? (int) tile41.type : 1; - if (tile1.slope() == (byte) 2) + if (tile65 != null && tile65.active()) + upLeft = !Main.tileStone[(int) tile65.type] ? (int) tile65.type : 1; + if (tile66 != null && tile66.active()) + upRight = !Main.tileStone[(int) tile66.type] ? (int) tile66.type : 1; + if (tile63 != null && tile63.active()) + downLeft = !Main.tileStone[(int) tile63.type] ? (int) tile63.type : 1; + if (tile64 != null && tile64.active()) + downRight = !Main.tileStone[(int) tile64.type] ? (int) tile64.type : 1; + if (centerTile.slope() == (byte) 2) { up = -1; left = -1; } - if (tile1.slope() == (byte) 1) + if (centerTile.slope() == (byte) 1) { up = -1; right = -1; } - if (tile1.slope() == (byte) 4) + if (centerTile.slope() == (byte) 4) { down = -1; left = -1; } - if (tile1.slope() == (byte) 3) + if (centerTile.slope() == (byte) 3) { down = -1; right = -1; @@ -50345,16 +37293,16 @@ label_218: } if ((index1 == 1 || Main.tileMoss[index1] || index1 == 117 || index1 == 25 || index1 == 203) && down == 165) { - if (tile37.frameY == (short) 72) + if (tile60.frameY == (short) 72) down = index1; - else if (tile37.frameY == (short) 0) + else if (tile60.frameY == (short) 0) down = index1; } if ((index1 == 1 || Main.tileMoss[index1] || index1 == 117 || index1 == 25 || index1 == 203) && up == 165) { - if (tileTopCache.frameY == (short) 90) + if (tile59.frameY == (short) 90) up = index1; - else if (tileTopCache.frameY == (short) 54) + else if (tile59.frameY == (short) 54) up = index1; } if (index1 == 225) @@ -50364,40 +37312,40 @@ label_218: if (up == 165) up = index1; } - if ((index1 == 200 || index1 == 161 || index1 == 147 || index1 == 163 || index1 == 164) && down == 165) + if ((index1 == 200 || index1 == 161 || index1 == 163 || index1 == 164) && down == 165) down = index1; - if ((tile1.slope() == (byte) 1 || tile1.slope() == (byte) 2) && down > -1 && !TileID.Sets.Platforms[down]) + if ((centerTile.slope() == (byte) 1 || centerTile.slope() == (byte) 2) && down > -1 && !TileID.Sets.Platforms[down]) down = index1; - if (up > -1 && (tileTopCache.slope() == (byte) 1 || tileTopCache.slope() == (byte) 2) && !TileID.Sets.Platforms[up]) + if (up > -1 && (tile59.slope() == (byte) 1 || tile59.slope() == (byte) 2) && !TileID.Sets.Platforms[up]) up = index1; - if ((tile1.slope() == (byte) 3 || tile1.slope() == (byte) 4) && up > -1 && !TileID.Sets.Platforms[up]) + if ((centerTile.slope() == (byte) 3 || centerTile.slope() == (byte) 4) && up > -1 && !TileID.Sets.Platforms[up]) up = index1; - if (down > -1 && (tile37.slope() == (byte) 3 || tile37.slope() == (byte) 4) && !TileID.Sets.Platforms[down]) + if (down > -1 && (tile60.slope() == (byte) 3 || tile60.slope() == (byte) 4) && !TileID.Sets.Platforms[down]) down = index1; if (index1 == 124) { - if (up > -1 && Main.tileSolid[up] && !TileID.Sets.Platforms[up]) + if (up > -1 && Main.tileSolid[up]) up = index1; - if (down > -1 && Main.tileSolid[down] && !TileID.Sets.Platforms[down]) + if (down > -1 && Main.tileSolid[down]) down = index1; } - if (up > -1 && tileTopCache.halfBrick() && !TileID.Sets.Platforms[up]) + if (up > -1 && tile59.halfBrick() && !TileID.Sets.Platforms[up]) up = index1; - if (left > -1 && tile38.halfBrick()) + if (left > -1 && tile61.halfBrick()) { - if (tile1.halfBrick()) + if (centerTile.halfBrick()) left = index1; - else if ((int) tile38.type != index1) + else if ((int) tile61.type != index1) left = -1; } - if (right > -1 && tile39.halfBrick()) + if (right > -1 && tile62.halfBrick()) { - if (tile1.halfBrick()) + if (centerTile.halfBrick()) right = index1; - else if ((int) tile39.type != index1) + else if ((int) tile62.type != index1) right = -1; } - if (tile1.halfBrick()) + if (centerTile.halfBrick()) { if (left != index1) left = -1; @@ -50405,7 +37353,7 @@ label_218: right = -1; up = -1; } - if (tile37 != null && tile37.halfBrick()) + if (tile60 != null && tile60.halfBrick()) down = -1; if (!Main.tileSolid[index1]) { @@ -50424,16 +37372,16 @@ label_218: WorldGen.mergeDown = false; WorldGen.mergeLeft = false; WorldGen.mergeRight = false; - int num7; + int num22; if (resetFrame) { - num7 = WorldGen.genRand.Next(0, 3); - tile1.frameNumber((byte) num7); + num22 = WorldGen.genRand.Next(0, 3); + centerTile.frameNumber((byte) num22); } else - num7 = (int) tile1.frameNumber(); + num22 = (int) centerTile.frameNumber(); if (Main.tileLargeFrames[index1] == (byte) 1) - num7 = new int[4, 3] + num22 = new int[4, 3] { { 2, @@ -50456,36 +37404,9 @@ label_218: 3 } }[j % 4, i % 3] - 1; - if (Main.tileLargeFrames[index1] == (byte) 2) - num7 = i % 2 + j % 2 * 2; WorldGen.TileMergeAttempt(index1, Main.tileBlendAll, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); if (Main.tileBlendAll[index1]) - { - Main.tileSolid[10] = false; - Main.tileSolid[387] = false; WorldGen.TileMergeAttempt(index1, Main.tileSolid, Main.tileSolidTop, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - Main.tileSolid[10] = true; - Main.tileSolid[387] = true; - } - if (TileID.Sets.ForcedDirtMerging[index1]) - { - if (up == 0) - up = index1; - if (down == 0) - down = index1; - if (left == 0) - left = index1; - if (right == 0) - right = index1; - if (upLeft == 0) - upLeft = index1; - if (upRight == 0) - upRight = index1; - if (downLeft == 0) - downLeft = index1; - if (downRight == 0) - downRight = index1; - } switch (index1) { case 0: @@ -50537,52 +37458,32 @@ label_218: if (WorldGen.mergeLeft) right = index1; } - bool[] dirtInAspecialWay = TileID.Sets.Conversion.MergesWithDirtInASpecialWay; - if (up > -1 && dirtInAspecialWay[up]) + if (up == 2 || up == 23 || up == 109 || up == 199) up = index1; - if (down > -1 && dirtInAspecialWay[down]) + if (down == 2 || down == 23 || down == 109 || down == 199) down = index1; - if (left > -1 && dirtInAspecialWay[left]) + if (left == 2 || left == 23 || left == 109 || left == 199) left = index1; - if (right > -1 && dirtInAspecialWay[right]) + if (right == 2 || right == 23 || right == 109 || right == 199) right = index1; if (upLeft > -1 && Main.tileMergeDirt[upLeft]) upLeft = index1; - else if (upLeft > -1 && dirtInAspecialWay[upLeft]) + else if (upLeft == 2 || upLeft == 23 || upLeft == 109 || upLeft == 199) upLeft = index1; if (upRight > -1 && Main.tileMergeDirt[upRight]) upRight = index1; - else if (upRight > -1 && dirtInAspecialWay[upRight]) + else if (upRight == 2 || upRight == 23 || upRight == 109 || upRight == 199) upRight = index1; if (downLeft > -1 && Main.tileMergeDirt[downLeft]) downLeft = index1; - else if (downLeft > -1 && dirtInAspecialWay[downLeft]) + else if (downLeft == 2 || downLeft == 23 || downLeft == 109 || downLeft == 199) downLeft = index1; if (downRight > -1 && Main.tileMergeDirt[downRight]) downRight = index1; - else if (downRight > -1 && dirtInAspecialWay[downRight]) + else if (downRight == 2 || downRight == 23 || downRight == 109 || downRight == 199) downRight = index1; WorldGen.TileMergeAttempt(-2, 59, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); WorldGen.TileMergeAttempt(index1, 191, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - if (up > -1 && TileID.Sets.ForcedDirtMerging[up]) - up = index1; - if (down > -1 && TileID.Sets.ForcedDirtMerging[down]) - down = index1; - if (left > -1 && TileID.Sets.ForcedDirtMerging[left]) - left = index1; - if (right > -1 && TileID.Sets.ForcedDirtMerging[right]) - right = index1; - if (upLeft > -1 && TileID.Sets.ForcedDirtMerging[upLeft]) - upLeft = index1; - if (upRight > -1 && TileID.Sets.ForcedDirtMerging[upRight]) - upRight = index1; - if (downLeft > -1 && TileID.Sets.ForcedDirtMerging[downLeft]) - downLeft = index1; - if (downRight > -1 && TileID.Sets.ForcedDirtMerging[downRight]) - { - downRight = index1; - break; - } break; case 53: WorldGen.TileMergeAttemptFrametest(i, j, index1, 397, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); @@ -50628,18 +37529,29 @@ label_218: WorldGen.TileMergeAttemptFrametest(i, j, index1, 57, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); } } - else if (index1 == 58 || index1 == 76 || index1 == 75) - { - WorldGen.TileMergeAttempt(-2, 57, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - } else { switch (index1) { + case 32: + if (down == 23) + { + down = index1; + break; + } + break; + case 51: + WorldGen.TileMergeAttempt(index1, TileID.Sets.AllTiles, Main.tileNoAttach, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + break; case 57: WorldGen.TileMergeAttempt(-2, 1, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); WorldGen.TileMergeAttemptFrametest(i, j, index1, TileID.Sets.HellSpecial, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); break; + case 58: + case 75: + case 76: + WorldGen.TileMergeAttempt(-2, 57, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + break; case 59: if ((double) j > Main.rockLayer) WorldGen.TileMergeAttempt(-2, 1, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); @@ -50652,232 +37564,157 @@ label_218: } WorldGen.TileMergeAttempt(index1, 0, ref up, ref down, ref left, ref right); break; + case 60: + WorldGen.TileMergeAttempt(59, 211, ref up, ref down, ref left, ref right); + break; + case 69: + if (down == 60) + { + down = index1; + break; + } + break; + case 147: + WorldGen.TileMergeAttemptFrametest(i, j, index1, TileID.Sets.IcesSlush, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + break; + case 161: + case 163: + case 164: + case 200: + case 224: + WorldGen.TileMergeAttempt(-2, 147, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + break; + case 162: + WorldGen.TileMergeAttempt(-2, TileID.Sets.IcesSnow, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + break; + case 189: + WorldGen.TileMergeAttemptFrametest(i, j, index1, 196, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + break; + case 191: + WorldGen.TileMergeAttempt(-2, 192, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + WorldGen.TileMergeAttempt(index1, 0, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + break; + case 192: + WorldGen.TileMergeAttemptFrametest(i, j, index1, 191, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + break; + case 196: + WorldGen.TileMergeAttempt(-2, 189, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + break; case 211: WorldGen.TileMergeAttempt(59, 60, ref up, ref down, ref left, ref right); WorldGen.TileMergeAttempt(-2, 59, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); break; - default: - if (index1 == 225 || index1 == 226) + case 225: + case 226: + WorldGen.TileMergeAttempt(-2, 59, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + break; + case 352: + if (down == 199) { - WorldGen.TileMergeAttempt(-2, 59, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + down = index1; break; } - switch (index1) - { - case 60: - WorldGen.TileMergeAttempt(59, 211, ref up, ref down, ref left, ref right); - break; - case 147: - WorldGen.TileMergeAttemptFrametest(i, j, index1, TileID.Sets.IcesSlush, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - break; - case 189: - WorldGen.TileMergeAttemptFrametest(i, j, index1, TileID.Sets.MergesWithClouds, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - break; - case 196: - WorldGen.TileMergeAttempt(-2, 189, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - WorldGen.TileMergeAttempt(index1, 460, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - break; - case 460: - WorldGen.TileMergeAttempt(-2, 189, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - WorldGen.TileMergeAttempt(index1, 196, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - break; - default: - if (index1 == 161 || index1 == 163 || index1 == 164 || index1 == 200 || index1 == 224) - { - WorldGen.TileMergeAttempt(-2, 147, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - break; - } - if (index1 == 162) - { - WorldGen.TileMergeAttempt(-2, TileID.Sets.IcesSnow, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - break; - } - if (index1 == 32) - { - if (down == 23) - { - down = index1; - break; - } - break; - } - if (index1 == 352) - { - if (down == 199) - { - down = index1; - break; - } - break; - } - if (index1 == 69) - { - if (down == 60) - { - down = index1; - break; - } - break; - } - if (index1 == 51) - { - WorldGen.TileMergeAttempt(index1, TileID.Sets.AllTiles, Main.tileNoAttach, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - break; - } - if (index1 == 192) - { - WorldGen.TileMergeAttemptFrametest(i, j, index1, 191, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - break; - } - if (index1 == 191) - { - WorldGen.TileMergeAttempt(-2, 192, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - WorldGen.TileMergeAttempt(index1, 0, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - break; - } - if (index1 == 384) - { - WorldGen.TileMergeAttemptFrametest(i, j, index1, 383, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - break; - } - if (index1 == 383) - { - WorldGen.TileMergeAttempt(-2, 384, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - WorldGen.TileMergeAttempt(index1, 59, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - break; - } - if (index1 == 407) - { - WorldGen.TileMergeAttempt(-2, 404, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - break; - } - if (index1 == 404) - { - WorldGen.TileMergeAttempt(-2, 396, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - WorldGen.TileMergeAttemptFrametest(i, j, index1, 407, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - break; - } - if (index1 == 397) - { - WorldGen.TileMergeAttempt(-2, 53, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - WorldGen.TileMergeAttemptFrametest(i, j, index1, 396, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - break; - } - if (index1 == 396) - { - WorldGen.TileMergeAttempt(-2, 397, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - WorldGen.TileMergeAttempt(-2, 53, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - WorldGen.TileMergeAttemptFrametest(i, j, index1, 404, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - break; - } - if (index1 == 398) - { - WorldGen.TileMergeAttempt(-2, 112, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - WorldGen.TileMergeAttemptFrametest(i, j, index1, 400, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - break; - } - if (index1 == 400) - { - WorldGen.TileMergeAttempt(-2, 398, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - WorldGen.TileMergeAttempt(-2, 112, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - break; - } - if (index1 == 399) - { - WorldGen.TileMergeAttempt(-2, 234, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - WorldGen.TileMergeAttemptFrametest(i, j, index1, 401, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - break; - } - if (index1 == 401) - { - WorldGen.TileMergeAttempt(-2, 399, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - WorldGen.TileMergeAttempt(-2, 234, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - break; - } - if (index1 == 402) - { - WorldGen.TileMergeAttempt(-2, 116, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - WorldGen.TileMergeAttemptFrametest(i, j, index1, 403, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - break; - } - if (index1 == 403) - { - WorldGen.TileMergeAttempt(-2, 402, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - WorldGen.TileMergeAttempt(-2, 116, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - break; - } - break; - } + break; + case 383: + WorldGen.TileMergeAttempt(-2, 384, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + WorldGen.TileMergeAttempt(index1, 59, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + break; + case 384: + WorldGen.TileMergeAttemptFrametest(i, j, index1, 383, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + break; + case 396: + WorldGen.TileMergeAttempt(-2, 397, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + WorldGen.TileMergeAttempt(-2, 53, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + WorldGen.TileMergeAttemptFrametest(i, j, index1, 404, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + break; + case 397: + WorldGen.TileMergeAttempt(-2, 53, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + WorldGen.TileMergeAttemptFrametest(i, j, index1, 396, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + break; + case 398: + WorldGen.TileMergeAttempt(-2, 112, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + WorldGen.TileMergeAttemptFrametest(i, j, index1, 400, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + break; + case 399: + WorldGen.TileMergeAttempt(-2, 234, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + WorldGen.TileMergeAttemptFrametest(i, j, index1, 401, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + break; + case 400: + WorldGen.TileMergeAttempt(-2, 398, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + WorldGen.TileMergeAttempt(-2, 112, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + break; + case 401: + WorldGen.TileMergeAttempt(-2, 399, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + WorldGen.TileMergeAttempt(-2, 234, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + break; + case 402: + WorldGen.TileMergeAttempt(-2, 116, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + WorldGen.TileMergeAttemptFrametest(i, j, index1, 403, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + break; + case 403: + WorldGen.TileMergeAttempt(-2, 402, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + WorldGen.TileMergeAttempt(-2, 116, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + break; + case 404: + WorldGen.TileMergeAttempt(-2, 396, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + WorldGen.TileMergeAttemptFrametest(i, j, index1, 407, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + break; + case 407: + WorldGen.TileMergeAttempt(-2, 404, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); break; } } - if (index1 == 0) - { + if (Main.tileStone[index1] || index1 == 1) WorldGen.TileMergeAttempt(index1, Main.tileMoss, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - WorldGen.TileMergeAttempt(index1, TileID.Sets.tileMossBrick, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - } - else if (Main.tileMoss[index1] || TileID.Sets.tileMossBrick[index1]) + bool flag8 = false; + if (up == -2 && (int) centerTile.color() != (int) tile59.color()) { - WorldGen.TileMergeAttempt(index1, 0, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + up = index1; + WorldGen.mergeUp = true; } - else + if (down == -2 && (int) centerTile.color() != (int) tile60.color()) { - if (!Main.tileStone[index1]) - { - switch (index1) - { - case 1: - break; - case 38: - WorldGen.TileMergeAttempt(index1, TileID.Sets.tileMossBrick, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - goto label_576; - default: - goto label_576; - } - } - WorldGen.TileMergeAttempt(index1, Main.tileMoss, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + down = index1; + WorldGen.mergeDown = true; } -label_576: - if (TileID.Sets.Conversion.Grass[index1]) - WorldGen.TileMergeAttempt(index1, TileID.Sets.Ore, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - else if (TileID.Sets.Ore[index1]) - WorldGen.TileMergeAttempt(index1, TileID.Sets.Conversion.Grass, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - if (index1 == 59) - WorldGen.TileMergeAttempt(index1, TileID.Sets.OreMergesWithMud, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - else if (TileID.Sets.OreMergesWithMud[index1]) - WorldGen.TileMergeAttempt(index1, 59, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - bool flag1 = false; - if (index1 == 2 || index1 == 23 || index1 == 60 || index1 == 477 || index1 == 492 || index1 == 70 || index1 == 109 || index1 == 199 || Main.tileMoss[index1] || TileID.Sets.NeedsGrassFraming[index1] || TileID.Sets.tileMossBrick[index1]) + if (left == -2 && (int) centerTile.color() != (int) tile61.color()) { - flag1 = true; + left = index1; + WorldGen.mergeLeft = true; + } + if (right == -2 && (int) centerTile.color() != (int) tile62.color()) + { + right = index1; + WorldGen.mergeRight = true; + } + if (index1 == 2 || index1 == 23 || index1 == 60 || index1 == 70 || index1 == 109 || index1 == 199 || Main.tileMoss[index1] || TileID.Sets.NeedsGrassFraming[index1]) + { + flag8 = true; WorldGen.TileMergeAttemptWeird(index1, -1, Main.tileSolid, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - int num8 = TileID.Sets.NeedsGrassFramingDirt[index1]; + int num23 = TileID.Sets.NeedsGrassFramingDirt[index1]; if (index1 == 60 || index1 == 70) - num8 = 59; + num23 = 59; else if (Main.tileMoss[index1]) - num8 = 1; - else if (TileID.Sets.tileMossBrick[index1]) { - num8 = 38; + num23 = 1; } else { switch (index1) { case 2: - case 477: - WorldGen.TileMergeAttempt(num8, 23, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + WorldGen.TileMergeAttempt(num23, 23, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); break; case 23: - WorldGen.TileMergeAttempt(num8, 2, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + WorldGen.TileMergeAttempt(num23, 2, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); break; } } - if (up != index1 && up != num8 && (down == index1 || down == num8)) + if (up != index1 && up != num23 && (down == index1 || down == num23)) { - if (left == num8 && right == index1) + if (left == num23 && right == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 0; @@ -50893,9 +37730,9 @@ label_576: break; } } - else if (left == index1 && right == num8) + else if (left == index1 && right == num23) { - switch (num7) + switch (num22) { case 0: rectangle.X = 54; @@ -50912,11 +37749,11 @@ label_576: } } } - else if (down != index1 && down != num8 && (up == index1 || up == num8)) + else if (down != index1 && down != num23 && (up == index1 || up == num23)) { - if (left == num8 && right == index1) + if (left == num23 && right == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 0; @@ -50932,9 +37769,9 @@ label_576: break; } } - else if (left == index1 && right == num8) + else if (left == index1 && right == num23) { - switch (num7) + switch (num22) { case 0: rectangle.X = 54; @@ -50951,11 +37788,11 @@ label_576: } } } - else if (left != index1 && left != num8 && (right == index1 || right == num8)) + else if (left != index1 && left != num23 && (right == index1 || right == num23)) { - if (up == num8 && down == index1) + if (up == num23 && down == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 72; @@ -50971,9 +37808,9 @@ label_576: break; } } - else if (down == index1 && up == num8) + else if (down == index1 && up == num23) { - switch (num7) + switch (num22) { case 0: rectangle.X = 72; @@ -50990,11 +37827,11 @@ label_576: } } } - else if (right != index1 && right != num8 && (left == index1 || left == num8)) + else if (right != index1 && right != num23 && (left == index1 || left == num23)) { - if (up == num8 && down == index1) + if (up == num23 && down == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 90; @@ -51012,7 +37849,7 @@ label_576: } else if (down == index1 && right == up) { - switch (num7) + switch (num22) { case 0: rectangle.X = 90; @@ -51033,9 +37870,9 @@ label_576: { if (upLeft != index1 && upRight != index1 && downLeft != index1 && downRight != index1) { - if (downRight == num8) + if (downRight == num23) { - switch (num7) + switch (num22) { case 0: rectangle.X = 108; @@ -51051,9 +37888,9 @@ label_576: break; } } - else if (upRight == num8) + else if (upRight == num23) { - switch (num7) + switch (num22) { case 0: rectangle.X = 108; @@ -51069,9 +37906,9 @@ label_576: break; } } - else if (downLeft == num8) + else if (downLeft == num23) { - switch (num7) + switch (num22) { case 0: rectangle.X = 108; @@ -51087,9 +37924,9 @@ label_576: break; } } - else if (upLeft == num8) + else if (upLeft == num23) { - switch (num7) + switch (num22) { case 0: rectangle.X = 108; @@ -51107,7 +37944,7 @@ label_576: } else { - switch (num7) + switch (num22) { case 0: rectangle.X = 144; @@ -51126,7 +37963,7 @@ label_576: } else if (upLeft != index1 && downRight != index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 36; @@ -51144,7 +37981,7 @@ label_576: } else if (upRight != index1 && downLeft != index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 90; @@ -51162,7 +37999,7 @@ label_576: } else if (upLeft != index1 && upRight == index1 && downLeft == index1 && downRight == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 54; @@ -51180,7 +38017,7 @@ label_576: } else if (upLeft == index1 && upRight != index1 && downLeft == index1 && downRight == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 36; @@ -51198,7 +38035,7 @@ label_576: } else if (upLeft == index1 && upRight == index1 && downLeft != index1 && downRight == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 54; @@ -51216,7 +38053,7 @@ label_576: } else if (upLeft == index1 && upRight == index1 && downLeft == index1 && downRight != index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 36; @@ -51233,9 +38070,9 @@ label_576: } } } - else if (up == index1 && down == num8 && left == index1 && right == index1 && upLeft == -1 && upRight == -1) + else if (up == index1 && down == num23 && left == index1 && right == index1 && upLeft == -1 && upRight == -1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 108; @@ -51251,9 +38088,9 @@ label_576: break; } } - else if (up == num8 && down == index1 && left == index1 && right == index1 && downLeft == -1 && downRight == -1) + else if (up == num23 && down == index1 && left == index1 && right == index1 && downLeft == -1 && downRight == -1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 108; @@ -51269,9 +38106,9 @@ label_576: break; } } - else if (up == index1 && down == index1 && left == num8 && right == index1 && upRight == -1 && downRight == -1) + else if (up == index1 && down == index1 && left == num23 && right == index1 && upRight == -1 && downRight == -1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 198; @@ -51287,9 +38124,9 @@ label_576: break; } } - else if (up == index1 && down == index1 && left == index1 && right == num8 && upLeft == -1 && downLeft == -1) + else if (up == index1 && down == index1 && left == index1 && right == num23 && upLeft == -1 && downLeft == -1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 180; @@ -51305,11 +38142,11 @@ label_576: break; } } - else if (up == index1 && down == num8 && left == index1 && right == index1) + else if (up == index1 && down == num23 && left == index1 && right == index1) { if (upRight != -1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 54; @@ -51327,7 +38164,7 @@ label_576: } else if (upLeft != -1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 36; @@ -51344,11 +38181,11 @@ label_576: } } } - else if (up == num8 && down == index1 && left == index1 && right == index1) + else if (up == num23 && down == index1 && left == index1 && right == index1) { if (downRight != -1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 54; @@ -51366,7 +38203,7 @@ label_576: } else if (downLeft != -1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 36; @@ -51383,11 +38220,11 @@ label_576: } } } - else if (up == index1 && down == index1 && left == index1 && right == num8) + else if (up == index1 && down == index1 && left == index1 && right == num23) { if (upLeft != -1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 54; @@ -51405,7 +38242,7 @@ label_576: } else if (downLeft != -1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 54; @@ -51422,11 +38259,11 @@ label_576: } } } - else if (up == index1 && down == index1 && left == num8 && right == index1) + else if (up == index1 && down == index1 && left == num23 && right == index1) { if (upRight != -1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 36; @@ -51444,7 +38281,7 @@ label_576: } else if (downRight != -1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 36; @@ -51461,9 +38298,9 @@ label_576: } } } - else if (up == num8 && down == index1 && left == index1 && right == index1 || up == index1 && down == num8 && left == index1 && right == index1 || up == index1 && down == index1 && left == num8 && right == index1 || up == index1 && down == index1 && left == index1 && right == num8) + else if (up == num23 && down == index1 && left == index1 && right == index1 || up == index1 && down == num23 && left == index1 && right == index1 || up == index1 && down == index1 && left == num23 && right == index1 || up == index1 && down == index1 && left == index1 && right == num23) { - switch (num7) + switch (num22) { case 0: rectangle.X = 18; @@ -51479,11 +38316,11 @@ label_576: break; } } - if ((up == index1 || up == num8) && (down == index1 || down == num8) && (left == index1 || left == num8) && (right == index1 || right == num8)) + if ((up == index1 || up == num23) && (down == index1 || down == num23) && (left == index1 || left == num23) && (right == index1 || right == num23)) { - if (upLeft != index1 && upLeft != num8 && (upRight == index1 || upRight == num8) && (downLeft == index1 || downLeft == num8) && (downRight == index1 || downRight == num8)) + if (upLeft != index1 && upLeft != num23 && (upRight == index1 || upRight == num23) && (downLeft == index1 || downLeft == num23) && (downRight == index1 || downRight == num23)) { - switch (num7) + switch (num22) { case 0: rectangle.X = 54; @@ -51499,9 +38336,9 @@ label_576: break; } } - else if (upRight != index1 && upRight != num8 && (upLeft == index1 || upLeft == num8) && (downLeft == index1 || downLeft == num8) && (downRight == index1 || downRight == num8)) + else if (upRight != index1 && upRight != num23 && (upLeft == index1 || upLeft == num23) && (downLeft == index1 || downLeft == num23) && (downRight == index1 || downRight == num23)) { - switch (num7) + switch (num22) { case 0: rectangle.X = 36; @@ -51517,9 +38354,9 @@ label_576: break; } } - else if (downLeft != index1 && downLeft != num8 && (upLeft == index1 || upLeft == num8) && (upRight == index1 || upRight == num8) && (downRight == index1 || downRight == num8)) + else if (downLeft != index1 && downLeft != num23 && (upLeft == index1 || upLeft == num23) && (upRight == index1 || upRight == num23) && (downRight == index1 || downRight == num23)) { - switch (num7) + switch (num22) { case 0: rectangle.X = 54; @@ -51535,9 +38372,9 @@ label_576: break; } } - else if (downRight != index1 && downRight != num8 && (upLeft == index1 || upLeft == num8) && (downLeft == index1 || downLeft == num8) && (upRight == index1 || upRight == num8)) + else if (downRight != index1 && downRight != num23 && (upLeft == index1 || upLeft == num23) && (downLeft == index1 || downLeft == num23) && (upRight == index1 || upRight == num23)) { - switch (num7) + switch (num22) { case 0: rectangle.X = 36; @@ -51554,9 +38391,9 @@ label_576: } } } - if (up != num8 && up != index1 && down == index1 && left != num8 && left != index1 && right == index1 && downRight != num8 && downRight != index1) + if (up != num23 && up != index1 && down == index1 && left != num23 && left != index1 && right == index1 && downRight != num23 && downRight != index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 90; @@ -51572,9 +38409,9 @@ label_576: break; } } - else if (up != num8 && up != index1 && down == index1 && left == index1 && right != num8 && right != index1 && downLeft != num8 && downLeft != index1) + else if (up != num23 && up != index1 && down == index1 && left == index1 && right != num23 && right != index1 && downLeft != num23 && downLeft != index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 144; @@ -51590,9 +38427,9 @@ label_576: break; } } - else if (down != num8 && down != index1 && up == index1 && left != num8 && left != index1 && right == index1 && upRight != num8 && upRight != index1) + else if (down != num23 && down != index1 && up == index1 && left != num23 && left != index1 && right == index1 && upRight != num23 && upRight != index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 90; @@ -51608,9 +38445,9 @@ label_576: break; } } - else if (down != num8 && down != index1 && up == index1 && left == index1 && right != num8 && right != index1 && upLeft != num8 && upLeft != index1) + else if (down != num23 && down != index1 && up == index1 && left == index1 && right != num23 && right != index1 && upLeft != num23 && upLeft != index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 144; @@ -51626,9 +38463,9 @@ label_576: break; } } - else if (up != index1 && up != num8 && down == index1 && left == index1 && right == index1 && downLeft != index1 && downLeft != num8 && downRight != index1 && downRight != num8) + else if (up != index1 && up != num23 && down == index1 && left == index1 && right == index1 && downLeft != index1 && downLeft != num23 && downRight != index1 && downRight != num23) { - switch (num7) + switch (num22) { case 0: rectangle.X = 144; @@ -51644,9 +38481,9 @@ label_576: break; } } - else if (down != index1 && down != num8 && up == index1 && left == index1 && right == index1 && upLeft != index1 && upLeft != num8 && upRight != index1 && upRight != num8) + else if (down != index1 && down != num23 && up == index1 && left == index1 && right == index1 && upLeft != index1 && upLeft != num23 && upRight != index1 && upRight != num23) { - switch (num7) + switch (num22) { case 0: rectangle.X = 144; @@ -51662,9 +38499,9 @@ label_576: break; } } - else if (left != index1 && left != num8 && down == index1 && up == index1 && right == index1 && upRight != index1 && upRight != num8 && downRight != index1 && downRight != num8) + else if (left != index1 && left != num23 && down == index1 && up == index1 && right == index1 && upRight != index1 && upRight != num23 && downRight != index1 && downRight != num23) { - switch (num7) + switch (num22) { case 0: rectangle.X = 126; @@ -51680,9 +38517,9 @@ label_576: break; } } - else if (right != index1 && right != num8 && down == index1 && up == index1 && left == index1 && upLeft != index1 && upLeft != num8 && downLeft != index1 && downLeft != num8) + else if (right != index1 && right != num23 && down == index1 && up == index1 && left == index1 && upLeft != index1 && upLeft != num23 && downLeft != index1 && downLeft != num23) { - switch (num7) + switch (num22) { case 0: rectangle.X = 162; @@ -51698,9 +38535,9 @@ label_576: break; } } - else if (up != num8 && up != index1 && (down == num8 || down == index1) && left == num8 && right == num8) + else if (up != num23 && up != index1 && (down == num23 || down == index1) && left == num23 && right == num23) { - switch (num7) + switch (num22) { case 0: rectangle.X = 36; @@ -51716,9 +38553,9 @@ label_576: break; } } - else if (down != num8 && down != index1 && (up == num8 || up == index1) && left == num8 && right == num8) + else if (down != num23 && down != index1 && (up == num23 || up == index1) && left == num23 && right == num23) { - switch (num7) + switch (num22) { case 0: rectangle.X = 36; @@ -51734,9 +38571,9 @@ label_576: break; } } - else if (left != num8 && left != index1 && (right == num8 || right == index1) && up == num8 && down == num8) + else if (left != num23 && left != index1 && (right == num23 || right == index1) && up == num23 && down == num23) { - switch (num7) + switch (num22) { case 0: rectangle.X = 0; @@ -51752,9 +38589,9 @@ label_576: break; } } - else if (right != num8 && right != index1 && (left == num8 || left == index1) && up == num8 && down == num8) + else if (right != num23 && right != index1 && (left == num23 || left == index1) && up == num23 && down == num23) { - switch (num7) + switch (num22) { case 0: rectangle.X = 18; @@ -51770,9 +38607,9 @@ label_576: break; } } - else if (up == index1 && down == num8 && left == num8 && right == num8) + else if (up == index1 && down == num23 && left == num23 && right == num23) { - switch (num7) + switch (num22) { case 0: rectangle.X = 198; @@ -51788,9 +38625,9 @@ label_576: break; } } - else if (up == num8 && down == index1 && left == num8 && right == num8) + else if (up == num23 && down == index1 && left == num23 && right == num23) { - switch (num7) + switch (num22) { case 0: rectangle.X = 198; @@ -51806,9 +38643,9 @@ label_576: break; } } - else if (up == num8 && down == num8 && left == index1 && right == num8) + else if (up == num23 && down == num23 && left == index1 && right == num23) { - switch (num7) + switch (num22) { case 0: rectangle.X = 198; @@ -51824,9 +38661,9 @@ label_576: break; } } - else if (up == num8 && down == num8 && left == num8 && right == index1) + else if (up == num23 && down == num23 && left == num23 && right == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 144; @@ -51842,11 +38679,11 @@ label_576: break; } } - if (up != index1 && up != num8 && down == index1 && left == index1 && right == index1) + if (up != index1 && up != num23 && down == index1 && left == index1 && right == index1) { - if ((downLeft == num8 || downLeft == index1) && downRight != num8 && downRight != index1) + if ((downLeft == num23 || downLeft == index1) && downRight != num23 && downRight != index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 0; @@ -51862,9 +38699,9 @@ label_576: break; } } - else if ((downRight == num8 || downRight == index1) && downLeft != num8 && downLeft != index1) + else if ((downRight == num23 || downRight == index1) && downLeft != num23 && downLeft != index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 54; @@ -51881,11 +38718,11 @@ label_576: } } } - else if (down != index1 && down != num8 && up == index1 && left == index1 && right == index1) + else if (down != index1 && down != num23 && up == index1 && left == index1 && right == index1) { - if ((upLeft == num8 || upLeft == index1) && upRight != num8 && upRight != index1) + if ((upLeft == num23 || upLeft == index1) && upRight != num23 && upRight != index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 0; @@ -51901,9 +38738,9 @@ label_576: break; } } - else if ((upRight == num8 || upRight == index1) && upLeft != num8 && upLeft != index1) + else if ((upRight == num23 || upRight == index1) && upLeft != num23 && upLeft != index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 54; @@ -51920,11 +38757,11 @@ label_576: } } } - else if (left != index1 && left != num8 && up == index1 && down == index1 && right == index1) + else if (left != index1 && left != num23 && up == index1 && down == index1 && right == index1) { - if ((upRight == num8 || upRight == index1) && downRight != num8 && downRight != index1) + if ((upRight == num23 || upRight == index1) && downRight != num23 && downRight != index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 54; @@ -51940,9 +38777,9 @@ label_576: break; } } - else if ((downRight == num8 || downRight == index1) && upRight != num8 && upRight != index1) + else if ((downRight == num23 || downRight == index1) && upRight != num23 && upRight != index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 0; @@ -51959,11 +38796,11 @@ label_576: } } } - else if (right != index1 && right != num8 && up == index1 && down == index1 && left == index1) + else if (right != index1 && right != num23 && up == index1 && down == index1 && left == index1) { - if ((upLeft == num8 || upLeft == index1) && downLeft != num8 && downLeft != index1) + if ((upLeft == num23 || upLeft == index1) && downLeft != num23 && downLeft != index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 0; @@ -51979,9 +38816,9 @@ label_576: break; } } - else if ((downLeft == num8 || downLeft == index1) && upLeft != num8 && upLeft != index1) + else if ((downLeft == num23 || downLeft == index1) && upLeft != num23 && upLeft != index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 54; @@ -51998,11 +38835,11 @@ label_576: } } } - if ((up == index1 || up == num8) && (down == index1 || down == num8) && (left == index1 || left == num8) && (right == index1 || right == num8) && upLeft != -1 && upRight != -1 && downLeft != -1 && downRight != -1) + if ((up == index1 || up == num23) && (down == index1 || down == num23) && (left == index1 || left == num23) && (right == index1 || right == num23) && upLeft != -1 && upRight != -1 && downLeft != -1 && downRight != -1) { if ((i + j) % 2 == 1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 108; @@ -52020,7 +38857,7 @@ label_576: } else { - switch (num7) + switch (num22) { case 0: rectangle.X = 18; @@ -52037,14 +38874,14 @@ label_576: } } } - WorldGen.TileMergeAttempt(-2, num8, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); + WorldGen.TileMergeAttempt(-2, num23, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); } WorldGen.TileMergeAttempt(index1, Main.tileMerge[index1], ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); if (rectangle.X == -1 && rectangle.Y == -1 && (Main.tileMergeDirt[index1] || index1 > -1 && TileID.Sets.ChecksForMerge[index1])) { - if (!flag1) + if (!flag8) { - flag1 = true; + flag8 = true; WorldGen.TileMergeAttemptWeird(index1, -1, Main.tileSolid, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); } if (up > -1 && up != index1) @@ -52059,7 +38896,7 @@ label_576: { if (up == -2 && down == index1 && left == index1 && right == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 144; @@ -52078,7 +38915,7 @@ label_576: } else if (up == index1 && down == -2 && left == index1 && right == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 144; @@ -52097,7 +38934,7 @@ label_576: } else if (up == index1 && down == index1 && left == -2 && right == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 162; @@ -52116,7 +38953,7 @@ label_576: } else if (up == index1 && down == index1 && left == index1 && right == -2) { - switch (num7) + switch (num22) { case 0: rectangle.X = 144; @@ -52135,7 +38972,7 @@ label_576: } else if (up == -2 && down == index1 && left == -2 && right == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 36; @@ -52155,7 +38992,7 @@ label_576: } else if (up == -2 && down == index1 && left == index1 && right == -2) { - switch (num7) + switch (num22) { case 0: rectangle.X = 54; @@ -52175,7 +39012,7 @@ label_576: } else if (up == index1 && down == -2 && left == -2 && right == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 36; @@ -52195,7 +39032,7 @@ label_576: } else if (up == index1 && down == -2 && left == index1 && right == -2) { - switch (num7) + switch (num22) { case 0: rectangle.X = 54; @@ -52215,7 +39052,7 @@ label_576: } else if (up == index1 && down == index1 && left == -2 && right == -2) { - switch (num7) + switch (num22) { case 0: rectangle.X = 180; @@ -52235,7 +39072,7 @@ label_576: } else if (up == -2 && down == -2 && left == index1 && right == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 144; @@ -52255,7 +39092,7 @@ label_576: } else if (up == -2 && down == index1 && left == -2 && right == -2) { - switch (num7) + switch (num22) { case 0: rectangle.X = 198; @@ -52276,7 +39113,7 @@ label_576: } else if (up == index1 && down == -2 && left == -2 && right == -2) { - switch (num7) + switch (num22) { case 0: rectangle.X = 198; @@ -52297,7 +39134,7 @@ label_576: } else if (up == -2 && down == -2 && left == index1 && right == -2) { - switch (num7) + switch (num22) { case 0: rectangle.X = 216; @@ -52318,7 +39155,7 @@ label_576: } else if (up == -2 && down == -2 && left == -2 && right == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 216; @@ -52339,7 +39176,7 @@ label_576: } else if (up == -2 && down == -2 && left == -2 && right == -2) { - switch (num7) + switch (num22) { case 0: rectangle.X = 108; @@ -52363,7 +39200,7 @@ label_576: { if (upLeft == -2) { - switch (num7) + switch (num22) { case 0: rectangle.X = 18; @@ -52381,7 +39218,7 @@ label_576: } if (upRight == -2) { - switch (num7) + switch (num22) { case 0: rectangle.X = 0; @@ -52399,7 +39236,7 @@ label_576: } if (downLeft == -2) { - switch (num7) + switch (num22) { case 0: rectangle.X = 18; @@ -52417,7 +39254,7 @@ label_576: } if (downRight == -2) { - switch (num7) + switch (num22) { case 0: rectangle.X = 0; @@ -52437,11 +39274,11 @@ label_576: } else { - if (index1 != 2 && index1 != 23 && index1 != 60 && index1 != 70 && index1 != 109 && index1 != 199 && index1 != 477 && index1 != 492) + if (index1 != 2 && index1 != 23 && index1 != 60 && index1 != 70 && index1 != 109 && index1 != 199) { if (up == -1 && down == -2 && left == index1 && right == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 234; @@ -52460,7 +39297,7 @@ label_576: } else if (up == -2 && down == -1 && left == index1 && right == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 234; @@ -52479,7 +39316,7 @@ label_576: } else if (up == index1 && down == index1 && left == -1 && right == -2) { - switch (num7) + switch (num22) { case 0: rectangle.X = 234; @@ -52498,7 +39335,7 @@ label_576: } else if (up == index1 && down == index1 && left == -2 && right == -1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 234; @@ -52520,7 +39357,7 @@ label_576: { if (up == -2 && down == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 72; @@ -52539,7 +39376,7 @@ label_576: } else if (down == -2 && up == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 72; @@ -52561,7 +39398,7 @@ label_576: { if (up == -2 && down == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 90; @@ -52580,7 +39417,7 @@ label_576: } else if (down == -2 && up == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 90; @@ -52602,7 +39439,7 @@ label_576: { if (left == -2 && right == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 0; @@ -52621,7 +39458,7 @@ label_576: } else if (right == -2 && left == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 54; @@ -52643,7 +39480,7 @@ label_576: { if (left == -2 && right == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 0; @@ -52662,7 +39499,7 @@ label_576: } else if (right == -2 && left == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 54; @@ -52684,7 +39521,7 @@ label_576: { if (up == -2 && down == -2) { - switch (num7) + switch (num22) { case 0: rectangle.X = 108; @@ -52704,7 +39541,7 @@ label_576: } else if (up == -2) { - switch (num7) + switch (num22) { case 0: rectangle.X = 126; @@ -52723,7 +39560,7 @@ label_576: } else if (down == -2) { - switch (num7) + switch (num22) { case 0: rectangle.X = 126; @@ -52745,7 +39582,7 @@ label_576: { if (left == -2 && right == -2) { - switch (num7) + switch (num22) { case 0: rectangle.X = 162; @@ -52765,7 +39602,7 @@ label_576: } else if (left == -2) { - switch (num7) + switch (num22) { case 0: rectangle.X = 0; @@ -52784,7 +39621,7 @@ label_576: } else if (right == -2) { - switch (num7) + switch (num22) { case 0: rectangle.X = 54; @@ -52804,7 +39641,7 @@ label_576: } else if (up == -2 && down == -1 && left == -1 && right == -1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 108; @@ -52823,7 +39660,7 @@ label_576: } else if (up == -1 && down == -2 && left == -1 && right == -1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 108; @@ -52842,7 +39679,7 @@ label_576: } else if (up == -1 && down == -1 && left == -2 && right == -1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 0; @@ -52861,7 +39698,7 @@ label_576: } else if (up == -1 && down == -1 && left == -1 && right == -2) { - switch (num7) + switch (num22) { case 0: rectangle.X = 54; @@ -52880,155 +39717,155 @@ label_576: } } } - int num9 = tile1.blockType(); + int num24 = centerTile.blockType(); if (TileID.Sets.HasSlopeFrames[index1]) { - if (num9 == 0) + if (num24 == 0) { - bool flag2 = index1 == up && tileTopCache.topSlope(); - bool flag3 = index1 == left && tile38.leftSlope(); - bool flag4 = index1 == right && tile39.rightSlope(); - bool flag5 = index1 == down && tile37.bottomSlope(); - int num10 = 0; - int num11 = 0; - if (flag2.ToInt() + flag3.ToInt() + flag4.ToInt() + flag5.ToInt() > 2) + bool flag9 = index1 == up && tile59.topSlope(); + bool flag10 = index1 == left && tile61.leftSlope(); + bool flag11 = index1 == right && tile62.rightSlope(); + bool flag12 = index1 == down && tile60.bottomSlope(); + int num25 = 0; + int num26 = 0; + if (flag9.ToInt() + flag10.ToInt() + flag11.ToInt() + flag12.ToInt() > 2) { - int num12 = (tileTopCache.slope() == (byte) 1).ToInt() + (tile39.slope() == (byte) 1).ToInt() + (tile37.slope() == (byte) 4).ToInt() + (tile38.slope() == (byte) 4).ToInt(); - int num13 = (tileTopCache.slope() == (byte) 2).ToInt() + (tile39.slope() == (byte) 3).ToInt() + (tile37.slope() == (byte) 3).ToInt() + (tile38.slope() == (byte) 2).ToInt(); - if (num12 == num13) + int num27 = (tile59.slope() == (byte) 1).ToInt() + (tile62.slope() == (byte) 1).ToInt() + (tile60.slope() == (byte) 4).ToInt() + (tile61.slope() == (byte) 4).ToInt(); + int num28 = (tile59.slope() == (byte) 2).ToInt() + (tile62.slope() == (byte) 3).ToInt() + (tile60.slope() == (byte) 3).ToInt() + (tile61.slope() == (byte) 2).ToInt(); + if (num27 == num28) { - num10 = 2; - num11 = 4; + num25 = 2; + num26 = 4; } - else if (num12 > num13) + else if (num27 > num28) { - int num14 = index1 != upLeft ? 0 : (tile42.slope() == (byte) 0 ? 1 : 0); - bool flag6 = index1 == downRight && tile41.slope() == (byte) 0; - int num15 = flag6 ? 1 : 0; - if ((num14 & num15) != 0) - num11 = 4; - else if (flag6) + int num29 = index1 != upLeft ? 0 : (tile65.slope() == (byte) 0 ? 1 : 0); + bool flag13 = index1 == downRight && tile64.slope() == (byte) 0; + int num30 = flag13 ? 1 : 0; + if ((num29 & num30) != 0) + num26 = 4; + else if (flag13) { - num10 = 6; + num25 = 6; } else { - num10 = 7; - num11 = 1; + num25 = 7; + num26 = 1; } } else { - int num16 = index1 != upRight ? 0 : (tile43.slope() == (byte) 0 ? 1 : 0); - bool flag7 = index1 == downLeft && tile40.slope() == (byte) 0; - int num17 = flag7 ? 1 : 0; - if ((num16 & num17) != 0) + int num31 = index1 != upRight ? 0 : (tile66.slope() == (byte) 0 ? 1 : 0); + bool flag14 = index1 == downLeft && tile63.slope() == (byte) 0; + int num32 = flag14 ? 1 : 0; + if ((num31 & num32) != 0) { - num11 = 4; - num10 = 1; + num26 = 4; + num25 = 1; } - else if (flag7) + else if (flag14) { - num10 = 7; + num25 = 7; } else { - num10 = 6; - num11 = 1; + num25 = 6; + num26 = 1; } } - rectangle.X = (18 + num10) * 18; - rectangle.Y = num11 * 18; + rectangle.X = (18 + num25) * 18; + rectangle.Y = num26 * 18; } else { - if (flag2 & flag3 && index1 == down && index1 == right) - num11 = 2; - else if (flag2 & flag4 && index1 == down && index1 == left) + if (flag9 & flag10 && index1 == down && index1 == right) + num26 = 2; + else if (flag9 & flag11 && index1 == down && index1 == left) { - num10 = 1; - num11 = 2; + num25 = 1; + num26 = 2; } - else if (flag4 & flag5 && index1 == up && index1 == left) + else if (flag11 & flag12 && index1 == up && index1 == left) { - num10 = 1; - num11 = 3; + num25 = 1; + num26 = 3; } - else if (flag5 & flag3 && index1 == up && index1 == right) - num11 = 3; - if (num10 != 0 || num11 != 0) + else if (flag12 & flag10 && index1 == up && index1 == right) + num26 = 3; + if (num25 != 0 || num26 != 0) { - rectangle.X = (18 + num10) * 18; - rectangle.Y = num11 * 18; + rectangle.X = (18 + num25) * 18; + rectangle.Y = num26 * 18; } } } - if (num9 >= 2 && (rectangle.X < 0 || rectangle.Y < 0)) + if (num24 >= 2 && (rectangle.X < 0 || rectangle.Y < 0)) { - int num18 = -1; - int num19 = -1; - int num20 = -1; - int num21 = 0; - int num22 = 0; - switch (num9) + int num33 = -1; + int num34 = -1; + int num35 = -1; + int num36 = 0; + int num37 = 0; + switch (num24) { case 2: - num18 = left; - num19 = down; - num20 = downLeft; - ++num21; + num33 = left; + num34 = down; + num35 = downLeft; + ++num36; break; case 3: - num18 = right; - num19 = down; - num20 = downRight; + num33 = right; + num34 = down; + num35 = downRight; break; case 4: - num18 = left; - num19 = up; - num20 = upLeft; - ++num21; - ++num22; + num33 = left; + num34 = up; + num35 = upLeft; + ++num36; + ++num37; break; case 5: - num18 = right; - num19 = up; - num20 = upRight; - ++num22; + num33 = right; + num34 = up; + num35 = upRight; + ++num37; break; } - if (index1 != num18 || index1 != num19 || index1 != num20) + if (index1 != num33 || index1 != num34 || index1 != num35) { - if (index1 == num18 && index1 == num19) - num21 += 2; - else if (index1 == num18) - num21 += 4; - else if (index1 == num19) + if (index1 == num33 && index1 == num34) + num36 += 2; + else if (index1 == num33) + num36 += 4; + else if (index1 == num34) { - num21 += 4; - num22 += 2; + num36 += 4; + num37 += 2; } else { - num21 += 2; - num22 += 2; + num36 += 2; + num37 += 2; } } - rectangle.X = (18 + num21) * 18; - rectangle.Y = num22 * 18; + rectangle.X = (18 + num36) * 18; + rectangle.Y = num37 * 18; } } if (rectangle.X < 0 || rectangle.Y < 0) { - if (!flag1) + if (!flag8) WorldGen.TileMergeAttemptWeird(index1, -1, Main.tileSolid, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); - if (index1 == 2 || index1 == 23 || index1 == 60 || index1 == 70 || index1 == 109 || index1 == 199 || index1 == 477 || index1 == 492 || Main.tileMoss[index1] || TileID.Sets.tileMossBrick[index1]) + if (index1 == 2 || index1 == 23 || index1 == 60 || index1 == 70 || index1 == 109 || index1 == 199 || Main.tileMoss[index1]) WorldGen.TileMergeAttempt(index1, -2, ref up, ref down, ref left, ref right, ref upLeft, ref upRight, ref downLeft, ref downRight); if (up == index1 && down == index1 && left == index1 && right == index1) { if (upLeft != index1 && upRight != index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 108; @@ -53046,7 +39883,7 @@ label_576: } else if (downLeft != index1 && downRight != index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 108; @@ -53064,7 +39901,7 @@ label_576: } else if (upLeft != index1 && downLeft != index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 180; @@ -53082,7 +39919,7 @@ label_576: } else if (upRight != index1 && downRight != index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 198; @@ -53100,7 +39937,7 @@ label_576: } else { - switch (num7) + switch (num22) { case 0: rectangle.X = 18; @@ -53119,7 +39956,7 @@ label_576: } else if (up != index1 && down == index1 && left == index1 && right == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 18; @@ -53137,7 +39974,7 @@ label_576: } else if (up == index1 && down != index1 && left == index1 && right == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 18; @@ -53155,7 +39992,7 @@ label_576: } else if (up == index1 && down == index1 && left != index1 && right == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 0; @@ -53173,7 +40010,7 @@ label_576: } else if (up == index1 && down == index1 && left == index1 && right != index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 72; @@ -53191,7 +40028,7 @@ label_576: } else if (up != index1 && down == index1 && left != index1 && right == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 0; @@ -53209,7 +40046,7 @@ label_576: } else if (up != index1 && down == index1 && left == index1 && right != index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 18; @@ -53227,7 +40064,7 @@ label_576: } else if (up == index1 && down != index1 && left != index1 && right == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 0; @@ -53245,7 +40082,7 @@ label_576: } else if (up == index1 && down != index1 && left == index1 && right != index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 18; @@ -53263,7 +40100,7 @@ label_576: } else if (up == index1 && down == index1 && left != index1 && right != index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 90; @@ -53281,7 +40118,7 @@ label_576: } else if (up != index1 && down != index1 && left == index1 && right == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 108; @@ -53299,7 +40136,7 @@ label_576: } else if (up != index1 && down == index1 && left != index1 && right != index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 108; @@ -53317,7 +40154,7 @@ label_576: } else if (up == index1 && down != index1 && left != index1 && right != index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 108; @@ -53335,7 +40172,7 @@ label_576: } else if (up != index1 && down != index1 && left != index1 && right == index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 162; @@ -53353,7 +40190,7 @@ label_576: } else if (up != index1 && down != index1 && left == index1 && right != index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 216; @@ -53371,7 +40208,7 @@ label_576: } else if (up != index1 && down != index1 && left != index1 && right != index1) { - switch (num7) + switch (num22) { case 0: rectangle.X = 162; @@ -53390,97 +40227,121 @@ label_576: } if (rectangle.X <= -1 || rectangle.Y <= -1) { - if (num7 <= 0) + if (num22 <= 0) { rectangle.X = 18; rectangle.Y = 18; } - else if (num7 == 1) + else if (num22 == 1) { rectangle.X = 36; rectangle.Y = 18; } - if (num7 >= 2) + if (num22 >= 2) { rectangle.X = 54; rectangle.Y = 18; } } - if (Main.tileLargeFrames[index1] == (byte) 1 && num7 == 3) + if (Main.tileLargeFrames[index1] == (byte) 1 && num22 == 3) rectangle.Y += 90; - if (Main.tileLargeFrames[index1] == (byte) 2 && num7 == 3) - rectangle.Y += 90; - tile1.frameX = (short) rectangle.X; - tile1.frameY = (short) rectangle.Y; - if (TileID.Sets.IsVine[index1]) + centerTile.frameX = (short) rectangle.X; + centerTile.frameY = (short) rectangle.Y; + if (index1 == 52 || index1 == 62 || index1 == 115 || index1 == 205) { - up = tileTopCache == null ? index1 : (tileTopCache.nactive() ? (!tileTopCache.bottomSlope() ? (int) tileTopCache.type : -1) : -1); - if (index1 != up) + up = tile59 == null ? index1 : (tile59.active() ? (!tile59.bottomSlope() ? (int) tile59.type : -1) : -1); + if ((index1 == 52 || index1 == 205) && (up == 109 || up == 115)) { - int num23 = up == 109 ? 1 : (up == 115 ? 1 : 0); - bool flag8 = up == 199 || up == 205; - bool flag9 = up == 2 || up == 52; - bool flag10 = up == 382; - int num24 = up == 70 ? 1 : (up == 528 ? 1 : 0); - ushort num25 = 0; - if (num24 != 0) - num25 = (ushort) 528; - if (num23 != 0) - num25 = (ushort) 115; - if (flag8) - num25 = (ushort) 205; - if (flag9 && index1 != 382) - num25 = (ushort) 52; - if (flag10) - num25 = (ushort) 382; - if (num25 != (ushort) 0 && (int) num25 != index1) - { - tile1.type = num25; - WorldGen.SquareTileFrame(i, j); - return; - } + centerTile.type = (ushort) 115; + WorldGen.SquareTileFrame(i, j); + return; + } + if ((index1 == 115 || index1 == 205) && (up == 2 || up == 52)) + { + centerTile.type = (ushort) 52; + WorldGen.SquareTileFrame(i, j); + return; + } + if ((index1 == 52 || index1 == 115) && (up == 199 || up == 205)) + { + centerTile.type = (ushort) 205; + WorldGen.SquareTileFrame(i, j); + return; } if (up != index1) { - bool flag11 = false; + bool flag15 = false; if (up == -1) - flag11 = true; + flag15 = true; if (index1 == 52 && up != 2 && up != 192) - flag11 = true; - if (index1 == 382 && up != 2 && up != 192) - flag11 = true; + flag15 = true; if (index1 == 62 && up != 60) - flag11 = true; + flag15 = true; if (index1 == 115 && up != 109) - flag11 = true; - if (index1 == 528 && up != 70) - flag11 = true; + flag15 = true; if (index1 == 205 && up != 199) - flag11 = true; - if (flag11) + flag15 = true; + if (flag15) WorldGen.KillTile(i, j); } } - if (!WorldGen.noTileActions && tile1.active() && (index1 == 53 || index1 == 112 || index1 == 116 || index1 == 123 || index1 == 234 || index1 == 224 || index1 == 495 || index1 == 330 || index1 == 331 || index1 == 332 || index1 == 333)) + if (!WorldGen.noTileActions && centerTile.active() && (index1 == 53 || index1 == 112 || index1 == 116 || index1 == 123 || index1 == 234 || index1 == 224 || index1 == 330 || index1 == 331 || index1 == 332 || index1 == 333)) { switch (Main.netMode) { case 0: - if (tile37 != null) + if (tile60 != null && !tile60.active()) { - bool flag12 = false; - if (!Main.tile[i, j + 1].nactive()) - flag12 = true; - else if (!Main.tile[i, j + 2].nactive() && (!Main.tile[i, j + 1].active() || !Main.tileSolid[(int) Main.tile[i, j + 1].type])) - flag12 = true; - if (flag12 && WorldGen.AllowsSandfall(tileTopCache)) + bool flag16 = true; + if (tile59.active() && (TileID.Sets.BasicChest[(int) tile59.type] || TileID.Sets.BasicChestFake[(int) tile59.type] || tile59.type == (ushort) 323 || tile59.type == (ushort) 88)) + flag16 = false; + if (flag16) { - int projType; - int dmg; - WorldGen.GetSandfallProjData(index1, out projType, out dmg); - tile1.ClearTile(); - int index16 = Projectile.NewProjectile((float) (i * 16 + 8), (float) (j * 16 + 8), 0.0f, 0.41f, projType, dmg, 0.0f, Main.myPlayer); - Main.projectile[index16].ai[0] = 1f; + int Damage = 10; + int Type; + switch (index1) + { + case 59: + Type = 39; + break; + case 112: + Type = 56; + break; + case 116: + Type = 67; + break; + case 123: + Type = 71; + break; + case 224: + Type = 179; + break; + case 234: + Type = 241; + break; + case 330: + Type = 411; + Damage = 0; + break; + case 331: + Type = 412; + Damage = 0; + break; + case 332: + Type = 413; + Damage = 0; + break; + case 333: + Type = 414; + Damage = 0; + break; + default: + Type = 31; + break; + } + centerTile.ClearTile(); + int index30 = Projectile.NewProjectile((float) (i * 16 + 8), (float) (j * 16 + 8), 0.0f, 0.41f, Type, Damage, 0.0f, Main.myPlayer); + Main.projectile[index30].ai[0] = 1f; WorldGen.SquareTileFrame(i, j); break; } @@ -53488,47 +40349,93 @@ label_576: } break; case 2: - if (tile37 != null && !tile37.nactive() && WorldGen.AllowsSandfall(tileTopCache)) + if (tile60 != null && !tile60.active()) { - int projType; - int dmg; - WorldGen.GetSandfallProjData(index1, out projType, out dmg); - tile1.ClearTile(); - bool flag13 = false; - for (int index17 = 0; index17 < 1000; ++index17) + bool flag17 = true; + if (tile59.active() && (TileID.Sets.BasicChest[(int) tile59.type] || TileID.Sets.BasicChestFake[(int) tile59.type] || tile59.type == (ushort) 323 || tile59.type == (ushort) 88)) + flag17 = false; + if (flag17) { - if (Main.projectile[index17].active && Main.projectile[index17].owner == Main.myPlayer && Main.projectile[index17].type == projType && Math.Abs(Main.projectile[index17].timeLeft - 3600) < 60 && (double) Main.projectile[index17].Distance(new Vector2((float) (i * 16 + 8), (float) (j * 16 + 10))) < 4.0) + int Damage = 10; + int Type; + switch (index1) { - flag13 = true; - break; + case 59: + Type = 39; + break; + case 112: + Type = 56; + break; + case 116: + Type = 67; + break; + case 123: + Type = 71; + break; + case 224: + Type = 179; + break; + case 234: + Type = 241; + break; + case 330: + Type = 411; + Damage = 0; + break; + case 331: + Type = 412; + Damage = 0; + break; + case 332: + Type = 413; + Damage = 0; + break; + case 333: + Type = 414; + Damage = 0; + break; + default: + Type = 31; + break; } + centerTile.active(false); + bool flag18 = false; + for (int index31 = 0; index31 < 1000; ++index31) + { + if (Main.projectile[index31].active && Main.projectile[index31].owner == Main.myPlayer && Main.projectile[index31].type == Type && Math.Abs(Main.projectile[index31].timeLeft - 3600) < 60 && (double) Main.projectile[index31].Distance(new Vector2((float) (i * 16 + 8), (float) (j * 16 + 10))) < 4.0) + { + flag18 = true; + break; + } + } + if (!flag18) + { + int index32 = Projectile.NewProjectile((float) (i * 16 + 8), (float) (j * 16 + 8), 0.0f, 2.5f, Type, Damage, 0.0f, Main.myPlayer); + Main.projectile[index32].velocity.Y = 0.5f; + Main.projectile[index32].position.Y += 2f; + Main.projectile[index32].netUpdate = true; + } + NetMessage.SendTileSquare(-1, i, j, 1); + WorldGen.SquareTileFrame(i, j); + break; } - if (!flag13) - { - int index18 = Projectile.NewProjectile((float) (i * 16 + 8), (float) (j * 16 + 8), 0.0f, 2.5f, projType, dmg, 0.0f, Main.myPlayer); - Main.projectile[index18].velocity.Y = 0.5f; - Main.projectile[index18].position.Y += 2f; - Main.projectile[index18].netUpdate = true; - } - NetMessage.SendTileSquare(-1, i, j, 1); - WorldGen.SquareTileFrame(i, j); break; } break; } } - if (rectangle.X != frameX) + if (rectangle.X != frameX1) { - if (rectangle.Y != frameY) + if (rectangle.Y != frameY1) { - if (frameX >= 0) + if (frameX1 >= 0) { - if (frameY >= 0) + if (frameY1 >= 0) { ++WorldGen.tileReframeCount; - if (WorldGen.tileReframeCount < 25) + if (WorldGen.tileReframeCount < 55) { - int num26 = WorldGen.mergeUp ? 1 : 0; + int num38 = WorldGen.mergeUp ? 1 : 0; bool mergeDown = WorldGen.mergeDown; bool mergeLeft = WorldGen.mergeLeft; bool mergeRight = WorldGen.mergeRight; @@ -53536,7 +40443,7 @@ label_576: WorldGen.TileFrame(i + 1, j); WorldGen.TileFrame(i, j - 1); WorldGen.TileFrame(i, j + 1); - WorldGen.mergeUp = num26 != 0; + WorldGen.mergeUp = num38 != 0; WorldGen.mergeDown = mergeDown; WorldGen.mergeLeft = mergeLeft; WorldGen.mergeRight = mergeRight; @@ -53562,390 +40469,6 @@ label_576: WorldGen.UpdateMapTile(i, j, addToList); } - public static void CheckTorch(int x, int y) - { - for (int index1 = x - 1; index1 <= x + 1; ++index1) - { - for (int index2 = y - 1; index2 <= y + 1; ++index2) - { - if (Main.tile[index1, index2] == null) - return; - } - } - Tile tile1 = Main.tile[x, y]; - Tile tile2 = Main.tile[x, y - 1]; - Tile tile3 = Main.tile[x, y + 1]; - Tile tile4 = Main.tile[x - 1, y]; - Tile tile5 = Main.tile[x + 1, y]; - Tile tile6 = Main.tile[x - 1, y + 1]; - Tile tile7 = Main.tile[x + 1, y + 1]; - Tile tile8 = Main.tile[x - 1, y - 1]; - Tile tile9 = Main.tile[x + 1, y - 1]; - short num = 0; - if (tile1.frameX >= (short) 66) - num = (short) 66; - int index = -1; - int tree1 = -1; - int tree2 = -1; - int tree3 = -1; - int tree4 = -1; - int tree5 = -1; - int tree6 = -1; - if (tile2 != null && tile2.active() && !tile2.bottomSlope()) - { - int type = (int) tile2.type; - } - if (tile3 != null && tile3.active() && (TileID.Sets.Platforms[(int) tile3.type] && WorldGen.TopEdgeCanBeAttachedTo(x, y + 1) || !tile3.halfBrick() && !tile3.topSlope())) - index = (int) tile3.type; - if (tile4 != null && tile4.active() && (tile4.slope() == (byte) 0 || (int) tile4.slope() % 2 != 1)) - tree1 = (int) tile4.type; - if (tile5 != null && tile5.active() && (tile5.slope() == (byte) 0 || (int) tile5.slope() % 2 != 0)) - tree2 = (int) tile5.type; - if (tile6 != null && tile6.active()) - tree3 = (int) tile6.type; - if (tile7 != null && tile7.active()) - tree4 = (int) tile7.type; - if (tile8 != null && tile8.active()) - tree5 = (int) tile8.type; - if (tile9 != null && tile9.active()) - tree6 = (int) tile9.type; - if (index >= 0 && Main.tileSolid[index] && (!Main.tileNoAttach[index] || TileID.Sets.Platforms[index])) - tile1.frameX = num; - else if (tree1 >= 0 && Main.tileSolid[tree1] && !Main.tileNoAttach[tree1] || tree1 >= 0 && TileID.Sets.IsBeam[tree1] || WorldGen.IsTreeType(tree1) && WorldGen.IsTreeType(tree5) && WorldGen.IsTreeType(tree3)) - tile1.frameX = (short) (22 + (int) num); - else if (tree2 >= 0 && Main.tileSolid[tree2] && !Main.tileNoAttach[tree2] || tree2 >= 0 && TileID.Sets.IsBeam[tree2] || WorldGen.IsTreeType(tree2) && WorldGen.IsTreeType(tree6) && WorldGen.IsTreeType(tree4)) - tile1.frameX = (short) (44 + (int) num); - else if (tile1.wall > (ushort) 0) - tile1.frameX = num; - else - WorldGen.KillTile(x, y); - } - - public static void CheckProjectilePressurePad(int i, int j) - { - bool canUp; - bool canLeft; - bool canRight; - bool canDown; - WorldGen.CheckProjectilePressurePad_GetPossiblePlacementDirections(i, j, out canUp, out canLeft, out canRight, out canDown); - Tile tile = Main.tile[i, j]; - bool flag; - switch ((int) tile.frameX / 22) - { - case 0: - flag = !canDown; - break; - case 1: - flag = !canUp; - break; - case 2: - flag = !canLeft; - break; - case 3: - flag = !canRight; - break; - default: - flag = true; - break; - } - if (!flag) - return; - if (canDown) - tile.frameX = (short) 0; - else if (canUp) - tile.frameX = (short) 22; - else if (canLeft) - tile.frameX = (short) 44; - else if (canRight) - tile.frameX = (short) 66; - else - WorldGen.KillTile(i, j); - } - - private static void CheckProjectilePressurePad_GetPossiblePlacementDirections( - int i, - int j, - out bool canUp, - out bool canLeft, - out bool canRight, - out bool canDown) - { - canUp = false; - canLeft = false; - canRight = false; - canDown = false; - Tile tile1 = Main.tile[i, j]; - Tile tile2 = Main.tile[i, j - 1]; - Tile tile3 = Main.tile[i, j + 1]; - Tile tile4 = Main.tile[i - 1, j]; - Tile tile5 = Main.tile[i + 1, j]; - Tile tile6 = Main.tile[i - 1, j + 1]; - Tile tile7 = Main.tile[i + 1, j + 1]; - Tile tile8 = Main.tile[i - 1, j - 1]; - Tile tile9 = Main.tile[i + 1, j - 1]; - int index1 = -1; - int index2 = -1; - int tree1 = -1; - int tree2 = -1; - int tree3 = -1; - int tree4 = -1; - int tree5 = -1; - int tree6 = -1; - if (tile2 != null && tile2.nactive() && !tile2.bottomSlope()) - index2 = (int) tile2.type; - if (tile3 != null && tile3.nactive() && !tile3.halfBrick() && !tile3.topSlope()) - index1 = (int) tile3.type; - if (tile4 != null && tile4.nactive() && (tile4.slope() == (byte) 0 || (int) tile4.slope() % 2 != 1)) - tree1 = (int) tile4.type; - if (tile5 != null && tile5.nactive() && (tile5.slope() == (byte) 0 || (int) tile5.slope() % 2 != 0)) - tree2 = (int) tile5.type; - if (tile6 != null && tile6.nactive()) - tree3 = (int) tile6.type; - if (tile7 != null && tile7.nactive()) - tree4 = (int) tile7.type; - if (tile8 != null && tile8.nactive()) - tree5 = (int) tile8.type; - if (tile9 != null && tile9.nactive()) - tree6 = (int) tile9.type; - if (index1 >= 0 && Main.tileSolid[index1] && (!Main.tileNoAttach[index1] || TileID.Sets.Platforms[index1]) && (tile3.bottomSlope() || tile3.slope() == (byte) 0) && !tile3.halfBrick()) - canDown = true; - if (index2 >= 0 && Main.tileSolid[index2] && (!Main.tileNoAttach[index2] || TileID.Sets.Platforms[index2] && tile2.halfBrick()) && (tile2.topSlope() || tile2.slope() == (byte) 0 || tile2.halfBrick())) - canUp = true; - if (tree1 >= 0 && Main.tileSolid[tree1] && !Main.tileNoAttach[tree1] && (tile4.leftSlope() || tile4.slope() == (byte) 0) && !tile4.halfBrick() || tree1 >= 0 && TileID.Sets.IsBeam[tree1] || WorldGen.IsTreeType(tree1) && WorldGen.IsTreeType(tree5) && WorldGen.IsTreeType(tree3)) - canLeft = true; - if ((tree2 < 0 || !Main.tileSolid[tree2] || Main.tileNoAttach[tree2] || !tile5.rightSlope() && tile5.slope() != (byte) 0 || tile5.halfBrick()) && (tree2 < 0 || !TileID.Sets.IsBeam[tree2]) && (!WorldGen.IsTreeType(tree2) || !WorldGen.IsTreeType(tree6) || !WorldGen.IsTreeType(tree4))) - return; - canRight = true; - } - - public static bool IsTreeType(int tree) => tree >= 0 && TileID.Sets.IsATreeTrunk[tree]; - - public static int CanPlaceProjectilePressurePad( - int x, - int y, - int type = 442, - int style = 0, - int direction = 0, - int alternate = 0) - { - bool canUp; - bool canLeft; - bool canRight; - bool canDown; - WorldGen.CheckProjectilePressurePad_GetPossiblePlacementDirections(x, y, out canUp, out canLeft, out canRight, out canDown); - if (!canUp && !canDown && !canLeft && !canRight) - return -1; - switch (alternate) - { - case 0: - if (!canDown) - return -1; - break; - case 1: - if (!canUp) - return -1; - break; - case 2: - if (!canLeft) - return -1; - break; - case 3: - if (!canRight) - return -1; - break; - } - return style; - } - - private static void CheckDoorOpen(int i, int j, Tile tileCache) - { - if (WorldGen.destroyObject) - return; - int num1 = 0; - int index = i; - int frameX = (int) tileCache.frameX; - int frameY = (int) tileCache.frameY; - int doorStyle = frameY / 54 + (int) tileCache.frameX / 72 * 36; - int num2 = j - frameY % 54 / 18; - bool flag = false; - switch (frameX % 72) - { - case 0: - index = i; - num1 = 1; - break; - case 18: - index = i - 1; - num1 = 1; - break; - case 36: - index = i + 1; - num1 = -1; - break; - case 54: - index = i; - num1 = -1; - break; - } - Tile testTile1 = Main.tile[index, num2 - 1]; - Tile testTile2 = Main.tile[index, num2 + 3]; - if (testTile1 == null) - { - testTile1 = new Tile(); - Main.tile[index, num2 - 1] = testTile1; - } - if (testTile2 == null) - { - testTile2 = new Tile(); - Main.tile[index, num2 + 3] = testTile2; - } - if (!WorldGen.SolidTile(testTile1) || !WorldGen.SolidTile(testTile2)) - { - flag = true; - WorldGen.destroyObject = true; - WorldGen.DropDoorItem(i, j, doorStyle); - } - int num3 = index; - if (num1 == -1) - num3 = index - 1; - for (int i1 = num3; i1 < num3 + 2; ++i1) - { - for (int j1 = num2; j1 < num2 + 3; ++j1) - { - if (!flag) - { - Tile tile = Main.tile[i1, j1]; - if (!tile.active() || tile.type != (ushort) 11) - { - WorldGen.destroyObject = true; - WorldGen.DropDoorItem(i, j, doorStyle); - flag = true; - i1 = num3; - j1 = num2; - } - } - if (flag) - WorldGen.KillTile(i1, j1); - } - } - WorldGen.destroyObject = false; - } - - private static void CheckDoorClosed(int i, int j, Tile tileCache, int type) - { - if (WorldGen.destroyObject) - return; - bool flag = false; - int frameY = (int) tileCache.frameY; - int doorStyle = frameY / 54 + (int) tileCache.frameX / 54 * 36; - int j1 = j - frameY % 54 / 18; - Tile testTile1 = Main.tile[i, j1 - 1]; - Tile tile1 = Main.tile[i, j1]; - Tile tile2 = Main.tile[i, j1 + 1]; - Tile tile3 = Main.tile[i, j1 + 2]; - Tile testTile2 = Main.tile[i, j1 + 3]; - if (testTile1 == null) - { - testTile1 = new Tile(); - Main.tile[i, j1 - 1] = testTile1; - } - if (tile1 == null) - { - tile1 = new Tile(); - Main.tile[i, j1] = tile1; - } - if (tile2 == null) - { - tile2 = new Tile(); - Main.tile[i, j1 + 1] = tile2; - } - if (tile3 == null) - { - tile3 = new Tile(); - Main.tile[i, j1 + 2] = tile3; - } - if (testTile2 == null) - { - testTile2 = new Tile(); - Main.tile[i, j1 + 3] = testTile2; - } - if (!WorldGen.SolidTile(testTile1)) - flag = true; - if (!WorldGen.SolidTile(testTile2)) - flag = true; - if (!tile1.active() || (int) tile1.type != type) - flag = true; - if (!tile2.active() || (int) tile2.type != type) - flag = true; - if (!tile3.active() || (int) tile3.type != type) - flag = true; - if (flag) - { - WorldGen.destroyObject = true; - WorldGen.KillTile(i, j1); - WorldGen.KillTile(i, j1 + 1); - WorldGen.KillTile(i, j1 + 2); - WorldGen.DropDoorItem(i, j, doorStyle); - } - WorldGen.destroyObject = false; - } - - private static void GetSandfallProjData(int type, out int projType, out int dmg) - { - dmg = 10; - switch (type) - { - case 59: - projType = 39; - break; - case 112: - projType = 56; - break; - case 116: - projType = 67; - break; - case 123: - projType = 71; - break; - case 224: - projType = 179; - break; - case 234: - projType = 241; - break; - case 330: - projType = 411; - dmg = 0; - break; - case 331: - projType = 412; - dmg = 0; - break; - case 332: - projType = 413; - dmg = 0; - break; - case 333: - projType = 414; - dmg = 0; - break; - case 495: - projType = 812; - break; - default: - projType = 31; - break; - } - } - - public static bool AllowsSandfall(Tile tileTopCache) - { - bool flag = true; - if (tileTopCache.active() && (TileID.Sets.BasicChest[(int) tileTopCache.type] || TileID.Sets.BasicChestFake[(int) tileTopCache.type] || tileTopCache.type == (ushort) 323 || tileTopCache.type == (ushort) 88 || tileTopCache.type == (ushort) 80 || tileTopCache.type == (ushort) 77 || tileTopCache.type == (ushort) 26 || tileTopCache.type == (ushort) 475 || tileTopCache.type == (ushort) 470 || tileTopCache.type == (ushort) 597)) - flag = false; - return flag; - } - public static void TriggerLunarApocalypse() { List intList = new List() @@ -54108,96 +40631,28 @@ label_576: { if (Main.netMode != 2) return; - ChatHelper.BroadcastChatMessage(text, color); + NetMessage.BroadcastChatMessage(text, color); } } public static bool CanCutTile(int x, int y, TileCuttingContext context) { - if (Main.tile[x, y + 1] == null || Main.tile[x, y + 1].type == (ushort) 78 || Main.tile[x, y + 1].type == (ushort) 380 || Main.tile[x, y + 1].type == (ushort) 579) + if (Main.tile[x, y + 1] == null || Main.tile[x, y + 1].type == (ushort) 78 || Main.tile[x, y + 1].type == (ushort) 380) return false; - return Main.tile[x, y].type != (ushort) 254 || Main.tile[x, y].frameX >= (short) 144; + return Main.tile[x, y].type != (ushort) 254 || context == TileCuttingContext.TilePlacement; } - public static bool InAPlaceWithWind(Vector2 position, int width, int height) + public class Hooks { - Point tileCoordinates1 = position.ToTileCoordinates(); - Point tileCoordinates2 = (position + new Vector2((float) width, (float) height)).ToTileCoordinates(); - return WorldGen.InAPlaceWithWind(tileCoordinates1.X, tileCoordinates1.Y, 1 + tileCoordinates2.X - tileCoordinates1.X, 1 + tileCoordinates2.Y - tileCoordinates1.Y); - } - - public static bool InAPlaceWithWind(int x, int y, int width, int height) - { - if ((double) y >= Main.worldSurface) - return false; - for (int index1 = 0; index1 < width; ++index1) - { - for (int index2 = 0; index2 < height; ++index2) - { - Tile tile = Main.tile[x + index1, y + index2]; - if (tile == null || tile.liquid > (byte) 0 || tile.wall > (ushort) 0 && !WallID.Sets.AllowsWind[(int) tile.wall]) - return false; - } - } - return true; - } - - public static int[] CountTileTypesInWorld(params int[] oreTypes) - { - int[] numArray = new int[oreTypes.Length]; - for (int index1 = 0; index1 < Main.maxTilesX; ++index1) - { - for (int index2 = 0; index2 < Main.maxTilesY; ++index2) - { - Tile tile = Main.tile[index1, index2]; - if (tile.active()) - { - for (int index3 = 0; index3 < oreTypes.Length; ++index3) - { - if (oreTypes[index3] == (int) tile.type) - { - ++numArray[index3]; - break; - } - } - } - } - } - return numArray; - } - - public static class SavedOreTiers - { - public static int Copper = 7; - public static int Iron = 6; - public static int Silver = 9; - public static int Gold = 8; - public static int Cobalt = 107; - public static int Mythril = 108; - public static int Adamantite = 111; - } - - public static class Hooks - { - public static event WorldGen.Hooks.WorldGenConfigProcessEvent OnWorldGenConfigProcess; - public static event Action OnWorldLoad; - public static void Initialize() + public static void Initialize() => Player.Hooks.OnEnterWorld += (Action) (player => { - Player.Hooks.OnEnterWorld += (Action) (player => - { - if (player.whoAmI != Main.myPlayer) - return; - WorldGen.Hooks.WorldLoaded(); - if (Main.netMode == 1) - return; - Main.FixUIScale(); - }); - WorldGen.Hooks.OnWorldLoad += new Action(WorldGen.mysticLogsEvent.StartWorld); - WorldGen.Hooks.OnWorldLoad += new Action(Main.checkHalloween); - WorldGen.Hooks.OnWorldLoad += new Action(Main.checkXMas); - } + if (player.whoAmI != Main.myPlayer) + return; + WorldGen.Hooks.WorldLoaded(); + Main.FixUIScale(); + }); public static void WorldLoaded() { @@ -54211,27 +40666,16 @@ label_576: PressurePlateHelper.Reset(); WorldGen.TownManager.Clear(); NPC.ResetKillCount(); - Main.instance.ClearCachedTileDraws(); - MapHelper.ResetMapData(); } - - public static void ProcessWorldGenConfig(ref WorldGenConfiguration config) - { - if (WorldGen.Hooks.OnWorldGenConfigProcess == null) - return; - WorldGen.Hooks.OnWorldGenConfigProcess(ref config); - } - - public delegate void WorldGenConfigProcessEvent(ref WorldGenConfiguration config); } - public static class Spread + public class Spread { public static void Wall(int x, int y, int wallType) { if (!WorldGen.InWorld(x, y)) return; - ushort num = (ushort) wallType; + byte num = (byte) wallType; List pointList1 = new List(); List pointList2 = new List(); HashSet pointSet = new HashSet(); @@ -54253,9 +40697,9 @@ label_576: pointSet.Add(point1); pointList1.Remove(point1); Tile tile = Main.tile[point1.X, point1.Y]; - if (WorldGen.SolidTile(point1.X, point1.Y) || tile.wall != (ushort) 0) + if (WorldGen.SolidTile(point1.X, point1.Y) || tile.wall != (byte) 0) { - if (tile.active() && tile.wall == (ushort) 0) + if (tile.active() && tile.wall == (byte) 0) tile.wall = num; } else @@ -54283,7 +40727,7 @@ label_576: { if (!WorldGen.InWorld(x, y)) return; - ushort num1 = (ushort) wallType; + byte num1 = (byte) wallType; int num2 = 0; int maxWallOut2 = WorldGen.maxWallOut2; List pointList1 = new List(); @@ -54307,9 +40751,9 @@ label_576: pointSet.Add(point1); pointList1.Remove(point1); Tile tile = Main.tile[point1.X, point1.Y]; - if (!WorldGen.SolidTile(point1.X, point1.Y) && (int) tile.wall != (int) num1 && tile.wall != (ushort) 4 && tile.wall != (ushort) 40 && tile.wall != (ushort) 3 && tile.wall != (ushort) 87 && tile.wall != (ushort) 34) + if (!WorldGen.SolidTile(point1.X, point1.Y) && (int) tile.wall != (int) num1 && tile.wall != (byte) 4 && tile.wall != (byte) 40 && tile.wall != (byte) 3) { - if (num1 == (ushort) 63 && tile.wall == (ushort) 0) + if (num1 == (byte) 63 && tile.wall == (byte) 0) { pointList1.Remove(point1); } @@ -54335,7 +40779,7 @@ label_576: point2 = new Point(point1.X, point1.Y + 1); if (!pointSet.Contains(point2)) pointList2.Add(point2); - if (num1 == (ushort) 63) + if (num1 == (byte) 63) { point2 = new Point(point1.X - 1, point1.Y - 1); if (!pointSet.Contains(point2)) @@ -54359,7 +40803,7 @@ label_576: } } } - else if (tile.active() && (int) tile.wall != (int) num1 && tile.wall != (ushort) 4 && tile.wall != (ushort) 40 && tile.wall != (ushort) 3 && tile.wall != (ushort) 87 && tile.wall != (ushort) 34) + else if (tile.active() && (int) tile.wall != (int) num1 && tile.wall != (byte) 4 && tile.wall != (byte) 40 && tile.wall != (byte) 3) tile.wall = num1; } } @@ -54370,8 +40814,8 @@ label_576: { if (!WorldGen.InWorld(x, y)) return; - ushort mossWall = WorldGen.mossWall; - ushort mossTile = WorldGen.mossTile; + byte mossWall = WorldGen.mossWall; + ushort mossTile = (ushort) WorldGen.mossTile; List pointList1 = new List(); List pointList2 = new List(); HashSet pointSet = new HashSet(); @@ -54393,11 +40837,11 @@ label_576: pointSet.Add(point1); pointList1.Remove(point1); Tile tile = Main.tile[point1.X, point1.Y]; - if (WorldGen.SolidTile(point1.X, point1.Y) || tile.wall != (ushort) 0) + if (WorldGen.SolidTile(point1.X, point1.Y) || tile.wall != (byte) 0) { if (tile.active()) { - if (tile.wall == (ushort) 0) + if (tile.wall == (byte) 0) tile.wall = mossWall; if (tile.type == (ushort) 1) tile.type = mossTile; @@ -54449,7 +40893,7 @@ label_576: pointSet.Add(point1); pointList1.Remove(point1); Tile tile1 = Main.tile[point1.X, point1.Y]; - if (WorldGen.SolidTile(point1.X, point1.Y) || tile1.wall != (ushort) 0) + if (WorldGen.SolidTile(point1.X, point1.Y) || tile1.wall != (byte) 0) { if (tile1.active()) { @@ -54471,7 +40915,7 @@ label_576: } else { - tile1.wall = (ushort) (48 + WorldGen.randGem()); + tile1.wall = (byte) (48 + WorldGen.randGem()); if (!tile1.active() && WorldGen.genRand.Next(2) == 0) WorldGen.PlaceTile(point1.X, point1.Y, 178, true, style: WorldGen.randGem()); Point point2 = new Point(point1.X - 1, point1.Y); @@ -54518,14 +40962,14 @@ label_576: pointSet.Add(point1); pointList1.Remove(point1); Tile tile = Main.tile[point1.X, point1.Y]; - if (WorldGen.SolidTile(point1.X, point1.Y) || tile.wall != (ushort) 0) + if (WorldGen.SolidTile(point1.X, point1.Y) || tile.wall != (byte) 0) { - if (tile.active() && tile.wall == (ushort) 0) - tile.wall = (ushort) num; + if (tile.active() && tile.wall == (byte) 0) + tile.wall = num; } else { - tile.wall = (ushort) num; + tile.wall = num; WorldGen.SquareWallFrame(point1.X, point1.Y); if (!tile.active()) { @@ -54541,7 +40985,7 @@ label_576: if (!tile.active()) { if (WorldGen.SolidTile(point1.X, point1.Y - 1) && WorldGen.genRand.Next(3) == 0) - WorldGen.PlaceTight(point1.X, point1.Y, true); + WorldGen.PlaceTight(point1.X, point1.Y, spiders: true); else if (WorldGen.SolidTile(point1.X, point1.Y + 1)) { WorldGen.PlaceTile(point1.X, point1.Y, 187, true, style: (9 + WorldGen.genRand.Next(5))); @@ -54577,7 +41021,7 @@ label_576: { if (!WorldGen.InWorld(x, y)) return; - ushort num = (ushort) wallType; + byte num = (byte) wallType; List pointList1 = new List(); List pointList2 = new List(); HashSet pointSet = new HashSet(); @@ -54599,7 +41043,7 @@ label_576: pointSet.Add(point1); pointList1.Remove(point1); Tile tile = Main.tile[point1.X, point1.Y]; - if (!WorldGen.SolidTile(point1.X, point1.Y) && (int) tile.wall != (int) num && tile.wall > (ushort) 0 && tile.wall != (ushort) 244) + if (!WorldGen.SolidTile(point1.X, point1.Y) && (int) tile.wall != (int) num && tile.wall > (byte) 0) { tile.wall = num; Point point2 = new Point(point1.X - 1, point1.Y); @@ -54624,174 +41068,5 @@ label_576: private static bool Gemmable(int type) => type == 0 || type == 1 || type == 40 || type == 59 || type == 60 || type == 70 || type == 147 || type == 161; } - - public struct GrowTreeSettings - { - public ushort TreeTileType; - public int TreeHeightMin; - public int TreeHeightMax; - public int TreeTopPaddingNeeded; - public WorldGen.GrowTreeSettings.IsTileFitForTreeGroundTest GroundTest; - public WorldGen.GrowTreeSettings.IsWallTypeFitForTreeBack WallTest; - public ushort SaplingTileType; - - public delegate bool IsTileFitForTreeGroundTest(int tileType); - - public delegate bool IsWallTypeFitForTreeBack(int wallType); - - public static class Profiles - { - public static WorldGen.GrowTreeSettings GemTree_Ruby = new WorldGen.GrowTreeSettings() - { - GroundTest = new WorldGen.GrowTreeSettings.IsTileFitForTreeGroundTest(WorldGen.GemTreeGroundTest), - WallTest = new WorldGen.GrowTreeSettings.IsWallTypeFitForTreeBack(WorldGen.GemTreeWallTest), - TreeHeightMax = 12, - TreeHeightMin = 7, - TreeTileType = 587, - TreeTopPaddingNeeded = 4, - SaplingTileType = 590 - }; - public static WorldGen.GrowTreeSettings GemTree_Diamond = new WorldGen.GrowTreeSettings() - { - GroundTest = new WorldGen.GrowTreeSettings.IsTileFitForTreeGroundTest(WorldGen.GemTreeGroundTest), - WallTest = new WorldGen.GrowTreeSettings.IsWallTypeFitForTreeBack(WorldGen.GemTreeWallTest), - TreeHeightMax = 12, - TreeHeightMin = 7, - TreeTileType = 588, - TreeTopPaddingNeeded = 4, - SaplingTileType = 590 - }; - public static WorldGen.GrowTreeSettings GemTree_Topaz = new WorldGen.GrowTreeSettings() - { - GroundTest = new WorldGen.GrowTreeSettings.IsTileFitForTreeGroundTest(WorldGen.GemTreeGroundTest), - WallTest = new WorldGen.GrowTreeSettings.IsWallTypeFitForTreeBack(WorldGen.GemTreeWallTest), - TreeHeightMax = 12, - TreeHeightMin = 7, - TreeTileType = 583, - TreeTopPaddingNeeded = 4, - SaplingTileType = 590 - }; - public static WorldGen.GrowTreeSettings GemTree_Amethyst = new WorldGen.GrowTreeSettings() - { - GroundTest = new WorldGen.GrowTreeSettings.IsTileFitForTreeGroundTest(WorldGen.GemTreeGroundTest), - WallTest = new WorldGen.GrowTreeSettings.IsWallTypeFitForTreeBack(WorldGen.GemTreeWallTest), - TreeHeightMax = 12, - TreeHeightMin = 7, - TreeTileType = 584, - TreeTopPaddingNeeded = 4, - SaplingTileType = 590 - }; - public static WorldGen.GrowTreeSettings GemTree_Sappphire = new WorldGen.GrowTreeSettings() - { - GroundTest = new WorldGen.GrowTreeSettings.IsTileFitForTreeGroundTest(WorldGen.GemTreeGroundTest), - WallTest = new WorldGen.GrowTreeSettings.IsWallTypeFitForTreeBack(WorldGen.GemTreeWallTest), - TreeHeightMax = 12, - TreeHeightMin = 7, - TreeTileType = 585, - TreeTopPaddingNeeded = 4, - SaplingTileType = 590 - }; - public static WorldGen.GrowTreeSettings GemTree_Emerald = new WorldGen.GrowTreeSettings() - { - GroundTest = new WorldGen.GrowTreeSettings.IsTileFitForTreeGroundTest(WorldGen.GemTreeGroundTest), - WallTest = new WorldGen.GrowTreeSettings.IsWallTypeFitForTreeBack(WorldGen.GemTreeWallTest), - TreeHeightMax = 12, - TreeHeightMin = 7, - TreeTileType = 586, - TreeTopPaddingNeeded = 4, - SaplingTileType = 590 - }; - public static WorldGen.GrowTreeSettings GemTree_Amber = new WorldGen.GrowTreeSettings() - { - GroundTest = new WorldGen.GrowTreeSettings.IsTileFitForTreeGroundTest(WorldGen.GemTreeGroundTest), - WallTest = new WorldGen.GrowTreeSettings.IsWallTypeFitForTreeBack(WorldGen.GemTreeWallTest), - TreeHeightMax = 12, - TreeHeightMin = 7, - TreeTileType = 589, - TreeTopPaddingNeeded = 4, - SaplingTileType = 590 - }; - public static WorldGen.GrowTreeSettings VanityTree_Sakura = new WorldGen.GrowTreeSettings() - { - GroundTest = new WorldGen.GrowTreeSettings.IsTileFitForTreeGroundTest(WorldGen.VanityTreeGroundTest), - WallTest = new WorldGen.GrowTreeSettings.IsWallTypeFitForTreeBack(WorldGen.DefaultTreeWallTest), - TreeHeightMax = 12, - TreeHeightMin = 7, - TreeTileType = 596, - TreeTopPaddingNeeded = 4, - SaplingTileType = 595 - }; - public static WorldGen.GrowTreeSettings VanityTree_Willow = new WorldGen.GrowTreeSettings() - { - GroundTest = new WorldGen.GrowTreeSettings.IsTileFitForTreeGroundTest(WorldGen.VanityTreeGroundTest), - WallTest = new WorldGen.GrowTreeSettings.IsWallTypeFitForTreeBack(WorldGen.DefaultTreeWallTest), - TreeHeightMax = 12, - TreeHeightMin = 7, - TreeTileType = 616, - TreeTopPaddingNeeded = 4, - SaplingTileType = 615 - }; - - public static bool TryGetFromItemId(int itemType, out WorldGen.GrowTreeSettings profile) - { - switch (itemType) - { - case 4851: - profile = WorldGen.GrowTreeSettings.Profiles.GemTree_Topaz; - return true; - case 4852: - profile = WorldGen.GrowTreeSettings.Profiles.GemTree_Amethyst; - return true; - case 4853: - profile = WorldGen.GrowTreeSettings.Profiles.GemTree_Sappphire; - return true; - case 4854: - profile = WorldGen.GrowTreeSettings.Profiles.GemTree_Emerald; - return true; - case 4855: - profile = WorldGen.GrowTreeSettings.Profiles.GemTree_Ruby; - return true; - case 4856: - profile = WorldGen.GrowTreeSettings.Profiles.GemTree_Diamond; - return true; - case 4857: - profile = WorldGen.GrowTreeSettings.Profiles.GemTree_Amber; - return true; - case 4871: - profile = WorldGen.GrowTreeSettings.Profiles.VanityTree_Sakura; - return true; - case 4907: - profile = WorldGen.GrowTreeSettings.Profiles.VanityTree_Willow; - return true; - default: - profile = new WorldGen.GrowTreeSettings(); - return false; - } - } - } - } - - public struct CheckTreeSettings - { - public WorldGen.CheckTreeSettings.GroundValidTest IsGroundValid; - - public delegate bool GroundValidTest(int groundTileType); - } - - public enum SpecialKillTileContext - { - None, - MowingTheGrass, - } - - public delegate bool GetTreeFoliageDataMethod( - int i, - int j, - int xoffset, - ref int treeFrame, - ref int treeStyle, - out int floorY, - out int topTextureFrameWidth, - out int topTextureFrameHeight); } } diff --git a/WorldSections.cs b/WorldSections.cs index f48e310..67768ef 100644 --- a/WorldSections.cs +++ b/WorldSections.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.WorldSections -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe using Microsoft.Xna.Framework; diff --git a/ZoomContext.cs b/ZoomContext.cs index b16afee..e6d9519 100644 --- a/ZoomContext.cs +++ b/ZoomContext.cs @@ -1,7 +1,7 @@ // Decompiled with JetBrains decompiler // Type: Terraria.ZoomContext -// Assembly: Terraria, Version=1.4.0.5, Culture=neutral, PublicKeyToken=null -// MVID: 67F9E73E-0A81-4937-A22C-5515CD405A83 +// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null +// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08 // Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe namespace Terraria